diff --git a/Makefile b/Makefile index 3c686d00b..c510428fc 100644 --- a/Makefile +++ b/Makefile @@ -214,7 +214,7 @@ gen-c: cd $(SWIFTNAV_ROOT)/c; \ mkdir -p build.docker/ && cd build.docker/; \ cmake $(CMAKEFLAGS) ../; \ - #$(MAKE) clang-format-all + $(MAKE) clang-format-all $(call announce-end,"Finished formatting C code") diff --git a/c/include/libsbp/acquisition.h b/c/include/libsbp/acquisition.h index fddb34571..897cef91f 100644 --- a/c/include/libsbp/acquisition.h +++ b/c/include/libsbp/acquisition.h @@ -17,12 +17,12 @@ #ifndef LIBSBP_ACQUISITION_MESSAGES_H #define LIBSBP_ACQUISITION_MESSAGES_H -#include -#include -#include -#include #include #include +#include +#include +#include +#include #include #include diff --git a/c/include/libsbp/acquisition/AcqSvProfile.h b/c/include/libsbp/acquisition/AcqSvProfile.h index 573f6adea..51d9872cc 100644 --- a/c/include/libsbp/acquisition/AcqSvProfile.h +++ b/c/include/libsbp/acquisition/AcqSvProfile.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_ACQUISITION_ACQSVPROFILE_H #define LIBSBP_ACQUISITION_ACQSVPROFILE_H +#include +#include #include #include -#include -#include #include -#include +#include -#include -#include #include +#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,93 +41,80 @@ *****************************************************************************/ /** Acq perfomance measurement and debug * -* Profile for a specific SV for debugging purposes. The message describes SV profile during acquisition time. The message is used to debug and measure the performance. + * Profile for a specific SV for debugging purposes. The message describes SV + * profile during acquisition time. The message is used to debug and measure the + * performance. */ typedef struct { - - /** -* SV search job type (deep, fallback, etc) + * SV search job type (deep, fallback, etc) */ u8 job_type; - /** -* Acquisition status 1 is Success, 0 is Failure + * Acquisition status 1 is Success, 0 is Failure */ u8 status; - /** -* CN0 value. Only valid if status is '1' [dB-Hz*10] + * CN0 value. Only valid if status is '1' [dB-Hz*10] */ u16 cn0; - /** -* Acquisition integration time [ms] + * Acquisition integration time [ms] */ u8 int_time; - /** -* GNSS signal for which acquisition was attempted + * GNSS signal for which acquisition was attempted */ sbp_v4_gnss_signal_t sid; - /** -* Acq frequency bin width [Hz] + * Acq frequency bin width [Hz] */ u16 bin_width; - /** -* Timestamp of the job complete event [ms] + * Timestamp of the job complete event [ms] */ u32 timestamp; - /** -* Time spent to search for sid.code [us] + * Time spent to search for sid.code [us] */ u32 time_spent; - /** -* Doppler range lowest frequency [Hz] + * Doppler range lowest frequency [Hz] */ s32 cf_min; - /** -* Doppler range highest frequency [Hz] + * Doppler range highest frequency [Hz] */ s32 cf_max; - /** -* Doppler value of detected peak. Only valid if status is '1' [Hz] + * Doppler value of detected peak. Only valid if status is '1' [Hz] */ s32 cf; - /** -* Codephase of detected peak. Only valid if status is '1' [chips*10] + * Codephase of detected peak. Only valid if status is '1' [chips*10] */ u32 cp; } sbp_acq_sv_profile_t; - - /** * Get encoded size of an instance of sbp_acq_sv_profile_t * * @param msg sbp_acq_sv_profile_t instance * @return Length of on-wire representation */ -static inline size_t sbp_acq_sv_profile_encoded_len(const sbp_acq_sv_profile_t *msg) -{ +static inline size_t sbp_acq_sv_profile_encoded_len( + const sbp_acq_sv_profile_t *msg) { (void)msg; return SBP_ACQ_SV_PROFILE_ENCODED_LEN; } @@ -135,74 +122,96 @@ static inline size_t sbp_acq_sv_profile_encoded_len(const sbp_acq_sv_profile_t * /** * Encode an instance of sbp_acq_sv_profile_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_acq_sv_profile_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_acq_sv_profile_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_acq_sv_profile_t *msg); +SBP_EXPORT s8 sbp_acq_sv_profile_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_acq_sv_profile_t *msg); /** * Decode an instance of sbp_acq_sv_profile_t from wire representation * - * This function decodes the wire representation of a sbp_acq_sv_profile_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_acq_sv_profile_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_acq_sv_profile_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_acq_sv_profile_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_acq_sv_profile_t *msg); +SBP_EXPORT s8 sbp_acq_sv_profile_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_acq_sv_profile_t *msg); /** * Compare two instances of sbp_acq_sv_profile_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_acq_sv_profile_t instance * @param b sbp_acq_sv_profile_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_acq_sv_profile_cmp(const sbp_acq_sv_profile_t *a, const sbp_acq_sv_profile_t *b); +SBP_EXPORT int sbp_acq_sv_profile_cmp(const sbp_acq_sv_profile_t *a, + const sbp_acq_sv_profile_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_acq_sv_profile_t &lhs, const sbp_acq_sv_profile_t &rhs) { +static inline bool operator==(const sbp_acq_sv_profile_t &lhs, + const sbp_acq_sv_profile_t &rhs) { return sbp_acq_sv_profile_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_acq_sv_profile_t &lhs, const sbp_acq_sv_profile_t &rhs) { +static inline bool operator!=(const sbp_acq_sv_profile_t &lhs, + const sbp_acq_sv_profile_t &rhs) { return sbp_acq_sv_profile_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_acq_sv_profile_t &lhs, const sbp_acq_sv_profile_t &rhs) { +static inline bool operator<(const sbp_acq_sv_profile_t &lhs, + const sbp_acq_sv_profile_t &rhs) { return sbp_acq_sv_profile_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_acq_sv_profile_t &lhs, const sbp_acq_sv_profile_t &rhs) { +static inline bool operator<=(const sbp_acq_sv_profile_t &lhs, + const sbp_acq_sv_profile_t &rhs) { return sbp_acq_sv_profile_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_acq_sv_profile_t &lhs, const sbp_acq_sv_profile_t &rhs) { +static inline bool operator>(const sbp_acq_sv_profile_t &lhs, + const sbp_acq_sv_profile_t &rhs) { return sbp_acq_sv_profile_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_acq_sv_profile_t &lhs, const sbp_acq_sv_profile_t &rhs) { +static inline bool operator>=(const sbp_acq_sv_profile_t &lhs, + const sbp_acq_sv_profile_t &rhs) { return sbp_acq_sv_profile_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_ACQUISITION_ACQSVPROFILE_H */ - diff --git a/c/include/libsbp/acquisition/AcqSvProfileDep.h b/c/include/libsbp/acquisition/AcqSvProfileDep.h index 0fc58e3ab..702ac64b0 100644 --- a/c/include/libsbp/acquisition/AcqSvProfileDep.h +++ b/c/include/libsbp/acquisition/AcqSvProfileDep.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_ACQUISITION_ACQSVPROFILEDEP_H #define LIBSBP_ACQUISITION_ACQSVPROFILEDEP_H +#include +#include #include #include -#include -#include #include -#include +#include -#include -#include #include +#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,93 +41,78 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* SV search job type (deep, fallback, etc) + * SV search job type (deep, fallback, etc) */ u8 job_type; - /** -* Acquisition status 1 is Success, 0 is Failure + * Acquisition status 1 is Success, 0 is Failure */ u8 status; - /** -* CN0 value. Only valid if status is '1' [dB-Hz*10] + * CN0 value. Only valid if status is '1' [dB-Hz*10] */ u16 cn0; - /** -* Acquisition integration time [ms] + * Acquisition integration time [ms] */ u8 int_time; - /** -* GNSS signal for which acquisition was attempted + * GNSS signal for which acquisition was attempted */ sbp_gnss_signal_dep_t sid; - /** -* Acq frequency bin width [Hz] + * Acq frequency bin width [Hz] */ u16 bin_width; - /** -* Timestamp of the job complete event [ms] + * Timestamp of the job complete event [ms] */ u32 timestamp; - /** -* Time spent to search for sid.code [us] + * Time spent to search for sid.code [us] */ u32 time_spent; - /** -* Doppler range lowest frequency [Hz] + * Doppler range lowest frequency [Hz] */ s32 cf_min; - /** -* Doppler range highest frequency [Hz] + * Doppler range highest frequency [Hz] */ s32 cf_max; - /** -* Doppler value of detected peak. Only valid if status is '1' [Hz] + * Doppler value of detected peak. Only valid if status is '1' [Hz] */ s32 cf; - /** -* Codephase of detected peak. Only valid if status is '1' [chips*10] + * Codephase of detected peak. Only valid if status is '1' [chips*10] */ u32 cp; } sbp_acq_sv_profile_dep_t; - - /** * Get encoded size of an instance of sbp_acq_sv_profile_dep_t * * @param msg sbp_acq_sv_profile_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_acq_sv_profile_dep_encoded_len(const sbp_acq_sv_profile_dep_t *msg) -{ +static inline size_t sbp_acq_sv_profile_dep_encoded_len( + const sbp_acq_sv_profile_dep_t *msg) { (void)msg; return SBP_ACQ_SV_PROFILE_DEP_ENCODED_LEN; } @@ -135,74 +120,96 @@ static inline size_t sbp_acq_sv_profile_dep_encoded_len(const sbp_acq_sv_profile /** * Encode an instance of sbp_acq_sv_profile_dep_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_acq_sv_profile_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_acq_sv_profile_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_acq_sv_profile_dep_t *msg); +SBP_EXPORT s8 +sbp_acq_sv_profile_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_acq_sv_profile_dep_t *msg); /** * Decode an instance of sbp_acq_sv_profile_dep_t from wire representation * - * This function decodes the wire representation of a sbp_acq_sv_profile_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_acq_sv_profile_dep_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_acq_sv_profile_dep_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_acq_sv_profile_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_acq_sv_profile_dep_t *msg); +SBP_EXPORT s8 sbp_acq_sv_profile_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_acq_sv_profile_dep_t *msg); /** * Compare two instances of sbp_acq_sv_profile_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_acq_sv_profile_dep_t instance * @param b sbp_acq_sv_profile_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_acq_sv_profile_dep_cmp(const sbp_acq_sv_profile_dep_t *a, const sbp_acq_sv_profile_dep_t *b); +SBP_EXPORT int sbp_acq_sv_profile_dep_cmp(const sbp_acq_sv_profile_dep_t *a, + const sbp_acq_sv_profile_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_acq_sv_profile_dep_t &lhs, const sbp_acq_sv_profile_dep_t &rhs) { +static inline bool operator==(const sbp_acq_sv_profile_dep_t &lhs, + const sbp_acq_sv_profile_dep_t &rhs) { return sbp_acq_sv_profile_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_acq_sv_profile_dep_t &lhs, const sbp_acq_sv_profile_dep_t &rhs) { +static inline bool operator!=(const sbp_acq_sv_profile_dep_t &lhs, + const sbp_acq_sv_profile_dep_t &rhs) { return sbp_acq_sv_profile_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_acq_sv_profile_dep_t &lhs, const sbp_acq_sv_profile_dep_t &rhs) { +static inline bool operator<(const sbp_acq_sv_profile_dep_t &lhs, + const sbp_acq_sv_profile_dep_t &rhs) { return sbp_acq_sv_profile_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_acq_sv_profile_dep_t &lhs, const sbp_acq_sv_profile_dep_t &rhs) { +static inline bool operator<=(const sbp_acq_sv_profile_dep_t &lhs, + const sbp_acq_sv_profile_dep_t &rhs) { return sbp_acq_sv_profile_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_acq_sv_profile_dep_t &lhs, const sbp_acq_sv_profile_dep_t &rhs) { +static inline bool operator>(const sbp_acq_sv_profile_dep_t &lhs, + const sbp_acq_sv_profile_dep_t &rhs) { return sbp_acq_sv_profile_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_acq_sv_profile_dep_t &lhs, const sbp_acq_sv_profile_dep_t &rhs) { +static inline bool operator>=(const sbp_acq_sv_profile_dep_t &lhs, + const sbp_acq_sv_profile_dep_t &rhs) { return sbp_acq_sv_profile_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_ACQUISITION_ACQSVPROFILEDEP_H */ - diff --git a/c/include/libsbp/acquisition/MSG_ACQ_RESULT.h b/c/include/libsbp/acquisition/MSG_ACQ_RESULT.h index 1cb1e3c35..b213092c5 100644 --- a/c/include/libsbp/acquisition/MSG_ACQ_RESULT.h +++ b/c/include/libsbp/acquisition/MSG_ACQ_RESULT.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_ACQUISITION_MSG_ACQ_RESULT_H #define LIBSBP_ACQUISITION_MSG_ACQ_RESULT_H +#include +#include #include #include -#include -#include #include -#include +#include -#include -#include #include +#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,45 +41,41 @@ *****************************************************************************/ /** Satellite acquisition result * -* This message describes the results from an attempted GPS signal acquisition search for a satellite PRN over a code phase/carrier frequency range. It contains the parameters of the point in the acquisition search space with the best carrier-to-noise (CN/0) ratio. + * This message describes the results from an attempted GPS signal acquisition + * search for a satellite PRN over a code phase/carrier frequency range. It + * contains the parameters of the point in the acquisition search space with the + * best carrier-to-noise (CN/0) ratio. */ typedef struct { - - /** -* CN/0 of best point [dB Hz] + * CN/0 of best point [dB Hz] */ float cn0; - /** -* Code phase of best point [chips] + * Code phase of best point [chips] */ float cp; - /** -* Carrier frequency of best point [hz] + * Carrier frequency of best point [hz] */ float cf; - /** -* GNSS signal for which acquisition was attempted + * GNSS signal for which acquisition was attempted */ sbp_v4_gnss_signal_t sid; } sbp_msg_acq_result_t; - - /** * Get encoded size of an instance of sbp_msg_acq_result_t * * @param msg sbp_msg_acq_result_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_acq_result_encoded_len(const sbp_msg_acq_result_t *msg) -{ +static inline size_t sbp_msg_acq_result_encoded_len( + const sbp_msg_acq_result_t *msg) { (void)msg; return SBP_MSG_ACQ_RESULT_ENCODED_LEN; } @@ -87,36 +83,53 @@ static inline size_t sbp_msg_acq_result_encoded_len(const sbp_msg_acq_result_t * /** * Encode an instance of sbp_msg_acq_result_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_acq_result_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_result_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_result_t *msg); +SBP_EXPORT s8 sbp_msg_acq_result_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_acq_result_t *msg); /** * Decode an instance of sbp_msg_acq_result_t from wire representation * - * This function decodes the wire representation of a sbp_msg_acq_result_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_acq_result_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_acq_result_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_result_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_result_t *msg); +SBP_EXPORT s8 sbp_msg_acq_result_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_acq_result_t *msg); /** * Send an instance of sbp_msg_acq_result_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_acq_result_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_acq_result_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -124,51 +137,61 @@ SBP_EXPORT s8 sbp_msg_acq_result_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_result_send(sbp_state_t *s, u16 sender_id, const sbp_msg_acq_result_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_acq_result_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_acq_result_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_acq_result_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_acq_result_t instance * @param b sbp_msg_acq_result_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_acq_result_cmp(const sbp_msg_acq_result_t *a, const sbp_msg_acq_result_t *b); +SBP_EXPORT int sbp_msg_acq_result_cmp(const sbp_msg_acq_result_t *a, + const sbp_msg_acq_result_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_acq_result_t &lhs, const sbp_msg_acq_result_t &rhs) { +static inline bool operator==(const sbp_msg_acq_result_t &lhs, + const sbp_msg_acq_result_t &rhs) { return sbp_msg_acq_result_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_acq_result_t &lhs, const sbp_msg_acq_result_t &rhs) { +static inline bool operator!=(const sbp_msg_acq_result_t &lhs, + const sbp_msg_acq_result_t &rhs) { return sbp_msg_acq_result_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_acq_result_t &lhs, const sbp_msg_acq_result_t &rhs) { +static inline bool operator<(const sbp_msg_acq_result_t &lhs, + const sbp_msg_acq_result_t &rhs) { return sbp_msg_acq_result_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_acq_result_t &lhs, const sbp_msg_acq_result_t &rhs) { +static inline bool operator<=(const sbp_msg_acq_result_t &lhs, + const sbp_msg_acq_result_t &rhs) { return sbp_msg_acq_result_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_acq_result_t &lhs, const sbp_msg_acq_result_t &rhs) { +static inline bool operator>(const sbp_msg_acq_result_t &lhs, + const sbp_msg_acq_result_t &rhs) { return sbp_msg_acq_result_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_acq_result_t &lhs, const sbp_msg_acq_result_t &rhs) { +static inline bool operator>=(const sbp_msg_acq_result_t &lhs, + const sbp_msg_acq_result_t &rhs) { return sbp_msg_acq_result_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_ACQUISITION_MSG_ACQ_RESULT_H */ - diff --git a/c/include/libsbp/acquisition/MSG_ACQ_RESULT_DEP_A.h b/c/include/libsbp/acquisition/MSG_ACQ_RESULT_DEP_A.h index 7c0e17866..c6a493db7 100644 --- a/c/include/libsbp/acquisition/MSG_ACQ_RESULT_DEP_A.h +++ b/c/include/libsbp/acquisition/MSG_ACQ_RESULT_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_ACQUISITION_MSG_ACQ_RESULT_DEP_A_H #define LIBSBP_ACQUISITION_MSG_ACQ_RESULT_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include +#include #include #include -#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,45 +40,40 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** - * SNR of best point. Currently dimensionless, but will have units of dB Hz in the revision of this message. + * SNR of best point. Currently dimensionless, but will have units of dB Hz in + * the revision of this message. */ float snr; - /** -* Code phase of best point [chips] + * Code phase of best point [chips] */ float cp; - /** -* Carrier frequency of best point [hz] + * Carrier frequency of best point [hz] */ float cf; - /** - * PRN-1 identifier of the satellite signal for which acquisition was attempted + * PRN-1 identifier of the satellite signal for which acquisition was + * attempted */ u8 prn; } sbp_msg_acq_result_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_acq_result_dep_a_t * * @param msg sbp_msg_acq_result_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_acq_result_dep_a_encoded_len(const sbp_msg_acq_result_dep_a_t *msg) -{ +static inline size_t sbp_msg_acq_result_dep_a_encoded_len( + const sbp_msg_acq_result_dep_a_t *msg) { (void)msg; return SBP_MSG_ACQ_RESULT_DEP_A_ENCODED_LEN; } @@ -86,36 +81,53 @@ static inline size_t sbp_msg_acq_result_dep_a_encoded_len(const sbp_msg_acq_resu /** * Encode an instance of sbp_msg_acq_result_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_acq_result_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_result_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_result_dep_a_t *msg); +SBP_EXPORT s8 +sbp_msg_acq_result_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_acq_result_dep_a_t *msg); /** * Decode an instance of sbp_msg_acq_result_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_acq_result_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_acq_result_dep_a_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_acq_result_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_result_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_result_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_acq_result_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_acq_result_dep_a_t *msg); /** * Send an instance of sbp_msg_acq_result_dep_a_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_acq_result_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_acq_result_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -123,51 +135,61 @@ SBP_EXPORT s8 sbp_msg_acq_result_dep_a_decode(const uint8_t *buf, uint8_t len, u * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_result_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_acq_result_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_acq_result_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_acq_result_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_acq_result_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_acq_result_dep_a_t instance * @param b sbp_msg_acq_result_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_acq_result_dep_a_cmp(const sbp_msg_acq_result_dep_a_t *a, const sbp_msg_acq_result_dep_a_t *b); +SBP_EXPORT int sbp_msg_acq_result_dep_a_cmp( + const sbp_msg_acq_result_dep_a_t *a, const sbp_msg_acq_result_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_acq_result_dep_a_t &lhs, const sbp_msg_acq_result_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_acq_result_dep_a_t &lhs, + const sbp_msg_acq_result_dep_a_t &rhs) { return sbp_msg_acq_result_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_acq_result_dep_a_t &lhs, const sbp_msg_acq_result_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_acq_result_dep_a_t &lhs, + const sbp_msg_acq_result_dep_a_t &rhs) { return sbp_msg_acq_result_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_acq_result_dep_a_t &lhs, const sbp_msg_acq_result_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_acq_result_dep_a_t &lhs, + const sbp_msg_acq_result_dep_a_t &rhs) { return sbp_msg_acq_result_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_acq_result_dep_a_t &lhs, const sbp_msg_acq_result_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_acq_result_dep_a_t &lhs, + const sbp_msg_acq_result_dep_a_t &rhs) { return sbp_msg_acq_result_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_acq_result_dep_a_t &lhs, const sbp_msg_acq_result_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_acq_result_dep_a_t &lhs, + const sbp_msg_acq_result_dep_a_t &rhs) { return sbp_msg_acq_result_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_acq_result_dep_a_t &lhs, const sbp_msg_acq_result_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_acq_result_dep_a_t &lhs, + const sbp_msg_acq_result_dep_a_t &rhs) { return sbp_msg_acq_result_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_ACQUISITION_MSG_ACQ_RESULT_DEP_A_H */ - diff --git a/c/include/libsbp/acquisition/MSG_ACQ_RESULT_DEP_B.h b/c/include/libsbp/acquisition/MSG_ACQ_RESULT_DEP_B.h index 81f209d83..4f98cbcfb 100644 --- a/c/include/libsbp/acquisition/MSG_ACQ_RESULT_DEP_B.h +++ b/c/include/libsbp/acquisition/MSG_ACQ_RESULT_DEP_B.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_ACQUISITION_MSG_ACQ_RESULT_DEP_B_H #define LIBSBP_ACQUISITION_MSG_ACQ_RESULT_DEP_B_H +#include +#include #include #include -#include -#include #include -#include +#include -#include -#include #include +#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,45 +41,39 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** - * SNR of best point. Currently in arbitrary SNR points, but will be in units of dB Hz in a later revision of this message. + * SNR of best point. Currently in arbitrary SNR points, but will be in units + * of dB Hz in a later revision of this message. */ float snr; - /** -* Code phase of best point [chips] + * Code phase of best point [chips] */ float cp; - /** -* Carrier frequency of best point [hz] + * Carrier frequency of best point [hz] */ float cf; - /** -* GNSS signal for which acquisition was attempted + * GNSS signal for which acquisition was attempted */ sbp_gnss_signal_dep_t sid; } sbp_msg_acq_result_dep_b_t; - - /** * Get encoded size of an instance of sbp_msg_acq_result_dep_b_t * * @param msg sbp_msg_acq_result_dep_b_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_acq_result_dep_b_encoded_len(const sbp_msg_acq_result_dep_b_t *msg) -{ +static inline size_t sbp_msg_acq_result_dep_b_encoded_len( + const sbp_msg_acq_result_dep_b_t *msg) { (void)msg; return SBP_MSG_ACQ_RESULT_DEP_B_ENCODED_LEN; } @@ -87,36 +81,53 @@ static inline size_t sbp_msg_acq_result_dep_b_encoded_len(const sbp_msg_acq_resu /** * Encode an instance of sbp_msg_acq_result_dep_b_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_acq_result_dep_b_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_result_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_result_dep_b_t *msg); +SBP_EXPORT s8 +sbp_msg_acq_result_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_acq_result_dep_b_t *msg); /** * Decode an instance of sbp_msg_acq_result_dep_b_t from wire representation * - * This function decodes the wire representation of a sbp_msg_acq_result_dep_b_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_acq_result_dep_b_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_acq_result_dep_b_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_result_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_result_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_acq_result_dep_b_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_acq_result_dep_b_t *msg); /** * Send an instance of sbp_msg_acq_result_dep_b_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_acq_result_dep_b_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_acq_result_dep_b_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -124,51 +135,61 @@ SBP_EXPORT s8 sbp_msg_acq_result_dep_b_decode(const uint8_t *buf, uint8_t len, u * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_result_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_acq_result_dep_b_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_acq_result_dep_b_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_acq_result_dep_b_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_acq_result_dep_b_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_acq_result_dep_b_t instance * @param b sbp_msg_acq_result_dep_b_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_acq_result_dep_b_cmp(const sbp_msg_acq_result_dep_b_t *a, const sbp_msg_acq_result_dep_b_t *b); +SBP_EXPORT int sbp_msg_acq_result_dep_b_cmp( + const sbp_msg_acq_result_dep_b_t *a, const sbp_msg_acq_result_dep_b_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_acq_result_dep_b_t &lhs, const sbp_msg_acq_result_dep_b_t &rhs) { +static inline bool operator==(const sbp_msg_acq_result_dep_b_t &lhs, + const sbp_msg_acq_result_dep_b_t &rhs) { return sbp_msg_acq_result_dep_b_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_acq_result_dep_b_t &lhs, const sbp_msg_acq_result_dep_b_t &rhs) { +static inline bool operator!=(const sbp_msg_acq_result_dep_b_t &lhs, + const sbp_msg_acq_result_dep_b_t &rhs) { return sbp_msg_acq_result_dep_b_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_acq_result_dep_b_t &lhs, const sbp_msg_acq_result_dep_b_t &rhs) { +static inline bool operator<(const sbp_msg_acq_result_dep_b_t &lhs, + const sbp_msg_acq_result_dep_b_t &rhs) { return sbp_msg_acq_result_dep_b_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_acq_result_dep_b_t &lhs, const sbp_msg_acq_result_dep_b_t &rhs) { +static inline bool operator<=(const sbp_msg_acq_result_dep_b_t &lhs, + const sbp_msg_acq_result_dep_b_t &rhs) { return sbp_msg_acq_result_dep_b_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_acq_result_dep_b_t &lhs, const sbp_msg_acq_result_dep_b_t &rhs) { +static inline bool operator>(const sbp_msg_acq_result_dep_b_t &lhs, + const sbp_msg_acq_result_dep_b_t &rhs) { return sbp_msg_acq_result_dep_b_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_acq_result_dep_b_t &lhs, const sbp_msg_acq_result_dep_b_t &rhs) { +static inline bool operator>=(const sbp_msg_acq_result_dep_b_t &lhs, + const sbp_msg_acq_result_dep_b_t &rhs) { return sbp_msg_acq_result_dep_b_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_ACQUISITION_MSG_ACQ_RESULT_DEP_B_H */ - diff --git a/c/include/libsbp/acquisition/MSG_ACQ_RESULT_DEP_C.h b/c/include/libsbp/acquisition/MSG_ACQ_RESULT_DEP_C.h index 4500a6ce0..562a71d67 100644 --- a/c/include/libsbp/acquisition/MSG_ACQ_RESULT_DEP_C.h +++ b/c/include/libsbp/acquisition/MSG_ACQ_RESULT_DEP_C.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_ACQUISITION_MSG_ACQ_RESULT_DEP_C_H #define LIBSBP_ACQUISITION_MSG_ACQ_RESULT_DEP_C_H +#include +#include #include #include -#include -#include #include -#include +#include -#include -#include #include +#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,45 +41,38 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* CN/0 of best point [dB Hz] + * CN/0 of best point [dB Hz] */ float cn0; - /** -* Code phase of best point [chips] + * Code phase of best point [chips] */ float cp; - /** -* Carrier frequency of best point [hz] + * Carrier frequency of best point [hz] */ float cf; - /** -* GNSS signal for which acquisition was attempted + * GNSS signal for which acquisition was attempted */ sbp_gnss_signal_dep_t sid; } sbp_msg_acq_result_dep_c_t; - - /** * Get encoded size of an instance of sbp_msg_acq_result_dep_c_t * * @param msg sbp_msg_acq_result_dep_c_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_acq_result_dep_c_encoded_len(const sbp_msg_acq_result_dep_c_t *msg) -{ +static inline size_t sbp_msg_acq_result_dep_c_encoded_len( + const sbp_msg_acq_result_dep_c_t *msg) { (void)msg; return SBP_MSG_ACQ_RESULT_DEP_C_ENCODED_LEN; } @@ -87,36 +80,53 @@ static inline size_t sbp_msg_acq_result_dep_c_encoded_len(const sbp_msg_acq_resu /** * Encode an instance of sbp_msg_acq_result_dep_c_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_acq_result_dep_c_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_result_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_result_dep_c_t *msg); +SBP_EXPORT s8 +sbp_msg_acq_result_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_acq_result_dep_c_t *msg); /** * Decode an instance of sbp_msg_acq_result_dep_c_t from wire representation * - * This function decodes the wire representation of a sbp_msg_acq_result_dep_c_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_acq_result_dep_c_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_acq_result_dep_c_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_result_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_result_dep_c_t *msg); +SBP_EXPORT s8 sbp_msg_acq_result_dep_c_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_acq_result_dep_c_t *msg); /** * Send an instance of sbp_msg_acq_result_dep_c_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_acq_result_dep_c_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_acq_result_dep_c_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -124,51 +134,61 @@ SBP_EXPORT s8 sbp_msg_acq_result_dep_c_decode(const uint8_t *buf, uint8_t len, u * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_result_dep_c_send(sbp_state_t *s, u16 sender_id, const sbp_msg_acq_result_dep_c_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_acq_result_dep_c_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_acq_result_dep_c_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_acq_result_dep_c_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_acq_result_dep_c_t instance * @param b sbp_msg_acq_result_dep_c_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_acq_result_dep_c_cmp(const sbp_msg_acq_result_dep_c_t *a, const sbp_msg_acq_result_dep_c_t *b); +SBP_EXPORT int sbp_msg_acq_result_dep_c_cmp( + const sbp_msg_acq_result_dep_c_t *a, const sbp_msg_acq_result_dep_c_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_acq_result_dep_c_t &lhs, const sbp_msg_acq_result_dep_c_t &rhs) { +static inline bool operator==(const sbp_msg_acq_result_dep_c_t &lhs, + const sbp_msg_acq_result_dep_c_t &rhs) { return sbp_msg_acq_result_dep_c_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_acq_result_dep_c_t &lhs, const sbp_msg_acq_result_dep_c_t &rhs) { +static inline bool operator!=(const sbp_msg_acq_result_dep_c_t &lhs, + const sbp_msg_acq_result_dep_c_t &rhs) { return sbp_msg_acq_result_dep_c_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_acq_result_dep_c_t &lhs, const sbp_msg_acq_result_dep_c_t &rhs) { +static inline bool operator<(const sbp_msg_acq_result_dep_c_t &lhs, + const sbp_msg_acq_result_dep_c_t &rhs) { return sbp_msg_acq_result_dep_c_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_acq_result_dep_c_t &lhs, const sbp_msg_acq_result_dep_c_t &rhs) { +static inline bool operator<=(const sbp_msg_acq_result_dep_c_t &lhs, + const sbp_msg_acq_result_dep_c_t &rhs) { return sbp_msg_acq_result_dep_c_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_acq_result_dep_c_t &lhs, const sbp_msg_acq_result_dep_c_t &rhs) { +static inline bool operator>(const sbp_msg_acq_result_dep_c_t &lhs, + const sbp_msg_acq_result_dep_c_t &rhs) { return sbp_msg_acq_result_dep_c_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_acq_result_dep_c_t &lhs, const sbp_msg_acq_result_dep_c_t &rhs) { +static inline bool operator>=(const sbp_msg_acq_result_dep_c_t &lhs, + const sbp_msg_acq_result_dep_c_t &rhs) { return sbp_msg_acq_result_dep_c_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_ACQUISITION_MSG_ACQ_RESULT_DEP_C_H */ - diff --git a/c/include/libsbp/acquisition/MSG_ACQ_SV_PROFILE.h b/c/include/libsbp/acquisition/MSG_ACQ_SV_PROFILE.h index 6121cc5fd..1d6f0a618 100644 --- a/c/include/libsbp/acquisition/MSG_ACQ_SV_PROFILE.h +++ b/c/include/libsbp/acquisition/MSG_ACQ_SV_PROFILE.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_ACQUISITION_MSG_ACQ_SV_PROFILE_H #define LIBSBP_ACQUISITION_MSG_ACQ_SV_PROFILE_H +#include +#include #include #include -#include -#include #include -#include +#include +#include +#include #include #include -#include -#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,73 +41,90 @@ *****************************************************************************/ /** Acquisition perfomance measurement and debug * -* The message describes all SV profiles during acquisition time. The message is used to debug and measure the performance. + * The message describes all SV profiles during acquisition time. The message is + * used to debug and measure the performance. */ typedef struct { - - /** -* SV profiles during acquisition time + * SV profiles during acquisition time */ - sbp_acq_sv_profile_t acq_sv_profile[SBP_MSG_ACQ_SV_PROFILE_ACQ_SV_PROFILE_MAX]; + sbp_acq_sv_profile_t + acq_sv_profile[SBP_MSG_ACQ_SV_PROFILE_ACQ_SV_PROFILE_MAX]; /** * Number of elements in acq_sv_profile * - * When sending a message fill in this field with the number elements set in acq_sv_profile before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * acq_sv_profile before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in acq_sv_profile. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * acq_sv_profile. The value of any elements beyond the index specified in + * this field is undefined */ u8 n_acq_sv_profile; } sbp_msg_acq_sv_profile_t; - - /** * Get encoded size of an instance of sbp_msg_acq_sv_profile_t * * @param msg sbp_msg_acq_sv_profile_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_acq_sv_profile_encoded_len(const sbp_msg_acq_sv_profile_t *msg) -{ - return SBP_MSG_ACQ_SV_PROFILE_ENCODED_OVERHEAD - + (msg->n_acq_sv_profile * SBP_ACQ_SV_PROFILE_ENCODED_LEN) - ; +static inline size_t sbp_msg_acq_sv_profile_encoded_len( + const sbp_msg_acq_sv_profile_t *msg) { + return SBP_MSG_ACQ_SV_PROFILE_ENCODED_OVERHEAD + + (msg->n_acq_sv_profile * SBP_ACQ_SV_PROFILE_ENCODED_LEN); } /** * Encode an instance of sbp_msg_acq_sv_profile_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_acq_sv_profile_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_sv_profile_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_sv_profile_t *msg); +SBP_EXPORT s8 +sbp_msg_acq_sv_profile_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_acq_sv_profile_t *msg); /** * Decode an instance of sbp_msg_acq_sv_profile_t from wire representation * - * This function decodes the wire representation of a sbp_msg_acq_sv_profile_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_acq_sv_profile_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_acq_sv_profile_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_sv_profile_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_sv_profile_t *msg); +SBP_EXPORT s8 sbp_msg_acq_sv_profile_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_acq_sv_profile_t *msg); /** * Send an instance of sbp_msg_acq_sv_profile_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_acq_sv_profile_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_acq_sv_profile_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -115,51 +132,61 @@ SBP_EXPORT s8 sbp_msg_acq_sv_profile_decode(const uint8_t *buf, uint8_t len, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_sv_profile_send(sbp_state_t *s, u16 sender_id, const sbp_msg_acq_sv_profile_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_acq_sv_profile_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_acq_sv_profile_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_acq_sv_profile_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_acq_sv_profile_t instance * @param b sbp_msg_acq_sv_profile_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_acq_sv_profile_cmp(const sbp_msg_acq_sv_profile_t *a, const sbp_msg_acq_sv_profile_t *b); +SBP_EXPORT int sbp_msg_acq_sv_profile_cmp(const sbp_msg_acq_sv_profile_t *a, + const sbp_msg_acq_sv_profile_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_acq_sv_profile_t &lhs, const sbp_msg_acq_sv_profile_t &rhs) { +static inline bool operator==(const sbp_msg_acq_sv_profile_t &lhs, + const sbp_msg_acq_sv_profile_t &rhs) { return sbp_msg_acq_sv_profile_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_acq_sv_profile_t &lhs, const sbp_msg_acq_sv_profile_t &rhs) { +static inline bool operator!=(const sbp_msg_acq_sv_profile_t &lhs, + const sbp_msg_acq_sv_profile_t &rhs) { return sbp_msg_acq_sv_profile_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_acq_sv_profile_t &lhs, const sbp_msg_acq_sv_profile_t &rhs) { +static inline bool operator<(const sbp_msg_acq_sv_profile_t &lhs, + const sbp_msg_acq_sv_profile_t &rhs) { return sbp_msg_acq_sv_profile_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_acq_sv_profile_t &lhs, const sbp_msg_acq_sv_profile_t &rhs) { +static inline bool operator<=(const sbp_msg_acq_sv_profile_t &lhs, + const sbp_msg_acq_sv_profile_t &rhs) { return sbp_msg_acq_sv_profile_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_acq_sv_profile_t &lhs, const sbp_msg_acq_sv_profile_t &rhs) { +static inline bool operator>(const sbp_msg_acq_sv_profile_t &lhs, + const sbp_msg_acq_sv_profile_t &rhs) { return sbp_msg_acq_sv_profile_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_acq_sv_profile_t &lhs, const sbp_msg_acq_sv_profile_t &rhs) { +static inline bool operator>=(const sbp_msg_acq_sv_profile_t &lhs, + const sbp_msg_acq_sv_profile_t &rhs) { return sbp_msg_acq_sv_profile_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_ACQUISITION_MSG_ACQ_SV_PROFILE_H */ - diff --git a/c/include/libsbp/acquisition/MSG_ACQ_SV_PROFILE_DEP.h b/c/include/libsbp/acquisition/MSG_ACQ_SV_PROFILE_DEP.h index 3dbda3c8a..c72634705 100644 --- a/c/include/libsbp/acquisition/MSG_ACQ_SV_PROFILE_DEP.h +++ b/c/include/libsbp/acquisition/MSG_ACQ_SV_PROFILE_DEP.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_ACQUISITION_MSG_ACQ_SV_PROFILE_DEP_H #define LIBSBP_ACQUISITION_MSG_ACQ_SV_PROFILE_DEP_H +#include +#include #include #include -#include -#include #include -#include +#include +#include +#include #include #include -#include -#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,73 +41,90 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* SV profiles during acquisition time + * SV profiles during acquisition time */ - sbp_acq_sv_profile_dep_t acq_sv_profile[SBP_MSG_ACQ_SV_PROFILE_DEP_ACQ_SV_PROFILE_MAX]; + sbp_acq_sv_profile_dep_t + acq_sv_profile[SBP_MSG_ACQ_SV_PROFILE_DEP_ACQ_SV_PROFILE_MAX]; /** * Number of elements in acq_sv_profile * - * When sending a message fill in this field with the number elements set in acq_sv_profile before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * acq_sv_profile before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in acq_sv_profile. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * acq_sv_profile. The value of any elements beyond the index specified in + * this field is undefined */ u8 n_acq_sv_profile; } sbp_msg_acq_sv_profile_dep_t; - - /** * Get encoded size of an instance of sbp_msg_acq_sv_profile_dep_t * * @param msg sbp_msg_acq_sv_profile_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_acq_sv_profile_dep_encoded_len(const sbp_msg_acq_sv_profile_dep_t *msg) -{ - return SBP_MSG_ACQ_SV_PROFILE_DEP_ENCODED_OVERHEAD - + (msg->n_acq_sv_profile * SBP_ACQ_SV_PROFILE_DEP_ENCODED_LEN) - ; +static inline size_t sbp_msg_acq_sv_profile_dep_encoded_len( + const sbp_msg_acq_sv_profile_dep_t *msg) { + return SBP_MSG_ACQ_SV_PROFILE_DEP_ENCODED_OVERHEAD + + (msg->n_acq_sv_profile * SBP_ACQ_SV_PROFILE_DEP_ENCODED_LEN); } /** * Encode an instance of sbp_msg_acq_sv_profile_dep_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_acq_sv_profile_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_sv_profile_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_sv_profile_dep_t *msg); +SBP_EXPORT s8 +sbp_msg_acq_sv_profile_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_acq_sv_profile_dep_t *msg); /** * Decode an instance of sbp_msg_acq_sv_profile_dep_t from wire representation * - * This function decodes the wire representation of a sbp_msg_acq_sv_profile_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_acq_sv_profile_dep_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_acq_sv_profile_dep_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_sv_profile_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_sv_profile_dep_t *msg); +SBP_EXPORT s8 sbp_msg_acq_sv_profile_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_acq_sv_profile_dep_t *msg); /** - * Send an instance of sbp_msg_acq_sv_profile_dep_t with the given write function + * Send an instance of sbp_msg_acq_sv_profile_dep_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_acq_sv_profile_dep_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_acq_sv_profile_dep_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -115,51 +132,62 @@ SBP_EXPORT s8 sbp_msg_acq_sv_profile_dep_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acq_sv_profile_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_acq_sv_profile_dep_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_acq_sv_profile_dep_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_acq_sv_profile_dep_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_acq_sv_profile_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_acq_sv_profile_dep_t instance * @param b sbp_msg_acq_sv_profile_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_acq_sv_profile_dep_cmp(const sbp_msg_acq_sv_profile_dep_t *a, const sbp_msg_acq_sv_profile_dep_t *b); +SBP_EXPORT int sbp_msg_acq_sv_profile_dep_cmp( + const sbp_msg_acq_sv_profile_dep_t *a, + const sbp_msg_acq_sv_profile_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_acq_sv_profile_dep_t &lhs, const sbp_msg_acq_sv_profile_dep_t &rhs) { +static inline bool operator==(const sbp_msg_acq_sv_profile_dep_t &lhs, + const sbp_msg_acq_sv_profile_dep_t &rhs) { return sbp_msg_acq_sv_profile_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_acq_sv_profile_dep_t &lhs, const sbp_msg_acq_sv_profile_dep_t &rhs) { +static inline bool operator!=(const sbp_msg_acq_sv_profile_dep_t &lhs, + const sbp_msg_acq_sv_profile_dep_t &rhs) { return sbp_msg_acq_sv_profile_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_acq_sv_profile_dep_t &lhs, const sbp_msg_acq_sv_profile_dep_t &rhs) { +static inline bool operator<(const sbp_msg_acq_sv_profile_dep_t &lhs, + const sbp_msg_acq_sv_profile_dep_t &rhs) { return sbp_msg_acq_sv_profile_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_acq_sv_profile_dep_t &lhs, const sbp_msg_acq_sv_profile_dep_t &rhs) { +static inline bool operator<=(const sbp_msg_acq_sv_profile_dep_t &lhs, + const sbp_msg_acq_sv_profile_dep_t &rhs) { return sbp_msg_acq_sv_profile_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_acq_sv_profile_dep_t &lhs, const sbp_msg_acq_sv_profile_dep_t &rhs) { +static inline bool operator>(const sbp_msg_acq_sv_profile_dep_t &lhs, + const sbp_msg_acq_sv_profile_dep_t &rhs) { return sbp_msg_acq_sv_profile_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_acq_sv_profile_dep_t &lhs, const sbp_msg_acq_sv_profile_dep_t &rhs) { +static inline bool operator>=(const sbp_msg_acq_sv_profile_dep_t &lhs, + const sbp_msg_acq_sv_profile_dep_t &rhs) { return sbp_msg_acq_sv_profile_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_ACQUISITION_MSG_ACQ_SV_PROFILE_DEP_H */ - diff --git a/c/include/libsbp/acquisition_macros.h b/c/include/libsbp/acquisition_macros.h index f6a142e0a..61fa17f10 100644 --- a/c/include/libsbp/acquisition_macros.h +++ b/c/include/libsbp/acquisition_macros.h @@ -18,98 +18,92 @@ #ifndef LIBSBP_ACQUISITION_MACROS_H #define LIBSBP_ACQUISITION_MACROS_H - #define SBP_MSG_ACQ_RESULT 0x002F /** - * Encoded length of sbp_msg_acq_result_t (V4 API) and + * Encoded length of sbp_msg_acq_result_t (V4 API) and * msg_acq_result_t (legacy API) */ #define SBP_MSG_ACQ_RESULT_ENCODED_LEN 14u - #define SBP_MSG_ACQ_RESULT_DEP_C 0x001F /** - * Encoded length of sbp_msg_acq_result_dep_c_t (V4 API) and + * Encoded length of sbp_msg_acq_result_dep_c_t (V4 API) and * msg_acq_result_dep_c_t (legacy API) */ #define SBP_MSG_ACQ_RESULT_DEP_C_ENCODED_LEN 16u - #define SBP_MSG_ACQ_RESULT_DEP_B 0x0014 /** - * Encoded length of sbp_msg_acq_result_dep_b_t (V4 API) and + * Encoded length of sbp_msg_acq_result_dep_b_t (V4 API) and * msg_acq_result_dep_b_t (legacy API) */ #define SBP_MSG_ACQ_RESULT_DEP_B_ENCODED_LEN 16u - #define SBP_MSG_ACQ_RESULT_DEP_A 0x0015 /** - * Encoded length of sbp_msg_acq_result_dep_a_t (V4 API) and + * Encoded length of sbp_msg_acq_result_dep_a_t (V4 API) and * msg_acq_result_dep_a_t (legacy API) */ #define SBP_MSG_ACQ_RESULT_DEP_A_ENCODED_LEN 13u - /** - * Encoded length of sbp_acq_sv_profile_t (V4 API) and + * Encoded length of sbp_acq_sv_profile_t (V4 API) and * acq_sv_profile_t (legacy API) */ #define SBP_ACQ_SV_PROFILE_ENCODED_LEN 33u - /** - * Encoded length of sbp_acq_sv_profile_dep_t (V4 API) and + * Encoded length of sbp_acq_sv_profile_dep_t (V4 API) and * acq_sv_profile_dep_t (legacy API) */ #define SBP_ACQ_SV_PROFILE_DEP_ENCODED_LEN 35u - #define SBP_MSG_ACQ_SV_PROFILE 0x002E /** - * The maximum number of items that can be stored in sbp_msg_acq_sv_profile_t::acq_sv_profile (V4 API) or msg_acq_sv_profile_t::acq_sv_profile (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_acq_sv_profile_t::acq_sv_profile (V4 API) or + * msg_acq_sv_profile_t::acq_sv_profile (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_ACQ_SV_PROFILE_ACQ_SV_PROFILE_MAX 7u - /** - * Encoded length of sbp_msg_acq_sv_profile_t (V4 API) and + * Encoded length of sbp_msg_acq_sv_profile_t (V4 API) and * msg_acq_sv_profile_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_acq_sv_profile_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_acq_sv_profile_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_ACQ_SV_PROFILE_ENCODED_OVERHEAD 0u - #define SBP_MSG_ACQ_SV_PROFILE_DEP 0x001E /** - * The maximum number of items that can be stored in sbp_msg_acq_sv_profile_dep_t::acq_sv_profile (V4 API) or msg_acq_sv_profile_dep_t::acq_sv_profile (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_acq_sv_profile_dep_t::acq_sv_profile (V4 API) or + * msg_acq_sv_profile_dep_t::acq_sv_profile (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_ACQ_SV_PROFILE_DEP_ACQ_SV_PROFILE_MAX 7u - /** - * Encoded length of sbp_msg_acq_sv_profile_dep_t (V4 API) and + * Encoded length of sbp_msg_acq_sv_profile_dep_t (V4 API) and * msg_acq_sv_profile_dep_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_acq_sv_profile_dep_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_acq_sv_profile_dep_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_ACQ_SV_PROFILE_DEP_ENCODED_OVERHEAD 0u - - #endif /* LIBSBP_ACQUISITION_MACROS_H */ diff --git a/c/include/libsbp/bootload.h b/c/include/libsbp/bootload.h index de44a31b2..523bd49d1 100644 --- a/c/include/libsbp/bootload.h +++ b/c/include/libsbp/bootload.h @@ -17,11 +17,11 @@ #ifndef LIBSBP_BOOTLOAD_MESSAGES_H #define LIBSBP_BOOTLOAD_MESSAGES_H +#include #include #include #include #include #include -#include #endif /* LIBSBP_BOOTLOAD_MESSAGES_H */ diff --git a/c/include/libsbp/bootload/MSG_BOOTLOADER_HANDSHAKE_DEP_A.h b/c/include/libsbp/bootload/MSG_BOOTLOADER_HANDSHAKE_DEP_A.h index 4f2a7c042..f5d65fb11 100644 --- a/c/include/libsbp/bootload/MSG_BOOTLOADER_HANDSHAKE_DEP_A.h +++ b/c/include/libsbp/bootload/MSG_BOOTLOADER_HANDSHAKE_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_BOOTLOAD_MSG_BOOTLOADER_HANDSHAKE_DEP_A_H #define LIBSBP_BOOTLOAD_MSG_BOOTLOADER_HANDSHAKE_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include +#include #include #include -#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,185 +40,214 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Version number string (not NULL terminated) + * Version number string (not NULL terminated) */ sbp_string_t handshake; } sbp_msg_bootloader_handshake_dep_a_t; +/** + * Initialise sbp_msg_bootloader_handshake_dep_a_t::handshake to empty + * + * @param msg sbp_msg_bootloader_handshake_dep_a_t instance + */ +SBP_EXPORT void sbp_msg_bootloader_handshake_dep_a_handshake_init( + sbp_msg_bootloader_handshake_dep_a_t *msg); - /** - * Initialise sbp_msg_bootloader_handshake_dep_a_t::handshake to empty - * - * @param msg sbp_msg_bootloader_handshake_dep_a_t instance - */ - SBP_EXPORT void sbp_msg_bootloader_handshake_dep_a_handshake_init(sbp_msg_bootloader_handshake_dep_a_t *msg); - - /** - * Test sbp_msg_bootloader_handshake_dep_a_t::handshake for validity - * - * @param msg sbp_msg_bootloader_handshake_dep_a_t instance - * @return true is sbp_msg_bootloader_handshake_dep_a_t::handshake is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_bootloader_handshake_dep_a_handshake_valid(const sbp_msg_bootloader_handshake_dep_a_t *msg); +/** + * Test sbp_msg_bootloader_handshake_dep_a_t::handshake for validity + * + * @param msg sbp_msg_bootloader_handshake_dep_a_t instance + * @return true is sbp_msg_bootloader_handshake_dep_a_t::handshake is valid for + * encoding purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_bootloader_handshake_dep_a_handshake_valid( + const sbp_msg_bootloader_handshake_dep_a_t *msg); - /** - * Tests 2 instances of sbp_msg_bootloader_handshake_dep_a_t::handshake for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_bootloader_handshake_dep_a_t instance - * @param b sbp_msg_bootloader_handshake_dep_a_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_bootloader_handshake_dep_a_handshake_strcmp(const sbp_msg_bootloader_handshake_dep_a_t *a, const sbp_msg_bootloader_handshake_dep_a_t *b); +/** + * Tests 2 instances of sbp_msg_bootloader_handshake_dep_a_t::handshake for + * equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_bootloader_handshake_dep_a_t instance + * @param b sbp_msg_bootloader_handshake_dep_a_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_bootloader_handshake_dep_a_handshake_strcmp( + const sbp_msg_bootloader_handshake_dep_a_t *a, + const sbp_msg_bootloader_handshake_dep_a_t *b); - /** - * Get the encoded size of sbp_msg_bootloader_handshake_dep_a_t::handshake - * - * @param msg sbp_msg_bootloader_handshake_dep_a_t instance - * @return Size of sbp_msg_bootloader_handshake_dep_a_t::handshake in wire representation - */ - SBP_EXPORT size_t sbp_msg_bootloader_handshake_dep_a_handshake_encoded_len(const sbp_msg_bootloader_handshake_dep_a_t *msg); +/** + * Get the encoded size of sbp_msg_bootloader_handshake_dep_a_t::handshake + * + * @param msg sbp_msg_bootloader_handshake_dep_a_t instance + * @return Size of sbp_msg_bootloader_handshake_dep_a_t::handshake in wire + * representation + */ +SBP_EXPORT size_t sbp_msg_bootloader_handshake_dep_a_handshake_encoded_len( + const sbp_msg_bootloader_handshake_dep_a_t *msg); - /** - * Query sbp_msg_bootloader_handshake_dep_a_t::handshake for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_bootloader_handshake_dep_a_t::handshake before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_bootloader_handshake_dep_a_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_bootloader_handshake_dep_a_handshake_space_remaining(const sbp_msg_bootloader_handshake_dep_a_t *msg); - /** - * Set sbp_msg_bootloader_handshake_dep_a_t::handshake - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_bootloader_handshake_dep_a_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_bootloader_handshake_dep_a_handshake_set(sbp_msg_bootloader_handshake_dep_a_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_bootloader_handshake_dep_a_t::handshake for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_bootloader_handshake_dep_a_t::handshake before it exceeds + * the maximum size of the field in wire representation + * + * @param msg sbp_msg_bootloader_handshake_dep_a_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_bootloader_handshake_dep_a_handshake_space_remaining( + const sbp_msg_bootloader_handshake_dep_a_t *msg); +/** + * Set sbp_msg_bootloader_handshake_dep_a_t::handshake + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_bootloader_handshake_dep_a_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_bootloader_handshake_dep_a_handshake_set( + sbp_msg_bootloader_handshake_dep_a_t *msg, const char *new_str, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_bootloader_handshake_dep_a_t::handshake from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_bootloader_handshake_dep_a_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_bootloader_handshake_dep_a_handshake_set_raw(sbp_msg_bootloader_handshake_dep_a_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_bootloader_handshake_dep_a_t::handshake from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_bootloader_handshake_dep_a_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_bootloader_handshake_dep_a_handshake_set_raw( + sbp_msg_bootloader_handshake_dep_a_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_bootloader_handshake_dep_a_t::handshake with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_bootloader_handshake_dep_a_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_bootloader_handshake_dep_a_handshake_printf(sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_bootloader_handshake_dep_a_t::handshake with printf style + * formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_bootloader_handshake_dep_a_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_bootloader_handshake_dep_a_handshake_printf( + sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_bootloader_handshake_dep_a_t::handshake with printf style formatting - * - * Identical to #sbp_msg_bootloader_handshake_dep_a_handshake_printf except it takes a va_list argument - * - * @param msg sbp_msg_bootloader_handshake_dep_a_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_bootloader_handshake_dep_a_handshake_vprintf(sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_bootloader_handshake_dep_a_t::handshake with printf style + * formatting + * + * Identical to #sbp_msg_bootloader_handshake_dep_a_handshake_printf except it + * takes a va_list argument + * + * @param msg sbp_msg_bootloader_handshake_dep_a_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_bootloader_handshake_dep_a_handshake_vprintf( + sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_bootloader_handshake_dep_a_t::handshake with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_bootloader_handshake_dep_a_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_bootloader_handshake_dep_a_handshake_append_printf(sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_bootloader_handshake_dep_a_t::handshake with printf style + * formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_bootloader_handshake_dep_a_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_bootloader_handshake_dep_a_handshake_append_printf( + sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_bootloader_handshake_dep_a_t::handshake with printf style formatting - * - * Identical to #sbp_msg_bootloader_handshake_dep_a_handshake_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_bootloader_handshake_dep_a_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_bootloader_handshake_dep_a_handshake_append_vprintf(sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_bootloader_handshake_dep_a_t::handshake with printf style + * formatting + * + * Identical to #sbp_msg_bootloader_handshake_dep_a_handshake_append_printf + * except it takes a va_list argument + * + * @param msg sbp_msg_bootloader_handshake_dep_a_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_bootloader_handshake_dep_a_handshake_append_vprintf( + sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_bootloader_handshake_dep_a_t::handshake - * - * @param msg sbp_msg_bootloader_handshake_dep_a_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_bootloader_handshake_dep_a_handshake_get(const sbp_msg_bootloader_handshake_dep_a_t *msg); +/** + * Obtain the string value from sbp_msg_bootloader_handshake_dep_a_t::handshake + * + * @param msg sbp_msg_bootloader_handshake_dep_a_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_bootloader_handshake_dep_a_handshake_get( + const sbp_msg_bootloader_handshake_dep_a_t *msg); - /** - * Obtain the length of sbp_msg_bootloader_handshake_dep_a_t::handshake - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_bootloader_handshake_dep_a_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_bootloader_handshake_dep_a_handshake_strlen(const sbp_msg_bootloader_handshake_dep_a_t *msg); +/** + * Obtain the length of sbp_msg_bootloader_handshake_dep_a_t::handshake + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_bootloader_handshake_dep_a_t instance + * @return Length of string + */ +SBP_EXPORT size_t sbp_msg_bootloader_handshake_dep_a_handshake_strlen( + const sbp_msg_bootloader_handshake_dep_a_t *msg); /** * Get encoded size of an instance of sbp_msg_bootloader_handshake_dep_a_t @@ -226,46 +255,67 @@ typedef struct { * @param msg sbp_msg_bootloader_handshake_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_bootloader_handshake_dep_a_encoded_len(const sbp_msg_bootloader_handshake_dep_a_t *msg) -{ - return SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_ENCODED_OVERHEAD - + sbp_msg_bootloader_handshake_dep_a_handshake_encoded_len(msg) - ; +static inline size_t sbp_msg_bootloader_handshake_dep_a_encoded_len( + const sbp_msg_bootloader_handshake_dep_a_t *msg) { + return SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_ENCODED_OVERHEAD + + sbp_msg_bootloader_handshake_dep_a_handshake_encoded_len(msg); } /** - * Encode an instance of sbp_msg_bootloader_handshake_dep_a_t to wire representation + * Encode an instance of sbp_msg_bootloader_handshake_dep_a_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_bootloader_handshake_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_bootloader_handshake_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_bootloader_handshake_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_bootloader_handshake_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_bootloader_handshake_dep_a_t *msg); /** - * Decode an instance of sbp_msg_bootloader_handshake_dep_a_t from wire representation + * Decode an instance of sbp_msg_bootloader_handshake_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_bootloader_handshake_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_bootloader_handshake_dep_a_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_bootloader_handshake_dep_a_t instance + * @param buf Wire representation of the sbp_msg_bootloader_handshake_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_bootloader_handshake_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_bootloader_handshake_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_bootloader_handshake_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_bootloader_handshake_dep_a_t *msg); /** - * Send an instance of sbp_msg_bootloader_handshake_dep_a_t with the given write function + * Send an instance of sbp_msg_bootloader_handshake_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_bootloader_handshake_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_bootloader_handshake_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -273,51 +323,62 @@ SBP_EXPORT s8 sbp_msg_bootloader_handshake_dep_a_decode(const uint8_t *buf, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_bootloader_handshake_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_bootloader_handshake_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_bootloader_handshake_dep_a_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_bootloader_handshake_dep_a_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_bootloader_handshake_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_bootloader_handshake_dep_a_t instance * @param b sbp_msg_bootloader_handshake_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_bootloader_handshake_dep_a_cmp(const sbp_msg_bootloader_handshake_dep_a_t *a, const sbp_msg_bootloader_handshake_dep_a_t *b); +SBP_EXPORT int sbp_msg_bootloader_handshake_dep_a_cmp( + const sbp_msg_bootloader_handshake_dep_a_t *a, + const sbp_msg_bootloader_handshake_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_bootloader_handshake_dep_a_t &lhs, const sbp_msg_bootloader_handshake_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_bootloader_handshake_dep_a_t &lhs, + const sbp_msg_bootloader_handshake_dep_a_t &rhs) { return sbp_msg_bootloader_handshake_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_bootloader_handshake_dep_a_t &lhs, const sbp_msg_bootloader_handshake_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_bootloader_handshake_dep_a_t &lhs, + const sbp_msg_bootloader_handshake_dep_a_t &rhs) { return sbp_msg_bootloader_handshake_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_bootloader_handshake_dep_a_t &lhs, const sbp_msg_bootloader_handshake_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_bootloader_handshake_dep_a_t &lhs, + const sbp_msg_bootloader_handshake_dep_a_t &rhs) { return sbp_msg_bootloader_handshake_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_bootloader_handshake_dep_a_t &lhs, const sbp_msg_bootloader_handshake_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_bootloader_handshake_dep_a_t &lhs, + const sbp_msg_bootloader_handshake_dep_a_t &rhs) { return sbp_msg_bootloader_handshake_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_bootloader_handshake_dep_a_t &lhs, const sbp_msg_bootloader_handshake_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_bootloader_handshake_dep_a_t &lhs, + const sbp_msg_bootloader_handshake_dep_a_t &rhs) { return sbp_msg_bootloader_handshake_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_bootloader_handshake_dep_a_t &lhs, const sbp_msg_bootloader_handshake_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_bootloader_handshake_dep_a_t &lhs, + const sbp_msg_bootloader_handshake_dep_a_t &rhs) { return sbp_msg_bootloader_handshake_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_BOOTLOAD_MSG_BOOTLOADER_HANDSHAKE_DEP_A_H */ - diff --git a/c/include/libsbp/bootload/MSG_BOOTLOADER_HANDSHAKE_REQ.h b/c/include/libsbp/bootload/MSG_BOOTLOADER_HANDSHAKE_REQ.h index ddb7fbfb6..cdabbaff5 100644 --- a/c/include/libsbp/bootload/MSG_BOOTLOADER_HANDSHAKE_REQ.h +++ b/c/include/libsbp/bootload/MSG_BOOTLOADER_HANDSHAKE_REQ.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_BOOTLOAD_MSG_BOOTLOADER_HANDSHAKE_REQ_H #define LIBSBP_BOOTLOAD_MSG_BOOTLOADER_HANDSHAKE_REQ_H +#include +#include #include #include -#include -#include #include -#include +#include +#include #include #include -#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,62 +40,84 @@ *****************************************************************************/ /** Bootloading handshake request (host => device) * -* The handshake message request from the host establishes a handshake between the device bootloader and the host. The response from the device is MSG_BOOTLOADER_HANDSHAKE_RESP. + * The handshake message request from the host establishes a handshake between + * the device bootloader and the host. The response from the device is + * MSG_BOOTLOADER_HANDSHAKE_RESP. */ typedef struct { /** - * Do not use this field, it exists only to prevent illegal C syntax. Any value written to this field will be ignored + * Do not use this field, it exists only to prevent illegal C syntax. Any + * value written to this field will be ignored */ char DO_NOT_USE_dummy_field_to_prevent_empty_struct; } sbp_msg_bootloader_handshake_req_t; - - /** * Get encoded size of an instance of sbp_msg_bootloader_handshake_req_t * * @param msg sbp_msg_bootloader_handshake_req_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_bootloader_handshake_req_encoded_len(const sbp_msg_bootloader_handshake_req_t *msg) -{ +static inline size_t sbp_msg_bootloader_handshake_req_encoded_len( + const sbp_msg_bootloader_handshake_req_t *msg) { (void)msg; return SBP_MSG_BOOTLOADER_HANDSHAKE_REQ_ENCODED_LEN; } /** - * Encode an instance of sbp_msg_bootloader_handshake_req_t to wire representation + * Encode an instance of sbp_msg_bootloader_handshake_req_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_bootloader_handshake_req_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_bootloader_handshake_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_bootloader_handshake_req_t *msg); +SBP_EXPORT s8 sbp_msg_bootloader_handshake_req_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_bootloader_handshake_req_t *msg); /** - * Decode an instance of sbp_msg_bootloader_handshake_req_t from wire representation + * Decode an instance of sbp_msg_bootloader_handshake_req_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_bootloader_handshake_req_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_bootloader_handshake_req_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_bootloader_handshake_req_t instance + * @param buf Wire representation of the sbp_msg_bootloader_handshake_req_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_bootloader_handshake_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_bootloader_handshake_req_t *msg); +SBP_EXPORT s8 sbp_msg_bootloader_handshake_req_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_bootloader_handshake_req_t *msg); /** - * Send an instance of sbp_msg_bootloader_handshake_req_t with the given write function + * Send an instance of sbp_msg_bootloader_handshake_req_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_bootloader_handshake_req_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_bootloader_handshake_req_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -103,51 +125,62 @@ SBP_EXPORT s8 sbp_msg_bootloader_handshake_req_decode(const uint8_t *buf, uint8_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_bootloader_handshake_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_bootloader_handshake_req_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_bootloader_handshake_req_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_bootloader_handshake_req_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_bootloader_handshake_req_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_bootloader_handshake_req_t instance * @param b sbp_msg_bootloader_handshake_req_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_bootloader_handshake_req_cmp(const sbp_msg_bootloader_handshake_req_t *a, const sbp_msg_bootloader_handshake_req_t *b); +SBP_EXPORT int sbp_msg_bootloader_handshake_req_cmp( + const sbp_msg_bootloader_handshake_req_t *a, + const sbp_msg_bootloader_handshake_req_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_bootloader_handshake_req_t &lhs, const sbp_msg_bootloader_handshake_req_t &rhs) { +static inline bool operator==(const sbp_msg_bootloader_handshake_req_t &lhs, + const sbp_msg_bootloader_handshake_req_t &rhs) { return sbp_msg_bootloader_handshake_req_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_bootloader_handshake_req_t &lhs, const sbp_msg_bootloader_handshake_req_t &rhs) { +static inline bool operator!=(const sbp_msg_bootloader_handshake_req_t &lhs, + const sbp_msg_bootloader_handshake_req_t &rhs) { return sbp_msg_bootloader_handshake_req_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_bootloader_handshake_req_t &lhs, const sbp_msg_bootloader_handshake_req_t &rhs) { +static inline bool operator<(const sbp_msg_bootloader_handshake_req_t &lhs, + const sbp_msg_bootloader_handshake_req_t &rhs) { return sbp_msg_bootloader_handshake_req_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_bootloader_handshake_req_t &lhs, const sbp_msg_bootloader_handshake_req_t &rhs) { +static inline bool operator<=(const sbp_msg_bootloader_handshake_req_t &lhs, + const sbp_msg_bootloader_handshake_req_t &rhs) { return sbp_msg_bootloader_handshake_req_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_bootloader_handshake_req_t &lhs, const sbp_msg_bootloader_handshake_req_t &rhs) { +static inline bool operator>(const sbp_msg_bootloader_handshake_req_t &lhs, + const sbp_msg_bootloader_handshake_req_t &rhs) { return sbp_msg_bootloader_handshake_req_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_bootloader_handshake_req_t &lhs, const sbp_msg_bootloader_handshake_req_t &rhs) { +static inline bool operator>=(const sbp_msg_bootloader_handshake_req_t &lhs, + const sbp_msg_bootloader_handshake_req_t &rhs) { return sbp_msg_bootloader_handshake_req_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_BOOTLOAD_MSG_BOOTLOADER_HANDSHAKE_REQ_H */ - diff --git a/c/include/libsbp/bootload/MSG_BOOTLOADER_HANDSHAKE_RESP.h b/c/include/libsbp/bootload/MSG_BOOTLOADER_HANDSHAKE_RESP.h index e480baed5..1a120a11f 100644 --- a/c/include/libsbp/bootload/MSG_BOOTLOADER_HANDSHAKE_RESP.h +++ b/c/include/libsbp/bootload/MSG_BOOTLOADER_HANDSHAKE_RESP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_BOOTLOAD_MSG_BOOTLOADER_HANDSHAKE_RESP_H #define LIBSBP_BOOTLOAD_MSG_BOOTLOADER_HANDSHAKE_RESP_H +#include +#include #include #include -#include -#include #include -#include +#include +#include #include #include -#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,191 +40,220 @@ *****************************************************************************/ /** Bootloading handshake response (host <= device) * -* The handshake message response from the device establishes a handshake between the device bootloader and the host. The request from the host is MSG_BOOTLOADER_HANDSHAKE_REQ. The payload contains the bootloader version number and the SBP protocol version number. + * The handshake message response from the device establishes a handshake + * between the device bootloader and the host. The request from the host is + * MSG_BOOTLOADER_HANDSHAKE_REQ. The payload contains the bootloader version + * number and the SBP protocol version number. */ typedef struct { - - /** -* Bootloader flags + * Bootloader flags */ u32 flags; - /** -* Bootloader version number + * Bootloader version number */ sbp_string_t version; } sbp_msg_bootloader_handshake_resp_t; +/** + * Initialise sbp_msg_bootloader_handshake_resp_t::version to empty + * + * @param msg sbp_msg_bootloader_handshake_resp_t instance + */ +SBP_EXPORT void sbp_msg_bootloader_handshake_resp_version_init( + sbp_msg_bootloader_handshake_resp_t *msg); - /** - * Initialise sbp_msg_bootloader_handshake_resp_t::version to empty - * - * @param msg sbp_msg_bootloader_handshake_resp_t instance - */ - SBP_EXPORT void sbp_msg_bootloader_handshake_resp_version_init(sbp_msg_bootloader_handshake_resp_t *msg); - - /** - * Test sbp_msg_bootloader_handshake_resp_t::version for validity - * - * @param msg sbp_msg_bootloader_handshake_resp_t instance - * @return true is sbp_msg_bootloader_handshake_resp_t::version is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_bootloader_handshake_resp_version_valid(const sbp_msg_bootloader_handshake_resp_t *msg); +/** + * Test sbp_msg_bootloader_handshake_resp_t::version for validity + * + * @param msg sbp_msg_bootloader_handshake_resp_t instance + * @return true is sbp_msg_bootloader_handshake_resp_t::version is valid for + * encoding purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_bootloader_handshake_resp_version_valid( + const sbp_msg_bootloader_handshake_resp_t *msg); - /** - * Tests 2 instances of sbp_msg_bootloader_handshake_resp_t::version for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_bootloader_handshake_resp_t instance - * @param b sbp_msg_bootloader_handshake_resp_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_bootloader_handshake_resp_version_strcmp(const sbp_msg_bootloader_handshake_resp_t *a, const sbp_msg_bootloader_handshake_resp_t *b); +/** + * Tests 2 instances of sbp_msg_bootloader_handshake_resp_t::version for + * equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_bootloader_handshake_resp_t instance + * @param b sbp_msg_bootloader_handshake_resp_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_bootloader_handshake_resp_version_strcmp( + const sbp_msg_bootloader_handshake_resp_t *a, + const sbp_msg_bootloader_handshake_resp_t *b); - /** - * Get the encoded size of sbp_msg_bootloader_handshake_resp_t::version - * - * @param msg sbp_msg_bootloader_handshake_resp_t instance - * @return Size of sbp_msg_bootloader_handshake_resp_t::version in wire representation - */ - SBP_EXPORT size_t sbp_msg_bootloader_handshake_resp_version_encoded_len(const sbp_msg_bootloader_handshake_resp_t *msg); +/** + * Get the encoded size of sbp_msg_bootloader_handshake_resp_t::version + * + * @param msg sbp_msg_bootloader_handshake_resp_t instance + * @return Size of sbp_msg_bootloader_handshake_resp_t::version in wire + * representation + */ +SBP_EXPORT size_t sbp_msg_bootloader_handshake_resp_version_encoded_len( + const sbp_msg_bootloader_handshake_resp_t *msg); - /** - * Query sbp_msg_bootloader_handshake_resp_t::version for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_bootloader_handshake_resp_t::version before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_bootloader_handshake_resp_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_bootloader_handshake_resp_version_space_remaining(const sbp_msg_bootloader_handshake_resp_t *msg); - /** - * Set sbp_msg_bootloader_handshake_resp_t::version - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_bootloader_handshake_resp_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_bootloader_handshake_resp_version_set(sbp_msg_bootloader_handshake_resp_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_bootloader_handshake_resp_t::version for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_bootloader_handshake_resp_t::version before it exceeds the + * maximum size of the field in wire representation + * + * @param msg sbp_msg_bootloader_handshake_resp_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_bootloader_handshake_resp_version_space_remaining( + const sbp_msg_bootloader_handshake_resp_t *msg); +/** + * Set sbp_msg_bootloader_handshake_resp_t::version + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_bootloader_handshake_resp_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_bootloader_handshake_resp_version_set( + sbp_msg_bootloader_handshake_resp_t *msg, const char *new_str, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_bootloader_handshake_resp_t::version from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_bootloader_handshake_resp_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_bootloader_handshake_resp_version_set_raw(sbp_msg_bootloader_handshake_resp_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_bootloader_handshake_resp_t::version from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_bootloader_handshake_resp_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_bootloader_handshake_resp_version_set_raw( + sbp_msg_bootloader_handshake_resp_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_bootloader_handshake_resp_t::version with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_bootloader_handshake_resp_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_bootloader_handshake_resp_version_printf(sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_bootloader_handshake_resp_t::version with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_bootloader_handshake_resp_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_bootloader_handshake_resp_version_printf( + sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_bootloader_handshake_resp_t::version with printf style formatting - * - * Identical to #sbp_msg_bootloader_handshake_resp_version_printf except it takes a va_list argument - * - * @param msg sbp_msg_bootloader_handshake_resp_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_bootloader_handshake_resp_version_vprintf(sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_bootloader_handshake_resp_t::version with printf style formatting + * + * Identical to #sbp_msg_bootloader_handshake_resp_version_printf except it + * takes a va_list argument + * + * @param msg sbp_msg_bootloader_handshake_resp_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_bootloader_handshake_resp_version_vprintf( + sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_bootloader_handshake_resp_t::version with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_bootloader_handshake_resp_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_bootloader_handshake_resp_version_append_printf(sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_bootloader_handshake_resp_t::version with printf style + * formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_bootloader_handshake_resp_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_bootloader_handshake_resp_version_append_printf( + sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_bootloader_handshake_resp_t::version with printf style formatting - * - * Identical to #sbp_msg_bootloader_handshake_resp_version_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_bootloader_handshake_resp_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_bootloader_handshake_resp_version_append_vprintf(sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_bootloader_handshake_resp_t::version with printf style + * formatting + * + * Identical to #sbp_msg_bootloader_handshake_resp_version_append_printf except + * it takes a va_list argument + * + * @param msg sbp_msg_bootloader_handshake_resp_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_bootloader_handshake_resp_version_append_vprintf( + sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_bootloader_handshake_resp_t::version - * - * @param msg sbp_msg_bootloader_handshake_resp_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_bootloader_handshake_resp_version_get(const sbp_msg_bootloader_handshake_resp_t *msg); +/** + * Obtain the string value from sbp_msg_bootloader_handshake_resp_t::version + * + * @param msg sbp_msg_bootloader_handshake_resp_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_bootloader_handshake_resp_version_get( + const sbp_msg_bootloader_handshake_resp_t *msg); - /** - * Obtain the length of sbp_msg_bootloader_handshake_resp_t::version - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_bootloader_handshake_resp_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_bootloader_handshake_resp_version_strlen(const sbp_msg_bootloader_handshake_resp_t *msg); +/** + * Obtain the length of sbp_msg_bootloader_handshake_resp_t::version + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_bootloader_handshake_resp_t instance + * @return Length of string + */ +SBP_EXPORT size_t sbp_msg_bootloader_handshake_resp_version_strlen( + const sbp_msg_bootloader_handshake_resp_t *msg); /** * Get encoded size of an instance of sbp_msg_bootloader_handshake_resp_t @@ -232,46 +261,66 @@ typedef struct { * @param msg sbp_msg_bootloader_handshake_resp_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_bootloader_handshake_resp_encoded_len(const sbp_msg_bootloader_handshake_resp_t *msg) -{ - return SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_ENCODED_OVERHEAD - + sbp_msg_bootloader_handshake_resp_version_encoded_len(msg) - ; +static inline size_t sbp_msg_bootloader_handshake_resp_encoded_len( + const sbp_msg_bootloader_handshake_resp_t *msg) { + return SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_ENCODED_OVERHEAD + + sbp_msg_bootloader_handshake_resp_version_encoded_len(msg); } /** - * Encode an instance of sbp_msg_bootloader_handshake_resp_t to wire representation + * Encode an instance of sbp_msg_bootloader_handshake_resp_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_bootloader_handshake_resp_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_bootloader_handshake_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_bootloader_handshake_resp_t *msg); +SBP_EXPORT s8 sbp_msg_bootloader_handshake_resp_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_bootloader_handshake_resp_t *msg); /** - * Decode an instance of sbp_msg_bootloader_handshake_resp_t from wire representation + * Decode an instance of sbp_msg_bootloader_handshake_resp_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_bootloader_handshake_resp_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_bootloader_handshake_resp_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_bootloader_handshake_resp_t instance + * @param buf Wire representation of the sbp_msg_bootloader_handshake_resp_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_bootloader_handshake_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_bootloader_handshake_resp_t *msg); +SBP_EXPORT s8 sbp_msg_bootloader_handshake_resp_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_bootloader_handshake_resp_t *msg); /** - * Send an instance of sbp_msg_bootloader_handshake_resp_t with the given write function + * Send an instance of sbp_msg_bootloader_handshake_resp_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_bootloader_handshake_resp_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_bootloader_handshake_resp_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -279,51 +328,62 @@ SBP_EXPORT s8 sbp_msg_bootloader_handshake_resp_decode(const uint8_t *buf, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_bootloader_handshake_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_bootloader_handshake_resp_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_bootloader_handshake_resp_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_bootloader_handshake_resp_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_bootloader_handshake_resp_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_bootloader_handshake_resp_t instance * @param b sbp_msg_bootloader_handshake_resp_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_bootloader_handshake_resp_cmp(const sbp_msg_bootloader_handshake_resp_t *a, const sbp_msg_bootloader_handshake_resp_t *b); +SBP_EXPORT int sbp_msg_bootloader_handshake_resp_cmp( + const sbp_msg_bootloader_handshake_resp_t *a, + const sbp_msg_bootloader_handshake_resp_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_bootloader_handshake_resp_t &lhs, const sbp_msg_bootloader_handshake_resp_t &rhs) { +static inline bool operator==(const sbp_msg_bootloader_handshake_resp_t &lhs, + const sbp_msg_bootloader_handshake_resp_t &rhs) { return sbp_msg_bootloader_handshake_resp_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_bootloader_handshake_resp_t &lhs, const sbp_msg_bootloader_handshake_resp_t &rhs) { +static inline bool operator!=(const sbp_msg_bootloader_handshake_resp_t &lhs, + const sbp_msg_bootloader_handshake_resp_t &rhs) { return sbp_msg_bootloader_handshake_resp_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_bootloader_handshake_resp_t &lhs, const sbp_msg_bootloader_handshake_resp_t &rhs) { +static inline bool operator<(const sbp_msg_bootloader_handshake_resp_t &lhs, + const sbp_msg_bootloader_handshake_resp_t &rhs) { return sbp_msg_bootloader_handshake_resp_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_bootloader_handshake_resp_t &lhs, const sbp_msg_bootloader_handshake_resp_t &rhs) { +static inline bool operator<=(const sbp_msg_bootloader_handshake_resp_t &lhs, + const sbp_msg_bootloader_handshake_resp_t &rhs) { return sbp_msg_bootloader_handshake_resp_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_bootloader_handshake_resp_t &lhs, const sbp_msg_bootloader_handshake_resp_t &rhs) { +static inline bool operator>(const sbp_msg_bootloader_handshake_resp_t &lhs, + const sbp_msg_bootloader_handshake_resp_t &rhs) { return sbp_msg_bootloader_handshake_resp_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_bootloader_handshake_resp_t &lhs, const sbp_msg_bootloader_handshake_resp_t &rhs) { +static inline bool operator>=(const sbp_msg_bootloader_handshake_resp_t &lhs, + const sbp_msg_bootloader_handshake_resp_t &rhs) { return sbp_msg_bootloader_handshake_resp_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_BOOTLOAD_MSG_BOOTLOADER_HANDSHAKE_RESP_H */ - diff --git a/c/include/libsbp/bootload/MSG_BOOTLOADER_JUMP_TO_APP.h b/c/include/libsbp/bootload/MSG_BOOTLOADER_JUMP_TO_APP.h index 8271c839c..8a42fe29f 100644 --- a/c/include/libsbp/bootload/MSG_BOOTLOADER_JUMP_TO_APP.h +++ b/c/include/libsbp/bootload/MSG_BOOTLOADER_JUMP_TO_APP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_BOOTLOAD_MSG_BOOTLOADER_JUMP_TO_APP_H #define LIBSBP_BOOTLOAD_MSG_BOOTLOADER_JUMP_TO_APP_H +#include +#include #include #include -#include -#include #include -#include +#include +#include #include #include -#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,27 +40,23 @@ *****************************************************************************/ /** Bootloader jump to application (host => device) * -* The host initiates the bootloader to jump to the application. + * The host initiates the bootloader to jump to the application. */ typedef struct { - - /** -* Ignored by the device + * Ignored by the device */ u8 jump; } sbp_msg_bootloader_jump_to_app_t; - - /** * Get encoded size of an instance of sbp_msg_bootloader_jump_to_app_t * * @param msg sbp_msg_bootloader_jump_to_app_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_bootloader_jump_to_app_encoded_len(const sbp_msg_bootloader_jump_to_app_t *msg) -{ +static inline size_t sbp_msg_bootloader_jump_to_app_encoded_len( + const sbp_msg_bootloader_jump_to_app_t *msg) { (void)msg; return SBP_MSG_BOOTLOADER_JUMP_TO_APP_ENCODED_LEN; } @@ -68,36 +64,56 @@ static inline size_t sbp_msg_bootloader_jump_to_app_encoded_len(const sbp_msg_bo /** * Encode an instance of sbp_msg_bootloader_jump_to_app_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_bootloader_jump_to_app_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_bootloader_jump_to_app_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_bootloader_jump_to_app_t *msg); +SBP_EXPORT s8 sbp_msg_bootloader_jump_to_app_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_bootloader_jump_to_app_t *msg); /** - * Decode an instance of sbp_msg_bootloader_jump_to_app_t from wire representation + * Decode an instance of sbp_msg_bootloader_jump_to_app_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_bootloader_jump_to_app_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_bootloader_jump_to_app_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_bootloader_jump_to_app_t instance + * @param buf Wire representation of the sbp_msg_bootloader_jump_to_app_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_bootloader_jump_to_app_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_bootloader_jump_to_app_t *msg); +SBP_EXPORT s8 sbp_msg_bootloader_jump_to_app_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_bootloader_jump_to_app_t *msg); /** - * Send an instance of sbp_msg_bootloader_jump_to_app_t with the given write function + * Send an instance of sbp_msg_bootloader_jump_to_app_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_bootloader_jump_to_app_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_bootloader_jump_to_app_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -105,51 +121,62 @@ SBP_EXPORT s8 sbp_msg_bootloader_jump_to_app_decode(const uint8_t *buf, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_bootloader_jump_to_app_send(sbp_state_t *s, u16 sender_id, const sbp_msg_bootloader_jump_to_app_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_bootloader_jump_to_app_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_bootloader_jump_to_app_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_bootloader_jump_to_app_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_bootloader_jump_to_app_t instance * @param b sbp_msg_bootloader_jump_to_app_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_bootloader_jump_to_app_cmp(const sbp_msg_bootloader_jump_to_app_t *a, const sbp_msg_bootloader_jump_to_app_t *b); +SBP_EXPORT int sbp_msg_bootloader_jump_to_app_cmp( + const sbp_msg_bootloader_jump_to_app_t *a, + const sbp_msg_bootloader_jump_to_app_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_bootloader_jump_to_app_t &lhs, const sbp_msg_bootloader_jump_to_app_t &rhs) { +static inline bool operator==(const sbp_msg_bootloader_jump_to_app_t &lhs, + const sbp_msg_bootloader_jump_to_app_t &rhs) { return sbp_msg_bootloader_jump_to_app_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_bootloader_jump_to_app_t &lhs, const sbp_msg_bootloader_jump_to_app_t &rhs) { +static inline bool operator!=(const sbp_msg_bootloader_jump_to_app_t &lhs, + const sbp_msg_bootloader_jump_to_app_t &rhs) { return sbp_msg_bootloader_jump_to_app_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_bootloader_jump_to_app_t &lhs, const sbp_msg_bootloader_jump_to_app_t &rhs) { +static inline bool operator<(const sbp_msg_bootloader_jump_to_app_t &lhs, + const sbp_msg_bootloader_jump_to_app_t &rhs) { return sbp_msg_bootloader_jump_to_app_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_bootloader_jump_to_app_t &lhs, const sbp_msg_bootloader_jump_to_app_t &rhs) { +static inline bool operator<=(const sbp_msg_bootloader_jump_to_app_t &lhs, + const sbp_msg_bootloader_jump_to_app_t &rhs) { return sbp_msg_bootloader_jump_to_app_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_bootloader_jump_to_app_t &lhs, const sbp_msg_bootloader_jump_to_app_t &rhs) { +static inline bool operator>(const sbp_msg_bootloader_jump_to_app_t &lhs, + const sbp_msg_bootloader_jump_to_app_t &rhs) { return sbp_msg_bootloader_jump_to_app_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_bootloader_jump_to_app_t &lhs, const sbp_msg_bootloader_jump_to_app_t &rhs) { +static inline bool operator>=(const sbp_msg_bootloader_jump_to_app_t &lhs, + const sbp_msg_bootloader_jump_to_app_t &rhs) { return sbp_msg_bootloader_jump_to_app_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_BOOTLOAD_MSG_BOOTLOADER_JUMP_TO_APP_H */ - diff --git a/c/include/libsbp/bootload/MSG_NAP_DEVICE_DNA_REQ.h b/c/include/libsbp/bootload/MSG_NAP_DEVICE_DNA_REQ.h index 11a91c3fa..764ac7df1 100644 --- a/c/include/libsbp/bootload/MSG_NAP_DEVICE_DNA_REQ.h +++ b/c/include/libsbp/bootload/MSG_NAP_DEVICE_DNA_REQ.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_BOOTLOAD_MSG_NAP_DEVICE_DNA_REQ_H #define LIBSBP_BOOTLOAD_MSG_NAP_DEVICE_DNA_REQ_H +#include +#include #include #include -#include -#include #include -#include +#include +#include #include #include -#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,25 +40,28 @@ *****************************************************************************/ /** Read FPGA device ID over UART request (host => device) * -* The device message from the host reads a unique device identifier from the SwiftNAP, an FPGA. The host requests the ID by sending a MSG_NAP_DEVICE_DNA_REQ message. The device responds with a MSG_NAP_DEVICE_DNA_RESP message with the device ID in the payload. Note that this ID is tied to the FPGA, and not related to the Piksi's serial number. + * The device message from the host reads a unique device identifier from the + * SwiftNAP, an FPGA. The host requests the ID by sending a + * MSG_NAP_DEVICE_DNA_REQ message. The device responds with a + * MSG_NAP_DEVICE_DNA_RESP message with the device ID in the payload. Note that + * this ID is tied to the FPGA, and not related to the Piksi's serial number. */ typedef struct { /** - * Do not use this field, it exists only to prevent illegal C syntax. Any value written to this field will be ignored + * Do not use this field, it exists only to prevent illegal C syntax. Any + * value written to this field will be ignored */ char DO_NOT_USE_dummy_field_to_prevent_empty_struct; } sbp_msg_nap_device_dna_req_t; - - /** * Get encoded size of an instance of sbp_msg_nap_device_dna_req_t * * @param msg sbp_msg_nap_device_dna_req_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_nap_device_dna_req_encoded_len(const sbp_msg_nap_device_dna_req_t *msg) -{ +static inline size_t sbp_msg_nap_device_dna_req_encoded_len( + const sbp_msg_nap_device_dna_req_t *msg) { (void)msg; return SBP_MSG_NAP_DEVICE_DNA_REQ_ENCODED_LEN; } @@ -66,36 +69,54 @@ static inline size_t sbp_msg_nap_device_dna_req_encoded_len(const sbp_msg_nap_de /** * Encode an instance of sbp_msg_nap_device_dna_req_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_nap_device_dna_req_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_nap_device_dna_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_nap_device_dna_req_t *msg); +SBP_EXPORT s8 +sbp_msg_nap_device_dna_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_nap_device_dna_req_t *msg); /** * Decode an instance of sbp_msg_nap_device_dna_req_t from wire representation * - * This function decodes the wire representation of a sbp_msg_nap_device_dna_req_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_nap_device_dna_req_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_nap_device_dna_req_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_nap_device_dna_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_nap_device_dna_req_t *msg); +SBP_EXPORT s8 sbp_msg_nap_device_dna_req_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_nap_device_dna_req_t *msg); /** - * Send an instance of sbp_msg_nap_device_dna_req_t with the given write function + * Send an instance of sbp_msg_nap_device_dna_req_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_nap_device_dna_req_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_nap_device_dna_req_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -103,51 +124,62 @@ SBP_EXPORT s8 sbp_msg_nap_device_dna_req_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_nap_device_dna_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_nap_device_dna_req_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_nap_device_dna_req_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_nap_device_dna_req_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_nap_device_dna_req_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_nap_device_dna_req_t instance * @param b sbp_msg_nap_device_dna_req_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_nap_device_dna_req_cmp(const sbp_msg_nap_device_dna_req_t *a, const sbp_msg_nap_device_dna_req_t *b); +SBP_EXPORT int sbp_msg_nap_device_dna_req_cmp( + const sbp_msg_nap_device_dna_req_t *a, + const sbp_msg_nap_device_dna_req_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_nap_device_dna_req_t &lhs, const sbp_msg_nap_device_dna_req_t &rhs) { +static inline bool operator==(const sbp_msg_nap_device_dna_req_t &lhs, + const sbp_msg_nap_device_dna_req_t &rhs) { return sbp_msg_nap_device_dna_req_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_nap_device_dna_req_t &lhs, const sbp_msg_nap_device_dna_req_t &rhs) { +static inline bool operator!=(const sbp_msg_nap_device_dna_req_t &lhs, + const sbp_msg_nap_device_dna_req_t &rhs) { return sbp_msg_nap_device_dna_req_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_nap_device_dna_req_t &lhs, const sbp_msg_nap_device_dna_req_t &rhs) { +static inline bool operator<(const sbp_msg_nap_device_dna_req_t &lhs, + const sbp_msg_nap_device_dna_req_t &rhs) { return sbp_msg_nap_device_dna_req_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_nap_device_dna_req_t &lhs, const sbp_msg_nap_device_dna_req_t &rhs) { +static inline bool operator<=(const sbp_msg_nap_device_dna_req_t &lhs, + const sbp_msg_nap_device_dna_req_t &rhs) { return sbp_msg_nap_device_dna_req_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_nap_device_dna_req_t &lhs, const sbp_msg_nap_device_dna_req_t &rhs) { +static inline bool operator>(const sbp_msg_nap_device_dna_req_t &lhs, + const sbp_msg_nap_device_dna_req_t &rhs) { return sbp_msg_nap_device_dna_req_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_nap_device_dna_req_t &lhs, const sbp_msg_nap_device_dna_req_t &rhs) { +static inline bool operator>=(const sbp_msg_nap_device_dna_req_t &lhs, + const sbp_msg_nap_device_dna_req_t &rhs) { return sbp_msg_nap_device_dna_req_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_BOOTLOAD_MSG_NAP_DEVICE_DNA_REQ_H */ - diff --git a/c/include/libsbp/bootload/MSG_NAP_DEVICE_DNA_RESP.h b/c/include/libsbp/bootload/MSG_NAP_DEVICE_DNA_RESP.h index bd1ab2ef7..7eb06e5e2 100644 --- a/c/include/libsbp/bootload/MSG_NAP_DEVICE_DNA_RESP.h +++ b/c/include/libsbp/bootload/MSG_NAP_DEVICE_DNA_RESP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_BOOTLOAD_MSG_NAP_DEVICE_DNA_RESP_H #define LIBSBP_BOOTLOAD_MSG_NAP_DEVICE_DNA_RESP_H +#include +#include #include #include -#include -#include #include -#include +#include +#include #include #include -#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,27 +40,27 @@ *****************************************************************************/ /** Read FPGA device ID over UART response (host <= device) * -* The device message from the host reads a unique device identifier from the SwiftNAP, an FPGA. The host requests the ID by sending a MSG_NAP_DEVICE_DNA_REQ message. The device responds with a MSG_NAP_DEVICE_DNA_RESP message with the device ID in the payload. Note that this ID is tied to the FPGA, and not related to the Piksi's serial number. + * The device message from the host reads a unique device identifier from the + * SwiftNAP, an FPGA. The host requests the ID by sending a + * MSG_NAP_DEVICE_DNA_REQ message. The device responds with a + * MSG_NAP_DEVICE_DNA_RESP message with the device ID in the payload. Note that + * this ID is tied to the FPGA, and not related to the Piksi's serial number. */ typedef struct { - - /** - * 57-bit SwiftNAP FPGA Device ID. Remaining bits are padded on the right. + * 57-bit SwiftNAP FPGA Device ID. Remaining bits are padded on the right. */ u8 dna[SBP_MSG_NAP_DEVICE_DNA_RESP_DNA_MAX]; } sbp_msg_nap_device_dna_resp_t; - - /** * Get encoded size of an instance of sbp_msg_nap_device_dna_resp_t * * @param msg sbp_msg_nap_device_dna_resp_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_nap_device_dna_resp_encoded_len(const sbp_msg_nap_device_dna_resp_t *msg) -{ +static inline size_t sbp_msg_nap_device_dna_resp_encoded_len( + const sbp_msg_nap_device_dna_resp_t *msg) { (void)msg; return SBP_MSG_NAP_DEVICE_DNA_RESP_ENCODED_LEN; } @@ -68,36 +68,54 @@ static inline size_t sbp_msg_nap_device_dna_resp_encoded_len(const sbp_msg_nap_d /** * Encode an instance of sbp_msg_nap_device_dna_resp_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_nap_device_dna_resp_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_nap_device_dna_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_nap_device_dna_resp_t *msg); +SBP_EXPORT s8 sbp_msg_nap_device_dna_resp_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_nap_device_dna_resp_t *msg); /** * Decode an instance of sbp_msg_nap_device_dna_resp_t from wire representation * - * This function decodes the wire representation of a sbp_msg_nap_device_dna_resp_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_nap_device_dna_resp_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_nap_device_dna_resp_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_nap_device_dna_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_nap_device_dna_resp_t *msg); +SBP_EXPORT s8 sbp_msg_nap_device_dna_resp_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_nap_device_dna_resp_t *msg); /** - * Send an instance of sbp_msg_nap_device_dna_resp_t with the given write function + * Send an instance of sbp_msg_nap_device_dna_resp_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_nap_device_dna_resp_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_nap_device_dna_resp_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -105,51 +123,62 @@ SBP_EXPORT s8 sbp_msg_nap_device_dna_resp_decode(const uint8_t *buf, uint8_t len * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_nap_device_dna_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_nap_device_dna_resp_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_nap_device_dna_resp_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_nap_device_dna_resp_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_nap_device_dna_resp_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_nap_device_dna_resp_t instance * @param b sbp_msg_nap_device_dna_resp_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_nap_device_dna_resp_cmp(const sbp_msg_nap_device_dna_resp_t *a, const sbp_msg_nap_device_dna_resp_t *b); +SBP_EXPORT int sbp_msg_nap_device_dna_resp_cmp( + const sbp_msg_nap_device_dna_resp_t *a, + const sbp_msg_nap_device_dna_resp_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_nap_device_dna_resp_t &lhs, const sbp_msg_nap_device_dna_resp_t &rhs) { +static inline bool operator==(const sbp_msg_nap_device_dna_resp_t &lhs, + const sbp_msg_nap_device_dna_resp_t &rhs) { return sbp_msg_nap_device_dna_resp_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_nap_device_dna_resp_t &lhs, const sbp_msg_nap_device_dna_resp_t &rhs) { +static inline bool operator!=(const sbp_msg_nap_device_dna_resp_t &lhs, + const sbp_msg_nap_device_dna_resp_t &rhs) { return sbp_msg_nap_device_dna_resp_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_nap_device_dna_resp_t &lhs, const sbp_msg_nap_device_dna_resp_t &rhs) { +static inline bool operator<(const sbp_msg_nap_device_dna_resp_t &lhs, + const sbp_msg_nap_device_dna_resp_t &rhs) { return sbp_msg_nap_device_dna_resp_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_nap_device_dna_resp_t &lhs, const sbp_msg_nap_device_dna_resp_t &rhs) { +static inline bool operator<=(const sbp_msg_nap_device_dna_resp_t &lhs, + const sbp_msg_nap_device_dna_resp_t &rhs) { return sbp_msg_nap_device_dna_resp_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_nap_device_dna_resp_t &lhs, const sbp_msg_nap_device_dna_resp_t &rhs) { +static inline bool operator>(const sbp_msg_nap_device_dna_resp_t &lhs, + const sbp_msg_nap_device_dna_resp_t &rhs) { return sbp_msg_nap_device_dna_resp_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_nap_device_dna_resp_t &lhs, const sbp_msg_nap_device_dna_resp_t &rhs) { +static inline bool operator>=(const sbp_msg_nap_device_dna_resp_t &lhs, + const sbp_msg_nap_device_dna_resp_t &rhs) { return sbp_msg_nap_device_dna_resp_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_BOOTLOAD_MSG_NAP_DEVICE_DNA_RESP_H */ - diff --git a/c/include/libsbp/bootload_macros.h b/c/include/libsbp/bootload_macros.h index 1198457ed..eb9771fa3 100644 --- a/c/include/libsbp/bootload_macros.h +++ b/c/include/libsbp/bootload_macros.h @@ -18,112 +18,133 @@ #ifndef LIBSBP_BOOTLOAD_MACROS_H #define LIBSBP_BOOTLOAD_MACROS_H - #define SBP_MSG_BOOTLOADER_HANDSHAKE_REQ 0x00B3 /** - * Encoded length of sbp_msg_bootloader_handshake_req_t (V4 API) and + * Encoded length of sbp_msg_bootloader_handshake_req_t (V4 API) and * msg_bootloader_handshake_req_t (legacy API) */ #define SBP_MSG_BOOTLOADER_HANDSHAKE_REQ_ENCODED_LEN 0u - #define SBP_MSG_BOOTLOADER_HANDSHAKE_RESP 0x00B4 -#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK (0xffu) -#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT (8u) -#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_GET(flags) \ - ((u32)((u32)((flags) >> SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT) \ - & SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) -#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK << SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ - (((val) & (SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) \ - << (SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT)));} while(0) - - -#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK (0xffu) -#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT (0u) -#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_GET(flags) \ - ((u32)((u32)((flags) >> SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT) \ - & SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) -#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK << SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ - (((val) & (SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) \ - << (SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT)));} while(0) - +#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK \ + (0xffu) +#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT \ + (8u) +#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_GET( \ + flags) \ + ((u32)( \ + (u32)( \ + (flags) >> \ + SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT) & \ + SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) +#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SET( \ + flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK \ + << SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ + (((val) & \ + (SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) \ + << (SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT))); \ + } while (0) + +#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK \ + (0xffu) +#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT \ + (0u) +#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_GET( \ + flags) \ + ((u32)( \ + (u32)( \ + (flags) >> \ + SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT) & \ + SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) +#define SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SET( \ + flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK \ + << SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ + (((val) & \ + (SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) \ + << (SBP_BOOTLOADER_HANDSHAKE_RESP_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT))); \ + } while (0) /** - * The maximum number of items that can be stored in sbp_msg_bootloader_handshake_resp_t::version (V4 API) or msg_bootloader_handshake_resp_t::version (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_bootloader_handshake_resp_t::version (V4 API) or + * msg_bootloader_handshake_resp_t::version (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX 251u - /** - * Encoded length of sbp_msg_bootloader_handshake_resp_t (V4 API) and + * Encoded length of sbp_msg_bootloader_handshake_resp_t (V4 API) and * msg_bootloader_handshake_resp_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_bootloader_handshake_resp_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_bootloader_handshake_resp_encoded_len to determine the actual size + * of an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_ENCODED_OVERHEAD 4u - #define SBP_MSG_BOOTLOADER_JUMP_TO_APP 0x00B1 /** - * Encoded length of sbp_msg_bootloader_jump_to_app_t (V4 API) and + * Encoded length of sbp_msg_bootloader_jump_to_app_t (V4 API) and * msg_bootloader_jump_to_app_t (legacy API) */ #define SBP_MSG_BOOTLOADER_JUMP_TO_APP_ENCODED_LEN 1u - #define SBP_MSG_NAP_DEVICE_DNA_REQ 0x00DE /** - * Encoded length of sbp_msg_nap_device_dna_req_t (V4 API) and + * Encoded length of sbp_msg_nap_device_dna_req_t (V4 API) and * msg_nap_device_dna_req_t (legacy API) */ #define SBP_MSG_NAP_DEVICE_DNA_REQ_ENCODED_LEN 0u - #define SBP_MSG_NAP_DEVICE_DNA_RESP 0x00DD /** - * The maximum number of items that can be stored in sbp_msg_nap_device_dna_resp_t::dna (V4 API) or msg_nap_device_dna_resp_t::dna (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_nap_device_dna_resp_t::dna (V4 API) or msg_nap_device_dna_resp_t::dna + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_NAP_DEVICE_DNA_RESP_DNA_MAX 8u - /** - * Encoded length of sbp_msg_nap_device_dna_resp_t (V4 API) and + * Encoded length of sbp_msg_nap_device_dna_resp_t (V4 API) and * msg_nap_device_dna_resp_t (legacy API) */ #define SBP_MSG_NAP_DEVICE_DNA_RESP_ENCODED_LEN 8u - #define SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A 0x00B0 /** - * The maximum number of items that can be stored in sbp_msg_bootloader_handshake_dep_a_t::handshake (V4 API) or msg_bootloader_handshake_dep_a_t::handshake (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_bootloader_handshake_dep_a_t::handshake (V4 API) or + * msg_bootloader_handshake_dep_a_t::handshake (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX 255u - /** - * Encoded length of sbp_msg_bootloader_handshake_dep_a_t (V4 API) and + * Encoded length of sbp_msg_bootloader_handshake_dep_a_t (V4 API) and * msg_bootloader_handshake_dep_a_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_bootloader_handshake_dep_a_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_bootloader_handshake_dep_a_encoded_len to determine the actual size + * of an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_ENCODED_OVERHEAD 0u - - #endif /* LIBSBP_BOOTLOAD_MACROS_H */ diff --git a/c/include/libsbp/cpp/message_traits.h b/c/include/libsbp/cpp/message_traits.h index 66970de90..d48341256 100644 --- a/c/include/libsbp/cpp/message_traits.h +++ b/c/include/libsbp/cpp/message_traits.h @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include #include #include @@ -42,8 +44,6 @@ #include #include #include -#include -#include namespace sbp { @@ -53,35 +53,35 @@ namespace sbp { * These are only meant to be used by the C++ library at compile time. * These are automatically generated, DO NOT EDIT. */ -template +template struct MessageTraits; - -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgAcknowledge; static constexpr const char *name = "MSG_ACKNOWLEDGE"; - static const sbp_msg_acknowledge_t& get(const sbp_msg_t &msg) { + static const sbp_msg_acknowledge_t &get(const sbp_msg_t &msg) { return msg.acknowledge; } - static sbp_msg_acknowledge_t& get(sbp_msg_t &msg) { - return msg.acknowledge; - } - static void to_sbp_msg(const sbp_msg_acknowledge_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_acknowledge_t &get(sbp_msg_t &msg) { return msg.acknowledge; } + static void to_sbp_msg(const sbp_msg_acknowledge_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->acknowledge = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_acknowledge_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_acknowledge_t &msg) { sbp_msg_t sbp_msg; sbp_msg.acknowledge = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_acknowledge_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_acknowledge_t &msg, sbp_write_fn_t write) { return sbp_msg_acknowledge_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acknowledge_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_acknowledge_t &msg) { return sbp_msg_acknowledge_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acknowledge_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_acknowledge_t *msg) { return sbp_msg_acknowledge_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_acknowledge_t &msg) { @@ -89,31 +89,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgAcqResultDepA; static constexpr const char *name = "MSG_ACQ_RESULT_DEP_A"; - static const sbp_msg_acq_result_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_acq_result_dep_a_t &get(const sbp_msg_t &msg) { return msg.acq_result_dep_a; } - static sbp_msg_acq_result_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_acq_result_dep_a_t &get(sbp_msg_t &msg) { return msg.acq_result_dep_a; } - static void to_sbp_msg(const sbp_msg_acq_result_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_acq_result_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->acq_result_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_acq_result_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_acq_result_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.acq_result_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_acq_result_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_acq_result_dep_a_t &msg, sbp_write_fn_t write) { return sbp_msg_acq_result_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_result_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_acq_result_dep_a_t &msg) { return sbp_msg_acq_result_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_result_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_acq_result_dep_a_t *msg) { return sbp_msg_acq_result_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_acq_result_dep_a_t &msg) { @@ -121,31 +125,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgAcqResultDepB; static constexpr const char *name = "MSG_ACQ_RESULT_DEP_B"; - static const sbp_msg_acq_result_dep_b_t& get(const sbp_msg_t &msg) { + static const sbp_msg_acq_result_dep_b_t &get(const sbp_msg_t &msg) { return msg.acq_result_dep_b; } - static sbp_msg_acq_result_dep_b_t& get(sbp_msg_t &msg) { + static sbp_msg_acq_result_dep_b_t &get(sbp_msg_t &msg) { return msg.acq_result_dep_b; } - static void to_sbp_msg(const sbp_msg_acq_result_dep_b_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_acq_result_dep_b_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->acq_result_dep_b = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_acq_result_dep_b_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_acq_result_dep_b_t &msg) { sbp_msg_t sbp_msg; sbp_msg.acq_result_dep_b = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_acq_result_dep_b_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_acq_result_dep_b_t &msg, sbp_write_fn_t write) { return sbp_msg_acq_result_dep_b_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_result_dep_b_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_acq_result_dep_b_t &msg) { return sbp_msg_acq_result_dep_b_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_result_dep_b_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_acq_result_dep_b_t *msg) { return sbp_msg_acq_result_dep_b_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_acq_result_dep_b_t &msg) { @@ -153,31 +161,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgAcqResultDepC; static constexpr const char *name = "MSG_ACQ_RESULT_DEP_C"; - static const sbp_msg_acq_result_dep_c_t& get(const sbp_msg_t &msg) { + static const sbp_msg_acq_result_dep_c_t &get(const sbp_msg_t &msg) { return msg.acq_result_dep_c; } - static sbp_msg_acq_result_dep_c_t& get(sbp_msg_t &msg) { + static sbp_msg_acq_result_dep_c_t &get(sbp_msg_t &msg) { return msg.acq_result_dep_c; } - static void to_sbp_msg(const sbp_msg_acq_result_dep_c_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_acq_result_dep_c_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->acq_result_dep_c = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_acq_result_dep_c_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_acq_result_dep_c_t &msg) { sbp_msg_t sbp_msg; sbp_msg.acq_result_dep_c = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_acq_result_dep_c_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_acq_result_dep_c_t &msg, sbp_write_fn_t write) { return sbp_msg_acq_result_dep_c_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_result_dep_c_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_acq_result_dep_c_t &msg) { return sbp_msg_acq_result_dep_c_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_result_dep_c_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_acq_result_dep_c_t *msg) { return sbp_msg_acq_result_dep_c_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_acq_result_dep_c_t &msg) { @@ -185,31 +197,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgAcqResult; static constexpr const char *name = "MSG_ACQ_RESULT"; - static const sbp_msg_acq_result_t& get(const sbp_msg_t &msg) { - return msg.acq_result; - } - static sbp_msg_acq_result_t& get(sbp_msg_t &msg) { + static const sbp_msg_acq_result_t &get(const sbp_msg_t &msg) { return msg.acq_result; } - static void to_sbp_msg(const sbp_msg_acq_result_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_acq_result_t &get(sbp_msg_t &msg) { return msg.acq_result; } + static void to_sbp_msg(const sbp_msg_acq_result_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->acq_result = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_acq_result_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_acq_result_t &msg) { sbp_msg_t sbp_msg; sbp_msg.acq_result = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_acq_result_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_acq_result_t &msg, sbp_write_fn_t write) { return sbp_msg_acq_result_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_result_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_acq_result_t &msg) { return sbp_msg_acq_result_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_result_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_acq_result_t *msg) { return sbp_msg_acq_result_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_acq_result_t &msg) { @@ -217,31 +230,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgAcqSvProfileDep; static constexpr const char *name = "MSG_ACQ_SV_PROFILE_DEP"; - static const sbp_msg_acq_sv_profile_dep_t& get(const sbp_msg_t &msg) { + static const sbp_msg_acq_sv_profile_dep_t &get(const sbp_msg_t &msg) { return msg.acq_sv_profile_dep; } - static sbp_msg_acq_sv_profile_dep_t& get(sbp_msg_t &msg) { + static sbp_msg_acq_sv_profile_dep_t &get(sbp_msg_t &msg) { return msg.acq_sv_profile_dep; } - static void to_sbp_msg(const sbp_msg_acq_sv_profile_dep_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_acq_sv_profile_dep_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->acq_sv_profile_dep = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_acq_sv_profile_dep_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_acq_sv_profile_dep_t &msg) { sbp_msg_t sbp_msg; sbp_msg.acq_sv_profile_dep = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_acq_sv_profile_dep_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_acq_sv_profile_dep_t &msg, + sbp_write_fn_t write) { return sbp_msg_acq_sv_profile_dep_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_sv_profile_dep_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_acq_sv_profile_dep_t &msg) { return sbp_msg_acq_sv_profile_dep_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_sv_profile_dep_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_acq_sv_profile_dep_t *msg) { return sbp_msg_acq_sv_profile_dep_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_acq_sv_profile_dep_t &msg) { @@ -249,31 +267,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgAcqSvProfile; static constexpr const char *name = "MSG_ACQ_SV_PROFILE"; - static const sbp_msg_acq_sv_profile_t& get(const sbp_msg_t &msg) { + static const sbp_msg_acq_sv_profile_t &get(const sbp_msg_t &msg) { return msg.acq_sv_profile; } - static sbp_msg_acq_sv_profile_t& get(sbp_msg_t &msg) { + static sbp_msg_acq_sv_profile_t &get(sbp_msg_t &msg) { return msg.acq_sv_profile; } - static void to_sbp_msg(const sbp_msg_acq_sv_profile_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_acq_sv_profile_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->acq_sv_profile = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_acq_sv_profile_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_acq_sv_profile_t &msg) { sbp_msg_t sbp_msg; sbp_msg.acq_sv_profile = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_acq_sv_profile_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_acq_sv_profile_t &msg, sbp_write_fn_t write) { return sbp_msg_acq_sv_profile_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_sv_profile_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_acq_sv_profile_t &msg) { return sbp_msg_acq_sv_profile_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_sv_profile_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_acq_sv_profile_t *msg) { return sbp_msg_acq_sv_profile_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_acq_sv_profile_t &msg) { @@ -281,31 +303,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgAgeCorrections; static constexpr const char *name = "MSG_AGE_CORRECTIONS"; - static const sbp_msg_age_corrections_t& get(const sbp_msg_t &msg) { + static const sbp_msg_age_corrections_t &get(const sbp_msg_t &msg) { return msg.age_corrections; } - static sbp_msg_age_corrections_t& get(sbp_msg_t &msg) { + static sbp_msg_age_corrections_t &get(sbp_msg_t &msg) { return msg.age_corrections; } - static void to_sbp_msg(const sbp_msg_age_corrections_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_age_corrections_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->age_corrections = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_age_corrections_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_age_corrections_t &msg) { sbp_msg_t sbp_msg; sbp_msg.age_corrections = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_age_corrections_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_age_corrections_t &msg, sbp_write_fn_t write) { return sbp_msg_age_corrections_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_age_corrections_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_age_corrections_t &msg) { return sbp_msg_age_corrections_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_age_corrections_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_age_corrections_t *msg) { return sbp_msg_age_corrections_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_age_corrections_t &msg) { @@ -313,31 +339,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgAlmanacGloDep; static constexpr const char *name = "MSG_ALMANAC_GLO_DEP"; - static const sbp_msg_almanac_glo_dep_t& get(const sbp_msg_t &msg) { + static const sbp_msg_almanac_glo_dep_t &get(const sbp_msg_t &msg) { return msg.almanac_glo_dep; } - static sbp_msg_almanac_glo_dep_t& get(sbp_msg_t &msg) { + static sbp_msg_almanac_glo_dep_t &get(sbp_msg_t &msg) { return msg.almanac_glo_dep; } - static void to_sbp_msg(const sbp_msg_almanac_glo_dep_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_almanac_glo_dep_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->almanac_glo_dep = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_almanac_glo_dep_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_almanac_glo_dep_t &msg) { sbp_msg_t sbp_msg; sbp_msg.almanac_glo_dep = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_almanac_glo_dep_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_almanac_glo_dep_t &msg, sbp_write_fn_t write) { return sbp_msg_almanac_glo_dep_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_almanac_glo_dep_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_almanac_glo_dep_t &msg) { return sbp_msg_almanac_glo_dep_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_almanac_glo_dep_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_almanac_glo_dep_t *msg) { return sbp_msg_almanac_glo_dep_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_almanac_glo_dep_t &msg) { @@ -345,31 +375,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgAlmanacGlo; static constexpr const char *name = "MSG_ALMANAC_GLO"; - static const sbp_msg_almanac_glo_t& get(const sbp_msg_t &msg) { + static const sbp_msg_almanac_glo_t &get(const sbp_msg_t &msg) { return msg.almanac_glo; } - static sbp_msg_almanac_glo_t& get(sbp_msg_t &msg) { - return msg.almanac_glo; - } - static void to_sbp_msg(const sbp_msg_almanac_glo_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_almanac_glo_t &get(sbp_msg_t &msg) { return msg.almanac_glo; } + static void to_sbp_msg(const sbp_msg_almanac_glo_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->almanac_glo = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_almanac_glo_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_almanac_glo_t &msg) { sbp_msg_t sbp_msg; sbp_msg.almanac_glo = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_almanac_glo_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_almanac_glo_t &msg, sbp_write_fn_t write) { return sbp_msg_almanac_glo_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_almanac_glo_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_almanac_glo_t &msg) { return sbp_msg_almanac_glo_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_almanac_glo_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_almanac_glo_t *msg) { return sbp_msg_almanac_glo_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_almanac_glo_t &msg) { @@ -377,31 +408,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgAlmanacGpsDep; static constexpr const char *name = "MSG_ALMANAC_GPS_DEP"; - static const sbp_msg_almanac_gps_dep_t& get(const sbp_msg_t &msg) { + static const sbp_msg_almanac_gps_dep_t &get(const sbp_msg_t &msg) { return msg.almanac_gps_dep; } - static sbp_msg_almanac_gps_dep_t& get(sbp_msg_t &msg) { + static sbp_msg_almanac_gps_dep_t &get(sbp_msg_t &msg) { return msg.almanac_gps_dep; } - static void to_sbp_msg(const sbp_msg_almanac_gps_dep_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_almanac_gps_dep_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->almanac_gps_dep = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_almanac_gps_dep_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_almanac_gps_dep_t &msg) { sbp_msg_t sbp_msg; sbp_msg.almanac_gps_dep = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_almanac_gps_dep_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_almanac_gps_dep_t &msg, sbp_write_fn_t write) { return sbp_msg_almanac_gps_dep_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_almanac_gps_dep_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_almanac_gps_dep_t &msg) { return sbp_msg_almanac_gps_dep_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_almanac_gps_dep_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_almanac_gps_dep_t *msg) { return sbp_msg_almanac_gps_dep_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_almanac_gps_dep_t &msg) { @@ -409,31 +444,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgAlmanacGps; static constexpr const char *name = "MSG_ALMANAC_GPS"; - static const sbp_msg_almanac_gps_t& get(const sbp_msg_t &msg) { - return msg.almanac_gps; - } - static sbp_msg_almanac_gps_t& get(sbp_msg_t &msg) { + static const sbp_msg_almanac_gps_t &get(const sbp_msg_t &msg) { return msg.almanac_gps; } - static void to_sbp_msg(const sbp_msg_almanac_gps_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_almanac_gps_t &get(sbp_msg_t &msg) { return msg.almanac_gps; } + static void to_sbp_msg(const sbp_msg_almanac_gps_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->almanac_gps = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_almanac_gps_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_almanac_gps_t &msg) { sbp_msg_t sbp_msg; sbp_msg.almanac_gps = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_almanac_gps_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_almanac_gps_t &msg, sbp_write_fn_t write) { return sbp_msg_almanac_gps_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_almanac_gps_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_almanac_gps_t &msg) { return sbp_msg_almanac_gps_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_almanac_gps_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_almanac_gps_t *msg) { return sbp_msg_almanac_gps_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_almanac_gps_t &msg) { @@ -441,31 +477,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgAlmanac; static constexpr const char *name = "MSG_ALMANAC"; - static const sbp_msg_almanac_t& get(const sbp_msg_t &msg) { + static const sbp_msg_almanac_t &get(const sbp_msg_t &msg) { return msg.almanac; } - static sbp_msg_almanac_t& get(sbp_msg_t &msg) { - return msg.almanac; - } - static void to_sbp_msg(const sbp_msg_almanac_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_almanac_t &get(sbp_msg_t &msg) { return msg.almanac; } + static void to_sbp_msg(const sbp_msg_almanac_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->almanac = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_almanac_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_almanac_t &msg) { sbp_msg_t sbp_msg; sbp_msg.almanac = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_almanac_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_almanac_t &msg, sbp_write_fn_t write) { return sbp_msg_almanac_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_almanac_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_almanac_t &msg) { return sbp_msg_almanac_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_almanac_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_almanac_t *msg) { return sbp_msg_almanac_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_almanac_t &msg) { @@ -473,31 +510,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgAngularRate; static constexpr const char *name = "MSG_ANGULAR_RATE"; - static const sbp_msg_angular_rate_t& get(const sbp_msg_t &msg) { + static const sbp_msg_angular_rate_t &get(const sbp_msg_t &msg) { return msg.angular_rate; } - static sbp_msg_angular_rate_t& get(sbp_msg_t &msg) { + static sbp_msg_angular_rate_t &get(sbp_msg_t &msg) { return msg.angular_rate; } - static void to_sbp_msg(const sbp_msg_angular_rate_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_angular_rate_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->angular_rate = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_angular_rate_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_angular_rate_t &msg) { sbp_msg_t sbp_msg; sbp_msg.angular_rate = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_angular_rate_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_angular_rate_t &msg, sbp_write_fn_t write) { return sbp_msg_angular_rate_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_angular_rate_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_angular_rate_t &msg) { return sbp_msg_angular_rate_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_angular_rate_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_angular_rate_t *msg) { return sbp_msg_angular_rate_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_angular_rate_t &msg) { @@ -505,31 +546,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgBasePosEcef; static constexpr const char *name = "MSG_BASE_POS_ECEF"; - static const sbp_msg_base_pos_ecef_t& get(const sbp_msg_t &msg) { + static const sbp_msg_base_pos_ecef_t &get(const sbp_msg_t &msg) { return msg.base_pos_ecef; } - static sbp_msg_base_pos_ecef_t& get(sbp_msg_t &msg) { + static sbp_msg_base_pos_ecef_t &get(sbp_msg_t &msg) { return msg.base_pos_ecef; } - static void to_sbp_msg(const sbp_msg_base_pos_ecef_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_base_pos_ecef_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->base_pos_ecef = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_base_pos_ecef_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_base_pos_ecef_t &msg) { sbp_msg_t sbp_msg; sbp_msg.base_pos_ecef = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_base_pos_ecef_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_base_pos_ecef_t &msg, sbp_write_fn_t write) { return sbp_msg_base_pos_ecef_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_base_pos_ecef_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_base_pos_ecef_t &msg) { return sbp_msg_base_pos_ecef_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_base_pos_ecef_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_base_pos_ecef_t *msg) { return sbp_msg_base_pos_ecef_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_base_pos_ecef_t &msg) { @@ -537,31 +582,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgBasePosLlh; static constexpr const char *name = "MSG_BASE_POS_LLH"; - static const sbp_msg_base_pos_llh_t& get(const sbp_msg_t &msg) { + static const sbp_msg_base_pos_llh_t &get(const sbp_msg_t &msg) { return msg.base_pos_llh; } - static sbp_msg_base_pos_llh_t& get(sbp_msg_t &msg) { + static sbp_msg_base_pos_llh_t &get(sbp_msg_t &msg) { return msg.base_pos_llh; } - static void to_sbp_msg(const sbp_msg_base_pos_llh_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_base_pos_llh_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->base_pos_llh = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_base_pos_llh_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_base_pos_llh_t &msg) { sbp_msg_t sbp_msg; sbp_msg.base_pos_llh = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_base_pos_llh_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_base_pos_llh_t &msg, sbp_write_fn_t write) { return sbp_msg_base_pos_llh_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_base_pos_llh_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_base_pos_llh_t &msg) { return sbp_msg_base_pos_llh_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_base_pos_llh_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_base_pos_llh_t *msg) { return sbp_msg_base_pos_llh_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_base_pos_llh_t &msg) { @@ -569,31 +618,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgBaselineEcefDepA; static constexpr const char *name = "MSG_BASELINE_ECEF_DEP_A"; - static const sbp_msg_baseline_ecef_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_baseline_ecef_dep_a_t &get(const sbp_msg_t &msg) { return msg.baseline_ecef_dep_a; } - static sbp_msg_baseline_ecef_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_baseline_ecef_dep_a_t &get(sbp_msg_t &msg) { return msg.baseline_ecef_dep_a; } - static void to_sbp_msg(const sbp_msg_baseline_ecef_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_baseline_ecef_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->baseline_ecef_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_baseline_ecef_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_baseline_ecef_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.baseline_ecef_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_baseline_ecef_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_baseline_ecef_dep_a_t &msg, + sbp_write_fn_t write) { return sbp_msg_baseline_ecef_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_ecef_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_baseline_ecef_dep_a_t &msg) { return sbp_msg_baseline_ecef_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_ecef_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_baseline_ecef_dep_a_t *msg) { return sbp_msg_baseline_ecef_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_baseline_ecef_dep_a_t &msg) { @@ -601,31 +655,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgBaselineEcef; static constexpr const char *name = "MSG_BASELINE_ECEF"; - static const sbp_msg_baseline_ecef_t& get(const sbp_msg_t &msg) { + static const sbp_msg_baseline_ecef_t &get(const sbp_msg_t &msg) { return msg.baseline_ecef; } - static sbp_msg_baseline_ecef_t& get(sbp_msg_t &msg) { + static sbp_msg_baseline_ecef_t &get(sbp_msg_t &msg) { return msg.baseline_ecef; } - static void to_sbp_msg(const sbp_msg_baseline_ecef_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_baseline_ecef_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->baseline_ecef = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_baseline_ecef_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_baseline_ecef_t &msg) { sbp_msg_t sbp_msg; sbp_msg.baseline_ecef = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_baseline_ecef_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_baseline_ecef_t &msg, sbp_write_fn_t write) { return sbp_msg_baseline_ecef_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_ecef_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_baseline_ecef_t &msg) { return sbp_msg_baseline_ecef_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_ecef_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_baseline_ecef_t *msg) { return sbp_msg_baseline_ecef_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_baseline_ecef_t &msg) { @@ -633,31 +691,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgBaselineHeadingDepA; static constexpr const char *name = "MSG_BASELINE_HEADING_DEP_A"; - static const sbp_msg_baseline_heading_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_baseline_heading_dep_a_t &get(const sbp_msg_t &msg) { return msg.baseline_heading_dep_a; } - static sbp_msg_baseline_heading_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_baseline_heading_dep_a_t &get(sbp_msg_t &msg) { return msg.baseline_heading_dep_a; } - static void to_sbp_msg(const sbp_msg_baseline_heading_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_baseline_heading_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->baseline_heading_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_baseline_heading_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_baseline_heading_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.baseline_heading_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_baseline_heading_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_baseline_heading_dep_a_t &msg, + sbp_write_fn_t write) { return sbp_msg_baseline_heading_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_heading_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_baseline_heading_dep_a_t &msg) { return sbp_msg_baseline_heading_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_heading_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_baseline_heading_dep_a_t *msg) { return sbp_msg_baseline_heading_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_baseline_heading_dep_a_t &msg) { @@ -665,31 +728,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgBaselineHeading; static constexpr const char *name = "MSG_BASELINE_HEADING"; - static const sbp_msg_baseline_heading_t& get(const sbp_msg_t &msg) { + static const sbp_msg_baseline_heading_t &get(const sbp_msg_t &msg) { return msg.baseline_heading; } - static sbp_msg_baseline_heading_t& get(sbp_msg_t &msg) { + static sbp_msg_baseline_heading_t &get(sbp_msg_t &msg) { return msg.baseline_heading; } - static void to_sbp_msg(const sbp_msg_baseline_heading_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_baseline_heading_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->baseline_heading = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_baseline_heading_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_baseline_heading_t &msg) { sbp_msg_t sbp_msg; sbp_msg.baseline_heading = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_baseline_heading_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_baseline_heading_t &msg, sbp_write_fn_t write) { return sbp_msg_baseline_heading_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_heading_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_baseline_heading_t &msg) { return sbp_msg_baseline_heading_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_heading_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_baseline_heading_t *msg) { return sbp_msg_baseline_heading_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_baseline_heading_t &msg) { @@ -697,31 +764,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgBaselineNedDepA; static constexpr const char *name = "MSG_BASELINE_NED_DEP_A"; - static const sbp_msg_baseline_ned_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_baseline_ned_dep_a_t &get(const sbp_msg_t &msg) { return msg.baseline_ned_dep_a; } - static sbp_msg_baseline_ned_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_baseline_ned_dep_a_t &get(sbp_msg_t &msg) { return msg.baseline_ned_dep_a; } - static void to_sbp_msg(const sbp_msg_baseline_ned_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_baseline_ned_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->baseline_ned_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_baseline_ned_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_baseline_ned_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.baseline_ned_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_baseline_ned_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_baseline_ned_dep_a_t &msg, + sbp_write_fn_t write) { return sbp_msg_baseline_ned_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_ned_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_baseline_ned_dep_a_t &msg) { return sbp_msg_baseline_ned_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_ned_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_baseline_ned_dep_a_t *msg) { return sbp_msg_baseline_ned_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_baseline_ned_dep_a_t &msg) { @@ -729,31 +801,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgBaselineNed; static constexpr const char *name = "MSG_BASELINE_NED"; - static const sbp_msg_baseline_ned_t& get(const sbp_msg_t &msg) { + static const sbp_msg_baseline_ned_t &get(const sbp_msg_t &msg) { return msg.baseline_ned; } - static sbp_msg_baseline_ned_t& get(sbp_msg_t &msg) { + static sbp_msg_baseline_ned_t &get(sbp_msg_t &msg) { return msg.baseline_ned; } - static void to_sbp_msg(const sbp_msg_baseline_ned_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_baseline_ned_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->baseline_ned = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_baseline_ned_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_baseline_ned_t &msg) { sbp_msg_t sbp_msg; sbp_msg.baseline_ned = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_baseline_ned_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_baseline_ned_t &msg, sbp_write_fn_t write) { return sbp_msg_baseline_ned_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_ned_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_baseline_ned_t &msg) { return sbp_msg_baseline_ned_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_ned_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_baseline_ned_t *msg) { return sbp_msg_baseline_ned_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_baseline_ned_t &msg) { @@ -761,31 +837,37 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgBootloaderHandshakeDepA; static constexpr const char *name = "MSG_BOOTLOADER_HANDSHAKE_DEP_A"; - static const sbp_msg_bootloader_handshake_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_bootloader_handshake_dep_a_t &get(const sbp_msg_t &msg) { return msg.bootloader_handshake_dep_a; } - static sbp_msg_bootloader_handshake_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_bootloader_handshake_dep_a_t &get(sbp_msg_t &msg) { return msg.bootloader_handshake_dep_a; } - static void to_sbp_msg(const sbp_msg_bootloader_handshake_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_bootloader_handshake_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->bootloader_handshake_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_bootloader_handshake_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_bootloader_handshake_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.bootloader_handshake_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_bootloader_handshake_dep_a_t &msg, sbp_write_fn_t write) { - return sbp_msg_bootloader_handshake_dep_a_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_bootloader_handshake_dep_a_t &msg, + sbp_write_fn_t write) { + return sbp_msg_bootloader_handshake_dep_a_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_bootloader_handshake_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_bootloader_handshake_dep_a_t &msg) { return sbp_msg_bootloader_handshake_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_bootloader_handshake_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_bootloader_handshake_dep_a_t *msg) { return sbp_msg_bootloader_handshake_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_bootloader_handshake_dep_a_t &msg) { @@ -793,31 +875,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgBootloaderHandshakeReq; static constexpr const char *name = "MSG_BOOTLOADER_HANDSHAKE_REQ"; - static const sbp_msg_bootloader_handshake_req_t& get(const sbp_msg_t &msg) { + static const sbp_msg_bootloader_handshake_req_t &get(const sbp_msg_t &msg) { return msg.bootloader_handshake_req; } - static sbp_msg_bootloader_handshake_req_t& get(sbp_msg_t &msg) { + static sbp_msg_bootloader_handshake_req_t &get(sbp_msg_t &msg) { return msg.bootloader_handshake_req; } - static void to_sbp_msg(const sbp_msg_bootloader_handshake_req_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_bootloader_handshake_req_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->bootloader_handshake_req = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_bootloader_handshake_req_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_bootloader_handshake_req_t &msg) { sbp_msg_t sbp_msg; sbp_msg.bootloader_handshake_req = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_bootloader_handshake_req_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_bootloader_handshake_req_t &msg, + sbp_write_fn_t write) { return sbp_msg_bootloader_handshake_req_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_bootloader_handshake_req_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_bootloader_handshake_req_t &msg) { return sbp_msg_bootloader_handshake_req_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_bootloader_handshake_req_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_bootloader_handshake_req_t *msg) { return sbp_msg_bootloader_handshake_req_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_bootloader_handshake_req_t &msg) { @@ -825,31 +912,37 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgBootloaderHandshakeResp; static constexpr const char *name = "MSG_BOOTLOADER_HANDSHAKE_RESP"; - static const sbp_msg_bootloader_handshake_resp_t& get(const sbp_msg_t &msg) { + static const sbp_msg_bootloader_handshake_resp_t &get(const sbp_msg_t &msg) { return msg.bootloader_handshake_resp; } - static sbp_msg_bootloader_handshake_resp_t& get(sbp_msg_t &msg) { + static sbp_msg_bootloader_handshake_resp_t &get(sbp_msg_t &msg) { return msg.bootloader_handshake_resp; } - static void to_sbp_msg(const sbp_msg_bootloader_handshake_resp_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_bootloader_handshake_resp_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->bootloader_handshake_resp = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_bootloader_handshake_resp_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_bootloader_handshake_resp_t &msg) { sbp_msg_t sbp_msg; sbp_msg.bootloader_handshake_resp = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_bootloader_handshake_resp_t &msg, sbp_write_fn_t write) { - return sbp_msg_bootloader_handshake_resp_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_bootloader_handshake_resp_t &msg, + sbp_write_fn_t write) { + return sbp_msg_bootloader_handshake_resp_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_bootloader_handshake_resp_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_bootloader_handshake_resp_t &msg) { return sbp_msg_bootloader_handshake_resp_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_bootloader_handshake_resp_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_bootloader_handshake_resp_t *msg) { return sbp_msg_bootloader_handshake_resp_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_bootloader_handshake_resp_t &msg) { @@ -857,31 +950,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgBootloaderJumpToApp; static constexpr const char *name = "MSG_BOOTLOADER_JUMP_TO_APP"; - static const sbp_msg_bootloader_jump_to_app_t& get(const sbp_msg_t &msg) { + static const sbp_msg_bootloader_jump_to_app_t &get(const sbp_msg_t &msg) { return msg.bootloader_jump_to_app; } - static sbp_msg_bootloader_jump_to_app_t& get(sbp_msg_t &msg) { + static sbp_msg_bootloader_jump_to_app_t &get(sbp_msg_t &msg) { return msg.bootloader_jump_to_app; } - static void to_sbp_msg(const sbp_msg_bootloader_jump_to_app_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_bootloader_jump_to_app_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->bootloader_jump_to_app = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_bootloader_jump_to_app_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_bootloader_jump_to_app_t &msg) { sbp_msg_t sbp_msg; sbp_msg.bootloader_jump_to_app = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_bootloader_jump_to_app_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_bootloader_jump_to_app_t &msg, + sbp_write_fn_t write) { return sbp_msg_bootloader_jump_to_app_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_bootloader_jump_to_app_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_bootloader_jump_to_app_t &msg) { return sbp_msg_bootloader_jump_to_app_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_bootloader_jump_to_app_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_bootloader_jump_to_app_t *msg) { return sbp_msg_bootloader_jump_to_app_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_bootloader_jump_to_app_t &msg) { @@ -889,31 +987,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgCellModemStatus; static constexpr const char *name = "MSG_CELL_MODEM_STATUS"; - static const sbp_msg_cell_modem_status_t& get(const sbp_msg_t &msg) { + static const sbp_msg_cell_modem_status_t &get(const sbp_msg_t &msg) { return msg.cell_modem_status; } - static sbp_msg_cell_modem_status_t& get(sbp_msg_t &msg) { + static sbp_msg_cell_modem_status_t &get(sbp_msg_t &msg) { return msg.cell_modem_status; } - static void to_sbp_msg(const sbp_msg_cell_modem_status_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_cell_modem_status_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->cell_modem_status = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_cell_modem_status_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_cell_modem_status_t &msg) { sbp_msg_t sbp_msg; sbp_msg.cell_modem_status = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_cell_modem_status_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_cell_modem_status_t &msg, sbp_write_fn_t write) { return sbp_msg_cell_modem_status_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_cell_modem_status_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_cell_modem_status_t &msg) { return sbp_msg_cell_modem_status_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_cell_modem_status_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_cell_modem_status_t *msg) { return sbp_msg_cell_modem_status_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_cell_modem_status_t &msg) { @@ -921,31 +1023,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgCertificateChainDep; static constexpr const char *name = "MSG_CERTIFICATE_CHAIN_DEP"; - static const sbp_msg_certificate_chain_dep_t& get(const sbp_msg_t &msg) { + static const sbp_msg_certificate_chain_dep_t &get(const sbp_msg_t &msg) { return msg.certificate_chain_dep; } - static sbp_msg_certificate_chain_dep_t& get(sbp_msg_t &msg) { + static sbp_msg_certificate_chain_dep_t &get(sbp_msg_t &msg) { return msg.certificate_chain_dep; } - static void to_sbp_msg(const sbp_msg_certificate_chain_dep_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_certificate_chain_dep_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->certificate_chain_dep = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_certificate_chain_dep_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_certificate_chain_dep_t &msg) { sbp_msg_t sbp_msg; sbp_msg.certificate_chain_dep = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_certificate_chain_dep_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_certificate_chain_dep_t &msg, + sbp_write_fn_t write) { return sbp_msg_certificate_chain_dep_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_certificate_chain_dep_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_certificate_chain_dep_t &msg) { return sbp_msg_certificate_chain_dep_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_certificate_chain_dep_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_certificate_chain_dep_t *msg) { return sbp_msg_certificate_chain_dep_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_certificate_chain_dep_t &msg) { @@ -953,31 +1060,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgCertificateChain; static constexpr const char *name = "MSG_CERTIFICATE_CHAIN"; - static const sbp_msg_certificate_chain_t& get(const sbp_msg_t &msg) { + static const sbp_msg_certificate_chain_t &get(const sbp_msg_t &msg) { return msg.certificate_chain; } - static sbp_msg_certificate_chain_t& get(sbp_msg_t &msg) { + static sbp_msg_certificate_chain_t &get(sbp_msg_t &msg) { return msg.certificate_chain; } - static void to_sbp_msg(const sbp_msg_certificate_chain_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_certificate_chain_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->certificate_chain = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_certificate_chain_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_certificate_chain_t &msg) { sbp_msg_t sbp_msg; sbp_msg.certificate_chain = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_certificate_chain_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_certificate_chain_t &msg, sbp_write_fn_t write) { return sbp_msg_certificate_chain_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_certificate_chain_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_certificate_chain_t &msg) { return sbp_msg_certificate_chain_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_certificate_chain_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_certificate_chain_t *msg) { return sbp_msg_certificate_chain_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_certificate_chain_t &msg) { @@ -985,31 +1096,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgCommandOutput; static constexpr const char *name = "MSG_COMMAND_OUTPUT"; - static const sbp_msg_command_output_t& get(const sbp_msg_t &msg) { + static const sbp_msg_command_output_t &get(const sbp_msg_t &msg) { return msg.command_output; } - static sbp_msg_command_output_t& get(sbp_msg_t &msg) { + static sbp_msg_command_output_t &get(sbp_msg_t &msg) { return msg.command_output; } - static void to_sbp_msg(const sbp_msg_command_output_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_command_output_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->command_output = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_command_output_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_command_output_t &msg) { sbp_msg_t sbp_msg; sbp_msg.command_output = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_command_output_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_command_output_t &msg, sbp_write_fn_t write) { return sbp_msg_command_output_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_command_output_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_command_output_t &msg) { return sbp_msg_command_output_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_command_output_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_command_output_t *msg) { return sbp_msg_command_output_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_command_output_t &msg) { @@ -1017,31 +1132,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgCommandReq; static constexpr const char *name = "MSG_COMMAND_REQ"; - static const sbp_msg_command_req_t& get(const sbp_msg_t &msg) { - return msg.command_req; - } - static sbp_msg_command_req_t& get(sbp_msg_t &msg) { + static const sbp_msg_command_req_t &get(const sbp_msg_t &msg) { return msg.command_req; } - static void to_sbp_msg(const sbp_msg_command_req_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_command_req_t &get(sbp_msg_t &msg) { return msg.command_req; } + static void to_sbp_msg(const sbp_msg_command_req_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->command_req = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_command_req_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_command_req_t &msg) { sbp_msg_t sbp_msg; sbp_msg.command_req = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_command_req_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_command_req_t &msg, sbp_write_fn_t write) { return sbp_msg_command_req_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_command_req_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_command_req_t &msg) { return sbp_msg_command_req_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_command_req_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_command_req_t *msg) { return sbp_msg_command_req_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_command_req_t &msg) { @@ -1049,31 +1165,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgCommandResp; static constexpr const char *name = "MSG_COMMAND_RESP"; - static const sbp_msg_command_resp_t& get(const sbp_msg_t &msg) { + static const sbp_msg_command_resp_t &get(const sbp_msg_t &msg) { return msg.command_resp; } - static sbp_msg_command_resp_t& get(sbp_msg_t &msg) { + static sbp_msg_command_resp_t &get(sbp_msg_t &msg) { return msg.command_resp; } - static void to_sbp_msg(const sbp_msg_command_resp_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_command_resp_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->command_resp = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_command_resp_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_command_resp_t &msg) { sbp_msg_t sbp_msg; sbp_msg.command_resp = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_command_resp_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_command_resp_t &msg, sbp_write_fn_t write) { return sbp_msg_command_resp_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_command_resp_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_command_resp_t &msg) { return sbp_msg_command_resp_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_command_resp_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_command_resp_t *msg) { return sbp_msg_command_resp_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_command_resp_t &msg) { @@ -1081,31 +1201,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgCsacTelemetryLabels; static constexpr const char *name = "MSG_CSAC_TELEMETRY_LABELS"; - static const sbp_msg_csac_telemetry_labels_t& get(const sbp_msg_t &msg) { + static const sbp_msg_csac_telemetry_labels_t &get(const sbp_msg_t &msg) { return msg.csac_telemetry_labels; } - static sbp_msg_csac_telemetry_labels_t& get(sbp_msg_t &msg) { + static sbp_msg_csac_telemetry_labels_t &get(sbp_msg_t &msg) { return msg.csac_telemetry_labels; } - static void to_sbp_msg(const sbp_msg_csac_telemetry_labels_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_csac_telemetry_labels_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->csac_telemetry_labels = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_csac_telemetry_labels_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_csac_telemetry_labels_t &msg) { sbp_msg_t sbp_msg; sbp_msg.csac_telemetry_labels = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_csac_telemetry_labels_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_csac_telemetry_labels_t &msg, + sbp_write_fn_t write) { return sbp_msg_csac_telemetry_labels_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_csac_telemetry_labels_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_csac_telemetry_labels_t &msg) { return sbp_msg_csac_telemetry_labels_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_csac_telemetry_labels_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_csac_telemetry_labels_t *msg) { return sbp_msg_csac_telemetry_labels_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_csac_telemetry_labels_t &msg) { @@ -1113,31 +1238,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgCsacTelemetry; static constexpr const char *name = "MSG_CSAC_TELEMETRY"; - static const sbp_msg_csac_telemetry_t& get(const sbp_msg_t &msg) { + static const sbp_msg_csac_telemetry_t &get(const sbp_msg_t &msg) { return msg.csac_telemetry; } - static sbp_msg_csac_telemetry_t& get(sbp_msg_t &msg) { + static sbp_msg_csac_telemetry_t &get(sbp_msg_t &msg) { return msg.csac_telemetry; } - static void to_sbp_msg(const sbp_msg_csac_telemetry_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_csac_telemetry_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->csac_telemetry = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_csac_telemetry_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_csac_telemetry_t &msg) { sbp_msg_t sbp_msg; sbp_msg.csac_telemetry = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_csac_telemetry_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_csac_telemetry_t &msg, sbp_write_fn_t write) { return sbp_msg_csac_telemetry_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_csac_telemetry_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_csac_telemetry_t &msg) { return sbp_msg_csac_telemetry_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_csac_telemetry_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_csac_telemetry_t *msg) { return sbp_msg_csac_telemetry_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_csac_telemetry_t &msg) { @@ -1145,31 +1274,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgCwResults; static constexpr const char *name = "MSG_CW_RESULTS"; - static const sbp_msg_cw_results_t& get(const sbp_msg_t &msg) { + static const sbp_msg_cw_results_t &get(const sbp_msg_t &msg) { return msg.cw_results; } - static sbp_msg_cw_results_t& get(sbp_msg_t &msg) { - return msg.cw_results; - } - static void to_sbp_msg(const sbp_msg_cw_results_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_cw_results_t &get(sbp_msg_t &msg) { return msg.cw_results; } + static void to_sbp_msg(const sbp_msg_cw_results_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->cw_results = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_cw_results_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_cw_results_t &msg) { sbp_msg_t sbp_msg; sbp_msg.cw_results = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_cw_results_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_cw_results_t &msg, sbp_write_fn_t write) { return sbp_msg_cw_results_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_cw_results_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_cw_results_t &msg) { return sbp_msg_cw_results_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_cw_results_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_cw_results_t *msg) { return sbp_msg_cw_results_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_cw_results_t &msg) { @@ -1177,31 +1307,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgCwStart; static constexpr const char *name = "MSG_CW_START"; - static const sbp_msg_cw_start_t& get(const sbp_msg_t &msg) { - return msg.cw_start; - } - static sbp_msg_cw_start_t& get(sbp_msg_t &msg) { + static const sbp_msg_cw_start_t &get(const sbp_msg_t &msg) { return msg.cw_start; } - static void to_sbp_msg(const sbp_msg_cw_start_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_cw_start_t &get(sbp_msg_t &msg) { return msg.cw_start; } + static void to_sbp_msg(const sbp_msg_cw_start_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->cw_start = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_cw_start_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_cw_start_t &msg) { sbp_msg_t sbp_msg; sbp_msg.cw_start = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_cw_start_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_cw_start_t &msg, sbp_write_fn_t write) { return sbp_msg_cw_start_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_cw_start_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_cw_start_t &msg) { return sbp_msg_cw_start_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_cw_start_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_cw_start_t *msg) { return sbp_msg_cw_start_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_cw_start_t &msg) { @@ -1209,31 +1340,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgDeviceMonitor; static constexpr const char *name = "MSG_DEVICE_MONITOR"; - static const sbp_msg_device_monitor_t& get(const sbp_msg_t &msg) { + static const sbp_msg_device_monitor_t &get(const sbp_msg_t &msg) { return msg.device_monitor; } - static sbp_msg_device_monitor_t& get(sbp_msg_t &msg) { + static sbp_msg_device_monitor_t &get(sbp_msg_t &msg) { return msg.device_monitor; } - static void to_sbp_msg(const sbp_msg_device_monitor_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_device_monitor_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->device_monitor = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_device_monitor_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_device_monitor_t &msg) { sbp_msg_t sbp_msg; sbp_msg.device_monitor = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_device_monitor_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_device_monitor_t &msg, sbp_write_fn_t write) { return sbp_msg_device_monitor_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_device_monitor_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_device_monitor_t &msg) { return sbp_msg_device_monitor_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_device_monitor_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_device_monitor_t *msg) { return sbp_msg_device_monitor_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_device_monitor_t &msg) { @@ -1241,31 +1376,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgDgnssStatus; static constexpr const char *name = "MSG_DGNSS_STATUS"; - static const sbp_msg_dgnss_status_t& get(const sbp_msg_t &msg) { + static const sbp_msg_dgnss_status_t &get(const sbp_msg_t &msg) { return msg.dgnss_status; } - static sbp_msg_dgnss_status_t& get(sbp_msg_t &msg) { + static sbp_msg_dgnss_status_t &get(sbp_msg_t &msg) { return msg.dgnss_status; } - static void to_sbp_msg(const sbp_msg_dgnss_status_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_dgnss_status_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->dgnss_status = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_dgnss_status_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_dgnss_status_t &msg) { sbp_msg_t sbp_msg; sbp_msg.dgnss_status = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_dgnss_status_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_dgnss_status_t &msg, sbp_write_fn_t write) { return sbp_msg_dgnss_status_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_dgnss_status_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_dgnss_status_t &msg) { return sbp_msg_dgnss_status_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_dgnss_status_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_dgnss_status_t *msg) { return sbp_msg_dgnss_status_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_dgnss_status_t &msg) { @@ -1273,31 +1412,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgDopsDepA; static constexpr const char *name = "MSG_DOPS_DEP_A"; - static const sbp_msg_dops_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_dops_dep_a_t &get(const sbp_msg_t &msg) { return msg.dops_dep_a; } - static sbp_msg_dops_dep_a_t& get(sbp_msg_t &msg) { - return msg.dops_dep_a; - } - static void to_sbp_msg(const sbp_msg_dops_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_dops_dep_a_t &get(sbp_msg_t &msg) { return msg.dops_dep_a; } + static void to_sbp_msg(const sbp_msg_dops_dep_a_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->dops_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_dops_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_dops_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.dops_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_dops_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_dops_dep_a_t &msg, sbp_write_fn_t write) { return sbp_msg_dops_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_dops_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_dops_dep_a_t &msg) { return sbp_msg_dops_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_dops_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_dops_dep_a_t *msg) { return sbp_msg_dops_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_dops_dep_a_t &msg) { @@ -1305,31 +1445,30 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgDops; static constexpr const char *name = "MSG_DOPS"; - static const sbp_msg_dops_t& get(const sbp_msg_t &msg) { - return msg.dops; - } - static sbp_msg_dops_t& get(sbp_msg_t &msg) { - return msg.dops; - } - static void to_sbp_msg(const sbp_msg_dops_t& msg, sbp_msg_t *sbp_msg) { + static const sbp_msg_dops_t &get(const sbp_msg_t &msg) { return msg.dops; } + static sbp_msg_dops_t &get(sbp_msg_t &msg) { return msg.dops; } + static void to_sbp_msg(const sbp_msg_dops_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->dops = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_dops_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_dops_t &msg) { sbp_msg_t sbp_msg; sbp_msg.dops = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_dops_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_dops_t &msg, + sbp_write_fn_t write) { return sbp_msg_dops_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_dops_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_dops_t &msg) { return sbp_msg_dops_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_dops_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_dops_t *msg) { return sbp_msg_dops_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_dops_t &msg) { @@ -1337,31 +1476,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEcdsaCertificate; static constexpr const char *name = "MSG_ECDSA_CERTIFICATE"; - static const sbp_msg_ecdsa_certificate_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ecdsa_certificate_t &get(const sbp_msg_t &msg) { return msg.ecdsa_certificate; } - static sbp_msg_ecdsa_certificate_t& get(sbp_msg_t &msg) { + static sbp_msg_ecdsa_certificate_t &get(sbp_msg_t &msg) { return msg.ecdsa_certificate; } - static void to_sbp_msg(const sbp_msg_ecdsa_certificate_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ecdsa_certificate_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ecdsa_certificate = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ecdsa_certificate_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ecdsa_certificate_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ecdsa_certificate = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ecdsa_certificate_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ecdsa_certificate_t &msg, sbp_write_fn_t write) { return sbp_msg_ecdsa_certificate_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ecdsa_certificate_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ecdsa_certificate_t &msg) { return sbp_msg_ecdsa_certificate_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ecdsa_certificate_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ecdsa_certificate_t *msg) { return sbp_msg_ecdsa_certificate_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ecdsa_certificate_t &msg) { @@ -1369,31 +1512,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEcdsaSignatureDepA; static constexpr const char *name = "MSG_ECDSA_SIGNATURE_DEP_A"; - static const sbp_msg_ecdsa_signature_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ecdsa_signature_dep_a_t &get(const sbp_msg_t &msg) { return msg.ecdsa_signature_dep_a; } - static sbp_msg_ecdsa_signature_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_ecdsa_signature_dep_a_t &get(sbp_msg_t &msg) { return msg.ecdsa_signature_dep_a; } - static void to_sbp_msg(const sbp_msg_ecdsa_signature_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ecdsa_signature_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ecdsa_signature_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ecdsa_signature_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ecdsa_signature_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ecdsa_signature_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ecdsa_signature_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ecdsa_signature_dep_a_t &msg, + sbp_write_fn_t write) { return sbp_msg_ecdsa_signature_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ecdsa_signature_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ecdsa_signature_dep_a_t &msg) { return sbp_msg_ecdsa_signature_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ecdsa_signature_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ecdsa_signature_dep_a_t *msg) { return sbp_msg_ecdsa_signature_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ecdsa_signature_dep_a_t &msg) { @@ -1401,31 +1549,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEcdsaSignatureDepB; static constexpr const char *name = "MSG_ECDSA_SIGNATURE_DEP_B"; - static const sbp_msg_ecdsa_signature_dep_b_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ecdsa_signature_dep_b_t &get(const sbp_msg_t &msg) { return msg.ecdsa_signature_dep_b; } - static sbp_msg_ecdsa_signature_dep_b_t& get(sbp_msg_t &msg) { + static sbp_msg_ecdsa_signature_dep_b_t &get(sbp_msg_t &msg) { return msg.ecdsa_signature_dep_b; } - static void to_sbp_msg(const sbp_msg_ecdsa_signature_dep_b_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ecdsa_signature_dep_b_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ecdsa_signature_dep_b = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ecdsa_signature_dep_b_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ecdsa_signature_dep_b_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ecdsa_signature_dep_b = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ecdsa_signature_dep_b_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ecdsa_signature_dep_b_t &msg, + sbp_write_fn_t write) { return sbp_msg_ecdsa_signature_dep_b_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ecdsa_signature_dep_b_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ecdsa_signature_dep_b_t &msg) { return sbp_msg_ecdsa_signature_dep_b_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ecdsa_signature_dep_b_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ecdsa_signature_dep_b_t *msg) { return sbp_msg_ecdsa_signature_dep_b_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ecdsa_signature_dep_b_t &msg) { @@ -1433,31 +1586,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEcdsaSignature; static constexpr const char *name = "MSG_ECDSA_SIGNATURE"; - static const sbp_msg_ecdsa_signature_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ecdsa_signature_t &get(const sbp_msg_t &msg) { return msg.ecdsa_signature; } - static sbp_msg_ecdsa_signature_t& get(sbp_msg_t &msg) { + static sbp_msg_ecdsa_signature_t &get(sbp_msg_t &msg) { return msg.ecdsa_signature; } - static void to_sbp_msg(const sbp_msg_ecdsa_signature_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ecdsa_signature_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ecdsa_signature = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ecdsa_signature_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ecdsa_signature_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ecdsa_signature = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ecdsa_signature_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ecdsa_signature_t &msg, sbp_write_fn_t write) { return sbp_msg_ecdsa_signature_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ecdsa_signature_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ecdsa_signature_t &msg) { return sbp_msg_ecdsa_signature_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ecdsa_signature_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ecdsa_signature_t *msg) { return sbp_msg_ecdsa_signature_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ecdsa_signature_t &msg) { @@ -1465,31 +1622,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEd25519CertificateDep; static constexpr const char *name = "MSG_ED25519_CERTIFICATE_DEP"; - static const sbp_msg_ed25519_certificate_dep_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ed25519_certificate_dep_t &get(const sbp_msg_t &msg) { return msg.ed25519_certificate_dep; } - static sbp_msg_ed25519_certificate_dep_t& get(sbp_msg_t &msg) { + static sbp_msg_ed25519_certificate_dep_t &get(sbp_msg_t &msg) { return msg.ed25519_certificate_dep; } - static void to_sbp_msg(const sbp_msg_ed25519_certificate_dep_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ed25519_certificate_dep_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ed25519_certificate_dep = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ed25519_certificate_dep_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ed25519_certificate_dep_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ed25519_certificate_dep = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ed25519_certificate_dep_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ed25519_certificate_dep_t &msg, + sbp_write_fn_t write) { return sbp_msg_ed25519_certificate_dep_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ed25519_certificate_dep_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ed25519_certificate_dep_t &msg) { return sbp_msg_ed25519_certificate_dep_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ed25519_certificate_dep_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ed25519_certificate_dep_t *msg) { return sbp_msg_ed25519_certificate_dep_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ed25519_certificate_dep_t &msg) { @@ -1497,31 +1659,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEd25519SignatureDepA; static constexpr const char *name = "MSG_ED25519_SIGNATURE_DEP_A"; - static const sbp_msg_ed25519_signature_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ed25519_signature_dep_a_t &get(const sbp_msg_t &msg) { return msg.ed25519_signature_dep_a; } - static sbp_msg_ed25519_signature_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_ed25519_signature_dep_a_t &get(sbp_msg_t &msg) { return msg.ed25519_signature_dep_a; } - static void to_sbp_msg(const sbp_msg_ed25519_signature_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ed25519_signature_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ed25519_signature_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ed25519_signature_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ed25519_signature_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ed25519_signature_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ed25519_signature_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ed25519_signature_dep_a_t &msg, + sbp_write_fn_t write) { return sbp_msg_ed25519_signature_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ed25519_signature_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ed25519_signature_dep_a_t &msg) { return sbp_msg_ed25519_signature_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ed25519_signature_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ed25519_signature_dep_a_t *msg) { return sbp_msg_ed25519_signature_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ed25519_signature_dep_a_t &msg) { @@ -1529,31 +1696,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEd25519SignatureDepB; static constexpr const char *name = "MSG_ED25519_SIGNATURE_DEP_B"; - static const sbp_msg_ed25519_signature_dep_b_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ed25519_signature_dep_b_t &get(const sbp_msg_t &msg) { return msg.ed25519_signature_dep_b; } - static sbp_msg_ed25519_signature_dep_b_t& get(sbp_msg_t &msg) { + static sbp_msg_ed25519_signature_dep_b_t &get(sbp_msg_t &msg) { return msg.ed25519_signature_dep_b; } - static void to_sbp_msg(const sbp_msg_ed25519_signature_dep_b_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ed25519_signature_dep_b_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ed25519_signature_dep_b = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ed25519_signature_dep_b_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ed25519_signature_dep_b_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ed25519_signature_dep_b = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ed25519_signature_dep_b_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ed25519_signature_dep_b_t &msg, + sbp_write_fn_t write) { return sbp_msg_ed25519_signature_dep_b_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ed25519_signature_dep_b_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ed25519_signature_dep_b_t &msg) { return sbp_msg_ed25519_signature_dep_b_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ed25519_signature_dep_b_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ed25519_signature_dep_b_t *msg) { return sbp_msg_ed25519_signature_dep_b_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ed25519_signature_dep_b_t &msg) { @@ -1561,31 +1733,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisBds; static constexpr const char *name = "MSG_EPHEMERIS_BDS"; - static const sbp_msg_ephemeris_bds_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_bds_t &get(const sbp_msg_t &msg) { return msg.ephemeris_bds; } - static sbp_msg_ephemeris_bds_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_bds_t &get(sbp_msg_t &msg) { return msg.ephemeris_bds; } - static void to_sbp_msg(const sbp_msg_ephemeris_bds_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_bds_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_bds = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_bds_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_bds_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_bds = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_bds_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_bds_t &msg, sbp_write_fn_t write) { return sbp_msg_ephemeris_bds_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_bds_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_bds_t &msg) { return sbp_msg_ephemeris_bds_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_bds_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_bds_t *msg) { return sbp_msg_ephemeris_bds_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_bds_t &msg) { @@ -1593,31 +1769,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisDepA; static constexpr const char *name = "MSG_EPHEMERIS_DEP_A"; - static const sbp_msg_ephemeris_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_dep_a_t &get(const sbp_msg_t &msg) { return msg.ephemeris_dep_a; } - static sbp_msg_ephemeris_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_dep_a_t &get(sbp_msg_t &msg) { return msg.ephemeris_dep_a; } - static void to_sbp_msg(const sbp_msg_ephemeris_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_dep_a_t &msg, sbp_write_fn_t write) { return sbp_msg_ephemeris_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_dep_a_t &msg) { return sbp_msg_ephemeris_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_dep_a_t *msg) { return sbp_msg_ephemeris_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_dep_a_t &msg) { @@ -1625,31 +1805,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisDepB; static constexpr const char *name = "MSG_EPHEMERIS_DEP_B"; - static const sbp_msg_ephemeris_dep_b_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_dep_b_t &get(const sbp_msg_t &msg) { return msg.ephemeris_dep_b; } - static sbp_msg_ephemeris_dep_b_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_dep_b_t &get(sbp_msg_t &msg) { return msg.ephemeris_dep_b; } - static void to_sbp_msg(const sbp_msg_ephemeris_dep_b_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_dep_b_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_dep_b = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_dep_b_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_dep_b_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_dep_b = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_dep_b_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_dep_b_t &msg, sbp_write_fn_t write) { return sbp_msg_ephemeris_dep_b_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_dep_b_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_dep_b_t &msg) { return sbp_msg_ephemeris_dep_b_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_dep_b_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_dep_b_t *msg) { return sbp_msg_ephemeris_dep_b_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_dep_b_t &msg) { @@ -1657,31 +1841,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisDepC; static constexpr const char *name = "MSG_EPHEMERIS_DEP_C"; - static const sbp_msg_ephemeris_dep_c_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_dep_c_t &get(const sbp_msg_t &msg) { return msg.ephemeris_dep_c; } - static sbp_msg_ephemeris_dep_c_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_dep_c_t &get(sbp_msg_t &msg) { return msg.ephemeris_dep_c; } - static void to_sbp_msg(const sbp_msg_ephemeris_dep_c_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_dep_c_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_dep_c = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_dep_c_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_dep_c_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_dep_c = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_dep_c_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_dep_c_t &msg, sbp_write_fn_t write) { return sbp_msg_ephemeris_dep_c_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_dep_c_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_dep_c_t &msg) { return sbp_msg_ephemeris_dep_c_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_dep_c_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_dep_c_t *msg) { return sbp_msg_ephemeris_dep_c_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_dep_c_t &msg) { @@ -1689,31 +1877,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisDepD; static constexpr const char *name = "MSG_EPHEMERIS_DEP_D"; - static const sbp_msg_ephemeris_dep_d_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_dep_d_t &get(const sbp_msg_t &msg) { return msg.ephemeris_dep_d; } - static sbp_msg_ephemeris_dep_d_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_dep_d_t &get(sbp_msg_t &msg) { return msg.ephemeris_dep_d; } - static void to_sbp_msg(const sbp_msg_ephemeris_dep_d_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_dep_d_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_dep_d = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_dep_d_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_dep_d_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_dep_d = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_dep_d_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_dep_d_t &msg, sbp_write_fn_t write) { return sbp_msg_ephemeris_dep_d_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_dep_d_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_dep_d_t &msg) { return sbp_msg_ephemeris_dep_d_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_dep_d_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_dep_d_t *msg) { return sbp_msg_ephemeris_dep_d_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_dep_d_t &msg) { @@ -1721,31 +1913,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisGalDepA; static constexpr const char *name = "MSG_EPHEMERIS_GAL_DEP_A"; - static const sbp_msg_ephemeris_gal_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_gal_dep_a_t &get(const sbp_msg_t &msg) { return msg.ephemeris_gal_dep_a; } - static sbp_msg_ephemeris_gal_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_gal_dep_a_t &get(sbp_msg_t &msg) { return msg.ephemeris_gal_dep_a; } - static void to_sbp_msg(const sbp_msg_ephemeris_gal_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_gal_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_gal_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_gal_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_gal_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_gal_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_gal_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_gal_dep_a_t &msg, + sbp_write_fn_t write) { return sbp_msg_ephemeris_gal_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_gal_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_gal_dep_a_t &msg) { return sbp_msg_ephemeris_gal_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_gal_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_gal_dep_a_t *msg) { return sbp_msg_ephemeris_gal_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_gal_dep_a_t &msg) { @@ -1753,31 +1950,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisGal; static constexpr const char *name = "MSG_EPHEMERIS_GAL"; - static const sbp_msg_ephemeris_gal_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_gal_t &get(const sbp_msg_t &msg) { return msg.ephemeris_gal; } - static sbp_msg_ephemeris_gal_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_gal_t &get(sbp_msg_t &msg) { return msg.ephemeris_gal; } - static void to_sbp_msg(const sbp_msg_ephemeris_gal_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_gal_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_gal = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_gal_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_gal_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_gal = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_gal_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_gal_t &msg, sbp_write_fn_t write) { return sbp_msg_ephemeris_gal_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_gal_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_gal_t &msg) { return sbp_msg_ephemeris_gal_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_gal_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_gal_t *msg) { return sbp_msg_ephemeris_gal_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_gal_t &msg) { @@ -1785,31 +1986,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisGloDepA; static constexpr const char *name = "MSG_EPHEMERIS_GLO_DEP_A"; - static const sbp_msg_ephemeris_glo_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_glo_dep_a_t &get(const sbp_msg_t &msg) { return msg.ephemeris_glo_dep_a; } - static sbp_msg_ephemeris_glo_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_glo_dep_a_t &get(sbp_msg_t &msg) { return msg.ephemeris_glo_dep_a; } - static void to_sbp_msg(const sbp_msg_ephemeris_glo_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_glo_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_glo_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_glo_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_glo_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_glo_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_glo_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_glo_dep_a_t &msg, + sbp_write_fn_t write) { return sbp_msg_ephemeris_glo_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_glo_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_glo_dep_a_t &msg) { return sbp_msg_ephemeris_glo_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_glo_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_glo_dep_a_t *msg) { return sbp_msg_ephemeris_glo_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_glo_dep_a_t &msg) { @@ -1817,31 +2023,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisGloDepB; static constexpr const char *name = "MSG_EPHEMERIS_GLO_DEP_B"; - static const sbp_msg_ephemeris_glo_dep_b_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_glo_dep_b_t &get(const sbp_msg_t &msg) { return msg.ephemeris_glo_dep_b; } - static sbp_msg_ephemeris_glo_dep_b_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_glo_dep_b_t &get(sbp_msg_t &msg) { return msg.ephemeris_glo_dep_b; } - static void to_sbp_msg(const sbp_msg_ephemeris_glo_dep_b_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_glo_dep_b_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_glo_dep_b = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_glo_dep_b_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_glo_dep_b_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_glo_dep_b = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_glo_dep_b_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_glo_dep_b_t &msg, + sbp_write_fn_t write) { return sbp_msg_ephemeris_glo_dep_b_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_glo_dep_b_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_glo_dep_b_t &msg) { return sbp_msg_ephemeris_glo_dep_b_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_glo_dep_b_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_glo_dep_b_t *msg) { return sbp_msg_ephemeris_glo_dep_b_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_glo_dep_b_t &msg) { @@ -1849,31 +2060,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisGloDepC; static constexpr const char *name = "MSG_EPHEMERIS_GLO_DEP_C"; - static const sbp_msg_ephemeris_glo_dep_c_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_glo_dep_c_t &get(const sbp_msg_t &msg) { return msg.ephemeris_glo_dep_c; } - static sbp_msg_ephemeris_glo_dep_c_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_glo_dep_c_t &get(sbp_msg_t &msg) { return msg.ephemeris_glo_dep_c; } - static void to_sbp_msg(const sbp_msg_ephemeris_glo_dep_c_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_glo_dep_c_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_glo_dep_c = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_glo_dep_c_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_glo_dep_c_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_glo_dep_c = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_glo_dep_c_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_glo_dep_c_t &msg, + sbp_write_fn_t write) { return sbp_msg_ephemeris_glo_dep_c_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_glo_dep_c_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_glo_dep_c_t &msg) { return sbp_msg_ephemeris_glo_dep_c_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_glo_dep_c_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_glo_dep_c_t *msg) { return sbp_msg_ephemeris_glo_dep_c_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_glo_dep_c_t &msg) { @@ -1881,31 +2097,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisGloDepD; static constexpr const char *name = "MSG_EPHEMERIS_GLO_DEP_D"; - static const sbp_msg_ephemeris_glo_dep_d_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_glo_dep_d_t &get(const sbp_msg_t &msg) { return msg.ephemeris_glo_dep_d; } - static sbp_msg_ephemeris_glo_dep_d_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_glo_dep_d_t &get(sbp_msg_t &msg) { return msg.ephemeris_glo_dep_d; } - static void to_sbp_msg(const sbp_msg_ephemeris_glo_dep_d_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_glo_dep_d_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_glo_dep_d = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_glo_dep_d_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_glo_dep_d_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_glo_dep_d = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_glo_dep_d_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_glo_dep_d_t &msg, + sbp_write_fn_t write) { return sbp_msg_ephemeris_glo_dep_d_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_glo_dep_d_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_glo_dep_d_t &msg) { return sbp_msg_ephemeris_glo_dep_d_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_glo_dep_d_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_glo_dep_d_t *msg) { return sbp_msg_ephemeris_glo_dep_d_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_glo_dep_d_t &msg) { @@ -1913,31 +2134,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisGlo; static constexpr const char *name = "MSG_EPHEMERIS_GLO"; - static const sbp_msg_ephemeris_glo_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_glo_t &get(const sbp_msg_t &msg) { return msg.ephemeris_glo; } - static sbp_msg_ephemeris_glo_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_glo_t &get(sbp_msg_t &msg) { return msg.ephemeris_glo; } - static void to_sbp_msg(const sbp_msg_ephemeris_glo_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_glo_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_glo = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_glo_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_glo_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_glo = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_glo_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_glo_t &msg, sbp_write_fn_t write) { return sbp_msg_ephemeris_glo_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_glo_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_glo_t &msg) { return sbp_msg_ephemeris_glo_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_glo_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_glo_t *msg) { return sbp_msg_ephemeris_glo_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_glo_t &msg) { @@ -1945,31 +2170,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisGpsDepE; static constexpr const char *name = "MSG_EPHEMERIS_GPS_DEP_E"; - static const sbp_msg_ephemeris_gps_dep_e_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_gps_dep_e_t &get(const sbp_msg_t &msg) { return msg.ephemeris_gps_dep_e; } - static sbp_msg_ephemeris_gps_dep_e_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_gps_dep_e_t &get(sbp_msg_t &msg) { return msg.ephemeris_gps_dep_e; } - static void to_sbp_msg(const sbp_msg_ephemeris_gps_dep_e_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_gps_dep_e_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_gps_dep_e = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_gps_dep_e_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_gps_dep_e_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_gps_dep_e = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_gps_dep_e_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_gps_dep_e_t &msg, + sbp_write_fn_t write) { return sbp_msg_ephemeris_gps_dep_e_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_gps_dep_e_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_gps_dep_e_t &msg) { return sbp_msg_ephemeris_gps_dep_e_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_gps_dep_e_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_gps_dep_e_t *msg) { return sbp_msg_ephemeris_gps_dep_e_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_gps_dep_e_t &msg) { @@ -1977,31 +2207,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisGpsDepF; static constexpr const char *name = "MSG_EPHEMERIS_GPS_DEP_F"; - static const sbp_msg_ephemeris_gps_dep_f_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_gps_dep_f_t &get(const sbp_msg_t &msg) { return msg.ephemeris_gps_dep_f; } - static sbp_msg_ephemeris_gps_dep_f_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_gps_dep_f_t &get(sbp_msg_t &msg) { return msg.ephemeris_gps_dep_f; } - static void to_sbp_msg(const sbp_msg_ephemeris_gps_dep_f_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_gps_dep_f_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_gps_dep_f = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_gps_dep_f_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_gps_dep_f_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_gps_dep_f = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_gps_dep_f_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_gps_dep_f_t &msg, + sbp_write_fn_t write) { return sbp_msg_ephemeris_gps_dep_f_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_gps_dep_f_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_gps_dep_f_t &msg) { return sbp_msg_ephemeris_gps_dep_f_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_gps_dep_f_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_gps_dep_f_t *msg) { return sbp_msg_ephemeris_gps_dep_f_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_gps_dep_f_t &msg) { @@ -2009,31 +2244,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisGps; static constexpr const char *name = "MSG_EPHEMERIS_GPS"; - static const sbp_msg_ephemeris_gps_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_gps_t &get(const sbp_msg_t &msg) { return msg.ephemeris_gps; } - static sbp_msg_ephemeris_gps_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_gps_t &get(sbp_msg_t &msg) { return msg.ephemeris_gps; } - static void to_sbp_msg(const sbp_msg_ephemeris_gps_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_gps_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_gps = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_gps_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_gps_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_gps = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_gps_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_gps_t &msg, sbp_write_fn_t write) { return sbp_msg_ephemeris_gps_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_gps_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_gps_t &msg) { return sbp_msg_ephemeris_gps_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_gps_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_gps_t *msg) { return sbp_msg_ephemeris_gps_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_gps_t &msg) { @@ -2041,31 +2280,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisQzss; static constexpr const char *name = "MSG_EPHEMERIS_QZSS"; - static const sbp_msg_ephemeris_qzss_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_qzss_t &get(const sbp_msg_t &msg) { return msg.ephemeris_qzss; } - static sbp_msg_ephemeris_qzss_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_qzss_t &get(sbp_msg_t &msg) { return msg.ephemeris_qzss; } - static void to_sbp_msg(const sbp_msg_ephemeris_qzss_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_qzss_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_qzss = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_qzss_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_qzss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_qzss = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_qzss_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_qzss_t &msg, sbp_write_fn_t write) { return sbp_msg_ephemeris_qzss_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_qzss_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_qzss_t &msg) { return sbp_msg_ephemeris_qzss_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_qzss_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_qzss_t *msg) { return sbp_msg_ephemeris_qzss_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_qzss_t &msg) { @@ -2073,31 +2316,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisSbasDepA; static constexpr const char *name = "MSG_EPHEMERIS_SBAS_DEP_A"; - static const sbp_msg_ephemeris_sbas_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_sbas_dep_a_t &get(const sbp_msg_t &msg) { return msg.ephemeris_sbas_dep_a; } - static sbp_msg_ephemeris_sbas_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_sbas_dep_a_t &get(sbp_msg_t &msg) { return msg.ephemeris_sbas_dep_a; } - static void to_sbp_msg(const sbp_msg_ephemeris_sbas_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_sbas_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_sbas_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_sbas_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_sbas_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_sbas_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_sbas_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_sbas_dep_a_t &msg, + sbp_write_fn_t write) { return sbp_msg_ephemeris_sbas_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_sbas_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_sbas_dep_a_t &msg) { return sbp_msg_ephemeris_sbas_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_sbas_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_sbas_dep_a_t *msg) { return sbp_msg_ephemeris_sbas_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_sbas_dep_a_t &msg) { @@ -2105,31 +2353,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisSbasDepB; static constexpr const char *name = "MSG_EPHEMERIS_SBAS_DEP_B"; - static const sbp_msg_ephemeris_sbas_dep_b_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_sbas_dep_b_t &get(const sbp_msg_t &msg) { return msg.ephemeris_sbas_dep_b; } - static sbp_msg_ephemeris_sbas_dep_b_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_sbas_dep_b_t &get(sbp_msg_t &msg) { return msg.ephemeris_sbas_dep_b; } - static void to_sbp_msg(const sbp_msg_ephemeris_sbas_dep_b_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_sbas_dep_b_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_sbas_dep_b = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_sbas_dep_b_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_sbas_dep_b_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_sbas_dep_b = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_sbas_dep_b_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_sbas_dep_b_t &msg, + sbp_write_fn_t write) { return sbp_msg_ephemeris_sbas_dep_b_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_sbas_dep_b_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_sbas_dep_b_t &msg) { return sbp_msg_ephemeris_sbas_dep_b_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_sbas_dep_b_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_sbas_dep_b_t *msg) { return sbp_msg_ephemeris_sbas_dep_b_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_sbas_dep_b_t &msg) { @@ -2137,31 +2390,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgEphemerisSbas; static constexpr const char *name = "MSG_EPHEMERIS_SBAS"; - static const sbp_msg_ephemeris_sbas_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ephemeris_sbas_t &get(const sbp_msg_t &msg) { return msg.ephemeris_sbas; } - static sbp_msg_ephemeris_sbas_t& get(sbp_msg_t &msg) { + static sbp_msg_ephemeris_sbas_t &get(sbp_msg_t &msg) { return msg.ephemeris_sbas; } - static void to_sbp_msg(const sbp_msg_ephemeris_sbas_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ephemeris_sbas_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ephemeris_sbas = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_sbas_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ephemeris_sbas_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ephemeris_sbas = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ephemeris_sbas_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ephemeris_sbas_t &msg, sbp_write_fn_t write) { return sbp_msg_ephemeris_sbas_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_sbas_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_sbas_t &msg) { return sbp_msg_ephemeris_sbas_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_sbas_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_sbas_t *msg) { return sbp_msg_ephemeris_sbas_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ephemeris_sbas_t &msg) { @@ -2169,31 +2426,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgExtEvent; static constexpr const char *name = "MSG_EXT_EVENT"; - static const sbp_msg_ext_event_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ext_event_t &get(const sbp_msg_t &msg) { return msg.ext_event; } - static sbp_msg_ext_event_t& get(sbp_msg_t &msg) { - return msg.ext_event; - } - static void to_sbp_msg(const sbp_msg_ext_event_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_ext_event_t &get(sbp_msg_t &msg) { return msg.ext_event; } + static void to_sbp_msg(const sbp_msg_ext_event_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->ext_event = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ext_event_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ext_event_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ext_event = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ext_event_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ext_event_t &msg, sbp_write_fn_t write) { return sbp_msg_ext_event_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ext_event_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ext_event_t &msg) { return sbp_msg_ext_event_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ext_event_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ext_event_t *msg) { return sbp_msg_ext_event_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ext_event_t &msg) { @@ -2201,31 +2459,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFileioConfigReq; static constexpr const char *name = "MSG_FILEIO_CONFIG_REQ"; - static const sbp_msg_fileio_config_req_t& get(const sbp_msg_t &msg) { + static const sbp_msg_fileio_config_req_t &get(const sbp_msg_t &msg) { return msg.fileio_config_req; } - static sbp_msg_fileio_config_req_t& get(sbp_msg_t &msg) { + static sbp_msg_fileio_config_req_t &get(sbp_msg_t &msg) { return msg.fileio_config_req; } - static void to_sbp_msg(const sbp_msg_fileio_config_req_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_fileio_config_req_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->fileio_config_req = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_config_req_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_config_req_t &msg) { sbp_msg_t sbp_msg; sbp_msg.fileio_config_req = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_fileio_config_req_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_fileio_config_req_t &msg, sbp_write_fn_t write) { return sbp_msg_fileio_config_req_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_config_req_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_config_req_t &msg) { return sbp_msg_fileio_config_req_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_config_req_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fileio_config_req_t *msg) { return sbp_msg_fileio_config_req_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_fileio_config_req_t &msg) { @@ -2233,31 +2495,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFileioConfigResp; static constexpr const char *name = "MSG_FILEIO_CONFIG_RESP"; - static const sbp_msg_fileio_config_resp_t& get(const sbp_msg_t &msg) { + static const sbp_msg_fileio_config_resp_t &get(const sbp_msg_t &msg) { return msg.fileio_config_resp; } - static sbp_msg_fileio_config_resp_t& get(sbp_msg_t &msg) { + static sbp_msg_fileio_config_resp_t &get(sbp_msg_t &msg) { return msg.fileio_config_resp; } - static void to_sbp_msg(const sbp_msg_fileio_config_resp_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_fileio_config_resp_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->fileio_config_resp = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_config_resp_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_config_resp_t &msg) { sbp_msg_t sbp_msg; sbp_msg.fileio_config_resp = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_fileio_config_resp_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_fileio_config_resp_t &msg, + sbp_write_fn_t write) { return sbp_msg_fileio_config_resp_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_config_resp_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_config_resp_t &msg) { return sbp_msg_fileio_config_resp_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_config_resp_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fileio_config_resp_t *msg) { return sbp_msg_fileio_config_resp_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_fileio_config_resp_t &msg) { @@ -2265,31 +2532,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFileioReadDirReq; static constexpr const char *name = "MSG_FILEIO_READ_DIR_REQ"; - static const sbp_msg_fileio_read_dir_req_t& get(const sbp_msg_t &msg) { + static const sbp_msg_fileio_read_dir_req_t &get(const sbp_msg_t &msg) { return msg.fileio_read_dir_req; } - static sbp_msg_fileio_read_dir_req_t& get(sbp_msg_t &msg) { + static sbp_msg_fileio_read_dir_req_t &get(sbp_msg_t &msg) { return msg.fileio_read_dir_req; } - static void to_sbp_msg(const sbp_msg_fileio_read_dir_req_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_fileio_read_dir_req_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->fileio_read_dir_req = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_read_dir_req_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_read_dir_req_t &msg) { sbp_msg_t sbp_msg; sbp_msg.fileio_read_dir_req = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_fileio_read_dir_req_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_fileio_read_dir_req_t &msg, + sbp_write_fn_t write) { return sbp_msg_fileio_read_dir_req_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_read_dir_req_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_read_dir_req_t &msg) { return sbp_msg_fileio_read_dir_req_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_read_dir_req_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fileio_read_dir_req_t *msg) { return sbp_msg_fileio_read_dir_req_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_fileio_read_dir_req_t &msg) { @@ -2297,31 +2569,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFileioReadDirResp; static constexpr const char *name = "MSG_FILEIO_READ_DIR_RESP"; - static const sbp_msg_fileio_read_dir_resp_t& get(const sbp_msg_t &msg) { + static const sbp_msg_fileio_read_dir_resp_t &get(const sbp_msg_t &msg) { return msg.fileio_read_dir_resp; } - static sbp_msg_fileio_read_dir_resp_t& get(sbp_msg_t &msg) { + static sbp_msg_fileio_read_dir_resp_t &get(sbp_msg_t &msg) { return msg.fileio_read_dir_resp; } - static void to_sbp_msg(const sbp_msg_fileio_read_dir_resp_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_fileio_read_dir_resp_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->fileio_read_dir_resp = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_read_dir_resp_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_read_dir_resp_t &msg) { sbp_msg_t sbp_msg; sbp_msg.fileio_read_dir_resp = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_fileio_read_dir_resp_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_fileio_read_dir_resp_t &msg, + sbp_write_fn_t write) { return sbp_msg_fileio_read_dir_resp_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_read_dir_resp_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_read_dir_resp_t &msg) { return sbp_msg_fileio_read_dir_resp_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_read_dir_resp_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fileio_read_dir_resp_t *msg) { return sbp_msg_fileio_read_dir_resp_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_fileio_read_dir_resp_t &msg) { @@ -2329,31 +2606,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFileioReadReq; static constexpr const char *name = "MSG_FILEIO_READ_REQ"; - static const sbp_msg_fileio_read_req_t& get(const sbp_msg_t &msg) { + static const sbp_msg_fileio_read_req_t &get(const sbp_msg_t &msg) { return msg.fileio_read_req; } - static sbp_msg_fileio_read_req_t& get(sbp_msg_t &msg) { + static sbp_msg_fileio_read_req_t &get(sbp_msg_t &msg) { return msg.fileio_read_req; } - static void to_sbp_msg(const sbp_msg_fileio_read_req_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_fileio_read_req_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->fileio_read_req = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_read_req_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_read_req_t &msg) { sbp_msg_t sbp_msg; sbp_msg.fileio_read_req = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_fileio_read_req_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_fileio_read_req_t &msg, sbp_write_fn_t write) { return sbp_msg_fileio_read_req_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_read_req_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_read_req_t &msg) { return sbp_msg_fileio_read_req_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_read_req_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fileio_read_req_t *msg) { return sbp_msg_fileio_read_req_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_fileio_read_req_t &msg) { @@ -2361,31 +2642,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFileioReadResp; static constexpr const char *name = "MSG_FILEIO_READ_RESP"; - static const sbp_msg_fileio_read_resp_t& get(const sbp_msg_t &msg) { + static const sbp_msg_fileio_read_resp_t &get(const sbp_msg_t &msg) { return msg.fileio_read_resp; } - static sbp_msg_fileio_read_resp_t& get(sbp_msg_t &msg) { + static sbp_msg_fileio_read_resp_t &get(sbp_msg_t &msg) { return msg.fileio_read_resp; } - static void to_sbp_msg(const sbp_msg_fileio_read_resp_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_fileio_read_resp_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->fileio_read_resp = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_read_resp_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_read_resp_t &msg) { sbp_msg_t sbp_msg; sbp_msg.fileio_read_resp = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_fileio_read_resp_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_fileio_read_resp_t &msg, sbp_write_fn_t write) { return sbp_msg_fileio_read_resp_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_read_resp_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_read_resp_t &msg) { return sbp_msg_fileio_read_resp_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_read_resp_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fileio_read_resp_t *msg) { return sbp_msg_fileio_read_resp_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_fileio_read_resp_t &msg) { @@ -2393,31 +2678,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFileioRemove; static constexpr const char *name = "MSG_FILEIO_REMOVE"; - static const sbp_msg_fileio_remove_t& get(const sbp_msg_t &msg) { + static const sbp_msg_fileio_remove_t &get(const sbp_msg_t &msg) { return msg.fileio_remove; } - static sbp_msg_fileio_remove_t& get(sbp_msg_t &msg) { + static sbp_msg_fileio_remove_t &get(sbp_msg_t &msg) { return msg.fileio_remove; } - static void to_sbp_msg(const sbp_msg_fileio_remove_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_fileio_remove_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->fileio_remove = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_remove_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_remove_t &msg) { sbp_msg_t sbp_msg; sbp_msg.fileio_remove = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_fileio_remove_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_fileio_remove_t &msg, sbp_write_fn_t write) { return sbp_msg_fileio_remove_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_remove_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_remove_t &msg) { return sbp_msg_fileio_remove_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_remove_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fileio_remove_t *msg) { return sbp_msg_fileio_remove_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_fileio_remove_t &msg) { @@ -2425,31 +2714,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFileioWriteReq; static constexpr const char *name = "MSG_FILEIO_WRITE_REQ"; - static const sbp_msg_fileio_write_req_t& get(const sbp_msg_t &msg) { + static const sbp_msg_fileio_write_req_t &get(const sbp_msg_t &msg) { return msg.fileio_write_req; } - static sbp_msg_fileio_write_req_t& get(sbp_msg_t &msg) { + static sbp_msg_fileio_write_req_t &get(sbp_msg_t &msg) { return msg.fileio_write_req; } - static void to_sbp_msg(const sbp_msg_fileio_write_req_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_fileio_write_req_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->fileio_write_req = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_write_req_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_write_req_t &msg) { sbp_msg_t sbp_msg; sbp_msg.fileio_write_req = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_fileio_write_req_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_fileio_write_req_t &msg, sbp_write_fn_t write) { return sbp_msg_fileio_write_req_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_write_req_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_write_req_t &msg) { return sbp_msg_fileio_write_req_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_write_req_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fileio_write_req_t *msg) { return sbp_msg_fileio_write_req_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_fileio_write_req_t &msg) { @@ -2457,31 +2750,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFileioWriteResp; static constexpr const char *name = "MSG_FILEIO_WRITE_RESP"; - static const sbp_msg_fileio_write_resp_t& get(const sbp_msg_t &msg) { + static const sbp_msg_fileio_write_resp_t &get(const sbp_msg_t &msg) { return msg.fileio_write_resp; } - static sbp_msg_fileio_write_resp_t& get(sbp_msg_t &msg) { + static sbp_msg_fileio_write_resp_t &get(sbp_msg_t &msg) { return msg.fileio_write_resp; } - static void to_sbp_msg(const sbp_msg_fileio_write_resp_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_fileio_write_resp_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->fileio_write_resp = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_write_resp_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_fileio_write_resp_t &msg) { sbp_msg_t sbp_msg; sbp_msg.fileio_write_resp = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_fileio_write_resp_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_fileio_write_resp_t &msg, sbp_write_fn_t write) { return sbp_msg_fileio_write_resp_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_write_resp_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_write_resp_t &msg) { return sbp_msg_fileio_write_resp_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_write_resp_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fileio_write_resp_t *msg) { return sbp_msg_fileio_write_resp_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_fileio_write_resp_t &msg) { @@ -2489,31 +2786,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFlashDone; static constexpr const char *name = "MSG_FLASH_DONE"; - static const sbp_msg_flash_done_t& get(const sbp_msg_t &msg) { - return msg.flash_done; - } - static sbp_msg_flash_done_t& get(sbp_msg_t &msg) { + static const sbp_msg_flash_done_t &get(const sbp_msg_t &msg) { return msg.flash_done; } - static void to_sbp_msg(const sbp_msg_flash_done_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_flash_done_t &get(sbp_msg_t &msg) { return msg.flash_done; } + static void to_sbp_msg(const sbp_msg_flash_done_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->flash_done = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_flash_done_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_flash_done_t &msg) { sbp_msg_t sbp_msg; sbp_msg.flash_done = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_flash_done_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_flash_done_t &msg, sbp_write_fn_t write) { return sbp_msg_flash_done_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_flash_done_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_flash_done_t &msg) { return sbp_msg_flash_done_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_flash_done_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_flash_done_t *msg) { return sbp_msg_flash_done_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_flash_done_t &msg) { @@ -2521,31 +2819,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFlashErase; static constexpr const char *name = "MSG_FLASH_ERASE"; - static const sbp_msg_flash_erase_t& get(const sbp_msg_t &msg) { + static const sbp_msg_flash_erase_t &get(const sbp_msg_t &msg) { return msg.flash_erase; } - static sbp_msg_flash_erase_t& get(sbp_msg_t &msg) { - return msg.flash_erase; - } - static void to_sbp_msg(const sbp_msg_flash_erase_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_flash_erase_t &get(sbp_msg_t &msg) { return msg.flash_erase; } + static void to_sbp_msg(const sbp_msg_flash_erase_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->flash_erase = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_flash_erase_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_flash_erase_t &msg) { sbp_msg_t sbp_msg; sbp_msg.flash_erase = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_flash_erase_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_flash_erase_t &msg, sbp_write_fn_t write) { return sbp_msg_flash_erase_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_flash_erase_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_flash_erase_t &msg) { return sbp_msg_flash_erase_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_flash_erase_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_flash_erase_t *msg) { return sbp_msg_flash_erase_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_flash_erase_t &msg) { @@ -2553,31 +2852,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFlashProgram; static constexpr const char *name = "MSG_FLASH_PROGRAM"; - static const sbp_msg_flash_program_t& get(const sbp_msg_t &msg) { + static const sbp_msg_flash_program_t &get(const sbp_msg_t &msg) { return msg.flash_program; } - static sbp_msg_flash_program_t& get(sbp_msg_t &msg) { + static sbp_msg_flash_program_t &get(sbp_msg_t &msg) { return msg.flash_program; } - static void to_sbp_msg(const sbp_msg_flash_program_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_flash_program_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->flash_program = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_flash_program_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_flash_program_t &msg) { sbp_msg_t sbp_msg; sbp_msg.flash_program = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_flash_program_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_flash_program_t &msg, sbp_write_fn_t write) { return sbp_msg_flash_program_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_flash_program_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_flash_program_t &msg) { return sbp_msg_flash_program_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_flash_program_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_flash_program_t *msg) { return sbp_msg_flash_program_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_flash_program_t &msg) { @@ -2585,31 +2888,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFlashReadReq; static constexpr const char *name = "MSG_FLASH_READ_REQ"; - static const sbp_msg_flash_read_req_t& get(const sbp_msg_t &msg) { + static const sbp_msg_flash_read_req_t &get(const sbp_msg_t &msg) { return msg.flash_read_req; } - static sbp_msg_flash_read_req_t& get(sbp_msg_t &msg) { + static sbp_msg_flash_read_req_t &get(sbp_msg_t &msg) { return msg.flash_read_req; } - static void to_sbp_msg(const sbp_msg_flash_read_req_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_flash_read_req_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->flash_read_req = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_flash_read_req_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_flash_read_req_t &msg) { sbp_msg_t sbp_msg; sbp_msg.flash_read_req = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_flash_read_req_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_flash_read_req_t &msg, sbp_write_fn_t write) { return sbp_msg_flash_read_req_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_flash_read_req_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_flash_read_req_t &msg) { return sbp_msg_flash_read_req_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_flash_read_req_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_flash_read_req_t *msg) { return sbp_msg_flash_read_req_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_flash_read_req_t &msg) { @@ -2617,31 +2924,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFlashReadResp; static constexpr const char *name = "MSG_FLASH_READ_RESP"; - static const sbp_msg_flash_read_resp_t& get(const sbp_msg_t &msg) { + static const sbp_msg_flash_read_resp_t &get(const sbp_msg_t &msg) { return msg.flash_read_resp; } - static sbp_msg_flash_read_resp_t& get(sbp_msg_t &msg) { + static sbp_msg_flash_read_resp_t &get(sbp_msg_t &msg) { return msg.flash_read_resp; } - static void to_sbp_msg(const sbp_msg_flash_read_resp_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_flash_read_resp_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->flash_read_resp = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_flash_read_resp_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_flash_read_resp_t &msg) { sbp_msg_t sbp_msg; sbp_msg.flash_read_resp = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_flash_read_resp_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_flash_read_resp_t &msg, sbp_write_fn_t write) { return sbp_msg_flash_read_resp_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_flash_read_resp_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_flash_read_resp_t &msg) { return sbp_msg_flash_read_resp_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_flash_read_resp_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_flash_read_resp_t *msg) { return sbp_msg_flash_read_resp_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_flash_read_resp_t &msg) { @@ -2649,31 +2960,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFrontEndGain; static constexpr const char *name = "MSG_FRONT_END_GAIN"; - static const sbp_msg_front_end_gain_t& get(const sbp_msg_t &msg) { + static const sbp_msg_front_end_gain_t &get(const sbp_msg_t &msg) { return msg.front_end_gain; } - static sbp_msg_front_end_gain_t& get(sbp_msg_t &msg) { + static sbp_msg_front_end_gain_t &get(sbp_msg_t &msg) { return msg.front_end_gain; } - static void to_sbp_msg(const sbp_msg_front_end_gain_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_front_end_gain_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->front_end_gain = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_front_end_gain_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_front_end_gain_t &msg) { sbp_msg_t sbp_msg; sbp_msg.front_end_gain = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_front_end_gain_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_front_end_gain_t &msg, sbp_write_fn_t write) { return sbp_msg_front_end_gain_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_front_end_gain_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_front_end_gain_t &msg) { return sbp_msg_front_end_gain_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_front_end_gain_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_front_end_gain_t *msg) { return sbp_msg_front_end_gain_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_front_end_gain_t &msg) { @@ -2681,31 +2996,30 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgFwd; static constexpr const char *name = "MSG_FWD"; - static const sbp_msg_fwd_t& get(const sbp_msg_t &msg) { - return msg.fwd; - } - static sbp_msg_fwd_t& get(sbp_msg_t &msg) { - return msg.fwd; - } - static void to_sbp_msg(const sbp_msg_fwd_t& msg, sbp_msg_t *sbp_msg) { + static const sbp_msg_fwd_t &get(const sbp_msg_t &msg) { return msg.fwd; } + static sbp_msg_fwd_t &get(sbp_msg_t &msg) { return msg.fwd; } + static void to_sbp_msg(const sbp_msg_fwd_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->fwd = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_fwd_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_fwd_t &msg) { sbp_msg_t sbp_msg; sbp_msg.fwd = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_fwd_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_fwd_t &msg, + sbp_write_fn_t write) { return sbp_msg_fwd_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fwd_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fwd_t &msg) { return sbp_msg_fwd_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fwd_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fwd_t *msg) { return sbp_msg_fwd_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_fwd_t &msg) { @@ -2713,31 +3027,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgGloBiases; static constexpr const char *name = "MSG_GLO_BIASES"; - static const sbp_msg_glo_biases_t& get(const sbp_msg_t &msg) { + static const sbp_msg_glo_biases_t &get(const sbp_msg_t &msg) { return msg.glo_biases; } - static sbp_msg_glo_biases_t& get(sbp_msg_t &msg) { - return msg.glo_biases; - } - static void to_sbp_msg(const sbp_msg_glo_biases_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_glo_biases_t &get(sbp_msg_t &msg) { return msg.glo_biases; } + static void to_sbp_msg(const sbp_msg_glo_biases_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->glo_biases = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_glo_biases_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_glo_biases_t &msg) { sbp_msg_t sbp_msg; sbp_msg.glo_biases = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_glo_biases_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_glo_biases_t &msg, sbp_write_fn_t write) { return sbp_msg_glo_biases_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_glo_biases_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_glo_biases_t &msg) { return sbp_msg_glo_biases_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_glo_biases_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_glo_biases_t *msg) { return sbp_msg_glo_biases_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_glo_biases_t &msg) { @@ -2745,31 +3060,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgGnssCapb; static constexpr const char *name = "MSG_GNSS_CAPB"; - static const sbp_msg_gnss_capb_t& get(const sbp_msg_t &msg) { - return msg.gnss_capb; - } - static sbp_msg_gnss_capb_t& get(sbp_msg_t &msg) { + static const sbp_msg_gnss_capb_t &get(const sbp_msg_t &msg) { return msg.gnss_capb; } - static void to_sbp_msg(const sbp_msg_gnss_capb_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_gnss_capb_t &get(sbp_msg_t &msg) { return msg.gnss_capb; } + static void to_sbp_msg(const sbp_msg_gnss_capb_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->gnss_capb = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_gnss_capb_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_gnss_capb_t &msg) { sbp_msg_t sbp_msg; sbp_msg.gnss_capb = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_gnss_capb_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_gnss_capb_t &msg, sbp_write_fn_t write) { return sbp_msg_gnss_capb_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_gnss_capb_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_gnss_capb_t &msg) { return sbp_msg_gnss_capb_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_gnss_capb_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_gnss_capb_t *msg) { return sbp_msg_gnss_capb_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_gnss_capb_t &msg) { @@ -2777,31 +3093,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgGnssTimeOffset; static constexpr const char *name = "MSG_GNSS_TIME_OFFSET"; - static const sbp_msg_gnss_time_offset_t& get(const sbp_msg_t &msg) { + static const sbp_msg_gnss_time_offset_t &get(const sbp_msg_t &msg) { return msg.gnss_time_offset; } - static sbp_msg_gnss_time_offset_t& get(sbp_msg_t &msg) { + static sbp_msg_gnss_time_offset_t &get(sbp_msg_t &msg) { return msg.gnss_time_offset; } - static void to_sbp_msg(const sbp_msg_gnss_time_offset_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_gnss_time_offset_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->gnss_time_offset = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_gnss_time_offset_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_gnss_time_offset_t &msg) { sbp_msg_t sbp_msg; sbp_msg.gnss_time_offset = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_gnss_time_offset_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_gnss_time_offset_t &msg, sbp_write_fn_t write) { return sbp_msg_gnss_time_offset_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_gnss_time_offset_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_gnss_time_offset_t &msg) { return sbp_msg_gnss_time_offset_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_gnss_time_offset_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_gnss_time_offset_t *msg) { return sbp_msg_gnss_time_offset_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_gnss_time_offset_t &msg) { @@ -2809,31 +3129,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgGpsTimeDepA; static constexpr const char *name = "MSG_GPS_TIME_DEP_A"; - static const sbp_msg_gps_time_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_gps_time_dep_a_t &get(const sbp_msg_t &msg) { return msg.gps_time_dep_a; } - static sbp_msg_gps_time_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_gps_time_dep_a_t &get(sbp_msg_t &msg) { return msg.gps_time_dep_a; } - static void to_sbp_msg(const sbp_msg_gps_time_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_gps_time_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->gps_time_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_gps_time_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_gps_time_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.gps_time_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_gps_time_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_gps_time_dep_a_t &msg, sbp_write_fn_t write) { return sbp_msg_gps_time_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_gps_time_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_gps_time_dep_a_t &msg) { return sbp_msg_gps_time_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_gps_time_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_gps_time_dep_a_t *msg) { return sbp_msg_gps_time_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_gps_time_dep_a_t &msg) { @@ -2841,40 +3165,44 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgGpsTimeGnss; static constexpr const char *name = "MSG_GPS_TIME_GNSS"; - static const sbp_msg_gps_time_gnss_t& get(const sbp_msg_t &msg) { + static const sbp_msg_gps_time_gnss_t &get(const sbp_msg_t &msg) { return msg.gps_time_gnss; } - static sbp_msg_gps_time_gnss_t& get(sbp_msg_t &msg) { + static sbp_msg_gps_time_gnss_t &get(sbp_msg_t &msg) { return msg.gps_time_gnss; } - static void to_sbp_msg(const sbp_msg_gps_time_gnss_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_gps_time_gnss_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->gps_time_gnss = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_gps_time_gnss_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_gps_time_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.gps_time_gnss = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_gps_time_gnss_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_gps_time_gnss_t &msg, sbp_write_fn_t write) { return sbp_msg_gps_time_gnss_send(state, sender_id, &msg, write); } - static sbp_msg_gps_time_gnss_t to_gnss(const sbp_msg_gps_time_gnss_t& msg) { + static sbp_msg_gps_time_gnss_t to_gnss(const sbp_msg_gps_time_gnss_t &msg) { return msg; } - static sbp_msg_gps_time_t to_non_gnss(const sbp_msg_gps_time_gnss_t& msg){ + static sbp_msg_gps_time_t to_non_gnss(const sbp_msg_gps_time_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.gps_time_gnss = msg; return sbp_msg.gps_time; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_gps_time_gnss_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_gps_time_gnss_t &msg) { return sbp_msg_gps_time_gnss_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_gps_time_gnss_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_gps_time_gnss_t *msg) { return sbp_msg_gps_time_gnss_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_gps_time_gnss_t &msg) { @@ -2882,40 +3210,41 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgGpsTime; static constexpr const char *name = "MSG_GPS_TIME"; - static const sbp_msg_gps_time_t& get(const sbp_msg_t &msg) { + static const sbp_msg_gps_time_t &get(const sbp_msg_t &msg) { return msg.gps_time; } - static sbp_msg_gps_time_t& get(sbp_msg_t &msg) { - return msg.gps_time; - } - static void to_sbp_msg(const sbp_msg_gps_time_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_gps_time_t &get(sbp_msg_t &msg) { return msg.gps_time; } + static void to_sbp_msg(const sbp_msg_gps_time_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->gps_time = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_gps_time_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_gps_time_t &msg) { sbp_msg_t sbp_msg; sbp_msg.gps_time = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_gps_time_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_gps_time_t &msg, sbp_write_fn_t write) { return sbp_msg_gps_time_send(state, sender_id, &msg, write); } - static sbp_msg_gps_time_gnss_t to_gnss(const sbp_msg_gps_time_t& msg){ + static sbp_msg_gps_time_gnss_t to_gnss(const sbp_msg_gps_time_t &msg) { sbp_msg_t sbp_msg; sbp_msg.gps_time = msg; return sbp_msg.gps_time_gnss; } - static sbp_msg_gps_time_t to_non_gnss(const sbp_msg_gps_time_t& msg) { + static sbp_msg_gps_time_t to_non_gnss(const sbp_msg_gps_time_t &msg) { return msg; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_gps_time_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_gps_time_t &msg) { return sbp_msg_gps_time_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_gps_time_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_gps_time_t *msg) { return sbp_msg_gps_time_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_gps_time_t &msg) { @@ -2923,31 +3252,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgGroupDelayDepA; static constexpr const char *name = "MSG_GROUP_DELAY_DEP_A"; - static const sbp_msg_group_delay_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_group_delay_dep_a_t &get(const sbp_msg_t &msg) { return msg.group_delay_dep_a; } - static sbp_msg_group_delay_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_group_delay_dep_a_t &get(sbp_msg_t &msg) { return msg.group_delay_dep_a; } - static void to_sbp_msg(const sbp_msg_group_delay_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_group_delay_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->group_delay_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_group_delay_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_group_delay_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.group_delay_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_group_delay_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_group_delay_dep_a_t &msg, sbp_write_fn_t write) { return sbp_msg_group_delay_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_group_delay_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_group_delay_dep_a_t &msg) { return sbp_msg_group_delay_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_group_delay_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_group_delay_dep_a_t *msg) { return sbp_msg_group_delay_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_group_delay_dep_a_t &msg) { @@ -2955,31 +3288,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgGroupDelayDepB; static constexpr const char *name = "MSG_GROUP_DELAY_DEP_B"; - static const sbp_msg_group_delay_dep_b_t& get(const sbp_msg_t &msg) { + static const sbp_msg_group_delay_dep_b_t &get(const sbp_msg_t &msg) { return msg.group_delay_dep_b; } - static sbp_msg_group_delay_dep_b_t& get(sbp_msg_t &msg) { + static sbp_msg_group_delay_dep_b_t &get(sbp_msg_t &msg) { return msg.group_delay_dep_b; } - static void to_sbp_msg(const sbp_msg_group_delay_dep_b_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_group_delay_dep_b_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->group_delay_dep_b = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_group_delay_dep_b_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_group_delay_dep_b_t &msg) { sbp_msg_t sbp_msg; sbp_msg.group_delay_dep_b = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_group_delay_dep_b_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_group_delay_dep_b_t &msg, sbp_write_fn_t write) { return sbp_msg_group_delay_dep_b_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_group_delay_dep_b_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_group_delay_dep_b_t &msg) { return sbp_msg_group_delay_dep_b_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_group_delay_dep_b_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_group_delay_dep_b_t *msg) { return sbp_msg_group_delay_dep_b_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_group_delay_dep_b_t &msg) { @@ -2987,31 +3324,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgGroupDelay; static constexpr const char *name = "MSG_GROUP_DELAY"; - static const sbp_msg_group_delay_t& get(const sbp_msg_t &msg) { - return msg.group_delay; - } - static sbp_msg_group_delay_t& get(sbp_msg_t &msg) { + static const sbp_msg_group_delay_t &get(const sbp_msg_t &msg) { return msg.group_delay; } - static void to_sbp_msg(const sbp_msg_group_delay_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_group_delay_t &get(sbp_msg_t &msg) { return msg.group_delay; } + static void to_sbp_msg(const sbp_msg_group_delay_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->group_delay = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_group_delay_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_group_delay_t &msg) { sbp_msg_t sbp_msg; sbp_msg.group_delay = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_group_delay_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_group_delay_t &msg, sbp_write_fn_t write) { return sbp_msg_group_delay_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_group_delay_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_group_delay_t &msg) { return sbp_msg_group_delay_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_group_delay_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_group_delay_t *msg) { return sbp_msg_group_delay_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_group_delay_t &msg) { @@ -3019,31 +3357,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgGroupMeta; static constexpr const char *name = "MSG_GROUP_META"; - static const sbp_msg_group_meta_t& get(const sbp_msg_t &msg) { + static const sbp_msg_group_meta_t &get(const sbp_msg_t &msg) { return msg.group_meta; } - static sbp_msg_group_meta_t& get(sbp_msg_t &msg) { - return msg.group_meta; - } - static void to_sbp_msg(const sbp_msg_group_meta_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_group_meta_t &get(sbp_msg_t &msg) { return msg.group_meta; } + static void to_sbp_msg(const sbp_msg_group_meta_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->group_meta = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_group_meta_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_group_meta_t &msg) { sbp_msg_t sbp_msg; sbp_msg.group_meta = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_group_meta_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_group_meta_t &msg, sbp_write_fn_t write) { return sbp_msg_group_meta_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_group_meta_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_group_meta_t &msg) { return sbp_msg_group_meta_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_group_meta_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_group_meta_t *msg) { return sbp_msg_group_meta_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_group_meta_t &msg) { @@ -3051,31 +3390,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgHeartbeat; static constexpr const char *name = "MSG_HEARTBEAT"; - static const sbp_msg_heartbeat_t& get(const sbp_msg_t &msg) { - return msg.heartbeat; - } - static sbp_msg_heartbeat_t& get(sbp_msg_t &msg) { + static const sbp_msg_heartbeat_t &get(const sbp_msg_t &msg) { return msg.heartbeat; } - static void to_sbp_msg(const sbp_msg_heartbeat_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_heartbeat_t &get(sbp_msg_t &msg) { return msg.heartbeat; } + static void to_sbp_msg(const sbp_msg_heartbeat_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->heartbeat = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_heartbeat_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_heartbeat_t &msg) { sbp_msg_t sbp_msg; sbp_msg.heartbeat = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_heartbeat_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_heartbeat_t &msg, sbp_write_fn_t write) { return sbp_msg_heartbeat_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_heartbeat_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_heartbeat_t &msg) { return sbp_msg_heartbeat_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_heartbeat_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_heartbeat_t *msg) { return sbp_msg_heartbeat_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_heartbeat_t &msg) { @@ -3083,31 +3423,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgIarState; static constexpr const char *name = "MSG_IAR_STATE"; - static const sbp_msg_iar_state_t& get(const sbp_msg_t &msg) { + static const sbp_msg_iar_state_t &get(const sbp_msg_t &msg) { return msg.iar_state; } - static sbp_msg_iar_state_t& get(sbp_msg_t &msg) { - return msg.iar_state; - } - static void to_sbp_msg(const sbp_msg_iar_state_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_iar_state_t &get(sbp_msg_t &msg) { return msg.iar_state; } + static void to_sbp_msg(const sbp_msg_iar_state_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->iar_state = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_iar_state_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_iar_state_t &msg) { sbp_msg_t sbp_msg; sbp_msg.iar_state = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_iar_state_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_iar_state_t &msg, sbp_write_fn_t write) { return sbp_msg_iar_state_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_iar_state_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_iar_state_t &msg) { return sbp_msg_iar_state_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_iar_state_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_iar_state_t *msg) { return sbp_msg_iar_state_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_iar_state_t &msg) { @@ -3115,31 +3456,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgImuAux; static constexpr const char *name = "MSG_IMU_AUX"; - static const sbp_msg_imu_aux_t& get(const sbp_msg_t &msg) { - return msg.imu_aux; - } - static sbp_msg_imu_aux_t& get(sbp_msg_t &msg) { + static const sbp_msg_imu_aux_t &get(const sbp_msg_t &msg) { return msg.imu_aux; } - static void to_sbp_msg(const sbp_msg_imu_aux_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_imu_aux_t &get(sbp_msg_t &msg) { return msg.imu_aux; } + static void to_sbp_msg(const sbp_msg_imu_aux_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->imu_aux = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_imu_aux_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_imu_aux_t &msg) { sbp_msg_t sbp_msg; sbp_msg.imu_aux = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_imu_aux_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_imu_aux_t &msg, sbp_write_fn_t write) { return sbp_msg_imu_aux_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_imu_aux_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_imu_aux_t &msg) { return sbp_msg_imu_aux_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_imu_aux_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_imu_aux_t *msg) { return sbp_msg_imu_aux_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_imu_aux_t &msg) { @@ -3147,31 +3489,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgImuRaw; static constexpr const char *name = "MSG_IMU_RAW"; - static const sbp_msg_imu_raw_t& get(const sbp_msg_t &msg) { + static const sbp_msg_imu_raw_t &get(const sbp_msg_t &msg) { return msg.imu_raw; } - static sbp_msg_imu_raw_t& get(sbp_msg_t &msg) { - return msg.imu_raw; - } - static void to_sbp_msg(const sbp_msg_imu_raw_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_imu_raw_t &get(sbp_msg_t &msg) { return msg.imu_raw; } + static void to_sbp_msg(const sbp_msg_imu_raw_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->imu_raw = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_imu_raw_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_imu_raw_t &msg) { sbp_msg_t sbp_msg; sbp_msg.imu_raw = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_imu_raw_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_imu_raw_t &msg, sbp_write_fn_t write) { return sbp_msg_imu_raw_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_imu_raw_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_imu_raw_t &msg) { return sbp_msg_imu_raw_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_imu_raw_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_imu_raw_t *msg) { return sbp_msg_imu_raw_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_imu_raw_t &msg) { @@ -3179,31 +3522,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgInitBaseDep; static constexpr const char *name = "MSG_INIT_BASE_DEP"; - static const sbp_msg_init_base_dep_t& get(const sbp_msg_t &msg) { + static const sbp_msg_init_base_dep_t &get(const sbp_msg_t &msg) { return msg.init_base_dep; } - static sbp_msg_init_base_dep_t& get(sbp_msg_t &msg) { + static sbp_msg_init_base_dep_t &get(sbp_msg_t &msg) { return msg.init_base_dep; } - static void to_sbp_msg(const sbp_msg_init_base_dep_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_init_base_dep_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->init_base_dep = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_init_base_dep_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_init_base_dep_t &msg) { sbp_msg_t sbp_msg; sbp_msg.init_base_dep = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_init_base_dep_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_init_base_dep_t &msg, sbp_write_fn_t write) { return sbp_msg_init_base_dep_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_init_base_dep_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_init_base_dep_t &msg) { return sbp_msg_init_base_dep_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_init_base_dep_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_init_base_dep_t *msg) { return sbp_msg_init_base_dep_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_init_base_dep_t &msg) { @@ -3211,31 +3558,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgInsStatus; static constexpr const char *name = "MSG_INS_STATUS"; - static const sbp_msg_ins_status_t& get(const sbp_msg_t &msg) { - return msg.ins_status; - } - static sbp_msg_ins_status_t& get(sbp_msg_t &msg) { + static const sbp_msg_ins_status_t &get(const sbp_msg_t &msg) { return msg.ins_status; } - static void to_sbp_msg(const sbp_msg_ins_status_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_ins_status_t &get(sbp_msg_t &msg) { return msg.ins_status; } + static void to_sbp_msg(const sbp_msg_ins_status_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->ins_status = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ins_status_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ins_status_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ins_status = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ins_status_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ins_status_t &msg, sbp_write_fn_t write) { return sbp_msg_ins_status_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ins_status_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ins_status_t &msg) { return sbp_msg_ins_status_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ins_status_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ins_status_t *msg) { return sbp_msg_ins_status_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ins_status_t &msg) { @@ -3243,31 +3591,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgInsUpdates; static constexpr const char *name = "MSG_INS_UPDATES"; - static const sbp_msg_ins_updates_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ins_updates_t &get(const sbp_msg_t &msg) { return msg.ins_updates; } - static sbp_msg_ins_updates_t& get(sbp_msg_t &msg) { - return msg.ins_updates; - } - static void to_sbp_msg(const sbp_msg_ins_updates_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_ins_updates_t &get(sbp_msg_t &msg) { return msg.ins_updates; } + static void to_sbp_msg(const sbp_msg_ins_updates_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->ins_updates = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ins_updates_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ins_updates_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ins_updates = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ins_updates_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ins_updates_t &msg, sbp_write_fn_t write) { return sbp_msg_ins_updates_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ins_updates_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ins_updates_t &msg) { return sbp_msg_ins_updates_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ins_updates_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ins_updates_t *msg) { return sbp_msg_ins_updates_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ins_updates_t &msg) { @@ -3275,31 +3624,30 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgIono; static constexpr const char *name = "MSG_IONO"; - static const sbp_msg_iono_t& get(const sbp_msg_t &msg) { - return msg.iono; - } - static sbp_msg_iono_t& get(sbp_msg_t &msg) { - return msg.iono; - } - static void to_sbp_msg(const sbp_msg_iono_t& msg, sbp_msg_t *sbp_msg) { + static const sbp_msg_iono_t &get(const sbp_msg_t &msg) { return msg.iono; } + static sbp_msg_iono_t &get(sbp_msg_t &msg) { return msg.iono; } + static void to_sbp_msg(const sbp_msg_iono_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->iono = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_iono_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_iono_t &msg) { sbp_msg_t sbp_msg; sbp_msg.iono = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_iono_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_iono_t &msg, + sbp_write_fn_t write) { return sbp_msg_iono_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_iono_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_iono_t &msg) { return sbp_msg_iono_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_iono_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_iono_t *msg) { return sbp_msg_iono_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_iono_t &msg) { @@ -3307,31 +3655,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgLinuxCpuStateDepA; static constexpr const char *name = "MSG_LINUX_CPU_STATE_DEP_A"; - static const sbp_msg_linux_cpu_state_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_linux_cpu_state_dep_a_t &get(const sbp_msg_t &msg) { return msg.linux_cpu_state_dep_a; } - static sbp_msg_linux_cpu_state_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_linux_cpu_state_dep_a_t &get(sbp_msg_t &msg) { return msg.linux_cpu_state_dep_a; } - static void to_sbp_msg(const sbp_msg_linux_cpu_state_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_linux_cpu_state_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->linux_cpu_state_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_linux_cpu_state_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_linux_cpu_state_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.linux_cpu_state_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_linux_cpu_state_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_linux_cpu_state_dep_a_t &msg, + sbp_write_fn_t write) { return sbp_msg_linux_cpu_state_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_cpu_state_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_cpu_state_dep_a_t &msg) { return sbp_msg_linux_cpu_state_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_cpu_state_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_cpu_state_dep_a_t *msg) { return sbp_msg_linux_cpu_state_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_linux_cpu_state_dep_a_t &msg) { @@ -3339,31 +3692,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgLinuxCpuState; static constexpr const char *name = "MSG_LINUX_CPU_STATE"; - static const sbp_msg_linux_cpu_state_t& get(const sbp_msg_t &msg) { + static const sbp_msg_linux_cpu_state_t &get(const sbp_msg_t &msg) { return msg.linux_cpu_state; } - static sbp_msg_linux_cpu_state_t& get(sbp_msg_t &msg) { + static sbp_msg_linux_cpu_state_t &get(sbp_msg_t &msg) { return msg.linux_cpu_state; } - static void to_sbp_msg(const sbp_msg_linux_cpu_state_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_linux_cpu_state_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->linux_cpu_state = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_linux_cpu_state_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_linux_cpu_state_t &msg) { sbp_msg_t sbp_msg; sbp_msg.linux_cpu_state = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_linux_cpu_state_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_linux_cpu_state_t &msg, sbp_write_fn_t write) { return sbp_msg_linux_cpu_state_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_cpu_state_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_cpu_state_t &msg) { return sbp_msg_linux_cpu_state_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_cpu_state_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_cpu_state_t *msg) { return sbp_msg_linux_cpu_state_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_linux_cpu_state_t &msg) { @@ -3371,31 +3728,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgLinuxMemStateDepA; static constexpr const char *name = "MSG_LINUX_MEM_STATE_DEP_A"; - static const sbp_msg_linux_mem_state_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_linux_mem_state_dep_a_t &get(const sbp_msg_t &msg) { return msg.linux_mem_state_dep_a; } - static sbp_msg_linux_mem_state_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_linux_mem_state_dep_a_t &get(sbp_msg_t &msg) { return msg.linux_mem_state_dep_a; } - static void to_sbp_msg(const sbp_msg_linux_mem_state_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_linux_mem_state_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->linux_mem_state_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_linux_mem_state_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_linux_mem_state_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.linux_mem_state_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_linux_mem_state_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_linux_mem_state_dep_a_t &msg, + sbp_write_fn_t write) { return sbp_msg_linux_mem_state_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_mem_state_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_mem_state_dep_a_t &msg) { return sbp_msg_linux_mem_state_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_mem_state_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_mem_state_dep_a_t *msg) { return sbp_msg_linux_mem_state_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_linux_mem_state_dep_a_t &msg) { @@ -3403,31 +3765,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgLinuxMemState; static constexpr const char *name = "MSG_LINUX_MEM_STATE"; - static const sbp_msg_linux_mem_state_t& get(const sbp_msg_t &msg) { + static const sbp_msg_linux_mem_state_t &get(const sbp_msg_t &msg) { return msg.linux_mem_state; } - static sbp_msg_linux_mem_state_t& get(sbp_msg_t &msg) { + static sbp_msg_linux_mem_state_t &get(sbp_msg_t &msg) { return msg.linux_mem_state; } - static void to_sbp_msg(const sbp_msg_linux_mem_state_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_linux_mem_state_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->linux_mem_state = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_linux_mem_state_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_linux_mem_state_t &msg) { sbp_msg_t sbp_msg; sbp_msg.linux_mem_state = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_linux_mem_state_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_linux_mem_state_t &msg, sbp_write_fn_t write) { return sbp_msg_linux_mem_state_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_mem_state_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_mem_state_t &msg) { return sbp_msg_linux_mem_state_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_mem_state_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_mem_state_t *msg) { return sbp_msg_linux_mem_state_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_linux_mem_state_t &msg) { @@ -3435,31 +3801,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgLinuxProcessFdCount; static constexpr const char *name = "MSG_LINUX_PROCESS_FD_COUNT"; - static const sbp_msg_linux_process_fd_count_t& get(const sbp_msg_t &msg) { + static const sbp_msg_linux_process_fd_count_t &get(const sbp_msg_t &msg) { return msg.linux_process_fd_count; } - static sbp_msg_linux_process_fd_count_t& get(sbp_msg_t &msg) { + static sbp_msg_linux_process_fd_count_t &get(sbp_msg_t &msg) { return msg.linux_process_fd_count; } - static void to_sbp_msg(const sbp_msg_linux_process_fd_count_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_linux_process_fd_count_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->linux_process_fd_count = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_linux_process_fd_count_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_linux_process_fd_count_t &msg) { sbp_msg_t sbp_msg; sbp_msg.linux_process_fd_count = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_linux_process_fd_count_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_linux_process_fd_count_t &msg, + sbp_write_fn_t write) { return sbp_msg_linux_process_fd_count_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_process_fd_count_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_process_fd_count_t &msg) { return sbp_msg_linux_process_fd_count_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_process_fd_count_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_process_fd_count_t *msg) { return sbp_msg_linux_process_fd_count_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_linux_process_fd_count_t &msg) { @@ -3467,31 +3838,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgLinuxProcessFdSummary; static constexpr const char *name = "MSG_LINUX_PROCESS_FD_SUMMARY"; - static const sbp_msg_linux_process_fd_summary_t& get(const sbp_msg_t &msg) { + static const sbp_msg_linux_process_fd_summary_t &get(const sbp_msg_t &msg) { return msg.linux_process_fd_summary; } - static sbp_msg_linux_process_fd_summary_t& get(sbp_msg_t &msg) { + static sbp_msg_linux_process_fd_summary_t &get(sbp_msg_t &msg) { return msg.linux_process_fd_summary; } - static void to_sbp_msg(const sbp_msg_linux_process_fd_summary_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_linux_process_fd_summary_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->linux_process_fd_summary = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_linux_process_fd_summary_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_linux_process_fd_summary_t &msg) { sbp_msg_t sbp_msg; sbp_msg.linux_process_fd_summary = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_linux_process_fd_summary_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_linux_process_fd_summary_t &msg, + sbp_write_fn_t write) { return sbp_msg_linux_process_fd_summary_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_process_fd_summary_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_process_fd_summary_t &msg) { return sbp_msg_linux_process_fd_summary_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_process_fd_summary_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_process_fd_summary_t *msg) { return sbp_msg_linux_process_fd_summary_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_linux_process_fd_summary_t &msg) { @@ -3499,31 +3875,40 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgLinuxProcessSocketCounts; static constexpr const char *name = "MSG_LINUX_PROCESS_SOCKET_COUNTS"; - static const sbp_msg_linux_process_socket_counts_t& get(const sbp_msg_t &msg) { + static const sbp_msg_linux_process_socket_counts_t &get( + const sbp_msg_t &msg) { return msg.linux_process_socket_counts; } - static sbp_msg_linux_process_socket_counts_t& get(sbp_msg_t &msg) { + static sbp_msg_linux_process_socket_counts_t &get(sbp_msg_t &msg) { return msg.linux_process_socket_counts; } - static void to_sbp_msg(const sbp_msg_linux_process_socket_counts_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_linux_process_socket_counts_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->linux_process_socket_counts = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_linux_process_socket_counts_t& msg) { + static sbp_msg_t to_sbp_msg( + const sbp_msg_linux_process_socket_counts_t &msg) { sbp_msg_t sbp_msg; sbp_msg.linux_process_socket_counts = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_linux_process_socket_counts_t &msg, sbp_write_fn_t write) { - return sbp_msg_linux_process_socket_counts_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_linux_process_socket_counts_t &msg, + sbp_write_fn_t write) { + return sbp_msg_linux_process_socket_counts_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_process_socket_counts_t &msg){ - return sbp_msg_linux_process_socket_counts_encode(buf, len, n_written, &msg); + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_process_socket_counts_t &msg) { + return sbp_msg_linux_process_socket_counts_encode(buf, len, n_written, + &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_process_socket_counts_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_process_socket_counts_t *msg) { return sbp_msg_linux_process_socket_counts_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_linux_process_socket_counts_t &msg) { @@ -3531,31 +3916,40 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgLinuxProcessSocketQueues; static constexpr const char *name = "MSG_LINUX_PROCESS_SOCKET_QUEUES"; - static const sbp_msg_linux_process_socket_queues_t& get(const sbp_msg_t &msg) { + static const sbp_msg_linux_process_socket_queues_t &get( + const sbp_msg_t &msg) { return msg.linux_process_socket_queues; } - static sbp_msg_linux_process_socket_queues_t& get(sbp_msg_t &msg) { + static sbp_msg_linux_process_socket_queues_t &get(sbp_msg_t &msg) { return msg.linux_process_socket_queues; } - static void to_sbp_msg(const sbp_msg_linux_process_socket_queues_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_linux_process_socket_queues_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->linux_process_socket_queues = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_linux_process_socket_queues_t& msg) { + static sbp_msg_t to_sbp_msg( + const sbp_msg_linux_process_socket_queues_t &msg) { sbp_msg_t sbp_msg; sbp_msg.linux_process_socket_queues = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_linux_process_socket_queues_t &msg, sbp_write_fn_t write) { - return sbp_msg_linux_process_socket_queues_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_linux_process_socket_queues_t &msg, + sbp_write_fn_t write) { + return sbp_msg_linux_process_socket_queues_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_process_socket_queues_t &msg){ - return sbp_msg_linux_process_socket_queues_encode(buf, len, n_written, &msg); + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_process_socket_queues_t &msg) { + return sbp_msg_linux_process_socket_queues_encode(buf, len, n_written, + &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_process_socket_queues_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_process_socket_queues_t *msg) { return sbp_msg_linux_process_socket_queues_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_linux_process_socket_queues_t &msg) { @@ -3563,31 +3957,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgLinuxSocketUsage; static constexpr const char *name = "MSG_LINUX_SOCKET_USAGE"; - static const sbp_msg_linux_socket_usage_t& get(const sbp_msg_t &msg) { + static const sbp_msg_linux_socket_usage_t &get(const sbp_msg_t &msg) { return msg.linux_socket_usage; } - static sbp_msg_linux_socket_usage_t& get(sbp_msg_t &msg) { + static sbp_msg_linux_socket_usage_t &get(sbp_msg_t &msg) { return msg.linux_socket_usage; } - static void to_sbp_msg(const sbp_msg_linux_socket_usage_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_linux_socket_usage_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->linux_socket_usage = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_linux_socket_usage_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_linux_socket_usage_t &msg) { sbp_msg_t sbp_msg; sbp_msg.linux_socket_usage = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_linux_socket_usage_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_linux_socket_usage_t &msg, + sbp_write_fn_t write) { return sbp_msg_linux_socket_usage_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_socket_usage_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_socket_usage_t &msg) { return sbp_msg_linux_socket_usage_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_socket_usage_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_socket_usage_t *msg) { return sbp_msg_linux_socket_usage_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_linux_socket_usage_t &msg) { @@ -3595,31 +3994,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgLinuxSysStateDepA; static constexpr const char *name = "MSG_LINUX_SYS_STATE_DEP_A"; - static const sbp_msg_linux_sys_state_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_linux_sys_state_dep_a_t &get(const sbp_msg_t &msg) { return msg.linux_sys_state_dep_a; } - static sbp_msg_linux_sys_state_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_linux_sys_state_dep_a_t &get(sbp_msg_t &msg) { return msg.linux_sys_state_dep_a; } - static void to_sbp_msg(const sbp_msg_linux_sys_state_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_linux_sys_state_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->linux_sys_state_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_linux_sys_state_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_linux_sys_state_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.linux_sys_state_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_linux_sys_state_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_linux_sys_state_dep_a_t &msg, + sbp_write_fn_t write) { return sbp_msg_linux_sys_state_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_sys_state_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_sys_state_dep_a_t &msg) { return sbp_msg_linux_sys_state_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_sys_state_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_sys_state_dep_a_t *msg) { return sbp_msg_linux_sys_state_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_linux_sys_state_dep_a_t &msg) { @@ -3627,31 +4031,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgLinuxSysState; static constexpr const char *name = "MSG_LINUX_SYS_STATE"; - static const sbp_msg_linux_sys_state_t& get(const sbp_msg_t &msg) { + static const sbp_msg_linux_sys_state_t &get(const sbp_msg_t &msg) { return msg.linux_sys_state; } - static sbp_msg_linux_sys_state_t& get(sbp_msg_t &msg) { + static sbp_msg_linux_sys_state_t &get(sbp_msg_t &msg) { return msg.linux_sys_state; } - static void to_sbp_msg(const sbp_msg_linux_sys_state_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_linux_sys_state_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->linux_sys_state = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_linux_sys_state_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_linux_sys_state_t &msg) { sbp_msg_t sbp_msg; sbp_msg.linux_sys_state = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_linux_sys_state_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_linux_sys_state_t &msg, sbp_write_fn_t write) { return sbp_msg_linux_sys_state_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_sys_state_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_sys_state_t &msg) { return sbp_msg_linux_sys_state_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_sys_state_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_sys_state_t *msg) { return sbp_msg_linux_sys_state_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_linux_sys_state_t &msg) { @@ -3659,31 +4067,30 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgLog; static constexpr const char *name = "MSG_LOG"; - static const sbp_msg_log_t& get(const sbp_msg_t &msg) { - return msg.log; - } - static sbp_msg_log_t& get(sbp_msg_t &msg) { - return msg.log; - } - static void to_sbp_msg(const sbp_msg_log_t& msg, sbp_msg_t *sbp_msg) { + static const sbp_msg_log_t &get(const sbp_msg_t &msg) { return msg.log; } + static sbp_msg_log_t &get(sbp_msg_t &msg) { return msg.log; } + static void to_sbp_msg(const sbp_msg_log_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->log = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_log_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_log_t &msg) { sbp_msg_t sbp_msg; sbp_msg.log = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_log_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_log_t &msg, + sbp_write_fn_t write) { return sbp_msg_log_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_log_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_log_t &msg) { return sbp_msg_log_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_log_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_log_t *msg) { return sbp_msg_log_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_log_t &msg) { @@ -3691,31 +4098,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgM25FlashWriteStatus; static constexpr const char *name = "MSG_M25_FLASH_WRITE_STATUS"; - static const sbp_msg_m25_flash_write_status_t& get(const sbp_msg_t &msg) { + static const sbp_msg_m25_flash_write_status_t &get(const sbp_msg_t &msg) { return msg.m25_flash_write_status; } - static sbp_msg_m25_flash_write_status_t& get(sbp_msg_t &msg) { + static sbp_msg_m25_flash_write_status_t &get(sbp_msg_t &msg) { return msg.m25_flash_write_status; } - static void to_sbp_msg(const sbp_msg_m25_flash_write_status_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_m25_flash_write_status_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->m25_flash_write_status = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_m25_flash_write_status_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_m25_flash_write_status_t &msg) { sbp_msg_t sbp_msg; sbp_msg.m25_flash_write_status = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_m25_flash_write_status_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_m25_flash_write_status_t &msg, + sbp_write_fn_t write) { return sbp_msg_m25_flash_write_status_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_m25_flash_write_status_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_m25_flash_write_status_t &msg) { return sbp_msg_m25_flash_write_status_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_m25_flash_write_status_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_m25_flash_write_status_t *msg) { return sbp_msg_m25_flash_write_status_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_m25_flash_write_status_t &msg) { @@ -3723,31 +4135,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgMagRaw; static constexpr const char *name = "MSG_MAG_RAW"; - static const sbp_msg_mag_raw_t& get(const sbp_msg_t &msg) { - return msg.mag_raw; - } - static sbp_msg_mag_raw_t& get(sbp_msg_t &msg) { + static const sbp_msg_mag_raw_t &get(const sbp_msg_t &msg) { return msg.mag_raw; } - static void to_sbp_msg(const sbp_msg_mag_raw_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_mag_raw_t &get(sbp_msg_t &msg) { return msg.mag_raw; } + static void to_sbp_msg(const sbp_msg_mag_raw_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->mag_raw = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_mag_raw_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_mag_raw_t &msg) { sbp_msg_t sbp_msg; sbp_msg.mag_raw = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_mag_raw_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_mag_raw_t &msg, sbp_write_fn_t write) { return sbp_msg_mag_raw_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_mag_raw_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_mag_raw_t &msg) { return sbp_msg_mag_raw_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_mag_raw_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_mag_raw_t *msg) { return sbp_msg_mag_raw_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_mag_raw_t &msg) { @@ -3755,31 +4168,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgMaskSatelliteDep; static constexpr const char *name = "MSG_MASK_SATELLITE_DEP"; - static const sbp_msg_mask_satellite_dep_t& get(const sbp_msg_t &msg) { + static const sbp_msg_mask_satellite_dep_t &get(const sbp_msg_t &msg) { return msg.mask_satellite_dep; } - static sbp_msg_mask_satellite_dep_t& get(sbp_msg_t &msg) { + static sbp_msg_mask_satellite_dep_t &get(sbp_msg_t &msg) { return msg.mask_satellite_dep; } - static void to_sbp_msg(const sbp_msg_mask_satellite_dep_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_mask_satellite_dep_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->mask_satellite_dep = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_mask_satellite_dep_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_mask_satellite_dep_t &msg) { sbp_msg_t sbp_msg; sbp_msg.mask_satellite_dep = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_mask_satellite_dep_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_mask_satellite_dep_t &msg, + sbp_write_fn_t write) { return sbp_msg_mask_satellite_dep_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_mask_satellite_dep_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_mask_satellite_dep_t &msg) { return sbp_msg_mask_satellite_dep_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_mask_satellite_dep_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_mask_satellite_dep_t *msg) { return sbp_msg_mask_satellite_dep_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_mask_satellite_dep_t &msg) { @@ -3787,31 +4205,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgMaskSatellite; static constexpr const char *name = "MSG_MASK_SATELLITE"; - static const sbp_msg_mask_satellite_t& get(const sbp_msg_t &msg) { + static const sbp_msg_mask_satellite_t &get(const sbp_msg_t &msg) { return msg.mask_satellite; } - static sbp_msg_mask_satellite_t& get(sbp_msg_t &msg) { + static sbp_msg_mask_satellite_t &get(sbp_msg_t &msg) { return msg.mask_satellite; } - static void to_sbp_msg(const sbp_msg_mask_satellite_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_mask_satellite_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->mask_satellite = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_mask_satellite_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_mask_satellite_t &msg) { sbp_msg_t sbp_msg; sbp_msg.mask_satellite = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_mask_satellite_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_mask_satellite_t &msg, sbp_write_fn_t write) { return sbp_msg_mask_satellite_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_mask_satellite_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_mask_satellite_t &msg) { return sbp_msg_mask_satellite_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_mask_satellite_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_mask_satellite_t *msg) { return sbp_msg_mask_satellite_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_mask_satellite_t &msg) { @@ -3819,31 +4241,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgMeasurementState; static constexpr const char *name = "MSG_MEASUREMENT_STATE"; - static const sbp_msg_measurement_state_t& get(const sbp_msg_t &msg) { + static const sbp_msg_measurement_state_t &get(const sbp_msg_t &msg) { return msg.measurement_state; } - static sbp_msg_measurement_state_t& get(sbp_msg_t &msg) { + static sbp_msg_measurement_state_t &get(sbp_msg_t &msg) { return msg.measurement_state; } - static void to_sbp_msg(const sbp_msg_measurement_state_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_measurement_state_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->measurement_state = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_measurement_state_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_measurement_state_t &msg) { sbp_msg_t sbp_msg; sbp_msg.measurement_state = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_measurement_state_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_measurement_state_t &msg, sbp_write_fn_t write) { return sbp_msg_measurement_state_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_measurement_state_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_measurement_state_t &msg) { return sbp_msg_measurement_state_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_measurement_state_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_measurement_state_t *msg) { return sbp_msg_measurement_state_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_measurement_state_t &msg) { @@ -3851,31 +4277,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgNapDeviceDnaReq; static constexpr const char *name = "MSG_NAP_DEVICE_DNA_REQ"; - static const sbp_msg_nap_device_dna_req_t& get(const sbp_msg_t &msg) { + static const sbp_msg_nap_device_dna_req_t &get(const sbp_msg_t &msg) { return msg.nap_device_dna_req; } - static sbp_msg_nap_device_dna_req_t& get(sbp_msg_t &msg) { + static sbp_msg_nap_device_dna_req_t &get(sbp_msg_t &msg) { return msg.nap_device_dna_req; } - static void to_sbp_msg(const sbp_msg_nap_device_dna_req_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_nap_device_dna_req_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->nap_device_dna_req = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_nap_device_dna_req_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_nap_device_dna_req_t &msg) { sbp_msg_t sbp_msg; sbp_msg.nap_device_dna_req = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_nap_device_dna_req_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_nap_device_dna_req_t &msg, + sbp_write_fn_t write) { return sbp_msg_nap_device_dna_req_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_nap_device_dna_req_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_nap_device_dna_req_t &msg) { return sbp_msg_nap_device_dna_req_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_nap_device_dna_req_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_nap_device_dna_req_t *msg) { return sbp_msg_nap_device_dna_req_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_nap_device_dna_req_t &msg) { @@ -3883,31 +4314,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgNapDeviceDnaResp; static constexpr const char *name = "MSG_NAP_DEVICE_DNA_RESP"; - static const sbp_msg_nap_device_dna_resp_t& get(const sbp_msg_t &msg) { + static const sbp_msg_nap_device_dna_resp_t &get(const sbp_msg_t &msg) { return msg.nap_device_dna_resp; } - static sbp_msg_nap_device_dna_resp_t& get(sbp_msg_t &msg) { + static sbp_msg_nap_device_dna_resp_t &get(sbp_msg_t &msg) { return msg.nap_device_dna_resp; } - static void to_sbp_msg(const sbp_msg_nap_device_dna_resp_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_nap_device_dna_resp_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->nap_device_dna_resp = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_nap_device_dna_resp_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_nap_device_dna_resp_t &msg) { sbp_msg_t sbp_msg; sbp_msg.nap_device_dna_resp = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_nap_device_dna_resp_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_nap_device_dna_resp_t &msg, + sbp_write_fn_t write) { return sbp_msg_nap_device_dna_resp_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_nap_device_dna_resp_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_nap_device_dna_resp_t &msg) { return sbp_msg_nap_device_dna_resp_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_nap_device_dna_resp_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_nap_device_dna_resp_t *msg) { return sbp_msg_nap_device_dna_resp_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_nap_device_dna_resp_t &msg) { @@ -3915,31 +4351,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgNdbEvent; static constexpr const char *name = "MSG_NDB_EVENT"; - static const sbp_msg_ndb_event_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ndb_event_t &get(const sbp_msg_t &msg) { return msg.ndb_event; } - static sbp_msg_ndb_event_t& get(sbp_msg_t &msg) { - return msg.ndb_event; - } - static void to_sbp_msg(const sbp_msg_ndb_event_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_ndb_event_t &get(sbp_msg_t &msg) { return msg.ndb_event; } + static void to_sbp_msg(const sbp_msg_ndb_event_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->ndb_event = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ndb_event_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ndb_event_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ndb_event = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ndb_event_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ndb_event_t &msg, sbp_write_fn_t write) { return sbp_msg_ndb_event_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ndb_event_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ndb_event_t &msg) { return sbp_msg_ndb_event_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ndb_event_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ndb_event_t *msg) { return sbp_msg_ndb_event_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ndb_event_t &msg) { @@ -3947,31 +4384,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgNetworkBandwidthUsage; static constexpr const char *name = "MSG_NETWORK_BANDWIDTH_USAGE"; - static const sbp_msg_network_bandwidth_usage_t& get(const sbp_msg_t &msg) { + static const sbp_msg_network_bandwidth_usage_t &get(const sbp_msg_t &msg) { return msg.network_bandwidth_usage; } - static sbp_msg_network_bandwidth_usage_t& get(sbp_msg_t &msg) { + static sbp_msg_network_bandwidth_usage_t &get(sbp_msg_t &msg) { return msg.network_bandwidth_usage; } - static void to_sbp_msg(const sbp_msg_network_bandwidth_usage_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_network_bandwidth_usage_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->network_bandwidth_usage = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_network_bandwidth_usage_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_network_bandwidth_usage_t &msg) { sbp_msg_t sbp_msg; sbp_msg.network_bandwidth_usage = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_network_bandwidth_usage_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_network_bandwidth_usage_t &msg, + sbp_write_fn_t write) { return sbp_msg_network_bandwidth_usage_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_network_bandwidth_usage_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_network_bandwidth_usage_t &msg) { return sbp_msg_network_bandwidth_usage_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_network_bandwidth_usage_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_network_bandwidth_usage_t *msg) { return sbp_msg_network_bandwidth_usage_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_network_bandwidth_usage_t &msg) { @@ -3979,31 +4421,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgNetworkStateReq; static constexpr const char *name = "MSG_NETWORK_STATE_REQ"; - static const sbp_msg_network_state_req_t& get(const sbp_msg_t &msg) { + static const sbp_msg_network_state_req_t &get(const sbp_msg_t &msg) { return msg.network_state_req; } - static sbp_msg_network_state_req_t& get(sbp_msg_t &msg) { + static sbp_msg_network_state_req_t &get(sbp_msg_t &msg) { return msg.network_state_req; } - static void to_sbp_msg(const sbp_msg_network_state_req_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_network_state_req_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->network_state_req = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_network_state_req_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_network_state_req_t &msg) { sbp_msg_t sbp_msg; sbp_msg.network_state_req = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_network_state_req_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_network_state_req_t &msg, sbp_write_fn_t write) { return sbp_msg_network_state_req_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_network_state_req_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_network_state_req_t &msg) { return sbp_msg_network_state_req_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_network_state_req_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_network_state_req_t *msg) { return sbp_msg_network_state_req_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_network_state_req_t &msg) { @@ -4011,31 +4457,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgNetworkStateResp; static constexpr const char *name = "MSG_NETWORK_STATE_RESP"; - static const sbp_msg_network_state_resp_t& get(const sbp_msg_t &msg) { + static const sbp_msg_network_state_resp_t &get(const sbp_msg_t &msg) { return msg.network_state_resp; } - static sbp_msg_network_state_resp_t& get(sbp_msg_t &msg) { + static sbp_msg_network_state_resp_t &get(sbp_msg_t &msg) { return msg.network_state_resp; } - static void to_sbp_msg(const sbp_msg_network_state_resp_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_network_state_resp_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->network_state_resp = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_network_state_resp_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_network_state_resp_t &msg) { sbp_msg_t sbp_msg; sbp_msg.network_state_resp = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_network_state_resp_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_network_state_resp_t &msg, + sbp_write_fn_t write) { return sbp_msg_network_state_resp_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_network_state_resp_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_network_state_resp_t &msg) { return sbp_msg_network_state_resp_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_network_state_resp_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_network_state_resp_t *msg) { return sbp_msg_network_state_resp_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_network_state_resp_t &msg) { @@ -4043,31 +4494,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgObsDepA; static constexpr const char *name = "MSG_OBS_DEP_A"; - static const sbp_msg_obs_dep_a_t& get(const sbp_msg_t &msg) { - return msg.obs_dep_a; - } - static sbp_msg_obs_dep_a_t& get(sbp_msg_t &msg) { + static const sbp_msg_obs_dep_a_t &get(const sbp_msg_t &msg) { return msg.obs_dep_a; } - static void to_sbp_msg(const sbp_msg_obs_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_obs_dep_a_t &get(sbp_msg_t &msg) { return msg.obs_dep_a; } + static void to_sbp_msg(const sbp_msg_obs_dep_a_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->obs_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_obs_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_obs_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.obs_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_obs_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_obs_dep_a_t &msg, sbp_write_fn_t write) { return sbp_msg_obs_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_obs_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_obs_dep_a_t &msg) { return sbp_msg_obs_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_obs_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_obs_dep_a_t *msg) { return sbp_msg_obs_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_obs_dep_a_t &msg) { @@ -4075,31 +4527,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgObsDepB; static constexpr const char *name = "MSG_OBS_DEP_B"; - static const sbp_msg_obs_dep_b_t& get(const sbp_msg_t &msg) { + static const sbp_msg_obs_dep_b_t &get(const sbp_msg_t &msg) { return msg.obs_dep_b; } - static sbp_msg_obs_dep_b_t& get(sbp_msg_t &msg) { - return msg.obs_dep_b; - } - static void to_sbp_msg(const sbp_msg_obs_dep_b_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_obs_dep_b_t &get(sbp_msg_t &msg) { return msg.obs_dep_b; } + static void to_sbp_msg(const sbp_msg_obs_dep_b_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->obs_dep_b = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_obs_dep_b_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_obs_dep_b_t &msg) { sbp_msg_t sbp_msg; sbp_msg.obs_dep_b = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_obs_dep_b_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_obs_dep_b_t &msg, sbp_write_fn_t write) { return sbp_msg_obs_dep_b_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_obs_dep_b_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_obs_dep_b_t &msg) { return sbp_msg_obs_dep_b_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_obs_dep_b_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_obs_dep_b_t *msg) { return sbp_msg_obs_dep_b_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_obs_dep_b_t &msg) { @@ -4107,31 +4560,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgObsDepC; static constexpr const char *name = "MSG_OBS_DEP_C"; - static const sbp_msg_obs_dep_c_t& get(const sbp_msg_t &msg) { + static const sbp_msg_obs_dep_c_t &get(const sbp_msg_t &msg) { return msg.obs_dep_c; } - static sbp_msg_obs_dep_c_t& get(sbp_msg_t &msg) { - return msg.obs_dep_c; - } - static void to_sbp_msg(const sbp_msg_obs_dep_c_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_obs_dep_c_t &get(sbp_msg_t &msg) { return msg.obs_dep_c; } + static void to_sbp_msg(const sbp_msg_obs_dep_c_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->obs_dep_c = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_obs_dep_c_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_obs_dep_c_t &msg) { sbp_msg_t sbp_msg; sbp_msg.obs_dep_c = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_obs_dep_c_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_obs_dep_c_t &msg, sbp_write_fn_t write) { return sbp_msg_obs_dep_c_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_obs_dep_c_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_obs_dep_c_t &msg) { return sbp_msg_obs_dep_c_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_obs_dep_c_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_obs_dep_c_t *msg) { return sbp_msg_obs_dep_c_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_obs_dep_c_t &msg) { @@ -4139,31 +4593,30 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgObs; static constexpr const char *name = "MSG_OBS"; - static const sbp_msg_obs_t& get(const sbp_msg_t &msg) { - return msg.obs; - } - static sbp_msg_obs_t& get(sbp_msg_t &msg) { - return msg.obs; - } - static void to_sbp_msg(const sbp_msg_obs_t& msg, sbp_msg_t *sbp_msg) { + static const sbp_msg_obs_t &get(const sbp_msg_t &msg) { return msg.obs; } + static sbp_msg_obs_t &get(sbp_msg_t &msg) { return msg.obs; } + static void to_sbp_msg(const sbp_msg_obs_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->obs = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_obs_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_obs_t &msg) { sbp_msg_t sbp_msg; sbp_msg.obs = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_obs_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_obs_t &msg, + sbp_write_fn_t write) { return sbp_msg_obs_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_obs_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_obs_t &msg) { return sbp_msg_obs_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_obs_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_obs_t *msg) { return sbp_msg_obs_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_obs_t &msg) { @@ -4171,31 +4624,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgOdometry; static constexpr const char *name = "MSG_ODOMETRY"; - static const sbp_msg_odometry_t& get(const sbp_msg_t &msg) { - return msg.odometry; - } - static sbp_msg_odometry_t& get(sbp_msg_t &msg) { + static const sbp_msg_odometry_t &get(const sbp_msg_t &msg) { return msg.odometry; } - static void to_sbp_msg(const sbp_msg_odometry_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_odometry_t &get(sbp_msg_t &msg) { return msg.odometry; } + static void to_sbp_msg(const sbp_msg_odometry_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->odometry = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_odometry_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_odometry_t &msg) { sbp_msg_t sbp_msg; sbp_msg.odometry = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_odometry_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_odometry_t &msg, sbp_write_fn_t write) { return sbp_msg_odometry_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_odometry_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_odometry_t &msg) { return sbp_msg_odometry_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_odometry_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_odometry_t *msg) { return sbp_msg_odometry_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_odometry_t &msg) { @@ -4203,31 +4657,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgOrientEuler; static constexpr const char *name = "MSG_ORIENT_EULER"; - static const sbp_msg_orient_euler_t& get(const sbp_msg_t &msg) { + static const sbp_msg_orient_euler_t &get(const sbp_msg_t &msg) { return msg.orient_euler; } - static sbp_msg_orient_euler_t& get(sbp_msg_t &msg) { + static sbp_msg_orient_euler_t &get(sbp_msg_t &msg) { return msg.orient_euler; } - static void to_sbp_msg(const sbp_msg_orient_euler_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_orient_euler_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->orient_euler = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_orient_euler_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_orient_euler_t &msg) { sbp_msg_t sbp_msg; sbp_msg.orient_euler = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_orient_euler_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_orient_euler_t &msg, sbp_write_fn_t write) { return sbp_msg_orient_euler_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_orient_euler_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_orient_euler_t &msg) { return sbp_msg_orient_euler_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_orient_euler_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_orient_euler_t *msg) { return sbp_msg_orient_euler_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_orient_euler_t &msg) { @@ -4235,31 +4693,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgOrientQuat; static constexpr const char *name = "MSG_ORIENT_QUAT"; - static const sbp_msg_orient_quat_t& get(const sbp_msg_t &msg) { + static const sbp_msg_orient_quat_t &get(const sbp_msg_t &msg) { return msg.orient_quat; } - static sbp_msg_orient_quat_t& get(sbp_msg_t &msg) { - return msg.orient_quat; - } - static void to_sbp_msg(const sbp_msg_orient_quat_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_orient_quat_t &get(sbp_msg_t &msg) { return msg.orient_quat; } + static void to_sbp_msg(const sbp_msg_orient_quat_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->orient_quat = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_orient_quat_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_orient_quat_t &msg) { sbp_msg_t sbp_msg; sbp_msg.orient_quat = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_orient_quat_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_orient_quat_t &msg, sbp_write_fn_t write) { return sbp_msg_orient_quat_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_orient_quat_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_orient_quat_t &msg) { return sbp_msg_orient_quat_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_orient_quat_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_orient_quat_t *msg) { return sbp_msg_orient_quat_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_orient_quat_t &msg) { @@ -4267,31 +4726,30 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgOsr; static constexpr const char *name = "MSG_OSR"; - static const sbp_msg_osr_t& get(const sbp_msg_t &msg) { - return msg.osr; - } - static sbp_msg_osr_t& get(sbp_msg_t &msg) { - return msg.osr; - } - static void to_sbp_msg(const sbp_msg_osr_t& msg, sbp_msg_t *sbp_msg) { + static const sbp_msg_osr_t &get(const sbp_msg_t &msg) { return msg.osr; } + static sbp_msg_osr_t &get(sbp_msg_t &msg) { return msg.osr; } + static void to_sbp_msg(const sbp_msg_osr_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->osr = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_osr_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_osr_t &msg) { sbp_msg_t sbp_msg; sbp_msg.osr = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_osr_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_osr_t &msg, + sbp_write_fn_t write) { return sbp_msg_osr_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_osr_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_osr_t &msg) { return sbp_msg_osr_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_osr_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_osr_t *msg) { return sbp_msg_osr_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_osr_t &msg) { @@ -4299,40 +4757,46 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgPosEcefCovGnss; static constexpr const char *name = "MSG_POS_ECEF_COV_GNSS"; - static const sbp_msg_pos_ecef_cov_gnss_t& get(const sbp_msg_t &msg) { + static const sbp_msg_pos_ecef_cov_gnss_t &get(const sbp_msg_t &msg) { return msg.pos_ecef_cov_gnss; } - static sbp_msg_pos_ecef_cov_gnss_t& get(sbp_msg_t &msg) { + static sbp_msg_pos_ecef_cov_gnss_t &get(sbp_msg_t &msg) { return msg.pos_ecef_cov_gnss; } - static void to_sbp_msg(const sbp_msg_pos_ecef_cov_gnss_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_pos_ecef_cov_gnss_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->pos_ecef_cov_gnss = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_pos_ecef_cov_gnss_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_pos_ecef_cov_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_ecef_cov_gnss = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_pos_ecef_cov_gnss_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_pos_ecef_cov_gnss_t &msg, sbp_write_fn_t write) { return sbp_msg_pos_ecef_cov_gnss_send(state, sender_id, &msg, write); } - static sbp_msg_pos_ecef_cov_gnss_t to_gnss(const sbp_msg_pos_ecef_cov_gnss_t& msg) { + static sbp_msg_pos_ecef_cov_gnss_t to_gnss( + const sbp_msg_pos_ecef_cov_gnss_t &msg) { return msg; } - static sbp_msg_pos_ecef_cov_t to_non_gnss(const sbp_msg_pos_ecef_cov_gnss_t& msg){ + static sbp_msg_pos_ecef_cov_t to_non_gnss( + const sbp_msg_pos_ecef_cov_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_ecef_cov_gnss = msg; return sbp_msg.pos_ecef_cov; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_ecef_cov_gnss_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_ecef_cov_gnss_t &msg) { return sbp_msg_pos_ecef_cov_gnss_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_ecef_cov_gnss_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_ecef_cov_gnss_t *msg) { return sbp_msg_pos_ecef_cov_gnss_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_pos_ecef_cov_gnss_t &msg) { @@ -4340,40 +4804,45 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgPosEcefCov; static constexpr const char *name = "MSG_POS_ECEF_COV"; - static const sbp_msg_pos_ecef_cov_t& get(const sbp_msg_t &msg) { + static const sbp_msg_pos_ecef_cov_t &get(const sbp_msg_t &msg) { return msg.pos_ecef_cov; } - static sbp_msg_pos_ecef_cov_t& get(sbp_msg_t &msg) { + static sbp_msg_pos_ecef_cov_t &get(sbp_msg_t &msg) { return msg.pos_ecef_cov; } - static void to_sbp_msg(const sbp_msg_pos_ecef_cov_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_pos_ecef_cov_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->pos_ecef_cov = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_pos_ecef_cov_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_pos_ecef_cov_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_ecef_cov = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_pos_ecef_cov_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_pos_ecef_cov_t &msg, sbp_write_fn_t write) { return sbp_msg_pos_ecef_cov_send(state, sender_id, &msg, write); } - static sbp_msg_pos_ecef_cov_gnss_t to_gnss(const sbp_msg_pos_ecef_cov_t& msg){ + static sbp_msg_pos_ecef_cov_gnss_t to_gnss( + const sbp_msg_pos_ecef_cov_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_ecef_cov = msg; return sbp_msg.pos_ecef_cov_gnss; } - static sbp_msg_pos_ecef_cov_t to_non_gnss(const sbp_msg_pos_ecef_cov_t& msg) { + static sbp_msg_pos_ecef_cov_t to_non_gnss(const sbp_msg_pos_ecef_cov_t &msg) { return msg; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_ecef_cov_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_ecef_cov_t &msg) { return sbp_msg_pos_ecef_cov_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_ecef_cov_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_ecef_cov_t *msg) { return sbp_msg_pos_ecef_cov_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_pos_ecef_cov_t &msg) { @@ -4381,31 +4850,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgPosEcefDepA; static constexpr const char *name = "MSG_POS_ECEF_DEP_A"; - static const sbp_msg_pos_ecef_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_pos_ecef_dep_a_t &get(const sbp_msg_t &msg) { return msg.pos_ecef_dep_a; } - static sbp_msg_pos_ecef_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_pos_ecef_dep_a_t &get(sbp_msg_t &msg) { return msg.pos_ecef_dep_a; } - static void to_sbp_msg(const sbp_msg_pos_ecef_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_pos_ecef_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->pos_ecef_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_pos_ecef_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_pos_ecef_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_ecef_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_pos_ecef_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_pos_ecef_dep_a_t &msg, sbp_write_fn_t write) { return sbp_msg_pos_ecef_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_ecef_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_ecef_dep_a_t &msg) { return sbp_msg_pos_ecef_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_ecef_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_ecef_dep_a_t *msg) { return sbp_msg_pos_ecef_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_pos_ecef_dep_a_t &msg) { @@ -4413,40 +4886,44 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgPosEcefGnss; static constexpr const char *name = "MSG_POS_ECEF_GNSS"; - static const sbp_msg_pos_ecef_gnss_t& get(const sbp_msg_t &msg) { + static const sbp_msg_pos_ecef_gnss_t &get(const sbp_msg_t &msg) { return msg.pos_ecef_gnss; } - static sbp_msg_pos_ecef_gnss_t& get(sbp_msg_t &msg) { + static sbp_msg_pos_ecef_gnss_t &get(sbp_msg_t &msg) { return msg.pos_ecef_gnss; } - static void to_sbp_msg(const sbp_msg_pos_ecef_gnss_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_pos_ecef_gnss_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->pos_ecef_gnss = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_pos_ecef_gnss_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_pos_ecef_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_ecef_gnss = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_pos_ecef_gnss_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_pos_ecef_gnss_t &msg, sbp_write_fn_t write) { return sbp_msg_pos_ecef_gnss_send(state, sender_id, &msg, write); } - static sbp_msg_pos_ecef_gnss_t to_gnss(const sbp_msg_pos_ecef_gnss_t& msg) { + static sbp_msg_pos_ecef_gnss_t to_gnss(const sbp_msg_pos_ecef_gnss_t &msg) { return msg; } - static sbp_msg_pos_ecef_t to_non_gnss(const sbp_msg_pos_ecef_gnss_t& msg){ + static sbp_msg_pos_ecef_t to_non_gnss(const sbp_msg_pos_ecef_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_ecef_gnss = msg; return sbp_msg.pos_ecef; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_ecef_gnss_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_ecef_gnss_t &msg) { return sbp_msg_pos_ecef_gnss_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_ecef_gnss_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_ecef_gnss_t *msg) { return sbp_msg_pos_ecef_gnss_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_pos_ecef_gnss_t &msg) { @@ -4454,40 +4931,41 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgPosEcef; static constexpr const char *name = "MSG_POS_ECEF"; - static const sbp_msg_pos_ecef_t& get(const sbp_msg_t &msg) { - return msg.pos_ecef; - } - static sbp_msg_pos_ecef_t& get(sbp_msg_t &msg) { + static const sbp_msg_pos_ecef_t &get(const sbp_msg_t &msg) { return msg.pos_ecef; } - static void to_sbp_msg(const sbp_msg_pos_ecef_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_pos_ecef_t &get(sbp_msg_t &msg) { return msg.pos_ecef; } + static void to_sbp_msg(const sbp_msg_pos_ecef_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->pos_ecef = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_pos_ecef_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_pos_ecef_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_ecef = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_pos_ecef_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_pos_ecef_t &msg, sbp_write_fn_t write) { return sbp_msg_pos_ecef_send(state, sender_id, &msg, write); } - static sbp_msg_pos_ecef_gnss_t to_gnss(const sbp_msg_pos_ecef_t& msg){ + static sbp_msg_pos_ecef_gnss_t to_gnss(const sbp_msg_pos_ecef_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_ecef = msg; return sbp_msg.pos_ecef_gnss; } - static sbp_msg_pos_ecef_t to_non_gnss(const sbp_msg_pos_ecef_t& msg) { + static sbp_msg_pos_ecef_t to_non_gnss(const sbp_msg_pos_ecef_t &msg) { return msg; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_ecef_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_ecef_t &msg) { return sbp_msg_pos_ecef_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_ecef_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_ecef_t *msg) { return sbp_msg_pos_ecef_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_pos_ecef_t &msg) { @@ -4495,31 +4973,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgPosLlhAcc; static constexpr const char *name = "MSG_POS_LLH_ACC"; - static const sbp_msg_pos_llh_acc_t& get(const sbp_msg_t &msg) { - return msg.pos_llh_acc; - } - static sbp_msg_pos_llh_acc_t& get(sbp_msg_t &msg) { + static const sbp_msg_pos_llh_acc_t &get(const sbp_msg_t &msg) { return msg.pos_llh_acc; } - static void to_sbp_msg(const sbp_msg_pos_llh_acc_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_pos_llh_acc_t &get(sbp_msg_t &msg) { return msg.pos_llh_acc; } + static void to_sbp_msg(const sbp_msg_pos_llh_acc_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->pos_llh_acc = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_pos_llh_acc_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_pos_llh_acc_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_llh_acc = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_pos_llh_acc_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_pos_llh_acc_t &msg, sbp_write_fn_t write) { return sbp_msg_pos_llh_acc_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_acc_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_llh_acc_t &msg) { return sbp_msg_pos_llh_acc_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_acc_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_llh_acc_t *msg) { return sbp_msg_pos_llh_acc_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_pos_llh_acc_t &msg) { @@ -4527,40 +5006,46 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgPosLlhCovGnss; static constexpr const char *name = "MSG_POS_LLH_COV_GNSS"; - static const sbp_msg_pos_llh_cov_gnss_t& get(const sbp_msg_t &msg) { + static const sbp_msg_pos_llh_cov_gnss_t &get(const sbp_msg_t &msg) { return msg.pos_llh_cov_gnss; } - static sbp_msg_pos_llh_cov_gnss_t& get(sbp_msg_t &msg) { + static sbp_msg_pos_llh_cov_gnss_t &get(sbp_msg_t &msg) { return msg.pos_llh_cov_gnss; } - static void to_sbp_msg(const sbp_msg_pos_llh_cov_gnss_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_pos_llh_cov_gnss_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->pos_llh_cov_gnss = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_pos_llh_cov_gnss_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_pos_llh_cov_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_llh_cov_gnss = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_pos_llh_cov_gnss_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_pos_llh_cov_gnss_t &msg, sbp_write_fn_t write) { return sbp_msg_pos_llh_cov_gnss_send(state, sender_id, &msg, write); } - static sbp_msg_pos_llh_cov_gnss_t to_gnss(const sbp_msg_pos_llh_cov_gnss_t& msg) { + static sbp_msg_pos_llh_cov_gnss_t to_gnss( + const sbp_msg_pos_llh_cov_gnss_t &msg) { return msg; } - static sbp_msg_pos_llh_cov_t to_non_gnss(const sbp_msg_pos_llh_cov_gnss_t& msg){ + static sbp_msg_pos_llh_cov_t to_non_gnss( + const sbp_msg_pos_llh_cov_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_llh_cov_gnss = msg; return sbp_msg.pos_llh_cov; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_cov_gnss_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_llh_cov_gnss_t &msg) { return sbp_msg_pos_llh_cov_gnss_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_cov_gnss_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_llh_cov_gnss_t *msg) { return sbp_msg_pos_llh_cov_gnss_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_pos_llh_cov_gnss_t &msg) { @@ -4568,40 +5053,41 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgPosLlhCov; static constexpr const char *name = "MSG_POS_LLH_COV"; - static const sbp_msg_pos_llh_cov_t& get(const sbp_msg_t &msg) { + static const sbp_msg_pos_llh_cov_t &get(const sbp_msg_t &msg) { return msg.pos_llh_cov; } - static sbp_msg_pos_llh_cov_t& get(sbp_msg_t &msg) { - return msg.pos_llh_cov; - } - static void to_sbp_msg(const sbp_msg_pos_llh_cov_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_pos_llh_cov_t &get(sbp_msg_t &msg) { return msg.pos_llh_cov; } + static void to_sbp_msg(const sbp_msg_pos_llh_cov_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->pos_llh_cov = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_pos_llh_cov_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_pos_llh_cov_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_llh_cov = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_pos_llh_cov_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_pos_llh_cov_t &msg, sbp_write_fn_t write) { return sbp_msg_pos_llh_cov_send(state, sender_id, &msg, write); } - static sbp_msg_pos_llh_cov_gnss_t to_gnss(const sbp_msg_pos_llh_cov_t& msg){ + static sbp_msg_pos_llh_cov_gnss_t to_gnss(const sbp_msg_pos_llh_cov_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_llh_cov = msg; return sbp_msg.pos_llh_cov_gnss; } - static sbp_msg_pos_llh_cov_t to_non_gnss(const sbp_msg_pos_llh_cov_t& msg) { + static sbp_msg_pos_llh_cov_t to_non_gnss(const sbp_msg_pos_llh_cov_t &msg) { return msg; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_cov_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_llh_cov_t &msg) { return sbp_msg_pos_llh_cov_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_cov_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_llh_cov_t *msg) { return sbp_msg_pos_llh_cov_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_pos_llh_cov_t &msg) { @@ -4609,31 +5095,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgPosLlhDepA; static constexpr const char *name = "MSG_POS_LLH_DEP_A"; - static const sbp_msg_pos_llh_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_pos_llh_dep_a_t &get(const sbp_msg_t &msg) { return msg.pos_llh_dep_a; } - static sbp_msg_pos_llh_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_pos_llh_dep_a_t &get(sbp_msg_t &msg) { return msg.pos_llh_dep_a; } - static void to_sbp_msg(const sbp_msg_pos_llh_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_pos_llh_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->pos_llh_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_pos_llh_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_pos_llh_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_llh_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_pos_llh_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_pos_llh_dep_a_t &msg, sbp_write_fn_t write) { return sbp_msg_pos_llh_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_llh_dep_a_t &msg) { return sbp_msg_pos_llh_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_llh_dep_a_t *msg) { return sbp_msg_pos_llh_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_pos_llh_dep_a_t &msg) { @@ -4641,40 +5131,44 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgPosLlhGnss; static constexpr const char *name = "MSG_POS_LLH_GNSS"; - static const sbp_msg_pos_llh_gnss_t& get(const sbp_msg_t &msg) { + static const sbp_msg_pos_llh_gnss_t &get(const sbp_msg_t &msg) { return msg.pos_llh_gnss; } - static sbp_msg_pos_llh_gnss_t& get(sbp_msg_t &msg) { + static sbp_msg_pos_llh_gnss_t &get(sbp_msg_t &msg) { return msg.pos_llh_gnss; } - static void to_sbp_msg(const sbp_msg_pos_llh_gnss_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_pos_llh_gnss_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->pos_llh_gnss = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_pos_llh_gnss_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_pos_llh_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_llh_gnss = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_pos_llh_gnss_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_pos_llh_gnss_t &msg, sbp_write_fn_t write) { return sbp_msg_pos_llh_gnss_send(state, sender_id, &msg, write); } - static sbp_msg_pos_llh_gnss_t to_gnss(const sbp_msg_pos_llh_gnss_t& msg) { + static sbp_msg_pos_llh_gnss_t to_gnss(const sbp_msg_pos_llh_gnss_t &msg) { return msg; } - static sbp_msg_pos_llh_t to_non_gnss(const sbp_msg_pos_llh_gnss_t& msg){ + static sbp_msg_pos_llh_t to_non_gnss(const sbp_msg_pos_llh_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_llh_gnss = msg; return sbp_msg.pos_llh; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_gnss_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_llh_gnss_t &msg) { return sbp_msg_pos_llh_gnss_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_gnss_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_llh_gnss_t *msg) { return sbp_msg_pos_llh_gnss_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_pos_llh_gnss_t &msg) { @@ -4682,40 +5176,41 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgPosLlh; static constexpr const char *name = "MSG_POS_LLH"; - static const sbp_msg_pos_llh_t& get(const sbp_msg_t &msg) { - return msg.pos_llh; - } - static sbp_msg_pos_llh_t& get(sbp_msg_t &msg) { + static const sbp_msg_pos_llh_t &get(const sbp_msg_t &msg) { return msg.pos_llh; } - static void to_sbp_msg(const sbp_msg_pos_llh_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_pos_llh_t &get(sbp_msg_t &msg) { return msg.pos_llh; } + static void to_sbp_msg(const sbp_msg_pos_llh_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->pos_llh = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_pos_llh_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_pos_llh_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_llh = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_pos_llh_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_pos_llh_t &msg, sbp_write_fn_t write) { return sbp_msg_pos_llh_send(state, sender_id, &msg, write); } - static sbp_msg_pos_llh_gnss_t to_gnss(const sbp_msg_pos_llh_t& msg){ + static sbp_msg_pos_llh_gnss_t to_gnss(const sbp_msg_pos_llh_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pos_llh = msg; return sbp_msg.pos_llh_gnss; } - static sbp_msg_pos_llh_t to_non_gnss(const sbp_msg_pos_llh_t& msg) { + static sbp_msg_pos_llh_t to_non_gnss(const sbp_msg_pos_llh_t &msg) { return msg; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_llh_t &msg) { return sbp_msg_pos_llh_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_llh_t *msg) { return sbp_msg_pos_llh_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_pos_llh_t &msg) { @@ -4723,31 +5218,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgPoseRelative; static constexpr const char *name = "MSG_POSE_RELATIVE"; - static const sbp_msg_pose_relative_t& get(const sbp_msg_t &msg) { + static const sbp_msg_pose_relative_t &get(const sbp_msg_t &msg) { return msg.pose_relative; } - static sbp_msg_pose_relative_t& get(sbp_msg_t &msg) { + static sbp_msg_pose_relative_t &get(sbp_msg_t &msg) { return msg.pose_relative; } - static void to_sbp_msg(const sbp_msg_pose_relative_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_pose_relative_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->pose_relative = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_pose_relative_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_pose_relative_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pose_relative = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_pose_relative_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_pose_relative_t &msg, sbp_write_fn_t write) { return sbp_msg_pose_relative_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pose_relative_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pose_relative_t &msg) { return sbp_msg_pose_relative_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pose_relative_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pose_relative_t *msg) { return sbp_msg_pose_relative_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_pose_relative_t &msg) { @@ -4755,31 +5254,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgPpsTime; static constexpr const char *name = "MSG_PPS_TIME"; - static const sbp_msg_pps_time_t& get(const sbp_msg_t &msg) { - return msg.pps_time; - } - static sbp_msg_pps_time_t& get(sbp_msg_t &msg) { + static const sbp_msg_pps_time_t &get(const sbp_msg_t &msg) { return msg.pps_time; } - static void to_sbp_msg(const sbp_msg_pps_time_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_pps_time_t &get(sbp_msg_t &msg) { return msg.pps_time; } + static void to_sbp_msg(const sbp_msg_pps_time_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->pps_time = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_pps_time_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_pps_time_t &msg) { sbp_msg_t sbp_msg; sbp_msg.pps_time = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_pps_time_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_pps_time_t &msg, sbp_write_fn_t write) { return sbp_msg_pps_time_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pps_time_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pps_time_t &msg) { return sbp_msg_pps_time_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pps_time_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pps_time_t *msg) { return sbp_msg_pps_time_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_pps_time_t &msg) { @@ -4787,31 +5287,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgPrintDep; static constexpr const char *name = "MSG_PRINT_DEP"; - static const sbp_msg_print_dep_t& get(const sbp_msg_t &msg) { - return msg.print_dep; - } - static sbp_msg_print_dep_t& get(sbp_msg_t &msg) { + static const sbp_msg_print_dep_t &get(const sbp_msg_t &msg) { return msg.print_dep; } - static void to_sbp_msg(const sbp_msg_print_dep_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_print_dep_t &get(sbp_msg_t &msg) { return msg.print_dep; } + static void to_sbp_msg(const sbp_msg_print_dep_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->print_dep = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_print_dep_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_print_dep_t &msg) { sbp_msg_t sbp_msg; sbp_msg.print_dep = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_print_dep_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_print_dep_t &msg, sbp_write_fn_t write) { return sbp_msg_print_dep_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_print_dep_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_print_dep_t &msg) { return sbp_msg_print_dep_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_print_dep_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_print_dep_t *msg) { return sbp_msg_print_dep_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_print_dep_t &msg) { @@ -4819,31 +5320,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgProtectionLevelDepA; static constexpr const char *name = "MSG_PROTECTION_LEVEL_DEP_A"; - static const sbp_msg_protection_level_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_protection_level_dep_a_t &get(const sbp_msg_t &msg) { return msg.protection_level_dep_a; } - static sbp_msg_protection_level_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_protection_level_dep_a_t &get(sbp_msg_t &msg) { return msg.protection_level_dep_a; } - static void to_sbp_msg(const sbp_msg_protection_level_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_protection_level_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->protection_level_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_protection_level_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_protection_level_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.protection_level_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_protection_level_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_protection_level_dep_a_t &msg, + sbp_write_fn_t write) { return sbp_msg_protection_level_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_protection_level_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_protection_level_dep_a_t &msg) { return sbp_msg_protection_level_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_protection_level_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_protection_level_dep_a_t *msg) { return sbp_msg_protection_level_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_protection_level_dep_a_t &msg) { @@ -4851,31 +5357,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgProtectionLevel; static constexpr const char *name = "MSG_PROTECTION_LEVEL"; - static const sbp_msg_protection_level_t& get(const sbp_msg_t &msg) { + static const sbp_msg_protection_level_t &get(const sbp_msg_t &msg) { return msg.protection_level; } - static sbp_msg_protection_level_t& get(sbp_msg_t &msg) { + static sbp_msg_protection_level_t &get(sbp_msg_t &msg) { return msg.protection_level; } - static void to_sbp_msg(const sbp_msg_protection_level_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_protection_level_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->protection_level = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_protection_level_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_protection_level_t &msg) { sbp_msg_t sbp_msg; sbp_msg.protection_level = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_protection_level_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_protection_level_t &msg, sbp_write_fn_t write) { return sbp_msg_protection_level_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_protection_level_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_protection_level_t &msg) { return sbp_msg_protection_level_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_protection_level_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_protection_level_t *msg) { return sbp_msg_protection_level_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_protection_level_t &msg) { @@ -4883,31 +5393,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgReferenceFrameParam; static constexpr const char *name = "MSG_REFERENCE_FRAME_PARAM"; - static const sbp_msg_reference_frame_param_t& get(const sbp_msg_t &msg) { + static const sbp_msg_reference_frame_param_t &get(const sbp_msg_t &msg) { return msg.reference_frame_param; } - static sbp_msg_reference_frame_param_t& get(sbp_msg_t &msg) { + static sbp_msg_reference_frame_param_t &get(sbp_msg_t &msg) { return msg.reference_frame_param; } - static void to_sbp_msg(const sbp_msg_reference_frame_param_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_reference_frame_param_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->reference_frame_param = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_reference_frame_param_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_reference_frame_param_t &msg) { sbp_msg_t sbp_msg; sbp_msg.reference_frame_param = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_reference_frame_param_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_reference_frame_param_t &msg, + sbp_write_fn_t write) { return sbp_msg_reference_frame_param_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_reference_frame_param_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_reference_frame_param_t &msg) { return sbp_msg_reference_frame_param_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_reference_frame_param_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_reference_frame_param_t *msg) { return sbp_msg_reference_frame_param_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_reference_frame_param_t &msg) { @@ -4915,31 +5430,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgResetDep; static constexpr const char *name = "MSG_RESET_DEP"; - static const sbp_msg_reset_dep_t& get(const sbp_msg_t &msg) { - return msg.reset_dep; - } - static sbp_msg_reset_dep_t& get(sbp_msg_t &msg) { + static const sbp_msg_reset_dep_t &get(const sbp_msg_t &msg) { return msg.reset_dep; } - static void to_sbp_msg(const sbp_msg_reset_dep_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_reset_dep_t &get(sbp_msg_t &msg) { return msg.reset_dep; } + static void to_sbp_msg(const sbp_msg_reset_dep_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->reset_dep = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_reset_dep_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_reset_dep_t &msg) { sbp_msg_t sbp_msg; sbp_msg.reset_dep = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_reset_dep_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_reset_dep_t &msg, sbp_write_fn_t write) { return sbp_msg_reset_dep_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_reset_dep_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_reset_dep_t &msg) { return sbp_msg_reset_dep_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_reset_dep_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_reset_dep_t *msg) { return sbp_msg_reset_dep_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_reset_dep_t &msg) { @@ -4947,31 +5463,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgResetFilters; static constexpr const char *name = "MSG_RESET_FILTERS"; - static const sbp_msg_reset_filters_t& get(const sbp_msg_t &msg) { + static const sbp_msg_reset_filters_t &get(const sbp_msg_t &msg) { return msg.reset_filters; } - static sbp_msg_reset_filters_t& get(sbp_msg_t &msg) { + static sbp_msg_reset_filters_t &get(sbp_msg_t &msg) { return msg.reset_filters; } - static void to_sbp_msg(const sbp_msg_reset_filters_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_reset_filters_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->reset_filters = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_reset_filters_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_reset_filters_t &msg) { sbp_msg_t sbp_msg; sbp_msg.reset_filters = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_reset_filters_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_reset_filters_t &msg, sbp_write_fn_t write) { return sbp_msg_reset_filters_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_reset_filters_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_reset_filters_t &msg) { return sbp_msg_reset_filters_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_reset_filters_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_reset_filters_t *msg) { return sbp_msg_reset_filters_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_reset_filters_t &msg) { @@ -4979,31 +5499,30 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgReset; static constexpr const char *name = "MSG_RESET"; - static const sbp_msg_reset_t& get(const sbp_msg_t &msg) { - return msg.reset; - } - static sbp_msg_reset_t& get(sbp_msg_t &msg) { - return msg.reset; - } - static void to_sbp_msg(const sbp_msg_reset_t& msg, sbp_msg_t *sbp_msg) { + static const sbp_msg_reset_t &get(const sbp_msg_t &msg) { return msg.reset; } + static sbp_msg_reset_t &get(sbp_msg_t &msg) { return msg.reset; } + static void to_sbp_msg(const sbp_msg_reset_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->reset = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_reset_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_reset_t &msg) { sbp_msg_t sbp_msg; sbp_msg.reset = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_reset_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_reset_t &msg, + sbp_write_fn_t write) { return sbp_msg_reset_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_reset_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_reset_t &msg) { return sbp_msg_reset_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_reset_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_reset_t *msg) { return sbp_msg_reset_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_reset_t &msg) { @@ -5011,31 +5530,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSbasRaw; static constexpr const char *name = "MSG_SBAS_RAW"; - static const sbp_msg_sbas_raw_t& get(const sbp_msg_t &msg) { - return msg.sbas_raw; - } - static sbp_msg_sbas_raw_t& get(sbp_msg_t &msg) { + static const sbp_msg_sbas_raw_t &get(const sbp_msg_t &msg) { return msg.sbas_raw; } - static void to_sbp_msg(const sbp_msg_sbas_raw_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_sbas_raw_t &get(sbp_msg_t &msg) { return msg.sbas_raw; } + static void to_sbp_msg(const sbp_msg_sbas_raw_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->sbas_raw = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_sbas_raw_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_sbas_raw_t &msg) { sbp_msg_t sbp_msg; sbp_msg.sbas_raw = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_sbas_raw_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_sbas_raw_t &msg, sbp_write_fn_t write) { return sbp_msg_sbas_raw_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_sbas_raw_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_sbas_raw_t &msg) { return sbp_msg_sbas_raw_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_sbas_raw_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_sbas_raw_t *msg) { return sbp_msg_sbas_raw_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_sbas_raw_t &msg) { @@ -5043,31 +5563,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSensorAidEvent; static constexpr const char *name = "MSG_SENSOR_AID_EVENT"; - static const sbp_msg_sensor_aid_event_t& get(const sbp_msg_t &msg) { + static const sbp_msg_sensor_aid_event_t &get(const sbp_msg_t &msg) { return msg.sensor_aid_event; } - static sbp_msg_sensor_aid_event_t& get(sbp_msg_t &msg) { + static sbp_msg_sensor_aid_event_t &get(sbp_msg_t &msg) { return msg.sensor_aid_event; } - static void to_sbp_msg(const sbp_msg_sensor_aid_event_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_sensor_aid_event_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->sensor_aid_event = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_sensor_aid_event_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_sensor_aid_event_t &msg) { sbp_msg_t sbp_msg; sbp_msg.sensor_aid_event = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_sensor_aid_event_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_sensor_aid_event_t &msg, sbp_write_fn_t write) { return sbp_msg_sensor_aid_event_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_sensor_aid_event_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_sensor_aid_event_t &msg) { return sbp_msg_sensor_aid_event_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_sensor_aid_event_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_sensor_aid_event_t *msg) { return sbp_msg_sensor_aid_event_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_sensor_aid_event_t &msg) { @@ -5075,31 +5599,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSetTime; static constexpr const char *name = "MSG_SET_TIME"; - static const sbp_msg_set_time_t& get(const sbp_msg_t &msg) { - return msg.set_time; - } - static sbp_msg_set_time_t& get(sbp_msg_t &msg) { + static const sbp_msg_set_time_t &get(const sbp_msg_t &msg) { return msg.set_time; } - static void to_sbp_msg(const sbp_msg_set_time_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_set_time_t &get(sbp_msg_t &msg) { return msg.set_time; } + static void to_sbp_msg(const sbp_msg_set_time_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->set_time = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_set_time_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_set_time_t &msg) { sbp_msg_t sbp_msg; sbp_msg.set_time = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_set_time_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_set_time_t &msg, sbp_write_fn_t write) { return sbp_msg_set_time_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_set_time_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_set_time_t &msg) { return sbp_msg_set_time_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_set_time_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_set_time_t *msg) { return sbp_msg_set_time_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_set_time_t &msg) { @@ -5107,31 +5632,40 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSettingsReadByIndexDone; static constexpr const char *name = "MSG_SETTINGS_READ_BY_INDEX_DONE"; - static const sbp_msg_settings_read_by_index_done_t& get(const sbp_msg_t &msg) { + static const sbp_msg_settings_read_by_index_done_t &get( + const sbp_msg_t &msg) { return msg.settings_read_by_index_done; } - static sbp_msg_settings_read_by_index_done_t& get(sbp_msg_t &msg) { + static sbp_msg_settings_read_by_index_done_t &get(sbp_msg_t &msg) { return msg.settings_read_by_index_done; } - static void to_sbp_msg(const sbp_msg_settings_read_by_index_done_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_settings_read_by_index_done_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->settings_read_by_index_done = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_settings_read_by_index_done_t& msg) { + static sbp_msg_t to_sbp_msg( + const sbp_msg_settings_read_by_index_done_t &msg) { sbp_msg_t sbp_msg; sbp_msg.settings_read_by_index_done = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_settings_read_by_index_done_t &msg, sbp_write_fn_t write) { - return sbp_msg_settings_read_by_index_done_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_settings_read_by_index_done_t &msg, + sbp_write_fn_t write) { + return sbp_msg_settings_read_by_index_done_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_by_index_done_t &msg){ - return sbp_msg_settings_read_by_index_done_encode(buf, len, n_written, &msg); + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_read_by_index_done_t &msg) { + return sbp_msg_settings_read_by_index_done_encode(buf, len, n_written, + &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_by_index_done_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_read_by_index_done_t *msg) { return sbp_msg_settings_read_by_index_done_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_settings_read_by_index_done_t &msg) { @@ -5139,31 +5673,37 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSettingsReadByIndexReq; static constexpr const char *name = "MSG_SETTINGS_READ_BY_INDEX_REQ"; - static const sbp_msg_settings_read_by_index_req_t& get(const sbp_msg_t &msg) { + static const sbp_msg_settings_read_by_index_req_t &get(const sbp_msg_t &msg) { return msg.settings_read_by_index_req; } - static sbp_msg_settings_read_by_index_req_t& get(sbp_msg_t &msg) { + static sbp_msg_settings_read_by_index_req_t &get(sbp_msg_t &msg) { return msg.settings_read_by_index_req; } - static void to_sbp_msg(const sbp_msg_settings_read_by_index_req_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_settings_read_by_index_req_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->settings_read_by_index_req = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_settings_read_by_index_req_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_settings_read_by_index_req_t &msg) { sbp_msg_t sbp_msg; sbp_msg.settings_read_by_index_req = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_settings_read_by_index_req_t &msg, sbp_write_fn_t write) { - return sbp_msg_settings_read_by_index_req_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_settings_read_by_index_req_t &msg, + sbp_write_fn_t write) { + return sbp_msg_settings_read_by_index_req_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_by_index_req_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_read_by_index_req_t &msg) { return sbp_msg_settings_read_by_index_req_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_by_index_req_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_read_by_index_req_t *msg) { return sbp_msg_settings_read_by_index_req_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_settings_read_by_index_req_t &msg) { @@ -5171,31 +5711,40 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSettingsReadByIndexResp; static constexpr const char *name = "MSG_SETTINGS_READ_BY_INDEX_RESP"; - static const sbp_msg_settings_read_by_index_resp_t& get(const sbp_msg_t &msg) { + static const sbp_msg_settings_read_by_index_resp_t &get( + const sbp_msg_t &msg) { return msg.settings_read_by_index_resp; } - static sbp_msg_settings_read_by_index_resp_t& get(sbp_msg_t &msg) { + static sbp_msg_settings_read_by_index_resp_t &get(sbp_msg_t &msg) { return msg.settings_read_by_index_resp; } - static void to_sbp_msg(const sbp_msg_settings_read_by_index_resp_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_settings_read_by_index_resp_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->settings_read_by_index_resp = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_settings_read_by_index_resp_t& msg) { + static sbp_msg_t to_sbp_msg( + const sbp_msg_settings_read_by_index_resp_t &msg) { sbp_msg_t sbp_msg; sbp_msg.settings_read_by_index_resp = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_settings_read_by_index_resp_t &msg, sbp_write_fn_t write) { - return sbp_msg_settings_read_by_index_resp_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_settings_read_by_index_resp_t &msg, + sbp_write_fn_t write) { + return sbp_msg_settings_read_by_index_resp_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_by_index_resp_t &msg){ - return sbp_msg_settings_read_by_index_resp_encode(buf, len, n_written, &msg); + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_read_by_index_resp_t &msg) { + return sbp_msg_settings_read_by_index_resp_encode(buf, len, n_written, + &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_by_index_resp_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_read_by_index_resp_t *msg) { return sbp_msg_settings_read_by_index_resp_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_settings_read_by_index_resp_t &msg) { @@ -5203,31 +5752,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSettingsReadReq; static constexpr const char *name = "MSG_SETTINGS_READ_REQ"; - static const sbp_msg_settings_read_req_t& get(const sbp_msg_t &msg) { + static const sbp_msg_settings_read_req_t &get(const sbp_msg_t &msg) { return msg.settings_read_req; } - static sbp_msg_settings_read_req_t& get(sbp_msg_t &msg) { + static sbp_msg_settings_read_req_t &get(sbp_msg_t &msg) { return msg.settings_read_req; } - static void to_sbp_msg(const sbp_msg_settings_read_req_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_settings_read_req_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->settings_read_req = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_settings_read_req_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_settings_read_req_t &msg) { sbp_msg_t sbp_msg; sbp_msg.settings_read_req = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_settings_read_req_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_settings_read_req_t &msg, sbp_write_fn_t write) { return sbp_msg_settings_read_req_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_req_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_read_req_t &msg) { return sbp_msg_settings_read_req_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_req_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_read_req_t *msg) { return sbp_msg_settings_read_req_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_settings_read_req_t &msg) { @@ -5235,31 +5788,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSettingsReadResp; static constexpr const char *name = "MSG_SETTINGS_READ_RESP"; - static const sbp_msg_settings_read_resp_t& get(const sbp_msg_t &msg) { + static const sbp_msg_settings_read_resp_t &get(const sbp_msg_t &msg) { return msg.settings_read_resp; } - static sbp_msg_settings_read_resp_t& get(sbp_msg_t &msg) { + static sbp_msg_settings_read_resp_t &get(sbp_msg_t &msg) { return msg.settings_read_resp; } - static void to_sbp_msg(const sbp_msg_settings_read_resp_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_settings_read_resp_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->settings_read_resp = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_settings_read_resp_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_settings_read_resp_t &msg) { sbp_msg_t sbp_msg; sbp_msg.settings_read_resp = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_settings_read_resp_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_settings_read_resp_t &msg, + sbp_write_fn_t write) { return sbp_msg_settings_read_resp_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_resp_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_read_resp_t &msg) { return sbp_msg_settings_read_resp_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_resp_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_read_resp_t *msg) { return sbp_msg_settings_read_resp_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_settings_read_resp_t &msg) { @@ -5267,31 +5825,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSettingsRegisterResp; static constexpr const char *name = "MSG_SETTINGS_REGISTER_RESP"; - static const sbp_msg_settings_register_resp_t& get(const sbp_msg_t &msg) { + static const sbp_msg_settings_register_resp_t &get(const sbp_msg_t &msg) { return msg.settings_register_resp; } - static sbp_msg_settings_register_resp_t& get(sbp_msg_t &msg) { + static sbp_msg_settings_register_resp_t &get(sbp_msg_t &msg) { return msg.settings_register_resp; } - static void to_sbp_msg(const sbp_msg_settings_register_resp_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_settings_register_resp_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->settings_register_resp = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_settings_register_resp_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_settings_register_resp_t &msg) { sbp_msg_t sbp_msg; sbp_msg.settings_register_resp = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_settings_register_resp_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_settings_register_resp_t &msg, + sbp_write_fn_t write) { return sbp_msg_settings_register_resp_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_register_resp_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_register_resp_t &msg) { return sbp_msg_settings_register_resp_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_register_resp_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_register_resp_t *msg) { return sbp_msg_settings_register_resp_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_settings_register_resp_t &msg) { @@ -5299,31 +5862,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSettingsRegister; static constexpr const char *name = "MSG_SETTINGS_REGISTER"; - static const sbp_msg_settings_register_t& get(const sbp_msg_t &msg) { + static const sbp_msg_settings_register_t &get(const sbp_msg_t &msg) { return msg.settings_register; } - static sbp_msg_settings_register_t& get(sbp_msg_t &msg) { + static sbp_msg_settings_register_t &get(sbp_msg_t &msg) { return msg.settings_register; } - static void to_sbp_msg(const sbp_msg_settings_register_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_settings_register_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->settings_register = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_settings_register_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_settings_register_t &msg) { sbp_msg_t sbp_msg; sbp_msg.settings_register = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_settings_register_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_settings_register_t &msg, sbp_write_fn_t write) { return sbp_msg_settings_register_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_register_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_register_t &msg) { return sbp_msg_settings_register_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_register_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_register_t *msg) { return sbp_msg_settings_register_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_settings_register_t &msg) { @@ -5331,31 +5898,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSettingsSave; static constexpr const char *name = "MSG_SETTINGS_SAVE"; - static const sbp_msg_settings_save_t& get(const sbp_msg_t &msg) { + static const sbp_msg_settings_save_t &get(const sbp_msg_t &msg) { return msg.settings_save; } - static sbp_msg_settings_save_t& get(sbp_msg_t &msg) { + static sbp_msg_settings_save_t &get(sbp_msg_t &msg) { return msg.settings_save; } - static void to_sbp_msg(const sbp_msg_settings_save_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_settings_save_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->settings_save = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_settings_save_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_settings_save_t &msg) { sbp_msg_t sbp_msg; sbp_msg.settings_save = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_settings_save_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_settings_save_t &msg, sbp_write_fn_t write) { return sbp_msg_settings_save_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_save_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_save_t &msg) { return sbp_msg_settings_save_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_save_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_save_t *msg) { return sbp_msg_settings_save_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_settings_save_t &msg) { @@ -5363,31 +5934,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSettingsWriteResp; static constexpr const char *name = "MSG_SETTINGS_WRITE_RESP"; - static const sbp_msg_settings_write_resp_t& get(const sbp_msg_t &msg) { + static const sbp_msg_settings_write_resp_t &get(const sbp_msg_t &msg) { return msg.settings_write_resp; } - static sbp_msg_settings_write_resp_t& get(sbp_msg_t &msg) { + static sbp_msg_settings_write_resp_t &get(sbp_msg_t &msg) { return msg.settings_write_resp; } - static void to_sbp_msg(const sbp_msg_settings_write_resp_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_settings_write_resp_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->settings_write_resp = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_settings_write_resp_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_settings_write_resp_t &msg) { sbp_msg_t sbp_msg; sbp_msg.settings_write_resp = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_settings_write_resp_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_settings_write_resp_t &msg, + sbp_write_fn_t write) { return sbp_msg_settings_write_resp_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_write_resp_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_write_resp_t &msg) { return sbp_msg_settings_write_resp_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_write_resp_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_write_resp_t *msg) { return sbp_msg_settings_write_resp_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_settings_write_resp_t &msg) { @@ -5395,31 +5971,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSettingsWrite; static constexpr const char *name = "MSG_SETTINGS_WRITE"; - static const sbp_msg_settings_write_t& get(const sbp_msg_t &msg) { + static const sbp_msg_settings_write_t &get(const sbp_msg_t &msg) { return msg.settings_write; } - static sbp_msg_settings_write_t& get(sbp_msg_t &msg) { + static sbp_msg_settings_write_t &get(sbp_msg_t &msg) { return msg.settings_write; } - static void to_sbp_msg(const sbp_msg_settings_write_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_settings_write_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->settings_write = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_settings_write_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_settings_write_t &msg) { sbp_msg_t sbp_msg; sbp_msg.settings_write = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_settings_write_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_settings_write_t &msg, sbp_write_fn_t write) { return sbp_msg_settings_write_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_write_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_write_t &msg) { return sbp_msg_settings_write_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_write_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_write_t *msg) { return sbp_msg_settings_write_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_settings_write_t &msg) { @@ -5427,31 +6007,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSolnMetaDepA; static constexpr const char *name = "MSG_SOLN_META_DEP_A"; - static const sbp_msg_soln_meta_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_soln_meta_dep_a_t &get(const sbp_msg_t &msg) { return msg.soln_meta_dep_a; } - static sbp_msg_soln_meta_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_soln_meta_dep_a_t &get(sbp_msg_t &msg) { return msg.soln_meta_dep_a; } - static void to_sbp_msg(const sbp_msg_soln_meta_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_soln_meta_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->soln_meta_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_soln_meta_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_soln_meta_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.soln_meta_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_soln_meta_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_soln_meta_dep_a_t &msg, sbp_write_fn_t write) { return sbp_msg_soln_meta_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_soln_meta_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_soln_meta_dep_a_t &msg) { return sbp_msg_soln_meta_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_soln_meta_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_soln_meta_dep_a_t *msg) { return sbp_msg_soln_meta_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_soln_meta_dep_a_t &msg) { @@ -5459,31 +6043,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSolnMeta; static constexpr const char *name = "MSG_SOLN_META"; - static const sbp_msg_soln_meta_t& get(const sbp_msg_t &msg) { + static const sbp_msg_soln_meta_t &get(const sbp_msg_t &msg) { return msg.soln_meta; } - static sbp_msg_soln_meta_t& get(sbp_msg_t &msg) { - return msg.soln_meta; - } - static void to_sbp_msg(const sbp_msg_soln_meta_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_soln_meta_t &get(sbp_msg_t &msg) { return msg.soln_meta; } + static void to_sbp_msg(const sbp_msg_soln_meta_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->soln_meta = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_soln_meta_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_soln_meta_t &msg) { sbp_msg_t sbp_msg; sbp_msg.soln_meta = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_soln_meta_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_soln_meta_t &msg, sbp_write_fn_t write) { return sbp_msg_soln_meta_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_soln_meta_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_soln_meta_t &msg) { return sbp_msg_soln_meta_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_soln_meta_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_soln_meta_t *msg) { return sbp_msg_soln_meta_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_soln_meta_t &msg) { @@ -5491,31 +6076,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSpecanDep; static constexpr const char *name = "MSG_SPECAN_DEP"; - static const sbp_msg_specan_dep_t& get(const sbp_msg_t &msg) { - return msg.specan_dep; - } - static sbp_msg_specan_dep_t& get(sbp_msg_t &msg) { + static const sbp_msg_specan_dep_t &get(const sbp_msg_t &msg) { return msg.specan_dep; } - static void to_sbp_msg(const sbp_msg_specan_dep_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_specan_dep_t &get(sbp_msg_t &msg) { return msg.specan_dep; } + static void to_sbp_msg(const sbp_msg_specan_dep_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->specan_dep = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_specan_dep_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_specan_dep_t &msg) { sbp_msg_t sbp_msg; sbp_msg.specan_dep = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_specan_dep_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_specan_dep_t &msg, sbp_write_fn_t write) { return sbp_msg_specan_dep_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_specan_dep_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_specan_dep_t &msg) { return sbp_msg_specan_dep_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_specan_dep_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_specan_dep_t *msg) { return sbp_msg_specan_dep_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_specan_dep_t &msg) { @@ -5523,31 +6109,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSpecan; static constexpr const char *name = "MSG_SPECAN"; - static const sbp_msg_specan_t& get(const sbp_msg_t &msg) { - return msg.specan; - } - static sbp_msg_specan_t& get(sbp_msg_t &msg) { + static const sbp_msg_specan_t &get(const sbp_msg_t &msg) { return msg.specan; } - static void to_sbp_msg(const sbp_msg_specan_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_specan_t &get(sbp_msg_t &msg) { return msg.specan; } + static void to_sbp_msg(const sbp_msg_specan_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->specan = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_specan_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_specan_t &msg) { sbp_msg_t sbp_msg; sbp_msg.specan = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_specan_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_specan_t &msg, + sbp_write_fn_t write) { return sbp_msg_specan_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_specan_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_specan_t &msg) { return sbp_msg_specan_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_specan_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_specan_t *msg) { return sbp_msg_specan_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_specan_t &msg) { @@ -5555,31 +6142,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrCodeBiases; static constexpr const char *name = "MSG_SSR_CODE_BIASES"; - static const sbp_msg_ssr_code_biases_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_code_biases_t &get(const sbp_msg_t &msg) { return msg.ssr_code_biases; } - static sbp_msg_ssr_code_biases_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_code_biases_t &get(sbp_msg_t &msg) { return msg.ssr_code_biases; } - static void to_sbp_msg(const sbp_msg_ssr_code_biases_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_code_biases_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_code_biases = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_code_biases_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_code_biases_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_code_biases = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_code_biases_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_code_biases_t &msg, sbp_write_fn_t write) { return sbp_msg_ssr_code_biases_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_code_biases_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_code_biases_t &msg) { return sbp_msg_ssr_code_biases_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_code_biases_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_code_biases_t *msg) { return sbp_msg_ssr_code_biases_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_code_biases_t &msg) { @@ -5587,31 +6178,40 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrCodePhaseBiasesBounds; static constexpr const char *name = "MSG_SSR_CODE_PHASE_BIASES_BOUNDS"; - static const sbp_msg_ssr_code_phase_biases_bounds_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_code_phase_biases_bounds_t &get( + const sbp_msg_t &msg) { return msg.ssr_code_phase_biases_bounds; } - static sbp_msg_ssr_code_phase_biases_bounds_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_code_phase_biases_bounds_t &get(sbp_msg_t &msg) { return msg.ssr_code_phase_biases_bounds; } - static void to_sbp_msg(const sbp_msg_ssr_code_phase_biases_bounds_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_code_phase_biases_bounds_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_code_phase_biases_bounds = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_code_phase_biases_bounds_t& msg) { + static sbp_msg_t to_sbp_msg( + const sbp_msg_ssr_code_phase_biases_bounds_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_code_phase_biases_bounds = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_code_phase_biases_bounds_t &msg, sbp_write_fn_t write) { - return sbp_msg_ssr_code_phase_biases_bounds_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_code_phase_biases_bounds_t &msg, + sbp_write_fn_t write) { + return sbp_msg_ssr_code_phase_biases_bounds_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_code_phase_biases_bounds_t &msg){ - return sbp_msg_ssr_code_phase_biases_bounds_encode(buf, len, n_written, &msg); + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_code_phase_biases_bounds_t &msg) { + return sbp_msg_ssr_code_phase_biases_bounds_encode(buf, len, n_written, + &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_code_phase_biases_bounds_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_code_phase_biases_bounds_t *msg) { return sbp_msg_ssr_code_phase_biases_bounds_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_code_phase_biases_bounds_t &msg) { @@ -5619,31 +6219,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrFlagHighLevel; static constexpr const char *name = "MSG_SSR_FLAG_HIGH_LEVEL"; - static const sbp_msg_ssr_flag_high_level_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_flag_high_level_t &get(const sbp_msg_t &msg) { return msg.ssr_flag_high_level; } - static sbp_msg_ssr_flag_high_level_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_flag_high_level_t &get(sbp_msg_t &msg) { return msg.ssr_flag_high_level; } - static void to_sbp_msg(const sbp_msg_ssr_flag_high_level_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_flag_high_level_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_flag_high_level = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_flag_high_level_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_flag_high_level_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_flag_high_level = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_flag_high_level_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_flag_high_level_t &msg, + sbp_write_fn_t write) { return sbp_msg_ssr_flag_high_level_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_high_level_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_high_level_t &msg) { return sbp_msg_ssr_flag_high_level_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_high_level_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_high_level_t *msg) { return sbp_msg_ssr_flag_high_level_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_flag_high_level_t &msg) { @@ -5651,63 +6256,80 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrFlagIonoGridPointSatLos; static constexpr const char *name = "MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS"; - static const sbp_msg_ssr_flag_iono_grid_point_sat_los_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &get( + const sbp_msg_t &msg) { return msg.ssr_flag_iono_grid_point_sat_los; } - static sbp_msg_ssr_flag_iono_grid_point_sat_los_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_flag_iono_grid_point_sat_los_t &get(sbp_msg_t &msg) { return msg.ssr_flag_iono_grid_point_sat_los; } - static void to_sbp_msg(const sbp_msg_ssr_flag_iono_grid_point_sat_los_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_flag_iono_grid_point_sat_los = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_flag_iono_grid_point_sat_los_t& msg) { + static sbp_msg_t to_sbp_msg( + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_flag_iono_grid_point_sat_los = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &msg, sbp_write_fn_t write) { - return sbp_msg_ssr_flag_iono_grid_point_sat_los_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &msg, + sbp_write_fn_t write) { + return sbp_msg_ssr_flag_iono_grid_point_sat_los_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &msg){ - return sbp_msg_ssr_flag_iono_grid_point_sat_los_encode(buf, len, n_written, &msg); + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &msg) { + return sbp_msg_ssr_flag_iono_grid_point_sat_los_encode(buf, len, n_written, + &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg){ - return sbp_msg_ssr_flag_iono_grid_point_sat_los_decode(buf, len, n_read, msg); + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg) { + return sbp_msg_ssr_flag_iono_grid_point_sat_los_decode(buf, len, n_read, + msg); } - static size_t encoded_len(const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &msg) { + static size_t encoded_len( + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &msg) { return sbp_msg_ssr_flag_iono_grid_point_sat_los_encoded_len(&msg); } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrFlagIonoGridPoints; static constexpr const char *name = "MSG_SSR_FLAG_IONO_GRID_POINTS"; - static const sbp_msg_ssr_flag_iono_grid_points_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_flag_iono_grid_points_t &get(const sbp_msg_t &msg) { return msg.ssr_flag_iono_grid_points; } - static sbp_msg_ssr_flag_iono_grid_points_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_flag_iono_grid_points_t &get(sbp_msg_t &msg) { return msg.ssr_flag_iono_grid_points; } - static void to_sbp_msg(const sbp_msg_ssr_flag_iono_grid_points_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_flag_iono_grid_points_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_flag_iono_grid_points = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_flag_iono_grid_points_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_flag_iono_grid_points_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_flag_iono_grid_points = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_flag_iono_grid_points_t &msg, sbp_write_fn_t write) { - return sbp_msg_ssr_flag_iono_grid_points_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_flag_iono_grid_points_t &msg, + sbp_write_fn_t write) { + return sbp_msg_ssr_flag_iono_grid_points_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_iono_grid_points_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_iono_grid_points_t &msg) { return sbp_msg_ssr_flag_iono_grid_points_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_iono_grid_points_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_iono_grid_points_t *msg) { return sbp_msg_ssr_flag_iono_grid_points_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_flag_iono_grid_points_t &msg) { @@ -5715,31 +6337,37 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrFlagIonoTileSatLos; static constexpr const char *name = "MSG_SSR_FLAG_IONO_TILE_SAT_LOS"; - static const sbp_msg_ssr_flag_iono_tile_sat_los_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_flag_iono_tile_sat_los_t &get(const sbp_msg_t &msg) { return msg.ssr_flag_iono_tile_sat_los; } - static sbp_msg_ssr_flag_iono_tile_sat_los_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_flag_iono_tile_sat_los_t &get(sbp_msg_t &msg) { return msg.ssr_flag_iono_tile_sat_los; } - static void to_sbp_msg(const sbp_msg_ssr_flag_iono_tile_sat_los_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_flag_iono_tile_sat_los_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_flag_iono_tile_sat_los = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_flag_iono_tile_sat_los_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_flag_iono_tile_sat_los_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_flag_iono_tile_sat_los = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_flag_iono_tile_sat_los_t &msg, sbp_write_fn_t write) { - return sbp_msg_ssr_flag_iono_tile_sat_los_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_flag_iono_tile_sat_los_t &msg, + sbp_write_fn_t write) { + return sbp_msg_ssr_flag_iono_tile_sat_los_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_iono_tile_sat_los_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_iono_tile_sat_los_t &msg) { return sbp_msg_ssr_flag_iono_tile_sat_los_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_iono_tile_sat_los_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_iono_tile_sat_los_t *msg) { return sbp_msg_ssr_flag_iono_tile_sat_los_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_flag_iono_tile_sat_los_t &msg) { @@ -5747,31 +6375,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrFlagSatellites; static constexpr const char *name = "MSG_SSR_FLAG_SATELLITES"; - static const sbp_msg_ssr_flag_satellites_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_flag_satellites_t &get(const sbp_msg_t &msg) { return msg.ssr_flag_satellites; } - static sbp_msg_ssr_flag_satellites_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_flag_satellites_t &get(sbp_msg_t &msg) { return msg.ssr_flag_satellites; } - static void to_sbp_msg(const sbp_msg_ssr_flag_satellites_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_flag_satellites_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_flag_satellites = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_flag_satellites_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_flag_satellites_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_flag_satellites = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_flag_satellites_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_flag_satellites_t &msg, + sbp_write_fn_t write) { return sbp_msg_ssr_flag_satellites_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_satellites_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_satellites_t &msg) { return sbp_msg_ssr_flag_satellites_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_satellites_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_satellites_t *msg) { return sbp_msg_ssr_flag_satellites_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_flag_satellites_t &msg) { @@ -5779,31 +6412,37 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrFlagTropoGridPoints; static constexpr const char *name = "MSG_SSR_FLAG_TROPO_GRID_POINTS"; - static const sbp_msg_ssr_flag_tropo_grid_points_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_flag_tropo_grid_points_t &get(const sbp_msg_t &msg) { return msg.ssr_flag_tropo_grid_points; } - static sbp_msg_ssr_flag_tropo_grid_points_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_flag_tropo_grid_points_t &get(sbp_msg_t &msg) { return msg.ssr_flag_tropo_grid_points; } - static void to_sbp_msg(const sbp_msg_ssr_flag_tropo_grid_points_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_flag_tropo_grid_points_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_flag_tropo_grid_points = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_flag_tropo_grid_points_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_flag_tropo_grid_points_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_flag_tropo_grid_points = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_flag_tropo_grid_points_t &msg, sbp_write_fn_t write) { - return sbp_msg_ssr_flag_tropo_grid_points_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_flag_tropo_grid_points_t &msg, + sbp_write_fn_t write) { + return sbp_msg_ssr_flag_tropo_grid_points_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_tropo_grid_points_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_tropo_grid_points_t &msg) { return sbp_msg_ssr_flag_tropo_grid_points_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_tropo_grid_points_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_tropo_grid_points_t *msg) { return sbp_msg_ssr_flag_tropo_grid_points_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_flag_tropo_grid_points_t &msg) { @@ -5811,31 +6450,37 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrGridDefinitionDepA; static constexpr const char *name = "MSG_SSR_GRID_DEFINITION_DEP_A"; - static const sbp_msg_ssr_grid_definition_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_grid_definition_dep_a_t &get(const sbp_msg_t &msg) { return msg.ssr_grid_definition_dep_a; } - static sbp_msg_ssr_grid_definition_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_grid_definition_dep_a_t &get(sbp_msg_t &msg) { return msg.ssr_grid_definition_dep_a; } - static void to_sbp_msg(const sbp_msg_ssr_grid_definition_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_grid_definition_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_grid_definition_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_grid_definition_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_grid_definition_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_grid_definition_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_grid_definition_dep_a_t &msg, sbp_write_fn_t write) { - return sbp_msg_ssr_grid_definition_dep_a_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_grid_definition_dep_a_t &msg, + sbp_write_fn_t write) { + return sbp_msg_ssr_grid_definition_dep_a_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_grid_definition_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_grid_definition_dep_a_t &msg) { return sbp_msg_ssr_grid_definition_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_grid_definition_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_grid_definition_dep_a_t *msg) { return sbp_msg_ssr_grid_definition_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_grid_definition_dep_a_t &msg) { @@ -5843,63 +6488,82 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrGriddedCorrectionBounds; static constexpr const char *name = "MSG_SSR_GRIDDED_CORRECTION_BOUNDS"; - static const sbp_msg_ssr_gridded_correction_bounds_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_gridded_correction_bounds_t &get( + const sbp_msg_t &msg) { return msg.ssr_gridded_correction_bounds; } - static sbp_msg_ssr_gridded_correction_bounds_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_gridded_correction_bounds_t &get(sbp_msg_t &msg) { return msg.ssr_gridded_correction_bounds; } - static void to_sbp_msg(const sbp_msg_ssr_gridded_correction_bounds_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_gridded_correction_bounds_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_gridded_correction_bounds = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_gridded_correction_bounds_t& msg) { + static sbp_msg_t to_sbp_msg( + const sbp_msg_ssr_gridded_correction_bounds_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_gridded_correction_bounds = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_gridded_correction_bounds_t &msg, sbp_write_fn_t write) { - return sbp_msg_ssr_gridded_correction_bounds_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_gridded_correction_bounds_t &msg, + sbp_write_fn_t write) { + return sbp_msg_ssr_gridded_correction_bounds_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_gridded_correction_bounds_t &msg){ - return sbp_msg_ssr_gridded_correction_bounds_encode(buf, len, n_written, &msg); + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_gridded_correction_bounds_t &msg) { + return sbp_msg_ssr_gridded_correction_bounds_encode(buf, len, n_written, + &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_gridded_correction_bounds_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_gridded_correction_bounds_t *msg) { return sbp_msg_ssr_gridded_correction_bounds_decode(buf, len, n_read, msg); } - static size_t encoded_len(const sbp_msg_ssr_gridded_correction_bounds_t &msg) { + static size_t encoded_len( + const sbp_msg_ssr_gridded_correction_bounds_t &msg) { return sbp_msg_ssr_gridded_correction_bounds_encoded_len(&msg); } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrGriddedCorrectionDepA; static constexpr const char *name = "MSG_SSR_GRIDDED_CORRECTION_DEP_A"; - static const sbp_msg_ssr_gridded_correction_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_gridded_correction_dep_a_t &get( + const sbp_msg_t &msg) { return msg.ssr_gridded_correction_dep_a; } - static sbp_msg_ssr_gridded_correction_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_gridded_correction_dep_a_t &get(sbp_msg_t &msg) { return msg.ssr_gridded_correction_dep_a; } - static void to_sbp_msg(const sbp_msg_ssr_gridded_correction_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_gridded_correction_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_gridded_correction_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_gridded_correction_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg( + const sbp_msg_ssr_gridded_correction_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_gridded_correction_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_gridded_correction_dep_a_t &msg, sbp_write_fn_t write) { - return sbp_msg_ssr_gridded_correction_dep_a_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_gridded_correction_dep_a_t &msg, + sbp_write_fn_t write) { + return sbp_msg_ssr_gridded_correction_dep_a_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_gridded_correction_dep_a_t &msg){ - return sbp_msg_ssr_gridded_correction_dep_a_encode(buf, len, n_written, &msg); + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_gridded_correction_dep_a_t &msg) { + return sbp_msg_ssr_gridded_correction_dep_a_encode(buf, len, n_written, + &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_gridded_correction_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_gridded_correction_dep_a_t *msg) { return sbp_msg_ssr_gridded_correction_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_gridded_correction_dep_a_t &msg) { @@ -5907,63 +6571,80 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrGriddedCorrectionNoStdDepA; static constexpr const char *name = "MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A"; - static const sbp_msg_ssr_gridded_correction_no_std_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &get( + const sbp_msg_t &msg) { return msg.ssr_gridded_correction_no_std_dep_a; } - static sbp_msg_ssr_gridded_correction_no_std_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_gridded_correction_no_std_dep_a_t &get(sbp_msg_t &msg) { return msg.ssr_gridded_correction_no_std_dep_a; } - static void to_sbp_msg(const sbp_msg_ssr_gridded_correction_no_std_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg( + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_gridded_correction_no_std_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_gridded_correction_no_std_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg( + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_gridded_correction_no_std_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &msg, sbp_write_fn_t write) { - return sbp_msg_ssr_gridded_correction_no_std_dep_a_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &msg, + sbp_write_fn_t write) { + return sbp_msg_ssr_gridded_correction_no_std_dep_a_send(state, sender_id, + &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &msg){ - return sbp_msg_ssr_gridded_correction_no_std_dep_a_encode(buf, len, n_written, &msg); + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &msg) { + return sbp_msg_ssr_gridded_correction_no_std_dep_a_encode(buf, len, + n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg){ - return sbp_msg_ssr_gridded_correction_no_std_dep_a_decode(buf, len, n_read, msg); + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg) { + return sbp_msg_ssr_gridded_correction_no_std_dep_a_decode(buf, len, n_read, + msg); } - static size_t encoded_len(const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &msg) { + static size_t encoded_len( + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &msg) { return sbp_msg_ssr_gridded_correction_no_std_dep_a_encoded_len(&msg); } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrGriddedCorrection; static constexpr const char *name = "MSG_SSR_GRIDDED_CORRECTION"; - static const sbp_msg_ssr_gridded_correction_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_gridded_correction_t &get(const sbp_msg_t &msg) { return msg.ssr_gridded_correction; } - static sbp_msg_ssr_gridded_correction_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_gridded_correction_t &get(sbp_msg_t &msg) { return msg.ssr_gridded_correction; } - static void to_sbp_msg(const sbp_msg_ssr_gridded_correction_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_gridded_correction_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_gridded_correction = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_gridded_correction_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_gridded_correction_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_gridded_correction = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_gridded_correction_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_gridded_correction_t &msg, + sbp_write_fn_t write) { return sbp_msg_ssr_gridded_correction_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_gridded_correction_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_gridded_correction_t &msg) { return sbp_msg_ssr_gridded_correction_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_gridded_correction_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_gridded_correction_t *msg) { return sbp_msg_ssr_gridded_correction_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_gridded_correction_t &msg) { @@ -5971,63 +6652,80 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrOrbitClockBoundsDegradation; static constexpr const char *name = "MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION"; - static const sbp_msg_ssr_orbit_clock_bounds_degradation_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_orbit_clock_bounds_degradation_t &get( + const sbp_msg_t &msg) { return msg.ssr_orbit_clock_bounds_degradation; } - static sbp_msg_ssr_orbit_clock_bounds_degradation_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_orbit_clock_bounds_degradation_t &get(sbp_msg_t &msg) { return msg.ssr_orbit_clock_bounds_degradation; } - static void to_sbp_msg(const sbp_msg_ssr_orbit_clock_bounds_degradation_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg( + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_orbit_clock_bounds_degradation = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_orbit_clock_bounds_degradation_t& msg) { + static sbp_msg_t to_sbp_msg( + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_orbit_clock_bounds_degradation = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_orbit_clock_bounds_degradation_t &msg, sbp_write_fn_t write) { - return sbp_msg_ssr_orbit_clock_bounds_degradation_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &msg, + sbp_write_fn_t write) { + return sbp_msg_ssr_orbit_clock_bounds_degradation_send(state, sender_id, + &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_orbit_clock_bounds_degradation_t &msg){ - return sbp_msg_ssr_orbit_clock_bounds_degradation_encode(buf, len, n_written, &msg); + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &msg) { + return sbp_msg_ssr_orbit_clock_bounds_degradation_encode(buf, len, + n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg){ - return sbp_msg_ssr_orbit_clock_bounds_degradation_decode(buf, len, n_read, msg); + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg) { + return sbp_msg_ssr_orbit_clock_bounds_degradation_decode(buf, len, n_read, + msg); } - static size_t encoded_len(const sbp_msg_ssr_orbit_clock_bounds_degradation_t &msg) { + static size_t encoded_len( + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &msg) { return sbp_msg_ssr_orbit_clock_bounds_degradation_encoded_len(&msg); } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrOrbitClockBounds; static constexpr const char *name = "MSG_SSR_ORBIT_CLOCK_BOUNDS"; - static const sbp_msg_ssr_orbit_clock_bounds_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_orbit_clock_bounds_t &get(const sbp_msg_t &msg) { return msg.ssr_orbit_clock_bounds; } - static sbp_msg_ssr_orbit_clock_bounds_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_orbit_clock_bounds_t &get(sbp_msg_t &msg) { return msg.ssr_orbit_clock_bounds; } - static void to_sbp_msg(const sbp_msg_ssr_orbit_clock_bounds_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_orbit_clock_bounds_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_orbit_clock_bounds = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_orbit_clock_bounds_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_orbit_clock_bounds_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_orbit_clock_bounds = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_orbit_clock_bounds_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_orbit_clock_bounds_t &msg, + sbp_write_fn_t write) { return sbp_msg_ssr_orbit_clock_bounds_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_orbit_clock_bounds_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_orbit_clock_bounds_t &msg) { return sbp_msg_ssr_orbit_clock_bounds_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_orbit_clock_bounds_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_orbit_clock_bounds_t *msg) { return sbp_msg_ssr_orbit_clock_bounds_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_orbit_clock_bounds_t &msg) { @@ -6035,31 +6733,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrOrbitClockDepA; static constexpr const char *name = "MSG_SSR_ORBIT_CLOCK_DEP_A"; - static const sbp_msg_ssr_orbit_clock_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_orbit_clock_dep_a_t &get(const sbp_msg_t &msg) { return msg.ssr_orbit_clock_dep_a; } - static sbp_msg_ssr_orbit_clock_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_orbit_clock_dep_a_t &get(sbp_msg_t &msg) { return msg.ssr_orbit_clock_dep_a; } - static void to_sbp_msg(const sbp_msg_ssr_orbit_clock_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_orbit_clock_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_orbit_clock_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_orbit_clock_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_orbit_clock_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_orbit_clock_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_orbit_clock_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_orbit_clock_dep_a_t &msg, + sbp_write_fn_t write) { return sbp_msg_ssr_orbit_clock_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_orbit_clock_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_orbit_clock_dep_a_t &msg) { return sbp_msg_ssr_orbit_clock_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_orbit_clock_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_orbit_clock_dep_a_t *msg) { return sbp_msg_ssr_orbit_clock_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_orbit_clock_dep_a_t &msg) { @@ -6067,31 +6770,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrOrbitClock; static constexpr const char *name = "MSG_SSR_ORBIT_CLOCK"; - static const sbp_msg_ssr_orbit_clock_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_orbit_clock_t &get(const sbp_msg_t &msg) { return msg.ssr_orbit_clock; } - static sbp_msg_ssr_orbit_clock_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_orbit_clock_t &get(sbp_msg_t &msg) { return msg.ssr_orbit_clock; } - static void to_sbp_msg(const sbp_msg_ssr_orbit_clock_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_orbit_clock_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_orbit_clock = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_orbit_clock_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_orbit_clock_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_orbit_clock = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_orbit_clock_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_orbit_clock_t &msg, sbp_write_fn_t write) { return sbp_msg_ssr_orbit_clock_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_orbit_clock_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_orbit_clock_t &msg) { return sbp_msg_ssr_orbit_clock_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_orbit_clock_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_orbit_clock_t *msg) { return sbp_msg_ssr_orbit_clock_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_orbit_clock_t &msg) { @@ -6099,31 +6806,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrPhaseBiases; static constexpr const char *name = "MSG_SSR_PHASE_BIASES"; - static const sbp_msg_ssr_phase_biases_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_phase_biases_t &get(const sbp_msg_t &msg) { return msg.ssr_phase_biases; } - static sbp_msg_ssr_phase_biases_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_phase_biases_t &get(sbp_msg_t &msg) { return msg.ssr_phase_biases; } - static void to_sbp_msg(const sbp_msg_ssr_phase_biases_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_phase_biases_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_phase_biases = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_phase_biases_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_phase_biases_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_phase_biases = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_phase_biases_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_phase_biases_t &msg, sbp_write_fn_t write) { return sbp_msg_ssr_phase_biases_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_phase_biases_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_phase_biases_t &msg) { return sbp_msg_ssr_phase_biases_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_phase_biases_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_phase_biases_t *msg) { return sbp_msg_ssr_phase_biases_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_phase_biases_t &msg) { @@ -6131,31 +6842,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrSatelliteApcDep; static constexpr const char *name = "MSG_SSR_SATELLITE_APC_DEP"; - static const sbp_msg_ssr_satellite_apc_dep_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_satellite_apc_dep_t &get(const sbp_msg_t &msg) { return msg.ssr_satellite_apc_dep; } - static sbp_msg_ssr_satellite_apc_dep_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_satellite_apc_dep_t &get(sbp_msg_t &msg) { return msg.ssr_satellite_apc_dep; } - static void to_sbp_msg(const sbp_msg_ssr_satellite_apc_dep_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_satellite_apc_dep_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_satellite_apc_dep = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_satellite_apc_dep_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_satellite_apc_dep_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_satellite_apc_dep = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_satellite_apc_dep_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_satellite_apc_dep_t &msg, + sbp_write_fn_t write) { return sbp_msg_ssr_satellite_apc_dep_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_satellite_apc_dep_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_satellite_apc_dep_t &msg) { return sbp_msg_ssr_satellite_apc_dep_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_satellite_apc_dep_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_satellite_apc_dep_t *msg) { return sbp_msg_ssr_satellite_apc_dep_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_satellite_apc_dep_t &msg) { @@ -6163,31 +6879,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrSatelliteApc; static constexpr const char *name = "MSG_SSR_SATELLITE_APC"; - static const sbp_msg_ssr_satellite_apc_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_satellite_apc_t &get(const sbp_msg_t &msg) { return msg.ssr_satellite_apc; } - static sbp_msg_ssr_satellite_apc_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_satellite_apc_t &get(sbp_msg_t &msg) { return msg.ssr_satellite_apc; } - static void to_sbp_msg(const sbp_msg_ssr_satellite_apc_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_satellite_apc_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_satellite_apc = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_satellite_apc_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_satellite_apc_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_satellite_apc = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_satellite_apc_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_satellite_apc_t &msg, sbp_write_fn_t write) { return sbp_msg_ssr_satellite_apc_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_satellite_apc_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_satellite_apc_t &msg) { return sbp_msg_ssr_satellite_apc_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_satellite_apc_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_satellite_apc_t *msg) { return sbp_msg_ssr_satellite_apc_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_satellite_apc_t &msg) { @@ -6195,31 +6915,37 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrStecCorrectionDepA; static constexpr const char *name = "MSG_SSR_STEC_CORRECTION_DEP_A"; - static const sbp_msg_ssr_stec_correction_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_stec_correction_dep_a_t &get(const sbp_msg_t &msg) { return msg.ssr_stec_correction_dep_a; } - static sbp_msg_ssr_stec_correction_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_stec_correction_dep_a_t &get(sbp_msg_t &msg) { return msg.ssr_stec_correction_dep_a; } - static void to_sbp_msg(const sbp_msg_ssr_stec_correction_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_stec_correction_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_stec_correction_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_stec_correction_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_stec_correction_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_stec_correction_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_stec_correction_dep_a_t &msg, sbp_write_fn_t write) { - return sbp_msg_ssr_stec_correction_dep_a_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_stec_correction_dep_a_t &msg, + sbp_write_fn_t write) { + return sbp_msg_ssr_stec_correction_dep_a_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_stec_correction_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_stec_correction_dep_a_t &msg) { return sbp_msg_ssr_stec_correction_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_stec_correction_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_stec_correction_dep_a_t *msg) { return sbp_msg_ssr_stec_correction_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_stec_correction_dep_a_t &msg) { @@ -6227,31 +6953,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrStecCorrectionDep; static constexpr const char *name = "MSG_SSR_STEC_CORRECTION_DEP"; - static const sbp_msg_ssr_stec_correction_dep_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_stec_correction_dep_t &get(const sbp_msg_t &msg) { return msg.ssr_stec_correction_dep; } - static sbp_msg_ssr_stec_correction_dep_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_stec_correction_dep_t &get(sbp_msg_t &msg) { return msg.ssr_stec_correction_dep; } - static void to_sbp_msg(const sbp_msg_ssr_stec_correction_dep_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_stec_correction_dep_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_stec_correction_dep = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_stec_correction_dep_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_stec_correction_dep_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_stec_correction_dep = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_stec_correction_dep_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_stec_correction_dep_t &msg, + sbp_write_fn_t write) { return sbp_msg_ssr_stec_correction_dep_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_stec_correction_dep_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_stec_correction_dep_t &msg) { return sbp_msg_ssr_stec_correction_dep_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_stec_correction_dep_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_stec_correction_dep_t *msg) { return sbp_msg_ssr_stec_correction_dep_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_stec_correction_dep_t &msg) { @@ -6259,31 +6990,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrStecCorrection; static constexpr const char *name = "MSG_SSR_STEC_CORRECTION"; - static const sbp_msg_ssr_stec_correction_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_stec_correction_t &get(const sbp_msg_t &msg) { return msg.ssr_stec_correction; } - static sbp_msg_ssr_stec_correction_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_stec_correction_t &get(sbp_msg_t &msg) { return msg.ssr_stec_correction; } - static void to_sbp_msg(const sbp_msg_ssr_stec_correction_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_stec_correction_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_stec_correction = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_stec_correction_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_stec_correction_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_stec_correction = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_stec_correction_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_stec_correction_t &msg, + sbp_write_fn_t write) { return sbp_msg_ssr_stec_correction_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_stec_correction_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_stec_correction_t &msg) { return sbp_msg_ssr_stec_correction_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_stec_correction_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_stec_correction_t *msg) { return sbp_msg_ssr_stec_correction_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_stec_correction_t &msg) { @@ -6291,31 +7027,37 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrTileDefinitionDepA; static constexpr const char *name = "MSG_SSR_TILE_DEFINITION_DEP_A"; - static const sbp_msg_ssr_tile_definition_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_tile_definition_dep_a_t &get(const sbp_msg_t &msg) { return msg.ssr_tile_definition_dep_a; } - static sbp_msg_ssr_tile_definition_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_tile_definition_dep_a_t &get(sbp_msg_t &msg) { return msg.ssr_tile_definition_dep_a; } - static void to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_tile_definition_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_tile_definition_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_tile_definition_dep_a_t &msg, sbp_write_fn_t write) { - return sbp_msg_ssr_tile_definition_dep_a_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_tile_definition_dep_a_t &msg, + sbp_write_fn_t write) { + return sbp_msg_ssr_tile_definition_dep_a_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_tile_definition_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_tile_definition_dep_a_t &msg) { return sbp_msg_ssr_tile_definition_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_tile_definition_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_tile_definition_dep_a_t *msg) { return sbp_msg_ssr_tile_definition_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_tile_definition_dep_a_t &msg) { @@ -6323,31 +7065,37 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrTileDefinitionDepB; static constexpr const char *name = "MSG_SSR_TILE_DEFINITION_DEP_B"; - static const sbp_msg_ssr_tile_definition_dep_b_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_tile_definition_dep_b_t &get(const sbp_msg_t &msg) { return msg.ssr_tile_definition_dep_b; } - static sbp_msg_ssr_tile_definition_dep_b_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_tile_definition_dep_b_t &get(sbp_msg_t &msg) { return msg.ssr_tile_definition_dep_b; } - static void to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_b_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_b_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_tile_definition_dep_b = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_b_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_tile_definition_dep_b_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_tile_definition_dep_b = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_tile_definition_dep_b_t &msg, sbp_write_fn_t write) { - return sbp_msg_ssr_tile_definition_dep_b_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_tile_definition_dep_b_t &msg, + sbp_write_fn_t write) { + return sbp_msg_ssr_tile_definition_dep_b_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_tile_definition_dep_b_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_tile_definition_dep_b_t &msg) { return sbp_msg_ssr_tile_definition_dep_b_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_tile_definition_dep_b_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_tile_definition_dep_b_t *msg) { return sbp_msg_ssr_tile_definition_dep_b_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_tile_definition_dep_b_t &msg) { @@ -6355,31 +7103,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSsrTileDefinition; static constexpr const char *name = "MSG_SSR_TILE_DEFINITION"; - static const sbp_msg_ssr_tile_definition_t& get(const sbp_msg_t &msg) { + static const sbp_msg_ssr_tile_definition_t &get(const sbp_msg_t &msg) { return msg.ssr_tile_definition; } - static sbp_msg_ssr_tile_definition_t& get(sbp_msg_t &msg) { + static sbp_msg_ssr_tile_definition_t &get(sbp_msg_t &msg) { return msg.ssr_tile_definition; } - static void to_sbp_msg(const sbp_msg_ssr_tile_definition_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_ssr_tile_definition_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->ssr_tile_definition = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_tile_definition_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_tile_definition_t &msg) { sbp_msg_t sbp_msg; sbp_msg.ssr_tile_definition = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_ssr_tile_definition_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ssr_tile_definition_t &msg, + sbp_write_fn_t write) { return sbp_msg_ssr_tile_definition_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_tile_definition_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_tile_definition_t &msg) { return sbp_msg_ssr_tile_definition_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_tile_definition_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_tile_definition_t *msg) { return sbp_msg_ssr_tile_definition_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_ssr_tile_definition_t &msg) { @@ -6387,31 +7140,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgStartup; static constexpr const char *name = "MSG_STARTUP"; - static const sbp_msg_startup_t& get(const sbp_msg_t &msg) { - return msg.startup; - } - static sbp_msg_startup_t& get(sbp_msg_t &msg) { + static const sbp_msg_startup_t &get(const sbp_msg_t &msg) { return msg.startup; } - static void to_sbp_msg(const sbp_msg_startup_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_startup_t &get(sbp_msg_t &msg) { return msg.startup; } + static void to_sbp_msg(const sbp_msg_startup_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->startup = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_startup_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_startup_t &msg) { sbp_msg_t sbp_msg; sbp_msg.startup = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_startup_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_startup_t &msg, sbp_write_fn_t write) { return sbp_msg_startup_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_startup_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_startup_t &msg) { return sbp_msg_startup_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_startup_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_startup_t *msg) { return sbp_msg_startup_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_startup_t &msg) { @@ -6419,31 +7173,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgStatusJournal; static constexpr const char *name = "MSG_STATUS_JOURNAL"; - static const sbp_msg_status_journal_t& get(const sbp_msg_t &msg) { + static const sbp_msg_status_journal_t &get(const sbp_msg_t &msg) { return msg.status_journal; } - static sbp_msg_status_journal_t& get(sbp_msg_t &msg) { + static sbp_msg_status_journal_t &get(sbp_msg_t &msg) { return msg.status_journal; } - static void to_sbp_msg(const sbp_msg_status_journal_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_status_journal_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->status_journal = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_status_journal_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_status_journal_t &msg) { sbp_msg_t sbp_msg; sbp_msg.status_journal = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_status_journal_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_status_journal_t &msg, sbp_write_fn_t write) { return sbp_msg_status_journal_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_status_journal_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_status_journal_t &msg) { return sbp_msg_status_journal_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_status_journal_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_status_journal_t *msg) { return sbp_msg_status_journal_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_status_journal_t &msg) { @@ -6451,31 +7209,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgStatusReport; static constexpr const char *name = "MSG_STATUS_REPORT"; - static const sbp_msg_status_report_t& get(const sbp_msg_t &msg) { + static const sbp_msg_status_report_t &get(const sbp_msg_t &msg) { return msg.status_report; } - static sbp_msg_status_report_t& get(sbp_msg_t &msg) { + static sbp_msg_status_report_t &get(sbp_msg_t &msg) { return msg.status_report; } - static void to_sbp_msg(const sbp_msg_status_report_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_status_report_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->status_report = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_status_report_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_status_report_t &msg) { sbp_msg_t sbp_msg; sbp_msg.status_report = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_status_report_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_status_report_t &msg, sbp_write_fn_t write) { return sbp_msg_status_report_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_status_report_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_status_report_t &msg) { return sbp_msg_status_report_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_status_report_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_status_report_t *msg) { return sbp_msg_status_report_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_status_report_t &msg) { @@ -6483,31 +7245,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgStmFlashLockSector; static constexpr const char *name = "MSG_STM_FLASH_LOCK_SECTOR"; - static const sbp_msg_stm_flash_lock_sector_t& get(const sbp_msg_t &msg) { + static const sbp_msg_stm_flash_lock_sector_t &get(const sbp_msg_t &msg) { return msg.stm_flash_lock_sector; } - static sbp_msg_stm_flash_lock_sector_t& get(sbp_msg_t &msg) { + static sbp_msg_stm_flash_lock_sector_t &get(sbp_msg_t &msg) { return msg.stm_flash_lock_sector; } - static void to_sbp_msg(const sbp_msg_stm_flash_lock_sector_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_stm_flash_lock_sector_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->stm_flash_lock_sector = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_stm_flash_lock_sector_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_stm_flash_lock_sector_t &msg) { sbp_msg_t sbp_msg; sbp_msg.stm_flash_lock_sector = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_stm_flash_lock_sector_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_stm_flash_lock_sector_t &msg, + sbp_write_fn_t write) { return sbp_msg_stm_flash_lock_sector_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_stm_flash_lock_sector_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_stm_flash_lock_sector_t &msg) { return sbp_msg_stm_flash_lock_sector_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_stm_flash_lock_sector_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_stm_flash_lock_sector_t *msg) { return sbp_msg_stm_flash_lock_sector_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_stm_flash_lock_sector_t &msg) { @@ -6515,31 +7282,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgStmFlashUnlockSector; static constexpr const char *name = "MSG_STM_FLASH_UNLOCK_SECTOR"; - static const sbp_msg_stm_flash_unlock_sector_t& get(const sbp_msg_t &msg) { + static const sbp_msg_stm_flash_unlock_sector_t &get(const sbp_msg_t &msg) { return msg.stm_flash_unlock_sector; } - static sbp_msg_stm_flash_unlock_sector_t& get(sbp_msg_t &msg) { + static sbp_msg_stm_flash_unlock_sector_t &get(sbp_msg_t &msg) { return msg.stm_flash_unlock_sector; } - static void to_sbp_msg(const sbp_msg_stm_flash_unlock_sector_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_stm_flash_unlock_sector_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->stm_flash_unlock_sector = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_stm_flash_unlock_sector_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_stm_flash_unlock_sector_t &msg) { sbp_msg_t sbp_msg; sbp_msg.stm_flash_unlock_sector = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_stm_flash_unlock_sector_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_stm_flash_unlock_sector_t &msg, + sbp_write_fn_t write) { return sbp_msg_stm_flash_unlock_sector_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_stm_flash_unlock_sector_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_stm_flash_unlock_sector_t &msg) { return sbp_msg_stm_flash_unlock_sector_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_stm_flash_unlock_sector_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_stm_flash_unlock_sector_t *msg) { return sbp_msg_stm_flash_unlock_sector_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_stm_flash_unlock_sector_t &msg) { @@ -6547,31 +7319,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgStmUniqueIdReq; static constexpr const char *name = "MSG_STM_UNIQUE_ID_REQ"; - static const sbp_msg_stm_unique_id_req_t& get(const sbp_msg_t &msg) { + static const sbp_msg_stm_unique_id_req_t &get(const sbp_msg_t &msg) { return msg.stm_unique_id_req; } - static sbp_msg_stm_unique_id_req_t& get(sbp_msg_t &msg) { + static sbp_msg_stm_unique_id_req_t &get(sbp_msg_t &msg) { return msg.stm_unique_id_req; } - static void to_sbp_msg(const sbp_msg_stm_unique_id_req_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_stm_unique_id_req_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->stm_unique_id_req = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_stm_unique_id_req_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_stm_unique_id_req_t &msg) { sbp_msg_t sbp_msg; sbp_msg.stm_unique_id_req = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_stm_unique_id_req_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_stm_unique_id_req_t &msg, sbp_write_fn_t write) { return sbp_msg_stm_unique_id_req_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_stm_unique_id_req_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_stm_unique_id_req_t &msg) { return sbp_msg_stm_unique_id_req_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_stm_unique_id_req_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_stm_unique_id_req_t *msg) { return sbp_msg_stm_unique_id_req_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_stm_unique_id_req_t &msg) { @@ -6579,31 +7355,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgStmUniqueIdResp; static constexpr const char *name = "MSG_STM_UNIQUE_ID_RESP"; - static const sbp_msg_stm_unique_id_resp_t& get(const sbp_msg_t &msg) { + static const sbp_msg_stm_unique_id_resp_t &get(const sbp_msg_t &msg) { return msg.stm_unique_id_resp; } - static sbp_msg_stm_unique_id_resp_t& get(sbp_msg_t &msg) { + static sbp_msg_stm_unique_id_resp_t &get(sbp_msg_t &msg) { return msg.stm_unique_id_resp; } - static void to_sbp_msg(const sbp_msg_stm_unique_id_resp_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_stm_unique_id_resp_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->stm_unique_id_resp = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_stm_unique_id_resp_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_stm_unique_id_resp_t &msg) { sbp_msg_t sbp_msg; sbp_msg.stm_unique_id_resp = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_stm_unique_id_resp_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_stm_unique_id_resp_t &msg, + sbp_write_fn_t write) { return sbp_msg_stm_unique_id_resp_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_stm_unique_id_resp_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_stm_unique_id_resp_t &msg) { return sbp_msg_stm_unique_id_resp_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_stm_unique_id_resp_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_stm_unique_id_resp_t *msg) { return sbp_msg_stm_unique_id_resp_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_stm_unique_id_resp_t &msg) { @@ -6611,31 +7392,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSvAzEl; static constexpr const char *name = "MSG_SV_AZ_EL"; - static const sbp_msg_sv_az_el_t& get(const sbp_msg_t &msg) { - return msg.sv_az_el; - } - static sbp_msg_sv_az_el_t& get(sbp_msg_t &msg) { + static const sbp_msg_sv_az_el_t &get(const sbp_msg_t &msg) { return msg.sv_az_el; } - static void to_sbp_msg(const sbp_msg_sv_az_el_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_sv_az_el_t &get(sbp_msg_t &msg) { return msg.sv_az_el; } + static void to_sbp_msg(const sbp_msg_sv_az_el_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->sv_az_el = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_sv_az_el_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_sv_az_el_t &msg) { sbp_msg_t sbp_msg; sbp_msg.sv_az_el = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_sv_az_el_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_sv_az_el_t &msg, sbp_write_fn_t write) { return sbp_msg_sv_az_el_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_sv_az_el_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_sv_az_el_t &msg) { return sbp_msg_sv_az_el_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_sv_az_el_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_sv_az_el_t *msg) { return sbp_msg_sv_az_el_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_sv_az_el_t &msg) { @@ -6643,31 +7425,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgSvConfigurationGpsDep; static constexpr const char *name = "MSG_SV_CONFIGURATION_GPS_DEP"; - static const sbp_msg_sv_configuration_gps_dep_t& get(const sbp_msg_t &msg) { + static const sbp_msg_sv_configuration_gps_dep_t &get(const sbp_msg_t &msg) { return msg.sv_configuration_gps_dep; } - static sbp_msg_sv_configuration_gps_dep_t& get(sbp_msg_t &msg) { + static sbp_msg_sv_configuration_gps_dep_t &get(sbp_msg_t &msg) { return msg.sv_configuration_gps_dep; } - static void to_sbp_msg(const sbp_msg_sv_configuration_gps_dep_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_sv_configuration_gps_dep_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->sv_configuration_gps_dep = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_sv_configuration_gps_dep_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_sv_configuration_gps_dep_t &msg) { sbp_msg_t sbp_msg; sbp_msg.sv_configuration_gps_dep = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_sv_configuration_gps_dep_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_sv_configuration_gps_dep_t &msg, + sbp_write_fn_t write) { return sbp_msg_sv_configuration_gps_dep_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_sv_configuration_gps_dep_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_sv_configuration_gps_dep_t &msg) { return sbp_msg_sv_configuration_gps_dep_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_sv_configuration_gps_dep_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_sv_configuration_gps_dep_t *msg) { return sbp_msg_sv_configuration_gps_dep_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_sv_configuration_gps_dep_t &msg) { @@ -6675,31 +7462,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgTelSv; static constexpr const char *name = "MSG_TEL_SV"; - static const sbp_msg_tel_sv_t& get(const sbp_msg_t &msg) { - return msg.tel_sv; - } - static sbp_msg_tel_sv_t& get(sbp_msg_t &msg) { + static const sbp_msg_tel_sv_t &get(const sbp_msg_t &msg) { return msg.tel_sv; } - static void to_sbp_msg(const sbp_msg_tel_sv_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_tel_sv_t &get(sbp_msg_t &msg) { return msg.tel_sv; } + static void to_sbp_msg(const sbp_msg_tel_sv_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->tel_sv = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_tel_sv_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_tel_sv_t &msg) { sbp_msg_t sbp_msg; sbp_msg.tel_sv = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_tel_sv_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_tel_sv_t &msg, + sbp_write_fn_t write) { return sbp_msg_tel_sv_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tel_sv_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tel_sv_t &msg) { return sbp_msg_tel_sv_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tel_sv_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tel_sv_t *msg) { return sbp_msg_tel_sv_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_tel_sv_t &msg) { @@ -6707,31 +7495,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgThreadState; static constexpr const char *name = "MSG_THREAD_STATE"; - static const sbp_msg_thread_state_t& get(const sbp_msg_t &msg) { + static const sbp_msg_thread_state_t &get(const sbp_msg_t &msg) { return msg.thread_state; } - static sbp_msg_thread_state_t& get(sbp_msg_t &msg) { + static sbp_msg_thread_state_t &get(sbp_msg_t &msg) { return msg.thread_state; } - static void to_sbp_msg(const sbp_msg_thread_state_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_thread_state_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->thread_state = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_thread_state_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_thread_state_t &msg) { sbp_msg_t sbp_msg; sbp_msg.thread_state = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_thread_state_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_thread_state_t &msg, sbp_write_fn_t write) { return sbp_msg_thread_state_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_thread_state_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_thread_state_t &msg) { return sbp_msg_thread_state_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_thread_state_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_thread_state_t *msg) { return sbp_msg_thread_state_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_thread_state_t &msg) { @@ -6739,31 +7531,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgTrackingIqDepA; static constexpr const char *name = "MSG_TRACKING_IQ_DEP_A"; - static const sbp_msg_tracking_iq_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_tracking_iq_dep_a_t &get(const sbp_msg_t &msg) { return msg.tracking_iq_dep_a; } - static sbp_msg_tracking_iq_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_tracking_iq_dep_a_t &get(sbp_msg_t &msg) { return msg.tracking_iq_dep_a; } - static void to_sbp_msg(const sbp_msg_tracking_iq_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_tracking_iq_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->tracking_iq_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_tracking_iq_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_tracking_iq_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.tracking_iq_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_tracking_iq_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_tracking_iq_dep_a_t &msg, sbp_write_fn_t write) { return sbp_msg_tracking_iq_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_iq_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_iq_dep_a_t &msg) { return sbp_msg_tracking_iq_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_iq_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_iq_dep_a_t *msg) { return sbp_msg_tracking_iq_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_tracking_iq_dep_a_t &msg) { @@ -6771,31 +7567,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgTrackingIqDepB; static constexpr const char *name = "MSG_TRACKING_IQ_DEP_B"; - static const sbp_msg_tracking_iq_dep_b_t& get(const sbp_msg_t &msg) { + static const sbp_msg_tracking_iq_dep_b_t &get(const sbp_msg_t &msg) { return msg.tracking_iq_dep_b; } - static sbp_msg_tracking_iq_dep_b_t& get(sbp_msg_t &msg) { + static sbp_msg_tracking_iq_dep_b_t &get(sbp_msg_t &msg) { return msg.tracking_iq_dep_b; } - static void to_sbp_msg(const sbp_msg_tracking_iq_dep_b_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_tracking_iq_dep_b_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->tracking_iq_dep_b = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_tracking_iq_dep_b_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_tracking_iq_dep_b_t &msg) { sbp_msg_t sbp_msg; sbp_msg.tracking_iq_dep_b = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_tracking_iq_dep_b_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_tracking_iq_dep_b_t &msg, sbp_write_fn_t write) { return sbp_msg_tracking_iq_dep_b_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_iq_dep_b_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_iq_dep_b_t &msg) { return sbp_msg_tracking_iq_dep_b_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_iq_dep_b_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_iq_dep_b_t *msg) { return sbp_msg_tracking_iq_dep_b_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_tracking_iq_dep_b_t &msg) { @@ -6803,31 +7603,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgTrackingIq; static constexpr const char *name = "MSG_TRACKING_IQ"; - static const sbp_msg_tracking_iq_t& get(const sbp_msg_t &msg) { - return msg.tracking_iq; - } - static sbp_msg_tracking_iq_t& get(sbp_msg_t &msg) { + static const sbp_msg_tracking_iq_t &get(const sbp_msg_t &msg) { return msg.tracking_iq; } - static void to_sbp_msg(const sbp_msg_tracking_iq_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_tracking_iq_t &get(sbp_msg_t &msg) { return msg.tracking_iq; } + static void to_sbp_msg(const sbp_msg_tracking_iq_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->tracking_iq = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_tracking_iq_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_tracking_iq_t &msg) { sbp_msg_t sbp_msg; sbp_msg.tracking_iq = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_tracking_iq_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_tracking_iq_t &msg, sbp_write_fn_t write) { return sbp_msg_tracking_iq_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_iq_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_iq_t &msg) { return sbp_msg_tracking_iq_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_iq_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_iq_t *msg) { return sbp_msg_tracking_iq_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_tracking_iq_t &msg) { @@ -6835,31 +7636,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgTrackingStateDepA; static constexpr const char *name = "MSG_TRACKING_STATE_DEP_A"; - static const sbp_msg_tracking_state_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_tracking_state_dep_a_t &get(const sbp_msg_t &msg) { return msg.tracking_state_dep_a; } - static sbp_msg_tracking_state_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_tracking_state_dep_a_t &get(sbp_msg_t &msg) { return msg.tracking_state_dep_a; } - static void to_sbp_msg(const sbp_msg_tracking_state_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_tracking_state_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->tracking_state_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_tracking_state_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_tracking_state_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.tracking_state_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_tracking_state_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_tracking_state_dep_a_t &msg, + sbp_write_fn_t write) { return sbp_msg_tracking_state_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_state_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_state_dep_a_t &msg) { return sbp_msg_tracking_state_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_state_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_state_dep_a_t *msg) { return sbp_msg_tracking_state_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_tracking_state_dep_a_t &msg) { @@ -6867,31 +7673,36 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgTrackingStateDepB; static constexpr const char *name = "MSG_TRACKING_STATE_DEP_B"; - static const sbp_msg_tracking_state_dep_b_t& get(const sbp_msg_t &msg) { + static const sbp_msg_tracking_state_dep_b_t &get(const sbp_msg_t &msg) { return msg.tracking_state_dep_b; } - static sbp_msg_tracking_state_dep_b_t& get(sbp_msg_t &msg) { + static sbp_msg_tracking_state_dep_b_t &get(sbp_msg_t &msg) { return msg.tracking_state_dep_b; } - static void to_sbp_msg(const sbp_msg_tracking_state_dep_b_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_tracking_state_dep_b_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->tracking_state_dep_b = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_tracking_state_dep_b_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_tracking_state_dep_b_t &msg) { sbp_msg_t sbp_msg; sbp_msg.tracking_state_dep_b = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_tracking_state_dep_b_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_tracking_state_dep_b_t &msg, + sbp_write_fn_t write) { return sbp_msg_tracking_state_dep_b_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_state_dep_b_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_state_dep_b_t &msg) { return sbp_msg_tracking_state_dep_b_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_state_dep_b_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_state_dep_b_t *msg) { return sbp_msg_tracking_state_dep_b_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_tracking_state_dep_b_t &msg) { @@ -6899,63 +7710,82 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgTrackingStateDetailedDepA; static constexpr const char *name = "MSG_TRACKING_STATE_DETAILED_DEP_A"; - static const sbp_msg_tracking_state_detailed_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_tracking_state_detailed_dep_a_t &get( + const sbp_msg_t &msg) { return msg.tracking_state_detailed_dep_a; } - static sbp_msg_tracking_state_detailed_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_tracking_state_detailed_dep_a_t &get(sbp_msg_t &msg) { return msg.tracking_state_detailed_dep_a; } - static void to_sbp_msg(const sbp_msg_tracking_state_detailed_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_tracking_state_detailed_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->tracking_state_detailed_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_tracking_state_detailed_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg( + const sbp_msg_tracking_state_detailed_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.tracking_state_detailed_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_tracking_state_detailed_dep_a_t &msg, sbp_write_fn_t write) { - return sbp_msg_tracking_state_detailed_dep_a_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_tracking_state_detailed_dep_a_t &msg, + sbp_write_fn_t write) { + return sbp_msg_tracking_state_detailed_dep_a_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_state_detailed_dep_a_t &msg){ - return sbp_msg_tracking_state_detailed_dep_a_encode(buf, len, n_written, &msg); + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_state_detailed_dep_a_t &msg) { + return sbp_msg_tracking_state_detailed_dep_a_encode(buf, len, n_written, + &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_state_detailed_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_state_detailed_dep_a_t *msg) { return sbp_msg_tracking_state_detailed_dep_a_decode(buf, len, n_read, msg); } - static size_t encoded_len(const sbp_msg_tracking_state_detailed_dep_a_t &msg) { + static size_t encoded_len( + const sbp_msg_tracking_state_detailed_dep_a_t &msg) { return sbp_msg_tracking_state_detailed_dep_a_encoded_len(&msg); } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgTrackingStateDetailedDep; static constexpr const char *name = "MSG_TRACKING_STATE_DETAILED_DEP"; - static const sbp_msg_tracking_state_detailed_dep_t& get(const sbp_msg_t &msg) { + static const sbp_msg_tracking_state_detailed_dep_t &get( + const sbp_msg_t &msg) { return msg.tracking_state_detailed_dep; } - static sbp_msg_tracking_state_detailed_dep_t& get(sbp_msg_t &msg) { + static sbp_msg_tracking_state_detailed_dep_t &get(sbp_msg_t &msg) { return msg.tracking_state_detailed_dep; } - static void to_sbp_msg(const sbp_msg_tracking_state_detailed_dep_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_tracking_state_detailed_dep_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->tracking_state_detailed_dep = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_tracking_state_detailed_dep_t& msg) { + static sbp_msg_t to_sbp_msg( + const sbp_msg_tracking_state_detailed_dep_t &msg) { sbp_msg_t sbp_msg; sbp_msg.tracking_state_detailed_dep = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_tracking_state_detailed_dep_t &msg, sbp_write_fn_t write) { - return sbp_msg_tracking_state_detailed_dep_send(state, sender_id, &msg, write); + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_tracking_state_detailed_dep_t &msg, + sbp_write_fn_t write) { + return sbp_msg_tracking_state_detailed_dep_send(state, sender_id, &msg, + write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_state_detailed_dep_t &msg){ - return sbp_msg_tracking_state_detailed_dep_encode(buf, len, n_written, &msg); + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_state_detailed_dep_t &msg) { + return sbp_msg_tracking_state_detailed_dep_encode(buf, len, n_written, + &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_state_detailed_dep_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_state_detailed_dep_t *msg) { return sbp_msg_tracking_state_detailed_dep_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_tracking_state_detailed_dep_t &msg) { @@ -6963,31 +7793,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgTrackingState; static constexpr const char *name = "MSG_TRACKING_STATE"; - static const sbp_msg_tracking_state_t& get(const sbp_msg_t &msg) { + static const sbp_msg_tracking_state_t &get(const sbp_msg_t &msg) { return msg.tracking_state; } - static sbp_msg_tracking_state_t& get(sbp_msg_t &msg) { + static sbp_msg_tracking_state_t &get(sbp_msg_t &msg) { return msg.tracking_state; } - static void to_sbp_msg(const sbp_msg_tracking_state_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_tracking_state_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->tracking_state = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_tracking_state_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_tracking_state_t &msg) { sbp_msg_t sbp_msg; sbp_msg.tracking_state = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_tracking_state_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_tracking_state_t &msg, sbp_write_fn_t write) { return sbp_msg_tracking_state_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_state_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_state_t &msg) { return sbp_msg_tracking_state_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_state_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_state_t *msg) { return sbp_msg_tracking_state_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_tracking_state_t &msg) { @@ -6995,31 +7829,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgUartStateDepa; static constexpr const char *name = "MSG_UART_STATE_DEPA"; - static const sbp_msg_uart_state_depa_t& get(const sbp_msg_t &msg) { + static const sbp_msg_uart_state_depa_t &get(const sbp_msg_t &msg) { return msg.uart_state_depa; } - static sbp_msg_uart_state_depa_t& get(sbp_msg_t &msg) { + static sbp_msg_uart_state_depa_t &get(sbp_msg_t &msg) { return msg.uart_state_depa; } - static void to_sbp_msg(const sbp_msg_uart_state_depa_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_uart_state_depa_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->uart_state_depa = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_uart_state_depa_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_uart_state_depa_t &msg) { sbp_msg_t sbp_msg; sbp_msg.uart_state_depa = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_uart_state_depa_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_uart_state_depa_t &msg, sbp_write_fn_t write) { return sbp_msg_uart_state_depa_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_uart_state_depa_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_uart_state_depa_t &msg) { return sbp_msg_uart_state_depa_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_uart_state_depa_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_uart_state_depa_t *msg) { return sbp_msg_uart_state_depa_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_uart_state_depa_t &msg) { @@ -7027,31 +7865,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgUartState; static constexpr const char *name = "MSG_UART_STATE"; - static const sbp_msg_uart_state_t& get(const sbp_msg_t &msg) { - return msg.uart_state; - } - static sbp_msg_uart_state_t& get(sbp_msg_t &msg) { + static const sbp_msg_uart_state_t &get(const sbp_msg_t &msg) { return msg.uart_state; } - static void to_sbp_msg(const sbp_msg_uart_state_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_uart_state_t &get(sbp_msg_t &msg) { return msg.uart_state; } + static void to_sbp_msg(const sbp_msg_uart_state_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->uart_state = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_uart_state_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_uart_state_t &msg) { sbp_msg_t sbp_msg; sbp_msg.uart_state = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_uart_state_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_uart_state_t &msg, sbp_write_fn_t write) { return sbp_msg_uart_state_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_uart_state_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_uart_state_t &msg) { return sbp_msg_uart_state_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_uart_state_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_uart_state_t *msg) { return sbp_msg_uart_state_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_uart_state_t &msg) { @@ -7059,31 +7898,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgUserData; static constexpr const char *name = "MSG_USER_DATA"; - static const sbp_msg_user_data_t& get(const sbp_msg_t &msg) { - return msg.user_data; - } - static sbp_msg_user_data_t& get(sbp_msg_t &msg) { + static const sbp_msg_user_data_t &get(const sbp_msg_t &msg) { return msg.user_data; } - static void to_sbp_msg(const sbp_msg_user_data_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_user_data_t &get(sbp_msg_t &msg) { return msg.user_data; } + static void to_sbp_msg(const sbp_msg_user_data_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->user_data = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_user_data_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_user_data_t &msg) { sbp_msg_t sbp_msg; sbp_msg.user_data = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_user_data_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_user_data_t &msg, sbp_write_fn_t write) { return sbp_msg_user_data_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_user_data_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_user_data_t &msg) { return sbp_msg_user_data_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_user_data_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_user_data_t *msg) { return sbp_msg_user_data_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_user_data_t &msg) { @@ -7091,31 +7931,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgUtcLeapSecond; static constexpr const char *name = "MSG_UTC_LEAP_SECOND"; - static const sbp_msg_utc_leap_second_t& get(const sbp_msg_t &msg) { + static const sbp_msg_utc_leap_second_t &get(const sbp_msg_t &msg) { return msg.utc_leap_second; } - static sbp_msg_utc_leap_second_t& get(sbp_msg_t &msg) { + static sbp_msg_utc_leap_second_t &get(sbp_msg_t &msg) { return msg.utc_leap_second; } - static void to_sbp_msg(const sbp_msg_utc_leap_second_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_utc_leap_second_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->utc_leap_second = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_utc_leap_second_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_utc_leap_second_t &msg) { sbp_msg_t sbp_msg; sbp_msg.utc_leap_second = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_utc_leap_second_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_utc_leap_second_t &msg, sbp_write_fn_t write) { return sbp_msg_utc_leap_second_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_utc_leap_second_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_utc_leap_second_t &msg) { return sbp_msg_utc_leap_second_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_utc_leap_second_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_utc_leap_second_t *msg) { return sbp_msg_utc_leap_second_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_utc_leap_second_t &msg) { @@ -7123,40 +7967,44 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgUtcTimeGnss; static constexpr const char *name = "MSG_UTC_TIME_GNSS"; - static const sbp_msg_utc_time_gnss_t& get(const sbp_msg_t &msg) { + static const sbp_msg_utc_time_gnss_t &get(const sbp_msg_t &msg) { return msg.utc_time_gnss; } - static sbp_msg_utc_time_gnss_t& get(sbp_msg_t &msg) { + static sbp_msg_utc_time_gnss_t &get(sbp_msg_t &msg) { return msg.utc_time_gnss; } - static void to_sbp_msg(const sbp_msg_utc_time_gnss_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_utc_time_gnss_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->utc_time_gnss = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_utc_time_gnss_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_utc_time_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.utc_time_gnss = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_utc_time_gnss_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_utc_time_gnss_t &msg, sbp_write_fn_t write) { return sbp_msg_utc_time_gnss_send(state, sender_id, &msg, write); } - static sbp_msg_utc_time_gnss_t to_gnss(const sbp_msg_utc_time_gnss_t& msg) { + static sbp_msg_utc_time_gnss_t to_gnss(const sbp_msg_utc_time_gnss_t &msg) { return msg; } - static sbp_msg_utc_time_t to_non_gnss(const sbp_msg_utc_time_gnss_t& msg){ + static sbp_msg_utc_time_t to_non_gnss(const sbp_msg_utc_time_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.utc_time_gnss = msg; return sbp_msg.utc_time; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_utc_time_gnss_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_utc_time_gnss_t &msg) { return sbp_msg_utc_time_gnss_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_utc_time_gnss_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_utc_time_gnss_t *msg) { return sbp_msg_utc_time_gnss_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_utc_time_gnss_t &msg) { @@ -7164,40 +8012,41 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgUtcTime; static constexpr const char *name = "MSG_UTC_TIME"; - static const sbp_msg_utc_time_t& get(const sbp_msg_t &msg) { - return msg.utc_time; - } - static sbp_msg_utc_time_t& get(sbp_msg_t &msg) { + static const sbp_msg_utc_time_t &get(const sbp_msg_t &msg) { return msg.utc_time; } - static void to_sbp_msg(const sbp_msg_utc_time_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_utc_time_t &get(sbp_msg_t &msg) { return msg.utc_time; } + static void to_sbp_msg(const sbp_msg_utc_time_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->utc_time = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_utc_time_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_utc_time_t &msg) { sbp_msg_t sbp_msg; sbp_msg.utc_time = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_utc_time_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_utc_time_t &msg, sbp_write_fn_t write) { return sbp_msg_utc_time_send(state, sender_id, &msg, write); } - static sbp_msg_utc_time_gnss_t to_gnss(const sbp_msg_utc_time_t& msg){ + static sbp_msg_utc_time_gnss_t to_gnss(const sbp_msg_utc_time_t &msg) { sbp_msg_t sbp_msg; sbp_msg.utc_time = msg; return sbp_msg.utc_time_gnss; } - static sbp_msg_utc_time_t to_non_gnss(const sbp_msg_utc_time_t& msg) { + static sbp_msg_utc_time_t to_non_gnss(const sbp_msg_utc_time_t &msg) { return msg; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_utc_time_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_utc_time_t &msg) { return sbp_msg_utc_time_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_utc_time_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_utc_time_t *msg) { return sbp_msg_utc_time_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_utc_time_t &msg) { @@ -7205,31 +8054,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgVelBody; static constexpr const char *name = "MSG_VEL_BODY"; - static const sbp_msg_vel_body_t& get(const sbp_msg_t &msg) { - return msg.vel_body; - } - static sbp_msg_vel_body_t& get(sbp_msg_t &msg) { + static const sbp_msg_vel_body_t &get(const sbp_msg_t &msg) { return msg.vel_body; } - static void to_sbp_msg(const sbp_msg_vel_body_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_vel_body_t &get(sbp_msg_t &msg) { return msg.vel_body; } + static void to_sbp_msg(const sbp_msg_vel_body_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->vel_body = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_vel_body_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_vel_body_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_body = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_vel_body_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_vel_body_t &msg, sbp_write_fn_t write) { return sbp_msg_vel_body_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_body_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_body_t &msg) { return sbp_msg_vel_body_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_body_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_body_t *msg) { return sbp_msg_vel_body_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_vel_body_t &msg) { @@ -7237,31 +8087,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgVelCog; static constexpr const char *name = "MSG_VEL_COG"; - static const sbp_msg_vel_cog_t& get(const sbp_msg_t &msg) { - return msg.vel_cog; - } - static sbp_msg_vel_cog_t& get(sbp_msg_t &msg) { + static const sbp_msg_vel_cog_t &get(const sbp_msg_t &msg) { return msg.vel_cog; } - static void to_sbp_msg(const sbp_msg_vel_cog_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_vel_cog_t &get(sbp_msg_t &msg) { return msg.vel_cog; } + static void to_sbp_msg(const sbp_msg_vel_cog_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->vel_cog = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_vel_cog_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_vel_cog_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_cog = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_vel_cog_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_vel_cog_t &msg, sbp_write_fn_t write) { return sbp_msg_vel_cog_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_cog_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_cog_t &msg) { return sbp_msg_vel_cog_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_cog_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_cog_t *msg) { return sbp_msg_vel_cog_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_vel_cog_t &msg) { @@ -7269,40 +8120,46 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgVelEcefCovGnss; static constexpr const char *name = "MSG_VEL_ECEF_COV_GNSS"; - static const sbp_msg_vel_ecef_cov_gnss_t& get(const sbp_msg_t &msg) { + static const sbp_msg_vel_ecef_cov_gnss_t &get(const sbp_msg_t &msg) { return msg.vel_ecef_cov_gnss; } - static sbp_msg_vel_ecef_cov_gnss_t& get(sbp_msg_t &msg) { + static sbp_msg_vel_ecef_cov_gnss_t &get(sbp_msg_t &msg) { return msg.vel_ecef_cov_gnss; } - static void to_sbp_msg(const sbp_msg_vel_ecef_cov_gnss_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_vel_ecef_cov_gnss_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->vel_ecef_cov_gnss = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ecef_cov_gnss_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ecef_cov_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ecef_cov_gnss = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_vel_ecef_cov_gnss_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_vel_ecef_cov_gnss_t &msg, sbp_write_fn_t write) { return sbp_msg_vel_ecef_cov_gnss_send(state, sender_id, &msg, write); } - static sbp_msg_vel_ecef_cov_gnss_t to_gnss(const sbp_msg_vel_ecef_cov_gnss_t& msg) { + static sbp_msg_vel_ecef_cov_gnss_t to_gnss( + const sbp_msg_vel_ecef_cov_gnss_t &msg) { return msg; } - static sbp_msg_vel_ecef_cov_t to_non_gnss(const sbp_msg_vel_ecef_cov_gnss_t& msg){ + static sbp_msg_vel_ecef_cov_t to_non_gnss( + const sbp_msg_vel_ecef_cov_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ecef_cov_gnss = msg; return sbp_msg.vel_ecef_cov; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ecef_cov_gnss_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ecef_cov_gnss_t &msg) { return sbp_msg_vel_ecef_cov_gnss_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ecef_cov_gnss_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ecef_cov_gnss_t *msg) { return sbp_msg_vel_ecef_cov_gnss_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_vel_ecef_cov_gnss_t &msg) { @@ -7310,40 +8167,45 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgVelEcefCov; static constexpr const char *name = "MSG_VEL_ECEF_COV"; - static const sbp_msg_vel_ecef_cov_t& get(const sbp_msg_t &msg) { + static const sbp_msg_vel_ecef_cov_t &get(const sbp_msg_t &msg) { return msg.vel_ecef_cov; } - static sbp_msg_vel_ecef_cov_t& get(sbp_msg_t &msg) { + static sbp_msg_vel_ecef_cov_t &get(sbp_msg_t &msg) { return msg.vel_ecef_cov; } - static void to_sbp_msg(const sbp_msg_vel_ecef_cov_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_vel_ecef_cov_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->vel_ecef_cov = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ecef_cov_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ecef_cov_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ecef_cov = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_vel_ecef_cov_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_vel_ecef_cov_t &msg, sbp_write_fn_t write) { return sbp_msg_vel_ecef_cov_send(state, sender_id, &msg, write); } - static sbp_msg_vel_ecef_cov_gnss_t to_gnss(const sbp_msg_vel_ecef_cov_t& msg){ + static sbp_msg_vel_ecef_cov_gnss_t to_gnss( + const sbp_msg_vel_ecef_cov_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ecef_cov = msg; return sbp_msg.vel_ecef_cov_gnss; } - static sbp_msg_vel_ecef_cov_t to_non_gnss(const sbp_msg_vel_ecef_cov_t& msg) { + static sbp_msg_vel_ecef_cov_t to_non_gnss(const sbp_msg_vel_ecef_cov_t &msg) { return msg; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ecef_cov_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ecef_cov_t &msg) { return sbp_msg_vel_ecef_cov_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ecef_cov_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ecef_cov_t *msg) { return sbp_msg_vel_ecef_cov_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_vel_ecef_cov_t &msg) { @@ -7351,31 +8213,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgVelEcefDepA; static constexpr const char *name = "MSG_VEL_ECEF_DEP_A"; - static const sbp_msg_vel_ecef_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_vel_ecef_dep_a_t &get(const sbp_msg_t &msg) { return msg.vel_ecef_dep_a; } - static sbp_msg_vel_ecef_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_vel_ecef_dep_a_t &get(sbp_msg_t &msg) { return msg.vel_ecef_dep_a; } - static void to_sbp_msg(const sbp_msg_vel_ecef_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_vel_ecef_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->vel_ecef_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ecef_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ecef_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ecef_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_vel_ecef_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_vel_ecef_dep_a_t &msg, sbp_write_fn_t write) { return sbp_msg_vel_ecef_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ecef_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ecef_dep_a_t &msg) { return sbp_msg_vel_ecef_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ecef_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ecef_dep_a_t *msg) { return sbp_msg_vel_ecef_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_vel_ecef_dep_a_t &msg) { @@ -7383,40 +8249,44 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgVelEcefGnss; static constexpr const char *name = "MSG_VEL_ECEF_GNSS"; - static const sbp_msg_vel_ecef_gnss_t& get(const sbp_msg_t &msg) { + static const sbp_msg_vel_ecef_gnss_t &get(const sbp_msg_t &msg) { return msg.vel_ecef_gnss; } - static sbp_msg_vel_ecef_gnss_t& get(sbp_msg_t &msg) { + static sbp_msg_vel_ecef_gnss_t &get(sbp_msg_t &msg) { return msg.vel_ecef_gnss; } - static void to_sbp_msg(const sbp_msg_vel_ecef_gnss_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_vel_ecef_gnss_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->vel_ecef_gnss = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ecef_gnss_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ecef_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ecef_gnss = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_vel_ecef_gnss_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_vel_ecef_gnss_t &msg, sbp_write_fn_t write) { return sbp_msg_vel_ecef_gnss_send(state, sender_id, &msg, write); } - static sbp_msg_vel_ecef_gnss_t to_gnss(const sbp_msg_vel_ecef_gnss_t& msg) { + static sbp_msg_vel_ecef_gnss_t to_gnss(const sbp_msg_vel_ecef_gnss_t &msg) { return msg; } - static sbp_msg_vel_ecef_t to_non_gnss(const sbp_msg_vel_ecef_gnss_t& msg){ + static sbp_msg_vel_ecef_t to_non_gnss(const sbp_msg_vel_ecef_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ecef_gnss = msg; return sbp_msg.vel_ecef; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ecef_gnss_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ecef_gnss_t &msg) { return sbp_msg_vel_ecef_gnss_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ecef_gnss_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ecef_gnss_t *msg) { return sbp_msg_vel_ecef_gnss_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_vel_ecef_gnss_t &msg) { @@ -7424,40 +8294,41 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgVelEcef; static constexpr const char *name = "MSG_VEL_ECEF"; - static const sbp_msg_vel_ecef_t& get(const sbp_msg_t &msg) { - return msg.vel_ecef; - } - static sbp_msg_vel_ecef_t& get(sbp_msg_t &msg) { + static const sbp_msg_vel_ecef_t &get(const sbp_msg_t &msg) { return msg.vel_ecef; } - static void to_sbp_msg(const sbp_msg_vel_ecef_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_vel_ecef_t &get(sbp_msg_t &msg) { return msg.vel_ecef; } + static void to_sbp_msg(const sbp_msg_vel_ecef_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->vel_ecef = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ecef_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ecef_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ecef = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_vel_ecef_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_vel_ecef_t &msg, sbp_write_fn_t write) { return sbp_msg_vel_ecef_send(state, sender_id, &msg, write); } - static sbp_msg_vel_ecef_gnss_t to_gnss(const sbp_msg_vel_ecef_t& msg){ + static sbp_msg_vel_ecef_gnss_t to_gnss(const sbp_msg_vel_ecef_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ecef = msg; return sbp_msg.vel_ecef_gnss; } - static sbp_msg_vel_ecef_t to_non_gnss(const sbp_msg_vel_ecef_t& msg) { + static sbp_msg_vel_ecef_t to_non_gnss(const sbp_msg_vel_ecef_t &msg) { return msg; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ecef_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ecef_t &msg) { return sbp_msg_vel_ecef_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ecef_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ecef_t *msg) { return sbp_msg_vel_ecef_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_vel_ecef_t &msg) { @@ -7465,40 +8336,46 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgVelNedCovGnss; static constexpr const char *name = "MSG_VEL_NED_COV_GNSS"; - static const sbp_msg_vel_ned_cov_gnss_t& get(const sbp_msg_t &msg) { + static const sbp_msg_vel_ned_cov_gnss_t &get(const sbp_msg_t &msg) { return msg.vel_ned_cov_gnss; } - static sbp_msg_vel_ned_cov_gnss_t& get(sbp_msg_t &msg) { + static sbp_msg_vel_ned_cov_gnss_t &get(sbp_msg_t &msg) { return msg.vel_ned_cov_gnss; } - static void to_sbp_msg(const sbp_msg_vel_ned_cov_gnss_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_vel_ned_cov_gnss_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->vel_ned_cov_gnss = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ned_cov_gnss_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ned_cov_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ned_cov_gnss = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_vel_ned_cov_gnss_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_vel_ned_cov_gnss_t &msg, sbp_write_fn_t write) { return sbp_msg_vel_ned_cov_gnss_send(state, sender_id, &msg, write); } - static sbp_msg_vel_ned_cov_gnss_t to_gnss(const sbp_msg_vel_ned_cov_gnss_t& msg) { + static sbp_msg_vel_ned_cov_gnss_t to_gnss( + const sbp_msg_vel_ned_cov_gnss_t &msg) { return msg; } - static sbp_msg_vel_ned_cov_t to_non_gnss(const sbp_msg_vel_ned_cov_gnss_t& msg){ + static sbp_msg_vel_ned_cov_t to_non_gnss( + const sbp_msg_vel_ned_cov_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ned_cov_gnss = msg; return sbp_msg.vel_ned_cov; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ned_cov_gnss_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ned_cov_gnss_t &msg) { return sbp_msg_vel_ned_cov_gnss_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ned_cov_gnss_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ned_cov_gnss_t *msg) { return sbp_msg_vel_ned_cov_gnss_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_vel_ned_cov_gnss_t &msg) { @@ -7506,40 +8383,41 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgVelNedCov; static constexpr const char *name = "MSG_VEL_NED_COV"; - static const sbp_msg_vel_ned_cov_t& get(const sbp_msg_t &msg) { - return msg.vel_ned_cov; - } - static sbp_msg_vel_ned_cov_t& get(sbp_msg_t &msg) { + static const sbp_msg_vel_ned_cov_t &get(const sbp_msg_t &msg) { return msg.vel_ned_cov; } - static void to_sbp_msg(const sbp_msg_vel_ned_cov_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_vel_ned_cov_t &get(sbp_msg_t &msg) { return msg.vel_ned_cov; } + static void to_sbp_msg(const sbp_msg_vel_ned_cov_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->vel_ned_cov = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ned_cov_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ned_cov_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ned_cov = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_vel_ned_cov_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_vel_ned_cov_t &msg, sbp_write_fn_t write) { return sbp_msg_vel_ned_cov_send(state, sender_id, &msg, write); } - static sbp_msg_vel_ned_cov_gnss_t to_gnss(const sbp_msg_vel_ned_cov_t& msg){ + static sbp_msg_vel_ned_cov_gnss_t to_gnss(const sbp_msg_vel_ned_cov_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ned_cov = msg; return sbp_msg.vel_ned_cov_gnss; } - static sbp_msg_vel_ned_cov_t to_non_gnss(const sbp_msg_vel_ned_cov_t& msg) { + static sbp_msg_vel_ned_cov_t to_non_gnss(const sbp_msg_vel_ned_cov_t &msg) { return msg; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ned_cov_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ned_cov_t &msg) { return sbp_msg_vel_ned_cov_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ned_cov_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ned_cov_t *msg) { return sbp_msg_vel_ned_cov_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_vel_ned_cov_t &msg) { @@ -7547,31 +8425,35 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgVelNedDepA; static constexpr const char *name = "MSG_VEL_NED_DEP_A"; - static const sbp_msg_vel_ned_dep_a_t& get(const sbp_msg_t &msg) { + static const sbp_msg_vel_ned_dep_a_t &get(const sbp_msg_t &msg) { return msg.vel_ned_dep_a; } - static sbp_msg_vel_ned_dep_a_t& get(sbp_msg_t &msg) { + static sbp_msg_vel_ned_dep_a_t &get(sbp_msg_t &msg) { return msg.vel_ned_dep_a; } - static void to_sbp_msg(const sbp_msg_vel_ned_dep_a_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_vel_ned_dep_a_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->vel_ned_dep_a = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ned_dep_a_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ned_dep_a_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ned_dep_a = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_vel_ned_dep_a_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_vel_ned_dep_a_t &msg, sbp_write_fn_t write) { return sbp_msg_vel_ned_dep_a_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ned_dep_a_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ned_dep_a_t &msg) { return sbp_msg_vel_ned_dep_a_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ned_dep_a_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ned_dep_a_t *msg) { return sbp_msg_vel_ned_dep_a_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_vel_ned_dep_a_t &msg) { @@ -7579,40 +8461,44 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgVelNedGnss; static constexpr const char *name = "MSG_VEL_NED_GNSS"; - static const sbp_msg_vel_ned_gnss_t& get(const sbp_msg_t &msg) { + static const sbp_msg_vel_ned_gnss_t &get(const sbp_msg_t &msg) { return msg.vel_ned_gnss; } - static sbp_msg_vel_ned_gnss_t& get(sbp_msg_t &msg) { + static sbp_msg_vel_ned_gnss_t &get(sbp_msg_t &msg) { return msg.vel_ned_gnss; } - static void to_sbp_msg(const sbp_msg_vel_ned_gnss_t& msg, sbp_msg_t *sbp_msg) { + static void to_sbp_msg(const sbp_msg_vel_ned_gnss_t &msg, + sbp_msg_t *sbp_msg) { sbp_msg->vel_ned_gnss = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ned_gnss_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ned_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ned_gnss = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_vel_ned_gnss_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_vel_ned_gnss_t &msg, sbp_write_fn_t write) { return sbp_msg_vel_ned_gnss_send(state, sender_id, &msg, write); } - static sbp_msg_vel_ned_gnss_t to_gnss(const sbp_msg_vel_ned_gnss_t& msg) { + static sbp_msg_vel_ned_gnss_t to_gnss(const sbp_msg_vel_ned_gnss_t &msg) { return msg; } - static sbp_msg_vel_ned_t to_non_gnss(const sbp_msg_vel_ned_gnss_t& msg){ + static sbp_msg_vel_ned_t to_non_gnss(const sbp_msg_vel_ned_gnss_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ned_gnss = msg; return sbp_msg.vel_ned; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ned_gnss_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ned_gnss_t &msg) { return sbp_msg_vel_ned_gnss_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ned_gnss_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ned_gnss_t *msg) { return sbp_msg_vel_ned_gnss_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_vel_ned_gnss_t &msg) { @@ -7620,40 +8506,41 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgVelNed; static constexpr const char *name = "MSG_VEL_NED"; - static const sbp_msg_vel_ned_t& get(const sbp_msg_t &msg) { - return msg.vel_ned; - } - static sbp_msg_vel_ned_t& get(sbp_msg_t &msg) { + static const sbp_msg_vel_ned_t &get(const sbp_msg_t &msg) { return msg.vel_ned; } - static void to_sbp_msg(const sbp_msg_vel_ned_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_vel_ned_t &get(sbp_msg_t &msg) { return msg.vel_ned; } + static void to_sbp_msg(const sbp_msg_vel_ned_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->vel_ned = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ned_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_vel_ned_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ned = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_vel_ned_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_vel_ned_t &msg, sbp_write_fn_t write) { return sbp_msg_vel_ned_send(state, sender_id, &msg, write); } - static sbp_msg_vel_ned_gnss_t to_gnss(const sbp_msg_vel_ned_t& msg){ + static sbp_msg_vel_ned_gnss_t to_gnss(const sbp_msg_vel_ned_t &msg) { sbp_msg_t sbp_msg; sbp_msg.vel_ned = msg; return sbp_msg.vel_ned_gnss; } - static sbp_msg_vel_ned_t to_non_gnss(const sbp_msg_vel_ned_t& msg) { + static sbp_msg_vel_ned_t to_non_gnss(const sbp_msg_vel_ned_t &msg) { return msg; } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ned_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ned_t &msg) { return sbp_msg_vel_ned_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ned_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ned_t *msg) { return sbp_msg_vel_ned_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_vel_ned_t &msg) { @@ -7661,31 +8548,32 @@ struct MessageTraits { } }; -template<> +template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgWheeltick; static constexpr const char *name = "MSG_WHEELTICK"; - static const sbp_msg_wheeltick_t& get(const sbp_msg_t &msg) { - return msg.wheeltick; - } - static sbp_msg_wheeltick_t& get(sbp_msg_t &msg) { + static const sbp_msg_wheeltick_t &get(const sbp_msg_t &msg) { return msg.wheeltick; } - static void to_sbp_msg(const sbp_msg_wheeltick_t& msg, sbp_msg_t *sbp_msg) { + static sbp_msg_wheeltick_t &get(sbp_msg_t &msg) { return msg.wheeltick; } + static void to_sbp_msg(const sbp_msg_wheeltick_t &msg, sbp_msg_t *sbp_msg) { sbp_msg->wheeltick = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_wheeltick_t& msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_wheeltick_t &msg) { sbp_msg_t sbp_msg; sbp_msg.wheeltick = msg; return sbp_msg; } - static s8 send(sbp_state_t *state, u16 sender_id, const sbp_msg_wheeltick_t &msg, sbp_write_fn_t write) { + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_wheeltick_t &msg, sbp_write_fn_t write) { return sbp_msg_wheeltick_send(state, sender_id, &msg, write); } - static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_wheeltick_t &msg){ + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_wheeltick_t &msg) { return sbp_msg_wheeltick_encode(buf, len, n_written, &msg); } - static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_wheeltick_t *msg){ + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_wheeltick_t *msg) { return sbp_msg_wheeltick_decode(buf, len, n_read, msg); } static size_t encoded_len(const sbp_msg_wheeltick_t &msg) { @@ -7693,7 +8581,6 @@ struct MessageTraits { } }; +} // namespace sbp -} // namespace sbp - -#endif //LIBSBP_CPP_MESSAGE_TRAITS_H +#endif // LIBSBP_CPP_MESSAGE_TRAITS_H diff --git a/c/include/libsbp/ext_events/MSG_EXT_EVENT.h b/c/include/libsbp/ext_events/MSG_EXT_EVENT.h index 8347827c8..d0ede1f76 100644 --- a/c/include/libsbp/ext_events/MSG_EXT_EVENT.h +++ b/c/include/libsbp/ext_events/MSG_EXT_EVENT.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_EXT_EVENTS_MSG_EXT_EVENT_H #define LIBSBP_EXT_EVENTS_MSG_EXT_EVENT_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,51 +40,45 @@ *****************************************************************************/ /** Reports timestamped external pin event * -* Reports detection of an external event, the GPS time it occurred, which pin it was and whether it was rising or falling. + * Reports detection of an external event, the GPS time it occurred, which pin + * it was and whether it was rising or falling. */ typedef struct { - - /** -* GPS week number [weeks] + * GPS week number [weeks] */ u16 wn; - /** -* GPS time of week rounded to the nearest millisecond [ms] + * GPS time of week rounded to the nearest millisecond [ms] */ u32 tow; - /** - * Nanosecond residual of millisecond-rounded TOW (ranges from -500000 to 500000) [ns] + * Nanosecond residual of millisecond-rounded TOW (ranges from -500000 to + * 500000) [ns] */ s32 ns_residual; - /** -* Flags + * Flags */ u8 flags; - /** -* Pin number. 0..9 = DEBUG0..9. + * Pin number. 0..9 = DEBUG0..9. */ u8 pin; } sbp_msg_ext_event_t; - - /** * Get encoded size of an instance of sbp_msg_ext_event_t * * @param msg sbp_msg_ext_event_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ext_event_encoded_len(const sbp_msg_ext_event_t *msg) -{ +static inline size_t sbp_msg_ext_event_encoded_len( + const sbp_msg_ext_event_t *msg) { (void)msg; return SBP_MSG_EXT_EVENT_ENCODED_LEN; } @@ -92,36 +86,53 @@ static inline size_t sbp_msg_ext_event_encoded_len(const sbp_msg_ext_event_t *ms /** * Encode an instance of sbp_msg_ext_event_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ext_event_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ext_event_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ext_event_t *msg); +SBP_EXPORT s8 sbp_msg_ext_event_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_ext_event_t *msg); /** * Decode an instance of sbp_msg_ext_event_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ext_event_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ext_event_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ext_event_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ext_event_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ext_event_t *msg); +SBP_EXPORT s8 sbp_msg_ext_event_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ext_event_t *msg); /** * Send an instance of sbp_msg_ext_event_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ext_event_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ext_event_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -129,51 +140,61 @@ SBP_EXPORT s8 sbp_msg_ext_event_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ext_event_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ext_event_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ext_event_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ext_event_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ext_event_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ext_event_t instance * @param b sbp_msg_ext_event_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ext_event_cmp(const sbp_msg_ext_event_t *a, const sbp_msg_ext_event_t *b); +SBP_EXPORT int sbp_msg_ext_event_cmp(const sbp_msg_ext_event_t *a, + const sbp_msg_ext_event_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ext_event_t &lhs, const sbp_msg_ext_event_t &rhs) { +static inline bool operator==(const sbp_msg_ext_event_t &lhs, + const sbp_msg_ext_event_t &rhs) { return sbp_msg_ext_event_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ext_event_t &lhs, const sbp_msg_ext_event_t &rhs) { +static inline bool operator!=(const sbp_msg_ext_event_t &lhs, + const sbp_msg_ext_event_t &rhs) { return sbp_msg_ext_event_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ext_event_t &lhs, const sbp_msg_ext_event_t &rhs) { +static inline bool operator<(const sbp_msg_ext_event_t &lhs, + const sbp_msg_ext_event_t &rhs) { return sbp_msg_ext_event_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ext_event_t &lhs, const sbp_msg_ext_event_t &rhs) { +static inline bool operator<=(const sbp_msg_ext_event_t &lhs, + const sbp_msg_ext_event_t &rhs) { return sbp_msg_ext_event_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ext_event_t &lhs, const sbp_msg_ext_event_t &rhs) { +static inline bool operator>(const sbp_msg_ext_event_t &lhs, + const sbp_msg_ext_event_t &rhs) { return sbp_msg_ext_event_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ext_event_t &lhs, const sbp_msg_ext_event_t &rhs) { +static inline bool operator>=(const sbp_msg_ext_event_t &lhs, + const sbp_msg_ext_event_t &rhs) { return sbp_msg_ext_event_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_EXT_EVENTS_MSG_EXT_EVENT_H */ - diff --git a/c/include/libsbp/ext_events_macros.h b/c/include/libsbp/ext_events_macros.h index d29050eb4..9637908da 100644 --- a/c/include/libsbp/ext_events_macros.h +++ b/c/include/libsbp/ext_events_macros.h @@ -18,40 +18,41 @@ #ifndef LIBSBP_EXT_EVENTS_MACROS_H #define LIBSBP_EXT_EVENTS_MACROS_H - #define SBP_MSG_EXT_EVENT 0x0101 #define SBP_EXT_EVENT_TIME_QUALITY_MASK (0x1u) #define SBP_EXT_EVENT_TIME_QUALITY_SHIFT (1u) -#define SBP_EXT_EVENT_TIME_QUALITY_GET(flags) \ - ((u8)((u8)((flags) >> SBP_EXT_EVENT_TIME_QUALITY_SHIFT) \ - & SBP_EXT_EVENT_TIME_QUALITY_MASK)) -#define SBP_EXT_EVENT_TIME_QUALITY_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_EXT_EVENT_TIME_QUALITY_MASK << SBP_EXT_EVENT_TIME_QUALITY_SHIFT))) | \ - (((val) & (SBP_EXT_EVENT_TIME_QUALITY_MASK)) \ - << (SBP_EXT_EVENT_TIME_QUALITY_SHIFT)));} while(0) - +#define SBP_EXT_EVENT_TIME_QUALITY_GET(flags) \ + ((u8)((u8)((flags) >> SBP_EXT_EVENT_TIME_QUALITY_SHIFT) & \ + SBP_EXT_EVENT_TIME_QUALITY_MASK)) +#define SBP_EXT_EVENT_TIME_QUALITY_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_EXT_EVENT_TIME_QUALITY_MASK \ + << SBP_EXT_EVENT_TIME_QUALITY_SHIFT))) | \ + (((val) & (SBP_EXT_EVENT_TIME_QUALITY_MASK)) \ + << (SBP_EXT_EVENT_TIME_QUALITY_SHIFT))); \ + } while (0) #define SBP_EXT_EVENT_TIME_QUALITY_UNKNOWN_DONT_HAVE_NAV_SOLUTION (0) #define SBP_EXT_EVENT_TIME_QUALITY_GOOD (1) #define SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_MASK (0x1u) #define SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_SHIFT (0u) -#define SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_GET(flags) \ - ((u8)((u8)((flags) >> SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_SHIFT) \ - & SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_MASK)) -#define SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_MASK << SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_SHIFT))) | \ - (((val) & (SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_MASK)) \ - << (SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_SHIFT)));} while(0) - +#define SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_GET(flags) \ + ((u8)((u8)((flags) >> SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_SHIFT) & \ + SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_MASK)) +#define SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_MASK \ + << SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_SHIFT))) | \ + (((val) & (SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_MASK)) \ + << (SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_SHIFT))); \ + } while (0) #define SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_LOW (0) #define SBP_EXT_EVENT_NEW_LEVEL_OF_PIN_HIGH (1) /** - * Encoded length of sbp_msg_ext_event_t (V4 API) and + * Encoded length of sbp_msg_ext_event_t (V4 API) and * msg_ext_event_t (legacy API) */ #define SBP_MSG_EXT_EVENT_ENCODED_LEN 12u - - #endif /* LIBSBP_EXT_EVENTS_MACROS_H */ diff --git a/c/include/libsbp/file_io.h b/c/include/libsbp/file_io.h index 1d6336f3e..252fcb605 100644 --- a/c/include/libsbp/file_io.h +++ b/c/include/libsbp/file_io.h @@ -17,14 +17,14 @@ #ifndef LIBSBP_FILE_IO_MESSAGES_H #define LIBSBP_FILE_IO_MESSAGES_H -#include -#include +#include +#include #include #include +#include +#include #include #include #include -#include -#include #endif /* LIBSBP_FILE_IO_MESSAGES_H */ diff --git a/c/include/libsbp/file_io/MSG_FILEIO_CONFIG_REQ.h b/c/include/libsbp/file_io/MSG_FILEIO_CONFIG_REQ.h index a883920e0..7284b6998 100644 --- a/c/include/libsbp/file_io/MSG_FILEIO_CONFIG_REQ.h +++ b/c/include/libsbp/file_io/MSG_FILEIO_CONFIG_REQ.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FILE_IO_MSG_FILEIO_CONFIG_REQ_H #define LIBSBP_FILE_IO_MSG_FILEIO_CONFIG_REQ_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,27 +40,25 @@ *****************************************************************************/ /** Request advice on the optimal configuration for FileIO * -* Requests advice on the optimal configuration for a FileIO transfer. Newer version of FileIO can support greater throughput by supporting a large window of FileIO data that can be in-flight during read or write operations. + * Requests advice on the optimal configuration for a FileIO transfer. Newer + * version of FileIO can support greater throughput by supporting a large window + * of FileIO data that can be in-flight during read or write operations. */ typedef struct { - - /** -* Advice sequence number + * Advice sequence number */ u32 sequence; } sbp_msg_fileio_config_req_t; - - /** * Get encoded size of an instance of sbp_msg_fileio_config_req_t * * @param msg sbp_msg_fileio_config_req_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_fileio_config_req_encoded_len(const sbp_msg_fileio_config_req_t *msg) -{ +static inline size_t sbp_msg_fileio_config_req_encoded_len( + const sbp_msg_fileio_config_req_t *msg) { (void)msg; return SBP_MSG_FILEIO_CONFIG_REQ_ENCODED_LEN; } @@ -68,36 +66,53 @@ static inline size_t sbp_msg_fileio_config_req_encoded_len(const sbp_msg_fileio_ /** * Encode an instance of sbp_msg_fileio_config_req_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_fileio_config_req_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_config_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_config_req_t *msg); +SBP_EXPORT s8 +sbp_msg_fileio_config_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_config_req_t *msg); /** * Decode an instance of sbp_msg_fileio_config_req_t from wire representation * - * This function decodes the wire representation of a sbp_msg_fileio_config_req_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_fileio_config_req_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_fileio_config_req_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_config_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_config_req_t *msg); +SBP_EXPORT s8 sbp_msg_fileio_config_req_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fileio_config_req_t *msg); /** * Send an instance of sbp_msg_fileio_config_req_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_fileio_config_req_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_fileio_config_req_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -105,51 +120,61 @@ SBP_EXPORT s8 sbp_msg_fileio_config_req_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_config_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_config_req_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_fileio_config_req_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_config_req_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_fileio_config_req_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_fileio_config_req_t instance * @param b sbp_msg_fileio_config_req_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_fileio_config_req_cmp(const sbp_msg_fileio_config_req_t *a, const sbp_msg_fileio_config_req_t *b); +SBP_EXPORT int sbp_msg_fileio_config_req_cmp( + const sbp_msg_fileio_config_req_t *a, const sbp_msg_fileio_config_req_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_fileio_config_req_t &lhs, const sbp_msg_fileio_config_req_t &rhs) { +static inline bool operator==(const sbp_msg_fileio_config_req_t &lhs, + const sbp_msg_fileio_config_req_t &rhs) { return sbp_msg_fileio_config_req_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_fileio_config_req_t &lhs, const sbp_msg_fileio_config_req_t &rhs) { +static inline bool operator!=(const sbp_msg_fileio_config_req_t &lhs, + const sbp_msg_fileio_config_req_t &rhs) { return sbp_msg_fileio_config_req_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_fileio_config_req_t &lhs, const sbp_msg_fileio_config_req_t &rhs) { +static inline bool operator<(const sbp_msg_fileio_config_req_t &lhs, + const sbp_msg_fileio_config_req_t &rhs) { return sbp_msg_fileio_config_req_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_fileio_config_req_t &lhs, const sbp_msg_fileio_config_req_t &rhs) { +static inline bool operator<=(const sbp_msg_fileio_config_req_t &lhs, + const sbp_msg_fileio_config_req_t &rhs) { return sbp_msg_fileio_config_req_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_fileio_config_req_t &lhs, const sbp_msg_fileio_config_req_t &rhs) { +static inline bool operator>(const sbp_msg_fileio_config_req_t &lhs, + const sbp_msg_fileio_config_req_t &rhs) { return sbp_msg_fileio_config_req_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_fileio_config_req_t &lhs, const sbp_msg_fileio_config_req_t &rhs) { +static inline bool operator>=(const sbp_msg_fileio_config_req_t &lhs, + const sbp_msg_fileio_config_req_t &rhs) { return sbp_msg_fileio_config_req_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FILE_IO_MSG_FILEIO_CONFIG_REQ_H */ - diff --git a/c/include/libsbp/file_io/MSG_FILEIO_CONFIG_RESP.h b/c/include/libsbp/file_io/MSG_FILEIO_CONFIG_RESP.h index f1657ae45..7aca194f7 100644 --- a/c/include/libsbp/file_io/MSG_FILEIO_CONFIG_RESP.h +++ b/c/include/libsbp/file_io/MSG_FILEIO_CONFIG_RESP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FILE_IO_MSG_FILEIO_CONFIG_RESP_H #define LIBSBP_FILE_IO_MSG_FILEIO_CONFIG_RESP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,45 +41,40 @@ /** Response with advice on the optimal configuration for FileIO. * -* The advice on the optimal configuration for a FileIO transfer. Newer version of FileIO can support greater throughput by supporting a large window of FileIO data that can be in-flight during read or write operations. +* The advice on the optimal configuration for a FileIO transfer. Newer version +of FileIO can support greater throughput by supporting a large window of FileIO +data that can be in-flight during read or write operations. */ typedef struct { - - /** -* Advice sequence number + * Advice sequence number */ u32 sequence; - /** -* The number of SBP packets in the data in-flight window + * The number of SBP packets in the data in-flight window */ u32 window_size; - /** -* The number of SBP packets sent in one PDU + * The number of SBP packets sent in one PDU */ u32 batch_size; - /** -* The version of FileIO that is supported + * The version of FileIO that is supported */ u32 fileio_version; } sbp_msg_fileio_config_resp_t; - - /** * Get encoded size of an instance of sbp_msg_fileio_config_resp_t * * @param msg sbp_msg_fileio_config_resp_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_fileio_config_resp_encoded_len(const sbp_msg_fileio_config_resp_t *msg) -{ +static inline size_t sbp_msg_fileio_config_resp_encoded_len( + const sbp_msg_fileio_config_resp_t *msg) { (void)msg; return SBP_MSG_FILEIO_CONFIG_RESP_ENCODED_LEN; } @@ -87,36 +82,54 @@ static inline size_t sbp_msg_fileio_config_resp_encoded_len(const sbp_msg_fileio /** * Encode an instance of sbp_msg_fileio_config_resp_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_fileio_config_resp_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_config_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_config_resp_t *msg); +SBP_EXPORT s8 +sbp_msg_fileio_config_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_config_resp_t *msg); /** * Decode an instance of sbp_msg_fileio_config_resp_t from wire representation * - * This function decodes the wire representation of a sbp_msg_fileio_config_resp_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_fileio_config_resp_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_fileio_config_resp_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_config_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_config_resp_t *msg); +SBP_EXPORT s8 sbp_msg_fileio_config_resp_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fileio_config_resp_t *msg); /** - * Send an instance of sbp_msg_fileio_config_resp_t with the given write function + * Send an instance of sbp_msg_fileio_config_resp_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_fileio_config_resp_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_fileio_config_resp_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -124,51 +137,62 @@ SBP_EXPORT s8 sbp_msg_fileio_config_resp_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_config_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_config_resp_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_fileio_config_resp_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_config_resp_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_fileio_config_resp_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_fileio_config_resp_t instance * @param b sbp_msg_fileio_config_resp_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_fileio_config_resp_cmp(const sbp_msg_fileio_config_resp_t *a, const sbp_msg_fileio_config_resp_t *b); +SBP_EXPORT int sbp_msg_fileio_config_resp_cmp( + const sbp_msg_fileio_config_resp_t *a, + const sbp_msg_fileio_config_resp_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_fileio_config_resp_t &lhs, const sbp_msg_fileio_config_resp_t &rhs) { +static inline bool operator==(const sbp_msg_fileio_config_resp_t &lhs, + const sbp_msg_fileio_config_resp_t &rhs) { return sbp_msg_fileio_config_resp_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_fileio_config_resp_t &lhs, const sbp_msg_fileio_config_resp_t &rhs) { +static inline bool operator!=(const sbp_msg_fileio_config_resp_t &lhs, + const sbp_msg_fileio_config_resp_t &rhs) { return sbp_msg_fileio_config_resp_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_fileio_config_resp_t &lhs, const sbp_msg_fileio_config_resp_t &rhs) { +static inline bool operator<(const sbp_msg_fileio_config_resp_t &lhs, + const sbp_msg_fileio_config_resp_t &rhs) { return sbp_msg_fileio_config_resp_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_fileio_config_resp_t &lhs, const sbp_msg_fileio_config_resp_t &rhs) { +static inline bool operator<=(const sbp_msg_fileio_config_resp_t &lhs, + const sbp_msg_fileio_config_resp_t &rhs) { return sbp_msg_fileio_config_resp_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_fileio_config_resp_t &lhs, const sbp_msg_fileio_config_resp_t &rhs) { +static inline bool operator>(const sbp_msg_fileio_config_resp_t &lhs, + const sbp_msg_fileio_config_resp_t &rhs) { return sbp_msg_fileio_config_resp_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_fileio_config_resp_t &lhs, const sbp_msg_fileio_config_resp_t &rhs) { +static inline bool operator>=(const sbp_msg_fileio_config_resp_t &lhs, + const sbp_msg_fileio_config_resp_t &rhs) { return sbp_msg_fileio_config_resp_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FILE_IO_MSG_FILEIO_CONFIG_RESP_H */ - diff --git a/c/include/libsbp/file_io/MSG_FILEIO_READ_DIR_REQ.h b/c/include/libsbp/file_io/MSG_FILEIO_READ_DIR_REQ.h index 55c0840b9..6b69516d0 100644 --- a/c/include/libsbp/file_io/MSG_FILEIO_READ_DIR_REQ.h +++ b/c/include/libsbp/file_io/MSG_FILEIO_READ_DIR_REQ.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FILE_IO_MSG_FILEIO_READ_DIR_REQ_H #define LIBSBP_FILE_IO_MSG_FILEIO_READ_DIR_REQ_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,197 +40,225 @@ *****************************************************************************/ /** List files in a directory (host => device) * -* The read directory message lists the files in a directory on the device's onboard flash file system. The offset parameter can be used to skip the first n elements of the file list. Returns a MSG_FILEIO_READ_DIR_RESP message containing the directory listings as a NULL delimited list. The listing is chunked over multiple SBP packets. The sequence number in the request will be returned in the response. If message is invalid, a followup MSG_PRINT message will print "Invalid fileio read message". A device will only respond to this message when it is received from sender ID 0x42. + * The read directory message lists the files in a directory on the device's + * onboard flash file system. The offset parameter can be used to skip the + * first n elements of the file list. Returns a MSG_FILEIO_READ_DIR_RESP message + * containing the directory listings as a NULL delimited list. The listing is + * chunked over multiple SBP packets. The sequence number in the request will be + * returned in the response. If message is invalid, a followup MSG_PRINT + * message will print "Invalid fileio read message". A device will only respond + * to this message when it is received from sender ID 0x42. */ typedef struct { - - /** -* Read sequence number + * Read sequence number */ u32 sequence; - /** - * The offset to skip the first n elements of the file list + * The offset to skip the first n elements of the file list */ u32 offset; - /** -* Name of the directory to list + * Name of the directory to list */ sbp_string_t dirname; } sbp_msg_fileio_read_dir_req_t; +/** + * Initialise sbp_msg_fileio_read_dir_req_t::dirname to empty + * + * @param msg sbp_msg_fileio_read_dir_req_t instance + */ +SBP_EXPORT void sbp_msg_fileio_read_dir_req_dirname_init( + sbp_msg_fileio_read_dir_req_t *msg); - /** - * Initialise sbp_msg_fileio_read_dir_req_t::dirname to empty - * - * @param msg sbp_msg_fileio_read_dir_req_t instance - */ - SBP_EXPORT void sbp_msg_fileio_read_dir_req_dirname_init(sbp_msg_fileio_read_dir_req_t *msg); - - /** - * Test sbp_msg_fileio_read_dir_req_t::dirname for validity - * - * @param msg sbp_msg_fileio_read_dir_req_t instance - * @return true is sbp_msg_fileio_read_dir_req_t::dirname is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_dir_req_dirname_valid(const sbp_msg_fileio_read_dir_req_t *msg); +/** + * Test sbp_msg_fileio_read_dir_req_t::dirname for validity + * + * @param msg sbp_msg_fileio_read_dir_req_t instance + * @return true is sbp_msg_fileio_read_dir_req_t::dirname is valid for encoding + * purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_dir_req_dirname_valid( + const sbp_msg_fileio_read_dir_req_t *msg); - /** - * Tests 2 instances of sbp_msg_fileio_read_dir_req_t::dirname for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_fileio_read_dir_req_t instance - * @param b sbp_msg_fileio_read_dir_req_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_fileio_read_dir_req_dirname_strcmp(const sbp_msg_fileio_read_dir_req_t *a, const sbp_msg_fileio_read_dir_req_t *b); +/** + * Tests 2 instances of sbp_msg_fileio_read_dir_req_t::dirname for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_fileio_read_dir_req_t instance + * @param b sbp_msg_fileio_read_dir_req_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_fileio_read_dir_req_dirname_strcmp( + const sbp_msg_fileio_read_dir_req_t *a, + const sbp_msg_fileio_read_dir_req_t *b); - /** - * Get the encoded size of sbp_msg_fileio_read_dir_req_t::dirname - * - * @param msg sbp_msg_fileio_read_dir_req_t instance - * @return Size of sbp_msg_fileio_read_dir_req_t::dirname in wire representation - */ - SBP_EXPORT size_t sbp_msg_fileio_read_dir_req_dirname_encoded_len(const sbp_msg_fileio_read_dir_req_t *msg); +/** + * Get the encoded size of sbp_msg_fileio_read_dir_req_t::dirname + * + * @param msg sbp_msg_fileio_read_dir_req_t instance + * @return Size of sbp_msg_fileio_read_dir_req_t::dirname in wire representation + */ +SBP_EXPORT size_t sbp_msg_fileio_read_dir_req_dirname_encoded_len( + const sbp_msg_fileio_read_dir_req_t *msg); - /** - * Query sbp_msg_fileio_read_dir_req_t::dirname for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_fileio_read_dir_req_t::dirname before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_fileio_read_dir_req_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_fileio_read_dir_req_dirname_space_remaining(const sbp_msg_fileio_read_dir_req_t *msg); - /** - * Set sbp_msg_fileio_read_dir_req_t::dirname - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_fileio_read_dir_req_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_dir_req_dirname_set(sbp_msg_fileio_read_dir_req_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_fileio_read_dir_req_t::dirname for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_fileio_read_dir_req_t::dirname before it exceeds the maximum + * size of the field in wire representation + * + * @param msg sbp_msg_fileio_read_dir_req_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_fileio_read_dir_req_dirname_space_remaining( + const sbp_msg_fileio_read_dir_req_t *msg); +/** + * Set sbp_msg_fileio_read_dir_req_t::dirname + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_fileio_read_dir_req_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_dir_req_dirname_set( + sbp_msg_fileio_read_dir_req_t *msg, const char *new_str, bool should_trunc, + size_t *n_written); - /** - * Set sbp_msg_fileio_read_dir_req_t::dirname from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_fileio_read_dir_req_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_dir_req_dirname_set_raw(sbp_msg_fileio_read_dir_req_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_fileio_read_dir_req_t::dirname from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_fileio_read_dir_req_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_dir_req_dirname_set_raw( + sbp_msg_fileio_read_dir_req_t *msg, const char *new_buf, size_t new_buf_len, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_fileio_read_dir_req_t::dirname with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_fileio_read_dir_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_dir_req_dirname_printf(sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_fileio_read_dir_req_t::dirname with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_fileio_read_dir_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_dir_req_dirname_printf( + sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_fileio_read_dir_req_t::dirname with printf style formatting - * - * Identical to #sbp_msg_fileio_read_dir_req_dirname_printf except it takes a va_list argument - * - * @param msg sbp_msg_fileio_read_dir_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_dir_req_dirname_vprintf(sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_fileio_read_dir_req_t::dirname with printf style formatting + * + * Identical to #sbp_msg_fileio_read_dir_req_dirname_printf except it takes a + * va_list argument + * + * @param msg sbp_msg_fileio_read_dir_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_dir_req_dirname_vprintf( + sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_fileio_read_dir_req_t::dirname with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_fileio_read_dir_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_dir_req_dirname_append_printf(sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_fileio_read_dir_req_t::dirname with printf style formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_fileio_read_dir_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_dir_req_dirname_append_printf( + sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_fileio_read_dir_req_t::dirname with printf style formatting - * - * Identical to #sbp_msg_fileio_read_dir_req_dirname_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_fileio_read_dir_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_dir_req_dirname_append_vprintf(sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_fileio_read_dir_req_t::dirname with printf style formatting + * + * Identical to #sbp_msg_fileio_read_dir_req_dirname_append_printf except it + * takes a va_list argument + * + * @param msg sbp_msg_fileio_read_dir_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_dir_req_dirname_append_vprintf( + sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_fileio_read_dir_req_t::dirname - * - * @param msg sbp_msg_fileio_read_dir_req_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_fileio_read_dir_req_dirname_get(const sbp_msg_fileio_read_dir_req_t *msg); +/** + * Obtain the string value from sbp_msg_fileio_read_dir_req_t::dirname + * + * @param msg sbp_msg_fileio_read_dir_req_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_fileio_read_dir_req_dirname_get( + const sbp_msg_fileio_read_dir_req_t *msg); - /** - * Obtain the length of sbp_msg_fileio_read_dir_req_t::dirname - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_fileio_read_dir_req_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_fileio_read_dir_req_dirname_strlen(const sbp_msg_fileio_read_dir_req_t *msg); +/** + * Obtain the length of sbp_msg_fileio_read_dir_req_t::dirname + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_fileio_read_dir_req_t instance + * @return Length of string + */ +SBP_EXPORT size_t sbp_msg_fileio_read_dir_req_dirname_strlen( + const sbp_msg_fileio_read_dir_req_t *msg); /** * Get encoded size of an instance of sbp_msg_fileio_read_dir_req_t @@ -238,46 +266,63 @@ typedef struct { * @param msg sbp_msg_fileio_read_dir_req_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_fileio_read_dir_req_encoded_len(const sbp_msg_fileio_read_dir_req_t *msg) -{ - return SBP_MSG_FILEIO_READ_DIR_REQ_ENCODED_OVERHEAD - + sbp_msg_fileio_read_dir_req_dirname_encoded_len(msg) - ; +static inline size_t sbp_msg_fileio_read_dir_req_encoded_len( + const sbp_msg_fileio_read_dir_req_t *msg) { + return SBP_MSG_FILEIO_READ_DIR_REQ_ENCODED_OVERHEAD + + sbp_msg_fileio_read_dir_req_dirname_encoded_len(msg); } /** * Encode an instance of sbp_msg_fileio_read_dir_req_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_fileio_read_dir_req_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_read_dir_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_read_dir_req_t *msg); +SBP_EXPORT s8 sbp_msg_fileio_read_dir_req_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_read_dir_req_t *msg); /** * Decode an instance of sbp_msg_fileio_read_dir_req_t from wire representation * - * This function decodes the wire representation of a sbp_msg_fileio_read_dir_req_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_fileio_read_dir_req_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_fileio_read_dir_req_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_read_dir_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_read_dir_req_t *msg); +SBP_EXPORT s8 sbp_msg_fileio_read_dir_req_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fileio_read_dir_req_t *msg); /** - * Send an instance of sbp_msg_fileio_read_dir_req_t with the given write function + * Send an instance of sbp_msg_fileio_read_dir_req_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_fileio_read_dir_req_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_fileio_read_dir_req_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -285,51 +330,62 @@ SBP_EXPORT s8 sbp_msg_fileio_read_dir_req_decode(const uint8_t *buf, uint8_t len * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_read_dir_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_read_dir_req_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_fileio_read_dir_req_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_read_dir_req_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_fileio_read_dir_req_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_fileio_read_dir_req_t instance * @param b sbp_msg_fileio_read_dir_req_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_fileio_read_dir_req_cmp(const sbp_msg_fileio_read_dir_req_t *a, const sbp_msg_fileio_read_dir_req_t *b); +SBP_EXPORT int sbp_msg_fileio_read_dir_req_cmp( + const sbp_msg_fileio_read_dir_req_t *a, + const sbp_msg_fileio_read_dir_req_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_fileio_read_dir_req_t &lhs, const sbp_msg_fileio_read_dir_req_t &rhs) { +static inline bool operator==(const sbp_msg_fileio_read_dir_req_t &lhs, + const sbp_msg_fileio_read_dir_req_t &rhs) { return sbp_msg_fileio_read_dir_req_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_fileio_read_dir_req_t &lhs, const sbp_msg_fileio_read_dir_req_t &rhs) { +static inline bool operator!=(const sbp_msg_fileio_read_dir_req_t &lhs, + const sbp_msg_fileio_read_dir_req_t &rhs) { return sbp_msg_fileio_read_dir_req_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_fileio_read_dir_req_t &lhs, const sbp_msg_fileio_read_dir_req_t &rhs) { +static inline bool operator<(const sbp_msg_fileio_read_dir_req_t &lhs, + const sbp_msg_fileio_read_dir_req_t &rhs) { return sbp_msg_fileio_read_dir_req_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_fileio_read_dir_req_t &lhs, const sbp_msg_fileio_read_dir_req_t &rhs) { +static inline bool operator<=(const sbp_msg_fileio_read_dir_req_t &lhs, + const sbp_msg_fileio_read_dir_req_t &rhs) { return sbp_msg_fileio_read_dir_req_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_fileio_read_dir_req_t &lhs, const sbp_msg_fileio_read_dir_req_t &rhs) { +static inline bool operator>(const sbp_msg_fileio_read_dir_req_t &lhs, + const sbp_msg_fileio_read_dir_req_t &rhs) { return sbp_msg_fileio_read_dir_req_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_fileio_read_dir_req_t &lhs, const sbp_msg_fileio_read_dir_req_t &rhs) { +static inline bool operator>=(const sbp_msg_fileio_read_dir_req_t &lhs, + const sbp_msg_fileio_read_dir_req_t &rhs) { return sbp_msg_fileio_read_dir_req_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FILE_IO_MSG_FILEIO_READ_DIR_REQ_H */ - diff --git a/c/include/libsbp/file_io/MSG_FILEIO_READ_DIR_RESP.h b/c/include/libsbp/file_io/MSG_FILEIO_READ_DIR_RESP.h index 6c3e6383c..17182fcdb 100644 --- a/c/include/libsbp/file_io/MSG_FILEIO_READ_DIR_RESP.h +++ b/c/include/libsbp/file_io/MSG_FILEIO_READ_DIR_RESP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FILE_IO_MSG_FILEIO_READ_DIR_RESP_H #define LIBSBP_FILE_IO_MSG_FILEIO_READ_DIR_RESP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,178 +40,227 @@ *****************************************************************************/ /** Files listed in a directory (host <= device) * -* The read directory message lists the files in a directory on the device's onboard flash file system. Message contains the directory listings as a NULL delimited list. The listing is chunked over multiple SBP packets and the end of the list is identified by an packet with no entries. The sequence number in the response is preserved from the request. + * The read directory message lists the files in a directory on the device's + * onboard flash file system. Message contains the directory listings as a NULL + * delimited list. The listing is chunked over multiple SBP packets and the end + * of the list is identified by an packet with no entries. The sequence number + * in the response is preserved from the request. */ typedef struct { - - /** -* Read sequence number + * Read sequence number */ u32 sequence; - /** -* Contents of read directory + * Contents of read directory */ sbp_string_t contents; } sbp_msg_fileio_read_dir_resp_t; +/** + * Initialise sbp_msg_fileio_read_dir_resp_t::contents to empty + * + * @param msg sbp_msg_fileio_read_dir_resp_t instance + */ +SBP_EXPORT void sbp_msg_fileio_read_dir_resp_contents_init( + sbp_msg_fileio_read_dir_resp_t *msg); - /** - * Initialise sbp_msg_fileio_read_dir_resp_t::contents to empty - * - * @param msg sbp_msg_fileio_read_dir_resp_t instance - */ - SBP_EXPORT void sbp_msg_fileio_read_dir_resp_contents_init(sbp_msg_fileio_read_dir_resp_t *msg); - - /** - * Test sbp_msg_fileio_read_dir_resp_t::contents for validity - * - * @param msg sbp_msg_fileio_read_dir_resp_t instance - * @return true is sbp_msg_fileio_read_dir_resp_t::contents is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_dir_resp_contents_valid(const sbp_msg_fileio_read_dir_resp_t *msg); +/** + * Test sbp_msg_fileio_read_dir_resp_t::contents for validity + * + * @param msg sbp_msg_fileio_read_dir_resp_t instance + * @return true is sbp_msg_fileio_read_dir_resp_t::contents is valid for + * encoding purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_dir_resp_contents_valid( + const sbp_msg_fileio_read_dir_resp_t *msg); - /** - * Tests 2 instances of sbp_msg_fileio_read_dir_resp_t::contents for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_fileio_read_dir_resp_t instance - * @param b sbp_msg_fileio_read_dir_resp_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_fileio_read_dir_resp_contents_strcmp(const sbp_msg_fileio_read_dir_resp_t *a, const sbp_msg_fileio_read_dir_resp_t *b); +/** + * Tests 2 instances of sbp_msg_fileio_read_dir_resp_t::contents for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_fileio_read_dir_resp_t instance + * @param b sbp_msg_fileio_read_dir_resp_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_fileio_read_dir_resp_contents_strcmp( + const sbp_msg_fileio_read_dir_resp_t *a, + const sbp_msg_fileio_read_dir_resp_t *b); - /** - * Get the encoded size of sbp_msg_fileio_read_dir_resp_t::contents - * - * @param msg sbp_msg_fileio_read_dir_resp_t instance - * @return Size of sbp_msg_fileio_read_dir_resp_t::contents in wire representation - */ - SBP_EXPORT size_t sbp_msg_fileio_read_dir_resp_contents_encoded_len(const sbp_msg_fileio_read_dir_resp_t *msg); +/** + * Get the encoded size of sbp_msg_fileio_read_dir_resp_t::contents + * + * @param msg sbp_msg_fileio_read_dir_resp_t instance + * @return Size of sbp_msg_fileio_read_dir_resp_t::contents in wire + * representation + */ +SBP_EXPORT size_t sbp_msg_fileio_read_dir_resp_contents_encoded_len( + const sbp_msg_fileio_read_dir_resp_t *msg); - /** - * Query sbp_msg_fileio_read_dir_resp_t::contents for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_fileio_read_dir_resp_t::contents before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_fileio_read_dir_resp_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_fileio_read_dir_resp_contents_space_remaining(const sbp_msg_fileio_read_dir_resp_t *msg); - /** - * Return the number of sections in sbp_msg_fileio_read_dir_resp_t::contents - * - * @param msg sbp_msg_fileio_read_dir_resp_t instance - * @return Number of sections in string - */ - SBP_EXPORT size_t sbp_msg_fileio_read_dir_resp_contents_count_sections(const sbp_msg_fileio_read_dir_resp_t *msg); +/** + * Query sbp_msg_fileio_read_dir_resp_t::contents for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_fileio_read_dir_resp_t::contents before it exceeds the + * maximum size of the field in wire representation + * + * @param msg sbp_msg_fileio_read_dir_resp_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_fileio_read_dir_resp_contents_space_remaining( + const sbp_msg_fileio_read_dir_resp_t *msg); +/** + * Return the number of sections in sbp_msg_fileio_read_dir_resp_t::contents + * + * @param msg sbp_msg_fileio_read_dir_resp_t instance + * @return Number of sections in string + */ +SBP_EXPORT size_t sbp_msg_fileio_read_dir_resp_contents_count_sections( + const sbp_msg_fileio_read_dir_resp_t *msg); - /** - * Add a section to sbp_msg_fileio_read_dir_resp_t::contents - * - * The specified string will be appended to the field as a new section. If the new section would end up overflowing the maximum encoded length of this field the string will not be changed and this function will return false - * - * @param msg sbp_msg_fileio_read_dir_resp_t instance - * @param new_str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_dir_resp_contents_add_section(sbp_msg_fileio_read_dir_resp_t *msg, const char *new_str); +/** + * Add a section to sbp_msg_fileio_read_dir_resp_t::contents + * + * The specified string will be appended to the field as a new section. If the + * new section would end up overflowing the maximum encoded length of this field + * the string will not be changed and this function will return false + * + * @param msg sbp_msg_fileio_read_dir_resp_t instance + * @param new_str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_dir_resp_contents_add_section( + sbp_msg_fileio_read_dir_resp_t *msg, const char *new_str); - /** - * Add a section to sbp_msg_fileio_read_dir_resp_t::contents with printf style formatting - * - * A new section will be added to the field according to the specified printf style format string and arguments. If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_fileio_read_dir_resp_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_dir_resp_contents_add_section_printf(sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Add a section to sbp_msg_fileio_read_dir_resp_t::contents with printf style + * formatting + * + * A new section will be added to the field according to the specified printf + * style format string and arguments. If the operation would end up overflowing + * the maximum size of this field in wire encoding the existing contents will be + * unmodified and this function will return false. + * + * @param msg sbp_msg_fileio_read_dir_resp_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_dir_resp_contents_add_section_printf( + sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Add a section to sbp_msg_fileio_read_dir_resp_t::contents with printf style formatting - * - * Identical to #sbp_msg_fileio_read_dir_resp_contents_add_section_printf except it takes a va_list argument - * - * @param msg sbp_msg_fileio_read_dir_resp_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_dir_resp_contents_add_section_vprintf(sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Add a section to sbp_msg_fileio_read_dir_resp_t::contents with printf style + * formatting + * + * Identical to #sbp_msg_fileio_read_dir_resp_contents_add_section_printf except + * it takes a va_list argument + * + * @param msg sbp_msg_fileio_read_dir_resp_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_dir_resp_contents_add_section_vprintf( + sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Append a string to the last section in sbp_msg_fileio_read_dir_resp_t::contents - * - * If the field is currently empty this function will behave exactly like #sbp_msg_fileio_read_dir_resp_contents_add_section - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_fileio_read_dir_resp_t instance - * @param str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_dir_resp_contents_append(sbp_msg_fileio_read_dir_resp_t *msg, const char *str); +/** + * Append a string to the last section in + * sbp_msg_fileio_read_dir_resp_t::contents + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_fileio_read_dir_resp_contents_add_section + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_fileio_read_dir_resp_t instance + * @param str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_dir_resp_contents_append( + sbp_msg_fileio_read_dir_resp_t *msg, const char *str); - /** - * Append a string to the last section in sbp_msg_fileio_read_dir_resp_t::contents with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_fileio_read_dir_resp_contents_add_section_printf - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_fileio_read_dir_resp_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_dir_resp_contents_append_printf(sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Append a string to the last section in + * sbp_msg_fileio_read_dir_resp_t::contents with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_fileio_read_dir_resp_contents_add_section_printf + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_fileio_read_dir_resp_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_dir_resp_contents_append_printf( + sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Append a string to the last section in sbp_msg_fileio_read_dir_resp_t::contents with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_fileio_read_dir_resp_contents_add_section_vprintf - * - * If the field already contains one or more sections the given string will be sppended on to the last section in the string. - * - * If the operation would end overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_fileio_read_dir_resp_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_dir_resp_contents_append_vprintf(sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Append a string to the last section in + * sbp_msg_fileio_read_dir_resp_t::contents with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_fileio_read_dir_resp_contents_add_section_vprintf + * + * If the field already contains one or more sections the given string will be + * sppended on to the last section in the string. + * + * If the operation would end overflowing the maximum size of this field in wire + * encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_fileio_read_dir_resp_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_dir_resp_contents_append_vprintf( + sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Obtain a section from sbp_msg_fileio_read_dir_resp_t::contents - * - * Returns a pointer to the given subsection in the field. Sections are 0-indexed, the \p section parameters must be less than the value returned from #sbp_msg_fileio_read_dir_resp_contents_count_sections. - * - * @param msg sbp_msg_fileio_read_dir_resp_t instance - * @param section Section number - * @return Pointer to C string, NULL on error - */ - SBP_EXPORT const char *sbp_msg_fileio_read_dir_resp_contents_get_section(const sbp_msg_fileio_read_dir_resp_t *msg, size_t section); +/** + * Obtain a section from sbp_msg_fileio_read_dir_resp_t::contents + * + * Returns a pointer to the given subsection in the field. Sections are + * 0-indexed, the \p section parameters must be less than the value returned + * from #sbp_msg_fileio_read_dir_resp_contents_count_sections. + * + * @param msg sbp_msg_fileio_read_dir_resp_t instance + * @param section Section number + * @return Pointer to C string, NULL on error + */ +SBP_EXPORT const char *sbp_msg_fileio_read_dir_resp_contents_get_section( + const sbp_msg_fileio_read_dir_resp_t *msg, size_t section); - /** - * Obtain the length of a section in sbp_msg_fileio_read_dir_resp_t::contents - * - * The returned value does not include the NULL terminator. - * - * If the given section does not exist 0 is returned. - * - * @param msg sbp_msg_fileio_read_dir_resp_t instance - * @param section Section number - * @return Length of section - */ - SBP_EXPORT size_t sbp_msg_fileio_read_dir_resp_contents_section_strlen(const sbp_msg_fileio_read_dir_resp_t *msg, size_t section); +/** + * Obtain the length of a section in sbp_msg_fileio_read_dir_resp_t::contents + * + * The returned value does not include the NULL terminator. + * + * If the given section does not exist 0 is returned. + * + * @param msg sbp_msg_fileio_read_dir_resp_t instance + * @param section Section number + * @return Length of section + */ +SBP_EXPORT size_t sbp_msg_fileio_read_dir_resp_contents_section_strlen( + const sbp_msg_fileio_read_dir_resp_t *msg, size_t section); /** * Get encoded size of an instance of sbp_msg_fileio_read_dir_resp_t @@ -219,46 +268,63 @@ typedef struct { * @param msg sbp_msg_fileio_read_dir_resp_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_fileio_read_dir_resp_encoded_len(const sbp_msg_fileio_read_dir_resp_t *msg) -{ - return SBP_MSG_FILEIO_READ_DIR_RESP_ENCODED_OVERHEAD - + sbp_msg_fileio_read_dir_resp_contents_encoded_len(msg) - ; +static inline size_t sbp_msg_fileio_read_dir_resp_encoded_len( + const sbp_msg_fileio_read_dir_resp_t *msg) { + return SBP_MSG_FILEIO_READ_DIR_RESP_ENCODED_OVERHEAD + + sbp_msg_fileio_read_dir_resp_contents_encoded_len(msg); } /** * Encode an instance of sbp_msg_fileio_read_dir_resp_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_fileio_read_dir_resp_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_read_dir_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_read_dir_resp_t *msg); +SBP_EXPORT s8 sbp_msg_fileio_read_dir_resp_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_read_dir_resp_t *msg); /** * Decode an instance of sbp_msg_fileio_read_dir_resp_t from wire representation * - * This function decodes the wire representation of a sbp_msg_fileio_read_dir_resp_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_fileio_read_dir_resp_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_fileio_read_dir_resp_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_read_dir_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_read_dir_resp_t *msg); +SBP_EXPORT s8 sbp_msg_fileio_read_dir_resp_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fileio_read_dir_resp_t *msg); /** - * Send an instance of sbp_msg_fileio_read_dir_resp_t with the given write function + * Send an instance of sbp_msg_fileio_read_dir_resp_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_fileio_read_dir_resp_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_fileio_read_dir_resp_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -266,51 +332,62 @@ SBP_EXPORT s8 sbp_msg_fileio_read_dir_resp_decode(const uint8_t *buf, uint8_t le * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_read_dir_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_read_dir_resp_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_fileio_read_dir_resp_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_read_dir_resp_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_fileio_read_dir_resp_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_fileio_read_dir_resp_t instance * @param b sbp_msg_fileio_read_dir_resp_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_fileio_read_dir_resp_cmp(const sbp_msg_fileio_read_dir_resp_t *a, const sbp_msg_fileio_read_dir_resp_t *b); +SBP_EXPORT int sbp_msg_fileio_read_dir_resp_cmp( + const sbp_msg_fileio_read_dir_resp_t *a, + const sbp_msg_fileio_read_dir_resp_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_fileio_read_dir_resp_t &lhs, const sbp_msg_fileio_read_dir_resp_t &rhs) { +static inline bool operator==(const sbp_msg_fileio_read_dir_resp_t &lhs, + const sbp_msg_fileio_read_dir_resp_t &rhs) { return sbp_msg_fileio_read_dir_resp_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_fileio_read_dir_resp_t &lhs, const sbp_msg_fileio_read_dir_resp_t &rhs) { +static inline bool operator!=(const sbp_msg_fileio_read_dir_resp_t &lhs, + const sbp_msg_fileio_read_dir_resp_t &rhs) { return sbp_msg_fileio_read_dir_resp_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_fileio_read_dir_resp_t &lhs, const sbp_msg_fileio_read_dir_resp_t &rhs) { +static inline bool operator<(const sbp_msg_fileio_read_dir_resp_t &lhs, + const sbp_msg_fileio_read_dir_resp_t &rhs) { return sbp_msg_fileio_read_dir_resp_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_fileio_read_dir_resp_t &lhs, const sbp_msg_fileio_read_dir_resp_t &rhs) { +static inline bool operator<=(const sbp_msg_fileio_read_dir_resp_t &lhs, + const sbp_msg_fileio_read_dir_resp_t &rhs) { return sbp_msg_fileio_read_dir_resp_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_fileio_read_dir_resp_t &lhs, const sbp_msg_fileio_read_dir_resp_t &rhs) { +static inline bool operator>(const sbp_msg_fileio_read_dir_resp_t &lhs, + const sbp_msg_fileio_read_dir_resp_t &rhs) { return sbp_msg_fileio_read_dir_resp_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_fileio_read_dir_resp_t &lhs, const sbp_msg_fileio_read_dir_resp_t &rhs) { +static inline bool operator>=(const sbp_msg_fileio_read_dir_resp_t &lhs, + const sbp_msg_fileio_read_dir_resp_t &rhs) { return sbp_msg_fileio_read_dir_resp_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FILE_IO_MSG_FILEIO_READ_DIR_RESP_H */ - diff --git a/c/include/libsbp/file_io/MSG_FILEIO_READ_REQ.h b/c/include/libsbp/file_io/MSG_FILEIO_READ_REQ.h index 2d7a32185..77601d81e 100644 --- a/c/include/libsbp/file_io/MSG_FILEIO_READ_REQ.h +++ b/c/include/libsbp/file_io/MSG_FILEIO_READ_REQ.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FILE_IO_MSG_FILEIO_READ_REQ_H #define LIBSBP_FILE_IO_MSG_FILEIO_READ_REQ_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,203 +40,228 @@ *****************************************************************************/ /** Read file from the file system (host => device) * -* The file read message reads a certain length (up to 255 bytes) from a given offset into a file, and returns the data in a MSG_FILEIO_READ_RESP message where the message length field indicates how many bytes were successfully read. The sequence number in the request will be returned in the response. If the message is invalid, a followup MSG_PRINT message will print "Invalid fileio read message". A device will only respond to this message when it is received from sender ID 0x42. + * The file read message reads a certain length (up to 255 bytes) from a given + * offset into a file, and returns the data in a MSG_FILEIO_READ_RESP message + * where the message length field indicates how many bytes were successfully + * read. The sequence number in the request will be returned in the response. If + * the message is invalid, a followup MSG_PRINT message will print "Invalid + * fileio read message". A device will only respond to this message when it is + * received from sender ID 0x42. */ typedef struct { - - /** -* Read sequence number + * Read sequence number */ u32 sequence; - /** -* File offset [bytes] + * File offset [bytes] */ u32 offset; - /** -* Chunk size to read [bytes] + * Chunk size to read [bytes] */ u8 chunk_size; - /** -* Name of the file to read from + * Name of the file to read from */ sbp_string_t filename; } sbp_msg_fileio_read_req_t; +/** + * Initialise sbp_msg_fileio_read_req_t::filename to empty + * + * @param msg sbp_msg_fileio_read_req_t instance + */ +SBP_EXPORT void sbp_msg_fileio_read_req_filename_init( + sbp_msg_fileio_read_req_t *msg); - /** - * Initialise sbp_msg_fileio_read_req_t::filename to empty - * - * @param msg sbp_msg_fileio_read_req_t instance - */ - SBP_EXPORT void sbp_msg_fileio_read_req_filename_init(sbp_msg_fileio_read_req_t *msg); - - /** - * Test sbp_msg_fileio_read_req_t::filename for validity - * - * @param msg sbp_msg_fileio_read_req_t instance - * @return true is sbp_msg_fileio_read_req_t::filename is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_req_filename_valid(const sbp_msg_fileio_read_req_t *msg); +/** + * Test sbp_msg_fileio_read_req_t::filename for validity + * + * @param msg sbp_msg_fileio_read_req_t instance + * @return true is sbp_msg_fileio_read_req_t::filename is valid for encoding + * purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_req_filename_valid( + const sbp_msg_fileio_read_req_t *msg); - /** - * Tests 2 instances of sbp_msg_fileio_read_req_t::filename for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_fileio_read_req_t instance - * @param b sbp_msg_fileio_read_req_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_fileio_read_req_filename_strcmp(const sbp_msg_fileio_read_req_t *a, const sbp_msg_fileio_read_req_t *b); +/** + * Tests 2 instances of sbp_msg_fileio_read_req_t::filename for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_fileio_read_req_t instance + * @param b sbp_msg_fileio_read_req_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_fileio_read_req_filename_strcmp( + const sbp_msg_fileio_read_req_t *a, const sbp_msg_fileio_read_req_t *b); - /** - * Get the encoded size of sbp_msg_fileio_read_req_t::filename - * - * @param msg sbp_msg_fileio_read_req_t instance - * @return Size of sbp_msg_fileio_read_req_t::filename in wire representation - */ - SBP_EXPORT size_t sbp_msg_fileio_read_req_filename_encoded_len(const sbp_msg_fileio_read_req_t *msg); +/** + * Get the encoded size of sbp_msg_fileio_read_req_t::filename + * + * @param msg sbp_msg_fileio_read_req_t instance + * @return Size of sbp_msg_fileio_read_req_t::filename in wire representation + */ +SBP_EXPORT size_t sbp_msg_fileio_read_req_filename_encoded_len( + const sbp_msg_fileio_read_req_t *msg); - /** - * Query sbp_msg_fileio_read_req_t::filename for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_fileio_read_req_t::filename before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_fileio_read_req_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_fileio_read_req_filename_space_remaining(const sbp_msg_fileio_read_req_t *msg); - /** - * Set sbp_msg_fileio_read_req_t::filename - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_fileio_read_req_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_req_filename_set(sbp_msg_fileio_read_req_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_fileio_read_req_t::filename for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_fileio_read_req_t::filename before it exceeds the maximum + * size of the field in wire representation + * + * @param msg sbp_msg_fileio_read_req_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_fileio_read_req_filename_space_remaining( + const sbp_msg_fileio_read_req_t *msg); +/** + * Set sbp_msg_fileio_read_req_t::filename + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_fileio_read_req_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_req_filename_set( + sbp_msg_fileio_read_req_t *msg, const char *new_str, bool should_trunc, + size_t *n_written); - /** - * Set sbp_msg_fileio_read_req_t::filename from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_fileio_read_req_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_req_filename_set_raw(sbp_msg_fileio_read_req_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_fileio_read_req_t::filename from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_fileio_read_req_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_req_filename_set_raw( + sbp_msg_fileio_read_req_t *msg, const char *new_buf, size_t new_buf_len, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_fileio_read_req_t::filename with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_fileio_read_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_req_filename_printf(sbp_msg_fileio_read_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_fileio_read_req_t::filename with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_fileio_read_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_req_filename_printf( + sbp_msg_fileio_read_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_fileio_read_req_t::filename with printf style formatting - * - * Identical to #sbp_msg_fileio_read_req_filename_printf except it takes a va_list argument - * - * @param msg sbp_msg_fileio_read_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_req_filename_vprintf(sbp_msg_fileio_read_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_fileio_read_req_t::filename with printf style formatting + * + * Identical to #sbp_msg_fileio_read_req_filename_printf except it takes a + * va_list argument + * + * @param msg sbp_msg_fileio_read_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_req_filename_vprintf( + sbp_msg_fileio_read_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_fileio_read_req_t::filename with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_fileio_read_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_req_filename_append_printf(sbp_msg_fileio_read_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_fileio_read_req_t::filename with printf style formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_fileio_read_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_req_filename_append_printf( + sbp_msg_fileio_read_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_fileio_read_req_t::filename with printf style formatting - * - * Identical to #sbp_msg_fileio_read_req_filename_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_fileio_read_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_read_req_filename_append_vprintf(sbp_msg_fileio_read_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_fileio_read_req_t::filename with printf style formatting + * + * Identical to #sbp_msg_fileio_read_req_filename_append_printf except it takes + * a va_list argument + * + * @param msg sbp_msg_fileio_read_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_read_req_filename_append_vprintf( + sbp_msg_fileio_read_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_fileio_read_req_t::filename - * - * @param msg sbp_msg_fileio_read_req_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_fileio_read_req_filename_get(const sbp_msg_fileio_read_req_t *msg); +/** + * Obtain the string value from sbp_msg_fileio_read_req_t::filename + * + * @param msg sbp_msg_fileio_read_req_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_fileio_read_req_filename_get( + const sbp_msg_fileio_read_req_t *msg); - /** - * Obtain the length of sbp_msg_fileio_read_req_t::filename - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_fileio_read_req_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_fileio_read_req_filename_strlen(const sbp_msg_fileio_read_req_t *msg); +/** + * Obtain the length of sbp_msg_fileio_read_req_t::filename + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_fileio_read_req_t instance + * @return Length of string + */ +SBP_EXPORT size_t +sbp_msg_fileio_read_req_filename_strlen(const sbp_msg_fileio_read_req_t *msg); /** * Get encoded size of an instance of sbp_msg_fileio_read_req_t @@ -244,46 +269,62 @@ typedef struct { * @param msg sbp_msg_fileio_read_req_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_fileio_read_req_encoded_len(const sbp_msg_fileio_read_req_t *msg) -{ - return SBP_MSG_FILEIO_READ_REQ_ENCODED_OVERHEAD - + sbp_msg_fileio_read_req_filename_encoded_len(msg) - ; +static inline size_t sbp_msg_fileio_read_req_encoded_len( + const sbp_msg_fileio_read_req_t *msg) { + return SBP_MSG_FILEIO_READ_REQ_ENCODED_OVERHEAD + + sbp_msg_fileio_read_req_filename_encoded_len(msg); } /** * Encode an instance of sbp_msg_fileio_read_req_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_fileio_read_req_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_read_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_read_req_t *msg); +SBP_EXPORT s8 +sbp_msg_fileio_read_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_read_req_t *msg); /** * Decode an instance of sbp_msg_fileio_read_req_t from wire representation * - * This function decodes the wire representation of a sbp_msg_fileio_read_req_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_fileio_read_req_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_fileio_read_req_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_read_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_read_req_t *msg); +SBP_EXPORT s8 sbp_msg_fileio_read_req_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_fileio_read_req_t *msg); /** * Send an instance of sbp_msg_fileio_read_req_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_fileio_read_req_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_fileio_read_req_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -291,51 +332,61 @@ SBP_EXPORT s8 sbp_msg_fileio_read_req_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_read_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_read_req_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_fileio_read_req_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_fileio_read_req_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_fileio_read_req_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_fileio_read_req_t instance * @param b sbp_msg_fileio_read_req_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_fileio_read_req_cmp(const sbp_msg_fileio_read_req_t *a, const sbp_msg_fileio_read_req_t *b); +SBP_EXPORT int sbp_msg_fileio_read_req_cmp(const sbp_msg_fileio_read_req_t *a, + const sbp_msg_fileio_read_req_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_fileio_read_req_t &lhs, const sbp_msg_fileio_read_req_t &rhs) { +static inline bool operator==(const sbp_msg_fileio_read_req_t &lhs, + const sbp_msg_fileio_read_req_t &rhs) { return sbp_msg_fileio_read_req_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_fileio_read_req_t &lhs, const sbp_msg_fileio_read_req_t &rhs) { +static inline bool operator!=(const sbp_msg_fileio_read_req_t &lhs, + const sbp_msg_fileio_read_req_t &rhs) { return sbp_msg_fileio_read_req_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_fileio_read_req_t &lhs, const sbp_msg_fileio_read_req_t &rhs) { +static inline bool operator<(const sbp_msg_fileio_read_req_t &lhs, + const sbp_msg_fileio_read_req_t &rhs) { return sbp_msg_fileio_read_req_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_fileio_read_req_t &lhs, const sbp_msg_fileio_read_req_t &rhs) { +static inline bool operator<=(const sbp_msg_fileio_read_req_t &lhs, + const sbp_msg_fileio_read_req_t &rhs) { return sbp_msg_fileio_read_req_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_fileio_read_req_t &lhs, const sbp_msg_fileio_read_req_t &rhs) { +static inline bool operator>(const sbp_msg_fileio_read_req_t &lhs, + const sbp_msg_fileio_read_req_t &rhs) { return sbp_msg_fileio_read_req_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_fileio_read_req_t &lhs, const sbp_msg_fileio_read_req_t &rhs) { +static inline bool operator>=(const sbp_msg_fileio_read_req_t &lhs, + const sbp_msg_fileio_read_req_t &rhs) { return sbp_msg_fileio_read_req_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FILE_IO_MSG_FILEIO_READ_REQ_H */ - diff --git a/c/include/libsbp/file_io/MSG_FILEIO_READ_RESP.h b/c/include/libsbp/file_io/MSG_FILEIO_READ_RESP.h index e71f2b083..1963b0573 100644 --- a/c/include/libsbp/file_io/MSG_FILEIO_READ_RESP.h +++ b/c/include/libsbp/file_io/MSG_FILEIO_READ_RESP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FILE_IO_MSG_FILEIO_READ_RESP_H #define LIBSBP_FILE_IO_MSG_FILEIO_READ_RESP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,79 +40,96 @@ *****************************************************************************/ /** File read from the file system (host <= device) * -* The file read message reads a certain length (up to 255 bytes) from a given offset into a file, and returns the data in a message where the message length field indicates how many bytes were successfully read. The sequence number in the response is preserved from the request. + * The file read message reads a certain length (up to 255 bytes) from a given + * offset into a file, and returns the data in a message where the message + * length field indicates how many bytes were successfully read. The sequence + * number in the response is preserved from the request. */ typedef struct { - - /** -* Read sequence number + * Read sequence number */ u32 sequence; - /** -* Contents of read file + * Contents of read file */ u8 contents[SBP_MSG_FILEIO_READ_RESP_CONTENTS_MAX]; /** * Number of elements in contents * - * When sending a message fill in this field with the number elements set in contents before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * contents before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in contents. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * contents. The value of any elements beyond the index specified in this + * field is undefined */ u8 n_contents; } sbp_msg_fileio_read_resp_t; - - /** * Get encoded size of an instance of sbp_msg_fileio_read_resp_t * * @param msg sbp_msg_fileio_read_resp_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_fileio_read_resp_encoded_len(const sbp_msg_fileio_read_resp_t *msg) -{ - return SBP_MSG_FILEIO_READ_RESP_ENCODED_OVERHEAD - + (msg->n_contents * SBP_ENCODED_LEN_U8) - ; +static inline size_t sbp_msg_fileio_read_resp_encoded_len( + const sbp_msg_fileio_read_resp_t *msg) { + return SBP_MSG_FILEIO_READ_RESP_ENCODED_OVERHEAD + + (msg->n_contents * SBP_ENCODED_LEN_U8); } /** * Encode an instance of sbp_msg_fileio_read_resp_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_fileio_read_resp_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_read_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_read_resp_t *msg); +SBP_EXPORT s8 +sbp_msg_fileio_read_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_read_resp_t *msg); /** * Decode an instance of sbp_msg_fileio_read_resp_t from wire representation * - * This function decodes the wire representation of a sbp_msg_fileio_read_resp_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_fileio_read_resp_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_fileio_read_resp_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_read_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_read_resp_t *msg); +SBP_EXPORT s8 sbp_msg_fileio_read_resp_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_fileio_read_resp_t *msg); /** * Send an instance of sbp_msg_fileio_read_resp_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_fileio_read_resp_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_fileio_read_resp_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -120,51 +137,61 @@ SBP_EXPORT s8 sbp_msg_fileio_read_resp_decode(const uint8_t *buf, uint8_t len, u * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_read_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_read_resp_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_fileio_read_resp_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_read_resp_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_fileio_read_resp_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_fileio_read_resp_t instance * @param b sbp_msg_fileio_read_resp_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_fileio_read_resp_cmp(const sbp_msg_fileio_read_resp_t *a, const sbp_msg_fileio_read_resp_t *b); +SBP_EXPORT int sbp_msg_fileio_read_resp_cmp( + const sbp_msg_fileio_read_resp_t *a, const sbp_msg_fileio_read_resp_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_fileio_read_resp_t &lhs, const sbp_msg_fileio_read_resp_t &rhs) { +static inline bool operator==(const sbp_msg_fileio_read_resp_t &lhs, + const sbp_msg_fileio_read_resp_t &rhs) { return sbp_msg_fileio_read_resp_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_fileio_read_resp_t &lhs, const sbp_msg_fileio_read_resp_t &rhs) { +static inline bool operator!=(const sbp_msg_fileio_read_resp_t &lhs, + const sbp_msg_fileio_read_resp_t &rhs) { return sbp_msg_fileio_read_resp_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_fileio_read_resp_t &lhs, const sbp_msg_fileio_read_resp_t &rhs) { +static inline bool operator<(const sbp_msg_fileio_read_resp_t &lhs, + const sbp_msg_fileio_read_resp_t &rhs) { return sbp_msg_fileio_read_resp_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_fileio_read_resp_t &lhs, const sbp_msg_fileio_read_resp_t &rhs) { +static inline bool operator<=(const sbp_msg_fileio_read_resp_t &lhs, + const sbp_msg_fileio_read_resp_t &rhs) { return sbp_msg_fileio_read_resp_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_fileio_read_resp_t &lhs, const sbp_msg_fileio_read_resp_t &rhs) { +static inline bool operator>(const sbp_msg_fileio_read_resp_t &lhs, + const sbp_msg_fileio_read_resp_t &rhs) { return sbp_msg_fileio_read_resp_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_fileio_read_resp_t &lhs, const sbp_msg_fileio_read_resp_t &rhs) { +static inline bool operator>=(const sbp_msg_fileio_read_resp_t &lhs, + const sbp_msg_fileio_read_resp_t &rhs) { return sbp_msg_fileio_read_resp_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FILE_IO_MSG_FILEIO_READ_RESP_H */ - diff --git a/c/include/libsbp/file_io/MSG_FILEIO_REMOVE.h b/c/include/libsbp/file_io/MSG_FILEIO_REMOVE.h index 9c138f60c..d7a9eaa2b 100644 --- a/c/include/libsbp/file_io/MSG_FILEIO_REMOVE.h +++ b/c/include/libsbp/file_io/MSG_FILEIO_REMOVE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FILE_IO_MSG_FILEIO_REMOVE_H #define LIBSBP_FILE_IO_MSG_FILEIO_REMOVE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,185 +40,211 @@ *****************************************************************************/ /** Delete a file from the file system (host => device) * -* The file remove message deletes a file from the file system. If the message is invalid, a followup MSG_PRINT message will print "Invalid fileio remove message". A device will only process this message when it is received from sender ID 0x42. + * The file remove message deletes a file from the file system. If the message + * is invalid, a followup MSG_PRINT message will print "Invalid fileio remove + * message". A device will only process this message when it is received from + * sender ID 0x42. */ typedef struct { - - /** -* Name of the file to delete + * Name of the file to delete */ sbp_string_t filename; } sbp_msg_fileio_remove_t; +/** + * Initialise sbp_msg_fileio_remove_t::filename to empty + * + * @param msg sbp_msg_fileio_remove_t instance + */ +SBP_EXPORT void sbp_msg_fileio_remove_filename_init( + sbp_msg_fileio_remove_t *msg); - /** - * Initialise sbp_msg_fileio_remove_t::filename to empty - * - * @param msg sbp_msg_fileio_remove_t instance - */ - SBP_EXPORT void sbp_msg_fileio_remove_filename_init(sbp_msg_fileio_remove_t *msg); - - /** - * Test sbp_msg_fileio_remove_t::filename for validity - * - * @param msg sbp_msg_fileio_remove_t instance - * @return true is sbp_msg_fileio_remove_t::filename is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_remove_filename_valid(const sbp_msg_fileio_remove_t *msg); +/** + * Test sbp_msg_fileio_remove_t::filename for validity + * + * @param msg sbp_msg_fileio_remove_t instance + * @return true is sbp_msg_fileio_remove_t::filename is valid for encoding + * purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_remove_filename_valid( + const sbp_msg_fileio_remove_t *msg); - /** - * Tests 2 instances of sbp_msg_fileio_remove_t::filename for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_fileio_remove_t instance - * @param b sbp_msg_fileio_remove_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_fileio_remove_filename_strcmp(const sbp_msg_fileio_remove_t *a, const sbp_msg_fileio_remove_t *b); +/** + * Tests 2 instances of sbp_msg_fileio_remove_t::filename for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_fileio_remove_t instance + * @param b sbp_msg_fileio_remove_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_fileio_remove_filename_strcmp( + const sbp_msg_fileio_remove_t *a, const sbp_msg_fileio_remove_t *b); - /** - * Get the encoded size of sbp_msg_fileio_remove_t::filename - * - * @param msg sbp_msg_fileio_remove_t instance - * @return Size of sbp_msg_fileio_remove_t::filename in wire representation - */ - SBP_EXPORT size_t sbp_msg_fileio_remove_filename_encoded_len(const sbp_msg_fileio_remove_t *msg); +/** + * Get the encoded size of sbp_msg_fileio_remove_t::filename + * + * @param msg sbp_msg_fileio_remove_t instance + * @return Size of sbp_msg_fileio_remove_t::filename in wire representation + */ +SBP_EXPORT size_t +sbp_msg_fileio_remove_filename_encoded_len(const sbp_msg_fileio_remove_t *msg); - /** - * Query sbp_msg_fileio_remove_t::filename for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_fileio_remove_t::filename before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_fileio_remove_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_fileio_remove_filename_space_remaining(const sbp_msg_fileio_remove_t *msg); - /** - * Set sbp_msg_fileio_remove_t::filename - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_fileio_remove_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_remove_filename_set(sbp_msg_fileio_remove_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_fileio_remove_t::filename for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_fileio_remove_t::filename before it exceeds the maximum size + * of the field in wire representation + * + * @param msg sbp_msg_fileio_remove_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_fileio_remove_filename_space_remaining( + const sbp_msg_fileio_remove_t *msg); +/** + * Set sbp_msg_fileio_remove_t::filename + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_fileio_remove_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_remove_filename_set(sbp_msg_fileio_remove_t *msg, + const char *new_str, + bool should_trunc, + size_t *n_written); - /** - * Set sbp_msg_fileio_remove_t::filename from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_fileio_remove_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_remove_filename_set_raw(sbp_msg_fileio_remove_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_fileio_remove_t::filename from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_fileio_remove_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_remove_filename_set_raw( + sbp_msg_fileio_remove_t *msg, const char *new_buf, size_t new_buf_len, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_fileio_remove_t::filename with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_fileio_remove_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_remove_filename_printf(sbp_msg_fileio_remove_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_fileio_remove_t::filename with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_fileio_remove_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_remove_filename_printf( + sbp_msg_fileio_remove_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_fileio_remove_t::filename with printf style formatting - * - * Identical to #sbp_msg_fileio_remove_filename_printf except it takes a va_list argument - * - * @param msg sbp_msg_fileio_remove_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_remove_filename_vprintf(sbp_msg_fileio_remove_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_fileio_remove_t::filename with printf style formatting + * + * Identical to #sbp_msg_fileio_remove_filename_printf except it takes a va_list + * argument + * + * @param msg sbp_msg_fileio_remove_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_remove_filename_vprintf( + sbp_msg_fileio_remove_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_fileio_remove_t::filename with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_fileio_remove_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_remove_filename_append_printf(sbp_msg_fileio_remove_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_fileio_remove_t::filename with printf style formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_fileio_remove_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_remove_filename_append_printf( + sbp_msg_fileio_remove_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_fileio_remove_t::filename with printf style formatting - * - * Identical to #sbp_msg_fileio_remove_filename_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_fileio_remove_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_remove_filename_append_vprintf(sbp_msg_fileio_remove_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_fileio_remove_t::filename with printf style formatting + * + * Identical to #sbp_msg_fileio_remove_filename_append_printf except it takes a + * va_list argument + * + * @param msg sbp_msg_fileio_remove_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_remove_filename_append_vprintf( + sbp_msg_fileio_remove_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_fileio_remove_t::filename - * - * @param msg sbp_msg_fileio_remove_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_fileio_remove_filename_get(const sbp_msg_fileio_remove_t *msg); +/** + * Obtain the string value from sbp_msg_fileio_remove_t::filename + * + * @param msg sbp_msg_fileio_remove_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_fileio_remove_filename_get( + const sbp_msg_fileio_remove_t *msg); - /** - * Obtain the length of sbp_msg_fileio_remove_t::filename - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_fileio_remove_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_fileio_remove_filename_strlen(const sbp_msg_fileio_remove_t *msg); +/** + * Obtain the length of sbp_msg_fileio_remove_t::filename + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_fileio_remove_t instance + * @return Length of string + */ +SBP_EXPORT size_t +sbp_msg_fileio_remove_filename_strlen(const sbp_msg_fileio_remove_t *msg); /** * Get encoded size of an instance of sbp_msg_fileio_remove_t @@ -226,46 +252,62 @@ typedef struct { * @param msg sbp_msg_fileio_remove_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_fileio_remove_encoded_len(const sbp_msg_fileio_remove_t *msg) -{ - return SBP_MSG_FILEIO_REMOVE_ENCODED_OVERHEAD - + sbp_msg_fileio_remove_filename_encoded_len(msg) - ; +static inline size_t sbp_msg_fileio_remove_encoded_len( + const sbp_msg_fileio_remove_t *msg) { + return SBP_MSG_FILEIO_REMOVE_ENCODED_OVERHEAD + + sbp_msg_fileio_remove_filename_encoded_len(msg); } /** * Encode an instance of sbp_msg_fileio_remove_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_fileio_remove_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_remove_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_remove_t *msg); +SBP_EXPORT s8 sbp_msg_fileio_remove_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_fileio_remove_t *msg); /** * Decode an instance of sbp_msg_fileio_remove_t from wire representation * - * This function decodes the wire representation of a sbp_msg_fileio_remove_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_fileio_remove_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_fileio_remove_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_remove_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_remove_t *msg); +SBP_EXPORT s8 sbp_msg_fileio_remove_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_fileio_remove_t *msg); /** * Send an instance of sbp_msg_fileio_remove_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_fileio_remove_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_fileio_remove_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -273,51 +315,61 @@ SBP_EXPORT s8 sbp_msg_fileio_remove_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_remove_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_remove_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_fileio_remove_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_fileio_remove_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_fileio_remove_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_fileio_remove_t instance * @param b sbp_msg_fileio_remove_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_fileio_remove_cmp(const sbp_msg_fileio_remove_t *a, const sbp_msg_fileio_remove_t *b); +SBP_EXPORT int sbp_msg_fileio_remove_cmp(const sbp_msg_fileio_remove_t *a, + const sbp_msg_fileio_remove_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_fileio_remove_t &lhs, const sbp_msg_fileio_remove_t &rhs) { +static inline bool operator==(const sbp_msg_fileio_remove_t &lhs, + const sbp_msg_fileio_remove_t &rhs) { return sbp_msg_fileio_remove_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_fileio_remove_t &lhs, const sbp_msg_fileio_remove_t &rhs) { +static inline bool operator!=(const sbp_msg_fileio_remove_t &lhs, + const sbp_msg_fileio_remove_t &rhs) { return sbp_msg_fileio_remove_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_fileio_remove_t &lhs, const sbp_msg_fileio_remove_t &rhs) { +static inline bool operator<(const sbp_msg_fileio_remove_t &lhs, + const sbp_msg_fileio_remove_t &rhs) { return sbp_msg_fileio_remove_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_fileio_remove_t &lhs, const sbp_msg_fileio_remove_t &rhs) { +static inline bool operator<=(const sbp_msg_fileio_remove_t &lhs, + const sbp_msg_fileio_remove_t &rhs) { return sbp_msg_fileio_remove_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_fileio_remove_t &lhs, const sbp_msg_fileio_remove_t &rhs) { +static inline bool operator>(const sbp_msg_fileio_remove_t &lhs, + const sbp_msg_fileio_remove_t &rhs) { return sbp_msg_fileio_remove_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_fileio_remove_t &lhs, const sbp_msg_fileio_remove_t &rhs) { +static inline bool operator>=(const sbp_msg_fileio_remove_t &lhs, + const sbp_msg_fileio_remove_t &rhs) { return sbp_msg_fileio_remove_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FILE_IO_MSG_FILEIO_REMOVE_H */ - diff --git a/c/include/libsbp/file_io/MSG_FILEIO_WRITE_REQ.h b/c/include/libsbp/file_io/MSG_FILEIO_WRITE_REQ.h index 657cf7e2e..c66df3be7 100644 --- a/c/include/libsbp/file_io/MSG_FILEIO_WRITE_REQ.h +++ b/c/include/libsbp/file_io/MSG_FILEIO_WRITE_REQ.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FILE_IO_MSG_FILEIO_WRITE_REQ_H #define LIBSBP_FILE_IO_MSG_FILEIO_WRITE_REQ_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,211 +40,238 @@ *****************************************************************************/ /** Write to file (host => device) * -* The file write message writes a certain length (up to 255 bytes) of data to a file at a given offset. Returns a copy of the original MSG_FILEIO_WRITE_RESP message to check integrity of the write. The sequence number in the request will be returned in the response. If message is invalid, a followup MSG_PRINT message will print "Invalid fileio write message". A device will only process this message when it is received from sender ID 0x42. + * The file write message writes a certain length (up to 255 bytes) of data to a + * file at a given offset. Returns a copy of the original MSG_FILEIO_WRITE_RESP + * message to check integrity of the write. The sequence number in the request + * will be returned in the response. If message is invalid, a followup MSG_PRINT + * message will print "Invalid fileio write message". A device will only process + * this message when it is received from sender ID 0x42. */ typedef struct { - - /** -* Write sequence number + * Write sequence number */ u32 sequence; - /** -* Offset into the file at which to start writing in bytes [bytes] + * Offset into the file at which to start writing in bytes [bytes] */ u32 offset; - /** -* Name of the file to write to + * Name of the file to write to */ sbp_string_t filename; - /** -* Variable-length array of data to write + * Variable-length array of data to write */ u8 data[SBP_MSG_FILEIO_WRITE_REQ_DATA_MAX]; /** * Number of elements in data * - * When sending a message fill in this field with the number elements set in data before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * data before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in data. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * data. The value of any elements beyond the index specified in this field is + * undefined */ u8 n_data; } sbp_msg_fileio_write_req_t; +/** + * Initialise sbp_msg_fileio_write_req_t::filename to empty + * + * @param msg sbp_msg_fileio_write_req_t instance + */ +SBP_EXPORT void sbp_msg_fileio_write_req_filename_init( + sbp_msg_fileio_write_req_t *msg); - /** - * Initialise sbp_msg_fileio_write_req_t::filename to empty - * - * @param msg sbp_msg_fileio_write_req_t instance - */ - SBP_EXPORT void sbp_msg_fileio_write_req_filename_init(sbp_msg_fileio_write_req_t *msg); - - /** - * Test sbp_msg_fileio_write_req_t::filename for validity - * - * @param msg sbp_msg_fileio_write_req_t instance - * @return true is sbp_msg_fileio_write_req_t::filename is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_write_req_filename_valid(const sbp_msg_fileio_write_req_t *msg); +/** + * Test sbp_msg_fileio_write_req_t::filename for validity + * + * @param msg sbp_msg_fileio_write_req_t instance + * @return true is sbp_msg_fileio_write_req_t::filename is valid for encoding + * purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_write_req_filename_valid( + const sbp_msg_fileio_write_req_t *msg); - /** - * Tests 2 instances of sbp_msg_fileio_write_req_t::filename for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_fileio_write_req_t instance - * @param b sbp_msg_fileio_write_req_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_fileio_write_req_filename_strcmp(const sbp_msg_fileio_write_req_t *a, const sbp_msg_fileio_write_req_t *b); +/** + * Tests 2 instances of sbp_msg_fileio_write_req_t::filename for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_fileio_write_req_t instance + * @param b sbp_msg_fileio_write_req_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_fileio_write_req_filename_strcmp( + const sbp_msg_fileio_write_req_t *a, const sbp_msg_fileio_write_req_t *b); - /** - * Get the encoded size of sbp_msg_fileio_write_req_t::filename - * - * @param msg sbp_msg_fileio_write_req_t instance - * @return Size of sbp_msg_fileio_write_req_t::filename in wire representation - */ - SBP_EXPORT size_t sbp_msg_fileio_write_req_filename_encoded_len(const sbp_msg_fileio_write_req_t *msg); +/** + * Get the encoded size of sbp_msg_fileio_write_req_t::filename + * + * @param msg sbp_msg_fileio_write_req_t instance + * @return Size of sbp_msg_fileio_write_req_t::filename in wire representation + */ +SBP_EXPORT size_t sbp_msg_fileio_write_req_filename_encoded_len( + const sbp_msg_fileio_write_req_t *msg); - /** - * Query sbp_msg_fileio_write_req_t::filename for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_fileio_write_req_t::filename before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_fileio_write_req_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_fileio_write_req_filename_space_remaining(const sbp_msg_fileio_write_req_t *msg); - /** - * Set sbp_msg_fileio_write_req_t::filename - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_fileio_write_req_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_write_req_filename_set(sbp_msg_fileio_write_req_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_fileio_write_req_t::filename for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_fileio_write_req_t::filename before it exceeds the maximum + * size of the field in wire representation + * + * @param msg sbp_msg_fileio_write_req_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_fileio_write_req_filename_space_remaining( + const sbp_msg_fileio_write_req_t *msg); +/** + * Set sbp_msg_fileio_write_req_t::filename + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_fileio_write_req_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_write_req_filename_set( + sbp_msg_fileio_write_req_t *msg, const char *new_str, bool should_trunc, + size_t *n_written); - /** - * Set sbp_msg_fileio_write_req_t::filename from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_fileio_write_req_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_write_req_filename_set_raw(sbp_msg_fileio_write_req_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_fileio_write_req_t::filename from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_fileio_write_req_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_write_req_filename_set_raw( + sbp_msg_fileio_write_req_t *msg, const char *new_buf, size_t new_buf_len, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_fileio_write_req_t::filename with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_fileio_write_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_write_req_filename_printf(sbp_msg_fileio_write_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_fileio_write_req_t::filename with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_fileio_write_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_write_req_filename_printf( + sbp_msg_fileio_write_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_fileio_write_req_t::filename with printf style formatting - * - * Identical to #sbp_msg_fileio_write_req_filename_printf except it takes a va_list argument - * - * @param msg sbp_msg_fileio_write_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_write_req_filename_vprintf(sbp_msg_fileio_write_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_fileio_write_req_t::filename with printf style formatting + * + * Identical to #sbp_msg_fileio_write_req_filename_printf except it takes a + * va_list argument + * + * @param msg sbp_msg_fileio_write_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_write_req_filename_vprintf( + sbp_msg_fileio_write_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_fileio_write_req_t::filename with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_fileio_write_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_write_req_filename_append_printf(sbp_msg_fileio_write_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_fileio_write_req_t::filename with printf style formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_fileio_write_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_write_req_filename_append_printf( + sbp_msg_fileio_write_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_fileio_write_req_t::filename with printf style formatting - * - * Identical to #sbp_msg_fileio_write_req_filename_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_fileio_write_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_fileio_write_req_filename_append_vprintf(sbp_msg_fileio_write_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_fileio_write_req_t::filename with printf style formatting + * + * Identical to #sbp_msg_fileio_write_req_filename_append_printf except it takes + * a va_list argument + * + * @param msg sbp_msg_fileio_write_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_fileio_write_req_filename_append_vprintf( + sbp_msg_fileio_write_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_fileio_write_req_t::filename - * - * @param msg sbp_msg_fileio_write_req_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_fileio_write_req_filename_get(const sbp_msg_fileio_write_req_t *msg); +/** + * Obtain the string value from sbp_msg_fileio_write_req_t::filename + * + * @param msg sbp_msg_fileio_write_req_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_fileio_write_req_filename_get( + const sbp_msg_fileio_write_req_t *msg); - /** - * Obtain the length of sbp_msg_fileio_write_req_t::filename - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_fileio_write_req_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_fileio_write_req_filename_strlen(const sbp_msg_fileio_write_req_t *msg); +/** + * Obtain the length of sbp_msg_fileio_write_req_t::filename + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_fileio_write_req_t instance + * @return Length of string + */ +SBP_EXPORT size_t +sbp_msg_fileio_write_req_filename_strlen(const sbp_msg_fileio_write_req_t *msg); /** * Get encoded size of an instance of sbp_msg_fileio_write_req_t @@ -252,47 +279,63 @@ typedef struct { * @param msg sbp_msg_fileio_write_req_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_fileio_write_req_encoded_len(const sbp_msg_fileio_write_req_t *msg) -{ - return SBP_MSG_FILEIO_WRITE_REQ_ENCODED_OVERHEAD - + sbp_msg_fileio_write_req_filename_encoded_len(msg) - + (msg->n_data * SBP_ENCODED_LEN_U8) - ; +static inline size_t sbp_msg_fileio_write_req_encoded_len( + const sbp_msg_fileio_write_req_t *msg) { + return SBP_MSG_FILEIO_WRITE_REQ_ENCODED_OVERHEAD + + sbp_msg_fileio_write_req_filename_encoded_len(msg) + + (msg->n_data * SBP_ENCODED_LEN_U8); } /** * Encode an instance of sbp_msg_fileio_write_req_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_fileio_write_req_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_write_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_write_req_t *msg); +SBP_EXPORT s8 +sbp_msg_fileio_write_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_write_req_t *msg); /** * Decode an instance of sbp_msg_fileio_write_req_t from wire representation * - * This function decodes the wire representation of a sbp_msg_fileio_write_req_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_fileio_write_req_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_fileio_write_req_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_write_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_write_req_t *msg); +SBP_EXPORT s8 sbp_msg_fileio_write_req_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_fileio_write_req_t *msg); /** * Send an instance of sbp_msg_fileio_write_req_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_fileio_write_req_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_fileio_write_req_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -300,51 +343,61 @@ SBP_EXPORT s8 sbp_msg_fileio_write_req_decode(const uint8_t *buf, uint8_t len, u * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_write_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_write_req_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_fileio_write_req_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_write_req_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_fileio_write_req_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_fileio_write_req_t instance * @param b sbp_msg_fileio_write_req_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_fileio_write_req_cmp(const sbp_msg_fileio_write_req_t *a, const sbp_msg_fileio_write_req_t *b); +SBP_EXPORT int sbp_msg_fileio_write_req_cmp( + const sbp_msg_fileio_write_req_t *a, const sbp_msg_fileio_write_req_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_fileio_write_req_t &lhs, const sbp_msg_fileio_write_req_t &rhs) { +static inline bool operator==(const sbp_msg_fileio_write_req_t &lhs, + const sbp_msg_fileio_write_req_t &rhs) { return sbp_msg_fileio_write_req_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_fileio_write_req_t &lhs, const sbp_msg_fileio_write_req_t &rhs) { +static inline bool operator!=(const sbp_msg_fileio_write_req_t &lhs, + const sbp_msg_fileio_write_req_t &rhs) { return sbp_msg_fileio_write_req_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_fileio_write_req_t &lhs, const sbp_msg_fileio_write_req_t &rhs) { +static inline bool operator<(const sbp_msg_fileio_write_req_t &lhs, + const sbp_msg_fileio_write_req_t &rhs) { return sbp_msg_fileio_write_req_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_fileio_write_req_t &lhs, const sbp_msg_fileio_write_req_t &rhs) { +static inline bool operator<=(const sbp_msg_fileio_write_req_t &lhs, + const sbp_msg_fileio_write_req_t &rhs) { return sbp_msg_fileio_write_req_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_fileio_write_req_t &lhs, const sbp_msg_fileio_write_req_t &rhs) { +static inline bool operator>(const sbp_msg_fileio_write_req_t &lhs, + const sbp_msg_fileio_write_req_t &rhs) { return sbp_msg_fileio_write_req_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_fileio_write_req_t &lhs, const sbp_msg_fileio_write_req_t &rhs) { +static inline bool operator>=(const sbp_msg_fileio_write_req_t &lhs, + const sbp_msg_fileio_write_req_t &rhs) { return sbp_msg_fileio_write_req_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FILE_IO_MSG_FILEIO_WRITE_REQ_H */ - diff --git a/c/include/libsbp/file_io/MSG_FILEIO_WRITE_RESP.h b/c/include/libsbp/file_io/MSG_FILEIO_WRITE_RESP.h index 13373c11d..dfe14a1f9 100644 --- a/c/include/libsbp/file_io/MSG_FILEIO_WRITE_RESP.h +++ b/c/include/libsbp/file_io/MSG_FILEIO_WRITE_RESP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FILE_IO_MSG_FILEIO_WRITE_RESP_H #define LIBSBP_FILE_IO_MSG_FILEIO_WRITE_RESP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,27 +40,26 @@ *****************************************************************************/ /** File written to (host <= device) * -* The file write message writes a certain length (up to 255 bytes) of data to a file at a given offset. The message is a copy of the original MSG_FILEIO_WRITE_REQ message to check integrity of the write. The sequence number in the response is preserved from the request. + * The file write message writes a certain length (up to 255 bytes) of data to a + * file at a given offset. The message is a copy of the original + * MSG_FILEIO_WRITE_REQ message to check integrity of the write. The sequence + * number in the response is preserved from the request. */ typedef struct { - - /** -* Write sequence number + * Write sequence number */ u32 sequence; } sbp_msg_fileio_write_resp_t; - - /** * Get encoded size of an instance of sbp_msg_fileio_write_resp_t * * @param msg sbp_msg_fileio_write_resp_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_fileio_write_resp_encoded_len(const sbp_msg_fileio_write_resp_t *msg) -{ +static inline size_t sbp_msg_fileio_write_resp_encoded_len( + const sbp_msg_fileio_write_resp_t *msg) { (void)msg; return SBP_MSG_FILEIO_WRITE_RESP_ENCODED_LEN; } @@ -68,36 +67,53 @@ static inline size_t sbp_msg_fileio_write_resp_encoded_len(const sbp_msg_fileio_ /** * Encode an instance of sbp_msg_fileio_write_resp_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_fileio_write_resp_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_write_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_write_resp_t *msg); +SBP_EXPORT s8 +sbp_msg_fileio_write_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_write_resp_t *msg); /** * Decode an instance of sbp_msg_fileio_write_resp_t from wire representation * - * This function decodes the wire representation of a sbp_msg_fileio_write_resp_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_fileio_write_resp_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_fileio_write_resp_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_write_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_write_resp_t *msg); +SBP_EXPORT s8 sbp_msg_fileio_write_resp_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fileio_write_resp_t *msg); /** * Send an instance of sbp_msg_fileio_write_resp_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_fileio_write_resp_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_fileio_write_resp_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -105,51 +121,61 @@ SBP_EXPORT s8 sbp_msg_fileio_write_resp_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fileio_write_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_write_resp_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_fileio_write_resp_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_write_resp_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_fileio_write_resp_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_fileio_write_resp_t instance * @param b sbp_msg_fileio_write_resp_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_fileio_write_resp_cmp(const sbp_msg_fileio_write_resp_t *a, const sbp_msg_fileio_write_resp_t *b); +SBP_EXPORT int sbp_msg_fileio_write_resp_cmp( + const sbp_msg_fileio_write_resp_t *a, const sbp_msg_fileio_write_resp_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_fileio_write_resp_t &lhs, const sbp_msg_fileio_write_resp_t &rhs) { +static inline bool operator==(const sbp_msg_fileio_write_resp_t &lhs, + const sbp_msg_fileio_write_resp_t &rhs) { return sbp_msg_fileio_write_resp_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_fileio_write_resp_t &lhs, const sbp_msg_fileio_write_resp_t &rhs) { +static inline bool operator!=(const sbp_msg_fileio_write_resp_t &lhs, + const sbp_msg_fileio_write_resp_t &rhs) { return sbp_msg_fileio_write_resp_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_fileio_write_resp_t &lhs, const sbp_msg_fileio_write_resp_t &rhs) { +static inline bool operator<(const sbp_msg_fileio_write_resp_t &lhs, + const sbp_msg_fileio_write_resp_t &rhs) { return sbp_msg_fileio_write_resp_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_fileio_write_resp_t &lhs, const sbp_msg_fileio_write_resp_t &rhs) { +static inline bool operator<=(const sbp_msg_fileio_write_resp_t &lhs, + const sbp_msg_fileio_write_resp_t &rhs) { return sbp_msg_fileio_write_resp_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_fileio_write_resp_t &lhs, const sbp_msg_fileio_write_resp_t &rhs) { +static inline bool operator>(const sbp_msg_fileio_write_resp_t &lhs, + const sbp_msg_fileio_write_resp_t &rhs) { return sbp_msg_fileio_write_resp_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_fileio_write_resp_t &lhs, const sbp_msg_fileio_write_resp_t &rhs) { +static inline bool operator>=(const sbp_msg_fileio_write_resp_t &lhs, + const sbp_msg_fileio_write_resp_t &rhs) { return sbp_msg_fileio_write_resp_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FILE_IO_MSG_FILEIO_WRITE_RESP_H */ - diff --git a/c/include/libsbp/file_io_macros.h b/c/include/libsbp/file_io_macros.h index 8ca354e83..d9de091d2 100644 --- a/c/include/libsbp/file_io_macros.h +++ b/c/include/libsbp/file_io_macros.h @@ -18,174 +18,175 @@ #ifndef LIBSBP_FILE_IO_MACROS_H #define LIBSBP_FILE_IO_MACROS_H - #define SBP_MSG_FILEIO_READ_REQ 0x00A8 /** - * The maximum number of items that can be stored in sbp_msg_fileio_read_req_t::filename (V4 API) or msg_fileio_read_req_t::filename (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_fileio_read_req_t::filename (V4 API) or + * msg_fileio_read_req_t::filename (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX 246u - /** - * Encoded length of sbp_msg_fileio_read_req_t (V4 API) and + * Encoded length of sbp_msg_fileio_read_req_t (V4 API) and * msg_fileio_read_req_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_fileio_read_req_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_fileio_read_req_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_FILEIO_READ_REQ_ENCODED_OVERHEAD 9u - #define SBP_MSG_FILEIO_READ_RESP 0x00A3 /** - * The maximum number of items that can be stored in sbp_msg_fileio_read_resp_t::contents (V4 API) or msg_fileio_read_resp_t::contents (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_fileio_read_resp_t::contents (V4 API) or + * msg_fileio_read_resp_t::contents (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_FILEIO_READ_RESP_CONTENTS_MAX 251u - /** - * Encoded length of sbp_msg_fileio_read_resp_t (V4 API) and + * Encoded length of sbp_msg_fileio_read_resp_t (V4 API) and * msg_fileio_read_resp_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_fileio_read_resp_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_fileio_read_resp_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_FILEIO_READ_RESP_ENCODED_OVERHEAD 4u - #define SBP_MSG_FILEIO_READ_DIR_REQ 0x00A9 /** - * The maximum number of items that can be stored in sbp_msg_fileio_read_dir_req_t::dirname (V4 API) or msg_fileio_read_dir_req_t::dirname (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_fileio_read_dir_req_t::dirname (V4 API) or + * msg_fileio_read_dir_req_t::dirname (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX 247u - /** - * Encoded length of sbp_msg_fileio_read_dir_req_t (V4 API) and + * Encoded length of sbp_msg_fileio_read_dir_req_t (V4 API) and * msg_fileio_read_dir_req_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_fileio_read_dir_req_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_fileio_read_dir_req_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_FILEIO_READ_DIR_REQ_ENCODED_OVERHEAD 8u - #define SBP_MSG_FILEIO_READ_DIR_RESP 0x00AA /** - * The maximum number of items that can be stored in sbp_msg_fileio_read_dir_resp_t::contents (V4 API) or msg_fileio_read_dir_resp_t::contents (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_fileio_read_dir_resp_t::contents (V4 API) or + * msg_fileio_read_dir_resp_t::contents (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX 251u - /** - * Encoded length of sbp_msg_fileio_read_dir_resp_t (V4 API) and + * Encoded length of sbp_msg_fileio_read_dir_resp_t (V4 API) and * msg_fileio_read_dir_resp_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_fileio_read_dir_resp_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_fileio_read_dir_resp_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_FILEIO_READ_DIR_RESP_ENCODED_OVERHEAD 4u - #define SBP_MSG_FILEIO_REMOVE 0x00AC /** - * The maximum number of items that can be stored in sbp_msg_fileio_remove_t::filename (V4 API) or msg_fileio_remove_t::filename (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_fileio_remove_t::filename (V4 API) or msg_fileio_remove_t::filename + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_FILEIO_REMOVE_FILENAME_MAX 255u - /** - * Encoded length of sbp_msg_fileio_remove_t (V4 API) and + * Encoded length of sbp_msg_fileio_remove_t (V4 API) and * msg_fileio_remove_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_fileio_remove_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_fileio_remove_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_FILEIO_REMOVE_ENCODED_OVERHEAD 0u - #define SBP_MSG_FILEIO_WRITE_REQ 0x00AD /** - * The maximum number of items that can be stored in sbp_msg_fileio_write_req_t::filename (V4 API) or msg_fileio_write_req_t::filename (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_fileio_write_req_t::filename (V4 API) or + * msg_fileio_write_req_t::filename (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX 247u - /** - * The maximum number of items that can be stored in sbp_msg_fileio_write_req_t::data (V4 API) or msg_fileio_write_req_t::data (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_fileio_write_req_t::data (V4 API) or msg_fileio_write_req_t::data + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_FILEIO_WRITE_REQ_DATA_MAX 247u - /** - * Encoded length of sbp_msg_fileio_write_req_t (V4 API) and + * Encoded length of sbp_msg_fileio_write_req_t (V4 API) and * msg_fileio_write_req_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_fileio_write_req_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_fileio_write_req_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_FILEIO_WRITE_REQ_ENCODED_OVERHEAD 8u - #define SBP_MSG_FILEIO_WRITE_RESP 0x00AB /** - * Encoded length of sbp_msg_fileio_write_resp_t (V4 API) and + * Encoded length of sbp_msg_fileio_write_resp_t (V4 API) and * msg_fileio_write_resp_t (legacy API) */ #define SBP_MSG_FILEIO_WRITE_RESP_ENCODED_LEN 4u - #define SBP_MSG_FILEIO_CONFIG_REQ 0x1001 /** - * Encoded length of sbp_msg_fileio_config_req_t (V4 API) and + * Encoded length of sbp_msg_fileio_config_req_t (V4 API) and * msg_fileio_config_req_t (legacy API) */ #define SBP_MSG_FILEIO_CONFIG_REQ_ENCODED_LEN 4u - #define SBP_MSG_FILEIO_CONFIG_RESP 0x1002 /** - * Encoded length of sbp_msg_fileio_config_resp_t (V4 API) and + * Encoded length of sbp_msg_fileio_config_resp_t (V4 API) and * msg_fileio_config_resp_t (legacy API) */ #define SBP_MSG_FILEIO_CONFIG_RESP_ENCODED_LEN 16u - - #endif /* LIBSBP_FILE_IO_MACROS_H */ diff --git a/c/include/libsbp/flash.h b/c/include/libsbp/flash.h index 0cd51e76b..82ec65679 100644 --- a/c/include/libsbp/flash.h +++ b/c/include/libsbp/flash.h @@ -17,15 +17,15 @@ #ifndef LIBSBP_FLASH_MESSAGES_H #define LIBSBP_FLASH_MESSAGES_H -#include #include +#include +#include #include #include -#include +#include #include #include #include #include -#include #endif /* LIBSBP_FLASH_MESSAGES_H */ diff --git a/c/include/libsbp/flash/MSG_FLASH_DONE.h b/c/include/libsbp/flash/MSG_FLASH_DONE.h index c62cb641f..b3985f90e 100644 --- a/c/include/libsbp/flash/MSG_FLASH_DONE.h +++ b/c/include/libsbp/flash/MSG_FLASH_DONE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FLASH_MSG_FLASH_DONE_H #define LIBSBP_FLASH_MSG_FLASH_DONE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,27 +40,25 @@ *****************************************************************************/ /** Flash response message (host <= device) * -* This message defines success or failure codes for a variety of flash memory requests from the host to the device. Flash read and write messages, such as MSG_FLASH_READ_REQ, or MSG_FLASH_PROGRAM, may return this message on failure. + * This message defines success or failure codes for a variety of flash memory + * requests from the host to the device. Flash read and write messages, such as + * MSG_FLASH_READ_REQ, or MSG_FLASH_PROGRAM, may return this message on failure. */ typedef struct { - - /** -* Response flags + * Response flags */ u8 response; } sbp_msg_flash_done_t; - - /** * Get encoded size of an instance of sbp_msg_flash_done_t * * @param msg sbp_msg_flash_done_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_flash_done_encoded_len(const sbp_msg_flash_done_t *msg) -{ +static inline size_t sbp_msg_flash_done_encoded_len( + const sbp_msg_flash_done_t *msg) { (void)msg; return SBP_MSG_FLASH_DONE_ENCODED_LEN; } @@ -68,36 +66,53 @@ static inline size_t sbp_msg_flash_done_encoded_len(const sbp_msg_flash_done_t * /** * Encode an instance of sbp_msg_flash_done_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_flash_done_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_flash_done_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_flash_done_t *msg); +SBP_EXPORT s8 sbp_msg_flash_done_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_flash_done_t *msg); /** * Decode an instance of sbp_msg_flash_done_t from wire representation * - * This function decodes the wire representation of a sbp_msg_flash_done_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_flash_done_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_flash_done_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_flash_done_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_flash_done_t *msg); +SBP_EXPORT s8 sbp_msg_flash_done_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_flash_done_t *msg); /** * Send an instance of sbp_msg_flash_done_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_flash_done_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_flash_done_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -105,51 +120,61 @@ SBP_EXPORT s8 sbp_msg_flash_done_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_flash_done_send(sbp_state_t *s, u16 sender_id, const sbp_msg_flash_done_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_flash_done_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_flash_done_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_flash_done_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_flash_done_t instance * @param b sbp_msg_flash_done_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_flash_done_cmp(const sbp_msg_flash_done_t *a, const sbp_msg_flash_done_t *b); +SBP_EXPORT int sbp_msg_flash_done_cmp(const sbp_msg_flash_done_t *a, + const sbp_msg_flash_done_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_flash_done_t &lhs, const sbp_msg_flash_done_t &rhs) { +static inline bool operator==(const sbp_msg_flash_done_t &lhs, + const sbp_msg_flash_done_t &rhs) { return sbp_msg_flash_done_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_flash_done_t &lhs, const sbp_msg_flash_done_t &rhs) { +static inline bool operator!=(const sbp_msg_flash_done_t &lhs, + const sbp_msg_flash_done_t &rhs) { return sbp_msg_flash_done_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_flash_done_t &lhs, const sbp_msg_flash_done_t &rhs) { +static inline bool operator<(const sbp_msg_flash_done_t &lhs, + const sbp_msg_flash_done_t &rhs) { return sbp_msg_flash_done_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_flash_done_t &lhs, const sbp_msg_flash_done_t &rhs) { +static inline bool operator<=(const sbp_msg_flash_done_t &lhs, + const sbp_msg_flash_done_t &rhs) { return sbp_msg_flash_done_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_flash_done_t &lhs, const sbp_msg_flash_done_t &rhs) { +static inline bool operator>(const sbp_msg_flash_done_t &lhs, + const sbp_msg_flash_done_t &rhs) { return sbp_msg_flash_done_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_flash_done_t &lhs, const sbp_msg_flash_done_t &rhs) { +static inline bool operator>=(const sbp_msg_flash_done_t &lhs, + const sbp_msg_flash_done_t &rhs) { return sbp_msg_flash_done_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FLASH_MSG_FLASH_DONE_H */ - diff --git a/c/include/libsbp/flash/MSG_FLASH_ERASE.h b/c/include/libsbp/flash/MSG_FLASH_ERASE.h index 51c2a0bcd..71fd54729 100644 --- a/c/include/libsbp/flash/MSG_FLASH_ERASE.h +++ b/c/include/libsbp/flash/MSG_FLASH_ERASE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FLASH_MSG_FLASH_ERASE_H #define LIBSBP_FLASH_MSG_FLASH_ERASE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,33 +40,31 @@ *****************************************************************************/ /** Erase sector of device flash memory (host => device) * -* The flash erase message from the host erases a sector of either the STM or M25 onboard flash memory. The device will reply with a MSG_FLASH_DONE message containing the return code - FLASH_OK (0) on success or FLASH_INVALID_FLASH (1) if the flash specified is invalid. + * The flash erase message from the host erases a sector of either the STM or + * M25 onboard flash memory. The device will reply with a MSG_FLASH_DONE message + * containing the return code - FLASH_OK (0) on success or FLASH_INVALID_FLASH + * (1) if the flash specified is invalid. */ typedef struct { - - /** -* Target flags + * Target flags */ u8 target; - /** - * Flash sector number to erase (0-11 for the STM, 0-15 for the M25) + * Flash sector number to erase (0-11 for the STM, 0-15 for the M25) */ u32 sector_num; } sbp_msg_flash_erase_t; - - /** * Get encoded size of an instance of sbp_msg_flash_erase_t * * @param msg sbp_msg_flash_erase_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_flash_erase_encoded_len(const sbp_msg_flash_erase_t *msg) -{ +static inline size_t sbp_msg_flash_erase_encoded_len( + const sbp_msg_flash_erase_t *msg) { (void)msg; return SBP_MSG_FLASH_ERASE_ENCODED_LEN; } @@ -74,36 +72,53 @@ static inline size_t sbp_msg_flash_erase_encoded_len(const sbp_msg_flash_erase_t /** * Encode an instance of sbp_msg_flash_erase_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_flash_erase_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_flash_erase_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_flash_erase_t *msg); +SBP_EXPORT s8 sbp_msg_flash_erase_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_flash_erase_t *msg); /** * Decode an instance of sbp_msg_flash_erase_t from wire representation * - * This function decodes the wire representation of a sbp_msg_flash_erase_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_flash_erase_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_flash_erase_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_flash_erase_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_flash_erase_t *msg); +SBP_EXPORT s8 sbp_msg_flash_erase_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_flash_erase_t *msg); /** * Send an instance of sbp_msg_flash_erase_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_flash_erase_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_flash_erase_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -111,51 +126,61 @@ SBP_EXPORT s8 sbp_msg_flash_erase_decode(const uint8_t *buf, uint8_t len, uint8_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_flash_erase_send(sbp_state_t *s, u16 sender_id, const sbp_msg_flash_erase_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_flash_erase_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_flash_erase_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_flash_erase_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_flash_erase_t instance * @param b sbp_msg_flash_erase_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_flash_erase_cmp(const sbp_msg_flash_erase_t *a, const sbp_msg_flash_erase_t *b); +SBP_EXPORT int sbp_msg_flash_erase_cmp(const sbp_msg_flash_erase_t *a, + const sbp_msg_flash_erase_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_flash_erase_t &lhs, const sbp_msg_flash_erase_t &rhs) { +static inline bool operator==(const sbp_msg_flash_erase_t &lhs, + const sbp_msg_flash_erase_t &rhs) { return sbp_msg_flash_erase_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_flash_erase_t &lhs, const sbp_msg_flash_erase_t &rhs) { +static inline bool operator!=(const sbp_msg_flash_erase_t &lhs, + const sbp_msg_flash_erase_t &rhs) { return sbp_msg_flash_erase_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_flash_erase_t &lhs, const sbp_msg_flash_erase_t &rhs) { +static inline bool operator<(const sbp_msg_flash_erase_t &lhs, + const sbp_msg_flash_erase_t &rhs) { return sbp_msg_flash_erase_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_flash_erase_t &lhs, const sbp_msg_flash_erase_t &rhs) { +static inline bool operator<=(const sbp_msg_flash_erase_t &lhs, + const sbp_msg_flash_erase_t &rhs) { return sbp_msg_flash_erase_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_flash_erase_t &lhs, const sbp_msg_flash_erase_t &rhs) { +static inline bool operator>(const sbp_msg_flash_erase_t &lhs, + const sbp_msg_flash_erase_t &rhs) { return sbp_msg_flash_erase_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_flash_erase_t &lhs, const sbp_msg_flash_erase_t &rhs) { +static inline bool operator>=(const sbp_msg_flash_erase_t &lhs, + const sbp_msg_flash_erase_t &rhs) { return sbp_msg_flash_erase_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FLASH_MSG_FLASH_ERASE_H */ - diff --git a/c/include/libsbp/flash/MSG_FLASH_PROGRAM.h b/c/include/libsbp/flash/MSG_FLASH_PROGRAM.h index 4818dcee0..39af114c9 100644 --- a/c/include/libsbp/flash/MSG_FLASH_PROGRAM.h +++ b/c/include/libsbp/flash/MSG_FLASH_PROGRAM.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FLASH_MSG_FLASH_PROGRAM_H #define LIBSBP_FLASH_MSG_FLASH_PROGRAM_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,83 +40,97 @@ *****************************************************************************/ /** Program flash addresses * -* The flash program message programs a set of addresses of either the STM or M25 flash. The device replies with either a MSG_FLASH_DONE message containing the return code FLASH_OK (0) on success, or FLASH_INVALID_LEN (2) if the maximum write size is exceeded. Note that the sector-containing addresses must be erased before addresses can be programmed. + * The flash program message programs a set of addresses of either the STM or + * M25 flash. The device replies with either a MSG_FLASH_DONE message containing + * the return code FLASH_OK (0) on success, or FLASH_INVALID_LEN (2) if the + * maximum write size is exceeded. Note that the sector-containing addresses + * must be erased before addresses can be programmed. */ typedef struct { - - /** -* Target flags + * Target flags */ u8 target; - /** -* Starting address offset to program [bytes] + * Starting address offset to program [bytes] */ u8 addr_start[SBP_MSG_FLASH_PROGRAM_ADDR_START_MAX]; - /** - * Length of set of addresses to program, counting up from starting address [bytes] + * Length of set of addresses to program, counting up from starting address + * [bytes] */ u8 addr_len; - /** -* Data to program addresses with, with length N=addr_len + * Data to program addresses with, with length N=addr_len */ u8 data[SBP_MSG_FLASH_PROGRAM_DATA_MAX]; } sbp_msg_flash_program_t; - - /** * Get encoded size of an instance of sbp_msg_flash_program_t * * @param msg sbp_msg_flash_program_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_flash_program_encoded_len(const sbp_msg_flash_program_t *msg) -{ - return SBP_MSG_FLASH_PROGRAM_ENCODED_OVERHEAD - + (msg->addr_len * SBP_ENCODED_LEN_U8) - ; +static inline size_t sbp_msg_flash_program_encoded_len( + const sbp_msg_flash_program_t *msg) { + return SBP_MSG_FLASH_PROGRAM_ENCODED_OVERHEAD + + (msg->addr_len * SBP_ENCODED_LEN_U8); } /** * Encode an instance of sbp_msg_flash_program_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_flash_program_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_flash_program_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_flash_program_t *msg); +SBP_EXPORT s8 sbp_msg_flash_program_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_flash_program_t *msg); /** * Decode an instance of sbp_msg_flash_program_t from wire representation * - * This function decodes the wire representation of a sbp_msg_flash_program_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_flash_program_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_flash_program_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_flash_program_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_flash_program_t *msg); +SBP_EXPORT s8 sbp_msg_flash_program_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_flash_program_t *msg); /** * Send an instance of sbp_msg_flash_program_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_flash_program_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_flash_program_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -124,51 +138,61 @@ SBP_EXPORT s8 sbp_msg_flash_program_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_flash_program_send(sbp_state_t *s, u16 sender_id, const sbp_msg_flash_program_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_flash_program_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_flash_program_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_flash_program_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_flash_program_t instance * @param b sbp_msg_flash_program_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_flash_program_cmp(const sbp_msg_flash_program_t *a, const sbp_msg_flash_program_t *b); +SBP_EXPORT int sbp_msg_flash_program_cmp(const sbp_msg_flash_program_t *a, + const sbp_msg_flash_program_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_flash_program_t &lhs, const sbp_msg_flash_program_t &rhs) { +static inline bool operator==(const sbp_msg_flash_program_t &lhs, + const sbp_msg_flash_program_t &rhs) { return sbp_msg_flash_program_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_flash_program_t &lhs, const sbp_msg_flash_program_t &rhs) { +static inline bool operator!=(const sbp_msg_flash_program_t &lhs, + const sbp_msg_flash_program_t &rhs) { return sbp_msg_flash_program_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_flash_program_t &lhs, const sbp_msg_flash_program_t &rhs) { +static inline bool operator<(const sbp_msg_flash_program_t &lhs, + const sbp_msg_flash_program_t &rhs) { return sbp_msg_flash_program_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_flash_program_t &lhs, const sbp_msg_flash_program_t &rhs) { +static inline bool operator<=(const sbp_msg_flash_program_t &lhs, + const sbp_msg_flash_program_t &rhs) { return sbp_msg_flash_program_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_flash_program_t &lhs, const sbp_msg_flash_program_t &rhs) { +static inline bool operator>(const sbp_msg_flash_program_t &lhs, + const sbp_msg_flash_program_t &rhs) { return sbp_msg_flash_program_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_flash_program_t &lhs, const sbp_msg_flash_program_t &rhs) { +static inline bool operator>=(const sbp_msg_flash_program_t &lhs, + const sbp_msg_flash_program_t &rhs) { return sbp_msg_flash_program_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FLASH_MSG_FLASH_PROGRAM_H */ - diff --git a/c/include/libsbp/flash/MSG_FLASH_READ_REQ.h b/c/include/libsbp/flash/MSG_FLASH_READ_REQ.h index baab9b229..49116127f 100644 --- a/c/include/libsbp/flash/MSG_FLASH_READ_REQ.h +++ b/c/include/libsbp/flash/MSG_FLASH_READ_REQ.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FLASH_MSG_FLASH_READ_REQ_H #define LIBSBP_FLASH_MSG_FLASH_READ_REQ_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,39 +40,39 @@ *****************************************************************************/ /** Read STM or M25 flash address request (host => device) * -* The flash read message reads a set of addresses of either the STM or M25 onboard flash. The device replies with a MSG_FLASH_READ_RESP message containing either the read data on success or a MSG_FLASH_DONE message containing the return code FLASH_INVALID_LEN (2) if the maximum read size is exceeded or FLASH_INVALID_ADDR (3) if the address is outside of the allowed range. + * The flash read message reads a set of addresses of either the STM or M25 + * onboard flash. The device replies with a MSG_FLASH_READ_RESP message + * containing either the read data on success or a MSG_FLASH_DONE message + * containing the return code FLASH_INVALID_LEN (2) if the maximum read size is + * exceeded or FLASH_INVALID_ADDR (3) if the address is outside of the allowed + * range. */ typedef struct { - - /** -* Target flags + * Target flags */ u8 target; - /** -* Starting address offset to read from [bytes] + * Starting address offset to read from [bytes] */ u8 addr_start[SBP_MSG_FLASH_READ_REQ_ADDR_START_MAX]; - /** - * Length of set of addresses to read, counting up from starting address [bytes] + * Length of set of addresses to read, counting up from starting address + * [bytes] */ u8 addr_len; } sbp_msg_flash_read_req_t; - - /** * Get encoded size of an instance of sbp_msg_flash_read_req_t * * @param msg sbp_msg_flash_read_req_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_flash_read_req_encoded_len(const sbp_msg_flash_read_req_t *msg) -{ +static inline size_t sbp_msg_flash_read_req_encoded_len( + const sbp_msg_flash_read_req_t *msg) { (void)msg; return SBP_MSG_FLASH_READ_REQ_ENCODED_LEN; } @@ -80,36 +80,53 @@ static inline size_t sbp_msg_flash_read_req_encoded_len(const sbp_msg_flash_read /** * Encode an instance of sbp_msg_flash_read_req_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_flash_read_req_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_flash_read_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_flash_read_req_t *msg); +SBP_EXPORT s8 +sbp_msg_flash_read_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_flash_read_req_t *msg); /** * Decode an instance of sbp_msg_flash_read_req_t from wire representation * - * This function decodes the wire representation of a sbp_msg_flash_read_req_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_flash_read_req_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_flash_read_req_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_flash_read_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_flash_read_req_t *msg); +SBP_EXPORT s8 sbp_msg_flash_read_req_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_flash_read_req_t *msg); /** * Send an instance of sbp_msg_flash_read_req_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_flash_read_req_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_flash_read_req_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -117,51 +134,61 @@ SBP_EXPORT s8 sbp_msg_flash_read_req_decode(const uint8_t *buf, uint8_t len, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_flash_read_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_flash_read_req_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_flash_read_req_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_flash_read_req_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_flash_read_req_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_flash_read_req_t instance * @param b sbp_msg_flash_read_req_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_flash_read_req_cmp(const sbp_msg_flash_read_req_t *a, const sbp_msg_flash_read_req_t *b); +SBP_EXPORT int sbp_msg_flash_read_req_cmp(const sbp_msg_flash_read_req_t *a, + const sbp_msg_flash_read_req_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_flash_read_req_t &lhs, const sbp_msg_flash_read_req_t &rhs) { +static inline bool operator==(const sbp_msg_flash_read_req_t &lhs, + const sbp_msg_flash_read_req_t &rhs) { return sbp_msg_flash_read_req_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_flash_read_req_t &lhs, const sbp_msg_flash_read_req_t &rhs) { +static inline bool operator!=(const sbp_msg_flash_read_req_t &lhs, + const sbp_msg_flash_read_req_t &rhs) { return sbp_msg_flash_read_req_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_flash_read_req_t &lhs, const sbp_msg_flash_read_req_t &rhs) { +static inline bool operator<(const sbp_msg_flash_read_req_t &lhs, + const sbp_msg_flash_read_req_t &rhs) { return sbp_msg_flash_read_req_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_flash_read_req_t &lhs, const sbp_msg_flash_read_req_t &rhs) { +static inline bool operator<=(const sbp_msg_flash_read_req_t &lhs, + const sbp_msg_flash_read_req_t &rhs) { return sbp_msg_flash_read_req_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_flash_read_req_t &lhs, const sbp_msg_flash_read_req_t &rhs) { +static inline bool operator>(const sbp_msg_flash_read_req_t &lhs, + const sbp_msg_flash_read_req_t &rhs) { return sbp_msg_flash_read_req_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_flash_read_req_t &lhs, const sbp_msg_flash_read_req_t &rhs) { +static inline bool operator>=(const sbp_msg_flash_read_req_t &lhs, + const sbp_msg_flash_read_req_t &rhs) { return sbp_msg_flash_read_req_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FLASH_MSG_FLASH_READ_REQ_H */ - diff --git a/c/include/libsbp/flash/MSG_FLASH_READ_RESP.h b/c/include/libsbp/flash/MSG_FLASH_READ_RESP.h index e38ffcf07..07081db0f 100644 --- a/c/include/libsbp/flash/MSG_FLASH_READ_RESP.h +++ b/c/include/libsbp/flash/MSG_FLASH_READ_RESP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FLASH_MSG_FLASH_READ_RESP_H #define LIBSBP_FLASH_MSG_FLASH_READ_RESP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,39 +40,39 @@ *****************************************************************************/ /** Read STM or M25 flash address response (host <= device) * -* The flash read message reads a set of addresses of either the STM or M25 onboard flash. The device replies with a MSG_FLASH_READ_RESP message containing either the read data on success or a MSG_FLASH_DONE message containing the return code FLASH_INVALID_LEN (2) if the maximum read size is exceeded or FLASH_INVALID_ADDR (3) if the address is outside of the allowed range. + * The flash read message reads a set of addresses of either the STM or M25 + * onboard flash. The device replies with a MSG_FLASH_READ_RESP message + * containing either the read data on success or a MSG_FLASH_DONE message + * containing the return code FLASH_INVALID_LEN (2) if the maximum read size is + * exceeded or FLASH_INVALID_ADDR (3) if the address is outside of the allowed + * range. */ typedef struct { - - /** -* Target flags + * Target flags */ u8 target; - /** -* Starting address offset to read from [bytes] + * Starting address offset to read from [bytes] */ u8 addr_start[SBP_MSG_FLASH_READ_RESP_ADDR_START_MAX]; - /** - * Length of set of addresses to read, counting up from starting address [bytes] + * Length of set of addresses to read, counting up from starting address + * [bytes] */ u8 addr_len; } sbp_msg_flash_read_resp_t; - - /** * Get encoded size of an instance of sbp_msg_flash_read_resp_t * * @param msg sbp_msg_flash_read_resp_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_flash_read_resp_encoded_len(const sbp_msg_flash_read_resp_t *msg) -{ +static inline size_t sbp_msg_flash_read_resp_encoded_len( + const sbp_msg_flash_read_resp_t *msg) { (void)msg; return SBP_MSG_FLASH_READ_RESP_ENCODED_LEN; } @@ -80,36 +80,53 @@ static inline size_t sbp_msg_flash_read_resp_encoded_len(const sbp_msg_flash_rea /** * Encode an instance of sbp_msg_flash_read_resp_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_flash_read_resp_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_flash_read_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_flash_read_resp_t *msg); +SBP_EXPORT s8 +sbp_msg_flash_read_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_flash_read_resp_t *msg); /** * Decode an instance of sbp_msg_flash_read_resp_t from wire representation * - * This function decodes the wire representation of a sbp_msg_flash_read_resp_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_flash_read_resp_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_flash_read_resp_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_flash_read_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_flash_read_resp_t *msg); +SBP_EXPORT s8 sbp_msg_flash_read_resp_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_flash_read_resp_t *msg); /** * Send an instance of sbp_msg_flash_read_resp_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_flash_read_resp_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_flash_read_resp_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -117,51 +134,61 @@ SBP_EXPORT s8 sbp_msg_flash_read_resp_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_flash_read_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_flash_read_resp_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_flash_read_resp_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_flash_read_resp_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_flash_read_resp_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_flash_read_resp_t instance * @param b sbp_msg_flash_read_resp_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_flash_read_resp_cmp(const sbp_msg_flash_read_resp_t *a, const sbp_msg_flash_read_resp_t *b); +SBP_EXPORT int sbp_msg_flash_read_resp_cmp(const sbp_msg_flash_read_resp_t *a, + const sbp_msg_flash_read_resp_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_flash_read_resp_t &lhs, const sbp_msg_flash_read_resp_t &rhs) { +static inline bool operator==(const sbp_msg_flash_read_resp_t &lhs, + const sbp_msg_flash_read_resp_t &rhs) { return sbp_msg_flash_read_resp_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_flash_read_resp_t &lhs, const sbp_msg_flash_read_resp_t &rhs) { +static inline bool operator!=(const sbp_msg_flash_read_resp_t &lhs, + const sbp_msg_flash_read_resp_t &rhs) { return sbp_msg_flash_read_resp_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_flash_read_resp_t &lhs, const sbp_msg_flash_read_resp_t &rhs) { +static inline bool operator<(const sbp_msg_flash_read_resp_t &lhs, + const sbp_msg_flash_read_resp_t &rhs) { return sbp_msg_flash_read_resp_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_flash_read_resp_t &lhs, const sbp_msg_flash_read_resp_t &rhs) { +static inline bool operator<=(const sbp_msg_flash_read_resp_t &lhs, + const sbp_msg_flash_read_resp_t &rhs) { return sbp_msg_flash_read_resp_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_flash_read_resp_t &lhs, const sbp_msg_flash_read_resp_t &rhs) { +static inline bool operator>(const sbp_msg_flash_read_resp_t &lhs, + const sbp_msg_flash_read_resp_t &rhs) { return sbp_msg_flash_read_resp_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_flash_read_resp_t &lhs, const sbp_msg_flash_read_resp_t &rhs) { +static inline bool operator>=(const sbp_msg_flash_read_resp_t &lhs, + const sbp_msg_flash_read_resp_t &rhs) { return sbp_msg_flash_read_resp_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FLASH_MSG_FLASH_READ_RESP_H */ - diff --git a/c/include/libsbp/flash/MSG_M25_FLASH_WRITE_STATUS.h b/c/include/libsbp/flash/MSG_M25_FLASH_WRITE_STATUS.h index 9ab0d7b3a..be1e16521 100644 --- a/c/include/libsbp/flash/MSG_M25_FLASH_WRITE_STATUS.h +++ b/c/include/libsbp/flash/MSG_M25_FLASH_WRITE_STATUS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FLASH_MSG_M25_FLASH_WRITE_STATUS_H #define LIBSBP_FLASH_MSG_M25_FLASH_WRITE_STATUS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,27 +40,24 @@ *****************************************************************************/ /** Write M25 flash status register (host => device) * -* The flash status message writes to the 8-bit M25 flash status register. The device replies with a MSG_FLASH_DONE message. + * The flash status message writes to the 8-bit M25 flash status register. The + * device replies with a MSG_FLASH_DONE message. */ typedef struct { - - /** -* Byte to write to the M25 flash status register + * Byte to write to the M25 flash status register */ u8 status[SBP_MSG_M25_FLASH_WRITE_STATUS_STATUS_MAX]; } sbp_msg_m25_flash_write_status_t; - - /** * Get encoded size of an instance of sbp_msg_m25_flash_write_status_t * * @param msg sbp_msg_m25_flash_write_status_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_m25_flash_write_status_encoded_len(const sbp_msg_m25_flash_write_status_t *msg) -{ +static inline size_t sbp_msg_m25_flash_write_status_encoded_len( + const sbp_msg_m25_flash_write_status_t *msg) { (void)msg; return SBP_MSG_M25_FLASH_WRITE_STATUS_ENCODED_LEN; } @@ -68,36 +65,56 @@ static inline size_t sbp_msg_m25_flash_write_status_encoded_len(const sbp_msg_m2 /** * Encode an instance of sbp_msg_m25_flash_write_status_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_m25_flash_write_status_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_m25_flash_write_status_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_m25_flash_write_status_t *msg); +SBP_EXPORT s8 sbp_msg_m25_flash_write_status_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_m25_flash_write_status_t *msg); /** - * Decode an instance of sbp_msg_m25_flash_write_status_t from wire representation + * Decode an instance of sbp_msg_m25_flash_write_status_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_m25_flash_write_status_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_m25_flash_write_status_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_m25_flash_write_status_t instance + * @param buf Wire representation of the sbp_msg_m25_flash_write_status_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_m25_flash_write_status_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_m25_flash_write_status_t *msg); +SBP_EXPORT s8 sbp_msg_m25_flash_write_status_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_m25_flash_write_status_t *msg); /** - * Send an instance of sbp_msg_m25_flash_write_status_t with the given write function + * Send an instance of sbp_msg_m25_flash_write_status_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_m25_flash_write_status_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_m25_flash_write_status_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -105,51 +122,62 @@ SBP_EXPORT s8 sbp_msg_m25_flash_write_status_decode(const uint8_t *buf, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_m25_flash_write_status_send(sbp_state_t *s, u16 sender_id, const sbp_msg_m25_flash_write_status_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_m25_flash_write_status_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_m25_flash_write_status_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_m25_flash_write_status_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_m25_flash_write_status_t instance * @param b sbp_msg_m25_flash_write_status_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_m25_flash_write_status_cmp(const sbp_msg_m25_flash_write_status_t *a, const sbp_msg_m25_flash_write_status_t *b); +SBP_EXPORT int sbp_msg_m25_flash_write_status_cmp( + const sbp_msg_m25_flash_write_status_t *a, + const sbp_msg_m25_flash_write_status_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_m25_flash_write_status_t &lhs, const sbp_msg_m25_flash_write_status_t &rhs) { +static inline bool operator==(const sbp_msg_m25_flash_write_status_t &lhs, + const sbp_msg_m25_flash_write_status_t &rhs) { return sbp_msg_m25_flash_write_status_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_m25_flash_write_status_t &lhs, const sbp_msg_m25_flash_write_status_t &rhs) { +static inline bool operator!=(const sbp_msg_m25_flash_write_status_t &lhs, + const sbp_msg_m25_flash_write_status_t &rhs) { return sbp_msg_m25_flash_write_status_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_m25_flash_write_status_t &lhs, const sbp_msg_m25_flash_write_status_t &rhs) { +static inline bool operator<(const sbp_msg_m25_flash_write_status_t &lhs, + const sbp_msg_m25_flash_write_status_t &rhs) { return sbp_msg_m25_flash_write_status_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_m25_flash_write_status_t &lhs, const sbp_msg_m25_flash_write_status_t &rhs) { +static inline bool operator<=(const sbp_msg_m25_flash_write_status_t &lhs, + const sbp_msg_m25_flash_write_status_t &rhs) { return sbp_msg_m25_flash_write_status_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_m25_flash_write_status_t &lhs, const sbp_msg_m25_flash_write_status_t &rhs) { +static inline bool operator>(const sbp_msg_m25_flash_write_status_t &lhs, + const sbp_msg_m25_flash_write_status_t &rhs) { return sbp_msg_m25_flash_write_status_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_m25_flash_write_status_t &lhs, const sbp_msg_m25_flash_write_status_t &rhs) { +static inline bool operator>=(const sbp_msg_m25_flash_write_status_t &lhs, + const sbp_msg_m25_flash_write_status_t &rhs) { return sbp_msg_m25_flash_write_status_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FLASH_MSG_M25_FLASH_WRITE_STATUS_H */ - diff --git a/c/include/libsbp/flash/MSG_STM_FLASH_LOCK_SECTOR.h b/c/include/libsbp/flash/MSG_STM_FLASH_LOCK_SECTOR.h index 2d0ea358c..87a96b0e5 100644 --- a/c/include/libsbp/flash/MSG_STM_FLASH_LOCK_SECTOR.h +++ b/c/include/libsbp/flash/MSG_STM_FLASH_LOCK_SECTOR.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FLASH_MSG_STM_FLASH_LOCK_SECTOR_H #define LIBSBP_FLASH_MSG_STM_FLASH_LOCK_SECTOR_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,27 +40,24 @@ *****************************************************************************/ /** Lock sector of STM flash memory (host => device) * -* The flash lock message locks a sector of the STM flash memory. The device replies with a MSG_FLASH_DONE message. + * The flash lock message locks a sector of the STM flash memory. The device + * replies with a MSG_FLASH_DONE message. */ typedef struct { - - /** -* Flash sector number to lock + * Flash sector number to lock */ u32 sector; } sbp_msg_stm_flash_lock_sector_t; - - /** * Get encoded size of an instance of sbp_msg_stm_flash_lock_sector_t * * @param msg sbp_msg_stm_flash_lock_sector_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_stm_flash_lock_sector_encoded_len(const sbp_msg_stm_flash_lock_sector_t *msg) -{ +static inline size_t sbp_msg_stm_flash_lock_sector_encoded_len( + const sbp_msg_stm_flash_lock_sector_t *msg) { (void)msg; return SBP_MSG_STM_FLASH_LOCK_SECTOR_ENCODED_LEN; } @@ -68,36 +65,56 @@ static inline size_t sbp_msg_stm_flash_lock_sector_encoded_len(const sbp_msg_stm /** * Encode an instance of sbp_msg_stm_flash_lock_sector_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_stm_flash_lock_sector_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_stm_flash_lock_sector_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_stm_flash_lock_sector_t *msg); +SBP_EXPORT s8 sbp_msg_stm_flash_lock_sector_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_stm_flash_lock_sector_t *msg); /** - * Decode an instance of sbp_msg_stm_flash_lock_sector_t from wire representation + * Decode an instance of sbp_msg_stm_flash_lock_sector_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_stm_flash_lock_sector_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_stm_flash_lock_sector_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_stm_flash_lock_sector_t instance + * @param buf Wire representation of the sbp_msg_stm_flash_lock_sector_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_stm_flash_lock_sector_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_stm_flash_lock_sector_t *msg); +SBP_EXPORT s8 sbp_msg_stm_flash_lock_sector_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_stm_flash_lock_sector_t *msg); /** - * Send an instance of sbp_msg_stm_flash_lock_sector_t with the given write function + * Send an instance of sbp_msg_stm_flash_lock_sector_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_stm_flash_lock_sector_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_stm_flash_lock_sector_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -105,51 +122,62 @@ SBP_EXPORT s8 sbp_msg_stm_flash_lock_sector_decode(const uint8_t *buf, uint8_t l * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_stm_flash_lock_sector_send(sbp_state_t *s, u16 sender_id, const sbp_msg_stm_flash_lock_sector_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_stm_flash_lock_sector_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_stm_flash_lock_sector_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_stm_flash_lock_sector_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_stm_flash_lock_sector_t instance * @param b sbp_msg_stm_flash_lock_sector_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_stm_flash_lock_sector_cmp(const sbp_msg_stm_flash_lock_sector_t *a, const sbp_msg_stm_flash_lock_sector_t *b); +SBP_EXPORT int sbp_msg_stm_flash_lock_sector_cmp( + const sbp_msg_stm_flash_lock_sector_t *a, + const sbp_msg_stm_flash_lock_sector_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_stm_flash_lock_sector_t &lhs, const sbp_msg_stm_flash_lock_sector_t &rhs) { +static inline bool operator==(const sbp_msg_stm_flash_lock_sector_t &lhs, + const sbp_msg_stm_flash_lock_sector_t &rhs) { return sbp_msg_stm_flash_lock_sector_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_stm_flash_lock_sector_t &lhs, const sbp_msg_stm_flash_lock_sector_t &rhs) { +static inline bool operator!=(const sbp_msg_stm_flash_lock_sector_t &lhs, + const sbp_msg_stm_flash_lock_sector_t &rhs) { return sbp_msg_stm_flash_lock_sector_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_stm_flash_lock_sector_t &lhs, const sbp_msg_stm_flash_lock_sector_t &rhs) { +static inline bool operator<(const sbp_msg_stm_flash_lock_sector_t &lhs, + const sbp_msg_stm_flash_lock_sector_t &rhs) { return sbp_msg_stm_flash_lock_sector_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_stm_flash_lock_sector_t &lhs, const sbp_msg_stm_flash_lock_sector_t &rhs) { +static inline bool operator<=(const sbp_msg_stm_flash_lock_sector_t &lhs, + const sbp_msg_stm_flash_lock_sector_t &rhs) { return sbp_msg_stm_flash_lock_sector_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_stm_flash_lock_sector_t &lhs, const sbp_msg_stm_flash_lock_sector_t &rhs) { +static inline bool operator>(const sbp_msg_stm_flash_lock_sector_t &lhs, + const sbp_msg_stm_flash_lock_sector_t &rhs) { return sbp_msg_stm_flash_lock_sector_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_stm_flash_lock_sector_t &lhs, const sbp_msg_stm_flash_lock_sector_t &rhs) { +static inline bool operator>=(const sbp_msg_stm_flash_lock_sector_t &lhs, + const sbp_msg_stm_flash_lock_sector_t &rhs) { return sbp_msg_stm_flash_lock_sector_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FLASH_MSG_STM_FLASH_LOCK_SECTOR_H */ - diff --git a/c/include/libsbp/flash/MSG_STM_FLASH_UNLOCK_SECTOR.h b/c/include/libsbp/flash/MSG_STM_FLASH_UNLOCK_SECTOR.h index e1c68224c..2a6235481 100644 --- a/c/include/libsbp/flash/MSG_STM_FLASH_UNLOCK_SECTOR.h +++ b/c/include/libsbp/flash/MSG_STM_FLASH_UNLOCK_SECTOR.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FLASH_MSG_STM_FLASH_UNLOCK_SECTOR_H #define LIBSBP_FLASH_MSG_STM_FLASH_UNLOCK_SECTOR_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,64 +40,82 @@ *****************************************************************************/ /** Unlock sector of STM flash memory (host => device) * -* The flash unlock message unlocks a sector of the STM flash memory. The device replies with a MSG_FLASH_DONE message. + * The flash unlock message unlocks a sector of the STM flash memory. The device + * replies with a MSG_FLASH_DONE message. */ typedef struct { - - /** -* Flash sector number to unlock + * Flash sector number to unlock */ u32 sector; } sbp_msg_stm_flash_unlock_sector_t; - - /** * Get encoded size of an instance of sbp_msg_stm_flash_unlock_sector_t * * @param msg sbp_msg_stm_flash_unlock_sector_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_stm_flash_unlock_sector_encoded_len(const sbp_msg_stm_flash_unlock_sector_t *msg) -{ +static inline size_t sbp_msg_stm_flash_unlock_sector_encoded_len( + const sbp_msg_stm_flash_unlock_sector_t *msg) { (void)msg; return SBP_MSG_STM_FLASH_UNLOCK_SECTOR_ENCODED_LEN; } /** - * Encode an instance of sbp_msg_stm_flash_unlock_sector_t to wire representation + * Encode an instance of sbp_msg_stm_flash_unlock_sector_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_stm_flash_unlock_sector_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_stm_flash_unlock_sector_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_stm_flash_unlock_sector_t *msg); +SBP_EXPORT s8 sbp_msg_stm_flash_unlock_sector_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_stm_flash_unlock_sector_t *msg); /** - * Decode an instance of sbp_msg_stm_flash_unlock_sector_t from wire representation + * Decode an instance of sbp_msg_stm_flash_unlock_sector_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_stm_flash_unlock_sector_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_stm_flash_unlock_sector_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_stm_flash_unlock_sector_t instance + * @param buf Wire representation of the sbp_msg_stm_flash_unlock_sector_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_stm_flash_unlock_sector_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_stm_flash_unlock_sector_t *msg); +SBP_EXPORT s8 sbp_msg_stm_flash_unlock_sector_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_stm_flash_unlock_sector_t *msg); /** - * Send an instance of sbp_msg_stm_flash_unlock_sector_t with the given write function + * Send an instance of sbp_msg_stm_flash_unlock_sector_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_stm_flash_unlock_sector_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_stm_flash_unlock_sector_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -105,51 +123,62 @@ SBP_EXPORT s8 sbp_msg_stm_flash_unlock_sector_decode(const uint8_t *buf, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_stm_flash_unlock_sector_send(sbp_state_t *s, u16 sender_id, const sbp_msg_stm_flash_unlock_sector_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_stm_flash_unlock_sector_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_stm_flash_unlock_sector_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_stm_flash_unlock_sector_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_stm_flash_unlock_sector_t instance * @param b sbp_msg_stm_flash_unlock_sector_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_stm_flash_unlock_sector_cmp(const sbp_msg_stm_flash_unlock_sector_t *a, const sbp_msg_stm_flash_unlock_sector_t *b); +SBP_EXPORT int sbp_msg_stm_flash_unlock_sector_cmp( + const sbp_msg_stm_flash_unlock_sector_t *a, + const sbp_msg_stm_flash_unlock_sector_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_stm_flash_unlock_sector_t &lhs, const sbp_msg_stm_flash_unlock_sector_t &rhs) { +static inline bool operator==(const sbp_msg_stm_flash_unlock_sector_t &lhs, + const sbp_msg_stm_flash_unlock_sector_t &rhs) { return sbp_msg_stm_flash_unlock_sector_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_stm_flash_unlock_sector_t &lhs, const sbp_msg_stm_flash_unlock_sector_t &rhs) { +static inline bool operator!=(const sbp_msg_stm_flash_unlock_sector_t &lhs, + const sbp_msg_stm_flash_unlock_sector_t &rhs) { return sbp_msg_stm_flash_unlock_sector_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_stm_flash_unlock_sector_t &lhs, const sbp_msg_stm_flash_unlock_sector_t &rhs) { +static inline bool operator<(const sbp_msg_stm_flash_unlock_sector_t &lhs, + const sbp_msg_stm_flash_unlock_sector_t &rhs) { return sbp_msg_stm_flash_unlock_sector_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_stm_flash_unlock_sector_t &lhs, const sbp_msg_stm_flash_unlock_sector_t &rhs) { +static inline bool operator<=(const sbp_msg_stm_flash_unlock_sector_t &lhs, + const sbp_msg_stm_flash_unlock_sector_t &rhs) { return sbp_msg_stm_flash_unlock_sector_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_stm_flash_unlock_sector_t &lhs, const sbp_msg_stm_flash_unlock_sector_t &rhs) { +static inline bool operator>(const sbp_msg_stm_flash_unlock_sector_t &lhs, + const sbp_msg_stm_flash_unlock_sector_t &rhs) { return sbp_msg_stm_flash_unlock_sector_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_stm_flash_unlock_sector_t &lhs, const sbp_msg_stm_flash_unlock_sector_t &rhs) { +static inline bool operator>=(const sbp_msg_stm_flash_unlock_sector_t &lhs, + const sbp_msg_stm_flash_unlock_sector_t &rhs) { return sbp_msg_stm_flash_unlock_sector_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FLASH_MSG_STM_FLASH_UNLOCK_SECTOR_H */ - diff --git a/c/include/libsbp/flash/MSG_STM_UNIQUE_ID_REQ.h b/c/include/libsbp/flash/MSG_STM_UNIQUE_ID_REQ.h index ebf52908a..55702a5e6 100644 --- a/c/include/libsbp/flash/MSG_STM_UNIQUE_ID_REQ.h +++ b/c/include/libsbp/flash/MSG_STM_UNIQUE_ID_REQ.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FLASH_MSG_STM_UNIQUE_ID_REQ_H #define LIBSBP_FLASH_MSG_STM_UNIQUE_ID_REQ_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,25 +41,26 @@ /** Read device's hard-coded unique ID request (host => device) * -* This message reads the device's hard-coded unique ID. The host requests the ID by sending a MSG_STM_UNIQUE_ID_REQ. The device responds with a MSG_STM_UNIQUE_ID_RESP with the 12-byte unique ID in the payload. +* This message reads the device's hard-coded unique ID. The host requests the ID +by sending a MSG_STM_UNIQUE_ID_REQ. The device responds with a +MSG_STM_UNIQUE_ID_RESP with the 12-byte unique ID in the payload. */ typedef struct { /** - * Do not use this field, it exists only to prevent illegal C syntax. Any value written to this field will be ignored + * Do not use this field, it exists only to prevent illegal C syntax. Any + * value written to this field will be ignored */ char DO_NOT_USE_dummy_field_to_prevent_empty_struct; } sbp_msg_stm_unique_id_req_t; - - /** * Get encoded size of an instance of sbp_msg_stm_unique_id_req_t * * @param msg sbp_msg_stm_unique_id_req_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_stm_unique_id_req_encoded_len(const sbp_msg_stm_unique_id_req_t *msg) -{ +static inline size_t sbp_msg_stm_unique_id_req_encoded_len( + const sbp_msg_stm_unique_id_req_t *msg) { (void)msg; return SBP_MSG_STM_UNIQUE_ID_REQ_ENCODED_LEN; } @@ -67,36 +68,53 @@ static inline size_t sbp_msg_stm_unique_id_req_encoded_len(const sbp_msg_stm_uni /** * Encode an instance of sbp_msg_stm_unique_id_req_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_stm_unique_id_req_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_stm_unique_id_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_stm_unique_id_req_t *msg); +SBP_EXPORT s8 +sbp_msg_stm_unique_id_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_stm_unique_id_req_t *msg); /** * Decode an instance of sbp_msg_stm_unique_id_req_t from wire representation * - * This function decodes the wire representation of a sbp_msg_stm_unique_id_req_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_stm_unique_id_req_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_stm_unique_id_req_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_stm_unique_id_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_stm_unique_id_req_t *msg); +SBP_EXPORT s8 sbp_msg_stm_unique_id_req_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_stm_unique_id_req_t *msg); /** * Send an instance of sbp_msg_stm_unique_id_req_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_stm_unique_id_req_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_stm_unique_id_req_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -104,51 +122,61 @@ SBP_EXPORT s8 sbp_msg_stm_unique_id_req_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_stm_unique_id_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_stm_unique_id_req_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_stm_unique_id_req_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_stm_unique_id_req_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_stm_unique_id_req_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_stm_unique_id_req_t instance * @param b sbp_msg_stm_unique_id_req_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_stm_unique_id_req_cmp(const sbp_msg_stm_unique_id_req_t *a, const sbp_msg_stm_unique_id_req_t *b); +SBP_EXPORT int sbp_msg_stm_unique_id_req_cmp( + const sbp_msg_stm_unique_id_req_t *a, const sbp_msg_stm_unique_id_req_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_stm_unique_id_req_t &lhs, const sbp_msg_stm_unique_id_req_t &rhs) { +static inline bool operator==(const sbp_msg_stm_unique_id_req_t &lhs, + const sbp_msg_stm_unique_id_req_t &rhs) { return sbp_msg_stm_unique_id_req_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_stm_unique_id_req_t &lhs, const sbp_msg_stm_unique_id_req_t &rhs) { +static inline bool operator!=(const sbp_msg_stm_unique_id_req_t &lhs, + const sbp_msg_stm_unique_id_req_t &rhs) { return sbp_msg_stm_unique_id_req_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_stm_unique_id_req_t &lhs, const sbp_msg_stm_unique_id_req_t &rhs) { +static inline bool operator<(const sbp_msg_stm_unique_id_req_t &lhs, + const sbp_msg_stm_unique_id_req_t &rhs) { return sbp_msg_stm_unique_id_req_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_stm_unique_id_req_t &lhs, const sbp_msg_stm_unique_id_req_t &rhs) { +static inline bool operator<=(const sbp_msg_stm_unique_id_req_t &lhs, + const sbp_msg_stm_unique_id_req_t &rhs) { return sbp_msg_stm_unique_id_req_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_stm_unique_id_req_t &lhs, const sbp_msg_stm_unique_id_req_t &rhs) { +static inline bool operator>(const sbp_msg_stm_unique_id_req_t &lhs, + const sbp_msg_stm_unique_id_req_t &rhs) { return sbp_msg_stm_unique_id_req_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_stm_unique_id_req_t &lhs, const sbp_msg_stm_unique_id_req_t &rhs) { +static inline bool operator>=(const sbp_msg_stm_unique_id_req_t &lhs, + const sbp_msg_stm_unique_id_req_t &rhs) { return sbp_msg_stm_unique_id_req_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FLASH_MSG_STM_UNIQUE_ID_REQ_H */ - diff --git a/c/include/libsbp/flash/MSG_STM_UNIQUE_ID_RESP.h b/c/include/libsbp/flash/MSG_STM_UNIQUE_ID_RESP.h index 140d356e6..18c704d51 100644 --- a/c/include/libsbp/flash/MSG_STM_UNIQUE_ID_RESP.h +++ b/c/include/libsbp/flash/MSG_STM_UNIQUE_ID_RESP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_FLASH_MSG_STM_UNIQUE_ID_RESP_H #define LIBSBP_FLASH_MSG_STM_UNIQUE_ID_RESP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,27 +41,25 @@ /** Read device's hard-coded unique ID response (host <= device) * -* This message reads the device's hard-coded unique ID. The host requests the ID by sending a MSG_STM_UNIQUE_ID_REQ. The device responds with a MSG_STM_UNIQUE_ID_RESP with the 12-byte unique ID in the payload. +* This message reads the device's hard-coded unique ID. The host requests the ID +by sending a MSG_STM_UNIQUE_ID_REQ. The device responds with a +MSG_STM_UNIQUE_ID_RESP with the 12-byte unique ID in the payload. */ typedef struct { - - /** -* Device unique ID + * Device unique ID */ u8 stm_id[SBP_MSG_STM_UNIQUE_ID_RESP_STM_ID_MAX]; } sbp_msg_stm_unique_id_resp_t; - - /** * Get encoded size of an instance of sbp_msg_stm_unique_id_resp_t * * @param msg sbp_msg_stm_unique_id_resp_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_stm_unique_id_resp_encoded_len(const sbp_msg_stm_unique_id_resp_t *msg) -{ +static inline size_t sbp_msg_stm_unique_id_resp_encoded_len( + const sbp_msg_stm_unique_id_resp_t *msg) { (void)msg; return SBP_MSG_STM_UNIQUE_ID_RESP_ENCODED_LEN; } @@ -69,36 +67,54 @@ static inline size_t sbp_msg_stm_unique_id_resp_encoded_len(const sbp_msg_stm_un /** * Encode an instance of sbp_msg_stm_unique_id_resp_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_stm_unique_id_resp_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_stm_unique_id_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_stm_unique_id_resp_t *msg); +SBP_EXPORT s8 +sbp_msg_stm_unique_id_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_stm_unique_id_resp_t *msg); /** * Decode an instance of sbp_msg_stm_unique_id_resp_t from wire representation * - * This function decodes the wire representation of a sbp_msg_stm_unique_id_resp_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_stm_unique_id_resp_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_stm_unique_id_resp_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_stm_unique_id_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_stm_unique_id_resp_t *msg); +SBP_EXPORT s8 sbp_msg_stm_unique_id_resp_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_stm_unique_id_resp_t *msg); /** - * Send an instance of sbp_msg_stm_unique_id_resp_t with the given write function + * Send an instance of sbp_msg_stm_unique_id_resp_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_stm_unique_id_resp_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_stm_unique_id_resp_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -106,51 +122,62 @@ SBP_EXPORT s8 sbp_msg_stm_unique_id_resp_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_stm_unique_id_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_stm_unique_id_resp_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_stm_unique_id_resp_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_stm_unique_id_resp_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_stm_unique_id_resp_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_stm_unique_id_resp_t instance * @param b sbp_msg_stm_unique_id_resp_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_stm_unique_id_resp_cmp(const sbp_msg_stm_unique_id_resp_t *a, const sbp_msg_stm_unique_id_resp_t *b); +SBP_EXPORT int sbp_msg_stm_unique_id_resp_cmp( + const sbp_msg_stm_unique_id_resp_t *a, + const sbp_msg_stm_unique_id_resp_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_stm_unique_id_resp_t &lhs, const sbp_msg_stm_unique_id_resp_t &rhs) { +static inline bool operator==(const sbp_msg_stm_unique_id_resp_t &lhs, + const sbp_msg_stm_unique_id_resp_t &rhs) { return sbp_msg_stm_unique_id_resp_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_stm_unique_id_resp_t &lhs, const sbp_msg_stm_unique_id_resp_t &rhs) { +static inline bool operator!=(const sbp_msg_stm_unique_id_resp_t &lhs, + const sbp_msg_stm_unique_id_resp_t &rhs) { return sbp_msg_stm_unique_id_resp_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_stm_unique_id_resp_t &lhs, const sbp_msg_stm_unique_id_resp_t &rhs) { +static inline bool operator<(const sbp_msg_stm_unique_id_resp_t &lhs, + const sbp_msg_stm_unique_id_resp_t &rhs) { return sbp_msg_stm_unique_id_resp_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_stm_unique_id_resp_t &lhs, const sbp_msg_stm_unique_id_resp_t &rhs) { +static inline bool operator<=(const sbp_msg_stm_unique_id_resp_t &lhs, + const sbp_msg_stm_unique_id_resp_t &rhs) { return sbp_msg_stm_unique_id_resp_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_stm_unique_id_resp_t &lhs, const sbp_msg_stm_unique_id_resp_t &rhs) { +static inline bool operator>(const sbp_msg_stm_unique_id_resp_t &lhs, + const sbp_msg_stm_unique_id_resp_t &rhs) { return sbp_msg_stm_unique_id_resp_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_stm_unique_id_resp_t &lhs, const sbp_msg_stm_unique_id_resp_t &rhs) { +static inline bool operator>=(const sbp_msg_stm_unique_id_resp_t &lhs, + const sbp_msg_stm_unique_id_resp_t &rhs) { return sbp_msg_stm_unique_id_resp_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_FLASH_MSG_STM_UNIQUE_ID_RESP_H */ - diff --git a/c/include/libsbp/flash_macros.h b/c/include/libsbp/flash_macros.h index 05df9eb75..39a8e8766 100644 --- a/c/include/libsbp/flash_macros.h +++ b/c/include/libsbp/flash_macros.h @@ -18,60 +18,66 @@ #ifndef LIBSBP_FLASH_MACROS_H #define LIBSBP_FLASH_MACROS_H - #define SBP_MSG_FLASH_PROGRAM 0x00E6 #define SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_MASK (0x1u) #define SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_SHIFT (0u) -#define SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_GET(flags) \ - ((u8)((u8)((flags) >> SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_SHIFT) \ - & SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_MASK)) -#define SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_MASK << SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_SHIFT))) | \ - (((val) & (SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_MASK)) \ - << (SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_SHIFT)));} while(0) - +#define SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_GET(flags) \ + ((u8)((u8)((flags) >> SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_SHIFT) & \ + SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_MASK)) +#define SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_MASK \ + << SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_SHIFT))) | \ + (((val) & (SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_MASK)) \ + << (SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_SHIFT))); \ + } while (0) #define SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_FLASH_STM (0) #define SBP_FLASH_PROGRAM_FLASH_TARGET_TO_READ_FLASH_M25 (1) /** - * The maximum number of items that can be stored in sbp_msg_flash_program_t::addr_start (V4 API) or msg_flash_program_t::addr_start (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_flash_program_t::addr_start (V4 API) or + * msg_flash_program_t::addr_start (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_FLASH_PROGRAM_ADDR_START_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_flash_program_t::data (V4 API) or msg_flash_program_t::data (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_flash_program_t::data (V4 API) or msg_flash_program_t::data (legacy + * API) before the maximum SBP message size is exceeded */ #define SBP_MSG_FLASH_PROGRAM_DATA_MAX 250u - /** - * Encoded length of sbp_msg_flash_program_t (V4 API) and + * Encoded length of sbp_msg_flash_program_t (V4 API) and * msg_flash_program_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_flash_program_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_flash_program_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_FLASH_PROGRAM_ENCODED_OVERHEAD 5u - #define SBP_MSG_FLASH_DONE 0x00E0 #define SBP_FLASH_DONE_RESPONSE_CODE_MASK (0x7u) #define SBP_FLASH_DONE_RESPONSE_CODE_SHIFT (0u) -#define SBP_FLASH_DONE_RESPONSE_CODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_FLASH_DONE_RESPONSE_CODE_SHIFT) \ - & SBP_FLASH_DONE_RESPONSE_CODE_MASK)) -#define SBP_FLASH_DONE_RESPONSE_CODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_FLASH_DONE_RESPONSE_CODE_MASK << SBP_FLASH_DONE_RESPONSE_CODE_SHIFT))) | \ - (((val) & (SBP_FLASH_DONE_RESPONSE_CODE_MASK)) \ - << (SBP_FLASH_DONE_RESPONSE_CODE_SHIFT)));} while(0) - +#define SBP_FLASH_DONE_RESPONSE_CODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_FLASH_DONE_RESPONSE_CODE_SHIFT) & \ + SBP_FLASH_DONE_RESPONSE_CODE_MASK)) +#define SBP_FLASH_DONE_RESPONSE_CODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_FLASH_DONE_RESPONSE_CODE_MASK \ + << SBP_FLASH_DONE_RESPONSE_CODE_SHIFT))) | \ + (((val) & (SBP_FLASH_DONE_RESPONSE_CODE_MASK)) \ + << (SBP_FLASH_DONE_RESPONSE_CODE_SHIFT))); \ + } while (0) #define SBP_FLASH_DONE_RESPONSE_CODE_FLASH_OK (0) #define SBP_FLASH_DONE_RESPONSE_CODE_FLASH_INVALID_FLASH (1) @@ -80,138 +86,145 @@ #define SBP_FLASH_DONE_RESPONSE_CODE_FLASH_INVALID_RANGE (4) #define SBP_FLASH_DONE_RESPONSE_CODE_FLASH_INVALID_SECTOR (5) /** - * Encoded length of sbp_msg_flash_done_t (V4 API) and + * Encoded length of sbp_msg_flash_done_t (V4 API) and * msg_flash_done_t (legacy API) */ #define SBP_MSG_FLASH_DONE_ENCODED_LEN 1u - #define SBP_MSG_FLASH_READ_REQ 0x00E7 #define SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_MASK (0x1u) #define SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_SHIFT (0u) -#define SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_GET(flags) \ - ((u8)((u8)((flags) >> SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_SHIFT) \ - & SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_MASK)) -#define SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_MASK << SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_SHIFT))) | \ - (((val) & (SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_MASK)) \ - << (SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_SHIFT)));} while(0) - +#define SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_GET(flags) \ + ((u8)((u8)((flags) >> SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_SHIFT) & \ + SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_MASK)) +#define SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_MASK \ + << SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_SHIFT))) | \ + (((val) & (SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_MASK)) \ + << (SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_SHIFT))); \ + } while (0) #define SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_FLASH_STM (0) #define SBP_FLASH_READ_REQ_FLASH_TARGET_TO_READ_FLASH_M25 (1) /** - * The maximum number of items that can be stored in sbp_msg_flash_read_req_t::addr_start (V4 API) or msg_flash_read_req_t::addr_start (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_flash_read_req_t::addr_start (V4 API) or + * msg_flash_read_req_t::addr_start (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_FLASH_READ_REQ_ADDR_START_MAX 3u - /** - * Encoded length of sbp_msg_flash_read_req_t (V4 API) and + * Encoded length of sbp_msg_flash_read_req_t (V4 API) and * msg_flash_read_req_t (legacy API) */ #define SBP_MSG_FLASH_READ_REQ_ENCODED_LEN 5u - #define SBP_MSG_FLASH_READ_RESP 0x00E1 #define SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_MASK (0x1u) #define SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_SHIFT (0u) -#define SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_GET(flags) \ - ((u8)((u8)((flags) >> SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_SHIFT) \ - & SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_MASK)) -#define SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_MASK << SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_SHIFT))) | \ - (((val) & (SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_MASK)) \ - << (SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_SHIFT)));} while(0) - +#define SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_GET(flags) \ + ((u8)((u8)((flags) >> SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_SHIFT) & \ + SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_MASK)) +#define SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_MASK \ + << SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_SHIFT))) | \ + (((val) & (SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_MASK)) \ + << (SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_SHIFT))); \ + } while (0) #define SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_FLASH_STM (0) #define SBP_FLASH_READ_RESP_FLASH_TARGET_TO_READ_FLASH_M25 (1) /** - * The maximum number of items that can be stored in sbp_msg_flash_read_resp_t::addr_start (V4 API) or msg_flash_read_resp_t::addr_start (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_flash_read_resp_t::addr_start (V4 API) or + * msg_flash_read_resp_t::addr_start (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_FLASH_READ_RESP_ADDR_START_MAX 3u - /** - * Encoded length of sbp_msg_flash_read_resp_t (V4 API) and + * Encoded length of sbp_msg_flash_read_resp_t (V4 API) and * msg_flash_read_resp_t (legacy API) */ #define SBP_MSG_FLASH_READ_RESP_ENCODED_LEN 5u - #define SBP_MSG_FLASH_ERASE 0x00E2 #define SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_MASK (0x1u) #define SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_SHIFT (0u) -#define SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_GET(flags) \ - ((u8)((u8)((flags) >> SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_SHIFT) \ - & SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_MASK)) -#define SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_MASK << SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_SHIFT))) | \ - (((val) & (SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_MASK)) \ - << (SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_SHIFT)));} while(0) - +#define SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_GET(flags) \ + ((u8)((u8)((flags) >> SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_SHIFT) & \ + SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_MASK)) +#define SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_MASK \ + << SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_SHIFT))) | \ + (((val) & (SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_MASK)) \ + << (SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_SHIFT))); \ + } while (0) #define SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_FLASH_STM (0) #define SBP_FLASH_ERASE_FLASH_TARGET_TO_READ_FLASH_M25 (1) /** - * Encoded length of sbp_msg_flash_erase_t (V4 API) and + * Encoded length of sbp_msg_flash_erase_t (V4 API) and * msg_flash_erase_t (legacy API) */ #define SBP_MSG_FLASH_ERASE_ENCODED_LEN 5u - #define SBP_MSG_STM_FLASH_LOCK_SECTOR 0x00E3 /** - * Encoded length of sbp_msg_stm_flash_lock_sector_t (V4 API) and + * Encoded length of sbp_msg_stm_flash_lock_sector_t (V4 API) and * msg_stm_flash_lock_sector_t (legacy API) */ #define SBP_MSG_STM_FLASH_LOCK_SECTOR_ENCODED_LEN 4u - #define SBP_MSG_STM_FLASH_UNLOCK_SECTOR 0x00E4 /** - * Encoded length of sbp_msg_stm_flash_unlock_sector_t (V4 API) and + * Encoded length of sbp_msg_stm_flash_unlock_sector_t (V4 API) and * msg_stm_flash_unlock_sector_t (legacy API) */ #define SBP_MSG_STM_FLASH_UNLOCK_SECTOR_ENCODED_LEN 4u - #define SBP_MSG_STM_UNIQUE_ID_REQ 0x00E8 /** - * Encoded length of sbp_msg_stm_unique_id_req_t (V4 API) and + * Encoded length of sbp_msg_stm_unique_id_req_t (V4 API) and * msg_stm_unique_id_req_t (legacy API) */ #define SBP_MSG_STM_UNIQUE_ID_REQ_ENCODED_LEN 0u - #define SBP_MSG_STM_UNIQUE_ID_RESP 0x00E5 /** - * The maximum number of items that can be stored in sbp_msg_stm_unique_id_resp_t::stm_id (V4 API) or msg_stm_unique_id_resp_t::stm_id (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_stm_unique_id_resp_t::stm_id (V4 API) or + * msg_stm_unique_id_resp_t::stm_id (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_STM_UNIQUE_ID_RESP_STM_ID_MAX 12u - /** - * Encoded length of sbp_msg_stm_unique_id_resp_t (V4 API) and + * Encoded length of sbp_msg_stm_unique_id_resp_t (V4 API) and * msg_stm_unique_id_resp_t (legacy API) */ #define SBP_MSG_STM_UNIQUE_ID_RESP_ENCODED_LEN 12u - #define SBP_MSG_M25_FLASH_WRITE_STATUS 0x00F3 /** - * The maximum number of items that can be stored in sbp_msg_m25_flash_write_status_t::status (V4 API) or msg_m25_flash_write_status_t::status (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_m25_flash_write_status_t::status (V4 API) or + * msg_m25_flash_write_status_t::status (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_M25_FLASH_WRITE_STATUS_STATUS_MAX 1u - /** - * Encoded length of sbp_msg_m25_flash_write_status_t (V4 API) and + * Encoded length of sbp_msg_m25_flash_write_status_t (V4 API) and * msg_m25_flash_write_status_t (legacy API) */ #define SBP_MSG_M25_FLASH_WRITE_STATUS_ENCODED_LEN 1u - - #endif /* LIBSBP_FLASH_MACROS_H */ diff --git a/c/include/libsbp/gnss.h b/c/include/libsbp/gnss.h index 57914b094..1827a4226 100644 --- a/c/include/libsbp/gnss.h +++ b/c/include/libsbp/gnss.h @@ -17,12 +17,12 @@ #ifndef LIBSBP_GNSS_MESSAGES_H #define LIBSBP_GNSS_MESSAGES_H -#include -#include -#include +#include +#include #include #include -#include -#include +#include +#include +#include #endif /* LIBSBP_GNSS_MESSAGES_H */ diff --git a/c/include/libsbp/gnss/CarrierPhase.h b/c/include/libsbp/gnss/CarrierPhase.h index 4c5fb9635..1054162d7 100644 --- a/c/include/libsbp/gnss/CarrierPhase.h +++ b/c/include/libsbp/gnss/CarrierPhase.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_GNSS_CARRIERPHASE_H #define LIBSBP_GNSS_CARRIERPHASE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,33 +40,30 @@ *****************************************************************************/ /** GNSS carrier phase measurement * -* Carrier phase measurement in cycles represented as a 40-bit fixed point number with Q32.8 layout, i.e. 32-bits of whole cycles and 8-bits of fractional cycles. This phase has the same sign as the pseudorange. + * Carrier phase measurement in cycles represented as a 40-bit fixed point + * number with Q32.8 layout, i.e. 32-bits of whole cycles and 8-bits of + * fractional cycles. This phase has the same sign as the pseudorange. */ typedef struct { - - /** -* Carrier phase whole cycles [cycles] + * Carrier phase whole cycles [cycles] */ s32 i; - /** -* Carrier phase fractional part [cycles / 256] + * Carrier phase fractional part [cycles / 256] */ u8 f; } sbp_carrier_phase_t; - - /** * Get encoded size of an instance of sbp_carrier_phase_t * * @param msg sbp_carrier_phase_t instance * @return Length of on-wire representation */ -static inline size_t sbp_carrier_phase_encoded_len(const sbp_carrier_phase_t *msg) -{ +static inline size_t sbp_carrier_phase_encoded_len( + const sbp_carrier_phase_t *msg) { (void)msg; return SBP_CARRIER_PHASE_ENCODED_LEN; } @@ -74,74 +71,96 @@ static inline size_t sbp_carrier_phase_encoded_len(const sbp_carrier_phase_t *ms /** * Encode an instance of sbp_carrier_phase_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_carrier_phase_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_carrier_phase_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_carrier_phase_t *msg); +SBP_EXPORT s8 sbp_carrier_phase_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_carrier_phase_t *msg); /** * Decode an instance of sbp_carrier_phase_t from wire representation * - * This function decodes the wire representation of a sbp_carrier_phase_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_carrier_phase_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_carrier_phase_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_carrier_phase_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_carrier_phase_t *msg); +SBP_EXPORT s8 sbp_carrier_phase_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_carrier_phase_t *msg); /** * Compare two instances of sbp_carrier_phase_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_carrier_phase_t instance * @param b sbp_carrier_phase_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_carrier_phase_cmp(const sbp_carrier_phase_t *a, const sbp_carrier_phase_t *b); +SBP_EXPORT int sbp_carrier_phase_cmp(const sbp_carrier_phase_t *a, + const sbp_carrier_phase_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_carrier_phase_t &lhs, const sbp_carrier_phase_t &rhs) { +static inline bool operator==(const sbp_carrier_phase_t &lhs, + const sbp_carrier_phase_t &rhs) { return sbp_carrier_phase_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_carrier_phase_t &lhs, const sbp_carrier_phase_t &rhs) { +static inline bool operator!=(const sbp_carrier_phase_t &lhs, + const sbp_carrier_phase_t &rhs) { return sbp_carrier_phase_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_carrier_phase_t &lhs, const sbp_carrier_phase_t &rhs) { +static inline bool operator<(const sbp_carrier_phase_t &lhs, + const sbp_carrier_phase_t &rhs) { return sbp_carrier_phase_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_carrier_phase_t &lhs, const sbp_carrier_phase_t &rhs) { +static inline bool operator<=(const sbp_carrier_phase_t &lhs, + const sbp_carrier_phase_t &rhs) { return sbp_carrier_phase_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_carrier_phase_t &lhs, const sbp_carrier_phase_t &rhs) { +static inline bool operator>(const sbp_carrier_phase_t &lhs, + const sbp_carrier_phase_t &rhs) { return sbp_carrier_phase_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_carrier_phase_t &lhs, const sbp_carrier_phase_t &rhs) { +static inline bool operator>=(const sbp_carrier_phase_t &lhs, + const sbp_carrier_phase_t &rhs) { return sbp_carrier_phase_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_GNSS_CARRIERPHASE_H */ - diff --git a/c/include/libsbp/gnss/GPSTime.h b/c/include/libsbp/gnss/GPSTime.h index 74e21987e..7313aff6b 100644 --- a/c/include/libsbp/gnss/GPSTime.h +++ b/c/include/libsbp/gnss/GPSTime.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_GNSS_GPSTIME_H #define LIBSBP_GNSS_GPSTIME_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,39 +40,35 @@ *****************************************************************************/ /** Nanosecond-accurate receiver clock time * -* A wire-appropriate receiver clock time, defined as the time since the beginning of the week on the Saturday/Sunday transition. In most cases, observations are epoch aligned so ns field will be 0. + * A wire-appropriate receiver clock time, defined as the time since the + * beginning of the week on the Saturday/Sunday transition. In most cases, + * observations are epoch aligned so ns field will be 0. */ typedef struct { - - /** -* Milliseconds since start of GPS week [ms] + * Milliseconds since start of GPS week [ms] */ u32 tow; - /** - * Nanosecond residual of millisecond-rounded TOW (ranges from -500000 to 500000) [ns] + * Nanosecond residual of millisecond-rounded TOW (ranges from -500000 to + * 500000) [ns] */ s32 ns_residual; - /** -* GPS week number [week] + * GPS week number [week] */ u16 wn; } sbp_v4_gps_time_t; - - /** * Get encoded size of an instance of sbp_v4_gps_time_t * * @param msg sbp_v4_gps_time_t instance * @return Length of on-wire representation */ -static inline size_t sbp_v4_gps_time_encoded_len(const sbp_v4_gps_time_t *msg) -{ +static inline size_t sbp_v4_gps_time_encoded_len(const sbp_v4_gps_time_t *msg) { (void)msg; return SBP_V4_GPS_TIME_ENCODED_LEN; } @@ -80,74 +76,95 @@ static inline size_t sbp_v4_gps_time_encoded_len(const sbp_v4_gps_time_t *msg) /** * Encode an instance of sbp_v4_gps_time_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_v4_gps_time_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_v4_gps_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_v4_gps_time_t *msg); +SBP_EXPORT s8 sbp_v4_gps_time_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_v4_gps_time_t *msg); /** * Decode an instance of sbp_v4_gps_time_t from wire representation * - * This function decodes the wire representation of a sbp_v4_gps_time_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_v4_gps_time_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_v4_gps_time_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_v4_gps_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_v4_gps_time_t *msg); +SBP_EXPORT s8 sbp_v4_gps_time_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_v4_gps_time_t *msg); /** * Compare two instances of sbp_v4_gps_time_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_v4_gps_time_t instance * @param b sbp_v4_gps_time_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_v4_gps_time_cmp(const sbp_v4_gps_time_t *a, const sbp_v4_gps_time_t *b); +SBP_EXPORT int sbp_v4_gps_time_cmp(const sbp_v4_gps_time_t *a, + const sbp_v4_gps_time_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_v4_gps_time_t &lhs, const sbp_v4_gps_time_t &rhs) { +static inline bool operator==(const sbp_v4_gps_time_t &lhs, + const sbp_v4_gps_time_t &rhs) { return sbp_v4_gps_time_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_v4_gps_time_t &lhs, const sbp_v4_gps_time_t &rhs) { +static inline bool operator!=(const sbp_v4_gps_time_t &lhs, + const sbp_v4_gps_time_t &rhs) { return sbp_v4_gps_time_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_v4_gps_time_t &lhs, const sbp_v4_gps_time_t &rhs) { +static inline bool operator<(const sbp_v4_gps_time_t &lhs, + const sbp_v4_gps_time_t &rhs) { return sbp_v4_gps_time_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_v4_gps_time_t &lhs, const sbp_v4_gps_time_t &rhs) { +static inline bool operator<=(const sbp_v4_gps_time_t &lhs, + const sbp_v4_gps_time_t &rhs) { return sbp_v4_gps_time_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_v4_gps_time_t &lhs, const sbp_v4_gps_time_t &rhs) { +static inline bool operator>(const sbp_v4_gps_time_t &lhs, + const sbp_v4_gps_time_t &rhs) { return sbp_v4_gps_time_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_v4_gps_time_t &lhs, const sbp_v4_gps_time_t &rhs) { +static inline bool operator>=(const sbp_v4_gps_time_t &lhs, + const sbp_v4_gps_time_t &rhs) { return sbp_v4_gps_time_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_GNSS_GPSTIME_H */ - diff --git a/c/include/libsbp/gnss/GPSTimeDep.h b/c/include/libsbp/gnss/GPSTimeDep.h index 1b5eac451..c37789938 100644 --- a/c/include/libsbp/gnss/GPSTimeDep.h +++ b/c/include/libsbp/gnss/GPSTimeDep.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_GNSS_GPSTIMEDEP_H #define LIBSBP_GNSS_GPSTIMEDEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,33 +40,29 @@ *****************************************************************************/ /** Millisecond-accurate GPS time * -* A wire-appropriate GPS time, defined as the number of milliseconds since beginning of the week on the Saturday/Sunday transition. + * A wire-appropriate GPS time, defined as the number of milliseconds since + * beginning of the week on the Saturday/Sunday transition. */ typedef struct { - - /** -* Milliseconds since start of GPS week [ms] + * Milliseconds since start of GPS week [ms] */ u32 tow; - /** -* GPS week number [week] + * GPS week number [week] */ u16 wn; } sbp_gps_time_dep_t; - - /** * Get encoded size of an instance of sbp_gps_time_dep_t * * @param msg sbp_gps_time_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_gps_time_dep_encoded_len(const sbp_gps_time_dep_t *msg) -{ +static inline size_t sbp_gps_time_dep_encoded_len( + const sbp_gps_time_dep_t *msg) { (void)msg; return SBP_GPS_TIME_DEP_ENCODED_LEN; } @@ -74,74 +70,95 @@ static inline size_t sbp_gps_time_dep_encoded_len(const sbp_gps_time_dep_t *msg) /** * Encode an instance of sbp_gps_time_dep_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_gps_time_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_gps_time_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_gps_time_dep_t *msg); +SBP_EXPORT s8 sbp_gps_time_dep_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_gps_time_dep_t *msg); /** * Decode an instance of sbp_gps_time_dep_t from wire representation * - * This function decodes the wire representation of a sbp_gps_time_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_gps_time_dep_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_gps_time_dep_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_gps_time_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_gps_time_dep_t *msg); +SBP_EXPORT s8 sbp_gps_time_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_gps_time_dep_t *msg); /** * Compare two instances of sbp_gps_time_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_gps_time_dep_t instance * @param b sbp_gps_time_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_gps_time_dep_cmp(const sbp_gps_time_dep_t *a, const sbp_gps_time_dep_t *b); +SBP_EXPORT int sbp_gps_time_dep_cmp(const sbp_gps_time_dep_t *a, + const sbp_gps_time_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_gps_time_dep_t &lhs, const sbp_gps_time_dep_t &rhs) { +static inline bool operator==(const sbp_gps_time_dep_t &lhs, + const sbp_gps_time_dep_t &rhs) { return sbp_gps_time_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_gps_time_dep_t &lhs, const sbp_gps_time_dep_t &rhs) { +static inline bool operator!=(const sbp_gps_time_dep_t &lhs, + const sbp_gps_time_dep_t &rhs) { return sbp_gps_time_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_gps_time_dep_t &lhs, const sbp_gps_time_dep_t &rhs) { +static inline bool operator<(const sbp_gps_time_dep_t &lhs, + const sbp_gps_time_dep_t &rhs) { return sbp_gps_time_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_gps_time_dep_t &lhs, const sbp_gps_time_dep_t &rhs) { +static inline bool operator<=(const sbp_gps_time_dep_t &lhs, + const sbp_gps_time_dep_t &rhs) { return sbp_gps_time_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_gps_time_dep_t &lhs, const sbp_gps_time_dep_t &rhs) { +static inline bool operator>(const sbp_gps_time_dep_t &lhs, + const sbp_gps_time_dep_t &rhs) { return sbp_gps_time_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_gps_time_dep_t &lhs, const sbp_gps_time_dep_t &rhs) { +static inline bool operator>=(const sbp_gps_time_dep_t &lhs, + const sbp_gps_time_dep_t &rhs) { return sbp_gps_time_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_GNSS_GPSTIMEDEP_H */ - diff --git a/c/include/libsbp/gnss/GPSTimeSec.h b/c/include/libsbp/gnss/GPSTimeSec.h index 05452fa95..482fc705d 100644 --- a/c/include/libsbp/gnss/GPSTimeSec.h +++ b/c/include/libsbp/gnss/GPSTimeSec.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_GNSS_GPSTIMESEC_H #define LIBSBP_GNSS_GPSTIMESEC_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,33 +40,29 @@ *****************************************************************************/ /** Whole second accurate GPS time * -* A GPS time, defined as the number of seconds since beginning of the week on the Saturday/Sunday transition. + * A GPS time, defined as the number of seconds since beginning of the week on + * the Saturday/Sunday transition. */ typedef struct { - - /** -* Seconds since start of GPS week [s] + * Seconds since start of GPS week [s] */ u32 tow; - /** -* GPS week number [week] + * GPS week number [week] */ u16 wn; } sbp_gps_time_sec_t; - - /** * Get encoded size of an instance of sbp_gps_time_sec_t * * @param msg sbp_gps_time_sec_t instance * @return Length of on-wire representation */ -static inline size_t sbp_gps_time_sec_encoded_len(const sbp_gps_time_sec_t *msg) -{ +static inline size_t sbp_gps_time_sec_encoded_len( + const sbp_gps_time_sec_t *msg) { (void)msg; return SBP_GPS_TIME_SEC_ENCODED_LEN; } @@ -74,74 +70,95 @@ static inline size_t sbp_gps_time_sec_encoded_len(const sbp_gps_time_sec_t *msg) /** * Encode an instance of sbp_gps_time_sec_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_gps_time_sec_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_gps_time_sec_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_gps_time_sec_t *msg); +SBP_EXPORT s8 sbp_gps_time_sec_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_gps_time_sec_t *msg); /** * Decode an instance of sbp_gps_time_sec_t from wire representation * - * This function decodes the wire representation of a sbp_gps_time_sec_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_gps_time_sec_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_gps_time_sec_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_gps_time_sec_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_gps_time_sec_t *msg); +SBP_EXPORT s8 sbp_gps_time_sec_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_gps_time_sec_t *msg); /** * Compare two instances of sbp_gps_time_sec_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_gps_time_sec_t instance * @param b sbp_gps_time_sec_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_gps_time_sec_cmp(const sbp_gps_time_sec_t *a, const sbp_gps_time_sec_t *b); +SBP_EXPORT int sbp_gps_time_sec_cmp(const sbp_gps_time_sec_t *a, + const sbp_gps_time_sec_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_gps_time_sec_t &lhs, const sbp_gps_time_sec_t &rhs) { +static inline bool operator==(const sbp_gps_time_sec_t &lhs, + const sbp_gps_time_sec_t &rhs) { return sbp_gps_time_sec_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_gps_time_sec_t &lhs, const sbp_gps_time_sec_t &rhs) { +static inline bool operator!=(const sbp_gps_time_sec_t &lhs, + const sbp_gps_time_sec_t &rhs) { return sbp_gps_time_sec_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_gps_time_sec_t &lhs, const sbp_gps_time_sec_t &rhs) { +static inline bool operator<(const sbp_gps_time_sec_t &lhs, + const sbp_gps_time_sec_t &rhs) { return sbp_gps_time_sec_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_gps_time_sec_t &lhs, const sbp_gps_time_sec_t &rhs) { +static inline bool operator<=(const sbp_gps_time_sec_t &lhs, + const sbp_gps_time_sec_t &rhs) { return sbp_gps_time_sec_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_gps_time_sec_t &lhs, const sbp_gps_time_sec_t &rhs) { +static inline bool operator>(const sbp_gps_time_sec_t &lhs, + const sbp_gps_time_sec_t &rhs) { return sbp_gps_time_sec_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_gps_time_sec_t &lhs, const sbp_gps_time_sec_t &rhs) { +static inline bool operator>=(const sbp_gps_time_sec_t &lhs, + const sbp_gps_time_sec_t &rhs) { return sbp_gps_time_sec_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_GNSS_GPSTIMESEC_H */ - diff --git a/c/include/libsbp/gnss/GnssSignal.h b/c/include/libsbp/gnss/GnssSignal.h index b7a2f1748..5b68f74d4 100644 --- a/c/include/libsbp/gnss/GnssSignal.h +++ b/c/include/libsbp/gnss/GnssSignal.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_GNSS_GNSSSIGNAL_H #define LIBSBP_GNSS_GNSSSIGNAL_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,33 +40,29 @@ *****************************************************************************/ /** Represents all the relevant information about the signal * -* Signal identifier containing constellation, band, and satellite identifier. + * Signal identifier containing constellation, band, and satellite identifier. */ typedef struct { - - /** - * Constellation-specific satellite id. For GLO can either be (100+FCN) where FCN is in [-7,+6] or the Slot ID in [1,28]. + * Constellation-specific satellite id. For GLO can either be (100+FCN) where + * FCN is in [-7,+6] or the Slot ID in [1,28]. */ u8 sat; - /** -* Signal constellation, band and code + * Signal constellation, band and code */ u8 code; } sbp_v4_gnss_signal_t; - - /** * Get encoded size of an instance of sbp_v4_gnss_signal_t * * @param msg sbp_v4_gnss_signal_t instance * @return Length of on-wire representation */ -static inline size_t sbp_v4_gnss_signal_encoded_len(const sbp_v4_gnss_signal_t *msg) -{ +static inline size_t sbp_v4_gnss_signal_encoded_len( + const sbp_v4_gnss_signal_t *msg) { (void)msg; return SBP_V4_GNSS_SIGNAL_ENCODED_LEN; } @@ -74,74 +70,96 @@ static inline size_t sbp_v4_gnss_signal_encoded_len(const sbp_v4_gnss_signal_t * /** * Encode an instance of sbp_v4_gnss_signal_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_v4_gnss_signal_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_v4_gnss_signal_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_v4_gnss_signal_t *msg); +SBP_EXPORT s8 sbp_v4_gnss_signal_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_v4_gnss_signal_t *msg); /** * Decode an instance of sbp_v4_gnss_signal_t from wire representation * - * This function decodes the wire representation of a sbp_v4_gnss_signal_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_v4_gnss_signal_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_v4_gnss_signal_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_v4_gnss_signal_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_v4_gnss_signal_t *msg); +SBP_EXPORT s8 sbp_v4_gnss_signal_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_v4_gnss_signal_t *msg); /** * Compare two instances of sbp_v4_gnss_signal_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_v4_gnss_signal_t instance * @param b sbp_v4_gnss_signal_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_v4_gnss_signal_cmp(const sbp_v4_gnss_signal_t *a, const sbp_v4_gnss_signal_t *b); +SBP_EXPORT int sbp_v4_gnss_signal_cmp(const sbp_v4_gnss_signal_t *a, + const sbp_v4_gnss_signal_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_v4_gnss_signal_t &lhs, const sbp_v4_gnss_signal_t &rhs) { +static inline bool operator==(const sbp_v4_gnss_signal_t &lhs, + const sbp_v4_gnss_signal_t &rhs) { return sbp_v4_gnss_signal_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_v4_gnss_signal_t &lhs, const sbp_v4_gnss_signal_t &rhs) { +static inline bool operator!=(const sbp_v4_gnss_signal_t &lhs, + const sbp_v4_gnss_signal_t &rhs) { return sbp_v4_gnss_signal_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_v4_gnss_signal_t &lhs, const sbp_v4_gnss_signal_t &rhs) { +static inline bool operator<(const sbp_v4_gnss_signal_t &lhs, + const sbp_v4_gnss_signal_t &rhs) { return sbp_v4_gnss_signal_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_v4_gnss_signal_t &lhs, const sbp_v4_gnss_signal_t &rhs) { +static inline bool operator<=(const sbp_v4_gnss_signal_t &lhs, + const sbp_v4_gnss_signal_t &rhs) { return sbp_v4_gnss_signal_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_v4_gnss_signal_t &lhs, const sbp_v4_gnss_signal_t &rhs) { +static inline bool operator>(const sbp_v4_gnss_signal_t &lhs, + const sbp_v4_gnss_signal_t &rhs) { return sbp_v4_gnss_signal_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_v4_gnss_signal_t &lhs, const sbp_v4_gnss_signal_t &rhs) { +static inline bool operator>=(const sbp_v4_gnss_signal_t &lhs, + const sbp_v4_gnss_signal_t &rhs) { return sbp_v4_gnss_signal_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_GNSS_GNSSSIGNAL_H */ - diff --git a/c/include/libsbp/gnss/GnssSignalDep.h b/c/include/libsbp/gnss/GnssSignalDep.h index 9e5113ff2..f5ef5896c 100644 --- a/c/include/libsbp/gnss/GnssSignalDep.h +++ b/c/include/libsbp/gnss/GnssSignalDep.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_GNSS_GNSSSIGNALDEP_H #define LIBSBP_GNSS_GNSSSIGNALDEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,41 +40,36 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** - * Constellation-specific satellite identifier. - * - * Note: unlike GnssSignal, GPS satellites are encoded as (PRN - 1). Other constellations do not have this offset. + * Constellation-specific satellite identifier. + * + * Note: unlike GnssSignal, GPS satellites are encoded as (PRN - 1). Other + * constellations do not have this offset. */ u16 sat; - /** -* Signal constellation, band and code + * Signal constellation, band and code */ u8 code; - /** -* Reserved + * Reserved */ u8 reserved; } sbp_gnss_signal_dep_t; - - /** * Get encoded size of an instance of sbp_gnss_signal_dep_t * * @param msg sbp_gnss_signal_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_gnss_signal_dep_encoded_len(const sbp_gnss_signal_dep_t *msg) -{ +static inline size_t sbp_gnss_signal_dep_encoded_len( + const sbp_gnss_signal_dep_t *msg) { (void)msg; return SBP_GNSS_SIGNAL_DEP_ENCODED_LEN; } @@ -82,74 +77,96 @@ static inline size_t sbp_gnss_signal_dep_encoded_len(const sbp_gnss_signal_dep_t /** * Encode an instance of sbp_gnss_signal_dep_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_gnss_signal_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_gnss_signal_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_gnss_signal_dep_t *msg); +SBP_EXPORT s8 sbp_gnss_signal_dep_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_gnss_signal_dep_t *msg); /** * Decode an instance of sbp_gnss_signal_dep_t from wire representation * - * This function decodes the wire representation of a sbp_gnss_signal_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_gnss_signal_dep_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_gnss_signal_dep_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_gnss_signal_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_gnss_signal_dep_t *msg); +SBP_EXPORT s8 sbp_gnss_signal_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_gnss_signal_dep_t *msg); /** * Compare two instances of sbp_gnss_signal_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_gnss_signal_dep_t instance * @param b sbp_gnss_signal_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_gnss_signal_dep_cmp(const sbp_gnss_signal_dep_t *a, const sbp_gnss_signal_dep_t *b); +SBP_EXPORT int sbp_gnss_signal_dep_cmp(const sbp_gnss_signal_dep_t *a, + const sbp_gnss_signal_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_gnss_signal_dep_t &lhs, const sbp_gnss_signal_dep_t &rhs) { +static inline bool operator==(const sbp_gnss_signal_dep_t &lhs, + const sbp_gnss_signal_dep_t &rhs) { return sbp_gnss_signal_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_gnss_signal_dep_t &lhs, const sbp_gnss_signal_dep_t &rhs) { +static inline bool operator!=(const sbp_gnss_signal_dep_t &lhs, + const sbp_gnss_signal_dep_t &rhs) { return sbp_gnss_signal_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_gnss_signal_dep_t &lhs, const sbp_gnss_signal_dep_t &rhs) { +static inline bool operator<(const sbp_gnss_signal_dep_t &lhs, + const sbp_gnss_signal_dep_t &rhs) { return sbp_gnss_signal_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_gnss_signal_dep_t &lhs, const sbp_gnss_signal_dep_t &rhs) { +static inline bool operator<=(const sbp_gnss_signal_dep_t &lhs, + const sbp_gnss_signal_dep_t &rhs) { return sbp_gnss_signal_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_gnss_signal_dep_t &lhs, const sbp_gnss_signal_dep_t &rhs) { +static inline bool operator>(const sbp_gnss_signal_dep_t &lhs, + const sbp_gnss_signal_dep_t &rhs) { return sbp_gnss_signal_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_gnss_signal_dep_t &lhs, const sbp_gnss_signal_dep_t &rhs) { +static inline bool operator>=(const sbp_gnss_signal_dep_t &lhs, + const sbp_gnss_signal_dep_t &rhs) { return sbp_gnss_signal_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_GNSS_GNSSSIGNALDEP_H */ - diff --git a/c/include/libsbp/gnss/SvId.h b/c/include/libsbp/gnss/SvId.h index 4f2b4bb4e..2ac09bf1f 100644 --- a/c/include/libsbp/gnss/SvId.h +++ b/c/include/libsbp/gnss/SvId.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_GNSS_SVID_H #define LIBSBP_GNSS_SVID_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,33 +40,29 @@ *****************************************************************************/ /** Space vehicle identifier * -* A (Constellation ID, satellite ID) tuple that uniquely identifies a space vehicle. + * A (Constellation ID, satellite ID) tuple that uniquely identifies a space + * vehicle. */ typedef struct { - - /** - * Constellation-specific satellite id. For GLO can either be (100+FCN) where FCN is in [-7,+6] or the Slot ID in [1,28]. + * Constellation-specific satellite id. For GLO can either be (100+FCN) where + * FCN is in [-7,+6] or the Slot ID in [1,28]. */ u8 satId; - /** -* Constellation ID to which the SV belongs + * Constellation ID to which the SV belongs */ u8 constellation; } sbp_sv_id_t; - - /** * Get encoded size of an instance of sbp_sv_id_t * * @param msg sbp_sv_id_t instance * @return Length of on-wire representation */ -static inline size_t sbp_sv_id_encoded_len(const sbp_sv_id_t *msg) -{ +static inline size_t sbp_sv_id_encoded_len(const sbp_sv_id_t *msg) { (void)msg; return SBP_SV_ID_ENCODED_LEN; } @@ -74,39 +70,53 @@ static inline size_t sbp_sv_id_encoded_len(const sbp_sv_id_t *msg) /** * Encode an instance of sbp_sv_id_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_sv_id_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_sv_id_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_sv_id_t *msg); +SBP_EXPORT s8 sbp_sv_id_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_sv_id_t *msg); /** * Decode an instance of sbp_sv_id_t from wire representation * - * This function decodes the wire representation of a sbp_sv_id_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_sv_id_t message to the + * given instance. The caller must specify the length of the buffer in the \p + * len parameter. If non-null the number of bytes read from the buffer will be + * returned in \p n_read. * * @param buf Wire representation of the sbp_sv_id_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_sv_id_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_sv_id_t *msg); +SBP_EXPORT s8 sbp_sv_id_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_sv_id_t *msg); /** * Compare two instances of sbp_sv_id_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_sv_id_t instance * @param b sbp_sv_id_t instance @@ -115,7 +125,7 @@ SBP_EXPORT s8 sbp_sv_id_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, SBP_EXPORT int sbp_sv_id_cmp(const sbp_sv_id_t *a, const sbp_sv_id_t *b); #ifdef __cplusplus - } +} static inline bool operator==(const sbp_sv_id_t &lhs, const sbp_sv_id_t &rhs) { return sbp_sv_id_cmp(&lhs, &rhs) == 0; @@ -141,7 +151,6 @@ static inline bool operator>=(const sbp_sv_id_t &lhs, const sbp_sv_id_t &rhs) { return sbp_sv_id_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_GNSS_SVID_H */ - diff --git a/c/include/libsbp/gnss_macros.h b/c/include/libsbp/gnss_macros.h index 047cb59d3..dbe39595b 100644 --- a/c/include/libsbp/gnss_macros.h +++ b/c/include/libsbp/gnss_macros.h @@ -18,17 +18,16 @@ #ifndef LIBSBP_GNSS_MACROS_H #define LIBSBP_GNSS_MACROS_H - #define SBP_GNSSSIGNAL__MASK (0xffu) #define SBP_GNSSSIGNAL__SHIFT (0u) #define SBP_GNSSSIGNAL__GET(flags) \ - ((u8)((u8)((flags) >> SBP_GNSSSIGNAL__SHIFT) \ - & SBP_GNSSSIGNAL__MASK)) -#define SBP_GNSSSIGNAL__SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_GNSSSIGNAL__MASK << SBP_GNSSSIGNAL__SHIFT))) | \ - (((val) & (SBP_GNSSSIGNAL__MASK)) \ - << (SBP_GNSSSIGNAL__SHIFT)));} while(0) - + ((u8)((u8)((flags) >> SBP_GNSSSIGNAL__SHIFT) & SBP_GNSSSIGNAL__MASK)) +#define SBP_GNSSSIGNAL__SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_GNSSSIGNAL__MASK << SBP_GNSSSIGNAL__SHIFT))) | \ + (((val) & (SBP_GNSSSIGNAL__MASK)) << (SBP_GNSSSIGNAL__SHIFT))); \ + } while (0) #define SBP_GNSSSIGNAL_GPS_L1CA (0) #define SBP_GNSSSIGNAL_GPS_L2CM (1) @@ -43,43 +42,40 @@ #define SBP_GNSSSIGNAL_GAL_E7I (20) #define SBP_GNSSSIGNAL_BDS3_B2A (47) /** - * Encoded length of sbp_v4_gnss_signal_t (V4 API) and + * Encoded length of sbp_v4_gnss_signal_t (V4 API) and * sbp_gnss_signal_t (legacy API) */ #define SBP_V4_GNSS_SIGNAL_ENCODED_LEN 2u - #define SBP_SVID__MASK (0xffu) #define SBP_SVID__SHIFT (0u) #define SBP_SVID__GET(flags) \ - ((u8)((u8)((flags) >> SBP_SVID__SHIFT) \ - & SBP_SVID__MASK)) -#define SBP_SVID__SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SVID__MASK << SBP_SVID__SHIFT))) | \ - (((val) & (SBP_SVID__MASK)) \ - << (SBP_SVID__SHIFT)));} while(0) - + ((u8)((u8)((flags) >> SBP_SVID__SHIFT) & SBP_SVID__MASK)) +#define SBP_SVID__SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_SVID__MASK << SBP_SVID__SHIFT))) | \ + (((val) & (SBP_SVID__MASK)) << (SBP_SVID__SHIFT))); \ + } while (0) #define SBP_SVID_GPS (0) #define SBP_SVID_BDS (3) #define SBP_SVID_GAL (5) /** - * Encoded length of sbp_sv_id_t (V4 API) and + * Encoded length of sbp_sv_id_t (V4 API) and * sv_id_t (legacy API) */ #define SBP_SV_ID_ENCODED_LEN 2u - #define SBP_GNSSSIGNALDEP__MASK (0xffu) #define SBP_GNSSSIGNALDEP__SHIFT (0u) #define SBP_GNSSSIGNALDEP__GET(flags) \ - ((u8)((u8)((flags) >> SBP_GNSSSIGNALDEP__SHIFT) \ - & SBP_GNSSSIGNALDEP__MASK)) -#define SBP_GNSSSIGNALDEP__SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_GNSSSIGNALDEP__MASK << SBP_GNSSSIGNALDEP__SHIFT))) | \ - (((val) & (SBP_GNSSSIGNALDEP__MASK)) \ - << (SBP_GNSSSIGNALDEP__SHIFT)));} while(0) - + ((u8)((u8)((flags) >> SBP_GNSSSIGNALDEP__SHIFT) & SBP_GNSSSIGNALDEP__MASK)) +#define SBP_GNSSSIGNALDEP__SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_GNSSSIGNALDEP__MASK << SBP_GNSSSIGNALDEP__SHIFT))) | \ + (((val) & (SBP_GNSSSIGNALDEP__MASK)) << (SBP_GNSSSIGNALDEP__SHIFT))); \ + } while (0) #define SBP_GNSSSIGNALDEP_GPS_L1CA (0) #define SBP_GNSSSIGNALDEP_GPS_L2CM (1) @@ -89,39 +85,33 @@ #define SBP_GNSSSIGNALDEP_GPS_L1P (5) #define SBP_GNSSSIGNALDEP_GPS_L2P (6) /** - * Encoded length of sbp_gnss_signal_dep_t (V4 API) and + * Encoded length of sbp_gnss_signal_dep_t (V4 API) and * gnss_signal_dep_t (legacy API) */ #define SBP_GNSS_SIGNAL_DEP_ENCODED_LEN 4u - /** - * Encoded length of sbp_gps_time_dep_t (V4 API) and + * Encoded length of sbp_gps_time_dep_t (V4 API) and * gps_time_dep_t (legacy API) */ #define SBP_GPS_TIME_DEP_ENCODED_LEN 6u - /** - * Encoded length of sbp_gps_time_sec_t (V4 API) and + * Encoded length of sbp_gps_time_sec_t (V4 API) and * gps_time_sec_t (legacy API) */ #define SBP_GPS_TIME_SEC_ENCODED_LEN 6u - /** - * Encoded length of sbp_v4_gps_time_t (V4 API) and + * Encoded length of sbp_v4_gps_time_t (V4 API) and * sbp_gps_time_t (legacy API) */ #define SBP_V4_GPS_TIME_ENCODED_LEN 10u - /** - * Encoded length of sbp_carrier_phase_t (V4 API) and + * Encoded length of sbp_carrier_phase_t (V4 API) and * carrier_phase_t (legacy API) */ #define SBP_CARRIER_PHASE_ENCODED_LEN 5u - - #endif /* LIBSBP_GNSS_MACROS_H */ diff --git a/c/include/libsbp/imu.h b/c/include/libsbp/imu.h index c4c06990d..be2231759 100644 --- a/c/include/libsbp/imu.h +++ b/c/include/libsbp/imu.h @@ -17,7 +17,7 @@ #ifndef LIBSBP_IMU_MESSAGES_H #define LIBSBP_IMU_MESSAGES_H -#include #include +#include #endif /* LIBSBP_IMU_MESSAGES_H */ diff --git a/c/include/libsbp/imu/MSG_IMU_AUX.h b/c/include/libsbp/imu/MSG_IMU_AUX.h index 1ea70a415..93f372142 100644 --- a/c/include/libsbp/imu/MSG_IMU_AUX.h +++ b/c/include/libsbp/imu/MSG_IMU_AUX.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_IMU_MSG_IMU_AUX_H #define LIBSBP_IMU_MSG_IMU_AUX_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,39 +40,34 @@ *****************************************************************************/ /** Auxiliary IMU data * -* Auxiliary data specific to a particular IMU. The `imu_type` field will always be consistent but the rest of the payload is device specific and depends on the value of `imu_type`. + * Auxiliary data specific to a particular IMU. The `imu_type` field will always + * be consistent but the rest of the payload is device specific and depends on + * the value of `imu_type`. */ typedef struct { - - /** -* IMU type + * IMU type */ u8 imu_type; - /** -* Raw IMU temperature + * Raw IMU temperature */ s16 temp; - /** -* IMU configuration + * IMU configuration */ u8 imu_conf; } sbp_msg_imu_aux_t; - - /** * Get encoded size of an instance of sbp_msg_imu_aux_t * * @param msg sbp_msg_imu_aux_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_imu_aux_encoded_len(const sbp_msg_imu_aux_t *msg) -{ +static inline size_t sbp_msg_imu_aux_encoded_len(const sbp_msg_imu_aux_t *msg) { (void)msg; return SBP_MSG_IMU_AUX_ENCODED_LEN; } @@ -80,36 +75,52 @@ static inline size_t sbp_msg_imu_aux_encoded_len(const sbp_msg_imu_aux_t *msg) /** * Encode an instance of sbp_msg_imu_aux_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_imu_aux_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_imu_aux_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_imu_aux_t *msg); +SBP_EXPORT s8 sbp_msg_imu_aux_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_imu_aux_t *msg); /** * Decode an instance of sbp_msg_imu_aux_t from wire representation * - * This function decodes the wire representation of a sbp_msg_imu_aux_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_imu_aux_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_imu_aux_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_imu_aux_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_imu_aux_t *msg); +SBP_EXPORT s8 sbp_msg_imu_aux_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_imu_aux_t *msg); /** * Send an instance of sbp_msg_imu_aux_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_imu_aux_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_imu_aux_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -117,51 +128,61 @@ SBP_EXPORT s8 sbp_msg_imu_aux_decode(const uint8_t *buf, uint8_t len, uint8_t *n * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_imu_aux_send(sbp_state_t *s, u16 sender_id, const sbp_msg_imu_aux_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_imu_aux_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_imu_aux_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_imu_aux_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_imu_aux_t instance * @param b sbp_msg_imu_aux_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_imu_aux_cmp(const sbp_msg_imu_aux_t *a, const sbp_msg_imu_aux_t *b); +SBP_EXPORT int sbp_msg_imu_aux_cmp(const sbp_msg_imu_aux_t *a, + const sbp_msg_imu_aux_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_imu_aux_t &lhs, const sbp_msg_imu_aux_t &rhs) { +static inline bool operator==(const sbp_msg_imu_aux_t &lhs, + const sbp_msg_imu_aux_t &rhs) { return sbp_msg_imu_aux_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_imu_aux_t &lhs, const sbp_msg_imu_aux_t &rhs) { +static inline bool operator!=(const sbp_msg_imu_aux_t &lhs, + const sbp_msg_imu_aux_t &rhs) { return sbp_msg_imu_aux_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_imu_aux_t &lhs, const sbp_msg_imu_aux_t &rhs) { +static inline bool operator<(const sbp_msg_imu_aux_t &lhs, + const sbp_msg_imu_aux_t &rhs) { return sbp_msg_imu_aux_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_imu_aux_t &lhs, const sbp_msg_imu_aux_t &rhs) { +static inline bool operator<=(const sbp_msg_imu_aux_t &lhs, + const sbp_msg_imu_aux_t &rhs) { return sbp_msg_imu_aux_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_imu_aux_t &lhs, const sbp_msg_imu_aux_t &rhs) { +static inline bool operator>(const sbp_msg_imu_aux_t &lhs, + const sbp_msg_imu_aux_t &rhs) { return sbp_msg_imu_aux_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_imu_aux_t &lhs, const sbp_msg_imu_aux_t &rhs) { +static inline bool operator>=(const sbp_msg_imu_aux_t &lhs, + const sbp_msg_imu_aux_t &rhs) { return sbp_msg_imu_aux_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_IMU_MSG_IMU_AUX_H */ - diff --git a/c/include/libsbp/imu/MSG_IMU_RAW.h b/c/include/libsbp/imu/MSG_IMU_RAW.h index b8dcd08ca..f37ec7631 100644 --- a/c/include/libsbp/imu/MSG_IMU_RAW.h +++ b/c/include/libsbp/imu/MSG_IMU_RAW.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_IMU_MSG_IMU_RAW_H #define LIBSBP_IMU_MSG_IMU_RAW_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,69 +40,66 @@ *****************************************************************************/ /** Raw IMU data * - * Raw data from the Inertial Measurement Unit, containing accelerometer and gyroscope readings. The sense of the measurements are to be aligned with the indications on the device itself. Measurement units, which are specific to the device hardware and settings, are communicated via the MSG_IMU_AUX message. If using "time since startup" local time tags, the receiving end will expect a `MSG_PPS_TIME` regardless of GNSS fix state. This also requires that the MSG_PPS_TIME message be sent prior to any IMU RAW messages that are based on the current (as measured at the PPS edge) local time timestamps. The local time (as defined in the MSG_PPS_TIME message) must wrap around to zero when reaching the extent of the u64 "Local time in microseconds" parameter. + * Raw data from the Inertial Measurement Unit, containing accelerometer and + * gyroscope readings. The sense of the measurements are to be aligned with the + * indications on the device itself. Measurement units, which are specific to + * the device hardware and settings, are communicated via the MSG_IMU_AUX + * message. If using "time since startup" local time tags, the receiving end + * will expect a `MSG_PPS_TIME` regardless of GNSS fix state. This also requires + * that the MSG_PPS_TIME message be sent prior to any IMU RAW messages that are + * based on the current (as measured at the PPS edge) local time timestamps. The + * local time (as defined in the MSG_PPS_TIME message) must wrap around to zero + * when reaching the extent of the u64 "Local time in microseconds" parameter. */ typedef struct { - - /** - * Milliseconds since reference epoch and time status. + * Milliseconds since reference epoch and time status. */ u32 tow; - /** - * Milliseconds since reference epoch, fractional part [ms / 256] + * Milliseconds since reference epoch, fractional part [ms / 256] */ u8 tow_f; - /** -* Acceleration in the IMU frame X axis + * Acceleration in the IMU frame X axis */ s16 acc_x; - /** -* Acceleration in the IMU frame Y axis + * Acceleration in the IMU frame Y axis */ s16 acc_y; - /** -* Acceleration in the IMU frame Z axis + * Acceleration in the IMU frame Z axis */ s16 acc_z; - /** -* Angular rate around IMU frame X axis + * Angular rate around IMU frame X axis */ s16 gyr_x; - /** -* Angular rate around IMU frame Y axis + * Angular rate around IMU frame Y axis */ s16 gyr_y; - /** -* Angular rate around IMU frame Z axis + * Angular rate around IMU frame Z axis */ s16 gyr_z; } sbp_msg_imu_raw_t; - - /** * Get encoded size of an instance of sbp_msg_imu_raw_t * * @param msg sbp_msg_imu_raw_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_imu_raw_encoded_len(const sbp_msg_imu_raw_t *msg) -{ +static inline size_t sbp_msg_imu_raw_encoded_len(const sbp_msg_imu_raw_t *msg) { (void)msg; return SBP_MSG_IMU_RAW_ENCODED_LEN; } @@ -110,36 +107,52 @@ static inline size_t sbp_msg_imu_raw_encoded_len(const sbp_msg_imu_raw_t *msg) /** * Encode an instance of sbp_msg_imu_raw_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_imu_raw_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_imu_raw_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_imu_raw_t *msg); +SBP_EXPORT s8 sbp_msg_imu_raw_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_imu_raw_t *msg); /** * Decode an instance of sbp_msg_imu_raw_t from wire representation * - * This function decodes the wire representation of a sbp_msg_imu_raw_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_imu_raw_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_imu_raw_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_imu_raw_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_imu_raw_t *msg); +SBP_EXPORT s8 sbp_msg_imu_raw_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_imu_raw_t *msg); /** * Send an instance of sbp_msg_imu_raw_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_imu_raw_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_imu_raw_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -147,51 +160,61 @@ SBP_EXPORT s8 sbp_msg_imu_raw_decode(const uint8_t *buf, uint8_t len, uint8_t *n * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_imu_raw_send(sbp_state_t *s, u16 sender_id, const sbp_msg_imu_raw_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_imu_raw_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_imu_raw_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_imu_raw_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_imu_raw_t instance * @param b sbp_msg_imu_raw_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_imu_raw_cmp(const sbp_msg_imu_raw_t *a, const sbp_msg_imu_raw_t *b); +SBP_EXPORT int sbp_msg_imu_raw_cmp(const sbp_msg_imu_raw_t *a, + const sbp_msg_imu_raw_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_imu_raw_t &lhs, const sbp_msg_imu_raw_t &rhs) { +static inline bool operator==(const sbp_msg_imu_raw_t &lhs, + const sbp_msg_imu_raw_t &rhs) { return sbp_msg_imu_raw_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_imu_raw_t &lhs, const sbp_msg_imu_raw_t &rhs) { +static inline bool operator!=(const sbp_msg_imu_raw_t &lhs, + const sbp_msg_imu_raw_t &rhs) { return sbp_msg_imu_raw_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_imu_raw_t &lhs, const sbp_msg_imu_raw_t &rhs) { +static inline bool operator<(const sbp_msg_imu_raw_t &lhs, + const sbp_msg_imu_raw_t &rhs) { return sbp_msg_imu_raw_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_imu_raw_t &lhs, const sbp_msg_imu_raw_t &rhs) { +static inline bool operator<=(const sbp_msg_imu_raw_t &lhs, + const sbp_msg_imu_raw_t &rhs) { return sbp_msg_imu_raw_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_imu_raw_t &lhs, const sbp_msg_imu_raw_t &rhs) { +static inline bool operator>(const sbp_msg_imu_raw_t &lhs, + const sbp_msg_imu_raw_t &rhs) { return sbp_msg_imu_raw_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_imu_raw_t &lhs, const sbp_msg_imu_raw_t &rhs) { +static inline bool operator>=(const sbp_msg_imu_raw_t &lhs, + const sbp_msg_imu_raw_t &rhs) { return sbp_msg_imu_raw_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_IMU_MSG_IMU_RAW_H */ - diff --git a/c/include/libsbp/imu_macros.h b/c/include/libsbp/imu_macros.h index 41fe89fd9..b2a105581 100644 --- a/c/include/libsbp/imu_macros.h +++ b/c/include/libsbp/imu_macros.h @@ -18,52 +18,61 @@ #ifndef LIBSBP_IMU_MACROS_H #define LIBSBP_IMU_MACROS_H - #define SBP_MSG_IMU_RAW 0x0900 #define SBP_IMU_RAW_TIME_STATUS_MASK (0x3u) #define SBP_IMU_RAW_TIME_STATUS_SHIFT (30u) -#define SBP_IMU_RAW_TIME_STATUS_GET(flags) \ - ((u32)((u32)((flags) >> SBP_IMU_RAW_TIME_STATUS_SHIFT) \ - & SBP_IMU_RAW_TIME_STATUS_MASK)) -#define SBP_IMU_RAW_TIME_STATUS_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_IMU_RAW_TIME_STATUS_MASK << SBP_IMU_RAW_TIME_STATUS_SHIFT))) | \ - (((val) & (SBP_IMU_RAW_TIME_STATUS_MASK)) \ - << (SBP_IMU_RAW_TIME_STATUS_SHIFT)));} while(0) - +#define SBP_IMU_RAW_TIME_STATUS_GET(flags) \ + ((u32)((u32)((flags) >> SBP_IMU_RAW_TIME_STATUS_SHIFT) & \ + SBP_IMU_RAW_TIME_STATUS_MASK)) +#define SBP_IMU_RAW_TIME_STATUS_SET(flags, val) \ + do { \ + (flags) = (u32)((flags & (~(SBP_IMU_RAW_TIME_STATUS_MASK \ + << SBP_IMU_RAW_TIME_STATUS_SHIFT))) | \ + (((val) & (SBP_IMU_RAW_TIME_STATUS_MASK)) \ + << (SBP_IMU_RAW_TIME_STATUS_SHIFT))); \ + } while (0) #define SBP_IMU_RAW_TIME_STATUS_REFERENCE_EPOCH_IS_START_OF_CURRENT_GPS_WEEK (0) #define SBP_IMU_RAW_TIME_STATUS_REFERENCE_EPOCH_IS_TIME_OF_SYSTEM_STARTUP (1) #define SBP_IMU_RAW_TIME_STATUS_REFERENCE_EPOCH_IS_UNKNOWN (2) #define SBP_IMU_RAW_TIME_STATUS_REFERENCE_EPOCH_IS_LAST_PPS (3) -#define SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_MASK (0x3fffffffu) +#define SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_MASK \ + (0x3fffffffu) #define SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_SHIFT (0u) -#define SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_GET(flags) \ - ((u32)((u32)((flags) >> SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_SHIFT) \ - & SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_MASK)) -#define SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_MASK << SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_SHIFT))) | \ - (((val) & (SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_MASK)) \ - << (SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_SHIFT)));} while(0) - +#define SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_GET(flags) \ + ((u32)((u32)((flags) >> \ + SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_SHIFT) & \ + SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_MASK)) +#define SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_SET(flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_MASK \ + << SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_SHIFT))) | \ + (((val) & \ + (SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_MASK)) \ + << (SBP_IMU_RAW_TIME_SINCE_REFERENCE_EPOCH_IN_MILLISECONDS_SHIFT))); \ + } while (0) /** - * Encoded length of sbp_msg_imu_raw_t (V4 API) and + * Encoded length of sbp_msg_imu_raw_t (V4 API) and * msg_imu_raw_t (legacy API) */ #define SBP_MSG_IMU_RAW_ENCODED_LEN 17u - #define SBP_MSG_IMU_AUX 0x0901 #define SBP_IMU_AUX_IMU_TYPE_MASK (0xffu) #define SBP_IMU_AUX_IMU_TYPE_SHIFT (0u) -#define SBP_IMU_AUX_IMU_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_IMU_AUX_IMU_TYPE_SHIFT) \ - & SBP_IMU_AUX_IMU_TYPE_MASK)) -#define SBP_IMU_AUX_IMU_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_IMU_AUX_IMU_TYPE_MASK << SBP_IMU_AUX_IMU_TYPE_SHIFT))) | \ - (((val) & (SBP_IMU_AUX_IMU_TYPE_MASK)) \ - << (SBP_IMU_AUX_IMU_TYPE_SHIFT)));} while(0) - +#define SBP_IMU_AUX_IMU_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_IMU_AUX_IMU_TYPE_SHIFT) & \ + SBP_IMU_AUX_IMU_TYPE_MASK)) +#define SBP_IMU_AUX_IMU_TYPE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_IMU_AUX_IMU_TYPE_MASK \ + << SBP_IMU_AUX_IMU_TYPE_SHIFT))) | \ + (((val) & (SBP_IMU_AUX_IMU_TYPE_MASK)) \ + << (SBP_IMU_AUX_IMU_TYPE_SHIFT))); \ + } while (0) #define SBP_IMU_AUX_IMU_TYPE_BOSCH_BMI160 (0) #define SBP_IMU_AUX_IMU_TYPE_ST_MICROELECTRONICS_ASM330LLH (1) @@ -72,14 +81,16 @@ #define SBP_IMU_AUX_IMU_TYPE_TDK_IAM_20680HP (5) #define SBP_IMU_AUX_GYROSCOPE_RANGE_MASK (0xfu) #define SBP_IMU_AUX_GYROSCOPE_RANGE_SHIFT (4u) -#define SBP_IMU_AUX_GYROSCOPE_RANGE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_IMU_AUX_GYROSCOPE_RANGE_SHIFT) \ - & SBP_IMU_AUX_GYROSCOPE_RANGE_MASK)) -#define SBP_IMU_AUX_GYROSCOPE_RANGE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_IMU_AUX_GYROSCOPE_RANGE_MASK << SBP_IMU_AUX_GYROSCOPE_RANGE_SHIFT))) | \ - (((val) & (SBP_IMU_AUX_GYROSCOPE_RANGE_MASK)) \ - << (SBP_IMU_AUX_GYROSCOPE_RANGE_SHIFT)));} while(0) - +#define SBP_IMU_AUX_GYROSCOPE_RANGE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_IMU_AUX_GYROSCOPE_RANGE_SHIFT) & \ + SBP_IMU_AUX_GYROSCOPE_RANGE_MASK)) +#define SBP_IMU_AUX_GYROSCOPE_RANGE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_IMU_AUX_GYROSCOPE_RANGE_MASK \ + << SBP_IMU_AUX_GYROSCOPE_RANGE_SHIFT))) | \ + (((val) & (SBP_IMU_AUX_GYROSCOPE_RANGE_MASK)) \ + << (SBP_IMU_AUX_GYROSCOPE_RANGE_SHIFT))); \ + } while (0) #define SBP_IMU_AUX_GYROSCOPE_RANGE__2000_DEG__S (0) #define SBP_IMU_AUX_GYROSCOPE_RANGE_2000_DEG_S (0) @@ -95,14 +106,16 @@ #define SBP_IMU_AUX_GYROSCOPE_RANGE_300_DEG_S (5) #define SBP_IMU_AUX_ACCELEROMETER_RANGE_MASK (0xfu) #define SBP_IMU_AUX_ACCELEROMETER_RANGE_SHIFT (0u) -#define SBP_IMU_AUX_ACCELEROMETER_RANGE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_IMU_AUX_ACCELEROMETER_RANGE_SHIFT) \ - & SBP_IMU_AUX_ACCELEROMETER_RANGE_MASK)) -#define SBP_IMU_AUX_ACCELEROMETER_RANGE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_IMU_AUX_ACCELEROMETER_RANGE_MASK << SBP_IMU_AUX_ACCELEROMETER_RANGE_SHIFT))) | \ - (((val) & (SBP_IMU_AUX_ACCELEROMETER_RANGE_MASK)) \ - << (SBP_IMU_AUX_ACCELEROMETER_RANGE_SHIFT)));} while(0) - +#define SBP_IMU_AUX_ACCELEROMETER_RANGE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_IMU_AUX_ACCELEROMETER_RANGE_SHIFT) & \ + SBP_IMU_AUX_ACCELEROMETER_RANGE_MASK)) +#define SBP_IMU_AUX_ACCELEROMETER_RANGE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_IMU_AUX_ACCELEROMETER_RANGE_MASK \ + << SBP_IMU_AUX_ACCELEROMETER_RANGE_SHIFT))) | \ + (((val) & (SBP_IMU_AUX_ACCELEROMETER_RANGE_MASK)) \ + << (SBP_IMU_AUX_ACCELEROMETER_RANGE_SHIFT))); \ + } while (0) #define SBP_IMU_AUX_ACCELEROMETER_RANGE__2G (0) #define SBP_IMU_AUX_ACCELEROMETER_RANGE_2G (0) @@ -115,11 +128,9 @@ #define SBP_IMU_AUX_ACCELEROMETER_RANGE__6G (4) #define SBP_IMU_AUX_ACCELEROMETER_RANGE_6G (4) /** - * Encoded length of sbp_msg_imu_aux_t (V4 API) and + * Encoded length of sbp_msg_imu_aux_t (V4 API) and * msg_imu_aux_t (legacy API) */ #define SBP_MSG_IMU_AUX_ENCODED_LEN 4u - - #endif /* LIBSBP_IMU_MACROS_H */ diff --git a/c/include/libsbp/integrity.h b/c/include/libsbp/integrity.h index b355c4e76..7958befcd 100644 --- a/c/include/libsbp/integrity.h +++ b/c/include/libsbp/integrity.h @@ -18,12 +18,12 @@ #ifndef LIBSBP_INTEGRITY_MESSAGES_H #define LIBSBP_INTEGRITY_MESSAGES_H #include +#include #include -#include -#include #include -#include #include -#include +#include +#include +#include #endif /* LIBSBP_INTEGRITY_MESSAGES_H */ diff --git a/c/include/libsbp/integrity/IntegritySSRHeader.h b/c/include/libsbp/integrity/IntegritySSRHeader.h index 4a02ea00b..3b6d35f36 100644 --- a/c/include/libsbp/integrity/IntegritySSRHeader.h +++ b/c/include/libsbp/integrity/IntegritySSRHeader.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_INTEGRITY_INTEGRITYSSRHEADER_H #define LIBSBP_INTEGRITY_INTEGRITYSSRHEADER_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,60 +40,50 @@ * *****************************************************************************/ typedef struct { - - /** -* GNSS reference time of the observation used to generate the flag. + * GNSS reference time of the observation used to generate the flag. */ sbp_gps_time_sec_t obs_time; - /** -* Number of messages in the dataset + * Number of messages in the dataset */ u8 num_msgs; - /** -* Position of this message in the dataset + * Position of this message in the dataset */ u8 seq_num; - /** -* SSR Solution ID. + * SSR Solution ID. */ u8 ssr_sol_id; - /** -* Unique identifier of the set this tile belongs to. + * Unique identifier of the set this tile belongs to. */ u16 tile_set_id; - /** -* Unique identifier of this tile in the tile set. + * Unique identifier of this tile in the tile set. */ u16 tile_id; - /** -* Chain and type of flag. + * Chain and type of flag. */ u8 chain_id; } sbp_integrity_ssr_header_t; - - /** * Get encoded size of an instance of sbp_integrity_ssr_header_t * * @param msg sbp_integrity_ssr_header_t instance * @return Length of on-wire representation */ -static inline size_t sbp_integrity_ssr_header_encoded_len(const sbp_integrity_ssr_header_t *msg) -{ +static inline size_t sbp_integrity_ssr_header_encoded_len( + const sbp_integrity_ssr_header_t *msg) { (void)msg; return SBP_INTEGRITY_SSR_HEADER_ENCODED_LEN; } @@ -101,74 +91,96 @@ static inline size_t sbp_integrity_ssr_header_encoded_len(const sbp_integrity_ss /** * Encode an instance of sbp_integrity_ssr_header_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_integrity_ssr_header_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_integrity_ssr_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_integrity_ssr_header_t *msg); +SBP_EXPORT s8 +sbp_integrity_ssr_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_integrity_ssr_header_t *msg); /** * Decode an instance of sbp_integrity_ssr_header_t from wire representation * - * This function decodes the wire representation of a sbp_integrity_ssr_header_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_integrity_ssr_header_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_integrity_ssr_header_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_integrity_ssr_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_integrity_ssr_header_t *msg); +SBP_EXPORT s8 sbp_integrity_ssr_header_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_integrity_ssr_header_t *msg); /** * Compare two instances of sbp_integrity_ssr_header_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_integrity_ssr_header_t instance * @param b sbp_integrity_ssr_header_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_integrity_ssr_header_cmp(const sbp_integrity_ssr_header_t *a, const sbp_integrity_ssr_header_t *b); +SBP_EXPORT int sbp_integrity_ssr_header_cmp( + const sbp_integrity_ssr_header_t *a, const sbp_integrity_ssr_header_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_integrity_ssr_header_t &lhs, const sbp_integrity_ssr_header_t &rhs) { +static inline bool operator==(const sbp_integrity_ssr_header_t &lhs, + const sbp_integrity_ssr_header_t &rhs) { return sbp_integrity_ssr_header_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_integrity_ssr_header_t &lhs, const sbp_integrity_ssr_header_t &rhs) { +static inline bool operator!=(const sbp_integrity_ssr_header_t &lhs, + const sbp_integrity_ssr_header_t &rhs) { return sbp_integrity_ssr_header_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_integrity_ssr_header_t &lhs, const sbp_integrity_ssr_header_t &rhs) { +static inline bool operator<(const sbp_integrity_ssr_header_t &lhs, + const sbp_integrity_ssr_header_t &rhs) { return sbp_integrity_ssr_header_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_integrity_ssr_header_t &lhs, const sbp_integrity_ssr_header_t &rhs) { +static inline bool operator<=(const sbp_integrity_ssr_header_t &lhs, + const sbp_integrity_ssr_header_t &rhs) { return sbp_integrity_ssr_header_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_integrity_ssr_header_t &lhs, const sbp_integrity_ssr_header_t &rhs) { +static inline bool operator>(const sbp_integrity_ssr_header_t &lhs, + const sbp_integrity_ssr_header_t &rhs) { return sbp_integrity_ssr_header_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_integrity_ssr_header_t &lhs, const sbp_integrity_ssr_header_t &rhs) { +static inline bool operator>=(const sbp_integrity_ssr_header_t &lhs, + const sbp_integrity_ssr_header_t &rhs) { return sbp_integrity_ssr_header_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_INTEGRITY_INTEGRITYSSRHEADER_H */ - diff --git a/c/include/libsbp/integrity/MSG_ACKNOWLEDGE.h b/c/include/libsbp/integrity/MSG_ACKNOWLEDGE.h index b5a12f6a6..3d6d07db2 100644 --- a/c/include/libsbp/integrity/MSG_ACKNOWLEDGE.h +++ b/c/include/libsbp/integrity/MSG_ACKNOWLEDGE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_INTEGRITY_MSG_ACKNOWLEDGE_H #define LIBSBP_INTEGRITY_MSG_ACKNOWLEDGE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -39,54 +39,48 @@ * *****************************************************************************/ typedef struct { - - /** -* Echo of the request ID field from the corresponding CRA message, or 255 if no request ID was provided. + * Echo of the request ID field from the corresponding CRA message, or 255 if + * no request ID was provided. */ u8 request_id; - /** -* Echo of the Area ID field from the corresponding CRA message. + * Echo of the Area ID field from the corresponding CRA message. */ u32 area_id; - /** -* Reported status of the request. + * Reported status of the request. */ u8 response_code; - /** - * Contains the message group(s) that will be sent in response from the corresponding CRA correction mask. An echo of the correction mask field from the corresponding CRA message. + * Contains the message group(s) that will be sent in response from the + * corresponding CRA correction mask. An echo of the correction mask field + * from the corresponding CRA message. */ u16 correction_mask_on_demand; - /** -* For future expansion. Always set to 0. + * For future expansion. Always set to 0. */ u16 correction_mask_stream; - /** -* The solution ID of the instance providing the corrections. + * The solution ID of the instance providing the corrections. */ u8 solution_id; } sbp_msg_acknowledge_t; - - /** * Get encoded size of an instance of sbp_msg_acknowledge_t * * @param msg sbp_msg_acknowledge_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_acknowledge_encoded_len(const sbp_msg_acknowledge_t *msg) -{ +static inline size_t sbp_msg_acknowledge_encoded_len( + const sbp_msg_acknowledge_t *msg) { (void)msg; return SBP_MSG_ACKNOWLEDGE_ENCODED_LEN; } @@ -94,36 +88,53 @@ static inline size_t sbp_msg_acknowledge_encoded_len(const sbp_msg_acknowledge_t /** * Encode an instance of sbp_msg_acknowledge_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_acknowledge_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acknowledge_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acknowledge_t *msg); +SBP_EXPORT s8 sbp_msg_acknowledge_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_acknowledge_t *msg); /** * Decode an instance of sbp_msg_acknowledge_t from wire representation * - * This function decodes the wire representation of a sbp_msg_acknowledge_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_acknowledge_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_acknowledge_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acknowledge_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acknowledge_t *msg); +SBP_EXPORT s8 sbp_msg_acknowledge_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_acknowledge_t *msg); /** * Send an instance of sbp_msg_acknowledge_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_acknowledge_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_acknowledge_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -131,51 +142,61 @@ SBP_EXPORT s8 sbp_msg_acknowledge_decode(const uint8_t *buf, uint8_t len, uint8_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_acknowledge_send(sbp_state_t *s, u16 sender_id, const sbp_msg_acknowledge_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_acknowledge_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_acknowledge_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_acknowledge_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_acknowledge_t instance * @param b sbp_msg_acknowledge_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_acknowledge_cmp(const sbp_msg_acknowledge_t *a, const sbp_msg_acknowledge_t *b); +SBP_EXPORT int sbp_msg_acknowledge_cmp(const sbp_msg_acknowledge_t *a, + const sbp_msg_acknowledge_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_acknowledge_t &lhs, const sbp_msg_acknowledge_t &rhs) { +static inline bool operator==(const sbp_msg_acknowledge_t &lhs, + const sbp_msg_acknowledge_t &rhs) { return sbp_msg_acknowledge_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_acknowledge_t &lhs, const sbp_msg_acknowledge_t &rhs) { +static inline bool operator!=(const sbp_msg_acknowledge_t &lhs, + const sbp_msg_acknowledge_t &rhs) { return sbp_msg_acknowledge_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_acknowledge_t &lhs, const sbp_msg_acknowledge_t &rhs) { +static inline bool operator<(const sbp_msg_acknowledge_t &lhs, + const sbp_msg_acknowledge_t &rhs) { return sbp_msg_acknowledge_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_acknowledge_t &lhs, const sbp_msg_acknowledge_t &rhs) { +static inline bool operator<=(const sbp_msg_acknowledge_t &lhs, + const sbp_msg_acknowledge_t &rhs) { return sbp_msg_acknowledge_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_acknowledge_t &lhs, const sbp_msg_acknowledge_t &rhs) { +static inline bool operator>(const sbp_msg_acknowledge_t &lhs, + const sbp_msg_acknowledge_t &rhs) { return sbp_msg_acknowledge_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_acknowledge_t &lhs, const sbp_msg_acknowledge_t &rhs) { +static inline bool operator>=(const sbp_msg_acknowledge_t &lhs, + const sbp_msg_acknowledge_t &rhs) { return sbp_msg_acknowledge_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_INTEGRITY_MSG_ACKNOWLEDGE_H */ - diff --git a/c/include/libsbp/integrity/MSG_SSR_FLAG_HIGH_LEVEL.h b/c/include/libsbp/integrity/MSG_SSR_FLAG_HIGH_LEVEL.h index 6f47838a8..78eb026bf 100644 --- a/c/include/libsbp/integrity/MSG_SSR_FLAG_HIGH_LEVEL.h +++ b/c/include/libsbp/integrity/MSG_SSR_FLAG_HIGH_LEVEL.h @@ -18,21 +18,20 @@ #ifndef LIBSBP_INTEGRITY_MSG_SSR_FLAG_HIGH_LEVEL_H #define LIBSBP_INTEGRITY_MSG_SSR_FLAG_HIGH_LEVEL_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,120 +41,110 @@ *****************************************************************************/ /** High level integrity flags * - * Integrity monitoring flags for multiple aggregated elements. An element could be a satellite, SSR grid point, or SSR tile. A group of aggregated elements being monitored for integrity could refer to: - * + * Integrity monitoring flags for multiple aggregated elements. An element could + * be a satellite, SSR grid point, or SSR tile. A group of aggregated elements + * being monitored for integrity could refer to: + * * - Satellites in a particular {GPS, GAL, BDS} constellation. - * + * * - Satellites in the line-of-sight of a particular SSR tile. - * + * * - Satellites in the line-of-sight of a particular SSR grid point. - * - * The integrity usage for a group of aggregated elements varies according to the integrity flag of the satellites comprising that group. - * - * SSR_INTEGRITY_USAGE_NOMINAL: All satellites received passed the integrity check and have flag INTEGRITY_FLAG_OK. - * - * SSR_INTEGRITY_USAGE_WARNING: A limited number of elements in the group failed the integrity check. Refer to more granular integrity messages for details on the specific failing elements. - * - * SSR_INTEGRITY_USAGE_ALERT: Most elements in the group failed the integrity check, do not use for positioning. - * + * + * The integrity usage for a group of aggregated elements varies according to + * the integrity flag of the satellites comprising that group. + * + * SSR_INTEGRITY_USAGE_NOMINAL: All satellites received passed the integrity + * check and have flag INTEGRITY_FLAG_OK. + * + * SSR_INTEGRITY_USAGE_WARNING: A limited number of elements in the group failed + * the integrity check. Refer to more granular integrity messages for details on + * the specific failing elements. + * + * SSR_INTEGRITY_USAGE_ALERT: Most elements in the group failed the integrity + * check, do not use for positioning. + * */ typedef struct { - - /** -* GNSS reference time of the observation used to generate the flag. + * GNSS reference time of the observation used to generate the flag. */ sbp_gps_time_sec_t obs_time; - /** -* GNSS reference time of the correction associated to the flag. + * GNSS reference time of the correction associated to the flag. */ sbp_gps_time_sec_t corr_time; - /** -* SSR Solution ID. + * SSR Solution ID. */ u8 ssr_sol_id; - /** -* Unique identifier of the set this tile belongs to. + * Unique identifier of the set this tile belongs to. */ u16 tile_set_id; - /** -* Unique identifier of this tile in the tile set. + * Unique identifier of this tile in the tile set. */ u16 tile_id; - /** -* Chain and type of flag. + * Chain and type of flag. */ u8 chain_id; - /** -* Use GPS satellites. + * Use GPS satellites. */ u8 use_gps_sat; - /** -* Use GAL satellites. + * Use GAL satellites. */ u8 use_gal_sat; - /** -* Use BDS satellites. + * Use BDS satellites. */ u8 use_bds_sat; - /** -* Reserved + * Reserved */ u8 reserved[SBP_MSG_SSR_FLAG_HIGH_LEVEL_RESERVED_MAX]; - /** -* Use tropo grid points. + * Use tropo grid points. */ u8 use_tropo_grid_points; - /** -* Use iono grid points. + * Use iono grid points. */ u8 use_iono_grid_points; - /** -* Use iono tile satellite LoS. + * Use iono tile satellite LoS. */ u8 use_iono_tile_sat_los; - /** -* Use iono grid point satellite LoS. + * Use iono grid point satellite LoS. */ u8 use_iono_grid_point_sat_los; } sbp_msg_ssr_flag_high_level_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_flag_high_level_t * * @param msg sbp_msg_ssr_flag_high_level_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_flag_high_level_encoded_len(const sbp_msg_ssr_flag_high_level_t *msg) -{ +static inline size_t sbp_msg_ssr_flag_high_level_encoded_len( + const sbp_msg_ssr_flag_high_level_t *msg) { (void)msg; return SBP_MSG_SSR_FLAG_HIGH_LEVEL_ENCODED_LEN; } @@ -163,36 +152,54 @@ static inline size_t sbp_msg_ssr_flag_high_level_encoded_len(const sbp_msg_ssr_f /** * Encode an instance of sbp_msg_ssr_flag_high_level_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_flag_high_level_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_high_level_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_high_level_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_flag_high_level_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_high_level_t *msg); /** * Decode an instance of sbp_msg_ssr_flag_high_level_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ssr_flag_high_level_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_flag_high_level_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ssr_flag_high_level_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_high_level_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_high_level_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_flag_high_level_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_high_level_t *msg); /** - * Send an instance of sbp_msg_ssr_flag_high_level_t with the given write function + * Send an instance of sbp_msg_ssr_flag_high_level_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_flag_high_level_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_flag_high_level_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -200,51 +207,62 @@ SBP_EXPORT s8 sbp_msg_ssr_flag_high_level_decode(const uint8_t *buf, uint8_t len * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_high_level_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_flag_high_level_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_flag_high_level_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_flag_high_level_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_flag_high_level_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_flag_high_level_t instance * @param b sbp_msg_ssr_flag_high_level_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_flag_high_level_cmp(const sbp_msg_ssr_flag_high_level_t *a, const sbp_msg_ssr_flag_high_level_t *b); +SBP_EXPORT int sbp_msg_ssr_flag_high_level_cmp( + const sbp_msg_ssr_flag_high_level_t *a, + const sbp_msg_ssr_flag_high_level_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_flag_high_level_t &lhs, const sbp_msg_ssr_flag_high_level_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_flag_high_level_t &lhs, + const sbp_msg_ssr_flag_high_level_t &rhs) { return sbp_msg_ssr_flag_high_level_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_flag_high_level_t &lhs, const sbp_msg_ssr_flag_high_level_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_flag_high_level_t &lhs, + const sbp_msg_ssr_flag_high_level_t &rhs) { return sbp_msg_ssr_flag_high_level_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_flag_high_level_t &lhs, const sbp_msg_ssr_flag_high_level_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_flag_high_level_t &lhs, + const sbp_msg_ssr_flag_high_level_t &rhs) { return sbp_msg_ssr_flag_high_level_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_flag_high_level_t &lhs, const sbp_msg_ssr_flag_high_level_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_flag_high_level_t &lhs, + const sbp_msg_ssr_flag_high_level_t &rhs) { return sbp_msg_ssr_flag_high_level_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_flag_high_level_t &lhs, const sbp_msg_ssr_flag_high_level_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_flag_high_level_t &lhs, + const sbp_msg_ssr_flag_high_level_t &rhs) { return sbp_msg_ssr_flag_high_level_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_flag_high_level_t &lhs, const sbp_msg_ssr_flag_high_level_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_flag_high_level_t &lhs, + const sbp_msg_ssr_flag_high_level_t &rhs) { return sbp_msg_ssr_flag_high_level_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_INTEGRITY_MSG_SSR_FLAG_HIGH_LEVEL_H */ - diff --git a/c/include/libsbp/integrity/MSG_SSR_FLAG_IONO_GRID_POINTS.h b/c/include/libsbp/integrity/MSG_SSR_FLAG_IONO_GRID_POINTS.h index 0705762ab..16babade7 100644 --- a/c/include/libsbp/integrity/MSG_SSR_FLAG_IONO_GRID_POINTS.h +++ b/c/include/libsbp/integrity/MSG_SSR_FLAG_IONO_GRID_POINTS.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_INTEGRITY_MSG_SSR_FLAG_IONO_GRID_POINTS_H #define LIBSBP_INTEGRITY_MSG_SSR_FLAG_IONO_GRID_POINTS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,74 +40,88 @@ * *****************************************************************************/ typedef struct { - - /** -* Header of an integrity message. + * Header of an integrity message. */ sbp_integrity_ssr_header_t header; - /** -* Number of faulty grid points. + * Number of faulty grid points. */ u8 n_faulty_points; - /** -* List of faulty grid points. + * List of faulty grid points. */ u16 faulty_points[SBP_MSG_SSR_FLAG_IONO_GRID_POINTS_FAULTY_POINTS_MAX]; } sbp_msg_ssr_flag_iono_grid_points_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_flag_iono_grid_points_t * * @param msg sbp_msg_ssr_flag_iono_grid_points_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_flag_iono_grid_points_encoded_len(const sbp_msg_ssr_flag_iono_grid_points_t *msg) -{ - return SBP_MSG_SSR_FLAG_IONO_GRID_POINTS_ENCODED_OVERHEAD - + (msg->n_faulty_points * SBP_ENCODED_LEN_U16) - ; +static inline size_t sbp_msg_ssr_flag_iono_grid_points_encoded_len( + const sbp_msg_ssr_flag_iono_grid_points_t *msg) { + return SBP_MSG_SSR_FLAG_IONO_GRID_POINTS_ENCODED_OVERHEAD + + (msg->n_faulty_points * SBP_ENCODED_LEN_U16); } /** - * Encode an instance of sbp_msg_ssr_flag_iono_grid_points_t to wire representation + * Encode an instance of sbp_msg_ssr_flag_iono_grid_points_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_flag_iono_grid_points_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_iono_grid_points_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_iono_grid_points_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_flag_iono_grid_points_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_iono_grid_points_t *msg); /** - * Decode an instance of sbp_msg_ssr_flag_iono_grid_points_t from wire representation + * Decode an instance of sbp_msg_ssr_flag_iono_grid_points_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_flag_iono_grid_points_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_flag_iono_grid_points_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ssr_flag_iono_grid_points_t instance + * @param buf Wire representation of the sbp_msg_ssr_flag_iono_grid_points_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_iono_grid_points_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_iono_grid_points_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_flag_iono_grid_points_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_iono_grid_points_t *msg); /** - * Send an instance of sbp_msg_ssr_flag_iono_grid_points_t with the given write function + * Send an instance of sbp_msg_ssr_flag_iono_grid_points_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_flag_iono_grid_points_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_flag_iono_grid_points_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -115,51 +129,62 @@ SBP_EXPORT s8 sbp_msg_ssr_flag_iono_grid_points_decode(const uint8_t *buf, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_iono_grid_points_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_flag_iono_grid_points_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_flag_iono_grid_points_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_flag_iono_grid_points_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_flag_iono_grid_points_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_flag_iono_grid_points_t instance * @param b sbp_msg_ssr_flag_iono_grid_points_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_flag_iono_grid_points_cmp(const sbp_msg_ssr_flag_iono_grid_points_t *a, const sbp_msg_ssr_flag_iono_grid_points_t *b); +SBP_EXPORT int sbp_msg_ssr_flag_iono_grid_points_cmp( + const sbp_msg_ssr_flag_iono_grid_points_t *a, + const sbp_msg_ssr_flag_iono_grid_points_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_flag_iono_grid_points_t &lhs, const sbp_msg_ssr_flag_iono_grid_points_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_flag_iono_grid_points_t &lhs, + const sbp_msg_ssr_flag_iono_grid_points_t &rhs) { return sbp_msg_ssr_flag_iono_grid_points_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_flag_iono_grid_points_t &lhs, const sbp_msg_ssr_flag_iono_grid_points_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_flag_iono_grid_points_t &lhs, + const sbp_msg_ssr_flag_iono_grid_points_t &rhs) { return sbp_msg_ssr_flag_iono_grid_points_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_flag_iono_grid_points_t &lhs, const sbp_msg_ssr_flag_iono_grid_points_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_flag_iono_grid_points_t &lhs, + const sbp_msg_ssr_flag_iono_grid_points_t &rhs) { return sbp_msg_ssr_flag_iono_grid_points_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_flag_iono_grid_points_t &lhs, const sbp_msg_ssr_flag_iono_grid_points_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_flag_iono_grid_points_t &lhs, + const sbp_msg_ssr_flag_iono_grid_points_t &rhs) { return sbp_msg_ssr_flag_iono_grid_points_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_flag_iono_grid_points_t &lhs, const sbp_msg_ssr_flag_iono_grid_points_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_flag_iono_grid_points_t &lhs, + const sbp_msg_ssr_flag_iono_grid_points_t &rhs) { return sbp_msg_ssr_flag_iono_grid_points_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_flag_iono_grid_points_t &lhs, const sbp_msg_ssr_flag_iono_grid_points_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_flag_iono_grid_points_t &lhs, + const sbp_msg_ssr_flag_iono_grid_points_t &rhs) { return sbp_msg_ssr_flag_iono_grid_points_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_INTEGRITY_MSG_SSR_FLAG_IONO_GRID_POINTS_H */ - diff --git a/c/include/libsbp/integrity/MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS.h b/c/include/libsbp/integrity/MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS.h index 1eab39186..fb6c7c209 100644 --- a/c/include/libsbp/integrity/MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS.h +++ b/c/include/libsbp/integrity/MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_INTEGRITY_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS_H #define LIBSBP_INTEGRITY_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,80 +41,95 @@ * *****************************************************************************/ typedef struct { - - /** -* Header of an integrity message. + * Header of an integrity message. */ sbp_integrity_ssr_header_t header; - /** -* Index of the grid point. + * Index of the grid point. */ u16 grid_point_id; - /** -* Number of faulty LOS. + * Number of faulty LOS. */ u8 n_faulty_los; - /** -* List of faulty LOS + * List of faulty LOS */ - sbp_sv_id_t faulty_los[SBP_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS_FAULTY_LOS_MAX]; + sbp_sv_id_t + faulty_los[SBP_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS_FAULTY_LOS_MAX]; } sbp_msg_ssr_flag_iono_grid_point_sat_los_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_flag_iono_grid_point_sat_los_t * * @param msg sbp_msg_ssr_flag_iono_grid_point_sat_los_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_flag_iono_grid_point_sat_los_encoded_len(const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg) -{ - return SBP_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS_ENCODED_OVERHEAD - + (msg->n_faulty_los * SBP_SV_ID_ENCODED_LEN) - ; +static inline size_t sbp_msg_ssr_flag_iono_grid_point_sat_los_encoded_len( + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg) { + return SBP_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS_ENCODED_OVERHEAD + + (msg->n_faulty_los * SBP_SV_ID_ENCODED_LEN); } /** - * Encode an instance of sbp_msg_ssr_flag_iono_grid_point_sat_los_t to wire representation + * Encode an instance of sbp_msg_ssr_flag_iono_grid_point_sat_los_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_flag_iono_grid_point_sat_los_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_iono_grid_point_sat_los_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_flag_iono_grid_point_sat_los_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg); /** - * Decode an instance of sbp_msg_ssr_flag_iono_grid_point_sat_los_t from wire representation + * Decode an instance of sbp_msg_ssr_flag_iono_grid_point_sat_los_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_flag_iono_grid_point_sat_los_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_flag_iono_grid_point_sat_los_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_ssr_flag_iono_grid_point_sat_los_t instance + * @param buf Wire representation of the + * sbp_msg_ssr_flag_iono_grid_point_sat_los_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_iono_grid_point_sat_los_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_flag_iono_grid_point_sat_los_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg); /** - * Send an instance of sbp_msg_ssr_flag_iono_grid_point_sat_los_t with the given write function + * Send an instance of sbp_msg_ssr_flag_iono_grid_point_sat_los_t with the given + * write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_flag_iono_grid_point_sat_los_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_flag_iono_grid_point_sat_los_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -122,51 +137,69 @@ SBP_EXPORT s8 sbp_msg_ssr_flag_iono_grid_point_sat_los_decode(const uint8_t *buf * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_iono_grid_point_sat_los_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_flag_iono_grid_point_sat_los_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_flag_iono_grid_point_sat_los_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_flag_iono_grid_point_sat_los_t instance * @param b sbp_msg_ssr_flag_iono_grid_point_sat_los_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_flag_iono_grid_point_sat_los_cmp(const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *a, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *b); +SBP_EXPORT int sbp_msg_ssr_flag_iono_grid_point_sat_los_cmp( + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *a, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &lhs, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &rhs) { +static inline bool operator==( + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &lhs, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &rhs) { return sbp_msg_ssr_flag_iono_grid_point_sat_los_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &lhs, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &rhs) { +static inline bool operator!=( + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &lhs, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &rhs) { return sbp_msg_ssr_flag_iono_grid_point_sat_los_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &lhs, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &rhs) { +static inline bool operator<( + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &lhs, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &rhs) { return sbp_msg_ssr_flag_iono_grid_point_sat_los_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &lhs, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &rhs) { +static inline bool operator<=( + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &lhs, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &rhs) { return sbp_msg_ssr_flag_iono_grid_point_sat_los_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &lhs, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &rhs) { +static inline bool operator>( + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &lhs, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &rhs) { return sbp_msg_ssr_flag_iono_grid_point_sat_los_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &lhs, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &rhs) { +static inline bool operator>=( + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &lhs, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &rhs) { return sbp_msg_ssr_flag_iono_grid_point_sat_los_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_INTEGRITY_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS_H */ - diff --git a/c/include/libsbp/integrity/MSG_SSR_FLAG_IONO_TILE_SAT_LOS.h b/c/include/libsbp/integrity/MSG_SSR_FLAG_IONO_TILE_SAT_LOS.h index 39ff279a9..91a649d80 100644 --- a/c/include/libsbp/integrity/MSG_SSR_FLAG_IONO_TILE_SAT_LOS.h +++ b/c/include/libsbp/integrity/MSG_SSR_FLAG_IONO_TILE_SAT_LOS.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_INTEGRITY_MSG_SSR_FLAG_IONO_TILE_SAT_LOS_H #define LIBSBP_INTEGRITY_MSG_SSR_FLAG_IONO_TILE_SAT_LOS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,74 +41,89 @@ * *****************************************************************************/ typedef struct { - - /** -* Header of an integrity message. + * Header of an integrity message. */ sbp_integrity_ssr_header_t header; - /** -* Number of faulty LOS. + * Number of faulty LOS. */ u8 n_faulty_los; - /** -* List of faulty LOS + * List of faulty LOS */ sbp_sv_id_t faulty_los[SBP_MSG_SSR_FLAG_IONO_TILE_SAT_LOS_FAULTY_LOS_MAX]; } sbp_msg_ssr_flag_iono_tile_sat_los_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_flag_iono_tile_sat_los_t * * @param msg sbp_msg_ssr_flag_iono_tile_sat_los_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_flag_iono_tile_sat_los_encoded_len(const sbp_msg_ssr_flag_iono_tile_sat_los_t *msg) -{ - return SBP_MSG_SSR_FLAG_IONO_TILE_SAT_LOS_ENCODED_OVERHEAD - + (msg->n_faulty_los * SBP_SV_ID_ENCODED_LEN) - ; +static inline size_t sbp_msg_ssr_flag_iono_tile_sat_los_encoded_len( + const sbp_msg_ssr_flag_iono_tile_sat_los_t *msg) { + return SBP_MSG_SSR_FLAG_IONO_TILE_SAT_LOS_ENCODED_OVERHEAD + + (msg->n_faulty_los * SBP_SV_ID_ENCODED_LEN); } /** - * Encode an instance of sbp_msg_ssr_flag_iono_tile_sat_los_t to wire representation + * Encode an instance of sbp_msg_ssr_flag_iono_tile_sat_los_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_flag_iono_tile_sat_los_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_iono_tile_sat_los_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_iono_tile_sat_los_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_flag_iono_tile_sat_los_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_iono_tile_sat_los_t *msg); /** - * Decode an instance of sbp_msg_ssr_flag_iono_tile_sat_los_t from wire representation + * Decode an instance of sbp_msg_ssr_flag_iono_tile_sat_los_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_flag_iono_tile_sat_los_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_flag_iono_tile_sat_los_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_ssr_flag_iono_tile_sat_los_t instance + * @param buf Wire representation of the sbp_msg_ssr_flag_iono_tile_sat_los_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_iono_tile_sat_los_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_iono_tile_sat_los_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_flag_iono_tile_sat_los_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_iono_tile_sat_los_t *msg); /** - * Send an instance of sbp_msg_ssr_flag_iono_tile_sat_los_t with the given write function + * Send an instance of sbp_msg_ssr_flag_iono_tile_sat_los_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_flag_iono_tile_sat_los_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_flag_iono_tile_sat_los_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -116,51 +131,62 @@ SBP_EXPORT s8 sbp_msg_ssr_flag_iono_tile_sat_los_decode(const uint8_t *buf, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_iono_tile_sat_los_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_flag_iono_tile_sat_los_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_flag_iono_tile_sat_los_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_flag_iono_tile_sat_los_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_flag_iono_tile_sat_los_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_flag_iono_tile_sat_los_t instance * @param b sbp_msg_ssr_flag_iono_tile_sat_los_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_flag_iono_tile_sat_los_cmp(const sbp_msg_ssr_flag_iono_tile_sat_los_t *a, const sbp_msg_ssr_flag_iono_tile_sat_los_t *b); +SBP_EXPORT int sbp_msg_ssr_flag_iono_tile_sat_los_cmp( + const sbp_msg_ssr_flag_iono_tile_sat_los_t *a, + const sbp_msg_ssr_flag_iono_tile_sat_los_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_flag_iono_tile_sat_los_t &lhs, const sbp_msg_ssr_flag_iono_tile_sat_los_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_flag_iono_tile_sat_los_t &lhs, + const sbp_msg_ssr_flag_iono_tile_sat_los_t &rhs) { return sbp_msg_ssr_flag_iono_tile_sat_los_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_flag_iono_tile_sat_los_t &lhs, const sbp_msg_ssr_flag_iono_tile_sat_los_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_flag_iono_tile_sat_los_t &lhs, + const sbp_msg_ssr_flag_iono_tile_sat_los_t &rhs) { return sbp_msg_ssr_flag_iono_tile_sat_los_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_flag_iono_tile_sat_los_t &lhs, const sbp_msg_ssr_flag_iono_tile_sat_los_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_flag_iono_tile_sat_los_t &lhs, + const sbp_msg_ssr_flag_iono_tile_sat_los_t &rhs) { return sbp_msg_ssr_flag_iono_tile_sat_los_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_flag_iono_tile_sat_los_t &lhs, const sbp_msg_ssr_flag_iono_tile_sat_los_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_flag_iono_tile_sat_los_t &lhs, + const sbp_msg_ssr_flag_iono_tile_sat_los_t &rhs) { return sbp_msg_ssr_flag_iono_tile_sat_los_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_flag_iono_tile_sat_los_t &lhs, const sbp_msg_ssr_flag_iono_tile_sat_los_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_flag_iono_tile_sat_los_t &lhs, + const sbp_msg_ssr_flag_iono_tile_sat_los_t &rhs) { return sbp_msg_ssr_flag_iono_tile_sat_los_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_flag_iono_tile_sat_los_t &lhs, const sbp_msg_ssr_flag_iono_tile_sat_los_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_flag_iono_tile_sat_los_t &lhs, + const sbp_msg_ssr_flag_iono_tile_sat_los_t &rhs) { return sbp_msg_ssr_flag_iono_tile_sat_los_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_INTEGRITY_MSG_SSR_FLAG_IONO_TILE_SAT_LOS_H */ - diff --git a/c/include/libsbp/integrity/MSG_SSR_FLAG_SATELLITES.h b/c/include/libsbp/integrity/MSG_SSR_FLAG_SATELLITES.h index 71dbb8d4d..dcc230124 100644 --- a/c/include/libsbp/integrity/MSG_SSR_FLAG_SATELLITES.h +++ b/c/include/libsbp/integrity/MSG_SSR_FLAG_SATELLITES.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_INTEGRITY_MSG_SSR_FLAG_SATELLITES_H #define LIBSBP_INTEGRITY_MSG_SSR_FLAG_SATELLITES_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,104 +40,110 @@ * *****************************************************************************/ typedef struct { - - /** -* GNSS reference time of the observation used to generate the flag. + * GNSS reference time of the observation used to generate the flag. */ sbp_gps_time_sec_t obs_time; - /** -* Number of messages in the dataset + * Number of messages in the dataset */ u8 num_msgs; - /** -* Position of this message in the dataset + * Position of this message in the dataset */ u8 seq_num; - /** -* SSR Solution ID. + * SSR Solution ID. */ u8 ssr_sol_id; - /** -* Chain and type of flag. + * Chain and type of flag. */ u8 chain_id; - /** -* Constellation ID. + * Constellation ID. */ u8 const_id; - /** -* Number of faulty satellites. + * Number of faulty satellites. */ u8 n_faulty_sats; - /** -* List of faulty satellites. + * List of faulty satellites. */ u8 faulty_sats[SBP_MSG_SSR_FLAG_SATELLITES_FAULTY_SATS_MAX]; } sbp_msg_ssr_flag_satellites_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_flag_satellites_t * * @param msg sbp_msg_ssr_flag_satellites_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_flag_satellites_encoded_len(const sbp_msg_ssr_flag_satellites_t *msg) -{ - return SBP_MSG_SSR_FLAG_SATELLITES_ENCODED_OVERHEAD - + (msg->n_faulty_sats * SBP_ENCODED_LEN_U8) - ; +static inline size_t sbp_msg_ssr_flag_satellites_encoded_len( + const sbp_msg_ssr_flag_satellites_t *msg) { + return SBP_MSG_SSR_FLAG_SATELLITES_ENCODED_OVERHEAD + + (msg->n_faulty_sats * SBP_ENCODED_LEN_U8); } /** * Encode an instance of sbp_msg_ssr_flag_satellites_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_flag_satellites_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_satellites_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_satellites_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_flag_satellites_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_satellites_t *msg); /** * Decode an instance of sbp_msg_ssr_flag_satellites_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ssr_flag_satellites_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_flag_satellites_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ssr_flag_satellites_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_satellites_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_satellites_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_flag_satellites_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_satellites_t *msg); /** - * Send an instance of sbp_msg_ssr_flag_satellites_t with the given write function + * Send an instance of sbp_msg_ssr_flag_satellites_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_flag_satellites_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_flag_satellites_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -145,51 +151,62 @@ SBP_EXPORT s8 sbp_msg_ssr_flag_satellites_decode(const uint8_t *buf, uint8_t len * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_satellites_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_flag_satellites_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_flag_satellites_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_flag_satellites_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_flag_satellites_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_flag_satellites_t instance * @param b sbp_msg_ssr_flag_satellites_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_flag_satellites_cmp(const sbp_msg_ssr_flag_satellites_t *a, const sbp_msg_ssr_flag_satellites_t *b); +SBP_EXPORT int sbp_msg_ssr_flag_satellites_cmp( + const sbp_msg_ssr_flag_satellites_t *a, + const sbp_msg_ssr_flag_satellites_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_flag_satellites_t &lhs, const sbp_msg_ssr_flag_satellites_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_flag_satellites_t &lhs, + const sbp_msg_ssr_flag_satellites_t &rhs) { return sbp_msg_ssr_flag_satellites_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_flag_satellites_t &lhs, const sbp_msg_ssr_flag_satellites_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_flag_satellites_t &lhs, + const sbp_msg_ssr_flag_satellites_t &rhs) { return sbp_msg_ssr_flag_satellites_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_flag_satellites_t &lhs, const sbp_msg_ssr_flag_satellites_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_flag_satellites_t &lhs, + const sbp_msg_ssr_flag_satellites_t &rhs) { return sbp_msg_ssr_flag_satellites_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_flag_satellites_t &lhs, const sbp_msg_ssr_flag_satellites_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_flag_satellites_t &lhs, + const sbp_msg_ssr_flag_satellites_t &rhs) { return sbp_msg_ssr_flag_satellites_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_flag_satellites_t &lhs, const sbp_msg_ssr_flag_satellites_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_flag_satellites_t &lhs, + const sbp_msg_ssr_flag_satellites_t &rhs) { return sbp_msg_ssr_flag_satellites_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_flag_satellites_t &lhs, const sbp_msg_ssr_flag_satellites_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_flag_satellites_t &lhs, + const sbp_msg_ssr_flag_satellites_t &rhs) { return sbp_msg_ssr_flag_satellites_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_INTEGRITY_MSG_SSR_FLAG_SATELLITES_H */ - diff --git a/c/include/libsbp/integrity/MSG_SSR_FLAG_TROPO_GRID_POINTS.h b/c/include/libsbp/integrity/MSG_SSR_FLAG_TROPO_GRID_POINTS.h index 72ec4b001..9be23f7e9 100644 --- a/c/include/libsbp/integrity/MSG_SSR_FLAG_TROPO_GRID_POINTS.h +++ b/c/include/libsbp/integrity/MSG_SSR_FLAG_TROPO_GRID_POINTS.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_INTEGRITY_MSG_SSR_FLAG_TROPO_GRID_POINTS_H #define LIBSBP_INTEGRITY_MSG_SSR_FLAG_TROPO_GRID_POINTS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,74 +40,89 @@ * *****************************************************************************/ typedef struct { - - /** -* Header of an integrity message. + * Header of an integrity message. */ sbp_integrity_ssr_header_t header; - /** -* Number of faulty grid points. + * Number of faulty grid points. */ u8 n_faulty_points; - /** -* List of faulty grid points. + * List of faulty grid points. */ u16 faulty_points[SBP_MSG_SSR_FLAG_TROPO_GRID_POINTS_FAULTY_POINTS_MAX]; } sbp_msg_ssr_flag_tropo_grid_points_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_flag_tropo_grid_points_t * * @param msg sbp_msg_ssr_flag_tropo_grid_points_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_flag_tropo_grid_points_encoded_len(const sbp_msg_ssr_flag_tropo_grid_points_t *msg) -{ - return SBP_MSG_SSR_FLAG_TROPO_GRID_POINTS_ENCODED_OVERHEAD - + (msg->n_faulty_points * SBP_ENCODED_LEN_U16) - ; +static inline size_t sbp_msg_ssr_flag_tropo_grid_points_encoded_len( + const sbp_msg_ssr_flag_tropo_grid_points_t *msg) { + return SBP_MSG_SSR_FLAG_TROPO_GRID_POINTS_ENCODED_OVERHEAD + + (msg->n_faulty_points * SBP_ENCODED_LEN_U16); } /** - * Encode an instance of sbp_msg_ssr_flag_tropo_grid_points_t to wire representation + * Encode an instance of sbp_msg_ssr_flag_tropo_grid_points_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_flag_tropo_grid_points_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_tropo_grid_points_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_tropo_grid_points_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_flag_tropo_grid_points_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_tropo_grid_points_t *msg); /** - * Decode an instance of sbp_msg_ssr_flag_tropo_grid_points_t from wire representation + * Decode an instance of sbp_msg_ssr_flag_tropo_grid_points_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_flag_tropo_grid_points_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_flag_tropo_grid_points_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_ssr_flag_tropo_grid_points_t instance + * @param buf Wire representation of the sbp_msg_ssr_flag_tropo_grid_points_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_tropo_grid_points_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_tropo_grid_points_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_flag_tropo_grid_points_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_tropo_grid_points_t *msg); /** - * Send an instance of sbp_msg_ssr_flag_tropo_grid_points_t with the given write function + * Send an instance of sbp_msg_ssr_flag_tropo_grid_points_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_flag_tropo_grid_points_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_flag_tropo_grid_points_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -115,51 +130,62 @@ SBP_EXPORT s8 sbp_msg_ssr_flag_tropo_grid_points_decode(const uint8_t *buf, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_flag_tropo_grid_points_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_flag_tropo_grid_points_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_flag_tropo_grid_points_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_flag_tropo_grid_points_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_flag_tropo_grid_points_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_flag_tropo_grid_points_t instance * @param b sbp_msg_ssr_flag_tropo_grid_points_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_flag_tropo_grid_points_cmp(const sbp_msg_ssr_flag_tropo_grid_points_t *a, const sbp_msg_ssr_flag_tropo_grid_points_t *b); +SBP_EXPORT int sbp_msg_ssr_flag_tropo_grid_points_cmp( + const sbp_msg_ssr_flag_tropo_grid_points_t *a, + const sbp_msg_ssr_flag_tropo_grid_points_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_flag_tropo_grid_points_t &lhs, const sbp_msg_ssr_flag_tropo_grid_points_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_flag_tropo_grid_points_t &lhs, + const sbp_msg_ssr_flag_tropo_grid_points_t &rhs) { return sbp_msg_ssr_flag_tropo_grid_points_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_flag_tropo_grid_points_t &lhs, const sbp_msg_ssr_flag_tropo_grid_points_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_flag_tropo_grid_points_t &lhs, + const sbp_msg_ssr_flag_tropo_grid_points_t &rhs) { return sbp_msg_ssr_flag_tropo_grid_points_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_flag_tropo_grid_points_t &lhs, const sbp_msg_ssr_flag_tropo_grid_points_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_flag_tropo_grid_points_t &lhs, + const sbp_msg_ssr_flag_tropo_grid_points_t &rhs) { return sbp_msg_ssr_flag_tropo_grid_points_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_flag_tropo_grid_points_t &lhs, const sbp_msg_ssr_flag_tropo_grid_points_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_flag_tropo_grid_points_t &lhs, + const sbp_msg_ssr_flag_tropo_grid_points_t &rhs) { return sbp_msg_ssr_flag_tropo_grid_points_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_flag_tropo_grid_points_t &lhs, const sbp_msg_ssr_flag_tropo_grid_points_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_flag_tropo_grid_points_t &lhs, + const sbp_msg_ssr_flag_tropo_grid_points_t &rhs) { return sbp_msg_ssr_flag_tropo_grid_points_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_flag_tropo_grid_points_t &lhs, const sbp_msg_ssr_flag_tropo_grid_points_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_flag_tropo_grid_points_t &lhs, + const sbp_msg_ssr_flag_tropo_grid_points_t &rhs) { return sbp_msg_ssr_flag_tropo_grid_points_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_INTEGRITY_MSG_SSR_FLAG_TROPO_GRID_POINTS_H */ - diff --git a/c/include/libsbp/integrity_macros.h b/c/include/libsbp/integrity_macros.h index 19f6f1e8c..4f2d83d14 100644 --- a/c/include/libsbp/integrity_macros.h +++ b/c/include/libsbp/integrity_macros.h @@ -18,25 +18,26 @@ #ifndef LIBSBP_INTEGRITY_MACROS_H #define LIBSBP_INTEGRITY_MACROS_H - /** - * Encoded length of sbp_integrity_ssr_header_t (V4 API) and + * Encoded length of sbp_integrity_ssr_header_t (V4 API) and * integrity_ssr_header_t (legacy API) */ #define SBP_INTEGRITY_SSR_HEADER_ENCODED_LEN 14u - #define SBP_MSG_SSR_FLAG_HIGH_LEVEL 0x0BB9 #define SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_MASK (0x7u) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_SHIFT (0u) -#define SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_GET(flags) \ - ((u8)((u8)((flags) >> SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_SHIFT) \ - & SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_MASK)) -#define SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_MASK << SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_SHIFT))) | \ - (((val) & (SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_MASK)) \ - << (SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_SHIFT)));} while(0) - +#define SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_GET(flags) \ + ((u8)((u8)((flags) >> SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_SHIFT) & \ + SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_MASK)) +#define SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_MASK \ + << SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_SHIFT))) | \ + (((val) & (SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_MASK)) \ + << (SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_SHIFT))); \ + } while (0) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_NOMINAL (0) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_WARNING (1) @@ -44,14 +45,17 @@ #define SBP_SSR_FLAG_HIGH_LEVEL_USE_GPS_SATELLITES_NOT_MONITORED (3) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_MASK (0x7u) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_SHIFT (0u) -#define SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_GET(flags) \ - ((u8)((u8)((flags) >> SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_SHIFT) \ - & SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_MASK)) -#define SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_MASK << SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_SHIFT))) | \ - (((val) & (SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_MASK)) \ - << (SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_SHIFT)));} while(0) - +#define SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_GET(flags) \ + ((u8)((u8)((flags) >> SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_SHIFT) & \ + SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_MASK)) +#define SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_MASK \ + << SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_SHIFT))) | \ + (((val) & (SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_MASK)) \ + << (SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_SHIFT))); \ + } while (0) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_NOMINAL (0) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_WARNING (1) @@ -59,35 +63,44 @@ #define SBP_SSR_FLAG_HIGH_LEVEL_USE_GAL_SATELLITES_NOT_MONITORED (3) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_MASK (0x7u) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_SHIFT (0u) -#define SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_GET(flags) \ - ((u8)((u8)((flags) >> SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_SHIFT) \ - & SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_MASK)) -#define SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_MASK << SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_SHIFT))) | \ - (((val) & (SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_MASK)) \ - << (SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_SHIFT)));} while(0) - +#define SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_GET(flags) \ + ((u8)((u8)((flags) >> SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_SHIFT) & \ + SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_MASK)) +#define SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_MASK \ + << SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_SHIFT))) | \ + (((val) & (SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_MASK)) \ + << (SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_SHIFT))); \ + } while (0) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_NOMINAL (0) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_WARNING (1) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_ALERT (2) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_BDS_SATELLITES_NOT_MONITORED (3) /** - * The maximum number of items that can be stored in sbp_msg_ssr_flag_high_level_t::reserved (V4 API) or msg_ssr_flag_high_level_t::reserved (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_flag_high_level_t::reserved (V4 API) or + * msg_ssr_flag_high_level_t::reserved (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_SSR_FLAG_HIGH_LEVEL_RESERVED_MAX 6u - #define SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_MASK (0x7u) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_SHIFT (0u) -#define SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_SHIFT) \ - & SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_MASK)) -#define SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_MASK << SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_SHIFT))) | \ - (((val) & (SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_MASK)) \ - << (SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_SHIFT)));} while(0) - +#define SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_SHIFT) & \ + SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_MASK)) +#define SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & \ + (~(SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_MASK \ + << SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_SHIFT))) | \ + (((val) & (SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_MASK)) \ + << (SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_SHIFT))); \ + } while (0) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_NOMINAL (0) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_WARNING (1) @@ -95,14 +108,17 @@ #define SBP_SSR_FLAG_HIGH_LEVEL_USE_TROPO_GRID_POINTS_NOT_MONITORED (3) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_MASK (0x7u) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_SHIFT (0u) -#define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_SHIFT) \ - & SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_MASK)) -#define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_MASK << SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_SHIFT))) | \ - (((val) & (SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_MASK)) \ - << (SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_SHIFT)));} while(0) - +#define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_SHIFT) & \ + SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_MASK)) +#define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_MASK \ + << SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_SHIFT))) | \ + (((val) & (SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_MASK)) \ + << (SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_SHIFT))); \ + } while (0) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_NOMINAL (0) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_WARNING (1) @@ -110,14 +126,19 @@ #define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINTS_NOT_MONITORED (3) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_MASK (0x7u) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_SHIFT (0u) -#define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_SHIFT) \ - & SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_MASK)) -#define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_MASK << SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_SHIFT))) | \ - (((val) & (SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_MASK)) \ - << (SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_SHIFT)));} while(0) - +#define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_GET(flags) \ + ((u8)((u8)((flags) >> \ + SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_SHIFT) & \ + SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_MASK)) +#define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_MASK \ + << SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_SHIFT))) | \ + (((val) & (SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_MASK)) \ + << (SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_SHIFT))); \ + } while (0) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_NOMINAL (0) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_WARNING (1) @@ -125,152 +146,167 @@ #define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_TILE_SATELLITE_LOS_NOT_MONITORED (3) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_MASK (0x7u) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_SHIFT (0u) -#define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_SHIFT) \ - & SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_MASK)) -#define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_MASK << SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_SHIFT))) | \ - (((val) & (SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_MASK)) \ - << (SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_SHIFT)));} while(0) - +#define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_GET(flags) \ + ((u8)( \ + (u8)((flags) >> \ + SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_SHIFT) & \ + SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_MASK)) +#define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_SET(flags, \ + val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_MASK \ + << SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_SHIFT))) | \ + (((val) & \ + (SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_MASK)) \ + << (SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_SHIFT))); \ + } while (0) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_NOMINAL (0) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_WARNING (1) #define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_ALERT (2) -#define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_NOT_MONITORED (3) +#define SBP_SSR_FLAG_HIGH_LEVEL_USE_IONO_GRID_POINT_SATELLITE_LOS_NOT_MONITORED \ + (3) /** - * Encoded length of sbp_msg_ssr_flag_high_level_t (V4 API) and + * Encoded length of sbp_msg_ssr_flag_high_level_t (V4 API) and * msg_ssr_flag_high_level_t (legacy API) */ #define SBP_MSG_SSR_FLAG_HIGH_LEVEL_ENCODED_LEN 31u - #define SBP_MSG_SSR_FLAG_SATELLITES 0x0BBD /** - * The maximum number of items that can be stored in sbp_msg_ssr_flag_satellites_t::faulty_sats (V4 API) or msg_ssr_flag_satellites_t::faulty_sats (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_flag_satellites_t::faulty_sats (V4 API) or + * msg_ssr_flag_satellites_t::faulty_sats (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_SSR_FLAG_SATELLITES_FAULTY_SATS_MAX 243u - /** - * Encoded length of sbp_msg_ssr_flag_satellites_t (V4 API) and + * Encoded length of sbp_msg_ssr_flag_satellites_t (V4 API) and * msg_ssr_flag_satellites_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_flag_satellites_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_flag_satellites_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_FLAG_SATELLITES_ENCODED_OVERHEAD 12u - #define SBP_MSG_SSR_FLAG_TROPO_GRID_POINTS 0x0BC3 /** - * The maximum number of items that can be stored in sbp_msg_ssr_flag_tropo_grid_points_t::faulty_points (V4 API) or msg_ssr_flag_tropo_grid_points_t::faulty_points (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_flag_tropo_grid_points_t::faulty_points (V4 API) or + * msg_ssr_flag_tropo_grid_points_t::faulty_points (legacy API) before the + * maximum SBP message size is exceeded */ #define SBP_MSG_SSR_FLAG_TROPO_GRID_POINTS_FAULTY_POINTS_MAX 120u - /** - * Encoded length of sbp_msg_ssr_flag_tropo_grid_points_t (V4 API) and + * Encoded length of sbp_msg_ssr_flag_tropo_grid_points_t (V4 API) and * msg_ssr_flag_tropo_grid_points_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_flag_tropo_grid_points_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_flag_tropo_grid_points_encoded_len to determine the actual size + * of an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_FLAG_TROPO_GRID_POINTS_ENCODED_OVERHEAD 15u - #define SBP_MSG_SSR_FLAG_IONO_GRID_POINTS 0x0BC7 /** - * The maximum number of items that can be stored in sbp_msg_ssr_flag_iono_grid_points_t::faulty_points (V4 API) or msg_ssr_flag_iono_grid_points_t::faulty_points (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_flag_iono_grid_points_t::faulty_points (V4 API) or + * msg_ssr_flag_iono_grid_points_t::faulty_points (legacy API) before the + * maximum SBP message size is exceeded */ #define SBP_MSG_SSR_FLAG_IONO_GRID_POINTS_FAULTY_POINTS_MAX 120u - /** - * Encoded length of sbp_msg_ssr_flag_iono_grid_points_t (V4 API) and + * Encoded length of sbp_msg_ssr_flag_iono_grid_points_t (V4 API) and * msg_ssr_flag_iono_grid_points_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_flag_iono_grid_points_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_flag_iono_grid_points_encoded_len to determine the actual size + * of an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_FLAG_IONO_GRID_POINTS_ENCODED_OVERHEAD 15u - #define SBP_MSG_SSR_FLAG_IONO_TILE_SAT_LOS 0x0BCD /** - * The maximum number of items that can be stored in sbp_msg_ssr_flag_iono_tile_sat_los_t::faulty_los (V4 API) or msg_ssr_flag_iono_tile_sat_los_t::faulty_los (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_flag_iono_tile_sat_los_t::faulty_los (V4 API) or + * msg_ssr_flag_iono_tile_sat_los_t::faulty_los (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_SSR_FLAG_IONO_TILE_SAT_LOS_FAULTY_LOS_MAX 120u - /** - * Encoded length of sbp_msg_ssr_flag_iono_tile_sat_los_t (V4 API) and + * Encoded length of sbp_msg_ssr_flag_iono_tile_sat_los_t (V4 API) and * msg_ssr_flag_iono_tile_sat_los_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_flag_iono_tile_sat_los_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_flag_iono_tile_sat_los_encoded_len to determine the actual size + * of an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_FLAG_IONO_TILE_SAT_LOS_ENCODED_OVERHEAD 15u - #define SBP_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS 0x0BD1 /** - * The maximum number of items that can be stored in sbp_msg_ssr_flag_iono_grid_point_sat_los_t::faulty_los (V4 API) or msg_ssr_flag_iono_grid_point_sat_los_t::faulty_los (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_flag_iono_grid_point_sat_los_t::faulty_los (V4 API) or + * msg_ssr_flag_iono_grid_point_sat_los_t::faulty_los (legacy API) before the + * maximum SBP message size is exceeded */ #define SBP_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS_FAULTY_LOS_MAX 119u - /** - * Encoded length of sbp_msg_ssr_flag_iono_grid_point_sat_los_t (V4 API) and + * Encoded length of sbp_msg_ssr_flag_iono_grid_point_sat_los_t (V4 API) and * msg_ssr_flag_iono_grid_point_sat_los_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_flag_iono_grid_point_sat_los_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_flag_iono_grid_point_sat_los_encoded_len to determine the actual + * size of an instance of this message. Users of the legacy API are required to + * track the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS_ENCODED_OVERHEAD 17u - #define SBP_MSG_ACKNOWLEDGE 0x0BD2 #define SBP_ACKNOWLEDGE_RESPONSE_CODE_MASK (0xffu) #define SBP_ACKNOWLEDGE_RESPONSE_CODE_SHIFT (0u) -#define SBP_ACKNOWLEDGE_RESPONSE_CODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_ACKNOWLEDGE_RESPONSE_CODE_SHIFT) \ - & SBP_ACKNOWLEDGE_RESPONSE_CODE_MASK)) -#define SBP_ACKNOWLEDGE_RESPONSE_CODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_ACKNOWLEDGE_RESPONSE_CODE_MASK << SBP_ACKNOWLEDGE_RESPONSE_CODE_SHIFT))) | \ - (((val) & (SBP_ACKNOWLEDGE_RESPONSE_CODE_MASK)) \ - << (SBP_ACKNOWLEDGE_RESPONSE_CODE_SHIFT)));} while(0) - +#define SBP_ACKNOWLEDGE_RESPONSE_CODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ACKNOWLEDGE_RESPONSE_CODE_SHIFT) & \ + SBP_ACKNOWLEDGE_RESPONSE_CODE_MASK)) +#define SBP_ACKNOWLEDGE_RESPONSE_CODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_ACKNOWLEDGE_RESPONSE_CODE_MASK \ + << SBP_ACKNOWLEDGE_RESPONSE_CODE_SHIFT))) | \ + (((val) & (SBP_ACKNOWLEDGE_RESPONSE_CODE_MASK)) \ + << (SBP_ACKNOWLEDGE_RESPONSE_CODE_SHIFT))); \ + } while (0) #define SBP_ACKNOWLEDGE_RESPONSE_CODE_OK (0) #define SBP_ACKNOWLEDGE_RESPONSE_CODE_OUT_OF_COVERAGE (1) @@ -279,153 +315,179 @@ #define SBP_ACKNOWLEDGE_RESPONSE_CODE_INVALID_AREA_ID (4) #define SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_MASK (0x1u) #define SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_SHIFT (0u) -#define SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_GET(flags) \ - ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_SHIFT) \ - & SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_MASK)) -#define SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_MASK << SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_SHIFT))) | \ - (((val) & (SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_MASK)) \ - << (SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_SHIFT)));} while(0) - +#define SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_GET(flags) \ + ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_SHIFT) & \ + SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_MASK)) +#define SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_SET(flags, val) \ + do { \ + (flags) = (u16)( \ + (flags & (~(SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_MASK \ + << SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_SHIFT))) | \ + (((val) & (SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_MASK)) \ + << (SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_SHIFT))); \ + } while (0) #define SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_NOT_REQUESTED (0) #define SBP_ACKNOWLEDGE_CORRECTIONS_CERTIFICATE_REQUESTED (1) #define SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_MASK (0x1u) #define SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_SHIFT (1u) -#define SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_GET(flags) \ - ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_SHIFT) \ - & SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_MASK)) -#define SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_MASK << SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_SHIFT))) | \ - (((val) & (SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_MASK)) \ - << (SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_SHIFT)));} while(0) - +#define SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_GET(flags) \ + ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_SHIFT) & \ + SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_MASK)) +#define SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_SET(flags, val) \ + do { \ + (flags) = \ + (u16)((flags & (~(SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_MASK \ + << SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_SHIFT))) | \ + (((val) & (SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_MASK)) \ + << (SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_SHIFT))); \ + } while (0) #define SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_NOT_REQUESTED (0) #define SBP_ACKNOWLEDGE_LOW_RATE_MESSAGES_REQUESTED (1) #define SBP_ACKNOWLEDGE_EPHEMERIS_MASK (0x1u) #define SBP_ACKNOWLEDGE_EPHEMERIS_SHIFT (2u) -#define SBP_ACKNOWLEDGE_EPHEMERIS_GET(flags) \ - ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_EPHEMERIS_SHIFT) \ - & SBP_ACKNOWLEDGE_EPHEMERIS_MASK)) -#define SBP_ACKNOWLEDGE_EPHEMERIS_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_EPHEMERIS_MASK << SBP_ACKNOWLEDGE_EPHEMERIS_SHIFT))) | \ - (((val) & (SBP_ACKNOWLEDGE_EPHEMERIS_MASK)) \ - << (SBP_ACKNOWLEDGE_EPHEMERIS_SHIFT)));} while(0) - +#define SBP_ACKNOWLEDGE_EPHEMERIS_GET(flags) \ + ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_EPHEMERIS_SHIFT) & \ + SBP_ACKNOWLEDGE_EPHEMERIS_MASK)) +#define SBP_ACKNOWLEDGE_EPHEMERIS_SET(flags, val) \ + do { \ + (flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_EPHEMERIS_MASK \ + << SBP_ACKNOWLEDGE_EPHEMERIS_SHIFT))) | \ + (((val) & (SBP_ACKNOWLEDGE_EPHEMERIS_MASK)) \ + << (SBP_ACKNOWLEDGE_EPHEMERIS_SHIFT))); \ + } while (0) #define SBP_ACKNOWLEDGE_EPHEMERIS_NOT_REQUESTED (0) #define SBP_ACKNOWLEDGE_EPHEMERIS_REQUESTED (1) #define SBP_ACKNOWLEDGE_SATELLITE_CLOCK_MASK (0x1u) #define SBP_ACKNOWLEDGE_SATELLITE_CLOCK_SHIFT (3u) -#define SBP_ACKNOWLEDGE_SATELLITE_CLOCK_GET(flags) \ - ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_SATELLITE_CLOCK_SHIFT) \ - & SBP_ACKNOWLEDGE_SATELLITE_CLOCK_MASK)) -#define SBP_ACKNOWLEDGE_SATELLITE_CLOCK_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_SATELLITE_CLOCK_MASK << SBP_ACKNOWLEDGE_SATELLITE_CLOCK_SHIFT))) | \ - (((val) & (SBP_ACKNOWLEDGE_SATELLITE_CLOCK_MASK)) \ - << (SBP_ACKNOWLEDGE_SATELLITE_CLOCK_SHIFT)));} while(0) - +#define SBP_ACKNOWLEDGE_SATELLITE_CLOCK_GET(flags) \ + ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_SATELLITE_CLOCK_SHIFT) & \ + SBP_ACKNOWLEDGE_SATELLITE_CLOCK_MASK)) +#define SBP_ACKNOWLEDGE_SATELLITE_CLOCK_SET(flags, val) \ + do { \ + (flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_SATELLITE_CLOCK_MASK \ + << SBP_ACKNOWLEDGE_SATELLITE_CLOCK_SHIFT))) | \ + (((val) & (SBP_ACKNOWLEDGE_SATELLITE_CLOCK_MASK)) \ + << (SBP_ACKNOWLEDGE_SATELLITE_CLOCK_SHIFT))); \ + } while (0) #define SBP_ACKNOWLEDGE_SATELLITE_CLOCK_NOT_REQUESTED (0) #define SBP_ACKNOWLEDGE_SATELLITE_CLOCK_REQUESTED (1) #define SBP_ACKNOWLEDGE_SATELLITE_ORBIT_MASK (0x1u) #define SBP_ACKNOWLEDGE_SATELLITE_ORBIT_SHIFT (4u) -#define SBP_ACKNOWLEDGE_SATELLITE_ORBIT_GET(flags) \ - ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_SATELLITE_ORBIT_SHIFT) \ - & SBP_ACKNOWLEDGE_SATELLITE_ORBIT_MASK)) -#define SBP_ACKNOWLEDGE_SATELLITE_ORBIT_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_SATELLITE_ORBIT_MASK << SBP_ACKNOWLEDGE_SATELLITE_ORBIT_SHIFT))) | \ - (((val) & (SBP_ACKNOWLEDGE_SATELLITE_ORBIT_MASK)) \ - << (SBP_ACKNOWLEDGE_SATELLITE_ORBIT_SHIFT)));} while(0) - +#define SBP_ACKNOWLEDGE_SATELLITE_ORBIT_GET(flags) \ + ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_SATELLITE_ORBIT_SHIFT) & \ + SBP_ACKNOWLEDGE_SATELLITE_ORBIT_MASK)) +#define SBP_ACKNOWLEDGE_SATELLITE_ORBIT_SET(flags, val) \ + do { \ + (flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_SATELLITE_ORBIT_MASK \ + << SBP_ACKNOWLEDGE_SATELLITE_ORBIT_SHIFT))) | \ + (((val) & (SBP_ACKNOWLEDGE_SATELLITE_ORBIT_MASK)) \ + << (SBP_ACKNOWLEDGE_SATELLITE_ORBIT_SHIFT))); \ + } while (0) #define SBP_ACKNOWLEDGE_SATELLITE_ORBIT_NOT_REQUESTED (0) #define SBP_ACKNOWLEDGE_SATELLITE_ORBIT_REQUESTED (1) #define SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_MASK (0x1u) #define SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_SHIFT (5u) -#define SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_GET(flags) \ - ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_SHIFT) \ - & SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_MASK)) -#define SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_MASK << SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_SHIFT))) | \ - (((val) & (SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_MASK)) \ - << (SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_SHIFT)));} while(0) - +#define SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_GET(flags) \ + ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_SHIFT) & \ + SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_MASK)) +#define SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_SET(flags, val) \ + do { \ + (flags) = \ + (u16)((flags & (~(SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_MASK \ + << SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_SHIFT))) | \ + (((val) & (SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_MASK)) \ + << (SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_SHIFT))); \ + } while (0) #define SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_NOT_REQUESTED (0) #define SBP_ACKNOWLEDGE_SATELLITE_CODE_BIAS_REQUESTED (1) #define SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_MASK (0x1u) #define SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_SHIFT (6u) -#define SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_GET(flags) \ - ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_SHIFT) \ - & SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_MASK)) -#define SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_MASK << SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_SHIFT))) | \ - (((val) & (SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_MASK)) \ - << (SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_SHIFT)));} while(0) - +#define SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_GET(flags) \ + ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_SHIFT) & \ + SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_MASK)) +#define SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_SET(flags, val) \ + do { \ + (flags) = \ + (u16)((flags & (~(SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_MASK \ + << SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_SHIFT))) | \ + (((val) & (SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_MASK)) \ + << (SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_SHIFT))); \ + } while (0) #define SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_NOT_REQUESTED (0) #define SBP_ACKNOWLEDGE_SATELLITE_PHASE_BIAS_REQUESTED (1) #define SBP_ACKNOWLEDGE_ATMOSPHERICS_MASK (0x1u) #define SBP_ACKNOWLEDGE_ATMOSPHERICS_SHIFT (7u) -#define SBP_ACKNOWLEDGE_ATMOSPHERICS_GET(flags) \ - ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_ATMOSPHERICS_SHIFT) \ - & SBP_ACKNOWLEDGE_ATMOSPHERICS_MASK)) -#define SBP_ACKNOWLEDGE_ATMOSPHERICS_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_ATMOSPHERICS_MASK << SBP_ACKNOWLEDGE_ATMOSPHERICS_SHIFT))) | \ - (((val) & (SBP_ACKNOWLEDGE_ATMOSPHERICS_MASK)) \ - << (SBP_ACKNOWLEDGE_ATMOSPHERICS_SHIFT)));} while(0) - +#define SBP_ACKNOWLEDGE_ATMOSPHERICS_GET(flags) \ + ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_ATMOSPHERICS_SHIFT) & \ + SBP_ACKNOWLEDGE_ATMOSPHERICS_MASK)) +#define SBP_ACKNOWLEDGE_ATMOSPHERICS_SET(flags, val) \ + do { \ + (flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_ATMOSPHERICS_MASK \ + << SBP_ACKNOWLEDGE_ATMOSPHERICS_SHIFT))) | \ + (((val) & (SBP_ACKNOWLEDGE_ATMOSPHERICS_MASK)) \ + << (SBP_ACKNOWLEDGE_ATMOSPHERICS_SHIFT))); \ + } while (0) #define SBP_ACKNOWLEDGE_ATMOSPHERICS_NOT_REQUESTED (0) #define SBP_ACKNOWLEDGE_ATMOSPHERICS_REQUESTED (1) #define SBP_ACKNOWLEDGE_INTEGRITY_MASK (0x1u) #define SBP_ACKNOWLEDGE_INTEGRITY_SHIFT (8u) -#define SBP_ACKNOWLEDGE_INTEGRITY_GET(flags) \ - ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_INTEGRITY_SHIFT) \ - & SBP_ACKNOWLEDGE_INTEGRITY_MASK)) -#define SBP_ACKNOWLEDGE_INTEGRITY_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_INTEGRITY_MASK << SBP_ACKNOWLEDGE_INTEGRITY_SHIFT))) | \ - (((val) & (SBP_ACKNOWLEDGE_INTEGRITY_MASK)) \ - << (SBP_ACKNOWLEDGE_INTEGRITY_SHIFT)));} while(0) - +#define SBP_ACKNOWLEDGE_INTEGRITY_GET(flags) \ + ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_INTEGRITY_SHIFT) & \ + SBP_ACKNOWLEDGE_INTEGRITY_MASK)) +#define SBP_ACKNOWLEDGE_INTEGRITY_SET(flags, val) \ + do { \ + (flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_INTEGRITY_MASK \ + << SBP_ACKNOWLEDGE_INTEGRITY_SHIFT))) | \ + (((val) & (SBP_ACKNOWLEDGE_INTEGRITY_MASK)) \ + << (SBP_ACKNOWLEDGE_INTEGRITY_SHIFT))); \ + } while (0) #define SBP_ACKNOWLEDGE_INTEGRITY_NOT_REQUESTED (0) #define SBP_ACKNOWLEDGE_INTEGRITY_REQUESTED (1) #define SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_MASK (0x1u) #define SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_SHIFT (9u) -#define SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_GET(flags) \ - ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_SHIFT) \ - & SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_MASK)) -#define SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_MASK << SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_SHIFT))) | \ - (((val) & (SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_MASK)) \ - << (SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_SHIFT)));} while(0) - +#define SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_GET(flags) \ + ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_SHIFT) & \ + SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_MASK)) +#define SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_SET(flags, val) \ + do { \ + (flags) = (u16)( \ + (flags & (~(SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_MASK \ + << SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_SHIFT))) | \ + (((val) & (SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_MASK)) \ + << (SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_SHIFT))); \ + } while (0) #define SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_NOT_REQUESTED (0) #define SBP_ACKNOWLEDGE_INTERMEDIATE_CERTIFICATE_REQUESTED (1) #define SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_MASK (0x1u) #define SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_SHIFT (10u) -#define SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_GET(flags) \ - ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_SHIFT) \ - & SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_MASK)) -#define SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_MASK << SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_SHIFT))) | \ - (((val) & (SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_MASK)) \ - << (SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_SHIFT)));} while(0) - +#define SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_GET(flags) \ + ((u16)((u16)((flags) >> SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_SHIFT) & \ + SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_MASK)) +#define SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_SET(flags, val) \ + do { \ + (flags) = \ + (u16)((flags & (~(SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_MASK \ + << SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_SHIFT))) | \ + (((val) & (SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_MASK)) \ + << (SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_SHIFT))); \ + } while (0) #define SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_NOT_REQUESTED (0) #define SBP_ACKNOWLEDGE_CERTIFICATE_CHAIN_REQUESTED (1) /** - * Encoded length of sbp_msg_acknowledge_t (V4 API) and + * Encoded length of sbp_msg_acknowledge_t (V4 API) and * msg_acknowledge_t (legacy API) */ #define SBP_MSG_ACKNOWLEDGE_ENCODED_LEN 11u - - #endif /* LIBSBP_INTEGRITY_MACROS_H */ diff --git a/c/include/libsbp/legacy/acquisition.h b/c/include/libsbp/legacy/acquisition.h index fe6b924cf..681e5f04b 100644 --- a/c/include/libsbp/legacy/acquisition.h +++ b/c/include/libsbp/legacy/acquisition.h @@ -28,14 +28,14 @@ #include #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Satellite acquisition result * * This message describes the results from an attempted GPS signal acquisition @@ -45,59 +45,55 @@ SBP_PACK_START */ typedef struct SBP_ATTR_PACKED { - float cn0; /**< CN/0 of best point [dB Hz] */ - float cp; /**< Code phase of best point [chips] */ - float cf; /**< Carrier frequency of best point [hz] */ - sbp_gnss_signal_t sid; /**< GNSS signal for which acquisition was - attempted */ + float cn0; /**< CN/0 of best point [dB Hz] */ + float cp; /**< Code phase of best point [chips] */ + float cf; /**< Carrier frequency of best point [hz] */ + sbp_gnss_signal_t sid; /**< GNSS signal for which acquisition was + attempted */ } msg_acq_result_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - float cn0; /**< CN/0 of best point [dB Hz] */ - float cp; /**< Code phase of best point [chips] */ - float cf; /**< Carrier frequency of best point [hz] */ - gnss_signal_dep_t sid; /**< GNSS signal for which acquisition was - attempted */ + float cn0; /**< CN/0 of best point [dB Hz] */ + float cp; /**< Code phase of best point [chips] */ + float cf; /**< Carrier frequency of best point [hz] */ + gnss_signal_dep_t sid; /**< GNSS signal for which acquisition was + attempted */ } msg_acq_result_dep_c_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - float snr; /**< SNR of best point. Currently in arbitrary SNR points, but - will be in units of dB Hz in a later revision of this - message. */ - float cp; /**< Code phase of best point [chips] */ - float cf; /**< Carrier frequency of best point [hz] */ - gnss_signal_dep_t sid; /**< GNSS signal for which acquisition was - attempted */ + float snr; /**< SNR of best point. Currently in arbitrary SNR points, but + will be in units of dB Hz in a later revision of this + message. */ + float cp; /**< Code phase of best point [chips] */ + float cf; /**< Carrier frequency of best point [hz] */ + gnss_signal_dep_t sid; /**< GNSS signal for which acquisition was + attempted */ } msg_acq_result_dep_b_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - float snr; /**< SNR of best point. Currently dimensionless, but will have - units of dB Hz in the revision of this message. */ - float cp; /**< Code phase of best point [chips] */ - float cf; /**< Carrier frequency of best point [hz] */ + float snr; /**< SNR of best point. Currently dimensionless, but will have + units of dB Hz in the revision of this message. */ + float cp; /**< Code phase of best point [chips] */ + float cf; /**< Carrier frequency of best point [hz] */ u8 prn; /**< PRN-1 identifier of the satellite signal for which acquisition was attempted */ } msg_acq_result_dep_a_t; - /** Acq perfomance measurement and debug * * Profile for a specific SV for debugging purposes. The message describes SV @@ -106,48 +102,46 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 job_type; /**< SV search job type (deep, fallback, etc) */ - u8 status; /**< Acquisition status 1 is Success, 0 is Failure */ - u16 cn0; /**< CN0 value. Only valid if status is '1' [dB-Hz*10] */ - u8 int_time; /**< Acquisition integration time [ms] */ - sbp_gnss_signal_t sid; /**< GNSS signal for which acquisition was - attempted */ - u16 bin_width; /**< Acq frequency bin width [Hz] */ - u32 timestamp; /**< Timestamp of the job complete event [ms] */ - u32 time_spent; /**< Time spent to search for sid.code [us] */ - s32 cf_min; /**< Doppler range lowest frequency [Hz] */ - s32 cf_max; /**< Doppler range highest frequency [Hz] */ - s32 cf; /**< Doppler value of detected peak. Only valid if status - is '1' [Hz] */ - u32 cp; /**< Codephase of detected peak. Only valid if status is - '1' [chips*10] */ + u8 job_type; /**< SV search job type (deep, fallback, etc) */ + u8 status; /**< Acquisition status 1 is Success, 0 is Failure */ + u16 cn0; /**< CN0 value. Only valid if status is '1' [dB-Hz*10] */ + u8 int_time; /**< Acquisition integration time [ms] */ + sbp_gnss_signal_t sid; /**< GNSS signal for which acquisition was + attempted */ + u16 bin_width; /**< Acq frequency bin width [Hz] */ + u32 timestamp; /**< Timestamp of the job complete event [ms] */ + u32 time_spent; /**< Time spent to search for sid.code [us] */ + s32 cf_min; /**< Doppler range lowest frequency [Hz] */ + s32 cf_max; /**< Doppler range highest frequency [Hz] */ + s32 cf; /**< Doppler value of detected peak. Only valid if status + is '1' [Hz] */ + u32 cp; /**< Codephase of detected peak. Only valid if status is + '1' [chips*10] */ } acq_sv_profile_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u8 job_type; /**< SV search job type (deep, fallback, etc) */ - u8 status; /**< Acquisition status 1 is Success, 0 is Failure */ - u16 cn0; /**< CN0 value. Only valid if status is '1' [dB-Hz*10] */ - u8 int_time; /**< Acquisition integration time [ms] */ - gnss_signal_dep_t sid; /**< GNSS signal for which acquisition was - attempted */ - u16 bin_width; /**< Acq frequency bin width [Hz] */ - u32 timestamp; /**< Timestamp of the job complete event [ms] */ - u32 time_spent; /**< Time spent to search for sid.code [us] */ - s32 cf_min; /**< Doppler range lowest frequency [Hz] */ - s32 cf_max; /**< Doppler range highest frequency [Hz] */ - s32 cf; /**< Doppler value of detected peak. Only valid if status - is '1' [Hz] */ - u32 cp; /**< Codephase of detected peak. Only valid if status is - '1' [chips*10] */ + u8 job_type; /**< SV search job type (deep, fallback, etc) */ + u8 status; /**< Acquisition status 1 is Success, 0 is Failure */ + u16 cn0; /**< CN0 value. Only valid if status is '1' [dB-Hz*10] */ + u8 int_time; /**< Acquisition integration time [ms] */ + gnss_signal_dep_t sid; /**< GNSS signal for which acquisition was + attempted */ + u16 bin_width; /**< Acq frequency bin width [Hz] */ + u32 timestamp; /**< Timestamp of the job complete event [ms] */ + u32 time_spent; /**< Time spent to search for sid.code [us] */ + s32 cf_min; /**< Doppler range lowest frequency [Hz] */ + s32 cf_max; /**< Doppler range highest frequency [Hz] */ + s32 cf; /**< Doppler value of detected peak. Only valid if status + is '1' [Hz] */ + u32 cp; /**< Codephase of detected peak. Only valid if status is + '1' [chips*10] */ } acq_sv_profile_dep_t; - /** Acquisition perfomance measurement and debug * * The message describes all SV profiles during acquisition time. The message @@ -155,10 +149,10 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - acq_sv_profile_t acq_sv_profile[0]; /**< SV profiles during acquisition time */ + acq_sv_profile_t + acq_sv_profile[0]; /**< SV profiles during acquisition time */ } msg_acq_sv_profile_t; - /** Deprecated * * Deprecated. @@ -169,7 +163,6 @@ typedef struct SBP_ATTR_PACKED { time */ } msg_acq_sv_profile_dep_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/bootload.h b/c/include/libsbp/legacy/bootload.h index 94fcc6935..0ff0eec90 100644 --- a/c/include/libsbp/legacy/bootload.h +++ b/c/include/libsbp/legacy/bootload.h @@ -31,14 +31,14 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Bootloading handshake request (host => device) * * The handshake message request from the host establishes a handshake between @@ -46,7 +46,6 @@ SBP_PACK_START * MSG_BOOTLOADER_HANDSHAKE_RESP. */ - /** Bootloading handshake response (host <= device) * * The handshake message response from the device establishes a handshake @@ -56,21 +55,19 @@ SBP_PACK_START */ typedef struct SBP_ATTR_PACKED { - u32 flags; /**< Bootloader flags */ + u32 flags; /**< Bootloader flags */ char version[0]; /**< Bootloader version number */ } msg_bootloader_handshake_resp_t; - /** Bootloader jump to application (host => device) * * The host initiates the bootloader to jump to the application. */ typedef struct SBP_ATTR_PACKED { - u8 jump; /**< Ignored by the device */ + u8 jump; /**< Ignored by the device */ } msg_bootloader_jump_to_app_t; - /** Read FPGA device ID over UART request (host => device) * * The device message from the host reads a unique device identifier from the @@ -81,7 +78,6 @@ typedef struct SBP_ATTR_PACKED { * number. */ - /** Read FPGA device ID over UART response (host <= device) * * The device message from the host reads a unique device identifier from the @@ -97,7 +93,6 @@ typedef struct SBP_ATTR_PACKED { the right. */ } msg_nap_device_dna_resp_t; - /** Deprecated * * Deprecated. @@ -107,7 +102,6 @@ typedef struct SBP_ATTR_PACKED { u8 handshake[0]; /**< Version number string (not NULL terminated) */ } msg_bootloader_handshake_dep_a_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/ext_events.h b/c/include/libsbp/legacy/ext_events.h index 27e17acf2..9c639f1db 100644 --- a/c/include/libsbp/legacy/ext_events.h +++ b/c/include/libsbp/legacy/ext_events.h @@ -28,14 +28,14 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Reports timestamped external pin event * * Reports detection of an external event, the GPS time it occurred, which pin @@ -43,15 +43,14 @@ SBP_PACK_START */ typedef struct SBP_ATTR_PACKED { - u16 wn; /**< GPS week number [weeks] */ - u32 tow; /**< GPS time of week rounded to the nearest millisecond [ms] */ - s32 ns_residual; /**< Nanosecond residual of millisecond-rounded TOW - (ranges from -500000 to 500000) [ns] */ - u8 flags; /**< Flags */ - u8 pin; /**< Pin number. 0..9 = DEBUG0..9. */ + u16 wn; /**< GPS week number [weeks] */ + u32 tow; /**< GPS time of week rounded to the nearest millisecond [ms] */ + s32 ns_residual; /**< Nanosecond residual of millisecond-rounded TOW + (ranges from -500000 to 500000) [ns] */ + u8 flags; /**< Flags */ + u8 pin; /**< Pin number. 0..9 = DEBUG0..9. */ } msg_ext_event_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/file_io.h b/c/include/libsbp/legacy/file_io.h index a81718ae9..db43b8d27 100644 --- a/c/include/libsbp/legacy/file_io.h +++ b/c/include/libsbp/legacy/file_io.h @@ -34,14 +34,14 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Read file from the file system (host => device) * * The file read message reads a certain length (up to 255 bytes) from a given @@ -54,13 +54,12 @@ SBP_PACK_START */ typedef struct SBP_ATTR_PACKED { - u32 sequence; /**< Read sequence number */ - u32 offset; /**< File offset [bytes] */ + u32 sequence; /**< Read sequence number */ + u32 offset; /**< File offset [bytes] */ u8 chunk_size; /**< Chunk size to read [bytes] */ - char filename[0]; /**< Name of the file to read from */ + char filename[0]; /**< Name of the file to read from */ } msg_fileio_read_req_t; - /** File read from the file system (host <= device) * * The file read message reads a certain length (up to 255 bytes) from a given @@ -70,11 +69,10 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 sequence; /**< Read sequence number */ + u32 sequence; /**< Read sequence number */ u8 contents[0]; /**< Contents of read file */ } msg_fileio_read_resp_t; - /** List files in a directory (host => device) * * The read directory message lists the files in a directory on the device's @@ -92,10 +90,9 @@ typedef struct SBP_ATTR_PACKED { u32 sequence; /**< Read sequence number */ u32 offset; /**< The offset to skip the first n elements of the file list */ - char dirname[0]; /**< Name of the directory to list */ + char dirname[0]; /**< Name of the directory to list */ } msg_fileio_read_dir_req_t; - /** Files listed in a directory (host <= device) * * The read directory message lists the files in a directory on the device's @@ -106,11 +103,10 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 sequence; /**< Read sequence number */ + u32 sequence; /**< Read sequence number */ char contents[0]; /**< Contents of read directory */ } msg_fileio_read_dir_resp_t; - /** Delete a file from the file system (host => device) * * The file remove message deletes a file from the file system. If the message @@ -123,7 +119,6 @@ typedef struct SBP_ATTR_PACKED { char filename[0]; /**< Name of the file to delete */ } msg_fileio_remove_t; - /** Write to file (host => device) * * The file write message writes a certain length (up to 255 bytes) of data to @@ -136,14 +131,13 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 sequence; /**< Write sequence number */ - u32 offset; /**< Offset into the file at which to start writing in - bytes [bytes] */ + u32 sequence; /**< Write sequence number */ + u32 offset; /**< Offset into the file at which to start writing in + bytes [bytes] */ char filename[0]; /**< Name of the file to write to */ - u8 data[0]; /**< Variable-length array of data to write */ + u8 data[0]; /**< Variable-length array of data to write */ } msg_fileio_write_req_t; - /** File written to (host <= device) * * The file write message writes a certain length (up to 255 bytes) of data to @@ -153,10 +147,9 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 sequence; /**< Write sequence number */ + u32 sequence; /**< Write sequence number */ } msg_fileio_write_resp_t; - /** Request advice on the optimal configuration for FileIO * * Requests advice on the optimal configuration for a FileIO transfer. Newer @@ -166,10 +159,9 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 sequence; /**< Advice sequence number */ + u32 sequence; /**< Advice sequence number */ } msg_fileio_config_req_t; - /** Response with advice on the optimal configuration for FileIO. * @@ -180,14 +172,13 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 sequence; /**< Advice sequence number */ - u32 window_size; /**< The number of SBP packets in the data in-flight - window */ - u32 batch_size; /**< The number of SBP packets sent in one PDU */ - u32 fileio_version; /**< The version of FileIO that is supported */ + u32 sequence; /**< Advice sequence number */ + u32 window_size; /**< The number of SBP packets in the data in-flight + window */ + u32 batch_size; /**< The number of SBP packets sent in one PDU */ + u32 fileio_version; /**< The version of FileIO that is supported */ } msg_fileio_config_resp_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/flash.h b/c/include/libsbp/legacy/flash.h index 90ab4f346..3edcff208 100644 --- a/c/include/libsbp/legacy/flash.h +++ b/c/include/libsbp/legacy/flash.h @@ -30,14 +30,14 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Program flash addresses * * The flash program message programs a set of addresses of either the STM or @@ -56,7 +56,6 @@ typedef struct SBP_ATTR_PACKED { N=addr_len */ } msg_flash_program_t; - /** Flash response message (host <= device) * * This message defines success or failure codes for a variety of flash memory @@ -66,10 +65,9 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 response; /**< Response flags */ + u8 response; /**< Response flags */ } msg_flash_done_t; - /** Read STM or M25 flash address request (host => device) * * The flash read message reads a set of addresses of either the STM or M25 @@ -87,7 +85,6 @@ typedef struct SBP_ATTR_PACKED { starting address [bytes] */ } msg_flash_read_req_t; - /** Read STM or M25 flash address response (host <= device) * * The flash read message reads a set of addresses of either the STM or M25 @@ -105,7 +102,6 @@ typedef struct SBP_ATTR_PACKED { starting address [bytes] */ } msg_flash_read_resp_t; - /** Erase sector of device flash memory (host => device) * * The flash erase message from the host erases a sector of either the STM or @@ -115,12 +111,11 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 target; /**< Target flags */ - u32 sector_num; /**< Flash sector number to erase (0-11 for the STM, 0-15 - for the M25) */ + u8 target; /**< Target flags */ + u32 sector_num; /**< Flash sector number to erase (0-11 for the STM, 0-15 + for the M25) */ } msg_flash_erase_t; - /** Lock sector of STM flash memory (host => device) * * The flash lock message locks a sector of the STM flash memory. The device @@ -128,10 +123,9 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 sector; /**< Flash sector number to lock */ + u32 sector; /**< Flash sector number to lock */ } msg_stm_flash_lock_sector_t; - /** Unlock sector of STM flash memory (host => device) * * The flash unlock message unlocks a sector of the STM flash memory. The @@ -139,10 +133,9 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 sector; /**< Flash sector number to unlock */ + u32 sector; /**< Flash sector number to unlock */ } msg_stm_flash_unlock_sector_t; - /** Read device's hard-coded unique ID request (host => device) * @@ -151,7 +144,6 @@ typedef struct SBP_ATTR_PACKED { * MSG_STM_UNIQUE_ID_RESP with the 12-byte unique ID in the payload. */ - /** Read device's hard-coded unique ID response (host <= device) * @@ -164,7 +156,6 @@ typedef struct SBP_ATTR_PACKED { u8 stm_id[12]; /**< Device unique ID */ } msg_stm_unique_id_resp_t; - /** Write M25 flash status register (host => device) * * The flash status message writes to the 8-bit M25 flash status register. The @@ -175,7 +166,6 @@ typedef struct SBP_ATTR_PACKED { u8 status[1]; /**< Byte to write to the M25 flash status register */ } msg_m25_flash_write_status_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/gnss.h b/c/include/libsbp/legacy/gnss.h index 5ae67cc28..8602032df 100644 --- a/c/include/libsbp/legacy/gnss.h +++ b/c/include/libsbp/legacy/gnss.h @@ -27,26 +27,25 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Represents all the relevant information about the signal * * Signal identifier containing constellation, band, and satellite identifier. */ typedef struct SBP_ATTR_PACKED { - u8 sat; /**< Constellation-specific satellite id. For GLO can either be - (100+FCN) where FCN is in [-7,+6] or the Slot ID in [1,28]. */ - u8 code; /**< Signal constellation, band and code */ + u8 sat; /**< Constellation-specific satellite id. For GLO can either be + (100+FCN) where FCN is in [-7,+6] or the Slot ID in [1,28]. */ + u8 code; /**< Signal constellation, band and code */ } sbp_gnss_signal_t; - /** Space vehicle identifier * * A (Constellation ID, satellite ID) tuple that uniquely identifies a space @@ -54,29 +53,27 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 satId; /**< Constellation-specific satellite id. For GLO can - either be (100+FCN) where FCN is in [-7,+6] or the - Slot ID in [1,28]. */ - u8 constellation; /**< Constellation ID to which the SV belongs */ + u8 satId; /**< Constellation-specific satellite id. For GLO can + either be (100+FCN) where FCN is in [-7,+6] or the + Slot ID in [1,28]. */ + u8 constellation; /**< Constellation ID to which the SV belongs */ } sv_id_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u16 sat; /**< Constellation-specific satellite identifier. + u16 sat; /**< Constellation-specific satellite identifier. - Note: unlike GnssSignal, GPS satellites are encoded as - (PRN - 1). Other constellations do not have this - offset. */ - u8 code; /**< Signal constellation, band and code */ - u8 reserved; /**< Reserved */ + Note: unlike GnssSignal, GPS satellites are encoded as + (PRN - 1). Other constellations do not have this + offset. */ + u8 code; /**< Signal constellation, band and code */ + u8 reserved; /**< Reserved */ } gnss_signal_dep_t; - /** Millisecond-accurate GPS time * * A wire-appropriate GPS time, defined as the number of milliseconds since @@ -84,11 +81,10 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< Milliseconds since start of GPS week [ms] */ - u16 wn; /**< GPS week number [week] */ + u32 tow; /**< Milliseconds since start of GPS week [ms] */ + u16 wn; /**< GPS week number [week] */ } gps_time_dep_t; - /** Whole second accurate GPS time * * A GPS time, defined as the number of seconds since beginning of the week on @@ -96,11 +92,10 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< Seconds since start of GPS week [s] */ - u16 wn; /**< GPS week number [week] */ + u32 tow; /**< Seconds since start of GPS week [s] */ + u16 wn; /**< GPS week number [week] */ } gps_time_sec_t; - /** Nanosecond-accurate receiver clock time * * A wire-appropriate receiver clock time, defined as the time since the @@ -109,13 +104,12 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< Milliseconds since start of GPS week [ms] */ - s32 ns_residual; /**< Nanosecond residual of millisecond-rounded TOW - (ranges from -500000 to 500000) [ns] */ - u16 wn; /**< GPS week number [week] */ + u32 tow; /**< Milliseconds since start of GPS week [ms] */ + s32 ns_residual; /**< Nanosecond residual of millisecond-rounded TOW + (ranges from -500000 to 500000) [ns] */ + u16 wn; /**< GPS week number [week] */ } sbp_gps_time_t; - /** GNSS carrier phase measurement * * Carrier phase measurement in cycles represented as a 40-bit fixed point @@ -124,11 +118,10 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - s32 i; /**< Carrier phase whole cycles [cycles] */ - u8 f; /**< Carrier phase fractional part [cycles / 256] */ + s32 i; /**< Carrier phase whole cycles [cycles] */ + u8 f; /**< Carrier phase fractional part [cycles / 256] */ } carrier_phase_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/imu.h b/c/include/libsbp/legacy/imu.h index 298cd7e59..fa0deb959 100644 --- a/c/include/libsbp/legacy/imu.h +++ b/c/include/libsbp/legacy/imu.h @@ -27,14 +27,14 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Raw IMU data * * Raw data from the Inertial Measurement Unit, containing accelerometer and @@ -52,17 +52,17 @@ SBP_PACK_START */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< Milliseconds since reference epoch and time status. */ - u8 tow_f; /**< Milliseconds since reference epoch, fractional part [ms / 256] */ - s16 acc_x; /**< Acceleration in the IMU frame X axis */ - s16 acc_y; /**< Acceleration in the IMU frame Y axis */ - s16 acc_z; /**< Acceleration in the IMU frame Z axis */ - s16 gyr_x; /**< Angular rate around IMU frame X axis */ - s16 gyr_y; /**< Angular rate around IMU frame Y axis */ - s16 gyr_z; /**< Angular rate around IMU frame Z axis */ + u32 tow; /**< Milliseconds since reference epoch and time status. */ + u8 tow_f; /**< Milliseconds since reference epoch, fractional part [ms / 256] + */ + s16 acc_x; /**< Acceleration in the IMU frame X axis */ + s16 acc_y; /**< Acceleration in the IMU frame Y axis */ + s16 acc_z; /**< Acceleration in the IMU frame Z axis */ + s16 gyr_x; /**< Angular rate around IMU frame X axis */ + s16 gyr_y; /**< Angular rate around IMU frame Y axis */ + s16 gyr_z; /**< Angular rate around IMU frame Z axis */ } msg_imu_raw_t; - /** Auxiliary IMU data * * Auxiliary data specific to a particular IMU. The `imu_type` field will @@ -71,12 +71,11 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 imu_type; /**< IMU type */ - s16 temp; /**< Raw IMU temperature */ - u8 imu_conf; /**< IMU configuration */ + u8 imu_type; /**< IMU type */ + s16 temp; /**< Raw IMU temperature */ + u8 imu_conf; /**< IMU configuration */ } msg_imu_aux_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/integrity.h b/c/include/libsbp/legacy/integrity.h index 5431908ec..cdc692959 100644 --- a/c/include/libsbp/legacy/integrity.h +++ b/c/include/libsbp/legacy/integrity.h @@ -28,27 +28,25 @@ #include #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - - typedef struct SBP_ATTR_PACKED { - gps_time_sec_t obs_time; /**< GNSS reference time of the observation - used to generate the flag. */ - u8 num_msgs; /**< Number of messages in the dataset */ - u8 seq_num; /**< Position of this message in the dataset */ - u8 ssr_sol_id; /**< SSR Solution ID. */ - u16 tile_set_id; /**< Unique identifier of the set this tile belongs to. */ - u16 tile_id; /**< Unique identifier of this tile in the tile set. */ - u8 chain_id; /**< Chain and type of flag. */ + gps_time_sec_t obs_time; /**< GNSS reference time of the observation + used to generate the flag. */ + u8 num_msgs; /**< Number of messages in the dataset */ + u8 seq_num; /**< Position of this message in the dataset */ + u8 ssr_sol_id; /**< SSR Solution ID. */ + u16 tile_set_id; /**< Unique identifier of the set this tile belongs to. */ + u16 tile_id; /**< Unique identifier of this tile in the tile set. */ + u8 chain_id; /**< Chain and type of flag. */ } integrity_ssr_header_t; - /** High level integrity flags * * Integrity monitoring flags for multiple aggregated elements. An element @@ -79,99 +77,86 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - gps_time_sec_t obs_time; /**< GNSS reference time of - the observation used to - generate the flag. */ - gps_time_sec_t corr_time; /**< GNSS reference time of - the correction - associated to the flag. */ - u8 ssr_sol_id; /**< SSR Solution ID. */ - u16 tile_set_id; /**< Unique identifier of the set this - tile belongs to. */ - u16 tile_id; /**< Unique identifier of this tile in - the tile set. */ - u8 chain_id; /**< Chain and type of flag. */ - u8 use_gps_sat; /**< Use GPS satellites. */ - u8 use_gal_sat; /**< Use GAL satellites. */ - u8 use_bds_sat; /**< Use BDS satellites. */ - u8 reserved[6]; /**< Reserved */ - u8 use_tropo_grid_points; /**< Use tropo grid points. */ - u8 use_iono_grid_points; /**< Use iono grid points. */ - u8 use_iono_tile_sat_los; /**< Use iono tile satellite LoS. */ - u8 use_iono_grid_point_sat_los; /**< Use iono grid point satellite LoS. */ + gps_time_sec_t obs_time; /**< GNSS reference time of + the observation used to + generate the flag. */ + gps_time_sec_t corr_time; /**< GNSS reference time of + the correction + associated to the flag. */ + u8 ssr_sol_id; /**< SSR Solution ID. */ + u16 tile_set_id; /**< Unique identifier of the set this + tile belongs to. */ + u16 tile_id; /**< Unique identifier of this tile in + the tile set. */ + u8 chain_id; /**< Chain and type of flag. */ + u8 use_gps_sat; /**< Use GPS satellites. */ + u8 use_gal_sat; /**< Use GAL satellites. */ + u8 use_bds_sat; /**< Use BDS satellites. */ + u8 reserved[6]; /**< Reserved */ + u8 use_tropo_grid_points; /**< Use tropo grid points. */ + u8 use_iono_grid_points; /**< Use iono grid points. */ + u8 use_iono_tile_sat_los; /**< Use iono tile satellite LoS. */ + u8 use_iono_grid_point_sat_los; /**< Use iono grid point satellite LoS. */ } msg_ssr_flag_high_level_t; - - typedef struct SBP_ATTR_PACKED { - gps_time_sec_t obs_time; /**< GNSS reference time of the observation - used to generate the flag. */ - u8 num_msgs; /**< Number of messages in the dataset */ - u8 seq_num; /**< Position of this message in the dataset */ - u8 ssr_sol_id; /**< SSR Solution ID. */ - u8 chain_id; /**< Chain and type of flag. */ - u8 const_id; /**< Constellation ID. */ - u8 n_faulty_sats; /**< Number of faulty satellites. */ - u8 faulty_sats[0]; /**< List of faulty satellites. */ + gps_time_sec_t obs_time; /**< GNSS reference time of the observation + used to generate the flag. */ + u8 num_msgs; /**< Number of messages in the dataset */ + u8 seq_num; /**< Position of this message in the dataset */ + u8 ssr_sol_id; /**< SSR Solution ID. */ + u8 chain_id; /**< Chain and type of flag. */ + u8 const_id; /**< Constellation ID. */ + u8 n_faulty_sats; /**< Number of faulty satellites. */ + u8 faulty_sats[0]; /**< List of faulty satellites. */ } msg_ssr_flag_satellites_t; - - typedef struct SBP_ATTR_PACKED { - integrity_ssr_header_t header; /**< Header of an integrity - message. */ - u8 n_faulty_points; /**< Number of faulty grid points. */ - u16 faulty_points[0]; /**< List of faulty grid points. */ + integrity_ssr_header_t header; /**< Header of an integrity + message. */ + u8 n_faulty_points; /**< Number of faulty grid points. */ + u16 faulty_points[0]; /**< List of faulty grid points. */ } msg_ssr_flag_tropo_grid_points_t; - - typedef struct SBP_ATTR_PACKED { - integrity_ssr_header_t header; /**< Header of an integrity - message. */ - u8 n_faulty_points; /**< Number of faulty grid points. */ - u16 faulty_points[0]; /**< List of faulty grid points. */ + integrity_ssr_header_t header; /**< Header of an integrity + message. */ + u8 n_faulty_points; /**< Number of faulty grid points. */ + u16 faulty_points[0]; /**< List of faulty grid points. */ } msg_ssr_flag_iono_grid_points_t; - - typedef struct SBP_ATTR_PACKED { - integrity_ssr_header_t header; /**< Header of an integrity message. */ - u8 n_faulty_los; /**< Number of faulty LOS. */ - sv_id_t faulty_los[0]; /**< List of faulty LOS */ + integrity_ssr_header_t header; /**< Header of an integrity message. */ + u8 n_faulty_los; /**< Number of faulty LOS. */ + sv_id_t faulty_los[0]; /**< List of faulty LOS */ } msg_ssr_flag_iono_tile_sat_los_t; - - typedef struct SBP_ATTR_PACKED { - integrity_ssr_header_t header; /**< Header of an integrity - message. */ - u16 grid_point_id; /**< Index of the grid point. */ - u8 n_faulty_los; /**< Number of faulty LOS. */ - sv_id_t faulty_los[0]; /**< List of faulty LOS */ + integrity_ssr_header_t header; /**< Header of an integrity + message. */ + u16 grid_point_id; /**< Index of the grid point. */ + u8 n_faulty_los; /**< Number of faulty LOS. */ + sv_id_t faulty_los[0]; /**< List of faulty LOS */ } msg_ssr_flag_iono_grid_point_sat_los_t; - - typedef struct SBP_ATTR_PACKED { - u8 request_id; /**< Echo of the request ID field from the - corresponding CRA message, or 255 if - no request ID was provided. */ - u32 area_id; /**< Echo of the Area ID field from the - corresponding CRA message. */ - u8 response_code; /**< Reported status of the request. */ - u16 correction_mask_on_demand; /**< Contains the message group(s) that - will be sent in response from the - corresponding CRA correction mask. An - echo of the correction mask field - from the corresponding CRA message. */ - u16 correction_mask_stream; /**< For future expansion. Always set to - 0. */ - u8 solution_id; /**< The solution ID of the instance - providing the corrections. */ + u8 request_id; /**< Echo of the request ID field from the + corresponding CRA message, or 255 if + no request ID was provided. */ + u32 area_id; /**< Echo of the Area ID field from the + corresponding CRA message. */ + u8 response_code; /**< Reported status of the request. */ + u16 correction_mask_on_demand; /**< Contains the message group(s) that + will be sent in response from the + corresponding CRA correction mask. An + echo of the correction mask field + from the corresponding CRA message. */ + u16 correction_mask_stream; /**< For future expansion. Always set to + 0. */ + u8 solution_id; /**< The solution ID of the instance + providing the corrections. */ } msg_acknowledge_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/linux.h b/c/include/libsbp/legacy/linux.h index 0f2cfb05c..6ea74ef4a 100644 --- a/c/include/libsbp/legacy/linux.h +++ b/c/include/libsbp/legacy/linux.h @@ -27,149 +27,142 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u8 index; /**< sequence of this status message, values from 0-9 */ - u16 pid; /**< the PID of the process */ - u8 pcpu; /**< percent of cpu used, expressed as a fraction of 256 */ + u8 index; /**< sequence of this status message, values from 0-9 */ + u16 pid; /**< the PID of the process */ + u8 pcpu; /**< percent of cpu used, expressed as a fraction of 256 */ char tname[15]; /**< fixed length string representing the thread name */ char cmdline[0]; /**< the command line (as much as it fits in the remaining packet) */ } msg_linux_cpu_state_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u8 index; /**< sequence of this status message, values from 0-9 */ + u8 index; /**< sequence of this status message, values from 0-9 */ u16 pid; /**< the PID of the process */ - u8 pmem; /**< percent of memory used, expressed as a fraction of 256 */ - char tname[15]; /**< fixed length string representing the thread name */ + u8 pmem; /**< percent of memory used, expressed as a fraction of 256 */ + char tname[15]; /**< fixed length string representing the thread name */ char cmdline[0]; /**< the command line (as much as it fits in the remaining packet) */ } msg_linux_mem_state_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u16 mem_total; /**< total system memory */ - u8 pcpu; /**< percent of total cpu currently utilized */ - u8 pmem; /**< percent of total memory currently utilized */ - u16 procs_starting; /**< number of processes that started during - collection phase */ - u16 procs_stopping; /**< number of processes that stopped during - collection phase */ - u16 pid_count; /**< the count of processes on the system */ + u16 mem_total; /**< total system memory */ + u8 pcpu; /**< percent of total cpu currently utilized */ + u8 pmem; /**< percent of total memory currently utilized */ + u16 procs_starting; /**< number of processes that started during + collection phase */ + u16 procs_stopping; /**< number of processes that stopped during + collection phase */ + u16 pid_count; /**< the count of processes on the system */ } msg_linux_sys_state_dep_a_t; - /** A list of processes with high socket counts * * Top 10 list of processes with high socket counts. */ typedef struct SBP_ATTR_PACKED { - u8 index; /**< sequence of this status message, values from 0-9 */ - u16 pid; /**< the PID of the process in question */ - u16 socket_count; /**< the number of sockets the process is using */ - u16 socket_types; /**< A bitfield indicating the socket types used: 0x1 - (tcp), 0x2 (udp), 0x4 (unix stream), 0x8 (unix - dgram), 0x10 (netlink), and 0x8000 (unknown) */ - u16 socket_states; /**< A bitfield indicating the socket states: 0x1 - (established), 0x2 (syn-sent), 0x4 (syn-recv), - 0x8 (fin-wait-1), 0x10 (fin-wait-2), 0x20 (time- - wait), 0x40 (closed), 0x80 (close-wait), 0x100 - (last-ack), 0x200 (listen), 0x400 (closing), - 0x800 (unconnected), and 0x8000 (unknown) */ - char cmdline[0]; /**< the command line of the process in question */ + u8 index; /**< sequence of this status message, values from 0-9 */ + u16 pid; /**< the PID of the process in question */ + u16 socket_count; /**< the number of sockets the process is using */ + u16 socket_types; /**< A bitfield indicating the socket types used: 0x1 + (tcp), 0x2 (udp), 0x4 (unix stream), 0x8 (unix + dgram), 0x10 (netlink), and 0x8000 (unknown) */ + u16 socket_states; /**< A bitfield indicating the socket states: 0x1 + (established), 0x2 (syn-sent), 0x4 (syn-recv), + 0x8 (fin-wait-1), 0x10 (fin-wait-2), 0x20 (time- + wait), 0x40 (closed), 0x80 (close-wait), 0x100 + (last-ack), 0x200 (listen), 0x400 (closing), + 0x800 (unconnected), and 0x8000 (unknown) */ + char cmdline[0]; /**< the command line of the process in question */ } msg_linux_process_socket_counts_t; - /** A list of processes with deep socket queues * * Top 10 list of sockets with deep queues. */ typedef struct SBP_ATTR_PACKED { - u8 index; /**< sequence of this status message, values from - 0-9 */ - u16 pid; /**< the PID of the process in question */ - u16 recv_queued; /**< the total amount of receive data queued for - this process */ - u16 send_queued; /**< the total amount of send data queued for - this process */ - u16 socket_types; /**< A bitfield indicating the socket types used: - 0x1 (tcp), 0x2 (udp), 0x4 (unix stream), 0x8 - (unix dgram), 0x10 (netlink), and 0x8000 - (unknown) */ - u16 socket_states; /**< A bitfield indicating the socket states: 0x1 - (established), 0x2 (syn-sent), 0x4 (syn- - recv), 0x8 (fin-wait-1), 0x10 (fin-wait-2), - 0x20 (time-wait), 0x40 (closed), 0x80 - (close-wait), 0x100 (last-ack), 0x200 - (listen), 0x400 (closing), 0x800 - (unconnected), and 0x8000 (unknown) */ + u8 index; /**< sequence of this status message, values from + 0-9 */ + u16 pid; /**< the PID of the process in question */ + u16 recv_queued; /**< the total amount of receive data queued for + this process */ + u16 send_queued; /**< the total amount of send data queued for + this process */ + u16 socket_types; /**< A bitfield indicating the socket types used: + 0x1 (tcp), 0x2 (udp), 0x4 (unix stream), 0x8 + (unix dgram), 0x10 (netlink), and 0x8000 + (unknown) */ + u16 socket_states; /**< A bitfield indicating the socket states: 0x1 + (established), 0x2 (syn-sent), 0x4 (syn- + recv), 0x8 (fin-wait-1), 0x10 (fin-wait-2), + 0x20 (time-wait), 0x40 (closed), 0x80 + (close-wait), 0x100 (last-ack), 0x200 + (listen), 0x400 (closing), 0x800 + (unconnected), and 0x8000 (unknown) */ char address_of_largest[64]; /**< Address of the largest queue, remote or local depending on the directionality of the connection. */ - char cmdline[0]; /**< the command line of the process in question */ + char cmdline[0]; /**< the command line of the process in question */ } msg_linux_process_socket_queues_t; - /** Summary of socket usage across the system * * Summaries the socket usage across the system. */ typedef struct SBP_ATTR_PACKED { - u32 avg_queue_depth; /**< average socket queue depths across all - sockets on the system */ - u32 max_queue_depth; /**< the max queue depth seen within the - reporting period */ + u32 avg_queue_depth; /**< average socket queue depths across all + sockets on the system */ + u32 max_queue_depth; /**< the max queue depth seen within the + reporting period */ u16 socket_state_counts[16]; /**< A count for each socket type reported in the `socket_types_reported` field, the first entry corresponds to the first enabled bit in `types_reported`. */ - u16 socket_type_counts[16]; /**< A count for each socket type reported in - the `socket_types_reported` field, the - first entry corresponds to the first - enabled bit in `types_reported`. */ + u16 socket_type_counts[16]; /**< A count for each socket type reported in + the `socket_types_reported` field, the + first entry corresponds to the first + enabled bit in `types_reported`. */ } msg_linux_socket_usage_t; - /** Summary of processes with large amounts of open file descriptors * * Top 10 list of processes with a large number of open file descriptors. */ typedef struct SBP_ATTR_PACKED { - u8 index; /**< sequence of this status message, values from 0-9 */ + u8 index; /**< sequence of this status message, values from 0-9 */ u16 pid; /**< the PID of the process in question */ u16 fd_count; /**< a count of the number of file descriptors opened by the process */ - char cmdline[0]; /**< the command line of the process in question */ + char cmdline[0]; /**< the command line of the process in question */ } msg_linux_process_fd_count_t; - /** Summary of open file descriptors on the system * * Summary of open file descriptors on the system. @@ -177,16 +170,15 @@ typedef struct SBP_ATTR_PACKED { typedef struct SBP_ATTR_PACKED { u32 sys_fd_count; /**< count of total FDs open on the system */ - char most_opened[0]; /**< A null delimited list of strings which alternates - between a string representation of the process - count and the file name whose count it being - reported. That is, in C string syntax - "32\0/var/log/syslog\012\0/tmp/foo\0" with the - end of the list being 2 NULL terminators in a - row. */ + char most_opened[0]; /**< A null delimited list of strings which alternates + between a string representation of the process + count and the file name whose count it being + reported. That is, in C string syntax + "32\0/var/log/syslog\012\0/tmp/foo\0" with the + end of the list being 2 NULL terminators in a + row. */ } msg_linux_process_fd_summary_t; - /** List CPU state on the system * * This message indicates the process state of the top 10 heaviest consumers @@ -194,18 +186,17 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 index; /**< sequence of this status message, values from 0-9 */ - u16 pid; /**< the PID of the process */ - u8 pcpu; /**< percent of CPU used, expressed as a fraction of 256 */ - u32 time; /**< timestamp of message, refer to flags field for how to - interpret */ - u8 flags; /**< flags */ + u8 index; /**< sequence of this status message, values from 0-9 */ + u16 pid; /**< the PID of the process */ + u8 pcpu; /**< percent of CPU used, expressed as a fraction of 256 */ + u32 time; /**< timestamp of message, refer to flags field for how to + interpret */ + u8 flags; /**< flags */ char tname[15]; /**< fixed length string representing the thread name */ char cmdline[0]; /**< the command line (as much as it fits in the remaining packet) */ } msg_linux_cpu_state_t; - /** List memory state on the system * * This message indicates the process state of the top 10 heaviest consumers @@ -213,18 +204,17 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 index; /**< sequence of this status message, values from 0-9 */ + u8 index; /**< sequence of this status message, values from 0-9 */ u16 pid; /**< the PID of the process */ - u8 pmem; /**< percent of memory used, expressed as a fraction of 256 */ + u8 pmem; /**< percent of memory used, expressed as a fraction of 256 */ u32 time; /**< timestamp of message, refer to flags field for how to interpret */ - u8 flags; /**< flags */ - char tname[15]; /**< fixed length string representing the thread name */ + u8 flags; /**< flags */ + char tname[15]; /**< fixed length string representing the thread name */ char cmdline[0]; /**< the command line (as much as it fits in the remaining packet) */ } msg_linux_mem_state_t; - /** CPU, Memory and Process Starts/Stops * * This presents a summary of CPU and memory utilization, including a @@ -232,22 +222,21 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u16 mem_total; /**< total system memory, in MiB */ - u8 pcpu; /**< percent of CPU used, expressed as a fraction of - 256 */ - u8 pmem; /**< percent of memory used, expressed as a fraction - of 256 */ - u16 procs_starting; /**< number of processes that started during - collection phase */ - u16 procs_stopping; /**< number of processes that stopped during - collection phase */ - u16 pid_count; /**< the count of processes on the system */ - u32 time; /**< timestamp of message, refer to flags field for - how to interpret */ - u8 flags; /**< flags */ + u16 mem_total; /**< total system memory, in MiB */ + u8 pcpu; /**< percent of CPU used, expressed as a fraction of + 256 */ + u8 pmem; /**< percent of memory used, expressed as a fraction + of 256 */ + u16 procs_starting; /**< number of processes that started during + collection phase */ + u16 procs_stopping; /**< number of processes that stopped during + collection phase */ + u16 pid_count; /**< the count of processes on the system */ + u32 time; /**< timestamp of message, refer to flags field for + how to interpret */ + u8 flags; /**< flags */ } msg_linux_sys_state_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/logging.h b/c/include/libsbp/legacy/logging.h index cb1de4716..a0193cd64 100644 --- a/c/include/libsbp/legacy/logging.h +++ b/c/include/libsbp/legacy/logging.h @@ -27,14 +27,14 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Plaintext logging messages with levels * * This message contains a human-readable payload string from the device @@ -43,11 +43,10 @@ SBP_PACK_START */ typedef struct SBP_ATTR_PACKED { - u8 level; /**< Logging level */ - char text[0]; /**< Human-readable string */ + u8 level; /**< Logging level */ + char text[0]; /**< Human-readable string */ } msg_log_t; - /** Wrapper for FWD a separate stream of information over SBP * * This message provides the ability to forward messages over SBP. This may @@ -66,7 +65,6 @@ typedef struct SBP_ATTR_PACKED { u8 fwd_payload[0]; /**< variable length wrapped binary message */ } msg_fwd_t; - /** Deprecated * * Deprecated. @@ -76,7 +74,6 @@ typedef struct SBP_ATTR_PACKED { char text[0]; /**< Human-readable string */ } msg_print_dep_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/mag.h b/c/include/libsbp/legacy/mag.h index 0095a5963..eba7b76ab 100644 --- a/c/include/libsbp/legacy/mag.h +++ b/c/include/libsbp/legacy/mag.h @@ -27,29 +27,29 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Raw magnetometer data * * Raw data from the magnetometer. */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< Milliseconds since start of GPS week. If the high bit is - set, the time is unknown or invalid. [ms] */ - u8 tow_f; /**< Milliseconds since start of GPS week, fractional part [ms / 256] */ - s16 mag_x; /**< Magnetic field in the body frame X axis [microteslas] */ - s16 mag_y; /**< Magnetic field in the body frame Y axis [microteslas] */ - s16 mag_z; /**< Magnetic field in the body frame Z axis [microteslas] */ + u32 tow; /**< Milliseconds since start of GPS week. If the high bit is + set, the time is unknown or invalid. [ms] */ + u8 tow_f; /**< Milliseconds since start of GPS week, fractional part [ms / + 256] */ + s16 mag_x; /**< Magnetic field in the body frame X axis [microteslas] */ + s16 mag_y; /**< Magnetic field in the body frame Y axis [microteslas] */ + s16 mag_z; /**< Magnetic field in the body frame Z axis [microteslas] */ } msg_mag_raw_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/navigation.h b/c/include/libsbp/legacy/navigation.h index 55120793d..3d4564b07 100644 --- a/c/include/libsbp/legacy/navigation.h +++ b/c/include/libsbp/legacy/navigation.h @@ -49,14 +49,14 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** GPS Time (GNSS + inertial) * * This message reports the GPS time, representing the time since the GPS @@ -77,14 +77,13 @@ SBP_PACK_START */ typedef struct SBP_ATTR_PACKED { - u16 wn; /**< GPS week number [weeks] */ - u32 tow; /**< GPS time of week rounded to the nearest millisecond [ms] */ - s32 ns_residual; /**< Nanosecond residual of millisecond-rounded TOW - (ranges from -500000 to 500000) [ns] */ - u8 flags; /**< Status flags (reserved) */ + u16 wn; /**< GPS week number [weeks] */ + u32 tow; /**< GPS time of week rounded to the nearest millisecond [ms] */ + s32 ns_residual; /**< Nanosecond residual of millisecond-rounded TOW + (ranges from -500000 to 500000) [ns] */ + u8 flags; /**< Status flags (reserved) */ } msg_gps_time_t; - /** GNSS-only GPS Time * * This message reports the GPS time, representing the time since the GPS @@ -104,14 +103,13 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u16 wn; /**< GPS week number [weeks] */ - u32 tow; /**< GPS time of week rounded to the nearest millisecond [ms] */ - s32 ns_residual; /**< Nanosecond residual of millisecond-rounded TOW - (ranges from -500000 to 500000) [ns] */ - u8 flags; /**< Status flags (reserved) */ + u16 wn; /**< GPS week number [weeks] */ + u32 tow; /**< GPS time of week rounded to the nearest millisecond [ms] */ + s32 ns_residual; /**< Nanosecond residual of millisecond-rounded TOW + (ranges from -500000 to 500000) [ns] */ + u8 flags; /**< Status flags (reserved) */ } msg_gps_time_gnss_t; - /** UTC Time * * This message reports the Universal Coordinated Time (UTC). Note the flags @@ -124,18 +122,17 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 flags; /**< Indicates source and time validity */ - u32 tow; /**< GPS time of week rounded to the nearest millisecond [ms] */ - u16 year; /**< Year [year] */ - u8 month; /**< Month (range 1 .. 12) [months] */ - u8 day; /**< days in the month (range 1-31) [day] */ - u8 hours; /**< hours of day (range 0-23) [hours] */ - u8 minutes; /**< minutes of hour (range 0-59) [minutes] */ - u8 seconds; /**< seconds of minute (range 0-60) rounded down [seconds] */ - u32 ns; /**< nanoseconds of second (range 0-999999999) [nanoseconds] */ + u8 flags; /**< Indicates source and time validity */ + u32 tow; /**< GPS time of week rounded to the nearest millisecond [ms] */ + u16 year; /**< Year [year] */ + u8 month; /**< Month (range 1 .. 12) [months] */ + u8 day; /**< days in the month (range 1-31) [day] */ + u8 hours; /**< hours of day (range 0-23) [hours] */ + u8 minutes; /**< minutes of hour (range 0-59) [minutes] */ + u8 seconds; /**< seconds of minute (range 0-60) rounded down [seconds] */ + u32 ns; /**< nanoseconds of second (range 0-999999999) [nanoseconds] */ } msg_utc_time_t; - /** GNSS-only UTC Time * * This message reports the Universal Coordinated Time (UTC). Note the flags @@ -147,18 +144,17 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 flags; /**< Indicates source and time validity */ - u32 tow; /**< GPS time of week rounded to the nearest millisecond [ms] */ - u16 year; /**< Year [year] */ - u8 month; /**< Month (range 1 .. 12) [months] */ - u8 day; /**< days in the month (range 1-31) [day] */ - u8 hours; /**< hours of day (range 0-23) [hours] */ - u8 minutes; /**< minutes of hour (range 0-59) [minutes] */ - u8 seconds; /**< seconds of minute (range 0-60) rounded down [seconds] */ - u32 ns; /**< nanoseconds of second (range 0-999999999) [nanoseconds] */ + u8 flags; /**< Indicates source and time validity */ + u32 tow; /**< GPS time of week rounded to the nearest millisecond [ms] */ + u16 year; /**< Year [year] */ + u8 month; /**< Month (range 1 .. 12) [months] */ + u8 day; /**< days in the month (range 1-31) [day] */ + u8 hours; /**< hours of day (range 0-23) [hours] */ + u8 minutes; /**< minutes of hour (range 0-59) [minutes] */ + u8 seconds; /**< seconds of minute (range 0-60) rounded down [seconds] */ + u32 ns; /**< nanoseconds of second (range 0-999999999) [nanoseconds] */ } msg_utc_time_gnss_t; - /** GNSS-only Dilution of Precision * * This dilution of precision (DOP) message describes the effect of navigation @@ -170,17 +166,16 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - u16 gdop; /**< Geometric Dilution of Precision [0.01] */ - u16 pdop; /**< Position Dilution of Precision [0.01] */ - u16 tdop; /**< Time Dilution of Precision [0.01] */ - u16 hdop; /**< Horizontal Dilution of Precision [0.01] */ - u16 vdop; /**< Vertical Dilution of Precision [0.01] */ - u8 flags; /**< Indicates the position solution with which the DOPS - message corresponds */ + u32 tow; /**< GPS Time of Week [ms] */ + u16 gdop; /**< Geometric Dilution of Precision [0.01] */ + u16 pdop; /**< Position Dilution of Precision [0.01] */ + u16 tdop; /**< Time Dilution of Precision [0.01] */ + u16 hdop; /**< Horizontal Dilution of Precision [0.01] */ + u16 vdop; /**< Vertical Dilution of Precision [0.01] */ + u8 flags; /**< Indicates the position solution with which the DOPS + message corresponds */ } msg_dops_t; - /** Position in ECEF * * The position solution message reports absolute Earth Centered Earth Fixed @@ -197,16 +192,15 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - double x; /**< ECEF X coordinate [m] */ - double y; /**< ECEF Y coordinate [m] */ - double z; /**< ECEF Z coordinate [m] */ - u16 accuracy; /**< Position estimated standard deviation [mm] */ - u8 n_sats; /**< Number of satellites used in solution */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + double x; /**< ECEF X coordinate [m] */ + double y; /**< ECEF Y coordinate [m] */ + double z; /**< ECEF Z coordinate [m] */ + u16 accuracy; /**< Position estimated standard deviation [mm] */ + u8 n_sats; /**< Number of satellites used in solution */ + u8 flags; /**< Status flags */ } msg_pos_ecef_t; - /** Position in ECEF with Covariances * * The position solution message reports absolute Earth Centered Earth Fixed @@ -224,21 +218,20 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - double x; /**< ECEF X coordinate [m] */ - double y; /**< ECEF Y coordinate [m] */ - double z; /**< ECEF Z coordinate [m] */ - float cov_x_x; /**< Estimated variance of x [m^2] */ - float cov_x_y; /**< Estimated covariance of x and y [m^2] */ - float cov_x_z; /**< Estimated covariance of x and z [m^2] */ - float cov_y_y; /**< Estimated variance of y [m^2] */ - float cov_y_z; /**< Estimated covariance of y and z [m^2] */ - float cov_z_z; /**< Estimated variance of z [m^2] */ + u32 tow; /**< GPS Time of Week [ms] */ + double x; /**< ECEF X coordinate [m] */ + double y; /**< ECEF Y coordinate [m] */ + double z; /**< ECEF Z coordinate [m] */ + float cov_x_x; /**< Estimated variance of x [m^2] */ + float cov_x_y; /**< Estimated covariance of x and y [m^2] */ + float cov_x_z; /**< Estimated covariance of x and z [m^2] */ + float cov_y_y; /**< Estimated variance of y [m^2] */ + float cov_y_z; /**< Estimated covariance of y and z [m^2] */ + float cov_z_z; /**< Estimated variance of z [m^2] */ u8 n_sats; /**< Number of satellites used in solution */ u8 flags; /**< Status flags */ } msg_pos_ecef_cov_t; - /** Geodetic Position * * This position solution message reports the absolute geodetic coordinates @@ -255,17 +248,16 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - double lat; /**< Latitude [deg] */ - double lon; /**< Longitude [deg] */ - double height; /**< Height above WGS84 ellipsoid [m] */ - u16 h_accuracy; /**< Horizontal position estimated standard deviation [mm] */ - u16 v_accuracy; /**< Vertical position estimated standard deviation [mm] */ - u8 n_sats; /**< Number of satellites used in solution. */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + double lat; /**< Latitude [deg] */ + double lon; /**< Longitude [deg] */ + double height; /**< Height above WGS84 ellipsoid [m] */ + u16 h_accuracy; /**< Horizontal position estimated standard deviation [mm] */ + u16 v_accuracy; /**< Vertical position estimated standard deviation [mm] */ + u8 n_sats; /**< Number of satellites used in solution. */ + u8 flags; /**< Status flags */ } msg_pos_llh_t; - /** Geodetic Position with Covariances * * This position solution message reports the absolute geodetic coordinates @@ -283,35 +275,32 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - double lat; /**< Latitude [deg] */ - double lon; /**< Longitude [deg] */ - double height; /**< Height above WGS84 ellipsoid [m] */ - float cov_n_n; /**< Estimated variance of northing [m^2] */ - float cov_n_e; /**< Covariance of northing and easting [m^2] */ - float cov_n_d; /**< Covariance of northing and downward measurement [m^2] */ - float cov_e_e; /**< Estimated variance of easting [m^2] */ - float cov_e_d; /**< Covariance of easting and downward measurement [m^2] */ - float cov_d_d; /**< Estimated variance of downward measurement [m^2] */ + u32 tow; /**< GPS Time of Week [ms] */ + double lat; /**< Latitude [deg] */ + double lon; /**< Longitude [deg] */ + double height; /**< Height above WGS84 ellipsoid [m] */ + float cov_n_n; /**< Estimated variance of northing [m^2] */ + float cov_n_e; /**< Covariance of northing and easting [m^2] */ + float cov_n_d; /**< Covariance of northing and downward measurement [m^2] */ + float cov_e_e; /**< Estimated variance of easting [m^2] */ + float cov_e_d; /**< Covariance of easting and downward measurement [m^2] */ + float cov_d_d; /**< Estimated variance of downward measurement [m^2] */ u8 n_sats; /**< Number of satellites used in solution. */ u8 flags; /**< Status flags */ } msg_pos_llh_cov_t; - - typedef struct SBP_ATTR_PACKED { - float semi_major; /**< The semi major axis of the estimated horizontal - error ellipse at the user-configured confidence - level; zero implies invalid. [m] */ - float semi_minor; /**< The semi minor axis of the estimated horizontal - error ellipse at the user-configured confidence - level; zero implies invalid. [m] */ - float orientation; /**< The orientation of the semi major axis of the - estimated horizontal error ellipse with respect - to North. [deg] */ + float semi_major; /**< The semi major axis of the estimated horizontal + error ellipse at the user-configured confidence + level; zero implies invalid. [m] */ + float semi_minor; /**< The semi minor axis of the estimated horizontal + error ellipse at the user-configured confidence + level; zero implies invalid. [m] */ + float orientation; /**< The orientation of the semi major axis of the + estimated horizontal error ellipse with respect + to North. [deg] */ } estimated_horizontal_error_ellipse_t; - /** Geodetic Position and Accuracy * * This position solution message reports the absolute geodetic coordinates @@ -330,46 +319,45 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - double lat; /**< Latitude [deg] */ - double lon; /**< Longitude [deg] */ - double height; /**< Height above WGS84 ellipsoid [m] */ - double orthometric_height; /**< Height above the geoid (i.e. height - above mean sea level). See - confidence_and_geoid for geoid model - used. [m] */ - float h_accuracy; /**< Estimated horizontal error at the user- - configured confidence level; zero - implies invalid. [m] */ - float v_accuracy; /**< Estimated vertical error at the user- - configured confidence level; zero - implies invalid. [m] */ - float ct_accuracy; /**< Estimated cross-track error at the user- - configured confidence level; zero - implies invalid. [m] */ - float at_accuracy; /**< Estimated along-track error at the user- - configured confidence level; zero - implies invalid. [m] */ - estimated_horizontal_error_ellipse_t h_ellipse; /**< The - estimated - horizontal - error - ellipse - at the - user- - configured - confidence - level. */ - u8 confidence_and_geoid; /**< The lower bits describe the configured - confidence level for the estimated position - error. The middle bits describe the geoid - model used to calculate the orthometric - height. */ - u8 n_sats; /**< Number of satellites used in solution. */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + double lat; /**< Latitude [deg] */ + double lon; /**< Longitude [deg] */ + double height; /**< Height above WGS84 ellipsoid [m] */ + double orthometric_height; /**< Height above the geoid (i.e. height + above mean sea level). See + confidence_and_geoid for geoid model + used. [m] */ + float h_accuracy; /**< Estimated horizontal error at the user- + configured confidence level; zero + implies invalid. [m] */ + float v_accuracy; /**< Estimated vertical error at the user- + configured confidence level; zero + implies invalid. [m] */ + float ct_accuracy; /**< Estimated cross-track error at the user- + configured confidence level; zero + implies invalid. [m] */ + float at_accuracy; /**< Estimated along-track error at the user- + configured confidence level; zero + implies invalid. [m] */ + estimated_horizontal_error_ellipse_t h_ellipse; /**< The + estimated + horizontal + error + ellipse + at the + user- + configured + confidence + level. */ + u8 confidence_and_geoid; /**< The lower bits describe the configured + confidence level for the estimated position + error. The middle bits describe the geoid + model used to calculate the orthometric + height. */ + u8 n_sats; /**< Number of satellites used in solution. */ + u8 flags; /**< Status flags */ } msg_pos_llh_acc_t; - /** GNSS-only Baseline Position in ECEF * * This message reports the baseline solution in Earth Centered Earth Fixed @@ -381,16 +369,15 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 x; /**< Baseline ECEF X coordinate [mm] */ - s32 y; /**< Baseline ECEF Y coordinate [mm] */ - s32 z; /**< Baseline ECEF Z coordinate [mm] */ - u16 accuracy; /**< Position estimated standard deviation [mm] */ - u8 n_sats; /**< Number of satellites used in solution */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 x; /**< Baseline ECEF X coordinate [mm] */ + s32 y; /**< Baseline ECEF Y coordinate [mm] */ + s32 z; /**< Baseline ECEF Z coordinate [mm] */ + u16 accuracy; /**< Position estimated standard deviation [mm] */ + u8 n_sats; /**< Number of satellites used in solution */ + u8 flags; /**< Status flags */ } msg_baseline_ecef_t; - /** GNSS-only Baseline in NED * * This message reports the baseline solution in North East Down (NED) @@ -404,17 +391,16 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 n; /**< Baseline North coordinate [mm] */ - s32 e; /**< Baseline East coordinate [mm] */ - s32 d; /**< Baseline Down coordinate [mm] */ - u16 h_accuracy; /**< Horizontal position estimated standard deviation [mm] */ - u16 v_accuracy; /**< Vertical position estimated standard deviation [mm] */ - u8 n_sats; /**< Number of satellites used in solution */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 n; /**< Baseline North coordinate [mm] */ + s32 e; /**< Baseline East coordinate [mm] */ + s32 d; /**< Baseline Down coordinate [mm] */ + u16 h_accuracy; /**< Horizontal position estimated standard deviation [mm] */ + u16 v_accuracy; /**< Vertical position estimated standard deviation [mm] */ + u8 n_sats; /**< Number of satellites used in solution */ + u8 flags; /**< Status flags */ } msg_baseline_ned_t; - /** Velocity in ECEF * * This message reports the velocity in Earth Centered Earth Fixed (ECEF) @@ -427,16 +413,15 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 x; /**< Velocity ECEF X coordinate [mm/s] */ - s32 y; /**< Velocity ECEF Y coordinate [mm/s] */ - s32 z; /**< Velocity ECEF Z coordinate [mm/s] */ - u16 accuracy; /**< Velocity estimated standard deviation [mm/s] */ - u8 n_sats; /**< Number of satellites used in solution */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 x; /**< Velocity ECEF X coordinate [mm/s] */ + s32 y; /**< Velocity ECEF Y coordinate [mm/s] */ + s32 z; /**< Velocity ECEF Z coordinate [mm/s] */ + u16 accuracy; /**< Velocity estimated standard deviation [mm/s] */ + u8 n_sats; /**< Number of satellites used in solution */ + u8 flags; /**< Status flags */ } msg_vel_ecef_t; - /** Velocity in ECEF with Covariances * * This message reports the velocity in Earth Centered Earth Fixed (ECEF) @@ -449,21 +434,20 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 x; /**< Velocity ECEF X coordinate [mm/s] */ - s32 y; /**< Velocity ECEF Y coordinate [mm/s] */ - s32 z; /**< Velocity ECEF Z coordinate [mm/s] */ - float cov_x_x; /**< Estimated variance of x [m^2/s^2] */ - float cov_x_y; /**< Estimated covariance of x and y [m^2/s^2] */ - float cov_x_z; /**< Estimated covariance of x and z [m^2/s^2] */ - float cov_y_y; /**< Estimated variance of y [m^2/s^2] */ - float cov_y_z; /**< Estimated covariance of y and z [m^2/s^2] */ - float cov_z_z; /**< Estimated variance of z [m^2/s^2] */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 x; /**< Velocity ECEF X coordinate [mm/s] */ + s32 y; /**< Velocity ECEF Y coordinate [mm/s] */ + s32 z; /**< Velocity ECEF Z coordinate [mm/s] */ + float cov_x_x; /**< Estimated variance of x [m^2/s^2] */ + float cov_x_y; /**< Estimated covariance of x and y [m^2/s^2] */ + float cov_x_z; /**< Estimated covariance of x and z [m^2/s^2] */ + float cov_y_y; /**< Estimated variance of y [m^2/s^2] */ + float cov_y_z; /**< Estimated covariance of y and z [m^2/s^2] */ + float cov_z_z; /**< Estimated variance of z [m^2/s^2] */ u8 n_sats; /**< Number of satellites used in solution */ u8 flags; /**< Status flags */ } msg_vel_ecef_cov_t; - /** Velocity in NED * * This message reports the velocity in local North East Down (NED) @@ -477,17 +461,17 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 n; /**< Velocity North coordinate [mm/s] */ - s32 e; /**< Velocity East coordinate [mm/s] */ - s32 d; /**< Velocity Down coordinate [mm/s] */ - u16 h_accuracy; /**< Horizontal velocity estimated standard deviation [mm/s] */ - u16 v_accuracy; /**< Vertical velocity estimated standard deviation [mm/s] */ - u8 n_sats; /**< Number of satellites used in solution */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 n; /**< Velocity North coordinate [mm/s] */ + s32 e; /**< Velocity East coordinate [mm/s] */ + s32 d; /**< Velocity Down coordinate [mm/s] */ + u16 h_accuracy; /**< Horizontal velocity estimated standard deviation [mm/s] + */ + u16 v_accuracy; /**< Vertical velocity estimated standard deviation [mm/s] */ + u8 n_sats; /**< Number of satellites used in solution */ + u8 flags; /**< Status flags */ } msg_vel_ned_t; - /** Velocity in NED with Covariances * * This message reports the velocity in local North East Down (NED) @@ -503,21 +487,20 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 n; /**< Velocity North coordinate [mm/s] */ - s32 e; /**< Velocity East coordinate [mm/s] */ - s32 d; /**< Velocity Down coordinate [mm/s] */ - float cov_n_n; /**< Estimated variance of northward measurement [m^2] */ - float cov_n_e; /**< Covariance of northward and eastward measurement [m^2] */ - float cov_n_d; /**< Covariance of northward and downward measurement [m^2] */ - float cov_e_e; /**< Estimated variance of eastward measurement [m^2] */ - float cov_e_d; /**< Covariance of eastward and downward measurement [m^2] */ - float cov_d_d; /**< Estimated variance of downward measurement [m^2] */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 n; /**< Velocity North coordinate [mm/s] */ + s32 e; /**< Velocity East coordinate [mm/s] */ + s32 d; /**< Velocity Down coordinate [mm/s] */ + float cov_n_n; /**< Estimated variance of northward measurement [m^2] */ + float cov_n_e; /**< Covariance of northward and eastward measurement [m^2] */ + float cov_n_d; /**< Covariance of northward and downward measurement [m^2] */ + float cov_e_e; /**< Estimated variance of eastward measurement [m^2] */ + float cov_e_d; /**< Covariance of eastward and downward measurement [m^2] */ + float cov_d_d; /**< Estimated variance of downward measurement [m^2] */ u8 n_sats; /**< Number of satellites used in solution */ u8 flags; /**< Status flags */ } msg_vel_ned_cov_t; - /** GNSS-only Position in ECEF * * The position solution message reports absolute Earth Centered Earth Fixed @@ -533,16 +516,15 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - double x; /**< ECEF X coordinate [m] */ - double y; /**< ECEF Y coordinate [m] */ - double z; /**< ECEF Z coordinate [m] */ - u16 accuracy; /**< Position estimated standard deviation [mm] */ - u8 n_sats; /**< Number of satellites used in solution */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + double x; /**< ECEF X coordinate [m] */ + double y; /**< ECEF Y coordinate [m] */ + double z; /**< ECEF Z coordinate [m] */ + u16 accuracy; /**< Position estimated standard deviation [mm] */ + u8 n_sats; /**< Number of satellites used in solution */ + u8 flags; /**< Status flags */ } msg_pos_ecef_gnss_t; - /** GNSS-only Position in ECEF with Covariances * * The position solution message reports absolute Earth Centered Earth Fixed @@ -559,21 +541,20 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - double x; /**< ECEF X coordinate [m] */ - double y; /**< ECEF Y coordinate [m] */ - double z; /**< ECEF Z coordinate [m] */ - float cov_x_x; /**< Estimated variance of x [m^2] */ - float cov_x_y; /**< Estimated covariance of x and y [m^2] */ - float cov_x_z; /**< Estimated covariance of x and z [m^2] */ - float cov_y_y; /**< Estimated variance of y [m^2] */ - float cov_y_z; /**< Estimated covariance of y and z [m^2] */ - float cov_z_z; /**< Estimated variance of z [m^2] */ + u32 tow; /**< GPS Time of Week [ms] */ + double x; /**< ECEF X coordinate [m] */ + double y; /**< ECEF Y coordinate [m] */ + double z; /**< ECEF Z coordinate [m] */ + float cov_x_x; /**< Estimated variance of x [m^2] */ + float cov_x_y; /**< Estimated covariance of x and y [m^2] */ + float cov_x_z; /**< Estimated covariance of x and z [m^2] */ + float cov_y_y; /**< Estimated variance of y [m^2] */ + float cov_y_z; /**< Estimated covariance of y and z [m^2] */ + float cov_z_z; /**< Estimated variance of z [m^2] */ u8 n_sats; /**< Number of satellites used in solution */ u8 flags; /**< Status flags */ } msg_pos_ecef_cov_gnss_t; - /** GNSS-only Geodetic Position * * This position solution message reports the absolute geodetic coordinates @@ -589,17 +570,16 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - double lat; /**< Latitude [deg] */ - double lon; /**< Longitude [deg] */ - double height; /**< Height above WGS84 ellipsoid [m] */ - u16 h_accuracy; /**< Horizontal position estimated standard deviation [mm] */ - u16 v_accuracy; /**< Vertical position estimated standard deviation [mm] */ - u8 n_sats; /**< Number of satellites used in solution. */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + double lat; /**< Latitude [deg] */ + double lon; /**< Longitude [deg] */ + double height; /**< Height above WGS84 ellipsoid [m] */ + u16 h_accuracy; /**< Horizontal position estimated standard deviation [mm] */ + u16 v_accuracy; /**< Vertical position estimated standard deviation [mm] */ + u8 n_sats; /**< Number of satellites used in solution. */ + u8 flags; /**< Status flags */ } msg_pos_llh_gnss_t; - /** GNSS-only Geodetic Position with Covariances * * This position solution message reports the absolute geodetic coordinates @@ -616,21 +596,20 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - double lat; /**< Latitude [deg] */ - double lon; /**< Longitude [deg] */ - double height; /**< Height above WGS84 ellipsoid [m] */ - float cov_n_n; /**< Estimated variance of northing [m^2] */ - float cov_n_e; /**< Covariance of northing and easting [m^2] */ - float cov_n_d; /**< Covariance of northing and downward measurement [m^2] */ - float cov_e_e; /**< Estimated variance of easting [m^2] */ - float cov_e_d; /**< Covariance of easting and downward measurement [m^2] */ - float cov_d_d; /**< Estimated variance of downward measurement [m^2] */ + u32 tow; /**< GPS Time of Week [ms] */ + double lat; /**< Latitude [deg] */ + double lon; /**< Longitude [deg] */ + double height; /**< Height above WGS84 ellipsoid [m] */ + float cov_n_n; /**< Estimated variance of northing [m^2] */ + float cov_n_e; /**< Covariance of northing and easting [m^2] */ + float cov_n_d; /**< Covariance of northing and downward measurement [m^2] */ + float cov_e_e; /**< Estimated variance of easting [m^2] */ + float cov_e_d; /**< Covariance of easting and downward measurement [m^2] */ + float cov_d_d; /**< Estimated variance of downward measurement [m^2] */ u8 n_sats; /**< Number of satellites used in solution. */ u8 flags; /**< Status flags */ } msg_pos_llh_cov_gnss_t; - /** GNSS-only Velocity in ECEF * * This message reports the velocity in Earth Centered Earth Fixed (ECEF) @@ -642,16 +621,15 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 x; /**< Velocity ECEF X coordinate [mm/s] */ - s32 y; /**< Velocity ECEF Y coordinate [mm/s] */ - s32 z; /**< Velocity ECEF Z coordinate [mm/s] */ - u16 accuracy; /**< Velocity estimated standard deviation [mm/s] */ - u8 n_sats; /**< Number of satellites used in solution */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 x; /**< Velocity ECEF X coordinate [mm/s] */ + s32 y; /**< Velocity ECEF Y coordinate [mm/s] */ + s32 z; /**< Velocity ECEF Z coordinate [mm/s] */ + u16 accuracy; /**< Velocity estimated standard deviation [mm/s] */ + u8 n_sats; /**< Number of satellites used in solution */ + u8 flags; /**< Status flags */ } msg_vel_ecef_gnss_t; - /** GNSS-only Velocity in ECEF with Covariances * * This message reports the velocity in Earth Centered Earth Fixed (ECEF) @@ -663,21 +641,20 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 x; /**< Velocity ECEF X coordinate [mm/s] */ - s32 y; /**< Velocity ECEF Y coordinate [mm/s] */ - s32 z; /**< Velocity ECEF Z coordinate [mm/s] */ - float cov_x_x; /**< Estimated variance of x [m^2/s^2] */ - float cov_x_y; /**< Estimated covariance of x and y [m^2/s^2] */ - float cov_x_z; /**< Estimated covariance of x and z [m^2/s^2] */ - float cov_y_y; /**< Estimated variance of y [m^2/s^2] */ - float cov_y_z; /**< Estimated covariance of y and z [m^2/s^2] */ - float cov_z_z; /**< Estimated variance of z [m^2/s^2] */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 x; /**< Velocity ECEF X coordinate [mm/s] */ + s32 y; /**< Velocity ECEF Y coordinate [mm/s] */ + s32 z; /**< Velocity ECEF Z coordinate [mm/s] */ + float cov_x_x; /**< Estimated variance of x [m^2/s^2] */ + float cov_x_y; /**< Estimated covariance of x and y [m^2/s^2] */ + float cov_x_z; /**< Estimated covariance of x and z [m^2/s^2] */ + float cov_y_y; /**< Estimated variance of y [m^2/s^2] */ + float cov_y_z; /**< Estimated covariance of y and z [m^2/s^2] */ + float cov_z_z; /**< Estimated variance of z [m^2/s^2] */ u8 n_sats; /**< Number of satellites used in solution */ u8 flags; /**< Status flags */ } msg_vel_ecef_cov_gnss_t; - /** GNSS-only Velocity in NED * * This message reports the velocity in local North East Down (NED) @@ -690,17 +667,17 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 n; /**< Velocity North coordinate [mm/s] */ - s32 e; /**< Velocity East coordinate [mm/s] */ - s32 d; /**< Velocity Down coordinate [mm/s] */ - u16 h_accuracy; /**< Horizontal velocity estimated standard deviation [mm/s] */ - u16 v_accuracy; /**< Vertical velocity estimated standard deviation [mm/s] */ - u8 n_sats; /**< Number of satellites used in solution */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 n; /**< Velocity North coordinate [mm/s] */ + s32 e; /**< Velocity East coordinate [mm/s] */ + s32 d; /**< Velocity Down coordinate [mm/s] */ + u16 h_accuracy; /**< Horizontal velocity estimated standard deviation [mm/s] + */ + u16 v_accuracy; /**< Vertical velocity estimated standard deviation [mm/s] */ + u8 n_sats; /**< Number of satellites used in solution */ + u8 flags; /**< Status flags */ } msg_vel_ned_gnss_t; - /** GNSS-only Velocity in NED with Covariances * * This message reports the velocity in local North East Down (NED) @@ -715,21 +692,20 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 n; /**< Velocity North coordinate [mm/s] */ - s32 e; /**< Velocity East coordinate [mm/s] */ - s32 d; /**< Velocity Down coordinate [mm/s] */ - float cov_n_n; /**< Estimated variance of northward measurement [m^2] */ - float cov_n_e; /**< Covariance of northward and eastward measurement [m^2] */ - float cov_n_d; /**< Covariance of northward and downward measurement [m^2] */ - float cov_e_e; /**< Estimated variance of eastward measurement [m^2] */ - float cov_e_d; /**< Covariance of eastward and downward measurement [m^2] */ - float cov_d_d; /**< Estimated variance of downward measurement [m^2] */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 n; /**< Velocity North coordinate [mm/s] */ + s32 e; /**< Velocity East coordinate [mm/s] */ + s32 d; /**< Velocity Down coordinate [mm/s] */ + float cov_n_n; /**< Estimated variance of northward measurement [m^2] */ + float cov_n_e; /**< Covariance of northward and eastward measurement [m^2] */ + float cov_n_d; /**< Covariance of northward and downward measurement [m^2] */ + float cov_e_e; /**< Estimated variance of eastward measurement [m^2] */ + float cov_e_d; /**< Covariance of eastward and downward measurement [m^2] */ + float cov_d_d; /**< Estimated variance of downward measurement [m^2] */ u8 n_sats; /**< Number of satellites used in solution */ u8 flags; /**< Status flags */ } msg_vel_ned_cov_gnss_t; - /** Velocity in User Frame * * This message reports the velocity in the Vehicle Body Frame. By convention, @@ -747,21 +723,20 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 x; /**< Velocity in x direction [mm/s] */ - s32 y; /**< Velocity in y direction [mm/s] */ - s32 z; /**< Velocity in z direction [mm/s] */ - float cov_x_x; /**< Estimated variance of x [m^2] */ - float cov_x_y; /**< Covariance of x and y [m^2] */ - float cov_x_z; /**< Covariance of x and z [m^2] */ - float cov_y_y; /**< Estimated variance of y [m^2] */ - float cov_y_z; /**< Covariance of y and z [m^2] */ - float cov_z_z; /**< Estimated variance of z [m^2] */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 x; /**< Velocity in x direction [mm/s] */ + s32 y; /**< Velocity in y direction [mm/s] */ + s32 z; /**< Velocity in z direction [mm/s] */ + float cov_x_x; /**< Estimated variance of x [m^2] */ + float cov_x_y; /**< Covariance of x and y [m^2] */ + float cov_x_z; /**< Covariance of x and z [m^2] */ + float cov_y_y; /**< Estimated variance of y [m^2] */ + float cov_y_z; /**< Covariance of y and z [m^2] */ + float cov_z_z; /**< Estimated variance of z [m^2] */ u8 n_sats; /**< Number of satellites used in solution */ u8 flags; /**< Status flags */ } msg_vel_body_t; - /** Velocity expressed as course over ground * * This message reports the receiver course over ground (COG) and speed over @@ -781,17 +756,19 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - u32 cog; /**< Course over ground relative to north direction [microdegrees] */ - u32 sog; /**< Speed over ground (based on horizontal velocity) [mm/s] */ - s32 v_up; /**< Vertical velocity component (positive up) [mm/s] */ - u32 cog_accuracy; /**< Course over ground estimated standard deviation [microdegrees] */ - u32 sog_accuracy; /**< Speed over ground estimated standard deviation [mm/s] */ - u32 v_up_accuracy; /**< Vertical velocity estimated standard deviation [mm/s] */ - u16 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + u32 cog; /**< Course over ground relative to north direction [microdegrees] */ + u32 sog; /**< Speed over ground (based on horizontal velocity) [mm/s] */ + s32 v_up; /**< Vertical velocity component (positive up) [mm/s] */ + u32 cog_accuracy; /**< Course over ground estimated standard deviation + [microdegrees] */ + u32 sog_accuracy; /**< Speed over ground estimated standard deviation [mm/s] + */ + u32 v_up_accuracy; /**< Vertical velocity estimated standard deviation [mm/s] + */ + u16 flags; /**< Status flags */ } msg_vel_cog_t; - /** Age of corrections * * This message reports the Age of the corrections used for the current @@ -799,160 +776,151 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - u16 age; /**< Age of the corrections (0xFFFF indicates invalid) [deciseconds] */ + u32 tow; /**< GPS Time of Week [ms] */ + u16 age; /**< Age of the corrections (0xFFFF indicates invalid) [deciseconds] + */ } msg_age_corrections_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u16 wn; /**< GPS week number [weeks] */ - u32 tow; /**< GPS time of week rounded to the nearest millisecond [ms] */ - s32 ns_residual; /**< Nanosecond residual of millisecond-rounded TOW - (ranges from -500000 to 500000) [ns] */ - u8 flags; /**< Status flags (reserved) */ + u16 wn; /**< GPS week number [weeks] */ + u32 tow; /**< GPS time of week rounded to the nearest millisecond [ms] */ + s32 ns_residual; /**< Nanosecond residual of millisecond-rounded TOW + (ranges from -500000 to 500000) [ns] */ + u8 flags; /**< Status flags (reserved) */ } msg_gps_time_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - u16 gdop; /**< Geometric Dilution of Precision [0.01] */ - u16 pdop; /**< Position Dilution of Precision [0.01] */ - u16 tdop; /**< Time Dilution of Precision [0.01] */ - u16 hdop; /**< Horizontal Dilution of Precision [0.01] */ - u16 vdop; /**< Vertical Dilution of Precision [0.01] */ + u32 tow; /**< GPS Time of Week [ms] */ + u16 gdop; /**< Geometric Dilution of Precision [0.01] */ + u16 pdop; /**< Position Dilution of Precision [0.01] */ + u16 tdop; /**< Time Dilution of Precision [0.01] */ + u16 hdop; /**< Horizontal Dilution of Precision [0.01] */ + u16 vdop; /**< Vertical Dilution of Precision [0.01] */ } msg_dops_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - double x; /**< ECEF X coordinate [m] */ - double y; /**< ECEF Y coordinate [m] */ - double z; /**< ECEF Z coordinate [m] */ - u16 accuracy; /**< Position accuracy estimate (not implemented). Defaults - to 0. [mm] */ - u8 n_sats; /**< Number of satellites used in solution */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + double x; /**< ECEF X coordinate [m] */ + double y; /**< ECEF Y coordinate [m] */ + double z; /**< ECEF Z coordinate [m] */ + u16 accuracy; /**< Position accuracy estimate (not implemented). Defaults + to 0. [mm] */ + u8 n_sats; /**< Number of satellites used in solution */ + u8 flags; /**< Status flags */ } msg_pos_ecef_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - double lat; /**< Latitude [deg] */ - double lon; /**< Longitude [deg] */ - double height; /**< Height [m] */ - u16 h_accuracy; /**< Horizontal position accuracy estimate (not - implemented). Defaults to 0. [mm] */ - u16 v_accuracy; /**< Vertical position accuracy estimate (not - implemented). Defaults to 0. [mm] */ - u8 n_sats; /**< Number of satellites used in solution. */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + double lat; /**< Latitude [deg] */ + double lon; /**< Longitude [deg] */ + double height; /**< Height [m] */ + u16 h_accuracy; /**< Horizontal position accuracy estimate (not + implemented). Defaults to 0. [mm] */ + u16 v_accuracy; /**< Vertical position accuracy estimate (not + implemented). Defaults to 0. [mm] */ + u8 n_sats; /**< Number of satellites used in solution. */ + u8 flags; /**< Status flags */ } msg_pos_llh_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 x; /**< Baseline ECEF X coordinate [mm] */ - s32 y; /**< Baseline ECEF Y coordinate [mm] */ - s32 z; /**< Baseline ECEF Z coordinate [mm] */ - u16 accuracy; /**< Position accuracy estimate [mm] */ - u8 n_sats; /**< Number of satellites used in solution */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 x; /**< Baseline ECEF X coordinate [mm] */ + s32 y; /**< Baseline ECEF Y coordinate [mm] */ + s32 z; /**< Baseline ECEF Z coordinate [mm] */ + u16 accuracy; /**< Position accuracy estimate [mm] */ + u8 n_sats; /**< Number of satellites used in solution */ + u8 flags; /**< Status flags */ } msg_baseline_ecef_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 n; /**< Baseline North coordinate [mm] */ - s32 e; /**< Baseline East coordinate [mm] */ - s32 d; /**< Baseline Down coordinate [mm] */ - u16 h_accuracy; /**< Horizontal position accuracy estimate (not - implemented). Defaults to 0. [mm] */ - u16 v_accuracy; /**< Vertical position accuracy estimate (not - implemented). Defaults to 0. [mm] */ - u8 n_sats; /**< Number of satellites used in solution */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 n; /**< Baseline North coordinate [mm] */ + s32 e; /**< Baseline East coordinate [mm] */ + s32 d; /**< Baseline Down coordinate [mm] */ + u16 h_accuracy; /**< Horizontal position accuracy estimate (not + implemented). Defaults to 0. [mm] */ + u16 v_accuracy; /**< Vertical position accuracy estimate (not + implemented). Defaults to 0. [mm] */ + u8 n_sats; /**< Number of satellites used in solution */ + u8 flags; /**< Status flags */ } msg_baseline_ned_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 x; /**< Velocity ECEF X coordinate [mm/s] */ - s32 y; /**< Velocity ECEF Y coordinate [mm/s] */ - s32 z; /**< Velocity ECEF Z coordinate [mm/s] */ - u16 accuracy; /**< Velocity accuracy estimate (not implemented). Defaults - to 0. [mm/s] */ - u8 n_sats; /**< Number of satellites used in solution */ - u8 flags; /**< Status flags (reserved) */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 x; /**< Velocity ECEF X coordinate [mm/s] */ + s32 y; /**< Velocity ECEF Y coordinate [mm/s] */ + s32 z; /**< Velocity ECEF Z coordinate [mm/s] */ + u16 accuracy; /**< Velocity accuracy estimate (not implemented). Defaults + to 0. [mm/s] */ + u8 n_sats; /**< Number of satellites used in solution */ + u8 flags; /**< Status flags (reserved) */ } msg_vel_ecef_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 n; /**< Velocity North coordinate [mm/s] */ - s32 e; /**< Velocity East coordinate [mm/s] */ - s32 d; /**< Velocity Down coordinate [mm/s] */ - u16 h_accuracy; /**< Horizontal velocity accuracy estimate (not - implemented). Defaults to 0. [mm/s] */ - u16 v_accuracy; /**< Vertical velocity accuracy estimate (not - implemented). Defaults to 0. [mm/s] */ - u8 n_sats; /**< Number of satellites used in solution */ - u8 flags; /**< Status flags (reserved) */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 n; /**< Velocity North coordinate [mm/s] */ + s32 e; /**< Velocity East coordinate [mm/s] */ + s32 d; /**< Velocity Down coordinate [mm/s] */ + u16 h_accuracy; /**< Horizontal velocity accuracy estimate (not + implemented). Defaults to 0. [mm/s] */ + u16 v_accuracy; /**< Vertical velocity accuracy estimate (not + implemented). Defaults to 0. [mm/s] */ + u8 n_sats; /**< Number of satellites used in solution */ + u8 flags; /**< Status flags (reserved) */ } msg_vel_ned_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - u32 heading; /**< Heading [mdeg] */ - u8 n_sats; /**< Number of satellites used in solution */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + u32 heading; /**< Heading [mdeg] */ + u8 n_sats; /**< Number of satellites used in solution */ + u8 flags; /**< Status flags */ } msg_baseline_heading_dep_a_t; - /** Deprecated * * Deprecated. @@ -962,13 +930,12 @@ typedef struct SBP_ATTR_PACKED { u32 tow; /**< GPS Time of Week [ms] */ u16 vpl; /**< Vertical protection level [cm] */ u16 hpl; /**< Horizontal protection level [cm] */ - double lat; /**< Latitude [deg] */ - double lon; /**< Longitude [deg] */ - double height; /**< Height [m] */ - u8 flags; /**< Status flags */ + double lat; /**< Latitude [deg] */ + double lon; /**< Longitude [deg] */ + double height; /**< Height [m] */ + u8 flags; /**< Status flags */ } msg_protection_level_dep_a_t; - /** Computed state and Protection Levels * * This message reports the protection levels associated to the given state @@ -977,33 +944,32 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s16 wn; /**< GPS week number [weeks] */ - u16 hpl; /**< Horizontal protection level [cm] */ - u16 vpl; /**< Vertical protection level [cm] */ - u16 atpl; /**< Along-track position error protection level [cm] */ - u16 ctpl; /**< Cross-track position error protection level [cm] */ - u16 hvpl; /**< Protection level for the error vector between estimated - and true along/cross track velocity vector [mm/s] */ - u16 vvpl; /**< Protection level for the velocity in vehicle upright - direction (different from vertical direction if on a - slope) [mm/s] */ - u16 hopl; /**< Heading orientation protection level [mdeg] */ - u16 popl; /**< Pitch orientation protection level [mdeg] */ - u16 ropl; /**< Roll orientation protection level [mdeg] */ - double lat; /**< Latitude [deg] */ - double lon; /**< Longitude [deg] */ - double height; /**< Height [m] */ - s32 v_x; /**< Velocity in vehicle x direction [mm/s] */ - s32 v_y; /**< Velocity in vehicle y direction [mm/s] */ - s32 v_z; /**< Velocity in vehicle z direction [mm/s] */ - s32 roll; /**< Roll angle [udeg] */ - s32 pitch; /**< Pitch angle [udeg] */ - s32 heading; /**< Heading angle [udeg] */ - u32 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + s16 wn; /**< GPS week number [weeks] */ + u16 hpl; /**< Horizontal protection level [cm] */ + u16 vpl; /**< Vertical protection level [cm] */ + u16 atpl; /**< Along-track position error protection level [cm] */ + u16 ctpl; /**< Cross-track position error protection level [cm] */ + u16 hvpl; /**< Protection level for the error vector between estimated + and true along/cross track velocity vector [mm/s] */ + u16 vvpl; /**< Protection level for the velocity in vehicle upright + direction (different from vertical direction if on a + slope) [mm/s] */ + u16 hopl; /**< Heading orientation protection level [mdeg] */ + u16 popl; /**< Pitch orientation protection level [mdeg] */ + u16 ropl; /**< Roll orientation protection level [mdeg] */ + double lat; /**< Latitude [deg] */ + double lon; /**< Longitude [deg] */ + double height; /**< Height [m] */ + s32 v_x; /**< Velocity in vehicle x direction [mm/s] */ + s32 v_y; /**< Velocity in vehicle y direction [mm/s] */ + s32 v_z; /**< Velocity in vehicle z direction [mm/s] */ + s32 roll; /**< Roll angle [udeg] */ + s32 pitch; /**< Pitch angle [udeg] */ + s32 heading; /**< Heading angle [udeg] */ + u32 flags; /**< Status flags */ } msg_protection_level_t; - /** Leap second SBP message. * @@ -1012,45 +978,48 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - s16 reserved_0; /**< Reserved. */ - s16 reserved_1; /**< Reserved. */ - s8 reserved_2; /**< Reserved. */ - s8 count_before; /**< Leap second count before insertion. [s] */ - u16 reserved_3; /**< Reserved. */ - u16 reserved_4; /**< Reserved. */ - u16 ref_wn; /**< Leap second reference GPS week number. [weeks] */ - u8 ref_dn; /**< Leap second reference day number. [days] */ - s8 count_after; /**< Leap second count after insertion. [s] */ + s16 reserved_0; /**< Reserved. */ + s16 reserved_1; /**< Reserved. */ + s8 reserved_2; /**< Reserved. */ + s8 count_before; /**< Leap second count before insertion. [s] */ + u16 reserved_3; /**< Reserved. */ + u16 reserved_4; /**< Reserved. */ + u16 ref_wn; /**< Leap second reference GPS week number. [weeks] */ + u8 ref_dn; /**< Leap second reference day number. [days] */ + s8 count_after; /**< Leap second count after insertion. [s] */ } msg_utc_leap_second_t; - - typedef struct SBP_ATTR_PACKED { - u8 ssr_iod; /**< SSR IOD parameter. */ - char sn[32]; /**< Name of source coordinate-system. */ - char tn[32]; /**< Name of target coordinate-system. */ - u8 sin; /**< System Identification Number. */ - u16 utn; /**< Utilized Transformation Message. */ - u16 re_t0; /**< Reference Epoch t0 for transformation parameter - set given as Modified Julian Day (MJD) Number - minus 44244 days. [1 day] */ - s32 delta_X0; /**< Translation in X for Reference Epoch t0. [0.001 m] */ - s32 delta_Y0; /**< Translation in Y for Reference Epoch t0. [0.001 m] */ - s32 delta_Z0; /**< Translation in Z for Reference Epoch t0. [0.001 m] */ - s32 theta_01; /**< Rotation around the X-axis for Reference Epoch t0. [0.00002 "] */ - s32 theta_02; /**< Rotation around the Y-axis for Reference Epoch t0. [0.00002 "] */ - s32 theta_03; /**< Rotation around the Z-axis for Reference Epoch t0. [0.00002 "] */ - s32 scale; /**< Scale correction for Reference Epoch t0. [0.00001 ppm] */ - s32 dot_delta_X0; /**< Rate of change of translation in X. [0.00002 m/yr] */ - s32 dot_delta_Y0; /**< Rate of change of translation in Y. [0.00002 m/yr] */ - s32 dot_delta_Z0; /**< Rate of change of translation in Z. [0.00002 m/yr] */ - s32 dot_theta_01; /**< Rate of change of rotation around the X-axis. [0.0000004 "/yr] */ - s32 dot_theta_02; /**< Rate of change of rotation around the Y-axis. [0.0000004 "/yr] */ - s32 dot_theta_03; /**< Rate of change of rotation around the Z-axis. [0.0000004 "/yr] */ - s16 dot_scale; /**< Rate of change of scale correction. [0.0000002 ppm/yr] */ + u8 ssr_iod; /**< SSR IOD parameter. */ + char sn[32]; /**< Name of source coordinate-system. */ + char tn[32]; /**< Name of target coordinate-system. */ + u8 sin; /**< System Identification Number. */ + u16 utn; /**< Utilized Transformation Message. */ + u16 re_t0; /**< Reference Epoch t0 for transformation parameter + set given as Modified Julian Day (MJD) Number + minus 44244 days. [1 day] */ + s32 delta_X0; /**< Translation in X for Reference Epoch t0. [0.001 m] */ + s32 delta_Y0; /**< Translation in Y for Reference Epoch t0. [0.001 m] */ + s32 delta_Z0; /**< Translation in Z for Reference Epoch t0. [0.001 m] */ + s32 theta_01; /**< Rotation around the X-axis for Reference Epoch t0. [0.00002 + "] */ + s32 theta_02; /**< Rotation around the Y-axis for Reference Epoch t0. [0.00002 + "] */ + s32 theta_03; /**< Rotation around the Z-axis for Reference Epoch t0. [0.00002 + "] */ + s32 scale; /**< Scale correction for Reference Epoch t0. [0.00001 ppm] */ + s32 dot_delta_X0; /**< Rate of change of translation in X. [0.00002 m/yr] */ + s32 dot_delta_Y0; /**< Rate of change of translation in Y. [0.00002 m/yr] */ + s32 dot_delta_Z0; /**< Rate of change of translation in Z. [0.00002 m/yr] */ + s32 dot_theta_01; /**< Rate of change of rotation around the X-axis. + [0.0000004 "/yr] */ + s32 dot_theta_02; /**< Rate of change of rotation around the Y-axis. + [0.0000004 "/yr] */ + s32 dot_theta_03; /**< Rate of change of rotation around the Z-axis. + [0.0000004 "/yr] */ + s16 dot_scale; /**< Rate of change of scale correction. [0.0000002 ppm/yr] */ } msg_reference_frame_param_t; - /** Relative Pose * * This solution message reports the relative pose of a sensor between two @@ -1063,36 +1032,35 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - u8 sensor_id; /**< ID of the sensor producing this message */ - u32 timestamp_1; /**< Timestamp of first keyframe [ms] */ - u32 timestamp_2; /**< Timestamp of second keyframe [ms] */ - s32 trans[3]; /**< Relative translation [x,y,z] described in first - keyframe [mm] */ - s32 w; /**< Real component of quaternion to describe relative - rotation (second to first keyframe) [2^-31] */ - s32 x; /**< 1st imaginary component of quaternion to describe - relative rotation (second to first keyframe) [2^-31] */ - s32 y; /**< 2nd imaginary component of quaternion to describe - relative rotation (second to first keyframe) [2^-31] */ - s32 z; /**< 3rd imaginary component of quaternion to describe - relative rotation (second to first keyframe) [2^-31] */ - float cov_r_x_x; /**< Estimated variance of x (relative translation) [m^2] */ - float cov_r_x_y; /**< Covariance of x and y (relative translation) [m^2] */ - float cov_r_x_z; /**< Covariance of x and z (relative translation) [m^2] */ - float cov_r_y_y; /**< Estimated variance of y (relative translation) [m^2] */ - float cov_r_y_z; /**< Covariance of y and z (relative translation) [m^2] */ - float cov_r_z_z; /**< Estimated variance of z (relative translation) [m^2] */ - float cov_c_x_x; /**< Estimated variance of x (relative rotation) [rad^2] */ - float cov_c_x_y; /**< Covariance of x and y (relative rotation) [rad^2] */ - float cov_c_x_z; /**< Covariance of x and z (relative rotation) [rad^2] */ - float cov_c_y_y; /**< Estimated variance of y (relative rotation) [rad^2] */ - float cov_c_y_z; /**< Covariance of y and z (relative rotation) [rad^2] */ - float cov_c_z_z; /**< Estimated variance of z (relative rotation) [rad^2] */ - u8 flags; /**< Status flags of relative translation and rotation */ + u32 tow; /**< GPS Time of Week [ms] */ + u8 sensor_id; /**< ID of the sensor producing this message */ + u32 timestamp_1; /**< Timestamp of first keyframe [ms] */ + u32 timestamp_2; /**< Timestamp of second keyframe [ms] */ + s32 trans[3]; /**< Relative translation [x,y,z] described in first + keyframe [mm] */ + s32 w; /**< Real component of quaternion to describe relative + rotation (second to first keyframe) [2^-31] */ + s32 x; /**< 1st imaginary component of quaternion to describe + relative rotation (second to first keyframe) [2^-31] */ + s32 y; /**< 2nd imaginary component of quaternion to describe + relative rotation (second to first keyframe) [2^-31] */ + s32 z; /**< 3rd imaginary component of quaternion to describe + relative rotation (second to first keyframe) [2^-31] */ + float cov_r_x_x; /**< Estimated variance of x (relative translation) [m^2] */ + float cov_r_x_y; /**< Covariance of x and y (relative translation) [m^2] */ + float cov_r_x_z; /**< Covariance of x and z (relative translation) [m^2] */ + float cov_r_y_y; /**< Estimated variance of y (relative translation) [m^2] */ + float cov_r_y_z; /**< Covariance of y and z (relative translation) [m^2] */ + float cov_r_z_z; /**< Estimated variance of z (relative translation) [m^2] */ + float cov_c_x_x; /**< Estimated variance of x (relative rotation) [rad^2] */ + float cov_c_x_y; /**< Covariance of x and y (relative rotation) [rad^2] */ + float cov_c_x_z; /**< Covariance of x and z (relative rotation) [rad^2] */ + float cov_c_y_y; /**< Estimated variance of y (relative rotation) [rad^2] */ + float cov_c_y_z; /**< Covariance of y and z (relative rotation) [rad^2] */ + float cov_c_z_z; /**< Estimated variance of z (relative rotation) [rad^2] */ + u8 flags; /**< Status flags of relative translation and rotation */ } msg_pose_relative_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/ndb.h b/c/include/libsbp/legacy/ndb.h index 08e3a70f4..7c9b2afcc 100644 --- a/c/include/libsbp/legacy/ndb.h +++ b/c/include/libsbp/legacy/ndb.h @@ -25,17 +25,17 @@ #include -#include #include +#include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Navigation DataBase Event * * This message is sent out when an object is stored into NDB. If needed @@ -43,32 +43,31 @@ SBP_PACK_START */ typedef struct SBP_ATTR_PACKED { - u64 recv_time; /**< HW time in milliseconds. [ms] */ - u8 event; /**< Event type. */ - u8 object_type; /**< Event object type. */ - u8 result; /**< Event result. */ - u8 data_source; /**< Data source for STORE event, reserved for other - events. */ - sbp_gnss_signal_t object_sid; /**< GNSS signal identifier, If - object_type is Ephemeris OR - Almanac, sid indicates for which - signal the object belongs to. - Reserved in other cases. */ - sbp_gnss_signal_t src_sid; /**< GNSS signal identifier, If - object_type is Almanac, Almanac - WN, Iono OR L2C capabilities AND - data_source is NDB_DS_RECEIVER - sid indicates from which SV data - was decoded. Reserved in other - cases. */ - u16 original_sender; /**< A unique identifier of the sending hardware. - For v1.0, set to the 2 least significant bytes - of the device serial number, valid only if - data_source is NDB_DS_SBP. Reserved in case of - other data_source. */ + u64 recv_time; /**< HW time in milliseconds. [ms] */ + u8 event; /**< Event type. */ + u8 object_type; /**< Event object type. */ + u8 result; /**< Event result. */ + u8 data_source; /**< Data source for STORE event, reserved for other + events. */ + sbp_gnss_signal_t object_sid; /**< GNSS signal identifier, If + object_type is Ephemeris OR + Almanac, sid indicates for which + signal the object belongs to. + Reserved in other cases. */ + sbp_gnss_signal_t src_sid; /**< GNSS signal identifier, If + object_type is Almanac, Almanac + WN, Iono OR L2C capabilities AND + data_source is NDB_DS_RECEIVER + sid indicates from which SV data + was decoded. Reserved in other + cases. */ + u16 original_sender; /**< A unique identifier of the sending hardware. + For v1.0, set to the 2 least significant bytes + of the device serial number, valid only if + data_source is NDB_DS_SBP. Reserved in case of + other data_source. */ } msg_ndb_event_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/observation.h b/c/include/libsbp/legacy/observation.h index 89972e335..24a9374d3 100644 --- a/c/include/libsbp/legacy/observation.h +++ b/c/include/libsbp/legacy/observation.h @@ -27,30 +27,29 @@ #include -#include #include +#include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Header for observation message * * Header of a GNSS observation message. */ typedef struct SBP_ATTR_PACKED { - sbp_gps_time_t t; /**< GNSS time of this observation */ - u8 n_obs; /**< Total number of observations. First nibble is the size of - the sequence (n), second nibble is the zero-indexed - counter (ith packet of n) */ + sbp_gps_time_t t; /**< GNSS time of this observation */ + u8 n_obs; /**< Total number of observations. First nibble is the size of + the sequence (n), second nibble is the zero-indexed + counter (ith packet of n) */ } observation_header_t; - /** GNSS doppler measurement * * Doppler measurement in Hz represented as a 24-bit fixed point number with @@ -59,11 +58,10 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - s16 i; /**< Doppler whole Hz [Hz] */ - u8 f; /**< Doppler fractional part [Hz / 256] */ + s16 i; /**< Doppler whole Hz [Hz] */ + u8 f; /**< Doppler fractional part [Hz / 256] */ } doppler_t; - /** GNSS observations for a particular satellite signal * * Pseudorange and carrier phase observation for a satellite being tracked. @@ -76,51 +74,50 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 P; /**< Pseudorange observation [2 cm] */ - carrier_phase_t L; /**< Carrier phase observation with typical sign - convention. [cycles] */ - doppler_t D; /**< Doppler observation with typical sign convention. [Hz] */ - u8 cn0; /**< Carrier-to-Noise density. Zero implies invalid cn0. [dB Hz / 4] */ - u8 lock; /**< Lock timer. This value gives an indication of the time for - which a signal has maintained continuous phase lock. - Whenever a signal has lost and regained lock, this value - is reset to zero. It is encoded according to DF402 from - the RTCM 10403.2 Amendment 2 specification. Valid values - range from 0 to 15 and the most significant nibble is - reserved for future use. */ - u8 flags; /**< Measurement status flags. A bit field of flags providing - the status of this observation. If this field is 0 it - means only the Cn0 estimate for the signal is valid. */ - sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 bit) */ + u32 P; /**< Pseudorange observation [2 cm] */ + carrier_phase_t L; /**< Carrier phase observation with typical sign + convention. [cycles] */ + doppler_t D; /**< Doppler observation with typical sign convention. [Hz] */ + u8 cn0; /**< Carrier-to-Noise density. Zero implies invalid cn0. [dB Hz / 4] + */ + u8 lock; /**< Lock timer. This value gives an indication of the time for + which a signal has maintained continuous phase lock. + Whenever a signal has lost and regained lock, this value + is reset to zero. It is encoded according to DF402 from + the RTCM 10403.2 Amendment 2 specification. Valid values + range from 0 to 15 and the most significant nibble is + reserved for future use. */ + u8 flags; /**< Measurement status flags. A bit field of flags providing + the status of this observation. If this field is 0 it + means only the Cn0 estimate for the signal is valid. */ + sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 bit) */ } packed_obs_content_t; - /** Network correction for a particular satellite signal * * Pseudorange and carrier phase network corrections for a satellite signal. */ typedef struct SBP_ATTR_PACKED { - u32 P; /**< Pseudorange observation [2 cm] */ - carrier_phase_t L; /**< Carrier phase observation with typical - sign convention. [cycles] */ - u8 lock; /**< Lock timer. This value gives an indication of the time - for which a signal has maintained continuous phase - lock. Whenever a signal has lost and regained lock, - this value is reset to zero. It is encoded according - to DF402 from the RTCM 10403.2 Amendment 2 - specification. Valid values range from 0 to 15 and - the most significant nibble is reserved for future - use. */ - u8 flags; /**< Correction flags. */ - sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 bit) */ - u16 iono_std; /**< Slant ionospheric correction standard deviation [5 mm] */ - u16 tropo_std; /**< Slant tropospheric correction standard deviation [5 mm] */ - u16 range_std; /**< Orbit/clock/bias correction projected on range - standard deviation [5 mm] */ + u32 P; /**< Pseudorange observation [2 cm] */ + carrier_phase_t L; /**< Carrier phase observation with typical + sign convention. [cycles] */ + u8 lock; /**< Lock timer. This value gives an indication of the time + for which a signal has maintained continuous phase + lock. Whenever a signal has lost and regained lock, + this value is reset to zero. It is encoded according + to DF402 from the RTCM 10403.2 Amendment 2 + specification. Valid values range from 0 to 15 and + the most significant nibble is reserved for future + use. */ + u8 flags; /**< Correction flags. */ + sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 bit) */ + u16 iono_std; /**< Slant ionospheric correction standard deviation [5 mm] */ + u16 tropo_std; /**< Slant tropospheric correction standard deviation [5 mm] */ + u16 range_std; /**< Orbit/clock/bias correction projected on range + standard deviation [5 mm] */ } packed_osr_content_t; - /** GPS satellite observations * * The GPS observations message reports all the raw pseudorange and carrier @@ -132,13 +129,12 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - observation_header_t header; /**< Header of a GPS observation message */ - packed_obs_content_t obs[0]; /**< Pseudorange and carrier phase - observation for a satellite being - tracked. */ + observation_header_t header; /**< Header of a GPS observation message */ + packed_obs_content_t obs[0]; /**< Pseudorange and carrier phase + observation for a satellite being + tracked. */ } msg_obs_t; - /** Base station position * * The base station position message is the position reported by the base @@ -148,12 +144,11 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - double lat; /**< Latitude [deg] */ - double lon; /**< Longitude [deg] */ - double height; /**< Height [m] */ + double lat; /**< Latitude [deg] */ + double lon; /**< Longitude [deg] */ + double height; /**< Height [m] */ } msg_base_pos_llh_t; - /** Base station position in ECEF * * The base station position message is the position reported by the base @@ -164,139 +159,130 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - double x; /**< ECEF X coordinate [m] */ - double y; /**< ECEF Y coordinate [m] */ - double z; /**< ECEF Z coordinate [m] */ + double x; /**< ECEF X coordinate [m] */ + double y; /**< ECEF Y coordinate [m] */ + double z; /**< ECEF Z coordinate [m] */ } msg_base_pos_ecef_t; - - typedef struct SBP_ATTR_PACKED { - sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 bit) */ - gps_time_sec_t toe; /**< Time of Ephemerides */ + sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 bit) */ + gps_time_sec_t toe; /**< Time of Ephemerides */ float ura; /**< User Range Accuracy [m] */ - u32 fit_interval; /**< Curve fit interval [s] */ - u8 valid; /**< Status of ephemeris, 1 = valid, 0 = invalid */ - u8 health_bits; /**< Satellite health status. - GPS: ICD-GPS-200, chapter 20.3.3.3.1.4 - SBAS: 0 = valid, non-zero = invalid - GLO: 0 = valid, non-zero = invalid */ + u32 fit_interval; /**< Curve fit interval [s] */ + u8 valid; /**< Status of ephemeris, 1 = valid, 0 = invalid */ + u8 health_bits; /**< Satellite health status. + GPS: ICD-GPS-200, chapter 20.3.3.3.1.4 + SBAS: 0 = valid, non-zero = invalid + GLO: 0 = valid, non-zero = invalid */ } ephemeris_common_content_t; - - typedef struct SBP_ATTR_PACKED { - sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 bit) */ - gps_time_sec_t toe; /**< Time of Ephemerides */ - double ura; /**< User Range Accuracy [m] */ - u32 fit_interval; /**< Curve fit interval [s] */ - u8 valid; /**< Status of ephemeris, 1 = valid, 0 = invalid */ - u8 health_bits; /**< Satellite health status. - GPS: ICD-GPS-200, chapter 20.3.3.3.1.4 - Others: 0 = valid, non-zero = invalid */ + sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 bit) */ + gps_time_sec_t toe; /**< Time of Ephemerides */ + double ura; /**< User Range Accuracy [m] */ + u32 fit_interval; /**< Curve fit interval [s] */ + u8 valid; /**< Status of ephemeris, 1 = valid, 0 = invalid */ + u8 health_bits; /**< Satellite health status. + GPS: ICD-GPS-200, chapter 20.3.3.3.1.4 + Others: 0 = valid, non-zero = invalid */ } ephemeris_common_content_dep_b_t; - - typedef struct SBP_ATTR_PACKED { - gnss_signal_dep_t sid; /**< GNSS signal identifier */ - gps_time_dep_t toe; /**< Time of Ephemerides */ - double ura; /**< User Range Accuracy [m] */ - u32 fit_interval; /**< Curve fit interval [s] */ - u8 valid; /**< Status of ephemeris, 1 = valid, 0 = invalid */ - u8 health_bits; /**< Satellite health status. - GPS: ICD-GPS-200, chapter 20.3.3.3.1.4 - SBAS: 0 = valid, non-zero = invalid - GLO: 0 = valid, non-zero = invalid */ + gnss_signal_dep_t sid; /**< GNSS signal identifier */ + gps_time_dep_t toe; /**< Time of Ephemerides */ + double ura; /**< User Range Accuracy [m] */ + u32 fit_interval; /**< Curve fit interval [s] */ + u8 valid; /**< Status of ephemeris, 1 = valid, 0 = invalid */ + u8 health_bits; /**< Satellite health status. + GPS: ICD-GPS-200, chapter 20.3.3.3.1.4 + SBAS: 0 = valid, non-zero = invalid + GLO: 0 = valid, non-zero = invalid */ } ephemeris_common_content_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - ephemeris_common_content_dep_a_t common; /**< Values common for all - ephemeris types */ - double tgd; /**< Group delay differential between L1 and L2 [s] */ - double c_rs; /**< Amplitude of the sine harmonic correction term to - the orbit radius [m] */ - double c_rc; /**< Amplitude of the cosine harmonic correction term to - the orbit radius [m] */ - double c_uc; /**< Amplitude of the cosine harmonic correction term to - the argument of latitude [rad] */ - double c_us; /**< Amplitude of the sine harmonic correction term to - the argument of latitude [rad] */ - double c_ic; /**< Amplitude of the cosine harmonic correction term to - the angle of inclination [rad] */ - double c_is; /**< Amplitude of the sine harmonic correction term to - the angle of inclination [rad] */ - double dn; /**< Mean motion difference [rad/s] */ - double m0; /**< Mean anomaly at reference time [rad] */ - double ecc; /**< Eccentricity of satellite orbit */ - double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ - double omega0; /**< Longitude of ascending node of orbit plane at - weekly epoch [rad] */ - double omegadot; /**< Rate of right ascension [rad/s] */ - double w; /**< Argument of perigee [rad] */ - double inc; /**< Inclination [rad] */ - double inc_dot; /**< Inclination first derivative [rad/s] */ - double af0; /**< Polynomial clock correction coefficient (clock - bias) [s] */ - double af1; /**< Polynomial clock correction coefficient (clock - drift) [s/s] */ - double af2; /**< Polynomial clock correction coefficient (rate of - clock drift) [s/s^2] */ - gps_time_dep_t toc; /**< Clock reference */ - u8 iode; /**< Issue of ephemeris data */ - u16 iodc; /**< Issue of clock data */ + ephemeris_common_content_dep_a_t common; /**< Values common for all + ephemeris types */ + double tgd; /**< Group delay differential between L1 and L2 [s] */ + double c_rs; /**< Amplitude of the sine harmonic correction term to + the orbit radius [m] */ + double c_rc; /**< Amplitude of the cosine harmonic correction term to + the orbit radius [m] */ + double c_uc; /**< Amplitude of the cosine harmonic correction term to + the argument of latitude [rad] */ + double c_us; /**< Amplitude of the sine harmonic correction term to + the argument of latitude [rad] */ + double c_ic; /**< Amplitude of the cosine harmonic correction term to + the angle of inclination [rad] */ + double c_is; /**< Amplitude of the sine harmonic correction term to + the angle of inclination [rad] */ + double dn; /**< Mean motion difference [rad/s] */ + double m0; /**< Mean anomaly at reference time [rad] */ + double ecc; /**< Eccentricity of satellite orbit */ + double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ + double omega0; /**< Longitude of ascending node of orbit plane at + weekly epoch [rad] */ + double omegadot; /**< Rate of right ascension [rad/s] */ + double w; /**< Argument of perigee [rad] */ + double inc; /**< Inclination [rad] */ + double inc_dot; /**< Inclination first derivative [rad/s] */ + double af0; /**< Polynomial clock correction coefficient (clock + bias) [s] */ + double af1; /**< Polynomial clock correction coefficient (clock + drift) [s/s] */ + double af2; /**< Polynomial clock correction coefficient (rate of + clock drift) [s/s^2] */ + gps_time_dep_t toc; /**< Clock reference */ + u8 iode; /**< Issue of ephemeris data */ + u16 iodc; /**< Issue of clock data */ } msg_ephemeris_gps_dep_e_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - ephemeris_common_content_dep_b_t common; /**< Values common for all - ephemeris types */ - double tgd; /**< Group delay differential between L1 and L2 [s] */ - double c_rs; /**< Amplitude of the sine harmonic correction term to - the orbit radius [m] */ - double c_rc; /**< Amplitude of the cosine harmonic correction term to - the orbit radius [m] */ - double c_uc; /**< Amplitude of the cosine harmonic correction term to - the argument of latitude [rad] */ - double c_us; /**< Amplitude of the sine harmonic correction term to - the argument of latitude [rad] */ - double c_ic; /**< Amplitude of the cosine harmonic correction term to - the angle of inclination [rad] */ - double c_is; /**< Amplitude of the sine harmonic correction term to - the angle of inclination [rad] */ - double dn; /**< Mean motion difference [rad/s] */ - double m0; /**< Mean anomaly at reference time [rad] */ - double ecc; /**< Eccentricity of satellite orbit */ - double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ - double omega0; /**< Longitude of ascending node of orbit plane at - weekly epoch [rad] */ - double omegadot; /**< Rate of right ascension [rad/s] */ - double w; /**< Argument of perigee [rad] */ - double inc; /**< Inclination [rad] */ - double inc_dot; /**< Inclination first derivative [rad/s] */ - double af0; /**< Polynomial clock correction coefficient (clock - bias) [s] */ - double af1; /**< Polynomial clock correction coefficient (clock - drift) [s/s] */ - double af2; /**< Polynomial clock correction coefficient (rate of - clock drift) [s/s^2] */ - gps_time_sec_t toc; /**< Clock reference */ - u8 iode; /**< Issue of ephemeris data */ - u16 iodc; /**< Issue of clock data */ + ephemeris_common_content_dep_b_t common; /**< Values common for all + ephemeris types */ + double tgd; /**< Group delay differential between L1 and L2 [s] */ + double c_rs; /**< Amplitude of the sine harmonic correction term to + the orbit radius [m] */ + double c_rc; /**< Amplitude of the cosine harmonic correction term to + the orbit radius [m] */ + double c_uc; /**< Amplitude of the cosine harmonic correction term to + the argument of latitude [rad] */ + double c_us; /**< Amplitude of the sine harmonic correction term to + the argument of latitude [rad] */ + double c_ic; /**< Amplitude of the cosine harmonic correction term to + the angle of inclination [rad] */ + double c_is; /**< Amplitude of the sine harmonic correction term to + the angle of inclination [rad] */ + double dn; /**< Mean motion difference [rad/s] */ + double m0; /**< Mean anomaly at reference time [rad] */ + double ecc; /**< Eccentricity of satellite orbit */ + double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ + double omega0; /**< Longitude of ascending node of orbit plane at + weekly epoch [rad] */ + double omegadot; /**< Rate of right ascension [rad/s] */ + double w; /**< Argument of perigee [rad] */ + double inc; /**< Inclination [rad] */ + double inc_dot; /**< Inclination first derivative [rad/s] */ + double af0; /**< Polynomial clock correction coefficient (clock + bias) [s] */ + double af1; /**< Polynomial clock correction coefficient (clock + drift) [s/s] */ + double af2; /**< Polynomial clock correction coefficient (rate of + clock drift) [s/s^2] */ + gps_time_sec_t toc; /**< Clock reference */ + u8 iode; /**< Issue of ephemeris data */ + u16 iodc; /**< Issue of clock data */ } msg_ephemeris_gps_dep_f_t; - /** Satellite broadcast ephemeris for GPS * * The ephemeris message returns a set of satellite orbit parameters that is @@ -306,42 +292,41 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - ephemeris_common_content_t common; /**< Values common for all ephemeris - types */ - float tgd; /**< Group delay differential between L1 and L2 [s] */ - float c_rs; /**< Amplitude of the sine harmonic correction term to - the orbit radius [m] */ - float c_rc; /**< Amplitude of the cosine harmonic correction term to - the orbit radius [m] */ - float c_uc; /**< Amplitude of the cosine harmonic correction term to - the argument of latitude [rad] */ - float c_us; /**< Amplitude of the sine harmonic correction term to - the argument of latitude [rad] */ - float c_ic; /**< Amplitude of the cosine harmonic correction term to - the angle of inclination [rad] */ - float c_is; /**< Amplitude of the sine harmonic correction term to - the angle of inclination [rad] */ - double dn; /**< Mean motion difference [rad/s] */ - double m0; /**< Mean anomaly at reference time [rad] */ - double ecc; /**< Eccentricity of satellite orbit */ - double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ - double omega0; /**< Longitude of ascending node of orbit plane at - weekly epoch [rad] */ - double omegadot; /**< Rate of right ascension [rad/s] */ - double w; /**< Argument of perigee [rad] */ - double inc; /**< Inclination [rad] */ - double inc_dot; /**< Inclination first derivative [rad/s] */ - float af0; /**< Polynomial clock correction coefficient (clock bias) [s] */ - float af1; /**< Polynomial clock correction coefficient (clock - drift) [s/s] */ - float af2; /**< Polynomial clock correction coefficient (rate of - clock drift) [s/s^2] */ - gps_time_sec_t toc; /**< Clock reference */ - u8 iode; /**< Issue of ephemeris data */ - u16 iodc; /**< Issue of clock data */ + ephemeris_common_content_t common; /**< Values common for all ephemeris + types */ + float tgd; /**< Group delay differential between L1 and L2 [s] */ + float c_rs; /**< Amplitude of the sine harmonic correction term to + the orbit radius [m] */ + float c_rc; /**< Amplitude of the cosine harmonic correction term to + the orbit radius [m] */ + float c_uc; /**< Amplitude of the cosine harmonic correction term to + the argument of latitude [rad] */ + float c_us; /**< Amplitude of the sine harmonic correction term to + the argument of latitude [rad] */ + float c_ic; /**< Amplitude of the cosine harmonic correction term to + the angle of inclination [rad] */ + float c_is; /**< Amplitude of the sine harmonic correction term to + the angle of inclination [rad] */ + double dn; /**< Mean motion difference [rad/s] */ + double m0; /**< Mean anomaly at reference time [rad] */ + double ecc; /**< Eccentricity of satellite orbit */ + double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ + double omega0; /**< Longitude of ascending node of orbit plane at + weekly epoch [rad] */ + double omegadot; /**< Rate of right ascension [rad/s] */ + double w; /**< Argument of perigee [rad] */ + double inc; /**< Inclination [rad] */ + double inc_dot; /**< Inclination first derivative [rad/s] */ + float af0; /**< Polynomial clock correction coefficient (clock bias) [s] */ + float af1; /**< Polynomial clock correction coefficient (clock + drift) [s/s] */ + float af2; /**< Polynomial clock correction coefficient (rate of + clock drift) [s/s^2] */ + gps_time_sec_t toc; /**< Clock reference */ + u8 iode; /**< Issue of ephemeris data */ + u16 iodc; /**< Issue of clock data */ } msg_ephemeris_gps_t; - /** Satellite broadcast ephemeris for QZSS * * The ephemeris message returns a set of satellite orbit parameters that is @@ -349,42 +334,41 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - ephemeris_common_content_t common; /**< Values common for all ephemeris - types */ - float tgd; /**< Group delay differential between L1 and L2 [s] */ - float c_rs; /**< Amplitude of the sine harmonic correction term to - the orbit radius [m] */ - float c_rc; /**< Amplitude of the cosine harmonic correction term to - the orbit radius [m] */ - float c_uc; /**< Amplitude of the cosine harmonic correction term to - the argument of latitude [rad] */ - float c_us; /**< Amplitude of the sine harmonic correction term to - the argument of latitude [rad] */ - float c_ic; /**< Amplitude of the cosine harmonic correction term to - the angle of inclination [rad] */ - float c_is; /**< Amplitude of the sine harmonic correction term to - the angle of inclination [rad] */ - double dn; /**< Mean motion difference [rad/s] */ - double m0; /**< Mean anomaly at reference time [rad] */ - double ecc; /**< Eccentricity of satellite orbit */ - double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ - double omega0; /**< Longitude of ascending node of orbit plane at - weekly epoch [rad] */ - double omegadot; /**< Rate of right ascension [rad/s] */ - double w; /**< Argument of perigee [rad] */ - double inc; /**< Inclination [rad] */ - double inc_dot; /**< Inclination first derivative [rad/s] */ - float af0; /**< Polynomial clock correction coefficient (clock bias) [s] */ - float af1; /**< Polynomial clock correction coefficient (clock - drift) [s/s] */ - float af2; /**< Polynomial clock correction coefficient (rate of - clock drift) [s/s^2] */ - gps_time_sec_t toc; /**< Clock reference */ - u8 iode; /**< Issue of ephemeris data */ - u16 iodc; /**< Issue of clock data */ + ephemeris_common_content_t common; /**< Values common for all ephemeris + types */ + float tgd; /**< Group delay differential between L1 and L2 [s] */ + float c_rs; /**< Amplitude of the sine harmonic correction term to + the orbit radius [m] */ + float c_rc; /**< Amplitude of the cosine harmonic correction term to + the orbit radius [m] */ + float c_uc; /**< Amplitude of the cosine harmonic correction term to + the argument of latitude [rad] */ + float c_us; /**< Amplitude of the sine harmonic correction term to + the argument of latitude [rad] */ + float c_ic; /**< Amplitude of the cosine harmonic correction term to + the angle of inclination [rad] */ + float c_is; /**< Amplitude of the sine harmonic correction term to + the angle of inclination [rad] */ + double dn; /**< Mean motion difference [rad/s] */ + double m0; /**< Mean anomaly at reference time [rad] */ + double ecc; /**< Eccentricity of satellite orbit */ + double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ + double omega0; /**< Longitude of ascending node of orbit plane at + weekly epoch [rad] */ + double omegadot; /**< Rate of right ascension [rad/s] */ + double w; /**< Argument of perigee [rad] */ + double inc; /**< Inclination [rad] */ + double inc_dot; /**< Inclination first derivative [rad/s] */ + float af0; /**< Polynomial clock correction coefficient (clock bias) [s] */ + float af1; /**< Polynomial clock correction coefficient (clock + drift) [s/s] */ + float af2; /**< Polynomial clock correction coefficient (rate of + clock drift) [s/s^2] */ + gps_time_sec_t toc; /**< Clock reference */ + u8 iode; /**< Issue of ephemeris data */ + u16 iodc; /**< Issue of clock data */ } msg_ephemeris_qzss_t; - /** Satellite broadcast ephemeris for BDS * * The ephemeris message returns a set of satellite orbit parameters that is @@ -394,92 +378,90 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - ephemeris_common_content_t common; /**< Values common for all ephemeris - types */ - float tgd1; /**< Group delay differential for B1 [s] */ - float tgd2; /**< Group delay differential for B2 [s] */ - float c_rs; /**< Amplitude of the sine harmonic correction term to - the orbit radius [m] */ - float c_rc; /**< Amplitude of the cosine harmonic correction term to - the orbit radius [m] */ - float c_uc; /**< Amplitude of the cosine harmonic correction term to - the argument of latitude [rad] */ - float c_us; /**< Amplitude of the sine harmonic correction term to - the argument of latitude [rad] */ - float c_ic; /**< Amplitude of the cosine harmonic correction term to - the angle of inclination [rad] */ - float c_is; /**< Amplitude of the sine harmonic correction term to - the angle of inclination [rad] */ - double dn; /**< Mean motion difference [rad/s] */ - double m0; /**< Mean anomaly at reference time [rad] */ - double ecc; /**< Eccentricity of satellite orbit */ - double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ - double omega0; /**< Longitude of ascending node of orbit plane at - weekly epoch [rad] */ - double omegadot; /**< Rate of right ascension [rad/s] */ - double w; /**< Argument of perigee [rad] */ - double inc; /**< Inclination [rad] */ - double inc_dot; /**< Inclination first derivative [rad/s] */ - double af0; /**< Polynomial clock correction coefficient (clock - bias) [s] */ - float af1; /**< Polynomial clock correction coefficient (clock - drift) [s/s] */ - float af2; /**< Polynomial clock correction coefficient (rate of - clock drift) [s/s^2] */ - gps_time_sec_t toc; /**< Clock reference */ - u8 iode; /**< Issue of ephemeris data - Calculated from the navigation data parameter t_oe per - RTCM/CSNO recommendation: IODE = mod (t_oe / 720, 240) */ - u16 iodc; /**< Issue of clock data - Calculated from the navigation data parameter t_oe per - RTCM/CSNO recommendation: IODE = mod (t_oc / 720, 240) */ + ephemeris_common_content_t common; /**< Values common for all ephemeris + types */ + float tgd1; /**< Group delay differential for B1 [s] */ + float tgd2; /**< Group delay differential for B2 [s] */ + float c_rs; /**< Amplitude of the sine harmonic correction term to + the orbit radius [m] */ + float c_rc; /**< Amplitude of the cosine harmonic correction term to + the orbit radius [m] */ + float c_uc; /**< Amplitude of the cosine harmonic correction term to + the argument of latitude [rad] */ + float c_us; /**< Amplitude of the sine harmonic correction term to + the argument of latitude [rad] */ + float c_ic; /**< Amplitude of the cosine harmonic correction term to + the angle of inclination [rad] */ + float c_is; /**< Amplitude of the sine harmonic correction term to + the angle of inclination [rad] */ + double dn; /**< Mean motion difference [rad/s] */ + double m0; /**< Mean anomaly at reference time [rad] */ + double ecc; /**< Eccentricity of satellite orbit */ + double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ + double omega0; /**< Longitude of ascending node of orbit plane at + weekly epoch [rad] */ + double omegadot; /**< Rate of right ascension [rad/s] */ + double w; /**< Argument of perigee [rad] */ + double inc; /**< Inclination [rad] */ + double inc_dot; /**< Inclination first derivative [rad/s] */ + double af0; /**< Polynomial clock correction coefficient (clock + bias) [s] */ + float af1; /**< Polynomial clock correction coefficient (clock + drift) [s/s] */ + float af2; /**< Polynomial clock correction coefficient (rate of + clock drift) [s/s^2] */ + gps_time_sec_t toc; /**< Clock reference */ + u8 iode; /**< Issue of ephemeris data + Calculated from the navigation data parameter t_oe per + RTCM/CSNO recommendation: IODE = mod (t_oe / 720, 240) */ + u16 iodc; /**< Issue of clock data + Calculated from the navigation data parameter t_oe per + RTCM/CSNO recommendation: IODE = mod (t_oc / 720, 240) */ } msg_ephemeris_bds_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - ephemeris_common_content_t common; /**< Values common for all - ephemeris types */ - float bgd_e1e5a; /**< E1-E5a Broadcast Group Delay [s] */ - float bgd_e1e5b; /**< E1-E5b Broadcast Group Delay [s] */ - float c_rs; /**< Amplitude of the sine harmonic correction term to - the orbit radius [m] */ - float c_rc; /**< Amplitude of the cosine harmonic correction term to - the orbit radius [m] */ - float c_uc; /**< Amplitude of the cosine harmonic correction term to - the argument of latitude [rad] */ - float c_us; /**< Amplitude of the sine harmonic correction term to - the argument of latitude [rad] */ - float c_ic; /**< Amplitude of the cosine harmonic correction term to - the angle of inclination [rad] */ - float c_is; /**< Amplitude of the sine harmonic correction term to - the angle of inclination [rad] */ - double dn; /**< Mean motion difference [rad/s] */ - double m0; /**< Mean anomaly at reference time [rad] */ - double ecc; /**< Eccentricity of satellite orbit */ - double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ - double omega0; /**< Longitude of ascending node of orbit plane at - weekly epoch [rad] */ - double omegadot; /**< Rate of right ascension [rad/s] */ - double w; /**< Argument of perigee [rad] */ - double inc; /**< Inclination [rad] */ - double inc_dot; /**< Inclination first derivative [rad/s] */ - double af0; /**< Polynomial clock correction coefficient (clock - bias) [s] */ - double af1; /**< Polynomial clock correction coefficient (clock - drift) [s/s] */ - float af2; /**< Polynomial clock correction coefficient (rate of - clock drift) [s/s^2] */ - gps_time_sec_t toc; /**< Clock reference */ - u16 iode; /**< Issue of data (IODnav) */ - u16 iodc; /**< Issue of data (IODnav). Always equal to iode */ + ephemeris_common_content_t common; /**< Values common for all + ephemeris types */ + float bgd_e1e5a; /**< E1-E5a Broadcast Group Delay [s] */ + float bgd_e1e5b; /**< E1-E5b Broadcast Group Delay [s] */ + float c_rs; /**< Amplitude of the sine harmonic correction term to + the orbit radius [m] */ + float c_rc; /**< Amplitude of the cosine harmonic correction term to + the orbit radius [m] */ + float c_uc; /**< Amplitude of the cosine harmonic correction term to + the argument of latitude [rad] */ + float c_us; /**< Amplitude of the sine harmonic correction term to + the argument of latitude [rad] */ + float c_ic; /**< Amplitude of the cosine harmonic correction term to + the angle of inclination [rad] */ + float c_is; /**< Amplitude of the sine harmonic correction term to + the angle of inclination [rad] */ + double dn; /**< Mean motion difference [rad/s] */ + double m0; /**< Mean anomaly at reference time [rad] */ + double ecc; /**< Eccentricity of satellite orbit */ + double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ + double omega0; /**< Longitude of ascending node of orbit plane at + weekly epoch [rad] */ + double omegadot; /**< Rate of right ascension [rad/s] */ + double w; /**< Argument of perigee [rad] */ + double inc; /**< Inclination [rad] */ + double inc_dot; /**< Inclination first derivative [rad/s] */ + double af0; /**< Polynomial clock correction coefficient (clock + bias) [s] */ + double af1; /**< Polynomial clock correction coefficient (clock + drift) [s/s] */ + float af2; /**< Polynomial clock correction coefficient (rate of + clock drift) [s/s^2] */ + gps_time_sec_t toc; /**< Clock reference */ + u16 iode; /**< Issue of data (IODnav) */ + u16 iodc; /**< Issue of data (IODnav). Always equal to iode */ } msg_ephemeris_gal_dep_a_t; - /** Satellite broadcast ephemeris for Galileo * * The ephemeris message returns a set of satellite orbit parameters that is @@ -489,129 +471,124 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - ephemeris_common_content_t common; /**< Values common for all - ephemeris types */ - float bgd_e1e5a; /**< E1-E5a Broadcast Group Delay [s] */ - float bgd_e1e5b; /**< E1-E5b Broadcast Group Delay [s] */ - float c_rs; /**< Amplitude of the sine harmonic correction term to - the orbit radius [m] */ - float c_rc; /**< Amplitude of the cosine harmonic correction term to - the orbit radius [m] */ - float c_uc; /**< Amplitude of the cosine harmonic correction term to - the argument of latitude [rad] */ - float c_us; /**< Amplitude of the sine harmonic correction term to - the argument of latitude [rad] */ - float c_ic; /**< Amplitude of the cosine harmonic correction term to - the angle of inclination [rad] */ - float c_is; /**< Amplitude of the sine harmonic correction term to - the angle of inclination [rad] */ - double dn; /**< Mean motion difference [rad/s] */ - double m0; /**< Mean anomaly at reference time [rad] */ - double ecc; /**< Eccentricity of satellite orbit */ - double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ - double omega0; /**< Longitude of ascending node of orbit plane at - weekly epoch [rad] */ - double omegadot; /**< Rate of right ascension [rad/s] */ - double w; /**< Argument of perigee [rad] */ - double inc; /**< Inclination [rad] */ - double inc_dot; /**< Inclination first derivative [rad/s] */ - double af0; /**< Polynomial clock correction coefficient (clock - bias) [s] */ - double af1; /**< Polynomial clock correction coefficient (clock - drift) [s/s] */ - float af2; /**< Polynomial clock correction coefficient (rate of - clock drift) [s/s^2] */ - gps_time_sec_t toc; /**< Clock reference */ - u16 iode; /**< Issue of data (IODnav) */ - u16 iodc; /**< Issue of data (IODnav). Always equal to iode */ - u8 source; /**< 0=I/NAV, 1=F/NAV */ + ephemeris_common_content_t common; /**< Values common for all + ephemeris types */ + float bgd_e1e5a; /**< E1-E5a Broadcast Group Delay [s] */ + float bgd_e1e5b; /**< E1-E5b Broadcast Group Delay [s] */ + float c_rs; /**< Amplitude of the sine harmonic correction term to + the orbit radius [m] */ + float c_rc; /**< Amplitude of the cosine harmonic correction term to + the orbit radius [m] */ + float c_uc; /**< Amplitude of the cosine harmonic correction term to + the argument of latitude [rad] */ + float c_us; /**< Amplitude of the sine harmonic correction term to + the argument of latitude [rad] */ + float c_ic; /**< Amplitude of the cosine harmonic correction term to + the angle of inclination [rad] */ + float c_is; /**< Amplitude of the sine harmonic correction term to + the angle of inclination [rad] */ + double dn; /**< Mean motion difference [rad/s] */ + double m0; /**< Mean anomaly at reference time [rad] */ + double ecc; /**< Eccentricity of satellite orbit */ + double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ + double omega0; /**< Longitude of ascending node of orbit plane at + weekly epoch [rad] */ + double omegadot; /**< Rate of right ascension [rad/s] */ + double w; /**< Argument of perigee [rad] */ + double inc; /**< Inclination [rad] */ + double inc_dot; /**< Inclination first derivative [rad/s] */ + double af0; /**< Polynomial clock correction coefficient (clock + bias) [s] */ + double af1; /**< Polynomial clock correction coefficient (clock + drift) [s/s] */ + float af2; /**< Polynomial clock correction coefficient (rate of + clock drift) [s/s^2] */ + gps_time_sec_t toc; /**< Clock reference */ + u16 iode; /**< Issue of data (IODnav) */ + u16 iodc; /**< Issue of data (IODnav). Always equal to iode */ + u8 source; /**< 0=I/NAV, 1=F/NAV */ } msg_ephemeris_gal_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - ephemeris_common_content_dep_a_t common; /**< Values common for all - ephemeris types */ - double pos[3]; /**< Position of the GEO at time toe [m] */ - double vel[3]; /**< Velocity of the GEO at time toe [m/s] */ - double acc[3]; /**< Acceleration of the GEO at time toe [m/s^2] */ - double a_gf0; /**< Time offset of the GEO clock w.r.t. SBAS Network Time [s] */ - double a_gf1; /**< Drift of the GEO clock w.r.t. SBAS Network Time [s/s] */ + ephemeris_common_content_dep_a_t common; /**< Values common for all + ephemeris types */ + double pos[3]; /**< Position of the GEO at time toe [m] */ + double vel[3]; /**< Velocity of the GEO at time toe [m/s] */ + double acc[3]; /**< Acceleration of the GEO at time toe [m/s^2] */ + double + a_gf0; /**< Time offset of the GEO clock w.r.t. SBAS Network Time [s] */ + double a_gf1; /**< Drift of the GEO clock w.r.t. SBAS Network Time [s/s] */ } msg_ephemeris_sbas_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - ephemeris_common_content_dep_a_t common; /**< Values common for all - ephemeris types */ - double gamma; /**< Relative deviation of predicted carrier frequency - from nominal */ - double tau; /**< Correction to the SV time [s] */ - double pos[3]; /**< Position of the SV at tb in PZ-90.02 coordinates - system [m] */ - double vel[3]; /**< Velocity vector of the SV at tb in PZ-90.02 - coordinates system [m/s] */ - double acc[3]; /**< Acceleration vector of the SV at tb in PZ-90.02 - coordinates sys [m/s^2] */ + ephemeris_common_content_dep_a_t common; /**< Values common for all + ephemeris types */ + double gamma; /**< Relative deviation of predicted carrier frequency + from nominal */ + double tau; /**< Correction to the SV time [s] */ + double pos[3]; /**< Position of the SV at tb in PZ-90.02 coordinates + system [m] */ + double vel[3]; /**< Velocity vector of the SV at tb in PZ-90.02 + coordinates system [m/s] */ + double acc[3]; /**< Acceleration vector of the SV at tb in PZ-90.02 + coordinates sys [m/s^2] */ } msg_ephemeris_glo_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - ephemeris_common_content_dep_b_t common; /**< Values common for all - ephemeris types */ - double pos[3]; /**< Position of the GEO at time toe [m] */ - double vel[3]; /**< Velocity of the GEO at time toe [m/s] */ - double acc[3]; /**< Acceleration of the GEO at time toe [m/s^2] */ - double a_gf0; /**< Time offset of the GEO clock w.r.t. SBAS Network Time [s] */ - double a_gf1; /**< Drift of the GEO clock w.r.t. SBAS Network Time [s/s] */ + ephemeris_common_content_dep_b_t common; /**< Values common for all + ephemeris types */ + double pos[3]; /**< Position of the GEO at time toe [m] */ + double vel[3]; /**< Velocity of the GEO at time toe [m/s] */ + double acc[3]; /**< Acceleration of the GEO at time toe [m/s^2] */ + double + a_gf0; /**< Time offset of the GEO clock w.r.t. SBAS Network Time [s] */ + double a_gf1; /**< Drift of the GEO clock w.r.t. SBAS Network Time [s/s] */ } msg_ephemeris_sbas_dep_b_t; - - typedef struct SBP_ATTR_PACKED { - ephemeris_common_content_t common; /**< Values common for all ephemeris - types */ - double pos[3]; /**< Position of the GEO at time toe [m] */ - float vel[3]; /**< Velocity of the GEO at time toe [m/s] */ - float acc[3]; /**< Acceleration of the GEO at time toe [m/s^2] */ - float a_gf0; /**< Time offset of the GEO clock w.r.t. SBAS Network Time [s] */ - float a_gf1; /**< Drift of the GEO clock w.r.t. SBAS Network Time [s/s] */ + ephemeris_common_content_t common; /**< Values common for all ephemeris + types */ + double pos[3]; /**< Position of the GEO at time toe [m] */ + float vel[3]; /**< Velocity of the GEO at time toe [m/s] */ + float acc[3]; /**< Acceleration of the GEO at time toe [m/s^2] */ + float a_gf0; /**< Time offset of the GEO clock w.r.t. SBAS Network Time [s] */ + float a_gf1; /**< Drift of the GEO clock w.r.t. SBAS Network Time [s/s] */ } msg_ephemeris_sbas_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - ephemeris_common_content_dep_b_t common; /**< Values common for all - ephemeris types */ - double gamma; /**< Relative deviation of predicted carrier frequency - from nominal */ - double tau; /**< Correction to the SV time [s] */ - double pos[3]; /**< Position of the SV at tb in PZ-90.02 coordinates - system [m] */ - double vel[3]; /**< Velocity vector of the SV at tb in PZ-90.02 - coordinates system [m/s] */ - double acc[3]; /**< Acceleration vector of the SV at tb in PZ-90.02 - coordinates sys [m/s^2] */ + ephemeris_common_content_dep_b_t common; /**< Values common for all + ephemeris types */ + double gamma; /**< Relative deviation of predicted carrier frequency + from nominal */ + double tau; /**< Correction to the SV time [s] */ + double pos[3]; /**< Position of the SV at tb in PZ-90.02 coordinates + system [m] */ + double vel[3]; /**< Velocity vector of the SV at tb in PZ-90.02 + coordinates system [m/s] */ + double acc[3]; /**< Acceleration vector of the SV at tb in PZ-90.02 + coordinates sys [m/s^2] */ } msg_ephemeris_glo_dep_b_t; - /** Deprecated * * The ephemeris message returns a set of satellite orbit parameters that is @@ -621,23 +598,22 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - ephemeris_common_content_dep_b_t common; /**< Values common for all - ephemeris types */ - double gamma; /**< Relative deviation of predicted carrier frequency - from nominal */ - double tau; /**< Correction to the SV time [s] */ - double d_tau; /**< Equipment delay between L1 and L2 [s] */ - double pos[3]; /**< Position of the SV at tb in PZ-90.02 coordinates - system [m] */ - double vel[3]; /**< Velocity vector of the SV at tb in PZ-90.02 - coordinates system [m/s] */ - double acc[3]; /**< Acceleration vector of the SV at tb in PZ-90.02 - coordinates sys [m/s^2] */ - u8 fcn; /**< Frequency slot. FCN+8 (that is [1..14]). 0 or 0xFF for - invalid */ + ephemeris_common_content_dep_b_t common; /**< Values common for all + ephemeris types */ + double gamma; /**< Relative deviation of predicted carrier frequency + from nominal */ + double tau; /**< Correction to the SV time [s] */ + double d_tau; /**< Equipment delay between L1 and L2 [s] */ + double pos[3]; /**< Position of the SV at tb in PZ-90.02 coordinates + system [m] */ + double vel[3]; /**< Velocity vector of the SV at tb in PZ-90.02 + coordinates system [m/s] */ + double acc[3]; /**< Acceleration vector of the SV at tb in PZ-90.02 + coordinates sys [m/s^2] */ + u8 fcn; /**< Frequency slot. FCN+8 (that is [1..14]). 0 or 0xFF for + invalid */ } msg_ephemeris_glo_dep_c_t; - /** Deprecated * * This observation message has been deprecated in favor of ephemeris message @@ -645,25 +621,24 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - ephemeris_common_content_dep_b_t common; /**< Values common for all - ephemeris types */ - double gamma; /**< Relative deviation of predicted carrier frequency - from nominal */ - double tau; /**< Correction to the SV time [s] */ - double d_tau; /**< Equipment delay between L1 and L2 [s] */ - double pos[3]; /**< Position of the SV at tb in PZ-90.02 coordinates - system [m] */ - double vel[3]; /**< Velocity vector of the SV at tb in PZ-90.02 - coordinates system [m/s] */ - double acc[3]; /**< Acceleration vector of the SV at tb in PZ-90.02 - coordinates sys [m/s^2] */ - u8 fcn; /**< Frequency slot. FCN+8 (that is [1..14]). 0 or 0xFF for - invalid */ - u8 iod; /**< Issue of data. Equal to the 7 bits of the immediate data - word t_b */ + ephemeris_common_content_dep_b_t common; /**< Values common for all + ephemeris types */ + double gamma; /**< Relative deviation of predicted carrier frequency + from nominal */ + double tau; /**< Correction to the SV time [s] */ + double d_tau; /**< Equipment delay between L1 and L2 [s] */ + double pos[3]; /**< Position of the SV at tb in PZ-90.02 coordinates + system [m] */ + double vel[3]; /**< Velocity vector of the SV at tb in PZ-90.02 + coordinates system [m/s] */ + double acc[3]; /**< Acceleration vector of the SV at tb in PZ-90.02 + coordinates sys [m/s^2] */ + u8 fcn; /**< Frequency slot. FCN+8 (that is [1..14]). 0 or 0xFF for + invalid */ + u8 iod; /**< Issue of data. Equal to the 7 bits of the immediate data + word t_b */ } msg_ephemeris_glo_dep_d_t; - /** Satellite broadcast ephemeris for GLO * * The ephemeris message returns a set of satellite orbit parameters that is @@ -673,225 +648,219 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - ephemeris_common_content_t common; /**< Values common for all ephemeris - types */ - float gamma; /**< Relative deviation of predicted carrier frequency from - nominal */ - float tau; /**< Correction to the SV time [s] */ - float d_tau; /**< Equipment delay between L1 and L2 [s] */ - double pos[3]; /**< Position of the SV at tb in PZ-90.02 coordinates - system [m] */ - double vel[3]; /**< Velocity vector of the SV at tb in PZ-90.02 - coordinates system [m/s] */ - float acc[3]; /**< Acceleration vector of the SV at tb in PZ-90.02 - coordinates sys [m/s^2] */ - u8 fcn; /**< Frequency slot. FCN+8 (that is [1..14]). 0 or 0xFF for - invalid */ - u8 iod; /**< Issue of data. Equal to the 7 bits of the immediate data - word t_b */ + ephemeris_common_content_t common; /**< Values common for all ephemeris + types */ + float gamma; /**< Relative deviation of predicted carrier frequency from + nominal */ + float tau; /**< Correction to the SV time [s] */ + float d_tau; /**< Equipment delay between L1 and L2 [s] */ + double pos[3]; /**< Position of the SV at tb in PZ-90.02 coordinates + system [m] */ + double vel[3]; /**< Velocity vector of the SV at tb in PZ-90.02 + coordinates system [m/s] */ + float acc[3]; /**< Acceleration vector of the SV at tb in PZ-90.02 + coordinates sys [m/s^2] */ + u8 fcn; /**< Frequency slot. FCN+8 (that is [1..14]). 0 or 0xFF for + invalid */ + u8 iod; /**< Issue of data. Equal to the 7 bits of the immediate data + word t_b */ } msg_ephemeris_glo_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - double tgd; /**< Group delay differential between L1 and L2 [s] */ - double c_rs; /**< Amplitude of the sine harmonic correction term to - the orbit radius [m] */ - double c_rc; /**< Amplitude of the cosine harmonic correction term to - the orbit radius [m] */ - double c_uc; /**< Amplitude of the cosine harmonic correction term to - the argument of latitude [rad] */ - double c_us; /**< Amplitude of the sine harmonic correction term to - the argument of latitude [rad] */ - double c_ic; /**< Amplitude of the cosine harmonic correction term to - the angle of inclination [rad] */ - double c_is; /**< Amplitude of the sine harmonic correction term to - the angle of inclination [rad] */ - double dn; /**< Mean motion difference [rad/s] */ - double m0; /**< Mean anomaly at reference time [rad] */ - double ecc; /**< Eccentricity of satellite orbit */ - double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ - double omega0; /**< Longitude of ascending node of orbit plane at - weekly epoch [rad] */ - double omegadot; /**< Rate of right ascension [rad/s] */ - double w; /**< Argument of perigee [rad] */ - double inc; /**< Inclination [rad] */ - double inc_dot; /**< Inclination first derivative [rad/s] */ - double af0; /**< Polynomial clock correction coefficient (clock - bias) [s] */ - double af1; /**< Polynomial clock correction coefficient (clock - drift) [s/s] */ - double af2; /**< Polynomial clock correction coefficient (rate of - clock drift) [s/s^2] */ - double toe_tow; /**< Time of week [s] */ + double tgd; /**< Group delay differential between L1 and L2 [s] */ + double c_rs; /**< Amplitude of the sine harmonic correction term to + the orbit radius [m] */ + double c_rc; /**< Amplitude of the cosine harmonic correction term to + the orbit radius [m] */ + double c_uc; /**< Amplitude of the cosine harmonic correction term to + the argument of latitude [rad] */ + double c_us; /**< Amplitude of the sine harmonic correction term to + the argument of latitude [rad] */ + double c_ic; /**< Amplitude of the cosine harmonic correction term to + the angle of inclination [rad] */ + double c_is; /**< Amplitude of the sine harmonic correction term to + the angle of inclination [rad] */ + double dn; /**< Mean motion difference [rad/s] */ + double m0; /**< Mean anomaly at reference time [rad] */ + double ecc; /**< Eccentricity of satellite orbit */ + double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ + double omega0; /**< Longitude of ascending node of orbit plane at + weekly epoch [rad] */ + double omegadot; /**< Rate of right ascension [rad/s] */ + double w; /**< Argument of perigee [rad] */ + double inc; /**< Inclination [rad] */ + double inc_dot; /**< Inclination first derivative [rad/s] */ + double af0; /**< Polynomial clock correction coefficient (clock + bias) [s] */ + double af1; /**< Polynomial clock correction coefficient (clock + drift) [s/s] */ + double af2; /**< Polynomial clock correction coefficient (rate of + clock drift) [s/s^2] */ + double toe_tow; /**< Time of week [s] */ u16 toe_wn; /**< Week number [week] */ - double toc_tow; /**< Clock reference time of week [s] */ + double toc_tow; /**< Clock reference time of week [s] */ u16 toc_wn; /**< Clock reference week number [week] */ - u8 valid; /**< Is valid? */ - u8 healthy; /**< Satellite is healthy? */ - gnss_signal_dep_t sid; /**< GNSS signal identifier */ - u8 iode; /**< Issue of ephemeris data */ - u16 iodc; /**< Issue of clock data */ - u32 reserved; /**< Reserved field */ + u8 valid; /**< Is valid? */ + u8 healthy; /**< Satellite is healthy? */ + gnss_signal_dep_t sid; /**< GNSS signal identifier */ + u8 iode; /**< Issue of ephemeris data */ + u16 iodc; /**< Issue of clock data */ + u32 reserved; /**< Reserved field */ } msg_ephemeris_dep_d_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - double tgd; /**< Group delay differential between L1 and L2 [s] */ - double c_rs; /**< Amplitude of the sine harmonic correction term to - the orbit radius [m] */ - double c_rc; /**< Amplitude of the cosine harmonic correction term to - the orbit radius [m] */ - double c_uc; /**< Amplitude of the cosine harmonic correction term to - the argument of latitude [rad] */ - double c_us; /**< Amplitude of the sine harmonic correction term to - the argument of latitude [rad] */ - double c_ic; /**< Amplitude of the cosine harmonic correction term to - the angle of inclination [rad] */ - double c_is; /**< Amplitude of the sine harmonic correction term to - the angle of inclination [rad] */ - double dn; /**< Mean motion difference [rad/s] */ - double m0; /**< Mean anomaly at reference time [rad] */ - double ecc; /**< Eccentricity of satellite orbit */ - double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ - double omega0; /**< Longitude of ascending node of orbit plane at - weekly epoch [rad] */ - double omegadot; /**< Rate of right ascension [rad/s] */ - double w; /**< Argument of perigee [rad] */ - double inc; /**< Inclination [rad] */ - double inc_dot; /**< Inclination first derivative [rad/s] */ - double af0; /**< Polynomial clock correction coefficient (clock - bias) [s] */ - double af1; /**< Polynomial clock correction coefficient (clock - drift) [s/s] */ - double af2; /**< Polynomial clock correction coefficient (rate of - clock drift) [s/s^2] */ - double toe_tow; /**< Time of week [s] */ + double tgd; /**< Group delay differential between L1 and L2 [s] */ + double c_rs; /**< Amplitude of the sine harmonic correction term to + the orbit radius [m] */ + double c_rc; /**< Amplitude of the cosine harmonic correction term to + the orbit radius [m] */ + double c_uc; /**< Amplitude of the cosine harmonic correction term to + the argument of latitude [rad] */ + double c_us; /**< Amplitude of the sine harmonic correction term to + the argument of latitude [rad] */ + double c_ic; /**< Amplitude of the cosine harmonic correction term to + the angle of inclination [rad] */ + double c_is; /**< Amplitude of the sine harmonic correction term to + the angle of inclination [rad] */ + double dn; /**< Mean motion difference [rad/s] */ + double m0; /**< Mean anomaly at reference time [rad] */ + double ecc; /**< Eccentricity of satellite orbit */ + double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ + double omega0; /**< Longitude of ascending node of orbit plane at + weekly epoch [rad] */ + double omegadot; /**< Rate of right ascension [rad/s] */ + double w; /**< Argument of perigee [rad] */ + double inc; /**< Inclination [rad] */ + double inc_dot; /**< Inclination first derivative [rad/s] */ + double af0; /**< Polynomial clock correction coefficient (clock + bias) [s] */ + double af1; /**< Polynomial clock correction coefficient (clock + drift) [s/s] */ + double af2; /**< Polynomial clock correction coefficient (rate of + clock drift) [s/s^2] */ + double toe_tow; /**< Time of week [s] */ u16 toe_wn; /**< Week number [week] */ - double toc_tow; /**< Clock reference time of week [s] */ + double toc_tow; /**< Clock reference time of week [s] */ u16 toc_wn; /**< Clock reference week number [week] */ - u8 valid; /**< Is valid? */ - u8 healthy; /**< Satellite is healthy? */ - u8 prn; /**< PRN being tracked */ + u8 valid; /**< Is valid? */ + u8 healthy; /**< Satellite is healthy? */ + u8 prn; /**< PRN being tracked */ } msg_ephemeris_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - double tgd; /**< Group delay differential between L1 and L2 [s] */ - double c_rs; /**< Amplitude of the sine harmonic correction term to - the orbit radius [m] */ - double c_rc; /**< Amplitude of the cosine harmonic correction term to - the orbit radius [m] */ - double c_uc; /**< Amplitude of the cosine harmonic correction term to - the argument of latitude [rad] */ - double c_us; /**< Amplitude of the sine harmonic correction term to - the argument of latitude [rad] */ - double c_ic; /**< Amplitude of the cosine harmonic correction term to - the angle of inclination [rad] */ - double c_is; /**< Amplitude of the sine harmonic correction term to - the angle of inclination [rad] */ - double dn; /**< Mean motion difference [rad/s] */ - double m0; /**< Mean anomaly at reference time [rad] */ - double ecc; /**< Eccentricity of satellite orbit */ - double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ - double omega0; /**< Longitude of ascending node of orbit plane at - weekly epoch [rad] */ - double omegadot; /**< Rate of right ascension [rad/s] */ - double w; /**< Argument of perigee [rad] */ - double inc; /**< Inclination [rad] */ - double inc_dot; /**< Inclination first derivative [rad/s] */ - double af0; /**< Polynomial clock correction coefficient (clock - bias) [s] */ - double af1; /**< Polynomial clock correction coefficient (clock - drift) [s/s] */ - double af2; /**< Polynomial clock correction coefficient (rate of - clock drift) [s/s^2] */ - double toe_tow; /**< Time of week [s] */ + double tgd; /**< Group delay differential between L1 and L2 [s] */ + double c_rs; /**< Amplitude of the sine harmonic correction term to + the orbit radius [m] */ + double c_rc; /**< Amplitude of the cosine harmonic correction term to + the orbit radius [m] */ + double c_uc; /**< Amplitude of the cosine harmonic correction term to + the argument of latitude [rad] */ + double c_us; /**< Amplitude of the sine harmonic correction term to + the argument of latitude [rad] */ + double c_ic; /**< Amplitude of the cosine harmonic correction term to + the angle of inclination [rad] */ + double c_is; /**< Amplitude of the sine harmonic correction term to + the angle of inclination [rad] */ + double dn; /**< Mean motion difference [rad/s] */ + double m0; /**< Mean anomaly at reference time [rad] */ + double ecc; /**< Eccentricity of satellite orbit */ + double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ + double omega0; /**< Longitude of ascending node of orbit plane at + weekly epoch [rad] */ + double omegadot; /**< Rate of right ascension [rad/s] */ + double w; /**< Argument of perigee [rad] */ + double inc; /**< Inclination [rad] */ + double inc_dot; /**< Inclination first derivative [rad/s] */ + double af0; /**< Polynomial clock correction coefficient (clock + bias) [s] */ + double af1; /**< Polynomial clock correction coefficient (clock + drift) [s/s] */ + double af2; /**< Polynomial clock correction coefficient (rate of + clock drift) [s/s^2] */ + double toe_tow; /**< Time of week [s] */ u16 toe_wn; /**< Week number [week] */ - double toc_tow; /**< Clock reference time of week [s] */ + double toc_tow; /**< Clock reference time of week [s] */ u16 toc_wn; /**< Clock reference week number [week] */ - u8 valid; /**< Is valid? */ - u8 healthy; /**< Satellite is healthy? */ - u8 prn; /**< PRN being tracked */ - u8 iode; /**< Issue of ephemeris data */ + u8 valid; /**< Is valid? */ + u8 healthy; /**< Satellite is healthy? */ + u8 prn; /**< PRN being tracked */ + u8 iode; /**< Issue of ephemeris data */ } msg_ephemeris_dep_b_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - double tgd; /**< Group delay differential between L1 and L2 [s] */ - double c_rs; /**< Amplitude of the sine harmonic correction term to - the orbit radius [m] */ - double c_rc; /**< Amplitude of the cosine harmonic correction term to - the orbit radius [m] */ - double c_uc; /**< Amplitude of the cosine harmonic correction term to - the argument of latitude [rad] */ - double c_us; /**< Amplitude of the sine harmonic correction term to - the argument of latitude [rad] */ - double c_ic; /**< Amplitude of the cosine harmonic correction term to - the angle of inclination [rad] */ - double c_is; /**< Amplitude of the sine harmonic correction term to - the angle of inclination [rad] */ - double dn; /**< Mean motion difference [rad/s] */ - double m0; /**< Mean anomaly at reference time [rad] */ - double ecc; /**< Eccentricity of satellite orbit */ - double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ - double omega0; /**< Longitude of ascending node of orbit plane at - weekly epoch [rad] */ - double omegadot; /**< Rate of right ascension [rad/s] */ - double w; /**< Argument of perigee [rad] */ - double inc; /**< Inclination [rad] */ - double inc_dot; /**< Inclination first derivative [rad/s] */ - double af0; /**< Polynomial clock correction coefficient (clock - bias) [s] */ - double af1; /**< Polynomial clock correction coefficient (clock - drift) [s/s] */ - double af2; /**< Polynomial clock correction coefficient (rate of - clock drift) [s/s^2] */ - double toe_tow; /**< Time of week [s] */ + double tgd; /**< Group delay differential between L1 and L2 [s] */ + double c_rs; /**< Amplitude of the sine harmonic correction term to + the orbit radius [m] */ + double c_rc; /**< Amplitude of the cosine harmonic correction term to + the orbit radius [m] */ + double c_uc; /**< Amplitude of the cosine harmonic correction term to + the argument of latitude [rad] */ + double c_us; /**< Amplitude of the sine harmonic correction term to + the argument of latitude [rad] */ + double c_ic; /**< Amplitude of the cosine harmonic correction term to + the angle of inclination [rad] */ + double c_is; /**< Amplitude of the sine harmonic correction term to + the angle of inclination [rad] */ + double dn; /**< Mean motion difference [rad/s] */ + double m0; /**< Mean anomaly at reference time [rad] */ + double ecc; /**< Eccentricity of satellite orbit */ + double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ + double omega0; /**< Longitude of ascending node of orbit plane at + weekly epoch [rad] */ + double omegadot; /**< Rate of right ascension [rad/s] */ + double w; /**< Argument of perigee [rad] */ + double inc; /**< Inclination [rad] */ + double inc_dot; /**< Inclination first derivative [rad/s] */ + double af0; /**< Polynomial clock correction coefficient (clock + bias) [s] */ + double af1; /**< Polynomial clock correction coefficient (clock + drift) [s/s] */ + double af2; /**< Polynomial clock correction coefficient (rate of + clock drift) [s/s^2] */ + double toe_tow; /**< Time of week [s] */ u16 toe_wn; /**< Week number [week] */ - double toc_tow; /**< Clock reference time of week [s] */ + double toc_tow; /**< Clock reference time of week [s] */ u16 toc_wn; /**< Clock reference week number [week] */ - u8 valid; /**< Is valid? */ - u8 healthy; /**< Satellite is healthy? */ - gnss_signal_dep_t sid; /**< GNSS signal identifier */ - u8 iode; /**< Issue of ephemeris data */ - u16 iodc; /**< Issue of clock data */ - u32 reserved; /**< Reserved field */ + u8 valid; /**< Is valid? */ + u8 healthy; /**< Satellite is healthy? */ + gnss_signal_dep_t sid; /**< GNSS signal identifier */ + u8 iode; /**< Issue of ephemeris data */ + u16 iodc; /**< Issue of clock data */ + u32 reserved; /**< Reserved field */ } msg_ephemeris_dep_c_t; - /** Header for observation message * * Header of a GPS observation message. */ typedef struct SBP_ATTR_PACKED { - gps_time_dep_t t; /**< GPS time of this observation */ - u8 n_obs; /**< Total number of observations. First nibble is the size of - the sequence (n), second nibble is the zero-indexed - counter (ith packet of n) */ + gps_time_dep_t t; /**< GPS time of this observation */ + u8 n_obs; /**< Total number of observations. First nibble is the size of + the sequence (n), second nibble is the zero-indexed + counter (ith packet of n) */ } observation_header_dep_t; - /** GPS carrier phase measurement * * Carrier phase measurement in cycles represented as a 40-bit fixed point @@ -901,28 +870,26 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - s32 i; /**< Carrier phase whole cycles [cycles] */ - u8 f; /**< Carrier phase fractional part [cycles / 256] */ + s32 i; /**< Carrier phase whole cycles [cycles] */ + u8 f; /**< Carrier phase fractional part [cycles / 256] */ } carrier_phase_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u32 P; /**< Pseudorange observation [cm] */ - carrier_phase_dep_a_t L; /**< Carrier phase observation with opposite - sign from typical convention */ - u8 cn0; /**< Carrier-to-Noise density [dB Hz / 4] */ - u16 lock; /**< Lock indicator. This value changes whenever a satellite - signal has lost and regained lock, indicating that the - carrier phase ambiguity may have changed. */ - u8 prn; /**< PRN-1 identifier of the satellite signal */ + u32 P; /**< Pseudorange observation [cm] */ + carrier_phase_dep_a_t L; /**< Carrier phase observation with opposite + sign from typical convention */ + u8 cn0; /**< Carrier-to-Noise density [dB Hz / 4] */ + u16 lock; /**< Lock indicator. This value changes whenever a satellite + signal has lost and regained lock, indicating that the + carrier phase ambiguity may have changed. */ + u8 prn; /**< PRN-1 identifier of the satellite signal */ } packed_obs_content_dep_a_t; - /** GPS observations for a particular satellite signal * * Pseudorange and carrier phase observation for a satellite being tracked. @@ -930,17 +897,16 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 P; /**< Pseudorange observation [cm] */ - carrier_phase_dep_a_t L; /**< Carrier phase observation with opposite - sign from typical convention. */ - u8 cn0; /**< Carrier-to-Noise density [dB Hz / 4] */ - u16 lock; /**< Lock indicator. This value changes whenever a satellite - signal has lost and regained lock, indicating that the - carrier phase ambiguity may have changed. */ - gnss_signal_dep_t sid; /**< GNSS signal identifier */ + u32 P; /**< Pseudorange observation [cm] */ + carrier_phase_dep_a_t L; /**< Carrier phase observation with opposite + sign from typical convention. */ + u8 cn0; /**< Carrier-to-Noise density [dB Hz / 4] */ + u16 lock; /**< Lock indicator. This value changes whenever a satellite + signal has lost and regained lock, indicating that the + carrier phase ambiguity may have changed. */ + gnss_signal_dep_t sid; /**< GNSS signal identifier */ } packed_obs_content_dep_b_t; - /** GPS observations for a particular satellite signal * * Pseudorange and carrier phase observation for a satellite being tracked. @@ -949,56 +915,52 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 P; /**< Pseudorange observation [2 cm] */ - carrier_phase_t L; /**< Carrier phase observation with typical sign - convention. [cycles] */ - u8 cn0; /**< Carrier-to-Noise density [dB Hz / 4] */ - u16 lock; /**< Lock indicator. This value changes whenever a satellite - signal has lost and regained lock, indicating that the - carrier phase ambiguity may have changed. */ - gnss_signal_dep_t sid; /**< GNSS signal identifier */ + u32 P; /**< Pseudorange observation [2 cm] */ + carrier_phase_t L; /**< Carrier phase observation with typical sign + convention. [cycles] */ + u8 cn0; /**< Carrier-to-Noise density [dB Hz / 4] */ + u16 lock; /**< Lock indicator. This value changes whenever a satellite + signal has lost and regained lock, indicating that the + carrier phase ambiguity may have changed. */ + gnss_signal_dep_t sid; /**< GNSS signal identifier */ } packed_obs_content_dep_c_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - observation_header_dep_t header; /**< Header of a GPS observation message */ - packed_obs_content_dep_a_t obs[0]; /**< Pseudorange and carrier phase - observation for a satellite being - tracked. */ + observation_header_dep_t header; /**< Header of a GPS observation message */ + packed_obs_content_dep_a_t obs[0]; /**< Pseudorange and carrier phase + observation for a satellite being + tracked. */ } msg_obs_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - observation_header_dep_t header; /**< Header of a GPS observation message */ - packed_obs_content_dep_b_t obs[0]; /**< Pseudorange and carrier phase - observation for a satellite being - tracked. */ + observation_header_dep_t header; /**< Header of a GPS observation message */ + packed_obs_content_dep_b_t obs[0]; /**< Pseudorange and carrier phase + observation for a satellite being + tracked. */ } msg_obs_dep_b_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - observation_header_dep_t header; /**< Header of a GPS observation message */ - packed_obs_content_dep_c_t obs[0]; /**< Pseudorange and carrier phase - observation for a satellite being - tracked. */ + observation_header_dep_t header; /**< Header of a GPS observation message */ + packed_obs_content_dep_c_t obs[0]; /**< Pseudorange and carrier phase + observation for a satellite being + tracked. */ } msg_obs_dep_c_t; - /** Iono corrections * * The ionospheric parameters which allow the "L1 only" or "L2 only" user to @@ -1007,56 +969,54 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - gps_time_sec_t t_nmct; /**< Navigation Message Correction Table Validity - Time */ - double a0; - double a1; - double a2; - double a3; - double b0; - double b1; - double b2; - double b3; + gps_time_sec_t t_nmct; /**< Navigation Message Correction Table Validity + Time */ + double a0; + double a1; + double a2; + double a3; + double b0; + double b1; + double b2; + double b3; } msg_iono_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - gps_time_sec_t t_nmct; /**< Navigation Message Correction Table - Validity Time */ - u32 l2c_mask; /**< L2C capability mask, SV32 bit being MSB, SV1 bit being - LSB */ + gps_time_sec_t t_nmct; /**< Navigation Message Correction Table + Validity Time */ + u32 l2c_mask; /**< L2C capability mask, SV32 bit being MSB, SV1 bit being + LSB */ } msg_sv_configuration_gps_dep_t; - - typedef struct SBP_ATTR_PACKED { - u64 gps_active; /**< GPS SV active mask */ - u64 gps_l2c; /**< GPS L2C active mask */ - u64 gps_l5; /**< GPS L5 active mask */ - u32 glo_active; /**< GLO active mask */ - u32 glo_l2of; /**< GLO L2OF active mask */ - u32 glo_l3; /**< GLO L3 active mask */ - u64 sbas_active; /**< SBAS active mask (PRNs 120..158, AN 7/62.2.2-18/18 - Table B-23, - https://www.caat.or.th/wp-content/uploads/2018/03/SL-2018.18.E-1.pdf) */ - u64 sbas_l5; /**< SBAS L5 active mask (PRNs 120..158, AN - 7/62.2.2-18/18 Table B-23, - https://www.caat.or.th/wp-content/uploads/2018/03/SL-2018.18.E-1.pdf) */ - u64 bds_active; /**< BDS active mask */ - u64 bds_d2nav; /**< BDS D2NAV active mask */ - u64 bds_b2; /**< BDS B2 active mask */ - u64 bds_b2a; /**< BDS B2A active mask */ - u32 qzss_active; /**< QZSS active mask */ - u64 gal_active; /**< GAL active mask */ - u64 gal_e5; /**< GAL E5 active mask */ + u64 gps_active; /**< GPS SV active mask */ + u64 gps_l2c; /**< GPS L2C active mask */ + u64 gps_l5; /**< GPS L5 active mask */ + u32 glo_active; /**< GLO active mask */ + u32 glo_l2of; /**< GLO L2OF active mask */ + u32 glo_l3; /**< GLO L3 active mask */ + u64 sbas_active; /**< SBAS active mask (PRNs 120..158, AN 7/62.2.2-18/18 + Table B-23, + https://www.caat.or.th/wp-content/uploads/2018/03/SL-2018.18.E-1.pdf) + */ + u64 sbas_l5; /**< SBAS L5 active mask (PRNs 120..158, AN + 7/62.2.2-18/18 Table B-23, + https://www.caat.or.th/wp-content/uploads/2018/03/SL-2018.18.E-1.pdf) + */ + u64 bds_active; /**< BDS active mask */ + u64 bds_d2nav; /**< BDS D2NAV active mask */ + u64 bds_b2; /**< BDS B2 active mask */ + u64 bds_b2a; /**< BDS B2A active mask */ + u32 qzss_active; /**< QZSS active mask */ + u64 gal_active; /**< GAL active mask */ + u64 gal_e5; /**< GAL E5 active mask */ } gnss_capb_t; - /** GNSS capabilities masks * * Bit masks of signal capabilities for each GNSS satellite PRN. @@ -1064,144 +1024,135 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - gps_time_sec_t t_nmct; /**< Navigation Message Correction Table Validity - Time */ + gps_time_sec_t t_nmct; /**< Navigation Message Correction Table Validity + Time */ gnss_capb_t gc; /**< GNSS capabilities masks */ } msg_gnss_capb_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - gps_time_dep_t t_op; /**< Data Predict Time of Week */ - u8 prn; /**< Satellite number */ - u8 valid; /**< bit-field indicating validity of the values, LSB - indicating tgd validity etc. 1 = value is valid, 0 = - value is not valid. */ - s16 tgd; - s16 isc_l1ca; - s16 isc_l2c; + gps_time_dep_t t_op; /**< Data Predict Time of Week */ + u8 prn; /**< Satellite number */ + u8 valid; /**< bit-field indicating validity of the values, LSB + indicating tgd validity etc. 1 = value is valid, 0 = + value is not valid. */ + s16 tgd; + s16 isc_l1ca; + s16 isc_l2c; } msg_group_delay_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - gps_time_sec_t t_op; /**< Data Predict Time of Week */ - gnss_signal_dep_t sid; /**< GNSS signal identifier */ - u8 valid; /**< bit-field indicating validity of the values, LSB - indicating tgd validity etc. 1 = value is valid, 0 = - value is not valid. */ - s16 tgd; - s16 isc_l1ca; - s16 isc_l2c; + gps_time_sec_t t_op; /**< Data Predict Time of Week */ + gnss_signal_dep_t sid; /**< GNSS signal identifier */ + u8 valid; /**< bit-field indicating validity of the values, LSB + indicating tgd validity etc. 1 = value is valid, 0 = + value is not valid. */ + s16 tgd; + s16 isc_l1ca; + s16 isc_l2c; } msg_group_delay_dep_b_t; - /** Group Delay * * Please see ICD-GPS-200 (30.3.3.3.1.1) for more details. */ typedef struct SBP_ATTR_PACKED { - gps_time_sec_t t_op; /**< Data Predict Time of Week */ - sbp_gnss_signal_t sid; /**< GNSS signal identifier */ - u8 valid; /**< bit-field indicating validity of the values, LSB - indicating tgd validity etc. 1 = value is valid, 0 = - value is not valid. */ - s16 tgd; - s16 isc_l1ca; - s16 isc_l2c; + gps_time_sec_t t_op; /**< Data Predict Time of Week */ + sbp_gnss_signal_t sid; /**< GNSS signal identifier */ + u8 valid; /**< bit-field indicating validity of the values, LSB + indicating tgd validity etc. 1 = value is valid, 0 = + value is not valid. */ + s16 tgd; + s16 isc_l1ca; + s16 isc_l2c; } msg_group_delay_t; - - typedef struct SBP_ATTR_PACKED { - sbp_gnss_signal_t sid; /**< GNSS signal identifier */ - gps_time_sec_t toa; /**< Reference time of almanac */ - double ura; /**< User Range Accuracy [m] */ - u32 fit_interval; /**< Curve fit interval [s] */ - u8 valid; /**< Status of almanac, 1 = valid, 0 = invalid */ - u8 health_bits; /**< Satellite health status for GPS: - - bits 5-7: NAV data health status. See IS- - GPS-200H - Table 20-VII: NAV Data Health Indications. - - bits 0-4: Signal health status. See IS-GPS-200H - Table 20-VIII. Codes for Health of SV Signal - Components. - Satellite health status for GLO (see GLO ICD 5.1 - table 5.1 for details): - - bit 0: C(n), "unhealthy" flag that is - transmitted within - non-immediate data and indicates overall - constellation status - at the moment of almanac uploading. - '0' indicates malfunction of n-satellite. - '1' indicates that n-satellite is operational. - - bit 1: Bn(ln), '0' indicates the satellite is - operational - and suitable for navigation. */ + sbp_gnss_signal_t sid; /**< GNSS signal identifier */ + gps_time_sec_t toa; /**< Reference time of almanac */ + double ura; /**< User Range Accuracy [m] */ + u32 fit_interval; /**< Curve fit interval [s] */ + u8 valid; /**< Status of almanac, 1 = valid, 0 = invalid */ + u8 health_bits; /**< Satellite health status for GPS: + - bits 5-7: NAV data health status. See IS- + GPS-200H + Table 20-VII: NAV Data Health Indications. + - bits 0-4: Signal health status. See IS-GPS-200H + Table 20-VIII. Codes for Health of SV Signal + Components. + Satellite health status for GLO (see GLO ICD 5.1 + table 5.1 for details): + - bit 0: C(n), "unhealthy" flag that is + transmitted within + non-immediate data and indicates overall + constellation status + at the moment of almanac uploading. + '0' indicates malfunction of n-satellite. + '1' indicates that n-satellite is operational. + - bit 1: Bn(ln), '0' indicates the satellite is + operational + and suitable for navigation. */ } almanac_common_content_t; - - typedef struct SBP_ATTR_PACKED { - gnss_signal_dep_t sid; /**< GNSS signal identifier */ - gps_time_sec_t toa; /**< Reference time of almanac */ - double ura; /**< User Range Accuracy [m] */ - u32 fit_interval; /**< Curve fit interval [s] */ - u8 valid; /**< Status of almanac, 1 = valid, 0 = invalid */ - u8 health_bits; /**< Satellite health status for GPS: - - bits 5-7: NAV data health status. See IS- - GPS-200H - Table 20-VII: NAV Data Health Indications. - - bits 0-4: Signal health status. See IS-GPS-200H - Table 20-VIII. Codes for Health of SV Signal - Components. - Satellite health status for GLO (see GLO ICD 5.1 - table 5.1 for details): - - bit 0: C(n), "unhealthy" flag that is - transmitted within - non-immediate data and indicates overall - constellation status - at the moment of almanac uploading. - '0' indicates malfunction of n-satellite. - '1' indicates that n-satellite is operational. - - bit 1: Bn(ln), '0' indicates the satellite is - operational - and suitable for navigation. */ + gnss_signal_dep_t sid; /**< GNSS signal identifier */ + gps_time_sec_t toa; /**< Reference time of almanac */ + double ura; /**< User Range Accuracy [m] */ + u32 fit_interval; /**< Curve fit interval [s] */ + u8 valid; /**< Status of almanac, 1 = valid, 0 = invalid */ + u8 health_bits; /**< Satellite health status for GPS: + - bits 5-7: NAV data health status. See IS- + GPS-200H + Table 20-VII: NAV Data Health Indications. + - bits 0-4: Signal health status. See IS-GPS-200H + Table 20-VIII. Codes for Health of SV Signal + Components. + Satellite health status for GLO (see GLO ICD 5.1 + table 5.1 for details): + - bit 0: C(n), "unhealthy" flag that is + transmitted within + non-immediate data and indicates overall + constellation status + at the moment of almanac uploading. + '0' indicates malfunction of n-satellite. + '1' indicates that n-satellite is operational. + - bit 1: Bn(ln), '0' indicates the satellite is + operational + and suitable for navigation. */ } almanac_common_content_dep_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - almanac_common_content_dep_t common; /**< Values common for all almanac - types */ - double m0; /**< Mean anomaly at reference time [rad] */ - double ecc; /**< Eccentricity of satellite orbit */ - double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ - double omega0; /**< Longitude of ascending node of orbit plane at - weekly epoch [rad] */ - double omegadot; /**< Rate of right ascension [rad/s] */ - double w; /**< Argument of perigee [rad] */ - double inc; /**< Inclination [rad] */ - double af0; /**< Polynomial clock correction coefficient (clock - bias) [s] */ - double af1; /**< Polynomial clock correction coefficient (clock - drift) [s/s] */ + almanac_common_content_dep_t common; /**< Values common for all almanac + types */ + double m0; /**< Mean anomaly at reference time [rad] */ + double ecc; /**< Eccentricity of satellite orbit */ + double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ + double omega0; /**< Longitude of ascending node of orbit plane at + weekly epoch [rad] */ + double omegadot; /**< Rate of right ascension [rad/s] */ + double w; /**< Argument of perigee [rad] */ + double inc; /**< Inclination [rad] */ + double af0; /**< Polynomial clock correction coefficient (clock + bias) [s] */ + double af1; /**< Polynomial clock correction coefficient (clock + drift) [s/s] */ } msg_almanac_gps_dep_t; - /** Satellite broadcast almanac for GPS * * The almanac message returns a set of satellite orbit parameters. Almanac @@ -1211,42 +1162,42 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - almanac_common_content_t common; /**< Values common for all almanac - types */ - double m0; /**< Mean anomaly at reference time [rad] */ - double ecc; /**< Eccentricity of satellite orbit */ - double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ - double omega0; /**< Longitude of ascending node of orbit plane at - weekly epoch [rad] */ - double omegadot; /**< Rate of right ascension [rad/s] */ - double w; /**< Argument of perigee [rad] */ - double inc; /**< Inclination [rad] */ - double af0; /**< Polynomial clock correction coefficient (clock - bias) [s] */ - double af1; /**< Polynomial clock correction coefficient (clock - drift) [s/s] */ + almanac_common_content_t common; /**< Values common for all almanac + types */ + double m0; /**< Mean anomaly at reference time [rad] */ + double ecc; /**< Eccentricity of satellite orbit */ + double sqrta; /**< Square root of the semi-major axis of orbit [m^(1/2)] */ + double omega0; /**< Longitude of ascending node of orbit plane at + weekly epoch [rad] */ + double omegadot; /**< Rate of right ascension [rad/s] */ + double w; /**< Argument of perigee [rad] */ + double inc; /**< Inclination [rad] */ + double af0; /**< Polynomial clock correction coefficient (clock + bias) [s] */ + double af1; /**< Polynomial clock correction coefficient (clock + drift) [s/s] */ } msg_almanac_gps_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - almanac_common_content_dep_t common; /**< Values common for all - almanac types */ - double lambda_na; /**< Longitude of the first ascending node of the - orbit in PZ-90.02 coordinate system [rad] */ - double t_lambda_na; /**< Time of the first ascending node passage [s] */ - double i; /**< Value of inclination at instant of t_lambda [rad] */ - double t; /**< Value of Draconian period at instant of t_lambda [s/orbital period] */ - double t_dot; /**< Rate of change of the Draconian period [s/(orbital period^2)] */ - double epsilon; /**< Eccentricity at instant of t_lambda */ - double omega; /**< Argument of perigee at instant of t_lambda [rad] */ + almanac_common_content_dep_t common; /**< Values common for all + almanac types */ + double lambda_na; /**< Longitude of the first ascending node of the + orbit in PZ-90.02 coordinate system [rad] */ + double t_lambda_na; /**< Time of the first ascending node passage [s] */ + double i; /**< Value of inclination at instant of t_lambda [rad] */ + double t; /**< Value of Draconian period at instant of t_lambda [s/orbital + period] */ + double t_dot; /**< Rate of change of the Draconian period [s/(orbital + period^2)] */ + double epsilon; /**< Eccentricity at instant of t_lambda */ + double omega; /**< Argument of perigee at instant of t_lambda [rad] */ } msg_almanac_glo_dep_t; - /** Satellite broadcast almanac for GLO * * The almanac message returns a set of satellite orbit parameters. Almanac @@ -1256,19 +1207,20 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - almanac_common_content_t common; /**< Values common for all almanac - types */ - double lambda_na; /**< Longitude of the first ascending node of the - orbit in PZ-90.02 coordinate system [rad] */ - double t_lambda_na; /**< Time of the first ascending node passage [s] */ - double i; /**< Value of inclination at instant of t_lambda [rad] */ - double t; /**< Value of Draconian period at instant of t_lambda [s/orbital period] */ - double t_dot; /**< Rate of change of the Draconian period [s/(orbital period^2)] */ - double epsilon; /**< Eccentricity at instant of t_lambda */ - double omega; /**< Argument of perigee at instant of t_lambda [rad] */ + almanac_common_content_t common; /**< Values common for all almanac + types */ + double lambda_na; /**< Longitude of the first ascending node of the + orbit in PZ-90.02 coordinate system [rad] */ + double t_lambda_na; /**< Time of the first ascending node passage [s] */ + double i; /**< Value of inclination at instant of t_lambda [rad] */ + double t; /**< Value of Draconian period at instant of t_lambda [s/orbital + period] */ + double t_dot; /**< Rate of change of the Draconian period [s/(orbital + period^2)] */ + double epsilon; /**< Eccentricity at instant of t_lambda */ + double omega; /**< Argument of perigee at instant of t_lambda [rad] */ } msg_almanac_glo_t; - /** GLONASS L1/L2 Code-Phase biases * * The GLONASS L1/L2 Code-Phase biases allows to perform GPS+GLONASS integer @@ -1277,26 +1229,24 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 mask; /**< GLONASS FDMA signals mask [boolean] */ - s16 l1ca_bias; /**< GLONASS L1 C/A Code-Phase Bias [m * 0.02] */ - s16 l1p_bias; /**< GLONASS L1 P Code-Phase Bias [m * 0.02] */ - s16 l2ca_bias; /**< GLONASS L2 C/A Code-Phase Bias [m * 0.02] */ - s16 l2p_bias; /**< GLONASS L2 P Code-Phase Bias [m * 0.02] */ + u8 mask; /**< GLONASS FDMA signals mask [boolean] */ + s16 l1ca_bias; /**< GLONASS L1 C/A Code-Phase Bias [m * 0.02] */ + s16 l1p_bias; /**< GLONASS L1 P Code-Phase Bias [m * 0.02] */ + s16 l2ca_bias; /**< GLONASS L2 C/A Code-Phase Bias [m * 0.02] */ + s16 l2p_bias; /**< GLONASS L2 P Code-Phase Bias [m * 0.02] */ } msg_glo_biases_t; - /** Satellite azimuth and elevation * * Satellite azimuth and elevation. */ typedef struct SBP_ATTR_PACKED { - sbp_gnss_signal_t sid; /**< GNSS signal identifier */ - u8 az; /**< Azimuth angle (range 0..179) [deg * 2] */ - s8 el; /**< Elevation angle (range -90..90) [deg] */ + sbp_gnss_signal_t sid; /**< GNSS signal identifier */ + u8 az; /**< Azimuth angle (range 0..179) [deg * 2] */ + s8 el; /**< Elevation angle (range -90..90) [deg] */ } sv_az_el_t; - /** Satellite azimuths and elevations * * Azimuth and elevation angles of all the visible satellites that the device @@ -1307,19 +1257,17 @@ typedef struct SBP_ATTR_PACKED { sv_az_el_t azel[0]; /**< Azimuth and elevation per satellite */ } msg_sv_az_el_t; - /** OSR corrections * * The OSR message contains network corrections in an observation-like format. */ typedef struct SBP_ATTR_PACKED { - observation_header_t header; /**< Header of a GPS observation message */ - packed_osr_content_t obs[0]; /**< Network correction for a satellite - signal. */ + observation_header_t header; /**< Header of a GPS observation message */ + packed_osr_content_t obs[0]; /**< Network correction for a satellite + signal. */ } msg_osr_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/orientation.h b/c/include/libsbp/legacy/orientation.h index 5c0ae2927..541871630 100644 --- a/c/include/libsbp/legacy/orientation.h +++ b/c/include/libsbp/legacy/orientation.h @@ -27,14 +27,14 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Heading relative to True North * * This message reports the baseline heading pointing from the base station to @@ -44,13 +44,12 @@ SBP_PACK_START */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - u32 heading; /**< Heading [mdeg] */ - u8 n_sats; /**< Number of satellites used in solution */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + u32 heading; /**< Heading [mdeg] */ + u8 n_sats; /**< Number of satellites used in solution */ + u8 flags; /**< Status flags */ } msg_baseline_heading_t; - /** Quaternion 4 component vector * * This message reports the quaternion vector describing the vehicle body @@ -62,19 +61,18 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 w; /**< Real component [2^-31] */ - s32 x; /**< 1st imaginary component [2^-31] */ - s32 y; /**< 2nd imaginary component [2^-31] */ - s32 z; /**< 3rd imaginary component [2^-31] */ - float w_accuracy; /**< Estimated standard deviation of w [N/A] */ - float x_accuracy; /**< Estimated standard deviation of x [N/A] */ - float y_accuracy; /**< Estimated standard deviation of y [N/A] */ - float z_accuracy; /**< Estimated standard deviation of z [N/A] */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 w; /**< Real component [2^-31] */ + s32 x; /**< 1st imaginary component [2^-31] */ + s32 y; /**< 2nd imaginary component [2^-31] */ + s32 z; /**< 3rd imaginary component [2^-31] */ + float w_accuracy; /**< Estimated standard deviation of w [N/A] */ + float x_accuracy; /**< Estimated standard deviation of x [N/A] */ + float y_accuracy; /**< Estimated standard deviation of y [N/A] */ + float z_accuracy; /**< Estimated standard deviation of z [N/A] */ u8 flags; /**< Status flags */ } msg_orient_quat_t; - /** Euler angles * * This message reports the yaw, pitch, and roll angles of the vehicle body @@ -86,17 +84,19 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 roll; /**< rotation about the forward axis of the vehicle [microdegrees] */ - s32 pitch; /**< rotation about the rightward axis of the vehicle [microdegrees] */ - s32 yaw; /**< rotation about the downward axis of the vehicle [microdegrees] */ - float roll_accuracy; /**< Estimated standard deviation of roll [degrees] */ - float pitch_accuracy; /**< Estimated standard deviation of pitch [degrees] */ - float yaw_accuracy; /**< Estimated standard deviation of yaw [degrees] */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 roll; /**< rotation about the forward axis of the vehicle [microdegrees] + */ + s32 pitch; /**< rotation about the rightward axis of the vehicle + [microdegrees] */ + s32 yaw; /**< rotation about the downward axis of the vehicle [microdegrees] + */ + float roll_accuracy; /**< Estimated standard deviation of roll [degrees] */ + float pitch_accuracy; /**< Estimated standard deviation of pitch [degrees] */ + float yaw_accuracy; /**< Estimated standard deviation of yaw [degrees] */ u8 flags; /**< Status flags */ } msg_orient_euler_t; - /** Vehicle Body Frame instantaneous angular rates * * This message reports the orientation rates in the vehicle body frame. The @@ -111,14 +111,13 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - s32 x; /**< angular rate about x axis [microdegrees/s] */ - s32 y; /**< angular rate about y axis [microdegrees/s] */ - s32 z; /**< angular rate about z axis [microdegrees/s] */ - u8 flags; /**< Status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + s32 x; /**< angular rate about x axis [microdegrees/s] */ + s32 y; /**< angular rate about y axis [microdegrees/s] */ + s32 z; /**< angular rate about z axis [microdegrees/s] */ + u8 flags; /**< Status flags */ } msg_angular_rate_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/piksi.h b/c/include/libsbp/legacy/piksi.h index 230237e0e..5bac269e7 100644 --- a/c/include/libsbp/legacy/piksi.h +++ b/c/include/libsbp/legacy/piksi.h @@ -27,47 +27,43 @@ #include -#include #include +#include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Legacy message to load satellite almanac (host => Piksi) * * This is a legacy message for sending and loading a satellite alamanac onto * the Piksi's flash memory from the host. */ - /** Send GPS time from host (host => Piksi) * * This message sets up timing functionality using a coarse GPS time estimate * sent by the host. */ - /** Reset the device (host => Piksi) * * This message from the host resets the Piksi back into the bootloader. */ typedef struct SBP_ATTR_PACKED { - u32 flags; /**< Reset flags */ + u32 flags; /**< Reset flags */ } msg_reset_t; - /** Deprecated * * Deprecated. */ - /** Legacy message for CW interference channel (Piksi => host) * * This is an unused legacy message for result reporting from the CW @@ -75,7 +71,6 @@ typedef struct SBP_ATTR_PACKED { * future release. */ - /** Legacy message for CW interference channel (host => Piksi) * * This is an unused legacy message from the host for starting the CW @@ -83,7 +78,6 @@ typedef struct SBP_ATTR_PACKED { * future release. */ - /** Reset IAR filters (host => Piksi) * * This message resets either the DGNSS Kalman filters or Integer Ambiguity @@ -91,16 +85,14 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 filter; /**< Filter flags */ + u8 filter; /**< Filter flags */ } msg_reset_filters_t; - /** Deprecated * * Deprecated. */ - /** State of an RTOS thread * * The thread usage message from the device reports real-time operating system @@ -109,13 +101,12 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - char name[20]; /**< Thread name (NULL terminated) */ - u16 cpu; /**< Percentage cpu use for this thread. Values range - from 0 - 1000 and needs to be renormalized to 100 */ - u32 stack_free; /**< Free stack space for this thread [bytes] */ + char name[20]; /**< Thread name (NULL terminated) */ + u16 cpu; /**< Percentage cpu use for this thread. Values range + from 0 - 1000 and needs to be renormalized to 100 */ + u32 stack_free; /**< Free stack space for this thread [bytes] */ } msg_thread_state_t; - /** State of the UART channel * * Throughput, utilization, and error counts on the RX/TX buffers of this UART @@ -123,17 +114,16 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - float tx_throughput; /**< UART transmit throughput [kB/s] */ - float rx_throughput; /**< UART receive throughput [kB/s] */ - u16 crc_error_count; /**< UART CRC error count */ - u16 io_error_count; /**< UART IO error count */ - u8 tx_buffer_level; /**< UART transmit buffer percentage utilization - (ranges from 0 to 255) */ - u8 rx_buffer_level; /**< UART receive buffer percentage utilization - (ranges from 0 to 255) */ + float tx_throughput; /**< UART transmit throughput [kB/s] */ + float rx_throughput; /**< UART receive throughput [kB/s] */ + u16 crc_error_count; /**< UART CRC error count */ + u16 io_error_count; /**< UART IO error count */ + u8 tx_buffer_level; /**< UART transmit buffer percentage utilization + (ranges from 0 to 255) */ + u8 rx_buffer_level; /**< UART receive buffer percentage utilization + (ranges from 0 to 255) */ } uart_channel_t; - /** base station observation message receipt period * * Statistics on the period of observations received from the base station. As @@ -144,13 +134,12 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - s32 avg; /**< Average period [ms] */ - s32 pmin; /**< Minimum period [ms] */ - s32 pmax; /**< Maximum period [ms] */ - s32 current; /**< Smoothed estimate of the current period [ms] */ + s32 avg; /**< Average period [ms] */ + s32 pmin; /**< Minimum period [ms] */ + s32 pmax; /**< Maximum period [ms] */ + s32 current; /**< Smoothed estimate of the current period [ms] */ } period_t; - /** Receiver-to-base station latency * * Statistics on the latency of observations received from the base station. @@ -160,13 +149,12 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - s32 avg; /**< Average latency [ms] */ - s32 lmin; /**< Minimum latency [ms] */ - s32 lmax; /**< Maximum latency [ms] */ - s32 current; /**< Smoothed estimate of the current latency [ms] */ + s32 avg; /**< Average latency [ms] */ + s32 lmin; /**< Minimum latency [ms] */ + s32 lmax; /**< Maximum latency [ms] */ + s32 current; /**< Smoothed estimate of the current latency [ms] */ } latency_t; - /** State of the UART channels * * The UART message reports data latency and throughput of the UART channels @@ -180,27 +168,25 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - uart_channel_t uart_a; /**< State of UART A */ - uart_channel_t uart_b; /**< State of UART B */ - uart_channel_t uart_ftdi; /**< State of UART FTDI (USB logger) */ - latency_t latency; /**< UART communication latency */ - period_t obs_period; /**< Observation receipt period */ + uart_channel_t uart_a; /**< State of UART A */ + uart_channel_t uart_b; /**< State of UART B */ + uart_channel_t uart_ftdi; /**< State of UART FTDI (USB logger) */ + latency_t latency; /**< UART communication latency */ + period_t obs_period; /**< Observation receipt period */ } msg_uart_state_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - uart_channel_t uart_a; /**< State of UART A */ - uart_channel_t uart_b; /**< State of UART B */ - uart_channel_t uart_ftdi; /**< State of UART FTDI (USB logger) */ - latency_t latency; /**< UART communication latency */ + uart_channel_t uart_a; /**< State of UART A */ + uart_channel_t uart_b; /**< State of UART B */ + uart_channel_t uart_ftdi; /**< State of UART FTDI (USB logger) */ + latency_t latency; /**< UART communication latency */ } msg_uart_state_depa_t; - /** State of the Integer Ambiguity Resolution (IAR) process * * This message reports the state of the Integer Ambiguity Resolution (IAR) @@ -209,10 +195,9 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 num_hyps; /**< Number of integer ambiguity hypotheses remaining */ + u32 num_hyps; /**< Number of integer ambiguity hypotheses remaining */ } msg_iar_state_t; - /** Mask a satellite from use in Piksi subsystems * * This message allows setting a mask to prevent a particular satellite from @@ -220,22 +205,20 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 mask; /**< Mask of systems that should ignore this satellite. */ - sbp_gnss_signal_t sid; /**< GNSS signal for which the mask is applied */ + u8 mask; /**< Mask of systems that should ignore this satellite. */ + sbp_gnss_signal_t sid; /**< GNSS signal for which the mask is applied */ } msg_mask_satellite_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u8 mask; /**< Mask of systems that should ignore this satellite. */ - gnss_signal_dep_t sid; /**< GNSS signal for which the mask is applied */ + u8 mask; /**< Mask of systems that should ignore this satellite. */ + gnss_signal_dep_t sid; /**< GNSS signal for which the mask is applied */ } msg_mask_satellite_dep_t; - /** Device temperature and voltage levels * * This message contains temperature and voltage level measurements from the @@ -244,14 +227,14 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - s16 dev_vin; /**< Device V_in [V / 1000] */ - s16 cpu_vint; /**< Processor V_int [V / 1000] */ - s16 cpu_vaux; /**< Processor V_aux [V / 1000] */ - s16 cpu_temperature; /**< Processor temperature [degrees C / 100] */ - s16 fe_temperature; /**< Frontend temperature (if available) [degrees C / 100] */ + s16 dev_vin; /**< Device V_in [V / 1000] */ + s16 cpu_vint; /**< Processor V_int [V / 1000] */ + s16 cpu_vaux; /**< Processor V_aux [V / 1000] */ + s16 cpu_temperature; /**< Processor temperature [degrees C / 100] */ + s16 fe_temperature; /**< Frontend temperature (if available) [degrees C / 100] + */ } msg_device_monitor_t; - /** Execute a command (host => device) * * Request the recipient to execute an command. Output will be sent in MSG_LOG @@ -260,10 +243,9 @@ typedef struct SBP_ATTR_PACKED { typedef struct SBP_ATTR_PACKED { u32 sequence; /**< Sequence number */ - char command[0]; /**< Command line to execute */ + char command[0]; /**< Command line to execute */ } msg_command_req_t; - /** Exit code from executed command (device => host) * * The response to MSG_COMMAND_REQ with the return code of the command. A @@ -271,11 +253,10 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 sequence; /**< Sequence number */ - s32 code; /**< Exit code */ + u32 sequence; /**< Sequence number */ + s32 code; /**< Exit code */ } msg_command_resp_t; - /** Command output * * Returns the standard output and standard error of the command requested by @@ -284,18 +265,16 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 sequence; /**< Sequence number */ - char line[0]; /**< Line of standard output or standard error */ + u32 sequence; /**< Sequence number */ + char line[0]; /**< Line of standard output or standard error */ } msg_command_output_t; - /** Request state of Piksi network interfaces * * Request state of Piksi network interfaces. Output will be sent in * MSG_NETWORK_STATE_RESP messages. */ - /** State of network interface * * The state of a network interface on the Piksi. Data is made to reflect @@ -303,17 +282,16 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 ipv4_address[4]; /**< IPv4 address (all zero when unavailable) */ - u8 ipv4_mask_size; /**< IPv4 netmask CIDR notation */ - u8 ipv6_address[16]; /**< IPv6 address (all zero when unavailable) */ - u8 ipv6_mask_size; /**< IPv6 netmask CIDR notation */ - u32 rx_bytes; /**< Number of Rx bytes */ - u32 tx_bytes; /**< Number of Tx bytes */ + u8 ipv4_address[4]; /**< IPv4 address (all zero when unavailable) */ + u8 ipv4_mask_size; /**< IPv4 netmask CIDR notation */ + u8 ipv6_address[16]; /**< IPv6 address (all zero when unavailable) */ + u8 ipv6_mask_size; /**< IPv6 netmask CIDR notation */ + u32 rx_bytes; /**< Number of Rx bytes */ + u32 tx_bytes; /**< Number of Tx bytes */ char interface_name[16]; /**< Interface Name */ - u32 flags; /**< Interface flags from SIOCGIFFLAGS */ + u32 flags; /**< Interface flags from SIOCGIFFLAGS */ } msg_network_state_resp_t; - /** Bandwidth usage measurement for a single interface * * The bandwidth usage for each interface can be reported within this struct @@ -324,15 +302,14 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u64 duration; /**< Duration over which the measurement was - collected [ms] */ - u64 total_bytes; /**< Number of bytes handled in total within period */ - u32 rx_bytes; /**< Number of bytes transmitted within period */ - u32 tx_bytes; /**< Number of bytes received within period */ + u64 duration; /**< Duration over which the measurement was + collected [ms] */ + u64 total_bytes; /**< Number of bytes handled in total within period */ + u32 rx_bytes; /**< Number of bytes transmitted within period */ + u32 tx_bytes; /**< Number of bytes received within period */ char interface_name[16]; /**< Interface Name */ } network_usage_t; - /** Bandwidth usage reporting message * * The bandwidth usage, a list of usage by interface. @@ -342,7 +319,6 @@ typedef struct SBP_ATTR_PACKED { network_usage_t interfaces[0]; /**< Usage measurement array */ } msg_network_bandwidth_usage_t; - /** Cell modem information update message * * If a cell modem is present on a piksi device, this message will be send @@ -353,46 +329,45 @@ typedef struct SBP_ATTR_PACKED { typedef struct SBP_ATTR_PACKED { s8 signal_strength; /**< Received cell signal strength in dBm, zero translates to unknown [dBm] */ - float signal_error_rate; /**< BER as reported by the modem, zero - translates to unknown */ + float signal_error_rate; /**< BER as reported by the modem, zero + translates to unknown */ u8 reserved[0]; /**< Unspecified data TBD for this schema */ } msg_cell_modem_status_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u16 channel_tag; /**< Channel ID */ - gps_time_dep_t t; /**< Receiver time of this observation */ - float freq_ref; /**< Reference frequency of this packet [MHz] */ - float freq_step; /**< Frequency step of points in this packet [MHz] */ - float amplitude_ref; /**< Reference amplitude of this packet [dB] */ - float amplitude_unit; /**< Amplitude unit value of points in this packet [dB] */ + u16 channel_tag; /**< Channel ID */ + gps_time_dep_t t; /**< Receiver time of this observation */ + float freq_ref; /**< Reference frequency of this packet [MHz] */ + float freq_step; /**< Frequency step of points in this packet [MHz] */ + float amplitude_ref; /**< Reference amplitude of this packet [dB] */ + float + amplitude_unit; /**< Amplitude unit value of points in this packet [dB] */ u8 amplitude_value[0]; /**< Amplitude values (in the above units) of points in this packet */ } msg_specan_dep_t; - /** Spectrum analyzer * * Spectrum analyzer packet. */ typedef struct SBP_ATTR_PACKED { - u16 channel_tag; /**< Channel ID */ - sbp_gps_time_t t; /**< Receiver time of this observation */ - float freq_ref; /**< Reference frequency of this packet [MHz] */ - float freq_step; /**< Frequency step of points in this packet [MHz] */ - float amplitude_ref; /**< Reference amplitude of this packet [dB] */ - float amplitude_unit; /**< Amplitude unit value of points in this packet [dB] */ + u16 channel_tag; /**< Channel ID */ + sbp_gps_time_t t; /**< Receiver time of this observation */ + float freq_ref; /**< Reference frequency of this packet [MHz] */ + float freq_step; /**< Frequency step of points in this packet [MHz] */ + float amplitude_ref; /**< Reference amplitude of this packet [dB] */ + float + amplitude_unit; /**< Amplitude unit value of points in this packet [dB] */ u8 amplitude_value[0]; /**< Amplitude values (in the above units) of points in this packet */ } msg_specan_t; - /** RF AGC status * * This message describes the gain of each channel in the receiver frontend. @@ -406,10 +381,10 @@ typedef struct SBP_ATTR_PACKED { typedef struct SBP_ATTR_PACKED { s8 rf_gain[8]; /**< RF gain for each frontend channel [percent] */ - s8 if_gain[8]; /**< Intermediate frequency gain for each frontend channel [percent] */ + s8 if_gain[8]; /**< Intermediate frequency gain for each frontend channel + [percent] */ } msg_front_end_gain_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/sbas.h b/c/include/libsbp/legacy/sbas.h index 5cc235796..68874c03e 100644 --- a/c/include/libsbp/legacy/sbas.h +++ b/c/include/libsbp/legacy/sbas.h @@ -25,17 +25,17 @@ #include -#include #include +#include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Raw SBAS data * * This message is sent once per second per SBAS satellite. ME checks the @@ -43,14 +43,13 @@ SBP_PACK_START */ typedef struct SBP_ATTR_PACKED { - sbp_gnss_signal_t sid; /**< GNSS signal identifier. */ - u32 tow; /**< GPS time-of-week at the start of the data block. [ms] */ - u8 message_type; /**< SBAS message type (0-63) */ - u8 data[27]; /**< Raw SBAS data field of 212 bits (last byte padded - with zeros). */ + sbp_gnss_signal_t sid; /**< GNSS signal identifier. */ + u32 tow; /**< GPS time-of-week at the start of the data block. [ms] */ + u8 message_type; /**< SBAS message type (0-63) */ + u8 data[27]; /**< Raw SBAS data field of 212 bits (last byte padded + with zeros). */ } msg_sbas_raw_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/settings.h b/c/include/libsbp/legacy/settings.h index f654f32f8..cd3e9f975 100644 --- a/c/include/libsbp/legacy/settings.h +++ b/c/include/libsbp/legacy/settings.h @@ -51,21 +51,20 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Save settings to flash (host => device) * * The save settings message persists the device's current settings * configuration to its onboard flash memory file system. */ - /** Write device configuration settings (host => device) * * The setting message writes the device configuration for a particular @@ -82,7 +81,6 @@ typedef struct SBP_ATTR_PACKED { contents "SECTION_SETTING\0SETTING\0VALUE\0" */ } msg_settings_write_t; - /** Acknowledgement with status of MSG_SETTINGS_WRITE * * Return the status of a write request with the new value of the setting. If @@ -94,12 +92,11 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 status; /**< Write status */ + u8 status; /**< Write status */ char setting[0]; /**< A NULL-terminated and delimited string with contents "SECTION_SETTING\0SETTING\0VALUE\0" */ } msg_settings_write_resp_t; - /** Read device configuration settings (host => device) * * The setting message that reads the device configuration. The string field @@ -117,7 +114,6 @@ typedef struct SBP_ATTR_PACKED { contents "SECTION_SETTING\0SETTING\0" */ } msg_settings_read_req_t; - /** Read device configuration settings (host <= device) * * The setting message with which the device responds after a @@ -133,7 +129,6 @@ typedef struct SBP_ATTR_PACKED { contents "SECTION_SETTING\0SETTING\0VALUE\0" */ } msg_settings_read_resp_t; - /** Read setting by direct index (host => device) * * The settings message for iterating through the settings values. A device @@ -141,11 +136,10 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u16 index; /**< An index into the device settings, with values ranging - from 0 to length(settings). */ + u16 index; /**< An index into the device settings, with values ranging + from 0 to length(settings). */ } msg_settings_read_by_index_req_t; - /** Read setting by direct index (host <= device) * * The settings message that reports the value of a setting at an index. @@ -161,19 +155,17 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u16 index; /**< An index into the device settings, with values ranging - from 0 to length(settings) */ + u16 index; /**< An index into the device settings, with values ranging + from 0 to length(settings) */ char setting[0]; /**< A NULL-terminated and delimited string with contents "SECTION_SETTING\0SETTING\0VALUE\0FORMAT_TYPE\0" */ } msg_settings_read_by_index_resp_t; - /** Finished reading settings (host <= device) * * The settings message for indicating end of the settings values. */ - /** Register setting and default value (device => host) * * This message registers the presence and default value of a setting with a @@ -186,7 +178,6 @@ typedef struct SBP_ATTR_PACKED { "SECTION_SETTING\0SETTING\0VALUE". */ } msg_settings_register_t; - /** Register setting and default value (device <= host) * * This message responds to setting registration with the effective value. The @@ -196,13 +187,12 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 status; /**< Register status */ + u8 status; /**< Register status */ char setting[0]; /**< A NULL-terminated and delimited string with contents "SECTION_SETTING\0SETTING\0VALUE". The meaning of value is defined according to the status field. */ } msg_settings_register_resp_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/signing.h b/c/include/libsbp/legacy/signing.h index d4b09eae0..00e23cb2f 100644 --- a/c/include/libsbp/legacy/signing.h +++ b/c/include/libsbp/legacy/signing.h @@ -27,234 +27,223 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - - typedef struct SBP_ATTR_PACKED { - u16 year; /**< Year [year] */ - u8 month; /**< Month (range 1 .. 12) [months] */ - u8 day; /**< days in the month (range 1-31) [day] */ - u8 hours; /**< hours of day (range 0-23) [hours] */ - u8 minutes; /**< minutes of hour (range 0-59) [minutes] */ - u8 seconds; /**< seconds of minute (range 0-60) rounded down [seconds] */ - u32 ns; /**< nanoseconds of second (range 0-999999999) [nanoseconds] */ + u16 year; /**< Year [year] */ + u8 month; /**< Month (range 1 .. 12) [months] */ + u8 day; /**< days in the month (range 1-31) [day] */ + u8 hours; /**< hours of day (range 0-23) [hours] */ + u8 minutes; /**< minutes of hour (range 0-59) [minutes] */ + u8 seconds; /**< seconds of minute (range 0-60) rounded down [seconds] */ + u32 ns; /**< nanoseconds of second (range 0-999999999) [nanoseconds] */ } utc_time_t; - - typedef struct SBP_ATTR_PACKED { - u8 len; /**< Number of bytes to use of the signature field. The DER - encoded signature has a maximum size of 72 bytes but can - vary between 70 and 72 bytes in length. */ + u8 len; /**< Number of bytes to use of the signature field. The DER + encoded signature has a maximum size of 72 bytes but can + vary between 70 and 72 bytes in length. */ u8 data[72]; /**< DER encoded ECDSA signature for the messages using SHA-256 as the digest algorithm. */ } ecdsa_signature_t; - /** An ECDSA certificate split over multiple messages * * A DER encoded x.509 ECDSA-256 certificate (using curve secp256r1). */ typedef struct SBP_ATTR_PACKED { - u8 n_msg; /**< Total number messages that make up the - certificate. The first nibble (mask 0xF0 or - left shifted by 4 bits) is the size of the - sequence (n), second nibble (mask 0x0F) is the - zero-indexed counter (ith packet of n). */ - u8 certificate_id[4]; /**< The last 4 bytes of the certificate's SHA-1 - fingerprint */ - u8 flags; + u8 n_msg; /**< Total number messages that make up the + certificate. The first nibble (mask 0xF0 or + left shifted by 4 bits) is the size of the + sequence (n), second nibble (mask 0x0F) is the + zero-indexed counter (ith packet of n). */ + u8 certificate_id[4]; /**< The last 4 bytes of the certificate's SHA-1 + fingerprint */ + u8 flags; u8 certificate_bytes[0]; /**< DER encoded x.509 ECDSA certificate bytes */ } msg_ecdsa_certificate_t; - - typedef struct SBP_ATTR_PACKED { - u8 root_certificate[20]; /**< SHA-1 fingerprint of the root - certificate */ + u8 root_certificate[20]; /**< SHA-1 fingerprint of the root + certificate */ u8 intermediate_certificate[20]; /**< SHA-1 fingerprint of the intermediate certificate */ - u8 corrections_certificate[20]; /**< SHA-1 fingerprint of the corrections - certificate */ - utc_time_t expiration; /**< The time after which the - signature given is no longer - valid. Implementors should - consult a time source (such as - GNSS) to check if the current - time is later than the - expiration time, if the - condition is true, signatures - in the stream should not be - considered valid. */ - ecdsa_signature_t signature; /**< Signature (created by - the root certificate) - over the concatenation - of the SBP payload bytes - preceding this field. - That is, the - concatenation of - `root_certificate`, - `intermediate_certificate`, - `corrections_certificate` - and `expiration`. This - certificate chain (allow - list) can also be - validated by fetching it - from - `http(s)://certs.swiftnav.com/chain`. */ + u8 corrections_certificate[20]; /**< SHA-1 fingerprint of the corrections + certificate */ + utc_time_t expiration; /**< The time after which the + signature given is no longer + valid. Implementors should + consult a time source (such as + GNSS) to check if the current + time is later than the + expiration time, if the + condition is true, signatures + in the stream should not be + considered valid. */ + ecdsa_signature_t signature; /**< Signature (created by + the root certificate) + over the concatenation + of the SBP payload bytes + preceding this field. + That is, the + concatenation of + `root_certificate`, + `intermediate_certificate`, + `corrections_certificate` + and `expiration`. This + certificate chain (allow + list) can also be + validated by fetching it + from + `http(s)://certs.swiftnav.com/chain`. */ } msg_certificate_chain_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u8 root_certificate[20]; /**< SHA-1 fingerprint of the root - certificate */ + u8 root_certificate[20]; /**< SHA-1 fingerprint of the root + certificate */ u8 intermediate_certificate[20]; /**< SHA-1 fingerprint of the intermediate certificate */ - u8 corrections_certificate[20]; /**< SHA-1 fingerprint of the corrections - certificate */ - utc_time_t expiration; /**< The certificate chain comprised - of three fingerprints: root - certificate, intermediate - certificate and corrections - certificate. */ - u8 signature[64]; /**< An ECDSA signature (created by the root - certificate) over the concatenation of - the SBP payload bytes preceding this - field. That is, the concatenation of - `root_certificate`, - `intermediate_certificate`, - `corrections_certificate` and - `expiration`. This certificate chain - (allow list) can also be validated by - fetching it from - `http(s)://certs.swiftnav.com/chain`. */ + u8 corrections_certificate[20]; /**< SHA-1 fingerprint of the corrections + certificate */ + utc_time_t expiration; /**< The certificate chain comprised + of three fingerprints: root + certificate, intermediate + certificate and corrections + certificate. */ + u8 signature[64]; /**< An ECDSA signature (created by the root + certificate) over the concatenation of + the SBP payload bytes preceding this + field. That is, the concatenation of + `root_certificate`, + `intermediate_certificate`, + `corrections_certificate` and + `expiration`. This certificate chain + (allow list) can also be validated by + fetching it from + `http(s)://certs.swiftnav.com/chain`. */ } msg_certificate_chain_dep_t; - /** An ECDSA signature * * An ECDSA-256 signature using SHA-256 as the message digest algorithm. */ typedef struct SBP_ATTR_PACKED { - u8 flags; /**< Describes the format of the `signed\_messages` - field below. */ - u8 stream_counter; /**< Signature message counter. Zero indexed and - incremented with each signature message. The - counter will not increment if this message was - in response to an on demand request. The - counter will roll over after 256 messages. - Upon connection, the value of the counter may - not initially be zero. */ - u8 on_demand_counter; /**< On demand message counter. Zero indexed and - incremented with each signature message sent - in response to an on demand message. The - counter will roll over after 256 messages. - Upon connection, the value of the counter may - not initially be zero. */ - u8 certificate_id[4]; /**< The last 4 bytes of the certificate's SHA-1 - fingerprint */ - ecdsa_signature_t signature; /**< Signature over the frames of - this message group. */ - u8 signed_messages[0]; /**< CRCs of the messages covered by this - signature. For Skylark, which delivers SBP - messages wrapped in Swift's proprietary RTCM - message, these are the 24-bit CRCs from the - RTCM message framing. For SBP only streams, - this will be 16-bit CRCs from the SBP framing. - See the `flags` field to determine the type of - CRCs covered. */ + u8 flags; /**< Describes the format of the `signed\_messages` + field below. */ + u8 stream_counter; /**< Signature message counter. Zero indexed and + incremented with each signature message. The + counter will not increment if this message was + in response to an on demand request. The + counter will roll over after 256 messages. + Upon connection, the value of the counter may + not initially be zero. */ + u8 on_demand_counter; /**< On demand message counter. Zero indexed and + incremented with each signature message sent + in response to an on demand message. The + counter will roll over after 256 messages. + Upon connection, the value of the counter may + not initially be zero. */ + u8 certificate_id[4]; /**< The last 4 bytes of the certificate's SHA-1 + fingerprint */ + ecdsa_signature_t signature; /**< Signature over the frames of + this message group. */ + u8 signed_messages[0]; /**< CRCs of the messages covered by this + signature. For Skylark, which delivers SBP + messages wrapped in Swift's proprietary RTCM + message, these are the 24-bit CRCs from the + RTCM message framing. For SBP only streams, + this will be 16-bit CRCs from the SBP framing. + See the `flags` field to determine the type of + CRCs covered. */ } msg_ecdsa_signature_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u8 flags; /**< Describes the format of the `signed\_messages` - field below. */ - u8 stream_counter; /**< Signature message counter. Zero indexed and - incremented with each signature message. The - counter will not increment if this message was - in response to an on demand request. The - counter will roll over after 256 messages. - Upon connection, the value of the counter may - not initially be zero. */ - u8 on_demand_counter; /**< On demand message counter. Zero indexed and - incremented with each signature message sent - in response to an on demand message. The - counter will roll over after 256 messages. - Upon connection, the value of the counter may - not initially be zero. */ - u8 certificate_id[4]; /**< The last 4 bytes of the certificate's SHA-1 - fingerprint */ - u8 n_signature_bytes; /**< Number of bytes to use of the signature field. - The DER encoded signature has a maximum size - of 72 bytes but can vary between 70 and 72 - bytes in length. */ - u8 signature[72]; /**< DER encoded ECDSA signature for the messages - using SHA-256 as the digest algorithm. */ - u8 signed_messages[0]; /**< CRCs of the messages covered by this - signature. For Skylark, which delivers SBP - messages wrapped in Swift's proprietary RTCM - message, these are the 24-bit CRCs from the - RTCM message framing. For SBP only streams, - this will be 16-bit CRCs from the SBP framing. - See the `flags` field to determine the type of - CRCs covered. */ + u8 flags; /**< Describes the format of the `signed\_messages` + field below. */ + u8 stream_counter; /**< Signature message counter. Zero indexed and + incremented with each signature message. The + counter will not increment if this message was + in response to an on demand request. The + counter will roll over after 256 messages. + Upon connection, the value of the counter may + not initially be zero. */ + u8 on_demand_counter; /**< On demand message counter. Zero indexed and + incremented with each signature message sent + in response to an on demand message. The + counter will roll over after 256 messages. + Upon connection, the value of the counter may + not initially be zero. */ + u8 certificate_id[4]; /**< The last 4 bytes of the certificate's SHA-1 + fingerprint */ + u8 n_signature_bytes; /**< Number of bytes to use of the signature field. + The DER encoded signature has a maximum size + of 72 bytes but can vary between 70 and 72 + bytes in length. */ + u8 signature[72]; /**< DER encoded ECDSA signature for the messages + using SHA-256 as the digest algorithm. */ + u8 signed_messages[0]; /**< CRCs of the messages covered by this + signature. For Skylark, which delivers SBP + messages wrapped in Swift's proprietary RTCM + message, these are the 24-bit CRCs from the + RTCM message framing. For SBP only streams, + this will be 16-bit CRCs from the SBP framing. + See the `flags` field to determine the type of + CRCs covered. */ } msg_ecdsa_signature_dep_b_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u8 flags; /**< Describes the format of the `signed\_messages` - field below. */ - u8 stream_counter; /**< Signature message counter. Zero indexed and - incremented with each signature message. The - counter will not increment if this message was - in response to an on demand request. The - counter will roll over after 256 messages. - Upon connection, the value of the counter may - not initially be zero. */ - u8 on_demand_counter; /**< On demand message counter. Zero indexed and - incremented with each signature message sent - in response to an on demand message. The - counter will roll over after 256 messages. - Upon connection, the value of the counter may - not initially be zero. */ - u8 certificate_id[4]; /**< The last 4 bytes of the certificate's SHA-1 - fingerprint */ - u8 signature[64]; /**< ECDSA signature for the messages using SHA-256 - as the digest algorithm. */ - u8 signed_messages[0]; /**< CRCs of the messages covered by this - signature. For Skylark, which delivers SBP - messages wrapped in Swift's proprietary RTCM - message, these are the 24-bit CRCs from the - RTCM message framing. For SBP only streams, - this will be 16-bit CRCs from the SBP framing. - See the `flags` field to determine the type of - CRCs covered. */ + u8 flags; /**< Describes the format of the `signed\_messages` + field below. */ + u8 stream_counter; /**< Signature message counter. Zero indexed and + incremented with each signature message. The + counter will not increment if this message was + in response to an on demand request. The + counter will roll over after 256 messages. + Upon connection, the value of the counter may + not initially be zero. */ + u8 on_demand_counter; /**< On demand message counter. Zero indexed and + incremented with each signature message sent + in response to an on demand message. The + counter will roll over after 256 messages. + Upon connection, the value of the counter may + not initially be zero. */ + u8 certificate_id[4]; /**< The last 4 bytes of the certificate's SHA-1 + fingerprint */ + u8 signature[64]; /**< ECDSA signature for the messages using SHA-256 + as the digest algorithm. */ + u8 signed_messages[0]; /**< CRCs of the messages covered by this + signature. For Skylark, which delivers SBP + messages wrapped in Swift's proprietary RTCM + message, these are the 24-bit CRCs from the + RTCM message framing. For SBP only streams, + this will be 16-bit CRCs from the SBP framing. + See the `flags` field to determine the type of + CRCs covered. */ } msg_ecdsa_signature_dep_a_t; - /** Deprecated * * Deprecated. @@ -270,45 +259,42 @@ typedef struct SBP_ATTR_PACKED { u8 certificate_bytes[0]; /**< ED25519 certificate bytes. */ } msg_ed25519_certificate_dep_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u8 signature[64]; /**< ED25519 signature for messages. */ - u8 fingerprint[20]; /**< SHA-1 fingerprint of the associated certificate. */ + u8 signature[64]; /**< ED25519 signature for messages. */ + u8 fingerprint[20]; /**< SHA-1 fingerprint of the associated certificate. */ u32 signed_messages[0]; /**< CRCs of signed messages. */ } msg_ed25519_signature_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u8 stream_counter; /**< Signature message counter. Zero indexed and - incremented with each signature message. The - counter will not increment if this message was - in response to an on demand request. The - counter will roll over after 256 messages. - Upon connection, the value of the counter may - not initially be zero. */ - u8 on_demand_counter; /**< On demand message counter. Zero indexed and - incremented with each signature message sent - in response to an on demand message. The - counter will roll over after 256 messages. - Upon connection, the value of the counter may - not initially be zero. */ - u8 signature[64]; /**< ED25519 signature for messages. */ - u8 fingerprint[20]; /**< SHA-1 fingerprint of the associated - certificate. */ - u32 signed_messages[0]; /**< CRCs of signed messages. */ + u8 stream_counter; /**< Signature message counter. Zero indexed and + incremented with each signature message. The + counter will not increment if this message was + in response to an on demand request. The + counter will roll over after 256 messages. + Upon connection, the value of the counter may + not initially be zero. */ + u8 on_demand_counter; /**< On demand message counter. Zero indexed and + incremented with each signature message sent + in response to an on demand message. The + counter will roll over after 256 messages. + Upon connection, the value of the counter may + not initially be zero. */ + u8 signature[64]; /**< ED25519 signature for messages. */ + u8 fingerprint[20]; /**< SHA-1 fingerprint of the associated + certificate. */ + u32 signed_messages[0]; /**< CRCs of signed messages. */ } msg_ed25519_signature_dep_b_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/solution_meta.h b/c/include/libsbp/legacy/solution_meta.h index 9c50f075c..74d7da11f 100644 --- a/c/include/libsbp/legacy/solution_meta.h +++ b/c/include/libsbp/legacy/solution_meta.h @@ -28,14 +28,14 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Flags for a given solution input type * * Metadata describing which sensors were involved in the solution. The @@ -48,55 +48,53 @@ SBP_PACK_START */ typedef struct SBP_ATTR_PACKED { - u8 sensor_type; /**< The type of sensor */ - u8 flags; /**< Refer to each InputType description [(XX)InputType] */ + u8 sensor_type; /**< The type of sensor */ + u8 flags; /**< Refer to each InputType description [(XX)InputType] */ } solution_input_type_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u16 pdop; /**< Position Dilution of Precision as per - last available DOPS from PVT engine - (0xFFFF indicates invalid) [0.01] */ - u16 hdop; /**< Horizontal Dilution of Precision as per - last available DOPS from PVT engine - (0xFFFF indicates invalid) [0.01] */ - u16 vdop; /**< Vertical Dilution of Precision as per - last available DOPS from PVT engine - (0xFFFF indicates invalid) [0.01] */ - u8 n_sats; /**< Number of satellites as per last - available solution from PVT engine */ - u16 age_corrections; /**< Age of corrections as per last available - AGE_CORRECTIONS from PVT engine (0xFFFF - indicates invalid) [deciseconds] */ - u8 alignment_status; /**< State of alignment and the status and - receipt of the alignment inputs */ - u32 last_used_gnss_pos_tow; /**< Tow of last-used GNSS position - measurement [ms] */ - u32 last_used_gnss_vel_tow; /**< Tow of last-used GNSS velocity - measurement [ms] */ - solution_input_type_t sol_in[0]; /**< Array of Metadata - describing the sensors - potentially involved - in the solution. Each - element in the array - represents a single - sensor type and - consists of flags - containing (meta)data - pertaining to that - specific single - sensor. Refer to each - (XX)InputType - descriptor in the - present doc. */ + u16 pdop; /**< Position Dilution of Precision as per + last available DOPS from PVT engine + (0xFFFF indicates invalid) [0.01] */ + u16 hdop; /**< Horizontal Dilution of Precision as per + last available DOPS from PVT engine + (0xFFFF indicates invalid) [0.01] */ + u16 vdop; /**< Vertical Dilution of Precision as per + last available DOPS from PVT engine + (0xFFFF indicates invalid) [0.01] */ + u8 n_sats; /**< Number of satellites as per last + available solution from PVT engine */ + u16 age_corrections; /**< Age of corrections as per last available + AGE_CORRECTIONS from PVT engine (0xFFFF + indicates invalid) [deciseconds] */ + u8 alignment_status; /**< State of alignment and the status and + receipt of the alignment inputs */ + u32 last_used_gnss_pos_tow; /**< Tow of last-used GNSS position + measurement [ms] */ + u32 last_used_gnss_vel_tow; /**< Tow of last-used GNSS velocity + measurement [ms] */ + solution_input_type_t sol_in[0]; /**< Array of Metadata + describing the sensors + potentially involved + in the solution. Each + element in the array + represents a single + sensor type and + consists of flags + containing (meta)data + pertaining to that + specific single + sensor. Refer to each + (XX)InputType + descriptor in the + present doc. */ } msg_soln_meta_dep_a_t; - /** Solution Sensors Metadata * * This message contains all metadata about the sensors received and/or used @@ -111,36 +109,35 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS time of week rounded to the nearest - millisecond [ms] */ - u16 pdop; /**< Position Dilution of Precision as per last - available DOPS from PVT engine (0xFFFF - indicates invalid) [0.01] */ - u16 hdop; /**< Horizontal Dilution of Precision as per last - available DOPS from PVT engine (0xFFFF - indicates invalid) [0.01] */ - u16 vdop; /**< Vertical Dilution of Precision as per last - available DOPS from PVT engine (0xFFFF - indicates invalid) [0.01] */ - u16 age_corrections; /**< Age of corrections as per last available - AGE_CORRECTIONS from PVT engine (0xFFFF - indicates invalid) [deciseconds] */ - u32 age_gnss; /**< Age and Time Status of the last received valid - GNSS solution. [ms] */ - solution_input_type_t sol_in[0]; /**< Array of Metadata describing - the sensors potentially - involved in the solution. - Each element in the array - represents a single sensor - type and consists of flags - containing (meta)data - pertaining to that specific - single sensor. Refer to each - (XX)InputType descriptor in - the present doc. */ + u32 tow; /**< GPS time of week rounded to the nearest + millisecond [ms] */ + u16 pdop; /**< Position Dilution of Precision as per last + available DOPS from PVT engine (0xFFFF + indicates invalid) [0.01] */ + u16 hdop; /**< Horizontal Dilution of Precision as per last + available DOPS from PVT engine (0xFFFF + indicates invalid) [0.01] */ + u16 vdop; /**< Vertical Dilution of Precision as per last + available DOPS from PVT engine (0xFFFF + indicates invalid) [0.01] */ + u16 age_corrections; /**< Age of corrections as per last available + AGE_CORRECTIONS from PVT engine (0xFFFF + indicates invalid) [deciseconds] */ + u32 age_gnss; /**< Age and Time Status of the last received valid + GNSS solution. [ms] */ + solution_input_type_t sol_in[0]; /**< Array of Metadata describing + the sensors potentially + involved in the solution. + Each element in the array + represents a single sensor + type and consists of flags + containing (meta)data + pertaining to that specific + single sensor. Refer to each + (XX)InputType descriptor in + the present doc. */ } msg_soln_meta_t; - /** Instruments the physical type of GNSS sensor input to the fuzed solution * * Metadata around the GNSS sensors involved in the fuzed solution. Accessible @@ -148,12 +145,12 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 flags; /**< flags that store all relevant info specific to this sensor - type. */ + u8 flags; /**< flags that store all relevant info specific to this sensor + type. */ } gnss_input_type_t; - -/** Provides detail about the IMU sensor, its timestamping mode, and its quality for input to the fuzed solution +/** Provides detail about the IMU sensor, its timestamping mode, and its quality + for input to the fuzed solution * * Metadata around the IMU sensors involved in the fuzed solution. Accessible @@ -161,11 +158,11 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 flags; /**< Instrument time, grade, and architecture for a sensor. */ + u8 flags; /**< Instrument time, grade, and architecture for a sensor. */ } imu_input_type_t; - -/** Provides detail about the Odometry sensor, its timestamping mode, and its quality for input to the fuzed solution +/** Provides detail about the Odometry sensor, its timestamping mode, and its + quality for input to the fuzed solution * * Metadata around the Odometry sensors involved in the fuzed solution. @@ -173,10 +170,9 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 flags; /**< Instrument ODO rate, grade, and quality. */ + u8 flags; /**< Instrument ODO rate, grade, and quality. */ } odo_input_type_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/ssr.h b/c/include/libsbp/legacy/ssr.h index ff076c11b..5d4fe5540 100644 --- a/c/include/libsbp/legacy/ssr.h +++ b/c/include/libsbp/legacy/ssr.h @@ -25,17 +25,17 @@ #include -#include #include +#include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** SSR code biases corrections for a particular satellite * * Code biases are to be added to pseudorange. The corrections conform with @@ -43,31 +43,29 @@ SBP_PACK_START */ typedef struct SBP_ATTR_PACKED { - u8 code; /**< Signal encoded following RTCM specifications (DF380, - DF381, DF382 and DF467). */ - s16 value; /**< Code bias value [0.01 m] */ + u8 code; /**< Signal encoded following RTCM specifications (DF380, + DF381, DF382 and DF467). */ + s16 value; /**< Code bias value [0.01 m] */ } code_biases_content_t; - /** SSR phase biases corrections for a particular satellite * * Phase biases are to be added to carrier phase measurements. */ typedef struct SBP_ATTR_PACKED { - u8 code; /**< Signal encoded following RTCM - specifications (DF380, DF381, DF382 - and DF467) */ - u8 integer_indicator; /**< Indicator for integer property */ - u8 widelane_integer_indicator; /**< Indicator for two groups of Wide- - Lane(s) integer property */ - u8 discontinuity_counter; /**< Signal phase discontinuity counter. - Increased for every discontinuity in - phase. */ - s32 bias; /**< Phase bias for specified signal [0.1 mm] */ + u8 code; /**< Signal encoded following RTCM + specifications (DF380, DF381, DF382 + and DF467) */ + u8 integer_indicator; /**< Indicator for integer property */ + u8 widelane_integer_indicator; /**< Indicator for two groups of Wide- + Lane(s) integer property */ + u8 discontinuity_counter; /**< Signal phase discontinuity counter. + Increased for every discontinuity in + phase. */ + s32 bias; /**< Phase bias for specified signal [0.1 mm] */ } phase_biases_content_t; - /** Header for the MSG_SSR_STEC_CORRECTION message * * A full set of STEC information will likely span multiple SBP messages, @@ -76,19 +74,18 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u16 tile_set_id; /**< Unique identifier of the tile set this tile - belongs to. */ - u16 tile_id; /**< Unique identifier of this tile in the tile set. */ - gps_time_sec_t time; /**< GNSS reference time of the - correction */ - u8 num_msgs; /**< Number of messages in the dataset */ - u8 seq_num; /**< Position of this message in the dataset */ - u8 update_interval; /**< Update interval between consecutive corrections. - Encoded following RTCM DF391 specification. */ - u8 iod_atmo; /**< IOD of the SSR atmospheric correction */ + u16 tile_set_id; /**< Unique identifier of the tile set this tile + belongs to. */ + u16 tile_id; /**< Unique identifier of this tile in the tile set. */ + gps_time_sec_t time; /**< GNSS reference time of the + correction */ + u8 num_msgs; /**< Number of messages in the dataset */ + u8 seq_num; /**< Position of this message in the dataset */ + u8 update_interval; /**< Update interval between consecutive corrections. + Encoded following RTCM DF391 specification. */ + u8 iod_atmo; /**< IOD of the SSR atmospheric correction */ } stec_header_t; - /** Header for the MSG_SSR_GRIDDED_CORRECTION message * * The LPP message contains nested variable length arrays which are not @@ -96,52 +93,51 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u16 tile_set_id; /**< Unique identifier of the tile set this - tile belongs to. */ - u16 tile_id; /**< Unique identifier of this tile in the - tile set. */ - gps_time_sec_t time; /**< GNSS reference time of the - correction */ - u16 num_msgs; /**< Number of messages in the dataset */ - u16 seq_num; /**< Position of this message in the dataset */ - u8 update_interval; /**< Update interval between consecutive - corrections. Encoded following RTCM - DF391 specification. */ - u8 iod_atmo; /**< IOD of the SSR atmospheric correction */ - u8 tropo_quality_indicator; /**< Quality of the troposphere data. Encoded - following RTCM DF389 specification in - units of m. */ + u16 tile_set_id; /**< Unique identifier of the tile set this + tile belongs to. */ + u16 tile_id; /**< Unique identifier of this tile in the + tile set. */ + gps_time_sec_t time; /**< GNSS reference time of the + correction */ + u16 num_msgs; /**< Number of messages in the dataset */ + u16 seq_num; /**< Position of this message in the dataset */ + u8 update_interval; /**< Update interval between consecutive + corrections. Encoded following RTCM + DF391 specification. */ + u8 iod_atmo; /**< IOD of the SSR atmospheric correction */ + u8 tropo_quality_indicator; /**< Quality of the troposphere data. Encoded + following RTCM DF389 specification in + units of m. */ } gridded_correction_header_t; - /** None * * STEC polynomial for the given satellite. */ typedef struct SBP_ATTR_PACKED { - sv_id_t sv_id; /**< Unique space vehicle identifier */ - u8 stec_quality_indicator; /**< Quality of the STEC data. Encoded - following RTCM DF389 specification but in - units of TECU instead of m. */ - s16 stec_coeff[4]; /**< Coefficients of the STEC polynomial in - the order of C00, C01, C10, C11. C00 = - 0.05 TECU, C01/C10 = 0.02 TECU/deg, C11 - 0.02 TECU/deg^2 */ + sv_id_t sv_id; /**< Unique space vehicle identifier */ + u8 stec_quality_indicator; /**< Quality of the STEC data. Encoded + following RTCM DF389 specification but in + units of TECU instead of m. */ + s16 stec_coeff[4]; /**< Coefficients of the STEC polynomial in + the order of C00, C01, C10, C11. C00 = + 0.05 TECU, C01/C10 = 0.02 TECU/deg, C11 + 0.02 TECU/deg^2 */ } stec_sat_element_t; - /** None * * Troposphere vertical delays at the grid point. */ typedef struct SBP_ATTR_PACKED { - s16 hydro; /**< Hydrostatic vertical delay [4 mm (add 2.3 m to get actual vertical hydro delay)] */ - s8 wet; /**< Wet vertical delay [4 mm (add 0.252 m to get actual vertical wet delay)] */ + s16 hydro; /**< Hydrostatic vertical delay [4 mm (add 2.3 m to get actual + vertical hydro delay)] */ + s8 wet; /**< Wet vertical delay [4 mm (add 0.252 m to get actual vertical wet + delay)] */ } tropospheric_delay_correction_no_std_t; - /** None * * Troposphere vertical delays (mean and standard deviation) at the grid @@ -149,25 +145,23 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - s16 hydro; /**< Hydrostatic vertical delay. Add 2.3 m to get actual - value. [4 mm] */ - s8 wet; /**< Wet vertical delay. Add 0.252 m to get actual value. [4 mm] */ - u8 stddev; /**< Modified DF389. class 3 MSB, value 5 LSB. stddev = - (3^class * (1 + value/16) - 1) [mm] */ + s16 hydro; /**< Hydrostatic vertical delay. Add 2.3 m to get actual + value. [4 mm] */ + s8 wet; /**< Wet vertical delay. Add 0.252 m to get actual value. [4 mm] */ + u8 stddev; /**< Modified DF389. class 3 MSB, value 5 LSB. stddev = + (3^class * (1 + value/16) - 1) [mm] */ } tropospheric_delay_correction_t; - /** None * * STEC residual for the given satellite at the grid point. */ typedef struct SBP_ATTR_PACKED { - sv_id_t sv_id; /**< space vehicle identifier */ - s16 residual; /**< STEC residual [0.04 TECU] */ + sv_id_t sv_id; /**< space vehicle identifier */ + s16 residual; /**< STEC residual [0.04 TECU] */ } stec_residual_no_std_t; - /** None * * STEC residual (mean and standard deviation) for the given satellite at the @@ -175,13 +169,12 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - sv_id_t sv_id; /**< space vehicle identifier */ - s16 residual; /**< STEC residual [0.04 TECU] */ - u8 stddev; /**< Modified DF389. class 3 MSB, value 5 LSB. stddev = - (3^class * (1 + value/16) - 1) * 10 */ + sv_id_t sv_id; /**< space vehicle identifier */ + s16 residual; /**< STEC residual [0.04 TECU] */ + u8 stddev; /**< Modified DF389. class 3 MSB, value 5 LSB. stddev = + (3^class * (1 + value/16) - 1) * 10 */ } stec_residual_t; - /** Precise orbit and clock correction * * The precise orbit and clock correction message is to be applied as a delta @@ -190,31 +183,30 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - gps_time_sec_t time; /**< GNSS reference time of the - correction */ - sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 bit) */ + gps_time_sec_t time; /**< GNSS reference time of the + correction */ + sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 bit) */ u8 update_interval; /**< Update interval between consecutive corrections. Encoded following RTCM DF391 specification. */ u8 iod_ssr; /**< IOD of the SSR correction. A change of Issue Of Data SSR is used to indicate a change in the SSR generating configuration */ - u32 iod; /**< Issue of broadcast ephemeris data or IODCRC - (Beidou) */ - s32 radial; /**< Orbit radial delta correction [0.1 mm] */ - s32 along; /**< Orbit along delta correction [0.4 mm] */ - s32 cross; /**< Orbit along delta correction [0.4 mm] */ - s32 dot_radial; /**< Velocity of orbit radial delta correction [0.001 mm/s] */ - s32 dot_along; /**< Velocity of orbit along delta correction [0.004 mm/s] */ - s32 dot_cross; /**< Velocity of orbit cross delta correction [0.004 mm/s] */ - s32 c0; /**< C0 polynomial coefficient for correction of - broadcast satellite clock [0.1 mm] */ - s32 c1; /**< C1 polynomial coefficient for correction of - broadcast satellite clock [0.001 mm/s] */ - s32 c2; /**< C2 polynomial coefficient for correction of - broadcast satellite clock [0.00002 mm/s^-2] */ + u32 iod; /**< Issue of broadcast ephemeris data or IODCRC + (Beidou) */ + s32 radial; /**< Orbit radial delta correction [0.1 mm] */ + s32 along; /**< Orbit along delta correction [0.4 mm] */ + s32 cross; /**< Orbit along delta correction [0.4 mm] */ + s32 dot_radial; /**< Velocity of orbit radial delta correction [0.001 mm/s] */ + s32 dot_along; /**< Velocity of orbit along delta correction [0.004 mm/s] */ + s32 dot_cross; /**< Velocity of orbit cross delta correction [0.004 mm/s] */ + s32 c0; /**< C0 polynomial coefficient for correction of + broadcast satellite clock [0.1 mm] */ + s32 c1; /**< C1 polynomial coefficient for correction of + broadcast satellite clock [0.001 mm/s] */ + s32 c2; /**< C2 polynomial coefficient for correction of + broadcast satellite clock [0.00002 mm/s^-2] */ } msg_ssr_orbit_clock_t; - /** Precise code biases correction * * The precise code biases message is to be added to the pseudorange of the @@ -223,19 +215,18 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - gps_time_sec_t time; /**< GNSS reference time of the - correction */ - sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 bit) */ + gps_time_sec_t time; /**< GNSS reference time of the + correction */ + sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 bit) */ u8 update_interval; /**< Update interval between consecutive corrections. Encoded following RTCM DF391 specification. */ u8 iod_ssr; /**< IOD of the SSR correction. A change of Issue Of Data SSR is used to indicate a change in the SSR generating configuration */ - code_biases_content_t biases[0]; /**< Code biases for the different - satellite signals */ + code_biases_content_t biases[0]; /**< Code biases for the different + satellite signals */ } msg_ssr_code_biases_t; - /** Precise phase biases correction * * The precise phase biases message contains the biases to be added to the @@ -246,9 +237,9 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - gps_time_sec_t time; /**< GNSS reference time of the - correction */ - sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 bit) */ + gps_time_sec_t time; /**< GNSS reference time of the + correction */ + sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 bit) */ u8 update_interval; /**< Update interval between consecutive corrections. Encoded following RTCM DF391 specification. */ u8 iod_ssr; /**< IOD of the SSR correction. A change of Issue Of @@ -258,52 +249,46 @@ typedef struct SBP_ATTR_PACKED { property. */ u8 mw_consistency; /**< Consistency indicator for Melbourne-Wubbena linear combinations */ - u16 yaw; /**< Satellite yaw angle [1 / 256 semi-circle] */ - s8 yaw_rate; /**< Satellite yaw angle rate [1 / 8192 semi-circle / s] */ - phase_biases_content_t biases[0]; /**< Phase biases corrections for - a satellite being tracked. */ + u16 yaw; /**< Satellite yaw angle [1 / 256 semi-circle] */ + s8 yaw_rate; /**< Satellite yaw angle rate [1 / 8192 semi-circle / s] */ + phase_biases_content_t biases[0]; /**< Phase biases corrections for + a satellite being tracked. */ } msg_ssr_phase_biases_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - stec_header_t header; /**< Header of a STEC polynomial coefficient - message. */ + stec_header_t header; /**< Header of a STEC polynomial coefficient + message. */ stec_sat_element_t stec_sat_list[0]; /**< Array of STEC polynomial coefficients for each space vehicle. */ } msg_ssr_stec_correction_dep_t; - - typedef struct SBP_ATTR_PACKED { - gps_time_sec_t time; /**< GNSS reference time of the bound */ - u8 num_msgs; /**< Number of messages in the dataset */ - u8 seq_num; /**< Position of this message in the dataset */ - u8 update_interval; /**< Update interval between consecutive bounds. - Similar to RTCM DF391. */ - u8 sol_id; /**< SSR Solution ID. */ + gps_time_sec_t time; /**< GNSS reference time of the bound */ + u8 num_msgs; /**< Number of messages in the dataset */ + u8 seq_num; /**< Position of this message in the dataset */ + u8 update_interval; /**< Update interval between consecutive bounds. + Similar to RTCM DF391. */ + u8 sol_id; /**< SSR Solution ID. */ } bounds_header_t; - - typedef struct SBP_ATTR_PACKED { - bounds_header_t header; /**< Header of a STEC correction with - bounds message. */ - u8 ssr_iod_atmo; /**< IOD of the SSR atmospheric correction */ - u16 tile_set_id; /**< Tile set ID */ - u16 tile_id; /**< Tile ID */ - u8 n_sats; /**< Number of satellites. */ + bounds_header_t header; /**< Header of a STEC correction with + bounds message. */ + u8 ssr_iod_atmo; /**< IOD of the SSR atmospheric correction */ + u16 tile_set_id; /**< Tile set ID */ + u16 tile_id; /**< Tile ID */ + u8 n_sats; /**< Number of satellites. */ stec_sat_element_t stec_sat_list[0]; /**< Array of STEC polynomial coefficients for each space vehicle. */ } msg_ssr_stec_correction_t; - /** Gridded troposphere and STEC correction residuals * * STEC residuals are per space vehicle, troposphere is not. @@ -312,36 +297,35 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - gridded_correction_header_t header; /**< Header of a - gridded - correction - message */ - u16 index; /**< Index of the grid point. */ - tropospheric_delay_correction_t tropo_delay_correction; /**< Wet and - hydrostatic - vertical - delays - (mean, - stddev). */ - stec_residual_t stec_residuals[0]; /**< STEC residuals for each - satellite (mean, stddev). */ + gridded_correction_header_t header; /**< Header of a + gridded + correction + message */ + u16 index; /**< Index of the grid point. */ + tropospheric_delay_correction_t tropo_delay_correction; /**< Wet and + hydrostatic + vertical + delays + (mean, + stddev). */ + stec_residual_t stec_residuals[0]; /**< STEC residuals for each + satellite (mean, stddev). */ } msg_ssr_gridded_correction_t; - /** None * * STEC polynomial and bounds for the given satellite. */ typedef struct SBP_ATTR_PACKED { - stec_residual_t stec_residual; /**< STEC residuals (mean, stddev) */ - u8 stec_bound_mu; /**< Error Bound Mean. See Note 1. [m] */ - u8 stec_bound_sig; /**< Error Bound StDev. See Note 1. [m] */ - u8 stec_bound_mu_dot; /**< Error Bound Mean First derivative. [0.00005 m/s] */ - u8 stec_bound_sig_dot; /**< Error Bound StDev First derivative. [0.00005 m/s] */ + stec_residual_t stec_residual; /**< STEC residuals (mean, stddev) */ + u8 stec_bound_mu; /**< Error Bound Mean. See Note 1. [m] */ + u8 stec_bound_sig; /**< Error Bound StDev. See Note 1. [m] */ + u8 stec_bound_mu_dot; /**< Error Bound Mean First derivative. [0.00005 m/s] */ + u8 stec_bound_sig_dot; /**< Error Bound StDev First derivative. [0.00005 m/s] + */ } stec_sat_element_integrity_t; - /** Gridded troposhere and STEC correction residuals bounds * * Note 1: Range: 0-17.5 m. i<= 200, mean = 0.01i; 200 -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** System start-up message * * The system start-up message is sent once on system start-up. It notifies @@ -43,12 +43,11 @@ SBP_PACK_START */ typedef struct SBP_ATTR_PACKED { - u8 cause; /**< Cause of startup */ - u8 startup_type; /**< Startup type */ - u16 reserved; /**< Reserved */ + u8 cause; /**< Cause of startup */ + u8 startup_type; /**< Startup type */ + u16 reserved; /**< Reserved */ } msg_startup_t; - /** Status of received corrections * * This message provides information about the receipt of Differential @@ -57,13 +56,12 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 flags; /**< Status flags */ - u16 latency; /**< Latency of observation receipt [deci-seconds] */ - u8 num_signals; /**< Number of signals from base station */ - char source[0]; /**< Corrections source string */ + u8 flags; /**< Status flags */ + u16 latency; /**< Latency of observation receipt [deci-seconds] */ + u8 num_signals; /**< Number of signals from base station */ + char source[0]; /**< Corrections source string */ } msg_dgnss_status_t; - /** System heartbeat message * * The heartbeat message is sent periodically to inform the host or other @@ -78,10 +76,9 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 flags; /**< Status flags */ + u32 flags; /**< Status flags */ } msg_heartbeat_t; - /** Subsystem Status report * * Report the general and specific state of a subsystem. If the generic state @@ -89,12 +86,11 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u16 component; /**< Identity of reporting subsystem */ - u8 generic; /**< Generic form status report */ - u8 specific; /**< Subsystem specific status code */ + u16 component; /**< Identity of reporting subsystem */ + u8 generic; /**< Generic form status report */ + u8 specific; /**< Subsystem specific status code */ } sub_system_report_t; - /** Status report message * * The status report is sent periodically to inform the host or other attached @@ -108,15 +104,14 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u16 reporting_system; /**< Identity of reporting system */ - u16 sbp_version; /**< SBP protocol version */ - u32 sequence; /**< Increments on each status report sent */ - u32 uptime; /**< Number of seconds since system start-up */ - sub_system_report_t status[0]; /**< Reported status of individual - subsystems */ + u16 reporting_system; /**< Identity of reporting system */ + u16 sbp_version; /**< SBP protocol version */ + u32 sequence; /**< Increments on each status report sent */ + u32 uptime; /**< Number of seconds since system start-up */ + sub_system_report_t status[0]; /**< Reported status of individual + subsystems */ } msg_status_report_t; - /** Subsystem Status report * * Reports the uptime and the state of a subsystem via generic and specific @@ -125,11 +120,10 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 uptime; /**< Milliseconds since system startup */ - sub_system_report_t report; + u32 uptime; /**< Milliseconds since system startup */ + sub_system_report_t report; } status_journal_item_t; - /** Status report journal * * The status journal message contains past status reports (see @@ -138,18 +132,17 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u16 reporting_system; /**< Identity of reporting system */ - u16 sbp_version; /**< SBP protocol version */ - u32 total_status_reports; /**< Total number of status reports sent since - system startup */ - u8 sequence_descriptor; /**< Index and number of messages in this - sequence. First nibble is the size of the - sequence (n), second nibble is the zero- - indexed counter (ith packet of n) */ - status_journal_item_t journal[0]; /**< Status journal */ + u16 reporting_system; /**< Identity of reporting system */ + u16 sbp_version; /**< SBP protocol version */ + u32 total_status_reports; /**< Total number of status reports sent since + system startup */ + u8 sequence_descriptor; /**< Index and number of messages in this + sequence. First nibble is the size of the + sequence (n), second nibble is the zero- + indexed counter (ith packet of n) */ + status_journal_item_t journal[0]; /**< Status journal */ } msg_status_journal_t; - /** Inertial Navigation System status message * * The INS status message describes the state of the operation and @@ -157,10 +150,9 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 flags; /**< Status flags */ + u32 flags; /**< Status flags */ } msg_ins_status_t; - /** Experimental telemetry message * * The CSAC telemetry message has an implementation defined telemetry string @@ -169,13 +161,12 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 id; /**< Index representing the type of telemetry in use. It - is implementation defined. */ + u8 id; /**< Index representing the type of telemetry in use. It + is implementation defined. */ char telemetry[0]; /**< Comma separated list of values as defined by the index */ } msg_csac_telemetry_t; - /** Experimental telemetry message labels * * The CSAC telemetry message provides labels for each member of the string @@ -184,13 +175,12 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 id; /**< Index representing the type of telemetry in - use. It is implementation defined. */ + u8 id; /**< Index representing the type of telemetry in + use. It is implementation defined. */ char telemetry_labels[0]; /**< Comma separated list of telemetry field values */ } msg_csac_telemetry_labels_t; - /** Inertial Navigation System update status message * * The INS update status message contains information about executed and @@ -199,16 +189,15 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< GPS Time of Week [ms] */ - u8 gnsspos; /**< GNSS position update status flags */ - u8 gnssvel; /**< GNSS velocity update status flags */ - u8 wheelticks; /**< Wheelticks update status flags */ - u8 speed; /**< Wheelticks update status flags */ - u8 nhc; /**< NHC update status flags */ - u8 zerovel; /**< Zero velocity update status flags */ + u32 tow; /**< GPS Time of Week [ms] */ + u8 gnsspos; /**< GNSS position update status flags */ + u8 gnssvel; /**< GNSS velocity update status flags */ + u8 wheelticks; /**< Wheelticks update status flags */ + u8 speed; /**< Wheelticks update status flags */ + u8 nhc; /**< NHC update status flags */ + u8 zerovel; /**< Zero velocity update status flags */ } msg_ins_updates_t; - /** Offset of the local time with respect to GNSS time * * The GNSS time offset message contains the information that is needed to @@ -217,13 +206,13 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - s16 weeks; /**< Weeks portion of the time offset [weeks] */ - s32 milliseconds; /**< Milliseconds portion of the time offset [ms] */ - s16 microseconds; /**< Microseconds portion of the time offset [microseconds] */ - u8 flags; /**< Status flags (reserved) */ + s16 weeks; /**< Weeks portion of the time offset [weeks] */ + s32 milliseconds; /**< Milliseconds portion of the time offset [ms] */ + s16 microseconds; /**< Microseconds portion of the time offset [microseconds] + */ + u8 flags; /**< Status flags (reserved) */ } msg_gnss_time_offset_t; - /** Local time at detection of PPS pulse * * The PPS time message contains the value of the sender's local time in @@ -240,11 +229,10 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u64 time; /**< Local time in microseconds [microseconds] */ - u8 flags; /**< Status flags */ + u64 time; /**< Local time in microseconds [microseconds] */ + u8 flags; /**< Status flags */ } msg_pps_time_t; - /** Sensor state and update status data * * This diagnostic message contains state and update status information for @@ -254,17 +242,16 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u32 time; /**< Update timestamp in milliseconds. [milliseconds] */ - u8 sensor_type; /**< Sensor type */ - u16 sensor_id; /**< Sensor identifier */ - u8 sensor_state; /**< Reserved for future use */ - u8 n_available_meas; /**< Number of available measurements in this epoch */ - u8 n_attempted_meas; /**< Number of attempted measurements in this epoch */ - u8 n_accepted_meas; /**< Number of accepted measurements in this epoch */ - u32 flags; /**< Reserved for future use */ + u32 time; /**< Update timestamp in milliseconds. [milliseconds] */ + u8 sensor_type; /**< Sensor type */ + u16 sensor_id; /**< Sensor identifier */ + u8 sensor_state; /**< Reserved for future use */ + u8 n_available_meas; /**< Number of available measurements in this epoch */ + u8 n_attempted_meas; /**< Number of attempted measurements in this epoch */ + u8 n_accepted_meas; /**< Number of accepted measurements in this epoch */ + u32 flags; /**< Reserved for future use */ } msg_sensor_aid_event_t; - /** Solution Group Metadata * * This leading message lists the time metadata of the Solution Group. It also @@ -273,15 +260,14 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 group_id; /**< Id of the Msgs Group, 0 is Unknown, 1 is Bestpos, 2 - is Gnss */ - u8 flags; /**< Status flags (reserved) */ - u8 n_group_msgs; /**< Size of list group_msgs */ - u16 group_msgs[0]; /**< An in-order list of message types included in the - Solution Group, including GROUP_META itself */ + u8 group_id; /**< Id of the Msgs Group, 0 is Unknown, 1 is Bestpos, 2 + is Gnss */ + u8 flags; /**< Status flags (reserved) */ + u8 n_group_msgs; /**< Size of list group_msgs */ + u16 group_msgs[0]; /**< An in-order list of message types included in the + Solution Group, including GROUP_META itself */ } msg_group_meta_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/telemetry.h b/c/include/libsbp/legacy/telemetry.h index b451c598c..661537e29 100644 --- a/c/include/libsbp/legacy/telemetry.h +++ b/c/include/libsbp/legacy/telemetry.h @@ -27,34 +27,32 @@ #include -#include #include +#include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - - typedef struct SBP_ATTR_PACKED { - u8 az; /**< Azimuth angle (range 0..179) [deg * 2] */ - s8 el; /**< Elevation angle (range -90..90) [deg] */ - u8 availability_flags; /**< Observation availability at filter update */ - s16 pseudorange_residual; /**< Pseudorange observation residual [1 dm] */ - s16 phase_residual; /**< Carrier-phase or carrier-phase-derived - observation residual [5 mm] */ - u8 outlier_flags; /**< Reports if observation is marked as an - outlier and is excluded from the update */ - u8 ephemeris_flags; /**< Ephemeris metadata */ - u8 correction_flags; /**< Reserved */ - sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 - bit) */ + u8 az; /**< Azimuth angle (range 0..179) [deg * 2] */ + s8 el; /**< Elevation angle (range -90..90) [deg] */ + u8 availability_flags; /**< Observation availability at filter update */ + s16 pseudorange_residual; /**< Pseudorange observation residual [1 dm] */ + s16 phase_residual; /**< Carrier-phase or carrier-phase-derived + observation residual [5 mm] */ + u8 outlier_flags; /**< Reports if observation is marked as an + outlier and is excluded from the update */ + u8 ephemeris_flags; /**< Ephemeris metadata */ + u8 correction_flags; /**< Reserved */ + sbp_gnss_signal_t sid; /**< GNSS signal identifier (16 + bit) */ } telemetry_sv_t; - /** Per-signal telemetry * * This message includes telemetry pertinent to satellite signals available to @@ -62,17 +60,16 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u16 wn; /**< GPS week number [weeks] */ - u32 tow; /**< GPS Time of Week [ms] */ - u8 n_obs; /**< Total number of observations. First nibble is the - size of the sequence (n), second nibble is the - zero-indexed counter (ith packet of n) */ - u8 origin_flags; /**< Flags to identify the filter type from which the - telemetry is reported from */ - telemetry_sv_t sv_tel[0]; /**< Array of per-signal telemetry entries */ + u16 wn; /**< GPS week number [weeks] */ + u32 tow; /**< GPS Time of Week [ms] */ + u8 n_obs; /**< Total number of observations. First nibble is the + size of the sequence (n), second nibble is the + zero-indexed counter (ith packet of n) */ + u8 origin_flags; /**< Flags to identify the filter type from which the + telemetry is reported from */ + telemetry_sv_t sv_tel[0]; /**< Array of per-signal telemetry entries */ } msg_tel_sv_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/tracking.h b/c/include/libsbp/legacy/tracking.h index 21ad858e0..07563934e 100644 --- a/c/include/libsbp/legacy/tracking.h +++ b/c/include/libsbp/legacy/tracking.h @@ -25,17 +25,17 @@ #include -#include #include +#include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Detailed signal tracking channel states. DEPRECATED * * The tracking message returns a set tracking channel parameters for a single @@ -43,92 +43,92 @@ SBP_PACK_START */ typedef struct SBP_ATTR_PACKED { - u64 recv_time; /**< Receiver clock time. [ns] */ - sbp_gps_time_t tot; /**< Time of transmission of signal from - satellite. TOW only valid when TOW - status is decoded or propagated. WN - only valid when week number valid flag - is set. */ - u32 P; /**< Pseudorange observation. Valid only when - pseudorange valid flag is set. [2 cm] */ - u16 P_std; /**< Pseudorange observation standard deviation. Valid - only when pseudorange valid flag is set. [2 cm] */ - carrier_phase_t L; /**< Carrier phase observation with typical - sign convention. Valid only when PLL - pessimistic lock is achieved. [cycles] */ - u8 cn0; /**< Carrier-to-Noise density [dB Hz / 4] */ - u16 lock; /**< Lock time. It is encoded according to DF402 from - the RTCM 10403.2 Amendment 2 specification. Valid - values range from 0 to 15. */ - sbp_gnss_signal_t sid; /**< GNSS signal identifier. */ - s32 doppler; /**< Carrier Doppler frequency. [Hz / 16] */ - u16 doppler_std; /**< Carrier Doppler frequency standard deviation. [Hz / 16] */ - u32 uptime; /**< Number of seconds of continuous tracking. - Specifies how much time signal is in continuous - track. [s] */ - s16 clock_offset; /**< TCXO clock offset. Valid only when valid clock - valid flag is set. [s / (2 ^ 20)] */ - s16 clock_drift; /**< TCXO clock drift. Valid only when valid clock - valid flag is set. [(s / s) / (2 ^ 31)] */ - u16 corr_spacing; /**< Early-Prompt (EP) and Prompt-Late (PL) correlators - spacing. [ns] */ - s8 acceleration; /**< Acceleration. Valid only when acceleration valid - flag is set. [g / 8] */ - u8 sync_flags; /**< Synchronization status flags. */ - u8 tow_flags; /**< TOW status flags. */ - u8 track_flags; /**< Tracking loop status flags. */ - u8 nav_flags; /**< Navigation data status flags. */ - u8 pset_flags; /**< Parameters sets flags. */ - u8 misc_flags; /**< Miscellaneous flags. */ + u64 recv_time; /**< Receiver clock time. [ns] */ + sbp_gps_time_t tot; /**< Time of transmission of signal from + satellite. TOW only valid when TOW + status is decoded or propagated. WN + only valid when week number valid flag + is set. */ + u32 P; /**< Pseudorange observation. Valid only when + pseudorange valid flag is set. [2 cm] */ + u16 P_std; /**< Pseudorange observation standard deviation. Valid + only when pseudorange valid flag is set. [2 cm] */ + carrier_phase_t L; /**< Carrier phase observation with typical + sign convention. Valid only when PLL + pessimistic lock is achieved. [cycles] */ + u8 cn0; /**< Carrier-to-Noise density [dB Hz / 4] */ + u16 lock; /**< Lock time. It is encoded according to DF402 from + the RTCM 10403.2 Amendment 2 specification. Valid + values range from 0 to 15. */ + sbp_gnss_signal_t sid; /**< GNSS signal identifier. */ + s32 doppler; /**< Carrier Doppler frequency. [Hz / 16] */ + u16 doppler_std; /**< Carrier Doppler frequency standard deviation. [Hz / 16] + */ + u32 uptime; /**< Number of seconds of continuous tracking. + Specifies how much time signal is in continuous + track. [s] */ + s16 clock_offset; /**< TCXO clock offset. Valid only when valid clock + valid flag is set. [s / (2 ^ 20)] */ + s16 clock_drift; /**< TCXO clock drift. Valid only when valid clock + valid flag is set. [(s / s) / (2 ^ 31)] */ + u16 corr_spacing; /**< Early-Prompt (EP) and Prompt-Late (PL) correlators + spacing. [ns] */ + s8 acceleration; /**< Acceleration. Valid only when acceleration valid + flag is set. [g / 8] */ + u8 sync_flags; /**< Synchronization status flags. */ + u8 tow_flags; /**< TOW status flags. */ + u8 track_flags; /**< Tracking loop status flags. */ + u8 nav_flags; /**< Navigation data status flags. */ + u8 pset_flags; /**< Parameters sets flags. */ + u8 misc_flags; /**< Miscellaneous flags. */ } msg_tracking_state_detailed_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u64 recv_time; /**< Receiver clock time. [ns] */ - gps_time_dep_t tot; /**< Time of transmission of signal from - satellite. TOW only valid when TOW - status is decoded or propagated. WN - only valid when week number valid flag - is set. */ - u32 P; /**< Pseudorange observation. Valid only when - pseudorange valid flag is set. [2 cm] */ - u16 P_std; /**< Pseudorange observation standard deviation. Valid - only when pseudorange valid flag is set. [2 cm] */ - carrier_phase_t L; /**< Carrier phase observation with typical - sign convention. Valid only when PLL - pessimistic lock is achieved. [cycles] */ - u8 cn0; /**< Carrier-to-Noise density [dB Hz / 4] */ - u16 lock; /**< Lock time. It is encoded according to DF402 from - the RTCM 10403.2 Amendment 2 specification. Valid - values range from 0 to 15. */ - gnss_signal_dep_t sid; /**< GNSS signal identifier. */ - s32 doppler; /**< Carrier Doppler frequency. [Hz / 16] */ - u16 doppler_std; /**< Carrier Doppler frequency standard deviation. [Hz / 16] */ - u32 uptime; /**< Number of seconds of continuous tracking. - Specifies how much time signal is in continuous - track. [s] */ - s16 clock_offset; /**< TCXO clock offset. Valid only when valid clock - valid flag is set. [s / (2 ^ 20)] */ - s16 clock_drift; /**< TCXO clock drift. Valid only when valid clock - valid flag is set. [(s / s) / (2 ^ 31)] */ - u16 corr_spacing; /**< Early-Prompt (EP) and Prompt-Late (PL) correlators - spacing. [ns] */ - s8 acceleration; /**< Acceleration. Valid only when acceleration valid - flag is set. [g / 8] */ - u8 sync_flags; /**< Synchronization status flags. */ - u8 tow_flags; /**< TOW status flags. */ - u8 track_flags; /**< Tracking loop status flags. */ - u8 nav_flags; /**< Navigation data status flags. */ - u8 pset_flags; /**< Parameters sets flags. */ - u8 misc_flags; /**< Miscellaneous flags. */ + u64 recv_time; /**< Receiver clock time. [ns] */ + gps_time_dep_t tot; /**< Time of transmission of signal from + satellite. TOW only valid when TOW + status is decoded or propagated. WN + only valid when week number valid flag + is set. */ + u32 P; /**< Pseudorange observation. Valid only when + pseudorange valid flag is set. [2 cm] */ + u16 P_std; /**< Pseudorange observation standard deviation. Valid + only when pseudorange valid flag is set. [2 cm] */ + carrier_phase_t L; /**< Carrier phase observation with typical + sign convention. Valid only when PLL + pessimistic lock is achieved. [cycles] */ + u8 cn0; /**< Carrier-to-Noise density [dB Hz / 4] */ + u16 lock; /**< Lock time. It is encoded according to DF402 from + the RTCM 10403.2 Amendment 2 specification. Valid + values range from 0 to 15. */ + gnss_signal_dep_t sid; /**< GNSS signal identifier. */ + s32 doppler; /**< Carrier Doppler frequency. [Hz / 16] */ + u16 doppler_std; /**< Carrier Doppler frequency standard deviation. [Hz / 16] + */ + u32 uptime; /**< Number of seconds of continuous tracking. + Specifies how much time signal is in continuous + track. [s] */ + s16 clock_offset; /**< TCXO clock offset. Valid only when valid clock + valid flag is set. [s / (2 ^ 20)] */ + s16 clock_drift; /**< TCXO clock drift. Valid only when valid clock + valid flag is set. [(s / s) / (2 ^ 31)] */ + u16 corr_spacing; /**< Early-Prompt (EP) and Prompt-Late (PL) correlators + spacing. [ns] */ + s8 acceleration; /**< Acceleration. Valid only when acceleration valid + flag is set. [g / 8] */ + u8 sync_flags; /**< Synchronization status flags. */ + u8 tow_flags; /**< TOW status flags. */ + u8 track_flags; /**< Tracking loop status flags. */ + u8 nav_flags; /**< Navigation data status flags. */ + u8 pset_flags; /**< Parameters sets flags. */ + u8 misc_flags; /**< Miscellaneous flags. */ } msg_tracking_state_detailed_dep_t; - /** Signal tracking channel state * * Tracking channel state for a specific satellite signal and measured signal @@ -136,12 +136,12 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - sbp_gnss_signal_t sid; /**< GNSS signal being tracked */ - u8 fcn; /**< Frequency channel number (GLONASS only) */ - u8 cn0; /**< Carrier-to-Noise density. Zero implies invalid cn0. [dB Hz / 4] */ + sbp_gnss_signal_t sid; /**< GNSS signal being tracked */ + u8 fcn; /**< Frequency channel number (GLONASS only) */ + u8 cn0; /**< Carrier-to-Noise density. Zero implies invalid cn0. [dB Hz / 4] + */ } tracking_channel_state_t; - /** Signal tracking channel states * * The tracking message returns a variable-length array of tracking channel @@ -153,7 +153,6 @@ typedef struct SBP_ATTR_PACKED { tracking_channel_state_t states[0]; /**< Signal tracking channel state */ } msg_tracking_state_t; - /** Measurement Engine signal tracking channel state * * Measurement Engine tracking channel state for a specific satellite signal @@ -162,13 +161,13 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - sbp_gnss_signal_t mesid; /**< Measurement Engine GNSS signal being - tracked (carries either Glonass FCN or - SLOT) */ - u8 cn0; /**< Carrier-to-Noise density. Zero implies invalid cn0. [dB Hz / 4] */ + sbp_gnss_signal_t mesid; /**< Measurement Engine GNSS signal being + tracked (carries either Glonass FCN or + SLOT) */ + u8 cn0; /**< Carrier-to-Noise density. Zero implies invalid cn0. [dB Hz / 4] + */ } measurement_state_t; - /** Measurement Engine signal tracking channel states * * The tracking message returns a variable-length array of tracking channel @@ -180,18 +179,16 @@ typedef struct SBP_ATTR_PACKED { measurement_state_t states[0]; /**< ME signal tracking channel state */ } msg_measurement_state_t; - /** Complex correlation structure * * Structure containing in-phase and quadrature correlation components. */ typedef struct SBP_ATTR_PACKED { - s16 I; /**< In-phase correlation */ - s16 Q; /**< Quadrature correlation */ + s16 I; /**< In-phase correlation */ + s16 Q; /**< Quadrature correlation */ } tracking_channel_correlation_t; - /** Tracking channel correlations * * When enabled, a tracking channel can output the correlations at each update @@ -199,62 +196,57 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u8 channel; /**< Tracking channel of origin */ - sbp_gnss_signal_t sid; /**< GNSS signal identifier */ - tracking_channel_correlation_t corrs[3]; /**< Early, Prompt and Late - correlations */ + u8 channel; /**< Tracking channel of origin */ + sbp_gnss_signal_t sid; /**< GNSS signal identifier */ + tracking_channel_correlation_t corrs[3]; /**< Early, Prompt and Late + correlations */ } msg_tracking_iq_t; - /** Complex correlation structure * * Structure containing in-phase and quadrature correlation components. */ typedef struct SBP_ATTR_PACKED { - s32 I; /**< In-phase correlation */ - s32 Q; /**< Quadrature correlation */ + s32 I; /**< In-phase correlation */ + s32 Q; /**< Quadrature correlation */ } tracking_channel_correlation_dep_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u8 channel; /**< Tracking channel of origin */ - sbp_gnss_signal_t sid; /**< GNSS signal identifier */ - tracking_channel_correlation_dep_t corrs[3]; /**< Early, Prompt and Late - correlations */ + u8 channel; /**< Tracking channel of origin */ + sbp_gnss_signal_t sid; /**< GNSS signal identifier */ + tracking_channel_correlation_dep_t corrs[3]; /**< Early, Prompt and Late + correlations */ } msg_tracking_iq_dep_b_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u8 channel; /**< Tracking channel of origin */ - gnss_signal_dep_t sid; /**< GNSS signal identifier */ - tracking_channel_correlation_dep_t corrs[3]; /**< Early, Prompt and Late - correlations */ + u8 channel; /**< Tracking channel of origin */ + gnss_signal_dep_t sid; /**< GNSS signal identifier */ + tracking_channel_correlation_dep_t corrs[3]; /**< Early, Prompt and Late + correlations */ } msg_tracking_iq_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u8 state; /**< Status of tracking channel */ - u8 prn; /**< PRN-1 being tracked */ - float cn0; /**< Carrier-to-noise density [dB Hz] */ + u8 state; /**< Status of tracking channel */ + u8 prn; /**< PRN-1 being tracked */ + float cn0; /**< Carrier-to-noise density [dB Hz] */ } tracking_channel_state_dep_a_t; - /** Deprecated * * Deprecated. @@ -265,29 +257,27 @@ typedef struct SBP_ATTR_PACKED { state */ } msg_tracking_state_dep_a_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - u8 state; /**< Status of tracking channel */ - gnss_signal_dep_t sid; /**< GNSS signal being tracked */ - float cn0; /**< Carrier-to-noise density [dB Hz] */ + u8 state; /**< Status of tracking channel */ + gnss_signal_dep_t sid; /**< GNSS signal being tracked */ + float cn0; /**< Carrier-to-noise density [dB Hz] */ } tracking_channel_state_dep_b_t; - /** Deprecated * * Deprecated. */ typedef struct SBP_ATTR_PACKED { - tracking_channel_state_dep_b_t states[0]; /**< Signal tracking channel state */ + tracking_channel_state_dep_b_t + states[0]; /**< Signal tracking channel state */ } msg_tracking_state_dep_b_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/user.h b/c/include/libsbp/legacy/user.h index 420a4a754..ce3006274 100644 --- a/c/include/libsbp/legacy/user.h +++ b/c/include/libsbp/legacy/user.h @@ -27,14 +27,14 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** User data * * This message can contain any application specific user data up to a maximum @@ -45,7 +45,6 @@ typedef struct SBP_ATTR_PACKED { u8 contents[0]; /**< User data payload */ } msg_user_data_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/legacy/vehicle.h b/c/include/libsbp/legacy/vehicle.h index 9f57050b1..0301ffa65 100644 --- a/c/include/libsbp/legacy/vehicle.h +++ b/c/include/libsbp/legacy/vehicle.h @@ -27,14 +27,14 @@ #include -SBP_MESSAGE("The legacy libsbp API is deprecated and soon to be removed. All " - "symbols in this file will be removed in libsbp version 6. You " - "should immediately upgrade to make use of the modern libsbp API " - "defined in `libsbp/sbp.h` and related headers") +SBP_MESSAGE( + "The legacy libsbp API is deprecated and soon to be removed. All " + "symbols in this file will be removed in libsbp version 6. You " + "should immediately upgrade to make use of the modern libsbp API " + "defined in `libsbp/sbp.h` and related headers") SBP_PACK_START - /** Vehicle forward (x-axis) velocity * * Message representing the x component of vehicle velocity in the user frame @@ -49,15 +49,14 @@ SBP_PACK_START */ typedef struct SBP_ATTR_PACKED { - u32 tow; /**< Time field representing either milliseconds in the GPS - Week or local CPU time from the producing system in - milliseconds. See the tow_source flag for the exact - source of this timestamp. [ms] */ - s32 velocity; /**< The signed forward component of vehicle velocity. [mm/s] */ - u8 flags; /**< Status flags */ + u32 tow; /**< Time field representing either milliseconds in the GPS + Week or local CPU time from the producing system in + milliseconds. See the tow_source flag for the exact + source of this timestamp. [ms] */ + s32 velocity; /**< The signed forward component of vehicle velocity. [mm/s] */ + u8 flags; /**< Status flags */ } msg_odometry_t; - /** Accumulated wheeltick count message * * Message containing the accumulated distance travelled by a wheel located at @@ -74,21 +73,21 @@ typedef struct SBP_ATTR_PACKED { */ typedef struct SBP_ATTR_PACKED { - u64 time; /**< Time field representing either microseconds since the - last PPS, microseconds in the GPS Week or local CPU time - from the producing system in microseconds. See the - synch_type field for the exact meaning of this - timestamp. [us] */ - u8 flags; /**< Field indicating the type of timestamp contained in the - time field. */ - u8 source; /**< ID of the sensor producing this message */ - s32 ticks; /**< Free-running counter of the accumulated distance for - this sensor. The counter should be incrementing if - travelling into one direction and decrementing when - travelling in the opposite direction. [arbitrary distance units] */ + u64 time; /**< Time field representing either microseconds since the + last PPS, microseconds in the GPS Week or local CPU time + from the producing system in microseconds. See the + synch_type field for the exact meaning of this + timestamp. [us] */ + u8 flags; /**< Field indicating the type of timestamp contained in the + time field. */ + u8 source; /**< ID of the sensor producing this message */ + s32 ticks; /**< Free-running counter of the accumulated distance for + this sensor. The counter should be incrementing if + travelling into one direction and decrementing when + travelling in the opposite direction. [arbitrary distance + units] */ } msg_wheeltick_t; - /** \} */ SBP_PACK_END diff --git a/c/include/libsbp/linux.h b/c/include/libsbp/linux.h index 8b4be7990..e8c1a7185 100644 --- a/c/include/libsbp/linux.h +++ b/c/include/libsbp/linux.h @@ -17,16 +17,16 @@ #ifndef LIBSBP_LINUX_MESSAGES_H #define LIBSBP_LINUX_MESSAGES_H +#include #include +#include #include -#include +#include +#include #include #include #include -#include -#include -#include -#include #include +#include #endif /* LIBSBP_LINUX_MESSAGES_H */ diff --git a/c/include/libsbp/linux/MSG_LINUX_CPU_STATE.h b/c/include/libsbp/linux/MSG_LINUX_CPU_STATE.h index aab1a6ec0..ea3aba78b 100644 --- a/c/include/libsbp/linux/MSG_LINUX_CPU_STATE.h +++ b/c/include/libsbp/linux/MSG_LINUX_CPU_STATE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_LINUX_MSG_LINUX_CPU_STATE_H #define LIBSBP_LINUX_MSG_LINUX_CPU_STATE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,221 +40,238 @@ *****************************************************************************/ /** List CPU state on the system * -* This message indicates the process state of the top 10 heaviest consumers of CPU on the system, including a timestamp. + * This message indicates the process state of the top 10 heaviest consumers of + * CPU on the system, including a timestamp. */ typedef struct { - - /** -* sequence of this status message, values from 0-9 + * sequence of this status message, values from 0-9 */ u8 index; - /** -* the PID of the process + * the PID of the process */ u16 pid; - /** -* percent of CPU used, expressed as a fraction of 256 + * percent of CPU used, expressed as a fraction of 256 */ u8 pcpu; - /** -* timestamp of message, refer to flags field for how to interpret + * timestamp of message, refer to flags field for how to interpret */ u32 time; - /** -* flags + * flags */ u8 flags; - /** -* fixed length string representing the thread name + * fixed length string representing the thread name */ char tname[SBP_MSG_LINUX_CPU_STATE_TNAME_MAX]; - /** -* the command line (as much as it fits in the remaining packet) + * the command line (as much as it fits in the remaining packet) */ sbp_string_t cmdline; } sbp_msg_linux_cpu_state_t; +/** + * Initialise sbp_msg_linux_cpu_state_t::cmdline to empty + * + * @param msg sbp_msg_linux_cpu_state_t instance + */ +SBP_EXPORT void sbp_msg_linux_cpu_state_cmdline_init( + sbp_msg_linux_cpu_state_t *msg); - /** - * Initialise sbp_msg_linux_cpu_state_t::cmdline to empty - * - * @param msg sbp_msg_linux_cpu_state_t instance - */ - SBP_EXPORT void sbp_msg_linux_cpu_state_cmdline_init(sbp_msg_linux_cpu_state_t *msg); - - /** - * Test sbp_msg_linux_cpu_state_t::cmdline for validity - * - * @param msg sbp_msg_linux_cpu_state_t instance - * @return true is sbp_msg_linux_cpu_state_t::cmdline is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_cpu_state_cmdline_valid(const sbp_msg_linux_cpu_state_t *msg); +/** + * Test sbp_msg_linux_cpu_state_t::cmdline for validity + * + * @param msg sbp_msg_linux_cpu_state_t instance + * @return true is sbp_msg_linux_cpu_state_t::cmdline is valid for encoding + * purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_cpu_state_cmdline_valid( + const sbp_msg_linux_cpu_state_t *msg); - /** - * Tests 2 instances of sbp_msg_linux_cpu_state_t::cmdline for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_linux_cpu_state_t instance - * @param b sbp_msg_linux_cpu_state_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_linux_cpu_state_cmdline_strcmp(const sbp_msg_linux_cpu_state_t *a, const sbp_msg_linux_cpu_state_t *b); +/** + * Tests 2 instances of sbp_msg_linux_cpu_state_t::cmdline for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_linux_cpu_state_t instance + * @param b sbp_msg_linux_cpu_state_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_linux_cpu_state_cmdline_strcmp( + const sbp_msg_linux_cpu_state_t *a, const sbp_msg_linux_cpu_state_t *b); - /** - * Get the encoded size of sbp_msg_linux_cpu_state_t::cmdline - * - * @param msg sbp_msg_linux_cpu_state_t instance - * @return Size of sbp_msg_linux_cpu_state_t::cmdline in wire representation - */ - SBP_EXPORT size_t sbp_msg_linux_cpu_state_cmdline_encoded_len(const sbp_msg_linux_cpu_state_t *msg); +/** + * Get the encoded size of sbp_msg_linux_cpu_state_t::cmdline + * + * @param msg sbp_msg_linux_cpu_state_t instance + * @return Size of sbp_msg_linux_cpu_state_t::cmdline in wire representation + */ +SBP_EXPORT size_t sbp_msg_linux_cpu_state_cmdline_encoded_len( + const sbp_msg_linux_cpu_state_t *msg); - /** - * Query sbp_msg_linux_cpu_state_t::cmdline for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_linux_cpu_state_t::cmdline before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_linux_cpu_state_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_linux_cpu_state_cmdline_space_remaining(const sbp_msg_linux_cpu_state_t *msg); - /** - * Set sbp_msg_linux_cpu_state_t::cmdline - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_linux_cpu_state_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_cpu_state_cmdline_set(sbp_msg_linux_cpu_state_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_linux_cpu_state_t::cmdline for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_linux_cpu_state_t::cmdline before it exceeds the maximum + * size of the field in wire representation + * + * @param msg sbp_msg_linux_cpu_state_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_linux_cpu_state_cmdline_space_remaining( + const sbp_msg_linux_cpu_state_t *msg); +/** + * Set sbp_msg_linux_cpu_state_t::cmdline + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_linux_cpu_state_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_cpu_state_cmdline_set( + sbp_msg_linux_cpu_state_t *msg, const char *new_str, bool should_trunc, + size_t *n_written); - /** - * Set sbp_msg_linux_cpu_state_t::cmdline from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_linux_cpu_state_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_cpu_state_cmdline_set_raw(sbp_msg_linux_cpu_state_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_linux_cpu_state_t::cmdline from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_linux_cpu_state_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_cpu_state_cmdline_set_raw( + sbp_msg_linux_cpu_state_t *msg, const char *new_buf, size_t new_buf_len, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_linux_cpu_state_t::cmdline with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_linux_cpu_state_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_cpu_state_cmdline_printf(sbp_msg_linux_cpu_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_linux_cpu_state_t::cmdline with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_linux_cpu_state_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_cpu_state_cmdline_printf( + sbp_msg_linux_cpu_state_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_linux_cpu_state_t::cmdline with printf style formatting - * - * Identical to #sbp_msg_linux_cpu_state_cmdline_printf except it takes a va_list argument - * - * @param msg sbp_msg_linux_cpu_state_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_cpu_state_cmdline_vprintf(sbp_msg_linux_cpu_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_linux_cpu_state_t::cmdline with printf style formatting + * + * Identical to #sbp_msg_linux_cpu_state_cmdline_printf except it takes a + * va_list argument + * + * @param msg sbp_msg_linux_cpu_state_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_cpu_state_cmdline_vprintf( + sbp_msg_linux_cpu_state_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_linux_cpu_state_t::cmdline with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_linux_cpu_state_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_cpu_state_cmdline_append_printf(sbp_msg_linux_cpu_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_linux_cpu_state_t::cmdline with printf style formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_linux_cpu_state_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_cpu_state_cmdline_append_printf( + sbp_msg_linux_cpu_state_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_linux_cpu_state_t::cmdline with printf style formatting - * - * Identical to #sbp_msg_linux_cpu_state_cmdline_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_linux_cpu_state_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_cpu_state_cmdline_append_vprintf(sbp_msg_linux_cpu_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_linux_cpu_state_t::cmdline with printf style formatting + * + * Identical to #sbp_msg_linux_cpu_state_cmdline_append_printf except it takes a + * va_list argument + * + * @param msg sbp_msg_linux_cpu_state_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_cpu_state_cmdline_append_vprintf( + sbp_msg_linux_cpu_state_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_linux_cpu_state_t::cmdline - * - * @param msg sbp_msg_linux_cpu_state_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_linux_cpu_state_cmdline_get(const sbp_msg_linux_cpu_state_t *msg); +/** + * Obtain the string value from sbp_msg_linux_cpu_state_t::cmdline + * + * @param msg sbp_msg_linux_cpu_state_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_linux_cpu_state_cmdline_get( + const sbp_msg_linux_cpu_state_t *msg); - /** - * Obtain the length of sbp_msg_linux_cpu_state_t::cmdline - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_linux_cpu_state_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_linux_cpu_state_cmdline_strlen(const sbp_msg_linux_cpu_state_t *msg); +/** + * Obtain the length of sbp_msg_linux_cpu_state_t::cmdline + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_linux_cpu_state_t instance + * @return Length of string + */ +SBP_EXPORT size_t +sbp_msg_linux_cpu_state_cmdline_strlen(const sbp_msg_linux_cpu_state_t *msg); /** * Get encoded size of an instance of sbp_msg_linux_cpu_state_t @@ -262,46 +279,62 @@ typedef struct { * @param msg sbp_msg_linux_cpu_state_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_linux_cpu_state_encoded_len(const sbp_msg_linux_cpu_state_t *msg) -{ - return SBP_MSG_LINUX_CPU_STATE_ENCODED_OVERHEAD - + sbp_msg_linux_cpu_state_cmdline_encoded_len(msg) - ; +static inline size_t sbp_msg_linux_cpu_state_encoded_len( + const sbp_msg_linux_cpu_state_t *msg) { + return SBP_MSG_LINUX_CPU_STATE_ENCODED_OVERHEAD + + sbp_msg_linux_cpu_state_cmdline_encoded_len(msg); } /** * Encode an instance of sbp_msg_linux_cpu_state_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_linux_cpu_state_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_cpu_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_cpu_state_t *msg); +SBP_EXPORT s8 +sbp_msg_linux_cpu_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_cpu_state_t *msg); /** * Decode an instance of sbp_msg_linux_cpu_state_t from wire representation * - * This function decodes the wire representation of a sbp_msg_linux_cpu_state_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_linux_cpu_state_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_linux_cpu_state_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_cpu_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_cpu_state_t *msg); +SBP_EXPORT s8 sbp_msg_linux_cpu_state_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_linux_cpu_state_t *msg); /** * Send an instance of sbp_msg_linux_cpu_state_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_linux_cpu_state_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_linux_cpu_state_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -309,51 +342,61 @@ SBP_EXPORT s8 sbp_msg_linux_cpu_state_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_cpu_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_cpu_state_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_linux_cpu_state_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_linux_cpu_state_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_linux_cpu_state_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_linux_cpu_state_t instance * @param b sbp_msg_linux_cpu_state_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_linux_cpu_state_cmp(const sbp_msg_linux_cpu_state_t *a, const sbp_msg_linux_cpu_state_t *b); +SBP_EXPORT int sbp_msg_linux_cpu_state_cmp(const sbp_msg_linux_cpu_state_t *a, + const sbp_msg_linux_cpu_state_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_linux_cpu_state_t &lhs, const sbp_msg_linux_cpu_state_t &rhs) { +static inline bool operator==(const sbp_msg_linux_cpu_state_t &lhs, + const sbp_msg_linux_cpu_state_t &rhs) { return sbp_msg_linux_cpu_state_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_linux_cpu_state_t &lhs, const sbp_msg_linux_cpu_state_t &rhs) { +static inline bool operator!=(const sbp_msg_linux_cpu_state_t &lhs, + const sbp_msg_linux_cpu_state_t &rhs) { return sbp_msg_linux_cpu_state_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_linux_cpu_state_t &lhs, const sbp_msg_linux_cpu_state_t &rhs) { +static inline bool operator<(const sbp_msg_linux_cpu_state_t &lhs, + const sbp_msg_linux_cpu_state_t &rhs) { return sbp_msg_linux_cpu_state_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_linux_cpu_state_t &lhs, const sbp_msg_linux_cpu_state_t &rhs) { +static inline bool operator<=(const sbp_msg_linux_cpu_state_t &lhs, + const sbp_msg_linux_cpu_state_t &rhs) { return sbp_msg_linux_cpu_state_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_linux_cpu_state_t &lhs, const sbp_msg_linux_cpu_state_t &rhs) { +static inline bool operator>(const sbp_msg_linux_cpu_state_t &lhs, + const sbp_msg_linux_cpu_state_t &rhs) { return sbp_msg_linux_cpu_state_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_linux_cpu_state_t &lhs, const sbp_msg_linux_cpu_state_t &rhs) { +static inline bool operator>=(const sbp_msg_linux_cpu_state_t &lhs, + const sbp_msg_linux_cpu_state_t &rhs) { return sbp_msg_linux_cpu_state_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_LINUX_MSG_LINUX_CPU_STATE_H */ - diff --git a/c/include/libsbp/linux/MSG_LINUX_CPU_STATE_DEP_A.h b/c/include/libsbp/linux/MSG_LINUX_CPU_STATE_DEP_A.h index 79d0a609e..0999a7c0e 100644 --- a/c/include/libsbp/linux/MSG_LINUX_CPU_STATE_DEP_A.h +++ b/c/include/libsbp/linux/MSG_LINUX_CPU_STATE_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_LINUX_MSG_LINUX_CPU_STATE_DEP_A_H #define LIBSBP_LINUX_MSG_LINUX_CPU_STATE_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,209 +40,229 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* sequence of this status message, values from 0-9 + * sequence of this status message, values from 0-9 */ u8 index; - /** -* the PID of the process + * the PID of the process */ u16 pid; - /** -* percent of cpu used, expressed as a fraction of 256 + * percent of cpu used, expressed as a fraction of 256 */ u8 pcpu; - /** -* fixed length string representing the thread name + * fixed length string representing the thread name */ char tname[SBP_MSG_LINUX_CPU_STATE_DEP_A_TNAME_MAX]; - /** -* the command line (as much as it fits in the remaining packet) + * the command line (as much as it fits in the remaining packet) */ sbp_string_t cmdline; } sbp_msg_linux_cpu_state_dep_a_t; +/** + * Initialise sbp_msg_linux_cpu_state_dep_a_t::cmdline to empty + * + * @param msg sbp_msg_linux_cpu_state_dep_a_t instance + */ +SBP_EXPORT void sbp_msg_linux_cpu_state_dep_a_cmdline_init( + sbp_msg_linux_cpu_state_dep_a_t *msg); - /** - * Initialise sbp_msg_linux_cpu_state_dep_a_t::cmdline to empty - * - * @param msg sbp_msg_linux_cpu_state_dep_a_t instance - */ - SBP_EXPORT void sbp_msg_linux_cpu_state_dep_a_cmdline_init(sbp_msg_linux_cpu_state_dep_a_t *msg); - - /** - * Test sbp_msg_linux_cpu_state_dep_a_t::cmdline for validity - * - * @param msg sbp_msg_linux_cpu_state_dep_a_t instance - * @return true is sbp_msg_linux_cpu_state_dep_a_t::cmdline is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_cpu_state_dep_a_cmdline_valid(const sbp_msg_linux_cpu_state_dep_a_t *msg); +/** + * Test sbp_msg_linux_cpu_state_dep_a_t::cmdline for validity + * + * @param msg sbp_msg_linux_cpu_state_dep_a_t instance + * @return true is sbp_msg_linux_cpu_state_dep_a_t::cmdline is valid for + * encoding purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_cpu_state_dep_a_cmdline_valid( + const sbp_msg_linux_cpu_state_dep_a_t *msg); - /** - * Tests 2 instances of sbp_msg_linux_cpu_state_dep_a_t::cmdline for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_linux_cpu_state_dep_a_t instance - * @param b sbp_msg_linux_cpu_state_dep_a_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_linux_cpu_state_dep_a_cmdline_strcmp(const sbp_msg_linux_cpu_state_dep_a_t *a, const sbp_msg_linux_cpu_state_dep_a_t *b); +/** + * Tests 2 instances of sbp_msg_linux_cpu_state_dep_a_t::cmdline for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_linux_cpu_state_dep_a_t instance + * @param b sbp_msg_linux_cpu_state_dep_a_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_linux_cpu_state_dep_a_cmdline_strcmp( + const sbp_msg_linux_cpu_state_dep_a_t *a, + const sbp_msg_linux_cpu_state_dep_a_t *b); - /** - * Get the encoded size of sbp_msg_linux_cpu_state_dep_a_t::cmdline - * - * @param msg sbp_msg_linux_cpu_state_dep_a_t instance - * @return Size of sbp_msg_linux_cpu_state_dep_a_t::cmdline in wire representation - */ - SBP_EXPORT size_t sbp_msg_linux_cpu_state_dep_a_cmdline_encoded_len(const sbp_msg_linux_cpu_state_dep_a_t *msg); +/** + * Get the encoded size of sbp_msg_linux_cpu_state_dep_a_t::cmdline + * + * @param msg sbp_msg_linux_cpu_state_dep_a_t instance + * @return Size of sbp_msg_linux_cpu_state_dep_a_t::cmdline in wire + * representation + */ +SBP_EXPORT size_t sbp_msg_linux_cpu_state_dep_a_cmdline_encoded_len( + const sbp_msg_linux_cpu_state_dep_a_t *msg); - /** - * Query sbp_msg_linux_cpu_state_dep_a_t::cmdline for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_linux_cpu_state_dep_a_t::cmdline before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_linux_cpu_state_dep_a_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_linux_cpu_state_dep_a_cmdline_space_remaining(const sbp_msg_linux_cpu_state_dep_a_t *msg); - /** - * Set sbp_msg_linux_cpu_state_dep_a_t::cmdline - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_linux_cpu_state_dep_a_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_cpu_state_dep_a_cmdline_set(sbp_msg_linux_cpu_state_dep_a_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_linux_cpu_state_dep_a_t::cmdline for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_linux_cpu_state_dep_a_t::cmdline before it exceeds the + * maximum size of the field in wire representation + * + * @param msg sbp_msg_linux_cpu_state_dep_a_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_linux_cpu_state_dep_a_cmdline_space_remaining( + const sbp_msg_linux_cpu_state_dep_a_t *msg); +/** + * Set sbp_msg_linux_cpu_state_dep_a_t::cmdline + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_linux_cpu_state_dep_a_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_cpu_state_dep_a_cmdline_set( + sbp_msg_linux_cpu_state_dep_a_t *msg, const char *new_str, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_linux_cpu_state_dep_a_t::cmdline from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_linux_cpu_state_dep_a_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_cpu_state_dep_a_cmdline_set_raw(sbp_msg_linux_cpu_state_dep_a_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_linux_cpu_state_dep_a_t::cmdline from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_linux_cpu_state_dep_a_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_cpu_state_dep_a_cmdline_set_raw( + sbp_msg_linux_cpu_state_dep_a_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_linux_cpu_state_dep_a_t::cmdline with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_linux_cpu_state_dep_a_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_cpu_state_dep_a_cmdline_printf(sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_linux_cpu_state_dep_a_t::cmdline with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_linux_cpu_state_dep_a_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_cpu_state_dep_a_cmdline_printf( + sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_linux_cpu_state_dep_a_t::cmdline with printf style formatting - * - * Identical to #sbp_msg_linux_cpu_state_dep_a_cmdline_printf except it takes a va_list argument - * - * @param msg sbp_msg_linux_cpu_state_dep_a_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_cpu_state_dep_a_cmdline_vprintf(sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_linux_cpu_state_dep_a_t::cmdline with printf style formatting + * + * Identical to #sbp_msg_linux_cpu_state_dep_a_cmdline_printf except it takes a + * va_list argument + * + * @param msg sbp_msg_linux_cpu_state_dep_a_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_cpu_state_dep_a_cmdline_vprintf( + sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_linux_cpu_state_dep_a_t::cmdline with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_linux_cpu_state_dep_a_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_cpu_state_dep_a_cmdline_append_printf(sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_linux_cpu_state_dep_a_t::cmdline with printf style formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_linux_cpu_state_dep_a_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_cpu_state_dep_a_cmdline_append_printf( + sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_linux_cpu_state_dep_a_t::cmdline with printf style formatting - * - * Identical to #sbp_msg_linux_cpu_state_dep_a_cmdline_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_linux_cpu_state_dep_a_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_cpu_state_dep_a_cmdline_append_vprintf(sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_linux_cpu_state_dep_a_t::cmdline with printf style formatting + * + * Identical to #sbp_msg_linux_cpu_state_dep_a_cmdline_append_printf except it + * takes a va_list argument + * + * @param msg sbp_msg_linux_cpu_state_dep_a_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_cpu_state_dep_a_cmdline_append_vprintf( + sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_linux_cpu_state_dep_a_t::cmdline - * - * @param msg sbp_msg_linux_cpu_state_dep_a_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_linux_cpu_state_dep_a_cmdline_get(const sbp_msg_linux_cpu_state_dep_a_t *msg); +/** + * Obtain the string value from sbp_msg_linux_cpu_state_dep_a_t::cmdline + * + * @param msg sbp_msg_linux_cpu_state_dep_a_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_linux_cpu_state_dep_a_cmdline_get( + const sbp_msg_linux_cpu_state_dep_a_t *msg); - /** - * Obtain the length of sbp_msg_linux_cpu_state_dep_a_t::cmdline - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_linux_cpu_state_dep_a_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_linux_cpu_state_dep_a_cmdline_strlen(const sbp_msg_linux_cpu_state_dep_a_t *msg); +/** + * Obtain the length of sbp_msg_linux_cpu_state_dep_a_t::cmdline + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_linux_cpu_state_dep_a_t instance + * @return Length of string + */ +SBP_EXPORT size_t sbp_msg_linux_cpu_state_dep_a_cmdline_strlen( + const sbp_msg_linux_cpu_state_dep_a_t *msg); /** * Get encoded size of an instance of sbp_msg_linux_cpu_state_dep_a_t @@ -250,46 +270,65 @@ typedef struct { * @param msg sbp_msg_linux_cpu_state_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_linux_cpu_state_dep_a_encoded_len(const sbp_msg_linux_cpu_state_dep_a_t *msg) -{ - return SBP_MSG_LINUX_CPU_STATE_DEP_A_ENCODED_OVERHEAD - + sbp_msg_linux_cpu_state_dep_a_cmdline_encoded_len(msg) - ; +static inline size_t sbp_msg_linux_cpu_state_dep_a_encoded_len( + const sbp_msg_linux_cpu_state_dep_a_t *msg) { + return SBP_MSG_LINUX_CPU_STATE_DEP_A_ENCODED_OVERHEAD + + sbp_msg_linux_cpu_state_dep_a_cmdline_encoded_len(msg); } /** * Encode an instance of sbp_msg_linux_cpu_state_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_linux_cpu_state_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_cpu_state_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_cpu_state_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_linux_cpu_state_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_cpu_state_dep_a_t *msg); /** - * Decode an instance of sbp_msg_linux_cpu_state_dep_a_t from wire representation + * Decode an instance of sbp_msg_linux_cpu_state_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_linux_cpu_state_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_linux_cpu_state_dep_a_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_linux_cpu_state_dep_a_t instance + * @param buf Wire representation of the sbp_msg_linux_cpu_state_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_cpu_state_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_cpu_state_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_linux_cpu_state_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_cpu_state_dep_a_t *msg); /** - * Send an instance of sbp_msg_linux_cpu_state_dep_a_t with the given write function + * Send an instance of sbp_msg_linux_cpu_state_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_linux_cpu_state_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_linux_cpu_state_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -297,51 +336,62 @@ SBP_EXPORT s8 sbp_msg_linux_cpu_state_dep_a_decode(const uint8_t *buf, uint8_t l * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_cpu_state_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_cpu_state_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_linux_cpu_state_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_linux_cpu_state_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_linux_cpu_state_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_linux_cpu_state_dep_a_t instance * @param b sbp_msg_linux_cpu_state_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_linux_cpu_state_dep_a_cmp(const sbp_msg_linux_cpu_state_dep_a_t *a, const sbp_msg_linux_cpu_state_dep_a_t *b); +SBP_EXPORT int sbp_msg_linux_cpu_state_dep_a_cmp( + const sbp_msg_linux_cpu_state_dep_a_t *a, + const sbp_msg_linux_cpu_state_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_linux_cpu_state_dep_a_t &lhs, const sbp_msg_linux_cpu_state_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_linux_cpu_state_dep_a_t &lhs, + const sbp_msg_linux_cpu_state_dep_a_t &rhs) { return sbp_msg_linux_cpu_state_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_linux_cpu_state_dep_a_t &lhs, const sbp_msg_linux_cpu_state_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_linux_cpu_state_dep_a_t &lhs, + const sbp_msg_linux_cpu_state_dep_a_t &rhs) { return sbp_msg_linux_cpu_state_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_linux_cpu_state_dep_a_t &lhs, const sbp_msg_linux_cpu_state_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_linux_cpu_state_dep_a_t &lhs, + const sbp_msg_linux_cpu_state_dep_a_t &rhs) { return sbp_msg_linux_cpu_state_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_linux_cpu_state_dep_a_t &lhs, const sbp_msg_linux_cpu_state_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_linux_cpu_state_dep_a_t &lhs, + const sbp_msg_linux_cpu_state_dep_a_t &rhs) { return sbp_msg_linux_cpu_state_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_linux_cpu_state_dep_a_t &lhs, const sbp_msg_linux_cpu_state_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_linux_cpu_state_dep_a_t &lhs, + const sbp_msg_linux_cpu_state_dep_a_t &rhs) { return sbp_msg_linux_cpu_state_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_linux_cpu_state_dep_a_t &lhs, const sbp_msg_linux_cpu_state_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_linux_cpu_state_dep_a_t &lhs, + const sbp_msg_linux_cpu_state_dep_a_t &rhs) { return sbp_msg_linux_cpu_state_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_LINUX_MSG_LINUX_CPU_STATE_DEP_A_H */ - diff --git a/c/include/libsbp/linux/MSG_LINUX_MEM_STATE.h b/c/include/libsbp/linux/MSG_LINUX_MEM_STATE.h index 60e654f4c..3d71dae83 100644 --- a/c/include/libsbp/linux/MSG_LINUX_MEM_STATE.h +++ b/c/include/libsbp/linux/MSG_LINUX_MEM_STATE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_LINUX_MSG_LINUX_MEM_STATE_H #define LIBSBP_LINUX_MSG_LINUX_MEM_STATE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,221 +40,238 @@ *****************************************************************************/ /** List memory state on the system * -* This message indicates the process state of the top 10 heaviest consumers of memory on the system, including a timestamp. + * This message indicates the process state of the top 10 heaviest consumers of + * memory on the system, including a timestamp. */ typedef struct { - - /** -* sequence of this status message, values from 0-9 + * sequence of this status message, values from 0-9 */ u8 index; - /** -* the PID of the process + * the PID of the process */ u16 pid; - /** -* percent of memory used, expressed as a fraction of 256 + * percent of memory used, expressed as a fraction of 256 */ u8 pmem; - /** -* timestamp of message, refer to flags field for how to interpret + * timestamp of message, refer to flags field for how to interpret */ u32 time; - /** -* flags + * flags */ u8 flags; - /** -* fixed length string representing the thread name + * fixed length string representing the thread name */ char tname[SBP_MSG_LINUX_MEM_STATE_TNAME_MAX]; - /** -* the command line (as much as it fits in the remaining packet) + * the command line (as much as it fits in the remaining packet) */ sbp_string_t cmdline; } sbp_msg_linux_mem_state_t; +/** + * Initialise sbp_msg_linux_mem_state_t::cmdline to empty + * + * @param msg sbp_msg_linux_mem_state_t instance + */ +SBP_EXPORT void sbp_msg_linux_mem_state_cmdline_init( + sbp_msg_linux_mem_state_t *msg); - /** - * Initialise sbp_msg_linux_mem_state_t::cmdline to empty - * - * @param msg sbp_msg_linux_mem_state_t instance - */ - SBP_EXPORT void sbp_msg_linux_mem_state_cmdline_init(sbp_msg_linux_mem_state_t *msg); - - /** - * Test sbp_msg_linux_mem_state_t::cmdline for validity - * - * @param msg sbp_msg_linux_mem_state_t instance - * @return true is sbp_msg_linux_mem_state_t::cmdline is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_mem_state_cmdline_valid(const sbp_msg_linux_mem_state_t *msg); +/** + * Test sbp_msg_linux_mem_state_t::cmdline for validity + * + * @param msg sbp_msg_linux_mem_state_t instance + * @return true is sbp_msg_linux_mem_state_t::cmdline is valid for encoding + * purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_mem_state_cmdline_valid( + const sbp_msg_linux_mem_state_t *msg); - /** - * Tests 2 instances of sbp_msg_linux_mem_state_t::cmdline for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_linux_mem_state_t instance - * @param b sbp_msg_linux_mem_state_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_linux_mem_state_cmdline_strcmp(const sbp_msg_linux_mem_state_t *a, const sbp_msg_linux_mem_state_t *b); +/** + * Tests 2 instances of sbp_msg_linux_mem_state_t::cmdline for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_linux_mem_state_t instance + * @param b sbp_msg_linux_mem_state_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_linux_mem_state_cmdline_strcmp( + const sbp_msg_linux_mem_state_t *a, const sbp_msg_linux_mem_state_t *b); - /** - * Get the encoded size of sbp_msg_linux_mem_state_t::cmdline - * - * @param msg sbp_msg_linux_mem_state_t instance - * @return Size of sbp_msg_linux_mem_state_t::cmdline in wire representation - */ - SBP_EXPORT size_t sbp_msg_linux_mem_state_cmdline_encoded_len(const sbp_msg_linux_mem_state_t *msg); +/** + * Get the encoded size of sbp_msg_linux_mem_state_t::cmdline + * + * @param msg sbp_msg_linux_mem_state_t instance + * @return Size of sbp_msg_linux_mem_state_t::cmdline in wire representation + */ +SBP_EXPORT size_t sbp_msg_linux_mem_state_cmdline_encoded_len( + const sbp_msg_linux_mem_state_t *msg); - /** - * Query sbp_msg_linux_mem_state_t::cmdline for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_linux_mem_state_t::cmdline before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_linux_mem_state_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_linux_mem_state_cmdline_space_remaining(const sbp_msg_linux_mem_state_t *msg); - /** - * Set sbp_msg_linux_mem_state_t::cmdline - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_linux_mem_state_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_mem_state_cmdline_set(sbp_msg_linux_mem_state_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_linux_mem_state_t::cmdline for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_linux_mem_state_t::cmdline before it exceeds the maximum + * size of the field in wire representation + * + * @param msg sbp_msg_linux_mem_state_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_linux_mem_state_cmdline_space_remaining( + const sbp_msg_linux_mem_state_t *msg); +/** + * Set sbp_msg_linux_mem_state_t::cmdline + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_linux_mem_state_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_mem_state_cmdline_set( + sbp_msg_linux_mem_state_t *msg, const char *new_str, bool should_trunc, + size_t *n_written); - /** - * Set sbp_msg_linux_mem_state_t::cmdline from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_linux_mem_state_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_mem_state_cmdline_set_raw(sbp_msg_linux_mem_state_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_linux_mem_state_t::cmdline from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_linux_mem_state_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_mem_state_cmdline_set_raw( + sbp_msg_linux_mem_state_t *msg, const char *new_buf, size_t new_buf_len, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_linux_mem_state_t::cmdline with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_linux_mem_state_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_mem_state_cmdline_printf(sbp_msg_linux_mem_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_linux_mem_state_t::cmdline with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_linux_mem_state_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_mem_state_cmdline_printf( + sbp_msg_linux_mem_state_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_linux_mem_state_t::cmdline with printf style formatting - * - * Identical to #sbp_msg_linux_mem_state_cmdline_printf except it takes a va_list argument - * - * @param msg sbp_msg_linux_mem_state_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_mem_state_cmdline_vprintf(sbp_msg_linux_mem_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_linux_mem_state_t::cmdline with printf style formatting + * + * Identical to #sbp_msg_linux_mem_state_cmdline_printf except it takes a + * va_list argument + * + * @param msg sbp_msg_linux_mem_state_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_mem_state_cmdline_vprintf( + sbp_msg_linux_mem_state_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_linux_mem_state_t::cmdline with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_linux_mem_state_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_mem_state_cmdline_append_printf(sbp_msg_linux_mem_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_linux_mem_state_t::cmdline with printf style formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_linux_mem_state_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_mem_state_cmdline_append_printf( + sbp_msg_linux_mem_state_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_linux_mem_state_t::cmdline with printf style formatting - * - * Identical to #sbp_msg_linux_mem_state_cmdline_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_linux_mem_state_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_mem_state_cmdline_append_vprintf(sbp_msg_linux_mem_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_linux_mem_state_t::cmdline with printf style formatting + * + * Identical to #sbp_msg_linux_mem_state_cmdline_append_printf except it takes a + * va_list argument + * + * @param msg sbp_msg_linux_mem_state_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_mem_state_cmdline_append_vprintf( + sbp_msg_linux_mem_state_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_linux_mem_state_t::cmdline - * - * @param msg sbp_msg_linux_mem_state_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_linux_mem_state_cmdline_get(const sbp_msg_linux_mem_state_t *msg); +/** + * Obtain the string value from sbp_msg_linux_mem_state_t::cmdline + * + * @param msg sbp_msg_linux_mem_state_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_linux_mem_state_cmdline_get( + const sbp_msg_linux_mem_state_t *msg); - /** - * Obtain the length of sbp_msg_linux_mem_state_t::cmdline - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_linux_mem_state_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_linux_mem_state_cmdline_strlen(const sbp_msg_linux_mem_state_t *msg); +/** + * Obtain the length of sbp_msg_linux_mem_state_t::cmdline + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_linux_mem_state_t instance + * @return Length of string + */ +SBP_EXPORT size_t +sbp_msg_linux_mem_state_cmdline_strlen(const sbp_msg_linux_mem_state_t *msg); /** * Get encoded size of an instance of sbp_msg_linux_mem_state_t @@ -262,46 +279,62 @@ typedef struct { * @param msg sbp_msg_linux_mem_state_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_linux_mem_state_encoded_len(const sbp_msg_linux_mem_state_t *msg) -{ - return SBP_MSG_LINUX_MEM_STATE_ENCODED_OVERHEAD - + sbp_msg_linux_mem_state_cmdline_encoded_len(msg) - ; +static inline size_t sbp_msg_linux_mem_state_encoded_len( + const sbp_msg_linux_mem_state_t *msg) { + return SBP_MSG_LINUX_MEM_STATE_ENCODED_OVERHEAD + + sbp_msg_linux_mem_state_cmdline_encoded_len(msg); } /** * Encode an instance of sbp_msg_linux_mem_state_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_linux_mem_state_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_mem_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_mem_state_t *msg); +SBP_EXPORT s8 +sbp_msg_linux_mem_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_mem_state_t *msg); /** * Decode an instance of sbp_msg_linux_mem_state_t from wire representation * - * This function decodes the wire representation of a sbp_msg_linux_mem_state_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_linux_mem_state_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_linux_mem_state_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_mem_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_mem_state_t *msg); +SBP_EXPORT s8 sbp_msg_linux_mem_state_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_linux_mem_state_t *msg); /** * Send an instance of sbp_msg_linux_mem_state_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_linux_mem_state_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_linux_mem_state_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -309,51 +342,61 @@ SBP_EXPORT s8 sbp_msg_linux_mem_state_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_mem_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_mem_state_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_linux_mem_state_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_linux_mem_state_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_linux_mem_state_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_linux_mem_state_t instance * @param b sbp_msg_linux_mem_state_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_linux_mem_state_cmp(const sbp_msg_linux_mem_state_t *a, const sbp_msg_linux_mem_state_t *b); +SBP_EXPORT int sbp_msg_linux_mem_state_cmp(const sbp_msg_linux_mem_state_t *a, + const sbp_msg_linux_mem_state_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_linux_mem_state_t &lhs, const sbp_msg_linux_mem_state_t &rhs) { +static inline bool operator==(const sbp_msg_linux_mem_state_t &lhs, + const sbp_msg_linux_mem_state_t &rhs) { return sbp_msg_linux_mem_state_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_linux_mem_state_t &lhs, const sbp_msg_linux_mem_state_t &rhs) { +static inline bool operator!=(const sbp_msg_linux_mem_state_t &lhs, + const sbp_msg_linux_mem_state_t &rhs) { return sbp_msg_linux_mem_state_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_linux_mem_state_t &lhs, const sbp_msg_linux_mem_state_t &rhs) { +static inline bool operator<(const sbp_msg_linux_mem_state_t &lhs, + const sbp_msg_linux_mem_state_t &rhs) { return sbp_msg_linux_mem_state_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_linux_mem_state_t &lhs, const sbp_msg_linux_mem_state_t &rhs) { +static inline bool operator<=(const sbp_msg_linux_mem_state_t &lhs, + const sbp_msg_linux_mem_state_t &rhs) { return sbp_msg_linux_mem_state_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_linux_mem_state_t &lhs, const sbp_msg_linux_mem_state_t &rhs) { +static inline bool operator>(const sbp_msg_linux_mem_state_t &lhs, + const sbp_msg_linux_mem_state_t &rhs) { return sbp_msg_linux_mem_state_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_linux_mem_state_t &lhs, const sbp_msg_linux_mem_state_t &rhs) { +static inline bool operator>=(const sbp_msg_linux_mem_state_t &lhs, + const sbp_msg_linux_mem_state_t &rhs) { return sbp_msg_linux_mem_state_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_LINUX_MSG_LINUX_MEM_STATE_H */ - diff --git a/c/include/libsbp/linux/MSG_LINUX_MEM_STATE_DEP_A.h b/c/include/libsbp/linux/MSG_LINUX_MEM_STATE_DEP_A.h index 4830a818e..82b83c5ae 100644 --- a/c/include/libsbp/linux/MSG_LINUX_MEM_STATE_DEP_A.h +++ b/c/include/libsbp/linux/MSG_LINUX_MEM_STATE_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_LINUX_MSG_LINUX_MEM_STATE_DEP_A_H #define LIBSBP_LINUX_MSG_LINUX_MEM_STATE_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,209 +40,229 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* sequence of this status message, values from 0-9 + * sequence of this status message, values from 0-9 */ u8 index; - /** -* the PID of the process + * the PID of the process */ u16 pid; - /** -* percent of memory used, expressed as a fraction of 256 + * percent of memory used, expressed as a fraction of 256 */ u8 pmem; - /** -* fixed length string representing the thread name + * fixed length string representing the thread name */ char tname[SBP_MSG_LINUX_MEM_STATE_DEP_A_TNAME_MAX]; - /** -* the command line (as much as it fits in the remaining packet) + * the command line (as much as it fits in the remaining packet) */ sbp_string_t cmdline; } sbp_msg_linux_mem_state_dep_a_t; +/** + * Initialise sbp_msg_linux_mem_state_dep_a_t::cmdline to empty + * + * @param msg sbp_msg_linux_mem_state_dep_a_t instance + */ +SBP_EXPORT void sbp_msg_linux_mem_state_dep_a_cmdline_init( + sbp_msg_linux_mem_state_dep_a_t *msg); - /** - * Initialise sbp_msg_linux_mem_state_dep_a_t::cmdline to empty - * - * @param msg sbp_msg_linux_mem_state_dep_a_t instance - */ - SBP_EXPORT void sbp_msg_linux_mem_state_dep_a_cmdline_init(sbp_msg_linux_mem_state_dep_a_t *msg); - - /** - * Test sbp_msg_linux_mem_state_dep_a_t::cmdline for validity - * - * @param msg sbp_msg_linux_mem_state_dep_a_t instance - * @return true is sbp_msg_linux_mem_state_dep_a_t::cmdline is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_mem_state_dep_a_cmdline_valid(const sbp_msg_linux_mem_state_dep_a_t *msg); +/** + * Test sbp_msg_linux_mem_state_dep_a_t::cmdline for validity + * + * @param msg sbp_msg_linux_mem_state_dep_a_t instance + * @return true is sbp_msg_linux_mem_state_dep_a_t::cmdline is valid for + * encoding purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_mem_state_dep_a_cmdline_valid( + const sbp_msg_linux_mem_state_dep_a_t *msg); - /** - * Tests 2 instances of sbp_msg_linux_mem_state_dep_a_t::cmdline for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_linux_mem_state_dep_a_t instance - * @param b sbp_msg_linux_mem_state_dep_a_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_linux_mem_state_dep_a_cmdline_strcmp(const sbp_msg_linux_mem_state_dep_a_t *a, const sbp_msg_linux_mem_state_dep_a_t *b); +/** + * Tests 2 instances of sbp_msg_linux_mem_state_dep_a_t::cmdline for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_linux_mem_state_dep_a_t instance + * @param b sbp_msg_linux_mem_state_dep_a_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_linux_mem_state_dep_a_cmdline_strcmp( + const sbp_msg_linux_mem_state_dep_a_t *a, + const sbp_msg_linux_mem_state_dep_a_t *b); - /** - * Get the encoded size of sbp_msg_linux_mem_state_dep_a_t::cmdline - * - * @param msg sbp_msg_linux_mem_state_dep_a_t instance - * @return Size of sbp_msg_linux_mem_state_dep_a_t::cmdline in wire representation - */ - SBP_EXPORT size_t sbp_msg_linux_mem_state_dep_a_cmdline_encoded_len(const sbp_msg_linux_mem_state_dep_a_t *msg); +/** + * Get the encoded size of sbp_msg_linux_mem_state_dep_a_t::cmdline + * + * @param msg sbp_msg_linux_mem_state_dep_a_t instance + * @return Size of sbp_msg_linux_mem_state_dep_a_t::cmdline in wire + * representation + */ +SBP_EXPORT size_t sbp_msg_linux_mem_state_dep_a_cmdline_encoded_len( + const sbp_msg_linux_mem_state_dep_a_t *msg); - /** - * Query sbp_msg_linux_mem_state_dep_a_t::cmdline for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_linux_mem_state_dep_a_t::cmdline before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_linux_mem_state_dep_a_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_linux_mem_state_dep_a_cmdline_space_remaining(const sbp_msg_linux_mem_state_dep_a_t *msg); - /** - * Set sbp_msg_linux_mem_state_dep_a_t::cmdline - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_linux_mem_state_dep_a_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_mem_state_dep_a_cmdline_set(sbp_msg_linux_mem_state_dep_a_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_linux_mem_state_dep_a_t::cmdline for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_linux_mem_state_dep_a_t::cmdline before it exceeds the + * maximum size of the field in wire representation + * + * @param msg sbp_msg_linux_mem_state_dep_a_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_linux_mem_state_dep_a_cmdline_space_remaining( + const sbp_msg_linux_mem_state_dep_a_t *msg); +/** + * Set sbp_msg_linux_mem_state_dep_a_t::cmdline + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_linux_mem_state_dep_a_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_mem_state_dep_a_cmdline_set( + sbp_msg_linux_mem_state_dep_a_t *msg, const char *new_str, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_linux_mem_state_dep_a_t::cmdline from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_linux_mem_state_dep_a_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_mem_state_dep_a_cmdline_set_raw(sbp_msg_linux_mem_state_dep_a_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_linux_mem_state_dep_a_t::cmdline from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_linux_mem_state_dep_a_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_mem_state_dep_a_cmdline_set_raw( + sbp_msg_linux_mem_state_dep_a_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_linux_mem_state_dep_a_t::cmdline with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_linux_mem_state_dep_a_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_mem_state_dep_a_cmdline_printf(sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_linux_mem_state_dep_a_t::cmdline with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_linux_mem_state_dep_a_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_mem_state_dep_a_cmdline_printf( + sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_linux_mem_state_dep_a_t::cmdline with printf style formatting - * - * Identical to #sbp_msg_linux_mem_state_dep_a_cmdline_printf except it takes a va_list argument - * - * @param msg sbp_msg_linux_mem_state_dep_a_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_mem_state_dep_a_cmdline_vprintf(sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_linux_mem_state_dep_a_t::cmdline with printf style formatting + * + * Identical to #sbp_msg_linux_mem_state_dep_a_cmdline_printf except it takes a + * va_list argument + * + * @param msg sbp_msg_linux_mem_state_dep_a_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_mem_state_dep_a_cmdline_vprintf( + sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_linux_mem_state_dep_a_t::cmdline with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_linux_mem_state_dep_a_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_mem_state_dep_a_cmdline_append_printf(sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_linux_mem_state_dep_a_t::cmdline with printf style formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_linux_mem_state_dep_a_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_mem_state_dep_a_cmdline_append_printf( + sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_linux_mem_state_dep_a_t::cmdline with printf style formatting - * - * Identical to #sbp_msg_linux_mem_state_dep_a_cmdline_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_linux_mem_state_dep_a_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_mem_state_dep_a_cmdline_append_vprintf(sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_linux_mem_state_dep_a_t::cmdline with printf style formatting + * + * Identical to #sbp_msg_linux_mem_state_dep_a_cmdline_append_printf except it + * takes a va_list argument + * + * @param msg sbp_msg_linux_mem_state_dep_a_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_mem_state_dep_a_cmdline_append_vprintf( + sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_linux_mem_state_dep_a_t::cmdline - * - * @param msg sbp_msg_linux_mem_state_dep_a_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_linux_mem_state_dep_a_cmdline_get(const sbp_msg_linux_mem_state_dep_a_t *msg); +/** + * Obtain the string value from sbp_msg_linux_mem_state_dep_a_t::cmdline + * + * @param msg sbp_msg_linux_mem_state_dep_a_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_linux_mem_state_dep_a_cmdline_get( + const sbp_msg_linux_mem_state_dep_a_t *msg); - /** - * Obtain the length of sbp_msg_linux_mem_state_dep_a_t::cmdline - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_linux_mem_state_dep_a_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_linux_mem_state_dep_a_cmdline_strlen(const sbp_msg_linux_mem_state_dep_a_t *msg); +/** + * Obtain the length of sbp_msg_linux_mem_state_dep_a_t::cmdline + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_linux_mem_state_dep_a_t instance + * @return Length of string + */ +SBP_EXPORT size_t sbp_msg_linux_mem_state_dep_a_cmdline_strlen( + const sbp_msg_linux_mem_state_dep_a_t *msg); /** * Get encoded size of an instance of sbp_msg_linux_mem_state_dep_a_t @@ -250,46 +270,65 @@ typedef struct { * @param msg sbp_msg_linux_mem_state_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_linux_mem_state_dep_a_encoded_len(const sbp_msg_linux_mem_state_dep_a_t *msg) -{ - return SBP_MSG_LINUX_MEM_STATE_DEP_A_ENCODED_OVERHEAD - + sbp_msg_linux_mem_state_dep_a_cmdline_encoded_len(msg) - ; +static inline size_t sbp_msg_linux_mem_state_dep_a_encoded_len( + const sbp_msg_linux_mem_state_dep_a_t *msg) { + return SBP_MSG_LINUX_MEM_STATE_DEP_A_ENCODED_OVERHEAD + + sbp_msg_linux_mem_state_dep_a_cmdline_encoded_len(msg); } /** * Encode an instance of sbp_msg_linux_mem_state_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_linux_mem_state_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_mem_state_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_mem_state_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_linux_mem_state_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_mem_state_dep_a_t *msg); /** - * Decode an instance of sbp_msg_linux_mem_state_dep_a_t from wire representation + * Decode an instance of sbp_msg_linux_mem_state_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_linux_mem_state_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_linux_mem_state_dep_a_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_linux_mem_state_dep_a_t instance + * @param buf Wire representation of the sbp_msg_linux_mem_state_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_mem_state_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_mem_state_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_linux_mem_state_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_mem_state_dep_a_t *msg); /** - * Send an instance of sbp_msg_linux_mem_state_dep_a_t with the given write function + * Send an instance of sbp_msg_linux_mem_state_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_linux_mem_state_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_linux_mem_state_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -297,51 +336,62 @@ SBP_EXPORT s8 sbp_msg_linux_mem_state_dep_a_decode(const uint8_t *buf, uint8_t l * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_mem_state_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_mem_state_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_linux_mem_state_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_linux_mem_state_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_linux_mem_state_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_linux_mem_state_dep_a_t instance * @param b sbp_msg_linux_mem_state_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_linux_mem_state_dep_a_cmp(const sbp_msg_linux_mem_state_dep_a_t *a, const sbp_msg_linux_mem_state_dep_a_t *b); +SBP_EXPORT int sbp_msg_linux_mem_state_dep_a_cmp( + const sbp_msg_linux_mem_state_dep_a_t *a, + const sbp_msg_linux_mem_state_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_linux_mem_state_dep_a_t &lhs, const sbp_msg_linux_mem_state_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_linux_mem_state_dep_a_t &lhs, + const sbp_msg_linux_mem_state_dep_a_t &rhs) { return sbp_msg_linux_mem_state_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_linux_mem_state_dep_a_t &lhs, const sbp_msg_linux_mem_state_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_linux_mem_state_dep_a_t &lhs, + const sbp_msg_linux_mem_state_dep_a_t &rhs) { return sbp_msg_linux_mem_state_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_linux_mem_state_dep_a_t &lhs, const sbp_msg_linux_mem_state_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_linux_mem_state_dep_a_t &lhs, + const sbp_msg_linux_mem_state_dep_a_t &rhs) { return sbp_msg_linux_mem_state_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_linux_mem_state_dep_a_t &lhs, const sbp_msg_linux_mem_state_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_linux_mem_state_dep_a_t &lhs, + const sbp_msg_linux_mem_state_dep_a_t &rhs) { return sbp_msg_linux_mem_state_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_linux_mem_state_dep_a_t &lhs, const sbp_msg_linux_mem_state_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_linux_mem_state_dep_a_t &lhs, + const sbp_msg_linux_mem_state_dep_a_t &rhs) { return sbp_msg_linux_mem_state_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_linux_mem_state_dep_a_t &lhs, const sbp_msg_linux_mem_state_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_linux_mem_state_dep_a_t &lhs, + const sbp_msg_linux_mem_state_dep_a_t &rhs) { return sbp_msg_linux_mem_state_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_LINUX_MSG_LINUX_MEM_STATE_DEP_A_H */ - diff --git a/c/include/libsbp/linux/MSG_LINUX_PROCESS_FD_COUNT.h b/c/include/libsbp/linux/MSG_LINUX_PROCESS_FD_COUNT.h index a71bb205b..0c82d7af4 100644 --- a/c/include/libsbp/linux/MSG_LINUX_PROCESS_FD_COUNT.h +++ b/c/include/libsbp/linux/MSG_LINUX_PROCESS_FD_COUNT.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_LINUX_MSG_LINUX_PROCESS_FD_COUNT_H #define LIBSBP_LINUX_MSG_LINUX_PROCESS_FD_COUNT_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,203 +40,224 @@ *****************************************************************************/ /** Summary of processes with large amounts of open file descriptors * -* Top 10 list of processes with a large number of open file descriptors. + * Top 10 list of processes with a large number of open file descriptors. */ typedef struct { - - /** -* sequence of this status message, values from 0-9 + * sequence of this status message, values from 0-9 */ u8 index; - /** -* the PID of the process in question + * the PID of the process in question */ u16 pid; - /** -* a count of the number of file descriptors opened by the process + * a count of the number of file descriptors opened by the process */ u16 fd_count; - /** -* the command line of the process in question + * the command line of the process in question */ sbp_string_t cmdline; } sbp_msg_linux_process_fd_count_t; +/** + * Initialise sbp_msg_linux_process_fd_count_t::cmdline to empty + * + * @param msg sbp_msg_linux_process_fd_count_t instance + */ +SBP_EXPORT void sbp_msg_linux_process_fd_count_cmdline_init( + sbp_msg_linux_process_fd_count_t *msg); - /** - * Initialise sbp_msg_linux_process_fd_count_t::cmdline to empty - * - * @param msg sbp_msg_linux_process_fd_count_t instance - */ - SBP_EXPORT void sbp_msg_linux_process_fd_count_cmdline_init(sbp_msg_linux_process_fd_count_t *msg); - - /** - * Test sbp_msg_linux_process_fd_count_t::cmdline for validity - * - * @param msg sbp_msg_linux_process_fd_count_t instance - * @return true is sbp_msg_linux_process_fd_count_t::cmdline is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_fd_count_cmdline_valid(const sbp_msg_linux_process_fd_count_t *msg); +/** + * Test sbp_msg_linux_process_fd_count_t::cmdline for validity + * + * @param msg sbp_msg_linux_process_fd_count_t instance + * @return true is sbp_msg_linux_process_fd_count_t::cmdline is valid for + * encoding purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_fd_count_cmdline_valid( + const sbp_msg_linux_process_fd_count_t *msg); - /** - * Tests 2 instances of sbp_msg_linux_process_fd_count_t::cmdline for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_linux_process_fd_count_t instance - * @param b sbp_msg_linux_process_fd_count_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_linux_process_fd_count_cmdline_strcmp(const sbp_msg_linux_process_fd_count_t *a, const sbp_msg_linux_process_fd_count_t *b); +/** + * Tests 2 instances of sbp_msg_linux_process_fd_count_t::cmdline for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_linux_process_fd_count_t instance + * @param b sbp_msg_linux_process_fd_count_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_linux_process_fd_count_cmdline_strcmp( + const sbp_msg_linux_process_fd_count_t *a, + const sbp_msg_linux_process_fd_count_t *b); - /** - * Get the encoded size of sbp_msg_linux_process_fd_count_t::cmdline - * - * @param msg sbp_msg_linux_process_fd_count_t instance - * @return Size of sbp_msg_linux_process_fd_count_t::cmdline in wire representation - */ - SBP_EXPORT size_t sbp_msg_linux_process_fd_count_cmdline_encoded_len(const sbp_msg_linux_process_fd_count_t *msg); +/** + * Get the encoded size of sbp_msg_linux_process_fd_count_t::cmdline + * + * @param msg sbp_msg_linux_process_fd_count_t instance + * @return Size of sbp_msg_linux_process_fd_count_t::cmdline in wire + * representation + */ +SBP_EXPORT size_t sbp_msg_linux_process_fd_count_cmdline_encoded_len( + const sbp_msg_linux_process_fd_count_t *msg); - /** - * Query sbp_msg_linux_process_fd_count_t::cmdline for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_linux_process_fd_count_t::cmdline before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_linux_process_fd_count_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_linux_process_fd_count_cmdline_space_remaining(const sbp_msg_linux_process_fd_count_t *msg); - /** - * Set sbp_msg_linux_process_fd_count_t::cmdline - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_linux_process_fd_count_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_fd_count_cmdline_set(sbp_msg_linux_process_fd_count_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_linux_process_fd_count_t::cmdline for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_linux_process_fd_count_t::cmdline before it exceeds the + * maximum size of the field in wire representation + * + * @param msg sbp_msg_linux_process_fd_count_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_linux_process_fd_count_cmdline_space_remaining( + const sbp_msg_linux_process_fd_count_t *msg); +/** + * Set sbp_msg_linux_process_fd_count_t::cmdline + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_linux_process_fd_count_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_fd_count_cmdline_set( + sbp_msg_linux_process_fd_count_t *msg, const char *new_str, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_linux_process_fd_count_t::cmdline from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_linux_process_fd_count_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_fd_count_cmdline_set_raw(sbp_msg_linux_process_fd_count_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_linux_process_fd_count_t::cmdline from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_linux_process_fd_count_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_fd_count_cmdline_set_raw( + sbp_msg_linux_process_fd_count_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_linux_process_fd_count_t::cmdline with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_linux_process_fd_count_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_fd_count_cmdline_printf(sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_linux_process_fd_count_t::cmdline with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_linux_process_fd_count_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_fd_count_cmdline_printf( + sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_linux_process_fd_count_t::cmdline with printf style formatting - * - * Identical to #sbp_msg_linux_process_fd_count_cmdline_printf except it takes a va_list argument - * - * @param msg sbp_msg_linux_process_fd_count_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_fd_count_cmdline_vprintf(sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_linux_process_fd_count_t::cmdline with printf style formatting + * + * Identical to #sbp_msg_linux_process_fd_count_cmdline_printf except it takes a + * va_list argument + * + * @param msg sbp_msg_linux_process_fd_count_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_fd_count_cmdline_vprintf( + sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_linux_process_fd_count_t::cmdline with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_linux_process_fd_count_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_fd_count_cmdline_append_printf(sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_linux_process_fd_count_t::cmdline with printf style formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_linux_process_fd_count_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_fd_count_cmdline_append_printf( + sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_linux_process_fd_count_t::cmdline with printf style formatting - * - * Identical to #sbp_msg_linux_process_fd_count_cmdline_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_linux_process_fd_count_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_fd_count_cmdline_append_vprintf(sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_linux_process_fd_count_t::cmdline with printf style formatting + * + * Identical to #sbp_msg_linux_process_fd_count_cmdline_append_printf except it + * takes a va_list argument + * + * @param msg sbp_msg_linux_process_fd_count_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_fd_count_cmdline_append_vprintf( + sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_linux_process_fd_count_t::cmdline - * - * @param msg sbp_msg_linux_process_fd_count_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_linux_process_fd_count_cmdline_get(const sbp_msg_linux_process_fd_count_t *msg); +/** + * Obtain the string value from sbp_msg_linux_process_fd_count_t::cmdline + * + * @param msg sbp_msg_linux_process_fd_count_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_linux_process_fd_count_cmdline_get( + const sbp_msg_linux_process_fd_count_t *msg); - /** - * Obtain the length of sbp_msg_linux_process_fd_count_t::cmdline - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_linux_process_fd_count_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_linux_process_fd_count_cmdline_strlen(const sbp_msg_linux_process_fd_count_t *msg); +/** + * Obtain the length of sbp_msg_linux_process_fd_count_t::cmdline + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_linux_process_fd_count_t instance + * @return Length of string + */ +SBP_EXPORT size_t sbp_msg_linux_process_fd_count_cmdline_strlen( + const sbp_msg_linux_process_fd_count_t *msg); /** * Get encoded size of an instance of sbp_msg_linux_process_fd_count_t @@ -244,46 +265,65 @@ typedef struct { * @param msg sbp_msg_linux_process_fd_count_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_linux_process_fd_count_encoded_len(const sbp_msg_linux_process_fd_count_t *msg) -{ - return SBP_MSG_LINUX_PROCESS_FD_COUNT_ENCODED_OVERHEAD - + sbp_msg_linux_process_fd_count_cmdline_encoded_len(msg) - ; +static inline size_t sbp_msg_linux_process_fd_count_encoded_len( + const sbp_msg_linux_process_fd_count_t *msg) { + return SBP_MSG_LINUX_PROCESS_FD_COUNT_ENCODED_OVERHEAD + + sbp_msg_linux_process_fd_count_cmdline_encoded_len(msg); } /** * Encode an instance of sbp_msg_linux_process_fd_count_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_linux_process_fd_count_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_process_fd_count_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_process_fd_count_t *msg); +SBP_EXPORT s8 sbp_msg_linux_process_fd_count_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_process_fd_count_t *msg); /** - * Decode an instance of sbp_msg_linux_process_fd_count_t from wire representation + * Decode an instance of sbp_msg_linux_process_fd_count_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_linux_process_fd_count_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_linux_process_fd_count_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_linux_process_fd_count_t instance + * @param buf Wire representation of the sbp_msg_linux_process_fd_count_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_process_fd_count_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_process_fd_count_t *msg); +SBP_EXPORT s8 sbp_msg_linux_process_fd_count_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_process_fd_count_t *msg); /** - * Send an instance of sbp_msg_linux_process_fd_count_t with the given write function + * Send an instance of sbp_msg_linux_process_fd_count_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_linux_process_fd_count_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_linux_process_fd_count_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -291,51 +331,62 @@ SBP_EXPORT s8 sbp_msg_linux_process_fd_count_decode(const uint8_t *buf, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_process_fd_count_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_process_fd_count_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_linux_process_fd_count_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_linux_process_fd_count_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_linux_process_fd_count_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_linux_process_fd_count_t instance * @param b sbp_msg_linux_process_fd_count_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_linux_process_fd_count_cmp(const sbp_msg_linux_process_fd_count_t *a, const sbp_msg_linux_process_fd_count_t *b); +SBP_EXPORT int sbp_msg_linux_process_fd_count_cmp( + const sbp_msg_linux_process_fd_count_t *a, + const sbp_msg_linux_process_fd_count_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_linux_process_fd_count_t &lhs, const sbp_msg_linux_process_fd_count_t &rhs) { +static inline bool operator==(const sbp_msg_linux_process_fd_count_t &lhs, + const sbp_msg_linux_process_fd_count_t &rhs) { return sbp_msg_linux_process_fd_count_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_linux_process_fd_count_t &lhs, const sbp_msg_linux_process_fd_count_t &rhs) { +static inline bool operator!=(const sbp_msg_linux_process_fd_count_t &lhs, + const sbp_msg_linux_process_fd_count_t &rhs) { return sbp_msg_linux_process_fd_count_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_linux_process_fd_count_t &lhs, const sbp_msg_linux_process_fd_count_t &rhs) { +static inline bool operator<(const sbp_msg_linux_process_fd_count_t &lhs, + const sbp_msg_linux_process_fd_count_t &rhs) { return sbp_msg_linux_process_fd_count_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_linux_process_fd_count_t &lhs, const sbp_msg_linux_process_fd_count_t &rhs) { +static inline bool operator<=(const sbp_msg_linux_process_fd_count_t &lhs, + const sbp_msg_linux_process_fd_count_t &rhs) { return sbp_msg_linux_process_fd_count_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_linux_process_fd_count_t &lhs, const sbp_msg_linux_process_fd_count_t &rhs) { +static inline bool operator>(const sbp_msg_linux_process_fd_count_t &lhs, + const sbp_msg_linux_process_fd_count_t &rhs) { return sbp_msg_linux_process_fd_count_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_linux_process_fd_count_t &lhs, const sbp_msg_linux_process_fd_count_t &rhs) { +static inline bool operator>=(const sbp_msg_linux_process_fd_count_t &lhs, + const sbp_msg_linux_process_fd_count_t &rhs) { return sbp_msg_linux_process_fd_count_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_LINUX_MSG_LINUX_PROCESS_FD_COUNT_H */ - diff --git a/c/include/libsbp/linux/MSG_LINUX_PROCESS_FD_SUMMARY.h b/c/include/libsbp/linux/MSG_LINUX_PROCESS_FD_SUMMARY.h index 8676d47e1..b5c642261 100644 --- a/c/include/libsbp/linux/MSG_LINUX_PROCESS_FD_SUMMARY.h +++ b/c/include/libsbp/linux/MSG_LINUX_PROCESS_FD_SUMMARY.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_LINUX_MSG_LINUX_PROCESS_FD_SUMMARY_H #define LIBSBP_LINUX_MSG_LINUX_PROCESS_FD_SUMMARY_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,178 +40,231 @@ *****************************************************************************/ /** Summary of open file descriptors on the system * -* Summary of open file descriptors on the system. + * Summary of open file descriptors on the system. */ typedef struct { - - /** -* count of total FDs open on the system + * count of total FDs open on the system */ u32 sys_fd_count; - /** - * A null delimited list of strings which alternates between a string representation of the process count and the file name whose count it being reported. That is, in C string syntax "32\0/var/log/syslog\012\0/tmp/foo\0" with the end of the list being 2 NULL terminators in a row. + * A null delimited list of strings which alternates between a string + * representation of the process count and the file name whose count it being + * reported. That is, in C string syntax + * "32\0/var/log/syslog\012\0/tmp/foo\0" with the end of the list being 2 NULL + * terminators in a row. */ sbp_string_t most_opened; } sbp_msg_linux_process_fd_summary_t; +/** + * Initialise sbp_msg_linux_process_fd_summary_t::most_opened to empty + * + * @param msg sbp_msg_linux_process_fd_summary_t instance + */ +SBP_EXPORT void sbp_msg_linux_process_fd_summary_most_opened_init( + sbp_msg_linux_process_fd_summary_t *msg); - /** - * Initialise sbp_msg_linux_process_fd_summary_t::most_opened to empty - * - * @param msg sbp_msg_linux_process_fd_summary_t instance - */ - SBP_EXPORT void sbp_msg_linux_process_fd_summary_most_opened_init(sbp_msg_linux_process_fd_summary_t *msg); - - /** - * Test sbp_msg_linux_process_fd_summary_t::most_opened for validity - * - * @param msg sbp_msg_linux_process_fd_summary_t instance - * @return true is sbp_msg_linux_process_fd_summary_t::most_opened is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_fd_summary_most_opened_valid(const sbp_msg_linux_process_fd_summary_t *msg); +/** + * Test sbp_msg_linux_process_fd_summary_t::most_opened for validity + * + * @param msg sbp_msg_linux_process_fd_summary_t instance + * @return true is sbp_msg_linux_process_fd_summary_t::most_opened is valid for + * encoding purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_fd_summary_most_opened_valid( + const sbp_msg_linux_process_fd_summary_t *msg); - /** - * Tests 2 instances of sbp_msg_linux_process_fd_summary_t::most_opened for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_linux_process_fd_summary_t instance - * @param b sbp_msg_linux_process_fd_summary_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_linux_process_fd_summary_most_opened_strcmp(const sbp_msg_linux_process_fd_summary_t *a, const sbp_msg_linux_process_fd_summary_t *b); +/** + * Tests 2 instances of sbp_msg_linux_process_fd_summary_t::most_opened for + * equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_linux_process_fd_summary_t instance + * @param b sbp_msg_linux_process_fd_summary_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_linux_process_fd_summary_most_opened_strcmp( + const sbp_msg_linux_process_fd_summary_t *a, + const sbp_msg_linux_process_fd_summary_t *b); - /** - * Get the encoded size of sbp_msg_linux_process_fd_summary_t::most_opened - * - * @param msg sbp_msg_linux_process_fd_summary_t instance - * @return Size of sbp_msg_linux_process_fd_summary_t::most_opened in wire representation - */ - SBP_EXPORT size_t sbp_msg_linux_process_fd_summary_most_opened_encoded_len(const sbp_msg_linux_process_fd_summary_t *msg); +/** + * Get the encoded size of sbp_msg_linux_process_fd_summary_t::most_opened + * + * @param msg sbp_msg_linux_process_fd_summary_t instance + * @return Size of sbp_msg_linux_process_fd_summary_t::most_opened in wire + * representation + */ +SBP_EXPORT size_t sbp_msg_linux_process_fd_summary_most_opened_encoded_len( + const sbp_msg_linux_process_fd_summary_t *msg); - /** - * Query sbp_msg_linux_process_fd_summary_t::most_opened for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_linux_process_fd_summary_t::most_opened before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_linux_process_fd_summary_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_linux_process_fd_summary_most_opened_space_remaining(const sbp_msg_linux_process_fd_summary_t *msg); - /** - * Return the number of sections in sbp_msg_linux_process_fd_summary_t::most_opened - * - * @param msg sbp_msg_linux_process_fd_summary_t instance - * @return Number of sections in string - */ - SBP_EXPORT size_t sbp_msg_linux_process_fd_summary_most_opened_count_sections(const sbp_msg_linux_process_fd_summary_t *msg); +/** + * Query sbp_msg_linux_process_fd_summary_t::most_opened for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_linux_process_fd_summary_t::most_opened before it exceeds + * the maximum size of the field in wire representation + * + * @param msg sbp_msg_linux_process_fd_summary_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_linux_process_fd_summary_most_opened_space_remaining( + const sbp_msg_linux_process_fd_summary_t *msg); +/** + * Return the number of sections in + * sbp_msg_linux_process_fd_summary_t::most_opened + * + * @param msg sbp_msg_linux_process_fd_summary_t instance + * @return Number of sections in string + */ +SBP_EXPORT size_t sbp_msg_linux_process_fd_summary_most_opened_count_sections( + const sbp_msg_linux_process_fd_summary_t *msg); - /** - * Add a section to sbp_msg_linux_process_fd_summary_t::most_opened - * - * The specified string will be appended to the field as a new section. If the new section would end up overflowing the maximum encoded length of this field the string will not be changed and this function will return false - * - * @param msg sbp_msg_linux_process_fd_summary_t instance - * @param new_str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_fd_summary_most_opened_add_section(sbp_msg_linux_process_fd_summary_t *msg, const char *new_str); +/** + * Add a section to sbp_msg_linux_process_fd_summary_t::most_opened + * + * The specified string will be appended to the field as a new section. If the + * new section would end up overflowing the maximum encoded length of this field + * the string will not be changed and this function will return false + * + * @param msg sbp_msg_linux_process_fd_summary_t instance + * @param new_str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_fd_summary_most_opened_add_section( + sbp_msg_linux_process_fd_summary_t *msg, const char *new_str); - /** - * Add a section to sbp_msg_linux_process_fd_summary_t::most_opened with printf style formatting - * - * A new section will be added to the field according to the specified printf style format string and arguments. If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_linux_process_fd_summary_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_fd_summary_most_opened_add_section_printf(sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Add a section to sbp_msg_linux_process_fd_summary_t::most_opened with printf + * style formatting + * + * A new section will be added to the field according to the specified printf + * style format string and arguments. If the operation would end up overflowing + * the maximum size of this field in wire encoding the existing contents will be + * unmodified and this function will return false. + * + * @param msg sbp_msg_linux_process_fd_summary_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_fd_summary_most_opened_add_section_printf( + sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Add a section to sbp_msg_linux_process_fd_summary_t::most_opened with printf style formatting - * - * Identical to #sbp_msg_linux_process_fd_summary_most_opened_add_section_printf except it takes a va_list argument - * - * @param msg sbp_msg_linux_process_fd_summary_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_fd_summary_most_opened_add_section_vprintf(sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Add a section to sbp_msg_linux_process_fd_summary_t::most_opened with printf + * style formatting + * + * Identical to #sbp_msg_linux_process_fd_summary_most_opened_add_section_printf + * except it takes a va_list argument + * + * @param msg sbp_msg_linux_process_fd_summary_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool +sbp_msg_linux_process_fd_summary_most_opened_add_section_vprintf( + sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Append a string to the last section in sbp_msg_linux_process_fd_summary_t::most_opened - * - * If the field is currently empty this function will behave exactly like #sbp_msg_linux_process_fd_summary_most_opened_add_section - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_linux_process_fd_summary_t instance - * @param str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_fd_summary_most_opened_append(sbp_msg_linux_process_fd_summary_t *msg, const char *str); +/** + * Append a string to the last section in + * sbp_msg_linux_process_fd_summary_t::most_opened + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_linux_process_fd_summary_most_opened_add_section + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_linux_process_fd_summary_t instance + * @param str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_fd_summary_most_opened_append( + sbp_msg_linux_process_fd_summary_t *msg, const char *str); - /** - * Append a string to the last section in sbp_msg_linux_process_fd_summary_t::most_opened with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_linux_process_fd_summary_most_opened_add_section_printf - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_linux_process_fd_summary_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_fd_summary_most_opened_append_printf(sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Append a string to the last section in + * sbp_msg_linux_process_fd_summary_t::most_opened with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_linux_process_fd_summary_most_opened_add_section_printf + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_linux_process_fd_summary_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_fd_summary_most_opened_append_printf( + sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Append a string to the last section in sbp_msg_linux_process_fd_summary_t::most_opened with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_linux_process_fd_summary_most_opened_add_section_vprintf - * - * If the field already contains one or more sections the given string will be sppended on to the last section in the string. - * - * If the operation would end overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_linux_process_fd_summary_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_fd_summary_most_opened_append_vprintf(sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Append a string to the last section in + * sbp_msg_linux_process_fd_summary_t::most_opened with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_linux_process_fd_summary_most_opened_add_section_vprintf + * + * If the field already contains one or more sections the given string will be + * sppended on to the last section in the string. + * + * If the operation would end overflowing the maximum size of this field in wire + * encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_linux_process_fd_summary_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_fd_summary_most_opened_append_vprintf( + sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Obtain a section from sbp_msg_linux_process_fd_summary_t::most_opened - * - * Returns a pointer to the given subsection in the field. Sections are 0-indexed, the \p section parameters must be less than the value returned from #sbp_msg_linux_process_fd_summary_most_opened_count_sections. - * - * @param msg sbp_msg_linux_process_fd_summary_t instance - * @param section Section number - * @return Pointer to C string, NULL on error - */ - SBP_EXPORT const char *sbp_msg_linux_process_fd_summary_most_opened_get_section(const sbp_msg_linux_process_fd_summary_t *msg, size_t section); +/** + * Obtain a section from sbp_msg_linux_process_fd_summary_t::most_opened + * + * Returns a pointer to the given subsection in the field. Sections are + * 0-indexed, the \p section parameters must be less than the value returned + * from #sbp_msg_linux_process_fd_summary_most_opened_count_sections. + * + * @param msg sbp_msg_linux_process_fd_summary_t instance + * @param section Section number + * @return Pointer to C string, NULL on error + */ +SBP_EXPORT const char *sbp_msg_linux_process_fd_summary_most_opened_get_section( + const sbp_msg_linux_process_fd_summary_t *msg, size_t section); - /** - * Obtain the length of a section in sbp_msg_linux_process_fd_summary_t::most_opened - * - * The returned value does not include the NULL terminator. - * - * If the given section does not exist 0 is returned. - * - * @param msg sbp_msg_linux_process_fd_summary_t instance - * @param section Section number - * @return Length of section - */ - SBP_EXPORT size_t sbp_msg_linux_process_fd_summary_most_opened_section_strlen(const sbp_msg_linux_process_fd_summary_t *msg, size_t section); +/** + * Obtain the length of a section in + * sbp_msg_linux_process_fd_summary_t::most_opened + * + * The returned value does not include the NULL terminator. + * + * If the given section does not exist 0 is returned. + * + * @param msg sbp_msg_linux_process_fd_summary_t instance + * @param section Section number + * @return Length of section + */ +SBP_EXPORT size_t sbp_msg_linux_process_fd_summary_most_opened_section_strlen( + const sbp_msg_linux_process_fd_summary_t *msg, size_t section); /** * Get encoded size of an instance of sbp_msg_linux_process_fd_summary_t @@ -219,46 +272,66 @@ typedef struct { * @param msg sbp_msg_linux_process_fd_summary_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_linux_process_fd_summary_encoded_len(const sbp_msg_linux_process_fd_summary_t *msg) -{ - return SBP_MSG_LINUX_PROCESS_FD_SUMMARY_ENCODED_OVERHEAD - + sbp_msg_linux_process_fd_summary_most_opened_encoded_len(msg) - ; +static inline size_t sbp_msg_linux_process_fd_summary_encoded_len( + const sbp_msg_linux_process_fd_summary_t *msg) { + return SBP_MSG_LINUX_PROCESS_FD_SUMMARY_ENCODED_OVERHEAD + + sbp_msg_linux_process_fd_summary_most_opened_encoded_len(msg); } /** - * Encode an instance of sbp_msg_linux_process_fd_summary_t to wire representation + * Encode an instance of sbp_msg_linux_process_fd_summary_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_linux_process_fd_summary_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_process_fd_summary_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_process_fd_summary_t *msg); +SBP_EXPORT s8 sbp_msg_linux_process_fd_summary_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_process_fd_summary_t *msg); /** - * Decode an instance of sbp_msg_linux_process_fd_summary_t from wire representation + * Decode an instance of sbp_msg_linux_process_fd_summary_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_linux_process_fd_summary_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_linux_process_fd_summary_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_linux_process_fd_summary_t instance + * @param buf Wire representation of the sbp_msg_linux_process_fd_summary_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_process_fd_summary_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_process_fd_summary_t *msg); +SBP_EXPORT s8 sbp_msg_linux_process_fd_summary_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_process_fd_summary_t *msg); /** - * Send an instance of sbp_msg_linux_process_fd_summary_t with the given write function + * Send an instance of sbp_msg_linux_process_fd_summary_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_linux_process_fd_summary_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_linux_process_fd_summary_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -266,51 +339,62 @@ SBP_EXPORT s8 sbp_msg_linux_process_fd_summary_decode(const uint8_t *buf, uint8_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_process_fd_summary_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_process_fd_summary_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_linux_process_fd_summary_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_linux_process_fd_summary_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_linux_process_fd_summary_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_linux_process_fd_summary_t instance * @param b sbp_msg_linux_process_fd_summary_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_linux_process_fd_summary_cmp(const sbp_msg_linux_process_fd_summary_t *a, const sbp_msg_linux_process_fd_summary_t *b); +SBP_EXPORT int sbp_msg_linux_process_fd_summary_cmp( + const sbp_msg_linux_process_fd_summary_t *a, + const sbp_msg_linux_process_fd_summary_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_linux_process_fd_summary_t &lhs, const sbp_msg_linux_process_fd_summary_t &rhs) { +static inline bool operator==(const sbp_msg_linux_process_fd_summary_t &lhs, + const sbp_msg_linux_process_fd_summary_t &rhs) { return sbp_msg_linux_process_fd_summary_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_linux_process_fd_summary_t &lhs, const sbp_msg_linux_process_fd_summary_t &rhs) { +static inline bool operator!=(const sbp_msg_linux_process_fd_summary_t &lhs, + const sbp_msg_linux_process_fd_summary_t &rhs) { return sbp_msg_linux_process_fd_summary_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_linux_process_fd_summary_t &lhs, const sbp_msg_linux_process_fd_summary_t &rhs) { +static inline bool operator<(const sbp_msg_linux_process_fd_summary_t &lhs, + const sbp_msg_linux_process_fd_summary_t &rhs) { return sbp_msg_linux_process_fd_summary_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_linux_process_fd_summary_t &lhs, const sbp_msg_linux_process_fd_summary_t &rhs) { +static inline bool operator<=(const sbp_msg_linux_process_fd_summary_t &lhs, + const sbp_msg_linux_process_fd_summary_t &rhs) { return sbp_msg_linux_process_fd_summary_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_linux_process_fd_summary_t &lhs, const sbp_msg_linux_process_fd_summary_t &rhs) { +static inline bool operator>(const sbp_msg_linux_process_fd_summary_t &lhs, + const sbp_msg_linux_process_fd_summary_t &rhs) { return sbp_msg_linux_process_fd_summary_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_linux_process_fd_summary_t &lhs, const sbp_msg_linux_process_fd_summary_t &rhs) { +static inline bool operator>=(const sbp_msg_linux_process_fd_summary_t &lhs, + const sbp_msg_linux_process_fd_summary_t &rhs) { return sbp_msg_linux_process_fd_summary_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_LINUX_MSG_LINUX_PROCESS_FD_SUMMARY_H */ - diff --git a/c/include/libsbp/linux/MSG_LINUX_PROCESS_SOCKET_COUNTS.h b/c/include/libsbp/linux/MSG_LINUX_PROCESS_SOCKET_COUNTS.h index 6672a578a..c6b1020f1 100644 --- a/c/include/libsbp/linux/MSG_LINUX_PROCESS_SOCKET_COUNTS.h +++ b/c/include/libsbp/linux/MSG_LINUX_PROCESS_SOCKET_COUNTS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_LINUX_MSG_LINUX_PROCESS_SOCKET_COUNTS_H #define LIBSBP_LINUX_MSG_LINUX_PROCESS_SOCKET_COUNTS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,215 +40,243 @@ *****************************************************************************/ /** A list of processes with high socket counts * -* Top 10 list of processes with high socket counts. + * Top 10 list of processes with high socket counts. */ typedef struct { - - /** -* sequence of this status message, values from 0-9 + * sequence of this status message, values from 0-9 */ u8 index; - /** -* the PID of the process in question + * the PID of the process in question */ u16 pid; - /** -* the number of sockets the process is using + * the number of sockets the process is using */ u16 socket_count; - /** - * A bitfield indicating the socket types used: 0x1 (tcp), 0x2 (udp), 0x4 (unix stream), 0x8 (unix dgram), 0x10 (netlink), and 0x8000 (unknown) + * A bitfield indicating the socket types used: 0x1 (tcp), 0x2 (udp), 0x4 + * (unix stream), 0x8 (unix dgram), 0x10 (netlink), and 0x8000 (unknown) */ u16 socket_types; - /** - * A bitfield indicating the socket states: 0x1 (established), 0x2 (syn-sent), 0x4 (syn-recv), 0x8 (fin-wait-1), 0x10 (fin-wait-2), 0x20 (time-wait), 0x40 (closed), 0x80 (close-wait), 0x100 (last-ack), 0x200 (listen), 0x400 (closing), 0x800 (unconnected), and 0x8000 (unknown) + * A bitfield indicating the socket states: 0x1 (established), 0x2 (syn-sent), + * 0x4 (syn-recv), 0x8 (fin-wait-1), 0x10 (fin-wait-2), 0x20 (time-wait), 0x40 + * (closed), 0x80 (close-wait), 0x100 (last-ack), 0x200 (listen), 0x400 + * (closing), 0x800 (unconnected), and 0x8000 (unknown) */ u16 socket_states; - /** -* the command line of the process in question + * the command line of the process in question */ sbp_string_t cmdline; } sbp_msg_linux_process_socket_counts_t; +/** + * Initialise sbp_msg_linux_process_socket_counts_t::cmdline to empty + * + * @param msg sbp_msg_linux_process_socket_counts_t instance + */ +SBP_EXPORT void sbp_msg_linux_process_socket_counts_cmdline_init( + sbp_msg_linux_process_socket_counts_t *msg); - /** - * Initialise sbp_msg_linux_process_socket_counts_t::cmdline to empty - * - * @param msg sbp_msg_linux_process_socket_counts_t instance - */ - SBP_EXPORT void sbp_msg_linux_process_socket_counts_cmdline_init(sbp_msg_linux_process_socket_counts_t *msg); - - /** - * Test sbp_msg_linux_process_socket_counts_t::cmdline for validity - * - * @param msg sbp_msg_linux_process_socket_counts_t instance - * @return true is sbp_msg_linux_process_socket_counts_t::cmdline is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_socket_counts_cmdline_valid(const sbp_msg_linux_process_socket_counts_t *msg); +/** + * Test sbp_msg_linux_process_socket_counts_t::cmdline for validity + * + * @param msg sbp_msg_linux_process_socket_counts_t instance + * @return true is sbp_msg_linux_process_socket_counts_t::cmdline is valid for + * encoding purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_socket_counts_cmdline_valid( + const sbp_msg_linux_process_socket_counts_t *msg); - /** - * Tests 2 instances of sbp_msg_linux_process_socket_counts_t::cmdline for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_linux_process_socket_counts_t instance - * @param b sbp_msg_linux_process_socket_counts_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_linux_process_socket_counts_cmdline_strcmp(const sbp_msg_linux_process_socket_counts_t *a, const sbp_msg_linux_process_socket_counts_t *b); +/** + * Tests 2 instances of sbp_msg_linux_process_socket_counts_t::cmdline for + * equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_linux_process_socket_counts_t instance + * @param b sbp_msg_linux_process_socket_counts_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_linux_process_socket_counts_cmdline_strcmp( + const sbp_msg_linux_process_socket_counts_t *a, + const sbp_msg_linux_process_socket_counts_t *b); - /** - * Get the encoded size of sbp_msg_linux_process_socket_counts_t::cmdline - * - * @param msg sbp_msg_linux_process_socket_counts_t instance - * @return Size of sbp_msg_linux_process_socket_counts_t::cmdline in wire representation - */ - SBP_EXPORT size_t sbp_msg_linux_process_socket_counts_cmdline_encoded_len(const sbp_msg_linux_process_socket_counts_t *msg); +/** + * Get the encoded size of sbp_msg_linux_process_socket_counts_t::cmdline + * + * @param msg sbp_msg_linux_process_socket_counts_t instance + * @return Size of sbp_msg_linux_process_socket_counts_t::cmdline in wire + * representation + */ +SBP_EXPORT size_t sbp_msg_linux_process_socket_counts_cmdline_encoded_len( + const sbp_msg_linux_process_socket_counts_t *msg); - /** - * Query sbp_msg_linux_process_socket_counts_t::cmdline for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_linux_process_socket_counts_t::cmdline before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_linux_process_socket_counts_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_linux_process_socket_counts_cmdline_space_remaining(const sbp_msg_linux_process_socket_counts_t *msg); - /** - * Set sbp_msg_linux_process_socket_counts_t::cmdline - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_linux_process_socket_counts_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_socket_counts_cmdline_set(sbp_msg_linux_process_socket_counts_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_linux_process_socket_counts_t::cmdline for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_linux_process_socket_counts_t::cmdline before it exceeds the + * maximum size of the field in wire representation + * + * @param msg sbp_msg_linux_process_socket_counts_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_linux_process_socket_counts_cmdline_space_remaining( + const sbp_msg_linux_process_socket_counts_t *msg); +/** + * Set sbp_msg_linux_process_socket_counts_t::cmdline + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_linux_process_socket_counts_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_socket_counts_cmdline_set( + sbp_msg_linux_process_socket_counts_t *msg, const char *new_str, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_linux_process_socket_counts_t::cmdline from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_linux_process_socket_counts_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_socket_counts_cmdline_set_raw(sbp_msg_linux_process_socket_counts_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_linux_process_socket_counts_t::cmdline from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_linux_process_socket_counts_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_socket_counts_cmdline_set_raw( + sbp_msg_linux_process_socket_counts_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_linux_process_socket_counts_t::cmdline with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_linux_process_socket_counts_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_socket_counts_cmdline_printf(sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_linux_process_socket_counts_t::cmdline with printf style + * formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_linux_process_socket_counts_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_socket_counts_cmdline_printf( + sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_linux_process_socket_counts_t::cmdline with printf style formatting - * - * Identical to #sbp_msg_linux_process_socket_counts_cmdline_printf except it takes a va_list argument - * - * @param msg sbp_msg_linux_process_socket_counts_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_socket_counts_cmdline_vprintf(sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_linux_process_socket_counts_t::cmdline with printf style + * formatting + * + * Identical to #sbp_msg_linux_process_socket_counts_cmdline_printf except it + * takes a va_list argument + * + * @param msg sbp_msg_linux_process_socket_counts_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_socket_counts_cmdline_vprintf( + sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_linux_process_socket_counts_t::cmdline with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_linux_process_socket_counts_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_socket_counts_cmdline_append_printf(sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_linux_process_socket_counts_t::cmdline with printf style + * formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_linux_process_socket_counts_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_socket_counts_cmdline_append_printf( + sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_linux_process_socket_counts_t::cmdline with printf style formatting - * - * Identical to #sbp_msg_linux_process_socket_counts_cmdline_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_linux_process_socket_counts_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_socket_counts_cmdline_append_vprintf(sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_linux_process_socket_counts_t::cmdline with printf style + * formatting + * + * Identical to #sbp_msg_linux_process_socket_counts_cmdline_append_printf + * except it takes a va_list argument + * + * @param msg sbp_msg_linux_process_socket_counts_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_socket_counts_cmdline_append_vprintf( + sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_linux_process_socket_counts_t::cmdline - * - * @param msg sbp_msg_linux_process_socket_counts_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_linux_process_socket_counts_cmdline_get(const sbp_msg_linux_process_socket_counts_t *msg); +/** + * Obtain the string value from sbp_msg_linux_process_socket_counts_t::cmdline + * + * @param msg sbp_msg_linux_process_socket_counts_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_linux_process_socket_counts_cmdline_get( + const sbp_msg_linux_process_socket_counts_t *msg); - /** - * Obtain the length of sbp_msg_linux_process_socket_counts_t::cmdline - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_linux_process_socket_counts_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_linux_process_socket_counts_cmdline_strlen(const sbp_msg_linux_process_socket_counts_t *msg); +/** + * Obtain the length of sbp_msg_linux_process_socket_counts_t::cmdline + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_linux_process_socket_counts_t instance + * @return Length of string + */ +SBP_EXPORT size_t sbp_msg_linux_process_socket_counts_cmdline_strlen( + const sbp_msg_linux_process_socket_counts_t *msg); /** * Get encoded size of an instance of sbp_msg_linux_process_socket_counts_t @@ -256,46 +284,67 @@ typedef struct { * @param msg sbp_msg_linux_process_socket_counts_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_linux_process_socket_counts_encoded_len(const sbp_msg_linux_process_socket_counts_t *msg) -{ - return SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_ENCODED_OVERHEAD - + sbp_msg_linux_process_socket_counts_cmdline_encoded_len(msg) - ; +static inline size_t sbp_msg_linux_process_socket_counts_encoded_len( + const sbp_msg_linux_process_socket_counts_t *msg) { + return SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_ENCODED_OVERHEAD + + sbp_msg_linux_process_socket_counts_cmdline_encoded_len(msg); } /** - * Encode an instance of sbp_msg_linux_process_socket_counts_t to wire representation + * Encode an instance of sbp_msg_linux_process_socket_counts_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_linux_process_socket_counts_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_process_socket_counts_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_process_socket_counts_t *msg); +SBP_EXPORT s8 sbp_msg_linux_process_socket_counts_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_process_socket_counts_t *msg); /** - * Decode an instance of sbp_msg_linux_process_socket_counts_t from wire representation + * Decode an instance of sbp_msg_linux_process_socket_counts_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_linux_process_socket_counts_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_linux_process_socket_counts_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_linux_process_socket_counts_t instance + * @param buf Wire representation of the sbp_msg_linux_process_socket_counts_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_process_socket_counts_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_process_socket_counts_t *msg); +SBP_EXPORT s8 sbp_msg_linux_process_socket_counts_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_process_socket_counts_t *msg); /** - * Send an instance of sbp_msg_linux_process_socket_counts_t with the given write function + * Send an instance of sbp_msg_linux_process_socket_counts_t with the given + * write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_linux_process_socket_counts_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_linux_process_socket_counts_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -303,51 +352,66 @@ SBP_EXPORT s8 sbp_msg_linux_process_socket_counts_decode(const uint8_t *buf, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_process_socket_counts_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_process_socket_counts_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_linux_process_socket_counts_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_linux_process_socket_counts_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_linux_process_socket_counts_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_linux_process_socket_counts_t instance * @param b sbp_msg_linux_process_socket_counts_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_linux_process_socket_counts_cmp(const sbp_msg_linux_process_socket_counts_t *a, const sbp_msg_linux_process_socket_counts_t *b); +SBP_EXPORT int sbp_msg_linux_process_socket_counts_cmp( + const sbp_msg_linux_process_socket_counts_t *a, + const sbp_msg_linux_process_socket_counts_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_linux_process_socket_counts_t &lhs, const sbp_msg_linux_process_socket_counts_t &rhs) { +static inline bool operator==( + const sbp_msg_linux_process_socket_counts_t &lhs, + const sbp_msg_linux_process_socket_counts_t &rhs) { return sbp_msg_linux_process_socket_counts_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_linux_process_socket_counts_t &lhs, const sbp_msg_linux_process_socket_counts_t &rhs) { +static inline bool operator!=( + const sbp_msg_linux_process_socket_counts_t &lhs, + const sbp_msg_linux_process_socket_counts_t &rhs) { return sbp_msg_linux_process_socket_counts_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_linux_process_socket_counts_t &lhs, const sbp_msg_linux_process_socket_counts_t &rhs) { +static inline bool operator<(const sbp_msg_linux_process_socket_counts_t &lhs, + const sbp_msg_linux_process_socket_counts_t &rhs) { return sbp_msg_linux_process_socket_counts_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_linux_process_socket_counts_t &lhs, const sbp_msg_linux_process_socket_counts_t &rhs) { +static inline bool operator<=( + const sbp_msg_linux_process_socket_counts_t &lhs, + const sbp_msg_linux_process_socket_counts_t &rhs) { return sbp_msg_linux_process_socket_counts_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_linux_process_socket_counts_t &lhs, const sbp_msg_linux_process_socket_counts_t &rhs) { +static inline bool operator>(const sbp_msg_linux_process_socket_counts_t &lhs, + const sbp_msg_linux_process_socket_counts_t &rhs) { return sbp_msg_linux_process_socket_counts_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_linux_process_socket_counts_t &lhs, const sbp_msg_linux_process_socket_counts_t &rhs) { +static inline bool operator>=( + const sbp_msg_linux_process_socket_counts_t &lhs, + const sbp_msg_linux_process_socket_counts_t &rhs) { return sbp_msg_linux_process_socket_counts_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_LINUX_MSG_LINUX_PROCESS_SOCKET_COUNTS_H */ - diff --git a/c/include/libsbp/linux/MSG_LINUX_PROCESS_SOCKET_QUEUES.h b/c/include/libsbp/linux/MSG_LINUX_PROCESS_SOCKET_QUEUES.h index ed0bf4327..8d1e10991 100644 --- a/c/include/libsbp/linux/MSG_LINUX_PROCESS_SOCKET_QUEUES.h +++ b/c/include/libsbp/linux/MSG_LINUX_PROCESS_SOCKET_QUEUES.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_LINUX_MSG_LINUX_PROCESS_SOCKET_QUEUES_H #define LIBSBP_LINUX_MSG_LINUX_PROCESS_SOCKET_QUEUES_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,227 +40,255 @@ *****************************************************************************/ /** A list of processes with deep socket queues * -* Top 10 list of sockets with deep queues. + * Top 10 list of sockets with deep queues. */ typedef struct { - - /** -* sequence of this status message, values from 0-9 + * sequence of this status message, values from 0-9 */ u8 index; - /** -* the PID of the process in question + * the PID of the process in question */ u16 pid; - /** -* the total amount of receive data queued for this process + * the total amount of receive data queued for this process */ u16 recv_queued; - /** -* the total amount of send data queued for this process + * the total amount of send data queued for this process */ u16 send_queued; - /** - * A bitfield indicating the socket types used: 0x1 (tcp), 0x2 (udp), 0x4 (unix stream), 0x8 (unix dgram), 0x10 (netlink), and 0x8000 (unknown) + * A bitfield indicating the socket types used: 0x1 (tcp), 0x2 (udp), 0x4 + * (unix stream), 0x8 (unix dgram), 0x10 (netlink), and 0x8000 (unknown) */ u16 socket_types; - /** - * A bitfield indicating the socket states: 0x1 (established), 0x2 (syn-sent), 0x4 (syn-recv), 0x8 (fin-wait-1), 0x10 (fin-wait-2), 0x20 (time-wait), 0x40 (closed), 0x80 (close-wait), 0x100 (last-ack), 0x200 (listen), 0x400 (closing), 0x800 (unconnected), and 0x8000 (unknown) + * A bitfield indicating the socket states: 0x1 (established), 0x2 (syn-sent), + * 0x4 (syn-recv), 0x8 (fin-wait-1), 0x10 (fin-wait-2), 0x20 (time-wait), 0x40 + * (closed), 0x80 (close-wait), 0x100 (last-ack), 0x200 (listen), 0x400 + * (closing), 0x800 (unconnected), and 0x8000 (unknown) */ u16 socket_states; - /** - * Address of the largest queue, remote or local depending on the directionality of the connection. + * Address of the largest queue, remote or local depending on the + * directionality of the connection. */ - char address_of_largest[SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_ADDRESS_OF_LARGEST_MAX]; + char address_of_largest + [SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_ADDRESS_OF_LARGEST_MAX]; - /** -* the command line of the process in question + * the command line of the process in question */ sbp_string_t cmdline; } sbp_msg_linux_process_socket_queues_t; +/** + * Initialise sbp_msg_linux_process_socket_queues_t::cmdline to empty + * + * @param msg sbp_msg_linux_process_socket_queues_t instance + */ +SBP_EXPORT void sbp_msg_linux_process_socket_queues_cmdline_init( + sbp_msg_linux_process_socket_queues_t *msg); - /** - * Initialise sbp_msg_linux_process_socket_queues_t::cmdline to empty - * - * @param msg sbp_msg_linux_process_socket_queues_t instance - */ - SBP_EXPORT void sbp_msg_linux_process_socket_queues_cmdline_init(sbp_msg_linux_process_socket_queues_t *msg); - - /** - * Test sbp_msg_linux_process_socket_queues_t::cmdline for validity - * - * @param msg sbp_msg_linux_process_socket_queues_t instance - * @return true is sbp_msg_linux_process_socket_queues_t::cmdline is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_socket_queues_cmdline_valid(const sbp_msg_linux_process_socket_queues_t *msg); +/** + * Test sbp_msg_linux_process_socket_queues_t::cmdline for validity + * + * @param msg sbp_msg_linux_process_socket_queues_t instance + * @return true is sbp_msg_linux_process_socket_queues_t::cmdline is valid for + * encoding purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_socket_queues_cmdline_valid( + const sbp_msg_linux_process_socket_queues_t *msg); - /** - * Tests 2 instances of sbp_msg_linux_process_socket_queues_t::cmdline for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_linux_process_socket_queues_t instance - * @param b sbp_msg_linux_process_socket_queues_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_linux_process_socket_queues_cmdline_strcmp(const sbp_msg_linux_process_socket_queues_t *a, const sbp_msg_linux_process_socket_queues_t *b); +/** + * Tests 2 instances of sbp_msg_linux_process_socket_queues_t::cmdline for + * equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_linux_process_socket_queues_t instance + * @param b sbp_msg_linux_process_socket_queues_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_linux_process_socket_queues_cmdline_strcmp( + const sbp_msg_linux_process_socket_queues_t *a, + const sbp_msg_linux_process_socket_queues_t *b); - /** - * Get the encoded size of sbp_msg_linux_process_socket_queues_t::cmdline - * - * @param msg sbp_msg_linux_process_socket_queues_t instance - * @return Size of sbp_msg_linux_process_socket_queues_t::cmdline in wire representation - */ - SBP_EXPORT size_t sbp_msg_linux_process_socket_queues_cmdline_encoded_len(const sbp_msg_linux_process_socket_queues_t *msg); +/** + * Get the encoded size of sbp_msg_linux_process_socket_queues_t::cmdline + * + * @param msg sbp_msg_linux_process_socket_queues_t instance + * @return Size of sbp_msg_linux_process_socket_queues_t::cmdline in wire + * representation + */ +SBP_EXPORT size_t sbp_msg_linux_process_socket_queues_cmdline_encoded_len( + const sbp_msg_linux_process_socket_queues_t *msg); - /** - * Query sbp_msg_linux_process_socket_queues_t::cmdline for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_linux_process_socket_queues_t::cmdline before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_linux_process_socket_queues_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_linux_process_socket_queues_cmdline_space_remaining(const sbp_msg_linux_process_socket_queues_t *msg); - /** - * Set sbp_msg_linux_process_socket_queues_t::cmdline - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_linux_process_socket_queues_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_socket_queues_cmdline_set(sbp_msg_linux_process_socket_queues_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_linux_process_socket_queues_t::cmdline for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_linux_process_socket_queues_t::cmdline before it exceeds the + * maximum size of the field in wire representation + * + * @param msg sbp_msg_linux_process_socket_queues_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_linux_process_socket_queues_cmdline_space_remaining( + const sbp_msg_linux_process_socket_queues_t *msg); +/** + * Set sbp_msg_linux_process_socket_queues_t::cmdline + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_linux_process_socket_queues_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_socket_queues_cmdline_set( + sbp_msg_linux_process_socket_queues_t *msg, const char *new_str, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_linux_process_socket_queues_t::cmdline from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_linux_process_socket_queues_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_socket_queues_cmdline_set_raw(sbp_msg_linux_process_socket_queues_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_linux_process_socket_queues_t::cmdline from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_linux_process_socket_queues_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_socket_queues_cmdline_set_raw( + sbp_msg_linux_process_socket_queues_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_linux_process_socket_queues_t::cmdline with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_linux_process_socket_queues_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_socket_queues_cmdline_printf(sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_linux_process_socket_queues_t::cmdline with printf style + * formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_linux_process_socket_queues_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_socket_queues_cmdline_printf( + sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_linux_process_socket_queues_t::cmdline with printf style formatting - * - * Identical to #sbp_msg_linux_process_socket_queues_cmdline_printf except it takes a va_list argument - * - * @param msg sbp_msg_linux_process_socket_queues_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_socket_queues_cmdline_vprintf(sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_linux_process_socket_queues_t::cmdline with printf style + * formatting + * + * Identical to #sbp_msg_linux_process_socket_queues_cmdline_printf except it + * takes a va_list argument + * + * @param msg sbp_msg_linux_process_socket_queues_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_socket_queues_cmdline_vprintf( + sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_linux_process_socket_queues_t::cmdline with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_linux_process_socket_queues_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_socket_queues_cmdline_append_printf(sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_linux_process_socket_queues_t::cmdline with printf style + * formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_linux_process_socket_queues_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_socket_queues_cmdline_append_printf( + sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_linux_process_socket_queues_t::cmdline with printf style formatting - * - * Identical to #sbp_msg_linux_process_socket_queues_cmdline_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_linux_process_socket_queues_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_linux_process_socket_queues_cmdline_append_vprintf(sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_linux_process_socket_queues_t::cmdline with printf style + * formatting + * + * Identical to #sbp_msg_linux_process_socket_queues_cmdline_append_printf + * except it takes a va_list argument + * + * @param msg sbp_msg_linux_process_socket_queues_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_linux_process_socket_queues_cmdline_append_vprintf( + sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_linux_process_socket_queues_t::cmdline - * - * @param msg sbp_msg_linux_process_socket_queues_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_linux_process_socket_queues_cmdline_get(const sbp_msg_linux_process_socket_queues_t *msg); +/** + * Obtain the string value from sbp_msg_linux_process_socket_queues_t::cmdline + * + * @param msg sbp_msg_linux_process_socket_queues_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_linux_process_socket_queues_cmdline_get( + const sbp_msg_linux_process_socket_queues_t *msg); - /** - * Obtain the length of sbp_msg_linux_process_socket_queues_t::cmdline - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_linux_process_socket_queues_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_linux_process_socket_queues_cmdline_strlen(const sbp_msg_linux_process_socket_queues_t *msg); +/** + * Obtain the length of sbp_msg_linux_process_socket_queues_t::cmdline + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_linux_process_socket_queues_t instance + * @return Length of string + */ +SBP_EXPORT size_t sbp_msg_linux_process_socket_queues_cmdline_strlen( + const sbp_msg_linux_process_socket_queues_t *msg); /** * Get encoded size of an instance of sbp_msg_linux_process_socket_queues_t @@ -268,46 +296,67 @@ typedef struct { * @param msg sbp_msg_linux_process_socket_queues_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_linux_process_socket_queues_encoded_len(const sbp_msg_linux_process_socket_queues_t *msg) -{ - return SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_ENCODED_OVERHEAD - + sbp_msg_linux_process_socket_queues_cmdline_encoded_len(msg) - ; +static inline size_t sbp_msg_linux_process_socket_queues_encoded_len( + const sbp_msg_linux_process_socket_queues_t *msg) { + return SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_ENCODED_OVERHEAD + + sbp_msg_linux_process_socket_queues_cmdline_encoded_len(msg); } /** - * Encode an instance of sbp_msg_linux_process_socket_queues_t to wire representation + * Encode an instance of sbp_msg_linux_process_socket_queues_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_linux_process_socket_queues_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_process_socket_queues_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_process_socket_queues_t *msg); +SBP_EXPORT s8 sbp_msg_linux_process_socket_queues_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_process_socket_queues_t *msg); /** - * Decode an instance of sbp_msg_linux_process_socket_queues_t from wire representation + * Decode an instance of sbp_msg_linux_process_socket_queues_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_linux_process_socket_queues_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_linux_process_socket_queues_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_linux_process_socket_queues_t instance + * @param buf Wire representation of the sbp_msg_linux_process_socket_queues_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_process_socket_queues_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_process_socket_queues_t *msg); +SBP_EXPORT s8 sbp_msg_linux_process_socket_queues_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_process_socket_queues_t *msg); /** - * Send an instance of sbp_msg_linux_process_socket_queues_t with the given write function + * Send an instance of sbp_msg_linux_process_socket_queues_t with the given + * write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_linux_process_socket_queues_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_linux_process_socket_queues_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -315,51 +364,66 @@ SBP_EXPORT s8 sbp_msg_linux_process_socket_queues_decode(const uint8_t *buf, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_process_socket_queues_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_process_socket_queues_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_linux_process_socket_queues_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_linux_process_socket_queues_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_linux_process_socket_queues_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_linux_process_socket_queues_t instance * @param b sbp_msg_linux_process_socket_queues_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_linux_process_socket_queues_cmp(const sbp_msg_linux_process_socket_queues_t *a, const sbp_msg_linux_process_socket_queues_t *b); +SBP_EXPORT int sbp_msg_linux_process_socket_queues_cmp( + const sbp_msg_linux_process_socket_queues_t *a, + const sbp_msg_linux_process_socket_queues_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_linux_process_socket_queues_t &lhs, const sbp_msg_linux_process_socket_queues_t &rhs) { +static inline bool operator==( + const sbp_msg_linux_process_socket_queues_t &lhs, + const sbp_msg_linux_process_socket_queues_t &rhs) { return sbp_msg_linux_process_socket_queues_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_linux_process_socket_queues_t &lhs, const sbp_msg_linux_process_socket_queues_t &rhs) { +static inline bool operator!=( + const sbp_msg_linux_process_socket_queues_t &lhs, + const sbp_msg_linux_process_socket_queues_t &rhs) { return sbp_msg_linux_process_socket_queues_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_linux_process_socket_queues_t &lhs, const sbp_msg_linux_process_socket_queues_t &rhs) { +static inline bool operator<(const sbp_msg_linux_process_socket_queues_t &lhs, + const sbp_msg_linux_process_socket_queues_t &rhs) { return sbp_msg_linux_process_socket_queues_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_linux_process_socket_queues_t &lhs, const sbp_msg_linux_process_socket_queues_t &rhs) { +static inline bool operator<=( + const sbp_msg_linux_process_socket_queues_t &lhs, + const sbp_msg_linux_process_socket_queues_t &rhs) { return sbp_msg_linux_process_socket_queues_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_linux_process_socket_queues_t &lhs, const sbp_msg_linux_process_socket_queues_t &rhs) { +static inline bool operator>(const sbp_msg_linux_process_socket_queues_t &lhs, + const sbp_msg_linux_process_socket_queues_t &rhs) { return sbp_msg_linux_process_socket_queues_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_linux_process_socket_queues_t &lhs, const sbp_msg_linux_process_socket_queues_t &rhs) { +static inline bool operator>=( + const sbp_msg_linux_process_socket_queues_t &lhs, + const sbp_msg_linux_process_socket_queues_t &rhs) { return sbp_msg_linux_process_socket_queues_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_LINUX_MSG_LINUX_PROCESS_SOCKET_QUEUES_H */ - diff --git a/c/include/libsbp/linux/MSG_LINUX_SOCKET_USAGE.h b/c/include/libsbp/linux/MSG_LINUX_SOCKET_USAGE.h index 4ed514ecd..8ff3ed2d1 100644 --- a/c/include/libsbp/linux/MSG_LINUX_SOCKET_USAGE.h +++ b/c/include/libsbp/linux/MSG_LINUX_SOCKET_USAGE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_LINUX_MSG_LINUX_SOCKET_USAGE_H #define LIBSBP_LINUX_MSG_LINUX_SOCKET_USAGE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,45 +40,40 @@ *****************************************************************************/ /** Summary of socket usage across the system * -* Summaries the socket usage across the system. + * Summaries the socket usage across the system. */ typedef struct { - - /** -* average socket queue depths across all sockets on the system + * average socket queue depths across all sockets on the system */ u32 avg_queue_depth; - /** -* the max queue depth seen within the reporting period + * the max queue depth seen within the reporting period */ u32 max_queue_depth; - /** - * A count for each socket type reported in the `socket_types_reported` field, the first entry corresponds to the first enabled bit in `types_reported`. + * A count for each socket type reported in the `socket_types_reported` field, + * the first entry corresponds to the first enabled bit in `types_reported`. */ u16 socket_state_counts[SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_STATE_COUNTS_MAX]; - /** - * A count for each socket type reported in the `socket_types_reported` field, the first entry corresponds to the first enabled bit in `types_reported`. + * A count for each socket type reported in the `socket_types_reported` field, + * the first entry corresponds to the first enabled bit in `types_reported`. */ u16 socket_type_counts[SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_TYPE_COUNTS_MAX]; } sbp_msg_linux_socket_usage_t; - - /** * Get encoded size of an instance of sbp_msg_linux_socket_usage_t * * @param msg sbp_msg_linux_socket_usage_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_linux_socket_usage_encoded_len(const sbp_msg_linux_socket_usage_t *msg) -{ +static inline size_t sbp_msg_linux_socket_usage_encoded_len( + const sbp_msg_linux_socket_usage_t *msg) { (void)msg; return SBP_MSG_LINUX_SOCKET_USAGE_ENCODED_LEN; } @@ -86,36 +81,54 @@ static inline size_t sbp_msg_linux_socket_usage_encoded_len(const sbp_msg_linux_ /** * Encode an instance of sbp_msg_linux_socket_usage_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_linux_socket_usage_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_socket_usage_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_socket_usage_t *msg); +SBP_EXPORT s8 +sbp_msg_linux_socket_usage_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_socket_usage_t *msg); /** * Decode an instance of sbp_msg_linux_socket_usage_t from wire representation * - * This function decodes the wire representation of a sbp_msg_linux_socket_usage_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_linux_socket_usage_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_linux_socket_usage_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_socket_usage_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_socket_usage_t *msg); +SBP_EXPORT s8 sbp_msg_linux_socket_usage_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_socket_usage_t *msg); /** - * Send an instance of sbp_msg_linux_socket_usage_t with the given write function + * Send an instance of sbp_msg_linux_socket_usage_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_linux_socket_usage_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_linux_socket_usage_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -123,51 +136,62 @@ SBP_EXPORT s8 sbp_msg_linux_socket_usage_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_socket_usage_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_socket_usage_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_linux_socket_usage_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_linux_socket_usage_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_linux_socket_usage_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_linux_socket_usage_t instance * @param b sbp_msg_linux_socket_usage_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_linux_socket_usage_cmp(const sbp_msg_linux_socket_usage_t *a, const sbp_msg_linux_socket_usage_t *b); +SBP_EXPORT int sbp_msg_linux_socket_usage_cmp( + const sbp_msg_linux_socket_usage_t *a, + const sbp_msg_linux_socket_usage_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_linux_socket_usage_t &lhs, const sbp_msg_linux_socket_usage_t &rhs) { +static inline bool operator==(const sbp_msg_linux_socket_usage_t &lhs, + const sbp_msg_linux_socket_usage_t &rhs) { return sbp_msg_linux_socket_usage_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_linux_socket_usage_t &lhs, const sbp_msg_linux_socket_usage_t &rhs) { +static inline bool operator!=(const sbp_msg_linux_socket_usage_t &lhs, + const sbp_msg_linux_socket_usage_t &rhs) { return sbp_msg_linux_socket_usage_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_linux_socket_usage_t &lhs, const sbp_msg_linux_socket_usage_t &rhs) { +static inline bool operator<(const sbp_msg_linux_socket_usage_t &lhs, + const sbp_msg_linux_socket_usage_t &rhs) { return sbp_msg_linux_socket_usage_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_linux_socket_usage_t &lhs, const sbp_msg_linux_socket_usage_t &rhs) { +static inline bool operator<=(const sbp_msg_linux_socket_usage_t &lhs, + const sbp_msg_linux_socket_usage_t &rhs) { return sbp_msg_linux_socket_usage_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_linux_socket_usage_t &lhs, const sbp_msg_linux_socket_usage_t &rhs) { +static inline bool operator>(const sbp_msg_linux_socket_usage_t &lhs, + const sbp_msg_linux_socket_usage_t &rhs) { return sbp_msg_linux_socket_usage_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_linux_socket_usage_t &lhs, const sbp_msg_linux_socket_usage_t &rhs) { +static inline bool operator>=(const sbp_msg_linux_socket_usage_t &lhs, + const sbp_msg_linux_socket_usage_t &rhs) { return sbp_msg_linux_socket_usage_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_LINUX_MSG_LINUX_SOCKET_USAGE_H */ - diff --git a/c/include/libsbp/linux/MSG_LINUX_SYS_STATE.h b/c/include/libsbp/linux/MSG_LINUX_SYS_STATE.h index 94083d439..559e71a31 100644 --- a/c/include/libsbp/linux/MSG_LINUX_SYS_STATE.h +++ b/c/include/libsbp/linux/MSG_LINUX_SYS_STATE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_LINUX_MSG_LINUX_SYS_STATE_H #define LIBSBP_LINUX_MSG_LINUX_SYS_STATE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,69 +40,58 @@ *****************************************************************************/ /** CPU, Memory and Process Starts/Stops * -* This presents a summary of CPU and memory utilization, including a timestamp. + * This presents a summary of CPU and memory utilization, including a timestamp. */ typedef struct { - - /** -* total system memory, in MiB + * total system memory, in MiB */ u16 mem_total; - /** -* percent of CPU used, expressed as a fraction of 256 + * percent of CPU used, expressed as a fraction of 256 */ u8 pcpu; - /** -* percent of memory used, expressed as a fraction of 256 + * percent of memory used, expressed as a fraction of 256 */ u8 pmem; - /** -* number of processes that started during collection phase + * number of processes that started during collection phase */ u16 procs_starting; - /** -* number of processes that stopped during collection phase + * number of processes that stopped during collection phase */ u16 procs_stopping; - /** -* the count of processes on the system + * the count of processes on the system */ u16 pid_count; - /** -* timestamp of message, refer to flags field for how to interpret + * timestamp of message, refer to flags field for how to interpret */ u32 time; - /** -* flags + * flags */ u8 flags; } sbp_msg_linux_sys_state_t; - - /** * Get encoded size of an instance of sbp_msg_linux_sys_state_t * * @param msg sbp_msg_linux_sys_state_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_linux_sys_state_encoded_len(const sbp_msg_linux_sys_state_t *msg) -{ +static inline size_t sbp_msg_linux_sys_state_encoded_len( + const sbp_msg_linux_sys_state_t *msg) { (void)msg; return SBP_MSG_LINUX_SYS_STATE_ENCODED_LEN; } @@ -110,36 +99,53 @@ static inline size_t sbp_msg_linux_sys_state_encoded_len(const sbp_msg_linux_sys /** * Encode an instance of sbp_msg_linux_sys_state_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_linux_sys_state_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_sys_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_sys_state_t *msg); +SBP_EXPORT s8 +sbp_msg_linux_sys_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_sys_state_t *msg); /** * Decode an instance of sbp_msg_linux_sys_state_t from wire representation * - * This function decodes the wire representation of a sbp_msg_linux_sys_state_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_linux_sys_state_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_linux_sys_state_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_sys_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_sys_state_t *msg); +SBP_EXPORT s8 sbp_msg_linux_sys_state_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_linux_sys_state_t *msg); /** * Send an instance of sbp_msg_linux_sys_state_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_linux_sys_state_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_linux_sys_state_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -147,51 +153,61 @@ SBP_EXPORT s8 sbp_msg_linux_sys_state_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_sys_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_sys_state_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_linux_sys_state_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_linux_sys_state_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_linux_sys_state_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_linux_sys_state_t instance * @param b sbp_msg_linux_sys_state_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_linux_sys_state_cmp(const sbp_msg_linux_sys_state_t *a, const sbp_msg_linux_sys_state_t *b); +SBP_EXPORT int sbp_msg_linux_sys_state_cmp(const sbp_msg_linux_sys_state_t *a, + const sbp_msg_linux_sys_state_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_linux_sys_state_t &lhs, const sbp_msg_linux_sys_state_t &rhs) { +static inline bool operator==(const sbp_msg_linux_sys_state_t &lhs, + const sbp_msg_linux_sys_state_t &rhs) { return sbp_msg_linux_sys_state_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_linux_sys_state_t &lhs, const sbp_msg_linux_sys_state_t &rhs) { +static inline bool operator!=(const sbp_msg_linux_sys_state_t &lhs, + const sbp_msg_linux_sys_state_t &rhs) { return sbp_msg_linux_sys_state_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_linux_sys_state_t &lhs, const sbp_msg_linux_sys_state_t &rhs) { +static inline bool operator<(const sbp_msg_linux_sys_state_t &lhs, + const sbp_msg_linux_sys_state_t &rhs) { return sbp_msg_linux_sys_state_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_linux_sys_state_t &lhs, const sbp_msg_linux_sys_state_t &rhs) { +static inline bool operator<=(const sbp_msg_linux_sys_state_t &lhs, + const sbp_msg_linux_sys_state_t &rhs) { return sbp_msg_linux_sys_state_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_linux_sys_state_t &lhs, const sbp_msg_linux_sys_state_t &rhs) { +static inline bool operator>(const sbp_msg_linux_sys_state_t &lhs, + const sbp_msg_linux_sys_state_t &rhs) { return sbp_msg_linux_sys_state_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_linux_sys_state_t &lhs, const sbp_msg_linux_sys_state_t &rhs) { +static inline bool operator>=(const sbp_msg_linux_sys_state_t &lhs, + const sbp_msg_linux_sys_state_t &rhs) { return sbp_msg_linux_sys_state_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_LINUX_MSG_LINUX_SYS_STATE_H */ - diff --git a/c/include/libsbp/linux/MSG_LINUX_SYS_STATE_DEP_A.h b/c/include/libsbp/linux/MSG_LINUX_SYS_STATE_DEP_A.h index b537ff162..940dfcf79 100644 --- a/c/include/libsbp/linux/MSG_LINUX_SYS_STATE_DEP_A.h +++ b/c/include/libsbp/linux/MSG_LINUX_SYS_STATE_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_LINUX_MSG_LINUX_SYS_STATE_DEP_A_H #define LIBSBP_LINUX_MSG_LINUX_SYS_STATE_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,57 +40,48 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* total system memory + * total system memory */ u16 mem_total; - /** -* percent of total cpu currently utilized + * percent of total cpu currently utilized */ u8 pcpu; - /** -* percent of total memory currently utilized + * percent of total memory currently utilized */ u8 pmem; - /** -* number of processes that started during collection phase + * number of processes that started during collection phase */ u16 procs_starting; - /** -* number of processes that stopped during collection phase + * number of processes that stopped during collection phase */ u16 procs_stopping; - /** -* the count of processes on the system + * the count of processes on the system */ u16 pid_count; } sbp_msg_linux_sys_state_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_linux_sys_state_dep_a_t * * @param msg sbp_msg_linux_sys_state_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_linux_sys_state_dep_a_encoded_len(const sbp_msg_linux_sys_state_dep_a_t *msg) -{ +static inline size_t sbp_msg_linux_sys_state_dep_a_encoded_len( + const sbp_msg_linux_sys_state_dep_a_t *msg) { (void)msg; return SBP_MSG_LINUX_SYS_STATE_DEP_A_ENCODED_LEN; } @@ -98,36 +89,56 @@ static inline size_t sbp_msg_linux_sys_state_dep_a_encoded_len(const sbp_msg_lin /** * Encode an instance of sbp_msg_linux_sys_state_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_linux_sys_state_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_sys_state_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_sys_state_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_linux_sys_state_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_sys_state_dep_a_t *msg); /** - * Decode an instance of sbp_msg_linux_sys_state_dep_a_t from wire representation + * Decode an instance of sbp_msg_linux_sys_state_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_linux_sys_state_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_linux_sys_state_dep_a_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_linux_sys_state_dep_a_t instance + * @param buf Wire representation of the sbp_msg_linux_sys_state_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_sys_state_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_sys_state_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_linux_sys_state_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_sys_state_dep_a_t *msg); /** - * Send an instance of sbp_msg_linux_sys_state_dep_a_t with the given write function + * Send an instance of sbp_msg_linux_sys_state_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_linux_sys_state_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_linux_sys_state_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -135,51 +146,62 @@ SBP_EXPORT s8 sbp_msg_linux_sys_state_dep_a_decode(const uint8_t *buf, uint8_t l * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_linux_sys_state_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_sys_state_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_linux_sys_state_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_linux_sys_state_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_linux_sys_state_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_linux_sys_state_dep_a_t instance * @param b sbp_msg_linux_sys_state_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_linux_sys_state_dep_a_cmp(const sbp_msg_linux_sys_state_dep_a_t *a, const sbp_msg_linux_sys_state_dep_a_t *b); +SBP_EXPORT int sbp_msg_linux_sys_state_dep_a_cmp( + const sbp_msg_linux_sys_state_dep_a_t *a, + const sbp_msg_linux_sys_state_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_linux_sys_state_dep_a_t &lhs, const sbp_msg_linux_sys_state_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_linux_sys_state_dep_a_t &lhs, + const sbp_msg_linux_sys_state_dep_a_t &rhs) { return sbp_msg_linux_sys_state_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_linux_sys_state_dep_a_t &lhs, const sbp_msg_linux_sys_state_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_linux_sys_state_dep_a_t &lhs, + const sbp_msg_linux_sys_state_dep_a_t &rhs) { return sbp_msg_linux_sys_state_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_linux_sys_state_dep_a_t &lhs, const sbp_msg_linux_sys_state_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_linux_sys_state_dep_a_t &lhs, + const sbp_msg_linux_sys_state_dep_a_t &rhs) { return sbp_msg_linux_sys_state_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_linux_sys_state_dep_a_t &lhs, const sbp_msg_linux_sys_state_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_linux_sys_state_dep_a_t &lhs, + const sbp_msg_linux_sys_state_dep_a_t &rhs) { return sbp_msg_linux_sys_state_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_linux_sys_state_dep_a_t &lhs, const sbp_msg_linux_sys_state_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_linux_sys_state_dep_a_t &lhs, + const sbp_msg_linux_sys_state_dep_a_t &rhs) { return sbp_msg_linux_sys_state_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_linux_sys_state_dep_a_t &lhs, const sbp_msg_linux_sys_state_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_linux_sys_state_dep_a_t &lhs, + const sbp_msg_linux_sys_state_dep_a_t &rhs) { return sbp_msg_linux_sys_state_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_LINUX_MSG_LINUX_SYS_STATE_DEP_A_H */ - diff --git a/c/include/libsbp/linux_macros.h b/c/include/libsbp/linux_macros.h index a73867b7f..fd3308e64 100644 --- a/c/include/libsbp/linux_macros.h +++ b/c/include/libsbp/linux_macros.h @@ -18,295 +18,317 @@ #ifndef LIBSBP_LINUX_MACROS_H #define LIBSBP_LINUX_MACROS_H - #define SBP_MSG_LINUX_CPU_STATE_DEP_A 0x7F00 /** - * The maximum number of items that can be stored in sbp_msg_linux_cpu_state_dep_a_t::tname (V4 API) or msg_linux_cpu_state_dep_a_t::tname (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_linux_cpu_state_dep_a_t::tname (V4 API) or + * msg_linux_cpu_state_dep_a_t::tname (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_LINUX_CPU_STATE_DEP_A_TNAME_MAX 15u - /** - * The maximum number of items that can be stored in sbp_msg_linux_cpu_state_dep_a_t::cmdline (V4 API) or msg_linux_cpu_state_dep_a_t::cmdline (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_linux_cpu_state_dep_a_t::cmdline (V4 API) or + * msg_linux_cpu_state_dep_a_t::cmdline (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX 236u - /** - * Encoded length of sbp_msg_linux_cpu_state_dep_a_t (V4 API) and + * Encoded length of sbp_msg_linux_cpu_state_dep_a_t (V4 API) and * msg_linux_cpu_state_dep_a_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_linux_cpu_state_dep_a_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_linux_cpu_state_dep_a_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_LINUX_CPU_STATE_DEP_A_ENCODED_OVERHEAD 19u - #define SBP_MSG_LINUX_MEM_STATE_DEP_A 0x7F01 /** - * The maximum number of items that can be stored in sbp_msg_linux_mem_state_dep_a_t::tname (V4 API) or msg_linux_mem_state_dep_a_t::tname (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_linux_mem_state_dep_a_t::tname (V4 API) or + * msg_linux_mem_state_dep_a_t::tname (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_LINUX_MEM_STATE_DEP_A_TNAME_MAX 15u - /** - * The maximum number of items that can be stored in sbp_msg_linux_mem_state_dep_a_t::cmdline (V4 API) or msg_linux_mem_state_dep_a_t::cmdline (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_linux_mem_state_dep_a_t::cmdline (V4 API) or + * msg_linux_mem_state_dep_a_t::cmdline (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX 236u - /** - * Encoded length of sbp_msg_linux_mem_state_dep_a_t (V4 API) and + * Encoded length of sbp_msg_linux_mem_state_dep_a_t (V4 API) and * msg_linux_mem_state_dep_a_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_linux_mem_state_dep_a_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_linux_mem_state_dep_a_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_LINUX_MEM_STATE_DEP_A_ENCODED_OVERHEAD 19u - #define SBP_MSG_LINUX_SYS_STATE_DEP_A 0x7F02 /** - * Encoded length of sbp_msg_linux_sys_state_dep_a_t (V4 API) and + * Encoded length of sbp_msg_linux_sys_state_dep_a_t (V4 API) and * msg_linux_sys_state_dep_a_t (legacy API) */ #define SBP_MSG_LINUX_SYS_STATE_DEP_A_ENCODED_LEN 10u - #define SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS 0x7F03 /** - * The maximum number of items that can be stored in sbp_msg_linux_process_socket_counts_t::cmdline (V4 API) or msg_linux_process_socket_counts_t::cmdline (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_linux_process_socket_counts_t::cmdline (V4 API) or + * msg_linux_process_socket_counts_t::cmdline (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX 246u - /** - * Encoded length of sbp_msg_linux_process_socket_counts_t (V4 API) and + * Encoded length of sbp_msg_linux_process_socket_counts_t (V4 API) and * msg_linux_process_socket_counts_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_linux_process_socket_counts_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_linux_process_socket_counts_encoded_len to determine the actual size + * of an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_ENCODED_OVERHEAD 9u - #define SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES 0x7F04 /** - * The maximum number of items that can be stored in sbp_msg_linux_process_socket_queues_t::address_of_largest (V4 API) or msg_linux_process_socket_queues_t::address_of_largest (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_linux_process_socket_queues_t::address_of_largest (V4 API) or + * msg_linux_process_socket_queues_t::address_of_largest (legacy API) before the + * maximum SBP message size is exceeded */ #define SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_ADDRESS_OF_LARGEST_MAX 64u - /** - * The maximum number of items that can be stored in sbp_msg_linux_process_socket_queues_t::cmdline (V4 API) or msg_linux_process_socket_queues_t::cmdline (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_linux_process_socket_queues_t::cmdline (V4 API) or + * msg_linux_process_socket_queues_t::cmdline (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX 180u - /** - * Encoded length of sbp_msg_linux_process_socket_queues_t (V4 API) and + * Encoded length of sbp_msg_linux_process_socket_queues_t (V4 API) and * msg_linux_process_socket_queues_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_linux_process_socket_queues_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_linux_process_socket_queues_encoded_len to determine the actual size + * of an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_ENCODED_OVERHEAD 75u - #define SBP_MSG_LINUX_SOCKET_USAGE 0x7F05 /** - * The maximum number of items that can be stored in sbp_msg_linux_socket_usage_t::socket_state_counts (V4 API) or msg_linux_socket_usage_t::socket_state_counts (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_linux_socket_usage_t::socket_state_counts (V4 API) or + * msg_linux_socket_usage_t::socket_state_counts (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_STATE_COUNTS_MAX 16u - /** - * The maximum number of items that can be stored in sbp_msg_linux_socket_usage_t::socket_type_counts (V4 API) or msg_linux_socket_usage_t::socket_type_counts (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_linux_socket_usage_t::socket_type_counts (V4 API) or + * msg_linux_socket_usage_t::socket_type_counts (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_TYPE_COUNTS_MAX 16u - /** - * Encoded length of sbp_msg_linux_socket_usage_t (V4 API) and + * Encoded length of sbp_msg_linux_socket_usage_t (V4 API) and * msg_linux_socket_usage_t (legacy API) */ #define SBP_MSG_LINUX_SOCKET_USAGE_ENCODED_LEN 72u - #define SBP_MSG_LINUX_PROCESS_FD_COUNT 0x7F06 /** - * The maximum number of items that can be stored in sbp_msg_linux_process_fd_count_t::cmdline (V4 API) or msg_linux_process_fd_count_t::cmdline (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_linux_process_fd_count_t::cmdline (V4 API) or + * msg_linux_process_fd_count_t::cmdline (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX 250u - /** - * Encoded length of sbp_msg_linux_process_fd_count_t (V4 API) and + * Encoded length of sbp_msg_linux_process_fd_count_t (V4 API) and * msg_linux_process_fd_count_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_linux_process_fd_count_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_linux_process_fd_count_encoded_len to determine the actual size of + * an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_LINUX_PROCESS_FD_COUNT_ENCODED_OVERHEAD 5u - #define SBP_MSG_LINUX_PROCESS_FD_SUMMARY 0x7F07 /** - * The maximum number of items that can be stored in sbp_msg_linux_process_fd_summary_t::most_opened (V4 API) or msg_linux_process_fd_summary_t::most_opened (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_linux_process_fd_summary_t::most_opened (V4 API) or + * msg_linux_process_fd_summary_t::most_opened (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX 251u - /** - * Encoded length of sbp_msg_linux_process_fd_summary_t (V4 API) and + * Encoded length of sbp_msg_linux_process_fd_summary_t (V4 API) and * msg_linux_process_fd_summary_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_linux_process_fd_summary_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_linux_process_fd_summary_encoded_len to determine the actual size of + * an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_LINUX_PROCESS_FD_SUMMARY_ENCODED_OVERHEAD 4u - #define SBP_MSG_LINUX_CPU_STATE 0x7F08 #define SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_MASK (0x7u) #define SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_SHIFT (0u) -#define SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_SHIFT) \ - & SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_MASK)) -#define SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_MASK << SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_SHIFT))) | \ - (((val) & (SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_MASK)) \ - << (SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_SHIFT)));} while(0) - +#define SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_SHIFT) & \ + SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_MASK)) +#define SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_MASK \ + << SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_SHIFT))) | \ + (((val) & (SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_MASK)) \ + << (SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_SHIFT))); \ + } while (0) #define SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_SYSTEM_TIME_IN_SECONDS (0) #define SBP_LINUX_CPU_STATE_TIMESTAMP_TYPE_GPS_TOW_IN_MILLISECONDS (1) /** - * The maximum number of items that can be stored in sbp_msg_linux_cpu_state_t::tname (V4 API) or msg_linux_cpu_state_t::tname (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_linux_cpu_state_t::tname (V4 API) or msg_linux_cpu_state_t::tname + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_LINUX_CPU_STATE_TNAME_MAX 15u - /** - * The maximum number of items that can be stored in sbp_msg_linux_cpu_state_t::cmdline (V4 API) or msg_linux_cpu_state_t::cmdline (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_linux_cpu_state_t::cmdline (V4 API) or msg_linux_cpu_state_t::cmdline + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX 231u - /** - * Encoded length of sbp_msg_linux_cpu_state_t (V4 API) and + * Encoded length of sbp_msg_linux_cpu_state_t (V4 API) and * msg_linux_cpu_state_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_linux_cpu_state_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_linux_cpu_state_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_LINUX_CPU_STATE_ENCODED_OVERHEAD 24u - #define SBP_MSG_LINUX_MEM_STATE 0x7F09 #define SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_MASK (0x7u) #define SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_SHIFT (0u) -#define SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_SHIFT) \ - & SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_MASK)) -#define SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_MASK << SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_SHIFT))) | \ - (((val) & (SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_MASK)) \ - << (SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_SHIFT)));} while(0) - +#define SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_SHIFT) & \ + SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_MASK)) +#define SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_MASK \ + << SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_SHIFT))) | \ + (((val) & (SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_MASK)) \ + << (SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_SHIFT))); \ + } while (0) #define SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_SYSTEM_TIME_IN_SECONDS (0) #define SBP_LINUX_MEM_STATE_TIMESTAMP_TYPE_GPS_TOW_IN_MILLISECONDS (1) /** - * The maximum number of items that can be stored in sbp_msg_linux_mem_state_t::tname (V4 API) or msg_linux_mem_state_t::tname (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_linux_mem_state_t::tname (V4 API) or msg_linux_mem_state_t::tname + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_LINUX_MEM_STATE_TNAME_MAX 15u - /** - * The maximum number of items that can be stored in sbp_msg_linux_mem_state_t::cmdline (V4 API) or msg_linux_mem_state_t::cmdline (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_linux_mem_state_t::cmdline (V4 API) or msg_linux_mem_state_t::cmdline + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX 231u - /** - * Encoded length of sbp_msg_linux_mem_state_t (V4 API) and + * Encoded length of sbp_msg_linux_mem_state_t (V4 API) and * msg_linux_mem_state_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_linux_mem_state_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_linux_mem_state_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_LINUX_MEM_STATE_ENCODED_OVERHEAD 24u - #define SBP_MSG_LINUX_SYS_STATE 0x7F0A #define SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_MASK (0x7u) #define SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_SHIFT (0u) -#define SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_SHIFT) \ - & SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_MASK)) -#define SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_MASK << SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_SHIFT))) | \ - (((val) & (SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_MASK)) \ - << (SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_SHIFT)));} while(0) - +#define SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_SHIFT) & \ + SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_MASK)) +#define SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_MASK \ + << SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_SHIFT))) | \ + (((val) & (SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_MASK)) \ + << (SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_SHIFT))); \ + } while (0) #define SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_SYSTEM_TIME_IN_SECONDS (0) #define SBP_LINUX_SYS_STATE_TIMESTAMP_TYPE_GPS_TOW_IN_MILLISECONDS (1) /** - * Encoded length of sbp_msg_linux_sys_state_t (V4 API) and + * Encoded length of sbp_msg_linux_sys_state_t (V4 API) and * msg_linux_sys_state_t (legacy API) */ #define SBP_MSG_LINUX_SYS_STATE_ENCODED_LEN 15u - - #endif /* LIBSBP_LINUX_MACROS_H */ diff --git a/c/include/libsbp/logging.h b/c/include/libsbp/logging.h index c12584858..6b2f7cfd3 100644 --- a/c/include/libsbp/logging.h +++ b/c/include/libsbp/logging.h @@ -17,8 +17,8 @@ #ifndef LIBSBP_LOGGING_MESSAGES_H #define LIBSBP_LOGGING_MESSAGES_H -#include #include +#include #include #endif /* LIBSBP_LOGGING_MESSAGES_H */ diff --git a/c/include/libsbp/logging/MSG_FWD.h b/c/include/libsbp/logging/MSG_FWD.h index 2e8587c8b..17cee2fe8 100644 --- a/c/include/libsbp/logging/MSG_FWD.h +++ b/c/include/libsbp/logging/MSG_FWD.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_LOGGING_MSG_FWD_H #define LIBSBP_LOGGING_MSG_FWD_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,86 +40,98 @@ *****************************************************************************/ /** Wrapper for FWD a separate stream of information over SBP * - * This message provides the ability to forward messages over SBP. This may take the form of wrapping up SBP messages received by Piksi for logging purposes or wrapping another protocol with SBP. - * + * This message provides the ability to forward messages over SBP. This may + * take the form of wrapping up SBP messages received by Piksi for logging + * purposes or wrapping another protocol with SBP. + * */ typedef struct { - - /** -* source identifier + * source identifier */ u8 source; - /** -* protocol identifier + * protocol identifier */ u8 protocol; - /** -* variable length wrapped binary message + * variable length wrapped binary message */ u8 fwd_payload[SBP_MSG_FWD_FWD_PAYLOAD_MAX]; /** * Number of elements in fwd_payload * - * When sending a message fill in this field with the number elements set in fwd_payload before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * fwd_payload before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in fwd_payload. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * fwd_payload. The value of any elements beyond the index specified in this + * field is undefined */ u8 n_fwd_payload; } sbp_msg_fwd_t; - - /** * Get encoded size of an instance of sbp_msg_fwd_t * * @param msg sbp_msg_fwd_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_fwd_encoded_len(const sbp_msg_fwd_t *msg) -{ - return SBP_MSG_FWD_ENCODED_OVERHEAD - + (msg->n_fwd_payload * SBP_ENCODED_LEN_U8) - ; +static inline size_t sbp_msg_fwd_encoded_len(const sbp_msg_fwd_t *msg) { + return SBP_MSG_FWD_ENCODED_OVERHEAD + + (msg->n_fwd_payload * SBP_ENCODED_LEN_U8); } /** * Encode an instance of sbp_msg_fwd_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_fwd_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fwd_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fwd_t *msg); +SBP_EXPORT s8 sbp_msg_fwd_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fwd_t *msg); /** * Decode an instance of sbp_msg_fwd_t from wire representation * - * This function decodes the wire representation of a sbp_msg_fwd_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_fwd_t message to + * the given instance. The caller must specify the length of the buffer in the + * \p len parameter. If non-null the number of bytes read from the buffer will + * be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_fwd_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fwd_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fwd_t *msg); +SBP_EXPORT s8 sbp_msg_fwd_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_fwd_t *msg); /** * Send an instance of sbp_msg_fwd_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_fwd_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_fwd_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -127,16 +139,19 @@ SBP_EXPORT s8 sbp_msg_fwd_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_fwd_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fwd_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_fwd_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_fwd_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_fwd_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_fwd_t instance * @param b sbp_msg_fwd_t instance @@ -145,33 +160,38 @@ SBP_EXPORT s8 sbp_msg_fwd_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fwd SBP_EXPORT int sbp_msg_fwd_cmp(const sbp_msg_fwd_t *a, const sbp_msg_fwd_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_fwd_t &lhs, const sbp_msg_fwd_t &rhs) { +static inline bool operator==(const sbp_msg_fwd_t &lhs, + const sbp_msg_fwd_t &rhs) { return sbp_msg_fwd_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_fwd_t &lhs, const sbp_msg_fwd_t &rhs) { +static inline bool operator!=(const sbp_msg_fwd_t &lhs, + const sbp_msg_fwd_t &rhs) { return sbp_msg_fwd_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_fwd_t &lhs, const sbp_msg_fwd_t &rhs) { +static inline bool operator<(const sbp_msg_fwd_t &lhs, + const sbp_msg_fwd_t &rhs) { return sbp_msg_fwd_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_fwd_t &lhs, const sbp_msg_fwd_t &rhs) { +static inline bool operator<=(const sbp_msg_fwd_t &lhs, + const sbp_msg_fwd_t &rhs) { return sbp_msg_fwd_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_fwd_t &lhs, const sbp_msg_fwd_t &rhs) { +static inline bool operator>(const sbp_msg_fwd_t &lhs, + const sbp_msg_fwd_t &rhs) { return sbp_msg_fwd_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_fwd_t &lhs, const sbp_msg_fwd_t &rhs) { +static inline bool operator>=(const sbp_msg_fwd_t &lhs, + const sbp_msg_fwd_t &rhs) { return sbp_msg_fwd_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_LOGGING_MSG_FWD_H */ - diff --git a/c/include/libsbp/logging/MSG_LOG.h b/c/include/libsbp/logging/MSG_LOG.h index 6c89e0f66..9bcd7a999 100644 --- a/c/include/libsbp/logging/MSG_LOG.h +++ b/c/include/libsbp/logging/MSG_LOG.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_LOGGING_MSG_LOG_H #define LIBSBP_LOGGING_MSG_LOG_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,191 +40,211 @@ *****************************************************************************/ /** Plaintext logging messages with levels * -* This message contains a human-readable payload string from the device containing errors, warnings and informational messages at ERROR, WARNING, DEBUG, INFO logging levels. + * This message contains a human-readable payload string from the device + * containing errors, warnings and informational messages at ERROR, WARNING, + * DEBUG, INFO logging levels. */ typedef struct { - - /** -* Logging level + * Logging level */ u8 level; - /** -* Human-readable string + * Human-readable string */ sbp_string_t text; } sbp_msg_log_t; +/** + * Initialise sbp_msg_log_t::text to empty + * + * @param msg sbp_msg_log_t instance + */ +SBP_EXPORT void sbp_msg_log_text_init(sbp_msg_log_t *msg); - /** - * Initialise sbp_msg_log_t::text to empty - * - * @param msg sbp_msg_log_t instance - */ - SBP_EXPORT void sbp_msg_log_text_init(sbp_msg_log_t *msg); - - /** - * Test sbp_msg_log_t::text for validity - * - * @param msg sbp_msg_log_t instance - * @return true is sbp_msg_log_t::text is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_log_text_valid(const sbp_msg_log_t *msg); +/** + * Test sbp_msg_log_t::text for validity + * + * @param msg sbp_msg_log_t instance + * @return true is sbp_msg_log_t::text is valid for encoding purposes, false + * otherwise + */ +SBP_EXPORT bool sbp_msg_log_text_valid(const sbp_msg_log_t *msg); - /** - * Tests 2 instances of sbp_msg_log_t::text for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_log_t instance - * @param b sbp_msg_log_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_log_text_strcmp(const sbp_msg_log_t *a, const sbp_msg_log_t *b); +/** + * Tests 2 instances of sbp_msg_log_t::text for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_log_t instance + * @param b sbp_msg_log_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_log_text_strcmp(const sbp_msg_log_t *a, + const sbp_msg_log_t *b); - /** - * Get the encoded size of sbp_msg_log_t::text - * - * @param msg sbp_msg_log_t instance - * @return Size of sbp_msg_log_t::text in wire representation - */ - SBP_EXPORT size_t sbp_msg_log_text_encoded_len(const sbp_msg_log_t *msg); +/** + * Get the encoded size of sbp_msg_log_t::text + * + * @param msg sbp_msg_log_t instance + * @return Size of sbp_msg_log_t::text in wire representation + */ +SBP_EXPORT size_t sbp_msg_log_text_encoded_len(const sbp_msg_log_t *msg); - /** - * Query sbp_msg_log_t::text for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_log_t::text before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_log_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_log_text_space_remaining(const sbp_msg_log_t *msg); - /** - * Set sbp_msg_log_t::text - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_log_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_log_text_set(sbp_msg_log_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_log_t::text for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_log_t::text before it exceeds the maximum size of the field + * in wire representation + * + * @param msg sbp_msg_log_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_log_text_space_remaining(const sbp_msg_log_t *msg); +/** + * Set sbp_msg_log_t::text + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_log_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_log_text_set(sbp_msg_log_t *msg, const char *new_str, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_log_t::text from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_log_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_log_text_set_raw(sbp_msg_log_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_log_t::text from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_log_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_log_text_set_raw(sbp_msg_log_t *msg, + const char *new_buf, + size_t new_buf_len, bool should_trunc, + size_t *n_written); - /** - * Set sbp_msg_log_t::text with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_log_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_log_text_printf(sbp_msg_log_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_log_t::text with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_log_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_log_text_printf(sbp_msg_log_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) + SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_log_t::text with printf style formatting - * - * Identical to #sbp_msg_log_text_printf except it takes a va_list argument - * - * @param msg sbp_msg_log_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_log_text_vprintf(sbp_msg_log_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_log_t::text with printf style formatting + * + * Identical to #sbp_msg_log_text_printf except it takes a va_list argument + * + * @param msg sbp_msg_log_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_log_text_vprintf(sbp_msg_log_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, + va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_log_t::text with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_log_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_log_text_append_printf(sbp_msg_log_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_log_t::text with printf style formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_log_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_log_text_append_printf(sbp_msg_log_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, ...) + SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_log_t::text with printf style formatting - * - * Identical to #sbp_msg_log_text_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_log_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_log_text_append_vprintf(sbp_msg_log_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_log_t::text with printf style formatting + * + * Identical to #sbp_msg_log_text_append_printf except it takes a va_list + * argument + * + * @param msg sbp_msg_log_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_log_text_append_vprintf(sbp_msg_log_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_log_t::text - * - * @param msg sbp_msg_log_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_log_text_get(const sbp_msg_log_t *msg); +/** + * Obtain the string value from sbp_msg_log_t::text + * + * @param msg sbp_msg_log_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_log_text_get(const sbp_msg_log_t *msg); - /** - * Obtain the length of sbp_msg_log_t::text - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_log_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_log_text_strlen(const sbp_msg_log_t *msg); +/** + * Obtain the length of sbp_msg_log_t::text + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_log_t instance + * @return Length of string + */ +SBP_EXPORT size_t sbp_msg_log_text_strlen(const sbp_msg_log_t *msg); /** * Get encoded size of an instance of sbp_msg_log_t @@ -232,46 +252,58 @@ typedef struct { * @param msg sbp_msg_log_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_log_encoded_len(const sbp_msg_log_t *msg) -{ - return SBP_MSG_LOG_ENCODED_OVERHEAD - + sbp_msg_log_text_encoded_len(msg) - ; +static inline size_t sbp_msg_log_encoded_len(const sbp_msg_log_t *msg) { + return SBP_MSG_LOG_ENCODED_OVERHEAD + sbp_msg_log_text_encoded_len(msg); } /** * Encode an instance of sbp_msg_log_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_log_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_log_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_log_t *msg); +SBP_EXPORT s8 sbp_msg_log_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_log_t *msg); /** * Decode an instance of sbp_msg_log_t from wire representation * - * This function decodes the wire representation of a sbp_msg_log_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_log_t message to + * the given instance. The caller must specify the length of the buffer in the + * \p len parameter. If non-null the number of bytes read from the buffer will + * be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_log_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_log_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_log_t *msg); +SBP_EXPORT s8 sbp_msg_log_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_log_t *msg); /** * Send an instance of sbp_msg_log_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_log_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_log_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -279,16 +311,19 @@ SBP_EXPORT s8 sbp_msg_log_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_log_send(sbp_state_t *s, u16 sender_id, const sbp_msg_log_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_log_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_log_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_log_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_log_t instance * @param b sbp_msg_log_t instance @@ -297,33 +332,38 @@ SBP_EXPORT s8 sbp_msg_log_send(sbp_state_t *s, u16 sender_id, const sbp_msg_log SBP_EXPORT int sbp_msg_log_cmp(const sbp_msg_log_t *a, const sbp_msg_log_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_log_t &lhs, const sbp_msg_log_t &rhs) { +static inline bool operator==(const sbp_msg_log_t &lhs, + const sbp_msg_log_t &rhs) { return sbp_msg_log_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_log_t &lhs, const sbp_msg_log_t &rhs) { +static inline bool operator!=(const sbp_msg_log_t &lhs, + const sbp_msg_log_t &rhs) { return sbp_msg_log_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_log_t &lhs, const sbp_msg_log_t &rhs) { +static inline bool operator<(const sbp_msg_log_t &lhs, + const sbp_msg_log_t &rhs) { return sbp_msg_log_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_log_t &lhs, const sbp_msg_log_t &rhs) { +static inline bool operator<=(const sbp_msg_log_t &lhs, + const sbp_msg_log_t &rhs) { return sbp_msg_log_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_log_t &lhs, const sbp_msg_log_t &rhs) { +static inline bool operator>(const sbp_msg_log_t &lhs, + const sbp_msg_log_t &rhs) { return sbp_msg_log_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_log_t &lhs, const sbp_msg_log_t &rhs) { +static inline bool operator>=(const sbp_msg_log_t &lhs, + const sbp_msg_log_t &rhs) { return sbp_msg_log_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_LOGGING_MSG_LOG_H */ - diff --git a/c/include/libsbp/logging/MSG_PRINT_DEP.h b/c/include/libsbp/logging/MSG_PRINT_DEP.h index 36fd721b3..78a311827 100644 --- a/c/include/libsbp/logging/MSG_PRINT_DEP.h +++ b/c/include/libsbp/logging/MSG_PRINT_DEP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_LOGGING_MSG_PRINT_DEP_H #define LIBSBP_LOGGING_MSG_PRINT_DEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,185 +40,213 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Human-readable string + * Human-readable string */ sbp_string_t text; } sbp_msg_print_dep_t; +/** + * Initialise sbp_msg_print_dep_t::text to empty + * + * @param msg sbp_msg_print_dep_t instance + */ +SBP_EXPORT void sbp_msg_print_dep_text_init(sbp_msg_print_dep_t *msg); - /** - * Initialise sbp_msg_print_dep_t::text to empty - * - * @param msg sbp_msg_print_dep_t instance - */ - SBP_EXPORT void sbp_msg_print_dep_text_init(sbp_msg_print_dep_t *msg); - - /** - * Test sbp_msg_print_dep_t::text for validity - * - * @param msg sbp_msg_print_dep_t instance - * @return true is sbp_msg_print_dep_t::text is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_print_dep_text_valid(const sbp_msg_print_dep_t *msg); +/** + * Test sbp_msg_print_dep_t::text for validity + * + * @param msg sbp_msg_print_dep_t instance + * @return true is sbp_msg_print_dep_t::text is valid for encoding purposes, + * false otherwise + */ +SBP_EXPORT bool sbp_msg_print_dep_text_valid(const sbp_msg_print_dep_t *msg); - /** - * Tests 2 instances of sbp_msg_print_dep_t::text for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_print_dep_t instance - * @param b sbp_msg_print_dep_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_print_dep_text_strcmp(const sbp_msg_print_dep_t *a, const sbp_msg_print_dep_t *b); +/** + * Tests 2 instances of sbp_msg_print_dep_t::text for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_print_dep_t instance + * @param b sbp_msg_print_dep_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_print_dep_text_strcmp(const sbp_msg_print_dep_t *a, + const sbp_msg_print_dep_t *b); - /** - * Get the encoded size of sbp_msg_print_dep_t::text - * - * @param msg sbp_msg_print_dep_t instance - * @return Size of sbp_msg_print_dep_t::text in wire representation - */ - SBP_EXPORT size_t sbp_msg_print_dep_text_encoded_len(const sbp_msg_print_dep_t *msg); +/** + * Get the encoded size of sbp_msg_print_dep_t::text + * + * @param msg sbp_msg_print_dep_t instance + * @return Size of sbp_msg_print_dep_t::text in wire representation + */ +SBP_EXPORT size_t +sbp_msg_print_dep_text_encoded_len(const sbp_msg_print_dep_t *msg); - /** - * Query sbp_msg_print_dep_t::text for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_print_dep_t::text before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_print_dep_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_print_dep_text_space_remaining(const sbp_msg_print_dep_t *msg); - /** - * Set sbp_msg_print_dep_t::text - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_print_dep_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_print_dep_text_set(sbp_msg_print_dep_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_print_dep_t::text for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_print_dep_t::text before it exceeds the maximum size of the + * field in wire representation + * + * @param msg sbp_msg_print_dep_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t +sbp_msg_print_dep_text_space_remaining(const sbp_msg_print_dep_t *msg); +/** + * Set sbp_msg_print_dep_t::text + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_print_dep_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_print_dep_text_set(sbp_msg_print_dep_t *msg, + const char *new_str, + bool should_trunc, + size_t *n_written); - /** - * Set sbp_msg_print_dep_t::text from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_print_dep_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_print_dep_text_set_raw(sbp_msg_print_dep_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_print_dep_t::text from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_print_dep_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_print_dep_text_set_raw(sbp_msg_print_dep_t *msg, + const char *new_buf, + size_t new_buf_len, + bool should_trunc, + size_t *n_written); - /** - * Set sbp_msg_print_dep_t::text with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_print_dep_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_print_dep_text_printf(sbp_msg_print_dep_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_print_dep_t::text with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_print_dep_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_print_dep_text_printf(sbp_msg_print_dep_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, ...) + SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_print_dep_t::text with printf style formatting - * - * Identical to #sbp_msg_print_dep_text_printf except it takes a va_list argument - * - * @param msg sbp_msg_print_dep_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_print_dep_text_vprintf(sbp_msg_print_dep_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_print_dep_t::text with printf style formatting + * + * Identical to #sbp_msg_print_dep_text_printf except it takes a va_list + * argument + * + * @param msg sbp_msg_print_dep_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_print_dep_text_vprintf(sbp_msg_print_dep_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_print_dep_t::text with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_print_dep_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_print_dep_text_append_printf(sbp_msg_print_dep_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_print_dep_t::text with printf style formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_print_dep_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_print_dep_text_append_printf(sbp_msg_print_dep_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, ...) + SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_print_dep_t::text with printf style formatting - * - * Identical to #sbp_msg_print_dep_text_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_print_dep_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_print_dep_text_append_vprintf(sbp_msg_print_dep_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_print_dep_t::text with printf style formatting + * + * Identical to #sbp_msg_print_dep_text_append_printf except it takes a va_list + * argument + * + * @param msg sbp_msg_print_dep_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_print_dep_text_append_vprintf( + sbp_msg_print_dep_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_print_dep_t::text - * - * @param msg sbp_msg_print_dep_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_print_dep_text_get(const sbp_msg_print_dep_t *msg); +/** + * Obtain the string value from sbp_msg_print_dep_t::text + * + * @param msg sbp_msg_print_dep_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_print_dep_text_get( + const sbp_msg_print_dep_t *msg); - /** - * Obtain the length of sbp_msg_print_dep_t::text - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_print_dep_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_print_dep_text_strlen(const sbp_msg_print_dep_t *msg); +/** + * Obtain the length of sbp_msg_print_dep_t::text + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_print_dep_t instance + * @return Length of string + */ +SBP_EXPORT size_t sbp_msg_print_dep_text_strlen(const sbp_msg_print_dep_t *msg); /** * Get encoded size of an instance of sbp_msg_print_dep_t @@ -226,46 +254,62 @@ typedef struct { * @param msg sbp_msg_print_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_print_dep_encoded_len(const sbp_msg_print_dep_t *msg) -{ - return SBP_MSG_PRINT_DEP_ENCODED_OVERHEAD - + sbp_msg_print_dep_text_encoded_len(msg) - ; +static inline size_t sbp_msg_print_dep_encoded_len( + const sbp_msg_print_dep_t *msg) { + return SBP_MSG_PRINT_DEP_ENCODED_OVERHEAD + + sbp_msg_print_dep_text_encoded_len(msg); } /** * Encode an instance of sbp_msg_print_dep_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_print_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_print_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_print_dep_t *msg); +SBP_EXPORT s8 sbp_msg_print_dep_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_print_dep_t *msg); /** * Decode an instance of sbp_msg_print_dep_t from wire representation * - * This function decodes the wire representation of a sbp_msg_print_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_print_dep_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_print_dep_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_print_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_print_dep_t *msg); +SBP_EXPORT s8 sbp_msg_print_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_print_dep_t *msg); /** * Send an instance of sbp_msg_print_dep_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_print_dep_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_print_dep_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -273,51 +317,61 @@ SBP_EXPORT s8 sbp_msg_print_dep_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_print_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_print_dep_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_print_dep_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_print_dep_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_print_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_print_dep_t instance * @param b sbp_msg_print_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_print_dep_cmp(const sbp_msg_print_dep_t *a, const sbp_msg_print_dep_t *b); +SBP_EXPORT int sbp_msg_print_dep_cmp(const sbp_msg_print_dep_t *a, + const sbp_msg_print_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_print_dep_t &lhs, const sbp_msg_print_dep_t &rhs) { +static inline bool operator==(const sbp_msg_print_dep_t &lhs, + const sbp_msg_print_dep_t &rhs) { return sbp_msg_print_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_print_dep_t &lhs, const sbp_msg_print_dep_t &rhs) { +static inline bool operator!=(const sbp_msg_print_dep_t &lhs, + const sbp_msg_print_dep_t &rhs) { return sbp_msg_print_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_print_dep_t &lhs, const sbp_msg_print_dep_t &rhs) { +static inline bool operator<(const sbp_msg_print_dep_t &lhs, + const sbp_msg_print_dep_t &rhs) { return sbp_msg_print_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_print_dep_t &lhs, const sbp_msg_print_dep_t &rhs) { +static inline bool operator<=(const sbp_msg_print_dep_t &lhs, + const sbp_msg_print_dep_t &rhs) { return sbp_msg_print_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_print_dep_t &lhs, const sbp_msg_print_dep_t &rhs) { +static inline bool operator>(const sbp_msg_print_dep_t &lhs, + const sbp_msg_print_dep_t &rhs) { return sbp_msg_print_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_print_dep_t &lhs, const sbp_msg_print_dep_t &rhs) { +static inline bool operator>=(const sbp_msg_print_dep_t &lhs, + const sbp_msg_print_dep_t &rhs) { return sbp_msg_print_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_LOGGING_MSG_PRINT_DEP_H */ - diff --git a/c/include/libsbp/logging_macros.h b/c/include/libsbp/logging_macros.h index dd7372ed9..66791cb80 100644 --- a/c/include/libsbp/logging_macros.h +++ b/c/include/libsbp/logging_macros.h @@ -18,18 +18,19 @@ #ifndef LIBSBP_LOGGING_MACROS_H #define LIBSBP_LOGGING_MACROS_H - #define SBP_MSG_LOG 0x0401 #define SBP_LOG_LOGGING_LEVEL_MASK (0x7u) #define SBP_LOG_LOGGING_LEVEL_SHIFT (0u) -#define SBP_LOG_LOGGING_LEVEL_GET(flags) \ - ((u8)((u8)((flags) >> SBP_LOG_LOGGING_LEVEL_SHIFT) \ - & SBP_LOG_LOGGING_LEVEL_MASK)) -#define SBP_LOG_LOGGING_LEVEL_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_LOG_LOGGING_LEVEL_MASK << SBP_LOG_LOGGING_LEVEL_SHIFT))) | \ - (((val) & (SBP_LOG_LOGGING_LEVEL_MASK)) \ - << (SBP_LOG_LOGGING_LEVEL_SHIFT)));} while(0) - +#define SBP_LOG_LOGGING_LEVEL_GET(flags) \ + ((u8)((u8)((flags) >> SBP_LOG_LOGGING_LEVEL_SHIFT) & \ + SBP_LOG_LOGGING_LEVEL_MASK)) +#define SBP_LOG_LOGGING_LEVEL_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_LOG_LOGGING_LEVEL_MASK \ + << SBP_LOG_LOGGING_LEVEL_SHIFT))) | \ + (((val) & (SBP_LOG_LOGGING_LEVEL_MASK)) \ + << (SBP_LOG_LOGGING_LEVEL_SHIFT))); \ + } while (0) #define SBP_LOG_LOGGING_LEVEL_EMERG (0) #define SBP_LOG_LOGGING_LEVEL_ALERT (1) @@ -40,72 +41,71 @@ #define SBP_LOG_LOGGING_LEVEL_INFO (6) #define SBP_LOG_LOGGING_LEVEL_DEBUG (7) /** - * The maximum number of items that can be stored in sbp_msg_log_t::text (V4 API) or msg_log_t::text (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in sbp_msg_log_t::text (V4 + * API) or msg_log_t::text (legacy API) before the maximum SBP message size is + * exceeded */ #define SBP_MSG_LOG_TEXT_MAX 254u - /** - * Encoded length of sbp_msg_log_t (V4 API) and + * Encoded length of sbp_msg_log_t (V4 API) and * msg_log_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_log_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_log_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_LOG_ENCODED_OVERHEAD 1u - #define SBP_MSG_FWD 0x0402 /** - * The maximum number of items that can be stored in sbp_msg_fwd_t::fwd_payload (V4 API) or msg_fwd_t::fwd_payload (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in sbp_msg_fwd_t::fwd_payload + * (V4 API) or msg_fwd_t::fwd_payload (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_FWD_FWD_PAYLOAD_MAX 253u - /** - * Encoded length of sbp_msg_fwd_t (V4 API) and + * Encoded length of sbp_msg_fwd_t (V4 API) and * msg_fwd_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_fwd_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_fwd_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_FWD_ENCODED_OVERHEAD 2u - #define SBP_MSG_PRINT_DEP 0x0010 /** - * The maximum number of items that can be stored in sbp_msg_print_dep_t::text (V4 API) or msg_print_dep_t::text (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in sbp_msg_print_dep_t::text + * (V4 API) or msg_print_dep_t::text (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_PRINT_DEP_TEXT_MAX 255u - /** - * Encoded length of sbp_msg_print_dep_t (V4 API) and + * Encoded length of sbp_msg_print_dep_t (V4 API) and * msg_print_dep_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_print_dep_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_print_dep_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_PRINT_DEP_ENCODED_OVERHEAD 0u - - #endif /* LIBSBP_LOGGING_MACROS_H */ diff --git a/c/include/libsbp/mag/MSG_MAG_RAW.h b/c/include/libsbp/mag/MSG_MAG_RAW.h index 8b03c53c0..685f2f58f 100644 --- a/c/include/libsbp/mag/MSG_MAG_RAW.h +++ b/c/include/libsbp/mag/MSG_MAG_RAW.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_MAG_MSG_MAG_RAW_H #define LIBSBP_MAG_MSG_MAG_RAW_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,51 +40,43 @@ *****************************************************************************/ /** Raw magnetometer data * -* Raw data from the magnetometer. + * Raw data from the magnetometer. */ typedef struct { - - /** - * Milliseconds since start of GPS week. If the high bit is set, the time is unknown or invalid. [ms] + * Milliseconds since start of GPS week. If the high bit is set, the time is + * unknown or invalid. [ms] */ u32 tow; - /** - * Milliseconds since start of GPS week, fractional part [ms / 256] + * Milliseconds since start of GPS week, fractional part [ms / 256] */ u8 tow_f; - /** -* Magnetic field in the body frame X axis [microteslas] + * Magnetic field in the body frame X axis [microteslas] */ s16 mag_x; - /** -* Magnetic field in the body frame Y axis [microteslas] + * Magnetic field in the body frame Y axis [microteslas] */ s16 mag_y; - /** -* Magnetic field in the body frame Z axis [microteslas] + * Magnetic field in the body frame Z axis [microteslas] */ s16 mag_z; } sbp_msg_mag_raw_t; - - /** * Get encoded size of an instance of sbp_msg_mag_raw_t * * @param msg sbp_msg_mag_raw_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_mag_raw_encoded_len(const sbp_msg_mag_raw_t *msg) -{ +static inline size_t sbp_msg_mag_raw_encoded_len(const sbp_msg_mag_raw_t *msg) { (void)msg; return SBP_MSG_MAG_RAW_ENCODED_LEN; } @@ -92,36 +84,52 @@ static inline size_t sbp_msg_mag_raw_encoded_len(const sbp_msg_mag_raw_t *msg) /** * Encode an instance of sbp_msg_mag_raw_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_mag_raw_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_mag_raw_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_mag_raw_t *msg); +SBP_EXPORT s8 sbp_msg_mag_raw_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_mag_raw_t *msg); /** * Decode an instance of sbp_msg_mag_raw_t from wire representation * - * This function decodes the wire representation of a sbp_msg_mag_raw_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_mag_raw_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_mag_raw_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_mag_raw_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_mag_raw_t *msg); +SBP_EXPORT s8 sbp_msg_mag_raw_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_mag_raw_t *msg); /** * Send an instance of sbp_msg_mag_raw_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_mag_raw_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_mag_raw_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -129,51 +137,61 @@ SBP_EXPORT s8 sbp_msg_mag_raw_decode(const uint8_t *buf, uint8_t len, uint8_t *n * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_mag_raw_send(sbp_state_t *s, u16 sender_id, const sbp_msg_mag_raw_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_mag_raw_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_mag_raw_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_mag_raw_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_mag_raw_t instance * @param b sbp_msg_mag_raw_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_mag_raw_cmp(const sbp_msg_mag_raw_t *a, const sbp_msg_mag_raw_t *b); +SBP_EXPORT int sbp_msg_mag_raw_cmp(const sbp_msg_mag_raw_t *a, + const sbp_msg_mag_raw_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_mag_raw_t &lhs, const sbp_msg_mag_raw_t &rhs) { +static inline bool operator==(const sbp_msg_mag_raw_t &lhs, + const sbp_msg_mag_raw_t &rhs) { return sbp_msg_mag_raw_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_mag_raw_t &lhs, const sbp_msg_mag_raw_t &rhs) { +static inline bool operator!=(const sbp_msg_mag_raw_t &lhs, + const sbp_msg_mag_raw_t &rhs) { return sbp_msg_mag_raw_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_mag_raw_t &lhs, const sbp_msg_mag_raw_t &rhs) { +static inline bool operator<(const sbp_msg_mag_raw_t &lhs, + const sbp_msg_mag_raw_t &rhs) { return sbp_msg_mag_raw_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_mag_raw_t &lhs, const sbp_msg_mag_raw_t &rhs) { +static inline bool operator<=(const sbp_msg_mag_raw_t &lhs, + const sbp_msg_mag_raw_t &rhs) { return sbp_msg_mag_raw_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_mag_raw_t &lhs, const sbp_msg_mag_raw_t &rhs) { +static inline bool operator>(const sbp_msg_mag_raw_t &lhs, + const sbp_msg_mag_raw_t &rhs) { return sbp_msg_mag_raw_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_mag_raw_t &lhs, const sbp_msg_mag_raw_t &rhs) { +static inline bool operator>=(const sbp_msg_mag_raw_t &lhs, + const sbp_msg_mag_raw_t &rhs) { return sbp_msg_mag_raw_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_MAG_MSG_MAG_RAW_H */ - diff --git a/c/include/libsbp/mag_macros.h b/c/include/libsbp/mag_macros.h index defffdeab..12e382bf7 100644 --- a/c/include/libsbp/mag_macros.h +++ b/c/include/libsbp/mag_macros.h @@ -18,14 +18,11 @@ #ifndef LIBSBP_MAG_MACROS_H #define LIBSBP_MAG_MACROS_H - #define SBP_MSG_MAG_RAW 0x0902 /** - * Encoded length of sbp_msg_mag_raw_t (V4 API) and + * Encoded length of sbp_msg_mag_raw_t (V4 API) and * msg_mag_raw_t (legacy API) */ #define SBP_MSG_MAG_RAW_ENCODED_LEN 11u - - #endif /* LIBSBP_MAG_MACROS_H */ diff --git a/c/include/libsbp/navigation.h b/c/include/libsbp/navigation.h index f1c78b332..627df9ac5 100644 --- a/c/include/libsbp/navigation.h +++ b/c/include/libsbp/navigation.h @@ -17,47 +17,47 @@ #ifndef LIBSBP_NAVIGATION_MESSAGES_H #define LIBSBP_NAVIGATION_MESSAGES_H +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include #include -#include -#include -#include +#include #include #include +#include +#include +#include #include -#include -#include #include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include +#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include +#include #endif /* LIBSBP_NAVIGATION_MESSAGES_H */ diff --git a/c/include/libsbp/navigation/EstimatedHorizontalErrorEllipse.h b/c/include/libsbp/navigation/EstimatedHorizontalErrorEllipse.h index 3086402f2..2c578a8d3 100644 --- a/c/include/libsbp/navigation/EstimatedHorizontalErrorEllipse.h +++ b/c/include/libsbp/navigation/EstimatedHorizontalErrorEllipse.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_ESTIMATEDHORIZONTALERRORELLIPSE_H #define LIBSBP_NAVIGATION_ESTIMATEDHORIZONTALERRORELLIPSE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -39,111 +39,141 @@ * *****************************************************************************/ typedef struct { - - /** - * The semi major axis of the estimated horizontal error ellipse at the user-configured confidence level; zero implies invalid. [m] + * The semi major axis of the estimated horizontal error ellipse at the + * user-configured confidence level; zero implies invalid. [m] */ float semi_major; - /** - * The semi minor axis of the estimated horizontal error ellipse at the user-configured confidence level; zero implies invalid. [m] + * The semi minor axis of the estimated horizontal error ellipse at the + * user-configured confidence level; zero implies invalid. [m] */ float semi_minor; - /** - * The orientation of the semi major axis of the estimated horizontal error ellipse with respect to North. [deg] + * The orientation of the semi major axis of the estimated horizontal error + * ellipse with respect to North. [deg] */ float orientation; } sbp_estimated_horizontal_error_ellipse_t; - - /** * Get encoded size of an instance of sbp_estimated_horizontal_error_ellipse_t * * @param msg sbp_estimated_horizontal_error_ellipse_t instance * @return Length of on-wire representation */ -static inline size_t sbp_estimated_horizontal_error_ellipse_encoded_len(const sbp_estimated_horizontal_error_ellipse_t *msg) -{ +static inline size_t sbp_estimated_horizontal_error_ellipse_encoded_len( + const sbp_estimated_horizontal_error_ellipse_t *msg) { (void)msg; return SBP_ESTIMATED_HORIZONTAL_ERROR_ELLIPSE_ENCODED_LEN; } /** - * Encode an instance of sbp_estimated_horizontal_error_ellipse_t to wire representation + * Encode an instance of sbp_estimated_horizontal_error_ellipse_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_estimated_horizontal_error_ellipse_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_estimated_horizontal_error_ellipse_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_estimated_horizontal_error_ellipse_t *msg); +SBP_EXPORT s8 sbp_estimated_horizontal_error_ellipse_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_estimated_horizontal_error_ellipse_t *msg); /** - * Decode an instance of sbp_estimated_horizontal_error_ellipse_t from wire representation + * Decode an instance of sbp_estimated_horizontal_error_ellipse_t from wire + * representation * - * This function decodes the wire representation of a sbp_estimated_horizontal_error_ellipse_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_estimated_horizontal_error_ellipse_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_estimated_horizontal_error_ellipse_t instance + * @param buf Wire representation of the + * sbp_estimated_horizontal_error_ellipse_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_estimated_horizontal_error_ellipse_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_estimated_horizontal_error_ellipse_t *msg); +SBP_EXPORT s8 sbp_estimated_horizontal_error_ellipse_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_estimated_horizontal_error_ellipse_t *msg); /** * Compare two instances of sbp_estimated_horizontal_error_ellipse_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_estimated_horizontal_error_ellipse_t instance * @param b sbp_estimated_horizontal_error_ellipse_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_estimated_horizontal_error_ellipse_cmp(const sbp_estimated_horizontal_error_ellipse_t *a, const sbp_estimated_horizontal_error_ellipse_t *b); +SBP_EXPORT int sbp_estimated_horizontal_error_ellipse_cmp( + const sbp_estimated_horizontal_error_ellipse_t *a, + const sbp_estimated_horizontal_error_ellipse_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_estimated_horizontal_error_ellipse_t &lhs, const sbp_estimated_horizontal_error_ellipse_t &rhs) { +static inline bool operator==( + const sbp_estimated_horizontal_error_ellipse_t &lhs, + const sbp_estimated_horizontal_error_ellipse_t &rhs) { return sbp_estimated_horizontal_error_ellipse_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_estimated_horizontal_error_ellipse_t &lhs, const sbp_estimated_horizontal_error_ellipse_t &rhs) { +static inline bool operator!=( + const sbp_estimated_horizontal_error_ellipse_t &lhs, + const sbp_estimated_horizontal_error_ellipse_t &rhs) { return sbp_estimated_horizontal_error_ellipse_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_estimated_horizontal_error_ellipse_t &lhs, const sbp_estimated_horizontal_error_ellipse_t &rhs) { +static inline bool operator<( + const sbp_estimated_horizontal_error_ellipse_t &lhs, + const sbp_estimated_horizontal_error_ellipse_t &rhs) { return sbp_estimated_horizontal_error_ellipse_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_estimated_horizontal_error_ellipse_t &lhs, const sbp_estimated_horizontal_error_ellipse_t &rhs) { +static inline bool operator<=( + const sbp_estimated_horizontal_error_ellipse_t &lhs, + const sbp_estimated_horizontal_error_ellipse_t &rhs) { return sbp_estimated_horizontal_error_ellipse_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_estimated_horizontal_error_ellipse_t &lhs, const sbp_estimated_horizontal_error_ellipse_t &rhs) { +static inline bool operator>( + const sbp_estimated_horizontal_error_ellipse_t &lhs, + const sbp_estimated_horizontal_error_ellipse_t &rhs) { return sbp_estimated_horizontal_error_ellipse_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_estimated_horizontal_error_ellipse_t &lhs, const sbp_estimated_horizontal_error_ellipse_t &rhs) { +static inline bool operator>=( + const sbp_estimated_horizontal_error_ellipse_t &lhs, + const sbp_estimated_horizontal_error_ellipse_t &rhs) { return sbp_estimated_horizontal_error_ellipse_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_ESTIMATEDHORIZONTALERRORELLIPSE_H */ - diff --git a/c/include/libsbp/navigation/MSG_AGE_CORRECTIONS.h b/c/include/libsbp/navigation/MSG_AGE_CORRECTIONS.h index 7a8144f5f..631419574 100644 --- a/c/include/libsbp/navigation/MSG_AGE_CORRECTIONS.h +++ b/c/include/libsbp/navigation/MSG_AGE_CORRECTIONS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_AGE_CORRECTIONS_H #define LIBSBP_NAVIGATION_MSG_AGE_CORRECTIONS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,33 +40,29 @@ *****************************************************************************/ /** Age of corrections * -* This message reports the Age of the corrections used for the current Differential solution. + * This message reports the Age of the corrections used for the current + * Differential solution. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Age of the corrections (0xFFFF indicates invalid) [deciseconds] + * Age of the corrections (0xFFFF indicates invalid) [deciseconds] */ u16 age; } sbp_msg_age_corrections_t; - - /** * Get encoded size of an instance of sbp_msg_age_corrections_t * * @param msg sbp_msg_age_corrections_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_age_corrections_encoded_len(const sbp_msg_age_corrections_t *msg) -{ +static inline size_t sbp_msg_age_corrections_encoded_len( + const sbp_msg_age_corrections_t *msg) { (void)msg; return SBP_MSG_AGE_CORRECTIONS_ENCODED_LEN; } @@ -74,36 +70,53 @@ static inline size_t sbp_msg_age_corrections_encoded_len(const sbp_msg_age_corre /** * Encode an instance of sbp_msg_age_corrections_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_age_corrections_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_age_corrections_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_age_corrections_t *msg); +SBP_EXPORT s8 +sbp_msg_age_corrections_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_age_corrections_t *msg); /** * Decode an instance of sbp_msg_age_corrections_t from wire representation * - * This function decodes the wire representation of a sbp_msg_age_corrections_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_age_corrections_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_age_corrections_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_age_corrections_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_age_corrections_t *msg); +SBP_EXPORT s8 sbp_msg_age_corrections_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_age_corrections_t *msg); /** * Send an instance of sbp_msg_age_corrections_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_age_corrections_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_age_corrections_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -111,51 +124,61 @@ SBP_EXPORT s8 sbp_msg_age_corrections_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_age_corrections_send(sbp_state_t *s, u16 sender_id, const sbp_msg_age_corrections_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_age_corrections_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_age_corrections_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_age_corrections_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_age_corrections_t instance * @param b sbp_msg_age_corrections_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_age_corrections_cmp(const sbp_msg_age_corrections_t *a, const sbp_msg_age_corrections_t *b); +SBP_EXPORT int sbp_msg_age_corrections_cmp(const sbp_msg_age_corrections_t *a, + const sbp_msg_age_corrections_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_age_corrections_t &lhs, const sbp_msg_age_corrections_t &rhs) { +static inline bool operator==(const sbp_msg_age_corrections_t &lhs, + const sbp_msg_age_corrections_t &rhs) { return sbp_msg_age_corrections_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_age_corrections_t &lhs, const sbp_msg_age_corrections_t &rhs) { +static inline bool operator!=(const sbp_msg_age_corrections_t &lhs, + const sbp_msg_age_corrections_t &rhs) { return sbp_msg_age_corrections_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_age_corrections_t &lhs, const sbp_msg_age_corrections_t &rhs) { +static inline bool operator<(const sbp_msg_age_corrections_t &lhs, + const sbp_msg_age_corrections_t &rhs) { return sbp_msg_age_corrections_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_age_corrections_t &lhs, const sbp_msg_age_corrections_t &rhs) { +static inline bool operator<=(const sbp_msg_age_corrections_t &lhs, + const sbp_msg_age_corrections_t &rhs) { return sbp_msg_age_corrections_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_age_corrections_t &lhs, const sbp_msg_age_corrections_t &rhs) { +static inline bool operator>(const sbp_msg_age_corrections_t &lhs, + const sbp_msg_age_corrections_t &rhs) { return sbp_msg_age_corrections_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_age_corrections_t &lhs, const sbp_msg_age_corrections_t &rhs) { +static inline bool operator>=(const sbp_msg_age_corrections_t &lhs, + const sbp_msg_age_corrections_t &rhs) { return sbp_msg_age_corrections_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_AGE_CORRECTIONS_H */ - diff --git a/c/include/libsbp/navigation/MSG_BASELINE_ECEF.h b/c/include/libsbp/navigation/MSG_BASELINE_ECEF.h index 9e8ec0e70..397dec2d8 100644 --- a/c/include/libsbp/navigation/MSG_BASELINE_ECEF.h +++ b/c/include/libsbp/navigation/MSG_BASELINE_ECEF.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_BASELINE_ECEF_H #define LIBSBP_NAVIGATION_MSG_BASELINE_ECEF_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,64 +40,57 @@ *****************************************************************************/ /** GNSS-only Baseline Position in ECEF * - * This message reports the baseline solution in Earth Centered Earth Fixed (ECEF) coordinates. This baseline is the relative vector distance from the base station to the rover receiver. The full GPS time is given by the preceding MSG_GPS_TIME with the matching time-of-week (tow). - * + * This message reports the baseline solution in Earth Centered Earth Fixed + * (ECEF) coordinates. This baseline is the relative vector distance from the + * base station to the rover receiver. The full GPS time is given by the + * preceding MSG_GPS_TIME with the matching time-of-week (tow). + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Baseline ECEF X coordinate [mm] + * Baseline ECEF X coordinate [mm] */ s32 x; - /** -* Baseline ECEF Y coordinate [mm] + * Baseline ECEF Y coordinate [mm] */ s32 y; - /** -* Baseline ECEF Z coordinate [mm] + * Baseline ECEF Z coordinate [mm] */ s32 z; - /** -* Position estimated standard deviation [mm] + * Position estimated standard deviation [mm] */ u16 accuracy; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_baseline_ecef_t; - - /** * Get encoded size of an instance of sbp_msg_baseline_ecef_t * * @param msg sbp_msg_baseline_ecef_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_baseline_ecef_encoded_len(const sbp_msg_baseline_ecef_t *msg) -{ +static inline size_t sbp_msg_baseline_ecef_encoded_len( + const sbp_msg_baseline_ecef_t *msg) { (void)msg; return SBP_MSG_BASELINE_ECEF_ENCODED_LEN; } @@ -105,36 +98,53 @@ static inline size_t sbp_msg_baseline_ecef_encoded_len(const sbp_msg_baseline_ec /** * Encode an instance of sbp_msg_baseline_ecef_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_baseline_ecef_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_ecef_t *msg); +SBP_EXPORT s8 sbp_msg_baseline_ecef_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_baseline_ecef_t *msg); /** * Decode an instance of sbp_msg_baseline_ecef_t from wire representation * - * This function decodes the wire representation of a sbp_msg_baseline_ecef_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_baseline_ecef_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_baseline_ecef_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_ecef_t *msg); +SBP_EXPORT s8 sbp_msg_baseline_ecef_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_baseline_ecef_t *msg); /** * Send an instance of sbp_msg_baseline_ecef_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_baseline_ecef_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_baseline_ecef_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -142,51 +152,61 @@ SBP_EXPORT s8 sbp_msg_baseline_ecef_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_ecef_send(sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_ecef_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_baseline_ecef_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_baseline_ecef_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_baseline_ecef_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_baseline_ecef_t instance * @param b sbp_msg_baseline_ecef_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_baseline_ecef_cmp(const sbp_msg_baseline_ecef_t *a, const sbp_msg_baseline_ecef_t *b); +SBP_EXPORT int sbp_msg_baseline_ecef_cmp(const sbp_msg_baseline_ecef_t *a, + const sbp_msg_baseline_ecef_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_baseline_ecef_t &lhs, const sbp_msg_baseline_ecef_t &rhs) { +static inline bool operator==(const sbp_msg_baseline_ecef_t &lhs, + const sbp_msg_baseline_ecef_t &rhs) { return sbp_msg_baseline_ecef_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_baseline_ecef_t &lhs, const sbp_msg_baseline_ecef_t &rhs) { +static inline bool operator!=(const sbp_msg_baseline_ecef_t &lhs, + const sbp_msg_baseline_ecef_t &rhs) { return sbp_msg_baseline_ecef_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_baseline_ecef_t &lhs, const sbp_msg_baseline_ecef_t &rhs) { +static inline bool operator<(const sbp_msg_baseline_ecef_t &lhs, + const sbp_msg_baseline_ecef_t &rhs) { return sbp_msg_baseline_ecef_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_baseline_ecef_t &lhs, const sbp_msg_baseline_ecef_t &rhs) { +static inline bool operator<=(const sbp_msg_baseline_ecef_t &lhs, + const sbp_msg_baseline_ecef_t &rhs) { return sbp_msg_baseline_ecef_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_baseline_ecef_t &lhs, const sbp_msg_baseline_ecef_t &rhs) { +static inline bool operator>(const sbp_msg_baseline_ecef_t &lhs, + const sbp_msg_baseline_ecef_t &rhs) { return sbp_msg_baseline_ecef_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_baseline_ecef_t &lhs, const sbp_msg_baseline_ecef_t &rhs) { +static inline bool operator>=(const sbp_msg_baseline_ecef_t &lhs, + const sbp_msg_baseline_ecef_t &rhs) { return sbp_msg_baseline_ecef_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_BASELINE_ECEF_H */ - diff --git a/c/include/libsbp/navigation/MSG_BASELINE_ECEF_DEP_A.h b/c/include/libsbp/navigation/MSG_BASELINE_ECEF_DEP_A.h index 0eefe87e7..7eca49447 100644 --- a/c/include/libsbp/navigation/MSG_BASELINE_ECEF_DEP_A.h +++ b/c/include/libsbp/navigation/MSG_BASELINE_ECEF_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_BASELINE_ECEF_DEP_A_H #define LIBSBP_NAVIGATION_MSG_BASELINE_ECEF_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,63 +40,53 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Baseline ECEF X coordinate [mm] + * Baseline ECEF X coordinate [mm] */ s32 x; - /** -* Baseline ECEF Y coordinate [mm] + * Baseline ECEF Y coordinate [mm] */ s32 y; - /** -* Baseline ECEF Z coordinate [mm] + * Baseline ECEF Z coordinate [mm] */ s32 z; - /** - * Position accuracy estimate [mm] + * Position accuracy estimate [mm] */ u16 accuracy; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_baseline_ecef_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_baseline_ecef_dep_a_t * * @param msg sbp_msg_baseline_ecef_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_baseline_ecef_dep_a_encoded_len(const sbp_msg_baseline_ecef_dep_a_t *msg) -{ +static inline size_t sbp_msg_baseline_ecef_dep_a_encoded_len( + const sbp_msg_baseline_ecef_dep_a_t *msg) { (void)msg; return SBP_MSG_BASELINE_ECEF_DEP_A_ENCODED_LEN; } @@ -104,36 +94,54 @@ static inline size_t sbp_msg_baseline_ecef_dep_a_encoded_len(const sbp_msg_basel /** * Encode an instance of sbp_msg_baseline_ecef_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_baseline_ecef_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_ecef_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_ecef_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_baseline_ecef_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_baseline_ecef_dep_a_t *msg); /** * Decode an instance of sbp_msg_baseline_ecef_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_baseline_ecef_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_baseline_ecef_dep_a_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_baseline_ecef_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_ecef_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_baseline_ecef_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_baseline_ecef_dep_a_t *msg); /** - * Send an instance of sbp_msg_baseline_ecef_dep_a_t with the given write function + * Send an instance of sbp_msg_baseline_ecef_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_baseline_ecef_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_baseline_ecef_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -141,51 +149,62 @@ SBP_EXPORT s8 sbp_msg_baseline_ecef_dep_a_decode(const uint8_t *buf, uint8_t len * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_ecef_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_ecef_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_baseline_ecef_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_ecef_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_baseline_ecef_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_baseline_ecef_dep_a_t instance * @param b sbp_msg_baseline_ecef_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_baseline_ecef_dep_a_cmp(const sbp_msg_baseline_ecef_dep_a_t *a, const sbp_msg_baseline_ecef_dep_a_t *b); +SBP_EXPORT int sbp_msg_baseline_ecef_dep_a_cmp( + const sbp_msg_baseline_ecef_dep_a_t *a, + const sbp_msg_baseline_ecef_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_baseline_ecef_dep_a_t &lhs, const sbp_msg_baseline_ecef_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_baseline_ecef_dep_a_t &lhs, + const sbp_msg_baseline_ecef_dep_a_t &rhs) { return sbp_msg_baseline_ecef_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_baseline_ecef_dep_a_t &lhs, const sbp_msg_baseline_ecef_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_baseline_ecef_dep_a_t &lhs, + const sbp_msg_baseline_ecef_dep_a_t &rhs) { return sbp_msg_baseline_ecef_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_baseline_ecef_dep_a_t &lhs, const sbp_msg_baseline_ecef_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_baseline_ecef_dep_a_t &lhs, + const sbp_msg_baseline_ecef_dep_a_t &rhs) { return sbp_msg_baseline_ecef_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_baseline_ecef_dep_a_t &lhs, const sbp_msg_baseline_ecef_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_baseline_ecef_dep_a_t &lhs, + const sbp_msg_baseline_ecef_dep_a_t &rhs) { return sbp_msg_baseline_ecef_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_baseline_ecef_dep_a_t &lhs, const sbp_msg_baseline_ecef_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_baseline_ecef_dep_a_t &lhs, + const sbp_msg_baseline_ecef_dep_a_t &rhs) { return sbp_msg_baseline_ecef_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_baseline_ecef_dep_a_t &lhs, const sbp_msg_baseline_ecef_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_baseline_ecef_dep_a_t &lhs, + const sbp_msg_baseline_ecef_dep_a_t &rhs) { return sbp_msg_baseline_ecef_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_BASELINE_ECEF_DEP_A_H */ - diff --git a/c/include/libsbp/navigation/MSG_BASELINE_HEADING_DEP_A.h b/c/include/libsbp/navigation/MSG_BASELINE_HEADING_DEP_A.h index c87679f76..95cbde33a 100644 --- a/c/include/libsbp/navigation/MSG_BASELINE_HEADING_DEP_A.h +++ b/c/include/libsbp/navigation/MSG_BASELINE_HEADING_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_BASELINE_HEADING_DEP_A_H #define LIBSBP_NAVIGATION_MSG_BASELINE_HEADING_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,45 +40,38 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Heading [mdeg] + * Heading [mdeg] */ u32 heading; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_baseline_heading_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_baseline_heading_dep_a_t * * @param msg sbp_msg_baseline_heading_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_baseline_heading_dep_a_encoded_len(const sbp_msg_baseline_heading_dep_a_t *msg) -{ +static inline size_t sbp_msg_baseline_heading_dep_a_encoded_len( + const sbp_msg_baseline_heading_dep_a_t *msg) { (void)msg; return SBP_MSG_BASELINE_HEADING_DEP_A_ENCODED_LEN; } @@ -86,36 +79,56 @@ static inline size_t sbp_msg_baseline_heading_dep_a_encoded_len(const sbp_msg_ba /** * Encode an instance of sbp_msg_baseline_heading_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_baseline_heading_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_heading_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_heading_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_baseline_heading_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_baseline_heading_dep_a_t *msg); /** - * Decode an instance of sbp_msg_baseline_heading_dep_a_t from wire representation + * Decode an instance of sbp_msg_baseline_heading_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_baseline_heading_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_baseline_heading_dep_a_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_baseline_heading_dep_a_t instance + * @param buf Wire representation of the sbp_msg_baseline_heading_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_heading_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_heading_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_baseline_heading_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_baseline_heading_dep_a_t *msg); /** - * Send an instance of sbp_msg_baseline_heading_dep_a_t with the given write function + * Send an instance of sbp_msg_baseline_heading_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_baseline_heading_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_baseline_heading_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -123,51 +136,62 @@ SBP_EXPORT s8 sbp_msg_baseline_heading_dep_a_decode(const uint8_t *buf, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_heading_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_heading_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_baseline_heading_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_heading_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_baseline_heading_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_baseline_heading_dep_a_t instance * @param b sbp_msg_baseline_heading_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_baseline_heading_dep_a_cmp(const sbp_msg_baseline_heading_dep_a_t *a, const sbp_msg_baseline_heading_dep_a_t *b); +SBP_EXPORT int sbp_msg_baseline_heading_dep_a_cmp( + const sbp_msg_baseline_heading_dep_a_t *a, + const sbp_msg_baseline_heading_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_baseline_heading_dep_a_t &lhs, const sbp_msg_baseline_heading_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_baseline_heading_dep_a_t &lhs, + const sbp_msg_baseline_heading_dep_a_t &rhs) { return sbp_msg_baseline_heading_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_baseline_heading_dep_a_t &lhs, const sbp_msg_baseline_heading_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_baseline_heading_dep_a_t &lhs, + const sbp_msg_baseline_heading_dep_a_t &rhs) { return sbp_msg_baseline_heading_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_baseline_heading_dep_a_t &lhs, const sbp_msg_baseline_heading_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_baseline_heading_dep_a_t &lhs, + const sbp_msg_baseline_heading_dep_a_t &rhs) { return sbp_msg_baseline_heading_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_baseline_heading_dep_a_t &lhs, const sbp_msg_baseline_heading_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_baseline_heading_dep_a_t &lhs, + const sbp_msg_baseline_heading_dep_a_t &rhs) { return sbp_msg_baseline_heading_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_baseline_heading_dep_a_t &lhs, const sbp_msg_baseline_heading_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_baseline_heading_dep_a_t &lhs, + const sbp_msg_baseline_heading_dep_a_t &rhs) { return sbp_msg_baseline_heading_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_baseline_heading_dep_a_t &lhs, const sbp_msg_baseline_heading_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_baseline_heading_dep_a_t &lhs, + const sbp_msg_baseline_heading_dep_a_t &rhs) { return sbp_msg_baseline_heading_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_BASELINE_HEADING_DEP_A_H */ - diff --git a/c/include/libsbp/navigation/MSG_BASELINE_NED.h b/c/include/libsbp/navigation/MSG_BASELINE_NED.h index f0866dca9..a8988323c 100644 --- a/c/include/libsbp/navigation/MSG_BASELINE_NED.h +++ b/c/include/libsbp/navigation/MSG_BASELINE_NED.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_BASELINE_NED_H #define LIBSBP_NAVIGATION_MSG_BASELINE_NED_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,70 +40,64 @@ *****************************************************************************/ /** GNSS-only Baseline in NED * - * This message reports the baseline solution in North East Down (NED) coordinates. This baseline is the relative vector distance from the base station to the rover receiver, and NED coordinate system is defined at the local WGS84 tangent plane centered at the base station position. The full GPS time is given by the preceding MSG_GPS_TIME with the matching time-of-week (tow). - * + * This message reports the baseline solution in North East Down (NED) + * coordinates. This baseline is the relative vector distance from the base + * station to the rover receiver, and NED coordinate system is defined at the + * local WGS84 tangent plane centered at the base station position. The full + * GPS time is given by the preceding MSG_GPS_TIME with the matching + * time-of-week (tow). + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Baseline North coordinate [mm] + * Baseline North coordinate [mm] */ s32 n; - /** -* Baseline East coordinate [mm] + * Baseline East coordinate [mm] */ s32 e; - /** -* Baseline Down coordinate [mm] + * Baseline Down coordinate [mm] */ s32 d; - /** -* Horizontal position estimated standard deviation [mm] + * Horizontal position estimated standard deviation [mm] */ u16 h_accuracy; - /** -* Vertical position estimated standard deviation [mm] + * Vertical position estimated standard deviation [mm] */ u16 v_accuracy; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_baseline_ned_t; - - /** * Get encoded size of an instance of sbp_msg_baseline_ned_t * * @param msg sbp_msg_baseline_ned_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_baseline_ned_encoded_len(const sbp_msg_baseline_ned_t *msg) -{ +static inline size_t sbp_msg_baseline_ned_encoded_len( + const sbp_msg_baseline_ned_t *msg) { (void)msg; return SBP_MSG_BASELINE_NED_ENCODED_LEN; } @@ -111,36 +105,53 @@ static inline size_t sbp_msg_baseline_ned_encoded_len(const sbp_msg_baseline_ned /** * Encode an instance of sbp_msg_baseline_ned_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_baseline_ned_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_ned_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_ned_t *msg); +SBP_EXPORT s8 sbp_msg_baseline_ned_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_baseline_ned_t *msg); /** * Decode an instance of sbp_msg_baseline_ned_t from wire representation * - * This function decodes the wire representation of a sbp_msg_baseline_ned_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_baseline_ned_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_baseline_ned_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_ned_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_ned_t *msg); +SBP_EXPORT s8 sbp_msg_baseline_ned_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_baseline_ned_t *msg); /** * Send an instance of sbp_msg_baseline_ned_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_baseline_ned_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_baseline_ned_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -148,51 +159,61 @@ SBP_EXPORT s8 sbp_msg_baseline_ned_decode(const uint8_t *buf, uint8_t len, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_ned_send(sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_ned_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_baseline_ned_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_baseline_ned_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_baseline_ned_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_baseline_ned_t instance * @param b sbp_msg_baseline_ned_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_baseline_ned_cmp(const sbp_msg_baseline_ned_t *a, const sbp_msg_baseline_ned_t *b); +SBP_EXPORT int sbp_msg_baseline_ned_cmp(const sbp_msg_baseline_ned_t *a, + const sbp_msg_baseline_ned_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_baseline_ned_t &lhs, const sbp_msg_baseline_ned_t &rhs) { +static inline bool operator==(const sbp_msg_baseline_ned_t &lhs, + const sbp_msg_baseline_ned_t &rhs) { return sbp_msg_baseline_ned_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_baseline_ned_t &lhs, const sbp_msg_baseline_ned_t &rhs) { +static inline bool operator!=(const sbp_msg_baseline_ned_t &lhs, + const sbp_msg_baseline_ned_t &rhs) { return sbp_msg_baseline_ned_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_baseline_ned_t &lhs, const sbp_msg_baseline_ned_t &rhs) { +static inline bool operator<(const sbp_msg_baseline_ned_t &lhs, + const sbp_msg_baseline_ned_t &rhs) { return sbp_msg_baseline_ned_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_baseline_ned_t &lhs, const sbp_msg_baseline_ned_t &rhs) { +static inline bool operator<=(const sbp_msg_baseline_ned_t &lhs, + const sbp_msg_baseline_ned_t &rhs) { return sbp_msg_baseline_ned_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_baseline_ned_t &lhs, const sbp_msg_baseline_ned_t &rhs) { +static inline bool operator>(const sbp_msg_baseline_ned_t &lhs, + const sbp_msg_baseline_ned_t &rhs) { return sbp_msg_baseline_ned_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_baseline_ned_t &lhs, const sbp_msg_baseline_ned_t &rhs) { +static inline bool operator>=(const sbp_msg_baseline_ned_t &lhs, + const sbp_msg_baseline_ned_t &rhs) { return sbp_msg_baseline_ned_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_BASELINE_NED_H */ - diff --git a/c/include/libsbp/navigation/MSG_BASELINE_NED_DEP_A.h b/c/include/libsbp/navigation/MSG_BASELINE_NED_DEP_A.h index 28d82887b..ee4cb9b50 100644 --- a/c/include/libsbp/navigation/MSG_BASELINE_NED_DEP_A.h +++ b/c/include/libsbp/navigation/MSG_BASELINE_NED_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_BASELINE_NED_DEP_A_H #define LIBSBP_NAVIGATION_MSG_BASELINE_NED_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,69 +40,59 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Baseline North coordinate [mm] + * Baseline North coordinate [mm] */ s32 n; - /** -* Baseline East coordinate [mm] + * Baseline East coordinate [mm] */ s32 e; - /** -* Baseline Down coordinate [mm] + * Baseline Down coordinate [mm] */ s32 d; - /** - * Horizontal position accuracy estimate (not implemented). Defaults to 0. [mm] + * Horizontal position accuracy estimate (not implemented). Defaults to 0. + * [mm] */ u16 h_accuracy; - /** - * Vertical position accuracy estimate (not implemented). Defaults to 0. [mm] + * Vertical position accuracy estimate (not implemented). Defaults to 0. [mm] */ u16 v_accuracy; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_baseline_ned_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_baseline_ned_dep_a_t * * @param msg sbp_msg_baseline_ned_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_baseline_ned_dep_a_encoded_len(const sbp_msg_baseline_ned_dep_a_t *msg) -{ +static inline size_t sbp_msg_baseline_ned_dep_a_encoded_len( + const sbp_msg_baseline_ned_dep_a_t *msg) { (void)msg; return SBP_MSG_BASELINE_NED_DEP_A_ENCODED_LEN; } @@ -110,36 +100,54 @@ static inline size_t sbp_msg_baseline_ned_dep_a_encoded_len(const sbp_msg_baseli /** * Encode an instance of sbp_msg_baseline_ned_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_baseline_ned_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_ned_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_ned_dep_a_t *msg); +SBP_EXPORT s8 +sbp_msg_baseline_ned_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_baseline_ned_dep_a_t *msg); /** * Decode an instance of sbp_msg_baseline_ned_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_baseline_ned_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_baseline_ned_dep_a_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_baseline_ned_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_ned_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_ned_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_baseline_ned_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_baseline_ned_dep_a_t *msg); /** - * Send an instance of sbp_msg_baseline_ned_dep_a_t with the given write function + * Send an instance of sbp_msg_baseline_ned_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_baseline_ned_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_baseline_ned_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -147,51 +155,62 @@ SBP_EXPORT s8 sbp_msg_baseline_ned_dep_a_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_ned_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_ned_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_baseline_ned_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_ned_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_baseline_ned_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_baseline_ned_dep_a_t instance * @param b sbp_msg_baseline_ned_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_baseline_ned_dep_a_cmp(const sbp_msg_baseline_ned_dep_a_t *a, const sbp_msg_baseline_ned_dep_a_t *b); +SBP_EXPORT int sbp_msg_baseline_ned_dep_a_cmp( + const sbp_msg_baseline_ned_dep_a_t *a, + const sbp_msg_baseline_ned_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_baseline_ned_dep_a_t &lhs, const sbp_msg_baseline_ned_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_baseline_ned_dep_a_t &lhs, + const sbp_msg_baseline_ned_dep_a_t &rhs) { return sbp_msg_baseline_ned_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_baseline_ned_dep_a_t &lhs, const sbp_msg_baseline_ned_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_baseline_ned_dep_a_t &lhs, + const sbp_msg_baseline_ned_dep_a_t &rhs) { return sbp_msg_baseline_ned_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_baseline_ned_dep_a_t &lhs, const sbp_msg_baseline_ned_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_baseline_ned_dep_a_t &lhs, + const sbp_msg_baseline_ned_dep_a_t &rhs) { return sbp_msg_baseline_ned_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_baseline_ned_dep_a_t &lhs, const sbp_msg_baseline_ned_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_baseline_ned_dep_a_t &lhs, + const sbp_msg_baseline_ned_dep_a_t &rhs) { return sbp_msg_baseline_ned_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_baseline_ned_dep_a_t &lhs, const sbp_msg_baseline_ned_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_baseline_ned_dep_a_t &lhs, + const sbp_msg_baseline_ned_dep_a_t &rhs) { return sbp_msg_baseline_ned_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_baseline_ned_dep_a_t &lhs, const sbp_msg_baseline_ned_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_baseline_ned_dep_a_t &lhs, + const sbp_msg_baseline_ned_dep_a_t &rhs) { return sbp_msg_baseline_ned_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_BASELINE_NED_DEP_A_H */ - diff --git a/c/include/libsbp/navigation/MSG_DOPS.h b/c/include/libsbp/navigation/MSG_DOPS.h index c95da8cf8..befa69cdc 100644 --- a/c/include/libsbp/navigation/MSG_DOPS.h +++ b/c/include/libsbp/navigation/MSG_DOPS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_DOPS_H #define LIBSBP_NAVIGATION_MSG_DOPS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,64 +40,56 @@ *****************************************************************************/ /** GNSS-only Dilution of Precision * - * This dilution of precision (DOP) message describes the effect of navigation satellite geometry on positional measurement precision. The flags field indicated whether the DOP reported corresponds to differential or SPP solution. - * + * This dilution of precision (DOP) message describes the effect of navigation + * satellite geometry on positional measurement precision. The flags field + * indicated whether the DOP reported corresponds to differential or SPP + * solution. + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Geometric Dilution of Precision [0.01] + * Geometric Dilution of Precision [0.01] */ u16 gdop; - /** -* Position Dilution of Precision [0.01] + * Position Dilution of Precision [0.01] */ u16 pdop; - /** -* Time Dilution of Precision [0.01] + * Time Dilution of Precision [0.01] */ u16 tdop; - /** -* Horizontal Dilution of Precision [0.01] + * Horizontal Dilution of Precision [0.01] */ u16 hdop; - /** -* Vertical Dilution of Precision [0.01] + * Vertical Dilution of Precision [0.01] */ u16 vdop; - /** -* Indicates the position solution with which the DOPS message corresponds + * Indicates the position solution with which the DOPS message corresponds */ u8 flags; } sbp_msg_dops_t; - - /** * Get encoded size of an instance of sbp_msg_dops_t * * @param msg sbp_msg_dops_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_dops_encoded_len(const sbp_msg_dops_t *msg) -{ +static inline size_t sbp_msg_dops_encoded_len(const sbp_msg_dops_t *msg) { (void)msg; return SBP_MSG_DOPS_ENCODED_LEN; } @@ -105,36 +97,51 @@ static inline size_t sbp_msg_dops_encoded_len(const sbp_msg_dops_t *msg) /** * Encode an instance of sbp_msg_dops_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_dops_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_dops_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_dops_t *msg); +SBP_EXPORT s8 sbp_msg_dops_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_dops_t *msg); /** * Decode an instance of sbp_msg_dops_t from wire representation * - * This function decodes the wire representation of a sbp_msg_dops_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_dops_t message to + * the given instance. The caller must specify the length of the buffer in the + * \p len parameter. If non-null the number of bytes read from the buffer will + * be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_dops_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_dops_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_dops_t *msg); +SBP_EXPORT s8 sbp_msg_dops_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_dops_t *msg); /** * Send an instance of sbp_msg_dops_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_dops_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_dops_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -142,51 +149,61 @@ SBP_EXPORT s8 sbp_msg_dops_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_dops_send(sbp_state_t *s, u16 sender_id, const sbp_msg_dops_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_dops_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_dops_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_dops_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_dops_t instance * @param b sbp_msg_dops_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_dops_cmp(const sbp_msg_dops_t *a, const sbp_msg_dops_t *b); +SBP_EXPORT int sbp_msg_dops_cmp(const sbp_msg_dops_t *a, + const sbp_msg_dops_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_dops_t &lhs, const sbp_msg_dops_t &rhs) { +static inline bool operator==(const sbp_msg_dops_t &lhs, + const sbp_msg_dops_t &rhs) { return sbp_msg_dops_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_dops_t &lhs, const sbp_msg_dops_t &rhs) { +static inline bool operator!=(const sbp_msg_dops_t &lhs, + const sbp_msg_dops_t &rhs) { return sbp_msg_dops_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_dops_t &lhs, const sbp_msg_dops_t &rhs) { +static inline bool operator<(const sbp_msg_dops_t &lhs, + const sbp_msg_dops_t &rhs) { return sbp_msg_dops_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_dops_t &lhs, const sbp_msg_dops_t &rhs) { +static inline bool operator<=(const sbp_msg_dops_t &lhs, + const sbp_msg_dops_t &rhs) { return sbp_msg_dops_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_dops_t &lhs, const sbp_msg_dops_t &rhs) { +static inline bool operator>(const sbp_msg_dops_t &lhs, + const sbp_msg_dops_t &rhs) { return sbp_msg_dops_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_dops_t &lhs, const sbp_msg_dops_t &rhs) { +static inline bool operator>=(const sbp_msg_dops_t &lhs, + const sbp_msg_dops_t &rhs) { return sbp_msg_dops_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_DOPS_H */ - diff --git a/c/include/libsbp/navigation/MSG_DOPS_DEP_A.h b/c/include/libsbp/navigation/MSG_DOPS_DEP_A.h index d371d60e8..74f280d49 100644 --- a/c/include/libsbp/navigation/MSG_DOPS_DEP_A.h +++ b/c/include/libsbp/navigation/MSG_DOPS_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_DOPS_DEP_A_H #define LIBSBP_NAVIGATION_MSG_DOPS_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,57 +40,48 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Geometric Dilution of Precision [0.01] + * Geometric Dilution of Precision [0.01] */ u16 gdop; - /** -* Position Dilution of Precision [0.01] + * Position Dilution of Precision [0.01] */ u16 pdop; - /** -* Time Dilution of Precision [0.01] + * Time Dilution of Precision [0.01] */ u16 tdop; - /** -* Horizontal Dilution of Precision [0.01] + * Horizontal Dilution of Precision [0.01] */ u16 hdop; - /** -* Vertical Dilution of Precision [0.01] + * Vertical Dilution of Precision [0.01] */ u16 vdop; } sbp_msg_dops_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_dops_dep_a_t * * @param msg sbp_msg_dops_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_dops_dep_a_encoded_len(const sbp_msg_dops_dep_a_t *msg) -{ +static inline size_t sbp_msg_dops_dep_a_encoded_len( + const sbp_msg_dops_dep_a_t *msg) { (void)msg; return SBP_MSG_DOPS_DEP_A_ENCODED_LEN; } @@ -98,36 +89,53 @@ static inline size_t sbp_msg_dops_dep_a_encoded_len(const sbp_msg_dops_dep_a_t * /** * Encode an instance of sbp_msg_dops_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_dops_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_dops_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_dops_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_dops_dep_a_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_dops_dep_a_t *msg); /** * Decode an instance of sbp_msg_dops_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_dops_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_dops_dep_a_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_dops_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_dops_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_dops_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_dops_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_dops_dep_a_t *msg); /** * Send an instance of sbp_msg_dops_dep_a_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_dops_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_dops_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -135,51 +143,61 @@ SBP_EXPORT s8 sbp_msg_dops_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_dops_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_dops_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_dops_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_dops_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_dops_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_dops_dep_a_t instance * @param b sbp_msg_dops_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_dops_dep_a_cmp(const sbp_msg_dops_dep_a_t *a, const sbp_msg_dops_dep_a_t *b); +SBP_EXPORT int sbp_msg_dops_dep_a_cmp(const sbp_msg_dops_dep_a_t *a, + const sbp_msg_dops_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_dops_dep_a_t &lhs, const sbp_msg_dops_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_dops_dep_a_t &lhs, + const sbp_msg_dops_dep_a_t &rhs) { return sbp_msg_dops_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_dops_dep_a_t &lhs, const sbp_msg_dops_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_dops_dep_a_t &lhs, + const sbp_msg_dops_dep_a_t &rhs) { return sbp_msg_dops_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_dops_dep_a_t &lhs, const sbp_msg_dops_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_dops_dep_a_t &lhs, + const sbp_msg_dops_dep_a_t &rhs) { return sbp_msg_dops_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_dops_dep_a_t &lhs, const sbp_msg_dops_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_dops_dep_a_t &lhs, + const sbp_msg_dops_dep_a_t &rhs) { return sbp_msg_dops_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_dops_dep_a_t &lhs, const sbp_msg_dops_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_dops_dep_a_t &lhs, + const sbp_msg_dops_dep_a_t &rhs) { return sbp_msg_dops_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_dops_dep_a_t &lhs, const sbp_msg_dops_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_dops_dep_a_t &lhs, + const sbp_msg_dops_dep_a_t &rhs) { return sbp_msg_dops_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_DOPS_DEP_A_H */ - diff --git a/c/include/libsbp/navigation/MSG_GPS_TIME.h b/c/include/libsbp/navigation/MSG_GPS_TIME.h index 07318cb97..132ea796a 100644 --- a/c/include/libsbp/navigation/MSG_GPS_TIME.h +++ b/c/include/libsbp/navigation/MSG_GPS_TIME.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_GPS_TIME_H #define LIBSBP_NAVIGATION_MSG_GPS_TIME_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,48 +40,50 @@ *****************************************************************************/ /** GPS Time (GNSS + inertial) * - * This message reports the GPS time, representing the time since the GPS epoch began on midnight January 6, 1980 UTC. GPS time counts the weeks and seconds of the week. The weeks begin at the Saturday/Sunday transition. GPS week 0 began at the beginning of the GPS time scale. - * - * Within each week number, the GPS time of the week is between between 0 and 604800 seconds (=60*60*24*7). Note that GPS time does not accumulate leap seconds, and as of now, has a small offset from UTC. In a message stream, this message precedes a set of other navigation messages referenced to the same time (but lacking the ns field) and indicates a more precise time of these messages. - * + * This message reports the GPS time, representing the time since the GPS epoch + * began on midnight January 6, 1980 UTC. GPS time counts the weeks and seconds + * of the week. The weeks begin at the Saturday/Sunday transition. GPS week 0 + * began at the beginning of the GPS time scale. + * + * Within each week number, the GPS time of the week is between between 0 and + * 604800 seconds (=60*60*24*7). Note that GPS time does not accumulate leap + * seconds, and as of now, has a small offset from UTC. In a message stream, + * this message precedes a set of other navigation messages referenced to the + * same time (but lacking the ns field) and indicates a more precise time of + * these messages. + * */ typedef struct { - - /** -* GPS week number [weeks] + * GPS week number [weeks] */ u16 wn; - /** -* GPS time of week rounded to the nearest millisecond [ms] + * GPS time of week rounded to the nearest millisecond [ms] */ u32 tow; - /** - * Nanosecond residual of millisecond-rounded TOW (ranges from -500000 to 500000) [ns] + * Nanosecond residual of millisecond-rounded TOW (ranges from -500000 to + * 500000) [ns] */ s32 ns_residual; - /** -* Status flags (reserved) + * Status flags (reserved) */ u8 flags; } sbp_msg_gps_time_t; - - /** * Get encoded size of an instance of sbp_msg_gps_time_t * * @param msg sbp_msg_gps_time_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_gps_time_encoded_len(const sbp_msg_gps_time_t *msg) -{ +static inline size_t sbp_msg_gps_time_encoded_len( + const sbp_msg_gps_time_t *msg) { (void)msg; return SBP_MSG_GPS_TIME_ENCODED_LEN; } @@ -89,36 +91,52 @@ static inline size_t sbp_msg_gps_time_encoded_len(const sbp_msg_gps_time_t *msg) /** * Encode an instance of sbp_msg_gps_time_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_gps_time_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_gps_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_gps_time_t *msg); +SBP_EXPORT s8 sbp_msg_gps_time_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_gps_time_t *msg); /** * Decode an instance of sbp_msg_gps_time_t from wire representation * - * This function decodes the wire representation of a sbp_msg_gps_time_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_gps_time_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_gps_time_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_gps_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_gps_time_t *msg); +SBP_EXPORT s8 sbp_msg_gps_time_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_gps_time_t *msg); /** * Send an instance of sbp_msg_gps_time_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_gps_time_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_gps_time_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -126,51 +144,61 @@ SBP_EXPORT s8 sbp_msg_gps_time_decode(const uint8_t *buf, uint8_t len, uint8_t * * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_gps_time_send(sbp_state_t *s, u16 sender_id, const sbp_msg_gps_time_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_gps_time_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_gps_time_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_gps_time_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_gps_time_t instance * @param b sbp_msg_gps_time_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_gps_time_cmp(const sbp_msg_gps_time_t *a, const sbp_msg_gps_time_t *b); +SBP_EXPORT int sbp_msg_gps_time_cmp(const sbp_msg_gps_time_t *a, + const sbp_msg_gps_time_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_gps_time_t &lhs, const sbp_msg_gps_time_t &rhs) { +static inline bool operator==(const sbp_msg_gps_time_t &lhs, + const sbp_msg_gps_time_t &rhs) { return sbp_msg_gps_time_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_gps_time_t &lhs, const sbp_msg_gps_time_t &rhs) { +static inline bool operator!=(const sbp_msg_gps_time_t &lhs, + const sbp_msg_gps_time_t &rhs) { return sbp_msg_gps_time_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_gps_time_t &lhs, const sbp_msg_gps_time_t &rhs) { +static inline bool operator<(const sbp_msg_gps_time_t &lhs, + const sbp_msg_gps_time_t &rhs) { return sbp_msg_gps_time_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_gps_time_t &lhs, const sbp_msg_gps_time_t &rhs) { +static inline bool operator<=(const sbp_msg_gps_time_t &lhs, + const sbp_msg_gps_time_t &rhs) { return sbp_msg_gps_time_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_gps_time_t &lhs, const sbp_msg_gps_time_t &rhs) { +static inline bool operator>(const sbp_msg_gps_time_t &lhs, + const sbp_msg_gps_time_t &rhs) { return sbp_msg_gps_time_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_gps_time_t &lhs, const sbp_msg_gps_time_t &rhs) { +static inline bool operator>=(const sbp_msg_gps_time_t &lhs, + const sbp_msg_gps_time_t &rhs) { return sbp_msg_gps_time_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_GPS_TIME_H */ - diff --git a/c/include/libsbp/navigation/MSG_GPS_TIME_DEP_A.h b/c/include/libsbp/navigation/MSG_GPS_TIME_DEP_A.h index efe166960..ac93bfca1 100644 --- a/c/include/libsbp/navigation/MSG_GPS_TIME_DEP_A.h +++ b/c/include/libsbp/navigation/MSG_GPS_TIME_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_GPS_TIME_DEP_A_H #define LIBSBP_NAVIGATION_MSG_GPS_TIME_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,45 +40,39 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* GPS week number [weeks] + * GPS week number [weeks] */ u16 wn; - /** -* GPS time of week rounded to the nearest millisecond [ms] + * GPS time of week rounded to the nearest millisecond [ms] */ u32 tow; - /** - * Nanosecond residual of millisecond-rounded TOW (ranges from -500000 to 500000) [ns] + * Nanosecond residual of millisecond-rounded TOW (ranges from -500000 to + * 500000) [ns] */ s32 ns_residual; - /** -* Status flags (reserved) + * Status flags (reserved) */ u8 flags; } sbp_msg_gps_time_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_gps_time_dep_a_t * * @param msg sbp_msg_gps_time_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_gps_time_dep_a_encoded_len(const sbp_msg_gps_time_dep_a_t *msg) -{ +static inline size_t sbp_msg_gps_time_dep_a_encoded_len( + const sbp_msg_gps_time_dep_a_t *msg) { (void)msg; return SBP_MSG_GPS_TIME_DEP_A_ENCODED_LEN; } @@ -86,36 +80,53 @@ static inline size_t sbp_msg_gps_time_dep_a_encoded_len(const sbp_msg_gps_time_d /** * Encode an instance of sbp_msg_gps_time_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_gps_time_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_gps_time_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_gps_time_dep_a_t *msg); +SBP_EXPORT s8 +sbp_msg_gps_time_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_gps_time_dep_a_t *msg); /** * Decode an instance of sbp_msg_gps_time_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_gps_time_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_gps_time_dep_a_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_gps_time_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_gps_time_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_gps_time_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_gps_time_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_gps_time_dep_a_t *msg); /** * Send an instance of sbp_msg_gps_time_dep_a_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_gps_time_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_gps_time_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -123,51 +134,61 @@ SBP_EXPORT s8 sbp_msg_gps_time_dep_a_decode(const uint8_t *buf, uint8_t len, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_gps_time_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_gps_time_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_gps_time_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_gps_time_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_gps_time_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_gps_time_dep_a_t instance * @param b sbp_msg_gps_time_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_gps_time_dep_a_cmp(const sbp_msg_gps_time_dep_a_t *a, const sbp_msg_gps_time_dep_a_t *b); +SBP_EXPORT int sbp_msg_gps_time_dep_a_cmp(const sbp_msg_gps_time_dep_a_t *a, + const sbp_msg_gps_time_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_gps_time_dep_a_t &lhs, const sbp_msg_gps_time_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_gps_time_dep_a_t &lhs, + const sbp_msg_gps_time_dep_a_t &rhs) { return sbp_msg_gps_time_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_gps_time_dep_a_t &lhs, const sbp_msg_gps_time_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_gps_time_dep_a_t &lhs, + const sbp_msg_gps_time_dep_a_t &rhs) { return sbp_msg_gps_time_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_gps_time_dep_a_t &lhs, const sbp_msg_gps_time_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_gps_time_dep_a_t &lhs, + const sbp_msg_gps_time_dep_a_t &rhs) { return sbp_msg_gps_time_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_gps_time_dep_a_t &lhs, const sbp_msg_gps_time_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_gps_time_dep_a_t &lhs, + const sbp_msg_gps_time_dep_a_t &rhs) { return sbp_msg_gps_time_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_gps_time_dep_a_t &lhs, const sbp_msg_gps_time_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_gps_time_dep_a_t &lhs, + const sbp_msg_gps_time_dep_a_t &rhs) { return sbp_msg_gps_time_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_gps_time_dep_a_t &lhs, const sbp_msg_gps_time_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_gps_time_dep_a_t &lhs, + const sbp_msg_gps_time_dep_a_t &rhs) { return sbp_msg_gps_time_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_GPS_TIME_DEP_A_H */ - diff --git a/c/include/libsbp/navigation/MSG_GPS_TIME_GNSS.h b/c/include/libsbp/navigation/MSG_GPS_TIME_GNSS.h index f5f0a74fe..854b6456b 100644 --- a/c/include/libsbp/navigation/MSG_GPS_TIME_GNSS.h +++ b/c/include/libsbp/navigation/MSG_GPS_TIME_GNSS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_GPS_TIME_GNSS_H #define LIBSBP_NAVIGATION_MSG_GPS_TIME_GNSS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,48 +40,50 @@ *****************************************************************************/ /** GNSS-only GPS Time * - * This message reports the GPS time, representing the time since the GPS epoch began on midnight January 6, 1980 UTC. GPS time counts the weeks and seconds of the week. The weeks begin at the Saturday/Sunday transition. GPS week 0 began at the beginning of the GPS time scale. - * - * Within each week number, the GPS time of the week is between between 0 and 604800 seconds (=60*60*24*7). Note that GPS time does not accumulate leap seconds, and as of now, has a small offset from UTC. In a message stream, this message precedes a set of other navigation messages referenced to the same time (but lacking the ns field) and indicates a more precise time of these messages. - * + * This message reports the GPS time, representing the time since the GPS epoch + * began on midnight January 6, 1980 UTC. GPS time counts the weeks and seconds + * of the week. The weeks begin at the Saturday/Sunday transition. GPS week 0 + * began at the beginning of the GPS time scale. + * + * Within each week number, the GPS time of the week is between between 0 and + * 604800 seconds (=60*60*24*7). Note that GPS time does not accumulate leap + * seconds, and as of now, has a small offset from UTC. In a message stream, + * this message precedes a set of other navigation messages referenced to the + * same time (but lacking the ns field) and indicates a more precise time of + * these messages. + * */ typedef struct { - - /** -* GPS week number [weeks] + * GPS week number [weeks] */ u16 wn; - /** -* GPS time of week rounded to the nearest millisecond [ms] + * GPS time of week rounded to the nearest millisecond [ms] */ u32 tow; - /** - * Nanosecond residual of millisecond-rounded TOW (ranges from -500000 to 500000) [ns] + * Nanosecond residual of millisecond-rounded TOW (ranges from -500000 to + * 500000) [ns] */ s32 ns_residual; - /** -* Status flags (reserved) + * Status flags (reserved) */ u8 flags; } sbp_msg_gps_time_gnss_t; - - /** * Get encoded size of an instance of sbp_msg_gps_time_gnss_t * * @param msg sbp_msg_gps_time_gnss_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_gps_time_gnss_encoded_len(const sbp_msg_gps_time_gnss_t *msg) -{ +static inline size_t sbp_msg_gps_time_gnss_encoded_len( + const sbp_msg_gps_time_gnss_t *msg) { (void)msg; return SBP_MSG_GPS_TIME_GNSS_ENCODED_LEN; } @@ -89,36 +91,53 @@ static inline size_t sbp_msg_gps_time_gnss_encoded_len(const sbp_msg_gps_time_gn /** * Encode an instance of sbp_msg_gps_time_gnss_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_gps_time_gnss_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_gps_time_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_gps_time_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_gps_time_gnss_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_gps_time_gnss_t *msg); /** * Decode an instance of sbp_msg_gps_time_gnss_t from wire representation * - * This function decodes the wire representation of a sbp_msg_gps_time_gnss_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_gps_time_gnss_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_gps_time_gnss_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_gps_time_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_gps_time_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_gps_time_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_gps_time_gnss_t *msg); /** * Send an instance of sbp_msg_gps_time_gnss_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_gps_time_gnss_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_gps_time_gnss_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -126,51 +145,61 @@ SBP_EXPORT s8 sbp_msg_gps_time_gnss_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_gps_time_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_gps_time_gnss_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_gps_time_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_gps_time_gnss_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_gps_time_gnss_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_gps_time_gnss_t instance * @param b sbp_msg_gps_time_gnss_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_gps_time_gnss_cmp(const sbp_msg_gps_time_gnss_t *a, const sbp_msg_gps_time_gnss_t *b); +SBP_EXPORT int sbp_msg_gps_time_gnss_cmp(const sbp_msg_gps_time_gnss_t *a, + const sbp_msg_gps_time_gnss_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_gps_time_gnss_t &lhs, const sbp_msg_gps_time_gnss_t &rhs) { +static inline bool operator==(const sbp_msg_gps_time_gnss_t &lhs, + const sbp_msg_gps_time_gnss_t &rhs) { return sbp_msg_gps_time_gnss_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_gps_time_gnss_t &lhs, const sbp_msg_gps_time_gnss_t &rhs) { +static inline bool operator!=(const sbp_msg_gps_time_gnss_t &lhs, + const sbp_msg_gps_time_gnss_t &rhs) { return sbp_msg_gps_time_gnss_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_gps_time_gnss_t &lhs, const sbp_msg_gps_time_gnss_t &rhs) { +static inline bool operator<(const sbp_msg_gps_time_gnss_t &lhs, + const sbp_msg_gps_time_gnss_t &rhs) { return sbp_msg_gps_time_gnss_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_gps_time_gnss_t &lhs, const sbp_msg_gps_time_gnss_t &rhs) { +static inline bool operator<=(const sbp_msg_gps_time_gnss_t &lhs, + const sbp_msg_gps_time_gnss_t &rhs) { return sbp_msg_gps_time_gnss_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_gps_time_gnss_t &lhs, const sbp_msg_gps_time_gnss_t &rhs) { +static inline bool operator>(const sbp_msg_gps_time_gnss_t &lhs, + const sbp_msg_gps_time_gnss_t &rhs) { return sbp_msg_gps_time_gnss_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_gps_time_gnss_t &lhs, const sbp_msg_gps_time_gnss_t &rhs) { +static inline bool operator>=(const sbp_msg_gps_time_gnss_t &lhs, + const sbp_msg_gps_time_gnss_t &rhs) { return sbp_msg_gps_time_gnss_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_GPS_TIME_GNSS_H */ - diff --git a/c/include/libsbp/navigation/MSG_POSE_RELATIVE.h b/c/include/libsbp/navigation/MSG_POSE_RELATIVE.h index 568929a50..2beb265c0 100644 --- a/c/include/libsbp/navigation/MSG_POSE_RELATIVE.h +++ b/c/include/libsbp/navigation/MSG_POSE_RELATIVE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_POSE_RELATIVE_H #define LIBSBP_NAVIGATION_MSG_POSE_RELATIVE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,153 +40,137 @@ *****************************************************************************/ /** Relative Pose * -* This solution message reports the relative pose of a sensor between two time instances. The relative pose comprises of a rotation and a translation which relates the sensor (e.g. camera) frame at a given time (first keyframe) to the sensor frame at another time (second keyframe). The relative translations is a 3x1 vector described in the first keyframe. Relative rotation is described by a quaternion from second keyframe to the first keyframe. + * This solution message reports the relative pose of a sensor between two time + * instances. The relative pose comprises of a rotation and a translation which + * relates the sensor (e.g. camera) frame at a given time (first keyframe) to + * the sensor frame at another time (second keyframe). The relative translations + * is a 3x1 vector described in the first keyframe. Relative rotation is + * described by a quaternion from second keyframe to the first keyframe. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* ID of the sensor producing this message + * ID of the sensor producing this message */ u8 sensor_id; - /** -* Timestamp of first keyframe [ms] + * Timestamp of first keyframe [ms] */ u32 timestamp_1; - /** -* Timestamp of second keyframe [ms] + * Timestamp of second keyframe [ms] */ u32 timestamp_2; - /** -* Relative translation [x,y,z] described in first keyframe [mm] + * Relative translation [x,y,z] described in first keyframe [mm] */ s32 trans[SBP_MSG_POSE_RELATIVE_TRANS_MAX]; - /** -* Real component of quaternion to describe relative rotation (second to first keyframe) [2^-31] + * Real component of quaternion to describe relative rotation (second to first + * keyframe) [2^-31] */ s32 w; - /** -* 1st imaginary component of quaternion to describe relative rotation (second to first keyframe) [2^-31] + * 1st imaginary component of quaternion to describe relative rotation (second + * to first keyframe) [2^-31] */ s32 x; - /** -* 2nd imaginary component of quaternion to describe relative rotation (second to first keyframe) [2^-31] + * 2nd imaginary component of quaternion to describe relative rotation (second + * to first keyframe) [2^-31] */ s32 y; - /** -* 3rd imaginary component of quaternion to describe relative rotation (second to first keyframe) [2^-31] + * 3rd imaginary component of quaternion to describe relative rotation (second + * to first keyframe) [2^-31] */ s32 z; - /** -* Estimated variance of x (relative translation) [m^2] + * Estimated variance of x (relative translation) [m^2] */ float cov_r_x_x; - /** -* Covariance of x and y (relative translation) [m^2] + * Covariance of x and y (relative translation) [m^2] */ float cov_r_x_y; - /** -* Covariance of x and z (relative translation) [m^2] + * Covariance of x and z (relative translation) [m^2] */ float cov_r_x_z; - /** -* Estimated variance of y (relative translation) [m^2] + * Estimated variance of y (relative translation) [m^2] */ float cov_r_y_y; - /** -* Covariance of y and z (relative translation) [m^2] + * Covariance of y and z (relative translation) [m^2] */ float cov_r_y_z; - /** -* Estimated variance of z (relative translation) [m^2] + * Estimated variance of z (relative translation) [m^2] */ float cov_r_z_z; - /** -* Estimated variance of x (relative rotation) [rad^2] + * Estimated variance of x (relative rotation) [rad^2] */ float cov_c_x_x; - /** -* Covariance of x and y (relative rotation) [rad^2] + * Covariance of x and y (relative rotation) [rad^2] */ float cov_c_x_y; - /** -* Covariance of x and z (relative rotation) [rad^2] + * Covariance of x and z (relative rotation) [rad^2] */ float cov_c_x_z; - /** -* Estimated variance of y (relative rotation) [rad^2] + * Estimated variance of y (relative rotation) [rad^2] */ float cov_c_y_y; - /** -* Covariance of y and z (relative rotation) [rad^2] + * Covariance of y and z (relative rotation) [rad^2] */ float cov_c_y_z; - /** -* Estimated variance of z (relative rotation) [rad^2] + * Estimated variance of z (relative rotation) [rad^2] */ float cov_c_z_z; - /** -* Status flags of relative translation and rotation + * Status flags of relative translation and rotation */ u8 flags; } sbp_msg_pose_relative_t; - - /** * Get encoded size of an instance of sbp_msg_pose_relative_t * * @param msg sbp_msg_pose_relative_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_pose_relative_encoded_len(const sbp_msg_pose_relative_t *msg) -{ +static inline size_t sbp_msg_pose_relative_encoded_len( + const sbp_msg_pose_relative_t *msg) { (void)msg; return SBP_MSG_POSE_RELATIVE_ENCODED_LEN; } @@ -194,36 +178,53 @@ static inline size_t sbp_msg_pose_relative_encoded_len(const sbp_msg_pose_relati /** * Encode an instance of sbp_msg_pose_relative_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_pose_relative_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pose_relative_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pose_relative_t *msg); +SBP_EXPORT s8 sbp_msg_pose_relative_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_pose_relative_t *msg); /** * Decode an instance of sbp_msg_pose_relative_t from wire representation * - * This function decodes the wire representation of a sbp_msg_pose_relative_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_pose_relative_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_pose_relative_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pose_relative_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pose_relative_t *msg); +SBP_EXPORT s8 sbp_msg_pose_relative_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_pose_relative_t *msg); /** * Send an instance of sbp_msg_pose_relative_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_pose_relative_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_pose_relative_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -231,51 +232,61 @@ SBP_EXPORT s8 sbp_msg_pose_relative_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pose_relative_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pose_relative_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_pose_relative_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pose_relative_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_pose_relative_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_pose_relative_t instance * @param b sbp_msg_pose_relative_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_pose_relative_cmp(const sbp_msg_pose_relative_t *a, const sbp_msg_pose_relative_t *b); +SBP_EXPORT int sbp_msg_pose_relative_cmp(const sbp_msg_pose_relative_t *a, + const sbp_msg_pose_relative_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_pose_relative_t &lhs, const sbp_msg_pose_relative_t &rhs) { +static inline bool operator==(const sbp_msg_pose_relative_t &lhs, + const sbp_msg_pose_relative_t &rhs) { return sbp_msg_pose_relative_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_pose_relative_t &lhs, const sbp_msg_pose_relative_t &rhs) { +static inline bool operator!=(const sbp_msg_pose_relative_t &lhs, + const sbp_msg_pose_relative_t &rhs) { return sbp_msg_pose_relative_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_pose_relative_t &lhs, const sbp_msg_pose_relative_t &rhs) { +static inline bool operator<(const sbp_msg_pose_relative_t &lhs, + const sbp_msg_pose_relative_t &rhs) { return sbp_msg_pose_relative_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_pose_relative_t &lhs, const sbp_msg_pose_relative_t &rhs) { +static inline bool operator<=(const sbp_msg_pose_relative_t &lhs, + const sbp_msg_pose_relative_t &rhs) { return sbp_msg_pose_relative_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_pose_relative_t &lhs, const sbp_msg_pose_relative_t &rhs) { +static inline bool operator>(const sbp_msg_pose_relative_t &lhs, + const sbp_msg_pose_relative_t &rhs) { return sbp_msg_pose_relative_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_pose_relative_t &lhs, const sbp_msg_pose_relative_t &rhs) { +static inline bool operator>=(const sbp_msg_pose_relative_t &lhs, + const sbp_msg_pose_relative_t &rhs) { return sbp_msg_pose_relative_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_POSE_RELATIVE_H */ - diff --git a/c/include/libsbp/navigation/MSG_POS_ECEF.h b/c/include/libsbp/navigation/MSG_POS_ECEF.h index adbfe54c6..a40747a77 100644 --- a/c/include/libsbp/navigation/MSG_POS_ECEF.h +++ b/c/include/libsbp/navigation/MSG_POS_ECEF.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_POS_ECEF_H #define LIBSBP_NAVIGATION_MSG_POS_ECEF_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,64 +40,60 @@ *****************************************************************************/ /** Position in ECEF * - * The position solution message reports absolute Earth Centered Earth Fixed (ECEF) coordinates and the status (single point vs pseudo-absolute RTK) of the position solution. If the rover receiver knows the surveyed position of the base station and has an RTK solution, this reports a pseudo-absolute position solution using the base station position and the rover's RTK baseline vector. The full GPS time is given by the preceding MSG_GPS_TIME with the matching time-of-week (tow). - * + * The position solution message reports absolute Earth Centered Earth Fixed + * (ECEF) coordinates and the status (single point vs pseudo-absolute RTK) of + * the position solution. If the rover receiver knows the surveyed position of + * the base station and has an RTK solution, this reports a pseudo-absolute + * position solution using the base station position and the rover's RTK + * baseline vector. The full GPS time is given by the preceding MSG_GPS_TIME + * with the matching time-of-week (tow). + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* ECEF X coordinate [m] + * ECEF X coordinate [m] */ double x; - /** -* ECEF Y coordinate [m] + * ECEF Y coordinate [m] */ double y; - /** -* ECEF Z coordinate [m] + * ECEF Z coordinate [m] */ double z; - /** -* Position estimated standard deviation [mm] + * Position estimated standard deviation [mm] */ u16 accuracy; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_pos_ecef_t; - - /** * Get encoded size of an instance of sbp_msg_pos_ecef_t * * @param msg sbp_msg_pos_ecef_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_pos_ecef_encoded_len(const sbp_msg_pos_ecef_t *msg) -{ +static inline size_t sbp_msg_pos_ecef_encoded_len( + const sbp_msg_pos_ecef_t *msg) { (void)msg; return SBP_MSG_POS_ECEF_ENCODED_LEN; } @@ -105,36 +101,52 @@ static inline size_t sbp_msg_pos_ecef_encoded_len(const sbp_msg_pos_ecef_t *msg) /** * Encode an instance of sbp_msg_pos_ecef_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_pos_ecef_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_ecef_t *msg); +SBP_EXPORT s8 sbp_msg_pos_ecef_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_pos_ecef_t *msg); /** * Decode an instance of sbp_msg_pos_ecef_t from wire representation * - * This function decodes the wire representation of a sbp_msg_pos_ecef_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_pos_ecef_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_pos_ecef_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_ecef_t *msg); +SBP_EXPORT s8 sbp_msg_pos_ecef_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_pos_ecef_t *msg); /** * Send an instance of sbp_msg_pos_ecef_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_pos_ecef_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_pos_ecef_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -142,51 +154,61 @@ SBP_EXPORT s8 sbp_msg_pos_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t * * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_ecef_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_ecef_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_pos_ecef_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_ecef_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_pos_ecef_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_pos_ecef_t instance * @param b sbp_msg_pos_ecef_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_pos_ecef_cmp(const sbp_msg_pos_ecef_t *a, const sbp_msg_pos_ecef_t *b); +SBP_EXPORT int sbp_msg_pos_ecef_cmp(const sbp_msg_pos_ecef_t *a, + const sbp_msg_pos_ecef_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_pos_ecef_t &lhs, const sbp_msg_pos_ecef_t &rhs) { +static inline bool operator==(const sbp_msg_pos_ecef_t &lhs, + const sbp_msg_pos_ecef_t &rhs) { return sbp_msg_pos_ecef_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_pos_ecef_t &lhs, const sbp_msg_pos_ecef_t &rhs) { +static inline bool operator!=(const sbp_msg_pos_ecef_t &lhs, + const sbp_msg_pos_ecef_t &rhs) { return sbp_msg_pos_ecef_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_pos_ecef_t &lhs, const sbp_msg_pos_ecef_t &rhs) { +static inline bool operator<(const sbp_msg_pos_ecef_t &lhs, + const sbp_msg_pos_ecef_t &rhs) { return sbp_msg_pos_ecef_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_pos_ecef_t &lhs, const sbp_msg_pos_ecef_t &rhs) { +static inline bool operator<=(const sbp_msg_pos_ecef_t &lhs, + const sbp_msg_pos_ecef_t &rhs) { return sbp_msg_pos_ecef_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_pos_ecef_t &lhs, const sbp_msg_pos_ecef_t &rhs) { +static inline bool operator>(const sbp_msg_pos_ecef_t &lhs, + const sbp_msg_pos_ecef_t &rhs) { return sbp_msg_pos_ecef_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_pos_ecef_t &lhs, const sbp_msg_pos_ecef_t &rhs) { +static inline bool operator>=(const sbp_msg_pos_ecef_t &lhs, + const sbp_msg_pos_ecef_t &rhs) { return sbp_msg_pos_ecef_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_POS_ECEF_H */ - diff --git a/c/include/libsbp/navigation/MSG_POS_ECEF_COV.h b/c/include/libsbp/navigation/MSG_POS_ECEF_COV.h index 6973cc7e4..2c4bcc697 100644 --- a/c/include/libsbp/navigation/MSG_POS_ECEF_COV.h +++ b/c/include/libsbp/navigation/MSG_POS_ECEF_COV.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_POS_ECEF_COV_H #define LIBSBP_NAVIGATION_MSG_POS_ECEF_COV_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,94 +40,86 @@ *****************************************************************************/ /** Position in ECEF with Covariances * - * The position solution message reports absolute Earth Centered Earth Fixed (ECEF) coordinates and the status (single point vs pseudo-absolute RTK) of the position solution. The message also reports the upper triangular portion of the 3x3 covariance matrix. If the receiver knows the surveyed position of the base station and has an RTK solution, this reports a pseudo-absolute position solution using the base station position and the rover's RTK baseline vector. The full GPS time is given by the preceding MSG_GPS_TIME with the matching time-of-week (tow). - * + * The position solution message reports absolute Earth Centered Earth Fixed + * (ECEF) coordinates and the status (single point vs pseudo-absolute RTK) of + * the position solution. The message also reports the upper triangular portion + * of the 3x3 covariance matrix. If the receiver knows the surveyed position of + * the base station and has an RTK solution, this reports a pseudo-absolute + * position solution using the base station position and the rover's RTK + * baseline vector. The full GPS time is given by the preceding MSG_GPS_TIME + * with the matching time-of-week (tow). + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* ECEF X coordinate [m] + * ECEF X coordinate [m] */ double x; - /** -* ECEF Y coordinate [m] + * ECEF Y coordinate [m] */ double y; - /** -* ECEF Z coordinate [m] + * ECEF Z coordinate [m] */ double z; - /** -* Estimated variance of x [m^2] + * Estimated variance of x [m^2] */ float cov_x_x; - /** -* Estimated covariance of x and y [m^2] + * Estimated covariance of x and y [m^2] */ float cov_x_y; - /** -* Estimated covariance of x and z [m^2] + * Estimated covariance of x and z [m^2] */ float cov_x_z; - /** -* Estimated variance of y [m^2] + * Estimated variance of y [m^2] */ float cov_y_y; - /** -* Estimated covariance of y and z [m^2] + * Estimated covariance of y and z [m^2] */ float cov_y_z; - /** -* Estimated variance of z [m^2] + * Estimated variance of z [m^2] */ float cov_z_z; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_pos_ecef_cov_t; - - /** * Get encoded size of an instance of sbp_msg_pos_ecef_cov_t * * @param msg sbp_msg_pos_ecef_cov_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_pos_ecef_cov_encoded_len(const sbp_msg_pos_ecef_cov_t *msg) -{ +static inline size_t sbp_msg_pos_ecef_cov_encoded_len( + const sbp_msg_pos_ecef_cov_t *msg) { (void)msg; return SBP_MSG_POS_ECEF_COV_ENCODED_LEN; } @@ -135,36 +127,53 @@ static inline size_t sbp_msg_pos_ecef_cov_encoded_len(const sbp_msg_pos_ecef_cov /** * Encode an instance of sbp_msg_pos_ecef_cov_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_pos_ecef_cov_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_ecef_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_ecef_cov_t *msg); +SBP_EXPORT s8 sbp_msg_pos_ecef_cov_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_pos_ecef_cov_t *msg); /** * Decode an instance of sbp_msg_pos_ecef_cov_t from wire representation * - * This function decodes the wire representation of a sbp_msg_pos_ecef_cov_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_pos_ecef_cov_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_pos_ecef_cov_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_ecef_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_ecef_cov_t *msg); +SBP_EXPORT s8 sbp_msg_pos_ecef_cov_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_pos_ecef_cov_t *msg); /** * Send an instance of sbp_msg_pos_ecef_cov_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_pos_ecef_cov_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_pos_ecef_cov_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -172,51 +181,61 @@ SBP_EXPORT s8 sbp_msg_pos_ecef_cov_decode(const uint8_t *buf, uint8_t len, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_ecef_cov_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_ecef_cov_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_pos_ecef_cov_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_ecef_cov_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_pos_ecef_cov_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_pos_ecef_cov_t instance * @param b sbp_msg_pos_ecef_cov_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_pos_ecef_cov_cmp(const sbp_msg_pos_ecef_cov_t *a, const sbp_msg_pos_ecef_cov_t *b); +SBP_EXPORT int sbp_msg_pos_ecef_cov_cmp(const sbp_msg_pos_ecef_cov_t *a, + const sbp_msg_pos_ecef_cov_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_pos_ecef_cov_t &lhs, const sbp_msg_pos_ecef_cov_t &rhs) { +static inline bool operator==(const sbp_msg_pos_ecef_cov_t &lhs, + const sbp_msg_pos_ecef_cov_t &rhs) { return sbp_msg_pos_ecef_cov_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_pos_ecef_cov_t &lhs, const sbp_msg_pos_ecef_cov_t &rhs) { +static inline bool operator!=(const sbp_msg_pos_ecef_cov_t &lhs, + const sbp_msg_pos_ecef_cov_t &rhs) { return sbp_msg_pos_ecef_cov_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_pos_ecef_cov_t &lhs, const sbp_msg_pos_ecef_cov_t &rhs) { +static inline bool operator<(const sbp_msg_pos_ecef_cov_t &lhs, + const sbp_msg_pos_ecef_cov_t &rhs) { return sbp_msg_pos_ecef_cov_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_pos_ecef_cov_t &lhs, const sbp_msg_pos_ecef_cov_t &rhs) { +static inline bool operator<=(const sbp_msg_pos_ecef_cov_t &lhs, + const sbp_msg_pos_ecef_cov_t &rhs) { return sbp_msg_pos_ecef_cov_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_pos_ecef_cov_t &lhs, const sbp_msg_pos_ecef_cov_t &rhs) { +static inline bool operator>(const sbp_msg_pos_ecef_cov_t &lhs, + const sbp_msg_pos_ecef_cov_t &rhs) { return sbp_msg_pos_ecef_cov_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_pos_ecef_cov_t &lhs, const sbp_msg_pos_ecef_cov_t &rhs) { +static inline bool operator>=(const sbp_msg_pos_ecef_cov_t &lhs, + const sbp_msg_pos_ecef_cov_t &rhs) { return sbp_msg_pos_ecef_cov_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_POS_ECEF_COV_H */ - diff --git a/c/include/libsbp/navigation/MSG_POS_ECEF_COV_GNSS.h b/c/include/libsbp/navigation/MSG_POS_ECEF_COV_GNSS.h index ea93902fc..adf9f421d 100644 --- a/c/include/libsbp/navigation/MSG_POS_ECEF_COV_GNSS.h +++ b/c/include/libsbp/navigation/MSG_POS_ECEF_COV_GNSS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_POS_ECEF_COV_GNSS_H #define LIBSBP_NAVIGATION_MSG_POS_ECEF_COV_GNSS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,94 +40,86 @@ *****************************************************************************/ /** GNSS-only Position in ECEF with Covariances * - * The position solution message reports absolute Earth Centered Earth Fixed (ECEF) coordinates and the status (single point vs pseudo-absolute RTK) of the position solution. The message also reports the upper triangular portion of the 3x3 covariance matrix. If the receiver knows the surveyed position of the base station and has an RTK solution, this reports a pseudo-absolute position solution using the base station position and the rover's RTK baseline vector. The full GPS time is given by the preceding MSG_GPS_TIME_GNSS with the matching time-of-week (tow). - * + * The position solution message reports absolute Earth Centered Earth Fixed + * (ECEF) coordinates and the status (single point vs pseudo-absolute RTK) of + * the position solution. The message also reports the upper triangular portion + * of the 3x3 covariance matrix. If the receiver knows the surveyed position of + * the base station and has an RTK solution, this reports a pseudo-absolute + * position solution using the base station position and the rover's RTK + * baseline vector. The full GPS time is given by the preceding + * MSG_GPS_TIME_GNSS with the matching time-of-week (tow). + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* ECEF X coordinate [m] + * ECEF X coordinate [m] */ double x; - /** -* ECEF Y coordinate [m] + * ECEF Y coordinate [m] */ double y; - /** -* ECEF Z coordinate [m] + * ECEF Z coordinate [m] */ double z; - /** -* Estimated variance of x [m^2] + * Estimated variance of x [m^2] */ float cov_x_x; - /** -* Estimated covariance of x and y [m^2] + * Estimated covariance of x and y [m^2] */ float cov_x_y; - /** -* Estimated covariance of x and z [m^2] + * Estimated covariance of x and z [m^2] */ float cov_x_z; - /** -* Estimated variance of y [m^2] + * Estimated variance of y [m^2] */ float cov_y_y; - /** -* Estimated covariance of y and z [m^2] + * Estimated covariance of y and z [m^2] */ float cov_y_z; - /** -* Estimated variance of z [m^2] + * Estimated variance of z [m^2] */ float cov_z_z; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_pos_ecef_cov_gnss_t; - - /** * Get encoded size of an instance of sbp_msg_pos_ecef_cov_gnss_t * * @param msg sbp_msg_pos_ecef_cov_gnss_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_pos_ecef_cov_gnss_encoded_len(const sbp_msg_pos_ecef_cov_gnss_t *msg) -{ +static inline size_t sbp_msg_pos_ecef_cov_gnss_encoded_len( + const sbp_msg_pos_ecef_cov_gnss_t *msg) { (void)msg; return SBP_MSG_POS_ECEF_COV_GNSS_ENCODED_LEN; } @@ -135,36 +127,53 @@ static inline size_t sbp_msg_pos_ecef_cov_gnss_encoded_len(const sbp_msg_pos_ece /** * Encode an instance of sbp_msg_pos_ecef_cov_gnss_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_pos_ecef_cov_gnss_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_ecef_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_ecef_cov_gnss_t *msg); +SBP_EXPORT s8 +sbp_msg_pos_ecef_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_ecef_cov_gnss_t *msg); /** * Decode an instance of sbp_msg_pos_ecef_cov_gnss_t from wire representation * - * This function decodes the wire representation of a sbp_msg_pos_ecef_cov_gnss_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_pos_ecef_cov_gnss_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_pos_ecef_cov_gnss_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_ecef_cov_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_ecef_cov_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_pos_ecef_cov_gnss_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_ecef_cov_gnss_t *msg); /** * Send an instance of sbp_msg_pos_ecef_cov_gnss_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_pos_ecef_cov_gnss_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_pos_ecef_cov_gnss_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -172,51 +181,61 @@ SBP_EXPORT s8 sbp_msg_pos_ecef_cov_gnss_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_ecef_cov_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_ecef_cov_gnss_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_pos_ecef_cov_gnss_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_pos_ecef_cov_gnss_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_pos_ecef_cov_gnss_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_pos_ecef_cov_gnss_t instance * @param b sbp_msg_pos_ecef_cov_gnss_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_pos_ecef_cov_gnss_cmp(const sbp_msg_pos_ecef_cov_gnss_t *a, const sbp_msg_pos_ecef_cov_gnss_t *b); +SBP_EXPORT int sbp_msg_pos_ecef_cov_gnss_cmp( + const sbp_msg_pos_ecef_cov_gnss_t *a, const sbp_msg_pos_ecef_cov_gnss_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_pos_ecef_cov_gnss_t &lhs, const sbp_msg_pos_ecef_cov_gnss_t &rhs) { +static inline bool operator==(const sbp_msg_pos_ecef_cov_gnss_t &lhs, + const sbp_msg_pos_ecef_cov_gnss_t &rhs) { return sbp_msg_pos_ecef_cov_gnss_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_pos_ecef_cov_gnss_t &lhs, const sbp_msg_pos_ecef_cov_gnss_t &rhs) { +static inline bool operator!=(const sbp_msg_pos_ecef_cov_gnss_t &lhs, + const sbp_msg_pos_ecef_cov_gnss_t &rhs) { return sbp_msg_pos_ecef_cov_gnss_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_pos_ecef_cov_gnss_t &lhs, const sbp_msg_pos_ecef_cov_gnss_t &rhs) { +static inline bool operator<(const sbp_msg_pos_ecef_cov_gnss_t &lhs, + const sbp_msg_pos_ecef_cov_gnss_t &rhs) { return sbp_msg_pos_ecef_cov_gnss_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_pos_ecef_cov_gnss_t &lhs, const sbp_msg_pos_ecef_cov_gnss_t &rhs) { +static inline bool operator<=(const sbp_msg_pos_ecef_cov_gnss_t &lhs, + const sbp_msg_pos_ecef_cov_gnss_t &rhs) { return sbp_msg_pos_ecef_cov_gnss_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_pos_ecef_cov_gnss_t &lhs, const sbp_msg_pos_ecef_cov_gnss_t &rhs) { +static inline bool operator>(const sbp_msg_pos_ecef_cov_gnss_t &lhs, + const sbp_msg_pos_ecef_cov_gnss_t &rhs) { return sbp_msg_pos_ecef_cov_gnss_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_pos_ecef_cov_gnss_t &lhs, const sbp_msg_pos_ecef_cov_gnss_t &rhs) { +static inline bool operator>=(const sbp_msg_pos_ecef_cov_gnss_t &lhs, + const sbp_msg_pos_ecef_cov_gnss_t &rhs) { return sbp_msg_pos_ecef_cov_gnss_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_POS_ECEF_COV_GNSS_H */ - diff --git a/c/include/libsbp/navigation/MSG_POS_ECEF_DEP_A.h b/c/include/libsbp/navigation/MSG_POS_ECEF_DEP_A.h index 016b2e65c..20a21ded0 100644 --- a/c/include/libsbp/navigation/MSG_POS_ECEF_DEP_A.h +++ b/c/include/libsbp/navigation/MSG_POS_ECEF_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_POS_ECEF_DEP_A_H #define LIBSBP_NAVIGATION_MSG_POS_ECEF_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,63 +40,53 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* ECEF X coordinate [m] + * ECEF X coordinate [m] */ double x; - /** -* ECEF Y coordinate [m] + * ECEF Y coordinate [m] */ double y; - /** -* ECEF Z coordinate [m] + * ECEF Z coordinate [m] */ double z; - /** - * Position accuracy estimate (not implemented). Defaults to 0. [mm] + * Position accuracy estimate (not implemented). Defaults to 0. [mm] */ u16 accuracy; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_pos_ecef_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_pos_ecef_dep_a_t * * @param msg sbp_msg_pos_ecef_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_pos_ecef_dep_a_encoded_len(const sbp_msg_pos_ecef_dep_a_t *msg) -{ +static inline size_t sbp_msg_pos_ecef_dep_a_encoded_len( + const sbp_msg_pos_ecef_dep_a_t *msg) { (void)msg; return SBP_MSG_POS_ECEF_DEP_A_ENCODED_LEN; } @@ -104,36 +94,53 @@ static inline size_t sbp_msg_pos_ecef_dep_a_encoded_len(const sbp_msg_pos_ecef_d /** * Encode an instance of sbp_msg_pos_ecef_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_pos_ecef_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_ecef_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_ecef_dep_a_t *msg); +SBP_EXPORT s8 +sbp_msg_pos_ecef_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_ecef_dep_a_t *msg); /** * Decode an instance of sbp_msg_pos_ecef_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_pos_ecef_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_pos_ecef_dep_a_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_pos_ecef_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_ecef_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_pos_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_pos_ecef_dep_a_t *msg); /** * Send an instance of sbp_msg_pos_ecef_dep_a_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_pos_ecef_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_pos_ecef_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -141,51 +148,61 @@ SBP_EXPORT s8 sbp_msg_pos_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_ecef_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_ecef_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_pos_ecef_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_ecef_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_pos_ecef_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_pos_ecef_dep_a_t instance * @param b sbp_msg_pos_ecef_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_pos_ecef_dep_a_cmp(const sbp_msg_pos_ecef_dep_a_t *a, const sbp_msg_pos_ecef_dep_a_t *b); +SBP_EXPORT int sbp_msg_pos_ecef_dep_a_cmp(const sbp_msg_pos_ecef_dep_a_t *a, + const sbp_msg_pos_ecef_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_pos_ecef_dep_a_t &lhs, const sbp_msg_pos_ecef_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_pos_ecef_dep_a_t &lhs, + const sbp_msg_pos_ecef_dep_a_t &rhs) { return sbp_msg_pos_ecef_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_pos_ecef_dep_a_t &lhs, const sbp_msg_pos_ecef_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_pos_ecef_dep_a_t &lhs, + const sbp_msg_pos_ecef_dep_a_t &rhs) { return sbp_msg_pos_ecef_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_pos_ecef_dep_a_t &lhs, const sbp_msg_pos_ecef_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_pos_ecef_dep_a_t &lhs, + const sbp_msg_pos_ecef_dep_a_t &rhs) { return sbp_msg_pos_ecef_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_pos_ecef_dep_a_t &lhs, const sbp_msg_pos_ecef_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_pos_ecef_dep_a_t &lhs, + const sbp_msg_pos_ecef_dep_a_t &rhs) { return sbp_msg_pos_ecef_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_pos_ecef_dep_a_t &lhs, const sbp_msg_pos_ecef_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_pos_ecef_dep_a_t &lhs, + const sbp_msg_pos_ecef_dep_a_t &rhs) { return sbp_msg_pos_ecef_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_pos_ecef_dep_a_t &lhs, const sbp_msg_pos_ecef_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_pos_ecef_dep_a_t &lhs, + const sbp_msg_pos_ecef_dep_a_t &rhs) { return sbp_msg_pos_ecef_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_POS_ECEF_DEP_A_H */ - diff --git a/c/include/libsbp/navigation/MSG_POS_ECEF_GNSS.h b/c/include/libsbp/navigation/MSG_POS_ECEF_GNSS.h index 13b8e214c..73738383c 100644 --- a/c/include/libsbp/navigation/MSG_POS_ECEF_GNSS.h +++ b/c/include/libsbp/navigation/MSG_POS_ECEF_GNSS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_POS_ECEF_GNSS_H #define LIBSBP_NAVIGATION_MSG_POS_ECEF_GNSS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,64 +40,60 @@ *****************************************************************************/ /** GNSS-only Position in ECEF * - * The position solution message reports absolute Earth Centered Earth Fixed (ECEF) coordinates and the status (single point vs pseudo-absolute RTK) of the position solution. If the rover receiver knows the surveyed position of the base station and has an RTK solution, this reports a pseudo-absolute position solution using the base station position and the rover's RTK baseline vector. The full GPS time is given by the preceding MSG_GPS_TIME_GNSS with the matching time-of-week (tow). - * + * The position solution message reports absolute Earth Centered Earth Fixed + * (ECEF) coordinates and the status (single point vs pseudo-absolute RTK) of + * the position solution. If the rover receiver knows the surveyed position of + * the base station and has an RTK solution, this reports a pseudo-absolute + * position solution using the base station position and the rover's RTK + * baseline vector. The full GPS time is given by the preceding + * MSG_GPS_TIME_GNSS with the matching time-of-week (tow). + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* ECEF X coordinate [m] + * ECEF X coordinate [m] */ double x; - /** -* ECEF Y coordinate [m] + * ECEF Y coordinate [m] */ double y; - /** -* ECEF Z coordinate [m] + * ECEF Z coordinate [m] */ double z; - /** -* Position estimated standard deviation [mm] + * Position estimated standard deviation [mm] */ u16 accuracy; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_pos_ecef_gnss_t; - - /** * Get encoded size of an instance of sbp_msg_pos_ecef_gnss_t * * @param msg sbp_msg_pos_ecef_gnss_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_pos_ecef_gnss_encoded_len(const sbp_msg_pos_ecef_gnss_t *msg) -{ +static inline size_t sbp_msg_pos_ecef_gnss_encoded_len( + const sbp_msg_pos_ecef_gnss_t *msg) { (void)msg; return SBP_MSG_POS_ECEF_GNSS_ENCODED_LEN; } @@ -105,36 +101,53 @@ static inline size_t sbp_msg_pos_ecef_gnss_encoded_len(const sbp_msg_pos_ecef_gn /** * Encode an instance of sbp_msg_pos_ecef_gnss_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_pos_ecef_gnss_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_ecef_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_ecef_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_pos_ecef_gnss_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_pos_ecef_gnss_t *msg); /** * Decode an instance of sbp_msg_pos_ecef_gnss_t from wire representation * - * This function decodes the wire representation of a sbp_msg_pos_ecef_gnss_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_pos_ecef_gnss_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_pos_ecef_gnss_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_ecef_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_ecef_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_pos_ecef_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_pos_ecef_gnss_t *msg); /** * Send an instance of sbp_msg_pos_ecef_gnss_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_pos_ecef_gnss_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_pos_ecef_gnss_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -142,51 +155,61 @@ SBP_EXPORT s8 sbp_msg_pos_ecef_gnss_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_ecef_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_ecef_gnss_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_pos_ecef_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_ecef_gnss_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_pos_ecef_gnss_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_pos_ecef_gnss_t instance * @param b sbp_msg_pos_ecef_gnss_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_pos_ecef_gnss_cmp(const sbp_msg_pos_ecef_gnss_t *a, const sbp_msg_pos_ecef_gnss_t *b); +SBP_EXPORT int sbp_msg_pos_ecef_gnss_cmp(const sbp_msg_pos_ecef_gnss_t *a, + const sbp_msg_pos_ecef_gnss_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_pos_ecef_gnss_t &lhs, const sbp_msg_pos_ecef_gnss_t &rhs) { +static inline bool operator==(const sbp_msg_pos_ecef_gnss_t &lhs, + const sbp_msg_pos_ecef_gnss_t &rhs) { return sbp_msg_pos_ecef_gnss_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_pos_ecef_gnss_t &lhs, const sbp_msg_pos_ecef_gnss_t &rhs) { +static inline bool operator!=(const sbp_msg_pos_ecef_gnss_t &lhs, + const sbp_msg_pos_ecef_gnss_t &rhs) { return sbp_msg_pos_ecef_gnss_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_pos_ecef_gnss_t &lhs, const sbp_msg_pos_ecef_gnss_t &rhs) { +static inline bool operator<(const sbp_msg_pos_ecef_gnss_t &lhs, + const sbp_msg_pos_ecef_gnss_t &rhs) { return sbp_msg_pos_ecef_gnss_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_pos_ecef_gnss_t &lhs, const sbp_msg_pos_ecef_gnss_t &rhs) { +static inline bool operator<=(const sbp_msg_pos_ecef_gnss_t &lhs, + const sbp_msg_pos_ecef_gnss_t &rhs) { return sbp_msg_pos_ecef_gnss_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_pos_ecef_gnss_t &lhs, const sbp_msg_pos_ecef_gnss_t &rhs) { +static inline bool operator>(const sbp_msg_pos_ecef_gnss_t &lhs, + const sbp_msg_pos_ecef_gnss_t &rhs) { return sbp_msg_pos_ecef_gnss_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_pos_ecef_gnss_t &lhs, const sbp_msg_pos_ecef_gnss_t &rhs) { +static inline bool operator>=(const sbp_msg_pos_ecef_gnss_t &lhs, + const sbp_msg_pos_ecef_gnss_t &rhs) { return sbp_msg_pos_ecef_gnss_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_POS_ECEF_GNSS_H */ - diff --git a/c/include/libsbp/navigation/MSG_POS_LLH.h b/c/include/libsbp/navigation/MSG_POS_LLH.h index fd51ed141..5bb448760 100644 --- a/c/include/libsbp/navigation/MSG_POS_LLH.h +++ b/c/include/libsbp/navigation/MSG_POS_LLH.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_POS_LLH_H #define LIBSBP_NAVIGATION_MSG_POS_LLH_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,70 +40,63 @@ *****************************************************************************/ /** Geodetic Position * - * This position solution message reports the absolute geodetic coordinates and the status (single point vs pseudo-absolute RTK) of the position solution. If the rover receiver knows the surveyed position of the base station and has an RTK solution, this reports a pseudo-absolute position solution using the base station position and the rover's RTK baseline vector. The full GPS time is given by the preceding MSG_GPS_TIME with the matching time-of-week (tow). - * + * This position solution message reports the absolute geodetic coordinates and + * the status (single point vs pseudo-absolute RTK) of the position solution. If + * the rover receiver knows the surveyed position of the base station and has an + * RTK solution, this reports a pseudo-absolute position solution using the base + * station position and the rover's RTK baseline vector. The full GPS time is + * given by the preceding MSG_GPS_TIME with the matching time-of-week (tow). + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Latitude [deg] + * Latitude [deg] */ double lat; - /** -* Longitude [deg] + * Longitude [deg] */ double lon; - /** -* Height above WGS84 ellipsoid [m] + * Height above WGS84 ellipsoid [m] */ double height; - /** -* Horizontal position estimated standard deviation [mm] + * Horizontal position estimated standard deviation [mm] */ u16 h_accuracy; - /** -* Vertical position estimated standard deviation [mm] + * Vertical position estimated standard deviation [mm] */ u16 v_accuracy; - /** -* Number of satellites used in solution. + * Number of satellites used in solution. */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_pos_llh_t; - - /** * Get encoded size of an instance of sbp_msg_pos_llh_t * * @param msg sbp_msg_pos_llh_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_pos_llh_encoded_len(const sbp_msg_pos_llh_t *msg) -{ +static inline size_t sbp_msg_pos_llh_encoded_len(const sbp_msg_pos_llh_t *msg) { (void)msg; return SBP_MSG_POS_LLH_ENCODED_LEN; } @@ -111,36 +104,52 @@ static inline size_t sbp_msg_pos_llh_encoded_len(const sbp_msg_pos_llh_t *msg) /** * Encode an instance of sbp_msg_pos_llh_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_pos_llh_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_t *msg); +SBP_EXPORT s8 sbp_msg_pos_llh_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_pos_llh_t *msg); /** * Decode an instance of sbp_msg_pos_llh_t from wire representation * - * This function decodes the wire representation of a sbp_msg_pos_llh_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_pos_llh_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_pos_llh_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_t *msg); +SBP_EXPORT s8 sbp_msg_pos_llh_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_pos_llh_t *msg); /** * Send an instance of sbp_msg_pos_llh_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_pos_llh_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_pos_llh_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -148,51 +157,61 @@ SBP_EXPORT s8 sbp_msg_pos_llh_decode(const uint8_t *buf, uint8_t len, uint8_t *n * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_llh_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_pos_llh_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_llh_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_pos_llh_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_pos_llh_t instance * @param b sbp_msg_pos_llh_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_pos_llh_cmp(const sbp_msg_pos_llh_t *a, const sbp_msg_pos_llh_t *b); +SBP_EXPORT int sbp_msg_pos_llh_cmp(const sbp_msg_pos_llh_t *a, + const sbp_msg_pos_llh_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_pos_llh_t &lhs, const sbp_msg_pos_llh_t &rhs) { +static inline bool operator==(const sbp_msg_pos_llh_t &lhs, + const sbp_msg_pos_llh_t &rhs) { return sbp_msg_pos_llh_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_pos_llh_t &lhs, const sbp_msg_pos_llh_t &rhs) { +static inline bool operator!=(const sbp_msg_pos_llh_t &lhs, + const sbp_msg_pos_llh_t &rhs) { return sbp_msg_pos_llh_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_pos_llh_t &lhs, const sbp_msg_pos_llh_t &rhs) { +static inline bool operator<(const sbp_msg_pos_llh_t &lhs, + const sbp_msg_pos_llh_t &rhs) { return sbp_msg_pos_llh_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_pos_llh_t &lhs, const sbp_msg_pos_llh_t &rhs) { +static inline bool operator<=(const sbp_msg_pos_llh_t &lhs, + const sbp_msg_pos_llh_t &rhs) { return sbp_msg_pos_llh_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_pos_llh_t &lhs, const sbp_msg_pos_llh_t &rhs) { +static inline bool operator>(const sbp_msg_pos_llh_t &lhs, + const sbp_msg_pos_llh_t &rhs) { return sbp_msg_pos_llh_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_pos_llh_t &lhs, const sbp_msg_pos_llh_t &rhs) { +static inline bool operator>=(const sbp_msg_pos_llh_t &lhs, + const sbp_msg_pos_llh_t &rhs) { return sbp_msg_pos_llh_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_POS_LLH_H */ - diff --git a/c/include/libsbp/navigation/MSG_POS_LLH_ACC.h b/c/include/libsbp/navigation/MSG_POS_LLH_ACC.h index a05df28be..3f9cfab40 100644 --- a/c/include/libsbp/navigation/MSG_POS_LLH_ACC.h +++ b/c/include/libsbp/navigation/MSG_POS_LLH_ACC.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_NAVIGATION_MSG_POS_LLH_ACC_H #define LIBSBP_NAVIGATION_MSG_POS_LLH_ACC_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,102 +41,100 @@ *****************************************************************************/ /** Geodetic Position and Accuracy * - * This position solution message reports the absolute geodetic coordinates and the status (single point vs pseudo-absolute RTK) of the position solution as well as the estimated horizontal, vertical, cross-track and along-track errors. The position information and Fix Mode flags follow the MSG_POS_LLH message. Since the covariance matrix is computed in the local-level North, East, Down frame, the estimated error terms follow that convention. - * - * The estimated errors are reported at a user-configurable confidence level. The user-configured percentile is encoded in the percentile field. - * + * This position solution message reports the absolute geodetic coordinates and + * the status (single point vs pseudo-absolute RTK) of the position solution as + * well as the estimated horizontal, vertical, cross-track and along-track + * errors. The position information and Fix Mode flags follow the MSG_POS_LLH + * message. Since the covariance matrix is computed in the local-level North, + * East, Down frame, the estimated error terms follow that convention. + * + * The estimated errors are reported at a user-configurable confidence level. + * The user-configured percentile is encoded in the percentile field. + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Latitude [deg] + * Latitude [deg] */ double lat; - /** -* Longitude [deg] + * Longitude [deg] */ double lon; - /** -* Height above WGS84 ellipsoid [m] + * Height above WGS84 ellipsoid [m] */ double height; - /** -* Height above the geoid (i.e. height above mean sea level). See confidence_and_geoid for geoid model used. [m] + * Height above the geoid (i.e. height above mean sea level). See + * confidence_and_geoid for geoid model used. [m] */ double orthometric_height; - /** -* Estimated horizontal error at the user-configured confidence level; zero implies invalid. [m] + * Estimated horizontal error at the user-configured confidence level; zero + * implies invalid. [m] */ float h_accuracy; - /** -* Estimated vertical error at the user-configured confidence level; zero implies invalid. [m] + * Estimated vertical error at the user-configured confidence level; zero + * implies invalid. [m] */ float v_accuracy; - /** -* Estimated cross-track error at the user-configured confidence level; zero implies invalid. [m] + * Estimated cross-track error at the user-configured confidence level; zero + * implies invalid. [m] */ float ct_accuracy; - /** -* Estimated along-track error at the user-configured confidence level; zero implies invalid. [m] + * Estimated along-track error at the user-configured confidence level; zero + * implies invalid. [m] */ float at_accuracy; - /** -* The estimated horizontal error ellipse at the user-configured confidence level. + * The estimated horizontal error ellipse at the user-configured confidence + * level. */ sbp_estimated_horizontal_error_ellipse_t h_ellipse; - /** -* The lower bits describe the configured confidence level for the estimated position error. The middle bits describe the geoid model used to calculate the orthometric height. + * The lower bits describe the configured confidence level for the estimated + * position error. The middle bits describe the geoid model used to calculate + * the orthometric height. */ u8 confidence_and_geoid; - /** -* Number of satellites used in solution. + * Number of satellites used in solution. */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_pos_llh_acc_t; - - /** * Get encoded size of an instance of sbp_msg_pos_llh_acc_t * * @param msg sbp_msg_pos_llh_acc_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_pos_llh_acc_encoded_len(const sbp_msg_pos_llh_acc_t *msg) -{ +static inline size_t sbp_msg_pos_llh_acc_encoded_len( + const sbp_msg_pos_llh_acc_t *msg) { (void)msg; return SBP_MSG_POS_LLH_ACC_ENCODED_LEN; } @@ -144,36 +142,53 @@ static inline size_t sbp_msg_pos_llh_acc_encoded_len(const sbp_msg_pos_llh_acc_t /** * Encode an instance of sbp_msg_pos_llh_acc_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_pos_llh_acc_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_acc_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_acc_t *msg); +SBP_EXPORT s8 sbp_msg_pos_llh_acc_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_pos_llh_acc_t *msg); /** * Decode an instance of sbp_msg_pos_llh_acc_t from wire representation * - * This function decodes the wire representation of a sbp_msg_pos_llh_acc_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_pos_llh_acc_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_pos_llh_acc_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_acc_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_acc_t *msg); +SBP_EXPORT s8 sbp_msg_pos_llh_acc_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_pos_llh_acc_t *msg); /** * Send an instance of sbp_msg_pos_llh_acc_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_pos_llh_acc_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_pos_llh_acc_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -181,51 +196,61 @@ SBP_EXPORT s8 sbp_msg_pos_llh_acc_decode(const uint8_t *buf, uint8_t len, uint8_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_acc_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_llh_acc_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_pos_llh_acc_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_llh_acc_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_pos_llh_acc_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_pos_llh_acc_t instance * @param b sbp_msg_pos_llh_acc_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_pos_llh_acc_cmp(const sbp_msg_pos_llh_acc_t *a, const sbp_msg_pos_llh_acc_t *b); +SBP_EXPORT int sbp_msg_pos_llh_acc_cmp(const sbp_msg_pos_llh_acc_t *a, + const sbp_msg_pos_llh_acc_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_pos_llh_acc_t &lhs, const sbp_msg_pos_llh_acc_t &rhs) { +static inline bool operator==(const sbp_msg_pos_llh_acc_t &lhs, + const sbp_msg_pos_llh_acc_t &rhs) { return sbp_msg_pos_llh_acc_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_pos_llh_acc_t &lhs, const sbp_msg_pos_llh_acc_t &rhs) { +static inline bool operator!=(const sbp_msg_pos_llh_acc_t &lhs, + const sbp_msg_pos_llh_acc_t &rhs) { return sbp_msg_pos_llh_acc_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_pos_llh_acc_t &lhs, const sbp_msg_pos_llh_acc_t &rhs) { +static inline bool operator<(const sbp_msg_pos_llh_acc_t &lhs, + const sbp_msg_pos_llh_acc_t &rhs) { return sbp_msg_pos_llh_acc_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_pos_llh_acc_t &lhs, const sbp_msg_pos_llh_acc_t &rhs) { +static inline bool operator<=(const sbp_msg_pos_llh_acc_t &lhs, + const sbp_msg_pos_llh_acc_t &rhs) { return sbp_msg_pos_llh_acc_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_pos_llh_acc_t &lhs, const sbp_msg_pos_llh_acc_t &rhs) { +static inline bool operator>(const sbp_msg_pos_llh_acc_t &lhs, + const sbp_msg_pos_llh_acc_t &rhs) { return sbp_msg_pos_llh_acc_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_pos_llh_acc_t &lhs, const sbp_msg_pos_llh_acc_t &rhs) { +static inline bool operator>=(const sbp_msg_pos_llh_acc_t &lhs, + const sbp_msg_pos_llh_acc_t &rhs) { return sbp_msg_pos_llh_acc_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_POS_LLH_ACC_H */ - diff --git a/c/include/libsbp/navigation/MSG_POS_LLH_COV.h b/c/include/libsbp/navigation/MSG_POS_LLH_COV.h index 7055d8a5a..0da3d6d6c 100644 --- a/c/include/libsbp/navigation/MSG_POS_LLH_COV.h +++ b/c/include/libsbp/navigation/MSG_POS_LLH_COV.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_POS_LLH_COV_H #define LIBSBP_NAVIGATION_MSG_POS_LLH_COV_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,94 +40,86 @@ *****************************************************************************/ /** Geodetic Position with Covariances * - * This position solution message reports the absolute geodetic coordinates and the status (single point vs pseudo-absolute RTK) of the position solution as well as the upper triangle of the 3x3 covariance matrix. The position information and Fix Mode flags follow the MSG_POS_LLH message. Since the covariance matrix is computed in the local-level North, East, Down frame, the covariance terms follow that convention. Thus, covariances are reported against the "downward" measurement and care should be taken with the sign convention. - * + * This position solution message reports the absolute geodetic coordinates and + * the status (single point vs pseudo-absolute RTK) of the position solution as + * well as the upper triangle of the 3x3 covariance matrix. The position + * information and Fix Mode flags follow the MSG_POS_LLH message. Since the + * covariance matrix is computed in the local-level North, East, Down frame, the + * covariance terms follow that convention. Thus, covariances are reported + * against the "downward" measurement and care should be taken with the sign + * convention. + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Latitude [deg] + * Latitude [deg] */ double lat; - /** -* Longitude [deg] + * Longitude [deg] */ double lon; - /** -* Height above WGS84 ellipsoid [m] + * Height above WGS84 ellipsoid [m] */ double height; - /** -* Estimated variance of northing [m^2] + * Estimated variance of northing [m^2] */ float cov_n_n; - /** -* Covariance of northing and easting [m^2] + * Covariance of northing and easting [m^2] */ float cov_n_e; - /** -* Covariance of northing and downward measurement [m^2] + * Covariance of northing and downward measurement [m^2] */ float cov_n_d; - /** -* Estimated variance of easting [m^2] + * Estimated variance of easting [m^2] */ float cov_e_e; - /** -* Covariance of easting and downward measurement [m^2] + * Covariance of easting and downward measurement [m^2] */ float cov_e_d; - /** -* Estimated variance of downward measurement [m^2] + * Estimated variance of downward measurement [m^2] */ float cov_d_d; - /** -* Number of satellites used in solution. + * Number of satellites used in solution. */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_pos_llh_cov_t; - - /** * Get encoded size of an instance of sbp_msg_pos_llh_cov_t * * @param msg sbp_msg_pos_llh_cov_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_pos_llh_cov_encoded_len(const sbp_msg_pos_llh_cov_t *msg) -{ +static inline size_t sbp_msg_pos_llh_cov_encoded_len( + const sbp_msg_pos_llh_cov_t *msg) { (void)msg; return SBP_MSG_POS_LLH_COV_ENCODED_LEN; } @@ -135,36 +127,53 @@ static inline size_t sbp_msg_pos_llh_cov_encoded_len(const sbp_msg_pos_llh_cov_t /** * Encode an instance of sbp_msg_pos_llh_cov_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_pos_llh_cov_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_cov_t *msg); +SBP_EXPORT s8 sbp_msg_pos_llh_cov_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_pos_llh_cov_t *msg); /** * Decode an instance of sbp_msg_pos_llh_cov_t from wire representation * - * This function decodes the wire representation of a sbp_msg_pos_llh_cov_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_pos_llh_cov_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_pos_llh_cov_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_cov_t *msg); +SBP_EXPORT s8 sbp_msg_pos_llh_cov_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_pos_llh_cov_t *msg); /** * Send an instance of sbp_msg_pos_llh_cov_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_pos_llh_cov_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_pos_llh_cov_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -172,51 +181,61 @@ SBP_EXPORT s8 sbp_msg_pos_llh_cov_decode(const uint8_t *buf, uint8_t len, uint8_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_cov_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_llh_cov_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_pos_llh_cov_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_llh_cov_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_pos_llh_cov_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_pos_llh_cov_t instance * @param b sbp_msg_pos_llh_cov_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_pos_llh_cov_cmp(const sbp_msg_pos_llh_cov_t *a, const sbp_msg_pos_llh_cov_t *b); +SBP_EXPORT int sbp_msg_pos_llh_cov_cmp(const sbp_msg_pos_llh_cov_t *a, + const sbp_msg_pos_llh_cov_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_pos_llh_cov_t &lhs, const sbp_msg_pos_llh_cov_t &rhs) { +static inline bool operator==(const sbp_msg_pos_llh_cov_t &lhs, + const sbp_msg_pos_llh_cov_t &rhs) { return sbp_msg_pos_llh_cov_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_pos_llh_cov_t &lhs, const sbp_msg_pos_llh_cov_t &rhs) { +static inline bool operator!=(const sbp_msg_pos_llh_cov_t &lhs, + const sbp_msg_pos_llh_cov_t &rhs) { return sbp_msg_pos_llh_cov_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_pos_llh_cov_t &lhs, const sbp_msg_pos_llh_cov_t &rhs) { +static inline bool operator<(const sbp_msg_pos_llh_cov_t &lhs, + const sbp_msg_pos_llh_cov_t &rhs) { return sbp_msg_pos_llh_cov_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_pos_llh_cov_t &lhs, const sbp_msg_pos_llh_cov_t &rhs) { +static inline bool operator<=(const sbp_msg_pos_llh_cov_t &lhs, + const sbp_msg_pos_llh_cov_t &rhs) { return sbp_msg_pos_llh_cov_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_pos_llh_cov_t &lhs, const sbp_msg_pos_llh_cov_t &rhs) { +static inline bool operator>(const sbp_msg_pos_llh_cov_t &lhs, + const sbp_msg_pos_llh_cov_t &rhs) { return sbp_msg_pos_llh_cov_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_pos_llh_cov_t &lhs, const sbp_msg_pos_llh_cov_t &rhs) { +static inline bool operator>=(const sbp_msg_pos_llh_cov_t &lhs, + const sbp_msg_pos_llh_cov_t &rhs) { return sbp_msg_pos_llh_cov_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_POS_LLH_COV_H */ - diff --git a/c/include/libsbp/navigation/MSG_POS_LLH_COV_GNSS.h b/c/include/libsbp/navigation/MSG_POS_LLH_COV_GNSS.h index ebc1c4dd1..243254ded 100644 --- a/c/include/libsbp/navigation/MSG_POS_LLH_COV_GNSS.h +++ b/c/include/libsbp/navigation/MSG_POS_LLH_COV_GNSS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_POS_LLH_COV_GNSS_H #define LIBSBP_NAVIGATION_MSG_POS_LLH_COV_GNSS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,94 +40,86 @@ *****************************************************************************/ /** GNSS-only Geodetic Position with Covariances * - * This position solution message reports the absolute geodetic coordinates and the status (single point vs pseudo-absolute RTK) of the position solution as well as the upper triangle of the 3x3 covariance matrix. The position information and Fix Mode flags should follow the MSG_POS_LLH_GNSS message. Since the covariance matrix is computed in the local-level North, East, Down frame, the covariance terms follow with that convention. Thus, covariances are reported against the "downward" measurement and care should be taken with the sign convention. - * + * This position solution message reports the absolute geodetic coordinates and + * the status (single point vs pseudo-absolute RTK) of the position solution as + * well as the upper triangle of the 3x3 covariance matrix. The position + * information and Fix Mode flags should follow the MSG_POS_LLH_GNSS message. + * Since the covariance matrix is computed in the local-level North, East, Down + * frame, the covariance terms follow with that convention. Thus, covariances + * are reported against the "downward" measurement and care should be taken with + * the sign convention. + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Latitude [deg] + * Latitude [deg] */ double lat; - /** -* Longitude [deg] + * Longitude [deg] */ double lon; - /** -* Height above WGS84 ellipsoid [m] + * Height above WGS84 ellipsoid [m] */ double height; - /** -* Estimated variance of northing [m^2] + * Estimated variance of northing [m^2] */ float cov_n_n; - /** -* Covariance of northing and easting [m^2] + * Covariance of northing and easting [m^2] */ float cov_n_e; - /** -* Covariance of northing and downward measurement [m^2] + * Covariance of northing and downward measurement [m^2] */ float cov_n_d; - /** -* Estimated variance of easting [m^2] + * Estimated variance of easting [m^2] */ float cov_e_e; - /** -* Covariance of easting and downward measurement [m^2] + * Covariance of easting and downward measurement [m^2] */ float cov_e_d; - /** -* Estimated variance of downward measurement [m^2] + * Estimated variance of downward measurement [m^2] */ float cov_d_d; - /** -* Number of satellites used in solution. + * Number of satellites used in solution. */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_pos_llh_cov_gnss_t; - - /** * Get encoded size of an instance of sbp_msg_pos_llh_cov_gnss_t * * @param msg sbp_msg_pos_llh_cov_gnss_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_pos_llh_cov_gnss_encoded_len(const sbp_msg_pos_llh_cov_gnss_t *msg) -{ +static inline size_t sbp_msg_pos_llh_cov_gnss_encoded_len( + const sbp_msg_pos_llh_cov_gnss_t *msg) { (void)msg; return SBP_MSG_POS_LLH_COV_GNSS_ENCODED_LEN; } @@ -135,36 +127,53 @@ static inline size_t sbp_msg_pos_llh_cov_gnss_encoded_len(const sbp_msg_pos_llh_ /** * Encode an instance of sbp_msg_pos_llh_cov_gnss_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_pos_llh_cov_gnss_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_cov_gnss_t *msg); +SBP_EXPORT s8 +sbp_msg_pos_llh_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_llh_cov_gnss_t *msg); /** * Decode an instance of sbp_msg_pos_llh_cov_gnss_t from wire representation * - * This function decodes the wire representation of a sbp_msg_pos_llh_cov_gnss_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_pos_llh_cov_gnss_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_pos_llh_cov_gnss_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_cov_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_cov_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_pos_llh_cov_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_pos_llh_cov_gnss_t *msg); /** * Send an instance of sbp_msg_pos_llh_cov_gnss_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_pos_llh_cov_gnss_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_pos_llh_cov_gnss_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -172,51 +181,61 @@ SBP_EXPORT s8 sbp_msg_pos_llh_cov_gnss_decode(const uint8_t *buf, uint8_t len, u * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_cov_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_llh_cov_gnss_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_pos_llh_cov_gnss_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_pos_llh_cov_gnss_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_pos_llh_cov_gnss_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_pos_llh_cov_gnss_t instance * @param b sbp_msg_pos_llh_cov_gnss_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_pos_llh_cov_gnss_cmp(const sbp_msg_pos_llh_cov_gnss_t *a, const sbp_msg_pos_llh_cov_gnss_t *b); +SBP_EXPORT int sbp_msg_pos_llh_cov_gnss_cmp( + const sbp_msg_pos_llh_cov_gnss_t *a, const sbp_msg_pos_llh_cov_gnss_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_pos_llh_cov_gnss_t &lhs, const sbp_msg_pos_llh_cov_gnss_t &rhs) { +static inline bool operator==(const sbp_msg_pos_llh_cov_gnss_t &lhs, + const sbp_msg_pos_llh_cov_gnss_t &rhs) { return sbp_msg_pos_llh_cov_gnss_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_pos_llh_cov_gnss_t &lhs, const sbp_msg_pos_llh_cov_gnss_t &rhs) { +static inline bool operator!=(const sbp_msg_pos_llh_cov_gnss_t &lhs, + const sbp_msg_pos_llh_cov_gnss_t &rhs) { return sbp_msg_pos_llh_cov_gnss_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_pos_llh_cov_gnss_t &lhs, const sbp_msg_pos_llh_cov_gnss_t &rhs) { +static inline bool operator<(const sbp_msg_pos_llh_cov_gnss_t &lhs, + const sbp_msg_pos_llh_cov_gnss_t &rhs) { return sbp_msg_pos_llh_cov_gnss_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_pos_llh_cov_gnss_t &lhs, const sbp_msg_pos_llh_cov_gnss_t &rhs) { +static inline bool operator<=(const sbp_msg_pos_llh_cov_gnss_t &lhs, + const sbp_msg_pos_llh_cov_gnss_t &rhs) { return sbp_msg_pos_llh_cov_gnss_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_pos_llh_cov_gnss_t &lhs, const sbp_msg_pos_llh_cov_gnss_t &rhs) { +static inline bool operator>(const sbp_msg_pos_llh_cov_gnss_t &lhs, + const sbp_msg_pos_llh_cov_gnss_t &rhs) { return sbp_msg_pos_llh_cov_gnss_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_pos_llh_cov_gnss_t &lhs, const sbp_msg_pos_llh_cov_gnss_t &rhs) { +static inline bool operator>=(const sbp_msg_pos_llh_cov_gnss_t &lhs, + const sbp_msg_pos_llh_cov_gnss_t &rhs) { return sbp_msg_pos_llh_cov_gnss_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_POS_LLH_COV_GNSS_H */ - diff --git a/c/include/libsbp/navigation/MSG_POS_LLH_DEP_A.h b/c/include/libsbp/navigation/MSG_POS_LLH_DEP_A.h index 3bd7afbf4..af4c48382 100644 --- a/c/include/libsbp/navigation/MSG_POS_LLH_DEP_A.h +++ b/c/include/libsbp/navigation/MSG_POS_LLH_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_POS_LLH_DEP_A_H #define LIBSBP_NAVIGATION_MSG_POS_LLH_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,69 +40,59 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Latitude [deg] + * Latitude [deg] */ double lat; - /** -* Longitude [deg] + * Longitude [deg] */ double lon; - /** -* Height [m] + * Height [m] */ double height; - /** - * Horizontal position accuracy estimate (not implemented). Defaults to 0. [mm] + * Horizontal position accuracy estimate (not implemented). Defaults to 0. + * [mm] */ u16 h_accuracy; - /** - * Vertical position accuracy estimate (not implemented). Defaults to 0. [mm] + * Vertical position accuracy estimate (not implemented). Defaults to 0. [mm] */ u16 v_accuracy; - /** -* Number of satellites used in solution. + * Number of satellites used in solution. */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_pos_llh_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_pos_llh_dep_a_t * * @param msg sbp_msg_pos_llh_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_pos_llh_dep_a_encoded_len(const sbp_msg_pos_llh_dep_a_t *msg) -{ +static inline size_t sbp_msg_pos_llh_dep_a_encoded_len( + const sbp_msg_pos_llh_dep_a_t *msg) { (void)msg; return SBP_MSG_POS_LLH_DEP_A_ENCODED_LEN; } @@ -110,36 +100,53 @@ static inline size_t sbp_msg_pos_llh_dep_a_encoded_len(const sbp_msg_pos_llh_dep /** * Encode an instance of sbp_msg_pos_llh_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_pos_llh_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_pos_llh_dep_a_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_pos_llh_dep_a_t *msg); /** * Decode an instance of sbp_msg_pos_llh_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_pos_llh_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_pos_llh_dep_a_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_pos_llh_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_pos_llh_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_pos_llh_dep_a_t *msg); /** * Send an instance of sbp_msg_pos_llh_dep_a_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_pos_llh_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_pos_llh_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -147,51 +154,61 @@ SBP_EXPORT s8 sbp_msg_pos_llh_dep_a_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_llh_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_pos_llh_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_llh_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_pos_llh_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_pos_llh_dep_a_t instance * @param b sbp_msg_pos_llh_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_pos_llh_dep_a_cmp(const sbp_msg_pos_llh_dep_a_t *a, const sbp_msg_pos_llh_dep_a_t *b); +SBP_EXPORT int sbp_msg_pos_llh_dep_a_cmp(const sbp_msg_pos_llh_dep_a_t *a, + const sbp_msg_pos_llh_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_pos_llh_dep_a_t &lhs, const sbp_msg_pos_llh_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_pos_llh_dep_a_t &lhs, + const sbp_msg_pos_llh_dep_a_t &rhs) { return sbp_msg_pos_llh_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_pos_llh_dep_a_t &lhs, const sbp_msg_pos_llh_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_pos_llh_dep_a_t &lhs, + const sbp_msg_pos_llh_dep_a_t &rhs) { return sbp_msg_pos_llh_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_pos_llh_dep_a_t &lhs, const sbp_msg_pos_llh_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_pos_llh_dep_a_t &lhs, + const sbp_msg_pos_llh_dep_a_t &rhs) { return sbp_msg_pos_llh_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_pos_llh_dep_a_t &lhs, const sbp_msg_pos_llh_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_pos_llh_dep_a_t &lhs, + const sbp_msg_pos_llh_dep_a_t &rhs) { return sbp_msg_pos_llh_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_pos_llh_dep_a_t &lhs, const sbp_msg_pos_llh_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_pos_llh_dep_a_t &lhs, + const sbp_msg_pos_llh_dep_a_t &rhs) { return sbp_msg_pos_llh_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_pos_llh_dep_a_t &lhs, const sbp_msg_pos_llh_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_pos_llh_dep_a_t &lhs, + const sbp_msg_pos_llh_dep_a_t &rhs) { return sbp_msg_pos_llh_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_POS_LLH_DEP_A_H */ - diff --git a/c/include/libsbp/navigation/MSG_POS_LLH_GNSS.h b/c/include/libsbp/navigation/MSG_POS_LLH_GNSS.h index 7190bd656..ba56badbc 100644 --- a/c/include/libsbp/navigation/MSG_POS_LLH_GNSS.h +++ b/c/include/libsbp/navigation/MSG_POS_LLH_GNSS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_POS_LLH_GNSS_H #define LIBSBP_NAVIGATION_MSG_POS_LLH_GNSS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,70 +40,65 @@ *****************************************************************************/ /** GNSS-only Geodetic Position * - * This position solution message reports the absolute geodetic coordinates and the status (single point vs pseudo-absolute RTK) of the position solution. If the rover receiver knows the surveyed position of the base station and has an RTK solution, this reports a pseudo-absolute position solution using the base station position and the rover's RTK baseline vector. The full GPS time is given by the preceding MSG_GPS_TIME_GNSS with the matching time-of-week (tow). - * + * This position solution message reports the absolute geodetic coordinates and + * the status (single point vs pseudo-absolute RTK) of the position solution. If + * the rover receiver knows the surveyed position of the base station and has an + * RTK solution, this reports a pseudo-absolute position solution using the base + * station position and the rover's RTK baseline vector. The full GPS time is + * given by the preceding MSG_GPS_TIME_GNSS with the matching time-of-week + * (tow). + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Latitude [deg] + * Latitude [deg] */ double lat; - /** -* Longitude [deg] + * Longitude [deg] */ double lon; - /** -* Height above WGS84 ellipsoid [m] + * Height above WGS84 ellipsoid [m] */ double height; - /** -* Horizontal position estimated standard deviation [mm] + * Horizontal position estimated standard deviation [mm] */ u16 h_accuracy; - /** -* Vertical position estimated standard deviation [mm] + * Vertical position estimated standard deviation [mm] */ u16 v_accuracy; - /** -* Number of satellites used in solution. + * Number of satellites used in solution. */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_pos_llh_gnss_t; - - /** * Get encoded size of an instance of sbp_msg_pos_llh_gnss_t * * @param msg sbp_msg_pos_llh_gnss_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_pos_llh_gnss_encoded_len(const sbp_msg_pos_llh_gnss_t *msg) -{ +static inline size_t sbp_msg_pos_llh_gnss_encoded_len( + const sbp_msg_pos_llh_gnss_t *msg) { (void)msg; return SBP_MSG_POS_LLH_GNSS_ENCODED_LEN; } @@ -111,36 +106,53 @@ static inline size_t sbp_msg_pos_llh_gnss_encoded_len(const sbp_msg_pos_llh_gnss /** * Encode an instance of sbp_msg_pos_llh_gnss_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_pos_llh_gnss_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_pos_llh_gnss_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_pos_llh_gnss_t *msg); /** * Decode an instance of sbp_msg_pos_llh_gnss_t from wire representation * - * This function decodes the wire representation of a sbp_msg_pos_llh_gnss_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_pos_llh_gnss_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_pos_llh_gnss_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_pos_llh_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_pos_llh_gnss_t *msg); /** * Send an instance of sbp_msg_pos_llh_gnss_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_pos_llh_gnss_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_pos_llh_gnss_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -148,51 +160,61 @@ SBP_EXPORT s8 sbp_msg_pos_llh_gnss_decode(const uint8_t *buf, uint8_t len, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pos_llh_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_llh_gnss_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_pos_llh_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_llh_gnss_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_pos_llh_gnss_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_pos_llh_gnss_t instance * @param b sbp_msg_pos_llh_gnss_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_pos_llh_gnss_cmp(const sbp_msg_pos_llh_gnss_t *a, const sbp_msg_pos_llh_gnss_t *b); +SBP_EXPORT int sbp_msg_pos_llh_gnss_cmp(const sbp_msg_pos_llh_gnss_t *a, + const sbp_msg_pos_llh_gnss_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_pos_llh_gnss_t &lhs, const sbp_msg_pos_llh_gnss_t &rhs) { +static inline bool operator==(const sbp_msg_pos_llh_gnss_t &lhs, + const sbp_msg_pos_llh_gnss_t &rhs) { return sbp_msg_pos_llh_gnss_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_pos_llh_gnss_t &lhs, const sbp_msg_pos_llh_gnss_t &rhs) { +static inline bool operator!=(const sbp_msg_pos_llh_gnss_t &lhs, + const sbp_msg_pos_llh_gnss_t &rhs) { return sbp_msg_pos_llh_gnss_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_pos_llh_gnss_t &lhs, const sbp_msg_pos_llh_gnss_t &rhs) { +static inline bool operator<(const sbp_msg_pos_llh_gnss_t &lhs, + const sbp_msg_pos_llh_gnss_t &rhs) { return sbp_msg_pos_llh_gnss_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_pos_llh_gnss_t &lhs, const sbp_msg_pos_llh_gnss_t &rhs) { +static inline bool operator<=(const sbp_msg_pos_llh_gnss_t &lhs, + const sbp_msg_pos_llh_gnss_t &rhs) { return sbp_msg_pos_llh_gnss_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_pos_llh_gnss_t &lhs, const sbp_msg_pos_llh_gnss_t &rhs) { +static inline bool operator>(const sbp_msg_pos_llh_gnss_t &lhs, + const sbp_msg_pos_llh_gnss_t &rhs) { return sbp_msg_pos_llh_gnss_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_pos_llh_gnss_t &lhs, const sbp_msg_pos_llh_gnss_t &rhs) { +static inline bool operator>=(const sbp_msg_pos_llh_gnss_t &lhs, + const sbp_msg_pos_llh_gnss_t &rhs) { return sbp_msg_pos_llh_gnss_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_POS_LLH_GNSS_H */ - diff --git a/c/include/libsbp/navigation/MSG_PROTECTION_LEVEL.h b/c/include/libsbp/navigation/MSG_PROTECTION_LEVEL.h index 0ac24ba0f..eb26c54d1 100644 --- a/c/include/libsbp/navigation/MSG_PROTECTION_LEVEL.h +++ b/c/include/libsbp/navigation/MSG_PROTECTION_LEVEL.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_PROTECTION_LEVEL_H #define LIBSBP_NAVIGATION_MSG_PROTECTION_LEVEL_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,147 +40,127 @@ *****************************************************************************/ /** Computed state and Protection Levels * -* This message reports the protection levels associated to the given state estimate. The full GPS time is given by the preceding MSG_GPS_TIME with the matching time-of-week (tow). + * This message reports the protection levels associated to the given state + * estimate. The full GPS time is given by the preceding MSG_GPS_TIME with the + * matching time-of-week (tow). */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* GPS week number [weeks] + * GPS week number [weeks] */ s16 wn; - /** -* Horizontal protection level [cm] + * Horizontal protection level [cm] */ u16 hpl; - /** -* Vertical protection level [cm] + * Vertical protection level [cm] */ u16 vpl; - /** -* Along-track position error protection level [cm] + * Along-track position error protection level [cm] */ u16 atpl; - /** -* Cross-track position error protection level [cm] + * Cross-track position error protection level [cm] */ u16 ctpl; - /** - * Protection level for the error vector between estimated and true along/cross track velocity vector [mm/s] + * Protection level for the error vector between estimated and true + * along/cross track velocity vector [mm/s] */ u16 hvpl; - /** - * Protection level for the velocity in vehicle upright direction (different from vertical direction if on a slope) [mm/s] + * Protection level for the velocity in vehicle upright direction (different + * from vertical direction if on a slope) [mm/s] */ u16 vvpl; - /** -* Heading orientation protection level [mdeg] + * Heading orientation protection level [mdeg] */ u16 hopl; - /** -* Pitch orientation protection level [mdeg] + * Pitch orientation protection level [mdeg] */ u16 popl; - /** -* Roll orientation protection level [mdeg] + * Roll orientation protection level [mdeg] */ u16 ropl; - /** -* Latitude [deg] + * Latitude [deg] */ double lat; - /** -* Longitude [deg] + * Longitude [deg] */ double lon; - /** -* Height [m] + * Height [m] */ double height; - /** -* Velocity in vehicle x direction [mm/s] + * Velocity in vehicle x direction [mm/s] */ s32 v_x; - /** -* Velocity in vehicle y direction [mm/s] + * Velocity in vehicle y direction [mm/s] */ s32 v_y; - /** -* Velocity in vehicle z direction [mm/s] + * Velocity in vehicle z direction [mm/s] */ s32 v_z; - /** -* Roll angle [udeg] + * Roll angle [udeg] */ s32 roll; - /** -* Pitch angle [udeg] + * Pitch angle [udeg] */ s32 pitch; - /** -* Heading angle [udeg] + * Heading angle [udeg] */ s32 heading; - /** -* Status flags + * Status flags */ u32 flags; } sbp_msg_protection_level_t; - - /** * Get encoded size of an instance of sbp_msg_protection_level_t * * @param msg sbp_msg_protection_level_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_protection_level_encoded_len(const sbp_msg_protection_level_t *msg) -{ +static inline size_t sbp_msg_protection_level_encoded_len( + const sbp_msg_protection_level_t *msg) { (void)msg; return SBP_MSG_PROTECTION_LEVEL_ENCODED_LEN; } @@ -188,36 +168,53 @@ static inline size_t sbp_msg_protection_level_encoded_len(const sbp_msg_protecti /** * Encode an instance of sbp_msg_protection_level_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_protection_level_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_protection_level_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_protection_level_t *msg); +SBP_EXPORT s8 +sbp_msg_protection_level_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_protection_level_t *msg); /** * Decode an instance of sbp_msg_protection_level_t from wire representation * - * This function decodes the wire representation of a sbp_msg_protection_level_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_protection_level_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_protection_level_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_protection_level_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_protection_level_t *msg); +SBP_EXPORT s8 sbp_msg_protection_level_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_protection_level_t *msg); /** * Send an instance of sbp_msg_protection_level_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_protection_level_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_protection_level_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -225,51 +222,61 @@ SBP_EXPORT s8 sbp_msg_protection_level_decode(const uint8_t *buf, uint8_t len, u * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_protection_level_send(sbp_state_t *s, u16 sender_id, const sbp_msg_protection_level_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_protection_level_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_protection_level_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_protection_level_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_protection_level_t instance * @param b sbp_msg_protection_level_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_protection_level_cmp(const sbp_msg_protection_level_t *a, const sbp_msg_protection_level_t *b); +SBP_EXPORT int sbp_msg_protection_level_cmp( + const sbp_msg_protection_level_t *a, const sbp_msg_protection_level_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_protection_level_t &lhs, const sbp_msg_protection_level_t &rhs) { +static inline bool operator==(const sbp_msg_protection_level_t &lhs, + const sbp_msg_protection_level_t &rhs) { return sbp_msg_protection_level_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_protection_level_t &lhs, const sbp_msg_protection_level_t &rhs) { +static inline bool operator!=(const sbp_msg_protection_level_t &lhs, + const sbp_msg_protection_level_t &rhs) { return sbp_msg_protection_level_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_protection_level_t &lhs, const sbp_msg_protection_level_t &rhs) { +static inline bool operator<(const sbp_msg_protection_level_t &lhs, + const sbp_msg_protection_level_t &rhs) { return sbp_msg_protection_level_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_protection_level_t &lhs, const sbp_msg_protection_level_t &rhs) { +static inline bool operator<=(const sbp_msg_protection_level_t &lhs, + const sbp_msg_protection_level_t &rhs) { return sbp_msg_protection_level_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_protection_level_t &lhs, const sbp_msg_protection_level_t &rhs) { +static inline bool operator>(const sbp_msg_protection_level_t &lhs, + const sbp_msg_protection_level_t &rhs) { return sbp_msg_protection_level_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_protection_level_t &lhs, const sbp_msg_protection_level_t &rhs) { +static inline bool operator>=(const sbp_msg_protection_level_t &lhs, + const sbp_msg_protection_level_t &rhs) { return sbp_msg_protection_level_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_PROTECTION_LEVEL_H */ - diff --git a/c/include/libsbp/navigation/MSG_PROTECTION_LEVEL_DEP_A.h b/c/include/libsbp/navigation/MSG_PROTECTION_LEVEL_DEP_A.h index efef5b654..4083cb3a8 100644 --- a/c/include/libsbp/navigation/MSG_PROTECTION_LEVEL_DEP_A.h +++ b/c/include/libsbp/navigation/MSG_PROTECTION_LEVEL_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_PROTECTION_LEVEL_DEP_A_H #define LIBSBP_NAVIGATION_MSG_PROTECTION_LEVEL_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,63 +40,53 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Vertical protection level [cm] + * Vertical protection level [cm] */ u16 vpl; - /** -* Horizontal protection level [cm] + * Horizontal protection level [cm] */ u16 hpl; - /** -* Latitude [deg] + * Latitude [deg] */ double lat; - /** -* Longitude [deg] + * Longitude [deg] */ double lon; - /** -* Height [m] + * Height [m] */ double height; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_protection_level_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_protection_level_dep_a_t * * @param msg sbp_msg_protection_level_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_protection_level_dep_a_encoded_len(const sbp_msg_protection_level_dep_a_t *msg) -{ +static inline size_t sbp_msg_protection_level_dep_a_encoded_len( + const sbp_msg_protection_level_dep_a_t *msg) { (void)msg; return SBP_MSG_PROTECTION_LEVEL_DEP_A_ENCODED_LEN; } @@ -104,36 +94,56 @@ static inline size_t sbp_msg_protection_level_dep_a_encoded_len(const sbp_msg_pr /** * Encode an instance of sbp_msg_protection_level_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_protection_level_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_protection_level_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_protection_level_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_protection_level_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_protection_level_dep_a_t *msg); /** - * Decode an instance of sbp_msg_protection_level_dep_a_t from wire representation + * Decode an instance of sbp_msg_protection_level_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_protection_level_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_protection_level_dep_a_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_protection_level_dep_a_t instance + * @param buf Wire representation of the sbp_msg_protection_level_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_protection_level_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_protection_level_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_protection_level_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_protection_level_dep_a_t *msg); /** - * Send an instance of sbp_msg_protection_level_dep_a_t with the given write function + * Send an instance of sbp_msg_protection_level_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_protection_level_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_protection_level_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -141,51 +151,62 @@ SBP_EXPORT s8 sbp_msg_protection_level_dep_a_decode(const uint8_t *buf, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_protection_level_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_protection_level_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_protection_level_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_protection_level_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_protection_level_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_protection_level_dep_a_t instance * @param b sbp_msg_protection_level_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_protection_level_dep_a_cmp(const sbp_msg_protection_level_dep_a_t *a, const sbp_msg_protection_level_dep_a_t *b); +SBP_EXPORT int sbp_msg_protection_level_dep_a_cmp( + const sbp_msg_protection_level_dep_a_t *a, + const sbp_msg_protection_level_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_protection_level_dep_a_t &lhs, const sbp_msg_protection_level_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_protection_level_dep_a_t &lhs, + const sbp_msg_protection_level_dep_a_t &rhs) { return sbp_msg_protection_level_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_protection_level_dep_a_t &lhs, const sbp_msg_protection_level_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_protection_level_dep_a_t &lhs, + const sbp_msg_protection_level_dep_a_t &rhs) { return sbp_msg_protection_level_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_protection_level_dep_a_t &lhs, const sbp_msg_protection_level_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_protection_level_dep_a_t &lhs, + const sbp_msg_protection_level_dep_a_t &rhs) { return sbp_msg_protection_level_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_protection_level_dep_a_t &lhs, const sbp_msg_protection_level_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_protection_level_dep_a_t &lhs, + const sbp_msg_protection_level_dep_a_t &rhs) { return sbp_msg_protection_level_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_protection_level_dep_a_t &lhs, const sbp_msg_protection_level_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_protection_level_dep_a_t &lhs, + const sbp_msg_protection_level_dep_a_t &rhs) { return sbp_msg_protection_level_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_protection_level_dep_a_t &lhs, const sbp_msg_protection_level_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_protection_level_dep_a_t &lhs, + const sbp_msg_protection_level_dep_a_t &rhs) { return sbp_msg_protection_level_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_PROTECTION_LEVEL_DEP_A_H */ - diff --git a/c/include/libsbp/navigation/MSG_REFERENCE_FRAME_PARAM.h b/c/include/libsbp/navigation/MSG_REFERENCE_FRAME_PARAM.h index 50e9461d8..114ad9513 100644 --- a/c/include/libsbp/navigation/MSG_REFERENCE_FRAME_PARAM.h +++ b/c/include/libsbp/navigation/MSG_REFERENCE_FRAME_PARAM.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_REFERENCE_FRAME_PARAM_H #define LIBSBP_NAVIGATION_MSG_REFERENCE_FRAME_PARAM_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -39,138 +39,116 @@ * *****************************************************************************/ typedef struct { - - /** -* SSR IOD parameter. + * SSR IOD parameter. */ u8 ssr_iod; - /** -* Name of source coordinate-system. + * Name of source coordinate-system. */ char sn[SBP_MSG_REFERENCE_FRAME_PARAM_SN_MAX]; - /** -* Name of target coordinate-system. + * Name of target coordinate-system. */ char tn[SBP_MSG_REFERENCE_FRAME_PARAM_TN_MAX]; - /** -* System Identification Number. + * System Identification Number. */ u8 sin; - /** -* Utilized Transformation Message. + * Utilized Transformation Message. */ u16 utn; - /** - * Reference Epoch t0 for transformation parameter set given as Modified Julian Day (MJD) Number minus 44244 days. [1 day] + * Reference Epoch t0 for transformation parameter set given as Modified + * Julian Day (MJD) Number minus 44244 days. [1 day] */ u16 re_t0; - /** -* Translation in X for Reference Epoch t0. [0.001 m] + * Translation in X for Reference Epoch t0. [0.001 m] */ s32 delta_X0; - /** -* Translation in Y for Reference Epoch t0. [0.001 m] + * Translation in Y for Reference Epoch t0. [0.001 m] */ s32 delta_Y0; - /** -* Translation in Z for Reference Epoch t0. [0.001 m] + * Translation in Z for Reference Epoch t0. [0.001 m] */ s32 delta_Z0; - /** -* Rotation around the X-axis for Reference Epoch t0. [0.00002 "] + * Rotation around the X-axis for Reference Epoch t0. [0.00002 "] */ s32 theta_01; - /** -* Rotation around the Y-axis for Reference Epoch t0. [0.00002 "] + * Rotation around the Y-axis for Reference Epoch t0. [0.00002 "] */ s32 theta_02; - /** -* Rotation around the Z-axis for Reference Epoch t0. [0.00002 "] + * Rotation around the Z-axis for Reference Epoch t0. [0.00002 "] */ s32 theta_03; - /** -* Scale correction for Reference Epoch t0. [0.00001 ppm] + * Scale correction for Reference Epoch t0. [0.00001 ppm] */ s32 scale; - /** -* Rate of change of translation in X. [0.00002 m/yr] + * Rate of change of translation in X. [0.00002 m/yr] */ s32 dot_delta_X0; - /** -* Rate of change of translation in Y. [0.00002 m/yr] + * Rate of change of translation in Y. [0.00002 m/yr] */ s32 dot_delta_Y0; - /** -* Rate of change of translation in Z. [0.00002 m/yr] + * Rate of change of translation in Z. [0.00002 m/yr] */ s32 dot_delta_Z0; - /** -* Rate of change of rotation around the X-axis. [0.0000004 "/yr] + * Rate of change of rotation around the X-axis. [0.0000004 "/yr] */ s32 dot_theta_01; - /** -* Rate of change of rotation around the Y-axis. [0.0000004 "/yr] + * Rate of change of rotation around the Y-axis. [0.0000004 "/yr] */ s32 dot_theta_02; - /** -* Rate of change of rotation around the Z-axis. [0.0000004 "/yr] + * Rate of change of rotation around the Z-axis. [0.0000004 "/yr] */ s32 dot_theta_03; - /** -* Rate of change of scale correction. [0.0000002 ppm/yr] + * Rate of change of scale correction. [0.0000002 ppm/yr] */ s16 dot_scale; } sbp_msg_reference_frame_param_t; - - /** * Get encoded size of an instance of sbp_msg_reference_frame_param_t * * @param msg sbp_msg_reference_frame_param_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_reference_frame_param_encoded_len(const sbp_msg_reference_frame_param_t *msg) -{ +static inline size_t sbp_msg_reference_frame_param_encoded_len( + const sbp_msg_reference_frame_param_t *msg) { (void)msg; return SBP_MSG_REFERENCE_FRAME_PARAM_ENCODED_LEN; } @@ -178,36 +156,56 @@ static inline size_t sbp_msg_reference_frame_param_encoded_len(const sbp_msg_ref /** * Encode an instance of sbp_msg_reference_frame_param_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_reference_frame_param_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_reference_frame_param_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_reference_frame_param_t *msg); +SBP_EXPORT s8 sbp_msg_reference_frame_param_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_reference_frame_param_t *msg); /** - * Decode an instance of sbp_msg_reference_frame_param_t from wire representation + * Decode an instance of sbp_msg_reference_frame_param_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_reference_frame_param_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_reference_frame_param_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_reference_frame_param_t instance + * @param buf Wire representation of the sbp_msg_reference_frame_param_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_reference_frame_param_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_reference_frame_param_t *msg); +SBP_EXPORT s8 sbp_msg_reference_frame_param_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_reference_frame_param_t *msg); /** - * Send an instance of sbp_msg_reference_frame_param_t with the given write function + * Send an instance of sbp_msg_reference_frame_param_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_reference_frame_param_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_reference_frame_param_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -215,51 +213,62 @@ SBP_EXPORT s8 sbp_msg_reference_frame_param_decode(const uint8_t *buf, uint8_t l * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_reference_frame_param_send(sbp_state_t *s, u16 sender_id, const sbp_msg_reference_frame_param_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_reference_frame_param_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_reference_frame_param_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_reference_frame_param_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_reference_frame_param_t instance * @param b sbp_msg_reference_frame_param_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_reference_frame_param_cmp(const sbp_msg_reference_frame_param_t *a, const sbp_msg_reference_frame_param_t *b); +SBP_EXPORT int sbp_msg_reference_frame_param_cmp( + const sbp_msg_reference_frame_param_t *a, + const sbp_msg_reference_frame_param_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_reference_frame_param_t &lhs, const sbp_msg_reference_frame_param_t &rhs) { +static inline bool operator==(const sbp_msg_reference_frame_param_t &lhs, + const sbp_msg_reference_frame_param_t &rhs) { return sbp_msg_reference_frame_param_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_reference_frame_param_t &lhs, const sbp_msg_reference_frame_param_t &rhs) { +static inline bool operator!=(const sbp_msg_reference_frame_param_t &lhs, + const sbp_msg_reference_frame_param_t &rhs) { return sbp_msg_reference_frame_param_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_reference_frame_param_t &lhs, const sbp_msg_reference_frame_param_t &rhs) { +static inline bool operator<(const sbp_msg_reference_frame_param_t &lhs, + const sbp_msg_reference_frame_param_t &rhs) { return sbp_msg_reference_frame_param_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_reference_frame_param_t &lhs, const sbp_msg_reference_frame_param_t &rhs) { +static inline bool operator<=(const sbp_msg_reference_frame_param_t &lhs, + const sbp_msg_reference_frame_param_t &rhs) { return sbp_msg_reference_frame_param_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_reference_frame_param_t &lhs, const sbp_msg_reference_frame_param_t &rhs) { +static inline bool operator>(const sbp_msg_reference_frame_param_t &lhs, + const sbp_msg_reference_frame_param_t &rhs) { return sbp_msg_reference_frame_param_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_reference_frame_param_t &lhs, const sbp_msg_reference_frame_param_t &rhs) { +static inline bool operator>=(const sbp_msg_reference_frame_param_t &lhs, + const sbp_msg_reference_frame_param_t &rhs) { return sbp_msg_reference_frame_param_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_REFERENCE_FRAME_PARAM_H */ - diff --git a/c/include/libsbp/navigation/MSG_UTC_LEAP_SECOND.h b/c/include/libsbp/navigation/MSG_UTC_LEAP_SECOND.h index 49ba586c4..5b3e423af 100644 --- a/c/include/libsbp/navigation/MSG_UTC_LEAP_SECOND.h +++ b/c/include/libsbp/navigation/MSG_UTC_LEAP_SECOND.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_UTC_LEAP_SECOND_H #define LIBSBP_NAVIGATION_MSG_UTC_LEAP_SECOND_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,75 +41,64 @@ /** Leap second SBP message. * -* UTC-GPST leap seconds before and after the most recent (past, or future, for announced insertions) UTC leap second insertion. +* UTC-GPST leap seconds before and after the most recent (past, or future, for +announced insertions) UTC leap second insertion. */ typedef struct { - - /** - * Reserved. + * Reserved. */ s16 reserved_0; - /** - * Reserved. + * Reserved. */ s16 reserved_1; - /** - * Reserved. + * Reserved. */ s8 reserved_2; - /** -* Leap second count before insertion. [s] + * Leap second count before insertion. [s] */ s8 count_before; - /** -* Reserved. + * Reserved. */ u16 reserved_3; - /** -* Reserved. + * Reserved. */ u16 reserved_4; - /** -* Leap second reference GPS week number. [weeks] + * Leap second reference GPS week number. [weeks] */ u16 ref_wn; - /** -* Leap second reference day number. [days] + * Leap second reference day number. [days] */ u8 ref_dn; - /** -* Leap second count after insertion. [s] + * Leap second count after insertion. [s] */ s8 count_after; } sbp_msg_utc_leap_second_t; - - /** * Get encoded size of an instance of sbp_msg_utc_leap_second_t * * @param msg sbp_msg_utc_leap_second_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_utc_leap_second_encoded_len(const sbp_msg_utc_leap_second_t *msg) -{ +static inline size_t sbp_msg_utc_leap_second_encoded_len( + const sbp_msg_utc_leap_second_t *msg) { (void)msg; return SBP_MSG_UTC_LEAP_SECOND_ENCODED_LEN; } @@ -117,36 +106,53 @@ static inline size_t sbp_msg_utc_leap_second_encoded_len(const sbp_msg_utc_leap_ /** * Encode an instance of sbp_msg_utc_leap_second_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_utc_leap_second_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_utc_leap_second_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_utc_leap_second_t *msg); +SBP_EXPORT s8 +sbp_msg_utc_leap_second_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_utc_leap_second_t *msg); /** * Decode an instance of sbp_msg_utc_leap_second_t from wire representation * - * This function decodes the wire representation of a sbp_msg_utc_leap_second_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_utc_leap_second_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_utc_leap_second_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_utc_leap_second_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_utc_leap_second_t *msg); +SBP_EXPORT s8 sbp_msg_utc_leap_second_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_utc_leap_second_t *msg); /** * Send an instance of sbp_msg_utc_leap_second_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_utc_leap_second_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_utc_leap_second_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -154,51 +160,61 @@ SBP_EXPORT s8 sbp_msg_utc_leap_second_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_utc_leap_second_send(sbp_state_t *s, u16 sender_id, const sbp_msg_utc_leap_second_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_utc_leap_second_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_utc_leap_second_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_utc_leap_second_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_utc_leap_second_t instance * @param b sbp_msg_utc_leap_second_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_utc_leap_second_cmp(const sbp_msg_utc_leap_second_t *a, const sbp_msg_utc_leap_second_t *b); +SBP_EXPORT int sbp_msg_utc_leap_second_cmp(const sbp_msg_utc_leap_second_t *a, + const sbp_msg_utc_leap_second_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_utc_leap_second_t &lhs, const sbp_msg_utc_leap_second_t &rhs) { +static inline bool operator==(const sbp_msg_utc_leap_second_t &lhs, + const sbp_msg_utc_leap_second_t &rhs) { return sbp_msg_utc_leap_second_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_utc_leap_second_t &lhs, const sbp_msg_utc_leap_second_t &rhs) { +static inline bool operator!=(const sbp_msg_utc_leap_second_t &lhs, + const sbp_msg_utc_leap_second_t &rhs) { return sbp_msg_utc_leap_second_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_utc_leap_second_t &lhs, const sbp_msg_utc_leap_second_t &rhs) { +static inline bool operator<(const sbp_msg_utc_leap_second_t &lhs, + const sbp_msg_utc_leap_second_t &rhs) { return sbp_msg_utc_leap_second_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_utc_leap_second_t &lhs, const sbp_msg_utc_leap_second_t &rhs) { +static inline bool operator<=(const sbp_msg_utc_leap_second_t &lhs, + const sbp_msg_utc_leap_second_t &rhs) { return sbp_msg_utc_leap_second_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_utc_leap_second_t &lhs, const sbp_msg_utc_leap_second_t &rhs) { +static inline bool operator>(const sbp_msg_utc_leap_second_t &lhs, + const sbp_msg_utc_leap_second_t &rhs) { return sbp_msg_utc_leap_second_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_utc_leap_second_t &lhs, const sbp_msg_utc_leap_second_t &rhs) { +static inline bool operator>=(const sbp_msg_utc_leap_second_t &lhs, + const sbp_msg_utc_leap_second_t &rhs) { return sbp_msg_utc_leap_second_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_UTC_LEAP_SECOND_H */ - diff --git a/c/include/libsbp/navigation/MSG_UTC_TIME.h b/c/include/libsbp/navigation/MSG_UTC_TIME.h index c4d3627f5..9e8eb97c2 100644 --- a/c/include/libsbp/navigation/MSG_UTC_TIME.h +++ b/c/include/libsbp/navigation/MSG_UTC_TIME.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_UTC_TIME_H #define LIBSBP_NAVIGATION_MSG_UTC_TIME_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,76 +40,65 @@ *****************************************************************************/ /** UTC Time * - * This message reports the Universal Coordinated Time (UTC). Note the flags which indicate the source of the UTC offset value and source of the time fix. - * + * This message reports the Universal Coordinated Time (UTC). Note the flags + * which indicate the source of the UTC offset value and source of the time fix. + * */ typedef struct { - - /** -* Indicates source and time validity + * Indicates source and time validity */ u8 flags; - /** -* GPS time of week rounded to the nearest millisecond [ms] + * GPS time of week rounded to the nearest millisecond [ms] */ u32 tow; - /** -* Year [year] + * Year [year] */ u16 year; - /** -* Month (range 1 .. 12) [months] + * Month (range 1 .. 12) [months] */ u8 month; - /** -* days in the month (range 1-31) [day] + * days in the month (range 1-31) [day] */ u8 day; - /** -* hours of day (range 0-23) [hours] + * hours of day (range 0-23) [hours] */ u8 hours; - /** -* minutes of hour (range 0-59) [minutes] + * minutes of hour (range 0-59) [minutes] */ u8 minutes; - /** -* seconds of minute (range 0-60) rounded down [seconds] + * seconds of minute (range 0-60) rounded down [seconds] */ u8 seconds; - /** -* nanoseconds of second (range 0-999999999) [nanoseconds] + * nanoseconds of second (range 0-999999999) [nanoseconds] */ u32 ns; } sbp_msg_utc_time_t; - - /** * Get encoded size of an instance of sbp_msg_utc_time_t * * @param msg sbp_msg_utc_time_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_utc_time_encoded_len(const sbp_msg_utc_time_t *msg) -{ +static inline size_t sbp_msg_utc_time_encoded_len( + const sbp_msg_utc_time_t *msg) { (void)msg; return SBP_MSG_UTC_TIME_ENCODED_LEN; } @@ -117,36 +106,52 @@ static inline size_t sbp_msg_utc_time_encoded_len(const sbp_msg_utc_time_t *msg) /** * Encode an instance of sbp_msg_utc_time_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_utc_time_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_utc_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_utc_time_t *msg); +SBP_EXPORT s8 sbp_msg_utc_time_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_utc_time_t *msg); /** * Decode an instance of sbp_msg_utc_time_t from wire representation * - * This function decodes the wire representation of a sbp_msg_utc_time_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_utc_time_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_utc_time_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_utc_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_utc_time_t *msg); +SBP_EXPORT s8 sbp_msg_utc_time_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_utc_time_t *msg); /** * Send an instance of sbp_msg_utc_time_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_utc_time_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_utc_time_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -154,51 +159,61 @@ SBP_EXPORT s8 sbp_msg_utc_time_decode(const uint8_t *buf, uint8_t len, uint8_t * * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_utc_time_send(sbp_state_t *s, u16 sender_id, const sbp_msg_utc_time_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_utc_time_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_utc_time_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_utc_time_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_utc_time_t instance * @param b sbp_msg_utc_time_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_utc_time_cmp(const sbp_msg_utc_time_t *a, const sbp_msg_utc_time_t *b); +SBP_EXPORT int sbp_msg_utc_time_cmp(const sbp_msg_utc_time_t *a, + const sbp_msg_utc_time_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_utc_time_t &lhs, const sbp_msg_utc_time_t &rhs) { +static inline bool operator==(const sbp_msg_utc_time_t &lhs, + const sbp_msg_utc_time_t &rhs) { return sbp_msg_utc_time_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_utc_time_t &lhs, const sbp_msg_utc_time_t &rhs) { +static inline bool operator!=(const sbp_msg_utc_time_t &lhs, + const sbp_msg_utc_time_t &rhs) { return sbp_msg_utc_time_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_utc_time_t &lhs, const sbp_msg_utc_time_t &rhs) { +static inline bool operator<(const sbp_msg_utc_time_t &lhs, + const sbp_msg_utc_time_t &rhs) { return sbp_msg_utc_time_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_utc_time_t &lhs, const sbp_msg_utc_time_t &rhs) { +static inline bool operator<=(const sbp_msg_utc_time_t &lhs, + const sbp_msg_utc_time_t &rhs) { return sbp_msg_utc_time_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_utc_time_t &lhs, const sbp_msg_utc_time_t &rhs) { +static inline bool operator>(const sbp_msg_utc_time_t &lhs, + const sbp_msg_utc_time_t &rhs) { return sbp_msg_utc_time_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_utc_time_t &lhs, const sbp_msg_utc_time_t &rhs) { +static inline bool operator>=(const sbp_msg_utc_time_t &lhs, + const sbp_msg_utc_time_t &rhs) { return sbp_msg_utc_time_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_UTC_TIME_H */ - diff --git a/c/include/libsbp/navigation/MSG_UTC_TIME_GNSS.h b/c/include/libsbp/navigation/MSG_UTC_TIME_GNSS.h index 882216f70..a23ea4d53 100644 --- a/c/include/libsbp/navigation/MSG_UTC_TIME_GNSS.h +++ b/c/include/libsbp/navigation/MSG_UTC_TIME_GNSS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_UTC_TIME_GNSS_H #define LIBSBP_NAVIGATION_MSG_UTC_TIME_GNSS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,76 +40,65 @@ *****************************************************************************/ /** GNSS-only UTC Time * - * This message reports the Universal Coordinated Time (UTC). Note the flags which indicate the source of the UTC offset value and source of the time fix. - * + * This message reports the Universal Coordinated Time (UTC). Note the flags + * which indicate the source of the UTC offset value and source of the time fix. + * */ typedef struct { - - /** -* Indicates source and time validity + * Indicates source and time validity */ u8 flags; - /** -* GPS time of week rounded to the nearest millisecond [ms] + * GPS time of week rounded to the nearest millisecond [ms] */ u32 tow; - /** -* Year [year] + * Year [year] */ u16 year; - /** -* Month (range 1 .. 12) [months] + * Month (range 1 .. 12) [months] */ u8 month; - /** -* days in the month (range 1-31) [day] + * days in the month (range 1-31) [day] */ u8 day; - /** -* hours of day (range 0-23) [hours] + * hours of day (range 0-23) [hours] */ u8 hours; - /** -* minutes of hour (range 0-59) [minutes] + * minutes of hour (range 0-59) [minutes] */ u8 minutes; - /** -* seconds of minute (range 0-60) rounded down [seconds] + * seconds of minute (range 0-60) rounded down [seconds] */ u8 seconds; - /** -* nanoseconds of second (range 0-999999999) [nanoseconds] + * nanoseconds of second (range 0-999999999) [nanoseconds] */ u32 ns; } sbp_msg_utc_time_gnss_t; - - /** * Get encoded size of an instance of sbp_msg_utc_time_gnss_t * * @param msg sbp_msg_utc_time_gnss_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_utc_time_gnss_encoded_len(const sbp_msg_utc_time_gnss_t *msg) -{ +static inline size_t sbp_msg_utc_time_gnss_encoded_len( + const sbp_msg_utc_time_gnss_t *msg) { (void)msg; return SBP_MSG_UTC_TIME_GNSS_ENCODED_LEN; } @@ -117,36 +106,53 @@ static inline size_t sbp_msg_utc_time_gnss_encoded_len(const sbp_msg_utc_time_gn /** * Encode an instance of sbp_msg_utc_time_gnss_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_utc_time_gnss_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_utc_time_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_utc_time_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_utc_time_gnss_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_utc_time_gnss_t *msg); /** * Decode an instance of sbp_msg_utc_time_gnss_t from wire representation * - * This function decodes the wire representation of a sbp_msg_utc_time_gnss_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_utc_time_gnss_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_utc_time_gnss_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_utc_time_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_utc_time_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_utc_time_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_utc_time_gnss_t *msg); /** * Send an instance of sbp_msg_utc_time_gnss_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_utc_time_gnss_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_utc_time_gnss_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -154,51 +160,61 @@ SBP_EXPORT s8 sbp_msg_utc_time_gnss_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_utc_time_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_utc_time_gnss_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_utc_time_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_utc_time_gnss_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_utc_time_gnss_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_utc_time_gnss_t instance * @param b sbp_msg_utc_time_gnss_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_utc_time_gnss_cmp(const sbp_msg_utc_time_gnss_t *a, const sbp_msg_utc_time_gnss_t *b); +SBP_EXPORT int sbp_msg_utc_time_gnss_cmp(const sbp_msg_utc_time_gnss_t *a, + const sbp_msg_utc_time_gnss_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_utc_time_gnss_t &lhs, const sbp_msg_utc_time_gnss_t &rhs) { +static inline bool operator==(const sbp_msg_utc_time_gnss_t &lhs, + const sbp_msg_utc_time_gnss_t &rhs) { return sbp_msg_utc_time_gnss_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_utc_time_gnss_t &lhs, const sbp_msg_utc_time_gnss_t &rhs) { +static inline bool operator!=(const sbp_msg_utc_time_gnss_t &lhs, + const sbp_msg_utc_time_gnss_t &rhs) { return sbp_msg_utc_time_gnss_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_utc_time_gnss_t &lhs, const sbp_msg_utc_time_gnss_t &rhs) { +static inline bool operator<(const sbp_msg_utc_time_gnss_t &lhs, + const sbp_msg_utc_time_gnss_t &rhs) { return sbp_msg_utc_time_gnss_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_utc_time_gnss_t &lhs, const sbp_msg_utc_time_gnss_t &rhs) { +static inline bool operator<=(const sbp_msg_utc_time_gnss_t &lhs, + const sbp_msg_utc_time_gnss_t &rhs) { return sbp_msg_utc_time_gnss_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_utc_time_gnss_t &lhs, const sbp_msg_utc_time_gnss_t &rhs) { +static inline bool operator>(const sbp_msg_utc_time_gnss_t &lhs, + const sbp_msg_utc_time_gnss_t &rhs) { return sbp_msg_utc_time_gnss_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_utc_time_gnss_t &lhs, const sbp_msg_utc_time_gnss_t &rhs) { +static inline bool operator>=(const sbp_msg_utc_time_gnss_t &lhs, + const sbp_msg_utc_time_gnss_t &rhs) { return sbp_msg_utc_time_gnss_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_UTC_TIME_GNSS_H */ - diff --git a/c/include/libsbp/navigation/MSG_VEL_BODY.h b/c/include/libsbp/navigation/MSG_VEL_BODY.h index b830c8737..a07bb791f 100644 --- a/c/include/libsbp/navigation/MSG_VEL_BODY.h +++ b/c/include/libsbp/navigation/MSG_VEL_BODY.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_VEL_BODY_H #define LIBSBP_NAVIGATION_MSG_VEL_BODY_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,94 +40,87 @@ *****************************************************************************/ /** Velocity in User Frame * - * This message reports the velocity in the Vehicle Body Frame. By convention, the x-axis should point out the nose of the vehicle and represent the forward direction, while as the y-axis should point out the right hand side of the vehicle. Since this is a right handed system, z should point out the bottom of the vehicle. The orientation and origin of the Vehicle Body Frame are specified via the device settings. The full GPS time is given by the preceding MSG_GPS_TIME with the matching time-of-week (tow). This message is only produced by inertial versions of Swift products and is not available from Piksi Multi or Duro. - * + * This message reports the velocity in the Vehicle Body Frame. By convention, + * the x-axis should point out the nose of the vehicle and represent the forward + * direction, while as the y-axis should point out the right hand side of the + * vehicle. Since this is a right handed system, z should point out the bottom + * of the vehicle. The orientation and origin of the Vehicle Body Frame are + * specified via the device settings. The full GPS time is given by the + * preceding MSG_GPS_TIME with the matching time-of-week (tow). This message is + * only produced by inertial versions of Swift products and is not available + * from Piksi Multi or Duro. + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Velocity in x direction [mm/s] + * Velocity in x direction [mm/s] */ s32 x; - /** -* Velocity in y direction [mm/s] + * Velocity in y direction [mm/s] */ s32 y; - /** -* Velocity in z direction [mm/s] + * Velocity in z direction [mm/s] */ s32 z; - /** -* Estimated variance of x [m^2] + * Estimated variance of x [m^2] */ float cov_x_x; - /** -* Covariance of x and y [m^2] + * Covariance of x and y [m^2] */ float cov_x_y; - /** -* Covariance of x and z [m^2] + * Covariance of x and z [m^2] */ float cov_x_z; - /** -* Estimated variance of y [m^2] + * Estimated variance of y [m^2] */ float cov_y_y; - /** -* Covariance of y and z [m^2] + * Covariance of y and z [m^2] */ float cov_y_z; - /** -* Estimated variance of z [m^2] + * Estimated variance of z [m^2] */ float cov_z_z; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_vel_body_t; - - /** * Get encoded size of an instance of sbp_msg_vel_body_t * * @param msg sbp_msg_vel_body_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_vel_body_encoded_len(const sbp_msg_vel_body_t *msg) -{ +static inline size_t sbp_msg_vel_body_encoded_len( + const sbp_msg_vel_body_t *msg) { (void)msg; return SBP_MSG_VEL_BODY_ENCODED_LEN; } @@ -135,36 +128,52 @@ static inline size_t sbp_msg_vel_body_encoded_len(const sbp_msg_vel_body_t *msg) /** * Encode an instance of sbp_msg_vel_body_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_vel_body_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_body_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_body_t *msg); +SBP_EXPORT s8 sbp_msg_vel_body_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_vel_body_t *msg); /** * Decode an instance of sbp_msg_vel_body_t from wire representation * - * This function decodes the wire representation of a sbp_msg_vel_body_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_vel_body_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_vel_body_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_body_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_body_t *msg); +SBP_EXPORT s8 sbp_msg_vel_body_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_vel_body_t *msg); /** * Send an instance of sbp_msg_vel_body_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_vel_body_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_vel_body_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -172,51 +181,61 @@ SBP_EXPORT s8 sbp_msg_vel_body_decode(const uint8_t *buf, uint8_t len, uint8_t * * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_body_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_body_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_vel_body_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_body_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_vel_body_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_vel_body_t instance * @param b sbp_msg_vel_body_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_vel_body_cmp(const sbp_msg_vel_body_t *a, const sbp_msg_vel_body_t *b); +SBP_EXPORT int sbp_msg_vel_body_cmp(const sbp_msg_vel_body_t *a, + const sbp_msg_vel_body_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_vel_body_t &lhs, const sbp_msg_vel_body_t &rhs) { +static inline bool operator==(const sbp_msg_vel_body_t &lhs, + const sbp_msg_vel_body_t &rhs) { return sbp_msg_vel_body_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_vel_body_t &lhs, const sbp_msg_vel_body_t &rhs) { +static inline bool operator!=(const sbp_msg_vel_body_t &lhs, + const sbp_msg_vel_body_t &rhs) { return sbp_msg_vel_body_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_vel_body_t &lhs, const sbp_msg_vel_body_t &rhs) { +static inline bool operator<(const sbp_msg_vel_body_t &lhs, + const sbp_msg_vel_body_t &rhs) { return sbp_msg_vel_body_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_vel_body_t &lhs, const sbp_msg_vel_body_t &rhs) { +static inline bool operator<=(const sbp_msg_vel_body_t &lhs, + const sbp_msg_vel_body_t &rhs) { return sbp_msg_vel_body_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_vel_body_t &lhs, const sbp_msg_vel_body_t &rhs) { +static inline bool operator>(const sbp_msg_vel_body_t &lhs, + const sbp_msg_vel_body_t &rhs) { return sbp_msg_vel_body_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_vel_body_t &lhs, const sbp_msg_vel_body_t &rhs) { +static inline bool operator>=(const sbp_msg_vel_body_t &lhs, + const sbp_msg_vel_body_t &rhs) { return sbp_msg_vel_body_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_VEL_BODY_H */ - diff --git a/c/include/libsbp/navigation/MSG_VEL_COG.h b/c/include/libsbp/navigation/MSG_VEL_COG.h index 9eda71e6a..03d2c9935 100644 --- a/c/include/libsbp/navigation/MSG_VEL_COG.h +++ b/c/include/libsbp/navigation/MSG_VEL_COG.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_VEL_COG_H #define LIBSBP_NAVIGATION_MSG_VEL_COG_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,70 +40,68 @@ *****************************************************************************/ /** Velocity expressed as course over ground * - * This message reports the receiver course over ground (COG) and speed over ground (SOG) based on the horizontal (N-E) components of the NED velocity vector. It also includes the vertical velocity coordinate. A flag is provided to indicate whether the COG value has been frozen. When the flag is set to true, the COG field is set to its last valid value until the system exceeds a minimum velocity threshold. No other fields are affected by this flag. The NED coordinate system is defined as the local WGS84 tangent plane centered at the current position. The full GPS time is given by the preceding MSG_GPS_TIME with the matching time-of-week (tow). Note: course over ground represents the receiver's direction of travel, but not necessarily the device heading. - * + * This message reports the receiver course over ground (COG) and speed over + * ground (SOG) based on the horizontal (N-E) components of the NED velocity + * vector. It also includes the vertical velocity coordinate. A flag is provided + * to indicate whether the COG value has been frozen. When the flag is set to + * true, the COG field is set to its last valid value until the system exceeds a + * minimum velocity threshold. No other fields are affected by this flag. The + * NED coordinate system is defined as the local WGS84 tangent plane centered at + * the current position. The full GPS time is given by the preceding + * MSG_GPS_TIME with the matching time-of-week (tow). Note: course over ground + * represents the receiver's direction of travel, but not necessarily the device + * heading. + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Course over ground relative to north direction [microdegrees] + * Course over ground relative to north direction [microdegrees] */ u32 cog; - /** - * Speed over ground (based on horizontal velocity) [mm/s] + * Speed over ground (based on horizontal velocity) [mm/s] */ u32 sog; - /** -* Vertical velocity component (positive up) [mm/s] + * Vertical velocity component (positive up) [mm/s] */ s32 v_up; - /** - * Course over ground estimated standard deviation [microdegrees] + * Course over ground estimated standard deviation [microdegrees] */ u32 cog_accuracy; - /** - * Speed over ground estimated standard deviation [mm/s] + * Speed over ground estimated standard deviation [mm/s] */ u32 sog_accuracy; - /** - * Vertical velocity estimated standard deviation [mm/s] + * Vertical velocity estimated standard deviation [mm/s] */ u32 v_up_accuracy; - /** -* Status flags + * Status flags */ u16 flags; } sbp_msg_vel_cog_t; - - /** * Get encoded size of an instance of sbp_msg_vel_cog_t * * @param msg sbp_msg_vel_cog_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_vel_cog_encoded_len(const sbp_msg_vel_cog_t *msg) -{ +static inline size_t sbp_msg_vel_cog_encoded_len(const sbp_msg_vel_cog_t *msg) { (void)msg; return SBP_MSG_VEL_COG_ENCODED_LEN; } @@ -111,36 +109,52 @@ static inline size_t sbp_msg_vel_cog_encoded_len(const sbp_msg_vel_cog_t *msg) /** * Encode an instance of sbp_msg_vel_cog_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_vel_cog_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_cog_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_cog_t *msg); +SBP_EXPORT s8 sbp_msg_vel_cog_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_vel_cog_t *msg); /** * Decode an instance of sbp_msg_vel_cog_t from wire representation * - * This function decodes the wire representation of a sbp_msg_vel_cog_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_vel_cog_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_vel_cog_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_cog_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_cog_t *msg); +SBP_EXPORT s8 sbp_msg_vel_cog_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_vel_cog_t *msg); /** * Send an instance of sbp_msg_vel_cog_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_vel_cog_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_vel_cog_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -148,51 +162,61 @@ SBP_EXPORT s8 sbp_msg_vel_cog_decode(const uint8_t *buf, uint8_t len, uint8_t *n * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_cog_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_cog_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_vel_cog_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_cog_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_vel_cog_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_vel_cog_t instance * @param b sbp_msg_vel_cog_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_vel_cog_cmp(const sbp_msg_vel_cog_t *a, const sbp_msg_vel_cog_t *b); +SBP_EXPORT int sbp_msg_vel_cog_cmp(const sbp_msg_vel_cog_t *a, + const sbp_msg_vel_cog_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_vel_cog_t &lhs, const sbp_msg_vel_cog_t &rhs) { +static inline bool operator==(const sbp_msg_vel_cog_t &lhs, + const sbp_msg_vel_cog_t &rhs) { return sbp_msg_vel_cog_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_vel_cog_t &lhs, const sbp_msg_vel_cog_t &rhs) { +static inline bool operator!=(const sbp_msg_vel_cog_t &lhs, + const sbp_msg_vel_cog_t &rhs) { return sbp_msg_vel_cog_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_vel_cog_t &lhs, const sbp_msg_vel_cog_t &rhs) { +static inline bool operator<(const sbp_msg_vel_cog_t &lhs, + const sbp_msg_vel_cog_t &rhs) { return sbp_msg_vel_cog_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_vel_cog_t &lhs, const sbp_msg_vel_cog_t &rhs) { +static inline bool operator<=(const sbp_msg_vel_cog_t &lhs, + const sbp_msg_vel_cog_t &rhs) { return sbp_msg_vel_cog_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_vel_cog_t &lhs, const sbp_msg_vel_cog_t &rhs) { +static inline bool operator>(const sbp_msg_vel_cog_t &lhs, + const sbp_msg_vel_cog_t &rhs) { return sbp_msg_vel_cog_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_vel_cog_t &lhs, const sbp_msg_vel_cog_t &rhs) { +static inline bool operator>=(const sbp_msg_vel_cog_t &lhs, + const sbp_msg_vel_cog_t &rhs) { return sbp_msg_vel_cog_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_VEL_COG_H */ - diff --git a/c/include/libsbp/navigation/MSG_VEL_ECEF.h b/c/include/libsbp/navigation/MSG_VEL_ECEF.h index 7a2c80a7e..60146c835 100644 --- a/c/include/libsbp/navigation/MSG_VEL_ECEF.h +++ b/c/include/libsbp/navigation/MSG_VEL_ECEF.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_VEL_ECEF_H #define LIBSBP_NAVIGATION_MSG_VEL_ECEF_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,64 +40,56 @@ *****************************************************************************/ /** Velocity in ECEF * - * This message reports the velocity in Earth Centered Earth Fixed (ECEF) coordinates. The full GPS time is given by the preceding MSG_GPS_TIME with the matching time-of-week (tow). - * + * This message reports the velocity in Earth Centered Earth Fixed (ECEF) + * coordinates. The full GPS time is given by the preceding MSG_GPS_TIME with + * the matching time-of-week (tow). + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Velocity ECEF X coordinate [mm/s] + * Velocity ECEF X coordinate [mm/s] */ s32 x; - /** -* Velocity ECEF Y coordinate [mm/s] + * Velocity ECEF Y coordinate [mm/s] */ s32 y; - /** -* Velocity ECEF Z coordinate [mm/s] + * Velocity ECEF Z coordinate [mm/s] */ s32 z; - /** - * Velocity estimated standard deviation [mm/s] + * Velocity estimated standard deviation [mm/s] */ u16 accuracy; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_vel_ecef_t; - - /** * Get encoded size of an instance of sbp_msg_vel_ecef_t * * @param msg sbp_msg_vel_ecef_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_vel_ecef_encoded_len(const sbp_msg_vel_ecef_t *msg) -{ +static inline size_t sbp_msg_vel_ecef_encoded_len( + const sbp_msg_vel_ecef_t *msg) { (void)msg; return SBP_MSG_VEL_ECEF_ENCODED_LEN; } @@ -105,36 +97,52 @@ static inline size_t sbp_msg_vel_ecef_encoded_len(const sbp_msg_vel_ecef_t *msg) /** * Encode an instance of sbp_msg_vel_ecef_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_vel_ecef_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ecef_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ecef_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_vel_ecef_t *msg); /** * Decode an instance of sbp_msg_vel_ecef_t from wire representation * - * This function decodes the wire representation of a sbp_msg_vel_ecef_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_vel_ecef_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_vel_ecef_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ecef_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ecef_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_vel_ecef_t *msg); /** * Send an instance of sbp_msg_vel_ecef_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_vel_ecef_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_vel_ecef_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -142,51 +150,61 @@ SBP_EXPORT s8 sbp_msg_vel_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t * * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ecef_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ecef_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_vel_ecef_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ecef_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_vel_ecef_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_vel_ecef_t instance * @param b sbp_msg_vel_ecef_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_vel_ecef_cmp(const sbp_msg_vel_ecef_t *a, const sbp_msg_vel_ecef_t *b); +SBP_EXPORT int sbp_msg_vel_ecef_cmp(const sbp_msg_vel_ecef_t *a, + const sbp_msg_vel_ecef_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_vel_ecef_t &lhs, const sbp_msg_vel_ecef_t &rhs) { +static inline bool operator==(const sbp_msg_vel_ecef_t &lhs, + const sbp_msg_vel_ecef_t &rhs) { return sbp_msg_vel_ecef_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_vel_ecef_t &lhs, const sbp_msg_vel_ecef_t &rhs) { +static inline bool operator!=(const sbp_msg_vel_ecef_t &lhs, + const sbp_msg_vel_ecef_t &rhs) { return sbp_msg_vel_ecef_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_vel_ecef_t &lhs, const sbp_msg_vel_ecef_t &rhs) { +static inline bool operator<(const sbp_msg_vel_ecef_t &lhs, + const sbp_msg_vel_ecef_t &rhs) { return sbp_msg_vel_ecef_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_vel_ecef_t &lhs, const sbp_msg_vel_ecef_t &rhs) { +static inline bool operator<=(const sbp_msg_vel_ecef_t &lhs, + const sbp_msg_vel_ecef_t &rhs) { return sbp_msg_vel_ecef_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_vel_ecef_t &lhs, const sbp_msg_vel_ecef_t &rhs) { +static inline bool operator>(const sbp_msg_vel_ecef_t &lhs, + const sbp_msg_vel_ecef_t &rhs) { return sbp_msg_vel_ecef_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_vel_ecef_t &lhs, const sbp_msg_vel_ecef_t &rhs) { +static inline bool operator>=(const sbp_msg_vel_ecef_t &lhs, + const sbp_msg_vel_ecef_t &rhs) { return sbp_msg_vel_ecef_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_VEL_ECEF_H */ - diff --git a/c/include/libsbp/navigation/MSG_VEL_ECEF_COV.h b/c/include/libsbp/navigation/MSG_VEL_ECEF_COV.h index 1e7c5b34c..65ea698ef 100644 --- a/c/include/libsbp/navigation/MSG_VEL_ECEF_COV.h +++ b/c/include/libsbp/navigation/MSG_VEL_ECEF_COV.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_VEL_ECEF_COV_H #define LIBSBP_NAVIGATION_MSG_VEL_ECEF_COV_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,94 +40,81 @@ *****************************************************************************/ /** Velocity in ECEF with Covariances * - * This message reports the velocity in Earth Centered Earth Fixed (ECEF) coordinates. The full GPS time is given by the preceding MSG_GPS_TIME with the matching time-of-week (tow). - * + * This message reports the velocity in Earth Centered Earth Fixed (ECEF) + * coordinates. The full GPS time is given by the preceding MSG_GPS_TIME with + * the matching time-of-week (tow). + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Velocity ECEF X coordinate [mm/s] + * Velocity ECEF X coordinate [mm/s] */ s32 x; - /** -* Velocity ECEF Y coordinate [mm/s] + * Velocity ECEF Y coordinate [mm/s] */ s32 y; - /** -* Velocity ECEF Z coordinate [mm/s] + * Velocity ECEF Z coordinate [mm/s] */ s32 z; - /** -* Estimated variance of x [m^2/s^2] + * Estimated variance of x [m^2/s^2] */ float cov_x_x; - /** -* Estimated covariance of x and y [m^2/s^2] + * Estimated covariance of x and y [m^2/s^2] */ float cov_x_y; - /** -* Estimated covariance of x and z [m^2/s^2] + * Estimated covariance of x and z [m^2/s^2] */ float cov_x_z; - /** -* Estimated variance of y [m^2/s^2] + * Estimated variance of y [m^2/s^2] */ float cov_y_y; - /** -* Estimated covariance of y and z [m^2/s^2] + * Estimated covariance of y and z [m^2/s^2] */ float cov_y_z; - /** -* Estimated variance of z [m^2/s^2] + * Estimated variance of z [m^2/s^2] */ float cov_z_z; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_vel_ecef_cov_t; - - /** * Get encoded size of an instance of sbp_msg_vel_ecef_cov_t * * @param msg sbp_msg_vel_ecef_cov_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_vel_ecef_cov_encoded_len(const sbp_msg_vel_ecef_cov_t *msg) -{ +static inline size_t sbp_msg_vel_ecef_cov_encoded_len( + const sbp_msg_vel_ecef_cov_t *msg) { (void)msg; return SBP_MSG_VEL_ECEF_COV_ENCODED_LEN; } @@ -135,36 +122,53 @@ static inline size_t sbp_msg_vel_ecef_cov_encoded_len(const sbp_msg_vel_ecef_cov /** * Encode an instance of sbp_msg_vel_ecef_cov_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_vel_ecef_cov_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ecef_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ecef_cov_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ecef_cov_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_vel_ecef_cov_t *msg); /** * Decode an instance of sbp_msg_vel_ecef_cov_t from wire representation * - * This function decodes the wire representation of a sbp_msg_vel_ecef_cov_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_vel_ecef_cov_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_vel_ecef_cov_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ecef_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ecef_cov_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ecef_cov_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_vel_ecef_cov_t *msg); /** * Send an instance of sbp_msg_vel_ecef_cov_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_vel_ecef_cov_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_vel_ecef_cov_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -172,51 +176,61 @@ SBP_EXPORT s8 sbp_msg_vel_ecef_cov_decode(const uint8_t *buf, uint8_t len, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ecef_cov_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ecef_cov_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_vel_ecef_cov_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ecef_cov_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_vel_ecef_cov_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_vel_ecef_cov_t instance * @param b sbp_msg_vel_ecef_cov_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_vel_ecef_cov_cmp(const sbp_msg_vel_ecef_cov_t *a, const sbp_msg_vel_ecef_cov_t *b); +SBP_EXPORT int sbp_msg_vel_ecef_cov_cmp(const sbp_msg_vel_ecef_cov_t *a, + const sbp_msg_vel_ecef_cov_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_vel_ecef_cov_t &lhs, const sbp_msg_vel_ecef_cov_t &rhs) { +static inline bool operator==(const sbp_msg_vel_ecef_cov_t &lhs, + const sbp_msg_vel_ecef_cov_t &rhs) { return sbp_msg_vel_ecef_cov_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_vel_ecef_cov_t &lhs, const sbp_msg_vel_ecef_cov_t &rhs) { +static inline bool operator!=(const sbp_msg_vel_ecef_cov_t &lhs, + const sbp_msg_vel_ecef_cov_t &rhs) { return sbp_msg_vel_ecef_cov_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_vel_ecef_cov_t &lhs, const sbp_msg_vel_ecef_cov_t &rhs) { +static inline bool operator<(const sbp_msg_vel_ecef_cov_t &lhs, + const sbp_msg_vel_ecef_cov_t &rhs) { return sbp_msg_vel_ecef_cov_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_vel_ecef_cov_t &lhs, const sbp_msg_vel_ecef_cov_t &rhs) { +static inline bool operator<=(const sbp_msg_vel_ecef_cov_t &lhs, + const sbp_msg_vel_ecef_cov_t &rhs) { return sbp_msg_vel_ecef_cov_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_vel_ecef_cov_t &lhs, const sbp_msg_vel_ecef_cov_t &rhs) { +static inline bool operator>(const sbp_msg_vel_ecef_cov_t &lhs, + const sbp_msg_vel_ecef_cov_t &rhs) { return sbp_msg_vel_ecef_cov_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_vel_ecef_cov_t &lhs, const sbp_msg_vel_ecef_cov_t &rhs) { +static inline bool operator>=(const sbp_msg_vel_ecef_cov_t &lhs, + const sbp_msg_vel_ecef_cov_t &rhs) { return sbp_msg_vel_ecef_cov_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_VEL_ECEF_COV_H */ - diff --git a/c/include/libsbp/navigation/MSG_VEL_ECEF_COV_GNSS.h b/c/include/libsbp/navigation/MSG_VEL_ECEF_COV_GNSS.h index 05face9a6..babd053a9 100644 --- a/c/include/libsbp/navigation/MSG_VEL_ECEF_COV_GNSS.h +++ b/c/include/libsbp/navigation/MSG_VEL_ECEF_COV_GNSS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_VEL_ECEF_COV_GNSS_H #define LIBSBP_NAVIGATION_MSG_VEL_ECEF_COV_GNSS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,94 +40,81 @@ *****************************************************************************/ /** GNSS-only Velocity in ECEF with Covariances * - * This message reports the velocity in Earth Centered Earth Fixed (ECEF) coordinates. The full GPS time is given by the preceding MSG_GPS_TIME_GNSS with the matching time-of-week (tow). - * + * This message reports the velocity in Earth Centered Earth Fixed (ECEF) + * coordinates. The full GPS time is given by the preceding MSG_GPS_TIME_GNSS + * with the matching time-of-week (tow). + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Velocity ECEF X coordinate [mm/s] + * Velocity ECEF X coordinate [mm/s] */ s32 x; - /** -* Velocity ECEF Y coordinate [mm/s] + * Velocity ECEF Y coordinate [mm/s] */ s32 y; - /** -* Velocity ECEF Z coordinate [mm/s] + * Velocity ECEF Z coordinate [mm/s] */ s32 z; - /** -* Estimated variance of x [m^2/s^2] + * Estimated variance of x [m^2/s^2] */ float cov_x_x; - /** -* Estimated covariance of x and y [m^2/s^2] + * Estimated covariance of x and y [m^2/s^2] */ float cov_x_y; - /** -* Estimated covariance of x and z [m^2/s^2] + * Estimated covariance of x and z [m^2/s^2] */ float cov_x_z; - /** -* Estimated variance of y [m^2/s^2] + * Estimated variance of y [m^2/s^2] */ float cov_y_y; - /** -* Estimated covariance of y and z [m^2/s^2] + * Estimated covariance of y and z [m^2/s^2] */ float cov_y_z; - /** -* Estimated variance of z [m^2/s^2] + * Estimated variance of z [m^2/s^2] */ float cov_z_z; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_vel_ecef_cov_gnss_t; - - /** * Get encoded size of an instance of sbp_msg_vel_ecef_cov_gnss_t * * @param msg sbp_msg_vel_ecef_cov_gnss_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_vel_ecef_cov_gnss_encoded_len(const sbp_msg_vel_ecef_cov_gnss_t *msg) -{ +static inline size_t sbp_msg_vel_ecef_cov_gnss_encoded_len( + const sbp_msg_vel_ecef_cov_gnss_t *msg) { (void)msg; return SBP_MSG_VEL_ECEF_COV_GNSS_ENCODED_LEN; } @@ -135,36 +122,53 @@ static inline size_t sbp_msg_vel_ecef_cov_gnss_encoded_len(const sbp_msg_vel_ece /** * Encode an instance of sbp_msg_vel_ecef_cov_gnss_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_vel_ecef_cov_gnss_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ecef_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ecef_cov_gnss_t *msg); +SBP_EXPORT s8 +sbp_msg_vel_ecef_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ecef_cov_gnss_t *msg); /** * Decode an instance of sbp_msg_vel_ecef_cov_gnss_t from wire representation * - * This function decodes the wire representation of a sbp_msg_vel_ecef_cov_gnss_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_vel_ecef_cov_gnss_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_vel_ecef_cov_gnss_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ecef_cov_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ecef_cov_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ecef_cov_gnss_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ecef_cov_gnss_t *msg); /** * Send an instance of sbp_msg_vel_ecef_cov_gnss_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_vel_ecef_cov_gnss_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_vel_ecef_cov_gnss_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -172,51 +176,61 @@ SBP_EXPORT s8 sbp_msg_vel_ecef_cov_gnss_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ecef_cov_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ecef_cov_gnss_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_vel_ecef_cov_gnss_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ecef_cov_gnss_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_vel_ecef_cov_gnss_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_vel_ecef_cov_gnss_t instance * @param b sbp_msg_vel_ecef_cov_gnss_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_vel_ecef_cov_gnss_cmp(const sbp_msg_vel_ecef_cov_gnss_t *a, const sbp_msg_vel_ecef_cov_gnss_t *b); +SBP_EXPORT int sbp_msg_vel_ecef_cov_gnss_cmp( + const sbp_msg_vel_ecef_cov_gnss_t *a, const sbp_msg_vel_ecef_cov_gnss_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_vel_ecef_cov_gnss_t &lhs, const sbp_msg_vel_ecef_cov_gnss_t &rhs) { +static inline bool operator==(const sbp_msg_vel_ecef_cov_gnss_t &lhs, + const sbp_msg_vel_ecef_cov_gnss_t &rhs) { return sbp_msg_vel_ecef_cov_gnss_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_vel_ecef_cov_gnss_t &lhs, const sbp_msg_vel_ecef_cov_gnss_t &rhs) { +static inline bool operator!=(const sbp_msg_vel_ecef_cov_gnss_t &lhs, + const sbp_msg_vel_ecef_cov_gnss_t &rhs) { return sbp_msg_vel_ecef_cov_gnss_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_vel_ecef_cov_gnss_t &lhs, const sbp_msg_vel_ecef_cov_gnss_t &rhs) { +static inline bool operator<(const sbp_msg_vel_ecef_cov_gnss_t &lhs, + const sbp_msg_vel_ecef_cov_gnss_t &rhs) { return sbp_msg_vel_ecef_cov_gnss_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_vel_ecef_cov_gnss_t &lhs, const sbp_msg_vel_ecef_cov_gnss_t &rhs) { +static inline bool operator<=(const sbp_msg_vel_ecef_cov_gnss_t &lhs, + const sbp_msg_vel_ecef_cov_gnss_t &rhs) { return sbp_msg_vel_ecef_cov_gnss_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_vel_ecef_cov_gnss_t &lhs, const sbp_msg_vel_ecef_cov_gnss_t &rhs) { +static inline bool operator>(const sbp_msg_vel_ecef_cov_gnss_t &lhs, + const sbp_msg_vel_ecef_cov_gnss_t &rhs) { return sbp_msg_vel_ecef_cov_gnss_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_vel_ecef_cov_gnss_t &lhs, const sbp_msg_vel_ecef_cov_gnss_t &rhs) { +static inline bool operator>=(const sbp_msg_vel_ecef_cov_gnss_t &lhs, + const sbp_msg_vel_ecef_cov_gnss_t &rhs) { return sbp_msg_vel_ecef_cov_gnss_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_VEL_ECEF_COV_GNSS_H */ - diff --git a/c/include/libsbp/navigation/MSG_VEL_ECEF_DEP_A.h b/c/include/libsbp/navigation/MSG_VEL_ECEF_DEP_A.h index 2f20a393c..856a84cdc 100644 --- a/c/include/libsbp/navigation/MSG_VEL_ECEF_DEP_A.h +++ b/c/include/libsbp/navigation/MSG_VEL_ECEF_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_VEL_ECEF_DEP_A_H #define LIBSBP_NAVIGATION_MSG_VEL_ECEF_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,63 +40,53 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Velocity ECEF X coordinate [mm/s] + * Velocity ECEF X coordinate [mm/s] */ s32 x; - /** -* Velocity ECEF Y coordinate [mm/s] + * Velocity ECEF Y coordinate [mm/s] */ s32 y; - /** -* Velocity ECEF Z coordinate [mm/s] + * Velocity ECEF Z coordinate [mm/s] */ s32 z; - /** - * Velocity accuracy estimate (not implemented). Defaults to 0. [mm/s] + * Velocity accuracy estimate (not implemented). Defaults to 0. [mm/s] */ u16 accuracy; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags (reserved) + * Status flags (reserved) */ u8 flags; } sbp_msg_vel_ecef_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_vel_ecef_dep_a_t * * @param msg sbp_msg_vel_ecef_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_vel_ecef_dep_a_encoded_len(const sbp_msg_vel_ecef_dep_a_t *msg) -{ +static inline size_t sbp_msg_vel_ecef_dep_a_encoded_len( + const sbp_msg_vel_ecef_dep_a_t *msg) { (void)msg; return SBP_MSG_VEL_ECEF_DEP_A_ENCODED_LEN; } @@ -104,36 +94,53 @@ static inline size_t sbp_msg_vel_ecef_dep_a_encoded_len(const sbp_msg_vel_ecef_d /** * Encode an instance of sbp_msg_vel_ecef_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_vel_ecef_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ecef_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ecef_dep_a_t *msg); +SBP_EXPORT s8 +sbp_msg_vel_ecef_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ecef_dep_a_t *msg); /** * Decode an instance of sbp_msg_vel_ecef_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_vel_ecef_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_vel_ecef_dep_a_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_vel_ecef_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ecef_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_vel_ecef_dep_a_t *msg); /** * Send an instance of sbp_msg_vel_ecef_dep_a_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_vel_ecef_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_vel_ecef_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -141,51 +148,61 @@ SBP_EXPORT s8 sbp_msg_vel_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ecef_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ecef_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_vel_ecef_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ecef_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_vel_ecef_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_vel_ecef_dep_a_t instance * @param b sbp_msg_vel_ecef_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_vel_ecef_dep_a_cmp(const sbp_msg_vel_ecef_dep_a_t *a, const sbp_msg_vel_ecef_dep_a_t *b); +SBP_EXPORT int sbp_msg_vel_ecef_dep_a_cmp(const sbp_msg_vel_ecef_dep_a_t *a, + const sbp_msg_vel_ecef_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_vel_ecef_dep_a_t &lhs, const sbp_msg_vel_ecef_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_vel_ecef_dep_a_t &lhs, + const sbp_msg_vel_ecef_dep_a_t &rhs) { return sbp_msg_vel_ecef_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_vel_ecef_dep_a_t &lhs, const sbp_msg_vel_ecef_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_vel_ecef_dep_a_t &lhs, + const sbp_msg_vel_ecef_dep_a_t &rhs) { return sbp_msg_vel_ecef_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_vel_ecef_dep_a_t &lhs, const sbp_msg_vel_ecef_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_vel_ecef_dep_a_t &lhs, + const sbp_msg_vel_ecef_dep_a_t &rhs) { return sbp_msg_vel_ecef_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_vel_ecef_dep_a_t &lhs, const sbp_msg_vel_ecef_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_vel_ecef_dep_a_t &lhs, + const sbp_msg_vel_ecef_dep_a_t &rhs) { return sbp_msg_vel_ecef_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_vel_ecef_dep_a_t &lhs, const sbp_msg_vel_ecef_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_vel_ecef_dep_a_t &lhs, + const sbp_msg_vel_ecef_dep_a_t &rhs) { return sbp_msg_vel_ecef_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_vel_ecef_dep_a_t &lhs, const sbp_msg_vel_ecef_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_vel_ecef_dep_a_t &lhs, + const sbp_msg_vel_ecef_dep_a_t &rhs) { return sbp_msg_vel_ecef_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_VEL_ECEF_DEP_A_H */ - diff --git a/c/include/libsbp/navigation/MSG_VEL_ECEF_GNSS.h b/c/include/libsbp/navigation/MSG_VEL_ECEF_GNSS.h index 992b3ce7b..02492b6be 100644 --- a/c/include/libsbp/navigation/MSG_VEL_ECEF_GNSS.h +++ b/c/include/libsbp/navigation/MSG_VEL_ECEF_GNSS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_VEL_ECEF_GNSS_H #define LIBSBP_NAVIGATION_MSG_VEL_ECEF_GNSS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,64 +40,56 @@ *****************************************************************************/ /** GNSS-only Velocity in ECEF * - * This message reports the velocity in Earth Centered Earth Fixed (ECEF) coordinates. The full GPS time is given by the preceding MSG_GPS_TIME_GNSS with the matching time-of-week (tow). - * + * This message reports the velocity in Earth Centered Earth Fixed (ECEF) + * coordinates. The full GPS time is given by the preceding MSG_GPS_TIME_GNSS + * with the matching time-of-week (tow). + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Velocity ECEF X coordinate [mm/s] + * Velocity ECEF X coordinate [mm/s] */ s32 x; - /** -* Velocity ECEF Y coordinate [mm/s] + * Velocity ECEF Y coordinate [mm/s] */ s32 y; - /** -* Velocity ECEF Z coordinate [mm/s] + * Velocity ECEF Z coordinate [mm/s] */ s32 z; - /** - * Velocity estimated standard deviation [mm/s] + * Velocity estimated standard deviation [mm/s] */ u16 accuracy; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_vel_ecef_gnss_t; - - /** * Get encoded size of an instance of sbp_msg_vel_ecef_gnss_t * * @param msg sbp_msg_vel_ecef_gnss_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_vel_ecef_gnss_encoded_len(const sbp_msg_vel_ecef_gnss_t *msg) -{ +static inline size_t sbp_msg_vel_ecef_gnss_encoded_len( + const sbp_msg_vel_ecef_gnss_t *msg) { (void)msg; return SBP_MSG_VEL_ECEF_GNSS_ENCODED_LEN; } @@ -105,36 +97,53 @@ static inline size_t sbp_msg_vel_ecef_gnss_encoded_len(const sbp_msg_vel_ecef_gn /** * Encode an instance of sbp_msg_vel_ecef_gnss_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_vel_ecef_gnss_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ecef_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ecef_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ecef_gnss_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_vel_ecef_gnss_t *msg); /** * Decode an instance of sbp_msg_vel_ecef_gnss_t from wire representation * - * This function decodes the wire representation of a sbp_msg_vel_ecef_gnss_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_vel_ecef_gnss_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_vel_ecef_gnss_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ecef_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ecef_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ecef_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_vel_ecef_gnss_t *msg); /** * Send an instance of sbp_msg_vel_ecef_gnss_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_vel_ecef_gnss_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_vel_ecef_gnss_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -142,51 +151,61 @@ SBP_EXPORT s8 sbp_msg_vel_ecef_gnss_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ecef_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ecef_gnss_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_vel_ecef_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ecef_gnss_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_vel_ecef_gnss_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_vel_ecef_gnss_t instance * @param b sbp_msg_vel_ecef_gnss_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_vel_ecef_gnss_cmp(const sbp_msg_vel_ecef_gnss_t *a, const sbp_msg_vel_ecef_gnss_t *b); +SBP_EXPORT int sbp_msg_vel_ecef_gnss_cmp(const sbp_msg_vel_ecef_gnss_t *a, + const sbp_msg_vel_ecef_gnss_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_vel_ecef_gnss_t &lhs, const sbp_msg_vel_ecef_gnss_t &rhs) { +static inline bool operator==(const sbp_msg_vel_ecef_gnss_t &lhs, + const sbp_msg_vel_ecef_gnss_t &rhs) { return sbp_msg_vel_ecef_gnss_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_vel_ecef_gnss_t &lhs, const sbp_msg_vel_ecef_gnss_t &rhs) { +static inline bool operator!=(const sbp_msg_vel_ecef_gnss_t &lhs, + const sbp_msg_vel_ecef_gnss_t &rhs) { return sbp_msg_vel_ecef_gnss_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_vel_ecef_gnss_t &lhs, const sbp_msg_vel_ecef_gnss_t &rhs) { +static inline bool operator<(const sbp_msg_vel_ecef_gnss_t &lhs, + const sbp_msg_vel_ecef_gnss_t &rhs) { return sbp_msg_vel_ecef_gnss_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_vel_ecef_gnss_t &lhs, const sbp_msg_vel_ecef_gnss_t &rhs) { +static inline bool operator<=(const sbp_msg_vel_ecef_gnss_t &lhs, + const sbp_msg_vel_ecef_gnss_t &rhs) { return sbp_msg_vel_ecef_gnss_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_vel_ecef_gnss_t &lhs, const sbp_msg_vel_ecef_gnss_t &rhs) { +static inline bool operator>(const sbp_msg_vel_ecef_gnss_t &lhs, + const sbp_msg_vel_ecef_gnss_t &rhs) { return sbp_msg_vel_ecef_gnss_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_vel_ecef_gnss_t &lhs, const sbp_msg_vel_ecef_gnss_t &rhs) { +static inline bool operator>=(const sbp_msg_vel_ecef_gnss_t &lhs, + const sbp_msg_vel_ecef_gnss_t &rhs) { return sbp_msg_vel_ecef_gnss_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_VEL_ECEF_GNSS_H */ - diff --git a/c/include/libsbp/navigation/MSG_VEL_NED.h b/c/include/libsbp/navigation/MSG_VEL_NED.h index c4bc6058d..54b955058 100644 --- a/c/include/libsbp/navigation/MSG_VEL_NED.h +++ b/c/include/libsbp/navigation/MSG_VEL_NED.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_VEL_NED_H #define LIBSBP_NAVIGATION_MSG_VEL_NED_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,70 +40,61 @@ *****************************************************************************/ /** Velocity in NED * - * This message reports the velocity in local North East Down (NED) coordinates. The NED coordinate system is defined as the local WGS84 tangent plane centered at the current position. The full GPS time is given by the preceding MSG_GPS_TIME with the matching time-of-week (tow). - * + * This message reports the velocity in local North East Down (NED) coordinates. + * The NED coordinate system is defined as the local WGS84 tangent plane + * centered at the current position. The full GPS time is given by the preceding + * MSG_GPS_TIME with the matching time-of-week (tow). + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Velocity North coordinate [mm/s] + * Velocity North coordinate [mm/s] */ s32 n; - /** -* Velocity East coordinate [mm/s] + * Velocity East coordinate [mm/s] */ s32 e; - /** -* Velocity Down coordinate [mm/s] + * Velocity Down coordinate [mm/s] */ s32 d; - /** - * Horizontal velocity estimated standard deviation [mm/s] + * Horizontal velocity estimated standard deviation [mm/s] */ u16 h_accuracy; - /** - * Vertical velocity estimated standard deviation [mm/s] + * Vertical velocity estimated standard deviation [mm/s] */ u16 v_accuracy; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_vel_ned_t; - - /** * Get encoded size of an instance of sbp_msg_vel_ned_t * * @param msg sbp_msg_vel_ned_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_vel_ned_encoded_len(const sbp_msg_vel_ned_t *msg) -{ +static inline size_t sbp_msg_vel_ned_encoded_len(const sbp_msg_vel_ned_t *msg) { (void)msg; return SBP_MSG_VEL_NED_ENCODED_LEN; } @@ -111,36 +102,52 @@ static inline size_t sbp_msg_vel_ned_encoded_len(const sbp_msg_vel_ned_t *msg) /** * Encode an instance of sbp_msg_vel_ned_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_vel_ned_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ned_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ned_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ned_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_vel_ned_t *msg); /** * Decode an instance of sbp_msg_vel_ned_t from wire representation * - * This function decodes the wire representation of a sbp_msg_vel_ned_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_vel_ned_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_vel_ned_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ned_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ned_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ned_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_vel_ned_t *msg); /** * Send an instance of sbp_msg_vel_ned_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_vel_ned_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_vel_ned_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -148,51 +155,61 @@ SBP_EXPORT s8 sbp_msg_vel_ned_decode(const uint8_t *buf, uint8_t len, uint8_t *n * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ned_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ned_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_vel_ned_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ned_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_vel_ned_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_vel_ned_t instance * @param b sbp_msg_vel_ned_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_vel_ned_cmp(const sbp_msg_vel_ned_t *a, const sbp_msg_vel_ned_t *b); +SBP_EXPORT int sbp_msg_vel_ned_cmp(const sbp_msg_vel_ned_t *a, + const sbp_msg_vel_ned_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_vel_ned_t &lhs, const sbp_msg_vel_ned_t &rhs) { +static inline bool operator==(const sbp_msg_vel_ned_t &lhs, + const sbp_msg_vel_ned_t &rhs) { return sbp_msg_vel_ned_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_vel_ned_t &lhs, const sbp_msg_vel_ned_t &rhs) { +static inline bool operator!=(const sbp_msg_vel_ned_t &lhs, + const sbp_msg_vel_ned_t &rhs) { return sbp_msg_vel_ned_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_vel_ned_t &lhs, const sbp_msg_vel_ned_t &rhs) { +static inline bool operator<(const sbp_msg_vel_ned_t &lhs, + const sbp_msg_vel_ned_t &rhs) { return sbp_msg_vel_ned_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_vel_ned_t &lhs, const sbp_msg_vel_ned_t &rhs) { +static inline bool operator<=(const sbp_msg_vel_ned_t &lhs, + const sbp_msg_vel_ned_t &rhs) { return sbp_msg_vel_ned_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_vel_ned_t &lhs, const sbp_msg_vel_ned_t &rhs) { +static inline bool operator>(const sbp_msg_vel_ned_t &lhs, + const sbp_msg_vel_ned_t &rhs) { return sbp_msg_vel_ned_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_vel_ned_t &lhs, const sbp_msg_vel_ned_t &rhs) { +static inline bool operator>=(const sbp_msg_vel_ned_t &lhs, + const sbp_msg_vel_ned_t &rhs) { return sbp_msg_vel_ned_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_VEL_NED_H */ - diff --git a/c/include/libsbp/navigation/MSG_VEL_NED_COV.h b/c/include/libsbp/navigation/MSG_VEL_NED_COV.h index 90b8914f7..3211bc2a1 100644 --- a/c/include/libsbp/navigation/MSG_VEL_NED_COV.h +++ b/c/include/libsbp/navigation/MSG_VEL_NED_COV.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_VEL_NED_COV_H #define LIBSBP_NAVIGATION_MSG_VEL_NED_COV_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,94 +40,84 @@ *****************************************************************************/ /** Velocity in NED with Covariances * - * This message reports the velocity in local North East Down (NED) coordinates. The NED coordinate system is defined as the local WGS84 tangent plane centered at the current position. The full GPS time is given by the preceding MSG_GPS_TIME with the matching time-of-week (tow). This message is similar to the MSG_VEL_NED, but it includes the upper triangular portion of the 3x3 covariance matrix. - * + * This message reports the velocity in local North East Down (NED) coordinates. + * The NED coordinate system is defined as the local WGS84 tangent plane + * centered at the current position. The full GPS time is given by the preceding + * MSG_GPS_TIME with the matching time-of-week (tow). This message is similar to + * the MSG_VEL_NED, but it includes the upper triangular portion of the 3x3 + * covariance matrix. + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Velocity North coordinate [mm/s] + * Velocity North coordinate [mm/s] */ s32 n; - /** -* Velocity East coordinate [mm/s] + * Velocity East coordinate [mm/s] */ s32 e; - /** -* Velocity Down coordinate [mm/s] + * Velocity Down coordinate [mm/s] */ s32 d; - /** -* Estimated variance of northward measurement [m^2] + * Estimated variance of northward measurement [m^2] */ float cov_n_n; - /** -* Covariance of northward and eastward measurement [m^2] + * Covariance of northward and eastward measurement [m^2] */ float cov_n_e; - /** -* Covariance of northward and downward measurement [m^2] + * Covariance of northward and downward measurement [m^2] */ float cov_n_d; - /** -* Estimated variance of eastward measurement [m^2] + * Estimated variance of eastward measurement [m^2] */ float cov_e_e; - /** -* Covariance of eastward and downward measurement [m^2] + * Covariance of eastward and downward measurement [m^2] */ float cov_e_d; - /** -* Estimated variance of downward measurement [m^2] + * Estimated variance of downward measurement [m^2] */ float cov_d_d; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_vel_ned_cov_t; - - /** * Get encoded size of an instance of sbp_msg_vel_ned_cov_t * * @param msg sbp_msg_vel_ned_cov_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_vel_ned_cov_encoded_len(const sbp_msg_vel_ned_cov_t *msg) -{ +static inline size_t sbp_msg_vel_ned_cov_encoded_len( + const sbp_msg_vel_ned_cov_t *msg) { (void)msg; return SBP_MSG_VEL_NED_COV_ENCODED_LEN; } @@ -135,36 +125,53 @@ static inline size_t sbp_msg_vel_ned_cov_encoded_len(const sbp_msg_vel_ned_cov_t /** * Encode an instance of sbp_msg_vel_ned_cov_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_vel_ned_cov_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ned_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ned_cov_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ned_cov_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_vel_ned_cov_t *msg); /** * Decode an instance of sbp_msg_vel_ned_cov_t from wire representation * - * This function decodes the wire representation of a sbp_msg_vel_ned_cov_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_vel_ned_cov_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_vel_ned_cov_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ned_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ned_cov_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ned_cov_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_vel_ned_cov_t *msg); /** * Send an instance of sbp_msg_vel_ned_cov_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_vel_ned_cov_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_vel_ned_cov_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -172,51 +179,61 @@ SBP_EXPORT s8 sbp_msg_vel_ned_cov_decode(const uint8_t *buf, uint8_t len, uint8_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ned_cov_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ned_cov_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_vel_ned_cov_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ned_cov_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_vel_ned_cov_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_vel_ned_cov_t instance * @param b sbp_msg_vel_ned_cov_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_vel_ned_cov_cmp(const sbp_msg_vel_ned_cov_t *a, const sbp_msg_vel_ned_cov_t *b); +SBP_EXPORT int sbp_msg_vel_ned_cov_cmp(const sbp_msg_vel_ned_cov_t *a, + const sbp_msg_vel_ned_cov_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_vel_ned_cov_t &lhs, const sbp_msg_vel_ned_cov_t &rhs) { +static inline bool operator==(const sbp_msg_vel_ned_cov_t &lhs, + const sbp_msg_vel_ned_cov_t &rhs) { return sbp_msg_vel_ned_cov_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_vel_ned_cov_t &lhs, const sbp_msg_vel_ned_cov_t &rhs) { +static inline bool operator!=(const sbp_msg_vel_ned_cov_t &lhs, + const sbp_msg_vel_ned_cov_t &rhs) { return sbp_msg_vel_ned_cov_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_vel_ned_cov_t &lhs, const sbp_msg_vel_ned_cov_t &rhs) { +static inline bool operator<(const sbp_msg_vel_ned_cov_t &lhs, + const sbp_msg_vel_ned_cov_t &rhs) { return sbp_msg_vel_ned_cov_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_vel_ned_cov_t &lhs, const sbp_msg_vel_ned_cov_t &rhs) { +static inline bool operator<=(const sbp_msg_vel_ned_cov_t &lhs, + const sbp_msg_vel_ned_cov_t &rhs) { return sbp_msg_vel_ned_cov_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_vel_ned_cov_t &lhs, const sbp_msg_vel_ned_cov_t &rhs) { +static inline bool operator>(const sbp_msg_vel_ned_cov_t &lhs, + const sbp_msg_vel_ned_cov_t &rhs) { return sbp_msg_vel_ned_cov_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_vel_ned_cov_t &lhs, const sbp_msg_vel_ned_cov_t &rhs) { +static inline bool operator>=(const sbp_msg_vel_ned_cov_t &lhs, + const sbp_msg_vel_ned_cov_t &rhs) { return sbp_msg_vel_ned_cov_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_VEL_NED_COV_H */ - diff --git a/c/include/libsbp/navigation/MSG_VEL_NED_COV_GNSS.h b/c/include/libsbp/navigation/MSG_VEL_NED_COV_GNSS.h index b30ac286a..acf300f40 100644 --- a/c/include/libsbp/navigation/MSG_VEL_NED_COV_GNSS.h +++ b/c/include/libsbp/navigation/MSG_VEL_NED_COV_GNSS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_VEL_NED_COV_GNSS_H #define LIBSBP_NAVIGATION_MSG_VEL_NED_COV_GNSS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,94 +40,84 @@ *****************************************************************************/ /** GNSS-only Velocity in NED with Covariances * - * This message reports the velocity in local North East Down (NED) coordinates. The NED coordinate system is defined as the local WGS84 tangent plane centered at the current position. The full GPS time is given by the preceding MSG_GPS_TIME_GNSS with the matching time-of-week (tow). This message is similar to the MSG_VEL_NED_GNSS, but it includes the upper triangular portion of the 3x3 covariance matrix. - * + * This message reports the velocity in local North East Down (NED) coordinates. + * The NED coordinate system is defined as the local WGS84 tangent plane + * centered at the current position. The full GPS time is given by the preceding + * MSG_GPS_TIME_GNSS with the matching time-of-week (tow). This message is + * similar to the MSG_VEL_NED_GNSS, but it includes the upper triangular portion + * of the 3x3 covariance matrix. + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Velocity North coordinate [mm/s] + * Velocity North coordinate [mm/s] */ s32 n; - /** -* Velocity East coordinate [mm/s] + * Velocity East coordinate [mm/s] */ s32 e; - /** -* Velocity Down coordinate [mm/s] + * Velocity Down coordinate [mm/s] */ s32 d; - /** -* Estimated variance of northward measurement [m^2] + * Estimated variance of northward measurement [m^2] */ float cov_n_n; - /** -* Covariance of northward and eastward measurement [m^2] + * Covariance of northward and eastward measurement [m^2] */ float cov_n_e; - /** -* Covariance of northward and downward measurement [m^2] + * Covariance of northward and downward measurement [m^2] */ float cov_n_d; - /** -* Estimated variance of eastward measurement [m^2] + * Estimated variance of eastward measurement [m^2] */ float cov_e_e; - /** -* Covariance of eastward and downward measurement [m^2] + * Covariance of eastward and downward measurement [m^2] */ float cov_e_d; - /** -* Estimated variance of downward measurement [m^2] + * Estimated variance of downward measurement [m^2] */ float cov_d_d; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_vel_ned_cov_gnss_t; - - /** * Get encoded size of an instance of sbp_msg_vel_ned_cov_gnss_t * * @param msg sbp_msg_vel_ned_cov_gnss_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_vel_ned_cov_gnss_encoded_len(const sbp_msg_vel_ned_cov_gnss_t *msg) -{ +static inline size_t sbp_msg_vel_ned_cov_gnss_encoded_len( + const sbp_msg_vel_ned_cov_gnss_t *msg) { (void)msg; return SBP_MSG_VEL_NED_COV_GNSS_ENCODED_LEN; } @@ -135,36 +125,53 @@ static inline size_t sbp_msg_vel_ned_cov_gnss_encoded_len(const sbp_msg_vel_ned_ /** * Encode an instance of sbp_msg_vel_ned_cov_gnss_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_vel_ned_cov_gnss_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ned_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ned_cov_gnss_t *msg); +SBP_EXPORT s8 +sbp_msg_vel_ned_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ned_cov_gnss_t *msg); /** * Decode an instance of sbp_msg_vel_ned_cov_gnss_t from wire representation * - * This function decodes the wire representation of a sbp_msg_vel_ned_cov_gnss_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_vel_ned_cov_gnss_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_vel_ned_cov_gnss_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ned_cov_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ned_cov_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ned_cov_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_vel_ned_cov_gnss_t *msg); /** * Send an instance of sbp_msg_vel_ned_cov_gnss_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_vel_ned_cov_gnss_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_vel_ned_cov_gnss_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -172,51 +179,61 @@ SBP_EXPORT s8 sbp_msg_vel_ned_cov_gnss_decode(const uint8_t *buf, uint8_t len, u * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ned_cov_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ned_cov_gnss_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_vel_ned_cov_gnss_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ned_cov_gnss_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_vel_ned_cov_gnss_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_vel_ned_cov_gnss_t instance * @param b sbp_msg_vel_ned_cov_gnss_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_vel_ned_cov_gnss_cmp(const sbp_msg_vel_ned_cov_gnss_t *a, const sbp_msg_vel_ned_cov_gnss_t *b); +SBP_EXPORT int sbp_msg_vel_ned_cov_gnss_cmp( + const sbp_msg_vel_ned_cov_gnss_t *a, const sbp_msg_vel_ned_cov_gnss_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_vel_ned_cov_gnss_t &lhs, const sbp_msg_vel_ned_cov_gnss_t &rhs) { +static inline bool operator==(const sbp_msg_vel_ned_cov_gnss_t &lhs, + const sbp_msg_vel_ned_cov_gnss_t &rhs) { return sbp_msg_vel_ned_cov_gnss_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_vel_ned_cov_gnss_t &lhs, const sbp_msg_vel_ned_cov_gnss_t &rhs) { +static inline bool operator!=(const sbp_msg_vel_ned_cov_gnss_t &lhs, + const sbp_msg_vel_ned_cov_gnss_t &rhs) { return sbp_msg_vel_ned_cov_gnss_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_vel_ned_cov_gnss_t &lhs, const sbp_msg_vel_ned_cov_gnss_t &rhs) { +static inline bool operator<(const sbp_msg_vel_ned_cov_gnss_t &lhs, + const sbp_msg_vel_ned_cov_gnss_t &rhs) { return sbp_msg_vel_ned_cov_gnss_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_vel_ned_cov_gnss_t &lhs, const sbp_msg_vel_ned_cov_gnss_t &rhs) { +static inline bool operator<=(const sbp_msg_vel_ned_cov_gnss_t &lhs, + const sbp_msg_vel_ned_cov_gnss_t &rhs) { return sbp_msg_vel_ned_cov_gnss_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_vel_ned_cov_gnss_t &lhs, const sbp_msg_vel_ned_cov_gnss_t &rhs) { +static inline bool operator>(const sbp_msg_vel_ned_cov_gnss_t &lhs, + const sbp_msg_vel_ned_cov_gnss_t &rhs) { return sbp_msg_vel_ned_cov_gnss_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_vel_ned_cov_gnss_t &lhs, const sbp_msg_vel_ned_cov_gnss_t &rhs) { +static inline bool operator>=(const sbp_msg_vel_ned_cov_gnss_t &lhs, + const sbp_msg_vel_ned_cov_gnss_t &rhs) { return sbp_msg_vel_ned_cov_gnss_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_VEL_NED_COV_GNSS_H */ - diff --git a/c/include/libsbp/navigation/MSG_VEL_NED_DEP_A.h b/c/include/libsbp/navigation/MSG_VEL_NED_DEP_A.h index e80f0def1..861fe2507 100644 --- a/c/include/libsbp/navigation/MSG_VEL_NED_DEP_A.h +++ b/c/include/libsbp/navigation/MSG_VEL_NED_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_VEL_NED_DEP_A_H #define LIBSBP_NAVIGATION_MSG_VEL_NED_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,69 +40,60 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Velocity North coordinate [mm/s] + * Velocity North coordinate [mm/s] */ s32 n; - /** -* Velocity East coordinate [mm/s] + * Velocity East coordinate [mm/s] */ s32 e; - /** -* Velocity Down coordinate [mm/s] + * Velocity Down coordinate [mm/s] */ s32 d; - /** - * Horizontal velocity accuracy estimate (not implemented). Defaults to 0. [mm/s] + * Horizontal velocity accuracy estimate (not implemented). Defaults to 0. + * [mm/s] */ u16 h_accuracy; - /** - * Vertical velocity accuracy estimate (not implemented). Defaults to 0. [mm/s] + * Vertical velocity accuracy estimate (not implemented). Defaults to 0. + * [mm/s] */ u16 v_accuracy; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags (reserved) + * Status flags (reserved) */ u8 flags; } sbp_msg_vel_ned_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_vel_ned_dep_a_t * * @param msg sbp_msg_vel_ned_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_vel_ned_dep_a_encoded_len(const sbp_msg_vel_ned_dep_a_t *msg) -{ +static inline size_t sbp_msg_vel_ned_dep_a_encoded_len( + const sbp_msg_vel_ned_dep_a_t *msg) { (void)msg; return SBP_MSG_VEL_NED_DEP_A_ENCODED_LEN; } @@ -110,36 +101,53 @@ static inline size_t sbp_msg_vel_ned_dep_a_encoded_len(const sbp_msg_vel_ned_dep /** * Encode an instance of sbp_msg_vel_ned_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_vel_ned_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ned_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ned_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ned_dep_a_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_vel_ned_dep_a_t *msg); /** * Decode an instance of sbp_msg_vel_ned_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_vel_ned_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_vel_ned_dep_a_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_vel_ned_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ned_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ned_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ned_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_vel_ned_dep_a_t *msg); /** * Send an instance of sbp_msg_vel_ned_dep_a_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_vel_ned_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_vel_ned_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -147,51 +155,61 @@ SBP_EXPORT s8 sbp_msg_vel_ned_dep_a_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ned_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ned_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_vel_ned_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ned_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_vel_ned_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_vel_ned_dep_a_t instance * @param b sbp_msg_vel_ned_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_vel_ned_dep_a_cmp(const sbp_msg_vel_ned_dep_a_t *a, const sbp_msg_vel_ned_dep_a_t *b); +SBP_EXPORT int sbp_msg_vel_ned_dep_a_cmp(const sbp_msg_vel_ned_dep_a_t *a, + const sbp_msg_vel_ned_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_vel_ned_dep_a_t &lhs, const sbp_msg_vel_ned_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_vel_ned_dep_a_t &lhs, + const sbp_msg_vel_ned_dep_a_t &rhs) { return sbp_msg_vel_ned_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_vel_ned_dep_a_t &lhs, const sbp_msg_vel_ned_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_vel_ned_dep_a_t &lhs, + const sbp_msg_vel_ned_dep_a_t &rhs) { return sbp_msg_vel_ned_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_vel_ned_dep_a_t &lhs, const sbp_msg_vel_ned_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_vel_ned_dep_a_t &lhs, + const sbp_msg_vel_ned_dep_a_t &rhs) { return sbp_msg_vel_ned_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_vel_ned_dep_a_t &lhs, const sbp_msg_vel_ned_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_vel_ned_dep_a_t &lhs, + const sbp_msg_vel_ned_dep_a_t &rhs) { return sbp_msg_vel_ned_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_vel_ned_dep_a_t &lhs, const sbp_msg_vel_ned_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_vel_ned_dep_a_t &lhs, + const sbp_msg_vel_ned_dep_a_t &rhs) { return sbp_msg_vel_ned_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_vel_ned_dep_a_t &lhs, const sbp_msg_vel_ned_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_vel_ned_dep_a_t &lhs, + const sbp_msg_vel_ned_dep_a_t &rhs) { return sbp_msg_vel_ned_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_VEL_NED_DEP_A_H */ - diff --git a/c/include/libsbp/navigation/MSG_VEL_NED_GNSS.h b/c/include/libsbp/navigation/MSG_VEL_NED_GNSS.h index a22310b90..fc681587c 100644 --- a/c/include/libsbp/navigation/MSG_VEL_NED_GNSS.h +++ b/c/include/libsbp/navigation/MSG_VEL_NED_GNSS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_NAVIGATION_MSG_VEL_NED_GNSS_H #define LIBSBP_NAVIGATION_MSG_VEL_NED_GNSS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,70 +40,62 @@ *****************************************************************************/ /** GNSS-only Velocity in NED * - * This message reports the velocity in local North East Down (NED) coordinates. The NED coordinate system is defined as the local WGS84 tangent plane centered at the current position. The full GPS time is given by the preceding MSG_GPS_TIME_GNSS with the matching time-of-week (tow). - * + * This message reports the velocity in local North East Down (NED) coordinates. + * The NED coordinate system is defined as the local WGS84 tangent plane + * centered at the current position. The full GPS time is given by the preceding + * MSG_GPS_TIME_GNSS with the matching time-of-week (tow). + * */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Velocity North coordinate [mm/s] + * Velocity North coordinate [mm/s] */ s32 n; - /** -* Velocity East coordinate [mm/s] + * Velocity East coordinate [mm/s] */ s32 e; - /** -* Velocity Down coordinate [mm/s] + * Velocity Down coordinate [mm/s] */ s32 d; - /** - * Horizontal velocity estimated standard deviation [mm/s] + * Horizontal velocity estimated standard deviation [mm/s] */ u16 h_accuracy; - /** - * Vertical velocity estimated standard deviation [mm/s] + * Vertical velocity estimated standard deviation [mm/s] */ u16 v_accuracy; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_vel_ned_gnss_t; - - /** * Get encoded size of an instance of sbp_msg_vel_ned_gnss_t * * @param msg sbp_msg_vel_ned_gnss_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_vel_ned_gnss_encoded_len(const sbp_msg_vel_ned_gnss_t *msg) -{ +static inline size_t sbp_msg_vel_ned_gnss_encoded_len( + const sbp_msg_vel_ned_gnss_t *msg) { (void)msg; return SBP_MSG_VEL_NED_GNSS_ENCODED_LEN; } @@ -111,36 +103,53 @@ static inline size_t sbp_msg_vel_ned_gnss_encoded_len(const sbp_msg_vel_ned_gnss /** * Encode an instance of sbp_msg_vel_ned_gnss_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_vel_ned_gnss_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ned_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ned_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ned_gnss_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_vel_ned_gnss_t *msg); /** * Decode an instance of sbp_msg_vel_ned_gnss_t from wire representation * - * This function decodes the wire representation of a sbp_msg_vel_ned_gnss_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_vel_ned_gnss_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_vel_ned_gnss_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ned_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ned_gnss_t *msg); +SBP_EXPORT s8 sbp_msg_vel_ned_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_vel_ned_gnss_t *msg); /** * Send an instance of sbp_msg_vel_ned_gnss_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_vel_ned_gnss_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_vel_ned_gnss_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -148,51 +157,61 @@ SBP_EXPORT s8 sbp_msg_vel_ned_gnss_decode(const uint8_t *buf, uint8_t len, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_vel_ned_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ned_gnss_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_vel_ned_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ned_gnss_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_vel_ned_gnss_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_vel_ned_gnss_t instance * @param b sbp_msg_vel_ned_gnss_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_vel_ned_gnss_cmp(const sbp_msg_vel_ned_gnss_t *a, const sbp_msg_vel_ned_gnss_t *b); +SBP_EXPORT int sbp_msg_vel_ned_gnss_cmp(const sbp_msg_vel_ned_gnss_t *a, + const sbp_msg_vel_ned_gnss_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_vel_ned_gnss_t &lhs, const sbp_msg_vel_ned_gnss_t &rhs) { +static inline bool operator==(const sbp_msg_vel_ned_gnss_t &lhs, + const sbp_msg_vel_ned_gnss_t &rhs) { return sbp_msg_vel_ned_gnss_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_vel_ned_gnss_t &lhs, const sbp_msg_vel_ned_gnss_t &rhs) { +static inline bool operator!=(const sbp_msg_vel_ned_gnss_t &lhs, + const sbp_msg_vel_ned_gnss_t &rhs) { return sbp_msg_vel_ned_gnss_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_vel_ned_gnss_t &lhs, const sbp_msg_vel_ned_gnss_t &rhs) { +static inline bool operator<(const sbp_msg_vel_ned_gnss_t &lhs, + const sbp_msg_vel_ned_gnss_t &rhs) { return sbp_msg_vel_ned_gnss_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_vel_ned_gnss_t &lhs, const sbp_msg_vel_ned_gnss_t &rhs) { +static inline bool operator<=(const sbp_msg_vel_ned_gnss_t &lhs, + const sbp_msg_vel_ned_gnss_t &rhs) { return sbp_msg_vel_ned_gnss_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_vel_ned_gnss_t &lhs, const sbp_msg_vel_ned_gnss_t &rhs) { +static inline bool operator>(const sbp_msg_vel_ned_gnss_t &lhs, + const sbp_msg_vel_ned_gnss_t &rhs) { return sbp_msg_vel_ned_gnss_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_vel_ned_gnss_t &lhs, const sbp_msg_vel_ned_gnss_t &rhs) { +static inline bool operator>=(const sbp_msg_vel_ned_gnss_t &lhs, + const sbp_msg_vel_ned_gnss_t &rhs) { return sbp_msg_vel_ned_gnss_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NAVIGATION_MSG_VEL_NED_GNSS_H */ - diff --git a/c/include/libsbp/navigation_macros.h b/c/include/libsbp/navigation_macros.h index 0dfd24cd3..35b5e131c 100644 --- a/c/include/libsbp/navigation_macros.h +++ b/c/include/libsbp/navigation_macros.h @@ -18,145 +18,155 @@ #ifndef LIBSBP_NAVIGATION_MACROS_H #define LIBSBP_NAVIGATION_MACROS_H - #define SBP_MSG_GPS_TIME 0x0102 #define SBP_GPS_TIME_TIME_SOURCE_MASK (0x7u) #define SBP_GPS_TIME_TIME_SOURCE_SHIFT (0u) -#define SBP_GPS_TIME_TIME_SOURCE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_GPS_TIME_TIME_SOURCE_SHIFT) \ - & SBP_GPS_TIME_TIME_SOURCE_MASK)) -#define SBP_GPS_TIME_TIME_SOURCE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_GPS_TIME_TIME_SOURCE_MASK << SBP_GPS_TIME_TIME_SOURCE_SHIFT))) | \ - (((val) & (SBP_GPS_TIME_TIME_SOURCE_MASK)) \ - << (SBP_GPS_TIME_TIME_SOURCE_SHIFT)));} while(0) - +#define SBP_GPS_TIME_TIME_SOURCE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_GPS_TIME_TIME_SOURCE_SHIFT) & \ + SBP_GPS_TIME_TIME_SOURCE_MASK)) +#define SBP_GPS_TIME_TIME_SOURCE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_GPS_TIME_TIME_SOURCE_MASK \ + << SBP_GPS_TIME_TIME_SOURCE_SHIFT))) | \ + (((val) & (SBP_GPS_TIME_TIME_SOURCE_MASK)) \ + << (SBP_GPS_TIME_TIME_SOURCE_SHIFT))); \ + } while (0) #define SBP_GPS_TIME_TIME_SOURCE_NONE (0) #define SBP_GPS_TIME_TIME_SOURCE_GNSS_SOLUTION (1) #define SBP_GPS_TIME_TIME_SOURCE_PROPAGATED (2) /** - * Encoded length of sbp_msg_gps_time_t (V4 API) and + * Encoded length of sbp_msg_gps_time_t (V4 API) and * msg_gps_time_t (legacy API) */ #define SBP_MSG_GPS_TIME_ENCODED_LEN 11u - #define SBP_MSG_GPS_TIME_GNSS 0x0104 #define SBP_GPS_TIME_GNSS_TIME_SOURCE_MASK (0x7u) #define SBP_GPS_TIME_GNSS_TIME_SOURCE_SHIFT (0u) -#define SBP_GPS_TIME_GNSS_TIME_SOURCE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_GPS_TIME_GNSS_TIME_SOURCE_SHIFT) \ - & SBP_GPS_TIME_GNSS_TIME_SOURCE_MASK)) -#define SBP_GPS_TIME_GNSS_TIME_SOURCE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_GPS_TIME_GNSS_TIME_SOURCE_MASK << SBP_GPS_TIME_GNSS_TIME_SOURCE_SHIFT))) | \ - (((val) & (SBP_GPS_TIME_GNSS_TIME_SOURCE_MASK)) \ - << (SBP_GPS_TIME_GNSS_TIME_SOURCE_SHIFT)));} while(0) - +#define SBP_GPS_TIME_GNSS_TIME_SOURCE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_GPS_TIME_GNSS_TIME_SOURCE_SHIFT) & \ + SBP_GPS_TIME_GNSS_TIME_SOURCE_MASK)) +#define SBP_GPS_TIME_GNSS_TIME_SOURCE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_GPS_TIME_GNSS_TIME_SOURCE_MASK \ + << SBP_GPS_TIME_GNSS_TIME_SOURCE_SHIFT))) | \ + (((val) & (SBP_GPS_TIME_GNSS_TIME_SOURCE_MASK)) \ + << (SBP_GPS_TIME_GNSS_TIME_SOURCE_SHIFT))); \ + } while (0) #define SBP_GPS_TIME_GNSS_TIME_SOURCE_NONE (0) #define SBP_GPS_TIME_GNSS_TIME_SOURCE_GNSS_SOLUTION (1) #define SBP_GPS_TIME_GNSS_TIME_SOURCE_PROPAGATED (2) /** - * Encoded length of sbp_msg_gps_time_gnss_t (V4 API) and + * Encoded length of sbp_msg_gps_time_gnss_t (V4 API) and * msg_gps_time_gnss_t (legacy API) */ #define SBP_MSG_GPS_TIME_GNSS_ENCODED_LEN 11u - #define SBP_MSG_UTC_TIME 0x0103 #define SBP_UTC_TIME_UTC_OFFSET_SOURCE_MASK (0x3u) #define SBP_UTC_TIME_UTC_OFFSET_SOURCE_SHIFT (3u) -#define SBP_UTC_TIME_UTC_OFFSET_SOURCE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_UTC_TIME_UTC_OFFSET_SOURCE_SHIFT) \ - & SBP_UTC_TIME_UTC_OFFSET_SOURCE_MASK)) -#define SBP_UTC_TIME_UTC_OFFSET_SOURCE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_UTC_TIME_UTC_OFFSET_SOURCE_MASK << SBP_UTC_TIME_UTC_OFFSET_SOURCE_SHIFT))) | \ - (((val) & (SBP_UTC_TIME_UTC_OFFSET_SOURCE_MASK)) \ - << (SBP_UTC_TIME_UTC_OFFSET_SOURCE_SHIFT)));} while(0) - +#define SBP_UTC_TIME_UTC_OFFSET_SOURCE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_UTC_TIME_UTC_OFFSET_SOURCE_SHIFT) & \ + SBP_UTC_TIME_UTC_OFFSET_SOURCE_MASK)) +#define SBP_UTC_TIME_UTC_OFFSET_SOURCE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_UTC_TIME_UTC_OFFSET_SOURCE_MASK \ + << SBP_UTC_TIME_UTC_OFFSET_SOURCE_SHIFT))) | \ + (((val) & (SBP_UTC_TIME_UTC_OFFSET_SOURCE_MASK)) \ + << (SBP_UTC_TIME_UTC_OFFSET_SOURCE_SHIFT))); \ + } while (0) #define SBP_UTC_TIME_UTC_OFFSET_SOURCE_FACTORY_DEFAULT (0) #define SBP_UTC_TIME_UTC_OFFSET_SOURCE_NON_VOLATILE_MEMORY (1) #define SBP_UTC_TIME_UTC_OFFSET_SOURCE_DECODED_THIS_SESSION (2) #define SBP_UTC_TIME_TIME_SOURCE_MASK (0x7u) #define SBP_UTC_TIME_TIME_SOURCE_SHIFT (0u) -#define SBP_UTC_TIME_TIME_SOURCE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_UTC_TIME_TIME_SOURCE_SHIFT) \ - & SBP_UTC_TIME_TIME_SOURCE_MASK)) -#define SBP_UTC_TIME_TIME_SOURCE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_UTC_TIME_TIME_SOURCE_MASK << SBP_UTC_TIME_TIME_SOURCE_SHIFT))) | \ - (((val) & (SBP_UTC_TIME_TIME_SOURCE_MASK)) \ - << (SBP_UTC_TIME_TIME_SOURCE_SHIFT)));} while(0) - +#define SBP_UTC_TIME_TIME_SOURCE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_UTC_TIME_TIME_SOURCE_SHIFT) & \ + SBP_UTC_TIME_TIME_SOURCE_MASK)) +#define SBP_UTC_TIME_TIME_SOURCE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_UTC_TIME_TIME_SOURCE_MASK \ + << SBP_UTC_TIME_TIME_SOURCE_SHIFT))) | \ + (((val) & (SBP_UTC_TIME_TIME_SOURCE_MASK)) \ + << (SBP_UTC_TIME_TIME_SOURCE_SHIFT))); \ + } while (0) #define SBP_UTC_TIME_TIME_SOURCE_NONE (0) #define SBP_UTC_TIME_TIME_SOURCE_GNSS_SOLUTION (1) #define SBP_UTC_TIME_TIME_SOURCE_PROPAGATED (2) /** - * Encoded length of sbp_msg_utc_time_t (V4 API) and + * Encoded length of sbp_msg_utc_time_t (V4 API) and * msg_utc_time_t (legacy API) */ #define SBP_MSG_UTC_TIME_ENCODED_LEN 16u - #define SBP_MSG_UTC_TIME_GNSS 0x0105 #define SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_MASK (0x3u) #define SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_SHIFT (3u) -#define SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_SHIFT) \ - & SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_MASK)) -#define SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_MASK << SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_SHIFT))) | \ - (((val) & (SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_MASK)) \ - << (SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_SHIFT)));} while(0) - +#define SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_SHIFT) & \ + SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_MASK)) +#define SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_MASK \ + << SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_SHIFT))) | \ + (((val) & (SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_MASK)) \ + << (SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_SHIFT))); \ + } while (0) #define SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_FACTORY_DEFAULT (0) #define SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_NON_VOLATILE_MEMORY (1) #define SBP_UTC_TIME_GNSS_UTC_OFFSET_SOURCE_DECODED_THIS_SESSION (2) #define SBP_UTC_TIME_GNSS_TIME_SOURCE_MASK (0x7u) #define SBP_UTC_TIME_GNSS_TIME_SOURCE_SHIFT (0u) -#define SBP_UTC_TIME_GNSS_TIME_SOURCE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_UTC_TIME_GNSS_TIME_SOURCE_SHIFT) \ - & SBP_UTC_TIME_GNSS_TIME_SOURCE_MASK)) -#define SBP_UTC_TIME_GNSS_TIME_SOURCE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_UTC_TIME_GNSS_TIME_SOURCE_MASK << SBP_UTC_TIME_GNSS_TIME_SOURCE_SHIFT))) | \ - (((val) & (SBP_UTC_TIME_GNSS_TIME_SOURCE_MASK)) \ - << (SBP_UTC_TIME_GNSS_TIME_SOURCE_SHIFT)));} while(0) - +#define SBP_UTC_TIME_GNSS_TIME_SOURCE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_UTC_TIME_GNSS_TIME_SOURCE_SHIFT) & \ + SBP_UTC_TIME_GNSS_TIME_SOURCE_MASK)) +#define SBP_UTC_TIME_GNSS_TIME_SOURCE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_UTC_TIME_GNSS_TIME_SOURCE_MASK \ + << SBP_UTC_TIME_GNSS_TIME_SOURCE_SHIFT))) | \ + (((val) & (SBP_UTC_TIME_GNSS_TIME_SOURCE_MASK)) \ + << (SBP_UTC_TIME_GNSS_TIME_SOURCE_SHIFT))); \ + } while (0) #define SBP_UTC_TIME_GNSS_TIME_SOURCE_NONE (0) #define SBP_UTC_TIME_GNSS_TIME_SOURCE_GNSS_SOLUTION (1) #define SBP_UTC_TIME_GNSS_TIME_SOURCE_PROPAGATED (2) /** - * Encoded length of sbp_msg_utc_time_gnss_t (V4 API) and + * Encoded length of sbp_msg_utc_time_gnss_t (V4 API) and * msg_utc_time_gnss_t (legacy API) */ #define SBP_MSG_UTC_TIME_GNSS_ENCODED_LEN 16u - #define SBP_MSG_DOPS 0x0208 #define SBP_DOPS_RAIM_REPAIR_FLAG_MASK (0x1u) #define SBP_DOPS_RAIM_REPAIR_FLAG_SHIFT (7u) -#define SBP_DOPS_RAIM_REPAIR_FLAG_GET(flags) \ - ((u8)((u8)((flags) >> SBP_DOPS_RAIM_REPAIR_FLAG_SHIFT) \ - & SBP_DOPS_RAIM_REPAIR_FLAG_MASK)) -#define SBP_DOPS_RAIM_REPAIR_FLAG_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_DOPS_RAIM_REPAIR_FLAG_MASK << SBP_DOPS_RAIM_REPAIR_FLAG_SHIFT))) | \ - (((val) & (SBP_DOPS_RAIM_REPAIR_FLAG_MASK)) \ - << (SBP_DOPS_RAIM_REPAIR_FLAG_SHIFT)));} while(0) - +#define SBP_DOPS_RAIM_REPAIR_FLAG_GET(flags) \ + ((u8)((u8)((flags) >> SBP_DOPS_RAIM_REPAIR_FLAG_SHIFT) & \ + SBP_DOPS_RAIM_REPAIR_FLAG_MASK)) +#define SBP_DOPS_RAIM_REPAIR_FLAG_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_DOPS_RAIM_REPAIR_FLAG_MASK \ + << SBP_DOPS_RAIM_REPAIR_FLAG_SHIFT))) | \ + (((val) & (SBP_DOPS_RAIM_REPAIR_FLAG_MASK)) \ + << (SBP_DOPS_RAIM_REPAIR_FLAG_SHIFT))); \ + } while (0) #define SBP_DOPS_FIX_MODE_MASK (0x7u) #define SBP_DOPS_FIX_MODE_SHIFT (0u) #define SBP_DOPS_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_DOPS_FIX_MODE_SHIFT) \ - & SBP_DOPS_FIX_MODE_MASK)) -#define SBP_DOPS_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_DOPS_FIX_MODE_MASK << SBP_DOPS_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_DOPS_FIX_MODE_MASK)) \ - << (SBP_DOPS_FIX_MODE_SHIFT)));} while(0) - + ((u8)((u8)((flags) >> SBP_DOPS_FIX_MODE_SHIFT) & SBP_DOPS_FIX_MODE_MASK)) +#define SBP_DOPS_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_DOPS_FIX_MODE_MASK << SBP_DOPS_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_DOPS_FIX_MODE_MASK)) << (SBP_DOPS_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_DOPS_FIX_MODE_INVALID (0) #define SBP_DOPS_FIX_MODE_SINGLE_POINT_POSITION (1) @@ -166,49 +176,55 @@ #define SBP_DOPS_FIX_MODE_UNDEFINED (5) #define SBP_DOPS_FIX_MODE_SBAS_POSITION (6) /** - * Encoded length of sbp_msg_dops_t (V4 API) and + * Encoded length of sbp_msg_dops_t (V4 API) and * msg_dops_t (legacy API) */ #define SBP_MSG_DOPS_ENCODED_LEN 15u - #define SBP_MSG_POS_ECEF 0x0209 #define SBP_POS_ECEF_TOW_TYPE_MASK (0x1u) #define SBP_POS_ECEF_TOW_TYPE_SHIFT (5u) -#define SBP_POS_ECEF_TOW_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_ECEF_TOW_TYPE_SHIFT) \ - & SBP_POS_ECEF_TOW_TYPE_MASK)) -#define SBP_POS_ECEF_TOW_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_ECEF_TOW_TYPE_MASK << SBP_POS_ECEF_TOW_TYPE_SHIFT))) | \ - (((val) & (SBP_POS_ECEF_TOW_TYPE_MASK)) \ - << (SBP_POS_ECEF_TOW_TYPE_SHIFT)));} while(0) - +#define SBP_POS_ECEF_TOW_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_ECEF_TOW_TYPE_SHIFT) & \ + SBP_POS_ECEF_TOW_TYPE_MASK)) +#define SBP_POS_ECEF_TOW_TYPE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_ECEF_TOW_TYPE_MASK \ + << SBP_POS_ECEF_TOW_TYPE_SHIFT))) | \ + (((val) & (SBP_POS_ECEF_TOW_TYPE_MASK)) \ + << (SBP_POS_ECEF_TOW_TYPE_SHIFT))); \ + } while (0) #define SBP_POS_ECEF_TOW_TYPE_TIME_OF_MEASUREMENT (0) #define SBP_POS_ECEF_TOW_TYPE_OTHER (1) #define SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_MASK (0x3u) #define SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_SHIFT (3u) -#define SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_SHIFT) \ - & SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_MASK)) -#define SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_MASK << SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_SHIFT))) | \ - (((val) & (SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_MASK)) \ - << (SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_SHIFT)));} while(0) - +#define SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_SHIFT) & \ + SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_MASK)) +#define SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_MASK \ + << SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_SHIFT))) | \ + (((val) & (SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_MASK)) \ + << (SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_SHIFT))); \ + } while (0) #define SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_NONE (0) #define SBP_POS_ECEF_INERTIAL_NAVIGATION_MODE_INS_USED (1) #define SBP_POS_ECEF_FIX_MODE_MASK (0x7u) #define SBP_POS_ECEF_FIX_MODE_SHIFT (0u) -#define SBP_POS_ECEF_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_ECEF_FIX_MODE_SHIFT) \ - & SBP_POS_ECEF_FIX_MODE_MASK)) -#define SBP_POS_ECEF_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_ECEF_FIX_MODE_MASK << SBP_POS_ECEF_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_POS_ECEF_FIX_MODE_MASK)) \ - << (SBP_POS_ECEF_FIX_MODE_SHIFT)));} while(0) - +#define SBP_POS_ECEF_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_ECEF_FIX_MODE_SHIFT) & \ + SBP_POS_ECEF_FIX_MODE_MASK)) +#define SBP_POS_ECEF_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_ECEF_FIX_MODE_MASK \ + << SBP_POS_ECEF_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_POS_ECEF_FIX_MODE_MASK)) \ + << (SBP_POS_ECEF_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_POS_ECEF_FIX_MODE_INVALID (0) #define SBP_POS_ECEF_FIX_MODE_SINGLE_POINT_POSITION (1) @@ -218,49 +234,56 @@ #define SBP_POS_ECEF_FIX_MODE_DEAD_RECKONING (5) #define SBP_POS_ECEF_FIX_MODE_SBAS_POSITION (6) /** - * Encoded length of sbp_msg_pos_ecef_t (V4 API) and + * Encoded length of sbp_msg_pos_ecef_t (V4 API) and * msg_pos_ecef_t (legacy API) */ #define SBP_MSG_POS_ECEF_ENCODED_LEN 32u - #define SBP_MSG_POS_ECEF_COV 0x0214 #define SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_MASK (0x1u) #define SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_SHIFT (5u) -#define SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_SHIFT) \ - & SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_MASK)) -#define SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_MASK << SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_SHIFT))) | \ - (((val) & (SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_MASK)) \ - << (SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_SHIFT)));} while(0) - +#define SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_SHIFT) & \ + SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_MASK)) +#define SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_MASK \ + << SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_SHIFT))) | \ + (((val) & (SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_MASK)) \ + << (SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_SHIFT))); \ + } while (0) #define SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_TIME_OF_MEASUREMENT (0) #define SBP_POS_ECEF_COV_TYPE_OF_REPORTED_TOW_OTHER (1) #define SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_MASK (0x3u) #define SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_SHIFT (3u) -#define SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_SHIFT) \ - & SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_MASK)) -#define SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_MASK << SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_SHIFT))) | \ - (((val) & (SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_MASK)) \ - << (SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_SHIFT)));} while(0) - +#define SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_SHIFT) & \ + SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_MASK)) +#define SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_MASK \ + << SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_SHIFT))) | \ + (((val) & (SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_MASK)) \ + << (SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_SHIFT))); \ + } while (0) #define SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_NONE (0) #define SBP_POS_ECEF_COV_INERTIAL_NAVIGATION_MODE_INS_USED (1) #define SBP_POS_ECEF_COV_FIX_MODE_MASK (0x7u) #define SBP_POS_ECEF_COV_FIX_MODE_SHIFT (0u) -#define SBP_POS_ECEF_COV_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_ECEF_COV_FIX_MODE_SHIFT) \ - & SBP_POS_ECEF_COV_FIX_MODE_MASK)) -#define SBP_POS_ECEF_COV_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_ECEF_COV_FIX_MODE_MASK << SBP_POS_ECEF_COV_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_POS_ECEF_COV_FIX_MODE_MASK)) \ - << (SBP_POS_ECEF_COV_FIX_MODE_SHIFT)));} while(0) - +#define SBP_POS_ECEF_COV_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_ECEF_COV_FIX_MODE_SHIFT) & \ + SBP_POS_ECEF_COV_FIX_MODE_MASK)) +#define SBP_POS_ECEF_COV_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_ECEF_COV_FIX_MODE_MASK \ + << SBP_POS_ECEF_COV_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_POS_ECEF_COV_FIX_MODE_MASK)) \ + << (SBP_POS_ECEF_COV_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_POS_ECEF_COV_FIX_MODE_INVALID (0) #define SBP_POS_ECEF_COV_FIX_MODE_SINGLE_POINT_POSITION (1) @@ -270,49 +293,55 @@ #define SBP_POS_ECEF_COV_FIX_MODE_DEAD_RECKONING (5) #define SBP_POS_ECEF_COV_FIX_MODE_SBAS_POSITION (6) /** - * Encoded length of sbp_msg_pos_ecef_cov_t (V4 API) and + * Encoded length of sbp_msg_pos_ecef_cov_t (V4 API) and * msg_pos_ecef_cov_t (legacy API) */ #define SBP_MSG_POS_ECEF_COV_ENCODED_LEN 54u - #define SBP_MSG_POS_LLH 0x020A #define SBP_POS_LLH_TYPE_OF_REPORTED_TOW_MASK (0x1u) #define SBP_POS_LLH_TYPE_OF_REPORTED_TOW_SHIFT (5u) -#define SBP_POS_LLH_TYPE_OF_REPORTED_TOW_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_TYPE_OF_REPORTED_TOW_SHIFT) \ - & SBP_POS_LLH_TYPE_OF_REPORTED_TOW_MASK)) -#define SBP_POS_LLH_TYPE_OF_REPORTED_TOW_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_TYPE_OF_REPORTED_TOW_MASK << SBP_POS_LLH_TYPE_OF_REPORTED_TOW_SHIFT))) | \ - (((val) & (SBP_POS_LLH_TYPE_OF_REPORTED_TOW_MASK)) \ - << (SBP_POS_LLH_TYPE_OF_REPORTED_TOW_SHIFT)));} while(0) - +#define SBP_POS_LLH_TYPE_OF_REPORTED_TOW_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_TYPE_OF_REPORTED_TOW_SHIFT) & \ + SBP_POS_LLH_TYPE_OF_REPORTED_TOW_MASK)) +#define SBP_POS_LLH_TYPE_OF_REPORTED_TOW_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_LLH_TYPE_OF_REPORTED_TOW_MASK \ + << SBP_POS_LLH_TYPE_OF_REPORTED_TOW_SHIFT))) | \ + (((val) & (SBP_POS_LLH_TYPE_OF_REPORTED_TOW_MASK)) \ + << (SBP_POS_LLH_TYPE_OF_REPORTED_TOW_SHIFT))); \ + } while (0) #define SBP_POS_LLH_TYPE_OF_REPORTED_TOW_TIME_OF_MEASUREMENT (0) #define SBP_POS_LLH_TYPE_OF_REPORTED_TOW_OTHER (1) #define SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_MASK (0x3u) #define SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_SHIFT (3u) -#define SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_SHIFT) \ - & SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_MASK)) -#define SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_MASK << SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_SHIFT))) | \ - (((val) & (SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_MASK)) \ - << (SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_SHIFT)));} while(0) - +#define SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_SHIFT) & \ + SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_MASK)) +#define SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_MASK \ + << SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_SHIFT))) | \ + (((val) & (SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_MASK)) \ + << (SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_SHIFT))); \ + } while (0) #define SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_NONE (0) #define SBP_POS_LLH_INERTIAL_NAVIGATION_MODE_INS_USED (1) #define SBP_POS_LLH_FIX_MODE_MASK (0x7u) #define SBP_POS_LLH_FIX_MODE_SHIFT (0u) -#define SBP_POS_LLH_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_FIX_MODE_SHIFT) \ - & SBP_POS_LLH_FIX_MODE_MASK)) -#define SBP_POS_LLH_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_FIX_MODE_MASK << SBP_POS_LLH_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_POS_LLH_FIX_MODE_MASK)) \ - << (SBP_POS_LLH_FIX_MODE_SHIFT)));} while(0) - +#define SBP_POS_LLH_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_FIX_MODE_SHIFT) & \ + SBP_POS_LLH_FIX_MODE_MASK)) +#define SBP_POS_LLH_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_LLH_FIX_MODE_MASK \ + << SBP_POS_LLH_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_POS_LLH_FIX_MODE_MASK)) \ + << (SBP_POS_LLH_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_POS_LLH_FIX_MODE_INVALID (0) #define SBP_POS_LLH_FIX_MODE_SINGLE_POINT_POSITION (1) @@ -322,49 +351,56 @@ #define SBP_POS_LLH_FIX_MODE_DEAD_RECKONING (5) #define SBP_POS_LLH_FIX_MODE_SBAS_POSITION (6) /** - * Encoded length of sbp_msg_pos_llh_t (V4 API) and + * Encoded length of sbp_msg_pos_llh_t (V4 API) and * msg_pos_llh_t (legacy API) */ #define SBP_MSG_POS_LLH_ENCODED_LEN 34u - #define SBP_MSG_POS_LLH_COV 0x0211 #define SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_MASK (0x1u) #define SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_SHIFT (5u) -#define SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_SHIFT) \ - & SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_MASK)) -#define SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_MASK << SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_SHIFT))) | \ - (((val) & (SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_MASK)) \ - << (SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_SHIFT)));} while(0) - +#define SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_SHIFT) & \ + SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_MASK)) +#define SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_MASK \ + << SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_SHIFT))) | \ + (((val) & (SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_MASK)) \ + << (SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_SHIFT))); \ + } while (0) #define SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_TIME_OF_MEASUREMENT (0) #define SBP_POS_LLH_COV_TYPE_OF_REPORTED_TOW_OTHER (1) #define SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_MASK (0x3u) #define SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_SHIFT (3u) -#define SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_SHIFT) \ - & SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_MASK)) -#define SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_MASK << SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_SHIFT))) | \ - (((val) & (SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_MASK)) \ - << (SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_SHIFT)));} while(0) - +#define SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_SHIFT) & \ + SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_MASK)) +#define SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_MASK \ + << SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_SHIFT))) | \ + (((val) & (SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_MASK)) \ + << (SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_SHIFT))); \ + } while (0) #define SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_NONE (0) #define SBP_POS_LLH_COV_INERTIAL_NAVIGATION_MODE_INS_USED (1) #define SBP_POS_LLH_COV_FIX_MODE_MASK (0x7u) #define SBP_POS_LLH_COV_FIX_MODE_SHIFT (0u) -#define SBP_POS_LLH_COV_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_COV_FIX_MODE_SHIFT) \ - & SBP_POS_LLH_COV_FIX_MODE_MASK)) -#define SBP_POS_LLH_COV_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_COV_FIX_MODE_MASK << SBP_POS_LLH_COV_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_POS_LLH_COV_FIX_MODE_MASK)) \ - << (SBP_POS_LLH_COV_FIX_MODE_SHIFT)));} while(0) - +#define SBP_POS_LLH_COV_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_COV_FIX_MODE_SHIFT) & \ + SBP_POS_LLH_COV_FIX_MODE_MASK)) +#define SBP_POS_LLH_COV_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_LLH_COV_FIX_MODE_MASK \ + << SBP_POS_LLH_COV_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_POS_LLH_COV_FIX_MODE_MASK)) \ + << (SBP_POS_LLH_COV_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_POS_LLH_COV_FIX_MODE_INVALID (0) #define SBP_POS_LLH_COV_FIX_MODE_SINGLE_POINT_POSITION (1) @@ -374,84 +410,94 @@ #define SBP_POS_LLH_COV_FIX_MODE_DEAD_RECKONING (5) #define SBP_POS_LLH_COV_FIX_MODE_SBAS_POSITION (6) /** - * Encoded length of sbp_msg_pos_llh_cov_t (V4 API) and + * Encoded length of sbp_msg_pos_llh_cov_t (V4 API) and * msg_pos_llh_cov_t (legacy API) */ #define SBP_MSG_POS_LLH_COV_ENCODED_LEN 54u - /** - * Encoded length of sbp_estimated_horizontal_error_ellipse_t (V4 API) and + * Encoded length of sbp_estimated_horizontal_error_ellipse_t (V4 API) and * estimated_horizontal_error_ellipse_t (legacy API) */ #define SBP_ESTIMATED_HORIZONTAL_ERROR_ELLIPSE_ENCODED_LEN 12u - #define SBP_MSG_POS_LLH_ACC 0x0218 #define SBP_POS_LLH_ACC_GEOID_MODEL_MASK (0x7u) #define SBP_POS_LLH_ACC_GEOID_MODEL_SHIFT (4u) -#define SBP_POS_LLH_ACC_GEOID_MODEL_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_ACC_GEOID_MODEL_SHIFT) \ - & SBP_POS_LLH_ACC_GEOID_MODEL_MASK)) -#define SBP_POS_LLH_ACC_GEOID_MODEL_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_ACC_GEOID_MODEL_MASK << SBP_POS_LLH_ACC_GEOID_MODEL_SHIFT))) | \ - (((val) & (SBP_POS_LLH_ACC_GEOID_MODEL_MASK)) \ - << (SBP_POS_LLH_ACC_GEOID_MODEL_SHIFT)));} while(0) - +#define SBP_POS_LLH_ACC_GEOID_MODEL_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_ACC_GEOID_MODEL_SHIFT) & \ + SBP_POS_LLH_ACC_GEOID_MODEL_MASK)) +#define SBP_POS_LLH_ACC_GEOID_MODEL_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_LLH_ACC_GEOID_MODEL_MASK \ + << SBP_POS_LLH_ACC_GEOID_MODEL_SHIFT))) | \ + (((val) & (SBP_POS_LLH_ACC_GEOID_MODEL_MASK)) \ + << (SBP_POS_LLH_ACC_GEOID_MODEL_SHIFT))); \ + } while (0) #define SBP_POS_LLH_ACC_GEOID_MODEL_NO_MODEL (0) #define SBP_POS_LLH_ACC_GEOID_MODEL_EGM96 (1) #define SBP_POS_LLH_ACC_GEOID_MODEL_EGM2008 (2) #define SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_MASK (0xfu) #define SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_SHIFT (0u) -#define SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_SHIFT) \ - & SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_MASK)) -#define SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_MASK << SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_SHIFT))) | \ - (((val) & (SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_MASK)) \ - << (SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_SHIFT)));} while(0) - +#define SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_SHIFT) & \ + SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_MASK)) +#define SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_MASK \ + << SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_SHIFT))) | \ + (((val) & (SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_MASK)) \ + << (SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_SHIFT))); \ + } while (0) #define SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_3935 (1) #define SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_6827 (2) #define SBP_POS_LLH_ACC_CONFIDENCE_LEVEL_9545 (3) #define SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_MASK (0x1u) #define SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_SHIFT (5u) -#define SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_SHIFT) \ - & SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_MASK)) -#define SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_MASK << SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_SHIFT))) | \ - (((val) & (SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_MASK)) \ - << (SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_SHIFT)));} while(0) - +#define SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_SHIFT) & \ + SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_MASK)) +#define SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_MASK \ + << SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_SHIFT))) | \ + (((val) & (SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_MASK)) \ + << (SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_SHIFT))); \ + } while (0) #define SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_TIME_OF_MEASUREMENT (0) #define SBP_POS_LLH_ACC_TYPE_OF_REPORTED_TOW_OTHER (1) #define SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_MASK (0x3u) #define SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_SHIFT (3u) -#define SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_SHIFT) \ - & SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_MASK)) -#define SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_MASK << SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_SHIFT))) | \ - (((val) & (SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_MASK)) \ - << (SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_SHIFT)));} while(0) - +#define SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_SHIFT) & \ + SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_MASK)) +#define SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_MASK \ + << SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_SHIFT))) | \ + (((val) & (SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_MASK)) \ + << (SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_SHIFT))); \ + } while (0) #define SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_NONE (0) #define SBP_POS_LLH_ACC_INERTIAL_NAVIGATION_MODE_INS_USED (1) #define SBP_POS_LLH_ACC_FIX_MODE_MASK (0x7u) #define SBP_POS_LLH_ACC_FIX_MODE_SHIFT (0u) -#define SBP_POS_LLH_ACC_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_ACC_FIX_MODE_SHIFT) \ - & SBP_POS_LLH_ACC_FIX_MODE_MASK)) -#define SBP_POS_LLH_ACC_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_ACC_FIX_MODE_MASK << SBP_POS_LLH_ACC_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_POS_LLH_ACC_FIX_MODE_MASK)) \ - << (SBP_POS_LLH_ACC_FIX_MODE_SHIFT)));} while(0) - +#define SBP_POS_LLH_ACC_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_ACC_FIX_MODE_SHIFT) & \ + SBP_POS_LLH_ACC_FIX_MODE_MASK)) +#define SBP_POS_LLH_ACC_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_LLH_ACC_FIX_MODE_MASK \ + << SBP_POS_LLH_ACC_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_POS_LLH_ACC_FIX_MODE_MASK)) \ + << (SBP_POS_LLH_ACC_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_POS_LLH_ACC_FIX_MODE_INVALID (0) #define SBP_POS_LLH_ACC_FIX_MODE_SINGLE_POINT_POSITION (1) @@ -461,265 +507,292 @@ #define SBP_POS_LLH_ACC_FIX_MODE_DEAD_RECKONING (5) #define SBP_POS_LLH_ACC_FIX_MODE_SBAS_POSITION (6) /** - * Encoded length of sbp_msg_pos_llh_acc_t (V4 API) and + * Encoded length of sbp_msg_pos_llh_acc_t (V4 API) and * msg_pos_llh_acc_t (legacy API) */ #define SBP_MSG_POS_LLH_ACC_ENCODED_LEN 67u - #define SBP_MSG_BASELINE_ECEF 0x020B #define SBP_BASELINE_ECEF_FIX_MODE_MASK (0x7u) #define SBP_BASELINE_ECEF_FIX_MODE_SHIFT (0u) -#define SBP_BASELINE_ECEF_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_BASELINE_ECEF_FIX_MODE_SHIFT) \ - & SBP_BASELINE_ECEF_FIX_MODE_MASK)) -#define SBP_BASELINE_ECEF_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_BASELINE_ECEF_FIX_MODE_MASK << SBP_BASELINE_ECEF_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_BASELINE_ECEF_FIX_MODE_MASK)) \ - << (SBP_BASELINE_ECEF_FIX_MODE_SHIFT)));} while(0) - +#define SBP_BASELINE_ECEF_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_BASELINE_ECEF_FIX_MODE_SHIFT) & \ + SBP_BASELINE_ECEF_FIX_MODE_MASK)) +#define SBP_BASELINE_ECEF_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_BASELINE_ECEF_FIX_MODE_MASK \ + << SBP_BASELINE_ECEF_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_BASELINE_ECEF_FIX_MODE_MASK)) \ + << (SBP_BASELINE_ECEF_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_BASELINE_ECEF_FIX_MODE_INVALID (0) #define SBP_BASELINE_ECEF_FIX_MODE_DIFFERENTIAL_GNSS (2) #define SBP_BASELINE_ECEF_FIX_MODE_FLOAT_RTK (3) #define SBP_BASELINE_ECEF_FIX_MODE_FIXED_RTK (4) /** - * Encoded length of sbp_msg_baseline_ecef_t (V4 API) and + * Encoded length of sbp_msg_baseline_ecef_t (V4 API) and * msg_baseline_ecef_t (legacy API) */ #define SBP_MSG_BASELINE_ECEF_ENCODED_LEN 20u - #define SBP_MSG_BASELINE_NED 0x020C #define SBP_BASELINE_NED_FIX_MODE_MASK (0x7u) #define SBP_BASELINE_NED_FIX_MODE_SHIFT (0u) -#define SBP_BASELINE_NED_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_BASELINE_NED_FIX_MODE_SHIFT) \ - & SBP_BASELINE_NED_FIX_MODE_MASK)) -#define SBP_BASELINE_NED_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_BASELINE_NED_FIX_MODE_MASK << SBP_BASELINE_NED_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_BASELINE_NED_FIX_MODE_MASK)) \ - << (SBP_BASELINE_NED_FIX_MODE_SHIFT)));} while(0) - +#define SBP_BASELINE_NED_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_BASELINE_NED_FIX_MODE_SHIFT) & \ + SBP_BASELINE_NED_FIX_MODE_MASK)) +#define SBP_BASELINE_NED_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_BASELINE_NED_FIX_MODE_MASK \ + << SBP_BASELINE_NED_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_BASELINE_NED_FIX_MODE_MASK)) \ + << (SBP_BASELINE_NED_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_BASELINE_NED_FIX_MODE_INVALID (0) #define SBP_BASELINE_NED_FIX_MODE_DIFFERENTIAL_GNSS (2) #define SBP_BASELINE_NED_FIX_MODE_FLOAT_RTK (3) #define SBP_BASELINE_NED_FIX_MODE_FIXED_RTK (4) /** - * Encoded length of sbp_msg_baseline_ned_t (V4 API) and + * Encoded length of sbp_msg_baseline_ned_t (V4 API) and * msg_baseline_ned_t (legacy API) */ #define SBP_MSG_BASELINE_NED_ENCODED_LEN 22u - #define SBP_MSG_VEL_ECEF 0x020D #define SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_MASK (0x1u) #define SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_SHIFT (5u) -#define SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_SHIFT) \ - & SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_MASK)) -#define SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_MASK << SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_SHIFT))) | \ - (((val) & (SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_MASK)) \ - << (SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_SHIFT)));} while(0) - +#define SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_SHIFT) & \ + SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_MASK)) +#define SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_MASK \ + << SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_SHIFT))) | \ + (((val) & (SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_MASK)) \ + << (SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_SHIFT))); \ + } while (0) #define SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_TIME_OF_MEASUREMENT (0) #define SBP_VEL_ECEF_TYPE_OF_REPORTED_TOW_OTHER (1) #define SBP_VEL_ECEF_INS_NAVIGATION_MODE_MASK (0x3u) #define SBP_VEL_ECEF_INS_NAVIGATION_MODE_SHIFT (3u) -#define SBP_VEL_ECEF_INS_NAVIGATION_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_ECEF_INS_NAVIGATION_MODE_SHIFT) \ - & SBP_VEL_ECEF_INS_NAVIGATION_MODE_MASK)) -#define SBP_VEL_ECEF_INS_NAVIGATION_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_ECEF_INS_NAVIGATION_MODE_MASK << SBP_VEL_ECEF_INS_NAVIGATION_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_ECEF_INS_NAVIGATION_MODE_MASK)) \ - << (SBP_VEL_ECEF_INS_NAVIGATION_MODE_SHIFT)));} while(0) - +#define SBP_VEL_ECEF_INS_NAVIGATION_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_ECEF_INS_NAVIGATION_MODE_SHIFT) & \ + SBP_VEL_ECEF_INS_NAVIGATION_MODE_MASK)) +#define SBP_VEL_ECEF_INS_NAVIGATION_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_VEL_ECEF_INS_NAVIGATION_MODE_MASK \ + << SBP_VEL_ECEF_INS_NAVIGATION_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_ECEF_INS_NAVIGATION_MODE_MASK)) \ + << (SBP_VEL_ECEF_INS_NAVIGATION_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_ECEF_INS_NAVIGATION_MODE_NONE (0) #define SBP_VEL_ECEF_INS_NAVIGATION_MODE_INS_USED (1) #define SBP_VEL_ECEF_VELOCITY_MODE_MASK (0x7u) #define SBP_VEL_ECEF_VELOCITY_MODE_SHIFT (0u) -#define SBP_VEL_ECEF_VELOCITY_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_ECEF_VELOCITY_MODE_SHIFT) \ - & SBP_VEL_ECEF_VELOCITY_MODE_MASK)) -#define SBP_VEL_ECEF_VELOCITY_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_ECEF_VELOCITY_MODE_MASK << SBP_VEL_ECEF_VELOCITY_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_ECEF_VELOCITY_MODE_MASK)) \ - << (SBP_VEL_ECEF_VELOCITY_MODE_SHIFT)));} while(0) - +#define SBP_VEL_ECEF_VELOCITY_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_ECEF_VELOCITY_MODE_SHIFT) & \ + SBP_VEL_ECEF_VELOCITY_MODE_MASK)) +#define SBP_VEL_ECEF_VELOCITY_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_VEL_ECEF_VELOCITY_MODE_MASK \ + << SBP_VEL_ECEF_VELOCITY_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_ECEF_VELOCITY_MODE_MASK)) \ + << (SBP_VEL_ECEF_VELOCITY_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_ECEF_VELOCITY_MODE_INVALID (0) #define SBP_VEL_ECEF_VELOCITY_MODE_MEASURED_DOPPLER_DERIVED (1) #define SBP_VEL_ECEF_VELOCITY_MODE_COMPUTED_DOPPLER_DERIVED (2) #define SBP_VEL_ECEF_VELOCITY_MODE_DEAD_RECKONING (3) /** - * Encoded length of sbp_msg_vel_ecef_t (V4 API) and + * Encoded length of sbp_msg_vel_ecef_t (V4 API) and * msg_vel_ecef_t (legacy API) */ #define SBP_MSG_VEL_ECEF_ENCODED_LEN 20u - #define SBP_MSG_VEL_ECEF_COV 0x0215 #define SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_MASK (0x1u) #define SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_SHIFT (5u) -#define SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_SHIFT) \ - & SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_MASK)) -#define SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_MASK << SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_SHIFT))) | \ - (((val) & (SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_MASK)) \ - << (SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_SHIFT)));} while(0) - +#define SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_SHIFT) & \ + SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_MASK)) +#define SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_MASK \ + << SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_SHIFT))) | \ + (((val) & (SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_MASK)) \ + << (SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_SHIFT))); \ + } while (0) #define SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_TIME_OF_MEASUREMENT (0) #define SBP_VEL_ECEF_COV_TYPE_OF_REPORTED_TOW_OTHER (1) #define SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_MASK (0x3u) #define SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_SHIFT (3u) -#define SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_SHIFT) \ - & SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_MASK)) -#define SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_MASK << SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_MASK)) \ - << (SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_SHIFT)));} while(0) - +#define SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_SHIFT) & \ + SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_MASK)) +#define SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_MASK \ + << SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_MASK)) \ + << (SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_NONE (0) #define SBP_VEL_ECEF_COV_INS_NAVIGATION_MODE_INS_USED (1) #define SBP_VEL_ECEF_COV_VELOCITY_MODE_MASK (0x7u) #define SBP_VEL_ECEF_COV_VELOCITY_MODE_SHIFT (0u) -#define SBP_VEL_ECEF_COV_VELOCITY_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_ECEF_COV_VELOCITY_MODE_SHIFT) \ - & SBP_VEL_ECEF_COV_VELOCITY_MODE_MASK)) -#define SBP_VEL_ECEF_COV_VELOCITY_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_ECEF_COV_VELOCITY_MODE_MASK << SBP_VEL_ECEF_COV_VELOCITY_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_ECEF_COV_VELOCITY_MODE_MASK)) \ - << (SBP_VEL_ECEF_COV_VELOCITY_MODE_SHIFT)));} while(0) - +#define SBP_VEL_ECEF_COV_VELOCITY_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_ECEF_COV_VELOCITY_MODE_SHIFT) & \ + SBP_VEL_ECEF_COV_VELOCITY_MODE_MASK)) +#define SBP_VEL_ECEF_COV_VELOCITY_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_VEL_ECEF_COV_VELOCITY_MODE_MASK \ + << SBP_VEL_ECEF_COV_VELOCITY_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_ECEF_COV_VELOCITY_MODE_MASK)) \ + << (SBP_VEL_ECEF_COV_VELOCITY_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_ECEF_COV_VELOCITY_MODE_INVALID (0) #define SBP_VEL_ECEF_COV_VELOCITY_MODE_MEASURED_DOPPLER_DERIVED (1) #define SBP_VEL_ECEF_COV_VELOCITY_MODE_COMPUTED_DOPPLER_DERIVED (2) #define SBP_VEL_ECEF_COV_VELOCITY_MODE_DEAD_RECKONING (3) /** - * Encoded length of sbp_msg_vel_ecef_cov_t (V4 API) and + * Encoded length of sbp_msg_vel_ecef_cov_t (V4 API) and * msg_vel_ecef_cov_t (legacy API) */ #define SBP_MSG_VEL_ECEF_COV_ENCODED_LEN 42u - #define SBP_MSG_VEL_NED 0x020E #define SBP_VEL_NED_TYPE_OF_REPORTED_TOW_MASK (0x1u) #define SBP_VEL_NED_TYPE_OF_REPORTED_TOW_SHIFT (5u) -#define SBP_VEL_NED_TYPE_OF_REPORTED_TOW_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_NED_TYPE_OF_REPORTED_TOW_SHIFT) \ - & SBP_VEL_NED_TYPE_OF_REPORTED_TOW_MASK)) -#define SBP_VEL_NED_TYPE_OF_REPORTED_TOW_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_NED_TYPE_OF_REPORTED_TOW_MASK << SBP_VEL_NED_TYPE_OF_REPORTED_TOW_SHIFT))) | \ - (((val) & (SBP_VEL_NED_TYPE_OF_REPORTED_TOW_MASK)) \ - << (SBP_VEL_NED_TYPE_OF_REPORTED_TOW_SHIFT)));} while(0) - +#define SBP_VEL_NED_TYPE_OF_REPORTED_TOW_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_NED_TYPE_OF_REPORTED_TOW_SHIFT) & \ + SBP_VEL_NED_TYPE_OF_REPORTED_TOW_MASK)) +#define SBP_VEL_NED_TYPE_OF_REPORTED_TOW_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_VEL_NED_TYPE_OF_REPORTED_TOW_MASK \ + << SBP_VEL_NED_TYPE_OF_REPORTED_TOW_SHIFT))) | \ + (((val) & (SBP_VEL_NED_TYPE_OF_REPORTED_TOW_MASK)) \ + << (SBP_VEL_NED_TYPE_OF_REPORTED_TOW_SHIFT))); \ + } while (0) #define SBP_VEL_NED_TYPE_OF_REPORTED_TOW_TIME_OF_MEASUREMENT (0) #define SBP_VEL_NED_TYPE_OF_REPORTED_TOW_OTHER (1) #define SBP_VEL_NED_INS_NAVIGATION_MODE_MASK (0x3u) #define SBP_VEL_NED_INS_NAVIGATION_MODE_SHIFT (3u) -#define SBP_VEL_NED_INS_NAVIGATION_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_NED_INS_NAVIGATION_MODE_SHIFT) \ - & SBP_VEL_NED_INS_NAVIGATION_MODE_MASK)) -#define SBP_VEL_NED_INS_NAVIGATION_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_NED_INS_NAVIGATION_MODE_MASK << SBP_VEL_NED_INS_NAVIGATION_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_NED_INS_NAVIGATION_MODE_MASK)) \ - << (SBP_VEL_NED_INS_NAVIGATION_MODE_SHIFT)));} while(0) - +#define SBP_VEL_NED_INS_NAVIGATION_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_NED_INS_NAVIGATION_MODE_SHIFT) & \ + SBP_VEL_NED_INS_NAVIGATION_MODE_MASK)) +#define SBP_VEL_NED_INS_NAVIGATION_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_VEL_NED_INS_NAVIGATION_MODE_MASK \ + << SBP_VEL_NED_INS_NAVIGATION_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_NED_INS_NAVIGATION_MODE_MASK)) \ + << (SBP_VEL_NED_INS_NAVIGATION_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_NED_INS_NAVIGATION_MODE_NONE (0) #define SBP_VEL_NED_INS_NAVIGATION_MODE_INS_USED (1) #define SBP_VEL_NED_VELOCITY_MODE_MASK (0x7u) #define SBP_VEL_NED_VELOCITY_MODE_SHIFT (0u) -#define SBP_VEL_NED_VELOCITY_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_NED_VELOCITY_MODE_SHIFT) \ - & SBP_VEL_NED_VELOCITY_MODE_MASK)) -#define SBP_VEL_NED_VELOCITY_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_NED_VELOCITY_MODE_MASK << SBP_VEL_NED_VELOCITY_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_NED_VELOCITY_MODE_MASK)) \ - << (SBP_VEL_NED_VELOCITY_MODE_SHIFT)));} while(0) - +#define SBP_VEL_NED_VELOCITY_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_NED_VELOCITY_MODE_SHIFT) & \ + SBP_VEL_NED_VELOCITY_MODE_MASK)) +#define SBP_VEL_NED_VELOCITY_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_VEL_NED_VELOCITY_MODE_MASK \ + << SBP_VEL_NED_VELOCITY_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_NED_VELOCITY_MODE_MASK)) \ + << (SBP_VEL_NED_VELOCITY_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_NED_VELOCITY_MODE_INVALID (0) #define SBP_VEL_NED_VELOCITY_MODE_MEASURED_DOPPLER_DERIVED (1) #define SBP_VEL_NED_VELOCITY_MODE_COMPUTED_DOPPLER_DERIVED (2) #define SBP_VEL_NED_VELOCITY_MODE_DEAD_RECKONING (3) /** - * Encoded length of sbp_msg_vel_ned_t (V4 API) and + * Encoded length of sbp_msg_vel_ned_t (V4 API) and * msg_vel_ned_t (legacy API) */ #define SBP_MSG_VEL_NED_ENCODED_LEN 22u - #define SBP_MSG_VEL_NED_COV 0x0212 #define SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_MASK (0x1u) #define SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_SHIFT (5u) -#define SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_SHIFT) \ - & SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_MASK)) -#define SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_MASK << SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_SHIFT))) | \ - (((val) & (SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_MASK)) \ - << (SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_SHIFT)));} while(0) - +#define SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_SHIFT) & \ + SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_MASK)) +#define SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_MASK \ + << SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_SHIFT))) | \ + (((val) & (SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_MASK)) \ + << (SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_SHIFT))); \ + } while (0) #define SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_TIME_OF_MEASUREMENT (0) #define SBP_VEL_NED_COV_TYPE_OF_REPORTED_TOW_OTHER (1) #define SBP_VEL_NED_COV_INS_NAVIGATION_MODE_MASK (0x3u) #define SBP_VEL_NED_COV_INS_NAVIGATION_MODE_SHIFT (3u) -#define SBP_VEL_NED_COV_INS_NAVIGATION_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_NED_COV_INS_NAVIGATION_MODE_SHIFT) \ - & SBP_VEL_NED_COV_INS_NAVIGATION_MODE_MASK)) -#define SBP_VEL_NED_COV_INS_NAVIGATION_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_NED_COV_INS_NAVIGATION_MODE_MASK << SBP_VEL_NED_COV_INS_NAVIGATION_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_NED_COV_INS_NAVIGATION_MODE_MASK)) \ - << (SBP_VEL_NED_COV_INS_NAVIGATION_MODE_SHIFT)));} while(0) - +#define SBP_VEL_NED_COV_INS_NAVIGATION_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_NED_COV_INS_NAVIGATION_MODE_SHIFT) & \ + SBP_VEL_NED_COV_INS_NAVIGATION_MODE_MASK)) +#define SBP_VEL_NED_COV_INS_NAVIGATION_MODE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_VEL_NED_COV_INS_NAVIGATION_MODE_MASK \ + << SBP_VEL_NED_COV_INS_NAVIGATION_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_NED_COV_INS_NAVIGATION_MODE_MASK)) \ + << (SBP_VEL_NED_COV_INS_NAVIGATION_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_NED_COV_INS_NAVIGATION_MODE_NONE (0) #define SBP_VEL_NED_COV_INS_NAVIGATION_MODE_INS_USED (1) #define SBP_VEL_NED_COV_VELOCITY_MODE_MASK (0x7u) #define SBP_VEL_NED_COV_VELOCITY_MODE_SHIFT (0u) -#define SBP_VEL_NED_COV_VELOCITY_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_NED_COV_VELOCITY_MODE_SHIFT) \ - & SBP_VEL_NED_COV_VELOCITY_MODE_MASK)) -#define SBP_VEL_NED_COV_VELOCITY_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_NED_COV_VELOCITY_MODE_MASK << SBP_VEL_NED_COV_VELOCITY_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_NED_COV_VELOCITY_MODE_MASK)) \ - << (SBP_VEL_NED_COV_VELOCITY_MODE_SHIFT)));} while(0) - +#define SBP_VEL_NED_COV_VELOCITY_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_NED_COV_VELOCITY_MODE_SHIFT) & \ + SBP_VEL_NED_COV_VELOCITY_MODE_MASK)) +#define SBP_VEL_NED_COV_VELOCITY_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_VEL_NED_COV_VELOCITY_MODE_MASK \ + << SBP_VEL_NED_COV_VELOCITY_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_NED_COV_VELOCITY_MODE_MASK)) \ + << (SBP_VEL_NED_COV_VELOCITY_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_NED_COV_VELOCITY_MODE_INVALID (0) #define SBP_VEL_NED_COV_VELOCITY_MODE_MEASURED_DOPPLER_DERIVED (1) #define SBP_VEL_NED_COV_VELOCITY_MODE_COMPUTED_DOPPLER_DERIVED (2) #define SBP_VEL_NED_COV_VELOCITY_MODE_DEAD_RECKONING (3) /** - * Encoded length of sbp_msg_vel_ned_cov_t (V4 API) and + * Encoded length of sbp_msg_vel_ned_cov_t (V4 API) and * msg_vel_ned_cov_t (legacy API) */ #define SBP_MSG_VEL_NED_COV_ENCODED_LEN 42u - #define SBP_MSG_POS_ECEF_GNSS 0x0229 #define SBP_POS_ECEF_GNSS_FIX_MODE_MASK (0x7u) #define SBP_POS_ECEF_GNSS_FIX_MODE_SHIFT (0u) -#define SBP_POS_ECEF_GNSS_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_ECEF_GNSS_FIX_MODE_SHIFT) \ - & SBP_POS_ECEF_GNSS_FIX_MODE_MASK)) -#define SBP_POS_ECEF_GNSS_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_ECEF_GNSS_FIX_MODE_MASK << SBP_POS_ECEF_GNSS_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_POS_ECEF_GNSS_FIX_MODE_MASK)) \ - << (SBP_POS_ECEF_GNSS_FIX_MODE_SHIFT)));} while(0) - +#define SBP_POS_ECEF_GNSS_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_ECEF_GNSS_FIX_MODE_SHIFT) & \ + SBP_POS_ECEF_GNSS_FIX_MODE_MASK)) +#define SBP_POS_ECEF_GNSS_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_ECEF_GNSS_FIX_MODE_MASK \ + << SBP_POS_ECEF_GNSS_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_POS_ECEF_GNSS_FIX_MODE_MASK)) \ + << (SBP_POS_ECEF_GNSS_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_POS_ECEF_GNSS_FIX_MODE_INVALID (0) #define SBP_POS_ECEF_GNSS_FIX_MODE_SINGLE_POINT_POSITION (1) @@ -728,23 +801,24 @@ #define SBP_POS_ECEF_GNSS_FIX_MODE_FIXED_RTK (4) #define SBP_POS_ECEF_GNSS_FIX_MODE_SBAS_POSITION (6) /** - * Encoded length of sbp_msg_pos_ecef_gnss_t (V4 API) and + * Encoded length of sbp_msg_pos_ecef_gnss_t (V4 API) and * msg_pos_ecef_gnss_t (legacy API) */ #define SBP_MSG_POS_ECEF_GNSS_ENCODED_LEN 32u - #define SBP_MSG_POS_ECEF_COV_GNSS 0x0234 #define SBP_POS_ECEF_COV_GNSS_FIX_MODE_MASK (0x7u) #define SBP_POS_ECEF_COV_GNSS_FIX_MODE_SHIFT (0u) -#define SBP_POS_ECEF_COV_GNSS_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_ECEF_COV_GNSS_FIX_MODE_SHIFT) \ - & SBP_POS_ECEF_COV_GNSS_FIX_MODE_MASK)) -#define SBP_POS_ECEF_COV_GNSS_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_ECEF_COV_GNSS_FIX_MODE_MASK << SBP_POS_ECEF_COV_GNSS_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_POS_ECEF_COV_GNSS_FIX_MODE_MASK)) \ - << (SBP_POS_ECEF_COV_GNSS_FIX_MODE_SHIFT)));} while(0) - +#define SBP_POS_ECEF_COV_GNSS_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_ECEF_COV_GNSS_FIX_MODE_SHIFT) & \ + SBP_POS_ECEF_COV_GNSS_FIX_MODE_MASK)) +#define SBP_POS_ECEF_COV_GNSS_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_ECEF_COV_GNSS_FIX_MODE_MASK \ + << SBP_POS_ECEF_COV_GNSS_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_POS_ECEF_COV_GNSS_FIX_MODE_MASK)) \ + << (SBP_POS_ECEF_COV_GNSS_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_POS_ECEF_COV_GNSS_FIX_MODE_INVALID (0) #define SBP_POS_ECEF_COV_GNSS_FIX_MODE_SINGLE_POINT_POSITION (1) @@ -753,23 +827,24 @@ #define SBP_POS_ECEF_COV_GNSS_FIX_MODE_FIXED_RTK (4) #define SBP_POS_ECEF_COV_GNSS_FIX_MODE_SBAS_POSITION (6) /** - * Encoded length of sbp_msg_pos_ecef_cov_gnss_t (V4 API) and + * Encoded length of sbp_msg_pos_ecef_cov_gnss_t (V4 API) and * msg_pos_ecef_cov_gnss_t (legacy API) */ #define SBP_MSG_POS_ECEF_COV_GNSS_ENCODED_LEN 54u - #define SBP_MSG_POS_LLH_GNSS 0x022A #define SBP_POS_LLH_GNSS_FIX_MODE_MASK (0x7u) #define SBP_POS_LLH_GNSS_FIX_MODE_SHIFT (0u) -#define SBP_POS_LLH_GNSS_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_GNSS_FIX_MODE_SHIFT) \ - & SBP_POS_LLH_GNSS_FIX_MODE_MASK)) -#define SBP_POS_LLH_GNSS_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_GNSS_FIX_MODE_MASK << SBP_POS_LLH_GNSS_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_POS_LLH_GNSS_FIX_MODE_MASK)) \ - << (SBP_POS_LLH_GNSS_FIX_MODE_SHIFT)));} while(0) - +#define SBP_POS_LLH_GNSS_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_GNSS_FIX_MODE_SHIFT) & \ + SBP_POS_LLH_GNSS_FIX_MODE_MASK)) +#define SBP_POS_LLH_GNSS_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_LLH_GNSS_FIX_MODE_MASK \ + << SBP_POS_LLH_GNSS_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_POS_LLH_GNSS_FIX_MODE_MASK)) \ + << (SBP_POS_LLH_GNSS_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_POS_LLH_GNSS_FIX_MODE_INVALID (0) #define SBP_POS_LLH_GNSS_FIX_MODE_SINGLE_POINT_POSITION (1) @@ -778,23 +853,24 @@ #define SBP_POS_LLH_GNSS_FIX_MODE_FIXED_RTK (4) #define SBP_POS_LLH_GNSS_FIX_MODE_SBAS_POSITION (6) /** - * Encoded length of sbp_msg_pos_llh_gnss_t (V4 API) and + * Encoded length of sbp_msg_pos_llh_gnss_t (V4 API) and * msg_pos_llh_gnss_t (legacy API) */ #define SBP_MSG_POS_LLH_GNSS_ENCODED_LEN 34u - #define SBP_MSG_POS_LLH_COV_GNSS 0x0231 #define SBP_POS_LLH_COV_GNSS_FIX_MODE_MASK (0x7u) #define SBP_POS_LLH_COV_GNSS_FIX_MODE_SHIFT (0u) -#define SBP_POS_LLH_COV_GNSS_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_COV_GNSS_FIX_MODE_SHIFT) \ - & SBP_POS_LLH_COV_GNSS_FIX_MODE_MASK)) -#define SBP_POS_LLH_COV_GNSS_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_COV_GNSS_FIX_MODE_MASK << SBP_POS_LLH_COV_GNSS_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_POS_LLH_COV_GNSS_FIX_MODE_MASK)) \ - << (SBP_POS_LLH_COV_GNSS_FIX_MODE_SHIFT)));} while(0) - +#define SBP_POS_LLH_COV_GNSS_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_COV_GNSS_FIX_MODE_SHIFT) & \ + SBP_POS_LLH_COV_GNSS_FIX_MODE_MASK)) +#define SBP_POS_LLH_COV_GNSS_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_LLH_COV_GNSS_FIX_MODE_MASK \ + << SBP_POS_LLH_COV_GNSS_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_POS_LLH_COV_GNSS_FIX_MODE_MASK)) \ + << (SBP_POS_LLH_COV_GNSS_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_POS_LLH_COV_GNSS_FIX_MODE_INVALID (0) #define SBP_POS_LLH_COV_GNSS_FIX_MODE_SINGLE_POINT_POSITION (1) @@ -804,572 +880,661 @@ #define SBP_POS_LLH_COV_GNSS_FIX_MODE_DEAD_RECKONING (5) #define SBP_POS_LLH_COV_GNSS_FIX_MODE_SBAS_POSITION (6) /** - * Encoded length of sbp_msg_pos_llh_cov_gnss_t (V4 API) and + * Encoded length of sbp_msg_pos_llh_cov_gnss_t (V4 API) and * msg_pos_llh_cov_gnss_t (legacy API) */ #define SBP_MSG_POS_LLH_COV_GNSS_ENCODED_LEN 54u - #define SBP_MSG_VEL_ECEF_GNSS 0x022D #define SBP_VEL_ECEF_GNSS_VELOCITY_MODE_MASK (0x7u) #define SBP_VEL_ECEF_GNSS_VELOCITY_MODE_SHIFT (0u) -#define SBP_VEL_ECEF_GNSS_VELOCITY_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_ECEF_GNSS_VELOCITY_MODE_SHIFT) \ - & SBP_VEL_ECEF_GNSS_VELOCITY_MODE_MASK)) -#define SBP_VEL_ECEF_GNSS_VELOCITY_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_ECEF_GNSS_VELOCITY_MODE_MASK << SBP_VEL_ECEF_GNSS_VELOCITY_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_ECEF_GNSS_VELOCITY_MODE_MASK)) \ - << (SBP_VEL_ECEF_GNSS_VELOCITY_MODE_SHIFT)));} while(0) - +#define SBP_VEL_ECEF_GNSS_VELOCITY_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_ECEF_GNSS_VELOCITY_MODE_SHIFT) & \ + SBP_VEL_ECEF_GNSS_VELOCITY_MODE_MASK)) +#define SBP_VEL_ECEF_GNSS_VELOCITY_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_VEL_ECEF_GNSS_VELOCITY_MODE_MASK \ + << SBP_VEL_ECEF_GNSS_VELOCITY_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_ECEF_GNSS_VELOCITY_MODE_MASK)) \ + << (SBP_VEL_ECEF_GNSS_VELOCITY_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_ECEF_GNSS_VELOCITY_MODE_INVALID (0) #define SBP_VEL_ECEF_GNSS_VELOCITY_MODE_MEASURED_DOPPLER_DERIVED (1) #define SBP_VEL_ECEF_GNSS_VELOCITY_MODE_COMPUTED_DOPPLER_DERIVED (2) /** - * Encoded length of sbp_msg_vel_ecef_gnss_t (V4 API) and + * Encoded length of sbp_msg_vel_ecef_gnss_t (V4 API) and * msg_vel_ecef_gnss_t (legacy API) */ #define SBP_MSG_VEL_ECEF_GNSS_ENCODED_LEN 20u - #define SBP_MSG_VEL_ECEF_COV_GNSS 0x0235 #define SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_MASK (0x7u) #define SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_SHIFT (0u) -#define SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_SHIFT) \ - & SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_MASK)) -#define SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_MASK << SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_MASK)) \ - << (SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_SHIFT)));} while(0) - +#define SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_SHIFT) & \ + SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_MASK)) +#define SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_MASK \ + << SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_MASK)) \ + << (SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_INVALID (0) #define SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_MEASURED_DOPPLER_DERIVED (1) #define SBP_VEL_ECEF_COV_GNSS_VELOCITY_MODE_COMPUTED_DOPPLER_DERIVED (2) /** - * Encoded length of sbp_msg_vel_ecef_cov_gnss_t (V4 API) and + * Encoded length of sbp_msg_vel_ecef_cov_gnss_t (V4 API) and * msg_vel_ecef_cov_gnss_t (legacy API) */ #define SBP_MSG_VEL_ECEF_COV_GNSS_ENCODED_LEN 42u - #define SBP_MSG_VEL_NED_GNSS 0x022E #define SBP_VEL_NED_GNSS_VELOCITY_MODE_MASK (0x7u) #define SBP_VEL_NED_GNSS_VELOCITY_MODE_SHIFT (0u) -#define SBP_VEL_NED_GNSS_VELOCITY_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_NED_GNSS_VELOCITY_MODE_SHIFT) \ - & SBP_VEL_NED_GNSS_VELOCITY_MODE_MASK)) -#define SBP_VEL_NED_GNSS_VELOCITY_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_NED_GNSS_VELOCITY_MODE_MASK << SBP_VEL_NED_GNSS_VELOCITY_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_NED_GNSS_VELOCITY_MODE_MASK)) \ - << (SBP_VEL_NED_GNSS_VELOCITY_MODE_SHIFT)));} while(0) - +#define SBP_VEL_NED_GNSS_VELOCITY_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_NED_GNSS_VELOCITY_MODE_SHIFT) & \ + SBP_VEL_NED_GNSS_VELOCITY_MODE_MASK)) +#define SBP_VEL_NED_GNSS_VELOCITY_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_VEL_NED_GNSS_VELOCITY_MODE_MASK \ + << SBP_VEL_NED_GNSS_VELOCITY_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_NED_GNSS_VELOCITY_MODE_MASK)) \ + << (SBP_VEL_NED_GNSS_VELOCITY_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_NED_GNSS_VELOCITY_MODE_INVALID (0) #define SBP_VEL_NED_GNSS_VELOCITY_MODE_MEASURED_DOPPLER_DERIVED (1) #define SBP_VEL_NED_GNSS_VELOCITY_MODE_COMPUTED_DOPPLER_DERIVED (2) /** - * Encoded length of sbp_msg_vel_ned_gnss_t (V4 API) and + * Encoded length of sbp_msg_vel_ned_gnss_t (V4 API) and * msg_vel_ned_gnss_t (legacy API) */ #define SBP_MSG_VEL_NED_GNSS_ENCODED_LEN 22u - #define SBP_MSG_VEL_NED_COV_GNSS 0x0232 #define SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_MASK (0x7u) #define SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_SHIFT (0u) -#define SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_SHIFT) \ - & SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_MASK)) -#define SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_MASK << SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_MASK)) \ - << (SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_SHIFT)));} while(0) - +#define SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_SHIFT) & \ + SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_MASK)) +#define SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_MASK \ + << SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_MASK)) \ + << (SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_INVALID (0) #define SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_MEASURED_DOPPLER_DERIVED (1) #define SBP_VEL_NED_COV_GNSS_VELOCITY_MODE_COMPUTED_DOPPLER_DERIVED (2) /** - * Encoded length of sbp_msg_vel_ned_cov_gnss_t (V4 API) and + * Encoded length of sbp_msg_vel_ned_cov_gnss_t (V4 API) and * msg_vel_ned_cov_gnss_t (legacy API) */ #define SBP_MSG_VEL_NED_COV_GNSS_ENCODED_LEN 42u - #define SBP_MSG_VEL_BODY 0x0213 #define SBP_VEL_BODY_INS_NAVIGATION_MODE_MASK (0x3u) #define SBP_VEL_BODY_INS_NAVIGATION_MODE_SHIFT (3u) -#define SBP_VEL_BODY_INS_NAVIGATION_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_BODY_INS_NAVIGATION_MODE_SHIFT) \ - & SBP_VEL_BODY_INS_NAVIGATION_MODE_MASK)) -#define SBP_VEL_BODY_INS_NAVIGATION_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_BODY_INS_NAVIGATION_MODE_MASK << SBP_VEL_BODY_INS_NAVIGATION_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_BODY_INS_NAVIGATION_MODE_MASK)) \ - << (SBP_VEL_BODY_INS_NAVIGATION_MODE_SHIFT)));} while(0) - +#define SBP_VEL_BODY_INS_NAVIGATION_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_BODY_INS_NAVIGATION_MODE_SHIFT) & \ + SBP_VEL_BODY_INS_NAVIGATION_MODE_MASK)) +#define SBP_VEL_BODY_INS_NAVIGATION_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_VEL_BODY_INS_NAVIGATION_MODE_MASK \ + << SBP_VEL_BODY_INS_NAVIGATION_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_BODY_INS_NAVIGATION_MODE_MASK)) \ + << (SBP_VEL_BODY_INS_NAVIGATION_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_BODY_INS_NAVIGATION_MODE_NONE (0) #define SBP_VEL_BODY_INS_NAVIGATION_MODE_INS_USED (1) #define SBP_VEL_BODY_VELOCITY_MODE_MASK (0x7u) #define SBP_VEL_BODY_VELOCITY_MODE_SHIFT (0u) -#define SBP_VEL_BODY_VELOCITY_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_VEL_BODY_VELOCITY_MODE_SHIFT) \ - & SBP_VEL_BODY_VELOCITY_MODE_MASK)) -#define SBP_VEL_BODY_VELOCITY_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_VEL_BODY_VELOCITY_MODE_MASK << SBP_VEL_BODY_VELOCITY_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_BODY_VELOCITY_MODE_MASK)) \ - << (SBP_VEL_BODY_VELOCITY_MODE_SHIFT)));} while(0) - +#define SBP_VEL_BODY_VELOCITY_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_VEL_BODY_VELOCITY_MODE_SHIFT) & \ + SBP_VEL_BODY_VELOCITY_MODE_MASK)) +#define SBP_VEL_BODY_VELOCITY_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_VEL_BODY_VELOCITY_MODE_MASK \ + << SBP_VEL_BODY_VELOCITY_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_BODY_VELOCITY_MODE_MASK)) \ + << (SBP_VEL_BODY_VELOCITY_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_BODY_VELOCITY_MODE_INVALID (0) #define SBP_VEL_BODY_VELOCITY_MODE_MEASURED_DOPPLER_DERIVED (1) #define SBP_VEL_BODY_VELOCITY_MODE_COMPUTED_DOPPLER_DERIVED (2) #define SBP_VEL_BODY_VELOCITY_MODE_DEAD_RECKONING (3) /** - * Encoded length of sbp_msg_vel_body_t (V4 API) and + * Encoded length of sbp_msg_vel_body_t (V4 API) and * msg_vel_body_t (legacy API) */ #define SBP_MSG_VEL_BODY_ENCODED_LEN 42u - #define SBP_MSG_VEL_COG 0x021C #define SBP_VEL_COG_COG_FROZEN_MASK (0x1u) #define SBP_VEL_COG_COG_FROZEN_SHIFT (9u) -#define SBP_VEL_COG_COG_FROZEN_GET(flags) \ - ((u16)((u16)((flags) >> SBP_VEL_COG_COG_FROZEN_SHIFT) \ - & SBP_VEL_COG_COG_FROZEN_MASK)) -#define SBP_VEL_COG_COG_FROZEN_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_VEL_COG_COG_FROZEN_MASK << SBP_VEL_COG_COG_FROZEN_SHIFT))) | \ - (((val) & (SBP_VEL_COG_COG_FROZEN_MASK)) \ - << (SBP_VEL_COG_COG_FROZEN_SHIFT)));} while(0) - +#define SBP_VEL_COG_COG_FROZEN_GET(flags) \ + ((u16)((u16)((flags) >> SBP_VEL_COG_COG_FROZEN_SHIFT) & \ + SBP_VEL_COG_COG_FROZEN_MASK)) +#define SBP_VEL_COG_COG_FROZEN_SET(flags, val) \ + do { \ + (flags) = (u16)((flags & (~(SBP_VEL_COG_COG_FROZEN_MASK \ + << SBP_VEL_COG_COG_FROZEN_SHIFT))) | \ + (((val) & (SBP_VEL_COG_COG_FROZEN_MASK)) \ + << (SBP_VEL_COG_COG_FROZEN_SHIFT))); \ + } while (0) #define SBP_VEL_COG_COG_FROZEN_NOT_FROZEN (0) #define SBP_VEL_COG_COG_FROZEN_FROZEN (1) #define SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_MASK (0x1u) #define SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_SHIFT (8u) -#define SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_GET(flags) \ - ((u16)((u16)((flags) >> SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_SHIFT) \ - & SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_MASK)) -#define SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_MASK << SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_SHIFT))) | \ - (((val) & (SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_MASK)) \ - << (SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_SHIFT)));} while(0) - +#define SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_GET(flags) \ + ((u16)((u16)((flags) >> SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_SHIFT) & \ + SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_MASK)) +#define SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_SET(flags, val) \ + do { \ + (flags) = \ + (u16)((flags & (~(SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_MASK \ + << SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_SHIFT))) | \ + (((val) & (SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_MASK)) \ + << (SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_SHIFT))); \ + } while (0) #define SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_INVALID (0) #define SBP_VEL_COG_VERTICAL_VELOCITY_VALIDITY_VERTICAL_VELOCITY_VALID (1) #define SBP_VEL_COG_SOG_VALIDITY_MASK (0x1u) #define SBP_VEL_COG_SOG_VALIDITY_SHIFT (7u) -#define SBP_VEL_COG_SOG_VALIDITY_GET(flags) \ - ((u16)((u16)((flags) >> SBP_VEL_COG_SOG_VALIDITY_SHIFT) \ - & SBP_VEL_COG_SOG_VALIDITY_MASK)) -#define SBP_VEL_COG_SOG_VALIDITY_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_VEL_COG_SOG_VALIDITY_MASK << SBP_VEL_COG_SOG_VALIDITY_SHIFT))) | \ - (((val) & (SBP_VEL_COG_SOG_VALIDITY_MASK)) \ - << (SBP_VEL_COG_SOG_VALIDITY_SHIFT)));} while(0) - +#define SBP_VEL_COG_SOG_VALIDITY_GET(flags) \ + ((u16)((u16)((flags) >> SBP_VEL_COG_SOG_VALIDITY_SHIFT) & \ + SBP_VEL_COG_SOG_VALIDITY_MASK)) +#define SBP_VEL_COG_SOG_VALIDITY_SET(flags, val) \ + do { \ + (flags) = (u16)((flags & (~(SBP_VEL_COG_SOG_VALIDITY_MASK \ + << SBP_VEL_COG_SOG_VALIDITY_SHIFT))) | \ + (((val) & (SBP_VEL_COG_SOG_VALIDITY_MASK)) \ + << (SBP_VEL_COG_SOG_VALIDITY_SHIFT))); \ + } while (0) #define SBP_VEL_COG_SOG_VALIDITY_INVALID (0) #define SBP_VEL_COG_SOG_VALIDITY_SOG_VALID (1) #define SBP_VEL_COG_COG_VALIDITY_MASK (0x1u) #define SBP_VEL_COG_COG_VALIDITY_SHIFT (6u) -#define SBP_VEL_COG_COG_VALIDITY_GET(flags) \ - ((u16)((u16)((flags) >> SBP_VEL_COG_COG_VALIDITY_SHIFT) \ - & SBP_VEL_COG_COG_VALIDITY_MASK)) -#define SBP_VEL_COG_COG_VALIDITY_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_VEL_COG_COG_VALIDITY_MASK << SBP_VEL_COG_COG_VALIDITY_SHIFT))) | \ - (((val) & (SBP_VEL_COG_COG_VALIDITY_MASK)) \ - << (SBP_VEL_COG_COG_VALIDITY_SHIFT)));} while(0) - +#define SBP_VEL_COG_COG_VALIDITY_GET(flags) \ + ((u16)((u16)((flags) >> SBP_VEL_COG_COG_VALIDITY_SHIFT) & \ + SBP_VEL_COG_COG_VALIDITY_MASK)) +#define SBP_VEL_COG_COG_VALIDITY_SET(flags, val) \ + do { \ + (flags) = (u16)((flags & (~(SBP_VEL_COG_COG_VALIDITY_MASK \ + << SBP_VEL_COG_COG_VALIDITY_SHIFT))) | \ + (((val) & (SBP_VEL_COG_COG_VALIDITY_MASK)) \ + << (SBP_VEL_COG_COG_VALIDITY_SHIFT))); \ + } while (0) #define SBP_VEL_COG_COG_VALIDITY_INVALID (0) #define SBP_VEL_COG_COG_VALIDITY_COG_VALID (1) #define SBP_VEL_COG_TYPE_OF_REPORTED_TOW_MASK (0x1u) #define SBP_VEL_COG_TYPE_OF_REPORTED_TOW_SHIFT (5u) -#define SBP_VEL_COG_TYPE_OF_REPORTED_TOW_GET(flags) \ - ((u16)((u16)((flags) >> SBP_VEL_COG_TYPE_OF_REPORTED_TOW_SHIFT) \ - & SBP_VEL_COG_TYPE_OF_REPORTED_TOW_MASK)) -#define SBP_VEL_COG_TYPE_OF_REPORTED_TOW_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_VEL_COG_TYPE_OF_REPORTED_TOW_MASK << SBP_VEL_COG_TYPE_OF_REPORTED_TOW_SHIFT))) | \ - (((val) & (SBP_VEL_COG_TYPE_OF_REPORTED_TOW_MASK)) \ - << (SBP_VEL_COG_TYPE_OF_REPORTED_TOW_SHIFT)));} while(0) - +#define SBP_VEL_COG_TYPE_OF_REPORTED_TOW_GET(flags) \ + ((u16)((u16)((flags) >> SBP_VEL_COG_TYPE_OF_REPORTED_TOW_SHIFT) & \ + SBP_VEL_COG_TYPE_OF_REPORTED_TOW_MASK)) +#define SBP_VEL_COG_TYPE_OF_REPORTED_TOW_SET(flags, val) \ + do { \ + (flags) = (u16)((flags & (~(SBP_VEL_COG_TYPE_OF_REPORTED_TOW_MASK \ + << SBP_VEL_COG_TYPE_OF_REPORTED_TOW_SHIFT))) | \ + (((val) & (SBP_VEL_COG_TYPE_OF_REPORTED_TOW_MASK)) \ + << (SBP_VEL_COG_TYPE_OF_REPORTED_TOW_SHIFT))); \ + } while (0) #define SBP_VEL_COG_TYPE_OF_REPORTED_TOW_TIME_OF_MEASUREMENT (0) #define SBP_VEL_COG_TYPE_OF_REPORTED_TOW_OTHER (1) #define SBP_VEL_COG_INS_NAVIGATION_MODE_MASK (0x3u) #define SBP_VEL_COG_INS_NAVIGATION_MODE_SHIFT (3u) -#define SBP_VEL_COG_INS_NAVIGATION_MODE_GET(flags) \ - ((u16)((u16)((flags) >> SBP_VEL_COG_INS_NAVIGATION_MODE_SHIFT) \ - & SBP_VEL_COG_INS_NAVIGATION_MODE_MASK)) -#define SBP_VEL_COG_INS_NAVIGATION_MODE_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_VEL_COG_INS_NAVIGATION_MODE_MASK << SBP_VEL_COG_INS_NAVIGATION_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_COG_INS_NAVIGATION_MODE_MASK)) \ - << (SBP_VEL_COG_INS_NAVIGATION_MODE_SHIFT)));} while(0) - +#define SBP_VEL_COG_INS_NAVIGATION_MODE_GET(flags) \ + ((u16)((u16)((flags) >> SBP_VEL_COG_INS_NAVIGATION_MODE_SHIFT) & \ + SBP_VEL_COG_INS_NAVIGATION_MODE_MASK)) +#define SBP_VEL_COG_INS_NAVIGATION_MODE_SET(flags, val) \ + do { \ + (flags) = (u16)((flags & (~(SBP_VEL_COG_INS_NAVIGATION_MODE_MASK \ + << SBP_VEL_COG_INS_NAVIGATION_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_COG_INS_NAVIGATION_MODE_MASK)) \ + << (SBP_VEL_COG_INS_NAVIGATION_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_COG_INS_NAVIGATION_MODE_NONE (0) #define SBP_VEL_COG_INS_NAVIGATION_MODE_INS_USED (1) #define SBP_VEL_COG_VELOCITY_MODE_MASK (0x7u) #define SBP_VEL_COG_VELOCITY_MODE_SHIFT (0u) -#define SBP_VEL_COG_VELOCITY_MODE_GET(flags) \ - ((u16)((u16)((flags) >> SBP_VEL_COG_VELOCITY_MODE_SHIFT) \ - & SBP_VEL_COG_VELOCITY_MODE_MASK)) -#define SBP_VEL_COG_VELOCITY_MODE_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_VEL_COG_VELOCITY_MODE_MASK << SBP_VEL_COG_VELOCITY_MODE_SHIFT))) | \ - (((val) & (SBP_VEL_COG_VELOCITY_MODE_MASK)) \ - << (SBP_VEL_COG_VELOCITY_MODE_SHIFT)));} while(0) - +#define SBP_VEL_COG_VELOCITY_MODE_GET(flags) \ + ((u16)((u16)((flags) >> SBP_VEL_COG_VELOCITY_MODE_SHIFT) & \ + SBP_VEL_COG_VELOCITY_MODE_MASK)) +#define SBP_VEL_COG_VELOCITY_MODE_SET(flags, val) \ + do { \ + (flags) = (u16)((flags & (~(SBP_VEL_COG_VELOCITY_MODE_MASK \ + << SBP_VEL_COG_VELOCITY_MODE_SHIFT))) | \ + (((val) & (SBP_VEL_COG_VELOCITY_MODE_MASK)) \ + << (SBP_VEL_COG_VELOCITY_MODE_SHIFT))); \ + } while (0) #define SBP_VEL_COG_VELOCITY_MODE_INVALID (0) #define SBP_VEL_COG_VELOCITY_MODE_MEASURED_DOPPLER_DERIVED (1) #define SBP_VEL_COG_VELOCITY_MODE_COMPUTED_DOPPLER_DERIVED (2) #define SBP_VEL_COG_VELOCITY_MODE_DEAD_RECKONING (3) /** - * Encoded length of sbp_msg_vel_cog_t (V4 API) and + * Encoded length of sbp_msg_vel_cog_t (V4 API) and * msg_vel_cog_t (legacy API) */ #define SBP_MSG_VEL_COG_ENCODED_LEN 30u - #define SBP_MSG_AGE_CORRECTIONS 0x0210 /** - * Encoded length of sbp_msg_age_corrections_t (V4 API) and + * Encoded length of sbp_msg_age_corrections_t (V4 API) and * msg_age_corrections_t (legacy API) */ #define SBP_MSG_AGE_CORRECTIONS_ENCODED_LEN 6u - #define SBP_MSG_GPS_TIME_DEP_A 0x0100 /** - * Encoded length of sbp_msg_gps_time_dep_a_t (V4 API) and + * Encoded length of sbp_msg_gps_time_dep_a_t (V4 API) and * msg_gps_time_dep_a_t (legacy API) */ #define SBP_MSG_GPS_TIME_DEP_A_ENCODED_LEN 11u - #define SBP_MSG_DOPS_DEP_A 0x0206 /** - * Encoded length of sbp_msg_dops_dep_a_t (V4 API) and + * Encoded length of sbp_msg_dops_dep_a_t (V4 API) and * msg_dops_dep_a_t (legacy API) */ #define SBP_MSG_DOPS_DEP_A_ENCODED_LEN 14u - #define SBP_MSG_POS_ECEF_DEP_A 0x0200 #define SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_MASK (0x1u) #define SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_SHIFT (4u) -#define SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_SHIFT) \ - & SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_MASK)) -#define SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_MASK << SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_SHIFT))) | \ - (((val) & (SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_MASK)) \ - << (SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_SHIFT)));} while(0) - +#define SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_SHIFT) & \ + SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_MASK)) +#define SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_MASK \ + << SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_SHIFT))) | \ + (((val) & (SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_MASK)) \ + << (SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_SHIFT))); \ + } while (0) #define SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_NO_REPAIR (0) #define SBP_POS_ECEF_DEP_A_RAIM_REPAIR_FLAG_SOLUTION_CAME_FROM_RAIM_REPAIR (1) #define SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_MASK (0x1u) #define SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT (3u) -#define SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT) \ - & SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) -#define SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_MASK << SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT))) | \ - (((val) & (SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) \ - << (SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT)));} while(0) - - -#define SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_EXPLICITLY_DISABLED_OR_UNAVAILABLE (0) +#define SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT) & \ + SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) +#define SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_MASK \ + << SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT))) | \ + (((val) & (SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) \ + << (SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT))); \ + } while (0) + +#define SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_EXPLICITLY_DISABLED_OR_UNAVAILABLE \ + (0) #define SBP_POS_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_AVAILABLE (1) #define SBP_POS_ECEF_DEP_A_FIX_MODE_MASK (0x7u) #define SBP_POS_ECEF_DEP_A_FIX_MODE_SHIFT (0u) -#define SBP_POS_ECEF_DEP_A_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_ECEF_DEP_A_FIX_MODE_SHIFT) \ - & SBP_POS_ECEF_DEP_A_FIX_MODE_MASK)) -#define SBP_POS_ECEF_DEP_A_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_ECEF_DEP_A_FIX_MODE_MASK << SBP_POS_ECEF_DEP_A_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_POS_ECEF_DEP_A_FIX_MODE_MASK)) \ - << (SBP_POS_ECEF_DEP_A_FIX_MODE_SHIFT)));} while(0) - +#define SBP_POS_ECEF_DEP_A_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_ECEF_DEP_A_FIX_MODE_SHIFT) & \ + SBP_POS_ECEF_DEP_A_FIX_MODE_MASK)) +#define SBP_POS_ECEF_DEP_A_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_ECEF_DEP_A_FIX_MODE_MASK \ + << SBP_POS_ECEF_DEP_A_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_POS_ECEF_DEP_A_FIX_MODE_MASK)) \ + << (SBP_POS_ECEF_DEP_A_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_POS_ECEF_DEP_A_FIX_MODE_SINGLE_POINT_POSITIONING (0) #define SBP_POS_ECEF_DEP_A_FIX_MODE_FIXED_RTK (1) #define SBP_POS_ECEF_DEP_A_FIX_MODE_FLOAT_RTK (2) /** - * Encoded length of sbp_msg_pos_ecef_dep_a_t (V4 API) and + * Encoded length of sbp_msg_pos_ecef_dep_a_t (V4 API) and * msg_pos_ecef_dep_a_t (legacy API) */ #define SBP_MSG_POS_ECEF_DEP_A_ENCODED_LEN 32u - #define SBP_MSG_POS_LLH_DEP_A 0x0201 #define SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_MASK (0x1u) #define SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_SHIFT (5u) -#define SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_SHIFT) \ - & SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_MASK)) -#define SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_MASK << SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_SHIFT))) | \ - (((val) & (SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_MASK)) \ - << (SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_SHIFT)));} while(0) - +#define SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_SHIFT) & \ + SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_MASK)) +#define SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_MASK \ + << SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_SHIFT))) | \ + (((val) & (SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_MASK)) \ + << (SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_SHIFT))); \ + } while (0) #define SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_NO_REPAIR (0) #define SBP_POS_LLH_DEP_A_RAIM_REPAIR_FLAG_SOLUTION_CAME_FROM_RAIM_REPAIR (1) #define SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_MASK (0x1u) #define SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT (4u) -#define SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT) \ - & SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) -#define SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_MASK << SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT))) | \ - (((val) & (SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) \ - << (SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT)));} while(0) - - -#define SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_EXPLICITLY_DISABLED_OR_UNAVAILABLE (0) +#define SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT) & \ + SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) +#define SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_MASK \ + << SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT))) | \ + (((val) & (SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) \ + << (SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT))); \ + } while (0) + +#define SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_EXPLICITLY_DISABLED_OR_UNAVAILABLE \ + (0) #define SBP_POS_LLH_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_AVAILABLE (1) #define SBP_POS_LLH_DEP_A_HEIGHT_MODE_MASK (0x1u) #define SBP_POS_LLH_DEP_A_HEIGHT_MODE_SHIFT (3u) -#define SBP_POS_LLH_DEP_A_HEIGHT_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_DEP_A_HEIGHT_MODE_SHIFT) \ - & SBP_POS_LLH_DEP_A_HEIGHT_MODE_MASK)) -#define SBP_POS_LLH_DEP_A_HEIGHT_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_DEP_A_HEIGHT_MODE_MASK << SBP_POS_LLH_DEP_A_HEIGHT_MODE_SHIFT))) | \ - (((val) & (SBP_POS_LLH_DEP_A_HEIGHT_MODE_MASK)) \ - << (SBP_POS_LLH_DEP_A_HEIGHT_MODE_SHIFT)));} while(0) - +#define SBP_POS_LLH_DEP_A_HEIGHT_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_DEP_A_HEIGHT_MODE_SHIFT) & \ + SBP_POS_LLH_DEP_A_HEIGHT_MODE_MASK)) +#define SBP_POS_LLH_DEP_A_HEIGHT_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_LLH_DEP_A_HEIGHT_MODE_MASK \ + << SBP_POS_LLH_DEP_A_HEIGHT_MODE_SHIFT))) | \ + (((val) & (SBP_POS_LLH_DEP_A_HEIGHT_MODE_MASK)) \ + << (SBP_POS_LLH_DEP_A_HEIGHT_MODE_SHIFT))); \ + } while (0) #define SBP_POS_LLH_DEP_A_HEIGHT_MODE_HEIGHT_ABOVE_WGS84_ELLIPSOID (0) #define SBP_POS_LLH_DEP_A_HEIGHT_MODE_HEIGHT_ABOVE_MEAN_SEA_LEVEL (1) #define SBP_POS_LLH_DEP_A_FIX_MODE_MASK (0x7u) #define SBP_POS_LLH_DEP_A_FIX_MODE_SHIFT (0u) -#define SBP_POS_LLH_DEP_A_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POS_LLH_DEP_A_FIX_MODE_SHIFT) \ - & SBP_POS_LLH_DEP_A_FIX_MODE_MASK)) -#define SBP_POS_LLH_DEP_A_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POS_LLH_DEP_A_FIX_MODE_MASK << SBP_POS_LLH_DEP_A_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_POS_LLH_DEP_A_FIX_MODE_MASK)) \ - << (SBP_POS_LLH_DEP_A_FIX_MODE_SHIFT)));} while(0) - +#define SBP_POS_LLH_DEP_A_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POS_LLH_DEP_A_FIX_MODE_SHIFT) & \ + SBP_POS_LLH_DEP_A_FIX_MODE_MASK)) +#define SBP_POS_LLH_DEP_A_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POS_LLH_DEP_A_FIX_MODE_MASK \ + << SBP_POS_LLH_DEP_A_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_POS_LLH_DEP_A_FIX_MODE_MASK)) \ + << (SBP_POS_LLH_DEP_A_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_POS_LLH_DEP_A_FIX_MODE_SINGLE_POINT_POSITIONING (0) #define SBP_POS_LLH_DEP_A_FIX_MODE_FIXED_RTK (1) #define SBP_POS_LLH_DEP_A_FIX_MODE_FLOAT_RTK (2) /** - * Encoded length of sbp_msg_pos_llh_dep_a_t (V4 API) and + * Encoded length of sbp_msg_pos_llh_dep_a_t (V4 API) and * msg_pos_llh_dep_a_t (legacy API) */ #define SBP_MSG_POS_LLH_DEP_A_ENCODED_LEN 34u - #define SBP_MSG_BASELINE_ECEF_DEP_A 0x0202 #define SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_MASK (0x1u) #define SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_SHIFT (4u) -#define SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_GET(flags) \ - ((u8)((u8)((flags) >> SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_SHIFT) \ - & SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_MASK)) -#define SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_MASK << SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_SHIFT))) | \ - (((val) & (SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_MASK)) \ - << (SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_SHIFT)));} while(0) - +#define SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_GET(flags) \ + ((u8)((u8)((flags) >> SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_SHIFT) & \ + SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_MASK)) +#define SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_MASK \ + << SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_SHIFT))) | \ + (((val) & (SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_MASK)) \ + << (SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_SHIFT))); \ + } while (0) #define SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_NO_REPAIR (0) -#define SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_SOLUTION_CAME_FROM_RAIM_REPAIR (1) +#define SBP_BASELINE_ECEF_DEP_A_RAIM_REPAIR_FLAG_SOLUTION_CAME_FROM_RAIM_REPAIR \ + (1) #define SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_MASK (0x1u) #define SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT (3u) -#define SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_GET(flags) \ - ((u8)((u8)((flags) >> SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT) \ - & SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) -#define SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_MASK << SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT))) | \ - (((val) & (SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) \ - << (SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT)));} while(0) - - -#define SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_EXPLICITLY_DISABLED_OR_UNAVAILABLE (0) -#define SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_AVAILABLE (1) +#define SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_GET(flags) \ + ((u8)( \ + (u8)((flags) >> SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT) & \ + SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) +#define SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & \ + (~(SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_MASK \ + << SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT))) | \ + (((val) & (SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) \ + << (SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT))); \ + } while (0) + +#define SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_EXPLICITLY_DISABLED_OR_UNAVAILABLE \ + (0) +#define SBP_BASELINE_ECEF_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_AVAILABLE \ + (1) #define SBP_BASELINE_ECEF_DEP_A_FIX_MODE_MASK (0x7u) #define SBP_BASELINE_ECEF_DEP_A_FIX_MODE_SHIFT (0u) -#define SBP_BASELINE_ECEF_DEP_A_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_BASELINE_ECEF_DEP_A_FIX_MODE_SHIFT) \ - & SBP_BASELINE_ECEF_DEP_A_FIX_MODE_MASK)) -#define SBP_BASELINE_ECEF_DEP_A_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_BASELINE_ECEF_DEP_A_FIX_MODE_MASK << SBP_BASELINE_ECEF_DEP_A_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_BASELINE_ECEF_DEP_A_FIX_MODE_MASK)) \ - << (SBP_BASELINE_ECEF_DEP_A_FIX_MODE_SHIFT)));} while(0) - +#define SBP_BASELINE_ECEF_DEP_A_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_BASELINE_ECEF_DEP_A_FIX_MODE_SHIFT) & \ + SBP_BASELINE_ECEF_DEP_A_FIX_MODE_MASK)) +#define SBP_BASELINE_ECEF_DEP_A_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_BASELINE_ECEF_DEP_A_FIX_MODE_MASK \ + << SBP_BASELINE_ECEF_DEP_A_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_BASELINE_ECEF_DEP_A_FIX_MODE_MASK)) \ + << (SBP_BASELINE_ECEF_DEP_A_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_BASELINE_ECEF_DEP_A_FIX_MODE_FLOAT_RTK (0) #define SBP_BASELINE_ECEF_DEP_A_FIX_MODE_FIXED_RTK (1) /** - * Encoded length of sbp_msg_baseline_ecef_dep_a_t (V4 API) and + * Encoded length of sbp_msg_baseline_ecef_dep_a_t (V4 API) and * msg_baseline_ecef_dep_a_t (legacy API) */ #define SBP_MSG_BASELINE_ECEF_DEP_A_ENCODED_LEN 20u - #define SBP_MSG_BASELINE_NED_DEP_A 0x0203 #define SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_MASK (0x1u) #define SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_SHIFT (4u) -#define SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_GET(flags) \ - ((u8)((u8)((flags) >> SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_SHIFT) \ - & SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_MASK)) -#define SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_MASK << SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_SHIFT))) | \ - (((val) & (SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_MASK)) \ - << (SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_SHIFT)));} while(0) - +#define SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_GET(flags) \ + ((u8)((u8)((flags) >> SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_SHIFT) & \ + SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_MASK)) +#define SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_MASK \ + << SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_SHIFT))) | \ + (((val) & (SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_MASK)) \ + << (SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_SHIFT))); \ + } while (0) #define SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_NO_REPAIR (0) -#define SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_SOLUTION_CAME_FROM_RAIM_REPAIR (1) +#define SBP_BASELINE_NED_DEP_A_RAIM_REPAIR_FLAG_SOLUTION_CAME_FROM_RAIM_REPAIR \ + (1) #define SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_MASK (0x1u) #define SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT (3u) -#define SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_GET(flags) \ - ((u8)((u8)((flags) >> SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT) \ - & SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) -#define SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_MASK << SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT))) | \ - (((val) & (SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) \ - << (SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT)));} while(0) - - -#define SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_EXPLICITLY_DISABLED_OR_UNAVAILABLE (0) -#define SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_AVAILABLE (1) +#define SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_GET(flags) \ + ((u8)((u8)((flags) >> SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT) & \ + SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) +#define SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & \ + (~(SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_MASK \ + << SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT))) | \ + (((val) & (SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) \ + << (SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT))); \ + } while (0) + +#define SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_EXPLICITLY_DISABLED_OR_UNAVAILABLE \ + (0) +#define SBP_BASELINE_NED_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_AVAILABLE \ + (1) #define SBP_BASELINE_NED_DEP_A_FIX_MODE_MASK (0x7u) #define SBP_BASELINE_NED_DEP_A_FIX_MODE_SHIFT (0u) -#define SBP_BASELINE_NED_DEP_A_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_BASELINE_NED_DEP_A_FIX_MODE_SHIFT) \ - & SBP_BASELINE_NED_DEP_A_FIX_MODE_MASK)) -#define SBP_BASELINE_NED_DEP_A_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_BASELINE_NED_DEP_A_FIX_MODE_MASK << SBP_BASELINE_NED_DEP_A_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_BASELINE_NED_DEP_A_FIX_MODE_MASK)) \ - << (SBP_BASELINE_NED_DEP_A_FIX_MODE_SHIFT)));} while(0) - +#define SBP_BASELINE_NED_DEP_A_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_BASELINE_NED_DEP_A_FIX_MODE_SHIFT) & \ + SBP_BASELINE_NED_DEP_A_FIX_MODE_MASK)) +#define SBP_BASELINE_NED_DEP_A_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_BASELINE_NED_DEP_A_FIX_MODE_MASK \ + << SBP_BASELINE_NED_DEP_A_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_BASELINE_NED_DEP_A_FIX_MODE_MASK)) \ + << (SBP_BASELINE_NED_DEP_A_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_BASELINE_NED_DEP_A_FIX_MODE_FLOAT_RTK (0) #define SBP_BASELINE_NED_DEP_A_FIX_MODE_FIXED_RTK (1) /** - * Encoded length of sbp_msg_baseline_ned_dep_a_t (V4 API) and + * Encoded length of sbp_msg_baseline_ned_dep_a_t (V4 API) and * msg_baseline_ned_dep_a_t (legacy API) */ #define SBP_MSG_BASELINE_NED_DEP_A_ENCODED_LEN 22u - #define SBP_MSG_VEL_ECEF_DEP_A 0x0204 /** - * Encoded length of sbp_msg_vel_ecef_dep_a_t (V4 API) and + * Encoded length of sbp_msg_vel_ecef_dep_a_t (V4 API) and * msg_vel_ecef_dep_a_t (legacy API) */ #define SBP_MSG_VEL_ECEF_DEP_A_ENCODED_LEN 20u - #define SBP_MSG_VEL_NED_DEP_A 0x0205 /** - * Encoded length of sbp_msg_vel_ned_dep_a_t (V4 API) and + * Encoded length of sbp_msg_vel_ned_dep_a_t (V4 API) and * msg_vel_ned_dep_a_t (legacy API) */ #define SBP_MSG_VEL_NED_DEP_A_ENCODED_LEN 22u - #define SBP_MSG_BASELINE_HEADING_DEP_A 0x0207 #define SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_MASK (0x1u) #define SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_SHIFT (4u) -#define SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_GET(flags) \ - ((u8)((u8)((flags) >> SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_SHIFT) \ - & SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_MASK)) -#define SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_MASK << SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_SHIFT))) | \ - (((val) & (SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_MASK)) \ - << (SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_SHIFT)));} while(0) - +#define SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_GET(flags) \ + ((u8)((u8)((flags) >> SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_SHIFT) & \ + SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_MASK)) +#define SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_MASK \ + << SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_SHIFT))) | \ + (((val) & (SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_MASK)) \ + << (SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_SHIFT))); \ + } while (0) #define SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_NO_REPAIR (0) -#define SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_SOLUTION_CAME_FROM_RAIM_REPAIR (1) +#define SBP_BASELINE_HEADING_DEP_A_RAIM_REPAIR_FLAG_SOLUTION_CAME_FROM_RAIM_REPAIR \ + (1) #define SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_MASK (0x1u) #define SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT (3u) -#define SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_GET(flags) \ - ((u8)((u8)((flags) >> SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT) \ - & SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) -#define SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_MASK << SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT))) | \ - (((val) & (SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) \ - << (SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT)));} while(0) - - -#define SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_EXPLICITLY_DISABLED_OR_UNAVAILABLE (0) -#define SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_AVAILABLE (1) +#define SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_GET(flags) \ + ((u8)((u8)((flags) >> \ + SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT) & \ + SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) +#define SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_MASK \ + << SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT))) | \ + (((val) & (SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_MASK)) \ + << (SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_SHIFT))); \ + } while (0) + +#define SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_EXPLICITLY_DISABLED_OR_UNAVAILABLE \ + (0) +#define SBP_BASELINE_HEADING_DEP_A_RAIM_AVAILABILITY_FLAG_RAIM_CHECK_WAS_AVAILABLE \ + (1) #define SBP_BASELINE_HEADING_DEP_A_FIX_MODE_MASK (0x7u) #define SBP_BASELINE_HEADING_DEP_A_FIX_MODE_SHIFT (0u) -#define SBP_BASELINE_HEADING_DEP_A_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_BASELINE_HEADING_DEP_A_FIX_MODE_SHIFT) \ - & SBP_BASELINE_HEADING_DEP_A_FIX_MODE_MASK)) -#define SBP_BASELINE_HEADING_DEP_A_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_BASELINE_HEADING_DEP_A_FIX_MODE_MASK << SBP_BASELINE_HEADING_DEP_A_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_BASELINE_HEADING_DEP_A_FIX_MODE_MASK)) \ - << (SBP_BASELINE_HEADING_DEP_A_FIX_MODE_SHIFT)));} while(0) - +#define SBP_BASELINE_HEADING_DEP_A_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_BASELINE_HEADING_DEP_A_FIX_MODE_SHIFT) & \ + SBP_BASELINE_HEADING_DEP_A_FIX_MODE_MASK)) +#define SBP_BASELINE_HEADING_DEP_A_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_BASELINE_HEADING_DEP_A_FIX_MODE_MASK \ + << SBP_BASELINE_HEADING_DEP_A_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_BASELINE_HEADING_DEP_A_FIX_MODE_MASK)) \ + << (SBP_BASELINE_HEADING_DEP_A_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_BASELINE_HEADING_DEP_A_FIX_MODE_FLOAT_RTK (0) #define SBP_BASELINE_HEADING_DEP_A_FIX_MODE_FIXED_RTK (1) /** - * Encoded length of sbp_msg_baseline_heading_dep_a_t (V4 API) and + * Encoded length of sbp_msg_baseline_heading_dep_a_t (V4 API) and * msg_baseline_heading_dep_a_t (legacy API) */ #define SBP_MSG_BASELINE_HEADING_DEP_A_ENCODED_LEN 10u - #define SBP_MSG_PROTECTION_LEVEL_DEP_A 0x0216 #define SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_MASK (0x7u) #define SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_SHIFT (0u) -#define SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_GET(flags) \ - ((u8)((u8)((flags) >> SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_SHIFT) \ - & SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_MASK)) -#define SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_MASK << SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_MASK)) \ - << (SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_SHIFT)));} while(0) - - -#define SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_SAFE_STATE_PROTECTION_LEVEL_SHALL_NOT_BE_USED_FOR_SAFETY_CRITICAL_APPLICATION (0) -#define SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_TIR_LEVEL_1 (1) -#define SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_TIR_LEVEL_2 (2) -#define SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_TIR_LEVEL_3 (3) +#define SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_GET(flags) \ + ((u8)( \ + (u8)((flags) >> \ + SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_SHIFT) & \ + SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_MASK)) +#define SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_SET(flags, \ + val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_MASK \ + << SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_SHIFT))) | \ + (((val) & \ + (SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_MASK)) \ + << (SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_SHIFT))); \ + } while (0) + +#define SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_SAFE_STATE_PROTECTION_LEVEL_SHALL_NOT_BE_USED_FOR_SAFETY_CRITICAL_APPLICATION \ + (0) +#define SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_TIR_LEVEL_1 \ + (1) +#define SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_TIR_LEVEL_2 \ + (2) +#define SBP_PROTECTION_LEVEL_DEP_A_TARGET_INTEGRITY_RISK_TIR_LEVEL_TIR_LEVEL_3 \ + (3) /** - * Encoded length of sbp_msg_protection_level_dep_a_t (V4 API) and + * Encoded length of sbp_msg_protection_level_dep_a_t (V4 API) and * msg_protection_level_dep_a_t (legacy API) */ #define SBP_MSG_PROTECTION_LEVEL_DEP_A_ENCODED_LEN 33u - #define SBP_MSG_PROTECTION_LEVEL 0x0217 #define SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_MASK (0x7u) #define SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_SHIFT (0u) -#define SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_GET(flags) \ - ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_SHIFT) \ - & SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_MASK)) -#define SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_MASK << SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_MASK)) \ - << (SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_SHIFT)));} while(0) - +#define SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_GET(flags) \ + ((u32)((u32)((flags) >> \ + SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_SHIFT) & \ + SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_MASK)) +#define SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_SET(flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_MASK \ + << SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_SHIFT))) | \ + (((val) & (SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_MASK)) \ + << (SBP_PROTECTION_LEVEL_TARGET_INTEGRITY_RISK_TIR_LEVEL_SHIFT))); \ + } while (0) #define SBP_PROTECTION_LEVEL_FIX_MODE_MASK (0x7u) #define SBP_PROTECTION_LEVEL_FIX_MODE_SHIFT (15u) -#define SBP_PROTECTION_LEVEL_FIX_MODE_GET(flags) \ - ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_FIX_MODE_SHIFT) \ - & SBP_PROTECTION_LEVEL_FIX_MODE_MASK)) -#define SBP_PROTECTION_LEVEL_FIX_MODE_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_FIX_MODE_MASK << SBP_PROTECTION_LEVEL_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_FIX_MODE_MASK)) \ - << (SBP_PROTECTION_LEVEL_FIX_MODE_SHIFT)));} while(0) - +#define SBP_PROTECTION_LEVEL_FIX_MODE_GET(flags) \ + ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_FIX_MODE_SHIFT) & \ + SBP_PROTECTION_LEVEL_FIX_MODE_MASK)) +#define SBP_PROTECTION_LEVEL_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_FIX_MODE_MASK \ + << SBP_PROTECTION_LEVEL_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_PROTECTION_LEVEL_FIX_MODE_MASK)) \ + << (SBP_PROTECTION_LEVEL_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_PROTECTION_LEVEL_FIX_MODE_INVALID (0) #define SBP_PROTECTION_LEVEL_FIX_MODE_SINGLE_POINT_POSITION (1) @@ -1380,239 +1545,288 @@ #define SBP_PROTECTION_LEVEL_FIX_MODE_SBAS_POSITION (6) #define SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_MASK (0x3u) #define SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_SHIFT (18u) -#define SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_GET(flags) \ - ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_SHIFT) \ - & SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_MASK)) -#define SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_MASK << SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_MASK)) \ - << (SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_SHIFT)));} while(0) - +#define SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_GET(flags) \ + ((u32)( \ + (u32)((flags) >> SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_SHIFT) & \ + SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_MASK)) +#define SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_SET(flags, val) \ + do { \ + (flags) = \ + (u32)((flags & \ + (~(SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_MASK \ + << SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_SHIFT))) | \ + (((val) & (SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_MASK)) \ + << (SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_SHIFT))); \ + } while (0) #define SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_NONE (0) #define SBP_PROTECTION_LEVEL_INERTIAL_NAVIGATION_MODE_INS_USED (1) #define SBP_PROTECTION_LEVEL_TIME_STATUS_MASK (0x1u) #define SBP_PROTECTION_LEVEL_TIME_STATUS_SHIFT (20u) -#define SBP_PROTECTION_LEVEL_TIME_STATUS_GET(flags) \ - ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_TIME_STATUS_SHIFT) \ - & SBP_PROTECTION_LEVEL_TIME_STATUS_MASK)) -#define SBP_PROTECTION_LEVEL_TIME_STATUS_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_TIME_STATUS_MASK << SBP_PROTECTION_LEVEL_TIME_STATUS_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_TIME_STATUS_MASK)) \ - << (SBP_PROTECTION_LEVEL_TIME_STATUS_SHIFT)));} while(0) - +#define SBP_PROTECTION_LEVEL_TIME_STATUS_GET(flags) \ + ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_TIME_STATUS_SHIFT) & \ + SBP_PROTECTION_LEVEL_TIME_STATUS_MASK)) +#define SBP_PROTECTION_LEVEL_TIME_STATUS_SET(flags, val) \ + do { \ + (flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_TIME_STATUS_MASK \ + << SBP_PROTECTION_LEVEL_TIME_STATUS_SHIFT))) | \ + (((val) & (SBP_PROTECTION_LEVEL_TIME_STATUS_MASK)) \ + << (SBP_PROTECTION_LEVEL_TIME_STATUS_SHIFT))); \ + } while (0) #define SBP_PROTECTION_LEVEL_TIME_STATUS_GNSS_TIME_OF_VALIDITY (0) #define SBP_PROTECTION_LEVEL_TIME_STATUS_OTHER (1) #define SBP_PROTECTION_LEVEL_VELOCITY_VALID_MASK (0x1u) #define SBP_PROTECTION_LEVEL_VELOCITY_VALID_SHIFT (21u) -#define SBP_PROTECTION_LEVEL_VELOCITY_VALID_GET(flags) \ - ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_VELOCITY_VALID_SHIFT) \ - & SBP_PROTECTION_LEVEL_VELOCITY_VALID_MASK)) -#define SBP_PROTECTION_LEVEL_VELOCITY_VALID_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_VELOCITY_VALID_MASK << SBP_PROTECTION_LEVEL_VELOCITY_VALID_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_VELOCITY_VALID_MASK)) \ - << (SBP_PROTECTION_LEVEL_VELOCITY_VALID_SHIFT)));} while(0) - +#define SBP_PROTECTION_LEVEL_VELOCITY_VALID_GET(flags) \ + ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_VELOCITY_VALID_SHIFT) & \ + SBP_PROTECTION_LEVEL_VELOCITY_VALID_MASK)) +#define SBP_PROTECTION_LEVEL_VELOCITY_VALID_SET(flags, val) \ + do { \ + (flags) = \ + (u32)((flags & (~(SBP_PROTECTION_LEVEL_VELOCITY_VALID_MASK \ + << SBP_PROTECTION_LEVEL_VELOCITY_VALID_SHIFT))) | \ + (((val) & (SBP_PROTECTION_LEVEL_VELOCITY_VALID_MASK)) \ + << (SBP_PROTECTION_LEVEL_VELOCITY_VALID_SHIFT))); \ + } while (0) #define SBP_PROTECTION_LEVEL_ATTITUDE_VALID_MASK (0x1u) #define SBP_PROTECTION_LEVEL_ATTITUDE_VALID_SHIFT (22u) -#define SBP_PROTECTION_LEVEL_ATTITUDE_VALID_GET(flags) \ - ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_ATTITUDE_VALID_SHIFT) \ - & SBP_PROTECTION_LEVEL_ATTITUDE_VALID_MASK)) -#define SBP_PROTECTION_LEVEL_ATTITUDE_VALID_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_ATTITUDE_VALID_MASK << SBP_PROTECTION_LEVEL_ATTITUDE_VALID_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_ATTITUDE_VALID_MASK)) \ - << (SBP_PROTECTION_LEVEL_ATTITUDE_VALID_SHIFT)));} while(0) - +#define SBP_PROTECTION_LEVEL_ATTITUDE_VALID_GET(flags) \ + ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_ATTITUDE_VALID_SHIFT) & \ + SBP_PROTECTION_LEVEL_ATTITUDE_VALID_MASK)) +#define SBP_PROTECTION_LEVEL_ATTITUDE_VALID_SET(flags, val) \ + do { \ + (flags) = \ + (u32)((flags & (~(SBP_PROTECTION_LEVEL_ATTITUDE_VALID_MASK \ + << SBP_PROTECTION_LEVEL_ATTITUDE_VALID_SHIFT))) | \ + (((val) & (SBP_PROTECTION_LEVEL_ATTITUDE_VALID_MASK)) \ + << (SBP_PROTECTION_LEVEL_ATTITUDE_VALID_SHIFT))); \ + } while (0) #define SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_MASK (0x1u) #define SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_SHIFT (23u) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_GET(flags) \ - ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_SHIFT) \ - & SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_MASK)) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_MASK << SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_MASK)) \ - << (SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_SHIFT)));} while(0) - +#define SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_GET(flags) \ + ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_SHIFT) & \ + SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_MASK)) +#define SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_SET(flags, val) \ + do { \ + (flags) = \ + (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_MASK \ + << SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_SHIFT))) | \ + (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_MASK)) \ + << (SBP_PROTECTION_LEVEL_SAFE_STATE_HPL_SHIFT))); \ + } while (0) #define SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_MASK (0x1u) #define SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_SHIFT (24u) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_GET(flags) \ - ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_SHIFT) \ - & SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_MASK)) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_MASK << SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_MASK)) \ - << (SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_SHIFT)));} while(0) - +#define SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_GET(flags) \ + ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_SHIFT) & \ + SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_MASK)) +#define SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_SET(flags, val) \ + do { \ + (flags) = \ + (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_MASK \ + << SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_SHIFT))) | \ + (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_MASK)) \ + << (SBP_PROTECTION_LEVEL_SAFE_STATE_VPL_SHIFT))); \ + } while (0) #define SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_MASK (0x1u) #define SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_SHIFT (25u) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_GET(flags) \ - ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_SHIFT) \ - & SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_MASK)) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_MASK << SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_MASK)) \ - << (SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_SHIFT)));} while(0) - +#define SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_GET(flags) \ + ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_SHIFT) & \ + SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_MASK)) +#define SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_SET(flags, val) \ + do { \ + (flags) = \ + (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_MASK \ + << SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_SHIFT))) | \ + (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_MASK)) \ + << (SBP_PROTECTION_LEVEL_SAFE_STATE_ATPL_SHIFT))); \ + } while (0) #define SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_MASK (0x1u) #define SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_SHIFT (26u) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_GET(flags) \ - ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_SHIFT) \ - & SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_MASK)) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_MASK << SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_MASK)) \ - << (SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_SHIFT)));} while(0) - +#define SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_GET(flags) \ + ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_SHIFT) & \ + SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_MASK)) +#define SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_SET(flags, val) \ + do { \ + (flags) = \ + (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_MASK \ + << SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_SHIFT))) | \ + (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_MASK)) \ + << (SBP_PROTECTION_LEVEL_SAFE_STATE_CTPL_SHIFT))); \ + } while (0) #define SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_MASK (0x1u) #define SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_SHIFT (27u) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_GET(flags) \ - ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_SHIFT) \ - & SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_MASK)) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_MASK << SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_MASK)) \ - << (SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_SHIFT)));} while(0) - +#define SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_GET(flags) \ + ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_SHIFT) & \ + SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_MASK)) +#define SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_SET(flags, val) \ + do { \ + (flags) = \ + (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_MASK \ + << SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_SHIFT))) | \ + (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_MASK)) \ + << (SBP_PROTECTION_LEVEL_SAFE_STATE_HVPL_SHIFT))); \ + } while (0) #define SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_MASK (0x1u) #define SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_SHIFT (28u) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_GET(flags) \ - ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_SHIFT) \ - & SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_MASK)) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_MASK << SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_MASK)) \ - << (SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_SHIFT)));} while(0) - +#define SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_GET(flags) \ + ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_SHIFT) & \ + SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_MASK)) +#define SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_SET(flags, val) \ + do { \ + (flags) = \ + (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_MASK \ + << SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_SHIFT))) | \ + (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_MASK)) \ + << (SBP_PROTECTION_LEVEL_SAFE_STATE_VVPL_SHIFT))); \ + } while (0) #define SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_MASK (0x1u) #define SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_SHIFT (29u) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_GET(flags) \ - ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_SHIFT) \ - & SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_MASK)) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_MASK << SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_MASK)) \ - << (SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_SHIFT)));} while(0) - +#define SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_GET(flags) \ + ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_SHIFT) & \ + SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_MASK)) +#define SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_SET(flags, val) \ + do { \ + (flags) = \ + (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_MASK \ + << SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_SHIFT))) | \ + (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_MASK)) \ + << (SBP_PROTECTION_LEVEL_SAFE_STATE_HOPL_SHIFT))); \ + } while (0) #define SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_MASK (0x1u) #define SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_SHIFT (30u) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_GET(flags) \ - ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_SHIFT) \ - & SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_MASK)) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_MASK << SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_MASK)) \ - << (SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_SHIFT)));} while(0) - +#define SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_GET(flags) \ + ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_SHIFT) & \ + SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_MASK)) +#define SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_SET(flags, val) \ + do { \ + (flags) = \ + (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_MASK \ + << SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_SHIFT))) | \ + (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_MASK)) \ + << (SBP_PROTECTION_LEVEL_SAFE_STATE_POPL_SHIFT))); \ + } while (0) #define SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_MASK (0x1u) #define SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_SHIFT (31u) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_GET(flags) \ - ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_SHIFT) \ - & SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_MASK)) -#define SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_MASK << SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_SHIFT))) | \ - (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_MASK)) \ - << (SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_SHIFT)));} while(0) - +#define SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_GET(flags) \ + ((u32)((u32)((flags) >> SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_SHIFT) & \ + SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_MASK)) +#define SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_SET(flags, val) \ + do { \ + (flags) = \ + (u32)((flags & (~(SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_MASK \ + << SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_SHIFT))) | \ + (((val) & (SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_MASK)) \ + << (SBP_PROTECTION_LEVEL_SAFE_STATE_ROPL_SHIFT))); \ + } while (0) /** - * Encoded length of sbp_msg_protection_level_t (V4 API) and + * Encoded length of sbp_msg_protection_level_t (V4 API) and * msg_protection_level_t (legacy API) */ #define SBP_MSG_PROTECTION_LEVEL_ENCODED_LEN 76u - #define SBP_MSG_UTC_LEAP_SECOND 0x023A /** - * Encoded length of sbp_msg_utc_leap_second_t (V4 API) and + * Encoded length of sbp_msg_utc_leap_second_t (V4 API) and * msg_utc_leap_second_t (legacy API) */ #define SBP_MSG_UTC_LEAP_SECOND_ENCODED_LEN 14u - #define SBP_MSG_REFERENCE_FRAME_PARAM 0x0244 /** - * The maximum number of items that can be stored in sbp_msg_reference_frame_param_t::sn (V4 API) or msg_reference_frame_param_t::sn (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_reference_frame_param_t::sn (V4 API) or + * msg_reference_frame_param_t::sn (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_REFERENCE_FRAME_PARAM_SN_MAX 32u - /** - * The maximum number of items that can be stored in sbp_msg_reference_frame_param_t::tn (V4 API) or msg_reference_frame_param_t::tn (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_reference_frame_param_t::tn (V4 API) or + * msg_reference_frame_param_t::tn (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_REFERENCE_FRAME_PARAM_TN_MAX 32u - /** - * Encoded length of sbp_msg_reference_frame_param_t (V4 API) and + * Encoded length of sbp_msg_reference_frame_param_t (V4 API) and * msg_reference_frame_param_t (legacy API) */ #define SBP_MSG_REFERENCE_FRAME_PARAM_ENCODED_LEN 124u - #define SBP_MSG_POSE_RELATIVE 0x0245 /** - * The maximum number of items that can be stored in sbp_msg_pose_relative_t::trans (V4 API) or msg_pose_relative_t::trans (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_pose_relative_t::trans (V4 API) or msg_pose_relative_t::trans (legacy + * API) before the maximum SBP message size is exceeded */ #define SBP_MSG_POSE_RELATIVE_TRANS_MAX 3u - #define SBP_POSE_RELATIVE_TIME_SOURCE_MASK (0x3u) #define SBP_POSE_RELATIVE_TIME_SOURCE_SHIFT (4u) -#define SBP_POSE_RELATIVE_TIME_SOURCE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POSE_RELATIVE_TIME_SOURCE_SHIFT) \ - & SBP_POSE_RELATIVE_TIME_SOURCE_MASK)) -#define SBP_POSE_RELATIVE_TIME_SOURCE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POSE_RELATIVE_TIME_SOURCE_MASK << SBP_POSE_RELATIVE_TIME_SOURCE_SHIFT))) | \ - (((val) & (SBP_POSE_RELATIVE_TIME_SOURCE_MASK)) \ - << (SBP_POSE_RELATIVE_TIME_SOURCE_SHIFT)));} while(0) - +#define SBP_POSE_RELATIVE_TIME_SOURCE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POSE_RELATIVE_TIME_SOURCE_SHIFT) & \ + SBP_POSE_RELATIVE_TIME_SOURCE_MASK)) +#define SBP_POSE_RELATIVE_TIME_SOURCE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_POSE_RELATIVE_TIME_SOURCE_MASK \ + << SBP_POSE_RELATIVE_TIME_SOURCE_SHIFT))) | \ + (((val) & (SBP_POSE_RELATIVE_TIME_SOURCE_MASK)) \ + << (SBP_POSE_RELATIVE_TIME_SOURCE_SHIFT))); \ + } while (0) #define SBP_POSE_RELATIVE_TIME_SOURCE_NONE (0) #define SBP_POSE_RELATIVE_TIME_SOURCE_GNSS_SOLUTION (1) #define SBP_POSE_RELATIVE_TIME_SOURCE_LOCAL_CPU_TIME (2) #define SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_MASK (0x3u) #define SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_SHIFT (2u) -#define SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_SHIFT) \ - & SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_MASK)) -#define SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_MASK << SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_SHIFT))) | \ - (((val) & (SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_MASK)) \ - << (SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_SHIFT)));} while(0) - +#define SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_SHIFT) & \ + SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_MASK)) +#define SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & \ + (~(SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_MASK \ + << SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_SHIFT))) | \ + (((val) & (SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_MASK)) \ + << (SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_SHIFT))); \ + } while (0) #define SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_INVALID (0) #define SBP_POSE_RELATIVE_RELATIVE_TRANSLATION_STATUS_VALID (1) #define SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_MASK (0x3u) #define SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_SHIFT (0u) -#define SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_SHIFT) \ - & SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_MASK)) -#define SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_MASK << SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_SHIFT))) | \ - (((val) & (SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_MASK)) \ - << (SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_SHIFT)));} while(0) - +#define SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_SHIFT) & \ + SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_MASK)) +#define SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_MASK \ + << SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_SHIFT))) | \ + (((val) & (SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_MASK)) \ + << (SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_SHIFT))); \ + } while (0) #define SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_INVALID (0) #define SBP_POSE_RELATIVE_RELATIVE_ROTATION_STATUS_VALID (1) /** - * Encoded length of sbp_msg_pose_relative_t (V4 API) and + * Encoded length of sbp_msg_pose_relative_t (V4 API) and * msg_pose_relative_t (legacy API) */ #define SBP_MSG_POSE_RELATIVE_ENCODED_LEN 90u - - #endif /* LIBSBP_NAVIGATION_MACROS_H */ diff --git a/c/include/libsbp/ndb/MSG_NDB_EVENT.h b/c/include/libsbp/ndb/MSG_NDB_EVENT.h index b5c828014..91136ada6 100644 --- a/c/include/libsbp/ndb/MSG_NDB_EVENT.h +++ b/c/include/libsbp/ndb/MSG_NDB_EVENT.h @@ -18,21 +18,20 @@ #ifndef LIBSBP_NDB_MSG_NDB_EVENT_H #define LIBSBP_NDB_MSG_NDB_EVENT_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,69 +41,64 @@ *****************************************************************************/ /** Navigation DataBase Event * -* This message is sent out when an object is stored into NDB. If needed message could also be sent out when fetching an object from NDB. + * This message is sent out when an object is stored into NDB. If needed message + * could also be sent out when fetching an object from NDB. */ typedef struct { - - /** -* HW time in milliseconds. [ms] + * HW time in milliseconds. [ms] */ u64 recv_time; - /** -* Event type. + * Event type. */ u8 event; - /** -* Event object type. + * Event object type. */ u8 object_type; - /** -* Event result. + * Event result. */ u8 result; - /** -* Data source for STORE event, reserved for other events. + * Data source for STORE event, reserved for other events. */ u8 data_source; - /** - * GNSS signal identifier, If object_type is Ephemeris OR Almanac, sid indicates for which signal the object belongs to. Reserved in other cases. + * GNSS signal identifier, If object_type is Ephemeris OR Almanac, sid + * indicates for which signal the object belongs to. Reserved in other cases. */ sbp_v4_gnss_signal_t object_sid; - /** - * GNSS signal identifier, If object_type is Almanac, Almanac WN, Iono OR L2C capabilities AND data_source is NDB_DS_RECEIVER sid indicates from which SV data was decoded. Reserved in other cases. + * GNSS signal identifier, If object_type is Almanac, Almanac WN, Iono OR L2C + * capabilities AND data_source is NDB_DS_RECEIVER sid indicates from which SV + * data was decoded. Reserved in other cases. */ sbp_v4_gnss_signal_t src_sid; - /** - * A unique identifier of the sending hardware. For v1.0, set to the 2 least significant bytes of the device serial number, valid only if data_source is NDB_DS_SBP. Reserved in case of other data_source. + * A unique identifier of the sending hardware. For v1.0, set to the 2 least + * significant bytes of the device serial number, valid only if data_source is + * NDB_DS_SBP. Reserved in case of other data_source. */ u16 original_sender; } sbp_msg_ndb_event_t; - - /** * Get encoded size of an instance of sbp_msg_ndb_event_t * * @param msg sbp_msg_ndb_event_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ndb_event_encoded_len(const sbp_msg_ndb_event_t *msg) -{ +static inline size_t sbp_msg_ndb_event_encoded_len( + const sbp_msg_ndb_event_t *msg) { (void)msg; return SBP_MSG_NDB_EVENT_ENCODED_LEN; } @@ -112,36 +106,53 @@ static inline size_t sbp_msg_ndb_event_encoded_len(const sbp_msg_ndb_event_t *ms /** * Encode an instance of sbp_msg_ndb_event_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ndb_event_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ndb_event_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ndb_event_t *msg); +SBP_EXPORT s8 sbp_msg_ndb_event_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_ndb_event_t *msg); /** * Decode an instance of sbp_msg_ndb_event_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ndb_event_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ndb_event_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ndb_event_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ndb_event_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ndb_event_t *msg); +SBP_EXPORT s8 sbp_msg_ndb_event_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ndb_event_t *msg); /** * Send an instance of sbp_msg_ndb_event_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ndb_event_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ndb_event_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -149,51 +160,61 @@ SBP_EXPORT s8 sbp_msg_ndb_event_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ndb_event_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ndb_event_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ndb_event_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ndb_event_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ndb_event_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ndb_event_t instance * @param b sbp_msg_ndb_event_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ndb_event_cmp(const sbp_msg_ndb_event_t *a, const sbp_msg_ndb_event_t *b); +SBP_EXPORT int sbp_msg_ndb_event_cmp(const sbp_msg_ndb_event_t *a, + const sbp_msg_ndb_event_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ndb_event_t &lhs, const sbp_msg_ndb_event_t &rhs) { +static inline bool operator==(const sbp_msg_ndb_event_t &lhs, + const sbp_msg_ndb_event_t &rhs) { return sbp_msg_ndb_event_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ndb_event_t &lhs, const sbp_msg_ndb_event_t &rhs) { +static inline bool operator!=(const sbp_msg_ndb_event_t &lhs, + const sbp_msg_ndb_event_t &rhs) { return sbp_msg_ndb_event_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ndb_event_t &lhs, const sbp_msg_ndb_event_t &rhs) { +static inline bool operator<(const sbp_msg_ndb_event_t &lhs, + const sbp_msg_ndb_event_t &rhs) { return sbp_msg_ndb_event_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ndb_event_t &lhs, const sbp_msg_ndb_event_t &rhs) { +static inline bool operator<=(const sbp_msg_ndb_event_t &lhs, + const sbp_msg_ndb_event_t &rhs) { return sbp_msg_ndb_event_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ndb_event_t &lhs, const sbp_msg_ndb_event_t &rhs) { +static inline bool operator>(const sbp_msg_ndb_event_t &lhs, + const sbp_msg_ndb_event_t &rhs) { return sbp_msg_ndb_event_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ndb_event_t &lhs, const sbp_msg_ndb_event_t &rhs) { +static inline bool operator>=(const sbp_msg_ndb_event_t &lhs, + const sbp_msg_ndb_event_t &rhs) { return sbp_msg_ndb_event_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_NDB_MSG_NDB_EVENT_H */ - diff --git a/c/include/libsbp/ndb_macros.h b/c/include/libsbp/ndb_macros.h index 7dad1a358..e034bb444 100644 --- a/c/include/libsbp/ndb_macros.h +++ b/c/include/libsbp/ndb_macros.h @@ -18,18 +18,19 @@ #ifndef LIBSBP_NDB_MACROS_H #define LIBSBP_NDB_MACROS_H - #define SBP_MSG_NDB_EVENT 0x0400 #define SBP_NDB_EVENT_EVENT_TYPE_MASK (0x3u) #define SBP_NDB_EVENT_EVENT_TYPE_SHIFT (0u) -#define SBP_NDB_EVENT_EVENT_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_NDB_EVENT_EVENT_TYPE_SHIFT) \ - & SBP_NDB_EVENT_EVENT_TYPE_MASK)) -#define SBP_NDB_EVENT_EVENT_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_NDB_EVENT_EVENT_TYPE_MASK << SBP_NDB_EVENT_EVENT_TYPE_SHIFT))) | \ - (((val) & (SBP_NDB_EVENT_EVENT_TYPE_MASK)) \ - << (SBP_NDB_EVENT_EVENT_TYPE_SHIFT)));} while(0) - +#define SBP_NDB_EVENT_EVENT_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_NDB_EVENT_EVENT_TYPE_SHIFT) & \ + SBP_NDB_EVENT_EVENT_TYPE_MASK)) +#define SBP_NDB_EVENT_EVENT_TYPE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_NDB_EVENT_EVENT_TYPE_MASK \ + << SBP_NDB_EVENT_EVENT_TYPE_SHIFT))) | \ + (((val) & (SBP_NDB_EVENT_EVENT_TYPE_MASK)) \ + << (SBP_NDB_EVENT_EVENT_TYPE_SHIFT))); \ + } while (0) #define SBP_NDB_EVENT_EVENT_TYPE_UNKNOWN (0) #define SBP_NDB_EVENT_EVENT_TYPE_STORE (1) @@ -37,14 +38,16 @@ #define SBP_NDB_EVENT_EVENT_TYPE_ERASE (3) #define SBP_NDB_EVENT_EVENT_OBJECT_TYPE_MASK (0x7u) #define SBP_NDB_EVENT_EVENT_OBJECT_TYPE_SHIFT (0u) -#define SBP_NDB_EVENT_EVENT_OBJECT_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_NDB_EVENT_EVENT_OBJECT_TYPE_SHIFT) \ - & SBP_NDB_EVENT_EVENT_OBJECT_TYPE_MASK)) -#define SBP_NDB_EVENT_EVENT_OBJECT_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_NDB_EVENT_EVENT_OBJECT_TYPE_MASK << SBP_NDB_EVENT_EVENT_OBJECT_TYPE_SHIFT))) | \ - (((val) & (SBP_NDB_EVENT_EVENT_OBJECT_TYPE_MASK)) \ - << (SBP_NDB_EVENT_EVENT_OBJECT_TYPE_SHIFT)));} while(0) - +#define SBP_NDB_EVENT_EVENT_OBJECT_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_NDB_EVENT_EVENT_OBJECT_TYPE_SHIFT) & \ + SBP_NDB_EVENT_EVENT_OBJECT_TYPE_MASK)) +#define SBP_NDB_EVENT_EVENT_OBJECT_TYPE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_NDB_EVENT_EVENT_OBJECT_TYPE_MASK \ + << SBP_NDB_EVENT_EVENT_OBJECT_TYPE_SHIFT))) | \ + (((val) & (SBP_NDB_EVENT_EVENT_OBJECT_TYPE_MASK)) \ + << (SBP_NDB_EVENT_EVENT_OBJECT_TYPE_SHIFT))); \ + } while (0) #define SBP_NDB_EVENT_EVENT_OBJECT_TYPE_UNKNOWN (0) #define SBP_NDB_EVENT_EVENT_OBJECT_TYPE_EPHEMERIS (1) @@ -55,14 +58,16 @@ #define SBP_NDB_EVENT_EVENT_OBJECT_TYPE_LGF (6) #define SBP_NDB_EVENT_EVENT_RESULT_MASK (0xfu) #define SBP_NDB_EVENT_EVENT_RESULT_SHIFT (0u) -#define SBP_NDB_EVENT_EVENT_RESULT_GET(flags) \ - ((u8)((u8)((flags) >> SBP_NDB_EVENT_EVENT_RESULT_SHIFT) \ - & SBP_NDB_EVENT_EVENT_RESULT_MASK)) -#define SBP_NDB_EVENT_EVENT_RESULT_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_NDB_EVENT_EVENT_RESULT_MASK << SBP_NDB_EVENT_EVENT_RESULT_SHIFT))) | \ - (((val) & (SBP_NDB_EVENT_EVENT_RESULT_MASK)) \ - << (SBP_NDB_EVENT_EVENT_RESULT_SHIFT)));} while(0) - +#define SBP_NDB_EVENT_EVENT_RESULT_GET(flags) \ + ((u8)((u8)((flags) >> SBP_NDB_EVENT_EVENT_RESULT_SHIFT) & \ + SBP_NDB_EVENT_EVENT_RESULT_MASK)) +#define SBP_NDB_EVENT_EVENT_RESULT_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_NDB_EVENT_EVENT_RESULT_MASK \ + << SBP_NDB_EVENT_EVENT_RESULT_SHIFT))) | \ + (((val) & (SBP_NDB_EVENT_EVENT_RESULT_MASK)) \ + << (SBP_NDB_EVENT_EVENT_RESULT_SHIFT))); \ + } while (0) #define SBP_NDB_EVENT_EVENT_RESULT_NDB_ERR_NONE (0) #define SBP_NDB_EVENT_EVENT_RESULT_NDB_ERR_MISSING_IE (1) @@ -77,25 +82,25 @@ #define SBP_NDB_EVENT_EVENT_RESULT_NDB_ERR_OLDER_DATA (10) #define SBP_NDB_EVENT_DATA_SOURCE_MASK (0x3u) #define SBP_NDB_EVENT_DATA_SOURCE_SHIFT (0u) -#define SBP_NDB_EVENT_DATA_SOURCE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_NDB_EVENT_DATA_SOURCE_SHIFT) \ - & SBP_NDB_EVENT_DATA_SOURCE_MASK)) -#define SBP_NDB_EVENT_DATA_SOURCE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_NDB_EVENT_DATA_SOURCE_MASK << SBP_NDB_EVENT_DATA_SOURCE_SHIFT))) | \ - (((val) & (SBP_NDB_EVENT_DATA_SOURCE_MASK)) \ - << (SBP_NDB_EVENT_DATA_SOURCE_SHIFT)));} while(0) - +#define SBP_NDB_EVENT_DATA_SOURCE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_NDB_EVENT_DATA_SOURCE_SHIFT) & \ + SBP_NDB_EVENT_DATA_SOURCE_MASK)) +#define SBP_NDB_EVENT_DATA_SOURCE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_NDB_EVENT_DATA_SOURCE_MASK \ + << SBP_NDB_EVENT_DATA_SOURCE_SHIFT))) | \ + (((val) & (SBP_NDB_EVENT_DATA_SOURCE_MASK)) \ + << (SBP_NDB_EVENT_DATA_SOURCE_SHIFT))); \ + } while (0) #define SBP_NDB_EVENT_DATA_SOURCE_NDB_DS_UNDEFINED (0) #define SBP_NDB_EVENT_DATA_SOURCE_NDB_DS_INIT (1) #define SBP_NDB_EVENT_DATA_SOURCE_NDB_DS_RECEIVER (2) #define SBP_NDB_EVENT_DATA_SOURCE_NDB_DS_SBP (3) /** - * Encoded length of sbp_msg_ndb_event_t (V4 API) and + * Encoded length of sbp_msg_ndb_event_t (V4 API) and * msg_ndb_event_t (legacy API) */ #define SBP_MSG_NDB_EVENT_ENCODED_LEN 18u - - #endif /* LIBSBP_NDB_MACROS_H */ diff --git a/c/include/libsbp/observation.h b/c/include/libsbp/observation.h index d8354e3c6..62f96f0cf 100644 --- a/c/include/libsbp/observation.h +++ b/c/include/libsbp/observation.h @@ -17,59 +17,59 @@ #ifndef LIBSBP_OBSERVATION_MESSAGES_H #define LIBSBP_OBSERVATION_MESSAGES_H -#include +#include +#include +#include #include -#include -#include -#include -#include -#include #include -#include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include +#include +#include +#include #include -#include +#include +#include #include -#include -#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include #endif /* LIBSBP_OBSERVATION_MESSAGES_H */ diff --git a/c/include/libsbp/observation/AlmanacCommonContent.h b/c/include/libsbp/observation/AlmanacCommonContent.h index 2f28eea5c..366297e13 100644 --- a/c/include/libsbp/observation/AlmanacCommonContent.h +++ b/c/include/libsbp/observation/AlmanacCommonContent.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_ALMANACCOMMONCONTENT_H #define LIBSBP_OBSERVATION_ALMANACCOMMONCONTENT_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,67 +41,58 @@ * *****************************************************************************/ typedef struct { - - /** -* GNSS signal identifier + * GNSS signal identifier */ sbp_v4_gnss_signal_t sid; - /** -* Reference time of almanac + * Reference time of almanac */ sbp_gps_time_sec_t toa; - /** -* User Range Accuracy [m] + * User Range Accuracy [m] */ double ura; - /** -* Curve fit interval [s] + * Curve fit interval [s] */ u32 fit_interval; - /** -* Status of almanac, 1 = valid, 0 = invalid + * Status of almanac, 1 = valid, 0 = invalid */ u8 valid; - /** - * Satellite health status for GPS: - * - bits 5-7: NAV data health status. See IS-GPS-200H - * Table 20-VII: NAV Data Health Indications. - * - bits 0-4: Signal health status. See IS-GPS-200H - * Table 20-VIII. Codes for Health of SV Signal - * Components. - * Satellite health status for GLO (see GLO ICD 5.1 table 5.1 for details): - * - bit 0: C(n), "unhealthy" flag that is transmitted within - * non-immediate data and indicates overall constellation status - * at the moment of almanac uploading. - * '0' indicates malfunction of n-satellite. - * '1' indicates that n-satellite is operational. - * - bit 1: Bn(ln), '0' indicates the satellite is operational - * and suitable for navigation. + * Satellite health status for GPS: + * - bits 5-7: NAV data health status. See IS-GPS-200H + * Table 20-VII: NAV Data Health Indications. + * - bits 0-4: Signal health status. See IS-GPS-200H + * Table 20-VIII. Codes for Health of SV Signal + * Components. + * Satellite health status for GLO (see GLO ICD 5.1 table 5.1 for details): + * - bit 0: C(n), "unhealthy" flag that is transmitted within + * non-immediate data and indicates overall constellation status + * at the moment of almanac uploading. + * '0' indicates malfunction of n-satellite. + * '1' indicates that n-satellite is operational. + * - bit 1: Bn(ln), '0' indicates the satellite is operational + * and suitable for navigation. */ u8 health_bits; } sbp_almanac_common_content_t; - - /** * Get encoded size of an instance of sbp_almanac_common_content_t * * @param msg sbp_almanac_common_content_t instance * @return Length of on-wire representation */ -static inline size_t sbp_almanac_common_content_encoded_len(const sbp_almanac_common_content_t *msg) -{ +static inline size_t sbp_almanac_common_content_encoded_len( + const sbp_almanac_common_content_t *msg) { (void)msg; return SBP_ALMANAC_COMMON_CONTENT_ENCODED_LEN; } @@ -109,74 +100,97 @@ static inline size_t sbp_almanac_common_content_encoded_len(const sbp_almanac_co /** * Encode an instance of sbp_almanac_common_content_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_almanac_common_content_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_almanac_common_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_almanac_common_content_t *msg); +SBP_EXPORT s8 +sbp_almanac_common_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_almanac_common_content_t *msg); /** * Decode an instance of sbp_almanac_common_content_t from wire representation * - * This function decodes the wire representation of a sbp_almanac_common_content_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_almanac_common_content_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_almanac_common_content_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_almanac_common_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_almanac_common_content_t *msg); +SBP_EXPORT s8 sbp_almanac_common_content_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_almanac_common_content_t *msg); /** * Compare two instances of sbp_almanac_common_content_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_almanac_common_content_t instance * @param b sbp_almanac_common_content_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_almanac_common_content_cmp(const sbp_almanac_common_content_t *a, const sbp_almanac_common_content_t *b); +SBP_EXPORT int sbp_almanac_common_content_cmp( + const sbp_almanac_common_content_t *a, + const sbp_almanac_common_content_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_almanac_common_content_t &lhs, const sbp_almanac_common_content_t &rhs) { +static inline bool operator==(const sbp_almanac_common_content_t &lhs, + const sbp_almanac_common_content_t &rhs) { return sbp_almanac_common_content_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_almanac_common_content_t &lhs, const sbp_almanac_common_content_t &rhs) { +static inline bool operator!=(const sbp_almanac_common_content_t &lhs, + const sbp_almanac_common_content_t &rhs) { return sbp_almanac_common_content_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_almanac_common_content_t &lhs, const sbp_almanac_common_content_t &rhs) { +static inline bool operator<(const sbp_almanac_common_content_t &lhs, + const sbp_almanac_common_content_t &rhs) { return sbp_almanac_common_content_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_almanac_common_content_t &lhs, const sbp_almanac_common_content_t &rhs) { +static inline bool operator<=(const sbp_almanac_common_content_t &lhs, + const sbp_almanac_common_content_t &rhs) { return sbp_almanac_common_content_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_almanac_common_content_t &lhs, const sbp_almanac_common_content_t &rhs) { +static inline bool operator>(const sbp_almanac_common_content_t &lhs, + const sbp_almanac_common_content_t &rhs) { return sbp_almanac_common_content_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_almanac_common_content_t &lhs, const sbp_almanac_common_content_t &rhs) { +static inline bool operator>=(const sbp_almanac_common_content_t &lhs, + const sbp_almanac_common_content_t &rhs) { return sbp_almanac_common_content_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_ALMANACCOMMONCONTENT_H */ - diff --git a/c/include/libsbp/observation/AlmanacCommonContentDep.h b/c/include/libsbp/observation/AlmanacCommonContentDep.h index 9cfbb91fa..da089987c 100644 --- a/c/include/libsbp/observation/AlmanacCommonContentDep.h +++ b/c/include/libsbp/observation/AlmanacCommonContentDep.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_ALMANACCOMMONCONTENTDEP_H #define LIBSBP_OBSERVATION_ALMANACCOMMONCONTENTDEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,67 +41,58 @@ * *****************************************************************************/ typedef struct { - - /** -* GNSS signal identifier + * GNSS signal identifier */ sbp_gnss_signal_dep_t sid; - /** -* Reference time of almanac + * Reference time of almanac */ sbp_gps_time_sec_t toa; - /** -* User Range Accuracy [m] + * User Range Accuracy [m] */ double ura; - /** -* Curve fit interval [s] + * Curve fit interval [s] */ u32 fit_interval; - /** -* Status of almanac, 1 = valid, 0 = invalid + * Status of almanac, 1 = valid, 0 = invalid */ u8 valid; - /** - * Satellite health status for GPS: - * - bits 5-7: NAV data health status. See IS-GPS-200H - * Table 20-VII: NAV Data Health Indications. - * - bits 0-4: Signal health status. See IS-GPS-200H - * Table 20-VIII. Codes for Health of SV Signal - * Components. - * Satellite health status for GLO (see GLO ICD 5.1 table 5.1 for details): - * - bit 0: C(n), "unhealthy" flag that is transmitted within - * non-immediate data and indicates overall constellation status - * at the moment of almanac uploading. - * '0' indicates malfunction of n-satellite. - * '1' indicates that n-satellite is operational. - * - bit 1: Bn(ln), '0' indicates the satellite is operational - * and suitable for navigation. + * Satellite health status for GPS: + * - bits 5-7: NAV data health status. See IS-GPS-200H + * Table 20-VII: NAV Data Health Indications. + * - bits 0-4: Signal health status. See IS-GPS-200H + * Table 20-VIII. Codes for Health of SV Signal + * Components. + * Satellite health status for GLO (see GLO ICD 5.1 table 5.1 for details): + * - bit 0: C(n), "unhealthy" flag that is transmitted within + * non-immediate data and indicates overall constellation status + * at the moment of almanac uploading. + * '0' indicates malfunction of n-satellite. + * '1' indicates that n-satellite is operational. + * - bit 1: Bn(ln), '0' indicates the satellite is operational + * and suitable for navigation. */ u8 health_bits; } sbp_almanac_common_content_dep_t; - - /** * Get encoded size of an instance of sbp_almanac_common_content_dep_t * * @param msg sbp_almanac_common_content_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_almanac_common_content_dep_encoded_len(const sbp_almanac_common_content_dep_t *msg) -{ +static inline size_t sbp_almanac_common_content_dep_encoded_len( + const sbp_almanac_common_content_dep_t *msg) { (void)msg; return SBP_ALMANAC_COMMON_CONTENT_DEP_ENCODED_LEN; } @@ -109,74 +100,99 @@ static inline size_t sbp_almanac_common_content_dep_encoded_len(const sbp_almana /** * Encode an instance of sbp_almanac_common_content_dep_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_almanac_common_content_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_almanac_common_content_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_almanac_common_content_dep_t *msg); +SBP_EXPORT s8 sbp_almanac_common_content_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_almanac_common_content_dep_t *msg); /** - * Decode an instance of sbp_almanac_common_content_dep_t from wire representation + * Decode an instance of sbp_almanac_common_content_dep_t from wire + * representation * - * This function decodes the wire representation of a sbp_almanac_common_content_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_almanac_common_content_dep_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_almanac_common_content_dep_t instance + * @param buf Wire representation of the sbp_almanac_common_content_dep_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_almanac_common_content_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_almanac_common_content_dep_t *msg); +SBP_EXPORT s8 sbp_almanac_common_content_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_almanac_common_content_dep_t *msg); /** * Compare two instances of sbp_almanac_common_content_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_almanac_common_content_dep_t instance * @param b sbp_almanac_common_content_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_almanac_common_content_dep_cmp(const sbp_almanac_common_content_dep_t *a, const sbp_almanac_common_content_dep_t *b); +SBP_EXPORT int sbp_almanac_common_content_dep_cmp( + const sbp_almanac_common_content_dep_t *a, + const sbp_almanac_common_content_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_almanac_common_content_dep_t &lhs, const sbp_almanac_common_content_dep_t &rhs) { +static inline bool operator==(const sbp_almanac_common_content_dep_t &lhs, + const sbp_almanac_common_content_dep_t &rhs) { return sbp_almanac_common_content_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_almanac_common_content_dep_t &lhs, const sbp_almanac_common_content_dep_t &rhs) { +static inline bool operator!=(const sbp_almanac_common_content_dep_t &lhs, + const sbp_almanac_common_content_dep_t &rhs) { return sbp_almanac_common_content_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_almanac_common_content_dep_t &lhs, const sbp_almanac_common_content_dep_t &rhs) { +static inline bool operator<(const sbp_almanac_common_content_dep_t &lhs, + const sbp_almanac_common_content_dep_t &rhs) { return sbp_almanac_common_content_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_almanac_common_content_dep_t &lhs, const sbp_almanac_common_content_dep_t &rhs) { +static inline bool operator<=(const sbp_almanac_common_content_dep_t &lhs, + const sbp_almanac_common_content_dep_t &rhs) { return sbp_almanac_common_content_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_almanac_common_content_dep_t &lhs, const sbp_almanac_common_content_dep_t &rhs) { +static inline bool operator>(const sbp_almanac_common_content_dep_t &lhs, + const sbp_almanac_common_content_dep_t &rhs) { return sbp_almanac_common_content_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_almanac_common_content_dep_t &lhs, const sbp_almanac_common_content_dep_t &rhs) { +static inline bool operator>=(const sbp_almanac_common_content_dep_t &lhs, + const sbp_almanac_common_content_dep_t &rhs) { return sbp_almanac_common_content_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_ALMANACCOMMONCONTENTDEP_H */ - diff --git a/c/include/libsbp/observation/CarrierPhaseDepA.h b/c/include/libsbp/observation/CarrierPhaseDepA.h index 61a68e1d6..60d4fd30e 100644 --- a/c/include/libsbp/observation/CarrierPhaseDepA.h +++ b/c/include/libsbp/observation/CarrierPhaseDepA.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_OBSERVATION_CARRIERPHASEDEPA_H #define LIBSBP_OBSERVATION_CARRIERPHASEDEPA_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,33 +40,31 @@ *****************************************************************************/ /** GPS carrier phase measurement * -* Carrier phase measurement in cycles represented as a 40-bit fixed point number with Q32.8 layout, i.e. 32-bits of whole cycles and 8-bits of fractional cycles. This has the opposite sign convention than a typical GPS receiver and the phase has the opposite sign as the pseudorange. + * Carrier phase measurement in cycles represented as a 40-bit fixed point + * number with Q32.8 layout, i.e. 32-bits of whole cycles and 8-bits of + * fractional cycles. This has the opposite sign convention than a typical GPS + * receiver and the phase has the opposite sign as the pseudorange. */ typedef struct { - - /** -* Carrier phase whole cycles [cycles] + * Carrier phase whole cycles [cycles] */ s32 i; - /** -* Carrier phase fractional part [cycles / 256] + * Carrier phase fractional part [cycles / 256] */ u8 f; } sbp_carrier_phase_dep_a_t; - - /** * Get encoded size of an instance of sbp_carrier_phase_dep_a_t * * @param msg sbp_carrier_phase_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_carrier_phase_dep_a_encoded_len(const sbp_carrier_phase_dep_a_t *msg) -{ +static inline size_t sbp_carrier_phase_dep_a_encoded_len( + const sbp_carrier_phase_dep_a_t *msg) { (void)msg; return SBP_CARRIER_PHASE_DEP_A_ENCODED_LEN; } @@ -74,74 +72,96 @@ static inline size_t sbp_carrier_phase_dep_a_encoded_len(const sbp_carrier_phase /** * Encode an instance of sbp_carrier_phase_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_carrier_phase_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_carrier_phase_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_carrier_phase_dep_a_t *msg); +SBP_EXPORT s8 +sbp_carrier_phase_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_carrier_phase_dep_a_t *msg); /** * Decode an instance of sbp_carrier_phase_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_carrier_phase_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_carrier_phase_dep_a_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_carrier_phase_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_carrier_phase_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_carrier_phase_dep_a_t *msg); +SBP_EXPORT s8 sbp_carrier_phase_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_carrier_phase_dep_a_t *msg); /** * Compare two instances of sbp_carrier_phase_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_carrier_phase_dep_a_t instance * @param b sbp_carrier_phase_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_carrier_phase_dep_a_cmp(const sbp_carrier_phase_dep_a_t *a, const sbp_carrier_phase_dep_a_t *b); +SBP_EXPORT int sbp_carrier_phase_dep_a_cmp(const sbp_carrier_phase_dep_a_t *a, + const sbp_carrier_phase_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_carrier_phase_dep_a_t &lhs, const sbp_carrier_phase_dep_a_t &rhs) { +static inline bool operator==(const sbp_carrier_phase_dep_a_t &lhs, + const sbp_carrier_phase_dep_a_t &rhs) { return sbp_carrier_phase_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_carrier_phase_dep_a_t &lhs, const sbp_carrier_phase_dep_a_t &rhs) { +static inline bool operator!=(const sbp_carrier_phase_dep_a_t &lhs, + const sbp_carrier_phase_dep_a_t &rhs) { return sbp_carrier_phase_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_carrier_phase_dep_a_t &lhs, const sbp_carrier_phase_dep_a_t &rhs) { +static inline bool operator<(const sbp_carrier_phase_dep_a_t &lhs, + const sbp_carrier_phase_dep_a_t &rhs) { return sbp_carrier_phase_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_carrier_phase_dep_a_t &lhs, const sbp_carrier_phase_dep_a_t &rhs) { +static inline bool operator<=(const sbp_carrier_phase_dep_a_t &lhs, + const sbp_carrier_phase_dep_a_t &rhs) { return sbp_carrier_phase_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_carrier_phase_dep_a_t &lhs, const sbp_carrier_phase_dep_a_t &rhs) { +static inline bool operator>(const sbp_carrier_phase_dep_a_t &lhs, + const sbp_carrier_phase_dep_a_t &rhs) { return sbp_carrier_phase_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_carrier_phase_dep_a_t &lhs, const sbp_carrier_phase_dep_a_t &rhs) { +static inline bool operator>=(const sbp_carrier_phase_dep_a_t &lhs, + const sbp_carrier_phase_dep_a_t &rhs) { return sbp_carrier_phase_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_CARRIERPHASEDEPA_H */ - diff --git a/c/include/libsbp/observation/Doppler.h b/c/include/libsbp/observation/Doppler.h index ca938d9d7..74442755f 100644 --- a/c/include/libsbp/observation/Doppler.h +++ b/c/include/libsbp/observation/Doppler.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_OBSERVATION_DOPPLER_H #define LIBSBP_OBSERVATION_DOPPLER_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,33 +40,29 @@ *****************************************************************************/ /** GNSS doppler measurement * -* Doppler measurement in Hz represented as a 24-bit fixed point number with Q16.8 layout, i.e. 16-bits of whole doppler and 8-bits of fractional doppler. This doppler is defined as positive for approaching satellites. + * Doppler measurement in Hz represented as a 24-bit fixed point number with + * Q16.8 layout, i.e. 16-bits of whole doppler and 8-bits of fractional doppler. + * This doppler is defined as positive for approaching satellites. */ typedef struct { - - /** -* Doppler whole Hz [Hz] + * Doppler whole Hz [Hz] */ s16 i; - /** -* Doppler fractional part [Hz / 256] + * Doppler fractional part [Hz / 256] */ u8 f; } sbp_doppler_t; - - /** * Get encoded size of an instance of sbp_doppler_t * * @param msg sbp_doppler_t instance * @return Length of on-wire representation */ -static inline size_t sbp_doppler_encoded_len(const sbp_doppler_t *msg) -{ +static inline size_t sbp_doppler_encoded_len(const sbp_doppler_t *msg) { (void)msg; return SBP_DOPPLER_ENCODED_LEN; } @@ -74,39 +70,53 @@ static inline size_t sbp_doppler_encoded_len(const sbp_doppler_t *msg) /** * Encode an instance of sbp_doppler_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_doppler_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_doppler_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_doppler_t *msg); +SBP_EXPORT s8 sbp_doppler_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_doppler_t *msg); /** * Decode an instance of sbp_doppler_t from wire representation * - * This function decodes the wire representation of a sbp_doppler_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_doppler_t message to + * the given instance. The caller must specify the length of the buffer in the + * \p len parameter. If non-null the number of bytes read from the buffer will + * be returned in \p n_read. * * @param buf Wire representation of the sbp_doppler_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_doppler_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_doppler_t *msg); +SBP_EXPORT s8 sbp_doppler_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_doppler_t *msg); /** * Compare two instances of sbp_doppler_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_doppler_t instance * @param b sbp_doppler_t instance @@ -115,33 +125,38 @@ SBP_EXPORT s8 sbp_doppler_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea SBP_EXPORT int sbp_doppler_cmp(const sbp_doppler_t *a, const sbp_doppler_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_doppler_t &lhs, const sbp_doppler_t &rhs) { +static inline bool operator==(const sbp_doppler_t &lhs, + const sbp_doppler_t &rhs) { return sbp_doppler_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_doppler_t &lhs, const sbp_doppler_t &rhs) { +static inline bool operator!=(const sbp_doppler_t &lhs, + const sbp_doppler_t &rhs) { return sbp_doppler_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_doppler_t &lhs, const sbp_doppler_t &rhs) { +static inline bool operator<(const sbp_doppler_t &lhs, + const sbp_doppler_t &rhs) { return sbp_doppler_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_doppler_t &lhs, const sbp_doppler_t &rhs) { +static inline bool operator<=(const sbp_doppler_t &lhs, + const sbp_doppler_t &rhs) { return sbp_doppler_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_doppler_t &lhs, const sbp_doppler_t &rhs) { +static inline bool operator>(const sbp_doppler_t &lhs, + const sbp_doppler_t &rhs) { return sbp_doppler_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_doppler_t &lhs, const sbp_doppler_t &rhs) { +static inline bool operator>=(const sbp_doppler_t &lhs, + const sbp_doppler_t &rhs) { return sbp_doppler_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_DOPPLER_H */ - diff --git a/c/include/libsbp/observation/EphemerisCommonContent.h b/c/include/libsbp/observation/EphemerisCommonContent.h index ddd24bd9f..7cda16e4a 100644 --- a/c/include/libsbp/observation/EphemerisCommonContent.h +++ b/c/include/libsbp/observation/EphemerisCommonContent.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_EPHEMERISCOMMONCONTENT_H #define LIBSBP_OBSERVATION_EPHEMERISCOMMONCONTENT_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,57 +41,48 @@ * *****************************************************************************/ typedef struct { - - /** -* GNSS signal identifier (16 bit) + * GNSS signal identifier (16 bit) */ sbp_v4_gnss_signal_t sid; - /** -* Time of Ephemerides + * Time of Ephemerides */ sbp_gps_time_sec_t toe; - /** -* User Range Accuracy [m] + * User Range Accuracy [m] */ float ura; - /** -* Curve fit interval [s] + * Curve fit interval [s] */ u32 fit_interval; - /** -* Status of ephemeris, 1 = valid, 0 = invalid + * Status of ephemeris, 1 = valid, 0 = invalid */ u8 valid; - /** - * Satellite health status. - * GPS: ICD-GPS-200, chapter 20.3.3.3.1.4 - * SBAS: 0 = valid, non-zero = invalid - * GLO: 0 = valid, non-zero = invalid + * Satellite health status. + * GPS: ICD-GPS-200, chapter 20.3.3.3.1.4 + * SBAS: 0 = valid, non-zero = invalid + * GLO: 0 = valid, non-zero = invalid */ u8 health_bits; } sbp_ephemeris_common_content_t; - - /** * Get encoded size of an instance of sbp_ephemeris_common_content_t * * @param msg sbp_ephemeris_common_content_t instance * @return Length of on-wire representation */ -static inline size_t sbp_ephemeris_common_content_encoded_len(const sbp_ephemeris_common_content_t *msg) -{ +static inline size_t sbp_ephemeris_common_content_encoded_len( + const sbp_ephemeris_common_content_t *msg) { (void)msg; return SBP_EPHEMERIS_COMMON_CONTENT_ENCODED_LEN; } @@ -99,74 +90,97 @@ static inline size_t sbp_ephemeris_common_content_encoded_len(const sbp_ephemeri /** * Encode an instance of sbp_ephemeris_common_content_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_ephemeris_common_content_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_ephemeris_common_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_ephemeris_common_content_t *msg); +SBP_EXPORT s8 sbp_ephemeris_common_content_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_ephemeris_common_content_t *msg); /** * Decode an instance of sbp_ephemeris_common_content_t from wire representation * - * This function decodes the wire representation of a sbp_ephemeris_common_content_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_ephemeris_common_content_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_ephemeris_common_content_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_ephemeris_common_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ephemeris_common_content_t *msg); +SBP_EXPORT s8 sbp_ephemeris_common_content_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_ephemeris_common_content_t *msg); /** * Compare two instances of sbp_ephemeris_common_content_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_ephemeris_common_content_t instance * @param b sbp_ephemeris_common_content_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_ephemeris_common_content_cmp(const sbp_ephemeris_common_content_t *a, const sbp_ephemeris_common_content_t *b); +SBP_EXPORT int sbp_ephemeris_common_content_cmp( + const sbp_ephemeris_common_content_t *a, + const sbp_ephemeris_common_content_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_ephemeris_common_content_t &lhs, const sbp_ephemeris_common_content_t &rhs) { +static inline bool operator==(const sbp_ephemeris_common_content_t &lhs, + const sbp_ephemeris_common_content_t &rhs) { return sbp_ephemeris_common_content_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_ephemeris_common_content_t &lhs, const sbp_ephemeris_common_content_t &rhs) { +static inline bool operator!=(const sbp_ephemeris_common_content_t &lhs, + const sbp_ephemeris_common_content_t &rhs) { return sbp_ephemeris_common_content_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_ephemeris_common_content_t &lhs, const sbp_ephemeris_common_content_t &rhs) { +static inline bool operator<(const sbp_ephemeris_common_content_t &lhs, + const sbp_ephemeris_common_content_t &rhs) { return sbp_ephemeris_common_content_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_ephemeris_common_content_t &lhs, const sbp_ephemeris_common_content_t &rhs) { +static inline bool operator<=(const sbp_ephemeris_common_content_t &lhs, + const sbp_ephemeris_common_content_t &rhs) { return sbp_ephemeris_common_content_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_ephemeris_common_content_t &lhs, const sbp_ephemeris_common_content_t &rhs) { +static inline bool operator>(const sbp_ephemeris_common_content_t &lhs, + const sbp_ephemeris_common_content_t &rhs) { return sbp_ephemeris_common_content_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_ephemeris_common_content_t &lhs, const sbp_ephemeris_common_content_t &rhs) { +static inline bool operator>=(const sbp_ephemeris_common_content_t &lhs, + const sbp_ephemeris_common_content_t &rhs) { return sbp_ephemeris_common_content_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_EPHEMERISCOMMONCONTENT_H */ - diff --git a/c/include/libsbp/observation/EphemerisCommonContentDepA.h b/c/include/libsbp/observation/EphemerisCommonContentDepA.h index 9d14dc6ad..1ed094135 100644 --- a/c/include/libsbp/observation/EphemerisCommonContentDepA.h +++ b/c/include/libsbp/observation/EphemerisCommonContentDepA.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_EPHEMERISCOMMONCONTENTDEPA_H #define LIBSBP_OBSERVATION_EPHEMERISCOMMONCONTENTDEPA_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,132 +41,150 @@ * *****************************************************************************/ typedef struct { - - /** -* GNSS signal identifier + * GNSS signal identifier */ sbp_gnss_signal_dep_t sid; - /** -* Time of Ephemerides + * Time of Ephemerides */ sbp_gps_time_dep_t toe; - /** -* User Range Accuracy [m] + * User Range Accuracy [m] */ double ura; - /** -* Curve fit interval [s] + * Curve fit interval [s] */ u32 fit_interval; - /** -* Status of ephemeris, 1 = valid, 0 = invalid + * Status of ephemeris, 1 = valid, 0 = invalid */ u8 valid; - /** - * Satellite health status. - * GPS: ICD-GPS-200, chapter 20.3.3.3.1.4 - * SBAS: 0 = valid, non-zero = invalid - * GLO: 0 = valid, non-zero = invalid + * Satellite health status. + * GPS: ICD-GPS-200, chapter 20.3.3.3.1.4 + * SBAS: 0 = valid, non-zero = invalid + * GLO: 0 = valid, non-zero = invalid */ u8 health_bits; } sbp_ephemeris_common_content_dep_a_t; - - /** * Get encoded size of an instance of sbp_ephemeris_common_content_dep_a_t * * @param msg sbp_ephemeris_common_content_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_ephemeris_common_content_dep_a_encoded_len(const sbp_ephemeris_common_content_dep_a_t *msg) -{ +static inline size_t sbp_ephemeris_common_content_dep_a_encoded_len( + const sbp_ephemeris_common_content_dep_a_t *msg) { (void)msg; return SBP_EPHEMERIS_COMMON_CONTENT_DEP_A_ENCODED_LEN; } /** - * Encode an instance of sbp_ephemeris_common_content_dep_a_t to wire representation + * Encode an instance of sbp_ephemeris_common_content_dep_a_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_ephemeris_common_content_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_ephemeris_common_content_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_ephemeris_common_content_dep_a_t *msg); +SBP_EXPORT s8 sbp_ephemeris_common_content_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_ephemeris_common_content_dep_a_t *msg); /** - * Decode an instance of sbp_ephemeris_common_content_dep_a_t from wire representation + * Decode an instance of sbp_ephemeris_common_content_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_ephemeris_common_content_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_ephemeris_common_content_dep_a_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_ephemeris_common_content_dep_a_t instance + * @param buf Wire representation of the sbp_ephemeris_common_content_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_ephemeris_common_content_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ephemeris_common_content_dep_a_t *msg); +SBP_EXPORT s8 sbp_ephemeris_common_content_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_ephemeris_common_content_dep_a_t *msg); /** * Compare two instances of sbp_ephemeris_common_content_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_ephemeris_common_content_dep_a_t instance * @param b sbp_ephemeris_common_content_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_ephemeris_common_content_dep_a_cmp(const sbp_ephemeris_common_content_dep_a_t *a, const sbp_ephemeris_common_content_dep_a_t *b); +SBP_EXPORT int sbp_ephemeris_common_content_dep_a_cmp( + const sbp_ephemeris_common_content_dep_a_t *a, + const sbp_ephemeris_common_content_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_ephemeris_common_content_dep_a_t &lhs, const sbp_ephemeris_common_content_dep_a_t &rhs) { +static inline bool operator==(const sbp_ephemeris_common_content_dep_a_t &lhs, + const sbp_ephemeris_common_content_dep_a_t &rhs) { return sbp_ephemeris_common_content_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_ephemeris_common_content_dep_a_t &lhs, const sbp_ephemeris_common_content_dep_a_t &rhs) { +static inline bool operator!=(const sbp_ephemeris_common_content_dep_a_t &lhs, + const sbp_ephemeris_common_content_dep_a_t &rhs) { return sbp_ephemeris_common_content_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_ephemeris_common_content_dep_a_t &lhs, const sbp_ephemeris_common_content_dep_a_t &rhs) { +static inline bool operator<(const sbp_ephemeris_common_content_dep_a_t &lhs, + const sbp_ephemeris_common_content_dep_a_t &rhs) { return sbp_ephemeris_common_content_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_ephemeris_common_content_dep_a_t &lhs, const sbp_ephemeris_common_content_dep_a_t &rhs) { +static inline bool operator<=(const sbp_ephemeris_common_content_dep_a_t &lhs, + const sbp_ephemeris_common_content_dep_a_t &rhs) { return sbp_ephemeris_common_content_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_ephemeris_common_content_dep_a_t &lhs, const sbp_ephemeris_common_content_dep_a_t &rhs) { +static inline bool operator>(const sbp_ephemeris_common_content_dep_a_t &lhs, + const sbp_ephemeris_common_content_dep_a_t &rhs) { return sbp_ephemeris_common_content_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_ephemeris_common_content_dep_a_t &lhs, const sbp_ephemeris_common_content_dep_a_t &rhs) { +static inline bool operator>=(const sbp_ephemeris_common_content_dep_a_t &lhs, + const sbp_ephemeris_common_content_dep_a_t &rhs) { return sbp_ephemeris_common_content_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_EPHEMERISCOMMONCONTENTDEPA_H */ - diff --git a/c/include/libsbp/observation/EphemerisCommonContentDepB.h b/c/include/libsbp/observation/EphemerisCommonContentDepB.h index 5ffd4c55b..007e94364 100644 --- a/c/include/libsbp/observation/EphemerisCommonContentDepB.h +++ b/c/include/libsbp/observation/EphemerisCommonContentDepB.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_EPHEMERISCOMMONCONTENTDEPB_H #define LIBSBP_OBSERVATION_EPHEMERISCOMMONCONTENTDEPB_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,131 +41,149 @@ * *****************************************************************************/ typedef struct { - - /** -* GNSS signal identifier (16 bit) + * GNSS signal identifier (16 bit) */ sbp_v4_gnss_signal_t sid; - /** -* Time of Ephemerides + * Time of Ephemerides */ sbp_gps_time_sec_t toe; - /** -* User Range Accuracy [m] + * User Range Accuracy [m] */ double ura; - /** -* Curve fit interval [s] + * Curve fit interval [s] */ u32 fit_interval; - /** -* Status of ephemeris, 1 = valid, 0 = invalid + * Status of ephemeris, 1 = valid, 0 = invalid */ u8 valid; - /** - * Satellite health status. - * GPS: ICD-GPS-200, chapter 20.3.3.3.1.4 - * Others: 0 = valid, non-zero = invalid + * Satellite health status. + * GPS: ICD-GPS-200, chapter 20.3.3.3.1.4 + * Others: 0 = valid, non-zero = invalid */ u8 health_bits; } sbp_ephemeris_common_content_dep_b_t; - - /** * Get encoded size of an instance of sbp_ephemeris_common_content_dep_b_t * * @param msg sbp_ephemeris_common_content_dep_b_t instance * @return Length of on-wire representation */ -static inline size_t sbp_ephemeris_common_content_dep_b_encoded_len(const sbp_ephemeris_common_content_dep_b_t *msg) -{ +static inline size_t sbp_ephemeris_common_content_dep_b_encoded_len( + const sbp_ephemeris_common_content_dep_b_t *msg) { (void)msg; return SBP_EPHEMERIS_COMMON_CONTENT_DEP_B_ENCODED_LEN; } /** - * Encode an instance of sbp_ephemeris_common_content_dep_b_t to wire representation + * Encode an instance of sbp_ephemeris_common_content_dep_b_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_ephemeris_common_content_dep_b_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_ephemeris_common_content_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_ephemeris_common_content_dep_b_t *msg); +SBP_EXPORT s8 sbp_ephemeris_common_content_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_ephemeris_common_content_dep_b_t *msg); /** - * Decode an instance of sbp_ephemeris_common_content_dep_b_t from wire representation + * Decode an instance of sbp_ephemeris_common_content_dep_b_t from wire + * representation * - * This function decodes the wire representation of a sbp_ephemeris_common_content_dep_b_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_ephemeris_common_content_dep_b_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_ephemeris_common_content_dep_b_t instance + * @param buf Wire representation of the sbp_ephemeris_common_content_dep_b_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_ephemeris_common_content_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ephemeris_common_content_dep_b_t *msg); +SBP_EXPORT s8 sbp_ephemeris_common_content_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_ephemeris_common_content_dep_b_t *msg); /** * Compare two instances of sbp_ephemeris_common_content_dep_b_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_ephemeris_common_content_dep_b_t instance * @param b sbp_ephemeris_common_content_dep_b_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_ephemeris_common_content_dep_b_cmp(const sbp_ephemeris_common_content_dep_b_t *a, const sbp_ephemeris_common_content_dep_b_t *b); +SBP_EXPORT int sbp_ephemeris_common_content_dep_b_cmp( + const sbp_ephemeris_common_content_dep_b_t *a, + const sbp_ephemeris_common_content_dep_b_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_ephemeris_common_content_dep_b_t &lhs, const sbp_ephemeris_common_content_dep_b_t &rhs) { +static inline bool operator==(const sbp_ephemeris_common_content_dep_b_t &lhs, + const sbp_ephemeris_common_content_dep_b_t &rhs) { return sbp_ephemeris_common_content_dep_b_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_ephemeris_common_content_dep_b_t &lhs, const sbp_ephemeris_common_content_dep_b_t &rhs) { +static inline bool operator!=(const sbp_ephemeris_common_content_dep_b_t &lhs, + const sbp_ephemeris_common_content_dep_b_t &rhs) { return sbp_ephemeris_common_content_dep_b_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_ephemeris_common_content_dep_b_t &lhs, const sbp_ephemeris_common_content_dep_b_t &rhs) { +static inline bool operator<(const sbp_ephemeris_common_content_dep_b_t &lhs, + const sbp_ephemeris_common_content_dep_b_t &rhs) { return sbp_ephemeris_common_content_dep_b_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_ephemeris_common_content_dep_b_t &lhs, const sbp_ephemeris_common_content_dep_b_t &rhs) { +static inline bool operator<=(const sbp_ephemeris_common_content_dep_b_t &lhs, + const sbp_ephemeris_common_content_dep_b_t &rhs) { return sbp_ephemeris_common_content_dep_b_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_ephemeris_common_content_dep_b_t &lhs, const sbp_ephemeris_common_content_dep_b_t &rhs) { +static inline bool operator>(const sbp_ephemeris_common_content_dep_b_t &lhs, + const sbp_ephemeris_common_content_dep_b_t &rhs) { return sbp_ephemeris_common_content_dep_b_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_ephemeris_common_content_dep_b_t &lhs, const sbp_ephemeris_common_content_dep_b_t &rhs) { +static inline bool operator>=(const sbp_ephemeris_common_content_dep_b_t &lhs, + const sbp_ephemeris_common_content_dep_b_t &rhs) { return sbp_ephemeris_common_content_dep_b_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_EPHEMERISCOMMONCONTENTDEPB_H */ - diff --git a/c/include/libsbp/observation/GnssCapb.h b/c/include/libsbp/observation/GnssCapb.h index 98dbc7a30..0870fff5e 100644 --- a/c/include/libsbp/observation/GnssCapb.h +++ b/c/include/libsbp/observation/GnssCapb.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_OBSERVATION_GNSSCAPB_H #define LIBSBP_OBSERVATION_GNSSCAPB_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -39,108 +39,91 @@ * *****************************************************************************/ typedef struct { - - /** -* GPS SV active mask + * GPS SV active mask */ u64 gps_active; - /** -* GPS L2C active mask + * GPS L2C active mask */ u64 gps_l2c; - /** -* GPS L5 active mask + * GPS L5 active mask */ u64 gps_l5; - /** -* GLO active mask + * GLO active mask */ u32 glo_active; - /** -* GLO L2OF active mask + * GLO L2OF active mask */ u32 glo_l2of; - /** -* GLO L3 active mask + * GLO L3 active mask */ u32 glo_l3; - /** - * SBAS active mask (PRNs 120..158, AN 7/62.2.2-18/18 Table B-23, https://www.caat.or.th/wp-content/uploads/2018/03/SL-2018.18.E-1.pdf) + * SBAS active mask (PRNs 120..158, AN 7/62.2.2-18/18 Table B-23, + * https://www.caat.or.th/wp-content/uploads/2018/03/SL-2018.18.E-1.pdf) */ u64 sbas_active; - /** - * SBAS L5 active mask (PRNs 120..158, AN 7/62.2.2-18/18 Table B-23, https://www.caat.or.th/wp-content/uploads/2018/03/SL-2018.18.E-1.pdf) + * SBAS L5 active mask (PRNs 120..158, AN 7/62.2.2-18/18 Table B-23, + * https://www.caat.or.th/wp-content/uploads/2018/03/SL-2018.18.E-1.pdf) */ u64 sbas_l5; - /** -* BDS active mask + * BDS active mask */ u64 bds_active; - /** -* BDS D2NAV active mask + * BDS D2NAV active mask */ u64 bds_d2nav; - /** -* BDS B2 active mask + * BDS B2 active mask */ u64 bds_b2; - /** -* BDS B2A active mask + * BDS B2A active mask */ u64 bds_b2a; - /** -* QZSS active mask + * QZSS active mask */ u32 qzss_active; - /** -* GAL active mask + * GAL active mask */ u64 gal_active; - /** -* GAL E5 active mask + * GAL E5 active mask */ u64 gal_e5; } sbp_gnss_capb_t; - - /** * Get encoded size of an instance of sbp_gnss_capb_t * * @param msg sbp_gnss_capb_t instance * @return Length of on-wire representation */ -static inline size_t sbp_gnss_capb_encoded_len(const sbp_gnss_capb_t *msg) -{ +static inline size_t sbp_gnss_capb_encoded_len(const sbp_gnss_capb_t *msg) { (void)msg; return SBP_GNSS_CAPB_ENCODED_LEN; } @@ -148,74 +131,95 @@ static inline size_t sbp_gnss_capb_encoded_len(const sbp_gnss_capb_t *msg) /** * Encode an instance of sbp_gnss_capb_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_gnss_capb_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_gnss_capb_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_gnss_capb_t *msg); +SBP_EXPORT s8 sbp_gnss_capb_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_gnss_capb_t *msg); /** * Decode an instance of sbp_gnss_capb_t from wire representation * - * This function decodes the wire representation of a sbp_gnss_capb_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_gnss_capb_t message to + * the given instance. The caller must specify the length of the buffer in the + * \p len parameter. If non-null the number of bytes read from the buffer will + * be returned in \p n_read. * * @param buf Wire representation of the sbp_gnss_capb_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_gnss_capb_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_gnss_capb_t *msg); +SBP_EXPORT s8 sbp_gnss_capb_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_gnss_capb_t *msg); /** * Compare two instances of sbp_gnss_capb_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_gnss_capb_t instance * @param b sbp_gnss_capb_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_gnss_capb_cmp(const sbp_gnss_capb_t *a, const sbp_gnss_capb_t *b); +SBP_EXPORT int sbp_gnss_capb_cmp(const sbp_gnss_capb_t *a, + const sbp_gnss_capb_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_gnss_capb_t &lhs, const sbp_gnss_capb_t &rhs) { +static inline bool operator==(const sbp_gnss_capb_t &lhs, + const sbp_gnss_capb_t &rhs) { return sbp_gnss_capb_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_gnss_capb_t &lhs, const sbp_gnss_capb_t &rhs) { +static inline bool operator!=(const sbp_gnss_capb_t &lhs, + const sbp_gnss_capb_t &rhs) { return sbp_gnss_capb_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_gnss_capb_t &lhs, const sbp_gnss_capb_t &rhs) { +static inline bool operator<(const sbp_gnss_capb_t &lhs, + const sbp_gnss_capb_t &rhs) { return sbp_gnss_capb_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_gnss_capb_t &lhs, const sbp_gnss_capb_t &rhs) { +static inline bool operator<=(const sbp_gnss_capb_t &lhs, + const sbp_gnss_capb_t &rhs) { return sbp_gnss_capb_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_gnss_capb_t &lhs, const sbp_gnss_capb_t &rhs) { +static inline bool operator>(const sbp_gnss_capb_t &lhs, + const sbp_gnss_capb_t &rhs) { return sbp_gnss_capb_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_gnss_capb_t &lhs, const sbp_gnss_capb_t &rhs) { +static inline bool operator>=(const sbp_gnss_capb_t &lhs, + const sbp_gnss_capb_t &rhs) { return sbp_gnss_capb_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_GNSSCAPB_H */ - diff --git a/c/include/libsbp/observation/MSG_ALMANAC_GLO.h b/c/include/libsbp/observation/MSG_ALMANAC_GLO.h index 0b0f598e3..bfa67d8ca 100644 --- a/c/include/libsbp/observation/MSG_ALMANAC_GLO.h +++ b/c/include/libsbp/observation/MSG_ALMANAC_GLO.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_ALMANAC_GLO_H #define LIBSBP_OBSERVATION_MSG_ALMANAC_GLO_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,69 +41,62 @@ *****************************************************************************/ /** Satellite broadcast almanac for GLO * -* The almanac message returns a set of satellite orbit parameters. Almanac data is not very precise and is considered valid for up to several months. Please see the GLO ICD 5.1 "Chapter 4.5 Non-immediate information and almanac" for details. + * The almanac message returns a set of satellite orbit parameters. Almanac data + * is not very precise and is considered valid for up to several months. Please + * see the GLO ICD 5.1 "Chapter 4.5 Non-immediate information and almanac" for + * details. */ typedef struct { - - /** -* Values common for all almanac types + * Values common for all almanac types */ sbp_almanac_common_content_t common; - /** - * Longitude of the first ascending node of the orbit in PZ-90.02 coordinate system [rad] + * Longitude of the first ascending node of the orbit in PZ-90.02 coordinate + * system [rad] */ double lambda_na; - /** -* Time of the first ascending node passage [s] + * Time of the first ascending node passage [s] */ double t_lambda_na; - /** -* Value of inclination at instant of t_lambda [rad] + * Value of inclination at instant of t_lambda [rad] */ double i; - /** -* Value of Draconian period at instant of t_lambda [s/orbital period] + * Value of Draconian period at instant of t_lambda [s/orbital period] */ double t; - /** -* Rate of change of the Draconian period [s/(orbital period^2)] + * Rate of change of the Draconian period [s/(orbital period^2)] */ double t_dot; - /** -* Eccentricity at instant of t_lambda + * Eccentricity at instant of t_lambda */ double epsilon; - /** -* Argument of perigee at instant of t_lambda [rad] + * Argument of perigee at instant of t_lambda [rad] */ double omega; } sbp_msg_almanac_glo_t; - - /** * Get encoded size of an instance of sbp_msg_almanac_glo_t * * @param msg sbp_msg_almanac_glo_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_almanac_glo_encoded_len(const sbp_msg_almanac_glo_t *msg) -{ +static inline size_t sbp_msg_almanac_glo_encoded_len( + const sbp_msg_almanac_glo_t *msg) { (void)msg; return SBP_MSG_ALMANAC_GLO_ENCODED_LEN; } @@ -111,36 +104,53 @@ static inline size_t sbp_msg_almanac_glo_encoded_len(const sbp_msg_almanac_glo_t /** * Encode an instance of sbp_msg_almanac_glo_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_almanac_glo_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_almanac_glo_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_almanac_glo_t *msg); +SBP_EXPORT s8 sbp_msg_almanac_glo_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_almanac_glo_t *msg); /** * Decode an instance of sbp_msg_almanac_glo_t from wire representation * - * This function decodes the wire representation of a sbp_msg_almanac_glo_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_almanac_glo_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_almanac_glo_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_almanac_glo_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_almanac_glo_t *msg); +SBP_EXPORT s8 sbp_msg_almanac_glo_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_almanac_glo_t *msg); /** * Send an instance of sbp_msg_almanac_glo_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_almanac_glo_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_almanac_glo_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -148,51 +158,61 @@ SBP_EXPORT s8 sbp_msg_almanac_glo_decode(const uint8_t *buf, uint8_t len, uint8_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_almanac_glo_send(sbp_state_t *s, u16 sender_id, const sbp_msg_almanac_glo_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_almanac_glo_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_almanac_glo_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_almanac_glo_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_almanac_glo_t instance * @param b sbp_msg_almanac_glo_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_almanac_glo_cmp(const sbp_msg_almanac_glo_t *a, const sbp_msg_almanac_glo_t *b); +SBP_EXPORT int sbp_msg_almanac_glo_cmp(const sbp_msg_almanac_glo_t *a, + const sbp_msg_almanac_glo_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_almanac_glo_t &lhs, const sbp_msg_almanac_glo_t &rhs) { +static inline bool operator==(const sbp_msg_almanac_glo_t &lhs, + const sbp_msg_almanac_glo_t &rhs) { return sbp_msg_almanac_glo_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_almanac_glo_t &lhs, const sbp_msg_almanac_glo_t &rhs) { +static inline bool operator!=(const sbp_msg_almanac_glo_t &lhs, + const sbp_msg_almanac_glo_t &rhs) { return sbp_msg_almanac_glo_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_almanac_glo_t &lhs, const sbp_msg_almanac_glo_t &rhs) { +static inline bool operator<(const sbp_msg_almanac_glo_t &lhs, + const sbp_msg_almanac_glo_t &rhs) { return sbp_msg_almanac_glo_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_almanac_glo_t &lhs, const sbp_msg_almanac_glo_t &rhs) { +static inline bool operator<=(const sbp_msg_almanac_glo_t &lhs, + const sbp_msg_almanac_glo_t &rhs) { return sbp_msg_almanac_glo_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_almanac_glo_t &lhs, const sbp_msg_almanac_glo_t &rhs) { +static inline bool operator>(const sbp_msg_almanac_glo_t &lhs, + const sbp_msg_almanac_glo_t &rhs) { return sbp_msg_almanac_glo_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_almanac_glo_t &lhs, const sbp_msg_almanac_glo_t &rhs) { +static inline bool operator>=(const sbp_msg_almanac_glo_t &lhs, + const sbp_msg_almanac_glo_t &rhs) { return sbp_msg_almanac_glo_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_ALMANAC_GLO_H */ - diff --git a/c/include/libsbp/observation/MSG_ALMANAC_GLO_DEP.h b/c/include/libsbp/observation/MSG_ALMANAC_GLO_DEP.h index 8f5945d1c..4d9aa9122 100644 --- a/c/include/libsbp/observation/MSG_ALMANAC_GLO_DEP.h +++ b/c/include/libsbp/observation/MSG_ALMANAC_GLO_DEP.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_ALMANAC_GLO_DEP_H #define LIBSBP_OBSERVATION_MSG_ALMANAC_GLO_DEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,69 +41,59 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Values common for all almanac types + * Values common for all almanac types */ sbp_almanac_common_content_dep_t common; - /** - * Longitude of the first ascending node of the orbit in PZ-90.02 coordinate system [rad] + * Longitude of the first ascending node of the orbit in PZ-90.02 coordinate + * system [rad] */ double lambda_na; - /** -* Time of the first ascending node passage [s] + * Time of the first ascending node passage [s] */ double t_lambda_na; - /** -* Value of inclination at instant of t_lambda [rad] + * Value of inclination at instant of t_lambda [rad] */ double i; - /** -* Value of Draconian period at instant of t_lambda [s/orbital period] + * Value of Draconian period at instant of t_lambda [s/orbital period] */ double t; - /** -* Rate of change of the Draconian period [s/(orbital period^2)] + * Rate of change of the Draconian period [s/(orbital period^2)] */ double t_dot; - /** -* Eccentricity at instant of t_lambda + * Eccentricity at instant of t_lambda */ double epsilon; - /** -* Argument of perigee at instant of t_lambda [rad] + * Argument of perigee at instant of t_lambda [rad] */ double omega; } sbp_msg_almanac_glo_dep_t; - - /** * Get encoded size of an instance of sbp_msg_almanac_glo_dep_t * * @param msg sbp_msg_almanac_glo_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_almanac_glo_dep_encoded_len(const sbp_msg_almanac_glo_dep_t *msg) -{ +static inline size_t sbp_msg_almanac_glo_dep_encoded_len( + const sbp_msg_almanac_glo_dep_t *msg) { (void)msg; return SBP_MSG_ALMANAC_GLO_DEP_ENCODED_LEN; } @@ -111,36 +101,53 @@ static inline size_t sbp_msg_almanac_glo_dep_encoded_len(const sbp_msg_almanac_g /** * Encode an instance of sbp_msg_almanac_glo_dep_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_almanac_glo_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_almanac_glo_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_almanac_glo_dep_t *msg); +SBP_EXPORT s8 +sbp_msg_almanac_glo_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_almanac_glo_dep_t *msg); /** * Decode an instance of sbp_msg_almanac_glo_dep_t from wire representation * - * This function decodes the wire representation of a sbp_msg_almanac_glo_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_almanac_glo_dep_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_almanac_glo_dep_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_almanac_glo_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_almanac_glo_dep_t *msg); +SBP_EXPORT s8 sbp_msg_almanac_glo_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_almanac_glo_dep_t *msg); /** * Send an instance of sbp_msg_almanac_glo_dep_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_almanac_glo_dep_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_almanac_glo_dep_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -148,51 +155,61 @@ SBP_EXPORT s8 sbp_msg_almanac_glo_dep_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_almanac_glo_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_almanac_glo_dep_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_almanac_glo_dep_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_almanac_glo_dep_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_almanac_glo_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_almanac_glo_dep_t instance * @param b sbp_msg_almanac_glo_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_almanac_glo_dep_cmp(const sbp_msg_almanac_glo_dep_t *a, const sbp_msg_almanac_glo_dep_t *b); +SBP_EXPORT int sbp_msg_almanac_glo_dep_cmp(const sbp_msg_almanac_glo_dep_t *a, + const sbp_msg_almanac_glo_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_almanac_glo_dep_t &lhs, const sbp_msg_almanac_glo_dep_t &rhs) { +static inline bool operator==(const sbp_msg_almanac_glo_dep_t &lhs, + const sbp_msg_almanac_glo_dep_t &rhs) { return sbp_msg_almanac_glo_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_almanac_glo_dep_t &lhs, const sbp_msg_almanac_glo_dep_t &rhs) { +static inline bool operator!=(const sbp_msg_almanac_glo_dep_t &lhs, + const sbp_msg_almanac_glo_dep_t &rhs) { return sbp_msg_almanac_glo_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_almanac_glo_dep_t &lhs, const sbp_msg_almanac_glo_dep_t &rhs) { +static inline bool operator<(const sbp_msg_almanac_glo_dep_t &lhs, + const sbp_msg_almanac_glo_dep_t &rhs) { return sbp_msg_almanac_glo_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_almanac_glo_dep_t &lhs, const sbp_msg_almanac_glo_dep_t &rhs) { +static inline bool operator<=(const sbp_msg_almanac_glo_dep_t &lhs, + const sbp_msg_almanac_glo_dep_t &rhs) { return sbp_msg_almanac_glo_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_almanac_glo_dep_t &lhs, const sbp_msg_almanac_glo_dep_t &rhs) { +static inline bool operator>(const sbp_msg_almanac_glo_dep_t &lhs, + const sbp_msg_almanac_glo_dep_t &rhs) { return sbp_msg_almanac_glo_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_almanac_glo_dep_t &lhs, const sbp_msg_almanac_glo_dep_t &rhs) { +static inline bool operator>=(const sbp_msg_almanac_glo_dep_t &lhs, + const sbp_msg_almanac_glo_dep_t &rhs) { return sbp_msg_almanac_glo_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_ALMANAC_GLO_DEP_H */ - diff --git a/c/include/libsbp/observation/MSG_ALMANAC_GPS.h b/c/include/libsbp/observation/MSG_ALMANAC_GPS.h index 55fe84b2a..415e8e82a 100644 --- a/c/include/libsbp/observation/MSG_ALMANAC_GPS.h +++ b/c/include/libsbp/observation/MSG_ALMANAC_GPS.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_ALMANAC_GPS_H #define LIBSBP_OBSERVATION_MSG_ALMANAC_GPS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,81 +41,71 @@ *****************************************************************************/ /** Satellite broadcast almanac for GPS * -* The almanac message returns a set of satellite orbit parameters. Almanac data is not very precise and is considered valid for up to several months. Please see the Navstar GPS Space Segment/Navigation user interfaces (ICD-GPS-200, Chapter 20.3.3.5.1.2 Almanac Data) for more details. + * The almanac message returns a set of satellite orbit parameters. Almanac data + * is not very precise and is considered valid for up to several months. Please + * see the Navstar GPS Space Segment/Navigation user interfaces (ICD-GPS-200, + * Chapter 20.3.3.5.1.2 Almanac Data) for more details. */ typedef struct { - - /** -* Values common for all almanac types + * Values common for all almanac types */ sbp_almanac_common_content_t common; - /** -* Mean anomaly at reference time [rad] + * Mean anomaly at reference time [rad] */ double m0; - /** -* Eccentricity of satellite orbit + * Eccentricity of satellite orbit */ double ecc; - /** -* Square root of the semi-major axis of orbit [m^(1/2)] + * Square root of the semi-major axis of orbit [m^(1/2)] */ double sqrta; - /** -* Longitude of ascending node of orbit plane at weekly epoch [rad] + * Longitude of ascending node of orbit plane at weekly epoch [rad] */ double omega0; - /** -* Rate of right ascension [rad/s] + * Rate of right ascension [rad/s] */ double omegadot; - /** -* Argument of perigee [rad] + * Argument of perigee [rad] */ double w; - /** -* Inclination [rad] + * Inclination [rad] */ double inc; - /** -* Polynomial clock correction coefficient (clock bias) [s] + * Polynomial clock correction coefficient (clock bias) [s] */ double af0; - /** -* Polynomial clock correction coefficient (clock drift) [s/s] + * Polynomial clock correction coefficient (clock drift) [s/s] */ double af1; } sbp_msg_almanac_gps_t; - - /** * Get encoded size of an instance of sbp_msg_almanac_gps_t * * @param msg sbp_msg_almanac_gps_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_almanac_gps_encoded_len(const sbp_msg_almanac_gps_t *msg) -{ +static inline size_t sbp_msg_almanac_gps_encoded_len( + const sbp_msg_almanac_gps_t *msg) { (void)msg; return SBP_MSG_ALMANAC_GPS_ENCODED_LEN; } @@ -123,36 +113,53 @@ static inline size_t sbp_msg_almanac_gps_encoded_len(const sbp_msg_almanac_gps_t /** * Encode an instance of sbp_msg_almanac_gps_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_almanac_gps_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_almanac_gps_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_almanac_gps_t *msg); +SBP_EXPORT s8 sbp_msg_almanac_gps_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_almanac_gps_t *msg); /** * Decode an instance of sbp_msg_almanac_gps_t from wire representation * - * This function decodes the wire representation of a sbp_msg_almanac_gps_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_almanac_gps_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_almanac_gps_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_almanac_gps_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_almanac_gps_t *msg); +SBP_EXPORT s8 sbp_msg_almanac_gps_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_almanac_gps_t *msg); /** * Send an instance of sbp_msg_almanac_gps_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_almanac_gps_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_almanac_gps_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -160,51 +167,61 @@ SBP_EXPORT s8 sbp_msg_almanac_gps_decode(const uint8_t *buf, uint8_t len, uint8_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_almanac_gps_send(sbp_state_t *s, u16 sender_id, const sbp_msg_almanac_gps_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_almanac_gps_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_almanac_gps_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_almanac_gps_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_almanac_gps_t instance * @param b sbp_msg_almanac_gps_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_almanac_gps_cmp(const sbp_msg_almanac_gps_t *a, const sbp_msg_almanac_gps_t *b); +SBP_EXPORT int sbp_msg_almanac_gps_cmp(const sbp_msg_almanac_gps_t *a, + const sbp_msg_almanac_gps_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_almanac_gps_t &lhs, const sbp_msg_almanac_gps_t &rhs) { +static inline bool operator==(const sbp_msg_almanac_gps_t &lhs, + const sbp_msg_almanac_gps_t &rhs) { return sbp_msg_almanac_gps_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_almanac_gps_t &lhs, const sbp_msg_almanac_gps_t &rhs) { +static inline bool operator!=(const sbp_msg_almanac_gps_t &lhs, + const sbp_msg_almanac_gps_t &rhs) { return sbp_msg_almanac_gps_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_almanac_gps_t &lhs, const sbp_msg_almanac_gps_t &rhs) { +static inline bool operator<(const sbp_msg_almanac_gps_t &lhs, + const sbp_msg_almanac_gps_t &rhs) { return sbp_msg_almanac_gps_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_almanac_gps_t &lhs, const sbp_msg_almanac_gps_t &rhs) { +static inline bool operator<=(const sbp_msg_almanac_gps_t &lhs, + const sbp_msg_almanac_gps_t &rhs) { return sbp_msg_almanac_gps_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_almanac_gps_t &lhs, const sbp_msg_almanac_gps_t &rhs) { +static inline bool operator>(const sbp_msg_almanac_gps_t &lhs, + const sbp_msg_almanac_gps_t &rhs) { return sbp_msg_almanac_gps_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_almanac_gps_t &lhs, const sbp_msg_almanac_gps_t &rhs) { +static inline bool operator>=(const sbp_msg_almanac_gps_t &lhs, + const sbp_msg_almanac_gps_t &rhs) { return sbp_msg_almanac_gps_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_ALMANAC_GPS_H */ - diff --git a/c/include/libsbp/observation/MSG_ALMANAC_GPS_DEP.h b/c/include/libsbp/observation/MSG_ALMANAC_GPS_DEP.h index 9e0de647d..e99992659 100644 --- a/c/include/libsbp/observation/MSG_ALMANAC_GPS_DEP.h +++ b/c/include/libsbp/observation/MSG_ALMANAC_GPS_DEP.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_ALMANAC_GPS_DEP_H #define LIBSBP_OBSERVATION_MSG_ALMANAC_GPS_DEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,81 +41,68 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Values common for all almanac types + * Values common for all almanac types */ sbp_almanac_common_content_dep_t common; - /** -* Mean anomaly at reference time [rad] + * Mean anomaly at reference time [rad] */ double m0; - /** -* Eccentricity of satellite orbit + * Eccentricity of satellite orbit */ double ecc; - /** -* Square root of the semi-major axis of orbit [m^(1/2)] + * Square root of the semi-major axis of orbit [m^(1/2)] */ double sqrta; - /** -* Longitude of ascending node of orbit plane at weekly epoch [rad] + * Longitude of ascending node of orbit plane at weekly epoch [rad] */ double omega0; - /** -* Rate of right ascension [rad/s] + * Rate of right ascension [rad/s] */ double omegadot; - /** -* Argument of perigee [rad] + * Argument of perigee [rad] */ double w; - /** -* Inclination [rad] + * Inclination [rad] */ double inc; - /** -* Polynomial clock correction coefficient (clock bias) [s] + * Polynomial clock correction coefficient (clock bias) [s] */ double af0; - /** -* Polynomial clock correction coefficient (clock drift) [s/s] + * Polynomial clock correction coefficient (clock drift) [s/s] */ double af1; } sbp_msg_almanac_gps_dep_t; - - /** * Get encoded size of an instance of sbp_msg_almanac_gps_dep_t * * @param msg sbp_msg_almanac_gps_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_almanac_gps_dep_encoded_len(const sbp_msg_almanac_gps_dep_t *msg) -{ +static inline size_t sbp_msg_almanac_gps_dep_encoded_len( + const sbp_msg_almanac_gps_dep_t *msg) { (void)msg; return SBP_MSG_ALMANAC_GPS_DEP_ENCODED_LEN; } @@ -123,36 +110,53 @@ static inline size_t sbp_msg_almanac_gps_dep_encoded_len(const sbp_msg_almanac_g /** * Encode an instance of sbp_msg_almanac_gps_dep_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_almanac_gps_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_almanac_gps_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_almanac_gps_dep_t *msg); +SBP_EXPORT s8 +sbp_msg_almanac_gps_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_almanac_gps_dep_t *msg); /** * Decode an instance of sbp_msg_almanac_gps_dep_t from wire representation * - * This function decodes the wire representation of a sbp_msg_almanac_gps_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_almanac_gps_dep_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_almanac_gps_dep_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_almanac_gps_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_almanac_gps_dep_t *msg); +SBP_EXPORT s8 sbp_msg_almanac_gps_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_almanac_gps_dep_t *msg); /** * Send an instance of sbp_msg_almanac_gps_dep_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_almanac_gps_dep_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_almanac_gps_dep_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -160,51 +164,61 @@ SBP_EXPORT s8 sbp_msg_almanac_gps_dep_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_almanac_gps_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_almanac_gps_dep_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_almanac_gps_dep_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_almanac_gps_dep_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_almanac_gps_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_almanac_gps_dep_t instance * @param b sbp_msg_almanac_gps_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_almanac_gps_dep_cmp(const sbp_msg_almanac_gps_dep_t *a, const sbp_msg_almanac_gps_dep_t *b); +SBP_EXPORT int sbp_msg_almanac_gps_dep_cmp(const sbp_msg_almanac_gps_dep_t *a, + const sbp_msg_almanac_gps_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_almanac_gps_dep_t &lhs, const sbp_msg_almanac_gps_dep_t &rhs) { +static inline bool operator==(const sbp_msg_almanac_gps_dep_t &lhs, + const sbp_msg_almanac_gps_dep_t &rhs) { return sbp_msg_almanac_gps_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_almanac_gps_dep_t &lhs, const sbp_msg_almanac_gps_dep_t &rhs) { +static inline bool operator!=(const sbp_msg_almanac_gps_dep_t &lhs, + const sbp_msg_almanac_gps_dep_t &rhs) { return sbp_msg_almanac_gps_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_almanac_gps_dep_t &lhs, const sbp_msg_almanac_gps_dep_t &rhs) { +static inline bool operator<(const sbp_msg_almanac_gps_dep_t &lhs, + const sbp_msg_almanac_gps_dep_t &rhs) { return sbp_msg_almanac_gps_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_almanac_gps_dep_t &lhs, const sbp_msg_almanac_gps_dep_t &rhs) { +static inline bool operator<=(const sbp_msg_almanac_gps_dep_t &lhs, + const sbp_msg_almanac_gps_dep_t &rhs) { return sbp_msg_almanac_gps_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_almanac_gps_dep_t &lhs, const sbp_msg_almanac_gps_dep_t &rhs) { +static inline bool operator>(const sbp_msg_almanac_gps_dep_t &lhs, + const sbp_msg_almanac_gps_dep_t &rhs) { return sbp_msg_almanac_gps_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_almanac_gps_dep_t &lhs, const sbp_msg_almanac_gps_dep_t &rhs) { +static inline bool operator>=(const sbp_msg_almanac_gps_dep_t &lhs, + const sbp_msg_almanac_gps_dep_t &rhs) { return sbp_msg_almanac_gps_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_ALMANAC_GPS_DEP_H */ - diff --git a/c/include/libsbp/observation/MSG_BASE_POS_ECEF.h b/c/include/libsbp/observation/MSG_BASE_POS_ECEF.h index 23ca5f6a5..a3bcf8ffd 100644 --- a/c/include/libsbp/observation/MSG_BASE_POS_ECEF.h +++ b/c/include/libsbp/observation/MSG_BASE_POS_ECEF.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_OBSERVATION_MSG_BASE_POS_ECEF_H #define LIBSBP_OBSERVATION_MSG_BASE_POS_ECEF_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,39 +40,37 @@ *****************************************************************************/ /** Base station position in ECEF * -* The base station position message is the position reported by the base station itself in absolute Earth Centered Earth Fixed coordinates. It is used for pseudo-absolute RTK positioning, and is required to be a high-accuracy surveyed location of the base station. Any error here will result in an error in the pseudo-absolute position output. + * The base station position message is the position reported by the base + * station itself in absolute Earth Centered Earth Fixed coordinates. It is used + * for pseudo-absolute RTK positioning, and is required to be a high-accuracy + * surveyed location of the base station. Any error here will result in an error + * in the pseudo-absolute position output. */ typedef struct { - - /** -* ECEF X coordinate [m] + * ECEF X coordinate [m] */ double x; - /** -* ECEF Y coordinate [m] + * ECEF Y coordinate [m] */ double y; - /** -* ECEF Z coordinate [m] + * ECEF Z coordinate [m] */ double z; } sbp_msg_base_pos_ecef_t; - - /** * Get encoded size of an instance of sbp_msg_base_pos_ecef_t * * @param msg sbp_msg_base_pos_ecef_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_base_pos_ecef_encoded_len(const sbp_msg_base_pos_ecef_t *msg) -{ +static inline size_t sbp_msg_base_pos_ecef_encoded_len( + const sbp_msg_base_pos_ecef_t *msg) { (void)msg; return SBP_MSG_BASE_POS_ECEF_ENCODED_LEN; } @@ -80,36 +78,53 @@ static inline size_t sbp_msg_base_pos_ecef_encoded_len(const sbp_msg_base_pos_ec /** * Encode an instance of sbp_msg_base_pos_ecef_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_base_pos_ecef_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_base_pos_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_base_pos_ecef_t *msg); +SBP_EXPORT s8 sbp_msg_base_pos_ecef_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_base_pos_ecef_t *msg); /** * Decode an instance of sbp_msg_base_pos_ecef_t from wire representation * - * This function decodes the wire representation of a sbp_msg_base_pos_ecef_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_base_pos_ecef_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_base_pos_ecef_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_base_pos_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_base_pos_ecef_t *msg); +SBP_EXPORT s8 sbp_msg_base_pos_ecef_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_base_pos_ecef_t *msg); /** * Send an instance of sbp_msg_base_pos_ecef_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_base_pos_ecef_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_base_pos_ecef_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -117,51 +132,61 @@ SBP_EXPORT s8 sbp_msg_base_pos_ecef_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_base_pos_ecef_send(sbp_state_t *s, u16 sender_id, const sbp_msg_base_pos_ecef_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_base_pos_ecef_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_base_pos_ecef_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_base_pos_ecef_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_base_pos_ecef_t instance * @param b sbp_msg_base_pos_ecef_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_base_pos_ecef_cmp(const sbp_msg_base_pos_ecef_t *a, const sbp_msg_base_pos_ecef_t *b); +SBP_EXPORT int sbp_msg_base_pos_ecef_cmp(const sbp_msg_base_pos_ecef_t *a, + const sbp_msg_base_pos_ecef_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_base_pos_ecef_t &lhs, const sbp_msg_base_pos_ecef_t &rhs) { +static inline bool operator==(const sbp_msg_base_pos_ecef_t &lhs, + const sbp_msg_base_pos_ecef_t &rhs) { return sbp_msg_base_pos_ecef_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_base_pos_ecef_t &lhs, const sbp_msg_base_pos_ecef_t &rhs) { +static inline bool operator!=(const sbp_msg_base_pos_ecef_t &lhs, + const sbp_msg_base_pos_ecef_t &rhs) { return sbp_msg_base_pos_ecef_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_base_pos_ecef_t &lhs, const sbp_msg_base_pos_ecef_t &rhs) { +static inline bool operator<(const sbp_msg_base_pos_ecef_t &lhs, + const sbp_msg_base_pos_ecef_t &rhs) { return sbp_msg_base_pos_ecef_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_base_pos_ecef_t &lhs, const sbp_msg_base_pos_ecef_t &rhs) { +static inline bool operator<=(const sbp_msg_base_pos_ecef_t &lhs, + const sbp_msg_base_pos_ecef_t &rhs) { return sbp_msg_base_pos_ecef_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_base_pos_ecef_t &lhs, const sbp_msg_base_pos_ecef_t &rhs) { +static inline bool operator>(const sbp_msg_base_pos_ecef_t &lhs, + const sbp_msg_base_pos_ecef_t &rhs) { return sbp_msg_base_pos_ecef_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_base_pos_ecef_t &lhs, const sbp_msg_base_pos_ecef_t &rhs) { +static inline bool operator>=(const sbp_msg_base_pos_ecef_t &lhs, + const sbp_msg_base_pos_ecef_t &rhs) { return sbp_msg_base_pos_ecef_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_BASE_POS_ECEF_H */ - diff --git a/c/include/libsbp/observation/MSG_BASE_POS_LLH.h b/c/include/libsbp/observation/MSG_BASE_POS_LLH.h index 133d3b44b..7827d1a28 100644 --- a/c/include/libsbp/observation/MSG_BASE_POS_LLH.h +++ b/c/include/libsbp/observation/MSG_BASE_POS_LLH.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_OBSERVATION_MSG_BASE_POS_LLH_H #define LIBSBP_OBSERVATION_MSG_BASE_POS_LLH_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,39 +40,36 @@ *****************************************************************************/ /** Base station position * -* The base station position message is the position reported by the base station itself. It is used for pseudo-absolute RTK positioning, and is required to be a high-accuracy surveyed location of the base station. Any error here will result in an error in the pseudo-absolute position output. + * The base station position message is the position reported by the base + * station itself. It is used for pseudo-absolute RTK positioning, and is + * required to be a high-accuracy surveyed location of the base station. Any + * error here will result in an error in the pseudo-absolute position output. */ typedef struct { - - /** -* Latitude [deg] + * Latitude [deg] */ double lat; - /** -* Longitude [deg] + * Longitude [deg] */ double lon; - /** -* Height [m] + * Height [m] */ double height; } sbp_msg_base_pos_llh_t; - - /** * Get encoded size of an instance of sbp_msg_base_pos_llh_t * * @param msg sbp_msg_base_pos_llh_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_base_pos_llh_encoded_len(const sbp_msg_base_pos_llh_t *msg) -{ +static inline size_t sbp_msg_base_pos_llh_encoded_len( + const sbp_msg_base_pos_llh_t *msg) { (void)msg; return SBP_MSG_BASE_POS_LLH_ENCODED_LEN; } @@ -80,36 +77,53 @@ static inline size_t sbp_msg_base_pos_llh_encoded_len(const sbp_msg_base_pos_llh /** * Encode an instance of sbp_msg_base_pos_llh_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_base_pos_llh_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_base_pos_llh_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_base_pos_llh_t *msg); +SBP_EXPORT s8 sbp_msg_base_pos_llh_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_base_pos_llh_t *msg); /** * Decode an instance of sbp_msg_base_pos_llh_t from wire representation * - * This function decodes the wire representation of a sbp_msg_base_pos_llh_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_base_pos_llh_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_base_pos_llh_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_base_pos_llh_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_base_pos_llh_t *msg); +SBP_EXPORT s8 sbp_msg_base_pos_llh_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_base_pos_llh_t *msg); /** * Send an instance of sbp_msg_base_pos_llh_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_base_pos_llh_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_base_pos_llh_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -117,51 +131,61 @@ SBP_EXPORT s8 sbp_msg_base_pos_llh_decode(const uint8_t *buf, uint8_t len, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_base_pos_llh_send(sbp_state_t *s, u16 sender_id, const sbp_msg_base_pos_llh_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_base_pos_llh_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_base_pos_llh_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_base_pos_llh_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_base_pos_llh_t instance * @param b sbp_msg_base_pos_llh_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_base_pos_llh_cmp(const sbp_msg_base_pos_llh_t *a, const sbp_msg_base_pos_llh_t *b); +SBP_EXPORT int sbp_msg_base_pos_llh_cmp(const sbp_msg_base_pos_llh_t *a, + const sbp_msg_base_pos_llh_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_base_pos_llh_t &lhs, const sbp_msg_base_pos_llh_t &rhs) { +static inline bool operator==(const sbp_msg_base_pos_llh_t &lhs, + const sbp_msg_base_pos_llh_t &rhs) { return sbp_msg_base_pos_llh_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_base_pos_llh_t &lhs, const sbp_msg_base_pos_llh_t &rhs) { +static inline bool operator!=(const sbp_msg_base_pos_llh_t &lhs, + const sbp_msg_base_pos_llh_t &rhs) { return sbp_msg_base_pos_llh_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_base_pos_llh_t &lhs, const sbp_msg_base_pos_llh_t &rhs) { +static inline bool operator<(const sbp_msg_base_pos_llh_t &lhs, + const sbp_msg_base_pos_llh_t &rhs) { return sbp_msg_base_pos_llh_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_base_pos_llh_t &lhs, const sbp_msg_base_pos_llh_t &rhs) { +static inline bool operator<=(const sbp_msg_base_pos_llh_t &lhs, + const sbp_msg_base_pos_llh_t &rhs) { return sbp_msg_base_pos_llh_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_base_pos_llh_t &lhs, const sbp_msg_base_pos_llh_t &rhs) { +static inline bool operator>(const sbp_msg_base_pos_llh_t &lhs, + const sbp_msg_base_pos_llh_t &rhs) { return sbp_msg_base_pos_llh_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_base_pos_llh_t &lhs, const sbp_msg_base_pos_llh_t &rhs) { +static inline bool operator>=(const sbp_msg_base_pos_llh_t &lhs, + const sbp_msg_base_pos_llh_t &rhs) { return sbp_msg_base_pos_llh_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_BASE_POS_LLH_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_BDS.h b/c/include/libsbp/observation/MSG_EPHEMERIS_BDS.h index 2a909672d..164fdb2fb 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_BDS.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_BDS.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_BDS_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_BDS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,167 +42,149 @@ *****************************************************************************/ /** Satellite broadcast ephemeris for BDS * -* The ephemeris message returns a set of satellite orbit parameters that is used to calculate BDS satellite position, velocity, and clock offset. Please see the BeiDou Navigation Satellite System SIS-ICD Version 2.1, Table 5-9 for more details. + * The ephemeris message returns a set of satellite orbit parameters that is + * used to calculate BDS satellite position, velocity, and clock offset. Please + * see the BeiDou Navigation Satellite System SIS-ICD Version 2.1, Table 5-9 for + * more details. */ typedef struct { - - /** -* Values common for all ephemeris types + * Values common for all ephemeris types */ sbp_ephemeris_common_content_t common; - /** -* Group delay differential for B1 [s] + * Group delay differential for B1 [s] */ float tgd1; - /** -* Group delay differential for B2 [s] + * Group delay differential for B2 [s] */ float tgd2; - /** -* Amplitude of the sine harmonic correction term to the orbit radius [m] + * Amplitude of the sine harmonic correction term to the orbit radius [m] */ float c_rs; - /** -* Amplitude of the cosine harmonic correction term to the orbit radius [m] + * Amplitude of the cosine harmonic correction term to the orbit radius [m] */ float c_rc; - /** -* Amplitude of the cosine harmonic correction term to the argument of latitude [rad] + * Amplitude of the cosine harmonic correction term to the argument of + * latitude [rad] */ float c_uc; - /** -* Amplitude of the sine harmonic correction term to the argument of latitude [rad] + * Amplitude of the sine harmonic correction term to the argument of latitude + * [rad] */ float c_us; - /** -* Amplitude of the cosine harmonic correction term to the angle of inclination [rad] + * Amplitude of the cosine harmonic correction term to the angle of + * inclination [rad] */ float c_ic; - /** -* Amplitude of the sine harmonic correction term to the angle of inclination [rad] + * Amplitude of the sine harmonic correction term to the angle of inclination + * [rad] */ float c_is; - /** -* Mean motion difference [rad/s] + * Mean motion difference [rad/s] */ double dn; - /** -* Mean anomaly at reference time [rad] + * Mean anomaly at reference time [rad] */ double m0; - /** -* Eccentricity of satellite orbit + * Eccentricity of satellite orbit */ double ecc; - /** -* Square root of the semi-major axis of orbit [m^(1/2)] + * Square root of the semi-major axis of orbit [m^(1/2)] */ double sqrta; - /** -* Longitude of ascending node of orbit plane at weekly epoch [rad] + * Longitude of ascending node of orbit plane at weekly epoch [rad] */ double omega0; - /** -* Rate of right ascension [rad/s] + * Rate of right ascension [rad/s] */ double omegadot; - /** -* Argument of perigee [rad] + * Argument of perigee [rad] */ double w; - /** -* Inclination [rad] + * Inclination [rad] */ double inc; - /** -* Inclination first derivative [rad/s] + * Inclination first derivative [rad/s] */ double inc_dot; - /** -* Polynomial clock correction coefficient (clock bias) [s] + * Polynomial clock correction coefficient (clock bias) [s] */ double af0; - /** -* Polynomial clock correction coefficient (clock drift) [s/s] + * Polynomial clock correction coefficient (clock drift) [s/s] */ float af1; - /** -* Polynomial clock correction coefficient (rate of clock drift) [s/s^2] + * Polynomial clock correction coefficient (rate of clock drift) [s/s^2] */ float af2; - /** -* Clock reference + * Clock reference */ sbp_gps_time_sec_t toc; - /** - * Issue of ephemeris data - * Calculated from the navigation data parameter t_oe per RTCM/CSNO recommendation: IODE = mod (t_oe / 720, 240) + * Issue of ephemeris data + * Calculated from the navigation data parameter t_oe per RTCM/CSNO + * recommendation: IODE = mod (t_oe / 720, 240) */ u8 iode; - /** - * Issue of clock data - * Calculated from the navigation data parameter t_oe per RTCM/CSNO recommendation: IODE = mod (t_oc / 720, 240) + * Issue of clock data + * Calculated from the navigation data parameter t_oe per RTCM/CSNO + * recommendation: IODE = mod (t_oc / 720, 240) */ u16 iodc; } sbp_msg_ephemeris_bds_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_bds_t * * @param msg sbp_msg_ephemeris_bds_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_bds_encoded_len(const sbp_msg_ephemeris_bds_t *msg) -{ +static inline size_t sbp_msg_ephemeris_bds_encoded_len( + const sbp_msg_ephemeris_bds_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_BDS_ENCODED_LEN; } @@ -210,36 +192,53 @@ static inline size_t sbp_msg_ephemeris_bds_encoded_len(const sbp_msg_ephemeris_b /** * Encode an instance of sbp_msg_ephemeris_bds_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_bds_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_bds_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_bds_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_bds_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_ephemeris_bds_t *msg); /** * Decode an instance of sbp_msg_ephemeris_bds_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_bds_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ephemeris_bds_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_bds_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_bds_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_bds_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_bds_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_bds_t *msg); /** * Send an instance of sbp_msg_ephemeris_bds_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_bds_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_bds_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -247,51 +246,61 @@ SBP_EXPORT s8 sbp_msg_ephemeris_bds_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_bds_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_bds_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_bds_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_bds_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_bds_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_bds_t instance * @param b sbp_msg_ephemeris_bds_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_bds_cmp(const sbp_msg_ephemeris_bds_t *a, const sbp_msg_ephemeris_bds_t *b); +SBP_EXPORT int sbp_msg_ephemeris_bds_cmp(const sbp_msg_ephemeris_bds_t *a, + const sbp_msg_ephemeris_bds_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_bds_t &lhs, const sbp_msg_ephemeris_bds_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_bds_t &lhs, + const sbp_msg_ephemeris_bds_t &rhs) { return sbp_msg_ephemeris_bds_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_bds_t &lhs, const sbp_msg_ephemeris_bds_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_bds_t &lhs, + const sbp_msg_ephemeris_bds_t &rhs) { return sbp_msg_ephemeris_bds_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_bds_t &lhs, const sbp_msg_ephemeris_bds_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_bds_t &lhs, + const sbp_msg_ephemeris_bds_t &rhs) { return sbp_msg_ephemeris_bds_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_bds_t &lhs, const sbp_msg_ephemeris_bds_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_bds_t &lhs, + const sbp_msg_ephemeris_bds_t &rhs) { return sbp_msg_ephemeris_bds_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_bds_t &lhs, const sbp_msg_ephemeris_bds_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_bds_t &lhs, + const sbp_msg_ephemeris_bds_t &rhs) { return sbp_msg_ephemeris_bds_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_bds_t &lhs, const sbp_msg_ephemeris_bds_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_bds_t &lhs, + const sbp_msg_ephemeris_bds_t &rhs) { return sbp_msg_ephemeris_bds_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_BDS_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_A.h b/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_A.h index 8316f6e37..ae7842f28 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_A.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_DEP_A_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,177 +40,152 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Group delay differential between L1 and L2 [s] + * Group delay differential between L1 and L2 [s] */ double tgd; - /** -* Amplitude of the sine harmonic correction term to the orbit radius [m] + * Amplitude of the sine harmonic correction term to the orbit radius [m] */ double c_rs; - /** -* Amplitude of the cosine harmonic correction term to the orbit radius [m] + * Amplitude of the cosine harmonic correction term to the orbit radius [m] */ double c_rc; - /** -* Amplitude of the cosine harmonic correction term to the argument of latitude [rad] + * Amplitude of the cosine harmonic correction term to the argument of + * latitude [rad] */ double c_uc; - /** -* Amplitude of the sine harmonic correction term to the argument of latitude [rad] + * Amplitude of the sine harmonic correction term to the argument of latitude + * [rad] */ double c_us; - /** -* Amplitude of the cosine harmonic correction term to the angle of inclination [rad] + * Amplitude of the cosine harmonic correction term to the angle of + * inclination [rad] */ double c_ic; - /** -* Amplitude of the sine harmonic correction term to the angle of inclination [rad] + * Amplitude of the sine harmonic correction term to the angle of inclination + * [rad] */ double c_is; - /** -* Mean motion difference [rad/s] + * Mean motion difference [rad/s] */ double dn; - /** -* Mean anomaly at reference time [rad] + * Mean anomaly at reference time [rad] */ double m0; - /** -* Eccentricity of satellite orbit + * Eccentricity of satellite orbit */ double ecc; - /** -* Square root of the semi-major axis of orbit [m^(1/2)] + * Square root of the semi-major axis of orbit [m^(1/2)] */ double sqrta; - /** -* Longitude of ascending node of orbit plane at weekly epoch [rad] + * Longitude of ascending node of orbit plane at weekly epoch [rad] */ double omega0; - /** -* Rate of right ascension [rad/s] + * Rate of right ascension [rad/s] */ double omegadot; - /** -* Argument of perigee [rad] + * Argument of perigee [rad] */ double w; - /** -* Inclination [rad] + * Inclination [rad] */ double inc; - /** -* Inclination first derivative [rad/s] + * Inclination first derivative [rad/s] */ double inc_dot; - /** -* Polynomial clock correction coefficient (clock bias) [s] + * Polynomial clock correction coefficient (clock bias) [s] */ double af0; - /** -* Polynomial clock correction coefficient (clock drift) [s/s] + * Polynomial clock correction coefficient (clock drift) [s/s] */ double af1; - /** -* Polynomial clock correction coefficient (rate of clock drift) [s/s^2] + * Polynomial clock correction coefficient (rate of clock drift) [s/s^2] */ double af2; - /** -* Time of week [s] + * Time of week [s] */ double toe_tow; - /** -* Week number [week] + * Week number [week] */ u16 toe_wn; - /** -* Clock reference time of week [s] + * Clock reference time of week [s] */ double toc_tow; - /** -* Clock reference week number [week] + * Clock reference week number [week] */ u16 toc_wn; - /** -* Is valid? + * Is valid? */ u8 valid; - /** -* Satellite is healthy? + * Satellite is healthy? */ u8 healthy; - /** -* PRN being tracked + * PRN being tracked */ u8 prn; } sbp_msg_ephemeris_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_dep_a_t * * @param msg sbp_msg_ephemeris_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_dep_a_encoded_len(const sbp_msg_ephemeris_dep_a_t *msg) -{ +static inline size_t sbp_msg_ephemeris_dep_a_encoded_len( + const sbp_msg_ephemeris_dep_a_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_DEP_A_ENCODED_LEN; } @@ -218,36 +193,53 @@ static inline size_t sbp_msg_ephemeris_dep_a_encoded_len(const sbp_msg_ephemeris /** * Encode an instance of sbp_msg_ephemeris_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_dep_a_t *msg); +SBP_EXPORT s8 +sbp_msg_ephemeris_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_dep_a_t *msg); /** * Decode an instance of sbp_msg_ephemeris_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ephemeris_dep_a_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_dep_a_t *msg); /** * Send an instance of sbp_msg_ephemeris_dep_a_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -255,51 +247,61 @@ SBP_EXPORT s8 sbp_msg_ephemeris_dep_a_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_dep_a_t instance * @param b sbp_msg_ephemeris_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_dep_a_cmp(const sbp_msg_ephemeris_dep_a_t *a, const sbp_msg_ephemeris_dep_a_t *b); +SBP_EXPORT int sbp_msg_ephemeris_dep_a_cmp(const sbp_msg_ephemeris_dep_a_t *a, + const sbp_msg_ephemeris_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_dep_a_t &lhs, const sbp_msg_ephemeris_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_dep_a_t &lhs, + const sbp_msg_ephemeris_dep_a_t &rhs) { return sbp_msg_ephemeris_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_dep_a_t &lhs, const sbp_msg_ephemeris_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_dep_a_t &lhs, + const sbp_msg_ephemeris_dep_a_t &rhs) { return sbp_msg_ephemeris_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_dep_a_t &lhs, const sbp_msg_ephemeris_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_dep_a_t &lhs, + const sbp_msg_ephemeris_dep_a_t &rhs) { return sbp_msg_ephemeris_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_dep_a_t &lhs, const sbp_msg_ephemeris_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_dep_a_t &lhs, + const sbp_msg_ephemeris_dep_a_t &rhs) { return sbp_msg_ephemeris_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_dep_a_t &lhs, const sbp_msg_ephemeris_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_dep_a_t &lhs, + const sbp_msg_ephemeris_dep_a_t &rhs) { return sbp_msg_ephemeris_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_dep_a_t &lhs, const sbp_msg_ephemeris_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_dep_a_t &lhs, + const sbp_msg_ephemeris_dep_a_t &rhs) { return sbp_msg_ephemeris_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_DEP_A_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_B.h b/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_B.h index 3f1356978..24bd2474e 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_B.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_B.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_DEP_B_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_DEP_B_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,183 +40,157 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Group delay differential between L1 and L2 [s] + * Group delay differential between L1 and L2 [s] */ double tgd; - /** -* Amplitude of the sine harmonic correction term to the orbit radius [m] + * Amplitude of the sine harmonic correction term to the orbit radius [m] */ double c_rs; - /** -* Amplitude of the cosine harmonic correction term to the orbit radius [m] + * Amplitude of the cosine harmonic correction term to the orbit radius [m] */ double c_rc; - /** -* Amplitude of the cosine harmonic correction term to the argument of latitude [rad] + * Amplitude of the cosine harmonic correction term to the argument of + * latitude [rad] */ double c_uc; - /** -* Amplitude of the sine harmonic correction term to the argument of latitude [rad] + * Amplitude of the sine harmonic correction term to the argument of latitude + * [rad] */ double c_us; - /** -* Amplitude of the cosine harmonic correction term to the angle of inclination [rad] + * Amplitude of the cosine harmonic correction term to the angle of + * inclination [rad] */ double c_ic; - /** -* Amplitude of the sine harmonic correction term to the angle of inclination [rad] + * Amplitude of the sine harmonic correction term to the angle of inclination + * [rad] */ double c_is; - /** -* Mean motion difference [rad/s] + * Mean motion difference [rad/s] */ double dn; - /** -* Mean anomaly at reference time [rad] + * Mean anomaly at reference time [rad] */ double m0; - /** -* Eccentricity of satellite orbit + * Eccentricity of satellite orbit */ double ecc; - /** -* Square root of the semi-major axis of orbit [m^(1/2)] + * Square root of the semi-major axis of orbit [m^(1/2)] */ double sqrta; - /** -* Longitude of ascending node of orbit plane at weekly epoch [rad] + * Longitude of ascending node of orbit plane at weekly epoch [rad] */ double omega0; - /** -* Rate of right ascension [rad/s] + * Rate of right ascension [rad/s] */ double omegadot; - /** -* Argument of perigee [rad] + * Argument of perigee [rad] */ double w; - /** -* Inclination [rad] + * Inclination [rad] */ double inc; - /** -* Inclination first derivative [rad/s] + * Inclination first derivative [rad/s] */ double inc_dot; - /** -* Polynomial clock correction coefficient (clock bias) [s] + * Polynomial clock correction coefficient (clock bias) [s] */ double af0; - /** -* Polynomial clock correction coefficient (clock drift) [s/s] + * Polynomial clock correction coefficient (clock drift) [s/s] */ double af1; - /** -* Polynomial clock correction coefficient (rate of clock drift) [s/s^2] + * Polynomial clock correction coefficient (rate of clock drift) [s/s^2] */ double af2; - /** -* Time of week [s] + * Time of week [s] */ double toe_tow; - /** -* Week number [week] + * Week number [week] */ u16 toe_wn; - /** -* Clock reference time of week [s] + * Clock reference time of week [s] */ double toc_tow; - /** -* Clock reference week number [week] + * Clock reference week number [week] */ u16 toc_wn; - /** -* Is valid? + * Is valid? */ u8 valid; - /** -* Satellite is healthy? + * Satellite is healthy? */ u8 healthy; - /** -* PRN being tracked + * PRN being tracked */ u8 prn; - /** -* Issue of ephemeris data + * Issue of ephemeris data */ u8 iode; } sbp_msg_ephemeris_dep_b_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_dep_b_t * * @param msg sbp_msg_ephemeris_dep_b_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_dep_b_encoded_len(const sbp_msg_ephemeris_dep_b_t *msg) -{ +static inline size_t sbp_msg_ephemeris_dep_b_encoded_len( + const sbp_msg_ephemeris_dep_b_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_DEP_B_ENCODED_LEN; } @@ -224,36 +198,53 @@ static inline size_t sbp_msg_ephemeris_dep_b_encoded_len(const sbp_msg_ephemeris /** * Encode an instance of sbp_msg_ephemeris_dep_b_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_dep_b_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_dep_b_t *msg); +SBP_EXPORT s8 +sbp_msg_ephemeris_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_dep_b_t *msg); /** * Decode an instance of sbp_msg_ephemeris_dep_b_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_dep_b_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ephemeris_dep_b_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_dep_b_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_dep_b_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_dep_b_t *msg); /** * Send an instance of sbp_msg_ephemeris_dep_b_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_dep_b_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_dep_b_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -261,51 +252,61 @@ SBP_EXPORT s8 sbp_msg_ephemeris_dep_b_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_dep_b_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_dep_b_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_dep_b_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_dep_b_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_dep_b_t instance * @param b sbp_msg_ephemeris_dep_b_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_dep_b_cmp(const sbp_msg_ephemeris_dep_b_t *a, const sbp_msg_ephemeris_dep_b_t *b); +SBP_EXPORT int sbp_msg_ephemeris_dep_b_cmp(const sbp_msg_ephemeris_dep_b_t *a, + const sbp_msg_ephemeris_dep_b_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_dep_b_t &lhs, const sbp_msg_ephemeris_dep_b_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_dep_b_t &lhs, + const sbp_msg_ephemeris_dep_b_t &rhs) { return sbp_msg_ephemeris_dep_b_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_dep_b_t &lhs, const sbp_msg_ephemeris_dep_b_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_dep_b_t &lhs, + const sbp_msg_ephemeris_dep_b_t &rhs) { return sbp_msg_ephemeris_dep_b_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_dep_b_t &lhs, const sbp_msg_ephemeris_dep_b_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_dep_b_t &lhs, + const sbp_msg_ephemeris_dep_b_t &rhs) { return sbp_msg_ephemeris_dep_b_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_dep_b_t &lhs, const sbp_msg_ephemeris_dep_b_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_dep_b_t &lhs, + const sbp_msg_ephemeris_dep_b_t &rhs) { return sbp_msg_ephemeris_dep_b_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_dep_b_t &lhs, const sbp_msg_ephemeris_dep_b_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_dep_b_t &lhs, + const sbp_msg_ephemeris_dep_b_t &rhs) { return sbp_msg_ephemeris_dep_b_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_dep_b_t &lhs, const sbp_msg_ephemeris_dep_b_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_dep_b_t &lhs, + const sbp_msg_ephemeris_dep_b_t &rhs) { return sbp_msg_ephemeris_dep_b_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_DEP_B_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_C.h b/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_C.h index 427acb097..72aaca40b 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_C.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_C.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_DEP_C_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_DEP_C_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,195 +41,167 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Group delay differential between L1 and L2 [s] + * Group delay differential between L1 and L2 [s] */ double tgd; - /** -* Amplitude of the sine harmonic correction term to the orbit radius [m] + * Amplitude of the sine harmonic correction term to the orbit radius [m] */ double c_rs; - /** -* Amplitude of the cosine harmonic correction term to the orbit radius [m] + * Amplitude of the cosine harmonic correction term to the orbit radius [m] */ double c_rc; - /** -* Amplitude of the cosine harmonic correction term to the argument of latitude [rad] + * Amplitude of the cosine harmonic correction term to the argument of + * latitude [rad] */ double c_uc; - /** -* Amplitude of the sine harmonic correction term to the argument of latitude [rad] + * Amplitude of the sine harmonic correction term to the argument of latitude + * [rad] */ double c_us; - /** -* Amplitude of the cosine harmonic correction term to the angle of inclination [rad] + * Amplitude of the cosine harmonic correction term to the angle of + * inclination [rad] */ double c_ic; - /** -* Amplitude of the sine harmonic correction term to the angle of inclination [rad] + * Amplitude of the sine harmonic correction term to the angle of inclination + * [rad] */ double c_is; - /** -* Mean motion difference [rad/s] + * Mean motion difference [rad/s] */ double dn; - /** -* Mean anomaly at reference time [rad] + * Mean anomaly at reference time [rad] */ double m0; - /** -* Eccentricity of satellite orbit + * Eccentricity of satellite orbit */ double ecc; - /** -* Square root of the semi-major axis of orbit [m^(1/2)] + * Square root of the semi-major axis of orbit [m^(1/2)] */ double sqrta; - /** -* Longitude of ascending node of orbit plane at weekly epoch [rad] + * Longitude of ascending node of orbit plane at weekly epoch [rad] */ double omega0; - /** -* Rate of right ascension [rad/s] + * Rate of right ascension [rad/s] */ double omegadot; - /** -* Argument of perigee [rad] + * Argument of perigee [rad] */ double w; - /** -* Inclination [rad] + * Inclination [rad] */ double inc; - /** -* Inclination first derivative [rad/s] + * Inclination first derivative [rad/s] */ double inc_dot; - /** -* Polynomial clock correction coefficient (clock bias) [s] + * Polynomial clock correction coefficient (clock bias) [s] */ double af0; - /** -* Polynomial clock correction coefficient (clock drift) [s/s] + * Polynomial clock correction coefficient (clock drift) [s/s] */ double af1; - /** -* Polynomial clock correction coefficient (rate of clock drift) [s/s^2] + * Polynomial clock correction coefficient (rate of clock drift) [s/s^2] */ double af2; - /** -* Time of week [s] + * Time of week [s] */ double toe_tow; - /** -* Week number [week] + * Week number [week] */ u16 toe_wn; - /** -* Clock reference time of week [s] + * Clock reference time of week [s] */ double toc_tow; - /** -* Clock reference week number [week] + * Clock reference week number [week] */ u16 toc_wn; - /** -* Is valid? + * Is valid? */ u8 valid; - /** -* Satellite is healthy? + * Satellite is healthy? */ u8 healthy; - /** -* GNSS signal identifier + * GNSS signal identifier */ sbp_gnss_signal_dep_t sid; - /** -* Issue of ephemeris data + * Issue of ephemeris data */ u8 iode; - /** -* Issue of clock data + * Issue of clock data */ u16 iodc; - /** -* Reserved field + * Reserved field */ u32 reserved; } sbp_msg_ephemeris_dep_c_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_dep_c_t * * @param msg sbp_msg_ephemeris_dep_c_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_dep_c_encoded_len(const sbp_msg_ephemeris_dep_c_t *msg) -{ +static inline size_t sbp_msg_ephemeris_dep_c_encoded_len( + const sbp_msg_ephemeris_dep_c_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_DEP_C_ENCODED_LEN; } @@ -237,36 +209,53 @@ static inline size_t sbp_msg_ephemeris_dep_c_encoded_len(const sbp_msg_ephemeris /** * Encode an instance of sbp_msg_ephemeris_dep_c_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_dep_c_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_dep_c_t *msg); +SBP_EXPORT s8 +sbp_msg_ephemeris_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_dep_c_t *msg); /** * Decode an instance of sbp_msg_ephemeris_dep_c_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_dep_c_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ephemeris_dep_c_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_dep_c_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_dep_c_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_dep_c_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_dep_c_t *msg); /** * Send an instance of sbp_msg_ephemeris_dep_c_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_dep_c_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_dep_c_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -274,51 +263,61 @@ SBP_EXPORT s8 sbp_msg_ephemeris_dep_c_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_dep_c_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_dep_c_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_dep_c_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_dep_c_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_dep_c_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_dep_c_t instance * @param b sbp_msg_ephemeris_dep_c_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_dep_c_cmp(const sbp_msg_ephemeris_dep_c_t *a, const sbp_msg_ephemeris_dep_c_t *b); +SBP_EXPORT int sbp_msg_ephemeris_dep_c_cmp(const sbp_msg_ephemeris_dep_c_t *a, + const sbp_msg_ephemeris_dep_c_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_dep_c_t &lhs, const sbp_msg_ephemeris_dep_c_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_dep_c_t &lhs, + const sbp_msg_ephemeris_dep_c_t &rhs) { return sbp_msg_ephemeris_dep_c_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_dep_c_t &lhs, const sbp_msg_ephemeris_dep_c_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_dep_c_t &lhs, + const sbp_msg_ephemeris_dep_c_t &rhs) { return sbp_msg_ephemeris_dep_c_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_dep_c_t &lhs, const sbp_msg_ephemeris_dep_c_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_dep_c_t &lhs, + const sbp_msg_ephemeris_dep_c_t &rhs) { return sbp_msg_ephemeris_dep_c_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_dep_c_t &lhs, const sbp_msg_ephemeris_dep_c_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_dep_c_t &lhs, + const sbp_msg_ephemeris_dep_c_t &rhs) { return sbp_msg_ephemeris_dep_c_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_dep_c_t &lhs, const sbp_msg_ephemeris_dep_c_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_dep_c_t &lhs, + const sbp_msg_ephemeris_dep_c_t &rhs) { return sbp_msg_ephemeris_dep_c_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_dep_c_t &lhs, const sbp_msg_ephemeris_dep_c_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_dep_c_t &lhs, + const sbp_msg_ephemeris_dep_c_t &rhs) { return sbp_msg_ephemeris_dep_c_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_DEP_C_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_D.h b/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_D.h index d144a26db..e148bbbd0 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_D.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_DEP_D.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_DEP_D_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_DEP_D_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,195 +41,167 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Group delay differential between L1 and L2 [s] + * Group delay differential between L1 and L2 [s] */ double tgd; - /** -* Amplitude of the sine harmonic correction term to the orbit radius [m] + * Amplitude of the sine harmonic correction term to the orbit radius [m] */ double c_rs; - /** -* Amplitude of the cosine harmonic correction term to the orbit radius [m] + * Amplitude of the cosine harmonic correction term to the orbit radius [m] */ double c_rc; - /** -* Amplitude of the cosine harmonic correction term to the argument of latitude [rad] + * Amplitude of the cosine harmonic correction term to the argument of + * latitude [rad] */ double c_uc; - /** -* Amplitude of the sine harmonic correction term to the argument of latitude [rad] + * Amplitude of the sine harmonic correction term to the argument of latitude + * [rad] */ double c_us; - /** -* Amplitude of the cosine harmonic correction term to the angle of inclination [rad] + * Amplitude of the cosine harmonic correction term to the angle of + * inclination [rad] */ double c_ic; - /** -* Amplitude of the sine harmonic correction term to the angle of inclination [rad] + * Amplitude of the sine harmonic correction term to the angle of inclination + * [rad] */ double c_is; - /** -* Mean motion difference [rad/s] + * Mean motion difference [rad/s] */ double dn; - /** -* Mean anomaly at reference time [rad] + * Mean anomaly at reference time [rad] */ double m0; - /** -* Eccentricity of satellite orbit + * Eccentricity of satellite orbit */ double ecc; - /** -* Square root of the semi-major axis of orbit [m^(1/2)] + * Square root of the semi-major axis of orbit [m^(1/2)] */ double sqrta; - /** -* Longitude of ascending node of orbit plane at weekly epoch [rad] + * Longitude of ascending node of orbit plane at weekly epoch [rad] */ double omega0; - /** -* Rate of right ascension [rad/s] + * Rate of right ascension [rad/s] */ double omegadot; - /** -* Argument of perigee [rad] + * Argument of perigee [rad] */ double w; - /** -* Inclination [rad] + * Inclination [rad] */ double inc; - /** -* Inclination first derivative [rad/s] + * Inclination first derivative [rad/s] */ double inc_dot; - /** -* Polynomial clock correction coefficient (clock bias) [s] + * Polynomial clock correction coefficient (clock bias) [s] */ double af0; - /** -* Polynomial clock correction coefficient (clock drift) [s/s] + * Polynomial clock correction coefficient (clock drift) [s/s] */ double af1; - /** -* Polynomial clock correction coefficient (rate of clock drift) [s/s^2] + * Polynomial clock correction coefficient (rate of clock drift) [s/s^2] */ double af2; - /** -* Time of week [s] + * Time of week [s] */ double toe_tow; - /** -* Week number [week] + * Week number [week] */ u16 toe_wn; - /** -* Clock reference time of week [s] + * Clock reference time of week [s] */ double toc_tow; - /** -* Clock reference week number [week] + * Clock reference week number [week] */ u16 toc_wn; - /** -* Is valid? + * Is valid? */ u8 valid; - /** -* Satellite is healthy? + * Satellite is healthy? */ u8 healthy; - /** -* GNSS signal identifier + * GNSS signal identifier */ sbp_gnss_signal_dep_t sid; - /** -* Issue of ephemeris data + * Issue of ephemeris data */ u8 iode; - /** -* Issue of clock data + * Issue of clock data */ u16 iodc; - /** -* Reserved field + * Reserved field */ u32 reserved; } sbp_msg_ephemeris_dep_d_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_dep_d_t * * @param msg sbp_msg_ephemeris_dep_d_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_dep_d_encoded_len(const sbp_msg_ephemeris_dep_d_t *msg) -{ +static inline size_t sbp_msg_ephemeris_dep_d_encoded_len( + const sbp_msg_ephemeris_dep_d_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_DEP_D_ENCODED_LEN; } @@ -237,36 +209,53 @@ static inline size_t sbp_msg_ephemeris_dep_d_encoded_len(const sbp_msg_ephemeris /** * Encode an instance of sbp_msg_ephemeris_dep_d_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_dep_d_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_dep_d_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_dep_d_t *msg); +SBP_EXPORT s8 +sbp_msg_ephemeris_dep_d_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_dep_d_t *msg); /** * Decode an instance of sbp_msg_ephemeris_dep_d_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_dep_d_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ephemeris_dep_d_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_dep_d_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_dep_d_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_dep_d_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_dep_d_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_dep_d_t *msg); /** * Send an instance of sbp_msg_ephemeris_dep_d_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_dep_d_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_dep_d_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -274,51 +263,61 @@ SBP_EXPORT s8 sbp_msg_ephemeris_dep_d_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_dep_d_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_dep_d_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_dep_d_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_dep_d_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_dep_d_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_dep_d_t instance * @param b sbp_msg_ephemeris_dep_d_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_dep_d_cmp(const sbp_msg_ephemeris_dep_d_t *a, const sbp_msg_ephemeris_dep_d_t *b); +SBP_EXPORT int sbp_msg_ephemeris_dep_d_cmp(const sbp_msg_ephemeris_dep_d_t *a, + const sbp_msg_ephemeris_dep_d_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_dep_d_t &lhs, const sbp_msg_ephemeris_dep_d_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_dep_d_t &lhs, + const sbp_msg_ephemeris_dep_d_t &rhs) { return sbp_msg_ephemeris_dep_d_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_dep_d_t &lhs, const sbp_msg_ephemeris_dep_d_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_dep_d_t &lhs, + const sbp_msg_ephemeris_dep_d_t &rhs) { return sbp_msg_ephemeris_dep_d_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_dep_d_t &lhs, const sbp_msg_ephemeris_dep_d_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_dep_d_t &lhs, + const sbp_msg_ephemeris_dep_d_t &rhs) { return sbp_msg_ephemeris_dep_d_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_dep_d_t &lhs, const sbp_msg_ephemeris_dep_d_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_dep_d_t &lhs, + const sbp_msg_ephemeris_dep_d_t &rhs) { return sbp_msg_ephemeris_dep_d_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_dep_d_t &lhs, const sbp_msg_ephemeris_dep_d_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_dep_d_t &lhs, + const sbp_msg_ephemeris_dep_d_t &rhs) { return sbp_msg_ephemeris_dep_d_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_dep_d_t &lhs, const sbp_msg_ephemeris_dep_d_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_dep_d_t &lhs, + const sbp_msg_ephemeris_dep_d_t &rhs) { return sbp_msg_ephemeris_dep_d_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_DEP_D_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_GAL.h b/c/include/libsbp/observation/MSG_EPHEMERIS_GAL.h index ba238ecb0..ef49111d2 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_GAL.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_GAL.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_GAL_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_GAL_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,171 +42,150 @@ *****************************************************************************/ /** Satellite broadcast ephemeris for Galileo * -* The ephemeris message returns a set of satellite orbit parameters that is used to calculate Galileo satellite position, velocity, and clock offset. Please see the Signal In Space ICD OS SIS ICD, Issue 1.3, December 2016 for more details. + * The ephemeris message returns a set of satellite orbit parameters that is + * used to calculate Galileo satellite position, velocity, and clock offset. + * Please see the Signal In Space ICD OS SIS ICD, Issue 1.3, December 2016 for + * more details. */ typedef struct { - - /** -* Values common for all ephemeris types + * Values common for all ephemeris types */ sbp_ephemeris_common_content_t common; - /** -* E1-E5a Broadcast Group Delay [s] + * E1-E5a Broadcast Group Delay [s] */ float bgd_e1e5a; - /** -* E1-E5b Broadcast Group Delay [s] + * E1-E5b Broadcast Group Delay [s] */ float bgd_e1e5b; - /** -* Amplitude of the sine harmonic correction term to the orbit radius [m] + * Amplitude of the sine harmonic correction term to the orbit radius [m] */ float c_rs; - /** -* Amplitude of the cosine harmonic correction term to the orbit radius [m] + * Amplitude of the cosine harmonic correction term to the orbit radius [m] */ float c_rc; - /** -* Amplitude of the cosine harmonic correction term to the argument of latitude [rad] + * Amplitude of the cosine harmonic correction term to the argument of + * latitude [rad] */ float c_uc; - /** -* Amplitude of the sine harmonic correction term to the argument of latitude [rad] + * Amplitude of the sine harmonic correction term to the argument of latitude + * [rad] */ float c_us; - /** -* Amplitude of the cosine harmonic correction term to the angle of inclination [rad] + * Amplitude of the cosine harmonic correction term to the angle of + * inclination [rad] */ float c_ic; - /** -* Amplitude of the sine harmonic correction term to the angle of inclination [rad] + * Amplitude of the sine harmonic correction term to the angle of inclination + * [rad] */ float c_is; - /** -* Mean motion difference [rad/s] + * Mean motion difference [rad/s] */ double dn; - /** -* Mean anomaly at reference time [rad] + * Mean anomaly at reference time [rad] */ double m0; - /** -* Eccentricity of satellite orbit + * Eccentricity of satellite orbit */ double ecc; - /** -* Square root of the semi-major axis of orbit [m^(1/2)] + * Square root of the semi-major axis of orbit [m^(1/2)] */ double sqrta; - /** -* Longitude of ascending node of orbit plane at weekly epoch [rad] + * Longitude of ascending node of orbit plane at weekly epoch [rad] */ double omega0; - /** -* Rate of right ascension [rad/s] + * Rate of right ascension [rad/s] */ double omegadot; - /** -* Argument of perigee [rad] + * Argument of perigee [rad] */ double w; - /** -* Inclination [rad] + * Inclination [rad] */ double inc; - /** -* Inclination first derivative [rad/s] + * Inclination first derivative [rad/s] */ double inc_dot; - /** -* Polynomial clock correction coefficient (clock bias) [s] + * Polynomial clock correction coefficient (clock bias) [s] */ double af0; - /** -* Polynomial clock correction coefficient (clock drift) [s/s] + * Polynomial clock correction coefficient (clock drift) [s/s] */ double af1; - /** -* Polynomial clock correction coefficient (rate of clock drift) [s/s^2] + * Polynomial clock correction coefficient (rate of clock drift) [s/s^2] */ float af2; - /** -* Clock reference + * Clock reference */ sbp_gps_time_sec_t toc; - /** -* Issue of data (IODnav) + * Issue of data (IODnav) */ u16 iode; - /** -* Issue of data (IODnav). Always equal to iode + * Issue of data (IODnav). Always equal to iode */ u16 iodc; - /** -* 0=I/NAV, 1=F/NAV + * 0=I/NAV, 1=F/NAV */ u8 source; } sbp_msg_ephemeris_gal_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_gal_t * * @param msg sbp_msg_ephemeris_gal_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_gal_encoded_len(const sbp_msg_ephemeris_gal_t *msg) -{ +static inline size_t sbp_msg_ephemeris_gal_encoded_len( + const sbp_msg_ephemeris_gal_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_GAL_ENCODED_LEN; } @@ -214,36 +193,53 @@ static inline size_t sbp_msg_ephemeris_gal_encoded_len(const sbp_msg_ephemeris_g /** * Encode an instance of sbp_msg_ephemeris_gal_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_gal_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_gal_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_gal_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_gal_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_ephemeris_gal_t *msg); /** * Decode an instance of sbp_msg_ephemeris_gal_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_gal_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ephemeris_gal_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_gal_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_gal_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_gal_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_gal_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_gal_t *msg); /** * Send an instance of sbp_msg_ephemeris_gal_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_gal_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_gal_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -251,51 +247,61 @@ SBP_EXPORT s8 sbp_msg_ephemeris_gal_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_gal_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_gal_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_gal_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_gal_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_gal_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_gal_t instance * @param b sbp_msg_ephemeris_gal_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_gal_cmp(const sbp_msg_ephemeris_gal_t *a, const sbp_msg_ephemeris_gal_t *b); +SBP_EXPORT int sbp_msg_ephemeris_gal_cmp(const sbp_msg_ephemeris_gal_t *a, + const sbp_msg_ephemeris_gal_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_gal_t &lhs, const sbp_msg_ephemeris_gal_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_gal_t &lhs, + const sbp_msg_ephemeris_gal_t &rhs) { return sbp_msg_ephemeris_gal_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_gal_t &lhs, const sbp_msg_ephemeris_gal_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_gal_t &lhs, + const sbp_msg_ephemeris_gal_t &rhs) { return sbp_msg_ephemeris_gal_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_gal_t &lhs, const sbp_msg_ephemeris_gal_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_gal_t &lhs, + const sbp_msg_ephemeris_gal_t &rhs) { return sbp_msg_ephemeris_gal_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_gal_t &lhs, const sbp_msg_ephemeris_gal_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_gal_t &lhs, + const sbp_msg_ephemeris_gal_t &rhs) { return sbp_msg_ephemeris_gal_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_gal_t &lhs, const sbp_msg_ephemeris_gal_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_gal_t &lhs, + const sbp_msg_ephemeris_gal_t &rhs) { return sbp_msg_ephemeris_gal_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_gal_t &lhs, const sbp_msg_ephemeris_gal_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_gal_t &lhs, + const sbp_msg_ephemeris_gal_t &rhs) { return sbp_msg_ephemeris_gal_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_GAL_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_GAL_DEP_A.h b/c/include/libsbp/observation/MSG_EPHEMERIS_GAL_DEP_A.h index aca772cd9..666ac0e40 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_GAL_DEP_A.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_GAL_DEP_A.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_GAL_DEP_A_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_GAL_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,165 +42,142 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Values common for all ephemeris types + * Values common for all ephemeris types */ sbp_ephemeris_common_content_t common; - /** -* E1-E5a Broadcast Group Delay [s] + * E1-E5a Broadcast Group Delay [s] */ float bgd_e1e5a; - /** -* E1-E5b Broadcast Group Delay [s] + * E1-E5b Broadcast Group Delay [s] */ float bgd_e1e5b; - /** -* Amplitude of the sine harmonic correction term to the orbit radius [m] + * Amplitude of the sine harmonic correction term to the orbit radius [m] */ float c_rs; - /** -* Amplitude of the cosine harmonic correction term to the orbit radius [m] + * Amplitude of the cosine harmonic correction term to the orbit radius [m] */ float c_rc; - /** -* Amplitude of the cosine harmonic correction term to the argument of latitude [rad] + * Amplitude of the cosine harmonic correction term to the argument of + * latitude [rad] */ float c_uc; - /** -* Amplitude of the sine harmonic correction term to the argument of latitude [rad] + * Amplitude of the sine harmonic correction term to the argument of latitude + * [rad] */ float c_us; - /** -* Amplitude of the cosine harmonic correction term to the angle of inclination [rad] + * Amplitude of the cosine harmonic correction term to the angle of + * inclination [rad] */ float c_ic; - /** -* Amplitude of the sine harmonic correction term to the angle of inclination [rad] + * Amplitude of the sine harmonic correction term to the angle of inclination + * [rad] */ float c_is; - /** -* Mean motion difference [rad/s] + * Mean motion difference [rad/s] */ double dn; - /** -* Mean anomaly at reference time [rad] + * Mean anomaly at reference time [rad] */ double m0; - /** -* Eccentricity of satellite orbit + * Eccentricity of satellite orbit */ double ecc; - /** -* Square root of the semi-major axis of orbit [m^(1/2)] + * Square root of the semi-major axis of orbit [m^(1/2)] */ double sqrta; - /** -* Longitude of ascending node of orbit plane at weekly epoch [rad] + * Longitude of ascending node of orbit plane at weekly epoch [rad] */ double omega0; - /** -* Rate of right ascension [rad/s] + * Rate of right ascension [rad/s] */ double omegadot; - /** -* Argument of perigee [rad] + * Argument of perigee [rad] */ double w; - /** -* Inclination [rad] + * Inclination [rad] */ double inc; - /** -* Inclination first derivative [rad/s] + * Inclination first derivative [rad/s] */ double inc_dot; - /** -* Polynomial clock correction coefficient (clock bias) [s] + * Polynomial clock correction coefficient (clock bias) [s] */ double af0; - /** -* Polynomial clock correction coefficient (clock drift) [s/s] + * Polynomial clock correction coefficient (clock drift) [s/s] */ double af1; - /** -* Polynomial clock correction coefficient (rate of clock drift) [s/s^2] + * Polynomial clock correction coefficient (rate of clock drift) [s/s^2] */ float af2; - /** -* Clock reference + * Clock reference */ sbp_gps_time_sec_t toc; - /** -* Issue of data (IODnav) + * Issue of data (IODnav) */ u16 iode; - /** -* Issue of data (IODnav). Always equal to iode + * Issue of data (IODnav). Always equal to iode */ u16 iodc; } sbp_msg_ephemeris_gal_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_gal_dep_a_t * * @param msg sbp_msg_ephemeris_gal_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_gal_dep_a_encoded_len(const sbp_msg_ephemeris_gal_dep_a_t *msg) -{ +static inline size_t sbp_msg_ephemeris_gal_dep_a_encoded_len( + const sbp_msg_ephemeris_gal_dep_a_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_GAL_DEP_A_ENCODED_LEN; } @@ -208,36 +185,54 @@ static inline size_t sbp_msg_ephemeris_gal_dep_a_encoded_len(const sbp_msg_ephem /** * Encode an instance of sbp_msg_ephemeris_gal_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_gal_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_gal_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_gal_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_gal_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_gal_dep_a_t *msg); /** * Decode an instance of sbp_msg_ephemeris_gal_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_gal_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ephemeris_gal_dep_a_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_gal_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_gal_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_gal_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_gal_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_gal_dep_a_t *msg); /** - * Send an instance of sbp_msg_ephemeris_gal_dep_a_t with the given write function + * Send an instance of sbp_msg_ephemeris_gal_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_gal_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_gal_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -245,51 +240,62 @@ SBP_EXPORT s8 sbp_msg_ephemeris_gal_dep_a_decode(const uint8_t *buf, uint8_t len * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_gal_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_gal_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_gal_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_gal_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_gal_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_gal_dep_a_t instance * @param b sbp_msg_ephemeris_gal_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_gal_dep_a_cmp(const sbp_msg_ephemeris_gal_dep_a_t *a, const sbp_msg_ephemeris_gal_dep_a_t *b); +SBP_EXPORT int sbp_msg_ephemeris_gal_dep_a_cmp( + const sbp_msg_ephemeris_gal_dep_a_t *a, + const sbp_msg_ephemeris_gal_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_gal_dep_a_t &lhs, const sbp_msg_ephemeris_gal_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_gal_dep_a_t &lhs, + const sbp_msg_ephemeris_gal_dep_a_t &rhs) { return sbp_msg_ephemeris_gal_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_gal_dep_a_t &lhs, const sbp_msg_ephemeris_gal_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_gal_dep_a_t &lhs, + const sbp_msg_ephemeris_gal_dep_a_t &rhs) { return sbp_msg_ephemeris_gal_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_gal_dep_a_t &lhs, const sbp_msg_ephemeris_gal_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_gal_dep_a_t &lhs, + const sbp_msg_ephemeris_gal_dep_a_t &rhs) { return sbp_msg_ephemeris_gal_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_gal_dep_a_t &lhs, const sbp_msg_ephemeris_gal_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_gal_dep_a_t &lhs, + const sbp_msg_ephemeris_gal_dep_a_t &rhs) { return sbp_msg_ephemeris_gal_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_gal_dep_a_t &lhs, const sbp_msg_ephemeris_gal_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_gal_dep_a_t &lhs, + const sbp_msg_ephemeris_gal_dep_a_t &rhs) { return sbp_msg_ephemeris_gal_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_gal_dep_a_t &lhs, const sbp_msg_ephemeris_gal_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_gal_dep_a_t &lhs, + const sbp_msg_ephemeris_gal_dep_a_t &rhs) { return sbp_msg_ephemeris_gal_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_GAL_DEP_A_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_GLO.h b/c/include/libsbp/observation/MSG_EPHEMERIS_GLO.h index ae53a6266..fb73731d9 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_GLO.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_GLO.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_GLO_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_GLO_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,75 +41,66 @@ *****************************************************************************/ /** Satellite broadcast ephemeris for GLO * -* The ephemeris message returns a set of satellite orbit parameters that is used to calculate GLO satellite position, velocity, and clock offset. Please see the GLO ICD 5.1 "Table 4.5 Characteristics of words of immediate information (ephemeris parameters)" for more details. + * The ephemeris message returns a set of satellite orbit parameters that is + * used to calculate GLO satellite position, velocity, and clock offset. Please + * see the GLO ICD 5.1 "Table 4.5 Characteristics of words of immediate + * information (ephemeris parameters)" for more details. */ typedef struct { - - /** -* Values common for all ephemeris types + * Values common for all ephemeris types */ sbp_ephemeris_common_content_t common; - /** -* Relative deviation of predicted carrier frequency from nominal + * Relative deviation of predicted carrier frequency from nominal */ float gamma; - /** -* Correction to the SV time [s] + * Correction to the SV time [s] */ float tau; - /** -* Equipment delay between L1 and L2 [s] + * Equipment delay between L1 and L2 [s] */ float d_tau; - /** -* Position of the SV at tb in PZ-90.02 coordinates system [m] + * Position of the SV at tb in PZ-90.02 coordinates system [m] */ double pos[SBP_MSG_EPHEMERIS_GLO_POS_MAX]; - /** -* Velocity vector of the SV at tb in PZ-90.02 coordinates system [m/s] + * Velocity vector of the SV at tb in PZ-90.02 coordinates system [m/s] */ double vel[SBP_MSG_EPHEMERIS_GLO_VEL_MAX]; - /** -* Acceleration vector of the SV at tb in PZ-90.02 coordinates sys [m/s^2] + * Acceleration vector of the SV at tb in PZ-90.02 coordinates sys [m/s^2] */ float acc[SBP_MSG_EPHEMERIS_GLO_ACC_MAX]; - /** -* Frequency slot. FCN+8 (that is [1..14]). 0 or 0xFF for invalid + * Frequency slot. FCN+8 (that is [1..14]). 0 or 0xFF for invalid */ u8 fcn; - /** -* Issue of data. Equal to the 7 bits of the immediate data word t_b + * Issue of data. Equal to the 7 bits of the immediate data word t_b */ u8 iod; } sbp_msg_ephemeris_glo_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_glo_t * * @param msg sbp_msg_ephemeris_glo_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_glo_encoded_len(const sbp_msg_ephemeris_glo_t *msg) -{ +static inline size_t sbp_msg_ephemeris_glo_encoded_len( + const sbp_msg_ephemeris_glo_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_GLO_ENCODED_LEN; } @@ -117,36 +108,53 @@ static inline size_t sbp_msg_ephemeris_glo_encoded_len(const sbp_msg_ephemeris_g /** * Encode an instance of sbp_msg_ephemeris_glo_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_glo_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_glo_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_glo_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_glo_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_ephemeris_glo_t *msg); /** * Decode an instance of sbp_msg_ephemeris_glo_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_glo_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ephemeris_glo_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_glo_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_glo_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_glo_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_glo_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_glo_t *msg); /** * Send an instance of sbp_msg_ephemeris_glo_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_glo_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_glo_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -154,51 +162,61 @@ SBP_EXPORT s8 sbp_msg_ephemeris_glo_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_glo_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_glo_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_glo_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_glo_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_glo_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_glo_t instance * @param b sbp_msg_ephemeris_glo_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_glo_cmp(const sbp_msg_ephemeris_glo_t *a, const sbp_msg_ephemeris_glo_t *b); +SBP_EXPORT int sbp_msg_ephemeris_glo_cmp(const sbp_msg_ephemeris_glo_t *a, + const sbp_msg_ephemeris_glo_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_glo_t &lhs, const sbp_msg_ephemeris_glo_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_glo_t &lhs, + const sbp_msg_ephemeris_glo_t &rhs) { return sbp_msg_ephemeris_glo_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_glo_t &lhs, const sbp_msg_ephemeris_glo_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_glo_t &lhs, + const sbp_msg_ephemeris_glo_t &rhs) { return sbp_msg_ephemeris_glo_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_glo_t &lhs, const sbp_msg_ephemeris_glo_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_glo_t &lhs, + const sbp_msg_ephemeris_glo_t &rhs) { return sbp_msg_ephemeris_glo_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_glo_t &lhs, const sbp_msg_ephemeris_glo_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_glo_t &lhs, + const sbp_msg_ephemeris_glo_t &rhs) { return sbp_msg_ephemeris_glo_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_glo_t &lhs, const sbp_msg_ephemeris_glo_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_glo_t &lhs, + const sbp_msg_ephemeris_glo_t &rhs) { return sbp_msg_ephemeris_glo_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_glo_t &lhs, const sbp_msg_ephemeris_glo_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_glo_t &lhs, + const sbp_msg_ephemeris_glo_t &rhs) { return sbp_msg_ephemeris_glo_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_GLO_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_A.h b/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_A.h index 6e280a73b..8ef399da8 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_A.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_A.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_GLO_DEP_A_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_GLO_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,57 +41,48 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Values common for all ephemeris types + * Values common for all ephemeris types */ sbp_ephemeris_common_content_dep_a_t common; - /** -* Relative deviation of predicted carrier frequency from nominal + * Relative deviation of predicted carrier frequency from nominal */ double gamma; - /** -* Correction to the SV time [s] + * Correction to the SV time [s] */ double tau; - /** -* Position of the SV at tb in PZ-90.02 coordinates system [m] + * Position of the SV at tb in PZ-90.02 coordinates system [m] */ double pos[SBP_MSG_EPHEMERIS_GLO_DEP_A_POS_MAX]; - /** -* Velocity vector of the SV at tb in PZ-90.02 coordinates system [m/s] + * Velocity vector of the SV at tb in PZ-90.02 coordinates system [m/s] */ double vel[SBP_MSG_EPHEMERIS_GLO_DEP_A_VEL_MAX]; - /** -* Acceleration vector of the SV at tb in PZ-90.02 coordinates sys [m/s^2] + * Acceleration vector of the SV at tb in PZ-90.02 coordinates sys [m/s^2] */ double acc[SBP_MSG_EPHEMERIS_GLO_DEP_A_ACC_MAX]; } sbp_msg_ephemeris_glo_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_glo_dep_a_t * * @param msg sbp_msg_ephemeris_glo_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_glo_dep_a_encoded_len(const sbp_msg_ephemeris_glo_dep_a_t *msg) -{ +static inline size_t sbp_msg_ephemeris_glo_dep_a_encoded_len( + const sbp_msg_ephemeris_glo_dep_a_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_GLO_DEP_A_ENCODED_LEN; } @@ -99,36 +90,54 @@ static inline size_t sbp_msg_ephemeris_glo_dep_a_encoded_len(const sbp_msg_ephem /** * Encode an instance of sbp_msg_ephemeris_glo_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_glo_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_glo_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_glo_dep_a_t *msg); /** * Decode an instance of sbp_msg_ephemeris_glo_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_glo_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ephemeris_glo_dep_a_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_glo_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_glo_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_glo_dep_a_t *msg); /** - * Send an instance of sbp_msg_ephemeris_glo_dep_a_t with the given write function + * Send an instance of sbp_msg_ephemeris_glo_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_glo_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_glo_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -136,51 +145,62 @@ SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_a_decode(const uint8_t *buf, uint8_t len * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_glo_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_glo_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_glo_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_glo_dep_a_t instance * @param b sbp_msg_ephemeris_glo_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_glo_dep_a_cmp(const sbp_msg_ephemeris_glo_dep_a_t *a, const sbp_msg_ephemeris_glo_dep_a_t *b); +SBP_EXPORT int sbp_msg_ephemeris_glo_dep_a_cmp( + const sbp_msg_ephemeris_glo_dep_a_t *a, + const sbp_msg_ephemeris_glo_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_glo_dep_a_t &lhs, const sbp_msg_ephemeris_glo_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_glo_dep_a_t &lhs, + const sbp_msg_ephemeris_glo_dep_a_t &rhs) { return sbp_msg_ephemeris_glo_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_glo_dep_a_t &lhs, const sbp_msg_ephemeris_glo_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_glo_dep_a_t &lhs, + const sbp_msg_ephemeris_glo_dep_a_t &rhs) { return sbp_msg_ephemeris_glo_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_glo_dep_a_t &lhs, const sbp_msg_ephemeris_glo_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_glo_dep_a_t &lhs, + const sbp_msg_ephemeris_glo_dep_a_t &rhs) { return sbp_msg_ephemeris_glo_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_glo_dep_a_t &lhs, const sbp_msg_ephemeris_glo_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_glo_dep_a_t &lhs, + const sbp_msg_ephemeris_glo_dep_a_t &rhs) { return sbp_msg_ephemeris_glo_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_glo_dep_a_t &lhs, const sbp_msg_ephemeris_glo_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_glo_dep_a_t &lhs, + const sbp_msg_ephemeris_glo_dep_a_t &rhs) { return sbp_msg_ephemeris_glo_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_glo_dep_a_t &lhs, const sbp_msg_ephemeris_glo_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_glo_dep_a_t &lhs, + const sbp_msg_ephemeris_glo_dep_a_t &rhs) { return sbp_msg_ephemeris_glo_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_GLO_DEP_A_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_B.h b/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_B.h index c75da085d..f3a7b852c 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_B.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_B.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_GLO_DEP_B_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_GLO_DEP_B_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,57 +41,48 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Values common for all ephemeris types + * Values common for all ephemeris types */ sbp_ephemeris_common_content_dep_b_t common; - /** -* Relative deviation of predicted carrier frequency from nominal + * Relative deviation of predicted carrier frequency from nominal */ double gamma; - /** -* Correction to the SV time [s] + * Correction to the SV time [s] */ double tau; - /** -* Position of the SV at tb in PZ-90.02 coordinates system [m] + * Position of the SV at tb in PZ-90.02 coordinates system [m] */ double pos[SBP_MSG_EPHEMERIS_GLO_DEP_B_POS_MAX]; - /** -* Velocity vector of the SV at tb in PZ-90.02 coordinates system [m/s] + * Velocity vector of the SV at tb in PZ-90.02 coordinates system [m/s] */ double vel[SBP_MSG_EPHEMERIS_GLO_DEP_B_VEL_MAX]; - /** -* Acceleration vector of the SV at tb in PZ-90.02 coordinates sys [m/s^2] + * Acceleration vector of the SV at tb in PZ-90.02 coordinates sys [m/s^2] */ double acc[SBP_MSG_EPHEMERIS_GLO_DEP_B_ACC_MAX]; } sbp_msg_ephemeris_glo_dep_b_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_glo_dep_b_t * * @param msg sbp_msg_ephemeris_glo_dep_b_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_glo_dep_b_encoded_len(const sbp_msg_ephemeris_glo_dep_b_t *msg) -{ +static inline size_t sbp_msg_ephemeris_glo_dep_b_encoded_len( + const sbp_msg_ephemeris_glo_dep_b_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_GLO_DEP_B_ENCODED_LEN; } @@ -99,36 +90,54 @@ static inline size_t sbp_msg_ephemeris_glo_dep_b_encoded_len(const sbp_msg_ephem /** * Encode an instance of sbp_msg_ephemeris_glo_dep_b_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_glo_dep_b_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_glo_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_glo_dep_b_t *msg); /** * Decode an instance of sbp_msg_ephemeris_glo_dep_b_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_glo_dep_b_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ephemeris_glo_dep_b_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_glo_dep_b_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_glo_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_glo_dep_b_t *msg); /** - * Send an instance of sbp_msg_ephemeris_glo_dep_b_t with the given write function + * Send an instance of sbp_msg_ephemeris_glo_dep_b_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_glo_dep_b_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_glo_dep_b_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -136,51 +145,62 @@ SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_b_decode(const uint8_t *buf, uint8_t len * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_glo_dep_b_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_b_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_glo_dep_b_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_glo_dep_b_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_glo_dep_b_t instance * @param b sbp_msg_ephemeris_glo_dep_b_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_glo_dep_b_cmp(const sbp_msg_ephemeris_glo_dep_b_t *a, const sbp_msg_ephemeris_glo_dep_b_t *b); +SBP_EXPORT int sbp_msg_ephemeris_glo_dep_b_cmp( + const sbp_msg_ephemeris_glo_dep_b_t *a, + const sbp_msg_ephemeris_glo_dep_b_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_glo_dep_b_t &lhs, const sbp_msg_ephemeris_glo_dep_b_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_glo_dep_b_t &lhs, + const sbp_msg_ephemeris_glo_dep_b_t &rhs) { return sbp_msg_ephemeris_glo_dep_b_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_glo_dep_b_t &lhs, const sbp_msg_ephemeris_glo_dep_b_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_glo_dep_b_t &lhs, + const sbp_msg_ephemeris_glo_dep_b_t &rhs) { return sbp_msg_ephemeris_glo_dep_b_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_glo_dep_b_t &lhs, const sbp_msg_ephemeris_glo_dep_b_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_glo_dep_b_t &lhs, + const sbp_msg_ephemeris_glo_dep_b_t &rhs) { return sbp_msg_ephemeris_glo_dep_b_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_glo_dep_b_t &lhs, const sbp_msg_ephemeris_glo_dep_b_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_glo_dep_b_t &lhs, + const sbp_msg_ephemeris_glo_dep_b_t &rhs) { return sbp_msg_ephemeris_glo_dep_b_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_glo_dep_b_t &lhs, const sbp_msg_ephemeris_glo_dep_b_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_glo_dep_b_t &lhs, + const sbp_msg_ephemeris_glo_dep_b_t &rhs) { return sbp_msg_ephemeris_glo_dep_b_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_glo_dep_b_t &lhs, const sbp_msg_ephemeris_glo_dep_b_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_glo_dep_b_t &lhs, + const sbp_msg_ephemeris_glo_dep_b_t &rhs) { return sbp_msg_ephemeris_glo_dep_b_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_GLO_DEP_B_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_C.h b/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_C.h index bb9a9f487..5402b5588 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_C.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_C.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_GLO_DEP_C_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_GLO_DEP_C_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,69 +41,61 @@ *****************************************************************************/ /** Deprecated * -* The ephemeris message returns a set of satellite orbit parameters that is used to calculate GLO satellite position, velocity, and clock offset. Please see the GLO ICD 5.1 "Table 4.5 Characteristics of words of immediate information (ephemeris parameters)" for more details. + * The ephemeris message returns a set of satellite orbit parameters that is + * used to calculate GLO satellite position, velocity, and clock offset. Please + * see the GLO ICD 5.1 "Table 4.5 Characteristics of words of immediate + * information (ephemeris parameters)" for more details. */ typedef struct { - - /** -* Values common for all ephemeris types + * Values common for all ephemeris types */ sbp_ephemeris_common_content_dep_b_t common; - /** -* Relative deviation of predicted carrier frequency from nominal + * Relative deviation of predicted carrier frequency from nominal */ double gamma; - /** -* Correction to the SV time [s] + * Correction to the SV time [s] */ double tau; - /** -* Equipment delay between L1 and L2 [s] + * Equipment delay between L1 and L2 [s] */ double d_tau; - /** -* Position of the SV at tb in PZ-90.02 coordinates system [m] + * Position of the SV at tb in PZ-90.02 coordinates system [m] */ double pos[SBP_MSG_EPHEMERIS_GLO_DEP_C_POS_MAX]; - /** -* Velocity vector of the SV at tb in PZ-90.02 coordinates system [m/s] + * Velocity vector of the SV at tb in PZ-90.02 coordinates system [m/s] */ double vel[SBP_MSG_EPHEMERIS_GLO_DEP_C_VEL_MAX]; - /** -* Acceleration vector of the SV at tb in PZ-90.02 coordinates sys [m/s^2] + * Acceleration vector of the SV at tb in PZ-90.02 coordinates sys [m/s^2] */ double acc[SBP_MSG_EPHEMERIS_GLO_DEP_C_ACC_MAX]; - /** -* Frequency slot. FCN+8 (that is [1..14]). 0 or 0xFF for invalid + * Frequency slot. FCN+8 (that is [1..14]). 0 or 0xFF for invalid */ u8 fcn; } sbp_msg_ephemeris_glo_dep_c_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_glo_dep_c_t * * @param msg sbp_msg_ephemeris_glo_dep_c_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_glo_dep_c_encoded_len(const sbp_msg_ephemeris_glo_dep_c_t *msg) -{ +static inline size_t sbp_msg_ephemeris_glo_dep_c_encoded_len( + const sbp_msg_ephemeris_glo_dep_c_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_GLO_DEP_C_ENCODED_LEN; } @@ -111,36 +103,54 @@ static inline size_t sbp_msg_ephemeris_glo_dep_c_encoded_len(const sbp_msg_ephem /** * Encode an instance of sbp_msg_ephemeris_glo_dep_c_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_glo_dep_c_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_glo_dep_c_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_c_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_glo_dep_c_t *msg); /** * Decode an instance of sbp_msg_ephemeris_glo_dep_c_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_glo_dep_c_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ephemeris_glo_dep_c_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_glo_dep_c_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_glo_dep_c_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_c_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_glo_dep_c_t *msg); /** - * Send an instance of sbp_msg_ephemeris_glo_dep_c_t with the given write function + * Send an instance of sbp_msg_ephemeris_glo_dep_c_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_glo_dep_c_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_glo_dep_c_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -148,51 +158,62 @@ SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_c_decode(const uint8_t *buf, uint8_t len * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_c_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_glo_dep_c_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_c_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_glo_dep_c_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_glo_dep_c_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_glo_dep_c_t instance * @param b sbp_msg_ephemeris_glo_dep_c_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_glo_dep_c_cmp(const sbp_msg_ephemeris_glo_dep_c_t *a, const sbp_msg_ephemeris_glo_dep_c_t *b); +SBP_EXPORT int sbp_msg_ephemeris_glo_dep_c_cmp( + const sbp_msg_ephemeris_glo_dep_c_t *a, + const sbp_msg_ephemeris_glo_dep_c_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_glo_dep_c_t &lhs, const sbp_msg_ephemeris_glo_dep_c_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_glo_dep_c_t &lhs, + const sbp_msg_ephemeris_glo_dep_c_t &rhs) { return sbp_msg_ephemeris_glo_dep_c_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_glo_dep_c_t &lhs, const sbp_msg_ephemeris_glo_dep_c_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_glo_dep_c_t &lhs, + const sbp_msg_ephemeris_glo_dep_c_t &rhs) { return sbp_msg_ephemeris_glo_dep_c_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_glo_dep_c_t &lhs, const sbp_msg_ephemeris_glo_dep_c_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_glo_dep_c_t &lhs, + const sbp_msg_ephemeris_glo_dep_c_t &rhs) { return sbp_msg_ephemeris_glo_dep_c_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_glo_dep_c_t &lhs, const sbp_msg_ephemeris_glo_dep_c_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_glo_dep_c_t &lhs, + const sbp_msg_ephemeris_glo_dep_c_t &rhs) { return sbp_msg_ephemeris_glo_dep_c_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_glo_dep_c_t &lhs, const sbp_msg_ephemeris_glo_dep_c_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_glo_dep_c_t &lhs, + const sbp_msg_ephemeris_glo_dep_c_t &rhs) { return sbp_msg_ephemeris_glo_dep_c_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_glo_dep_c_t &lhs, const sbp_msg_ephemeris_glo_dep_c_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_glo_dep_c_t &lhs, + const sbp_msg_ephemeris_glo_dep_c_t &rhs) { return sbp_msg_ephemeris_glo_dep_c_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_GLO_DEP_C_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_D.h b/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_D.h index 604b95f32..1dc2f9e09 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_D.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_GLO_DEP_D.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_GLO_DEP_D_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_GLO_DEP_D_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,75 +41,64 @@ *****************************************************************************/ /** Deprecated * -* This observation message has been deprecated in favor of ephemeris message using floats for size reduction. + * This observation message has been deprecated in favor of ephemeris message + * using floats for size reduction. */ typedef struct { - - /** -* Values common for all ephemeris types + * Values common for all ephemeris types */ sbp_ephemeris_common_content_dep_b_t common; - /** -* Relative deviation of predicted carrier frequency from nominal + * Relative deviation of predicted carrier frequency from nominal */ double gamma; - /** -* Correction to the SV time [s] + * Correction to the SV time [s] */ double tau; - /** -* Equipment delay between L1 and L2 [s] + * Equipment delay between L1 and L2 [s] */ double d_tau; - /** -* Position of the SV at tb in PZ-90.02 coordinates system [m] + * Position of the SV at tb in PZ-90.02 coordinates system [m] */ double pos[SBP_MSG_EPHEMERIS_GLO_DEP_D_POS_MAX]; - /** -* Velocity vector of the SV at tb in PZ-90.02 coordinates system [m/s] + * Velocity vector of the SV at tb in PZ-90.02 coordinates system [m/s] */ double vel[SBP_MSG_EPHEMERIS_GLO_DEP_D_VEL_MAX]; - /** -* Acceleration vector of the SV at tb in PZ-90.02 coordinates sys [m/s^2] + * Acceleration vector of the SV at tb in PZ-90.02 coordinates sys [m/s^2] */ double acc[SBP_MSG_EPHEMERIS_GLO_DEP_D_ACC_MAX]; - /** -* Frequency slot. FCN+8 (that is [1..14]). 0 or 0xFF for invalid + * Frequency slot. FCN+8 (that is [1..14]). 0 or 0xFF for invalid */ u8 fcn; - /** -* Issue of data. Equal to the 7 bits of the immediate data word t_b + * Issue of data. Equal to the 7 bits of the immediate data word t_b */ u8 iod; } sbp_msg_ephemeris_glo_dep_d_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_glo_dep_d_t * * @param msg sbp_msg_ephemeris_glo_dep_d_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_glo_dep_d_encoded_len(const sbp_msg_ephemeris_glo_dep_d_t *msg) -{ +static inline size_t sbp_msg_ephemeris_glo_dep_d_encoded_len( + const sbp_msg_ephemeris_glo_dep_d_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_GLO_DEP_D_ENCODED_LEN; } @@ -117,36 +106,54 @@ static inline size_t sbp_msg_ephemeris_glo_dep_d_encoded_len(const sbp_msg_ephem /** * Encode an instance of sbp_msg_ephemeris_glo_dep_d_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_glo_dep_d_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_d_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_glo_dep_d_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_d_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_glo_dep_d_t *msg); /** * Decode an instance of sbp_msg_ephemeris_glo_dep_d_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_glo_dep_d_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ephemeris_glo_dep_d_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_glo_dep_d_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_d_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_glo_dep_d_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_d_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_glo_dep_d_t *msg); /** - * Send an instance of sbp_msg_ephemeris_glo_dep_d_t with the given write function + * Send an instance of sbp_msg_ephemeris_glo_dep_d_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_glo_dep_d_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_glo_dep_d_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -154,51 +161,62 @@ SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_d_decode(const uint8_t *buf, uint8_t len * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_d_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_glo_dep_d_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_glo_dep_d_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_glo_dep_d_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_glo_dep_d_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_glo_dep_d_t instance * @param b sbp_msg_ephemeris_glo_dep_d_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_glo_dep_d_cmp(const sbp_msg_ephemeris_glo_dep_d_t *a, const sbp_msg_ephemeris_glo_dep_d_t *b); +SBP_EXPORT int sbp_msg_ephemeris_glo_dep_d_cmp( + const sbp_msg_ephemeris_glo_dep_d_t *a, + const sbp_msg_ephemeris_glo_dep_d_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_glo_dep_d_t &lhs, const sbp_msg_ephemeris_glo_dep_d_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_glo_dep_d_t &lhs, + const sbp_msg_ephemeris_glo_dep_d_t &rhs) { return sbp_msg_ephemeris_glo_dep_d_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_glo_dep_d_t &lhs, const sbp_msg_ephemeris_glo_dep_d_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_glo_dep_d_t &lhs, + const sbp_msg_ephemeris_glo_dep_d_t &rhs) { return sbp_msg_ephemeris_glo_dep_d_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_glo_dep_d_t &lhs, const sbp_msg_ephemeris_glo_dep_d_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_glo_dep_d_t &lhs, + const sbp_msg_ephemeris_glo_dep_d_t &rhs) { return sbp_msg_ephemeris_glo_dep_d_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_glo_dep_d_t &lhs, const sbp_msg_ephemeris_glo_dep_d_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_glo_dep_d_t &lhs, + const sbp_msg_ephemeris_glo_dep_d_t &rhs) { return sbp_msg_ephemeris_glo_dep_d_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_glo_dep_d_t &lhs, const sbp_msg_ephemeris_glo_dep_d_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_glo_dep_d_t &lhs, + const sbp_msg_ephemeris_glo_dep_d_t &rhs) { return sbp_msg_ephemeris_glo_dep_d_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_glo_dep_d_t &lhs, const sbp_msg_ephemeris_glo_dep_d_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_glo_dep_d_t &lhs, + const sbp_msg_ephemeris_glo_dep_d_t &rhs) { return sbp_msg_ephemeris_glo_dep_d_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_GLO_DEP_D_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_GPS.h b/c/include/libsbp/observation/MSG_EPHEMERIS_GPS.h index 3617ef12e..abb8d0f44 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_GPS.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_GPS.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_GPS_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_GPS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,159 +42,140 @@ *****************************************************************************/ /** Satellite broadcast ephemeris for GPS * -* The ephemeris message returns a set of satellite orbit parameters that is used to calculate GPS satellite position, velocity, and clock offset. Please see the Navstar GPS Space Segment/Navigation user interfaces (ICD-GPS-200, Table 20-III) for more details. + * The ephemeris message returns a set of satellite orbit parameters that is + * used to calculate GPS satellite position, velocity, and clock offset. Please + * see the Navstar GPS Space Segment/Navigation user interfaces (ICD-GPS-200, + * Table 20-III) for more details. */ typedef struct { - - /** -* Values common for all ephemeris types + * Values common for all ephemeris types */ sbp_ephemeris_common_content_t common; - /** -* Group delay differential between L1 and L2 [s] + * Group delay differential between L1 and L2 [s] */ float tgd; - /** -* Amplitude of the sine harmonic correction term to the orbit radius [m] + * Amplitude of the sine harmonic correction term to the orbit radius [m] */ float c_rs; - /** -* Amplitude of the cosine harmonic correction term to the orbit radius [m] + * Amplitude of the cosine harmonic correction term to the orbit radius [m] */ float c_rc; - /** -* Amplitude of the cosine harmonic correction term to the argument of latitude [rad] + * Amplitude of the cosine harmonic correction term to the argument of + * latitude [rad] */ float c_uc; - /** -* Amplitude of the sine harmonic correction term to the argument of latitude [rad] + * Amplitude of the sine harmonic correction term to the argument of latitude + * [rad] */ float c_us; - /** -* Amplitude of the cosine harmonic correction term to the angle of inclination [rad] + * Amplitude of the cosine harmonic correction term to the angle of + * inclination [rad] */ float c_ic; - /** -* Amplitude of the sine harmonic correction term to the angle of inclination [rad] + * Amplitude of the sine harmonic correction term to the angle of inclination + * [rad] */ float c_is; - /** -* Mean motion difference [rad/s] + * Mean motion difference [rad/s] */ double dn; - /** -* Mean anomaly at reference time [rad] + * Mean anomaly at reference time [rad] */ double m0; - /** -* Eccentricity of satellite orbit + * Eccentricity of satellite orbit */ double ecc; - /** -* Square root of the semi-major axis of orbit [m^(1/2)] + * Square root of the semi-major axis of orbit [m^(1/2)] */ double sqrta; - /** -* Longitude of ascending node of orbit plane at weekly epoch [rad] + * Longitude of ascending node of orbit plane at weekly epoch [rad] */ double omega0; - /** -* Rate of right ascension [rad/s] + * Rate of right ascension [rad/s] */ double omegadot; - /** -* Argument of perigee [rad] + * Argument of perigee [rad] */ double w; - /** -* Inclination [rad] + * Inclination [rad] */ double inc; - /** -* Inclination first derivative [rad/s] + * Inclination first derivative [rad/s] */ double inc_dot; - /** -* Polynomial clock correction coefficient (clock bias) [s] + * Polynomial clock correction coefficient (clock bias) [s] */ float af0; - /** -* Polynomial clock correction coefficient (clock drift) [s/s] + * Polynomial clock correction coefficient (clock drift) [s/s] */ float af1; - /** -* Polynomial clock correction coefficient (rate of clock drift) [s/s^2] + * Polynomial clock correction coefficient (rate of clock drift) [s/s^2] */ float af2; - /** -* Clock reference + * Clock reference */ sbp_gps_time_sec_t toc; - /** -* Issue of ephemeris data + * Issue of ephemeris data */ u8 iode; - /** -* Issue of clock data + * Issue of clock data */ u16 iodc; } sbp_msg_ephemeris_gps_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_gps_t * * @param msg sbp_msg_ephemeris_gps_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_gps_encoded_len(const sbp_msg_ephemeris_gps_t *msg) -{ +static inline size_t sbp_msg_ephemeris_gps_encoded_len( + const sbp_msg_ephemeris_gps_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_GPS_ENCODED_LEN; } @@ -202,36 +183,53 @@ static inline size_t sbp_msg_ephemeris_gps_encoded_len(const sbp_msg_ephemeris_g /** * Encode an instance of sbp_msg_ephemeris_gps_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_gps_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_gps_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_gps_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_gps_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_ephemeris_gps_t *msg); /** * Decode an instance of sbp_msg_ephemeris_gps_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_gps_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ephemeris_gps_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_gps_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_gps_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_gps_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_gps_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_gps_t *msg); /** * Send an instance of sbp_msg_ephemeris_gps_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_gps_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_gps_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -239,51 +237,61 @@ SBP_EXPORT s8 sbp_msg_ephemeris_gps_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_gps_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_gps_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_gps_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_gps_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_gps_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_gps_t instance * @param b sbp_msg_ephemeris_gps_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_gps_cmp(const sbp_msg_ephemeris_gps_t *a, const sbp_msg_ephemeris_gps_t *b); +SBP_EXPORT int sbp_msg_ephemeris_gps_cmp(const sbp_msg_ephemeris_gps_t *a, + const sbp_msg_ephemeris_gps_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_gps_t &lhs, const sbp_msg_ephemeris_gps_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_gps_t &lhs, + const sbp_msg_ephemeris_gps_t &rhs) { return sbp_msg_ephemeris_gps_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_gps_t &lhs, const sbp_msg_ephemeris_gps_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_gps_t &lhs, + const sbp_msg_ephemeris_gps_t &rhs) { return sbp_msg_ephemeris_gps_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_gps_t &lhs, const sbp_msg_ephemeris_gps_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_gps_t &lhs, + const sbp_msg_ephemeris_gps_t &rhs) { return sbp_msg_ephemeris_gps_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_gps_t &lhs, const sbp_msg_ephemeris_gps_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_gps_t &lhs, + const sbp_msg_ephemeris_gps_t &rhs) { return sbp_msg_ephemeris_gps_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_gps_t &lhs, const sbp_msg_ephemeris_gps_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_gps_t &lhs, + const sbp_msg_ephemeris_gps_t &rhs) { return sbp_msg_ephemeris_gps_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_gps_t &lhs, const sbp_msg_ephemeris_gps_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_gps_t &lhs, + const sbp_msg_ephemeris_gps_t &rhs) { return sbp_msg_ephemeris_gps_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_GPS_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_GPS_DEP_E.h b/c/include/libsbp/observation/MSG_EPHEMERIS_GPS_DEP_E.h index 0a8f26db8..d3f1cf607 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_GPS_DEP_E.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_GPS_DEP_E.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_GPS_DEP_E_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_GPS_DEP_E_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,159 +42,137 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Values common for all ephemeris types + * Values common for all ephemeris types */ sbp_ephemeris_common_content_dep_a_t common; - /** -* Group delay differential between L1 and L2 [s] + * Group delay differential between L1 and L2 [s] */ double tgd; - /** -* Amplitude of the sine harmonic correction term to the orbit radius [m] + * Amplitude of the sine harmonic correction term to the orbit radius [m] */ double c_rs; - /** -* Amplitude of the cosine harmonic correction term to the orbit radius [m] + * Amplitude of the cosine harmonic correction term to the orbit radius [m] */ double c_rc; - /** -* Amplitude of the cosine harmonic correction term to the argument of latitude [rad] + * Amplitude of the cosine harmonic correction term to the argument of + * latitude [rad] */ double c_uc; - /** -* Amplitude of the sine harmonic correction term to the argument of latitude [rad] + * Amplitude of the sine harmonic correction term to the argument of latitude + * [rad] */ double c_us; - /** -* Amplitude of the cosine harmonic correction term to the angle of inclination [rad] + * Amplitude of the cosine harmonic correction term to the angle of + * inclination [rad] */ double c_ic; - /** -* Amplitude of the sine harmonic correction term to the angle of inclination [rad] + * Amplitude of the sine harmonic correction term to the angle of inclination + * [rad] */ double c_is; - /** -* Mean motion difference [rad/s] + * Mean motion difference [rad/s] */ double dn; - /** -* Mean anomaly at reference time [rad] + * Mean anomaly at reference time [rad] */ double m0; - /** -* Eccentricity of satellite orbit + * Eccentricity of satellite orbit */ double ecc; - /** -* Square root of the semi-major axis of orbit [m^(1/2)] + * Square root of the semi-major axis of orbit [m^(1/2)] */ double sqrta; - /** -* Longitude of ascending node of orbit plane at weekly epoch [rad] + * Longitude of ascending node of orbit plane at weekly epoch [rad] */ double omega0; - /** -* Rate of right ascension [rad/s] + * Rate of right ascension [rad/s] */ double omegadot; - /** -* Argument of perigee [rad] + * Argument of perigee [rad] */ double w; - /** -* Inclination [rad] + * Inclination [rad] */ double inc; - /** -* Inclination first derivative [rad/s] + * Inclination first derivative [rad/s] */ double inc_dot; - /** -* Polynomial clock correction coefficient (clock bias) [s] + * Polynomial clock correction coefficient (clock bias) [s] */ double af0; - /** -* Polynomial clock correction coefficient (clock drift) [s/s] + * Polynomial clock correction coefficient (clock drift) [s/s] */ double af1; - /** -* Polynomial clock correction coefficient (rate of clock drift) [s/s^2] + * Polynomial clock correction coefficient (rate of clock drift) [s/s^2] */ double af2; - /** -* Clock reference + * Clock reference */ sbp_gps_time_dep_t toc; - /** -* Issue of ephemeris data + * Issue of ephemeris data */ u8 iode; - /** -* Issue of clock data + * Issue of clock data */ u16 iodc; } sbp_msg_ephemeris_gps_dep_e_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_gps_dep_e_t * * @param msg sbp_msg_ephemeris_gps_dep_e_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_gps_dep_e_encoded_len(const sbp_msg_ephemeris_gps_dep_e_t *msg) -{ +static inline size_t sbp_msg_ephemeris_gps_dep_e_encoded_len( + const sbp_msg_ephemeris_gps_dep_e_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_GPS_DEP_E_ENCODED_LEN; } @@ -202,36 +180,54 @@ static inline size_t sbp_msg_ephemeris_gps_dep_e_encoded_len(const sbp_msg_ephem /** * Encode an instance of sbp_msg_ephemeris_gps_dep_e_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_gps_dep_e_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_gps_dep_e_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_gps_dep_e_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_gps_dep_e_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_gps_dep_e_t *msg); /** * Decode an instance of sbp_msg_ephemeris_gps_dep_e_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_gps_dep_e_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ephemeris_gps_dep_e_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_gps_dep_e_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_gps_dep_e_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_gps_dep_e_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_gps_dep_e_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_gps_dep_e_t *msg); /** - * Send an instance of sbp_msg_ephemeris_gps_dep_e_t with the given write function + * Send an instance of sbp_msg_ephemeris_gps_dep_e_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_gps_dep_e_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_gps_dep_e_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -239,51 +235,62 @@ SBP_EXPORT s8 sbp_msg_ephemeris_gps_dep_e_decode(const uint8_t *buf, uint8_t len * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_gps_dep_e_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_gps_dep_e_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_gps_dep_e_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_gps_dep_e_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_gps_dep_e_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_gps_dep_e_t instance * @param b sbp_msg_ephemeris_gps_dep_e_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_gps_dep_e_cmp(const sbp_msg_ephemeris_gps_dep_e_t *a, const sbp_msg_ephemeris_gps_dep_e_t *b); +SBP_EXPORT int sbp_msg_ephemeris_gps_dep_e_cmp( + const sbp_msg_ephemeris_gps_dep_e_t *a, + const sbp_msg_ephemeris_gps_dep_e_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_gps_dep_e_t &lhs, const sbp_msg_ephemeris_gps_dep_e_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_gps_dep_e_t &lhs, + const sbp_msg_ephemeris_gps_dep_e_t &rhs) { return sbp_msg_ephemeris_gps_dep_e_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_gps_dep_e_t &lhs, const sbp_msg_ephemeris_gps_dep_e_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_gps_dep_e_t &lhs, + const sbp_msg_ephemeris_gps_dep_e_t &rhs) { return sbp_msg_ephemeris_gps_dep_e_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_gps_dep_e_t &lhs, const sbp_msg_ephemeris_gps_dep_e_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_gps_dep_e_t &lhs, + const sbp_msg_ephemeris_gps_dep_e_t &rhs) { return sbp_msg_ephemeris_gps_dep_e_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_gps_dep_e_t &lhs, const sbp_msg_ephemeris_gps_dep_e_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_gps_dep_e_t &lhs, + const sbp_msg_ephemeris_gps_dep_e_t &rhs) { return sbp_msg_ephemeris_gps_dep_e_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_gps_dep_e_t &lhs, const sbp_msg_ephemeris_gps_dep_e_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_gps_dep_e_t &lhs, + const sbp_msg_ephemeris_gps_dep_e_t &rhs) { return sbp_msg_ephemeris_gps_dep_e_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_gps_dep_e_t &lhs, const sbp_msg_ephemeris_gps_dep_e_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_gps_dep_e_t &lhs, + const sbp_msg_ephemeris_gps_dep_e_t &rhs) { return sbp_msg_ephemeris_gps_dep_e_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_GPS_DEP_E_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_GPS_DEP_F.h b/c/include/libsbp/observation/MSG_EPHEMERIS_GPS_DEP_F.h index 420c8f909..5557442a6 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_GPS_DEP_F.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_GPS_DEP_F.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_GPS_DEP_F_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_GPS_DEP_F_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,159 +42,137 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Values common for all ephemeris types + * Values common for all ephemeris types */ sbp_ephemeris_common_content_dep_b_t common; - /** -* Group delay differential between L1 and L2 [s] + * Group delay differential between L1 and L2 [s] */ double tgd; - /** -* Amplitude of the sine harmonic correction term to the orbit radius [m] + * Amplitude of the sine harmonic correction term to the orbit radius [m] */ double c_rs; - /** -* Amplitude of the cosine harmonic correction term to the orbit radius [m] + * Amplitude of the cosine harmonic correction term to the orbit radius [m] */ double c_rc; - /** -* Amplitude of the cosine harmonic correction term to the argument of latitude [rad] + * Amplitude of the cosine harmonic correction term to the argument of + * latitude [rad] */ double c_uc; - /** -* Amplitude of the sine harmonic correction term to the argument of latitude [rad] + * Amplitude of the sine harmonic correction term to the argument of latitude + * [rad] */ double c_us; - /** -* Amplitude of the cosine harmonic correction term to the angle of inclination [rad] + * Amplitude of the cosine harmonic correction term to the angle of + * inclination [rad] */ double c_ic; - /** -* Amplitude of the sine harmonic correction term to the angle of inclination [rad] + * Amplitude of the sine harmonic correction term to the angle of inclination + * [rad] */ double c_is; - /** -* Mean motion difference [rad/s] + * Mean motion difference [rad/s] */ double dn; - /** -* Mean anomaly at reference time [rad] + * Mean anomaly at reference time [rad] */ double m0; - /** -* Eccentricity of satellite orbit + * Eccentricity of satellite orbit */ double ecc; - /** -* Square root of the semi-major axis of orbit [m^(1/2)] + * Square root of the semi-major axis of orbit [m^(1/2)] */ double sqrta; - /** -* Longitude of ascending node of orbit plane at weekly epoch [rad] + * Longitude of ascending node of orbit plane at weekly epoch [rad] */ double omega0; - /** -* Rate of right ascension [rad/s] + * Rate of right ascension [rad/s] */ double omegadot; - /** -* Argument of perigee [rad] + * Argument of perigee [rad] */ double w; - /** -* Inclination [rad] + * Inclination [rad] */ double inc; - /** -* Inclination first derivative [rad/s] + * Inclination first derivative [rad/s] */ double inc_dot; - /** -* Polynomial clock correction coefficient (clock bias) [s] + * Polynomial clock correction coefficient (clock bias) [s] */ double af0; - /** -* Polynomial clock correction coefficient (clock drift) [s/s] + * Polynomial clock correction coefficient (clock drift) [s/s] */ double af1; - /** -* Polynomial clock correction coefficient (rate of clock drift) [s/s^2] + * Polynomial clock correction coefficient (rate of clock drift) [s/s^2] */ double af2; - /** -* Clock reference + * Clock reference */ sbp_gps_time_sec_t toc; - /** -* Issue of ephemeris data + * Issue of ephemeris data */ u8 iode; - /** -* Issue of clock data + * Issue of clock data */ u16 iodc; } sbp_msg_ephemeris_gps_dep_f_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_gps_dep_f_t * * @param msg sbp_msg_ephemeris_gps_dep_f_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_gps_dep_f_encoded_len(const sbp_msg_ephemeris_gps_dep_f_t *msg) -{ +static inline size_t sbp_msg_ephemeris_gps_dep_f_encoded_len( + const sbp_msg_ephemeris_gps_dep_f_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_GPS_DEP_F_ENCODED_LEN; } @@ -202,36 +180,54 @@ static inline size_t sbp_msg_ephemeris_gps_dep_f_encoded_len(const sbp_msg_ephem /** * Encode an instance of sbp_msg_ephemeris_gps_dep_f_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_gps_dep_f_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_gps_dep_f_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_gps_dep_f_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_gps_dep_f_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_gps_dep_f_t *msg); /** * Decode an instance of sbp_msg_ephemeris_gps_dep_f_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_gps_dep_f_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ephemeris_gps_dep_f_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_gps_dep_f_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_gps_dep_f_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_gps_dep_f_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_gps_dep_f_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_gps_dep_f_t *msg); /** - * Send an instance of sbp_msg_ephemeris_gps_dep_f_t with the given write function + * Send an instance of sbp_msg_ephemeris_gps_dep_f_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_gps_dep_f_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_gps_dep_f_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -239,51 +235,62 @@ SBP_EXPORT s8 sbp_msg_ephemeris_gps_dep_f_decode(const uint8_t *buf, uint8_t len * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_gps_dep_f_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_gps_dep_f_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_gps_dep_f_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_gps_dep_f_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_gps_dep_f_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_gps_dep_f_t instance * @param b sbp_msg_ephemeris_gps_dep_f_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_gps_dep_f_cmp(const sbp_msg_ephemeris_gps_dep_f_t *a, const sbp_msg_ephemeris_gps_dep_f_t *b); +SBP_EXPORT int sbp_msg_ephemeris_gps_dep_f_cmp( + const sbp_msg_ephemeris_gps_dep_f_t *a, + const sbp_msg_ephemeris_gps_dep_f_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_gps_dep_f_t &lhs, const sbp_msg_ephemeris_gps_dep_f_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_gps_dep_f_t &lhs, + const sbp_msg_ephemeris_gps_dep_f_t &rhs) { return sbp_msg_ephemeris_gps_dep_f_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_gps_dep_f_t &lhs, const sbp_msg_ephemeris_gps_dep_f_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_gps_dep_f_t &lhs, + const sbp_msg_ephemeris_gps_dep_f_t &rhs) { return sbp_msg_ephemeris_gps_dep_f_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_gps_dep_f_t &lhs, const sbp_msg_ephemeris_gps_dep_f_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_gps_dep_f_t &lhs, + const sbp_msg_ephemeris_gps_dep_f_t &rhs) { return sbp_msg_ephemeris_gps_dep_f_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_gps_dep_f_t &lhs, const sbp_msg_ephemeris_gps_dep_f_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_gps_dep_f_t &lhs, + const sbp_msg_ephemeris_gps_dep_f_t &rhs) { return sbp_msg_ephemeris_gps_dep_f_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_gps_dep_f_t &lhs, const sbp_msg_ephemeris_gps_dep_f_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_gps_dep_f_t &lhs, + const sbp_msg_ephemeris_gps_dep_f_t &rhs) { return sbp_msg_ephemeris_gps_dep_f_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_gps_dep_f_t &lhs, const sbp_msg_ephemeris_gps_dep_f_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_gps_dep_f_t &lhs, + const sbp_msg_ephemeris_gps_dep_f_t &rhs) { return sbp_msg_ephemeris_gps_dep_f_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_GPS_DEP_F_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_QZSS.h b/c/include/libsbp/observation/MSG_EPHEMERIS_QZSS.h index 793de1d47..a908cd1a2 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_QZSS.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_QZSS.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_QZSS_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_QZSS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,159 +42,138 @@ *****************************************************************************/ /** Satellite broadcast ephemeris for QZSS * -* The ephemeris message returns a set of satellite orbit parameters that is used to calculate QZSS satellite position, velocity, and clock offset. + * The ephemeris message returns a set of satellite orbit parameters that is + * used to calculate QZSS satellite position, velocity, and clock offset. */ typedef struct { - - /** -* Values common for all ephemeris types + * Values common for all ephemeris types */ sbp_ephemeris_common_content_t common; - /** -* Group delay differential between L1 and L2 [s] + * Group delay differential between L1 and L2 [s] */ float tgd; - /** -* Amplitude of the sine harmonic correction term to the orbit radius [m] + * Amplitude of the sine harmonic correction term to the orbit radius [m] */ float c_rs; - /** -* Amplitude of the cosine harmonic correction term to the orbit radius [m] + * Amplitude of the cosine harmonic correction term to the orbit radius [m] */ float c_rc; - /** -* Amplitude of the cosine harmonic correction term to the argument of latitude [rad] + * Amplitude of the cosine harmonic correction term to the argument of + * latitude [rad] */ float c_uc; - /** -* Amplitude of the sine harmonic correction term to the argument of latitude [rad] + * Amplitude of the sine harmonic correction term to the argument of latitude + * [rad] */ float c_us; - /** -* Amplitude of the cosine harmonic correction term to the angle of inclination [rad] + * Amplitude of the cosine harmonic correction term to the angle of + * inclination [rad] */ float c_ic; - /** -* Amplitude of the sine harmonic correction term to the angle of inclination [rad] + * Amplitude of the sine harmonic correction term to the angle of inclination + * [rad] */ float c_is; - /** -* Mean motion difference [rad/s] + * Mean motion difference [rad/s] */ double dn; - /** -* Mean anomaly at reference time [rad] + * Mean anomaly at reference time [rad] */ double m0; - /** -* Eccentricity of satellite orbit + * Eccentricity of satellite orbit */ double ecc; - /** -* Square root of the semi-major axis of orbit [m^(1/2)] + * Square root of the semi-major axis of orbit [m^(1/2)] */ double sqrta; - /** -* Longitude of ascending node of orbit plane at weekly epoch [rad] + * Longitude of ascending node of orbit plane at weekly epoch [rad] */ double omega0; - /** -* Rate of right ascension [rad/s] + * Rate of right ascension [rad/s] */ double omegadot; - /** -* Argument of perigee [rad] + * Argument of perigee [rad] */ double w; - /** -* Inclination [rad] + * Inclination [rad] */ double inc; - /** -* Inclination first derivative [rad/s] + * Inclination first derivative [rad/s] */ double inc_dot; - /** -* Polynomial clock correction coefficient (clock bias) [s] + * Polynomial clock correction coefficient (clock bias) [s] */ float af0; - /** -* Polynomial clock correction coefficient (clock drift) [s/s] + * Polynomial clock correction coefficient (clock drift) [s/s] */ float af1; - /** -* Polynomial clock correction coefficient (rate of clock drift) [s/s^2] + * Polynomial clock correction coefficient (rate of clock drift) [s/s^2] */ float af2; - /** -* Clock reference + * Clock reference */ sbp_gps_time_sec_t toc; - /** -* Issue of ephemeris data + * Issue of ephemeris data */ u8 iode; - /** -* Issue of clock data + * Issue of clock data */ u16 iodc; } sbp_msg_ephemeris_qzss_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_qzss_t * * @param msg sbp_msg_ephemeris_qzss_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_qzss_encoded_len(const sbp_msg_ephemeris_qzss_t *msg) -{ +static inline size_t sbp_msg_ephemeris_qzss_encoded_len( + const sbp_msg_ephemeris_qzss_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_QZSS_ENCODED_LEN; } @@ -202,36 +181,53 @@ static inline size_t sbp_msg_ephemeris_qzss_encoded_len(const sbp_msg_ephemeris_ /** * Encode an instance of sbp_msg_ephemeris_qzss_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_qzss_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_qzss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_qzss_t *msg); +SBP_EXPORT s8 +sbp_msg_ephemeris_qzss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_qzss_t *msg); /** * Decode an instance of sbp_msg_ephemeris_qzss_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_qzss_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ephemeris_qzss_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_qzss_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_qzss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_qzss_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_qzss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_qzss_t *msg); /** * Send an instance of sbp_msg_ephemeris_qzss_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_qzss_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_qzss_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -239,51 +235,61 @@ SBP_EXPORT s8 sbp_msg_ephemeris_qzss_decode(const uint8_t *buf, uint8_t len, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_qzss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_qzss_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_qzss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_qzss_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_qzss_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_qzss_t instance * @param b sbp_msg_ephemeris_qzss_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_qzss_cmp(const sbp_msg_ephemeris_qzss_t *a, const sbp_msg_ephemeris_qzss_t *b); +SBP_EXPORT int sbp_msg_ephemeris_qzss_cmp(const sbp_msg_ephemeris_qzss_t *a, + const sbp_msg_ephemeris_qzss_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_qzss_t &lhs, const sbp_msg_ephemeris_qzss_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_qzss_t &lhs, + const sbp_msg_ephemeris_qzss_t &rhs) { return sbp_msg_ephemeris_qzss_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_qzss_t &lhs, const sbp_msg_ephemeris_qzss_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_qzss_t &lhs, + const sbp_msg_ephemeris_qzss_t &rhs) { return sbp_msg_ephemeris_qzss_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_qzss_t &lhs, const sbp_msg_ephemeris_qzss_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_qzss_t &lhs, + const sbp_msg_ephemeris_qzss_t &rhs) { return sbp_msg_ephemeris_qzss_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_qzss_t &lhs, const sbp_msg_ephemeris_qzss_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_qzss_t &lhs, + const sbp_msg_ephemeris_qzss_t &rhs) { return sbp_msg_ephemeris_qzss_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_qzss_t &lhs, const sbp_msg_ephemeris_qzss_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_qzss_t &lhs, + const sbp_msg_ephemeris_qzss_t &rhs) { return sbp_msg_ephemeris_qzss_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_qzss_t &lhs, const sbp_msg_ephemeris_qzss_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_qzss_t &lhs, + const sbp_msg_ephemeris_qzss_t &rhs) { return sbp_msg_ephemeris_qzss_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_QZSS_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_SBAS.h b/c/include/libsbp/observation/MSG_EPHEMERIS_SBAS.h index d901714b2..713a11c8b 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_SBAS.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_SBAS.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_SBAS_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_SBAS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,54 +40,45 @@ * *****************************************************************************/ typedef struct { - - /** -* Values common for all ephemeris types + * Values common for all ephemeris types */ sbp_ephemeris_common_content_t common; - /** -* Position of the GEO at time toe [m] + * Position of the GEO at time toe [m] */ double pos[SBP_MSG_EPHEMERIS_SBAS_POS_MAX]; - /** -* Velocity of the GEO at time toe [m/s] + * Velocity of the GEO at time toe [m/s] */ float vel[SBP_MSG_EPHEMERIS_SBAS_VEL_MAX]; - /** -* Acceleration of the GEO at time toe [m/s^2] + * Acceleration of the GEO at time toe [m/s^2] */ float acc[SBP_MSG_EPHEMERIS_SBAS_ACC_MAX]; - /** -* Time offset of the GEO clock w.r.t. SBAS Network Time [s] + * Time offset of the GEO clock w.r.t. SBAS Network Time [s] */ float a_gf0; - /** -* Drift of the GEO clock w.r.t. SBAS Network Time [s/s] + * Drift of the GEO clock w.r.t. SBAS Network Time [s/s] */ float a_gf1; } sbp_msg_ephemeris_sbas_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_sbas_t * * @param msg sbp_msg_ephemeris_sbas_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_sbas_encoded_len(const sbp_msg_ephemeris_sbas_t *msg) -{ +static inline size_t sbp_msg_ephemeris_sbas_encoded_len( + const sbp_msg_ephemeris_sbas_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_SBAS_ENCODED_LEN; } @@ -95,36 +86,53 @@ static inline size_t sbp_msg_ephemeris_sbas_encoded_len(const sbp_msg_ephemeris_ /** * Encode an instance of sbp_msg_ephemeris_sbas_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_sbas_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_sbas_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_sbas_t *msg); +SBP_EXPORT s8 +sbp_msg_ephemeris_sbas_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_sbas_t *msg); /** * Decode an instance of sbp_msg_ephemeris_sbas_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_sbas_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ephemeris_sbas_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_sbas_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_sbas_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_sbas_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_sbas_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_sbas_t *msg); /** * Send an instance of sbp_msg_ephemeris_sbas_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_sbas_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_sbas_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -132,51 +140,61 @@ SBP_EXPORT s8 sbp_msg_ephemeris_sbas_decode(const uint8_t *buf, uint8_t len, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_sbas_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_sbas_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_sbas_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_sbas_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_sbas_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_sbas_t instance * @param b sbp_msg_ephemeris_sbas_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_sbas_cmp(const sbp_msg_ephemeris_sbas_t *a, const sbp_msg_ephemeris_sbas_t *b); +SBP_EXPORT int sbp_msg_ephemeris_sbas_cmp(const sbp_msg_ephemeris_sbas_t *a, + const sbp_msg_ephemeris_sbas_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_sbas_t &lhs, const sbp_msg_ephemeris_sbas_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_sbas_t &lhs, + const sbp_msg_ephemeris_sbas_t &rhs) { return sbp_msg_ephemeris_sbas_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_sbas_t &lhs, const sbp_msg_ephemeris_sbas_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_sbas_t &lhs, + const sbp_msg_ephemeris_sbas_t &rhs) { return sbp_msg_ephemeris_sbas_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_sbas_t &lhs, const sbp_msg_ephemeris_sbas_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_sbas_t &lhs, + const sbp_msg_ephemeris_sbas_t &rhs) { return sbp_msg_ephemeris_sbas_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_sbas_t &lhs, const sbp_msg_ephemeris_sbas_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_sbas_t &lhs, + const sbp_msg_ephemeris_sbas_t &rhs) { return sbp_msg_ephemeris_sbas_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_sbas_t &lhs, const sbp_msg_ephemeris_sbas_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_sbas_t &lhs, + const sbp_msg_ephemeris_sbas_t &rhs) { return sbp_msg_ephemeris_sbas_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_sbas_t &lhs, const sbp_msg_ephemeris_sbas_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_sbas_t &lhs, + const sbp_msg_ephemeris_sbas_t &rhs) { return sbp_msg_ephemeris_sbas_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_SBAS_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_SBAS_DEP_A.h b/c/include/libsbp/observation/MSG_EPHEMERIS_SBAS_DEP_A.h index d42601f87..63c911b22 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_SBAS_DEP_A.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_SBAS_DEP_A.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_SBAS_DEP_A_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_SBAS_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,57 +41,48 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Values common for all ephemeris types + * Values common for all ephemeris types */ sbp_ephemeris_common_content_dep_a_t common; - /** -* Position of the GEO at time toe [m] + * Position of the GEO at time toe [m] */ double pos[SBP_MSG_EPHEMERIS_SBAS_DEP_A_POS_MAX]; - /** -* Velocity of the GEO at time toe [m/s] + * Velocity of the GEO at time toe [m/s] */ double vel[SBP_MSG_EPHEMERIS_SBAS_DEP_A_VEL_MAX]; - /** -* Acceleration of the GEO at time toe [m/s^2] + * Acceleration of the GEO at time toe [m/s^2] */ double acc[SBP_MSG_EPHEMERIS_SBAS_DEP_A_ACC_MAX]; - /** -* Time offset of the GEO clock w.r.t. SBAS Network Time [s] + * Time offset of the GEO clock w.r.t. SBAS Network Time [s] */ double a_gf0; - /** -* Drift of the GEO clock w.r.t. SBAS Network Time [s/s] + * Drift of the GEO clock w.r.t. SBAS Network Time [s/s] */ double a_gf1; } sbp_msg_ephemeris_sbas_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_sbas_dep_a_t * * @param msg sbp_msg_ephemeris_sbas_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_sbas_dep_a_encoded_len(const sbp_msg_ephemeris_sbas_dep_a_t *msg) -{ +static inline size_t sbp_msg_ephemeris_sbas_dep_a_encoded_len( + const sbp_msg_ephemeris_sbas_dep_a_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_SBAS_DEP_A_ENCODED_LEN; } @@ -99,36 +90,54 @@ static inline size_t sbp_msg_ephemeris_sbas_dep_a_encoded_len(const sbp_msg_ephe /** * Encode an instance of sbp_msg_ephemeris_sbas_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_sbas_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_sbas_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_sbas_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_sbas_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_sbas_dep_a_t *msg); /** * Decode an instance of sbp_msg_ephemeris_sbas_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_sbas_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ephemeris_sbas_dep_a_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_sbas_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_sbas_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_sbas_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_sbas_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_sbas_dep_a_t *msg); /** - * Send an instance of sbp_msg_ephemeris_sbas_dep_a_t with the given write function + * Send an instance of sbp_msg_ephemeris_sbas_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_sbas_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_sbas_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -136,51 +145,62 @@ SBP_EXPORT s8 sbp_msg_ephemeris_sbas_dep_a_decode(const uint8_t *buf, uint8_t le * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_sbas_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_sbas_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_sbas_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_sbas_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_sbas_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_sbas_dep_a_t instance * @param b sbp_msg_ephemeris_sbas_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_sbas_dep_a_cmp(const sbp_msg_ephemeris_sbas_dep_a_t *a, const sbp_msg_ephemeris_sbas_dep_a_t *b); +SBP_EXPORT int sbp_msg_ephemeris_sbas_dep_a_cmp( + const sbp_msg_ephemeris_sbas_dep_a_t *a, + const sbp_msg_ephemeris_sbas_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_sbas_dep_a_t &lhs, const sbp_msg_ephemeris_sbas_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_sbas_dep_a_t &lhs, + const sbp_msg_ephemeris_sbas_dep_a_t &rhs) { return sbp_msg_ephemeris_sbas_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_sbas_dep_a_t &lhs, const sbp_msg_ephemeris_sbas_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_sbas_dep_a_t &lhs, + const sbp_msg_ephemeris_sbas_dep_a_t &rhs) { return sbp_msg_ephemeris_sbas_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_sbas_dep_a_t &lhs, const sbp_msg_ephemeris_sbas_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_sbas_dep_a_t &lhs, + const sbp_msg_ephemeris_sbas_dep_a_t &rhs) { return sbp_msg_ephemeris_sbas_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_sbas_dep_a_t &lhs, const sbp_msg_ephemeris_sbas_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_sbas_dep_a_t &lhs, + const sbp_msg_ephemeris_sbas_dep_a_t &rhs) { return sbp_msg_ephemeris_sbas_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_sbas_dep_a_t &lhs, const sbp_msg_ephemeris_sbas_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_sbas_dep_a_t &lhs, + const sbp_msg_ephemeris_sbas_dep_a_t &rhs) { return sbp_msg_ephemeris_sbas_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_sbas_dep_a_t &lhs, const sbp_msg_ephemeris_sbas_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_sbas_dep_a_t &lhs, + const sbp_msg_ephemeris_sbas_dep_a_t &rhs) { return sbp_msg_ephemeris_sbas_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_SBAS_DEP_A_H */ - diff --git a/c/include/libsbp/observation/MSG_EPHEMERIS_SBAS_DEP_B.h b/c/include/libsbp/observation/MSG_EPHEMERIS_SBAS_DEP_B.h index 12104fbbd..254a82c73 100644 --- a/c/include/libsbp/observation/MSG_EPHEMERIS_SBAS_DEP_B.h +++ b/c/include/libsbp/observation/MSG_EPHEMERIS_SBAS_DEP_B.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_EPHEMERIS_SBAS_DEP_B_H #define LIBSBP_OBSERVATION_MSG_EPHEMERIS_SBAS_DEP_B_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,57 +41,48 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Values common for all ephemeris types + * Values common for all ephemeris types */ sbp_ephemeris_common_content_dep_b_t common; - /** -* Position of the GEO at time toe [m] + * Position of the GEO at time toe [m] */ double pos[SBP_MSG_EPHEMERIS_SBAS_DEP_B_POS_MAX]; - /** -* Velocity of the GEO at time toe [m/s] + * Velocity of the GEO at time toe [m/s] */ double vel[SBP_MSG_EPHEMERIS_SBAS_DEP_B_VEL_MAX]; - /** -* Acceleration of the GEO at time toe [m/s^2] + * Acceleration of the GEO at time toe [m/s^2] */ double acc[SBP_MSG_EPHEMERIS_SBAS_DEP_B_ACC_MAX]; - /** -* Time offset of the GEO clock w.r.t. SBAS Network Time [s] + * Time offset of the GEO clock w.r.t. SBAS Network Time [s] */ double a_gf0; - /** -* Drift of the GEO clock w.r.t. SBAS Network Time [s/s] + * Drift of the GEO clock w.r.t. SBAS Network Time [s/s] */ double a_gf1; } sbp_msg_ephemeris_sbas_dep_b_t; - - /** * Get encoded size of an instance of sbp_msg_ephemeris_sbas_dep_b_t * * @param msg sbp_msg_ephemeris_sbas_dep_b_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ephemeris_sbas_dep_b_encoded_len(const sbp_msg_ephemeris_sbas_dep_b_t *msg) -{ +static inline size_t sbp_msg_ephemeris_sbas_dep_b_encoded_len( + const sbp_msg_ephemeris_sbas_dep_b_t *msg) { (void)msg; return SBP_MSG_EPHEMERIS_SBAS_DEP_B_ENCODED_LEN; } @@ -99,36 +90,54 @@ static inline size_t sbp_msg_ephemeris_sbas_dep_b_encoded_len(const sbp_msg_ephe /** * Encode an instance of sbp_msg_ephemeris_sbas_dep_b_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ephemeris_sbas_dep_b_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_sbas_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_sbas_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_sbas_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_sbas_dep_b_t *msg); /** * Decode an instance of sbp_msg_ephemeris_sbas_dep_b_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ephemeris_sbas_dep_b_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ephemeris_sbas_dep_b_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ephemeris_sbas_dep_b_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_sbas_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_sbas_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_ephemeris_sbas_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ephemeris_sbas_dep_b_t *msg); /** - * Send an instance of sbp_msg_ephemeris_sbas_dep_b_t with the given write function + * Send an instance of sbp_msg_ephemeris_sbas_dep_b_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ephemeris_sbas_dep_b_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ephemeris_sbas_dep_b_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -136,51 +145,62 @@ SBP_EXPORT s8 sbp_msg_ephemeris_sbas_dep_b_decode(const uint8_t *buf, uint8_t le * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ephemeris_sbas_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_sbas_dep_b_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ephemeris_sbas_dep_b_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_sbas_dep_b_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ephemeris_sbas_dep_b_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ephemeris_sbas_dep_b_t instance * @param b sbp_msg_ephemeris_sbas_dep_b_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ephemeris_sbas_dep_b_cmp(const sbp_msg_ephemeris_sbas_dep_b_t *a, const sbp_msg_ephemeris_sbas_dep_b_t *b); +SBP_EXPORT int sbp_msg_ephemeris_sbas_dep_b_cmp( + const sbp_msg_ephemeris_sbas_dep_b_t *a, + const sbp_msg_ephemeris_sbas_dep_b_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ephemeris_sbas_dep_b_t &lhs, const sbp_msg_ephemeris_sbas_dep_b_t &rhs) { +static inline bool operator==(const sbp_msg_ephemeris_sbas_dep_b_t &lhs, + const sbp_msg_ephemeris_sbas_dep_b_t &rhs) { return sbp_msg_ephemeris_sbas_dep_b_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ephemeris_sbas_dep_b_t &lhs, const sbp_msg_ephemeris_sbas_dep_b_t &rhs) { +static inline bool operator!=(const sbp_msg_ephemeris_sbas_dep_b_t &lhs, + const sbp_msg_ephemeris_sbas_dep_b_t &rhs) { return sbp_msg_ephemeris_sbas_dep_b_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ephemeris_sbas_dep_b_t &lhs, const sbp_msg_ephemeris_sbas_dep_b_t &rhs) { +static inline bool operator<(const sbp_msg_ephemeris_sbas_dep_b_t &lhs, + const sbp_msg_ephemeris_sbas_dep_b_t &rhs) { return sbp_msg_ephemeris_sbas_dep_b_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ephemeris_sbas_dep_b_t &lhs, const sbp_msg_ephemeris_sbas_dep_b_t &rhs) { +static inline bool operator<=(const sbp_msg_ephemeris_sbas_dep_b_t &lhs, + const sbp_msg_ephemeris_sbas_dep_b_t &rhs) { return sbp_msg_ephemeris_sbas_dep_b_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ephemeris_sbas_dep_b_t &lhs, const sbp_msg_ephemeris_sbas_dep_b_t &rhs) { +static inline bool operator>(const sbp_msg_ephemeris_sbas_dep_b_t &lhs, + const sbp_msg_ephemeris_sbas_dep_b_t &rhs) { return sbp_msg_ephemeris_sbas_dep_b_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ephemeris_sbas_dep_b_t &lhs, const sbp_msg_ephemeris_sbas_dep_b_t &rhs) { +static inline bool operator>=(const sbp_msg_ephemeris_sbas_dep_b_t &lhs, + const sbp_msg_ephemeris_sbas_dep_b_t &rhs) { return sbp_msg_ephemeris_sbas_dep_b_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_EPHEMERIS_SBAS_DEP_B_H */ - diff --git a/c/include/libsbp/observation/MSG_GLO_BIASES.h b/c/include/libsbp/observation/MSG_GLO_BIASES.h index 19ac2df98..a9649bf84 100644 --- a/c/include/libsbp/observation/MSG_GLO_BIASES.h +++ b/c/include/libsbp/observation/MSG_GLO_BIASES.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_OBSERVATION_MSG_GLO_BIASES_H #define LIBSBP_OBSERVATION_MSG_GLO_BIASES_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,51 +40,45 @@ *****************************************************************************/ /** GLONASS L1/L2 Code-Phase biases * -* The GLONASS L1/L2 Code-Phase biases allows to perform GPS+GLONASS integer ambiguity resolution for baselines with mixed receiver types (e.g. receiver of different manufacturers). + * The GLONASS L1/L2 Code-Phase biases allows to perform GPS+GLONASS integer + * ambiguity resolution for baselines with mixed receiver types (e.g. receiver + * of different manufacturers). */ typedef struct { - - /** -* GLONASS FDMA signals mask [boolean] + * GLONASS FDMA signals mask [boolean] */ u8 mask; - /** -* GLONASS L1 C/A Code-Phase Bias [m * 0.02] + * GLONASS L1 C/A Code-Phase Bias [m * 0.02] */ s16 l1ca_bias; - /** -* GLONASS L1 P Code-Phase Bias [m * 0.02] + * GLONASS L1 P Code-Phase Bias [m * 0.02] */ s16 l1p_bias; - /** -* GLONASS L2 C/A Code-Phase Bias [m * 0.02] + * GLONASS L2 C/A Code-Phase Bias [m * 0.02] */ s16 l2ca_bias; - /** -* GLONASS L2 P Code-Phase Bias [m * 0.02] + * GLONASS L2 P Code-Phase Bias [m * 0.02] */ s16 l2p_bias; } sbp_msg_glo_biases_t; - - /** * Get encoded size of an instance of sbp_msg_glo_biases_t * * @param msg sbp_msg_glo_biases_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_glo_biases_encoded_len(const sbp_msg_glo_biases_t *msg) -{ +static inline size_t sbp_msg_glo_biases_encoded_len( + const sbp_msg_glo_biases_t *msg) { (void)msg; return SBP_MSG_GLO_BIASES_ENCODED_LEN; } @@ -92,36 +86,53 @@ static inline size_t sbp_msg_glo_biases_encoded_len(const sbp_msg_glo_biases_t * /** * Encode an instance of sbp_msg_glo_biases_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_glo_biases_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_glo_biases_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_glo_biases_t *msg); +SBP_EXPORT s8 sbp_msg_glo_biases_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_glo_biases_t *msg); /** * Decode an instance of sbp_msg_glo_biases_t from wire representation * - * This function decodes the wire representation of a sbp_msg_glo_biases_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_glo_biases_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_glo_biases_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_glo_biases_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_glo_biases_t *msg); +SBP_EXPORT s8 sbp_msg_glo_biases_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_glo_biases_t *msg); /** * Send an instance of sbp_msg_glo_biases_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_glo_biases_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_glo_biases_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -129,51 +140,61 @@ SBP_EXPORT s8 sbp_msg_glo_biases_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_glo_biases_send(sbp_state_t *s, u16 sender_id, const sbp_msg_glo_biases_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_glo_biases_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_glo_biases_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_glo_biases_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_glo_biases_t instance * @param b sbp_msg_glo_biases_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_glo_biases_cmp(const sbp_msg_glo_biases_t *a, const sbp_msg_glo_biases_t *b); +SBP_EXPORT int sbp_msg_glo_biases_cmp(const sbp_msg_glo_biases_t *a, + const sbp_msg_glo_biases_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_glo_biases_t &lhs, const sbp_msg_glo_biases_t &rhs) { +static inline bool operator==(const sbp_msg_glo_biases_t &lhs, + const sbp_msg_glo_biases_t &rhs) { return sbp_msg_glo_biases_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_glo_biases_t &lhs, const sbp_msg_glo_biases_t &rhs) { +static inline bool operator!=(const sbp_msg_glo_biases_t &lhs, + const sbp_msg_glo_biases_t &rhs) { return sbp_msg_glo_biases_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_glo_biases_t &lhs, const sbp_msg_glo_biases_t &rhs) { +static inline bool operator<(const sbp_msg_glo_biases_t &lhs, + const sbp_msg_glo_biases_t &rhs) { return sbp_msg_glo_biases_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_glo_biases_t &lhs, const sbp_msg_glo_biases_t &rhs) { +static inline bool operator<=(const sbp_msg_glo_biases_t &lhs, + const sbp_msg_glo_biases_t &rhs) { return sbp_msg_glo_biases_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_glo_biases_t &lhs, const sbp_msg_glo_biases_t &rhs) { +static inline bool operator>(const sbp_msg_glo_biases_t &lhs, + const sbp_msg_glo_biases_t &rhs) { return sbp_msg_glo_biases_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_glo_biases_t &lhs, const sbp_msg_glo_biases_t &rhs) { +static inline bool operator>=(const sbp_msg_glo_biases_t &lhs, + const sbp_msg_glo_biases_t &rhs) { return sbp_msg_glo_biases_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_GLO_BIASES_H */ - diff --git a/c/include/libsbp/observation/MSG_GNSS_CAPB.h b/c/include/libsbp/observation/MSG_GNSS_CAPB.h index 66e9df1f7..ab8657971 100644 --- a/c/include/libsbp/observation/MSG_GNSS_CAPB.h +++ b/c/include/libsbp/observation/MSG_GNSS_CAPB.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_MSG_GNSS_CAPB_H #define LIBSBP_OBSERVATION_MSG_GNSS_CAPB_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -45,30 +45,25 @@ * Bit masks of signal capabilities for each GNSS satellite PRN. */ typedef struct { - - /** -* Navigation Message Correction Table Validity Time + * Navigation Message Correction Table Validity Time */ sbp_gps_time_sec_t t_nmct; - /** -* GNSS capabilities masks + * GNSS capabilities masks */ sbp_gnss_capb_t gc; } sbp_msg_gnss_capb_t; - - /** * Get encoded size of an instance of sbp_msg_gnss_capb_t * * @param msg sbp_msg_gnss_capb_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_gnss_capb_encoded_len(const sbp_msg_gnss_capb_t *msg) -{ +static inline size_t sbp_msg_gnss_capb_encoded_len( + const sbp_msg_gnss_capb_t *msg) { (void)msg; return SBP_MSG_GNSS_CAPB_ENCODED_LEN; } @@ -76,36 +71,53 @@ static inline size_t sbp_msg_gnss_capb_encoded_len(const sbp_msg_gnss_capb_t *ms /** * Encode an instance of sbp_msg_gnss_capb_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_gnss_capb_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_gnss_capb_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_gnss_capb_t *msg); +SBP_EXPORT s8 sbp_msg_gnss_capb_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_gnss_capb_t *msg); /** * Decode an instance of sbp_msg_gnss_capb_t from wire representation * - * This function decodes the wire representation of a sbp_msg_gnss_capb_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_gnss_capb_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_gnss_capb_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_gnss_capb_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_gnss_capb_t *msg); +SBP_EXPORT s8 sbp_msg_gnss_capb_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_gnss_capb_t *msg); /** * Send an instance of sbp_msg_gnss_capb_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_gnss_capb_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_gnss_capb_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -113,51 +125,61 @@ SBP_EXPORT s8 sbp_msg_gnss_capb_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_gnss_capb_send(sbp_state_t *s, u16 sender_id, const sbp_msg_gnss_capb_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_gnss_capb_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_gnss_capb_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_gnss_capb_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_gnss_capb_t instance * @param b sbp_msg_gnss_capb_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_gnss_capb_cmp(const sbp_msg_gnss_capb_t *a, const sbp_msg_gnss_capb_t *b); +SBP_EXPORT int sbp_msg_gnss_capb_cmp(const sbp_msg_gnss_capb_t *a, + const sbp_msg_gnss_capb_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_gnss_capb_t &lhs, const sbp_msg_gnss_capb_t &rhs) { +static inline bool operator==(const sbp_msg_gnss_capb_t &lhs, + const sbp_msg_gnss_capb_t &rhs) { return sbp_msg_gnss_capb_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_gnss_capb_t &lhs, const sbp_msg_gnss_capb_t &rhs) { +static inline bool operator!=(const sbp_msg_gnss_capb_t &lhs, + const sbp_msg_gnss_capb_t &rhs) { return sbp_msg_gnss_capb_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_gnss_capb_t &lhs, const sbp_msg_gnss_capb_t &rhs) { +static inline bool operator<(const sbp_msg_gnss_capb_t &lhs, + const sbp_msg_gnss_capb_t &rhs) { return sbp_msg_gnss_capb_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_gnss_capb_t &lhs, const sbp_msg_gnss_capb_t &rhs) { +static inline bool operator<=(const sbp_msg_gnss_capb_t &lhs, + const sbp_msg_gnss_capb_t &rhs) { return sbp_msg_gnss_capb_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_gnss_capb_t &lhs, const sbp_msg_gnss_capb_t &rhs) { +static inline bool operator>(const sbp_msg_gnss_capb_t &lhs, + const sbp_msg_gnss_capb_t &rhs) { return sbp_msg_gnss_capb_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_gnss_capb_t &lhs, const sbp_msg_gnss_capb_t &rhs) { +static inline bool operator>=(const sbp_msg_gnss_capb_t &lhs, + const sbp_msg_gnss_capb_t &rhs) { return sbp_msg_gnss_capb_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_GNSS_CAPB_H */ - diff --git a/c/include/libsbp/observation/MSG_GROUP_DELAY.h b/c/include/libsbp/observation/MSG_GROUP_DELAY.h index 51504fae2..e74da7bf0 100644 --- a/c/include/libsbp/observation/MSG_GROUP_DELAY.h +++ b/c/include/libsbp/observation/MSG_GROUP_DELAY.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_MSG_GROUP_DELAY_H #define LIBSBP_OBSERVATION_MSG_GROUP_DELAY_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,48 +42,40 @@ *****************************************************************************/ /** Group Delay * -* Please see ICD-GPS-200 (30.3.3.3.1.1) for more details. + * Please see ICD-GPS-200 (30.3.3.3.1.1) for more details. */ typedef struct { - - /** -* Data Predict Time of Week + * Data Predict Time of Week */ sbp_gps_time_sec_t t_op; - /** -* GNSS signal identifier + * GNSS signal identifier */ sbp_v4_gnss_signal_t sid; - /** - * bit-field indicating validity of the values, LSB indicating tgd validity etc. 1 = value is valid, 0 = value is not valid. + * bit-field indicating validity of the values, LSB indicating tgd validity + * etc. 1 = value is valid, 0 = value is not valid. */ u8 valid; - s16 tgd; - s16 isc_l1ca; - s16 isc_l2c; } sbp_msg_group_delay_t; - - /** * Get encoded size of an instance of sbp_msg_group_delay_t * * @param msg sbp_msg_group_delay_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_group_delay_encoded_len(const sbp_msg_group_delay_t *msg) -{ +static inline size_t sbp_msg_group_delay_encoded_len( + const sbp_msg_group_delay_t *msg) { (void)msg; return SBP_MSG_GROUP_DELAY_ENCODED_LEN; } @@ -91,36 +83,53 @@ static inline size_t sbp_msg_group_delay_encoded_len(const sbp_msg_group_delay_t /** * Encode an instance of sbp_msg_group_delay_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_group_delay_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_group_delay_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_group_delay_t *msg); +SBP_EXPORT s8 sbp_msg_group_delay_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_group_delay_t *msg); /** * Decode an instance of sbp_msg_group_delay_t from wire representation * - * This function decodes the wire representation of a sbp_msg_group_delay_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_group_delay_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_group_delay_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_group_delay_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_group_delay_t *msg); +SBP_EXPORT s8 sbp_msg_group_delay_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_group_delay_t *msg); /** * Send an instance of sbp_msg_group_delay_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_group_delay_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_group_delay_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -128,51 +137,61 @@ SBP_EXPORT s8 sbp_msg_group_delay_decode(const uint8_t *buf, uint8_t len, uint8_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_group_delay_send(sbp_state_t *s, u16 sender_id, const sbp_msg_group_delay_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_group_delay_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_group_delay_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_group_delay_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_group_delay_t instance * @param b sbp_msg_group_delay_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_group_delay_cmp(const sbp_msg_group_delay_t *a, const sbp_msg_group_delay_t *b); +SBP_EXPORT int sbp_msg_group_delay_cmp(const sbp_msg_group_delay_t *a, + const sbp_msg_group_delay_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_group_delay_t &lhs, const sbp_msg_group_delay_t &rhs) { +static inline bool operator==(const sbp_msg_group_delay_t &lhs, + const sbp_msg_group_delay_t &rhs) { return sbp_msg_group_delay_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_group_delay_t &lhs, const sbp_msg_group_delay_t &rhs) { +static inline bool operator!=(const sbp_msg_group_delay_t &lhs, + const sbp_msg_group_delay_t &rhs) { return sbp_msg_group_delay_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_group_delay_t &lhs, const sbp_msg_group_delay_t &rhs) { +static inline bool operator<(const sbp_msg_group_delay_t &lhs, + const sbp_msg_group_delay_t &rhs) { return sbp_msg_group_delay_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_group_delay_t &lhs, const sbp_msg_group_delay_t &rhs) { +static inline bool operator<=(const sbp_msg_group_delay_t &lhs, + const sbp_msg_group_delay_t &rhs) { return sbp_msg_group_delay_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_group_delay_t &lhs, const sbp_msg_group_delay_t &rhs) { +static inline bool operator>(const sbp_msg_group_delay_t &lhs, + const sbp_msg_group_delay_t &rhs) { return sbp_msg_group_delay_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_group_delay_t &lhs, const sbp_msg_group_delay_t &rhs) { +static inline bool operator>=(const sbp_msg_group_delay_t &lhs, + const sbp_msg_group_delay_t &rhs) { return sbp_msg_group_delay_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_GROUP_DELAY_H */ - diff --git a/c/include/libsbp/observation/MSG_GROUP_DELAY_DEP_A.h b/c/include/libsbp/observation/MSG_GROUP_DELAY_DEP_A.h index 517973666..c87d9b54f 100644 --- a/c/include/libsbp/observation/MSG_GROUP_DELAY_DEP_A.h +++ b/c/include/libsbp/observation/MSG_GROUP_DELAY_DEP_A.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_GROUP_DELAY_DEP_A_H #define LIBSBP_OBSERVATION_MSG_GROUP_DELAY_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,48 +41,40 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Data Predict Time of Week + * Data Predict Time of Week */ sbp_gps_time_dep_t t_op; - /** -* Satellite number + * Satellite number */ u8 prn; - /** - * bit-field indicating validity of the values, LSB indicating tgd validity etc. 1 = value is valid, 0 = value is not valid. + * bit-field indicating validity of the values, LSB indicating tgd validity + * etc. 1 = value is valid, 0 = value is not valid. */ u8 valid; - s16 tgd; - s16 isc_l1ca; - s16 isc_l2c; } sbp_msg_group_delay_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_group_delay_dep_a_t * * @param msg sbp_msg_group_delay_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_group_delay_dep_a_encoded_len(const sbp_msg_group_delay_dep_a_t *msg) -{ +static inline size_t sbp_msg_group_delay_dep_a_encoded_len( + const sbp_msg_group_delay_dep_a_t *msg) { (void)msg; return SBP_MSG_GROUP_DELAY_DEP_A_ENCODED_LEN; } @@ -90,36 +82,53 @@ static inline size_t sbp_msg_group_delay_dep_a_encoded_len(const sbp_msg_group_d /** * Encode an instance of sbp_msg_group_delay_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_group_delay_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_group_delay_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_group_delay_dep_a_t *msg); +SBP_EXPORT s8 +sbp_msg_group_delay_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_group_delay_dep_a_t *msg); /** * Decode an instance of sbp_msg_group_delay_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_group_delay_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_group_delay_dep_a_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_group_delay_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_group_delay_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_group_delay_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_group_delay_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_group_delay_dep_a_t *msg); /** * Send an instance of sbp_msg_group_delay_dep_a_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_group_delay_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_group_delay_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -127,51 +136,61 @@ SBP_EXPORT s8 sbp_msg_group_delay_dep_a_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_group_delay_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_group_delay_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_group_delay_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_group_delay_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_group_delay_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_group_delay_dep_a_t instance * @param b sbp_msg_group_delay_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_group_delay_dep_a_cmp(const sbp_msg_group_delay_dep_a_t *a, const sbp_msg_group_delay_dep_a_t *b); +SBP_EXPORT int sbp_msg_group_delay_dep_a_cmp( + const sbp_msg_group_delay_dep_a_t *a, const sbp_msg_group_delay_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_group_delay_dep_a_t &lhs, const sbp_msg_group_delay_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_group_delay_dep_a_t &lhs, + const sbp_msg_group_delay_dep_a_t &rhs) { return sbp_msg_group_delay_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_group_delay_dep_a_t &lhs, const sbp_msg_group_delay_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_group_delay_dep_a_t &lhs, + const sbp_msg_group_delay_dep_a_t &rhs) { return sbp_msg_group_delay_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_group_delay_dep_a_t &lhs, const sbp_msg_group_delay_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_group_delay_dep_a_t &lhs, + const sbp_msg_group_delay_dep_a_t &rhs) { return sbp_msg_group_delay_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_group_delay_dep_a_t &lhs, const sbp_msg_group_delay_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_group_delay_dep_a_t &lhs, + const sbp_msg_group_delay_dep_a_t &rhs) { return sbp_msg_group_delay_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_group_delay_dep_a_t &lhs, const sbp_msg_group_delay_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_group_delay_dep_a_t &lhs, + const sbp_msg_group_delay_dep_a_t &rhs) { return sbp_msg_group_delay_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_group_delay_dep_a_t &lhs, const sbp_msg_group_delay_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_group_delay_dep_a_t &lhs, + const sbp_msg_group_delay_dep_a_t &rhs) { return sbp_msg_group_delay_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_GROUP_DELAY_DEP_A_H */ - diff --git a/c/include/libsbp/observation/MSG_GROUP_DELAY_DEP_B.h b/c/include/libsbp/observation/MSG_GROUP_DELAY_DEP_B.h index 5c298f0d2..2eb71a48d 100644 --- a/c/include/libsbp/observation/MSG_GROUP_DELAY_DEP_B.h +++ b/c/include/libsbp/observation/MSG_GROUP_DELAY_DEP_B.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_MSG_GROUP_DELAY_DEP_B_H #define LIBSBP_OBSERVATION_MSG_GROUP_DELAY_DEP_B_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,48 +42,40 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Data Predict Time of Week + * Data Predict Time of Week */ sbp_gps_time_sec_t t_op; - /** -* GNSS signal identifier + * GNSS signal identifier */ sbp_gnss_signal_dep_t sid; - /** - * bit-field indicating validity of the values, LSB indicating tgd validity etc. 1 = value is valid, 0 = value is not valid. + * bit-field indicating validity of the values, LSB indicating tgd validity + * etc. 1 = value is valid, 0 = value is not valid. */ u8 valid; - s16 tgd; - s16 isc_l1ca; - s16 isc_l2c; } sbp_msg_group_delay_dep_b_t; - - /** * Get encoded size of an instance of sbp_msg_group_delay_dep_b_t * * @param msg sbp_msg_group_delay_dep_b_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_group_delay_dep_b_encoded_len(const sbp_msg_group_delay_dep_b_t *msg) -{ +static inline size_t sbp_msg_group_delay_dep_b_encoded_len( + const sbp_msg_group_delay_dep_b_t *msg) { (void)msg; return SBP_MSG_GROUP_DELAY_DEP_B_ENCODED_LEN; } @@ -91,36 +83,53 @@ static inline size_t sbp_msg_group_delay_dep_b_encoded_len(const sbp_msg_group_d /** * Encode an instance of sbp_msg_group_delay_dep_b_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_group_delay_dep_b_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_group_delay_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_group_delay_dep_b_t *msg); +SBP_EXPORT s8 +sbp_msg_group_delay_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_group_delay_dep_b_t *msg); /** * Decode an instance of sbp_msg_group_delay_dep_b_t from wire representation * - * This function decodes the wire representation of a sbp_msg_group_delay_dep_b_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_group_delay_dep_b_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_group_delay_dep_b_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_group_delay_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_group_delay_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_group_delay_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_group_delay_dep_b_t *msg); /** * Send an instance of sbp_msg_group_delay_dep_b_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_group_delay_dep_b_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_group_delay_dep_b_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -128,51 +137,61 @@ SBP_EXPORT s8 sbp_msg_group_delay_dep_b_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_group_delay_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_group_delay_dep_b_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_group_delay_dep_b_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_group_delay_dep_b_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_group_delay_dep_b_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_group_delay_dep_b_t instance * @param b sbp_msg_group_delay_dep_b_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_group_delay_dep_b_cmp(const sbp_msg_group_delay_dep_b_t *a, const sbp_msg_group_delay_dep_b_t *b); +SBP_EXPORT int sbp_msg_group_delay_dep_b_cmp( + const sbp_msg_group_delay_dep_b_t *a, const sbp_msg_group_delay_dep_b_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_group_delay_dep_b_t &lhs, const sbp_msg_group_delay_dep_b_t &rhs) { +static inline bool operator==(const sbp_msg_group_delay_dep_b_t &lhs, + const sbp_msg_group_delay_dep_b_t &rhs) { return sbp_msg_group_delay_dep_b_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_group_delay_dep_b_t &lhs, const sbp_msg_group_delay_dep_b_t &rhs) { +static inline bool operator!=(const sbp_msg_group_delay_dep_b_t &lhs, + const sbp_msg_group_delay_dep_b_t &rhs) { return sbp_msg_group_delay_dep_b_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_group_delay_dep_b_t &lhs, const sbp_msg_group_delay_dep_b_t &rhs) { +static inline bool operator<(const sbp_msg_group_delay_dep_b_t &lhs, + const sbp_msg_group_delay_dep_b_t &rhs) { return sbp_msg_group_delay_dep_b_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_group_delay_dep_b_t &lhs, const sbp_msg_group_delay_dep_b_t &rhs) { +static inline bool operator<=(const sbp_msg_group_delay_dep_b_t &lhs, + const sbp_msg_group_delay_dep_b_t &rhs) { return sbp_msg_group_delay_dep_b_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_group_delay_dep_b_t &lhs, const sbp_msg_group_delay_dep_b_t &rhs) { +static inline bool operator>(const sbp_msg_group_delay_dep_b_t &lhs, + const sbp_msg_group_delay_dep_b_t &rhs) { return sbp_msg_group_delay_dep_b_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_group_delay_dep_b_t &lhs, const sbp_msg_group_delay_dep_b_t &rhs) { +static inline bool operator>=(const sbp_msg_group_delay_dep_b_t &lhs, + const sbp_msg_group_delay_dep_b_t &rhs) { return sbp_msg_group_delay_dep_b_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_GROUP_DELAY_DEP_B_H */ - diff --git a/c/include/libsbp/observation/MSG_IONO.h b/c/include/libsbp/observation/MSG_IONO.h index 5f6b8976d..5edd9aedc 100644 --- a/c/include/libsbp/observation/MSG_IONO.h +++ b/c/include/libsbp/observation/MSG_IONO.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_IONO_H #define LIBSBP_OBSERVATION_MSG_IONO_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,51 +41,40 @@ *****************************************************************************/ /** Iono corrections * -* The ionospheric parameters which allow the "L1 only" or "L2 only" user to utilize the ionospheric model for computation of the ionospheric delay. Please see ICD-GPS-200 (Chapter 20.3.3.5.1.7) for more details. + * The ionospheric parameters which allow the "L1 only" or "L2 only" user to + * utilize the ionospheric model for computation of the ionospheric delay. + * Please see ICD-GPS-200 (Chapter 20.3.3.5.1.7) for more details. */ typedef struct { - - /** -* Navigation Message Correction Table Validity Time + * Navigation Message Correction Table Validity Time */ sbp_gps_time_sec_t t_nmct; - double a0; - double a1; - double a2; - double a3; - double b0; - double b1; - double b2; - double b3; } sbp_msg_iono_t; - - /** * Get encoded size of an instance of sbp_msg_iono_t * * @param msg sbp_msg_iono_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_iono_encoded_len(const sbp_msg_iono_t *msg) -{ +static inline size_t sbp_msg_iono_encoded_len(const sbp_msg_iono_t *msg) { (void)msg; return SBP_MSG_IONO_ENCODED_LEN; } @@ -93,36 +82,51 @@ static inline size_t sbp_msg_iono_encoded_len(const sbp_msg_iono_t *msg) /** * Encode an instance of sbp_msg_iono_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_iono_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_iono_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_iono_t *msg); +SBP_EXPORT s8 sbp_msg_iono_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_iono_t *msg); /** * Decode an instance of sbp_msg_iono_t from wire representation * - * This function decodes the wire representation of a sbp_msg_iono_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_iono_t message to + * the given instance. The caller must specify the length of the buffer in the + * \p len parameter. If non-null the number of bytes read from the buffer will + * be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_iono_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_iono_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_iono_t *msg); +SBP_EXPORT s8 sbp_msg_iono_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_iono_t *msg); /** * Send an instance of sbp_msg_iono_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_iono_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_iono_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -130,51 +134,61 @@ SBP_EXPORT s8 sbp_msg_iono_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_iono_send(sbp_state_t *s, u16 sender_id, const sbp_msg_iono_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_iono_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_iono_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_iono_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_iono_t instance * @param b sbp_msg_iono_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_iono_cmp(const sbp_msg_iono_t *a, const sbp_msg_iono_t *b); +SBP_EXPORT int sbp_msg_iono_cmp(const sbp_msg_iono_t *a, + const sbp_msg_iono_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_iono_t &lhs, const sbp_msg_iono_t &rhs) { +static inline bool operator==(const sbp_msg_iono_t &lhs, + const sbp_msg_iono_t &rhs) { return sbp_msg_iono_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_iono_t &lhs, const sbp_msg_iono_t &rhs) { +static inline bool operator!=(const sbp_msg_iono_t &lhs, + const sbp_msg_iono_t &rhs) { return sbp_msg_iono_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_iono_t &lhs, const sbp_msg_iono_t &rhs) { +static inline bool operator<(const sbp_msg_iono_t &lhs, + const sbp_msg_iono_t &rhs) { return sbp_msg_iono_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_iono_t &lhs, const sbp_msg_iono_t &rhs) { +static inline bool operator<=(const sbp_msg_iono_t &lhs, + const sbp_msg_iono_t &rhs) { return sbp_msg_iono_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_iono_t &lhs, const sbp_msg_iono_t &rhs) { +static inline bool operator>(const sbp_msg_iono_t &lhs, + const sbp_msg_iono_t &rhs) { return sbp_msg_iono_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_iono_t &lhs, const sbp_msg_iono_t &rhs) { +static inline bool operator>=(const sbp_msg_iono_t &lhs, + const sbp_msg_iono_t &rhs) { return sbp_msg_iono_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_IONO_H */ - diff --git a/c/include/libsbp/observation/MSG_OBS.h b/c/include/libsbp/observation/MSG_OBS.h index 7bba8dc52..822fe12ae 100644 --- a/c/include/libsbp/observation/MSG_OBS.h +++ b/c/include/libsbp/observation/MSG_OBS.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_MSG_OBS_H #define LIBSBP_OBSERVATION_MSG_OBS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,79 +42,95 @@ *****************************************************************************/ /** GPS satellite observations * -* The GPS observations message reports all the raw pseudorange and carrier phase observations for the satellites being tracked by the device. Carrier phase observation here is represented as a 40-bit fixed point number with Q32.8 layout (i.e. 32-bits of whole cycles and 8-bits of fractional cycles). The observations are be interoperable with 3rd party receivers and conform with typical RTCMv3 GNSS observations. + * The GPS observations message reports all the raw pseudorange and carrier + * phase observations for the satellites being tracked by the device. Carrier + * phase observation here is represented as a 40-bit fixed point number with + * Q32.8 layout (i.e. 32-bits of whole cycles and 8-bits of fractional cycles). + * The observations are be interoperable with 3rd party receivers and conform + * with typical RTCMv3 GNSS observations. */ typedef struct { - - /** -* Header of a GPS observation message + * Header of a GPS observation message */ sbp_observation_header_t header; - /** - * Pseudorange and carrier phase observation for a satellite being tracked. + * Pseudorange and carrier phase observation for a satellite being tracked. */ sbp_packed_obs_content_t obs[SBP_MSG_OBS_OBS_MAX]; /** * Number of elements in obs * - * When sending a message fill in this field with the number elements set in obs before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * obs before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in obs. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * obs. The value of any elements beyond the index specified in this field is + * undefined */ u8 n_obs; } sbp_msg_obs_t; - - /** * Get encoded size of an instance of sbp_msg_obs_t * * @param msg sbp_msg_obs_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_obs_encoded_len(const sbp_msg_obs_t *msg) -{ - return SBP_MSG_OBS_ENCODED_OVERHEAD - + (msg->n_obs * SBP_PACKED_OBS_CONTENT_ENCODED_LEN) - ; +static inline size_t sbp_msg_obs_encoded_len(const sbp_msg_obs_t *msg) { + return SBP_MSG_OBS_ENCODED_OVERHEAD + + (msg->n_obs * SBP_PACKED_OBS_CONTENT_ENCODED_LEN); } /** * Encode an instance of sbp_msg_obs_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_obs_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_obs_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_obs_t *msg); +SBP_EXPORT s8 sbp_msg_obs_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_obs_t *msg); /** * Decode an instance of sbp_msg_obs_t from wire representation * - * This function decodes the wire representation of a sbp_msg_obs_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_obs_t message to + * the given instance. The caller must specify the length of the buffer in the + * \p len parameter. If non-null the number of bytes read from the buffer will + * be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_obs_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_obs_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_obs_t *msg); +SBP_EXPORT s8 sbp_msg_obs_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_obs_t *msg); /** * Send an instance of sbp_msg_obs_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_obs_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_obs_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -122,16 +138,19 @@ SBP_EXPORT s8 sbp_msg_obs_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_obs_send(sbp_state_t *s, u16 sender_id, const sbp_msg_obs_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_obs_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_obs_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_obs_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_obs_t instance * @param b sbp_msg_obs_t instance @@ -140,33 +159,38 @@ SBP_EXPORT s8 sbp_msg_obs_send(sbp_state_t *s, u16 sender_id, const sbp_msg_obs SBP_EXPORT int sbp_msg_obs_cmp(const sbp_msg_obs_t *a, const sbp_msg_obs_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_obs_t &lhs, const sbp_msg_obs_t &rhs) { +static inline bool operator==(const sbp_msg_obs_t &lhs, + const sbp_msg_obs_t &rhs) { return sbp_msg_obs_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_obs_t &lhs, const sbp_msg_obs_t &rhs) { +static inline bool operator!=(const sbp_msg_obs_t &lhs, + const sbp_msg_obs_t &rhs) { return sbp_msg_obs_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_obs_t &lhs, const sbp_msg_obs_t &rhs) { +static inline bool operator<(const sbp_msg_obs_t &lhs, + const sbp_msg_obs_t &rhs) { return sbp_msg_obs_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_obs_t &lhs, const sbp_msg_obs_t &rhs) { +static inline bool operator<=(const sbp_msg_obs_t &lhs, + const sbp_msg_obs_t &rhs) { return sbp_msg_obs_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_obs_t &lhs, const sbp_msg_obs_t &rhs) { +static inline bool operator>(const sbp_msg_obs_t &lhs, + const sbp_msg_obs_t &rhs) { return sbp_msg_obs_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_obs_t &lhs, const sbp_msg_obs_t &rhs) { +static inline bool operator>=(const sbp_msg_obs_t &lhs, + const sbp_msg_obs_t &rhs) { return sbp_msg_obs_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_OBS_H */ - diff --git a/c/include/libsbp/observation/MSG_OBS_DEP_A.h b/c/include/libsbp/observation/MSG_OBS_DEP_A.h index f16c9d202..ae3909880 100644 --- a/c/include/libsbp/observation/MSG_OBS_DEP_A.h +++ b/c/include/libsbp/observation/MSG_OBS_DEP_A.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_MSG_OBS_DEP_A_H #define LIBSBP_OBSERVATION_MSG_OBS_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,79 +42,93 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Header of a GPS observation message + * Header of a GPS observation message */ sbp_observation_header_dep_t header; - /** - * Pseudorange and carrier phase observation for a satellite being tracked. + * Pseudorange and carrier phase observation for a satellite being tracked. */ sbp_packed_obs_content_dep_a_t obs[SBP_MSG_OBS_DEP_A_OBS_MAX]; /** * Number of elements in obs * - * When sending a message fill in this field with the number elements set in obs before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * obs before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in obs. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * obs. The value of any elements beyond the index specified in this field is + * undefined */ u8 n_obs; } sbp_msg_obs_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_obs_dep_a_t * * @param msg sbp_msg_obs_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_obs_dep_a_encoded_len(const sbp_msg_obs_dep_a_t *msg) -{ - return SBP_MSG_OBS_DEP_A_ENCODED_OVERHEAD - + (msg->n_obs * SBP_PACKED_OBS_CONTENT_DEP_A_ENCODED_LEN) - ; +static inline size_t sbp_msg_obs_dep_a_encoded_len( + const sbp_msg_obs_dep_a_t *msg) { + return SBP_MSG_OBS_DEP_A_ENCODED_OVERHEAD + + (msg->n_obs * SBP_PACKED_OBS_CONTENT_DEP_A_ENCODED_LEN); } /** * Encode an instance of sbp_msg_obs_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_obs_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_obs_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_obs_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_obs_dep_a_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_obs_dep_a_t *msg); /** * Decode an instance of sbp_msg_obs_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_obs_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_obs_dep_a_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_obs_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_obs_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_obs_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_obs_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_obs_dep_a_t *msg); /** * Send an instance of sbp_msg_obs_dep_a_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_obs_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_obs_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -122,51 +136,61 @@ SBP_EXPORT s8 sbp_msg_obs_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_obs_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_obs_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_obs_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_obs_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_obs_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_obs_dep_a_t instance * @param b sbp_msg_obs_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_obs_dep_a_cmp(const sbp_msg_obs_dep_a_t *a, const sbp_msg_obs_dep_a_t *b); +SBP_EXPORT int sbp_msg_obs_dep_a_cmp(const sbp_msg_obs_dep_a_t *a, + const sbp_msg_obs_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_obs_dep_a_t &lhs, const sbp_msg_obs_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_obs_dep_a_t &lhs, + const sbp_msg_obs_dep_a_t &rhs) { return sbp_msg_obs_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_obs_dep_a_t &lhs, const sbp_msg_obs_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_obs_dep_a_t &lhs, + const sbp_msg_obs_dep_a_t &rhs) { return sbp_msg_obs_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_obs_dep_a_t &lhs, const sbp_msg_obs_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_obs_dep_a_t &lhs, + const sbp_msg_obs_dep_a_t &rhs) { return sbp_msg_obs_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_obs_dep_a_t &lhs, const sbp_msg_obs_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_obs_dep_a_t &lhs, + const sbp_msg_obs_dep_a_t &rhs) { return sbp_msg_obs_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_obs_dep_a_t &lhs, const sbp_msg_obs_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_obs_dep_a_t &lhs, + const sbp_msg_obs_dep_a_t &rhs) { return sbp_msg_obs_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_obs_dep_a_t &lhs, const sbp_msg_obs_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_obs_dep_a_t &lhs, + const sbp_msg_obs_dep_a_t &rhs) { return sbp_msg_obs_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_OBS_DEP_A_H */ - diff --git a/c/include/libsbp/observation/MSG_OBS_DEP_B.h b/c/include/libsbp/observation/MSG_OBS_DEP_B.h index f5e8db021..be010b04a 100644 --- a/c/include/libsbp/observation/MSG_OBS_DEP_B.h +++ b/c/include/libsbp/observation/MSG_OBS_DEP_B.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_MSG_OBS_DEP_B_H #define LIBSBP_OBSERVATION_MSG_OBS_DEP_B_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,79 +42,93 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Header of a GPS observation message + * Header of a GPS observation message */ sbp_observation_header_dep_t header; - /** - * Pseudorange and carrier phase observation for a satellite being tracked. + * Pseudorange and carrier phase observation for a satellite being tracked. */ sbp_packed_obs_content_dep_b_t obs[SBP_MSG_OBS_DEP_B_OBS_MAX]; /** * Number of elements in obs * - * When sending a message fill in this field with the number elements set in obs before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * obs before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in obs. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * obs. The value of any elements beyond the index specified in this field is + * undefined */ u8 n_obs; } sbp_msg_obs_dep_b_t; - - /** * Get encoded size of an instance of sbp_msg_obs_dep_b_t * * @param msg sbp_msg_obs_dep_b_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_obs_dep_b_encoded_len(const sbp_msg_obs_dep_b_t *msg) -{ - return SBP_MSG_OBS_DEP_B_ENCODED_OVERHEAD - + (msg->n_obs * SBP_PACKED_OBS_CONTENT_DEP_B_ENCODED_LEN) - ; +static inline size_t sbp_msg_obs_dep_b_encoded_len( + const sbp_msg_obs_dep_b_t *msg) { + return SBP_MSG_OBS_DEP_B_ENCODED_OVERHEAD + + (msg->n_obs * SBP_PACKED_OBS_CONTENT_DEP_B_ENCODED_LEN); } /** * Encode an instance of sbp_msg_obs_dep_b_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_obs_dep_b_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_obs_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_obs_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_obs_dep_b_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_obs_dep_b_t *msg); /** * Decode an instance of sbp_msg_obs_dep_b_t from wire representation * - * This function decodes the wire representation of a sbp_msg_obs_dep_b_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_obs_dep_b_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_obs_dep_b_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_obs_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_obs_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_obs_dep_b_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_obs_dep_b_t *msg); /** * Send an instance of sbp_msg_obs_dep_b_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_obs_dep_b_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_obs_dep_b_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -122,51 +136,61 @@ SBP_EXPORT s8 sbp_msg_obs_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_obs_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_obs_dep_b_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_obs_dep_b_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_obs_dep_b_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_obs_dep_b_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_obs_dep_b_t instance * @param b sbp_msg_obs_dep_b_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_obs_dep_b_cmp(const sbp_msg_obs_dep_b_t *a, const sbp_msg_obs_dep_b_t *b); +SBP_EXPORT int sbp_msg_obs_dep_b_cmp(const sbp_msg_obs_dep_b_t *a, + const sbp_msg_obs_dep_b_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_obs_dep_b_t &lhs, const sbp_msg_obs_dep_b_t &rhs) { +static inline bool operator==(const sbp_msg_obs_dep_b_t &lhs, + const sbp_msg_obs_dep_b_t &rhs) { return sbp_msg_obs_dep_b_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_obs_dep_b_t &lhs, const sbp_msg_obs_dep_b_t &rhs) { +static inline bool operator!=(const sbp_msg_obs_dep_b_t &lhs, + const sbp_msg_obs_dep_b_t &rhs) { return sbp_msg_obs_dep_b_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_obs_dep_b_t &lhs, const sbp_msg_obs_dep_b_t &rhs) { +static inline bool operator<(const sbp_msg_obs_dep_b_t &lhs, + const sbp_msg_obs_dep_b_t &rhs) { return sbp_msg_obs_dep_b_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_obs_dep_b_t &lhs, const sbp_msg_obs_dep_b_t &rhs) { +static inline bool operator<=(const sbp_msg_obs_dep_b_t &lhs, + const sbp_msg_obs_dep_b_t &rhs) { return sbp_msg_obs_dep_b_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_obs_dep_b_t &lhs, const sbp_msg_obs_dep_b_t &rhs) { +static inline bool operator>(const sbp_msg_obs_dep_b_t &lhs, + const sbp_msg_obs_dep_b_t &rhs) { return sbp_msg_obs_dep_b_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_obs_dep_b_t &lhs, const sbp_msg_obs_dep_b_t &rhs) { +static inline bool operator>=(const sbp_msg_obs_dep_b_t &lhs, + const sbp_msg_obs_dep_b_t &rhs) { return sbp_msg_obs_dep_b_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_OBS_DEP_B_H */ - diff --git a/c/include/libsbp/observation/MSG_OBS_DEP_C.h b/c/include/libsbp/observation/MSG_OBS_DEP_C.h index d3ba1073f..64970eea6 100644 --- a/c/include/libsbp/observation/MSG_OBS_DEP_C.h +++ b/c/include/libsbp/observation/MSG_OBS_DEP_C.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_MSG_OBS_DEP_C_H #define LIBSBP_OBSERVATION_MSG_OBS_DEP_C_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,79 +42,93 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Header of a GPS observation message + * Header of a GPS observation message */ sbp_observation_header_dep_t header; - /** - * Pseudorange and carrier phase observation for a satellite being tracked. + * Pseudorange and carrier phase observation for a satellite being tracked. */ sbp_packed_obs_content_dep_c_t obs[SBP_MSG_OBS_DEP_C_OBS_MAX]; /** * Number of elements in obs * - * When sending a message fill in this field with the number elements set in obs before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * obs before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in obs. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * obs. The value of any elements beyond the index specified in this field is + * undefined */ u8 n_obs; } sbp_msg_obs_dep_c_t; - - /** * Get encoded size of an instance of sbp_msg_obs_dep_c_t * * @param msg sbp_msg_obs_dep_c_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_obs_dep_c_encoded_len(const sbp_msg_obs_dep_c_t *msg) -{ - return SBP_MSG_OBS_DEP_C_ENCODED_OVERHEAD - + (msg->n_obs * SBP_PACKED_OBS_CONTENT_DEP_C_ENCODED_LEN) - ; +static inline size_t sbp_msg_obs_dep_c_encoded_len( + const sbp_msg_obs_dep_c_t *msg) { + return SBP_MSG_OBS_DEP_C_ENCODED_OVERHEAD + + (msg->n_obs * SBP_PACKED_OBS_CONTENT_DEP_C_ENCODED_LEN); } /** * Encode an instance of sbp_msg_obs_dep_c_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_obs_dep_c_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_obs_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_obs_dep_c_t *msg); +SBP_EXPORT s8 sbp_msg_obs_dep_c_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_obs_dep_c_t *msg); /** * Decode an instance of sbp_msg_obs_dep_c_t from wire representation * - * This function decodes the wire representation of a sbp_msg_obs_dep_c_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_obs_dep_c_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_obs_dep_c_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_obs_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_obs_dep_c_t *msg); +SBP_EXPORT s8 sbp_msg_obs_dep_c_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_obs_dep_c_t *msg); /** * Send an instance of sbp_msg_obs_dep_c_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_obs_dep_c_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_obs_dep_c_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -122,51 +136,61 @@ SBP_EXPORT s8 sbp_msg_obs_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_obs_dep_c_send(sbp_state_t *s, u16 sender_id, const sbp_msg_obs_dep_c_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_obs_dep_c_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_obs_dep_c_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_obs_dep_c_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_obs_dep_c_t instance * @param b sbp_msg_obs_dep_c_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_obs_dep_c_cmp(const sbp_msg_obs_dep_c_t *a, const sbp_msg_obs_dep_c_t *b); +SBP_EXPORT int sbp_msg_obs_dep_c_cmp(const sbp_msg_obs_dep_c_t *a, + const sbp_msg_obs_dep_c_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_obs_dep_c_t &lhs, const sbp_msg_obs_dep_c_t &rhs) { +static inline bool operator==(const sbp_msg_obs_dep_c_t &lhs, + const sbp_msg_obs_dep_c_t &rhs) { return sbp_msg_obs_dep_c_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_obs_dep_c_t &lhs, const sbp_msg_obs_dep_c_t &rhs) { +static inline bool operator!=(const sbp_msg_obs_dep_c_t &lhs, + const sbp_msg_obs_dep_c_t &rhs) { return sbp_msg_obs_dep_c_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_obs_dep_c_t &lhs, const sbp_msg_obs_dep_c_t &rhs) { +static inline bool operator<(const sbp_msg_obs_dep_c_t &lhs, + const sbp_msg_obs_dep_c_t &rhs) { return sbp_msg_obs_dep_c_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_obs_dep_c_t &lhs, const sbp_msg_obs_dep_c_t &rhs) { +static inline bool operator<=(const sbp_msg_obs_dep_c_t &lhs, + const sbp_msg_obs_dep_c_t &rhs) { return sbp_msg_obs_dep_c_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_obs_dep_c_t &lhs, const sbp_msg_obs_dep_c_t &rhs) { +static inline bool operator>(const sbp_msg_obs_dep_c_t &lhs, + const sbp_msg_obs_dep_c_t &rhs) { return sbp_msg_obs_dep_c_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_obs_dep_c_t &lhs, const sbp_msg_obs_dep_c_t &rhs) { +static inline bool operator>=(const sbp_msg_obs_dep_c_t &lhs, + const sbp_msg_obs_dep_c_t &rhs) { return sbp_msg_obs_dep_c_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_OBS_DEP_C_H */ - diff --git a/c/include/libsbp/observation/MSG_OSR.h b/c/include/libsbp/observation/MSG_OSR.h index ddf9b7522..440c2aa8c 100644 --- a/c/include/libsbp/observation/MSG_OSR.h +++ b/c/include/libsbp/observation/MSG_OSR.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_MSG_OSR_H #define LIBSBP_OBSERVATION_MSG_OSR_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,79 +42,90 @@ *****************************************************************************/ /** OSR corrections * -* The OSR message contains network corrections in an observation-like format. + * The OSR message contains network corrections in an observation-like format. */ typedef struct { - - /** -* Header of a GPS observation message + * Header of a GPS observation message */ sbp_observation_header_t header; - /** - * Network correction for a satellite signal. + * Network correction for a satellite signal. */ sbp_packed_osr_content_t obs[SBP_MSG_OSR_OBS_MAX]; /** * Number of elements in obs * - * When sending a message fill in this field with the number elements set in obs before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * obs before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in obs. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * obs. The value of any elements beyond the index specified in this field is + * undefined */ u8 n_obs; } sbp_msg_osr_t; - - /** * Get encoded size of an instance of sbp_msg_osr_t * * @param msg sbp_msg_osr_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_osr_encoded_len(const sbp_msg_osr_t *msg) -{ - return SBP_MSG_OSR_ENCODED_OVERHEAD - + (msg->n_obs * SBP_PACKED_OSR_CONTENT_ENCODED_LEN) - ; +static inline size_t sbp_msg_osr_encoded_len(const sbp_msg_osr_t *msg) { + return SBP_MSG_OSR_ENCODED_OVERHEAD + + (msg->n_obs * SBP_PACKED_OSR_CONTENT_ENCODED_LEN); } /** * Encode an instance of sbp_msg_osr_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_osr_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_osr_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_osr_t *msg); +SBP_EXPORT s8 sbp_msg_osr_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_osr_t *msg); /** * Decode an instance of sbp_msg_osr_t from wire representation * - * This function decodes the wire representation of a sbp_msg_osr_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_osr_t message to + * the given instance. The caller must specify the length of the buffer in the + * \p len parameter. If non-null the number of bytes read from the buffer will + * be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_osr_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_osr_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_osr_t *msg); +SBP_EXPORT s8 sbp_msg_osr_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_osr_t *msg); /** * Send an instance of sbp_msg_osr_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_osr_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_osr_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -122,16 +133,19 @@ SBP_EXPORT s8 sbp_msg_osr_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_osr_send(sbp_state_t *s, u16 sender_id, const sbp_msg_osr_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_osr_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_osr_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_osr_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_osr_t instance * @param b sbp_msg_osr_t instance @@ -140,33 +154,38 @@ SBP_EXPORT s8 sbp_msg_osr_send(sbp_state_t *s, u16 sender_id, const sbp_msg_osr SBP_EXPORT int sbp_msg_osr_cmp(const sbp_msg_osr_t *a, const sbp_msg_osr_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_osr_t &lhs, const sbp_msg_osr_t &rhs) { +static inline bool operator==(const sbp_msg_osr_t &lhs, + const sbp_msg_osr_t &rhs) { return sbp_msg_osr_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_osr_t &lhs, const sbp_msg_osr_t &rhs) { +static inline bool operator!=(const sbp_msg_osr_t &lhs, + const sbp_msg_osr_t &rhs) { return sbp_msg_osr_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_osr_t &lhs, const sbp_msg_osr_t &rhs) { +static inline bool operator<(const sbp_msg_osr_t &lhs, + const sbp_msg_osr_t &rhs) { return sbp_msg_osr_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_osr_t &lhs, const sbp_msg_osr_t &rhs) { +static inline bool operator<=(const sbp_msg_osr_t &lhs, + const sbp_msg_osr_t &rhs) { return sbp_msg_osr_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_osr_t &lhs, const sbp_msg_osr_t &rhs) { +static inline bool operator>(const sbp_msg_osr_t &lhs, + const sbp_msg_osr_t &rhs) { return sbp_msg_osr_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_osr_t &lhs, const sbp_msg_osr_t &rhs) { +static inline bool operator>=(const sbp_msg_osr_t &lhs, + const sbp_msg_osr_t &rhs) { return sbp_msg_osr_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_OSR_H */ - diff --git a/c/include/libsbp/observation/MSG_SV_AZ_EL.h b/c/include/libsbp/observation/MSG_SV_AZ_EL.h index 2b234a196..2218edf1f 100644 --- a/c/include/libsbp/observation/MSG_SV_AZ_EL.h +++ b/c/include/libsbp/observation/MSG_SV_AZ_EL.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_SV_AZ_EL_H #define LIBSBP_OBSERVATION_MSG_SV_AZ_EL_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,73 +41,88 @@ *****************************************************************************/ /** Satellite azimuths and elevations * -* Azimuth and elevation angles of all the visible satellites that the device does have ephemeris or almanac for. + * Azimuth and elevation angles of all the visible satellites that the device + * does have ephemeris or almanac for. */ typedef struct { - - /** -* Azimuth and elevation per satellite + * Azimuth and elevation per satellite */ sbp_sv_az_el_t azel[SBP_MSG_SV_AZ_EL_AZEL_MAX]; /** * Number of elements in azel * - * When sending a message fill in this field with the number elements set in azel before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * azel before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in azel. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * azel. The value of any elements beyond the index specified in this field is + * undefined */ u8 n_azel; } sbp_msg_sv_az_el_t; - - /** * Get encoded size of an instance of sbp_msg_sv_az_el_t * * @param msg sbp_msg_sv_az_el_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_sv_az_el_encoded_len(const sbp_msg_sv_az_el_t *msg) -{ - return SBP_MSG_SV_AZ_EL_ENCODED_OVERHEAD - + (msg->n_azel * SBP_SV_AZ_EL_ENCODED_LEN) - ; +static inline size_t sbp_msg_sv_az_el_encoded_len( + const sbp_msg_sv_az_el_t *msg) { + return SBP_MSG_SV_AZ_EL_ENCODED_OVERHEAD + + (msg->n_azel * SBP_SV_AZ_EL_ENCODED_LEN); } /** * Encode an instance of sbp_msg_sv_az_el_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_sv_az_el_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_sv_az_el_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_sv_az_el_t *msg); +SBP_EXPORT s8 sbp_msg_sv_az_el_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_sv_az_el_t *msg); /** * Decode an instance of sbp_msg_sv_az_el_t from wire representation * - * This function decodes the wire representation of a sbp_msg_sv_az_el_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_sv_az_el_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_sv_az_el_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_sv_az_el_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_sv_az_el_t *msg); +SBP_EXPORT s8 sbp_msg_sv_az_el_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_sv_az_el_t *msg); /** * Send an instance of sbp_msg_sv_az_el_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_sv_az_el_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_sv_az_el_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -115,51 +130,61 @@ SBP_EXPORT s8 sbp_msg_sv_az_el_decode(const uint8_t *buf, uint8_t len, uint8_t * * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_sv_az_el_send(sbp_state_t *s, u16 sender_id, const sbp_msg_sv_az_el_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_sv_az_el_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_sv_az_el_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_sv_az_el_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_sv_az_el_t instance * @param b sbp_msg_sv_az_el_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_sv_az_el_cmp(const sbp_msg_sv_az_el_t *a, const sbp_msg_sv_az_el_t *b); +SBP_EXPORT int sbp_msg_sv_az_el_cmp(const sbp_msg_sv_az_el_t *a, + const sbp_msg_sv_az_el_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_sv_az_el_t &lhs, const sbp_msg_sv_az_el_t &rhs) { +static inline bool operator==(const sbp_msg_sv_az_el_t &lhs, + const sbp_msg_sv_az_el_t &rhs) { return sbp_msg_sv_az_el_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_sv_az_el_t &lhs, const sbp_msg_sv_az_el_t &rhs) { +static inline bool operator!=(const sbp_msg_sv_az_el_t &lhs, + const sbp_msg_sv_az_el_t &rhs) { return sbp_msg_sv_az_el_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_sv_az_el_t &lhs, const sbp_msg_sv_az_el_t &rhs) { +static inline bool operator<(const sbp_msg_sv_az_el_t &lhs, + const sbp_msg_sv_az_el_t &rhs) { return sbp_msg_sv_az_el_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_sv_az_el_t &lhs, const sbp_msg_sv_az_el_t &rhs) { +static inline bool operator<=(const sbp_msg_sv_az_el_t &lhs, + const sbp_msg_sv_az_el_t &rhs) { return sbp_msg_sv_az_el_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_sv_az_el_t &lhs, const sbp_msg_sv_az_el_t &rhs) { +static inline bool operator>(const sbp_msg_sv_az_el_t &lhs, + const sbp_msg_sv_az_el_t &rhs) { return sbp_msg_sv_az_el_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_sv_az_el_t &lhs, const sbp_msg_sv_az_el_t &rhs) { +static inline bool operator>=(const sbp_msg_sv_az_el_t &lhs, + const sbp_msg_sv_az_el_t &rhs) { return sbp_msg_sv_az_el_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_SV_AZ_EL_H */ - diff --git a/c/include/libsbp/observation/MSG_SV_CONFIGURATION_GPS_DEP.h b/c/include/libsbp/observation/MSG_SV_CONFIGURATION_GPS_DEP.h index 2b4c6c29f..cadaa2f78 100644 --- a/c/include/libsbp/observation/MSG_SV_CONFIGURATION_GPS_DEP.h +++ b/c/include/libsbp/observation/MSG_SV_CONFIGURATION_GPS_DEP.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_MSG_SV_CONFIGURATION_GPS_DEP_H #define LIBSBP_OBSERVATION_MSG_SV_CONFIGURATION_GPS_DEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,70 +41,86 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Navigation Message Correction Table Validity Time + * Navigation Message Correction Table Validity Time */ sbp_gps_time_sec_t t_nmct; - /** -* L2C capability mask, SV32 bit being MSB, SV1 bit being LSB + * L2C capability mask, SV32 bit being MSB, SV1 bit being LSB */ u32 l2c_mask; } sbp_msg_sv_configuration_gps_dep_t; - - /** * Get encoded size of an instance of sbp_msg_sv_configuration_gps_dep_t * * @param msg sbp_msg_sv_configuration_gps_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_sv_configuration_gps_dep_encoded_len(const sbp_msg_sv_configuration_gps_dep_t *msg) -{ +static inline size_t sbp_msg_sv_configuration_gps_dep_encoded_len( + const sbp_msg_sv_configuration_gps_dep_t *msg) { (void)msg; return SBP_MSG_SV_CONFIGURATION_GPS_DEP_ENCODED_LEN; } /** - * Encode an instance of sbp_msg_sv_configuration_gps_dep_t to wire representation + * Encode an instance of sbp_msg_sv_configuration_gps_dep_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_sv_configuration_gps_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_sv_configuration_gps_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_sv_configuration_gps_dep_t *msg); +SBP_EXPORT s8 sbp_msg_sv_configuration_gps_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_sv_configuration_gps_dep_t *msg); /** - * Decode an instance of sbp_msg_sv_configuration_gps_dep_t from wire representation + * Decode an instance of sbp_msg_sv_configuration_gps_dep_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_sv_configuration_gps_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_sv_configuration_gps_dep_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_sv_configuration_gps_dep_t instance + * @param buf Wire representation of the sbp_msg_sv_configuration_gps_dep_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_sv_configuration_gps_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_sv_configuration_gps_dep_t *msg); +SBP_EXPORT s8 sbp_msg_sv_configuration_gps_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_sv_configuration_gps_dep_t *msg); /** - * Send an instance of sbp_msg_sv_configuration_gps_dep_t with the given write function + * Send an instance of sbp_msg_sv_configuration_gps_dep_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_sv_configuration_gps_dep_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_sv_configuration_gps_dep_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -112,51 +128,62 @@ SBP_EXPORT s8 sbp_msg_sv_configuration_gps_dep_decode(const uint8_t *buf, uint8_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_sv_configuration_gps_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_sv_configuration_gps_dep_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_sv_configuration_gps_dep_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_sv_configuration_gps_dep_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_sv_configuration_gps_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_sv_configuration_gps_dep_t instance * @param b sbp_msg_sv_configuration_gps_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_sv_configuration_gps_dep_cmp(const sbp_msg_sv_configuration_gps_dep_t *a, const sbp_msg_sv_configuration_gps_dep_t *b); +SBP_EXPORT int sbp_msg_sv_configuration_gps_dep_cmp( + const sbp_msg_sv_configuration_gps_dep_t *a, + const sbp_msg_sv_configuration_gps_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_sv_configuration_gps_dep_t &lhs, const sbp_msg_sv_configuration_gps_dep_t &rhs) { +static inline bool operator==(const sbp_msg_sv_configuration_gps_dep_t &lhs, + const sbp_msg_sv_configuration_gps_dep_t &rhs) { return sbp_msg_sv_configuration_gps_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_sv_configuration_gps_dep_t &lhs, const sbp_msg_sv_configuration_gps_dep_t &rhs) { +static inline bool operator!=(const sbp_msg_sv_configuration_gps_dep_t &lhs, + const sbp_msg_sv_configuration_gps_dep_t &rhs) { return sbp_msg_sv_configuration_gps_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_sv_configuration_gps_dep_t &lhs, const sbp_msg_sv_configuration_gps_dep_t &rhs) { +static inline bool operator<(const sbp_msg_sv_configuration_gps_dep_t &lhs, + const sbp_msg_sv_configuration_gps_dep_t &rhs) { return sbp_msg_sv_configuration_gps_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_sv_configuration_gps_dep_t &lhs, const sbp_msg_sv_configuration_gps_dep_t &rhs) { +static inline bool operator<=(const sbp_msg_sv_configuration_gps_dep_t &lhs, + const sbp_msg_sv_configuration_gps_dep_t &rhs) { return sbp_msg_sv_configuration_gps_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_sv_configuration_gps_dep_t &lhs, const sbp_msg_sv_configuration_gps_dep_t &rhs) { +static inline bool operator>(const sbp_msg_sv_configuration_gps_dep_t &lhs, + const sbp_msg_sv_configuration_gps_dep_t &rhs) { return sbp_msg_sv_configuration_gps_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_sv_configuration_gps_dep_t &lhs, const sbp_msg_sv_configuration_gps_dep_t &rhs) { +static inline bool operator>=(const sbp_msg_sv_configuration_gps_dep_t &lhs, + const sbp_msg_sv_configuration_gps_dep_t &rhs) { return sbp_msg_sv_configuration_gps_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_MSG_SV_CONFIGURATION_GPS_DEP_H */ - diff --git a/c/include/libsbp/observation/ObservationHeader.h b/c/include/libsbp/observation/ObservationHeader.h index f623a56b2..5cd1658e0 100644 --- a/c/include/libsbp/observation/ObservationHeader.h +++ b/c/include/libsbp/observation/ObservationHeader.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_OBSERVATIONHEADER_H #define LIBSBP_OBSERVATION_OBSERVATIONHEADER_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,33 +41,29 @@ *****************************************************************************/ /** Header for observation message * -* Header of a GNSS observation message. + * Header of a GNSS observation message. */ typedef struct { - - /** -* GNSS time of this observation + * GNSS time of this observation */ sbp_v4_gps_time_t t; - /** - * Total number of observations. First nibble is the size of the sequence (n), second nibble is the zero-indexed counter (ith packet of n) + * Total number of observations. First nibble is the size of the sequence (n), + * second nibble is the zero-indexed counter (ith packet of n) */ u8 n_obs; } sbp_observation_header_t; - - /** * Get encoded size of an instance of sbp_observation_header_t * * @param msg sbp_observation_header_t instance * @return Length of on-wire representation */ -static inline size_t sbp_observation_header_encoded_len(const sbp_observation_header_t *msg) -{ +static inline size_t sbp_observation_header_encoded_len( + const sbp_observation_header_t *msg) { (void)msg; return SBP_OBSERVATION_HEADER_ENCODED_LEN; } @@ -75,74 +71,96 @@ static inline size_t sbp_observation_header_encoded_len(const sbp_observation_he /** * Encode an instance of sbp_observation_header_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_observation_header_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_observation_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_observation_header_t *msg); +SBP_EXPORT s8 +sbp_observation_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_observation_header_t *msg); /** * Decode an instance of sbp_observation_header_t from wire representation * - * This function decodes the wire representation of a sbp_observation_header_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_observation_header_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_observation_header_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_observation_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_observation_header_t *msg); +SBP_EXPORT s8 sbp_observation_header_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_observation_header_t *msg); /** * Compare two instances of sbp_observation_header_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_observation_header_t instance * @param b sbp_observation_header_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_observation_header_cmp(const sbp_observation_header_t *a, const sbp_observation_header_t *b); +SBP_EXPORT int sbp_observation_header_cmp(const sbp_observation_header_t *a, + const sbp_observation_header_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_observation_header_t &lhs, const sbp_observation_header_t &rhs) { +static inline bool operator==(const sbp_observation_header_t &lhs, + const sbp_observation_header_t &rhs) { return sbp_observation_header_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_observation_header_t &lhs, const sbp_observation_header_t &rhs) { +static inline bool operator!=(const sbp_observation_header_t &lhs, + const sbp_observation_header_t &rhs) { return sbp_observation_header_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_observation_header_t &lhs, const sbp_observation_header_t &rhs) { +static inline bool operator<(const sbp_observation_header_t &lhs, + const sbp_observation_header_t &rhs) { return sbp_observation_header_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_observation_header_t &lhs, const sbp_observation_header_t &rhs) { +static inline bool operator<=(const sbp_observation_header_t &lhs, + const sbp_observation_header_t &rhs) { return sbp_observation_header_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_observation_header_t &lhs, const sbp_observation_header_t &rhs) { +static inline bool operator>(const sbp_observation_header_t &lhs, + const sbp_observation_header_t &rhs) { return sbp_observation_header_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_observation_header_t &lhs, const sbp_observation_header_t &rhs) { +static inline bool operator>=(const sbp_observation_header_t &lhs, + const sbp_observation_header_t &rhs) { return sbp_observation_header_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_OBSERVATIONHEADER_H */ - diff --git a/c/include/libsbp/observation/ObservationHeaderDep.h b/c/include/libsbp/observation/ObservationHeaderDep.h index be2256c9d..60fef88cc 100644 --- a/c/include/libsbp/observation/ObservationHeaderDep.h +++ b/c/include/libsbp/observation/ObservationHeaderDep.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_OBSERVATIONHEADERDEP_H #define LIBSBP_OBSERVATION_OBSERVATIONHEADERDEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,33 +41,29 @@ *****************************************************************************/ /** Header for observation message * -* Header of a GPS observation message. + * Header of a GPS observation message. */ typedef struct { - - /** -* GPS time of this observation + * GPS time of this observation */ sbp_gps_time_dep_t t; - /** - * Total number of observations. First nibble is the size of the sequence (n), second nibble is the zero-indexed counter (ith packet of n) + * Total number of observations. First nibble is the size of the sequence (n), + * second nibble is the zero-indexed counter (ith packet of n) */ u8 n_obs; } sbp_observation_header_dep_t; - - /** * Get encoded size of an instance of sbp_observation_header_dep_t * * @param msg sbp_observation_header_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_observation_header_dep_encoded_len(const sbp_observation_header_dep_t *msg) -{ +static inline size_t sbp_observation_header_dep_encoded_len( + const sbp_observation_header_dep_t *msg) { (void)msg; return SBP_OBSERVATION_HEADER_DEP_ENCODED_LEN; } @@ -75,74 +71,97 @@ static inline size_t sbp_observation_header_dep_encoded_len(const sbp_observatio /** * Encode an instance of sbp_observation_header_dep_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_observation_header_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_observation_header_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_observation_header_dep_t *msg); +SBP_EXPORT s8 +sbp_observation_header_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_observation_header_dep_t *msg); /** * Decode an instance of sbp_observation_header_dep_t from wire representation * - * This function decodes the wire representation of a sbp_observation_header_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_observation_header_dep_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_observation_header_dep_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_observation_header_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_observation_header_dep_t *msg); +SBP_EXPORT s8 sbp_observation_header_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_observation_header_dep_t *msg); /** * Compare two instances of sbp_observation_header_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_observation_header_dep_t instance * @param b sbp_observation_header_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_observation_header_dep_cmp(const sbp_observation_header_dep_t *a, const sbp_observation_header_dep_t *b); +SBP_EXPORT int sbp_observation_header_dep_cmp( + const sbp_observation_header_dep_t *a, + const sbp_observation_header_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_observation_header_dep_t &lhs, const sbp_observation_header_dep_t &rhs) { +static inline bool operator==(const sbp_observation_header_dep_t &lhs, + const sbp_observation_header_dep_t &rhs) { return sbp_observation_header_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_observation_header_dep_t &lhs, const sbp_observation_header_dep_t &rhs) { +static inline bool operator!=(const sbp_observation_header_dep_t &lhs, + const sbp_observation_header_dep_t &rhs) { return sbp_observation_header_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_observation_header_dep_t &lhs, const sbp_observation_header_dep_t &rhs) { +static inline bool operator<(const sbp_observation_header_dep_t &lhs, + const sbp_observation_header_dep_t &rhs) { return sbp_observation_header_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_observation_header_dep_t &lhs, const sbp_observation_header_dep_t &rhs) { +static inline bool operator<=(const sbp_observation_header_dep_t &lhs, + const sbp_observation_header_dep_t &rhs) { return sbp_observation_header_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_observation_header_dep_t &lhs, const sbp_observation_header_dep_t &rhs) { +static inline bool operator>(const sbp_observation_header_dep_t &lhs, + const sbp_observation_header_dep_t &rhs) { return sbp_observation_header_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_observation_header_dep_t &lhs, const sbp_observation_header_dep_t &rhs) { +static inline bool operator>=(const sbp_observation_header_dep_t &lhs, + const sbp_observation_header_dep_t &rhs) { return sbp_observation_header_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_OBSERVATIONHEADERDEP_H */ - diff --git a/c/include/libsbp/observation/PackedObsContent.h b/c/include/libsbp/observation/PackedObsContent.h index 8ab44801d..f9e9c1bbe 100644 --- a/c/include/libsbp/observation/PackedObsContent.h +++ b/c/include/libsbp/observation/PackedObsContent.h @@ -18,22 +18,22 @@ #ifndef LIBSBP_OBSERVATION_PACKEDOBSCONTENT_H #define LIBSBP_OBSERVATION_PACKEDOBSCONTENT_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -43,64 +43,62 @@ *****************************************************************************/ /** GNSS observations for a particular satellite signal * - * Pseudorange and carrier phase observation for a satellite being tracked. The observations are interoperable with 3rd party receivers and conform with typical RTCM 3.1 message GPS/GLO observations. - * + * Pseudorange and carrier phase observation for a satellite being tracked. The + * observations are interoperable with 3rd party receivers and conform with + * typical RTCM 3.1 message GPS/GLO observations. + * */ typedef struct { - - /** -* Pseudorange observation [2 cm] + * Pseudorange observation [2 cm] */ u32 P; - /** -* Carrier phase observation with typical sign convention. [cycles] + * Carrier phase observation with typical sign convention. [cycles] */ sbp_carrier_phase_t L; - /** -* Doppler observation with typical sign convention. [Hz] + * Doppler observation with typical sign convention. [Hz] */ sbp_doppler_t D; - /** -* Carrier-to-Noise density. Zero implies invalid cn0. [dB Hz / 4] + * Carrier-to-Noise density. Zero implies invalid cn0. [dB Hz / 4] */ u8 cn0; - /** - * Lock timer. This value gives an indication of the time for which a signal has maintained continuous phase lock. Whenever a signal has lost and regained lock, this value is reset to zero. It is encoded according to DF402 from the RTCM 10403.2 Amendment 2 specification. Valid values range from 0 to 15 and the most significant nibble is reserved for future use. + * Lock timer. This value gives an indication of the time for which a signal + * has maintained continuous phase lock. Whenever a signal has lost and + * regained lock, this value is reset to zero. It is encoded according to + * DF402 from the RTCM 10403.2 Amendment 2 specification. Valid values range + * from 0 to 15 and the most significant nibble is reserved for future use. */ u8 lock; - /** - * Measurement status flags. A bit field of flags providing the status of this observation. If this field is 0 it means only the Cn0 estimate for the signal is valid. + * Measurement status flags. A bit field of flags providing the status of this + * observation. If this field is 0 it means only the Cn0 estimate for the + * signal is valid. */ u8 flags; - /** -* GNSS signal identifier (16 bit) + * GNSS signal identifier (16 bit) */ sbp_v4_gnss_signal_t sid; } sbp_packed_obs_content_t; - - /** * Get encoded size of an instance of sbp_packed_obs_content_t * * @param msg sbp_packed_obs_content_t instance * @return Length of on-wire representation */ -static inline size_t sbp_packed_obs_content_encoded_len(const sbp_packed_obs_content_t *msg) -{ +static inline size_t sbp_packed_obs_content_encoded_len( + const sbp_packed_obs_content_t *msg) { (void)msg; return SBP_PACKED_OBS_CONTENT_ENCODED_LEN; } @@ -108,74 +106,96 @@ static inline size_t sbp_packed_obs_content_encoded_len(const sbp_packed_obs_con /** * Encode an instance of sbp_packed_obs_content_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_packed_obs_content_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_packed_obs_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_packed_obs_content_t *msg); +SBP_EXPORT s8 +sbp_packed_obs_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_packed_obs_content_t *msg); /** * Decode an instance of sbp_packed_obs_content_t from wire representation * - * This function decodes the wire representation of a sbp_packed_obs_content_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_packed_obs_content_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_packed_obs_content_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_packed_obs_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_packed_obs_content_t *msg); +SBP_EXPORT s8 sbp_packed_obs_content_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_packed_obs_content_t *msg); /** * Compare two instances of sbp_packed_obs_content_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_packed_obs_content_t instance * @param b sbp_packed_obs_content_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_packed_obs_content_cmp(const sbp_packed_obs_content_t *a, const sbp_packed_obs_content_t *b); +SBP_EXPORT int sbp_packed_obs_content_cmp(const sbp_packed_obs_content_t *a, + const sbp_packed_obs_content_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_packed_obs_content_t &lhs, const sbp_packed_obs_content_t &rhs) { +static inline bool operator==(const sbp_packed_obs_content_t &lhs, + const sbp_packed_obs_content_t &rhs) { return sbp_packed_obs_content_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_packed_obs_content_t &lhs, const sbp_packed_obs_content_t &rhs) { +static inline bool operator!=(const sbp_packed_obs_content_t &lhs, + const sbp_packed_obs_content_t &rhs) { return sbp_packed_obs_content_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_packed_obs_content_t &lhs, const sbp_packed_obs_content_t &rhs) { +static inline bool operator<(const sbp_packed_obs_content_t &lhs, + const sbp_packed_obs_content_t &rhs) { return sbp_packed_obs_content_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_packed_obs_content_t &lhs, const sbp_packed_obs_content_t &rhs) { +static inline bool operator<=(const sbp_packed_obs_content_t &lhs, + const sbp_packed_obs_content_t &rhs) { return sbp_packed_obs_content_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_packed_obs_content_t &lhs, const sbp_packed_obs_content_t &rhs) { +static inline bool operator>(const sbp_packed_obs_content_t &lhs, + const sbp_packed_obs_content_t &rhs) { return sbp_packed_obs_content_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_packed_obs_content_t &lhs, const sbp_packed_obs_content_t &rhs) { +static inline bool operator>=(const sbp_packed_obs_content_t &lhs, + const sbp_packed_obs_content_t &rhs) { return sbp_packed_obs_content_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_PACKEDOBSCONTENT_H */ - diff --git a/c/include/libsbp/observation/PackedObsContentDepA.h b/c/include/libsbp/observation/PackedObsContentDepA.h index 747ecccfa..6fde9d7e3 100644 --- a/c/include/libsbp/observation/PackedObsContentDepA.h +++ b/c/include/libsbp/observation/PackedObsContentDepA.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_PACKEDOBSCONTENTDEPA_H #define LIBSBP_OBSERVATION_PACKEDOBSCONTENTDEPA_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,51 +41,45 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Pseudorange observation [cm] + * Pseudorange observation [cm] */ u32 P; - /** -* Carrier phase observation with opposite sign from typical convention + * Carrier phase observation with opposite sign from typical convention */ sbp_carrier_phase_dep_a_t L; - /** -* Carrier-to-Noise density [dB Hz / 4] + * Carrier-to-Noise density [dB Hz / 4] */ u8 cn0; - /** - * Lock indicator. This value changes whenever a satellite signal has lost and regained lock, indicating that the carrier phase ambiguity may have changed. + * Lock indicator. This value changes whenever a satellite signal has lost and + * regained lock, indicating that the carrier phase ambiguity may have + * changed. */ u16 lock; - /** -* PRN-1 identifier of the satellite signal + * PRN-1 identifier of the satellite signal */ u8 prn; } sbp_packed_obs_content_dep_a_t; - - /** * Get encoded size of an instance of sbp_packed_obs_content_dep_a_t * * @param msg sbp_packed_obs_content_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_packed_obs_content_dep_a_encoded_len(const sbp_packed_obs_content_dep_a_t *msg) -{ +static inline size_t sbp_packed_obs_content_dep_a_encoded_len( + const sbp_packed_obs_content_dep_a_t *msg) { (void)msg; return SBP_PACKED_OBS_CONTENT_DEP_A_ENCODED_LEN; } @@ -93,74 +87,97 @@ static inline size_t sbp_packed_obs_content_dep_a_encoded_len(const sbp_packed_o /** * Encode an instance of sbp_packed_obs_content_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_packed_obs_content_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_packed_obs_content_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_packed_obs_content_dep_a_t *msg); +SBP_EXPORT s8 sbp_packed_obs_content_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_packed_obs_content_dep_a_t *msg); /** * Decode an instance of sbp_packed_obs_content_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_packed_obs_content_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_packed_obs_content_dep_a_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_packed_obs_content_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_packed_obs_content_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_packed_obs_content_dep_a_t *msg); +SBP_EXPORT s8 sbp_packed_obs_content_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_packed_obs_content_dep_a_t *msg); /** * Compare two instances of sbp_packed_obs_content_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_packed_obs_content_dep_a_t instance * @param b sbp_packed_obs_content_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_packed_obs_content_dep_a_cmp(const sbp_packed_obs_content_dep_a_t *a, const sbp_packed_obs_content_dep_a_t *b); +SBP_EXPORT int sbp_packed_obs_content_dep_a_cmp( + const sbp_packed_obs_content_dep_a_t *a, + const sbp_packed_obs_content_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_packed_obs_content_dep_a_t &lhs, const sbp_packed_obs_content_dep_a_t &rhs) { +static inline bool operator==(const sbp_packed_obs_content_dep_a_t &lhs, + const sbp_packed_obs_content_dep_a_t &rhs) { return sbp_packed_obs_content_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_packed_obs_content_dep_a_t &lhs, const sbp_packed_obs_content_dep_a_t &rhs) { +static inline bool operator!=(const sbp_packed_obs_content_dep_a_t &lhs, + const sbp_packed_obs_content_dep_a_t &rhs) { return sbp_packed_obs_content_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_packed_obs_content_dep_a_t &lhs, const sbp_packed_obs_content_dep_a_t &rhs) { +static inline bool operator<(const sbp_packed_obs_content_dep_a_t &lhs, + const sbp_packed_obs_content_dep_a_t &rhs) { return sbp_packed_obs_content_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_packed_obs_content_dep_a_t &lhs, const sbp_packed_obs_content_dep_a_t &rhs) { +static inline bool operator<=(const sbp_packed_obs_content_dep_a_t &lhs, + const sbp_packed_obs_content_dep_a_t &rhs) { return sbp_packed_obs_content_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_packed_obs_content_dep_a_t &lhs, const sbp_packed_obs_content_dep_a_t &rhs) { +static inline bool operator>(const sbp_packed_obs_content_dep_a_t &lhs, + const sbp_packed_obs_content_dep_a_t &rhs) { return sbp_packed_obs_content_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_packed_obs_content_dep_a_t &lhs, const sbp_packed_obs_content_dep_a_t &rhs) { +static inline bool operator>=(const sbp_packed_obs_content_dep_a_t &lhs, + const sbp_packed_obs_content_dep_a_t &rhs) { return sbp_packed_obs_content_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_PACKEDOBSCONTENTDEPA_H */ - diff --git a/c/include/libsbp/observation/PackedObsContentDepB.h b/c/include/libsbp/observation/PackedObsContentDepB.h index b0a7ec41f..fa5688446 100644 --- a/c/include/libsbp/observation/PackedObsContentDepB.h +++ b/c/include/libsbp/observation/PackedObsContentDepB.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_PACKEDOBSCONTENTDEPB_H #define LIBSBP_OBSERVATION_PACKEDOBSCONTENTDEPB_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,51 +42,46 @@ *****************************************************************************/ /** GPS observations for a particular satellite signal * -* Pseudorange and carrier phase observation for a satellite being tracked. Pseudoranges are referenced to a nominal pseudorange. + * Pseudorange and carrier phase observation for a satellite being tracked. + * Pseudoranges are referenced to a nominal pseudorange. */ typedef struct { - - /** -* Pseudorange observation [cm] + * Pseudorange observation [cm] */ u32 P; - /** -* Carrier phase observation with opposite sign from typical convention. + * Carrier phase observation with opposite sign from typical convention. */ sbp_carrier_phase_dep_a_t L; - /** -* Carrier-to-Noise density [dB Hz / 4] + * Carrier-to-Noise density [dB Hz / 4] */ u8 cn0; - /** - * Lock indicator. This value changes whenever a satellite signal has lost and regained lock, indicating that the carrier phase ambiguity may have changed. + * Lock indicator. This value changes whenever a satellite signal has lost and + * regained lock, indicating that the carrier phase ambiguity may have + * changed. */ u16 lock; - /** -* GNSS signal identifier + * GNSS signal identifier */ sbp_gnss_signal_dep_t sid; } sbp_packed_obs_content_dep_b_t; - - /** * Get encoded size of an instance of sbp_packed_obs_content_dep_b_t * * @param msg sbp_packed_obs_content_dep_b_t instance * @return Length of on-wire representation */ -static inline size_t sbp_packed_obs_content_dep_b_encoded_len(const sbp_packed_obs_content_dep_b_t *msg) -{ +static inline size_t sbp_packed_obs_content_dep_b_encoded_len( + const sbp_packed_obs_content_dep_b_t *msg) { (void)msg; return SBP_PACKED_OBS_CONTENT_DEP_B_ENCODED_LEN; } @@ -94,74 +89,97 @@ static inline size_t sbp_packed_obs_content_dep_b_encoded_len(const sbp_packed_o /** * Encode an instance of sbp_packed_obs_content_dep_b_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_packed_obs_content_dep_b_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_packed_obs_content_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_packed_obs_content_dep_b_t *msg); +SBP_EXPORT s8 sbp_packed_obs_content_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_packed_obs_content_dep_b_t *msg); /** * Decode an instance of sbp_packed_obs_content_dep_b_t from wire representation * - * This function decodes the wire representation of a sbp_packed_obs_content_dep_b_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_packed_obs_content_dep_b_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_packed_obs_content_dep_b_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_packed_obs_content_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_packed_obs_content_dep_b_t *msg); +SBP_EXPORT s8 sbp_packed_obs_content_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_packed_obs_content_dep_b_t *msg); /** * Compare two instances of sbp_packed_obs_content_dep_b_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_packed_obs_content_dep_b_t instance * @param b sbp_packed_obs_content_dep_b_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_packed_obs_content_dep_b_cmp(const sbp_packed_obs_content_dep_b_t *a, const sbp_packed_obs_content_dep_b_t *b); +SBP_EXPORT int sbp_packed_obs_content_dep_b_cmp( + const sbp_packed_obs_content_dep_b_t *a, + const sbp_packed_obs_content_dep_b_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_packed_obs_content_dep_b_t &lhs, const sbp_packed_obs_content_dep_b_t &rhs) { +static inline bool operator==(const sbp_packed_obs_content_dep_b_t &lhs, + const sbp_packed_obs_content_dep_b_t &rhs) { return sbp_packed_obs_content_dep_b_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_packed_obs_content_dep_b_t &lhs, const sbp_packed_obs_content_dep_b_t &rhs) { +static inline bool operator!=(const sbp_packed_obs_content_dep_b_t &lhs, + const sbp_packed_obs_content_dep_b_t &rhs) { return sbp_packed_obs_content_dep_b_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_packed_obs_content_dep_b_t &lhs, const sbp_packed_obs_content_dep_b_t &rhs) { +static inline bool operator<(const sbp_packed_obs_content_dep_b_t &lhs, + const sbp_packed_obs_content_dep_b_t &rhs) { return sbp_packed_obs_content_dep_b_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_packed_obs_content_dep_b_t &lhs, const sbp_packed_obs_content_dep_b_t &rhs) { +static inline bool operator<=(const sbp_packed_obs_content_dep_b_t &lhs, + const sbp_packed_obs_content_dep_b_t &rhs) { return sbp_packed_obs_content_dep_b_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_packed_obs_content_dep_b_t &lhs, const sbp_packed_obs_content_dep_b_t &rhs) { +static inline bool operator>(const sbp_packed_obs_content_dep_b_t &lhs, + const sbp_packed_obs_content_dep_b_t &rhs) { return sbp_packed_obs_content_dep_b_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_packed_obs_content_dep_b_t &lhs, const sbp_packed_obs_content_dep_b_t &rhs) { +static inline bool operator>=(const sbp_packed_obs_content_dep_b_t &lhs, + const sbp_packed_obs_content_dep_b_t &rhs) { return sbp_packed_obs_content_dep_b_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_PACKEDOBSCONTENTDEPB_H */ - diff --git a/c/include/libsbp/observation/PackedObsContentDepC.h b/c/include/libsbp/observation/PackedObsContentDepC.h index c99c07c42..1d4680f2e 100644 --- a/c/include/libsbp/observation/PackedObsContentDepC.h +++ b/c/include/libsbp/observation/PackedObsContentDepC.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_PACKEDOBSCONTENTDEPC_H #define LIBSBP_OBSERVATION_PACKEDOBSCONTENTDEPC_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,51 +42,47 @@ *****************************************************************************/ /** GPS observations for a particular satellite signal * -* Pseudorange and carrier phase observation for a satellite being tracked. The observations are be interoperable with 3rd party receivers and conform with typical RTCMv3 GNSS observations. + * Pseudorange and carrier phase observation for a satellite being tracked. The + * observations are be interoperable with 3rd party receivers and conform with + * typical RTCMv3 GNSS observations. */ typedef struct { - - /** -* Pseudorange observation [2 cm] + * Pseudorange observation [2 cm] */ u32 P; - /** -* Carrier phase observation with typical sign convention. [cycles] + * Carrier phase observation with typical sign convention. [cycles] */ sbp_carrier_phase_t L; - /** -* Carrier-to-Noise density [dB Hz / 4] + * Carrier-to-Noise density [dB Hz / 4] */ u8 cn0; - /** - * Lock indicator. This value changes whenever a satellite signal has lost and regained lock, indicating that the carrier phase ambiguity may have changed. + * Lock indicator. This value changes whenever a satellite signal has lost and + * regained lock, indicating that the carrier phase ambiguity may have + * changed. */ u16 lock; - /** -* GNSS signal identifier + * GNSS signal identifier */ sbp_gnss_signal_dep_t sid; } sbp_packed_obs_content_dep_c_t; - - /** * Get encoded size of an instance of sbp_packed_obs_content_dep_c_t * * @param msg sbp_packed_obs_content_dep_c_t instance * @return Length of on-wire representation */ -static inline size_t sbp_packed_obs_content_dep_c_encoded_len(const sbp_packed_obs_content_dep_c_t *msg) -{ +static inline size_t sbp_packed_obs_content_dep_c_encoded_len( + const sbp_packed_obs_content_dep_c_t *msg) { (void)msg; return SBP_PACKED_OBS_CONTENT_DEP_C_ENCODED_LEN; } @@ -94,74 +90,97 @@ static inline size_t sbp_packed_obs_content_dep_c_encoded_len(const sbp_packed_o /** * Encode an instance of sbp_packed_obs_content_dep_c_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_packed_obs_content_dep_c_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_packed_obs_content_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_packed_obs_content_dep_c_t *msg); +SBP_EXPORT s8 sbp_packed_obs_content_dep_c_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_packed_obs_content_dep_c_t *msg); /** * Decode an instance of sbp_packed_obs_content_dep_c_t from wire representation * - * This function decodes the wire representation of a sbp_packed_obs_content_dep_c_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_packed_obs_content_dep_c_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_packed_obs_content_dep_c_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_packed_obs_content_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_packed_obs_content_dep_c_t *msg); +SBP_EXPORT s8 sbp_packed_obs_content_dep_c_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_packed_obs_content_dep_c_t *msg); /** * Compare two instances of sbp_packed_obs_content_dep_c_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_packed_obs_content_dep_c_t instance * @param b sbp_packed_obs_content_dep_c_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_packed_obs_content_dep_c_cmp(const sbp_packed_obs_content_dep_c_t *a, const sbp_packed_obs_content_dep_c_t *b); +SBP_EXPORT int sbp_packed_obs_content_dep_c_cmp( + const sbp_packed_obs_content_dep_c_t *a, + const sbp_packed_obs_content_dep_c_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_packed_obs_content_dep_c_t &lhs, const sbp_packed_obs_content_dep_c_t &rhs) { +static inline bool operator==(const sbp_packed_obs_content_dep_c_t &lhs, + const sbp_packed_obs_content_dep_c_t &rhs) { return sbp_packed_obs_content_dep_c_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_packed_obs_content_dep_c_t &lhs, const sbp_packed_obs_content_dep_c_t &rhs) { +static inline bool operator!=(const sbp_packed_obs_content_dep_c_t &lhs, + const sbp_packed_obs_content_dep_c_t &rhs) { return sbp_packed_obs_content_dep_c_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_packed_obs_content_dep_c_t &lhs, const sbp_packed_obs_content_dep_c_t &rhs) { +static inline bool operator<(const sbp_packed_obs_content_dep_c_t &lhs, + const sbp_packed_obs_content_dep_c_t &rhs) { return sbp_packed_obs_content_dep_c_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_packed_obs_content_dep_c_t &lhs, const sbp_packed_obs_content_dep_c_t &rhs) { +static inline bool operator<=(const sbp_packed_obs_content_dep_c_t &lhs, + const sbp_packed_obs_content_dep_c_t &rhs) { return sbp_packed_obs_content_dep_c_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_packed_obs_content_dep_c_t &lhs, const sbp_packed_obs_content_dep_c_t &rhs) { +static inline bool operator>(const sbp_packed_obs_content_dep_c_t &lhs, + const sbp_packed_obs_content_dep_c_t &rhs) { return sbp_packed_obs_content_dep_c_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_packed_obs_content_dep_c_t &lhs, const sbp_packed_obs_content_dep_c_t &rhs) { +static inline bool operator>=(const sbp_packed_obs_content_dep_c_t &lhs, + const sbp_packed_obs_content_dep_c_t &rhs) { return sbp_packed_obs_content_dep_c_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_PACKEDOBSCONTENTDEPC_H */ - diff --git a/c/include/libsbp/observation/PackedOsrContent.h b/c/include/libsbp/observation/PackedOsrContent.h index 8ece73bbb..3fdad293f 100644 --- a/c/include/libsbp/observation/PackedOsrContent.h +++ b/c/include/libsbp/observation/PackedOsrContent.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_OBSERVATION_PACKEDOSRCONTENT_H #define LIBSBP_OBSERVATION_PACKEDOSRCONTENT_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,69 +42,62 @@ *****************************************************************************/ /** Network correction for a particular satellite signal * -* Pseudorange and carrier phase network corrections for a satellite signal. + * Pseudorange and carrier phase network corrections for a satellite signal. */ typedef struct { - - /** -* Pseudorange observation [2 cm] + * Pseudorange observation [2 cm] */ u32 P; - /** -* Carrier phase observation with typical sign convention. [cycles] + * Carrier phase observation with typical sign convention. [cycles] */ sbp_carrier_phase_t L; - /** - * Lock timer. This value gives an indication of the time for which a signal has maintained continuous phase lock. Whenever a signal has lost and regained lock, this value is reset to zero. It is encoded according to DF402 from the RTCM 10403.2 Amendment 2 specification. Valid values range from 0 to 15 and the most significant nibble is reserved for future use. + * Lock timer. This value gives an indication of the time for which a signal + * has maintained continuous phase lock. Whenever a signal has lost and + * regained lock, this value is reset to zero. It is encoded according to + * DF402 from the RTCM 10403.2 Amendment 2 specification. Valid values range + * from 0 to 15 and the most significant nibble is reserved for future use. */ u8 lock; - /** - * Correction flags. + * Correction flags. */ u8 flags; - /** -* GNSS signal identifier (16 bit) + * GNSS signal identifier (16 bit) */ sbp_v4_gnss_signal_t sid; - /** -* Slant ionospheric correction standard deviation [5 mm] + * Slant ionospheric correction standard deviation [5 mm] */ u16 iono_std; - /** -* Slant tropospheric correction standard deviation [5 mm] + * Slant tropospheric correction standard deviation [5 mm] */ u16 tropo_std; - /** -* Orbit/clock/bias correction projected on range standard deviation [5 mm] + * Orbit/clock/bias correction projected on range standard deviation [5 mm] */ u16 range_std; } sbp_packed_osr_content_t; - - /** * Get encoded size of an instance of sbp_packed_osr_content_t * * @param msg sbp_packed_osr_content_t instance * @return Length of on-wire representation */ -static inline size_t sbp_packed_osr_content_encoded_len(const sbp_packed_osr_content_t *msg) -{ +static inline size_t sbp_packed_osr_content_encoded_len( + const sbp_packed_osr_content_t *msg) { (void)msg; return SBP_PACKED_OSR_CONTENT_ENCODED_LEN; } @@ -112,74 +105,96 @@ static inline size_t sbp_packed_osr_content_encoded_len(const sbp_packed_osr_con /** * Encode an instance of sbp_packed_osr_content_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_packed_osr_content_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_packed_osr_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_packed_osr_content_t *msg); +SBP_EXPORT s8 +sbp_packed_osr_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_packed_osr_content_t *msg); /** * Decode an instance of sbp_packed_osr_content_t from wire representation * - * This function decodes the wire representation of a sbp_packed_osr_content_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_packed_osr_content_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_packed_osr_content_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_packed_osr_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_packed_osr_content_t *msg); +SBP_EXPORT s8 sbp_packed_osr_content_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_packed_osr_content_t *msg); /** * Compare two instances of sbp_packed_osr_content_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_packed_osr_content_t instance * @param b sbp_packed_osr_content_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_packed_osr_content_cmp(const sbp_packed_osr_content_t *a, const sbp_packed_osr_content_t *b); +SBP_EXPORT int sbp_packed_osr_content_cmp(const sbp_packed_osr_content_t *a, + const sbp_packed_osr_content_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_packed_osr_content_t &lhs, const sbp_packed_osr_content_t &rhs) { +static inline bool operator==(const sbp_packed_osr_content_t &lhs, + const sbp_packed_osr_content_t &rhs) { return sbp_packed_osr_content_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_packed_osr_content_t &lhs, const sbp_packed_osr_content_t &rhs) { +static inline bool operator!=(const sbp_packed_osr_content_t &lhs, + const sbp_packed_osr_content_t &rhs) { return sbp_packed_osr_content_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_packed_osr_content_t &lhs, const sbp_packed_osr_content_t &rhs) { +static inline bool operator<(const sbp_packed_osr_content_t &lhs, + const sbp_packed_osr_content_t &rhs) { return sbp_packed_osr_content_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_packed_osr_content_t &lhs, const sbp_packed_osr_content_t &rhs) { +static inline bool operator<=(const sbp_packed_osr_content_t &lhs, + const sbp_packed_osr_content_t &rhs) { return sbp_packed_osr_content_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_packed_osr_content_t &lhs, const sbp_packed_osr_content_t &rhs) { +static inline bool operator>(const sbp_packed_osr_content_t &lhs, + const sbp_packed_osr_content_t &rhs) { return sbp_packed_osr_content_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_packed_osr_content_t &lhs, const sbp_packed_osr_content_t &rhs) { +static inline bool operator>=(const sbp_packed_osr_content_t &lhs, + const sbp_packed_osr_content_t &rhs) { return sbp_packed_osr_content_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_PACKEDOSRCONTENT_H */ - diff --git a/c/include/libsbp/observation/SvAzEl.h b/c/include/libsbp/observation/SvAzEl.h index fdce8a002..b6804206b 100644 --- a/c/include/libsbp/observation/SvAzEl.h +++ b/c/include/libsbp/observation/SvAzEl.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_OBSERVATION_SVAZEL_H #define LIBSBP_OBSERVATION_SVAZEL_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,39 +41,32 @@ *****************************************************************************/ /** Satellite azimuth and elevation * -* Satellite azimuth and elevation. + * Satellite azimuth and elevation. */ typedef struct { - - /** -* GNSS signal identifier + * GNSS signal identifier */ sbp_v4_gnss_signal_t sid; - /** -* Azimuth angle (range 0..179) [deg * 2] + * Azimuth angle (range 0..179) [deg * 2] */ u8 az; - /** -* Elevation angle (range -90..90) [deg] + * Elevation angle (range -90..90) [deg] */ s8 el; } sbp_sv_az_el_t; - - /** * Get encoded size of an instance of sbp_sv_az_el_t * * @param msg sbp_sv_az_el_t instance * @return Length of on-wire representation */ -static inline size_t sbp_sv_az_el_encoded_len(const sbp_sv_az_el_t *msg) -{ +static inline size_t sbp_sv_az_el_encoded_len(const sbp_sv_az_el_t *msg) { (void)msg; return SBP_SV_AZ_EL_ENCODED_LEN; } @@ -81,74 +74,94 @@ static inline size_t sbp_sv_az_el_encoded_len(const sbp_sv_az_el_t *msg) /** * Encode an instance of sbp_sv_az_el_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_sv_az_el_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_sv_az_el_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_sv_az_el_t *msg); +SBP_EXPORT s8 sbp_sv_az_el_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_sv_az_el_t *msg); /** * Decode an instance of sbp_sv_az_el_t from wire representation * - * This function decodes the wire representation of a sbp_sv_az_el_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_sv_az_el_t message to + * the given instance. The caller must specify the length of the buffer in the + * \p len parameter. If non-null the number of bytes read from the buffer will + * be returned in \p n_read. * * @param buf Wire representation of the sbp_sv_az_el_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_sv_az_el_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_sv_az_el_t *msg); +SBP_EXPORT s8 sbp_sv_az_el_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_sv_az_el_t *msg); /** * Compare two instances of sbp_sv_az_el_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_sv_az_el_t instance * @param b sbp_sv_az_el_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_sv_az_el_cmp(const sbp_sv_az_el_t *a, const sbp_sv_az_el_t *b); +SBP_EXPORT int sbp_sv_az_el_cmp(const sbp_sv_az_el_t *a, + const sbp_sv_az_el_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_sv_az_el_t &lhs, const sbp_sv_az_el_t &rhs) { +static inline bool operator==(const sbp_sv_az_el_t &lhs, + const sbp_sv_az_el_t &rhs) { return sbp_sv_az_el_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_sv_az_el_t &lhs, const sbp_sv_az_el_t &rhs) { +static inline bool operator!=(const sbp_sv_az_el_t &lhs, + const sbp_sv_az_el_t &rhs) { return sbp_sv_az_el_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_sv_az_el_t &lhs, const sbp_sv_az_el_t &rhs) { +static inline bool operator<(const sbp_sv_az_el_t &lhs, + const sbp_sv_az_el_t &rhs) { return sbp_sv_az_el_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_sv_az_el_t &lhs, const sbp_sv_az_el_t &rhs) { +static inline bool operator<=(const sbp_sv_az_el_t &lhs, + const sbp_sv_az_el_t &rhs) { return sbp_sv_az_el_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_sv_az_el_t &lhs, const sbp_sv_az_el_t &rhs) { +static inline bool operator>(const sbp_sv_az_el_t &lhs, + const sbp_sv_az_el_t &rhs) { return sbp_sv_az_el_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_sv_az_el_t &lhs, const sbp_sv_az_el_t &rhs) { +static inline bool operator>=(const sbp_sv_az_el_t &lhs, + const sbp_sv_az_el_t &rhs) { return sbp_sv_az_el_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_OBSERVATION_SVAZEL_H */ - diff --git a/c/include/libsbp/observation_macros.h b/c/include/libsbp/observation_macros.h index 4c3abf9e5..1825d69d0 100644 --- a/c/include/libsbp/observation_macros.h +++ b/c/include/libsbp/observation_macros.h @@ -18,786 +18,809 @@ #ifndef LIBSBP_OBSERVATION_MACROS_H #define LIBSBP_OBSERVATION_MACROS_H - /** - * Encoded length of sbp_observation_header_t (V4 API) and + * Encoded length of sbp_observation_header_t (V4 API) and * observation_header_t (legacy API) */ #define SBP_OBSERVATION_HEADER_ENCODED_LEN 11u - /** - * Encoded length of sbp_doppler_t (V4 API) and + * Encoded length of sbp_doppler_t (V4 API) and * doppler_t (legacy API) */ #define SBP_DOPPLER_ENCODED_LEN 3u - #define SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_MASK (0x1u) #define SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_SHIFT (7u) -#define SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_GET(flags) \ - ((u8)((u8)((flags) >> SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_SHIFT) \ - & SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_MASK)) -#define SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_MASK << SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_SHIFT))) | \ - (((val) & (SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_MASK)) \ - << (SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_SHIFT)));} while(0) - +#define SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_GET(flags) \ + ((u8)((u8)((flags) >> SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_SHIFT) & \ + SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_MASK)) +#define SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_MASK \ + << SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_SHIFT))) | \ + (((val) & (SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_MASK)) \ + << (SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_SHIFT))); \ + } while (0) #define SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_NO_EXCLUSION (0) -#define SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_MEASUREMENT_WAS_EXCLUDED_BY_SPP_RAIM_USE_WITH_CARE (1) +#define SBP_PACKEDOBSCONTENT_RAIM_EXCLUSION_MEASUREMENT_WAS_EXCLUDED_BY_SPP_RAIM_USE_WITH_CARE \ + (1) #define SBP_PACKEDOBSCONTENT_DOPPLER_VALID_MASK (0x1u) #define SBP_PACKEDOBSCONTENT_DOPPLER_VALID_SHIFT (3u) -#define SBP_PACKEDOBSCONTENT_DOPPLER_VALID_GET(flags) \ - ((u8)((u8)((flags) >> SBP_PACKEDOBSCONTENT_DOPPLER_VALID_SHIFT) \ - & SBP_PACKEDOBSCONTENT_DOPPLER_VALID_MASK)) -#define SBP_PACKEDOBSCONTENT_DOPPLER_VALID_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_PACKEDOBSCONTENT_DOPPLER_VALID_MASK << SBP_PACKEDOBSCONTENT_DOPPLER_VALID_SHIFT))) | \ - (((val) & (SBP_PACKEDOBSCONTENT_DOPPLER_VALID_MASK)) \ - << (SBP_PACKEDOBSCONTENT_DOPPLER_VALID_SHIFT)));} while(0) - +#define SBP_PACKEDOBSCONTENT_DOPPLER_VALID_GET(flags) \ + ((u8)((u8)((flags) >> SBP_PACKEDOBSCONTENT_DOPPLER_VALID_SHIFT) & \ + SBP_PACKEDOBSCONTENT_DOPPLER_VALID_MASK)) +#define SBP_PACKEDOBSCONTENT_DOPPLER_VALID_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_PACKEDOBSCONTENT_DOPPLER_VALID_MASK \ + << SBP_PACKEDOBSCONTENT_DOPPLER_VALID_SHIFT))) | \ + (((val) & (SBP_PACKEDOBSCONTENT_DOPPLER_VALID_MASK)) \ + << (SBP_PACKEDOBSCONTENT_DOPPLER_VALID_SHIFT))); \ + } while (0) #define SBP_PACKEDOBSCONTENT_DOPPLER_VALID_INVALID_DOPPLER_MEASUREMENT (0) #define SBP_PACKEDOBSCONTENT_DOPPLER_VALID_VALID_DOPPLER_MEASUREMENT (1) #define SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_MASK (0x1u) #define SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_SHIFT (2u) -#define SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_GET(flags) \ - ((u8)((u8)((flags) >> SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_SHIFT) \ - & SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_MASK)) -#define SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_MASK << SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_SHIFT))) | \ - (((val) & (SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_MASK)) \ - << (SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_SHIFT)));} while(0) - - -#define SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_HALF_CYCLE_PHASE_AMBIGUITY_UNRESOLVED (0) -#define SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_HALF_CYCLE_PHASE_AMBIGUITY_RESOLVED (1) +#define SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_GET(flags) \ + ((u8)((u8)((flags) >> SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_SHIFT) & \ + SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_MASK)) +#define SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_MASK \ + << SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_SHIFT))) | \ + (((val) & (SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_MASK)) \ + << (SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_SHIFT))); \ + } while (0) + +#define SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_HALF_CYCLE_PHASE_AMBIGUITY_UNRESOLVED \ + (0) +#define SBP_PACKEDOBSCONTENT_HALFCYCLE_AMBIGUITY_HALF_CYCLE_PHASE_AMBIGUITY_RESOLVED \ + (1) #define SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_MASK (0x1u) #define SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_SHIFT (1u) -#define SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_GET(flags) \ - ((u8)((u8)((flags) >> SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_SHIFT) \ - & SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_MASK)) -#define SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_MASK << SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_SHIFT))) | \ - (((val) & (SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_MASK)) \ - << (SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_SHIFT)));} while(0) - - -#define SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_INVALID_CARRIER_PHASE_MEASUREMENT (0) -#define SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_VALID_CARRIER_PHASE_MEASUREMENT (1) +#define SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_GET(flags) \ + ((u8)((u8)((flags) >> SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_SHIFT) & \ + SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_MASK)) +#define SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_MASK \ + << SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_SHIFT))) | \ + (((val) & (SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_MASK)) \ + << (SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_SHIFT))); \ + } while (0) + +#define SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_INVALID_CARRIER_PHASE_MEASUREMENT \ + (0) +#define SBP_PACKEDOBSCONTENT_CARRIER_PHASE_VALID_VALID_CARRIER_PHASE_MEASUREMENT \ + (1) #define SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_MASK (0x1u) #define SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_SHIFT (0u) -#define SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_GET(flags) \ - ((u8)((u8)((flags) >> SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_SHIFT) \ - & SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_MASK)) -#define SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_MASK << SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_SHIFT))) | \ - (((val) & (SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_MASK)) \ - << (SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_SHIFT)));} while(0) - - -#define SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_INVALID_PSEUDORANGE_MEASUREMENT (0) -#define SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_VALID_PSEUDORANGE_MEASUREMENT_AND_COARSE_TOW_DECODED (1) -/** - * Encoded length of sbp_packed_obs_content_t (V4 API) and +#define SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_GET(flags) \ + ((u8)((u8)((flags) >> SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_SHIFT) & \ + SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_MASK)) +#define SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_MASK \ + << SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_SHIFT))) | \ + (((val) & (SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_MASK)) \ + << (SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_SHIFT))); \ + } while (0) + +#define SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_INVALID_PSEUDORANGE_MEASUREMENT \ + (0) +#define SBP_PACKEDOBSCONTENT_PSEUDORANGE_VALID_VALID_PSEUDORANGE_MEASUREMENT_AND_COARSE_TOW_DECODED \ + (1) +/** + * Encoded length of sbp_packed_obs_content_t (V4 API) and * packed_obs_content_t (legacy API) */ #define SBP_PACKED_OBS_CONTENT_ENCODED_LEN 17u - #define SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_MASK (0x1u) #define SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_SHIFT (4u) -#define SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_SHIFT) \ - & SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_MASK)) -#define SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_MASK << SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_SHIFT))) | \ - (((val) & (SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_MASK)) \ - << (SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_SHIFT)));} while(0) - - -#define SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_VALID_PHASE_CORRECTIONS (0) -#define SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_DO_NOT_USE_PHASE_CORRECTIONS (1) +#define SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_GET(flags) \ + ((u8)( \ + (u8)((flags) >> SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_SHIFT) & \ + SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_MASK)) +#define SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & \ + (~(SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_MASK \ + << SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_SHIFT))) | \ + (((val) & (SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_MASK)) \ + << (SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_SHIFT))); \ + } while (0) + +#define SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_VALID_PHASE_CORRECTIONS \ + (0) +#define SBP_PACKEDOSRCONTENT_INVALID_PHASE_CORRECTIONS_DO_NOT_USE_PHASE_CORRECTIONS \ + (1) #define SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_MASK (0x1u) #define SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_SHIFT (3u) -#define SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_SHIFT) \ - & SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_MASK)) -#define SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_MASK << SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_SHIFT))) | \ - (((val) & (SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_MASK)) \ - << (SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_SHIFT)));} while(0) - +#define SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_SHIFT) & \ + SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_MASK)) +#define SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & \ + (~(SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_MASK \ + << SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_SHIFT))) | \ + (((val) & (SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_MASK)) \ + << (SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_SHIFT))); \ + } while (0) #define SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_VALID_CODE_CORRECTIONS (0) -#define SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_DO_NOT_USE_CODE_CORRECTIONS (1) +#define SBP_PACKEDOSRCONTENT_INVALID_CODE_CORRECTIONS_DO_NOT_USE_CODE_CORRECTIONS \ + (1) #define SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_MASK (0x1u) #define SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_SHIFT (2u) -#define SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_GET(flags) \ - ((u8)((u8)((flags) >> SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_SHIFT) \ - & SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_MASK)) -#define SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_MASK << SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_SHIFT))) | \ - (((val) & (SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_MASK)) \ - << (SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_SHIFT)));} while(0) - +#define SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_GET(flags) \ + ((u8)((u8)((flags) >> SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_SHIFT) & \ + SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_MASK)) +#define SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_MASK \ + << SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_SHIFT))) | \ + (((val) & (SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_MASK)) \ + << (SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_SHIFT))); \ + } while (0) #define SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_FULL_FIXING_UNAVAILABLE (0) #define SBP_PACKEDOSRCONTENT_FULL_FIXING_FLAG_FULL_FIXING_AVAILABLE (1) #define SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_MASK (0x1u) #define SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_SHIFT (1u) -#define SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_GET(flags) \ - ((u8)((u8)((flags) >> SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_SHIFT) \ - & SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_MASK)) -#define SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_MASK << SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_SHIFT))) | \ - (((val) & (SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_MASK)) \ - << (SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_SHIFT)));} while(0) - +#define SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_GET(flags) \ + ((u8)((u8)((flags) >> SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_SHIFT) & \ + SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_MASK)) +#define SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_MASK \ + << SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_SHIFT))) | \ + (((val) & (SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_MASK)) \ + << (SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_SHIFT))); \ + } while (0) #define SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_PARTIAL_FIXING_UNAVAILABLE (0) #define SBP_PACKEDOSRCONTENT_PARTIAL_FIXING_FLAG_PARTIAL_FIXING_AVAILABLE (1) #define SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_MASK (0x1u) #define SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_SHIFT (0u) -#define SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_GET(flags) \ - ((u8)((u8)((flags) >> SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_SHIFT) \ - & SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_MASK)) -#define SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_MASK << SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_SHIFT))) | \ - (((val) & (SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_MASK)) \ - << (SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_SHIFT)));} while(0) - +#define SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_GET(flags) \ + ((u8)((u8)((flags) >> SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_SHIFT) & \ + SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_MASK)) +#define SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_MASK \ + << SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_SHIFT))) | \ + (((val) & (SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_MASK)) \ + << (SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_SHIFT))); \ + } while (0) #define SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_DO_NOT_USE_SIGNAL (0) #define SBP_PACKEDOSRCONTENT_CORRECTION_VALIDITY_VALID_SIGNAL (1) /** - * Encoded length of sbp_packed_osr_content_t (V4 API) and + * Encoded length of sbp_packed_osr_content_t (V4 API) and * packed_osr_content_t (legacy API) */ #define SBP_PACKED_OSR_CONTENT_ENCODED_LEN 19u - #define SBP_MSG_OBS 0x004A /** - * The maximum number of items that can be stored in sbp_msg_obs_t::obs (V4 API) or msg_obs_t::obs (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in sbp_msg_obs_t::obs (V4 API) + * or msg_obs_t::obs (legacy API) before the maximum SBP message size is + * exceeded */ #define SBP_MSG_OBS_OBS_MAX 14u - /** - * Encoded length of sbp_msg_obs_t (V4 API) and + * Encoded length of sbp_msg_obs_t (V4 API) and * msg_obs_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_obs_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_obs_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_OBS_ENCODED_OVERHEAD 11u - #define SBP_MSG_BASE_POS_LLH 0x0044 /** - * Encoded length of sbp_msg_base_pos_llh_t (V4 API) and + * Encoded length of sbp_msg_base_pos_llh_t (V4 API) and * msg_base_pos_llh_t (legacy API) */ #define SBP_MSG_BASE_POS_LLH_ENCODED_LEN 24u - #define SBP_MSG_BASE_POS_ECEF 0x0048 /** - * Encoded length of sbp_msg_base_pos_ecef_t (V4 API) and + * Encoded length of sbp_msg_base_pos_ecef_t (V4 API) and * msg_base_pos_ecef_t (legacy API) */ #define SBP_MSG_BASE_POS_ECEF_ENCODED_LEN 24u - /** - * Encoded length of sbp_ephemeris_common_content_t (V4 API) and + * Encoded length of sbp_ephemeris_common_content_t (V4 API) and * ephemeris_common_content_t (legacy API) */ #define SBP_EPHEMERIS_COMMON_CONTENT_ENCODED_LEN 18u - /** - * Encoded length of sbp_ephemeris_common_content_dep_b_t (V4 API) and + * Encoded length of sbp_ephemeris_common_content_dep_b_t (V4 API) and * ephemeris_common_content_dep_b_t (legacy API) */ #define SBP_EPHEMERIS_COMMON_CONTENT_DEP_B_ENCODED_LEN 22u - /** - * Encoded length of sbp_ephemeris_common_content_dep_a_t (V4 API) and + * Encoded length of sbp_ephemeris_common_content_dep_a_t (V4 API) and * ephemeris_common_content_dep_a_t (legacy API) */ #define SBP_EPHEMERIS_COMMON_CONTENT_DEP_A_ENCODED_LEN 24u - #define SBP_MSG_EPHEMERIS_GPS_DEP_E 0x0081 /** - * Encoded length of sbp_msg_ephemeris_gps_dep_e_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_gps_dep_e_t (V4 API) and * msg_ephemeris_gps_dep_e_t (legacy API) */ #define SBP_MSG_EPHEMERIS_GPS_DEP_E_ENCODED_LEN 185u - #define SBP_MSG_EPHEMERIS_GPS_DEP_F 0x0086 /** - * Encoded length of sbp_msg_ephemeris_gps_dep_f_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_gps_dep_f_t (V4 API) and * msg_ephemeris_gps_dep_f_t (legacy API) */ #define SBP_MSG_EPHEMERIS_GPS_DEP_F_ENCODED_LEN 183u - #define SBP_MSG_EPHEMERIS_GPS 0x008A /** - * Encoded length of sbp_msg_ephemeris_gps_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_gps_t (V4 API) and * msg_ephemeris_gps_t (legacy API) */ #define SBP_MSG_EPHEMERIS_GPS_ENCODED_LEN 139u - #define SBP_MSG_EPHEMERIS_QZSS 0x008E /** - * Encoded length of sbp_msg_ephemeris_qzss_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_qzss_t (V4 API) and * msg_ephemeris_qzss_t (legacy API) */ #define SBP_MSG_EPHEMERIS_QZSS_ENCODED_LEN 139u - #define SBP_MSG_EPHEMERIS_BDS 0x0089 /** - * Encoded length of sbp_msg_ephemeris_bds_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_bds_t (V4 API) and * msg_ephemeris_bds_t (legacy API) */ #define SBP_MSG_EPHEMERIS_BDS_ENCODED_LEN 147u - #define SBP_MSG_EPHEMERIS_GAL_DEP_A 0x0095 /** - * Encoded length of sbp_msg_ephemeris_gal_dep_a_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_gal_dep_a_t (V4 API) and * msg_ephemeris_gal_dep_a_t (legacy API) */ #define SBP_MSG_EPHEMERIS_GAL_DEP_A_ENCODED_LEN 152u - #define SBP_MSG_EPHEMERIS_GAL 0x008D /** - * Encoded length of sbp_msg_ephemeris_gal_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_gal_t (V4 API) and * msg_ephemeris_gal_t (legacy API) */ #define SBP_MSG_EPHEMERIS_GAL_ENCODED_LEN 153u - #define SBP_MSG_EPHEMERIS_SBAS_DEP_A 0x0082 /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_sbas_dep_a_t::pos (V4 API) or msg_ephemeris_sbas_dep_a_t::pos (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_sbas_dep_a_t::pos (V4 API) or + * msg_ephemeris_sbas_dep_a_t::pos (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_EPHEMERIS_SBAS_DEP_A_POS_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_sbas_dep_a_t::vel (V4 API) or msg_ephemeris_sbas_dep_a_t::vel (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_sbas_dep_a_t::vel (V4 API) or + * msg_ephemeris_sbas_dep_a_t::vel (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_EPHEMERIS_SBAS_DEP_A_VEL_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_sbas_dep_a_t::acc (V4 API) or msg_ephemeris_sbas_dep_a_t::acc (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_sbas_dep_a_t::acc (V4 API) or + * msg_ephemeris_sbas_dep_a_t::acc (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_EPHEMERIS_SBAS_DEP_A_ACC_MAX 3u - /** - * Encoded length of sbp_msg_ephemeris_sbas_dep_a_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_sbas_dep_a_t (V4 API) and * msg_ephemeris_sbas_dep_a_t (legacy API) */ #define SBP_MSG_EPHEMERIS_SBAS_DEP_A_ENCODED_LEN 112u - #define SBP_MSG_EPHEMERIS_GLO_DEP_A 0x0083 /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_glo_dep_a_t::pos (V4 API) or msg_ephemeris_glo_dep_a_t::pos (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_glo_dep_a_t::pos (V4 API) or msg_ephemeris_glo_dep_a_t::pos + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_GLO_DEP_A_POS_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_glo_dep_a_t::vel (V4 API) or msg_ephemeris_glo_dep_a_t::vel (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_glo_dep_a_t::vel (V4 API) or msg_ephemeris_glo_dep_a_t::vel + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_GLO_DEP_A_VEL_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_glo_dep_a_t::acc (V4 API) or msg_ephemeris_glo_dep_a_t::acc (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_glo_dep_a_t::acc (V4 API) or msg_ephemeris_glo_dep_a_t::acc + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_GLO_DEP_A_ACC_MAX 3u - /** - * Encoded length of sbp_msg_ephemeris_glo_dep_a_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_glo_dep_a_t (V4 API) and * msg_ephemeris_glo_dep_a_t (legacy API) */ #define SBP_MSG_EPHEMERIS_GLO_DEP_A_ENCODED_LEN 112u - #define SBP_MSG_EPHEMERIS_SBAS_DEP_B 0x0084 /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_sbas_dep_b_t::pos (V4 API) or msg_ephemeris_sbas_dep_b_t::pos (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_sbas_dep_b_t::pos (V4 API) or + * msg_ephemeris_sbas_dep_b_t::pos (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_EPHEMERIS_SBAS_DEP_B_POS_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_sbas_dep_b_t::vel (V4 API) or msg_ephemeris_sbas_dep_b_t::vel (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_sbas_dep_b_t::vel (V4 API) or + * msg_ephemeris_sbas_dep_b_t::vel (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_EPHEMERIS_SBAS_DEP_B_VEL_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_sbas_dep_b_t::acc (V4 API) or msg_ephemeris_sbas_dep_b_t::acc (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_sbas_dep_b_t::acc (V4 API) or + * msg_ephemeris_sbas_dep_b_t::acc (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_EPHEMERIS_SBAS_DEP_B_ACC_MAX 3u - /** - * Encoded length of sbp_msg_ephemeris_sbas_dep_b_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_sbas_dep_b_t (V4 API) and * msg_ephemeris_sbas_dep_b_t (legacy API) */ #define SBP_MSG_EPHEMERIS_SBAS_DEP_B_ENCODED_LEN 110u - #define SBP_MSG_EPHEMERIS_SBAS 0x008C /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_sbas_t::pos (V4 API) or msg_ephemeris_sbas_t::pos (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_sbas_t::pos (V4 API) or msg_ephemeris_sbas_t::pos (legacy + * API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_SBAS_POS_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_sbas_t::vel (V4 API) or msg_ephemeris_sbas_t::vel (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_sbas_t::vel (V4 API) or msg_ephemeris_sbas_t::vel (legacy + * API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_SBAS_VEL_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_sbas_t::acc (V4 API) or msg_ephemeris_sbas_t::acc (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_sbas_t::acc (V4 API) or msg_ephemeris_sbas_t::acc (legacy + * API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_SBAS_ACC_MAX 3u - /** - * Encoded length of sbp_msg_ephemeris_sbas_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_sbas_t (V4 API) and * msg_ephemeris_sbas_t (legacy API) */ #define SBP_MSG_EPHEMERIS_SBAS_ENCODED_LEN 74u - #define SBP_MSG_EPHEMERIS_GLO_DEP_B 0x0085 /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_glo_dep_b_t::pos (V4 API) or msg_ephemeris_glo_dep_b_t::pos (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_glo_dep_b_t::pos (V4 API) or msg_ephemeris_glo_dep_b_t::pos + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_GLO_DEP_B_POS_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_glo_dep_b_t::vel (V4 API) or msg_ephemeris_glo_dep_b_t::vel (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_glo_dep_b_t::vel (V4 API) or msg_ephemeris_glo_dep_b_t::vel + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_GLO_DEP_B_VEL_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_glo_dep_b_t::acc (V4 API) or msg_ephemeris_glo_dep_b_t::acc (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_glo_dep_b_t::acc (V4 API) or msg_ephemeris_glo_dep_b_t::acc + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_GLO_DEP_B_ACC_MAX 3u - /** - * Encoded length of sbp_msg_ephemeris_glo_dep_b_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_glo_dep_b_t (V4 API) and * msg_ephemeris_glo_dep_b_t (legacy API) */ #define SBP_MSG_EPHEMERIS_GLO_DEP_B_ENCODED_LEN 110u - #define SBP_MSG_EPHEMERIS_GLO_DEP_C 0x0087 /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_glo_dep_c_t::pos (V4 API) or msg_ephemeris_glo_dep_c_t::pos (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_glo_dep_c_t::pos (V4 API) or msg_ephemeris_glo_dep_c_t::pos + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_GLO_DEP_C_POS_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_glo_dep_c_t::vel (V4 API) or msg_ephemeris_glo_dep_c_t::vel (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_glo_dep_c_t::vel (V4 API) or msg_ephemeris_glo_dep_c_t::vel + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_GLO_DEP_C_VEL_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_glo_dep_c_t::acc (V4 API) or msg_ephemeris_glo_dep_c_t::acc (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_glo_dep_c_t::acc (V4 API) or msg_ephemeris_glo_dep_c_t::acc + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_GLO_DEP_C_ACC_MAX 3u - /** - * Encoded length of sbp_msg_ephemeris_glo_dep_c_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_glo_dep_c_t (V4 API) and * msg_ephemeris_glo_dep_c_t (legacy API) */ #define SBP_MSG_EPHEMERIS_GLO_DEP_C_ENCODED_LEN 119u - #define SBP_MSG_EPHEMERIS_GLO_DEP_D 0x0088 /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_glo_dep_d_t::pos (V4 API) or msg_ephemeris_glo_dep_d_t::pos (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_glo_dep_d_t::pos (V4 API) or msg_ephemeris_glo_dep_d_t::pos + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_GLO_DEP_D_POS_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_glo_dep_d_t::vel (V4 API) or msg_ephemeris_glo_dep_d_t::vel (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_glo_dep_d_t::vel (V4 API) or msg_ephemeris_glo_dep_d_t::vel + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_GLO_DEP_D_VEL_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_glo_dep_d_t::acc (V4 API) or msg_ephemeris_glo_dep_d_t::acc (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_glo_dep_d_t::acc (V4 API) or msg_ephemeris_glo_dep_d_t::acc + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_GLO_DEP_D_ACC_MAX 3u - /** - * Encoded length of sbp_msg_ephemeris_glo_dep_d_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_glo_dep_d_t (V4 API) and * msg_ephemeris_glo_dep_d_t (legacy API) */ #define SBP_MSG_EPHEMERIS_GLO_DEP_D_ENCODED_LEN 120u - #define SBP_MSG_EPHEMERIS_GLO 0x008B /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_glo_t::pos (V4 API) or msg_ephemeris_glo_t::pos (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_glo_t::pos (V4 API) or msg_ephemeris_glo_t::pos (legacy + * API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_GLO_POS_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_glo_t::vel (V4 API) or msg_ephemeris_glo_t::vel (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_glo_t::vel (V4 API) or msg_ephemeris_glo_t::vel (legacy + * API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_GLO_VEL_MAX 3u - /** - * The maximum number of items that can be stored in sbp_msg_ephemeris_glo_t::acc (V4 API) or msg_ephemeris_glo_t::acc (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ephemeris_glo_t::acc (V4 API) or msg_ephemeris_glo_t::acc (legacy + * API) before the maximum SBP message size is exceeded */ #define SBP_MSG_EPHEMERIS_GLO_ACC_MAX 3u - /** - * Encoded length of sbp_msg_ephemeris_glo_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_glo_t (V4 API) and * msg_ephemeris_glo_t (legacy API) */ #define SBP_MSG_EPHEMERIS_GLO_ENCODED_LEN 92u - #define SBP_MSG_EPHEMERIS_DEP_D 0x0080 /** - * Encoded length of sbp_msg_ephemeris_dep_d_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_dep_d_t (V4 API) and * msg_ephemeris_dep_d_t (legacy API) */ #define SBP_MSG_EPHEMERIS_DEP_D_ENCODED_LEN 185u - #define SBP_MSG_EPHEMERIS_DEP_A 0x001A /** - * Encoded length of sbp_msg_ephemeris_dep_a_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_dep_a_t (V4 API) and * msg_ephemeris_dep_a_t (legacy API) */ #define SBP_MSG_EPHEMERIS_DEP_A_ENCODED_LEN 175u - #define SBP_MSG_EPHEMERIS_DEP_B 0x0046 /** - * Encoded length of sbp_msg_ephemeris_dep_b_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_dep_b_t (V4 API) and * msg_ephemeris_dep_b_t (legacy API) */ #define SBP_MSG_EPHEMERIS_DEP_B_ENCODED_LEN 176u - #define SBP_MSG_EPHEMERIS_DEP_C 0x0047 /** - * Encoded length of sbp_msg_ephemeris_dep_c_t (V4 API) and + * Encoded length of sbp_msg_ephemeris_dep_c_t (V4 API) and * msg_ephemeris_dep_c_t (legacy API) */ #define SBP_MSG_EPHEMERIS_DEP_C_ENCODED_LEN 185u - /** - * Encoded length of sbp_observation_header_dep_t (V4 API) and + * Encoded length of sbp_observation_header_dep_t (V4 API) and * observation_header_dep_t (legacy API) */ #define SBP_OBSERVATION_HEADER_DEP_ENCODED_LEN 7u - /** - * Encoded length of sbp_carrier_phase_dep_a_t (V4 API) and + * Encoded length of sbp_carrier_phase_dep_a_t (V4 API) and * carrier_phase_dep_a_t (legacy API) */ #define SBP_CARRIER_PHASE_DEP_A_ENCODED_LEN 5u - /** - * Encoded length of sbp_packed_obs_content_dep_a_t (V4 API) and + * Encoded length of sbp_packed_obs_content_dep_a_t (V4 API) and * packed_obs_content_dep_a_t (legacy API) */ #define SBP_PACKED_OBS_CONTENT_DEP_A_ENCODED_LEN 13u - /** - * Encoded length of sbp_packed_obs_content_dep_b_t (V4 API) and + * Encoded length of sbp_packed_obs_content_dep_b_t (V4 API) and * packed_obs_content_dep_b_t (legacy API) */ #define SBP_PACKED_OBS_CONTENT_DEP_B_ENCODED_LEN 16u - /** - * Encoded length of sbp_packed_obs_content_dep_c_t (V4 API) and + * Encoded length of sbp_packed_obs_content_dep_c_t (V4 API) and * packed_obs_content_dep_c_t (legacy API) */ #define SBP_PACKED_OBS_CONTENT_DEP_C_ENCODED_LEN 16u - #define SBP_MSG_OBS_DEP_A 0x0045 /** - * The maximum number of items that can be stored in sbp_msg_obs_dep_a_t::obs (V4 API) or msg_obs_dep_a_t::obs (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in sbp_msg_obs_dep_a_t::obs + * (V4 API) or msg_obs_dep_a_t::obs (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_OBS_DEP_A_OBS_MAX 19u - /** - * Encoded length of sbp_msg_obs_dep_a_t (V4 API) and + * Encoded length of sbp_msg_obs_dep_a_t (V4 API) and * msg_obs_dep_a_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_obs_dep_a_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_obs_dep_a_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_OBS_DEP_A_ENCODED_OVERHEAD 7u - #define SBP_MSG_OBS_DEP_B 0x0043 /** - * The maximum number of items that can be stored in sbp_msg_obs_dep_b_t::obs (V4 API) or msg_obs_dep_b_t::obs (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in sbp_msg_obs_dep_b_t::obs + * (V4 API) or msg_obs_dep_b_t::obs (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_OBS_DEP_B_OBS_MAX 15u - /** - * Encoded length of sbp_msg_obs_dep_b_t (V4 API) and + * Encoded length of sbp_msg_obs_dep_b_t (V4 API) and * msg_obs_dep_b_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_obs_dep_b_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_obs_dep_b_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_OBS_DEP_B_ENCODED_OVERHEAD 7u - #define SBP_MSG_OBS_DEP_C 0x0049 /** - * The maximum number of items that can be stored in sbp_msg_obs_dep_c_t::obs (V4 API) or msg_obs_dep_c_t::obs (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in sbp_msg_obs_dep_c_t::obs + * (V4 API) or msg_obs_dep_c_t::obs (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_OBS_DEP_C_OBS_MAX 15u - /** - * Encoded length of sbp_msg_obs_dep_c_t (V4 API) and + * Encoded length of sbp_msg_obs_dep_c_t (V4 API) and * msg_obs_dep_c_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_obs_dep_c_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_obs_dep_c_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_OBS_DEP_C_ENCODED_OVERHEAD 7u - #define SBP_MSG_IONO 0x0090 /** - * Encoded length of sbp_msg_iono_t (V4 API) and + * Encoded length of sbp_msg_iono_t (V4 API) and * msg_iono_t (legacy API) */ #define SBP_MSG_IONO_ENCODED_LEN 70u - #define SBP_MSG_SV_CONFIGURATION_GPS_DEP 0x0091 /** - * Encoded length of sbp_msg_sv_configuration_gps_dep_t (V4 API) and + * Encoded length of sbp_msg_sv_configuration_gps_dep_t (V4 API) and * msg_sv_configuration_gps_dep_t (legacy API) */ #define SBP_MSG_SV_CONFIGURATION_GPS_DEP_ENCODED_LEN 10u - /** - * Encoded length of sbp_gnss_capb_t (V4 API) and + * Encoded length of sbp_gnss_capb_t (V4 API) and * gnss_capb_t (legacy API) */ #define SBP_GNSS_CAPB_ENCODED_LEN 104u - #define SBP_MSG_GNSS_CAPB 0x0096 /** - * Encoded length of sbp_msg_gnss_capb_t (V4 API) and + * Encoded length of sbp_msg_gnss_capb_t (V4 API) and * msg_gnss_capb_t (legacy API) */ #define SBP_MSG_GNSS_CAPB_ENCODED_LEN 110u - #define SBP_MSG_GROUP_DELAY_DEP_A 0x0092 /** - * Encoded length of sbp_msg_group_delay_dep_a_t (V4 API) and + * Encoded length of sbp_msg_group_delay_dep_a_t (V4 API) and * msg_group_delay_dep_a_t (legacy API) */ #define SBP_MSG_GROUP_DELAY_DEP_A_ENCODED_LEN 14u - #define SBP_MSG_GROUP_DELAY_DEP_B 0x0093 /** - * Encoded length of sbp_msg_group_delay_dep_b_t (V4 API) and + * Encoded length of sbp_msg_group_delay_dep_b_t (V4 API) and * msg_group_delay_dep_b_t (legacy API) */ #define SBP_MSG_GROUP_DELAY_DEP_B_ENCODED_LEN 17u - #define SBP_MSG_GROUP_DELAY 0x0094 /** - * Encoded length of sbp_msg_group_delay_t (V4 API) and + * Encoded length of sbp_msg_group_delay_t (V4 API) and * msg_group_delay_t (legacy API) */ #define SBP_MSG_GROUP_DELAY_ENCODED_LEN 15u - /** - * Encoded length of sbp_almanac_common_content_t (V4 API) and + * Encoded length of sbp_almanac_common_content_t (V4 API) and * almanac_common_content_t (legacy API) */ #define SBP_ALMANAC_COMMON_CONTENT_ENCODED_LEN 22u - /** - * Encoded length of sbp_almanac_common_content_dep_t (V4 API) and + * Encoded length of sbp_almanac_common_content_dep_t (V4 API) and * almanac_common_content_dep_t (legacy API) */ #define SBP_ALMANAC_COMMON_CONTENT_DEP_ENCODED_LEN 24u - #define SBP_MSG_ALMANAC_GPS_DEP 0x0070 /** - * Encoded length of sbp_msg_almanac_gps_dep_t (V4 API) and + * Encoded length of sbp_msg_almanac_gps_dep_t (V4 API) and * msg_almanac_gps_dep_t (legacy API) */ #define SBP_MSG_ALMANAC_GPS_DEP_ENCODED_LEN 96u - #define SBP_MSG_ALMANAC_GPS 0x0072 /** - * Encoded length of sbp_msg_almanac_gps_t (V4 API) and + * Encoded length of sbp_msg_almanac_gps_t (V4 API) and * msg_almanac_gps_t (legacy API) */ #define SBP_MSG_ALMANAC_GPS_ENCODED_LEN 94u - #define SBP_MSG_ALMANAC_GLO_DEP 0x0071 /** - * Encoded length of sbp_msg_almanac_glo_dep_t (V4 API) and + * Encoded length of sbp_msg_almanac_glo_dep_t (V4 API) and * msg_almanac_glo_dep_t (legacy API) */ #define SBP_MSG_ALMANAC_GLO_DEP_ENCODED_LEN 80u - #define SBP_MSG_ALMANAC_GLO 0x0073 /** - * Encoded length of sbp_msg_almanac_glo_t (V4 API) and + * Encoded length of sbp_msg_almanac_glo_t (V4 API) and * msg_almanac_glo_t (legacy API) */ #define SBP_MSG_ALMANAC_GLO_ENCODED_LEN 78u - #define SBP_MSG_GLO_BIASES 0x0075 /** - * Encoded length of sbp_msg_glo_biases_t (V4 API) and + * Encoded length of sbp_msg_glo_biases_t (V4 API) and * msg_glo_biases_t (legacy API) */ #define SBP_MSG_GLO_BIASES_ENCODED_LEN 9u - /** - * Encoded length of sbp_sv_az_el_t (V4 API) and + * Encoded length of sbp_sv_az_el_t (V4 API) and * sv_az_el_t (legacy API) */ #define SBP_SV_AZ_EL_ENCODED_LEN 4u - #define SBP_MSG_SV_AZ_EL 0x0097 /** - * The maximum number of items that can be stored in sbp_msg_sv_az_el_t::azel (V4 API) or msg_sv_az_el_t::azel (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in sbp_msg_sv_az_el_t::azel + * (V4 API) or msg_sv_az_el_t::azel (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_SV_AZ_EL_AZEL_MAX 63u - /** - * Encoded length of sbp_msg_sv_az_el_t (V4 API) and + * Encoded length of sbp_msg_sv_az_el_t (V4 API) and * msg_sv_az_el_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_sv_az_el_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_sv_az_el_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SV_AZ_EL_ENCODED_OVERHEAD 0u - #define SBP_MSG_OSR 0x0640 /** - * The maximum number of items that can be stored in sbp_msg_osr_t::obs (V4 API) or msg_osr_t::obs (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in sbp_msg_osr_t::obs (V4 API) + * or msg_osr_t::obs (legacy API) before the maximum SBP message size is + * exceeded */ #define SBP_MSG_OSR_OBS_MAX 12u - /** - * Encoded length of sbp_msg_osr_t (V4 API) and + * Encoded length of sbp_msg_osr_t (V4 API) and * msg_osr_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_osr_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_osr_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_OSR_ENCODED_OVERHEAD 11u - - #endif /* LIBSBP_OBSERVATION_MACROS_H */ diff --git a/c/include/libsbp/orientation.h b/c/include/libsbp/orientation.h index fdc311ba8..203094960 100644 --- a/c/include/libsbp/orientation.h +++ b/c/include/libsbp/orientation.h @@ -17,9 +17,9 @@ #ifndef LIBSBP_ORIENTATION_MESSAGES_H #define LIBSBP_ORIENTATION_MESSAGES_H +#include #include -#include #include -#include +#include #endif /* LIBSBP_ORIENTATION_MESSAGES_H */ diff --git a/c/include/libsbp/orientation/MSG_ANGULAR_RATE.h b/c/include/libsbp/orientation/MSG_ANGULAR_RATE.h index 79bd9a607..139bbca44 100644 --- a/c/include/libsbp/orientation/MSG_ANGULAR_RATE.h +++ b/c/include/libsbp/orientation/MSG_ANGULAR_RATE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_ORIENTATION_MSG_ANGULAR_RATE_H #define LIBSBP_ORIENTATION_MSG_ANGULAR_RATE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,51 +40,51 @@ *****************************************************************************/ /** Vehicle Body Frame instantaneous angular rates * -* This message reports the orientation rates in the vehicle body frame. The values represent the measurements a strapped down gyroscope would make and are not equivalent to the time derivative of the Euler angles. The orientation and origin of the user frame is specified via device settings. By convention, the vehicle x-axis is expected to be aligned with the forward direction, while the vehicle y-axis is expected to be aligned with the right direction, and the vehicle z-axis should be aligned with the down direction. This message will only be available in future INS versions of Swift Products and is not produced by Piksi Multi or Duro. + * This message reports the orientation rates in the vehicle body frame. The + * values represent the measurements a strapped down gyroscope would make and + * are not equivalent to the time derivative of the Euler angles. The + * orientation and origin of the user frame is specified via device settings. By + * convention, the vehicle x-axis is expected to be aligned with the forward + * direction, while the vehicle y-axis is expected to be aligned with the right + * direction, and the vehicle z-axis should be aligned with the down direction. + * This message will only be available in future INS versions of Swift Products + * and is not produced by Piksi Multi or Duro. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* angular rate about x axis [microdegrees/s] + * angular rate about x axis [microdegrees/s] */ s32 x; - /** -* angular rate about y axis [microdegrees/s] + * angular rate about y axis [microdegrees/s] */ s32 y; - /** -* angular rate about z axis [microdegrees/s] + * angular rate about z axis [microdegrees/s] */ s32 z; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_angular_rate_t; - - /** * Get encoded size of an instance of sbp_msg_angular_rate_t * * @param msg sbp_msg_angular_rate_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_angular_rate_encoded_len(const sbp_msg_angular_rate_t *msg) -{ +static inline size_t sbp_msg_angular_rate_encoded_len( + const sbp_msg_angular_rate_t *msg) { (void)msg; return SBP_MSG_ANGULAR_RATE_ENCODED_LEN; } @@ -92,36 +92,53 @@ static inline size_t sbp_msg_angular_rate_encoded_len(const sbp_msg_angular_rate /** * Encode an instance of sbp_msg_angular_rate_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_angular_rate_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_angular_rate_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_angular_rate_t *msg); +SBP_EXPORT s8 sbp_msg_angular_rate_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_angular_rate_t *msg); /** * Decode an instance of sbp_msg_angular_rate_t from wire representation * - * This function decodes the wire representation of a sbp_msg_angular_rate_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_angular_rate_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_angular_rate_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_angular_rate_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_angular_rate_t *msg); +SBP_EXPORT s8 sbp_msg_angular_rate_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_angular_rate_t *msg); /** * Send an instance of sbp_msg_angular_rate_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_angular_rate_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_angular_rate_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -129,51 +146,61 @@ SBP_EXPORT s8 sbp_msg_angular_rate_decode(const uint8_t *buf, uint8_t len, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_angular_rate_send(sbp_state_t *s, u16 sender_id, const sbp_msg_angular_rate_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_angular_rate_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_angular_rate_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_angular_rate_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_angular_rate_t instance * @param b sbp_msg_angular_rate_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_angular_rate_cmp(const sbp_msg_angular_rate_t *a, const sbp_msg_angular_rate_t *b); +SBP_EXPORT int sbp_msg_angular_rate_cmp(const sbp_msg_angular_rate_t *a, + const sbp_msg_angular_rate_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_angular_rate_t &lhs, const sbp_msg_angular_rate_t &rhs) { +static inline bool operator==(const sbp_msg_angular_rate_t &lhs, + const sbp_msg_angular_rate_t &rhs) { return sbp_msg_angular_rate_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_angular_rate_t &lhs, const sbp_msg_angular_rate_t &rhs) { +static inline bool operator!=(const sbp_msg_angular_rate_t &lhs, + const sbp_msg_angular_rate_t &rhs) { return sbp_msg_angular_rate_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_angular_rate_t &lhs, const sbp_msg_angular_rate_t &rhs) { +static inline bool operator<(const sbp_msg_angular_rate_t &lhs, + const sbp_msg_angular_rate_t &rhs) { return sbp_msg_angular_rate_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_angular_rate_t &lhs, const sbp_msg_angular_rate_t &rhs) { +static inline bool operator<=(const sbp_msg_angular_rate_t &lhs, + const sbp_msg_angular_rate_t &rhs) { return sbp_msg_angular_rate_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_angular_rate_t &lhs, const sbp_msg_angular_rate_t &rhs) { +static inline bool operator>(const sbp_msg_angular_rate_t &lhs, + const sbp_msg_angular_rate_t &rhs) { return sbp_msg_angular_rate_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_angular_rate_t &lhs, const sbp_msg_angular_rate_t &rhs) { +static inline bool operator>=(const sbp_msg_angular_rate_t &lhs, + const sbp_msg_angular_rate_t &rhs) { return sbp_msg_angular_rate_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_ORIENTATION_MSG_ANGULAR_RATE_H */ - diff --git a/c/include/libsbp/orientation/MSG_BASELINE_HEADING.h b/c/include/libsbp/orientation/MSG_BASELINE_HEADING.h index f54bba674..0b20f6340 100644 --- a/c/include/libsbp/orientation/MSG_BASELINE_HEADING.h +++ b/c/include/libsbp/orientation/MSG_BASELINE_HEADING.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_ORIENTATION_MSG_BASELINE_HEADING_H #define LIBSBP_ORIENTATION_MSG_BASELINE_HEADING_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,45 +40,41 @@ *****************************************************************************/ /** Heading relative to True North * -* This message reports the baseline heading pointing from the base station to the rover relative to True North. The full GPS time is given by the preceding MSG_GPS_TIME with the matching time-of-week (tow). It is intended that time-matched RTK mode is used when the base station is moving. + * This message reports the baseline heading pointing from the base station to + * the rover relative to True North. The full GPS time is given by the preceding + * MSG_GPS_TIME with the matching time-of-week (tow). It is intended that + * time-matched RTK mode is used when the base station is moving. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Heading [mdeg] + * Heading [mdeg] */ u32 heading; - /** -* Number of satellites used in solution + * Number of satellites used in solution */ u8 n_sats; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_baseline_heading_t; - - /** * Get encoded size of an instance of sbp_msg_baseline_heading_t * * @param msg sbp_msg_baseline_heading_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_baseline_heading_encoded_len(const sbp_msg_baseline_heading_t *msg) -{ +static inline size_t sbp_msg_baseline_heading_encoded_len( + const sbp_msg_baseline_heading_t *msg) { (void)msg; return SBP_MSG_BASELINE_HEADING_ENCODED_LEN; } @@ -86,36 +82,53 @@ static inline size_t sbp_msg_baseline_heading_encoded_len(const sbp_msg_baseline /** * Encode an instance of sbp_msg_baseline_heading_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_baseline_heading_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_heading_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_heading_t *msg); +SBP_EXPORT s8 +sbp_msg_baseline_heading_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_baseline_heading_t *msg); /** * Decode an instance of sbp_msg_baseline_heading_t from wire representation * - * This function decodes the wire representation of a sbp_msg_baseline_heading_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_baseline_heading_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_baseline_heading_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_heading_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_heading_t *msg); +SBP_EXPORT s8 sbp_msg_baseline_heading_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_baseline_heading_t *msg); /** * Send an instance of sbp_msg_baseline_heading_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_baseline_heading_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_baseline_heading_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -123,51 +136,61 @@ SBP_EXPORT s8 sbp_msg_baseline_heading_decode(const uint8_t *buf, uint8_t len, u * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_baseline_heading_send(sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_heading_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_baseline_heading_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_heading_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_baseline_heading_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_baseline_heading_t instance * @param b sbp_msg_baseline_heading_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_baseline_heading_cmp(const sbp_msg_baseline_heading_t *a, const sbp_msg_baseline_heading_t *b); +SBP_EXPORT int sbp_msg_baseline_heading_cmp( + const sbp_msg_baseline_heading_t *a, const sbp_msg_baseline_heading_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_baseline_heading_t &lhs, const sbp_msg_baseline_heading_t &rhs) { +static inline bool operator==(const sbp_msg_baseline_heading_t &lhs, + const sbp_msg_baseline_heading_t &rhs) { return sbp_msg_baseline_heading_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_baseline_heading_t &lhs, const sbp_msg_baseline_heading_t &rhs) { +static inline bool operator!=(const sbp_msg_baseline_heading_t &lhs, + const sbp_msg_baseline_heading_t &rhs) { return sbp_msg_baseline_heading_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_baseline_heading_t &lhs, const sbp_msg_baseline_heading_t &rhs) { +static inline bool operator<(const sbp_msg_baseline_heading_t &lhs, + const sbp_msg_baseline_heading_t &rhs) { return sbp_msg_baseline_heading_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_baseline_heading_t &lhs, const sbp_msg_baseline_heading_t &rhs) { +static inline bool operator<=(const sbp_msg_baseline_heading_t &lhs, + const sbp_msg_baseline_heading_t &rhs) { return sbp_msg_baseline_heading_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_baseline_heading_t &lhs, const sbp_msg_baseline_heading_t &rhs) { +static inline bool operator>(const sbp_msg_baseline_heading_t &lhs, + const sbp_msg_baseline_heading_t &rhs) { return sbp_msg_baseline_heading_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_baseline_heading_t &lhs, const sbp_msg_baseline_heading_t &rhs) { +static inline bool operator>=(const sbp_msg_baseline_heading_t &lhs, + const sbp_msg_baseline_heading_t &rhs) { return sbp_msg_baseline_heading_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_ORIENTATION_MSG_BASELINE_HEADING_H */ - diff --git a/c/include/libsbp/orientation/MSG_ORIENT_EULER.h b/c/include/libsbp/orientation/MSG_ORIENT_EULER.h index 5609c8a3c..4d2a714f9 100644 --- a/c/include/libsbp/orientation/MSG_ORIENT_EULER.h +++ b/c/include/libsbp/orientation/MSG_ORIENT_EULER.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_ORIENTATION_MSG_ORIENT_EULER_H #define LIBSBP_ORIENTATION_MSG_ORIENT_EULER_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,69 +40,63 @@ *****************************************************************************/ /** Euler angles * -* This message reports the yaw, pitch, and roll angles of the vehicle body frame. The rotations should applied intrinsically in the order yaw, pitch, and roll in order to rotate the from a frame aligned with the local-level NED frame to the vehicle body frame. This message will only be available in future INS versions of Swift Products and is not produced by Piksi Multi or Duro. + * This message reports the yaw, pitch, and roll angles of the vehicle body + * frame. The rotations should applied intrinsically in the order yaw, pitch, + * and roll in order to rotate the from a frame aligned with the local-level NED + * frame to the vehicle body frame. This message will only be available in + * future INS versions of Swift Products and is not produced by Piksi Multi or + * Duro. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* rotation about the forward axis of the vehicle [microdegrees] + * rotation about the forward axis of the vehicle [microdegrees] */ s32 roll; - /** -* rotation about the rightward axis of the vehicle [microdegrees] + * rotation about the rightward axis of the vehicle [microdegrees] */ s32 pitch; - /** -* rotation about the downward axis of the vehicle [microdegrees] + * rotation about the downward axis of the vehicle [microdegrees] */ s32 yaw; - /** -* Estimated standard deviation of roll [degrees] + * Estimated standard deviation of roll [degrees] */ float roll_accuracy; - /** -* Estimated standard deviation of pitch [degrees] + * Estimated standard deviation of pitch [degrees] */ float pitch_accuracy; - /** -* Estimated standard deviation of yaw [degrees] + * Estimated standard deviation of yaw [degrees] */ float yaw_accuracy; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_orient_euler_t; - - /** * Get encoded size of an instance of sbp_msg_orient_euler_t * * @param msg sbp_msg_orient_euler_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_orient_euler_encoded_len(const sbp_msg_orient_euler_t *msg) -{ +static inline size_t sbp_msg_orient_euler_encoded_len( + const sbp_msg_orient_euler_t *msg) { (void)msg; return SBP_MSG_ORIENT_EULER_ENCODED_LEN; } @@ -110,36 +104,53 @@ static inline size_t sbp_msg_orient_euler_encoded_len(const sbp_msg_orient_euler /** * Encode an instance of sbp_msg_orient_euler_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_orient_euler_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_orient_euler_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_orient_euler_t *msg); +SBP_EXPORT s8 sbp_msg_orient_euler_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_orient_euler_t *msg); /** * Decode an instance of sbp_msg_orient_euler_t from wire representation * - * This function decodes the wire representation of a sbp_msg_orient_euler_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_orient_euler_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_orient_euler_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_orient_euler_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_orient_euler_t *msg); +SBP_EXPORT s8 sbp_msg_orient_euler_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_orient_euler_t *msg); /** * Send an instance of sbp_msg_orient_euler_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_orient_euler_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_orient_euler_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -147,51 +158,61 @@ SBP_EXPORT s8 sbp_msg_orient_euler_decode(const uint8_t *buf, uint8_t len, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_orient_euler_send(sbp_state_t *s, u16 sender_id, const sbp_msg_orient_euler_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_orient_euler_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_orient_euler_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_orient_euler_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_orient_euler_t instance * @param b sbp_msg_orient_euler_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_orient_euler_cmp(const sbp_msg_orient_euler_t *a, const sbp_msg_orient_euler_t *b); +SBP_EXPORT int sbp_msg_orient_euler_cmp(const sbp_msg_orient_euler_t *a, + const sbp_msg_orient_euler_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_orient_euler_t &lhs, const sbp_msg_orient_euler_t &rhs) { +static inline bool operator==(const sbp_msg_orient_euler_t &lhs, + const sbp_msg_orient_euler_t &rhs) { return sbp_msg_orient_euler_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_orient_euler_t &lhs, const sbp_msg_orient_euler_t &rhs) { +static inline bool operator!=(const sbp_msg_orient_euler_t &lhs, + const sbp_msg_orient_euler_t &rhs) { return sbp_msg_orient_euler_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_orient_euler_t &lhs, const sbp_msg_orient_euler_t &rhs) { +static inline bool operator<(const sbp_msg_orient_euler_t &lhs, + const sbp_msg_orient_euler_t &rhs) { return sbp_msg_orient_euler_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_orient_euler_t &lhs, const sbp_msg_orient_euler_t &rhs) { +static inline bool operator<=(const sbp_msg_orient_euler_t &lhs, + const sbp_msg_orient_euler_t &rhs) { return sbp_msg_orient_euler_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_orient_euler_t &lhs, const sbp_msg_orient_euler_t &rhs) { +static inline bool operator>(const sbp_msg_orient_euler_t &lhs, + const sbp_msg_orient_euler_t &rhs) { return sbp_msg_orient_euler_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_orient_euler_t &lhs, const sbp_msg_orient_euler_t &rhs) { +static inline bool operator>=(const sbp_msg_orient_euler_t &lhs, + const sbp_msg_orient_euler_t &rhs) { return sbp_msg_orient_euler_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_ORIENTATION_MSG_ORIENT_EULER_H */ - diff --git a/c/include/libsbp/orientation/MSG_ORIENT_QUAT.h b/c/include/libsbp/orientation/MSG_ORIENT_QUAT.h index d3d35a085..8fbfd0984 100644 --- a/c/include/libsbp/orientation/MSG_ORIENT_QUAT.h +++ b/c/include/libsbp/orientation/MSG_ORIENT_QUAT.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_ORIENTATION_MSG_ORIENT_QUAT_H #define LIBSBP_ORIENTATION_MSG_ORIENT_QUAT_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,81 +40,72 @@ *****************************************************************************/ /** Quaternion 4 component vector * -* This message reports the quaternion vector describing the vehicle body frame's orientation with respect to a local-level NED frame. The components of the vector should sum to a unit vector assuming that the LSB of each component as a value of 2^-31. This message will only be available in future INS versions of Swift Products and is not produced by Piksi Multi or Duro. + * This message reports the quaternion vector describing the vehicle body + * frame's orientation with respect to a local-level NED frame. The components + * of the vector should sum to a unit vector assuming that the LSB of each + * component as a value of 2^-31. This message will only be available in future + * INS versions of Swift Products and is not produced by Piksi Multi or Duro. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* Real component [2^-31] + * Real component [2^-31] */ s32 w; - /** -* 1st imaginary component [2^-31] + * 1st imaginary component [2^-31] */ s32 x; - /** -* 2nd imaginary component [2^-31] + * 2nd imaginary component [2^-31] */ s32 y; - /** -* 3rd imaginary component [2^-31] + * 3rd imaginary component [2^-31] */ s32 z; - /** -* Estimated standard deviation of w [N/A] + * Estimated standard deviation of w [N/A] */ float w_accuracy; - /** -* Estimated standard deviation of x [N/A] + * Estimated standard deviation of x [N/A] */ float x_accuracy; - /** -* Estimated standard deviation of y [N/A] + * Estimated standard deviation of y [N/A] */ float y_accuracy; - /** -* Estimated standard deviation of z [N/A] + * Estimated standard deviation of z [N/A] */ float z_accuracy; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_orient_quat_t; - - /** * Get encoded size of an instance of sbp_msg_orient_quat_t * * @param msg sbp_msg_orient_quat_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_orient_quat_encoded_len(const sbp_msg_orient_quat_t *msg) -{ +static inline size_t sbp_msg_orient_quat_encoded_len( + const sbp_msg_orient_quat_t *msg) { (void)msg; return SBP_MSG_ORIENT_QUAT_ENCODED_LEN; } @@ -122,36 +113,53 @@ static inline size_t sbp_msg_orient_quat_encoded_len(const sbp_msg_orient_quat_t /** * Encode an instance of sbp_msg_orient_quat_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_orient_quat_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_orient_quat_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_orient_quat_t *msg); +SBP_EXPORT s8 sbp_msg_orient_quat_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_orient_quat_t *msg); /** * Decode an instance of sbp_msg_orient_quat_t from wire representation * - * This function decodes the wire representation of a sbp_msg_orient_quat_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_orient_quat_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_orient_quat_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_orient_quat_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_orient_quat_t *msg); +SBP_EXPORT s8 sbp_msg_orient_quat_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_orient_quat_t *msg); /** * Send an instance of sbp_msg_orient_quat_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_orient_quat_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_orient_quat_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -159,51 +167,61 @@ SBP_EXPORT s8 sbp_msg_orient_quat_decode(const uint8_t *buf, uint8_t len, uint8_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_orient_quat_send(sbp_state_t *s, u16 sender_id, const sbp_msg_orient_quat_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_orient_quat_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_orient_quat_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_orient_quat_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_orient_quat_t instance * @param b sbp_msg_orient_quat_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_orient_quat_cmp(const sbp_msg_orient_quat_t *a, const sbp_msg_orient_quat_t *b); +SBP_EXPORT int sbp_msg_orient_quat_cmp(const sbp_msg_orient_quat_t *a, + const sbp_msg_orient_quat_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_orient_quat_t &lhs, const sbp_msg_orient_quat_t &rhs) { +static inline bool operator==(const sbp_msg_orient_quat_t &lhs, + const sbp_msg_orient_quat_t &rhs) { return sbp_msg_orient_quat_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_orient_quat_t &lhs, const sbp_msg_orient_quat_t &rhs) { +static inline bool operator!=(const sbp_msg_orient_quat_t &lhs, + const sbp_msg_orient_quat_t &rhs) { return sbp_msg_orient_quat_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_orient_quat_t &lhs, const sbp_msg_orient_quat_t &rhs) { +static inline bool operator<(const sbp_msg_orient_quat_t &lhs, + const sbp_msg_orient_quat_t &rhs) { return sbp_msg_orient_quat_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_orient_quat_t &lhs, const sbp_msg_orient_quat_t &rhs) { +static inline bool operator<=(const sbp_msg_orient_quat_t &lhs, + const sbp_msg_orient_quat_t &rhs) { return sbp_msg_orient_quat_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_orient_quat_t &lhs, const sbp_msg_orient_quat_t &rhs) { +static inline bool operator>(const sbp_msg_orient_quat_t &lhs, + const sbp_msg_orient_quat_t &rhs) { return sbp_msg_orient_quat_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_orient_quat_t &lhs, const sbp_msg_orient_quat_t &rhs) { +static inline bool operator>=(const sbp_msg_orient_quat_t &lhs, + const sbp_msg_orient_quat_t &rhs) { return sbp_msg_orient_quat_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_ORIENTATION_MSG_ORIENT_QUAT_H */ - diff --git a/c/include/libsbp/orientation_macros.h b/c/include/libsbp/orientation_macros.h index 3acd021c6..b29f3e907 100644 --- a/c/include/libsbp/orientation_macros.h +++ b/c/include/libsbp/orientation_macros.h @@ -18,92 +18,97 @@ #ifndef LIBSBP_ORIENTATION_MACROS_H #define LIBSBP_ORIENTATION_MACROS_H - #define SBP_MSG_BASELINE_HEADING 0x020F #define SBP_BASELINE_HEADING_FIX_MODE_MASK (0x7u) #define SBP_BASELINE_HEADING_FIX_MODE_SHIFT (0u) -#define SBP_BASELINE_HEADING_FIX_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_BASELINE_HEADING_FIX_MODE_SHIFT) \ - & SBP_BASELINE_HEADING_FIX_MODE_MASK)) -#define SBP_BASELINE_HEADING_FIX_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_BASELINE_HEADING_FIX_MODE_MASK << SBP_BASELINE_HEADING_FIX_MODE_SHIFT))) | \ - (((val) & (SBP_BASELINE_HEADING_FIX_MODE_MASK)) \ - << (SBP_BASELINE_HEADING_FIX_MODE_SHIFT)));} while(0) - +#define SBP_BASELINE_HEADING_FIX_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_BASELINE_HEADING_FIX_MODE_SHIFT) & \ + SBP_BASELINE_HEADING_FIX_MODE_MASK)) +#define SBP_BASELINE_HEADING_FIX_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_BASELINE_HEADING_FIX_MODE_MASK \ + << SBP_BASELINE_HEADING_FIX_MODE_SHIFT))) | \ + (((val) & (SBP_BASELINE_HEADING_FIX_MODE_MASK)) \ + << (SBP_BASELINE_HEADING_FIX_MODE_SHIFT))); \ + } while (0) #define SBP_BASELINE_HEADING_FIX_MODE_INVALID (0) #define SBP_BASELINE_HEADING_FIX_MODE_DIFFERENTIAL_GNSS (2) #define SBP_BASELINE_HEADING_FIX_MODE_FLOAT_RTK (3) #define SBP_BASELINE_HEADING_FIX_MODE_FIXED_RTK (4) /** - * Encoded length of sbp_msg_baseline_heading_t (V4 API) and + * Encoded length of sbp_msg_baseline_heading_t (V4 API) and * msg_baseline_heading_t (legacy API) */ #define SBP_MSG_BASELINE_HEADING_ENCODED_LEN 10u - #define SBP_MSG_ORIENT_QUAT 0x0220 #define SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_MASK (0x7u) #define SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_SHIFT (0u) -#define SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_SHIFT) \ - & SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_MASK)) -#define SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_MASK << SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_SHIFT))) | \ - (((val) & (SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_MASK)) \ - << (SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_SHIFT)));} while(0) - +#define SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_SHIFT) & \ + SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_MASK)) +#define SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_MASK \ + << SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_SHIFT))) | \ + (((val) & (SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_MASK)) \ + << (SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_SHIFT))); \ + } while (0) #define SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_INVALID (0) #define SBP_ORIENT_QUAT_INS_NAVIGATION_MODE_VALID (1) /** - * Encoded length of sbp_msg_orient_quat_t (V4 API) and + * Encoded length of sbp_msg_orient_quat_t (V4 API) and * msg_orient_quat_t (legacy API) */ #define SBP_MSG_ORIENT_QUAT_ENCODED_LEN 37u - #define SBP_MSG_ORIENT_EULER 0x0221 #define SBP_ORIENT_EULER_INS_NAVIGATION_MODE_MASK (0x7u) #define SBP_ORIENT_EULER_INS_NAVIGATION_MODE_SHIFT (0u) -#define SBP_ORIENT_EULER_INS_NAVIGATION_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_ORIENT_EULER_INS_NAVIGATION_MODE_SHIFT) \ - & SBP_ORIENT_EULER_INS_NAVIGATION_MODE_MASK)) -#define SBP_ORIENT_EULER_INS_NAVIGATION_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_ORIENT_EULER_INS_NAVIGATION_MODE_MASK << SBP_ORIENT_EULER_INS_NAVIGATION_MODE_SHIFT))) | \ - (((val) & (SBP_ORIENT_EULER_INS_NAVIGATION_MODE_MASK)) \ - << (SBP_ORIENT_EULER_INS_NAVIGATION_MODE_SHIFT)));} while(0) - +#define SBP_ORIENT_EULER_INS_NAVIGATION_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ORIENT_EULER_INS_NAVIGATION_MODE_SHIFT) & \ + SBP_ORIENT_EULER_INS_NAVIGATION_MODE_MASK)) +#define SBP_ORIENT_EULER_INS_NAVIGATION_MODE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_ORIENT_EULER_INS_NAVIGATION_MODE_MASK \ + << SBP_ORIENT_EULER_INS_NAVIGATION_MODE_SHIFT))) | \ + (((val) & (SBP_ORIENT_EULER_INS_NAVIGATION_MODE_MASK)) \ + << (SBP_ORIENT_EULER_INS_NAVIGATION_MODE_SHIFT))); \ + } while (0) #define SBP_ORIENT_EULER_INS_NAVIGATION_MODE_INVALID (0) #define SBP_ORIENT_EULER_INS_NAVIGATION_MODE_VALID (1) /** - * Encoded length of sbp_msg_orient_euler_t (V4 API) and + * Encoded length of sbp_msg_orient_euler_t (V4 API) and * msg_orient_euler_t (legacy API) */ #define SBP_MSG_ORIENT_EULER_ENCODED_LEN 29u - #define SBP_MSG_ANGULAR_RATE 0x0222 #define SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_MASK (0x7u) #define SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_SHIFT (0u) -#define SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_SHIFT) \ - & SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_MASK)) -#define SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_MASK << SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_SHIFT))) | \ - (((val) & (SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_MASK)) \ - << (SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_SHIFT)));} while(0) - +#define SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_SHIFT) & \ + SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_MASK)) +#define SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_MASK \ + << SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_SHIFT))) | \ + (((val) & (SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_MASK)) \ + << (SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_SHIFT))); \ + } while (0) #define SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_INVALID (0) #define SBP_ANGULAR_RATE_INS_NAVIGATION_MODE_VALID (1) /** - * Encoded length of sbp_msg_angular_rate_t (V4 API) and + * Encoded length of sbp_msg_angular_rate_t (V4 API) and * msg_angular_rate_t (legacy API) */ #define SBP_MSG_ANGULAR_RATE_ENCODED_LEN 17u - - #endif /* LIBSBP_ORIENTATION_MACROS_H */ diff --git a/c/include/libsbp/piksi.h b/c/include/libsbp/piksi.h index 15bdf4c88..4ef923e97 100644 --- a/c/include/libsbp/piksi.h +++ b/c/include/libsbp/piksi.h @@ -17,34 +17,34 @@ #ifndef LIBSBP_PIKSI_MESSAGES_H #define LIBSBP_PIKSI_MESSAGES_H +#include #include -#include -#include -#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include +#include #include #include -#include -#include -#include -#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include #endif /* LIBSBP_PIKSI_MESSAGES_H */ diff --git a/c/include/libsbp/piksi/Latency.h b/c/include/libsbp/piksi/Latency.h index d2bb66493..5a582de8b 100644 --- a/c/include/libsbp/piksi/Latency.h +++ b/c/include/libsbp/piksi/Latency.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_LATENCY_H #define LIBSBP_PIKSI_LATENCY_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,45 +40,40 @@ *****************************************************************************/ /** Receiver-to-base station latency * -* Statistics on the latency of observations received from the base station. As observation packets are received their GPS time is compared to the current GPS time calculated locally by the receiver to give a precise measurement of the end-to-end communication latency in the system. + * Statistics on the latency of observations received from the base station. As + * observation packets are received their GPS time is compared to the current + * GPS time calculated locally by the receiver to give a precise measurement of + * the end-to-end communication latency in the system. */ typedef struct { - - /** -* Average latency [ms] + * Average latency [ms] */ s32 avg; - /** -* Minimum latency [ms] + * Minimum latency [ms] */ s32 lmin; - /** -* Maximum latency [ms] + * Maximum latency [ms] */ s32 lmax; - /** -* Smoothed estimate of the current latency [ms] + * Smoothed estimate of the current latency [ms] */ s32 current; } sbp_latency_t; - - /** * Get encoded size of an instance of sbp_latency_t * * @param msg sbp_latency_t instance * @return Length of on-wire representation */ -static inline size_t sbp_latency_encoded_len(const sbp_latency_t *msg) -{ +static inline size_t sbp_latency_encoded_len(const sbp_latency_t *msg) { (void)msg; return SBP_LATENCY_ENCODED_LEN; } @@ -86,39 +81,53 @@ static inline size_t sbp_latency_encoded_len(const sbp_latency_t *msg) /** * Encode an instance of sbp_latency_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_latency_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_latency_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_latency_t *msg); +SBP_EXPORT s8 sbp_latency_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_latency_t *msg); /** * Decode an instance of sbp_latency_t from wire representation * - * This function decodes the wire representation of a sbp_latency_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_latency_t message to + * the given instance. The caller must specify the length of the buffer in the + * \p len parameter. If non-null the number of bytes read from the buffer will + * be returned in \p n_read. * * @param buf Wire representation of the sbp_latency_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_latency_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_latency_t *msg); +SBP_EXPORT s8 sbp_latency_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_latency_t *msg); /** * Compare two instances of sbp_latency_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_latency_t instance * @param b sbp_latency_t instance @@ -127,33 +136,38 @@ SBP_EXPORT s8 sbp_latency_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea SBP_EXPORT int sbp_latency_cmp(const sbp_latency_t *a, const sbp_latency_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_latency_t &lhs, const sbp_latency_t &rhs) { +static inline bool operator==(const sbp_latency_t &lhs, + const sbp_latency_t &rhs) { return sbp_latency_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_latency_t &lhs, const sbp_latency_t &rhs) { +static inline bool operator!=(const sbp_latency_t &lhs, + const sbp_latency_t &rhs) { return sbp_latency_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_latency_t &lhs, const sbp_latency_t &rhs) { +static inline bool operator<(const sbp_latency_t &lhs, + const sbp_latency_t &rhs) { return sbp_latency_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_latency_t &lhs, const sbp_latency_t &rhs) { +static inline bool operator<=(const sbp_latency_t &lhs, + const sbp_latency_t &rhs) { return sbp_latency_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_latency_t &lhs, const sbp_latency_t &rhs) { +static inline bool operator>(const sbp_latency_t &lhs, + const sbp_latency_t &rhs) { return sbp_latency_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_latency_t &lhs, const sbp_latency_t &rhs) { +static inline bool operator>=(const sbp_latency_t &lhs, + const sbp_latency_t &rhs) { return sbp_latency_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_LATENCY_H */ - diff --git a/c/include/libsbp/piksi/MSG_ALMANAC.h b/c/include/libsbp/piksi/MSG_ALMANAC.h index 0e6bba7f4..e0aa97150 100644 --- a/c/include/libsbp/piksi/MSG_ALMANAC.h +++ b/c/include/libsbp/piksi/MSG_ALMANAC.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_ALMANAC_H #define LIBSBP_PIKSI_MSG_ALMANAC_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,25 +40,24 @@ *****************************************************************************/ /** Legacy message to load satellite almanac (host => Piksi) * -* This is a legacy message for sending and loading a satellite alamanac onto the Piksi's flash memory from the host. + * This is a legacy message for sending and loading a satellite alamanac onto + * the Piksi's flash memory from the host. */ typedef struct { /** - * Do not use this field, it exists only to prevent illegal C syntax. Any value written to this field will be ignored + * Do not use this field, it exists only to prevent illegal C syntax. Any + * value written to this field will be ignored */ char DO_NOT_USE_dummy_field_to_prevent_empty_struct; } sbp_msg_almanac_t; - - /** * Get encoded size of an instance of sbp_msg_almanac_t * * @param msg sbp_msg_almanac_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_almanac_encoded_len(const sbp_msg_almanac_t *msg) -{ +static inline size_t sbp_msg_almanac_encoded_len(const sbp_msg_almanac_t *msg) { (void)msg; return SBP_MSG_ALMANAC_ENCODED_LEN; } @@ -66,36 +65,52 @@ static inline size_t sbp_msg_almanac_encoded_len(const sbp_msg_almanac_t *msg) /** * Encode an instance of sbp_msg_almanac_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_almanac_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_almanac_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_almanac_t *msg); +SBP_EXPORT s8 sbp_msg_almanac_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_almanac_t *msg); /** * Decode an instance of sbp_msg_almanac_t from wire representation * - * This function decodes the wire representation of a sbp_msg_almanac_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_almanac_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_almanac_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_almanac_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_almanac_t *msg); +SBP_EXPORT s8 sbp_msg_almanac_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_almanac_t *msg); /** * Send an instance of sbp_msg_almanac_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_almanac_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_almanac_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -103,51 +118,61 @@ SBP_EXPORT s8 sbp_msg_almanac_decode(const uint8_t *buf, uint8_t len, uint8_t *n * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_almanac_send(sbp_state_t *s, u16 sender_id, const sbp_msg_almanac_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_almanac_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_almanac_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_almanac_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_almanac_t instance * @param b sbp_msg_almanac_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_almanac_cmp(const sbp_msg_almanac_t *a, const sbp_msg_almanac_t *b); +SBP_EXPORT int sbp_msg_almanac_cmp(const sbp_msg_almanac_t *a, + const sbp_msg_almanac_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_almanac_t &lhs, const sbp_msg_almanac_t &rhs) { +static inline bool operator==(const sbp_msg_almanac_t &lhs, + const sbp_msg_almanac_t &rhs) { return sbp_msg_almanac_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_almanac_t &lhs, const sbp_msg_almanac_t &rhs) { +static inline bool operator!=(const sbp_msg_almanac_t &lhs, + const sbp_msg_almanac_t &rhs) { return sbp_msg_almanac_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_almanac_t &lhs, const sbp_msg_almanac_t &rhs) { +static inline bool operator<(const sbp_msg_almanac_t &lhs, + const sbp_msg_almanac_t &rhs) { return sbp_msg_almanac_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_almanac_t &lhs, const sbp_msg_almanac_t &rhs) { +static inline bool operator<=(const sbp_msg_almanac_t &lhs, + const sbp_msg_almanac_t &rhs) { return sbp_msg_almanac_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_almanac_t &lhs, const sbp_msg_almanac_t &rhs) { +static inline bool operator>(const sbp_msg_almanac_t &lhs, + const sbp_msg_almanac_t &rhs) { return sbp_msg_almanac_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_almanac_t &lhs, const sbp_msg_almanac_t &rhs) { +static inline bool operator>=(const sbp_msg_almanac_t &lhs, + const sbp_msg_almanac_t &rhs) { return sbp_msg_almanac_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_ALMANAC_H */ - diff --git a/c/include/libsbp/piksi/MSG_CELL_MODEM_STATUS.h b/c/include/libsbp/piksi/MSG_CELL_MODEM_STATUS.h index 7adca2789..20f1bce3c 100644 --- a/c/include/libsbp/piksi/MSG_CELL_MODEM_STATUS.h +++ b/c/include/libsbp/piksi/MSG_CELL_MODEM_STATUS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_CELL_MODEM_STATUS_H #define LIBSBP_PIKSI_MSG_CELL_MODEM_STATUS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,85 +40,100 @@ *****************************************************************************/ /** Cell modem information update message * -* If a cell modem is present on a piksi device, this message will be send periodically to update the host on the status of the modem and its various parameters. + * If a cell modem is present on a piksi device, this message will be send + * periodically to update the host on the status of the modem and its various + * parameters. */ typedef struct { - - /** -* Received cell signal strength in dBm, zero translates to unknown [dBm] + * Received cell signal strength in dBm, zero translates to unknown [dBm] */ s8 signal_strength; - /** -* BER as reported by the modem, zero translates to unknown + * BER as reported by the modem, zero translates to unknown */ float signal_error_rate; - /** -* Unspecified data TBD for this schema + * Unspecified data TBD for this schema */ u8 reserved[SBP_MSG_CELL_MODEM_STATUS_RESERVED_MAX]; /** * Number of elements in reserved * - * When sending a message fill in this field with the number elements set in reserved before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * reserved before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in reserved. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * reserved. The value of any elements beyond the index specified in this + * field is undefined */ u8 n_reserved; } sbp_msg_cell_modem_status_t; - - /** * Get encoded size of an instance of sbp_msg_cell_modem_status_t * * @param msg sbp_msg_cell_modem_status_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_cell_modem_status_encoded_len(const sbp_msg_cell_modem_status_t *msg) -{ - return SBP_MSG_CELL_MODEM_STATUS_ENCODED_OVERHEAD - + (msg->n_reserved * SBP_ENCODED_LEN_U8) - ; +static inline size_t sbp_msg_cell_modem_status_encoded_len( + const sbp_msg_cell_modem_status_t *msg) { + return SBP_MSG_CELL_MODEM_STATUS_ENCODED_OVERHEAD + + (msg->n_reserved * SBP_ENCODED_LEN_U8); } /** * Encode an instance of sbp_msg_cell_modem_status_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_cell_modem_status_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_cell_modem_status_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_cell_modem_status_t *msg); +SBP_EXPORT s8 +sbp_msg_cell_modem_status_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_cell_modem_status_t *msg); /** * Decode an instance of sbp_msg_cell_modem_status_t from wire representation * - * This function decodes the wire representation of a sbp_msg_cell_modem_status_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_cell_modem_status_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_cell_modem_status_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_cell_modem_status_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_cell_modem_status_t *msg); +SBP_EXPORT s8 sbp_msg_cell_modem_status_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_cell_modem_status_t *msg); /** * Send an instance of sbp_msg_cell_modem_status_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_cell_modem_status_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_cell_modem_status_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -126,51 +141,61 @@ SBP_EXPORT s8 sbp_msg_cell_modem_status_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_cell_modem_status_send(sbp_state_t *s, u16 sender_id, const sbp_msg_cell_modem_status_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_cell_modem_status_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_cell_modem_status_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_cell_modem_status_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_cell_modem_status_t instance * @param b sbp_msg_cell_modem_status_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_cell_modem_status_cmp(const sbp_msg_cell_modem_status_t *a, const sbp_msg_cell_modem_status_t *b); +SBP_EXPORT int sbp_msg_cell_modem_status_cmp( + const sbp_msg_cell_modem_status_t *a, const sbp_msg_cell_modem_status_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_cell_modem_status_t &lhs, const sbp_msg_cell_modem_status_t &rhs) { +static inline bool operator==(const sbp_msg_cell_modem_status_t &lhs, + const sbp_msg_cell_modem_status_t &rhs) { return sbp_msg_cell_modem_status_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_cell_modem_status_t &lhs, const sbp_msg_cell_modem_status_t &rhs) { +static inline bool operator!=(const sbp_msg_cell_modem_status_t &lhs, + const sbp_msg_cell_modem_status_t &rhs) { return sbp_msg_cell_modem_status_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_cell_modem_status_t &lhs, const sbp_msg_cell_modem_status_t &rhs) { +static inline bool operator<(const sbp_msg_cell_modem_status_t &lhs, + const sbp_msg_cell_modem_status_t &rhs) { return sbp_msg_cell_modem_status_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_cell_modem_status_t &lhs, const sbp_msg_cell_modem_status_t &rhs) { +static inline bool operator<=(const sbp_msg_cell_modem_status_t &lhs, + const sbp_msg_cell_modem_status_t &rhs) { return sbp_msg_cell_modem_status_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_cell_modem_status_t &lhs, const sbp_msg_cell_modem_status_t &rhs) { +static inline bool operator>(const sbp_msg_cell_modem_status_t &lhs, + const sbp_msg_cell_modem_status_t &rhs) { return sbp_msg_cell_modem_status_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_cell_modem_status_t &lhs, const sbp_msg_cell_modem_status_t &rhs) { +static inline bool operator>=(const sbp_msg_cell_modem_status_t &lhs, + const sbp_msg_cell_modem_status_t &rhs) { return sbp_msg_cell_modem_status_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_CELL_MODEM_STATUS_H */ - diff --git a/c/include/libsbp/piksi/MSG_COMMAND_OUTPUT.h b/c/include/libsbp/piksi/MSG_COMMAND_OUTPUT.h index 423acc72c..cf7c9808f 100644 --- a/c/include/libsbp/piksi/MSG_COMMAND_OUTPUT.h +++ b/c/include/libsbp/piksi/MSG_COMMAND_OUTPUT.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_COMMAND_OUTPUT_H #define LIBSBP_PIKSI_MSG_COMMAND_OUTPUT_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,191 +40,214 @@ *****************************************************************************/ /** Command output * -* Returns the standard output and standard error of the command requested by MSG_COMMAND_REQ. The sequence number can be used to filter for filtering the correct command. + * Returns the standard output and standard error of the command requested by + * MSG_COMMAND_REQ. The sequence number can be used to filter for filtering the + * correct command. */ typedef struct { - - /** -* Sequence number + * Sequence number */ u32 sequence; - /** -* Line of standard output or standard error + * Line of standard output or standard error */ sbp_string_t line; } sbp_msg_command_output_t; +/** + * Initialise sbp_msg_command_output_t::line to empty + * + * @param msg sbp_msg_command_output_t instance + */ +SBP_EXPORT void sbp_msg_command_output_line_init(sbp_msg_command_output_t *msg); - /** - * Initialise sbp_msg_command_output_t::line to empty - * - * @param msg sbp_msg_command_output_t instance - */ - SBP_EXPORT void sbp_msg_command_output_line_init(sbp_msg_command_output_t *msg); - - /** - * Test sbp_msg_command_output_t::line for validity - * - * @param msg sbp_msg_command_output_t instance - * @return true is sbp_msg_command_output_t::line is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_command_output_line_valid(const sbp_msg_command_output_t *msg); +/** + * Test sbp_msg_command_output_t::line for validity + * + * @param msg sbp_msg_command_output_t instance + * @return true is sbp_msg_command_output_t::line is valid for encoding + * purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_command_output_line_valid( + const sbp_msg_command_output_t *msg); - /** - * Tests 2 instances of sbp_msg_command_output_t::line for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_command_output_t instance - * @param b sbp_msg_command_output_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_command_output_line_strcmp(const sbp_msg_command_output_t *a, const sbp_msg_command_output_t *b); +/** + * Tests 2 instances of sbp_msg_command_output_t::line for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_command_output_t instance + * @param b sbp_msg_command_output_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_command_output_line_strcmp( + const sbp_msg_command_output_t *a, const sbp_msg_command_output_t *b); - /** - * Get the encoded size of sbp_msg_command_output_t::line - * - * @param msg sbp_msg_command_output_t instance - * @return Size of sbp_msg_command_output_t::line in wire representation - */ - SBP_EXPORT size_t sbp_msg_command_output_line_encoded_len(const sbp_msg_command_output_t *msg); +/** + * Get the encoded size of sbp_msg_command_output_t::line + * + * @param msg sbp_msg_command_output_t instance + * @return Size of sbp_msg_command_output_t::line in wire representation + */ +SBP_EXPORT size_t +sbp_msg_command_output_line_encoded_len(const sbp_msg_command_output_t *msg); - /** - * Query sbp_msg_command_output_t::line for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_command_output_t::line before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_command_output_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_command_output_line_space_remaining(const sbp_msg_command_output_t *msg); - /** - * Set sbp_msg_command_output_t::line - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_command_output_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_command_output_line_set(sbp_msg_command_output_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_command_output_t::line for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_command_output_t::line before it exceeds the maximum size of + * the field in wire representation + * + * @param msg sbp_msg_command_output_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_command_output_line_space_remaining( + const sbp_msg_command_output_t *msg); +/** + * Set sbp_msg_command_output_t::line + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_command_output_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_command_output_line_set(sbp_msg_command_output_t *msg, + const char *new_str, + bool should_trunc, + size_t *n_written); - /** - * Set sbp_msg_command_output_t::line from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_command_output_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_command_output_line_set_raw(sbp_msg_command_output_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_command_output_t::line from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_command_output_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_command_output_line_set_raw( + sbp_msg_command_output_t *msg, const char *new_buf, size_t new_buf_len, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_command_output_t::line with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_command_output_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_command_output_line_printf(sbp_msg_command_output_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_command_output_t::line with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_command_output_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_command_output_line_printf( + sbp_msg_command_output_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_command_output_t::line with printf style formatting - * - * Identical to #sbp_msg_command_output_line_printf except it takes a va_list argument - * - * @param msg sbp_msg_command_output_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_command_output_line_vprintf(sbp_msg_command_output_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_command_output_t::line with printf style formatting + * + * Identical to #sbp_msg_command_output_line_printf except it takes a va_list + * argument + * + * @param msg sbp_msg_command_output_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_command_output_line_vprintf( + sbp_msg_command_output_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_command_output_t::line with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_command_output_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_command_output_line_append_printf(sbp_msg_command_output_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_command_output_t::line with printf style formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_command_output_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_command_output_line_append_printf( + sbp_msg_command_output_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_command_output_t::line with printf style formatting - * - * Identical to #sbp_msg_command_output_line_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_command_output_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_command_output_line_append_vprintf(sbp_msg_command_output_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_command_output_t::line with printf style formatting + * + * Identical to #sbp_msg_command_output_line_append_printf except it takes a + * va_list argument + * + * @param msg sbp_msg_command_output_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_command_output_line_append_vprintf( + sbp_msg_command_output_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_command_output_t::line - * - * @param msg sbp_msg_command_output_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_command_output_line_get(const sbp_msg_command_output_t *msg); +/** + * Obtain the string value from sbp_msg_command_output_t::line + * + * @param msg sbp_msg_command_output_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_command_output_line_get( + const sbp_msg_command_output_t *msg); - /** - * Obtain the length of sbp_msg_command_output_t::line - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_command_output_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_command_output_line_strlen(const sbp_msg_command_output_t *msg); +/** + * Obtain the length of sbp_msg_command_output_t::line + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_command_output_t instance + * @return Length of string + */ +SBP_EXPORT size_t +sbp_msg_command_output_line_strlen(const sbp_msg_command_output_t *msg); /** * Get encoded size of an instance of sbp_msg_command_output_t @@ -232,46 +255,62 @@ typedef struct { * @param msg sbp_msg_command_output_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_command_output_encoded_len(const sbp_msg_command_output_t *msg) -{ - return SBP_MSG_COMMAND_OUTPUT_ENCODED_OVERHEAD - + sbp_msg_command_output_line_encoded_len(msg) - ; +static inline size_t sbp_msg_command_output_encoded_len( + const sbp_msg_command_output_t *msg) { + return SBP_MSG_COMMAND_OUTPUT_ENCODED_OVERHEAD + + sbp_msg_command_output_line_encoded_len(msg); } /** * Encode an instance of sbp_msg_command_output_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_command_output_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_command_output_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_command_output_t *msg); +SBP_EXPORT s8 +sbp_msg_command_output_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_command_output_t *msg); /** * Decode an instance of sbp_msg_command_output_t from wire representation * - * This function decodes the wire representation of a sbp_msg_command_output_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_command_output_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_command_output_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_command_output_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_command_output_t *msg); +SBP_EXPORT s8 sbp_msg_command_output_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_command_output_t *msg); /** * Send an instance of sbp_msg_command_output_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_command_output_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_command_output_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -279,51 +318,61 @@ SBP_EXPORT s8 sbp_msg_command_output_decode(const uint8_t *buf, uint8_t len, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_command_output_send(sbp_state_t *s, u16 sender_id, const sbp_msg_command_output_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_command_output_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_command_output_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_command_output_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_command_output_t instance * @param b sbp_msg_command_output_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_command_output_cmp(const sbp_msg_command_output_t *a, const sbp_msg_command_output_t *b); +SBP_EXPORT int sbp_msg_command_output_cmp(const sbp_msg_command_output_t *a, + const sbp_msg_command_output_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_command_output_t &lhs, const sbp_msg_command_output_t &rhs) { +static inline bool operator==(const sbp_msg_command_output_t &lhs, + const sbp_msg_command_output_t &rhs) { return sbp_msg_command_output_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_command_output_t &lhs, const sbp_msg_command_output_t &rhs) { +static inline bool operator!=(const sbp_msg_command_output_t &lhs, + const sbp_msg_command_output_t &rhs) { return sbp_msg_command_output_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_command_output_t &lhs, const sbp_msg_command_output_t &rhs) { +static inline bool operator<(const sbp_msg_command_output_t &lhs, + const sbp_msg_command_output_t &rhs) { return sbp_msg_command_output_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_command_output_t &lhs, const sbp_msg_command_output_t &rhs) { +static inline bool operator<=(const sbp_msg_command_output_t &lhs, + const sbp_msg_command_output_t &rhs) { return sbp_msg_command_output_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_command_output_t &lhs, const sbp_msg_command_output_t &rhs) { +static inline bool operator>(const sbp_msg_command_output_t &lhs, + const sbp_msg_command_output_t &rhs) { return sbp_msg_command_output_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_command_output_t &lhs, const sbp_msg_command_output_t &rhs) { +static inline bool operator>=(const sbp_msg_command_output_t &lhs, + const sbp_msg_command_output_t &rhs) { return sbp_msg_command_output_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_COMMAND_OUTPUT_H */ - diff --git a/c/include/libsbp/piksi/MSG_COMMAND_REQ.h b/c/include/libsbp/piksi/MSG_COMMAND_REQ.h index 59998de9b..6521dabd0 100644 --- a/c/include/libsbp/piksi/MSG_COMMAND_REQ.h +++ b/c/include/libsbp/piksi/MSG_COMMAND_REQ.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_COMMAND_REQ_H #define LIBSBP_PIKSI_MSG_COMMAND_REQ_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,191 +40,219 @@ *****************************************************************************/ /** Execute a command (host => device) * -* Request the recipient to execute an command. Output will be sent in MSG_LOG messages, and the exit code will be returned with MSG_COMMAND_RESP. + * Request the recipient to execute an command. Output will be sent in MSG_LOG + * messages, and the exit code will be returned with MSG_COMMAND_RESP. */ typedef struct { - - /** -* Sequence number + * Sequence number */ u32 sequence; - /** -* Command line to execute + * Command line to execute */ sbp_string_t command; } sbp_msg_command_req_t; +/** + * Initialise sbp_msg_command_req_t::command to empty + * + * @param msg sbp_msg_command_req_t instance + */ +SBP_EXPORT void sbp_msg_command_req_command_init(sbp_msg_command_req_t *msg); - /** - * Initialise sbp_msg_command_req_t::command to empty - * - * @param msg sbp_msg_command_req_t instance - */ - SBP_EXPORT void sbp_msg_command_req_command_init(sbp_msg_command_req_t *msg); - - /** - * Test sbp_msg_command_req_t::command for validity - * - * @param msg sbp_msg_command_req_t instance - * @return true is sbp_msg_command_req_t::command is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_command_req_command_valid(const sbp_msg_command_req_t *msg); +/** + * Test sbp_msg_command_req_t::command for validity + * + * @param msg sbp_msg_command_req_t instance + * @return true is sbp_msg_command_req_t::command is valid for encoding + * purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_command_req_command_valid( + const sbp_msg_command_req_t *msg); - /** - * Tests 2 instances of sbp_msg_command_req_t::command for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_command_req_t instance - * @param b sbp_msg_command_req_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_command_req_command_strcmp(const sbp_msg_command_req_t *a, const sbp_msg_command_req_t *b); +/** + * Tests 2 instances of sbp_msg_command_req_t::command for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_command_req_t instance + * @param b sbp_msg_command_req_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_command_req_command_strcmp( + const sbp_msg_command_req_t *a, const sbp_msg_command_req_t *b); - /** - * Get the encoded size of sbp_msg_command_req_t::command - * - * @param msg sbp_msg_command_req_t instance - * @return Size of sbp_msg_command_req_t::command in wire representation - */ - SBP_EXPORT size_t sbp_msg_command_req_command_encoded_len(const sbp_msg_command_req_t *msg); +/** + * Get the encoded size of sbp_msg_command_req_t::command + * + * @param msg sbp_msg_command_req_t instance + * @return Size of sbp_msg_command_req_t::command in wire representation + */ +SBP_EXPORT size_t +sbp_msg_command_req_command_encoded_len(const sbp_msg_command_req_t *msg); - /** - * Query sbp_msg_command_req_t::command for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_command_req_t::command before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_command_req_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_command_req_command_space_remaining(const sbp_msg_command_req_t *msg); - /** - * Set sbp_msg_command_req_t::command - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_command_req_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_command_req_command_set(sbp_msg_command_req_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_command_req_t::command for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_command_req_t::command before it exceeds the maximum size of + * the field in wire representation + * + * @param msg sbp_msg_command_req_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t +sbp_msg_command_req_command_space_remaining(const sbp_msg_command_req_t *msg); +/** + * Set sbp_msg_command_req_t::command + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_command_req_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_command_req_command_set(sbp_msg_command_req_t *msg, + const char *new_str, + bool should_trunc, + size_t *n_written); - /** - * Set sbp_msg_command_req_t::command from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_command_req_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_command_req_command_set_raw(sbp_msg_command_req_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_command_req_t::command from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_command_req_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_command_req_command_set_raw(sbp_msg_command_req_t *msg, + const char *new_buf, + size_t new_buf_len, + bool should_trunc, + size_t *n_written); - /** - * Set sbp_msg_command_req_t::command with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_command_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_command_req_command_printf(sbp_msg_command_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_command_req_t::command with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_command_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_command_req_command_printf(sbp_msg_command_req_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, ...) + SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_command_req_t::command with printf style formatting - * - * Identical to #sbp_msg_command_req_command_printf except it takes a va_list argument - * - * @param msg sbp_msg_command_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_command_req_command_vprintf(sbp_msg_command_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_command_req_t::command with printf style formatting + * + * Identical to #sbp_msg_command_req_command_printf except it takes a va_list + * argument + * + * @param msg sbp_msg_command_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_command_req_command_vprintf(sbp_msg_command_req_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_command_req_t::command with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_command_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_command_req_command_append_printf(sbp_msg_command_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_command_req_t::command with printf style formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_command_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_command_req_command_append_printf( + sbp_msg_command_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_command_req_t::command with printf style formatting - * - * Identical to #sbp_msg_command_req_command_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_command_req_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_command_req_command_append_vprintf(sbp_msg_command_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_command_req_t::command with printf style formatting + * + * Identical to #sbp_msg_command_req_command_append_printf except it takes a + * va_list argument + * + * @param msg sbp_msg_command_req_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_command_req_command_append_vprintf( + sbp_msg_command_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_command_req_t::command - * - * @param msg sbp_msg_command_req_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_command_req_command_get(const sbp_msg_command_req_t *msg); +/** + * Obtain the string value from sbp_msg_command_req_t::command + * + * @param msg sbp_msg_command_req_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_command_req_command_get( + const sbp_msg_command_req_t *msg); - /** - * Obtain the length of sbp_msg_command_req_t::command - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_command_req_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_command_req_command_strlen(const sbp_msg_command_req_t *msg); +/** + * Obtain the length of sbp_msg_command_req_t::command + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_command_req_t instance + * @return Length of string + */ +SBP_EXPORT size_t +sbp_msg_command_req_command_strlen(const sbp_msg_command_req_t *msg); /** * Get encoded size of an instance of sbp_msg_command_req_t @@ -232,46 +260,62 @@ typedef struct { * @param msg sbp_msg_command_req_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_command_req_encoded_len(const sbp_msg_command_req_t *msg) -{ - return SBP_MSG_COMMAND_REQ_ENCODED_OVERHEAD - + sbp_msg_command_req_command_encoded_len(msg) - ; +static inline size_t sbp_msg_command_req_encoded_len( + const sbp_msg_command_req_t *msg) { + return SBP_MSG_COMMAND_REQ_ENCODED_OVERHEAD + + sbp_msg_command_req_command_encoded_len(msg); } /** * Encode an instance of sbp_msg_command_req_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_command_req_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_command_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_command_req_t *msg); +SBP_EXPORT s8 sbp_msg_command_req_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_command_req_t *msg); /** * Decode an instance of sbp_msg_command_req_t from wire representation * - * This function decodes the wire representation of a sbp_msg_command_req_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_command_req_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_command_req_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_command_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_command_req_t *msg); +SBP_EXPORT s8 sbp_msg_command_req_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_command_req_t *msg); /** * Send an instance of sbp_msg_command_req_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_command_req_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_command_req_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -279,51 +323,61 @@ SBP_EXPORT s8 sbp_msg_command_req_decode(const uint8_t *buf, uint8_t len, uint8_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_command_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_command_req_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_command_req_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_command_req_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_command_req_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_command_req_t instance * @param b sbp_msg_command_req_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_command_req_cmp(const sbp_msg_command_req_t *a, const sbp_msg_command_req_t *b); +SBP_EXPORT int sbp_msg_command_req_cmp(const sbp_msg_command_req_t *a, + const sbp_msg_command_req_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_command_req_t &lhs, const sbp_msg_command_req_t &rhs) { +static inline bool operator==(const sbp_msg_command_req_t &lhs, + const sbp_msg_command_req_t &rhs) { return sbp_msg_command_req_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_command_req_t &lhs, const sbp_msg_command_req_t &rhs) { +static inline bool operator!=(const sbp_msg_command_req_t &lhs, + const sbp_msg_command_req_t &rhs) { return sbp_msg_command_req_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_command_req_t &lhs, const sbp_msg_command_req_t &rhs) { +static inline bool operator<(const sbp_msg_command_req_t &lhs, + const sbp_msg_command_req_t &rhs) { return sbp_msg_command_req_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_command_req_t &lhs, const sbp_msg_command_req_t &rhs) { +static inline bool operator<=(const sbp_msg_command_req_t &lhs, + const sbp_msg_command_req_t &rhs) { return sbp_msg_command_req_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_command_req_t &lhs, const sbp_msg_command_req_t &rhs) { +static inline bool operator>(const sbp_msg_command_req_t &lhs, + const sbp_msg_command_req_t &rhs) { return sbp_msg_command_req_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_command_req_t &lhs, const sbp_msg_command_req_t &rhs) { +static inline bool operator>=(const sbp_msg_command_req_t &lhs, + const sbp_msg_command_req_t &rhs) { return sbp_msg_command_req_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_COMMAND_REQ_H */ - diff --git a/c/include/libsbp/piksi/MSG_COMMAND_RESP.h b/c/include/libsbp/piksi/MSG_COMMAND_RESP.h index b74094afc..775a7f546 100644 --- a/c/include/libsbp/piksi/MSG_COMMAND_RESP.h +++ b/c/include/libsbp/piksi/MSG_COMMAND_RESP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_COMMAND_RESP_H #define LIBSBP_PIKSI_MSG_COMMAND_RESP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,33 +40,29 @@ *****************************************************************************/ /** Exit code from executed command (device => host) * -* The response to MSG_COMMAND_REQ with the return code of the command. A return code of zero indicates success. + * The response to MSG_COMMAND_REQ with the return code of the command. A + * return code of zero indicates success. */ typedef struct { - - /** -* Sequence number + * Sequence number */ u32 sequence; - /** -* Exit code + * Exit code */ s32 code; } sbp_msg_command_resp_t; - - /** * Get encoded size of an instance of sbp_msg_command_resp_t * * @param msg sbp_msg_command_resp_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_command_resp_encoded_len(const sbp_msg_command_resp_t *msg) -{ +static inline size_t sbp_msg_command_resp_encoded_len( + const sbp_msg_command_resp_t *msg) { (void)msg; return SBP_MSG_COMMAND_RESP_ENCODED_LEN; } @@ -74,36 +70,53 @@ static inline size_t sbp_msg_command_resp_encoded_len(const sbp_msg_command_resp /** * Encode an instance of sbp_msg_command_resp_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_command_resp_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_command_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_command_resp_t *msg); +SBP_EXPORT s8 sbp_msg_command_resp_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_command_resp_t *msg); /** * Decode an instance of sbp_msg_command_resp_t from wire representation * - * This function decodes the wire representation of a sbp_msg_command_resp_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_command_resp_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_command_resp_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_command_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_command_resp_t *msg); +SBP_EXPORT s8 sbp_msg_command_resp_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_command_resp_t *msg); /** * Send an instance of sbp_msg_command_resp_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_command_resp_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_command_resp_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -111,51 +124,61 @@ SBP_EXPORT s8 sbp_msg_command_resp_decode(const uint8_t *buf, uint8_t len, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_command_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_command_resp_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_command_resp_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_command_resp_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_command_resp_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_command_resp_t instance * @param b sbp_msg_command_resp_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_command_resp_cmp(const sbp_msg_command_resp_t *a, const sbp_msg_command_resp_t *b); +SBP_EXPORT int sbp_msg_command_resp_cmp(const sbp_msg_command_resp_t *a, + const sbp_msg_command_resp_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_command_resp_t &lhs, const sbp_msg_command_resp_t &rhs) { +static inline bool operator==(const sbp_msg_command_resp_t &lhs, + const sbp_msg_command_resp_t &rhs) { return sbp_msg_command_resp_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_command_resp_t &lhs, const sbp_msg_command_resp_t &rhs) { +static inline bool operator!=(const sbp_msg_command_resp_t &lhs, + const sbp_msg_command_resp_t &rhs) { return sbp_msg_command_resp_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_command_resp_t &lhs, const sbp_msg_command_resp_t &rhs) { +static inline bool operator<(const sbp_msg_command_resp_t &lhs, + const sbp_msg_command_resp_t &rhs) { return sbp_msg_command_resp_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_command_resp_t &lhs, const sbp_msg_command_resp_t &rhs) { +static inline bool operator<=(const sbp_msg_command_resp_t &lhs, + const sbp_msg_command_resp_t &rhs) { return sbp_msg_command_resp_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_command_resp_t &lhs, const sbp_msg_command_resp_t &rhs) { +static inline bool operator>(const sbp_msg_command_resp_t &lhs, + const sbp_msg_command_resp_t &rhs) { return sbp_msg_command_resp_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_command_resp_t &lhs, const sbp_msg_command_resp_t &rhs) { +static inline bool operator>=(const sbp_msg_command_resp_t &lhs, + const sbp_msg_command_resp_t &rhs) { return sbp_msg_command_resp_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_COMMAND_RESP_H */ - diff --git a/c/include/libsbp/piksi/MSG_CW_RESULTS.h b/c/include/libsbp/piksi/MSG_CW_RESULTS.h index 0a0ee0713..4a23d4cf5 100644 --- a/c/include/libsbp/piksi/MSG_CW_RESULTS.h +++ b/c/include/libsbp/piksi/MSG_CW_RESULTS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_CW_RESULTS_H #define LIBSBP_PIKSI_MSG_CW_RESULTS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,25 +40,26 @@ *****************************************************************************/ /** Legacy message for CW interference channel (Piksi => host) * -* This is an unused legacy message for result reporting from the CW interference channel on the SwiftNAP. This message will be removed in a future release. + * This is an unused legacy message for result reporting from the CW + * interference channel on the SwiftNAP. This message will be removed in a + * future release. */ typedef struct { /** - * Do not use this field, it exists only to prevent illegal C syntax. Any value written to this field will be ignored + * Do not use this field, it exists only to prevent illegal C syntax. Any + * value written to this field will be ignored */ char DO_NOT_USE_dummy_field_to_prevent_empty_struct; } sbp_msg_cw_results_t; - - /** * Get encoded size of an instance of sbp_msg_cw_results_t * * @param msg sbp_msg_cw_results_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_cw_results_encoded_len(const sbp_msg_cw_results_t *msg) -{ +static inline size_t sbp_msg_cw_results_encoded_len( + const sbp_msg_cw_results_t *msg) { (void)msg; return SBP_MSG_CW_RESULTS_ENCODED_LEN; } @@ -66,36 +67,53 @@ static inline size_t sbp_msg_cw_results_encoded_len(const sbp_msg_cw_results_t * /** * Encode an instance of sbp_msg_cw_results_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_cw_results_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_cw_results_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_cw_results_t *msg); +SBP_EXPORT s8 sbp_msg_cw_results_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_cw_results_t *msg); /** * Decode an instance of sbp_msg_cw_results_t from wire representation * - * This function decodes the wire representation of a sbp_msg_cw_results_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_cw_results_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_cw_results_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_cw_results_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_cw_results_t *msg); +SBP_EXPORT s8 sbp_msg_cw_results_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_cw_results_t *msg); /** * Send an instance of sbp_msg_cw_results_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_cw_results_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_cw_results_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -103,51 +121,61 @@ SBP_EXPORT s8 sbp_msg_cw_results_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_cw_results_send(sbp_state_t *s, u16 sender_id, const sbp_msg_cw_results_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_cw_results_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_cw_results_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_cw_results_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_cw_results_t instance * @param b sbp_msg_cw_results_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_cw_results_cmp(const sbp_msg_cw_results_t *a, const sbp_msg_cw_results_t *b); +SBP_EXPORT int sbp_msg_cw_results_cmp(const sbp_msg_cw_results_t *a, + const sbp_msg_cw_results_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_cw_results_t &lhs, const sbp_msg_cw_results_t &rhs) { +static inline bool operator==(const sbp_msg_cw_results_t &lhs, + const sbp_msg_cw_results_t &rhs) { return sbp_msg_cw_results_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_cw_results_t &lhs, const sbp_msg_cw_results_t &rhs) { +static inline bool operator!=(const sbp_msg_cw_results_t &lhs, + const sbp_msg_cw_results_t &rhs) { return sbp_msg_cw_results_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_cw_results_t &lhs, const sbp_msg_cw_results_t &rhs) { +static inline bool operator<(const sbp_msg_cw_results_t &lhs, + const sbp_msg_cw_results_t &rhs) { return sbp_msg_cw_results_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_cw_results_t &lhs, const sbp_msg_cw_results_t &rhs) { +static inline bool operator<=(const sbp_msg_cw_results_t &lhs, + const sbp_msg_cw_results_t &rhs) { return sbp_msg_cw_results_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_cw_results_t &lhs, const sbp_msg_cw_results_t &rhs) { +static inline bool operator>(const sbp_msg_cw_results_t &lhs, + const sbp_msg_cw_results_t &rhs) { return sbp_msg_cw_results_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_cw_results_t &lhs, const sbp_msg_cw_results_t &rhs) { +static inline bool operator>=(const sbp_msg_cw_results_t &lhs, + const sbp_msg_cw_results_t &rhs) { return sbp_msg_cw_results_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_CW_RESULTS_H */ - diff --git a/c/include/libsbp/piksi/MSG_CW_START.h b/c/include/libsbp/piksi/MSG_CW_START.h index a37d967aa..d31901e24 100644 --- a/c/include/libsbp/piksi/MSG_CW_START.h +++ b/c/include/libsbp/piksi/MSG_CW_START.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_CW_START_H #define LIBSBP_PIKSI_MSG_CW_START_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,25 +40,26 @@ *****************************************************************************/ /** Legacy message for CW interference channel (host => Piksi) * -* This is an unused legacy message from the host for starting the CW interference channel on the SwiftNAP. This message will be removed in a future release. + * This is an unused legacy message from the host for starting the CW + * interference channel on the SwiftNAP. This message will be removed in a + * future release. */ typedef struct { /** - * Do not use this field, it exists only to prevent illegal C syntax. Any value written to this field will be ignored + * Do not use this field, it exists only to prevent illegal C syntax. Any + * value written to this field will be ignored */ char DO_NOT_USE_dummy_field_to_prevent_empty_struct; } sbp_msg_cw_start_t; - - /** * Get encoded size of an instance of sbp_msg_cw_start_t * * @param msg sbp_msg_cw_start_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_cw_start_encoded_len(const sbp_msg_cw_start_t *msg) -{ +static inline size_t sbp_msg_cw_start_encoded_len( + const sbp_msg_cw_start_t *msg) { (void)msg; return SBP_MSG_CW_START_ENCODED_LEN; } @@ -66,36 +67,52 @@ static inline size_t sbp_msg_cw_start_encoded_len(const sbp_msg_cw_start_t *msg) /** * Encode an instance of sbp_msg_cw_start_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_cw_start_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_cw_start_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_cw_start_t *msg); +SBP_EXPORT s8 sbp_msg_cw_start_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_cw_start_t *msg); /** * Decode an instance of sbp_msg_cw_start_t from wire representation * - * This function decodes the wire representation of a sbp_msg_cw_start_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_cw_start_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_cw_start_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_cw_start_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_cw_start_t *msg); +SBP_EXPORT s8 sbp_msg_cw_start_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_cw_start_t *msg); /** * Send an instance of sbp_msg_cw_start_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_cw_start_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_cw_start_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -103,51 +120,61 @@ SBP_EXPORT s8 sbp_msg_cw_start_decode(const uint8_t *buf, uint8_t len, uint8_t * * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_cw_start_send(sbp_state_t *s, u16 sender_id, const sbp_msg_cw_start_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_cw_start_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_cw_start_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_cw_start_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_cw_start_t instance * @param b sbp_msg_cw_start_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_cw_start_cmp(const sbp_msg_cw_start_t *a, const sbp_msg_cw_start_t *b); +SBP_EXPORT int sbp_msg_cw_start_cmp(const sbp_msg_cw_start_t *a, + const sbp_msg_cw_start_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_cw_start_t &lhs, const sbp_msg_cw_start_t &rhs) { +static inline bool operator==(const sbp_msg_cw_start_t &lhs, + const sbp_msg_cw_start_t &rhs) { return sbp_msg_cw_start_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_cw_start_t &lhs, const sbp_msg_cw_start_t &rhs) { +static inline bool operator!=(const sbp_msg_cw_start_t &lhs, + const sbp_msg_cw_start_t &rhs) { return sbp_msg_cw_start_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_cw_start_t &lhs, const sbp_msg_cw_start_t &rhs) { +static inline bool operator<(const sbp_msg_cw_start_t &lhs, + const sbp_msg_cw_start_t &rhs) { return sbp_msg_cw_start_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_cw_start_t &lhs, const sbp_msg_cw_start_t &rhs) { +static inline bool operator<=(const sbp_msg_cw_start_t &lhs, + const sbp_msg_cw_start_t &rhs) { return sbp_msg_cw_start_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_cw_start_t &lhs, const sbp_msg_cw_start_t &rhs) { +static inline bool operator>(const sbp_msg_cw_start_t &lhs, + const sbp_msg_cw_start_t &rhs) { return sbp_msg_cw_start_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_cw_start_t &lhs, const sbp_msg_cw_start_t &rhs) { +static inline bool operator>=(const sbp_msg_cw_start_t &lhs, + const sbp_msg_cw_start_t &rhs) { return sbp_msg_cw_start_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_CW_START_H */ - diff --git a/c/include/libsbp/piksi/MSG_DEVICE_MONITOR.h b/c/include/libsbp/piksi/MSG_DEVICE_MONITOR.h index f45d0128a..943145382 100644 --- a/c/include/libsbp/piksi/MSG_DEVICE_MONITOR.h +++ b/c/include/libsbp/piksi/MSG_DEVICE_MONITOR.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_DEVICE_MONITOR_H #define LIBSBP_PIKSI_MSG_DEVICE_MONITOR_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,51 +40,45 @@ *****************************************************************************/ /** Device temperature and voltage levels * -* This message contains temperature and voltage level measurements from the processor's monitoring system and the RF frontend die temperature if available. + * This message contains temperature and voltage level measurements from the + * processor's monitoring system and the RF frontend die temperature if + * available. */ typedef struct { - - /** -* Device V_in [V / 1000] + * Device V_in [V / 1000] */ s16 dev_vin; - /** -* Processor V_int [V / 1000] + * Processor V_int [V / 1000] */ s16 cpu_vint; - /** -* Processor V_aux [V / 1000] + * Processor V_aux [V / 1000] */ s16 cpu_vaux; - /** -* Processor temperature [degrees C / 100] + * Processor temperature [degrees C / 100] */ s16 cpu_temperature; - /** -* Frontend temperature (if available) [degrees C / 100] + * Frontend temperature (if available) [degrees C / 100] */ s16 fe_temperature; } sbp_msg_device_monitor_t; - - /** * Get encoded size of an instance of sbp_msg_device_monitor_t * * @param msg sbp_msg_device_monitor_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_device_monitor_encoded_len(const sbp_msg_device_monitor_t *msg) -{ +static inline size_t sbp_msg_device_monitor_encoded_len( + const sbp_msg_device_monitor_t *msg) { (void)msg; return SBP_MSG_DEVICE_MONITOR_ENCODED_LEN; } @@ -92,36 +86,53 @@ static inline size_t sbp_msg_device_monitor_encoded_len(const sbp_msg_device_mon /** * Encode an instance of sbp_msg_device_monitor_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_device_monitor_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_device_monitor_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_device_monitor_t *msg); +SBP_EXPORT s8 +sbp_msg_device_monitor_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_device_monitor_t *msg); /** * Decode an instance of sbp_msg_device_monitor_t from wire representation * - * This function decodes the wire representation of a sbp_msg_device_monitor_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_device_monitor_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_device_monitor_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_device_monitor_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_device_monitor_t *msg); +SBP_EXPORT s8 sbp_msg_device_monitor_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_device_monitor_t *msg); /** * Send an instance of sbp_msg_device_monitor_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_device_monitor_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_device_monitor_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -129,51 +140,61 @@ SBP_EXPORT s8 sbp_msg_device_monitor_decode(const uint8_t *buf, uint8_t len, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_device_monitor_send(sbp_state_t *s, u16 sender_id, const sbp_msg_device_monitor_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_device_monitor_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_device_monitor_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_device_monitor_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_device_monitor_t instance * @param b sbp_msg_device_monitor_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_device_monitor_cmp(const sbp_msg_device_monitor_t *a, const sbp_msg_device_monitor_t *b); +SBP_EXPORT int sbp_msg_device_monitor_cmp(const sbp_msg_device_monitor_t *a, + const sbp_msg_device_monitor_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_device_monitor_t &lhs, const sbp_msg_device_monitor_t &rhs) { +static inline bool operator==(const sbp_msg_device_monitor_t &lhs, + const sbp_msg_device_monitor_t &rhs) { return sbp_msg_device_monitor_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_device_monitor_t &lhs, const sbp_msg_device_monitor_t &rhs) { +static inline bool operator!=(const sbp_msg_device_monitor_t &lhs, + const sbp_msg_device_monitor_t &rhs) { return sbp_msg_device_monitor_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_device_monitor_t &lhs, const sbp_msg_device_monitor_t &rhs) { +static inline bool operator<(const sbp_msg_device_monitor_t &lhs, + const sbp_msg_device_monitor_t &rhs) { return sbp_msg_device_monitor_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_device_monitor_t &lhs, const sbp_msg_device_monitor_t &rhs) { +static inline bool operator<=(const sbp_msg_device_monitor_t &lhs, + const sbp_msg_device_monitor_t &rhs) { return sbp_msg_device_monitor_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_device_monitor_t &lhs, const sbp_msg_device_monitor_t &rhs) { +static inline bool operator>(const sbp_msg_device_monitor_t &lhs, + const sbp_msg_device_monitor_t &rhs) { return sbp_msg_device_monitor_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_device_monitor_t &lhs, const sbp_msg_device_monitor_t &rhs) { +static inline bool operator>=(const sbp_msg_device_monitor_t &lhs, + const sbp_msg_device_monitor_t &rhs) { return sbp_msg_device_monitor_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_DEVICE_MONITOR_H */ - diff --git a/c/include/libsbp/piksi/MSG_FRONT_END_GAIN.h b/c/include/libsbp/piksi/MSG_FRONT_END_GAIN.h index 07e802603..9c8c86e15 100644 --- a/c/include/libsbp/piksi/MSG_FRONT_END_GAIN.h +++ b/c/include/libsbp/piksi/MSG_FRONT_END_GAIN.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_FRONT_END_GAIN_H #define LIBSBP_PIKSI_MSG_FRONT_END_GAIN_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,33 +40,34 @@ *****************************************************************************/ /** RF AGC status * -* This message describes the gain of each channel in the receiver frontend. Each gain is encoded as a non-dimensional percentage relative to the maximum range possible for the gain stage of the frontend. By convention, each gain array has 8 entries and the index of the array corresponding to the index of the rf channel in the frontend. A gain of 127 percent encodes that rf channel is not present in the hardware. A negative value implies an error for the particular gain stage as reported by the frontend. + * This message describes the gain of each channel in the receiver frontend. + * Each gain is encoded as a non-dimensional percentage relative to the maximum + * range possible for the gain stage of the frontend. By convention, each gain + * array has 8 entries and the index of the array corresponding to the index of + * the rf channel in the frontend. A gain of 127 percent encodes that rf channel + * is not present in the hardware. A negative value implies an error for the + * particular gain stage as reported by the frontend. */ typedef struct { - - /** -* RF gain for each frontend channel [percent] + * RF gain for each frontend channel [percent] */ s8 rf_gain[SBP_MSG_FRONT_END_GAIN_RF_GAIN_MAX]; - /** -* Intermediate frequency gain for each frontend channel [percent] + * Intermediate frequency gain for each frontend channel [percent] */ s8 if_gain[SBP_MSG_FRONT_END_GAIN_IF_GAIN_MAX]; } sbp_msg_front_end_gain_t; - - /** * Get encoded size of an instance of sbp_msg_front_end_gain_t * * @param msg sbp_msg_front_end_gain_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_front_end_gain_encoded_len(const sbp_msg_front_end_gain_t *msg) -{ +static inline size_t sbp_msg_front_end_gain_encoded_len( + const sbp_msg_front_end_gain_t *msg) { (void)msg; return SBP_MSG_FRONT_END_GAIN_ENCODED_LEN; } @@ -74,36 +75,53 @@ static inline size_t sbp_msg_front_end_gain_encoded_len(const sbp_msg_front_end_ /** * Encode an instance of sbp_msg_front_end_gain_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_front_end_gain_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_front_end_gain_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_front_end_gain_t *msg); +SBP_EXPORT s8 +sbp_msg_front_end_gain_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_front_end_gain_t *msg); /** * Decode an instance of sbp_msg_front_end_gain_t from wire representation * - * This function decodes the wire representation of a sbp_msg_front_end_gain_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_front_end_gain_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_front_end_gain_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_front_end_gain_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_front_end_gain_t *msg); +SBP_EXPORT s8 sbp_msg_front_end_gain_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_front_end_gain_t *msg); /** * Send an instance of sbp_msg_front_end_gain_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_front_end_gain_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_front_end_gain_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -111,51 +129,61 @@ SBP_EXPORT s8 sbp_msg_front_end_gain_decode(const uint8_t *buf, uint8_t len, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_front_end_gain_send(sbp_state_t *s, u16 sender_id, const sbp_msg_front_end_gain_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_front_end_gain_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_front_end_gain_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_front_end_gain_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_front_end_gain_t instance * @param b sbp_msg_front_end_gain_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_front_end_gain_cmp(const sbp_msg_front_end_gain_t *a, const sbp_msg_front_end_gain_t *b); +SBP_EXPORT int sbp_msg_front_end_gain_cmp(const sbp_msg_front_end_gain_t *a, + const sbp_msg_front_end_gain_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_front_end_gain_t &lhs, const sbp_msg_front_end_gain_t &rhs) { +static inline bool operator==(const sbp_msg_front_end_gain_t &lhs, + const sbp_msg_front_end_gain_t &rhs) { return sbp_msg_front_end_gain_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_front_end_gain_t &lhs, const sbp_msg_front_end_gain_t &rhs) { +static inline bool operator!=(const sbp_msg_front_end_gain_t &lhs, + const sbp_msg_front_end_gain_t &rhs) { return sbp_msg_front_end_gain_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_front_end_gain_t &lhs, const sbp_msg_front_end_gain_t &rhs) { +static inline bool operator<(const sbp_msg_front_end_gain_t &lhs, + const sbp_msg_front_end_gain_t &rhs) { return sbp_msg_front_end_gain_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_front_end_gain_t &lhs, const sbp_msg_front_end_gain_t &rhs) { +static inline bool operator<=(const sbp_msg_front_end_gain_t &lhs, + const sbp_msg_front_end_gain_t &rhs) { return sbp_msg_front_end_gain_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_front_end_gain_t &lhs, const sbp_msg_front_end_gain_t &rhs) { +static inline bool operator>(const sbp_msg_front_end_gain_t &lhs, + const sbp_msg_front_end_gain_t &rhs) { return sbp_msg_front_end_gain_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_front_end_gain_t &lhs, const sbp_msg_front_end_gain_t &rhs) { +static inline bool operator>=(const sbp_msg_front_end_gain_t &lhs, + const sbp_msg_front_end_gain_t &rhs) { return sbp_msg_front_end_gain_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_FRONT_END_GAIN_H */ - diff --git a/c/include/libsbp/piksi/MSG_IAR_STATE.h b/c/include/libsbp/piksi/MSG_IAR_STATE.h index 0a2f4fab3..a49f229f2 100644 --- a/c/include/libsbp/piksi/MSG_IAR_STATE.h +++ b/c/include/libsbp/piksi/MSG_IAR_STATE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_IAR_STATE_H #define LIBSBP_PIKSI_MSG_IAR_STATE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,27 +40,25 @@ *****************************************************************************/ /** State of the Integer Ambiguity Resolution (IAR) process * -* This message reports the state of the Integer Ambiguity Resolution (IAR) process, which resolves unknown integer ambiguities from double-differenced carrier-phase measurements from satellite observations. + * This message reports the state of the Integer Ambiguity Resolution (IAR) + * process, which resolves unknown integer ambiguities from double-differenced + * carrier-phase measurements from satellite observations. */ typedef struct { - - /** -* Number of integer ambiguity hypotheses remaining + * Number of integer ambiguity hypotheses remaining */ u32 num_hyps; } sbp_msg_iar_state_t; - - /** * Get encoded size of an instance of sbp_msg_iar_state_t * * @param msg sbp_msg_iar_state_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_iar_state_encoded_len(const sbp_msg_iar_state_t *msg) -{ +static inline size_t sbp_msg_iar_state_encoded_len( + const sbp_msg_iar_state_t *msg) { (void)msg; return SBP_MSG_IAR_STATE_ENCODED_LEN; } @@ -68,36 +66,53 @@ static inline size_t sbp_msg_iar_state_encoded_len(const sbp_msg_iar_state_t *ms /** * Encode an instance of sbp_msg_iar_state_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_iar_state_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_iar_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_iar_state_t *msg); +SBP_EXPORT s8 sbp_msg_iar_state_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_iar_state_t *msg); /** * Decode an instance of sbp_msg_iar_state_t from wire representation * - * This function decodes the wire representation of a sbp_msg_iar_state_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_iar_state_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_iar_state_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_iar_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_iar_state_t *msg); +SBP_EXPORT s8 sbp_msg_iar_state_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_iar_state_t *msg); /** * Send an instance of sbp_msg_iar_state_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_iar_state_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_iar_state_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -105,51 +120,61 @@ SBP_EXPORT s8 sbp_msg_iar_state_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_iar_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_iar_state_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_iar_state_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_iar_state_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_iar_state_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_iar_state_t instance * @param b sbp_msg_iar_state_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_iar_state_cmp(const sbp_msg_iar_state_t *a, const sbp_msg_iar_state_t *b); +SBP_EXPORT int sbp_msg_iar_state_cmp(const sbp_msg_iar_state_t *a, + const sbp_msg_iar_state_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_iar_state_t &lhs, const sbp_msg_iar_state_t &rhs) { +static inline bool operator==(const sbp_msg_iar_state_t &lhs, + const sbp_msg_iar_state_t &rhs) { return sbp_msg_iar_state_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_iar_state_t &lhs, const sbp_msg_iar_state_t &rhs) { +static inline bool operator!=(const sbp_msg_iar_state_t &lhs, + const sbp_msg_iar_state_t &rhs) { return sbp_msg_iar_state_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_iar_state_t &lhs, const sbp_msg_iar_state_t &rhs) { +static inline bool operator<(const sbp_msg_iar_state_t &lhs, + const sbp_msg_iar_state_t &rhs) { return sbp_msg_iar_state_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_iar_state_t &lhs, const sbp_msg_iar_state_t &rhs) { +static inline bool operator<=(const sbp_msg_iar_state_t &lhs, + const sbp_msg_iar_state_t &rhs) { return sbp_msg_iar_state_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_iar_state_t &lhs, const sbp_msg_iar_state_t &rhs) { +static inline bool operator>(const sbp_msg_iar_state_t &lhs, + const sbp_msg_iar_state_t &rhs) { return sbp_msg_iar_state_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_iar_state_t &lhs, const sbp_msg_iar_state_t &rhs) { +static inline bool operator>=(const sbp_msg_iar_state_t &lhs, + const sbp_msg_iar_state_t &rhs) { return sbp_msg_iar_state_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_IAR_STATE_H */ - diff --git a/c/include/libsbp/piksi/MSG_INIT_BASE_DEP.h b/c/include/libsbp/piksi/MSG_INIT_BASE_DEP.h index 9a4f3670a..9193c129d 100644 --- a/c/include/libsbp/piksi/MSG_INIT_BASE_DEP.h +++ b/c/include/libsbp/piksi/MSG_INIT_BASE_DEP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_INIT_BASE_DEP_H #define LIBSBP_PIKSI_MSG_INIT_BASE_DEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,25 +40,24 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { /** - * Do not use this field, it exists only to prevent illegal C syntax. Any value written to this field will be ignored + * Do not use this field, it exists only to prevent illegal C syntax. Any + * value written to this field will be ignored */ char DO_NOT_USE_dummy_field_to_prevent_empty_struct; } sbp_msg_init_base_dep_t; - - /** * Get encoded size of an instance of sbp_msg_init_base_dep_t * * @param msg sbp_msg_init_base_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_init_base_dep_encoded_len(const sbp_msg_init_base_dep_t *msg) -{ +static inline size_t sbp_msg_init_base_dep_encoded_len( + const sbp_msg_init_base_dep_t *msg) { (void)msg; return SBP_MSG_INIT_BASE_DEP_ENCODED_LEN; } @@ -66,36 +65,53 @@ static inline size_t sbp_msg_init_base_dep_encoded_len(const sbp_msg_init_base_d /** * Encode an instance of sbp_msg_init_base_dep_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_init_base_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_init_base_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_init_base_dep_t *msg); +SBP_EXPORT s8 sbp_msg_init_base_dep_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_init_base_dep_t *msg); /** * Decode an instance of sbp_msg_init_base_dep_t from wire representation * - * This function decodes the wire representation of a sbp_msg_init_base_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_init_base_dep_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_init_base_dep_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_init_base_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_init_base_dep_t *msg); +SBP_EXPORT s8 sbp_msg_init_base_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_init_base_dep_t *msg); /** * Send an instance of sbp_msg_init_base_dep_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_init_base_dep_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_init_base_dep_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -103,51 +119,61 @@ SBP_EXPORT s8 sbp_msg_init_base_dep_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_init_base_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_init_base_dep_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_init_base_dep_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_init_base_dep_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_init_base_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_init_base_dep_t instance * @param b sbp_msg_init_base_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_init_base_dep_cmp(const sbp_msg_init_base_dep_t *a, const sbp_msg_init_base_dep_t *b); +SBP_EXPORT int sbp_msg_init_base_dep_cmp(const sbp_msg_init_base_dep_t *a, + const sbp_msg_init_base_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_init_base_dep_t &lhs, const sbp_msg_init_base_dep_t &rhs) { +static inline bool operator==(const sbp_msg_init_base_dep_t &lhs, + const sbp_msg_init_base_dep_t &rhs) { return sbp_msg_init_base_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_init_base_dep_t &lhs, const sbp_msg_init_base_dep_t &rhs) { +static inline bool operator!=(const sbp_msg_init_base_dep_t &lhs, + const sbp_msg_init_base_dep_t &rhs) { return sbp_msg_init_base_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_init_base_dep_t &lhs, const sbp_msg_init_base_dep_t &rhs) { +static inline bool operator<(const sbp_msg_init_base_dep_t &lhs, + const sbp_msg_init_base_dep_t &rhs) { return sbp_msg_init_base_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_init_base_dep_t &lhs, const sbp_msg_init_base_dep_t &rhs) { +static inline bool operator<=(const sbp_msg_init_base_dep_t &lhs, + const sbp_msg_init_base_dep_t &rhs) { return sbp_msg_init_base_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_init_base_dep_t &lhs, const sbp_msg_init_base_dep_t &rhs) { +static inline bool operator>(const sbp_msg_init_base_dep_t &lhs, + const sbp_msg_init_base_dep_t &rhs) { return sbp_msg_init_base_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_init_base_dep_t &lhs, const sbp_msg_init_base_dep_t &rhs) { +static inline bool operator>=(const sbp_msg_init_base_dep_t &lhs, + const sbp_msg_init_base_dep_t &rhs) { return sbp_msg_init_base_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_INIT_BASE_DEP_H */ - diff --git a/c/include/libsbp/piksi/MSG_MASK_SATELLITE.h b/c/include/libsbp/piksi/MSG_MASK_SATELLITE.h index 28b3dec95..a51e64dbe 100644 --- a/c/include/libsbp/piksi/MSG_MASK_SATELLITE.h +++ b/c/include/libsbp/piksi/MSG_MASK_SATELLITE.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_PIKSI_MSG_MASK_SATELLITE_H #define LIBSBP_PIKSI_MSG_MASK_SATELLITE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,33 +41,29 @@ *****************************************************************************/ /** Mask a satellite from use in Piksi subsystems * -* This message allows setting a mask to prevent a particular satellite from being used in various Piksi subsystems. + * This message allows setting a mask to prevent a particular satellite from + * being used in various Piksi subsystems. */ typedef struct { - - /** -* Mask of systems that should ignore this satellite. + * Mask of systems that should ignore this satellite. */ u8 mask; - /** -* GNSS signal for which the mask is applied + * GNSS signal for which the mask is applied */ sbp_v4_gnss_signal_t sid; } sbp_msg_mask_satellite_t; - - /** * Get encoded size of an instance of sbp_msg_mask_satellite_t * * @param msg sbp_msg_mask_satellite_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_mask_satellite_encoded_len(const sbp_msg_mask_satellite_t *msg) -{ +static inline size_t sbp_msg_mask_satellite_encoded_len( + const sbp_msg_mask_satellite_t *msg) { (void)msg; return SBP_MSG_MASK_SATELLITE_ENCODED_LEN; } @@ -75,36 +71,53 @@ static inline size_t sbp_msg_mask_satellite_encoded_len(const sbp_msg_mask_satel /** * Encode an instance of sbp_msg_mask_satellite_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_mask_satellite_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_mask_satellite_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_mask_satellite_t *msg); +SBP_EXPORT s8 +sbp_msg_mask_satellite_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_mask_satellite_t *msg); /** * Decode an instance of sbp_msg_mask_satellite_t from wire representation * - * This function decodes the wire representation of a sbp_msg_mask_satellite_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_mask_satellite_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_mask_satellite_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_mask_satellite_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_mask_satellite_t *msg); +SBP_EXPORT s8 sbp_msg_mask_satellite_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_mask_satellite_t *msg); /** * Send an instance of sbp_msg_mask_satellite_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_mask_satellite_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_mask_satellite_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -112,51 +125,61 @@ SBP_EXPORT s8 sbp_msg_mask_satellite_decode(const uint8_t *buf, uint8_t len, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_mask_satellite_send(sbp_state_t *s, u16 sender_id, const sbp_msg_mask_satellite_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_mask_satellite_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_mask_satellite_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_mask_satellite_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_mask_satellite_t instance * @param b sbp_msg_mask_satellite_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_mask_satellite_cmp(const sbp_msg_mask_satellite_t *a, const sbp_msg_mask_satellite_t *b); +SBP_EXPORT int sbp_msg_mask_satellite_cmp(const sbp_msg_mask_satellite_t *a, + const sbp_msg_mask_satellite_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_mask_satellite_t &lhs, const sbp_msg_mask_satellite_t &rhs) { +static inline bool operator==(const sbp_msg_mask_satellite_t &lhs, + const sbp_msg_mask_satellite_t &rhs) { return sbp_msg_mask_satellite_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_mask_satellite_t &lhs, const sbp_msg_mask_satellite_t &rhs) { +static inline bool operator!=(const sbp_msg_mask_satellite_t &lhs, + const sbp_msg_mask_satellite_t &rhs) { return sbp_msg_mask_satellite_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_mask_satellite_t &lhs, const sbp_msg_mask_satellite_t &rhs) { +static inline bool operator<(const sbp_msg_mask_satellite_t &lhs, + const sbp_msg_mask_satellite_t &rhs) { return sbp_msg_mask_satellite_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_mask_satellite_t &lhs, const sbp_msg_mask_satellite_t &rhs) { +static inline bool operator<=(const sbp_msg_mask_satellite_t &lhs, + const sbp_msg_mask_satellite_t &rhs) { return sbp_msg_mask_satellite_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_mask_satellite_t &lhs, const sbp_msg_mask_satellite_t &rhs) { +static inline bool operator>(const sbp_msg_mask_satellite_t &lhs, + const sbp_msg_mask_satellite_t &rhs) { return sbp_msg_mask_satellite_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_mask_satellite_t &lhs, const sbp_msg_mask_satellite_t &rhs) { +static inline bool operator>=(const sbp_msg_mask_satellite_t &lhs, + const sbp_msg_mask_satellite_t &rhs) { return sbp_msg_mask_satellite_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_MASK_SATELLITE_H */ - diff --git a/c/include/libsbp/piksi/MSG_MASK_SATELLITE_DEP.h b/c/include/libsbp/piksi/MSG_MASK_SATELLITE_DEP.h index 9d69e7542..6a5e466df 100644 --- a/c/include/libsbp/piksi/MSG_MASK_SATELLITE_DEP.h +++ b/c/include/libsbp/piksi/MSG_MASK_SATELLITE_DEP.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_PIKSI_MSG_MASK_SATELLITE_DEP_H #define LIBSBP_PIKSI_MSG_MASK_SATELLITE_DEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,33 +41,28 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Mask of systems that should ignore this satellite. + * Mask of systems that should ignore this satellite. */ u8 mask; - /** -* GNSS signal for which the mask is applied + * GNSS signal for which the mask is applied */ sbp_gnss_signal_dep_t sid; } sbp_msg_mask_satellite_dep_t; - - /** * Get encoded size of an instance of sbp_msg_mask_satellite_dep_t * * @param msg sbp_msg_mask_satellite_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_mask_satellite_dep_encoded_len(const sbp_msg_mask_satellite_dep_t *msg) -{ +static inline size_t sbp_msg_mask_satellite_dep_encoded_len( + const sbp_msg_mask_satellite_dep_t *msg) { (void)msg; return SBP_MSG_MASK_SATELLITE_DEP_ENCODED_LEN; } @@ -75,36 +70,54 @@ static inline size_t sbp_msg_mask_satellite_dep_encoded_len(const sbp_msg_mask_s /** * Encode an instance of sbp_msg_mask_satellite_dep_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_mask_satellite_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_mask_satellite_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_mask_satellite_dep_t *msg); +SBP_EXPORT s8 +sbp_msg_mask_satellite_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_mask_satellite_dep_t *msg); /** * Decode an instance of sbp_msg_mask_satellite_dep_t from wire representation * - * This function decodes the wire representation of a sbp_msg_mask_satellite_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_mask_satellite_dep_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_mask_satellite_dep_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_mask_satellite_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_mask_satellite_dep_t *msg); +SBP_EXPORT s8 sbp_msg_mask_satellite_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_mask_satellite_dep_t *msg); /** - * Send an instance of sbp_msg_mask_satellite_dep_t with the given write function + * Send an instance of sbp_msg_mask_satellite_dep_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_mask_satellite_dep_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_mask_satellite_dep_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -112,51 +125,62 @@ SBP_EXPORT s8 sbp_msg_mask_satellite_dep_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_mask_satellite_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_mask_satellite_dep_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_mask_satellite_dep_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_mask_satellite_dep_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_mask_satellite_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_mask_satellite_dep_t instance * @param b sbp_msg_mask_satellite_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_mask_satellite_dep_cmp(const sbp_msg_mask_satellite_dep_t *a, const sbp_msg_mask_satellite_dep_t *b); +SBP_EXPORT int sbp_msg_mask_satellite_dep_cmp( + const sbp_msg_mask_satellite_dep_t *a, + const sbp_msg_mask_satellite_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_mask_satellite_dep_t &lhs, const sbp_msg_mask_satellite_dep_t &rhs) { +static inline bool operator==(const sbp_msg_mask_satellite_dep_t &lhs, + const sbp_msg_mask_satellite_dep_t &rhs) { return sbp_msg_mask_satellite_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_mask_satellite_dep_t &lhs, const sbp_msg_mask_satellite_dep_t &rhs) { +static inline bool operator!=(const sbp_msg_mask_satellite_dep_t &lhs, + const sbp_msg_mask_satellite_dep_t &rhs) { return sbp_msg_mask_satellite_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_mask_satellite_dep_t &lhs, const sbp_msg_mask_satellite_dep_t &rhs) { +static inline bool operator<(const sbp_msg_mask_satellite_dep_t &lhs, + const sbp_msg_mask_satellite_dep_t &rhs) { return sbp_msg_mask_satellite_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_mask_satellite_dep_t &lhs, const sbp_msg_mask_satellite_dep_t &rhs) { +static inline bool operator<=(const sbp_msg_mask_satellite_dep_t &lhs, + const sbp_msg_mask_satellite_dep_t &rhs) { return sbp_msg_mask_satellite_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_mask_satellite_dep_t &lhs, const sbp_msg_mask_satellite_dep_t &rhs) { +static inline bool operator>(const sbp_msg_mask_satellite_dep_t &lhs, + const sbp_msg_mask_satellite_dep_t &rhs) { return sbp_msg_mask_satellite_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_mask_satellite_dep_t &lhs, const sbp_msg_mask_satellite_dep_t &rhs) { +static inline bool operator>=(const sbp_msg_mask_satellite_dep_t &lhs, + const sbp_msg_mask_satellite_dep_t &rhs) { return sbp_msg_mask_satellite_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_MASK_SATELLITE_DEP_H */ - diff --git a/c/include/libsbp/piksi/MSG_NETWORK_BANDWIDTH_USAGE.h b/c/include/libsbp/piksi/MSG_NETWORK_BANDWIDTH_USAGE.h index 4f3b92aaa..88a477847 100644 --- a/c/include/libsbp/piksi/MSG_NETWORK_BANDWIDTH_USAGE.h +++ b/c/include/libsbp/piksi/MSG_NETWORK_BANDWIDTH_USAGE.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_PIKSI_MSG_NETWORK_BANDWIDTH_USAGE_H #define LIBSBP_PIKSI_MSG_NETWORK_BANDWIDTH_USAGE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,73 +41,93 @@ *****************************************************************************/ /** Bandwidth usage reporting message * -* The bandwidth usage, a list of usage by interface. + * The bandwidth usage, a list of usage by interface. */ typedef struct { - - /** -* Usage measurement array + * Usage measurement array */ - sbp_network_usage_t interfaces[SBP_MSG_NETWORK_BANDWIDTH_USAGE_INTERFACES_MAX]; + sbp_network_usage_t + interfaces[SBP_MSG_NETWORK_BANDWIDTH_USAGE_INTERFACES_MAX]; /** * Number of elements in interfaces * - * When sending a message fill in this field with the number elements set in interfaces before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * interfaces before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in interfaces. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * interfaces. The value of any elements beyond the index specified in this + * field is undefined */ u8 n_interfaces; } sbp_msg_network_bandwidth_usage_t; - - /** * Get encoded size of an instance of sbp_msg_network_bandwidth_usage_t * * @param msg sbp_msg_network_bandwidth_usage_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_network_bandwidth_usage_encoded_len(const sbp_msg_network_bandwidth_usage_t *msg) -{ - return SBP_MSG_NETWORK_BANDWIDTH_USAGE_ENCODED_OVERHEAD - + (msg->n_interfaces * SBP_NETWORK_USAGE_ENCODED_LEN) - ; +static inline size_t sbp_msg_network_bandwidth_usage_encoded_len( + const sbp_msg_network_bandwidth_usage_t *msg) { + return SBP_MSG_NETWORK_BANDWIDTH_USAGE_ENCODED_OVERHEAD + + (msg->n_interfaces * SBP_NETWORK_USAGE_ENCODED_LEN); } /** - * Encode an instance of sbp_msg_network_bandwidth_usage_t to wire representation + * Encode an instance of sbp_msg_network_bandwidth_usage_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_network_bandwidth_usage_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_network_bandwidth_usage_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_network_bandwidth_usage_t *msg); +SBP_EXPORT s8 sbp_msg_network_bandwidth_usage_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_network_bandwidth_usage_t *msg); /** - * Decode an instance of sbp_msg_network_bandwidth_usage_t from wire representation + * Decode an instance of sbp_msg_network_bandwidth_usage_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_network_bandwidth_usage_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_network_bandwidth_usage_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_network_bandwidth_usage_t instance + * @param buf Wire representation of the sbp_msg_network_bandwidth_usage_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_network_bandwidth_usage_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_network_bandwidth_usage_t *msg); +SBP_EXPORT s8 sbp_msg_network_bandwidth_usage_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_network_bandwidth_usage_t *msg); /** - * Send an instance of sbp_msg_network_bandwidth_usage_t with the given write function + * Send an instance of sbp_msg_network_bandwidth_usage_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_network_bandwidth_usage_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_network_bandwidth_usage_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -115,51 +135,62 @@ SBP_EXPORT s8 sbp_msg_network_bandwidth_usage_decode(const uint8_t *buf, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_network_bandwidth_usage_send(sbp_state_t *s, u16 sender_id, const sbp_msg_network_bandwidth_usage_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_network_bandwidth_usage_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_network_bandwidth_usage_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_network_bandwidth_usage_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_network_bandwidth_usage_t instance * @param b sbp_msg_network_bandwidth_usage_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_network_bandwidth_usage_cmp(const sbp_msg_network_bandwidth_usage_t *a, const sbp_msg_network_bandwidth_usage_t *b); +SBP_EXPORT int sbp_msg_network_bandwidth_usage_cmp( + const sbp_msg_network_bandwidth_usage_t *a, + const sbp_msg_network_bandwidth_usage_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_network_bandwidth_usage_t &lhs, const sbp_msg_network_bandwidth_usage_t &rhs) { +static inline bool operator==(const sbp_msg_network_bandwidth_usage_t &lhs, + const sbp_msg_network_bandwidth_usage_t &rhs) { return sbp_msg_network_bandwidth_usage_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_network_bandwidth_usage_t &lhs, const sbp_msg_network_bandwidth_usage_t &rhs) { +static inline bool operator!=(const sbp_msg_network_bandwidth_usage_t &lhs, + const sbp_msg_network_bandwidth_usage_t &rhs) { return sbp_msg_network_bandwidth_usage_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_network_bandwidth_usage_t &lhs, const sbp_msg_network_bandwidth_usage_t &rhs) { +static inline bool operator<(const sbp_msg_network_bandwidth_usage_t &lhs, + const sbp_msg_network_bandwidth_usage_t &rhs) { return sbp_msg_network_bandwidth_usage_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_network_bandwidth_usage_t &lhs, const sbp_msg_network_bandwidth_usage_t &rhs) { +static inline bool operator<=(const sbp_msg_network_bandwidth_usage_t &lhs, + const sbp_msg_network_bandwidth_usage_t &rhs) { return sbp_msg_network_bandwidth_usage_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_network_bandwidth_usage_t &lhs, const sbp_msg_network_bandwidth_usage_t &rhs) { +static inline bool operator>(const sbp_msg_network_bandwidth_usage_t &lhs, + const sbp_msg_network_bandwidth_usage_t &rhs) { return sbp_msg_network_bandwidth_usage_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_network_bandwidth_usage_t &lhs, const sbp_msg_network_bandwidth_usage_t &rhs) { +static inline bool operator>=(const sbp_msg_network_bandwidth_usage_t &lhs, + const sbp_msg_network_bandwidth_usage_t &rhs) { return sbp_msg_network_bandwidth_usage_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_NETWORK_BANDWIDTH_USAGE_H */ - diff --git a/c/include/libsbp/piksi/MSG_NETWORK_STATE_REQ.h b/c/include/libsbp/piksi/MSG_NETWORK_STATE_REQ.h index 1d0c83216..33484a5e2 100644 --- a/c/include/libsbp/piksi/MSG_NETWORK_STATE_REQ.h +++ b/c/include/libsbp/piksi/MSG_NETWORK_STATE_REQ.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_NETWORK_STATE_REQ_H #define LIBSBP_PIKSI_MSG_NETWORK_STATE_REQ_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,25 +40,25 @@ *****************************************************************************/ /** Request state of Piksi network interfaces * -* Request state of Piksi network interfaces. Output will be sent in MSG_NETWORK_STATE_RESP messages. + * Request state of Piksi network interfaces. Output will be sent in + * MSG_NETWORK_STATE_RESP messages. */ typedef struct { /** - * Do not use this field, it exists only to prevent illegal C syntax. Any value written to this field will be ignored + * Do not use this field, it exists only to prevent illegal C syntax. Any + * value written to this field will be ignored */ char DO_NOT_USE_dummy_field_to_prevent_empty_struct; } sbp_msg_network_state_req_t; - - /** * Get encoded size of an instance of sbp_msg_network_state_req_t * * @param msg sbp_msg_network_state_req_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_network_state_req_encoded_len(const sbp_msg_network_state_req_t *msg) -{ +static inline size_t sbp_msg_network_state_req_encoded_len( + const sbp_msg_network_state_req_t *msg) { (void)msg; return SBP_MSG_NETWORK_STATE_REQ_ENCODED_LEN; } @@ -66,36 +66,53 @@ static inline size_t sbp_msg_network_state_req_encoded_len(const sbp_msg_network /** * Encode an instance of sbp_msg_network_state_req_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_network_state_req_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_network_state_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_network_state_req_t *msg); +SBP_EXPORT s8 +sbp_msg_network_state_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_network_state_req_t *msg); /** * Decode an instance of sbp_msg_network_state_req_t from wire representation * - * This function decodes the wire representation of a sbp_msg_network_state_req_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_network_state_req_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_network_state_req_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_network_state_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_network_state_req_t *msg); +SBP_EXPORT s8 sbp_msg_network_state_req_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_network_state_req_t *msg); /** * Send an instance of sbp_msg_network_state_req_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_network_state_req_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_network_state_req_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -103,51 +120,61 @@ SBP_EXPORT s8 sbp_msg_network_state_req_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_network_state_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_network_state_req_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_network_state_req_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_network_state_req_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_network_state_req_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_network_state_req_t instance * @param b sbp_msg_network_state_req_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_network_state_req_cmp(const sbp_msg_network_state_req_t *a, const sbp_msg_network_state_req_t *b); +SBP_EXPORT int sbp_msg_network_state_req_cmp( + const sbp_msg_network_state_req_t *a, const sbp_msg_network_state_req_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_network_state_req_t &lhs, const sbp_msg_network_state_req_t &rhs) { +static inline bool operator==(const sbp_msg_network_state_req_t &lhs, + const sbp_msg_network_state_req_t &rhs) { return sbp_msg_network_state_req_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_network_state_req_t &lhs, const sbp_msg_network_state_req_t &rhs) { +static inline bool operator!=(const sbp_msg_network_state_req_t &lhs, + const sbp_msg_network_state_req_t &rhs) { return sbp_msg_network_state_req_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_network_state_req_t &lhs, const sbp_msg_network_state_req_t &rhs) { +static inline bool operator<(const sbp_msg_network_state_req_t &lhs, + const sbp_msg_network_state_req_t &rhs) { return sbp_msg_network_state_req_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_network_state_req_t &lhs, const sbp_msg_network_state_req_t &rhs) { +static inline bool operator<=(const sbp_msg_network_state_req_t &lhs, + const sbp_msg_network_state_req_t &rhs) { return sbp_msg_network_state_req_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_network_state_req_t &lhs, const sbp_msg_network_state_req_t &rhs) { +static inline bool operator>(const sbp_msg_network_state_req_t &lhs, + const sbp_msg_network_state_req_t &rhs) { return sbp_msg_network_state_req_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_network_state_req_t &lhs, const sbp_msg_network_state_req_t &rhs) { +static inline bool operator>=(const sbp_msg_network_state_req_t &lhs, + const sbp_msg_network_state_req_t &rhs) { return sbp_msg_network_state_req_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_NETWORK_STATE_REQ_H */ - diff --git a/c/include/libsbp/piksi/MSG_NETWORK_STATE_RESP.h b/c/include/libsbp/piksi/MSG_NETWORK_STATE_RESP.h index 61fbc66f8..773f85b9b 100644 --- a/c/include/libsbp/piksi/MSG_NETWORK_STATE_RESP.h +++ b/c/include/libsbp/piksi/MSG_NETWORK_STATE_RESP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_NETWORK_STATE_RESP_H #define LIBSBP_PIKSI_MSG_NETWORK_STATE_RESP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,69 +40,59 @@ *****************************************************************************/ /** State of network interface * -* The state of a network interface on the Piksi. Data is made to reflect output of ifaddrs struct returned by getifaddrs in c. + * The state of a network interface on the Piksi. Data is made to reflect output + * of ifaddrs struct returned by getifaddrs in c. */ typedef struct { - - /** -* IPv4 address (all zero when unavailable) + * IPv4 address (all zero when unavailable) */ u8 ipv4_address[SBP_MSG_NETWORK_STATE_RESP_IPV4_ADDRESS_MAX]; - /** -* IPv4 netmask CIDR notation + * IPv4 netmask CIDR notation */ u8 ipv4_mask_size; - /** -* IPv6 address (all zero when unavailable) + * IPv6 address (all zero when unavailable) */ u8 ipv6_address[SBP_MSG_NETWORK_STATE_RESP_IPV6_ADDRESS_MAX]; - /** -* IPv6 netmask CIDR notation + * IPv6 netmask CIDR notation */ u8 ipv6_mask_size; - /** -* Number of Rx bytes + * Number of Rx bytes */ u32 rx_bytes; - /** -* Number of Tx bytes + * Number of Tx bytes */ u32 tx_bytes; - /** -* Interface Name + * Interface Name */ char interface_name[SBP_MSG_NETWORK_STATE_RESP_INTERFACE_NAME_MAX]; - /** -* Interface flags from SIOCGIFFLAGS + * Interface flags from SIOCGIFFLAGS */ u32 flags; } sbp_msg_network_state_resp_t; - - /** * Get encoded size of an instance of sbp_msg_network_state_resp_t * * @param msg sbp_msg_network_state_resp_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_network_state_resp_encoded_len(const sbp_msg_network_state_resp_t *msg) -{ +static inline size_t sbp_msg_network_state_resp_encoded_len( + const sbp_msg_network_state_resp_t *msg) { (void)msg; return SBP_MSG_NETWORK_STATE_RESP_ENCODED_LEN; } @@ -110,36 +100,54 @@ static inline size_t sbp_msg_network_state_resp_encoded_len(const sbp_msg_networ /** * Encode an instance of sbp_msg_network_state_resp_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_network_state_resp_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_network_state_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_network_state_resp_t *msg); +SBP_EXPORT s8 +sbp_msg_network_state_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_network_state_resp_t *msg); /** * Decode an instance of sbp_msg_network_state_resp_t from wire representation * - * This function decodes the wire representation of a sbp_msg_network_state_resp_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_network_state_resp_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_network_state_resp_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_network_state_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_network_state_resp_t *msg); +SBP_EXPORT s8 sbp_msg_network_state_resp_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_network_state_resp_t *msg); /** - * Send an instance of sbp_msg_network_state_resp_t with the given write function + * Send an instance of sbp_msg_network_state_resp_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_network_state_resp_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_network_state_resp_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -147,51 +155,62 @@ SBP_EXPORT s8 sbp_msg_network_state_resp_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_network_state_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_network_state_resp_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_network_state_resp_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_network_state_resp_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_network_state_resp_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_network_state_resp_t instance * @param b sbp_msg_network_state_resp_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_network_state_resp_cmp(const sbp_msg_network_state_resp_t *a, const sbp_msg_network_state_resp_t *b); +SBP_EXPORT int sbp_msg_network_state_resp_cmp( + const sbp_msg_network_state_resp_t *a, + const sbp_msg_network_state_resp_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_network_state_resp_t &lhs, const sbp_msg_network_state_resp_t &rhs) { +static inline bool operator==(const sbp_msg_network_state_resp_t &lhs, + const sbp_msg_network_state_resp_t &rhs) { return sbp_msg_network_state_resp_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_network_state_resp_t &lhs, const sbp_msg_network_state_resp_t &rhs) { +static inline bool operator!=(const sbp_msg_network_state_resp_t &lhs, + const sbp_msg_network_state_resp_t &rhs) { return sbp_msg_network_state_resp_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_network_state_resp_t &lhs, const sbp_msg_network_state_resp_t &rhs) { +static inline bool operator<(const sbp_msg_network_state_resp_t &lhs, + const sbp_msg_network_state_resp_t &rhs) { return sbp_msg_network_state_resp_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_network_state_resp_t &lhs, const sbp_msg_network_state_resp_t &rhs) { +static inline bool operator<=(const sbp_msg_network_state_resp_t &lhs, + const sbp_msg_network_state_resp_t &rhs) { return sbp_msg_network_state_resp_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_network_state_resp_t &lhs, const sbp_msg_network_state_resp_t &rhs) { +static inline bool operator>(const sbp_msg_network_state_resp_t &lhs, + const sbp_msg_network_state_resp_t &rhs) { return sbp_msg_network_state_resp_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_network_state_resp_t &lhs, const sbp_msg_network_state_resp_t &rhs) { +static inline bool operator>=(const sbp_msg_network_state_resp_t &lhs, + const sbp_msg_network_state_resp_t &rhs) { return sbp_msg_network_state_resp_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_NETWORK_STATE_RESP_H */ - diff --git a/c/include/libsbp/piksi/MSG_RESET.h b/c/include/libsbp/piksi/MSG_RESET.h index 018be3638..7629c5390 100644 --- a/c/include/libsbp/piksi/MSG_RESET.h +++ b/c/include/libsbp/piksi/MSG_RESET.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_RESET_H #define LIBSBP_PIKSI_MSG_RESET_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,27 +40,22 @@ *****************************************************************************/ /** Reset the device (host => Piksi) * -* This message from the host resets the Piksi back into the bootloader. + * This message from the host resets the Piksi back into the bootloader. */ typedef struct { - - /** -* Reset flags + * Reset flags */ u32 flags; } sbp_msg_reset_t; - - /** * Get encoded size of an instance of sbp_msg_reset_t * * @param msg sbp_msg_reset_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_reset_encoded_len(const sbp_msg_reset_t *msg) -{ +static inline size_t sbp_msg_reset_encoded_len(const sbp_msg_reset_t *msg) { (void)msg; return SBP_MSG_RESET_ENCODED_LEN; } @@ -68,36 +63,52 @@ static inline size_t sbp_msg_reset_encoded_len(const sbp_msg_reset_t *msg) /** * Encode an instance of sbp_msg_reset_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_reset_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_reset_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_reset_t *msg); +SBP_EXPORT s8 sbp_msg_reset_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_reset_t *msg); /** * Decode an instance of sbp_msg_reset_t from wire representation * - * This function decodes the wire representation of a sbp_msg_reset_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_reset_t message to + * the given instance. The caller must specify the length of the buffer in the + * \p len parameter. If non-null the number of bytes read from the buffer will + * be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_reset_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_reset_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_reset_t *msg); +SBP_EXPORT s8 sbp_msg_reset_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_reset_t *msg); /** * Send an instance of sbp_msg_reset_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_reset_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_reset_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -105,51 +116,61 @@ SBP_EXPORT s8 sbp_msg_reset_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_reset_send(sbp_state_t *s, u16 sender_id, const sbp_msg_reset_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_reset_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_reset_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_reset_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_reset_t instance * @param b sbp_msg_reset_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_reset_cmp(const sbp_msg_reset_t *a, const sbp_msg_reset_t *b); +SBP_EXPORT int sbp_msg_reset_cmp(const sbp_msg_reset_t *a, + const sbp_msg_reset_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_reset_t &lhs, const sbp_msg_reset_t &rhs) { +static inline bool operator==(const sbp_msg_reset_t &lhs, + const sbp_msg_reset_t &rhs) { return sbp_msg_reset_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_reset_t &lhs, const sbp_msg_reset_t &rhs) { +static inline bool operator!=(const sbp_msg_reset_t &lhs, + const sbp_msg_reset_t &rhs) { return sbp_msg_reset_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_reset_t &lhs, const sbp_msg_reset_t &rhs) { +static inline bool operator<(const sbp_msg_reset_t &lhs, + const sbp_msg_reset_t &rhs) { return sbp_msg_reset_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_reset_t &lhs, const sbp_msg_reset_t &rhs) { +static inline bool operator<=(const sbp_msg_reset_t &lhs, + const sbp_msg_reset_t &rhs) { return sbp_msg_reset_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_reset_t &lhs, const sbp_msg_reset_t &rhs) { +static inline bool operator>(const sbp_msg_reset_t &lhs, + const sbp_msg_reset_t &rhs) { return sbp_msg_reset_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_reset_t &lhs, const sbp_msg_reset_t &rhs) { +static inline bool operator>=(const sbp_msg_reset_t &lhs, + const sbp_msg_reset_t &rhs) { return sbp_msg_reset_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_RESET_H */ - diff --git a/c/include/libsbp/piksi/MSG_RESET_DEP.h b/c/include/libsbp/piksi/MSG_RESET_DEP.h index 72c7225c7..aa5daa73f 100644 --- a/c/include/libsbp/piksi/MSG_RESET_DEP.h +++ b/c/include/libsbp/piksi/MSG_RESET_DEP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_RESET_DEP_H #define LIBSBP_PIKSI_MSG_RESET_DEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,25 +40,24 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { /** - * Do not use this field, it exists only to prevent illegal C syntax. Any value written to this field will be ignored + * Do not use this field, it exists only to prevent illegal C syntax. Any + * value written to this field will be ignored */ char DO_NOT_USE_dummy_field_to_prevent_empty_struct; } sbp_msg_reset_dep_t; - - /** * Get encoded size of an instance of sbp_msg_reset_dep_t * * @param msg sbp_msg_reset_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_reset_dep_encoded_len(const sbp_msg_reset_dep_t *msg) -{ +static inline size_t sbp_msg_reset_dep_encoded_len( + const sbp_msg_reset_dep_t *msg) { (void)msg; return SBP_MSG_RESET_DEP_ENCODED_LEN; } @@ -66,36 +65,53 @@ static inline size_t sbp_msg_reset_dep_encoded_len(const sbp_msg_reset_dep_t *ms /** * Encode an instance of sbp_msg_reset_dep_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_reset_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_reset_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_reset_dep_t *msg); +SBP_EXPORT s8 sbp_msg_reset_dep_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_reset_dep_t *msg); /** * Decode an instance of sbp_msg_reset_dep_t from wire representation * - * This function decodes the wire representation of a sbp_msg_reset_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_reset_dep_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_reset_dep_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_reset_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_reset_dep_t *msg); +SBP_EXPORT s8 sbp_msg_reset_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_reset_dep_t *msg); /** * Send an instance of sbp_msg_reset_dep_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_reset_dep_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_reset_dep_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -103,51 +119,61 @@ SBP_EXPORT s8 sbp_msg_reset_dep_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_reset_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_reset_dep_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_reset_dep_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_reset_dep_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_reset_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_reset_dep_t instance * @param b sbp_msg_reset_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_reset_dep_cmp(const sbp_msg_reset_dep_t *a, const sbp_msg_reset_dep_t *b); +SBP_EXPORT int sbp_msg_reset_dep_cmp(const sbp_msg_reset_dep_t *a, + const sbp_msg_reset_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_reset_dep_t &lhs, const sbp_msg_reset_dep_t &rhs) { +static inline bool operator==(const sbp_msg_reset_dep_t &lhs, + const sbp_msg_reset_dep_t &rhs) { return sbp_msg_reset_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_reset_dep_t &lhs, const sbp_msg_reset_dep_t &rhs) { +static inline bool operator!=(const sbp_msg_reset_dep_t &lhs, + const sbp_msg_reset_dep_t &rhs) { return sbp_msg_reset_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_reset_dep_t &lhs, const sbp_msg_reset_dep_t &rhs) { +static inline bool operator<(const sbp_msg_reset_dep_t &lhs, + const sbp_msg_reset_dep_t &rhs) { return sbp_msg_reset_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_reset_dep_t &lhs, const sbp_msg_reset_dep_t &rhs) { +static inline bool operator<=(const sbp_msg_reset_dep_t &lhs, + const sbp_msg_reset_dep_t &rhs) { return sbp_msg_reset_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_reset_dep_t &lhs, const sbp_msg_reset_dep_t &rhs) { +static inline bool operator>(const sbp_msg_reset_dep_t &lhs, + const sbp_msg_reset_dep_t &rhs) { return sbp_msg_reset_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_reset_dep_t &lhs, const sbp_msg_reset_dep_t &rhs) { +static inline bool operator>=(const sbp_msg_reset_dep_t &lhs, + const sbp_msg_reset_dep_t &rhs) { return sbp_msg_reset_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_RESET_DEP_H */ - diff --git a/c/include/libsbp/piksi/MSG_RESET_FILTERS.h b/c/include/libsbp/piksi/MSG_RESET_FILTERS.h index 56d11f7f4..68a08b440 100644 --- a/c/include/libsbp/piksi/MSG_RESET_FILTERS.h +++ b/c/include/libsbp/piksi/MSG_RESET_FILTERS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_RESET_FILTERS_H #define LIBSBP_PIKSI_MSG_RESET_FILTERS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,27 +40,24 @@ *****************************************************************************/ /** Reset IAR filters (host => Piksi) * -* This message resets either the DGNSS Kalman filters or Integer Ambiguity Resolution (IAR) process. + * This message resets either the DGNSS Kalman filters or Integer Ambiguity + * Resolution (IAR) process. */ typedef struct { - - /** -* Filter flags + * Filter flags */ u8 filter; } sbp_msg_reset_filters_t; - - /** * Get encoded size of an instance of sbp_msg_reset_filters_t * * @param msg sbp_msg_reset_filters_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_reset_filters_encoded_len(const sbp_msg_reset_filters_t *msg) -{ +static inline size_t sbp_msg_reset_filters_encoded_len( + const sbp_msg_reset_filters_t *msg) { (void)msg; return SBP_MSG_RESET_FILTERS_ENCODED_LEN; } @@ -68,36 +65,53 @@ static inline size_t sbp_msg_reset_filters_encoded_len(const sbp_msg_reset_filte /** * Encode an instance of sbp_msg_reset_filters_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_reset_filters_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_reset_filters_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_reset_filters_t *msg); +SBP_EXPORT s8 sbp_msg_reset_filters_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_reset_filters_t *msg); /** * Decode an instance of sbp_msg_reset_filters_t from wire representation * - * This function decodes the wire representation of a sbp_msg_reset_filters_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_reset_filters_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_reset_filters_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_reset_filters_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_reset_filters_t *msg); +SBP_EXPORT s8 sbp_msg_reset_filters_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_reset_filters_t *msg); /** * Send an instance of sbp_msg_reset_filters_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_reset_filters_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_reset_filters_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -105,51 +119,61 @@ SBP_EXPORT s8 sbp_msg_reset_filters_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_reset_filters_send(sbp_state_t *s, u16 sender_id, const sbp_msg_reset_filters_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_reset_filters_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_reset_filters_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_reset_filters_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_reset_filters_t instance * @param b sbp_msg_reset_filters_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_reset_filters_cmp(const sbp_msg_reset_filters_t *a, const sbp_msg_reset_filters_t *b); +SBP_EXPORT int sbp_msg_reset_filters_cmp(const sbp_msg_reset_filters_t *a, + const sbp_msg_reset_filters_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_reset_filters_t &lhs, const sbp_msg_reset_filters_t &rhs) { +static inline bool operator==(const sbp_msg_reset_filters_t &lhs, + const sbp_msg_reset_filters_t &rhs) { return sbp_msg_reset_filters_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_reset_filters_t &lhs, const sbp_msg_reset_filters_t &rhs) { +static inline bool operator!=(const sbp_msg_reset_filters_t &lhs, + const sbp_msg_reset_filters_t &rhs) { return sbp_msg_reset_filters_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_reset_filters_t &lhs, const sbp_msg_reset_filters_t &rhs) { +static inline bool operator<(const sbp_msg_reset_filters_t &lhs, + const sbp_msg_reset_filters_t &rhs) { return sbp_msg_reset_filters_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_reset_filters_t &lhs, const sbp_msg_reset_filters_t &rhs) { +static inline bool operator<=(const sbp_msg_reset_filters_t &lhs, + const sbp_msg_reset_filters_t &rhs) { return sbp_msg_reset_filters_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_reset_filters_t &lhs, const sbp_msg_reset_filters_t &rhs) { +static inline bool operator>(const sbp_msg_reset_filters_t &lhs, + const sbp_msg_reset_filters_t &rhs) { return sbp_msg_reset_filters_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_reset_filters_t &lhs, const sbp_msg_reset_filters_t &rhs) { +static inline bool operator>=(const sbp_msg_reset_filters_t &lhs, + const sbp_msg_reset_filters_t &rhs) { return sbp_msg_reset_filters_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_RESET_FILTERS_H */ - diff --git a/c/include/libsbp/piksi/MSG_SET_TIME.h b/c/include/libsbp/piksi/MSG_SET_TIME.h index 896045d06..9d437960b 100644 --- a/c/include/libsbp/piksi/MSG_SET_TIME.h +++ b/c/include/libsbp/piksi/MSG_SET_TIME.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_SET_TIME_H #define LIBSBP_PIKSI_MSG_SET_TIME_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,25 +40,25 @@ *****************************************************************************/ /** Send GPS time from host (host => Piksi) * -* This message sets up timing functionality using a coarse GPS time estimate sent by the host. + * This message sets up timing functionality using a coarse GPS time estimate + * sent by the host. */ typedef struct { /** - * Do not use this field, it exists only to prevent illegal C syntax. Any value written to this field will be ignored + * Do not use this field, it exists only to prevent illegal C syntax. Any + * value written to this field will be ignored */ char DO_NOT_USE_dummy_field_to_prevent_empty_struct; } sbp_msg_set_time_t; - - /** * Get encoded size of an instance of sbp_msg_set_time_t * * @param msg sbp_msg_set_time_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_set_time_encoded_len(const sbp_msg_set_time_t *msg) -{ +static inline size_t sbp_msg_set_time_encoded_len( + const sbp_msg_set_time_t *msg) { (void)msg; return SBP_MSG_SET_TIME_ENCODED_LEN; } @@ -66,36 +66,52 @@ static inline size_t sbp_msg_set_time_encoded_len(const sbp_msg_set_time_t *msg) /** * Encode an instance of sbp_msg_set_time_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_set_time_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_set_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_set_time_t *msg); +SBP_EXPORT s8 sbp_msg_set_time_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_set_time_t *msg); /** * Decode an instance of sbp_msg_set_time_t from wire representation * - * This function decodes the wire representation of a sbp_msg_set_time_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_set_time_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_set_time_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_set_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_set_time_t *msg); +SBP_EXPORT s8 sbp_msg_set_time_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_set_time_t *msg); /** * Send an instance of sbp_msg_set_time_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_set_time_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_set_time_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -103,51 +119,61 @@ SBP_EXPORT s8 sbp_msg_set_time_decode(const uint8_t *buf, uint8_t len, uint8_t * * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_set_time_send(sbp_state_t *s, u16 sender_id, const sbp_msg_set_time_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_set_time_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_set_time_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_set_time_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_set_time_t instance * @param b sbp_msg_set_time_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_set_time_cmp(const sbp_msg_set_time_t *a, const sbp_msg_set_time_t *b); +SBP_EXPORT int sbp_msg_set_time_cmp(const sbp_msg_set_time_t *a, + const sbp_msg_set_time_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_set_time_t &lhs, const sbp_msg_set_time_t &rhs) { +static inline bool operator==(const sbp_msg_set_time_t &lhs, + const sbp_msg_set_time_t &rhs) { return sbp_msg_set_time_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_set_time_t &lhs, const sbp_msg_set_time_t &rhs) { +static inline bool operator!=(const sbp_msg_set_time_t &lhs, + const sbp_msg_set_time_t &rhs) { return sbp_msg_set_time_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_set_time_t &lhs, const sbp_msg_set_time_t &rhs) { +static inline bool operator<(const sbp_msg_set_time_t &lhs, + const sbp_msg_set_time_t &rhs) { return sbp_msg_set_time_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_set_time_t &lhs, const sbp_msg_set_time_t &rhs) { +static inline bool operator<=(const sbp_msg_set_time_t &lhs, + const sbp_msg_set_time_t &rhs) { return sbp_msg_set_time_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_set_time_t &lhs, const sbp_msg_set_time_t &rhs) { +static inline bool operator>(const sbp_msg_set_time_t &lhs, + const sbp_msg_set_time_t &rhs) { return sbp_msg_set_time_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_set_time_t &lhs, const sbp_msg_set_time_t &rhs) { +static inline bool operator>=(const sbp_msg_set_time_t &lhs, + const sbp_msg_set_time_t &rhs) { return sbp_msg_set_time_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_SET_TIME_H */ - diff --git a/c/include/libsbp/piksi/MSG_SPECAN.h b/c/include/libsbp/piksi/MSG_SPECAN.h index 7e51e0f0a..acc3f02ac 100644 --- a/c/include/libsbp/piksi/MSG_SPECAN.h +++ b/c/include/libsbp/piksi/MSG_SPECAN.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_PIKSI_MSG_SPECAN_H #define LIBSBP_PIKSI_MSG_SPECAN_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,109 +41,116 @@ *****************************************************************************/ /** Spectrum analyzer * -* Spectrum analyzer packet. + * Spectrum analyzer packet. */ typedef struct { - - /** -* Channel ID + * Channel ID */ u16 channel_tag; - /** -* Receiver time of this observation + * Receiver time of this observation */ sbp_v4_gps_time_t t; - /** - * Reference frequency of this packet [MHz] + * Reference frequency of this packet [MHz] */ float freq_ref; - /** - * Frequency step of points in this packet [MHz] + * Frequency step of points in this packet [MHz] */ float freq_step; - /** - * Reference amplitude of this packet [dB] + * Reference amplitude of this packet [dB] */ float amplitude_ref; - /** - * Amplitude unit value of points in this packet [dB] + * Amplitude unit value of points in this packet [dB] */ float amplitude_unit; - /** - * Amplitude values (in the above units) of points in this packet + * Amplitude values (in the above units) of points in this packet */ u8 amplitude_value[SBP_MSG_SPECAN_AMPLITUDE_VALUE_MAX]; /** * Number of elements in amplitude_value * - * When sending a message fill in this field with the number elements set in amplitude_value before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * amplitude_value before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in amplitude_value. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * amplitude_value. The value of any elements beyond the index specified in + * this field is undefined */ u8 n_amplitude_value; } sbp_msg_specan_t; - - /** * Get encoded size of an instance of sbp_msg_specan_t * * @param msg sbp_msg_specan_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_specan_encoded_len(const sbp_msg_specan_t *msg) -{ - return SBP_MSG_SPECAN_ENCODED_OVERHEAD - + (msg->n_amplitude_value * SBP_ENCODED_LEN_U8) - ; +static inline size_t sbp_msg_specan_encoded_len(const sbp_msg_specan_t *msg) { + return SBP_MSG_SPECAN_ENCODED_OVERHEAD + + (msg->n_amplitude_value * SBP_ENCODED_LEN_U8); } /** * Encode an instance of sbp_msg_specan_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_specan_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_specan_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_specan_t *msg); +SBP_EXPORT s8 sbp_msg_specan_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_specan_t *msg); /** * Decode an instance of sbp_msg_specan_t from wire representation * - * This function decodes the wire representation of a sbp_msg_specan_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_specan_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_specan_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_specan_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_specan_t *msg); +SBP_EXPORT s8 sbp_msg_specan_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_specan_t *msg); /** * Send an instance of sbp_msg_specan_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_specan_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_specan_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -151,51 +158,61 @@ SBP_EXPORT s8 sbp_msg_specan_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_specan_send(sbp_state_t *s, u16 sender_id, const sbp_msg_specan_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_specan_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_specan_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_specan_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_specan_t instance * @param b sbp_msg_specan_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_specan_cmp(const sbp_msg_specan_t *a, const sbp_msg_specan_t *b); +SBP_EXPORT int sbp_msg_specan_cmp(const sbp_msg_specan_t *a, + const sbp_msg_specan_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_specan_t &lhs, const sbp_msg_specan_t &rhs) { +static inline bool operator==(const sbp_msg_specan_t &lhs, + const sbp_msg_specan_t &rhs) { return sbp_msg_specan_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_specan_t &lhs, const sbp_msg_specan_t &rhs) { +static inline bool operator!=(const sbp_msg_specan_t &lhs, + const sbp_msg_specan_t &rhs) { return sbp_msg_specan_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_specan_t &lhs, const sbp_msg_specan_t &rhs) { +static inline bool operator<(const sbp_msg_specan_t &lhs, + const sbp_msg_specan_t &rhs) { return sbp_msg_specan_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_specan_t &lhs, const sbp_msg_specan_t &rhs) { +static inline bool operator<=(const sbp_msg_specan_t &lhs, + const sbp_msg_specan_t &rhs) { return sbp_msg_specan_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_specan_t &lhs, const sbp_msg_specan_t &rhs) { +static inline bool operator>(const sbp_msg_specan_t &lhs, + const sbp_msg_specan_t &rhs) { return sbp_msg_specan_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_specan_t &lhs, const sbp_msg_specan_t &rhs) { +static inline bool operator>=(const sbp_msg_specan_t &lhs, + const sbp_msg_specan_t &rhs) { return sbp_msg_specan_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_SPECAN_H */ - diff --git a/c/include/libsbp/piksi/MSG_SPECAN_DEP.h b/c/include/libsbp/piksi/MSG_SPECAN_DEP.h index c7b536605..dfe977648 100644 --- a/c/include/libsbp/piksi/MSG_SPECAN_DEP.h +++ b/c/include/libsbp/piksi/MSG_SPECAN_DEP.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_PIKSI_MSG_SPECAN_DEP_H #define LIBSBP_PIKSI_MSG_SPECAN_DEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,109 +41,118 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Channel ID + * Channel ID */ u16 channel_tag; - /** -* Receiver time of this observation + * Receiver time of this observation */ sbp_gps_time_dep_t t; - /** - * Reference frequency of this packet [MHz] + * Reference frequency of this packet [MHz] */ float freq_ref; - /** - * Frequency step of points in this packet [MHz] + * Frequency step of points in this packet [MHz] */ float freq_step; - /** - * Reference amplitude of this packet [dB] + * Reference amplitude of this packet [dB] */ float amplitude_ref; - /** - * Amplitude unit value of points in this packet [dB] + * Amplitude unit value of points in this packet [dB] */ float amplitude_unit; - /** - * Amplitude values (in the above units) of points in this packet + * Amplitude values (in the above units) of points in this packet */ u8 amplitude_value[SBP_MSG_SPECAN_DEP_AMPLITUDE_VALUE_MAX]; /** * Number of elements in amplitude_value * - * When sending a message fill in this field with the number elements set in amplitude_value before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * amplitude_value before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in amplitude_value. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * amplitude_value. The value of any elements beyond the index specified in + * this field is undefined */ u8 n_amplitude_value; } sbp_msg_specan_dep_t; - - /** * Get encoded size of an instance of sbp_msg_specan_dep_t * * @param msg sbp_msg_specan_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_specan_dep_encoded_len(const sbp_msg_specan_dep_t *msg) -{ - return SBP_MSG_SPECAN_DEP_ENCODED_OVERHEAD - + (msg->n_amplitude_value * SBP_ENCODED_LEN_U8) - ; +static inline size_t sbp_msg_specan_dep_encoded_len( + const sbp_msg_specan_dep_t *msg) { + return SBP_MSG_SPECAN_DEP_ENCODED_OVERHEAD + + (msg->n_amplitude_value * SBP_ENCODED_LEN_U8); } /** * Encode an instance of sbp_msg_specan_dep_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_specan_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_specan_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_specan_dep_t *msg); +SBP_EXPORT s8 sbp_msg_specan_dep_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_specan_dep_t *msg); /** * Decode an instance of sbp_msg_specan_dep_t from wire representation * - * This function decodes the wire representation of a sbp_msg_specan_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_specan_dep_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_specan_dep_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_specan_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_specan_dep_t *msg); +SBP_EXPORT s8 sbp_msg_specan_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_specan_dep_t *msg); /** * Send an instance of sbp_msg_specan_dep_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_specan_dep_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_specan_dep_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -151,51 +160,61 @@ SBP_EXPORT s8 sbp_msg_specan_dep_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_specan_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_specan_dep_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_specan_dep_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_specan_dep_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_specan_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_specan_dep_t instance * @param b sbp_msg_specan_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_specan_dep_cmp(const sbp_msg_specan_dep_t *a, const sbp_msg_specan_dep_t *b); +SBP_EXPORT int sbp_msg_specan_dep_cmp(const sbp_msg_specan_dep_t *a, + const sbp_msg_specan_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_specan_dep_t &lhs, const sbp_msg_specan_dep_t &rhs) { +static inline bool operator==(const sbp_msg_specan_dep_t &lhs, + const sbp_msg_specan_dep_t &rhs) { return sbp_msg_specan_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_specan_dep_t &lhs, const sbp_msg_specan_dep_t &rhs) { +static inline bool operator!=(const sbp_msg_specan_dep_t &lhs, + const sbp_msg_specan_dep_t &rhs) { return sbp_msg_specan_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_specan_dep_t &lhs, const sbp_msg_specan_dep_t &rhs) { +static inline bool operator<(const sbp_msg_specan_dep_t &lhs, + const sbp_msg_specan_dep_t &rhs) { return sbp_msg_specan_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_specan_dep_t &lhs, const sbp_msg_specan_dep_t &rhs) { +static inline bool operator<=(const sbp_msg_specan_dep_t &lhs, + const sbp_msg_specan_dep_t &rhs) { return sbp_msg_specan_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_specan_dep_t &lhs, const sbp_msg_specan_dep_t &rhs) { +static inline bool operator>(const sbp_msg_specan_dep_t &lhs, + const sbp_msg_specan_dep_t &rhs) { return sbp_msg_specan_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_specan_dep_t &lhs, const sbp_msg_specan_dep_t &rhs) { +static inline bool operator>=(const sbp_msg_specan_dep_t &lhs, + const sbp_msg_specan_dep_t &rhs) { return sbp_msg_specan_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_SPECAN_DEP_H */ - diff --git a/c/include/libsbp/piksi/MSG_THREAD_STATE.h b/c/include/libsbp/piksi/MSG_THREAD_STATE.h index 29915da58..e3496239a 100644 --- a/c/include/libsbp/piksi/MSG_THREAD_STATE.h +++ b/c/include/libsbp/piksi/MSG_THREAD_STATE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_MSG_THREAD_STATE_H #define LIBSBP_PIKSI_MSG_THREAD_STATE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,39 +40,36 @@ *****************************************************************************/ /** State of an RTOS thread * -* The thread usage message from the device reports real-time operating system (RTOS) thread usage statistics for the named thread. The reported percentage values must be normalized. + * The thread usage message from the device reports real-time operating system + * (RTOS) thread usage statistics for the named thread. The reported percentage + * values must be normalized. */ typedef struct { - - /** -* Thread name (NULL terminated) + * Thread name (NULL terminated) */ char name[SBP_MSG_THREAD_STATE_NAME_MAX]; - /** - * Percentage cpu use for this thread. Values range from 0 - 1000 and needs to be renormalized to 100 + * Percentage cpu use for this thread. Values range from 0 - 1000 and needs to + * be renormalized to 100 */ u16 cpu; - /** -* Free stack space for this thread [bytes] + * Free stack space for this thread [bytes] */ u32 stack_free; } sbp_msg_thread_state_t; - - /** * Get encoded size of an instance of sbp_msg_thread_state_t * * @param msg sbp_msg_thread_state_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_thread_state_encoded_len(const sbp_msg_thread_state_t *msg) -{ +static inline size_t sbp_msg_thread_state_encoded_len( + const sbp_msg_thread_state_t *msg) { (void)msg; return SBP_MSG_THREAD_STATE_ENCODED_LEN; } @@ -80,36 +77,53 @@ static inline size_t sbp_msg_thread_state_encoded_len(const sbp_msg_thread_state /** * Encode an instance of sbp_msg_thread_state_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_thread_state_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_thread_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_thread_state_t *msg); +SBP_EXPORT s8 sbp_msg_thread_state_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_thread_state_t *msg); /** * Decode an instance of sbp_msg_thread_state_t from wire representation * - * This function decodes the wire representation of a sbp_msg_thread_state_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_thread_state_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_thread_state_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_thread_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_thread_state_t *msg); +SBP_EXPORT s8 sbp_msg_thread_state_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_thread_state_t *msg); /** * Send an instance of sbp_msg_thread_state_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_thread_state_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_thread_state_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -117,51 +131,61 @@ SBP_EXPORT s8 sbp_msg_thread_state_decode(const uint8_t *buf, uint8_t len, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_thread_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_thread_state_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_thread_state_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_thread_state_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_thread_state_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_thread_state_t instance * @param b sbp_msg_thread_state_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_thread_state_cmp(const sbp_msg_thread_state_t *a, const sbp_msg_thread_state_t *b); +SBP_EXPORT int sbp_msg_thread_state_cmp(const sbp_msg_thread_state_t *a, + const sbp_msg_thread_state_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_thread_state_t &lhs, const sbp_msg_thread_state_t &rhs) { +static inline bool operator==(const sbp_msg_thread_state_t &lhs, + const sbp_msg_thread_state_t &rhs) { return sbp_msg_thread_state_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_thread_state_t &lhs, const sbp_msg_thread_state_t &rhs) { +static inline bool operator!=(const sbp_msg_thread_state_t &lhs, + const sbp_msg_thread_state_t &rhs) { return sbp_msg_thread_state_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_thread_state_t &lhs, const sbp_msg_thread_state_t &rhs) { +static inline bool operator<(const sbp_msg_thread_state_t &lhs, + const sbp_msg_thread_state_t &rhs) { return sbp_msg_thread_state_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_thread_state_t &lhs, const sbp_msg_thread_state_t &rhs) { +static inline bool operator<=(const sbp_msg_thread_state_t &lhs, + const sbp_msg_thread_state_t &rhs) { return sbp_msg_thread_state_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_thread_state_t &lhs, const sbp_msg_thread_state_t &rhs) { +static inline bool operator>(const sbp_msg_thread_state_t &lhs, + const sbp_msg_thread_state_t &rhs) { return sbp_msg_thread_state_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_thread_state_t &lhs, const sbp_msg_thread_state_t &rhs) { +static inline bool operator>=(const sbp_msg_thread_state_t &lhs, + const sbp_msg_thread_state_t &rhs) { return sbp_msg_thread_state_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_THREAD_STATE_H */ - diff --git a/c/include/libsbp/piksi/MSG_UART_STATE.h b/c/include/libsbp/piksi/MSG_UART_STATE.h index 2c1f2e720..6242a2871 100644 --- a/c/include/libsbp/piksi/MSG_UART_STATE.h +++ b/c/include/libsbp/piksi/MSG_UART_STATE.h @@ -18,24 +18,22 @@ #ifndef LIBSBP_PIKSI_MSG_UART_STATE_H #define LIBSBP_PIKSI_MSG_UART_STATE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include -#include -#include #include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -45,51 +43,50 @@ *****************************************************************************/ /** State of the UART channels * -* The UART message reports data latency and throughput of the UART channels providing SBP I/O. On the default Piksi configuration, UARTs A and B are used for telemetry radios, but can also be host access ports for embedded hosts, or other interfaces in future. The reported percentage values must be normalized. Observations latency and period can be used to assess the health of the differential corrections link. Latency provides the timeliness of received base observations while the period indicates their likelihood of transmission. + * The UART message reports data latency and throughput of the UART channels + * providing SBP I/O. On the default Piksi configuration, UARTs A and B are used + * for telemetry radios, but can also be host access ports for embedded hosts, + * or other interfaces in future. The reported percentage values must be + * normalized. Observations latency and period can be used to assess the health + * of the differential corrections link. Latency provides the timeliness of + * received base observations while the period indicates their likelihood of + * transmission. */ typedef struct { - - /** -* State of UART A + * State of UART A */ sbp_uart_channel_t uart_a; - /** -* State of UART B + * State of UART B */ sbp_uart_channel_t uart_b; - /** -* State of UART FTDI (USB logger) + * State of UART FTDI (USB logger) */ sbp_uart_channel_t uart_ftdi; - /** -* UART communication latency + * UART communication latency */ sbp_latency_t latency; - /** -* Observation receipt period + * Observation receipt period */ sbp_period_t obs_period; } sbp_msg_uart_state_t; - - /** * Get encoded size of an instance of sbp_msg_uart_state_t * * @param msg sbp_msg_uart_state_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_uart_state_encoded_len(const sbp_msg_uart_state_t *msg) -{ +static inline size_t sbp_msg_uart_state_encoded_len( + const sbp_msg_uart_state_t *msg) { (void)msg; return SBP_MSG_UART_STATE_ENCODED_LEN; } @@ -97,36 +94,53 @@ static inline size_t sbp_msg_uart_state_encoded_len(const sbp_msg_uart_state_t * /** * Encode an instance of sbp_msg_uart_state_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_uart_state_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_uart_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_uart_state_t *msg); +SBP_EXPORT s8 sbp_msg_uart_state_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_uart_state_t *msg); /** * Decode an instance of sbp_msg_uart_state_t from wire representation * - * This function decodes the wire representation of a sbp_msg_uart_state_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_uart_state_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_uart_state_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_uart_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_uart_state_t *msg); +SBP_EXPORT s8 sbp_msg_uart_state_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_uart_state_t *msg); /** * Send an instance of sbp_msg_uart_state_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_uart_state_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_uart_state_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -134,51 +148,61 @@ SBP_EXPORT s8 sbp_msg_uart_state_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_uart_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_uart_state_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_uart_state_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_uart_state_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_uart_state_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_uart_state_t instance * @param b sbp_msg_uart_state_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_uart_state_cmp(const sbp_msg_uart_state_t *a, const sbp_msg_uart_state_t *b); +SBP_EXPORT int sbp_msg_uart_state_cmp(const sbp_msg_uart_state_t *a, + const sbp_msg_uart_state_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_uart_state_t &lhs, const sbp_msg_uart_state_t &rhs) { +static inline bool operator==(const sbp_msg_uart_state_t &lhs, + const sbp_msg_uart_state_t &rhs) { return sbp_msg_uart_state_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_uart_state_t &lhs, const sbp_msg_uart_state_t &rhs) { +static inline bool operator!=(const sbp_msg_uart_state_t &lhs, + const sbp_msg_uart_state_t &rhs) { return sbp_msg_uart_state_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_uart_state_t &lhs, const sbp_msg_uart_state_t &rhs) { +static inline bool operator<(const sbp_msg_uart_state_t &lhs, + const sbp_msg_uart_state_t &rhs) { return sbp_msg_uart_state_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_uart_state_t &lhs, const sbp_msg_uart_state_t &rhs) { +static inline bool operator<=(const sbp_msg_uart_state_t &lhs, + const sbp_msg_uart_state_t &rhs) { return sbp_msg_uart_state_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_uart_state_t &lhs, const sbp_msg_uart_state_t &rhs) { +static inline bool operator>(const sbp_msg_uart_state_t &lhs, + const sbp_msg_uart_state_t &rhs) { return sbp_msg_uart_state_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_uart_state_t &lhs, const sbp_msg_uart_state_t &rhs) { +static inline bool operator>=(const sbp_msg_uart_state_t &lhs, + const sbp_msg_uart_state_t &rhs) { return sbp_msg_uart_state_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_UART_STATE_H */ - diff --git a/c/include/libsbp/piksi/MSG_UART_STATE_DEPA.h b/c/include/libsbp/piksi/MSG_UART_STATE_DEPA.h index db96ddb97..30af77a0f 100644 --- a/c/include/libsbp/piksi/MSG_UART_STATE_DEPA.h +++ b/c/include/libsbp/piksi/MSG_UART_STATE_DEPA.h @@ -18,23 +18,21 @@ #ifndef LIBSBP_PIKSI_MSG_UART_STATE_DEPA_H #define LIBSBP_PIKSI_MSG_UART_STATE_DEPA_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -44,45 +42,38 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* State of UART A + * State of UART A */ sbp_uart_channel_t uart_a; - /** -* State of UART B + * State of UART B */ sbp_uart_channel_t uart_b; - /** -* State of UART FTDI (USB logger) + * State of UART FTDI (USB logger) */ sbp_uart_channel_t uart_ftdi; - /** -* UART communication latency + * UART communication latency */ sbp_latency_t latency; } sbp_msg_uart_state_depa_t; - - /** * Get encoded size of an instance of sbp_msg_uart_state_depa_t * * @param msg sbp_msg_uart_state_depa_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_uart_state_depa_encoded_len(const sbp_msg_uart_state_depa_t *msg) -{ +static inline size_t sbp_msg_uart_state_depa_encoded_len( + const sbp_msg_uart_state_depa_t *msg) { (void)msg; return SBP_MSG_UART_STATE_DEPA_ENCODED_LEN; } @@ -90,36 +81,53 @@ static inline size_t sbp_msg_uart_state_depa_encoded_len(const sbp_msg_uart_stat /** * Encode an instance of sbp_msg_uart_state_depa_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_uart_state_depa_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_uart_state_depa_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_uart_state_depa_t *msg); +SBP_EXPORT s8 +sbp_msg_uart_state_depa_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_uart_state_depa_t *msg); /** * Decode an instance of sbp_msg_uart_state_depa_t from wire representation * - * This function decodes the wire representation of a sbp_msg_uart_state_depa_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_uart_state_depa_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_uart_state_depa_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_uart_state_depa_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_uart_state_depa_t *msg); +SBP_EXPORT s8 sbp_msg_uart_state_depa_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_uart_state_depa_t *msg); /** * Send an instance of sbp_msg_uart_state_depa_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_uart_state_depa_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_uart_state_depa_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -127,51 +135,61 @@ SBP_EXPORT s8 sbp_msg_uart_state_depa_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_uart_state_depa_send(sbp_state_t *s, u16 sender_id, const sbp_msg_uart_state_depa_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_uart_state_depa_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_uart_state_depa_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_uart_state_depa_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_uart_state_depa_t instance * @param b sbp_msg_uart_state_depa_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_uart_state_depa_cmp(const sbp_msg_uart_state_depa_t *a, const sbp_msg_uart_state_depa_t *b); +SBP_EXPORT int sbp_msg_uart_state_depa_cmp(const sbp_msg_uart_state_depa_t *a, + const sbp_msg_uart_state_depa_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_uart_state_depa_t &lhs, const sbp_msg_uart_state_depa_t &rhs) { +static inline bool operator==(const sbp_msg_uart_state_depa_t &lhs, + const sbp_msg_uart_state_depa_t &rhs) { return sbp_msg_uart_state_depa_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_uart_state_depa_t &lhs, const sbp_msg_uart_state_depa_t &rhs) { +static inline bool operator!=(const sbp_msg_uart_state_depa_t &lhs, + const sbp_msg_uart_state_depa_t &rhs) { return sbp_msg_uart_state_depa_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_uart_state_depa_t &lhs, const sbp_msg_uart_state_depa_t &rhs) { +static inline bool operator<(const sbp_msg_uart_state_depa_t &lhs, + const sbp_msg_uart_state_depa_t &rhs) { return sbp_msg_uart_state_depa_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_uart_state_depa_t &lhs, const sbp_msg_uart_state_depa_t &rhs) { +static inline bool operator<=(const sbp_msg_uart_state_depa_t &lhs, + const sbp_msg_uart_state_depa_t &rhs) { return sbp_msg_uart_state_depa_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_uart_state_depa_t &lhs, const sbp_msg_uart_state_depa_t &rhs) { +static inline bool operator>(const sbp_msg_uart_state_depa_t &lhs, + const sbp_msg_uart_state_depa_t &rhs) { return sbp_msg_uart_state_depa_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_uart_state_depa_t &lhs, const sbp_msg_uart_state_depa_t &rhs) { +static inline bool operator>=(const sbp_msg_uart_state_depa_t &lhs, + const sbp_msg_uart_state_depa_t &rhs) { return sbp_msg_uart_state_depa_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_MSG_UART_STATE_DEPA_H */ - diff --git a/c/include/libsbp/piksi/NetworkUsage.h b/c/include/libsbp/piksi/NetworkUsage.h index 0008d8931..95012611d 100644 --- a/c/include/libsbp/piksi/NetworkUsage.h +++ b/c/include/libsbp/piksi/NetworkUsage.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_NETWORKUSAGE_H #define LIBSBP_PIKSI_NETWORKUSAGE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,51 +40,47 @@ *****************************************************************************/ /** Bandwidth usage measurement for a single interface * -* The bandwidth usage for each interface can be reported within this struct and utilize multiple fields to fully specify the type of traffic that is being tracked. As either the interval of collection or the collection time may vary, both a timestamp and period field is provided, though may not necessarily be populated with a value. + * The bandwidth usage for each interface can be reported within this struct and + * utilize multiple fields to fully specify the type of traffic that is being + * tracked. As either the interval of collection or the collection time may + * vary, both a timestamp and period field is provided, though may not + * necessarily be populated with a value. */ typedef struct { - - /** -* Duration over which the measurement was collected [ms] + * Duration over which the measurement was collected [ms] */ u64 duration; - /** -* Number of bytes handled in total within period + * Number of bytes handled in total within period */ u64 total_bytes; - /** -* Number of bytes transmitted within period + * Number of bytes transmitted within period */ u32 rx_bytes; - /** -* Number of bytes received within period + * Number of bytes received within period */ u32 tx_bytes; - /** -* Interface Name + * Interface Name */ char interface_name[SBP_NETWORK_USAGE_INTERFACE_NAME_MAX]; } sbp_network_usage_t; - - /** * Get encoded size of an instance of sbp_network_usage_t * * @param msg sbp_network_usage_t instance * @return Length of on-wire representation */ -static inline size_t sbp_network_usage_encoded_len(const sbp_network_usage_t *msg) -{ +static inline size_t sbp_network_usage_encoded_len( + const sbp_network_usage_t *msg) { (void)msg; return SBP_NETWORK_USAGE_ENCODED_LEN; } @@ -92,74 +88,96 @@ static inline size_t sbp_network_usage_encoded_len(const sbp_network_usage_t *ms /** * Encode an instance of sbp_network_usage_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_network_usage_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_network_usage_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_network_usage_t *msg); +SBP_EXPORT s8 sbp_network_usage_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_network_usage_t *msg); /** * Decode an instance of sbp_network_usage_t from wire representation * - * This function decodes the wire representation of a sbp_network_usage_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_network_usage_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_network_usage_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_network_usage_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_network_usage_t *msg); +SBP_EXPORT s8 sbp_network_usage_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_network_usage_t *msg); /** * Compare two instances of sbp_network_usage_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_network_usage_t instance * @param b sbp_network_usage_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_network_usage_cmp(const sbp_network_usage_t *a, const sbp_network_usage_t *b); +SBP_EXPORT int sbp_network_usage_cmp(const sbp_network_usage_t *a, + const sbp_network_usage_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_network_usage_t &lhs, const sbp_network_usage_t &rhs) { +static inline bool operator==(const sbp_network_usage_t &lhs, + const sbp_network_usage_t &rhs) { return sbp_network_usage_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_network_usage_t &lhs, const sbp_network_usage_t &rhs) { +static inline bool operator!=(const sbp_network_usage_t &lhs, + const sbp_network_usage_t &rhs) { return sbp_network_usage_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_network_usage_t &lhs, const sbp_network_usage_t &rhs) { +static inline bool operator<(const sbp_network_usage_t &lhs, + const sbp_network_usage_t &rhs) { return sbp_network_usage_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_network_usage_t &lhs, const sbp_network_usage_t &rhs) { +static inline bool operator<=(const sbp_network_usage_t &lhs, + const sbp_network_usage_t &rhs) { return sbp_network_usage_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_network_usage_t &lhs, const sbp_network_usage_t &rhs) { +static inline bool operator>(const sbp_network_usage_t &lhs, + const sbp_network_usage_t &rhs) { return sbp_network_usage_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_network_usage_t &lhs, const sbp_network_usage_t &rhs) { +static inline bool operator>=(const sbp_network_usage_t &lhs, + const sbp_network_usage_t &rhs) { return sbp_network_usage_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_NETWORKUSAGE_H */ - diff --git a/c/include/libsbp/piksi/Period.h b/c/include/libsbp/piksi/Period.h index a8fdc45df..2346d574f 100644 --- a/c/include/libsbp/piksi/Period.h +++ b/c/include/libsbp/piksi/Period.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_PERIOD_H #define LIBSBP_PIKSI_PERIOD_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,45 +40,41 @@ *****************************************************************************/ /** base station observation message receipt period * -* Statistics on the period of observations received from the base station. As complete observation sets are received, their time of reception is compared with the prior set''s time of reception. This measurement provides a proxy for link quality as incomplete or missing sets will increase the period. Long periods can cause momentary RTK solution outages. + * Statistics on the period of observations received from the base station. As + * complete observation sets are received, their time of reception is compared + * with the prior set''s time of reception. This measurement provides a proxy + * for link quality as incomplete or missing sets will increase the period. Long + * periods can cause momentary RTK solution outages. */ typedef struct { - - /** -* Average period [ms] + * Average period [ms] */ s32 avg; - /** -* Minimum period [ms] + * Minimum period [ms] */ s32 pmin; - /** -* Maximum period [ms] + * Maximum period [ms] */ s32 pmax; - /** -* Smoothed estimate of the current period [ms] + * Smoothed estimate of the current period [ms] */ s32 current; } sbp_period_t; - - /** * Get encoded size of an instance of sbp_period_t * * @param msg sbp_period_t instance * @return Length of on-wire representation */ -static inline size_t sbp_period_encoded_len(const sbp_period_t *msg) -{ +static inline size_t sbp_period_encoded_len(const sbp_period_t *msg) { (void)msg; return SBP_PERIOD_ENCODED_LEN; } @@ -86,39 +82,53 @@ static inline size_t sbp_period_encoded_len(const sbp_period_t *msg) /** * Encode an instance of sbp_period_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_period_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_period_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_period_t *msg); +SBP_EXPORT s8 sbp_period_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_period_t *msg); /** * Decode an instance of sbp_period_t from wire representation * - * This function decodes the wire representation of a sbp_period_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_period_t message to + * the given instance. The caller must specify the length of the buffer in the + * \p len parameter. If non-null the number of bytes read from the buffer will + * be returned in \p n_read. * * @param buf Wire representation of the sbp_period_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_period_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_period_t *msg); +SBP_EXPORT s8 sbp_period_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_period_t *msg); /** * Compare two instances of sbp_period_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_period_t instance * @param b sbp_period_t instance @@ -127,13 +137,15 @@ SBP_EXPORT s8 sbp_period_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read SBP_EXPORT int sbp_period_cmp(const sbp_period_t *a, const sbp_period_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_period_t &lhs, const sbp_period_t &rhs) { +static inline bool operator==(const sbp_period_t &lhs, + const sbp_period_t &rhs) { return sbp_period_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_period_t &lhs, const sbp_period_t &rhs) { +static inline bool operator!=(const sbp_period_t &lhs, + const sbp_period_t &rhs) { return sbp_period_cmp(&lhs, &rhs) != 0; } @@ -141,7 +153,8 @@ static inline bool operator<(const sbp_period_t &lhs, const sbp_period_t &rhs) { return sbp_period_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_period_t &lhs, const sbp_period_t &rhs) { +static inline bool operator<=(const sbp_period_t &lhs, + const sbp_period_t &rhs) { return sbp_period_cmp(&lhs, &rhs) <= 0; } @@ -149,11 +162,11 @@ static inline bool operator>(const sbp_period_t &lhs, const sbp_period_t &rhs) { return sbp_period_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_period_t &lhs, const sbp_period_t &rhs) { +static inline bool operator>=(const sbp_period_t &lhs, + const sbp_period_t &rhs) { return sbp_period_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_PERIOD_H */ - diff --git a/c/include/libsbp/piksi/UARTChannel.h b/c/include/libsbp/piksi/UARTChannel.h index a88f7ec94..ef5be8826 100644 --- a/c/include/libsbp/piksi/UARTChannel.h +++ b/c/include/libsbp/piksi/UARTChannel.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_PIKSI_UARTCHANNEL_H #define LIBSBP_PIKSI_UARTCHANNEL_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,57 +40,49 @@ *****************************************************************************/ /** State of the UART channel * -* Throughput, utilization, and error counts on the RX/TX buffers of this UART channel. The reported percentage values must be normalized. + * Throughput, utilization, and error counts on the RX/TX buffers of this UART + * channel. The reported percentage values must be normalized. */ typedef struct { - - /** -* UART transmit throughput [kB/s] + * UART transmit throughput [kB/s] */ float tx_throughput; - /** -* UART receive throughput [kB/s] + * UART receive throughput [kB/s] */ float rx_throughput; - /** -* UART CRC error count + * UART CRC error count */ u16 crc_error_count; - /** -* UART IO error count + * UART IO error count */ u16 io_error_count; - /** - * UART transmit buffer percentage utilization (ranges from 0 to 255) + * UART transmit buffer percentage utilization (ranges from 0 to 255) */ u8 tx_buffer_level; - /** - * UART receive buffer percentage utilization (ranges from 0 to 255) + * UART receive buffer percentage utilization (ranges from 0 to 255) */ u8 rx_buffer_level; } sbp_uart_channel_t; - - /** * Get encoded size of an instance of sbp_uart_channel_t * * @param msg sbp_uart_channel_t instance * @return Length of on-wire representation */ -static inline size_t sbp_uart_channel_encoded_len(const sbp_uart_channel_t *msg) -{ +static inline size_t sbp_uart_channel_encoded_len( + const sbp_uart_channel_t *msg) { (void)msg; return SBP_UART_CHANNEL_ENCODED_LEN; } @@ -98,74 +90,95 @@ static inline size_t sbp_uart_channel_encoded_len(const sbp_uart_channel_t *msg) /** * Encode an instance of sbp_uart_channel_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_uart_channel_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_uart_channel_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_uart_channel_t *msg); +SBP_EXPORT s8 sbp_uart_channel_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_uart_channel_t *msg); /** * Decode an instance of sbp_uart_channel_t from wire representation * - * This function decodes the wire representation of a sbp_uart_channel_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_uart_channel_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_uart_channel_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_uart_channel_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_uart_channel_t *msg); +SBP_EXPORT s8 sbp_uart_channel_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_uart_channel_t *msg); /** * Compare two instances of sbp_uart_channel_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_uart_channel_t instance * @param b sbp_uart_channel_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_uart_channel_cmp(const sbp_uart_channel_t *a, const sbp_uart_channel_t *b); +SBP_EXPORT int sbp_uart_channel_cmp(const sbp_uart_channel_t *a, + const sbp_uart_channel_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_uart_channel_t &lhs, const sbp_uart_channel_t &rhs) { +static inline bool operator==(const sbp_uart_channel_t &lhs, + const sbp_uart_channel_t &rhs) { return sbp_uart_channel_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_uart_channel_t &lhs, const sbp_uart_channel_t &rhs) { +static inline bool operator!=(const sbp_uart_channel_t &lhs, + const sbp_uart_channel_t &rhs) { return sbp_uart_channel_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_uart_channel_t &lhs, const sbp_uart_channel_t &rhs) { +static inline bool operator<(const sbp_uart_channel_t &lhs, + const sbp_uart_channel_t &rhs) { return sbp_uart_channel_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_uart_channel_t &lhs, const sbp_uart_channel_t &rhs) { +static inline bool operator<=(const sbp_uart_channel_t &lhs, + const sbp_uart_channel_t &rhs) { return sbp_uart_channel_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_uart_channel_t &lhs, const sbp_uart_channel_t &rhs) { +static inline bool operator>(const sbp_uart_channel_t &lhs, + const sbp_uart_channel_t &rhs) { return sbp_uart_channel_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_uart_channel_t &lhs, const sbp_uart_channel_t &rhs) { +static inline bool operator>=(const sbp_uart_channel_t &lhs, + const sbp_uart_channel_t &rhs) { return sbp_uart_channel_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_PIKSI_UARTCHANNEL_H */ - diff --git a/c/include/libsbp/piksi_macros.h b/c/include/libsbp/piksi_macros.h index efae496ed..651616a3c 100644 --- a/c/include/libsbp/piksi_macros.h +++ b/c/include/libsbp/piksi_macros.h @@ -18,621 +18,783 @@ #ifndef LIBSBP_PIKSI_MACROS_H #define LIBSBP_PIKSI_MACROS_H - #define SBP_MSG_ALMANAC 0x0069 /** - * Encoded length of sbp_msg_almanac_t (V4 API) and + * Encoded length of sbp_msg_almanac_t (V4 API) and * msg_almanac_t (legacy API) */ #define SBP_MSG_ALMANAC_ENCODED_LEN 0u - #define SBP_MSG_SET_TIME 0x0068 /** - * Encoded length of sbp_msg_set_time_t (V4 API) and + * Encoded length of sbp_msg_set_time_t (V4 API) and * msg_set_time_t (legacy API) */ #define SBP_MSG_SET_TIME_ENCODED_LEN 0u - #define SBP_MSG_RESET 0x00B6 #define SBP_RESET_DEFAULT_SETTINGS_MASK (0x1u) #define SBP_RESET_DEFAULT_SETTINGS_SHIFT (0u) -#define SBP_RESET_DEFAULT_SETTINGS_GET(flags) \ - ((u32)((u32)((flags) >> SBP_RESET_DEFAULT_SETTINGS_SHIFT) \ - & SBP_RESET_DEFAULT_SETTINGS_MASK)) -#define SBP_RESET_DEFAULT_SETTINGS_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_RESET_DEFAULT_SETTINGS_MASK << SBP_RESET_DEFAULT_SETTINGS_SHIFT))) | \ - (((val) & (SBP_RESET_DEFAULT_SETTINGS_MASK)) \ - << (SBP_RESET_DEFAULT_SETTINGS_SHIFT)));} while(0) - +#define SBP_RESET_DEFAULT_SETTINGS_GET(flags) \ + ((u32)((u32)((flags) >> SBP_RESET_DEFAULT_SETTINGS_SHIFT) & \ + SBP_RESET_DEFAULT_SETTINGS_MASK)) +#define SBP_RESET_DEFAULT_SETTINGS_SET(flags, val) \ + do { \ + (flags) = (u32)((flags & (~(SBP_RESET_DEFAULT_SETTINGS_MASK \ + << SBP_RESET_DEFAULT_SETTINGS_SHIFT))) | \ + (((val) & (SBP_RESET_DEFAULT_SETTINGS_MASK)) \ + << (SBP_RESET_DEFAULT_SETTINGS_SHIFT))); \ + } while (0) #define SBP_RESET_DEFAULT_SETTINGS_PRESERVE_EXISTING_SETTINGS (0) #define SBP_RESET_DEFAULT_SETTINGS_RESORE_DEFAULT_SETTINGS (1) /** - * Encoded length of sbp_msg_reset_t (V4 API) and + * Encoded length of sbp_msg_reset_t (V4 API) and * msg_reset_t (legacy API) */ #define SBP_MSG_RESET_ENCODED_LEN 4u - #define SBP_MSG_RESET_DEP 0x00B2 /** - * Encoded length of sbp_msg_reset_dep_t (V4 API) and + * Encoded length of sbp_msg_reset_dep_t (V4 API) and * msg_reset_dep_t (legacy API) */ #define SBP_MSG_RESET_DEP_ENCODED_LEN 0u - #define SBP_MSG_CW_RESULTS 0x00C0 /** - * Encoded length of sbp_msg_cw_results_t (V4 API) and + * Encoded length of sbp_msg_cw_results_t (V4 API) and * msg_cw_results_t (legacy API) */ #define SBP_MSG_CW_RESULTS_ENCODED_LEN 0u - #define SBP_MSG_CW_START 0x00C1 /** - * Encoded length of sbp_msg_cw_start_t (V4 API) and + * Encoded length of sbp_msg_cw_start_t (V4 API) and * msg_cw_start_t (legacy API) */ #define SBP_MSG_CW_START_ENCODED_LEN 0u - #define SBP_MSG_RESET_FILTERS 0x0022 #define SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_MASK (0x3u) #define SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_SHIFT (0u) -#define SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_GET(flags) \ - ((u8)((u8)((flags) >> SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_SHIFT) \ - & SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_MASK)) -#define SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_MASK << SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_SHIFT))) | \ - (((val) & (SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_MASK)) \ - << (SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_SHIFT)));} while(0) - +#define SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_GET(flags) \ + ((u8)((u8)((flags) >> SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_SHIFT) & \ + SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_MASK)) +#define SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_MASK \ + << SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_SHIFT))) | \ + (((val) & (SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_MASK)) \ + << (SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_SHIFT))); \ + } while (0) #define SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_DGNSS_FILTER (0) #define SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_IAR_PROCESS (1) #define SBP_RESET_FILTERS_FILTER_OR_PROCESS_TO_RESET_INERTIAL_FILTER (2) /** - * Encoded length of sbp_msg_reset_filters_t (V4 API) and + * Encoded length of sbp_msg_reset_filters_t (V4 API) and * msg_reset_filters_t (legacy API) */ #define SBP_MSG_RESET_FILTERS_ENCODED_LEN 1u - #define SBP_MSG_INIT_BASE_DEP 0x0023 /** - * Encoded length of sbp_msg_init_base_dep_t (V4 API) and + * Encoded length of sbp_msg_init_base_dep_t (V4 API) and * msg_init_base_dep_t (legacy API) */ #define SBP_MSG_INIT_BASE_DEP_ENCODED_LEN 0u - #define SBP_MSG_THREAD_STATE 0x0017 /** - * The maximum number of items that can be stored in sbp_msg_thread_state_t::name (V4 API) or msg_thread_state_t::name (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_thread_state_t::name (V4 API) or msg_thread_state_t::name (legacy + * API) before the maximum SBP message size is exceeded */ #define SBP_MSG_THREAD_STATE_NAME_MAX 20u - /** - * Encoded length of sbp_msg_thread_state_t (V4 API) and + * Encoded length of sbp_msg_thread_state_t (V4 API) and * msg_thread_state_t (legacy API) */ #define SBP_MSG_THREAD_STATE_ENCODED_LEN 26u - /** - * Encoded length of sbp_uart_channel_t (V4 API) and + * Encoded length of sbp_uart_channel_t (V4 API) and * uart_channel_t (legacy API) */ #define SBP_UART_CHANNEL_ENCODED_LEN 14u - /** - * Encoded length of sbp_period_t (V4 API) and + * Encoded length of sbp_period_t (V4 API) and * period_t (legacy API) */ #define SBP_PERIOD_ENCODED_LEN 16u - /** - * Encoded length of sbp_latency_t (V4 API) and + * Encoded length of sbp_latency_t (V4 API) and * latency_t (legacy API) */ #define SBP_LATENCY_ENCODED_LEN 16u - #define SBP_MSG_UART_STATE 0x001D /** - * Encoded length of sbp_msg_uart_state_t (V4 API) and + * Encoded length of sbp_msg_uart_state_t (V4 API) and * msg_uart_state_t (legacy API) */ #define SBP_MSG_UART_STATE_ENCODED_LEN 74u - #define SBP_MSG_UART_STATE_DEPA 0x0018 /** - * Encoded length of sbp_msg_uart_state_depa_t (V4 API) and + * Encoded length of sbp_msg_uart_state_depa_t (V4 API) and * msg_uart_state_depa_t (legacy API) */ #define SBP_MSG_UART_STATE_DEPA_ENCODED_LEN 58u - #define SBP_MSG_IAR_STATE 0x0019 /** - * Encoded length of sbp_msg_iar_state_t (V4 API) and + * Encoded length of sbp_msg_iar_state_t (V4 API) and * msg_iar_state_t (legacy API) */ #define SBP_MSG_IAR_STATE_ENCODED_LEN 4u - #define SBP_MSG_MASK_SATELLITE 0x002B #define SBP_MASK_SATELLITE_TRACKING_CHANNELS_MASK (0x1u) #define SBP_MASK_SATELLITE_TRACKING_CHANNELS_SHIFT (1u) -#define SBP_MASK_SATELLITE_TRACKING_CHANNELS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_MASK_SATELLITE_TRACKING_CHANNELS_SHIFT) \ - & SBP_MASK_SATELLITE_TRACKING_CHANNELS_MASK)) -#define SBP_MASK_SATELLITE_TRACKING_CHANNELS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_MASK_SATELLITE_TRACKING_CHANNELS_MASK << SBP_MASK_SATELLITE_TRACKING_CHANNELS_SHIFT))) | \ - (((val) & (SBP_MASK_SATELLITE_TRACKING_CHANNELS_MASK)) \ - << (SBP_MASK_SATELLITE_TRACKING_CHANNELS_SHIFT)));} while(0) - +#define SBP_MASK_SATELLITE_TRACKING_CHANNELS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_MASK_SATELLITE_TRACKING_CHANNELS_SHIFT) & \ + SBP_MASK_SATELLITE_TRACKING_CHANNELS_MASK)) +#define SBP_MASK_SATELLITE_TRACKING_CHANNELS_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_MASK_SATELLITE_TRACKING_CHANNELS_MASK \ + << SBP_MASK_SATELLITE_TRACKING_CHANNELS_SHIFT))) | \ + (((val) & (SBP_MASK_SATELLITE_TRACKING_CHANNELS_MASK)) \ + << (SBP_MASK_SATELLITE_TRACKING_CHANNELS_SHIFT))); \ + } while (0) #define SBP_MASK_SATELLITE_TRACKING_CHANNELS_ENABLED (0) -#define SBP_MASK_SATELLITE_TRACKING_CHANNELS_DROP_THIS_PRN_IF_CURRENTLY_TRACKING (1) +#define SBP_MASK_SATELLITE_TRACKING_CHANNELS_DROP_THIS_PRN_IF_CURRENTLY_TRACKING \ + (1) #define SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_MASK (0x1u) #define SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_SHIFT (0u) -#define SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_GET(flags) \ - ((u8)((u8)((flags) >> SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_SHIFT) \ - & SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_MASK)) -#define SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_MASK << SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_SHIFT))) | \ - (((val) & (SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_MASK)) \ - << (SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_SHIFT)));} while(0) - +#define SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_GET(flags) \ + ((u8)((u8)((flags) >> SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_SHIFT) & \ + SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_MASK)) +#define SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_MASK \ + << SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_SHIFT))) | \ + (((val) & (SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_MASK)) \ + << (SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_SHIFT))); \ + } while (0) #define SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_ENABLED (0) -#define SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_SKIP_THIS_SATELLITE_ON_FUTURE_ACQUISITIONS (1) +#define SBP_MASK_SATELLITE_ACQUISITION_CHANNEL_SKIP_THIS_SATELLITE_ON_FUTURE_ACQUISITIONS \ + (1) /** - * Encoded length of sbp_msg_mask_satellite_t (V4 API) and + * Encoded length of sbp_msg_mask_satellite_t (V4 API) and * msg_mask_satellite_t (legacy API) */ #define SBP_MSG_MASK_SATELLITE_ENCODED_LEN 3u - #define SBP_MSG_MASK_SATELLITE_DEP 0x001B #define SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_MASK (0x1u) #define SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_SHIFT (1u) -#define SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_SHIFT) \ - & SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_MASK)) -#define SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_MASK << SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_SHIFT))) | \ - (((val) & (SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_MASK)) \ - << (SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_SHIFT)));} while(0) - +#define SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_SHIFT) & \ + SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_MASK)) +#define SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_MASK \ + << SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_SHIFT))) | \ + (((val) & (SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_MASK)) \ + << (SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_SHIFT))); \ + } while (0) #define SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_ENABLED (0) -#define SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_DROP_THIS_PRN_IF_CURRENTLY_TRACKING (1) +#define SBP_MASK_SATELLITE_DEP_TRACKING_CHANNELS_DROP_THIS_PRN_IF_CURRENTLY_TRACKING \ + (1) #define SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_MASK (0x1u) #define SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_SHIFT (0u) -#define SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_GET(flags) \ - ((u8)((u8)((flags) >> SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_SHIFT) \ - & SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_MASK)) -#define SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_MASK << SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_SHIFT))) | \ - (((val) & (SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_MASK)) \ - << (SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_SHIFT)));} while(0) - +#define SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_GET(flags) \ + ((u8)((u8)((flags) >> SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_SHIFT) & \ + SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_MASK)) +#define SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_MASK \ + << SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_SHIFT))) | \ + (((val) & (SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_MASK)) \ + << (SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_SHIFT))); \ + } while (0) #define SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_ENABLED (0) -#define SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_SKIP_THIS_SATELLITE_ON_FUTURE_ACQUISITIONS (1) +#define SBP_MASK_SATELLITE_DEP_ACQUISITION_CHANNEL_SKIP_THIS_SATELLITE_ON_FUTURE_ACQUISITIONS \ + (1) /** - * Encoded length of sbp_msg_mask_satellite_dep_t (V4 API) and + * Encoded length of sbp_msg_mask_satellite_dep_t (V4 API) and * msg_mask_satellite_dep_t (legacy API) */ #define SBP_MSG_MASK_SATELLITE_DEP_ENCODED_LEN 5u - #define SBP_MSG_DEVICE_MONITOR 0x00B5 /** - * Encoded length of sbp_msg_device_monitor_t (V4 API) and + * Encoded length of sbp_msg_device_monitor_t (V4 API) and * msg_device_monitor_t (legacy API) */ #define SBP_MSG_DEVICE_MONITOR_ENCODED_LEN 10u - #define SBP_MSG_COMMAND_REQ 0x00B8 /** - * The maximum number of items that can be stored in sbp_msg_command_req_t::command (V4 API) or msg_command_req_t::command (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_command_req_t::command (V4 API) or msg_command_req_t::command (legacy + * API) before the maximum SBP message size is exceeded */ #define SBP_MSG_COMMAND_REQ_COMMAND_MAX 251u - /** - * Encoded length of sbp_msg_command_req_t (V4 API) and + * Encoded length of sbp_msg_command_req_t (V4 API) and * msg_command_req_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_command_req_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_command_req_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_COMMAND_REQ_ENCODED_OVERHEAD 4u - #define SBP_MSG_COMMAND_RESP 0x00B9 /** - * Encoded length of sbp_msg_command_resp_t (V4 API) and + * Encoded length of sbp_msg_command_resp_t (V4 API) and * msg_command_resp_t (legacy API) */ #define SBP_MSG_COMMAND_RESP_ENCODED_LEN 8u - #define SBP_MSG_COMMAND_OUTPUT 0x00BC /** - * The maximum number of items that can be stored in sbp_msg_command_output_t::line (V4 API) or msg_command_output_t::line (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_command_output_t::line (V4 API) or msg_command_output_t::line (legacy + * API) before the maximum SBP message size is exceeded */ #define SBP_MSG_COMMAND_OUTPUT_LINE_MAX 251u - /** - * Encoded length of sbp_msg_command_output_t (V4 API) and + * Encoded length of sbp_msg_command_output_t (V4 API) and * msg_command_output_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_command_output_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_command_output_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_COMMAND_OUTPUT_ENCODED_OVERHEAD 4u - #define SBP_MSG_NETWORK_STATE_REQ 0x00BA /** - * Encoded length of sbp_msg_network_state_req_t (V4 API) and + * Encoded length of sbp_msg_network_state_req_t (V4 API) and * msg_network_state_req_t (legacy API) */ #define SBP_MSG_NETWORK_STATE_REQ_ENCODED_LEN 0u - #define SBP_MSG_NETWORK_STATE_RESP 0x00BB /** - * The maximum number of items that can be stored in sbp_msg_network_state_resp_t::ipv4_address (V4 API) or msg_network_state_resp_t::ipv4_address (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_network_state_resp_t::ipv4_address (V4 API) or + * msg_network_state_resp_t::ipv4_address (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_NETWORK_STATE_RESP_IPV4_ADDRESS_MAX 4u - /** - * The maximum number of items that can be stored in sbp_msg_network_state_resp_t::ipv6_address (V4 API) or msg_network_state_resp_t::ipv6_address (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_network_state_resp_t::ipv6_address (V4 API) or + * msg_network_state_resp_t::ipv6_address (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_NETWORK_STATE_RESP_IPV6_ADDRESS_MAX 16u - /** - * The maximum number of items that can be stored in sbp_msg_network_state_resp_t::interface_name (V4 API) or msg_network_state_resp_t::interface_name (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_network_state_resp_t::interface_name (V4 API) or + * msg_network_state_resp_t::interface_name (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_NETWORK_STATE_RESP_INTERFACE_NAME_MAX 16u - #define SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_MASK (0x1u) #define SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_SHIFT (15u) -#define SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_MASK << SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_SHIFT)));} while(0) - +#define SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_GET(flags) \ + ((u32)( \ + (u32)((flags) >> \ + SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_SET(flags, \ + val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_SHIFT))) | \ + (((val) & \ + (SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_MULTICAST__SUPPORTS_MULTICAST_SHIFT))); \ + } while (0) #define SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_MASK (0x1u) #define SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_SHIFT (14u) -#define SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_MASK << SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_SHIFT)));} while(0) - +#define SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_GET( \ + flags) \ + ((u32)( \ + (u32)( \ + (flags) >> \ + SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_SET( \ + flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_SHIFT))) | \ + (((val) & \ + (SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_LINK2__PER_LINK_LAYER_DEFINED_BIT_SHIFT))); \ + } while (0) #define SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_MASK (0x1u) #define SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_SHIFT (13u) -#define SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_MASK << SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_SHIFT)));} while(0) - +#define SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_GET( \ + flags) \ + ((u32)( \ + (u32)( \ + (flags) >> \ + SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_SET( \ + flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_SHIFT))) | \ + (((val) & \ + (SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_LINK1__PER_LINK_LAYER_DEFINED_BIT_SHIFT))); \ + } while (0) #define SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_MASK (0x1u) #define SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_SHIFT (12u) -#define SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_MASK << SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_SHIFT)));} while(0) - - -#define SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_MASK (0x1u) -#define SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_SHIFT (11u) -#define SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_MASK << SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_SHIFT)));} while(0) - +#define SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_GET( \ + flags) \ + ((u32)( \ + (u32)( \ + (flags) >> \ + SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_SET( \ + flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_SHIFT))) | \ + (((val) & \ + (SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_LINK0__PER_LINK_LAYER_DEFINED_BIT_SHIFT))); \ + } while (0) + +#define SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_MASK \ + (0x1u) +#define SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_SHIFT \ + (11u) +#define SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_GET( \ + flags) \ + ((u32)( \ + (u32)( \ + (flags) >> \ + SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_SET( \ + flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_SHIFT))) | \ + (((val) & \ + (SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_SIMPLEX__CANT_HEAR_OWN_TRANSMISSIONS_SHIFT))); \ + } while (0) #define SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_MASK (0x1u) #define SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_SHIFT (10u) -#define SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_MASK << SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_SHIFT)));} while(0) - - -#define SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_MASK (0x1u) -#define SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_SHIFT (9u) -#define SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_MASK << SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_SHIFT)));} while(0) - +#define SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_GET( \ + flags) \ + ((u32)( \ + (u32)( \ + (flags) >> \ + SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_SET( \ + flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_SHIFT))) | \ + (((val) & \ + (SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_OACTIVE__TRANSMISSION_IN_PROGRESS_SHIFT))); \ + } while (0) + +#define SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_MASK \ + (0x1u) +#define SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_SHIFT \ + (9u) +#define SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_GET( \ + flags) \ + ((u32)( \ + (u32)( \ + (flags) >> \ + SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_SET( \ + flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_SHIFT))) | \ + (((val) & \ + (SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_ALLMULTI__RECEIVE_ALL_MULTICAST_PACKETS_SHIFT))); \ + } while (0) #define SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_MASK (0x1u) #define SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_SHIFT (8u) -#define SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_MASK << SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_SHIFT)));} while(0) - - -#define SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_MASK (0x1u) -#define SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_SHIFT (7u) -#define SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_MASK << SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_SHIFT)));} while(0) - +#define SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_GET(flags) \ + ((u32)( \ + (u32)((flags) >> \ + SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_SET(flags, \ + val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_SHIFT))) | \ + (((val) & \ + (SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_PROMISC__RECEIVE_ALL_PACKETS_SHIFT))); \ + } while (0) + +#define SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_MASK \ + (0x1u) +#define SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_SHIFT \ + (7u) +#define SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_GET( \ + flags) \ + ((u32)( \ + (u32)( \ + (flags) >> \ + SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_SET( \ + flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_SHIFT))) | \ + (((val) & \ + (SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_NOARP__NO_ADDRESS_RESOLUTION_PROTOCOL_SHIFT))); \ + } while (0) #define SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_MASK (0x1u) #define SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_SHIFT (6u) -#define SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_MASK << SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_SHIFT)));} while(0) - +#define SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_GET(flags) \ + ((u32)( \ + (u32)((flags) >> \ + SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_SET(flags, \ + val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_SHIFT))) | \ + (((val) & \ + (SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_RUNNING__RESOURCES_ALLOCATED_SHIFT))); \ + } while (0) #define SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_MASK (0x1u) #define SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_SHIFT (5u) -#define SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_MASK << SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_SHIFT)));} while(0) - - -#define SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_MASK (0x1u) -#define SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_SHIFT (4u) -#define SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_MASK << SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_SHIFT)));} while(0) - +#define SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_GET( \ + flags) \ + ((u32)( \ + (u32)( \ + (flags) >> \ + SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_SET( \ + flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_SHIFT))) | \ + (((val) & \ + (SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_NOTRAILERS__AVOID_USE_OF_TRAILERS_SHIFT))); \ + } while (0) + +#define SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_MASK \ + (0x1u) +#define SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_SHIFT \ + (4u) +#define SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_GET( \ + flags) \ + ((u32)( \ + (u32)( \ + (flags) >> \ + SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_SET( \ + flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_SHIFT))) | \ + (((val) & \ + (SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_POINTOPOINT__INTERFACE_IS_POINTTOPOINT_LINK_SHIFT))); \ + } while (0) #define SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_MASK (0x1u) #define SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_SHIFT (3u) -#define SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_MASK << SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_SHIFT)));} while(0) - +#define SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_GET(flags) \ + ((u32)((u32)((flags) >> \ + SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_SET(flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_SHIFT))) | \ + (((val) & \ + (SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_LOOPBACK__IS_A_LOOPBACK_NET_SHIFT))); \ + } while (0) #define SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_MASK (0x1u) #define SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_SHIFT (2u) -#define SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_MASK << SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_SHIFT)));} while(0) - - -#define SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_MASK (0x1u) +#define SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_GET(flags) \ + ((u32)( \ + (u32)((flags) >> \ + SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_SET(flags, \ + val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_SHIFT))) | \ + (((val) & \ + (SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_DEBUG__BROADCAST_ADDRESS_VALID_SHIFT))); \ + } while (0) + +#define SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_MASK \ + (0x1u) #define SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_SHIFT (1u) -#define SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_MASK << SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_SHIFT)));} while(0) - +#define SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_GET( \ + flags) \ + ((u32)( \ + (u32)( \ + (flags) >> \ + SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_SET( \ + flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_SHIFT))) | \ + (((val) & \ + (SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_BROADCAST__BROADCAST_ADDRESS_VALID_SHIFT))); \ + } while (0) #define SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_MASK (0x1u) #define SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_SHIFT (0u) -#define SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_GET(flags) \ - ((u32)((u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_SHIFT) \ - & SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_MASK)) -#define SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_MASK << SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_SHIFT))) | \ - (((val) & (SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_MASK)) \ - << (SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_SHIFT)));} while(0) - - -/** - * Encoded length of sbp_msg_network_state_resp_t (V4 API) and +#define SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_GET(flags) \ + ((u32)( \ + (u32)((flags) >> SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_SHIFT) & \ + SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_MASK)) +#define SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_SET(flags, val) \ + do { \ + (flags) = \ + (u32)((flags & \ + (~(SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_MASK \ + << SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_SHIFT))) | \ + (((val) & (SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_MASK)) \ + << (SBP_NETWORK_STATE_RESP_IFF_UP__INTERFACE_IS_UP_SHIFT))); \ + } while (0) + +/** + * Encoded length of sbp_msg_network_state_resp_t (V4 API) and * msg_network_state_resp_t (legacy API) */ #define SBP_MSG_NETWORK_STATE_RESP_ENCODED_LEN 50u - /** - * The maximum number of items that can be stored in sbp_network_usage_t::interface_name (V4 API) or network_usage_t::interface_name (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_network_usage_t::interface_name (V4 API) or + * network_usage_t::interface_name (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_NETWORK_USAGE_INTERFACE_NAME_MAX 16u - /** - * Encoded length of sbp_network_usage_t (V4 API) and + * Encoded length of sbp_network_usage_t (V4 API) and * network_usage_t (legacy API) */ #define SBP_NETWORK_USAGE_ENCODED_LEN 40u - #define SBP_MSG_NETWORK_BANDWIDTH_USAGE 0x00BD /** - * The maximum number of items that can be stored in sbp_msg_network_bandwidth_usage_t::interfaces (V4 API) or msg_network_bandwidth_usage_t::interfaces (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_network_bandwidth_usage_t::interfaces (V4 API) or + * msg_network_bandwidth_usage_t::interfaces (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_NETWORK_BANDWIDTH_USAGE_INTERFACES_MAX 6u - /** - * Encoded length of sbp_msg_network_bandwidth_usage_t (V4 API) and + * Encoded length of sbp_msg_network_bandwidth_usage_t (V4 API) and * msg_network_bandwidth_usage_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_network_bandwidth_usage_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_network_bandwidth_usage_encoded_len to determine the actual size of + * an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_NETWORK_BANDWIDTH_USAGE_ENCODED_OVERHEAD 0u - #define SBP_MSG_CELL_MODEM_STATUS 0x00BE /** - * The maximum number of items that can be stored in sbp_msg_cell_modem_status_t::reserved (V4 API) or msg_cell_modem_status_t::reserved (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_cell_modem_status_t::reserved (V4 API) or + * msg_cell_modem_status_t::reserved (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_CELL_MODEM_STATUS_RESERVED_MAX 250u - /** - * Encoded length of sbp_msg_cell_modem_status_t (V4 API) and + * Encoded length of sbp_msg_cell_modem_status_t (V4 API) and * msg_cell_modem_status_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_cell_modem_status_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_cell_modem_status_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_CELL_MODEM_STATUS_ENCODED_OVERHEAD 5u - #define SBP_MSG_SPECAN_DEP 0x0050 /** - * The maximum number of items that can be stored in sbp_msg_specan_dep_t::amplitude_value (V4 API) or msg_specan_dep_t::amplitude_value (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_specan_dep_t::amplitude_value (V4 API) or + * msg_specan_dep_t::amplitude_value (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_SPECAN_DEP_AMPLITUDE_VALUE_MAX 231u - /** - * Encoded length of sbp_msg_specan_dep_t (V4 API) and + * Encoded length of sbp_msg_specan_dep_t (V4 API) and * msg_specan_dep_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_specan_dep_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_specan_dep_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SPECAN_DEP_ENCODED_OVERHEAD 24u - #define SBP_MSG_SPECAN 0x0051 /** - * The maximum number of items that can be stored in sbp_msg_specan_t::amplitude_value (V4 API) or msg_specan_t::amplitude_value (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_specan_t::amplitude_value (V4 API) or msg_specan_t::amplitude_value + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_SPECAN_AMPLITUDE_VALUE_MAX 227u - /** - * Encoded length of sbp_msg_specan_t (V4 API) and + * Encoded length of sbp_msg_specan_t (V4 API) and * msg_specan_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_specan_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_specan_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SPECAN_ENCODED_OVERHEAD 28u - #define SBP_MSG_FRONT_END_GAIN 0x00BF /** - * The maximum number of items that can be stored in sbp_msg_front_end_gain_t::rf_gain (V4 API) or msg_front_end_gain_t::rf_gain (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_front_end_gain_t::rf_gain (V4 API) or msg_front_end_gain_t::rf_gain + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_FRONT_END_GAIN_RF_GAIN_MAX 8u - /** - * The maximum number of items that can be stored in sbp_msg_front_end_gain_t::if_gain (V4 API) or msg_front_end_gain_t::if_gain (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_front_end_gain_t::if_gain (V4 API) or msg_front_end_gain_t::if_gain + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_FRONT_END_GAIN_IF_GAIN_MAX 8u - /** - * Encoded length of sbp_msg_front_end_gain_t (V4 API) and + * Encoded length of sbp_msg_front_end_gain_t (V4 API) and * msg_front_end_gain_t (legacy API) */ #define SBP_MSG_FRONT_END_GAIN_ENCODED_LEN 16u - - #endif /* LIBSBP_PIKSI_MACROS_H */ diff --git a/c/include/libsbp/sbas/MSG_SBAS_RAW.h b/c/include/libsbp/sbas/MSG_SBAS_RAW.h index 3e155e7aa..36f574a84 100644 --- a/c/include/libsbp/sbas/MSG_SBAS_RAW.h +++ b/c/include/libsbp/sbas/MSG_SBAS_RAW.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SBAS_MSG_SBAS_RAW_H #define LIBSBP_SBAS_MSG_SBAS_RAW_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,45 +41,39 @@ *****************************************************************************/ /** Raw SBAS data * -* This message is sent once per second per SBAS satellite. ME checks the parity of the data block and sends only blocks that pass the check. + * This message is sent once per second per SBAS satellite. ME checks the parity + * of the data block and sends only blocks that pass the check. */ typedef struct { - - /** -* GNSS signal identifier. + * GNSS signal identifier. */ sbp_v4_gnss_signal_t sid; - /** -* GPS time-of-week at the start of the data block. [ms] + * GPS time-of-week at the start of the data block. [ms] */ u32 tow; - /** -* SBAS message type (0-63) + * SBAS message type (0-63) */ u8 message_type; - /** -* Raw SBAS data field of 212 bits (last byte padded with zeros). + * Raw SBAS data field of 212 bits (last byte padded with zeros). */ u8 data[SBP_MSG_SBAS_RAW_DATA_MAX]; } sbp_msg_sbas_raw_t; - - /** * Get encoded size of an instance of sbp_msg_sbas_raw_t * * @param msg sbp_msg_sbas_raw_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_sbas_raw_encoded_len(const sbp_msg_sbas_raw_t *msg) -{ +static inline size_t sbp_msg_sbas_raw_encoded_len( + const sbp_msg_sbas_raw_t *msg) { (void)msg; return SBP_MSG_SBAS_RAW_ENCODED_LEN; } @@ -87,36 +81,52 @@ static inline size_t sbp_msg_sbas_raw_encoded_len(const sbp_msg_sbas_raw_t *msg) /** * Encode an instance of sbp_msg_sbas_raw_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_sbas_raw_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_sbas_raw_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_sbas_raw_t *msg); +SBP_EXPORT s8 sbp_msg_sbas_raw_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_sbas_raw_t *msg); /** * Decode an instance of sbp_msg_sbas_raw_t from wire representation * - * This function decodes the wire representation of a sbp_msg_sbas_raw_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_sbas_raw_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_sbas_raw_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_sbas_raw_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_sbas_raw_t *msg); +SBP_EXPORT s8 sbp_msg_sbas_raw_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_sbas_raw_t *msg); /** * Send an instance of sbp_msg_sbas_raw_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_sbas_raw_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_sbas_raw_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -124,51 +134,61 @@ SBP_EXPORT s8 sbp_msg_sbas_raw_decode(const uint8_t *buf, uint8_t len, uint8_t * * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_sbas_raw_send(sbp_state_t *s, u16 sender_id, const sbp_msg_sbas_raw_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_sbas_raw_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_sbas_raw_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_sbas_raw_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_sbas_raw_t instance * @param b sbp_msg_sbas_raw_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_sbas_raw_cmp(const sbp_msg_sbas_raw_t *a, const sbp_msg_sbas_raw_t *b); +SBP_EXPORT int sbp_msg_sbas_raw_cmp(const sbp_msg_sbas_raw_t *a, + const sbp_msg_sbas_raw_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_sbas_raw_t &lhs, const sbp_msg_sbas_raw_t &rhs) { +static inline bool operator==(const sbp_msg_sbas_raw_t &lhs, + const sbp_msg_sbas_raw_t &rhs) { return sbp_msg_sbas_raw_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_sbas_raw_t &lhs, const sbp_msg_sbas_raw_t &rhs) { +static inline bool operator!=(const sbp_msg_sbas_raw_t &lhs, + const sbp_msg_sbas_raw_t &rhs) { return sbp_msg_sbas_raw_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_sbas_raw_t &lhs, const sbp_msg_sbas_raw_t &rhs) { +static inline bool operator<(const sbp_msg_sbas_raw_t &lhs, + const sbp_msg_sbas_raw_t &rhs) { return sbp_msg_sbas_raw_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_sbas_raw_t &lhs, const sbp_msg_sbas_raw_t &rhs) { +static inline bool operator<=(const sbp_msg_sbas_raw_t &lhs, + const sbp_msg_sbas_raw_t &rhs) { return sbp_msg_sbas_raw_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_sbas_raw_t &lhs, const sbp_msg_sbas_raw_t &rhs) { +static inline bool operator>(const sbp_msg_sbas_raw_t &lhs, + const sbp_msg_sbas_raw_t &rhs) { return sbp_msg_sbas_raw_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_sbas_raw_t &lhs, const sbp_msg_sbas_raw_t &rhs) { +static inline bool operator>=(const sbp_msg_sbas_raw_t &lhs, + const sbp_msg_sbas_raw_t &rhs) { return sbp_msg_sbas_raw_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SBAS_MSG_SBAS_RAW_H */ - diff --git a/c/include/libsbp/sbas_macros.h b/c/include/libsbp/sbas_macros.h index feaec9dc3..1457e8dd7 100644 --- a/c/include/libsbp/sbas_macros.h +++ b/c/include/libsbp/sbas_macros.h @@ -18,20 +18,18 @@ #ifndef LIBSBP_SBAS_MACROS_H #define LIBSBP_SBAS_MACROS_H - #define SBP_MSG_SBAS_RAW 0x7777 /** - * The maximum number of items that can be stored in sbp_msg_sbas_raw_t::data (V4 API) or msg_sbas_raw_t::data (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in sbp_msg_sbas_raw_t::data + * (V4 API) or msg_sbas_raw_t::data (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_SBAS_RAW_DATA_MAX 27u - /** - * Encoded length of sbp_msg_sbas_raw_t (V4 API) and + * Encoded length of sbp_msg_sbas_raw_t (V4 API) and * msg_sbas_raw_t (legacy API) */ #define SBP_MSG_SBAS_RAW_ENCODED_LEN 34u - - #endif /* LIBSBP_SBAS_MACROS_H */ diff --git a/c/include/libsbp/sbp_msg.h b/c/include/libsbp/sbp_msg.h index 51a4fdb83..b51ed6054 100644 --- a/c/include/libsbp/sbp_msg.h +++ b/c/include/libsbp/sbp_msg.h @@ -11,7 +11,7 @@ */ /***************************************************************************** - * Automatically generated + * Automatically generated * with generate.py. Please do not hand edit! *****************************************************************************/ @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -40,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -51,11 +51,10 @@ #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif - - /* +/* * Used to hold an individual sbp_msg struct so that the message can be used in * all general purpose functions within this file. */ @@ -240,9 +239,11 @@ typedef union { sbp_msg_ssr_grid_definition_dep_a_t ssr_grid_definition_dep_a; sbp_msg_ssr_gridded_correction_bounds_t ssr_gridded_correction_bounds; sbp_msg_ssr_gridded_correction_dep_a_t ssr_gridded_correction_dep_a; - sbp_msg_ssr_gridded_correction_no_std_dep_a_t ssr_gridded_correction_no_std_dep_a; + sbp_msg_ssr_gridded_correction_no_std_dep_a_t + ssr_gridded_correction_no_std_dep_a; sbp_msg_ssr_gridded_correction_t ssr_gridded_correction; - sbp_msg_ssr_orbit_clock_bounds_degradation_t ssr_orbit_clock_bounds_degradation; + sbp_msg_ssr_orbit_clock_bounds_degradation_t + ssr_orbit_clock_bounds_degradation; sbp_msg_ssr_orbit_clock_bounds_t ssr_orbit_clock_bounds; sbp_msg_ssr_orbit_clock_dep_a_t ssr_orbit_clock_dep_a; sbp_msg_ssr_orbit_clock_t ssr_orbit_clock; @@ -295,8 +296,8 @@ typedef union { sbp_msg_wheeltick_t wheeltick; } sbp_msg_t; - -/** Encodes a SBP message to the SBP wire format, writing it to the given buffer. +/** Encodes a SBP message to the SBP wire format, writing it to the given + * buffer. * * \param buf Buffer to write the resulting encoded data to * \param len The amount of bytes available in buf @@ -304,175 +305,246 @@ typedef union { * \param msg_type SBP message type * \param msg SBP message to encode * \return `SBP_ENCODE_ERROR` (-7) if message was unable to be encoded - * `SBP_OK` (0) if the message was successfully encoded and written to buf - * callback + * `SBP_OK` (0) if the message was successfully encoded and written to + * buf callback */ -static inline s8 sbp_message_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, sbp_msg_type_t msg_type, const sbp_msg_t *msg) { - switch(msg_type) { +static inline s8 sbp_message_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, sbp_msg_type_t msg_type, + const sbp_msg_t *msg) { + switch (msg_type) { case SbpMsgAcknowledge: return sbp_msg_acknowledge_encode(buf, len, n_written, &msg->acknowledge); case SbpMsgAcqResultDepA: - return sbp_msg_acq_result_dep_a_encode(buf, len, n_written, &msg->acq_result_dep_a); + return sbp_msg_acq_result_dep_a_encode(buf, len, n_written, + &msg->acq_result_dep_a); case SbpMsgAcqResultDepB: - return sbp_msg_acq_result_dep_b_encode(buf, len, n_written, &msg->acq_result_dep_b); + return sbp_msg_acq_result_dep_b_encode(buf, len, n_written, + &msg->acq_result_dep_b); case SbpMsgAcqResultDepC: - return sbp_msg_acq_result_dep_c_encode(buf, len, n_written, &msg->acq_result_dep_c); + return sbp_msg_acq_result_dep_c_encode(buf, len, n_written, + &msg->acq_result_dep_c); case SbpMsgAcqResult: return sbp_msg_acq_result_encode(buf, len, n_written, &msg->acq_result); case SbpMsgAcqSvProfileDep: - return sbp_msg_acq_sv_profile_dep_encode(buf, len, n_written, &msg->acq_sv_profile_dep); + return sbp_msg_acq_sv_profile_dep_encode(buf, len, n_written, + &msg->acq_sv_profile_dep); case SbpMsgAcqSvProfile: - return sbp_msg_acq_sv_profile_encode(buf, len, n_written, &msg->acq_sv_profile); + return sbp_msg_acq_sv_profile_encode(buf, len, n_written, + &msg->acq_sv_profile); case SbpMsgAgeCorrections: - return sbp_msg_age_corrections_encode(buf, len, n_written, &msg->age_corrections); + return sbp_msg_age_corrections_encode(buf, len, n_written, + &msg->age_corrections); case SbpMsgAlmanacGloDep: - return sbp_msg_almanac_glo_dep_encode(buf, len, n_written, &msg->almanac_glo_dep); + return sbp_msg_almanac_glo_dep_encode(buf, len, n_written, + &msg->almanac_glo_dep); case SbpMsgAlmanacGlo: return sbp_msg_almanac_glo_encode(buf, len, n_written, &msg->almanac_glo); case SbpMsgAlmanacGpsDep: - return sbp_msg_almanac_gps_dep_encode(buf, len, n_written, &msg->almanac_gps_dep); + return sbp_msg_almanac_gps_dep_encode(buf, len, n_written, + &msg->almanac_gps_dep); case SbpMsgAlmanacGps: return sbp_msg_almanac_gps_encode(buf, len, n_written, &msg->almanac_gps); case SbpMsgAlmanac: return sbp_msg_almanac_encode(buf, len, n_written, &msg->almanac); case SbpMsgAngularRate: - return sbp_msg_angular_rate_encode(buf, len, n_written, &msg->angular_rate); + return sbp_msg_angular_rate_encode(buf, len, n_written, + &msg->angular_rate); case SbpMsgBasePosEcef: - return sbp_msg_base_pos_ecef_encode(buf, len, n_written, &msg->base_pos_ecef); + return sbp_msg_base_pos_ecef_encode(buf, len, n_written, + &msg->base_pos_ecef); case SbpMsgBasePosLlh: - return sbp_msg_base_pos_llh_encode(buf, len, n_written, &msg->base_pos_llh); + return sbp_msg_base_pos_llh_encode(buf, len, n_written, + &msg->base_pos_llh); case SbpMsgBaselineEcefDepA: - return sbp_msg_baseline_ecef_dep_a_encode(buf, len, n_written, &msg->baseline_ecef_dep_a); + return sbp_msg_baseline_ecef_dep_a_encode(buf, len, n_written, + &msg->baseline_ecef_dep_a); case SbpMsgBaselineEcef: - return sbp_msg_baseline_ecef_encode(buf, len, n_written, &msg->baseline_ecef); + return sbp_msg_baseline_ecef_encode(buf, len, n_written, + &msg->baseline_ecef); case SbpMsgBaselineHeadingDepA: - return sbp_msg_baseline_heading_dep_a_encode(buf, len, n_written, &msg->baseline_heading_dep_a); + return sbp_msg_baseline_heading_dep_a_encode( + buf, len, n_written, &msg->baseline_heading_dep_a); case SbpMsgBaselineHeading: - return sbp_msg_baseline_heading_encode(buf, len, n_written, &msg->baseline_heading); + return sbp_msg_baseline_heading_encode(buf, len, n_written, + &msg->baseline_heading); case SbpMsgBaselineNedDepA: - return sbp_msg_baseline_ned_dep_a_encode(buf, len, n_written, &msg->baseline_ned_dep_a); + return sbp_msg_baseline_ned_dep_a_encode(buf, len, n_written, + &msg->baseline_ned_dep_a); case SbpMsgBaselineNed: - return sbp_msg_baseline_ned_encode(buf, len, n_written, &msg->baseline_ned); + return sbp_msg_baseline_ned_encode(buf, len, n_written, + &msg->baseline_ned); case SbpMsgBootloaderHandshakeDepA: - return sbp_msg_bootloader_handshake_dep_a_encode(buf, len, n_written, &msg->bootloader_handshake_dep_a); + return sbp_msg_bootloader_handshake_dep_a_encode( + buf, len, n_written, &msg->bootloader_handshake_dep_a); case SbpMsgBootloaderHandshakeReq: - return sbp_msg_bootloader_handshake_req_encode(buf, len, n_written, &msg->bootloader_handshake_req); + return sbp_msg_bootloader_handshake_req_encode( + buf, len, n_written, &msg->bootloader_handshake_req); case SbpMsgBootloaderHandshakeResp: - return sbp_msg_bootloader_handshake_resp_encode(buf, len, n_written, &msg->bootloader_handshake_resp); + return sbp_msg_bootloader_handshake_resp_encode( + buf, len, n_written, &msg->bootloader_handshake_resp); case SbpMsgBootloaderJumpToApp: - return sbp_msg_bootloader_jump_to_app_encode(buf, len, n_written, &msg->bootloader_jump_to_app); + return sbp_msg_bootloader_jump_to_app_encode( + buf, len, n_written, &msg->bootloader_jump_to_app); case SbpMsgCellModemStatus: - return sbp_msg_cell_modem_status_encode(buf, len, n_written, &msg->cell_modem_status); + return sbp_msg_cell_modem_status_encode(buf, len, n_written, + &msg->cell_modem_status); case SbpMsgCertificateChainDep: - return sbp_msg_certificate_chain_dep_encode(buf, len, n_written, &msg->certificate_chain_dep); + return sbp_msg_certificate_chain_dep_encode(buf, len, n_written, + &msg->certificate_chain_dep); case SbpMsgCertificateChain: - return sbp_msg_certificate_chain_encode(buf, len, n_written, &msg->certificate_chain); + return sbp_msg_certificate_chain_encode(buf, len, n_written, + &msg->certificate_chain); case SbpMsgCommandOutput: - return sbp_msg_command_output_encode(buf, len, n_written, &msg->command_output); + return sbp_msg_command_output_encode(buf, len, n_written, + &msg->command_output); case SbpMsgCommandReq: return sbp_msg_command_req_encode(buf, len, n_written, &msg->command_req); case SbpMsgCommandResp: - return sbp_msg_command_resp_encode(buf, len, n_written, &msg->command_resp); + return sbp_msg_command_resp_encode(buf, len, n_written, + &msg->command_resp); case SbpMsgCsacTelemetryLabels: - return sbp_msg_csac_telemetry_labels_encode(buf, len, n_written, &msg->csac_telemetry_labels); + return sbp_msg_csac_telemetry_labels_encode(buf, len, n_written, + &msg->csac_telemetry_labels); case SbpMsgCsacTelemetry: - return sbp_msg_csac_telemetry_encode(buf, len, n_written, &msg->csac_telemetry); + return sbp_msg_csac_telemetry_encode(buf, len, n_written, + &msg->csac_telemetry); case SbpMsgCwResults: return sbp_msg_cw_results_encode(buf, len, n_written, &msg->cw_results); case SbpMsgCwStart: return sbp_msg_cw_start_encode(buf, len, n_written, &msg->cw_start); case SbpMsgDeviceMonitor: - return sbp_msg_device_monitor_encode(buf, len, n_written, &msg->device_monitor); + return sbp_msg_device_monitor_encode(buf, len, n_written, + &msg->device_monitor); case SbpMsgDgnssStatus: - return sbp_msg_dgnss_status_encode(buf, len, n_written, &msg->dgnss_status); + return sbp_msg_dgnss_status_encode(buf, len, n_written, + &msg->dgnss_status); case SbpMsgDopsDepA: return sbp_msg_dops_dep_a_encode(buf, len, n_written, &msg->dops_dep_a); case SbpMsgDops: return sbp_msg_dops_encode(buf, len, n_written, &msg->dops); case SbpMsgEcdsaCertificate: - return sbp_msg_ecdsa_certificate_encode(buf, len, n_written, &msg->ecdsa_certificate); + return sbp_msg_ecdsa_certificate_encode(buf, len, n_written, + &msg->ecdsa_certificate); case SbpMsgEcdsaSignatureDepA: - return sbp_msg_ecdsa_signature_dep_a_encode(buf, len, n_written, &msg->ecdsa_signature_dep_a); + return sbp_msg_ecdsa_signature_dep_a_encode(buf, len, n_written, + &msg->ecdsa_signature_dep_a); case SbpMsgEcdsaSignatureDepB: - return sbp_msg_ecdsa_signature_dep_b_encode(buf, len, n_written, &msg->ecdsa_signature_dep_b); + return sbp_msg_ecdsa_signature_dep_b_encode(buf, len, n_written, + &msg->ecdsa_signature_dep_b); case SbpMsgEcdsaSignature: - return sbp_msg_ecdsa_signature_encode(buf, len, n_written, &msg->ecdsa_signature); + return sbp_msg_ecdsa_signature_encode(buf, len, n_written, + &msg->ecdsa_signature); case SbpMsgEd25519CertificateDep: - return sbp_msg_ed25519_certificate_dep_encode(buf, len, n_written, &msg->ed25519_certificate_dep); + return sbp_msg_ed25519_certificate_dep_encode( + buf, len, n_written, &msg->ed25519_certificate_dep); case SbpMsgEd25519SignatureDepA: - return sbp_msg_ed25519_signature_dep_a_encode(buf, len, n_written, &msg->ed25519_signature_dep_a); + return sbp_msg_ed25519_signature_dep_a_encode( + buf, len, n_written, &msg->ed25519_signature_dep_a); case SbpMsgEd25519SignatureDepB: - return sbp_msg_ed25519_signature_dep_b_encode(buf, len, n_written, &msg->ed25519_signature_dep_b); + return sbp_msg_ed25519_signature_dep_b_encode( + buf, len, n_written, &msg->ed25519_signature_dep_b); case SbpMsgEphemerisBds: - return sbp_msg_ephemeris_bds_encode(buf, len, n_written, &msg->ephemeris_bds); + return sbp_msg_ephemeris_bds_encode(buf, len, n_written, + &msg->ephemeris_bds); case SbpMsgEphemerisDepA: - return sbp_msg_ephemeris_dep_a_encode(buf, len, n_written, &msg->ephemeris_dep_a); + return sbp_msg_ephemeris_dep_a_encode(buf, len, n_written, + &msg->ephemeris_dep_a); case SbpMsgEphemerisDepB: - return sbp_msg_ephemeris_dep_b_encode(buf, len, n_written, &msg->ephemeris_dep_b); + return sbp_msg_ephemeris_dep_b_encode(buf, len, n_written, + &msg->ephemeris_dep_b); case SbpMsgEphemerisDepC: - return sbp_msg_ephemeris_dep_c_encode(buf, len, n_written, &msg->ephemeris_dep_c); + return sbp_msg_ephemeris_dep_c_encode(buf, len, n_written, + &msg->ephemeris_dep_c); case SbpMsgEphemerisDepD: - return sbp_msg_ephemeris_dep_d_encode(buf, len, n_written, &msg->ephemeris_dep_d); + return sbp_msg_ephemeris_dep_d_encode(buf, len, n_written, + &msg->ephemeris_dep_d); case SbpMsgEphemerisGalDepA: - return sbp_msg_ephemeris_gal_dep_a_encode(buf, len, n_written, &msg->ephemeris_gal_dep_a); + return sbp_msg_ephemeris_gal_dep_a_encode(buf, len, n_written, + &msg->ephemeris_gal_dep_a); case SbpMsgEphemerisGal: - return sbp_msg_ephemeris_gal_encode(buf, len, n_written, &msg->ephemeris_gal); + return sbp_msg_ephemeris_gal_encode(buf, len, n_written, + &msg->ephemeris_gal); case SbpMsgEphemerisGloDepA: - return sbp_msg_ephemeris_glo_dep_a_encode(buf, len, n_written, &msg->ephemeris_glo_dep_a); + return sbp_msg_ephemeris_glo_dep_a_encode(buf, len, n_written, + &msg->ephemeris_glo_dep_a); case SbpMsgEphemerisGloDepB: - return sbp_msg_ephemeris_glo_dep_b_encode(buf, len, n_written, &msg->ephemeris_glo_dep_b); + return sbp_msg_ephemeris_glo_dep_b_encode(buf, len, n_written, + &msg->ephemeris_glo_dep_b); case SbpMsgEphemerisGloDepC: - return sbp_msg_ephemeris_glo_dep_c_encode(buf, len, n_written, &msg->ephemeris_glo_dep_c); + return sbp_msg_ephemeris_glo_dep_c_encode(buf, len, n_written, + &msg->ephemeris_glo_dep_c); case SbpMsgEphemerisGloDepD: - return sbp_msg_ephemeris_glo_dep_d_encode(buf, len, n_written, &msg->ephemeris_glo_dep_d); + return sbp_msg_ephemeris_glo_dep_d_encode(buf, len, n_written, + &msg->ephemeris_glo_dep_d); case SbpMsgEphemerisGlo: - return sbp_msg_ephemeris_glo_encode(buf, len, n_written, &msg->ephemeris_glo); + return sbp_msg_ephemeris_glo_encode(buf, len, n_written, + &msg->ephemeris_glo); case SbpMsgEphemerisGpsDepE: - return sbp_msg_ephemeris_gps_dep_e_encode(buf, len, n_written, &msg->ephemeris_gps_dep_e); + return sbp_msg_ephemeris_gps_dep_e_encode(buf, len, n_written, + &msg->ephemeris_gps_dep_e); case SbpMsgEphemerisGpsDepF: - return sbp_msg_ephemeris_gps_dep_f_encode(buf, len, n_written, &msg->ephemeris_gps_dep_f); + return sbp_msg_ephemeris_gps_dep_f_encode(buf, len, n_written, + &msg->ephemeris_gps_dep_f); case SbpMsgEphemerisGps: - return sbp_msg_ephemeris_gps_encode(buf, len, n_written, &msg->ephemeris_gps); + return sbp_msg_ephemeris_gps_encode(buf, len, n_written, + &msg->ephemeris_gps); case SbpMsgEphemerisQzss: - return sbp_msg_ephemeris_qzss_encode(buf, len, n_written, &msg->ephemeris_qzss); + return sbp_msg_ephemeris_qzss_encode(buf, len, n_written, + &msg->ephemeris_qzss); case SbpMsgEphemerisSbasDepA: - return sbp_msg_ephemeris_sbas_dep_a_encode(buf, len, n_written, &msg->ephemeris_sbas_dep_a); + return sbp_msg_ephemeris_sbas_dep_a_encode(buf, len, n_written, + &msg->ephemeris_sbas_dep_a); case SbpMsgEphemerisSbasDepB: - return sbp_msg_ephemeris_sbas_dep_b_encode(buf, len, n_written, &msg->ephemeris_sbas_dep_b); + return sbp_msg_ephemeris_sbas_dep_b_encode(buf, len, n_written, + &msg->ephemeris_sbas_dep_b); case SbpMsgEphemerisSbas: - return sbp_msg_ephemeris_sbas_encode(buf, len, n_written, &msg->ephemeris_sbas); + return sbp_msg_ephemeris_sbas_encode(buf, len, n_written, + &msg->ephemeris_sbas); case SbpMsgExtEvent: return sbp_msg_ext_event_encode(buf, len, n_written, &msg->ext_event); case SbpMsgFileioConfigReq: - return sbp_msg_fileio_config_req_encode(buf, len, n_written, &msg->fileio_config_req); + return sbp_msg_fileio_config_req_encode(buf, len, n_written, + &msg->fileio_config_req); case SbpMsgFileioConfigResp: - return sbp_msg_fileio_config_resp_encode(buf, len, n_written, &msg->fileio_config_resp); + return sbp_msg_fileio_config_resp_encode(buf, len, n_written, + &msg->fileio_config_resp); case SbpMsgFileioReadDirReq: - return sbp_msg_fileio_read_dir_req_encode(buf, len, n_written, &msg->fileio_read_dir_req); + return sbp_msg_fileio_read_dir_req_encode(buf, len, n_written, + &msg->fileio_read_dir_req); case SbpMsgFileioReadDirResp: - return sbp_msg_fileio_read_dir_resp_encode(buf, len, n_written, &msg->fileio_read_dir_resp); + return sbp_msg_fileio_read_dir_resp_encode(buf, len, n_written, + &msg->fileio_read_dir_resp); case SbpMsgFileioReadReq: - return sbp_msg_fileio_read_req_encode(buf, len, n_written, &msg->fileio_read_req); + return sbp_msg_fileio_read_req_encode(buf, len, n_written, + &msg->fileio_read_req); case SbpMsgFileioReadResp: - return sbp_msg_fileio_read_resp_encode(buf, len, n_written, &msg->fileio_read_resp); + return sbp_msg_fileio_read_resp_encode(buf, len, n_written, + &msg->fileio_read_resp); case SbpMsgFileioRemove: - return sbp_msg_fileio_remove_encode(buf, len, n_written, &msg->fileio_remove); + return sbp_msg_fileio_remove_encode(buf, len, n_written, + &msg->fileio_remove); case SbpMsgFileioWriteReq: - return sbp_msg_fileio_write_req_encode(buf, len, n_written, &msg->fileio_write_req); + return sbp_msg_fileio_write_req_encode(buf, len, n_written, + &msg->fileio_write_req); case SbpMsgFileioWriteResp: - return sbp_msg_fileio_write_resp_encode(buf, len, n_written, &msg->fileio_write_resp); + return sbp_msg_fileio_write_resp_encode(buf, len, n_written, + &msg->fileio_write_resp); case SbpMsgFlashDone: return sbp_msg_flash_done_encode(buf, len, n_written, &msg->flash_done); case SbpMsgFlashErase: return sbp_msg_flash_erase_encode(buf, len, n_written, &msg->flash_erase); case SbpMsgFlashProgram: - return sbp_msg_flash_program_encode(buf, len, n_written, &msg->flash_program); + return sbp_msg_flash_program_encode(buf, len, n_written, + &msg->flash_program); case SbpMsgFlashReadReq: - return sbp_msg_flash_read_req_encode(buf, len, n_written, &msg->flash_read_req); + return sbp_msg_flash_read_req_encode(buf, len, n_written, + &msg->flash_read_req); case SbpMsgFlashReadResp: - return sbp_msg_flash_read_resp_encode(buf, len, n_written, &msg->flash_read_resp); + return sbp_msg_flash_read_resp_encode(buf, len, n_written, + &msg->flash_read_resp); case SbpMsgFrontEndGain: - return sbp_msg_front_end_gain_encode(buf, len, n_written, &msg->front_end_gain); + return sbp_msg_front_end_gain_encode(buf, len, n_written, + &msg->front_end_gain); case SbpMsgFwd: return sbp_msg_fwd_encode(buf, len, n_written, &msg->fwd); case SbpMsgGloBiases: @@ -480,17 +552,22 @@ static inline s8 sbp_message_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte case SbpMsgGnssCapb: return sbp_msg_gnss_capb_encode(buf, len, n_written, &msg->gnss_capb); case SbpMsgGnssTimeOffset: - return sbp_msg_gnss_time_offset_encode(buf, len, n_written, &msg->gnss_time_offset); + return sbp_msg_gnss_time_offset_encode(buf, len, n_written, + &msg->gnss_time_offset); case SbpMsgGpsTimeDepA: - return sbp_msg_gps_time_dep_a_encode(buf, len, n_written, &msg->gps_time_dep_a); + return sbp_msg_gps_time_dep_a_encode(buf, len, n_written, + &msg->gps_time_dep_a); case SbpMsgGpsTimeGnss: - return sbp_msg_gps_time_gnss_encode(buf, len, n_written, &msg->gps_time_gnss); + return sbp_msg_gps_time_gnss_encode(buf, len, n_written, + &msg->gps_time_gnss); case SbpMsgGpsTime: return sbp_msg_gps_time_encode(buf, len, n_written, &msg->gps_time); case SbpMsgGroupDelayDepA: - return sbp_msg_group_delay_dep_a_encode(buf, len, n_written, &msg->group_delay_dep_a); + return sbp_msg_group_delay_dep_a_encode(buf, len, n_written, + &msg->group_delay_dep_a); case SbpMsgGroupDelayDepB: - return sbp_msg_group_delay_dep_b_encode(buf, len, n_written, &msg->group_delay_dep_b); + return sbp_msg_group_delay_dep_b_encode(buf, len, n_written, + &msg->group_delay_dep_b); case SbpMsgGroupDelay: return sbp_msg_group_delay_encode(buf, len, n_written, &msg->group_delay); case SbpMsgGroupMeta: @@ -504,7 +581,8 @@ static inline s8 sbp_message_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte case SbpMsgImuRaw: return sbp_msg_imu_raw_encode(buf, len, n_written, &msg->imu_raw); case SbpMsgInitBaseDep: - return sbp_msg_init_base_dep_encode(buf, len, n_written, &msg->init_base_dep); + return sbp_msg_init_base_dep_encode(buf, len, n_written, + &msg->init_base_dep); case SbpMsgInsStatus: return sbp_msg_ins_status_encode(buf, len, n_written, &msg->ins_status); case SbpMsgInsUpdates: @@ -512,51 +590,71 @@ static inline s8 sbp_message_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte case SbpMsgIono: return sbp_msg_iono_encode(buf, len, n_written, &msg->iono); case SbpMsgLinuxCpuStateDepA: - return sbp_msg_linux_cpu_state_dep_a_encode(buf, len, n_written, &msg->linux_cpu_state_dep_a); + return sbp_msg_linux_cpu_state_dep_a_encode(buf, len, n_written, + &msg->linux_cpu_state_dep_a); case SbpMsgLinuxCpuState: - return sbp_msg_linux_cpu_state_encode(buf, len, n_written, &msg->linux_cpu_state); + return sbp_msg_linux_cpu_state_encode(buf, len, n_written, + &msg->linux_cpu_state); case SbpMsgLinuxMemStateDepA: - return sbp_msg_linux_mem_state_dep_a_encode(buf, len, n_written, &msg->linux_mem_state_dep_a); + return sbp_msg_linux_mem_state_dep_a_encode(buf, len, n_written, + &msg->linux_mem_state_dep_a); case SbpMsgLinuxMemState: - return sbp_msg_linux_mem_state_encode(buf, len, n_written, &msg->linux_mem_state); + return sbp_msg_linux_mem_state_encode(buf, len, n_written, + &msg->linux_mem_state); case SbpMsgLinuxProcessFdCount: - return sbp_msg_linux_process_fd_count_encode(buf, len, n_written, &msg->linux_process_fd_count); + return sbp_msg_linux_process_fd_count_encode( + buf, len, n_written, &msg->linux_process_fd_count); case SbpMsgLinuxProcessFdSummary: - return sbp_msg_linux_process_fd_summary_encode(buf, len, n_written, &msg->linux_process_fd_summary); + return sbp_msg_linux_process_fd_summary_encode( + buf, len, n_written, &msg->linux_process_fd_summary); case SbpMsgLinuxProcessSocketCounts: - return sbp_msg_linux_process_socket_counts_encode(buf, len, n_written, &msg->linux_process_socket_counts); + return sbp_msg_linux_process_socket_counts_encode( + buf, len, n_written, &msg->linux_process_socket_counts); case SbpMsgLinuxProcessSocketQueues: - return sbp_msg_linux_process_socket_queues_encode(buf, len, n_written, &msg->linux_process_socket_queues); + return sbp_msg_linux_process_socket_queues_encode( + buf, len, n_written, &msg->linux_process_socket_queues); case SbpMsgLinuxSocketUsage: - return sbp_msg_linux_socket_usage_encode(buf, len, n_written, &msg->linux_socket_usage); + return sbp_msg_linux_socket_usage_encode(buf, len, n_written, + &msg->linux_socket_usage); case SbpMsgLinuxSysStateDepA: - return sbp_msg_linux_sys_state_dep_a_encode(buf, len, n_written, &msg->linux_sys_state_dep_a); + return sbp_msg_linux_sys_state_dep_a_encode(buf, len, n_written, + &msg->linux_sys_state_dep_a); case SbpMsgLinuxSysState: - return sbp_msg_linux_sys_state_encode(buf, len, n_written, &msg->linux_sys_state); + return sbp_msg_linux_sys_state_encode(buf, len, n_written, + &msg->linux_sys_state); case SbpMsgLog: return sbp_msg_log_encode(buf, len, n_written, &msg->log); case SbpMsgM25FlashWriteStatus: - return sbp_msg_m25_flash_write_status_encode(buf, len, n_written, &msg->m25_flash_write_status); + return sbp_msg_m25_flash_write_status_encode( + buf, len, n_written, &msg->m25_flash_write_status); case SbpMsgMagRaw: return sbp_msg_mag_raw_encode(buf, len, n_written, &msg->mag_raw); case SbpMsgMaskSatelliteDep: - return sbp_msg_mask_satellite_dep_encode(buf, len, n_written, &msg->mask_satellite_dep); + return sbp_msg_mask_satellite_dep_encode(buf, len, n_written, + &msg->mask_satellite_dep); case SbpMsgMaskSatellite: - return sbp_msg_mask_satellite_encode(buf, len, n_written, &msg->mask_satellite); + return sbp_msg_mask_satellite_encode(buf, len, n_written, + &msg->mask_satellite); case SbpMsgMeasurementState: - return sbp_msg_measurement_state_encode(buf, len, n_written, &msg->measurement_state); + return sbp_msg_measurement_state_encode(buf, len, n_written, + &msg->measurement_state); case SbpMsgNapDeviceDnaReq: - return sbp_msg_nap_device_dna_req_encode(buf, len, n_written, &msg->nap_device_dna_req); + return sbp_msg_nap_device_dna_req_encode(buf, len, n_written, + &msg->nap_device_dna_req); case SbpMsgNapDeviceDnaResp: - return sbp_msg_nap_device_dna_resp_encode(buf, len, n_written, &msg->nap_device_dna_resp); + return sbp_msg_nap_device_dna_resp_encode(buf, len, n_written, + &msg->nap_device_dna_resp); case SbpMsgNdbEvent: return sbp_msg_ndb_event_encode(buf, len, n_written, &msg->ndb_event); case SbpMsgNetworkBandwidthUsage: - return sbp_msg_network_bandwidth_usage_encode(buf, len, n_written, &msg->network_bandwidth_usage); + return sbp_msg_network_bandwidth_usage_encode( + buf, len, n_written, &msg->network_bandwidth_usage); case SbpMsgNetworkStateReq: - return sbp_msg_network_state_req_encode(buf, len, n_written, &msg->network_state_req); + return sbp_msg_network_state_req_encode(buf, len, n_written, + &msg->network_state_req); case SbpMsgNetworkStateResp: - return sbp_msg_network_state_resp_encode(buf, len, n_written, &msg->network_state_resp); + return sbp_msg_network_state_resp_encode(buf, len, n_written, + &msg->network_state_resp); case SbpMsgObsDepA: return sbp_msg_obs_dep_a_encode(buf, len, n_written, &msg->obs_dep_a); case SbpMsgObsDepB: @@ -568,79 +666,104 @@ static inline s8 sbp_message_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte case SbpMsgOdometry: return sbp_msg_odometry_encode(buf, len, n_written, &msg->odometry); case SbpMsgOrientEuler: - return sbp_msg_orient_euler_encode(buf, len, n_written, &msg->orient_euler); + return sbp_msg_orient_euler_encode(buf, len, n_written, + &msg->orient_euler); case SbpMsgOrientQuat: return sbp_msg_orient_quat_encode(buf, len, n_written, &msg->orient_quat); case SbpMsgOsr: return sbp_msg_osr_encode(buf, len, n_written, &msg->osr); case SbpMsgPosEcefCovGnss: - return sbp_msg_pos_ecef_cov_gnss_encode(buf, len, n_written, &msg->pos_ecef_cov_gnss); + return sbp_msg_pos_ecef_cov_gnss_encode(buf, len, n_written, + &msg->pos_ecef_cov_gnss); case SbpMsgPosEcefCov: - return sbp_msg_pos_ecef_cov_encode(buf, len, n_written, &msg->pos_ecef_cov); + return sbp_msg_pos_ecef_cov_encode(buf, len, n_written, + &msg->pos_ecef_cov); case SbpMsgPosEcefDepA: - return sbp_msg_pos_ecef_dep_a_encode(buf, len, n_written, &msg->pos_ecef_dep_a); + return sbp_msg_pos_ecef_dep_a_encode(buf, len, n_written, + &msg->pos_ecef_dep_a); case SbpMsgPosEcefGnss: - return sbp_msg_pos_ecef_gnss_encode(buf, len, n_written, &msg->pos_ecef_gnss); + return sbp_msg_pos_ecef_gnss_encode(buf, len, n_written, + &msg->pos_ecef_gnss); case SbpMsgPosEcef: return sbp_msg_pos_ecef_encode(buf, len, n_written, &msg->pos_ecef); case SbpMsgPosLlhAcc: return sbp_msg_pos_llh_acc_encode(buf, len, n_written, &msg->pos_llh_acc); case SbpMsgPosLlhCovGnss: - return sbp_msg_pos_llh_cov_gnss_encode(buf, len, n_written, &msg->pos_llh_cov_gnss); + return sbp_msg_pos_llh_cov_gnss_encode(buf, len, n_written, + &msg->pos_llh_cov_gnss); case SbpMsgPosLlhCov: return sbp_msg_pos_llh_cov_encode(buf, len, n_written, &msg->pos_llh_cov); case SbpMsgPosLlhDepA: - return sbp_msg_pos_llh_dep_a_encode(buf, len, n_written, &msg->pos_llh_dep_a); + return sbp_msg_pos_llh_dep_a_encode(buf, len, n_written, + &msg->pos_llh_dep_a); case SbpMsgPosLlhGnss: - return sbp_msg_pos_llh_gnss_encode(buf, len, n_written, &msg->pos_llh_gnss); + return sbp_msg_pos_llh_gnss_encode(buf, len, n_written, + &msg->pos_llh_gnss); case SbpMsgPosLlh: return sbp_msg_pos_llh_encode(buf, len, n_written, &msg->pos_llh); case SbpMsgPoseRelative: - return sbp_msg_pose_relative_encode(buf, len, n_written, &msg->pose_relative); + return sbp_msg_pose_relative_encode(buf, len, n_written, + &msg->pose_relative); case SbpMsgPpsTime: return sbp_msg_pps_time_encode(buf, len, n_written, &msg->pps_time); case SbpMsgPrintDep: return sbp_msg_print_dep_encode(buf, len, n_written, &msg->print_dep); case SbpMsgProtectionLevelDepA: - return sbp_msg_protection_level_dep_a_encode(buf, len, n_written, &msg->protection_level_dep_a); + return sbp_msg_protection_level_dep_a_encode( + buf, len, n_written, &msg->protection_level_dep_a); case SbpMsgProtectionLevel: - return sbp_msg_protection_level_encode(buf, len, n_written, &msg->protection_level); + return sbp_msg_protection_level_encode(buf, len, n_written, + &msg->protection_level); case SbpMsgReferenceFrameParam: - return sbp_msg_reference_frame_param_encode(buf, len, n_written, &msg->reference_frame_param); + return sbp_msg_reference_frame_param_encode(buf, len, n_written, + &msg->reference_frame_param); case SbpMsgResetDep: return sbp_msg_reset_dep_encode(buf, len, n_written, &msg->reset_dep); case SbpMsgResetFilters: - return sbp_msg_reset_filters_encode(buf, len, n_written, &msg->reset_filters); + return sbp_msg_reset_filters_encode(buf, len, n_written, + &msg->reset_filters); case SbpMsgReset: return sbp_msg_reset_encode(buf, len, n_written, &msg->reset); case SbpMsgSbasRaw: return sbp_msg_sbas_raw_encode(buf, len, n_written, &msg->sbas_raw); case SbpMsgSensorAidEvent: - return sbp_msg_sensor_aid_event_encode(buf, len, n_written, &msg->sensor_aid_event); + return sbp_msg_sensor_aid_event_encode(buf, len, n_written, + &msg->sensor_aid_event); case SbpMsgSetTime: return sbp_msg_set_time_encode(buf, len, n_written, &msg->set_time); case SbpMsgSettingsReadByIndexDone: - return sbp_msg_settings_read_by_index_done_encode(buf, len, n_written, &msg->settings_read_by_index_done); + return sbp_msg_settings_read_by_index_done_encode( + buf, len, n_written, &msg->settings_read_by_index_done); case SbpMsgSettingsReadByIndexReq: - return sbp_msg_settings_read_by_index_req_encode(buf, len, n_written, &msg->settings_read_by_index_req); + return sbp_msg_settings_read_by_index_req_encode( + buf, len, n_written, &msg->settings_read_by_index_req); case SbpMsgSettingsReadByIndexResp: - return sbp_msg_settings_read_by_index_resp_encode(buf, len, n_written, &msg->settings_read_by_index_resp); + return sbp_msg_settings_read_by_index_resp_encode( + buf, len, n_written, &msg->settings_read_by_index_resp); case SbpMsgSettingsReadReq: - return sbp_msg_settings_read_req_encode(buf, len, n_written, &msg->settings_read_req); + return sbp_msg_settings_read_req_encode(buf, len, n_written, + &msg->settings_read_req); case SbpMsgSettingsReadResp: - return sbp_msg_settings_read_resp_encode(buf, len, n_written, &msg->settings_read_resp); + return sbp_msg_settings_read_resp_encode(buf, len, n_written, + &msg->settings_read_resp); case SbpMsgSettingsRegisterResp: - return sbp_msg_settings_register_resp_encode(buf, len, n_written, &msg->settings_register_resp); + return sbp_msg_settings_register_resp_encode( + buf, len, n_written, &msg->settings_register_resp); case SbpMsgSettingsRegister: - return sbp_msg_settings_register_encode(buf, len, n_written, &msg->settings_register); + return sbp_msg_settings_register_encode(buf, len, n_written, + &msg->settings_register); case SbpMsgSettingsSave: - return sbp_msg_settings_save_encode(buf, len, n_written, &msg->settings_save); + return sbp_msg_settings_save_encode(buf, len, n_written, + &msg->settings_save); case SbpMsgSettingsWriteResp: - return sbp_msg_settings_write_resp_encode(buf, len, n_written, &msg->settings_write_resp); + return sbp_msg_settings_write_resp_encode(buf, len, n_written, + &msg->settings_write_resp); case SbpMsgSettingsWrite: - return sbp_msg_settings_write_encode(buf, len, n_written, &msg->settings_write); + return sbp_msg_settings_write_encode(buf, len, n_written, + &msg->settings_write); case SbpMsgSolnMetaDepA: - return sbp_msg_soln_meta_dep_a_encode(buf, len, n_written, &msg->soln_meta_dep_a); + return sbp_msg_soln_meta_dep_a_encode(buf, len, n_written, + &msg->soln_meta_dep_a); case SbpMsgSolnMeta: return sbp_msg_soln_meta_encode(buf, len, n_written, &msg->soln_meta); case SbpMsgSpecanDep: @@ -648,105 +771,149 @@ static inline s8 sbp_message_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte case SbpMsgSpecan: return sbp_msg_specan_encode(buf, len, n_written, &msg->specan); case SbpMsgSsrCodeBiases: - return sbp_msg_ssr_code_biases_encode(buf, len, n_written, &msg->ssr_code_biases); + return sbp_msg_ssr_code_biases_encode(buf, len, n_written, + &msg->ssr_code_biases); case SbpMsgSsrCodePhaseBiasesBounds: - return sbp_msg_ssr_code_phase_biases_bounds_encode(buf, len, n_written, &msg->ssr_code_phase_biases_bounds); + return sbp_msg_ssr_code_phase_biases_bounds_encode( + buf, len, n_written, &msg->ssr_code_phase_biases_bounds); case SbpMsgSsrFlagHighLevel: - return sbp_msg_ssr_flag_high_level_encode(buf, len, n_written, &msg->ssr_flag_high_level); + return sbp_msg_ssr_flag_high_level_encode(buf, len, n_written, + &msg->ssr_flag_high_level); case SbpMsgSsrFlagIonoGridPointSatLos: - return sbp_msg_ssr_flag_iono_grid_point_sat_los_encode(buf, len, n_written, &msg->ssr_flag_iono_grid_point_sat_los); + return sbp_msg_ssr_flag_iono_grid_point_sat_los_encode( + buf, len, n_written, &msg->ssr_flag_iono_grid_point_sat_los); case SbpMsgSsrFlagIonoGridPoints: - return sbp_msg_ssr_flag_iono_grid_points_encode(buf, len, n_written, &msg->ssr_flag_iono_grid_points); + return sbp_msg_ssr_flag_iono_grid_points_encode( + buf, len, n_written, &msg->ssr_flag_iono_grid_points); case SbpMsgSsrFlagIonoTileSatLos: - return sbp_msg_ssr_flag_iono_tile_sat_los_encode(buf, len, n_written, &msg->ssr_flag_iono_tile_sat_los); + return sbp_msg_ssr_flag_iono_tile_sat_los_encode( + buf, len, n_written, &msg->ssr_flag_iono_tile_sat_los); case SbpMsgSsrFlagSatellites: - return sbp_msg_ssr_flag_satellites_encode(buf, len, n_written, &msg->ssr_flag_satellites); + return sbp_msg_ssr_flag_satellites_encode(buf, len, n_written, + &msg->ssr_flag_satellites); case SbpMsgSsrFlagTropoGridPoints: - return sbp_msg_ssr_flag_tropo_grid_points_encode(buf, len, n_written, &msg->ssr_flag_tropo_grid_points); + return sbp_msg_ssr_flag_tropo_grid_points_encode( + buf, len, n_written, &msg->ssr_flag_tropo_grid_points); case SbpMsgSsrGridDefinitionDepA: - return sbp_msg_ssr_grid_definition_dep_a_encode(buf, len, n_written, &msg->ssr_grid_definition_dep_a); + return sbp_msg_ssr_grid_definition_dep_a_encode( + buf, len, n_written, &msg->ssr_grid_definition_dep_a); case SbpMsgSsrGriddedCorrectionBounds: - return sbp_msg_ssr_gridded_correction_bounds_encode(buf, len, n_written, &msg->ssr_gridded_correction_bounds); + return sbp_msg_ssr_gridded_correction_bounds_encode( + buf, len, n_written, &msg->ssr_gridded_correction_bounds); case SbpMsgSsrGriddedCorrectionDepA: - return sbp_msg_ssr_gridded_correction_dep_a_encode(buf, len, n_written, &msg->ssr_gridded_correction_dep_a); + return sbp_msg_ssr_gridded_correction_dep_a_encode( + buf, len, n_written, &msg->ssr_gridded_correction_dep_a); case SbpMsgSsrGriddedCorrectionNoStdDepA: - return sbp_msg_ssr_gridded_correction_no_std_dep_a_encode(buf, len, n_written, &msg->ssr_gridded_correction_no_std_dep_a); + return sbp_msg_ssr_gridded_correction_no_std_dep_a_encode( + buf, len, n_written, &msg->ssr_gridded_correction_no_std_dep_a); case SbpMsgSsrGriddedCorrection: - return sbp_msg_ssr_gridded_correction_encode(buf, len, n_written, &msg->ssr_gridded_correction); + return sbp_msg_ssr_gridded_correction_encode( + buf, len, n_written, &msg->ssr_gridded_correction); case SbpMsgSsrOrbitClockBoundsDegradation: - return sbp_msg_ssr_orbit_clock_bounds_degradation_encode(buf, len, n_written, &msg->ssr_orbit_clock_bounds_degradation); + return sbp_msg_ssr_orbit_clock_bounds_degradation_encode( + buf, len, n_written, &msg->ssr_orbit_clock_bounds_degradation); case SbpMsgSsrOrbitClockBounds: - return sbp_msg_ssr_orbit_clock_bounds_encode(buf, len, n_written, &msg->ssr_orbit_clock_bounds); + return sbp_msg_ssr_orbit_clock_bounds_encode( + buf, len, n_written, &msg->ssr_orbit_clock_bounds); case SbpMsgSsrOrbitClockDepA: - return sbp_msg_ssr_orbit_clock_dep_a_encode(buf, len, n_written, &msg->ssr_orbit_clock_dep_a); + return sbp_msg_ssr_orbit_clock_dep_a_encode(buf, len, n_written, + &msg->ssr_orbit_clock_dep_a); case SbpMsgSsrOrbitClock: - return sbp_msg_ssr_orbit_clock_encode(buf, len, n_written, &msg->ssr_orbit_clock); + return sbp_msg_ssr_orbit_clock_encode(buf, len, n_written, + &msg->ssr_orbit_clock); case SbpMsgSsrPhaseBiases: - return sbp_msg_ssr_phase_biases_encode(buf, len, n_written, &msg->ssr_phase_biases); + return sbp_msg_ssr_phase_biases_encode(buf, len, n_written, + &msg->ssr_phase_biases); case SbpMsgSsrSatelliteApcDep: - return sbp_msg_ssr_satellite_apc_dep_encode(buf, len, n_written, &msg->ssr_satellite_apc_dep); + return sbp_msg_ssr_satellite_apc_dep_encode(buf, len, n_written, + &msg->ssr_satellite_apc_dep); case SbpMsgSsrSatelliteApc: - return sbp_msg_ssr_satellite_apc_encode(buf, len, n_written, &msg->ssr_satellite_apc); + return sbp_msg_ssr_satellite_apc_encode(buf, len, n_written, + &msg->ssr_satellite_apc); case SbpMsgSsrStecCorrectionDepA: - return sbp_msg_ssr_stec_correction_dep_a_encode(buf, len, n_written, &msg->ssr_stec_correction_dep_a); + return sbp_msg_ssr_stec_correction_dep_a_encode( + buf, len, n_written, &msg->ssr_stec_correction_dep_a); case SbpMsgSsrStecCorrectionDep: - return sbp_msg_ssr_stec_correction_dep_encode(buf, len, n_written, &msg->ssr_stec_correction_dep); + return sbp_msg_ssr_stec_correction_dep_encode( + buf, len, n_written, &msg->ssr_stec_correction_dep); case SbpMsgSsrStecCorrection: - return sbp_msg_ssr_stec_correction_encode(buf, len, n_written, &msg->ssr_stec_correction); + return sbp_msg_ssr_stec_correction_encode(buf, len, n_written, + &msg->ssr_stec_correction); case SbpMsgSsrTileDefinitionDepA: - return sbp_msg_ssr_tile_definition_dep_a_encode(buf, len, n_written, &msg->ssr_tile_definition_dep_a); + return sbp_msg_ssr_tile_definition_dep_a_encode( + buf, len, n_written, &msg->ssr_tile_definition_dep_a); case SbpMsgSsrTileDefinitionDepB: - return sbp_msg_ssr_tile_definition_dep_b_encode(buf, len, n_written, &msg->ssr_tile_definition_dep_b); + return sbp_msg_ssr_tile_definition_dep_b_encode( + buf, len, n_written, &msg->ssr_tile_definition_dep_b); case SbpMsgSsrTileDefinition: - return sbp_msg_ssr_tile_definition_encode(buf, len, n_written, &msg->ssr_tile_definition); + return sbp_msg_ssr_tile_definition_encode(buf, len, n_written, + &msg->ssr_tile_definition); case SbpMsgStartup: return sbp_msg_startup_encode(buf, len, n_written, &msg->startup); case SbpMsgStatusJournal: - return sbp_msg_status_journal_encode(buf, len, n_written, &msg->status_journal); + return sbp_msg_status_journal_encode(buf, len, n_written, + &msg->status_journal); case SbpMsgStatusReport: - return sbp_msg_status_report_encode(buf, len, n_written, &msg->status_report); + return sbp_msg_status_report_encode(buf, len, n_written, + &msg->status_report); case SbpMsgStmFlashLockSector: - return sbp_msg_stm_flash_lock_sector_encode(buf, len, n_written, &msg->stm_flash_lock_sector); + return sbp_msg_stm_flash_lock_sector_encode(buf, len, n_written, + &msg->stm_flash_lock_sector); case SbpMsgStmFlashUnlockSector: - return sbp_msg_stm_flash_unlock_sector_encode(buf, len, n_written, &msg->stm_flash_unlock_sector); + return sbp_msg_stm_flash_unlock_sector_encode( + buf, len, n_written, &msg->stm_flash_unlock_sector); case SbpMsgStmUniqueIdReq: - return sbp_msg_stm_unique_id_req_encode(buf, len, n_written, &msg->stm_unique_id_req); + return sbp_msg_stm_unique_id_req_encode(buf, len, n_written, + &msg->stm_unique_id_req); case SbpMsgStmUniqueIdResp: - return sbp_msg_stm_unique_id_resp_encode(buf, len, n_written, &msg->stm_unique_id_resp); + return sbp_msg_stm_unique_id_resp_encode(buf, len, n_written, + &msg->stm_unique_id_resp); case SbpMsgSvAzEl: return sbp_msg_sv_az_el_encode(buf, len, n_written, &msg->sv_az_el); case SbpMsgSvConfigurationGpsDep: - return sbp_msg_sv_configuration_gps_dep_encode(buf, len, n_written, &msg->sv_configuration_gps_dep); + return sbp_msg_sv_configuration_gps_dep_encode( + buf, len, n_written, &msg->sv_configuration_gps_dep); case SbpMsgTelSv: return sbp_msg_tel_sv_encode(buf, len, n_written, &msg->tel_sv); case SbpMsgThreadState: - return sbp_msg_thread_state_encode(buf, len, n_written, &msg->thread_state); + return sbp_msg_thread_state_encode(buf, len, n_written, + &msg->thread_state); case SbpMsgTrackingIqDepA: - return sbp_msg_tracking_iq_dep_a_encode(buf, len, n_written, &msg->tracking_iq_dep_a); + return sbp_msg_tracking_iq_dep_a_encode(buf, len, n_written, + &msg->tracking_iq_dep_a); case SbpMsgTrackingIqDepB: - return sbp_msg_tracking_iq_dep_b_encode(buf, len, n_written, &msg->tracking_iq_dep_b); + return sbp_msg_tracking_iq_dep_b_encode(buf, len, n_written, + &msg->tracking_iq_dep_b); case SbpMsgTrackingIq: return sbp_msg_tracking_iq_encode(buf, len, n_written, &msg->tracking_iq); case SbpMsgTrackingStateDepA: - return sbp_msg_tracking_state_dep_a_encode(buf, len, n_written, &msg->tracking_state_dep_a); + return sbp_msg_tracking_state_dep_a_encode(buf, len, n_written, + &msg->tracking_state_dep_a); case SbpMsgTrackingStateDepB: - return sbp_msg_tracking_state_dep_b_encode(buf, len, n_written, &msg->tracking_state_dep_b); + return sbp_msg_tracking_state_dep_b_encode(buf, len, n_written, + &msg->tracking_state_dep_b); case SbpMsgTrackingStateDetailedDepA: - return sbp_msg_tracking_state_detailed_dep_a_encode(buf, len, n_written, &msg->tracking_state_detailed_dep_a); + return sbp_msg_tracking_state_detailed_dep_a_encode( + buf, len, n_written, &msg->tracking_state_detailed_dep_a); case SbpMsgTrackingStateDetailedDep: - return sbp_msg_tracking_state_detailed_dep_encode(buf, len, n_written, &msg->tracking_state_detailed_dep); + return sbp_msg_tracking_state_detailed_dep_encode( + buf, len, n_written, &msg->tracking_state_detailed_dep); case SbpMsgTrackingState: - return sbp_msg_tracking_state_encode(buf, len, n_written, &msg->tracking_state); + return sbp_msg_tracking_state_encode(buf, len, n_written, + &msg->tracking_state); case SbpMsgUartStateDepa: - return sbp_msg_uart_state_depa_encode(buf, len, n_written, &msg->uart_state_depa); + return sbp_msg_uart_state_depa_encode(buf, len, n_written, + &msg->uart_state_depa); case SbpMsgUartState: return sbp_msg_uart_state_encode(buf, len, n_written, &msg->uart_state); case SbpMsgUserData: return sbp_msg_user_data_encode(buf, len, n_written, &msg->user_data); case SbpMsgUtcLeapSecond: - return sbp_msg_utc_leap_second_encode(buf, len, n_written, &msg->utc_leap_second); + return sbp_msg_utc_leap_second_encode(buf, len, n_written, + &msg->utc_leap_second); case SbpMsgUtcTimeGnss: - return sbp_msg_utc_time_gnss_encode(buf, len, n_written, &msg->utc_time_gnss); + return sbp_msg_utc_time_gnss_encode(buf, len, n_written, + &msg->utc_time_gnss); case SbpMsgUtcTime: return sbp_msg_utc_time_encode(buf, len, n_written, &msg->utc_time); case SbpMsgVelBody: @@ -754,23 +921,30 @@ static inline s8 sbp_message_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte case SbpMsgVelCog: return sbp_msg_vel_cog_encode(buf, len, n_written, &msg->vel_cog); case SbpMsgVelEcefCovGnss: - return sbp_msg_vel_ecef_cov_gnss_encode(buf, len, n_written, &msg->vel_ecef_cov_gnss); + return sbp_msg_vel_ecef_cov_gnss_encode(buf, len, n_written, + &msg->vel_ecef_cov_gnss); case SbpMsgVelEcefCov: - return sbp_msg_vel_ecef_cov_encode(buf, len, n_written, &msg->vel_ecef_cov); + return sbp_msg_vel_ecef_cov_encode(buf, len, n_written, + &msg->vel_ecef_cov); case SbpMsgVelEcefDepA: - return sbp_msg_vel_ecef_dep_a_encode(buf, len, n_written, &msg->vel_ecef_dep_a); + return sbp_msg_vel_ecef_dep_a_encode(buf, len, n_written, + &msg->vel_ecef_dep_a); case SbpMsgVelEcefGnss: - return sbp_msg_vel_ecef_gnss_encode(buf, len, n_written, &msg->vel_ecef_gnss); + return sbp_msg_vel_ecef_gnss_encode(buf, len, n_written, + &msg->vel_ecef_gnss); case SbpMsgVelEcef: return sbp_msg_vel_ecef_encode(buf, len, n_written, &msg->vel_ecef); case SbpMsgVelNedCovGnss: - return sbp_msg_vel_ned_cov_gnss_encode(buf, len, n_written, &msg->vel_ned_cov_gnss); + return sbp_msg_vel_ned_cov_gnss_encode(buf, len, n_written, + &msg->vel_ned_cov_gnss); case SbpMsgVelNedCov: return sbp_msg_vel_ned_cov_encode(buf, len, n_written, &msg->vel_ned_cov); case SbpMsgVelNedDepA: - return sbp_msg_vel_ned_dep_a_encode(buf, len, n_written, &msg->vel_ned_dep_a); + return sbp_msg_vel_ned_dep_a_encode(buf, len, n_written, + &msg->vel_ned_dep_a); case SbpMsgVelNedGnss: - return sbp_msg_vel_ned_gnss_encode(buf, len, n_written, &msg->vel_ned_gnss); + return sbp_msg_vel_ned_gnss_encode(buf, len, n_written, + &msg->vel_ned_gnss); case SbpMsgVelNed: return sbp_msg_vel_ned_encode(buf, len, n_written, &msg->vel_ned); case SbpMsgWheeltick: @@ -794,30 +968,40 @@ static inline s8 sbp_message_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte * `SBP_OK` (0) if the message was successfully decoded * callback */ -static inline s8 sbp_message_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_type_t msg_type, sbp_msg_t *msg) { - switch(msg_type) { +static inline s8 sbp_message_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_type_t msg_type, + sbp_msg_t *msg) { + switch (msg_type) { case SbpMsgAcknowledge: return sbp_msg_acknowledge_decode(buf, len, n_read, &msg->acknowledge); case SbpMsgAcqResultDepA: - return sbp_msg_acq_result_dep_a_decode(buf, len, n_read, &msg->acq_result_dep_a); + return sbp_msg_acq_result_dep_a_decode(buf, len, n_read, + &msg->acq_result_dep_a); case SbpMsgAcqResultDepB: - return sbp_msg_acq_result_dep_b_decode(buf, len, n_read, &msg->acq_result_dep_b); + return sbp_msg_acq_result_dep_b_decode(buf, len, n_read, + &msg->acq_result_dep_b); case SbpMsgAcqResultDepC: - return sbp_msg_acq_result_dep_c_decode(buf, len, n_read, &msg->acq_result_dep_c); + return sbp_msg_acq_result_dep_c_decode(buf, len, n_read, + &msg->acq_result_dep_c); case SbpMsgAcqResult: return sbp_msg_acq_result_decode(buf, len, n_read, &msg->acq_result); case SbpMsgAcqSvProfileDep: - return sbp_msg_acq_sv_profile_dep_decode(buf, len, n_read, &msg->acq_sv_profile_dep); + return sbp_msg_acq_sv_profile_dep_decode(buf, len, n_read, + &msg->acq_sv_profile_dep); case SbpMsgAcqSvProfile: - return sbp_msg_acq_sv_profile_decode(buf, len, n_read, &msg->acq_sv_profile); + return sbp_msg_acq_sv_profile_decode(buf, len, n_read, + &msg->acq_sv_profile); case SbpMsgAgeCorrections: - return sbp_msg_age_corrections_decode(buf, len, n_read, &msg->age_corrections); + return sbp_msg_age_corrections_decode(buf, len, n_read, + &msg->age_corrections); case SbpMsgAlmanacGloDep: - return sbp_msg_almanac_glo_dep_decode(buf, len, n_read, &msg->almanac_glo_dep); + return sbp_msg_almanac_glo_dep_decode(buf, len, n_read, + &msg->almanac_glo_dep); case SbpMsgAlmanacGlo: return sbp_msg_almanac_glo_decode(buf, len, n_read, &msg->almanac_glo); case SbpMsgAlmanacGpsDep: - return sbp_msg_almanac_gps_dep_decode(buf, len, n_read, &msg->almanac_gps_dep); + return sbp_msg_almanac_gps_dep_decode(buf, len, n_read, + &msg->almanac_gps_dep); case SbpMsgAlmanacGps: return sbp_msg_almanac_gps_decode(buf, len, n_read, &msg->almanac_gps); case SbpMsgAlmanac: @@ -825,51 +1009,68 @@ static inline s8 sbp_message_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ case SbpMsgAngularRate: return sbp_msg_angular_rate_decode(buf, len, n_read, &msg->angular_rate); case SbpMsgBasePosEcef: - return sbp_msg_base_pos_ecef_decode(buf, len, n_read, &msg->base_pos_ecef); + return sbp_msg_base_pos_ecef_decode(buf, len, n_read, + &msg->base_pos_ecef); case SbpMsgBasePosLlh: return sbp_msg_base_pos_llh_decode(buf, len, n_read, &msg->base_pos_llh); case SbpMsgBaselineEcefDepA: - return sbp_msg_baseline_ecef_dep_a_decode(buf, len, n_read, &msg->baseline_ecef_dep_a); + return sbp_msg_baseline_ecef_dep_a_decode(buf, len, n_read, + &msg->baseline_ecef_dep_a); case SbpMsgBaselineEcef: - return sbp_msg_baseline_ecef_decode(buf, len, n_read, &msg->baseline_ecef); + return sbp_msg_baseline_ecef_decode(buf, len, n_read, + &msg->baseline_ecef); case SbpMsgBaselineHeadingDepA: - return sbp_msg_baseline_heading_dep_a_decode(buf, len, n_read, &msg->baseline_heading_dep_a); + return sbp_msg_baseline_heading_dep_a_decode( + buf, len, n_read, &msg->baseline_heading_dep_a); case SbpMsgBaselineHeading: - return sbp_msg_baseline_heading_decode(buf, len, n_read, &msg->baseline_heading); + return sbp_msg_baseline_heading_decode(buf, len, n_read, + &msg->baseline_heading); case SbpMsgBaselineNedDepA: - return sbp_msg_baseline_ned_dep_a_decode(buf, len, n_read, &msg->baseline_ned_dep_a); + return sbp_msg_baseline_ned_dep_a_decode(buf, len, n_read, + &msg->baseline_ned_dep_a); case SbpMsgBaselineNed: return sbp_msg_baseline_ned_decode(buf, len, n_read, &msg->baseline_ned); case SbpMsgBootloaderHandshakeDepA: - return sbp_msg_bootloader_handshake_dep_a_decode(buf, len, n_read, &msg->bootloader_handshake_dep_a); + return sbp_msg_bootloader_handshake_dep_a_decode( + buf, len, n_read, &msg->bootloader_handshake_dep_a); case SbpMsgBootloaderHandshakeReq: - return sbp_msg_bootloader_handshake_req_decode(buf, len, n_read, &msg->bootloader_handshake_req); + return sbp_msg_bootloader_handshake_req_decode( + buf, len, n_read, &msg->bootloader_handshake_req); case SbpMsgBootloaderHandshakeResp: - return sbp_msg_bootloader_handshake_resp_decode(buf, len, n_read, &msg->bootloader_handshake_resp); + return sbp_msg_bootloader_handshake_resp_decode( + buf, len, n_read, &msg->bootloader_handshake_resp); case SbpMsgBootloaderJumpToApp: - return sbp_msg_bootloader_jump_to_app_decode(buf, len, n_read, &msg->bootloader_jump_to_app); + return sbp_msg_bootloader_jump_to_app_decode( + buf, len, n_read, &msg->bootloader_jump_to_app); case SbpMsgCellModemStatus: - return sbp_msg_cell_modem_status_decode(buf, len, n_read, &msg->cell_modem_status); + return sbp_msg_cell_modem_status_decode(buf, len, n_read, + &msg->cell_modem_status); case SbpMsgCertificateChainDep: - return sbp_msg_certificate_chain_dep_decode(buf, len, n_read, &msg->certificate_chain_dep); + return sbp_msg_certificate_chain_dep_decode(buf, len, n_read, + &msg->certificate_chain_dep); case SbpMsgCertificateChain: - return sbp_msg_certificate_chain_decode(buf, len, n_read, &msg->certificate_chain); + return sbp_msg_certificate_chain_decode(buf, len, n_read, + &msg->certificate_chain); case SbpMsgCommandOutput: - return sbp_msg_command_output_decode(buf, len, n_read, &msg->command_output); + return sbp_msg_command_output_decode(buf, len, n_read, + &msg->command_output); case SbpMsgCommandReq: return sbp_msg_command_req_decode(buf, len, n_read, &msg->command_req); case SbpMsgCommandResp: return sbp_msg_command_resp_decode(buf, len, n_read, &msg->command_resp); case SbpMsgCsacTelemetryLabels: - return sbp_msg_csac_telemetry_labels_decode(buf, len, n_read, &msg->csac_telemetry_labels); + return sbp_msg_csac_telemetry_labels_decode(buf, len, n_read, + &msg->csac_telemetry_labels); case SbpMsgCsacTelemetry: - return sbp_msg_csac_telemetry_decode(buf, len, n_read, &msg->csac_telemetry); + return sbp_msg_csac_telemetry_decode(buf, len, n_read, + &msg->csac_telemetry); case SbpMsgCwResults: return sbp_msg_cw_results_decode(buf, len, n_read, &msg->cw_results); case SbpMsgCwStart: return sbp_msg_cw_start_decode(buf, len, n_read, &msg->cw_start); case SbpMsgDeviceMonitor: - return sbp_msg_device_monitor_decode(buf, len, n_read, &msg->device_monitor); + return sbp_msg_device_monitor_decode(buf, len, n_read, + &msg->device_monitor); case SbpMsgDgnssStatus: return sbp_msg_dgnss_status_decode(buf, len, n_read, &msg->dgnss_status); case SbpMsgDopsDepA: @@ -877,89 +1078,128 @@ static inline s8 sbp_message_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ case SbpMsgDops: return sbp_msg_dops_decode(buf, len, n_read, &msg->dops); case SbpMsgEcdsaCertificate: - return sbp_msg_ecdsa_certificate_decode(buf, len, n_read, &msg->ecdsa_certificate); + return sbp_msg_ecdsa_certificate_decode(buf, len, n_read, + &msg->ecdsa_certificate); case SbpMsgEcdsaSignatureDepA: - return sbp_msg_ecdsa_signature_dep_a_decode(buf, len, n_read, &msg->ecdsa_signature_dep_a); + return sbp_msg_ecdsa_signature_dep_a_decode(buf, len, n_read, + &msg->ecdsa_signature_dep_a); case SbpMsgEcdsaSignatureDepB: - return sbp_msg_ecdsa_signature_dep_b_decode(buf, len, n_read, &msg->ecdsa_signature_dep_b); + return sbp_msg_ecdsa_signature_dep_b_decode(buf, len, n_read, + &msg->ecdsa_signature_dep_b); case SbpMsgEcdsaSignature: - return sbp_msg_ecdsa_signature_decode(buf, len, n_read, &msg->ecdsa_signature); + return sbp_msg_ecdsa_signature_decode(buf, len, n_read, + &msg->ecdsa_signature); case SbpMsgEd25519CertificateDep: - return sbp_msg_ed25519_certificate_dep_decode(buf, len, n_read, &msg->ed25519_certificate_dep); + return sbp_msg_ed25519_certificate_dep_decode( + buf, len, n_read, &msg->ed25519_certificate_dep); case SbpMsgEd25519SignatureDepA: - return sbp_msg_ed25519_signature_dep_a_decode(buf, len, n_read, &msg->ed25519_signature_dep_a); + return sbp_msg_ed25519_signature_dep_a_decode( + buf, len, n_read, &msg->ed25519_signature_dep_a); case SbpMsgEd25519SignatureDepB: - return sbp_msg_ed25519_signature_dep_b_decode(buf, len, n_read, &msg->ed25519_signature_dep_b); + return sbp_msg_ed25519_signature_dep_b_decode( + buf, len, n_read, &msg->ed25519_signature_dep_b); case SbpMsgEphemerisBds: - return sbp_msg_ephemeris_bds_decode(buf, len, n_read, &msg->ephemeris_bds); + return sbp_msg_ephemeris_bds_decode(buf, len, n_read, + &msg->ephemeris_bds); case SbpMsgEphemerisDepA: - return sbp_msg_ephemeris_dep_a_decode(buf, len, n_read, &msg->ephemeris_dep_a); + return sbp_msg_ephemeris_dep_a_decode(buf, len, n_read, + &msg->ephemeris_dep_a); case SbpMsgEphemerisDepB: - return sbp_msg_ephemeris_dep_b_decode(buf, len, n_read, &msg->ephemeris_dep_b); + return sbp_msg_ephemeris_dep_b_decode(buf, len, n_read, + &msg->ephemeris_dep_b); case SbpMsgEphemerisDepC: - return sbp_msg_ephemeris_dep_c_decode(buf, len, n_read, &msg->ephemeris_dep_c); + return sbp_msg_ephemeris_dep_c_decode(buf, len, n_read, + &msg->ephemeris_dep_c); case SbpMsgEphemerisDepD: - return sbp_msg_ephemeris_dep_d_decode(buf, len, n_read, &msg->ephemeris_dep_d); + return sbp_msg_ephemeris_dep_d_decode(buf, len, n_read, + &msg->ephemeris_dep_d); case SbpMsgEphemerisGalDepA: - return sbp_msg_ephemeris_gal_dep_a_decode(buf, len, n_read, &msg->ephemeris_gal_dep_a); + return sbp_msg_ephemeris_gal_dep_a_decode(buf, len, n_read, + &msg->ephemeris_gal_dep_a); case SbpMsgEphemerisGal: - return sbp_msg_ephemeris_gal_decode(buf, len, n_read, &msg->ephemeris_gal); + return sbp_msg_ephemeris_gal_decode(buf, len, n_read, + &msg->ephemeris_gal); case SbpMsgEphemerisGloDepA: - return sbp_msg_ephemeris_glo_dep_a_decode(buf, len, n_read, &msg->ephemeris_glo_dep_a); + return sbp_msg_ephemeris_glo_dep_a_decode(buf, len, n_read, + &msg->ephemeris_glo_dep_a); case SbpMsgEphemerisGloDepB: - return sbp_msg_ephemeris_glo_dep_b_decode(buf, len, n_read, &msg->ephemeris_glo_dep_b); + return sbp_msg_ephemeris_glo_dep_b_decode(buf, len, n_read, + &msg->ephemeris_glo_dep_b); case SbpMsgEphemerisGloDepC: - return sbp_msg_ephemeris_glo_dep_c_decode(buf, len, n_read, &msg->ephemeris_glo_dep_c); + return sbp_msg_ephemeris_glo_dep_c_decode(buf, len, n_read, + &msg->ephemeris_glo_dep_c); case SbpMsgEphemerisGloDepD: - return sbp_msg_ephemeris_glo_dep_d_decode(buf, len, n_read, &msg->ephemeris_glo_dep_d); + return sbp_msg_ephemeris_glo_dep_d_decode(buf, len, n_read, + &msg->ephemeris_glo_dep_d); case SbpMsgEphemerisGlo: - return sbp_msg_ephemeris_glo_decode(buf, len, n_read, &msg->ephemeris_glo); + return sbp_msg_ephemeris_glo_decode(buf, len, n_read, + &msg->ephemeris_glo); case SbpMsgEphemerisGpsDepE: - return sbp_msg_ephemeris_gps_dep_e_decode(buf, len, n_read, &msg->ephemeris_gps_dep_e); + return sbp_msg_ephemeris_gps_dep_e_decode(buf, len, n_read, + &msg->ephemeris_gps_dep_e); case SbpMsgEphemerisGpsDepF: - return sbp_msg_ephemeris_gps_dep_f_decode(buf, len, n_read, &msg->ephemeris_gps_dep_f); + return sbp_msg_ephemeris_gps_dep_f_decode(buf, len, n_read, + &msg->ephemeris_gps_dep_f); case SbpMsgEphemerisGps: - return sbp_msg_ephemeris_gps_decode(buf, len, n_read, &msg->ephemeris_gps); + return sbp_msg_ephemeris_gps_decode(buf, len, n_read, + &msg->ephemeris_gps); case SbpMsgEphemerisQzss: - return sbp_msg_ephemeris_qzss_decode(buf, len, n_read, &msg->ephemeris_qzss); + return sbp_msg_ephemeris_qzss_decode(buf, len, n_read, + &msg->ephemeris_qzss); case SbpMsgEphemerisSbasDepA: - return sbp_msg_ephemeris_sbas_dep_a_decode(buf, len, n_read, &msg->ephemeris_sbas_dep_a); + return sbp_msg_ephemeris_sbas_dep_a_decode(buf, len, n_read, + &msg->ephemeris_sbas_dep_a); case SbpMsgEphemerisSbasDepB: - return sbp_msg_ephemeris_sbas_dep_b_decode(buf, len, n_read, &msg->ephemeris_sbas_dep_b); + return sbp_msg_ephemeris_sbas_dep_b_decode(buf, len, n_read, + &msg->ephemeris_sbas_dep_b); case SbpMsgEphemerisSbas: - return sbp_msg_ephemeris_sbas_decode(buf, len, n_read, &msg->ephemeris_sbas); + return sbp_msg_ephemeris_sbas_decode(buf, len, n_read, + &msg->ephemeris_sbas); case SbpMsgExtEvent: return sbp_msg_ext_event_decode(buf, len, n_read, &msg->ext_event); case SbpMsgFileioConfigReq: - return sbp_msg_fileio_config_req_decode(buf, len, n_read, &msg->fileio_config_req); + return sbp_msg_fileio_config_req_decode(buf, len, n_read, + &msg->fileio_config_req); case SbpMsgFileioConfigResp: - return sbp_msg_fileio_config_resp_decode(buf, len, n_read, &msg->fileio_config_resp); + return sbp_msg_fileio_config_resp_decode(buf, len, n_read, + &msg->fileio_config_resp); case SbpMsgFileioReadDirReq: - return sbp_msg_fileio_read_dir_req_decode(buf, len, n_read, &msg->fileio_read_dir_req); + return sbp_msg_fileio_read_dir_req_decode(buf, len, n_read, + &msg->fileio_read_dir_req); case SbpMsgFileioReadDirResp: - return sbp_msg_fileio_read_dir_resp_decode(buf, len, n_read, &msg->fileio_read_dir_resp); + return sbp_msg_fileio_read_dir_resp_decode(buf, len, n_read, + &msg->fileio_read_dir_resp); case SbpMsgFileioReadReq: - return sbp_msg_fileio_read_req_decode(buf, len, n_read, &msg->fileio_read_req); + return sbp_msg_fileio_read_req_decode(buf, len, n_read, + &msg->fileio_read_req); case SbpMsgFileioReadResp: - return sbp_msg_fileio_read_resp_decode(buf, len, n_read, &msg->fileio_read_resp); + return sbp_msg_fileio_read_resp_decode(buf, len, n_read, + &msg->fileio_read_resp); case SbpMsgFileioRemove: - return sbp_msg_fileio_remove_decode(buf, len, n_read, &msg->fileio_remove); + return sbp_msg_fileio_remove_decode(buf, len, n_read, + &msg->fileio_remove); case SbpMsgFileioWriteReq: - return sbp_msg_fileio_write_req_decode(buf, len, n_read, &msg->fileio_write_req); + return sbp_msg_fileio_write_req_decode(buf, len, n_read, + &msg->fileio_write_req); case SbpMsgFileioWriteResp: - return sbp_msg_fileio_write_resp_decode(buf, len, n_read, &msg->fileio_write_resp); + return sbp_msg_fileio_write_resp_decode(buf, len, n_read, + &msg->fileio_write_resp); case SbpMsgFlashDone: return sbp_msg_flash_done_decode(buf, len, n_read, &msg->flash_done); case SbpMsgFlashErase: return sbp_msg_flash_erase_decode(buf, len, n_read, &msg->flash_erase); case SbpMsgFlashProgram: - return sbp_msg_flash_program_decode(buf, len, n_read, &msg->flash_program); + return sbp_msg_flash_program_decode(buf, len, n_read, + &msg->flash_program); case SbpMsgFlashReadReq: - return sbp_msg_flash_read_req_decode(buf, len, n_read, &msg->flash_read_req); + return sbp_msg_flash_read_req_decode(buf, len, n_read, + &msg->flash_read_req); case SbpMsgFlashReadResp: - return sbp_msg_flash_read_resp_decode(buf, len, n_read, &msg->flash_read_resp); + return sbp_msg_flash_read_resp_decode(buf, len, n_read, + &msg->flash_read_resp); case SbpMsgFrontEndGain: - return sbp_msg_front_end_gain_decode(buf, len, n_read, &msg->front_end_gain); + return sbp_msg_front_end_gain_decode(buf, len, n_read, + &msg->front_end_gain); case SbpMsgFwd: return sbp_msg_fwd_decode(buf, len, n_read, &msg->fwd); case SbpMsgGloBiases: @@ -967,17 +1207,22 @@ static inline s8 sbp_message_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ case SbpMsgGnssCapb: return sbp_msg_gnss_capb_decode(buf, len, n_read, &msg->gnss_capb); case SbpMsgGnssTimeOffset: - return sbp_msg_gnss_time_offset_decode(buf, len, n_read, &msg->gnss_time_offset); + return sbp_msg_gnss_time_offset_decode(buf, len, n_read, + &msg->gnss_time_offset); case SbpMsgGpsTimeDepA: - return sbp_msg_gps_time_dep_a_decode(buf, len, n_read, &msg->gps_time_dep_a); + return sbp_msg_gps_time_dep_a_decode(buf, len, n_read, + &msg->gps_time_dep_a); case SbpMsgGpsTimeGnss: - return sbp_msg_gps_time_gnss_decode(buf, len, n_read, &msg->gps_time_gnss); + return sbp_msg_gps_time_gnss_decode(buf, len, n_read, + &msg->gps_time_gnss); case SbpMsgGpsTime: return sbp_msg_gps_time_decode(buf, len, n_read, &msg->gps_time); case SbpMsgGroupDelayDepA: - return sbp_msg_group_delay_dep_a_decode(buf, len, n_read, &msg->group_delay_dep_a); + return sbp_msg_group_delay_dep_a_decode(buf, len, n_read, + &msg->group_delay_dep_a); case SbpMsgGroupDelayDepB: - return sbp_msg_group_delay_dep_b_decode(buf, len, n_read, &msg->group_delay_dep_b); + return sbp_msg_group_delay_dep_b_decode(buf, len, n_read, + &msg->group_delay_dep_b); case SbpMsgGroupDelay: return sbp_msg_group_delay_decode(buf, len, n_read, &msg->group_delay); case SbpMsgGroupMeta: @@ -991,7 +1236,8 @@ static inline s8 sbp_message_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ case SbpMsgImuRaw: return sbp_msg_imu_raw_decode(buf, len, n_read, &msg->imu_raw); case SbpMsgInitBaseDep: - return sbp_msg_init_base_dep_decode(buf, len, n_read, &msg->init_base_dep); + return sbp_msg_init_base_dep_decode(buf, len, n_read, + &msg->init_base_dep); case SbpMsgInsStatus: return sbp_msg_ins_status_decode(buf, len, n_read, &msg->ins_status); case SbpMsgInsUpdates: @@ -999,51 +1245,71 @@ static inline s8 sbp_message_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ case SbpMsgIono: return sbp_msg_iono_decode(buf, len, n_read, &msg->iono); case SbpMsgLinuxCpuStateDepA: - return sbp_msg_linux_cpu_state_dep_a_decode(buf, len, n_read, &msg->linux_cpu_state_dep_a); + return sbp_msg_linux_cpu_state_dep_a_decode(buf, len, n_read, + &msg->linux_cpu_state_dep_a); case SbpMsgLinuxCpuState: - return sbp_msg_linux_cpu_state_decode(buf, len, n_read, &msg->linux_cpu_state); + return sbp_msg_linux_cpu_state_decode(buf, len, n_read, + &msg->linux_cpu_state); case SbpMsgLinuxMemStateDepA: - return sbp_msg_linux_mem_state_dep_a_decode(buf, len, n_read, &msg->linux_mem_state_dep_a); + return sbp_msg_linux_mem_state_dep_a_decode(buf, len, n_read, + &msg->linux_mem_state_dep_a); case SbpMsgLinuxMemState: - return sbp_msg_linux_mem_state_decode(buf, len, n_read, &msg->linux_mem_state); + return sbp_msg_linux_mem_state_decode(buf, len, n_read, + &msg->linux_mem_state); case SbpMsgLinuxProcessFdCount: - return sbp_msg_linux_process_fd_count_decode(buf, len, n_read, &msg->linux_process_fd_count); + return sbp_msg_linux_process_fd_count_decode( + buf, len, n_read, &msg->linux_process_fd_count); case SbpMsgLinuxProcessFdSummary: - return sbp_msg_linux_process_fd_summary_decode(buf, len, n_read, &msg->linux_process_fd_summary); + return sbp_msg_linux_process_fd_summary_decode( + buf, len, n_read, &msg->linux_process_fd_summary); case SbpMsgLinuxProcessSocketCounts: - return sbp_msg_linux_process_socket_counts_decode(buf, len, n_read, &msg->linux_process_socket_counts); + return sbp_msg_linux_process_socket_counts_decode( + buf, len, n_read, &msg->linux_process_socket_counts); case SbpMsgLinuxProcessSocketQueues: - return sbp_msg_linux_process_socket_queues_decode(buf, len, n_read, &msg->linux_process_socket_queues); + return sbp_msg_linux_process_socket_queues_decode( + buf, len, n_read, &msg->linux_process_socket_queues); case SbpMsgLinuxSocketUsage: - return sbp_msg_linux_socket_usage_decode(buf, len, n_read, &msg->linux_socket_usage); + return sbp_msg_linux_socket_usage_decode(buf, len, n_read, + &msg->linux_socket_usage); case SbpMsgLinuxSysStateDepA: - return sbp_msg_linux_sys_state_dep_a_decode(buf, len, n_read, &msg->linux_sys_state_dep_a); + return sbp_msg_linux_sys_state_dep_a_decode(buf, len, n_read, + &msg->linux_sys_state_dep_a); case SbpMsgLinuxSysState: - return sbp_msg_linux_sys_state_decode(buf, len, n_read, &msg->linux_sys_state); + return sbp_msg_linux_sys_state_decode(buf, len, n_read, + &msg->linux_sys_state); case SbpMsgLog: return sbp_msg_log_decode(buf, len, n_read, &msg->log); case SbpMsgM25FlashWriteStatus: - return sbp_msg_m25_flash_write_status_decode(buf, len, n_read, &msg->m25_flash_write_status); + return sbp_msg_m25_flash_write_status_decode( + buf, len, n_read, &msg->m25_flash_write_status); case SbpMsgMagRaw: return sbp_msg_mag_raw_decode(buf, len, n_read, &msg->mag_raw); case SbpMsgMaskSatelliteDep: - return sbp_msg_mask_satellite_dep_decode(buf, len, n_read, &msg->mask_satellite_dep); + return sbp_msg_mask_satellite_dep_decode(buf, len, n_read, + &msg->mask_satellite_dep); case SbpMsgMaskSatellite: - return sbp_msg_mask_satellite_decode(buf, len, n_read, &msg->mask_satellite); + return sbp_msg_mask_satellite_decode(buf, len, n_read, + &msg->mask_satellite); case SbpMsgMeasurementState: - return sbp_msg_measurement_state_decode(buf, len, n_read, &msg->measurement_state); + return sbp_msg_measurement_state_decode(buf, len, n_read, + &msg->measurement_state); case SbpMsgNapDeviceDnaReq: - return sbp_msg_nap_device_dna_req_decode(buf, len, n_read, &msg->nap_device_dna_req); + return sbp_msg_nap_device_dna_req_decode(buf, len, n_read, + &msg->nap_device_dna_req); case SbpMsgNapDeviceDnaResp: - return sbp_msg_nap_device_dna_resp_decode(buf, len, n_read, &msg->nap_device_dna_resp); + return sbp_msg_nap_device_dna_resp_decode(buf, len, n_read, + &msg->nap_device_dna_resp); case SbpMsgNdbEvent: return sbp_msg_ndb_event_decode(buf, len, n_read, &msg->ndb_event); case SbpMsgNetworkBandwidthUsage: - return sbp_msg_network_bandwidth_usage_decode(buf, len, n_read, &msg->network_bandwidth_usage); + return sbp_msg_network_bandwidth_usage_decode( + buf, len, n_read, &msg->network_bandwidth_usage); case SbpMsgNetworkStateReq: - return sbp_msg_network_state_req_decode(buf, len, n_read, &msg->network_state_req); + return sbp_msg_network_state_req_decode(buf, len, n_read, + &msg->network_state_req); case SbpMsgNetworkStateResp: - return sbp_msg_network_state_resp_decode(buf, len, n_read, &msg->network_state_resp); + return sbp_msg_network_state_resp_decode(buf, len, n_read, + &msg->network_state_resp); case SbpMsgObsDepA: return sbp_msg_obs_dep_a_decode(buf, len, n_read, &msg->obs_dep_a); case SbpMsgObsDepB: @@ -1061,73 +1327,95 @@ static inline s8 sbp_message_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ case SbpMsgOsr: return sbp_msg_osr_decode(buf, len, n_read, &msg->osr); case SbpMsgPosEcefCovGnss: - return sbp_msg_pos_ecef_cov_gnss_decode(buf, len, n_read, &msg->pos_ecef_cov_gnss); + return sbp_msg_pos_ecef_cov_gnss_decode(buf, len, n_read, + &msg->pos_ecef_cov_gnss); case SbpMsgPosEcefCov: return sbp_msg_pos_ecef_cov_decode(buf, len, n_read, &msg->pos_ecef_cov); case SbpMsgPosEcefDepA: - return sbp_msg_pos_ecef_dep_a_decode(buf, len, n_read, &msg->pos_ecef_dep_a); + return sbp_msg_pos_ecef_dep_a_decode(buf, len, n_read, + &msg->pos_ecef_dep_a); case SbpMsgPosEcefGnss: - return sbp_msg_pos_ecef_gnss_decode(buf, len, n_read, &msg->pos_ecef_gnss); + return sbp_msg_pos_ecef_gnss_decode(buf, len, n_read, + &msg->pos_ecef_gnss); case SbpMsgPosEcef: return sbp_msg_pos_ecef_decode(buf, len, n_read, &msg->pos_ecef); case SbpMsgPosLlhAcc: return sbp_msg_pos_llh_acc_decode(buf, len, n_read, &msg->pos_llh_acc); case SbpMsgPosLlhCovGnss: - return sbp_msg_pos_llh_cov_gnss_decode(buf, len, n_read, &msg->pos_llh_cov_gnss); + return sbp_msg_pos_llh_cov_gnss_decode(buf, len, n_read, + &msg->pos_llh_cov_gnss); case SbpMsgPosLlhCov: return sbp_msg_pos_llh_cov_decode(buf, len, n_read, &msg->pos_llh_cov); case SbpMsgPosLlhDepA: - return sbp_msg_pos_llh_dep_a_decode(buf, len, n_read, &msg->pos_llh_dep_a); + return sbp_msg_pos_llh_dep_a_decode(buf, len, n_read, + &msg->pos_llh_dep_a); case SbpMsgPosLlhGnss: return sbp_msg_pos_llh_gnss_decode(buf, len, n_read, &msg->pos_llh_gnss); case SbpMsgPosLlh: return sbp_msg_pos_llh_decode(buf, len, n_read, &msg->pos_llh); case SbpMsgPoseRelative: - return sbp_msg_pose_relative_decode(buf, len, n_read, &msg->pose_relative); + return sbp_msg_pose_relative_decode(buf, len, n_read, + &msg->pose_relative); case SbpMsgPpsTime: return sbp_msg_pps_time_decode(buf, len, n_read, &msg->pps_time); case SbpMsgPrintDep: return sbp_msg_print_dep_decode(buf, len, n_read, &msg->print_dep); case SbpMsgProtectionLevelDepA: - return sbp_msg_protection_level_dep_a_decode(buf, len, n_read, &msg->protection_level_dep_a); + return sbp_msg_protection_level_dep_a_decode( + buf, len, n_read, &msg->protection_level_dep_a); case SbpMsgProtectionLevel: - return sbp_msg_protection_level_decode(buf, len, n_read, &msg->protection_level); + return sbp_msg_protection_level_decode(buf, len, n_read, + &msg->protection_level); case SbpMsgReferenceFrameParam: - return sbp_msg_reference_frame_param_decode(buf, len, n_read, &msg->reference_frame_param); + return sbp_msg_reference_frame_param_decode(buf, len, n_read, + &msg->reference_frame_param); case SbpMsgResetDep: return sbp_msg_reset_dep_decode(buf, len, n_read, &msg->reset_dep); case SbpMsgResetFilters: - return sbp_msg_reset_filters_decode(buf, len, n_read, &msg->reset_filters); + return sbp_msg_reset_filters_decode(buf, len, n_read, + &msg->reset_filters); case SbpMsgReset: return sbp_msg_reset_decode(buf, len, n_read, &msg->reset); case SbpMsgSbasRaw: return sbp_msg_sbas_raw_decode(buf, len, n_read, &msg->sbas_raw); case SbpMsgSensorAidEvent: - return sbp_msg_sensor_aid_event_decode(buf, len, n_read, &msg->sensor_aid_event); + return sbp_msg_sensor_aid_event_decode(buf, len, n_read, + &msg->sensor_aid_event); case SbpMsgSetTime: return sbp_msg_set_time_decode(buf, len, n_read, &msg->set_time); case SbpMsgSettingsReadByIndexDone: - return sbp_msg_settings_read_by_index_done_decode(buf, len, n_read, &msg->settings_read_by_index_done); + return sbp_msg_settings_read_by_index_done_decode( + buf, len, n_read, &msg->settings_read_by_index_done); case SbpMsgSettingsReadByIndexReq: - return sbp_msg_settings_read_by_index_req_decode(buf, len, n_read, &msg->settings_read_by_index_req); + return sbp_msg_settings_read_by_index_req_decode( + buf, len, n_read, &msg->settings_read_by_index_req); case SbpMsgSettingsReadByIndexResp: - return sbp_msg_settings_read_by_index_resp_decode(buf, len, n_read, &msg->settings_read_by_index_resp); + return sbp_msg_settings_read_by_index_resp_decode( + buf, len, n_read, &msg->settings_read_by_index_resp); case SbpMsgSettingsReadReq: - return sbp_msg_settings_read_req_decode(buf, len, n_read, &msg->settings_read_req); + return sbp_msg_settings_read_req_decode(buf, len, n_read, + &msg->settings_read_req); case SbpMsgSettingsReadResp: - return sbp_msg_settings_read_resp_decode(buf, len, n_read, &msg->settings_read_resp); + return sbp_msg_settings_read_resp_decode(buf, len, n_read, + &msg->settings_read_resp); case SbpMsgSettingsRegisterResp: - return sbp_msg_settings_register_resp_decode(buf, len, n_read, &msg->settings_register_resp); + return sbp_msg_settings_register_resp_decode( + buf, len, n_read, &msg->settings_register_resp); case SbpMsgSettingsRegister: - return sbp_msg_settings_register_decode(buf, len, n_read, &msg->settings_register); + return sbp_msg_settings_register_decode(buf, len, n_read, + &msg->settings_register); case SbpMsgSettingsSave: - return sbp_msg_settings_save_decode(buf, len, n_read, &msg->settings_save); + return sbp_msg_settings_save_decode(buf, len, n_read, + &msg->settings_save); case SbpMsgSettingsWriteResp: - return sbp_msg_settings_write_resp_decode(buf, len, n_read, &msg->settings_write_resp); + return sbp_msg_settings_write_resp_decode(buf, len, n_read, + &msg->settings_write_resp); case SbpMsgSettingsWrite: - return sbp_msg_settings_write_decode(buf, len, n_read, &msg->settings_write); + return sbp_msg_settings_write_decode(buf, len, n_read, + &msg->settings_write); case SbpMsgSolnMetaDepA: - return sbp_msg_soln_meta_dep_a_decode(buf, len, n_read, &msg->soln_meta_dep_a); + return sbp_msg_soln_meta_dep_a_decode(buf, len, n_read, + &msg->soln_meta_dep_a); case SbpMsgSolnMeta: return sbp_msg_soln_meta_decode(buf, len, n_read, &msg->soln_meta); case SbpMsgSpecanDep: @@ -1135,105 +1423,148 @@ static inline s8 sbp_message_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ case SbpMsgSpecan: return sbp_msg_specan_decode(buf, len, n_read, &msg->specan); case SbpMsgSsrCodeBiases: - return sbp_msg_ssr_code_biases_decode(buf, len, n_read, &msg->ssr_code_biases); + return sbp_msg_ssr_code_biases_decode(buf, len, n_read, + &msg->ssr_code_biases); case SbpMsgSsrCodePhaseBiasesBounds: - return sbp_msg_ssr_code_phase_biases_bounds_decode(buf, len, n_read, &msg->ssr_code_phase_biases_bounds); + return sbp_msg_ssr_code_phase_biases_bounds_decode( + buf, len, n_read, &msg->ssr_code_phase_biases_bounds); case SbpMsgSsrFlagHighLevel: - return sbp_msg_ssr_flag_high_level_decode(buf, len, n_read, &msg->ssr_flag_high_level); + return sbp_msg_ssr_flag_high_level_decode(buf, len, n_read, + &msg->ssr_flag_high_level); case SbpMsgSsrFlagIonoGridPointSatLos: - return sbp_msg_ssr_flag_iono_grid_point_sat_los_decode(buf, len, n_read, &msg->ssr_flag_iono_grid_point_sat_los); + return sbp_msg_ssr_flag_iono_grid_point_sat_los_decode( + buf, len, n_read, &msg->ssr_flag_iono_grid_point_sat_los); case SbpMsgSsrFlagIonoGridPoints: - return sbp_msg_ssr_flag_iono_grid_points_decode(buf, len, n_read, &msg->ssr_flag_iono_grid_points); + return sbp_msg_ssr_flag_iono_grid_points_decode( + buf, len, n_read, &msg->ssr_flag_iono_grid_points); case SbpMsgSsrFlagIonoTileSatLos: - return sbp_msg_ssr_flag_iono_tile_sat_los_decode(buf, len, n_read, &msg->ssr_flag_iono_tile_sat_los); + return sbp_msg_ssr_flag_iono_tile_sat_los_decode( + buf, len, n_read, &msg->ssr_flag_iono_tile_sat_los); case SbpMsgSsrFlagSatellites: - return sbp_msg_ssr_flag_satellites_decode(buf, len, n_read, &msg->ssr_flag_satellites); + return sbp_msg_ssr_flag_satellites_decode(buf, len, n_read, + &msg->ssr_flag_satellites); case SbpMsgSsrFlagTropoGridPoints: - return sbp_msg_ssr_flag_tropo_grid_points_decode(buf, len, n_read, &msg->ssr_flag_tropo_grid_points); + return sbp_msg_ssr_flag_tropo_grid_points_decode( + buf, len, n_read, &msg->ssr_flag_tropo_grid_points); case SbpMsgSsrGridDefinitionDepA: - return sbp_msg_ssr_grid_definition_dep_a_decode(buf, len, n_read, &msg->ssr_grid_definition_dep_a); + return sbp_msg_ssr_grid_definition_dep_a_decode( + buf, len, n_read, &msg->ssr_grid_definition_dep_a); case SbpMsgSsrGriddedCorrectionBounds: - return sbp_msg_ssr_gridded_correction_bounds_decode(buf, len, n_read, &msg->ssr_gridded_correction_bounds); + return sbp_msg_ssr_gridded_correction_bounds_decode( + buf, len, n_read, &msg->ssr_gridded_correction_bounds); case SbpMsgSsrGriddedCorrectionDepA: - return sbp_msg_ssr_gridded_correction_dep_a_decode(buf, len, n_read, &msg->ssr_gridded_correction_dep_a); + return sbp_msg_ssr_gridded_correction_dep_a_decode( + buf, len, n_read, &msg->ssr_gridded_correction_dep_a); case SbpMsgSsrGriddedCorrectionNoStdDepA: - return sbp_msg_ssr_gridded_correction_no_std_dep_a_decode(buf, len, n_read, &msg->ssr_gridded_correction_no_std_dep_a); + return sbp_msg_ssr_gridded_correction_no_std_dep_a_decode( + buf, len, n_read, &msg->ssr_gridded_correction_no_std_dep_a); case SbpMsgSsrGriddedCorrection: - return sbp_msg_ssr_gridded_correction_decode(buf, len, n_read, &msg->ssr_gridded_correction); + return sbp_msg_ssr_gridded_correction_decode( + buf, len, n_read, &msg->ssr_gridded_correction); case SbpMsgSsrOrbitClockBoundsDegradation: - return sbp_msg_ssr_orbit_clock_bounds_degradation_decode(buf, len, n_read, &msg->ssr_orbit_clock_bounds_degradation); + return sbp_msg_ssr_orbit_clock_bounds_degradation_decode( + buf, len, n_read, &msg->ssr_orbit_clock_bounds_degradation); case SbpMsgSsrOrbitClockBounds: - return sbp_msg_ssr_orbit_clock_bounds_decode(buf, len, n_read, &msg->ssr_orbit_clock_bounds); + return sbp_msg_ssr_orbit_clock_bounds_decode( + buf, len, n_read, &msg->ssr_orbit_clock_bounds); case SbpMsgSsrOrbitClockDepA: - return sbp_msg_ssr_orbit_clock_dep_a_decode(buf, len, n_read, &msg->ssr_orbit_clock_dep_a); + return sbp_msg_ssr_orbit_clock_dep_a_decode(buf, len, n_read, + &msg->ssr_orbit_clock_dep_a); case SbpMsgSsrOrbitClock: - return sbp_msg_ssr_orbit_clock_decode(buf, len, n_read, &msg->ssr_orbit_clock); + return sbp_msg_ssr_orbit_clock_decode(buf, len, n_read, + &msg->ssr_orbit_clock); case SbpMsgSsrPhaseBiases: - return sbp_msg_ssr_phase_biases_decode(buf, len, n_read, &msg->ssr_phase_biases); + return sbp_msg_ssr_phase_biases_decode(buf, len, n_read, + &msg->ssr_phase_biases); case SbpMsgSsrSatelliteApcDep: - return sbp_msg_ssr_satellite_apc_dep_decode(buf, len, n_read, &msg->ssr_satellite_apc_dep); + return sbp_msg_ssr_satellite_apc_dep_decode(buf, len, n_read, + &msg->ssr_satellite_apc_dep); case SbpMsgSsrSatelliteApc: - return sbp_msg_ssr_satellite_apc_decode(buf, len, n_read, &msg->ssr_satellite_apc); + return sbp_msg_ssr_satellite_apc_decode(buf, len, n_read, + &msg->ssr_satellite_apc); case SbpMsgSsrStecCorrectionDepA: - return sbp_msg_ssr_stec_correction_dep_a_decode(buf, len, n_read, &msg->ssr_stec_correction_dep_a); + return sbp_msg_ssr_stec_correction_dep_a_decode( + buf, len, n_read, &msg->ssr_stec_correction_dep_a); case SbpMsgSsrStecCorrectionDep: - return sbp_msg_ssr_stec_correction_dep_decode(buf, len, n_read, &msg->ssr_stec_correction_dep); + return sbp_msg_ssr_stec_correction_dep_decode( + buf, len, n_read, &msg->ssr_stec_correction_dep); case SbpMsgSsrStecCorrection: - return sbp_msg_ssr_stec_correction_decode(buf, len, n_read, &msg->ssr_stec_correction); + return sbp_msg_ssr_stec_correction_decode(buf, len, n_read, + &msg->ssr_stec_correction); case SbpMsgSsrTileDefinitionDepA: - return sbp_msg_ssr_tile_definition_dep_a_decode(buf, len, n_read, &msg->ssr_tile_definition_dep_a); + return sbp_msg_ssr_tile_definition_dep_a_decode( + buf, len, n_read, &msg->ssr_tile_definition_dep_a); case SbpMsgSsrTileDefinitionDepB: - return sbp_msg_ssr_tile_definition_dep_b_decode(buf, len, n_read, &msg->ssr_tile_definition_dep_b); + return sbp_msg_ssr_tile_definition_dep_b_decode( + buf, len, n_read, &msg->ssr_tile_definition_dep_b); case SbpMsgSsrTileDefinition: - return sbp_msg_ssr_tile_definition_decode(buf, len, n_read, &msg->ssr_tile_definition); + return sbp_msg_ssr_tile_definition_decode(buf, len, n_read, + &msg->ssr_tile_definition); case SbpMsgStartup: return sbp_msg_startup_decode(buf, len, n_read, &msg->startup); case SbpMsgStatusJournal: - return sbp_msg_status_journal_decode(buf, len, n_read, &msg->status_journal); + return sbp_msg_status_journal_decode(buf, len, n_read, + &msg->status_journal); case SbpMsgStatusReport: - return sbp_msg_status_report_decode(buf, len, n_read, &msg->status_report); + return sbp_msg_status_report_decode(buf, len, n_read, + &msg->status_report); case SbpMsgStmFlashLockSector: - return sbp_msg_stm_flash_lock_sector_decode(buf, len, n_read, &msg->stm_flash_lock_sector); + return sbp_msg_stm_flash_lock_sector_decode(buf, len, n_read, + &msg->stm_flash_lock_sector); case SbpMsgStmFlashUnlockSector: - return sbp_msg_stm_flash_unlock_sector_decode(buf, len, n_read, &msg->stm_flash_unlock_sector); + return sbp_msg_stm_flash_unlock_sector_decode( + buf, len, n_read, &msg->stm_flash_unlock_sector); case SbpMsgStmUniqueIdReq: - return sbp_msg_stm_unique_id_req_decode(buf, len, n_read, &msg->stm_unique_id_req); + return sbp_msg_stm_unique_id_req_decode(buf, len, n_read, + &msg->stm_unique_id_req); case SbpMsgStmUniqueIdResp: - return sbp_msg_stm_unique_id_resp_decode(buf, len, n_read, &msg->stm_unique_id_resp); + return sbp_msg_stm_unique_id_resp_decode(buf, len, n_read, + &msg->stm_unique_id_resp); case SbpMsgSvAzEl: return sbp_msg_sv_az_el_decode(buf, len, n_read, &msg->sv_az_el); case SbpMsgSvConfigurationGpsDep: - return sbp_msg_sv_configuration_gps_dep_decode(buf, len, n_read, &msg->sv_configuration_gps_dep); + return sbp_msg_sv_configuration_gps_dep_decode( + buf, len, n_read, &msg->sv_configuration_gps_dep); case SbpMsgTelSv: return sbp_msg_tel_sv_decode(buf, len, n_read, &msg->tel_sv); case SbpMsgThreadState: return sbp_msg_thread_state_decode(buf, len, n_read, &msg->thread_state); case SbpMsgTrackingIqDepA: - return sbp_msg_tracking_iq_dep_a_decode(buf, len, n_read, &msg->tracking_iq_dep_a); + return sbp_msg_tracking_iq_dep_a_decode(buf, len, n_read, + &msg->tracking_iq_dep_a); case SbpMsgTrackingIqDepB: - return sbp_msg_tracking_iq_dep_b_decode(buf, len, n_read, &msg->tracking_iq_dep_b); + return sbp_msg_tracking_iq_dep_b_decode(buf, len, n_read, + &msg->tracking_iq_dep_b); case SbpMsgTrackingIq: return sbp_msg_tracking_iq_decode(buf, len, n_read, &msg->tracking_iq); case SbpMsgTrackingStateDepA: - return sbp_msg_tracking_state_dep_a_decode(buf, len, n_read, &msg->tracking_state_dep_a); + return sbp_msg_tracking_state_dep_a_decode(buf, len, n_read, + &msg->tracking_state_dep_a); case SbpMsgTrackingStateDepB: - return sbp_msg_tracking_state_dep_b_decode(buf, len, n_read, &msg->tracking_state_dep_b); + return sbp_msg_tracking_state_dep_b_decode(buf, len, n_read, + &msg->tracking_state_dep_b); case SbpMsgTrackingStateDetailedDepA: - return sbp_msg_tracking_state_detailed_dep_a_decode(buf, len, n_read, &msg->tracking_state_detailed_dep_a); + return sbp_msg_tracking_state_detailed_dep_a_decode( + buf, len, n_read, &msg->tracking_state_detailed_dep_a); case SbpMsgTrackingStateDetailedDep: - return sbp_msg_tracking_state_detailed_dep_decode(buf, len, n_read, &msg->tracking_state_detailed_dep); + return sbp_msg_tracking_state_detailed_dep_decode( + buf, len, n_read, &msg->tracking_state_detailed_dep); case SbpMsgTrackingState: - return sbp_msg_tracking_state_decode(buf, len, n_read, &msg->tracking_state); + return sbp_msg_tracking_state_decode(buf, len, n_read, + &msg->tracking_state); case SbpMsgUartStateDepa: - return sbp_msg_uart_state_depa_decode(buf, len, n_read, &msg->uart_state_depa); + return sbp_msg_uart_state_depa_decode(buf, len, n_read, + &msg->uart_state_depa); case SbpMsgUartState: return sbp_msg_uart_state_decode(buf, len, n_read, &msg->uart_state); case SbpMsgUserData: return sbp_msg_user_data_decode(buf, len, n_read, &msg->user_data); case SbpMsgUtcLeapSecond: - return sbp_msg_utc_leap_second_decode(buf, len, n_read, &msg->utc_leap_second); + return sbp_msg_utc_leap_second_decode(buf, len, n_read, + &msg->utc_leap_second); case SbpMsgUtcTimeGnss: - return sbp_msg_utc_time_gnss_decode(buf, len, n_read, &msg->utc_time_gnss); + return sbp_msg_utc_time_gnss_decode(buf, len, n_read, + &msg->utc_time_gnss); case SbpMsgUtcTime: return sbp_msg_utc_time_decode(buf, len, n_read, &msg->utc_time); case SbpMsgVelBody: @@ -1241,21 +1572,26 @@ static inline s8 sbp_message_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ case SbpMsgVelCog: return sbp_msg_vel_cog_decode(buf, len, n_read, &msg->vel_cog); case SbpMsgVelEcefCovGnss: - return sbp_msg_vel_ecef_cov_gnss_decode(buf, len, n_read, &msg->vel_ecef_cov_gnss); + return sbp_msg_vel_ecef_cov_gnss_decode(buf, len, n_read, + &msg->vel_ecef_cov_gnss); case SbpMsgVelEcefCov: return sbp_msg_vel_ecef_cov_decode(buf, len, n_read, &msg->vel_ecef_cov); case SbpMsgVelEcefDepA: - return sbp_msg_vel_ecef_dep_a_decode(buf, len, n_read, &msg->vel_ecef_dep_a); + return sbp_msg_vel_ecef_dep_a_decode(buf, len, n_read, + &msg->vel_ecef_dep_a); case SbpMsgVelEcefGnss: - return sbp_msg_vel_ecef_gnss_decode(buf, len, n_read, &msg->vel_ecef_gnss); + return sbp_msg_vel_ecef_gnss_decode(buf, len, n_read, + &msg->vel_ecef_gnss); case SbpMsgVelEcef: return sbp_msg_vel_ecef_decode(buf, len, n_read, &msg->vel_ecef); case SbpMsgVelNedCovGnss: - return sbp_msg_vel_ned_cov_gnss_decode(buf, len, n_read, &msg->vel_ned_cov_gnss); + return sbp_msg_vel_ned_cov_gnss_decode(buf, len, n_read, + &msg->vel_ned_cov_gnss); case SbpMsgVelNedCov: return sbp_msg_vel_ned_cov_decode(buf, len, n_read, &msg->vel_ned_cov); case SbpMsgVelNedDepA: - return sbp_msg_vel_ned_dep_a_decode(buf, len, n_read, &msg->vel_ned_dep_a); + return sbp_msg_vel_ned_dep_a_decode(buf, len, n_read, + &msg->vel_ned_dep_a); case SbpMsgVelNedGnss: return sbp_msg_vel_ned_gnss_decode(buf, len, n_read, &msg->vel_ned_gnss); case SbpMsgVelNed: @@ -1274,10 +1610,12 @@ static inline s8 sbp_message_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ * * \param msg_type SBP message type * \param msg SBP message - * \return The Number of bytes that the given message would be on the wire + * \return The Number of bytes that the given message would be on the + * wire */ -static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_msg_t *msg) { - switch(msg_type) { +static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, + const sbp_msg_t *msg) { + switch (msg_type) { case SbpMsgAcknowledge: return sbp_msg_acknowledge_encoded_len(&msg->acknowledge); case SbpMsgAcqResultDepA: @@ -1315,7 +1653,8 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_ case SbpMsgBaselineEcef: return sbp_msg_baseline_ecef_encoded_len(&msg->baseline_ecef); case SbpMsgBaselineHeadingDepA: - return sbp_msg_baseline_heading_dep_a_encoded_len(&msg->baseline_heading_dep_a); + return sbp_msg_baseline_heading_dep_a_encoded_len( + &msg->baseline_heading_dep_a); case SbpMsgBaselineHeading: return sbp_msg_baseline_heading_encoded_len(&msg->baseline_heading); case SbpMsgBaselineNedDepA: @@ -1323,17 +1662,22 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_ case SbpMsgBaselineNed: return sbp_msg_baseline_ned_encoded_len(&msg->baseline_ned); case SbpMsgBootloaderHandshakeDepA: - return sbp_msg_bootloader_handshake_dep_a_encoded_len(&msg->bootloader_handshake_dep_a); + return sbp_msg_bootloader_handshake_dep_a_encoded_len( + &msg->bootloader_handshake_dep_a); case SbpMsgBootloaderHandshakeReq: - return sbp_msg_bootloader_handshake_req_encoded_len(&msg->bootloader_handshake_req); + return sbp_msg_bootloader_handshake_req_encoded_len( + &msg->bootloader_handshake_req); case SbpMsgBootloaderHandshakeResp: - return sbp_msg_bootloader_handshake_resp_encoded_len(&msg->bootloader_handshake_resp); + return sbp_msg_bootloader_handshake_resp_encoded_len( + &msg->bootloader_handshake_resp); case SbpMsgBootloaderJumpToApp: - return sbp_msg_bootloader_jump_to_app_encoded_len(&msg->bootloader_jump_to_app); + return sbp_msg_bootloader_jump_to_app_encoded_len( + &msg->bootloader_jump_to_app); case SbpMsgCellModemStatus: return sbp_msg_cell_modem_status_encoded_len(&msg->cell_modem_status); case SbpMsgCertificateChainDep: - return sbp_msg_certificate_chain_dep_encoded_len(&msg->certificate_chain_dep); + return sbp_msg_certificate_chain_dep_encoded_len( + &msg->certificate_chain_dep); case SbpMsgCertificateChain: return sbp_msg_certificate_chain_encoded_len(&msg->certificate_chain); case SbpMsgCommandOutput: @@ -1343,7 +1687,8 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_ case SbpMsgCommandResp: return sbp_msg_command_resp_encoded_len(&msg->command_resp); case SbpMsgCsacTelemetryLabels: - return sbp_msg_csac_telemetry_labels_encoded_len(&msg->csac_telemetry_labels); + return sbp_msg_csac_telemetry_labels_encoded_len( + &msg->csac_telemetry_labels); case SbpMsgCsacTelemetry: return sbp_msg_csac_telemetry_encoded_len(&msg->csac_telemetry); case SbpMsgCwResults: @@ -1361,17 +1706,22 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_ case SbpMsgEcdsaCertificate: return sbp_msg_ecdsa_certificate_encoded_len(&msg->ecdsa_certificate); case SbpMsgEcdsaSignatureDepA: - return sbp_msg_ecdsa_signature_dep_a_encoded_len(&msg->ecdsa_signature_dep_a); + return sbp_msg_ecdsa_signature_dep_a_encoded_len( + &msg->ecdsa_signature_dep_a); case SbpMsgEcdsaSignatureDepB: - return sbp_msg_ecdsa_signature_dep_b_encoded_len(&msg->ecdsa_signature_dep_b); + return sbp_msg_ecdsa_signature_dep_b_encoded_len( + &msg->ecdsa_signature_dep_b); case SbpMsgEcdsaSignature: return sbp_msg_ecdsa_signature_encoded_len(&msg->ecdsa_signature); case SbpMsgEd25519CertificateDep: - return sbp_msg_ed25519_certificate_dep_encoded_len(&msg->ed25519_certificate_dep); + return sbp_msg_ed25519_certificate_dep_encoded_len( + &msg->ed25519_certificate_dep); case SbpMsgEd25519SignatureDepA: - return sbp_msg_ed25519_signature_dep_a_encoded_len(&msg->ed25519_signature_dep_a); + return sbp_msg_ed25519_signature_dep_a_encoded_len( + &msg->ed25519_signature_dep_a); case SbpMsgEd25519SignatureDepB: - return sbp_msg_ed25519_signature_dep_b_encoded_len(&msg->ed25519_signature_dep_b); + return sbp_msg_ed25519_signature_dep_b_encoded_len( + &msg->ed25519_signature_dep_b); case SbpMsgEphemerisBds: return sbp_msg_ephemeris_bds_encoded_len(&msg->ephemeris_bds); case SbpMsgEphemerisDepA: @@ -1405,9 +1755,11 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_ case SbpMsgEphemerisQzss: return sbp_msg_ephemeris_qzss_encoded_len(&msg->ephemeris_qzss); case SbpMsgEphemerisSbasDepA: - return sbp_msg_ephemeris_sbas_dep_a_encoded_len(&msg->ephemeris_sbas_dep_a); + return sbp_msg_ephemeris_sbas_dep_a_encoded_len( + &msg->ephemeris_sbas_dep_a); case SbpMsgEphemerisSbasDepB: - return sbp_msg_ephemeris_sbas_dep_b_encoded_len(&msg->ephemeris_sbas_dep_b); + return sbp_msg_ephemeris_sbas_dep_b_encoded_len( + &msg->ephemeris_sbas_dep_b); case SbpMsgEphemerisSbas: return sbp_msg_ephemeris_sbas_encoded_len(&msg->ephemeris_sbas); case SbpMsgExtEvent: @@ -1419,7 +1771,8 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_ case SbpMsgFileioReadDirReq: return sbp_msg_fileio_read_dir_req_encoded_len(&msg->fileio_read_dir_req); case SbpMsgFileioReadDirResp: - return sbp_msg_fileio_read_dir_resp_encoded_len(&msg->fileio_read_dir_resp); + return sbp_msg_fileio_read_dir_resp_encoded_len( + &msg->fileio_read_dir_resp); case SbpMsgFileioReadReq: return sbp_msg_fileio_read_req_encoded_len(&msg->fileio_read_req); case SbpMsgFileioReadResp: @@ -1481,31 +1834,39 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_ case SbpMsgIono: return sbp_msg_iono_encoded_len(&msg->iono); case SbpMsgLinuxCpuStateDepA: - return sbp_msg_linux_cpu_state_dep_a_encoded_len(&msg->linux_cpu_state_dep_a); + return sbp_msg_linux_cpu_state_dep_a_encoded_len( + &msg->linux_cpu_state_dep_a); case SbpMsgLinuxCpuState: return sbp_msg_linux_cpu_state_encoded_len(&msg->linux_cpu_state); case SbpMsgLinuxMemStateDepA: - return sbp_msg_linux_mem_state_dep_a_encoded_len(&msg->linux_mem_state_dep_a); + return sbp_msg_linux_mem_state_dep_a_encoded_len( + &msg->linux_mem_state_dep_a); case SbpMsgLinuxMemState: return sbp_msg_linux_mem_state_encoded_len(&msg->linux_mem_state); case SbpMsgLinuxProcessFdCount: - return sbp_msg_linux_process_fd_count_encoded_len(&msg->linux_process_fd_count); + return sbp_msg_linux_process_fd_count_encoded_len( + &msg->linux_process_fd_count); case SbpMsgLinuxProcessFdSummary: - return sbp_msg_linux_process_fd_summary_encoded_len(&msg->linux_process_fd_summary); + return sbp_msg_linux_process_fd_summary_encoded_len( + &msg->linux_process_fd_summary); case SbpMsgLinuxProcessSocketCounts: - return sbp_msg_linux_process_socket_counts_encoded_len(&msg->linux_process_socket_counts); + return sbp_msg_linux_process_socket_counts_encoded_len( + &msg->linux_process_socket_counts); case SbpMsgLinuxProcessSocketQueues: - return sbp_msg_linux_process_socket_queues_encoded_len(&msg->linux_process_socket_queues); + return sbp_msg_linux_process_socket_queues_encoded_len( + &msg->linux_process_socket_queues); case SbpMsgLinuxSocketUsage: return sbp_msg_linux_socket_usage_encoded_len(&msg->linux_socket_usage); case SbpMsgLinuxSysStateDepA: - return sbp_msg_linux_sys_state_dep_a_encoded_len(&msg->linux_sys_state_dep_a); + return sbp_msg_linux_sys_state_dep_a_encoded_len( + &msg->linux_sys_state_dep_a); case SbpMsgLinuxSysState: return sbp_msg_linux_sys_state_encoded_len(&msg->linux_sys_state); case SbpMsgLog: return sbp_msg_log_encoded_len(&msg->log); case SbpMsgM25FlashWriteStatus: - return sbp_msg_m25_flash_write_status_encoded_len(&msg->m25_flash_write_status); + return sbp_msg_m25_flash_write_status_encoded_len( + &msg->m25_flash_write_status); case SbpMsgMagRaw: return sbp_msg_mag_raw_encoded_len(&msg->mag_raw); case SbpMsgMaskSatelliteDep: @@ -1521,7 +1882,8 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_ case SbpMsgNdbEvent: return sbp_msg_ndb_event_encoded_len(&msg->ndb_event); case SbpMsgNetworkBandwidthUsage: - return sbp_msg_network_bandwidth_usage_encoded_len(&msg->network_bandwidth_usage); + return sbp_msg_network_bandwidth_usage_encoded_len( + &msg->network_bandwidth_usage); case SbpMsgNetworkStateReq: return sbp_msg_network_state_req_encoded_len(&msg->network_state_req); case SbpMsgNetworkStateResp: @@ -1571,11 +1933,13 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_ case SbpMsgPrintDep: return sbp_msg_print_dep_encoded_len(&msg->print_dep); case SbpMsgProtectionLevelDepA: - return sbp_msg_protection_level_dep_a_encoded_len(&msg->protection_level_dep_a); + return sbp_msg_protection_level_dep_a_encoded_len( + &msg->protection_level_dep_a); case SbpMsgProtectionLevel: return sbp_msg_protection_level_encoded_len(&msg->protection_level); case SbpMsgReferenceFrameParam: - return sbp_msg_reference_frame_param_encoded_len(&msg->reference_frame_param); + return sbp_msg_reference_frame_param_encoded_len( + &msg->reference_frame_param); case SbpMsgResetDep: return sbp_msg_reset_dep_encoded_len(&msg->reset_dep); case SbpMsgResetFilters: @@ -1589,17 +1953,21 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_ case SbpMsgSetTime: return sbp_msg_set_time_encoded_len(&msg->set_time); case SbpMsgSettingsReadByIndexDone: - return sbp_msg_settings_read_by_index_done_encoded_len(&msg->settings_read_by_index_done); + return sbp_msg_settings_read_by_index_done_encoded_len( + &msg->settings_read_by_index_done); case SbpMsgSettingsReadByIndexReq: - return sbp_msg_settings_read_by_index_req_encoded_len(&msg->settings_read_by_index_req); + return sbp_msg_settings_read_by_index_req_encoded_len( + &msg->settings_read_by_index_req); case SbpMsgSettingsReadByIndexResp: - return sbp_msg_settings_read_by_index_resp_encoded_len(&msg->settings_read_by_index_resp); + return sbp_msg_settings_read_by_index_resp_encoded_len( + &msg->settings_read_by_index_resp); case SbpMsgSettingsReadReq: return sbp_msg_settings_read_req_encoded_len(&msg->settings_read_req); case SbpMsgSettingsReadResp: return sbp_msg_settings_read_resp_encoded_len(&msg->settings_read_resp); case SbpMsgSettingsRegisterResp: - return sbp_msg_settings_register_resp_encoded_len(&msg->settings_register_resp); + return sbp_msg_settings_register_resp_encoded_len( + &msg->settings_register_resp); case SbpMsgSettingsRegister: return sbp_msg_settings_register_encoded_len(&msg->settings_register); case SbpMsgSettingsSave: @@ -1619,53 +1987,71 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_ case SbpMsgSsrCodeBiases: return sbp_msg_ssr_code_biases_encoded_len(&msg->ssr_code_biases); case SbpMsgSsrCodePhaseBiasesBounds: - return sbp_msg_ssr_code_phase_biases_bounds_encoded_len(&msg->ssr_code_phase_biases_bounds); + return sbp_msg_ssr_code_phase_biases_bounds_encoded_len( + &msg->ssr_code_phase_biases_bounds); case SbpMsgSsrFlagHighLevel: return sbp_msg_ssr_flag_high_level_encoded_len(&msg->ssr_flag_high_level); case SbpMsgSsrFlagIonoGridPointSatLos: - return sbp_msg_ssr_flag_iono_grid_point_sat_los_encoded_len(&msg->ssr_flag_iono_grid_point_sat_los); + return sbp_msg_ssr_flag_iono_grid_point_sat_los_encoded_len( + &msg->ssr_flag_iono_grid_point_sat_los); case SbpMsgSsrFlagIonoGridPoints: - return sbp_msg_ssr_flag_iono_grid_points_encoded_len(&msg->ssr_flag_iono_grid_points); + return sbp_msg_ssr_flag_iono_grid_points_encoded_len( + &msg->ssr_flag_iono_grid_points); case SbpMsgSsrFlagIonoTileSatLos: - return sbp_msg_ssr_flag_iono_tile_sat_los_encoded_len(&msg->ssr_flag_iono_tile_sat_los); + return sbp_msg_ssr_flag_iono_tile_sat_los_encoded_len( + &msg->ssr_flag_iono_tile_sat_los); case SbpMsgSsrFlagSatellites: return sbp_msg_ssr_flag_satellites_encoded_len(&msg->ssr_flag_satellites); case SbpMsgSsrFlagTropoGridPoints: - return sbp_msg_ssr_flag_tropo_grid_points_encoded_len(&msg->ssr_flag_tropo_grid_points); + return sbp_msg_ssr_flag_tropo_grid_points_encoded_len( + &msg->ssr_flag_tropo_grid_points); case SbpMsgSsrGridDefinitionDepA: - return sbp_msg_ssr_grid_definition_dep_a_encoded_len(&msg->ssr_grid_definition_dep_a); + return sbp_msg_ssr_grid_definition_dep_a_encoded_len( + &msg->ssr_grid_definition_dep_a); case SbpMsgSsrGriddedCorrectionBounds: - return sbp_msg_ssr_gridded_correction_bounds_encoded_len(&msg->ssr_gridded_correction_bounds); + return sbp_msg_ssr_gridded_correction_bounds_encoded_len( + &msg->ssr_gridded_correction_bounds); case SbpMsgSsrGriddedCorrectionDepA: - return sbp_msg_ssr_gridded_correction_dep_a_encoded_len(&msg->ssr_gridded_correction_dep_a); + return sbp_msg_ssr_gridded_correction_dep_a_encoded_len( + &msg->ssr_gridded_correction_dep_a); case SbpMsgSsrGriddedCorrectionNoStdDepA: - return sbp_msg_ssr_gridded_correction_no_std_dep_a_encoded_len(&msg->ssr_gridded_correction_no_std_dep_a); + return sbp_msg_ssr_gridded_correction_no_std_dep_a_encoded_len( + &msg->ssr_gridded_correction_no_std_dep_a); case SbpMsgSsrGriddedCorrection: - return sbp_msg_ssr_gridded_correction_encoded_len(&msg->ssr_gridded_correction); + return sbp_msg_ssr_gridded_correction_encoded_len( + &msg->ssr_gridded_correction); case SbpMsgSsrOrbitClockBoundsDegradation: - return sbp_msg_ssr_orbit_clock_bounds_degradation_encoded_len(&msg->ssr_orbit_clock_bounds_degradation); + return sbp_msg_ssr_orbit_clock_bounds_degradation_encoded_len( + &msg->ssr_orbit_clock_bounds_degradation); case SbpMsgSsrOrbitClockBounds: - return sbp_msg_ssr_orbit_clock_bounds_encoded_len(&msg->ssr_orbit_clock_bounds); + return sbp_msg_ssr_orbit_clock_bounds_encoded_len( + &msg->ssr_orbit_clock_bounds); case SbpMsgSsrOrbitClockDepA: - return sbp_msg_ssr_orbit_clock_dep_a_encoded_len(&msg->ssr_orbit_clock_dep_a); + return sbp_msg_ssr_orbit_clock_dep_a_encoded_len( + &msg->ssr_orbit_clock_dep_a); case SbpMsgSsrOrbitClock: return sbp_msg_ssr_orbit_clock_encoded_len(&msg->ssr_orbit_clock); case SbpMsgSsrPhaseBiases: return sbp_msg_ssr_phase_biases_encoded_len(&msg->ssr_phase_biases); case SbpMsgSsrSatelliteApcDep: - return sbp_msg_ssr_satellite_apc_dep_encoded_len(&msg->ssr_satellite_apc_dep); + return sbp_msg_ssr_satellite_apc_dep_encoded_len( + &msg->ssr_satellite_apc_dep); case SbpMsgSsrSatelliteApc: return sbp_msg_ssr_satellite_apc_encoded_len(&msg->ssr_satellite_apc); case SbpMsgSsrStecCorrectionDepA: - return sbp_msg_ssr_stec_correction_dep_a_encoded_len(&msg->ssr_stec_correction_dep_a); + return sbp_msg_ssr_stec_correction_dep_a_encoded_len( + &msg->ssr_stec_correction_dep_a); case SbpMsgSsrStecCorrectionDep: - return sbp_msg_ssr_stec_correction_dep_encoded_len(&msg->ssr_stec_correction_dep); + return sbp_msg_ssr_stec_correction_dep_encoded_len( + &msg->ssr_stec_correction_dep); case SbpMsgSsrStecCorrection: return sbp_msg_ssr_stec_correction_encoded_len(&msg->ssr_stec_correction); case SbpMsgSsrTileDefinitionDepA: - return sbp_msg_ssr_tile_definition_dep_a_encoded_len(&msg->ssr_tile_definition_dep_a); + return sbp_msg_ssr_tile_definition_dep_a_encoded_len( + &msg->ssr_tile_definition_dep_a); case SbpMsgSsrTileDefinitionDepB: - return sbp_msg_ssr_tile_definition_dep_b_encoded_len(&msg->ssr_tile_definition_dep_b); + return sbp_msg_ssr_tile_definition_dep_b_encoded_len( + &msg->ssr_tile_definition_dep_b); case SbpMsgSsrTileDefinition: return sbp_msg_ssr_tile_definition_encoded_len(&msg->ssr_tile_definition); case SbpMsgStartup: @@ -1675,9 +2061,11 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_ case SbpMsgStatusReport: return sbp_msg_status_report_encoded_len(&msg->status_report); case SbpMsgStmFlashLockSector: - return sbp_msg_stm_flash_lock_sector_encoded_len(&msg->stm_flash_lock_sector); + return sbp_msg_stm_flash_lock_sector_encoded_len( + &msg->stm_flash_lock_sector); case SbpMsgStmFlashUnlockSector: - return sbp_msg_stm_flash_unlock_sector_encoded_len(&msg->stm_flash_unlock_sector); + return sbp_msg_stm_flash_unlock_sector_encoded_len( + &msg->stm_flash_unlock_sector); case SbpMsgStmUniqueIdReq: return sbp_msg_stm_unique_id_req_encoded_len(&msg->stm_unique_id_req); case SbpMsgStmUniqueIdResp: @@ -1685,7 +2073,8 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_ case SbpMsgSvAzEl: return sbp_msg_sv_az_el_encoded_len(&msg->sv_az_el); case SbpMsgSvConfigurationGpsDep: - return sbp_msg_sv_configuration_gps_dep_encoded_len(&msg->sv_configuration_gps_dep); + return sbp_msg_sv_configuration_gps_dep_encoded_len( + &msg->sv_configuration_gps_dep); case SbpMsgTelSv: return sbp_msg_tel_sv_encoded_len(&msg->tel_sv); case SbpMsgThreadState: @@ -1697,13 +2086,17 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_ case SbpMsgTrackingIq: return sbp_msg_tracking_iq_encoded_len(&msg->tracking_iq); case SbpMsgTrackingStateDepA: - return sbp_msg_tracking_state_dep_a_encoded_len(&msg->tracking_state_dep_a); + return sbp_msg_tracking_state_dep_a_encoded_len( + &msg->tracking_state_dep_a); case SbpMsgTrackingStateDepB: - return sbp_msg_tracking_state_dep_b_encoded_len(&msg->tracking_state_dep_b); + return sbp_msg_tracking_state_dep_b_encoded_len( + &msg->tracking_state_dep_b); case SbpMsgTrackingStateDetailedDepA: - return sbp_msg_tracking_state_detailed_dep_a_encoded_len(&msg->tracking_state_detailed_dep_a); + return sbp_msg_tracking_state_detailed_dep_a_encoded_len( + &msg->tracking_state_detailed_dep_a); case SbpMsgTrackingStateDetailedDep: - return sbp_msg_tracking_state_detailed_dep_encoded_len(&msg->tracking_state_detailed_dep); + return sbp_msg_tracking_state_detailed_dep_encoded_len( + &msg->tracking_state_detailed_dep); case SbpMsgTrackingState: return sbp_msg_tracking_state_encoded_len(&msg->tracking_state); case SbpMsgUartStateDepa: @@ -1761,30 +2154,38 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, const sbp_ * 1 if, on the first non-equal field, a.field > b.field * -1 if, on the first non-equal field, a.field < b.field */ -static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, const sbp_msg_t *b) { - switch(msg_type) { +static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, + const sbp_msg_t *b) { + switch (msg_type) { case SbpMsgAcknowledge: return sbp_msg_acknowledge_cmp(&a->acknowledge, &b->acknowledge); case SbpMsgAcqResultDepA: - return sbp_msg_acq_result_dep_a_cmp(&a->acq_result_dep_a, &b->acq_result_dep_a); + return sbp_msg_acq_result_dep_a_cmp(&a->acq_result_dep_a, + &b->acq_result_dep_a); case SbpMsgAcqResultDepB: - return sbp_msg_acq_result_dep_b_cmp(&a->acq_result_dep_b, &b->acq_result_dep_b); + return sbp_msg_acq_result_dep_b_cmp(&a->acq_result_dep_b, + &b->acq_result_dep_b); case SbpMsgAcqResultDepC: - return sbp_msg_acq_result_dep_c_cmp(&a->acq_result_dep_c, &b->acq_result_dep_c); + return sbp_msg_acq_result_dep_c_cmp(&a->acq_result_dep_c, + &b->acq_result_dep_c); case SbpMsgAcqResult: return sbp_msg_acq_result_cmp(&a->acq_result, &b->acq_result); case SbpMsgAcqSvProfileDep: - return sbp_msg_acq_sv_profile_dep_cmp(&a->acq_sv_profile_dep, &b->acq_sv_profile_dep); + return sbp_msg_acq_sv_profile_dep_cmp(&a->acq_sv_profile_dep, + &b->acq_sv_profile_dep); case SbpMsgAcqSvProfile: return sbp_msg_acq_sv_profile_cmp(&a->acq_sv_profile, &b->acq_sv_profile); case SbpMsgAgeCorrections: - return sbp_msg_age_corrections_cmp(&a->age_corrections, &b->age_corrections); + return sbp_msg_age_corrections_cmp(&a->age_corrections, + &b->age_corrections); case SbpMsgAlmanacGloDep: - return sbp_msg_almanac_glo_dep_cmp(&a->almanac_glo_dep, &b->almanac_glo_dep); + return sbp_msg_almanac_glo_dep_cmp(&a->almanac_glo_dep, + &b->almanac_glo_dep); case SbpMsgAlmanacGlo: return sbp_msg_almanac_glo_cmp(&a->almanac_glo, &b->almanac_glo); case SbpMsgAlmanacGpsDep: - return sbp_msg_almanac_gps_dep_cmp(&a->almanac_gps_dep, &b->almanac_gps_dep); + return sbp_msg_almanac_gps_dep_cmp(&a->almanac_gps_dep, + &b->almanac_gps_dep); case SbpMsgAlmanacGps: return sbp_msg_almanac_gps_cmp(&a->almanac_gps, &b->almanac_gps); case SbpMsgAlmanac: @@ -1796,31 +2197,42 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, c case SbpMsgBasePosLlh: return sbp_msg_base_pos_llh_cmp(&a->base_pos_llh, &b->base_pos_llh); case SbpMsgBaselineEcefDepA: - return sbp_msg_baseline_ecef_dep_a_cmp(&a->baseline_ecef_dep_a, &b->baseline_ecef_dep_a); + return sbp_msg_baseline_ecef_dep_a_cmp(&a->baseline_ecef_dep_a, + &b->baseline_ecef_dep_a); case SbpMsgBaselineEcef: return sbp_msg_baseline_ecef_cmp(&a->baseline_ecef, &b->baseline_ecef); case SbpMsgBaselineHeadingDepA: - return sbp_msg_baseline_heading_dep_a_cmp(&a->baseline_heading_dep_a, &b->baseline_heading_dep_a); + return sbp_msg_baseline_heading_dep_a_cmp(&a->baseline_heading_dep_a, + &b->baseline_heading_dep_a); case SbpMsgBaselineHeading: - return sbp_msg_baseline_heading_cmp(&a->baseline_heading, &b->baseline_heading); + return sbp_msg_baseline_heading_cmp(&a->baseline_heading, + &b->baseline_heading); case SbpMsgBaselineNedDepA: - return sbp_msg_baseline_ned_dep_a_cmp(&a->baseline_ned_dep_a, &b->baseline_ned_dep_a); + return sbp_msg_baseline_ned_dep_a_cmp(&a->baseline_ned_dep_a, + &b->baseline_ned_dep_a); case SbpMsgBaselineNed: return sbp_msg_baseline_ned_cmp(&a->baseline_ned, &b->baseline_ned); case SbpMsgBootloaderHandshakeDepA: - return sbp_msg_bootloader_handshake_dep_a_cmp(&a->bootloader_handshake_dep_a, &b->bootloader_handshake_dep_a); + return sbp_msg_bootloader_handshake_dep_a_cmp( + &a->bootloader_handshake_dep_a, &b->bootloader_handshake_dep_a); case SbpMsgBootloaderHandshakeReq: - return sbp_msg_bootloader_handshake_req_cmp(&a->bootloader_handshake_req, &b->bootloader_handshake_req); + return sbp_msg_bootloader_handshake_req_cmp(&a->bootloader_handshake_req, + &b->bootloader_handshake_req); case SbpMsgBootloaderHandshakeResp: - return sbp_msg_bootloader_handshake_resp_cmp(&a->bootloader_handshake_resp, &b->bootloader_handshake_resp); + return sbp_msg_bootloader_handshake_resp_cmp( + &a->bootloader_handshake_resp, &b->bootloader_handshake_resp); case SbpMsgBootloaderJumpToApp: - return sbp_msg_bootloader_jump_to_app_cmp(&a->bootloader_jump_to_app, &b->bootloader_jump_to_app); + return sbp_msg_bootloader_jump_to_app_cmp(&a->bootloader_jump_to_app, + &b->bootloader_jump_to_app); case SbpMsgCellModemStatus: - return sbp_msg_cell_modem_status_cmp(&a->cell_modem_status, &b->cell_modem_status); + return sbp_msg_cell_modem_status_cmp(&a->cell_modem_status, + &b->cell_modem_status); case SbpMsgCertificateChainDep: - return sbp_msg_certificate_chain_dep_cmp(&a->certificate_chain_dep, &b->certificate_chain_dep); + return sbp_msg_certificate_chain_dep_cmp(&a->certificate_chain_dep, + &b->certificate_chain_dep); case SbpMsgCertificateChain: - return sbp_msg_certificate_chain_cmp(&a->certificate_chain, &b->certificate_chain); + return sbp_msg_certificate_chain_cmp(&a->certificate_chain, + &b->certificate_chain); case SbpMsgCommandOutput: return sbp_msg_command_output_cmp(&a->command_output, &b->command_output); case SbpMsgCommandReq: @@ -1828,7 +2240,8 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, c case SbpMsgCommandResp: return sbp_msg_command_resp_cmp(&a->command_resp, &b->command_resp); case SbpMsgCsacTelemetryLabels: - return sbp_msg_csac_telemetry_labels_cmp(&a->csac_telemetry_labels, &b->csac_telemetry_labels); + return sbp_msg_csac_telemetry_labels_cmp(&a->csac_telemetry_labels, + &b->csac_telemetry_labels); case SbpMsgCsacTelemetry: return sbp_msg_csac_telemetry_cmp(&a->csac_telemetry, &b->csac_telemetry); case SbpMsgCwResults: @@ -1844,77 +2257,105 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, c case SbpMsgDops: return sbp_msg_dops_cmp(&a->dops, &b->dops); case SbpMsgEcdsaCertificate: - return sbp_msg_ecdsa_certificate_cmp(&a->ecdsa_certificate, &b->ecdsa_certificate); + return sbp_msg_ecdsa_certificate_cmp(&a->ecdsa_certificate, + &b->ecdsa_certificate); case SbpMsgEcdsaSignatureDepA: - return sbp_msg_ecdsa_signature_dep_a_cmp(&a->ecdsa_signature_dep_a, &b->ecdsa_signature_dep_a); + return sbp_msg_ecdsa_signature_dep_a_cmp(&a->ecdsa_signature_dep_a, + &b->ecdsa_signature_dep_a); case SbpMsgEcdsaSignatureDepB: - return sbp_msg_ecdsa_signature_dep_b_cmp(&a->ecdsa_signature_dep_b, &b->ecdsa_signature_dep_b); + return sbp_msg_ecdsa_signature_dep_b_cmp(&a->ecdsa_signature_dep_b, + &b->ecdsa_signature_dep_b); case SbpMsgEcdsaSignature: - return sbp_msg_ecdsa_signature_cmp(&a->ecdsa_signature, &b->ecdsa_signature); + return sbp_msg_ecdsa_signature_cmp(&a->ecdsa_signature, + &b->ecdsa_signature); case SbpMsgEd25519CertificateDep: - return sbp_msg_ed25519_certificate_dep_cmp(&a->ed25519_certificate_dep, &b->ed25519_certificate_dep); + return sbp_msg_ed25519_certificate_dep_cmp(&a->ed25519_certificate_dep, + &b->ed25519_certificate_dep); case SbpMsgEd25519SignatureDepA: - return sbp_msg_ed25519_signature_dep_a_cmp(&a->ed25519_signature_dep_a, &b->ed25519_signature_dep_a); + return sbp_msg_ed25519_signature_dep_a_cmp(&a->ed25519_signature_dep_a, + &b->ed25519_signature_dep_a); case SbpMsgEd25519SignatureDepB: - return sbp_msg_ed25519_signature_dep_b_cmp(&a->ed25519_signature_dep_b, &b->ed25519_signature_dep_b); + return sbp_msg_ed25519_signature_dep_b_cmp(&a->ed25519_signature_dep_b, + &b->ed25519_signature_dep_b); case SbpMsgEphemerisBds: return sbp_msg_ephemeris_bds_cmp(&a->ephemeris_bds, &b->ephemeris_bds); case SbpMsgEphemerisDepA: - return sbp_msg_ephemeris_dep_a_cmp(&a->ephemeris_dep_a, &b->ephemeris_dep_a); + return sbp_msg_ephemeris_dep_a_cmp(&a->ephemeris_dep_a, + &b->ephemeris_dep_a); case SbpMsgEphemerisDepB: - return sbp_msg_ephemeris_dep_b_cmp(&a->ephemeris_dep_b, &b->ephemeris_dep_b); + return sbp_msg_ephemeris_dep_b_cmp(&a->ephemeris_dep_b, + &b->ephemeris_dep_b); case SbpMsgEphemerisDepC: - return sbp_msg_ephemeris_dep_c_cmp(&a->ephemeris_dep_c, &b->ephemeris_dep_c); + return sbp_msg_ephemeris_dep_c_cmp(&a->ephemeris_dep_c, + &b->ephemeris_dep_c); case SbpMsgEphemerisDepD: - return sbp_msg_ephemeris_dep_d_cmp(&a->ephemeris_dep_d, &b->ephemeris_dep_d); + return sbp_msg_ephemeris_dep_d_cmp(&a->ephemeris_dep_d, + &b->ephemeris_dep_d); case SbpMsgEphemerisGalDepA: - return sbp_msg_ephemeris_gal_dep_a_cmp(&a->ephemeris_gal_dep_a, &b->ephemeris_gal_dep_a); + return sbp_msg_ephemeris_gal_dep_a_cmp(&a->ephemeris_gal_dep_a, + &b->ephemeris_gal_dep_a); case SbpMsgEphemerisGal: return sbp_msg_ephemeris_gal_cmp(&a->ephemeris_gal, &b->ephemeris_gal); case SbpMsgEphemerisGloDepA: - return sbp_msg_ephemeris_glo_dep_a_cmp(&a->ephemeris_glo_dep_a, &b->ephemeris_glo_dep_a); + return sbp_msg_ephemeris_glo_dep_a_cmp(&a->ephemeris_glo_dep_a, + &b->ephemeris_glo_dep_a); case SbpMsgEphemerisGloDepB: - return sbp_msg_ephemeris_glo_dep_b_cmp(&a->ephemeris_glo_dep_b, &b->ephemeris_glo_dep_b); + return sbp_msg_ephemeris_glo_dep_b_cmp(&a->ephemeris_glo_dep_b, + &b->ephemeris_glo_dep_b); case SbpMsgEphemerisGloDepC: - return sbp_msg_ephemeris_glo_dep_c_cmp(&a->ephemeris_glo_dep_c, &b->ephemeris_glo_dep_c); + return sbp_msg_ephemeris_glo_dep_c_cmp(&a->ephemeris_glo_dep_c, + &b->ephemeris_glo_dep_c); case SbpMsgEphemerisGloDepD: - return sbp_msg_ephemeris_glo_dep_d_cmp(&a->ephemeris_glo_dep_d, &b->ephemeris_glo_dep_d); + return sbp_msg_ephemeris_glo_dep_d_cmp(&a->ephemeris_glo_dep_d, + &b->ephemeris_glo_dep_d); case SbpMsgEphemerisGlo: return sbp_msg_ephemeris_glo_cmp(&a->ephemeris_glo, &b->ephemeris_glo); case SbpMsgEphemerisGpsDepE: - return sbp_msg_ephemeris_gps_dep_e_cmp(&a->ephemeris_gps_dep_e, &b->ephemeris_gps_dep_e); + return sbp_msg_ephemeris_gps_dep_e_cmp(&a->ephemeris_gps_dep_e, + &b->ephemeris_gps_dep_e); case SbpMsgEphemerisGpsDepF: - return sbp_msg_ephemeris_gps_dep_f_cmp(&a->ephemeris_gps_dep_f, &b->ephemeris_gps_dep_f); + return sbp_msg_ephemeris_gps_dep_f_cmp(&a->ephemeris_gps_dep_f, + &b->ephemeris_gps_dep_f); case SbpMsgEphemerisGps: return sbp_msg_ephemeris_gps_cmp(&a->ephemeris_gps, &b->ephemeris_gps); case SbpMsgEphemerisQzss: return sbp_msg_ephemeris_qzss_cmp(&a->ephemeris_qzss, &b->ephemeris_qzss); case SbpMsgEphemerisSbasDepA: - return sbp_msg_ephemeris_sbas_dep_a_cmp(&a->ephemeris_sbas_dep_a, &b->ephemeris_sbas_dep_a); + return sbp_msg_ephemeris_sbas_dep_a_cmp(&a->ephemeris_sbas_dep_a, + &b->ephemeris_sbas_dep_a); case SbpMsgEphemerisSbasDepB: - return sbp_msg_ephemeris_sbas_dep_b_cmp(&a->ephemeris_sbas_dep_b, &b->ephemeris_sbas_dep_b); + return sbp_msg_ephemeris_sbas_dep_b_cmp(&a->ephemeris_sbas_dep_b, + &b->ephemeris_sbas_dep_b); case SbpMsgEphemerisSbas: return sbp_msg_ephemeris_sbas_cmp(&a->ephemeris_sbas, &b->ephemeris_sbas); case SbpMsgExtEvent: return sbp_msg_ext_event_cmp(&a->ext_event, &b->ext_event); case SbpMsgFileioConfigReq: - return sbp_msg_fileio_config_req_cmp(&a->fileio_config_req, &b->fileio_config_req); + return sbp_msg_fileio_config_req_cmp(&a->fileio_config_req, + &b->fileio_config_req); case SbpMsgFileioConfigResp: - return sbp_msg_fileio_config_resp_cmp(&a->fileio_config_resp, &b->fileio_config_resp); + return sbp_msg_fileio_config_resp_cmp(&a->fileio_config_resp, + &b->fileio_config_resp); case SbpMsgFileioReadDirReq: - return sbp_msg_fileio_read_dir_req_cmp(&a->fileio_read_dir_req, &b->fileio_read_dir_req); + return sbp_msg_fileio_read_dir_req_cmp(&a->fileio_read_dir_req, + &b->fileio_read_dir_req); case SbpMsgFileioReadDirResp: - return sbp_msg_fileio_read_dir_resp_cmp(&a->fileio_read_dir_resp, &b->fileio_read_dir_resp); + return sbp_msg_fileio_read_dir_resp_cmp(&a->fileio_read_dir_resp, + &b->fileio_read_dir_resp); case SbpMsgFileioReadReq: - return sbp_msg_fileio_read_req_cmp(&a->fileio_read_req, &b->fileio_read_req); + return sbp_msg_fileio_read_req_cmp(&a->fileio_read_req, + &b->fileio_read_req); case SbpMsgFileioReadResp: - return sbp_msg_fileio_read_resp_cmp(&a->fileio_read_resp, &b->fileio_read_resp); + return sbp_msg_fileio_read_resp_cmp(&a->fileio_read_resp, + &b->fileio_read_resp); case SbpMsgFileioRemove: return sbp_msg_fileio_remove_cmp(&a->fileio_remove, &b->fileio_remove); case SbpMsgFileioWriteReq: - return sbp_msg_fileio_write_req_cmp(&a->fileio_write_req, &b->fileio_write_req); + return sbp_msg_fileio_write_req_cmp(&a->fileio_write_req, + &b->fileio_write_req); case SbpMsgFileioWriteResp: - return sbp_msg_fileio_write_resp_cmp(&a->fileio_write_resp, &b->fileio_write_resp); + return sbp_msg_fileio_write_resp_cmp(&a->fileio_write_resp, + &b->fileio_write_resp); case SbpMsgFlashDone: return sbp_msg_flash_done_cmp(&a->flash_done, &b->flash_done); case SbpMsgFlashErase: @@ -1924,7 +2365,8 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, c case SbpMsgFlashReadReq: return sbp_msg_flash_read_req_cmp(&a->flash_read_req, &b->flash_read_req); case SbpMsgFlashReadResp: - return sbp_msg_flash_read_resp_cmp(&a->flash_read_resp, &b->flash_read_resp); + return sbp_msg_flash_read_resp_cmp(&a->flash_read_resp, + &b->flash_read_resp); case SbpMsgFrontEndGain: return sbp_msg_front_end_gain_cmp(&a->front_end_gain, &b->front_end_gain); case SbpMsgFwd: @@ -1934,7 +2376,8 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, c case SbpMsgGnssCapb: return sbp_msg_gnss_capb_cmp(&a->gnss_capb, &b->gnss_capb); case SbpMsgGnssTimeOffset: - return sbp_msg_gnss_time_offset_cmp(&a->gnss_time_offset, &b->gnss_time_offset); + return sbp_msg_gnss_time_offset_cmp(&a->gnss_time_offset, + &b->gnss_time_offset); case SbpMsgGpsTimeDepA: return sbp_msg_gps_time_dep_a_cmp(&a->gps_time_dep_a, &b->gps_time_dep_a); case SbpMsgGpsTimeGnss: @@ -1942,9 +2385,11 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, c case SbpMsgGpsTime: return sbp_msg_gps_time_cmp(&a->gps_time, &b->gps_time); case SbpMsgGroupDelayDepA: - return sbp_msg_group_delay_dep_a_cmp(&a->group_delay_dep_a, &b->group_delay_dep_a); + return sbp_msg_group_delay_dep_a_cmp(&a->group_delay_dep_a, + &b->group_delay_dep_a); case SbpMsgGroupDelayDepB: - return sbp_msg_group_delay_dep_b_cmp(&a->group_delay_dep_b, &b->group_delay_dep_b); + return sbp_msg_group_delay_dep_b_cmp(&a->group_delay_dep_b, + &b->group_delay_dep_b); case SbpMsgGroupDelay: return sbp_msg_group_delay_cmp(&a->group_delay, &b->group_delay); case SbpMsgGroupMeta: @@ -1966,51 +2411,70 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, c case SbpMsgIono: return sbp_msg_iono_cmp(&a->iono, &b->iono); case SbpMsgLinuxCpuStateDepA: - return sbp_msg_linux_cpu_state_dep_a_cmp(&a->linux_cpu_state_dep_a, &b->linux_cpu_state_dep_a); + return sbp_msg_linux_cpu_state_dep_a_cmp(&a->linux_cpu_state_dep_a, + &b->linux_cpu_state_dep_a); case SbpMsgLinuxCpuState: - return sbp_msg_linux_cpu_state_cmp(&a->linux_cpu_state, &b->linux_cpu_state); + return sbp_msg_linux_cpu_state_cmp(&a->linux_cpu_state, + &b->linux_cpu_state); case SbpMsgLinuxMemStateDepA: - return sbp_msg_linux_mem_state_dep_a_cmp(&a->linux_mem_state_dep_a, &b->linux_mem_state_dep_a); + return sbp_msg_linux_mem_state_dep_a_cmp(&a->linux_mem_state_dep_a, + &b->linux_mem_state_dep_a); case SbpMsgLinuxMemState: - return sbp_msg_linux_mem_state_cmp(&a->linux_mem_state, &b->linux_mem_state); + return sbp_msg_linux_mem_state_cmp(&a->linux_mem_state, + &b->linux_mem_state); case SbpMsgLinuxProcessFdCount: - return sbp_msg_linux_process_fd_count_cmp(&a->linux_process_fd_count, &b->linux_process_fd_count); + return sbp_msg_linux_process_fd_count_cmp(&a->linux_process_fd_count, + &b->linux_process_fd_count); case SbpMsgLinuxProcessFdSummary: - return sbp_msg_linux_process_fd_summary_cmp(&a->linux_process_fd_summary, &b->linux_process_fd_summary); + return sbp_msg_linux_process_fd_summary_cmp(&a->linux_process_fd_summary, + &b->linux_process_fd_summary); case SbpMsgLinuxProcessSocketCounts: - return sbp_msg_linux_process_socket_counts_cmp(&a->linux_process_socket_counts, &b->linux_process_socket_counts); + return sbp_msg_linux_process_socket_counts_cmp( + &a->linux_process_socket_counts, &b->linux_process_socket_counts); case SbpMsgLinuxProcessSocketQueues: - return sbp_msg_linux_process_socket_queues_cmp(&a->linux_process_socket_queues, &b->linux_process_socket_queues); + return sbp_msg_linux_process_socket_queues_cmp( + &a->linux_process_socket_queues, &b->linux_process_socket_queues); case SbpMsgLinuxSocketUsage: - return sbp_msg_linux_socket_usage_cmp(&a->linux_socket_usage, &b->linux_socket_usage); + return sbp_msg_linux_socket_usage_cmp(&a->linux_socket_usage, + &b->linux_socket_usage); case SbpMsgLinuxSysStateDepA: - return sbp_msg_linux_sys_state_dep_a_cmp(&a->linux_sys_state_dep_a, &b->linux_sys_state_dep_a); + return sbp_msg_linux_sys_state_dep_a_cmp(&a->linux_sys_state_dep_a, + &b->linux_sys_state_dep_a); case SbpMsgLinuxSysState: - return sbp_msg_linux_sys_state_cmp(&a->linux_sys_state, &b->linux_sys_state); + return sbp_msg_linux_sys_state_cmp(&a->linux_sys_state, + &b->linux_sys_state); case SbpMsgLog: return sbp_msg_log_cmp(&a->log, &b->log); case SbpMsgM25FlashWriteStatus: - return sbp_msg_m25_flash_write_status_cmp(&a->m25_flash_write_status, &b->m25_flash_write_status); + return sbp_msg_m25_flash_write_status_cmp(&a->m25_flash_write_status, + &b->m25_flash_write_status); case SbpMsgMagRaw: return sbp_msg_mag_raw_cmp(&a->mag_raw, &b->mag_raw); case SbpMsgMaskSatelliteDep: - return sbp_msg_mask_satellite_dep_cmp(&a->mask_satellite_dep, &b->mask_satellite_dep); + return sbp_msg_mask_satellite_dep_cmp(&a->mask_satellite_dep, + &b->mask_satellite_dep); case SbpMsgMaskSatellite: return sbp_msg_mask_satellite_cmp(&a->mask_satellite, &b->mask_satellite); case SbpMsgMeasurementState: - return sbp_msg_measurement_state_cmp(&a->measurement_state, &b->measurement_state); + return sbp_msg_measurement_state_cmp(&a->measurement_state, + &b->measurement_state); case SbpMsgNapDeviceDnaReq: - return sbp_msg_nap_device_dna_req_cmp(&a->nap_device_dna_req, &b->nap_device_dna_req); + return sbp_msg_nap_device_dna_req_cmp(&a->nap_device_dna_req, + &b->nap_device_dna_req); case SbpMsgNapDeviceDnaResp: - return sbp_msg_nap_device_dna_resp_cmp(&a->nap_device_dna_resp, &b->nap_device_dna_resp); + return sbp_msg_nap_device_dna_resp_cmp(&a->nap_device_dna_resp, + &b->nap_device_dna_resp); case SbpMsgNdbEvent: return sbp_msg_ndb_event_cmp(&a->ndb_event, &b->ndb_event); case SbpMsgNetworkBandwidthUsage: - return sbp_msg_network_bandwidth_usage_cmp(&a->network_bandwidth_usage, &b->network_bandwidth_usage); + return sbp_msg_network_bandwidth_usage_cmp(&a->network_bandwidth_usage, + &b->network_bandwidth_usage); case SbpMsgNetworkStateReq: - return sbp_msg_network_state_req_cmp(&a->network_state_req, &b->network_state_req); + return sbp_msg_network_state_req_cmp(&a->network_state_req, + &b->network_state_req); case SbpMsgNetworkStateResp: - return sbp_msg_network_state_resp_cmp(&a->network_state_resp, &b->network_state_resp); + return sbp_msg_network_state_resp_cmp(&a->network_state_resp, + &b->network_state_resp); case SbpMsgObsDepA: return sbp_msg_obs_dep_a_cmp(&a->obs_dep_a, &b->obs_dep_a); case SbpMsgObsDepB: @@ -2028,7 +2492,8 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, c case SbpMsgOsr: return sbp_msg_osr_cmp(&a->osr, &b->osr); case SbpMsgPosEcefCovGnss: - return sbp_msg_pos_ecef_cov_gnss_cmp(&a->pos_ecef_cov_gnss, &b->pos_ecef_cov_gnss); + return sbp_msg_pos_ecef_cov_gnss_cmp(&a->pos_ecef_cov_gnss, + &b->pos_ecef_cov_gnss); case SbpMsgPosEcefCov: return sbp_msg_pos_ecef_cov_cmp(&a->pos_ecef_cov, &b->pos_ecef_cov); case SbpMsgPosEcefDepA: @@ -2040,7 +2505,8 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, c case SbpMsgPosLlhAcc: return sbp_msg_pos_llh_acc_cmp(&a->pos_llh_acc, &b->pos_llh_acc); case SbpMsgPosLlhCovGnss: - return sbp_msg_pos_llh_cov_gnss_cmp(&a->pos_llh_cov_gnss, &b->pos_llh_cov_gnss); + return sbp_msg_pos_llh_cov_gnss_cmp(&a->pos_llh_cov_gnss, + &b->pos_llh_cov_gnss); case SbpMsgPosLlhCov: return sbp_msg_pos_llh_cov_cmp(&a->pos_llh_cov, &b->pos_llh_cov); case SbpMsgPosLlhDepA: @@ -2056,11 +2522,14 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, c case SbpMsgPrintDep: return sbp_msg_print_dep_cmp(&a->print_dep, &b->print_dep); case SbpMsgProtectionLevelDepA: - return sbp_msg_protection_level_dep_a_cmp(&a->protection_level_dep_a, &b->protection_level_dep_a); + return sbp_msg_protection_level_dep_a_cmp(&a->protection_level_dep_a, + &b->protection_level_dep_a); case SbpMsgProtectionLevel: - return sbp_msg_protection_level_cmp(&a->protection_level, &b->protection_level); + return sbp_msg_protection_level_cmp(&a->protection_level, + &b->protection_level); case SbpMsgReferenceFrameParam: - return sbp_msg_reference_frame_param_cmp(&a->reference_frame_param, &b->reference_frame_param); + return sbp_msg_reference_frame_param_cmp(&a->reference_frame_param, + &b->reference_frame_param); case SbpMsgResetDep: return sbp_msg_reset_dep_cmp(&a->reset_dep, &b->reset_dep); case SbpMsgResetFilters: @@ -2070,31 +2539,41 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, c case SbpMsgSbasRaw: return sbp_msg_sbas_raw_cmp(&a->sbas_raw, &b->sbas_raw); case SbpMsgSensorAidEvent: - return sbp_msg_sensor_aid_event_cmp(&a->sensor_aid_event, &b->sensor_aid_event); + return sbp_msg_sensor_aid_event_cmp(&a->sensor_aid_event, + &b->sensor_aid_event); case SbpMsgSetTime: return sbp_msg_set_time_cmp(&a->set_time, &b->set_time); case SbpMsgSettingsReadByIndexDone: - return sbp_msg_settings_read_by_index_done_cmp(&a->settings_read_by_index_done, &b->settings_read_by_index_done); + return sbp_msg_settings_read_by_index_done_cmp( + &a->settings_read_by_index_done, &b->settings_read_by_index_done); case SbpMsgSettingsReadByIndexReq: - return sbp_msg_settings_read_by_index_req_cmp(&a->settings_read_by_index_req, &b->settings_read_by_index_req); + return sbp_msg_settings_read_by_index_req_cmp( + &a->settings_read_by_index_req, &b->settings_read_by_index_req); case SbpMsgSettingsReadByIndexResp: - return sbp_msg_settings_read_by_index_resp_cmp(&a->settings_read_by_index_resp, &b->settings_read_by_index_resp); + return sbp_msg_settings_read_by_index_resp_cmp( + &a->settings_read_by_index_resp, &b->settings_read_by_index_resp); case SbpMsgSettingsReadReq: - return sbp_msg_settings_read_req_cmp(&a->settings_read_req, &b->settings_read_req); + return sbp_msg_settings_read_req_cmp(&a->settings_read_req, + &b->settings_read_req); case SbpMsgSettingsReadResp: - return sbp_msg_settings_read_resp_cmp(&a->settings_read_resp, &b->settings_read_resp); + return sbp_msg_settings_read_resp_cmp(&a->settings_read_resp, + &b->settings_read_resp); case SbpMsgSettingsRegisterResp: - return sbp_msg_settings_register_resp_cmp(&a->settings_register_resp, &b->settings_register_resp); + return sbp_msg_settings_register_resp_cmp(&a->settings_register_resp, + &b->settings_register_resp); case SbpMsgSettingsRegister: - return sbp_msg_settings_register_cmp(&a->settings_register, &b->settings_register); + return sbp_msg_settings_register_cmp(&a->settings_register, + &b->settings_register); case SbpMsgSettingsSave: return sbp_msg_settings_save_cmp(&a->settings_save, &b->settings_save); case SbpMsgSettingsWriteResp: - return sbp_msg_settings_write_resp_cmp(&a->settings_write_resp, &b->settings_write_resp); + return sbp_msg_settings_write_resp_cmp(&a->settings_write_resp, + &b->settings_write_resp); case SbpMsgSettingsWrite: return sbp_msg_settings_write_cmp(&a->settings_write, &b->settings_write); case SbpMsgSolnMetaDepA: - return sbp_msg_soln_meta_dep_a_cmp(&a->soln_meta_dep_a, &b->soln_meta_dep_a); + return sbp_msg_soln_meta_dep_a_cmp(&a->soln_meta_dep_a, + &b->soln_meta_dep_a); case SbpMsgSolnMeta: return sbp_msg_soln_meta_cmp(&a->soln_meta, &b->soln_meta); case SbpMsgSpecanDep: @@ -2102,57 +2581,86 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, c case SbpMsgSpecan: return sbp_msg_specan_cmp(&a->specan, &b->specan); case SbpMsgSsrCodeBiases: - return sbp_msg_ssr_code_biases_cmp(&a->ssr_code_biases, &b->ssr_code_biases); + return sbp_msg_ssr_code_biases_cmp(&a->ssr_code_biases, + &b->ssr_code_biases); case SbpMsgSsrCodePhaseBiasesBounds: - return sbp_msg_ssr_code_phase_biases_bounds_cmp(&a->ssr_code_phase_biases_bounds, &b->ssr_code_phase_biases_bounds); + return sbp_msg_ssr_code_phase_biases_bounds_cmp( + &a->ssr_code_phase_biases_bounds, &b->ssr_code_phase_biases_bounds); case SbpMsgSsrFlagHighLevel: - return sbp_msg_ssr_flag_high_level_cmp(&a->ssr_flag_high_level, &b->ssr_flag_high_level); + return sbp_msg_ssr_flag_high_level_cmp(&a->ssr_flag_high_level, + &b->ssr_flag_high_level); case SbpMsgSsrFlagIonoGridPointSatLos: - return sbp_msg_ssr_flag_iono_grid_point_sat_los_cmp(&a->ssr_flag_iono_grid_point_sat_los, &b->ssr_flag_iono_grid_point_sat_los); + return sbp_msg_ssr_flag_iono_grid_point_sat_los_cmp( + &a->ssr_flag_iono_grid_point_sat_los, + &b->ssr_flag_iono_grid_point_sat_los); case SbpMsgSsrFlagIonoGridPoints: - return sbp_msg_ssr_flag_iono_grid_points_cmp(&a->ssr_flag_iono_grid_points, &b->ssr_flag_iono_grid_points); + return sbp_msg_ssr_flag_iono_grid_points_cmp( + &a->ssr_flag_iono_grid_points, &b->ssr_flag_iono_grid_points); case SbpMsgSsrFlagIonoTileSatLos: - return sbp_msg_ssr_flag_iono_tile_sat_los_cmp(&a->ssr_flag_iono_tile_sat_los, &b->ssr_flag_iono_tile_sat_los); + return sbp_msg_ssr_flag_iono_tile_sat_los_cmp( + &a->ssr_flag_iono_tile_sat_los, &b->ssr_flag_iono_tile_sat_los); case SbpMsgSsrFlagSatellites: - return sbp_msg_ssr_flag_satellites_cmp(&a->ssr_flag_satellites, &b->ssr_flag_satellites); + return sbp_msg_ssr_flag_satellites_cmp(&a->ssr_flag_satellites, + &b->ssr_flag_satellites); case SbpMsgSsrFlagTropoGridPoints: - return sbp_msg_ssr_flag_tropo_grid_points_cmp(&a->ssr_flag_tropo_grid_points, &b->ssr_flag_tropo_grid_points); + return sbp_msg_ssr_flag_tropo_grid_points_cmp( + &a->ssr_flag_tropo_grid_points, &b->ssr_flag_tropo_grid_points); case SbpMsgSsrGridDefinitionDepA: - return sbp_msg_ssr_grid_definition_dep_a_cmp(&a->ssr_grid_definition_dep_a, &b->ssr_grid_definition_dep_a); + return sbp_msg_ssr_grid_definition_dep_a_cmp( + &a->ssr_grid_definition_dep_a, &b->ssr_grid_definition_dep_a); case SbpMsgSsrGriddedCorrectionBounds: - return sbp_msg_ssr_gridded_correction_bounds_cmp(&a->ssr_gridded_correction_bounds, &b->ssr_gridded_correction_bounds); + return sbp_msg_ssr_gridded_correction_bounds_cmp( + &a->ssr_gridded_correction_bounds, &b->ssr_gridded_correction_bounds); case SbpMsgSsrGriddedCorrectionDepA: - return sbp_msg_ssr_gridded_correction_dep_a_cmp(&a->ssr_gridded_correction_dep_a, &b->ssr_gridded_correction_dep_a); + return sbp_msg_ssr_gridded_correction_dep_a_cmp( + &a->ssr_gridded_correction_dep_a, &b->ssr_gridded_correction_dep_a); case SbpMsgSsrGriddedCorrectionNoStdDepA: - return sbp_msg_ssr_gridded_correction_no_std_dep_a_cmp(&a->ssr_gridded_correction_no_std_dep_a, &b->ssr_gridded_correction_no_std_dep_a); + return sbp_msg_ssr_gridded_correction_no_std_dep_a_cmp( + &a->ssr_gridded_correction_no_std_dep_a, + &b->ssr_gridded_correction_no_std_dep_a); case SbpMsgSsrGriddedCorrection: - return sbp_msg_ssr_gridded_correction_cmp(&a->ssr_gridded_correction, &b->ssr_gridded_correction); + return sbp_msg_ssr_gridded_correction_cmp(&a->ssr_gridded_correction, + &b->ssr_gridded_correction); case SbpMsgSsrOrbitClockBoundsDegradation: - return sbp_msg_ssr_orbit_clock_bounds_degradation_cmp(&a->ssr_orbit_clock_bounds_degradation, &b->ssr_orbit_clock_bounds_degradation); + return sbp_msg_ssr_orbit_clock_bounds_degradation_cmp( + &a->ssr_orbit_clock_bounds_degradation, + &b->ssr_orbit_clock_bounds_degradation); case SbpMsgSsrOrbitClockBounds: - return sbp_msg_ssr_orbit_clock_bounds_cmp(&a->ssr_orbit_clock_bounds, &b->ssr_orbit_clock_bounds); + return sbp_msg_ssr_orbit_clock_bounds_cmp(&a->ssr_orbit_clock_bounds, + &b->ssr_orbit_clock_bounds); case SbpMsgSsrOrbitClockDepA: - return sbp_msg_ssr_orbit_clock_dep_a_cmp(&a->ssr_orbit_clock_dep_a, &b->ssr_orbit_clock_dep_a); + return sbp_msg_ssr_orbit_clock_dep_a_cmp(&a->ssr_orbit_clock_dep_a, + &b->ssr_orbit_clock_dep_a); case SbpMsgSsrOrbitClock: - return sbp_msg_ssr_orbit_clock_cmp(&a->ssr_orbit_clock, &b->ssr_orbit_clock); + return sbp_msg_ssr_orbit_clock_cmp(&a->ssr_orbit_clock, + &b->ssr_orbit_clock); case SbpMsgSsrPhaseBiases: - return sbp_msg_ssr_phase_biases_cmp(&a->ssr_phase_biases, &b->ssr_phase_biases); + return sbp_msg_ssr_phase_biases_cmp(&a->ssr_phase_biases, + &b->ssr_phase_biases); case SbpMsgSsrSatelliteApcDep: - return sbp_msg_ssr_satellite_apc_dep_cmp(&a->ssr_satellite_apc_dep, &b->ssr_satellite_apc_dep); + return sbp_msg_ssr_satellite_apc_dep_cmp(&a->ssr_satellite_apc_dep, + &b->ssr_satellite_apc_dep); case SbpMsgSsrSatelliteApc: - return sbp_msg_ssr_satellite_apc_cmp(&a->ssr_satellite_apc, &b->ssr_satellite_apc); + return sbp_msg_ssr_satellite_apc_cmp(&a->ssr_satellite_apc, + &b->ssr_satellite_apc); case SbpMsgSsrStecCorrectionDepA: - return sbp_msg_ssr_stec_correction_dep_a_cmp(&a->ssr_stec_correction_dep_a, &b->ssr_stec_correction_dep_a); + return sbp_msg_ssr_stec_correction_dep_a_cmp( + &a->ssr_stec_correction_dep_a, &b->ssr_stec_correction_dep_a); case SbpMsgSsrStecCorrectionDep: - return sbp_msg_ssr_stec_correction_dep_cmp(&a->ssr_stec_correction_dep, &b->ssr_stec_correction_dep); + return sbp_msg_ssr_stec_correction_dep_cmp(&a->ssr_stec_correction_dep, + &b->ssr_stec_correction_dep); case SbpMsgSsrStecCorrection: - return sbp_msg_ssr_stec_correction_cmp(&a->ssr_stec_correction, &b->ssr_stec_correction); + return sbp_msg_ssr_stec_correction_cmp(&a->ssr_stec_correction, + &b->ssr_stec_correction); case SbpMsgSsrTileDefinitionDepA: - return sbp_msg_ssr_tile_definition_dep_a_cmp(&a->ssr_tile_definition_dep_a, &b->ssr_tile_definition_dep_a); + return sbp_msg_ssr_tile_definition_dep_a_cmp( + &a->ssr_tile_definition_dep_a, &b->ssr_tile_definition_dep_a); case SbpMsgSsrTileDefinitionDepB: - return sbp_msg_ssr_tile_definition_dep_b_cmp(&a->ssr_tile_definition_dep_b, &b->ssr_tile_definition_dep_b); + return sbp_msg_ssr_tile_definition_dep_b_cmp( + &a->ssr_tile_definition_dep_b, &b->ssr_tile_definition_dep_b); case SbpMsgSsrTileDefinition: - return sbp_msg_ssr_tile_definition_cmp(&a->ssr_tile_definition, &b->ssr_tile_definition); + return sbp_msg_ssr_tile_definition_cmp(&a->ssr_tile_definition, + &b->ssr_tile_definition); case SbpMsgStartup: return sbp_msg_startup_cmp(&a->startup, &b->startup); case SbpMsgStatusJournal: @@ -2160,45 +2668,58 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, c case SbpMsgStatusReport: return sbp_msg_status_report_cmp(&a->status_report, &b->status_report); case SbpMsgStmFlashLockSector: - return sbp_msg_stm_flash_lock_sector_cmp(&a->stm_flash_lock_sector, &b->stm_flash_lock_sector); + return sbp_msg_stm_flash_lock_sector_cmp(&a->stm_flash_lock_sector, + &b->stm_flash_lock_sector); case SbpMsgStmFlashUnlockSector: - return sbp_msg_stm_flash_unlock_sector_cmp(&a->stm_flash_unlock_sector, &b->stm_flash_unlock_sector); + return sbp_msg_stm_flash_unlock_sector_cmp(&a->stm_flash_unlock_sector, + &b->stm_flash_unlock_sector); case SbpMsgStmUniqueIdReq: - return sbp_msg_stm_unique_id_req_cmp(&a->stm_unique_id_req, &b->stm_unique_id_req); + return sbp_msg_stm_unique_id_req_cmp(&a->stm_unique_id_req, + &b->stm_unique_id_req); case SbpMsgStmUniqueIdResp: - return sbp_msg_stm_unique_id_resp_cmp(&a->stm_unique_id_resp, &b->stm_unique_id_resp); + return sbp_msg_stm_unique_id_resp_cmp(&a->stm_unique_id_resp, + &b->stm_unique_id_resp); case SbpMsgSvAzEl: return sbp_msg_sv_az_el_cmp(&a->sv_az_el, &b->sv_az_el); case SbpMsgSvConfigurationGpsDep: - return sbp_msg_sv_configuration_gps_dep_cmp(&a->sv_configuration_gps_dep, &b->sv_configuration_gps_dep); + return sbp_msg_sv_configuration_gps_dep_cmp(&a->sv_configuration_gps_dep, + &b->sv_configuration_gps_dep); case SbpMsgTelSv: return sbp_msg_tel_sv_cmp(&a->tel_sv, &b->tel_sv); case SbpMsgThreadState: return sbp_msg_thread_state_cmp(&a->thread_state, &b->thread_state); case SbpMsgTrackingIqDepA: - return sbp_msg_tracking_iq_dep_a_cmp(&a->tracking_iq_dep_a, &b->tracking_iq_dep_a); + return sbp_msg_tracking_iq_dep_a_cmp(&a->tracking_iq_dep_a, + &b->tracking_iq_dep_a); case SbpMsgTrackingIqDepB: - return sbp_msg_tracking_iq_dep_b_cmp(&a->tracking_iq_dep_b, &b->tracking_iq_dep_b); + return sbp_msg_tracking_iq_dep_b_cmp(&a->tracking_iq_dep_b, + &b->tracking_iq_dep_b); case SbpMsgTrackingIq: return sbp_msg_tracking_iq_cmp(&a->tracking_iq, &b->tracking_iq); case SbpMsgTrackingStateDepA: - return sbp_msg_tracking_state_dep_a_cmp(&a->tracking_state_dep_a, &b->tracking_state_dep_a); + return sbp_msg_tracking_state_dep_a_cmp(&a->tracking_state_dep_a, + &b->tracking_state_dep_a); case SbpMsgTrackingStateDepB: - return sbp_msg_tracking_state_dep_b_cmp(&a->tracking_state_dep_b, &b->tracking_state_dep_b); + return sbp_msg_tracking_state_dep_b_cmp(&a->tracking_state_dep_b, + &b->tracking_state_dep_b); case SbpMsgTrackingStateDetailedDepA: - return sbp_msg_tracking_state_detailed_dep_a_cmp(&a->tracking_state_detailed_dep_a, &b->tracking_state_detailed_dep_a); + return sbp_msg_tracking_state_detailed_dep_a_cmp( + &a->tracking_state_detailed_dep_a, &b->tracking_state_detailed_dep_a); case SbpMsgTrackingStateDetailedDep: - return sbp_msg_tracking_state_detailed_dep_cmp(&a->tracking_state_detailed_dep, &b->tracking_state_detailed_dep); + return sbp_msg_tracking_state_detailed_dep_cmp( + &a->tracking_state_detailed_dep, &b->tracking_state_detailed_dep); case SbpMsgTrackingState: return sbp_msg_tracking_state_cmp(&a->tracking_state, &b->tracking_state); case SbpMsgUartStateDepa: - return sbp_msg_uart_state_depa_cmp(&a->uart_state_depa, &b->uart_state_depa); + return sbp_msg_uart_state_depa_cmp(&a->uart_state_depa, + &b->uart_state_depa); case SbpMsgUartState: return sbp_msg_uart_state_cmp(&a->uart_state, &b->uart_state); case SbpMsgUserData: return sbp_msg_user_data_cmp(&a->user_data, &b->user_data); case SbpMsgUtcLeapSecond: - return sbp_msg_utc_leap_second_cmp(&a->utc_leap_second, &b->utc_leap_second); + return sbp_msg_utc_leap_second_cmp(&a->utc_leap_second, + &b->utc_leap_second); case SbpMsgUtcTimeGnss: return sbp_msg_utc_time_gnss_cmp(&a->utc_time_gnss, &b->utc_time_gnss); case SbpMsgUtcTime: @@ -2208,7 +2729,8 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, c case SbpMsgVelCog: return sbp_msg_vel_cog_cmp(&a->vel_cog, &b->vel_cog); case SbpMsgVelEcefCovGnss: - return sbp_msg_vel_ecef_cov_gnss_cmp(&a->vel_ecef_cov_gnss, &b->vel_ecef_cov_gnss); + return sbp_msg_vel_ecef_cov_gnss_cmp(&a->vel_ecef_cov_gnss, + &b->vel_ecef_cov_gnss); case SbpMsgVelEcefCov: return sbp_msg_vel_ecef_cov_cmp(&a->vel_ecef_cov, &b->vel_ecef_cov); case SbpMsgVelEcefDepA: @@ -2218,7 +2740,8 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, c case SbpMsgVelEcef: return sbp_msg_vel_ecef_cmp(&a->vel_ecef, &b->vel_ecef); case SbpMsgVelNedCovGnss: - return sbp_msg_vel_ned_cov_gnss_cmp(&a->vel_ned_cov_gnss, &b->vel_ned_cov_gnss); + return sbp_msg_vel_ned_cov_gnss_cmp(&a->vel_ned_cov_gnss, + &b->vel_ned_cov_gnss); case SbpMsgVelNedCov: return sbp_msg_vel_ned_cov_cmp(&a->vel_ned_cov, &b->vel_ned_cov); case SbpMsgVelNedDepA: diff --git a/c/include/libsbp/sbp_msg_type.h b/c/include/libsbp/sbp_msg_type.h index 8bf04dd65..ce77c28ef 100644 --- a/c/include/libsbp/sbp_msg_type.h +++ b/c/include/libsbp/sbp_msg_type.h @@ -18,7 +18,6 @@ #ifndef LIBSBP_SBP_MSG_TYPE_H #define LIBSBP_SBP_MSG_TYPE_H - #include #include #include @@ -234,9 +233,11 @@ typedef enum { SbpMsgSsrGridDefinitionDepA = SBP_MSG_SSR_GRID_DEFINITION_DEP_A, SbpMsgSsrGriddedCorrectionBounds = SBP_MSG_SSR_GRIDDED_CORRECTION_BOUNDS, SbpMsgSsrGriddedCorrectionDepA = SBP_MSG_SSR_GRIDDED_CORRECTION_DEP_A, - SbpMsgSsrGriddedCorrectionNoStdDepA = SBP_MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A, + SbpMsgSsrGriddedCorrectionNoStdDepA = + SBP_MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A, SbpMsgSsrGriddedCorrection = SBP_MSG_SSR_GRIDDED_CORRECTION, - SbpMsgSsrOrbitClockBoundsDegradation = SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION, + SbpMsgSsrOrbitClockBoundsDegradation = + SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION, SbpMsgSsrOrbitClockBounds = SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS, SbpMsgSsrOrbitClockDepA = SBP_MSG_SSR_ORBIT_CLOCK_DEP_A, SbpMsgSsrOrbitClock = SBP_MSG_SSR_ORBIT_CLOCK, @@ -292,7 +293,7 @@ typedef enum { } sbp_msg_type_t; static inline const char *sbp_msg_type_to_string(sbp_msg_type_t msg_type) { - switch(msg_type) { + switch (msg_type) { case SbpMsgAcknowledge: return "MSG_ACKNOWLEDGE"; case SbpMsgAcqResultDepA: diff --git a/c/include/libsbp/settings.h b/c/include/libsbp/settings.h index a67d3e9a2..43527e9f9 100644 --- a/c/include/libsbp/settings.h +++ b/c/include/libsbp/settings.h @@ -17,15 +17,15 @@ #ifndef LIBSBP_SETTINGS_MESSAGES_H #define LIBSBP_SETTINGS_MESSAGES_H -#include -#include -#include -#include -#include +#include #include #include -#include +#include +#include #include #include +#include +#include +#include #endif /* LIBSBP_SETTINGS_MESSAGES_H */ diff --git a/c/include/libsbp/settings/MSG_SETTINGS_READ_BY_INDEX_DONE.h b/c/include/libsbp/settings/MSG_SETTINGS_READ_BY_INDEX_DONE.h index 88db8e91d..3f7fbb714 100644 --- a/c/include/libsbp/settings/MSG_SETTINGS_READ_BY_INDEX_DONE.h +++ b/c/include/libsbp/settings/MSG_SETTINGS_READ_BY_INDEX_DONE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SETTINGS_MSG_SETTINGS_READ_BY_INDEX_DONE_H #define LIBSBP_SETTINGS_MSG_SETTINGS_READ_BY_INDEX_DONE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,62 +40,83 @@ *****************************************************************************/ /** Finished reading settings (host <= device) * -* The settings message for indicating end of the settings values. + * The settings message for indicating end of the settings values. */ typedef struct { /** - * Do not use this field, it exists only to prevent illegal C syntax. Any value written to this field will be ignored + * Do not use this field, it exists only to prevent illegal C syntax. Any + * value written to this field will be ignored */ char DO_NOT_USE_dummy_field_to_prevent_empty_struct; } sbp_msg_settings_read_by_index_done_t; - - /** * Get encoded size of an instance of sbp_msg_settings_read_by_index_done_t * * @param msg sbp_msg_settings_read_by_index_done_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_settings_read_by_index_done_encoded_len(const sbp_msg_settings_read_by_index_done_t *msg) -{ +static inline size_t sbp_msg_settings_read_by_index_done_encoded_len( + const sbp_msg_settings_read_by_index_done_t *msg) { (void)msg; return SBP_MSG_SETTINGS_READ_BY_INDEX_DONE_ENCODED_LEN; } /** - * Encode an instance of sbp_msg_settings_read_by_index_done_t to wire representation + * Encode an instance of sbp_msg_settings_read_by_index_done_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_settings_read_by_index_done_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_read_by_index_done_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_by_index_done_t *msg); +SBP_EXPORT s8 sbp_msg_settings_read_by_index_done_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_read_by_index_done_t *msg); /** - * Decode an instance of sbp_msg_settings_read_by_index_done_t from wire representation + * Decode an instance of sbp_msg_settings_read_by_index_done_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_settings_read_by_index_done_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_settings_read_by_index_done_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_settings_read_by_index_done_t instance + * @param buf Wire representation of the sbp_msg_settings_read_by_index_done_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_read_by_index_done_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_by_index_done_t *msg); +SBP_EXPORT s8 sbp_msg_settings_read_by_index_done_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_read_by_index_done_t *msg); /** - * Send an instance of sbp_msg_settings_read_by_index_done_t with the given write function + * Send an instance of sbp_msg_settings_read_by_index_done_t with the given + * write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_settings_read_by_index_done_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_settings_read_by_index_done_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -103,51 +124,66 @@ SBP_EXPORT s8 sbp_msg_settings_read_by_index_done_decode(const uint8_t *buf, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_read_by_index_done_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_read_by_index_done_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_settings_read_by_index_done_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_settings_read_by_index_done_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_settings_read_by_index_done_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_settings_read_by_index_done_t instance * @param b sbp_msg_settings_read_by_index_done_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_settings_read_by_index_done_cmp(const sbp_msg_settings_read_by_index_done_t *a, const sbp_msg_settings_read_by_index_done_t *b); +SBP_EXPORT int sbp_msg_settings_read_by_index_done_cmp( + const sbp_msg_settings_read_by_index_done_t *a, + const sbp_msg_settings_read_by_index_done_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_settings_read_by_index_done_t &lhs, const sbp_msg_settings_read_by_index_done_t &rhs) { +static inline bool operator==( + const sbp_msg_settings_read_by_index_done_t &lhs, + const sbp_msg_settings_read_by_index_done_t &rhs) { return sbp_msg_settings_read_by_index_done_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_settings_read_by_index_done_t &lhs, const sbp_msg_settings_read_by_index_done_t &rhs) { +static inline bool operator!=( + const sbp_msg_settings_read_by_index_done_t &lhs, + const sbp_msg_settings_read_by_index_done_t &rhs) { return sbp_msg_settings_read_by_index_done_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_settings_read_by_index_done_t &lhs, const sbp_msg_settings_read_by_index_done_t &rhs) { +static inline bool operator<(const sbp_msg_settings_read_by_index_done_t &lhs, + const sbp_msg_settings_read_by_index_done_t &rhs) { return sbp_msg_settings_read_by_index_done_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_settings_read_by_index_done_t &lhs, const sbp_msg_settings_read_by_index_done_t &rhs) { +static inline bool operator<=( + const sbp_msg_settings_read_by_index_done_t &lhs, + const sbp_msg_settings_read_by_index_done_t &rhs) { return sbp_msg_settings_read_by_index_done_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_settings_read_by_index_done_t &lhs, const sbp_msg_settings_read_by_index_done_t &rhs) { +static inline bool operator>(const sbp_msg_settings_read_by_index_done_t &lhs, + const sbp_msg_settings_read_by_index_done_t &rhs) { return sbp_msg_settings_read_by_index_done_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_settings_read_by_index_done_t &lhs, const sbp_msg_settings_read_by_index_done_t &rhs) { +static inline bool operator>=( + const sbp_msg_settings_read_by_index_done_t &lhs, + const sbp_msg_settings_read_by_index_done_t &rhs) { return sbp_msg_settings_read_by_index_done_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SETTINGS_MSG_SETTINGS_READ_BY_INDEX_DONE_H */ - diff --git a/c/include/libsbp/settings/MSG_SETTINGS_READ_BY_INDEX_REQ.h b/c/include/libsbp/settings/MSG_SETTINGS_READ_BY_INDEX_REQ.h index 734fa30d0..e36aecefe 100644 --- a/c/include/libsbp/settings/MSG_SETTINGS_READ_BY_INDEX_REQ.h +++ b/c/include/libsbp/settings/MSG_SETTINGS_READ_BY_INDEX_REQ.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SETTINGS_MSG_SETTINGS_READ_BY_INDEX_REQ_H #define LIBSBP_SETTINGS_MSG_SETTINGS_READ_BY_INDEX_REQ_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,64 +40,84 @@ *****************************************************************************/ /** Read setting by direct index (host => device) * -* The settings message for iterating through the settings values. A device will respond to this message with a "MSG_SETTINGS_READ_BY_INDEX_RESP". + * The settings message for iterating through the settings values. A device will + * respond to this message with a "MSG_SETTINGS_READ_BY_INDEX_RESP". */ typedef struct { - - /** - * An index into the device settings, with values ranging from 0 to length(settings). + * An index into the device settings, with values ranging from 0 to + * length(settings). */ u16 index; } sbp_msg_settings_read_by_index_req_t; - - /** * Get encoded size of an instance of sbp_msg_settings_read_by_index_req_t * * @param msg sbp_msg_settings_read_by_index_req_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_settings_read_by_index_req_encoded_len(const sbp_msg_settings_read_by_index_req_t *msg) -{ +static inline size_t sbp_msg_settings_read_by_index_req_encoded_len( + const sbp_msg_settings_read_by_index_req_t *msg) { (void)msg; return SBP_MSG_SETTINGS_READ_BY_INDEX_REQ_ENCODED_LEN; } /** - * Encode an instance of sbp_msg_settings_read_by_index_req_t to wire representation + * Encode an instance of sbp_msg_settings_read_by_index_req_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_settings_read_by_index_req_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_read_by_index_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_by_index_req_t *msg); +SBP_EXPORT s8 sbp_msg_settings_read_by_index_req_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_read_by_index_req_t *msg); /** - * Decode an instance of sbp_msg_settings_read_by_index_req_t from wire representation + * Decode an instance of sbp_msg_settings_read_by_index_req_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_settings_read_by_index_req_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_settings_read_by_index_req_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_settings_read_by_index_req_t instance + * @param buf Wire representation of the sbp_msg_settings_read_by_index_req_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_read_by_index_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_by_index_req_t *msg); +SBP_EXPORT s8 sbp_msg_settings_read_by_index_req_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_read_by_index_req_t *msg); /** - * Send an instance of sbp_msg_settings_read_by_index_req_t with the given write function + * Send an instance of sbp_msg_settings_read_by_index_req_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_settings_read_by_index_req_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_settings_read_by_index_req_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -105,51 +125,62 @@ SBP_EXPORT s8 sbp_msg_settings_read_by_index_req_decode(const uint8_t *buf, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_read_by_index_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_read_by_index_req_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_settings_read_by_index_req_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_settings_read_by_index_req_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_settings_read_by_index_req_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_settings_read_by_index_req_t instance * @param b sbp_msg_settings_read_by_index_req_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_settings_read_by_index_req_cmp(const sbp_msg_settings_read_by_index_req_t *a, const sbp_msg_settings_read_by_index_req_t *b); +SBP_EXPORT int sbp_msg_settings_read_by_index_req_cmp( + const sbp_msg_settings_read_by_index_req_t *a, + const sbp_msg_settings_read_by_index_req_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_settings_read_by_index_req_t &lhs, const sbp_msg_settings_read_by_index_req_t &rhs) { +static inline bool operator==(const sbp_msg_settings_read_by_index_req_t &lhs, + const sbp_msg_settings_read_by_index_req_t &rhs) { return sbp_msg_settings_read_by_index_req_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_settings_read_by_index_req_t &lhs, const sbp_msg_settings_read_by_index_req_t &rhs) { +static inline bool operator!=(const sbp_msg_settings_read_by_index_req_t &lhs, + const sbp_msg_settings_read_by_index_req_t &rhs) { return sbp_msg_settings_read_by_index_req_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_settings_read_by_index_req_t &lhs, const sbp_msg_settings_read_by_index_req_t &rhs) { +static inline bool operator<(const sbp_msg_settings_read_by_index_req_t &lhs, + const sbp_msg_settings_read_by_index_req_t &rhs) { return sbp_msg_settings_read_by_index_req_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_settings_read_by_index_req_t &lhs, const sbp_msg_settings_read_by_index_req_t &rhs) { +static inline bool operator<=(const sbp_msg_settings_read_by_index_req_t &lhs, + const sbp_msg_settings_read_by_index_req_t &rhs) { return sbp_msg_settings_read_by_index_req_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_settings_read_by_index_req_t &lhs, const sbp_msg_settings_read_by_index_req_t &rhs) { +static inline bool operator>(const sbp_msg_settings_read_by_index_req_t &lhs, + const sbp_msg_settings_read_by_index_req_t &rhs) { return sbp_msg_settings_read_by_index_req_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_settings_read_by_index_req_t &lhs, const sbp_msg_settings_read_by_index_req_t &rhs) { +static inline bool operator>=(const sbp_msg_settings_read_by_index_req_t &lhs, + const sbp_msg_settings_read_by_index_req_t &rhs) { return sbp_msg_settings_read_by_index_req_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SETTINGS_MSG_SETTINGS_READ_BY_INDEX_REQ_H */ - diff --git a/c/include/libsbp/settings/MSG_SETTINGS_READ_BY_INDEX_RESP.h b/c/include/libsbp/settings/MSG_SETTINGS_READ_BY_INDEX_RESP.h index b7a01afd4..ca28ab538 100644 --- a/c/include/libsbp/settings/MSG_SETTINGS_READ_BY_INDEX_RESP.h +++ b/c/include/libsbp/settings/MSG_SETTINGS_READ_BY_INDEX_RESP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SETTINGS_MSG_SETTINGS_READ_BY_INDEX_RESP_H #define LIBSBP_SETTINGS_MSG_SETTINGS_READ_BY_INDEX_RESP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,178 +41,228 @@ /** Read setting by direct index (host <= device) * * The settings message that reports the value of a setting at an index. - * + * */ typedef struct { - - /** - * An index into the device settings, with values ranging from 0 to length(settings) + * An index into the device settings, with values ranging from 0 to + * length(settings) */ u16 index; - /** - * A NULL-terminated and delimited string with contents "SECTION_SETTING\0SETTING\0VALUE\0FORMAT_TYPE\0" + * A NULL-terminated and delimited string with contents + * "SECTION_SETTING\0SETTING\0VALUE\0FORMAT_TYPE\0" */ sbp_string_t setting; } sbp_msg_settings_read_by_index_resp_t; +/** + * Initialise sbp_msg_settings_read_by_index_resp_t::setting to empty + * + * @param msg sbp_msg_settings_read_by_index_resp_t instance + */ +SBP_EXPORT void sbp_msg_settings_read_by_index_resp_setting_init( + sbp_msg_settings_read_by_index_resp_t *msg); - /** - * Initialise sbp_msg_settings_read_by_index_resp_t::setting to empty - * - * @param msg sbp_msg_settings_read_by_index_resp_t instance - */ - SBP_EXPORT void sbp_msg_settings_read_by_index_resp_setting_init(sbp_msg_settings_read_by_index_resp_t *msg); - - /** - * Test sbp_msg_settings_read_by_index_resp_t::setting for validity - * - * @param msg sbp_msg_settings_read_by_index_resp_t instance - * @return true is sbp_msg_settings_read_by_index_resp_t::setting is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_valid(const sbp_msg_settings_read_by_index_resp_t *msg); +/** + * Test sbp_msg_settings_read_by_index_resp_t::setting for validity + * + * @param msg sbp_msg_settings_read_by_index_resp_t instance + * @return true is sbp_msg_settings_read_by_index_resp_t::setting is valid for + * encoding purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_valid( + const sbp_msg_settings_read_by_index_resp_t *msg); - /** - * Tests 2 instances of sbp_msg_settings_read_by_index_resp_t::setting for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_settings_read_by_index_resp_t instance - * @param b sbp_msg_settings_read_by_index_resp_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_settings_read_by_index_resp_setting_strcmp(const sbp_msg_settings_read_by_index_resp_t *a, const sbp_msg_settings_read_by_index_resp_t *b); +/** + * Tests 2 instances of sbp_msg_settings_read_by_index_resp_t::setting for + * equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_settings_read_by_index_resp_t instance + * @param b sbp_msg_settings_read_by_index_resp_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_settings_read_by_index_resp_setting_strcmp( + const sbp_msg_settings_read_by_index_resp_t *a, + const sbp_msg_settings_read_by_index_resp_t *b); - /** - * Get the encoded size of sbp_msg_settings_read_by_index_resp_t::setting - * - * @param msg sbp_msg_settings_read_by_index_resp_t instance - * @return Size of sbp_msg_settings_read_by_index_resp_t::setting in wire representation - */ - SBP_EXPORT size_t sbp_msg_settings_read_by_index_resp_setting_encoded_len(const sbp_msg_settings_read_by_index_resp_t *msg); +/** + * Get the encoded size of sbp_msg_settings_read_by_index_resp_t::setting + * + * @param msg sbp_msg_settings_read_by_index_resp_t instance + * @return Size of sbp_msg_settings_read_by_index_resp_t::setting in wire + * representation + */ +SBP_EXPORT size_t sbp_msg_settings_read_by_index_resp_setting_encoded_len( + const sbp_msg_settings_read_by_index_resp_t *msg); - /** - * Query sbp_msg_settings_read_by_index_resp_t::setting for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_settings_read_by_index_resp_t::setting before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_settings_read_by_index_resp_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_settings_read_by_index_resp_setting_space_remaining(const sbp_msg_settings_read_by_index_resp_t *msg); - /** - * Return the number of sections in sbp_msg_settings_read_by_index_resp_t::setting - * - * @param msg sbp_msg_settings_read_by_index_resp_t instance - * @return Number of sections in string - */ - SBP_EXPORT size_t sbp_msg_settings_read_by_index_resp_setting_count_sections(const sbp_msg_settings_read_by_index_resp_t *msg); +/** + * Query sbp_msg_settings_read_by_index_resp_t::setting for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_settings_read_by_index_resp_t::setting before it exceeds the + * maximum size of the field in wire representation + * + * @param msg sbp_msg_settings_read_by_index_resp_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_settings_read_by_index_resp_setting_space_remaining( + const sbp_msg_settings_read_by_index_resp_t *msg); +/** + * Return the number of sections in + * sbp_msg_settings_read_by_index_resp_t::setting + * + * @param msg sbp_msg_settings_read_by_index_resp_t instance + * @return Number of sections in string + */ +SBP_EXPORT size_t sbp_msg_settings_read_by_index_resp_setting_count_sections( + const sbp_msg_settings_read_by_index_resp_t *msg); - /** - * Add a section to sbp_msg_settings_read_by_index_resp_t::setting - * - * The specified string will be appended to the field as a new section. If the new section would end up overflowing the maximum encoded length of this field the string will not be changed and this function will return false - * - * @param msg sbp_msg_settings_read_by_index_resp_t instance - * @param new_str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_add_section(sbp_msg_settings_read_by_index_resp_t *msg, const char *new_str); +/** + * Add a section to sbp_msg_settings_read_by_index_resp_t::setting + * + * The specified string will be appended to the field as a new section. If the + * new section would end up overflowing the maximum encoded length of this field + * the string will not be changed and this function will return false + * + * @param msg sbp_msg_settings_read_by_index_resp_t instance + * @param new_str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_add_section( + sbp_msg_settings_read_by_index_resp_t *msg, const char *new_str); - /** - * Add a section to sbp_msg_settings_read_by_index_resp_t::setting with printf style formatting - * - * A new section will be added to the field according to the specified printf style format string and arguments. If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_read_by_index_resp_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_add_section_printf(sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Add a section to sbp_msg_settings_read_by_index_resp_t::setting with printf + * style formatting + * + * A new section will be added to the field according to the specified printf + * style format string and arguments. If the operation would end up overflowing + * the maximum size of this field in wire encoding the existing contents will be + * unmodified and this function will return false. + * + * @param msg sbp_msg_settings_read_by_index_resp_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_add_section_printf( + sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Add a section to sbp_msg_settings_read_by_index_resp_t::setting with printf style formatting - * - * Identical to #sbp_msg_settings_read_by_index_resp_setting_add_section_printf except it takes a va_list argument - * - * @param msg sbp_msg_settings_read_by_index_resp_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_add_section_vprintf(sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Add a section to sbp_msg_settings_read_by_index_resp_t::setting with printf + * style formatting + * + * Identical to #sbp_msg_settings_read_by_index_resp_setting_add_section_printf + * except it takes a va_list argument + * + * @param msg sbp_msg_settings_read_by_index_resp_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_add_section_vprintf( + sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Append a string to the last section in sbp_msg_settings_read_by_index_resp_t::setting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_read_by_index_resp_setting_add_section - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_read_by_index_resp_t instance - * @param str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_append(sbp_msg_settings_read_by_index_resp_t *msg, const char *str); +/** + * Append a string to the last section in + * sbp_msg_settings_read_by_index_resp_t::setting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_read_by_index_resp_setting_add_section + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_read_by_index_resp_t instance + * @param str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_append( + sbp_msg_settings_read_by_index_resp_t *msg, const char *str); - /** - * Append a string to the last section in sbp_msg_settings_read_by_index_resp_t::setting with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_read_by_index_resp_setting_add_section_printf - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_read_by_index_resp_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_append_printf(sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Append a string to the last section in + * sbp_msg_settings_read_by_index_resp_t::setting with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_read_by_index_resp_setting_add_section_printf + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_read_by_index_resp_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_append_printf( + sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Append a string to the last section in sbp_msg_settings_read_by_index_resp_t::setting with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_read_by_index_resp_setting_add_section_vprintf - * - * If the field already contains one or more sections the given string will be sppended on to the last section in the string. - * - * If the operation would end overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_read_by_index_resp_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_append_vprintf(sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Append a string to the last section in + * sbp_msg_settings_read_by_index_resp_t::setting with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_read_by_index_resp_setting_add_section_vprintf + * + * If the field already contains one or more sections the given string will be + * sppended on to the last section in the string. + * + * If the operation would end overflowing the maximum size of this field in wire + * encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_read_by_index_resp_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_by_index_resp_setting_append_vprintf( + sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Obtain a section from sbp_msg_settings_read_by_index_resp_t::setting - * - * Returns a pointer to the given subsection in the field. Sections are 0-indexed, the \p section parameters must be less than the value returned from #sbp_msg_settings_read_by_index_resp_setting_count_sections. - * - * @param msg sbp_msg_settings_read_by_index_resp_t instance - * @param section Section number - * @return Pointer to C string, NULL on error - */ - SBP_EXPORT const char *sbp_msg_settings_read_by_index_resp_setting_get_section(const sbp_msg_settings_read_by_index_resp_t *msg, size_t section); +/** + * Obtain a section from sbp_msg_settings_read_by_index_resp_t::setting + * + * Returns a pointer to the given subsection in the field. Sections are + * 0-indexed, the \p section parameters must be less than the value returned + * from #sbp_msg_settings_read_by_index_resp_setting_count_sections. + * + * @param msg sbp_msg_settings_read_by_index_resp_t instance + * @param section Section number + * @return Pointer to C string, NULL on error + */ +SBP_EXPORT const char *sbp_msg_settings_read_by_index_resp_setting_get_section( + const sbp_msg_settings_read_by_index_resp_t *msg, size_t section); - /** - * Obtain the length of a section in sbp_msg_settings_read_by_index_resp_t::setting - * - * The returned value does not include the NULL terminator. - * - * If the given section does not exist 0 is returned. - * - * @param msg sbp_msg_settings_read_by_index_resp_t instance - * @param section Section number - * @return Length of section - */ - SBP_EXPORT size_t sbp_msg_settings_read_by_index_resp_setting_section_strlen(const sbp_msg_settings_read_by_index_resp_t *msg, size_t section); +/** + * Obtain the length of a section in + * sbp_msg_settings_read_by_index_resp_t::setting + * + * The returned value does not include the NULL terminator. + * + * If the given section does not exist 0 is returned. + * + * @param msg sbp_msg_settings_read_by_index_resp_t instance + * @param section Section number + * @return Length of section + */ +SBP_EXPORT size_t sbp_msg_settings_read_by_index_resp_setting_section_strlen( + const sbp_msg_settings_read_by_index_resp_t *msg, size_t section); /** * Get encoded size of an instance of sbp_msg_settings_read_by_index_resp_t @@ -220,46 +270,67 @@ typedef struct { * @param msg sbp_msg_settings_read_by_index_resp_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_settings_read_by_index_resp_encoded_len(const sbp_msg_settings_read_by_index_resp_t *msg) -{ - return SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_ENCODED_OVERHEAD - + sbp_msg_settings_read_by_index_resp_setting_encoded_len(msg) - ; +static inline size_t sbp_msg_settings_read_by_index_resp_encoded_len( + const sbp_msg_settings_read_by_index_resp_t *msg) { + return SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_ENCODED_OVERHEAD + + sbp_msg_settings_read_by_index_resp_setting_encoded_len(msg); } /** - * Encode an instance of sbp_msg_settings_read_by_index_resp_t to wire representation + * Encode an instance of sbp_msg_settings_read_by_index_resp_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_settings_read_by_index_resp_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_read_by_index_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_by_index_resp_t *msg); +SBP_EXPORT s8 sbp_msg_settings_read_by_index_resp_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_read_by_index_resp_t *msg); /** - * Decode an instance of sbp_msg_settings_read_by_index_resp_t from wire representation + * Decode an instance of sbp_msg_settings_read_by_index_resp_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_settings_read_by_index_resp_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_settings_read_by_index_resp_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_settings_read_by_index_resp_t instance + * @param buf Wire representation of the sbp_msg_settings_read_by_index_resp_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_read_by_index_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_by_index_resp_t *msg); +SBP_EXPORT s8 sbp_msg_settings_read_by_index_resp_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_read_by_index_resp_t *msg); /** - * Send an instance of sbp_msg_settings_read_by_index_resp_t with the given write function + * Send an instance of sbp_msg_settings_read_by_index_resp_t with the given + * write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_settings_read_by_index_resp_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_settings_read_by_index_resp_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -267,51 +338,66 @@ SBP_EXPORT s8 sbp_msg_settings_read_by_index_resp_decode(const uint8_t *buf, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_read_by_index_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_read_by_index_resp_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_settings_read_by_index_resp_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_settings_read_by_index_resp_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_settings_read_by_index_resp_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_settings_read_by_index_resp_t instance * @param b sbp_msg_settings_read_by_index_resp_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_settings_read_by_index_resp_cmp(const sbp_msg_settings_read_by_index_resp_t *a, const sbp_msg_settings_read_by_index_resp_t *b); +SBP_EXPORT int sbp_msg_settings_read_by_index_resp_cmp( + const sbp_msg_settings_read_by_index_resp_t *a, + const sbp_msg_settings_read_by_index_resp_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_settings_read_by_index_resp_t &lhs, const sbp_msg_settings_read_by_index_resp_t &rhs) { +static inline bool operator==( + const sbp_msg_settings_read_by_index_resp_t &lhs, + const sbp_msg_settings_read_by_index_resp_t &rhs) { return sbp_msg_settings_read_by_index_resp_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_settings_read_by_index_resp_t &lhs, const sbp_msg_settings_read_by_index_resp_t &rhs) { +static inline bool operator!=( + const sbp_msg_settings_read_by_index_resp_t &lhs, + const sbp_msg_settings_read_by_index_resp_t &rhs) { return sbp_msg_settings_read_by_index_resp_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_settings_read_by_index_resp_t &lhs, const sbp_msg_settings_read_by_index_resp_t &rhs) { +static inline bool operator<(const sbp_msg_settings_read_by_index_resp_t &lhs, + const sbp_msg_settings_read_by_index_resp_t &rhs) { return sbp_msg_settings_read_by_index_resp_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_settings_read_by_index_resp_t &lhs, const sbp_msg_settings_read_by_index_resp_t &rhs) { +static inline bool operator<=( + const sbp_msg_settings_read_by_index_resp_t &lhs, + const sbp_msg_settings_read_by_index_resp_t &rhs) { return sbp_msg_settings_read_by_index_resp_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_settings_read_by_index_resp_t &lhs, const sbp_msg_settings_read_by_index_resp_t &rhs) { +static inline bool operator>(const sbp_msg_settings_read_by_index_resp_t &lhs, + const sbp_msg_settings_read_by_index_resp_t &rhs) { return sbp_msg_settings_read_by_index_resp_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_settings_read_by_index_resp_t &lhs, const sbp_msg_settings_read_by_index_resp_t &rhs) { +static inline bool operator>=( + const sbp_msg_settings_read_by_index_resp_t &lhs, + const sbp_msg_settings_read_by_index_resp_t &rhs) { return sbp_msg_settings_read_by_index_resp_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SETTINGS_MSG_SETTINGS_READ_BY_INDEX_RESP_H */ - diff --git a/c/include/libsbp/settings/MSG_SETTINGS_READ_REQ.h b/c/include/libsbp/settings/MSG_SETTINGS_READ_REQ.h index 061a1d345..141f5cd6a 100644 --- a/c/include/libsbp/settings/MSG_SETTINGS_READ_REQ.h +++ b/c/include/libsbp/settings/MSG_SETTINGS_READ_REQ.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SETTINGS_MSG_SETTINGS_READ_REQ_H #define LIBSBP_SETTINGS_MSG_SETTINGS_READ_REQ_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,172 +40,222 @@ *****************************************************************************/ /** Read device configuration settings (host => device) * -* The setting message that reads the device configuration. The string field is a NULL-terminated and NULL-delimited string with contents "SECTION_SETTING\0SETTING\0" where the '\0' escape sequence denotes the NULL character and where quotation marks are omitted. An example string that could be sent to a device is "solution\0soln_freq\0". A device will only respond to this message when it is received from sender ID 0x42. A device should respond with a MSG_SETTINGS_READ_RESP message (msg_id 0x00A5). + * The setting message that reads the device configuration. The string field is + * a NULL-terminated and NULL-delimited string with contents + * "SECTION_SETTING\0SETTING\0" where the '\0' escape sequence denotes the NULL + * character and where quotation marks are omitted. An example string that could + * be sent to a device is "solution\0soln_freq\0". A device will only respond to + * this message when it is received from sender ID 0x42. A device should respond + * with a MSG_SETTINGS_READ_RESP message (msg_id 0x00A5). */ typedef struct { - - /** - * A NULL-terminated and NULL-delimited string with contents "SECTION_SETTING\0SETTING\0" + * A NULL-terminated and NULL-delimited string with contents + * "SECTION_SETTING\0SETTING\0" */ sbp_string_t setting; } sbp_msg_settings_read_req_t; +/** + * Initialise sbp_msg_settings_read_req_t::setting to empty + * + * @param msg sbp_msg_settings_read_req_t instance + */ +SBP_EXPORT void sbp_msg_settings_read_req_setting_init( + sbp_msg_settings_read_req_t *msg); - /** - * Initialise sbp_msg_settings_read_req_t::setting to empty - * - * @param msg sbp_msg_settings_read_req_t instance - */ - SBP_EXPORT void sbp_msg_settings_read_req_setting_init(sbp_msg_settings_read_req_t *msg); - - /** - * Test sbp_msg_settings_read_req_t::setting for validity - * - * @param msg sbp_msg_settings_read_req_t instance - * @return true is sbp_msg_settings_read_req_t::setting is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_req_setting_valid(const sbp_msg_settings_read_req_t *msg); +/** + * Test sbp_msg_settings_read_req_t::setting for validity + * + * @param msg sbp_msg_settings_read_req_t instance + * @return true is sbp_msg_settings_read_req_t::setting is valid for encoding + * purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_req_setting_valid( + const sbp_msg_settings_read_req_t *msg); - /** - * Tests 2 instances of sbp_msg_settings_read_req_t::setting for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_settings_read_req_t instance - * @param b sbp_msg_settings_read_req_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_settings_read_req_setting_strcmp(const sbp_msg_settings_read_req_t *a, const sbp_msg_settings_read_req_t *b); +/** + * Tests 2 instances of sbp_msg_settings_read_req_t::setting for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_settings_read_req_t instance + * @param b sbp_msg_settings_read_req_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_settings_read_req_setting_strcmp( + const sbp_msg_settings_read_req_t *a, const sbp_msg_settings_read_req_t *b); - /** - * Get the encoded size of sbp_msg_settings_read_req_t::setting - * - * @param msg sbp_msg_settings_read_req_t instance - * @return Size of sbp_msg_settings_read_req_t::setting in wire representation - */ - SBP_EXPORT size_t sbp_msg_settings_read_req_setting_encoded_len(const sbp_msg_settings_read_req_t *msg); +/** + * Get the encoded size of sbp_msg_settings_read_req_t::setting + * + * @param msg sbp_msg_settings_read_req_t instance + * @return Size of sbp_msg_settings_read_req_t::setting in wire representation + */ +SBP_EXPORT size_t sbp_msg_settings_read_req_setting_encoded_len( + const sbp_msg_settings_read_req_t *msg); - /** - * Query sbp_msg_settings_read_req_t::setting for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_settings_read_req_t::setting before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_settings_read_req_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_settings_read_req_setting_space_remaining(const sbp_msg_settings_read_req_t *msg); - /** - * Return the number of sections in sbp_msg_settings_read_req_t::setting - * - * @param msg sbp_msg_settings_read_req_t instance - * @return Number of sections in string - */ - SBP_EXPORT size_t sbp_msg_settings_read_req_setting_count_sections(const sbp_msg_settings_read_req_t *msg); +/** + * Query sbp_msg_settings_read_req_t::setting for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_settings_read_req_t::setting before it exceeds the maximum + * size of the field in wire representation + * + * @param msg sbp_msg_settings_read_req_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_settings_read_req_setting_space_remaining( + const sbp_msg_settings_read_req_t *msg); +/** + * Return the number of sections in sbp_msg_settings_read_req_t::setting + * + * @param msg sbp_msg_settings_read_req_t instance + * @return Number of sections in string + */ +SBP_EXPORT size_t sbp_msg_settings_read_req_setting_count_sections( + const sbp_msg_settings_read_req_t *msg); - /** - * Add a section to sbp_msg_settings_read_req_t::setting - * - * The specified string will be appended to the field as a new section. If the new section would end up overflowing the maximum encoded length of this field the string will not be changed and this function will return false - * - * @param msg sbp_msg_settings_read_req_t instance - * @param new_str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_req_setting_add_section(sbp_msg_settings_read_req_t *msg, const char *new_str); +/** + * Add a section to sbp_msg_settings_read_req_t::setting + * + * The specified string will be appended to the field as a new section. If the + * new section would end up overflowing the maximum encoded length of this field + * the string will not be changed and this function will return false + * + * @param msg sbp_msg_settings_read_req_t instance + * @param new_str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_req_setting_add_section( + sbp_msg_settings_read_req_t *msg, const char *new_str); - /** - * Add a section to sbp_msg_settings_read_req_t::setting with printf style formatting - * - * A new section will be added to the field according to the specified printf style format string and arguments. If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_read_req_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_req_setting_add_section_printf(sbp_msg_settings_read_req_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Add a section to sbp_msg_settings_read_req_t::setting with printf style + * formatting + * + * A new section will be added to the field according to the specified printf + * style format string and arguments. If the operation would end up overflowing + * the maximum size of this field in wire encoding the existing contents will be + * unmodified and this function will return false. + * + * @param msg sbp_msg_settings_read_req_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_req_setting_add_section_printf( + sbp_msg_settings_read_req_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Add a section to sbp_msg_settings_read_req_t::setting with printf style formatting - * - * Identical to #sbp_msg_settings_read_req_setting_add_section_printf except it takes a va_list argument - * - * @param msg sbp_msg_settings_read_req_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_req_setting_add_section_vprintf(sbp_msg_settings_read_req_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Add a section to sbp_msg_settings_read_req_t::setting with printf style + * formatting + * + * Identical to #sbp_msg_settings_read_req_setting_add_section_printf except it + * takes a va_list argument + * + * @param msg sbp_msg_settings_read_req_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_req_setting_add_section_vprintf( + sbp_msg_settings_read_req_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Append a string to the last section in sbp_msg_settings_read_req_t::setting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_read_req_setting_add_section - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_read_req_t instance - * @param str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_req_setting_append(sbp_msg_settings_read_req_t *msg, const char *str); +/** + * Append a string to the last section in sbp_msg_settings_read_req_t::setting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_read_req_setting_add_section + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_read_req_t instance + * @param str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_req_setting_append( + sbp_msg_settings_read_req_t *msg, const char *str); - /** - * Append a string to the last section in sbp_msg_settings_read_req_t::setting with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_read_req_setting_add_section_printf - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_read_req_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_req_setting_append_printf(sbp_msg_settings_read_req_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Append a string to the last section in sbp_msg_settings_read_req_t::setting + * with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_read_req_setting_add_section_printf + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_read_req_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_req_setting_append_printf( + sbp_msg_settings_read_req_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Append a string to the last section in sbp_msg_settings_read_req_t::setting with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_read_req_setting_add_section_vprintf - * - * If the field already contains one or more sections the given string will be sppended on to the last section in the string. - * - * If the operation would end overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_read_req_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_req_setting_append_vprintf(sbp_msg_settings_read_req_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Append a string to the last section in sbp_msg_settings_read_req_t::setting + * with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_read_req_setting_add_section_vprintf + * + * If the field already contains one or more sections the given string will be + * sppended on to the last section in the string. + * + * If the operation would end overflowing the maximum size of this field in wire + * encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_read_req_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_req_setting_append_vprintf( + sbp_msg_settings_read_req_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Obtain a section from sbp_msg_settings_read_req_t::setting - * - * Returns a pointer to the given subsection in the field. Sections are 0-indexed, the \p section parameters must be less than the value returned from #sbp_msg_settings_read_req_setting_count_sections. - * - * @param msg sbp_msg_settings_read_req_t instance - * @param section Section number - * @return Pointer to C string, NULL on error - */ - SBP_EXPORT const char *sbp_msg_settings_read_req_setting_get_section(const sbp_msg_settings_read_req_t *msg, size_t section); +/** + * Obtain a section from sbp_msg_settings_read_req_t::setting + * + * Returns a pointer to the given subsection in the field. Sections are + * 0-indexed, the \p section parameters must be less than the value returned + * from #sbp_msg_settings_read_req_setting_count_sections. + * + * @param msg sbp_msg_settings_read_req_t instance + * @param section Section number + * @return Pointer to C string, NULL on error + */ +SBP_EXPORT const char *sbp_msg_settings_read_req_setting_get_section( + const sbp_msg_settings_read_req_t *msg, size_t section); - /** - * Obtain the length of a section in sbp_msg_settings_read_req_t::setting - * - * The returned value does not include the NULL terminator. - * - * If the given section does not exist 0 is returned. - * - * @param msg sbp_msg_settings_read_req_t instance - * @param section Section number - * @return Length of section - */ - SBP_EXPORT size_t sbp_msg_settings_read_req_setting_section_strlen(const sbp_msg_settings_read_req_t *msg, size_t section); +/** + * Obtain the length of a section in sbp_msg_settings_read_req_t::setting + * + * The returned value does not include the NULL terminator. + * + * If the given section does not exist 0 is returned. + * + * @param msg sbp_msg_settings_read_req_t instance + * @param section Section number + * @return Length of section + */ +SBP_EXPORT size_t sbp_msg_settings_read_req_setting_section_strlen( + const sbp_msg_settings_read_req_t *msg, size_t section); /** * Get encoded size of an instance of sbp_msg_settings_read_req_t @@ -213,46 +263,62 @@ typedef struct { * @param msg sbp_msg_settings_read_req_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_settings_read_req_encoded_len(const sbp_msg_settings_read_req_t *msg) -{ - return SBP_MSG_SETTINGS_READ_REQ_ENCODED_OVERHEAD - + sbp_msg_settings_read_req_setting_encoded_len(msg) - ; +static inline size_t sbp_msg_settings_read_req_encoded_len( + const sbp_msg_settings_read_req_t *msg) { + return SBP_MSG_SETTINGS_READ_REQ_ENCODED_OVERHEAD + + sbp_msg_settings_read_req_setting_encoded_len(msg); } /** * Encode an instance of sbp_msg_settings_read_req_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_settings_read_req_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_read_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_req_t *msg); +SBP_EXPORT s8 +sbp_msg_settings_read_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_read_req_t *msg); /** * Decode an instance of sbp_msg_settings_read_req_t from wire representation * - * This function decodes the wire representation of a sbp_msg_settings_read_req_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_settings_read_req_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_settings_read_req_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_read_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_req_t *msg); +SBP_EXPORT s8 sbp_msg_settings_read_req_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_read_req_t *msg); /** * Send an instance of sbp_msg_settings_read_req_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_settings_read_req_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_settings_read_req_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -260,51 +326,61 @@ SBP_EXPORT s8 sbp_msg_settings_read_req_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_read_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_read_req_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_settings_read_req_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_settings_read_req_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_settings_read_req_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_settings_read_req_t instance * @param b sbp_msg_settings_read_req_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_settings_read_req_cmp(const sbp_msg_settings_read_req_t *a, const sbp_msg_settings_read_req_t *b); +SBP_EXPORT int sbp_msg_settings_read_req_cmp( + const sbp_msg_settings_read_req_t *a, const sbp_msg_settings_read_req_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_settings_read_req_t &lhs, const sbp_msg_settings_read_req_t &rhs) { +static inline bool operator==(const sbp_msg_settings_read_req_t &lhs, + const sbp_msg_settings_read_req_t &rhs) { return sbp_msg_settings_read_req_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_settings_read_req_t &lhs, const sbp_msg_settings_read_req_t &rhs) { +static inline bool operator!=(const sbp_msg_settings_read_req_t &lhs, + const sbp_msg_settings_read_req_t &rhs) { return sbp_msg_settings_read_req_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_settings_read_req_t &lhs, const sbp_msg_settings_read_req_t &rhs) { +static inline bool operator<(const sbp_msg_settings_read_req_t &lhs, + const sbp_msg_settings_read_req_t &rhs) { return sbp_msg_settings_read_req_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_settings_read_req_t &lhs, const sbp_msg_settings_read_req_t &rhs) { +static inline bool operator<=(const sbp_msg_settings_read_req_t &lhs, + const sbp_msg_settings_read_req_t &rhs) { return sbp_msg_settings_read_req_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_settings_read_req_t &lhs, const sbp_msg_settings_read_req_t &rhs) { +static inline bool operator>(const sbp_msg_settings_read_req_t &lhs, + const sbp_msg_settings_read_req_t &rhs) { return sbp_msg_settings_read_req_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_settings_read_req_t &lhs, const sbp_msg_settings_read_req_t &rhs) { +static inline bool operator>=(const sbp_msg_settings_read_req_t &lhs, + const sbp_msg_settings_read_req_t &rhs) { return sbp_msg_settings_read_req_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SETTINGS_MSG_SETTINGS_READ_REQ_H */ - diff --git a/c/include/libsbp/settings/MSG_SETTINGS_READ_RESP.h b/c/include/libsbp/settings/MSG_SETTINGS_READ_RESP.h index 85a4f7230..e71b4ab85 100644 --- a/c/include/libsbp/settings/MSG_SETTINGS_READ_RESP.h +++ b/c/include/libsbp/settings/MSG_SETTINGS_READ_RESP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SETTINGS_MSG_SETTINGS_READ_RESP_H #define LIBSBP_SETTINGS_MSG_SETTINGS_READ_RESP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,172 +40,222 @@ *****************************************************************************/ /** Read device configuration settings (host <= device) * -* The setting message with which the device responds after a MSG_SETTING_READ_REQ is sent to device. The string field is a NULL-terminated and NULL-delimited string with contents "SECTION_SETTING\0SETTING\0VALUE\0" where the '\0' escape sequence denotes the NULL character and where quotation marks are omitted. An example string that could be sent from device is "solution\0soln_freq\010\0". + * The setting message with which the device responds after a + * MSG_SETTING_READ_REQ is sent to device. The string field is a NULL-terminated + * and NULL-delimited string with contents "SECTION_SETTING\0SETTING\0VALUE\0" + * where the '\0' escape sequence denotes the NULL character and where quotation + * marks are omitted. An example string that could be sent from device is + * "solution\0soln_freq\010\0". */ typedef struct { - - /** - * A NULL-terminated and NULL-delimited string with contents "SECTION_SETTING\0SETTING\0VALUE\0" + * A NULL-terminated and NULL-delimited string with contents + * "SECTION_SETTING\0SETTING\0VALUE\0" */ sbp_string_t setting; } sbp_msg_settings_read_resp_t; +/** + * Initialise sbp_msg_settings_read_resp_t::setting to empty + * + * @param msg sbp_msg_settings_read_resp_t instance + */ +SBP_EXPORT void sbp_msg_settings_read_resp_setting_init( + sbp_msg_settings_read_resp_t *msg); - /** - * Initialise sbp_msg_settings_read_resp_t::setting to empty - * - * @param msg sbp_msg_settings_read_resp_t instance - */ - SBP_EXPORT void sbp_msg_settings_read_resp_setting_init(sbp_msg_settings_read_resp_t *msg); - - /** - * Test sbp_msg_settings_read_resp_t::setting for validity - * - * @param msg sbp_msg_settings_read_resp_t instance - * @return true is sbp_msg_settings_read_resp_t::setting is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_resp_setting_valid(const sbp_msg_settings_read_resp_t *msg); +/** + * Test sbp_msg_settings_read_resp_t::setting for validity + * + * @param msg sbp_msg_settings_read_resp_t instance + * @return true is sbp_msg_settings_read_resp_t::setting is valid for encoding + * purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_resp_setting_valid( + const sbp_msg_settings_read_resp_t *msg); - /** - * Tests 2 instances of sbp_msg_settings_read_resp_t::setting for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_settings_read_resp_t instance - * @param b sbp_msg_settings_read_resp_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_settings_read_resp_setting_strcmp(const sbp_msg_settings_read_resp_t *a, const sbp_msg_settings_read_resp_t *b); +/** + * Tests 2 instances of sbp_msg_settings_read_resp_t::setting for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_settings_read_resp_t instance + * @param b sbp_msg_settings_read_resp_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_settings_read_resp_setting_strcmp( + const sbp_msg_settings_read_resp_t *a, + const sbp_msg_settings_read_resp_t *b); - /** - * Get the encoded size of sbp_msg_settings_read_resp_t::setting - * - * @param msg sbp_msg_settings_read_resp_t instance - * @return Size of sbp_msg_settings_read_resp_t::setting in wire representation - */ - SBP_EXPORT size_t sbp_msg_settings_read_resp_setting_encoded_len(const sbp_msg_settings_read_resp_t *msg); +/** + * Get the encoded size of sbp_msg_settings_read_resp_t::setting + * + * @param msg sbp_msg_settings_read_resp_t instance + * @return Size of sbp_msg_settings_read_resp_t::setting in wire representation + */ +SBP_EXPORT size_t sbp_msg_settings_read_resp_setting_encoded_len( + const sbp_msg_settings_read_resp_t *msg); - /** - * Query sbp_msg_settings_read_resp_t::setting for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_settings_read_resp_t::setting before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_settings_read_resp_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_settings_read_resp_setting_space_remaining(const sbp_msg_settings_read_resp_t *msg); - /** - * Return the number of sections in sbp_msg_settings_read_resp_t::setting - * - * @param msg sbp_msg_settings_read_resp_t instance - * @return Number of sections in string - */ - SBP_EXPORT size_t sbp_msg_settings_read_resp_setting_count_sections(const sbp_msg_settings_read_resp_t *msg); +/** + * Query sbp_msg_settings_read_resp_t::setting for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_settings_read_resp_t::setting before it exceeds the maximum + * size of the field in wire representation + * + * @param msg sbp_msg_settings_read_resp_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_settings_read_resp_setting_space_remaining( + const sbp_msg_settings_read_resp_t *msg); +/** + * Return the number of sections in sbp_msg_settings_read_resp_t::setting + * + * @param msg sbp_msg_settings_read_resp_t instance + * @return Number of sections in string + */ +SBP_EXPORT size_t sbp_msg_settings_read_resp_setting_count_sections( + const sbp_msg_settings_read_resp_t *msg); - /** - * Add a section to sbp_msg_settings_read_resp_t::setting - * - * The specified string will be appended to the field as a new section. If the new section would end up overflowing the maximum encoded length of this field the string will not be changed and this function will return false - * - * @param msg sbp_msg_settings_read_resp_t instance - * @param new_str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_resp_setting_add_section(sbp_msg_settings_read_resp_t *msg, const char *new_str); +/** + * Add a section to sbp_msg_settings_read_resp_t::setting + * + * The specified string will be appended to the field as a new section. If the + * new section would end up overflowing the maximum encoded length of this field + * the string will not be changed and this function will return false + * + * @param msg sbp_msg_settings_read_resp_t instance + * @param new_str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_resp_setting_add_section( + sbp_msg_settings_read_resp_t *msg, const char *new_str); - /** - * Add a section to sbp_msg_settings_read_resp_t::setting with printf style formatting - * - * A new section will be added to the field according to the specified printf style format string and arguments. If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_read_resp_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_resp_setting_add_section_printf(sbp_msg_settings_read_resp_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Add a section to sbp_msg_settings_read_resp_t::setting with printf style + * formatting + * + * A new section will be added to the field according to the specified printf + * style format string and arguments. If the operation would end up overflowing + * the maximum size of this field in wire encoding the existing contents will be + * unmodified and this function will return false. + * + * @param msg sbp_msg_settings_read_resp_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_resp_setting_add_section_printf( + sbp_msg_settings_read_resp_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Add a section to sbp_msg_settings_read_resp_t::setting with printf style formatting - * - * Identical to #sbp_msg_settings_read_resp_setting_add_section_printf except it takes a va_list argument - * - * @param msg sbp_msg_settings_read_resp_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_resp_setting_add_section_vprintf(sbp_msg_settings_read_resp_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Add a section to sbp_msg_settings_read_resp_t::setting with printf style + * formatting + * + * Identical to #sbp_msg_settings_read_resp_setting_add_section_printf except it + * takes a va_list argument + * + * @param msg sbp_msg_settings_read_resp_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_resp_setting_add_section_vprintf( + sbp_msg_settings_read_resp_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Append a string to the last section in sbp_msg_settings_read_resp_t::setting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_read_resp_setting_add_section - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_read_resp_t instance - * @param str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_resp_setting_append(sbp_msg_settings_read_resp_t *msg, const char *str); +/** + * Append a string to the last section in sbp_msg_settings_read_resp_t::setting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_read_resp_setting_add_section + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_read_resp_t instance + * @param str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_resp_setting_append( + sbp_msg_settings_read_resp_t *msg, const char *str); - /** - * Append a string to the last section in sbp_msg_settings_read_resp_t::setting with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_read_resp_setting_add_section_printf - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_read_resp_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_resp_setting_append_printf(sbp_msg_settings_read_resp_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Append a string to the last section in sbp_msg_settings_read_resp_t::setting + * with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_read_resp_setting_add_section_printf + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_read_resp_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_resp_setting_append_printf( + sbp_msg_settings_read_resp_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Append a string to the last section in sbp_msg_settings_read_resp_t::setting with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_read_resp_setting_add_section_vprintf - * - * If the field already contains one or more sections the given string will be sppended on to the last section in the string. - * - * If the operation would end overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_read_resp_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_read_resp_setting_append_vprintf(sbp_msg_settings_read_resp_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Append a string to the last section in sbp_msg_settings_read_resp_t::setting + * with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_read_resp_setting_add_section_vprintf + * + * If the field already contains one or more sections the given string will be + * sppended on to the last section in the string. + * + * If the operation would end overflowing the maximum size of this field in wire + * encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_read_resp_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_read_resp_setting_append_vprintf( + sbp_msg_settings_read_resp_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Obtain a section from sbp_msg_settings_read_resp_t::setting - * - * Returns a pointer to the given subsection in the field. Sections are 0-indexed, the \p section parameters must be less than the value returned from #sbp_msg_settings_read_resp_setting_count_sections. - * - * @param msg sbp_msg_settings_read_resp_t instance - * @param section Section number - * @return Pointer to C string, NULL on error - */ - SBP_EXPORT const char *sbp_msg_settings_read_resp_setting_get_section(const sbp_msg_settings_read_resp_t *msg, size_t section); +/** + * Obtain a section from sbp_msg_settings_read_resp_t::setting + * + * Returns a pointer to the given subsection in the field. Sections are + * 0-indexed, the \p section parameters must be less than the value returned + * from #sbp_msg_settings_read_resp_setting_count_sections. + * + * @param msg sbp_msg_settings_read_resp_t instance + * @param section Section number + * @return Pointer to C string, NULL on error + */ +SBP_EXPORT const char *sbp_msg_settings_read_resp_setting_get_section( + const sbp_msg_settings_read_resp_t *msg, size_t section); - /** - * Obtain the length of a section in sbp_msg_settings_read_resp_t::setting - * - * The returned value does not include the NULL terminator. - * - * If the given section does not exist 0 is returned. - * - * @param msg sbp_msg_settings_read_resp_t instance - * @param section Section number - * @return Length of section - */ - SBP_EXPORT size_t sbp_msg_settings_read_resp_setting_section_strlen(const sbp_msg_settings_read_resp_t *msg, size_t section); +/** + * Obtain the length of a section in sbp_msg_settings_read_resp_t::setting + * + * The returned value does not include the NULL terminator. + * + * If the given section does not exist 0 is returned. + * + * @param msg sbp_msg_settings_read_resp_t instance + * @param section Section number + * @return Length of section + */ +SBP_EXPORT size_t sbp_msg_settings_read_resp_setting_section_strlen( + const sbp_msg_settings_read_resp_t *msg, size_t section); /** * Get encoded size of an instance of sbp_msg_settings_read_resp_t @@ -213,46 +263,63 @@ typedef struct { * @param msg sbp_msg_settings_read_resp_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_settings_read_resp_encoded_len(const sbp_msg_settings_read_resp_t *msg) -{ - return SBP_MSG_SETTINGS_READ_RESP_ENCODED_OVERHEAD - + sbp_msg_settings_read_resp_setting_encoded_len(msg) - ; +static inline size_t sbp_msg_settings_read_resp_encoded_len( + const sbp_msg_settings_read_resp_t *msg) { + return SBP_MSG_SETTINGS_READ_RESP_ENCODED_OVERHEAD + + sbp_msg_settings_read_resp_setting_encoded_len(msg); } /** * Encode an instance of sbp_msg_settings_read_resp_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_settings_read_resp_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_read_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_resp_t *msg); +SBP_EXPORT s8 +sbp_msg_settings_read_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_read_resp_t *msg); /** * Decode an instance of sbp_msg_settings_read_resp_t from wire representation * - * This function decodes the wire representation of a sbp_msg_settings_read_resp_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_settings_read_resp_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_settings_read_resp_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_read_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_resp_t *msg); +SBP_EXPORT s8 sbp_msg_settings_read_resp_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_read_resp_t *msg); /** - * Send an instance of sbp_msg_settings_read_resp_t with the given write function + * Send an instance of sbp_msg_settings_read_resp_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_settings_read_resp_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_settings_read_resp_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -260,51 +327,62 @@ SBP_EXPORT s8 sbp_msg_settings_read_resp_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_read_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_read_resp_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_settings_read_resp_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_settings_read_resp_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_settings_read_resp_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_settings_read_resp_t instance * @param b sbp_msg_settings_read_resp_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_settings_read_resp_cmp(const sbp_msg_settings_read_resp_t *a, const sbp_msg_settings_read_resp_t *b); +SBP_EXPORT int sbp_msg_settings_read_resp_cmp( + const sbp_msg_settings_read_resp_t *a, + const sbp_msg_settings_read_resp_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_settings_read_resp_t &lhs, const sbp_msg_settings_read_resp_t &rhs) { +static inline bool operator==(const sbp_msg_settings_read_resp_t &lhs, + const sbp_msg_settings_read_resp_t &rhs) { return sbp_msg_settings_read_resp_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_settings_read_resp_t &lhs, const sbp_msg_settings_read_resp_t &rhs) { +static inline bool operator!=(const sbp_msg_settings_read_resp_t &lhs, + const sbp_msg_settings_read_resp_t &rhs) { return sbp_msg_settings_read_resp_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_settings_read_resp_t &lhs, const sbp_msg_settings_read_resp_t &rhs) { +static inline bool operator<(const sbp_msg_settings_read_resp_t &lhs, + const sbp_msg_settings_read_resp_t &rhs) { return sbp_msg_settings_read_resp_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_settings_read_resp_t &lhs, const sbp_msg_settings_read_resp_t &rhs) { +static inline bool operator<=(const sbp_msg_settings_read_resp_t &lhs, + const sbp_msg_settings_read_resp_t &rhs) { return sbp_msg_settings_read_resp_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_settings_read_resp_t &lhs, const sbp_msg_settings_read_resp_t &rhs) { +static inline bool operator>(const sbp_msg_settings_read_resp_t &lhs, + const sbp_msg_settings_read_resp_t &rhs) { return sbp_msg_settings_read_resp_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_settings_read_resp_t &lhs, const sbp_msg_settings_read_resp_t &rhs) { +static inline bool operator>=(const sbp_msg_settings_read_resp_t &lhs, + const sbp_msg_settings_read_resp_t &rhs) { return sbp_msg_settings_read_resp_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SETTINGS_MSG_SETTINGS_READ_RESP_H */ - diff --git a/c/include/libsbp/settings/MSG_SETTINGS_REGISTER.h b/c/include/libsbp/settings/MSG_SETTINGS_REGISTER.h index 813ec21a1..a8ad3b3b0 100644 --- a/c/include/libsbp/settings/MSG_SETTINGS_REGISTER.h +++ b/c/include/libsbp/settings/MSG_SETTINGS_REGISTER.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SETTINGS_MSG_SETTINGS_REGISTER_H #define LIBSBP_SETTINGS_MSG_SETTINGS_REGISTER_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,172 +40,218 @@ *****************************************************************************/ /** Register setting and default value (device => host) * -* This message registers the presence and default value of a setting with a settings daemon. The host should reply with MSG_SETTINGS_WRITE for this setting to set the initial value. + * This message registers the presence and default value of a setting with a + * settings daemon. The host should reply with MSG_SETTINGS_WRITE for this + * setting to set the initial value. */ typedef struct { - - /** - * A NULL-terminated and delimited string with contents "SECTION_SETTING\0SETTING\0VALUE". + * A NULL-terminated and delimited string with contents + * "SECTION_SETTING\0SETTING\0VALUE". */ sbp_string_t setting; } sbp_msg_settings_register_t; +/** + * Initialise sbp_msg_settings_register_t::setting to empty + * + * @param msg sbp_msg_settings_register_t instance + */ +SBP_EXPORT void sbp_msg_settings_register_setting_init( + sbp_msg_settings_register_t *msg); - /** - * Initialise sbp_msg_settings_register_t::setting to empty - * - * @param msg sbp_msg_settings_register_t instance - */ - SBP_EXPORT void sbp_msg_settings_register_setting_init(sbp_msg_settings_register_t *msg); - - /** - * Test sbp_msg_settings_register_t::setting for validity - * - * @param msg sbp_msg_settings_register_t instance - * @return true is sbp_msg_settings_register_t::setting is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_register_setting_valid(const sbp_msg_settings_register_t *msg); +/** + * Test sbp_msg_settings_register_t::setting for validity + * + * @param msg sbp_msg_settings_register_t instance + * @return true is sbp_msg_settings_register_t::setting is valid for encoding + * purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_register_setting_valid( + const sbp_msg_settings_register_t *msg); - /** - * Tests 2 instances of sbp_msg_settings_register_t::setting for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_settings_register_t instance - * @param b sbp_msg_settings_register_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_settings_register_setting_strcmp(const sbp_msg_settings_register_t *a, const sbp_msg_settings_register_t *b); +/** + * Tests 2 instances of sbp_msg_settings_register_t::setting for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_settings_register_t instance + * @param b sbp_msg_settings_register_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_settings_register_setting_strcmp( + const sbp_msg_settings_register_t *a, const sbp_msg_settings_register_t *b); - /** - * Get the encoded size of sbp_msg_settings_register_t::setting - * - * @param msg sbp_msg_settings_register_t instance - * @return Size of sbp_msg_settings_register_t::setting in wire representation - */ - SBP_EXPORT size_t sbp_msg_settings_register_setting_encoded_len(const sbp_msg_settings_register_t *msg); +/** + * Get the encoded size of sbp_msg_settings_register_t::setting + * + * @param msg sbp_msg_settings_register_t instance + * @return Size of sbp_msg_settings_register_t::setting in wire representation + */ +SBP_EXPORT size_t sbp_msg_settings_register_setting_encoded_len( + const sbp_msg_settings_register_t *msg); - /** - * Query sbp_msg_settings_register_t::setting for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_settings_register_t::setting before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_settings_register_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_settings_register_setting_space_remaining(const sbp_msg_settings_register_t *msg); - /** - * Return the number of sections in sbp_msg_settings_register_t::setting - * - * @param msg sbp_msg_settings_register_t instance - * @return Number of sections in string - */ - SBP_EXPORT size_t sbp_msg_settings_register_setting_count_sections(const sbp_msg_settings_register_t *msg); +/** + * Query sbp_msg_settings_register_t::setting for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_settings_register_t::setting before it exceeds the maximum + * size of the field in wire representation + * + * @param msg sbp_msg_settings_register_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_settings_register_setting_space_remaining( + const sbp_msg_settings_register_t *msg); +/** + * Return the number of sections in sbp_msg_settings_register_t::setting + * + * @param msg sbp_msg_settings_register_t instance + * @return Number of sections in string + */ +SBP_EXPORT size_t sbp_msg_settings_register_setting_count_sections( + const sbp_msg_settings_register_t *msg); - /** - * Add a section to sbp_msg_settings_register_t::setting - * - * The specified string will be appended to the field as a new section. If the new section would end up overflowing the maximum encoded length of this field the string will not be changed and this function will return false - * - * @param msg sbp_msg_settings_register_t instance - * @param new_str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_register_setting_add_section(sbp_msg_settings_register_t *msg, const char *new_str); +/** + * Add a section to sbp_msg_settings_register_t::setting + * + * The specified string will be appended to the field as a new section. If the + * new section would end up overflowing the maximum encoded length of this field + * the string will not be changed and this function will return false + * + * @param msg sbp_msg_settings_register_t instance + * @param new_str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_register_setting_add_section( + sbp_msg_settings_register_t *msg, const char *new_str); - /** - * Add a section to sbp_msg_settings_register_t::setting with printf style formatting - * - * A new section will be added to the field according to the specified printf style format string and arguments. If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_register_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_register_setting_add_section_printf(sbp_msg_settings_register_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Add a section to sbp_msg_settings_register_t::setting with printf style + * formatting + * + * A new section will be added to the field according to the specified printf + * style format string and arguments. If the operation would end up overflowing + * the maximum size of this field in wire encoding the existing contents will be + * unmodified and this function will return false. + * + * @param msg sbp_msg_settings_register_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_register_setting_add_section_printf( + sbp_msg_settings_register_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Add a section to sbp_msg_settings_register_t::setting with printf style formatting - * - * Identical to #sbp_msg_settings_register_setting_add_section_printf except it takes a va_list argument - * - * @param msg sbp_msg_settings_register_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_register_setting_add_section_vprintf(sbp_msg_settings_register_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Add a section to sbp_msg_settings_register_t::setting with printf style + * formatting + * + * Identical to #sbp_msg_settings_register_setting_add_section_printf except it + * takes a va_list argument + * + * @param msg sbp_msg_settings_register_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_register_setting_add_section_vprintf( + sbp_msg_settings_register_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Append a string to the last section in sbp_msg_settings_register_t::setting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_register_setting_add_section - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_register_t instance - * @param str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_register_setting_append(sbp_msg_settings_register_t *msg, const char *str); +/** + * Append a string to the last section in sbp_msg_settings_register_t::setting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_register_setting_add_section + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_register_t instance + * @param str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_register_setting_append( + sbp_msg_settings_register_t *msg, const char *str); - /** - * Append a string to the last section in sbp_msg_settings_register_t::setting with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_register_setting_add_section_printf - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_register_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_register_setting_append_printf(sbp_msg_settings_register_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Append a string to the last section in sbp_msg_settings_register_t::setting + * with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_register_setting_add_section_printf + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_register_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_register_setting_append_printf( + sbp_msg_settings_register_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Append a string to the last section in sbp_msg_settings_register_t::setting with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_register_setting_add_section_vprintf - * - * If the field already contains one or more sections the given string will be sppended on to the last section in the string. - * - * If the operation would end overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_register_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_register_setting_append_vprintf(sbp_msg_settings_register_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Append a string to the last section in sbp_msg_settings_register_t::setting + * with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_register_setting_add_section_vprintf + * + * If the field already contains one or more sections the given string will be + * sppended on to the last section in the string. + * + * If the operation would end overflowing the maximum size of this field in wire + * encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_register_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_register_setting_append_vprintf( + sbp_msg_settings_register_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Obtain a section from sbp_msg_settings_register_t::setting - * - * Returns a pointer to the given subsection in the field. Sections are 0-indexed, the \p section parameters must be less than the value returned from #sbp_msg_settings_register_setting_count_sections. - * - * @param msg sbp_msg_settings_register_t instance - * @param section Section number - * @return Pointer to C string, NULL on error - */ - SBP_EXPORT const char *sbp_msg_settings_register_setting_get_section(const sbp_msg_settings_register_t *msg, size_t section); +/** + * Obtain a section from sbp_msg_settings_register_t::setting + * + * Returns a pointer to the given subsection in the field. Sections are + * 0-indexed, the \p section parameters must be less than the value returned + * from #sbp_msg_settings_register_setting_count_sections. + * + * @param msg sbp_msg_settings_register_t instance + * @param section Section number + * @return Pointer to C string, NULL on error + */ +SBP_EXPORT const char *sbp_msg_settings_register_setting_get_section( + const sbp_msg_settings_register_t *msg, size_t section); - /** - * Obtain the length of a section in sbp_msg_settings_register_t::setting - * - * The returned value does not include the NULL terminator. - * - * If the given section does not exist 0 is returned. - * - * @param msg sbp_msg_settings_register_t instance - * @param section Section number - * @return Length of section - */ - SBP_EXPORT size_t sbp_msg_settings_register_setting_section_strlen(const sbp_msg_settings_register_t *msg, size_t section); +/** + * Obtain the length of a section in sbp_msg_settings_register_t::setting + * + * The returned value does not include the NULL terminator. + * + * If the given section does not exist 0 is returned. + * + * @param msg sbp_msg_settings_register_t instance + * @param section Section number + * @return Length of section + */ +SBP_EXPORT size_t sbp_msg_settings_register_setting_section_strlen( + const sbp_msg_settings_register_t *msg, size_t section); /** * Get encoded size of an instance of sbp_msg_settings_register_t @@ -213,46 +259,62 @@ typedef struct { * @param msg sbp_msg_settings_register_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_settings_register_encoded_len(const sbp_msg_settings_register_t *msg) -{ - return SBP_MSG_SETTINGS_REGISTER_ENCODED_OVERHEAD - + sbp_msg_settings_register_setting_encoded_len(msg) - ; +static inline size_t sbp_msg_settings_register_encoded_len( + const sbp_msg_settings_register_t *msg) { + return SBP_MSG_SETTINGS_REGISTER_ENCODED_OVERHEAD + + sbp_msg_settings_register_setting_encoded_len(msg); } /** * Encode an instance of sbp_msg_settings_register_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_settings_register_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_register_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_register_t *msg); +SBP_EXPORT s8 +sbp_msg_settings_register_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_register_t *msg); /** * Decode an instance of sbp_msg_settings_register_t from wire representation * - * This function decodes the wire representation of a sbp_msg_settings_register_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_settings_register_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_settings_register_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_register_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_register_t *msg); +SBP_EXPORT s8 sbp_msg_settings_register_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_register_t *msg); /** * Send an instance of sbp_msg_settings_register_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_settings_register_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_settings_register_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -260,51 +322,61 @@ SBP_EXPORT s8 sbp_msg_settings_register_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_register_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_register_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_settings_register_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_settings_register_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_settings_register_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_settings_register_t instance * @param b sbp_msg_settings_register_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_settings_register_cmp(const sbp_msg_settings_register_t *a, const sbp_msg_settings_register_t *b); +SBP_EXPORT int sbp_msg_settings_register_cmp( + const sbp_msg_settings_register_t *a, const sbp_msg_settings_register_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_settings_register_t &lhs, const sbp_msg_settings_register_t &rhs) { +static inline bool operator==(const sbp_msg_settings_register_t &lhs, + const sbp_msg_settings_register_t &rhs) { return sbp_msg_settings_register_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_settings_register_t &lhs, const sbp_msg_settings_register_t &rhs) { +static inline bool operator!=(const sbp_msg_settings_register_t &lhs, + const sbp_msg_settings_register_t &rhs) { return sbp_msg_settings_register_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_settings_register_t &lhs, const sbp_msg_settings_register_t &rhs) { +static inline bool operator<(const sbp_msg_settings_register_t &lhs, + const sbp_msg_settings_register_t &rhs) { return sbp_msg_settings_register_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_settings_register_t &lhs, const sbp_msg_settings_register_t &rhs) { +static inline bool operator<=(const sbp_msg_settings_register_t &lhs, + const sbp_msg_settings_register_t &rhs) { return sbp_msg_settings_register_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_settings_register_t &lhs, const sbp_msg_settings_register_t &rhs) { +static inline bool operator>(const sbp_msg_settings_register_t &lhs, + const sbp_msg_settings_register_t &rhs) { return sbp_msg_settings_register_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_settings_register_t &lhs, const sbp_msg_settings_register_t &rhs) { +static inline bool operator>=(const sbp_msg_settings_register_t &lhs, + const sbp_msg_settings_register_t &rhs) { return sbp_msg_settings_register_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SETTINGS_MSG_SETTINGS_REGISTER_H */ - diff --git a/c/include/libsbp/settings/MSG_SETTINGS_REGISTER_RESP.h b/c/include/libsbp/settings/MSG_SETTINGS_REGISTER_RESP.h index 98d1dc4fe..83aa8896d 100644 --- a/c/include/libsbp/settings/MSG_SETTINGS_REGISTER_RESP.h +++ b/c/include/libsbp/settings/MSG_SETTINGS_REGISTER_RESP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SETTINGS_MSG_SETTINGS_REGISTER_RESP_H #define LIBSBP_SETTINGS_MSG_SETTINGS_REGISTER_RESP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,178 +40,228 @@ *****************************************************************************/ /** Register setting and default value (device <= host) * -* This message responds to setting registration with the effective value. The effective value shall differ from the given default value if setting was already registered or is available in the permanent setting storage and had a different value. + * This message responds to setting registration with the effective value. The + * effective value shall differ from the given default value if setting was + * already registered or is available in the permanent setting storage and had a + * different value. */ typedef struct { - - /** -* Register status + * Register status */ u8 status; - /** - * A NULL-terminated and delimited string with contents "SECTION_SETTING\0SETTING\0VALUE". The meaning of value is defined according to the status field. + * A NULL-terminated and delimited string with contents + * "SECTION_SETTING\0SETTING\0VALUE". The meaning of value is defined + * according to the status field. */ sbp_string_t setting; } sbp_msg_settings_register_resp_t; +/** + * Initialise sbp_msg_settings_register_resp_t::setting to empty + * + * @param msg sbp_msg_settings_register_resp_t instance + */ +SBP_EXPORT void sbp_msg_settings_register_resp_setting_init( + sbp_msg_settings_register_resp_t *msg); - /** - * Initialise sbp_msg_settings_register_resp_t::setting to empty - * - * @param msg sbp_msg_settings_register_resp_t instance - */ - SBP_EXPORT void sbp_msg_settings_register_resp_setting_init(sbp_msg_settings_register_resp_t *msg); - - /** - * Test sbp_msg_settings_register_resp_t::setting for validity - * - * @param msg sbp_msg_settings_register_resp_t instance - * @return true is sbp_msg_settings_register_resp_t::setting is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_register_resp_setting_valid(const sbp_msg_settings_register_resp_t *msg); +/** + * Test sbp_msg_settings_register_resp_t::setting for validity + * + * @param msg sbp_msg_settings_register_resp_t instance + * @return true is sbp_msg_settings_register_resp_t::setting is valid for + * encoding purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_register_resp_setting_valid( + const sbp_msg_settings_register_resp_t *msg); - /** - * Tests 2 instances of sbp_msg_settings_register_resp_t::setting for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_settings_register_resp_t instance - * @param b sbp_msg_settings_register_resp_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_settings_register_resp_setting_strcmp(const sbp_msg_settings_register_resp_t *a, const sbp_msg_settings_register_resp_t *b); +/** + * Tests 2 instances of sbp_msg_settings_register_resp_t::setting for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_settings_register_resp_t instance + * @param b sbp_msg_settings_register_resp_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_settings_register_resp_setting_strcmp( + const sbp_msg_settings_register_resp_t *a, + const sbp_msg_settings_register_resp_t *b); - /** - * Get the encoded size of sbp_msg_settings_register_resp_t::setting - * - * @param msg sbp_msg_settings_register_resp_t instance - * @return Size of sbp_msg_settings_register_resp_t::setting in wire representation - */ - SBP_EXPORT size_t sbp_msg_settings_register_resp_setting_encoded_len(const sbp_msg_settings_register_resp_t *msg); +/** + * Get the encoded size of sbp_msg_settings_register_resp_t::setting + * + * @param msg sbp_msg_settings_register_resp_t instance + * @return Size of sbp_msg_settings_register_resp_t::setting in wire + * representation + */ +SBP_EXPORT size_t sbp_msg_settings_register_resp_setting_encoded_len( + const sbp_msg_settings_register_resp_t *msg); - /** - * Query sbp_msg_settings_register_resp_t::setting for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_settings_register_resp_t::setting before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_settings_register_resp_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_settings_register_resp_setting_space_remaining(const sbp_msg_settings_register_resp_t *msg); - /** - * Return the number of sections in sbp_msg_settings_register_resp_t::setting - * - * @param msg sbp_msg_settings_register_resp_t instance - * @return Number of sections in string - */ - SBP_EXPORT size_t sbp_msg_settings_register_resp_setting_count_sections(const sbp_msg_settings_register_resp_t *msg); +/** + * Query sbp_msg_settings_register_resp_t::setting for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_settings_register_resp_t::setting before it exceeds the + * maximum size of the field in wire representation + * + * @param msg sbp_msg_settings_register_resp_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_settings_register_resp_setting_space_remaining( + const sbp_msg_settings_register_resp_t *msg); +/** + * Return the number of sections in sbp_msg_settings_register_resp_t::setting + * + * @param msg sbp_msg_settings_register_resp_t instance + * @return Number of sections in string + */ +SBP_EXPORT size_t sbp_msg_settings_register_resp_setting_count_sections( + const sbp_msg_settings_register_resp_t *msg); - /** - * Add a section to sbp_msg_settings_register_resp_t::setting - * - * The specified string will be appended to the field as a new section. If the new section would end up overflowing the maximum encoded length of this field the string will not be changed and this function will return false - * - * @param msg sbp_msg_settings_register_resp_t instance - * @param new_str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_register_resp_setting_add_section(sbp_msg_settings_register_resp_t *msg, const char *new_str); +/** + * Add a section to sbp_msg_settings_register_resp_t::setting + * + * The specified string will be appended to the field as a new section. If the + * new section would end up overflowing the maximum encoded length of this field + * the string will not be changed and this function will return false + * + * @param msg sbp_msg_settings_register_resp_t instance + * @param new_str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_register_resp_setting_add_section( + sbp_msg_settings_register_resp_t *msg, const char *new_str); - /** - * Add a section to sbp_msg_settings_register_resp_t::setting with printf style formatting - * - * A new section will be added to the field according to the specified printf style format string and arguments. If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_register_resp_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_register_resp_setting_add_section_printf(sbp_msg_settings_register_resp_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Add a section to sbp_msg_settings_register_resp_t::setting with printf style + * formatting + * + * A new section will be added to the field according to the specified printf + * style format string and arguments. If the operation would end up overflowing + * the maximum size of this field in wire encoding the existing contents will be + * unmodified and this function will return false. + * + * @param msg sbp_msg_settings_register_resp_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_register_resp_setting_add_section_printf( + sbp_msg_settings_register_resp_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Add a section to sbp_msg_settings_register_resp_t::setting with printf style formatting - * - * Identical to #sbp_msg_settings_register_resp_setting_add_section_printf except it takes a va_list argument - * - * @param msg sbp_msg_settings_register_resp_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_register_resp_setting_add_section_vprintf(sbp_msg_settings_register_resp_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Add a section to sbp_msg_settings_register_resp_t::setting with printf style + * formatting + * + * Identical to #sbp_msg_settings_register_resp_setting_add_section_printf + * except it takes a va_list argument + * + * @param msg sbp_msg_settings_register_resp_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_register_resp_setting_add_section_vprintf( + sbp_msg_settings_register_resp_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Append a string to the last section in sbp_msg_settings_register_resp_t::setting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_register_resp_setting_add_section - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_register_resp_t instance - * @param str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_register_resp_setting_append(sbp_msg_settings_register_resp_t *msg, const char *str); +/** + * Append a string to the last section in + * sbp_msg_settings_register_resp_t::setting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_register_resp_setting_add_section + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_register_resp_t instance + * @param str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_register_resp_setting_append( + sbp_msg_settings_register_resp_t *msg, const char *str); - /** - * Append a string to the last section in sbp_msg_settings_register_resp_t::setting with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_register_resp_setting_add_section_printf - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_register_resp_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_register_resp_setting_append_printf(sbp_msg_settings_register_resp_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Append a string to the last section in + * sbp_msg_settings_register_resp_t::setting with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_register_resp_setting_add_section_printf + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_register_resp_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_register_resp_setting_append_printf( + sbp_msg_settings_register_resp_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Append a string to the last section in sbp_msg_settings_register_resp_t::setting with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_register_resp_setting_add_section_vprintf - * - * If the field already contains one or more sections the given string will be sppended on to the last section in the string. - * - * If the operation would end overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_register_resp_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_register_resp_setting_append_vprintf(sbp_msg_settings_register_resp_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Append a string to the last section in + * sbp_msg_settings_register_resp_t::setting with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_register_resp_setting_add_section_vprintf + * + * If the field already contains one or more sections the given string will be + * sppended on to the last section in the string. + * + * If the operation would end overflowing the maximum size of this field in wire + * encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_register_resp_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_register_resp_setting_append_vprintf( + sbp_msg_settings_register_resp_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Obtain a section from sbp_msg_settings_register_resp_t::setting - * - * Returns a pointer to the given subsection in the field. Sections are 0-indexed, the \p section parameters must be less than the value returned from #sbp_msg_settings_register_resp_setting_count_sections. - * - * @param msg sbp_msg_settings_register_resp_t instance - * @param section Section number - * @return Pointer to C string, NULL on error - */ - SBP_EXPORT const char *sbp_msg_settings_register_resp_setting_get_section(const sbp_msg_settings_register_resp_t *msg, size_t section); +/** + * Obtain a section from sbp_msg_settings_register_resp_t::setting + * + * Returns a pointer to the given subsection in the field. Sections are + * 0-indexed, the \p section parameters must be less than the value returned + * from #sbp_msg_settings_register_resp_setting_count_sections. + * + * @param msg sbp_msg_settings_register_resp_t instance + * @param section Section number + * @return Pointer to C string, NULL on error + */ +SBP_EXPORT const char *sbp_msg_settings_register_resp_setting_get_section( + const sbp_msg_settings_register_resp_t *msg, size_t section); - /** - * Obtain the length of a section in sbp_msg_settings_register_resp_t::setting - * - * The returned value does not include the NULL terminator. - * - * If the given section does not exist 0 is returned. - * - * @param msg sbp_msg_settings_register_resp_t instance - * @param section Section number - * @return Length of section - */ - SBP_EXPORT size_t sbp_msg_settings_register_resp_setting_section_strlen(const sbp_msg_settings_register_resp_t *msg, size_t section); +/** + * Obtain the length of a section in sbp_msg_settings_register_resp_t::setting + * + * The returned value does not include the NULL terminator. + * + * If the given section does not exist 0 is returned. + * + * @param msg sbp_msg_settings_register_resp_t instance + * @param section Section number + * @return Length of section + */ +SBP_EXPORT size_t sbp_msg_settings_register_resp_setting_section_strlen( + const sbp_msg_settings_register_resp_t *msg, size_t section); /** * Get encoded size of an instance of sbp_msg_settings_register_resp_t @@ -219,46 +269,65 @@ typedef struct { * @param msg sbp_msg_settings_register_resp_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_settings_register_resp_encoded_len(const sbp_msg_settings_register_resp_t *msg) -{ - return SBP_MSG_SETTINGS_REGISTER_RESP_ENCODED_OVERHEAD - + sbp_msg_settings_register_resp_setting_encoded_len(msg) - ; +static inline size_t sbp_msg_settings_register_resp_encoded_len( + const sbp_msg_settings_register_resp_t *msg) { + return SBP_MSG_SETTINGS_REGISTER_RESP_ENCODED_OVERHEAD + + sbp_msg_settings_register_resp_setting_encoded_len(msg); } /** * Encode an instance of sbp_msg_settings_register_resp_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_settings_register_resp_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_register_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_register_resp_t *msg); +SBP_EXPORT s8 sbp_msg_settings_register_resp_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_register_resp_t *msg); /** - * Decode an instance of sbp_msg_settings_register_resp_t from wire representation + * Decode an instance of sbp_msg_settings_register_resp_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_settings_register_resp_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_settings_register_resp_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_settings_register_resp_t instance + * @param buf Wire representation of the sbp_msg_settings_register_resp_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_register_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_register_resp_t *msg); +SBP_EXPORT s8 sbp_msg_settings_register_resp_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_register_resp_t *msg); /** - * Send an instance of sbp_msg_settings_register_resp_t with the given write function + * Send an instance of sbp_msg_settings_register_resp_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_settings_register_resp_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_settings_register_resp_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -266,51 +335,62 @@ SBP_EXPORT s8 sbp_msg_settings_register_resp_decode(const uint8_t *buf, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_register_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_register_resp_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_settings_register_resp_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_settings_register_resp_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_settings_register_resp_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_settings_register_resp_t instance * @param b sbp_msg_settings_register_resp_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_settings_register_resp_cmp(const sbp_msg_settings_register_resp_t *a, const sbp_msg_settings_register_resp_t *b); +SBP_EXPORT int sbp_msg_settings_register_resp_cmp( + const sbp_msg_settings_register_resp_t *a, + const sbp_msg_settings_register_resp_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_settings_register_resp_t &lhs, const sbp_msg_settings_register_resp_t &rhs) { +static inline bool operator==(const sbp_msg_settings_register_resp_t &lhs, + const sbp_msg_settings_register_resp_t &rhs) { return sbp_msg_settings_register_resp_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_settings_register_resp_t &lhs, const sbp_msg_settings_register_resp_t &rhs) { +static inline bool operator!=(const sbp_msg_settings_register_resp_t &lhs, + const sbp_msg_settings_register_resp_t &rhs) { return sbp_msg_settings_register_resp_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_settings_register_resp_t &lhs, const sbp_msg_settings_register_resp_t &rhs) { +static inline bool operator<(const sbp_msg_settings_register_resp_t &lhs, + const sbp_msg_settings_register_resp_t &rhs) { return sbp_msg_settings_register_resp_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_settings_register_resp_t &lhs, const sbp_msg_settings_register_resp_t &rhs) { +static inline bool operator<=(const sbp_msg_settings_register_resp_t &lhs, + const sbp_msg_settings_register_resp_t &rhs) { return sbp_msg_settings_register_resp_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_settings_register_resp_t &lhs, const sbp_msg_settings_register_resp_t &rhs) { +static inline bool operator>(const sbp_msg_settings_register_resp_t &lhs, + const sbp_msg_settings_register_resp_t &rhs) { return sbp_msg_settings_register_resp_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_settings_register_resp_t &lhs, const sbp_msg_settings_register_resp_t &rhs) { +static inline bool operator>=(const sbp_msg_settings_register_resp_t &lhs, + const sbp_msg_settings_register_resp_t &rhs) { return sbp_msg_settings_register_resp_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SETTINGS_MSG_SETTINGS_REGISTER_RESP_H */ - diff --git a/c/include/libsbp/settings/MSG_SETTINGS_SAVE.h b/c/include/libsbp/settings/MSG_SETTINGS_SAVE.h index 9d5762974..d3c7fb68f 100644 --- a/c/include/libsbp/settings/MSG_SETTINGS_SAVE.h +++ b/c/include/libsbp/settings/MSG_SETTINGS_SAVE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SETTINGS_MSG_SETTINGS_SAVE_H #define LIBSBP_SETTINGS_MSG_SETTINGS_SAVE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,25 +40,25 @@ *****************************************************************************/ /** Save settings to flash (host => device) * -* The save settings message persists the device's current settings configuration to its onboard flash memory file system. + * The save settings message persists the device's current settings + * configuration to its onboard flash memory file system. */ typedef struct { /** - * Do not use this field, it exists only to prevent illegal C syntax. Any value written to this field will be ignored + * Do not use this field, it exists only to prevent illegal C syntax. Any + * value written to this field will be ignored */ char DO_NOT_USE_dummy_field_to_prevent_empty_struct; } sbp_msg_settings_save_t; - - /** * Get encoded size of an instance of sbp_msg_settings_save_t * * @param msg sbp_msg_settings_save_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_settings_save_encoded_len(const sbp_msg_settings_save_t *msg) -{ +static inline size_t sbp_msg_settings_save_encoded_len( + const sbp_msg_settings_save_t *msg) { (void)msg; return SBP_MSG_SETTINGS_SAVE_ENCODED_LEN; } @@ -66,36 +66,53 @@ static inline size_t sbp_msg_settings_save_encoded_len(const sbp_msg_settings_sa /** * Encode an instance of sbp_msg_settings_save_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_settings_save_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_save_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_save_t *msg); +SBP_EXPORT s8 sbp_msg_settings_save_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_settings_save_t *msg); /** * Decode an instance of sbp_msg_settings_save_t from wire representation * - * This function decodes the wire representation of a sbp_msg_settings_save_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_settings_save_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_settings_save_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_save_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_save_t *msg); +SBP_EXPORT s8 sbp_msg_settings_save_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_settings_save_t *msg); /** * Send an instance of sbp_msg_settings_save_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_settings_save_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_settings_save_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -103,51 +120,61 @@ SBP_EXPORT s8 sbp_msg_settings_save_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_save_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_save_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_settings_save_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_settings_save_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_settings_save_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_settings_save_t instance * @param b sbp_msg_settings_save_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_settings_save_cmp(const sbp_msg_settings_save_t *a, const sbp_msg_settings_save_t *b); +SBP_EXPORT int sbp_msg_settings_save_cmp(const sbp_msg_settings_save_t *a, + const sbp_msg_settings_save_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_settings_save_t &lhs, const sbp_msg_settings_save_t &rhs) { +static inline bool operator==(const sbp_msg_settings_save_t &lhs, + const sbp_msg_settings_save_t &rhs) { return sbp_msg_settings_save_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_settings_save_t &lhs, const sbp_msg_settings_save_t &rhs) { +static inline bool operator!=(const sbp_msg_settings_save_t &lhs, + const sbp_msg_settings_save_t &rhs) { return sbp_msg_settings_save_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_settings_save_t &lhs, const sbp_msg_settings_save_t &rhs) { +static inline bool operator<(const sbp_msg_settings_save_t &lhs, + const sbp_msg_settings_save_t &rhs) { return sbp_msg_settings_save_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_settings_save_t &lhs, const sbp_msg_settings_save_t &rhs) { +static inline bool operator<=(const sbp_msg_settings_save_t &lhs, + const sbp_msg_settings_save_t &rhs) { return sbp_msg_settings_save_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_settings_save_t &lhs, const sbp_msg_settings_save_t &rhs) { +static inline bool operator>(const sbp_msg_settings_save_t &lhs, + const sbp_msg_settings_save_t &rhs) { return sbp_msg_settings_save_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_settings_save_t &lhs, const sbp_msg_settings_save_t &rhs) { +static inline bool operator>=(const sbp_msg_settings_save_t &lhs, + const sbp_msg_settings_save_t &rhs) { return sbp_msg_settings_save_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SETTINGS_MSG_SETTINGS_SAVE_H */ - diff --git a/c/include/libsbp/settings/MSG_SETTINGS_WRITE.h b/c/include/libsbp/settings/MSG_SETTINGS_WRITE.h index a7af5cb02..ee47f3dd5 100644 --- a/c/include/libsbp/settings/MSG_SETTINGS_WRITE.h +++ b/c/include/libsbp/settings/MSG_SETTINGS_WRITE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SETTINGS_MSG_SETTINGS_WRITE_H #define LIBSBP_SETTINGS_MSG_SETTINGS_WRITE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,172 +40,219 @@ *****************************************************************************/ /** Write device configuration settings (host => device) * -* The setting message writes the device configuration for a particular setting via A NULL-terminated and NULL-delimited string with contents "SECTION_SETTING\0SETTING\0VALUE\0" where the '\0' escape sequence denotes the NULL character and where quotation marks are omitted. A device will only process to this message when it is received from sender ID 0x42. An example string that could be sent to a device is "solution\0soln_freq\010\0". + * The setting message writes the device configuration for a particular setting + * via A NULL-terminated and NULL-delimited string with contents + * "SECTION_SETTING\0SETTING\0VALUE\0" where the '\0' escape sequence denotes + * the NULL character and where quotation marks are omitted. A device will only + * process to this message when it is received from sender ID 0x42. An example + * string that could be sent to a device is "solution\0soln_freq\010\0". */ typedef struct { - - /** - * A NULL-terminated and NULL-delimited string with contents "SECTION_SETTING\0SETTING\0VALUE\0" + * A NULL-terminated and NULL-delimited string with contents + * "SECTION_SETTING\0SETTING\0VALUE\0" */ sbp_string_t setting; } sbp_msg_settings_write_t; +/** + * Initialise sbp_msg_settings_write_t::setting to empty + * + * @param msg sbp_msg_settings_write_t instance + */ +SBP_EXPORT void sbp_msg_settings_write_setting_init( + sbp_msg_settings_write_t *msg); - /** - * Initialise sbp_msg_settings_write_t::setting to empty - * - * @param msg sbp_msg_settings_write_t instance - */ - SBP_EXPORT void sbp_msg_settings_write_setting_init(sbp_msg_settings_write_t *msg); - - /** - * Test sbp_msg_settings_write_t::setting for validity - * - * @param msg sbp_msg_settings_write_t instance - * @return true is sbp_msg_settings_write_t::setting is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_write_setting_valid(const sbp_msg_settings_write_t *msg); +/** + * Test sbp_msg_settings_write_t::setting for validity + * + * @param msg sbp_msg_settings_write_t instance + * @return true is sbp_msg_settings_write_t::setting is valid for encoding + * purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_write_setting_valid( + const sbp_msg_settings_write_t *msg); - /** - * Tests 2 instances of sbp_msg_settings_write_t::setting for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_settings_write_t instance - * @param b sbp_msg_settings_write_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_settings_write_setting_strcmp(const sbp_msg_settings_write_t *a, const sbp_msg_settings_write_t *b); +/** + * Tests 2 instances of sbp_msg_settings_write_t::setting for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_settings_write_t instance + * @param b sbp_msg_settings_write_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_settings_write_setting_strcmp( + const sbp_msg_settings_write_t *a, const sbp_msg_settings_write_t *b); - /** - * Get the encoded size of sbp_msg_settings_write_t::setting - * - * @param msg sbp_msg_settings_write_t instance - * @return Size of sbp_msg_settings_write_t::setting in wire representation - */ - SBP_EXPORT size_t sbp_msg_settings_write_setting_encoded_len(const sbp_msg_settings_write_t *msg); +/** + * Get the encoded size of sbp_msg_settings_write_t::setting + * + * @param msg sbp_msg_settings_write_t instance + * @return Size of sbp_msg_settings_write_t::setting in wire representation + */ +SBP_EXPORT size_t +sbp_msg_settings_write_setting_encoded_len(const sbp_msg_settings_write_t *msg); - /** - * Query sbp_msg_settings_write_t::setting for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_settings_write_t::setting before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_settings_write_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_settings_write_setting_space_remaining(const sbp_msg_settings_write_t *msg); - /** - * Return the number of sections in sbp_msg_settings_write_t::setting - * - * @param msg sbp_msg_settings_write_t instance - * @return Number of sections in string - */ - SBP_EXPORT size_t sbp_msg_settings_write_setting_count_sections(const sbp_msg_settings_write_t *msg); +/** + * Query sbp_msg_settings_write_t::setting for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_settings_write_t::setting before it exceeds the maximum size + * of the field in wire representation + * + * @param msg sbp_msg_settings_write_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_settings_write_setting_space_remaining( + const sbp_msg_settings_write_t *msg); +/** + * Return the number of sections in sbp_msg_settings_write_t::setting + * + * @param msg sbp_msg_settings_write_t instance + * @return Number of sections in string + */ +SBP_EXPORT size_t sbp_msg_settings_write_setting_count_sections( + const sbp_msg_settings_write_t *msg); - /** - * Add a section to sbp_msg_settings_write_t::setting - * - * The specified string will be appended to the field as a new section. If the new section would end up overflowing the maximum encoded length of this field the string will not be changed and this function will return false - * - * @param msg sbp_msg_settings_write_t instance - * @param new_str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_write_setting_add_section(sbp_msg_settings_write_t *msg, const char *new_str); +/** + * Add a section to sbp_msg_settings_write_t::setting + * + * The specified string will be appended to the field as a new section. If the + * new section would end up overflowing the maximum encoded length of this field + * the string will not be changed and this function will return false + * + * @param msg sbp_msg_settings_write_t instance + * @param new_str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_write_setting_add_section( + sbp_msg_settings_write_t *msg, const char *new_str); - /** - * Add a section to sbp_msg_settings_write_t::setting with printf style formatting - * - * A new section will be added to the field according to the specified printf style format string and arguments. If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_write_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_write_setting_add_section_printf(sbp_msg_settings_write_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Add a section to sbp_msg_settings_write_t::setting with printf style + * formatting + * + * A new section will be added to the field according to the specified printf + * style format string and arguments. If the operation would end up overflowing + * the maximum size of this field in wire encoding the existing contents will be + * unmodified and this function will return false. + * + * @param msg sbp_msg_settings_write_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_write_setting_add_section_printf( + sbp_msg_settings_write_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2, 3); - /** - * Add a section to sbp_msg_settings_write_t::setting with printf style formatting - * - * Identical to #sbp_msg_settings_write_setting_add_section_printf except it takes a va_list argument - * - * @param msg sbp_msg_settings_write_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_write_setting_add_section_vprintf(sbp_msg_settings_write_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Add a section to sbp_msg_settings_write_t::setting with printf style + * formatting + * + * Identical to #sbp_msg_settings_write_setting_add_section_printf except it + * takes a va_list argument + * + * @param msg sbp_msg_settings_write_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_write_setting_add_section_vprintf( + sbp_msg_settings_write_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Append a string to the last section in sbp_msg_settings_write_t::setting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_write_setting_add_section - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_write_t instance - * @param str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_write_setting_append(sbp_msg_settings_write_t *msg, const char *str); +/** + * Append a string to the last section in sbp_msg_settings_write_t::setting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_write_setting_add_section + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_write_t instance + * @param str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_write_setting_append( + sbp_msg_settings_write_t *msg, const char *str); - /** - * Append a string to the last section in sbp_msg_settings_write_t::setting with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_write_setting_add_section_printf - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_write_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_write_setting_append_printf(sbp_msg_settings_write_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Append a string to the last section in sbp_msg_settings_write_t::setting with + * printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_write_setting_add_section_printf + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_write_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_write_setting_append_printf( + sbp_msg_settings_write_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2, 3); - /** - * Append a string to the last section in sbp_msg_settings_write_t::setting with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_write_setting_add_section_vprintf - * - * If the field already contains one or more sections the given string will be sppended on to the last section in the string. - * - * If the operation would end overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_write_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_write_setting_append_vprintf(sbp_msg_settings_write_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Append a string to the last section in sbp_msg_settings_write_t::setting with + * printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_write_setting_add_section_vprintf + * + * If the field already contains one or more sections the given string will be + * sppended on to the last section in the string. + * + * If the operation would end overflowing the maximum size of this field in wire + * encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_write_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_write_setting_append_vprintf( + sbp_msg_settings_write_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Obtain a section from sbp_msg_settings_write_t::setting - * - * Returns a pointer to the given subsection in the field. Sections are 0-indexed, the \p section parameters must be less than the value returned from #sbp_msg_settings_write_setting_count_sections. - * - * @param msg sbp_msg_settings_write_t instance - * @param section Section number - * @return Pointer to C string, NULL on error - */ - SBP_EXPORT const char *sbp_msg_settings_write_setting_get_section(const sbp_msg_settings_write_t *msg, size_t section); +/** + * Obtain a section from sbp_msg_settings_write_t::setting + * + * Returns a pointer to the given subsection in the field. Sections are + * 0-indexed, the \p section parameters must be less than the value returned + * from #sbp_msg_settings_write_setting_count_sections. + * + * @param msg sbp_msg_settings_write_t instance + * @param section Section number + * @return Pointer to C string, NULL on error + */ +SBP_EXPORT const char *sbp_msg_settings_write_setting_get_section( + const sbp_msg_settings_write_t *msg, size_t section); - /** - * Obtain the length of a section in sbp_msg_settings_write_t::setting - * - * The returned value does not include the NULL terminator. - * - * If the given section does not exist 0 is returned. - * - * @param msg sbp_msg_settings_write_t instance - * @param section Section number - * @return Length of section - */ - SBP_EXPORT size_t sbp_msg_settings_write_setting_section_strlen(const sbp_msg_settings_write_t *msg, size_t section); +/** + * Obtain the length of a section in sbp_msg_settings_write_t::setting + * + * The returned value does not include the NULL terminator. + * + * If the given section does not exist 0 is returned. + * + * @param msg sbp_msg_settings_write_t instance + * @param section Section number + * @return Length of section + */ +SBP_EXPORT size_t sbp_msg_settings_write_setting_section_strlen( + const sbp_msg_settings_write_t *msg, size_t section); /** * Get encoded size of an instance of sbp_msg_settings_write_t @@ -213,46 +260,62 @@ typedef struct { * @param msg sbp_msg_settings_write_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_settings_write_encoded_len(const sbp_msg_settings_write_t *msg) -{ - return SBP_MSG_SETTINGS_WRITE_ENCODED_OVERHEAD - + sbp_msg_settings_write_setting_encoded_len(msg) - ; +static inline size_t sbp_msg_settings_write_encoded_len( + const sbp_msg_settings_write_t *msg) { + return SBP_MSG_SETTINGS_WRITE_ENCODED_OVERHEAD + + sbp_msg_settings_write_setting_encoded_len(msg); } /** * Encode an instance of sbp_msg_settings_write_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_settings_write_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_write_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_write_t *msg); +SBP_EXPORT s8 +sbp_msg_settings_write_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_write_t *msg); /** * Decode an instance of sbp_msg_settings_write_t from wire representation * - * This function decodes the wire representation of a sbp_msg_settings_write_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_settings_write_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_settings_write_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_write_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_write_t *msg); +SBP_EXPORT s8 sbp_msg_settings_write_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_settings_write_t *msg); /** * Send an instance of sbp_msg_settings_write_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_settings_write_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_settings_write_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -260,51 +323,61 @@ SBP_EXPORT s8 sbp_msg_settings_write_decode(const uint8_t *buf, uint8_t len, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_write_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_write_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_settings_write_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_settings_write_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_settings_write_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_settings_write_t instance * @param b sbp_msg_settings_write_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_settings_write_cmp(const sbp_msg_settings_write_t *a, const sbp_msg_settings_write_t *b); +SBP_EXPORT int sbp_msg_settings_write_cmp(const sbp_msg_settings_write_t *a, + const sbp_msg_settings_write_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_settings_write_t &lhs, const sbp_msg_settings_write_t &rhs) { +static inline bool operator==(const sbp_msg_settings_write_t &lhs, + const sbp_msg_settings_write_t &rhs) { return sbp_msg_settings_write_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_settings_write_t &lhs, const sbp_msg_settings_write_t &rhs) { +static inline bool operator!=(const sbp_msg_settings_write_t &lhs, + const sbp_msg_settings_write_t &rhs) { return sbp_msg_settings_write_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_settings_write_t &lhs, const sbp_msg_settings_write_t &rhs) { +static inline bool operator<(const sbp_msg_settings_write_t &lhs, + const sbp_msg_settings_write_t &rhs) { return sbp_msg_settings_write_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_settings_write_t &lhs, const sbp_msg_settings_write_t &rhs) { +static inline bool operator<=(const sbp_msg_settings_write_t &lhs, + const sbp_msg_settings_write_t &rhs) { return sbp_msg_settings_write_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_settings_write_t &lhs, const sbp_msg_settings_write_t &rhs) { +static inline bool operator>(const sbp_msg_settings_write_t &lhs, + const sbp_msg_settings_write_t &rhs) { return sbp_msg_settings_write_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_settings_write_t &lhs, const sbp_msg_settings_write_t &rhs) { +static inline bool operator>=(const sbp_msg_settings_write_t &lhs, + const sbp_msg_settings_write_t &rhs) { return sbp_msg_settings_write_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SETTINGS_MSG_SETTINGS_WRITE_H */ - diff --git a/c/include/libsbp/settings/MSG_SETTINGS_WRITE_RESP.h b/c/include/libsbp/settings/MSG_SETTINGS_WRITE_RESP.h index 2352e4a41..17ebcca7d 100644 --- a/c/include/libsbp/settings/MSG_SETTINGS_WRITE_RESP.h +++ b/c/include/libsbp/settings/MSG_SETTINGS_WRITE_RESP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SETTINGS_MSG_SETTINGS_WRITE_RESP_H #define LIBSBP_SETTINGS_MSG_SETTINGS_WRITE_RESP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,178 +40,227 @@ *****************************************************************************/ /** Acknowledgement with status of MSG_SETTINGS_WRITE * -* Return the status of a write request with the new value of the setting. If the requested value is rejected, the current value will be returned. The string field is a NULL-terminated and NULL-delimited string with contents "SECTION_SETTING\0SETTING\0VALUE\0" where the '\0' escape sequence denotes the NULL character and where quotation marks are omitted. An example string that could be sent from device is "solution\0soln_freq\010\0". + * Return the status of a write request with the new value of the setting. If + * the requested value is rejected, the current value will be returned. The + * string field is a NULL-terminated and NULL-delimited string with contents + * "SECTION_SETTING\0SETTING\0VALUE\0" where the '\0' escape sequence denotes + * the NULL character and where quotation marks are omitted. An example string + * that could be sent from device is "solution\0soln_freq\010\0". */ typedef struct { - - /** -* Write status + * Write status */ u8 status; - /** - * A NULL-terminated and delimited string with contents "SECTION_SETTING\0SETTING\0VALUE\0" + * A NULL-terminated and delimited string with contents + * "SECTION_SETTING\0SETTING\0VALUE\0" */ sbp_string_t setting; } sbp_msg_settings_write_resp_t; +/** + * Initialise sbp_msg_settings_write_resp_t::setting to empty + * + * @param msg sbp_msg_settings_write_resp_t instance + */ +SBP_EXPORT void sbp_msg_settings_write_resp_setting_init( + sbp_msg_settings_write_resp_t *msg); - /** - * Initialise sbp_msg_settings_write_resp_t::setting to empty - * - * @param msg sbp_msg_settings_write_resp_t instance - */ - SBP_EXPORT void sbp_msg_settings_write_resp_setting_init(sbp_msg_settings_write_resp_t *msg); - - /** - * Test sbp_msg_settings_write_resp_t::setting for validity - * - * @param msg sbp_msg_settings_write_resp_t instance - * @return true is sbp_msg_settings_write_resp_t::setting is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_write_resp_setting_valid(const sbp_msg_settings_write_resp_t *msg); +/** + * Test sbp_msg_settings_write_resp_t::setting for validity + * + * @param msg sbp_msg_settings_write_resp_t instance + * @return true is sbp_msg_settings_write_resp_t::setting is valid for encoding + * purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_write_resp_setting_valid( + const sbp_msg_settings_write_resp_t *msg); - /** - * Tests 2 instances of sbp_msg_settings_write_resp_t::setting for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_settings_write_resp_t instance - * @param b sbp_msg_settings_write_resp_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_settings_write_resp_setting_strcmp(const sbp_msg_settings_write_resp_t *a, const sbp_msg_settings_write_resp_t *b); +/** + * Tests 2 instances of sbp_msg_settings_write_resp_t::setting for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_settings_write_resp_t instance + * @param b sbp_msg_settings_write_resp_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_settings_write_resp_setting_strcmp( + const sbp_msg_settings_write_resp_t *a, + const sbp_msg_settings_write_resp_t *b); - /** - * Get the encoded size of sbp_msg_settings_write_resp_t::setting - * - * @param msg sbp_msg_settings_write_resp_t instance - * @return Size of sbp_msg_settings_write_resp_t::setting in wire representation - */ - SBP_EXPORT size_t sbp_msg_settings_write_resp_setting_encoded_len(const sbp_msg_settings_write_resp_t *msg); +/** + * Get the encoded size of sbp_msg_settings_write_resp_t::setting + * + * @param msg sbp_msg_settings_write_resp_t instance + * @return Size of sbp_msg_settings_write_resp_t::setting in wire representation + */ +SBP_EXPORT size_t sbp_msg_settings_write_resp_setting_encoded_len( + const sbp_msg_settings_write_resp_t *msg); - /** - * Query sbp_msg_settings_write_resp_t::setting for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_settings_write_resp_t::setting before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_settings_write_resp_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_settings_write_resp_setting_space_remaining(const sbp_msg_settings_write_resp_t *msg); - /** - * Return the number of sections in sbp_msg_settings_write_resp_t::setting - * - * @param msg sbp_msg_settings_write_resp_t instance - * @return Number of sections in string - */ - SBP_EXPORT size_t sbp_msg_settings_write_resp_setting_count_sections(const sbp_msg_settings_write_resp_t *msg); +/** + * Query sbp_msg_settings_write_resp_t::setting for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_settings_write_resp_t::setting before it exceeds the maximum + * size of the field in wire representation + * + * @param msg sbp_msg_settings_write_resp_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_settings_write_resp_setting_space_remaining( + const sbp_msg_settings_write_resp_t *msg); +/** + * Return the number of sections in sbp_msg_settings_write_resp_t::setting + * + * @param msg sbp_msg_settings_write_resp_t instance + * @return Number of sections in string + */ +SBP_EXPORT size_t sbp_msg_settings_write_resp_setting_count_sections( + const sbp_msg_settings_write_resp_t *msg); - /** - * Add a section to sbp_msg_settings_write_resp_t::setting - * - * The specified string will be appended to the field as a new section. If the new section would end up overflowing the maximum encoded length of this field the string will not be changed and this function will return false - * - * @param msg sbp_msg_settings_write_resp_t instance - * @param new_str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_write_resp_setting_add_section(sbp_msg_settings_write_resp_t *msg, const char *new_str); +/** + * Add a section to sbp_msg_settings_write_resp_t::setting + * + * The specified string will be appended to the field as a new section. If the + * new section would end up overflowing the maximum encoded length of this field + * the string will not be changed and this function will return false + * + * @param msg sbp_msg_settings_write_resp_t instance + * @param new_str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_write_resp_setting_add_section( + sbp_msg_settings_write_resp_t *msg, const char *new_str); - /** - * Add a section to sbp_msg_settings_write_resp_t::setting with printf style formatting - * - * A new section will be added to the field according to the specified printf style format string and arguments. If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_write_resp_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_write_resp_setting_add_section_printf(sbp_msg_settings_write_resp_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Add a section to sbp_msg_settings_write_resp_t::setting with printf style + * formatting + * + * A new section will be added to the field according to the specified printf + * style format string and arguments. If the operation would end up overflowing + * the maximum size of this field in wire encoding the existing contents will be + * unmodified and this function will return false. + * + * @param msg sbp_msg_settings_write_resp_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_write_resp_setting_add_section_printf( + sbp_msg_settings_write_resp_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Add a section to sbp_msg_settings_write_resp_t::setting with printf style formatting - * - * Identical to #sbp_msg_settings_write_resp_setting_add_section_printf except it takes a va_list argument - * - * @param msg sbp_msg_settings_write_resp_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_write_resp_setting_add_section_vprintf(sbp_msg_settings_write_resp_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Add a section to sbp_msg_settings_write_resp_t::setting with printf style + * formatting + * + * Identical to #sbp_msg_settings_write_resp_setting_add_section_printf except + * it takes a va_list argument + * + * @param msg sbp_msg_settings_write_resp_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_write_resp_setting_add_section_vprintf( + sbp_msg_settings_write_resp_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Append a string to the last section in sbp_msg_settings_write_resp_t::setting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_write_resp_setting_add_section - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_write_resp_t instance - * @param str New string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_write_resp_setting_append(sbp_msg_settings_write_resp_t *msg, const char *str); +/** + * Append a string to the last section in sbp_msg_settings_write_resp_t::setting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_write_resp_setting_add_section + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_write_resp_t instance + * @param str New string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_write_resp_setting_append( + sbp_msg_settings_write_resp_t *msg, const char *str); - /** - * Append a string to the last section in sbp_msg_settings_write_resp_t::setting with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_write_resp_setting_add_section_printf - * - * If the field already contains one or more sections the given string will be appended on to the last section in the string. - * - * If the operation would end up overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_write_resp_t instance - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_write_resp_setting_append_printf(sbp_msg_settings_write_resp_t *msg, const char *fmt, ...) SBP_ATTR_FORMAT(2,3); +/** + * Append a string to the last section in sbp_msg_settings_write_resp_t::setting + * with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_write_resp_setting_add_section_printf + * + * If the field already contains one or more sections the given string will be + * appended on to the last section in the string. + * + * If the operation would end up overflowing the maximum size of this field in + * wire encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_write_resp_t instance + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_write_resp_setting_append_printf( + sbp_msg_settings_write_resp_t *msg, const char *fmt, ...) + SBP_ATTR_FORMAT(2, 3); - /** - * Append a string to the last section in sbp_msg_settings_write_resp_t::setting with printf style formatting - * - * If the field is currently empty this function will behave exactly like #sbp_msg_settings_write_resp_setting_add_section_vprintf - * - * If the field already contains one or more sections the given string will be sppended on to the last section in the string. - * - * If the operation would end overflowing the maximum size of this field in wire encoding the existing contents will be unmodified and this function will return false. - * - * @param msg sbp_msg_settings_write_resp_t instance - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_settings_write_resp_setting_append_vprintf(sbp_msg_settings_write_resp_t *msg, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(2); +/** + * Append a string to the last section in sbp_msg_settings_write_resp_t::setting + * with printf style formatting + * + * If the field is currently empty this function will behave exactly like + * #sbp_msg_settings_write_resp_setting_add_section_vprintf + * + * If the field already contains one or more sections the given string will be + * sppended on to the last section in the string. + * + * If the operation would end overflowing the maximum size of this field in wire + * encoding the existing contents will be unmodified and this function will + * return false. + * + * @param msg sbp_msg_settings_write_resp_t instance + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_settings_write_resp_setting_append_vprintf( + sbp_msg_settings_write_resp_t *msg, const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(2); - /** - * Obtain a section from sbp_msg_settings_write_resp_t::setting - * - * Returns a pointer to the given subsection in the field. Sections are 0-indexed, the \p section parameters must be less than the value returned from #sbp_msg_settings_write_resp_setting_count_sections. - * - * @param msg sbp_msg_settings_write_resp_t instance - * @param section Section number - * @return Pointer to C string, NULL on error - */ - SBP_EXPORT const char *sbp_msg_settings_write_resp_setting_get_section(const sbp_msg_settings_write_resp_t *msg, size_t section); +/** + * Obtain a section from sbp_msg_settings_write_resp_t::setting + * + * Returns a pointer to the given subsection in the field. Sections are + * 0-indexed, the \p section parameters must be less than the value returned + * from #sbp_msg_settings_write_resp_setting_count_sections. + * + * @param msg sbp_msg_settings_write_resp_t instance + * @param section Section number + * @return Pointer to C string, NULL on error + */ +SBP_EXPORT const char *sbp_msg_settings_write_resp_setting_get_section( + const sbp_msg_settings_write_resp_t *msg, size_t section); - /** - * Obtain the length of a section in sbp_msg_settings_write_resp_t::setting - * - * The returned value does not include the NULL terminator. - * - * If the given section does not exist 0 is returned. - * - * @param msg sbp_msg_settings_write_resp_t instance - * @param section Section number - * @return Length of section - */ - SBP_EXPORT size_t sbp_msg_settings_write_resp_setting_section_strlen(const sbp_msg_settings_write_resp_t *msg, size_t section); +/** + * Obtain the length of a section in sbp_msg_settings_write_resp_t::setting + * + * The returned value does not include the NULL terminator. + * + * If the given section does not exist 0 is returned. + * + * @param msg sbp_msg_settings_write_resp_t instance + * @param section Section number + * @return Length of section + */ +SBP_EXPORT size_t sbp_msg_settings_write_resp_setting_section_strlen( + const sbp_msg_settings_write_resp_t *msg, size_t section); /** * Get encoded size of an instance of sbp_msg_settings_write_resp_t @@ -219,46 +268,63 @@ typedef struct { * @param msg sbp_msg_settings_write_resp_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_settings_write_resp_encoded_len(const sbp_msg_settings_write_resp_t *msg) -{ - return SBP_MSG_SETTINGS_WRITE_RESP_ENCODED_OVERHEAD - + sbp_msg_settings_write_resp_setting_encoded_len(msg) - ; +static inline size_t sbp_msg_settings_write_resp_encoded_len( + const sbp_msg_settings_write_resp_t *msg) { + return SBP_MSG_SETTINGS_WRITE_RESP_ENCODED_OVERHEAD + + sbp_msg_settings_write_resp_setting_encoded_len(msg); } /** * Encode an instance of sbp_msg_settings_write_resp_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_settings_write_resp_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_write_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_write_resp_t *msg); +SBP_EXPORT s8 sbp_msg_settings_write_resp_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_write_resp_t *msg); /** * Decode an instance of sbp_msg_settings_write_resp_t from wire representation * - * This function decodes the wire representation of a sbp_msg_settings_write_resp_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_settings_write_resp_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_settings_write_resp_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_write_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_write_resp_t *msg); +SBP_EXPORT s8 sbp_msg_settings_write_resp_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_write_resp_t *msg); /** - * Send an instance of sbp_msg_settings_write_resp_t with the given write function + * Send an instance of sbp_msg_settings_write_resp_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_settings_write_resp_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_settings_write_resp_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -266,51 +332,62 @@ SBP_EXPORT s8 sbp_msg_settings_write_resp_decode(const uint8_t *buf, uint8_t len * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_settings_write_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_write_resp_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_settings_write_resp_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_settings_write_resp_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_settings_write_resp_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_settings_write_resp_t instance * @param b sbp_msg_settings_write_resp_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_settings_write_resp_cmp(const sbp_msg_settings_write_resp_t *a, const sbp_msg_settings_write_resp_t *b); +SBP_EXPORT int sbp_msg_settings_write_resp_cmp( + const sbp_msg_settings_write_resp_t *a, + const sbp_msg_settings_write_resp_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_settings_write_resp_t &lhs, const sbp_msg_settings_write_resp_t &rhs) { +static inline bool operator==(const sbp_msg_settings_write_resp_t &lhs, + const sbp_msg_settings_write_resp_t &rhs) { return sbp_msg_settings_write_resp_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_settings_write_resp_t &lhs, const sbp_msg_settings_write_resp_t &rhs) { +static inline bool operator!=(const sbp_msg_settings_write_resp_t &lhs, + const sbp_msg_settings_write_resp_t &rhs) { return sbp_msg_settings_write_resp_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_settings_write_resp_t &lhs, const sbp_msg_settings_write_resp_t &rhs) { +static inline bool operator<(const sbp_msg_settings_write_resp_t &lhs, + const sbp_msg_settings_write_resp_t &rhs) { return sbp_msg_settings_write_resp_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_settings_write_resp_t &lhs, const sbp_msg_settings_write_resp_t &rhs) { +static inline bool operator<=(const sbp_msg_settings_write_resp_t &lhs, + const sbp_msg_settings_write_resp_t &rhs) { return sbp_msg_settings_write_resp_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_settings_write_resp_t &lhs, const sbp_msg_settings_write_resp_t &rhs) { +static inline bool operator>(const sbp_msg_settings_write_resp_t &lhs, + const sbp_msg_settings_write_resp_t &rhs) { return sbp_msg_settings_write_resp_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_settings_write_resp_t &lhs, const sbp_msg_settings_write_resp_t &rhs) { +static inline bool operator>=(const sbp_msg_settings_write_resp_t &lhs, + const sbp_msg_settings_write_resp_t &rhs) { return sbp_msg_settings_write_resp_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SETTINGS_MSG_SETTINGS_WRITE_RESP_H */ - diff --git a/c/include/libsbp/settings_macros.h b/c/include/libsbp/settings_macros.h index d1fb6167b..3611fcecb 100644 --- a/c/include/libsbp/settings_macros.h +++ b/c/include/libsbp/settings_macros.h @@ -18,224 +18,239 @@ #ifndef LIBSBP_SETTINGS_MACROS_H #define LIBSBP_SETTINGS_MACROS_H - #define SBP_MSG_SETTINGS_SAVE 0x00A1 /** - * Encoded length of sbp_msg_settings_save_t (V4 API) and + * Encoded length of sbp_msg_settings_save_t (V4 API) and * msg_settings_save_t (legacy API) */ #define SBP_MSG_SETTINGS_SAVE_ENCODED_LEN 0u - #define SBP_MSG_SETTINGS_WRITE 0x00A0 /** - * The maximum number of items that can be stored in sbp_msg_settings_write_t::setting (V4 API) or msg_settings_write_t::setting (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_settings_write_t::setting (V4 API) or msg_settings_write_t::setting + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_SETTINGS_WRITE_SETTING_MAX 255u - /** - * Encoded length of sbp_msg_settings_write_t (V4 API) and + * Encoded length of sbp_msg_settings_write_t (V4 API) and * msg_settings_write_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_settings_write_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_settings_write_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SETTINGS_WRITE_ENCODED_OVERHEAD 0u - #define SBP_MSG_SETTINGS_WRITE_RESP 0x00AF #define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_MASK (0x3u) #define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_SHIFT (0u) -#define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_SHIFT) \ - & SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_MASK)) -#define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_MASK << SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_SHIFT))) | \ - (((val) & (SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_MASK)) \ - << (SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_SHIFT)));} while(0) - +#define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_SHIFT) & \ + SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_MASK)) +#define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_MASK \ + << SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_SHIFT))) | \ + (((val) & (SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_MASK)) \ + << (SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_SHIFT))); \ + } while (0) #define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_ACCEPTED_VALUE_UPDATED (0) -#define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_REJECTED_VALUE_UNPARSABLE_OR_OUT_OF_RANGE (1) -#define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_REJECTED_REQUESTED_SETTING_DOES_NOT_EXIST (2) -#define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_REJECTED_SETTING_NAME_COULD_NOT_BE_PARSED (3) +#define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_REJECTED_VALUE_UNPARSABLE_OR_OUT_OF_RANGE \ + (1) +#define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_REJECTED_REQUESTED_SETTING_DOES_NOT_EXIST \ + (2) +#define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_REJECTED_SETTING_NAME_COULD_NOT_BE_PARSED \ + (3) #define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_REJECTED_SETTING_IS_READ_ONLY (4) -#define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_REJECTED_MODIFICATION_IS_TEMPORARILY_DISABLED (5) +#define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_REJECTED_MODIFICATION_IS_TEMPORARILY_DISABLED \ + (5) #define SBP_SETTINGS_WRITE_RESP_WRITE_STATUS_REJECTED_UNSPECIFIED_ERROR (6) /** - * The maximum number of items that can be stored in sbp_msg_settings_write_resp_t::setting (V4 API) or msg_settings_write_resp_t::setting (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_settings_write_resp_t::setting (V4 API) or + * msg_settings_write_resp_t::setting (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX 254u - /** - * Encoded length of sbp_msg_settings_write_resp_t (V4 API) and + * Encoded length of sbp_msg_settings_write_resp_t (V4 API) and * msg_settings_write_resp_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_settings_write_resp_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_settings_write_resp_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SETTINGS_WRITE_RESP_ENCODED_OVERHEAD 1u - #define SBP_MSG_SETTINGS_READ_REQ 0x00A4 /** - * The maximum number of items that can be stored in sbp_msg_settings_read_req_t::setting (V4 API) or msg_settings_read_req_t::setting (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_settings_read_req_t::setting (V4 API) or + * msg_settings_read_req_t::setting (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX 255u - /** - * Encoded length of sbp_msg_settings_read_req_t (V4 API) and + * Encoded length of sbp_msg_settings_read_req_t (V4 API) and * msg_settings_read_req_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_settings_read_req_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_settings_read_req_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SETTINGS_READ_REQ_ENCODED_OVERHEAD 0u - #define SBP_MSG_SETTINGS_READ_RESP 0x00A5 /** - * The maximum number of items that can be stored in sbp_msg_settings_read_resp_t::setting (V4 API) or msg_settings_read_resp_t::setting (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_settings_read_resp_t::setting (V4 API) or + * msg_settings_read_resp_t::setting (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX 255u - /** - * Encoded length of sbp_msg_settings_read_resp_t (V4 API) and + * Encoded length of sbp_msg_settings_read_resp_t (V4 API) and * msg_settings_read_resp_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_settings_read_resp_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_settings_read_resp_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SETTINGS_READ_RESP_ENCODED_OVERHEAD 0u - #define SBP_MSG_SETTINGS_READ_BY_INDEX_REQ 0x00A2 /** - * Encoded length of sbp_msg_settings_read_by_index_req_t (V4 API) and + * Encoded length of sbp_msg_settings_read_by_index_req_t (V4 API) and * msg_settings_read_by_index_req_t (legacy API) */ #define SBP_MSG_SETTINGS_READ_BY_INDEX_REQ_ENCODED_LEN 2u - #define SBP_MSG_SETTINGS_READ_BY_INDEX_RESP 0x00A7 /** - * The maximum number of items that can be stored in sbp_msg_settings_read_by_index_resp_t::setting (V4 API) or msg_settings_read_by_index_resp_t::setting (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_settings_read_by_index_resp_t::setting (V4 API) or + * msg_settings_read_by_index_resp_t::setting (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX 253u - /** - * Encoded length of sbp_msg_settings_read_by_index_resp_t (V4 API) and + * Encoded length of sbp_msg_settings_read_by_index_resp_t (V4 API) and * msg_settings_read_by_index_resp_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_settings_read_by_index_resp_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_settings_read_by_index_resp_encoded_len to determine the actual size + * of an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_ENCODED_OVERHEAD 2u - #define SBP_MSG_SETTINGS_READ_BY_INDEX_DONE 0x00A6 /** - * Encoded length of sbp_msg_settings_read_by_index_done_t (V4 API) and + * Encoded length of sbp_msg_settings_read_by_index_done_t (V4 API) and * msg_settings_read_by_index_done_t (legacy API) */ #define SBP_MSG_SETTINGS_READ_BY_INDEX_DONE_ENCODED_LEN 0u - #define SBP_MSG_SETTINGS_REGISTER 0x00AE /** - * The maximum number of items that can be stored in sbp_msg_settings_register_t::setting (V4 API) or msg_settings_register_t::setting (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_settings_register_t::setting (V4 API) or + * msg_settings_register_t::setting (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_SETTINGS_REGISTER_SETTING_MAX 255u - /** - * Encoded length of sbp_msg_settings_register_t (V4 API) and + * Encoded length of sbp_msg_settings_register_t (V4 API) and * msg_settings_register_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_settings_register_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_settings_register_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SETTINGS_REGISTER_ENCODED_OVERHEAD 0u - #define SBP_MSG_SETTINGS_REGISTER_RESP 0x01AF #define SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_MASK (0x3u) #define SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_SHIFT (0u) -#define SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_SHIFT) \ - & SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_MASK)) -#define SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_MASK << SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_SHIFT))) | \ - (((val) & (SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_MASK)) \ - << (SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_SHIFT)));} while(0) - - -#define SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_ACCEPTED_REQUESTED_DEFAULT_VALUE_RETURNED (0) -#define SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_ACCEPTED_SETTING_FOUND_IN_PERMANENT_STORAGE_VALUE_FROM_STORAGE_RETURNED (1) -#define SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_REJECTED_SETTING_ALREADY_REGISTERED_VALUE_FROM_MEMORY_RETURNED (2) -#define SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_REJECTED_MALFORMED_MESSAGE (3) -/** - * The maximum number of items that can be stored in sbp_msg_settings_register_resp_t::setting (V4 API) or msg_settings_register_resp_t::setting (legacy API) before the maximum SBP message size is exceeded +#define SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_SHIFT) & \ + SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_MASK)) +#define SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_MASK \ + << SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_SHIFT))) | \ + (((val) & (SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_MASK)) \ + << (SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_SHIFT))); \ + } while (0) + +#define SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_ACCEPTED_REQUESTED_DEFAULT_VALUE_RETURNED \ + (0) +#define SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_ACCEPTED_SETTING_FOUND_IN_PERMANENT_STORAGE_VALUE_FROM_STORAGE_RETURNED \ + (1) +#define SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_REJECTED_SETTING_ALREADY_REGISTERED_VALUE_FROM_MEMORY_RETURNED \ + (2) +#define SBP_SETTINGS_REGISTER_RESP_REGISTER_STATUS_REJECTED_MALFORMED_MESSAGE \ + (3) +/** + * The maximum number of items that can be stored in + * sbp_msg_settings_register_resp_t::setting (V4 API) or + * msg_settings_register_resp_t::setting (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX 254u - /** - * Encoded length of sbp_msg_settings_register_resp_t (V4 API) and + * Encoded length of sbp_msg_settings_register_resp_t (V4 API) and * msg_settings_register_resp_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_settings_register_resp_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_settings_register_resp_encoded_len to determine the actual size of + * an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SETTINGS_REGISTER_RESP_ENCODED_OVERHEAD 1u - - #endif /* LIBSBP_SETTINGS_MACROS_H */ diff --git a/c/include/libsbp/signing.h b/c/include/libsbp/signing.h index df1205280..6edf4bb76 100644 --- a/c/include/libsbp/signing.h +++ b/c/include/libsbp/signing.h @@ -17,16 +17,16 @@ #ifndef LIBSBP_SIGNING_MESSAGES_H #define LIBSBP_SIGNING_MESSAGES_H -#include #include -#include #include #include +#include #include -#include #include +#include #include #include #include +#include #endif /* LIBSBP_SIGNING_MESSAGES_H */ diff --git a/c/include/libsbp/signing/ECDSASignature.h b/c/include/libsbp/signing/ECDSASignature.h index 7aad83637..f6b6e063c 100644 --- a/c/include/libsbp/signing/ECDSASignature.h +++ b/c/include/libsbp/signing/ECDSASignature.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SIGNING_ECDSASIGNATURE_H #define LIBSBP_SIGNING_ECDSASIGNATURE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -39,30 +39,28 @@ * *****************************************************************************/ typedef struct { - - /** - * Number of bytes to use of the signature field. The DER encoded signature has a maximum size of 72 bytes but can vary between 70 and 72 bytes in length. + * Number of bytes to use of the signature field. The DER encoded signature + * has a maximum size of 72 bytes but can vary between 70 and 72 bytes in + * length. */ u8 len; - /** - * DER encoded ECDSA signature for the messages using SHA-256 as the digest algorithm. + * DER encoded ECDSA signature for the messages using SHA-256 as the digest + * algorithm. */ u8 data[SBP_ECDSA_SIGNATURE_DATA_MAX]; } sbp_ecdsa_signature_t; - - /** * Get encoded size of an instance of sbp_ecdsa_signature_t * * @param msg sbp_ecdsa_signature_t instance * @return Length of on-wire representation */ -static inline size_t sbp_ecdsa_signature_encoded_len(const sbp_ecdsa_signature_t *msg) -{ +static inline size_t sbp_ecdsa_signature_encoded_len( + const sbp_ecdsa_signature_t *msg) { (void)msg; return SBP_ECDSA_SIGNATURE_ENCODED_LEN; } @@ -70,74 +68,96 @@ static inline size_t sbp_ecdsa_signature_encoded_len(const sbp_ecdsa_signature_t /** * Encode an instance of sbp_ecdsa_signature_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_ecdsa_signature_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_ecdsa_signature_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_ecdsa_signature_t *msg); +SBP_EXPORT s8 sbp_ecdsa_signature_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_ecdsa_signature_t *msg); /** * Decode an instance of sbp_ecdsa_signature_t from wire representation * - * This function decodes the wire representation of a sbp_ecdsa_signature_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_ecdsa_signature_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_ecdsa_signature_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_ecdsa_signature_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ecdsa_signature_t *msg); +SBP_EXPORT s8 sbp_ecdsa_signature_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_ecdsa_signature_t *msg); /** * Compare two instances of sbp_ecdsa_signature_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_ecdsa_signature_t instance * @param b sbp_ecdsa_signature_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_ecdsa_signature_cmp(const sbp_ecdsa_signature_t *a, const sbp_ecdsa_signature_t *b); +SBP_EXPORT int sbp_ecdsa_signature_cmp(const sbp_ecdsa_signature_t *a, + const sbp_ecdsa_signature_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_ecdsa_signature_t &lhs, const sbp_ecdsa_signature_t &rhs) { +static inline bool operator==(const sbp_ecdsa_signature_t &lhs, + const sbp_ecdsa_signature_t &rhs) { return sbp_ecdsa_signature_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_ecdsa_signature_t &lhs, const sbp_ecdsa_signature_t &rhs) { +static inline bool operator!=(const sbp_ecdsa_signature_t &lhs, + const sbp_ecdsa_signature_t &rhs) { return sbp_ecdsa_signature_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_ecdsa_signature_t &lhs, const sbp_ecdsa_signature_t &rhs) { +static inline bool operator<(const sbp_ecdsa_signature_t &lhs, + const sbp_ecdsa_signature_t &rhs) { return sbp_ecdsa_signature_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_ecdsa_signature_t &lhs, const sbp_ecdsa_signature_t &rhs) { +static inline bool operator<=(const sbp_ecdsa_signature_t &lhs, + const sbp_ecdsa_signature_t &rhs) { return sbp_ecdsa_signature_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_ecdsa_signature_t &lhs, const sbp_ecdsa_signature_t &rhs) { +static inline bool operator>(const sbp_ecdsa_signature_t &lhs, + const sbp_ecdsa_signature_t &rhs) { return sbp_ecdsa_signature_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_ecdsa_signature_t &lhs, const sbp_ecdsa_signature_t &rhs) { +static inline bool operator>=(const sbp_ecdsa_signature_t &lhs, + const sbp_ecdsa_signature_t &rhs) { return sbp_ecdsa_signature_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SIGNING_ECDSASIGNATURE_H */ - diff --git a/c/include/libsbp/signing/MSG_CERTIFICATE_CHAIN.h b/c/include/libsbp/signing/MSG_CERTIFICATE_CHAIN.h index b17455d32..1435ff57e 100644 --- a/c/include/libsbp/signing/MSG_CERTIFICATE_CHAIN.h +++ b/c/include/libsbp/signing/MSG_CERTIFICATE_CHAIN.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_SIGNING_MSG_CERTIFICATE_CHAIN_H #define LIBSBP_SIGNING_MSG_CERTIFICATE_CHAIN_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,48 +41,49 @@ * *****************************************************************************/ typedef struct { - - /** -* SHA-1 fingerprint of the root certificate + * SHA-1 fingerprint of the root certificate */ u8 root_certificate[SBP_MSG_CERTIFICATE_CHAIN_ROOT_CERTIFICATE_MAX]; - /** -* SHA-1 fingerprint of the intermediate certificate + * SHA-1 fingerprint of the intermediate certificate */ - u8 intermediate_certificate[SBP_MSG_CERTIFICATE_CHAIN_INTERMEDIATE_CERTIFICATE_MAX]; + u8 intermediate_certificate + [SBP_MSG_CERTIFICATE_CHAIN_INTERMEDIATE_CERTIFICATE_MAX]; - /** -* SHA-1 fingerprint of the corrections certificate + * SHA-1 fingerprint of the corrections certificate */ - u8 corrections_certificate[SBP_MSG_CERTIFICATE_CHAIN_CORRECTIONS_CERTIFICATE_MAX]; + u8 corrections_certificate + [SBP_MSG_CERTIFICATE_CHAIN_CORRECTIONS_CERTIFICATE_MAX]; - /** - * The time after which the signature given is no longer valid. Implementors should consult a time source (such as GNSS) to check if the current time is later than the expiration time, if the condition is true, signatures in the stream should not be considered valid. + * The time after which the signature given is no longer valid. Implementors + * should consult a time source (such as GNSS) to check if the current time is + * later than the expiration time, if the condition is true, signatures in the + * stream should not be considered valid. */ sbp_utc_time_t expiration; - /** - * Signature (created by the root certificate) over the concatenation of the SBP payload bytes preceding this field. That is, the concatenation of `root_certificate`, `intermediate_certificate`, `corrections_certificate` and `expiration`. This certificate chain (allow list) can also be validated by fetching it from `http(s)://certs.swiftnav.com/chain`. + * Signature (created by the root certificate) over the concatenation of the + * SBP payload bytes preceding this field. That is, the concatenation of + * `root_certificate`, `intermediate_certificate`, `corrections_certificate` + * and `expiration`. This certificate chain (allow list) can also be + * validated by fetching it from `http(s)://certs.swiftnav.com/chain`. */ sbp_ecdsa_signature_t signature; } sbp_msg_certificate_chain_t; - - /** * Get encoded size of an instance of sbp_msg_certificate_chain_t * * @param msg sbp_msg_certificate_chain_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_certificate_chain_encoded_len(const sbp_msg_certificate_chain_t *msg) -{ +static inline size_t sbp_msg_certificate_chain_encoded_len( + const sbp_msg_certificate_chain_t *msg) { (void)msg; return SBP_MSG_CERTIFICATE_CHAIN_ENCODED_LEN; } @@ -90,36 +91,53 @@ static inline size_t sbp_msg_certificate_chain_encoded_len(const sbp_msg_certifi /** * Encode an instance of sbp_msg_certificate_chain_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_certificate_chain_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_certificate_chain_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_certificate_chain_t *msg); +SBP_EXPORT s8 +sbp_msg_certificate_chain_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_certificate_chain_t *msg); /** * Decode an instance of sbp_msg_certificate_chain_t from wire representation * - * This function decodes the wire representation of a sbp_msg_certificate_chain_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_certificate_chain_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_certificate_chain_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_certificate_chain_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_certificate_chain_t *msg); +SBP_EXPORT s8 sbp_msg_certificate_chain_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_certificate_chain_t *msg); /** * Send an instance of sbp_msg_certificate_chain_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_certificate_chain_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_certificate_chain_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -127,51 +145,61 @@ SBP_EXPORT s8 sbp_msg_certificate_chain_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_certificate_chain_send(sbp_state_t *s, u16 sender_id, const sbp_msg_certificate_chain_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_certificate_chain_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_certificate_chain_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_certificate_chain_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_certificate_chain_t instance * @param b sbp_msg_certificate_chain_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_certificate_chain_cmp(const sbp_msg_certificate_chain_t *a, const sbp_msg_certificate_chain_t *b); +SBP_EXPORT int sbp_msg_certificate_chain_cmp( + const sbp_msg_certificate_chain_t *a, const sbp_msg_certificate_chain_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_certificate_chain_t &lhs, const sbp_msg_certificate_chain_t &rhs) { +static inline bool operator==(const sbp_msg_certificate_chain_t &lhs, + const sbp_msg_certificate_chain_t &rhs) { return sbp_msg_certificate_chain_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_certificate_chain_t &lhs, const sbp_msg_certificate_chain_t &rhs) { +static inline bool operator!=(const sbp_msg_certificate_chain_t &lhs, + const sbp_msg_certificate_chain_t &rhs) { return sbp_msg_certificate_chain_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_certificate_chain_t &lhs, const sbp_msg_certificate_chain_t &rhs) { +static inline bool operator<(const sbp_msg_certificate_chain_t &lhs, + const sbp_msg_certificate_chain_t &rhs) { return sbp_msg_certificate_chain_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_certificate_chain_t &lhs, const sbp_msg_certificate_chain_t &rhs) { +static inline bool operator<=(const sbp_msg_certificate_chain_t &lhs, + const sbp_msg_certificate_chain_t &rhs) { return sbp_msg_certificate_chain_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_certificate_chain_t &lhs, const sbp_msg_certificate_chain_t &rhs) { +static inline bool operator>(const sbp_msg_certificate_chain_t &lhs, + const sbp_msg_certificate_chain_t &rhs) { return sbp_msg_certificate_chain_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_certificate_chain_t &lhs, const sbp_msg_certificate_chain_t &rhs) { +static inline bool operator>=(const sbp_msg_certificate_chain_t &lhs, + const sbp_msg_certificate_chain_t &rhs) { return sbp_msg_certificate_chain_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SIGNING_MSG_CERTIFICATE_CHAIN_H */ - diff --git a/c/include/libsbp/signing/MSG_CERTIFICATE_CHAIN_DEP.h b/c/include/libsbp/signing/MSG_CERTIFICATE_CHAIN_DEP.h index d0859e0e0..6dd023f1c 100644 --- a/c/include/libsbp/signing/MSG_CERTIFICATE_CHAIN_DEP.h +++ b/c/include/libsbp/signing/MSG_CERTIFICATE_CHAIN_DEP.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SIGNING_MSG_CERTIFICATE_CHAIN_DEP_H #define LIBSBP_SIGNING_MSG_CERTIFICATE_CHAIN_DEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,51 +41,51 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* SHA-1 fingerprint of the root certificate + * SHA-1 fingerprint of the root certificate */ u8 root_certificate[SBP_MSG_CERTIFICATE_CHAIN_DEP_ROOT_CERTIFICATE_MAX]; - /** -* SHA-1 fingerprint of the intermediate certificate + * SHA-1 fingerprint of the intermediate certificate */ - u8 intermediate_certificate[SBP_MSG_CERTIFICATE_CHAIN_DEP_INTERMEDIATE_CERTIFICATE_MAX]; + u8 intermediate_certificate + [SBP_MSG_CERTIFICATE_CHAIN_DEP_INTERMEDIATE_CERTIFICATE_MAX]; - /** -* SHA-1 fingerprint of the corrections certificate + * SHA-1 fingerprint of the corrections certificate */ - u8 corrections_certificate[SBP_MSG_CERTIFICATE_CHAIN_DEP_CORRECTIONS_CERTIFICATE_MAX]; + u8 corrections_certificate + [SBP_MSG_CERTIFICATE_CHAIN_DEP_CORRECTIONS_CERTIFICATE_MAX]; - /** - * The certificate chain comprised of three fingerprints: root certificate, intermediate certificate and corrections certificate. + * The certificate chain comprised of three fingerprints: root certificate, + * intermediate certificate and corrections certificate. */ sbp_utc_time_t expiration; - /** - * An ECDSA signature (created by the root certificate) over the concatenation of the SBP payload bytes preceding this field. That is, the concatenation of `root_certificate`, `intermediate_certificate`, `corrections_certificate` and `expiration`. This certificate chain (allow list) can also be validated by fetching it from `http(s)://certs.swiftnav.com/chain`. + * An ECDSA signature (created by the root certificate) over the concatenation + * of the SBP payload bytes preceding this field. That is, the concatenation + * of `root_certificate`, `intermediate_certificate`, + * `corrections_certificate` and `expiration`. This certificate chain (allow + * list) can also be validated by fetching it from + * `http(s)://certs.swiftnav.com/chain`. */ u8 signature[SBP_MSG_CERTIFICATE_CHAIN_DEP_SIGNATURE_MAX]; } sbp_msg_certificate_chain_dep_t; - - /** * Get encoded size of an instance of sbp_msg_certificate_chain_dep_t * * @param msg sbp_msg_certificate_chain_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_certificate_chain_dep_encoded_len(const sbp_msg_certificate_chain_dep_t *msg) -{ +static inline size_t sbp_msg_certificate_chain_dep_encoded_len( + const sbp_msg_certificate_chain_dep_t *msg) { (void)msg; return SBP_MSG_CERTIFICATE_CHAIN_DEP_ENCODED_LEN; } @@ -93,36 +93,56 @@ static inline size_t sbp_msg_certificate_chain_dep_encoded_len(const sbp_msg_cer /** * Encode an instance of sbp_msg_certificate_chain_dep_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_certificate_chain_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_certificate_chain_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_certificate_chain_dep_t *msg); +SBP_EXPORT s8 sbp_msg_certificate_chain_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_certificate_chain_dep_t *msg); /** - * Decode an instance of sbp_msg_certificate_chain_dep_t from wire representation + * Decode an instance of sbp_msg_certificate_chain_dep_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_certificate_chain_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_certificate_chain_dep_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_certificate_chain_dep_t instance + * @param buf Wire representation of the sbp_msg_certificate_chain_dep_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_certificate_chain_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_certificate_chain_dep_t *msg); +SBP_EXPORT s8 sbp_msg_certificate_chain_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_certificate_chain_dep_t *msg); /** - * Send an instance of sbp_msg_certificate_chain_dep_t with the given write function + * Send an instance of sbp_msg_certificate_chain_dep_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_certificate_chain_dep_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_certificate_chain_dep_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -130,51 +150,62 @@ SBP_EXPORT s8 sbp_msg_certificate_chain_dep_decode(const uint8_t *buf, uint8_t l * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_certificate_chain_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_certificate_chain_dep_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_certificate_chain_dep_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_certificate_chain_dep_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_certificate_chain_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_certificate_chain_dep_t instance * @param b sbp_msg_certificate_chain_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_certificate_chain_dep_cmp(const sbp_msg_certificate_chain_dep_t *a, const sbp_msg_certificate_chain_dep_t *b); +SBP_EXPORT int sbp_msg_certificate_chain_dep_cmp( + const sbp_msg_certificate_chain_dep_t *a, + const sbp_msg_certificate_chain_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_certificate_chain_dep_t &lhs, const sbp_msg_certificate_chain_dep_t &rhs) { +static inline bool operator==(const sbp_msg_certificate_chain_dep_t &lhs, + const sbp_msg_certificate_chain_dep_t &rhs) { return sbp_msg_certificate_chain_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_certificate_chain_dep_t &lhs, const sbp_msg_certificate_chain_dep_t &rhs) { +static inline bool operator!=(const sbp_msg_certificate_chain_dep_t &lhs, + const sbp_msg_certificate_chain_dep_t &rhs) { return sbp_msg_certificate_chain_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_certificate_chain_dep_t &lhs, const sbp_msg_certificate_chain_dep_t &rhs) { +static inline bool operator<(const sbp_msg_certificate_chain_dep_t &lhs, + const sbp_msg_certificate_chain_dep_t &rhs) { return sbp_msg_certificate_chain_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_certificate_chain_dep_t &lhs, const sbp_msg_certificate_chain_dep_t &rhs) { +static inline bool operator<=(const sbp_msg_certificate_chain_dep_t &lhs, + const sbp_msg_certificate_chain_dep_t &rhs) { return sbp_msg_certificate_chain_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_certificate_chain_dep_t &lhs, const sbp_msg_certificate_chain_dep_t &rhs) { +static inline bool operator>(const sbp_msg_certificate_chain_dep_t &lhs, + const sbp_msg_certificate_chain_dep_t &rhs) { return sbp_msg_certificate_chain_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_certificate_chain_dep_t &lhs, const sbp_msg_certificate_chain_dep_t &rhs) { +static inline bool operator>=(const sbp_msg_certificate_chain_dep_t &lhs, + const sbp_msg_certificate_chain_dep_t &rhs) { return sbp_msg_certificate_chain_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SIGNING_MSG_CERTIFICATE_CHAIN_DEP_H */ - diff --git a/c/include/libsbp/signing/MSG_ECDSA_CERTIFICATE.h b/c/include/libsbp/signing/MSG_ECDSA_CERTIFICATE.h index a07e18df3..7debd254b 100644 --- a/c/include/libsbp/signing/MSG_ECDSA_CERTIFICATE.h +++ b/c/include/libsbp/signing/MSG_ECDSA_CERTIFICATE.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SIGNING_MSG_ECDSA_CERTIFICATE_H #define LIBSBP_SIGNING_MSG_ECDSA_CERTIFICATE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,88 +40,102 @@ *****************************************************************************/ /** An ECDSA certificate split over multiple messages * -* A DER encoded x.509 ECDSA-256 certificate (using curve secp256r1). + * A DER encoded x.509 ECDSA-256 certificate (using curve secp256r1). */ typedef struct { - - /** - * Total number messages that make up the certificate. The first nibble (mask 0xF0 or left shifted by 4 bits) is the size of the sequence (n), second nibble (mask 0x0F) is the zero-indexed counter (ith packet of n). + * Total number messages that make up the certificate. The first nibble (mask + * 0xF0 or left shifted by 4 bits) is the size of the sequence (n), second + * nibble (mask 0x0F) is the zero-indexed counter (ith packet of n). */ u8 n_msg; - /** -* The last 4 bytes of the certificate's SHA-1 fingerprint + * The last 4 bytes of the certificate's SHA-1 fingerprint */ u8 certificate_id[SBP_MSG_ECDSA_CERTIFICATE_CERTIFICATE_ID_MAX]; - u8 flags; - /** -* DER encoded x.509 ECDSA certificate bytes + * DER encoded x.509 ECDSA certificate bytes */ u8 certificate_bytes[SBP_MSG_ECDSA_CERTIFICATE_CERTIFICATE_BYTES_MAX]; /** * Number of elements in certificate_bytes * - * When sending a message fill in this field with the number elements set in certificate_bytes before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * certificate_bytes before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in certificate_bytes. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * certificate_bytes. The value of any elements beyond the index specified in + * this field is undefined */ u8 n_certificate_bytes; } sbp_msg_ecdsa_certificate_t; - - /** * Get encoded size of an instance of sbp_msg_ecdsa_certificate_t * * @param msg sbp_msg_ecdsa_certificate_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ecdsa_certificate_encoded_len(const sbp_msg_ecdsa_certificate_t *msg) -{ - return SBP_MSG_ECDSA_CERTIFICATE_ENCODED_OVERHEAD - + (msg->n_certificate_bytes * SBP_ENCODED_LEN_U8) - ; +static inline size_t sbp_msg_ecdsa_certificate_encoded_len( + const sbp_msg_ecdsa_certificate_t *msg) { + return SBP_MSG_ECDSA_CERTIFICATE_ENCODED_OVERHEAD + + (msg->n_certificate_bytes * SBP_ENCODED_LEN_U8); } /** * Encode an instance of sbp_msg_ecdsa_certificate_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ecdsa_certificate_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ecdsa_certificate_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ecdsa_certificate_t *msg); +SBP_EXPORT s8 +sbp_msg_ecdsa_certificate_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ecdsa_certificate_t *msg); /** * Decode an instance of sbp_msg_ecdsa_certificate_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ecdsa_certificate_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ecdsa_certificate_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ecdsa_certificate_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ecdsa_certificate_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ecdsa_certificate_t *msg); +SBP_EXPORT s8 sbp_msg_ecdsa_certificate_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ecdsa_certificate_t *msg); /** * Send an instance of sbp_msg_ecdsa_certificate_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ecdsa_certificate_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ecdsa_certificate_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -129,51 +143,61 @@ SBP_EXPORT s8 sbp_msg_ecdsa_certificate_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ecdsa_certificate_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_certificate_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ecdsa_certificate_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_certificate_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ecdsa_certificate_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ecdsa_certificate_t instance * @param b sbp_msg_ecdsa_certificate_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ecdsa_certificate_cmp(const sbp_msg_ecdsa_certificate_t *a, const sbp_msg_ecdsa_certificate_t *b); +SBP_EXPORT int sbp_msg_ecdsa_certificate_cmp( + const sbp_msg_ecdsa_certificate_t *a, const sbp_msg_ecdsa_certificate_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ecdsa_certificate_t &lhs, const sbp_msg_ecdsa_certificate_t &rhs) { +static inline bool operator==(const sbp_msg_ecdsa_certificate_t &lhs, + const sbp_msg_ecdsa_certificate_t &rhs) { return sbp_msg_ecdsa_certificate_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ecdsa_certificate_t &lhs, const sbp_msg_ecdsa_certificate_t &rhs) { +static inline bool operator!=(const sbp_msg_ecdsa_certificate_t &lhs, + const sbp_msg_ecdsa_certificate_t &rhs) { return sbp_msg_ecdsa_certificate_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ecdsa_certificate_t &lhs, const sbp_msg_ecdsa_certificate_t &rhs) { +static inline bool operator<(const sbp_msg_ecdsa_certificate_t &lhs, + const sbp_msg_ecdsa_certificate_t &rhs) { return sbp_msg_ecdsa_certificate_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ecdsa_certificate_t &lhs, const sbp_msg_ecdsa_certificate_t &rhs) { +static inline bool operator<=(const sbp_msg_ecdsa_certificate_t &lhs, + const sbp_msg_ecdsa_certificate_t &rhs) { return sbp_msg_ecdsa_certificate_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ecdsa_certificate_t &lhs, const sbp_msg_ecdsa_certificate_t &rhs) { +static inline bool operator>(const sbp_msg_ecdsa_certificate_t &lhs, + const sbp_msg_ecdsa_certificate_t &rhs) { return sbp_msg_ecdsa_certificate_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ecdsa_certificate_t &lhs, const sbp_msg_ecdsa_certificate_t &rhs) { +static inline bool operator>=(const sbp_msg_ecdsa_certificate_t &lhs, + const sbp_msg_ecdsa_certificate_t &rhs) { return sbp_msg_ecdsa_certificate_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SIGNING_MSG_ECDSA_CERTIFICATE_H */ - diff --git a/c/include/libsbp/signing/MSG_ECDSA_SIGNATURE.h b/c/include/libsbp/signing/MSG_ECDSA_SIGNATURE.h index d80098523..dfc5096c9 100644 --- a/c/include/libsbp/signing/MSG_ECDSA_SIGNATURE.h +++ b/c/include/libsbp/signing/MSG_ECDSA_SIGNATURE.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SIGNING_MSG_ECDSA_SIGNATURE_H #define LIBSBP_SIGNING_MSG_ECDSA_SIGNATURE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,103 +41,123 @@ *****************************************************************************/ /** An ECDSA signature * -* An ECDSA-256 signature using SHA-256 as the message digest algorithm. + * An ECDSA-256 signature using SHA-256 as the message digest algorithm. */ typedef struct { - - /** -* Describes the format of the `signed\_messages` field below. + * Describes the format of the `signed\_messages` field below. */ u8 flags; - /** - * Signature message counter. Zero indexed and incremented with each signature message. The counter will not increment if this message was in response to an on demand request. The counter will roll over after 256 messages. Upon connection, the value of the counter may not initially be zero. + * Signature message counter. Zero indexed and incremented with each signature + * message. The counter will not increment if this message was in response to + * an on demand request. The counter will roll over after 256 messages. Upon + * connection, the value of the counter may not initially be zero. */ u8 stream_counter; - /** - * On demand message counter. Zero indexed and incremented with each signature message sent in response to an on demand message. The counter will roll over after 256 messages. Upon connection, the value of the counter may not initially be zero. + * On demand message counter. Zero indexed and incremented with each signature + * message sent in response to an on demand message. The counter will roll + * over after 256 messages. Upon connection, the value of the counter may not + * initially be zero. */ u8 on_demand_counter; - /** -* The last 4 bytes of the certificate's SHA-1 fingerprint + * The last 4 bytes of the certificate's SHA-1 fingerprint */ u8 certificate_id[SBP_MSG_ECDSA_SIGNATURE_CERTIFICATE_ID_MAX]; - /** - * Signature over the frames of this message group. + * Signature over the frames of this message group. */ sbp_ecdsa_signature_t signature; - /** - * CRCs of the messages covered by this signature. For Skylark, which delivers SBP messages wrapped in Swift's proprietary RTCM message, these are the 24-bit CRCs from the RTCM message framing. For SBP only streams, this will be 16-bit CRCs from the SBP framing. See the `flags` field to determine the type of CRCs covered. + * CRCs of the messages covered by this signature. For Skylark, which + * delivers SBP messages wrapped in Swift's proprietary RTCM message, these + * are the 24-bit CRCs from the RTCM message framing. For SBP only streams, + * this will be 16-bit CRCs from the SBP framing. See the `flags` field to + * determine the type of CRCs covered. */ u8 signed_messages[SBP_MSG_ECDSA_SIGNATURE_SIGNED_MESSAGES_MAX]; /** * Number of elements in signed_messages * - * When sending a message fill in this field with the number elements set in signed_messages before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * signed_messages before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in signed_messages. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * signed_messages. The value of any elements beyond the index specified in + * this field is undefined */ u8 n_signed_messages; } sbp_msg_ecdsa_signature_t; - - /** * Get encoded size of an instance of sbp_msg_ecdsa_signature_t * * @param msg sbp_msg_ecdsa_signature_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ecdsa_signature_encoded_len(const sbp_msg_ecdsa_signature_t *msg) -{ - return SBP_MSG_ECDSA_SIGNATURE_ENCODED_OVERHEAD - + (msg->n_signed_messages * SBP_ENCODED_LEN_U8) - ; +static inline size_t sbp_msg_ecdsa_signature_encoded_len( + const sbp_msg_ecdsa_signature_t *msg) { + return SBP_MSG_ECDSA_SIGNATURE_ENCODED_OVERHEAD + + (msg->n_signed_messages * SBP_ENCODED_LEN_U8); } /** * Encode an instance of sbp_msg_ecdsa_signature_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ecdsa_signature_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ecdsa_signature_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ecdsa_signature_t *msg); +SBP_EXPORT s8 +sbp_msg_ecdsa_signature_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ecdsa_signature_t *msg); /** * Decode an instance of sbp_msg_ecdsa_signature_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ecdsa_signature_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ecdsa_signature_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ecdsa_signature_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ecdsa_signature_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ecdsa_signature_t *msg); +SBP_EXPORT s8 sbp_msg_ecdsa_signature_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ecdsa_signature_t *msg); /** * Send an instance of sbp_msg_ecdsa_signature_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ecdsa_signature_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ecdsa_signature_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -145,51 +165,61 @@ SBP_EXPORT s8 sbp_msg_ecdsa_signature_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ecdsa_signature_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_signature_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ecdsa_signature_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ecdsa_signature_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ecdsa_signature_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ecdsa_signature_t instance * @param b sbp_msg_ecdsa_signature_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ecdsa_signature_cmp(const sbp_msg_ecdsa_signature_t *a, const sbp_msg_ecdsa_signature_t *b); +SBP_EXPORT int sbp_msg_ecdsa_signature_cmp(const sbp_msg_ecdsa_signature_t *a, + const sbp_msg_ecdsa_signature_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ecdsa_signature_t &lhs, const sbp_msg_ecdsa_signature_t &rhs) { +static inline bool operator==(const sbp_msg_ecdsa_signature_t &lhs, + const sbp_msg_ecdsa_signature_t &rhs) { return sbp_msg_ecdsa_signature_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ecdsa_signature_t &lhs, const sbp_msg_ecdsa_signature_t &rhs) { +static inline bool operator!=(const sbp_msg_ecdsa_signature_t &lhs, + const sbp_msg_ecdsa_signature_t &rhs) { return sbp_msg_ecdsa_signature_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ecdsa_signature_t &lhs, const sbp_msg_ecdsa_signature_t &rhs) { +static inline bool operator<(const sbp_msg_ecdsa_signature_t &lhs, + const sbp_msg_ecdsa_signature_t &rhs) { return sbp_msg_ecdsa_signature_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ecdsa_signature_t &lhs, const sbp_msg_ecdsa_signature_t &rhs) { +static inline bool operator<=(const sbp_msg_ecdsa_signature_t &lhs, + const sbp_msg_ecdsa_signature_t &rhs) { return sbp_msg_ecdsa_signature_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ecdsa_signature_t &lhs, const sbp_msg_ecdsa_signature_t &rhs) { +static inline bool operator>(const sbp_msg_ecdsa_signature_t &lhs, + const sbp_msg_ecdsa_signature_t &rhs) { return sbp_msg_ecdsa_signature_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ecdsa_signature_t &lhs, const sbp_msg_ecdsa_signature_t &rhs) { +static inline bool operator>=(const sbp_msg_ecdsa_signature_t &lhs, + const sbp_msg_ecdsa_signature_t &rhs) { return sbp_msg_ecdsa_signature_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SIGNING_MSG_ECDSA_SIGNATURE_H */ - diff --git a/c/include/libsbp/signing/MSG_ECDSA_SIGNATURE_DEP_A.h b/c/include/libsbp/signing/MSG_ECDSA_SIGNATURE_DEP_A.h index 563c1c166..1d78304ea 100644 --- a/c/include/libsbp/signing/MSG_ECDSA_SIGNATURE_DEP_A.h +++ b/c/include/libsbp/signing/MSG_ECDSA_SIGNATURE_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SIGNING_MSG_ECDSA_SIGNATURE_DEP_A_H #define LIBSBP_SIGNING_MSG_ECDSA_SIGNATURE_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,103 +40,126 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Describes the format of the `signed\_messages` field below. + * Describes the format of the `signed\_messages` field below. */ u8 flags; - /** - * Signature message counter. Zero indexed and incremented with each signature message. The counter will not increment if this message was in response to an on demand request. The counter will roll over after 256 messages. Upon connection, the value of the counter may not initially be zero. + * Signature message counter. Zero indexed and incremented with each signature + * message. The counter will not increment if this message was in response to + * an on demand request. The counter will roll over after 256 messages. Upon + * connection, the value of the counter may not initially be zero. */ u8 stream_counter; - /** - * On demand message counter. Zero indexed and incremented with each signature message sent in response to an on demand message. The counter will roll over after 256 messages. Upon connection, the value of the counter may not initially be zero. + * On demand message counter. Zero indexed and incremented with each signature + * message sent in response to an on demand message. The counter will roll + * over after 256 messages. Upon connection, the value of the counter may not + * initially be zero. */ u8 on_demand_counter; - /** -* The last 4 bytes of the certificate's SHA-1 fingerprint + * The last 4 bytes of the certificate's SHA-1 fingerprint */ u8 certificate_id[SBP_MSG_ECDSA_SIGNATURE_DEP_A_CERTIFICATE_ID_MAX]; - /** - * ECDSA signature for the messages using SHA-256 as the digest algorithm. + * ECDSA signature for the messages using SHA-256 as the digest algorithm. */ u8 signature[SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNATURE_MAX]; - /** - * CRCs of the messages covered by this signature. For Skylark, which delivers SBP messages wrapped in Swift's proprietary RTCM message, these are the 24-bit CRCs from the RTCM message framing. For SBP only streams, this will be 16-bit CRCs from the SBP framing. See the `flags` field to determine the type of CRCs covered. + * CRCs of the messages covered by this signature. For Skylark, which + * delivers SBP messages wrapped in Swift's proprietary RTCM message, these + * are the 24-bit CRCs from the RTCM message framing. For SBP only streams, + * this will be 16-bit CRCs from the SBP framing. See the `flags` field to + * determine the type of CRCs covered. */ u8 signed_messages[SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNED_MESSAGES_MAX]; /** * Number of elements in signed_messages * - * When sending a message fill in this field with the number elements set in signed_messages before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * signed_messages before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in signed_messages. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * signed_messages. The value of any elements beyond the index specified in + * this field is undefined */ u8 n_signed_messages; } sbp_msg_ecdsa_signature_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_ecdsa_signature_dep_a_t * * @param msg sbp_msg_ecdsa_signature_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ecdsa_signature_dep_a_encoded_len(const sbp_msg_ecdsa_signature_dep_a_t *msg) -{ - return SBP_MSG_ECDSA_SIGNATURE_DEP_A_ENCODED_OVERHEAD - + (msg->n_signed_messages * SBP_ENCODED_LEN_U8) - ; +static inline size_t sbp_msg_ecdsa_signature_dep_a_encoded_len( + const sbp_msg_ecdsa_signature_dep_a_t *msg) { + return SBP_MSG_ECDSA_SIGNATURE_DEP_A_ENCODED_OVERHEAD + + (msg->n_signed_messages * SBP_ENCODED_LEN_U8); } /** * Encode an instance of sbp_msg_ecdsa_signature_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ecdsa_signature_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ecdsa_signature_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ecdsa_signature_dep_a_t *msg); /** - * Decode an instance of sbp_msg_ecdsa_signature_dep_a_t from wire representation + * Decode an instance of sbp_msg_ecdsa_signature_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ecdsa_signature_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ecdsa_signature_dep_a_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ecdsa_signature_dep_a_t instance + * @param buf Wire representation of the sbp_msg_ecdsa_signature_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ecdsa_signature_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ecdsa_signature_dep_a_t *msg); /** - * Send an instance of sbp_msg_ecdsa_signature_dep_a_t with the given write function + * Send an instance of sbp_msg_ecdsa_signature_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ecdsa_signature_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ecdsa_signature_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -144,51 +167,62 @@ SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_a_decode(const uint8_t *buf, uint8_t l * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_signature_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_signature_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ecdsa_signature_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ecdsa_signature_dep_a_t instance * @param b sbp_msg_ecdsa_signature_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ecdsa_signature_dep_a_cmp(const sbp_msg_ecdsa_signature_dep_a_t *a, const sbp_msg_ecdsa_signature_dep_a_t *b); +SBP_EXPORT int sbp_msg_ecdsa_signature_dep_a_cmp( + const sbp_msg_ecdsa_signature_dep_a_t *a, + const sbp_msg_ecdsa_signature_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ecdsa_signature_dep_a_t &lhs, const sbp_msg_ecdsa_signature_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_ecdsa_signature_dep_a_t &lhs, + const sbp_msg_ecdsa_signature_dep_a_t &rhs) { return sbp_msg_ecdsa_signature_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ecdsa_signature_dep_a_t &lhs, const sbp_msg_ecdsa_signature_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_ecdsa_signature_dep_a_t &lhs, + const sbp_msg_ecdsa_signature_dep_a_t &rhs) { return sbp_msg_ecdsa_signature_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ecdsa_signature_dep_a_t &lhs, const sbp_msg_ecdsa_signature_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_ecdsa_signature_dep_a_t &lhs, + const sbp_msg_ecdsa_signature_dep_a_t &rhs) { return sbp_msg_ecdsa_signature_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ecdsa_signature_dep_a_t &lhs, const sbp_msg_ecdsa_signature_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_ecdsa_signature_dep_a_t &lhs, + const sbp_msg_ecdsa_signature_dep_a_t &rhs) { return sbp_msg_ecdsa_signature_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ecdsa_signature_dep_a_t &lhs, const sbp_msg_ecdsa_signature_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_ecdsa_signature_dep_a_t &lhs, + const sbp_msg_ecdsa_signature_dep_a_t &rhs) { return sbp_msg_ecdsa_signature_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ecdsa_signature_dep_a_t &lhs, const sbp_msg_ecdsa_signature_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_ecdsa_signature_dep_a_t &lhs, + const sbp_msg_ecdsa_signature_dep_a_t &rhs) { return sbp_msg_ecdsa_signature_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SIGNING_MSG_ECDSA_SIGNATURE_DEP_A_H */ - diff --git a/c/include/libsbp/signing/MSG_ECDSA_SIGNATURE_DEP_B.h b/c/include/libsbp/signing/MSG_ECDSA_SIGNATURE_DEP_B.h index 8d640996f..4ea41a209 100644 --- a/c/include/libsbp/signing/MSG_ECDSA_SIGNATURE_DEP_B.h +++ b/c/include/libsbp/signing/MSG_ECDSA_SIGNATURE_DEP_B.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SIGNING_MSG_ECDSA_SIGNATURE_DEP_B_H #define LIBSBP_SIGNING_MSG_ECDSA_SIGNATURE_DEP_B_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,109 +40,134 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Describes the format of the `signed\_messages` field below. + * Describes the format of the `signed\_messages` field below. */ u8 flags; - /** - * Signature message counter. Zero indexed and incremented with each signature message. The counter will not increment if this message was in response to an on demand request. The counter will roll over after 256 messages. Upon connection, the value of the counter may not initially be zero. + * Signature message counter. Zero indexed and incremented with each signature + * message. The counter will not increment if this message was in response to + * an on demand request. The counter will roll over after 256 messages. Upon + * connection, the value of the counter may not initially be zero. */ u8 stream_counter; - /** - * On demand message counter. Zero indexed and incremented with each signature message sent in response to an on demand message. The counter will roll over after 256 messages. Upon connection, the value of the counter may not initially be zero. + * On demand message counter. Zero indexed and incremented with each signature + * message sent in response to an on demand message. The counter will roll + * over after 256 messages. Upon connection, the value of the counter may not + * initially be zero. */ u8 on_demand_counter; - /** -* The last 4 bytes of the certificate's SHA-1 fingerprint + * The last 4 bytes of the certificate's SHA-1 fingerprint */ u8 certificate_id[SBP_MSG_ECDSA_SIGNATURE_DEP_B_CERTIFICATE_ID_MAX]; - /** - * Number of bytes to use of the signature field. The DER encoded signature has a maximum size of 72 bytes but can vary between 70 and 72 bytes in length. + * Number of bytes to use of the signature field. The DER encoded signature + * has a maximum size of 72 bytes but can vary between 70 and 72 bytes in + * length. */ u8 n_signature_bytes; - /** - * DER encoded ECDSA signature for the messages using SHA-256 as the digest algorithm. + * DER encoded ECDSA signature for the messages using SHA-256 as the digest + * algorithm. */ u8 signature[SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNATURE_MAX]; - /** - * CRCs of the messages covered by this signature. For Skylark, which delivers SBP messages wrapped in Swift's proprietary RTCM message, these are the 24-bit CRCs from the RTCM message framing. For SBP only streams, this will be 16-bit CRCs from the SBP framing. See the `flags` field to determine the type of CRCs covered. + * CRCs of the messages covered by this signature. For Skylark, which + * delivers SBP messages wrapped in Swift's proprietary RTCM message, these + * are the 24-bit CRCs from the RTCM message framing. For SBP only streams, + * this will be 16-bit CRCs from the SBP framing. See the `flags` field to + * determine the type of CRCs covered. */ u8 signed_messages[SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNED_MESSAGES_MAX]; /** * Number of elements in signed_messages * - * When sending a message fill in this field with the number elements set in signed_messages before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * signed_messages before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in signed_messages. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * signed_messages. The value of any elements beyond the index specified in + * this field is undefined */ u8 n_signed_messages; } sbp_msg_ecdsa_signature_dep_b_t; - - /** * Get encoded size of an instance of sbp_msg_ecdsa_signature_dep_b_t * * @param msg sbp_msg_ecdsa_signature_dep_b_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ecdsa_signature_dep_b_encoded_len(const sbp_msg_ecdsa_signature_dep_b_t *msg) -{ - return SBP_MSG_ECDSA_SIGNATURE_DEP_B_ENCODED_OVERHEAD - + (msg->n_signed_messages * SBP_ENCODED_LEN_U8) - ; +static inline size_t sbp_msg_ecdsa_signature_dep_b_encoded_len( + const sbp_msg_ecdsa_signature_dep_b_t *msg) { + return SBP_MSG_ECDSA_SIGNATURE_DEP_B_ENCODED_OVERHEAD + + (msg->n_signed_messages * SBP_ENCODED_LEN_U8); } /** * Encode an instance of sbp_msg_ecdsa_signature_dep_b_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ecdsa_signature_dep_b_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ecdsa_signature_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ecdsa_signature_dep_b_t *msg); /** - * Decode an instance of sbp_msg_ecdsa_signature_dep_b_t from wire representation + * Decode an instance of sbp_msg_ecdsa_signature_dep_b_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ecdsa_signature_dep_b_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ecdsa_signature_dep_b_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ecdsa_signature_dep_b_t instance + * @param buf Wire representation of the sbp_msg_ecdsa_signature_dep_b_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ecdsa_signature_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ecdsa_signature_dep_b_t *msg); /** - * Send an instance of sbp_msg_ecdsa_signature_dep_b_t with the given write function + * Send an instance of sbp_msg_ecdsa_signature_dep_b_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ecdsa_signature_dep_b_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ecdsa_signature_dep_b_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -150,51 +175,62 @@ SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_b_decode(const uint8_t *buf, uint8_t l * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_signature_dep_b_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_b_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_signature_dep_b_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ecdsa_signature_dep_b_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ecdsa_signature_dep_b_t instance * @param b sbp_msg_ecdsa_signature_dep_b_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ecdsa_signature_dep_b_cmp(const sbp_msg_ecdsa_signature_dep_b_t *a, const sbp_msg_ecdsa_signature_dep_b_t *b); +SBP_EXPORT int sbp_msg_ecdsa_signature_dep_b_cmp( + const sbp_msg_ecdsa_signature_dep_b_t *a, + const sbp_msg_ecdsa_signature_dep_b_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ecdsa_signature_dep_b_t &lhs, const sbp_msg_ecdsa_signature_dep_b_t &rhs) { +static inline bool operator==(const sbp_msg_ecdsa_signature_dep_b_t &lhs, + const sbp_msg_ecdsa_signature_dep_b_t &rhs) { return sbp_msg_ecdsa_signature_dep_b_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ecdsa_signature_dep_b_t &lhs, const sbp_msg_ecdsa_signature_dep_b_t &rhs) { +static inline bool operator!=(const sbp_msg_ecdsa_signature_dep_b_t &lhs, + const sbp_msg_ecdsa_signature_dep_b_t &rhs) { return sbp_msg_ecdsa_signature_dep_b_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ecdsa_signature_dep_b_t &lhs, const sbp_msg_ecdsa_signature_dep_b_t &rhs) { +static inline bool operator<(const sbp_msg_ecdsa_signature_dep_b_t &lhs, + const sbp_msg_ecdsa_signature_dep_b_t &rhs) { return sbp_msg_ecdsa_signature_dep_b_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ecdsa_signature_dep_b_t &lhs, const sbp_msg_ecdsa_signature_dep_b_t &rhs) { +static inline bool operator<=(const sbp_msg_ecdsa_signature_dep_b_t &lhs, + const sbp_msg_ecdsa_signature_dep_b_t &rhs) { return sbp_msg_ecdsa_signature_dep_b_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ecdsa_signature_dep_b_t &lhs, const sbp_msg_ecdsa_signature_dep_b_t &rhs) { +static inline bool operator>(const sbp_msg_ecdsa_signature_dep_b_t &lhs, + const sbp_msg_ecdsa_signature_dep_b_t &rhs) { return sbp_msg_ecdsa_signature_dep_b_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ecdsa_signature_dep_b_t &lhs, const sbp_msg_ecdsa_signature_dep_b_t &rhs) { +static inline bool operator>=(const sbp_msg_ecdsa_signature_dep_b_t &lhs, + const sbp_msg_ecdsa_signature_dep_b_t &rhs) { return sbp_msg_ecdsa_signature_dep_b_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SIGNING_MSG_ECDSA_SIGNATURE_DEP_B_H */ - diff --git a/c/include/libsbp/signing/MSG_ED25519_CERTIFICATE_DEP.h b/c/include/libsbp/signing/MSG_ED25519_CERTIFICATE_DEP.h index f53b4f033..3c4f0f78b 100644 --- a/c/include/libsbp/signing/MSG_ED25519_CERTIFICATE_DEP.h +++ b/c/include/libsbp/signing/MSG_ED25519_CERTIFICATE_DEP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SIGNING_MSG_ED25519_CERTIFICATE_DEP_H #define LIBSBP_SIGNING_MSG_ED25519_CERTIFICATE_DEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,85 +40,104 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** - * Total number messages that make up the certificate. First nibble is the size of the sequence (n), second nibble is the zero-indexed counter (ith packet of n) + * Total number messages that make up the certificate. First nibble is the + * size of the sequence (n), second nibble is the zero-indexed counter (ith + * packet of n) */ u8 n_msg; - /** -* SHA-1 fingerprint of the associated certificate. + * SHA-1 fingerprint of the associated certificate. */ u8 fingerprint[SBP_MSG_ED25519_CERTIFICATE_DEP_FINGERPRINT_MAX]; - /** -* ED25519 certificate bytes. + * ED25519 certificate bytes. */ u8 certificate_bytes[SBP_MSG_ED25519_CERTIFICATE_DEP_CERTIFICATE_BYTES_MAX]; /** * Number of elements in certificate_bytes * - * When sending a message fill in this field with the number elements set in certificate_bytes before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * certificate_bytes before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in certificate_bytes. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * certificate_bytes. The value of any elements beyond the index specified in + * this field is undefined */ u8 n_certificate_bytes; } sbp_msg_ed25519_certificate_dep_t; - - /** * Get encoded size of an instance of sbp_msg_ed25519_certificate_dep_t * * @param msg sbp_msg_ed25519_certificate_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ed25519_certificate_dep_encoded_len(const sbp_msg_ed25519_certificate_dep_t *msg) -{ - return SBP_MSG_ED25519_CERTIFICATE_DEP_ENCODED_OVERHEAD - + (msg->n_certificate_bytes * SBP_ENCODED_LEN_U8) - ; +static inline size_t sbp_msg_ed25519_certificate_dep_encoded_len( + const sbp_msg_ed25519_certificate_dep_t *msg) { + return SBP_MSG_ED25519_CERTIFICATE_DEP_ENCODED_OVERHEAD + + (msg->n_certificate_bytes * SBP_ENCODED_LEN_U8); } /** - * Encode an instance of sbp_msg_ed25519_certificate_dep_t to wire representation + * Encode an instance of sbp_msg_ed25519_certificate_dep_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ed25519_certificate_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ed25519_certificate_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ed25519_certificate_dep_t *msg); +SBP_EXPORT s8 sbp_msg_ed25519_certificate_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ed25519_certificate_dep_t *msg); /** - * Decode an instance of sbp_msg_ed25519_certificate_dep_t from wire representation + * Decode an instance of sbp_msg_ed25519_certificate_dep_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ed25519_certificate_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ed25519_certificate_dep_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ed25519_certificate_dep_t instance + * @param buf Wire representation of the sbp_msg_ed25519_certificate_dep_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ed25519_certificate_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ed25519_certificate_dep_t *msg); +SBP_EXPORT s8 sbp_msg_ed25519_certificate_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ed25519_certificate_dep_t *msg); /** - * Send an instance of sbp_msg_ed25519_certificate_dep_t with the given write function + * Send an instance of sbp_msg_ed25519_certificate_dep_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ed25519_certificate_dep_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ed25519_certificate_dep_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -126,51 +145,62 @@ SBP_EXPORT s8 sbp_msg_ed25519_certificate_dep_decode(const uint8_t *buf, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ed25519_certificate_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ed25519_certificate_dep_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ed25519_certificate_dep_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ed25519_certificate_dep_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ed25519_certificate_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ed25519_certificate_dep_t instance * @param b sbp_msg_ed25519_certificate_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ed25519_certificate_dep_cmp(const sbp_msg_ed25519_certificate_dep_t *a, const sbp_msg_ed25519_certificate_dep_t *b); +SBP_EXPORT int sbp_msg_ed25519_certificate_dep_cmp( + const sbp_msg_ed25519_certificate_dep_t *a, + const sbp_msg_ed25519_certificate_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ed25519_certificate_dep_t &lhs, const sbp_msg_ed25519_certificate_dep_t &rhs) { +static inline bool operator==(const sbp_msg_ed25519_certificate_dep_t &lhs, + const sbp_msg_ed25519_certificate_dep_t &rhs) { return sbp_msg_ed25519_certificate_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ed25519_certificate_dep_t &lhs, const sbp_msg_ed25519_certificate_dep_t &rhs) { +static inline bool operator!=(const sbp_msg_ed25519_certificate_dep_t &lhs, + const sbp_msg_ed25519_certificate_dep_t &rhs) { return sbp_msg_ed25519_certificate_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ed25519_certificate_dep_t &lhs, const sbp_msg_ed25519_certificate_dep_t &rhs) { +static inline bool operator<(const sbp_msg_ed25519_certificate_dep_t &lhs, + const sbp_msg_ed25519_certificate_dep_t &rhs) { return sbp_msg_ed25519_certificate_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ed25519_certificate_dep_t &lhs, const sbp_msg_ed25519_certificate_dep_t &rhs) { +static inline bool operator<=(const sbp_msg_ed25519_certificate_dep_t &lhs, + const sbp_msg_ed25519_certificate_dep_t &rhs) { return sbp_msg_ed25519_certificate_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ed25519_certificate_dep_t &lhs, const sbp_msg_ed25519_certificate_dep_t &rhs) { +static inline bool operator>(const sbp_msg_ed25519_certificate_dep_t &lhs, + const sbp_msg_ed25519_certificate_dep_t &rhs) { return sbp_msg_ed25519_certificate_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ed25519_certificate_dep_t &lhs, const sbp_msg_ed25519_certificate_dep_t &rhs) { +static inline bool operator>=(const sbp_msg_ed25519_certificate_dep_t &lhs, + const sbp_msg_ed25519_certificate_dep_t &rhs) { return sbp_msg_ed25519_certificate_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SIGNING_MSG_ED25519_CERTIFICATE_DEP_H */ - diff --git a/c/include/libsbp/signing/MSG_ED25519_SIGNATURE_DEP_A.h b/c/include/libsbp/signing/MSG_ED25519_SIGNATURE_DEP_A.h index f81bb6e4c..30c9f22ce 100644 --- a/c/include/libsbp/signing/MSG_ED25519_SIGNATURE_DEP_A.h +++ b/c/include/libsbp/signing/MSG_ED25519_SIGNATURE_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SIGNING_MSG_ED25519_SIGNATURE_DEP_A_H #define LIBSBP_SIGNING_MSG_ED25519_SIGNATURE_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,85 +40,102 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* ED25519 signature for messages. + * ED25519 signature for messages. */ u8 signature[SBP_MSG_ED25519_SIGNATURE_DEP_A_SIGNATURE_MAX]; - /** -* SHA-1 fingerprint of the associated certificate. + * SHA-1 fingerprint of the associated certificate. */ u8 fingerprint[SBP_MSG_ED25519_SIGNATURE_DEP_A_FINGERPRINT_MAX]; - /** -* CRCs of signed messages. + * CRCs of signed messages. */ u32 signed_messages[SBP_MSG_ED25519_SIGNATURE_DEP_A_SIGNED_MESSAGES_MAX]; /** * Number of elements in signed_messages * - * When sending a message fill in this field with the number elements set in signed_messages before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * signed_messages before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in signed_messages. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * signed_messages. The value of any elements beyond the index specified in + * this field is undefined */ u8 n_signed_messages; } sbp_msg_ed25519_signature_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_ed25519_signature_dep_a_t * * @param msg sbp_msg_ed25519_signature_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ed25519_signature_dep_a_encoded_len(const sbp_msg_ed25519_signature_dep_a_t *msg) -{ - return SBP_MSG_ED25519_SIGNATURE_DEP_A_ENCODED_OVERHEAD - + (msg->n_signed_messages * SBP_ENCODED_LEN_U32) - ; +static inline size_t sbp_msg_ed25519_signature_dep_a_encoded_len( + const sbp_msg_ed25519_signature_dep_a_t *msg) { + return SBP_MSG_ED25519_SIGNATURE_DEP_A_ENCODED_OVERHEAD + + (msg->n_signed_messages * SBP_ENCODED_LEN_U32); } /** - * Encode an instance of sbp_msg_ed25519_signature_dep_a_t to wire representation + * Encode an instance of sbp_msg_ed25519_signature_dep_a_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ed25519_signature_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ed25519_signature_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ed25519_signature_dep_a_t *msg); /** - * Decode an instance of sbp_msg_ed25519_signature_dep_a_t from wire representation + * Decode an instance of sbp_msg_ed25519_signature_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ed25519_signature_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ed25519_signature_dep_a_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ed25519_signature_dep_a_t instance + * @param buf Wire representation of the sbp_msg_ed25519_signature_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ed25519_signature_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ed25519_signature_dep_a_t *msg); /** - * Send an instance of sbp_msg_ed25519_signature_dep_a_t with the given write function + * Send an instance of sbp_msg_ed25519_signature_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ed25519_signature_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ed25519_signature_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -126,51 +143,62 @@ SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_a_decode(const uint8_t *buf, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ed25519_signature_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ed25519_signature_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ed25519_signature_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ed25519_signature_dep_a_t instance * @param b sbp_msg_ed25519_signature_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ed25519_signature_dep_a_cmp(const sbp_msg_ed25519_signature_dep_a_t *a, const sbp_msg_ed25519_signature_dep_a_t *b); +SBP_EXPORT int sbp_msg_ed25519_signature_dep_a_cmp( + const sbp_msg_ed25519_signature_dep_a_t *a, + const sbp_msg_ed25519_signature_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ed25519_signature_dep_a_t &lhs, const sbp_msg_ed25519_signature_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_ed25519_signature_dep_a_t &lhs, + const sbp_msg_ed25519_signature_dep_a_t &rhs) { return sbp_msg_ed25519_signature_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ed25519_signature_dep_a_t &lhs, const sbp_msg_ed25519_signature_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_ed25519_signature_dep_a_t &lhs, + const sbp_msg_ed25519_signature_dep_a_t &rhs) { return sbp_msg_ed25519_signature_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ed25519_signature_dep_a_t &lhs, const sbp_msg_ed25519_signature_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_ed25519_signature_dep_a_t &lhs, + const sbp_msg_ed25519_signature_dep_a_t &rhs) { return sbp_msg_ed25519_signature_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ed25519_signature_dep_a_t &lhs, const sbp_msg_ed25519_signature_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_ed25519_signature_dep_a_t &lhs, + const sbp_msg_ed25519_signature_dep_a_t &rhs) { return sbp_msg_ed25519_signature_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ed25519_signature_dep_a_t &lhs, const sbp_msg_ed25519_signature_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_ed25519_signature_dep_a_t &lhs, + const sbp_msg_ed25519_signature_dep_a_t &rhs) { return sbp_msg_ed25519_signature_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ed25519_signature_dep_a_t &lhs, const sbp_msg_ed25519_signature_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_ed25519_signature_dep_a_t &lhs, + const sbp_msg_ed25519_signature_dep_a_t &rhs) { return sbp_msg_ed25519_signature_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SIGNING_MSG_ED25519_SIGNATURE_DEP_A_H */ - diff --git a/c/include/libsbp/signing/MSG_ED25519_SIGNATURE_DEP_B.h b/c/include/libsbp/signing/MSG_ED25519_SIGNATURE_DEP_B.h index 88cff8ab5..664823e25 100644 --- a/c/include/libsbp/signing/MSG_ED25519_SIGNATURE_DEP_B.h +++ b/c/include/libsbp/signing/MSG_ED25519_SIGNATURE_DEP_B.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SIGNING_MSG_ED25519_SIGNATURE_DEP_B_H #define LIBSBP_SIGNING_MSG_ED25519_SIGNATURE_DEP_B_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,97 +40,118 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** - * Signature message counter. Zero indexed and incremented with each signature message. The counter will not increment if this message was in response to an on demand request. The counter will roll over after 256 messages. Upon connection, the value of the counter may not initially be zero. + * Signature message counter. Zero indexed and incremented with each signature + * message. The counter will not increment if this message was in response to + * an on demand request. The counter will roll over after 256 messages. Upon + * connection, the value of the counter may not initially be zero. */ u8 stream_counter; - /** - * On demand message counter. Zero indexed and incremented with each signature message sent in response to an on demand message. The counter will roll over after 256 messages. Upon connection, the value of the counter may not initially be zero. + * On demand message counter. Zero indexed and incremented with each signature + * message sent in response to an on demand message. The counter will roll + * over after 256 messages. Upon connection, the value of the counter may not + * initially be zero. */ u8 on_demand_counter; - /** -* ED25519 signature for messages. + * ED25519 signature for messages. */ u8 signature[SBP_MSG_ED25519_SIGNATURE_DEP_B_SIGNATURE_MAX]; - /** -* SHA-1 fingerprint of the associated certificate. + * SHA-1 fingerprint of the associated certificate. */ u8 fingerprint[SBP_MSG_ED25519_SIGNATURE_DEP_B_FINGERPRINT_MAX]; - /** -* CRCs of signed messages. + * CRCs of signed messages. */ u32 signed_messages[SBP_MSG_ED25519_SIGNATURE_DEP_B_SIGNED_MESSAGES_MAX]; /** * Number of elements in signed_messages * - * When sending a message fill in this field with the number elements set in signed_messages before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * signed_messages before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in signed_messages. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * signed_messages. The value of any elements beyond the index specified in + * this field is undefined */ u8 n_signed_messages; } sbp_msg_ed25519_signature_dep_b_t; - - /** * Get encoded size of an instance of sbp_msg_ed25519_signature_dep_b_t * * @param msg sbp_msg_ed25519_signature_dep_b_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ed25519_signature_dep_b_encoded_len(const sbp_msg_ed25519_signature_dep_b_t *msg) -{ - return SBP_MSG_ED25519_SIGNATURE_DEP_B_ENCODED_OVERHEAD - + (msg->n_signed_messages * SBP_ENCODED_LEN_U32) - ; +static inline size_t sbp_msg_ed25519_signature_dep_b_encoded_len( + const sbp_msg_ed25519_signature_dep_b_t *msg) { + return SBP_MSG_ED25519_SIGNATURE_DEP_B_ENCODED_OVERHEAD + + (msg->n_signed_messages * SBP_ENCODED_LEN_U32); } /** - * Encode an instance of sbp_msg_ed25519_signature_dep_b_t to wire representation + * Encode an instance of sbp_msg_ed25519_signature_dep_b_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ed25519_signature_dep_b_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ed25519_signature_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ed25519_signature_dep_b_t *msg); /** - * Decode an instance of sbp_msg_ed25519_signature_dep_b_t from wire representation + * Decode an instance of sbp_msg_ed25519_signature_dep_b_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ed25519_signature_dep_b_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ed25519_signature_dep_b_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ed25519_signature_dep_b_t instance + * @param buf Wire representation of the sbp_msg_ed25519_signature_dep_b_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ed25519_signature_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ed25519_signature_dep_b_t *msg); /** - * Send an instance of sbp_msg_ed25519_signature_dep_b_t with the given write function + * Send an instance of sbp_msg_ed25519_signature_dep_b_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ed25519_signature_dep_b_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ed25519_signature_dep_b_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -138,51 +159,62 @@ SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_b_decode(const uint8_t *buf, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ed25519_signature_dep_b_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_b_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ed25519_signature_dep_b_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ed25519_signature_dep_b_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ed25519_signature_dep_b_t instance * @param b sbp_msg_ed25519_signature_dep_b_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ed25519_signature_dep_b_cmp(const sbp_msg_ed25519_signature_dep_b_t *a, const sbp_msg_ed25519_signature_dep_b_t *b); +SBP_EXPORT int sbp_msg_ed25519_signature_dep_b_cmp( + const sbp_msg_ed25519_signature_dep_b_t *a, + const sbp_msg_ed25519_signature_dep_b_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ed25519_signature_dep_b_t &lhs, const sbp_msg_ed25519_signature_dep_b_t &rhs) { +static inline bool operator==(const sbp_msg_ed25519_signature_dep_b_t &lhs, + const sbp_msg_ed25519_signature_dep_b_t &rhs) { return sbp_msg_ed25519_signature_dep_b_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ed25519_signature_dep_b_t &lhs, const sbp_msg_ed25519_signature_dep_b_t &rhs) { +static inline bool operator!=(const sbp_msg_ed25519_signature_dep_b_t &lhs, + const sbp_msg_ed25519_signature_dep_b_t &rhs) { return sbp_msg_ed25519_signature_dep_b_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ed25519_signature_dep_b_t &lhs, const sbp_msg_ed25519_signature_dep_b_t &rhs) { +static inline bool operator<(const sbp_msg_ed25519_signature_dep_b_t &lhs, + const sbp_msg_ed25519_signature_dep_b_t &rhs) { return sbp_msg_ed25519_signature_dep_b_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ed25519_signature_dep_b_t &lhs, const sbp_msg_ed25519_signature_dep_b_t &rhs) { +static inline bool operator<=(const sbp_msg_ed25519_signature_dep_b_t &lhs, + const sbp_msg_ed25519_signature_dep_b_t &rhs) { return sbp_msg_ed25519_signature_dep_b_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ed25519_signature_dep_b_t &lhs, const sbp_msg_ed25519_signature_dep_b_t &rhs) { +static inline bool operator>(const sbp_msg_ed25519_signature_dep_b_t &lhs, + const sbp_msg_ed25519_signature_dep_b_t &rhs) { return sbp_msg_ed25519_signature_dep_b_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ed25519_signature_dep_b_t &lhs, const sbp_msg_ed25519_signature_dep_b_t &rhs) { +static inline bool operator>=(const sbp_msg_ed25519_signature_dep_b_t &lhs, + const sbp_msg_ed25519_signature_dep_b_t &rhs) { return sbp_msg_ed25519_signature_dep_b_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SIGNING_MSG_ED25519_SIGNATURE_DEP_B_H */ - diff --git a/c/include/libsbp/signing/UtcTime.h b/c/include/libsbp/signing/UtcTime.h index 4e87db782..f01fc3653 100644 --- a/c/include/libsbp/signing/UtcTime.h +++ b/c/include/libsbp/signing/UtcTime.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SIGNING_UTCTIME_H #define LIBSBP_SIGNING_UTCTIME_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -39,60 +39,49 @@ * *****************************************************************************/ typedef struct { - - /** -* Year [year] + * Year [year] */ u16 year; - /** -* Month (range 1 .. 12) [months] + * Month (range 1 .. 12) [months] */ u8 month; - /** -* days in the month (range 1-31) [day] + * days in the month (range 1-31) [day] */ u8 day; - /** -* hours of day (range 0-23) [hours] + * hours of day (range 0-23) [hours] */ u8 hours; - /** -* minutes of hour (range 0-59) [minutes] + * minutes of hour (range 0-59) [minutes] */ u8 minutes; - /** -* seconds of minute (range 0-60) rounded down [seconds] + * seconds of minute (range 0-60) rounded down [seconds] */ u8 seconds; - /** -* nanoseconds of second (range 0-999999999) [nanoseconds] + * nanoseconds of second (range 0-999999999) [nanoseconds] */ u32 ns; } sbp_utc_time_t; - - /** * Get encoded size of an instance of sbp_utc_time_t * * @param msg sbp_utc_time_t instance * @return Length of on-wire representation */ -static inline size_t sbp_utc_time_encoded_len(const sbp_utc_time_t *msg) -{ +static inline size_t sbp_utc_time_encoded_len(const sbp_utc_time_t *msg) { (void)msg; return SBP_UTC_TIME_ENCODED_LEN; } @@ -100,74 +89,94 @@ static inline size_t sbp_utc_time_encoded_len(const sbp_utc_time_t *msg) /** * Encode an instance of sbp_utc_time_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_utc_time_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_utc_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_utc_time_t *msg); +SBP_EXPORT s8 sbp_utc_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_utc_time_t *msg); /** * Decode an instance of sbp_utc_time_t from wire representation * - * This function decodes the wire representation of a sbp_utc_time_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_utc_time_t message to + * the given instance. The caller must specify the length of the buffer in the + * \p len parameter. If non-null the number of bytes read from the buffer will + * be returned in \p n_read. * * @param buf Wire representation of the sbp_utc_time_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_utc_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_utc_time_t *msg); +SBP_EXPORT s8 sbp_utc_time_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_utc_time_t *msg); /** * Compare two instances of sbp_utc_time_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_utc_time_t instance * @param b sbp_utc_time_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_utc_time_cmp(const sbp_utc_time_t *a, const sbp_utc_time_t *b); +SBP_EXPORT int sbp_utc_time_cmp(const sbp_utc_time_t *a, + const sbp_utc_time_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_utc_time_t &lhs, const sbp_utc_time_t &rhs) { +static inline bool operator==(const sbp_utc_time_t &lhs, + const sbp_utc_time_t &rhs) { return sbp_utc_time_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_utc_time_t &lhs, const sbp_utc_time_t &rhs) { +static inline bool operator!=(const sbp_utc_time_t &lhs, + const sbp_utc_time_t &rhs) { return sbp_utc_time_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_utc_time_t &lhs, const sbp_utc_time_t &rhs) { +static inline bool operator<(const sbp_utc_time_t &lhs, + const sbp_utc_time_t &rhs) { return sbp_utc_time_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_utc_time_t &lhs, const sbp_utc_time_t &rhs) { +static inline bool operator<=(const sbp_utc_time_t &lhs, + const sbp_utc_time_t &rhs) { return sbp_utc_time_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_utc_time_t &lhs, const sbp_utc_time_t &rhs) { +static inline bool operator>(const sbp_utc_time_t &lhs, + const sbp_utc_time_t &rhs) { return sbp_utc_time_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_utc_time_t &lhs, const sbp_utc_time_t &rhs) { +static inline bool operator>=(const sbp_utc_time_t &lhs, + const sbp_utc_time_t &rhs) { return sbp_utc_time_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SIGNING_UTCTIME_H */ - diff --git a/c/include/libsbp/signing_macros.h b/c/include/libsbp/signing_macros.h index e01d3ac0f..9362724c3 100644 --- a/c/include/libsbp/signing_macros.h +++ b/c/include/libsbp/signing_macros.h @@ -18,364 +18,413 @@ #ifndef LIBSBP_SIGNING_MACROS_H #define LIBSBP_SIGNING_MACROS_H - /** - * Encoded length of sbp_utc_time_t (V4 API) and + * Encoded length of sbp_utc_time_t (V4 API) and * utc_time_t (legacy API) */ #define SBP_UTC_TIME_ENCODED_LEN 11u - /** - * The maximum number of items that can be stored in sbp_ecdsa_signature_t::data (V4 API) or ecdsa_signature_t::data (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in sbp_ecdsa_signature_t::data + * (V4 API) or ecdsa_signature_t::data (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_ECDSA_SIGNATURE_DATA_MAX 72u - /** - * Encoded length of sbp_ecdsa_signature_t (V4 API) and + * Encoded length of sbp_ecdsa_signature_t (V4 API) and * ecdsa_signature_t (legacy API) */ #define SBP_ECDSA_SIGNATURE_ENCODED_LEN 73u - #define SBP_MSG_ECDSA_CERTIFICATE 0x0C04 /** - * The maximum number of items that can be stored in sbp_msg_ecdsa_certificate_t::certificate_id (V4 API) or msg_ecdsa_certificate_t::certificate_id (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ecdsa_certificate_t::certificate_id (V4 API) or + * msg_ecdsa_certificate_t::certificate_id (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_ECDSA_CERTIFICATE_CERTIFICATE_ID_MAX 4u - #define SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_MASK (0x7u) #define SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_SHIFT (0u) -#define SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_SHIFT) \ - & SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_MASK)) -#define SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_MASK << SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_SHIFT))) | \ - (((val) & (SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_MASK)) \ - << (SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_SHIFT)));} while(0) - +#define SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_SHIFT) & \ + SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_MASK)) +#define SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_MASK \ + << SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_SHIFT))) | \ + (((val) & (SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_MASK)) \ + << (SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_SHIFT))); \ + } while (0) #define SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_CORRECTIONS_CERTIFICATE (0) #define SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_ROOT_CERTIFICATE (1) #define SBP_ECDSA_CERTIFICATE_CERTIFICATE_TYPE_INTERMEDIATE_CERTIFICATE (2) /** - * The maximum number of items that can be stored in sbp_msg_ecdsa_certificate_t::certificate_bytes (V4 API) or msg_ecdsa_certificate_t::certificate_bytes (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ecdsa_certificate_t::certificate_bytes (V4 API) or + * msg_ecdsa_certificate_t::certificate_bytes (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_ECDSA_CERTIFICATE_CERTIFICATE_BYTES_MAX 249u - /** - * Encoded length of sbp_msg_ecdsa_certificate_t (V4 API) and + * Encoded length of sbp_msg_ecdsa_certificate_t (V4 API) and * msg_ecdsa_certificate_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ecdsa_certificate_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ecdsa_certificate_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_ECDSA_CERTIFICATE_ENCODED_OVERHEAD 6u - #define SBP_MSG_CERTIFICATE_CHAIN 0x0C09 /** - * The maximum number of items that can be stored in sbp_msg_certificate_chain_t::root_certificate (V4 API) or msg_certificate_chain_t::root_certificate (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_certificate_chain_t::root_certificate (V4 API) or + * msg_certificate_chain_t::root_certificate (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_CERTIFICATE_CHAIN_ROOT_CERTIFICATE_MAX 20u - /** - * The maximum number of items that can be stored in sbp_msg_certificate_chain_t::intermediate_certificate (V4 API) or msg_certificate_chain_t::intermediate_certificate (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_certificate_chain_t::intermediate_certificate (V4 API) or + * msg_certificate_chain_t::intermediate_certificate (legacy API) before the + * maximum SBP message size is exceeded */ #define SBP_MSG_CERTIFICATE_CHAIN_INTERMEDIATE_CERTIFICATE_MAX 20u - /** - * The maximum number of items that can be stored in sbp_msg_certificate_chain_t::corrections_certificate (V4 API) or msg_certificate_chain_t::corrections_certificate (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_certificate_chain_t::corrections_certificate (V4 API) or + * msg_certificate_chain_t::corrections_certificate (legacy API) before the + * maximum SBP message size is exceeded */ #define SBP_MSG_CERTIFICATE_CHAIN_CORRECTIONS_CERTIFICATE_MAX 20u - /** - * Encoded length of sbp_msg_certificate_chain_t (V4 API) and + * Encoded length of sbp_msg_certificate_chain_t (V4 API) and * msg_certificate_chain_t (legacy API) */ #define SBP_MSG_CERTIFICATE_CHAIN_ENCODED_LEN 144u - #define SBP_MSG_CERTIFICATE_CHAIN_DEP 0x0C05 /** - * The maximum number of items that can be stored in sbp_msg_certificate_chain_dep_t::root_certificate (V4 API) or msg_certificate_chain_dep_t::root_certificate (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_certificate_chain_dep_t::root_certificate (V4 API) or + * msg_certificate_chain_dep_t::root_certificate (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_CERTIFICATE_CHAIN_DEP_ROOT_CERTIFICATE_MAX 20u - /** - * The maximum number of items that can be stored in sbp_msg_certificate_chain_dep_t::intermediate_certificate (V4 API) or msg_certificate_chain_dep_t::intermediate_certificate (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_certificate_chain_dep_t::intermediate_certificate (V4 API) or + * msg_certificate_chain_dep_t::intermediate_certificate (legacy API) before the + * maximum SBP message size is exceeded */ #define SBP_MSG_CERTIFICATE_CHAIN_DEP_INTERMEDIATE_CERTIFICATE_MAX 20u - /** - * The maximum number of items that can be stored in sbp_msg_certificate_chain_dep_t::corrections_certificate (V4 API) or msg_certificate_chain_dep_t::corrections_certificate (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_certificate_chain_dep_t::corrections_certificate (V4 API) or + * msg_certificate_chain_dep_t::corrections_certificate (legacy API) before the + * maximum SBP message size is exceeded */ #define SBP_MSG_CERTIFICATE_CHAIN_DEP_CORRECTIONS_CERTIFICATE_MAX 20u - /** - * The maximum number of items that can be stored in sbp_msg_certificate_chain_dep_t::signature (V4 API) or msg_certificate_chain_dep_t::signature (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_certificate_chain_dep_t::signature (V4 API) or + * msg_certificate_chain_dep_t::signature (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_CERTIFICATE_CHAIN_DEP_SIGNATURE_MAX 64u - /** - * Encoded length of sbp_msg_certificate_chain_dep_t (V4 API) and + * Encoded length of sbp_msg_certificate_chain_dep_t (V4 API) and * msg_certificate_chain_dep_t (legacy API) */ #define SBP_MSG_CERTIFICATE_CHAIN_DEP_ENCODED_LEN 135u - #define SBP_MSG_ECDSA_SIGNATURE 0x0C08 #define SBP_ECDSA_SIGNATURE_CRC_TYPE_MASK (0x3u) #define SBP_ECDSA_SIGNATURE_CRC_TYPE_SHIFT (0u) -#define SBP_ECDSA_SIGNATURE_CRC_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_ECDSA_SIGNATURE_CRC_TYPE_SHIFT) \ - & SBP_ECDSA_SIGNATURE_CRC_TYPE_MASK)) -#define SBP_ECDSA_SIGNATURE_CRC_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_ECDSA_SIGNATURE_CRC_TYPE_MASK << SBP_ECDSA_SIGNATURE_CRC_TYPE_SHIFT))) | \ - (((val) & (SBP_ECDSA_SIGNATURE_CRC_TYPE_MASK)) \ - << (SBP_ECDSA_SIGNATURE_CRC_TYPE_SHIFT)));} while(0) - +#define SBP_ECDSA_SIGNATURE_CRC_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ECDSA_SIGNATURE_CRC_TYPE_SHIFT) & \ + SBP_ECDSA_SIGNATURE_CRC_TYPE_MASK)) +#define SBP_ECDSA_SIGNATURE_CRC_TYPE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_ECDSA_SIGNATURE_CRC_TYPE_MASK \ + << SBP_ECDSA_SIGNATURE_CRC_TYPE_SHIFT))) | \ + (((val) & (SBP_ECDSA_SIGNATURE_CRC_TYPE_MASK)) \ + << (SBP_ECDSA_SIGNATURE_CRC_TYPE_SHIFT))); \ + } while (0) #define SBP_ECDSA_SIGNATURE_CRC_TYPE_24_BIT_CRCS_FROM_RTCM_FRAMING (0) #define SBP_ECDSA_SIGNATURE_CRC_TYPE_16_BIT_CRCS_FROM_SBP_FRAMING (1) /** - * The maximum number of items that can be stored in sbp_msg_ecdsa_signature_t::certificate_id (V4 API) or msg_ecdsa_signature_t::certificate_id (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ecdsa_signature_t::certificate_id (V4 API) or + * msg_ecdsa_signature_t::certificate_id (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_ECDSA_SIGNATURE_CERTIFICATE_ID_MAX 4u - /** - * The maximum number of items that can be stored in sbp_msg_ecdsa_signature_t::signed_messages (V4 API) or msg_ecdsa_signature_t::signed_messages (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ecdsa_signature_t::signed_messages (V4 API) or + * msg_ecdsa_signature_t::signed_messages (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_ECDSA_SIGNATURE_SIGNED_MESSAGES_MAX 175u - /** - * Encoded length of sbp_msg_ecdsa_signature_t (V4 API) and + * Encoded length of sbp_msg_ecdsa_signature_t (V4 API) and * msg_ecdsa_signature_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ecdsa_signature_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ecdsa_signature_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_ECDSA_SIGNATURE_ENCODED_OVERHEAD 80u - #define SBP_MSG_ECDSA_SIGNATURE_DEP_B 0x0C07 #define SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_MASK (0x3u) #define SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_SHIFT (0u) -#define SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_SHIFT) \ - & SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_MASK)) -#define SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_MASK << SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_SHIFT))) | \ - (((val) & (SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_MASK)) \ - << (SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_SHIFT)));} while(0) - +#define SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_SHIFT) & \ + SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_MASK)) +#define SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_MASK \ + << SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_SHIFT))) | \ + (((val) & (SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_MASK)) \ + << (SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_SHIFT))); \ + } while (0) #define SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_24_BIT_CRCS_FROM_RTCM_FRAMING (0) #define SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_16_BIT_CRCS_FROM_SBP_FRAMING (1) /** - * The maximum number of items that can be stored in sbp_msg_ecdsa_signature_dep_b_t::certificate_id (V4 API) or msg_ecdsa_signature_dep_b_t::certificate_id (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ecdsa_signature_dep_b_t::certificate_id (V4 API) or + * msg_ecdsa_signature_dep_b_t::certificate_id (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_ECDSA_SIGNATURE_DEP_B_CERTIFICATE_ID_MAX 4u - /** - * The maximum number of items that can be stored in sbp_msg_ecdsa_signature_dep_b_t::signature (V4 API) or msg_ecdsa_signature_dep_b_t::signature (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ecdsa_signature_dep_b_t::signature (V4 API) or + * msg_ecdsa_signature_dep_b_t::signature (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNATURE_MAX 72u - /** - * The maximum number of items that can be stored in sbp_msg_ecdsa_signature_dep_b_t::signed_messages (V4 API) or msg_ecdsa_signature_dep_b_t::signed_messages (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ecdsa_signature_dep_b_t::signed_messages (V4 API) or + * msg_ecdsa_signature_dep_b_t::signed_messages (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNED_MESSAGES_MAX 175u - /** - * Encoded length of sbp_msg_ecdsa_signature_dep_b_t (V4 API) and + * Encoded length of sbp_msg_ecdsa_signature_dep_b_t (V4 API) and * msg_ecdsa_signature_dep_b_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ecdsa_signature_dep_b_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ecdsa_signature_dep_b_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_ECDSA_SIGNATURE_DEP_B_ENCODED_OVERHEAD 80u - #define SBP_MSG_ECDSA_SIGNATURE_DEP_A 0x0C06 #define SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_MASK (0x3u) #define SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_SHIFT (0u) -#define SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_SHIFT) \ - & SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_MASK)) -#define SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_MASK << SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_SHIFT))) | \ - (((val) & (SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_MASK)) \ - << (SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_SHIFT)));} while(0) - +#define SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_SHIFT) & \ + SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_MASK)) +#define SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_MASK \ + << SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_SHIFT))) | \ + (((val) & (SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_MASK)) \ + << (SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_SHIFT))); \ + } while (0) #define SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_24_BIT_CRCS_FROM_RTCM_FRAMING (0) #define SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_16_BIT_CRCS_FROM_SBP_FRAMING (1) /** - * The maximum number of items that can be stored in sbp_msg_ecdsa_signature_dep_a_t::certificate_id (V4 API) or msg_ecdsa_signature_dep_a_t::certificate_id (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ecdsa_signature_dep_a_t::certificate_id (V4 API) or + * msg_ecdsa_signature_dep_a_t::certificate_id (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_ECDSA_SIGNATURE_DEP_A_CERTIFICATE_ID_MAX 4u - /** - * The maximum number of items that can be stored in sbp_msg_ecdsa_signature_dep_a_t::signature (V4 API) or msg_ecdsa_signature_dep_a_t::signature (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ecdsa_signature_dep_a_t::signature (V4 API) or + * msg_ecdsa_signature_dep_a_t::signature (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNATURE_MAX 64u - /** - * The maximum number of items that can be stored in sbp_msg_ecdsa_signature_dep_a_t::signed_messages (V4 API) or msg_ecdsa_signature_dep_a_t::signed_messages (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ecdsa_signature_dep_a_t::signed_messages (V4 API) or + * msg_ecdsa_signature_dep_a_t::signed_messages (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNED_MESSAGES_MAX 184u - /** - * Encoded length of sbp_msg_ecdsa_signature_dep_a_t (V4 API) and + * Encoded length of sbp_msg_ecdsa_signature_dep_a_t (V4 API) and * msg_ecdsa_signature_dep_a_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ecdsa_signature_dep_a_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ecdsa_signature_dep_a_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_ECDSA_SIGNATURE_DEP_A_ENCODED_OVERHEAD 71u - #define SBP_MSG_ED25519_CERTIFICATE_DEP 0x0C02 /** - * The maximum number of items that can be stored in sbp_msg_ed25519_certificate_dep_t::fingerprint (V4 API) or msg_ed25519_certificate_dep_t::fingerprint (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ed25519_certificate_dep_t::fingerprint (V4 API) or + * msg_ed25519_certificate_dep_t::fingerprint (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_ED25519_CERTIFICATE_DEP_FINGERPRINT_MAX 20u - /** - * The maximum number of items that can be stored in sbp_msg_ed25519_certificate_dep_t::certificate_bytes (V4 API) or msg_ed25519_certificate_dep_t::certificate_bytes (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ed25519_certificate_dep_t::certificate_bytes (V4 API) or + * msg_ed25519_certificate_dep_t::certificate_bytes (legacy API) before the + * maximum SBP message size is exceeded */ #define SBP_MSG_ED25519_CERTIFICATE_DEP_CERTIFICATE_BYTES_MAX 234u - /** - * Encoded length of sbp_msg_ed25519_certificate_dep_t (V4 API) and + * Encoded length of sbp_msg_ed25519_certificate_dep_t (V4 API) and * msg_ed25519_certificate_dep_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ed25519_certificate_dep_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ed25519_certificate_dep_encoded_len to determine the actual size of + * an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_ED25519_CERTIFICATE_DEP_ENCODED_OVERHEAD 21u - #define SBP_MSG_ED25519_SIGNATURE_DEP_A 0x0C01 /** - * The maximum number of items that can be stored in sbp_msg_ed25519_signature_dep_a_t::signature (V4 API) or msg_ed25519_signature_dep_a_t::signature (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ed25519_signature_dep_a_t::signature (V4 API) or + * msg_ed25519_signature_dep_a_t::signature (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_ED25519_SIGNATURE_DEP_A_SIGNATURE_MAX 64u - /** - * The maximum number of items that can be stored in sbp_msg_ed25519_signature_dep_a_t::fingerprint (V4 API) or msg_ed25519_signature_dep_a_t::fingerprint (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ed25519_signature_dep_a_t::fingerprint (V4 API) or + * msg_ed25519_signature_dep_a_t::fingerprint (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_ED25519_SIGNATURE_DEP_A_FINGERPRINT_MAX 20u - /** - * The maximum number of items that can be stored in sbp_msg_ed25519_signature_dep_a_t::signed_messages (V4 API) or msg_ed25519_signature_dep_a_t::signed_messages (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ed25519_signature_dep_a_t::signed_messages (V4 API) or + * msg_ed25519_signature_dep_a_t::signed_messages (legacy API) before the + * maximum SBP message size is exceeded */ #define SBP_MSG_ED25519_SIGNATURE_DEP_A_SIGNED_MESSAGES_MAX 42u - /** - * Encoded length of sbp_msg_ed25519_signature_dep_a_t (V4 API) and + * Encoded length of sbp_msg_ed25519_signature_dep_a_t (V4 API) and * msg_ed25519_signature_dep_a_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ed25519_signature_dep_a_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ed25519_signature_dep_a_encoded_len to determine the actual size of + * an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_ED25519_SIGNATURE_DEP_A_ENCODED_OVERHEAD 84u - #define SBP_MSG_ED25519_SIGNATURE_DEP_B 0x0C03 /** - * The maximum number of items that can be stored in sbp_msg_ed25519_signature_dep_b_t::signature (V4 API) or msg_ed25519_signature_dep_b_t::signature (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ed25519_signature_dep_b_t::signature (V4 API) or + * msg_ed25519_signature_dep_b_t::signature (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_ED25519_SIGNATURE_DEP_B_SIGNATURE_MAX 64u - /** - * The maximum number of items that can be stored in sbp_msg_ed25519_signature_dep_b_t::fingerprint (V4 API) or msg_ed25519_signature_dep_b_t::fingerprint (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ed25519_signature_dep_b_t::fingerprint (V4 API) or + * msg_ed25519_signature_dep_b_t::fingerprint (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_ED25519_SIGNATURE_DEP_B_FINGERPRINT_MAX 20u - /** - * The maximum number of items that can be stored in sbp_msg_ed25519_signature_dep_b_t::signed_messages (V4 API) or msg_ed25519_signature_dep_b_t::signed_messages (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ed25519_signature_dep_b_t::signed_messages (V4 API) or + * msg_ed25519_signature_dep_b_t::signed_messages (legacy API) before the + * maximum SBP message size is exceeded */ #define SBP_MSG_ED25519_SIGNATURE_DEP_B_SIGNED_MESSAGES_MAX 42u - /** - * Encoded length of sbp_msg_ed25519_signature_dep_b_t (V4 API) and + * Encoded length of sbp_msg_ed25519_signature_dep_b_t (V4 API) and * msg_ed25519_signature_dep_b_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ed25519_signature_dep_b_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ed25519_signature_dep_b_encoded_len to determine the actual size of + * an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_ED25519_SIGNATURE_DEP_B_ENCODED_OVERHEAD 86u - - #endif /* LIBSBP_SIGNING_MACROS_H */ diff --git a/c/include/libsbp/solution_meta.h b/c/include/libsbp/solution_meta.h index 9745c9922..a4feb5af7 100644 --- a/c/include/libsbp/solution_meta.h +++ b/c/include/libsbp/solution_meta.h @@ -17,11 +17,11 @@ #ifndef LIBSBP_SOLUTION_META_MESSAGES_H #define LIBSBP_SOLUTION_META_MESSAGES_H -#include -#include -#include #include #include +#include +#include #include +#include #endif /* LIBSBP_SOLUTION_META_MESSAGES_H */ diff --git a/c/include/libsbp/solution_meta/GNSSInputType.h b/c/include/libsbp/solution_meta/GNSSInputType.h index 97309655a..1f2ce83b9 100644 --- a/c/include/libsbp/solution_meta/GNSSInputType.h +++ b/c/include/libsbp/solution_meta/GNSSInputType.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SOLUTION_META_GNSSINPUTTYPE_H #define LIBSBP_SOLUTION_META_GNSSINPUTTYPE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,27 +40,24 @@ *****************************************************************************/ /** Instruments the physical type of GNSS sensor input to the fuzed solution * -* Metadata around the GNSS sensors involved in the fuzed solution. Accessible through sol_in[N].flags in a MSG_SOLN_META. + * Metadata around the GNSS sensors involved in the fuzed solution. Accessible + * through sol_in[N].flags in a MSG_SOLN_META. */ typedef struct { - - /** -* flags that store all relevant info specific to this sensor type. + * flags that store all relevant info specific to this sensor type. */ u8 flags; } sbp_gnss_input_type_t; - - /** * Get encoded size of an instance of sbp_gnss_input_type_t * * @param msg sbp_gnss_input_type_t instance * @return Length of on-wire representation */ -static inline size_t sbp_gnss_input_type_encoded_len(const sbp_gnss_input_type_t *msg) -{ +static inline size_t sbp_gnss_input_type_encoded_len( + const sbp_gnss_input_type_t *msg) { (void)msg; return SBP_GNSS_INPUT_TYPE_ENCODED_LEN; } @@ -68,74 +65,96 @@ static inline size_t sbp_gnss_input_type_encoded_len(const sbp_gnss_input_type_t /** * Encode an instance of sbp_gnss_input_type_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_gnss_input_type_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_gnss_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_gnss_input_type_t *msg); +SBP_EXPORT s8 sbp_gnss_input_type_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_gnss_input_type_t *msg); /** * Decode an instance of sbp_gnss_input_type_t from wire representation * - * This function decodes the wire representation of a sbp_gnss_input_type_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_gnss_input_type_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_gnss_input_type_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_gnss_input_type_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_gnss_input_type_t *msg); +SBP_EXPORT s8 sbp_gnss_input_type_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_gnss_input_type_t *msg); /** * Compare two instances of sbp_gnss_input_type_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_gnss_input_type_t instance * @param b sbp_gnss_input_type_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_gnss_input_type_cmp(const sbp_gnss_input_type_t *a, const sbp_gnss_input_type_t *b); +SBP_EXPORT int sbp_gnss_input_type_cmp(const sbp_gnss_input_type_t *a, + const sbp_gnss_input_type_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_gnss_input_type_t &lhs, const sbp_gnss_input_type_t &rhs) { +static inline bool operator==(const sbp_gnss_input_type_t &lhs, + const sbp_gnss_input_type_t &rhs) { return sbp_gnss_input_type_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_gnss_input_type_t &lhs, const sbp_gnss_input_type_t &rhs) { +static inline bool operator!=(const sbp_gnss_input_type_t &lhs, + const sbp_gnss_input_type_t &rhs) { return sbp_gnss_input_type_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_gnss_input_type_t &lhs, const sbp_gnss_input_type_t &rhs) { +static inline bool operator<(const sbp_gnss_input_type_t &lhs, + const sbp_gnss_input_type_t &rhs) { return sbp_gnss_input_type_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_gnss_input_type_t &lhs, const sbp_gnss_input_type_t &rhs) { +static inline bool operator<=(const sbp_gnss_input_type_t &lhs, + const sbp_gnss_input_type_t &rhs) { return sbp_gnss_input_type_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_gnss_input_type_t &lhs, const sbp_gnss_input_type_t &rhs) { +static inline bool operator>(const sbp_gnss_input_type_t &lhs, + const sbp_gnss_input_type_t &rhs) { return sbp_gnss_input_type_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_gnss_input_type_t &lhs, const sbp_gnss_input_type_t &rhs) { +static inline bool operator>=(const sbp_gnss_input_type_t &lhs, + const sbp_gnss_input_type_t &rhs) { return sbp_gnss_input_type_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SOLUTION_META_GNSSINPUTTYPE_H */ - diff --git a/c/include/libsbp/solution_meta/IMUInputType.h b/c/include/libsbp/solution_meta/IMUInputType.h index 4c7c16457..216cec620 100644 --- a/c/include/libsbp/solution_meta/IMUInputType.h +++ b/c/include/libsbp/solution_meta/IMUInputType.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SOLUTION_META_IMUINPUTTYPE_H #define LIBSBP_SOLUTION_META_IMUINPUTTYPE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -38,30 +38,28 @@ * SBP_IMUINPUTTYPE * *****************************************************************************/ -/** Provides detail about the IMU sensor, its timestamping mode, and its quality for input to the fuzed solution +/** Provides detail about the IMU sensor, its timestamping mode, and its quality +for input to the fuzed solution * -* Metadata around the IMU sensors involved in the fuzed solution. Accessible through sol_in[N].flags in a MSG_SOLN_META. +* Metadata around the IMU sensors involved in the fuzed solution. Accessible +through sol_in[N].flags in a MSG_SOLN_META. */ typedef struct { - - /** -* Instrument time, grade, and architecture for a sensor. + * Instrument time, grade, and architecture for a sensor. */ u8 flags; } sbp_imu_input_type_t; - - /** * Get encoded size of an instance of sbp_imu_input_type_t * * @param msg sbp_imu_input_type_t instance * @return Length of on-wire representation */ -static inline size_t sbp_imu_input_type_encoded_len(const sbp_imu_input_type_t *msg) -{ +static inline size_t sbp_imu_input_type_encoded_len( + const sbp_imu_input_type_t *msg) { (void)msg; return SBP_IMU_INPUT_TYPE_ENCODED_LEN; } @@ -69,74 +67,96 @@ static inline size_t sbp_imu_input_type_encoded_len(const sbp_imu_input_type_t * /** * Encode an instance of sbp_imu_input_type_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_imu_input_type_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_imu_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_imu_input_type_t *msg); +SBP_EXPORT s8 sbp_imu_input_type_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_imu_input_type_t *msg); /** * Decode an instance of sbp_imu_input_type_t from wire representation * - * This function decodes the wire representation of a sbp_imu_input_type_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_imu_input_type_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_imu_input_type_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_imu_input_type_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_imu_input_type_t *msg); +SBP_EXPORT s8 sbp_imu_input_type_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_imu_input_type_t *msg); /** * Compare two instances of sbp_imu_input_type_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_imu_input_type_t instance * @param b sbp_imu_input_type_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_imu_input_type_cmp(const sbp_imu_input_type_t *a, const sbp_imu_input_type_t *b); +SBP_EXPORT int sbp_imu_input_type_cmp(const sbp_imu_input_type_t *a, + const sbp_imu_input_type_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_imu_input_type_t &lhs, const sbp_imu_input_type_t &rhs) { +static inline bool operator==(const sbp_imu_input_type_t &lhs, + const sbp_imu_input_type_t &rhs) { return sbp_imu_input_type_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_imu_input_type_t &lhs, const sbp_imu_input_type_t &rhs) { +static inline bool operator!=(const sbp_imu_input_type_t &lhs, + const sbp_imu_input_type_t &rhs) { return sbp_imu_input_type_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_imu_input_type_t &lhs, const sbp_imu_input_type_t &rhs) { +static inline bool operator<(const sbp_imu_input_type_t &lhs, + const sbp_imu_input_type_t &rhs) { return sbp_imu_input_type_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_imu_input_type_t &lhs, const sbp_imu_input_type_t &rhs) { +static inline bool operator<=(const sbp_imu_input_type_t &lhs, + const sbp_imu_input_type_t &rhs) { return sbp_imu_input_type_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_imu_input_type_t &lhs, const sbp_imu_input_type_t &rhs) { +static inline bool operator>(const sbp_imu_input_type_t &lhs, + const sbp_imu_input_type_t &rhs) { return sbp_imu_input_type_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_imu_input_type_t &lhs, const sbp_imu_input_type_t &rhs) { +static inline bool operator>=(const sbp_imu_input_type_t &lhs, + const sbp_imu_input_type_t &rhs) { return sbp_imu_input_type_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SOLUTION_META_IMUINPUTTYPE_H */ - diff --git a/c/include/libsbp/solution_meta/MSG_SOLN_META.h b/c/include/libsbp/solution_meta/MSG_SOLN_META.h index fa61076bf..ffde4614c 100644 --- a/c/include/libsbp/solution_meta/MSG_SOLN_META.h +++ b/c/include/libsbp/solution_meta/MSG_SOLN_META.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SOLUTION_META_MSG_SOLN_META_H #define LIBSBP_SOLUTION_META_MSG_SOLN_META_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,109 +41,133 @@ *****************************************************************************/ /** Solution Sensors Metadata * -* This message contains all metadata about the sensors received and/or used in computing the sensorfusion solution. It focuses primarily, but not only, on GNSS metadata. Regarding the age of the last received valid GNSS solution, the highest two bits are time status, indicating whether age gnss can or can not be used to retrieve time of measurement (noted TOM, also known as time of validity) If it can, subtract 'age gnss' from 'tow' in navigation messages to get TOM. Can be used before alignment is complete in the Fusion Engine, when output solution is the last received valid GNSS solution and its tow is not a TOM. + * This message contains all metadata about the sensors received and/or used in + * computing the sensorfusion solution. It focuses primarily, but not only, on + * GNSS metadata. Regarding the age of the last received valid GNSS solution, + * the highest two bits are time status, indicating whether age gnss can or can + * not be used to retrieve time of measurement (noted TOM, also known as time of + * validity) If it can, subtract 'age gnss' from 'tow' in navigation messages to + * get TOM. Can be used before alignment is complete in the Fusion Engine, when + * output solution is the last received valid GNSS solution and its tow is not a + * TOM. */ typedef struct { - - /** -* GPS time of week rounded to the nearest millisecond [ms] + * GPS time of week rounded to the nearest millisecond [ms] */ u32 tow; - /** -* Position Dilution of Precision as per last available DOPS from PVT engine (0xFFFF indicates invalid) [0.01] + * Position Dilution of Precision as per last available DOPS from PVT engine + * (0xFFFF indicates invalid) [0.01] */ u16 pdop; - /** -* Horizontal Dilution of Precision as per last available DOPS from PVT engine (0xFFFF indicates invalid) [0.01] + * Horizontal Dilution of Precision as per last available DOPS from PVT engine + * (0xFFFF indicates invalid) [0.01] */ u16 hdop; - /** -* Vertical Dilution of Precision as per last available DOPS from PVT engine (0xFFFF indicates invalid) [0.01] + * Vertical Dilution of Precision as per last available DOPS from PVT engine + * (0xFFFF indicates invalid) [0.01] */ u16 vdop; - /** -* Age of corrections as per last available AGE_CORRECTIONS from PVT engine (0xFFFF indicates invalid) [deciseconds] + * Age of corrections as per last available AGE_CORRECTIONS from PVT engine + * (0xFFFF indicates invalid) [deciseconds] */ u16 age_corrections; - /** -* Age and Time Status of the last received valid GNSS solution. [ms] + * Age and Time Status of the last received valid GNSS solution. [ms] */ u32 age_gnss; - /** -* Array of Metadata describing the sensors potentially involved in the solution. Each element in the array represents a single sensor type and consists of flags containing (meta)data pertaining to that specific single sensor. Refer to each (XX)InputType descriptor in the present doc. + * Array of Metadata describing the sensors potentially involved in the + * solution. Each element in the array represents a single sensor type and + * consists of flags containing (meta)data pertaining to that specific single + * sensor. Refer to each (XX)InputType descriptor in the present doc. */ sbp_solution_input_type_t sol_in[SBP_MSG_SOLN_META_SOL_IN_MAX]; /** * Number of elements in sol_in * - * When sending a message fill in this field with the number elements set in sol_in before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * sol_in before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in sol_in. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * sol_in. The value of any elements beyond the index specified in this field + * is undefined */ u8 n_sol_in; } sbp_msg_soln_meta_t; - - /** * Get encoded size of an instance of sbp_msg_soln_meta_t * * @param msg sbp_msg_soln_meta_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_soln_meta_encoded_len(const sbp_msg_soln_meta_t *msg) -{ - return SBP_MSG_SOLN_META_ENCODED_OVERHEAD - + (msg->n_sol_in * SBP_SOLUTION_INPUT_TYPE_ENCODED_LEN) - ; +static inline size_t sbp_msg_soln_meta_encoded_len( + const sbp_msg_soln_meta_t *msg) { + return SBP_MSG_SOLN_META_ENCODED_OVERHEAD + + (msg->n_sol_in * SBP_SOLUTION_INPUT_TYPE_ENCODED_LEN); } /** * Encode an instance of sbp_msg_soln_meta_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_soln_meta_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_soln_meta_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_soln_meta_t *msg); +SBP_EXPORT s8 sbp_msg_soln_meta_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_soln_meta_t *msg); /** * Decode an instance of sbp_msg_soln_meta_t from wire representation * - * This function decodes the wire representation of a sbp_msg_soln_meta_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_soln_meta_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_soln_meta_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_soln_meta_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_soln_meta_t *msg); +SBP_EXPORT s8 sbp_msg_soln_meta_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_soln_meta_t *msg); /** * Send an instance of sbp_msg_soln_meta_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_soln_meta_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_soln_meta_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -151,51 +175,61 @@ SBP_EXPORT s8 sbp_msg_soln_meta_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_soln_meta_send(sbp_state_t *s, u16 sender_id, const sbp_msg_soln_meta_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_soln_meta_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_soln_meta_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_soln_meta_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_soln_meta_t instance * @param b sbp_msg_soln_meta_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_soln_meta_cmp(const sbp_msg_soln_meta_t *a, const sbp_msg_soln_meta_t *b); +SBP_EXPORT int sbp_msg_soln_meta_cmp(const sbp_msg_soln_meta_t *a, + const sbp_msg_soln_meta_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_soln_meta_t &lhs, const sbp_msg_soln_meta_t &rhs) { +static inline bool operator==(const sbp_msg_soln_meta_t &lhs, + const sbp_msg_soln_meta_t &rhs) { return sbp_msg_soln_meta_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_soln_meta_t &lhs, const sbp_msg_soln_meta_t &rhs) { +static inline bool operator!=(const sbp_msg_soln_meta_t &lhs, + const sbp_msg_soln_meta_t &rhs) { return sbp_msg_soln_meta_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_soln_meta_t &lhs, const sbp_msg_soln_meta_t &rhs) { +static inline bool operator<(const sbp_msg_soln_meta_t &lhs, + const sbp_msg_soln_meta_t &rhs) { return sbp_msg_soln_meta_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_soln_meta_t &lhs, const sbp_msg_soln_meta_t &rhs) { +static inline bool operator<=(const sbp_msg_soln_meta_t &lhs, + const sbp_msg_soln_meta_t &rhs) { return sbp_msg_soln_meta_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_soln_meta_t &lhs, const sbp_msg_soln_meta_t &rhs) { +static inline bool operator>(const sbp_msg_soln_meta_t &lhs, + const sbp_msg_soln_meta_t &rhs) { return sbp_msg_soln_meta_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_soln_meta_t &lhs, const sbp_msg_soln_meta_t &rhs) { +static inline bool operator>=(const sbp_msg_soln_meta_t &lhs, + const sbp_msg_soln_meta_t &rhs) { return sbp_msg_soln_meta_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SOLUTION_META_MSG_SOLN_META_H */ - diff --git a/c/include/libsbp/solution_meta/MSG_SOLN_META_DEP_A.h b/c/include/libsbp/solution_meta/MSG_SOLN_META_DEP_A.h index 2abed33d5..9faac7001 100644 --- a/c/include/libsbp/solution_meta/MSG_SOLN_META_DEP_A.h +++ b/c/include/libsbp/solution_meta/MSG_SOLN_META_DEP_A.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SOLUTION_META_MSG_SOLN_META_DEP_A_H #define LIBSBP_SOLUTION_META_MSG_SOLN_META_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,121 +41,135 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Position Dilution of Precision as per last available DOPS from PVT engine (0xFFFF indicates invalid) [0.01] + * Position Dilution of Precision as per last available DOPS from PVT engine + * (0xFFFF indicates invalid) [0.01] */ u16 pdop; - /** -* Horizontal Dilution of Precision as per last available DOPS from PVT engine (0xFFFF indicates invalid) [0.01] + * Horizontal Dilution of Precision as per last available DOPS from PVT engine + * (0xFFFF indicates invalid) [0.01] */ u16 hdop; - /** -* Vertical Dilution of Precision as per last available DOPS from PVT engine (0xFFFF indicates invalid) [0.01] + * Vertical Dilution of Precision as per last available DOPS from PVT engine + * (0xFFFF indicates invalid) [0.01] */ u16 vdop; - /** -* Number of satellites as per last available solution from PVT engine + * Number of satellites as per last available solution from PVT engine */ u8 n_sats; - /** -* Age of corrections as per last available AGE_CORRECTIONS from PVT engine (0xFFFF indicates invalid) [deciseconds] + * Age of corrections as per last available AGE_CORRECTIONS from PVT engine + * (0xFFFF indicates invalid) [deciseconds] */ u16 age_corrections; - /** -* State of alignment and the status and receipt of the alignment inputs + * State of alignment and the status and receipt of the alignment inputs */ u8 alignment_status; - /** -* Tow of last-used GNSS position measurement [ms] + * Tow of last-used GNSS position measurement [ms] */ u32 last_used_gnss_pos_tow; - /** -* Tow of last-used GNSS velocity measurement [ms] + * Tow of last-used GNSS velocity measurement [ms] */ u32 last_used_gnss_vel_tow; - /** -* Array of Metadata describing the sensors potentially involved in the solution. Each element in the array represents a single sensor type and consists of flags containing (meta)data pertaining to that specific single sensor. Refer to each (XX)InputType descriptor in the present doc. + * Array of Metadata describing the sensors potentially involved in the + * solution. Each element in the array represents a single sensor type and + * consists of flags containing (meta)data pertaining to that specific single + * sensor. Refer to each (XX)InputType descriptor in the present doc. */ sbp_solution_input_type_t sol_in[SBP_MSG_SOLN_META_DEP_A_SOL_IN_MAX]; /** * Number of elements in sol_in * - * When sending a message fill in this field with the number elements set in sol_in before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * sol_in before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in sol_in. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * sol_in. The value of any elements beyond the index specified in this field + * is undefined */ u8 n_sol_in; } sbp_msg_soln_meta_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_soln_meta_dep_a_t * * @param msg sbp_msg_soln_meta_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_soln_meta_dep_a_encoded_len(const sbp_msg_soln_meta_dep_a_t *msg) -{ - return SBP_MSG_SOLN_META_DEP_A_ENCODED_OVERHEAD - + (msg->n_sol_in * SBP_SOLUTION_INPUT_TYPE_ENCODED_LEN) - ; +static inline size_t sbp_msg_soln_meta_dep_a_encoded_len( + const sbp_msg_soln_meta_dep_a_t *msg) { + return SBP_MSG_SOLN_META_DEP_A_ENCODED_OVERHEAD + + (msg->n_sol_in * SBP_SOLUTION_INPUT_TYPE_ENCODED_LEN); } /** * Encode an instance of sbp_msg_soln_meta_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_soln_meta_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_soln_meta_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_soln_meta_dep_a_t *msg); +SBP_EXPORT s8 +sbp_msg_soln_meta_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_soln_meta_dep_a_t *msg); /** * Decode an instance of sbp_msg_soln_meta_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_soln_meta_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_soln_meta_dep_a_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_soln_meta_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_soln_meta_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_soln_meta_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_soln_meta_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_soln_meta_dep_a_t *msg); /** * Send an instance of sbp_msg_soln_meta_dep_a_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_soln_meta_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_soln_meta_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -163,51 +177,61 @@ SBP_EXPORT s8 sbp_msg_soln_meta_dep_a_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_soln_meta_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_soln_meta_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_soln_meta_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_soln_meta_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_soln_meta_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_soln_meta_dep_a_t instance * @param b sbp_msg_soln_meta_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_soln_meta_dep_a_cmp(const sbp_msg_soln_meta_dep_a_t *a, const sbp_msg_soln_meta_dep_a_t *b); +SBP_EXPORT int sbp_msg_soln_meta_dep_a_cmp(const sbp_msg_soln_meta_dep_a_t *a, + const sbp_msg_soln_meta_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_soln_meta_dep_a_t &lhs, const sbp_msg_soln_meta_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_soln_meta_dep_a_t &lhs, + const sbp_msg_soln_meta_dep_a_t &rhs) { return sbp_msg_soln_meta_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_soln_meta_dep_a_t &lhs, const sbp_msg_soln_meta_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_soln_meta_dep_a_t &lhs, + const sbp_msg_soln_meta_dep_a_t &rhs) { return sbp_msg_soln_meta_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_soln_meta_dep_a_t &lhs, const sbp_msg_soln_meta_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_soln_meta_dep_a_t &lhs, + const sbp_msg_soln_meta_dep_a_t &rhs) { return sbp_msg_soln_meta_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_soln_meta_dep_a_t &lhs, const sbp_msg_soln_meta_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_soln_meta_dep_a_t &lhs, + const sbp_msg_soln_meta_dep_a_t &rhs) { return sbp_msg_soln_meta_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_soln_meta_dep_a_t &lhs, const sbp_msg_soln_meta_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_soln_meta_dep_a_t &lhs, + const sbp_msg_soln_meta_dep_a_t &rhs) { return sbp_msg_soln_meta_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_soln_meta_dep_a_t &lhs, const sbp_msg_soln_meta_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_soln_meta_dep_a_t &lhs, + const sbp_msg_soln_meta_dep_a_t &rhs) { return sbp_msg_soln_meta_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SOLUTION_META_MSG_SOLN_META_DEP_A_H */ - diff --git a/c/include/libsbp/solution_meta/OdoInputType.h b/c/include/libsbp/solution_meta/OdoInputType.h index 5c44e91d0..ee38d30d0 100644 --- a/c/include/libsbp/solution_meta/OdoInputType.h +++ b/c/include/libsbp/solution_meta/OdoInputType.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SOLUTION_META_ODOINPUTTYPE_H #define LIBSBP_SOLUTION_META_ODOINPUTTYPE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -38,30 +38,28 @@ * SBP_ODOINPUTTYPE * *****************************************************************************/ -/** Provides detail about the Odometry sensor, its timestamping mode, and its quality for input to the fuzed solution +/** Provides detail about the Odometry sensor, its timestamping mode, and its +quality for input to the fuzed solution * -* Metadata around the Odometry sensors involved in the fuzed solution. Accessible through sol_in[N].flags in a MSG_SOLN_META. +* Metadata around the Odometry sensors involved in the fuzed solution. +Accessible through sol_in[N].flags in a MSG_SOLN_META. */ typedef struct { - - /** -* Instrument ODO rate, grade, and quality. + * Instrument ODO rate, grade, and quality. */ u8 flags; } sbp_odo_input_type_t; - - /** * Get encoded size of an instance of sbp_odo_input_type_t * * @param msg sbp_odo_input_type_t instance * @return Length of on-wire representation */ -static inline size_t sbp_odo_input_type_encoded_len(const sbp_odo_input_type_t *msg) -{ +static inline size_t sbp_odo_input_type_encoded_len( + const sbp_odo_input_type_t *msg) { (void)msg; return SBP_ODO_INPUT_TYPE_ENCODED_LEN; } @@ -69,74 +67,96 @@ static inline size_t sbp_odo_input_type_encoded_len(const sbp_odo_input_type_t * /** * Encode an instance of sbp_odo_input_type_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_odo_input_type_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_odo_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_odo_input_type_t *msg); +SBP_EXPORT s8 sbp_odo_input_type_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_odo_input_type_t *msg); /** * Decode an instance of sbp_odo_input_type_t from wire representation * - * This function decodes the wire representation of a sbp_odo_input_type_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_odo_input_type_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_odo_input_type_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_odo_input_type_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_odo_input_type_t *msg); +SBP_EXPORT s8 sbp_odo_input_type_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_odo_input_type_t *msg); /** * Compare two instances of sbp_odo_input_type_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_odo_input_type_t instance * @param b sbp_odo_input_type_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_odo_input_type_cmp(const sbp_odo_input_type_t *a, const sbp_odo_input_type_t *b); +SBP_EXPORT int sbp_odo_input_type_cmp(const sbp_odo_input_type_t *a, + const sbp_odo_input_type_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_odo_input_type_t &lhs, const sbp_odo_input_type_t &rhs) { +static inline bool operator==(const sbp_odo_input_type_t &lhs, + const sbp_odo_input_type_t &rhs) { return sbp_odo_input_type_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_odo_input_type_t &lhs, const sbp_odo_input_type_t &rhs) { +static inline bool operator!=(const sbp_odo_input_type_t &lhs, + const sbp_odo_input_type_t &rhs) { return sbp_odo_input_type_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_odo_input_type_t &lhs, const sbp_odo_input_type_t &rhs) { +static inline bool operator<(const sbp_odo_input_type_t &lhs, + const sbp_odo_input_type_t &rhs) { return sbp_odo_input_type_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_odo_input_type_t &lhs, const sbp_odo_input_type_t &rhs) { +static inline bool operator<=(const sbp_odo_input_type_t &lhs, + const sbp_odo_input_type_t &rhs) { return sbp_odo_input_type_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_odo_input_type_t &lhs, const sbp_odo_input_type_t &rhs) { +static inline bool operator>(const sbp_odo_input_type_t &lhs, + const sbp_odo_input_type_t &rhs) { return sbp_odo_input_type_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_odo_input_type_t &lhs, const sbp_odo_input_type_t &rhs) { +static inline bool operator>=(const sbp_odo_input_type_t &lhs, + const sbp_odo_input_type_t &rhs) { return sbp_odo_input_type_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SOLUTION_META_ODOINPUTTYPE_H */ - diff --git a/c/include/libsbp/solution_meta/SolutionInputType.h b/c/include/libsbp/solution_meta/SolutionInputType.h index e7821a052..364d24543 100644 --- a/c/include/libsbp/solution_meta/SolutionInputType.h +++ b/c/include/libsbp/solution_meta/SolutionInputType.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SOLUTION_META_SOLUTIONINPUTTYPE_H #define LIBSBP_SOLUTION_META_SOLUTIONINPUTTYPE_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,33 +40,33 @@ *****************************************************************************/ /** Flags for a given solution input type * -* Metadata describing which sensors were involved in the solution. The structure is fixed no matter what the actual sensor type is. The sensor_type field tells you which sensor we are talking about. It also tells you whether the sensor data was actually used or not. The flags field, always a u8, contains the sensor-specific data. The content of flags, for each sensor type, is described in the relevant structures in this section. + * Metadata describing which sensors were involved in the solution. The + * structure is fixed no matter what the actual sensor type is. The sensor_type + * field tells you which sensor we are talking about. It also tells you whether + * the sensor data was actually used or not. The flags field, always a u8, + * contains the sensor-specific data. The content of flags, for each sensor + * type, is described in the relevant structures in this section. */ typedef struct { - - /** -* The type of sensor + * The type of sensor */ u8 sensor_type; - /** -* Refer to each InputType description [(XX)InputType] + * Refer to each InputType description [(XX)InputType] */ u8 flags; } sbp_solution_input_type_t; - - /** * Get encoded size of an instance of sbp_solution_input_type_t * * @param msg sbp_solution_input_type_t instance * @return Length of on-wire representation */ -static inline size_t sbp_solution_input_type_encoded_len(const sbp_solution_input_type_t *msg) -{ +static inline size_t sbp_solution_input_type_encoded_len( + const sbp_solution_input_type_t *msg) { (void)msg; return SBP_SOLUTION_INPUT_TYPE_ENCODED_LEN; } @@ -74,74 +74,96 @@ static inline size_t sbp_solution_input_type_encoded_len(const sbp_solution_inpu /** * Encode an instance of sbp_solution_input_type_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_solution_input_type_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_solution_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_solution_input_type_t *msg); +SBP_EXPORT s8 +sbp_solution_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_solution_input_type_t *msg); /** * Decode an instance of sbp_solution_input_type_t from wire representation * - * This function decodes the wire representation of a sbp_solution_input_type_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_solution_input_type_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_solution_input_type_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_solution_input_type_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_solution_input_type_t *msg); +SBP_EXPORT s8 sbp_solution_input_type_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_solution_input_type_t *msg); /** * Compare two instances of sbp_solution_input_type_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_solution_input_type_t instance * @param b sbp_solution_input_type_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_solution_input_type_cmp(const sbp_solution_input_type_t *a, const sbp_solution_input_type_t *b); +SBP_EXPORT int sbp_solution_input_type_cmp(const sbp_solution_input_type_t *a, + const sbp_solution_input_type_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_solution_input_type_t &lhs, const sbp_solution_input_type_t &rhs) { +static inline bool operator==(const sbp_solution_input_type_t &lhs, + const sbp_solution_input_type_t &rhs) { return sbp_solution_input_type_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_solution_input_type_t &lhs, const sbp_solution_input_type_t &rhs) { +static inline bool operator!=(const sbp_solution_input_type_t &lhs, + const sbp_solution_input_type_t &rhs) { return sbp_solution_input_type_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_solution_input_type_t &lhs, const sbp_solution_input_type_t &rhs) { +static inline bool operator<(const sbp_solution_input_type_t &lhs, + const sbp_solution_input_type_t &rhs) { return sbp_solution_input_type_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_solution_input_type_t &lhs, const sbp_solution_input_type_t &rhs) { +static inline bool operator<=(const sbp_solution_input_type_t &lhs, + const sbp_solution_input_type_t &rhs) { return sbp_solution_input_type_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_solution_input_type_t &lhs, const sbp_solution_input_type_t &rhs) { +static inline bool operator>(const sbp_solution_input_type_t &lhs, + const sbp_solution_input_type_t &rhs) { return sbp_solution_input_type_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_solution_input_type_t &lhs, const sbp_solution_input_type_t &rhs) { +static inline bool operator>=(const sbp_solution_input_type_t &lhs, + const sbp_solution_input_type_t &rhs) { return sbp_solution_input_type_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SOLUTION_META_SOLUTIONINPUTTYPE_H */ - diff --git a/c/include/libsbp/solution_meta_macros.h b/c/include/libsbp/solution_meta_macros.h index 5de6ce038..7bb333cc5 100644 --- a/c/include/libsbp/solution_meta_macros.h +++ b/c/include/libsbp/solution_meta_macros.h @@ -18,31 +18,35 @@ #ifndef LIBSBP_SOLUTION_META_MACROS_H #define LIBSBP_SOLUTION_META_MACROS_H - #define SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_MASK (0x3u) #define SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_SHIFT (3u) -#define SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_SHIFT) \ - & SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_MASK)) -#define SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_MASK << SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_SHIFT))) | \ - (((val) & (SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_MASK)) \ - << (SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_SHIFT)));} while(0) - +#define SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_SHIFT) & \ + SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_MASK)) +#define SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_MASK \ + << SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_SHIFT))) | \ + (((val) & (SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_MASK)) \ + << (SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_SHIFT))); \ + } while (0) #define SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_UNKNOWN (0) #define SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_RECEIVED_AND_USED (1) #define SBP_SOLUTIONINPUTTYPE_SENSOR_USAGE_RECEIVED_BUT_NOT_USED (2) #define SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_MASK (0x7u) #define SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_SHIFT (0u) -#define SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_SHIFT) \ - & SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_MASK)) -#define SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_MASK << SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_SHIFT))) | \ - (((val) & (SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_MASK)) \ - << (SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_SHIFT)));} while(0) - +#define SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_SHIFT) & \ + SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_MASK)) +#define SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_MASK \ + << SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_SHIFT))) | \ + (((val) & (SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_MASK)) \ + << (SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_SHIFT))); \ + } while (0) #define SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_INVALID (0) #define SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_GNSS_POSITION (1) @@ -52,144 +56,172 @@ #define SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_ODOMETRY_SPEED (5) #define SBP_SOLUTIONINPUTTYPE_SENSOR_TYPE_IMU_SENSOR (6) /** - * Encoded length of sbp_solution_input_type_t (V4 API) and + * Encoded length of sbp_solution_input_type_t (V4 API) and * solution_input_type_t (legacy API) */ #define SBP_SOLUTION_INPUT_TYPE_ENCODED_LEN 2u - #define SBP_MSG_SOLN_META_DEP_A 0xFF0F #define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_MASK (0x7u) #define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_SHIFT (0u) -#define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_SHIFT) \ - & SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_MASK)) -#define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_MASK << SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_SHIFT))) | \ - (((val) & (SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_MASK)) \ - << (SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_SHIFT)));} while(0) - - -#define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_UNKNOWN_REASON_OR_ALREADY_ALIGNED (0) -#define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_SEED_VALUES_LOADED_AND_ALIGNMENT_IN_PROGRESS (1) -#define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_NO_SEED_VALUES_AND_ALIGNMENT_IN_PROGRESS (2) -#define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_SEED_VALUES_LOADED_BUT_NO_GNSS_MEASUREMENTS (3) -#define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_NO_SEED_VALUES_NOR_GNSS_MEASUREMENTS (4) +#define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_SHIFT) & \ + SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_MASK)) +#define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_MASK \ + << SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_SHIFT))) | \ + (((val) & (SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_MASK)) \ + << (SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_SHIFT))); \ + } while (0) + +#define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_UNKNOWN_REASON_OR_ALREADY_ALIGNED \ + (0) +#define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_SEED_VALUES_LOADED_AND_ALIGNMENT_IN_PROGRESS \ + (1) +#define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_NO_SEED_VALUES_AND_ALIGNMENT_IN_PROGRESS \ + (2) +#define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_SEED_VALUES_LOADED_BUT_NO_GNSS_MEASUREMENTS \ + (3) +#define SBP_SOLN_META_DEP_A_ALIGNMENT_STATUS_NO_SEED_VALUES_NOR_GNSS_MEASUREMENTS \ + (4) /** - * The maximum number of items that can be stored in sbp_msg_soln_meta_dep_a_t::sol_in (V4 API) or msg_soln_meta_dep_a_t::sol_in (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_soln_meta_dep_a_t::sol_in (V4 API) or msg_soln_meta_dep_a_t::sol_in + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_SOLN_META_DEP_A_SOL_IN_MAX 118u - /** - * Encoded length of sbp_msg_soln_meta_dep_a_t (V4 API) and + * Encoded length of sbp_msg_soln_meta_dep_a_t (V4 API) and * msg_soln_meta_dep_a_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_soln_meta_dep_a_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_soln_meta_dep_a_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SOLN_META_DEP_A_ENCODED_OVERHEAD 18u - #define SBP_MSG_SOLN_META 0xFF0E #define SBP_SOLN_META_TIME_STATUS_MASK (0x3u) #define SBP_SOLN_META_TIME_STATUS_SHIFT (30u) -#define SBP_SOLN_META_TIME_STATUS_GET(flags) \ - ((u32)((u32)((flags) >> SBP_SOLN_META_TIME_STATUS_SHIFT) \ - & SBP_SOLN_META_TIME_STATUS_MASK)) -#define SBP_SOLN_META_TIME_STATUS_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_SOLN_META_TIME_STATUS_MASK << SBP_SOLN_META_TIME_STATUS_SHIFT))) | \ - (((val) & (SBP_SOLN_META_TIME_STATUS_MASK)) \ - << (SBP_SOLN_META_TIME_STATUS_SHIFT)));} while(0) - +#define SBP_SOLN_META_TIME_STATUS_GET(flags) \ + ((u32)((u32)((flags) >> SBP_SOLN_META_TIME_STATUS_SHIFT) & \ + SBP_SOLN_META_TIME_STATUS_MASK)) +#define SBP_SOLN_META_TIME_STATUS_SET(flags, val) \ + do { \ + (flags) = (u32)((flags & (~(SBP_SOLN_META_TIME_STATUS_MASK \ + << SBP_SOLN_META_TIME_STATUS_SHIFT))) | \ + (((val) & (SBP_SOLN_META_TIME_STATUS_MASK)) \ + << (SBP_SOLN_META_TIME_STATUS_SHIFT))); \ + } while (0) #define SBP_SOLN_META_TIME_STATUS_AGE_CAN_NOT_BE_USED_TO_RETRIEVE_TOM (0) #define SBP_SOLN_META_TIME_STATUS_AGE_CAN_BE_USED_TO_RETRIEVE_TOM (1) -#define SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_MASK (0x3fffffffu) +#define SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_MASK \ + (0x3fffffffu) #define SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_SHIFT (0u) #define SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_GET(flags) \ - ((u32)((u32)((flags) >> SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_SHIFT) \ - & SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_MASK)) -#define SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_MASK << SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_SHIFT))) | \ - (((val) & (SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_MASK)) \ - << (SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_SHIFT)));} while(0) - + ((u32)( \ + (u32)( \ + (flags) >> \ + SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_SHIFT) & \ + SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_MASK)) +#define SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_SET(flags, \ + val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_MASK \ + << SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_SHIFT))) | \ + (((val) & \ + (SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_MASK)) \ + << (SBP_SOLN_META_AGE_OF_THE_LAST_RECEIVED_VALID_GNSS_SOLUTION_SHIFT))); \ + } while (0) /** - * The maximum number of items that can be stored in sbp_msg_soln_meta_t::sol_in (V4 API) or msg_soln_meta_t::sol_in (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in sbp_msg_soln_meta_t::sol_in + * (V4 API) or msg_soln_meta_t::sol_in (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_SOLN_META_SOL_IN_MAX 119u - /** - * Encoded length of sbp_msg_soln_meta_t (V4 API) and + * Encoded length of sbp_msg_soln_meta_t (V4 API) and * msg_soln_meta_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_soln_meta_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_soln_meta_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SOLN_META_ENCODED_OVERHEAD 16u - #define SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_MASK (0x3u) #define SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_SHIFT (0u) -#define SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_GET(flags) \ - ((u8)((u8)((flags) >> SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_SHIFT) \ - & SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_MASK)) -#define SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_MASK << SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_SHIFT))) | \ - (((val) & (SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_MASK)) \ - << (SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_SHIFT)));} while(0) - +#define SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_GET(flags) \ + ((u8)((u8)((flags) >> SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_SHIFT) & \ + SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_MASK)) +#define SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_MASK \ + << SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_SHIFT))) | \ + (((val) & (SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_MASK)) \ + << (SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_SHIFT))); \ + } while (0) #define SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_GNSS_POSITION (0) #define SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_GNSS_VELOCITY_DOPPLER (1) -#define SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_GNSS_VELOCITY_DISPLACEMENT (2) +#define SBP_GNSSINPUTTYPE_TYPE_OF_GNSS_MEASUREMENT_GNSS_VELOCITY_DISPLACEMENT \ + (2) /** - * Encoded length of sbp_gnss_input_type_t (V4 API) and + * Encoded length of sbp_gnss_input_type_t (V4 API) and * gnss_input_type_t (legacy API) */ #define SBP_GNSS_INPUT_TYPE_ENCODED_LEN 1u - #define SBP_IMUINPUTTYPE_TIME_STATUS_MASK (0x3u) #define SBP_IMUINPUTTYPE_TIME_STATUS_SHIFT (4u) -#define SBP_IMUINPUTTYPE_TIME_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_IMUINPUTTYPE_TIME_STATUS_SHIFT) \ - & SBP_IMUINPUTTYPE_TIME_STATUS_MASK)) -#define SBP_IMUINPUTTYPE_TIME_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_IMUINPUTTYPE_TIME_STATUS_MASK << SBP_IMUINPUTTYPE_TIME_STATUS_SHIFT))) | \ - (((val) & (SBP_IMUINPUTTYPE_TIME_STATUS_MASK)) \ - << (SBP_IMUINPUTTYPE_TIME_STATUS_SHIFT)));} while(0) - - -#define SBP_IMUINPUTTYPE_TIME_STATUS_REFERENCE_EPOCH_IS_START_OF_CURRENT_GPS_WEEK (0) -#define SBP_IMUINPUTTYPE_TIME_STATUS_REFERENCE_EPOCH_IS_TIME_OF_SYSTEM_STARTUP (1) +#define SBP_IMUINPUTTYPE_TIME_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_IMUINPUTTYPE_TIME_STATUS_SHIFT) & \ + SBP_IMUINPUTTYPE_TIME_STATUS_MASK)) +#define SBP_IMUINPUTTYPE_TIME_STATUS_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_IMUINPUTTYPE_TIME_STATUS_MASK \ + << SBP_IMUINPUTTYPE_TIME_STATUS_SHIFT))) | \ + (((val) & (SBP_IMUINPUTTYPE_TIME_STATUS_MASK)) \ + << (SBP_IMUINPUTTYPE_TIME_STATUS_SHIFT))); \ + } while (0) + +#define SBP_IMUINPUTTYPE_TIME_STATUS_REFERENCE_EPOCH_IS_START_OF_CURRENT_GPS_WEEK \ + (0) +#define SBP_IMUINPUTTYPE_TIME_STATUS_REFERENCE_EPOCH_IS_TIME_OF_SYSTEM_STARTUP \ + (1) #define SBP_IMUINPUTTYPE_TIME_STATUS_REFERENCE_EPOCH_IS_UNKNOWN (2) #define SBP_IMUINPUTTYPE_TIME_STATUS_REFERENCE_EPOCH_IS_LAST_PPS (3) #define SBP_IMUINPUTTYPE_IMU_GRADE_MASK (0x3u) #define SBP_IMUINPUTTYPE_IMU_GRADE_SHIFT (2u) -#define SBP_IMUINPUTTYPE_IMU_GRADE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_IMUINPUTTYPE_IMU_GRADE_SHIFT) \ - & SBP_IMUINPUTTYPE_IMU_GRADE_MASK)) -#define SBP_IMUINPUTTYPE_IMU_GRADE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_IMUINPUTTYPE_IMU_GRADE_MASK << SBP_IMUINPUTTYPE_IMU_GRADE_SHIFT))) | \ - (((val) & (SBP_IMUINPUTTYPE_IMU_GRADE_MASK)) \ - << (SBP_IMUINPUTTYPE_IMU_GRADE_SHIFT)));} while(0) - +#define SBP_IMUINPUTTYPE_IMU_GRADE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_IMUINPUTTYPE_IMU_GRADE_SHIFT) & \ + SBP_IMUINPUTTYPE_IMU_GRADE_MASK)) +#define SBP_IMUINPUTTYPE_IMU_GRADE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_IMUINPUTTYPE_IMU_GRADE_MASK \ + << SBP_IMUINPUTTYPE_IMU_GRADE_SHIFT))) | \ + (((val) & (SBP_IMUINPUTTYPE_IMU_GRADE_MASK)) \ + << (SBP_IMUINPUTTYPE_IMU_GRADE_SHIFT))); \ + } while (0) #define SBP_IMUINPUTTYPE_IMU_GRADE_CONSUMER_GRADE (0) #define SBP_IMUINPUTTYPE_IMU_GRADE_TACTICAL_GRADE (1) @@ -197,72 +229,77 @@ #define SBP_IMUINPUTTYPE_IMU_GRADE_SUPERIOR_GRADE (3) #define SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_MASK (0x3u) #define SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_SHIFT (0u) -#define SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_SHIFT) \ - & SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_MASK)) -#define SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_MASK << SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_SHIFT))) | \ - (((val) & (SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_MASK)) \ - << (SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_SHIFT)));} while(0) - +#define SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_SHIFT) & \ + SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_MASK)) +#define SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_MASK \ + << SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_SHIFT))) | \ + (((val) & (SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_MASK)) \ + << (SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_SHIFT))); \ + } while (0) #define SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_6_AXIS_MEMS (0) #define SBP_IMUINPUTTYPE_IMU_ARCHITECTURE_OTHER_TYPE (1) /** - * Encoded length of sbp_imu_input_type_t (V4 API) and + * Encoded length of sbp_imu_input_type_t (V4 API) and * imu_input_type_t (legacy API) */ #define SBP_IMU_INPUT_TYPE_ENCODED_LEN 1u - #define SBP_ODOINPUTTYPE_RATE_MASK (0x3u) #define SBP_ODOINPUTTYPE_RATE_SHIFT (4u) -#define SBP_ODOINPUTTYPE_RATE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_ODOINPUTTYPE_RATE_SHIFT) \ - & SBP_ODOINPUTTYPE_RATE_MASK)) -#define SBP_ODOINPUTTYPE_RATE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_ODOINPUTTYPE_RATE_MASK << SBP_ODOINPUTTYPE_RATE_SHIFT))) | \ - (((val) & (SBP_ODOINPUTTYPE_RATE_MASK)) \ - << (SBP_ODOINPUTTYPE_RATE_SHIFT)));} while(0) - +#define SBP_ODOINPUTTYPE_RATE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ODOINPUTTYPE_RATE_SHIFT) & \ + SBP_ODOINPUTTYPE_RATE_MASK)) +#define SBP_ODOINPUTTYPE_RATE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_ODOINPUTTYPE_RATE_MASK \ + << SBP_ODOINPUTTYPE_RATE_SHIFT))) | \ + (((val) & (SBP_ODOINPUTTYPE_RATE_MASK)) \ + << (SBP_ODOINPUTTYPE_RATE_SHIFT))); \ + } while (0) #define SBP_ODOINPUTTYPE_RATE_FIXED_INCOMING_RATE (0) #define SBP_ODOINPUTTYPE_RATE_TRIGGERED_BY_MINIMUM_DISTANCE_OR_SPEED (1) #define SBP_ODOINPUTTYPE_ODOMETER_GRADE_MASK (0x3u) #define SBP_ODOINPUTTYPE_ODOMETER_GRADE_SHIFT (2u) -#define SBP_ODOINPUTTYPE_ODOMETER_GRADE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_ODOINPUTTYPE_ODOMETER_GRADE_SHIFT) \ - & SBP_ODOINPUTTYPE_ODOMETER_GRADE_MASK)) -#define SBP_ODOINPUTTYPE_ODOMETER_GRADE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_ODOINPUTTYPE_ODOMETER_GRADE_MASK << SBP_ODOINPUTTYPE_ODOMETER_GRADE_SHIFT))) | \ - (((val) & (SBP_ODOINPUTTYPE_ODOMETER_GRADE_MASK)) \ - << (SBP_ODOINPUTTYPE_ODOMETER_GRADE_SHIFT)));} while(0) - +#define SBP_ODOINPUTTYPE_ODOMETER_GRADE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ODOINPUTTYPE_ODOMETER_GRADE_SHIFT) & \ + SBP_ODOINPUTTYPE_ODOMETER_GRADE_MASK)) +#define SBP_ODOINPUTTYPE_ODOMETER_GRADE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_ODOINPUTTYPE_ODOMETER_GRADE_MASK \ + << SBP_ODOINPUTTYPE_ODOMETER_GRADE_SHIFT))) | \ + (((val) & (SBP_ODOINPUTTYPE_ODOMETER_GRADE_MASK)) \ + << (SBP_ODOINPUTTYPE_ODOMETER_GRADE_SHIFT))); \ + } while (0) #define SBP_ODOINPUTTYPE_ODOMETER_GRADE_LOW_GRADE (0) #define SBP_ODOINPUTTYPE_ODOMETER_GRADE_MEDIUM_GRADE (1) #define SBP_ODOINPUTTYPE_ODOMETER_GRADE_SUPERIOR_GRADE (2) #define SBP_ODOINPUTTYPE_ODOMETER_CLASS_MASK (0x3u) #define SBP_ODOINPUTTYPE_ODOMETER_CLASS_SHIFT (0u) -#define SBP_ODOINPUTTYPE_ODOMETER_CLASS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_ODOINPUTTYPE_ODOMETER_CLASS_SHIFT) \ - & SBP_ODOINPUTTYPE_ODOMETER_CLASS_MASK)) -#define SBP_ODOINPUTTYPE_ODOMETER_CLASS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_ODOINPUTTYPE_ODOMETER_CLASS_MASK << SBP_ODOINPUTTYPE_ODOMETER_CLASS_SHIFT))) | \ - (((val) & (SBP_ODOINPUTTYPE_ODOMETER_CLASS_MASK)) \ - << (SBP_ODOINPUTTYPE_ODOMETER_CLASS_SHIFT)));} while(0) - +#define SBP_ODOINPUTTYPE_ODOMETER_CLASS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ODOINPUTTYPE_ODOMETER_CLASS_SHIFT) & \ + SBP_ODOINPUTTYPE_ODOMETER_CLASS_MASK)) +#define SBP_ODOINPUTTYPE_ODOMETER_CLASS_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_ODOINPUTTYPE_ODOMETER_CLASS_MASK \ + << SBP_ODOINPUTTYPE_ODOMETER_CLASS_SHIFT))) | \ + (((val) & (SBP_ODOINPUTTYPE_ODOMETER_CLASS_MASK)) \ + << (SBP_ODOINPUTTYPE_ODOMETER_CLASS_SHIFT))); \ + } while (0) #define SBP_ODOINPUTTYPE_ODOMETER_CLASS_SINGLE_OR_AVERAGED_TICKS (0) #define SBP_ODOINPUTTYPE_ODOMETER_CLASS_SINGLE_OR_AVERAGED_SPEED (1) #define SBP_ODOINPUTTYPE_ODOMETER_CLASS_MULTI_DIMENSIONAL_TICKS (2) #define SBP_ODOINPUTTYPE_ODOMETER_CLASS_MULTI_DIMENSIONAL_SPEED (3) /** - * Encoded length of sbp_odo_input_type_t (V4 API) and + * Encoded length of sbp_odo_input_type_t (V4 API) and * odo_input_type_t (legacy API) */ #define SBP_ODO_INPUT_TYPE_ENCODED_LEN 1u - - #endif /* LIBSBP_SOLUTION_META_MACROS_H */ diff --git a/c/include/libsbp/ssr.h b/c/include/libsbp/ssr.h index 039aca0f7..d8276fc4b 100644 --- a/c/include/libsbp/ssr.h +++ b/c/include/libsbp/ssr.h @@ -17,43 +17,43 @@ #ifndef LIBSBP_SSR_MESSAGES_H #define LIBSBP_SSR_MESSAGES_H +#include #include -#include -#include +#include +#include #include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include +#include #include -#include +#include #include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif /* LIBSBP_SSR_MESSAGES_H */ diff --git a/c/include/libsbp/ssr/BoundsHeader.h b/c/include/libsbp/ssr/BoundsHeader.h index 33382b150..166b99805 100644 --- a/c/include/libsbp/ssr/BoundsHeader.h +++ b/c/include/libsbp/ssr/BoundsHeader.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SSR_BOUNDSHEADER_H #define LIBSBP_SSR_BOUNDSHEADER_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,48 +40,40 @@ * *****************************************************************************/ typedef struct { - - /** -* GNSS reference time of the bound + * GNSS reference time of the bound */ sbp_gps_time_sec_t time; - /** -* Number of messages in the dataset + * Number of messages in the dataset */ u8 num_msgs; - /** -* Position of this message in the dataset + * Position of this message in the dataset */ u8 seq_num; - /** - * Update interval between consecutive bounds. Similar to RTCM DF391. + * Update interval between consecutive bounds. Similar to RTCM DF391. */ u8 update_interval; - /** -* SSR Solution ID. + * SSR Solution ID. */ u8 sol_id; } sbp_bounds_header_t; - - /** * Get encoded size of an instance of sbp_bounds_header_t * * @param msg sbp_bounds_header_t instance * @return Length of on-wire representation */ -static inline size_t sbp_bounds_header_encoded_len(const sbp_bounds_header_t *msg) -{ +static inline size_t sbp_bounds_header_encoded_len( + const sbp_bounds_header_t *msg) { (void)msg; return SBP_BOUNDS_HEADER_ENCODED_LEN; } @@ -89,74 +81,96 @@ static inline size_t sbp_bounds_header_encoded_len(const sbp_bounds_header_t *ms /** * Encode an instance of sbp_bounds_header_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_bounds_header_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_bounds_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_bounds_header_t *msg); +SBP_EXPORT s8 sbp_bounds_header_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_bounds_header_t *msg); /** * Decode an instance of sbp_bounds_header_t from wire representation * - * This function decodes the wire representation of a sbp_bounds_header_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_bounds_header_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_bounds_header_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_bounds_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_bounds_header_t *msg); +SBP_EXPORT s8 sbp_bounds_header_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_bounds_header_t *msg); /** * Compare two instances of sbp_bounds_header_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_bounds_header_t instance * @param b sbp_bounds_header_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_bounds_header_cmp(const sbp_bounds_header_t *a, const sbp_bounds_header_t *b); +SBP_EXPORT int sbp_bounds_header_cmp(const sbp_bounds_header_t *a, + const sbp_bounds_header_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_bounds_header_t &lhs, const sbp_bounds_header_t &rhs) { +static inline bool operator==(const sbp_bounds_header_t &lhs, + const sbp_bounds_header_t &rhs) { return sbp_bounds_header_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_bounds_header_t &lhs, const sbp_bounds_header_t &rhs) { +static inline bool operator!=(const sbp_bounds_header_t &lhs, + const sbp_bounds_header_t &rhs) { return sbp_bounds_header_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_bounds_header_t &lhs, const sbp_bounds_header_t &rhs) { +static inline bool operator<(const sbp_bounds_header_t &lhs, + const sbp_bounds_header_t &rhs) { return sbp_bounds_header_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_bounds_header_t &lhs, const sbp_bounds_header_t &rhs) { +static inline bool operator<=(const sbp_bounds_header_t &lhs, + const sbp_bounds_header_t &rhs) { return sbp_bounds_header_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_bounds_header_t &lhs, const sbp_bounds_header_t &rhs) { +static inline bool operator>(const sbp_bounds_header_t &lhs, + const sbp_bounds_header_t &rhs) { return sbp_bounds_header_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_bounds_header_t &lhs, const sbp_bounds_header_t &rhs) { +static inline bool operator>=(const sbp_bounds_header_t &lhs, + const sbp_bounds_header_t &rhs) { return sbp_bounds_header_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_BOUNDSHEADER_H */ - diff --git a/c/include/libsbp/ssr/CodeBiasesContent.h b/c/include/libsbp/ssr/CodeBiasesContent.h index 6334659b4..aab66213a 100644 --- a/c/include/libsbp/ssr/CodeBiasesContent.h +++ b/c/include/libsbp/ssr/CodeBiasesContent.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SSR_CODEBIASESCONTENT_H #define LIBSBP_SSR_CODEBIASESCONTENT_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,33 +40,30 @@ *****************************************************************************/ /** SSR code biases corrections for a particular satellite * -* Code biases are to be added to pseudorange. The corrections conform with RTCMv3 MT 1059 / 1065. + * Code biases are to be added to pseudorange. The corrections conform with + * RTCMv3 MT 1059 / 1065. */ typedef struct { - - /** - * Signal encoded following RTCM specifications (DF380, DF381, DF382 and DF467). + * Signal encoded following RTCM specifications (DF380, DF381, DF382 and + * DF467). */ u8 code; - /** -* Code bias value [0.01 m] + * Code bias value [0.01 m] */ s16 value; } sbp_code_biases_content_t; - - /** * Get encoded size of an instance of sbp_code_biases_content_t * * @param msg sbp_code_biases_content_t instance * @return Length of on-wire representation */ -static inline size_t sbp_code_biases_content_encoded_len(const sbp_code_biases_content_t *msg) -{ +static inline size_t sbp_code_biases_content_encoded_len( + const sbp_code_biases_content_t *msg) { (void)msg; return SBP_CODE_BIASES_CONTENT_ENCODED_LEN; } @@ -74,74 +71,96 @@ static inline size_t sbp_code_biases_content_encoded_len(const sbp_code_biases_c /** * Encode an instance of sbp_code_biases_content_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_code_biases_content_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_code_biases_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_code_biases_content_t *msg); +SBP_EXPORT s8 +sbp_code_biases_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_code_biases_content_t *msg); /** * Decode an instance of sbp_code_biases_content_t from wire representation * - * This function decodes the wire representation of a sbp_code_biases_content_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_code_biases_content_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_code_biases_content_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_code_biases_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_code_biases_content_t *msg); +SBP_EXPORT s8 sbp_code_biases_content_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_code_biases_content_t *msg); /** * Compare two instances of sbp_code_biases_content_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_code_biases_content_t instance * @param b sbp_code_biases_content_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_code_biases_content_cmp(const sbp_code_biases_content_t *a, const sbp_code_biases_content_t *b); +SBP_EXPORT int sbp_code_biases_content_cmp(const sbp_code_biases_content_t *a, + const sbp_code_biases_content_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_code_biases_content_t &lhs, const sbp_code_biases_content_t &rhs) { +static inline bool operator==(const sbp_code_biases_content_t &lhs, + const sbp_code_biases_content_t &rhs) { return sbp_code_biases_content_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_code_biases_content_t &lhs, const sbp_code_biases_content_t &rhs) { +static inline bool operator!=(const sbp_code_biases_content_t &lhs, + const sbp_code_biases_content_t &rhs) { return sbp_code_biases_content_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_code_biases_content_t &lhs, const sbp_code_biases_content_t &rhs) { +static inline bool operator<(const sbp_code_biases_content_t &lhs, + const sbp_code_biases_content_t &rhs) { return sbp_code_biases_content_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_code_biases_content_t &lhs, const sbp_code_biases_content_t &rhs) { +static inline bool operator<=(const sbp_code_biases_content_t &lhs, + const sbp_code_biases_content_t &rhs) { return sbp_code_biases_content_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_code_biases_content_t &lhs, const sbp_code_biases_content_t &rhs) { +static inline bool operator>(const sbp_code_biases_content_t &lhs, + const sbp_code_biases_content_t &rhs) { return sbp_code_biases_content_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_code_biases_content_t &lhs, const sbp_code_biases_content_t &rhs) { +static inline bool operator>=(const sbp_code_biases_content_t &lhs, + const sbp_code_biases_content_t &rhs) { return sbp_code_biases_content_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_CODEBIASESCONTENT_H */ - diff --git a/c/include/libsbp/ssr/CodePhaseBiasesSatSig.h b/c/include/libsbp/ssr/CodePhaseBiasesSatSig.h index b3439d7f0..40ca111bc 100644 --- a/c/include/libsbp/ssr/CodePhaseBiasesSatSig.h +++ b/c/include/libsbp/ssr/CodePhaseBiasesSatSig.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SSR_CODEPHASEBIASESSATSIG_H #define LIBSBP_SSR_CODEPHASEBIASESSATSIG_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -39,54 +39,47 @@ * *****************************************************************************/ typedef struct { - - /** - * Satellite ID. Similar to either RTCM DF068 (GPS), DF252 (Galileo), or DF488 (BDS) depending on the constellation. + * Satellite ID. Similar to either RTCM DF068 (GPS), DF252 (Galileo), or DF488 + * (BDS) depending on the constellation. */ u8 sat_id; - /** - * Signal and Tracking Mode Identifier. Similar to either RTCM DF380 (GPS), DF382 (Galileo) or DF467 (BDS) depending on the constellation. + * Signal and Tracking Mode Identifier. Similar to either RTCM DF380 (GPS), + * DF382 (Galileo) or DF467 (BDS) depending on the constellation. */ u8 signal_id; - /** - * Code Bias Mean. Range: 0-1.275 m [0.005 m] + * Code Bias Mean. Range: 0-1.275 m [0.005 m] */ u8 code_bias_bound_mu; - /** - * Code Bias Standard Deviation. Range: 0-1.275 m [0.005 m] + * Code Bias Standard Deviation. Range: 0-1.275 m [0.005 m] */ u8 code_bias_bound_sig; - /** - * Phase Bias Mean. Range: 0-1.275 m [0.005 m] + * Phase Bias Mean. Range: 0-1.275 m [0.005 m] */ u8 phase_bias_bound_mu; - /** - * Phase Bias Standard Deviation. Range: 0-1.275 m [0.005 m] + * Phase Bias Standard Deviation. Range: 0-1.275 m [0.005 m] */ u8 phase_bias_bound_sig; } sbp_code_phase_biases_sat_sig_t; - - /** * Get encoded size of an instance of sbp_code_phase_biases_sat_sig_t * * @param msg sbp_code_phase_biases_sat_sig_t instance * @return Length of on-wire representation */ -static inline size_t sbp_code_phase_biases_sat_sig_encoded_len(const sbp_code_phase_biases_sat_sig_t *msg) -{ +static inline size_t sbp_code_phase_biases_sat_sig_encoded_len( + const sbp_code_phase_biases_sat_sig_t *msg) { (void)msg; return SBP_CODE_PHASE_BIASES_SAT_SIG_ENCODED_LEN; } @@ -94,74 +87,99 @@ static inline size_t sbp_code_phase_biases_sat_sig_encoded_len(const sbp_code_ph /** * Encode an instance of sbp_code_phase_biases_sat_sig_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_code_phase_biases_sat_sig_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_code_phase_biases_sat_sig_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_code_phase_biases_sat_sig_t *msg); +SBP_EXPORT s8 sbp_code_phase_biases_sat_sig_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_code_phase_biases_sat_sig_t *msg); /** - * Decode an instance of sbp_code_phase_biases_sat_sig_t from wire representation + * Decode an instance of sbp_code_phase_biases_sat_sig_t from wire + * representation * - * This function decodes the wire representation of a sbp_code_phase_biases_sat_sig_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_code_phase_biases_sat_sig_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_code_phase_biases_sat_sig_t instance + * @param buf Wire representation of the sbp_code_phase_biases_sat_sig_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_code_phase_biases_sat_sig_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_code_phase_biases_sat_sig_t *msg); +SBP_EXPORT s8 sbp_code_phase_biases_sat_sig_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_code_phase_biases_sat_sig_t *msg); /** * Compare two instances of sbp_code_phase_biases_sat_sig_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_code_phase_biases_sat_sig_t instance * @param b sbp_code_phase_biases_sat_sig_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_code_phase_biases_sat_sig_cmp(const sbp_code_phase_biases_sat_sig_t *a, const sbp_code_phase_biases_sat_sig_t *b); +SBP_EXPORT int sbp_code_phase_biases_sat_sig_cmp( + const sbp_code_phase_biases_sat_sig_t *a, + const sbp_code_phase_biases_sat_sig_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_code_phase_biases_sat_sig_t &lhs, const sbp_code_phase_biases_sat_sig_t &rhs) { +static inline bool operator==(const sbp_code_phase_biases_sat_sig_t &lhs, + const sbp_code_phase_biases_sat_sig_t &rhs) { return sbp_code_phase_biases_sat_sig_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_code_phase_biases_sat_sig_t &lhs, const sbp_code_phase_biases_sat_sig_t &rhs) { +static inline bool operator!=(const sbp_code_phase_biases_sat_sig_t &lhs, + const sbp_code_phase_biases_sat_sig_t &rhs) { return sbp_code_phase_biases_sat_sig_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_code_phase_biases_sat_sig_t &lhs, const sbp_code_phase_biases_sat_sig_t &rhs) { +static inline bool operator<(const sbp_code_phase_biases_sat_sig_t &lhs, + const sbp_code_phase_biases_sat_sig_t &rhs) { return sbp_code_phase_biases_sat_sig_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_code_phase_biases_sat_sig_t &lhs, const sbp_code_phase_biases_sat_sig_t &rhs) { +static inline bool operator<=(const sbp_code_phase_biases_sat_sig_t &lhs, + const sbp_code_phase_biases_sat_sig_t &rhs) { return sbp_code_phase_biases_sat_sig_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_code_phase_biases_sat_sig_t &lhs, const sbp_code_phase_biases_sat_sig_t &rhs) { +static inline bool operator>(const sbp_code_phase_biases_sat_sig_t &lhs, + const sbp_code_phase_biases_sat_sig_t &rhs) { return sbp_code_phase_biases_sat_sig_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_code_phase_biases_sat_sig_t &lhs, const sbp_code_phase_biases_sat_sig_t &rhs) { +static inline bool operator>=(const sbp_code_phase_biases_sat_sig_t &lhs, + const sbp_code_phase_biases_sat_sig_t &rhs) { return sbp_code_phase_biases_sat_sig_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_CODEPHASEBIASESSATSIG_H */ - diff --git a/c/include/libsbp/ssr/GridDefinitionHeaderDepA.h b/c/include/libsbp/ssr/GridDefinitionHeaderDepA.h index 4c9d89753..8339c43f3 100644 --- a/c/include/libsbp/ssr/GridDefinitionHeaderDepA.h +++ b/c/include/libsbp/ssr/GridDefinitionHeaderDepA.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SSR_GRIDDEFINITIONHEADERDEPA_H #define LIBSBP_SSR_GRIDDEFINITIONHEADERDEPA_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,132 +40,152 @@ *****************************************************************************/ /** Defines the grid for MSG_SSR_GRIDDED_CORRECTION messages * -* Defines the grid for MSG_SSR_GRIDDED_CORRECTION messages. Also includes an RLE encoded validity list. + * Defines the grid for MSG_SSR_GRIDDED_CORRECTION messages. Also includes an + * RLE encoded validity list. */ typedef struct { - - /** - * region_size (deg) = 10 / region_size_inverse 0 is an invalid value. [inverse degrees] + * region_size (deg) = 10 / region_size_inverse 0 is an invalid value. + * [inverse degrees] */ u8 region_size_inverse; - /** - * grid height (deg) = grid width (deg) = area_width / region_size 0 is an invalid value. + * grid height (deg) = grid width (deg) = area_width / region_size 0 is an + * invalid value. */ u16 area_width; - /** -* North-West corner latitude (deg) = region_size * lat_nw_corner_enc - 90 + * North-West corner latitude (deg) = region_size * lat_nw_corner_enc - 90 */ u16 lat_nw_corner_enc; - /** -* North-West corner longitude (deg) = region_size * lon_nw_corner_enc - 180 + * North-West corner longitude (deg) = region_size * lon_nw_corner_enc - 180 */ u16 lon_nw_corner_enc; - /** -* Number of messages in the dataset + * Number of messages in the dataset */ u8 num_msgs; - /** -* Position of this message in the dataset + * Position of this message in the dataset */ u8 seq_num; } sbp_grid_definition_header_dep_a_t; - - /** * Get encoded size of an instance of sbp_grid_definition_header_dep_a_t * * @param msg sbp_grid_definition_header_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_grid_definition_header_dep_a_encoded_len(const sbp_grid_definition_header_dep_a_t *msg) -{ +static inline size_t sbp_grid_definition_header_dep_a_encoded_len( + const sbp_grid_definition_header_dep_a_t *msg) { (void)msg; return SBP_GRID_DEFINITION_HEADER_DEP_A_ENCODED_LEN; } /** - * Encode an instance of sbp_grid_definition_header_dep_a_t to wire representation + * Encode an instance of sbp_grid_definition_header_dep_a_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_grid_definition_header_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_grid_definition_header_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_grid_definition_header_dep_a_t *msg); +SBP_EXPORT s8 sbp_grid_definition_header_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_grid_definition_header_dep_a_t *msg); /** - * Decode an instance of sbp_grid_definition_header_dep_a_t from wire representation + * Decode an instance of sbp_grid_definition_header_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_grid_definition_header_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_grid_definition_header_dep_a_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_grid_definition_header_dep_a_t instance + * @param buf Wire representation of the sbp_grid_definition_header_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_grid_definition_header_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_grid_definition_header_dep_a_t *msg); +SBP_EXPORT s8 sbp_grid_definition_header_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_grid_definition_header_dep_a_t *msg); /** * Compare two instances of sbp_grid_definition_header_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_grid_definition_header_dep_a_t instance * @param b sbp_grid_definition_header_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_grid_definition_header_dep_a_cmp(const sbp_grid_definition_header_dep_a_t *a, const sbp_grid_definition_header_dep_a_t *b); +SBP_EXPORT int sbp_grid_definition_header_dep_a_cmp( + const sbp_grid_definition_header_dep_a_t *a, + const sbp_grid_definition_header_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_grid_definition_header_dep_a_t &lhs, const sbp_grid_definition_header_dep_a_t &rhs) { +static inline bool operator==(const sbp_grid_definition_header_dep_a_t &lhs, + const sbp_grid_definition_header_dep_a_t &rhs) { return sbp_grid_definition_header_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_grid_definition_header_dep_a_t &lhs, const sbp_grid_definition_header_dep_a_t &rhs) { +static inline bool operator!=(const sbp_grid_definition_header_dep_a_t &lhs, + const sbp_grid_definition_header_dep_a_t &rhs) { return sbp_grid_definition_header_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_grid_definition_header_dep_a_t &lhs, const sbp_grid_definition_header_dep_a_t &rhs) { +static inline bool operator<(const sbp_grid_definition_header_dep_a_t &lhs, + const sbp_grid_definition_header_dep_a_t &rhs) { return sbp_grid_definition_header_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_grid_definition_header_dep_a_t &lhs, const sbp_grid_definition_header_dep_a_t &rhs) { +static inline bool operator<=(const sbp_grid_definition_header_dep_a_t &lhs, + const sbp_grid_definition_header_dep_a_t &rhs) { return sbp_grid_definition_header_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_grid_definition_header_dep_a_t &lhs, const sbp_grid_definition_header_dep_a_t &rhs) { +static inline bool operator>(const sbp_grid_definition_header_dep_a_t &lhs, + const sbp_grid_definition_header_dep_a_t &rhs) { return sbp_grid_definition_header_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_grid_definition_header_dep_a_t &lhs, const sbp_grid_definition_header_dep_a_t &rhs) { +static inline bool operator>=(const sbp_grid_definition_header_dep_a_t &lhs, + const sbp_grid_definition_header_dep_a_t &rhs) { return sbp_grid_definition_header_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_GRIDDEFINITIONHEADERDEPA_H */ - diff --git a/c/include/libsbp/ssr/GriddedCorrectionHeader.h b/c/include/libsbp/ssr/GriddedCorrectionHeader.h index 09b169af6..e7854670d 100644 --- a/c/include/libsbp/ssr/GriddedCorrectionHeader.h +++ b/c/include/libsbp/ssr/GriddedCorrectionHeader.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SSR_GRIDDEDCORRECTIONHEADER_H #define LIBSBP_SSR_GRIDDEDCORRECTIONHEADER_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,69 +41,61 @@ *****************************************************************************/ /** Header for the MSG_SSR_GRIDDED_CORRECTION message * -* The LPP message contains nested variable length arrays which are not supported in SBP, so each grid point will be identified by the index. + * The LPP message contains nested variable length arrays which are not + * supported in SBP, so each grid point will be identified by the index. */ typedef struct { - - /** -* Unique identifier of the tile set this tile belongs to. + * Unique identifier of the tile set this tile belongs to. */ u16 tile_set_id; - /** -* Unique identifier of this tile in the tile set. + * Unique identifier of this tile in the tile set. */ u16 tile_id; - /** -* GNSS reference time of the correction + * GNSS reference time of the correction */ sbp_gps_time_sec_t time; - /** -* Number of messages in the dataset + * Number of messages in the dataset */ u16 num_msgs; - /** -* Position of this message in the dataset + * Position of this message in the dataset */ u16 seq_num; - /** - * Update interval between consecutive corrections. Encoded following RTCM DF391 specification. + * Update interval between consecutive corrections. Encoded following RTCM + * DF391 specification. */ u8 update_interval; - /** - * IOD of the SSR atmospheric correction + * IOD of the SSR atmospheric correction */ u8 iod_atmo; - /** - * Quality of the troposphere data. Encoded following RTCM DF389 specification in units of m. + * Quality of the troposphere data. Encoded following RTCM DF389 specification + * in units of m. */ u8 tropo_quality_indicator; } sbp_gridded_correction_header_t; - - /** * Get encoded size of an instance of sbp_gridded_correction_header_t * * @param msg sbp_gridded_correction_header_t instance * @return Length of on-wire representation */ -static inline size_t sbp_gridded_correction_header_encoded_len(const sbp_gridded_correction_header_t *msg) -{ +static inline size_t sbp_gridded_correction_header_encoded_len( + const sbp_gridded_correction_header_t *msg) { (void)msg; return SBP_GRIDDED_CORRECTION_HEADER_ENCODED_LEN; } @@ -111,74 +103,99 @@ static inline size_t sbp_gridded_correction_header_encoded_len(const sbp_gridded /** * Encode an instance of sbp_gridded_correction_header_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_gridded_correction_header_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_gridded_correction_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_gridded_correction_header_t *msg); +SBP_EXPORT s8 sbp_gridded_correction_header_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_gridded_correction_header_t *msg); /** - * Decode an instance of sbp_gridded_correction_header_t from wire representation + * Decode an instance of sbp_gridded_correction_header_t from wire + * representation * - * This function decodes the wire representation of a sbp_gridded_correction_header_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_gridded_correction_header_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_gridded_correction_header_t instance + * @param buf Wire representation of the sbp_gridded_correction_header_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_gridded_correction_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_gridded_correction_header_t *msg); +SBP_EXPORT s8 sbp_gridded_correction_header_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_gridded_correction_header_t *msg); /** * Compare two instances of sbp_gridded_correction_header_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_gridded_correction_header_t instance * @param b sbp_gridded_correction_header_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_gridded_correction_header_cmp(const sbp_gridded_correction_header_t *a, const sbp_gridded_correction_header_t *b); +SBP_EXPORT int sbp_gridded_correction_header_cmp( + const sbp_gridded_correction_header_t *a, + const sbp_gridded_correction_header_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_gridded_correction_header_t &lhs, const sbp_gridded_correction_header_t &rhs) { +static inline bool operator==(const sbp_gridded_correction_header_t &lhs, + const sbp_gridded_correction_header_t &rhs) { return sbp_gridded_correction_header_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_gridded_correction_header_t &lhs, const sbp_gridded_correction_header_t &rhs) { +static inline bool operator!=(const sbp_gridded_correction_header_t &lhs, + const sbp_gridded_correction_header_t &rhs) { return sbp_gridded_correction_header_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_gridded_correction_header_t &lhs, const sbp_gridded_correction_header_t &rhs) { +static inline bool operator<(const sbp_gridded_correction_header_t &lhs, + const sbp_gridded_correction_header_t &rhs) { return sbp_gridded_correction_header_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_gridded_correction_header_t &lhs, const sbp_gridded_correction_header_t &rhs) { +static inline bool operator<=(const sbp_gridded_correction_header_t &lhs, + const sbp_gridded_correction_header_t &rhs) { return sbp_gridded_correction_header_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_gridded_correction_header_t &lhs, const sbp_gridded_correction_header_t &rhs) { +static inline bool operator>(const sbp_gridded_correction_header_t &lhs, + const sbp_gridded_correction_header_t &rhs) { return sbp_gridded_correction_header_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_gridded_correction_header_t &lhs, const sbp_gridded_correction_header_t &rhs) { +static inline bool operator>=(const sbp_gridded_correction_header_t &lhs, + const sbp_gridded_correction_header_t &rhs) { return sbp_gridded_correction_header_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_GRIDDEDCORRECTIONHEADER_H */ - diff --git a/c/include/libsbp/ssr/GriddedCorrectionHeaderDepA.h b/c/include/libsbp/ssr/GriddedCorrectionHeaderDepA.h index fff0fee55..a783f55e5 100644 --- a/c/include/libsbp/ssr/GriddedCorrectionHeaderDepA.h +++ b/c/include/libsbp/ssr/GriddedCorrectionHeaderDepA.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SSR_GRIDDEDCORRECTIONHEADERDEPA_H #define LIBSBP_SSR_GRIDDEDCORRECTIONHEADERDEPA_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,132 +41,157 @@ *****************************************************************************/ /** Header for MSG_SSR_GRIDDED_CORRECTION_DEP * -* The 3GPP message contains nested variable length arrays which are not supported in SBP, so each grid point will be identified by the index. + * The 3GPP message contains nested variable length arrays which are not + * supported in SBP, so each grid point will be identified by the index. */ typedef struct { - - /** -* GNSS reference time of the correction + * GNSS reference time of the correction */ sbp_gps_time_sec_t time; - /** -* Number of messages in the dataset + * Number of messages in the dataset */ u16 num_msgs; - /** -* Position of this message in the dataset + * Position of this message in the dataset */ u16 seq_num; - /** - * Update interval between consecutive corrections. Encoded following RTCM DF391 specification. + * Update interval between consecutive corrections. Encoded following RTCM + * DF391 specification. */ u8 update_interval; - /** - * IOD of the SSR atmospheric correction + * IOD of the SSR atmospheric correction */ u8 iod_atmo; - /** - * Quality of the troposphere data. Encoded following RTCM DF389 specification in units of m. + * Quality of the troposphere data. Encoded following RTCM DF389 specification + * in units of m. */ u8 tropo_quality_indicator; } sbp_gridded_correction_header_dep_a_t; - - /** * Get encoded size of an instance of sbp_gridded_correction_header_dep_a_t * * @param msg sbp_gridded_correction_header_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_gridded_correction_header_dep_a_encoded_len(const sbp_gridded_correction_header_dep_a_t *msg) -{ +static inline size_t sbp_gridded_correction_header_dep_a_encoded_len( + const sbp_gridded_correction_header_dep_a_t *msg) { (void)msg; return SBP_GRIDDED_CORRECTION_HEADER_DEP_A_ENCODED_LEN; } /** - * Encode an instance of sbp_gridded_correction_header_dep_a_t to wire representation + * Encode an instance of sbp_gridded_correction_header_dep_a_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_gridded_correction_header_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_gridded_correction_header_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_gridded_correction_header_dep_a_t *msg); +SBP_EXPORT s8 sbp_gridded_correction_header_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_gridded_correction_header_dep_a_t *msg); /** - * Decode an instance of sbp_gridded_correction_header_dep_a_t from wire representation + * Decode an instance of sbp_gridded_correction_header_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_gridded_correction_header_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_gridded_correction_header_dep_a_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_gridded_correction_header_dep_a_t instance + * @param buf Wire representation of the sbp_gridded_correction_header_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_gridded_correction_header_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_gridded_correction_header_dep_a_t *msg); +SBP_EXPORT s8 sbp_gridded_correction_header_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_gridded_correction_header_dep_a_t *msg); /** * Compare two instances of sbp_gridded_correction_header_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_gridded_correction_header_dep_a_t instance * @param b sbp_gridded_correction_header_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_gridded_correction_header_dep_a_cmp(const sbp_gridded_correction_header_dep_a_t *a, const sbp_gridded_correction_header_dep_a_t *b); +SBP_EXPORT int sbp_gridded_correction_header_dep_a_cmp( + const sbp_gridded_correction_header_dep_a_t *a, + const sbp_gridded_correction_header_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_gridded_correction_header_dep_a_t &lhs, const sbp_gridded_correction_header_dep_a_t &rhs) { +static inline bool operator==( + const sbp_gridded_correction_header_dep_a_t &lhs, + const sbp_gridded_correction_header_dep_a_t &rhs) { return sbp_gridded_correction_header_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_gridded_correction_header_dep_a_t &lhs, const sbp_gridded_correction_header_dep_a_t &rhs) { +static inline bool operator!=( + const sbp_gridded_correction_header_dep_a_t &lhs, + const sbp_gridded_correction_header_dep_a_t &rhs) { return sbp_gridded_correction_header_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_gridded_correction_header_dep_a_t &lhs, const sbp_gridded_correction_header_dep_a_t &rhs) { +static inline bool operator<(const sbp_gridded_correction_header_dep_a_t &lhs, + const sbp_gridded_correction_header_dep_a_t &rhs) { return sbp_gridded_correction_header_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_gridded_correction_header_dep_a_t &lhs, const sbp_gridded_correction_header_dep_a_t &rhs) { +static inline bool operator<=( + const sbp_gridded_correction_header_dep_a_t &lhs, + const sbp_gridded_correction_header_dep_a_t &rhs) { return sbp_gridded_correction_header_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_gridded_correction_header_dep_a_t &lhs, const sbp_gridded_correction_header_dep_a_t &rhs) { +static inline bool operator>(const sbp_gridded_correction_header_dep_a_t &lhs, + const sbp_gridded_correction_header_dep_a_t &rhs) { return sbp_gridded_correction_header_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_gridded_correction_header_dep_a_t &lhs, const sbp_gridded_correction_header_dep_a_t &rhs) { +static inline bool operator>=( + const sbp_gridded_correction_header_dep_a_t &lhs, + const sbp_gridded_correction_header_dep_a_t &rhs) { return sbp_gridded_correction_header_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_GRIDDEDCORRECTIONHEADERDEPA_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_CODE_BIASES.h b/c/include/libsbp/ssr/MSG_SSR_CODE_BIASES.h index 0e873a6a8..c2a7125a3 100644 --- a/c/include/libsbp/ssr/MSG_SSR_CODE_BIASES.h +++ b/c/include/libsbp/ssr/MSG_SSR_CODE_BIASES.h @@ -18,22 +18,22 @@ #ifndef LIBSBP_SSR_MSG_SSR_CODE_BIASES_H #define LIBSBP_SSR_MSG_SSR_CODE_BIASES_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -43,97 +43,112 @@ *****************************************************************************/ /** Precise code biases correction * -* The precise code biases message is to be added to the pseudorange of the corresponding signal to get corrected pseudorange. It is an equivalent to the 1059 / 1065 RTCM message types. + * The precise code biases message is to be added to the pseudorange of the + * corresponding signal to get corrected pseudorange. It is an equivalent to the + * 1059 / 1065 RTCM message types. */ typedef struct { - - /** -* GNSS reference time of the correction + * GNSS reference time of the correction */ sbp_gps_time_sec_t time; - /** -* GNSS signal identifier (16 bit) + * GNSS signal identifier (16 bit) */ sbp_v4_gnss_signal_t sid; - /** - * Update interval between consecutive corrections. Encoded following RTCM DF391 specification. + * Update interval between consecutive corrections. Encoded following RTCM + * DF391 specification. */ u8 update_interval; - /** - * IOD of the SSR correction. A change of Issue Of Data SSR is used to indicate a change in the SSR generating configuration + * IOD of the SSR correction. A change of Issue Of Data SSR is used to + * indicate a change in the SSR generating configuration */ u8 iod_ssr; - /** -* Code biases for the different satellite signals + * Code biases for the different satellite signals */ sbp_code_biases_content_t biases[SBP_MSG_SSR_CODE_BIASES_BIASES_MAX]; /** * Number of elements in biases * - * When sending a message fill in this field with the number elements set in biases before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * biases before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in biases. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * biases. The value of any elements beyond the index specified in this field + * is undefined */ u8 n_biases; } sbp_msg_ssr_code_biases_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_code_biases_t * * @param msg sbp_msg_ssr_code_biases_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_code_biases_encoded_len(const sbp_msg_ssr_code_biases_t *msg) -{ - return SBP_MSG_SSR_CODE_BIASES_ENCODED_OVERHEAD - + (msg->n_biases * SBP_CODE_BIASES_CONTENT_ENCODED_LEN) - ; +static inline size_t sbp_msg_ssr_code_biases_encoded_len( + const sbp_msg_ssr_code_biases_t *msg) { + return SBP_MSG_SSR_CODE_BIASES_ENCODED_OVERHEAD + + (msg->n_biases * SBP_CODE_BIASES_CONTENT_ENCODED_LEN); } /** * Encode an instance of sbp_msg_ssr_code_biases_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_code_biases_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_code_biases_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_code_biases_t *msg); +SBP_EXPORT s8 +sbp_msg_ssr_code_biases_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_code_biases_t *msg); /** * Decode an instance of sbp_msg_ssr_code_biases_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ssr_code_biases_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ssr_code_biases_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ssr_code_biases_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_code_biases_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_code_biases_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_code_biases_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ssr_code_biases_t *msg); /** * Send an instance of sbp_msg_ssr_code_biases_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_code_biases_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_code_biases_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -141,51 +156,61 @@ SBP_EXPORT s8 sbp_msg_ssr_code_biases_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_code_biases_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_code_biases_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_code_biases_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_code_biases_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_code_biases_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_code_biases_t instance * @param b sbp_msg_ssr_code_biases_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_code_biases_cmp(const sbp_msg_ssr_code_biases_t *a, const sbp_msg_ssr_code_biases_t *b); +SBP_EXPORT int sbp_msg_ssr_code_biases_cmp(const sbp_msg_ssr_code_biases_t *a, + const sbp_msg_ssr_code_biases_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_code_biases_t &lhs, const sbp_msg_ssr_code_biases_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_code_biases_t &lhs, + const sbp_msg_ssr_code_biases_t &rhs) { return sbp_msg_ssr_code_biases_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_code_biases_t &lhs, const sbp_msg_ssr_code_biases_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_code_biases_t &lhs, + const sbp_msg_ssr_code_biases_t &rhs) { return sbp_msg_ssr_code_biases_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_code_biases_t &lhs, const sbp_msg_ssr_code_biases_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_code_biases_t &lhs, + const sbp_msg_ssr_code_biases_t &rhs) { return sbp_msg_ssr_code_biases_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_code_biases_t &lhs, const sbp_msg_ssr_code_biases_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_code_biases_t &lhs, + const sbp_msg_ssr_code_biases_t &rhs) { return sbp_msg_ssr_code_biases_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_code_biases_t &lhs, const sbp_msg_ssr_code_biases_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_code_biases_t &lhs, + const sbp_msg_ssr_code_biases_t &rhs) { return sbp_msg_ssr_code_biases_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_code_biases_t &lhs, const sbp_msg_ssr_code_biases_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_code_biases_t &lhs, + const sbp_msg_ssr_code_biases_t &rhs) { return sbp_msg_ssr_code_biases_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_CODE_BIASES_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_CODE_PHASE_BIASES_BOUNDS.h b/c/include/libsbp/ssr/MSG_SSR_CODE_PHASE_BIASES_BOUNDS.h index 4d490f812..ad99157dd 100644 --- a/c/include/libsbp/ssr/MSG_SSR_CODE_PHASE_BIASES_BOUNDS.h +++ b/c/include/libsbp/ssr/MSG_SSR_CODE_PHASE_BIASES_BOUNDS.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_SSR_MSG_SSR_CODE_PHASE_BIASES_BOUNDS_H #define LIBSBP_SSR_MSG_SSR_CODE_PHASE_BIASES_BOUNDS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,86 +41,100 @@ * *****************************************************************************/ typedef struct { - - /** -* Header of a bounds message. + * Header of a bounds message. */ sbp_bounds_header_t header; - /** -* IOD of the SSR bound. + * IOD of the SSR bound. */ u8 ssr_iod; - /** -* Constellation ID to which the SVs belong. + * Constellation ID to which the SVs belong. */ u8 const_id; - /** -* Number of satellite-signal couples. + * Number of satellite-signal couples. */ u8 n_sats_signals; - /** -* Code and Phase Biases Bounds per Satellite-Signal couple. + * Code and Phase Biases Bounds per Satellite-Signal couple. */ - sbp_code_phase_biases_sat_sig_t satellites_signals[SBP_MSG_SSR_CODE_PHASE_BIASES_BOUNDS_SATELLITES_SIGNALS_MAX]; + sbp_code_phase_biases_sat_sig_t satellites_signals + [SBP_MSG_SSR_CODE_PHASE_BIASES_BOUNDS_SATELLITES_SIGNALS_MAX]; } sbp_msg_ssr_code_phase_biases_bounds_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_code_phase_biases_bounds_t * * @param msg sbp_msg_ssr_code_phase_biases_bounds_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_code_phase_biases_bounds_encoded_len(const sbp_msg_ssr_code_phase_biases_bounds_t *msg) -{ - return SBP_MSG_SSR_CODE_PHASE_BIASES_BOUNDS_ENCODED_OVERHEAD - + (msg->n_sats_signals * SBP_CODE_PHASE_BIASES_SAT_SIG_ENCODED_LEN) - ; +static inline size_t sbp_msg_ssr_code_phase_biases_bounds_encoded_len( + const sbp_msg_ssr_code_phase_biases_bounds_t *msg) { + return SBP_MSG_SSR_CODE_PHASE_BIASES_BOUNDS_ENCODED_OVERHEAD + + (msg->n_sats_signals * SBP_CODE_PHASE_BIASES_SAT_SIG_ENCODED_LEN); } /** - * Encode an instance of sbp_msg_ssr_code_phase_biases_bounds_t to wire representation + * Encode an instance of sbp_msg_ssr_code_phase_biases_bounds_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_code_phase_biases_bounds_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_code_phase_biases_bounds_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_code_phase_biases_bounds_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_code_phase_biases_bounds_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_code_phase_biases_bounds_t *msg); /** - * Decode an instance of sbp_msg_ssr_code_phase_biases_bounds_t from wire representation + * Decode an instance of sbp_msg_ssr_code_phase_biases_bounds_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_code_phase_biases_bounds_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_code_phase_biases_bounds_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_ssr_code_phase_biases_bounds_t instance + * @param buf Wire representation of the sbp_msg_ssr_code_phase_biases_bounds_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_code_phase_biases_bounds_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_code_phase_biases_bounds_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_code_phase_biases_bounds_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_code_phase_biases_bounds_t *msg); /** - * Send an instance of sbp_msg_ssr_code_phase_biases_bounds_t with the given write function + * Send an instance of sbp_msg_ssr_code_phase_biases_bounds_t with the given + * write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_code_phase_biases_bounds_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_code_phase_biases_bounds_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -128,51 +142,68 @@ SBP_EXPORT s8 sbp_msg_ssr_code_phase_biases_bounds_decode(const uint8_t *buf, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_code_phase_biases_bounds_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_code_phase_biases_bounds_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_code_phase_biases_bounds_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_code_phase_biases_bounds_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_code_phase_biases_bounds_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_code_phase_biases_bounds_t instance * @param b sbp_msg_ssr_code_phase_biases_bounds_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_code_phase_biases_bounds_cmp(const sbp_msg_ssr_code_phase_biases_bounds_t *a, const sbp_msg_ssr_code_phase_biases_bounds_t *b); +SBP_EXPORT int sbp_msg_ssr_code_phase_biases_bounds_cmp( + const sbp_msg_ssr_code_phase_biases_bounds_t *a, + const sbp_msg_ssr_code_phase_biases_bounds_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_code_phase_biases_bounds_t &lhs, const sbp_msg_ssr_code_phase_biases_bounds_t &rhs) { +static inline bool operator==( + const sbp_msg_ssr_code_phase_biases_bounds_t &lhs, + const sbp_msg_ssr_code_phase_biases_bounds_t &rhs) { return sbp_msg_ssr_code_phase_biases_bounds_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_code_phase_biases_bounds_t &lhs, const sbp_msg_ssr_code_phase_biases_bounds_t &rhs) { +static inline bool operator!=( + const sbp_msg_ssr_code_phase_biases_bounds_t &lhs, + const sbp_msg_ssr_code_phase_biases_bounds_t &rhs) { return sbp_msg_ssr_code_phase_biases_bounds_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_code_phase_biases_bounds_t &lhs, const sbp_msg_ssr_code_phase_biases_bounds_t &rhs) { +static inline bool operator<( + const sbp_msg_ssr_code_phase_biases_bounds_t &lhs, + const sbp_msg_ssr_code_phase_biases_bounds_t &rhs) { return sbp_msg_ssr_code_phase_biases_bounds_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_code_phase_biases_bounds_t &lhs, const sbp_msg_ssr_code_phase_biases_bounds_t &rhs) { +static inline bool operator<=( + const sbp_msg_ssr_code_phase_biases_bounds_t &lhs, + const sbp_msg_ssr_code_phase_biases_bounds_t &rhs) { return sbp_msg_ssr_code_phase_biases_bounds_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_code_phase_biases_bounds_t &lhs, const sbp_msg_ssr_code_phase_biases_bounds_t &rhs) { +static inline bool operator>( + const sbp_msg_ssr_code_phase_biases_bounds_t &lhs, + const sbp_msg_ssr_code_phase_biases_bounds_t &rhs) { return sbp_msg_ssr_code_phase_biases_bounds_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_code_phase_biases_bounds_t &lhs, const sbp_msg_ssr_code_phase_biases_bounds_t &rhs) { +static inline bool operator>=( + const sbp_msg_ssr_code_phase_biases_bounds_t &lhs, + const sbp_msg_ssr_code_phase_biases_bounds_t &rhs) { return sbp_msg_ssr_code_phase_biases_bounds_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_CODE_PHASE_BIASES_BOUNDS_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION.h b/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION.h index 558d813e6..65bbbed29 100644 --- a/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION.h +++ b/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION.h @@ -18,22 +18,22 @@ #ifndef LIBSBP_SSR_MSG_SSR_GRIDDED_CORRECTION_H #define LIBSBP_SSR_MSG_SSR_GRIDDED_CORRECTION_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -44,91 +44,107 @@ /** Gridded troposphere and STEC correction residuals * * STEC residuals are per space vehicle, troposphere is not. - * + * */ typedef struct { - - /** -* Header of a gridded correction message + * Header of a gridded correction message */ sbp_gridded_correction_header_t header; - /** -* Index of the grid point. + * Index of the grid point. */ u16 index; - /** -* Wet and hydrostatic vertical delays (mean, stddev). + * Wet and hydrostatic vertical delays (mean, stddev). */ sbp_tropospheric_delay_correction_t tropo_delay_correction; - /** -* STEC residuals for each satellite (mean, stddev). + * STEC residuals for each satellite (mean, stddev). */ - sbp_stec_residual_t stec_residuals[SBP_MSG_SSR_GRIDDED_CORRECTION_STEC_RESIDUALS_MAX]; + sbp_stec_residual_t + stec_residuals[SBP_MSG_SSR_GRIDDED_CORRECTION_STEC_RESIDUALS_MAX]; /** * Number of elements in stec_residuals * - * When sending a message fill in this field with the number elements set in stec_residuals before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * stec_residuals before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in stec_residuals. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * stec_residuals. The value of any elements beyond the index specified in + * this field is undefined */ u8 n_stec_residuals; } sbp_msg_ssr_gridded_correction_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_gridded_correction_t * * @param msg sbp_msg_ssr_gridded_correction_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_gridded_correction_encoded_len(const sbp_msg_ssr_gridded_correction_t *msg) -{ - return SBP_MSG_SSR_GRIDDED_CORRECTION_ENCODED_OVERHEAD - + (msg->n_stec_residuals * SBP_STEC_RESIDUAL_ENCODED_LEN) - ; +static inline size_t sbp_msg_ssr_gridded_correction_encoded_len( + const sbp_msg_ssr_gridded_correction_t *msg) { + return SBP_MSG_SSR_GRIDDED_CORRECTION_ENCODED_OVERHEAD + + (msg->n_stec_residuals * SBP_STEC_RESIDUAL_ENCODED_LEN); } /** * Encode an instance of sbp_msg_ssr_gridded_correction_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_gridded_correction_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_gridded_correction_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_gridded_correction_t *msg); /** - * Decode an instance of sbp_msg_ssr_gridded_correction_t from wire representation + * Decode an instance of sbp_msg_ssr_gridded_correction_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_gridded_correction_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_gridded_correction_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ssr_gridded_correction_t instance + * @param buf Wire representation of the sbp_msg_ssr_gridded_correction_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_gridded_correction_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_gridded_correction_t *msg); /** - * Send an instance of sbp_msg_ssr_gridded_correction_t with the given write function + * Send an instance of sbp_msg_ssr_gridded_correction_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_gridded_correction_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_gridded_correction_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -136,51 +152,62 @@ SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_decode(const uint8_t *buf, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_gridded_correction_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_gridded_correction_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_gridded_correction_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_gridded_correction_t instance * @param b sbp_msg_ssr_gridded_correction_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_gridded_correction_cmp(const sbp_msg_ssr_gridded_correction_t *a, const sbp_msg_ssr_gridded_correction_t *b); +SBP_EXPORT int sbp_msg_ssr_gridded_correction_cmp( + const sbp_msg_ssr_gridded_correction_t *a, + const sbp_msg_ssr_gridded_correction_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_gridded_correction_t &lhs, const sbp_msg_ssr_gridded_correction_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_gridded_correction_t &lhs, + const sbp_msg_ssr_gridded_correction_t &rhs) { return sbp_msg_ssr_gridded_correction_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_gridded_correction_t &lhs, const sbp_msg_ssr_gridded_correction_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_gridded_correction_t &lhs, + const sbp_msg_ssr_gridded_correction_t &rhs) { return sbp_msg_ssr_gridded_correction_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_gridded_correction_t &lhs, const sbp_msg_ssr_gridded_correction_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_gridded_correction_t &lhs, + const sbp_msg_ssr_gridded_correction_t &rhs) { return sbp_msg_ssr_gridded_correction_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_gridded_correction_t &lhs, const sbp_msg_ssr_gridded_correction_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_gridded_correction_t &lhs, + const sbp_msg_ssr_gridded_correction_t &rhs) { return sbp_msg_ssr_gridded_correction_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_gridded_correction_t &lhs, const sbp_msg_ssr_gridded_correction_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_gridded_correction_t &lhs, + const sbp_msg_ssr_gridded_correction_t &rhs) { return sbp_msg_ssr_gridded_correction_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_gridded_correction_t &lhs, const sbp_msg_ssr_gridded_correction_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_gridded_correction_t &lhs, + const sbp_msg_ssr_gridded_correction_t &rhs) { return sbp_msg_ssr_gridded_correction_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_GRIDDED_CORRECTION_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION_BOUNDS.h b/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION_BOUNDS.h index 3a48e72a2..9d5ebcda6 100644 --- a/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION_BOUNDS.h +++ b/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION_BOUNDS.h @@ -18,22 +18,22 @@ #ifndef LIBSBP_SSR_MSG_SSR_GRIDDED_CORRECTION_BOUNDS_H #define LIBSBP_SSR_MSG_SSR_GRIDDED_CORRECTION_BOUNDS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -43,137 +43,145 @@ *****************************************************************************/ /** Gridded troposhere and STEC correction residuals bounds * -* Note 1: Range: 0-17.5 m. i<= 200, mean = 0.01i; 200230, mean=5+0.5(i-230). + * Note 1: Range: 0-17.5 m. i<= 200, mean = 0.01i; 200230, mean=5+0.5(i-230). */ typedef struct { - - /** -* Header of a bounds message. + * Header of a bounds message. */ sbp_bounds_header_t header; - /** -* IOD of the correction. + * IOD of the correction. */ u8 ssr_iod_atmo; - /** -* Set this tile belongs to. + * Set this tile belongs to. */ u16 tile_set_id; - /** -* Unique identifier of this tile in the tile set. + * Unique identifier of this tile in the tile set. */ u16 tile_id; - /** -* Tropo Quality Indicator. Similar to RTCM DF389. + * Tropo Quality Indicator. Similar to RTCM DF389. */ u8 tropo_qi; - /** -* Index of the Grid Point. + * Index of the Grid Point. */ u16 grid_point_id; - /** -* Tropospheric delay at grid point. + * Tropospheric delay at grid point. */ sbp_tropospheric_delay_correction_t tropo_delay_correction; - /** -* Vertical Hydrostatic Error Bound Mean. [0.005 m] + * Vertical Hydrostatic Error Bound Mean. [0.005 m] */ u8 tropo_v_hydro_bound_mu; - /** -* Vertical Hydrostatic Error Bound StDev. [0.005 m] + * Vertical Hydrostatic Error Bound StDev. [0.005 m] */ u8 tropo_v_hydro_bound_sig; - /** -* Vertical Wet Error Bound Mean. [0.005 m] + * Vertical Wet Error Bound Mean. [0.005 m] */ u8 tropo_v_wet_bound_mu; - /** -* Vertical Wet Error Bound StDev. [0.005 m] + * Vertical Wet Error Bound StDev. [0.005 m] */ u8 tropo_v_wet_bound_sig; - /** -* Number of satellites. + * Number of satellites. */ u8 n_sats; - /** -* Array of STEC polynomial coefficients and its bounds for each space vehicle. + * Array of STEC polynomial coefficients and its bounds for each space + * vehicle. */ - sbp_stec_sat_element_integrity_t stec_sat_list[SBP_MSG_SSR_GRIDDED_CORRECTION_BOUNDS_STEC_SAT_LIST_MAX]; + sbp_stec_sat_element_integrity_t + stec_sat_list[SBP_MSG_SSR_GRIDDED_CORRECTION_BOUNDS_STEC_SAT_LIST_MAX]; } sbp_msg_ssr_gridded_correction_bounds_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_gridded_correction_bounds_t * * @param msg sbp_msg_ssr_gridded_correction_bounds_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_gridded_correction_bounds_encoded_len(const sbp_msg_ssr_gridded_correction_bounds_t *msg) -{ - return SBP_MSG_SSR_GRIDDED_CORRECTION_BOUNDS_ENCODED_OVERHEAD - + (msg->n_sats * SBP_STEC_SAT_ELEMENT_INTEGRITY_ENCODED_LEN) - ; +static inline size_t sbp_msg_ssr_gridded_correction_bounds_encoded_len( + const sbp_msg_ssr_gridded_correction_bounds_t *msg) { + return SBP_MSG_SSR_GRIDDED_CORRECTION_BOUNDS_ENCODED_OVERHEAD + + (msg->n_sats * SBP_STEC_SAT_ELEMENT_INTEGRITY_ENCODED_LEN); } /** - * Encode an instance of sbp_msg_ssr_gridded_correction_bounds_t to wire representation + * Encode an instance of sbp_msg_ssr_gridded_correction_bounds_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_gridded_correction_bounds_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_bounds_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_gridded_correction_bounds_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_bounds_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_gridded_correction_bounds_t *msg); /** - * Decode an instance of sbp_msg_ssr_gridded_correction_bounds_t from wire representation + * Decode an instance of sbp_msg_ssr_gridded_correction_bounds_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_gridded_correction_bounds_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_gridded_correction_bounds_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_ssr_gridded_correction_bounds_t instance + * @param buf Wire representation of the sbp_msg_ssr_gridded_correction_bounds_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_bounds_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_gridded_correction_bounds_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_bounds_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_gridded_correction_bounds_t *msg); /** - * Send an instance of sbp_msg_ssr_gridded_correction_bounds_t with the given write function + * Send an instance of sbp_msg_ssr_gridded_correction_bounds_t with the given + * write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_gridded_correction_bounds_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_gridded_correction_bounds_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -181,51 +189,68 @@ SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_bounds_decode(const uint8_t *buf, u * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_bounds_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_gridded_correction_bounds_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_bounds_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_gridded_correction_bounds_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_gridded_correction_bounds_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_gridded_correction_bounds_t instance * @param b sbp_msg_ssr_gridded_correction_bounds_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_gridded_correction_bounds_cmp(const sbp_msg_ssr_gridded_correction_bounds_t *a, const sbp_msg_ssr_gridded_correction_bounds_t *b); +SBP_EXPORT int sbp_msg_ssr_gridded_correction_bounds_cmp( + const sbp_msg_ssr_gridded_correction_bounds_t *a, + const sbp_msg_ssr_gridded_correction_bounds_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_gridded_correction_bounds_t &lhs, const sbp_msg_ssr_gridded_correction_bounds_t &rhs) { +static inline bool operator==( + const sbp_msg_ssr_gridded_correction_bounds_t &lhs, + const sbp_msg_ssr_gridded_correction_bounds_t &rhs) { return sbp_msg_ssr_gridded_correction_bounds_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_gridded_correction_bounds_t &lhs, const sbp_msg_ssr_gridded_correction_bounds_t &rhs) { +static inline bool operator!=( + const sbp_msg_ssr_gridded_correction_bounds_t &lhs, + const sbp_msg_ssr_gridded_correction_bounds_t &rhs) { return sbp_msg_ssr_gridded_correction_bounds_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_gridded_correction_bounds_t &lhs, const sbp_msg_ssr_gridded_correction_bounds_t &rhs) { +static inline bool operator<( + const sbp_msg_ssr_gridded_correction_bounds_t &lhs, + const sbp_msg_ssr_gridded_correction_bounds_t &rhs) { return sbp_msg_ssr_gridded_correction_bounds_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_gridded_correction_bounds_t &lhs, const sbp_msg_ssr_gridded_correction_bounds_t &rhs) { +static inline bool operator<=( + const sbp_msg_ssr_gridded_correction_bounds_t &lhs, + const sbp_msg_ssr_gridded_correction_bounds_t &rhs) { return sbp_msg_ssr_gridded_correction_bounds_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_gridded_correction_bounds_t &lhs, const sbp_msg_ssr_gridded_correction_bounds_t &rhs) { +static inline bool operator>( + const sbp_msg_ssr_gridded_correction_bounds_t &lhs, + const sbp_msg_ssr_gridded_correction_bounds_t &rhs) { return sbp_msg_ssr_gridded_correction_bounds_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_gridded_correction_bounds_t &lhs, const sbp_msg_ssr_gridded_correction_bounds_t &rhs) { +static inline bool operator>=( + const sbp_msg_ssr_gridded_correction_bounds_t &lhs, + const sbp_msg_ssr_gridded_correction_bounds_t &rhs) { return sbp_msg_ssr_gridded_correction_bounds_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_GRIDDED_CORRECTION_BOUNDS_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION_DEP_A.h b/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION_DEP_A.h index f698ad921..4b6ab0919 100644 --- a/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION_DEP_A.h +++ b/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION_DEP_A.h @@ -18,22 +18,22 @@ #ifndef LIBSBP_SSR_MSG_SSR_GRIDDED_CORRECTION_DEP_A_H #define LIBSBP_SSR_MSG_SSR_GRIDDED_CORRECTION_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -43,91 +43,109 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Header of a Gridded Correction message + * Header of a Gridded Correction message */ sbp_gridded_correction_header_dep_a_t header; - /** -* Index of the grid point + * Index of the grid point */ u16 index; - /** -* Wet and hydrostatic vertical delays (mean, stddev) + * Wet and hydrostatic vertical delays (mean, stddev) */ sbp_tropospheric_delay_correction_t tropo_delay_correction; - /** -* STEC residuals for each satellite (mean, stddev) + * STEC residuals for each satellite (mean, stddev) */ - sbp_stec_residual_t stec_residuals[SBP_MSG_SSR_GRIDDED_CORRECTION_DEP_A_STEC_RESIDUALS_MAX]; + sbp_stec_residual_t + stec_residuals[SBP_MSG_SSR_GRIDDED_CORRECTION_DEP_A_STEC_RESIDUALS_MAX]; /** * Number of elements in stec_residuals * - * When sending a message fill in this field with the number elements set in stec_residuals before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * stec_residuals before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in stec_residuals. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * stec_residuals. The value of any elements beyond the index specified in + * this field is undefined */ u8 n_stec_residuals; } sbp_msg_ssr_gridded_correction_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_gridded_correction_dep_a_t * * @param msg sbp_msg_ssr_gridded_correction_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_gridded_correction_dep_a_encoded_len(const sbp_msg_ssr_gridded_correction_dep_a_t *msg) -{ - return SBP_MSG_SSR_GRIDDED_CORRECTION_DEP_A_ENCODED_OVERHEAD - + (msg->n_stec_residuals * SBP_STEC_RESIDUAL_ENCODED_LEN) - ; +static inline size_t sbp_msg_ssr_gridded_correction_dep_a_encoded_len( + const sbp_msg_ssr_gridded_correction_dep_a_t *msg) { + return SBP_MSG_SSR_GRIDDED_CORRECTION_DEP_A_ENCODED_OVERHEAD + + (msg->n_stec_residuals * SBP_STEC_RESIDUAL_ENCODED_LEN); } /** - * Encode an instance of sbp_msg_ssr_gridded_correction_dep_a_t to wire representation + * Encode an instance of sbp_msg_ssr_gridded_correction_dep_a_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_gridded_correction_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_gridded_correction_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_gridded_correction_dep_a_t *msg); /** - * Decode an instance of sbp_msg_ssr_gridded_correction_dep_a_t from wire representation + * Decode an instance of sbp_msg_ssr_gridded_correction_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_gridded_correction_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_gridded_correction_dep_a_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_ssr_gridded_correction_dep_a_t instance + * @param buf Wire representation of the sbp_msg_ssr_gridded_correction_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_gridded_correction_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_gridded_correction_dep_a_t *msg); /** - * Send an instance of sbp_msg_ssr_gridded_correction_dep_a_t with the given write function + * Send an instance of sbp_msg_ssr_gridded_correction_dep_a_t with the given + * write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_gridded_correction_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_gridded_correction_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -135,51 +153,68 @@ SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_dep_a_decode(const uint8_t *buf, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_gridded_correction_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_dep_a_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_gridded_correction_dep_a_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_gridded_correction_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_gridded_correction_dep_a_t instance * @param b sbp_msg_ssr_gridded_correction_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_gridded_correction_dep_a_cmp(const sbp_msg_ssr_gridded_correction_dep_a_t *a, const sbp_msg_ssr_gridded_correction_dep_a_t *b); +SBP_EXPORT int sbp_msg_ssr_gridded_correction_dep_a_cmp( + const sbp_msg_ssr_gridded_correction_dep_a_t *a, + const sbp_msg_ssr_gridded_correction_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_gridded_correction_dep_a_t &lhs, const sbp_msg_ssr_gridded_correction_dep_a_t &rhs) { +static inline bool operator==( + const sbp_msg_ssr_gridded_correction_dep_a_t &lhs, + const sbp_msg_ssr_gridded_correction_dep_a_t &rhs) { return sbp_msg_ssr_gridded_correction_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_gridded_correction_dep_a_t &lhs, const sbp_msg_ssr_gridded_correction_dep_a_t &rhs) { +static inline bool operator!=( + const sbp_msg_ssr_gridded_correction_dep_a_t &lhs, + const sbp_msg_ssr_gridded_correction_dep_a_t &rhs) { return sbp_msg_ssr_gridded_correction_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_gridded_correction_dep_a_t &lhs, const sbp_msg_ssr_gridded_correction_dep_a_t &rhs) { +static inline bool operator<( + const sbp_msg_ssr_gridded_correction_dep_a_t &lhs, + const sbp_msg_ssr_gridded_correction_dep_a_t &rhs) { return sbp_msg_ssr_gridded_correction_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_gridded_correction_dep_a_t &lhs, const sbp_msg_ssr_gridded_correction_dep_a_t &rhs) { +static inline bool operator<=( + const sbp_msg_ssr_gridded_correction_dep_a_t &lhs, + const sbp_msg_ssr_gridded_correction_dep_a_t &rhs) { return sbp_msg_ssr_gridded_correction_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_gridded_correction_dep_a_t &lhs, const sbp_msg_ssr_gridded_correction_dep_a_t &rhs) { +static inline bool operator>( + const sbp_msg_ssr_gridded_correction_dep_a_t &lhs, + const sbp_msg_ssr_gridded_correction_dep_a_t &rhs) { return sbp_msg_ssr_gridded_correction_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_gridded_correction_dep_a_t &lhs, const sbp_msg_ssr_gridded_correction_dep_a_t &rhs) { +static inline bool operator>=( + const sbp_msg_ssr_gridded_correction_dep_a_t &lhs, + const sbp_msg_ssr_gridded_correction_dep_a_t &rhs) { return sbp_msg_ssr_gridded_correction_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_GRIDDED_CORRECTION_DEP_A_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A.h b/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A.h index a8cc6ae90..02e90f42c 100644 --- a/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A.h +++ b/c/include/libsbp/ssr/MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A.h @@ -18,22 +18,22 @@ #ifndef LIBSBP_SSR_MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A_H #define LIBSBP_SSR_MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include -#include #include +#include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -43,91 +43,111 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Header of a Gridded Correction message + * Header of a Gridded Correction message */ sbp_gridded_correction_header_dep_a_t header; - /** -* Index of the grid point + * Index of the grid point */ u16 index; - /** -* Wet and hydrostatic vertical delays + * Wet and hydrostatic vertical delays */ sbp_tropospheric_delay_correction_no_std_t tropo_delay_correction; - /** -* STEC residuals for each satellite + * STEC residuals for each satellite */ - sbp_stec_residual_no_std_t stec_residuals[SBP_MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A_STEC_RESIDUALS_MAX]; + sbp_stec_residual_no_std_t stec_residuals + [SBP_MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A_STEC_RESIDUALS_MAX]; /** * Number of elements in stec_residuals * - * When sending a message fill in this field with the number elements set in stec_residuals before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * stec_residuals before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in stec_residuals. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * stec_residuals. The value of any elements beyond the index specified in + * this field is undefined */ u8 n_stec_residuals; } sbp_msg_ssr_gridded_correction_no_std_dep_a_t; - - /** - * Get encoded size of an instance of sbp_msg_ssr_gridded_correction_no_std_dep_a_t + * Get encoded size of an instance of + * sbp_msg_ssr_gridded_correction_no_std_dep_a_t * * @param msg sbp_msg_ssr_gridded_correction_no_std_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_gridded_correction_no_std_dep_a_encoded_len(const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg) -{ - return SBP_MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A_ENCODED_OVERHEAD - + (msg->n_stec_residuals * SBP_STEC_RESIDUAL_NO_STD_ENCODED_LEN) - ; +static inline size_t sbp_msg_ssr_gridded_correction_no_std_dep_a_encoded_len( + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg) { + return SBP_MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A_ENCODED_OVERHEAD + + (msg->n_stec_residuals * SBP_STEC_RESIDUAL_NO_STD_ENCODED_LEN); } /** - * Encode an instance of sbp_msg_ssr_gridded_correction_no_std_dep_a_t to wire representation + * Encode an instance of sbp_msg_ssr_gridded_correction_no_std_dep_a_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf - * @param msg Instance of sbp_msg_ssr_gridded_correction_no_std_dep_a_t to encode + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf + * @param msg Instance of sbp_msg_ssr_gridded_correction_no_std_dep_a_t to + * encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_no_std_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_no_std_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg); /** - * Decode an instance of sbp_msg_ssr_gridded_correction_no_std_dep_a_t from wire representation + * Decode an instance of sbp_msg_ssr_gridded_correction_no_std_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_gridded_correction_no_std_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_gridded_correction_no_std_dep_a_t message to the given instance. + * The caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_ssr_gridded_correction_no_std_dep_a_t instance + * @param buf Wire representation of the + * sbp_msg_ssr_gridded_correction_no_std_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_no_std_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_no_std_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg); /** - * Send an instance of sbp_msg_ssr_gridded_correction_no_std_dep_a_t with the given write function + * Send an instance of sbp_msg_ssr_gridded_correction_no_std_dep_a_t with the + * given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_gridded_correction_no_std_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_gridded_correction_no_std_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -135,51 +155,69 @@ SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_no_std_dep_a_decode(const uint8_t * * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_no_std_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_gridded_correction_no_std_dep_a_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_gridded_correction_no_std_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_gridded_correction_no_std_dep_a_t instance * @param b sbp_msg_ssr_gridded_correction_no_std_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_gridded_correction_no_std_dep_a_cmp(const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *a, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *b); +SBP_EXPORT int sbp_msg_ssr_gridded_correction_no_std_dep_a_cmp( + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *a, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &lhs, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &rhs) { +static inline bool operator==( + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &lhs, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &rhs) { return sbp_msg_ssr_gridded_correction_no_std_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &lhs, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &rhs) { +static inline bool operator!=( + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &lhs, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &rhs) { return sbp_msg_ssr_gridded_correction_no_std_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &lhs, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &rhs) { +static inline bool operator<( + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &lhs, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &rhs) { return sbp_msg_ssr_gridded_correction_no_std_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &lhs, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &rhs) { +static inline bool operator<=( + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &lhs, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &rhs) { return sbp_msg_ssr_gridded_correction_no_std_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &lhs, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &rhs) { +static inline bool operator>( + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &lhs, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &rhs) { return sbp_msg_ssr_gridded_correction_no_std_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &lhs, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &rhs) { +static inline bool operator>=( + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &lhs, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &rhs) { return sbp_msg_ssr_gridded_correction_no_std_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_GRID_DEFINITION_DEP_A.h b/c/include/libsbp/ssr/MSG_SSR_GRID_DEFINITION_DEP_A.h index 6ebc59127..3f3b46e8b 100644 --- a/c/include/libsbp/ssr/MSG_SSR_GRID_DEFINITION_DEP_A.h +++ b/c/include/libsbp/ssr/MSG_SSR_GRID_DEFINITION_DEP_A.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SSR_MSG_SSR_GRID_DEFINITION_DEP_A_H #define LIBSBP_SSR_MSG_SSR_GRID_DEFINITION_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,79 +41,100 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Header of a Gridded Correction message + * Header of a Gridded Correction message */ sbp_grid_definition_header_dep_a_t header; - /** - * Run Length Encode list of quadrants that contain valid data. The spec describes the encoding scheme in detail, but essentially the index of the quadrants that contain transitions between valid and invalid (and vice versa) are encoded as u8 integers. + * Run Length Encode list of quadrants that contain valid data. The spec + * describes the encoding scheme in detail, but essentially the index of the + * quadrants that contain transitions between valid and invalid (and vice + * versa) are encoded as u8 integers. */ u8 rle_list[SBP_MSG_SSR_GRID_DEFINITION_DEP_A_RLE_LIST_MAX]; /** * Number of elements in rle_list * - * When sending a message fill in this field with the number elements set in rle_list before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * rle_list before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in rle_list. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * rle_list. The value of any elements beyond the index specified in this + * field is undefined */ u8 n_rle_list; } sbp_msg_ssr_grid_definition_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_grid_definition_dep_a_t * * @param msg sbp_msg_ssr_grid_definition_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_grid_definition_dep_a_encoded_len(const sbp_msg_ssr_grid_definition_dep_a_t *msg) -{ - return SBP_MSG_SSR_GRID_DEFINITION_DEP_A_ENCODED_OVERHEAD - + (msg->n_rle_list * SBP_ENCODED_LEN_U8) - ; +static inline size_t sbp_msg_ssr_grid_definition_dep_a_encoded_len( + const sbp_msg_ssr_grid_definition_dep_a_t *msg) { + return SBP_MSG_SSR_GRID_DEFINITION_DEP_A_ENCODED_OVERHEAD + + (msg->n_rle_list * SBP_ENCODED_LEN_U8); } /** - * Encode an instance of sbp_msg_ssr_grid_definition_dep_a_t to wire representation + * Encode an instance of sbp_msg_ssr_grid_definition_dep_a_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_grid_definition_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_grid_definition_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_grid_definition_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_grid_definition_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_grid_definition_dep_a_t *msg); /** - * Decode an instance of sbp_msg_ssr_grid_definition_dep_a_t from wire representation + * Decode an instance of sbp_msg_ssr_grid_definition_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_grid_definition_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_grid_definition_dep_a_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ssr_grid_definition_dep_a_t instance + * @param buf Wire representation of the sbp_msg_ssr_grid_definition_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_grid_definition_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_grid_definition_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_grid_definition_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_grid_definition_dep_a_t *msg); /** - * Send an instance of sbp_msg_ssr_grid_definition_dep_a_t with the given write function + * Send an instance of sbp_msg_ssr_grid_definition_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_grid_definition_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_grid_definition_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -121,51 +142,62 @@ SBP_EXPORT s8 sbp_msg_ssr_grid_definition_dep_a_decode(const uint8_t *buf, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_grid_definition_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_grid_definition_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_grid_definition_dep_a_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_grid_definition_dep_a_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_grid_definition_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_grid_definition_dep_a_t instance * @param b sbp_msg_ssr_grid_definition_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_grid_definition_dep_a_cmp(const sbp_msg_ssr_grid_definition_dep_a_t *a, const sbp_msg_ssr_grid_definition_dep_a_t *b); +SBP_EXPORT int sbp_msg_ssr_grid_definition_dep_a_cmp( + const sbp_msg_ssr_grid_definition_dep_a_t *a, + const sbp_msg_ssr_grid_definition_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_grid_definition_dep_a_t &lhs, const sbp_msg_ssr_grid_definition_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_grid_definition_dep_a_t &lhs, + const sbp_msg_ssr_grid_definition_dep_a_t &rhs) { return sbp_msg_ssr_grid_definition_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_grid_definition_dep_a_t &lhs, const sbp_msg_ssr_grid_definition_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_grid_definition_dep_a_t &lhs, + const sbp_msg_ssr_grid_definition_dep_a_t &rhs) { return sbp_msg_ssr_grid_definition_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_grid_definition_dep_a_t &lhs, const sbp_msg_ssr_grid_definition_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_grid_definition_dep_a_t &lhs, + const sbp_msg_ssr_grid_definition_dep_a_t &rhs) { return sbp_msg_ssr_grid_definition_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_grid_definition_dep_a_t &lhs, const sbp_msg_ssr_grid_definition_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_grid_definition_dep_a_t &lhs, + const sbp_msg_ssr_grid_definition_dep_a_t &rhs) { return sbp_msg_ssr_grid_definition_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_grid_definition_dep_a_t &lhs, const sbp_msg_ssr_grid_definition_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_grid_definition_dep_a_t &lhs, + const sbp_msg_ssr_grid_definition_dep_a_t &rhs) { return sbp_msg_ssr_grid_definition_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_grid_definition_dep_a_t &lhs, const sbp_msg_ssr_grid_definition_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_grid_definition_dep_a_t &lhs, + const sbp_msg_ssr_grid_definition_dep_a_t &rhs) { return sbp_msg_ssr_grid_definition_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_GRID_DEFINITION_DEP_A_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK.h b/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK.h index db039ca0b..da2effa4b 100644 --- a/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK.h +++ b/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_SSR_MSG_SSR_ORBIT_CLOCK_H #define LIBSBP_SSR_MSG_SSR_ORBIT_CLOCK_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,105 +42,95 @@ *****************************************************************************/ /** Precise orbit and clock correction * -* The precise orbit and clock correction message is to be applied as a delta correction to broadcast ephemeris and is an equivalent to the 1060 /1066 RTCM message types. + * The precise orbit and clock correction message is to be applied as a delta + * correction to broadcast ephemeris and is an equivalent to the 1060 /1066 RTCM + * message types. */ typedef struct { - - /** -* GNSS reference time of the correction + * GNSS reference time of the correction */ sbp_gps_time_sec_t time; - /** -* GNSS signal identifier (16 bit) + * GNSS signal identifier (16 bit) */ sbp_v4_gnss_signal_t sid; - /** - * Update interval between consecutive corrections. Encoded following RTCM DF391 specification. + * Update interval between consecutive corrections. Encoded following RTCM + * DF391 specification. */ u8 update_interval; - /** - * IOD of the SSR correction. A change of Issue Of Data SSR is used to indicate a change in the SSR generating configuration + * IOD of the SSR correction. A change of Issue Of Data SSR is used to + * indicate a change in the SSR generating configuration */ u8 iod_ssr; - /** -* Issue of broadcast ephemeris data or IODCRC (Beidou) + * Issue of broadcast ephemeris data or IODCRC (Beidou) */ u32 iod; - /** -* Orbit radial delta correction [0.1 mm] + * Orbit radial delta correction [0.1 mm] */ s32 radial; - /** -* Orbit along delta correction [0.4 mm] + * Orbit along delta correction [0.4 mm] */ s32 along; - /** -* Orbit along delta correction [0.4 mm] + * Orbit along delta correction [0.4 mm] */ s32 cross; - /** -* Velocity of orbit radial delta correction [0.001 mm/s] + * Velocity of orbit radial delta correction [0.001 mm/s] */ s32 dot_radial; - /** -* Velocity of orbit along delta correction [0.004 mm/s] + * Velocity of orbit along delta correction [0.004 mm/s] */ s32 dot_along; - /** -* Velocity of orbit cross delta correction [0.004 mm/s] + * Velocity of orbit cross delta correction [0.004 mm/s] */ s32 dot_cross; - /** -* C0 polynomial coefficient for correction of broadcast satellite clock [0.1 mm] + * C0 polynomial coefficient for correction of broadcast satellite clock [0.1 + * mm] */ s32 c0; - /** -* C1 polynomial coefficient for correction of broadcast satellite clock [0.001 mm/s] + * C1 polynomial coefficient for correction of broadcast satellite clock + * [0.001 mm/s] */ s32 c1; - /** -* C2 polynomial coefficient for correction of broadcast satellite clock [0.00002 mm/s^-2] + * C2 polynomial coefficient for correction of broadcast satellite clock + * [0.00002 mm/s^-2] */ s32 c2; } sbp_msg_ssr_orbit_clock_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_orbit_clock_t * * @param msg sbp_msg_ssr_orbit_clock_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_orbit_clock_encoded_len(const sbp_msg_ssr_orbit_clock_t *msg) -{ +static inline size_t sbp_msg_ssr_orbit_clock_encoded_len( + const sbp_msg_ssr_orbit_clock_t *msg) { (void)msg; return SBP_MSG_SSR_ORBIT_CLOCK_ENCODED_LEN; } @@ -148,36 +138,53 @@ static inline size_t sbp_msg_ssr_orbit_clock_encoded_len(const sbp_msg_ssr_orbit /** * Encode an instance of sbp_msg_ssr_orbit_clock_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_orbit_clock_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_orbit_clock_t *msg); +SBP_EXPORT s8 +sbp_msg_ssr_orbit_clock_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_orbit_clock_t *msg); /** * Decode an instance of sbp_msg_ssr_orbit_clock_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ssr_orbit_clock_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ssr_orbit_clock_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ssr_orbit_clock_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_orbit_clock_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ssr_orbit_clock_t *msg); /** * Send an instance of sbp_msg_ssr_orbit_clock_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_orbit_clock_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_orbit_clock_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -185,51 +192,61 @@ SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_decode(const uint8_t *buf, uint8_t len, ui * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_orbit_clock_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_orbit_clock_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_orbit_clock_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_orbit_clock_t instance * @param b sbp_msg_ssr_orbit_clock_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_orbit_clock_cmp(const sbp_msg_ssr_orbit_clock_t *a, const sbp_msg_ssr_orbit_clock_t *b); +SBP_EXPORT int sbp_msg_ssr_orbit_clock_cmp(const sbp_msg_ssr_orbit_clock_t *a, + const sbp_msg_ssr_orbit_clock_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_orbit_clock_t &lhs, const sbp_msg_ssr_orbit_clock_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_orbit_clock_t &lhs, + const sbp_msg_ssr_orbit_clock_t &rhs) { return sbp_msg_ssr_orbit_clock_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_orbit_clock_t &lhs, const sbp_msg_ssr_orbit_clock_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_orbit_clock_t &lhs, + const sbp_msg_ssr_orbit_clock_t &rhs) { return sbp_msg_ssr_orbit_clock_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_orbit_clock_t &lhs, const sbp_msg_ssr_orbit_clock_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_orbit_clock_t &lhs, + const sbp_msg_ssr_orbit_clock_t &rhs) { return sbp_msg_ssr_orbit_clock_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_orbit_clock_t &lhs, const sbp_msg_ssr_orbit_clock_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_orbit_clock_t &lhs, + const sbp_msg_ssr_orbit_clock_t &rhs) { return sbp_msg_ssr_orbit_clock_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_orbit_clock_t &lhs, const sbp_msg_ssr_orbit_clock_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_orbit_clock_t &lhs, + const sbp_msg_ssr_orbit_clock_t &rhs) { return sbp_msg_ssr_orbit_clock_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_orbit_clock_t &lhs, const sbp_msg_ssr_orbit_clock_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_orbit_clock_t &lhs, + const sbp_msg_ssr_orbit_clock_t &rhs) { return sbp_msg_ssr_orbit_clock_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_ORBIT_CLOCK_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK_BOUNDS.h b/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK_BOUNDS.h index 8807ca037..d72bf8962 100644 --- a/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK_BOUNDS.h +++ b/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK_BOUNDS.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_SSR_MSG_SSR_ORBIT_CLOCK_BOUNDS_H #define LIBSBP_SSR_MSG_SSR_ORBIT_CLOCK_BOUNDS_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,90 +42,103 @@ *****************************************************************************/ /** Combined Orbit and Clock Bound * - * Note 1: Range: 0-17.5 m. i<=200, mean=0.01i; 200230, mean=5+0.5(i-230). - * + * Note 1: Range: 0-17.5 m. i<=200, mean=0.01i; 200230, mean=5+0.5(i-230). + * */ typedef struct { - - /** -* Header of a bounds message. + * Header of a bounds message. */ sbp_bounds_header_t header; - /** -* IOD of the SSR bound. + * IOD of the SSR bound. */ u8 ssr_iod; - /** -* Constellation ID to which the SVs belong. + * Constellation ID to which the SVs belong. */ u8 const_id; - /** -* Number of satellites. + * Number of satellites. */ u8 n_sats; - /** -* Orbit and Clock Bounds per Satellite + * Orbit and Clock Bounds per Satellite */ - sbp_orbit_clock_bound_t orbit_clock_bounds[SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS_ORBIT_CLOCK_BOUNDS_MAX]; + sbp_orbit_clock_bound_t + orbit_clock_bounds[SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS_ORBIT_CLOCK_BOUNDS_MAX]; } sbp_msg_ssr_orbit_clock_bounds_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_orbit_clock_bounds_t * * @param msg sbp_msg_ssr_orbit_clock_bounds_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_orbit_clock_bounds_encoded_len(const sbp_msg_ssr_orbit_clock_bounds_t *msg) -{ - return SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS_ENCODED_OVERHEAD - + (msg->n_sats * SBP_ORBIT_CLOCK_BOUND_ENCODED_LEN) - ; +static inline size_t sbp_msg_ssr_orbit_clock_bounds_encoded_len( + const sbp_msg_ssr_orbit_clock_bounds_t *msg) { + return SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS_ENCODED_OVERHEAD + + (msg->n_sats * SBP_ORBIT_CLOCK_BOUND_ENCODED_LEN); } /** * Encode an instance of sbp_msg_ssr_orbit_clock_bounds_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_orbit_clock_bounds_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_bounds_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_orbit_clock_bounds_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_bounds_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_orbit_clock_bounds_t *msg); /** - * Decode an instance of sbp_msg_ssr_orbit_clock_bounds_t from wire representation + * Decode an instance of sbp_msg_ssr_orbit_clock_bounds_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_orbit_clock_bounds_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_orbit_clock_bounds_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ssr_orbit_clock_bounds_t instance + * @param buf Wire representation of the sbp_msg_ssr_orbit_clock_bounds_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_bounds_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_orbit_clock_bounds_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_bounds_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_orbit_clock_bounds_t *msg); /** - * Send an instance of sbp_msg_ssr_orbit_clock_bounds_t with the given write function + * Send an instance of sbp_msg_ssr_orbit_clock_bounds_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_orbit_clock_bounds_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_orbit_clock_bounds_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -133,51 +146,62 @@ SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_bounds_decode(const uint8_t *buf, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_bounds_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_orbit_clock_bounds_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_bounds_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_orbit_clock_bounds_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_orbit_clock_bounds_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_orbit_clock_bounds_t instance * @param b sbp_msg_ssr_orbit_clock_bounds_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_orbit_clock_bounds_cmp(const sbp_msg_ssr_orbit_clock_bounds_t *a, const sbp_msg_ssr_orbit_clock_bounds_t *b); +SBP_EXPORT int sbp_msg_ssr_orbit_clock_bounds_cmp( + const sbp_msg_ssr_orbit_clock_bounds_t *a, + const sbp_msg_ssr_orbit_clock_bounds_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_orbit_clock_bounds_t &lhs, const sbp_msg_ssr_orbit_clock_bounds_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_orbit_clock_bounds_t &lhs, + const sbp_msg_ssr_orbit_clock_bounds_t &rhs) { return sbp_msg_ssr_orbit_clock_bounds_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_orbit_clock_bounds_t &lhs, const sbp_msg_ssr_orbit_clock_bounds_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_orbit_clock_bounds_t &lhs, + const sbp_msg_ssr_orbit_clock_bounds_t &rhs) { return sbp_msg_ssr_orbit_clock_bounds_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_orbit_clock_bounds_t &lhs, const sbp_msg_ssr_orbit_clock_bounds_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_orbit_clock_bounds_t &lhs, + const sbp_msg_ssr_orbit_clock_bounds_t &rhs) { return sbp_msg_ssr_orbit_clock_bounds_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_orbit_clock_bounds_t &lhs, const sbp_msg_ssr_orbit_clock_bounds_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_orbit_clock_bounds_t &lhs, + const sbp_msg_ssr_orbit_clock_bounds_t &rhs) { return sbp_msg_ssr_orbit_clock_bounds_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_orbit_clock_bounds_t &lhs, const sbp_msg_ssr_orbit_clock_bounds_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_orbit_clock_bounds_t &lhs, + const sbp_msg_ssr_orbit_clock_bounds_t &rhs) { return sbp_msg_ssr_orbit_clock_bounds_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_orbit_clock_bounds_t &lhs, const sbp_msg_ssr_orbit_clock_bounds_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_orbit_clock_bounds_t &lhs, + const sbp_msg_ssr_orbit_clock_bounds_t &rhs) { return sbp_msg_ssr_orbit_clock_bounds_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_ORBIT_CLOCK_BOUNDS_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION.h b/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION.h index 5d871d414..435f970e5 100644 --- a/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION.h +++ b/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_SSR_MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION_H #define LIBSBP_SSR_MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,85 +41,102 @@ * *****************************************************************************/ typedef struct { - - /** -* Header of a bounds message. + * Header of a bounds message. */ sbp_bounds_header_t header; - /** -* IOD of the SSR bound degradation parameter. + * IOD of the SSR bound degradation parameter. */ u8 ssr_iod; - /** -* Constellation ID to which the SVs belong. + * Constellation ID to which the SVs belong. */ u8 const_id; - /** - * Satellite Bit Mask. Put 1 for each satellite where the following degradation parameters are applicable, 0 otherwise. Encoded following RTCM DF394 specification. + * Satellite Bit Mask. Put 1 for each satellite where the following + * degradation parameters are applicable, 0 otherwise. Encoded following RTCM + * DF394 specification. */ u64 sat_bitmask; - /** -* Orbit and Clock Bounds Degradation Parameters + * Orbit and Clock Bounds Degradation Parameters */ sbp_orbit_clock_bound_degradation_t orbit_clock_bounds_degradation; } sbp_msg_ssr_orbit_clock_bounds_degradation_t; - - /** - * Get encoded size of an instance of sbp_msg_ssr_orbit_clock_bounds_degradation_t + * Get encoded size of an instance of + * sbp_msg_ssr_orbit_clock_bounds_degradation_t * * @param msg sbp_msg_ssr_orbit_clock_bounds_degradation_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_orbit_clock_bounds_degradation_encoded_len(const sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg) -{ +static inline size_t sbp_msg_ssr_orbit_clock_bounds_degradation_encoded_len( + const sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg) { (void)msg; return SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION_ENCODED_LEN; } /** - * Encode an instance of sbp_msg_ssr_orbit_clock_bounds_degradation_t to wire representation + * Encode an instance of sbp_msg_ssr_orbit_clock_bounds_degradation_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_orbit_clock_bounds_degradation_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_bounds_degradation_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_bounds_degradation_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg); /** - * Decode an instance of sbp_msg_ssr_orbit_clock_bounds_degradation_t from wire representation + * Decode an instance of sbp_msg_ssr_orbit_clock_bounds_degradation_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_orbit_clock_bounds_degradation_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_orbit_clock_bounds_degradation_t message to the given instance. + * The caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_ssr_orbit_clock_bounds_degradation_t instance + * @param buf Wire representation of the + * sbp_msg_ssr_orbit_clock_bounds_degradation_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_bounds_degradation_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_bounds_degradation_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg); /** - * Send an instance of sbp_msg_ssr_orbit_clock_bounds_degradation_t with the given write function + * Send an instance of sbp_msg_ssr_orbit_clock_bounds_degradation_t with the + * given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_orbit_clock_bounds_degradation_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_orbit_clock_bounds_degradation_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -127,51 +144,69 @@ SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_bounds_degradation_decode(const uint8_t *b * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_bounds_degradation_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_bounds_degradation_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_orbit_clock_bounds_degradation_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_orbit_clock_bounds_degradation_t instance * @param b sbp_msg_ssr_orbit_clock_bounds_degradation_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_orbit_clock_bounds_degradation_cmp(const sbp_msg_ssr_orbit_clock_bounds_degradation_t *a, const sbp_msg_ssr_orbit_clock_bounds_degradation_t *b); +SBP_EXPORT int sbp_msg_ssr_orbit_clock_bounds_degradation_cmp( + const sbp_msg_ssr_orbit_clock_bounds_degradation_t *a, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_orbit_clock_bounds_degradation_t &lhs, const sbp_msg_ssr_orbit_clock_bounds_degradation_t &rhs) { +static inline bool operator==( + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &lhs, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &rhs) { return sbp_msg_ssr_orbit_clock_bounds_degradation_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_orbit_clock_bounds_degradation_t &lhs, const sbp_msg_ssr_orbit_clock_bounds_degradation_t &rhs) { +static inline bool operator!=( + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &lhs, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &rhs) { return sbp_msg_ssr_orbit_clock_bounds_degradation_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_orbit_clock_bounds_degradation_t &lhs, const sbp_msg_ssr_orbit_clock_bounds_degradation_t &rhs) { +static inline bool operator<( + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &lhs, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &rhs) { return sbp_msg_ssr_orbit_clock_bounds_degradation_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_orbit_clock_bounds_degradation_t &lhs, const sbp_msg_ssr_orbit_clock_bounds_degradation_t &rhs) { +static inline bool operator<=( + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &lhs, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &rhs) { return sbp_msg_ssr_orbit_clock_bounds_degradation_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_orbit_clock_bounds_degradation_t &lhs, const sbp_msg_ssr_orbit_clock_bounds_degradation_t &rhs) { +static inline bool operator>( + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &lhs, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &rhs) { return sbp_msg_ssr_orbit_clock_bounds_degradation_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_orbit_clock_bounds_degradation_t &lhs, const sbp_msg_ssr_orbit_clock_bounds_degradation_t &rhs) { +static inline bool operator>=( + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &lhs, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &rhs) { return sbp_msg_ssr_orbit_clock_bounds_degradation_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK_DEP_A.h b/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK_DEP_A.h index b9418c74e..1cd96ffab 100644 --- a/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK_DEP_A.h +++ b/c/include/libsbp/ssr/MSG_SSR_ORBIT_CLOCK_DEP_A.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_SSR_MSG_SSR_ORBIT_CLOCK_DEP_A_H #define LIBSBP_SSR_MSG_SSR_ORBIT_CLOCK_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,105 +42,93 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* GNSS reference time of the correction + * GNSS reference time of the correction */ sbp_gps_time_sec_t time; - /** -* GNSS signal identifier (16 bit) + * GNSS signal identifier (16 bit) */ sbp_v4_gnss_signal_t sid; - /** - * Update interval between consecutive corrections. Encoded following RTCM DF391 specification. + * Update interval between consecutive corrections. Encoded following RTCM + * DF391 specification. */ u8 update_interval; - /** - * IOD of the SSR correction. A change of Issue Of Data SSR is used to indicate a change in the SSR generating configuration + * IOD of the SSR correction. A change of Issue Of Data SSR is used to + * indicate a change in the SSR generating configuration */ u8 iod_ssr; - /** -* Issue of broadcast ephemeris data + * Issue of broadcast ephemeris data */ u8 iod; - /** -* Orbit radial delta correction [0.1 mm] + * Orbit radial delta correction [0.1 mm] */ s32 radial; - /** -* Orbit along delta correction [0.4 mm] + * Orbit along delta correction [0.4 mm] */ s32 along; - /** -* Orbit along delta correction [0.4 mm] + * Orbit along delta correction [0.4 mm] */ s32 cross; - /** -* Velocity of orbit radial delta correction [0.001 mm/s] + * Velocity of orbit radial delta correction [0.001 mm/s] */ s32 dot_radial; - /** -* Velocity of orbit along delta correction [0.004 mm/s] + * Velocity of orbit along delta correction [0.004 mm/s] */ s32 dot_along; - /** -* Velocity of orbit cross delta correction [0.004 mm/s] + * Velocity of orbit cross delta correction [0.004 mm/s] */ s32 dot_cross; - /** -* C0 polynomial coefficient for correction of broadcast satellite clock [0.1 mm] + * C0 polynomial coefficient for correction of broadcast satellite clock [0.1 + * mm] */ s32 c0; - /** -* C1 polynomial coefficient for correction of broadcast satellite clock [0.001 mm/s] + * C1 polynomial coefficient for correction of broadcast satellite clock + * [0.001 mm/s] */ s32 c1; - /** -* C2 polynomial coefficient for correction of broadcast satellite clock [0.00002 mm/s^-2] + * C2 polynomial coefficient for correction of broadcast satellite clock + * [0.00002 mm/s^-2] */ s32 c2; } sbp_msg_ssr_orbit_clock_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_orbit_clock_dep_a_t * * @param msg sbp_msg_ssr_orbit_clock_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_orbit_clock_dep_a_encoded_len(const sbp_msg_ssr_orbit_clock_dep_a_t *msg) -{ +static inline size_t sbp_msg_ssr_orbit_clock_dep_a_encoded_len( + const sbp_msg_ssr_orbit_clock_dep_a_t *msg) { (void)msg; return SBP_MSG_SSR_ORBIT_CLOCK_DEP_A_ENCODED_LEN; } @@ -148,36 +136,56 @@ static inline size_t sbp_msg_ssr_orbit_clock_dep_a_encoded_len(const sbp_msg_ssr /** * Encode an instance of sbp_msg_ssr_orbit_clock_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_orbit_clock_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_orbit_clock_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_orbit_clock_dep_a_t *msg); /** - * Decode an instance of sbp_msg_ssr_orbit_clock_dep_a_t from wire representation + * Decode an instance of sbp_msg_ssr_orbit_clock_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_orbit_clock_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_orbit_clock_dep_a_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ssr_orbit_clock_dep_a_t instance + * @param buf Wire representation of the sbp_msg_ssr_orbit_clock_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_orbit_clock_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_orbit_clock_dep_a_t *msg); /** - * Send an instance of sbp_msg_ssr_orbit_clock_dep_a_t with the given write function + * Send an instance of sbp_msg_ssr_orbit_clock_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_orbit_clock_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_orbit_clock_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -185,51 +193,62 @@ SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_dep_a_decode(const uint8_t *buf, uint8_t l * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_orbit_clock_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_orbit_clock_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_orbit_clock_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_orbit_clock_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_orbit_clock_dep_a_t instance * @param b sbp_msg_ssr_orbit_clock_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_orbit_clock_dep_a_cmp(const sbp_msg_ssr_orbit_clock_dep_a_t *a, const sbp_msg_ssr_orbit_clock_dep_a_t *b); +SBP_EXPORT int sbp_msg_ssr_orbit_clock_dep_a_cmp( + const sbp_msg_ssr_orbit_clock_dep_a_t *a, + const sbp_msg_ssr_orbit_clock_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_orbit_clock_dep_a_t &lhs, const sbp_msg_ssr_orbit_clock_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_orbit_clock_dep_a_t &lhs, + const sbp_msg_ssr_orbit_clock_dep_a_t &rhs) { return sbp_msg_ssr_orbit_clock_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_orbit_clock_dep_a_t &lhs, const sbp_msg_ssr_orbit_clock_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_orbit_clock_dep_a_t &lhs, + const sbp_msg_ssr_orbit_clock_dep_a_t &rhs) { return sbp_msg_ssr_orbit_clock_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_orbit_clock_dep_a_t &lhs, const sbp_msg_ssr_orbit_clock_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_orbit_clock_dep_a_t &lhs, + const sbp_msg_ssr_orbit_clock_dep_a_t &rhs) { return sbp_msg_ssr_orbit_clock_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_orbit_clock_dep_a_t &lhs, const sbp_msg_ssr_orbit_clock_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_orbit_clock_dep_a_t &lhs, + const sbp_msg_ssr_orbit_clock_dep_a_t &rhs) { return sbp_msg_ssr_orbit_clock_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_orbit_clock_dep_a_t &lhs, const sbp_msg_ssr_orbit_clock_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_orbit_clock_dep_a_t &lhs, + const sbp_msg_ssr_orbit_clock_dep_a_t &rhs) { return sbp_msg_ssr_orbit_clock_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_orbit_clock_dep_a_t &lhs, const sbp_msg_ssr_orbit_clock_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_orbit_clock_dep_a_t &lhs, + const sbp_msg_ssr_orbit_clock_dep_a_t &rhs) { return sbp_msg_ssr_orbit_clock_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_ORBIT_CLOCK_DEP_A_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_PHASE_BIASES.h b/c/include/libsbp/ssr/MSG_SSR_PHASE_BIASES.h index 27288f27f..676afca99 100644 --- a/c/include/libsbp/ssr/MSG_SSR_PHASE_BIASES.h +++ b/c/include/libsbp/ssr/MSG_SSR_PHASE_BIASES.h @@ -18,22 +18,22 @@ #ifndef LIBSBP_SSR_MSG_SSR_PHASE_BIASES_H #define LIBSBP_SSR_MSG_SSR_PHASE_BIASES_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -43,121 +43,134 @@ *****************************************************************************/ /** Precise phase biases correction * -* The precise phase biases message contains the biases to be added to the carrier phase of the corresponding signal to get corrected carrier phase measurement, as well as the satellite yaw angle to be applied to compute the phase wind-up correction. It is typically an equivalent to the 1265 RTCM message types. + * The precise phase biases message contains the biases to be added to the + * carrier phase of the corresponding signal to get corrected carrier phase + * measurement, as well as the satellite yaw angle to be applied to compute the + * phase wind-up correction. It is typically an equivalent to the 1265 RTCM + * message types. */ typedef struct { - - /** -* GNSS reference time of the correction + * GNSS reference time of the correction */ sbp_gps_time_sec_t time; - /** -* GNSS signal identifier (16 bit) + * GNSS signal identifier (16 bit) */ sbp_v4_gnss_signal_t sid; - /** - * Update interval between consecutive corrections. Encoded following RTCM DF391 specification. + * Update interval between consecutive corrections. Encoded following RTCM + * DF391 specification. */ u8 update_interval; - /** - * IOD of the SSR correction. A change of Issue Of Data SSR is used to indicate a change in the SSR generating configuration + * IOD of the SSR correction. A change of Issue Of Data SSR is used to + * indicate a change in the SSR generating configuration */ u8 iod_ssr; - /** - * Indicator for the dispersive phase biases property. + * Indicator for the dispersive phase biases property. */ u8 dispersive_bias; - /** - * Consistency indicator for Melbourne-Wubbena linear combinations + * Consistency indicator for Melbourne-Wubbena linear combinations */ u8 mw_consistency; - /** -* Satellite yaw angle [1 / 256 semi-circle] + * Satellite yaw angle [1 / 256 semi-circle] */ u16 yaw; - /** -* Satellite yaw angle rate [1 / 8192 semi-circle / s] + * Satellite yaw angle rate [1 / 8192 semi-circle / s] */ s8 yaw_rate; - /** - * Phase biases corrections for a satellite being tracked. + * Phase biases corrections for a satellite being tracked. */ sbp_phase_biases_content_t biases[SBP_MSG_SSR_PHASE_BIASES_BIASES_MAX]; /** * Number of elements in biases * - * When sending a message fill in this field with the number elements set in biases before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * biases before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in biases. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * biases. The value of any elements beyond the index specified in this field + * is undefined */ u8 n_biases; } sbp_msg_ssr_phase_biases_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_phase_biases_t * * @param msg sbp_msg_ssr_phase_biases_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_phase_biases_encoded_len(const sbp_msg_ssr_phase_biases_t *msg) -{ - return SBP_MSG_SSR_PHASE_BIASES_ENCODED_OVERHEAD - + (msg->n_biases * SBP_PHASE_BIASES_CONTENT_ENCODED_LEN) - ; +static inline size_t sbp_msg_ssr_phase_biases_encoded_len( + const sbp_msg_ssr_phase_biases_t *msg) { + return SBP_MSG_SSR_PHASE_BIASES_ENCODED_OVERHEAD + + (msg->n_biases * SBP_PHASE_BIASES_CONTENT_ENCODED_LEN); } /** * Encode an instance of sbp_msg_ssr_phase_biases_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_phase_biases_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_phase_biases_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_phase_biases_t *msg); +SBP_EXPORT s8 +sbp_msg_ssr_phase_biases_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_phase_biases_t *msg); /** * Decode an instance of sbp_msg_ssr_phase_biases_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ssr_phase_biases_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ssr_phase_biases_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ssr_phase_biases_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_phase_biases_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_phase_biases_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_phase_biases_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ssr_phase_biases_t *msg); /** * Send an instance of sbp_msg_ssr_phase_biases_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_phase_biases_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_phase_biases_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -165,51 +178,61 @@ SBP_EXPORT s8 sbp_msg_ssr_phase_biases_decode(const uint8_t *buf, uint8_t len, u * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_phase_biases_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_phase_biases_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_phase_biases_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_phase_biases_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_phase_biases_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_phase_biases_t instance * @param b sbp_msg_ssr_phase_biases_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_phase_biases_cmp(const sbp_msg_ssr_phase_biases_t *a, const sbp_msg_ssr_phase_biases_t *b); +SBP_EXPORT int sbp_msg_ssr_phase_biases_cmp( + const sbp_msg_ssr_phase_biases_t *a, const sbp_msg_ssr_phase_biases_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_phase_biases_t &lhs, const sbp_msg_ssr_phase_biases_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_phase_biases_t &lhs, + const sbp_msg_ssr_phase_biases_t &rhs) { return sbp_msg_ssr_phase_biases_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_phase_biases_t &lhs, const sbp_msg_ssr_phase_biases_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_phase_biases_t &lhs, + const sbp_msg_ssr_phase_biases_t &rhs) { return sbp_msg_ssr_phase_biases_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_phase_biases_t &lhs, const sbp_msg_ssr_phase_biases_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_phase_biases_t &lhs, + const sbp_msg_ssr_phase_biases_t &rhs) { return sbp_msg_ssr_phase_biases_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_phase_biases_t &lhs, const sbp_msg_ssr_phase_biases_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_phase_biases_t &lhs, + const sbp_msg_ssr_phase_biases_t &rhs) { return sbp_msg_ssr_phase_biases_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_phase_biases_t &lhs, const sbp_msg_ssr_phase_biases_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_phase_biases_t &lhs, + const sbp_msg_ssr_phase_biases_t &rhs) { return sbp_msg_ssr_phase_biases_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_phase_biases_t &lhs, const sbp_msg_ssr_phase_biases_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_phase_biases_t &lhs, + const sbp_msg_ssr_phase_biases_t &rhs) { return sbp_msg_ssr_phase_biases_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_PHASE_BIASES_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_SATELLITE_APC.h b/c/include/libsbp/ssr/MSG_SSR_SATELLITE_APC.h index 1311f992c..2ff6c7a0d 100644 --- a/c/include/libsbp/ssr/MSG_SSR_SATELLITE_APC.h +++ b/c/include/libsbp/ssr/MSG_SSR_SATELLITE_APC.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_SSR_MSG_SSR_SATELLITE_APC_H #define LIBSBP_SSR_MSG_SSR_SATELLITE_APC_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,94 +41,107 @@ * *****************************************************************************/ typedef struct { - - /** -* GNSS reference time of the correction + * GNSS reference time of the correction */ sbp_gps_time_sec_t time; - /** - * Update interval between consecutive corrections. Encoded following RTCM DF391 specification. + * Update interval between consecutive corrections. Encoded following RTCM + * DF391 specification. */ u8 update_interval; - /** -* SSR Solution ID. Similar to RTCM DF415. + * SSR Solution ID. Similar to RTCM DF415. */ u8 sol_id; - /** - * IOD of the SSR correction. A change of Issue Of Data SSR is used to indicate a change in the SSR generating configuration + * IOD of the SSR correction. A change of Issue Of Data SSR is used to + * indicate a change in the SSR generating configuration */ u8 iod_ssr; - /** -* Satellite antenna phase center corrections + * Satellite antenna phase center corrections */ sbp_satellite_apc_t apc[SBP_MSG_SSR_SATELLITE_APC_APC_MAX]; /** * Number of elements in apc * - * When sending a message fill in this field with the number elements set in apc before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * apc before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in apc. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * apc. The value of any elements beyond the index specified in this field is + * undefined */ u8 n_apc; } sbp_msg_ssr_satellite_apc_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_satellite_apc_t * * @param msg sbp_msg_ssr_satellite_apc_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_satellite_apc_encoded_len(const sbp_msg_ssr_satellite_apc_t *msg) -{ - return SBP_MSG_SSR_SATELLITE_APC_ENCODED_OVERHEAD - + (msg->n_apc * SBP_SATELLITE_APC_ENCODED_LEN) - ; +static inline size_t sbp_msg_ssr_satellite_apc_encoded_len( + const sbp_msg_ssr_satellite_apc_t *msg) { + return SBP_MSG_SSR_SATELLITE_APC_ENCODED_OVERHEAD + + (msg->n_apc * SBP_SATELLITE_APC_ENCODED_LEN); } /** * Encode an instance of sbp_msg_ssr_satellite_apc_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_satellite_apc_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_satellite_apc_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_satellite_apc_t *msg); +SBP_EXPORT s8 +sbp_msg_ssr_satellite_apc_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_satellite_apc_t *msg); /** * Decode an instance of sbp_msg_ssr_satellite_apc_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ssr_satellite_apc_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_satellite_apc_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ssr_satellite_apc_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_satellite_apc_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_satellite_apc_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_satellite_apc_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_satellite_apc_t *msg); /** * Send an instance of sbp_msg_ssr_satellite_apc_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_satellite_apc_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_satellite_apc_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -136,51 +149,61 @@ SBP_EXPORT s8 sbp_msg_ssr_satellite_apc_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_satellite_apc_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_satellite_apc_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_satellite_apc_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_satellite_apc_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_satellite_apc_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_satellite_apc_t instance * @param b sbp_msg_ssr_satellite_apc_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_satellite_apc_cmp(const sbp_msg_ssr_satellite_apc_t *a, const sbp_msg_ssr_satellite_apc_t *b); +SBP_EXPORT int sbp_msg_ssr_satellite_apc_cmp( + const sbp_msg_ssr_satellite_apc_t *a, const sbp_msg_ssr_satellite_apc_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_satellite_apc_t &lhs, const sbp_msg_ssr_satellite_apc_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_satellite_apc_t &lhs, + const sbp_msg_ssr_satellite_apc_t &rhs) { return sbp_msg_ssr_satellite_apc_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_satellite_apc_t &lhs, const sbp_msg_ssr_satellite_apc_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_satellite_apc_t &lhs, + const sbp_msg_ssr_satellite_apc_t &rhs) { return sbp_msg_ssr_satellite_apc_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_satellite_apc_t &lhs, const sbp_msg_ssr_satellite_apc_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_satellite_apc_t &lhs, + const sbp_msg_ssr_satellite_apc_t &rhs) { return sbp_msg_ssr_satellite_apc_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_satellite_apc_t &lhs, const sbp_msg_ssr_satellite_apc_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_satellite_apc_t &lhs, + const sbp_msg_ssr_satellite_apc_t &rhs) { return sbp_msg_ssr_satellite_apc_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_satellite_apc_t &lhs, const sbp_msg_ssr_satellite_apc_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_satellite_apc_t &lhs, + const sbp_msg_ssr_satellite_apc_t &rhs) { return sbp_msg_ssr_satellite_apc_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_satellite_apc_t &lhs, const sbp_msg_ssr_satellite_apc_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_satellite_apc_t &lhs, + const sbp_msg_ssr_satellite_apc_t &rhs) { return sbp_msg_ssr_satellite_apc_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_SATELLITE_APC_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_SATELLITE_APC_DEP.h b/c/include/libsbp/ssr/MSG_SSR_SATELLITE_APC_DEP.h index 097118eef..77e7450a6 100644 --- a/c/include/libsbp/ssr/MSG_SSR_SATELLITE_APC_DEP.h +++ b/c/include/libsbp/ssr/MSG_SSR_SATELLITE_APC_DEP.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SSR_MSG_SSR_SATELLITE_APC_DEP_H #define LIBSBP_SSR_MSG_SSR_SATELLITE_APC_DEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,73 +41,91 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Satellite antenna phase center corrections + * Satellite antenna phase center corrections */ sbp_satellite_apc_t apc[SBP_MSG_SSR_SATELLITE_APC_DEP_APC_MAX]; /** * Number of elements in apc * - * When sending a message fill in this field with the number elements set in apc before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * apc before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in apc. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * apc. The value of any elements beyond the index specified in this field is + * undefined */ u8 n_apc; } sbp_msg_ssr_satellite_apc_dep_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_satellite_apc_dep_t * * @param msg sbp_msg_ssr_satellite_apc_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_satellite_apc_dep_encoded_len(const sbp_msg_ssr_satellite_apc_dep_t *msg) -{ - return SBP_MSG_SSR_SATELLITE_APC_DEP_ENCODED_OVERHEAD - + (msg->n_apc * SBP_SATELLITE_APC_ENCODED_LEN) - ; +static inline size_t sbp_msg_ssr_satellite_apc_dep_encoded_len( + const sbp_msg_ssr_satellite_apc_dep_t *msg) { + return SBP_MSG_SSR_SATELLITE_APC_DEP_ENCODED_OVERHEAD + + (msg->n_apc * SBP_SATELLITE_APC_ENCODED_LEN); } /** * Encode an instance of sbp_msg_ssr_satellite_apc_dep_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_satellite_apc_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_satellite_apc_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_satellite_apc_dep_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_satellite_apc_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_satellite_apc_dep_t *msg); /** - * Decode an instance of sbp_msg_ssr_satellite_apc_dep_t from wire representation + * Decode an instance of sbp_msg_ssr_satellite_apc_dep_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_satellite_apc_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_satellite_apc_dep_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ssr_satellite_apc_dep_t instance + * @param buf Wire representation of the sbp_msg_ssr_satellite_apc_dep_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_satellite_apc_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_satellite_apc_dep_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_satellite_apc_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_satellite_apc_dep_t *msg); /** - * Send an instance of sbp_msg_ssr_satellite_apc_dep_t with the given write function + * Send an instance of sbp_msg_ssr_satellite_apc_dep_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_satellite_apc_dep_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_satellite_apc_dep_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -115,51 +133,62 @@ SBP_EXPORT s8 sbp_msg_ssr_satellite_apc_dep_decode(const uint8_t *buf, uint8_t l * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_satellite_apc_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_satellite_apc_dep_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_satellite_apc_dep_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_satellite_apc_dep_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_satellite_apc_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_satellite_apc_dep_t instance * @param b sbp_msg_ssr_satellite_apc_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_satellite_apc_dep_cmp(const sbp_msg_ssr_satellite_apc_dep_t *a, const sbp_msg_ssr_satellite_apc_dep_t *b); +SBP_EXPORT int sbp_msg_ssr_satellite_apc_dep_cmp( + const sbp_msg_ssr_satellite_apc_dep_t *a, + const sbp_msg_ssr_satellite_apc_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_satellite_apc_dep_t &lhs, const sbp_msg_ssr_satellite_apc_dep_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_satellite_apc_dep_t &lhs, + const sbp_msg_ssr_satellite_apc_dep_t &rhs) { return sbp_msg_ssr_satellite_apc_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_satellite_apc_dep_t &lhs, const sbp_msg_ssr_satellite_apc_dep_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_satellite_apc_dep_t &lhs, + const sbp_msg_ssr_satellite_apc_dep_t &rhs) { return sbp_msg_ssr_satellite_apc_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_satellite_apc_dep_t &lhs, const sbp_msg_ssr_satellite_apc_dep_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_satellite_apc_dep_t &lhs, + const sbp_msg_ssr_satellite_apc_dep_t &rhs) { return sbp_msg_ssr_satellite_apc_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_satellite_apc_dep_t &lhs, const sbp_msg_ssr_satellite_apc_dep_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_satellite_apc_dep_t &lhs, + const sbp_msg_ssr_satellite_apc_dep_t &rhs) { return sbp_msg_ssr_satellite_apc_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_satellite_apc_dep_t &lhs, const sbp_msg_ssr_satellite_apc_dep_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_satellite_apc_dep_t &lhs, + const sbp_msg_ssr_satellite_apc_dep_t &rhs) { return sbp_msg_ssr_satellite_apc_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_satellite_apc_dep_t &lhs, const sbp_msg_ssr_satellite_apc_dep_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_satellite_apc_dep_t &lhs, + const sbp_msg_ssr_satellite_apc_dep_t &rhs) { return sbp_msg_ssr_satellite_apc_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_SATELLITE_APC_DEP_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_STEC_CORRECTION.h b/c/include/libsbp/ssr/MSG_SSR_STEC_CORRECTION.h index 1a07b5801..462a01884 100644 --- a/c/include/libsbp/ssr/MSG_SSR_STEC_CORRECTION.h +++ b/c/include/libsbp/ssr/MSG_SSR_STEC_CORRECTION.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_SSR_MSG_SSR_STEC_CORRECTION_H #define LIBSBP_SSR_MSG_SSR_STEC_CORRECTION_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,92 +41,101 @@ * *****************************************************************************/ typedef struct { - - /** -* Header of a STEC correction with bounds message. + * Header of a STEC correction with bounds message. */ sbp_bounds_header_t header; - /** -* IOD of the SSR atmospheric correction + * IOD of the SSR atmospheric correction */ u8 ssr_iod_atmo; - /** -* Tile set ID + * Tile set ID */ u16 tile_set_id; - /** -* Tile ID + * Tile ID */ u16 tile_id; - /** -* Number of satellites. + * Number of satellites. */ u8 n_sats; - /** -* Array of STEC polynomial coefficients for each space vehicle. + * Array of STEC polynomial coefficients for each space vehicle. */ - sbp_stec_sat_element_t stec_sat_list[SBP_MSG_SSR_STEC_CORRECTION_STEC_SAT_LIST_MAX]; + sbp_stec_sat_element_t + stec_sat_list[SBP_MSG_SSR_STEC_CORRECTION_STEC_SAT_LIST_MAX]; } sbp_msg_ssr_stec_correction_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_stec_correction_t * * @param msg sbp_msg_ssr_stec_correction_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_stec_correction_encoded_len(const sbp_msg_ssr_stec_correction_t *msg) -{ - return SBP_MSG_SSR_STEC_CORRECTION_ENCODED_OVERHEAD - + (msg->n_sats * SBP_STEC_SAT_ELEMENT_ENCODED_LEN) - ; +static inline size_t sbp_msg_ssr_stec_correction_encoded_len( + const sbp_msg_ssr_stec_correction_t *msg) { + return SBP_MSG_SSR_STEC_CORRECTION_ENCODED_OVERHEAD + + (msg->n_sats * SBP_STEC_SAT_ELEMENT_ENCODED_LEN); } /** * Encode an instance of sbp_msg_ssr_stec_correction_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_stec_correction_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_stec_correction_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_stec_correction_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_stec_correction_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_stec_correction_t *msg); /** * Decode an instance of sbp_msg_ssr_stec_correction_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ssr_stec_correction_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_stec_correction_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ssr_stec_correction_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_stec_correction_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_stec_correction_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_stec_correction_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_stec_correction_t *msg); /** - * Send an instance of sbp_msg_ssr_stec_correction_t with the given write function + * Send an instance of sbp_msg_ssr_stec_correction_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_stec_correction_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_stec_correction_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -134,51 +143,62 @@ SBP_EXPORT s8 sbp_msg_ssr_stec_correction_decode(const uint8_t *buf, uint8_t len * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_stec_correction_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_stec_correction_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_stec_correction_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_stec_correction_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_stec_correction_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_stec_correction_t instance * @param b sbp_msg_ssr_stec_correction_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_stec_correction_cmp(const sbp_msg_ssr_stec_correction_t *a, const sbp_msg_ssr_stec_correction_t *b); +SBP_EXPORT int sbp_msg_ssr_stec_correction_cmp( + const sbp_msg_ssr_stec_correction_t *a, + const sbp_msg_ssr_stec_correction_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_stec_correction_t &lhs, const sbp_msg_ssr_stec_correction_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_stec_correction_t &lhs, + const sbp_msg_ssr_stec_correction_t &rhs) { return sbp_msg_ssr_stec_correction_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_stec_correction_t &lhs, const sbp_msg_ssr_stec_correction_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_stec_correction_t &lhs, + const sbp_msg_ssr_stec_correction_t &rhs) { return sbp_msg_ssr_stec_correction_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_stec_correction_t &lhs, const sbp_msg_ssr_stec_correction_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_stec_correction_t &lhs, + const sbp_msg_ssr_stec_correction_t &rhs) { return sbp_msg_ssr_stec_correction_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_stec_correction_t &lhs, const sbp_msg_ssr_stec_correction_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_stec_correction_t &lhs, + const sbp_msg_ssr_stec_correction_t &rhs) { return sbp_msg_ssr_stec_correction_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_stec_correction_t &lhs, const sbp_msg_ssr_stec_correction_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_stec_correction_t &lhs, + const sbp_msg_ssr_stec_correction_t &rhs) { return sbp_msg_ssr_stec_correction_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_stec_correction_t &lhs, const sbp_msg_ssr_stec_correction_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_stec_correction_t &lhs, + const sbp_msg_ssr_stec_correction_t &rhs) { return sbp_msg_ssr_stec_correction_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_STEC_CORRECTION_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_STEC_CORRECTION_DEP.h b/c/include/libsbp/ssr/MSG_SSR_STEC_CORRECTION_DEP.h index ed968b849..6aef6af8a 100644 --- a/c/include/libsbp/ssr/MSG_SSR_STEC_CORRECTION_DEP.h +++ b/c/include/libsbp/ssr/MSG_SSR_STEC_CORRECTION_DEP.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_SSR_MSG_SSR_STEC_CORRECTION_DEP_H #define LIBSBP_SSR_MSG_SSR_STEC_CORRECTION_DEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,79 +42,98 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Header of a STEC polynomial coefficient message. + * Header of a STEC polynomial coefficient message. */ sbp_stec_header_t header; - /** -* Array of STEC polynomial coefficients for each space vehicle. + * Array of STEC polynomial coefficients for each space vehicle. */ - sbp_stec_sat_element_t stec_sat_list[SBP_MSG_SSR_STEC_CORRECTION_DEP_STEC_SAT_LIST_MAX]; + sbp_stec_sat_element_t + stec_sat_list[SBP_MSG_SSR_STEC_CORRECTION_DEP_STEC_SAT_LIST_MAX]; /** * Number of elements in stec_sat_list * - * When sending a message fill in this field with the number elements set in stec_sat_list before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * stec_sat_list before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in stec_sat_list. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * stec_sat_list. The value of any elements beyond the index specified in this + * field is undefined */ u8 n_stec_sat_list; } sbp_msg_ssr_stec_correction_dep_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_stec_correction_dep_t * * @param msg sbp_msg_ssr_stec_correction_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_stec_correction_dep_encoded_len(const sbp_msg_ssr_stec_correction_dep_t *msg) -{ - return SBP_MSG_SSR_STEC_CORRECTION_DEP_ENCODED_OVERHEAD - + (msg->n_stec_sat_list * SBP_STEC_SAT_ELEMENT_ENCODED_LEN) - ; +static inline size_t sbp_msg_ssr_stec_correction_dep_encoded_len( + const sbp_msg_ssr_stec_correction_dep_t *msg) { + return SBP_MSG_SSR_STEC_CORRECTION_DEP_ENCODED_OVERHEAD + + (msg->n_stec_sat_list * SBP_STEC_SAT_ELEMENT_ENCODED_LEN); } /** - * Encode an instance of sbp_msg_ssr_stec_correction_dep_t to wire representation + * Encode an instance of sbp_msg_ssr_stec_correction_dep_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_stec_correction_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_stec_correction_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_stec_correction_dep_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_stec_correction_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_stec_correction_dep_t *msg); /** - * Decode an instance of sbp_msg_ssr_stec_correction_dep_t from wire representation + * Decode an instance of sbp_msg_ssr_stec_correction_dep_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_stec_correction_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_stec_correction_dep_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ssr_stec_correction_dep_t instance + * @param buf Wire representation of the sbp_msg_ssr_stec_correction_dep_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_stec_correction_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_stec_correction_dep_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_stec_correction_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_stec_correction_dep_t *msg); /** - * Send an instance of sbp_msg_ssr_stec_correction_dep_t with the given write function + * Send an instance of sbp_msg_ssr_stec_correction_dep_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_stec_correction_dep_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_stec_correction_dep_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -122,51 +141,62 @@ SBP_EXPORT s8 sbp_msg_ssr_stec_correction_dep_decode(const uint8_t *buf, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_stec_correction_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_stec_correction_dep_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_stec_correction_dep_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_stec_correction_dep_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_stec_correction_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_stec_correction_dep_t instance * @param b sbp_msg_ssr_stec_correction_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_stec_correction_dep_cmp(const sbp_msg_ssr_stec_correction_dep_t *a, const sbp_msg_ssr_stec_correction_dep_t *b); +SBP_EXPORT int sbp_msg_ssr_stec_correction_dep_cmp( + const sbp_msg_ssr_stec_correction_dep_t *a, + const sbp_msg_ssr_stec_correction_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_stec_correction_dep_t &lhs, const sbp_msg_ssr_stec_correction_dep_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_stec_correction_dep_t &lhs, + const sbp_msg_ssr_stec_correction_dep_t &rhs) { return sbp_msg_ssr_stec_correction_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_stec_correction_dep_t &lhs, const sbp_msg_ssr_stec_correction_dep_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_stec_correction_dep_t &lhs, + const sbp_msg_ssr_stec_correction_dep_t &rhs) { return sbp_msg_ssr_stec_correction_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_stec_correction_dep_t &lhs, const sbp_msg_ssr_stec_correction_dep_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_stec_correction_dep_t &lhs, + const sbp_msg_ssr_stec_correction_dep_t &rhs) { return sbp_msg_ssr_stec_correction_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_stec_correction_dep_t &lhs, const sbp_msg_ssr_stec_correction_dep_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_stec_correction_dep_t &lhs, + const sbp_msg_ssr_stec_correction_dep_t &rhs) { return sbp_msg_ssr_stec_correction_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_stec_correction_dep_t &lhs, const sbp_msg_ssr_stec_correction_dep_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_stec_correction_dep_t &lhs, + const sbp_msg_ssr_stec_correction_dep_t &rhs) { return sbp_msg_ssr_stec_correction_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_stec_correction_dep_t &lhs, const sbp_msg_ssr_stec_correction_dep_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_stec_correction_dep_t &lhs, + const sbp_msg_ssr_stec_correction_dep_t &rhs) { return sbp_msg_ssr_stec_correction_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_STEC_CORRECTION_DEP_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_STEC_CORRECTION_DEP_A.h b/c/include/libsbp/ssr/MSG_SSR_STEC_CORRECTION_DEP_A.h index ad79a7cd1..bec803c03 100644 --- a/c/include/libsbp/ssr/MSG_SSR_STEC_CORRECTION_DEP_A.h +++ b/c/include/libsbp/ssr/MSG_SSR_STEC_CORRECTION_DEP_A.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_SSR_MSG_SSR_STEC_CORRECTION_DEP_A_H #define LIBSBP_SSR_MSG_SSR_STEC_CORRECTION_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,79 +42,98 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Header of a STEC message + * Header of a STEC message */ sbp_stec_header_dep_a_t header; - /** -* Array of STEC information for each space vehicle + * Array of STEC information for each space vehicle */ - sbp_stec_sat_element_t stec_sat_list[SBP_MSG_SSR_STEC_CORRECTION_DEP_A_STEC_SAT_LIST_MAX]; + sbp_stec_sat_element_t + stec_sat_list[SBP_MSG_SSR_STEC_CORRECTION_DEP_A_STEC_SAT_LIST_MAX]; /** * Number of elements in stec_sat_list * - * When sending a message fill in this field with the number elements set in stec_sat_list before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * stec_sat_list before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in stec_sat_list. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * stec_sat_list. The value of any elements beyond the index specified in this + * field is undefined */ u8 n_stec_sat_list; } sbp_msg_ssr_stec_correction_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_stec_correction_dep_a_t * * @param msg sbp_msg_ssr_stec_correction_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_stec_correction_dep_a_encoded_len(const sbp_msg_ssr_stec_correction_dep_a_t *msg) -{ - return SBP_MSG_SSR_STEC_CORRECTION_DEP_A_ENCODED_OVERHEAD - + (msg->n_stec_sat_list * SBP_STEC_SAT_ELEMENT_ENCODED_LEN) - ; +static inline size_t sbp_msg_ssr_stec_correction_dep_a_encoded_len( + const sbp_msg_ssr_stec_correction_dep_a_t *msg) { + return SBP_MSG_SSR_STEC_CORRECTION_DEP_A_ENCODED_OVERHEAD + + (msg->n_stec_sat_list * SBP_STEC_SAT_ELEMENT_ENCODED_LEN); } /** - * Encode an instance of sbp_msg_ssr_stec_correction_dep_a_t to wire representation + * Encode an instance of sbp_msg_ssr_stec_correction_dep_a_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_stec_correction_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_stec_correction_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_stec_correction_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_stec_correction_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_stec_correction_dep_a_t *msg); /** - * Decode an instance of sbp_msg_ssr_stec_correction_dep_a_t from wire representation + * Decode an instance of sbp_msg_ssr_stec_correction_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_stec_correction_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_stec_correction_dep_a_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ssr_stec_correction_dep_a_t instance + * @param buf Wire representation of the sbp_msg_ssr_stec_correction_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_stec_correction_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_stec_correction_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_stec_correction_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_stec_correction_dep_a_t *msg); /** - * Send an instance of sbp_msg_ssr_stec_correction_dep_a_t with the given write function + * Send an instance of sbp_msg_ssr_stec_correction_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_stec_correction_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_stec_correction_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -122,51 +141,62 @@ SBP_EXPORT s8 sbp_msg_ssr_stec_correction_dep_a_decode(const uint8_t *buf, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_stec_correction_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_stec_correction_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_stec_correction_dep_a_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_stec_correction_dep_a_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_stec_correction_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_stec_correction_dep_a_t instance * @param b sbp_msg_ssr_stec_correction_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_stec_correction_dep_a_cmp(const sbp_msg_ssr_stec_correction_dep_a_t *a, const sbp_msg_ssr_stec_correction_dep_a_t *b); +SBP_EXPORT int sbp_msg_ssr_stec_correction_dep_a_cmp( + const sbp_msg_ssr_stec_correction_dep_a_t *a, + const sbp_msg_ssr_stec_correction_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_stec_correction_dep_a_t &lhs, const sbp_msg_ssr_stec_correction_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_stec_correction_dep_a_t &lhs, + const sbp_msg_ssr_stec_correction_dep_a_t &rhs) { return sbp_msg_ssr_stec_correction_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_stec_correction_dep_a_t &lhs, const sbp_msg_ssr_stec_correction_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_stec_correction_dep_a_t &lhs, + const sbp_msg_ssr_stec_correction_dep_a_t &rhs) { return sbp_msg_ssr_stec_correction_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_stec_correction_dep_a_t &lhs, const sbp_msg_ssr_stec_correction_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_stec_correction_dep_a_t &lhs, + const sbp_msg_ssr_stec_correction_dep_a_t &rhs) { return sbp_msg_ssr_stec_correction_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_stec_correction_dep_a_t &lhs, const sbp_msg_ssr_stec_correction_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_stec_correction_dep_a_t &lhs, + const sbp_msg_ssr_stec_correction_dep_a_t &rhs) { return sbp_msg_ssr_stec_correction_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_stec_correction_dep_a_t &lhs, const sbp_msg_ssr_stec_correction_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_stec_correction_dep_a_t &lhs, + const sbp_msg_ssr_stec_correction_dep_a_t &rhs) { return sbp_msg_ssr_stec_correction_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_stec_correction_dep_a_t &lhs, const sbp_msg_ssr_stec_correction_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_stec_correction_dep_a_t &lhs, + const sbp_msg_ssr_stec_correction_dep_a_t &rhs) { return sbp_msg_ssr_stec_correction_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_STEC_CORRECTION_DEP_A_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_TILE_DEFINITION.h b/c/include/libsbp/ssr/MSG_SSR_TILE_DEFINITION.h index ad4bb1cd6..cb8499a36 100644 --- a/c/include/libsbp/ssr/MSG_SSR_TILE_DEFINITION.h +++ b/c/include/libsbp/ssr/MSG_SSR_TILE_DEFINITION.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SSR_MSG_SSR_TILE_DEFINITION_H #define LIBSBP_SSR_MSG_SSR_TILE_DEFINITION_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,123 +42,119 @@ /** Definition of a SSR atmospheric correction tile. * - * Provides the correction point coordinates for the atmospheric correction values in the MSG_SSR_STEC_CORRECTION and MSG_SSR_GRIDDED_CORRECTION messages. - * + * Provides the correction point coordinates for the atmospheric correction + values in the MSG_SSR_STEC_CORRECTION and MSG_SSR_GRIDDED_CORRECTION messages. + * */ typedef struct { - - /** -* GNSS reference time of the correction + * GNSS reference time of the correction */ sbp_gps_time_sec_t time; - /** - * Update interval between consecutive corrections. Encoded following RTCM DF391 specification. + * Update interval between consecutive corrections. Encoded following RTCM + * DF391 specification. */ u8 update_interval; - /** -* SSR Solution ID. Similar to RTCM DF415. + * SSR Solution ID. Similar to RTCM DF415. */ u8 sol_id; - /** - * IOD of the SSR atmospheric correction. + * IOD of the SSR atmospheric correction. */ u8 iod_atmo; - /** -* Unique identifier of the tile set this tile belongs to. + * Unique identifier of the tile set this tile belongs to. */ u16 tile_set_id; - /** - * Unique identifier of this tile in the tile set. - * See GNSS-SSR-ArrayOfCorrectionPoints field correctionPointSetID. + * Unique identifier of this tile in the tile set. + * See GNSS-SSR-ArrayOfCorrectionPoints field correctionPointSetID. */ u16 tile_id; - /** - * North-West corner correction point latitude. - * - * The relation between the latitude X in the range [-90, 90] and the coded number N is: N = floor((X / 90) * 2^14) - * - * See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLatitude. [encoded degrees] + * North-West corner correction point latitude. + * + * The relation between the latitude X in the range [-90, 90] and the coded + * number N is: N = floor((X / 90) * 2^14) + * + * See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLatitude. [encoded + * degrees] */ s16 corner_nw_lat; - /** - * North-West corner correction point longitude. - * - * The relation between the longitude X in the range [-180, 180] and the coded number N is: N = floor((X / 180) * 2^15) - * - * See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLongitude. [encoded degrees] + * North-West corner correction point longitude. + * + * The relation between the longitude X in the range [-180, 180] and the coded + * number N is: N = floor((X / 180) * 2^15) + * + * See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLongitude. + * [encoded degrees] */ s16 corner_nw_lon; - /** - * Spacing of the correction points in the latitude direction. - * - * See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLatitude. [0.01 degrees] + * Spacing of the correction points in the latitude direction. + * + * See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLatitude. [0.01 degrees] */ u16 spacing_lat; - /** - * Spacing of the correction points in the longitude direction. - * - * See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLongitude. [0.01 degrees] + * Spacing of the correction points in the longitude direction. + * + * See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLongitude. [0.01 degrees] */ u16 spacing_lon; - /** - * Number of steps in the latitude direction. - * - * See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLatitude. + * Number of steps in the latitude direction. + * + * See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLatitude. */ u16 rows; - /** - * Number of steps in the longitude direction. - * - * See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLongitude. + * Number of steps in the longitude direction. + * + * See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLongitude. */ u16 cols; - /** - * Specifies the absence of correction data at the correction points in the array (grid). - * - * Only the first rows * cols bits are used, and if a specific bit is enabled (set to 1), the correction is not available. If there are more than 64 correction points the remaining corrections are always available. - * - * The correction points are packed by rows, starting with the northwest corner of the array (top-left on a north oriented map), with each row spanning west to east, ending with the southeast corner of the array. - * - * See GNSS-SSR-ArrayOfCorrectionPoints field bitmaskOfGrids but note the definition of the bits is inverted. + * Specifies the absence of correction data at the correction points in the + * array (grid). + * + * Only the first rows * cols bits are used, and if a specific bit is enabled + * (set to 1), the correction is not available. If there are more than 64 + * correction points the remaining corrections are always available. + * + * The correction points are packed by rows, starting with the northwest + * corner of the array (top-left on a north oriented map), with each row + * spanning west to east, ending with the southeast corner of the array. + * + * See GNSS-SSR-ArrayOfCorrectionPoints field bitmaskOfGrids but note the + * definition of the bits is inverted. */ u64 bitmask; } sbp_msg_ssr_tile_definition_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_tile_definition_t * * @param msg sbp_msg_ssr_tile_definition_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_tile_definition_encoded_len(const sbp_msg_ssr_tile_definition_t *msg) -{ +static inline size_t sbp_msg_ssr_tile_definition_encoded_len( + const sbp_msg_ssr_tile_definition_t *msg) { (void)msg; return SBP_MSG_SSR_TILE_DEFINITION_ENCODED_LEN; } @@ -166,36 +162,54 @@ static inline size_t sbp_msg_ssr_tile_definition_encoded_len(const sbp_msg_ssr_t /** * Encode an instance of sbp_msg_ssr_tile_definition_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_tile_definition_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_tile_definition_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_tile_definition_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_tile_definition_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_tile_definition_t *msg); /** * Decode an instance of sbp_msg_ssr_tile_definition_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ssr_tile_definition_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_tile_definition_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ssr_tile_definition_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_tile_definition_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_tile_definition_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_tile_definition_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_tile_definition_t *msg); /** - * Send an instance of sbp_msg_ssr_tile_definition_t with the given write function + * Send an instance of sbp_msg_ssr_tile_definition_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_tile_definition_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_tile_definition_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -203,51 +217,62 @@ SBP_EXPORT s8 sbp_msg_ssr_tile_definition_decode(const uint8_t *buf, uint8_t len * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_tile_definition_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_tile_definition_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_tile_definition_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_tile_definition_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_tile_definition_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_tile_definition_t instance * @param b sbp_msg_ssr_tile_definition_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_tile_definition_cmp(const sbp_msg_ssr_tile_definition_t *a, const sbp_msg_ssr_tile_definition_t *b); +SBP_EXPORT int sbp_msg_ssr_tile_definition_cmp( + const sbp_msg_ssr_tile_definition_t *a, + const sbp_msg_ssr_tile_definition_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_tile_definition_t &lhs, const sbp_msg_ssr_tile_definition_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_tile_definition_t &lhs, + const sbp_msg_ssr_tile_definition_t &rhs) { return sbp_msg_ssr_tile_definition_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_tile_definition_t &lhs, const sbp_msg_ssr_tile_definition_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_tile_definition_t &lhs, + const sbp_msg_ssr_tile_definition_t &rhs) { return sbp_msg_ssr_tile_definition_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_tile_definition_t &lhs, const sbp_msg_ssr_tile_definition_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_tile_definition_t &lhs, + const sbp_msg_ssr_tile_definition_t &rhs) { return sbp_msg_ssr_tile_definition_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_tile_definition_t &lhs, const sbp_msg_ssr_tile_definition_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_tile_definition_t &lhs, + const sbp_msg_ssr_tile_definition_t &rhs) { return sbp_msg_ssr_tile_definition_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_tile_definition_t &lhs, const sbp_msg_ssr_tile_definition_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_tile_definition_t &lhs, + const sbp_msg_ssr_tile_definition_t &rhs) { return sbp_msg_ssr_tile_definition_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_tile_definition_t &lhs, const sbp_msg_ssr_tile_definition_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_tile_definition_t &lhs, + const sbp_msg_ssr_tile_definition_t &rhs) { return sbp_msg_ssr_tile_definition_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_TILE_DEFINITION_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_TILE_DEFINITION_DEP_A.h b/c/include/libsbp/ssr/MSG_SSR_TILE_DEFINITION_DEP_A.h index 871ceb109..301fa1b61 100644 --- a/c/include/libsbp/ssr/MSG_SSR_TILE_DEFINITION_DEP_A.h +++ b/c/include/libsbp/ssr/MSG_SSR_TILE_DEFINITION_DEP_A.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SSR_MSG_SSR_TILE_DEFINITION_DEP_A_H #define LIBSBP_SSR_MSG_SSR_TILE_DEFINITION_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,139 +40,160 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Unique identifier of the tile set this tile belongs to. + * Unique identifier of the tile set this tile belongs to. */ u16 tile_set_id; - /** - * Unique identifier of this tile in the tile set. - * See GNSS-SSR-ArrayOfCorrectionPoints field correctionPointSetID. + * Unique identifier of this tile in the tile set. + * See GNSS-SSR-ArrayOfCorrectionPoints field correctionPointSetID. */ u16 tile_id; - /** - * North-West corner correction point latitude. - * - * The relation between the latitude X in the range [-90, 90] and the coded number N is: - * - * N = floor((X / 90) * 2^14) - * - * See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLatitude. [encoded degrees] + * North-West corner correction point latitude. + * + * The relation between the latitude X in the range [-90, 90] and the coded + * number N is: + * + * N = floor((X / 90) * 2^14) + * + * See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLatitude. [encoded + * degrees] */ s16 corner_nw_lat; - /** - * North-West corner correction point longitude. - * - * The relation between the longitude X in the range [-180, 180] and the coded number N is: - * - * N = floor((X / 180) * 2^15) - * - * See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLongitude. [encoded degrees] + * North-West corner correction point longitude. + * + * The relation between the longitude X in the range [-180, 180] and the coded + * number N is: + * + * N = floor((X / 180) * 2^15) + * + * See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLongitude. + * [encoded degrees] */ s16 corner_nw_lon; - /** - * Spacing of the correction points in the latitude direction. - * - * See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLatitude. [0.01 degrees] + * Spacing of the correction points in the latitude direction. + * + * See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLatitude. [0.01 degrees] */ u16 spacing_lat; - /** - * Spacing of the correction points in the longitude direction. - * - * See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLongitude. [0.01 degrees] + * Spacing of the correction points in the longitude direction. + * + * See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLongitude. [0.01 degrees] */ u16 spacing_lon; - /** - * Number of steps in the latitude direction. - * - * See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLatitude. + * Number of steps in the latitude direction. + * + * See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLatitude. */ u16 rows; - /** - * Number of steps in the longitude direction. - * - * See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLongitude. + * Number of steps in the longitude direction. + * + * See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLongitude. */ u16 cols; - /** - * Specifies the availability of correction data at the correction points in the array. - * - * If a specific bit is enabled (set to 1), the correction is not available. Only the first rows * cols bits are used, the remainder are set to 0. If there are more then 64 correction points the remaining corrections are always available. - * - * Starting with the northwest corner of the array (top left on a north oriented map) the correction points are enumerated with row precedence - first row west to east, second row west to east, until last row west to east - ending with the southeast corner of the array. - * - * See GNSS-SSR-ArrayOfCorrectionPoints field bitmaskOfGrids but note the definition of the bits is inverted. + * Specifies the availability of correction data at the correction points in + * the array. + * + * If a specific bit is enabled (set to 1), the correction is not available. + * Only the first rows * cols bits are used, the remainder are set to 0. If + * there are more then 64 correction points the remaining corrections are + * always available. + * + * Starting with the northwest corner of the array (top left on a north + * oriented map) the correction points are enumerated with row precedence - + * first row west to east, second row west to east, until last row west to + * east - ending with the southeast corner of the array. + * + * See GNSS-SSR-ArrayOfCorrectionPoints field bitmaskOfGrids but note the + * definition of the bits is inverted. */ u64 bitmask; } sbp_msg_ssr_tile_definition_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_tile_definition_dep_a_t * * @param msg sbp_msg_ssr_tile_definition_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_tile_definition_dep_a_encoded_len(const sbp_msg_ssr_tile_definition_dep_a_t *msg) -{ +static inline size_t sbp_msg_ssr_tile_definition_dep_a_encoded_len( + const sbp_msg_ssr_tile_definition_dep_a_t *msg) { (void)msg; return SBP_MSG_SSR_TILE_DEFINITION_DEP_A_ENCODED_LEN; } /** - * Encode an instance of sbp_msg_ssr_tile_definition_dep_a_t to wire representation + * Encode an instance of sbp_msg_ssr_tile_definition_dep_a_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_tile_definition_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_tile_definition_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_tile_definition_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_tile_definition_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_tile_definition_dep_a_t *msg); /** - * Decode an instance of sbp_msg_ssr_tile_definition_dep_a_t from wire representation + * Decode an instance of sbp_msg_ssr_tile_definition_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_tile_definition_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_tile_definition_dep_a_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ssr_tile_definition_dep_a_t instance + * @param buf Wire representation of the sbp_msg_ssr_tile_definition_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_tile_definition_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_tile_definition_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_tile_definition_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_tile_definition_dep_a_t *msg); /** - * Send an instance of sbp_msg_ssr_tile_definition_dep_a_t with the given write function + * Send an instance of sbp_msg_ssr_tile_definition_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_tile_definition_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_tile_definition_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -180,51 +201,62 @@ SBP_EXPORT s8 sbp_msg_ssr_tile_definition_dep_a_decode(const uint8_t *buf, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_tile_definition_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_tile_definition_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_tile_definition_dep_a_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_tile_definition_dep_a_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_tile_definition_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_tile_definition_dep_a_t instance * @param b sbp_msg_ssr_tile_definition_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_tile_definition_dep_a_cmp(const sbp_msg_ssr_tile_definition_dep_a_t *a, const sbp_msg_ssr_tile_definition_dep_a_t *b); +SBP_EXPORT int sbp_msg_ssr_tile_definition_dep_a_cmp( + const sbp_msg_ssr_tile_definition_dep_a_t *a, + const sbp_msg_ssr_tile_definition_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_tile_definition_dep_a_t &lhs, const sbp_msg_ssr_tile_definition_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_tile_definition_dep_a_t &lhs, + const sbp_msg_ssr_tile_definition_dep_a_t &rhs) { return sbp_msg_ssr_tile_definition_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_tile_definition_dep_a_t &lhs, const sbp_msg_ssr_tile_definition_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_tile_definition_dep_a_t &lhs, + const sbp_msg_ssr_tile_definition_dep_a_t &rhs) { return sbp_msg_ssr_tile_definition_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_tile_definition_dep_a_t &lhs, const sbp_msg_ssr_tile_definition_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_tile_definition_dep_a_t &lhs, + const sbp_msg_ssr_tile_definition_dep_a_t &rhs) { return sbp_msg_ssr_tile_definition_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_tile_definition_dep_a_t &lhs, const sbp_msg_ssr_tile_definition_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_tile_definition_dep_a_t &lhs, + const sbp_msg_ssr_tile_definition_dep_a_t &rhs) { return sbp_msg_ssr_tile_definition_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_tile_definition_dep_a_t &lhs, const sbp_msg_ssr_tile_definition_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_tile_definition_dep_a_t &lhs, + const sbp_msg_ssr_tile_definition_dep_a_t &rhs) { return sbp_msg_ssr_tile_definition_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_tile_definition_dep_a_t &lhs, const sbp_msg_ssr_tile_definition_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_tile_definition_dep_a_t &lhs, + const sbp_msg_ssr_tile_definition_dep_a_t &rhs) { return sbp_msg_ssr_tile_definition_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_TILE_DEFINITION_DEP_A_H */ - diff --git a/c/include/libsbp/ssr/MSG_SSR_TILE_DEFINITION_DEP_B.h b/c/include/libsbp/ssr/MSG_SSR_TILE_DEFINITION_DEP_B.h index b120bce5a..4f7ea84f3 100644 --- a/c/include/libsbp/ssr/MSG_SSR_TILE_DEFINITION_DEP_B.h +++ b/c/include/libsbp/ssr/MSG_SSR_TILE_DEFINITION_DEP_B.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SSR_MSG_SSR_TILE_DEFINITION_DEP_B_H #define LIBSBP_SSR_MSG_SSR_TILE_DEFINITION_DEP_B_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,145 +40,165 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* SSR Solution ID. + * SSR Solution ID. */ u8 ssr_sol_id; - /** -* Unique identifier of the tile set this tile belongs to. + * Unique identifier of the tile set this tile belongs to. */ u16 tile_set_id; - /** - * Unique identifier of this tile in the tile set. - * See GNSS-SSR-ArrayOfCorrectionPoints field correctionPointSetID. + * Unique identifier of this tile in the tile set. + * See GNSS-SSR-ArrayOfCorrectionPoints field correctionPointSetID. */ u16 tile_id; - /** - * North-West corner correction point latitude. - * - * The relation between the latitude X in the range [-90, 90] and the coded number N is: - * - * N = floor((X / 90) * 2^14) - * - * See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLatitude. [encoded degrees] + * North-West corner correction point latitude. + * + * The relation between the latitude X in the range [-90, 90] and the coded + * number N is: + * + * N = floor((X / 90) * 2^14) + * + * See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLatitude. [encoded + * degrees] */ s16 corner_nw_lat; - /** - * North-West corner correction point longitude. - * - * The relation between the longitude X in the range [-180, 180] and the coded number N is: - * - * N = floor((X / 180) * 2^15) - * - * See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLongitude. [encoded degrees] + * North-West corner correction point longitude. + * + * The relation between the longitude X in the range [-180, 180] and the coded + * number N is: + * + * N = floor((X / 180) * 2^15) + * + * See GNSS-SSR-ArrayOfCorrectionPoints field referencePointLongitude. + * [encoded degrees] */ s16 corner_nw_lon; - /** - * Spacing of the correction points in the latitude direction. - * - * See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLatitude. [0.01 degrees] + * Spacing of the correction points in the latitude direction. + * + * See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLatitude. [0.01 degrees] */ u16 spacing_lat; - /** - * Spacing of the correction points in the longitude direction. - * - * See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLongitude. [0.01 degrees] + * Spacing of the correction points in the longitude direction. + * + * See GNSS-SSR-ArrayOfCorrectionPoints field stepOfLongitude. [0.01 degrees] */ u16 spacing_lon; - /** - * Number of steps in the latitude direction. - * - * See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLatitude. + * Number of steps in the latitude direction. + * + * See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLatitude. */ u16 rows; - /** - * Number of steps in the longitude direction. - * - * See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLongitude. + * Number of steps in the longitude direction. + * + * See GNSS-SSR-ArrayOfCorrectionPoints field numberOfStepsLongitude. */ u16 cols; - /** - * Specifies the availability of correction data at the correction points in the array. - * - * If a specific bit is enabled (set to 1), the correction is not available. Only the first rows * cols bits are used, the remainder are set to 0. If there are more then 64 correction points the remaining corrections are always available. - * - * Starting with the northwest corner of the array (top left on a north oriented map) the correction points are enumerated with row precedence - first row west to east, second row west to east, until last row west to east - ending with the southeast corner of the array. - * - * See GNSS-SSR-ArrayOfCorrectionPoints field bitmaskOfGrids but note the definition of the bits is inverted. + * Specifies the availability of correction data at the correction points in + * the array. + * + * If a specific bit is enabled (set to 1), the correction is not available. + * Only the first rows * cols bits are used, the remainder are set to 0. If + * there are more then 64 correction points the remaining corrections are + * always available. + * + * Starting with the northwest corner of the array (top left on a north + * oriented map) the correction points are enumerated with row precedence - + * first row west to east, second row west to east, until last row west to + * east - ending with the southeast corner of the array. + * + * See GNSS-SSR-ArrayOfCorrectionPoints field bitmaskOfGrids but note the + * definition of the bits is inverted. */ u64 bitmask; } sbp_msg_ssr_tile_definition_dep_b_t; - - /** * Get encoded size of an instance of sbp_msg_ssr_tile_definition_dep_b_t * * @param msg sbp_msg_ssr_tile_definition_dep_b_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ssr_tile_definition_dep_b_encoded_len(const sbp_msg_ssr_tile_definition_dep_b_t *msg) -{ +static inline size_t sbp_msg_ssr_tile_definition_dep_b_encoded_len( + const sbp_msg_ssr_tile_definition_dep_b_t *msg) { (void)msg; return SBP_MSG_SSR_TILE_DEFINITION_DEP_B_ENCODED_LEN; } /** - * Encode an instance of sbp_msg_ssr_tile_definition_dep_b_t to wire representation + * Encode an instance of sbp_msg_ssr_tile_definition_dep_b_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ssr_tile_definition_dep_b_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_tile_definition_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_tile_definition_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_tile_definition_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_tile_definition_dep_b_t *msg); /** - * Decode an instance of sbp_msg_ssr_tile_definition_dep_b_t from wire representation + * Decode an instance of sbp_msg_ssr_tile_definition_dep_b_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_ssr_tile_definition_dep_b_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_ssr_tile_definition_dep_b_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ssr_tile_definition_dep_b_t instance + * @param buf Wire representation of the sbp_msg_ssr_tile_definition_dep_b_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_tile_definition_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_tile_definition_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_ssr_tile_definition_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_tile_definition_dep_b_t *msg); /** - * Send an instance of sbp_msg_ssr_tile_definition_dep_b_t with the given write function + * Send an instance of sbp_msg_ssr_tile_definition_dep_b_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ssr_tile_definition_dep_b_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ssr_tile_definition_dep_b_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -186,51 +206,62 @@ SBP_EXPORT s8 sbp_msg_ssr_tile_definition_dep_b_decode(const uint8_t *buf, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ssr_tile_definition_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_tile_definition_dep_b_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ssr_tile_definition_dep_b_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_tile_definition_dep_b_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ssr_tile_definition_dep_b_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ssr_tile_definition_dep_b_t instance * @param b sbp_msg_ssr_tile_definition_dep_b_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ssr_tile_definition_dep_b_cmp(const sbp_msg_ssr_tile_definition_dep_b_t *a, const sbp_msg_ssr_tile_definition_dep_b_t *b); +SBP_EXPORT int sbp_msg_ssr_tile_definition_dep_b_cmp( + const sbp_msg_ssr_tile_definition_dep_b_t *a, + const sbp_msg_ssr_tile_definition_dep_b_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ssr_tile_definition_dep_b_t &lhs, const sbp_msg_ssr_tile_definition_dep_b_t &rhs) { +static inline bool operator==(const sbp_msg_ssr_tile_definition_dep_b_t &lhs, + const sbp_msg_ssr_tile_definition_dep_b_t &rhs) { return sbp_msg_ssr_tile_definition_dep_b_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ssr_tile_definition_dep_b_t &lhs, const sbp_msg_ssr_tile_definition_dep_b_t &rhs) { +static inline bool operator!=(const sbp_msg_ssr_tile_definition_dep_b_t &lhs, + const sbp_msg_ssr_tile_definition_dep_b_t &rhs) { return sbp_msg_ssr_tile_definition_dep_b_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ssr_tile_definition_dep_b_t &lhs, const sbp_msg_ssr_tile_definition_dep_b_t &rhs) { +static inline bool operator<(const sbp_msg_ssr_tile_definition_dep_b_t &lhs, + const sbp_msg_ssr_tile_definition_dep_b_t &rhs) { return sbp_msg_ssr_tile_definition_dep_b_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ssr_tile_definition_dep_b_t &lhs, const sbp_msg_ssr_tile_definition_dep_b_t &rhs) { +static inline bool operator<=(const sbp_msg_ssr_tile_definition_dep_b_t &lhs, + const sbp_msg_ssr_tile_definition_dep_b_t &rhs) { return sbp_msg_ssr_tile_definition_dep_b_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ssr_tile_definition_dep_b_t &lhs, const sbp_msg_ssr_tile_definition_dep_b_t &rhs) { +static inline bool operator>(const sbp_msg_ssr_tile_definition_dep_b_t &lhs, + const sbp_msg_ssr_tile_definition_dep_b_t &rhs) { return sbp_msg_ssr_tile_definition_dep_b_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ssr_tile_definition_dep_b_t &lhs, const sbp_msg_ssr_tile_definition_dep_b_t &rhs) { +static inline bool operator>=(const sbp_msg_ssr_tile_definition_dep_b_t &lhs, + const sbp_msg_ssr_tile_definition_dep_b_t &rhs) { return sbp_msg_ssr_tile_definition_dep_b_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_MSG_SSR_TILE_DEFINITION_DEP_B_H */ - diff --git a/c/include/libsbp/ssr/OrbitClockBound.h b/c/include/libsbp/ssr/OrbitClockBound.h index 0b7ab9544..a917fb1fe 100644 --- a/c/include/libsbp/ssr/OrbitClockBound.h +++ b/c/include/libsbp/ssr/OrbitClockBound.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SSR_ORBITCLOCKBOUND_H #define LIBSBP_SSR_ORBITCLOCKBOUND_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,75 +40,64 @@ *****************************************************************************/ /** None * -* Orbit and clock bound. + * Orbit and clock bound. */ typedef struct { - - /** - * Satellite ID. Similar to either RTCM DF068 (GPS), DF252 (Galileo), or DF488 (BDS) depending on the constellation. + * Satellite ID. Similar to either RTCM DF068 (GPS), DF252 (Galileo), or DF488 + * (BDS) depending on the constellation. */ u8 sat_id; - /** - * Mean Radial. See Note 1. [m] + * Mean Radial. See Note 1. [m] */ u8 orb_radial_bound_mu; - /** - * Mean Along-Track. See Note 1. [m] + * Mean Along-Track. See Note 1. [m] */ u8 orb_along_bound_mu; - /** - * Mean Cross-Track. See Note 1. [m] + * Mean Cross-Track. See Note 1. [m] */ u8 orb_cross_bound_mu; - /** - * Standard Deviation Radial. See Note 2. [m] + * Standard Deviation Radial. See Note 2. [m] */ u8 orb_radial_bound_sig; - /** - * Standard Deviation Along-Track. See Note 2. [m] + * Standard Deviation Along-Track. See Note 2. [m] */ u8 orb_along_bound_sig; - /** - * Standard Deviation Cross-Track. See Note 2. [m] + * Standard Deviation Cross-Track. See Note 2. [m] */ u8 orb_cross_bound_sig; - /** - * Clock Bound Mean. See Note 1. [m] + * Clock Bound Mean. See Note 1. [m] */ u8 clock_bound_mu; - /** - * Clock Bound Standard Deviation. See Note 2. [m] + * Clock Bound Standard Deviation. See Note 2. [m] */ u8 clock_bound_sig; } sbp_orbit_clock_bound_t; - - /** * Get encoded size of an instance of sbp_orbit_clock_bound_t * * @param msg sbp_orbit_clock_bound_t instance * @return Length of on-wire representation */ -static inline size_t sbp_orbit_clock_bound_encoded_len(const sbp_orbit_clock_bound_t *msg) -{ +static inline size_t sbp_orbit_clock_bound_encoded_len( + const sbp_orbit_clock_bound_t *msg) { (void)msg; return SBP_ORBIT_CLOCK_BOUND_ENCODED_LEN; } @@ -116,74 +105,96 @@ static inline size_t sbp_orbit_clock_bound_encoded_len(const sbp_orbit_clock_bou /** * Encode an instance of sbp_orbit_clock_bound_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_orbit_clock_bound_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_orbit_clock_bound_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_orbit_clock_bound_t *msg); +SBP_EXPORT s8 sbp_orbit_clock_bound_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_orbit_clock_bound_t *msg); /** * Decode an instance of sbp_orbit_clock_bound_t from wire representation * - * This function decodes the wire representation of a sbp_orbit_clock_bound_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_orbit_clock_bound_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_orbit_clock_bound_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_orbit_clock_bound_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_orbit_clock_bound_t *msg); +SBP_EXPORT s8 sbp_orbit_clock_bound_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_orbit_clock_bound_t *msg); /** * Compare two instances of sbp_orbit_clock_bound_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_orbit_clock_bound_t instance * @param b sbp_orbit_clock_bound_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_orbit_clock_bound_cmp(const sbp_orbit_clock_bound_t *a, const sbp_orbit_clock_bound_t *b); +SBP_EXPORT int sbp_orbit_clock_bound_cmp(const sbp_orbit_clock_bound_t *a, + const sbp_orbit_clock_bound_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_orbit_clock_bound_t &lhs, const sbp_orbit_clock_bound_t &rhs) { +static inline bool operator==(const sbp_orbit_clock_bound_t &lhs, + const sbp_orbit_clock_bound_t &rhs) { return sbp_orbit_clock_bound_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_orbit_clock_bound_t &lhs, const sbp_orbit_clock_bound_t &rhs) { +static inline bool operator!=(const sbp_orbit_clock_bound_t &lhs, + const sbp_orbit_clock_bound_t &rhs) { return sbp_orbit_clock_bound_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_orbit_clock_bound_t &lhs, const sbp_orbit_clock_bound_t &rhs) { +static inline bool operator<(const sbp_orbit_clock_bound_t &lhs, + const sbp_orbit_clock_bound_t &rhs) { return sbp_orbit_clock_bound_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_orbit_clock_bound_t &lhs, const sbp_orbit_clock_bound_t &rhs) { +static inline bool operator<=(const sbp_orbit_clock_bound_t &lhs, + const sbp_orbit_clock_bound_t &rhs) { return sbp_orbit_clock_bound_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_orbit_clock_bound_t &lhs, const sbp_orbit_clock_bound_t &rhs) { +static inline bool operator>(const sbp_orbit_clock_bound_t &lhs, + const sbp_orbit_clock_bound_t &rhs) { return sbp_orbit_clock_bound_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_orbit_clock_bound_t &lhs, const sbp_orbit_clock_bound_t &rhs) { +static inline bool operator>=(const sbp_orbit_clock_bound_t &lhs, + const sbp_orbit_clock_bound_t &rhs) { return sbp_orbit_clock_bound_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_ORBITCLOCKBOUND_H */ - diff --git a/c/include/libsbp/ssr/OrbitClockBoundDegradation.h b/c/include/libsbp/ssr/OrbitClockBoundDegradation.h index ab889bb34..cc8f6fc7e 100644 --- a/c/include/libsbp/ssr/OrbitClockBoundDegradation.h +++ b/c/include/libsbp/ssr/OrbitClockBoundDegradation.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SSR_ORBITCLOCKBOUNDDEGRADATION_H #define LIBSBP_SSR_ORBITCLOCKBOUNDDEGRADATION_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,144 +40,165 @@ *****************************************************************************/ /** None * -* Orbit and clock bound degradation. + * Orbit and clock bound degradation. */ typedef struct { - - /** - * Orbit Bound Mean Radial First derivative. Range: 0-0.255 m/s [0.001 m/s] + * Orbit Bound Mean Radial First derivative. Range: 0-0.255 m/s [0.001 m/s] */ u8 orb_radial_bound_mu_dot; - /** - * Orbit Bound Mean Along-Track First derivative. Range: 0-0.255 m/s [0.001 m/s] + * Orbit Bound Mean Along-Track First derivative. Range: 0-0.255 m/s [0.001 + * m/s] */ u8 orb_along_bound_mu_dot; - /** - * Orbit Bound Mean Cross-Track First derivative. Range: 0-0.255 m/s [0.001 m/s] + * Orbit Bound Mean Cross-Track First derivative. Range: 0-0.255 m/s [0.001 + * m/s] */ u8 orb_cross_bound_mu_dot; - /** - * Orbit Bound Standard Deviation Radial First derivative. Range: 0-0.255 m/s [0.001 m/s] + * Orbit Bound Standard Deviation Radial First derivative. Range: 0-0.255 m/s + * [0.001 m/s] */ u8 orb_radial_bound_sig_dot; - /** - * Orbit Bound Standard Deviation Along-Track First derivative. Range: 0-0.255 m/s [0.001 m/s] + * Orbit Bound Standard Deviation Along-Track First derivative. Range: 0-0.255 + * m/s [0.001 m/s] */ u8 orb_along_bound_sig_dot; - /** - * Orbit Bound Standard Deviation Cross-Track First derivative. Range: 0-0.255 m/s [0.001 m/s] + * Orbit Bound Standard Deviation Cross-Track First derivative. Range: 0-0.255 + * m/s [0.001 m/s] */ u8 orb_cross_bound_sig_dot; - /** - * Clock Bound Mean First derivative. Range: 0-0.255 m/s [0.001 m/s] + * Clock Bound Mean First derivative. Range: 0-0.255 m/s [0.001 m/s] */ u8 clock_bound_mu_dot; - /** - * Clock Bound Standard Deviation First derivative. Range: 0-0.255 m/s [0.001 m/s] + * Clock Bound Standard Deviation First derivative. Range: 0-0.255 m/s [0.001 + * m/s] */ u8 clock_bound_sig_dot; } sbp_orbit_clock_bound_degradation_t; - - /** * Get encoded size of an instance of sbp_orbit_clock_bound_degradation_t * * @param msg sbp_orbit_clock_bound_degradation_t instance * @return Length of on-wire representation */ -static inline size_t sbp_orbit_clock_bound_degradation_encoded_len(const sbp_orbit_clock_bound_degradation_t *msg) -{ +static inline size_t sbp_orbit_clock_bound_degradation_encoded_len( + const sbp_orbit_clock_bound_degradation_t *msg) { (void)msg; return SBP_ORBIT_CLOCK_BOUND_DEGRADATION_ENCODED_LEN; } /** - * Encode an instance of sbp_orbit_clock_bound_degradation_t to wire representation + * Encode an instance of sbp_orbit_clock_bound_degradation_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_orbit_clock_bound_degradation_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_orbit_clock_bound_degradation_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_orbit_clock_bound_degradation_t *msg); +SBP_EXPORT s8 sbp_orbit_clock_bound_degradation_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_orbit_clock_bound_degradation_t *msg); /** - * Decode an instance of sbp_orbit_clock_bound_degradation_t from wire representation + * Decode an instance of sbp_orbit_clock_bound_degradation_t from wire + * representation * - * This function decodes the wire representation of a sbp_orbit_clock_bound_degradation_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_orbit_clock_bound_degradation_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_orbit_clock_bound_degradation_t instance + * @param buf Wire representation of the sbp_orbit_clock_bound_degradation_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_orbit_clock_bound_degradation_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_orbit_clock_bound_degradation_t *msg); +SBP_EXPORT s8 sbp_orbit_clock_bound_degradation_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_orbit_clock_bound_degradation_t *msg); /** * Compare two instances of sbp_orbit_clock_bound_degradation_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_orbit_clock_bound_degradation_t instance * @param b sbp_orbit_clock_bound_degradation_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_orbit_clock_bound_degradation_cmp(const sbp_orbit_clock_bound_degradation_t *a, const sbp_orbit_clock_bound_degradation_t *b); +SBP_EXPORT int sbp_orbit_clock_bound_degradation_cmp( + const sbp_orbit_clock_bound_degradation_t *a, + const sbp_orbit_clock_bound_degradation_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_orbit_clock_bound_degradation_t &lhs, const sbp_orbit_clock_bound_degradation_t &rhs) { +static inline bool operator==(const sbp_orbit_clock_bound_degradation_t &lhs, + const sbp_orbit_clock_bound_degradation_t &rhs) { return sbp_orbit_clock_bound_degradation_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_orbit_clock_bound_degradation_t &lhs, const sbp_orbit_clock_bound_degradation_t &rhs) { +static inline bool operator!=(const sbp_orbit_clock_bound_degradation_t &lhs, + const sbp_orbit_clock_bound_degradation_t &rhs) { return sbp_orbit_clock_bound_degradation_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_orbit_clock_bound_degradation_t &lhs, const sbp_orbit_clock_bound_degradation_t &rhs) { +static inline bool operator<(const sbp_orbit_clock_bound_degradation_t &lhs, + const sbp_orbit_clock_bound_degradation_t &rhs) { return sbp_orbit_clock_bound_degradation_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_orbit_clock_bound_degradation_t &lhs, const sbp_orbit_clock_bound_degradation_t &rhs) { +static inline bool operator<=(const sbp_orbit_clock_bound_degradation_t &lhs, + const sbp_orbit_clock_bound_degradation_t &rhs) { return sbp_orbit_clock_bound_degradation_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_orbit_clock_bound_degradation_t &lhs, const sbp_orbit_clock_bound_degradation_t &rhs) { +static inline bool operator>(const sbp_orbit_clock_bound_degradation_t &lhs, + const sbp_orbit_clock_bound_degradation_t &rhs) { return sbp_orbit_clock_bound_degradation_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_orbit_clock_bound_degradation_t &lhs, const sbp_orbit_clock_bound_degradation_t &rhs) { +static inline bool operator>=(const sbp_orbit_clock_bound_degradation_t &lhs, + const sbp_orbit_clock_bound_degradation_t &rhs) { return sbp_orbit_clock_bound_degradation_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_ORBITCLOCKBOUNDDEGRADATION_H */ - diff --git a/c/include/libsbp/ssr/PhaseBiasesContent.h b/c/include/libsbp/ssr/PhaseBiasesContent.h index bc37bbe2d..7950151a0 100644 --- a/c/include/libsbp/ssr/PhaseBiasesContent.h +++ b/c/include/libsbp/ssr/PhaseBiasesContent.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SSR_PHASEBIASESCONTENT_H #define LIBSBP_SSR_PHASEBIASESCONTENT_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,51 +40,45 @@ *****************************************************************************/ /** SSR phase biases corrections for a particular satellite * -* Phase biases are to be added to carrier phase measurements. + * Phase biases are to be added to carrier phase measurements. */ typedef struct { - - /** - * Signal encoded following RTCM specifications (DF380, DF381, DF382 and DF467) + * Signal encoded following RTCM specifications (DF380, DF381, DF382 and + * DF467) */ u8 code; - /** -* Indicator for integer property + * Indicator for integer property */ u8 integer_indicator; - /** -* Indicator for two groups of Wide-Lane(s) integer property + * Indicator for two groups of Wide-Lane(s) integer property */ u8 widelane_integer_indicator; - /** - * Signal phase discontinuity counter. Increased for every discontinuity in phase. + * Signal phase discontinuity counter. Increased for every discontinuity in + * phase. */ u8 discontinuity_counter; - /** -* Phase bias for specified signal [0.1 mm] + * Phase bias for specified signal [0.1 mm] */ s32 bias; } sbp_phase_biases_content_t; - - /** * Get encoded size of an instance of sbp_phase_biases_content_t * * @param msg sbp_phase_biases_content_t instance * @return Length of on-wire representation */ -static inline size_t sbp_phase_biases_content_encoded_len(const sbp_phase_biases_content_t *msg) -{ +static inline size_t sbp_phase_biases_content_encoded_len( + const sbp_phase_biases_content_t *msg) { (void)msg; return SBP_PHASE_BIASES_CONTENT_ENCODED_LEN; } @@ -92,74 +86,96 @@ static inline size_t sbp_phase_biases_content_encoded_len(const sbp_phase_biases /** * Encode an instance of sbp_phase_biases_content_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_phase_biases_content_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_phase_biases_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_phase_biases_content_t *msg); +SBP_EXPORT s8 +sbp_phase_biases_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_phase_biases_content_t *msg); /** * Decode an instance of sbp_phase_biases_content_t from wire representation * - * This function decodes the wire representation of a sbp_phase_biases_content_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_phase_biases_content_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_phase_biases_content_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_phase_biases_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_phase_biases_content_t *msg); +SBP_EXPORT s8 sbp_phase_biases_content_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_phase_biases_content_t *msg); /** * Compare two instances of sbp_phase_biases_content_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_phase_biases_content_t instance * @param b sbp_phase_biases_content_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_phase_biases_content_cmp(const sbp_phase_biases_content_t *a, const sbp_phase_biases_content_t *b); +SBP_EXPORT int sbp_phase_biases_content_cmp( + const sbp_phase_biases_content_t *a, const sbp_phase_biases_content_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_phase_biases_content_t &lhs, const sbp_phase_biases_content_t &rhs) { +static inline bool operator==(const sbp_phase_biases_content_t &lhs, + const sbp_phase_biases_content_t &rhs) { return sbp_phase_biases_content_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_phase_biases_content_t &lhs, const sbp_phase_biases_content_t &rhs) { +static inline bool operator!=(const sbp_phase_biases_content_t &lhs, + const sbp_phase_biases_content_t &rhs) { return sbp_phase_biases_content_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_phase_biases_content_t &lhs, const sbp_phase_biases_content_t &rhs) { +static inline bool operator<(const sbp_phase_biases_content_t &lhs, + const sbp_phase_biases_content_t &rhs) { return sbp_phase_biases_content_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_phase_biases_content_t &lhs, const sbp_phase_biases_content_t &rhs) { +static inline bool operator<=(const sbp_phase_biases_content_t &lhs, + const sbp_phase_biases_content_t &rhs) { return sbp_phase_biases_content_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_phase_biases_content_t &lhs, const sbp_phase_biases_content_t &rhs) { +static inline bool operator>(const sbp_phase_biases_content_t &lhs, + const sbp_phase_biases_content_t &rhs) { return sbp_phase_biases_content_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_phase_biases_content_t &lhs, const sbp_phase_biases_content_t &rhs) { +static inline bool operator>=(const sbp_phase_biases_content_t &lhs, + const sbp_phase_biases_content_t &rhs) { return sbp_phase_biases_content_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_PHASEBIASESCONTENT_H */ - diff --git a/c/include/libsbp/ssr/STECHeader.h b/c/include/libsbp/ssr/STECHeader.h index 288d9eba7..c19715628 100644 --- a/c/include/libsbp/ssr/STECHeader.h +++ b/c/include/libsbp/ssr/STECHeader.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SSR_STECHEADER_H #define LIBSBP_SSR_STECHEADER_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,63 +41,55 @@ *****************************************************************************/ /** Header for the MSG_SSR_STEC_CORRECTION message * -* A full set of STEC information will likely span multiple SBP messages, since SBP message a limited to 255 bytes. The header is used to tie multiple SBP messages into a sequence. + * A full set of STEC information will likely span multiple SBP messages, since + * SBP message a limited to 255 bytes. The header is used to tie multiple SBP + * messages into a sequence. */ typedef struct { - - /** -* Unique identifier of the tile set this tile belongs to. + * Unique identifier of the tile set this tile belongs to. */ u16 tile_set_id; - /** -* Unique identifier of this tile in the tile set. + * Unique identifier of this tile in the tile set. */ u16 tile_id; - /** -* GNSS reference time of the correction + * GNSS reference time of the correction */ sbp_gps_time_sec_t time; - /** -* Number of messages in the dataset + * Number of messages in the dataset */ u8 num_msgs; - /** -* Position of this message in the dataset + * Position of this message in the dataset */ u8 seq_num; - /** - * Update interval between consecutive corrections. Encoded following RTCM DF391 specification. + * Update interval between consecutive corrections. Encoded following RTCM + * DF391 specification. */ u8 update_interval; - /** - * IOD of the SSR atmospheric correction + * IOD of the SSR atmospheric correction */ u8 iod_atmo; } sbp_stec_header_t; - - /** * Get encoded size of an instance of sbp_stec_header_t * * @param msg sbp_stec_header_t instance * @return Length of on-wire representation */ -static inline size_t sbp_stec_header_encoded_len(const sbp_stec_header_t *msg) -{ +static inline size_t sbp_stec_header_encoded_len(const sbp_stec_header_t *msg) { (void)msg; return SBP_STEC_HEADER_ENCODED_LEN; } @@ -105,74 +97,95 @@ static inline size_t sbp_stec_header_encoded_len(const sbp_stec_header_t *msg) /** * Encode an instance of sbp_stec_header_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_stec_header_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_stec_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_stec_header_t *msg); +SBP_EXPORT s8 sbp_stec_header_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_stec_header_t *msg); /** * Decode an instance of sbp_stec_header_t from wire representation * - * This function decodes the wire representation of a sbp_stec_header_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_stec_header_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_stec_header_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_stec_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_stec_header_t *msg); +SBP_EXPORT s8 sbp_stec_header_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_stec_header_t *msg); /** * Compare two instances of sbp_stec_header_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_stec_header_t instance * @param b sbp_stec_header_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_stec_header_cmp(const sbp_stec_header_t *a, const sbp_stec_header_t *b); +SBP_EXPORT int sbp_stec_header_cmp(const sbp_stec_header_t *a, + const sbp_stec_header_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_stec_header_t &lhs, const sbp_stec_header_t &rhs) { +static inline bool operator==(const sbp_stec_header_t &lhs, + const sbp_stec_header_t &rhs) { return sbp_stec_header_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_stec_header_t &lhs, const sbp_stec_header_t &rhs) { +static inline bool operator!=(const sbp_stec_header_t &lhs, + const sbp_stec_header_t &rhs) { return sbp_stec_header_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_stec_header_t &lhs, const sbp_stec_header_t &rhs) { +static inline bool operator<(const sbp_stec_header_t &lhs, + const sbp_stec_header_t &rhs) { return sbp_stec_header_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_stec_header_t &lhs, const sbp_stec_header_t &rhs) { +static inline bool operator<=(const sbp_stec_header_t &lhs, + const sbp_stec_header_t &rhs) { return sbp_stec_header_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_stec_header_t &lhs, const sbp_stec_header_t &rhs) { +static inline bool operator>(const sbp_stec_header_t &lhs, + const sbp_stec_header_t &rhs) { return sbp_stec_header_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_stec_header_t &lhs, const sbp_stec_header_t &rhs) { +static inline bool operator>=(const sbp_stec_header_t &lhs, + const sbp_stec_header_t &rhs) { return sbp_stec_header_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_STECHEADER_H */ - diff --git a/c/include/libsbp/ssr/STECHeaderDepA.h b/c/include/libsbp/ssr/STECHeaderDepA.h index ae44ef348..0ea95812c 100644 --- a/c/include/libsbp/ssr/STECHeaderDepA.h +++ b/c/include/libsbp/ssr/STECHeaderDepA.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SSR_STECHEADERDEPA_H #define LIBSBP_SSR_STECHEADERDEPA_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,51 +41,46 @@ *****************************************************************************/ /** Header for MSG_SSR_STEC_CORRECTION_DEP message * -* A full set of STEC information will likely span multiple SBP messages, since SBP message a limited to 255 bytes. The header is used to tie multiple SBP messages into a sequence. + * A full set of STEC information will likely span multiple SBP messages, since + * SBP message a limited to 255 bytes. The header is used to tie multiple SBP + * messages into a sequence. */ typedef struct { - - /** -* GNSS reference time of the correction + * GNSS reference time of the correction */ sbp_gps_time_sec_t time; - /** -* Number of messages in the dataset + * Number of messages in the dataset */ u8 num_msgs; - /** -* Position of this message in the dataset + * Position of this message in the dataset */ u8 seq_num; - /** - * Update interval between consecutive corrections. Encoded following RTCM DF391 specification. + * Update interval between consecutive corrections. Encoded following RTCM + * DF391 specification. */ u8 update_interval; - /** - * IOD of the SSR atmospheric correction + * IOD of the SSR atmospheric correction */ u8 iod_atmo; } sbp_stec_header_dep_a_t; - - /** * Get encoded size of an instance of sbp_stec_header_dep_a_t * * @param msg sbp_stec_header_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_stec_header_dep_a_encoded_len(const sbp_stec_header_dep_a_t *msg) -{ +static inline size_t sbp_stec_header_dep_a_encoded_len( + const sbp_stec_header_dep_a_t *msg) { (void)msg; return SBP_STEC_HEADER_DEP_A_ENCODED_LEN; } @@ -93,74 +88,96 @@ static inline size_t sbp_stec_header_dep_a_encoded_len(const sbp_stec_header_dep /** * Encode an instance of sbp_stec_header_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_stec_header_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_stec_header_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_stec_header_dep_a_t *msg); +SBP_EXPORT s8 sbp_stec_header_dep_a_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_stec_header_dep_a_t *msg); /** * Decode an instance of sbp_stec_header_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_stec_header_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_stec_header_dep_a_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_stec_header_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_stec_header_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_stec_header_dep_a_t *msg); +SBP_EXPORT s8 sbp_stec_header_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_stec_header_dep_a_t *msg); /** * Compare two instances of sbp_stec_header_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_stec_header_dep_a_t instance * @param b sbp_stec_header_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_stec_header_dep_a_cmp(const sbp_stec_header_dep_a_t *a, const sbp_stec_header_dep_a_t *b); +SBP_EXPORT int sbp_stec_header_dep_a_cmp(const sbp_stec_header_dep_a_t *a, + const sbp_stec_header_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_stec_header_dep_a_t &lhs, const sbp_stec_header_dep_a_t &rhs) { +static inline bool operator==(const sbp_stec_header_dep_a_t &lhs, + const sbp_stec_header_dep_a_t &rhs) { return sbp_stec_header_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_stec_header_dep_a_t &lhs, const sbp_stec_header_dep_a_t &rhs) { +static inline bool operator!=(const sbp_stec_header_dep_a_t &lhs, + const sbp_stec_header_dep_a_t &rhs) { return sbp_stec_header_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_stec_header_dep_a_t &lhs, const sbp_stec_header_dep_a_t &rhs) { +static inline bool operator<(const sbp_stec_header_dep_a_t &lhs, + const sbp_stec_header_dep_a_t &rhs) { return sbp_stec_header_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_stec_header_dep_a_t &lhs, const sbp_stec_header_dep_a_t &rhs) { +static inline bool operator<=(const sbp_stec_header_dep_a_t &lhs, + const sbp_stec_header_dep_a_t &rhs) { return sbp_stec_header_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_stec_header_dep_a_t &lhs, const sbp_stec_header_dep_a_t &rhs) { +static inline bool operator>(const sbp_stec_header_dep_a_t &lhs, + const sbp_stec_header_dep_a_t &rhs) { return sbp_stec_header_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_stec_header_dep_a_t &lhs, const sbp_stec_header_dep_a_t &rhs) { +static inline bool operator>=(const sbp_stec_header_dep_a_t &lhs, + const sbp_stec_header_dep_a_t &rhs) { return sbp_stec_header_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_STECHEADERDEPA_H */ - diff --git a/c/include/libsbp/ssr/STECResidual.h b/c/include/libsbp/ssr/STECResidual.h index 7b7595b84..2a6cbd54c 100644 --- a/c/include/libsbp/ssr/STECResidual.h +++ b/c/include/libsbp/ssr/STECResidual.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SSR_STECRESIDUAL_H #define LIBSBP_SSR_STECRESIDUAL_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,39 +41,35 @@ *****************************************************************************/ /** None * -* STEC residual (mean and standard deviation) for the given satellite at the grid point. + * STEC residual (mean and standard deviation) for the given satellite at the + * grid point. */ typedef struct { - - /** -* space vehicle identifier + * space vehicle identifier */ sbp_sv_id_t sv_id; - /** -* STEC residual [0.04 TECU] + * STEC residual [0.04 TECU] */ s16 residual; - /** - * Modified DF389. class 3 MSB, value 5 LSB. stddev = (3^class * (1 + value/16) - 1) * 10 + * Modified DF389. class 3 MSB, value 5 LSB. stddev = (3^class * (1 + + * value/16) - 1) * 10 */ u8 stddev; } sbp_stec_residual_t; - - /** * Get encoded size of an instance of sbp_stec_residual_t * * @param msg sbp_stec_residual_t instance * @return Length of on-wire representation */ -static inline size_t sbp_stec_residual_encoded_len(const sbp_stec_residual_t *msg) -{ +static inline size_t sbp_stec_residual_encoded_len( + const sbp_stec_residual_t *msg) { (void)msg; return SBP_STEC_RESIDUAL_ENCODED_LEN; } @@ -81,74 +77,96 @@ static inline size_t sbp_stec_residual_encoded_len(const sbp_stec_residual_t *ms /** * Encode an instance of sbp_stec_residual_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_stec_residual_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_stec_residual_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_stec_residual_t *msg); +SBP_EXPORT s8 sbp_stec_residual_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_stec_residual_t *msg); /** * Decode an instance of sbp_stec_residual_t from wire representation * - * This function decodes the wire representation of a sbp_stec_residual_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_stec_residual_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_stec_residual_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_stec_residual_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_stec_residual_t *msg); +SBP_EXPORT s8 sbp_stec_residual_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_stec_residual_t *msg); /** * Compare two instances of sbp_stec_residual_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_stec_residual_t instance * @param b sbp_stec_residual_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_stec_residual_cmp(const sbp_stec_residual_t *a, const sbp_stec_residual_t *b); +SBP_EXPORT int sbp_stec_residual_cmp(const sbp_stec_residual_t *a, + const sbp_stec_residual_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_stec_residual_t &lhs, const sbp_stec_residual_t &rhs) { +static inline bool operator==(const sbp_stec_residual_t &lhs, + const sbp_stec_residual_t &rhs) { return sbp_stec_residual_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_stec_residual_t &lhs, const sbp_stec_residual_t &rhs) { +static inline bool operator!=(const sbp_stec_residual_t &lhs, + const sbp_stec_residual_t &rhs) { return sbp_stec_residual_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_stec_residual_t &lhs, const sbp_stec_residual_t &rhs) { +static inline bool operator<(const sbp_stec_residual_t &lhs, + const sbp_stec_residual_t &rhs) { return sbp_stec_residual_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_stec_residual_t &lhs, const sbp_stec_residual_t &rhs) { +static inline bool operator<=(const sbp_stec_residual_t &lhs, + const sbp_stec_residual_t &rhs) { return sbp_stec_residual_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_stec_residual_t &lhs, const sbp_stec_residual_t &rhs) { +static inline bool operator>(const sbp_stec_residual_t &lhs, + const sbp_stec_residual_t &rhs) { return sbp_stec_residual_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_stec_residual_t &lhs, const sbp_stec_residual_t &rhs) { +static inline bool operator>=(const sbp_stec_residual_t &lhs, + const sbp_stec_residual_t &rhs) { return sbp_stec_residual_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_STECRESIDUAL_H */ - diff --git a/c/include/libsbp/ssr/STECResidualNoStd.h b/c/include/libsbp/ssr/STECResidualNoStd.h index 3f094914c..ed1b02e31 100644 --- a/c/include/libsbp/ssr/STECResidualNoStd.h +++ b/c/include/libsbp/ssr/STECResidualNoStd.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SSR_STECRESIDUALNOSTD_H #define LIBSBP_SSR_STECRESIDUALNOSTD_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,33 +41,28 @@ *****************************************************************************/ /** None * -* STEC residual for the given satellite at the grid point. + * STEC residual for the given satellite at the grid point. */ typedef struct { - - /** -* space vehicle identifier + * space vehicle identifier */ sbp_sv_id_t sv_id; - /** -* STEC residual [0.04 TECU] + * STEC residual [0.04 TECU] */ s16 residual; } sbp_stec_residual_no_std_t; - - /** * Get encoded size of an instance of sbp_stec_residual_no_std_t * * @param msg sbp_stec_residual_no_std_t instance * @return Length of on-wire representation */ -static inline size_t sbp_stec_residual_no_std_encoded_len(const sbp_stec_residual_no_std_t *msg) -{ +static inline size_t sbp_stec_residual_no_std_encoded_len( + const sbp_stec_residual_no_std_t *msg) { (void)msg; return SBP_STEC_RESIDUAL_NO_STD_ENCODED_LEN; } @@ -75,74 +70,96 @@ static inline size_t sbp_stec_residual_no_std_encoded_len(const sbp_stec_residua /** * Encode an instance of sbp_stec_residual_no_std_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_stec_residual_no_std_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_stec_residual_no_std_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_stec_residual_no_std_t *msg); +SBP_EXPORT s8 +sbp_stec_residual_no_std_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_stec_residual_no_std_t *msg); /** * Decode an instance of sbp_stec_residual_no_std_t from wire representation * - * This function decodes the wire representation of a sbp_stec_residual_no_std_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_stec_residual_no_std_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_stec_residual_no_std_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_stec_residual_no_std_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_stec_residual_no_std_t *msg); +SBP_EXPORT s8 sbp_stec_residual_no_std_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_stec_residual_no_std_t *msg); /** * Compare two instances of sbp_stec_residual_no_std_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_stec_residual_no_std_t instance * @param b sbp_stec_residual_no_std_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_stec_residual_no_std_cmp(const sbp_stec_residual_no_std_t *a, const sbp_stec_residual_no_std_t *b); +SBP_EXPORT int sbp_stec_residual_no_std_cmp( + const sbp_stec_residual_no_std_t *a, const sbp_stec_residual_no_std_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_stec_residual_no_std_t &lhs, const sbp_stec_residual_no_std_t &rhs) { +static inline bool operator==(const sbp_stec_residual_no_std_t &lhs, + const sbp_stec_residual_no_std_t &rhs) { return sbp_stec_residual_no_std_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_stec_residual_no_std_t &lhs, const sbp_stec_residual_no_std_t &rhs) { +static inline bool operator!=(const sbp_stec_residual_no_std_t &lhs, + const sbp_stec_residual_no_std_t &rhs) { return sbp_stec_residual_no_std_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_stec_residual_no_std_t &lhs, const sbp_stec_residual_no_std_t &rhs) { +static inline bool operator<(const sbp_stec_residual_no_std_t &lhs, + const sbp_stec_residual_no_std_t &rhs) { return sbp_stec_residual_no_std_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_stec_residual_no_std_t &lhs, const sbp_stec_residual_no_std_t &rhs) { +static inline bool operator<=(const sbp_stec_residual_no_std_t &lhs, + const sbp_stec_residual_no_std_t &rhs) { return sbp_stec_residual_no_std_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_stec_residual_no_std_t &lhs, const sbp_stec_residual_no_std_t &rhs) { +static inline bool operator>(const sbp_stec_residual_no_std_t &lhs, + const sbp_stec_residual_no_std_t &rhs) { return sbp_stec_residual_no_std_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_stec_residual_no_std_t &lhs, const sbp_stec_residual_no_std_t &rhs) { +static inline bool operator>=(const sbp_stec_residual_no_std_t &lhs, + const sbp_stec_residual_no_std_t &rhs) { return sbp_stec_residual_no_std_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_STECRESIDUALNOSTD_H */ - diff --git a/c/include/libsbp/ssr/STECSatElement.h b/c/include/libsbp/ssr/STECSatElement.h index ec3bdb71b..024056b35 100644 --- a/c/include/libsbp/ssr/STECSatElement.h +++ b/c/include/libsbp/ssr/STECSatElement.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SSR_STECSATELEMENT_H #define LIBSBP_SSR_STECSATELEMENT_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,39 +41,35 @@ *****************************************************************************/ /** None * -* STEC polynomial for the given satellite. + * STEC polynomial for the given satellite. */ typedef struct { - - /** -* Unique space vehicle identifier + * Unique space vehicle identifier */ sbp_sv_id_t sv_id; - /** - * Quality of the STEC data. Encoded following RTCM DF389 specification but in units of TECU instead of m. + * Quality of the STEC data. Encoded following RTCM DF389 specification but in + * units of TECU instead of m. */ u8 stec_quality_indicator; - /** - * Coefficients of the STEC polynomial in the order of C00, C01, C10, C11. C00 = 0.05 TECU, C01/C10 = 0.02 TECU/deg, C11 0.02 TECU/deg^2 + * Coefficients of the STEC polynomial in the order of C00, C01, C10, C11. C00 + * = 0.05 TECU, C01/C10 = 0.02 TECU/deg, C11 0.02 TECU/deg^2 */ s16 stec_coeff[SBP_STEC_SAT_ELEMENT_STEC_COEFF_MAX]; } sbp_stec_sat_element_t; - - /** * Get encoded size of an instance of sbp_stec_sat_element_t * * @param msg sbp_stec_sat_element_t instance * @return Length of on-wire representation */ -static inline size_t sbp_stec_sat_element_encoded_len(const sbp_stec_sat_element_t *msg) -{ +static inline size_t sbp_stec_sat_element_encoded_len( + const sbp_stec_sat_element_t *msg) { (void)msg; return SBP_STEC_SAT_ELEMENT_ENCODED_LEN; } @@ -81,74 +77,96 @@ static inline size_t sbp_stec_sat_element_encoded_len(const sbp_stec_sat_element /** * Encode an instance of sbp_stec_sat_element_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_stec_sat_element_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_stec_sat_element_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_stec_sat_element_t *msg); +SBP_EXPORT s8 sbp_stec_sat_element_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_stec_sat_element_t *msg); /** * Decode an instance of sbp_stec_sat_element_t from wire representation * - * This function decodes the wire representation of a sbp_stec_sat_element_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_stec_sat_element_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_stec_sat_element_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_stec_sat_element_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_stec_sat_element_t *msg); +SBP_EXPORT s8 sbp_stec_sat_element_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_stec_sat_element_t *msg); /** * Compare two instances of sbp_stec_sat_element_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_stec_sat_element_t instance * @param b sbp_stec_sat_element_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_stec_sat_element_cmp(const sbp_stec_sat_element_t *a, const sbp_stec_sat_element_t *b); +SBP_EXPORT int sbp_stec_sat_element_cmp(const sbp_stec_sat_element_t *a, + const sbp_stec_sat_element_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_stec_sat_element_t &lhs, const sbp_stec_sat_element_t &rhs) { +static inline bool operator==(const sbp_stec_sat_element_t &lhs, + const sbp_stec_sat_element_t &rhs) { return sbp_stec_sat_element_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_stec_sat_element_t &lhs, const sbp_stec_sat_element_t &rhs) { +static inline bool operator!=(const sbp_stec_sat_element_t &lhs, + const sbp_stec_sat_element_t &rhs) { return sbp_stec_sat_element_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_stec_sat_element_t &lhs, const sbp_stec_sat_element_t &rhs) { +static inline bool operator<(const sbp_stec_sat_element_t &lhs, + const sbp_stec_sat_element_t &rhs) { return sbp_stec_sat_element_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_stec_sat_element_t &lhs, const sbp_stec_sat_element_t &rhs) { +static inline bool operator<=(const sbp_stec_sat_element_t &lhs, + const sbp_stec_sat_element_t &rhs) { return sbp_stec_sat_element_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_stec_sat_element_t &lhs, const sbp_stec_sat_element_t &rhs) { +static inline bool operator>(const sbp_stec_sat_element_t &lhs, + const sbp_stec_sat_element_t &rhs) { return sbp_stec_sat_element_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_stec_sat_element_t &lhs, const sbp_stec_sat_element_t &rhs) { +static inline bool operator>=(const sbp_stec_sat_element_t &lhs, + const sbp_stec_sat_element_t &rhs) { return sbp_stec_sat_element_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_STECSATELEMENT_H */ - diff --git a/c/include/libsbp/ssr/STECSatElementIntegrity.h b/c/include/libsbp/ssr/STECSatElementIntegrity.h index 600c1a32e..6bb9b5fc7 100644 --- a/c/include/libsbp/ssr/STECSatElementIntegrity.h +++ b/c/include/libsbp/ssr/STECSatElementIntegrity.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SSR_STECSATELEMENTINTEGRITY_H #define LIBSBP_SSR_STECSATELEMENTINTEGRITY_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,51 +41,43 @@ *****************************************************************************/ /** None * -* STEC polynomial and bounds for the given satellite. + * STEC polynomial and bounds for the given satellite. */ typedef struct { - - /** -* STEC residuals (mean, stddev) + * STEC residuals (mean, stddev) */ sbp_stec_residual_t stec_residual; - /** - * Error Bound Mean. See Note 1. [m] + * Error Bound Mean. See Note 1. [m] */ u8 stec_bound_mu; - /** - * Error Bound StDev. See Note 1. [m] + * Error Bound StDev. See Note 1. [m] */ u8 stec_bound_sig; - /** -* Error Bound Mean First derivative. [0.00005 m/s] + * Error Bound Mean First derivative. [0.00005 m/s] */ u8 stec_bound_mu_dot; - /** -* Error Bound StDev First derivative. [0.00005 m/s] + * Error Bound StDev First derivative. [0.00005 m/s] */ u8 stec_bound_sig_dot; } sbp_stec_sat_element_integrity_t; - - /** * Get encoded size of an instance of sbp_stec_sat_element_integrity_t * * @param msg sbp_stec_sat_element_integrity_t instance * @return Length of on-wire representation */ -static inline size_t sbp_stec_sat_element_integrity_encoded_len(const sbp_stec_sat_element_integrity_t *msg) -{ +static inline size_t sbp_stec_sat_element_integrity_encoded_len( + const sbp_stec_sat_element_integrity_t *msg) { (void)msg; return SBP_STEC_SAT_ELEMENT_INTEGRITY_ENCODED_LEN; } @@ -93,74 +85,99 @@ static inline size_t sbp_stec_sat_element_integrity_encoded_len(const sbp_stec_s /** * Encode an instance of sbp_stec_sat_element_integrity_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_stec_sat_element_integrity_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_stec_sat_element_integrity_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_stec_sat_element_integrity_t *msg); +SBP_EXPORT s8 sbp_stec_sat_element_integrity_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_stec_sat_element_integrity_t *msg); /** - * Decode an instance of sbp_stec_sat_element_integrity_t from wire representation + * Decode an instance of sbp_stec_sat_element_integrity_t from wire + * representation * - * This function decodes the wire representation of a sbp_stec_sat_element_integrity_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_stec_sat_element_integrity_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_stec_sat_element_integrity_t instance + * @param buf Wire representation of the sbp_stec_sat_element_integrity_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_stec_sat_element_integrity_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_stec_sat_element_integrity_t *msg); +SBP_EXPORT s8 sbp_stec_sat_element_integrity_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_stec_sat_element_integrity_t *msg); /** * Compare two instances of sbp_stec_sat_element_integrity_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_stec_sat_element_integrity_t instance * @param b sbp_stec_sat_element_integrity_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_stec_sat_element_integrity_cmp(const sbp_stec_sat_element_integrity_t *a, const sbp_stec_sat_element_integrity_t *b); +SBP_EXPORT int sbp_stec_sat_element_integrity_cmp( + const sbp_stec_sat_element_integrity_t *a, + const sbp_stec_sat_element_integrity_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_stec_sat_element_integrity_t &lhs, const sbp_stec_sat_element_integrity_t &rhs) { +static inline bool operator==(const sbp_stec_sat_element_integrity_t &lhs, + const sbp_stec_sat_element_integrity_t &rhs) { return sbp_stec_sat_element_integrity_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_stec_sat_element_integrity_t &lhs, const sbp_stec_sat_element_integrity_t &rhs) { +static inline bool operator!=(const sbp_stec_sat_element_integrity_t &lhs, + const sbp_stec_sat_element_integrity_t &rhs) { return sbp_stec_sat_element_integrity_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_stec_sat_element_integrity_t &lhs, const sbp_stec_sat_element_integrity_t &rhs) { +static inline bool operator<(const sbp_stec_sat_element_integrity_t &lhs, + const sbp_stec_sat_element_integrity_t &rhs) { return sbp_stec_sat_element_integrity_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_stec_sat_element_integrity_t &lhs, const sbp_stec_sat_element_integrity_t &rhs) { +static inline bool operator<=(const sbp_stec_sat_element_integrity_t &lhs, + const sbp_stec_sat_element_integrity_t &rhs) { return sbp_stec_sat_element_integrity_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_stec_sat_element_integrity_t &lhs, const sbp_stec_sat_element_integrity_t &rhs) { +static inline bool operator>(const sbp_stec_sat_element_integrity_t &lhs, + const sbp_stec_sat_element_integrity_t &rhs) { return sbp_stec_sat_element_integrity_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_stec_sat_element_integrity_t &lhs, const sbp_stec_sat_element_integrity_t &rhs) { +static inline bool operator>=(const sbp_stec_sat_element_integrity_t &lhs, + const sbp_stec_sat_element_integrity_t &rhs) { return sbp_stec_sat_element_integrity_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_STECSATELEMENTINTEGRITY_H */ - diff --git a/c/include/libsbp/ssr/SatelliteAPC.h b/c/include/libsbp/ssr/SatelliteAPC.h index dc19edeea..350f44ed5 100644 --- a/c/include/libsbp/ssr/SatelliteAPC.h +++ b/c/include/libsbp/ssr/SatelliteAPC.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SSR_SATELLITEAPC_H #define LIBSBP_SSR_SATELLITEAPC_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,51 +41,47 @@ *****************************************************************************/ /** Antenna phase center correction * -* Contains phase center offset and elevation variation corrections for one signal on a satellite. + * Contains phase center offset and elevation variation corrections for one + * signal on a satellite. */ typedef struct { - - /** -* GNSS signal identifier (16 bit) + * GNSS signal identifier (16 bit) */ sbp_v4_gnss_signal_t sid; - /** -* Additional satellite information + * Additional satellite information */ u8 sat_info; - /** -* Satellite Code, as defined by IGS. Typically the space vehicle number. + * Satellite Code, as defined by IGS. Typically the space vehicle number. */ u16 svn; - /** - * Mean phase center offset, X Y and Z axes. See IGS ANTEX file format description for coordinate system definition. [1 mm] + * Mean phase center offset, X Y and Z axes. See IGS ANTEX file format + * description for coordinate system definition. [1 mm] */ s16 pco[SBP_SATELLITE_APC_PCO_MAX]; - /** - * Elevation dependent phase center variations. First element is 0 degrees separation from the Z axis, subsequent elements represent elevation variations in 1 degree increments. [1 mm] + * Elevation dependent phase center variations. First element is 0 degrees + * separation from the Z axis, subsequent elements represent elevation + * variations in 1 degree increments. [1 mm] */ s8 pcv[SBP_SATELLITE_APC_PCV_MAX]; } sbp_satellite_apc_t; - - /** * Get encoded size of an instance of sbp_satellite_apc_t * * @param msg sbp_satellite_apc_t instance * @return Length of on-wire representation */ -static inline size_t sbp_satellite_apc_encoded_len(const sbp_satellite_apc_t *msg) -{ +static inline size_t sbp_satellite_apc_encoded_len( + const sbp_satellite_apc_t *msg) { (void)msg; return SBP_SATELLITE_APC_ENCODED_LEN; } @@ -93,74 +89,96 @@ static inline size_t sbp_satellite_apc_encoded_len(const sbp_satellite_apc_t *ms /** * Encode an instance of sbp_satellite_apc_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_satellite_apc_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_satellite_apc_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_satellite_apc_t *msg); +SBP_EXPORT s8 sbp_satellite_apc_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_satellite_apc_t *msg); /** * Decode an instance of sbp_satellite_apc_t from wire representation * - * This function decodes the wire representation of a sbp_satellite_apc_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_satellite_apc_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_satellite_apc_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_satellite_apc_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_satellite_apc_t *msg); +SBP_EXPORT s8 sbp_satellite_apc_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_satellite_apc_t *msg); /** * Compare two instances of sbp_satellite_apc_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_satellite_apc_t instance * @param b sbp_satellite_apc_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_satellite_apc_cmp(const sbp_satellite_apc_t *a, const sbp_satellite_apc_t *b); +SBP_EXPORT int sbp_satellite_apc_cmp(const sbp_satellite_apc_t *a, + const sbp_satellite_apc_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_satellite_apc_t &lhs, const sbp_satellite_apc_t &rhs) { +static inline bool operator==(const sbp_satellite_apc_t &lhs, + const sbp_satellite_apc_t &rhs) { return sbp_satellite_apc_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_satellite_apc_t &lhs, const sbp_satellite_apc_t &rhs) { +static inline bool operator!=(const sbp_satellite_apc_t &lhs, + const sbp_satellite_apc_t &rhs) { return sbp_satellite_apc_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_satellite_apc_t &lhs, const sbp_satellite_apc_t &rhs) { +static inline bool operator<(const sbp_satellite_apc_t &lhs, + const sbp_satellite_apc_t &rhs) { return sbp_satellite_apc_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_satellite_apc_t &lhs, const sbp_satellite_apc_t &rhs) { +static inline bool operator<=(const sbp_satellite_apc_t &lhs, + const sbp_satellite_apc_t &rhs) { return sbp_satellite_apc_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_satellite_apc_t &lhs, const sbp_satellite_apc_t &rhs) { +static inline bool operator>(const sbp_satellite_apc_t &lhs, + const sbp_satellite_apc_t &rhs) { return sbp_satellite_apc_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_satellite_apc_t &lhs, const sbp_satellite_apc_t &rhs) { +static inline bool operator>=(const sbp_satellite_apc_t &lhs, + const sbp_satellite_apc_t &rhs) { return sbp_satellite_apc_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_SATELLITEAPC_H */ - diff --git a/c/include/libsbp/ssr/TroposphericDelayCorrection.h b/c/include/libsbp/ssr/TroposphericDelayCorrection.h index 928e3630e..eee02f5cb 100644 --- a/c/include/libsbp/ssr/TroposphericDelayCorrection.h +++ b/c/include/libsbp/ssr/TroposphericDelayCorrection.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SSR_TROPOSPHERICDELAYCORRECTION_H #define LIBSBP_SSR_TROPOSPHERICDELAYCORRECTION_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,114 +40,135 @@ *****************************************************************************/ /** None * -* Troposphere vertical delays (mean and standard deviation) at the grid point. + * Troposphere vertical delays (mean and standard deviation) at the grid point. */ typedef struct { - - /** - * Hydrostatic vertical delay. Add 2.3 m to get actual value. [4 mm] + * Hydrostatic vertical delay. Add 2.3 m to get actual value. [4 mm] */ s16 hydro; - /** - * Wet vertical delay. Add 0.252 m to get actual value. [4 mm] + * Wet vertical delay. Add 0.252 m to get actual value. [4 mm] */ s8 wet; - /** - * Modified DF389. class 3 MSB, value 5 LSB. stddev = (3^class * (1 + value/16) - 1) [mm] + * Modified DF389. class 3 MSB, value 5 LSB. stddev = (3^class * (1 + + * value/16) - 1) [mm] */ u8 stddev; } sbp_tropospheric_delay_correction_t; - - /** * Get encoded size of an instance of sbp_tropospheric_delay_correction_t * * @param msg sbp_tropospheric_delay_correction_t instance * @return Length of on-wire representation */ -static inline size_t sbp_tropospheric_delay_correction_encoded_len(const sbp_tropospheric_delay_correction_t *msg) -{ +static inline size_t sbp_tropospheric_delay_correction_encoded_len( + const sbp_tropospheric_delay_correction_t *msg) { (void)msg; return SBP_TROPOSPHERIC_DELAY_CORRECTION_ENCODED_LEN; } /** - * Encode an instance of sbp_tropospheric_delay_correction_t to wire representation + * Encode an instance of sbp_tropospheric_delay_correction_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_tropospheric_delay_correction_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_tropospheric_delay_correction_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_tropospheric_delay_correction_t *msg); +SBP_EXPORT s8 sbp_tropospheric_delay_correction_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_tropospheric_delay_correction_t *msg); /** - * Decode an instance of sbp_tropospheric_delay_correction_t from wire representation + * Decode an instance of sbp_tropospheric_delay_correction_t from wire + * representation * - * This function decodes the wire representation of a sbp_tropospheric_delay_correction_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_tropospheric_delay_correction_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_tropospheric_delay_correction_t instance + * @param buf Wire representation of the sbp_tropospheric_delay_correction_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_tropospheric_delay_correction_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_tropospheric_delay_correction_t *msg); +SBP_EXPORT s8 sbp_tropospheric_delay_correction_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_tropospheric_delay_correction_t *msg); /** * Compare two instances of sbp_tropospheric_delay_correction_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_tropospheric_delay_correction_t instance * @param b sbp_tropospheric_delay_correction_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_tropospheric_delay_correction_cmp(const sbp_tropospheric_delay_correction_t *a, const sbp_tropospheric_delay_correction_t *b); +SBP_EXPORT int sbp_tropospheric_delay_correction_cmp( + const sbp_tropospheric_delay_correction_t *a, + const sbp_tropospheric_delay_correction_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_tropospheric_delay_correction_t &lhs, const sbp_tropospheric_delay_correction_t &rhs) { +static inline bool operator==(const sbp_tropospheric_delay_correction_t &lhs, + const sbp_tropospheric_delay_correction_t &rhs) { return sbp_tropospheric_delay_correction_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_tropospheric_delay_correction_t &lhs, const sbp_tropospheric_delay_correction_t &rhs) { +static inline bool operator!=(const sbp_tropospheric_delay_correction_t &lhs, + const sbp_tropospheric_delay_correction_t &rhs) { return sbp_tropospheric_delay_correction_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_tropospheric_delay_correction_t &lhs, const sbp_tropospheric_delay_correction_t &rhs) { +static inline bool operator<(const sbp_tropospheric_delay_correction_t &lhs, + const sbp_tropospheric_delay_correction_t &rhs) { return sbp_tropospheric_delay_correction_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_tropospheric_delay_correction_t &lhs, const sbp_tropospheric_delay_correction_t &rhs) { +static inline bool operator<=(const sbp_tropospheric_delay_correction_t &lhs, + const sbp_tropospheric_delay_correction_t &rhs) { return sbp_tropospheric_delay_correction_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_tropospheric_delay_correction_t &lhs, const sbp_tropospheric_delay_correction_t &rhs) { +static inline bool operator>(const sbp_tropospheric_delay_correction_t &lhs, + const sbp_tropospheric_delay_correction_t &rhs) { return sbp_tropospheric_delay_correction_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_tropospheric_delay_correction_t &lhs, const sbp_tropospheric_delay_correction_t &rhs) { +static inline bool operator>=(const sbp_tropospheric_delay_correction_t &lhs, + const sbp_tropospheric_delay_correction_t &rhs) { return sbp_tropospheric_delay_correction_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_TROPOSPHERICDELAYCORRECTION_H */ - diff --git a/c/include/libsbp/ssr/TroposphericDelayCorrectionNoStd.h b/c/include/libsbp/ssr/TroposphericDelayCorrectionNoStd.h index cbd53e3f8..4cc3275b6 100644 --- a/c/include/libsbp/ssr/TroposphericDelayCorrectionNoStd.h +++ b/c/include/libsbp/ssr/TroposphericDelayCorrectionNoStd.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SSR_TROPOSPHERICDELAYCORRECTIONNOSTD_H #define LIBSBP_SSR_TROPOSPHERICDELAYCORRECTIONNOSTD_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,108 +40,137 @@ *****************************************************************************/ /** None * -* Troposphere vertical delays at the grid point. + * Troposphere vertical delays at the grid point. */ typedef struct { - - /** -* Hydrostatic vertical delay [4 mm (add 2.3 m to get actual vertical hydro delay)] + * Hydrostatic vertical delay [4 mm (add 2.3 m to get actual vertical hydro + * delay)] */ s16 hydro; - /** -* Wet vertical delay [4 mm (add 0.252 m to get actual vertical wet delay)] + * Wet vertical delay [4 mm (add 0.252 m to get actual vertical wet delay)] */ s8 wet; } sbp_tropospheric_delay_correction_no_std_t; - - /** * Get encoded size of an instance of sbp_tropospheric_delay_correction_no_std_t * * @param msg sbp_tropospheric_delay_correction_no_std_t instance * @return Length of on-wire representation */ -static inline size_t sbp_tropospheric_delay_correction_no_std_encoded_len(const sbp_tropospheric_delay_correction_no_std_t *msg) -{ +static inline size_t sbp_tropospheric_delay_correction_no_std_encoded_len( + const sbp_tropospheric_delay_correction_no_std_t *msg) { (void)msg; return SBP_TROPOSPHERIC_DELAY_CORRECTION_NO_STD_ENCODED_LEN; } /** - * Encode an instance of sbp_tropospheric_delay_correction_no_std_t to wire representation + * Encode an instance of sbp_tropospheric_delay_correction_no_std_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_tropospheric_delay_correction_no_std_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_tropospheric_delay_correction_no_std_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_tropospheric_delay_correction_no_std_t *msg); +SBP_EXPORT s8 sbp_tropospheric_delay_correction_no_std_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_tropospheric_delay_correction_no_std_t *msg); /** - * Decode an instance of sbp_tropospheric_delay_correction_no_std_t from wire representation + * Decode an instance of sbp_tropospheric_delay_correction_no_std_t from wire + * representation * - * This function decodes the wire representation of a sbp_tropospheric_delay_correction_no_std_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_tropospheric_delay_correction_no_std_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_tropospheric_delay_correction_no_std_t instance + * @param buf Wire representation of the + * sbp_tropospheric_delay_correction_no_std_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_tropospheric_delay_correction_no_std_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_tropospheric_delay_correction_no_std_t *msg); +SBP_EXPORT s8 sbp_tropospheric_delay_correction_no_std_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_tropospheric_delay_correction_no_std_t *msg); /** * Compare two instances of sbp_tropospheric_delay_correction_no_std_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_tropospheric_delay_correction_no_std_t instance * @param b sbp_tropospheric_delay_correction_no_std_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_tropospheric_delay_correction_no_std_cmp(const sbp_tropospheric_delay_correction_no_std_t *a, const sbp_tropospheric_delay_correction_no_std_t *b); +SBP_EXPORT int sbp_tropospheric_delay_correction_no_std_cmp( + const sbp_tropospheric_delay_correction_no_std_t *a, + const sbp_tropospheric_delay_correction_no_std_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_tropospheric_delay_correction_no_std_t &lhs, const sbp_tropospheric_delay_correction_no_std_t &rhs) { +static inline bool operator==( + const sbp_tropospheric_delay_correction_no_std_t &lhs, + const sbp_tropospheric_delay_correction_no_std_t &rhs) { return sbp_tropospheric_delay_correction_no_std_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_tropospheric_delay_correction_no_std_t &lhs, const sbp_tropospheric_delay_correction_no_std_t &rhs) { +static inline bool operator!=( + const sbp_tropospheric_delay_correction_no_std_t &lhs, + const sbp_tropospheric_delay_correction_no_std_t &rhs) { return sbp_tropospheric_delay_correction_no_std_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_tropospheric_delay_correction_no_std_t &lhs, const sbp_tropospheric_delay_correction_no_std_t &rhs) { +static inline bool operator<( + const sbp_tropospheric_delay_correction_no_std_t &lhs, + const sbp_tropospheric_delay_correction_no_std_t &rhs) { return sbp_tropospheric_delay_correction_no_std_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_tropospheric_delay_correction_no_std_t &lhs, const sbp_tropospheric_delay_correction_no_std_t &rhs) { +static inline bool operator<=( + const sbp_tropospheric_delay_correction_no_std_t &lhs, + const sbp_tropospheric_delay_correction_no_std_t &rhs) { return sbp_tropospheric_delay_correction_no_std_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_tropospheric_delay_correction_no_std_t &lhs, const sbp_tropospheric_delay_correction_no_std_t &rhs) { +static inline bool operator>( + const sbp_tropospheric_delay_correction_no_std_t &lhs, + const sbp_tropospheric_delay_correction_no_std_t &rhs) { return sbp_tropospheric_delay_correction_no_std_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_tropospheric_delay_correction_no_std_t &lhs, const sbp_tropospheric_delay_correction_no_std_t &rhs) { +static inline bool operator>=( + const sbp_tropospheric_delay_correction_no_std_t &lhs, + const sbp_tropospheric_delay_correction_no_std_t &rhs) { return sbp_tropospheric_delay_correction_no_std_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SSR_TROPOSPHERICDELAYCORRECTIONNOSTD_H */ - diff --git a/c/include/libsbp/ssr_macros.h b/c/include/libsbp/ssr_macros.h index f297bb391..c2491dc54 100644 --- a/c/include/libsbp/ssr_macros.h +++ b/c/include/libsbp/ssr_macros.h @@ -18,270 +18,261 @@ #ifndef LIBSBP_SSR_MACROS_H #define LIBSBP_SSR_MACROS_H - /** - * Encoded length of sbp_code_biases_content_t (V4 API) and + * Encoded length of sbp_code_biases_content_t (V4 API) and * code_biases_content_t (legacy API) */ #define SBP_CODE_BIASES_CONTENT_ENCODED_LEN 3u - /** - * Encoded length of sbp_phase_biases_content_t (V4 API) and + * Encoded length of sbp_phase_biases_content_t (V4 API) and * phase_biases_content_t (legacy API) */ #define SBP_PHASE_BIASES_CONTENT_ENCODED_LEN 8u - /** - * Encoded length of sbp_stec_header_t (V4 API) and + * Encoded length of sbp_stec_header_t (V4 API) and * stec_header_t (legacy API) */ #define SBP_STEC_HEADER_ENCODED_LEN 14u - /** - * Encoded length of sbp_gridded_correction_header_t (V4 API) and + * Encoded length of sbp_gridded_correction_header_t (V4 API) and * gridded_correction_header_t (legacy API) */ #define SBP_GRIDDED_CORRECTION_HEADER_ENCODED_LEN 17u - /** - * The maximum number of items that can be stored in sbp_stec_sat_element_t::stec_coeff (V4 API) or stec_sat_element_t::stec_coeff (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_stec_sat_element_t::stec_coeff (V4 API) or stec_sat_element_t::stec_coeff + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_STEC_SAT_ELEMENT_STEC_COEFF_MAX 4u - /** - * Encoded length of sbp_stec_sat_element_t (V4 API) and + * Encoded length of sbp_stec_sat_element_t (V4 API) and * stec_sat_element_t (legacy API) */ #define SBP_STEC_SAT_ELEMENT_ENCODED_LEN 11u - /** - * Encoded length of sbp_tropospheric_delay_correction_no_std_t (V4 API) and + * Encoded length of sbp_tropospheric_delay_correction_no_std_t (V4 API) and * tropospheric_delay_correction_no_std_t (legacy API) */ #define SBP_TROPOSPHERIC_DELAY_CORRECTION_NO_STD_ENCODED_LEN 3u - /** - * Encoded length of sbp_tropospheric_delay_correction_t (V4 API) and + * Encoded length of sbp_tropospheric_delay_correction_t (V4 API) and * tropospheric_delay_correction_t (legacy API) */ #define SBP_TROPOSPHERIC_DELAY_CORRECTION_ENCODED_LEN 4u - /** - * Encoded length of sbp_stec_residual_no_std_t (V4 API) and + * Encoded length of sbp_stec_residual_no_std_t (V4 API) and * stec_residual_no_std_t (legacy API) */ #define SBP_STEC_RESIDUAL_NO_STD_ENCODED_LEN 4u - /** - * Encoded length of sbp_stec_residual_t (V4 API) and + * Encoded length of sbp_stec_residual_t (V4 API) and * stec_residual_t (legacy API) */ #define SBP_STEC_RESIDUAL_ENCODED_LEN 5u - #define SBP_MSG_SSR_ORBIT_CLOCK 0x05DD /** - * Encoded length of sbp_msg_ssr_orbit_clock_t (V4 API) and + * Encoded length of sbp_msg_ssr_orbit_clock_t (V4 API) and * msg_ssr_orbit_clock_t (legacy API) */ #define SBP_MSG_SSR_ORBIT_CLOCK_ENCODED_LEN 50u - #define SBP_MSG_SSR_CODE_BIASES 0x05E1 /** - * The maximum number of items that can be stored in sbp_msg_ssr_code_biases_t::biases (V4 API) or msg_ssr_code_biases_t::biases (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_code_biases_t::biases (V4 API) or msg_ssr_code_biases_t::biases + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_SSR_CODE_BIASES_BIASES_MAX 81u - /** - * Encoded length of sbp_msg_ssr_code_biases_t (V4 API) and + * Encoded length of sbp_msg_ssr_code_biases_t (V4 API) and * msg_ssr_code_biases_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_code_biases_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_code_biases_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_CODE_BIASES_ENCODED_OVERHEAD 10u - #define SBP_MSG_SSR_PHASE_BIASES 0x05E6 /** - * The maximum number of items that can be stored in sbp_msg_ssr_phase_biases_t::biases (V4 API) or msg_ssr_phase_biases_t::biases (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_phase_biases_t::biases (V4 API) or msg_ssr_phase_biases_t::biases + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_SSR_PHASE_BIASES_BIASES_MAX 30u - /** - * Encoded length of sbp_msg_ssr_phase_biases_t (V4 API) and + * Encoded length of sbp_msg_ssr_phase_biases_t (V4 API) and * msg_ssr_phase_biases_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_phase_biases_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_phase_biases_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_PHASE_BIASES_ENCODED_OVERHEAD 15u - #define SBP_MSG_SSR_STEC_CORRECTION_DEP 0x05FB /** - * The maximum number of items that can be stored in sbp_msg_ssr_stec_correction_dep_t::stec_sat_list (V4 API) or msg_ssr_stec_correction_dep_t::stec_sat_list (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_stec_correction_dep_t::stec_sat_list (V4 API) or + * msg_ssr_stec_correction_dep_t::stec_sat_list (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_SSR_STEC_CORRECTION_DEP_STEC_SAT_LIST_MAX 21u - /** - * Encoded length of sbp_msg_ssr_stec_correction_dep_t (V4 API) and + * Encoded length of sbp_msg_ssr_stec_correction_dep_t (V4 API) and * msg_ssr_stec_correction_dep_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_stec_correction_dep_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_stec_correction_dep_encoded_len to determine the actual size of + * an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_STEC_CORRECTION_DEP_ENCODED_OVERHEAD 14u - /** - * Encoded length of sbp_bounds_header_t (V4 API) and + * Encoded length of sbp_bounds_header_t (V4 API) and * bounds_header_t (legacy API) */ #define SBP_BOUNDS_HEADER_ENCODED_LEN 10u - #define SBP_MSG_SSR_STEC_CORRECTION 0x05FD /** - * The maximum number of items that can be stored in sbp_msg_ssr_stec_correction_t::stec_sat_list (V4 API) or msg_ssr_stec_correction_t::stec_sat_list (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_stec_correction_t::stec_sat_list (V4 API) or + * msg_ssr_stec_correction_t::stec_sat_list (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_SSR_STEC_CORRECTION_STEC_SAT_LIST_MAX 21u - /** - * Encoded length of sbp_msg_ssr_stec_correction_t (V4 API) and + * Encoded length of sbp_msg_ssr_stec_correction_t (V4 API) and * msg_ssr_stec_correction_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_stec_correction_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_stec_correction_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_STEC_CORRECTION_ENCODED_OVERHEAD 16u - #define SBP_MSG_SSR_GRIDDED_CORRECTION 0x05FC /** - * The maximum number of items that can be stored in sbp_msg_ssr_gridded_correction_t::stec_residuals (V4 API) or msg_ssr_gridded_correction_t::stec_residuals (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_gridded_correction_t::stec_residuals (V4 API) or + * msg_ssr_gridded_correction_t::stec_residuals (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_SSR_GRIDDED_CORRECTION_STEC_RESIDUALS_MAX 46u - /** - * Encoded length of sbp_msg_ssr_gridded_correction_t (V4 API) and + * Encoded length of sbp_msg_ssr_gridded_correction_t (V4 API) and * msg_ssr_gridded_correction_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_gridded_correction_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_gridded_correction_encoded_len to determine the actual size of + * an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_GRIDDED_CORRECTION_ENCODED_OVERHEAD 23u - /** - * Encoded length of sbp_stec_sat_element_integrity_t (V4 API) and + * Encoded length of sbp_stec_sat_element_integrity_t (V4 API) and * stec_sat_element_integrity_t (legacy API) */ #define SBP_STEC_SAT_ELEMENT_INTEGRITY_ENCODED_LEN 9u - #define SBP_MSG_SSR_GRIDDED_CORRECTION_BOUNDS 0x05FE /** - * The maximum number of items that can be stored in sbp_msg_ssr_gridded_correction_bounds_t::stec_sat_list (V4 API) or msg_ssr_gridded_correction_bounds_t::stec_sat_list (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_gridded_correction_bounds_t::stec_sat_list (V4 API) or + * msg_ssr_gridded_correction_bounds_t::stec_sat_list (legacy API) before the + * maximum SBP message size is exceeded */ #define SBP_MSG_SSR_GRIDDED_CORRECTION_BOUNDS_STEC_SAT_LIST_MAX 25u - /** - * Encoded length of sbp_msg_ssr_gridded_correction_bounds_t (V4 API) and + * Encoded length of sbp_msg_ssr_gridded_correction_bounds_t (V4 API) and * msg_ssr_gridded_correction_bounds_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_gridded_correction_bounds_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_gridded_correction_bounds_encoded_len to determine the actual + * size of an instance of this message. Users of the legacy API are required to + * track the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_GRIDDED_CORRECTION_BOUNDS_ENCODED_OVERHEAD 27u - #define SBP_MSG_SSR_TILE_DEFINITION_DEP_A 0x05F6 /** - * Encoded length of sbp_msg_ssr_tile_definition_dep_a_t (V4 API) and + * Encoded length of sbp_msg_ssr_tile_definition_dep_a_t (V4 API) and * msg_ssr_tile_definition_dep_a_t (legacy API) */ #define SBP_MSG_SSR_TILE_DEFINITION_DEP_A_ENCODED_LEN 24u - #define SBP_MSG_SSR_TILE_DEFINITION_DEP_B 0x05F7 /** - * Encoded length of sbp_msg_ssr_tile_definition_dep_b_t (V4 API) and + * Encoded length of sbp_msg_ssr_tile_definition_dep_b_t (V4 API) and * msg_ssr_tile_definition_dep_b_t (legacy API) */ #define SBP_MSG_SSR_TILE_DEFINITION_DEP_B_ENCODED_LEN 25u - #define SBP_MSG_SSR_TILE_DEFINITION 0x05F8 /** - * Encoded length of sbp_msg_ssr_tile_definition_t (V4 API) and + * Encoded length of sbp_msg_ssr_tile_definition_t (V4 API) and * msg_ssr_tile_definition_t (legacy API) */ #define SBP_MSG_SSR_TILE_DEFINITION_ENCODED_LEN 33u - #define SBP_SATELLITEAPC_SATELLITE_TYPE_MASK (0x1fu) #define SBP_SATELLITEAPC_SATELLITE_TYPE_SHIFT (0u) -#define SBP_SATELLITEAPC_SATELLITE_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_SATELLITEAPC_SATELLITE_TYPE_SHIFT) \ - & SBP_SATELLITEAPC_SATELLITE_TYPE_MASK)) -#define SBP_SATELLITEAPC_SATELLITE_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SATELLITEAPC_SATELLITE_TYPE_MASK << SBP_SATELLITEAPC_SATELLITE_TYPE_SHIFT))) | \ - (((val) & (SBP_SATELLITEAPC_SATELLITE_TYPE_MASK)) \ - << (SBP_SATELLITEAPC_SATELLITE_TYPE_SHIFT)));} while(0) - +#define SBP_SATELLITEAPC_SATELLITE_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_SATELLITEAPC_SATELLITE_TYPE_SHIFT) & \ + SBP_SATELLITEAPC_SATELLITE_TYPE_MASK)) +#define SBP_SATELLITEAPC_SATELLITE_TYPE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_SATELLITEAPC_SATELLITE_TYPE_MASK \ + << SBP_SATELLITEAPC_SATELLITE_TYPE_SHIFT))) | \ + (((val) & (SBP_SATELLITEAPC_SATELLITE_TYPE_MASK)) \ + << (SBP_SATELLITEAPC_SATELLITE_TYPE_SHIFT))); \ + } while (0) #define SBP_SATELLITEAPC_SATELLITE_TYPE_UNKNOWN_TYPE (0) #define SBP_SATELLITEAPC_SATELLITE_TYPE_GPS_I (1) @@ -309,265 +300,265 @@ #define SBP_SATELLITEAPC_SATELLITE_TYPE_BEIDOU_3SM_SECM (23) #define SBP_SATELLITEAPC_SATELLITE_TYPE_BEIDOU_3SI_SECM (24) /** - * The maximum number of items that can be stored in sbp_satellite_apc_t::pco (V4 API) or satellite_apc_t::pco (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in sbp_satellite_apc_t::pco + * (V4 API) or satellite_apc_t::pco (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_SATELLITE_APC_PCO_MAX 3u - /** - * The maximum number of items that can be stored in sbp_satellite_apc_t::pcv (V4 API) or satellite_apc_t::pcv (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in sbp_satellite_apc_t::pcv + * (V4 API) or satellite_apc_t::pcv (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_SATELLITE_APC_PCV_MAX 21u - /** - * Encoded length of sbp_satellite_apc_t (V4 API) and + * Encoded length of sbp_satellite_apc_t (V4 API) and * satellite_apc_t (legacy API) */ #define SBP_SATELLITE_APC_ENCODED_LEN 32u - #define SBP_MSG_SSR_SATELLITE_APC_DEP 0x0604 /** - * The maximum number of items that can be stored in sbp_msg_ssr_satellite_apc_dep_t::apc (V4 API) or msg_ssr_satellite_apc_dep_t::apc (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_satellite_apc_dep_t::apc (V4 API) or + * msg_ssr_satellite_apc_dep_t::apc (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_SSR_SATELLITE_APC_DEP_APC_MAX 7u - /** - * Encoded length of sbp_msg_ssr_satellite_apc_dep_t (V4 API) and + * Encoded length of sbp_msg_ssr_satellite_apc_dep_t (V4 API) and * msg_ssr_satellite_apc_dep_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_satellite_apc_dep_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_satellite_apc_dep_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_SATELLITE_APC_DEP_ENCODED_OVERHEAD 0u - #define SBP_MSG_SSR_SATELLITE_APC 0x0605 /** - * The maximum number of items that can be stored in sbp_msg_ssr_satellite_apc_t::apc (V4 API) or msg_ssr_satellite_apc_t::apc (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_satellite_apc_t::apc (V4 API) or msg_ssr_satellite_apc_t::apc + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_SSR_SATELLITE_APC_APC_MAX 7u - /** - * Encoded length of sbp_msg_ssr_satellite_apc_t (V4 API) and + * Encoded length of sbp_msg_ssr_satellite_apc_t (V4 API) and * msg_ssr_satellite_apc_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_satellite_apc_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_satellite_apc_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_SATELLITE_APC_ENCODED_OVERHEAD 9u - #define SBP_MSG_SSR_ORBIT_CLOCK_DEP_A 0x05DC /** - * Encoded length of sbp_msg_ssr_orbit_clock_dep_a_t (V4 API) and + * Encoded length of sbp_msg_ssr_orbit_clock_dep_a_t (V4 API) and * msg_ssr_orbit_clock_dep_a_t (legacy API) */ #define SBP_MSG_SSR_ORBIT_CLOCK_DEP_A_ENCODED_LEN 47u - /** - * Encoded length of sbp_stec_header_dep_a_t (V4 API) and + * Encoded length of sbp_stec_header_dep_a_t (V4 API) and * stec_header_dep_a_t (legacy API) */ #define SBP_STEC_HEADER_DEP_A_ENCODED_LEN 10u - /** - * Encoded length of sbp_gridded_correction_header_dep_a_t (V4 API) and + * Encoded length of sbp_gridded_correction_header_dep_a_t (V4 API) and * gridded_correction_header_dep_a_t (legacy API) */ #define SBP_GRIDDED_CORRECTION_HEADER_DEP_A_ENCODED_LEN 13u - /** - * Encoded length of sbp_grid_definition_header_dep_a_t (V4 API) and + * Encoded length of sbp_grid_definition_header_dep_a_t (V4 API) and * grid_definition_header_dep_a_t (legacy API) */ #define SBP_GRID_DEFINITION_HEADER_DEP_A_ENCODED_LEN 9u - #define SBP_MSG_SSR_STEC_CORRECTION_DEP_A 0x05EB /** - * The maximum number of items that can be stored in sbp_msg_ssr_stec_correction_dep_a_t::stec_sat_list (V4 API) or msg_ssr_stec_correction_dep_a_t::stec_sat_list (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_stec_correction_dep_a_t::stec_sat_list (V4 API) or + * msg_ssr_stec_correction_dep_a_t::stec_sat_list (legacy API) before the + * maximum SBP message size is exceeded */ #define SBP_MSG_SSR_STEC_CORRECTION_DEP_A_STEC_SAT_LIST_MAX 22u - /** - * Encoded length of sbp_msg_ssr_stec_correction_dep_a_t (V4 API) and + * Encoded length of sbp_msg_ssr_stec_correction_dep_a_t (V4 API) and * msg_ssr_stec_correction_dep_a_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_stec_correction_dep_a_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_stec_correction_dep_a_encoded_len to determine the actual size + * of an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_STEC_CORRECTION_DEP_A_ENCODED_OVERHEAD 10u - #define SBP_MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A 0x05F0 /** - * The maximum number of items that can be stored in sbp_msg_ssr_gridded_correction_no_std_dep_a_t::stec_residuals (V4 API) or msg_ssr_gridded_correction_no_std_dep_a_t::stec_residuals (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_gridded_correction_no_std_dep_a_t::stec_residuals (V4 API) or + * msg_ssr_gridded_correction_no_std_dep_a_t::stec_residuals (legacy API) before + * the maximum SBP message size is exceeded */ #define SBP_MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A_STEC_RESIDUALS_MAX 59u - /** - * Encoded length of sbp_msg_ssr_gridded_correction_no_std_dep_a_t (V4 API) and + * Encoded length of sbp_msg_ssr_gridded_correction_no_std_dep_a_t (V4 API) and * msg_ssr_gridded_correction_no_std_dep_a_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_gridded_correction_no_std_dep_a_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_gridded_correction_no_std_dep_a_encoded_len to determine the + * actual size of an instance of this message. Users of the legacy API are + * required to track the encoded message length when interacting with the legacy + * type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A_ENCODED_OVERHEAD 18u - #define SBP_MSG_SSR_GRIDDED_CORRECTION_DEP_A 0x05FA /** - * The maximum number of items that can be stored in sbp_msg_ssr_gridded_correction_dep_a_t::stec_residuals (V4 API) or msg_ssr_gridded_correction_dep_a_t::stec_residuals (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_gridded_correction_dep_a_t::stec_residuals (V4 API) or + * msg_ssr_gridded_correction_dep_a_t::stec_residuals (legacy API) before the + * maximum SBP message size is exceeded */ #define SBP_MSG_SSR_GRIDDED_CORRECTION_DEP_A_STEC_RESIDUALS_MAX 47u - /** - * Encoded length of sbp_msg_ssr_gridded_correction_dep_a_t (V4 API) and + * Encoded length of sbp_msg_ssr_gridded_correction_dep_a_t (V4 API) and * msg_ssr_gridded_correction_dep_a_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_gridded_correction_dep_a_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_gridded_correction_dep_a_encoded_len to determine the actual + * size of an instance of this message. Users of the legacy API are required to + * track the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_GRIDDED_CORRECTION_DEP_A_ENCODED_OVERHEAD 19u - #define SBP_MSG_SSR_GRID_DEFINITION_DEP_A 0x05F5 /** - * The maximum number of items that can be stored in sbp_msg_ssr_grid_definition_dep_a_t::rle_list (V4 API) or msg_ssr_grid_definition_dep_a_t::rle_list (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_grid_definition_dep_a_t::rle_list (V4 API) or + * msg_ssr_grid_definition_dep_a_t::rle_list (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_SSR_GRID_DEFINITION_DEP_A_RLE_LIST_MAX 246u - /** - * Encoded length of sbp_msg_ssr_grid_definition_dep_a_t (V4 API) and + * Encoded length of sbp_msg_ssr_grid_definition_dep_a_t (V4 API) and * msg_ssr_grid_definition_dep_a_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_grid_definition_dep_a_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_grid_definition_dep_a_encoded_len to determine the actual size + * of an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_GRID_DEFINITION_DEP_A_ENCODED_OVERHEAD 9u - /** - * Encoded length of sbp_orbit_clock_bound_t (V4 API) and + * Encoded length of sbp_orbit_clock_bound_t (V4 API) and * orbit_clock_bound_t (legacy API) */ #define SBP_ORBIT_CLOCK_BOUND_ENCODED_LEN 9u - #define SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS 0x05DE /** - * The maximum number of items that can be stored in sbp_msg_ssr_orbit_clock_bounds_t::orbit_clock_bounds (V4 API) or msg_ssr_orbit_clock_bounds_t::orbit_clock_bounds (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_orbit_clock_bounds_t::orbit_clock_bounds (V4 API) or + * msg_ssr_orbit_clock_bounds_t::orbit_clock_bounds (legacy API) before the + * maximum SBP message size is exceeded */ #define SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS_ORBIT_CLOCK_BOUNDS_MAX 26u - /** - * Encoded length of sbp_msg_ssr_orbit_clock_bounds_t (V4 API) and + * Encoded length of sbp_msg_ssr_orbit_clock_bounds_t (V4 API) and * msg_ssr_orbit_clock_bounds_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_orbit_clock_bounds_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_orbit_clock_bounds_encoded_len to determine the actual size of + * an instance of this message. Users of the legacy API are required to track + * the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS_ENCODED_OVERHEAD 13u - /** - * Encoded length of sbp_code_phase_biases_sat_sig_t (V4 API) and + * Encoded length of sbp_code_phase_biases_sat_sig_t (V4 API) and * code_phase_biases_sat_sig_t (legacy API) */ #define SBP_CODE_PHASE_BIASES_SAT_SIG_ENCODED_LEN 6u - #define SBP_MSG_SSR_CODE_PHASE_BIASES_BOUNDS 0x05EC /** - * The maximum number of items that can be stored in sbp_msg_ssr_code_phase_biases_bounds_t::satellites_signals (V4 API) or msg_ssr_code_phase_biases_bounds_t::satellites_signals (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_ssr_code_phase_biases_bounds_t::satellites_signals (V4 API) or + * msg_ssr_code_phase_biases_bounds_t::satellites_signals (legacy API) before + * the maximum SBP message size is exceeded */ #define SBP_MSG_SSR_CODE_PHASE_BIASES_BOUNDS_SATELLITES_SIGNALS_MAX 40u - /** - * Encoded length of sbp_msg_ssr_code_phase_biases_bounds_t (V4 API) and + * Encoded length of sbp_msg_ssr_code_phase_biases_bounds_t (V4 API) and * msg_ssr_code_phase_biases_bounds_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ssr_code_phase_biases_bounds_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ssr_code_phase_biases_bounds_encoded_len to determine the actual + * size of an instance of this message. Users of the legacy API are required to + * track the encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_SSR_CODE_PHASE_BIASES_BOUNDS_ENCODED_OVERHEAD 13u - /** - * Encoded length of sbp_orbit_clock_bound_degradation_t (V4 API) and + * Encoded length of sbp_orbit_clock_bound_degradation_t (V4 API) and * orbit_clock_bound_degradation_t (legacy API) */ #define SBP_ORBIT_CLOCK_BOUND_DEGRADATION_ENCODED_LEN 8u - #define SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION 0x05DF /** - * Encoded length of sbp_msg_ssr_orbit_clock_bounds_degradation_t (V4 API) and + * Encoded length of sbp_msg_ssr_orbit_clock_bounds_degradation_t (V4 API) and * msg_ssr_orbit_clock_bounds_degradation_t (legacy API) */ #define SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION_ENCODED_LEN 28u - - #endif /* LIBSBP_SSR_MACROS_H */ diff --git a/c/include/libsbp/system.h b/c/include/libsbp/system.h index 695d987e8..6d2bb2707 100644 --- a/c/include/libsbp/system.h +++ b/c/include/libsbp/system.h @@ -17,20 +17,20 @@ #ifndef LIBSBP_SYSTEM_MESSAGES_H #define LIBSBP_SYSTEM_MESSAGES_H -#include +#include +#include #include +#include +#include #include -#include -#include -#include -#include #include -#include -#include #include -#include #include #include -#include +#include +#include +#include +#include +#include #endif /* LIBSBP_SYSTEM_MESSAGES_H */ diff --git a/c/include/libsbp/system/MSG_CSAC_TELEMETRY.h b/c/include/libsbp/system/MSG_CSAC_TELEMETRY.h index 3ab15f044..9d0e40d11 100644 --- a/c/include/libsbp/system/MSG_CSAC_TELEMETRY.h +++ b/c/include/libsbp/system/MSG_CSAC_TELEMETRY.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SYSTEM_MSG_CSAC_TELEMETRY_H #define LIBSBP_SYSTEM_MSG_CSAC_TELEMETRY_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,191 +40,215 @@ *****************************************************************************/ /** Experimental telemetry message * -* The CSAC telemetry message has an implementation defined telemetry string from a device. It is not produced or available on general Swift Products. It is intended to be a low rate message for status purposes. + * The CSAC telemetry message has an implementation defined telemetry string + * from a device. It is not produced or available on general Swift Products. It + * is intended to be a low rate message for status purposes. */ typedef struct { - - /** -* Index representing the type of telemetry in use. It is implementation defined. + * Index representing the type of telemetry in use. It is implementation + * defined. */ u8 id; - /** -* Comma separated list of values as defined by the index + * Comma separated list of values as defined by the index */ sbp_string_t telemetry; } sbp_msg_csac_telemetry_t; +/** + * Initialise sbp_msg_csac_telemetry_t::telemetry to empty + * + * @param msg sbp_msg_csac_telemetry_t instance + */ +SBP_EXPORT void sbp_msg_csac_telemetry_telemetry_init( + sbp_msg_csac_telemetry_t *msg); - /** - * Initialise sbp_msg_csac_telemetry_t::telemetry to empty - * - * @param msg sbp_msg_csac_telemetry_t instance - */ - SBP_EXPORT void sbp_msg_csac_telemetry_telemetry_init(sbp_msg_csac_telemetry_t *msg); - - /** - * Test sbp_msg_csac_telemetry_t::telemetry for validity - * - * @param msg sbp_msg_csac_telemetry_t instance - * @return true is sbp_msg_csac_telemetry_t::telemetry is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_csac_telemetry_telemetry_valid(const sbp_msg_csac_telemetry_t *msg); +/** + * Test sbp_msg_csac_telemetry_t::telemetry for validity + * + * @param msg sbp_msg_csac_telemetry_t instance + * @return true is sbp_msg_csac_telemetry_t::telemetry is valid for encoding + * purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_csac_telemetry_telemetry_valid( + const sbp_msg_csac_telemetry_t *msg); - /** - * Tests 2 instances of sbp_msg_csac_telemetry_t::telemetry for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_csac_telemetry_t instance - * @param b sbp_msg_csac_telemetry_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_csac_telemetry_telemetry_strcmp(const sbp_msg_csac_telemetry_t *a, const sbp_msg_csac_telemetry_t *b); +/** + * Tests 2 instances of sbp_msg_csac_telemetry_t::telemetry for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_csac_telemetry_t instance + * @param b sbp_msg_csac_telemetry_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_csac_telemetry_telemetry_strcmp( + const sbp_msg_csac_telemetry_t *a, const sbp_msg_csac_telemetry_t *b); - /** - * Get the encoded size of sbp_msg_csac_telemetry_t::telemetry - * - * @param msg sbp_msg_csac_telemetry_t instance - * @return Size of sbp_msg_csac_telemetry_t::telemetry in wire representation - */ - SBP_EXPORT size_t sbp_msg_csac_telemetry_telemetry_encoded_len(const sbp_msg_csac_telemetry_t *msg); +/** + * Get the encoded size of sbp_msg_csac_telemetry_t::telemetry + * + * @param msg sbp_msg_csac_telemetry_t instance + * @return Size of sbp_msg_csac_telemetry_t::telemetry in wire representation + */ +SBP_EXPORT size_t sbp_msg_csac_telemetry_telemetry_encoded_len( + const sbp_msg_csac_telemetry_t *msg); - /** - * Query sbp_msg_csac_telemetry_t::telemetry for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_csac_telemetry_t::telemetry before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_csac_telemetry_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_csac_telemetry_telemetry_space_remaining(const sbp_msg_csac_telemetry_t *msg); - /** - * Set sbp_msg_csac_telemetry_t::telemetry - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_csac_telemetry_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_csac_telemetry_telemetry_set(sbp_msg_csac_telemetry_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_csac_telemetry_t::telemetry for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_csac_telemetry_t::telemetry before it exceeds the maximum + * size of the field in wire representation + * + * @param msg sbp_msg_csac_telemetry_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t sbp_msg_csac_telemetry_telemetry_space_remaining( + const sbp_msg_csac_telemetry_t *msg); +/** + * Set sbp_msg_csac_telemetry_t::telemetry + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_csac_telemetry_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_csac_telemetry_telemetry_set( + sbp_msg_csac_telemetry_t *msg, const char *new_str, bool should_trunc, + size_t *n_written); - /** - * Set sbp_msg_csac_telemetry_t::telemetry from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_csac_telemetry_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_csac_telemetry_telemetry_set_raw(sbp_msg_csac_telemetry_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_csac_telemetry_t::telemetry from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_csac_telemetry_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_csac_telemetry_telemetry_set_raw( + sbp_msg_csac_telemetry_t *msg, const char *new_buf, size_t new_buf_len, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_csac_telemetry_t::telemetry with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_csac_telemetry_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_csac_telemetry_telemetry_printf(sbp_msg_csac_telemetry_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_csac_telemetry_t::telemetry with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_csac_telemetry_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_csac_telemetry_telemetry_printf( + sbp_msg_csac_telemetry_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_csac_telemetry_t::telemetry with printf style formatting - * - * Identical to #sbp_msg_csac_telemetry_telemetry_printf except it takes a va_list argument - * - * @param msg sbp_msg_csac_telemetry_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_csac_telemetry_telemetry_vprintf(sbp_msg_csac_telemetry_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_csac_telemetry_t::telemetry with printf style formatting + * + * Identical to #sbp_msg_csac_telemetry_telemetry_printf except it takes a + * va_list argument + * + * @param msg sbp_msg_csac_telemetry_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_csac_telemetry_telemetry_vprintf( + sbp_msg_csac_telemetry_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_csac_telemetry_t::telemetry with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_csac_telemetry_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_csac_telemetry_telemetry_append_printf(sbp_msg_csac_telemetry_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_csac_telemetry_t::telemetry with printf style formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_csac_telemetry_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_csac_telemetry_telemetry_append_printf( + sbp_msg_csac_telemetry_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_csac_telemetry_t::telemetry with printf style formatting - * - * Identical to #sbp_msg_csac_telemetry_telemetry_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_csac_telemetry_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_csac_telemetry_telemetry_append_vprintf(sbp_msg_csac_telemetry_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_csac_telemetry_t::telemetry with printf style formatting + * + * Identical to #sbp_msg_csac_telemetry_telemetry_append_printf except it takes + * a va_list argument + * + * @param msg sbp_msg_csac_telemetry_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_csac_telemetry_telemetry_append_vprintf( + sbp_msg_csac_telemetry_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_csac_telemetry_t::telemetry - * - * @param msg sbp_msg_csac_telemetry_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_csac_telemetry_telemetry_get(const sbp_msg_csac_telemetry_t *msg); +/** + * Obtain the string value from sbp_msg_csac_telemetry_t::telemetry + * + * @param msg sbp_msg_csac_telemetry_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_csac_telemetry_telemetry_get( + const sbp_msg_csac_telemetry_t *msg); - /** - * Obtain the length of sbp_msg_csac_telemetry_t::telemetry - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_csac_telemetry_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_csac_telemetry_telemetry_strlen(const sbp_msg_csac_telemetry_t *msg); +/** + * Obtain the length of sbp_msg_csac_telemetry_t::telemetry + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_csac_telemetry_t instance + * @return Length of string + */ +SBP_EXPORT size_t +sbp_msg_csac_telemetry_telemetry_strlen(const sbp_msg_csac_telemetry_t *msg); /** * Get encoded size of an instance of sbp_msg_csac_telemetry_t @@ -232,46 +256,62 @@ typedef struct { * @param msg sbp_msg_csac_telemetry_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_csac_telemetry_encoded_len(const sbp_msg_csac_telemetry_t *msg) -{ - return SBP_MSG_CSAC_TELEMETRY_ENCODED_OVERHEAD - + sbp_msg_csac_telemetry_telemetry_encoded_len(msg) - ; +static inline size_t sbp_msg_csac_telemetry_encoded_len( + const sbp_msg_csac_telemetry_t *msg) { + return SBP_MSG_CSAC_TELEMETRY_ENCODED_OVERHEAD + + sbp_msg_csac_telemetry_telemetry_encoded_len(msg); } /** * Encode an instance of sbp_msg_csac_telemetry_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_csac_telemetry_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_csac_telemetry_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_csac_telemetry_t *msg); +SBP_EXPORT s8 +sbp_msg_csac_telemetry_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_csac_telemetry_t *msg); /** * Decode an instance of sbp_msg_csac_telemetry_t from wire representation * - * This function decodes the wire representation of a sbp_msg_csac_telemetry_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_csac_telemetry_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_csac_telemetry_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_csac_telemetry_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_csac_telemetry_t *msg); +SBP_EXPORT s8 sbp_msg_csac_telemetry_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_csac_telemetry_t *msg); /** * Send an instance of sbp_msg_csac_telemetry_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_csac_telemetry_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_csac_telemetry_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -279,51 +319,61 @@ SBP_EXPORT s8 sbp_msg_csac_telemetry_decode(const uint8_t *buf, uint8_t len, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_csac_telemetry_send(sbp_state_t *s, u16 sender_id, const sbp_msg_csac_telemetry_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_csac_telemetry_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_csac_telemetry_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_csac_telemetry_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_csac_telemetry_t instance * @param b sbp_msg_csac_telemetry_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_csac_telemetry_cmp(const sbp_msg_csac_telemetry_t *a, const sbp_msg_csac_telemetry_t *b); +SBP_EXPORT int sbp_msg_csac_telemetry_cmp(const sbp_msg_csac_telemetry_t *a, + const sbp_msg_csac_telemetry_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_csac_telemetry_t &lhs, const sbp_msg_csac_telemetry_t &rhs) { +static inline bool operator==(const sbp_msg_csac_telemetry_t &lhs, + const sbp_msg_csac_telemetry_t &rhs) { return sbp_msg_csac_telemetry_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_csac_telemetry_t &lhs, const sbp_msg_csac_telemetry_t &rhs) { +static inline bool operator!=(const sbp_msg_csac_telemetry_t &lhs, + const sbp_msg_csac_telemetry_t &rhs) { return sbp_msg_csac_telemetry_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_csac_telemetry_t &lhs, const sbp_msg_csac_telemetry_t &rhs) { +static inline bool operator<(const sbp_msg_csac_telemetry_t &lhs, + const sbp_msg_csac_telemetry_t &rhs) { return sbp_msg_csac_telemetry_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_csac_telemetry_t &lhs, const sbp_msg_csac_telemetry_t &rhs) { +static inline bool operator<=(const sbp_msg_csac_telemetry_t &lhs, + const sbp_msg_csac_telemetry_t &rhs) { return sbp_msg_csac_telemetry_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_csac_telemetry_t &lhs, const sbp_msg_csac_telemetry_t &rhs) { +static inline bool operator>(const sbp_msg_csac_telemetry_t &lhs, + const sbp_msg_csac_telemetry_t &rhs) { return sbp_msg_csac_telemetry_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_csac_telemetry_t &lhs, const sbp_msg_csac_telemetry_t &rhs) { +static inline bool operator>=(const sbp_msg_csac_telemetry_t &lhs, + const sbp_msg_csac_telemetry_t &rhs) { return sbp_msg_csac_telemetry_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SYSTEM_MSG_CSAC_TELEMETRY_H */ - diff --git a/c/include/libsbp/system/MSG_CSAC_TELEMETRY_LABELS.h b/c/include/libsbp/system/MSG_CSAC_TELEMETRY_LABELS.h index effc84e55..c13331474 100644 --- a/c/include/libsbp/system/MSG_CSAC_TELEMETRY_LABELS.h +++ b/c/include/libsbp/system/MSG_CSAC_TELEMETRY_LABELS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SYSTEM_MSG_CSAC_TELEMETRY_LABELS_H #define LIBSBP_SYSTEM_MSG_CSAC_TELEMETRY_LABELS_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,191 +40,224 @@ *****************************************************************************/ /** Experimental telemetry message labels * -* The CSAC telemetry message provides labels for each member of the string produced by MSG_CSAC_TELEMETRY. It should be provided by a device at a lower rate than the MSG_CSAC_TELEMETRY. + * The CSAC telemetry message provides labels for each member of the string + * produced by MSG_CSAC_TELEMETRY. It should be provided by a device at a lower + * rate than the MSG_CSAC_TELEMETRY. */ typedef struct { - - /** -* Index representing the type of telemetry in use. It is implementation defined. + * Index representing the type of telemetry in use. It is implementation + * defined. */ u8 id; - /** -* Comma separated list of telemetry field values + * Comma separated list of telemetry field values */ sbp_string_t telemetry_labels; } sbp_msg_csac_telemetry_labels_t; +/** + * Initialise sbp_msg_csac_telemetry_labels_t::telemetry_labels to empty + * + * @param msg sbp_msg_csac_telemetry_labels_t instance + */ +SBP_EXPORT void sbp_msg_csac_telemetry_labels_telemetry_labels_init( + sbp_msg_csac_telemetry_labels_t *msg); - /** - * Initialise sbp_msg_csac_telemetry_labels_t::telemetry_labels to empty - * - * @param msg sbp_msg_csac_telemetry_labels_t instance - */ - SBP_EXPORT void sbp_msg_csac_telemetry_labels_telemetry_labels_init(sbp_msg_csac_telemetry_labels_t *msg); - - /** - * Test sbp_msg_csac_telemetry_labels_t::telemetry_labels for validity - * - * @param msg sbp_msg_csac_telemetry_labels_t instance - * @return true is sbp_msg_csac_telemetry_labels_t::telemetry_labels is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_csac_telemetry_labels_telemetry_labels_valid(const sbp_msg_csac_telemetry_labels_t *msg); +/** + * Test sbp_msg_csac_telemetry_labels_t::telemetry_labels for validity + * + * @param msg sbp_msg_csac_telemetry_labels_t instance + * @return true is sbp_msg_csac_telemetry_labels_t::telemetry_labels is valid + * for encoding purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_csac_telemetry_labels_telemetry_labels_valid( + const sbp_msg_csac_telemetry_labels_t *msg); - /** - * Tests 2 instances of sbp_msg_csac_telemetry_labels_t::telemetry_labels for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_csac_telemetry_labels_t instance - * @param b sbp_msg_csac_telemetry_labels_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_csac_telemetry_labels_telemetry_labels_strcmp(const sbp_msg_csac_telemetry_labels_t *a, const sbp_msg_csac_telemetry_labels_t *b); +/** + * Tests 2 instances of sbp_msg_csac_telemetry_labels_t::telemetry_labels for + * equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_csac_telemetry_labels_t instance + * @param b sbp_msg_csac_telemetry_labels_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_csac_telemetry_labels_telemetry_labels_strcmp( + const sbp_msg_csac_telemetry_labels_t *a, + const sbp_msg_csac_telemetry_labels_t *b); - /** - * Get the encoded size of sbp_msg_csac_telemetry_labels_t::telemetry_labels - * - * @param msg sbp_msg_csac_telemetry_labels_t instance - * @return Size of sbp_msg_csac_telemetry_labels_t::telemetry_labels in wire representation - */ - SBP_EXPORT size_t sbp_msg_csac_telemetry_labels_telemetry_labels_encoded_len(const sbp_msg_csac_telemetry_labels_t *msg); +/** + * Get the encoded size of sbp_msg_csac_telemetry_labels_t::telemetry_labels + * + * @param msg sbp_msg_csac_telemetry_labels_t instance + * @return Size of sbp_msg_csac_telemetry_labels_t::telemetry_labels in wire + * representation + */ +SBP_EXPORT size_t sbp_msg_csac_telemetry_labels_telemetry_labels_encoded_len( + const sbp_msg_csac_telemetry_labels_t *msg); - /** - * Query sbp_msg_csac_telemetry_labels_t::telemetry_labels for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_csac_telemetry_labels_t::telemetry_labels before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_csac_telemetry_labels_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_csac_telemetry_labels_telemetry_labels_space_remaining(const sbp_msg_csac_telemetry_labels_t *msg); - /** - * Set sbp_msg_csac_telemetry_labels_t::telemetry_labels - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_csac_telemetry_labels_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_csac_telemetry_labels_telemetry_labels_set(sbp_msg_csac_telemetry_labels_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_csac_telemetry_labels_t::telemetry_labels for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_csac_telemetry_labels_t::telemetry_labels before it exceeds + * the maximum size of the field in wire representation + * + * @param msg sbp_msg_csac_telemetry_labels_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t +sbp_msg_csac_telemetry_labels_telemetry_labels_space_remaining( + const sbp_msg_csac_telemetry_labels_t *msg); +/** + * Set sbp_msg_csac_telemetry_labels_t::telemetry_labels + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_csac_telemetry_labels_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_csac_telemetry_labels_telemetry_labels_set( + sbp_msg_csac_telemetry_labels_t *msg, const char *new_str, + bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_csac_telemetry_labels_t::telemetry_labels from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_csac_telemetry_labels_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_csac_telemetry_labels_telemetry_labels_set_raw(sbp_msg_csac_telemetry_labels_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_csac_telemetry_labels_t::telemetry_labels from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_csac_telemetry_labels_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_csac_telemetry_labels_telemetry_labels_set_raw( + sbp_msg_csac_telemetry_labels_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written); - /** - * Set sbp_msg_csac_telemetry_labels_t::telemetry_labels with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_csac_telemetry_labels_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_csac_telemetry_labels_telemetry_labels_printf(sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_csac_telemetry_labels_t::telemetry_labels with printf style + * formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_csac_telemetry_labels_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_csac_telemetry_labels_telemetry_labels_printf( + sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_csac_telemetry_labels_t::telemetry_labels with printf style formatting - * - * Identical to #sbp_msg_csac_telemetry_labels_telemetry_labels_printf except it takes a va_list argument - * - * @param msg sbp_msg_csac_telemetry_labels_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_csac_telemetry_labels_telemetry_labels_vprintf(sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_csac_telemetry_labels_t::telemetry_labels with printf style + * formatting + * + * Identical to #sbp_msg_csac_telemetry_labels_telemetry_labels_printf except it + * takes a va_list argument + * + * @param msg sbp_msg_csac_telemetry_labels_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_csac_telemetry_labels_telemetry_labels_vprintf( + sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_csac_telemetry_labels_t::telemetry_labels with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_csac_telemetry_labels_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_csac_telemetry_labels_telemetry_labels_append_printf(sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_csac_telemetry_labels_t::telemetry_labels with printf style + * formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_csac_telemetry_labels_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_csac_telemetry_labels_telemetry_labels_append_printf( + sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_csac_telemetry_labels_t::telemetry_labels with printf style formatting - * - * Identical to #sbp_msg_csac_telemetry_labels_telemetry_labels_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_csac_telemetry_labels_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_csac_telemetry_labels_telemetry_labels_append_vprintf(sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_csac_telemetry_labels_t::telemetry_labels with printf style + * formatting + * + * Identical to #sbp_msg_csac_telemetry_labels_telemetry_labels_append_printf + * except it takes a va_list argument + * + * @param msg sbp_msg_csac_telemetry_labels_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_csac_telemetry_labels_telemetry_labels_append_vprintf( + sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_csac_telemetry_labels_t::telemetry_labels - * - * @param msg sbp_msg_csac_telemetry_labels_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_csac_telemetry_labels_telemetry_labels_get(const sbp_msg_csac_telemetry_labels_t *msg); +/** + * Obtain the string value from + * sbp_msg_csac_telemetry_labels_t::telemetry_labels + * + * @param msg sbp_msg_csac_telemetry_labels_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_csac_telemetry_labels_telemetry_labels_get( + const sbp_msg_csac_telemetry_labels_t *msg); - /** - * Obtain the length of sbp_msg_csac_telemetry_labels_t::telemetry_labels - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_csac_telemetry_labels_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_csac_telemetry_labels_telemetry_labels_strlen(const sbp_msg_csac_telemetry_labels_t *msg); +/** + * Obtain the length of sbp_msg_csac_telemetry_labels_t::telemetry_labels + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_csac_telemetry_labels_t instance + * @return Length of string + */ +SBP_EXPORT size_t sbp_msg_csac_telemetry_labels_telemetry_labels_strlen( + const sbp_msg_csac_telemetry_labels_t *msg); /** * Get encoded size of an instance of sbp_msg_csac_telemetry_labels_t @@ -232,46 +265,65 @@ typedef struct { * @param msg sbp_msg_csac_telemetry_labels_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_csac_telemetry_labels_encoded_len(const sbp_msg_csac_telemetry_labels_t *msg) -{ - return SBP_MSG_CSAC_TELEMETRY_LABELS_ENCODED_OVERHEAD - + sbp_msg_csac_telemetry_labels_telemetry_labels_encoded_len(msg) - ; +static inline size_t sbp_msg_csac_telemetry_labels_encoded_len( + const sbp_msg_csac_telemetry_labels_t *msg) { + return SBP_MSG_CSAC_TELEMETRY_LABELS_ENCODED_OVERHEAD + + sbp_msg_csac_telemetry_labels_telemetry_labels_encoded_len(msg); } /** * Encode an instance of sbp_msg_csac_telemetry_labels_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_csac_telemetry_labels_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_csac_telemetry_labels_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_csac_telemetry_labels_t *msg); +SBP_EXPORT s8 sbp_msg_csac_telemetry_labels_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_csac_telemetry_labels_t *msg); /** - * Decode an instance of sbp_msg_csac_telemetry_labels_t from wire representation + * Decode an instance of sbp_msg_csac_telemetry_labels_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_csac_telemetry_labels_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_csac_telemetry_labels_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_csac_telemetry_labels_t instance + * @param buf Wire representation of the sbp_msg_csac_telemetry_labels_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_csac_telemetry_labels_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_csac_telemetry_labels_t *msg); +SBP_EXPORT s8 sbp_msg_csac_telemetry_labels_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_csac_telemetry_labels_t *msg); /** - * Send an instance of sbp_msg_csac_telemetry_labels_t with the given write function + * Send an instance of sbp_msg_csac_telemetry_labels_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_csac_telemetry_labels_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_csac_telemetry_labels_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -279,51 +331,62 @@ SBP_EXPORT s8 sbp_msg_csac_telemetry_labels_decode(const uint8_t *buf, uint8_t l * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_csac_telemetry_labels_send(sbp_state_t *s, u16 sender_id, const sbp_msg_csac_telemetry_labels_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_csac_telemetry_labels_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_csac_telemetry_labels_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_csac_telemetry_labels_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_csac_telemetry_labels_t instance * @param b sbp_msg_csac_telemetry_labels_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_csac_telemetry_labels_cmp(const sbp_msg_csac_telemetry_labels_t *a, const sbp_msg_csac_telemetry_labels_t *b); +SBP_EXPORT int sbp_msg_csac_telemetry_labels_cmp( + const sbp_msg_csac_telemetry_labels_t *a, + const sbp_msg_csac_telemetry_labels_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_csac_telemetry_labels_t &lhs, const sbp_msg_csac_telemetry_labels_t &rhs) { +static inline bool operator==(const sbp_msg_csac_telemetry_labels_t &lhs, + const sbp_msg_csac_telemetry_labels_t &rhs) { return sbp_msg_csac_telemetry_labels_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_csac_telemetry_labels_t &lhs, const sbp_msg_csac_telemetry_labels_t &rhs) { +static inline bool operator!=(const sbp_msg_csac_telemetry_labels_t &lhs, + const sbp_msg_csac_telemetry_labels_t &rhs) { return sbp_msg_csac_telemetry_labels_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_csac_telemetry_labels_t &lhs, const sbp_msg_csac_telemetry_labels_t &rhs) { +static inline bool operator<(const sbp_msg_csac_telemetry_labels_t &lhs, + const sbp_msg_csac_telemetry_labels_t &rhs) { return sbp_msg_csac_telemetry_labels_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_csac_telemetry_labels_t &lhs, const sbp_msg_csac_telemetry_labels_t &rhs) { +static inline bool operator<=(const sbp_msg_csac_telemetry_labels_t &lhs, + const sbp_msg_csac_telemetry_labels_t &rhs) { return sbp_msg_csac_telemetry_labels_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_csac_telemetry_labels_t &lhs, const sbp_msg_csac_telemetry_labels_t &rhs) { +static inline bool operator>(const sbp_msg_csac_telemetry_labels_t &lhs, + const sbp_msg_csac_telemetry_labels_t &rhs) { return sbp_msg_csac_telemetry_labels_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_csac_telemetry_labels_t &lhs, const sbp_msg_csac_telemetry_labels_t &rhs) { +static inline bool operator>=(const sbp_msg_csac_telemetry_labels_t &lhs, + const sbp_msg_csac_telemetry_labels_t &rhs) { return sbp_msg_csac_telemetry_labels_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SYSTEM_MSG_CSAC_TELEMETRY_LABELS_H */ - diff --git a/c/include/libsbp/system/MSG_DGNSS_STATUS.h b/c/include/libsbp/system/MSG_DGNSS_STATUS.h index bde207ee3..23f65f0d4 100644 --- a/c/include/libsbp/system/MSG_DGNSS_STATUS.h +++ b/c/include/libsbp/system/MSG_DGNSS_STATUS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SYSTEM_MSG_DGNSS_STATUS_H #define LIBSBP_SYSTEM_MSG_DGNSS_STATUS_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,203 +40,230 @@ *****************************************************************************/ /** Status of received corrections * -* This message provides information about the receipt of Differential corrections. It is expected to be sent with each receipt of a complete corrections packet. + * This message provides information about the receipt of Differential + * corrections. It is expected to be sent with each receipt of a complete + * corrections packet. */ typedef struct { - - /** -* Status flags + * Status flags */ u8 flags; - /** -* Latency of observation receipt [deci-seconds] + * Latency of observation receipt [deci-seconds] */ u16 latency; - /** -* Number of signals from base station + * Number of signals from base station */ u8 num_signals; - /** -* Corrections source string + * Corrections source string */ sbp_string_t source; } sbp_msg_dgnss_status_t; +/** + * Initialise sbp_msg_dgnss_status_t::source to empty + * + * @param msg sbp_msg_dgnss_status_t instance + */ +SBP_EXPORT void sbp_msg_dgnss_status_source_init(sbp_msg_dgnss_status_t *msg); - /** - * Initialise sbp_msg_dgnss_status_t::source to empty - * - * @param msg sbp_msg_dgnss_status_t instance - */ - SBP_EXPORT void sbp_msg_dgnss_status_source_init(sbp_msg_dgnss_status_t *msg); - - /** - * Test sbp_msg_dgnss_status_t::source for validity - * - * @param msg sbp_msg_dgnss_status_t instance - * @return true is sbp_msg_dgnss_status_t::source is valid for encoding purposes, false otherwise - */ - SBP_EXPORT bool sbp_msg_dgnss_status_source_valid(const sbp_msg_dgnss_status_t *msg); +/** + * Test sbp_msg_dgnss_status_t::source for validity + * + * @param msg sbp_msg_dgnss_status_t instance + * @return true is sbp_msg_dgnss_status_t::source is valid for encoding + * purposes, false otherwise + */ +SBP_EXPORT bool sbp_msg_dgnss_status_source_valid( + const sbp_msg_dgnss_status_t *msg); - /** - * Tests 2 instances of sbp_msg_dgnss_status_t::source for equality - * - * Returns a value with the same definitions as strcmp from the C standard library - * - * @param a sbp_msg_dgnss_status_t instance - * @param b sbp_msg_dgnss_status_t instance - * @return 0 if equal, <0 if a0 if a>b - */ - SBP_EXPORT int sbp_msg_dgnss_status_source_strcmp(const sbp_msg_dgnss_status_t *a, const sbp_msg_dgnss_status_t *b); +/** + * Tests 2 instances of sbp_msg_dgnss_status_t::source for equality + * + * Returns a value with the same definitions as strcmp from the C standard + * library + * + * @param a sbp_msg_dgnss_status_t instance + * @param b sbp_msg_dgnss_status_t instance + * @return 0 if equal, <0 if a0 if a>b + */ +SBP_EXPORT int sbp_msg_dgnss_status_source_strcmp( + const sbp_msg_dgnss_status_t *a, const sbp_msg_dgnss_status_t *b); - /** - * Get the encoded size of sbp_msg_dgnss_status_t::source - * - * @param msg sbp_msg_dgnss_status_t instance - * @return Size of sbp_msg_dgnss_status_t::source in wire representation - */ - SBP_EXPORT size_t sbp_msg_dgnss_status_source_encoded_len(const sbp_msg_dgnss_status_t *msg); +/** + * Get the encoded size of sbp_msg_dgnss_status_t::source + * + * @param msg sbp_msg_dgnss_status_t instance + * @return Size of sbp_msg_dgnss_status_t::source in wire representation + */ +SBP_EXPORT size_t +sbp_msg_dgnss_status_source_encoded_len(const sbp_msg_dgnss_status_t *msg); - /** - * Query sbp_msg_dgnss_status_t::source for remaining space - * - * Returns the number of bytes (not including NULL terminator) which can be added to sbp_msg_dgnss_status_t::source before it exceeds the maximum size of the field in wire representation - * - * @param msg sbp_msg_dgnss_status_t instance - * @return Maximum number of bytes that can be appended to the existing string - */ - SBP_EXPORT size_t sbp_msg_dgnss_status_source_space_remaining(const sbp_msg_dgnss_status_t *msg); - /** - * Set sbp_msg_dgnss_status_t::source - * - * Erase any existing content and replace with the specified string - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_dgnss_status_t instance - * @param new_str New string - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_dgnss_status_source_set(sbp_msg_dgnss_status_t *msg, const char *new_str, bool should_trunc, size_t *n_written); +/** + * Query sbp_msg_dgnss_status_t::source for remaining space + * + * Returns the number of bytes (not including NULL terminator) which can be + * added to sbp_msg_dgnss_status_t::source before it exceeds the maximum size of + * the field in wire representation + * + * @param msg sbp_msg_dgnss_status_t instance + * @return Maximum number of bytes that can be appended to the existing string + */ +SBP_EXPORT size_t +sbp_msg_dgnss_status_source_space_remaining(const sbp_msg_dgnss_status_t *msg); +/** + * Set sbp_msg_dgnss_status_t::source + * + * Erase any existing content and replace with the specified string + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_dgnss_status_t instance + * @param new_str New string + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_dgnss_status_source_set(sbp_msg_dgnss_status_t *msg, + const char *new_str, + bool should_trunc, + size_t *n_written); - /** - * Set sbp_msg_dgnss_status_t::source from a raw buffer - * - * Erase any existing content and replace with the specified raw buffer - * - * If the should_trunc parameter is set to false and the specified string is - * longer than can be represented in wire encoding, this function will return - * false. Otherwise, if should_trunc is set to true, then as much as possible will - * be read from the new_str as can fit in the msg. - * - * @param msg sbp_msg_dgnss_status_t instance - * @param new_buf New buffer - * @param new_buf_len New buffer length - * @param should_trunc Whether the new_str can be truncated to fit in msg - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_dgnss_status_source_set_raw(sbp_msg_dgnss_status_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written); +/** + * Set sbp_msg_dgnss_status_t::source from a raw buffer + * + * Erase any existing content and replace with the specified raw buffer + * + * If the should_trunc parameter is set to false and the specified string is + * longer than can be represented in wire encoding, this function will return + * false. Otherwise, if should_trunc is set to true, then as much as possible + * will be read from the new_str as can fit in the msg. + * + * @param msg sbp_msg_dgnss_status_t instance + * @param new_buf New buffer + * @param new_buf_len New buffer length + * @param should_trunc Whether the new_str can be truncated to fit in msg + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_dgnss_status_source_set_raw(sbp_msg_dgnss_status_t *msg, + const char *new_buf, + size_t new_buf_len, + bool should_trunc, + size_t *n_written); - /** - * Set sbp_msg_dgnss_status_t::source with printf style formatting - * - * Erase any existing content and replace with the formatted string - * - * This function will return true if the new string was successfully applied. - * If should_trunc is set false, and the operation would end up overflowing the - * maximum size of this field in wire encoding the existing contents will be - * erased and this function will return false. Otherwise, if should_trunc is - * set true, the input formatted string will be truncated to fit. - * - * @param msg sbp_msg_dgnss_status_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_dgnss_status_source_printf(sbp_msg_dgnss_status_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Set sbp_msg_dgnss_status_t::source with printf style formatting + * + * Erase any existing content and replace with the formatted string + * + * This function will return true if the new string was successfully applied. + * If should_trunc is set false, and the operation would end up overflowing the + * maximum size of this field in wire encoding the existing contents will be + * erased and this function will return false. Otherwise, if should_trunc is + * set true, the input formatted string will be truncated to fit. + * + * @param msg sbp_msg_dgnss_status_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_dgnss_status_source_printf(sbp_msg_dgnss_status_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, ...) + SBP_ATTR_FORMAT(4, 5); - /** - * Set sbp_msg_dgnss_status_t::source with printf style formatting - * - * Identical to #sbp_msg_dgnss_status_source_printf except it takes a va_list argument - * - * @param msg sbp_msg_dgnss_status_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_dgnss_status_source_vprintf(sbp_msg_dgnss_status_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Set sbp_msg_dgnss_status_t::source with printf style formatting + * + * Identical to #sbp_msg_dgnss_status_source_printf except it takes a va_list + * argument + * + * @param msg sbp_msg_dgnss_status_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_dgnss_status_source_vprintf(sbp_msg_dgnss_status_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, va_list ap) + SBP_ATTR_VFORMAT(4); - /** - * Append sbp_msg_dgnss_status_t::source with printf style formatting - * - * The new string will be appended to the existing contents of the string (if - * any). If should_trunc is false and the operation would end up overflowing - * the maximum size of this field in wire encoding, the existing contents will - * be unmodified and this function will return false. Otherwise, if - * should_trunc is true, the input string will be truncated to fit. - * - * @param msg sbp_msg_dgnss_status_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_dgnss_status_source_append_printf(sbp_msg_dgnss_status_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) SBP_ATTR_FORMAT(4,5); +/** + * Append sbp_msg_dgnss_status_t::source with printf style formatting + * + * The new string will be appended to the existing contents of the string (if + * any). If should_trunc is false and the operation would end up overflowing + * the maximum size of this field in wire encoding, the existing contents will + * be unmodified and this function will return false. Otherwise, if + * should_trunc is true, the input string will be truncated to fit. + * + * @param msg sbp_msg_dgnss_status_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_dgnss_status_source_append_printf( + sbp_msg_dgnss_status_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) SBP_ATTR_FORMAT(4, 5); - /** - * Append sbp_msg_dgnss_status_t::source with printf style formatting - * - * Identical to #sbp_msg_dgnss_status_source_append_printf except it takes a va_list argument - * - * @param msg sbp_msg_dgnss_status_t instance - * @param should_trunc Whether the input string should be truncated to fit - * @param n_written If not null, on success will be set to the number of bytes - * written to msg - * @param fmt printf style format string - * @param ap Argument list - * @return true on success, false otherwise - */ - SBP_EXPORT bool sbp_msg_dgnss_status_source_append_vprintf(sbp_msg_dgnss_status_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); +/** + * Append sbp_msg_dgnss_status_t::source with printf style formatting + * + * Identical to #sbp_msg_dgnss_status_source_append_printf except it takes a + * va_list argument + * + * @param msg sbp_msg_dgnss_status_t instance + * @param should_trunc Whether the input string should be truncated to fit + * @param n_written If not null, on success will be set to the number of bytes + * written to msg + * @param fmt printf style format string + * @param ap Argument list + * @return true on success, false otherwise + */ +SBP_EXPORT bool sbp_msg_dgnss_status_source_append_vprintf( + sbp_msg_dgnss_status_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) SBP_ATTR_VFORMAT(4); - /** - * Obtain the string value from sbp_msg_dgnss_status_t::source - * - * @param msg sbp_msg_dgnss_status_t instance - * @return String contents - */ - SBP_EXPORT const char *sbp_msg_dgnss_status_source_get(const sbp_msg_dgnss_status_t *msg); +/** + * Obtain the string value from sbp_msg_dgnss_status_t::source + * + * @param msg sbp_msg_dgnss_status_t instance + * @return String contents + */ +SBP_EXPORT const char *sbp_msg_dgnss_status_source_get( + const sbp_msg_dgnss_status_t *msg); - /** - * Obtain the length of sbp_msg_dgnss_status_t::source - * - * The returned value does not include the NULL terminator. - * - * @param msg sbp_msg_dgnss_status_t instance - * @return Length of string - */ - SBP_EXPORT size_t sbp_msg_dgnss_status_source_strlen(const sbp_msg_dgnss_status_t *msg); +/** + * Obtain the length of sbp_msg_dgnss_status_t::source + * + * The returned value does not include the NULL terminator. + * + * @param msg sbp_msg_dgnss_status_t instance + * @return Length of string + */ +SBP_EXPORT size_t +sbp_msg_dgnss_status_source_strlen(const sbp_msg_dgnss_status_t *msg); /** * Get encoded size of an instance of sbp_msg_dgnss_status_t @@ -244,46 +271,62 @@ typedef struct { * @param msg sbp_msg_dgnss_status_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_dgnss_status_encoded_len(const sbp_msg_dgnss_status_t *msg) -{ - return SBP_MSG_DGNSS_STATUS_ENCODED_OVERHEAD - + sbp_msg_dgnss_status_source_encoded_len(msg) - ; +static inline size_t sbp_msg_dgnss_status_encoded_len( + const sbp_msg_dgnss_status_t *msg) { + return SBP_MSG_DGNSS_STATUS_ENCODED_OVERHEAD + + sbp_msg_dgnss_status_source_encoded_len(msg); } /** * Encode an instance of sbp_msg_dgnss_status_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_dgnss_status_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_dgnss_status_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_dgnss_status_t *msg); +SBP_EXPORT s8 sbp_msg_dgnss_status_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_dgnss_status_t *msg); /** * Decode an instance of sbp_msg_dgnss_status_t from wire representation * - * This function decodes the wire representation of a sbp_msg_dgnss_status_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_dgnss_status_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_dgnss_status_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_dgnss_status_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_dgnss_status_t *msg); +SBP_EXPORT s8 sbp_msg_dgnss_status_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_dgnss_status_t *msg); /** * Send an instance of sbp_msg_dgnss_status_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_dgnss_status_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_dgnss_status_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -291,51 +334,61 @@ SBP_EXPORT s8 sbp_msg_dgnss_status_decode(const uint8_t *buf, uint8_t len, uint8 * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_dgnss_status_send(sbp_state_t *s, u16 sender_id, const sbp_msg_dgnss_status_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_dgnss_status_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_dgnss_status_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_dgnss_status_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_dgnss_status_t instance * @param b sbp_msg_dgnss_status_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_dgnss_status_cmp(const sbp_msg_dgnss_status_t *a, const sbp_msg_dgnss_status_t *b); +SBP_EXPORT int sbp_msg_dgnss_status_cmp(const sbp_msg_dgnss_status_t *a, + const sbp_msg_dgnss_status_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_dgnss_status_t &lhs, const sbp_msg_dgnss_status_t &rhs) { +static inline bool operator==(const sbp_msg_dgnss_status_t &lhs, + const sbp_msg_dgnss_status_t &rhs) { return sbp_msg_dgnss_status_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_dgnss_status_t &lhs, const sbp_msg_dgnss_status_t &rhs) { +static inline bool operator!=(const sbp_msg_dgnss_status_t &lhs, + const sbp_msg_dgnss_status_t &rhs) { return sbp_msg_dgnss_status_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_dgnss_status_t &lhs, const sbp_msg_dgnss_status_t &rhs) { +static inline bool operator<(const sbp_msg_dgnss_status_t &lhs, + const sbp_msg_dgnss_status_t &rhs) { return sbp_msg_dgnss_status_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_dgnss_status_t &lhs, const sbp_msg_dgnss_status_t &rhs) { +static inline bool operator<=(const sbp_msg_dgnss_status_t &lhs, + const sbp_msg_dgnss_status_t &rhs) { return sbp_msg_dgnss_status_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_dgnss_status_t &lhs, const sbp_msg_dgnss_status_t &rhs) { +static inline bool operator>(const sbp_msg_dgnss_status_t &lhs, + const sbp_msg_dgnss_status_t &rhs) { return sbp_msg_dgnss_status_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_dgnss_status_t &lhs, const sbp_msg_dgnss_status_t &rhs) { +static inline bool operator>=(const sbp_msg_dgnss_status_t &lhs, + const sbp_msg_dgnss_status_t &rhs) { return sbp_msg_dgnss_status_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SYSTEM_MSG_DGNSS_STATUS_H */ - diff --git a/c/include/libsbp/system/MSG_GNSS_TIME_OFFSET.h b/c/include/libsbp/system/MSG_GNSS_TIME_OFFSET.h index a1488f9e7..a940c4d61 100644 --- a/c/include/libsbp/system/MSG_GNSS_TIME_OFFSET.h +++ b/c/include/libsbp/system/MSG_GNSS_TIME_OFFSET.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SYSTEM_MSG_GNSS_TIME_OFFSET_H #define LIBSBP_SYSTEM_MSG_GNSS_TIME_OFFSET_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,45 +40,40 @@ *****************************************************************************/ /** Offset of the local time with respect to GNSS time * -* The GNSS time offset message contains the information that is needed to translate messages tagged with a local timestamp (e.g. IMU or wheeltick messages) to GNSS time for the sender producing this message. + * The GNSS time offset message contains the information that is needed to + * translate messages tagged with a local timestamp (e.g. IMU or wheeltick + * messages) to GNSS time for the sender producing this message. */ typedef struct { - - /** -* Weeks portion of the time offset [weeks] + * Weeks portion of the time offset [weeks] */ s16 weeks; - /** -* Milliseconds portion of the time offset [ms] + * Milliseconds portion of the time offset [ms] */ s32 milliseconds; - /** -* Microseconds portion of the time offset [microseconds] + * Microseconds portion of the time offset [microseconds] */ s16 microseconds; - /** -* Status flags (reserved) + * Status flags (reserved) */ u8 flags; } sbp_msg_gnss_time_offset_t; - - /** * Get encoded size of an instance of sbp_msg_gnss_time_offset_t * * @param msg sbp_msg_gnss_time_offset_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_gnss_time_offset_encoded_len(const sbp_msg_gnss_time_offset_t *msg) -{ +static inline size_t sbp_msg_gnss_time_offset_encoded_len( + const sbp_msg_gnss_time_offset_t *msg) { (void)msg; return SBP_MSG_GNSS_TIME_OFFSET_ENCODED_LEN; } @@ -86,36 +81,53 @@ static inline size_t sbp_msg_gnss_time_offset_encoded_len(const sbp_msg_gnss_tim /** * Encode an instance of sbp_msg_gnss_time_offset_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_gnss_time_offset_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_gnss_time_offset_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_gnss_time_offset_t *msg); +SBP_EXPORT s8 +sbp_msg_gnss_time_offset_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_gnss_time_offset_t *msg); /** * Decode an instance of sbp_msg_gnss_time_offset_t from wire representation * - * This function decodes the wire representation of a sbp_msg_gnss_time_offset_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_gnss_time_offset_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_gnss_time_offset_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_gnss_time_offset_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_gnss_time_offset_t *msg); +SBP_EXPORT s8 sbp_msg_gnss_time_offset_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_gnss_time_offset_t *msg); /** * Send an instance of sbp_msg_gnss_time_offset_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_gnss_time_offset_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_gnss_time_offset_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -123,51 +135,61 @@ SBP_EXPORT s8 sbp_msg_gnss_time_offset_decode(const uint8_t *buf, uint8_t len, u * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_gnss_time_offset_send(sbp_state_t *s, u16 sender_id, const sbp_msg_gnss_time_offset_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_gnss_time_offset_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_gnss_time_offset_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_gnss_time_offset_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_gnss_time_offset_t instance * @param b sbp_msg_gnss_time_offset_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_gnss_time_offset_cmp(const sbp_msg_gnss_time_offset_t *a, const sbp_msg_gnss_time_offset_t *b); +SBP_EXPORT int sbp_msg_gnss_time_offset_cmp( + const sbp_msg_gnss_time_offset_t *a, const sbp_msg_gnss_time_offset_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_gnss_time_offset_t &lhs, const sbp_msg_gnss_time_offset_t &rhs) { +static inline bool operator==(const sbp_msg_gnss_time_offset_t &lhs, + const sbp_msg_gnss_time_offset_t &rhs) { return sbp_msg_gnss_time_offset_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_gnss_time_offset_t &lhs, const sbp_msg_gnss_time_offset_t &rhs) { +static inline bool operator!=(const sbp_msg_gnss_time_offset_t &lhs, + const sbp_msg_gnss_time_offset_t &rhs) { return sbp_msg_gnss_time_offset_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_gnss_time_offset_t &lhs, const sbp_msg_gnss_time_offset_t &rhs) { +static inline bool operator<(const sbp_msg_gnss_time_offset_t &lhs, + const sbp_msg_gnss_time_offset_t &rhs) { return sbp_msg_gnss_time_offset_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_gnss_time_offset_t &lhs, const sbp_msg_gnss_time_offset_t &rhs) { +static inline bool operator<=(const sbp_msg_gnss_time_offset_t &lhs, + const sbp_msg_gnss_time_offset_t &rhs) { return sbp_msg_gnss_time_offset_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_gnss_time_offset_t &lhs, const sbp_msg_gnss_time_offset_t &rhs) { +static inline bool operator>(const sbp_msg_gnss_time_offset_t &lhs, + const sbp_msg_gnss_time_offset_t &rhs) { return sbp_msg_gnss_time_offset_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_gnss_time_offset_t &lhs, const sbp_msg_gnss_time_offset_t &rhs) { +static inline bool operator>=(const sbp_msg_gnss_time_offset_t &lhs, + const sbp_msg_gnss_time_offset_t &rhs) { return sbp_msg_gnss_time_offset_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SYSTEM_MSG_GNSS_TIME_OFFSET_H */ - diff --git a/c/include/libsbp/system/MSG_GROUP_META.h b/c/include/libsbp/system/MSG_GROUP_META.h index da4ccde7c..e220d4af5 100644 --- a/c/include/libsbp/system/MSG_GROUP_META.h +++ b/c/include/libsbp/system/MSG_GROUP_META.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SYSTEM_MSG_GROUP_META_H #define LIBSBP_SYSTEM_MSG_GROUP_META_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,83 +40,95 @@ *****************************************************************************/ /** Solution Group Metadata * -* This leading message lists the time metadata of the Solution Group. It also lists the atomic contents (i.e. types of messages included) of the Solution Group. + * This leading message lists the time metadata of the Solution Group. It also + * lists the atomic contents (i.e. types of messages included) of the Solution + * Group. */ typedef struct { - - /** -* Id of the Msgs Group, 0 is Unknown, 1 is Bestpos, 2 is Gnss + * Id of the Msgs Group, 0 is Unknown, 1 is Bestpos, 2 is Gnss */ u8 group_id; - /** -* Status flags (reserved) + * Status flags (reserved) */ u8 flags; - /** -* Size of list group_msgs + * Size of list group_msgs */ u8 n_group_msgs; - /** - * An in-order list of message types included in the Solution Group, including GROUP_META itself + * An in-order list of message types included in the Solution Group, including + * GROUP_META itself */ u16 group_msgs[SBP_MSG_GROUP_META_GROUP_MSGS_MAX]; } sbp_msg_group_meta_t; - - /** * Get encoded size of an instance of sbp_msg_group_meta_t * * @param msg sbp_msg_group_meta_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_group_meta_encoded_len(const sbp_msg_group_meta_t *msg) -{ - return SBP_MSG_GROUP_META_ENCODED_OVERHEAD - + (msg->n_group_msgs * SBP_ENCODED_LEN_U16) - ; +static inline size_t sbp_msg_group_meta_encoded_len( + const sbp_msg_group_meta_t *msg) { + return SBP_MSG_GROUP_META_ENCODED_OVERHEAD + + (msg->n_group_msgs * SBP_ENCODED_LEN_U16); } /** * Encode an instance of sbp_msg_group_meta_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_group_meta_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_group_meta_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_group_meta_t *msg); +SBP_EXPORT s8 sbp_msg_group_meta_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_group_meta_t *msg); /** * Decode an instance of sbp_msg_group_meta_t from wire representation * - * This function decodes the wire representation of a sbp_msg_group_meta_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_group_meta_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_group_meta_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_group_meta_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_group_meta_t *msg); +SBP_EXPORT s8 sbp_msg_group_meta_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_group_meta_t *msg); /** * Send an instance of sbp_msg_group_meta_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_group_meta_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_group_meta_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -124,51 +136,61 @@ SBP_EXPORT s8 sbp_msg_group_meta_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_group_meta_send(sbp_state_t *s, u16 sender_id, const sbp_msg_group_meta_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_group_meta_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_group_meta_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_group_meta_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_group_meta_t instance * @param b sbp_msg_group_meta_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_group_meta_cmp(const sbp_msg_group_meta_t *a, const sbp_msg_group_meta_t *b); +SBP_EXPORT int sbp_msg_group_meta_cmp(const sbp_msg_group_meta_t *a, + const sbp_msg_group_meta_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_group_meta_t &lhs, const sbp_msg_group_meta_t &rhs) { +static inline bool operator==(const sbp_msg_group_meta_t &lhs, + const sbp_msg_group_meta_t &rhs) { return sbp_msg_group_meta_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_group_meta_t &lhs, const sbp_msg_group_meta_t &rhs) { +static inline bool operator!=(const sbp_msg_group_meta_t &lhs, + const sbp_msg_group_meta_t &rhs) { return sbp_msg_group_meta_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_group_meta_t &lhs, const sbp_msg_group_meta_t &rhs) { +static inline bool operator<(const sbp_msg_group_meta_t &lhs, + const sbp_msg_group_meta_t &rhs) { return sbp_msg_group_meta_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_group_meta_t &lhs, const sbp_msg_group_meta_t &rhs) { +static inline bool operator<=(const sbp_msg_group_meta_t &lhs, + const sbp_msg_group_meta_t &rhs) { return sbp_msg_group_meta_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_group_meta_t &lhs, const sbp_msg_group_meta_t &rhs) { +static inline bool operator>(const sbp_msg_group_meta_t &lhs, + const sbp_msg_group_meta_t &rhs) { return sbp_msg_group_meta_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_group_meta_t &lhs, const sbp_msg_group_meta_t &rhs) { +static inline bool operator>=(const sbp_msg_group_meta_t &lhs, + const sbp_msg_group_meta_t &rhs) { return sbp_msg_group_meta_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SYSTEM_MSG_GROUP_META_H */ - diff --git a/c/include/libsbp/system/MSG_HEARTBEAT.h b/c/include/libsbp/system/MSG_HEARTBEAT.h index 56ed915ac..d07a27927 100644 --- a/c/include/libsbp/system/MSG_HEARTBEAT.h +++ b/c/include/libsbp/system/MSG_HEARTBEAT.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SYSTEM_MSG_HEARTBEAT_H #define LIBSBP_SYSTEM_MSG_HEARTBEAT_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,28 +40,28 @@ *****************************************************************************/ /** System heartbeat message * - * The heartbeat message is sent periodically to inform the host or other attached devices that the system is running. It is used to monitor system malfunctions. It also contains status flags that indicate to the host the status of the system and whether it is operating correctly. Currently, the expected heartbeat interval is 1 sec. - * + * The heartbeat message is sent periodically to inform the host or other + * attached devices that the system is running. It is used to monitor system + * malfunctions. It also contains status flags that indicate to the host the + * status of the system and whether it is operating correctly. Currently, the + * expected heartbeat interval is 1 sec. + * */ typedef struct { - - /** -* Status flags + * Status flags */ u32 flags; } sbp_msg_heartbeat_t; - - /** * Get encoded size of an instance of sbp_msg_heartbeat_t * * @param msg sbp_msg_heartbeat_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_heartbeat_encoded_len(const sbp_msg_heartbeat_t *msg) -{ +static inline size_t sbp_msg_heartbeat_encoded_len( + const sbp_msg_heartbeat_t *msg) { (void)msg; return SBP_MSG_HEARTBEAT_ENCODED_LEN; } @@ -69,36 +69,53 @@ static inline size_t sbp_msg_heartbeat_encoded_len(const sbp_msg_heartbeat_t *ms /** * Encode an instance of sbp_msg_heartbeat_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_heartbeat_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_heartbeat_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_heartbeat_t *msg); +SBP_EXPORT s8 sbp_msg_heartbeat_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_heartbeat_t *msg); /** * Decode an instance of sbp_msg_heartbeat_t from wire representation * - * This function decodes the wire representation of a sbp_msg_heartbeat_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_heartbeat_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_heartbeat_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_heartbeat_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_heartbeat_t *msg); +SBP_EXPORT s8 sbp_msg_heartbeat_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_heartbeat_t *msg); /** * Send an instance of sbp_msg_heartbeat_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_heartbeat_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_heartbeat_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -106,51 +123,61 @@ SBP_EXPORT s8 sbp_msg_heartbeat_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_heartbeat_send(sbp_state_t *s, u16 sender_id, const sbp_msg_heartbeat_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_heartbeat_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_heartbeat_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_heartbeat_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_heartbeat_t instance * @param b sbp_msg_heartbeat_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_heartbeat_cmp(const sbp_msg_heartbeat_t *a, const sbp_msg_heartbeat_t *b); +SBP_EXPORT int sbp_msg_heartbeat_cmp(const sbp_msg_heartbeat_t *a, + const sbp_msg_heartbeat_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_heartbeat_t &lhs, const sbp_msg_heartbeat_t &rhs) { +static inline bool operator==(const sbp_msg_heartbeat_t &lhs, + const sbp_msg_heartbeat_t &rhs) { return sbp_msg_heartbeat_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_heartbeat_t &lhs, const sbp_msg_heartbeat_t &rhs) { +static inline bool operator!=(const sbp_msg_heartbeat_t &lhs, + const sbp_msg_heartbeat_t &rhs) { return sbp_msg_heartbeat_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_heartbeat_t &lhs, const sbp_msg_heartbeat_t &rhs) { +static inline bool operator<(const sbp_msg_heartbeat_t &lhs, + const sbp_msg_heartbeat_t &rhs) { return sbp_msg_heartbeat_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_heartbeat_t &lhs, const sbp_msg_heartbeat_t &rhs) { +static inline bool operator<=(const sbp_msg_heartbeat_t &lhs, + const sbp_msg_heartbeat_t &rhs) { return sbp_msg_heartbeat_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_heartbeat_t &lhs, const sbp_msg_heartbeat_t &rhs) { +static inline bool operator>(const sbp_msg_heartbeat_t &lhs, + const sbp_msg_heartbeat_t &rhs) { return sbp_msg_heartbeat_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_heartbeat_t &lhs, const sbp_msg_heartbeat_t &rhs) { +static inline bool operator>=(const sbp_msg_heartbeat_t &lhs, + const sbp_msg_heartbeat_t &rhs) { return sbp_msg_heartbeat_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SYSTEM_MSG_HEARTBEAT_H */ - diff --git a/c/include/libsbp/system/MSG_INS_STATUS.h b/c/include/libsbp/system/MSG_INS_STATUS.h index ee36b4f59..f868aa200 100644 --- a/c/include/libsbp/system/MSG_INS_STATUS.h +++ b/c/include/libsbp/system/MSG_INS_STATUS.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SYSTEM_MSG_INS_STATUS_H #define LIBSBP_SYSTEM_MSG_INS_STATUS_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,27 +40,24 @@ *****************************************************************************/ /** Inertial Navigation System status message * -* The INS status message describes the state of the operation and initialization of the inertial navigation system. + * The INS status message describes the state of the operation and + * initialization of the inertial navigation system. */ typedef struct { - - /** -* Status flags + * Status flags */ u32 flags; } sbp_msg_ins_status_t; - - /** * Get encoded size of an instance of sbp_msg_ins_status_t * * @param msg sbp_msg_ins_status_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ins_status_encoded_len(const sbp_msg_ins_status_t *msg) -{ +static inline size_t sbp_msg_ins_status_encoded_len( + const sbp_msg_ins_status_t *msg) { (void)msg; return SBP_MSG_INS_STATUS_ENCODED_LEN; } @@ -68,36 +65,53 @@ static inline size_t sbp_msg_ins_status_encoded_len(const sbp_msg_ins_status_t * /** * Encode an instance of sbp_msg_ins_status_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ins_status_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ins_status_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ins_status_t *msg); +SBP_EXPORT s8 sbp_msg_ins_status_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_ins_status_t *msg); /** * Decode an instance of sbp_msg_ins_status_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ins_status_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ins_status_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ins_status_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ins_status_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ins_status_t *msg); +SBP_EXPORT s8 sbp_msg_ins_status_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ins_status_t *msg); /** * Send an instance of sbp_msg_ins_status_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ins_status_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ins_status_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -105,51 +119,61 @@ SBP_EXPORT s8 sbp_msg_ins_status_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ins_status_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ins_status_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ins_status_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ins_status_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ins_status_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ins_status_t instance * @param b sbp_msg_ins_status_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ins_status_cmp(const sbp_msg_ins_status_t *a, const sbp_msg_ins_status_t *b); +SBP_EXPORT int sbp_msg_ins_status_cmp(const sbp_msg_ins_status_t *a, + const sbp_msg_ins_status_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ins_status_t &lhs, const sbp_msg_ins_status_t &rhs) { +static inline bool operator==(const sbp_msg_ins_status_t &lhs, + const sbp_msg_ins_status_t &rhs) { return sbp_msg_ins_status_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ins_status_t &lhs, const sbp_msg_ins_status_t &rhs) { +static inline bool operator!=(const sbp_msg_ins_status_t &lhs, + const sbp_msg_ins_status_t &rhs) { return sbp_msg_ins_status_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ins_status_t &lhs, const sbp_msg_ins_status_t &rhs) { +static inline bool operator<(const sbp_msg_ins_status_t &lhs, + const sbp_msg_ins_status_t &rhs) { return sbp_msg_ins_status_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ins_status_t &lhs, const sbp_msg_ins_status_t &rhs) { +static inline bool operator<=(const sbp_msg_ins_status_t &lhs, + const sbp_msg_ins_status_t &rhs) { return sbp_msg_ins_status_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ins_status_t &lhs, const sbp_msg_ins_status_t &rhs) { +static inline bool operator>(const sbp_msg_ins_status_t &lhs, + const sbp_msg_ins_status_t &rhs) { return sbp_msg_ins_status_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ins_status_t &lhs, const sbp_msg_ins_status_t &rhs) { +static inline bool operator>=(const sbp_msg_ins_status_t &lhs, + const sbp_msg_ins_status_t &rhs) { return sbp_msg_ins_status_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SYSTEM_MSG_INS_STATUS_H */ - diff --git a/c/include/libsbp/system/MSG_INS_UPDATES.h b/c/include/libsbp/system/MSG_INS_UPDATES.h index 36165de77..87b9b7d20 100644 --- a/c/include/libsbp/system/MSG_INS_UPDATES.h +++ b/c/include/libsbp/system/MSG_INS_UPDATES.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SYSTEM_MSG_INS_UPDATES_H #define LIBSBP_SYSTEM_MSG_INS_UPDATES_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,63 +40,55 @@ *****************************************************************************/ /** Inertial Navigation System update status message * -* The INS update status message contains information about executed and rejected INS updates. This message is expected to be extended in the future as new types of measurements are being added. + * The INS update status message contains information about executed and + * rejected INS updates. This message is expected to be extended in the future + * as new types of measurements are being added. */ typedef struct { - - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** -* GNSS position update status flags + * GNSS position update status flags */ u8 gnsspos; - /** -* GNSS velocity update status flags + * GNSS velocity update status flags */ u8 gnssvel; - /** -* Wheelticks update status flags + * Wheelticks update status flags */ u8 wheelticks; - /** -* Wheelticks update status flags + * Wheelticks update status flags */ u8 speed; - /** -* NHC update status flags + * NHC update status flags */ u8 nhc; - /** -* Zero velocity update status flags + * Zero velocity update status flags */ u8 zerovel; } sbp_msg_ins_updates_t; - - /** * Get encoded size of an instance of sbp_msg_ins_updates_t * * @param msg sbp_msg_ins_updates_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ins_updates_encoded_len(const sbp_msg_ins_updates_t *msg) -{ +static inline size_t sbp_msg_ins_updates_encoded_len( + const sbp_msg_ins_updates_t *msg) { (void)msg; return SBP_MSG_INS_UPDATES_ENCODED_LEN; } @@ -104,36 +96,53 @@ static inline size_t sbp_msg_ins_updates_encoded_len(const sbp_msg_ins_updates_t /** * Encode an instance of sbp_msg_ins_updates_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_ins_updates_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ins_updates_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ins_updates_t *msg); +SBP_EXPORT s8 sbp_msg_ins_updates_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_ins_updates_t *msg); /** * Decode an instance of sbp_msg_ins_updates_t from wire representation * - * This function decodes the wire representation of a sbp_msg_ins_updates_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_ins_updates_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_ins_updates_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ins_updates_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ins_updates_t *msg); +SBP_EXPORT s8 sbp_msg_ins_updates_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ins_updates_t *msg); /** * Send an instance of sbp_msg_ins_updates_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_ins_updates_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ins_updates_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -141,51 +150,61 @@ SBP_EXPORT s8 sbp_msg_ins_updates_decode(const uint8_t *buf, uint8_t len, uint8_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ins_updates_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ins_updates_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_ins_updates_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ins_updates_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_ins_updates_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_ins_updates_t instance * @param b sbp_msg_ins_updates_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ins_updates_cmp(const sbp_msg_ins_updates_t *a, const sbp_msg_ins_updates_t *b); +SBP_EXPORT int sbp_msg_ins_updates_cmp(const sbp_msg_ins_updates_t *a, + const sbp_msg_ins_updates_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_ins_updates_t &lhs, const sbp_msg_ins_updates_t &rhs) { +static inline bool operator==(const sbp_msg_ins_updates_t &lhs, + const sbp_msg_ins_updates_t &rhs) { return sbp_msg_ins_updates_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ins_updates_t &lhs, const sbp_msg_ins_updates_t &rhs) { +static inline bool operator!=(const sbp_msg_ins_updates_t &lhs, + const sbp_msg_ins_updates_t &rhs) { return sbp_msg_ins_updates_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ins_updates_t &lhs, const sbp_msg_ins_updates_t &rhs) { +static inline bool operator<(const sbp_msg_ins_updates_t &lhs, + const sbp_msg_ins_updates_t &rhs) { return sbp_msg_ins_updates_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ins_updates_t &lhs, const sbp_msg_ins_updates_t &rhs) { +static inline bool operator<=(const sbp_msg_ins_updates_t &lhs, + const sbp_msg_ins_updates_t &rhs) { return sbp_msg_ins_updates_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ins_updates_t &lhs, const sbp_msg_ins_updates_t &rhs) { +static inline bool operator>(const sbp_msg_ins_updates_t &lhs, + const sbp_msg_ins_updates_t &rhs) { return sbp_msg_ins_updates_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ins_updates_t &lhs, const sbp_msg_ins_updates_t &rhs) { +static inline bool operator>=(const sbp_msg_ins_updates_t &lhs, + const sbp_msg_ins_updates_t &rhs) { return sbp_msg_ins_updates_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SYSTEM_MSG_INS_UPDATES_H */ - diff --git a/c/include/libsbp/system/MSG_PPS_TIME.h b/c/include/libsbp/system/MSG_PPS_TIME.h index 7317b7393..17b7135e2 100644 --- a/c/include/libsbp/system/MSG_PPS_TIME.h +++ b/c/include/libsbp/system/MSG_PPS_TIME.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SYSTEM_MSG_PPS_TIME_H #define LIBSBP_SYSTEM_MSG_PPS_TIME_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,34 +40,32 @@ *****************************************************************************/ /** Local time at detection of PPS pulse * - * The PPS time message contains the value of the sender's local time in microseconds at the moment a pulse is detected on the PPS input. This is to be used for syncronisation of sensor data sampled with a local timestamp (e.g. IMU or wheeltick messages) where GNSS time is unknown to the sender. - * + * The PPS time message contains the value of the sender's local time in + * microseconds at the moment a pulse is detected on the PPS input. This is to + * be used for syncronisation of sensor data sampled with a local timestamp + * (e.g. IMU or wheeltick messages) where GNSS time is unknown to the sender. + * */ typedef struct { - - /** -* Local time in microseconds [microseconds] + * Local time in microseconds [microseconds] */ u64 time; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_pps_time_t; - - /** * Get encoded size of an instance of sbp_msg_pps_time_t * * @param msg sbp_msg_pps_time_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_pps_time_encoded_len(const sbp_msg_pps_time_t *msg) -{ +static inline size_t sbp_msg_pps_time_encoded_len( + const sbp_msg_pps_time_t *msg) { (void)msg; return SBP_MSG_PPS_TIME_ENCODED_LEN; } @@ -75,36 +73,52 @@ static inline size_t sbp_msg_pps_time_encoded_len(const sbp_msg_pps_time_t *msg) /** * Encode an instance of sbp_msg_pps_time_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_pps_time_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pps_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pps_time_t *msg); +SBP_EXPORT s8 sbp_msg_pps_time_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_pps_time_t *msg); /** * Decode an instance of sbp_msg_pps_time_t from wire representation * - * This function decodes the wire representation of a sbp_msg_pps_time_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_pps_time_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_pps_time_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pps_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pps_time_t *msg); +SBP_EXPORT s8 sbp_msg_pps_time_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_pps_time_t *msg); /** * Send an instance of sbp_msg_pps_time_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_pps_time_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_pps_time_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -112,51 +126,61 @@ SBP_EXPORT s8 sbp_msg_pps_time_decode(const uint8_t *buf, uint8_t len, uint8_t * * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_pps_time_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pps_time_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_pps_time_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pps_time_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_pps_time_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_pps_time_t instance * @param b sbp_msg_pps_time_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_pps_time_cmp(const sbp_msg_pps_time_t *a, const sbp_msg_pps_time_t *b); +SBP_EXPORT int sbp_msg_pps_time_cmp(const sbp_msg_pps_time_t *a, + const sbp_msg_pps_time_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_pps_time_t &lhs, const sbp_msg_pps_time_t &rhs) { +static inline bool operator==(const sbp_msg_pps_time_t &lhs, + const sbp_msg_pps_time_t &rhs) { return sbp_msg_pps_time_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_pps_time_t &lhs, const sbp_msg_pps_time_t &rhs) { +static inline bool operator!=(const sbp_msg_pps_time_t &lhs, + const sbp_msg_pps_time_t &rhs) { return sbp_msg_pps_time_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_pps_time_t &lhs, const sbp_msg_pps_time_t &rhs) { +static inline bool operator<(const sbp_msg_pps_time_t &lhs, + const sbp_msg_pps_time_t &rhs) { return sbp_msg_pps_time_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_pps_time_t &lhs, const sbp_msg_pps_time_t &rhs) { +static inline bool operator<=(const sbp_msg_pps_time_t &lhs, + const sbp_msg_pps_time_t &rhs) { return sbp_msg_pps_time_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_pps_time_t &lhs, const sbp_msg_pps_time_t &rhs) { +static inline bool operator>(const sbp_msg_pps_time_t &lhs, + const sbp_msg_pps_time_t &rhs) { return sbp_msg_pps_time_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_pps_time_t &lhs, const sbp_msg_pps_time_t &rhs) { +static inline bool operator>=(const sbp_msg_pps_time_t &lhs, + const sbp_msg_pps_time_t &rhs) { return sbp_msg_pps_time_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SYSTEM_MSG_PPS_TIME_H */ - diff --git a/c/include/libsbp/system/MSG_SENSOR_AID_EVENT.h b/c/include/libsbp/system/MSG_SENSOR_AID_EVENT.h index 75e081a17..523503917 100644 --- a/c/include/libsbp/system/MSG_SENSOR_AID_EVENT.h +++ b/c/include/libsbp/system/MSG_SENSOR_AID_EVENT.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SYSTEM_MSG_SENSOR_AID_EVENT_H #define LIBSBP_SYSTEM_MSG_SENSOR_AID_EVENT_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,69 +40,61 @@ *****************************************************************************/ /** Sensor state and update status data * -* This diagnostic message contains state and update status information for all sensors that are being used by the fusion engine. This message will be generated asynchronously to the solution messages and will be emitted anytime a sensor update is being processed. + * This diagnostic message contains state and update status information for all + * sensors that are being used by the fusion engine. This message will be + * generated asynchronously to the solution messages and will be emitted anytime + * a sensor update is being processed. */ typedef struct { - - /** -* Update timestamp in milliseconds. [milliseconds] + * Update timestamp in milliseconds. [milliseconds] */ u32 time; - /** -* Sensor type + * Sensor type */ u8 sensor_type; - /** -* Sensor identifier + * Sensor identifier */ u16 sensor_id; - /** -* Reserved for future use + * Reserved for future use */ u8 sensor_state; - /** -* Number of available measurements in this epoch + * Number of available measurements in this epoch */ u8 n_available_meas; - /** -* Number of attempted measurements in this epoch + * Number of attempted measurements in this epoch */ u8 n_attempted_meas; - /** -* Number of accepted measurements in this epoch + * Number of accepted measurements in this epoch */ u8 n_accepted_meas; - /** -* Reserved for future use + * Reserved for future use */ u32 flags; } sbp_msg_sensor_aid_event_t; - - /** * Get encoded size of an instance of sbp_msg_sensor_aid_event_t * * @param msg sbp_msg_sensor_aid_event_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_sensor_aid_event_encoded_len(const sbp_msg_sensor_aid_event_t *msg) -{ +static inline size_t sbp_msg_sensor_aid_event_encoded_len( + const sbp_msg_sensor_aid_event_t *msg) { (void)msg; return SBP_MSG_SENSOR_AID_EVENT_ENCODED_LEN; } @@ -110,36 +102,53 @@ static inline size_t sbp_msg_sensor_aid_event_encoded_len(const sbp_msg_sensor_a /** * Encode an instance of sbp_msg_sensor_aid_event_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_sensor_aid_event_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_sensor_aid_event_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_sensor_aid_event_t *msg); +SBP_EXPORT s8 +sbp_msg_sensor_aid_event_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_sensor_aid_event_t *msg); /** * Decode an instance of sbp_msg_sensor_aid_event_t from wire representation * - * This function decodes the wire representation of a sbp_msg_sensor_aid_event_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_sensor_aid_event_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_sensor_aid_event_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_sensor_aid_event_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_sensor_aid_event_t *msg); +SBP_EXPORT s8 sbp_msg_sensor_aid_event_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_sensor_aid_event_t *msg); /** * Send an instance of sbp_msg_sensor_aid_event_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_sensor_aid_event_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_sensor_aid_event_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -147,51 +156,61 @@ SBP_EXPORT s8 sbp_msg_sensor_aid_event_decode(const uint8_t *buf, uint8_t len, u * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_sensor_aid_event_send(sbp_state_t *s, u16 sender_id, const sbp_msg_sensor_aid_event_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_sensor_aid_event_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_sensor_aid_event_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_sensor_aid_event_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_sensor_aid_event_t instance * @param b sbp_msg_sensor_aid_event_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_sensor_aid_event_cmp(const sbp_msg_sensor_aid_event_t *a, const sbp_msg_sensor_aid_event_t *b); +SBP_EXPORT int sbp_msg_sensor_aid_event_cmp( + const sbp_msg_sensor_aid_event_t *a, const sbp_msg_sensor_aid_event_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_sensor_aid_event_t &lhs, const sbp_msg_sensor_aid_event_t &rhs) { +static inline bool operator==(const sbp_msg_sensor_aid_event_t &lhs, + const sbp_msg_sensor_aid_event_t &rhs) { return sbp_msg_sensor_aid_event_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_sensor_aid_event_t &lhs, const sbp_msg_sensor_aid_event_t &rhs) { +static inline bool operator!=(const sbp_msg_sensor_aid_event_t &lhs, + const sbp_msg_sensor_aid_event_t &rhs) { return sbp_msg_sensor_aid_event_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_sensor_aid_event_t &lhs, const sbp_msg_sensor_aid_event_t &rhs) { +static inline bool operator<(const sbp_msg_sensor_aid_event_t &lhs, + const sbp_msg_sensor_aid_event_t &rhs) { return sbp_msg_sensor_aid_event_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_sensor_aid_event_t &lhs, const sbp_msg_sensor_aid_event_t &rhs) { +static inline bool operator<=(const sbp_msg_sensor_aid_event_t &lhs, + const sbp_msg_sensor_aid_event_t &rhs) { return sbp_msg_sensor_aid_event_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_sensor_aid_event_t &lhs, const sbp_msg_sensor_aid_event_t &rhs) { +static inline bool operator>(const sbp_msg_sensor_aid_event_t &lhs, + const sbp_msg_sensor_aid_event_t &rhs) { return sbp_msg_sensor_aid_event_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_sensor_aid_event_t &lhs, const sbp_msg_sensor_aid_event_t &rhs) { +static inline bool operator>=(const sbp_msg_sensor_aid_event_t &lhs, + const sbp_msg_sensor_aid_event_t &rhs) { return sbp_msg_sensor_aid_event_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SYSTEM_MSG_SENSOR_AID_EVENT_H */ - diff --git a/c/include/libsbp/system/MSG_STARTUP.h b/c/include/libsbp/system/MSG_STARTUP.h index 8f603bb15..cd449d64a 100644 --- a/c/include/libsbp/system/MSG_STARTUP.h +++ b/c/include/libsbp/system/MSG_STARTUP.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SYSTEM_MSG_STARTUP_H #define LIBSBP_SYSTEM_MSG_STARTUP_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,39 +40,34 @@ *****************************************************************************/ /** System start-up message * -* The system start-up message is sent once on system start-up. It notifies the host or other attached devices that the system has started and is now ready to respond to commands or configuration requests. + * The system start-up message is sent once on system start-up. It notifies the + * host or other attached devices that the system has started and is now ready + * to respond to commands or configuration requests. */ typedef struct { - - /** -* Cause of startup + * Cause of startup */ u8 cause; - /** -* Startup type + * Startup type */ u8 startup_type; - /** -* Reserved + * Reserved */ u16 reserved; } sbp_msg_startup_t; - - /** * Get encoded size of an instance of sbp_msg_startup_t * * @param msg sbp_msg_startup_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_startup_encoded_len(const sbp_msg_startup_t *msg) -{ +static inline size_t sbp_msg_startup_encoded_len(const sbp_msg_startup_t *msg) { (void)msg; return SBP_MSG_STARTUP_ENCODED_LEN; } @@ -80,36 +75,52 @@ static inline size_t sbp_msg_startup_encoded_len(const sbp_msg_startup_t *msg) /** * Encode an instance of sbp_msg_startup_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_startup_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_startup_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_startup_t *msg); +SBP_EXPORT s8 sbp_msg_startup_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_startup_t *msg); /** * Decode an instance of sbp_msg_startup_t from wire representation * - * This function decodes the wire representation of a sbp_msg_startup_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_startup_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_startup_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_startup_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_startup_t *msg); +SBP_EXPORT s8 sbp_msg_startup_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_startup_t *msg); /** * Send an instance of sbp_msg_startup_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_startup_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_startup_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -117,51 +128,61 @@ SBP_EXPORT s8 sbp_msg_startup_decode(const uint8_t *buf, uint8_t len, uint8_t *n * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_startup_send(sbp_state_t *s, u16 sender_id, const sbp_msg_startup_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_startup_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_startup_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_startup_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_startup_t instance * @param b sbp_msg_startup_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_startup_cmp(const sbp_msg_startup_t *a, const sbp_msg_startup_t *b); +SBP_EXPORT int sbp_msg_startup_cmp(const sbp_msg_startup_t *a, + const sbp_msg_startup_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_startup_t &lhs, const sbp_msg_startup_t &rhs) { +static inline bool operator==(const sbp_msg_startup_t &lhs, + const sbp_msg_startup_t &rhs) { return sbp_msg_startup_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_startup_t &lhs, const sbp_msg_startup_t &rhs) { +static inline bool operator!=(const sbp_msg_startup_t &lhs, + const sbp_msg_startup_t &rhs) { return sbp_msg_startup_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_startup_t &lhs, const sbp_msg_startup_t &rhs) { +static inline bool operator<(const sbp_msg_startup_t &lhs, + const sbp_msg_startup_t &rhs) { return sbp_msg_startup_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_startup_t &lhs, const sbp_msg_startup_t &rhs) { +static inline bool operator<=(const sbp_msg_startup_t &lhs, + const sbp_msg_startup_t &rhs) { return sbp_msg_startup_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_startup_t &lhs, const sbp_msg_startup_t &rhs) { +static inline bool operator>(const sbp_msg_startup_t &lhs, + const sbp_msg_startup_t &rhs) { return sbp_msg_startup_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_startup_t &lhs, const sbp_msg_startup_t &rhs) { +static inline bool operator>=(const sbp_msg_startup_t &lhs, + const sbp_msg_startup_t &rhs) { return sbp_msg_startup_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SYSTEM_MSG_STARTUP_H */ - diff --git a/c/include/libsbp/system/MSG_STATUS_JOURNAL.h b/c/include/libsbp/system/MSG_STATUS_JOURNAL.h index add4ac65e..4124c45d7 100644 --- a/c/include/libsbp/system/MSG_STATUS_JOURNAL.h +++ b/c/include/libsbp/system/MSG_STATUS_JOURNAL.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SYSTEM_MSG_STATUS_JOURNAL_H #define LIBSBP_SYSTEM_MSG_STATUS_JOURNAL_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,97 +41,112 @@ *****************************************************************************/ /** Status report journal * -* The status journal message contains past status reports (see MSG_STATUS_REPORT) and functions as a error/event storage for telemetry purposes. + * The status journal message contains past status reports (see + * MSG_STATUS_REPORT) and functions as a error/event storage for telemetry + * purposes. */ typedef struct { - - /** -* Identity of reporting system + * Identity of reporting system */ u16 reporting_system; - /** -* SBP protocol version + * SBP protocol version */ u16 sbp_version; - /** -* Total number of status reports sent since system startup + * Total number of status reports sent since system startup */ u32 total_status_reports; - /** - * Index and number of messages in this sequence. First nibble is the size of the sequence (n), second nibble is the zero-indexed counter (ith packet of n) + * Index and number of messages in this sequence. First nibble is the size of + * the sequence (n), second nibble is the zero-indexed counter (ith packet of + * n) */ u8 sequence_descriptor; - /** -* Status journal + * Status journal */ sbp_status_journal_item_t journal[SBP_MSG_STATUS_JOURNAL_JOURNAL_MAX]; /** * Number of elements in journal * - * When sending a message fill in this field with the number elements set in journal before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * journal before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in journal. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * journal. The value of any elements beyond the index specified in this field + * is undefined */ u8 n_journal; } sbp_msg_status_journal_t; - - /** * Get encoded size of an instance of sbp_msg_status_journal_t * * @param msg sbp_msg_status_journal_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_status_journal_encoded_len(const sbp_msg_status_journal_t *msg) -{ - return SBP_MSG_STATUS_JOURNAL_ENCODED_OVERHEAD - + (msg->n_journal * SBP_STATUS_JOURNAL_ITEM_ENCODED_LEN) - ; +static inline size_t sbp_msg_status_journal_encoded_len( + const sbp_msg_status_journal_t *msg) { + return SBP_MSG_STATUS_JOURNAL_ENCODED_OVERHEAD + + (msg->n_journal * SBP_STATUS_JOURNAL_ITEM_ENCODED_LEN); } /** * Encode an instance of sbp_msg_status_journal_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_status_journal_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_status_journal_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_status_journal_t *msg); +SBP_EXPORT s8 +sbp_msg_status_journal_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_status_journal_t *msg); /** * Decode an instance of sbp_msg_status_journal_t from wire representation * - * This function decodes the wire representation of a sbp_msg_status_journal_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_status_journal_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_status_journal_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_status_journal_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_status_journal_t *msg); +SBP_EXPORT s8 sbp_msg_status_journal_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_status_journal_t *msg); /** * Send an instance of sbp_msg_status_journal_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_status_journal_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_status_journal_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -139,51 +154,61 @@ SBP_EXPORT s8 sbp_msg_status_journal_decode(const uint8_t *buf, uint8_t len, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_status_journal_send(sbp_state_t *s, u16 sender_id, const sbp_msg_status_journal_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_status_journal_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_status_journal_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_status_journal_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_status_journal_t instance * @param b sbp_msg_status_journal_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_status_journal_cmp(const sbp_msg_status_journal_t *a, const sbp_msg_status_journal_t *b); +SBP_EXPORT int sbp_msg_status_journal_cmp(const sbp_msg_status_journal_t *a, + const sbp_msg_status_journal_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_status_journal_t &lhs, const sbp_msg_status_journal_t &rhs) { +static inline bool operator==(const sbp_msg_status_journal_t &lhs, + const sbp_msg_status_journal_t &rhs) { return sbp_msg_status_journal_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_status_journal_t &lhs, const sbp_msg_status_journal_t &rhs) { +static inline bool operator!=(const sbp_msg_status_journal_t &lhs, + const sbp_msg_status_journal_t &rhs) { return sbp_msg_status_journal_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_status_journal_t &lhs, const sbp_msg_status_journal_t &rhs) { +static inline bool operator<(const sbp_msg_status_journal_t &lhs, + const sbp_msg_status_journal_t &rhs) { return sbp_msg_status_journal_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_status_journal_t &lhs, const sbp_msg_status_journal_t &rhs) { +static inline bool operator<=(const sbp_msg_status_journal_t &lhs, + const sbp_msg_status_journal_t &rhs) { return sbp_msg_status_journal_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_status_journal_t &lhs, const sbp_msg_status_journal_t &rhs) { +static inline bool operator>(const sbp_msg_status_journal_t &lhs, + const sbp_msg_status_journal_t &rhs) { return sbp_msg_status_journal_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_status_journal_t &lhs, const sbp_msg_status_journal_t &rhs) { +static inline bool operator>=(const sbp_msg_status_journal_t &lhs, + const sbp_msg_status_journal_t &rhs) { return sbp_msg_status_journal_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SYSTEM_MSG_STATUS_JOURNAL_H */ - diff --git a/c/include/libsbp/system/MSG_STATUS_REPORT.h b/c/include/libsbp/system/MSG_STATUS_REPORT.h index 778814b34..d9e34263d 100644 --- a/c/include/libsbp/system/MSG_STATUS_REPORT.h +++ b/c/include/libsbp/system/MSG_STATUS_REPORT.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SYSTEM_MSG_STATUS_REPORT_H #define LIBSBP_SYSTEM_MSG_STATUS_REPORT_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,98 +41,112 @@ *****************************************************************************/ /** Status report message * - * The status report is sent periodically to inform the host or other attached devices that the system is running. It is used to monitor system malfunctions. It contains status reports that indicate to the host the status of each subsystem and whether it is operating correctly. - * + * The status report is sent periodically to inform the host or other attached + * devices that the system is running. It is used to monitor system + * malfunctions. It contains status reports that indicate to the host the status + * of each subsystem and whether it is operating correctly. + * */ typedef struct { - - /** -* Identity of reporting system + * Identity of reporting system */ u16 reporting_system; - /** -* SBP protocol version + * SBP protocol version */ u16 sbp_version; - /** -* Increments on each status report sent + * Increments on each status report sent */ u32 sequence; - /** -* Number of seconds since system start-up + * Number of seconds since system start-up */ u32 uptime; - /** -* Reported status of individual subsystems + * Reported status of individual subsystems */ sbp_sub_system_report_t status[SBP_MSG_STATUS_REPORT_STATUS_MAX]; /** * Number of elements in status * - * When sending a message fill in this field with the number elements set in status before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * status before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in status. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * status. The value of any elements beyond the index specified in this field + * is undefined */ u8 n_status; } sbp_msg_status_report_t; - - /** * Get encoded size of an instance of sbp_msg_status_report_t * * @param msg sbp_msg_status_report_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_status_report_encoded_len(const sbp_msg_status_report_t *msg) -{ - return SBP_MSG_STATUS_REPORT_ENCODED_OVERHEAD - + (msg->n_status * SBP_SUB_SYSTEM_REPORT_ENCODED_LEN) - ; +static inline size_t sbp_msg_status_report_encoded_len( + const sbp_msg_status_report_t *msg) { + return SBP_MSG_STATUS_REPORT_ENCODED_OVERHEAD + + (msg->n_status * SBP_SUB_SYSTEM_REPORT_ENCODED_LEN); } /** * Encode an instance of sbp_msg_status_report_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_status_report_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_status_report_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_status_report_t *msg); +SBP_EXPORT s8 sbp_msg_status_report_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_status_report_t *msg); /** * Decode an instance of sbp_msg_status_report_t from wire representation * - * This function decodes the wire representation of a sbp_msg_status_report_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_status_report_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_status_report_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_status_report_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_status_report_t *msg); +SBP_EXPORT s8 sbp_msg_status_report_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_status_report_t *msg); /** * Send an instance of sbp_msg_status_report_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_status_report_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_status_report_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -140,51 +154,61 @@ SBP_EXPORT s8 sbp_msg_status_report_decode(const uint8_t *buf, uint8_t len, uint * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_status_report_send(sbp_state_t *s, u16 sender_id, const sbp_msg_status_report_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_status_report_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_status_report_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_status_report_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_status_report_t instance * @param b sbp_msg_status_report_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_status_report_cmp(const sbp_msg_status_report_t *a, const sbp_msg_status_report_t *b); +SBP_EXPORT int sbp_msg_status_report_cmp(const sbp_msg_status_report_t *a, + const sbp_msg_status_report_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_status_report_t &lhs, const sbp_msg_status_report_t &rhs) { +static inline bool operator==(const sbp_msg_status_report_t &lhs, + const sbp_msg_status_report_t &rhs) { return sbp_msg_status_report_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_status_report_t &lhs, const sbp_msg_status_report_t &rhs) { +static inline bool operator!=(const sbp_msg_status_report_t &lhs, + const sbp_msg_status_report_t &rhs) { return sbp_msg_status_report_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_status_report_t &lhs, const sbp_msg_status_report_t &rhs) { +static inline bool operator<(const sbp_msg_status_report_t &lhs, + const sbp_msg_status_report_t &rhs) { return sbp_msg_status_report_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_status_report_t &lhs, const sbp_msg_status_report_t &rhs) { +static inline bool operator<=(const sbp_msg_status_report_t &lhs, + const sbp_msg_status_report_t &rhs) { return sbp_msg_status_report_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_status_report_t &lhs, const sbp_msg_status_report_t &rhs) { +static inline bool operator>(const sbp_msg_status_report_t &lhs, + const sbp_msg_status_report_t &rhs) { return sbp_msg_status_report_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_status_report_t &lhs, const sbp_msg_status_report_t &rhs) { +static inline bool operator>=(const sbp_msg_status_report_t &lhs, + const sbp_msg_status_report_t &rhs) { return sbp_msg_status_report_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SYSTEM_MSG_STATUS_REPORT_H */ - diff --git a/c/include/libsbp/system/StatusJournalItem.h b/c/include/libsbp/system/StatusJournalItem.h index 3e035b196..1a2ebdf38 100644 --- a/c/include/libsbp/system/StatusJournalItem.h +++ b/c/include/libsbp/system/StatusJournalItem.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_SYSTEM_STATUSJOURNALITEM_H #define LIBSBP_SYSTEM_STATUSJOURNALITEM_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,30 +41,27 @@ *****************************************************************************/ /** Subsystem Status report * -* Reports the uptime and the state of a subsystem via generic and specific status codes. If the generic state is reported as initializing, the specific state should be ignored. + * Reports the uptime and the state of a subsystem via generic and specific + * status codes. If the generic state is reported as initializing, the specific + * state should be ignored. */ typedef struct { - - /** -* Milliseconds since system startup + * Milliseconds since system startup */ u32 uptime; - sbp_sub_system_report_t report; } sbp_status_journal_item_t; - - /** * Get encoded size of an instance of sbp_status_journal_item_t * * @param msg sbp_status_journal_item_t instance * @return Length of on-wire representation */ -static inline size_t sbp_status_journal_item_encoded_len(const sbp_status_journal_item_t *msg) -{ +static inline size_t sbp_status_journal_item_encoded_len( + const sbp_status_journal_item_t *msg) { (void)msg; return SBP_STATUS_JOURNAL_ITEM_ENCODED_LEN; } @@ -72,74 +69,96 @@ static inline size_t sbp_status_journal_item_encoded_len(const sbp_status_journa /** * Encode an instance of sbp_status_journal_item_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_status_journal_item_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_status_journal_item_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_status_journal_item_t *msg); +SBP_EXPORT s8 +sbp_status_journal_item_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_status_journal_item_t *msg); /** * Decode an instance of sbp_status_journal_item_t from wire representation * - * This function decodes the wire representation of a sbp_status_journal_item_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_status_journal_item_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_status_journal_item_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_status_journal_item_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_status_journal_item_t *msg); +SBP_EXPORT s8 sbp_status_journal_item_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_status_journal_item_t *msg); /** * Compare two instances of sbp_status_journal_item_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_status_journal_item_t instance * @param b sbp_status_journal_item_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_status_journal_item_cmp(const sbp_status_journal_item_t *a, const sbp_status_journal_item_t *b); +SBP_EXPORT int sbp_status_journal_item_cmp(const sbp_status_journal_item_t *a, + const sbp_status_journal_item_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_status_journal_item_t &lhs, const sbp_status_journal_item_t &rhs) { +static inline bool operator==(const sbp_status_journal_item_t &lhs, + const sbp_status_journal_item_t &rhs) { return sbp_status_journal_item_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_status_journal_item_t &lhs, const sbp_status_journal_item_t &rhs) { +static inline bool operator!=(const sbp_status_journal_item_t &lhs, + const sbp_status_journal_item_t &rhs) { return sbp_status_journal_item_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_status_journal_item_t &lhs, const sbp_status_journal_item_t &rhs) { +static inline bool operator<(const sbp_status_journal_item_t &lhs, + const sbp_status_journal_item_t &rhs) { return sbp_status_journal_item_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_status_journal_item_t &lhs, const sbp_status_journal_item_t &rhs) { +static inline bool operator<=(const sbp_status_journal_item_t &lhs, + const sbp_status_journal_item_t &rhs) { return sbp_status_journal_item_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_status_journal_item_t &lhs, const sbp_status_journal_item_t &rhs) { +static inline bool operator>(const sbp_status_journal_item_t &lhs, + const sbp_status_journal_item_t &rhs) { return sbp_status_journal_item_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_status_journal_item_t &lhs, const sbp_status_journal_item_t &rhs) { +static inline bool operator>=(const sbp_status_journal_item_t &lhs, + const sbp_status_journal_item_t &rhs) { return sbp_status_journal_item_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SYSTEM_STATUSJOURNALITEM_H */ - diff --git a/c/include/libsbp/system/SubSystemReport.h b/c/include/libsbp/system/SubSystemReport.h index 7ad7912db..c47573c5d 100644 --- a/c/include/libsbp/system/SubSystemReport.h +++ b/c/include/libsbp/system/SubSystemReport.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_SYSTEM_SUBSYSTEMREPORT_H #define LIBSBP_SYSTEM_SUBSYSTEMREPORT_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,39 +40,34 @@ *****************************************************************************/ /** Subsystem Status report * -* Report the general and specific state of a subsystem. If the generic state is reported as initializing, the specific state should be ignored. + * Report the general and specific state of a subsystem. If the generic state + * is reported as initializing, the specific state should be ignored. */ typedef struct { - - /** -* Identity of reporting subsystem + * Identity of reporting subsystem */ u16 component; - /** -* Generic form status report + * Generic form status report */ u8 generic; - /** -* Subsystem specific status code + * Subsystem specific status code */ u8 specific; } sbp_sub_system_report_t; - - /** * Get encoded size of an instance of sbp_sub_system_report_t * * @param msg sbp_sub_system_report_t instance * @return Length of on-wire representation */ -static inline size_t sbp_sub_system_report_encoded_len(const sbp_sub_system_report_t *msg) -{ +static inline size_t sbp_sub_system_report_encoded_len( + const sbp_sub_system_report_t *msg) { (void)msg; return SBP_SUB_SYSTEM_REPORT_ENCODED_LEN; } @@ -80,74 +75,96 @@ static inline size_t sbp_sub_system_report_encoded_len(const sbp_sub_system_repo /** * Encode an instance of sbp_sub_system_report_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_sub_system_report_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_sub_system_report_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_sub_system_report_t *msg); +SBP_EXPORT s8 sbp_sub_system_report_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_sub_system_report_t *msg); /** * Decode an instance of sbp_sub_system_report_t from wire representation * - * This function decodes the wire representation of a sbp_sub_system_report_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_sub_system_report_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_sub_system_report_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_sub_system_report_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_sub_system_report_t *msg); +SBP_EXPORT s8 sbp_sub_system_report_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_sub_system_report_t *msg); /** * Compare two instances of sbp_sub_system_report_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_sub_system_report_t instance * @param b sbp_sub_system_report_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_sub_system_report_cmp(const sbp_sub_system_report_t *a, const sbp_sub_system_report_t *b); +SBP_EXPORT int sbp_sub_system_report_cmp(const sbp_sub_system_report_t *a, + const sbp_sub_system_report_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_sub_system_report_t &lhs, const sbp_sub_system_report_t &rhs) { +static inline bool operator==(const sbp_sub_system_report_t &lhs, + const sbp_sub_system_report_t &rhs) { return sbp_sub_system_report_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_sub_system_report_t &lhs, const sbp_sub_system_report_t &rhs) { +static inline bool operator!=(const sbp_sub_system_report_t &lhs, + const sbp_sub_system_report_t &rhs) { return sbp_sub_system_report_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_sub_system_report_t &lhs, const sbp_sub_system_report_t &rhs) { +static inline bool operator<(const sbp_sub_system_report_t &lhs, + const sbp_sub_system_report_t &rhs) { return sbp_sub_system_report_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_sub_system_report_t &lhs, const sbp_sub_system_report_t &rhs) { +static inline bool operator<=(const sbp_sub_system_report_t &lhs, + const sbp_sub_system_report_t &rhs) { return sbp_sub_system_report_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_sub_system_report_t &lhs, const sbp_sub_system_report_t &rhs) { +static inline bool operator>(const sbp_sub_system_report_t &lhs, + const sbp_sub_system_report_t &rhs) { return sbp_sub_system_report_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_sub_system_report_t &lhs, const sbp_sub_system_report_t &rhs) { +static inline bool operator>=(const sbp_sub_system_report_t &lhs, + const sbp_sub_system_report_t &rhs) { return sbp_sub_system_report_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_SYSTEM_SUBSYSTEMREPORT_H */ - diff --git a/c/include/libsbp/system_macros.h b/c/include/libsbp/system_macros.h index 10191fa8d..780df5e61 100644 --- a/c/include/libsbp/system_macros.h +++ b/c/include/libsbp/system_macros.h @@ -18,18 +18,19 @@ #ifndef LIBSBP_SYSTEM_MACROS_H #define LIBSBP_SYSTEM_MACROS_H - #define SBP_MSG_STARTUP 0xFF00 #define SBP_STARTUP_CAUSE_OF_STARTUP_MASK (0xffu) #define SBP_STARTUP_CAUSE_OF_STARTUP_SHIFT (0u) -#define SBP_STARTUP_CAUSE_OF_STARTUP_GET(flags) \ - ((u8)((u8)((flags) >> SBP_STARTUP_CAUSE_OF_STARTUP_SHIFT) \ - & SBP_STARTUP_CAUSE_OF_STARTUP_MASK)) -#define SBP_STARTUP_CAUSE_OF_STARTUP_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_STARTUP_CAUSE_OF_STARTUP_MASK << SBP_STARTUP_CAUSE_OF_STARTUP_SHIFT))) | \ - (((val) & (SBP_STARTUP_CAUSE_OF_STARTUP_MASK)) \ - << (SBP_STARTUP_CAUSE_OF_STARTUP_SHIFT)));} while(0) - +#define SBP_STARTUP_CAUSE_OF_STARTUP_GET(flags) \ + ((u8)((u8)((flags) >> SBP_STARTUP_CAUSE_OF_STARTUP_SHIFT) & \ + SBP_STARTUP_CAUSE_OF_STARTUP_MASK)) +#define SBP_STARTUP_CAUSE_OF_STARTUP_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_STARTUP_CAUSE_OF_STARTUP_MASK \ + << SBP_STARTUP_CAUSE_OF_STARTUP_SHIFT))) | \ + (((val) & (SBP_STARTUP_CAUSE_OF_STARTUP_MASK)) \ + << (SBP_STARTUP_CAUSE_OF_STARTUP_SHIFT))); \ + } while (0) #define SBP_STARTUP_CAUSE_OF_STARTUP_POWER_ON (0) #define SBP_STARTUP_CAUSE_OF_STARTUP_SOFTWARE_RESET (1) @@ -37,13 +38,12 @@ #define SBP_STARTUP__MASK (0xffu) #define SBP_STARTUP__SHIFT (0u) #define SBP_STARTUP__GET(flags) \ - ((u8)((u8)((flags) >> SBP_STARTUP__SHIFT) \ - & SBP_STARTUP__MASK)) -#define SBP_STARTUP__SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_STARTUP__MASK << SBP_STARTUP__SHIFT))) | \ - (((val) & (SBP_STARTUP__MASK)) \ - << (SBP_STARTUP__SHIFT)));} while(0) - + ((u8)((u8)((flags) >> SBP_STARTUP__SHIFT) & SBP_STARTUP__MASK)) +#define SBP_STARTUP__SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_STARTUP__MASK << SBP_STARTUP__SHIFT))) | \ + (((val) & (SBP_STARTUP__MASK)) << (SBP_STARTUP__SHIFT))); \ + } while (0) #define SBP_STARTUP_COLD_START (0) #define SBP_STARTUP_WARM_START (1) @@ -51,154 +51,179 @@ #define SBP_STARTUP_HOT_START (2) #define SBP_STARTUP_HOT_START (2) /** - * Encoded length of sbp_msg_startup_t (V4 API) and + * Encoded length of sbp_msg_startup_t (V4 API) and * msg_startup_t (legacy API) */ #define SBP_MSG_STARTUP_ENCODED_LEN 4u - #define SBP_MSG_DGNSS_STATUS 0xFF02 #define SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_MASK (0xfu) #define SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_SHIFT (0u) -#define SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_SHIFT) \ - & SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_MASK)) -#define SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_MASK << SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_SHIFT))) | \ - (((val) & (SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_MASK)) \ - << (SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_SHIFT)));} while(0) - +#define SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_SHIFT) & \ + SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_MASK)) +#define SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_MASK \ + << SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_SHIFT))) | \ + (((val) & (SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_MASK)) \ + << (SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_SHIFT))); \ + } while (0) #define SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_INVALID (0) #define SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_CODE_DIFFERENCE (1) #define SBP_DGNSS_STATUS_DIFFERENTIAL_TYPE_RTK (2) /** - * The maximum number of items that can be stored in sbp_msg_dgnss_status_t::source (V4 API) or msg_dgnss_status_t::source (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_dgnss_status_t::source (V4 API) or msg_dgnss_status_t::source (legacy + * API) before the maximum SBP message size is exceeded */ #define SBP_MSG_DGNSS_STATUS_SOURCE_MAX 251u - /** - * Encoded length of sbp_msg_dgnss_status_t (V4 API) and + * Encoded length of sbp_msg_dgnss_status_t (V4 API) and * msg_dgnss_status_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_dgnss_status_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_dgnss_status_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_DGNSS_STATUS_ENCODED_OVERHEAD 4u - #define SBP_MSG_HEARTBEAT 0xFFFF #define SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_MASK (0x1u) #define SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_SHIFT (31u) -#define SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_GET(flags) \ - ((u32)((u32)((flags) >> SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_SHIFT) \ - & SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_MASK)) -#define SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_MASK << SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_SHIFT))) | \ - (((val) & (SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_MASK)) \ - << (SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_SHIFT)));} while(0) - +#define SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_GET(flags) \ + ((u32)((u32)((flags) >> SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_SHIFT) & \ + SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_MASK)) +#define SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_SET(flags, val) \ + do { \ + (flags) = \ + (u32)((flags & (~(SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_MASK \ + << SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_SHIFT))) | \ + (((val) & (SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_MASK)) \ + << (SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_SHIFT))); \ + } while (0) #define SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_NO_EXTERNAL_ANTENNA_DETECTED (0) #define SBP_HEARTBEAT_EXTERNAL_ANTENNA_PRESENT_EXTERNAL_ANTENNA_IS_PRESENT (1) #define SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_MASK (0x1u) #define SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_SHIFT (30u) -#define SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_GET(flags) \ - ((u32)((u32)((flags) >> SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_SHIFT) \ - & SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_MASK)) -#define SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_MASK << SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_SHIFT))) | \ - (((val) & (SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_MASK)) \ - << (SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_SHIFT)));} while(0) - +#define SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_GET(flags) \ + ((u32)((u32)((flags) >> SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_SHIFT) & \ + SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_MASK)) +#define SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_SET(flags, val) \ + do { \ + (flags) = \ + (u32)((flags & (~(SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_MASK \ + << SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_SHIFT))) | \ + (((val) & (SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_MASK)) \ + << (SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_SHIFT))); \ + } while (0) #define SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_NO_SHORT_DETECTED (0) #define SBP_HEARTBEAT_EXTERNAL_ANTENNA_SHORT_SHORT_DETECTED (1) #define SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK (0xffu) #define SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT (16u) -#define SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_GET(flags) \ - ((u32)((u32)((flags) >> SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT) \ - & SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) -#define SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK << SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ - (((val) & (SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) \ - << (SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT)));} while(0) - +#define SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_GET(flags) \ + ((u32)((u32)((flags) >> \ + SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT) & \ + SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) +#define SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK \ + << SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ + (((val) & (SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) \ + << (SBP_HEARTBEAT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT))); \ + } while (0) #define SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK (0xffu) #define SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT (8u) -#define SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_GET(flags) \ - ((u32)((u32)((flags) >> SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT) \ - & SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) -#define SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK << SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ - (((val) & (SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) \ - << (SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT)));} while(0) - +#define SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_GET(flags) \ + ((u32)((u32)((flags) >> \ + SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT) & \ + SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) +#define SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & \ + (~(SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK \ + << SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ + (((val) & (SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) \ + << (SBP_HEARTBEAT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT))); \ + } while (0) #define SBP_HEARTBEAT_SWIFTNAP_ERROR_MASK (0x1u) #define SBP_HEARTBEAT_SWIFTNAP_ERROR_SHIFT (2u) -#define SBP_HEARTBEAT_SWIFTNAP_ERROR_GET(flags) \ - ((u32)((u32)((flags) >> SBP_HEARTBEAT_SWIFTNAP_ERROR_SHIFT) \ - & SBP_HEARTBEAT_SWIFTNAP_ERROR_MASK)) -#define SBP_HEARTBEAT_SWIFTNAP_ERROR_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_HEARTBEAT_SWIFTNAP_ERROR_MASK << SBP_HEARTBEAT_SWIFTNAP_ERROR_SHIFT))) | \ - (((val) & (SBP_HEARTBEAT_SWIFTNAP_ERROR_MASK)) \ - << (SBP_HEARTBEAT_SWIFTNAP_ERROR_SHIFT)));} while(0) - +#define SBP_HEARTBEAT_SWIFTNAP_ERROR_GET(flags) \ + ((u32)((u32)((flags) >> SBP_HEARTBEAT_SWIFTNAP_ERROR_SHIFT) & \ + SBP_HEARTBEAT_SWIFTNAP_ERROR_MASK)) +#define SBP_HEARTBEAT_SWIFTNAP_ERROR_SET(flags, val) \ + do { \ + (flags) = (u32)((flags & (~(SBP_HEARTBEAT_SWIFTNAP_ERROR_MASK \ + << SBP_HEARTBEAT_SWIFTNAP_ERROR_SHIFT))) | \ + (((val) & (SBP_HEARTBEAT_SWIFTNAP_ERROR_MASK)) \ + << (SBP_HEARTBEAT_SWIFTNAP_ERROR_SHIFT))); \ + } while (0) #define SBP_HEARTBEAT_SWIFTNAP_ERROR_SYSTEM_HEALTHY (0) #define SBP_HEARTBEAT_SWIFTNAP_ERROR_AN_ERROR_HAS_OCCURRED_IN_THE_SWIFTNAP (1) #define SBP_HEARTBEAT_IO_ERROR_MASK (0x1u) #define SBP_HEARTBEAT_IO_ERROR_SHIFT (1u) -#define SBP_HEARTBEAT_IO_ERROR_GET(flags) \ - ((u32)((u32)((flags) >> SBP_HEARTBEAT_IO_ERROR_SHIFT) \ - & SBP_HEARTBEAT_IO_ERROR_MASK)) -#define SBP_HEARTBEAT_IO_ERROR_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_HEARTBEAT_IO_ERROR_MASK << SBP_HEARTBEAT_IO_ERROR_SHIFT))) | \ - (((val) & (SBP_HEARTBEAT_IO_ERROR_MASK)) \ - << (SBP_HEARTBEAT_IO_ERROR_SHIFT)));} while(0) - +#define SBP_HEARTBEAT_IO_ERROR_GET(flags) \ + ((u32)((u32)((flags) >> SBP_HEARTBEAT_IO_ERROR_SHIFT) & \ + SBP_HEARTBEAT_IO_ERROR_MASK)) +#define SBP_HEARTBEAT_IO_ERROR_SET(flags, val) \ + do { \ + (flags) = (u32)((flags & (~(SBP_HEARTBEAT_IO_ERROR_MASK \ + << SBP_HEARTBEAT_IO_ERROR_SHIFT))) | \ + (((val) & (SBP_HEARTBEAT_IO_ERROR_MASK)) \ + << (SBP_HEARTBEAT_IO_ERROR_SHIFT))); \ + } while (0) #define SBP_HEARTBEAT_IO_ERROR_SYSTEM_HEALTHY (0) #define SBP_HEARTBEAT_IO_ERROR_AN_IO_ERROR_HAS_OCCURRED (1) #define SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_MASK (0x1u) #define SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_SHIFT (0u) -#define SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_GET(flags) \ - ((u32)((u32)((flags) >> SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_SHIFT) \ - & SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_MASK)) -#define SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_MASK << SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_SHIFT))) | \ - (((val) & (SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_MASK)) \ - << (SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_SHIFT)));} while(0) - +#define SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_GET(flags) \ + ((u32)((u32)((flags) >> SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_SHIFT) & \ + SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_MASK)) +#define SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_SET(flags, val) \ + do { \ + (flags) = (u32)((flags & (~(SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_MASK \ + << SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_SHIFT))) | \ + (((val) & (SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_MASK)) \ + << (SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_SHIFT))); \ + } while (0) #define SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_SYSTEM_HEALTHY (0) #define SBP_HEARTBEAT_SYSTEM_ERROR_FLAG_AN_ERROR_HAS_OCCURRED (1) /** - * Encoded length of sbp_msg_heartbeat_t (V4 API) and + * Encoded length of sbp_msg_heartbeat_t (V4 API) and * msg_heartbeat_t (legacy API) */ #define SBP_MSG_HEARTBEAT_ENCODED_LEN 4u - #define SBP_SUBSYSTEMREPORT_SUBSYSTEM_MASK (0xffffu) #define SBP_SUBSYSTEMREPORT_SUBSYSTEM_SHIFT (0u) -#define SBP_SUBSYSTEMREPORT_SUBSYSTEM_GET(flags) \ - ((u16)((u16)((flags) >> SBP_SUBSYSTEMREPORT_SUBSYSTEM_SHIFT) \ - & SBP_SUBSYSTEMREPORT_SUBSYSTEM_MASK)) -#define SBP_SUBSYSTEMREPORT_SUBSYSTEM_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_SUBSYSTEMREPORT_SUBSYSTEM_MASK << SBP_SUBSYSTEMREPORT_SUBSYSTEM_SHIFT))) | \ - (((val) & (SBP_SUBSYSTEMREPORT_SUBSYSTEM_MASK)) \ - << (SBP_SUBSYSTEMREPORT_SUBSYSTEM_SHIFT)));} while(0) - +#define SBP_SUBSYSTEMREPORT_SUBSYSTEM_GET(flags) \ + ((u16)((u16)((flags) >> SBP_SUBSYSTEMREPORT_SUBSYSTEM_SHIFT) & \ + SBP_SUBSYSTEMREPORT_SUBSYSTEM_MASK)) +#define SBP_SUBSYSTEMREPORT_SUBSYSTEM_SET(flags, val) \ + do { \ + (flags) = (u16)((flags & (~(SBP_SUBSYSTEMREPORT_SUBSYSTEM_MASK \ + << SBP_SUBSYSTEMREPORT_SUBSYSTEM_SHIFT))) | \ + (((val) & (SBP_SUBSYSTEMREPORT_SUBSYSTEM_MASK)) \ + << (SBP_SUBSYSTEMREPORT_SUBSYSTEM_SHIFT))); \ + } while (0) #define SBP_SUBSYSTEMREPORT_SUBSYSTEM_PRIMARY_GNSS_ANTENNA (0) #define SBP_SUBSYSTEMREPORT_SUBSYSTEM_MEASUREMENT_ENGINE (1) @@ -209,14 +234,16 @@ #define SBP_SUBSYSTEMREPORT_SUBSYSTEM_SENSOR_FUSION_ENGINE (6) #define SBP_SUBSYSTEMREPORT_GENERIC_MASK (0xffu) #define SBP_SUBSYSTEMREPORT_GENERIC_SHIFT (0u) -#define SBP_SUBSYSTEMREPORT_GENERIC_GET(flags) \ - ((u8)((u8)((flags) >> SBP_SUBSYSTEMREPORT_GENERIC_SHIFT) \ - & SBP_SUBSYSTEMREPORT_GENERIC_MASK)) -#define SBP_SUBSYSTEMREPORT_GENERIC_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SUBSYSTEMREPORT_GENERIC_MASK << SBP_SUBSYSTEMREPORT_GENERIC_SHIFT))) | \ - (((val) & (SBP_SUBSYSTEMREPORT_GENERIC_MASK)) \ - << (SBP_SUBSYSTEMREPORT_GENERIC_SHIFT)));} while(0) - +#define SBP_SUBSYSTEMREPORT_GENERIC_GET(flags) \ + ((u8)((u8)((flags) >> SBP_SUBSYSTEMREPORT_GENERIC_SHIFT) & \ + SBP_SUBSYSTEMREPORT_GENERIC_MASK)) +#define SBP_SUBSYSTEMREPORT_GENERIC_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_SUBSYSTEMREPORT_GENERIC_MASK \ + << SBP_SUBSYSTEMREPORT_GENERIC_SHIFT))) | \ + (((val) & (SBP_SUBSYSTEMREPORT_GENERIC_MASK)) \ + << (SBP_SUBSYSTEMREPORT_GENERIC_SHIFT))); \ + } while (0) #define SBP_SUBSYSTEMREPORT_GENERIC_OKNOMINAL (0) #define SBP_SUBSYSTEMREPORT_GENERIC_INITIALIZING (1) @@ -224,159 +251,185 @@ #define SBP_SUBSYSTEMREPORT_GENERIC_DEGRADED (3) #define SBP_SUBSYSTEMREPORT_GENERIC_UNUSABLE (4) /** - * Encoded length of sbp_sub_system_report_t (V4 API) and + * Encoded length of sbp_sub_system_report_t (V4 API) and * sub_system_report_t (legacy API) */ #define SBP_SUB_SYSTEM_REPORT_ENCODED_LEN 4u - #define SBP_MSG_STATUS_REPORT 0xFFFE #define SBP_STATUS_REPORT_SYSTEM_MASK (0xffffu) #define SBP_STATUS_REPORT_SYSTEM_SHIFT (0u) -#define SBP_STATUS_REPORT_SYSTEM_GET(flags) \ - ((u16)((u16)((flags) >> SBP_STATUS_REPORT_SYSTEM_SHIFT) \ - & SBP_STATUS_REPORT_SYSTEM_MASK)) -#define SBP_STATUS_REPORT_SYSTEM_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_STATUS_REPORT_SYSTEM_MASK << SBP_STATUS_REPORT_SYSTEM_SHIFT))) | \ - (((val) & (SBP_STATUS_REPORT_SYSTEM_MASK)) \ - << (SBP_STATUS_REPORT_SYSTEM_SHIFT)));} while(0) - +#define SBP_STATUS_REPORT_SYSTEM_GET(flags) \ + ((u16)((u16)((flags) >> SBP_STATUS_REPORT_SYSTEM_SHIFT) & \ + SBP_STATUS_REPORT_SYSTEM_MASK)) +#define SBP_STATUS_REPORT_SYSTEM_SET(flags, val) \ + do { \ + (flags) = (u16)((flags & (~(SBP_STATUS_REPORT_SYSTEM_MASK \ + << SBP_STATUS_REPORT_SYSTEM_SHIFT))) | \ + (((val) & (SBP_STATUS_REPORT_SYSTEM_MASK)) \ + << (SBP_STATUS_REPORT_SYSTEM_SHIFT))); \ + } while (0) #define SBP_STATUS_REPORT_SYSTEM_STARLING (0) #define SBP_STATUS_REPORT_SYSTEM_PRECISION_GNSS_MODULE (1) #define SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK (0xffu) #define SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT (8u) -#define SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_GET(flags) \ - ((u16)((u16)((flags) >> SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT) \ - & SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) -#define SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK << SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ - (((val) & (SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) \ - << (SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT)));} while(0) - +#define SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_GET(flags) \ + ((u16)((u16)((flags) >> \ + SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT) & \ + SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) +#define SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \ + do { \ + (flags) = (u16)( \ + (flags & \ + (~(SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK \ + << SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ + (((val) & (SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) \ + << (SBP_STATUS_REPORT_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT))); \ + } while (0) #define SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK (0xffu) #define SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT (0u) -#define SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_GET(flags) \ - ((u16)((u16)((flags) >> SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT) \ - & SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) -#define SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK << SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ - (((val) & (SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) \ - << (SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT)));} while(0) - +#define SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_GET(flags) \ + ((u16)((u16)((flags) >> \ + SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT) & \ + SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) +#define SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \ + do { \ + (flags) = (u16)( \ + (flags & \ + (~(SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK \ + << SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ + (((val) & (SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) \ + << (SBP_STATUS_REPORT_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT))); \ + } while (0) /** - * The maximum number of items that can be stored in sbp_msg_status_report_t::status (V4 API) or msg_status_report_t::status (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_status_report_t::status (V4 API) or msg_status_report_t::status + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_STATUS_REPORT_STATUS_MAX 60u - /** - * Encoded length of sbp_msg_status_report_t (V4 API) and + * Encoded length of sbp_msg_status_report_t (V4 API) and * msg_status_report_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_status_report_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_status_report_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_STATUS_REPORT_ENCODED_OVERHEAD 12u - /** - * Encoded length of sbp_status_journal_item_t (V4 API) and + * Encoded length of sbp_status_journal_item_t (V4 API) and * status_journal_item_t (legacy API) */ #define SBP_STATUS_JOURNAL_ITEM_ENCODED_LEN 8u - #define SBP_MSG_STATUS_JOURNAL 0xFFFD #define SBP_STATUS_JOURNAL_SYSTEM_MASK (0xffffu) #define SBP_STATUS_JOURNAL_SYSTEM_SHIFT (0u) -#define SBP_STATUS_JOURNAL_SYSTEM_GET(flags) \ - ((u16)((u16)((flags) >> SBP_STATUS_JOURNAL_SYSTEM_SHIFT) \ - & SBP_STATUS_JOURNAL_SYSTEM_MASK)) -#define SBP_STATUS_JOURNAL_SYSTEM_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_STATUS_JOURNAL_SYSTEM_MASK << SBP_STATUS_JOURNAL_SYSTEM_SHIFT))) | \ - (((val) & (SBP_STATUS_JOURNAL_SYSTEM_MASK)) \ - << (SBP_STATUS_JOURNAL_SYSTEM_SHIFT)));} while(0) - +#define SBP_STATUS_JOURNAL_SYSTEM_GET(flags) \ + ((u16)((u16)((flags) >> SBP_STATUS_JOURNAL_SYSTEM_SHIFT) & \ + SBP_STATUS_JOURNAL_SYSTEM_MASK)) +#define SBP_STATUS_JOURNAL_SYSTEM_SET(flags, val) \ + do { \ + (flags) = (u16)((flags & (~(SBP_STATUS_JOURNAL_SYSTEM_MASK \ + << SBP_STATUS_JOURNAL_SYSTEM_SHIFT))) | \ + (((val) & (SBP_STATUS_JOURNAL_SYSTEM_MASK)) \ + << (SBP_STATUS_JOURNAL_SYSTEM_SHIFT))); \ + } while (0) #define SBP_STATUS_JOURNAL_SYSTEM_STARLING (0) #define SBP_STATUS_JOURNAL_SYSTEM_PRECISION_GNSS_MODULE (1) #define SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK (0xffu) #define SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT (8u) -#define SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_GET(flags) \ - ((u16)((u16)((flags) >> SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT) \ - & SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) -#define SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK << SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ - (((val) & (SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) \ - << (SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT)));} while(0) - +#define SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_GET(flags) \ + ((u16)((u16)((flags) >> \ + SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT) & \ + SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) +#define SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \ + do { \ + (flags) = (u16)( \ + (flags & \ + (~(SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK \ + << SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ + (((val) & (SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_MASK)) \ + << (SBP_STATUS_JOURNAL_SBP_MAJOR_PROTOCOL_VERSION_NUMBER_SHIFT))); \ + } while (0) #define SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK (0xffu) #define SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT (0u) -#define SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_GET(flags) \ - ((u16)((u16)((flags) >> SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT) \ - & SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) -#define SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \ - do {(flags) = (u16)((flags & (~(SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK << SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ - (((val) & (SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) \ - << (SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT)));} while(0) - +#define SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_GET(flags) \ + ((u16)((u16)((flags) >> \ + SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT) & \ + SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) +#define SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SET(flags, val) \ + do { \ + (flags) = (u16)( \ + (flags & \ + (~(SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK \ + << SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT))) | \ + (((val) & (SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_MASK)) \ + << (SBP_STATUS_JOURNAL_SBP_MINOR_PROTOCOL_VERSION_NUMBER_SHIFT))); \ + } while (0) /** - * The maximum number of items that can be stored in sbp_msg_status_journal_t::journal (V4 API) or msg_status_journal_t::journal (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_status_journal_t::journal (V4 API) or msg_status_journal_t::journal + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_STATUS_JOURNAL_JOURNAL_MAX 30u - /** - * Encoded length of sbp_msg_status_journal_t (V4 API) and + * Encoded length of sbp_msg_status_journal_t (V4 API) and * msg_status_journal_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_status_journal_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_status_journal_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_STATUS_JOURNAL_ENCODED_OVERHEAD 9u - #define SBP_MSG_INS_STATUS 0xFF03 #define SBP_INS_STATUS_INS_TYPE_MASK (0x7u) #define SBP_INS_STATUS_INS_TYPE_SHIFT (29u) -#define SBP_INS_STATUS_INS_TYPE_GET(flags) \ - ((u32)((u32)((flags) >> SBP_INS_STATUS_INS_TYPE_SHIFT) \ - & SBP_INS_STATUS_INS_TYPE_MASK)) -#define SBP_INS_STATUS_INS_TYPE_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_INS_STATUS_INS_TYPE_MASK << SBP_INS_STATUS_INS_TYPE_SHIFT))) | \ - (((val) & (SBP_INS_STATUS_INS_TYPE_MASK)) \ - << (SBP_INS_STATUS_INS_TYPE_SHIFT)));} while(0) - +#define SBP_INS_STATUS_INS_TYPE_GET(flags) \ + ((u32)((u32)((flags) >> SBP_INS_STATUS_INS_TYPE_SHIFT) & \ + SBP_INS_STATUS_INS_TYPE_MASK)) +#define SBP_INS_STATUS_INS_TYPE_SET(flags, val) \ + do { \ + (flags) = (u32)((flags & (~(SBP_INS_STATUS_INS_TYPE_MASK \ + << SBP_INS_STATUS_INS_TYPE_SHIFT))) | \ + (((val) & (SBP_INS_STATUS_INS_TYPE_MASK)) \ + << (SBP_INS_STATUS_INS_TYPE_SHIFT))); \ + } while (0) #define SBP_INS_STATUS_INS_TYPE_SMOOTHPOSE_LOOSELY_COUPLED (0) #define SBP_INS_STATUS_INS_TYPE_STARLING (1) #define SBP_INS_STATUS_MOTION_STATE_MASK (0x7u) #define SBP_INS_STATUS_MOTION_STATE_SHIFT (11u) -#define SBP_INS_STATUS_MOTION_STATE_GET(flags) \ - ((u32)((u32)((flags) >> SBP_INS_STATUS_MOTION_STATE_SHIFT) \ - & SBP_INS_STATUS_MOTION_STATE_MASK)) -#define SBP_INS_STATUS_MOTION_STATE_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_INS_STATUS_MOTION_STATE_MASK << SBP_INS_STATUS_MOTION_STATE_SHIFT))) | \ - (((val) & (SBP_INS_STATUS_MOTION_STATE_MASK)) \ - << (SBP_INS_STATUS_MOTION_STATE_SHIFT)));} while(0) - +#define SBP_INS_STATUS_MOTION_STATE_GET(flags) \ + ((u32)((u32)((flags) >> SBP_INS_STATUS_MOTION_STATE_SHIFT) & \ + SBP_INS_STATUS_MOTION_STATE_MASK)) +#define SBP_INS_STATUS_MOTION_STATE_SET(flags, val) \ + do { \ + (flags) = (u32)((flags & (~(SBP_INS_STATUS_MOTION_STATE_MASK \ + << SBP_INS_STATUS_MOTION_STATE_SHIFT))) | \ + (((val) & (SBP_INS_STATUS_MOTION_STATE_MASK)) \ + << (SBP_INS_STATUS_MOTION_STATE_SHIFT))); \ + } while (0) #define SBP_INS_STATUS_MOTION_STATE_UNKNOWN_OR_INIT (0) #define SBP_INS_STATUS_MOTION_STATE_ARBITRARY_MOTION (1) @@ -384,68 +437,79 @@ #define SBP_INS_STATUS_MOTION_STATE_STATIONARY (3) #define SBP_INS_STATUS_ODOMETRY_SYNCH_MASK (0x1u) #define SBP_INS_STATUS_ODOMETRY_SYNCH_SHIFT (10u) -#define SBP_INS_STATUS_ODOMETRY_SYNCH_GET(flags) \ - ((u32)((u32)((flags) >> SBP_INS_STATUS_ODOMETRY_SYNCH_SHIFT) \ - & SBP_INS_STATUS_ODOMETRY_SYNCH_MASK)) -#define SBP_INS_STATUS_ODOMETRY_SYNCH_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_INS_STATUS_ODOMETRY_SYNCH_MASK << SBP_INS_STATUS_ODOMETRY_SYNCH_SHIFT))) | \ - (((val) & (SBP_INS_STATUS_ODOMETRY_SYNCH_MASK)) \ - << (SBP_INS_STATUS_ODOMETRY_SYNCH_SHIFT)));} while(0) - +#define SBP_INS_STATUS_ODOMETRY_SYNCH_GET(flags) \ + ((u32)((u32)((flags) >> SBP_INS_STATUS_ODOMETRY_SYNCH_SHIFT) & \ + SBP_INS_STATUS_ODOMETRY_SYNCH_MASK)) +#define SBP_INS_STATUS_ODOMETRY_SYNCH_SET(flags, val) \ + do { \ + (flags) = (u32)((flags & (~(SBP_INS_STATUS_ODOMETRY_SYNCH_MASK \ + << SBP_INS_STATUS_ODOMETRY_SYNCH_SHIFT))) | \ + (((val) & (SBP_INS_STATUS_ODOMETRY_SYNCH_MASK)) \ + << (SBP_INS_STATUS_ODOMETRY_SYNCH_SHIFT))); \ + } while (0) #define SBP_INS_STATUS_ODOMETRY_SYNCH_ODOMETRY_TIMESTAMP_NOMINAL (0) #define SBP_INS_STATUS_ODOMETRY_SYNCH_ODOMETRY_TIMESTAMP_OUT_OF_BOUNDS (1) #define SBP_INS_STATUS_ODOMETRY_STATUS_MASK (0x3u) #define SBP_INS_STATUS_ODOMETRY_STATUS_SHIFT (8u) -#define SBP_INS_STATUS_ODOMETRY_STATUS_GET(flags) \ - ((u32)((u32)((flags) >> SBP_INS_STATUS_ODOMETRY_STATUS_SHIFT) \ - & SBP_INS_STATUS_ODOMETRY_STATUS_MASK)) -#define SBP_INS_STATUS_ODOMETRY_STATUS_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_INS_STATUS_ODOMETRY_STATUS_MASK << SBP_INS_STATUS_ODOMETRY_STATUS_SHIFT))) | \ - (((val) & (SBP_INS_STATUS_ODOMETRY_STATUS_MASK)) \ - << (SBP_INS_STATUS_ODOMETRY_STATUS_SHIFT)));} while(0) - +#define SBP_INS_STATUS_ODOMETRY_STATUS_GET(flags) \ + ((u32)((u32)((flags) >> SBP_INS_STATUS_ODOMETRY_STATUS_SHIFT) & \ + SBP_INS_STATUS_ODOMETRY_STATUS_MASK)) +#define SBP_INS_STATUS_ODOMETRY_STATUS_SET(flags, val) \ + do { \ + (flags) = (u32)((flags & (~(SBP_INS_STATUS_ODOMETRY_STATUS_MASK \ + << SBP_INS_STATUS_ODOMETRY_STATUS_SHIFT))) | \ + (((val) & (SBP_INS_STATUS_ODOMETRY_STATUS_MASK)) \ + << (SBP_INS_STATUS_ODOMETRY_STATUS_SHIFT))); \ + } while (0) #define SBP_INS_STATUS_ODOMETRY_STATUS_NO_ODOMETRY (0) #define SBP_INS_STATUS_ODOMETRY_STATUS_ODOMETRY_RECEIVED_WITHIN_LAST_SECOND (1) -#define SBP_INS_STATUS_ODOMETRY_STATUS_ODOMETRY_NOT_RECEIVED_WITHIN_LAST_SECOND (2) +#define SBP_INS_STATUS_ODOMETRY_STATUS_ODOMETRY_NOT_RECEIVED_WITHIN_LAST_SECOND \ + (2) #define SBP_INS_STATUS_INS_ERROR_MASK (0xfu) #define SBP_INS_STATUS_INS_ERROR_SHIFT (4u) -#define SBP_INS_STATUS_INS_ERROR_GET(flags) \ - ((u32)((u32)((flags) >> SBP_INS_STATUS_INS_ERROR_SHIFT) \ - & SBP_INS_STATUS_INS_ERROR_MASK)) -#define SBP_INS_STATUS_INS_ERROR_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_INS_STATUS_INS_ERROR_MASK << SBP_INS_STATUS_INS_ERROR_SHIFT))) | \ - (((val) & (SBP_INS_STATUS_INS_ERROR_MASK)) \ - << (SBP_INS_STATUS_INS_ERROR_SHIFT)));} while(0) - +#define SBP_INS_STATUS_INS_ERROR_GET(flags) \ + ((u32)((u32)((flags) >> SBP_INS_STATUS_INS_ERROR_SHIFT) & \ + SBP_INS_STATUS_INS_ERROR_MASK)) +#define SBP_INS_STATUS_INS_ERROR_SET(flags, val) \ + do { \ + (flags) = (u32)((flags & (~(SBP_INS_STATUS_INS_ERROR_MASK \ + << SBP_INS_STATUS_INS_ERROR_SHIFT))) | \ + (((val) & (SBP_INS_STATUS_INS_ERROR_MASK)) \ + << (SBP_INS_STATUS_INS_ERROR_SHIFT))); \ + } while (0) #define SBP_INS_STATUS_INS_ERROR_IMU_DATA_ERROR (1) #define SBP_INS_STATUS_INS_ERROR_INS_LICENSE_ERROR (2) #define SBP_INS_STATUS_INS_ERROR_IMU_CALIBRATION_DATA_ERROR (3) #define SBP_INS_STATUS_GNSS_FIX_MASK (0x1u) #define SBP_INS_STATUS_GNSS_FIX_SHIFT (3u) -#define SBP_INS_STATUS_GNSS_FIX_GET(flags) \ - ((u32)((u32)((flags) >> SBP_INS_STATUS_GNSS_FIX_SHIFT) \ - & SBP_INS_STATUS_GNSS_FIX_MASK)) -#define SBP_INS_STATUS_GNSS_FIX_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_INS_STATUS_GNSS_FIX_MASK << SBP_INS_STATUS_GNSS_FIX_SHIFT))) | \ - (((val) & (SBP_INS_STATUS_GNSS_FIX_MASK)) \ - << (SBP_INS_STATUS_GNSS_FIX_SHIFT)));} while(0) - +#define SBP_INS_STATUS_GNSS_FIX_GET(flags) \ + ((u32)((u32)((flags) >> SBP_INS_STATUS_GNSS_FIX_SHIFT) & \ + SBP_INS_STATUS_GNSS_FIX_MASK)) +#define SBP_INS_STATUS_GNSS_FIX_SET(flags, val) \ + do { \ + (flags) = (u32)((flags & (~(SBP_INS_STATUS_GNSS_FIX_MASK \ + << SBP_INS_STATUS_GNSS_FIX_SHIFT))) | \ + (((val) & (SBP_INS_STATUS_GNSS_FIX_MASK)) \ + << (SBP_INS_STATUS_GNSS_FIX_SHIFT))); \ + } while (0) #define SBP_INS_STATUS_GNSS_FIX_NO_GNSS_FIX_AVAILABLE (0) #define SBP_INS_STATUS_GNSS_FIX_GNSS_FIX (1) #define SBP_INS_STATUS_MODE_MASK (0x7u) #define SBP_INS_STATUS_MODE_SHIFT (0u) -#define SBP_INS_STATUS_MODE_GET(flags) \ - ((u32)((u32)((flags) >> SBP_INS_STATUS_MODE_SHIFT) \ - & SBP_INS_STATUS_MODE_MASK)) -#define SBP_INS_STATUS_MODE_SET(flags, val) \ - do {(flags) = (u32)((flags & (~(SBP_INS_STATUS_MODE_MASK << SBP_INS_STATUS_MODE_SHIFT))) | \ - (((val) & (SBP_INS_STATUS_MODE_MASK)) \ - << (SBP_INS_STATUS_MODE_SHIFT)));} while(0) - +#define SBP_INS_STATUS_MODE_GET(flags) \ + ((u32)((u32)((flags) >> SBP_INS_STATUS_MODE_SHIFT) & \ + SBP_INS_STATUS_MODE_MASK)) +#define SBP_INS_STATUS_MODE_SET(flags, val) \ + do { \ + (flags) = (u32)( \ + (flags & (~(SBP_INS_STATUS_MODE_MASK << SBP_INS_STATUS_MODE_SHIFT))) | \ + (((val) & (SBP_INS_STATUS_MODE_MASK)) \ + << (SBP_INS_STATUS_MODE_SHIFT))); \ + } while (0) #define SBP_INS_STATUS_MODE_AWAITING_INITIALIZATION (0) #define SBP_INS_STATUS_MODE_DYNAMICALLY_ALIGNING (1) @@ -455,228 +519,375 @@ #define SBP_INS_STATUS_MODE_FASTSTART_VALIDATING (5) #define SBP_INS_STATUS_MODE_VALIDATING_UNSAFE_FAST_START_SEED (6) /** - * Encoded length of sbp_msg_ins_status_t (V4 API) and + * Encoded length of sbp_msg_ins_status_t (V4 API) and * msg_ins_status_t (legacy API) */ #define SBP_MSG_INS_STATUS_ENCODED_LEN 4u - #define SBP_MSG_CSAC_TELEMETRY 0xFF04 /** - * The maximum number of items that can be stored in sbp_msg_csac_telemetry_t::telemetry (V4 API) or msg_csac_telemetry_t::telemetry (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_csac_telemetry_t::telemetry (V4 API) or + * msg_csac_telemetry_t::telemetry (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX 254u - /** - * Encoded length of sbp_msg_csac_telemetry_t (V4 API) and + * Encoded length of sbp_msg_csac_telemetry_t (V4 API) and * msg_csac_telemetry_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_csac_telemetry_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_csac_telemetry_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_CSAC_TELEMETRY_ENCODED_OVERHEAD 1u - #define SBP_MSG_CSAC_TELEMETRY_LABELS 0xFF05 /** - * The maximum number of items that can be stored in sbp_msg_csac_telemetry_labels_t::telemetry_labels (V4 API) or msg_csac_telemetry_labels_t::telemetry_labels (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_csac_telemetry_labels_t::telemetry_labels (V4 API) or + * msg_csac_telemetry_labels_t::telemetry_labels (legacy API) before the maximum + * SBP message size is exceeded */ #define SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX 254u - /** - * Encoded length of sbp_msg_csac_telemetry_labels_t (V4 API) and + * Encoded length of sbp_msg_csac_telemetry_labels_t (V4 API) and * msg_csac_telemetry_labels_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_csac_telemetry_labels_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_csac_telemetry_labels_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_CSAC_TELEMETRY_LABELS_ENCODED_OVERHEAD 1u - #define SBP_MSG_INS_UPDATES 0xFF06 -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK (0xfu) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT (4u) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT) \ - & SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK)) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK << SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ - (((val) & (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ - << (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT)));} while(0) - - -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK (0xfu) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT (0u) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT) \ - & SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK)) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK << SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ - (((val) & (SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ - << (SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT)));} while(0) - - -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK (0xfu) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT (4u) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT) \ - & SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK << SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ - (((val) & (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ - << (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT)));} while(0) - - -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK (0xfu) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT (0u) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT) \ - & SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK << SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ - (((val) & (SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ - << (SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT)));} while(0) - - -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK (0xfu) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT (4u) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT) \ - & SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK)) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK << SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ - (((val) & (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ - << (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT)));} while(0) - - -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK (0xfu) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT (0u) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT) \ - & SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK)) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK << SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ - (((val) & (SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ - << (SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT)));} while(0) - - -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK (0xfu) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT (4u) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT) \ - & SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK)) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK << SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ - (((val) & (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ - << (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT)));} while(0) - - -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK (0xfu) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT (0u) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT) \ - & SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK)) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK << SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ - (((val) & (SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ - << (SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT)));} while(0) - - -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK (0xfu) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT (4u) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT) \ - & SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK)) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK << SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ - (((val) & (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ - << (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT)));} while(0) - - -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK (0xfu) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT (0u) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT) \ - & SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK)) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK << SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ - (((val) & (SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ - << (SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT)));} while(0) - - -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK (0xfu) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT (4u) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT) \ - & SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) -#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK << SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ - (((val) & (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ - << (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT)));} while(0) - - -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK (0xfu) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT (0u) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT) \ - & SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) -#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK << SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ - (((val) & (SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ - << (SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT)));} while(0) - +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK \ + (0xfu) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT \ + (4u) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT) & \ + SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK)) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK \ + << SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ + (((val) & \ + (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ + << (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT))); \ + } while (0) + +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK \ + (0xfu) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT \ + (0u) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT) & \ + SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK)) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK \ + << SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ + (((val) & \ + (SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ + << (SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_POSITION_UPDATES_SINCE_LAST_MESSAGE_SHIFT))); \ + } while (0) + +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK \ + (0xfu) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT \ + (4u) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT) & \ + SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK \ + << SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ + (((val) & \ + (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ + << (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT))); \ + } while (0) + +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK \ + (0xfu) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT \ + (0u) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT) & \ + SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK \ + << SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ + (((val) & \ + (SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ + << (SBP_INS_UPDATES_NUMBER_OF_REJECTED_GNSS_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT))); \ + } while (0) + +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK \ + (0xfu) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT \ + (4u) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT) & \ + SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK)) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK \ + << SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ + (((val) & \ + (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ + << (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT))); \ + } while (0) + +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK \ + (0xfu) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT \ + (0u) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT) & \ + SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK)) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK \ + << SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ + (((val) & \ + (SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ + << (SBP_INS_UPDATES_NUMBER_OF_REJECTED_WHEELTICK_UPDATES_SINCE_LAST_MESSAGE_SHIFT))); \ + } while (0) + +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK \ + (0xfu) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT \ + (4u) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT) & \ + SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK)) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK \ + << SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ + (((val) & \ + (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ + << (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT))); \ + } while (0) + +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK \ + (0xfu) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT \ + (0u) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT) & \ + SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK)) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK \ + << SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ + (((val) & \ + (SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ + << (SBP_INS_UPDATES_NUMBER_OF_REJECTED_SPEED_UPDATES_SINCE_LAST_MESSAGE_SHIFT))); \ + } while (0) + +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK \ + (0xfu) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT \ + (4u) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT) & \ + SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK)) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK \ + << SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ + (((val) & \ + (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ + << (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT))); \ + } while (0) + +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK \ + (0xfu) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT \ + (0u) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT) & \ + SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK)) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK \ + << SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ + (((val) & \ + (SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ + << (SBP_INS_UPDATES_NUMBER_OF_REJECTED_NHC_UPDATES_SINCE_LAST_MESSAGE_SHIFT))); \ + } while (0) + +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK \ + (0xfu) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT \ + (4u) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT) & \ + SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) +#define SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK \ + << SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ + (((val) & \ + (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ + << (SBP_INS_UPDATES_NUMBER_OF_ATTEMPTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT))); \ + } while (0) + +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK \ + (0xfu) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT \ + (0u) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT) & \ + SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) +#define SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK \ + << SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT))) | \ + (((val) & \ + (SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_MASK)) \ + << (SBP_INS_UPDATES_NUMBER_OF_REJECTED_ZERO_VELOCITY_UPDATES_SINCE_LAST_MESSAGE_SHIFT))); \ + } while (0) /** - * Encoded length of sbp_msg_ins_updates_t (V4 API) and + * Encoded length of sbp_msg_ins_updates_t (V4 API) and * msg_ins_updates_t (legacy API) */ #define SBP_MSG_INS_UPDATES_ENCODED_LEN 10u - #define SBP_MSG_GNSS_TIME_OFFSET 0xFF07 /** - * Encoded length of sbp_msg_gnss_time_offset_t (V4 API) and + * Encoded length of sbp_msg_gnss_time_offset_t (V4 API) and * msg_gnss_time_offset_t (legacy API) */ #define SBP_MSG_GNSS_TIME_OFFSET_ENCODED_LEN 9u - #define SBP_MSG_PPS_TIME 0xFF08 #define SBP_PPS_TIME_RESERVED_SET_TO_ZERO_MASK (0x3fu) #define SBP_PPS_TIME_RESERVED_SET_TO_ZERO_SHIFT (2u) -#define SBP_PPS_TIME_RESERVED_SET_TO_ZERO_GET(flags) \ - ((u8)((u8)((flags) >> SBP_PPS_TIME_RESERVED_SET_TO_ZERO_SHIFT) \ - & SBP_PPS_TIME_RESERVED_SET_TO_ZERO_MASK)) -#define SBP_PPS_TIME_RESERVED_SET_TO_ZERO_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_PPS_TIME_RESERVED_SET_TO_ZERO_MASK << SBP_PPS_TIME_RESERVED_SET_TO_ZERO_SHIFT))) | \ - (((val) & (SBP_PPS_TIME_RESERVED_SET_TO_ZERO_MASK)) \ - << (SBP_PPS_TIME_RESERVED_SET_TO_ZERO_SHIFT)));} while(0) - +#define SBP_PPS_TIME_RESERVED_SET_TO_ZERO_GET(flags) \ + ((u8)((u8)((flags) >> SBP_PPS_TIME_RESERVED_SET_TO_ZERO_SHIFT) & \ + SBP_PPS_TIME_RESERVED_SET_TO_ZERO_MASK)) +#define SBP_PPS_TIME_RESERVED_SET_TO_ZERO_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_PPS_TIME_RESERVED_SET_TO_ZERO_MASK \ + << SBP_PPS_TIME_RESERVED_SET_TO_ZERO_SHIFT))) | \ + (((val) & (SBP_PPS_TIME_RESERVED_SET_TO_ZERO_MASK)) \ + << (SBP_PPS_TIME_RESERVED_SET_TO_ZERO_SHIFT))); \ + } while (0) #define SBP_PPS_TIME_TIME_UNCERTAINTY_MASK (0x3u) #define SBP_PPS_TIME_TIME_UNCERTAINTY_SHIFT (0u) -#define SBP_PPS_TIME_TIME_UNCERTAINTY_GET(flags) \ - ((u8)((u8)((flags) >> SBP_PPS_TIME_TIME_UNCERTAINTY_SHIFT) \ - & SBP_PPS_TIME_TIME_UNCERTAINTY_MASK)) -#define SBP_PPS_TIME_TIME_UNCERTAINTY_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_PPS_TIME_TIME_UNCERTAINTY_MASK << SBP_PPS_TIME_TIME_UNCERTAINTY_SHIFT))) | \ - (((val) & (SBP_PPS_TIME_TIME_UNCERTAINTY_MASK)) \ - << (SBP_PPS_TIME_TIME_UNCERTAINTY_SHIFT)));} while(0) - +#define SBP_PPS_TIME_TIME_UNCERTAINTY_GET(flags) \ + ((u8)((u8)((flags) >> SBP_PPS_TIME_TIME_UNCERTAINTY_SHIFT) & \ + SBP_PPS_TIME_TIME_UNCERTAINTY_MASK)) +#define SBP_PPS_TIME_TIME_UNCERTAINTY_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_PPS_TIME_TIME_UNCERTAINTY_MASK \ + << SBP_PPS_TIME_TIME_UNCERTAINTY_SHIFT))) | \ + (((val) & (SBP_PPS_TIME_TIME_UNCERTAINTY_MASK)) \ + << (SBP_PPS_TIME_TIME_UNCERTAINTY_SHIFT))); \ + } while (0) #define SBP_PPS_TIME_TIME_UNCERTAINTY_UNKNOWN (0) #define SBP_PPS_TIME_TIME_UNCERTAINTY_UNKNOWN (0) @@ -687,23 +898,25 @@ #define SBP_PPS_TIME_TIME_UNCERTAINTY__1_MICROSECONDS (3) #define SBP_PPS_TIME_TIME_UNCERTAINTY_1_MICROSECONDS (3) /** - * Encoded length of sbp_msg_pps_time_t (V4 API) and + * Encoded length of sbp_msg_pps_time_t (V4 API) and * msg_pps_time_t (legacy API) */ #define SBP_MSG_PPS_TIME_ENCODED_LEN 9u - #define SBP_MSG_SENSOR_AID_EVENT 0xFF09 #define SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_MASK (0xffu) #define SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_SHIFT (0u) -#define SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_GET(flags) \ - ((u8)((u8)((flags) >> SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_SHIFT) \ - & SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_MASK)) -#define SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_MASK << SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_SHIFT))) | \ - (((val) & (SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_MASK)) \ - << (SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_SHIFT)));} while(0) - +#define SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_GET(flags) \ + ((u8)((u8)((flags) >> SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_SHIFT) & \ + SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_MASK)) +#define SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_MASK \ + << SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_SHIFT))) | \ + (((val) & (SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_MASK)) \ + << (SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_SHIFT))); \ + } while (0) #define SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_GNSS_POSITION (0) #define SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_GNSS_AVERAGE_VELOCITY (1) @@ -711,50 +924,52 @@ #define SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_WHEEL_TICKS (3) #define SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_WHEEL_SPEED (4) #define SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_IMU (5) -#define SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_TIME_DIFFERENCES_OF_CARRIER_PHASE (6) +#define SBP_SENSOR_AID_EVENT_TYPE_IDENTIFIER_TIME_DIFFERENCES_OF_CARRIER_PHASE \ + (6) /** - * Encoded length of sbp_msg_sensor_aid_event_t (V4 API) and + * Encoded length of sbp_msg_sensor_aid_event_t (V4 API) and * msg_sensor_aid_event_t (legacy API) */ #define SBP_MSG_SENSOR_AID_EVENT_ENCODED_LEN 15u - #define SBP_MSG_GROUP_META 0xFF0A #define SBP_GROUP_META_SOLUTION_GROUP_TYPE_MASK (0x3u) #define SBP_GROUP_META_SOLUTION_GROUP_TYPE_SHIFT (0u) -#define SBP_GROUP_META_SOLUTION_GROUP_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_GROUP_META_SOLUTION_GROUP_TYPE_SHIFT) \ - & SBP_GROUP_META_SOLUTION_GROUP_TYPE_MASK)) -#define SBP_GROUP_META_SOLUTION_GROUP_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_GROUP_META_SOLUTION_GROUP_TYPE_MASK << SBP_GROUP_META_SOLUTION_GROUP_TYPE_SHIFT))) | \ - (((val) & (SBP_GROUP_META_SOLUTION_GROUP_TYPE_MASK)) \ - << (SBP_GROUP_META_SOLUTION_GROUP_TYPE_SHIFT)));} while(0) - +#define SBP_GROUP_META_SOLUTION_GROUP_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_GROUP_META_SOLUTION_GROUP_TYPE_SHIFT) & \ + SBP_GROUP_META_SOLUTION_GROUP_TYPE_MASK)) +#define SBP_GROUP_META_SOLUTION_GROUP_TYPE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_GROUP_META_SOLUTION_GROUP_TYPE_MASK \ + << SBP_GROUP_META_SOLUTION_GROUP_TYPE_SHIFT))) | \ + (((val) & (SBP_GROUP_META_SOLUTION_GROUP_TYPE_MASK)) \ + << (SBP_GROUP_META_SOLUTION_GROUP_TYPE_SHIFT))); \ + } while (0) #define SBP_GROUP_META_SOLUTION_GROUP_TYPE_NONE (0) #define SBP_GROUP_META_SOLUTION_GROUP_TYPE_GNSS_ONLY (1) #define SBP_GROUP_META_SOLUTION_GROUP_TYPE_GNSSINS (2) /** - * The maximum number of items that can be stored in sbp_msg_group_meta_t::group_msgs (V4 API) or msg_group_meta_t::group_msgs (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_group_meta_t::group_msgs (V4 API) or msg_group_meta_t::group_msgs + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_GROUP_META_GROUP_MSGS_MAX 126u - /** - * Encoded length of sbp_msg_group_meta_t (V4 API) and + * Encoded length of sbp_msg_group_meta_t (V4 API) and * msg_group_meta_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_group_meta_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_group_meta_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_GROUP_META_ENCODED_OVERHEAD 3u - - #endif /* LIBSBP_SYSTEM_MACROS_H */ diff --git a/c/include/libsbp/telemetry.h b/c/include/libsbp/telemetry.h index dfad2659e..c7b2f615f 100644 --- a/c/include/libsbp/telemetry.h +++ b/c/include/libsbp/telemetry.h @@ -17,7 +17,7 @@ #ifndef LIBSBP_TELEMETRY_MESSAGES_H #define LIBSBP_TELEMETRY_MESSAGES_H -#include #include +#include #endif /* LIBSBP_TELEMETRY_MESSAGES_H */ diff --git a/c/include/libsbp/telemetry/MSG_TEL_SV.h b/c/include/libsbp/telemetry/MSG_TEL_SV.h index 6c2b136be..c81ca4197 100644 --- a/c/include/libsbp/telemetry/MSG_TEL_SV.h +++ b/c/include/libsbp/telemetry/MSG_TEL_SV.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_TELEMETRY_MSG_TEL_SV_H #define LIBSBP_TELEMETRY_MSG_TEL_SV_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,97 +41,108 @@ *****************************************************************************/ /** Per-signal telemetry * -* This message includes telemetry pertinent to satellite signals available to Starling. + * This message includes telemetry pertinent to satellite signals available to + * Starling. */ typedef struct { - - /** -* GPS week number [weeks] + * GPS week number [weeks] */ u16 wn; - /** -* GPS Time of Week [ms] + * GPS Time of Week [ms] */ u32 tow; - /** - * Total number of observations. First nibble is the size of the sequence (n), second nibble is the zero-indexed counter (ith packet of n) + * Total number of observations. First nibble is the size of the sequence (n), + * second nibble is the zero-indexed counter (ith packet of n) */ u8 n_obs; - /** -* Flags to identify the filter type from which the telemetry is reported from + * Flags to identify the filter type from which the telemetry is reported from */ u8 origin_flags; - /** -* Array of per-signal telemetry entries + * Array of per-signal telemetry entries */ sbp_telemetry_sv_t sv_tel[SBP_MSG_TEL_SV_SV_TEL_MAX]; /** * Number of elements in sv_tel * - * When sending a message fill in this field with the number elements set in sv_tel before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * sv_tel before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in sv_tel. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * sv_tel. The value of any elements beyond the index specified in this field + * is undefined */ u8 n_sv_tel; } sbp_msg_tel_sv_t; - - /** * Get encoded size of an instance of sbp_msg_tel_sv_t * * @param msg sbp_msg_tel_sv_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_tel_sv_encoded_len(const sbp_msg_tel_sv_t *msg) -{ - return SBP_MSG_TEL_SV_ENCODED_OVERHEAD - + (msg->n_sv_tel * SBP_TELEMETRY_SV_ENCODED_LEN) - ; +static inline size_t sbp_msg_tel_sv_encoded_len(const sbp_msg_tel_sv_t *msg) { + return SBP_MSG_TEL_SV_ENCODED_OVERHEAD + + (msg->n_sv_tel * SBP_TELEMETRY_SV_ENCODED_LEN); } /** * Encode an instance of sbp_msg_tel_sv_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_tel_sv_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tel_sv_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tel_sv_t *msg); +SBP_EXPORT s8 sbp_msg_tel_sv_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_tel_sv_t *msg); /** * Decode an instance of sbp_msg_tel_sv_t from wire representation * - * This function decodes the wire representation of a sbp_msg_tel_sv_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_tel_sv_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_tel_sv_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tel_sv_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tel_sv_t *msg); +SBP_EXPORT s8 sbp_msg_tel_sv_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_tel_sv_t *msg); /** * Send an instance of sbp_msg_tel_sv_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_tel_sv_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_tel_sv_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -139,51 +150,61 @@ SBP_EXPORT s8 sbp_msg_tel_sv_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tel_sv_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tel_sv_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_tel_sv_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_tel_sv_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_tel_sv_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_tel_sv_t instance * @param b sbp_msg_tel_sv_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_tel_sv_cmp(const sbp_msg_tel_sv_t *a, const sbp_msg_tel_sv_t *b); +SBP_EXPORT int sbp_msg_tel_sv_cmp(const sbp_msg_tel_sv_t *a, + const sbp_msg_tel_sv_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_tel_sv_t &lhs, const sbp_msg_tel_sv_t &rhs) { +static inline bool operator==(const sbp_msg_tel_sv_t &lhs, + const sbp_msg_tel_sv_t &rhs) { return sbp_msg_tel_sv_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_tel_sv_t &lhs, const sbp_msg_tel_sv_t &rhs) { +static inline bool operator!=(const sbp_msg_tel_sv_t &lhs, + const sbp_msg_tel_sv_t &rhs) { return sbp_msg_tel_sv_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_tel_sv_t &lhs, const sbp_msg_tel_sv_t &rhs) { +static inline bool operator<(const sbp_msg_tel_sv_t &lhs, + const sbp_msg_tel_sv_t &rhs) { return sbp_msg_tel_sv_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_tel_sv_t &lhs, const sbp_msg_tel_sv_t &rhs) { +static inline bool operator<=(const sbp_msg_tel_sv_t &lhs, + const sbp_msg_tel_sv_t &rhs) { return sbp_msg_tel_sv_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_tel_sv_t &lhs, const sbp_msg_tel_sv_t &rhs) { +static inline bool operator>(const sbp_msg_tel_sv_t &lhs, + const sbp_msg_tel_sv_t &rhs) { return sbp_msg_tel_sv_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_tel_sv_t &lhs, const sbp_msg_tel_sv_t &rhs) { +static inline bool operator>=(const sbp_msg_tel_sv_t &lhs, + const sbp_msg_tel_sv_t &rhs) { return sbp_msg_tel_sv_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TELEMETRY_MSG_TEL_SV_H */ - diff --git a/c/include/libsbp/telemetry/TelemetrySV.h b/c/include/libsbp/telemetry/TelemetrySV.h index 7bb2cf3e8..dd7a2bc54 100644 --- a/c/include/libsbp/telemetry/TelemetrySV.h +++ b/c/include/libsbp/telemetry/TelemetrySV.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_TELEMETRY_TELEMETRYSV_H #define LIBSBP_TELEMETRY_TELEMETRYSV_H +#include +#include #include #include -#include -#include #include -#include +#include #include +#include #include #include -#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,72 +40,61 @@ * *****************************************************************************/ typedef struct { - - /** -* Azimuth angle (range 0..179) [deg * 2] + * Azimuth angle (range 0..179) [deg * 2] */ u8 az; - /** -* Elevation angle (range -90..90) [deg] + * Elevation angle (range -90..90) [deg] */ s8 el; - /** -* Observation availability at filter update + * Observation availability at filter update */ u8 availability_flags; - /** -* Pseudorange observation residual [1 dm] + * Pseudorange observation residual [1 dm] */ s16 pseudorange_residual; - /** -* Carrier-phase or carrier-phase-derived observation residual [5 mm] + * Carrier-phase or carrier-phase-derived observation residual [5 mm] */ s16 phase_residual; - /** -* Reports if observation is marked as an outlier and is excluded from the update + * Reports if observation is marked as an outlier and is excluded from the + * update */ u8 outlier_flags; - /** -* Ephemeris metadata + * Ephemeris metadata */ u8 ephemeris_flags; - /** -* Reserved + * Reserved */ u8 correction_flags; - /** -* GNSS signal identifier (16 bit) + * GNSS signal identifier (16 bit) */ sbp_v4_gnss_signal_t sid; } sbp_telemetry_sv_t; - - /** * Get encoded size of an instance of sbp_telemetry_sv_t * * @param msg sbp_telemetry_sv_t instance * @return Length of on-wire representation */ -static inline size_t sbp_telemetry_sv_encoded_len(const sbp_telemetry_sv_t *msg) -{ +static inline size_t sbp_telemetry_sv_encoded_len( + const sbp_telemetry_sv_t *msg) { (void)msg; return SBP_TELEMETRY_SV_ENCODED_LEN; } @@ -113,74 +102,95 @@ static inline size_t sbp_telemetry_sv_encoded_len(const sbp_telemetry_sv_t *msg) /** * Encode an instance of sbp_telemetry_sv_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_telemetry_sv_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_telemetry_sv_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_telemetry_sv_t *msg); +SBP_EXPORT s8 sbp_telemetry_sv_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_telemetry_sv_t *msg); /** * Decode an instance of sbp_telemetry_sv_t from wire representation * - * This function decodes the wire representation of a sbp_telemetry_sv_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_telemetry_sv_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_telemetry_sv_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_telemetry_sv_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_telemetry_sv_t *msg); +SBP_EXPORT s8 sbp_telemetry_sv_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_telemetry_sv_t *msg); /** * Compare two instances of sbp_telemetry_sv_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_telemetry_sv_t instance * @param b sbp_telemetry_sv_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_telemetry_sv_cmp(const sbp_telemetry_sv_t *a, const sbp_telemetry_sv_t *b); +SBP_EXPORT int sbp_telemetry_sv_cmp(const sbp_telemetry_sv_t *a, + const sbp_telemetry_sv_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_telemetry_sv_t &lhs, const sbp_telemetry_sv_t &rhs) { +static inline bool operator==(const sbp_telemetry_sv_t &lhs, + const sbp_telemetry_sv_t &rhs) { return sbp_telemetry_sv_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_telemetry_sv_t &lhs, const sbp_telemetry_sv_t &rhs) { +static inline bool operator!=(const sbp_telemetry_sv_t &lhs, + const sbp_telemetry_sv_t &rhs) { return sbp_telemetry_sv_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_telemetry_sv_t &lhs, const sbp_telemetry_sv_t &rhs) { +static inline bool operator<(const sbp_telemetry_sv_t &lhs, + const sbp_telemetry_sv_t &rhs) { return sbp_telemetry_sv_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_telemetry_sv_t &lhs, const sbp_telemetry_sv_t &rhs) { +static inline bool operator<=(const sbp_telemetry_sv_t &lhs, + const sbp_telemetry_sv_t &rhs) { return sbp_telemetry_sv_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_telemetry_sv_t &lhs, const sbp_telemetry_sv_t &rhs) { +static inline bool operator>(const sbp_telemetry_sv_t &lhs, + const sbp_telemetry_sv_t &rhs) { return sbp_telemetry_sv_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_telemetry_sv_t &lhs, const sbp_telemetry_sv_t &rhs) { +static inline bool operator>=(const sbp_telemetry_sv_t &lhs, + const sbp_telemetry_sv_t &rhs) { return sbp_telemetry_sv_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TELEMETRY_TELEMETRYSV_H */ - diff --git a/c/include/libsbp/telemetry_macros.h b/c/include/libsbp/telemetry_macros.h index 05f0fa220..f628119d6 100644 --- a/c/include/libsbp/telemetry_macros.h +++ b/c/include/libsbp/telemetry_macros.h @@ -18,167 +18,200 @@ #ifndef LIBSBP_TELEMETRY_MACROS_H #define LIBSBP_TELEMETRY_MACROS_H - #define SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_MASK (0x1u) #define SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_SHIFT (3u) -#define SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_SHIFT) \ - & SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_MASK)) -#define SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_MASK << SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_SHIFT))) | \ - (((val) & (SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_MASK)) \ - << (SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_SHIFT)));} while(0) - - -#define SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_MEASURED_DOPPLER_UNAVAILABLE (0) -#define SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_MEASURED_DOPPLER_AVAILABLE (1) +#define SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_SHIFT) & \ + SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_MASK)) +#define SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_MASK \ + << SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_SHIFT))) | \ + (((val) & (SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_MASK)) \ + << (SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_SHIFT))); \ + } while (0) + +#define SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_MEASURED_DOPPLER_UNAVAILABLE \ + (0) +#define SBP_TELEMETRYSV_MEASUREDDOPPLER_AVAILABILITY_MEASURED_DOPPLER_AVAILABLE \ + (1) #define SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_MASK (0x1u) #define SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_SHIFT (2u) -#define SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_SHIFT) \ - & SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_MASK)) -#define SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_MASK << SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_SHIFT))) | \ - (((val) & (SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_MASK)) \ - << (SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_SHIFT)));} while(0) - - -#define SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_COMPUTED_DOPPLER_UNAVAILABLE (0) -#define SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_COMPUTED_DOPPLER_AVAILABLE (1) +#define SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_SHIFT) & \ + SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_MASK)) +#define SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_MASK \ + << SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_SHIFT))) | \ + (((val) & (SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_MASK)) \ + << (SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_SHIFT))); \ + } while (0) + +#define SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_COMPUTED_DOPPLER_UNAVAILABLE \ + (0) +#define SBP_TELEMETRYSV_COMPUTEDDOPPLER_AVAILABILITY_COMPUTED_DOPPLER_AVAILABLE \ + (1) #define SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_MASK (0x1u) #define SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_SHIFT (1u) -#define SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_SHIFT) \ - & SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_MASK)) -#define SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_MASK << SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_SHIFT))) | \ - (((val) & (SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_MASK)) \ - << (SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_SHIFT)));} while(0) - +#define SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_SHIFT) & \ + SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_MASK)) +#define SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_MASK \ + << SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_SHIFT))) | \ + (((val) & (SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_MASK)) \ + << (SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_SHIFT))); \ + } while (0) #define SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_CARRIER_PHASE_UNAVAILABLE (0) #define SBP_TELEMETRYSV_CARRIERPHASE_AVAILABILITY_CARRIER_PHASE_AVAILABLE (1) #define SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_MASK (0x1u) #define SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_SHIFT (0u) -#define SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_SHIFT) \ - & SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_MASK)) -#define SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_MASK << SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_SHIFT))) | \ - (((val) & (SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_MASK)) \ - << (SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_SHIFT)));} while(0) - +#define SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_SHIFT) & \ + SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_MASK)) +#define SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_MASK \ + << SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_SHIFT))) | \ + (((val) & (SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_MASK)) \ + << (SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_SHIFT))); \ + } while (0) #define SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_PSEUDORANGE_UNAVAILABLE (0) #define SBP_TELEMETRYSV_PSEUDORANGE_AVAILABILITY_PSEUDORANGE_AVAILABLE (1) #define SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_MASK (0x1u) #define SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_SHIFT (4u) -#define SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_SHIFT) \ - & SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_MASK)) -#define SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_MASK << SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_SHIFT))) | \ - (((val) & (SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_MASK)) \ - << (SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_SHIFT)));} while(0) - +#define SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_SHIFT) & \ + SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_MASK)) +#define SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_MASK \ + << SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_SHIFT))) | \ + (((val) & (SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_MASK)) \ + << (SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_SHIFT))); \ + } while (0) #define SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_MEASURED_DOPPLER_ACCEPTED (0) -#define SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_MEASURED_DOPPLER_MARKED_AS_OUTLIER (1) +#define SBP_TELEMETRYSV_MEASUREDDOPPLER_OUTLIER_MEASURED_DOPPLER_MARKED_AS_OUTLIER \ + (1) #define SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_MASK (0x1u) #define SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_SHIFT (3u) -#define SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_SHIFT) \ - & SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_MASK)) -#define SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_MASK << SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_SHIFT))) | \ - (((val) & (SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_MASK)) \ - << (SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_SHIFT)));} while(0) - +#define SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_SHIFT) & \ + SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_MASK)) +#define SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_MASK \ + << SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_SHIFT))) | \ + (((val) & (SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_MASK)) \ + << (SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_SHIFT))); \ + } while (0) #define SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_COMPUTED_DOPPLER_ACCEPTED (0) -#define SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_COMPUTED_DOPPLER_MARKED_AS_OUTLIER (1) +#define SBP_TELEMETRYSV_COMPUTEDDOPPLER_OUTLIER_COMPUTED_DOPPLER_MARKED_AS_OUTLIER \ + (1) #define SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_MASK (0x1u) #define SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_SHIFT (2u) -#define SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_SHIFT) \ - & SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_MASK)) -#define SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_MASK << SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_SHIFT))) | \ - (((val) & (SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_MASK)) \ - << (SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_SHIFT)));} while(0) - +#define SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_SHIFT) & \ + SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_MASK)) +#define SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_MASK \ + << SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_SHIFT))) | \ + (((val) & (SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_MASK)) \ + << (SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_SHIFT))); \ + } while (0) #define SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_CARRIER_PHASE_ACCEPTED (0) #define SBP_TELEMETRYSV_CARRIERPHASE_OUTLIER_CARRIER_PHASE_MARKED_AS_OUTLIER (1) #define SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_MASK (0x3u) #define SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_SHIFT (0u) -#define SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_SHIFT) \ - & SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_MASK)) -#define SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_MASK << SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_SHIFT))) | \ - (((val) & (SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_MASK)) \ - << (SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_SHIFT)));} while(0) - +#define SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_SHIFT) & \ + SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_MASK)) +#define SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_MASK \ + << SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_SHIFT))) | \ + (((val) & (SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_MASK)) \ + << (SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_SHIFT))); \ + } while (0) #define SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_PSEUDORANGE_ACCEPTED (0) #define SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_PSEUDORANGE_MARKED_AS_OUTLIER (1) -#define SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_PSEUDORANGE_MARKED_AS_MAJOR_OUTLIER (2) +#define SBP_TELEMETRYSV_PSEUDORANGE_OUTLIER_PSEUDORANGE_MARKED_AS_MAJOR_OUTLIER \ + (2) #define SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_MASK (0x1u) #define SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_SHIFT (0u) -#define SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_SHIFT) \ - & SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_MASK)) -#define SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_MASK << SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_SHIFT))) | \ - (((val) & (SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_MASK)) \ - << (SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_SHIFT)));} while(0) - +#define SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_SHIFT) & \ + SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_MASK)) +#define SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_MASK \ + << SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_SHIFT))) | \ + (((val) & (SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_MASK)) \ + << (SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_SHIFT))); \ + } while (0) #define SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_VALID_EPHEMERIS_AVAILABLE (0) #define SBP_TELEMETRYSV_EPHEMERIS_AVAILABLE_NO_VALID_EPHEMERIS_AVAILABLE (1) /** - * Encoded length of sbp_telemetry_sv_t (V4 API) and + * Encoded length of sbp_telemetry_sv_t (V4 API) and * telemetry_sv_t (legacy API) */ #define SBP_TELEMETRY_SV_ENCODED_LEN 12u - #define SBP_MSG_TEL_SV 0x0120 #define SBP_TEL_SV_FILTER_TYPE_MASK (0xffu) #define SBP_TEL_SV_FILTER_TYPE_SHIFT (0u) -#define SBP_TEL_SV_FILTER_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TEL_SV_FILTER_TYPE_SHIFT) \ - & SBP_TEL_SV_FILTER_TYPE_MASK)) -#define SBP_TEL_SV_FILTER_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TEL_SV_FILTER_TYPE_MASK << SBP_TEL_SV_FILTER_TYPE_SHIFT))) | \ - (((val) & (SBP_TEL_SV_FILTER_TYPE_MASK)) \ - << (SBP_TEL_SV_FILTER_TYPE_SHIFT)));} while(0) - +#define SBP_TEL_SV_FILTER_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TEL_SV_FILTER_TYPE_SHIFT) & \ + SBP_TEL_SV_FILTER_TYPE_MASK)) +#define SBP_TEL_SV_FILTER_TYPE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_TEL_SV_FILTER_TYPE_MASK \ + << SBP_TEL_SV_FILTER_TYPE_SHIFT))) | \ + (((val) & (SBP_TEL_SV_FILTER_TYPE_MASK)) \ + << (SBP_TEL_SV_FILTER_TYPE_SHIFT))); \ + } while (0) #define SBP_TEL_SV_FILTER_TYPE_STANDALONE (0) #define SBP_TEL_SV_FILTER_TYPE_DIFFERENTIAL (1) /** - * The maximum number of items that can be stored in sbp_msg_tel_sv_t::sv_tel (V4 API) or msg_tel_sv_t::sv_tel (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in sbp_msg_tel_sv_t::sv_tel + * (V4 API) or msg_tel_sv_t::sv_tel (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_TEL_SV_SV_TEL_MAX 20u - /** - * Encoded length of sbp_msg_tel_sv_t (V4 API) and + * Encoded length of sbp_msg_tel_sv_t (V4 API) and * msg_tel_sv_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_tel_sv_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_tel_sv_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_TEL_SV_ENCODED_OVERHEAD 8u - - #endif /* LIBSBP_TELEMETRY_MACROS_H */ diff --git a/c/include/libsbp/tracking.h b/c/include/libsbp/tracking.h index 6b29a184e..052ff4fd3 100644 --- a/c/include/libsbp/tracking.h +++ b/c/include/libsbp/tracking.h @@ -17,20 +17,20 @@ #ifndef LIBSBP_TRACKING_MESSAGES_H #define LIBSBP_TRACKING_MESSAGES_H -#include -#include -#include +#include +#include +#include +#include #include +#include +#include +#include +#include #include -#include #include -#include #include -#include -#include +#include #include -#include #include -#include #endif /* LIBSBP_TRACKING_MESSAGES_H */ diff --git a/c/include/libsbp/tracking/MSG_MEASUREMENT_STATE.h b/c/include/libsbp/tracking/MSG_MEASUREMENT_STATE.h index a739a42ef..0eb93395d 100644 --- a/c/include/libsbp/tracking/MSG_MEASUREMENT_STATE.h +++ b/c/include/libsbp/tracking/MSG_MEASUREMENT_STATE.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_TRACKING_MSG_MEASUREMENT_STATE_H #define LIBSBP_TRACKING_MSG_MEASUREMENT_STATE_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,73 +41,90 @@ *****************************************************************************/ /** Measurement Engine signal tracking channel states * -* The tracking message returns a variable-length array of tracking channel states. It reports status and carrier-to-noise density measurements for all tracked satellites. + * The tracking message returns a variable-length array of tracking channel + * states. It reports status and carrier-to-noise density measurements for all + * tracked satellites. */ typedef struct { - - /** -* ME signal tracking channel state + * ME signal tracking channel state */ sbp_measurement_state_t states[SBP_MSG_MEASUREMENT_STATE_STATES_MAX]; /** * Number of elements in states * - * When sending a message fill in this field with the number elements set in states before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * states before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in states. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * states. The value of any elements beyond the index specified in this field + * is undefined */ u8 n_states; } sbp_msg_measurement_state_t; - - /** * Get encoded size of an instance of sbp_msg_measurement_state_t * * @param msg sbp_msg_measurement_state_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_measurement_state_encoded_len(const sbp_msg_measurement_state_t *msg) -{ - return SBP_MSG_MEASUREMENT_STATE_ENCODED_OVERHEAD - + (msg->n_states * SBP_MEASUREMENT_STATE_ENCODED_LEN) - ; +static inline size_t sbp_msg_measurement_state_encoded_len( + const sbp_msg_measurement_state_t *msg) { + return SBP_MSG_MEASUREMENT_STATE_ENCODED_OVERHEAD + + (msg->n_states * SBP_MEASUREMENT_STATE_ENCODED_LEN); } /** * Encode an instance of sbp_msg_measurement_state_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_measurement_state_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_measurement_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_measurement_state_t *msg); +SBP_EXPORT s8 +sbp_msg_measurement_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_measurement_state_t *msg); /** * Decode an instance of sbp_msg_measurement_state_t from wire representation * - * This function decodes the wire representation of a sbp_msg_measurement_state_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_measurement_state_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_measurement_state_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_measurement_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_measurement_state_t *msg); +SBP_EXPORT s8 sbp_msg_measurement_state_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_measurement_state_t *msg); /** * Send an instance of sbp_msg_measurement_state_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_measurement_state_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_measurement_state_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -115,51 +132,61 @@ SBP_EXPORT s8 sbp_msg_measurement_state_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_measurement_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_measurement_state_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_measurement_state_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_measurement_state_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_measurement_state_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_measurement_state_t instance * @param b sbp_msg_measurement_state_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_measurement_state_cmp(const sbp_msg_measurement_state_t *a, const sbp_msg_measurement_state_t *b); +SBP_EXPORT int sbp_msg_measurement_state_cmp( + const sbp_msg_measurement_state_t *a, const sbp_msg_measurement_state_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_measurement_state_t &lhs, const sbp_msg_measurement_state_t &rhs) { +static inline bool operator==(const sbp_msg_measurement_state_t &lhs, + const sbp_msg_measurement_state_t &rhs) { return sbp_msg_measurement_state_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_measurement_state_t &lhs, const sbp_msg_measurement_state_t &rhs) { +static inline bool operator!=(const sbp_msg_measurement_state_t &lhs, + const sbp_msg_measurement_state_t &rhs) { return sbp_msg_measurement_state_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_measurement_state_t &lhs, const sbp_msg_measurement_state_t &rhs) { +static inline bool operator<(const sbp_msg_measurement_state_t &lhs, + const sbp_msg_measurement_state_t &rhs) { return sbp_msg_measurement_state_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_measurement_state_t &lhs, const sbp_msg_measurement_state_t &rhs) { +static inline bool operator<=(const sbp_msg_measurement_state_t &lhs, + const sbp_msg_measurement_state_t &rhs) { return sbp_msg_measurement_state_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_measurement_state_t &lhs, const sbp_msg_measurement_state_t &rhs) { +static inline bool operator>(const sbp_msg_measurement_state_t &lhs, + const sbp_msg_measurement_state_t &rhs) { return sbp_msg_measurement_state_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_measurement_state_t &lhs, const sbp_msg_measurement_state_t &rhs) { +static inline bool operator>=(const sbp_msg_measurement_state_t &lhs, + const sbp_msg_measurement_state_t &rhs) { return sbp_msg_measurement_state_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TRACKING_MSG_MEASUREMENT_STATE_H */ - diff --git a/c/include/libsbp/tracking/MSG_TRACKING_IQ.h b/c/include/libsbp/tracking/MSG_TRACKING_IQ.h index 915e6f18b..9197a5f55 100644 --- a/c/include/libsbp/tracking/MSG_TRACKING_IQ.h +++ b/c/include/libsbp/tracking/MSG_TRACKING_IQ.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_TRACKING_MSG_TRACKING_IQ_H #define LIBSBP_TRACKING_MSG_TRACKING_IQ_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,39 +42,34 @@ *****************************************************************************/ /** Tracking channel correlations * -* When enabled, a tracking channel can output the correlations at each update interval. + * When enabled, a tracking channel can output the correlations at each update + * interval. */ typedef struct { - - /** -* Tracking channel of origin + * Tracking channel of origin */ u8 channel; - /** -* GNSS signal identifier + * GNSS signal identifier */ sbp_v4_gnss_signal_t sid; - /** -* Early, Prompt and Late correlations + * Early, Prompt and Late correlations */ sbp_tracking_channel_correlation_t corrs[SBP_MSG_TRACKING_IQ_CORRS_MAX]; } sbp_msg_tracking_iq_t; - - /** * Get encoded size of an instance of sbp_msg_tracking_iq_t * * @param msg sbp_msg_tracking_iq_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_tracking_iq_encoded_len(const sbp_msg_tracking_iq_t *msg) -{ +static inline size_t sbp_msg_tracking_iq_encoded_len( + const sbp_msg_tracking_iq_t *msg) { (void)msg; return SBP_MSG_TRACKING_IQ_ENCODED_LEN; } @@ -82,36 +77,53 @@ static inline size_t sbp_msg_tracking_iq_encoded_len(const sbp_msg_tracking_iq_t /** * Encode an instance of sbp_msg_tracking_iq_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_tracking_iq_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_iq_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_iq_t *msg); +SBP_EXPORT s8 sbp_msg_tracking_iq_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_tracking_iq_t *msg); /** * Decode an instance of sbp_msg_tracking_iq_t from wire representation * - * This function decodes the wire representation of a sbp_msg_tracking_iq_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_tracking_iq_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_tracking_iq_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_iq_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_iq_t *msg); +SBP_EXPORT s8 sbp_msg_tracking_iq_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_tracking_iq_t *msg); /** * Send an instance of sbp_msg_tracking_iq_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_tracking_iq_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_tracking_iq_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -119,51 +131,61 @@ SBP_EXPORT s8 sbp_msg_tracking_iq_decode(const uint8_t *buf, uint8_t len, uint8_ * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_iq_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_iq_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_tracking_iq_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_tracking_iq_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_tracking_iq_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_tracking_iq_t instance * @param b sbp_msg_tracking_iq_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_tracking_iq_cmp(const sbp_msg_tracking_iq_t *a, const sbp_msg_tracking_iq_t *b); +SBP_EXPORT int sbp_msg_tracking_iq_cmp(const sbp_msg_tracking_iq_t *a, + const sbp_msg_tracking_iq_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_tracking_iq_t &lhs, const sbp_msg_tracking_iq_t &rhs) { +static inline bool operator==(const sbp_msg_tracking_iq_t &lhs, + const sbp_msg_tracking_iq_t &rhs) { return sbp_msg_tracking_iq_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_tracking_iq_t &lhs, const sbp_msg_tracking_iq_t &rhs) { +static inline bool operator!=(const sbp_msg_tracking_iq_t &lhs, + const sbp_msg_tracking_iq_t &rhs) { return sbp_msg_tracking_iq_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_tracking_iq_t &lhs, const sbp_msg_tracking_iq_t &rhs) { +static inline bool operator<(const sbp_msg_tracking_iq_t &lhs, + const sbp_msg_tracking_iq_t &rhs) { return sbp_msg_tracking_iq_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_tracking_iq_t &lhs, const sbp_msg_tracking_iq_t &rhs) { +static inline bool operator<=(const sbp_msg_tracking_iq_t &lhs, + const sbp_msg_tracking_iq_t &rhs) { return sbp_msg_tracking_iq_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_tracking_iq_t &lhs, const sbp_msg_tracking_iq_t &rhs) { +static inline bool operator>(const sbp_msg_tracking_iq_t &lhs, + const sbp_msg_tracking_iq_t &rhs) { return sbp_msg_tracking_iq_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_tracking_iq_t &lhs, const sbp_msg_tracking_iq_t &rhs) { +static inline bool operator>=(const sbp_msg_tracking_iq_t &lhs, + const sbp_msg_tracking_iq_t &rhs) { return sbp_msg_tracking_iq_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TRACKING_MSG_TRACKING_IQ_H */ - diff --git a/c/include/libsbp/tracking/MSG_TRACKING_IQ_DEP_A.h b/c/include/libsbp/tracking/MSG_TRACKING_IQ_DEP_A.h index 9a05ae163..4efab05af 100644 --- a/c/include/libsbp/tracking/MSG_TRACKING_IQ_DEP_A.h +++ b/c/include/libsbp/tracking/MSG_TRACKING_IQ_DEP_A.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_TRACKING_MSG_TRACKING_IQ_DEP_A_H #define LIBSBP_TRACKING_MSG_TRACKING_IQ_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,39 +42,34 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Tracking channel of origin + * Tracking channel of origin */ u8 channel; - /** -* GNSS signal identifier + * GNSS signal identifier */ sbp_gnss_signal_dep_t sid; - /** -* Early, Prompt and Late correlations + * Early, Prompt and Late correlations */ - sbp_tracking_channel_correlation_dep_t corrs[SBP_MSG_TRACKING_IQ_DEP_A_CORRS_MAX]; + sbp_tracking_channel_correlation_dep_t + corrs[SBP_MSG_TRACKING_IQ_DEP_A_CORRS_MAX]; } sbp_msg_tracking_iq_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_tracking_iq_dep_a_t * * @param msg sbp_msg_tracking_iq_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_tracking_iq_dep_a_encoded_len(const sbp_msg_tracking_iq_dep_a_t *msg) -{ +static inline size_t sbp_msg_tracking_iq_dep_a_encoded_len( + const sbp_msg_tracking_iq_dep_a_t *msg) { (void)msg; return SBP_MSG_TRACKING_IQ_DEP_A_ENCODED_LEN; } @@ -82,36 +77,53 @@ static inline size_t sbp_msg_tracking_iq_dep_a_encoded_len(const sbp_msg_trackin /** * Encode an instance of sbp_msg_tracking_iq_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_tracking_iq_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_iq_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_iq_dep_a_t *msg); +SBP_EXPORT s8 +sbp_msg_tracking_iq_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_iq_dep_a_t *msg); /** * Decode an instance of sbp_msg_tracking_iq_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_tracking_iq_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_tracking_iq_dep_a_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_tracking_iq_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_iq_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_iq_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_tracking_iq_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_iq_dep_a_t *msg); /** * Send an instance of sbp_msg_tracking_iq_dep_a_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_tracking_iq_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_tracking_iq_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -119,51 +131,61 @@ SBP_EXPORT s8 sbp_msg_tracking_iq_dep_a_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_iq_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_iq_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_tracking_iq_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_iq_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_tracking_iq_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_tracking_iq_dep_a_t instance * @param b sbp_msg_tracking_iq_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_tracking_iq_dep_a_cmp(const sbp_msg_tracking_iq_dep_a_t *a, const sbp_msg_tracking_iq_dep_a_t *b); +SBP_EXPORT int sbp_msg_tracking_iq_dep_a_cmp( + const sbp_msg_tracking_iq_dep_a_t *a, const sbp_msg_tracking_iq_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_tracking_iq_dep_a_t &lhs, const sbp_msg_tracking_iq_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_tracking_iq_dep_a_t &lhs, + const sbp_msg_tracking_iq_dep_a_t &rhs) { return sbp_msg_tracking_iq_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_tracking_iq_dep_a_t &lhs, const sbp_msg_tracking_iq_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_tracking_iq_dep_a_t &lhs, + const sbp_msg_tracking_iq_dep_a_t &rhs) { return sbp_msg_tracking_iq_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_tracking_iq_dep_a_t &lhs, const sbp_msg_tracking_iq_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_tracking_iq_dep_a_t &lhs, + const sbp_msg_tracking_iq_dep_a_t &rhs) { return sbp_msg_tracking_iq_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_tracking_iq_dep_a_t &lhs, const sbp_msg_tracking_iq_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_tracking_iq_dep_a_t &lhs, + const sbp_msg_tracking_iq_dep_a_t &rhs) { return sbp_msg_tracking_iq_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_tracking_iq_dep_a_t &lhs, const sbp_msg_tracking_iq_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_tracking_iq_dep_a_t &lhs, + const sbp_msg_tracking_iq_dep_a_t &rhs) { return sbp_msg_tracking_iq_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_tracking_iq_dep_a_t &lhs, const sbp_msg_tracking_iq_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_tracking_iq_dep_a_t &lhs, + const sbp_msg_tracking_iq_dep_a_t &rhs) { return sbp_msg_tracking_iq_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TRACKING_MSG_TRACKING_IQ_DEP_A_H */ - diff --git a/c/include/libsbp/tracking/MSG_TRACKING_IQ_DEP_B.h b/c/include/libsbp/tracking/MSG_TRACKING_IQ_DEP_B.h index 21093623d..3f7f4a6af 100644 --- a/c/include/libsbp/tracking/MSG_TRACKING_IQ_DEP_B.h +++ b/c/include/libsbp/tracking/MSG_TRACKING_IQ_DEP_B.h @@ -18,21 +18,21 @@ #ifndef LIBSBP_TRACKING_MSG_TRACKING_IQ_DEP_B_H #define LIBSBP_TRACKING_MSG_TRACKING_IQ_DEP_B_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include #include +#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -42,39 +42,34 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Tracking channel of origin + * Tracking channel of origin */ u8 channel; - /** -* GNSS signal identifier + * GNSS signal identifier */ sbp_v4_gnss_signal_t sid; - /** -* Early, Prompt and Late correlations + * Early, Prompt and Late correlations */ - sbp_tracking_channel_correlation_dep_t corrs[SBP_MSG_TRACKING_IQ_DEP_B_CORRS_MAX]; + sbp_tracking_channel_correlation_dep_t + corrs[SBP_MSG_TRACKING_IQ_DEP_B_CORRS_MAX]; } sbp_msg_tracking_iq_dep_b_t; - - /** * Get encoded size of an instance of sbp_msg_tracking_iq_dep_b_t * * @param msg sbp_msg_tracking_iq_dep_b_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_tracking_iq_dep_b_encoded_len(const sbp_msg_tracking_iq_dep_b_t *msg) -{ +static inline size_t sbp_msg_tracking_iq_dep_b_encoded_len( + const sbp_msg_tracking_iq_dep_b_t *msg) { (void)msg; return SBP_MSG_TRACKING_IQ_DEP_B_ENCODED_LEN; } @@ -82,36 +77,53 @@ static inline size_t sbp_msg_tracking_iq_dep_b_encoded_len(const sbp_msg_trackin /** * Encode an instance of sbp_msg_tracking_iq_dep_b_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_tracking_iq_dep_b_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_iq_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_iq_dep_b_t *msg); +SBP_EXPORT s8 +sbp_msg_tracking_iq_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_iq_dep_b_t *msg); /** * Decode an instance of sbp_msg_tracking_iq_dep_b_t from wire representation * - * This function decodes the wire representation of a sbp_msg_tracking_iq_dep_b_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_tracking_iq_dep_b_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_tracking_iq_dep_b_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_iq_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_iq_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_tracking_iq_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_iq_dep_b_t *msg); /** * Send an instance of sbp_msg_tracking_iq_dep_b_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_tracking_iq_dep_b_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_tracking_iq_dep_b_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -119,51 +131,61 @@ SBP_EXPORT s8 sbp_msg_tracking_iq_dep_b_decode(const uint8_t *buf, uint8_t len, * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_iq_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_iq_dep_b_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_tracking_iq_dep_b_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_iq_dep_b_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_tracking_iq_dep_b_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_tracking_iq_dep_b_t instance * @param b sbp_msg_tracking_iq_dep_b_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_tracking_iq_dep_b_cmp(const sbp_msg_tracking_iq_dep_b_t *a, const sbp_msg_tracking_iq_dep_b_t *b); +SBP_EXPORT int sbp_msg_tracking_iq_dep_b_cmp( + const sbp_msg_tracking_iq_dep_b_t *a, const sbp_msg_tracking_iq_dep_b_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_tracking_iq_dep_b_t &lhs, const sbp_msg_tracking_iq_dep_b_t &rhs) { +static inline bool operator==(const sbp_msg_tracking_iq_dep_b_t &lhs, + const sbp_msg_tracking_iq_dep_b_t &rhs) { return sbp_msg_tracking_iq_dep_b_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_tracking_iq_dep_b_t &lhs, const sbp_msg_tracking_iq_dep_b_t &rhs) { +static inline bool operator!=(const sbp_msg_tracking_iq_dep_b_t &lhs, + const sbp_msg_tracking_iq_dep_b_t &rhs) { return sbp_msg_tracking_iq_dep_b_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_tracking_iq_dep_b_t &lhs, const sbp_msg_tracking_iq_dep_b_t &rhs) { +static inline bool operator<(const sbp_msg_tracking_iq_dep_b_t &lhs, + const sbp_msg_tracking_iq_dep_b_t &rhs) { return sbp_msg_tracking_iq_dep_b_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_tracking_iq_dep_b_t &lhs, const sbp_msg_tracking_iq_dep_b_t &rhs) { +static inline bool operator<=(const sbp_msg_tracking_iq_dep_b_t &lhs, + const sbp_msg_tracking_iq_dep_b_t &rhs) { return sbp_msg_tracking_iq_dep_b_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_tracking_iq_dep_b_t &lhs, const sbp_msg_tracking_iq_dep_b_t &rhs) { +static inline bool operator>(const sbp_msg_tracking_iq_dep_b_t &lhs, + const sbp_msg_tracking_iq_dep_b_t &rhs) { return sbp_msg_tracking_iq_dep_b_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_tracking_iq_dep_b_t &lhs, const sbp_msg_tracking_iq_dep_b_t &rhs) { +static inline bool operator>=(const sbp_msg_tracking_iq_dep_b_t &lhs, + const sbp_msg_tracking_iq_dep_b_t &rhs) { return sbp_msg_tracking_iq_dep_b_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TRACKING_MSG_TRACKING_IQ_DEP_B_H */ - diff --git a/c/include/libsbp/tracking/MSG_TRACKING_STATE.h b/c/include/libsbp/tracking/MSG_TRACKING_STATE.h index 7606bec8e..5fcd42f7e 100644 --- a/c/include/libsbp/tracking/MSG_TRACKING_STATE.h +++ b/c/include/libsbp/tracking/MSG_TRACKING_STATE.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_TRACKING_MSG_TRACKING_STATE_H #define LIBSBP_TRACKING_MSG_TRACKING_STATE_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,73 +41,90 @@ *****************************************************************************/ /** Signal tracking channel states * -* The tracking message returns a variable-length array of tracking channel states. It reports status and carrier-to-noise density measurements for all tracked satellites. + * The tracking message returns a variable-length array of tracking channel + * states. It reports status and carrier-to-noise density measurements for all + * tracked satellites. */ typedef struct { - - /** -* Signal tracking channel state + * Signal tracking channel state */ sbp_tracking_channel_state_t states[SBP_MSG_TRACKING_STATE_STATES_MAX]; /** * Number of elements in states * - * When sending a message fill in this field with the number elements set in states before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * states before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in states. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * states. The value of any elements beyond the index specified in this field + * is undefined */ u8 n_states; } sbp_msg_tracking_state_t; - - /** * Get encoded size of an instance of sbp_msg_tracking_state_t * * @param msg sbp_msg_tracking_state_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_tracking_state_encoded_len(const sbp_msg_tracking_state_t *msg) -{ - return SBP_MSG_TRACKING_STATE_ENCODED_OVERHEAD - + (msg->n_states * SBP_TRACKING_CHANNEL_STATE_ENCODED_LEN) - ; +static inline size_t sbp_msg_tracking_state_encoded_len( + const sbp_msg_tracking_state_t *msg) { + return SBP_MSG_TRACKING_STATE_ENCODED_OVERHEAD + + (msg->n_states * SBP_TRACKING_CHANNEL_STATE_ENCODED_LEN); } /** * Encode an instance of sbp_msg_tracking_state_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_tracking_state_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_state_t *msg); +SBP_EXPORT s8 +sbp_msg_tracking_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_state_t *msg); /** * Decode an instance of sbp_msg_tracking_state_t from wire representation * - * This function decodes the wire representation of a sbp_msg_tracking_state_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_tracking_state_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_tracking_state_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_state_t *msg); +SBP_EXPORT s8 sbp_msg_tracking_state_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_tracking_state_t *msg); /** * Send an instance of sbp_msg_tracking_state_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_tracking_state_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_tracking_state_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -115,51 +132,61 @@ SBP_EXPORT s8 sbp_msg_tracking_state_decode(const uint8_t *buf, uint8_t len, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_state_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_tracking_state_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_tracking_state_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_tracking_state_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_tracking_state_t instance * @param b sbp_msg_tracking_state_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_tracking_state_cmp(const sbp_msg_tracking_state_t *a, const sbp_msg_tracking_state_t *b); +SBP_EXPORT int sbp_msg_tracking_state_cmp(const sbp_msg_tracking_state_t *a, + const sbp_msg_tracking_state_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_tracking_state_t &lhs, const sbp_msg_tracking_state_t &rhs) { +static inline bool operator==(const sbp_msg_tracking_state_t &lhs, + const sbp_msg_tracking_state_t &rhs) { return sbp_msg_tracking_state_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_tracking_state_t &lhs, const sbp_msg_tracking_state_t &rhs) { +static inline bool operator!=(const sbp_msg_tracking_state_t &lhs, + const sbp_msg_tracking_state_t &rhs) { return sbp_msg_tracking_state_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_tracking_state_t &lhs, const sbp_msg_tracking_state_t &rhs) { +static inline bool operator<(const sbp_msg_tracking_state_t &lhs, + const sbp_msg_tracking_state_t &rhs) { return sbp_msg_tracking_state_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_tracking_state_t &lhs, const sbp_msg_tracking_state_t &rhs) { +static inline bool operator<=(const sbp_msg_tracking_state_t &lhs, + const sbp_msg_tracking_state_t &rhs) { return sbp_msg_tracking_state_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_tracking_state_t &lhs, const sbp_msg_tracking_state_t &rhs) { +static inline bool operator>(const sbp_msg_tracking_state_t &lhs, + const sbp_msg_tracking_state_t &rhs) { return sbp_msg_tracking_state_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_tracking_state_t &lhs, const sbp_msg_tracking_state_t &rhs) { +static inline bool operator>=(const sbp_msg_tracking_state_t &lhs, + const sbp_msg_tracking_state_t &rhs) { return sbp_msg_tracking_state_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TRACKING_MSG_TRACKING_STATE_H */ - diff --git a/c/include/libsbp/tracking/MSG_TRACKING_STATE_DEP_A.h b/c/include/libsbp/tracking/MSG_TRACKING_STATE_DEP_A.h index ee6aa254d..c04bd1f15 100644 --- a/c/include/libsbp/tracking/MSG_TRACKING_STATE_DEP_A.h +++ b/c/include/libsbp/tracking/MSG_TRACKING_STATE_DEP_A.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_TRACKING_MSG_TRACKING_STATE_DEP_A_H #define LIBSBP_TRACKING_MSG_TRACKING_STATE_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,73 +41,90 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Satellite tracking channel state + * Satellite tracking channel state */ - sbp_tracking_channel_state_dep_a_t states[SBP_MSG_TRACKING_STATE_DEP_A_STATES_MAX]; + sbp_tracking_channel_state_dep_a_t + states[SBP_MSG_TRACKING_STATE_DEP_A_STATES_MAX]; /** * Number of elements in states * - * When sending a message fill in this field with the number elements set in states before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * states before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in states. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * states. The value of any elements beyond the index specified in this field + * is undefined */ u8 n_states; } sbp_msg_tracking_state_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_tracking_state_dep_a_t * * @param msg sbp_msg_tracking_state_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_tracking_state_dep_a_encoded_len(const sbp_msg_tracking_state_dep_a_t *msg) -{ - return SBP_MSG_TRACKING_STATE_DEP_A_ENCODED_OVERHEAD - + (msg->n_states * SBP_TRACKING_CHANNEL_STATE_DEP_A_ENCODED_LEN) - ; +static inline size_t sbp_msg_tracking_state_dep_a_encoded_len( + const sbp_msg_tracking_state_dep_a_t *msg) { + return SBP_MSG_TRACKING_STATE_DEP_A_ENCODED_OVERHEAD + + (msg->n_states * SBP_TRACKING_CHANNEL_STATE_DEP_A_ENCODED_LEN); } /** * Encode an instance of sbp_msg_tracking_state_dep_a_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_tracking_state_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_state_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_state_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_tracking_state_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_state_dep_a_t *msg); /** * Decode an instance of sbp_msg_tracking_state_dep_a_t from wire representation * - * This function decodes the wire representation of a sbp_msg_tracking_state_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_tracking_state_dep_a_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_tracking_state_dep_a_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_state_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_state_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_tracking_state_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_state_dep_a_t *msg); /** - * Send an instance of sbp_msg_tracking_state_dep_a_t with the given write function + * Send an instance of sbp_msg_tracking_state_dep_a_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_tracking_state_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_tracking_state_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -115,51 +132,62 @@ SBP_EXPORT s8 sbp_msg_tracking_state_dep_a_decode(const uint8_t *buf, uint8_t le * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_state_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_state_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_tracking_state_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_state_dep_a_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_tracking_state_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_tracking_state_dep_a_t instance * @param b sbp_msg_tracking_state_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_tracking_state_dep_a_cmp(const sbp_msg_tracking_state_dep_a_t *a, const sbp_msg_tracking_state_dep_a_t *b); +SBP_EXPORT int sbp_msg_tracking_state_dep_a_cmp( + const sbp_msg_tracking_state_dep_a_t *a, + const sbp_msg_tracking_state_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_tracking_state_dep_a_t &lhs, const sbp_msg_tracking_state_dep_a_t &rhs) { +static inline bool operator==(const sbp_msg_tracking_state_dep_a_t &lhs, + const sbp_msg_tracking_state_dep_a_t &rhs) { return sbp_msg_tracking_state_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_tracking_state_dep_a_t &lhs, const sbp_msg_tracking_state_dep_a_t &rhs) { +static inline bool operator!=(const sbp_msg_tracking_state_dep_a_t &lhs, + const sbp_msg_tracking_state_dep_a_t &rhs) { return sbp_msg_tracking_state_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_tracking_state_dep_a_t &lhs, const sbp_msg_tracking_state_dep_a_t &rhs) { +static inline bool operator<(const sbp_msg_tracking_state_dep_a_t &lhs, + const sbp_msg_tracking_state_dep_a_t &rhs) { return sbp_msg_tracking_state_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_tracking_state_dep_a_t &lhs, const sbp_msg_tracking_state_dep_a_t &rhs) { +static inline bool operator<=(const sbp_msg_tracking_state_dep_a_t &lhs, + const sbp_msg_tracking_state_dep_a_t &rhs) { return sbp_msg_tracking_state_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_tracking_state_dep_a_t &lhs, const sbp_msg_tracking_state_dep_a_t &rhs) { +static inline bool operator>(const sbp_msg_tracking_state_dep_a_t &lhs, + const sbp_msg_tracking_state_dep_a_t &rhs) { return sbp_msg_tracking_state_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_tracking_state_dep_a_t &lhs, const sbp_msg_tracking_state_dep_a_t &rhs) { +static inline bool operator>=(const sbp_msg_tracking_state_dep_a_t &lhs, + const sbp_msg_tracking_state_dep_a_t &rhs) { return sbp_msg_tracking_state_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TRACKING_MSG_TRACKING_STATE_DEP_A_H */ - diff --git a/c/include/libsbp/tracking/MSG_TRACKING_STATE_DEP_B.h b/c/include/libsbp/tracking/MSG_TRACKING_STATE_DEP_B.h index 06fd9ae5a..abb71c8c7 100644 --- a/c/include/libsbp/tracking/MSG_TRACKING_STATE_DEP_B.h +++ b/c/include/libsbp/tracking/MSG_TRACKING_STATE_DEP_B.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_TRACKING_MSG_TRACKING_STATE_DEP_B_H #define LIBSBP_TRACKING_MSG_TRACKING_STATE_DEP_B_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,73 +41,90 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Signal tracking channel state + * Signal tracking channel state */ - sbp_tracking_channel_state_dep_b_t states[SBP_MSG_TRACKING_STATE_DEP_B_STATES_MAX]; + sbp_tracking_channel_state_dep_b_t + states[SBP_MSG_TRACKING_STATE_DEP_B_STATES_MAX]; /** * Number of elements in states * - * When sending a message fill in this field with the number elements set in states before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * states before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in states. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * states. The value of any elements beyond the index specified in this field + * is undefined */ u8 n_states; } sbp_msg_tracking_state_dep_b_t; - - /** * Get encoded size of an instance of sbp_msg_tracking_state_dep_b_t * * @param msg sbp_msg_tracking_state_dep_b_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_tracking_state_dep_b_encoded_len(const sbp_msg_tracking_state_dep_b_t *msg) -{ - return SBP_MSG_TRACKING_STATE_DEP_B_ENCODED_OVERHEAD - + (msg->n_states * SBP_TRACKING_CHANNEL_STATE_DEP_B_ENCODED_LEN) - ; +static inline size_t sbp_msg_tracking_state_dep_b_encoded_len( + const sbp_msg_tracking_state_dep_b_t *msg) { + return SBP_MSG_TRACKING_STATE_DEP_B_ENCODED_OVERHEAD + + (msg->n_states * SBP_TRACKING_CHANNEL_STATE_DEP_B_ENCODED_LEN); } /** * Encode an instance of sbp_msg_tracking_state_dep_b_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_tracking_state_dep_b_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_state_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_state_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_tracking_state_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_state_dep_b_t *msg); /** * Decode an instance of sbp_msg_tracking_state_dep_b_t from wire representation * - * This function decodes the wire representation of a sbp_msg_tracking_state_dep_b_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_tracking_state_dep_b_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_tracking_state_dep_b_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_state_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_state_dep_b_t *msg); +SBP_EXPORT s8 sbp_msg_tracking_state_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_state_dep_b_t *msg); /** - * Send an instance of sbp_msg_tracking_state_dep_b_t with the given write function + * Send an instance of sbp_msg_tracking_state_dep_b_t with the given write + * function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_tracking_state_dep_b_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_tracking_state_dep_b_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -115,51 +132,62 @@ SBP_EXPORT s8 sbp_msg_tracking_state_dep_b_decode(const uint8_t *buf, uint8_t le * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_state_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_state_dep_b_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_tracking_state_dep_b_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_state_dep_b_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_tracking_state_dep_b_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_tracking_state_dep_b_t instance * @param b sbp_msg_tracking_state_dep_b_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_tracking_state_dep_b_cmp(const sbp_msg_tracking_state_dep_b_t *a, const sbp_msg_tracking_state_dep_b_t *b); +SBP_EXPORT int sbp_msg_tracking_state_dep_b_cmp( + const sbp_msg_tracking_state_dep_b_t *a, + const sbp_msg_tracking_state_dep_b_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_tracking_state_dep_b_t &lhs, const sbp_msg_tracking_state_dep_b_t &rhs) { +static inline bool operator==(const sbp_msg_tracking_state_dep_b_t &lhs, + const sbp_msg_tracking_state_dep_b_t &rhs) { return sbp_msg_tracking_state_dep_b_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_tracking_state_dep_b_t &lhs, const sbp_msg_tracking_state_dep_b_t &rhs) { +static inline bool operator!=(const sbp_msg_tracking_state_dep_b_t &lhs, + const sbp_msg_tracking_state_dep_b_t &rhs) { return sbp_msg_tracking_state_dep_b_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_tracking_state_dep_b_t &lhs, const sbp_msg_tracking_state_dep_b_t &rhs) { +static inline bool operator<(const sbp_msg_tracking_state_dep_b_t &lhs, + const sbp_msg_tracking_state_dep_b_t &rhs) { return sbp_msg_tracking_state_dep_b_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_tracking_state_dep_b_t &lhs, const sbp_msg_tracking_state_dep_b_t &rhs) { +static inline bool operator<=(const sbp_msg_tracking_state_dep_b_t &lhs, + const sbp_msg_tracking_state_dep_b_t &rhs) { return sbp_msg_tracking_state_dep_b_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_tracking_state_dep_b_t &lhs, const sbp_msg_tracking_state_dep_b_t &rhs) { +static inline bool operator>(const sbp_msg_tracking_state_dep_b_t &lhs, + const sbp_msg_tracking_state_dep_b_t &rhs) { return sbp_msg_tracking_state_dep_b_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_tracking_state_dep_b_t &lhs, const sbp_msg_tracking_state_dep_b_t &rhs) { +static inline bool operator>=(const sbp_msg_tracking_state_dep_b_t &lhs, + const sbp_msg_tracking_state_dep_b_t &rhs) { return sbp_msg_tracking_state_dep_b_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TRACKING_MSG_TRACKING_STATE_DEP_B_H */ - diff --git a/c/include/libsbp/tracking/MSG_TRACKING_STATE_DETAILED_DEP.h b/c/include/libsbp/tracking/MSG_TRACKING_STATE_DETAILED_DEP.h index 52445f8d2..8ace27591 100644 --- a/c/include/libsbp/tracking/MSG_TRACKING_STATE_DETAILED_DEP.h +++ b/c/include/libsbp/tracking/MSG_TRACKING_STATE_DETAILED_DEP.h @@ -18,22 +18,22 @@ #ifndef LIBSBP_TRACKING_MSG_TRACKING_STATE_DETAILED_DEP_H #define LIBSBP_TRACKING_MSG_TRACKING_STATE_DETAILED_DEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -43,184 +43,191 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Receiver clock time. [ns] + * Receiver clock time. [ns] */ u64 recv_time; - /** - * Time of transmission of signal from satellite. TOW only valid when TOW status is decoded or propagated. WN only valid when week number valid flag is set. + * Time of transmission of signal from satellite. TOW only valid when TOW + * status is decoded or propagated. WN only valid when week number valid flag + * is set. */ sbp_gps_time_dep_t tot; - /** - * Pseudorange observation. Valid only when pseudorange valid flag is set. [2 cm] + * Pseudorange observation. Valid only when pseudorange valid flag is set. [2 + * cm] */ u32 P; - /** - * Pseudorange observation standard deviation. Valid only when pseudorange valid flag is set. [2 cm] + * Pseudorange observation standard deviation. Valid only when pseudorange + * valid flag is set. [2 cm] */ u16 P_std; - /** - * Carrier phase observation with typical sign convention. Valid only when PLL pessimistic lock is achieved. [cycles] + * Carrier phase observation with typical sign convention. Valid only when PLL + * pessimistic lock is achieved. [cycles] */ sbp_carrier_phase_t L; - /** -* Carrier-to-Noise density [dB Hz / 4] + * Carrier-to-Noise density [dB Hz / 4] */ u8 cn0; - /** - * Lock time. It is encoded according to DF402 from the RTCM 10403.2 Amendment 2 specification. Valid values range from 0 to 15. + * Lock time. It is encoded according to DF402 from the RTCM 10403.2 Amendment + * 2 specification. Valid values range from 0 to 15. */ u16 lock; - /** -* GNSS signal identifier. + * GNSS signal identifier. */ sbp_gnss_signal_dep_t sid; - /** -* Carrier Doppler frequency. [Hz / 16] + * Carrier Doppler frequency. [Hz / 16] */ s32 doppler; - /** -* Carrier Doppler frequency standard deviation. [Hz / 16] + * Carrier Doppler frequency standard deviation. [Hz / 16] */ u16 doppler_std; - /** - * Number of seconds of continuous tracking. Specifies how much time signal is in continuous track. [s] + * Number of seconds of continuous tracking. Specifies how much time signal is + * in continuous track. [s] */ u32 uptime; - /** - * TCXO clock offset. Valid only when valid clock valid flag is set. [s / (2 ^ 20)] + * TCXO clock offset. Valid only when valid clock valid flag is set. [s / (2 ^ + * 20)] */ s16 clock_offset; - /** - * TCXO clock drift. Valid only when valid clock valid flag is set. [(s / s) / (2 ^ 31)] + * TCXO clock drift. Valid only when valid clock valid flag is set. [(s / s) / + * (2 ^ 31)] */ s16 clock_drift; - /** -* Early-Prompt (EP) and Prompt-Late (PL) correlators spacing. [ns] + * Early-Prompt (EP) and Prompt-Late (PL) correlators spacing. [ns] */ u16 corr_spacing; - /** -* Acceleration. Valid only when acceleration valid flag is set. [g / 8] + * Acceleration. Valid only when acceleration valid flag is set. [g / 8] */ s8 acceleration; - /** -* Synchronization status flags. + * Synchronization status flags. */ u8 sync_flags; - /** -* TOW status flags. + * TOW status flags. */ u8 tow_flags; - /** -* Tracking loop status flags. + * Tracking loop status flags. */ u8 track_flags; - /** -* Navigation data status flags. + * Navigation data status flags. */ u8 nav_flags; - /** -* Parameters sets flags. + * Parameters sets flags. */ u8 pset_flags; - /** -* Miscellaneous flags. + * Miscellaneous flags. */ u8 misc_flags; } sbp_msg_tracking_state_detailed_dep_t; - - /** * Get encoded size of an instance of sbp_msg_tracking_state_detailed_dep_t * * @param msg sbp_msg_tracking_state_detailed_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_tracking_state_detailed_dep_encoded_len(const sbp_msg_tracking_state_detailed_dep_t *msg) -{ +static inline size_t sbp_msg_tracking_state_detailed_dep_encoded_len( + const sbp_msg_tracking_state_detailed_dep_t *msg) { (void)msg; return SBP_MSG_TRACKING_STATE_DETAILED_DEP_ENCODED_LEN; } /** - * Encode an instance of sbp_msg_tracking_state_detailed_dep_t to wire representation + * Encode an instance of sbp_msg_tracking_state_detailed_dep_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_tracking_state_detailed_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_state_detailed_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_state_detailed_dep_t *msg); +SBP_EXPORT s8 sbp_msg_tracking_state_detailed_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_state_detailed_dep_t *msg); /** - * Decode an instance of sbp_msg_tracking_state_detailed_dep_t from wire representation + * Decode an instance of sbp_msg_tracking_state_detailed_dep_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_tracking_state_detailed_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_tracking_state_detailed_dep_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_tracking_state_detailed_dep_t instance + * @param buf Wire representation of the sbp_msg_tracking_state_detailed_dep_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_state_detailed_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_state_detailed_dep_t *msg); +SBP_EXPORT s8 sbp_msg_tracking_state_detailed_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_state_detailed_dep_t *msg); /** - * Send an instance of sbp_msg_tracking_state_detailed_dep_t with the given write function + * Send an instance of sbp_msg_tracking_state_detailed_dep_t with the given + * write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_tracking_state_detailed_dep_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_tracking_state_detailed_dep_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -228,51 +235,66 @@ SBP_EXPORT s8 sbp_msg_tracking_state_detailed_dep_decode(const uint8_t *buf, uin * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_state_detailed_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_state_detailed_dep_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_tracking_state_detailed_dep_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_tracking_state_detailed_dep_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_tracking_state_detailed_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_tracking_state_detailed_dep_t instance * @param b sbp_msg_tracking_state_detailed_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_tracking_state_detailed_dep_cmp(const sbp_msg_tracking_state_detailed_dep_t *a, const sbp_msg_tracking_state_detailed_dep_t *b); +SBP_EXPORT int sbp_msg_tracking_state_detailed_dep_cmp( + const sbp_msg_tracking_state_detailed_dep_t *a, + const sbp_msg_tracking_state_detailed_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_tracking_state_detailed_dep_t &lhs, const sbp_msg_tracking_state_detailed_dep_t &rhs) { +static inline bool operator==( + const sbp_msg_tracking_state_detailed_dep_t &lhs, + const sbp_msg_tracking_state_detailed_dep_t &rhs) { return sbp_msg_tracking_state_detailed_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_tracking_state_detailed_dep_t &lhs, const sbp_msg_tracking_state_detailed_dep_t &rhs) { +static inline bool operator!=( + const sbp_msg_tracking_state_detailed_dep_t &lhs, + const sbp_msg_tracking_state_detailed_dep_t &rhs) { return sbp_msg_tracking_state_detailed_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_tracking_state_detailed_dep_t &lhs, const sbp_msg_tracking_state_detailed_dep_t &rhs) { +static inline bool operator<(const sbp_msg_tracking_state_detailed_dep_t &lhs, + const sbp_msg_tracking_state_detailed_dep_t &rhs) { return sbp_msg_tracking_state_detailed_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_tracking_state_detailed_dep_t &lhs, const sbp_msg_tracking_state_detailed_dep_t &rhs) { +static inline bool operator<=( + const sbp_msg_tracking_state_detailed_dep_t &lhs, + const sbp_msg_tracking_state_detailed_dep_t &rhs) { return sbp_msg_tracking_state_detailed_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_tracking_state_detailed_dep_t &lhs, const sbp_msg_tracking_state_detailed_dep_t &rhs) { +static inline bool operator>(const sbp_msg_tracking_state_detailed_dep_t &lhs, + const sbp_msg_tracking_state_detailed_dep_t &rhs) { return sbp_msg_tracking_state_detailed_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_tracking_state_detailed_dep_t &lhs, const sbp_msg_tracking_state_detailed_dep_t &rhs) { +static inline bool operator>=( + const sbp_msg_tracking_state_detailed_dep_t &lhs, + const sbp_msg_tracking_state_detailed_dep_t &rhs) { return sbp_msg_tracking_state_detailed_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TRACKING_MSG_TRACKING_STATE_DETAILED_DEP_H */ - diff --git a/c/include/libsbp/tracking/MSG_TRACKING_STATE_DETAILED_DEP_A.h b/c/include/libsbp/tracking/MSG_TRACKING_STATE_DETAILED_DEP_A.h index 31cbce213..1e2787393 100644 --- a/c/include/libsbp/tracking/MSG_TRACKING_STATE_DETAILED_DEP_A.h +++ b/c/include/libsbp/tracking/MSG_TRACKING_STATE_DETAILED_DEP_A.h @@ -18,22 +18,22 @@ #ifndef LIBSBP_TRACKING_MSG_TRACKING_STATE_DETAILED_DEP_A_H #define LIBSBP_TRACKING_MSG_TRACKING_STATE_DETAILED_DEP_A_H +#include +#include #include #include -#include -#include #include -#include +#include #include -#include -#include -#include #include +#include #include +#include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -43,184 +43,192 @@ *****************************************************************************/ /** Detailed signal tracking channel states. DEPRECATED * -* The tracking message returns a set tracking channel parameters for a single tracking channel useful for debugging issues. + * The tracking message returns a set tracking channel parameters for a single + * tracking channel useful for debugging issues. */ typedef struct { - - /** -* Receiver clock time. [ns] + * Receiver clock time. [ns] */ u64 recv_time; - /** - * Time of transmission of signal from satellite. TOW only valid when TOW status is decoded or propagated. WN only valid when week number valid flag is set. + * Time of transmission of signal from satellite. TOW only valid when TOW + * status is decoded or propagated. WN only valid when week number valid flag + * is set. */ sbp_v4_gps_time_t tot; - /** - * Pseudorange observation. Valid only when pseudorange valid flag is set. [2 cm] + * Pseudorange observation. Valid only when pseudorange valid flag is set. [2 + * cm] */ u32 P; - /** - * Pseudorange observation standard deviation. Valid only when pseudorange valid flag is set. [2 cm] + * Pseudorange observation standard deviation. Valid only when pseudorange + * valid flag is set. [2 cm] */ u16 P_std; - /** - * Carrier phase observation with typical sign convention. Valid only when PLL pessimistic lock is achieved. [cycles] + * Carrier phase observation with typical sign convention. Valid only when PLL + * pessimistic lock is achieved. [cycles] */ sbp_carrier_phase_t L; - /** -* Carrier-to-Noise density [dB Hz / 4] + * Carrier-to-Noise density [dB Hz / 4] */ u8 cn0; - /** - * Lock time. It is encoded according to DF402 from the RTCM 10403.2 Amendment 2 specification. Valid values range from 0 to 15. + * Lock time. It is encoded according to DF402 from the RTCM 10403.2 Amendment + * 2 specification. Valid values range from 0 to 15. */ u16 lock; - /** -* GNSS signal identifier. + * GNSS signal identifier. */ sbp_v4_gnss_signal_t sid; - /** -* Carrier Doppler frequency. [Hz / 16] + * Carrier Doppler frequency. [Hz / 16] */ s32 doppler; - /** -* Carrier Doppler frequency standard deviation. [Hz / 16] + * Carrier Doppler frequency standard deviation. [Hz / 16] */ u16 doppler_std; - /** - * Number of seconds of continuous tracking. Specifies how much time signal is in continuous track. [s] + * Number of seconds of continuous tracking. Specifies how much time signal is + * in continuous track. [s] */ u32 uptime; - /** - * TCXO clock offset. Valid only when valid clock valid flag is set. [s / (2 ^ 20)] + * TCXO clock offset. Valid only when valid clock valid flag is set. [s / (2 ^ + * 20)] */ s16 clock_offset; - /** - * TCXO clock drift. Valid only when valid clock valid flag is set. [(s / s) / (2 ^ 31)] + * TCXO clock drift. Valid only when valid clock valid flag is set. [(s / s) / + * (2 ^ 31)] */ s16 clock_drift; - /** -* Early-Prompt (EP) and Prompt-Late (PL) correlators spacing. [ns] + * Early-Prompt (EP) and Prompt-Late (PL) correlators spacing. [ns] */ u16 corr_spacing; - /** -* Acceleration. Valid only when acceleration valid flag is set. [g / 8] + * Acceleration. Valid only when acceleration valid flag is set. [g / 8] */ s8 acceleration; - /** -* Synchronization status flags. + * Synchronization status flags. */ u8 sync_flags; - /** -* TOW status flags. + * TOW status flags. */ u8 tow_flags; - /** -* Tracking loop status flags. + * Tracking loop status flags. */ u8 track_flags; - /** -* Navigation data status flags. + * Navigation data status flags. */ u8 nav_flags; - /** -* Parameters sets flags. + * Parameters sets flags. */ u8 pset_flags; - /** -* Miscellaneous flags. + * Miscellaneous flags. */ u8 misc_flags; } sbp_msg_tracking_state_detailed_dep_a_t; - - /** * Get encoded size of an instance of sbp_msg_tracking_state_detailed_dep_a_t * * @param msg sbp_msg_tracking_state_detailed_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_tracking_state_detailed_dep_a_encoded_len(const sbp_msg_tracking_state_detailed_dep_a_t *msg) -{ +static inline size_t sbp_msg_tracking_state_detailed_dep_a_encoded_len( + const sbp_msg_tracking_state_detailed_dep_a_t *msg) { (void)msg; return SBP_MSG_TRACKING_STATE_DETAILED_DEP_A_ENCODED_LEN; } /** - * Encode an instance of sbp_msg_tracking_state_detailed_dep_a_t to wire representation + * Encode an instance of sbp_msg_tracking_state_detailed_dep_a_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_tracking_state_detailed_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_state_detailed_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_state_detailed_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_tracking_state_detailed_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_state_detailed_dep_a_t *msg); /** - * Decode an instance of sbp_msg_tracking_state_detailed_dep_a_t from wire representation + * Decode an instance of sbp_msg_tracking_state_detailed_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_msg_tracking_state_detailed_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_msg_tracking_state_detailed_dep_a_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_msg_tracking_state_detailed_dep_a_t instance + * @param buf Wire representation of the sbp_msg_tracking_state_detailed_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_state_detailed_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_state_detailed_dep_a_t *msg); +SBP_EXPORT s8 sbp_msg_tracking_state_detailed_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_state_detailed_dep_a_t *msg); /** - * Send an instance of sbp_msg_tracking_state_detailed_dep_a_t with the given write function + * Send an instance of sbp_msg_tracking_state_detailed_dep_a_t with the given + * write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_tracking_state_detailed_dep_a_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_tracking_state_detailed_dep_a_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -228,51 +236,68 @@ SBP_EXPORT s8 sbp_msg_tracking_state_detailed_dep_a_decode(const uint8_t *buf, u * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_tracking_state_detailed_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_state_detailed_dep_a_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_tracking_state_detailed_dep_a_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_tracking_state_detailed_dep_a_t *msg, sbp_write_fn_t write); /** * Compare two instances of sbp_msg_tracking_state_detailed_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_tracking_state_detailed_dep_a_t instance * @param b sbp_msg_tracking_state_detailed_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_tracking_state_detailed_dep_a_cmp(const sbp_msg_tracking_state_detailed_dep_a_t *a, const sbp_msg_tracking_state_detailed_dep_a_t *b); +SBP_EXPORT int sbp_msg_tracking_state_detailed_dep_a_cmp( + const sbp_msg_tracking_state_detailed_dep_a_t *a, + const sbp_msg_tracking_state_detailed_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_tracking_state_detailed_dep_a_t &lhs, const sbp_msg_tracking_state_detailed_dep_a_t &rhs) { +static inline bool operator==( + const sbp_msg_tracking_state_detailed_dep_a_t &lhs, + const sbp_msg_tracking_state_detailed_dep_a_t &rhs) { return sbp_msg_tracking_state_detailed_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_tracking_state_detailed_dep_a_t &lhs, const sbp_msg_tracking_state_detailed_dep_a_t &rhs) { +static inline bool operator!=( + const sbp_msg_tracking_state_detailed_dep_a_t &lhs, + const sbp_msg_tracking_state_detailed_dep_a_t &rhs) { return sbp_msg_tracking_state_detailed_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_tracking_state_detailed_dep_a_t &lhs, const sbp_msg_tracking_state_detailed_dep_a_t &rhs) { +static inline bool operator<( + const sbp_msg_tracking_state_detailed_dep_a_t &lhs, + const sbp_msg_tracking_state_detailed_dep_a_t &rhs) { return sbp_msg_tracking_state_detailed_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_tracking_state_detailed_dep_a_t &lhs, const sbp_msg_tracking_state_detailed_dep_a_t &rhs) { +static inline bool operator<=( + const sbp_msg_tracking_state_detailed_dep_a_t &lhs, + const sbp_msg_tracking_state_detailed_dep_a_t &rhs) { return sbp_msg_tracking_state_detailed_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_tracking_state_detailed_dep_a_t &lhs, const sbp_msg_tracking_state_detailed_dep_a_t &rhs) { +static inline bool operator>( + const sbp_msg_tracking_state_detailed_dep_a_t &lhs, + const sbp_msg_tracking_state_detailed_dep_a_t &rhs) { return sbp_msg_tracking_state_detailed_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_tracking_state_detailed_dep_a_t &lhs, const sbp_msg_tracking_state_detailed_dep_a_t &rhs) { +static inline bool operator>=( + const sbp_msg_tracking_state_detailed_dep_a_t &lhs, + const sbp_msg_tracking_state_detailed_dep_a_t &rhs) { return sbp_msg_tracking_state_detailed_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TRACKING_MSG_TRACKING_STATE_DETAILED_DEP_A_H */ - diff --git a/c/include/libsbp/tracking/MeasurementState.h b/c/include/libsbp/tracking/MeasurementState.h index 665ca04cf..bc6f91bd4 100644 --- a/c/include/libsbp/tracking/MeasurementState.h +++ b/c/include/libsbp/tracking/MeasurementState.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_TRACKING_MEASUREMENTSTATE_H #define LIBSBP_TRACKING_MEASUREMENTSTATE_H +#include +#include #include #include -#include -#include #include -#include +#include #include +#include #include #include -#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,33 +41,31 @@ *****************************************************************************/ /** Measurement Engine signal tracking channel state * -* Measurement Engine tracking channel state for a specific satellite signal and measured signal power. The mesid field for Glonass can either carry the FCN as 100 + FCN where FCN is in [-7, +6] or the Slot ID (from 1 to 28). + * Measurement Engine tracking channel state for a specific satellite signal and + * measured signal power. The mesid field for Glonass can either carry the FCN + * as 100 + FCN where FCN is in [-7, +6] or the Slot ID (from 1 to 28). */ typedef struct { - - /** -* Measurement Engine GNSS signal being tracked (carries either Glonass FCN or SLOT) + * Measurement Engine GNSS signal being tracked (carries either Glonass FCN or + * SLOT) */ sbp_v4_gnss_signal_t mesid; - /** -* Carrier-to-Noise density. Zero implies invalid cn0. [dB Hz / 4] + * Carrier-to-Noise density. Zero implies invalid cn0. [dB Hz / 4] */ u8 cn0; } sbp_measurement_state_t; - - /** * Get encoded size of an instance of sbp_measurement_state_t * * @param msg sbp_measurement_state_t instance * @return Length of on-wire representation */ -static inline size_t sbp_measurement_state_encoded_len(const sbp_measurement_state_t *msg) -{ +static inline size_t sbp_measurement_state_encoded_len( + const sbp_measurement_state_t *msg) { (void)msg; return SBP_MEASUREMENT_STATE_ENCODED_LEN; } @@ -75,74 +73,96 @@ static inline size_t sbp_measurement_state_encoded_len(const sbp_measurement_sta /** * Encode an instance of sbp_measurement_state_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_measurement_state_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_measurement_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_measurement_state_t *msg); +SBP_EXPORT s8 sbp_measurement_state_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_measurement_state_t *msg); /** * Decode an instance of sbp_measurement_state_t from wire representation * - * This function decodes the wire representation of a sbp_measurement_state_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_measurement_state_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_measurement_state_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_measurement_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_measurement_state_t *msg); +SBP_EXPORT s8 sbp_measurement_state_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_measurement_state_t *msg); /** * Compare two instances of sbp_measurement_state_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_measurement_state_t instance * @param b sbp_measurement_state_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_measurement_state_cmp(const sbp_measurement_state_t *a, const sbp_measurement_state_t *b); +SBP_EXPORT int sbp_measurement_state_cmp(const sbp_measurement_state_t *a, + const sbp_measurement_state_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_measurement_state_t &lhs, const sbp_measurement_state_t &rhs) { +static inline bool operator==(const sbp_measurement_state_t &lhs, + const sbp_measurement_state_t &rhs) { return sbp_measurement_state_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_measurement_state_t &lhs, const sbp_measurement_state_t &rhs) { +static inline bool operator!=(const sbp_measurement_state_t &lhs, + const sbp_measurement_state_t &rhs) { return sbp_measurement_state_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_measurement_state_t &lhs, const sbp_measurement_state_t &rhs) { +static inline bool operator<(const sbp_measurement_state_t &lhs, + const sbp_measurement_state_t &rhs) { return sbp_measurement_state_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_measurement_state_t &lhs, const sbp_measurement_state_t &rhs) { +static inline bool operator<=(const sbp_measurement_state_t &lhs, + const sbp_measurement_state_t &rhs) { return sbp_measurement_state_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_measurement_state_t &lhs, const sbp_measurement_state_t &rhs) { +static inline bool operator>(const sbp_measurement_state_t &lhs, + const sbp_measurement_state_t &rhs) { return sbp_measurement_state_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_measurement_state_t &lhs, const sbp_measurement_state_t &rhs) { +static inline bool operator>=(const sbp_measurement_state_t &lhs, + const sbp_measurement_state_t &rhs) { return sbp_measurement_state_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TRACKING_MEASUREMENTSTATE_H */ - diff --git a/c/include/libsbp/tracking/TrackingChannelCorrelation.h b/c/include/libsbp/tracking/TrackingChannelCorrelation.h index 010ea419e..3d7dba07c 100644 --- a/c/include/libsbp/tracking/TrackingChannelCorrelation.h +++ b/c/include/libsbp/tracking/TrackingChannelCorrelation.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_TRACKING_TRACKINGCHANNELCORRELATION_H #define LIBSBP_TRACKING_TRACKINGCHANNELCORRELATION_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,108 +40,129 @@ *****************************************************************************/ /** Complex correlation structure * -* Structure containing in-phase and quadrature correlation components. + * Structure containing in-phase and quadrature correlation components. */ typedef struct { - - /** -* In-phase correlation + * In-phase correlation */ s16 I; - /** -* Quadrature correlation + * Quadrature correlation */ s16 Q; } sbp_tracking_channel_correlation_t; - - /** * Get encoded size of an instance of sbp_tracking_channel_correlation_t * * @param msg sbp_tracking_channel_correlation_t instance * @return Length of on-wire representation */ -static inline size_t sbp_tracking_channel_correlation_encoded_len(const sbp_tracking_channel_correlation_t *msg) -{ +static inline size_t sbp_tracking_channel_correlation_encoded_len( + const sbp_tracking_channel_correlation_t *msg) { (void)msg; return SBP_TRACKING_CHANNEL_CORRELATION_ENCODED_LEN; } /** - * Encode an instance of sbp_tracking_channel_correlation_t to wire representation + * Encode an instance of sbp_tracking_channel_correlation_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_tracking_channel_correlation_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_tracking_channel_correlation_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_tracking_channel_correlation_t *msg); +SBP_EXPORT s8 sbp_tracking_channel_correlation_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_tracking_channel_correlation_t *msg); /** - * Decode an instance of sbp_tracking_channel_correlation_t from wire representation + * Decode an instance of sbp_tracking_channel_correlation_t from wire + * representation * - * This function decodes the wire representation of a sbp_tracking_channel_correlation_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_tracking_channel_correlation_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_tracking_channel_correlation_t instance + * @param buf Wire representation of the sbp_tracking_channel_correlation_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_tracking_channel_correlation_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_tracking_channel_correlation_t *msg); +SBP_EXPORT s8 sbp_tracking_channel_correlation_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_tracking_channel_correlation_t *msg); /** * Compare two instances of sbp_tracking_channel_correlation_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_tracking_channel_correlation_t instance * @param b sbp_tracking_channel_correlation_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_tracking_channel_correlation_cmp(const sbp_tracking_channel_correlation_t *a, const sbp_tracking_channel_correlation_t *b); +SBP_EXPORT int sbp_tracking_channel_correlation_cmp( + const sbp_tracking_channel_correlation_t *a, + const sbp_tracking_channel_correlation_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_tracking_channel_correlation_t &lhs, const sbp_tracking_channel_correlation_t &rhs) { +static inline bool operator==(const sbp_tracking_channel_correlation_t &lhs, + const sbp_tracking_channel_correlation_t &rhs) { return sbp_tracking_channel_correlation_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_tracking_channel_correlation_t &lhs, const sbp_tracking_channel_correlation_t &rhs) { +static inline bool operator!=(const sbp_tracking_channel_correlation_t &lhs, + const sbp_tracking_channel_correlation_t &rhs) { return sbp_tracking_channel_correlation_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_tracking_channel_correlation_t &lhs, const sbp_tracking_channel_correlation_t &rhs) { +static inline bool operator<(const sbp_tracking_channel_correlation_t &lhs, + const sbp_tracking_channel_correlation_t &rhs) { return sbp_tracking_channel_correlation_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_tracking_channel_correlation_t &lhs, const sbp_tracking_channel_correlation_t &rhs) { +static inline bool operator<=(const sbp_tracking_channel_correlation_t &lhs, + const sbp_tracking_channel_correlation_t &rhs) { return sbp_tracking_channel_correlation_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_tracking_channel_correlation_t &lhs, const sbp_tracking_channel_correlation_t &rhs) { +static inline bool operator>(const sbp_tracking_channel_correlation_t &lhs, + const sbp_tracking_channel_correlation_t &rhs) { return sbp_tracking_channel_correlation_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_tracking_channel_correlation_t &lhs, const sbp_tracking_channel_correlation_t &rhs) { +static inline bool operator>=(const sbp_tracking_channel_correlation_t &lhs, + const sbp_tracking_channel_correlation_t &rhs) { return sbp_tracking_channel_correlation_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TRACKING_TRACKINGCHANNELCORRELATION_H */ - diff --git a/c/include/libsbp/tracking/TrackingChannelCorrelationDep.h b/c/include/libsbp/tracking/TrackingChannelCorrelationDep.h index 9e87f9aaa..056b5af80 100644 --- a/c/include/libsbp/tracking/TrackingChannelCorrelationDep.h +++ b/c/include/libsbp/tracking/TrackingChannelCorrelationDep.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_TRACKING_TRACKINGCHANNELCORRELATIONDEP_H #define LIBSBP_TRACKING_TRACKINGCHANNELCORRELATIONDEP_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,108 +40,136 @@ *****************************************************************************/ /** Complex correlation structure * -* Structure containing in-phase and quadrature correlation components. + * Structure containing in-phase and quadrature correlation components. */ typedef struct { - - /** -* In-phase correlation + * In-phase correlation */ s32 I; - /** -* Quadrature correlation + * Quadrature correlation */ s32 Q; } sbp_tracking_channel_correlation_dep_t; - - /** * Get encoded size of an instance of sbp_tracking_channel_correlation_dep_t * * @param msg sbp_tracking_channel_correlation_dep_t instance * @return Length of on-wire representation */ -static inline size_t sbp_tracking_channel_correlation_dep_encoded_len(const sbp_tracking_channel_correlation_dep_t *msg) -{ +static inline size_t sbp_tracking_channel_correlation_dep_encoded_len( + const sbp_tracking_channel_correlation_dep_t *msg) { (void)msg; return SBP_TRACKING_CHANNEL_CORRELATION_DEP_ENCODED_LEN; } /** - * Encode an instance of sbp_tracking_channel_correlation_dep_t to wire representation + * Encode an instance of sbp_tracking_channel_correlation_dep_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_tracking_channel_correlation_dep_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_tracking_channel_correlation_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_tracking_channel_correlation_dep_t *msg); +SBP_EXPORT s8 sbp_tracking_channel_correlation_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_tracking_channel_correlation_dep_t *msg); /** - * Decode an instance of sbp_tracking_channel_correlation_dep_t from wire representation + * Decode an instance of sbp_tracking_channel_correlation_dep_t from wire + * representation * - * This function decodes the wire representation of a sbp_tracking_channel_correlation_dep_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_tracking_channel_correlation_dep_t message to the given instance. The + * caller must specify the length of the buffer in the \p len parameter. If + * non-null the number of bytes read from the buffer will be returned in \p + * n_read. * - * @param buf Wire representation of the sbp_tracking_channel_correlation_dep_t instance + * @param buf Wire representation of the sbp_tracking_channel_correlation_dep_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_tracking_channel_correlation_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_tracking_channel_correlation_dep_t *msg); +SBP_EXPORT s8 sbp_tracking_channel_correlation_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_tracking_channel_correlation_dep_t *msg); /** * Compare two instances of sbp_tracking_channel_correlation_dep_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_tracking_channel_correlation_dep_t instance * @param b sbp_tracking_channel_correlation_dep_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_tracking_channel_correlation_dep_cmp(const sbp_tracking_channel_correlation_dep_t *a, const sbp_tracking_channel_correlation_dep_t *b); +SBP_EXPORT int sbp_tracking_channel_correlation_dep_cmp( + const sbp_tracking_channel_correlation_dep_t *a, + const sbp_tracking_channel_correlation_dep_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_tracking_channel_correlation_dep_t &lhs, const sbp_tracking_channel_correlation_dep_t &rhs) { +static inline bool operator==( + const sbp_tracking_channel_correlation_dep_t &lhs, + const sbp_tracking_channel_correlation_dep_t &rhs) { return sbp_tracking_channel_correlation_dep_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_tracking_channel_correlation_dep_t &lhs, const sbp_tracking_channel_correlation_dep_t &rhs) { +static inline bool operator!=( + const sbp_tracking_channel_correlation_dep_t &lhs, + const sbp_tracking_channel_correlation_dep_t &rhs) { return sbp_tracking_channel_correlation_dep_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_tracking_channel_correlation_dep_t &lhs, const sbp_tracking_channel_correlation_dep_t &rhs) { +static inline bool operator<( + const sbp_tracking_channel_correlation_dep_t &lhs, + const sbp_tracking_channel_correlation_dep_t &rhs) { return sbp_tracking_channel_correlation_dep_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_tracking_channel_correlation_dep_t &lhs, const sbp_tracking_channel_correlation_dep_t &rhs) { +static inline bool operator<=( + const sbp_tracking_channel_correlation_dep_t &lhs, + const sbp_tracking_channel_correlation_dep_t &rhs) { return sbp_tracking_channel_correlation_dep_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_tracking_channel_correlation_dep_t &lhs, const sbp_tracking_channel_correlation_dep_t &rhs) { +static inline bool operator>( + const sbp_tracking_channel_correlation_dep_t &lhs, + const sbp_tracking_channel_correlation_dep_t &rhs) { return sbp_tracking_channel_correlation_dep_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_tracking_channel_correlation_dep_t &lhs, const sbp_tracking_channel_correlation_dep_t &rhs) { +static inline bool operator>=( + const sbp_tracking_channel_correlation_dep_t &lhs, + const sbp_tracking_channel_correlation_dep_t &rhs) { return sbp_tracking_channel_correlation_dep_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TRACKING_TRACKINGCHANNELCORRELATIONDEP_H */ - diff --git a/c/include/libsbp/tracking/TrackingChannelState.h b/c/include/libsbp/tracking/TrackingChannelState.h index 73a976bf0..813718562 100644 --- a/c/include/libsbp/tracking/TrackingChannelState.h +++ b/c/include/libsbp/tracking/TrackingChannelState.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_TRACKING_TRACKINGCHANNELSTATE_H #define LIBSBP_TRACKING_TRACKINGCHANNELSTATE_H +#include +#include #include #include -#include -#include #include -#include +#include #include +#include #include #include -#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,39 +41,34 @@ *****************************************************************************/ /** Signal tracking channel state * -* Tracking channel state for a specific satellite signal and measured signal power. + * Tracking channel state for a specific satellite signal and measured signal + * power. */ typedef struct { - - /** -* GNSS signal being tracked + * GNSS signal being tracked */ sbp_v4_gnss_signal_t sid; - /** -* Frequency channel number (GLONASS only) + * Frequency channel number (GLONASS only) */ u8 fcn; - /** -* Carrier-to-Noise density. Zero implies invalid cn0. [dB Hz / 4] + * Carrier-to-Noise density. Zero implies invalid cn0. [dB Hz / 4] */ u8 cn0; } sbp_tracking_channel_state_t; - - /** * Get encoded size of an instance of sbp_tracking_channel_state_t * * @param msg sbp_tracking_channel_state_t instance * @return Length of on-wire representation */ -static inline size_t sbp_tracking_channel_state_encoded_len(const sbp_tracking_channel_state_t *msg) -{ +static inline size_t sbp_tracking_channel_state_encoded_len( + const sbp_tracking_channel_state_t *msg) { (void)msg; return SBP_TRACKING_CHANNEL_STATE_ENCODED_LEN; } @@ -81,74 +76,97 @@ static inline size_t sbp_tracking_channel_state_encoded_len(const sbp_tracking_c /** * Encode an instance of sbp_tracking_channel_state_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_tracking_channel_state_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_tracking_channel_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_tracking_channel_state_t *msg); +SBP_EXPORT s8 +sbp_tracking_channel_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_tracking_channel_state_t *msg); /** * Decode an instance of sbp_tracking_channel_state_t from wire representation * - * This function decodes the wire representation of a sbp_tracking_channel_state_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_tracking_channel_state_t message to the given instance. The caller must + * specify the length of the buffer in the \p len parameter. If non-null the + * number of bytes read from the buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_tracking_channel_state_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_tracking_channel_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_tracking_channel_state_t *msg); +SBP_EXPORT s8 sbp_tracking_channel_state_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_tracking_channel_state_t *msg); /** * Compare two instances of sbp_tracking_channel_state_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_tracking_channel_state_t instance * @param b sbp_tracking_channel_state_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_tracking_channel_state_cmp(const sbp_tracking_channel_state_t *a, const sbp_tracking_channel_state_t *b); +SBP_EXPORT int sbp_tracking_channel_state_cmp( + const sbp_tracking_channel_state_t *a, + const sbp_tracking_channel_state_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_tracking_channel_state_t &lhs, const sbp_tracking_channel_state_t &rhs) { +static inline bool operator==(const sbp_tracking_channel_state_t &lhs, + const sbp_tracking_channel_state_t &rhs) { return sbp_tracking_channel_state_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_tracking_channel_state_t &lhs, const sbp_tracking_channel_state_t &rhs) { +static inline bool operator!=(const sbp_tracking_channel_state_t &lhs, + const sbp_tracking_channel_state_t &rhs) { return sbp_tracking_channel_state_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_tracking_channel_state_t &lhs, const sbp_tracking_channel_state_t &rhs) { +static inline bool operator<(const sbp_tracking_channel_state_t &lhs, + const sbp_tracking_channel_state_t &rhs) { return sbp_tracking_channel_state_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_tracking_channel_state_t &lhs, const sbp_tracking_channel_state_t &rhs) { +static inline bool operator<=(const sbp_tracking_channel_state_t &lhs, + const sbp_tracking_channel_state_t &rhs) { return sbp_tracking_channel_state_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_tracking_channel_state_t &lhs, const sbp_tracking_channel_state_t &rhs) { +static inline bool operator>(const sbp_tracking_channel_state_t &lhs, + const sbp_tracking_channel_state_t &rhs) { return sbp_tracking_channel_state_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_tracking_channel_state_t &lhs, const sbp_tracking_channel_state_t &rhs) { +static inline bool operator>=(const sbp_tracking_channel_state_t &lhs, + const sbp_tracking_channel_state_t &rhs) { return sbp_tracking_channel_state_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TRACKING_TRACKINGCHANNELSTATE_H */ - diff --git a/c/include/libsbp/tracking/TrackingChannelStateDepA.h b/c/include/libsbp/tracking/TrackingChannelStateDepA.h index 7f0fd34d7..7768e8289 100644 --- a/c/include/libsbp/tracking/TrackingChannelStateDepA.h +++ b/c/include/libsbp/tracking/TrackingChannelStateDepA.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_TRACKING_TRACKINGCHANNELSTATEDEPA_H #define LIBSBP_TRACKING_TRACKINGCHANNELSTATEDEPA_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,114 +40,134 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Status of tracking channel + * Status of tracking channel */ u8 state; - /** -* PRN-1 being tracked + * PRN-1 being tracked */ u8 prn; - /** -* Carrier-to-noise density [dB Hz] + * Carrier-to-noise density [dB Hz] */ float cn0; } sbp_tracking_channel_state_dep_a_t; - - /** * Get encoded size of an instance of sbp_tracking_channel_state_dep_a_t * * @param msg sbp_tracking_channel_state_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_tracking_channel_state_dep_a_encoded_len(const sbp_tracking_channel_state_dep_a_t *msg) -{ +static inline size_t sbp_tracking_channel_state_dep_a_encoded_len( + const sbp_tracking_channel_state_dep_a_t *msg) { (void)msg; return SBP_TRACKING_CHANNEL_STATE_DEP_A_ENCODED_LEN; } /** - * Encode an instance of sbp_tracking_channel_state_dep_a_t to wire representation + * Encode an instance of sbp_tracking_channel_state_dep_a_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_tracking_channel_state_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_tracking_channel_state_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_tracking_channel_state_dep_a_t *msg); +SBP_EXPORT s8 sbp_tracking_channel_state_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_tracking_channel_state_dep_a_t *msg); /** - * Decode an instance of sbp_tracking_channel_state_dep_a_t from wire representation + * Decode an instance of sbp_tracking_channel_state_dep_a_t from wire + * representation * - * This function decodes the wire representation of a sbp_tracking_channel_state_dep_a_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_tracking_channel_state_dep_a_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_tracking_channel_state_dep_a_t instance + * @param buf Wire representation of the sbp_tracking_channel_state_dep_a_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_tracking_channel_state_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_tracking_channel_state_dep_a_t *msg); +SBP_EXPORT s8 sbp_tracking_channel_state_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_tracking_channel_state_dep_a_t *msg); /** * Compare two instances of sbp_tracking_channel_state_dep_a_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_tracking_channel_state_dep_a_t instance * @param b sbp_tracking_channel_state_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_tracking_channel_state_dep_a_cmp(const sbp_tracking_channel_state_dep_a_t *a, const sbp_tracking_channel_state_dep_a_t *b); +SBP_EXPORT int sbp_tracking_channel_state_dep_a_cmp( + const sbp_tracking_channel_state_dep_a_t *a, + const sbp_tracking_channel_state_dep_a_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_tracking_channel_state_dep_a_t &lhs, const sbp_tracking_channel_state_dep_a_t &rhs) { +static inline bool operator==(const sbp_tracking_channel_state_dep_a_t &lhs, + const sbp_tracking_channel_state_dep_a_t &rhs) { return sbp_tracking_channel_state_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_tracking_channel_state_dep_a_t &lhs, const sbp_tracking_channel_state_dep_a_t &rhs) { +static inline bool operator!=(const sbp_tracking_channel_state_dep_a_t &lhs, + const sbp_tracking_channel_state_dep_a_t &rhs) { return sbp_tracking_channel_state_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_tracking_channel_state_dep_a_t &lhs, const sbp_tracking_channel_state_dep_a_t &rhs) { +static inline bool operator<(const sbp_tracking_channel_state_dep_a_t &lhs, + const sbp_tracking_channel_state_dep_a_t &rhs) { return sbp_tracking_channel_state_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_tracking_channel_state_dep_a_t &lhs, const sbp_tracking_channel_state_dep_a_t &rhs) { +static inline bool operator<=(const sbp_tracking_channel_state_dep_a_t &lhs, + const sbp_tracking_channel_state_dep_a_t &rhs) { return sbp_tracking_channel_state_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_tracking_channel_state_dep_a_t &lhs, const sbp_tracking_channel_state_dep_a_t &rhs) { +static inline bool operator>(const sbp_tracking_channel_state_dep_a_t &lhs, + const sbp_tracking_channel_state_dep_a_t &rhs) { return sbp_tracking_channel_state_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_tracking_channel_state_dep_a_t &lhs, const sbp_tracking_channel_state_dep_a_t &rhs) { +static inline bool operator>=(const sbp_tracking_channel_state_dep_a_t &lhs, + const sbp_tracking_channel_state_dep_a_t &rhs) { return sbp_tracking_channel_state_dep_a_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TRACKING_TRACKINGCHANNELSTATEDEPA_H */ - diff --git a/c/include/libsbp/tracking/TrackingChannelStateDepB.h b/c/include/libsbp/tracking/TrackingChannelStateDepB.h index ce8860dc9..71b872b2f 100644 --- a/c/include/libsbp/tracking/TrackingChannelStateDepB.h +++ b/c/include/libsbp/tracking/TrackingChannelStateDepB.h @@ -18,20 +18,20 @@ #ifndef LIBSBP_TRACKING_TRACKINGCHANNELSTATEDEPB_H #define LIBSBP_TRACKING_TRACKINGCHANNELSTATEDEPB_H +#include +#include #include #include -#include -#include #include -#include +#include #include +#include #include #include -#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -41,114 +41,134 @@ *****************************************************************************/ /** Deprecated * -* Deprecated. + * Deprecated. */ typedef struct { - - /** -* Status of tracking channel + * Status of tracking channel */ u8 state; - /** -* GNSS signal being tracked + * GNSS signal being tracked */ sbp_gnss_signal_dep_t sid; - /** -* Carrier-to-noise density [dB Hz] + * Carrier-to-noise density [dB Hz] */ float cn0; } sbp_tracking_channel_state_dep_b_t; - - /** * Get encoded size of an instance of sbp_tracking_channel_state_dep_b_t * * @param msg sbp_tracking_channel_state_dep_b_t instance * @return Length of on-wire representation */ -static inline size_t sbp_tracking_channel_state_dep_b_encoded_len(const sbp_tracking_channel_state_dep_b_t *msg) -{ +static inline size_t sbp_tracking_channel_state_dep_b_encoded_len( + const sbp_tracking_channel_state_dep_b_t *msg) { (void)msg; return SBP_TRACKING_CHANNEL_STATE_DEP_B_ENCODED_LEN; } /** - * Encode an instance of sbp_tracking_channel_state_dep_b_t to wire representation + * Encode an instance of sbp_tracking_channel_state_dep_b_t to wire + * representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_tracking_channel_state_dep_b_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_tracking_channel_state_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_tracking_channel_state_dep_b_t *msg); +SBP_EXPORT s8 sbp_tracking_channel_state_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_tracking_channel_state_dep_b_t *msg); /** - * Decode an instance of sbp_tracking_channel_state_dep_b_t from wire representation + * Decode an instance of sbp_tracking_channel_state_dep_b_t from wire + * representation * - * This function decodes the wire representation of a sbp_tracking_channel_state_dep_b_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a + * sbp_tracking_channel_state_dep_b_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_tracking_channel_state_dep_b_t instance + * @param buf Wire representation of the sbp_tracking_channel_state_dep_b_t + * instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_tracking_channel_state_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_tracking_channel_state_dep_b_t *msg); +SBP_EXPORT s8 sbp_tracking_channel_state_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_tracking_channel_state_dep_b_t *msg); /** * Compare two instances of sbp_tracking_channel_state_dep_b_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_tracking_channel_state_dep_b_t instance * @param b sbp_tracking_channel_state_dep_b_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_tracking_channel_state_dep_b_cmp(const sbp_tracking_channel_state_dep_b_t *a, const sbp_tracking_channel_state_dep_b_t *b); +SBP_EXPORT int sbp_tracking_channel_state_dep_b_cmp( + const sbp_tracking_channel_state_dep_b_t *a, + const sbp_tracking_channel_state_dep_b_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_tracking_channel_state_dep_b_t &lhs, const sbp_tracking_channel_state_dep_b_t &rhs) { +static inline bool operator==(const sbp_tracking_channel_state_dep_b_t &lhs, + const sbp_tracking_channel_state_dep_b_t &rhs) { return sbp_tracking_channel_state_dep_b_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_tracking_channel_state_dep_b_t &lhs, const sbp_tracking_channel_state_dep_b_t &rhs) { +static inline bool operator!=(const sbp_tracking_channel_state_dep_b_t &lhs, + const sbp_tracking_channel_state_dep_b_t &rhs) { return sbp_tracking_channel_state_dep_b_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_tracking_channel_state_dep_b_t &lhs, const sbp_tracking_channel_state_dep_b_t &rhs) { +static inline bool operator<(const sbp_tracking_channel_state_dep_b_t &lhs, + const sbp_tracking_channel_state_dep_b_t &rhs) { return sbp_tracking_channel_state_dep_b_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_tracking_channel_state_dep_b_t &lhs, const sbp_tracking_channel_state_dep_b_t &rhs) { +static inline bool operator<=(const sbp_tracking_channel_state_dep_b_t &lhs, + const sbp_tracking_channel_state_dep_b_t &rhs) { return sbp_tracking_channel_state_dep_b_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_tracking_channel_state_dep_b_t &lhs, const sbp_tracking_channel_state_dep_b_t &rhs) { +static inline bool operator>(const sbp_tracking_channel_state_dep_b_t &lhs, + const sbp_tracking_channel_state_dep_b_t &rhs) { return sbp_tracking_channel_state_dep_b_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_tracking_channel_state_dep_b_t &lhs, const sbp_tracking_channel_state_dep_b_t &rhs) { +static inline bool operator>=(const sbp_tracking_channel_state_dep_b_t &lhs, + const sbp_tracking_channel_state_dep_b_t &rhs) { return sbp_tracking_channel_state_dep_b_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_TRACKING_TRACKINGCHANNELSTATEDEPB_H */ - diff --git a/c/include/libsbp/tracking_macros.h b/c/include/libsbp/tracking_macros.h index f1a56df55..300959458 100644 --- a/c/include/libsbp/tracking_macros.h +++ b/c/include/libsbp/tracking_macros.h @@ -18,630 +18,898 @@ #ifndef LIBSBP_TRACKING_MACROS_H #define LIBSBP_TRACKING_MACROS_H - #define SBP_MSG_TRACKING_STATE_DETAILED_DEP_A 0x0021 #define SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_MASK (0x7u) #define SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_SHIFT (0u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_NO_SYNCHRONIZATION (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_BIT_SYNCHRONIZATION (1) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_WORD_SYNCHRONIZATION (2) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_SUB_FRAME_SYNCHRONIZATION_MESSAGE_SYNCHRONIZATION (3) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_MASK (0x1u) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_SET(flags, \ + val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_NO_SYNCHRONIZATION \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_BIT_SYNCHRONIZATION \ + (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_WORD_SYNCHRONIZATION \ + (2) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_SYNCHRONIZATION_STATUS_SUB_FRAME_SYNCHRONIZATION_MESSAGE_SYNCHRONIZATION \ + (3) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_MASK \ + (0x1u) #define SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_SHIFT (3u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_WEEK_NUMBER_IS_NOT_VALID (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_WEEK_NUMBER_IS_VALID (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_WEEK_NUMBER_IS_NOT_VALID \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_WEEK_NUMBER_VALIDITY_STATUS_WEEK_NUMBER_IS_VALID \ + (1) #define SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_MASK (0x7u) #define SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_SHIFT (0u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_SHIFT)));} while(0) - +#define SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_SHIFT))) | \ + (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_SHIFT))); \ + } while (0) #define SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_TOW_IS_NOT_AVAILABLE (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_DECODED_TOW_IS_AVAILABLE (1) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_PROPAGATED_TOW_IS_AVAILABLE (2) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_DECODED_TOW_IS_AVAILABLE \ + (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_TOW_STATUS_PROPAGATED_TOW_IS_AVAILABLE \ + (2) #define SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_MASK (0x1u) #define SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_SHIFT (4u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_SHIFT)));} while(0) - +#define SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_SHIFT))) | \ + (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_SHIFT))); \ + } while (0) #define SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_FLL_IS_INACTIVE (0) #define SBP_TRACKING_STATE_DETAILED_DEP_A_FLL_STATUS_FLL_IS_ACTIVE (1) #define SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_MASK (0x1u) #define SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_SHIFT (3u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_SHIFT)));} while(0) - +#define SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_SHIFT))) | \ + (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_SHIFT))); \ + } while (0) #define SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_PLL_IS_INACTIVE (0) #define SBP_TRACKING_STATE_DETAILED_DEP_A_PLL_STATUS_PLL_IS_ACTIVE (1) #define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_MASK (0x7u) #define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_SHIFT (0u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_SHIFT)));} while(0) - +#define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_SHIFT))); \ + } while (0) #define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_NO_LOCKS (0) #define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_FLLDLL_LOCK (1) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_PLL_OPTIMISTIC_LOCK (2) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_PLL_PESSIMISTIC_LOCK (3) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_MASK (0x1u) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_PLL_OPTIMISTIC_LOCK \ + (2) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_LOOP_STATUS_PLL_PESSIMISTIC_LOCK \ + (3) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_MASK \ + (0x1u) #define SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_SHIFT (4u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_ALMANAC_IS_NOT_AVAILABLE (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_ALMANAC_IS_AVAILABLE (1) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_MASK (0x1u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_SHIFT (3u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_EPHEMERIS_IS_NOT_AVAILABLE (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_EPHEMERIS_IS_AVAILABLE (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_ALMANAC_IS_NOT_AVAILABLE \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_ALMANAC_AVAILABILITY_STATUS_ALMANAC_IS_AVAILABLE \ + (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_MASK \ + (0x1u) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_SHIFT \ + (3u) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_EPHEMERIS_IS_NOT_AVAILABLE \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_EPHEMERIS_AVAILABILITY_STATUS_EPHEMERIS_IS_AVAILABLE \ + (1) #define SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_MASK (0x7u) #define SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_SHIFT (0u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_SHIFT)));} while(0) - +#define SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_GET(flags) \ + ((u8)( \ + (u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_SHIFT))) | \ + (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_SHIFT))); \ + } while (0) #define SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_HEALTH_IS_UNKNOWN (0) #define SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_SIGNAL_IS_UNHEALTHY (1) #define SBP_TRACKING_STATE_DETAILED_DEP_A_HEALTH_STATUS_SIGNAL_IS_HEALTHY (2) #define SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_MASK (0x7u) #define SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_SHIFT (0u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_1_MS_INTEGRATION_TIME (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_5_MS_INTEGRATION_TIME (1) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_10_MS_INTEGRATION_TIME (2) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_20_MS_INTEGRATION_TIME (3) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_GET(flags) \ + ((u8)((u8)((flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_SHIFT))) | \ + (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_1_MS_INTEGRATION_TIME \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_5_MS_INTEGRATION_TIME \ + (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_10_MS_INTEGRATION_TIME \ + (2) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_PARAMETER_SETS_20_MS_INTEGRATION_TIME \ + (3) #define SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_MASK (0x1u) #define SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_SHIFT (5u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_CLOCK_OFFSET_AND_DRIFT_IS_NOT_VALID (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_CLOCK_OFFSET_AND_DRIFT_IS_VALID (1) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_MASK (0x1u) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_SET(flags, \ + val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_CLOCK_OFFSET_AND_DRIFT_IS_NOT_VALID \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_CLOCK_VALIDITY_STATUS_CLOCK_OFFSET_AND_DRIFT_IS_VALID \ + (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_MASK \ + (0x1u) #define SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_SHIFT (4u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_PSEUDORANGE_IS_NOT_VALID (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_PSEUDORANGE_IS_VALID (1) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_MASK (0x1u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_SHIFT (3u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_ACCELERATION_IS_NOT_VALID (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_ACCELERATION_IS_VALID (1) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK (0x1u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT (2u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_UNRESOLVED (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_RESOLVED (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_PSEUDORANGE_IS_NOT_VALID \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_PSEUDORANGE_VALIDITY_STATUS_PSEUDORANGE_IS_VALID \ + (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_MASK \ + (0x1u) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_SHIFT \ + (3u) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_ACCELERATION_IS_NOT_VALID \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_ACCELERATION_VALIDITY_STATUS_ACCELERATION_IS_VALID \ + (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK \ + (0x1u) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT \ + (2u) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_UNRESOLVED \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_RESOLVED \ + (1) #define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_MASK (0x3u) #define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_SHIFT (0u) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_RE_ACQUISITION (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_GET(flags) \ + ((u8)( \ + (u8)((flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_SET(flags, \ + val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_RE_ACQUISITION \ + (0) #define SBP_TRACKING_STATE_DETAILED_DEP_A_TRACKING_CHANNEL_STATUS_RUNNING (1) /** - * Encoded length of sbp_msg_tracking_state_detailed_dep_a_t (V4 API) and + * Encoded length of sbp_msg_tracking_state_detailed_dep_a_t (V4 API) and * msg_tracking_state_detailed_dep_a_t (legacy API) */ #define SBP_MSG_TRACKING_STATE_DETAILED_DEP_A_ENCODED_LEN 57u - #define SBP_MSG_TRACKING_STATE_DETAILED_DEP 0x0011 #define SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_MASK (0x7u) #define SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_SHIFT (0u) -#define SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_NO_SYNCHRONIZATION (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_BIT_SYNCHRONIZATION (1) -#define SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_WORD_SYNCHRONIZATION (2) -#define SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_SUB_FRAME_SYNCHRONIZATION_MESSAGE_SYNCHRONIZATION (3) +#define SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_NO_SYNCHRONIZATION \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_BIT_SYNCHRONIZATION \ + (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_WORD_SYNCHRONIZATION \ + (2) +#define SBP_TRACKING_STATE_DETAILED_DEP_SYNCHRONIZATION_STATUS_SUB_FRAME_SYNCHRONIZATION_MESSAGE_SYNCHRONIZATION \ + (3) #define SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_MASK (0x1u) #define SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_SHIFT (3u) #define SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_WEEK_NUMBER_IS_NOT_VALID (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_WEEK_NUMBER_IS_VALID (1) + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_SET(flags, \ + val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_WEEK_NUMBER_IS_NOT_VALID \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_WEEK_NUMBER_VALIDITY_STATUS_WEEK_NUMBER_IS_VALID \ + (1) #define SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_MASK (0x7u) #define SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_SHIFT (0u) -#define SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_SHIFT)));} while(0) - +#define SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_SHIFT))) | \ + (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_SHIFT))); \ + } while (0) #define SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_TOW_IS_NOT_AVAILABLE (0) #define SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_DECODED_TOW_IS_AVAILABLE (1) -#define SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_PROPAGATED_TOW_IS_AVAILABLE (2) +#define SBP_TRACKING_STATE_DETAILED_DEP_TOW_STATUS_PROPAGATED_TOW_IS_AVAILABLE \ + (2) #define SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_MASK (0x1u) #define SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_SHIFT (4u) -#define SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_SHIFT)));} while(0) - +#define SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_SHIFT))) | \ + (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_SHIFT))); \ + } while (0) #define SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_FLL_IS_INACTIVE (0) #define SBP_TRACKING_STATE_DETAILED_DEP_FLL_STATUS_FLL_IS_ACTIVE (1) #define SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_MASK (0x1u) #define SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_SHIFT (3u) -#define SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_SHIFT)));} while(0) - +#define SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_SHIFT))) | \ + (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_SHIFT))); \ + } while (0) #define SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_PLL_IS_INACTIVE (0) #define SBP_TRACKING_STATE_DETAILED_DEP_PLL_STATUS_PLL_IS_ACTIVE (1) #define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_MASK (0x7u) #define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_SHIFT (0u) -#define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_SHIFT)));} while(0) - +#define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_SHIFT))) | \ + (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_SHIFT))); \ + } while (0) #define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_NO_LOCKS (0) #define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_FLLDLL_LOCK (1) -#define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_PLL_OPTIMISTIC_LOCK (2) -#define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_PLL_PESSIMISTIC_LOCK (3) +#define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_PLL_OPTIMISTIC_LOCK \ + (2) +#define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_LOOP_STATUS_PLL_PESSIMISTIC_LOCK \ + (3) #define SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_MASK (0x1u) #define SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_SHIFT (4u) #define SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_ALMANAC_IS_NOT_AVAILABLE (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_ALMANAC_IS_AVAILABLE (1) -#define SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_MASK (0x1u) + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_SET(flags, \ + val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_ALMANAC_IS_NOT_AVAILABLE \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_ALMANAC_AVAILABILITY_STATUS_ALMANAC_IS_AVAILABLE \ + (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_MASK \ + (0x1u) #define SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_SHIFT (3u) -#define SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_EPHEMERIS_IS_NOT_AVAILABLE (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_EPHEMERIS_IS_AVAILABLE (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_EPHEMERIS_IS_NOT_AVAILABLE \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_EPHEMERIS_AVAILABILITY_STATUS_EPHEMERIS_IS_AVAILABLE \ + (1) #define SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_MASK (0x7u) #define SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_SHIFT (0u) -#define SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_SHIFT)));} while(0) - +#define SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_SHIFT))) | \ + (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_SHIFT))); \ + } while (0) #define SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_HEALTH_IS_UNKNOWN (0) #define SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_SIGNAL_IS_UNHEALTHY (1) #define SBP_TRACKING_STATE_DETAILED_DEP_HEALTH_STATUS_SIGNAL_IS_HEALTHY (2) #define SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_MASK (0x7u) #define SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_SHIFT (0u) -#define SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_SHIFT)));} while(0) - +#define SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_GET(flags) \ + ((u8)( \ + (u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_SHIFT))) | \ + (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_SHIFT))); \ + } while (0) #define SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_1_MS_INTEGRATION_TIME (0) #define SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_5_MS_INTEGRATION_TIME (1) -#define SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_10_MS_INTEGRATION_TIME (2) -#define SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_20_MS_INTEGRATION_TIME (3) +#define SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_10_MS_INTEGRATION_TIME \ + (2) +#define SBP_TRACKING_STATE_DETAILED_DEP_PARAMETER_SETS_20_MS_INTEGRATION_TIME \ + (3) #define SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_MASK (0x1u) #define SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_SHIFT (5u) -#define SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_CLOCK_OFFSET_AND_DRIFT_IS_NOT_VALID (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_CLOCK_OFFSET_AND_DRIFT_IS_VALID (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_CLOCK_OFFSET_AND_DRIFT_IS_NOT_VALID \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_CLOCK_VALIDITY_STATUS_CLOCK_OFFSET_AND_DRIFT_IS_VALID \ + (1) #define SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_MASK (0x1u) #define SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_SHIFT (4u) #define SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_PSEUDORANGE_IS_NOT_VALID (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_PSEUDORANGE_IS_VALID (1) + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_SET(flags, \ + val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_PSEUDORANGE_IS_NOT_VALID \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_PSEUDORANGE_VALIDITY_STATUS_PSEUDORANGE_IS_VALID \ + (1) #define SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_MASK (0x1u) #define SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_SHIFT (3u) -#define SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_ACCELERATION_IS_NOT_VALID (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_ACCELERATION_IS_VALID (1) -#define SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK (0x1u) -#define SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT (2u) -#define SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_UNRESOLVED (0) -#define SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_RESOLVED (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_ACCELERATION_IS_NOT_VALID \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_ACCELERATION_VALIDITY_STATUS_ACCELERATION_IS_VALID \ + (1) +#define SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK \ + (0x1u) +#define SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT \ + (2u) +#define SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_GET( \ + flags) \ + ((u8)( \ + (u8)( \ + (flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SET( \ + flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_UNRESOLVED \ + (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_CARRIER_HALF_CYCLE_AMBIGUITY_STATUS_RESOLVED \ + (1) #define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_MASK (0x3u) #define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_SHIFT (0u) -#define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_SHIFT) \ - & SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_MASK)) -#define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_MASK << SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_SHIFT))) | \ - (((val) & (SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_MASK)) \ - << (SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_SHIFT)));} while(0) - - -#define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_RE_ACQUISITION (0) +#define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_GET(flags) \ + ((u8)((u8)((flags) >> \ + SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_SHIFT) & \ + SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_MASK)) +#define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_SET(flags, \ + val) \ + do { \ + (flags) = (u8)( \ + (flags & \ + (~(SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_MASK \ + << SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_SHIFT))) | \ + (((val) & \ + (SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_MASK)) \ + << (SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_SHIFT))); \ + } while (0) + +#define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_RE_ACQUISITION \ + (0) #define SBP_TRACKING_STATE_DETAILED_DEP_TRACKING_CHANNEL_STATUS_RUNNING (1) /** - * Encoded length of sbp_msg_tracking_state_detailed_dep_t (V4 API) and + * Encoded length of sbp_msg_tracking_state_detailed_dep_t (V4 API) and * msg_tracking_state_detailed_dep_t (legacy API) */ #define SBP_MSG_TRACKING_STATE_DETAILED_DEP_ENCODED_LEN 55u - /** - * Encoded length of sbp_tracking_channel_state_t (V4 API) and + * Encoded length of sbp_tracking_channel_state_t (V4 API) and * tracking_channel_state_t (legacy API) */ #define SBP_TRACKING_CHANNEL_STATE_ENCODED_LEN 4u - #define SBP_MSG_TRACKING_STATE 0x0041 /** - * The maximum number of items that can be stored in sbp_msg_tracking_state_t::states (V4 API) or msg_tracking_state_t::states (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_tracking_state_t::states (V4 API) or msg_tracking_state_t::states + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_TRACKING_STATE_STATES_MAX 63u - /** - * Encoded length of sbp_msg_tracking_state_t (V4 API) and + * Encoded length of sbp_msg_tracking_state_t (V4 API) and * msg_tracking_state_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_tracking_state_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_tracking_state_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_TRACKING_STATE_ENCODED_OVERHEAD 0u - /** - * Encoded length of sbp_measurement_state_t (V4 API) and + * Encoded length of sbp_measurement_state_t (V4 API) and * measurement_state_t (legacy API) */ #define SBP_MEASUREMENT_STATE_ENCODED_LEN 3u - #define SBP_MSG_MEASUREMENT_STATE 0x0061 /** - * The maximum number of items that can be stored in sbp_msg_measurement_state_t::states (V4 API) or msg_measurement_state_t::states (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_measurement_state_t::states (V4 API) or + * msg_measurement_state_t::states (legacy API) before the maximum SBP message + * size is exceeded */ #define SBP_MSG_MEASUREMENT_STATE_STATES_MAX 85u - /** - * Encoded length of sbp_msg_measurement_state_t (V4 API) and + * Encoded length of sbp_msg_measurement_state_t (V4 API) and * msg_measurement_state_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_measurement_state_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_measurement_state_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_MEASUREMENT_STATE_ENCODED_OVERHEAD 0u - /** - * Encoded length of sbp_tracking_channel_correlation_t (V4 API) and + * Encoded length of sbp_tracking_channel_correlation_t (V4 API) and * tracking_channel_correlation_t (legacy API) */ #define SBP_TRACKING_CHANNEL_CORRELATION_ENCODED_LEN 4u - #define SBP_MSG_TRACKING_IQ 0x002D /** - * The maximum number of items that can be stored in sbp_msg_tracking_iq_t::corrs (V4 API) or msg_tracking_iq_t::corrs (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_tracking_iq_t::corrs (V4 API) or msg_tracking_iq_t::corrs (legacy + * API) before the maximum SBP message size is exceeded */ #define SBP_MSG_TRACKING_IQ_CORRS_MAX 3u - /** - * Encoded length of sbp_msg_tracking_iq_t (V4 API) and + * Encoded length of sbp_msg_tracking_iq_t (V4 API) and * msg_tracking_iq_t (legacy API) */ #define SBP_MSG_TRACKING_IQ_ENCODED_LEN 15u - /** - * Encoded length of sbp_tracking_channel_correlation_dep_t (V4 API) and + * Encoded length of sbp_tracking_channel_correlation_dep_t (V4 API) and * tracking_channel_correlation_dep_t (legacy API) */ #define SBP_TRACKING_CHANNEL_CORRELATION_DEP_ENCODED_LEN 8u - #define SBP_MSG_TRACKING_IQ_DEP_B 0x002C /** - * The maximum number of items that can be stored in sbp_msg_tracking_iq_dep_b_t::corrs (V4 API) or msg_tracking_iq_dep_b_t::corrs (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_tracking_iq_dep_b_t::corrs (V4 API) or msg_tracking_iq_dep_b_t::corrs + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_TRACKING_IQ_DEP_B_CORRS_MAX 3u - /** - * Encoded length of sbp_msg_tracking_iq_dep_b_t (V4 API) and + * Encoded length of sbp_msg_tracking_iq_dep_b_t (V4 API) and * msg_tracking_iq_dep_b_t (legacy API) */ #define SBP_MSG_TRACKING_IQ_DEP_B_ENCODED_LEN 27u - #define SBP_MSG_TRACKING_IQ_DEP_A 0x001C /** - * The maximum number of items that can be stored in sbp_msg_tracking_iq_dep_a_t::corrs (V4 API) or msg_tracking_iq_dep_a_t::corrs (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_tracking_iq_dep_a_t::corrs (V4 API) or msg_tracking_iq_dep_a_t::corrs + * (legacy API) before the maximum SBP message size is exceeded */ #define SBP_MSG_TRACKING_IQ_DEP_A_CORRS_MAX 3u - /** - * Encoded length of sbp_msg_tracking_iq_dep_a_t (V4 API) and + * Encoded length of sbp_msg_tracking_iq_dep_a_t (V4 API) and * msg_tracking_iq_dep_a_t (legacy API) */ #define SBP_MSG_TRACKING_IQ_DEP_A_ENCODED_LEN 29u - #define SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_MASK (0x3u) #define SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_SHIFT (0u) -#define SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_SHIFT) \ - & SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_MASK)) -#define SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_MASK << SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_SHIFT))) | \ - (((val) & (SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_MASK)) \ - << (SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_SHIFT)));} while(0) - +#define SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_SHIFT) & \ + SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_MASK)) +#define SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_MASK \ + << SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_SHIFT))) | \ + (((val) & (SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_MASK)) \ + << (SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_SHIFT))); \ + } while (0) #define SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_DISABLED (0) #define SBP_TRACKINGCHANNELSTATEDEPA_TRACKING_MODE_RUNNING (1) /** - * Encoded length of sbp_tracking_channel_state_dep_a_t (V4 API) and + * Encoded length of sbp_tracking_channel_state_dep_a_t (V4 API) and * tracking_channel_state_dep_a_t (legacy API) */ #define SBP_TRACKING_CHANNEL_STATE_DEP_A_ENCODED_LEN 6u - #define SBP_MSG_TRACKING_STATE_DEP_A 0x0016 /** - * The maximum number of items that can be stored in sbp_msg_tracking_state_dep_a_t::states (V4 API) or msg_tracking_state_dep_a_t::states (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_tracking_state_dep_a_t::states (V4 API) or + * msg_tracking_state_dep_a_t::states (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_TRACKING_STATE_DEP_A_STATES_MAX 42u - /** - * Encoded length of sbp_msg_tracking_state_dep_a_t (V4 API) and + * Encoded length of sbp_msg_tracking_state_dep_a_t (V4 API) and * msg_tracking_state_dep_a_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_tracking_state_dep_a_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_tracking_state_dep_a_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_TRACKING_STATE_DEP_A_ENCODED_OVERHEAD 0u - #define SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_MASK (0x3u) #define SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_SHIFT (0u) -#define SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_SHIFT) \ - & SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_MASK)) -#define SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_MASK << SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_SHIFT))) | \ - (((val) & (SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_MASK)) \ - << (SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_SHIFT)));} while(0) - +#define SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_SHIFT) & \ + SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_MASK)) +#define SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_SET(flags, val) \ + do { \ + (flags) = (u8)( \ + (flags & (~(SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_MASK \ + << SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_SHIFT))) | \ + (((val) & (SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_MASK)) \ + << (SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_SHIFT))); \ + } while (0) #define SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_DISABLED (0) #define SBP_TRACKINGCHANNELSTATEDEPB_TRACKING_MODE_RUNNING (1) /** - * Encoded length of sbp_tracking_channel_state_dep_b_t (V4 API) and + * Encoded length of sbp_tracking_channel_state_dep_b_t (V4 API) and * tracking_channel_state_dep_b_t (legacy API) */ #define SBP_TRACKING_CHANNEL_STATE_DEP_B_ENCODED_LEN 9u - #define SBP_MSG_TRACKING_STATE_DEP_B 0x0013 /** - * The maximum number of items that can be stored in sbp_msg_tracking_state_dep_b_t::states (V4 API) or msg_tracking_state_dep_b_t::states (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_tracking_state_dep_b_t::states (V4 API) or + * msg_tracking_state_dep_b_t::states (legacy API) before the maximum SBP + * message size is exceeded */ #define SBP_MSG_TRACKING_STATE_DEP_B_STATES_MAX 28u - /** - * Encoded length of sbp_msg_tracking_state_dep_b_t (V4 API) and + * Encoded length of sbp_msg_tracking_state_dep_b_t (V4 API) and * msg_tracking_state_dep_b_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_tracking_state_dep_b_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded - * message length when interacting with the legacy type. + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_tracking_state_dep_b_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_TRACKING_STATE_DEP_B_ENCODED_OVERHEAD 0u - - #endif /* LIBSBP_TRACKING_MACROS_H */ diff --git a/c/include/libsbp/user/MSG_USER_DATA.h b/c/include/libsbp/user/MSG_USER_DATA.h index 35be04592..d2877846a 100644 --- a/c/include/libsbp/user/MSG_USER_DATA.h +++ b/c/include/libsbp/user/MSG_USER_DATA.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_USER_MSG_USER_DATA_H #define LIBSBP_USER_MSG_USER_DATA_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,73 +40,89 @@ *****************************************************************************/ /** User data * -* This message can contain any application specific user data up to a maximum length of 255 bytes per message. + * This message can contain any application specific user data up to a maximum + * length of 255 bytes per message. */ typedef struct { - - /** -* User data payload + * User data payload */ u8 contents[SBP_MSG_USER_DATA_CONTENTS_MAX]; /** * Number of elements in contents * - * When sending a message fill in this field with the number elements set in contents before calling an appropriate libsbp send function + * When sending a message fill in this field with the number elements set in + * contents before calling an appropriate libsbp send function * - * When receiving a message query this field for the number of elements in contents. The value of any elements beyond the index specified in this field is undefined + * When receiving a message query this field for the number of elements in + * contents. The value of any elements beyond the index specified in this + * field is undefined */ u8 n_contents; } sbp_msg_user_data_t; - - /** * Get encoded size of an instance of sbp_msg_user_data_t * * @param msg sbp_msg_user_data_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_user_data_encoded_len(const sbp_msg_user_data_t *msg) -{ - return SBP_MSG_USER_DATA_ENCODED_OVERHEAD - + (msg->n_contents * SBP_ENCODED_LEN_U8) - ; +static inline size_t sbp_msg_user_data_encoded_len( + const sbp_msg_user_data_t *msg) { + return SBP_MSG_USER_DATA_ENCODED_OVERHEAD + + (msg->n_contents * SBP_ENCODED_LEN_U8); } /** * Encode an instance of sbp_msg_user_data_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_user_data_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_user_data_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_user_data_t *msg); +SBP_EXPORT s8 sbp_msg_user_data_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_user_data_t *msg); /** * Decode an instance of sbp_msg_user_data_t from wire representation * - * This function decodes the wire representation of a sbp_msg_user_data_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_user_data_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_user_data_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_user_data_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_user_data_t *msg); +SBP_EXPORT s8 sbp_msg_user_data_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_user_data_t *msg); /** * Send an instance of sbp_msg_user_data_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_user_data_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_user_data_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -114,51 +130,61 @@ SBP_EXPORT s8 sbp_msg_user_data_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_user_data_send(sbp_state_t *s, u16 sender_id, const sbp_msg_user_data_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_user_data_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_user_data_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_user_data_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_user_data_t instance * @param b sbp_msg_user_data_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_user_data_cmp(const sbp_msg_user_data_t *a, const sbp_msg_user_data_t *b); +SBP_EXPORT int sbp_msg_user_data_cmp(const sbp_msg_user_data_t *a, + const sbp_msg_user_data_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_user_data_t &lhs, const sbp_msg_user_data_t &rhs) { +static inline bool operator==(const sbp_msg_user_data_t &lhs, + const sbp_msg_user_data_t &rhs) { return sbp_msg_user_data_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_user_data_t &lhs, const sbp_msg_user_data_t &rhs) { +static inline bool operator!=(const sbp_msg_user_data_t &lhs, + const sbp_msg_user_data_t &rhs) { return sbp_msg_user_data_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_user_data_t &lhs, const sbp_msg_user_data_t &rhs) { +static inline bool operator<(const sbp_msg_user_data_t &lhs, + const sbp_msg_user_data_t &rhs) { return sbp_msg_user_data_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_user_data_t &lhs, const sbp_msg_user_data_t &rhs) { +static inline bool operator<=(const sbp_msg_user_data_t &lhs, + const sbp_msg_user_data_t &rhs) { return sbp_msg_user_data_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_user_data_t &lhs, const sbp_msg_user_data_t &rhs) { +static inline bool operator>(const sbp_msg_user_data_t &lhs, + const sbp_msg_user_data_t &rhs) { return sbp_msg_user_data_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_user_data_t &lhs, const sbp_msg_user_data_t &rhs) { +static inline bool operator>=(const sbp_msg_user_data_t &lhs, + const sbp_msg_user_data_t &rhs) { return sbp_msg_user_data_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_USER_MSG_USER_DATA_H */ - diff --git a/c/include/libsbp/user_macros.h b/c/include/libsbp/user_macros.h index 6688230a2..9f0ace72a 100644 --- a/c/include/libsbp/user_macros.h +++ b/c/include/libsbp/user_macros.h @@ -18,29 +18,27 @@ #ifndef LIBSBP_USER_MACROS_H #define LIBSBP_USER_MACROS_H - #define SBP_MSG_USER_DATA 0x0800 /** - * The maximum number of items that can be stored in sbp_msg_user_data_t::contents (V4 API) or msg_user_data_t::contents (legacy API) before the maximum SBP message size is exceeded + * The maximum number of items that can be stored in + * sbp_msg_user_data_t::contents (V4 API) or msg_user_data_t::contents (legacy + * API) before the maximum SBP message size is exceeded */ #define SBP_MSG_USER_DATA_CONTENTS_MAX 255u - /** - * Encoded length of sbp_msg_user_data_t (V4 API) and + * Encoded length of sbp_msg_user_data_t (V4 API) and * msg_user_data_t (legacy API) * - * This type is not fixed size and an instance of this message may be longer - * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_user_data_encoded_len to determine the actual size of an instance - * of this message. Users of the legacy API are required to track the encoded + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_user_data_encoded_len to determine the actual size of an instance + * of this message. Users of the legacy API are required to track the encoded * message length when interacting with the legacy type. * - * See the documentation for libsbp for more details regarding the message + * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ #define SBP_MSG_USER_DATA_ENCODED_OVERHEAD 0u - - #endif /* LIBSBP_USER_MACROS_H */ diff --git a/c/include/libsbp/v4/acquisition.h b/c/include/libsbp/v4/acquisition.h index 92a69d5bd..3780e802d 100644 --- a/c/include/libsbp/v4/acquisition.h +++ b/c/include/libsbp/v4/acquisition.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/acquisition.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/acquisition.h` instead. Access to SBP types via this header file " + "will be removed in version 6.") #include diff --git a/c/include/libsbp/v4/bootload.h b/c/include/libsbp/v4/bootload.h index 6bbecf191..3d8b17b6b 100644 --- a/c/include/libsbp/v4/bootload.h +++ b/c/include/libsbp/v4/bootload.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/bootload.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/bootload.h` instead. Access to SBP types via this header file " + "will be removed in version 6.") #include diff --git a/c/include/libsbp/v4/ext_events.h b/c/include/libsbp/v4/ext_events.h index bbbf21579..a51c6d7ce 100644 --- a/c/include/libsbp/v4/ext_events.h +++ b/c/include/libsbp/v4/ext_events.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/ext_events.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/ext_events.h` instead. Access to SBP types via this header file " + "will be removed in version 6.") #include diff --git a/c/include/libsbp/v4/file_io.h b/c/include/libsbp/v4/file_io.h index 6d9908c5c..1dc0ee03e 100644 --- a/c/include/libsbp/v4/file_io.h +++ b/c/include/libsbp/v4/file_io.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/file_io.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/file_io.h` instead. Access to SBP types via this header file will " + "be removed in version 6.") #include diff --git a/c/include/libsbp/v4/flash.h b/c/include/libsbp/v4/flash.h index cda8a05f3..31f614e3c 100644 --- a/c/include/libsbp/v4/flash.h +++ b/c/include/libsbp/v4/flash.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/flash.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/flash.h` instead. Access to SBP types via this header file will " + "be removed in version 6.") #include diff --git a/c/include/libsbp/v4/gnss.h b/c/include/libsbp/v4/gnss.h index 989a847eb..5dfc176bd 100644 --- a/c/include/libsbp/v4/gnss.h +++ b/c/include/libsbp/v4/gnss.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/gnss.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/gnss.h` instead. Access to SBP types via this header file will be " + "removed in version 6.") #include diff --git a/c/include/libsbp/v4/imu.h b/c/include/libsbp/v4/imu.h index f53b0eca8..f93e65ec3 100644 --- a/c/include/libsbp/v4/imu.h +++ b/c/include/libsbp/v4/imu.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/imu.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/imu.h` instead. Access to SBP types via this header file will be " + "removed in version 6.") #include diff --git a/c/include/libsbp/v4/integrity.h b/c/include/libsbp/v4/integrity.h index ef6f8fd81..eebf7403e 100644 --- a/c/include/libsbp/v4/integrity.h +++ b/c/include/libsbp/v4/integrity.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/integrity.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/integrity.h` instead. Access to SBP types via this header file " + "will be removed in version 6.") #include diff --git a/c/include/libsbp/v4/linux.h b/c/include/libsbp/v4/linux.h index 979643c6f..a7dbd62e0 100644 --- a/c/include/libsbp/v4/linux.h +++ b/c/include/libsbp/v4/linux.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/linux.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/linux.h` instead. Access to SBP types via this header file will " + "be removed in version 6.") #include diff --git a/c/include/libsbp/v4/logging.h b/c/include/libsbp/v4/logging.h index 7f9f0a6da..59a5ace69 100644 --- a/c/include/libsbp/v4/logging.h +++ b/c/include/libsbp/v4/logging.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/logging.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/logging.h` instead. Access to SBP types via this header file will " + "be removed in version 6.") #include diff --git a/c/include/libsbp/v4/mag.h b/c/include/libsbp/v4/mag.h index 609fe6252..680c76794 100644 --- a/c/include/libsbp/v4/mag.h +++ b/c/include/libsbp/v4/mag.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/mag.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/mag.h` instead. Access to SBP types via this header file will be " + "removed in version 6.") #include diff --git a/c/include/libsbp/v4/navigation.h b/c/include/libsbp/v4/navigation.h index db561bf81..627bf12a0 100644 --- a/c/include/libsbp/v4/navigation.h +++ b/c/include/libsbp/v4/navigation.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/navigation.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/navigation.h` instead. Access to SBP types via this header file " + "will be removed in version 6.") #include diff --git a/c/include/libsbp/v4/ndb.h b/c/include/libsbp/v4/ndb.h index 1501d3716..d505af526 100644 --- a/c/include/libsbp/v4/ndb.h +++ b/c/include/libsbp/v4/ndb.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/ndb.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/ndb.h` instead. Access to SBP types via this header file will be " + "removed in version 6.") #include diff --git a/c/include/libsbp/v4/observation.h b/c/include/libsbp/v4/observation.h index 97a869408..1c5166cb6 100644 --- a/c/include/libsbp/v4/observation.h +++ b/c/include/libsbp/v4/observation.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/observation.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/observation.h` instead. Access to SBP types via this header file " + "will be removed in version 6.") #include diff --git a/c/include/libsbp/v4/orientation.h b/c/include/libsbp/v4/orientation.h index 0092568bc..299776345 100644 --- a/c/include/libsbp/v4/orientation.h +++ b/c/include/libsbp/v4/orientation.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/orientation.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/orientation.h` instead. Access to SBP types via this header file " + "will be removed in version 6.") #include diff --git a/c/include/libsbp/v4/piksi.h b/c/include/libsbp/v4/piksi.h index a5ffd878d..4ffaf6a61 100644 --- a/c/include/libsbp/v4/piksi.h +++ b/c/include/libsbp/v4/piksi.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/piksi.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/piksi.h` instead. Access to SBP types via this header file will " + "be removed in version 6.") #include diff --git a/c/include/libsbp/v4/sbas.h b/c/include/libsbp/v4/sbas.h index cb2869fb5..ad5ee6f96 100644 --- a/c/include/libsbp/v4/sbas.h +++ b/c/include/libsbp/v4/sbas.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/sbas.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/sbas.h` instead. Access to SBP types via this header file will be " + "removed in version 6.") #include diff --git a/c/include/libsbp/v4/settings.h b/c/include/libsbp/v4/settings.h index 2e099930e..06c6f0870 100644 --- a/c/include/libsbp/v4/settings.h +++ b/c/include/libsbp/v4/settings.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/settings.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/settings.h` instead. Access to SBP types via this header file " + "will be removed in version 6.") #include diff --git a/c/include/libsbp/v4/signing.h b/c/include/libsbp/v4/signing.h index 485d23732..59607b3ca 100644 --- a/c/include/libsbp/v4/signing.h +++ b/c/include/libsbp/v4/signing.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/signing.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/signing.h` instead. Access to SBP types via this header file will " + "be removed in version 6.") #include diff --git a/c/include/libsbp/v4/solution_meta.h b/c/include/libsbp/v4/solution_meta.h index 9c76d920e..0ea825da3 100644 --- a/c/include/libsbp/v4/solution_meta.h +++ b/c/include/libsbp/v4/solution_meta.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/solution_meta.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/solution_meta.h` instead. Access to SBP types via this header " + "file will be removed in version 6.") #include diff --git a/c/include/libsbp/v4/ssr.h b/c/include/libsbp/v4/ssr.h index 4d55e3c10..943d28e06 100644 --- a/c/include/libsbp/v4/ssr.h +++ b/c/include/libsbp/v4/ssr.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/ssr.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/ssr.h` instead. Access to SBP types via this header file will be " + "removed in version 6.") #include diff --git a/c/include/libsbp/v4/system.h b/c/include/libsbp/v4/system.h index 63023a75b..7582c1d5a 100644 --- a/c/include/libsbp/v4/system.h +++ b/c/include/libsbp/v4/system.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/system.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/system.h` instead. Access to SBP types via this header file will " + "be removed in version 6.") #include diff --git a/c/include/libsbp/v4/telemetry.h b/c/include/libsbp/v4/telemetry.h index 78e58eb3e..20c7a8132 100644 --- a/c/include/libsbp/v4/telemetry.h +++ b/c/include/libsbp/v4/telemetry.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/telemetry.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/telemetry.h` instead. Access to SBP types via this header file " + "will be removed in version 6.") #include diff --git a/c/include/libsbp/v4/tracking.h b/c/include/libsbp/v4/tracking.h index 6297f59c4..4c6436b24 100644 --- a/c/include/libsbp/v4/tracking.h +++ b/c/include/libsbp/v4/tracking.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/tracking.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/tracking.h` instead. Access to SBP types via this header file " + "will be removed in version 6.") #include diff --git a/c/include/libsbp/v4/user.h b/c/include/libsbp/v4/user.h index 075d775e7..e63a8fcd0 100644 --- a/c/include/libsbp/v4/user.h +++ b/c/include/libsbp/v4/user.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/user.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/user.h` instead. Access to SBP types via this header file will be " + "removed in version 6.") #include diff --git a/c/include/libsbp/v4/vehicle.h b/c/include/libsbp/v4/vehicle.h index bd0b24885..6666fca52 100644 --- a/c/include/libsbp/v4/vehicle.h +++ b/c/include/libsbp/v4/vehicle.h @@ -20,7 +20,10 @@ #include -SBP_MESSAGE("SBP message definitions have moved. To continue using these types include `libsbp/vehicle.h` instead. Access to SBP types via this header file will be removed in version 6.") +SBP_MESSAGE( + "SBP message definitions have moved. To continue using these types include " + "`libsbp/vehicle.h` instead. Access to SBP types via this header file will " + "be removed in version 6.") #include diff --git a/c/include/libsbp/vehicle/MSG_ODOMETRY.h b/c/include/libsbp/vehicle/MSG_ODOMETRY.h index 9e70414fe..6cb1e2c1e 100644 --- a/c/include/libsbp/vehicle/MSG_ODOMETRY.h +++ b/c/include/libsbp/vehicle/MSG_ODOMETRY.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_VEHICLE_MSG_ODOMETRY_H #define LIBSBP_VEHICLE_MSG_ODOMETRY_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,39 +40,43 @@ *****************************************************************************/ /** Vehicle forward (x-axis) velocity * -* Message representing the x component of vehicle velocity in the user frame at the odometry reference point(s) specified by the user. The offset for the odometry reference point and the definition and origin of the user frame are defined through the device settings interface. There are 4 possible user-defined sources of this message which are labeled arbitrarily source 0 through 3. If using "processor time" time tags, the receiving end will expect a `MSG_GNSS_TIME_OFFSET` when a PVT fix becomes available to synchronise odometry measurements with GNSS. Processor time shall roll over to zero after one week. + * Message representing the x component of vehicle velocity in the user frame at + * the odometry reference point(s) specified by the user. The offset for the + * odometry reference point and the definition and origin of the user frame are + * defined through the device settings interface. There are 4 possible + * user-defined sources of this message which are labeled arbitrarily source 0 + * through 3. If using "processor time" time tags, the receiving end will expect + * a `MSG_GNSS_TIME_OFFSET` when a PVT fix becomes available to synchronise + * odometry measurements with GNSS. Processor time shall roll over to zero after + * one week. */ typedef struct { - - /** - * Time field representing either milliseconds in the GPS Week or local CPU time from the producing system in milliseconds. See the tow_source flag for the exact source of this timestamp. [ms] + * Time field representing either milliseconds in the GPS Week or local CPU + * time from the producing system in milliseconds. See the tow_source flag + * for the exact source of this timestamp. [ms] */ u32 tow; - /** - * The signed forward component of vehicle velocity. [mm/s] + * The signed forward component of vehicle velocity. [mm/s] */ s32 velocity; - /** -* Status flags + * Status flags */ u8 flags; } sbp_msg_odometry_t; - - /** * Get encoded size of an instance of sbp_msg_odometry_t * * @param msg sbp_msg_odometry_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_odometry_encoded_len(const sbp_msg_odometry_t *msg) -{ +static inline size_t sbp_msg_odometry_encoded_len( + const sbp_msg_odometry_t *msg) { (void)msg; return SBP_MSG_ODOMETRY_ENCODED_LEN; } @@ -80,36 +84,52 @@ static inline size_t sbp_msg_odometry_encoded_len(const sbp_msg_odometry_t *msg) /** * Encode an instance of sbp_msg_odometry_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_odometry_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_odometry_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_odometry_t *msg); +SBP_EXPORT s8 sbp_msg_odometry_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_odometry_t *msg); /** * Decode an instance of sbp_msg_odometry_t from wire representation * - * This function decodes the wire representation of a sbp_msg_odometry_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_odometry_t message + * to the given instance. The caller must specify the length of the buffer in + * the \p len parameter. If non-null the number of bytes read from the buffer + * will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_odometry_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_odometry_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_odometry_t *msg); +SBP_EXPORT s8 sbp_msg_odometry_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_odometry_t *msg); /** * Send an instance of sbp_msg_odometry_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_odometry_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_odometry_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -117,51 +137,61 @@ SBP_EXPORT s8 sbp_msg_odometry_decode(const uint8_t *buf, uint8_t len, uint8_t * * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_odometry_send(sbp_state_t *s, u16 sender_id, const sbp_msg_odometry_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_odometry_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_odometry_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_odometry_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_odometry_t instance * @param b sbp_msg_odometry_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_odometry_cmp(const sbp_msg_odometry_t *a, const sbp_msg_odometry_t *b); +SBP_EXPORT int sbp_msg_odometry_cmp(const sbp_msg_odometry_t *a, + const sbp_msg_odometry_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_odometry_t &lhs, const sbp_msg_odometry_t &rhs) { +static inline bool operator==(const sbp_msg_odometry_t &lhs, + const sbp_msg_odometry_t &rhs) { return sbp_msg_odometry_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_odometry_t &lhs, const sbp_msg_odometry_t &rhs) { +static inline bool operator!=(const sbp_msg_odometry_t &lhs, + const sbp_msg_odometry_t &rhs) { return sbp_msg_odometry_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_odometry_t &lhs, const sbp_msg_odometry_t &rhs) { +static inline bool operator<(const sbp_msg_odometry_t &lhs, + const sbp_msg_odometry_t &rhs) { return sbp_msg_odometry_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_odometry_t &lhs, const sbp_msg_odometry_t &rhs) { +static inline bool operator<=(const sbp_msg_odometry_t &lhs, + const sbp_msg_odometry_t &rhs) { return sbp_msg_odometry_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_odometry_t &lhs, const sbp_msg_odometry_t &rhs) { +static inline bool operator>(const sbp_msg_odometry_t &lhs, + const sbp_msg_odometry_t &rhs) { return sbp_msg_odometry_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_odometry_t &lhs, const sbp_msg_odometry_t &rhs) { +static inline bool operator>=(const sbp_msg_odometry_t &lhs, + const sbp_msg_odometry_t &rhs) { return sbp_msg_odometry_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_VEHICLE_MSG_ODOMETRY_H */ - diff --git a/c/include/libsbp/vehicle/MSG_WHEELTICK.h b/c/include/libsbp/vehicle/MSG_WHEELTICK.h index cbb5f6718..d344aeac4 100644 --- a/c/include/libsbp/vehicle/MSG_WHEELTICK.h +++ b/c/include/libsbp/vehicle/MSG_WHEELTICK.h @@ -18,19 +18,19 @@ #ifndef LIBSBP_VEHICLE_MSG_WHEELTICK_H #define LIBSBP_VEHICLE_MSG_WHEELTICK_H +#include +#include #include #include -#include -#include #include -#include +#include #include #include #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /****************************************************************************** @@ -40,45 +40,54 @@ *****************************************************************************/ /** Accumulated wheeltick count message * -* Message containing the accumulated distance travelled by a wheel located at an odometry reference point defined by the user. The offset for the odometry reference point and the definition and origin of the user frame are defined through the device settings interface. The source of this message is identified by the source field, which is an integer ranging from 0 to 255. The timestamp associated with this message should represent the time when the accumulated tick count reached the value given by the contents of this message as accurately as possible. If using "local CPU time" time tags, the receiving end will expect a `MSG_GNSS_TIME_OFFSET` when a PVT fix becomes available to synchronise wheeltick measurements with GNSS. Local CPU time shall roll over to zero after one week. + * Message containing the accumulated distance travelled by a wheel located at + * an odometry reference point defined by the user. The offset for the odometry + * reference point and the definition and origin of the user frame are defined + * through the device settings interface. The source of this message is + * identified by the source field, which is an integer ranging from 0 to 255. + * The timestamp associated with this message should represent the time when the + * accumulated tick count reached the value given by the contents of this + * message as accurately as possible. If using "local CPU time" time tags, the + * receiving end will expect a `MSG_GNSS_TIME_OFFSET` when a PVT fix becomes + * available to synchronise wheeltick measurements with GNSS. Local CPU time + * shall roll over to zero after one week. */ typedef struct { - - /** - * Time field representing either microseconds since the last PPS, microseconds in the GPS Week or local CPU time from the producing system in microseconds. See the synch_type field for the exact meaning of this timestamp. [us] + * Time field representing either microseconds since the last PPS, + * microseconds in the GPS Week or local CPU time from the producing system in + * microseconds. See the synch_type field for the exact meaning of this + * timestamp. [us] */ u64 time; - /** - * Field indicating the type of timestamp contained in the time field. + * Field indicating the type of timestamp contained in the time field. */ u8 flags; - /** - * ID of the sensor producing this message + * ID of the sensor producing this message */ u8 source; - /** - * Free-running counter of the accumulated distance for this sensor. The counter should be incrementing if travelling into one direction and decrementing when travelling in the opposite direction. [arbitrary distance units] + * Free-running counter of the accumulated distance for this sensor. The + * counter should be incrementing if travelling into one direction and + * decrementing when travelling in the opposite direction. [arbitrary distance + * units] */ s32 ticks; } sbp_msg_wheeltick_t; - - /** * Get encoded size of an instance of sbp_msg_wheeltick_t * * @param msg sbp_msg_wheeltick_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_wheeltick_encoded_len(const sbp_msg_wheeltick_t *msg) -{ +static inline size_t sbp_msg_wheeltick_encoded_len( + const sbp_msg_wheeltick_t *msg) { (void)msg; return SBP_MSG_WHEELTICK_ENCODED_LEN; } @@ -86,36 +95,53 @@ static inline size_t sbp_msg_wheeltick_encoded_len(const sbp_msg_wheeltick_t *ms /** * Encode an instance of sbp_msg_wheeltick_t to wire representation * - * This function encodes the given instance in to the user provided buffer. The buffer provided to this function must be large enough to store the encoded message otherwise it will return SBP_ENCODE_ERROR without writing anything to the buffer. + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. * - * Specify the length of the destination buffer in the \p len parameter. If non-null the number of bytes written to the buffer will be returned in \p n_written. + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. * * @param buf Destination buffer * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes written to \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf * @param msg Instance of sbp_msg_wheeltick_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_wheeltick_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_wheeltick_t *msg); +SBP_EXPORT s8 sbp_msg_wheeltick_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_wheeltick_t *msg); /** * Decode an instance of sbp_msg_wheeltick_t from wire representation * - * This function decodes the wire representation of a sbp_msg_wheeltick_t message to the given instance. The caller must specify the length of the buffer in the \p len parameter. If non-null the number of bytes read from the buffer will be returned in \p n_read. + * This function decodes the wire representation of a sbp_msg_wheeltick_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. * * @param buf Wire representation of the sbp_msg_wheeltick_t instance * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read from \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_wheeltick_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_wheeltick_t *msg); +SBP_EXPORT s8 sbp_msg_wheeltick_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_wheeltick_t *msg); /** * Send an instance of sbp_msg_wheeltick_t with the given write function * - * An equivalent of #sbp_message_send which operates specifically on sbp_msg_wheeltick_t + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_wheeltick_t * - * The given message will be encoded to wire representation and passed in to the given write function callback. The write callback will be called several times for each invocation of this function. + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. * * @param s SBP state * @param sender_id SBP sender id @@ -123,51 +149,61 @@ SBP_EXPORT s8 sbp_msg_wheeltick_decode(const uint8_t *buf, uint8_t len, uint8_t * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_wheeltick_send(sbp_state_t *s, u16 sender_id, const sbp_msg_wheeltick_t *msg, sbp_write_fn_t write); +SBP_EXPORT s8 sbp_msg_wheeltick_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_wheeltick_t *msg, + sbp_write_fn_t write); /** * Compare two instances of sbp_msg_wheeltick_t * - * The two instances will be compared and a value returned consistent with the return codes of comparison functions from the C standard library + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library * * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p b - * A value greater than 0 will be returned if \p b is considered to be greater than \p b + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b * * @param a sbp_msg_wheeltick_t instance * @param b sbp_msg_wheeltick_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_wheeltick_cmp(const sbp_msg_wheeltick_t *a, const sbp_msg_wheeltick_t *b); +SBP_EXPORT int sbp_msg_wheeltick_cmp(const sbp_msg_wheeltick_t *a, + const sbp_msg_wheeltick_t *b); #ifdef __cplusplus - } +} -static inline bool operator==(const sbp_msg_wheeltick_t &lhs, const sbp_msg_wheeltick_t &rhs) { +static inline bool operator==(const sbp_msg_wheeltick_t &lhs, + const sbp_msg_wheeltick_t &rhs) { return sbp_msg_wheeltick_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_wheeltick_t &lhs, const sbp_msg_wheeltick_t &rhs) { +static inline bool operator!=(const sbp_msg_wheeltick_t &lhs, + const sbp_msg_wheeltick_t &rhs) { return sbp_msg_wheeltick_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_wheeltick_t &lhs, const sbp_msg_wheeltick_t &rhs) { +static inline bool operator<(const sbp_msg_wheeltick_t &lhs, + const sbp_msg_wheeltick_t &rhs) { return sbp_msg_wheeltick_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_wheeltick_t &lhs, const sbp_msg_wheeltick_t &rhs) { +static inline bool operator<=(const sbp_msg_wheeltick_t &lhs, + const sbp_msg_wheeltick_t &rhs) { return sbp_msg_wheeltick_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_wheeltick_t &lhs, const sbp_msg_wheeltick_t &rhs) { +static inline bool operator>(const sbp_msg_wheeltick_t &lhs, + const sbp_msg_wheeltick_t &rhs) { return sbp_msg_wheeltick_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_wheeltick_t &lhs, const sbp_msg_wheeltick_t &rhs) { +static inline bool operator>=(const sbp_msg_wheeltick_t &lhs, + const sbp_msg_wheeltick_t &rhs) { return sbp_msg_wheeltick_cmp(&lhs, &rhs) >= 0; } -#endif // ifdef __cplusplus +#endif // ifdef __cplusplus #endif /* LIBSBP_VEHICLE_MSG_WHEELTICK_H */ - diff --git a/c/include/libsbp/vehicle_macros.h b/c/include/libsbp/vehicle_macros.h index eb792de98..0a77db95a 100644 --- a/c/include/libsbp/vehicle_macros.h +++ b/c/include/libsbp/vehicle_macros.h @@ -18,18 +18,19 @@ #ifndef LIBSBP_VEHICLE_MACROS_H #define LIBSBP_VEHICLE_MACROS_H - #define SBP_MSG_ODOMETRY 0x0903 #define SBP_ODOMETRY_VEHICLE_METADATA_MASK (0x3u) #define SBP_ODOMETRY_VEHICLE_METADATA_SHIFT (5u) -#define SBP_ODOMETRY_VEHICLE_METADATA_GET(flags) \ - ((u8)((u8)((flags) >> SBP_ODOMETRY_VEHICLE_METADATA_SHIFT) \ - & SBP_ODOMETRY_VEHICLE_METADATA_MASK)) -#define SBP_ODOMETRY_VEHICLE_METADATA_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_ODOMETRY_VEHICLE_METADATA_MASK << SBP_ODOMETRY_VEHICLE_METADATA_SHIFT))) | \ - (((val) & (SBP_ODOMETRY_VEHICLE_METADATA_MASK)) \ - << (SBP_ODOMETRY_VEHICLE_METADATA_SHIFT)));} while(0) - +#define SBP_ODOMETRY_VEHICLE_METADATA_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ODOMETRY_VEHICLE_METADATA_SHIFT) & \ + SBP_ODOMETRY_VEHICLE_METADATA_MASK)) +#define SBP_ODOMETRY_VEHICLE_METADATA_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_ODOMETRY_VEHICLE_METADATA_MASK \ + << SBP_ODOMETRY_VEHICLE_METADATA_SHIFT))) | \ + (((val) & (SBP_ODOMETRY_VEHICLE_METADATA_MASK)) \ + << (SBP_ODOMETRY_VEHICLE_METADATA_SHIFT))); \ + } while (0) #define SBP_ODOMETRY_VEHICLE_METADATA_UNAVAILABLE (0) #define SBP_ODOMETRY_VEHICLE_METADATA_FORWARD (1) @@ -37,14 +38,16 @@ #define SBP_ODOMETRY_VEHICLE_METADATA_PARK (3) #define SBP_ODOMETRY_VELOCITY_SOURCE_MASK (0x3u) #define SBP_ODOMETRY_VELOCITY_SOURCE_SHIFT (3u) -#define SBP_ODOMETRY_VELOCITY_SOURCE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_ODOMETRY_VELOCITY_SOURCE_SHIFT) \ - & SBP_ODOMETRY_VELOCITY_SOURCE_MASK)) -#define SBP_ODOMETRY_VELOCITY_SOURCE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_ODOMETRY_VELOCITY_SOURCE_MASK << SBP_ODOMETRY_VELOCITY_SOURCE_SHIFT))) | \ - (((val) & (SBP_ODOMETRY_VELOCITY_SOURCE_MASK)) \ - << (SBP_ODOMETRY_VELOCITY_SOURCE_SHIFT)));} while(0) - +#define SBP_ODOMETRY_VELOCITY_SOURCE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ODOMETRY_VELOCITY_SOURCE_SHIFT) & \ + SBP_ODOMETRY_VELOCITY_SOURCE_MASK)) +#define SBP_ODOMETRY_VELOCITY_SOURCE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_ODOMETRY_VELOCITY_SOURCE_MASK \ + << SBP_ODOMETRY_VELOCITY_SOURCE_SHIFT))) | \ + (((val) & (SBP_ODOMETRY_VELOCITY_SOURCE_MASK)) \ + << (SBP_ODOMETRY_VELOCITY_SOURCE_SHIFT))); \ + } while (0) #define SBP_ODOMETRY_VELOCITY_SOURCE_SOURCE_0 (0) #define SBP_ODOMETRY_VELOCITY_SOURCE_SOURCE_1 (1) @@ -52,36 +55,39 @@ #define SBP_ODOMETRY_VELOCITY_SOURCE_SOURCE_3 (3) #define SBP_ODOMETRY_TIME_SOURCE_MASK (0x7u) #define SBP_ODOMETRY_TIME_SOURCE_SHIFT (0u) -#define SBP_ODOMETRY_TIME_SOURCE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_ODOMETRY_TIME_SOURCE_SHIFT) \ - & SBP_ODOMETRY_TIME_SOURCE_MASK)) -#define SBP_ODOMETRY_TIME_SOURCE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_ODOMETRY_TIME_SOURCE_MASK << SBP_ODOMETRY_TIME_SOURCE_SHIFT))) | \ - (((val) & (SBP_ODOMETRY_TIME_SOURCE_MASK)) \ - << (SBP_ODOMETRY_TIME_SOURCE_SHIFT)));} while(0) - +#define SBP_ODOMETRY_TIME_SOURCE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ODOMETRY_TIME_SOURCE_SHIFT) & \ + SBP_ODOMETRY_TIME_SOURCE_MASK)) +#define SBP_ODOMETRY_TIME_SOURCE_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_ODOMETRY_TIME_SOURCE_MASK \ + << SBP_ODOMETRY_TIME_SOURCE_SHIFT))) | \ + (((val) & (SBP_ODOMETRY_TIME_SOURCE_MASK)) \ + << (SBP_ODOMETRY_TIME_SOURCE_SHIFT))); \ + } while (0) #define SBP_ODOMETRY_TIME_SOURCE_NONE (0) #define SBP_ODOMETRY_TIME_SOURCE_GPS_SOLUTION (1) #define SBP_ODOMETRY_TIME_SOURCE_PROCESSOR_TIME (2) /** - * Encoded length of sbp_msg_odometry_t (V4 API) and + * Encoded length of sbp_msg_odometry_t (V4 API) and * msg_odometry_t (legacy API) */ #define SBP_MSG_ODOMETRY_ENCODED_LEN 9u - #define SBP_MSG_WHEELTICK 0x0904 #define SBP_WHEELTICK_VEHICLE_METADATA_MASK (0x3u) #define SBP_WHEELTICK_VEHICLE_METADATA_SHIFT (2u) -#define SBP_WHEELTICK_VEHICLE_METADATA_GET(flags) \ - ((u8)((u8)((flags) >> SBP_WHEELTICK_VEHICLE_METADATA_SHIFT) \ - & SBP_WHEELTICK_VEHICLE_METADATA_MASK)) -#define SBP_WHEELTICK_VEHICLE_METADATA_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_WHEELTICK_VEHICLE_METADATA_MASK << SBP_WHEELTICK_VEHICLE_METADATA_SHIFT))) | \ - (((val) & (SBP_WHEELTICK_VEHICLE_METADATA_MASK)) \ - << (SBP_WHEELTICK_VEHICLE_METADATA_SHIFT)));} while(0) - +#define SBP_WHEELTICK_VEHICLE_METADATA_GET(flags) \ + ((u8)((u8)((flags) >> SBP_WHEELTICK_VEHICLE_METADATA_SHIFT) & \ + SBP_WHEELTICK_VEHICLE_METADATA_MASK)) +#define SBP_WHEELTICK_VEHICLE_METADATA_SET(flags, val) \ + do { \ + (flags) = (u8)((flags & (~(SBP_WHEELTICK_VEHICLE_METADATA_MASK \ + << SBP_WHEELTICK_VEHICLE_METADATA_SHIFT))) | \ + (((val) & (SBP_WHEELTICK_VEHICLE_METADATA_MASK)) \ + << (SBP_WHEELTICK_VEHICLE_METADATA_SHIFT))); \ + } while (0) #define SBP_WHEELTICK_VEHICLE_METADATA_UNAVAILABLE (0) #define SBP_WHEELTICK_VEHICLE_METADATA_FORWARD (1) @@ -89,24 +95,26 @@ #define SBP_WHEELTICK_VEHICLE_METADATA_PARK (3) #define SBP_WHEELTICK_SYNCHRONIZATION_TYPE_MASK (0x3u) #define SBP_WHEELTICK_SYNCHRONIZATION_TYPE_SHIFT (0u) -#define SBP_WHEELTICK_SYNCHRONIZATION_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_WHEELTICK_SYNCHRONIZATION_TYPE_SHIFT) \ - & SBP_WHEELTICK_SYNCHRONIZATION_TYPE_MASK)) -#define SBP_WHEELTICK_SYNCHRONIZATION_TYPE_SET(flags, val) \ - do {(flags) = (u8)((flags & (~(SBP_WHEELTICK_SYNCHRONIZATION_TYPE_MASK << SBP_WHEELTICK_SYNCHRONIZATION_TYPE_SHIFT))) | \ - (((val) & (SBP_WHEELTICK_SYNCHRONIZATION_TYPE_MASK)) \ - << (SBP_WHEELTICK_SYNCHRONIZATION_TYPE_SHIFT)));} while(0) - +#define SBP_WHEELTICK_SYNCHRONIZATION_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_WHEELTICK_SYNCHRONIZATION_TYPE_SHIFT) & \ + SBP_WHEELTICK_SYNCHRONIZATION_TYPE_MASK)) +#define SBP_WHEELTICK_SYNCHRONIZATION_TYPE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_WHEELTICK_SYNCHRONIZATION_TYPE_MASK \ + << SBP_WHEELTICK_SYNCHRONIZATION_TYPE_SHIFT))) | \ + (((val) & (SBP_WHEELTICK_SYNCHRONIZATION_TYPE_MASK)) \ + << (SBP_WHEELTICK_SYNCHRONIZATION_TYPE_SHIFT))); \ + } while (0) #define SBP_WHEELTICK_SYNCHRONIZATION_TYPE_MICROSECONDS_SINCE_LAST_PPS (0) #define SBP_WHEELTICK_SYNCHRONIZATION_TYPE_MICROSECONDS_IN_GPS_WEEK (1) -#define SBP_WHEELTICK_SYNCHRONIZATION_TYPE_LOCAL_CPU_TIME_IN_NOMINAL_MICROSECONDS (2) +#define SBP_WHEELTICK_SYNCHRONIZATION_TYPE_LOCAL_CPU_TIME_IN_NOMINAL_MICROSECONDS \ + (2) /** - * Encoded length of sbp_msg_wheeltick_t (V4 API) and + * Encoded length of sbp_msg_wheeltick_t (V4 API) and * msg_wheeltick_t (legacy API) */ #define SBP_MSG_WHEELTICK_ENCODED_LEN 14u - - #endif /* LIBSBP_VEHICLE_MACROS_H */ diff --git a/c/include/libsbp/version.h b/c/include/libsbp/version.h index 064652d97..9d95c9b6b 100644 --- a/c/include/libsbp/version.h +++ b/c/include/libsbp/version.h @@ -35,5 +35,4 @@ /** \} */ - #endif /* LIBSBP_VERSION_H */ diff --git a/c/src/acquisition.c b/c/src/acquisition.c index 92622039a..d118d4267 100644 --- a/c/src/acquisition.c +++ b/c/src/acquisition.c @@ -3,30 +3,39 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include -#include #include #include +#include +#include +#include #include #include -#include #include +#include -bool sbp_msg_acq_result_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_acq_result_t *msg) -{ - if (!sbp_float_encode(ctx, &msg->cn0)) { return false; } - if (!sbp_float_encode(ctx, &msg->cp)) { return false; } - if (!sbp_float_encode(ctx, &msg->cf)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } +bool sbp_msg_acq_result_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_acq_result_t *msg) { + if (!sbp_float_encode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cp)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cf)) { + return false; + } + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_msg_acq_result_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_result_t *msg) { +s8 sbp_msg_acq_result_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_acq_result_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -40,16 +49,25 @@ s8 sbp_msg_acq_result_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, cons return SBP_OK; } -bool sbp_msg_acq_result_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq_result_t *msg) -{ - if (!sbp_float_decode(ctx, &msg->cn0)) { return false; } - if (!sbp_float_decode(ctx, &msg->cp)) { return false; } - if (!sbp_float_decode(ctx, &msg->cf)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } +bool sbp_msg_acq_result_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_acq_result_t *msg) { + if (!sbp_float_decode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cp)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cf)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_msg_acq_result_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_result_t *msg) { +s8 sbp_msg_acq_result_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_acq_result_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -63,43 +81,66 @@ s8 sbp_msg_acq_result_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, s return SBP_OK; } - -s8 sbp_msg_acq_result_send(sbp_state_t *s, u16 sender_id, const sbp_msg_acq_result_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_acq_result_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_acq_result_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_acq_result_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ACQ_RESULT, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_acq_result_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ACQ_RESULT, sender_id, payload_len, + payload, write); } -int sbp_msg_acq_result_cmp(const sbp_msg_acq_result_t *a, const sbp_msg_acq_result_t *b) { +int sbp_msg_acq_result_cmp(const sbp_msg_acq_result_t *a, + const sbp_msg_acq_result_t *b) { int ret = 0; - + ret = sbp_float_cmp(&a->cn0, &b->cn0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cp, &b->cp); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cf, &b->cf); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_acq_result_dep_c_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_acq_result_dep_c_t *msg) -{ - if (!sbp_float_encode(ctx, &msg->cn0)) { return false; } - if (!sbp_float_encode(ctx, &msg->cp)) { return false; } - if (!sbp_float_encode(ctx, &msg->cf)) { return false; } - if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { return false; } +bool sbp_msg_acq_result_dep_c_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_acq_result_dep_c_t *msg) { + if (!sbp_float_encode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cp)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cf)) { + return false; + } + if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_msg_acq_result_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_result_dep_c_t *msg) { +s8 sbp_msg_acq_result_dep_c_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_acq_result_dep_c_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -113,16 +154,26 @@ s8 sbp_msg_acq_result_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written return SBP_OK; } -bool sbp_msg_acq_result_dep_c_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq_result_dep_c_t *msg) -{ - if (!sbp_float_decode(ctx, &msg->cn0)) { return false; } - if (!sbp_float_decode(ctx, &msg->cp)) { return false; } - if (!sbp_float_decode(ctx, &msg->cf)) { return false; } - if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { return false; } +bool sbp_msg_acq_result_dep_c_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_acq_result_dep_c_t *msg) { + if (!sbp_float_decode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cp)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cf)) { + return false; + } + if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_msg_acq_result_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_result_dep_c_t *msg) { +s8 sbp_msg_acq_result_dep_c_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_acq_result_dep_c_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -136,43 +187,66 @@ s8 sbp_msg_acq_result_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r return SBP_OK; } - -s8 sbp_msg_acq_result_dep_c_send(sbp_state_t *s, u16 sender_id, const sbp_msg_acq_result_dep_c_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_acq_result_dep_c_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_acq_result_dep_c_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_acq_result_dep_c_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ACQ_RESULT_DEP_C, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_acq_result_dep_c_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ACQ_RESULT_DEP_C, sender_id, payload_len, + payload, write); } -int sbp_msg_acq_result_dep_c_cmp(const sbp_msg_acq_result_dep_c_t *a, const sbp_msg_acq_result_dep_c_t *b) { +int sbp_msg_acq_result_dep_c_cmp(const sbp_msg_acq_result_dep_c_t *a, + const sbp_msg_acq_result_dep_c_t *b) { int ret = 0; - + ret = sbp_float_cmp(&a->cn0, &b->cn0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cp, &b->cp); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cf, &b->cf); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_acq_result_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_acq_result_dep_b_t *msg) -{ - if (!sbp_float_encode(ctx, &msg->snr)) { return false; } - if (!sbp_float_encode(ctx, &msg->cp)) { return false; } - if (!sbp_float_encode(ctx, &msg->cf)) { return false; } - if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { return false; } +bool sbp_msg_acq_result_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_acq_result_dep_b_t *msg) { + if (!sbp_float_encode(ctx, &msg->snr)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cp)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cf)) { + return false; + } + if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_msg_acq_result_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_result_dep_b_t *msg) { +s8 sbp_msg_acq_result_dep_b_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_acq_result_dep_b_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -186,16 +260,26 @@ s8 sbp_msg_acq_result_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written return SBP_OK; } -bool sbp_msg_acq_result_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq_result_dep_b_t *msg) -{ - if (!sbp_float_decode(ctx, &msg->snr)) { return false; } - if (!sbp_float_decode(ctx, &msg->cp)) { return false; } - if (!sbp_float_decode(ctx, &msg->cf)) { return false; } - if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { return false; } +bool sbp_msg_acq_result_dep_b_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_acq_result_dep_b_t *msg) { + if (!sbp_float_decode(ctx, &msg->snr)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cp)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cf)) { + return false; + } + if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_msg_acq_result_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_result_dep_b_t *msg) { +s8 sbp_msg_acq_result_dep_b_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_acq_result_dep_b_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -209,43 +293,66 @@ s8 sbp_msg_acq_result_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r return SBP_OK; } - -s8 sbp_msg_acq_result_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_acq_result_dep_b_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_acq_result_dep_b_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_acq_result_dep_b_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_acq_result_dep_b_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ACQ_RESULT_DEP_B, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_acq_result_dep_b_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ACQ_RESULT_DEP_B, sender_id, payload_len, + payload, write); } -int sbp_msg_acq_result_dep_b_cmp(const sbp_msg_acq_result_dep_b_t *a, const sbp_msg_acq_result_dep_b_t *b) { +int sbp_msg_acq_result_dep_b_cmp(const sbp_msg_acq_result_dep_b_t *a, + const sbp_msg_acq_result_dep_b_t *b) { int ret = 0; - + ret = sbp_float_cmp(&a->snr, &b->snr); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cp, &b->cp); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cf, &b->cf); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_acq_result_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_acq_result_dep_a_t *msg) -{ - if (!sbp_float_encode(ctx, &msg->snr)) { return false; } - if (!sbp_float_encode(ctx, &msg->cp)) { return false; } - if (!sbp_float_encode(ctx, &msg->cf)) { return false; } - if (!sbp_u8_encode(ctx, &msg->prn)) { return false; } +bool sbp_msg_acq_result_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_acq_result_dep_a_t *msg) { + if (!sbp_float_encode(ctx, &msg->snr)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cp)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cf)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->prn)) { + return false; + } return true; } -s8 sbp_msg_acq_result_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_result_dep_a_t *msg) { +s8 sbp_msg_acq_result_dep_a_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_acq_result_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -259,16 +366,26 @@ s8 sbp_msg_acq_result_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written return SBP_OK; } -bool sbp_msg_acq_result_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq_result_dep_a_t *msg) -{ - if (!sbp_float_decode(ctx, &msg->snr)) { return false; } - if (!sbp_float_decode(ctx, &msg->cp)) { return false; } - if (!sbp_float_decode(ctx, &msg->cf)) { return false; } - if (!sbp_u8_decode(ctx, &msg->prn)) { return false; } +bool sbp_msg_acq_result_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_acq_result_dep_a_t *msg) { + if (!sbp_float_decode(ctx, &msg->snr)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cp)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cf)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->prn)) { + return false; + } return true; } -s8 sbp_msg_acq_result_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_result_dep_a_t *msg) { +s8 sbp_msg_acq_result_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_acq_result_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -282,51 +399,89 @@ s8 sbp_msg_acq_result_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r return SBP_OK; } - -s8 sbp_msg_acq_result_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_acq_result_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_acq_result_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_acq_result_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_acq_result_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ACQ_RESULT_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_acq_result_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ACQ_RESULT_DEP_A, sender_id, payload_len, + payload, write); } -int sbp_msg_acq_result_dep_a_cmp(const sbp_msg_acq_result_dep_a_t *a, const sbp_msg_acq_result_dep_a_t *b) { +int sbp_msg_acq_result_dep_a_cmp(const sbp_msg_acq_result_dep_a_t *a, + const sbp_msg_acq_result_dep_a_t *b) { int ret = 0; - + ret = sbp_float_cmp(&a->snr, &b->snr); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cp, &b->cp); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cf, &b->cf); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->prn, &b->prn); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_acq_sv_profile_encode_internal(sbp_encode_ctx_t *ctx, const sbp_acq_sv_profile_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->job_type)) { return false; } - if (!sbp_u8_encode(ctx, &msg->status)) { return false; } - if (!sbp_u16_encode(ctx, &msg->cn0)) { return false; } - if (!sbp_u8_encode(ctx, &msg->int_time)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u16_encode(ctx, &msg->bin_width)) { return false; } - if (!sbp_u32_encode(ctx, &msg->timestamp)) { return false; } - if (!sbp_u32_encode(ctx, &msg->time_spent)) { return false; } - if (!sbp_s32_encode(ctx, &msg->cf_min)) { return false; } - if (!sbp_s32_encode(ctx, &msg->cf_max)) { return false; } - if (!sbp_s32_encode(ctx, &msg->cf)) { return false; } - if (!sbp_u32_encode(ctx, &msg->cp)) { return false; } +bool sbp_acq_sv_profile_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_acq_sv_profile_t *msg) { + if (!sbp_u8_encode(ctx, &msg->job_type)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->status)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->int_time)) { + return false; + } + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->bin_width)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->timestamp)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->time_spent)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->cf_min)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->cf_max)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->cf)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->cp)) { + return false; + } return true; } -s8 sbp_acq_sv_profile_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_acq_sv_profile_t *msg) { +s8 sbp_acq_sv_profile_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_acq_sv_profile_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -340,24 +495,49 @@ s8 sbp_acq_sv_profile_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, cons return SBP_OK; } -bool sbp_acq_sv_profile_decode_internal(sbp_decode_ctx_t *ctx, sbp_acq_sv_profile_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->job_type)) { return false; } - if (!sbp_u8_decode(ctx, &msg->status)) { return false; } - if (!sbp_u16_decode(ctx, &msg->cn0)) { return false; } - if (!sbp_u8_decode(ctx, &msg->int_time)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u16_decode(ctx, &msg->bin_width)) { return false; } - if (!sbp_u32_decode(ctx, &msg->timestamp)) { return false; } - if (!sbp_u32_decode(ctx, &msg->time_spent)) { return false; } - if (!sbp_s32_decode(ctx, &msg->cf_min)) { return false; } - if (!sbp_s32_decode(ctx, &msg->cf_max)) { return false; } - if (!sbp_s32_decode(ctx, &msg->cf)) { return false; } - if (!sbp_u32_decode(ctx, &msg->cp)) { return false; } +bool sbp_acq_sv_profile_decode_internal(sbp_decode_ctx_t *ctx, + sbp_acq_sv_profile_t *msg) { + if (!sbp_u8_decode(ctx, &msg->job_type)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->status)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->int_time)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->bin_width)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->timestamp)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->time_spent)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->cf_min)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->cf_max)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->cf)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->cp)) { + return false; + } return true; } -s8 sbp_acq_sv_profile_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_acq_sv_profile_t *msg) { +s8 sbp_acq_sv_profile_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_acq_sv_profile_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -371,67 +551,115 @@ s8 sbp_acq_sv_profile_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, s return SBP_OK; } - - -int sbp_acq_sv_profile_cmp(const sbp_acq_sv_profile_t *a, const sbp_acq_sv_profile_t *b) { +int sbp_acq_sv_profile_cmp(const sbp_acq_sv_profile_t *a, + const sbp_acq_sv_profile_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->job_type, &b->job_type); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->status, &b->status); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->cn0, &b->cn0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->int_time, &b->int_time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->bin_width, &b->bin_width); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->timestamp, &b->timestamp); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->time_spent, &b->time_spent); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->cf_min, &b->cf_min); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->cf_max, &b->cf_max); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->cf, &b->cf); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->cp, &b->cp); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_acq_sv_profile_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_acq_sv_profile_dep_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->job_type)) { return false; } - if (!sbp_u8_encode(ctx, &msg->status)) { return false; } - if (!sbp_u16_encode(ctx, &msg->cn0)) { return false; } - if (!sbp_u8_encode(ctx, &msg->int_time)) { return false; } - if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u16_encode(ctx, &msg->bin_width)) { return false; } - if (!sbp_u32_encode(ctx, &msg->timestamp)) { return false; } - if (!sbp_u32_encode(ctx, &msg->time_spent)) { return false; } - if (!sbp_s32_encode(ctx, &msg->cf_min)) { return false; } - if (!sbp_s32_encode(ctx, &msg->cf_max)) { return false; } - if (!sbp_s32_encode(ctx, &msg->cf)) { return false; } - if (!sbp_u32_encode(ctx, &msg->cp)) { return false; } +bool sbp_acq_sv_profile_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_acq_sv_profile_dep_t *msg) { + if (!sbp_u8_encode(ctx, &msg->job_type)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->status)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->int_time)) { + return false; + } + if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->bin_width)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->timestamp)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->time_spent)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->cf_min)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->cf_max)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->cf)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->cp)) { + return false; + } return true; } -s8 sbp_acq_sv_profile_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_acq_sv_profile_dep_t *msg) { +s8 sbp_acq_sv_profile_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_acq_sv_profile_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -445,24 +673,50 @@ s8 sbp_acq_sv_profile_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_acq_sv_profile_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_acq_sv_profile_dep_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->job_type)) { return false; } - if (!sbp_u8_decode(ctx, &msg->status)) { return false; } - if (!sbp_u16_decode(ctx, &msg->cn0)) { return false; } - if (!sbp_u8_decode(ctx, &msg->int_time)) { return false; } - if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u16_decode(ctx, &msg->bin_width)) { return false; } - if (!sbp_u32_decode(ctx, &msg->timestamp)) { return false; } - if (!sbp_u32_decode(ctx, &msg->time_spent)) { return false; } - if (!sbp_s32_decode(ctx, &msg->cf_min)) { return false; } - if (!sbp_s32_decode(ctx, &msg->cf_max)) { return false; } - if (!sbp_s32_decode(ctx, &msg->cf)) { return false; } - if (!sbp_u32_decode(ctx, &msg->cp)) { return false; } +bool sbp_acq_sv_profile_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_acq_sv_profile_dep_t *msg) { + if (!sbp_u8_decode(ctx, &msg->job_type)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->status)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->int_time)) { + return false; + } + if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->bin_width)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->timestamp)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->time_spent)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->cf_min)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->cf_max)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->cf)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->cp)) { + return false; + } return true; } -s8 sbp_acq_sv_profile_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_acq_sv_profile_dep_t *msg) { +s8 sbp_acq_sv_profile_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_acq_sv_profile_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -476,59 +730,84 @@ s8 sbp_acq_sv_profile_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - - -int sbp_acq_sv_profile_dep_cmp(const sbp_acq_sv_profile_dep_t *a, const sbp_acq_sv_profile_dep_t *b) { +int sbp_acq_sv_profile_dep_cmp(const sbp_acq_sv_profile_dep_t *a, + const sbp_acq_sv_profile_dep_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->job_type, &b->job_type); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->status, &b->status); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->cn0, &b->cn0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->int_time, &b->int_time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->bin_width, &b->bin_width); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->timestamp, &b->timestamp); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->time_spent, &b->time_spent); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->cf_min, &b->cf_min); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->cf_max, &b->cf_max); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->cf, &b->cf); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->cp, &b->cp); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_acq_sv_profile_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_acq_sv_profile_t *msg) -{ - for (size_t i = 0; i < msg->n_acq_sv_profile; i++) - { - if (!sbp_acq_sv_profile_encode_internal(ctx, &msg->acq_sv_profile[i])) { return false; } +bool sbp_msg_acq_sv_profile_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_acq_sv_profile_t *msg) { + for (size_t i = 0; i < msg->n_acq_sv_profile; i++) { + if (!sbp_acq_sv_profile_encode_internal(ctx, &msg->acq_sv_profile[i])) { + return false; + } } return true; } -s8 sbp_msg_acq_sv_profile_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_sv_profile_t *msg) { +s8 sbp_msg_acq_sv_profile_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_acq_sv_profile_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -542,19 +821,24 @@ s8 sbp_msg_acq_sv_profile_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_acq_sv_profile_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq_sv_profile_t *msg) -{ - if ( ((ctx->buf_len - ctx->offset) % SBP_ACQ_SV_PROFILE_ENCODED_LEN) != 0) { +bool sbp_msg_acq_sv_profile_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_acq_sv_profile_t *msg) { + if (((ctx->buf_len - ctx->offset) % SBP_ACQ_SV_PROFILE_ENCODED_LEN) != 0) { + return false; + } + msg->n_acq_sv_profile = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ACQ_SV_PROFILE_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_acq_sv_profile; i++) { + if (!sbp_acq_sv_profile_decode_internal(ctx, &msg->acq_sv_profile[i])) { return false; } - msg->n_acq_sv_profile = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ACQ_SV_PROFILE_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_acq_sv_profile; i++) { - if (!sbp_acq_sv_profile_decode_internal(ctx, &msg->acq_sv_profile[i])) { return false; } - } + } return true; } -s8 sbp_msg_acq_sv_profile_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_sv_profile_t *msg) { +s8 sbp_msg_acq_sv_profile_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_acq_sv_profile_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -568,38 +852,47 @@ s8 sbp_msg_acq_sv_profile_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - -s8 sbp_msg_acq_sv_profile_send(sbp_state_t *s, u16 sender_id, const sbp_msg_acq_sv_profile_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_acq_sv_profile_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_acq_sv_profile_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_acq_sv_profile_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ACQ_SV_PROFILE, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_acq_sv_profile_encode(payload, sizeof(payload), &payload_len, + msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ACQ_SV_PROFILE, sender_id, payload_len, + payload, write); } -int sbp_msg_acq_sv_profile_cmp(const sbp_msg_acq_sv_profile_t *a, const sbp_msg_acq_sv_profile_t *b) { +int sbp_msg_acq_sv_profile_cmp(const sbp_msg_acq_sv_profile_t *a, + const sbp_msg_acq_sv_profile_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->n_acq_sv_profile, &b->n_acq_sv_profile); - for (uint8_t i = 0; ret == 0 && i < a->n_acq_sv_profile; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_acq_sv_profile; i++) { ret = sbp_acq_sv_profile_cmp(&a->acq_sv_profile[i], &b->acq_sv_profile[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_acq_sv_profile_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_acq_sv_profile_dep_t *msg) -{ - for (size_t i = 0; i < msg->n_acq_sv_profile; i++) - { - if (!sbp_acq_sv_profile_dep_encode_internal(ctx, &msg->acq_sv_profile[i])) { return false; } +bool sbp_msg_acq_sv_profile_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_acq_sv_profile_dep_t *msg) { + for (size_t i = 0; i < msg->n_acq_sv_profile; i++) { + if (!sbp_acq_sv_profile_dep_encode_internal(ctx, &msg->acq_sv_profile[i])) { + return false; + } } return true; } -s8 sbp_msg_acq_sv_profile_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acq_sv_profile_dep_t *msg) { +s8 sbp_msg_acq_sv_profile_dep_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_acq_sv_profile_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -613,19 +906,25 @@ s8 sbp_msg_acq_sv_profile_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_writt return SBP_OK; } -bool sbp_msg_acq_sv_profile_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq_sv_profile_dep_t *msg) -{ - if ( ((ctx->buf_len - ctx->offset) % SBP_ACQ_SV_PROFILE_DEP_ENCODED_LEN) != 0) { +bool sbp_msg_acq_sv_profile_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_acq_sv_profile_dep_t *msg) { + if (((ctx->buf_len - ctx->offset) % SBP_ACQ_SV_PROFILE_DEP_ENCODED_LEN) != + 0) { + return false; + } + msg->n_acq_sv_profile = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_ACQ_SV_PROFILE_DEP_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_acq_sv_profile; i++) { + if (!sbp_acq_sv_profile_dep_decode_internal(ctx, &msg->acq_sv_profile[i])) { return false; } - msg->n_acq_sv_profile = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ACQ_SV_PROFILE_DEP_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_acq_sv_profile; i++) { - if (!sbp_acq_sv_profile_dep_decode_internal(ctx, &msg->acq_sv_profile[i])) { return false; } - } + } return true; } -s8 sbp_msg_acq_sv_profile_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acq_sv_profile_dep_t *msg) { +s8 sbp_msg_acq_sv_profile_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_acq_sv_profile_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -639,24 +938,31 @@ s8 sbp_msg_acq_sv_profile_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } - -s8 sbp_msg_acq_sv_profile_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_acq_sv_profile_dep_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_acq_sv_profile_dep_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_acq_sv_profile_dep_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_acq_sv_profile_dep_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ACQ_SV_PROFILE_DEP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_acq_sv_profile_dep_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ACQ_SV_PROFILE_DEP, sender_id, payload_len, + payload, write); } -int sbp_msg_acq_sv_profile_dep_cmp(const sbp_msg_acq_sv_profile_dep_t *a, const sbp_msg_acq_sv_profile_dep_t *b) { +int sbp_msg_acq_sv_profile_dep_cmp(const sbp_msg_acq_sv_profile_dep_t *a, + const sbp_msg_acq_sv_profile_dep_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->n_acq_sv_profile, &b->n_acq_sv_profile); - for (uint8_t i = 0; ret == 0 && i < a->n_acq_sv_profile; i++) - { - ret = sbp_acq_sv_profile_dep_cmp(&a->acq_sv_profile[i], &b->acq_sv_profile[i]); + for (uint8_t i = 0; ret == 0 && i < a->n_acq_sv_profile; i++) { + ret = sbp_acq_sv_profile_dep_cmp(&a->acq_sv_profile[i], + &b->acq_sv_profile[i]); + } + if (ret != 0) { + return ret; } - if (ret != 0) { return ret; } return ret; } diff --git a/c/src/bootload.c b/c/src/bootload.c index 3bf206b2b..d91a2eba5 100644 --- a/c/src/bootload.c +++ b/c/src/bootload.c @@ -3,28 +3,30 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include -#include #include #include +#include +#include +#include #include #include -#include #include +#include -bool sbp_msg_bootloader_handshake_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_handshake_req_t *msg) -{ +bool sbp_msg_bootloader_handshake_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_handshake_req_t *msg) { (void)ctx; (void)msg; return true; } -s8 sbp_msg_bootloader_handshake_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_bootloader_handshake_req_t *msg) { +s8 sbp_msg_bootloader_handshake_req_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_bootloader_handshake_req_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -38,14 +40,16 @@ s8 sbp_msg_bootloader_handshake_req_encode(uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } -bool sbp_msg_bootloader_handshake_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_bootloader_handshake_req_t *msg) -{ - (void)ctx; +bool sbp_msg_bootloader_handshake_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_bootloader_handshake_req_t *msg) { + (void)ctx; (void)msg; return true; } -s8 sbp_msg_bootloader_handshake_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_bootloader_handshake_req_t *msg) { +s8 sbp_msg_bootloader_handshake_req_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_bootloader_handshake_req_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -59,104 +63,141 @@ s8 sbp_msg_bootloader_handshake_req_decode(const uint8_t *buf, uint8_t len, uint return SBP_OK; } - -s8 sbp_msg_bootloader_handshake_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_bootloader_handshake_req_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_bootloader_handshake_req_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_bootloader_handshake_req_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_bootloader_handshake_req_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_BOOTLOADER_HANDSHAKE_REQ, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_bootloader_handshake_req_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_BOOTLOADER_HANDSHAKE_REQ, sender_id, + payload_len, payload, write); } -int sbp_msg_bootloader_handshake_req_cmp(const sbp_msg_bootloader_handshake_req_t *a, const sbp_msg_bootloader_handshake_req_t *b) { +int sbp_msg_bootloader_handshake_req_cmp( + const sbp_msg_bootloader_handshake_req_t *a, + const sbp_msg_bootloader_handshake_req_t *b) { (void)a; (void)b; int ret = 0; return ret; } -void sbp_msg_bootloader_handshake_resp_version_init(sbp_msg_bootloader_handshake_resp_t *msg) -{ +void sbp_msg_bootloader_handshake_resp_version_init( + sbp_msg_bootloader_handshake_resp_t *msg) { sbp_unterminated_string_init(&msg->version); } -bool sbp_msg_bootloader_handshake_resp_version_valid(const sbp_msg_bootloader_handshake_resp_t *msg) -{ - return sbp_unterminated_string_valid(&msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX); +bool sbp_msg_bootloader_handshake_resp_version_valid( + const sbp_msg_bootloader_handshake_resp_t *msg) { + return sbp_unterminated_string_valid( + &msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX); } -int sbp_msg_bootloader_handshake_resp_version_strcmp(const sbp_msg_bootloader_handshake_resp_t *a, const sbp_msg_bootloader_handshake_resp_t *b) -{ - return sbp_unterminated_string_strcmp(&a->version, &b->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX); +int sbp_msg_bootloader_handshake_resp_version_strcmp( + const sbp_msg_bootloader_handshake_resp_t *a, + const sbp_msg_bootloader_handshake_resp_t *b) { + return sbp_unterminated_string_strcmp( + &a->version, &b->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX); } -size_t sbp_msg_bootloader_handshake_resp_version_encoded_len(const sbp_msg_bootloader_handshake_resp_t *msg) -{ - return sbp_unterminated_string_encoded_len(&msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX); +size_t sbp_msg_bootloader_handshake_resp_version_encoded_len( + const sbp_msg_bootloader_handshake_resp_t *msg) { + return sbp_unterminated_string_encoded_len( + &msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX); } -size_t sbp_msg_bootloader_handshake_resp_version_space_remaining(const sbp_msg_bootloader_handshake_resp_t *msg) -{ - return sbp_unterminated_string_space_remaining(&msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX); +size_t sbp_msg_bootloader_handshake_resp_version_space_remaining( + const sbp_msg_bootloader_handshake_resp_t *msg) { + return sbp_unterminated_string_space_remaining( + &msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX); } - bool sbp_msg_bootloader_handshake_resp_version_set(sbp_msg_bootloader_handshake_resp_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set(&msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, should_trunc, n_written, new_str); +bool sbp_msg_bootloader_handshake_resp_version_set( + sbp_msg_bootloader_handshake_resp_t *msg, const char *new_str, + bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set( + &msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_bootloader_handshake_resp_version_set_raw(sbp_msg_bootloader_handshake_resp_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set_raw(&msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_bootloader_handshake_resp_version_set_raw( + sbp_msg_bootloader_handshake_resp_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set_raw( + &msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, + should_trunc, n_written, new_buf, new_buf_len); } - -bool sbp_msg_bootloader_handshake_resp_version_printf(sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_bootloader_handshake_resp_version_printf( + sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_vprintf(&msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_vprintf( + &msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, + should_trunc, n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_bootloader_handshake_resp_version_vprintf(sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_vprintf(&msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_bootloader_handshake_resp_version_vprintf( + sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) { + return sbp_unterminated_string_vprintf( + &msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, + should_trunc, n_written, fmt, ap); } -bool sbp_msg_bootloader_handshake_resp_version_append_printf(sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_bootloader_handshake_resp_version_append_printf( + sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_append_vprintf(&msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_append_vprintf( + &msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, + should_trunc, n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_bootloader_handshake_resp_version_append_vprintf(sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_append_vprintf(&msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_bootloader_handshake_resp_version_append_vprintf( + sbp_msg_bootloader_handshake_resp_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) { + return sbp_unterminated_string_append_vprintf( + &msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, + should_trunc, n_written, fmt, ap); } -const char *sbp_msg_bootloader_handshake_resp_version_get(const sbp_msg_bootloader_handshake_resp_t *msg) -{ - return sbp_unterminated_string_get(&msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX); +const char *sbp_msg_bootloader_handshake_resp_version_get( + const sbp_msg_bootloader_handshake_resp_t *msg) { + return sbp_unterminated_string_get( + &msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX); } -size_t sbp_msg_bootloader_handshake_resp_version_strlen(const sbp_msg_bootloader_handshake_resp_t *msg) -{ - return sbp_unterminated_string_strlen(&msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX); +size_t sbp_msg_bootloader_handshake_resp_version_strlen( + const sbp_msg_bootloader_handshake_resp_t *msg) { + return sbp_unterminated_string_strlen( + &msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX); } -bool sbp_msg_bootloader_handshake_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_handshake_resp_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->flags)) { return false; } - if (!sbp_unterminated_string_encode(&msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, ctx)) { return false; } +bool sbp_msg_bootloader_handshake_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_handshake_resp_t *msg) { + if (!sbp_u32_encode(ctx, &msg->flags)) { + return false; + } + if (!sbp_unterminated_string_encode( + &msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_bootloader_handshake_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_bootloader_handshake_resp_t *msg) { +s8 sbp_msg_bootloader_handshake_resp_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_bootloader_handshake_resp_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -170,14 +211,21 @@ s8 sbp_msg_bootloader_handshake_resp_encode(uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } -bool sbp_msg_bootloader_handshake_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_bootloader_handshake_resp_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->flags)) { return false; } - if (!sbp_unterminated_string_decode(&msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, ctx)) { return false; } +bool sbp_msg_bootloader_handshake_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_bootloader_handshake_resp_t *msg) { + if (!sbp_u32_decode(ctx, &msg->flags)) { + return false; + } + if (!sbp_unterminated_string_decode( + &msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_bootloader_handshake_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_bootloader_handshake_resp_t *msg) { +s8 sbp_msg_bootloader_handshake_resp_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_bootloader_handshake_resp_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -191,34 +239,48 @@ s8 sbp_msg_bootloader_handshake_resp_decode(const uint8_t *buf, uint8_t len, uin return SBP_OK; } - -s8 sbp_msg_bootloader_handshake_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_bootloader_handshake_resp_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_bootloader_handshake_resp_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_bootloader_handshake_resp_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_bootloader_handshake_resp_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_bootloader_handshake_resp_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP, sender_id, + payload_len, payload, write); } -int sbp_msg_bootloader_handshake_resp_cmp(const sbp_msg_bootloader_handshake_resp_t *a, const sbp_msg_bootloader_handshake_resp_t *b) { +int sbp_msg_bootloader_handshake_resp_cmp( + const sbp_msg_bootloader_handshake_resp_t *a, + const sbp_msg_bootloader_handshake_resp_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_bootloader_handshake_resp_version_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_bootloader_jump_to_app_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_jump_to_app_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->jump)) { return false; } +bool sbp_msg_bootloader_jump_to_app_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_jump_to_app_t *msg) { + if (!sbp_u8_encode(ctx, &msg->jump)) { + return false; + } return true; } -s8 sbp_msg_bootloader_jump_to_app_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_bootloader_jump_to_app_t *msg) { +s8 sbp_msg_bootloader_jump_to_app_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_bootloader_jump_to_app_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -232,13 +294,17 @@ s8 sbp_msg_bootloader_jump_to_app_encode(uint8_t *buf, uint8_t len, uint8_t *n_w return SBP_OK; } -bool sbp_msg_bootloader_jump_to_app_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_bootloader_jump_to_app_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->jump)) { return false; } +bool sbp_msg_bootloader_jump_to_app_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_bootloader_jump_to_app_t *msg) { + if (!sbp_u8_decode(ctx, &msg->jump)) { + return false; + } return true; } -s8 sbp_msg_bootloader_jump_to_app_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_bootloader_jump_to_app_t *msg) { +s8 sbp_msg_bootloader_jump_to_app_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_bootloader_jump_to_app_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -252,32 +318,42 @@ s8 sbp_msg_bootloader_jump_to_app_decode(const uint8_t *buf, uint8_t len, uint8_ return SBP_OK; } - -s8 sbp_msg_bootloader_jump_to_app_send(sbp_state_t *s, u16 sender_id, const sbp_msg_bootloader_jump_to_app_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_bootloader_jump_to_app_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_bootloader_jump_to_app_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_bootloader_jump_to_app_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_BOOTLOADER_JUMP_TO_APP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_bootloader_jump_to_app_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_BOOTLOADER_JUMP_TO_APP, sender_id, + payload_len, payload, write); } -int sbp_msg_bootloader_jump_to_app_cmp(const sbp_msg_bootloader_jump_to_app_t *a, const sbp_msg_bootloader_jump_to_app_t *b) { +int sbp_msg_bootloader_jump_to_app_cmp( + const sbp_msg_bootloader_jump_to_app_t *a, + const sbp_msg_bootloader_jump_to_app_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->jump, &b->jump); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_nap_device_dna_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_nap_device_dna_req_t *msg) -{ +bool sbp_msg_nap_device_dna_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_nap_device_dna_req_t *msg) { (void)ctx; (void)msg; return true; } -s8 sbp_msg_nap_device_dna_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_nap_device_dna_req_t *msg) { +s8 sbp_msg_nap_device_dna_req_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_nap_device_dna_req_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -291,14 +367,16 @@ s8 sbp_msg_nap_device_dna_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_writt return SBP_OK; } -bool sbp_msg_nap_device_dna_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_nap_device_dna_req_t *msg) -{ - (void)ctx; +bool sbp_msg_nap_device_dna_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_nap_device_dna_req_t *msg) { + (void)ctx; (void)msg; return true; } -s8 sbp_msg_nap_device_dna_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_nap_device_dna_req_t *msg) { +s8 sbp_msg_nap_device_dna_req_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_nap_device_dna_req_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -312,33 +390,41 @@ s8 sbp_msg_nap_device_dna_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } - -s8 sbp_msg_nap_device_dna_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_nap_device_dna_req_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_nap_device_dna_req_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_nap_device_dna_req_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_nap_device_dna_req_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_NAP_DEVICE_DNA_REQ, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_nap_device_dna_req_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_NAP_DEVICE_DNA_REQ, sender_id, payload_len, + payload, write); } -int sbp_msg_nap_device_dna_req_cmp(const sbp_msg_nap_device_dna_req_t *a, const sbp_msg_nap_device_dna_req_t *b) { +int sbp_msg_nap_device_dna_req_cmp(const sbp_msg_nap_device_dna_req_t *a, + const sbp_msg_nap_device_dna_req_t *b) { (void)a; (void)b; int ret = 0; return ret; } -bool sbp_msg_nap_device_dna_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_nap_device_dna_resp_t *msg) -{ - for (size_t i = 0; i < SBP_MSG_NAP_DEVICE_DNA_RESP_DNA_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->dna[i])) { return false; } +bool sbp_msg_nap_device_dna_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_nap_device_dna_resp_t *msg) { + for (size_t i = 0; i < SBP_MSG_NAP_DEVICE_DNA_RESP_DNA_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->dna[i])) { + return false; + } } return true; } -s8 sbp_msg_nap_device_dna_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_nap_device_dna_resp_t *msg) { +s8 sbp_msg_nap_device_dna_resp_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_nap_device_dna_resp_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -352,15 +438,19 @@ s8 sbp_msg_nap_device_dna_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_writ return SBP_OK; } -bool sbp_msg_nap_device_dna_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_nap_device_dna_resp_t *msg) -{ +bool sbp_msg_nap_device_dna_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_nap_device_dna_resp_t *msg) { for (uint8_t i = 0; i < SBP_MSG_NAP_DEVICE_DNA_RESP_DNA_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->dna[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->dna[i])) { + return false; + } } return true; } -s8 sbp_msg_nap_device_dna_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_nap_device_dna_resp_t *msg) { +s8 sbp_msg_nap_device_dna_resp_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_nap_device_dna_resp_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -374,107 +464,145 @@ s8 sbp_msg_nap_device_dna_resp_decode(const uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } - -s8 sbp_msg_nap_device_dna_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_nap_device_dna_resp_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_nap_device_dna_resp_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_nap_device_dna_resp_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_nap_device_dna_resp_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_NAP_DEVICE_DNA_RESP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_nap_device_dna_resp_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_NAP_DEVICE_DNA_RESP, sender_id, + payload_len, payload, write); } -int sbp_msg_nap_device_dna_resp_cmp(const sbp_msg_nap_device_dna_resp_t *a, const sbp_msg_nap_device_dna_resp_t *b) { +int sbp_msg_nap_device_dna_resp_cmp(const sbp_msg_nap_device_dna_resp_t *a, + const sbp_msg_nap_device_dna_resp_t *b) { int ret = 0; - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_NAP_DEVICE_DNA_RESP_DNA_MAX; i++) - { + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_NAP_DEVICE_DNA_RESP_DNA_MAX; + i++) { ret = sbp_u8_cmp(&a->dna[i], &b->dna[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_bootloader_handshake_dep_a_handshake_init(sbp_msg_bootloader_handshake_dep_a_t *msg) -{ +void sbp_msg_bootloader_handshake_dep_a_handshake_init( + sbp_msg_bootloader_handshake_dep_a_t *msg) { sbp_unterminated_string_init(&msg->handshake); } -bool sbp_msg_bootloader_handshake_dep_a_handshake_valid(const sbp_msg_bootloader_handshake_dep_a_t *msg) -{ - return sbp_unterminated_string_valid(&msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX); +bool sbp_msg_bootloader_handshake_dep_a_handshake_valid( + const sbp_msg_bootloader_handshake_dep_a_t *msg) { + return sbp_unterminated_string_valid( + &msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX); } -int sbp_msg_bootloader_handshake_dep_a_handshake_strcmp(const sbp_msg_bootloader_handshake_dep_a_t *a, const sbp_msg_bootloader_handshake_dep_a_t *b) -{ - return sbp_unterminated_string_strcmp(&a->handshake, &b->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX); +int sbp_msg_bootloader_handshake_dep_a_handshake_strcmp( + const sbp_msg_bootloader_handshake_dep_a_t *a, + const sbp_msg_bootloader_handshake_dep_a_t *b) { + return sbp_unterminated_string_strcmp( + &a->handshake, &b->handshake, + SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX); } -size_t sbp_msg_bootloader_handshake_dep_a_handshake_encoded_len(const sbp_msg_bootloader_handshake_dep_a_t *msg) -{ - return sbp_unterminated_string_encoded_len(&msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX); +size_t sbp_msg_bootloader_handshake_dep_a_handshake_encoded_len( + const sbp_msg_bootloader_handshake_dep_a_t *msg) { + return sbp_unterminated_string_encoded_len( + &msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX); } -size_t sbp_msg_bootloader_handshake_dep_a_handshake_space_remaining(const sbp_msg_bootloader_handshake_dep_a_t *msg) -{ - return sbp_unterminated_string_space_remaining(&msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX); +size_t sbp_msg_bootloader_handshake_dep_a_handshake_space_remaining( + const sbp_msg_bootloader_handshake_dep_a_t *msg) { + return sbp_unterminated_string_space_remaining( + &msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX); } - bool sbp_msg_bootloader_handshake_dep_a_handshake_set(sbp_msg_bootloader_handshake_dep_a_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set(&msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, should_trunc, n_written, new_str); +bool sbp_msg_bootloader_handshake_dep_a_handshake_set( + sbp_msg_bootloader_handshake_dep_a_t *msg, const char *new_str, + bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set( + &msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_bootloader_handshake_dep_a_handshake_set_raw(sbp_msg_bootloader_handshake_dep_a_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set_raw(&msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_bootloader_handshake_dep_a_handshake_set_raw( + sbp_msg_bootloader_handshake_dep_a_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set_raw( + &msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, + should_trunc, n_written, new_buf, new_buf_len); } - -bool sbp_msg_bootloader_handshake_dep_a_handshake_printf(sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_bootloader_handshake_dep_a_handshake_printf( + sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_vprintf(&msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_vprintf( + &msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, + should_trunc, n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_bootloader_handshake_dep_a_handshake_vprintf(sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_vprintf(&msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_bootloader_handshake_dep_a_handshake_vprintf( + sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) { + return sbp_unterminated_string_vprintf( + &msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, + should_trunc, n_written, fmt, ap); } -bool sbp_msg_bootloader_handshake_dep_a_handshake_append_printf(sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_bootloader_handshake_dep_a_handshake_append_printf( + sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_append_vprintf(&msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_append_vprintf( + &msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, + should_trunc, n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_bootloader_handshake_dep_a_handshake_append_vprintf(sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_append_vprintf(&msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_bootloader_handshake_dep_a_handshake_append_vprintf( + sbp_msg_bootloader_handshake_dep_a_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) { + return sbp_unterminated_string_append_vprintf( + &msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, + should_trunc, n_written, fmt, ap); } -const char *sbp_msg_bootloader_handshake_dep_a_handshake_get(const sbp_msg_bootloader_handshake_dep_a_t *msg) -{ - return sbp_unterminated_string_get(&msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX); +const char *sbp_msg_bootloader_handshake_dep_a_handshake_get( + const sbp_msg_bootloader_handshake_dep_a_t *msg) { + return sbp_unterminated_string_get( + &msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX); } -size_t sbp_msg_bootloader_handshake_dep_a_handshake_strlen(const sbp_msg_bootloader_handshake_dep_a_t *msg) -{ - return sbp_unterminated_string_strlen(&msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX); +size_t sbp_msg_bootloader_handshake_dep_a_handshake_strlen( + const sbp_msg_bootloader_handshake_dep_a_t *msg) { + return sbp_unterminated_string_strlen( + &msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX); } -bool sbp_msg_bootloader_handshake_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_handshake_dep_a_t *msg) -{ - if (!sbp_unterminated_string_encode(&msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, ctx)) { return false; } +bool sbp_msg_bootloader_handshake_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_handshake_dep_a_t *msg) { + if (!sbp_unterminated_string_encode( + &msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, + ctx)) { + return false; + } return true; } -s8 sbp_msg_bootloader_handshake_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_bootloader_handshake_dep_a_t *msg) { +s8 sbp_msg_bootloader_handshake_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_bootloader_handshake_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -488,13 +616,19 @@ s8 sbp_msg_bootloader_handshake_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } -bool sbp_msg_bootloader_handshake_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_bootloader_handshake_dep_a_t *msg) -{ - if (!sbp_unterminated_string_decode(&msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, ctx)) { return false; } +bool sbp_msg_bootloader_handshake_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_bootloader_handshake_dep_a_t *msg) { + if (!sbp_unterminated_string_decode( + &msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, + ctx)) { + return false; + } return true; } -s8 sbp_msg_bootloader_handshake_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_bootloader_handshake_dep_a_t *msg) { +s8 sbp_msg_bootloader_handshake_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_bootloader_handshake_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -508,20 +642,28 @@ s8 sbp_msg_bootloader_handshake_dep_a_decode(const uint8_t *buf, uint8_t len, ui return SBP_OK; } - -s8 sbp_msg_bootloader_handshake_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_bootloader_handshake_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_bootloader_handshake_dep_a_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_bootloader_handshake_dep_a_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_bootloader_handshake_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_bootloader_handshake_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_bootloader_handshake_dep_a_cmp(const sbp_msg_bootloader_handshake_dep_a_t *a, const sbp_msg_bootloader_handshake_dep_a_t *b) { +int sbp_msg_bootloader_handshake_dep_a_cmp( + const sbp_msg_bootloader_handshake_dep_a_t *a, + const sbp_msg_bootloader_handshake_dep_a_t *b) { int ret = 0; - + ret = sbp_msg_bootloader_handshake_dep_a_handshake_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/ext_events.c b/c/src/ext_events.c index 1e180de6f..50f53cf57 100644 --- a/c/src/ext_events.c +++ b/c/src/ext_events.c @@ -3,31 +3,42 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include -#include #include +#include #include +#include +#include #include #include -#include #include +#include -bool sbp_msg_ext_event_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ext_event_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->wn)) { return false; } - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->ns_residual)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->pin)) { return false; } +bool sbp_msg_ext_event_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ext_event_t *msg) { + if (!sbp_u16_encode(ctx, &msg->wn)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->ns_residual)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->pin)) { + return false; + } return true; } -s8 sbp_msg_ext_event_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ext_event_t *msg) { +s8 sbp_msg_ext_event_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ext_event_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -41,17 +52,28 @@ s8 sbp_msg_ext_event_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_ext_event_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ext_event_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->wn)) { return false; } - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->ns_residual)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->pin)) { return false; } +bool sbp_msg_ext_event_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ext_event_t *msg) { + if (!sbp_u16_decode(ctx, &msg->wn)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->ns_residual)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->pin)) { + return false; + } return true; } -s8 sbp_msg_ext_event_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ext_event_t *msg) { +s8 sbp_msg_ext_event_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ext_event_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -65,32 +87,47 @@ s8 sbp_msg_ext_event_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - -s8 sbp_msg_ext_event_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ext_event_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ext_event_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ext_event_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ext_event_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EXT_EVENT, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_ext_event_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EXT_EVENT, sender_id, payload_len, payload, + write); } -int sbp_msg_ext_event_cmp(const sbp_msg_ext_event_t *a, const sbp_msg_ext_event_t *b) { +int sbp_msg_ext_event_cmp(const sbp_msg_ext_event_t *a, + const sbp_msg_ext_event_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->wn, &b->wn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->ns_residual, &b->ns_residual); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->pin, &b->pin); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/file_io.c b/c/src/file_io.c index 7cc5b1bc7..0347ed801 100644 --- a/c/src/file_io.c +++ b/c/src/file_io.c @@ -3,103 +3,140 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include -#include #include +#include #include +#include +#include #include #include -#include #include +#include -void sbp_msg_fileio_read_req_filename_init(sbp_msg_fileio_read_req_t *msg) -{ +void sbp_msg_fileio_read_req_filename_init(sbp_msg_fileio_read_req_t *msg) { sbp_null_terminated_string_init(&msg->filename); } -bool sbp_msg_fileio_read_req_filename_valid(const sbp_msg_fileio_read_req_t *msg) -{ - return sbp_null_terminated_string_valid(&msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX); +bool sbp_msg_fileio_read_req_filename_valid( + const sbp_msg_fileio_read_req_t *msg) { + return sbp_null_terminated_string_valid(&msg->filename, + SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX); } -int sbp_msg_fileio_read_req_filename_strcmp(const sbp_msg_fileio_read_req_t *a, const sbp_msg_fileio_read_req_t *b) -{ - return sbp_null_terminated_string_strcmp(&a->filename, &b->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX); +int sbp_msg_fileio_read_req_filename_strcmp( + const sbp_msg_fileio_read_req_t *a, const sbp_msg_fileio_read_req_t *b) { + return sbp_null_terminated_string_strcmp( + &a->filename, &b->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX); } -size_t sbp_msg_fileio_read_req_filename_encoded_len(const sbp_msg_fileio_read_req_t *msg) -{ - return sbp_null_terminated_string_encoded_len(&msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX); +size_t sbp_msg_fileio_read_req_filename_encoded_len( + const sbp_msg_fileio_read_req_t *msg) { + return sbp_null_terminated_string_encoded_len( + &msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX); } -size_t sbp_msg_fileio_read_req_filename_space_remaining(const sbp_msg_fileio_read_req_t *msg) -{ - return sbp_null_terminated_string_space_remaining(&msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX); +size_t sbp_msg_fileio_read_req_filename_space_remaining( + const sbp_msg_fileio_read_req_t *msg) { + return sbp_null_terminated_string_space_remaining( + &msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX); } - bool sbp_msg_fileio_read_req_filename_set(sbp_msg_fileio_read_req_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_null_terminated_string_set(&msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, should_trunc, n_written, new_str); +bool sbp_msg_fileio_read_req_filename_set(sbp_msg_fileio_read_req_t *msg, + const char *new_str, + bool should_trunc, + size_t *n_written) { + return sbp_null_terminated_string_set(&msg->filename, + SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_fileio_read_req_filename_set_raw(sbp_msg_fileio_read_req_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_null_terminated_string_set_raw(&msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_fileio_read_req_filename_set_raw(sbp_msg_fileio_read_req_t *msg, + const char *new_buf, + size_t new_buf_len, + bool should_trunc, + size_t *n_written) { + return sbp_null_terminated_string_set_raw( + &msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, should_trunc, + n_written, new_buf, new_buf_len); } - -bool sbp_msg_fileio_read_req_filename_printf(sbp_msg_fileio_read_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_fileio_read_req_filename_printf(sbp_msg_fileio_read_req_t *msg, + bool should_trunc, + size_t *n_written, const char *fmt, + ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_null_terminated_string_vprintf(&msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_null_terminated_string_vprintf( + &msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_fileio_read_req_filename_vprintf(sbp_msg_fileio_read_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_null_terminated_string_vprintf(&msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_fileio_read_req_filename_vprintf(sbp_msg_fileio_read_req_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, va_list ap) { + return sbp_null_terminated_string_vprintf( + &msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, should_trunc, + n_written, fmt, ap); } -bool sbp_msg_fileio_read_req_filename_append_printf(sbp_msg_fileio_read_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_fileio_read_req_filename_append_printf( + sbp_msg_fileio_read_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_null_terminated_string_append_vprintf(&msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_null_terminated_string_append_vprintf( + &msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_fileio_read_req_filename_append_vprintf(sbp_msg_fileio_read_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_null_terminated_string_append_vprintf(&msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_fileio_read_req_filename_append_vprintf( + sbp_msg_fileio_read_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_null_terminated_string_append_vprintf( + &msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, should_trunc, + n_written, fmt, ap); } -const char *sbp_msg_fileio_read_req_filename_get(const sbp_msg_fileio_read_req_t *msg) -{ - return sbp_null_terminated_string_get(&msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX); +const char *sbp_msg_fileio_read_req_filename_get( + const sbp_msg_fileio_read_req_t *msg) { + return sbp_null_terminated_string_get(&msg->filename, + SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX); } -size_t sbp_msg_fileio_read_req_filename_strlen(const sbp_msg_fileio_read_req_t *msg) -{ - return sbp_null_terminated_string_strlen(&msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX); +size_t sbp_msg_fileio_read_req_filename_strlen( + const sbp_msg_fileio_read_req_t *msg) { + return sbp_null_terminated_string_strlen( + &msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX); } -bool sbp_msg_fileio_read_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_req_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->sequence)) { return false; } - if (!sbp_u32_encode(ctx, &msg->offset)) { return false; } - if (!sbp_u8_encode(ctx, &msg->chunk_size)) { return false; } - if (!sbp_null_terminated_string_encode(&msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, ctx)) { return false; } +bool sbp_msg_fileio_read_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_req_t *msg) { + if (!sbp_u32_encode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->offset)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->chunk_size)) { + return false; + } + if (!sbp_null_terminated_string_encode( + &msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_fileio_read_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_read_req_t *msg) { +s8 sbp_msg_fileio_read_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_read_req_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -113,16 +150,27 @@ s8 sbp_msg_fileio_read_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_fileio_read_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_read_req_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->sequence)) { return false; } - if (!sbp_u32_decode(ctx, &msg->offset)) { return false; } - if (!sbp_u8_decode(ctx, &msg->chunk_size)) { return false; } - if (!sbp_null_terminated_string_decode(&msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, ctx)) { return false; } +bool sbp_msg_fileio_read_req_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_fileio_read_req_t *msg) { + if (!sbp_u32_decode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->offset)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->chunk_size)) { + return false; + } + if (!sbp_null_terminated_string_decode( + &msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_fileio_read_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_read_req_t *msg) { +s8 sbp_msg_fileio_read_req_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_fileio_read_req_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -136,44 +184,62 @@ s8 sbp_msg_fileio_read_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_fileio_read_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_read_req_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_fileio_read_req_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_fileio_read_req_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_fileio_read_req_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FILEIO_READ_REQ, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_fileio_read_req_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FILEIO_READ_REQ, sender_id, payload_len, + payload, write); } -int sbp_msg_fileio_read_req_cmp(const sbp_msg_fileio_read_req_t *a, const sbp_msg_fileio_read_req_t *b) { +int sbp_msg_fileio_read_req_cmp(const sbp_msg_fileio_read_req_t *a, + const sbp_msg_fileio_read_req_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->sequence, &b->sequence); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->offset, &b->offset); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->chunk_size, &b->chunk_size); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_fileio_read_req_filename_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_fileio_read_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_resp_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->sequence)) { return false; } - for (size_t i = 0; i < msg->n_contents; i++) - { - if (!sbp_u8_encode(ctx, &msg->contents[i])) { return false; } +bool sbp_msg_fileio_read_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_resp_t *msg) { + if (!sbp_u32_encode(ctx, &msg->sequence)) { + return false; + } + for (size_t i = 0; i < msg->n_contents; i++) { + if (!sbp_u8_encode(ctx, &msg->contents[i])) { + return false; + } } return true; } -s8 sbp_msg_fileio_read_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_read_resp_t *msg) { +s8 sbp_msg_fileio_read_resp_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_fileio_read_resp_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -187,20 +253,27 @@ s8 sbp_msg_fileio_read_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written return SBP_OK; } -bool sbp_msg_fileio_read_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_read_resp_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->sequence)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { +bool sbp_msg_fileio_read_resp_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_fileio_read_resp_t *msg) { + if (!sbp_u32_decode(ctx, &msg->sequence)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + return false; + } + msg->n_contents = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->n_contents; i++) { + if (!sbp_u8_decode(ctx, &msg->contents[i])) { return false; } - msg->n_contents = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); - for (uint8_t i = 0; i < msg->n_contents; i++) { - if (!sbp_u8_decode(ctx, &msg->contents[i])) { return false; } - } + } return true; } -s8 sbp_msg_fileio_read_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_read_resp_t *msg) { +s8 sbp_msg_fileio_read_resp_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_fileio_read_resp_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -214,113 +287,155 @@ s8 sbp_msg_fileio_read_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r return SBP_OK; } - -s8 sbp_msg_fileio_read_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_read_resp_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_fileio_read_resp_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_fileio_read_resp_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_fileio_read_resp_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FILEIO_READ_RESP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_fileio_read_resp_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FILEIO_READ_RESP, sender_id, payload_len, + payload, write); } -int sbp_msg_fileio_read_resp_cmp(const sbp_msg_fileio_read_resp_t *a, const sbp_msg_fileio_read_resp_t *b) { +int sbp_msg_fileio_read_resp_cmp(const sbp_msg_fileio_read_resp_t *a, + const sbp_msg_fileio_read_resp_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->sequence, &b->sequence); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_contents, &b->n_contents); - for (uint8_t i = 0; ret == 0 && i < a->n_contents; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_contents; i++) { ret = sbp_u8_cmp(&a->contents[i], &b->contents[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_fileio_read_dir_req_dirname_init(sbp_msg_fileio_read_dir_req_t *msg) -{ +void sbp_msg_fileio_read_dir_req_dirname_init( + sbp_msg_fileio_read_dir_req_t *msg) { sbp_null_terminated_string_init(&msg->dirname); } -bool sbp_msg_fileio_read_dir_req_dirname_valid(const sbp_msg_fileio_read_dir_req_t *msg) -{ - return sbp_null_terminated_string_valid(&msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX); +bool sbp_msg_fileio_read_dir_req_dirname_valid( + const sbp_msg_fileio_read_dir_req_t *msg) { + return sbp_null_terminated_string_valid( + &msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX); } -int sbp_msg_fileio_read_dir_req_dirname_strcmp(const sbp_msg_fileio_read_dir_req_t *a, const sbp_msg_fileio_read_dir_req_t *b) -{ - return sbp_null_terminated_string_strcmp(&a->dirname, &b->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX); +int sbp_msg_fileio_read_dir_req_dirname_strcmp( + const sbp_msg_fileio_read_dir_req_t *a, + const sbp_msg_fileio_read_dir_req_t *b) { + return sbp_null_terminated_string_strcmp( + &a->dirname, &b->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX); } -size_t sbp_msg_fileio_read_dir_req_dirname_encoded_len(const sbp_msg_fileio_read_dir_req_t *msg) -{ - return sbp_null_terminated_string_encoded_len(&msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX); +size_t sbp_msg_fileio_read_dir_req_dirname_encoded_len( + const sbp_msg_fileio_read_dir_req_t *msg) { + return sbp_null_terminated_string_encoded_len( + &msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX); } -size_t sbp_msg_fileio_read_dir_req_dirname_space_remaining(const sbp_msg_fileio_read_dir_req_t *msg) -{ - return sbp_null_terminated_string_space_remaining(&msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX); +size_t sbp_msg_fileio_read_dir_req_dirname_space_remaining( + const sbp_msg_fileio_read_dir_req_t *msg) { + return sbp_null_terminated_string_space_remaining( + &msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX); } - bool sbp_msg_fileio_read_dir_req_dirname_set(sbp_msg_fileio_read_dir_req_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_null_terminated_string_set(&msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, should_trunc, n_written, new_str); +bool sbp_msg_fileio_read_dir_req_dirname_set(sbp_msg_fileio_read_dir_req_t *msg, + const char *new_str, + bool should_trunc, + size_t *n_written) { + return sbp_null_terminated_string_set(&msg->dirname, + SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_fileio_read_dir_req_dirname_set_raw(sbp_msg_fileio_read_dir_req_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_null_terminated_string_set_raw(&msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_fileio_read_dir_req_dirname_set_raw( + sbp_msg_fileio_read_dir_req_t *msg, const char *new_buf, size_t new_buf_len, + bool should_trunc, size_t *n_written) { + return sbp_null_terminated_string_set_raw( + &msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, should_trunc, + n_written, new_buf, new_buf_len); } - -bool sbp_msg_fileio_read_dir_req_dirname_printf(sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_fileio_read_dir_req_dirname_printf( + sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_null_terminated_string_vprintf(&msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_null_terminated_string_vprintf( + &msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_fileio_read_dir_req_dirname_vprintf(sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_null_terminated_string_vprintf(&msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_fileio_read_dir_req_dirname_vprintf( + sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_null_terminated_string_vprintf( + &msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, should_trunc, + n_written, fmt, ap); } -bool sbp_msg_fileio_read_dir_req_dirname_append_printf(sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_fileio_read_dir_req_dirname_append_printf( + sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_null_terminated_string_append_vprintf(&msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_null_terminated_string_append_vprintf( + &msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_fileio_read_dir_req_dirname_append_vprintf(sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_null_terminated_string_append_vprintf(&msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_fileio_read_dir_req_dirname_append_vprintf( + sbp_msg_fileio_read_dir_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_null_terminated_string_append_vprintf( + &msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, should_trunc, + n_written, fmt, ap); } -const char *sbp_msg_fileio_read_dir_req_dirname_get(const sbp_msg_fileio_read_dir_req_t *msg) -{ - return sbp_null_terminated_string_get(&msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX); +const char *sbp_msg_fileio_read_dir_req_dirname_get( + const sbp_msg_fileio_read_dir_req_t *msg) { + return sbp_null_terminated_string_get( + &msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX); } -size_t sbp_msg_fileio_read_dir_req_dirname_strlen(const sbp_msg_fileio_read_dir_req_t *msg) -{ - return sbp_null_terminated_string_strlen(&msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX); +size_t sbp_msg_fileio_read_dir_req_dirname_strlen( + const sbp_msg_fileio_read_dir_req_t *msg) { + return sbp_null_terminated_string_strlen( + &msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX); } -bool sbp_msg_fileio_read_dir_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_dir_req_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->sequence)) { return false; } - if (!sbp_u32_encode(ctx, &msg->offset)) { return false; } - if (!sbp_null_terminated_string_encode(&msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, ctx)) { return false; } +bool sbp_msg_fileio_read_dir_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_dir_req_t *msg) { + if (!sbp_u32_encode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->offset)) { + return false; + } + if (!sbp_null_terminated_string_encode( + &msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_fileio_read_dir_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_read_dir_req_t *msg) { +s8 sbp_msg_fileio_read_dir_req_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_read_dir_req_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -334,15 +449,24 @@ s8 sbp_msg_fileio_read_dir_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_writ return SBP_OK; } -bool sbp_msg_fileio_read_dir_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_read_dir_req_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->sequence)) { return false; } - if (!sbp_u32_decode(ctx, &msg->offset)) { return false; } - if (!sbp_null_terminated_string_decode(&msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, ctx)) { return false; } +bool sbp_msg_fileio_read_dir_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_fileio_read_dir_req_t *msg) { + if (!sbp_u32_decode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->offset)) { + return false; + } + if (!sbp_null_terminated_string_decode( + &msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_fileio_read_dir_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_read_dir_req_t *msg) { +s8 sbp_msg_fileio_read_dir_req_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_fileio_read_dir_req_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -356,115 +480,147 @@ s8 sbp_msg_fileio_read_dir_req_decode(const uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } - -s8 sbp_msg_fileio_read_dir_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_read_dir_req_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_fileio_read_dir_req_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_fileio_read_dir_req_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_fileio_read_dir_req_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FILEIO_READ_DIR_REQ, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_fileio_read_dir_req_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FILEIO_READ_DIR_REQ, sender_id, + payload_len, payload, write); } -int sbp_msg_fileio_read_dir_req_cmp(const sbp_msg_fileio_read_dir_req_t *a, const sbp_msg_fileio_read_dir_req_t *b) { +int sbp_msg_fileio_read_dir_req_cmp(const sbp_msg_fileio_read_dir_req_t *a, + const sbp_msg_fileio_read_dir_req_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->sequence, &b->sequence); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->offset, &b->offset); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_fileio_read_dir_req_dirname_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_fileio_read_dir_resp_contents_init(sbp_msg_fileio_read_dir_resp_t *msg) -{ +void sbp_msg_fileio_read_dir_resp_contents_init( + sbp_msg_fileio_read_dir_resp_t *msg) { sbp_multipart_string_init(&msg->contents); } -bool sbp_msg_fileio_read_dir_resp_contents_valid(const sbp_msg_fileio_read_dir_resp_t *msg) -{ - return sbp_multipart_string_valid(&msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX); +bool sbp_msg_fileio_read_dir_resp_contents_valid( + const sbp_msg_fileio_read_dir_resp_t *msg) { + return sbp_multipart_string_valid(&msg->contents, + SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX); } -int sbp_msg_fileio_read_dir_resp_contents_strcmp(const sbp_msg_fileio_read_dir_resp_t *a, const sbp_msg_fileio_read_dir_resp_t *b) -{ - return sbp_multipart_string_strcmp(&a->contents, &b->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX); +int sbp_msg_fileio_read_dir_resp_contents_strcmp( + const sbp_msg_fileio_read_dir_resp_t *a, + const sbp_msg_fileio_read_dir_resp_t *b) { + return sbp_multipart_string_strcmp(&a->contents, &b->contents, + SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX); } -size_t sbp_msg_fileio_read_dir_resp_contents_encoded_len(const sbp_msg_fileio_read_dir_resp_t *msg) -{ - return sbp_multipart_string_encoded_len(&msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX); +size_t sbp_msg_fileio_read_dir_resp_contents_encoded_len( + const sbp_msg_fileio_read_dir_resp_t *msg) { + return sbp_multipart_string_encoded_len( + &msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX); } -size_t sbp_msg_fileio_read_dir_resp_contents_space_remaining(const sbp_msg_fileio_read_dir_resp_t *msg) -{ - return sbp_multipart_string_space_remaining(&msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX); +size_t sbp_msg_fileio_read_dir_resp_contents_space_remaining( + const sbp_msg_fileio_read_dir_resp_t *msg) { + return sbp_multipart_string_space_remaining( + &msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX); } -size_t sbp_msg_fileio_read_dir_resp_contents_count_sections(const sbp_msg_fileio_read_dir_resp_t *msg) -{ - return sbp_multipart_string_count_sections(&msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX); +size_t sbp_msg_fileio_read_dir_resp_contents_count_sections( + const sbp_msg_fileio_read_dir_resp_t *msg) { + return sbp_multipart_string_count_sections( + &msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX); } -bool sbp_msg_fileio_read_dir_resp_contents_add_section(sbp_msg_fileio_read_dir_resp_t *msg, const char *new_str) -{ - return sbp_multipart_string_add_section(&msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, new_str); +bool sbp_msg_fileio_read_dir_resp_contents_add_section( + sbp_msg_fileio_read_dir_resp_t *msg, const char *new_str) { + return sbp_multipart_string_add_section( + &msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, new_str); } -bool sbp_msg_fileio_read_dir_resp_contents_add_section_printf(sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, ...) -{ +bool sbp_msg_fileio_read_dir_resp_contents_add_section_printf( + sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_add_section_vprintf(&msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, fmt, ap); + bool ret = sbp_multipart_string_add_section_vprintf( + &msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_fileio_read_dir_resp_contents_add_section_vprintf(sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_add_section_vprintf(&msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, fmt, ap); +bool sbp_msg_fileio_read_dir_resp_contents_add_section_vprintf( + sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_add_section_vprintf( + &msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, fmt, ap); } -bool sbp_msg_fileio_read_dir_resp_contents_append(sbp_msg_fileio_read_dir_resp_t *msg, const char *str) -{ - return sbp_multipart_string_append(&msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, str); +bool sbp_msg_fileio_read_dir_resp_contents_append( + sbp_msg_fileio_read_dir_resp_t *msg, const char *str) { + return sbp_multipart_string_append( + &msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, str); } -bool sbp_msg_fileio_read_dir_resp_contents_append_printf(sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, ...) -{ +bool sbp_msg_fileio_read_dir_resp_contents_append_printf( + sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_append_vprintf(&msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, fmt, ap); + bool ret = sbp_multipart_string_append_vprintf( + &msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_fileio_read_dir_resp_contents_append_vprintf(sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_append_vprintf(&msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, fmt, ap); +bool sbp_msg_fileio_read_dir_resp_contents_append_vprintf( + sbp_msg_fileio_read_dir_resp_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_append_vprintf( + &msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, fmt, ap); } -const char *sbp_msg_fileio_read_dir_resp_contents_get_section(const sbp_msg_fileio_read_dir_resp_t *msg, size_t section) -{ - return sbp_multipart_string_get_section(&msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, section); +const char *sbp_msg_fileio_read_dir_resp_contents_get_section( + const sbp_msg_fileio_read_dir_resp_t *msg, size_t section) { + return sbp_multipart_string_get_section( + &msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, section); } -size_t sbp_msg_fileio_read_dir_resp_contents_section_strlen(const sbp_msg_fileio_read_dir_resp_t *msg, size_t section) -{ - return sbp_multipart_string_section_strlen(&msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, section); +size_t sbp_msg_fileio_read_dir_resp_contents_section_strlen( + const sbp_msg_fileio_read_dir_resp_t *msg, size_t section) { + return sbp_multipart_string_section_strlen( + &msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, section); } -bool sbp_msg_fileio_read_dir_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_dir_resp_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->sequence)) { return false; } - if (!sbp_multipart_string_encode(&msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, ctx)) { return false; } +bool sbp_msg_fileio_read_dir_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_dir_resp_t *msg) { + if (!sbp_u32_encode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_multipart_string_encode( + &msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_fileio_read_dir_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_read_dir_resp_t *msg) { +s8 sbp_msg_fileio_read_dir_resp_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_read_dir_resp_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -478,14 +634,21 @@ s8 sbp_msg_fileio_read_dir_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_wri return SBP_OK; } -bool sbp_msg_fileio_read_dir_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_read_dir_resp_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->sequence)) { return false; } - if (!sbp_multipart_string_decode(&msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, ctx)) { return false; } +bool sbp_msg_fileio_read_dir_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_fileio_read_dir_resp_t *msg) { + if (!sbp_u32_decode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_multipart_string_decode( + &msg->contents, SBP_MSG_FILEIO_READ_DIR_RESP_CONTENTS_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_fileio_read_dir_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_read_dir_resp_t *msg) { +s8 sbp_msg_fileio_read_dir_resp_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_fileio_read_dir_resp_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -499,107 +662,147 @@ s8 sbp_msg_fileio_read_dir_resp_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_fileio_read_dir_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_read_dir_resp_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_fileio_read_dir_resp_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_fileio_read_dir_resp_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_fileio_read_dir_resp_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FILEIO_READ_DIR_RESP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_fileio_read_dir_resp_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FILEIO_READ_DIR_RESP, sender_id, + payload_len, payload, write); } -int sbp_msg_fileio_read_dir_resp_cmp(const sbp_msg_fileio_read_dir_resp_t *a, const sbp_msg_fileio_read_dir_resp_t *b) { +int sbp_msg_fileio_read_dir_resp_cmp(const sbp_msg_fileio_read_dir_resp_t *a, + const sbp_msg_fileio_read_dir_resp_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->sequence, &b->sequence); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_fileio_read_dir_resp_contents_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_fileio_remove_filename_init(sbp_msg_fileio_remove_t *msg) -{ +void sbp_msg_fileio_remove_filename_init(sbp_msg_fileio_remove_t *msg) { sbp_null_terminated_string_init(&msg->filename); } -bool sbp_msg_fileio_remove_filename_valid(const sbp_msg_fileio_remove_t *msg) -{ - return sbp_null_terminated_string_valid(&msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX); +bool sbp_msg_fileio_remove_filename_valid(const sbp_msg_fileio_remove_t *msg) { + return sbp_null_terminated_string_valid(&msg->filename, + SBP_MSG_FILEIO_REMOVE_FILENAME_MAX); } -int sbp_msg_fileio_remove_filename_strcmp(const sbp_msg_fileio_remove_t *a, const sbp_msg_fileio_remove_t *b) -{ - return sbp_null_terminated_string_strcmp(&a->filename, &b->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX); +int sbp_msg_fileio_remove_filename_strcmp(const sbp_msg_fileio_remove_t *a, + const sbp_msg_fileio_remove_t *b) { + return sbp_null_terminated_string_strcmp(&a->filename, &b->filename, + SBP_MSG_FILEIO_REMOVE_FILENAME_MAX); } -size_t sbp_msg_fileio_remove_filename_encoded_len(const sbp_msg_fileio_remove_t *msg) -{ - return sbp_null_terminated_string_encoded_len(&msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX); +size_t sbp_msg_fileio_remove_filename_encoded_len( + const sbp_msg_fileio_remove_t *msg) { + return sbp_null_terminated_string_encoded_len( + &msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX); } -size_t sbp_msg_fileio_remove_filename_space_remaining(const sbp_msg_fileio_remove_t *msg) -{ - return sbp_null_terminated_string_space_remaining(&msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX); +size_t sbp_msg_fileio_remove_filename_space_remaining( + const sbp_msg_fileio_remove_t *msg) { + return sbp_null_terminated_string_space_remaining( + &msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX); } - bool sbp_msg_fileio_remove_filename_set(sbp_msg_fileio_remove_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_null_terminated_string_set(&msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, should_trunc, n_written, new_str); +bool sbp_msg_fileio_remove_filename_set(sbp_msg_fileio_remove_t *msg, + const char *new_str, bool should_trunc, + size_t *n_written) { + return sbp_null_terminated_string_set(&msg->filename, + SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_fileio_remove_filename_set_raw(sbp_msg_fileio_remove_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_null_terminated_string_set_raw(&msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_fileio_remove_filename_set_raw(sbp_msg_fileio_remove_t *msg, + const char *new_buf, + size_t new_buf_len, + bool should_trunc, + size_t *n_written) { + return sbp_null_terminated_string_set_raw( + &msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, should_trunc, + n_written, new_buf, new_buf_len); } - -bool sbp_msg_fileio_remove_filename_printf(sbp_msg_fileio_remove_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_fileio_remove_filename_printf(sbp_msg_fileio_remove_t *msg, + bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_null_terminated_string_vprintf(&msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_null_terminated_string_vprintf( + &msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_fileio_remove_filename_vprintf(sbp_msg_fileio_remove_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_null_terminated_string_vprintf(&msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_fileio_remove_filename_vprintf(sbp_msg_fileio_remove_t *msg, + bool should_trunc, + size_t *n_written, const char *fmt, + va_list ap) { + return sbp_null_terminated_string_vprintf(&msg->filename, + SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, + should_trunc, n_written, fmt, ap); } -bool sbp_msg_fileio_remove_filename_append_printf(sbp_msg_fileio_remove_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_fileio_remove_filename_append_printf(sbp_msg_fileio_remove_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_null_terminated_string_append_vprintf(&msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_null_terminated_string_append_vprintf( + &msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_fileio_remove_filename_append_vprintf(sbp_msg_fileio_remove_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_null_terminated_string_append_vprintf(&msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_fileio_remove_filename_append_vprintf(sbp_msg_fileio_remove_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, + va_list ap) { + return sbp_null_terminated_string_append_vprintf( + &msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, should_trunc, + n_written, fmt, ap); } -const char *sbp_msg_fileio_remove_filename_get(const sbp_msg_fileio_remove_t *msg) -{ - return sbp_null_terminated_string_get(&msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX); +const char *sbp_msg_fileio_remove_filename_get( + const sbp_msg_fileio_remove_t *msg) { + return sbp_null_terminated_string_get(&msg->filename, + SBP_MSG_FILEIO_REMOVE_FILENAME_MAX); } -size_t sbp_msg_fileio_remove_filename_strlen(const sbp_msg_fileio_remove_t *msg) -{ - return sbp_null_terminated_string_strlen(&msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX); +size_t sbp_msg_fileio_remove_filename_strlen( + const sbp_msg_fileio_remove_t *msg) { + return sbp_null_terminated_string_strlen(&msg->filename, + SBP_MSG_FILEIO_REMOVE_FILENAME_MAX); } -bool sbp_msg_fileio_remove_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_remove_t *msg) -{ - if (!sbp_null_terminated_string_encode(&msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, ctx)) { return false; } +bool sbp_msg_fileio_remove_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_fileio_remove_t *msg) { + if (!sbp_null_terminated_string_encode( + &msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_fileio_remove_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_remove_t *msg) { +s8 sbp_msg_fileio_remove_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fileio_remove_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -613,13 +816,17 @@ s8 sbp_msg_fileio_remove_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_fileio_remove_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_remove_t *msg) -{ - if (!sbp_null_terminated_string_decode(&msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, ctx)) { return false; } +bool sbp_msg_fileio_remove_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_fileio_remove_t *msg) { + if (!sbp_null_terminated_string_decode( + &msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_fileio_remove_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_remove_t *msg) { +s8 sbp_msg_fileio_remove_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_fileio_remove_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -633,110 +840,154 @@ s8 sbp_msg_fileio_remove_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_fileio_remove_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_remove_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_fileio_remove_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_fileio_remove_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_fileio_remove_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FILEIO_REMOVE, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_fileio_remove_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FILEIO_REMOVE, sender_id, payload_len, + payload, write); } -int sbp_msg_fileio_remove_cmp(const sbp_msg_fileio_remove_t *a, const sbp_msg_fileio_remove_t *b) { +int sbp_msg_fileio_remove_cmp(const sbp_msg_fileio_remove_t *a, + const sbp_msg_fileio_remove_t *b) { int ret = 0; - + ret = sbp_msg_fileio_remove_filename_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_fileio_write_req_filename_init(sbp_msg_fileio_write_req_t *msg) -{ +void sbp_msg_fileio_write_req_filename_init(sbp_msg_fileio_write_req_t *msg) { sbp_null_terminated_string_init(&msg->filename); } -bool sbp_msg_fileio_write_req_filename_valid(const sbp_msg_fileio_write_req_t *msg) -{ - return sbp_null_terminated_string_valid(&msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX); +bool sbp_msg_fileio_write_req_filename_valid( + const sbp_msg_fileio_write_req_t *msg) { + return sbp_null_terminated_string_valid( + &msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX); } -int sbp_msg_fileio_write_req_filename_strcmp(const sbp_msg_fileio_write_req_t *a, const sbp_msg_fileio_write_req_t *b) -{ - return sbp_null_terminated_string_strcmp(&a->filename, &b->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX); +int sbp_msg_fileio_write_req_filename_strcmp( + const sbp_msg_fileio_write_req_t *a, const sbp_msg_fileio_write_req_t *b) { + return sbp_null_terminated_string_strcmp( + &a->filename, &b->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX); } -size_t sbp_msg_fileio_write_req_filename_encoded_len(const sbp_msg_fileio_write_req_t *msg) -{ - return sbp_null_terminated_string_encoded_len(&msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX); +size_t sbp_msg_fileio_write_req_filename_encoded_len( + const sbp_msg_fileio_write_req_t *msg) { + return sbp_null_terminated_string_encoded_len( + &msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX); } -size_t sbp_msg_fileio_write_req_filename_space_remaining(const sbp_msg_fileio_write_req_t *msg) -{ - return sbp_null_terminated_string_space_remaining(&msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX); +size_t sbp_msg_fileio_write_req_filename_space_remaining( + const sbp_msg_fileio_write_req_t *msg) { + return sbp_null_terminated_string_space_remaining( + &msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX); } - bool sbp_msg_fileio_write_req_filename_set(sbp_msg_fileio_write_req_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_null_terminated_string_set(&msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, should_trunc, n_written, new_str); +bool sbp_msg_fileio_write_req_filename_set(sbp_msg_fileio_write_req_t *msg, + const char *new_str, + bool should_trunc, + size_t *n_written) { + return sbp_null_terminated_string_set(&msg->filename, + SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_fileio_write_req_filename_set_raw(sbp_msg_fileio_write_req_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_null_terminated_string_set_raw(&msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_fileio_write_req_filename_set_raw(sbp_msg_fileio_write_req_t *msg, + const char *new_buf, + size_t new_buf_len, + bool should_trunc, + size_t *n_written) { + return sbp_null_terminated_string_set_raw( + &msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, should_trunc, + n_written, new_buf, new_buf_len); } - -bool sbp_msg_fileio_write_req_filename_printf(sbp_msg_fileio_write_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_fileio_write_req_filename_printf(sbp_msg_fileio_write_req_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_null_terminated_string_vprintf(&msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_null_terminated_string_vprintf( + &msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_fileio_write_req_filename_vprintf(sbp_msg_fileio_write_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_null_terminated_string_vprintf(&msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_fileio_write_req_filename_vprintf(sbp_msg_fileio_write_req_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, va_list ap) { + return sbp_null_terminated_string_vprintf( + &msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, should_trunc, + n_written, fmt, ap); } -bool sbp_msg_fileio_write_req_filename_append_printf(sbp_msg_fileio_write_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_fileio_write_req_filename_append_printf( + sbp_msg_fileio_write_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_null_terminated_string_append_vprintf(&msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_null_terminated_string_append_vprintf( + &msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_fileio_write_req_filename_append_vprintf(sbp_msg_fileio_write_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_null_terminated_string_append_vprintf(&msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_fileio_write_req_filename_append_vprintf( + sbp_msg_fileio_write_req_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_null_terminated_string_append_vprintf( + &msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, should_trunc, + n_written, fmt, ap); } -const char *sbp_msg_fileio_write_req_filename_get(const sbp_msg_fileio_write_req_t *msg) -{ - return sbp_null_terminated_string_get(&msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX); +const char *sbp_msg_fileio_write_req_filename_get( + const sbp_msg_fileio_write_req_t *msg) { + return sbp_null_terminated_string_get(&msg->filename, + SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX); } -size_t sbp_msg_fileio_write_req_filename_strlen(const sbp_msg_fileio_write_req_t *msg) -{ - return sbp_null_terminated_string_strlen(&msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX); +size_t sbp_msg_fileio_write_req_filename_strlen( + const sbp_msg_fileio_write_req_t *msg) { + return sbp_null_terminated_string_strlen( + &msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX); } -bool sbp_msg_fileio_write_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_write_req_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->sequence)) { return false; } - if (!sbp_u32_encode(ctx, &msg->offset)) { return false; } - if (!sbp_null_terminated_string_encode(&msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, ctx)) { return false; } - for (size_t i = 0; i < msg->n_data; i++) - { - if (!sbp_u8_encode(ctx, &msg->data[i])) { return false; } +bool sbp_msg_fileio_write_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_write_req_t *msg) { + if (!sbp_u32_encode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->offset)) { + return false; + } + if (!sbp_null_terminated_string_encode( + &msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, ctx)) { + return false; + } + for (size_t i = 0; i < msg->n_data; i++) { + if (!sbp_u8_encode(ctx, &msg->data[i])) { + return false; + } } return true; } -s8 sbp_msg_fileio_write_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_write_req_t *msg) { +s8 sbp_msg_fileio_write_req_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_fileio_write_req_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -750,22 +1001,33 @@ s8 sbp_msg_fileio_write_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written return SBP_OK; } -bool sbp_msg_fileio_write_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_write_req_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->sequence)) { return false; } - if (!sbp_u32_decode(ctx, &msg->offset)) { return false; } - if (!sbp_null_terminated_string_decode(&msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, ctx)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { +bool sbp_msg_fileio_write_req_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_fileio_write_req_t *msg) { + if (!sbp_u32_decode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->offset)) { + return false; + } + if (!sbp_null_terminated_string_decode( + &msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, ctx)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + return false; + } + msg->n_data = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->n_data; i++) { + if (!sbp_u8_decode(ctx, &msg->data[i])) { return false; } - msg->n_data = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); - for (uint8_t i = 0; i < msg->n_data; i++) { - if (!sbp_u8_decode(ctx, &msg->data[i])) { return false; } - } + } return true; } -s8 sbp_msg_fileio_write_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_write_req_t *msg) { +s8 sbp_msg_fileio_write_req_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_fileio_write_req_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -779,44 +1041,60 @@ s8 sbp_msg_fileio_write_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r return SBP_OK; } - -s8 sbp_msg_fileio_write_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_write_req_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_fileio_write_req_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_fileio_write_req_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_fileio_write_req_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FILEIO_WRITE_REQ, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_fileio_write_req_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FILEIO_WRITE_REQ, sender_id, payload_len, + payload, write); } -int sbp_msg_fileio_write_req_cmp(const sbp_msg_fileio_write_req_t *a, const sbp_msg_fileio_write_req_t *b) { +int sbp_msg_fileio_write_req_cmp(const sbp_msg_fileio_write_req_t *a, + const sbp_msg_fileio_write_req_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->sequence, &b->sequence); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->offset, &b->offset); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_fileio_write_req_filename_strcmp(a, b); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_data, &b->n_data); - for (uint8_t i = 0; ret == 0 && i < a->n_data; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_data; i++) { ret = sbp_u8_cmp(&a->data[i], &b->data[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_fileio_write_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_write_resp_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->sequence)) { return false; } +bool sbp_msg_fileio_write_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_write_resp_t *msg) { + if (!sbp_u32_encode(ctx, &msg->sequence)) { + return false; + } return true; } -s8 sbp_msg_fileio_write_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_write_resp_t *msg) { +s8 sbp_msg_fileio_write_resp_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_fileio_write_resp_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -830,13 +1108,17 @@ s8 sbp_msg_fileio_write_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_fileio_write_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_write_resp_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->sequence)) { return false; } +bool sbp_msg_fileio_write_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_fileio_write_resp_t *msg) { + if (!sbp_u32_decode(ctx, &msg->sequence)) { + return false; + } return true; } -s8 sbp_msg_fileio_write_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_write_resp_t *msg) { +s8 sbp_msg_fileio_write_resp_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_fileio_write_resp_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -850,31 +1132,42 @@ s8 sbp_msg_fileio_write_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_fileio_write_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_write_resp_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_fileio_write_resp_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_fileio_write_resp_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_fileio_write_resp_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FILEIO_WRITE_RESP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_fileio_write_resp_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FILEIO_WRITE_RESP, sender_id, payload_len, + payload, write); } -int sbp_msg_fileio_write_resp_cmp(const sbp_msg_fileio_write_resp_t *a, const sbp_msg_fileio_write_resp_t *b) { +int sbp_msg_fileio_write_resp_cmp(const sbp_msg_fileio_write_resp_t *a, + const sbp_msg_fileio_write_resp_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->sequence, &b->sequence); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_fileio_config_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_config_req_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->sequence)) { return false; } +bool sbp_msg_fileio_config_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_config_req_t *msg) { + if (!sbp_u32_encode(ctx, &msg->sequence)) { + return false; + } return true; } -s8 sbp_msg_fileio_config_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_config_req_t *msg) { +s8 sbp_msg_fileio_config_req_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_fileio_config_req_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -888,13 +1181,17 @@ s8 sbp_msg_fileio_config_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_fileio_config_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_config_req_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->sequence)) { return false; } +bool sbp_msg_fileio_config_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_fileio_config_req_t *msg) { + if (!sbp_u32_decode(ctx, &msg->sequence)) { + return false; + } return true; } -s8 sbp_msg_fileio_config_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_config_req_t *msg) { +s8 sbp_msg_fileio_config_req_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_fileio_config_req_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -908,34 +1205,51 @@ s8 sbp_msg_fileio_config_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_fileio_config_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_config_req_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_fileio_config_req_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_fileio_config_req_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_fileio_config_req_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FILEIO_CONFIG_REQ, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_fileio_config_req_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FILEIO_CONFIG_REQ, sender_id, payload_len, + payload, write); } -int sbp_msg_fileio_config_req_cmp(const sbp_msg_fileio_config_req_t *a, const sbp_msg_fileio_config_req_t *b) { +int sbp_msg_fileio_config_req_cmp(const sbp_msg_fileio_config_req_t *a, + const sbp_msg_fileio_config_req_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->sequence, &b->sequence); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_fileio_config_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_config_resp_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->sequence)) { return false; } - if (!sbp_u32_encode(ctx, &msg->window_size)) { return false; } - if (!sbp_u32_encode(ctx, &msg->batch_size)) { return false; } - if (!sbp_u32_encode(ctx, &msg->fileio_version)) { return false; } +bool sbp_msg_fileio_config_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_config_resp_t *msg) { + if (!sbp_u32_encode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->window_size)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->batch_size)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->fileio_version)) { + return false; + } return true; } -s8 sbp_msg_fileio_config_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fileio_config_resp_t *msg) { +s8 sbp_msg_fileio_config_resp_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_fileio_config_resp_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -949,16 +1263,26 @@ s8 sbp_msg_fileio_config_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_writt return SBP_OK; } -bool sbp_msg_fileio_config_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_config_resp_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->sequence)) { return false; } - if (!sbp_u32_decode(ctx, &msg->window_size)) { return false; } - if (!sbp_u32_decode(ctx, &msg->batch_size)) { return false; } - if (!sbp_u32_decode(ctx, &msg->fileio_version)) { return false; } +bool sbp_msg_fileio_config_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_fileio_config_resp_t *msg) { + if (!sbp_u32_decode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->window_size)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->batch_size)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->fileio_version)) { + return false; + } return true; } -s8 sbp_msg_fileio_config_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fileio_config_resp_t *msg) { +s8 sbp_msg_fileio_config_resp_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_fileio_config_resp_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -972,29 +1296,42 @@ s8 sbp_msg_fileio_config_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } - -s8 sbp_msg_fileio_config_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fileio_config_resp_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_fileio_config_resp_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_fileio_config_resp_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_fileio_config_resp_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FILEIO_CONFIG_RESP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_fileio_config_resp_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FILEIO_CONFIG_RESP, sender_id, payload_len, + payload, write); } -int sbp_msg_fileio_config_resp_cmp(const sbp_msg_fileio_config_resp_t *a, const sbp_msg_fileio_config_resp_t *b) { +int sbp_msg_fileio_config_resp_cmp(const sbp_msg_fileio_config_resp_t *a, + const sbp_msg_fileio_config_resp_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->sequence, &b->sequence); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->window_size, &b->window_size); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->batch_size, &b->batch_size); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->fileio_version, &b->fileio_version); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/flash.c b/c/src/flash.c index e76736b70..20384d6b0 100644 --- a/c/src/flash.c +++ b/c/src/flash.c @@ -3,36 +3,43 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include -#include #include +#include #include +#include +#include #include #include -#include #include +#include -bool sbp_msg_flash_program_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_flash_program_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->target)) { return false; } - for (size_t i = 0; i < SBP_MSG_FLASH_PROGRAM_ADDR_START_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->addr_start[i])) { return false; } +bool sbp_msg_flash_program_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_flash_program_t *msg) { + if (!sbp_u8_encode(ctx, &msg->target)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_FLASH_PROGRAM_ADDR_START_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->addr_start[i])) { + return false; + } } - if (!sbp_u8_encode(ctx, &msg->addr_len)) { return false; } - for (size_t i = 0; i < msg->addr_len; i++) - { - if (!sbp_u8_encode(ctx, &msg->data[i])) { return false; } + if (!sbp_u8_encode(ctx, &msg->addr_len)) { + return false; + } + for (size_t i = 0; i < msg->addr_len; i++) { + if (!sbp_u8_encode(ctx, &msg->data[i])) { + return false; + } } return true; } -s8 sbp_msg_flash_program_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_flash_program_t *msg) { +s8 sbp_msg_flash_program_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_flash_program_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -46,24 +53,33 @@ s8 sbp_msg_flash_program_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_flash_program_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_flash_program_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->target)) { return false; } - for (uint8_t i = 0; i < SBP_MSG_FLASH_PROGRAM_ADDR_START_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->addr_start[i])) { return false; } +bool sbp_msg_flash_program_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_flash_program_t *msg) { + if (!sbp_u8_decode(ctx, &msg->target)) { + return false; } - if (!sbp_u8_decode(ctx, &msg->addr_len)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + for (uint8_t i = 0; i < SBP_MSG_FLASH_PROGRAM_ADDR_START_MAX; i++) { + if (!sbp_u8_decode(ctx, &msg->addr_start[i])) { return false; } - msg->addr_len = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); - for (uint8_t i = 0; i < msg->addr_len; i++) { - if (!sbp_u8_decode(ctx, &msg->data[i])) { return false; } + } + if (!sbp_u8_decode(ctx, &msg->addr_len)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + return false; + } + msg->addr_len = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->addr_len; i++) { + if (!sbp_u8_decode(ctx, &msg->data[i])) { + return false; } + } return true; } -s8 sbp_msg_flash_program_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_flash_program_t *msg) { +s8 sbp_msg_flash_program_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_flash_program_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -77,47 +93,62 @@ s8 sbp_msg_flash_program_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_flash_program_send(sbp_state_t *s, u16 sender_id, const sbp_msg_flash_program_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_flash_program_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_flash_program_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_flash_program_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FLASH_PROGRAM, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_flash_program_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FLASH_PROGRAM, sender_id, payload_len, + payload, write); } -int sbp_msg_flash_program_cmp(const sbp_msg_flash_program_t *a, const sbp_msg_flash_program_t *b) { +int sbp_msg_flash_program_cmp(const sbp_msg_flash_program_t *a, + const sbp_msg_flash_program_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->target, &b->target); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_FLASH_PROGRAM_ADDR_START_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_FLASH_PROGRAM_ADDR_START_MAX; + i++) { ret = sbp_u8_cmp(&a->addr_start[i], &b->addr_start[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->addr_len, &b->addr_len); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->addr_len, &b->addr_len); - for (uint8_t i = 0; ret == 0 && i < a->addr_len; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->addr_len; i++) { ret = sbp_u8_cmp(&a->data[i], &b->data[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_flash_done_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_flash_done_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->response)) { return false; } +bool sbp_msg_flash_done_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_flash_done_t *msg) { + if (!sbp_u8_encode(ctx, &msg->response)) { + return false; + } return true; } -s8 sbp_msg_flash_done_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_flash_done_t *msg) { +s8 sbp_msg_flash_done_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_flash_done_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -131,13 +162,16 @@ s8 sbp_msg_flash_done_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, cons return SBP_OK; } -bool sbp_msg_flash_done_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_flash_done_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->response)) { return false; } +bool sbp_msg_flash_done_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_flash_done_t *msg) { + if (!sbp_u8_decode(ctx, &msg->response)) { + return false; + } return true; } -s8 sbp_msg_flash_done_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_flash_done_t *msg) { +s8 sbp_msg_flash_done_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_flash_done_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -151,36 +185,49 @@ s8 sbp_msg_flash_done_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, s return SBP_OK; } - -s8 sbp_msg_flash_done_send(sbp_state_t *s, u16 sender_id, const sbp_msg_flash_done_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_flash_done_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_flash_done_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_flash_done_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FLASH_DONE, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_flash_done_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FLASH_DONE, sender_id, payload_len, + payload, write); } -int sbp_msg_flash_done_cmp(const sbp_msg_flash_done_t *a, const sbp_msg_flash_done_t *b) { +int sbp_msg_flash_done_cmp(const sbp_msg_flash_done_t *a, + const sbp_msg_flash_done_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->response, &b->response); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_flash_read_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_flash_read_req_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->target)) { return false; } - for (size_t i = 0; i < SBP_MSG_FLASH_READ_REQ_ADDR_START_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->addr_start[i])) { return false; } +bool sbp_msg_flash_read_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_flash_read_req_t *msg) { + if (!sbp_u8_encode(ctx, &msg->target)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_FLASH_READ_REQ_ADDR_START_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->addr_start[i])) { + return false; + } + } + if (!sbp_u8_encode(ctx, &msg->addr_len)) { + return false; } - if (!sbp_u8_encode(ctx, &msg->addr_len)) { return false; } return true; } -s8 sbp_msg_flash_read_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_flash_read_req_t *msg) { +s8 sbp_msg_flash_read_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_flash_read_req_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -194,17 +241,25 @@ s8 sbp_msg_flash_read_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_flash_read_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_flash_read_req_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->target)) { return false; } +bool sbp_msg_flash_read_req_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_flash_read_req_t *msg) { + if (!sbp_u8_decode(ctx, &msg->target)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_FLASH_READ_REQ_ADDR_START_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->addr_start[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->addr_start[i])) { + return false; + } + } + if (!sbp_u8_decode(ctx, &msg->addr_len)) { + return false; } - if (!sbp_u8_decode(ctx, &msg->addr_len)) { return false; } return true; } -s8 sbp_msg_flash_read_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_flash_read_req_t *msg) { +s8 sbp_msg_flash_read_req_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_flash_read_req_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -218,45 +273,62 @@ s8 sbp_msg_flash_read_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - -s8 sbp_msg_flash_read_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_flash_read_req_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_flash_read_req_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_flash_read_req_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_flash_read_req_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FLASH_READ_REQ, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_flash_read_req_encode(payload, sizeof(payload), &payload_len, + msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FLASH_READ_REQ, sender_id, payload_len, + payload, write); } -int sbp_msg_flash_read_req_cmp(const sbp_msg_flash_read_req_t *a, const sbp_msg_flash_read_req_t *b) { +int sbp_msg_flash_read_req_cmp(const sbp_msg_flash_read_req_t *a, + const sbp_msg_flash_read_req_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->target, &b->target); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_FLASH_READ_REQ_ADDR_START_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_FLASH_READ_REQ_ADDR_START_MAX; + i++) { ret = sbp_u8_cmp(&a->addr_start[i], &b->addr_start[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->addr_len, &b->addr_len); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_flash_read_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_flash_read_resp_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->target)) { return false; } - for (size_t i = 0; i < SBP_MSG_FLASH_READ_RESP_ADDR_START_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->addr_start[i])) { return false; } +bool sbp_msg_flash_read_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_flash_read_resp_t *msg) { + if (!sbp_u8_encode(ctx, &msg->target)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_FLASH_READ_RESP_ADDR_START_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->addr_start[i])) { + return false; + } + } + if (!sbp_u8_encode(ctx, &msg->addr_len)) { + return false; } - if (!sbp_u8_encode(ctx, &msg->addr_len)) { return false; } return true; } -s8 sbp_msg_flash_read_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_flash_read_resp_t *msg) { +s8 sbp_msg_flash_read_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_flash_read_resp_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -270,17 +342,25 @@ s8 sbp_msg_flash_read_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_flash_read_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_flash_read_resp_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->target)) { return false; } +bool sbp_msg_flash_read_resp_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_flash_read_resp_t *msg) { + if (!sbp_u8_decode(ctx, &msg->target)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_FLASH_READ_RESP_ADDR_START_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->addr_start[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->addr_start[i])) { + return false; + } + } + if (!sbp_u8_decode(ctx, &msg->addr_len)) { + return false; } - if (!sbp_u8_decode(ctx, &msg->addr_len)) { return false; } return true; } -s8 sbp_msg_flash_read_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_flash_read_resp_t *msg) { +s8 sbp_msg_flash_read_resp_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_flash_read_resp_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -294,41 +374,57 @@ s8 sbp_msg_flash_read_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_flash_read_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_flash_read_resp_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_flash_read_resp_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_flash_read_resp_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_flash_read_resp_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FLASH_READ_RESP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_flash_read_resp_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FLASH_READ_RESP, sender_id, payload_len, + payload, write); } -int sbp_msg_flash_read_resp_cmp(const sbp_msg_flash_read_resp_t *a, const sbp_msg_flash_read_resp_t *b) { +int sbp_msg_flash_read_resp_cmp(const sbp_msg_flash_read_resp_t *a, + const sbp_msg_flash_read_resp_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->target, &b->target); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_FLASH_READ_RESP_ADDR_START_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_FLASH_READ_RESP_ADDR_START_MAX; + i++) { ret = sbp_u8_cmp(&a->addr_start[i], &b->addr_start[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->addr_len, &b->addr_len); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_flash_erase_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_flash_erase_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->target)) { return false; } - if (!sbp_u32_encode(ctx, &msg->sector_num)) { return false; } +bool sbp_msg_flash_erase_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_flash_erase_t *msg) { + if (!sbp_u8_encode(ctx, &msg->target)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->sector_num)) { + return false; + } return true; } -s8 sbp_msg_flash_erase_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_flash_erase_t *msg) { +s8 sbp_msg_flash_erase_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_flash_erase_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -342,14 +438,19 @@ s8 sbp_msg_flash_erase_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, con return SBP_OK; } -bool sbp_msg_flash_erase_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_flash_erase_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->target)) { return false; } - if (!sbp_u32_decode(ctx, &msg->sector_num)) { return false; } +bool sbp_msg_flash_erase_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_flash_erase_t *msg) { + if (!sbp_u8_decode(ctx, &msg->target)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->sector_num)) { + return false; + } return true; } -s8 sbp_msg_flash_erase_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_flash_erase_t *msg) { +s8 sbp_msg_flash_erase_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_flash_erase_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -363,34 +464,47 @@ s8 sbp_msg_flash_erase_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_flash_erase_send(sbp_state_t *s, u16 sender_id, const sbp_msg_flash_erase_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_flash_erase_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_flash_erase_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_flash_erase_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FLASH_ERASE, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_flash_erase_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FLASH_ERASE, sender_id, payload_len, + payload, write); } -int sbp_msg_flash_erase_cmp(const sbp_msg_flash_erase_t *a, const sbp_msg_flash_erase_t *b) { +int sbp_msg_flash_erase_cmp(const sbp_msg_flash_erase_t *a, + const sbp_msg_flash_erase_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->target, &b->target); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->sector_num, &b->sector_num); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_stm_flash_lock_sector_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_stm_flash_lock_sector_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->sector)) { return false; } +bool sbp_msg_stm_flash_lock_sector_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_stm_flash_lock_sector_t *msg) { + if (!sbp_u32_encode(ctx, &msg->sector)) { + return false; + } return true; } -s8 sbp_msg_stm_flash_lock_sector_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_stm_flash_lock_sector_t *msg) { +s8 sbp_msg_stm_flash_lock_sector_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_stm_flash_lock_sector_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -404,13 +518,17 @@ s8 sbp_msg_stm_flash_lock_sector_encode(uint8_t *buf, uint8_t len, uint8_t *n_wr return SBP_OK; } -bool sbp_msg_stm_flash_lock_sector_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_stm_flash_lock_sector_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->sector)) { return false; } +bool sbp_msg_stm_flash_lock_sector_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_stm_flash_lock_sector_t *msg) { + if (!sbp_u32_decode(ctx, &msg->sector)) { + return false; + } return true; } -s8 sbp_msg_stm_flash_lock_sector_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_stm_flash_lock_sector_t *msg) { +s8 sbp_msg_stm_flash_lock_sector_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_stm_flash_lock_sector_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -424,31 +542,43 @@ s8 sbp_msg_stm_flash_lock_sector_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_stm_flash_lock_sector_send(sbp_state_t *s, u16 sender_id, const sbp_msg_stm_flash_lock_sector_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_stm_flash_lock_sector_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_stm_flash_lock_sector_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_stm_flash_lock_sector_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_STM_FLASH_LOCK_SECTOR, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_stm_flash_lock_sector_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_STM_FLASH_LOCK_SECTOR, sender_id, + payload_len, payload, write); } -int sbp_msg_stm_flash_lock_sector_cmp(const sbp_msg_stm_flash_lock_sector_t *a, const sbp_msg_stm_flash_lock_sector_t *b) { +int sbp_msg_stm_flash_lock_sector_cmp( + const sbp_msg_stm_flash_lock_sector_t *a, + const sbp_msg_stm_flash_lock_sector_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->sector, &b->sector); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_stm_flash_unlock_sector_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_stm_flash_unlock_sector_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->sector)) { return false; } +bool sbp_msg_stm_flash_unlock_sector_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_stm_flash_unlock_sector_t *msg) { + if (!sbp_u32_encode(ctx, &msg->sector)) { + return false; + } return true; } -s8 sbp_msg_stm_flash_unlock_sector_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_stm_flash_unlock_sector_t *msg) { +s8 sbp_msg_stm_flash_unlock_sector_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_stm_flash_unlock_sector_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -462,13 +592,17 @@ s8 sbp_msg_stm_flash_unlock_sector_encode(uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } -bool sbp_msg_stm_flash_unlock_sector_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_stm_flash_unlock_sector_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->sector)) { return false; } +bool sbp_msg_stm_flash_unlock_sector_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_stm_flash_unlock_sector_t *msg) { + if (!sbp_u32_decode(ctx, &msg->sector)) { + return false; + } return true; } -s8 sbp_msg_stm_flash_unlock_sector_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_stm_flash_unlock_sector_t *msg) { +s8 sbp_msg_stm_flash_unlock_sector_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_stm_flash_unlock_sector_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -482,32 +616,42 @@ s8 sbp_msg_stm_flash_unlock_sector_decode(const uint8_t *buf, uint8_t len, uint8 return SBP_OK; } - -s8 sbp_msg_stm_flash_unlock_sector_send(sbp_state_t *s, u16 sender_id, const sbp_msg_stm_flash_unlock_sector_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_stm_flash_unlock_sector_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_stm_flash_unlock_sector_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_stm_flash_unlock_sector_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_STM_FLASH_UNLOCK_SECTOR, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_stm_flash_unlock_sector_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_STM_FLASH_UNLOCK_SECTOR, sender_id, + payload_len, payload, write); } -int sbp_msg_stm_flash_unlock_sector_cmp(const sbp_msg_stm_flash_unlock_sector_t *a, const sbp_msg_stm_flash_unlock_sector_t *b) { +int sbp_msg_stm_flash_unlock_sector_cmp( + const sbp_msg_stm_flash_unlock_sector_t *a, + const sbp_msg_stm_flash_unlock_sector_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->sector, &b->sector); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_stm_unique_id_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_stm_unique_id_req_t *msg) -{ +bool sbp_msg_stm_unique_id_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_stm_unique_id_req_t *msg) { (void)ctx; (void)msg; return true; } -s8 sbp_msg_stm_unique_id_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_stm_unique_id_req_t *msg) { +s8 sbp_msg_stm_unique_id_req_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_stm_unique_id_req_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -521,14 +665,16 @@ s8 sbp_msg_stm_unique_id_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_stm_unique_id_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_stm_unique_id_req_t *msg) -{ - (void)ctx; +bool sbp_msg_stm_unique_id_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_stm_unique_id_req_t *msg) { + (void)ctx; (void)msg; return true; } -s8 sbp_msg_stm_unique_id_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_stm_unique_id_req_t *msg) { +s8 sbp_msg_stm_unique_id_req_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_stm_unique_id_req_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -542,33 +688,41 @@ s8 sbp_msg_stm_unique_id_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_stm_unique_id_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_stm_unique_id_req_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_stm_unique_id_req_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_stm_unique_id_req_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_stm_unique_id_req_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_STM_UNIQUE_ID_REQ, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_stm_unique_id_req_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_STM_UNIQUE_ID_REQ, sender_id, payload_len, + payload, write); } -int sbp_msg_stm_unique_id_req_cmp(const sbp_msg_stm_unique_id_req_t *a, const sbp_msg_stm_unique_id_req_t *b) { +int sbp_msg_stm_unique_id_req_cmp(const sbp_msg_stm_unique_id_req_t *a, + const sbp_msg_stm_unique_id_req_t *b) { (void)a; (void)b; int ret = 0; return ret; } -bool sbp_msg_stm_unique_id_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_stm_unique_id_resp_t *msg) -{ - for (size_t i = 0; i < SBP_MSG_STM_UNIQUE_ID_RESP_STM_ID_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->stm_id[i])) { return false; } +bool sbp_msg_stm_unique_id_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_stm_unique_id_resp_t *msg) { + for (size_t i = 0; i < SBP_MSG_STM_UNIQUE_ID_RESP_STM_ID_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->stm_id[i])) { + return false; + } } return true; } -s8 sbp_msg_stm_unique_id_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_stm_unique_id_resp_t *msg) { +s8 sbp_msg_stm_unique_id_resp_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_stm_unique_id_resp_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -582,15 +736,19 @@ s8 sbp_msg_stm_unique_id_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_writt return SBP_OK; } -bool sbp_msg_stm_unique_id_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_stm_unique_id_resp_t *msg) -{ +bool sbp_msg_stm_unique_id_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_stm_unique_id_resp_t *msg) { for (uint8_t i = 0; i < SBP_MSG_STM_UNIQUE_ID_RESP_STM_ID_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->stm_id[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->stm_id[i])) { + return false; + } } return true; } -s8 sbp_msg_stm_unique_id_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_stm_unique_id_resp_t *msg) { +s8 sbp_msg_stm_unique_id_resp_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_stm_unique_id_resp_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -604,37 +762,47 @@ s8 sbp_msg_stm_unique_id_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } - -s8 sbp_msg_stm_unique_id_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_stm_unique_id_resp_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_stm_unique_id_resp_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_stm_unique_id_resp_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_stm_unique_id_resp_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_STM_UNIQUE_ID_RESP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_stm_unique_id_resp_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_STM_UNIQUE_ID_RESP, sender_id, payload_len, + payload, write); } -int sbp_msg_stm_unique_id_resp_cmp(const sbp_msg_stm_unique_id_resp_t *a, const sbp_msg_stm_unique_id_resp_t *b) { +int sbp_msg_stm_unique_id_resp_cmp(const sbp_msg_stm_unique_id_resp_t *a, + const sbp_msg_stm_unique_id_resp_t *b) { int ret = 0; - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_STM_UNIQUE_ID_RESP_STM_ID_MAX; i++) - { + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_STM_UNIQUE_ID_RESP_STM_ID_MAX; + i++) { ret = sbp_u8_cmp(&a->stm_id[i], &b->stm_id[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_m25_flash_write_status_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_m25_flash_write_status_t *msg) -{ - for (size_t i = 0; i < SBP_MSG_M25_FLASH_WRITE_STATUS_STATUS_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->status[i])) { return false; } +bool sbp_msg_m25_flash_write_status_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_m25_flash_write_status_t *msg) { + for (size_t i = 0; i < SBP_MSG_M25_FLASH_WRITE_STATUS_STATUS_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->status[i])) { + return false; + } } return true; } -s8 sbp_msg_m25_flash_write_status_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_m25_flash_write_status_t *msg) { +s8 sbp_msg_m25_flash_write_status_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_m25_flash_write_status_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -648,15 +816,19 @@ s8 sbp_msg_m25_flash_write_status_encode(uint8_t *buf, uint8_t len, uint8_t *n_w return SBP_OK; } -bool sbp_msg_m25_flash_write_status_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_m25_flash_write_status_t *msg) -{ +bool sbp_msg_m25_flash_write_status_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_m25_flash_write_status_t *msg) { for (uint8_t i = 0; i < SBP_MSG_M25_FLASH_WRITE_STATUS_STATUS_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->status[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->status[i])) { + return false; + } } return true; } -s8 sbp_msg_m25_flash_write_status_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_m25_flash_write_status_t *msg) { +s8 sbp_msg_m25_flash_write_status_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_m25_flash_write_status_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -670,23 +842,31 @@ s8 sbp_msg_m25_flash_write_status_decode(const uint8_t *buf, uint8_t len, uint8_ return SBP_OK; } - -s8 sbp_msg_m25_flash_write_status_send(sbp_state_t *s, u16 sender_id, const sbp_msg_m25_flash_write_status_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_m25_flash_write_status_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_m25_flash_write_status_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_m25_flash_write_status_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_M25_FLASH_WRITE_STATUS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_m25_flash_write_status_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_M25_FLASH_WRITE_STATUS, sender_id, + payload_len, payload, write); } -int sbp_msg_m25_flash_write_status_cmp(const sbp_msg_m25_flash_write_status_t *a, const sbp_msg_m25_flash_write_status_t *b) { +int sbp_msg_m25_flash_write_status_cmp( + const sbp_msg_m25_flash_write_status_t *a, + const sbp_msg_m25_flash_write_status_t *b) { int ret = 0; - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_M25_FLASH_WRITE_STATUS_STATUS_MAX; i++) - { + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_M25_FLASH_WRITE_STATUS_STATUS_MAX; + i++) { ret = sbp_u8_cmp(&a->status[i], &b->status[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/gnss.c b/c/src/gnss.c index f2ea8628b..7ab62b659 100644 --- a/c/src/gnss.c +++ b/c/src/gnss.c @@ -3,28 +3,33 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include -#include #include +#include #include +#include +#include #include #include -#include #include +#include -bool sbp_v4_gnss_signal_encode_internal(sbp_encode_ctx_t *ctx, const sbp_v4_gnss_signal_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->sat)) { return false; } - if (!sbp_u8_encode(ctx, &msg->code)) { return false; } +bool sbp_v4_gnss_signal_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_v4_gnss_signal_t *msg) { + if (!sbp_u8_encode(ctx, &msg->sat)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->code)) { + return false; + } return true; } -s8 sbp_v4_gnss_signal_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_v4_gnss_signal_t *msg) { +s8 sbp_v4_gnss_signal_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_v4_gnss_signal_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -38,14 +43,19 @@ s8 sbp_v4_gnss_signal_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, cons return SBP_OK; } -bool sbp_v4_gnss_signal_decode_internal(sbp_decode_ctx_t *ctx, sbp_v4_gnss_signal_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->sat)) { return false; } - if (!sbp_u8_decode(ctx, &msg->code)) { return false; } +bool sbp_v4_gnss_signal_decode_internal(sbp_decode_ctx_t *ctx, + sbp_v4_gnss_signal_t *msg) { + if (!sbp_u8_decode(ctx, &msg->sat)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->code)) { + return false; + } return true; } -s8 sbp_v4_gnss_signal_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_v4_gnss_signal_t *msg) { +s8 sbp_v4_gnss_signal_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_v4_gnss_signal_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -59,27 +69,34 @@ s8 sbp_v4_gnss_signal_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, s return SBP_OK; } - - -int sbp_v4_gnss_signal_cmp(const sbp_v4_gnss_signal_t *a, const sbp_v4_gnss_signal_t *b) { +int sbp_v4_gnss_signal_cmp(const sbp_v4_gnss_signal_t *a, + const sbp_v4_gnss_signal_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->sat, &b->sat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->code, &b->code); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_sv_id_encode_internal(sbp_encode_ctx_t *ctx, const sbp_sv_id_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->satId)) { return false; } - if (!sbp_u8_encode(ctx, &msg->constellation)) { return false; } +bool sbp_sv_id_encode_internal(sbp_encode_ctx_t *ctx, const sbp_sv_id_t *msg) { + if (!sbp_u8_encode(ctx, &msg->satId)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->constellation)) { + return false; + } return true; } -s8 sbp_sv_id_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_sv_id_t *msg) { +s8 sbp_sv_id_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_sv_id_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -93,14 +110,18 @@ s8 sbp_sv_id_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_sv_ return SBP_OK; } -bool sbp_sv_id_decode_internal(sbp_decode_ctx_t *ctx, sbp_sv_id_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->satId)) { return false; } - if (!sbp_u8_decode(ctx, &msg->constellation)) { return false; } +bool sbp_sv_id_decode_internal(sbp_decode_ctx_t *ctx, sbp_sv_id_t *msg) { + if (!sbp_u8_decode(ctx, &msg->satId)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->constellation)) { + return false; + } return true; } -s8 sbp_sv_id_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_sv_id_t *msg) { +s8 sbp_sv_id_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_sv_id_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -114,28 +135,37 @@ s8 sbp_sv_id_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_sv_id_ return SBP_OK; } - - int sbp_sv_id_cmp(const sbp_sv_id_t *a, const sbp_sv_id_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->satId, &b->satId); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->constellation, &b->constellation); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_gnss_signal_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gnss_signal_dep_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->sat)) { return false; } - if (!sbp_u8_encode(ctx, &msg->code)) { return false; } - if (!sbp_u8_encode(ctx, &msg->reserved)) { return false; } +bool sbp_gnss_signal_dep_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_gnss_signal_dep_t *msg) { + if (!sbp_u16_encode(ctx, &msg->sat)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->code)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->reserved)) { + return false; + } return true; } -s8 sbp_gnss_signal_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_gnss_signal_dep_t *msg) { +s8 sbp_gnss_signal_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_gnss_signal_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -149,15 +179,22 @@ s8 sbp_gnss_signal_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, con return SBP_OK; } -bool sbp_gnss_signal_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_gnss_signal_dep_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->sat)) { return false; } - if (!sbp_u8_decode(ctx, &msg->code)) { return false; } - if (!sbp_u8_decode(ctx, &msg->reserved)) { return false; } +bool sbp_gnss_signal_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_gnss_signal_dep_t *msg) { + if (!sbp_u16_decode(ctx, &msg->sat)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->code)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->reserved)) { + return false; + } return true; } -s8 sbp_gnss_signal_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_gnss_signal_dep_t *msg) { +s8 sbp_gnss_signal_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_gnss_signal_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -171,30 +208,40 @@ s8 sbp_gnss_signal_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - - -int sbp_gnss_signal_dep_cmp(const sbp_gnss_signal_dep_t *a, const sbp_gnss_signal_dep_t *b) { +int sbp_gnss_signal_dep_cmp(const sbp_gnss_signal_dep_t *a, + const sbp_gnss_signal_dep_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->sat, &b->sat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->code, &b->code); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->reserved, &b->reserved); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_gps_time_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gps_time_dep_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->wn)) { return false; } +bool sbp_gps_time_dep_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_gps_time_dep_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->wn)) { + return false; + } return true; } -s8 sbp_gps_time_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_gps_time_dep_t *msg) { +s8 sbp_gps_time_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_gps_time_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -208,14 +255,19 @@ s8 sbp_gps_time_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_gps_time_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_gps_time_dep_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->wn)) { return false; } +bool sbp_gps_time_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_gps_time_dep_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->wn)) { + return false; + } return true; } -s8 sbp_gps_time_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_gps_time_dep_t *msg) { +s8 sbp_gps_time_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_gps_time_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -229,27 +281,35 @@ s8 sbp_gps_time_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp return SBP_OK; } - - -int sbp_gps_time_dep_cmp(const sbp_gps_time_dep_t *a, const sbp_gps_time_dep_t *b) { +int sbp_gps_time_dep_cmp(const sbp_gps_time_dep_t *a, + const sbp_gps_time_dep_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->wn, &b->wn); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_gps_time_sec_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gps_time_sec_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->wn)) { return false; } +bool sbp_gps_time_sec_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_gps_time_sec_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->wn)) { + return false; + } return true; } -s8 sbp_gps_time_sec_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_gps_time_sec_t *msg) { +s8 sbp_gps_time_sec_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_gps_time_sec_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -263,14 +323,19 @@ s8 sbp_gps_time_sec_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_gps_time_sec_decode_internal(sbp_decode_ctx_t *ctx, sbp_gps_time_sec_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->wn)) { return false; } +bool sbp_gps_time_sec_decode_internal(sbp_decode_ctx_t *ctx, + sbp_gps_time_sec_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->wn)) { + return false; + } return true; } -s8 sbp_gps_time_sec_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_gps_time_sec_t *msg) { +s8 sbp_gps_time_sec_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_gps_time_sec_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -284,28 +349,38 @@ s8 sbp_gps_time_sec_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp return SBP_OK; } - - -int sbp_gps_time_sec_cmp(const sbp_gps_time_sec_t *a, const sbp_gps_time_sec_t *b) { +int sbp_gps_time_sec_cmp(const sbp_gps_time_sec_t *a, + const sbp_gps_time_sec_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->wn, &b->wn); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_v4_gps_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_v4_gps_time_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->ns_residual)) { return false; } - if (!sbp_u16_encode(ctx, &msg->wn)) { return false; } +bool sbp_v4_gps_time_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_v4_gps_time_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->ns_residual)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->wn)) { + return false; + } return true; } -s8 sbp_v4_gps_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_v4_gps_time_t *msg) { +s8 sbp_v4_gps_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_v4_gps_time_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -319,15 +394,22 @@ s8 sbp_v4_gps_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const s return SBP_OK; } -bool sbp_v4_gps_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_v4_gps_time_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->ns_residual)) { return false; } - if (!sbp_u16_decode(ctx, &msg->wn)) { return false; } +bool sbp_v4_gps_time_decode_internal(sbp_decode_ctx_t *ctx, + sbp_v4_gps_time_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->ns_residual)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->wn)) { + return false; + } return true; } -s8 sbp_v4_gps_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_v4_gps_time_t *msg) { +s8 sbp_v4_gps_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_v4_gps_time_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -341,30 +423,40 @@ s8 sbp_v4_gps_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ return SBP_OK; } - - -int sbp_v4_gps_time_cmp(const sbp_v4_gps_time_t *a, const sbp_v4_gps_time_t *b) { +int sbp_v4_gps_time_cmp(const sbp_v4_gps_time_t *a, + const sbp_v4_gps_time_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->ns_residual, &b->ns_residual); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->wn, &b->wn); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_carrier_phase_encode_internal(sbp_encode_ctx_t *ctx, const sbp_carrier_phase_t *msg) -{ - if (!sbp_s32_encode(ctx, &msg->i)) { return false; } - if (!sbp_u8_encode(ctx, &msg->f)) { return false; } +bool sbp_carrier_phase_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_carrier_phase_t *msg) { + if (!sbp_s32_encode(ctx, &msg->i)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->f)) { + return false; + } return true; } -s8 sbp_carrier_phase_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_carrier_phase_t *msg) { +s8 sbp_carrier_phase_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_carrier_phase_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -378,14 +470,19 @@ s8 sbp_carrier_phase_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_carrier_phase_decode_internal(sbp_decode_ctx_t *ctx, sbp_carrier_phase_t *msg) -{ - if (!sbp_s32_decode(ctx, &msg->i)) { return false; } - if (!sbp_u8_decode(ctx, &msg->f)) { return false; } +bool sbp_carrier_phase_decode_internal(sbp_decode_ctx_t *ctx, + sbp_carrier_phase_t *msg) { + if (!sbp_s32_decode(ctx, &msg->i)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->f)) { + return false; + } return true; } -s8 sbp_carrier_phase_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_carrier_phase_t *msg) { +s8 sbp_carrier_phase_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_carrier_phase_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -399,15 +496,18 @@ s8 sbp_carrier_phase_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - - -int sbp_carrier_phase_cmp(const sbp_carrier_phase_t *a, const sbp_carrier_phase_t *b) { +int sbp_carrier_phase_cmp(const sbp_carrier_phase_t *a, + const sbp_carrier_phase_t *b) { int ret = 0; - + ret = sbp_s32_cmp(&a->i, &b->i); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->f, &b->f); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/imu.c b/c/src/imu.c index 7eed17500..4db49a36d 100644 --- a/c/src/imu.c +++ b/c/src/imu.c @@ -3,34 +3,51 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include -#include #include +#include #include +#include +#include #include #include -#include #include +#include -bool sbp_msg_imu_raw_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_imu_raw_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u8_encode(ctx, &msg->tow_f)) { return false; } - if (!sbp_s16_encode(ctx, &msg->acc_x)) { return false; } - if (!sbp_s16_encode(ctx, &msg->acc_y)) { return false; } - if (!sbp_s16_encode(ctx, &msg->acc_z)) { return false; } - if (!sbp_s16_encode(ctx, &msg->gyr_x)) { return false; } - if (!sbp_s16_encode(ctx, &msg->gyr_y)) { return false; } - if (!sbp_s16_encode(ctx, &msg->gyr_z)) { return false; } +bool sbp_msg_imu_raw_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_imu_raw_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->tow_f)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->acc_x)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->acc_y)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->acc_z)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->gyr_x)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->gyr_y)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->gyr_z)) { + return false; + } return true; } -s8 sbp_msg_imu_raw_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_imu_raw_t *msg) { +s8 sbp_msg_imu_raw_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_imu_raw_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -44,20 +61,37 @@ s8 sbp_msg_imu_raw_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const s return SBP_OK; } -bool sbp_msg_imu_raw_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_imu_raw_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u8_decode(ctx, &msg->tow_f)) { return false; } - if (!sbp_s16_decode(ctx, &msg->acc_x)) { return false; } - if (!sbp_s16_decode(ctx, &msg->acc_y)) { return false; } - if (!sbp_s16_decode(ctx, &msg->acc_z)) { return false; } - if (!sbp_s16_decode(ctx, &msg->gyr_x)) { return false; } - if (!sbp_s16_decode(ctx, &msg->gyr_y)) { return false; } - if (!sbp_s16_decode(ctx, &msg->gyr_z)) { return false; } +bool sbp_msg_imu_raw_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_imu_raw_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->tow_f)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->acc_x)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->acc_y)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->acc_z)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->gyr_x)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->gyr_y)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->gyr_z)) { + return false; + } return true; } -s8 sbp_msg_imu_raw_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_imu_raw_t *msg) { +s8 sbp_msg_imu_raw_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_imu_raw_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -71,54 +105,80 @@ s8 sbp_msg_imu_raw_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ return SBP_OK; } - -s8 sbp_msg_imu_raw_send(sbp_state_t *s, u16 sender_id, const sbp_msg_imu_raw_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_imu_raw_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_imu_raw_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_imu_raw_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_IMU_RAW, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_IMU_RAW, sender_id, payload_len, payload, + write); } -int sbp_msg_imu_raw_cmp(const sbp_msg_imu_raw_t *a, const sbp_msg_imu_raw_t *b) { +int sbp_msg_imu_raw_cmp(const sbp_msg_imu_raw_t *a, + const sbp_msg_imu_raw_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->tow_f, &b->tow_f); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->acc_x, &b->acc_x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->acc_y, &b->acc_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->acc_z, &b->acc_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->gyr_x, &b->gyr_x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->gyr_y, &b->gyr_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->gyr_z, &b->gyr_z); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_imu_aux_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_imu_aux_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->imu_type)) { return false; } - if (!sbp_s16_encode(ctx, &msg->temp)) { return false; } - if (!sbp_u8_encode(ctx, &msg->imu_conf)) { return false; } +bool sbp_msg_imu_aux_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_imu_aux_t *msg) { + if (!sbp_u8_encode(ctx, &msg->imu_type)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->temp)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->imu_conf)) { + return false; + } return true; } -s8 sbp_msg_imu_aux_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_imu_aux_t *msg) { +s8 sbp_msg_imu_aux_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_imu_aux_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -132,15 +192,22 @@ s8 sbp_msg_imu_aux_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const s return SBP_OK; } -bool sbp_msg_imu_aux_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_imu_aux_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->imu_type)) { return false; } - if (!sbp_s16_decode(ctx, &msg->temp)) { return false; } - if (!sbp_u8_decode(ctx, &msg->imu_conf)) { return false; } +bool sbp_msg_imu_aux_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_imu_aux_t *msg) { + if (!sbp_u8_decode(ctx, &msg->imu_type)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->temp)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->imu_conf)) { + return false; + } return true; } -s8 sbp_msg_imu_aux_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_imu_aux_t *msg) { +s8 sbp_msg_imu_aux_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_imu_aux_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -154,26 +221,35 @@ s8 sbp_msg_imu_aux_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ return SBP_OK; } - -s8 sbp_msg_imu_aux_send(sbp_state_t *s, u16 sender_id, const sbp_msg_imu_aux_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_imu_aux_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_imu_aux_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_imu_aux_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_IMU_AUX, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_IMU_AUX, sender_id, payload_len, payload, + write); } -int sbp_msg_imu_aux_cmp(const sbp_msg_imu_aux_t *a, const sbp_msg_imu_aux_t *b) { +int sbp_msg_imu_aux_cmp(const sbp_msg_imu_aux_t *a, + const sbp_msg_imu_aux_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->imu_type, &b->imu_type); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->temp, &b->temp); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->imu_conf, &b->imu_conf); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/include/libsbp/internal/acquisition.h b/c/src/include/libsbp/internal/acquisition.h index a059c5026..898037197 100644 --- a/c/src/include/libsbp/internal/acquisition.h +++ b/c/src/include/libsbp/internal/acquisition.h @@ -25,7 +25,7 @@ #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -35,7 +35,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_acq_result_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_acq_result_t *msg); +bool sbp_msg_acq_result_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_acq_result_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -44,7 +45,8 @@ bool sbp_msg_acq_result_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_acq * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_acq_result_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq_result_t *msg); +bool sbp_msg_acq_result_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_acq_result_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -53,7 +55,8 @@ bool sbp_msg_acq_result_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq_resul * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_acq_result_dep_c_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_acq_result_dep_c_t *msg); +bool sbp_msg_acq_result_dep_c_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_acq_result_dep_c_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -62,7 +65,8 @@ bool sbp_msg_acq_result_dep_c_encode_internal(sbp_encode_ctx_t *ctx, const sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_acq_result_dep_c_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq_result_dep_c_t *msg); +bool sbp_msg_acq_result_dep_c_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_acq_result_dep_c_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -71,7 +75,8 @@ bool sbp_msg_acq_result_dep_c_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_acq_result_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_acq_result_dep_b_t *msg); +bool sbp_msg_acq_result_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_acq_result_dep_b_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -80,7 +85,8 @@ bool sbp_msg_acq_result_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_acq_result_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq_result_dep_b_t *msg); +bool sbp_msg_acq_result_dep_b_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_acq_result_dep_b_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -89,7 +95,8 @@ bool sbp_msg_acq_result_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_acq_result_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_acq_result_dep_a_t *msg); +bool sbp_msg_acq_result_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_acq_result_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -98,7 +105,8 @@ bool sbp_msg_acq_result_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_acq_result_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq_result_dep_a_t *msg); +bool sbp_msg_acq_result_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_acq_result_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -107,7 +115,8 @@ bool sbp_msg_acq_result_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_acq_sv_profile_encode_internal(sbp_encode_ctx_t *ctx, const sbp_acq_sv_profile_t *msg); +bool sbp_acq_sv_profile_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_acq_sv_profile_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -116,7 +125,8 @@ bool sbp_acq_sv_profile_encode_internal(sbp_encode_ctx_t *ctx, const sbp_acq_sv_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_acq_sv_profile_decode_internal(sbp_decode_ctx_t *ctx, sbp_acq_sv_profile_t *msg); +bool sbp_acq_sv_profile_decode_internal(sbp_decode_ctx_t *ctx, + sbp_acq_sv_profile_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -125,7 +135,8 @@ bool sbp_acq_sv_profile_decode_internal(sbp_decode_ctx_t *ctx, sbp_acq_sv_profil * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_acq_sv_profile_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_acq_sv_profile_dep_t *msg); +bool sbp_acq_sv_profile_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_acq_sv_profile_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -134,7 +145,8 @@ bool sbp_acq_sv_profile_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_acq * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_acq_sv_profile_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_acq_sv_profile_dep_t *msg); +bool sbp_acq_sv_profile_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_acq_sv_profile_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -143,7 +155,8 @@ bool sbp_acq_sv_profile_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_acq_sv_pr * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_acq_sv_profile_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_acq_sv_profile_t *msg); +bool sbp_msg_acq_sv_profile_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_acq_sv_profile_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -152,7 +165,8 @@ bool sbp_msg_acq_sv_profile_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_acq_sv_profile_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq_sv_profile_t *msg); +bool sbp_msg_acq_sv_profile_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_acq_sv_profile_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -161,7 +175,8 @@ bool sbp_msg_acq_sv_profile_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq_s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_acq_sv_profile_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_acq_sv_profile_dep_t *msg); +bool sbp_msg_acq_sv_profile_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_acq_sv_profile_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -170,10 +185,11 @@ bool sbp_msg_acq_sv_profile_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_acq_sv_profile_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acq_sv_profile_dep_t *msg); +bool sbp_msg_acq_sv_profile_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_acq_sv_profile_dep_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_ACQUISITION_H */ diff --git a/c/src/include/libsbp/internal/bootload.h b/c/src/include/libsbp/internal/bootload.h index e08fd723f..814fd26c5 100644 --- a/c/src/include/libsbp/internal/bootload.h +++ b/c/src/include/libsbp/internal/bootload.h @@ -24,7 +24,7 @@ #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_bootloader_handshake_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_handshake_req_t *msg); +bool sbp_msg_bootloader_handshake_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_handshake_req_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -43,7 +44,8 @@ bool sbp_msg_bootloader_handshake_req_encode_internal(sbp_encode_ctx_t *ctx, con * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_bootloader_handshake_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_bootloader_handshake_req_t *msg); +bool sbp_msg_bootloader_handshake_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_bootloader_handshake_req_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -52,7 +54,8 @@ bool sbp_msg_bootloader_handshake_req_decode_internal(sbp_decode_ctx_t *ctx, sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_bootloader_handshake_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_handshake_resp_t *msg); +bool sbp_msg_bootloader_handshake_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_handshake_resp_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -61,7 +64,8 @@ bool sbp_msg_bootloader_handshake_resp_encode_internal(sbp_encode_ctx_t *ctx, co * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_bootloader_handshake_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_bootloader_handshake_resp_t *msg); +bool sbp_msg_bootloader_handshake_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_bootloader_handshake_resp_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -70,7 +74,8 @@ bool sbp_msg_bootloader_handshake_resp_decode_internal(sbp_decode_ctx_t *ctx, sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_bootloader_jump_to_app_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_jump_to_app_t *msg); +bool sbp_msg_bootloader_jump_to_app_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_jump_to_app_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -79,7 +84,8 @@ bool sbp_msg_bootloader_jump_to_app_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_bootloader_jump_to_app_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_bootloader_jump_to_app_t *msg); +bool sbp_msg_bootloader_jump_to_app_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_bootloader_jump_to_app_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -88,7 +94,8 @@ bool sbp_msg_bootloader_jump_to_app_decode_internal(sbp_decode_ctx_t *ctx, sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_nap_device_dna_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_nap_device_dna_req_t *msg); +bool sbp_msg_nap_device_dna_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_nap_device_dna_req_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -97,7 +104,8 @@ bool sbp_msg_nap_device_dna_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_nap_device_dna_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_nap_device_dna_req_t *msg); +bool sbp_msg_nap_device_dna_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_nap_device_dna_req_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -106,7 +114,8 @@ bool sbp_msg_nap_device_dna_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_n * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_nap_device_dna_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_nap_device_dna_resp_t *msg); +bool sbp_msg_nap_device_dna_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_nap_device_dna_resp_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -115,7 +124,8 @@ bool sbp_msg_nap_device_dna_resp_encode_internal(sbp_encode_ctx_t *ctx, const sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_nap_device_dna_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_nap_device_dna_resp_t *msg); +bool sbp_msg_nap_device_dna_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_nap_device_dna_resp_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -124,7 +134,8 @@ bool sbp_msg_nap_device_dna_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_bootloader_handshake_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_handshake_dep_a_t *msg); +bool sbp_msg_bootloader_handshake_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_bootloader_handshake_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -133,10 +144,11 @@ bool sbp_msg_bootloader_handshake_dep_a_encode_internal(sbp_encode_ctx_t *ctx, c * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_bootloader_handshake_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_bootloader_handshake_dep_a_t *msg); +bool sbp_msg_bootloader_handshake_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_bootloader_handshake_dep_a_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_BOOTLOAD_H */ diff --git a/c/src/include/libsbp/internal/ext_events.h b/c/src/include/libsbp/internal/ext_events.h index 0bceef1b5..4fa6351e4 100644 --- a/c/src/include/libsbp/internal/ext_events.h +++ b/c/src/include/libsbp/internal/ext_events.h @@ -24,7 +24,7 @@ #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ext_event_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ext_event_t *msg); +bool sbp_msg_ext_event_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ext_event_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -43,10 +44,11 @@ bool sbp_msg_ext_event_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ext_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ext_event_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ext_event_t *msg); +bool sbp_msg_ext_event_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ext_event_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_EXT_EVENTS_H */ diff --git a/c/src/include/libsbp/internal/file_io.h b/c/src/include/libsbp/internal/file_io.h index 4a99faccf..2423bcbb1 100644 --- a/c/src/include/libsbp/internal/file_io.h +++ b/c/src/include/libsbp/internal/file_io.h @@ -24,7 +24,7 @@ #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_read_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_req_t *msg); +bool sbp_msg_fileio_read_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_req_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -43,7 +44,8 @@ bool sbp_msg_fileio_read_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_read_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_read_req_t *msg); +bool sbp_msg_fileio_read_req_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_fileio_read_req_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -52,7 +54,8 @@ bool sbp_msg_fileio_read_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_file * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_read_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_resp_t *msg); +bool sbp_msg_fileio_read_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_resp_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -61,7 +64,8 @@ bool sbp_msg_fileio_read_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_read_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_read_resp_t *msg); +bool sbp_msg_fileio_read_resp_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_fileio_read_resp_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -70,7 +74,8 @@ bool sbp_msg_fileio_read_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fil * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_read_dir_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_dir_req_t *msg); +bool sbp_msg_fileio_read_dir_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_dir_req_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -79,7 +84,8 @@ bool sbp_msg_fileio_read_dir_req_encode_internal(sbp_encode_ctx_t *ctx, const sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_read_dir_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_read_dir_req_t *msg); +bool sbp_msg_fileio_read_dir_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_fileio_read_dir_req_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -88,7 +94,8 @@ bool sbp_msg_fileio_read_dir_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_read_dir_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_dir_resp_t *msg); +bool sbp_msg_fileio_read_dir_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_read_dir_resp_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -97,7 +104,8 @@ bool sbp_msg_fileio_read_dir_resp_encode_internal(sbp_encode_ctx_t *ctx, const s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_read_dir_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_read_dir_resp_t *msg); +bool sbp_msg_fileio_read_dir_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_fileio_read_dir_resp_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -106,7 +114,8 @@ bool sbp_msg_fileio_read_dir_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_remove_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_remove_t *msg); +bool sbp_msg_fileio_remove_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_fileio_remove_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -115,7 +124,8 @@ bool sbp_msg_fileio_remove_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_remove_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_remove_t *msg); +bool sbp_msg_fileio_remove_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_fileio_remove_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -124,7 +134,8 @@ bool sbp_msg_fileio_remove_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_write_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_write_req_t *msg); +bool sbp_msg_fileio_write_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_write_req_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -133,7 +144,8 @@ bool sbp_msg_fileio_write_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_write_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_write_req_t *msg); +bool sbp_msg_fileio_write_req_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_fileio_write_req_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -142,7 +154,8 @@ bool sbp_msg_fileio_write_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fil * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_write_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_write_resp_t *msg); +bool sbp_msg_fileio_write_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_write_resp_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -151,7 +164,8 @@ bool sbp_msg_fileio_write_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_write_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_write_resp_t *msg); +bool sbp_msg_fileio_write_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_fileio_write_resp_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -160,7 +174,8 @@ bool sbp_msg_fileio_write_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fi * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_config_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_config_req_t *msg); +bool sbp_msg_fileio_config_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_config_req_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -169,7 +184,8 @@ bool sbp_msg_fileio_config_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_config_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_config_req_t *msg); +bool sbp_msg_fileio_config_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_fileio_config_req_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -178,7 +194,8 @@ bool sbp_msg_fileio_config_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fi * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_config_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fileio_config_resp_t *msg); +bool sbp_msg_fileio_config_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_fileio_config_resp_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -187,10 +204,11 @@ bool sbp_msg_fileio_config_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fileio_config_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fileio_config_resp_t *msg); +bool sbp_msg_fileio_config_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_fileio_config_resp_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_FILE_IO_H */ diff --git a/c/src/include/libsbp/internal/flash.h b/c/src/include/libsbp/internal/flash.h index a78af6678..81989cf4f 100644 --- a/c/src/include/libsbp/internal/flash.h +++ b/c/src/include/libsbp/internal/flash.h @@ -24,7 +24,7 @@ #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_flash_program_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_flash_program_t *msg); +bool sbp_msg_flash_program_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_flash_program_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -43,7 +44,8 @@ bool sbp_msg_flash_program_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_flash_program_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_flash_program_t *msg); +bool sbp_msg_flash_program_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_flash_program_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -52,7 +54,8 @@ bool sbp_msg_flash_program_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_flash_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_flash_done_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_flash_done_t *msg); +bool sbp_msg_flash_done_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_flash_done_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -61,7 +64,8 @@ bool sbp_msg_flash_done_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fla * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_flash_done_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_flash_done_t *msg); +bool sbp_msg_flash_done_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_flash_done_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -70,7 +74,8 @@ bool sbp_msg_flash_done_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_flash_don * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_flash_read_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_flash_read_req_t *msg); +bool sbp_msg_flash_read_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_flash_read_req_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -79,7 +84,8 @@ bool sbp_msg_flash_read_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_flash_read_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_flash_read_req_t *msg); +bool sbp_msg_flash_read_req_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_flash_read_req_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -88,7 +94,8 @@ bool sbp_msg_flash_read_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_flash * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_flash_read_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_flash_read_resp_t *msg); +bool sbp_msg_flash_read_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_flash_read_resp_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -97,7 +104,8 @@ bool sbp_msg_flash_read_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_flash_read_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_flash_read_resp_t *msg); +bool sbp_msg_flash_read_resp_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_flash_read_resp_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -106,7 +114,8 @@ bool sbp_msg_flash_read_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_flas * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_flash_erase_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_flash_erase_t *msg); +bool sbp_msg_flash_erase_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_flash_erase_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -115,7 +124,8 @@ bool sbp_msg_flash_erase_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fl * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_flash_erase_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_flash_erase_t *msg); +bool sbp_msg_flash_erase_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_flash_erase_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -124,7 +134,8 @@ bool sbp_msg_flash_erase_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_flash_er * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_stm_flash_lock_sector_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_stm_flash_lock_sector_t *msg); +bool sbp_msg_stm_flash_lock_sector_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_stm_flash_lock_sector_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -133,7 +144,8 @@ bool sbp_msg_stm_flash_lock_sector_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_stm_flash_lock_sector_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_stm_flash_lock_sector_t *msg); +bool sbp_msg_stm_flash_lock_sector_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_stm_flash_lock_sector_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -142,7 +154,8 @@ bool sbp_msg_stm_flash_lock_sector_decode_internal(sbp_decode_ctx_t *ctx, sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_stm_flash_unlock_sector_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_stm_flash_unlock_sector_t *msg); +bool sbp_msg_stm_flash_unlock_sector_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_stm_flash_unlock_sector_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -151,7 +164,8 @@ bool sbp_msg_stm_flash_unlock_sector_encode_internal(sbp_encode_ctx_t *ctx, cons * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_stm_flash_unlock_sector_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_stm_flash_unlock_sector_t *msg); +bool sbp_msg_stm_flash_unlock_sector_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_stm_flash_unlock_sector_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -160,7 +174,8 @@ bool sbp_msg_stm_flash_unlock_sector_decode_internal(sbp_decode_ctx_t *ctx, sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_stm_unique_id_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_stm_unique_id_req_t *msg); +bool sbp_msg_stm_unique_id_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_stm_unique_id_req_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -169,7 +184,8 @@ bool sbp_msg_stm_unique_id_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_stm_unique_id_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_stm_unique_id_req_t *msg); +bool sbp_msg_stm_unique_id_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_stm_unique_id_req_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -178,7 +194,8 @@ bool sbp_msg_stm_unique_id_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_st * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_stm_unique_id_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_stm_unique_id_resp_t *msg); +bool sbp_msg_stm_unique_id_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_stm_unique_id_resp_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -187,7 +204,8 @@ bool sbp_msg_stm_unique_id_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_stm_unique_id_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_stm_unique_id_resp_t *msg); +bool sbp_msg_stm_unique_id_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_stm_unique_id_resp_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -196,7 +214,8 @@ bool sbp_msg_stm_unique_id_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_m25_flash_write_status_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_m25_flash_write_status_t *msg); +bool sbp_msg_m25_flash_write_status_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_m25_flash_write_status_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -205,10 +224,11 @@ bool sbp_msg_m25_flash_write_status_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_m25_flash_write_status_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_m25_flash_write_status_t *msg); +bool sbp_msg_m25_flash_write_status_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_m25_flash_write_status_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_FLASH_H */ diff --git a/c/src/include/libsbp/internal/gnss.h b/c/src/include/libsbp/internal/gnss.h index f0b9b5327..dc5669640 100644 --- a/c/src/include/libsbp/internal/gnss.h +++ b/c/src/include/libsbp/internal/gnss.h @@ -24,7 +24,7 @@ #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_v4_gnss_signal_encode_internal(sbp_encode_ctx_t *ctx, const sbp_v4_gnss_signal_t *msg); +bool sbp_v4_gnss_signal_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_v4_gnss_signal_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -43,7 +44,8 @@ bool sbp_v4_gnss_signal_encode_internal(sbp_encode_ctx_t *ctx, const sbp_v4_gnss * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_v4_gnss_signal_decode_internal(sbp_decode_ctx_t *ctx, sbp_v4_gnss_signal_t *msg); +bool sbp_v4_gnss_signal_decode_internal(sbp_decode_ctx_t *ctx, + sbp_v4_gnss_signal_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -70,7 +72,8 @@ bool sbp_sv_id_decode_internal(sbp_decode_ctx_t *ctx, sbp_sv_id_t *msg); * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_gnss_signal_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gnss_signal_dep_t *msg); +bool sbp_gnss_signal_dep_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_gnss_signal_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -79,7 +82,8 @@ bool sbp_gnss_signal_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gnss_s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_gnss_signal_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_gnss_signal_dep_t *msg); +bool sbp_gnss_signal_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_gnss_signal_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -88,7 +92,8 @@ bool sbp_gnss_signal_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_gnss_signal_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_gps_time_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gps_time_dep_t *msg); +bool sbp_gps_time_dep_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_gps_time_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -97,7 +102,8 @@ bool sbp_gps_time_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gps_time_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_gps_time_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_gps_time_dep_t *msg); +bool sbp_gps_time_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_gps_time_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -106,7 +112,8 @@ bool sbp_gps_time_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_gps_time_dep_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_gps_time_sec_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gps_time_sec_t *msg); +bool sbp_gps_time_sec_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_gps_time_sec_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -115,7 +122,8 @@ bool sbp_gps_time_sec_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gps_time_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_gps_time_sec_decode_internal(sbp_decode_ctx_t *ctx, sbp_gps_time_sec_t *msg); +bool sbp_gps_time_sec_decode_internal(sbp_decode_ctx_t *ctx, + sbp_gps_time_sec_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -124,7 +132,8 @@ bool sbp_gps_time_sec_decode_internal(sbp_decode_ctx_t *ctx, sbp_gps_time_sec_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_v4_gps_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_v4_gps_time_t *msg); +bool sbp_v4_gps_time_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_v4_gps_time_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -133,7 +142,8 @@ bool sbp_v4_gps_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_v4_gps_tim * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_v4_gps_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_v4_gps_time_t *msg); +bool sbp_v4_gps_time_decode_internal(sbp_decode_ctx_t *ctx, + sbp_v4_gps_time_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -142,7 +152,8 @@ bool sbp_v4_gps_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_v4_gps_time_t *m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_carrier_phase_encode_internal(sbp_encode_ctx_t *ctx, const sbp_carrier_phase_t *msg); +bool sbp_carrier_phase_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_carrier_phase_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -151,10 +162,11 @@ bool sbp_carrier_phase_encode_internal(sbp_encode_ctx_t *ctx, const sbp_carrier_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_carrier_phase_decode_internal(sbp_decode_ctx_t *ctx, sbp_carrier_phase_t *msg); +bool sbp_carrier_phase_decode_internal(sbp_decode_ctx_t *ctx, + sbp_carrier_phase_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_GNSS_H */ diff --git a/c/src/include/libsbp/internal/imu.h b/c/src/include/libsbp/internal/imu.h index 7152fa29d..eed5c364b 100644 --- a/c/src/include/libsbp/internal/imu.h +++ b/c/src/include/libsbp/internal/imu.h @@ -24,7 +24,7 @@ #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_imu_raw_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_imu_raw_t *msg); +bool sbp_msg_imu_raw_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_imu_raw_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -43,7 +44,8 @@ bool sbp_msg_imu_raw_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_imu_ra * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_imu_raw_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_imu_raw_t *msg); +bool sbp_msg_imu_raw_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_imu_raw_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -52,7 +54,8 @@ bool sbp_msg_imu_raw_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_imu_raw_t *m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_imu_aux_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_imu_aux_t *msg); +bool sbp_msg_imu_aux_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_imu_aux_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -61,10 +64,11 @@ bool sbp_msg_imu_aux_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_imu_au * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_imu_aux_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_imu_aux_t *msg); +bool sbp_msg_imu_aux_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_imu_aux_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_IMU_H */ diff --git a/c/src/include/libsbp/internal/integrity.h b/c/src/include/libsbp/internal/integrity.h index e9e79da37..6d751d140 100644 --- a/c/src/include/libsbp/internal/integrity.h +++ b/c/src/include/libsbp/internal/integrity.h @@ -25,7 +25,7 @@ #include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -35,7 +35,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_integrity_ssr_header_encode_internal(sbp_encode_ctx_t *ctx, const sbp_integrity_ssr_header_t *msg); +bool sbp_integrity_ssr_header_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_integrity_ssr_header_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -44,7 +45,8 @@ bool sbp_integrity_ssr_header_encode_internal(sbp_encode_ctx_t *ctx, const sbp_i * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_integrity_ssr_header_decode_internal(sbp_decode_ctx_t *ctx, sbp_integrity_ssr_header_t *msg); +bool sbp_integrity_ssr_header_decode_internal(sbp_decode_ctx_t *ctx, + sbp_integrity_ssr_header_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -53,7 +55,8 @@ bool sbp_integrity_ssr_header_decode_internal(sbp_decode_ctx_t *ctx, sbp_integri * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_flag_high_level_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_high_level_t *msg); +bool sbp_msg_ssr_flag_high_level_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_high_level_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -62,7 +65,8 @@ bool sbp_msg_ssr_flag_high_level_encode_internal(sbp_encode_ctx_t *ctx, const sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_flag_high_level_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_high_level_t *msg); +bool sbp_msg_ssr_flag_high_level_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_high_level_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -71,7 +75,8 @@ bool sbp_msg_ssr_flag_high_level_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_flag_satellites_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_satellites_t *msg); +bool sbp_msg_ssr_flag_satellites_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_satellites_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -80,7 +85,8 @@ bool sbp_msg_ssr_flag_satellites_encode_internal(sbp_encode_ctx_t *ctx, const sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_flag_satellites_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_satellites_t *msg); +bool sbp_msg_ssr_flag_satellites_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_satellites_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -89,7 +95,8 @@ bool sbp_msg_ssr_flag_satellites_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_flag_tropo_grid_points_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_tropo_grid_points_t *msg); +bool sbp_msg_ssr_flag_tropo_grid_points_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_tropo_grid_points_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -98,7 +105,8 @@ bool sbp_msg_ssr_flag_tropo_grid_points_encode_internal(sbp_encode_ctx_t *ctx, c * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_flag_tropo_grid_points_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_tropo_grid_points_t *msg); +bool sbp_msg_ssr_flag_tropo_grid_points_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_tropo_grid_points_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -107,7 +115,8 @@ bool sbp_msg_ssr_flag_tropo_grid_points_decode_internal(sbp_decode_ctx_t *ctx, s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_flag_iono_grid_points_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_iono_grid_points_t *msg); +bool sbp_msg_ssr_flag_iono_grid_points_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_iono_grid_points_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -116,7 +125,8 @@ bool sbp_msg_ssr_flag_iono_grid_points_encode_internal(sbp_encode_ctx_t *ctx, co * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_flag_iono_grid_points_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_iono_grid_points_t *msg); +bool sbp_msg_ssr_flag_iono_grid_points_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_iono_grid_points_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -125,7 +135,8 @@ bool sbp_msg_ssr_flag_iono_grid_points_decode_internal(sbp_decode_ctx_t *ctx, sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_flag_iono_tile_sat_los_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_iono_tile_sat_los_t *msg); +bool sbp_msg_ssr_flag_iono_tile_sat_los_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_iono_tile_sat_los_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -134,7 +145,8 @@ bool sbp_msg_ssr_flag_iono_tile_sat_los_encode_internal(sbp_encode_ctx_t *ctx, c * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_flag_iono_tile_sat_los_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_iono_tile_sat_los_t *msg); +bool sbp_msg_ssr_flag_iono_tile_sat_los_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_iono_tile_sat_los_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -143,7 +155,9 @@ bool sbp_msg_ssr_flag_iono_tile_sat_los_decode_internal(sbp_decode_ctx_t *ctx, s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_flag_iono_grid_point_sat_los_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg); +bool sbp_msg_ssr_flag_iono_grid_point_sat_los_encode_internal( + sbp_encode_ctx_t *ctx, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -152,7 +166,8 @@ bool sbp_msg_ssr_flag_iono_grid_point_sat_los_encode_internal(sbp_encode_ctx_t * * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_flag_iono_grid_point_sat_los_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg); +bool sbp_msg_ssr_flag_iono_grid_point_sat_los_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -161,7 +176,8 @@ bool sbp_msg_ssr_flag_iono_grid_point_sat_los_decode_internal(sbp_decode_ctx_t * * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_acknowledge_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_acknowledge_t *msg); +bool sbp_msg_acknowledge_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_acknowledge_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -170,10 +186,11 @@ bool sbp_msg_acknowledge_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ac * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_acknowledge_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acknowledge_t *msg); +bool sbp_msg_acknowledge_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_acknowledge_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_INTEGRITY_H */ diff --git a/c/src/include/libsbp/internal/linux.h b/c/src/include/libsbp/internal/linux.h index 3ed1da926..95306aaa6 100644 --- a/c/src/include/libsbp/internal/linux.h +++ b/c/src/include/libsbp/internal/linux.h @@ -20,11 +20,11 @@ #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_cpu_state_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_cpu_state_dep_a_t *msg); +bool sbp_msg_linux_cpu_state_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_cpu_state_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -43,7 +44,8 @@ bool sbp_msg_linux_cpu_state_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_cpu_state_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_cpu_state_dep_a_t *msg); +bool sbp_msg_linux_cpu_state_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_cpu_state_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -52,7 +54,8 @@ bool sbp_msg_linux_cpu_state_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_mem_state_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_mem_state_dep_a_t *msg); +bool sbp_msg_linux_mem_state_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_mem_state_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -61,7 +64,8 @@ bool sbp_msg_linux_mem_state_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_mem_state_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_mem_state_dep_a_t *msg); +bool sbp_msg_linux_mem_state_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_mem_state_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -70,7 +74,8 @@ bool sbp_msg_linux_mem_state_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_sys_state_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_sys_state_dep_a_t *msg); +bool sbp_msg_linux_sys_state_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_sys_state_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -79,7 +84,8 @@ bool sbp_msg_linux_sys_state_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_sys_state_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_sys_state_dep_a_t *msg); +bool sbp_msg_linux_sys_state_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_sys_state_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -88,7 +94,8 @@ bool sbp_msg_linux_sys_state_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_process_socket_counts_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_socket_counts_t *msg); +bool sbp_msg_linux_process_socket_counts_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_socket_counts_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -97,7 +104,8 @@ bool sbp_msg_linux_process_socket_counts_encode_internal(sbp_encode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_process_socket_counts_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_process_socket_counts_t *msg); +bool sbp_msg_linux_process_socket_counts_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_process_socket_counts_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -106,7 +114,8 @@ bool sbp_msg_linux_process_socket_counts_decode_internal(sbp_decode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_process_socket_queues_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_socket_queues_t *msg); +bool sbp_msg_linux_process_socket_queues_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_socket_queues_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -115,7 +124,8 @@ bool sbp_msg_linux_process_socket_queues_encode_internal(sbp_encode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_process_socket_queues_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_process_socket_queues_t *msg); +bool sbp_msg_linux_process_socket_queues_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_process_socket_queues_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -124,7 +134,8 @@ bool sbp_msg_linux_process_socket_queues_decode_internal(sbp_decode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_socket_usage_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_socket_usage_t *msg); +bool sbp_msg_linux_socket_usage_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_socket_usage_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -133,7 +144,8 @@ bool sbp_msg_linux_socket_usage_encode_internal(sbp_encode_ctx_t *ctx, const sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_socket_usage_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_socket_usage_t *msg); +bool sbp_msg_linux_socket_usage_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_socket_usage_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -142,7 +154,8 @@ bool sbp_msg_linux_socket_usage_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_l * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_process_fd_count_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_fd_count_t *msg); +bool sbp_msg_linux_process_fd_count_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_fd_count_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -151,7 +164,8 @@ bool sbp_msg_linux_process_fd_count_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_process_fd_count_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_process_fd_count_t *msg); +bool sbp_msg_linux_process_fd_count_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_process_fd_count_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -160,7 +174,8 @@ bool sbp_msg_linux_process_fd_count_decode_internal(sbp_decode_ctx_t *ctx, sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_process_fd_summary_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_fd_summary_t *msg); +bool sbp_msg_linux_process_fd_summary_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_fd_summary_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -169,7 +184,8 @@ bool sbp_msg_linux_process_fd_summary_encode_internal(sbp_encode_ctx_t *ctx, con * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_process_fd_summary_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_process_fd_summary_t *msg); +bool sbp_msg_linux_process_fd_summary_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_process_fd_summary_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -178,7 +194,8 @@ bool sbp_msg_linux_process_fd_summary_decode_internal(sbp_decode_ctx_t *ctx, sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_cpu_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_cpu_state_t *msg); +bool sbp_msg_linux_cpu_state_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_cpu_state_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -187,7 +204,8 @@ bool sbp_msg_linux_cpu_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_cpu_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_cpu_state_t *msg); +bool sbp_msg_linux_cpu_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_linux_cpu_state_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -196,7 +214,8 @@ bool sbp_msg_linux_cpu_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linu * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_mem_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_mem_state_t *msg); +bool sbp_msg_linux_mem_state_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_mem_state_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -205,7 +224,8 @@ bool sbp_msg_linux_mem_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_mem_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_mem_state_t *msg); +bool sbp_msg_linux_mem_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_linux_mem_state_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -214,7 +234,8 @@ bool sbp_msg_linux_mem_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linu * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_sys_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_sys_state_t *msg); +bool sbp_msg_linux_sys_state_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_sys_state_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -223,10 +244,11 @@ bool sbp_msg_linux_sys_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_linux_sys_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_sys_state_t *msg); +bool sbp_msg_linux_sys_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_linux_sys_state_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_LINUX_H */ diff --git a/c/src/include/libsbp/internal/logging.h b/c/src/include/libsbp/internal/logging.h index d31b3041d..ad719ab51 100644 --- a/c/src/include/libsbp/internal/logging.h +++ b/c/src/include/libsbp/internal/logging.h @@ -20,11 +20,11 @@ #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_log_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_log_t *msg); +bool sbp_msg_log_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_log_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -52,7 +53,8 @@ bool sbp_msg_log_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_log_t *msg); * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_fwd_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fwd_t *msg); +bool sbp_msg_fwd_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_fwd_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -70,7 +72,8 @@ bool sbp_msg_fwd_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fwd_t *msg); * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_print_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_print_dep_t *msg); +bool sbp_msg_print_dep_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_print_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -79,10 +82,11 @@ bool sbp_msg_print_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_prin * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_print_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_print_dep_t *msg); +bool sbp_msg_print_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_print_dep_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_LOGGING_H */ diff --git a/c/src/include/libsbp/internal/mag.h b/c/src/include/libsbp/internal/mag.h index 366e4ebf6..c044e987a 100644 --- a/c/src/include/libsbp/internal/mag.h +++ b/c/src/include/libsbp/internal/mag.h @@ -20,11 +20,11 @@ #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_mag_raw_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_mag_raw_t *msg); +bool sbp_msg_mag_raw_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_mag_raw_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -43,10 +44,11 @@ bool sbp_msg_mag_raw_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_mag_ra * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_mag_raw_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_mag_raw_t *msg); +bool sbp_msg_mag_raw_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_mag_raw_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_MAG_H */ diff --git a/c/src/include/libsbp/internal/navigation.h b/c/src/include/libsbp/internal/navigation.h index 8f2699a90..db7e4d5c0 100644 --- a/c/src/include/libsbp/internal/navigation.h +++ b/c/src/include/libsbp/internal/navigation.h @@ -20,11 +20,11 @@ #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_gps_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_gps_time_t *msg); +bool sbp_msg_gps_time_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_gps_time_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -43,7 +44,8 @@ bool sbp_msg_gps_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_gps_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_gps_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gps_time_t *msg); +bool sbp_msg_gps_time_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_gps_time_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -52,7 +54,8 @@ bool sbp_msg_gps_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gps_time_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_gps_time_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_gps_time_gnss_t *msg); +bool sbp_msg_gps_time_gnss_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_gps_time_gnss_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -61,7 +64,8 @@ bool sbp_msg_gps_time_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_gps_time_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gps_time_gnss_t *msg); +bool sbp_msg_gps_time_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_gps_time_gnss_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -70,7 +74,8 @@ bool sbp_msg_gps_time_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gps_ti * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_utc_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_utc_time_t *msg); +bool sbp_msg_utc_time_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_utc_time_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -79,7 +84,8 @@ bool sbp_msg_utc_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_utc_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_utc_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_utc_time_t *msg); +bool sbp_msg_utc_time_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_utc_time_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -88,7 +94,8 @@ bool sbp_msg_utc_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_utc_time_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_utc_time_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_utc_time_gnss_t *msg); +bool sbp_msg_utc_time_gnss_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_utc_time_gnss_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -97,7 +104,8 @@ bool sbp_msg_utc_time_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_utc_time_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_utc_time_gnss_t *msg); +bool sbp_msg_utc_time_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_utc_time_gnss_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -106,7 +114,8 @@ bool sbp_msg_utc_time_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_utc_ti * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_dops_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_dops_t *msg); +bool sbp_msg_dops_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_dops_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -124,7 +133,8 @@ bool sbp_msg_dops_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_dops_t *msg); * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_ecef_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_ecef_t *msg); +bool sbp_msg_pos_ecef_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_ecef_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -133,7 +143,8 @@ bool sbp_msg_pos_ecef_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_e * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_ecef_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_ecef_t *msg); +bool sbp_msg_pos_ecef_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_ecef_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -142,7 +153,8 @@ bool sbp_msg_pos_ecef_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_ecef_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_ecef_cov_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_ecef_cov_t *msg); +bool sbp_msg_pos_ecef_cov_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_ecef_cov_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -151,7 +163,8 @@ bool sbp_msg_pos_ecef_cov_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_p * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_ecef_cov_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_ecef_cov_t *msg); +bool sbp_msg_pos_ecef_cov_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_ecef_cov_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -160,7 +173,8 @@ bool sbp_msg_pos_ecef_cov_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_ece * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_llh_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_llh_t *msg); +bool sbp_msg_pos_llh_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_llh_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -169,7 +183,8 @@ bool sbp_msg_pos_llh_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_ll * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_llh_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh_t *msg); +bool sbp_msg_pos_llh_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_llh_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -178,7 +193,8 @@ bool sbp_msg_pos_llh_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh_t *m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_llh_cov_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_llh_cov_t *msg); +bool sbp_msg_pos_llh_cov_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_llh_cov_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -187,7 +203,8 @@ bool sbp_msg_pos_llh_cov_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_po * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_llh_cov_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh_cov_t *msg); +bool sbp_msg_pos_llh_cov_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_llh_cov_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -196,7 +213,8 @@ bool sbp_msg_pos_llh_cov_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_estimated_horizontal_error_ellipse_encode_internal(sbp_encode_ctx_t *ctx, const sbp_estimated_horizontal_error_ellipse_t *msg); +bool sbp_estimated_horizontal_error_ellipse_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_estimated_horizontal_error_ellipse_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -205,7 +223,8 @@ bool sbp_estimated_horizontal_error_ellipse_encode_internal(sbp_encode_ctx_t *ct * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_estimated_horizontal_error_ellipse_decode_internal(sbp_decode_ctx_t *ctx, sbp_estimated_horizontal_error_ellipse_t *msg); +bool sbp_estimated_horizontal_error_ellipse_decode_internal( + sbp_decode_ctx_t *ctx, sbp_estimated_horizontal_error_ellipse_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -214,7 +233,8 @@ bool sbp_estimated_horizontal_error_ellipse_decode_internal(sbp_decode_ctx_t *ct * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_llh_acc_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_llh_acc_t *msg); +bool sbp_msg_pos_llh_acc_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_llh_acc_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -223,7 +243,8 @@ bool sbp_msg_pos_llh_acc_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_po * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_llh_acc_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh_acc_t *msg); +bool sbp_msg_pos_llh_acc_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_llh_acc_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -232,7 +253,8 @@ bool sbp_msg_pos_llh_acc_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_baseline_ecef_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_baseline_ecef_t *msg); +bool sbp_msg_baseline_ecef_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_baseline_ecef_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -241,7 +263,8 @@ bool sbp_msg_baseline_ecef_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_baseline_ecef_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_baseline_ecef_t *msg); +bool sbp_msg_baseline_ecef_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_baseline_ecef_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -250,7 +273,8 @@ bool sbp_msg_baseline_ecef_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_baseli * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_baseline_ned_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_baseline_ned_t *msg); +bool sbp_msg_baseline_ned_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_baseline_ned_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -259,7 +283,8 @@ bool sbp_msg_baseline_ned_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_b * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_baseline_ned_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_baseline_ned_t *msg); +bool sbp_msg_baseline_ned_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_baseline_ned_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -268,7 +293,8 @@ bool sbp_msg_baseline_ned_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_baselin * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ecef_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ecef_t *msg); +bool sbp_msg_vel_ecef_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_ecef_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -277,7 +303,8 @@ bool sbp_msg_vel_ecef_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_e * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ecef_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ecef_t *msg); +bool sbp_msg_vel_ecef_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ecef_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -286,7 +313,8 @@ bool sbp_msg_vel_ecef_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ecef_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ecef_cov_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ecef_cov_t *msg); +bool sbp_msg_vel_ecef_cov_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_ecef_cov_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -295,7 +323,8 @@ bool sbp_msg_vel_ecef_cov_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_v * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ecef_cov_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ecef_cov_t *msg); +bool sbp_msg_vel_ecef_cov_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ecef_cov_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -304,7 +333,8 @@ bool sbp_msg_vel_ecef_cov_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ece * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ned_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ned_t *msg); +bool sbp_msg_vel_ned_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_ned_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -313,7 +343,8 @@ bool sbp_msg_vel_ned_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ne * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ned_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ned_t *msg); +bool sbp_msg_vel_ned_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ned_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -322,7 +353,8 @@ bool sbp_msg_vel_ned_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ned_t *m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ned_cov_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ned_cov_t *msg); +bool sbp_msg_vel_ned_cov_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_ned_cov_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -331,7 +363,8 @@ bool sbp_msg_vel_ned_cov_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ve * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ned_cov_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ned_cov_t *msg); +bool sbp_msg_vel_ned_cov_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ned_cov_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -340,7 +373,8 @@ bool sbp_msg_vel_ned_cov_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ned_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_ecef_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_ecef_gnss_t *msg); +bool sbp_msg_pos_ecef_gnss_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_ecef_gnss_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -349,7 +383,8 @@ bool sbp_msg_pos_ecef_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_ecef_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_ecef_gnss_t *msg); +bool sbp_msg_pos_ecef_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_ecef_gnss_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -358,7 +393,8 @@ bool sbp_msg_pos_ecef_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_ec * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_ecef_cov_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_ecef_cov_gnss_t *msg); +bool sbp_msg_pos_ecef_cov_gnss_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_pos_ecef_cov_gnss_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -367,7 +403,8 @@ bool sbp_msg_pos_ecef_cov_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_ecef_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_ecef_cov_gnss_t *msg); +bool sbp_msg_pos_ecef_cov_gnss_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_pos_ecef_cov_gnss_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -376,7 +413,8 @@ bool sbp_msg_pos_ecef_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_po * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_llh_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_llh_gnss_t *msg); +bool sbp_msg_pos_llh_gnss_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_llh_gnss_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -385,7 +423,8 @@ bool sbp_msg_pos_llh_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_p * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_llh_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh_gnss_t *msg); +bool sbp_msg_pos_llh_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_llh_gnss_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -394,7 +433,8 @@ bool sbp_msg_pos_llh_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_llh_cov_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_llh_cov_gnss_t *msg); +bool sbp_msg_pos_llh_cov_gnss_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_pos_llh_cov_gnss_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -403,7 +443,8 @@ bool sbp_msg_pos_llh_cov_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_llh_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh_cov_gnss_t *msg); +bool sbp_msg_pos_llh_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_llh_cov_gnss_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -412,7 +453,8 @@ bool sbp_msg_pos_llh_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ecef_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ecef_gnss_t *msg); +bool sbp_msg_vel_ecef_gnss_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_ecef_gnss_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -421,7 +463,8 @@ bool sbp_msg_vel_ecef_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ecef_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ecef_gnss_t *msg); +bool sbp_msg_vel_ecef_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ecef_gnss_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -430,7 +473,8 @@ bool sbp_msg_vel_ecef_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ec * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ecef_cov_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ecef_cov_gnss_t *msg); +bool sbp_msg_vel_ecef_cov_gnss_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_vel_ecef_cov_gnss_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -439,7 +483,8 @@ bool sbp_msg_vel_ecef_cov_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ecef_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ecef_cov_gnss_t *msg); +bool sbp_msg_vel_ecef_cov_gnss_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_vel_ecef_cov_gnss_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -448,7 +493,8 @@ bool sbp_msg_vel_ecef_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ve * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ned_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ned_gnss_t *msg); +bool sbp_msg_vel_ned_gnss_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_ned_gnss_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -457,7 +503,8 @@ bool sbp_msg_vel_ned_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_v * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ned_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ned_gnss_t *msg); +bool sbp_msg_vel_ned_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ned_gnss_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -466,7 +513,8 @@ bool sbp_msg_vel_ned_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ned * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ned_cov_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ned_cov_gnss_t *msg); +bool sbp_msg_vel_ned_cov_gnss_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_vel_ned_cov_gnss_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -475,7 +523,8 @@ bool sbp_msg_vel_ned_cov_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ned_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ned_cov_gnss_t *msg); +bool sbp_msg_vel_ned_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ned_cov_gnss_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -484,7 +533,8 @@ bool sbp_msg_vel_ned_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_body_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_body_t *msg); +bool sbp_msg_vel_body_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_body_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -493,7 +543,8 @@ bool sbp_msg_vel_body_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_b * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_body_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_body_t *msg); +bool sbp_msg_vel_body_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_body_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -502,7 +553,8 @@ bool sbp_msg_vel_body_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_body_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_cog_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_cog_t *msg); +bool sbp_msg_vel_cog_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_cog_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -511,7 +563,8 @@ bool sbp_msg_vel_cog_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_co * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_cog_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_cog_t *msg); +bool sbp_msg_vel_cog_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_cog_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -520,7 +573,8 @@ bool sbp_msg_vel_cog_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_cog_t *m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_age_corrections_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_age_corrections_t *msg); +bool sbp_msg_age_corrections_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_age_corrections_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -529,7 +583,8 @@ bool sbp_msg_age_corrections_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_age_corrections_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_age_corrections_t *msg); +bool sbp_msg_age_corrections_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_age_corrections_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -538,7 +593,8 @@ bool sbp_msg_age_corrections_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_age_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_gps_time_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_gps_time_dep_a_t *msg); +bool sbp_msg_gps_time_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_gps_time_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -547,7 +603,8 @@ bool sbp_msg_gps_time_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_gps_time_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gps_time_dep_a_t *msg); +bool sbp_msg_gps_time_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_gps_time_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -556,7 +613,8 @@ bool sbp_msg_gps_time_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gps_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_dops_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_dops_dep_a_t *msg); +bool sbp_msg_dops_dep_a_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_dops_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -565,7 +623,8 @@ bool sbp_msg_dops_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_dop * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_dops_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_dops_dep_a_t *msg); +bool sbp_msg_dops_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_dops_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -574,7 +633,8 @@ bool sbp_msg_dops_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_dops_dep_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_ecef_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_ecef_dep_a_t *msg); +bool sbp_msg_pos_ecef_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_pos_ecef_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -583,7 +643,8 @@ bool sbp_msg_pos_ecef_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_ecef_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_ecef_dep_a_t *msg); +bool sbp_msg_pos_ecef_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_ecef_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -592,7 +653,8 @@ bool sbp_msg_pos_ecef_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_e * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_llh_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_llh_dep_a_t *msg); +bool sbp_msg_pos_llh_dep_a_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_llh_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -601,7 +663,8 @@ bool sbp_msg_pos_llh_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pos_llh_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh_dep_a_t *msg); +bool sbp_msg_pos_llh_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_llh_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -610,7 +673,8 @@ bool sbp_msg_pos_llh_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_ll * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_baseline_ecef_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_baseline_ecef_dep_a_t *msg); +bool sbp_msg_baseline_ecef_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_baseline_ecef_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -619,7 +683,8 @@ bool sbp_msg_baseline_ecef_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_baseline_ecef_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_baseline_ecef_dep_a_t *msg); +bool sbp_msg_baseline_ecef_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_baseline_ecef_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -628,7 +693,8 @@ bool sbp_msg_baseline_ecef_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_baseline_ned_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_baseline_ned_dep_a_t *msg); +bool sbp_msg_baseline_ned_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_baseline_ned_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -637,7 +703,8 @@ bool sbp_msg_baseline_ned_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_baseline_ned_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_baseline_ned_dep_a_t *msg); +bool sbp_msg_baseline_ned_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_baseline_ned_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -646,7 +713,8 @@ bool sbp_msg_baseline_ned_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_b * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ecef_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ecef_dep_a_t *msg); +bool sbp_msg_vel_ecef_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_vel_ecef_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -655,7 +723,8 @@ bool sbp_msg_vel_ecef_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ecef_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ecef_dep_a_t *msg); +bool sbp_msg_vel_ecef_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ecef_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -664,7 +733,8 @@ bool sbp_msg_vel_ecef_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_e * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ned_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ned_dep_a_t *msg); +bool sbp_msg_vel_ned_dep_a_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_ned_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -673,7 +743,8 @@ bool sbp_msg_vel_ned_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_vel_ned_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ned_dep_a_t *msg); +bool sbp_msg_vel_ned_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ned_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -682,7 +753,8 @@ bool sbp_msg_vel_ned_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ne * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_baseline_heading_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_baseline_heading_dep_a_t *msg); +bool sbp_msg_baseline_heading_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_baseline_heading_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -691,7 +763,8 @@ bool sbp_msg_baseline_heading_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_baseline_heading_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_baseline_heading_dep_a_t *msg); +bool sbp_msg_baseline_heading_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_baseline_heading_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -700,7 +773,8 @@ bool sbp_msg_baseline_heading_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_protection_level_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_protection_level_dep_a_t *msg); +bool sbp_msg_protection_level_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_protection_level_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -709,7 +783,8 @@ bool sbp_msg_protection_level_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_protection_level_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_protection_level_dep_a_t *msg); +bool sbp_msg_protection_level_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_protection_level_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -718,7 +793,8 @@ bool sbp_msg_protection_level_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_protection_level_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_protection_level_t *msg); +bool sbp_msg_protection_level_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_protection_level_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -727,7 +803,8 @@ bool sbp_msg_protection_level_encode_internal(sbp_encode_ctx_t *ctx, const sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_protection_level_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_protection_level_t *msg); +bool sbp_msg_protection_level_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_protection_level_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -736,7 +813,8 @@ bool sbp_msg_protection_level_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pro * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_utc_leap_second_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_utc_leap_second_t *msg); +bool sbp_msg_utc_leap_second_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_utc_leap_second_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -745,7 +823,8 @@ bool sbp_msg_utc_leap_second_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_utc_leap_second_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_utc_leap_second_t *msg); +bool sbp_msg_utc_leap_second_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_utc_leap_second_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -754,7 +833,8 @@ bool sbp_msg_utc_leap_second_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_utc_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_reference_frame_param_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_reference_frame_param_t *msg); +bool sbp_msg_reference_frame_param_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_reference_frame_param_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -763,7 +843,8 @@ bool sbp_msg_reference_frame_param_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_reference_frame_param_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_reference_frame_param_t *msg); +bool sbp_msg_reference_frame_param_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_reference_frame_param_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -772,7 +853,8 @@ bool sbp_msg_reference_frame_param_decode_internal(sbp_decode_ctx_t *ctx, sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pose_relative_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pose_relative_t *msg); +bool sbp_msg_pose_relative_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pose_relative_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -781,10 +863,11 @@ bool sbp_msg_pose_relative_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pose_relative_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pose_relative_t *msg); +bool sbp_msg_pose_relative_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pose_relative_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_NAVIGATION_H */ diff --git a/c/src/include/libsbp/internal/ndb.h b/c/src/include/libsbp/internal/ndb.h index 96ef6ffd7..03d0cb7c1 100644 --- a/c/src/include/libsbp/internal/ndb.h +++ b/c/src/include/libsbp/internal/ndb.h @@ -20,12 +20,12 @@ #include -#include #include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -35,7 +35,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ndb_event_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ndb_event_t *msg); +bool sbp_msg_ndb_event_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ndb_event_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -44,10 +45,11 @@ bool sbp_msg_ndb_event_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ndb_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ndb_event_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ndb_event_t *msg); +bool sbp_msg_ndb_event_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ndb_event_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_NDB_H */ diff --git a/c/src/include/libsbp/internal/observation.h b/c/src/include/libsbp/internal/observation.h index 0483f312d..19800e5d5 100644 --- a/c/src/include/libsbp/internal/observation.h +++ b/c/src/include/libsbp/internal/observation.h @@ -20,12 +20,12 @@ #include -#include #include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -35,7 +35,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_observation_header_encode_internal(sbp_encode_ctx_t *ctx, const sbp_observation_header_t *msg); +bool sbp_observation_header_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_observation_header_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -44,7 +45,8 @@ bool sbp_observation_header_encode_internal(sbp_encode_ctx_t *ctx, const sbp_obs * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_observation_header_decode_internal(sbp_decode_ctx_t *ctx, sbp_observation_header_t *msg); +bool sbp_observation_header_decode_internal(sbp_decode_ctx_t *ctx, + sbp_observation_header_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -53,7 +55,8 @@ bool sbp_observation_header_decode_internal(sbp_decode_ctx_t *ctx, sbp_observati * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_doppler_encode_internal(sbp_encode_ctx_t *ctx, const sbp_doppler_t *msg); +bool sbp_doppler_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_doppler_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -71,7 +74,8 @@ bool sbp_doppler_decode_internal(sbp_decode_ctx_t *ctx, sbp_doppler_t *msg); * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_packed_obs_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_t *msg); +bool sbp_packed_obs_content_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -80,7 +84,8 @@ bool sbp_packed_obs_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_pac * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_packed_obs_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_packed_obs_content_t *msg); +bool sbp_packed_obs_content_decode_internal(sbp_decode_ctx_t *ctx, + sbp_packed_obs_content_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -89,7 +94,8 @@ bool sbp_packed_obs_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_packed_ob * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_packed_osr_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_packed_osr_content_t *msg); +bool sbp_packed_osr_content_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_packed_osr_content_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -98,7 +104,8 @@ bool sbp_packed_osr_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_pac * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_packed_osr_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_packed_osr_content_t *msg); +bool sbp_packed_osr_content_decode_internal(sbp_decode_ctx_t *ctx, + sbp_packed_osr_content_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -107,7 +114,8 @@ bool sbp_packed_osr_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_packed_os * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_obs_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_obs_t *msg); +bool sbp_msg_obs_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_obs_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -125,7 +133,8 @@ bool sbp_msg_obs_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_obs_t *msg); * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_base_pos_llh_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_base_pos_llh_t *msg); +bool sbp_msg_base_pos_llh_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_base_pos_llh_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -134,7 +143,8 @@ bool sbp_msg_base_pos_llh_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_b * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_base_pos_llh_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_base_pos_llh_t *msg); +bool sbp_msg_base_pos_llh_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_base_pos_llh_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -143,7 +153,8 @@ bool sbp_msg_base_pos_llh_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_base_po * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_base_pos_ecef_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_base_pos_ecef_t *msg); +bool sbp_msg_base_pos_ecef_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_base_pos_ecef_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -152,7 +163,8 @@ bool sbp_msg_base_pos_ecef_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_base_pos_ecef_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_base_pos_ecef_t *msg); +bool sbp_msg_base_pos_ecef_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_base_pos_ecef_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -161,7 +173,8 @@ bool sbp_msg_base_pos_ecef_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_base_p * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_ephemeris_common_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ephemeris_common_content_t *msg); +bool sbp_ephemeris_common_content_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_ephemeris_common_content_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -170,7 +183,8 @@ bool sbp_ephemeris_common_content_encode_internal(sbp_encode_ctx_t *ctx, const s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_ephemeris_common_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_ephemeris_common_content_t *msg); +bool sbp_ephemeris_common_content_decode_internal( + sbp_decode_ctx_t *ctx, sbp_ephemeris_common_content_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -179,7 +193,8 @@ bool sbp_ephemeris_common_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_eph * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_ephemeris_common_content_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ephemeris_common_content_dep_b_t *msg); +bool sbp_ephemeris_common_content_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_ephemeris_common_content_dep_b_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -188,7 +203,8 @@ bool sbp_ephemeris_common_content_dep_b_encode_internal(sbp_encode_ctx_t *ctx, c * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_ephemeris_common_content_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_ephemeris_common_content_dep_b_t *msg); +bool sbp_ephemeris_common_content_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_ephemeris_common_content_dep_b_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -197,7 +213,8 @@ bool sbp_ephemeris_common_content_dep_b_decode_internal(sbp_decode_ctx_t *ctx, s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_ephemeris_common_content_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ephemeris_common_content_dep_a_t *msg); +bool sbp_ephemeris_common_content_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_ephemeris_common_content_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -206,7 +223,8 @@ bool sbp_ephemeris_common_content_dep_a_encode_internal(sbp_encode_ctx_t *ctx, c * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_ephemeris_common_content_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_ephemeris_common_content_dep_a_t *msg); +bool sbp_ephemeris_common_content_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_ephemeris_common_content_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -215,7 +233,8 @@ bool sbp_ephemeris_common_content_dep_a_decode_internal(sbp_decode_ctx_t *ctx, s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_gps_dep_e_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gps_dep_e_t *msg); +bool sbp_msg_ephemeris_gps_dep_e_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gps_dep_e_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -224,7 +243,8 @@ bool sbp_msg_ephemeris_gps_dep_e_encode_internal(sbp_encode_ctx_t *ctx, const sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_gps_dep_e_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gps_dep_e_t *msg); +bool sbp_msg_ephemeris_gps_dep_e_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gps_dep_e_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -233,7 +253,8 @@ bool sbp_msg_ephemeris_gps_dep_e_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_gps_dep_f_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gps_dep_f_t *msg); +bool sbp_msg_ephemeris_gps_dep_f_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gps_dep_f_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -242,7 +263,8 @@ bool sbp_msg_ephemeris_gps_dep_f_encode_internal(sbp_encode_ctx_t *ctx, const sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_gps_dep_f_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gps_dep_f_t *msg); +bool sbp_msg_ephemeris_gps_dep_f_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gps_dep_f_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -251,7 +273,8 @@ bool sbp_msg_ephemeris_gps_dep_f_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_gps_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gps_t *msg); +bool sbp_msg_ephemeris_gps_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ephemeris_gps_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -260,7 +283,8 @@ bool sbp_msg_ephemeris_gps_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_gps_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gps_t *msg); +bool sbp_msg_ephemeris_gps_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_gps_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -269,7 +293,8 @@ bool sbp_msg_ephemeris_gps_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_epheme * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_qzss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_qzss_t *msg); +bool sbp_msg_ephemeris_qzss_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_qzss_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -278,7 +303,8 @@ bool sbp_msg_ephemeris_qzss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_qzss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_qzss_t *msg); +bool sbp_msg_ephemeris_qzss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_qzss_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -287,7 +313,8 @@ bool sbp_msg_ephemeris_qzss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephem * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_bds_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_bds_t *msg); +bool sbp_msg_ephemeris_bds_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ephemeris_bds_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -296,7 +323,8 @@ bool sbp_msg_ephemeris_bds_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_bds_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_bds_t *msg); +bool sbp_msg_ephemeris_bds_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_bds_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -305,7 +333,8 @@ bool sbp_msg_ephemeris_bds_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_epheme * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_gal_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gal_dep_a_t *msg); +bool sbp_msg_ephemeris_gal_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gal_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -314,7 +343,8 @@ bool sbp_msg_ephemeris_gal_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_gal_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gal_dep_a_t *msg); +bool sbp_msg_ephemeris_gal_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gal_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -323,7 +353,8 @@ bool sbp_msg_ephemeris_gal_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_gal_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gal_t *msg); +bool sbp_msg_ephemeris_gal_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ephemeris_gal_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -332,7 +363,8 @@ bool sbp_msg_ephemeris_gal_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_gal_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gal_t *msg); +bool sbp_msg_ephemeris_gal_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_gal_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -341,7 +373,8 @@ bool sbp_msg_ephemeris_gal_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_epheme * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_sbas_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_sbas_dep_a_t *msg); +bool sbp_msg_ephemeris_sbas_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_sbas_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -350,7 +383,8 @@ bool sbp_msg_ephemeris_sbas_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_sbas_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_sbas_dep_a_t *msg); +bool sbp_msg_ephemeris_sbas_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_sbas_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -359,7 +393,8 @@ bool sbp_msg_ephemeris_sbas_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_glo_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_a_t *msg); +bool sbp_msg_ephemeris_glo_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -368,7 +403,8 @@ bool sbp_msg_ephemeris_glo_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_glo_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_a_t *msg); +bool sbp_msg_ephemeris_glo_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -377,7 +413,8 @@ bool sbp_msg_ephemeris_glo_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_sbas_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_sbas_dep_b_t *msg); +bool sbp_msg_ephemeris_sbas_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_sbas_dep_b_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -386,7 +423,8 @@ bool sbp_msg_ephemeris_sbas_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_sbas_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_sbas_dep_b_t *msg); +bool sbp_msg_ephemeris_sbas_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_sbas_dep_b_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -395,7 +433,8 @@ bool sbp_msg_ephemeris_sbas_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_sbas_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_sbas_t *msg); +bool sbp_msg_ephemeris_sbas_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_sbas_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -404,7 +443,8 @@ bool sbp_msg_ephemeris_sbas_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_sbas_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_sbas_t *msg); +bool sbp_msg_ephemeris_sbas_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_sbas_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -413,7 +453,8 @@ bool sbp_msg_ephemeris_sbas_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephem * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_glo_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_b_t *msg); +bool sbp_msg_ephemeris_glo_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_b_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -422,7 +463,8 @@ bool sbp_msg_ephemeris_glo_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_glo_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_b_t *msg); +bool sbp_msg_ephemeris_glo_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_b_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -431,7 +473,8 @@ bool sbp_msg_ephemeris_glo_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_glo_dep_c_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_c_t *msg); +bool sbp_msg_ephemeris_glo_dep_c_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_c_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -440,7 +483,8 @@ bool sbp_msg_ephemeris_glo_dep_c_encode_internal(sbp_encode_ctx_t *ctx, const sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_glo_dep_c_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_c_t *msg); +bool sbp_msg_ephemeris_glo_dep_c_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_c_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -449,7 +493,8 @@ bool sbp_msg_ephemeris_glo_dep_c_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_glo_dep_d_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_d_t *msg); +bool sbp_msg_ephemeris_glo_dep_d_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_d_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -458,7 +503,8 @@ bool sbp_msg_ephemeris_glo_dep_d_encode_internal(sbp_encode_ctx_t *ctx, const sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_glo_dep_d_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_d_t *msg); +bool sbp_msg_ephemeris_glo_dep_d_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_d_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -467,7 +513,8 @@ bool sbp_msg_ephemeris_glo_dep_d_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_glo_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_t *msg); +bool sbp_msg_ephemeris_glo_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ephemeris_glo_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -476,7 +523,8 @@ bool sbp_msg_ephemeris_glo_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_glo_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_t *msg); +bool sbp_msg_ephemeris_glo_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_glo_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -485,7 +533,8 @@ bool sbp_msg_ephemeris_glo_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_epheme * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_dep_d_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_d_t *msg); +bool sbp_msg_ephemeris_dep_d_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_d_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -494,7 +543,8 @@ bool sbp_msg_ephemeris_dep_d_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_dep_d_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_dep_d_t *msg); +bool sbp_msg_ephemeris_dep_d_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_dep_d_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -503,7 +553,8 @@ bool sbp_msg_ephemeris_dep_d_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephe * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_a_t *msg); +bool sbp_msg_ephemeris_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -512,7 +563,8 @@ bool sbp_msg_ephemeris_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_dep_a_t *msg); +bool sbp_msg_ephemeris_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -521,7 +573,8 @@ bool sbp_msg_ephemeris_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephe * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_b_t *msg); +bool sbp_msg_ephemeris_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_b_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -530,7 +583,8 @@ bool sbp_msg_ephemeris_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_dep_b_t *msg); +bool sbp_msg_ephemeris_dep_b_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_dep_b_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -539,7 +593,8 @@ bool sbp_msg_ephemeris_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephe * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_dep_c_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_c_t *msg); +bool sbp_msg_ephemeris_dep_c_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_c_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -548,7 +603,8 @@ bool sbp_msg_ephemeris_dep_c_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ephemeris_dep_c_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_dep_c_t *msg); +bool sbp_msg_ephemeris_dep_c_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_dep_c_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -557,7 +613,8 @@ bool sbp_msg_ephemeris_dep_c_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephe * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_observation_header_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_observation_header_dep_t *msg); +bool sbp_observation_header_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_observation_header_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -566,7 +623,8 @@ bool sbp_observation_header_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_observation_header_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_observation_header_dep_t *msg); +bool sbp_observation_header_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_observation_header_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -575,7 +633,8 @@ bool sbp_observation_header_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_obser * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_carrier_phase_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_carrier_phase_dep_a_t *msg); +bool sbp_carrier_phase_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_carrier_phase_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -584,7 +643,8 @@ bool sbp_carrier_phase_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ca * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_carrier_phase_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_carrier_phase_dep_a_t *msg); +bool sbp_carrier_phase_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_carrier_phase_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -593,7 +653,8 @@ bool sbp_carrier_phase_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_carrier_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_packed_obs_content_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_dep_a_t *msg); +bool sbp_packed_obs_content_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -602,7 +663,8 @@ bool sbp_packed_obs_content_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_packed_obs_content_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_packed_obs_content_dep_a_t *msg); +bool sbp_packed_obs_content_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_packed_obs_content_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -611,7 +673,8 @@ bool sbp_packed_obs_content_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_pac * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_packed_obs_content_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_dep_b_t *msg); +bool sbp_packed_obs_content_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_dep_b_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -620,7 +683,8 @@ bool sbp_packed_obs_content_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_packed_obs_content_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_packed_obs_content_dep_b_t *msg); +bool sbp_packed_obs_content_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_packed_obs_content_dep_b_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -629,7 +693,8 @@ bool sbp_packed_obs_content_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_pac * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_packed_obs_content_dep_c_encode_internal(sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_dep_c_t *msg); +bool sbp_packed_obs_content_dep_c_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_dep_c_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -638,7 +703,8 @@ bool sbp_packed_obs_content_dep_c_encode_internal(sbp_encode_ctx_t *ctx, const s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_packed_obs_content_dep_c_decode_internal(sbp_decode_ctx_t *ctx, sbp_packed_obs_content_dep_c_t *msg); +bool sbp_packed_obs_content_dep_c_decode_internal( + sbp_decode_ctx_t *ctx, sbp_packed_obs_content_dep_c_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -647,7 +713,8 @@ bool sbp_packed_obs_content_dep_c_decode_internal(sbp_decode_ctx_t *ctx, sbp_pac * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_obs_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_obs_dep_a_t *msg); +bool sbp_msg_obs_dep_a_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_obs_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -656,7 +723,8 @@ bool sbp_msg_obs_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_obs_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_obs_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_obs_dep_a_t *msg); +bool sbp_msg_obs_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_obs_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -665,7 +733,8 @@ bool sbp_msg_obs_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_obs_dep_a_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_obs_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_obs_dep_b_t *msg); +bool sbp_msg_obs_dep_b_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_obs_dep_b_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -674,7 +743,8 @@ bool sbp_msg_obs_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_obs_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_obs_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_obs_dep_b_t *msg); +bool sbp_msg_obs_dep_b_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_obs_dep_b_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -683,7 +753,8 @@ bool sbp_msg_obs_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_obs_dep_b_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_obs_dep_c_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_obs_dep_c_t *msg); +bool sbp_msg_obs_dep_c_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_obs_dep_c_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -692,7 +763,8 @@ bool sbp_msg_obs_dep_c_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_obs_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_obs_dep_c_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_obs_dep_c_t *msg); +bool sbp_msg_obs_dep_c_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_obs_dep_c_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -701,7 +773,8 @@ bool sbp_msg_obs_dep_c_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_obs_dep_c_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_iono_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_iono_t *msg); +bool sbp_msg_iono_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_iono_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -719,7 +792,8 @@ bool sbp_msg_iono_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_iono_t *msg); * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_sv_configuration_gps_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_sv_configuration_gps_dep_t *msg); +bool sbp_msg_sv_configuration_gps_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_sv_configuration_gps_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -728,7 +802,8 @@ bool sbp_msg_sv_configuration_gps_dep_encode_internal(sbp_encode_ctx_t *ctx, con * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_sv_configuration_gps_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_sv_configuration_gps_dep_t *msg); +bool sbp_msg_sv_configuration_gps_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_sv_configuration_gps_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -737,7 +812,8 @@ bool sbp_msg_sv_configuration_gps_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_gnss_capb_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gnss_capb_t *msg); +bool sbp_gnss_capb_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_gnss_capb_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -755,7 +831,8 @@ bool sbp_gnss_capb_decode_internal(sbp_decode_ctx_t *ctx, sbp_gnss_capb_t *msg); * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_gnss_capb_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_gnss_capb_t *msg); +bool sbp_msg_gnss_capb_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_gnss_capb_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -764,7 +841,8 @@ bool sbp_msg_gnss_capb_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_gnss * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_gnss_capb_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gnss_capb_t *msg); +bool sbp_msg_gnss_capb_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_gnss_capb_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -773,7 +851,8 @@ bool sbp_msg_gnss_capb_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gnss_capb_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_group_delay_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_group_delay_dep_a_t *msg); +bool sbp_msg_group_delay_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_group_delay_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -782,7 +861,8 @@ bool sbp_msg_group_delay_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_group_delay_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_group_delay_dep_a_t *msg); +bool sbp_msg_group_delay_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_group_delay_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -791,7 +871,8 @@ bool sbp_msg_group_delay_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gr * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_group_delay_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_group_delay_dep_b_t *msg); +bool sbp_msg_group_delay_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_group_delay_dep_b_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -800,7 +881,8 @@ bool sbp_msg_group_delay_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_group_delay_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_group_delay_dep_b_t *msg); +bool sbp_msg_group_delay_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_group_delay_dep_b_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -809,7 +891,8 @@ bool sbp_msg_group_delay_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gr * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_group_delay_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_group_delay_t *msg); +bool sbp_msg_group_delay_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_group_delay_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -818,7 +901,8 @@ bool sbp_msg_group_delay_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_gr * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_group_delay_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_group_delay_t *msg); +bool sbp_msg_group_delay_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_group_delay_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -827,7 +911,8 @@ bool sbp_msg_group_delay_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_group_de * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_almanac_common_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_almanac_common_content_t *msg); +bool sbp_almanac_common_content_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_almanac_common_content_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -836,7 +921,8 @@ bool sbp_almanac_common_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_almanac_common_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_almanac_common_content_t *msg); +bool sbp_almanac_common_content_decode_internal( + sbp_decode_ctx_t *ctx, sbp_almanac_common_content_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -845,7 +931,8 @@ bool sbp_almanac_common_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_alman * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_almanac_common_content_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_almanac_common_content_dep_t *msg); +bool sbp_almanac_common_content_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_almanac_common_content_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -854,7 +941,8 @@ bool sbp_almanac_common_content_dep_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_almanac_common_content_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_almanac_common_content_dep_t *msg); +bool sbp_almanac_common_content_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_almanac_common_content_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -863,7 +951,8 @@ bool sbp_almanac_common_content_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_a * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_almanac_gps_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_almanac_gps_dep_t *msg); +bool sbp_msg_almanac_gps_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_almanac_gps_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -872,7 +961,8 @@ bool sbp_msg_almanac_gps_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_almanac_gps_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_almanac_gps_dep_t *msg); +bool sbp_msg_almanac_gps_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_almanac_gps_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -881,7 +971,8 @@ bool sbp_msg_almanac_gps_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_alma * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_almanac_gps_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_almanac_gps_t *msg); +bool sbp_msg_almanac_gps_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_almanac_gps_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -890,7 +981,8 @@ bool sbp_msg_almanac_gps_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_al * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_almanac_gps_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_almanac_gps_t *msg); +bool sbp_msg_almanac_gps_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_almanac_gps_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -899,7 +991,8 @@ bool sbp_msg_almanac_gps_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_almanac_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_almanac_glo_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_almanac_glo_dep_t *msg); +bool sbp_msg_almanac_glo_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_almanac_glo_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -908,7 +1001,8 @@ bool sbp_msg_almanac_glo_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_almanac_glo_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_almanac_glo_dep_t *msg); +bool sbp_msg_almanac_glo_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_almanac_glo_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -917,7 +1011,8 @@ bool sbp_msg_almanac_glo_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_alma * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_almanac_glo_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_almanac_glo_t *msg); +bool sbp_msg_almanac_glo_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_almanac_glo_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -926,7 +1021,8 @@ bool sbp_msg_almanac_glo_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_al * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_almanac_glo_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_almanac_glo_t *msg); +bool sbp_msg_almanac_glo_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_almanac_glo_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -935,7 +1031,8 @@ bool sbp_msg_almanac_glo_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_almanac_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_glo_biases_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_glo_biases_t *msg); +bool sbp_msg_glo_biases_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_glo_biases_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -944,7 +1041,8 @@ bool sbp_msg_glo_biases_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_glo * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_glo_biases_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_glo_biases_t *msg); +bool sbp_msg_glo_biases_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_glo_biases_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -953,7 +1051,8 @@ bool sbp_msg_glo_biases_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_glo_biase * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_sv_az_el_encode_internal(sbp_encode_ctx_t *ctx, const sbp_sv_az_el_t *msg); +bool sbp_sv_az_el_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_sv_az_el_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -971,7 +1070,8 @@ bool sbp_sv_az_el_decode_internal(sbp_decode_ctx_t *ctx, sbp_sv_az_el_t *msg); * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_sv_az_el_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_sv_az_el_t *msg); +bool sbp_msg_sv_az_el_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_sv_az_el_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -980,7 +1080,8 @@ bool sbp_msg_sv_az_el_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_sv_az * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_sv_az_el_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_sv_az_el_t *msg); +bool sbp_msg_sv_az_el_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_sv_az_el_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -989,7 +1090,8 @@ bool sbp_msg_sv_az_el_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_sv_az_el_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_osr_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_osr_t *msg); +bool sbp_msg_osr_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_osr_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -1001,7 +1103,7 @@ bool sbp_msg_osr_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_osr_t *msg bool sbp_msg_osr_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_osr_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_OBSERVATION_H */ diff --git a/c/src/include/libsbp/internal/orientation.h b/c/src/include/libsbp/internal/orientation.h index bf5cf0d52..25049cc44 100644 --- a/c/src/include/libsbp/internal/orientation.h +++ b/c/src/include/libsbp/internal/orientation.h @@ -20,11 +20,11 @@ #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_baseline_heading_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_baseline_heading_t *msg); +bool sbp_msg_baseline_heading_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_baseline_heading_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -43,7 +44,8 @@ bool sbp_msg_baseline_heading_encode_internal(sbp_encode_ctx_t *ctx, const sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_baseline_heading_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_baseline_heading_t *msg); +bool sbp_msg_baseline_heading_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_baseline_heading_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -52,7 +54,8 @@ bool sbp_msg_baseline_heading_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_bas * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_orient_quat_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_orient_quat_t *msg); +bool sbp_msg_orient_quat_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_orient_quat_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -61,7 +64,8 @@ bool sbp_msg_orient_quat_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_or * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_orient_quat_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_orient_quat_t *msg); +bool sbp_msg_orient_quat_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_orient_quat_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -70,7 +74,8 @@ bool sbp_msg_orient_quat_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_orient_q * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_orient_euler_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_orient_euler_t *msg); +bool sbp_msg_orient_euler_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_orient_euler_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -79,7 +84,8 @@ bool sbp_msg_orient_euler_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_o * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_orient_euler_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_orient_euler_t *msg); +bool sbp_msg_orient_euler_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_orient_euler_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -88,7 +94,8 @@ bool sbp_msg_orient_euler_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_orient_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_angular_rate_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_angular_rate_t *msg); +bool sbp_msg_angular_rate_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_angular_rate_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -97,10 +104,11 @@ bool sbp_msg_angular_rate_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_a * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_angular_rate_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_angular_rate_t *msg); +bool sbp_msg_angular_rate_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_angular_rate_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_ORIENTATION_H */ diff --git a/c/src/include/libsbp/internal/piksi.h b/c/src/include/libsbp/internal/piksi.h index 8905f1dd8..0918d4a56 100644 --- a/c/src/include/libsbp/internal/piksi.h +++ b/c/src/include/libsbp/internal/piksi.h @@ -20,12 +20,12 @@ #include -#include #include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -35,7 +35,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_almanac_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_almanac_t *msg); +bool sbp_msg_almanac_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_almanac_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -44,7 +45,8 @@ bool sbp_msg_almanac_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_almana * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_almanac_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_almanac_t *msg); +bool sbp_msg_almanac_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_almanac_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -53,7 +55,8 @@ bool sbp_msg_almanac_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_almanac_t *m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_set_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_set_time_t *msg); +bool sbp_msg_set_time_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_set_time_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -62,7 +65,8 @@ bool sbp_msg_set_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_set_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_set_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_set_time_t *msg); +bool sbp_msg_set_time_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_set_time_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -71,7 +75,8 @@ bool sbp_msg_set_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_set_time_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_reset_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_reset_t *msg); +bool sbp_msg_reset_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_reset_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -89,7 +94,8 @@ bool sbp_msg_reset_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_reset_t *msg); * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_reset_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_reset_dep_t *msg); +bool sbp_msg_reset_dep_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_reset_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -98,7 +104,8 @@ bool sbp_msg_reset_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_rese * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_reset_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_reset_dep_t *msg); +bool sbp_msg_reset_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_reset_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -107,7 +114,8 @@ bool sbp_msg_reset_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_reset_dep_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_cw_results_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_cw_results_t *msg); +bool sbp_msg_cw_results_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_cw_results_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -116,7 +124,8 @@ bool sbp_msg_cw_results_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_cw_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_cw_results_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_cw_results_t *msg); +bool sbp_msg_cw_results_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_cw_results_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -125,7 +134,8 @@ bool sbp_msg_cw_results_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_cw_result * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_cw_start_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_cw_start_t *msg); +bool sbp_msg_cw_start_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_cw_start_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -134,7 +144,8 @@ bool sbp_msg_cw_start_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_cw_st * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_cw_start_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_cw_start_t *msg); +bool sbp_msg_cw_start_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_cw_start_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -143,7 +154,8 @@ bool sbp_msg_cw_start_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_cw_start_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_reset_filters_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_reset_filters_t *msg); +bool sbp_msg_reset_filters_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_reset_filters_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -152,7 +164,8 @@ bool sbp_msg_reset_filters_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_reset_filters_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_reset_filters_t *msg); +bool sbp_msg_reset_filters_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_reset_filters_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -161,7 +174,8 @@ bool sbp_msg_reset_filters_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_reset_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_init_base_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_init_base_dep_t *msg); +bool sbp_msg_init_base_dep_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_init_base_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -170,7 +184,8 @@ bool sbp_msg_init_base_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_init_base_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_init_base_dep_t *msg); +bool sbp_msg_init_base_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_init_base_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -179,7 +194,8 @@ bool sbp_msg_init_base_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_init_b * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_thread_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_thread_state_t *msg); +bool sbp_msg_thread_state_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_thread_state_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -188,7 +204,8 @@ bool sbp_msg_thread_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_thread_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_thread_state_t *msg); +bool sbp_msg_thread_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_thread_state_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -197,7 +214,8 @@ bool sbp_msg_thread_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_thread_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_uart_channel_encode_internal(sbp_encode_ctx_t *ctx, const sbp_uart_channel_t *msg); +bool sbp_uart_channel_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_uart_channel_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -206,7 +224,8 @@ bool sbp_uart_channel_encode_internal(sbp_encode_ctx_t *ctx, const sbp_uart_chan * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_uart_channel_decode_internal(sbp_decode_ctx_t *ctx, sbp_uart_channel_t *msg); +bool sbp_uart_channel_decode_internal(sbp_decode_ctx_t *ctx, + sbp_uart_channel_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -233,7 +252,8 @@ bool sbp_period_decode_internal(sbp_decode_ctx_t *ctx, sbp_period_t *msg); * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_latency_encode_internal(sbp_encode_ctx_t *ctx, const sbp_latency_t *msg); +bool sbp_latency_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_latency_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -251,7 +271,8 @@ bool sbp_latency_decode_internal(sbp_decode_ctx_t *ctx, sbp_latency_t *msg); * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_uart_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_uart_state_t *msg); +bool sbp_msg_uart_state_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_uart_state_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -260,7 +281,8 @@ bool sbp_msg_uart_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_uar * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_uart_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_uart_state_t *msg); +bool sbp_msg_uart_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_uart_state_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -269,7 +291,8 @@ bool sbp_msg_uart_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_uart_stat * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_uart_state_depa_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_uart_state_depa_t *msg); +bool sbp_msg_uart_state_depa_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_uart_state_depa_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -278,7 +301,8 @@ bool sbp_msg_uart_state_depa_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_uart_state_depa_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_uart_state_depa_t *msg); +bool sbp_msg_uart_state_depa_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_uart_state_depa_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -287,7 +311,8 @@ bool sbp_msg_uart_state_depa_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_uart * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_iar_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_iar_state_t *msg); +bool sbp_msg_iar_state_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_iar_state_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -296,7 +321,8 @@ bool sbp_msg_iar_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_iar_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_iar_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_iar_state_t *msg); +bool sbp_msg_iar_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_iar_state_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -305,7 +331,8 @@ bool sbp_msg_iar_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_iar_state_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_mask_satellite_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_mask_satellite_t *msg); +bool sbp_msg_mask_satellite_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_mask_satellite_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -314,7 +341,8 @@ bool sbp_msg_mask_satellite_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_mask_satellite_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_mask_satellite_t *msg); +bool sbp_msg_mask_satellite_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_mask_satellite_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -323,7 +351,8 @@ bool sbp_msg_mask_satellite_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_mask_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_mask_satellite_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_mask_satellite_dep_t *msg); +bool sbp_msg_mask_satellite_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_mask_satellite_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -332,7 +361,8 @@ bool sbp_msg_mask_satellite_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_mask_satellite_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_mask_satellite_dep_t *msg); +bool sbp_msg_mask_satellite_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_mask_satellite_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -341,7 +371,8 @@ bool sbp_msg_mask_satellite_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_device_monitor_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_device_monitor_t *msg); +bool sbp_msg_device_monitor_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_device_monitor_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -350,7 +381,8 @@ bool sbp_msg_device_monitor_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_device_monitor_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_device_monitor_t *msg); +bool sbp_msg_device_monitor_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_device_monitor_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -359,7 +391,8 @@ bool sbp_msg_device_monitor_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_devic * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_command_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_command_req_t *msg); +bool sbp_msg_command_req_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_command_req_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -368,7 +401,8 @@ bool sbp_msg_command_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_co * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_command_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_command_req_t *msg); +bool sbp_msg_command_req_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_command_req_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -377,7 +411,8 @@ bool sbp_msg_command_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_command_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_command_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_command_resp_t *msg); +bool sbp_msg_command_resp_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_command_resp_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -386,7 +421,8 @@ bool sbp_msg_command_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_c * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_command_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_command_resp_t *msg); +bool sbp_msg_command_resp_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_command_resp_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -395,7 +431,8 @@ bool sbp_msg_command_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_command * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_command_output_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_command_output_t *msg); +bool sbp_msg_command_output_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_command_output_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -404,7 +441,8 @@ bool sbp_msg_command_output_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_command_output_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_command_output_t *msg); +bool sbp_msg_command_output_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_command_output_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -413,7 +451,8 @@ bool sbp_msg_command_output_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_comma * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_network_state_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_network_state_req_t *msg); +bool sbp_msg_network_state_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_network_state_req_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -422,7 +461,8 @@ bool sbp_msg_network_state_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_network_state_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_network_state_req_t *msg); +bool sbp_msg_network_state_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_network_state_req_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -431,7 +471,8 @@ bool sbp_msg_network_state_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ne * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_network_state_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_network_state_resp_t *msg); +bool sbp_msg_network_state_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_network_state_resp_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -440,7 +481,8 @@ bool sbp_msg_network_state_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_network_state_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_network_state_resp_t *msg); +bool sbp_msg_network_state_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_network_state_resp_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -449,7 +491,8 @@ bool sbp_msg_network_state_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_n * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_network_usage_encode_internal(sbp_encode_ctx_t *ctx, const sbp_network_usage_t *msg); +bool sbp_network_usage_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_network_usage_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -458,7 +501,8 @@ bool sbp_network_usage_encode_internal(sbp_encode_ctx_t *ctx, const sbp_network_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_network_usage_decode_internal(sbp_decode_ctx_t *ctx, sbp_network_usage_t *msg); +bool sbp_network_usage_decode_internal(sbp_decode_ctx_t *ctx, + sbp_network_usage_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -467,7 +511,8 @@ bool sbp_network_usage_decode_internal(sbp_decode_ctx_t *ctx, sbp_network_usage_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_network_bandwidth_usage_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_network_bandwidth_usage_t *msg); +bool sbp_msg_network_bandwidth_usage_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_network_bandwidth_usage_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -476,7 +521,8 @@ bool sbp_msg_network_bandwidth_usage_encode_internal(sbp_encode_ctx_t *ctx, cons * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_network_bandwidth_usage_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_network_bandwidth_usage_t *msg); +bool sbp_msg_network_bandwidth_usage_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_network_bandwidth_usage_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -485,7 +531,8 @@ bool sbp_msg_network_bandwidth_usage_decode_internal(sbp_decode_ctx_t *ctx, sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_cell_modem_status_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_cell_modem_status_t *msg); +bool sbp_msg_cell_modem_status_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_cell_modem_status_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -494,7 +541,8 @@ bool sbp_msg_cell_modem_status_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_cell_modem_status_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_cell_modem_status_t *msg); +bool sbp_msg_cell_modem_status_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_cell_modem_status_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -503,7 +551,8 @@ bool sbp_msg_cell_modem_status_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ce * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_specan_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_specan_dep_t *msg); +bool sbp_msg_specan_dep_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_specan_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -512,7 +561,8 @@ bool sbp_msg_specan_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_spe * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_specan_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_specan_dep_t *msg); +bool sbp_msg_specan_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_specan_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -521,7 +571,8 @@ bool sbp_msg_specan_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_specan_de * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_specan_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_specan_t *msg); +bool sbp_msg_specan_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_specan_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -530,7 +581,8 @@ bool sbp_msg_specan_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_specan_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_specan_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_specan_t *msg); +bool sbp_msg_specan_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_specan_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -539,7 +591,8 @@ bool sbp_msg_specan_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_specan_t *msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_front_end_gain_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_front_end_gain_t *msg); +bool sbp_msg_front_end_gain_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_front_end_gain_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -548,10 +601,11 @@ bool sbp_msg_front_end_gain_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_front_end_gain_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_front_end_gain_t *msg); +bool sbp_msg_front_end_gain_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_front_end_gain_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_PIKSI_H */ diff --git a/c/src/include/libsbp/internal/sbas.h b/c/src/include/libsbp/internal/sbas.h index e3e558b36..ff1413bd6 100644 --- a/c/src/include/libsbp/internal/sbas.h +++ b/c/src/include/libsbp/internal/sbas.h @@ -20,12 +20,12 @@ #include -#include #include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -35,7 +35,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_sbas_raw_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_sbas_raw_t *msg); +bool sbp_msg_sbas_raw_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_sbas_raw_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -44,10 +45,11 @@ bool sbp_msg_sbas_raw_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_sbas_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_sbas_raw_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_sbas_raw_t *msg); +bool sbp_msg_sbas_raw_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_sbas_raw_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_SBAS_H */ diff --git a/c/src/include/libsbp/internal/settings.h b/c/src/include/libsbp/internal/settings.h index 161c13a55..d2ebb36bc 100644 --- a/c/src/include/libsbp/internal/settings.h +++ b/c/src/include/libsbp/internal/settings.h @@ -20,11 +20,11 @@ #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_save_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_save_t *msg); +bool sbp_msg_settings_save_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_settings_save_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -43,7 +44,8 @@ bool sbp_msg_settings_save_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_save_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_save_t *msg); +bool sbp_msg_settings_save_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_settings_save_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -52,7 +54,8 @@ bool sbp_msg_settings_save_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settin * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_write_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_write_t *msg); +bool sbp_msg_settings_write_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_write_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -61,7 +64,8 @@ bool sbp_msg_settings_write_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_write_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_write_t *msg); +bool sbp_msg_settings_write_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_settings_write_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -70,7 +74,8 @@ bool sbp_msg_settings_write_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_setti * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_write_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_write_resp_t *msg); +bool sbp_msg_settings_write_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_write_resp_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -79,7 +84,8 @@ bool sbp_msg_settings_write_resp_encode_internal(sbp_encode_ctx_t *ctx, const sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_write_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_write_resp_t *msg); +bool sbp_msg_settings_write_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_write_resp_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -88,7 +94,8 @@ bool sbp_msg_settings_write_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_read_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_req_t *msg); +bool sbp_msg_settings_read_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_req_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -97,7 +104,8 @@ bool sbp_msg_settings_read_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_read_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_read_req_t *msg); +bool sbp_msg_settings_read_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_read_req_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -106,7 +114,8 @@ bool sbp_msg_settings_read_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_se * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_read_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_resp_t *msg); +bool sbp_msg_settings_read_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_resp_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -115,7 +124,8 @@ bool sbp_msg_settings_read_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_read_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_read_resp_t *msg); +bool sbp_msg_settings_read_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_read_resp_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -124,7 +134,8 @@ bool sbp_msg_settings_read_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_read_by_index_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_by_index_req_t *msg); +bool sbp_msg_settings_read_by_index_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_by_index_req_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -133,7 +144,8 @@ bool sbp_msg_settings_read_by_index_req_encode_internal(sbp_encode_ctx_t *ctx, c * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_read_by_index_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_read_by_index_req_t *msg); +bool sbp_msg_settings_read_by_index_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_read_by_index_req_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -142,7 +154,8 @@ bool sbp_msg_settings_read_by_index_req_decode_internal(sbp_decode_ctx_t *ctx, s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_read_by_index_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_by_index_resp_t *msg); +bool sbp_msg_settings_read_by_index_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_by_index_resp_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -151,7 +164,8 @@ bool sbp_msg_settings_read_by_index_resp_encode_internal(sbp_encode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_read_by_index_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_read_by_index_resp_t *msg); +bool sbp_msg_settings_read_by_index_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_read_by_index_resp_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -160,7 +174,8 @@ bool sbp_msg_settings_read_by_index_resp_decode_internal(sbp_decode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_read_by_index_done_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_by_index_done_t *msg); +bool sbp_msg_settings_read_by_index_done_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_by_index_done_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -169,7 +184,8 @@ bool sbp_msg_settings_read_by_index_done_encode_internal(sbp_encode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_read_by_index_done_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_read_by_index_done_t *msg); +bool sbp_msg_settings_read_by_index_done_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_read_by_index_done_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -178,7 +194,8 @@ bool sbp_msg_settings_read_by_index_done_decode_internal(sbp_decode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_register_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_register_t *msg); +bool sbp_msg_settings_register_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_register_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -187,7 +204,8 @@ bool sbp_msg_settings_register_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_register_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_register_t *msg); +bool sbp_msg_settings_register_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_register_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -196,7 +214,8 @@ bool sbp_msg_settings_register_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_se * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_register_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_register_resp_t *msg); +bool sbp_msg_settings_register_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_register_resp_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -205,10 +224,11 @@ bool sbp_msg_settings_register_resp_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_settings_register_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_register_resp_t *msg); +bool sbp_msg_settings_register_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_register_resp_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_SETTINGS_H */ diff --git a/c/src/include/libsbp/internal/signing.h b/c/src/include/libsbp/internal/signing.h index 429168693..21b18cc66 100644 --- a/c/src/include/libsbp/internal/signing.h +++ b/c/src/include/libsbp/internal/signing.h @@ -20,11 +20,11 @@ #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_utc_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_utc_time_t *msg); +bool sbp_utc_time_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_utc_time_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -52,7 +53,8 @@ bool sbp_utc_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_utc_time_t *msg); * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_ecdsa_signature_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ecdsa_signature_t *msg); +bool sbp_ecdsa_signature_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_ecdsa_signature_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -61,7 +63,8 @@ bool sbp_ecdsa_signature_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ecdsa_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_ecdsa_signature_decode_internal(sbp_decode_ctx_t *ctx, sbp_ecdsa_signature_t *msg); +bool sbp_ecdsa_signature_decode_internal(sbp_decode_ctx_t *ctx, + sbp_ecdsa_signature_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -70,7 +73,8 @@ bool sbp_ecdsa_signature_decode_internal(sbp_decode_ctx_t *ctx, sbp_ecdsa_signat * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ecdsa_certificate_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_certificate_t *msg); +bool sbp_msg_ecdsa_certificate_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_certificate_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -79,7 +83,8 @@ bool sbp_msg_ecdsa_certificate_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ecdsa_certificate_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_certificate_t *msg); +bool sbp_msg_ecdsa_certificate_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_certificate_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -88,7 +93,8 @@ bool sbp_msg_ecdsa_certificate_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ec * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_certificate_chain_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_certificate_chain_t *msg); +bool sbp_msg_certificate_chain_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_certificate_chain_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -97,7 +103,8 @@ bool sbp_msg_certificate_chain_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_certificate_chain_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_certificate_chain_t *msg); +bool sbp_msg_certificate_chain_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_certificate_chain_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -106,7 +113,8 @@ bool sbp_msg_certificate_chain_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ce * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_certificate_chain_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_certificate_chain_dep_t *msg); +bool sbp_msg_certificate_chain_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_certificate_chain_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -115,7 +123,8 @@ bool sbp_msg_certificate_chain_dep_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_certificate_chain_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_certificate_chain_dep_t *msg); +bool sbp_msg_certificate_chain_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_certificate_chain_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -124,7 +133,8 @@ bool sbp_msg_certificate_chain_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ecdsa_signature_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_t *msg); +bool sbp_msg_ecdsa_signature_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -133,7 +143,8 @@ bool sbp_msg_ecdsa_signature_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ecdsa_signature_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_t *msg); +bool sbp_msg_ecdsa_signature_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ecdsa_signature_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -142,7 +153,8 @@ bool sbp_msg_ecdsa_signature_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ecds * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ecdsa_signature_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_dep_b_t *msg); +bool sbp_msg_ecdsa_signature_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_dep_b_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -151,7 +163,8 @@ bool sbp_msg_ecdsa_signature_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ecdsa_signature_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_dep_b_t *msg); +bool sbp_msg_ecdsa_signature_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_dep_b_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -160,7 +173,8 @@ bool sbp_msg_ecdsa_signature_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ecdsa_signature_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_dep_a_t *msg); +bool sbp_msg_ecdsa_signature_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -169,7 +183,8 @@ bool sbp_msg_ecdsa_signature_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ecdsa_signature_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_dep_a_t *msg); +bool sbp_msg_ecdsa_signature_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -178,7 +193,8 @@ bool sbp_msg_ecdsa_signature_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ed25519_certificate_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ed25519_certificate_dep_t *msg); +bool sbp_msg_ed25519_certificate_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ed25519_certificate_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -187,7 +203,8 @@ bool sbp_msg_ed25519_certificate_dep_encode_internal(sbp_encode_ctx_t *ctx, cons * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ed25519_certificate_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ed25519_certificate_dep_t *msg); +bool sbp_msg_ed25519_certificate_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ed25519_certificate_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -196,7 +213,8 @@ bool sbp_msg_ed25519_certificate_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ed25519_signature_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ed25519_signature_dep_a_t *msg); +bool sbp_msg_ed25519_signature_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ed25519_signature_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -205,7 +223,8 @@ bool sbp_msg_ed25519_signature_dep_a_encode_internal(sbp_encode_ctx_t *ctx, cons * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ed25519_signature_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ed25519_signature_dep_a_t *msg); +bool sbp_msg_ed25519_signature_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ed25519_signature_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -214,7 +233,8 @@ bool sbp_msg_ed25519_signature_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ed25519_signature_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ed25519_signature_dep_b_t *msg); +bool sbp_msg_ed25519_signature_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ed25519_signature_dep_b_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -223,10 +243,11 @@ bool sbp_msg_ed25519_signature_dep_b_encode_internal(sbp_encode_ctx_t *ctx, cons * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ed25519_signature_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ed25519_signature_dep_b_t *msg); +bool sbp_msg_ed25519_signature_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ed25519_signature_dep_b_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_SIGNING_H */ diff --git a/c/src/include/libsbp/internal/solution_meta.h b/c/src/include/libsbp/internal/solution_meta.h index b0f0a6775..b10f43f3c 100644 --- a/c/src/include/libsbp/internal/solution_meta.h +++ b/c/src/include/libsbp/internal/solution_meta.h @@ -20,11 +20,11 @@ #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_solution_input_type_encode_internal(sbp_encode_ctx_t *ctx, const sbp_solution_input_type_t *msg); +bool sbp_solution_input_type_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_solution_input_type_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -43,7 +44,8 @@ bool sbp_solution_input_type_encode_internal(sbp_encode_ctx_t *ctx, const sbp_so * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_solution_input_type_decode_internal(sbp_decode_ctx_t *ctx, sbp_solution_input_type_t *msg); +bool sbp_solution_input_type_decode_internal(sbp_decode_ctx_t *ctx, + sbp_solution_input_type_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -52,7 +54,8 @@ bool sbp_solution_input_type_decode_internal(sbp_decode_ctx_t *ctx, sbp_solution * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_soln_meta_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_soln_meta_dep_a_t *msg); +bool sbp_msg_soln_meta_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_soln_meta_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -61,7 +64,8 @@ bool sbp_msg_soln_meta_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_soln_meta_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_soln_meta_dep_a_t *msg); +bool sbp_msg_soln_meta_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_soln_meta_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -70,7 +74,8 @@ bool sbp_msg_soln_meta_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_soln * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_soln_meta_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_soln_meta_t *msg); +bool sbp_msg_soln_meta_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_soln_meta_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -79,7 +84,8 @@ bool sbp_msg_soln_meta_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_soln * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_soln_meta_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_soln_meta_t *msg); +bool sbp_msg_soln_meta_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_soln_meta_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -88,7 +94,8 @@ bool sbp_msg_soln_meta_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_soln_meta_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_gnss_input_type_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gnss_input_type_t *msg); +bool sbp_gnss_input_type_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_gnss_input_type_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -97,7 +104,8 @@ bool sbp_gnss_input_type_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gnss_i * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_gnss_input_type_decode_internal(sbp_decode_ctx_t *ctx, sbp_gnss_input_type_t *msg); +bool sbp_gnss_input_type_decode_internal(sbp_decode_ctx_t *ctx, + sbp_gnss_input_type_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -106,7 +114,8 @@ bool sbp_gnss_input_type_decode_internal(sbp_decode_ctx_t *ctx, sbp_gnss_input_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_imu_input_type_encode_internal(sbp_encode_ctx_t *ctx, const sbp_imu_input_type_t *msg); +bool sbp_imu_input_type_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_imu_input_type_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -115,7 +124,8 @@ bool sbp_imu_input_type_encode_internal(sbp_encode_ctx_t *ctx, const sbp_imu_inp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_imu_input_type_decode_internal(sbp_decode_ctx_t *ctx, sbp_imu_input_type_t *msg); +bool sbp_imu_input_type_decode_internal(sbp_decode_ctx_t *ctx, + sbp_imu_input_type_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -124,7 +134,8 @@ bool sbp_imu_input_type_decode_internal(sbp_decode_ctx_t *ctx, sbp_imu_input_typ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_odo_input_type_encode_internal(sbp_encode_ctx_t *ctx, const sbp_odo_input_type_t *msg); +bool sbp_odo_input_type_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_odo_input_type_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -133,10 +144,11 @@ bool sbp_odo_input_type_encode_internal(sbp_encode_ctx_t *ctx, const sbp_odo_inp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_odo_input_type_decode_internal(sbp_decode_ctx_t *ctx, sbp_odo_input_type_t *msg); +bool sbp_odo_input_type_decode_internal(sbp_decode_ctx_t *ctx, + sbp_odo_input_type_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_SOLUTION_META_H */ diff --git a/c/src/include/libsbp/internal/ssr.h b/c/src/include/libsbp/internal/ssr.h index fbe6cb078..ce82dba99 100644 --- a/c/src/include/libsbp/internal/ssr.h +++ b/c/src/include/libsbp/internal/ssr.h @@ -20,12 +20,12 @@ #include -#include #include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -35,7 +35,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_code_biases_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_code_biases_content_t *msg); +bool sbp_code_biases_content_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_code_biases_content_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -44,7 +45,8 @@ bool sbp_code_biases_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_co * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_code_biases_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_code_biases_content_t *msg); +bool sbp_code_biases_content_decode_internal(sbp_decode_ctx_t *ctx, + sbp_code_biases_content_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -53,7 +55,8 @@ bool sbp_code_biases_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_code_bia * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_phase_biases_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_phase_biases_content_t *msg); +bool sbp_phase_biases_content_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_phase_biases_content_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -62,7 +65,8 @@ bool sbp_phase_biases_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_p * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_phase_biases_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_phase_biases_content_t *msg); +bool sbp_phase_biases_content_decode_internal(sbp_decode_ctx_t *ctx, + sbp_phase_biases_content_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -71,7 +75,8 @@ bool sbp_phase_biases_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_phase_b * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_stec_header_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec_header_t *msg); +bool sbp_stec_header_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_stec_header_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -80,7 +85,8 @@ bool sbp_stec_header_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec_heade * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_stec_header_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_header_t *msg); +bool sbp_stec_header_decode_internal(sbp_decode_ctx_t *ctx, + sbp_stec_header_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -89,7 +95,8 @@ bool sbp_stec_header_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_header_t *m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_gridded_correction_header_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gridded_correction_header_t *msg); +bool sbp_gridded_correction_header_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_gridded_correction_header_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -98,7 +105,8 @@ bool sbp_gridded_correction_header_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_gridded_correction_header_decode_internal(sbp_decode_ctx_t *ctx, sbp_gridded_correction_header_t *msg); +bool sbp_gridded_correction_header_decode_internal( + sbp_decode_ctx_t *ctx, sbp_gridded_correction_header_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -107,7 +115,8 @@ bool sbp_gridded_correction_header_decode_internal(sbp_decode_ctx_t *ctx, sbp_gr * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_stec_sat_element_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec_sat_element_t *msg); +bool sbp_stec_sat_element_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_stec_sat_element_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -116,7 +125,8 @@ bool sbp_stec_sat_element_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_stec_sat_element_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_sat_element_t *msg); +bool sbp_stec_sat_element_decode_internal(sbp_decode_ctx_t *ctx, + sbp_stec_sat_element_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -125,7 +135,9 @@ bool sbp_stec_sat_element_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_sat_el * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_tropospheric_delay_correction_no_std_encode_internal(sbp_encode_ctx_t *ctx, const sbp_tropospheric_delay_correction_no_std_t *msg); +bool sbp_tropospheric_delay_correction_no_std_encode_internal( + sbp_encode_ctx_t *ctx, + const sbp_tropospheric_delay_correction_no_std_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -134,7 +146,8 @@ bool sbp_tropospheric_delay_correction_no_std_encode_internal(sbp_encode_ctx_t * * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_tropospheric_delay_correction_no_std_decode_internal(sbp_decode_ctx_t *ctx, sbp_tropospheric_delay_correction_no_std_t *msg); +bool sbp_tropospheric_delay_correction_no_std_decode_internal( + sbp_decode_ctx_t *ctx, sbp_tropospheric_delay_correction_no_std_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -143,7 +156,8 @@ bool sbp_tropospheric_delay_correction_no_std_decode_internal(sbp_decode_ctx_t * * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_tropospheric_delay_correction_encode_internal(sbp_encode_ctx_t *ctx, const sbp_tropospheric_delay_correction_t *msg); +bool sbp_tropospheric_delay_correction_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_tropospheric_delay_correction_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -152,7 +166,8 @@ bool sbp_tropospheric_delay_correction_encode_internal(sbp_encode_ctx_t *ctx, co * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_tropospheric_delay_correction_decode_internal(sbp_decode_ctx_t *ctx, sbp_tropospheric_delay_correction_t *msg); +bool sbp_tropospheric_delay_correction_decode_internal( + sbp_decode_ctx_t *ctx, sbp_tropospheric_delay_correction_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -161,7 +176,8 @@ bool sbp_tropospheric_delay_correction_decode_internal(sbp_decode_ctx_t *ctx, sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_stec_residual_no_std_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec_residual_no_std_t *msg); +bool sbp_stec_residual_no_std_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_stec_residual_no_std_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -170,7 +186,8 @@ bool sbp_stec_residual_no_std_encode_internal(sbp_encode_ctx_t *ctx, const sbp_s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_stec_residual_no_std_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_residual_no_std_t *msg); +bool sbp_stec_residual_no_std_decode_internal(sbp_decode_ctx_t *ctx, + sbp_stec_residual_no_std_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -179,7 +196,8 @@ bool sbp_stec_residual_no_std_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_re * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_stec_residual_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec_residual_t *msg); +bool sbp_stec_residual_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_stec_residual_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -188,7 +206,8 @@ bool sbp_stec_residual_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec_res * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_stec_residual_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_residual_t *msg); +bool sbp_stec_residual_decode_internal(sbp_decode_ctx_t *ctx, + sbp_stec_residual_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -197,7 +216,8 @@ bool sbp_stec_residual_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_residual_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_orbit_clock_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_orbit_clock_t *msg); +bool sbp_msg_ssr_orbit_clock_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_orbit_clock_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -206,7 +226,8 @@ bool sbp_msg_ssr_orbit_clock_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_orbit_clock_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_orbit_clock_t *msg); +bool sbp_msg_ssr_orbit_clock_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ssr_orbit_clock_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -215,7 +236,8 @@ bool sbp_msg_ssr_orbit_clock_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_code_biases_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_code_biases_t *msg); +bool sbp_msg_ssr_code_biases_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_code_biases_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -224,7 +246,8 @@ bool sbp_msg_ssr_code_biases_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_code_biases_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_code_biases_t *msg); +bool sbp_msg_ssr_code_biases_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ssr_code_biases_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -233,7 +256,8 @@ bool sbp_msg_ssr_code_biases_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_phase_biases_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_phase_biases_t *msg); +bool sbp_msg_ssr_phase_biases_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_phase_biases_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -242,7 +266,8 @@ bool sbp_msg_ssr_phase_biases_encode_internal(sbp_encode_ctx_t *ctx, const sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_phase_biases_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_phase_biases_t *msg); +bool sbp_msg_ssr_phase_biases_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ssr_phase_biases_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -251,7 +276,8 @@ bool sbp_msg_ssr_phase_biases_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_stec_correction_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_stec_correction_dep_t *msg); +bool sbp_msg_ssr_stec_correction_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_stec_correction_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -260,7 +286,8 @@ bool sbp_msg_ssr_stec_correction_dep_encode_internal(sbp_encode_ctx_t *ctx, cons * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_stec_correction_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_stec_correction_dep_t *msg); +bool sbp_msg_ssr_stec_correction_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_stec_correction_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -269,7 +296,8 @@ bool sbp_msg_ssr_stec_correction_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_bounds_header_encode_internal(sbp_encode_ctx_t *ctx, const sbp_bounds_header_t *msg); +bool sbp_bounds_header_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_bounds_header_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -278,7 +306,8 @@ bool sbp_bounds_header_encode_internal(sbp_encode_ctx_t *ctx, const sbp_bounds_h * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_bounds_header_decode_internal(sbp_decode_ctx_t *ctx, sbp_bounds_header_t *msg); +bool sbp_bounds_header_decode_internal(sbp_decode_ctx_t *ctx, + sbp_bounds_header_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -287,7 +316,8 @@ bool sbp_bounds_header_decode_internal(sbp_decode_ctx_t *ctx, sbp_bounds_header_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_stec_correction_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_stec_correction_t *msg); +bool sbp_msg_ssr_stec_correction_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_stec_correction_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -296,7 +326,8 @@ bool sbp_msg_ssr_stec_correction_encode_internal(sbp_encode_ctx_t *ctx, const sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_stec_correction_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_stec_correction_t *msg); +bool sbp_msg_ssr_stec_correction_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_stec_correction_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -305,7 +336,8 @@ bool sbp_msg_ssr_stec_correction_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_gridded_correction_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_gridded_correction_t *msg); +bool sbp_msg_ssr_gridded_correction_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_gridded_correction_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -314,7 +346,8 @@ bool sbp_msg_ssr_gridded_correction_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_gridded_correction_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_t *msg); +bool sbp_msg_ssr_gridded_correction_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -323,7 +356,8 @@ bool sbp_msg_ssr_gridded_correction_decode_internal(sbp_decode_ctx_t *ctx, sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_stec_sat_element_integrity_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec_sat_element_integrity_t *msg); +bool sbp_stec_sat_element_integrity_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_stec_sat_element_integrity_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -332,7 +366,8 @@ bool sbp_stec_sat_element_integrity_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_stec_sat_element_integrity_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_sat_element_integrity_t *msg); +bool sbp_stec_sat_element_integrity_decode_internal( + sbp_decode_ctx_t *ctx, sbp_stec_sat_element_integrity_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -341,7 +376,8 @@ bool sbp_stec_sat_element_integrity_decode_internal(sbp_decode_ctx_t *ctx, sbp_s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_gridded_correction_bounds_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_gridded_correction_bounds_t *msg); +bool sbp_msg_ssr_gridded_correction_bounds_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_gridded_correction_bounds_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -350,7 +386,8 @@ bool sbp_msg_ssr_gridded_correction_bounds_encode_internal(sbp_encode_ctx_t *ctx * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_gridded_correction_bounds_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_bounds_t *msg); +bool sbp_msg_ssr_gridded_correction_bounds_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_bounds_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -359,7 +396,8 @@ bool sbp_msg_ssr_gridded_correction_bounds_decode_internal(sbp_decode_ctx_t *ctx * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_tile_definition_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_tile_definition_dep_a_t *msg); +bool sbp_msg_ssr_tile_definition_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_tile_definition_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -368,7 +406,8 @@ bool sbp_msg_ssr_tile_definition_dep_a_encode_internal(sbp_encode_ctx_t *ctx, co * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_tile_definition_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_tile_definition_dep_a_t *msg); +bool sbp_msg_ssr_tile_definition_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_tile_definition_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -377,7 +416,8 @@ bool sbp_msg_ssr_tile_definition_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_tile_definition_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_tile_definition_dep_b_t *msg); +bool sbp_msg_ssr_tile_definition_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_tile_definition_dep_b_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -386,7 +426,8 @@ bool sbp_msg_ssr_tile_definition_dep_b_encode_internal(sbp_encode_ctx_t *ctx, co * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_tile_definition_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_tile_definition_dep_b_t *msg); +bool sbp_msg_ssr_tile_definition_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_tile_definition_dep_b_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -395,7 +436,8 @@ bool sbp_msg_ssr_tile_definition_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_tile_definition_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_tile_definition_t *msg); +bool sbp_msg_ssr_tile_definition_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_tile_definition_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -404,7 +446,8 @@ bool sbp_msg_ssr_tile_definition_encode_internal(sbp_encode_ctx_t *ctx, const sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_tile_definition_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_tile_definition_t *msg); +bool sbp_msg_ssr_tile_definition_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_tile_definition_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -413,7 +456,8 @@ bool sbp_msg_ssr_tile_definition_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_satellite_apc_encode_internal(sbp_encode_ctx_t *ctx, const sbp_satellite_apc_t *msg); +bool sbp_satellite_apc_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_satellite_apc_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -422,7 +466,8 @@ bool sbp_satellite_apc_encode_internal(sbp_encode_ctx_t *ctx, const sbp_satellit * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_satellite_apc_decode_internal(sbp_decode_ctx_t *ctx, sbp_satellite_apc_t *msg); +bool sbp_satellite_apc_decode_internal(sbp_decode_ctx_t *ctx, + sbp_satellite_apc_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -431,7 +476,8 @@ bool sbp_satellite_apc_decode_internal(sbp_decode_ctx_t *ctx, sbp_satellite_apc_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_satellite_apc_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_satellite_apc_dep_t *msg); +bool sbp_msg_ssr_satellite_apc_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_satellite_apc_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -440,7 +486,8 @@ bool sbp_msg_ssr_satellite_apc_dep_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_satellite_apc_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_satellite_apc_dep_t *msg); +bool sbp_msg_ssr_satellite_apc_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_satellite_apc_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -449,7 +496,8 @@ bool sbp_msg_ssr_satellite_apc_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_satellite_apc_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_satellite_apc_t *msg); +bool sbp_msg_ssr_satellite_apc_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_satellite_apc_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -458,7 +506,8 @@ bool sbp_msg_ssr_satellite_apc_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_satellite_apc_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_satellite_apc_t *msg); +bool sbp_msg_ssr_satellite_apc_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_satellite_apc_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -467,7 +516,8 @@ bool sbp_msg_ssr_satellite_apc_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ss * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_orbit_clock_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_orbit_clock_dep_a_t *msg); +bool sbp_msg_ssr_orbit_clock_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_orbit_clock_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -476,7 +526,8 @@ bool sbp_msg_ssr_orbit_clock_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_orbit_clock_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_orbit_clock_dep_a_t *msg); +bool sbp_msg_ssr_orbit_clock_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_orbit_clock_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -485,7 +536,8 @@ bool sbp_msg_ssr_orbit_clock_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_stec_header_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec_header_dep_a_t *msg); +bool sbp_stec_header_dep_a_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_stec_header_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -494,7 +546,8 @@ bool sbp_stec_header_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_stec_header_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_header_dep_a_t *msg); +bool sbp_stec_header_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_stec_header_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -503,7 +556,8 @@ bool sbp_stec_header_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_heade * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_gridded_correction_header_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gridded_correction_header_dep_a_t *msg); +bool sbp_gridded_correction_header_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_gridded_correction_header_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -512,7 +566,8 @@ bool sbp_gridded_correction_header_dep_a_encode_internal(sbp_encode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_gridded_correction_header_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_gridded_correction_header_dep_a_t *msg); +bool sbp_gridded_correction_header_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_gridded_correction_header_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -521,7 +576,8 @@ bool sbp_gridded_correction_header_dep_a_decode_internal(sbp_decode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_grid_definition_header_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_grid_definition_header_dep_a_t *msg); +bool sbp_grid_definition_header_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_grid_definition_header_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -530,7 +586,8 @@ bool sbp_grid_definition_header_dep_a_encode_internal(sbp_encode_ctx_t *ctx, con * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_grid_definition_header_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_grid_definition_header_dep_a_t *msg); +bool sbp_grid_definition_header_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_grid_definition_header_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -539,7 +596,8 @@ bool sbp_grid_definition_header_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_stec_correction_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_stec_correction_dep_a_t *msg); +bool sbp_msg_ssr_stec_correction_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_stec_correction_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -548,7 +606,8 @@ bool sbp_msg_ssr_stec_correction_dep_a_encode_internal(sbp_encode_ctx_t *ctx, co * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_stec_correction_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_stec_correction_dep_a_t *msg); +bool sbp_msg_ssr_stec_correction_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_stec_correction_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -557,7 +616,9 @@ bool sbp_msg_ssr_stec_correction_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_gridded_correction_no_std_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg); +bool sbp_msg_ssr_gridded_correction_no_std_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -566,7 +627,8 @@ bool sbp_msg_ssr_gridded_correction_no_std_dep_a_encode_internal(sbp_encode_ctx_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_gridded_correction_no_std_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg); +bool sbp_msg_ssr_gridded_correction_no_std_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -575,7 +637,8 @@ bool sbp_msg_ssr_gridded_correction_no_std_dep_a_decode_internal(sbp_decode_ctx_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_gridded_correction_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_gridded_correction_dep_a_t *msg); +bool sbp_msg_ssr_gridded_correction_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_gridded_correction_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -584,7 +647,8 @@ bool sbp_msg_ssr_gridded_correction_dep_a_encode_internal(sbp_encode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_gridded_correction_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_dep_a_t *msg); +bool sbp_msg_ssr_gridded_correction_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -593,7 +657,8 @@ bool sbp_msg_ssr_gridded_correction_dep_a_decode_internal(sbp_decode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_grid_definition_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_grid_definition_dep_a_t *msg); +bool sbp_msg_ssr_grid_definition_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_grid_definition_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -602,7 +667,8 @@ bool sbp_msg_ssr_grid_definition_dep_a_encode_internal(sbp_encode_ctx_t *ctx, co * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_grid_definition_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_grid_definition_dep_a_t *msg); +bool sbp_msg_ssr_grid_definition_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_grid_definition_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -611,7 +677,8 @@ bool sbp_msg_ssr_grid_definition_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_orbit_clock_bound_encode_internal(sbp_encode_ctx_t *ctx, const sbp_orbit_clock_bound_t *msg); +bool sbp_orbit_clock_bound_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_orbit_clock_bound_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -620,7 +687,8 @@ bool sbp_orbit_clock_bound_encode_internal(sbp_encode_ctx_t *ctx, const sbp_orbi * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_orbit_clock_bound_decode_internal(sbp_decode_ctx_t *ctx, sbp_orbit_clock_bound_t *msg); +bool sbp_orbit_clock_bound_decode_internal(sbp_decode_ctx_t *ctx, + sbp_orbit_clock_bound_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -629,7 +697,8 @@ bool sbp_orbit_clock_bound_decode_internal(sbp_decode_ctx_t *ctx, sbp_orbit_cloc * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_orbit_clock_bounds_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_orbit_clock_bounds_t *msg); +bool sbp_msg_ssr_orbit_clock_bounds_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_orbit_clock_bounds_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -638,7 +707,8 @@ bool sbp_msg_ssr_orbit_clock_bounds_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_orbit_clock_bounds_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_orbit_clock_bounds_t *msg); +bool sbp_msg_ssr_orbit_clock_bounds_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_orbit_clock_bounds_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -647,7 +717,8 @@ bool sbp_msg_ssr_orbit_clock_bounds_decode_internal(sbp_decode_ctx_t *ctx, sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_code_phase_biases_sat_sig_encode_internal(sbp_encode_ctx_t *ctx, const sbp_code_phase_biases_sat_sig_t *msg); +bool sbp_code_phase_biases_sat_sig_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_code_phase_biases_sat_sig_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -656,7 +727,8 @@ bool sbp_code_phase_biases_sat_sig_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_code_phase_biases_sat_sig_decode_internal(sbp_decode_ctx_t *ctx, sbp_code_phase_biases_sat_sig_t *msg); +bool sbp_code_phase_biases_sat_sig_decode_internal( + sbp_decode_ctx_t *ctx, sbp_code_phase_biases_sat_sig_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -665,7 +737,8 @@ bool sbp_code_phase_biases_sat_sig_decode_internal(sbp_decode_ctx_t *ctx, sbp_co * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_code_phase_biases_bounds_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_code_phase_biases_bounds_t *msg); +bool sbp_msg_ssr_code_phase_biases_bounds_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_code_phase_biases_bounds_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -674,7 +747,8 @@ bool sbp_msg_ssr_code_phase_biases_bounds_encode_internal(sbp_encode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_code_phase_biases_bounds_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_code_phase_biases_bounds_t *msg); +bool sbp_msg_ssr_code_phase_biases_bounds_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_code_phase_biases_bounds_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -683,7 +757,8 @@ bool sbp_msg_ssr_code_phase_biases_bounds_decode_internal(sbp_decode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_orbit_clock_bound_degradation_encode_internal(sbp_encode_ctx_t *ctx, const sbp_orbit_clock_bound_degradation_t *msg); +bool sbp_orbit_clock_bound_degradation_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_orbit_clock_bound_degradation_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -692,7 +767,8 @@ bool sbp_orbit_clock_bound_degradation_encode_internal(sbp_encode_ctx_t *ctx, co * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_orbit_clock_bound_degradation_decode_internal(sbp_decode_ctx_t *ctx, sbp_orbit_clock_bound_degradation_t *msg); +bool sbp_orbit_clock_bound_degradation_decode_internal( + sbp_decode_ctx_t *ctx, sbp_orbit_clock_bound_degradation_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -701,7 +777,9 @@ bool sbp_orbit_clock_bound_degradation_decode_internal(sbp_decode_ctx_t *ctx, sb * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_orbit_clock_bounds_degradation_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg); +bool sbp_msg_ssr_orbit_clock_bounds_degradation_encode_internal( + sbp_encode_ctx_t *ctx, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -710,10 +788,11 @@ bool sbp_msg_ssr_orbit_clock_bounds_degradation_encode_internal(sbp_encode_ctx_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ssr_orbit_clock_bounds_degradation_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg); +bool sbp_msg_ssr_orbit_clock_bounds_degradation_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_SSR_H */ diff --git a/c/src/include/libsbp/internal/system.h b/c/src/include/libsbp/internal/system.h index 4aeb27eab..8b7df8834 100644 --- a/c/src/include/libsbp/internal/system.h +++ b/c/src/include/libsbp/internal/system.h @@ -20,11 +20,11 @@ #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_startup_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_startup_t *msg); +bool sbp_msg_startup_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_startup_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -43,7 +44,8 @@ bool sbp_msg_startup_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_startu * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_startup_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_startup_t *msg); +bool sbp_msg_startup_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_startup_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -52,7 +54,8 @@ bool sbp_msg_startup_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_startup_t *m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_dgnss_status_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_dgnss_status_t *msg); +bool sbp_msg_dgnss_status_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_dgnss_status_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -61,7 +64,8 @@ bool sbp_msg_dgnss_status_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_d * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_dgnss_status_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_dgnss_status_t *msg); +bool sbp_msg_dgnss_status_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_dgnss_status_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -70,7 +74,8 @@ bool sbp_msg_dgnss_status_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_dgnss_s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_heartbeat_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_heartbeat_t *msg); +bool sbp_msg_heartbeat_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_heartbeat_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -79,7 +84,8 @@ bool sbp_msg_heartbeat_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_hear * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_heartbeat_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_heartbeat_t *msg); +bool sbp_msg_heartbeat_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_heartbeat_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -88,7 +94,8 @@ bool sbp_msg_heartbeat_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_heartbeat_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_sub_system_report_encode_internal(sbp_encode_ctx_t *ctx, const sbp_sub_system_report_t *msg); +bool sbp_sub_system_report_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_sub_system_report_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -97,7 +104,8 @@ bool sbp_sub_system_report_encode_internal(sbp_encode_ctx_t *ctx, const sbp_sub_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_sub_system_report_decode_internal(sbp_decode_ctx_t *ctx, sbp_sub_system_report_t *msg); +bool sbp_sub_system_report_decode_internal(sbp_decode_ctx_t *ctx, + sbp_sub_system_report_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -106,7 +114,8 @@ bool sbp_sub_system_report_decode_internal(sbp_decode_ctx_t *ctx, sbp_sub_system * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_status_report_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_status_report_t *msg); +bool sbp_msg_status_report_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_status_report_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -115,7 +124,8 @@ bool sbp_msg_status_report_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_status_report_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_status_report_t *msg); +bool sbp_msg_status_report_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_status_report_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -124,7 +134,8 @@ bool sbp_msg_status_report_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_status * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_status_journal_item_encode_internal(sbp_encode_ctx_t *ctx, const sbp_status_journal_item_t *msg); +bool sbp_status_journal_item_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_status_journal_item_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -133,7 +144,8 @@ bool sbp_status_journal_item_encode_internal(sbp_encode_ctx_t *ctx, const sbp_st * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_status_journal_item_decode_internal(sbp_decode_ctx_t *ctx, sbp_status_journal_item_t *msg); +bool sbp_status_journal_item_decode_internal(sbp_decode_ctx_t *ctx, + sbp_status_journal_item_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -142,7 +154,8 @@ bool sbp_status_journal_item_decode_internal(sbp_decode_ctx_t *ctx, sbp_status_j * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_status_journal_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_status_journal_t *msg); +bool sbp_msg_status_journal_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_status_journal_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -151,7 +164,8 @@ bool sbp_msg_status_journal_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_status_journal_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_status_journal_t *msg); +bool sbp_msg_status_journal_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_status_journal_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -160,7 +174,8 @@ bool sbp_msg_status_journal_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_statu * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ins_status_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ins_status_t *msg); +bool sbp_msg_ins_status_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ins_status_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -169,7 +184,8 @@ bool sbp_msg_ins_status_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ins * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ins_status_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ins_status_t *msg); +bool sbp_msg_ins_status_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ins_status_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -178,7 +194,8 @@ bool sbp_msg_ins_status_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ins_statu * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_csac_telemetry_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_csac_telemetry_t *msg); +bool sbp_msg_csac_telemetry_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_csac_telemetry_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -187,7 +204,8 @@ bool sbp_msg_csac_telemetry_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_csac_telemetry_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_csac_telemetry_t *msg); +bool sbp_msg_csac_telemetry_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_csac_telemetry_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -196,7 +214,8 @@ bool sbp_msg_csac_telemetry_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_csac_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_csac_telemetry_labels_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_csac_telemetry_labels_t *msg); +bool sbp_msg_csac_telemetry_labels_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_csac_telemetry_labels_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -205,7 +224,8 @@ bool sbp_msg_csac_telemetry_labels_encode_internal(sbp_encode_ctx_t *ctx, const * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_csac_telemetry_labels_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_csac_telemetry_labels_t *msg); +bool sbp_msg_csac_telemetry_labels_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_csac_telemetry_labels_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -214,7 +234,8 @@ bool sbp_msg_csac_telemetry_labels_decode_internal(sbp_decode_ctx_t *ctx, sbp_ms * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ins_updates_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ins_updates_t *msg); +bool sbp_msg_ins_updates_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ins_updates_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -223,7 +244,8 @@ bool sbp_msg_ins_updates_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_in * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ins_updates_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ins_updates_t *msg); +bool sbp_msg_ins_updates_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ins_updates_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -232,7 +254,8 @@ bool sbp_msg_ins_updates_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ins_upda * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_gnss_time_offset_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_gnss_time_offset_t *msg); +bool sbp_msg_gnss_time_offset_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_gnss_time_offset_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -241,7 +264,8 @@ bool sbp_msg_gnss_time_offset_encode_internal(sbp_encode_ctx_t *ctx, const sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_gnss_time_offset_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gnss_time_offset_t *msg); +bool sbp_msg_gnss_time_offset_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_gnss_time_offset_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -250,7 +274,8 @@ bool sbp_msg_gnss_time_offset_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gns * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pps_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pps_time_t *msg); +bool sbp_msg_pps_time_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pps_time_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -259,7 +284,8 @@ bool sbp_msg_pps_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pps_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_pps_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pps_time_t *msg); +bool sbp_msg_pps_time_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pps_time_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -268,7 +294,8 @@ bool sbp_msg_pps_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pps_time_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_sensor_aid_event_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_sensor_aid_event_t *msg); +bool sbp_msg_sensor_aid_event_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_sensor_aid_event_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -277,7 +304,8 @@ bool sbp_msg_sensor_aid_event_encode_internal(sbp_encode_ctx_t *ctx, const sbp_m * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_sensor_aid_event_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_sensor_aid_event_t *msg); +bool sbp_msg_sensor_aid_event_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_sensor_aid_event_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -286,7 +314,8 @@ bool sbp_msg_sensor_aid_event_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_sen * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_group_meta_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_group_meta_t *msg); +bool sbp_msg_group_meta_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_group_meta_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -295,10 +324,11 @@ bool sbp_msg_group_meta_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_gro * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_group_meta_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_group_meta_t *msg); +bool sbp_msg_group_meta_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_group_meta_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_SYSTEM_H */ diff --git a/c/src/include/libsbp/internal/telemetry.h b/c/src/include/libsbp/internal/telemetry.h index 9d0dab98e..f31c5aabb 100644 --- a/c/src/include/libsbp/internal/telemetry.h +++ b/c/src/include/libsbp/internal/telemetry.h @@ -20,12 +20,12 @@ #include -#include #include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -35,7 +35,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_telemetry_sv_encode_internal(sbp_encode_ctx_t *ctx, const sbp_telemetry_sv_t *msg); +bool sbp_telemetry_sv_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_telemetry_sv_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -44,7 +45,8 @@ bool sbp_telemetry_sv_encode_internal(sbp_encode_ctx_t *ctx, const sbp_telemetry * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_telemetry_sv_decode_internal(sbp_decode_ctx_t *ctx, sbp_telemetry_sv_t *msg); +bool sbp_telemetry_sv_decode_internal(sbp_decode_ctx_t *ctx, + sbp_telemetry_sv_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -53,7 +55,8 @@ bool sbp_telemetry_sv_decode_internal(sbp_decode_ctx_t *ctx, sbp_telemetry_sv_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tel_sv_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tel_sv_t *msg); +bool sbp_msg_tel_sv_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_tel_sv_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -62,10 +65,11 @@ bool sbp_msg_tel_sv_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tel_sv_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tel_sv_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tel_sv_t *msg); +bool sbp_msg_tel_sv_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_tel_sv_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_TELEMETRY_H */ diff --git a/c/src/include/libsbp/internal/tracking.h b/c/src/include/libsbp/internal/tracking.h index afb42b106..a486cf462 100644 --- a/c/src/include/libsbp/internal/tracking.h +++ b/c/src/include/libsbp/internal/tracking.h @@ -20,12 +20,12 @@ #include -#include #include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -35,7 +35,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_state_detailed_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_detailed_dep_a_t *msg); +bool sbp_msg_tracking_state_detailed_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_detailed_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -44,7 +45,8 @@ bool sbp_msg_tracking_state_detailed_dep_a_encode_internal(sbp_encode_ctx_t *ctx * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_state_detailed_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_detailed_dep_a_t *msg); +bool sbp_msg_tracking_state_detailed_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_detailed_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -53,7 +55,8 @@ bool sbp_msg_tracking_state_detailed_dep_a_decode_internal(sbp_decode_ctx_t *ctx * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_state_detailed_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_detailed_dep_t *msg); +bool sbp_msg_tracking_state_detailed_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_detailed_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -62,7 +65,8 @@ bool sbp_msg_tracking_state_detailed_dep_encode_internal(sbp_encode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_state_detailed_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_detailed_dep_t *msg); +bool sbp_msg_tracking_state_detailed_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_detailed_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -71,7 +75,8 @@ bool sbp_msg_tracking_state_detailed_dep_decode_internal(sbp_decode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_tracking_channel_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_tracking_channel_state_t *msg); +bool sbp_tracking_channel_state_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_tracking_channel_state_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -80,7 +85,8 @@ bool sbp_tracking_channel_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_tracking_channel_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_tracking_channel_state_t *msg); +bool sbp_tracking_channel_state_decode_internal( + sbp_decode_ctx_t *ctx, sbp_tracking_channel_state_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -89,7 +95,8 @@ bool sbp_tracking_channel_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_track * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_t *msg); +bool sbp_msg_tracking_state_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -98,7 +105,8 @@ bool sbp_msg_tracking_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_t *msg); +bool sbp_msg_tracking_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_tracking_state_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -107,7 +115,8 @@ bool sbp_msg_tracking_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_track * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_measurement_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_measurement_state_t *msg); +bool sbp_measurement_state_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_measurement_state_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -116,7 +125,8 @@ bool sbp_measurement_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_meas * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_measurement_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_measurement_state_t *msg); +bool sbp_measurement_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_measurement_state_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -125,7 +135,8 @@ bool sbp_measurement_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_measuremen * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_measurement_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_measurement_state_t *msg); +bool sbp_msg_measurement_state_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_measurement_state_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -134,7 +145,8 @@ bool sbp_msg_measurement_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_measurement_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_measurement_state_t *msg); +bool sbp_msg_measurement_state_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_measurement_state_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -143,7 +155,8 @@ bool sbp_msg_measurement_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_me * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_tracking_channel_correlation_encode_internal(sbp_encode_ctx_t *ctx, const sbp_tracking_channel_correlation_t *msg); +bool sbp_tracking_channel_correlation_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_tracking_channel_correlation_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -152,7 +165,8 @@ bool sbp_tracking_channel_correlation_encode_internal(sbp_encode_ctx_t *ctx, con * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_tracking_channel_correlation_decode_internal(sbp_decode_ctx_t *ctx, sbp_tracking_channel_correlation_t *msg); +bool sbp_tracking_channel_correlation_decode_internal( + sbp_decode_ctx_t *ctx, sbp_tracking_channel_correlation_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -161,7 +175,8 @@ bool sbp_tracking_channel_correlation_decode_internal(sbp_decode_ctx_t *ctx, sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_iq_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_iq_t *msg); +bool sbp_msg_tracking_iq_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_tracking_iq_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -170,7 +185,8 @@ bool sbp_msg_tracking_iq_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tr * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_iq_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_iq_t *msg); +bool sbp_msg_tracking_iq_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_tracking_iq_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -179,7 +195,8 @@ bool sbp_msg_tracking_iq_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_tracking_channel_correlation_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_tracking_channel_correlation_dep_t *msg); +bool sbp_tracking_channel_correlation_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_tracking_channel_correlation_dep_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -188,7 +205,8 @@ bool sbp_tracking_channel_correlation_dep_encode_internal(sbp_encode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_tracking_channel_correlation_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_tracking_channel_correlation_dep_t *msg); +bool sbp_tracking_channel_correlation_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_tracking_channel_correlation_dep_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -197,7 +215,8 @@ bool sbp_tracking_channel_correlation_dep_decode_internal(sbp_decode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_iq_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_iq_dep_b_t *msg); +bool sbp_msg_tracking_iq_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_tracking_iq_dep_b_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -206,7 +225,8 @@ bool sbp_msg_tracking_iq_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_iq_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_iq_dep_b_t *msg); +bool sbp_msg_tracking_iq_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_tracking_iq_dep_b_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -215,7 +235,8 @@ bool sbp_msg_tracking_iq_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tr * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_iq_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_iq_dep_a_t *msg); +bool sbp_msg_tracking_iq_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_tracking_iq_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -224,7 +245,8 @@ bool sbp_msg_tracking_iq_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_iq_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_iq_dep_a_t *msg); +bool sbp_msg_tracking_iq_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_tracking_iq_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -233,7 +255,8 @@ bool sbp_msg_tracking_iq_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tr * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_tracking_channel_state_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_tracking_channel_state_dep_a_t *msg); +bool sbp_tracking_channel_state_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_tracking_channel_state_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -242,7 +265,8 @@ bool sbp_tracking_channel_state_dep_a_encode_internal(sbp_encode_ctx_t *ctx, con * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_tracking_channel_state_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_tracking_channel_state_dep_a_t *msg); +bool sbp_tracking_channel_state_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_tracking_channel_state_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -251,7 +275,8 @@ bool sbp_tracking_channel_state_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_state_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_dep_a_t *msg); +bool sbp_msg_tracking_state_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -260,7 +285,8 @@ bool sbp_msg_tracking_state_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_state_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_dep_a_t *msg); +bool sbp_msg_tracking_state_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -269,7 +295,8 @@ bool sbp_msg_tracking_state_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_tracking_channel_state_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_tracking_channel_state_dep_b_t *msg); +bool sbp_tracking_channel_state_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_tracking_channel_state_dep_b_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -278,7 +305,8 @@ bool sbp_tracking_channel_state_dep_b_encode_internal(sbp_encode_ctx_t *ctx, con * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_tracking_channel_state_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_tracking_channel_state_dep_b_t *msg); +bool sbp_tracking_channel_state_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_tracking_channel_state_dep_b_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -287,7 +315,8 @@ bool sbp_tracking_channel_state_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_state_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_dep_b_t *msg); +bool sbp_msg_tracking_state_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_dep_b_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -296,10 +325,11 @@ bool sbp_msg_tracking_state_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const s * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_tracking_state_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_dep_b_t *msg); +bool sbp_msg_tracking_state_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_dep_b_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_TRACKING_H */ diff --git a/c/src/include/libsbp/internal/user.h b/c/src/include/libsbp/internal/user.h index 3851d713d..238d7517d 100644 --- a/c/src/include/libsbp/internal/user.h +++ b/c/src/include/libsbp/internal/user.h @@ -20,11 +20,11 @@ #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_user_data_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_user_data_t *msg); +bool sbp_msg_user_data_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_user_data_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -43,10 +44,11 @@ bool sbp_msg_user_data_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_user * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_user_data_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_user_data_t *msg); +bool sbp_msg_user_data_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_user_data_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_USER_H */ diff --git a/c/src/include/libsbp/internal/vehicle.h b/c/src/include/libsbp/internal/vehicle.h index fc4edcf19..000931f14 100644 --- a/c/src/include/libsbp/internal/vehicle.h +++ b/c/src/include/libsbp/internal/vehicle.h @@ -20,11 +20,11 @@ #include -#include #include +#include #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -34,7 +34,8 @@ * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_odometry_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_odometry_t *msg); +bool sbp_msg_odometry_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_odometry_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -43,7 +44,8 @@ bool sbp_msg_odometry_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_odome * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_odometry_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_odometry_t *msg); +bool sbp_msg_odometry_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_odometry_t *msg); /** * Internal function to encode an SBP type to a buffer @@ -52,7 +54,8 @@ bool sbp_msg_odometry_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_odometry_t * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_wheeltick_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_wheeltick_t *msg); +bool sbp_msg_wheeltick_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_wheeltick_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -61,10 +64,11 @@ bool sbp_msg_wheeltick_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_whee * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_wheeltick_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_wheeltick_t *msg); +bool sbp_msg_wheeltick_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_wheeltick_t *msg); #ifdef __cplusplus - } +} #endif #endif /* LIBSBP_INTERNAL_V4_VEHICLE_H */ diff --git a/c/src/integrity.c b/c/src/integrity.c index 4b67764dd..3c1ae4ec7 100644 --- a/c/src/integrity.c +++ b/c/src/integrity.c @@ -3,33 +3,49 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include -#include #include +#include #include +#include +#include #include #include -#include #include +#include -bool sbp_integrity_ssr_header_encode_internal(sbp_encode_ctx_t *ctx, const sbp_integrity_ssr_header_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->obs_time)) { return false; } - if (!sbp_u8_encode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u8_encode(ctx, &msg->seq_num)) { return false; } - if (!sbp_u8_encode(ctx, &msg->ssr_sol_id)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tile_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->chain_id)) { return false; } +bool sbp_integrity_ssr_header_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_integrity_ssr_header_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->obs_time)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->seq_num)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->ssr_sol_id)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->chain_id)) { + return false; + } return true; } -s8 sbp_integrity_ssr_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_integrity_ssr_header_t *msg) { +s8 sbp_integrity_ssr_header_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_integrity_ssr_header_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -43,19 +59,35 @@ s8 sbp_integrity_ssr_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written return SBP_OK; } -bool sbp_integrity_ssr_header_decode_internal(sbp_decode_ctx_t *ctx, sbp_integrity_ssr_header_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->obs_time)) { return false; } - if (!sbp_u8_decode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u8_decode(ctx, &msg->seq_num)) { return false; } - if (!sbp_u8_decode(ctx, &msg->ssr_sol_id)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tile_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->chain_id)) { return false; } +bool sbp_integrity_ssr_header_decode_internal(sbp_decode_ctx_t *ctx, + sbp_integrity_ssr_header_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->obs_time)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->seq_num)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->ssr_sol_id)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->chain_id)) { + return false; + } return true; } -s8 sbp_integrity_ssr_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_integrity_ssr_header_t *msg) { +s8 sbp_integrity_ssr_header_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_integrity_ssr_header_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -69,57 +101,99 @@ s8 sbp_integrity_ssr_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r return SBP_OK; } - - -int sbp_integrity_ssr_header_cmp(const sbp_integrity_ssr_header_t *a, const sbp_integrity_ssr_header_t *b) { +int sbp_integrity_ssr_header_cmp(const sbp_integrity_ssr_header_t *a, + const sbp_integrity_ssr_header_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->obs_time, &b->obs_time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->num_msgs, &b->num_msgs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->seq_num, &b->seq_num); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->ssr_sol_id, &b->ssr_sol_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tile_set_id, &b->tile_set_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tile_id, &b->tile_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->chain_id, &b->chain_id); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_flag_high_level_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_high_level_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->obs_time)) { return false; } - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->corr_time)) { return false; } - if (!sbp_u8_encode(ctx, &msg->ssr_sol_id)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tile_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->chain_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->use_gps_sat)) { return false; } - if (!sbp_u8_encode(ctx, &msg->use_gal_sat)) { return false; } - if (!sbp_u8_encode(ctx, &msg->use_bds_sat)) { return false; } - for (size_t i = 0; i < SBP_MSG_SSR_FLAG_HIGH_LEVEL_RESERVED_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->reserved[i])) { return false; } - } - if (!sbp_u8_encode(ctx, &msg->use_tropo_grid_points)) { return false; } - if (!sbp_u8_encode(ctx, &msg->use_iono_grid_points)) { return false; } - if (!sbp_u8_encode(ctx, &msg->use_iono_tile_sat_los)) { return false; } - if (!sbp_u8_encode(ctx, &msg->use_iono_grid_point_sat_los)) { return false; } +bool sbp_msg_ssr_flag_high_level_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_high_level_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->obs_time)) { + return false; + } + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->corr_time)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->ssr_sol_id)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->chain_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->use_gps_sat)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->use_gal_sat)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->use_bds_sat)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_SSR_FLAG_HIGH_LEVEL_RESERVED_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->reserved[i])) { + return false; + } + } + if (!sbp_u8_encode(ctx, &msg->use_tropo_grid_points)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->use_iono_grid_points)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->use_iono_tile_sat_los)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->use_iono_grid_point_sat_los)) { + return false; + } return true; } -s8 sbp_msg_ssr_flag_high_level_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_high_level_t *msg) { +s8 sbp_msg_ssr_flag_high_level_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_high_level_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -133,28 +207,58 @@ s8 sbp_msg_ssr_flag_high_level_encode(uint8_t *buf, uint8_t len, uint8_t *n_writ return SBP_OK; } -bool sbp_msg_ssr_flag_high_level_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_high_level_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->obs_time)) { return false; } - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->corr_time)) { return false; } - if (!sbp_u8_decode(ctx, &msg->ssr_sol_id)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tile_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->chain_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->use_gps_sat)) { return false; } - if (!sbp_u8_decode(ctx, &msg->use_gal_sat)) { return false; } - if (!sbp_u8_decode(ctx, &msg->use_bds_sat)) { return false; } +bool sbp_msg_ssr_flag_high_level_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_high_level_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->obs_time)) { + return false; + } + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->corr_time)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->ssr_sol_id)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->chain_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->use_gps_sat)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->use_gal_sat)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->use_bds_sat)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_SSR_FLAG_HIGH_LEVEL_RESERVED_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->reserved[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->reserved[i])) { + return false; + } + } + if (!sbp_u8_decode(ctx, &msg->use_tropo_grid_points)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->use_iono_grid_points)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->use_iono_tile_sat_los)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->use_iono_grid_point_sat_los)) { + return false; } - if (!sbp_u8_decode(ctx, &msg->use_tropo_grid_points)) { return false; } - if (!sbp_u8_decode(ctx, &msg->use_iono_grid_points)) { return false; } - if (!sbp_u8_decode(ctx, &msg->use_iono_tile_sat_los)) { return false; } - if (!sbp_u8_decode(ctx, &msg->use_iono_grid_point_sat_los)) { return false; } return true; } -s8 sbp_msg_ssr_flag_high_level_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_high_level_t *msg) { +s8 sbp_msg_ssr_flag_high_level_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ssr_flag_high_level_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -168,83 +272,134 @@ s8 sbp_msg_ssr_flag_high_level_decode(const uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } - -s8 sbp_msg_ssr_flag_high_level_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_flag_high_level_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_flag_high_level_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_flag_high_level_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_flag_high_level_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_FLAG_HIGH_LEVEL, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_flag_high_level_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_FLAG_HIGH_LEVEL, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_flag_high_level_cmp(const sbp_msg_ssr_flag_high_level_t *a, const sbp_msg_ssr_flag_high_level_t *b) { +int sbp_msg_ssr_flag_high_level_cmp(const sbp_msg_ssr_flag_high_level_t *a, + const sbp_msg_ssr_flag_high_level_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->obs_time, &b->obs_time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_sec_cmp(&a->corr_time, &b->corr_time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->ssr_sol_id, &b->ssr_sol_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tile_set_id, &b->tile_set_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tile_id, &b->tile_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->chain_id, &b->chain_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->use_gps_sat, &b->use_gps_sat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->use_gal_sat, &b->use_gal_sat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->use_bds_sat, &b->use_bds_sat); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_SSR_FLAG_HIGH_LEVEL_RESERVED_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_SSR_FLAG_HIGH_LEVEL_RESERVED_MAX; + i++) { ret = sbp_u8_cmp(&a->reserved[i], &b->reserved[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->use_tropo_grid_points, &b->use_tropo_grid_points); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->use_iono_grid_points, &b->use_iono_grid_points); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->use_iono_tile_sat_los, &b->use_iono_tile_sat_los); - if (ret != 0) { return ret; } - - ret = sbp_u8_cmp(&a->use_iono_grid_point_sat_los, &b->use_iono_grid_point_sat_los); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } + + ret = sbp_u8_cmp(&a->use_iono_grid_point_sat_los, + &b->use_iono_grid_point_sat_los); + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_flag_satellites_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_satellites_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->obs_time)) { return false; } - if (!sbp_u8_encode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u8_encode(ctx, &msg->seq_num)) { return false; } - if (!sbp_u8_encode(ctx, &msg->ssr_sol_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->chain_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->const_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_faulty_sats)) { return false; } - for (size_t i = 0; i < msg->n_faulty_sats; i++) - { - if (!sbp_u8_encode(ctx, &msg->faulty_sats[i])) { return false; } +bool sbp_msg_ssr_flag_satellites_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_satellites_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->obs_time)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->seq_num)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->ssr_sol_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->chain_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->const_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_faulty_sats)) { + return false; + } + for (size_t i = 0; i < msg->n_faulty_sats; i++) { + if (!sbp_u8_encode(ctx, &msg->faulty_sats[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_flag_satellites_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_satellites_t *msg) { +s8 sbp_msg_ssr_flag_satellites_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_satellites_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -258,26 +413,45 @@ s8 sbp_msg_ssr_flag_satellites_encode(uint8_t *buf, uint8_t len, uint8_t *n_writ return SBP_OK; } -bool sbp_msg_ssr_flag_satellites_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_satellites_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->obs_time)) { return false; } - if (!sbp_u8_decode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u8_decode(ctx, &msg->seq_num)) { return false; } - if (!sbp_u8_decode(ctx, &msg->ssr_sol_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->chain_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->const_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_faulty_sats)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { +bool sbp_msg_ssr_flag_satellites_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_satellites_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->obs_time)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->seq_num)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->ssr_sol_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->chain_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->const_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_faulty_sats)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + return false; + } + msg->n_faulty_sats = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->n_faulty_sats; i++) { + if (!sbp_u8_decode(ctx, &msg->faulty_sats[i])) { return false; } - msg->n_faulty_sats = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); - for (uint8_t i = 0; i < msg->n_faulty_sats; i++) { - if (!sbp_u8_decode(ctx, &msg->faulty_sats[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_flag_satellites_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_satellites_t *msg) { +s8 sbp_msg_ssr_flag_satellites_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ssr_flag_satellites_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -291,61 +465,88 @@ s8 sbp_msg_ssr_flag_satellites_decode(const uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } - -s8 sbp_msg_ssr_flag_satellites_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_flag_satellites_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_flag_satellites_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_flag_satellites_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_flag_satellites_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_FLAG_SATELLITES, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_flag_satellites_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_FLAG_SATELLITES, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_flag_satellites_cmp(const sbp_msg_ssr_flag_satellites_t *a, const sbp_msg_ssr_flag_satellites_t *b) { +int sbp_msg_ssr_flag_satellites_cmp(const sbp_msg_ssr_flag_satellites_t *a, + const sbp_msg_ssr_flag_satellites_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->obs_time, &b->obs_time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->num_msgs, &b->num_msgs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->seq_num, &b->seq_num); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->ssr_sol_id, &b->ssr_sol_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->chain_id, &b->chain_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->const_id, &b->const_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_faulty_sats, &b->n_faulty_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_faulty_sats, &b->n_faulty_sats); - for (uint8_t i = 0; ret == 0 && i < a->n_faulty_sats; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_faulty_sats; i++) { ret = sbp_u8_cmp(&a->faulty_sats[i], &b->faulty_sats[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_flag_tropo_grid_points_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_tropo_grid_points_t *msg) -{ - if (!sbp_integrity_ssr_header_encode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_faulty_points)) { return false; } - for (size_t i = 0; i < msg->n_faulty_points; i++) - { - if (!sbp_u16_encode(ctx, &msg->faulty_points[i])) { return false; } +bool sbp_msg_ssr_flag_tropo_grid_points_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_tropo_grid_points_t *msg) { + if (!sbp_integrity_ssr_header_encode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_faulty_points)) { + return false; + } + for (size_t i = 0; i < msg->n_faulty_points; i++) { + if (!sbp_u16_encode(ctx, &msg->faulty_points[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_flag_tropo_grid_points_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_tropo_grid_points_t *msg) { +s8 sbp_msg_ssr_flag_tropo_grid_points_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_tropo_grid_points_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -359,21 +560,30 @@ s8 sbp_msg_ssr_flag_tropo_grid_points_encode(uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } -bool sbp_msg_ssr_flag_tropo_grid_points_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_tropo_grid_points_t *msg) -{ - if (!sbp_integrity_ssr_header_decode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_faulty_points)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U16) != 0) { +bool sbp_msg_ssr_flag_tropo_grid_points_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_tropo_grid_points_t *msg) { + if (!sbp_integrity_ssr_header_decode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_faulty_points)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U16) != 0) { + return false; + } + msg->n_faulty_points = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U16); + for (uint8_t i = 0; i < msg->n_faulty_points; i++) { + if (!sbp_u16_decode(ctx, &msg->faulty_points[i])) { return false; } - msg->n_faulty_points = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U16); - for (uint8_t i = 0; i < msg->n_faulty_points; i++) { - if (!sbp_u16_decode(ctx, &msg->faulty_points[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_flag_tropo_grid_points_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_tropo_grid_points_t *msg) { +s8 sbp_msg_ssr_flag_tropo_grid_points_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_tropo_grid_points_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -387,46 +597,64 @@ s8 sbp_msg_ssr_flag_tropo_grid_points_decode(const uint8_t *buf, uint8_t len, ui return SBP_OK; } - -s8 sbp_msg_ssr_flag_tropo_grid_points_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_flag_tropo_grid_points_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_flag_tropo_grid_points_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_flag_tropo_grid_points_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_flag_tropo_grid_points_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_FLAG_TROPO_GRID_POINTS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_flag_tropo_grid_points_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_FLAG_TROPO_GRID_POINTS, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_flag_tropo_grid_points_cmp(const sbp_msg_ssr_flag_tropo_grid_points_t *a, const sbp_msg_ssr_flag_tropo_grid_points_t *b) { +int sbp_msg_ssr_flag_tropo_grid_points_cmp( + const sbp_msg_ssr_flag_tropo_grid_points_t *a, + const sbp_msg_ssr_flag_tropo_grid_points_t *b) { int ret = 0; - + ret = sbp_integrity_ssr_header_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_faulty_points, &b->n_faulty_points); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_faulty_points, &b->n_faulty_points); - for (uint8_t i = 0; ret == 0 && i < a->n_faulty_points; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_faulty_points; i++) { ret = sbp_u16_cmp(&a->faulty_points[i], &b->faulty_points[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_flag_iono_grid_points_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_iono_grid_points_t *msg) -{ - if (!sbp_integrity_ssr_header_encode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_faulty_points)) { return false; } - for (size_t i = 0; i < msg->n_faulty_points; i++) - { - if (!sbp_u16_encode(ctx, &msg->faulty_points[i])) { return false; } +bool sbp_msg_ssr_flag_iono_grid_points_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_iono_grid_points_t *msg) { + if (!sbp_integrity_ssr_header_encode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_faulty_points)) { + return false; + } + for (size_t i = 0; i < msg->n_faulty_points; i++) { + if (!sbp_u16_encode(ctx, &msg->faulty_points[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_flag_iono_grid_points_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_iono_grid_points_t *msg) { +s8 sbp_msg_ssr_flag_iono_grid_points_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_iono_grid_points_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -440,21 +668,30 @@ s8 sbp_msg_ssr_flag_iono_grid_points_encode(uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } -bool sbp_msg_ssr_flag_iono_grid_points_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_iono_grid_points_t *msg) -{ - if (!sbp_integrity_ssr_header_decode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_faulty_points)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U16) != 0) { +bool sbp_msg_ssr_flag_iono_grid_points_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_iono_grid_points_t *msg) { + if (!sbp_integrity_ssr_header_decode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_faulty_points)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U16) != 0) { + return false; + } + msg->n_faulty_points = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U16); + for (uint8_t i = 0; i < msg->n_faulty_points; i++) { + if (!sbp_u16_decode(ctx, &msg->faulty_points[i])) { return false; } - msg->n_faulty_points = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U16); - for (uint8_t i = 0; i < msg->n_faulty_points; i++) { - if (!sbp_u16_decode(ctx, &msg->faulty_points[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_flag_iono_grid_points_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_iono_grid_points_t *msg) { +s8 sbp_msg_ssr_flag_iono_grid_points_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_iono_grid_points_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -468,46 +705,64 @@ s8 sbp_msg_ssr_flag_iono_grid_points_decode(const uint8_t *buf, uint8_t len, uin return SBP_OK; } - -s8 sbp_msg_ssr_flag_iono_grid_points_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_flag_iono_grid_points_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_flag_iono_grid_points_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_flag_iono_grid_points_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_flag_iono_grid_points_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_FLAG_IONO_GRID_POINTS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_flag_iono_grid_points_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_FLAG_IONO_GRID_POINTS, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_flag_iono_grid_points_cmp(const sbp_msg_ssr_flag_iono_grid_points_t *a, const sbp_msg_ssr_flag_iono_grid_points_t *b) { +int sbp_msg_ssr_flag_iono_grid_points_cmp( + const sbp_msg_ssr_flag_iono_grid_points_t *a, + const sbp_msg_ssr_flag_iono_grid_points_t *b) { int ret = 0; - + ret = sbp_integrity_ssr_header_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_faulty_points, &b->n_faulty_points); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_faulty_points, &b->n_faulty_points); - for (uint8_t i = 0; ret == 0 && i < a->n_faulty_points; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_faulty_points; i++) { ret = sbp_u16_cmp(&a->faulty_points[i], &b->faulty_points[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_flag_iono_tile_sat_los_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_iono_tile_sat_los_t *msg) -{ - if (!sbp_integrity_ssr_header_encode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_faulty_los)) { return false; } - for (size_t i = 0; i < msg->n_faulty_los; i++) - { - if (!sbp_sv_id_encode_internal(ctx, &msg->faulty_los[i])) { return false; } +bool sbp_msg_ssr_flag_iono_tile_sat_los_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_iono_tile_sat_los_t *msg) { + if (!sbp_integrity_ssr_header_encode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_faulty_los)) { + return false; + } + for (size_t i = 0; i < msg->n_faulty_los; i++) { + if (!sbp_sv_id_encode_internal(ctx, &msg->faulty_los[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_flag_iono_tile_sat_los_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_iono_tile_sat_los_t *msg) { +s8 sbp_msg_ssr_flag_iono_tile_sat_los_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_iono_tile_sat_los_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -521,21 +776,30 @@ s8 sbp_msg_ssr_flag_iono_tile_sat_los_encode(uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } -bool sbp_msg_ssr_flag_iono_tile_sat_los_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_iono_tile_sat_los_t *msg) -{ - if (!sbp_integrity_ssr_header_decode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_faulty_los)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_SV_ID_ENCODED_LEN) != 0) { +bool sbp_msg_ssr_flag_iono_tile_sat_los_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_iono_tile_sat_los_t *msg) { + if (!sbp_integrity_ssr_header_decode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_faulty_los)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_SV_ID_ENCODED_LEN) != 0) { + return false; + } + msg->n_faulty_los = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_SV_ID_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_faulty_los; i++) { + if (!sbp_sv_id_decode_internal(ctx, &msg->faulty_los[i])) { return false; } - msg->n_faulty_los = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_SV_ID_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_faulty_los; i++) { - if (!sbp_sv_id_decode_internal(ctx, &msg->faulty_los[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_flag_iono_tile_sat_los_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_iono_tile_sat_los_t *msg) { +s8 sbp_msg_ssr_flag_iono_tile_sat_los_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_iono_tile_sat_los_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -549,47 +813,68 @@ s8 sbp_msg_ssr_flag_iono_tile_sat_los_decode(const uint8_t *buf, uint8_t len, ui return SBP_OK; } - -s8 sbp_msg_ssr_flag_iono_tile_sat_los_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_flag_iono_tile_sat_los_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_flag_iono_tile_sat_los_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_flag_iono_tile_sat_los_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_flag_iono_tile_sat_los_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_FLAG_IONO_TILE_SAT_LOS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_flag_iono_tile_sat_los_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_FLAG_IONO_TILE_SAT_LOS, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_flag_iono_tile_sat_los_cmp(const sbp_msg_ssr_flag_iono_tile_sat_los_t *a, const sbp_msg_ssr_flag_iono_tile_sat_los_t *b) { +int sbp_msg_ssr_flag_iono_tile_sat_los_cmp( + const sbp_msg_ssr_flag_iono_tile_sat_los_t *a, + const sbp_msg_ssr_flag_iono_tile_sat_los_t *b) { int ret = 0; - + ret = sbp_integrity_ssr_header_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_faulty_los, &b->n_faulty_los); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_faulty_los, &b->n_faulty_los); - for (uint8_t i = 0; ret == 0 && i < a->n_faulty_los; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_faulty_los; i++) { ret = sbp_sv_id_cmp(&a->faulty_los[i], &b->faulty_los[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_flag_iono_grid_point_sat_los_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg) -{ - if (!sbp_integrity_ssr_header_encode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u16_encode(ctx, &msg->grid_point_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_faulty_los)) { return false; } - for (size_t i = 0; i < msg->n_faulty_los; i++) - { - if (!sbp_sv_id_encode_internal(ctx, &msg->faulty_los[i])) { return false; } +bool sbp_msg_ssr_flag_iono_grid_point_sat_los_encode_internal( + sbp_encode_ctx_t *ctx, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg) { + if (!sbp_integrity_ssr_header_encode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->grid_point_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_faulty_los)) { + return false; + } + for (size_t i = 0; i < msg->n_faulty_los; i++) { + if (!sbp_sv_id_encode_internal(ctx, &msg->faulty_los[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_flag_iono_grid_point_sat_los_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg) { +s8 sbp_msg_ssr_flag_iono_grid_point_sat_los_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -603,22 +888,33 @@ s8 sbp_msg_ssr_flag_iono_grid_point_sat_los_encode(uint8_t *buf, uint8_t len, ui return SBP_OK; } -bool sbp_msg_ssr_flag_iono_grid_point_sat_los_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg) -{ - if (!sbp_integrity_ssr_header_decode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u16_decode(ctx, &msg->grid_point_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_faulty_los)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_SV_ID_ENCODED_LEN) != 0) { +bool sbp_msg_ssr_flag_iono_grid_point_sat_los_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg) { + if (!sbp_integrity_ssr_header_decode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->grid_point_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_faulty_los)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_SV_ID_ENCODED_LEN) != 0) { + return false; + } + msg->n_faulty_los = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_SV_ID_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_faulty_los; i++) { + if (!sbp_sv_id_decode_internal(ctx, &msg->faulty_los[i])) { return false; } - msg->n_faulty_los = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_SV_ID_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_faulty_los; i++) { - if (!sbp_sv_id_decode_internal(ctx, &msg->faulty_los[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_flag_iono_grid_point_sat_los_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg) { +s8 sbp_msg_ssr_flag_iono_grid_point_sat_los_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -632,49 +928,76 @@ s8 sbp_msg_ssr_flag_iono_grid_point_sat_los_decode(const uint8_t *buf, uint8_t l return SBP_OK; } - -s8 sbp_msg_ssr_flag_iono_grid_point_sat_los_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_flag_iono_grid_point_sat_los_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_flag_iono_grid_point_sat_los_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_flag_iono_grid_point_sat_los_encode( + payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS, + sender_id, payload_len, payload, write); } -int sbp_msg_ssr_flag_iono_grid_point_sat_los_cmp(const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *a, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *b) { +int sbp_msg_ssr_flag_iono_grid_point_sat_los_cmp( + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *a, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t *b) { int ret = 0; - + ret = sbp_integrity_ssr_header_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->grid_point_id, &b->grid_point_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_faulty_los, &b->n_faulty_los); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_faulty_los, &b->n_faulty_los); - for (uint8_t i = 0; ret == 0 && i < a->n_faulty_los; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_faulty_los; i++) { ret = sbp_sv_id_cmp(&a->faulty_los[i], &b->faulty_los[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_acknowledge_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_acknowledge_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->request_id)) { return false; } - if (!sbp_u32_encode(ctx, &msg->area_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->response_code)) { return false; } - if (!sbp_u16_encode(ctx, &msg->correction_mask_on_demand)) { return false; } - if (!sbp_u16_encode(ctx, &msg->correction_mask_stream)) { return false; } - if (!sbp_u8_encode(ctx, &msg->solution_id)) { return false; } +bool sbp_msg_acknowledge_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_acknowledge_t *msg) { + if (!sbp_u8_encode(ctx, &msg->request_id)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->area_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->response_code)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->correction_mask_on_demand)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->correction_mask_stream)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->solution_id)) { + return false; + } return true; } -s8 sbp_msg_acknowledge_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_acknowledge_t *msg) { +s8 sbp_msg_acknowledge_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_acknowledge_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -688,18 +1011,31 @@ s8 sbp_msg_acknowledge_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, con return SBP_OK; } -bool sbp_msg_acknowledge_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_acknowledge_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->request_id)) { return false; } - if (!sbp_u32_decode(ctx, &msg->area_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->response_code)) { return false; } - if (!sbp_u16_decode(ctx, &msg->correction_mask_on_demand)) { return false; } - if (!sbp_u16_decode(ctx, &msg->correction_mask_stream)) { return false; } - if (!sbp_u8_decode(ctx, &msg->solution_id)) { return false; } +bool sbp_msg_acknowledge_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_acknowledge_t *msg) { + if (!sbp_u8_decode(ctx, &msg->request_id)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->area_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->response_code)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->correction_mask_on_demand)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->correction_mask_stream)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->solution_id)) { + return false; + } return true; } -s8 sbp_msg_acknowledge_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_acknowledge_t *msg) { +s8 sbp_msg_acknowledge_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_acknowledge_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -713,35 +1049,53 @@ s8 sbp_msg_acknowledge_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_acknowledge_send(sbp_state_t *s, u16 sender_id, const sbp_msg_acknowledge_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_acknowledge_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_acknowledge_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_acknowledge_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ACKNOWLEDGE, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_acknowledge_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ACKNOWLEDGE, sender_id, payload_len, + payload, write); } -int sbp_msg_acknowledge_cmp(const sbp_msg_acknowledge_t *a, const sbp_msg_acknowledge_t *b) { +int sbp_msg_acknowledge_cmp(const sbp_msg_acknowledge_t *a, + const sbp_msg_acknowledge_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->request_id, &b->request_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->area_id, &b->area_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->response_code, &b->response_code); - if (ret != 0) { return ret; } - - ret = sbp_u16_cmp(&a->correction_mask_on_demand, &b->correction_mask_on_demand); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + + ret = + sbp_u16_cmp(&a->correction_mask_on_demand, &b->correction_mask_on_demand); + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->correction_mask_stream, &b->correction_mask_stream); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->solution_id, &b->solution_id); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/linux.c b/c/src/linux.c index 16f8afdd1..2d214535b 100644 --- a/c/src/linux.c +++ b/c/src/linux.c @@ -3,107 +3,143 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include #include +#include +#include #include #include -#include #include +#include +#include -void sbp_msg_linux_cpu_state_dep_a_cmdline_init(sbp_msg_linux_cpu_state_dep_a_t *msg) -{ +void sbp_msg_linux_cpu_state_dep_a_cmdline_init( + sbp_msg_linux_cpu_state_dep_a_t *msg) { sbp_unterminated_string_init(&msg->cmdline); } -bool sbp_msg_linux_cpu_state_dep_a_cmdline_valid(const sbp_msg_linux_cpu_state_dep_a_t *msg) -{ - return sbp_unterminated_string_valid(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX); +bool sbp_msg_linux_cpu_state_dep_a_cmdline_valid( + const sbp_msg_linux_cpu_state_dep_a_t *msg) { + return sbp_unterminated_string_valid( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX); } -int sbp_msg_linux_cpu_state_dep_a_cmdline_strcmp(const sbp_msg_linux_cpu_state_dep_a_t *a, const sbp_msg_linux_cpu_state_dep_a_t *b) -{ - return sbp_unterminated_string_strcmp(&a->cmdline, &b->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX); +int sbp_msg_linux_cpu_state_dep_a_cmdline_strcmp( + const sbp_msg_linux_cpu_state_dep_a_t *a, + const sbp_msg_linux_cpu_state_dep_a_t *b) { + return sbp_unterminated_string_strcmp( + &a->cmdline, &b->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX); } -size_t sbp_msg_linux_cpu_state_dep_a_cmdline_encoded_len(const sbp_msg_linux_cpu_state_dep_a_t *msg) -{ - return sbp_unterminated_string_encoded_len(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX); +size_t sbp_msg_linux_cpu_state_dep_a_cmdline_encoded_len( + const sbp_msg_linux_cpu_state_dep_a_t *msg) { + return sbp_unterminated_string_encoded_len( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX); } -size_t sbp_msg_linux_cpu_state_dep_a_cmdline_space_remaining(const sbp_msg_linux_cpu_state_dep_a_t *msg) -{ - return sbp_unterminated_string_space_remaining(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX); +size_t sbp_msg_linux_cpu_state_dep_a_cmdline_space_remaining( + const sbp_msg_linux_cpu_state_dep_a_t *msg) { + return sbp_unterminated_string_space_remaining( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX); } - bool sbp_msg_linux_cpu_state_dep_a_cmdline_set(sbp_msg_linux_cpu_state_dep_a_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, should_trunc, n_written, new_str); +bool sbp_msg_linux_cpu_state_dep_a_cmdline_set( + sbp_msg_linux_cpu_state_dep_a_t *msg, const char *new_str, + bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set(&msg->cmdline, + SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_linux_cpu_state_dep_a_cmdline_set_raw(sbp_msg_linux_cpu_state_dep_a_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set_raw(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_linux_cpu_state_dep_a_cmdline_set_raw( + sbp_msg_linux_cpu_state_dep_a_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set_raw( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, should_trunc, + n_written, new_buf, new_buf_len); } - -bool sbp_msg_linux_cpu_state_dep_a_cmdline_printf(sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_linux_cpu_state_dep_a_cmdline_printf( + sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_vprintf(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_vprintf( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_linux_cpu_state_dep_a_cmdline_vprintf(sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_vprintf(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_linux_cpu_state_dep_a_cmdline_vprintf( + sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_vprintf( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); } -bool sbp_msg_linux_cpu_state_dep_a_cmdline_append_printf(sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_linux_cpu_state_dep_a_cmdline_append_printf( + sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_append_vprintf(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_append_vprintf( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_linux_cpu_state_dep_a_cmdline_append_vprintf(sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_append_vprintf(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_linux_cpu_state_dep_a_cmdline_append_vprintf( + sbp_msg_linux_cpu_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_append_vprintf( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); } -const char *sbp_msg_linux_cpu_state_dep_a_cmdline_get(const sbp_msg_linux_cpu_state_dep_a_t *msg) -{ - return sbp_unterminated_string_get(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX); +const char *sbp_msg_linux_cpu_state_dep_a_cmdline_get( + const sbp_msg_linux_cpu_state_dep_a_t *msg) { + return sbp_unterminated_string_get(&msg->cmdline, + SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX); } -size_t sbp_msg_linux_cpu_state_dep_a_cmdline_strlen(const sbp_msg_linux_cpu_state_dep_a_t *msg) -{ - return sbp_unterminated_string_strlen(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX); +size_t sbp_msg_linux_cpu_state_dep_a_cmdline_strlen( + const sbp_msg_linux_cpu_state_dep_a_t *msg) { + return sbp_unterminated_string_strlen( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX); } -bool sbp_msg_linux_cpu_state_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_cpu_state_dep_a_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->index)) { return false; } - if (!sbp_u16_encode(ctx, &msg->pid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->pcpu)) { return false; } - for (size_t i = 0; i < SBP_MSG_LINUX_CPU_STATE_DEP_A_TNAME_MAX; i++) - { - if (!sbp_char_encode(ctx, &msg->tname[i])) { return false; } +bool sbp_msg_linux_cpu_state_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_cpu_state_dep_a_t *msg) { + if (!sbp_u8_encode(ctx, &msg->index)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->pid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->pcpu)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_LINUX_CPU_STATE_DEP_A_TNAME_MAX; i++) { + if (!sbp_char_encode(ctx, &msg->tname[i])) { + return false; + } + } + if (!sbp_unterminated_string_encode( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, ctx)) { + return false; } - if (!sbp_unterminated_string_encode(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, ctx)) { return false; } return true; } -s8 sbp_msg_linux_cpu_state_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_cpu_state_dep_a_t *msg) { +s8 sbp_msg_linux_cpu_state_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_cpu_state_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -117,19 +153,32 @@ s8 sbp_msg_linux_cpu_state_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_wr return SBP_OK; } -bool sbp_msg_linux_cpu_state_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_cpu_state_dep_a_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->index)) { return false; } - if (!sbp_u16_decode(ctx, &msg->pid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->pcpu)) { return false; } +bool sbp_msg_linux_cpu_state_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_cpu_state_dep_a_t *msg) { + if (!sbp_u8_decode(ctx, &msg->index)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->pid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->pcpu)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_LINUX_CPU_STATE_DEP_A_TNAME_MAX; i++) { - if (!sbp_char_decode(ctx, &msg->tname[i])) { return false; } + if (!sbp_char_decode(ctx, &msg->tname[i])) { + return false; + } + } + if (!sbp_unterminated_string_decode( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, ctx)) { + return false; } - if (!sbp_unterminated_string_decode(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, ctx)) { return false; } return true; } -s8 sbp_msg_linux_cpu_state_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_cpu_state_dep_a_t *msg) { +s8 sbp_msg_linux_cpu_state_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_linux_cpu_state_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -143,126 +192,178 @@ s8 sbp_msg_linux_cpu_state_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_linux_cpu_state_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_cpu_state_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_linux_cpu_state_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_linux_cpu_state_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_linux_cpu_state_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_LINUX_CPU_STATE_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_linux_cpu_state_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_LINUX_CPU_STATE_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_linux_cpu_state_dep_a_cmp(const sbp_msg_linux_cpu_state_dep_a_t *a, const sbp_msg_linux_cpu_state_dep_a_t *b) { +int sbp_msg_linux_cpu_state_dep_a_cmp( + const sbp_msg_linux_cpu_state_dep_a_t *a, + const sbp_msg_linux_cpu_state_dep_a_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->index, &b->index); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->pid, &b->pid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->pcpu, &b->pcpu); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_LINUX_CPU_STATE_DEP_A_TNAME_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_LINUX_CPU_STATE_DEP_A_TNAME_MAX; + i++) { ret = sbp_char_cmp(&a->tname[i], &b->tname[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_linux_cpu_state_dep_a_cmdline_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_linux_mem_state_dep_a_cmdline_init(sbp_msg_linux_mem_state_dep_a_t *msg) -{ +void sbp_msg_linux_mem_state_dep_a_cmdline_init( + sbp_msg_linux_mem_state_dep_a_t *msg) { sbp_unterminated_string_init(&msg->cmdline); } -bool sbp_msg_linux_mem_state_dep_a_cmdline_valid(const sbp_msg_linux_mem_state_dep_a_t *msg) -{ - return sbp_unterminated_string_valid(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX); +bool sbp_msg_linux_mem_state_dep_a_cmdline_valid( + const sbp_msg_linux_mem_state_dep_a_t *msg) { + return sbp_unterminated_string_valid( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX); } -int sbp_msg_linux_mem_state_dep_a_cmdline_strcmp(const sbp_msg_linux_mem_state_dep_a_t *a, const sbp_msg_linux_mem_state_dep_a_t *b) -{ - return sbp_unterminated_string_strcmp(&a->cmdline, &b->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX); +int sbp_msg_linux_mem_state_dep_a_cmdline_strcmp( + const sbp_msg_linux_mem_state_dep_a_t *a, + const sbp_msg_linux_mem_state_dep_a_t *b) { + return sbp_unterminated_string_strcmp( + &a->cmdline, &b->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX); } -size_t sbp_msg_linux_mem_state_dep_a_cmdline_encoded_len(const sbp_msg_linux_mem_state_dep_a_t *msg) -{ - return sbp_unterminated_string_encoded_len(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX); +size_t sbp_msg_linux_mem_state_dep_a_cmdline_encoded_len( + const sbp_msg_linux_mem_state_dep_a_t *msg) { + return sbp_unterminated_string_encoded_len( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX); } -size_t sbp_msg_linux_mem_state_dep_a_cmdline_space_remaining(const sbp_msg_linux_mem_state_dep_a_t *msg) -{ - return sbp_unterminated_string_space_remaining(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX); +size_t sbp_msg_linux_mem_state_dep_a_cmdline_space_remaining( + const sbp_msg_linux_mem_state_dep_a_t *msg) { + return sbp_unterminated_string_space_remaining( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX); } - bool sbp_msg_linux_mem_state_dep_a_cmdline_set(sbp_msg_linux_mem_state_dep_a_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, should_trunc, n_written, new_str); +bool sbp_msg_linux_mem_state_dep_a_cmdline_set( + sbp_msg_linux_mem_state_dep_a_t *msg, const char *new_str, + bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set(&msg->cmdline, + SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_linux_mem_state_dep_a_cmdline_set_raw(sbp_msg_linux_mem_state_dep_a_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set_raw(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_linux_mem_state_dep_a_cmdline_set_raw( + sbp_msg_linux_mem_state_dep_a_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set_raw( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, should_trunc, + n_written, new_buf, new_buf_len); } - -bool sbp_msg_linux_mem_state_dep_a_cmdline_printf(sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_linux_mem_state_dep_a_cmdline_printf( + sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_vprintf(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_vprintf( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_linux_mem_state_dep_a_cmdline_vprintf(sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_vprintf(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_linux_mem_state_dep_a_cmdline_vprintf( + sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_vprintf( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); } -bool sbp_msg_linux_mem_state_dep_a_cmdline_append_printf(sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_linux_mem_state_dep_a_cmdline_append_printf( + sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_append_vprintf(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_append_vprintf( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_linux_mem_state_dep_a_cmdline_append_vprintf(sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_append_vprintf(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_linux_mem_state_dep_a_cmdline_append_vprintf( + sbp_msg_linux_mem_state_dep_a_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_append_vprintf( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); } -const char *sbp_msg_linux_mem_state_dep_a_cmdline_get(const sbp_msg_linux_mem_state_dep_a_t *msg) -{ - return sbp_unterminated_string_get(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX); +const char *sbp_msg_linux_mem_state_dep_a_cmdline_get( + const sbp_msg_linux_mem_state_dep_a_t *msg) { + return sbp_unterminated_string_get(&msg->cmdline, + SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX); } -size_t sbp_msg_linux_mem_state_dep_a_cmdline_strlen(const sbp_msg_linux_mem_state_dep_a_t *msg) -{ - return sbp_unterminated_string_strlen(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX); +size_t sbp_msg_linux_mem_state_dep_a_cmdline_strlen( + const sbp_msg_linux_mem_state_dep_a_t *msg) { + return sbp_unterminated_string_strlen( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX); } -bool sbp_msg_linux_mem_state_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_mem_state_dep_a_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->index)) { return false; } - if (!sbp_u16_encode(ctx, &msg->pid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->pmem)) { return false; } - for (size_t i = 0; i < SBP_MSG_LINUX_MEM_STATE_DEP_A_TNAME_MAX; i++) - { - if (!sbp_char_encode(ctx, &msg->tname[i])) { return false; } +bool sbp_msg_linux_mem_state_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_mem_state_dep_a_t *msg) { + if (!sbp_u8_encode(ctx, &msg->index)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->pid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->pmem)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_LINUX_MEM_STATE_DEP_A_TNAME_MAX; i++) { + if (!sbp_char_encode(ctx, &msg->tname[i])) { + return false; + } + } + if (!sbp_unterminated_string_encode( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, ctx)) { + return false; } - if (!sbp_unterminated_string_encode(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, ctx)) { return false; } return true; } -s8 sbp_msg_linux_mem_state_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_mem_state_dep_a_t *msg) { +s8 sbp_msg_linux_mem_state_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_mem_state_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -276,19 +377,32 @@ s8 sbp_msg_linux_mem_state_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_wr return SBP_OK; } -bool sbp_msg_linux_mem_state_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_mem_state_dep_a_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->index)) { return false; } - if (!sbp_u16_decode(ctx, &msg->pid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->pmem)) { return false; } +bool sbp_msg_linux_mem_state_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_mem_state_dep_a_t *msg) { + if (!sbp_u8_decode(ctx, &msg->index)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->pid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->pmem)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_LINUX_MEM_STATE_DEP_A_TNAME_MAX; i++) { - if (!sbp_char_decode(ctx, &msg->tname[i])) { return false; } + if (!sbp_char_decode(ctx, &msg->tname[i])) { + return false; + } + } + if (!sbp_unterminated_string_decode( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, ctx)) { + return false; } - if (!sbp_unterminated_string_decode(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, ctx)) { return false; } return true; } -s8 sbp_msg_linux_mem_state_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_mem_state_dep_a_t *msg) { +s8 sbp_msg_linux_mem_state_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_linux_mem_state_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -302,51 +416,81 @@ s8 sbp_msg_linux_mem_state_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_linux_mem_state_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_mem_state_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_linux_mem_state_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_linux_mem_state_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_linux_mem_state_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_LINUX_MEM_STATE_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_linux_mem_state_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_LINUX_MEM_STATE_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_linux_mem_state_dep_a_cmp(const sbp_msg_linux_mem_state_dep_a_t *a, const sbp_msg_linux_mem_state_dep_a_t *b) { +int sbp_msg_linux_mem_state_dep_a_cmp( + const sbp_msg_linux_mem_state_dep_a_t *a, + const sbp_msg_linux_mem_state_dep_a_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->index, &b->index); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->pid, &b->pid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->pmem, &b->pmem); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_LINUX_MEM_STATE_DEP_A_TNAME_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_LINUX_MEM_STATE_DEP_A_TNAME_MAX; + i++) { ret = sbp_char_cmp(&a->tname[i], &b->tname[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_linux_mem_state_dep_a_cmdline_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_linux_sys_state_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_sys_state_dep_a_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->mem_total)) { return false; } - if (!sbp_u8_encode(ctx, &msg->pcpu)) { return false; } - if (!sbp_u8_encode(ctx, &msg->pmem)) { return false; } - if (!sbp_u16_encode(ctx, &msg->procs_starting)) { return false; } - if (!sbp_u16_encode(ctx, &msg->procs_stopping)) { return false; } - if (!sbp_u16_encode(ctx, &msg->pid_count)) { return false; } +bool sbp_msg_linux_sys_state_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_sys_state_dep_a_t *msg) { + if (!sbp_u16_encode(ctx, &msg->mem_total)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->pcpu)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->pmem)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->procs_starting)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->procs_stopping)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->pid_count)) { + return false; + } return true; } -s8 sbp_msg_linux_sys_state_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_sys_state_dep_a_t *msg) { +s8 sbp_msg_linux_sys_state_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_sys_state_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -360,18 +504,32 @@ s8 sbp_msg_linux_sys_state_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_wr return SBP_OK; } -bool sbp_msg_linux_sys_state_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_sys_state_dep_a_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->mem_total)) { return false; } - if (!sbp_u8_decode(ctx, &msg->pcpu)) { return false; } - if (!sbp_u8_decode(ctx, &msg->pmem)) { return false; } - if (!sbp_u16_decode(ctx, &msg->procs_starting)) { return false; } - if (!sbp_u16_decode(ctx, &msg->procs_stopping)) { return false; } - if (!sbp_u16_decode(ctx, &msg->pid_count)) { return false; } +bool sbp_msg_linux_sys_state_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_sys_state_dep_a_t *msg) { + if (!sbp_u16_decode(ctx, &msg->mem_total)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->pcpu)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->pmem)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->procs_starting)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->procs_stopping)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->pid_count)) { + return false; + } return true; } -s8 sbp_msg_linux_sys_state_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_sys_state_dep_a_t *msg) { +s8 sbp_msg_linux_sys_state_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_linux_sys_state_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -385,124 +543,183 @@ s8 sbp_msg_linux_sys_state_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_linux_sys_state_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_sys_state_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_linux_sys_state_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_linux_sys_state_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_linux_sys_state_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_LINUX_SYS_STATE_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_linux_sys_state_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_LINUX_SYS_STATE_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_linux_sys_state_dep_a_cmp(const sbp_msg_linux_sys_state_dep_a_t *a, const sbp_msg_linux_sys_state_dep_a_t *b) { +int sbp_msg_linux_sys_state_dep_a_cmp( + const sbp_msg_linux_sys_state_dep_a_t *a, + const sbp_msg_linux_sys_state_dep_a_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->mem_total, &b->mem_total); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->pcpu, &b->pcpu); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->pmem, &b->pmem); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->procs_starting, &b->procs_starting); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->procs_stopping, &b->procs_stopping); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->pid_count, &b->pid_count); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_linux_process_socket_counts_cmdline_init(sbp_msg_linux_process_socket_counts_t *msg) -{ +void sbp_msg_linux_process_socket_counts_cmdline_init( + sbp_msg_linux_process_socket_counts_t *msg) { sbp_unterminated_string_init(&msg->cmdline); } -bool sbp_msg_linux_process_socket_counts_cmdline_valid(const sbp_msg_linux_process_socket_counts_t *msg) -{ - return sbp_unterminated_string_valid(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX); +bool sbp_msg_linux_process_socket_counts_cmdline_valid( + const sbp_msg_linux_process_socket_counts_t *msg) { + return sbp_unterminated_string_valid( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX); } -int sbp_msg_linux_process_socket_counts_cmdline_strcmp(const sbp_msg_linux_process_socket_counts_t *a, const sbp_msg_linux_process_socket_counts_t *b) -{ - return sbp_unterminated_string_strcmp(&a->cmdline, &b->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX); +int sbp_msg_linux_process_socket_counts_cmdline_strcmp( + const sbp_msg_linux_process_socket_counts_t *a, + const sbp_msg_linux_process_socket_counts_t *b) { + return sbp_unterminated_string_strcmp( + &a->cmdline, &b->cmdline, + SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX); } -size_t sbp_msg_linux_process_socket_counts_cmdline_encoded_len(const sbp_msg_linux_process_socket_counts_t *msg) -{ - return sbp_unterminated_string_encoded_len(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX); +size_t sbp_msg_linux_process_socket_counts_cmdline_encoded_len( + const sbp_msg_linux_process_socket_counts_t *msg) { + return sbp_unterminated_string_encoded_len( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX); } -size_t sbp_msg_linux_process_socket_counts_cmdline_space_remaining(const sbp_msg_linux_process_socket_counts_t *msg) -{ - return sbp_unterminated_string_space_remaining(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX); +size_t sbp_msg_linux_process_socket_counts_cmdline_space_remaining( + const sbp_msg_linux_process_socket_counts_t *msg) { + return sbp_unterminated_string_space_remaining( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX); } - bool sbp_msg_linux_process_socket_counts_cmdline_set(sbp_msg_linux_process_socket_counts_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, should_trunc, n_written, new_str); +bool sbp_msg_linux_process_socket_counts_cmdline_set( + sbp_msg_linux_process_socket_counts_t *msg, const char *new_str, + bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_linux_process_socket_counts_cmdline_set_raw(sbp_msg_linux_process_socket_counts_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set_raw(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_linux_process_socket_counts_cmdline_set_raw( + sbp_msg_linux_process_socket_counts_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set_raw( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, + should_trunc, n_written, new_buf, new_buf_len); } - -bool sbp_msg_linux_process_socket_counts_cmdline_printf(sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_linux_process_socket_counts_cmdline_printf( + sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_vprintf(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_vprintf( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, + should_trunc, n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_linux_process_socket_counts_cmdline_vprintf(sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_vprintf(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_linux_process_socket_counts_cmdline_vprintf( + sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) { + return sbp_unterminated_string_vprintf( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, + should_trunc, n_written, fmt, ap); } -bool sbp_msg_linux_process_socket_counts_cmdline_append_printf(sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_linux_process_socket_counts_cmdline_append_printf( + sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_append_vprintf(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_append_vprintf( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, + should_trunc, n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_linux_process_socket_counts_cmdline_append_vprintf(sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_append_vprintf(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_linux_process_socket_counts_cmdline_append_vprintf( + sbp_msg_linux_process_socket_counts_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) { + return sbp_unterminated_string_append_vprintf( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, + should_trunc, n_written, fmt, ap); } -const char *sbp_msg_linux_process_socket_counts_cmdline_get(const sbp_msg_linux_process_socket_counts_t *msg) -{ - return sbp_unterminated_string_get(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX); +const char *sbp_msg_linux_process_socket_counts_cmdline_get( + const sbp_msg_linux_process_socket_counts_t *msg) { + return sbp_unterminated_string_get( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX); } -size_t sbp_msg_linux_process_socket_counts_cmdline_strlen(const sbp_msg_linux_process_socket_counts_t *msg) -{ - return sbp_unterminated_string_strlen(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX); +size_t sbp_msg_linux_process_socket_counts_cmdline_strlen( + const sbp_msg_linux_process_socket_counts_t *msg) { + return sbp_unterminated_string_strlen( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX); } -bool sbp_msg_linux_process_socket_counts_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_socket_counts_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->index)) { return false; } - if (!sbp_u16_encode(ctx, &msg->pid)) { return false; } - if (!sbp_u16_encode(ctx, &msg->socket_count)) { return false; } - if (!sbp_u16_encode(ctx, &msg->socket_types)) { return false; } - if (!sbp_u16_encode(ctx, &msg->socket_states)) { return false; } - if (!sbp_unterminated_string_encode(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, ctx)) { return false; } +bool sbp_msg_linux_process_socket_counts_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_socket_counts_t *msg) { + if (!sbp_u8_encode(ctx, &msg->index)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->pid)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->socket_count)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->socket_types)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->socket_states)) { + return false; + } + if (!sbp_unterminated_string_encode( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, + ctx)) { + return false; + } return true; } -s8 sbp_msg_linux_process_socket_counts_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_process_socket_counts_t *msg) { +s8 sbp_msg_linux_process_socket_counts_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_process_socket_counts_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -516,18 +733,34 @@ s8 sbp_msg_linux_process_socket_counts_encode(uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } -bool sbp_msg_linux_process_socket_counts_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_process_socket_counts_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->index)) { return false; } - if (!sbp_u16_decode(ctx, &msg->pid)) { return false; } - if (!sbp_u16_decode(ctx, &msg->socket_count)) { return false; } - if (!sbp_u16_decode(ctx, &msg->socket_types)) { return false; } - if (!sbp_u16_decode(ctx, &msg->socket_states)) { return false; } - if (!sbp_unterminated_string_decode(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, ctx)) { return false; } +bool sbp_msg_linux_process_socket_counts_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_process_socket_counts_t *msg) { + if (!sbp_u8_decode(ctx, &msg->index)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->pid)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->socket_count)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->socket_types)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->socket_states)) { + return false; + } + if (!sbp_unterminated_string_decode( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, + ctx)) { + return false; + } return true; } -s8 sbp_msg_linux_process_socket_counts_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_process_socket_counts_t *msg) { +s8 sbp_msg_linux_process_socket_counts_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_process_socket_counts_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -541,129 +774,192 @@ s8 sbp_msg_linux_process_socket_counts_decode(const uint8_t *buf, uint8_t len, u return SBP_OK; } - -s8 sbp_msg_linux_process_socket_counts_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_process_socket_counts_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_linux_process_socket_counts_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_linux_process_socket_counts_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_linux_process_socket_counts_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_linux_process_socket_counts_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS, sender_id, + payload_len, payload, write); } -int sbp_msg_linux_process_socket_counts_cmp(const sbp_msg_linux_process_socket_counts_t *a, const sbp_msg_linux_process_socket_counts_t *b) { +int sbp_msg_linux_process_socket_counts_cmp( + const sbp_msg_linux_process_socket_counts_t *a, + const sbp_msg_linux_process_socket_counts_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->index, &b->index); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->pid, &b->pid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->socket_count, &b->socket_count); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->socket_types, &b->socket_types); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->socket_states, &b->socket_states); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_linux_process_socket_counts_cmdline_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_linux_process_socket_queues_cmdline_init(sbp_msg_linux_process_socket_queues_t *msg) -{ +void sbp_msg_linux_process_socket_queues_cmdline_init( + sbp_msg_linux_process_socket_queues_t *msg) { sbp_unterminated_string_init(&msg->cmdline); } -bool sbp_msg_linux_process_socket_queues_cmdline_valid(const sbp_msg_linux_process_socket_queues_t *msg) -{ - return sbp_unterminated_string_valid(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX); +bool sbp_msg_linux_process_socket_queues_cmdline_valid( + const sbp_msg_linux_process_socket_queues_t *msg) { + return sbp_unterminated_string_valid( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX); } -int sbp_msg_linux_process_socket_queues_cmdline_strcmp(const sbp_msg_linux_process_socket_queues_t *a, const sbp_msg_linux_process_socket_queues_t *b) -{ - return sbp_unterminated_string_strcmp(&a->cmdline, &b->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX); +int sbp_msg_linux_process_socket_queues_cmdline_strcmp( + const sbp_msg_linux_process_socket_queues_t *a, + const sbp_msg_linux_process_socket_queues_t *b) { + return sbp_unterminated_string_strcmp( + &a->cmdline, &b->cmdline, + SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX); } -size_t sbp_msg_linux_process_socket_queues_cmdline_encoded_len(const sbp_msg_linux_process_socket_queues_t *msg) -{ - return sbp_unterminated_string_encoded_len(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX); +size_t sbp_msg_linux_process_socket_queues_cmdline_encoded_len( + const sbp_msg_linux_process_socket_queues_t *msg) { + return sbp_unterminated_string_encoded_len( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX); } -size_t sbp_msg_linux_process_socket_queues_cmdline_space_remaining(const sbp_msg_linux_process_socket_queues_t *msg) -{ - return sbp_unterminated_string_space_remaining(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX); +size_t sbp_msg_linux_process_socket_queues_cmdline_space_remaining( + const sbp_msg_linux_process_socket_queues_t *msg) { + return sbp_unterminated_string_space_remaining( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX); } - bool sbp_msg_linux_process_socket_queues_cmdline_set(sbp_msg_linux_process_socket_queues_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, should_trunc, n_written, new_str); +bool sbp_msg_linux_process_socket_queues_cmdline_set( + sbp_msg_linux_process_socket_queues_t *msg, const char *new_str, + bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_linux_process_socket_queues_cmdline_set_raw(sbp_msg_linux_process_socket_queues_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set_raw(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_linux_process_socket_queues_cmdline_set_raw( + sbp_msg_linux_process_socket_queues_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set_raw( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, + should_trunc, n_written, new_buf, new_buf_len); } - -bool sbp_msg_linux_process_socket_queues_cmdline_printf(sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_linux_process_socket_queues_cmdline_printf( + sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_vprintf(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_vprintf( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, + should_trunc, n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_linux_process_socket_queues_cmdline_vprintf(sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_vprintf(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_linux_process_socket_queues_cmdline_vprintf( + sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) { + return sbp_unterminated_string_vprintf( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, + should_trunc, n_written, fmt, ap); } -bool sbp_msg_linux_process_socket_queues_cmdline_append_printf(sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_linux_process_socket_queues_cmdline_append_printf( + sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_append_vprintf(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_append_vprintf( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, + should_trunc, n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_linux_process_socket_queues_cmdline_append_vprintf(sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_append_vprintf(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_linux_process_socket_queues_cmdline_append_vprintf( + sbp_msg_linux_process_socket_queues_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) { + return sbp_unterminated_string_append_vprintf( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, + should_trunc, n_written, fmt, ap); } -const char *sbp_msg_linux_process_socket_queues_cmdline_get(const sbp_msg_linux_process_socket_queues_t *msg) -{ - return sbp_unterminated_string_get(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX); +const char *sbp_msg_linux_process_socket_queues_cmdline_get( + const sbp_msg_linux_process_socket_queues_t *msg) { + return sbp_unterminated_string_get( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX); } -size_t sbp_msg_linux_process_socket_queues_cmdline_strlen(const sbp_msg_linux_process_socket_queues_t *msg) -{ - return sbp_unterminated_string_strlen(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX); +size_t sbp_msg_linux_process_socket_queues_cmdline_strlen( + const sbp_msg_linux_process_socket_queues_t *msg) { + return sbp_unterminated_string_strlen( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX); } -bool sbp_msg_linux_process_socket_queues_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_socket_queues_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->index)) { return false; } - if (!sbp_u16_encode(ctx, &msg->pid)) { return false; } - if (!sbp_u16_encode(ctx, &msg->recv_queued)) { return false; } - if (!sbp_u16_encode(ctx, &msg->send_queued)) { return false; } - if (!sbp_u16_encode(ctx, &msg->socket_types)) { return false; } - if (!sbp_u16_encode(ctx, &msg->socket_states)) { return false; } - for (size_t i = 0; i < SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_ADDRESS_OF_LARGEST_MAX; i++) - { - if (!sbp_char_encode(ctx, &msg->address_of_largest[i])) { return false; } +bool sbp_msg_linux_process_socket_queues_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_socket_queues_t *msg) { + if (!sbp_u8_encode(ctx, &msg->index)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->pid)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->recv_queued)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->send_queued)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->socket_types)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->socket_states)) { + return false; + } + for (size_t i = 0; + i < SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_ADDRESS_OF_LARGEST_MAX; i++) { + if (!sbp_char_encode(ctx, &msg->address_of_largest[i])) { + return false; + } + } + if (!sbp_unterminated_string_encode( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, + ctx)) { + return false; } - if (!sbp_unterminated_string_encode(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, ctx)) { return false; } return true; } -s8 sbp_msg_linux_process_socket_queues_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_process_socket_queues_t *msg) { +s8 sbp_msg_linux_process_socket_queues_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_process_socket_queues_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -677,22 +973,43 @@ s8 sbp_msg_linux_process_socket_queues_encode(uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } -bool sbp_msg_linux_process_socket_queues_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_process_socket_queues_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->index)) { return false; } - if (!sbp_u16_decode(ctx, &msg->pid)) { return false; } - if (!sbp_u16_decode(ctx, &msg->recv_queued)) { return false; } - if (!sbp_u16_decode(ctx, &msg->send_queued)) { return false; } - if (!sbp_u16_decode(ctx, &msg->socket_types)) { return false; } - if (!sbp_u16_decode(ctx, &msg->socket_states)) { return false; } - for (uint8_t i = 0; i < SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_ADDRESS_OF_LARGEST_MAX; i++) { - if (!sbp_char_decode(ctx, &msg->address_of_largest[i])) { return false; } +bool sbp_msg_linux_process_socket_queues_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_process_socket_queues_t *msg) { + if (!sbp_u8_decode(ctx, &msg->index)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->pid)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->recv_queued)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->send_queued)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->socket_types)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->socket_states)) { + return false; + } + for (uint8_t i = 0; + i < SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_ADDRESS_OF_LARGEST_MAX; i++) { + if (!sbp_char_decode(ctx, &msg->address_of_largest[i])) { + return false; + } + } + if (!sbp_unterminated_string_decode( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, + ctx)) { + return false; } - if (!sbp_unterminated_string_decode(&msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, ctx)) { return false; } return true; } -s8 sbp_msg_linux_process_socket_queues_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_process_socket_queues_t *msg) { +s8 sbp_msg_linux_process_socket_queues_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_process_socket_queues_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -706,64 +1023,98 @@ s8 sbp_msg_linux_process_socket_queues_decode(const uint8_t *buf, uint8_t len, u return SBP_OK; } - -s8 sbp_msg_linux_process_socket_queues_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_process_socket_queues_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_linux_process_socket_queues_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_linux_process_socket_queues_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_linux_process_socket_queues_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_linux_process_socket_queues_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES, sender_id, + payload_len, payload, write); } -int sbp_msg_linux_process_socket_queues_cmp(const sbp_msg_linux_process_socket_queues_t *a, const sbp_msg_linux_process_socket_queues_t *b) { +int sbp_msg_linux_process_socket_queues_cmp( + const sbp_msg_linux_process_socket_queues_t *a, + const sbp_msg_linux_process_socket_queues_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->index, &b->index); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->pid, &b->pid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->recv_queued, &b->recv_queued); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->send_queued, &b->send_queued); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->socket_types, &b->socket_types); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->socket_states, &b->socket_states); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_ADDRESS_OF_LARGEST_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && + i < SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_ADDRESS_OF_LARGEST_MAX; + i++) { ret = sbp_char_cmp(&a->address_of_largest[i], &b->address_of_largest[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_linux_process_socket_queues_cmdline_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_linux_socket_usage_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_socket_usage_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->avg_queue_depth)) { return false; } - if (!sbp_u32_encode(ctx, &msg->max_queue_depth)) { return false; } - for (size_t i = 0; i < SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_STATE_COUNTS_MAX; i++) - { - if (!sbp_u16_encode(ctx, &msg->socket_state_counts[i])) { return false; } +bool sbp_msg_linux_socket_usage_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_socket_usage_t *msg) { + if (!sbp_u32_encode(ctx, &msg->avg_queue_depth)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->max_queue_depth)) { + return false; } - for (size_t i = 0; i < SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_TYPE_COUNTS_MAX; i++) - { - if (!sbp_u16_encode(ctx, &msg->socket_type_counts[i])) { return false; } + for (size_t i = 0; i < SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_STATE_COUNTS_MAX; + i++) { + if (!sbp_u16_encode(ctx, &msg->socket_state_counts[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_TYPE_COUNTS_MAX; + i++) { + if (!sbp_u16_encode(ctx, &msg->socket_type_counts[i])) { + return false; + } } return true; } -s8 sbp_msg_linux_socket_usage_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_socket_usage_t *msg) { +s8 sbp_msg_linux_socket_usage_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_linux_socket_usage_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -777,20 +1128,32 @@ s8 sbp_msg_linux_socket_usage_encode(uint8_t *buf, uint8_t len, uint8_t *n_writt return SBP_OK; } -bool sbp_msg_linux_socket_usage_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_socket_usage_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->avg_queue_depth)) { return false; } - if (!sbp_u32_decode(ctx, &msg->max_queue_depth)) { return false; } - for (uint8_t i = 0; i < SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_STATE_COUNTS_MAX; i++) { - if (!sbp_u16_decode(ctx, &msg->socket_state_counts[i])) { return false; } +bool sbp_msg_linux_socket_usage_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_socket_usage_t *msg) { + if (!sbp_u32_decode(ctx, &msg->avg_queue_depth)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->max_queue_depth)) { + return false; } - for (uint8_t i = 0; i < SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_TYPE_COUNTS_MAX; i++) { - if (!sbp_u16_decode(ctx, &msg->socket_type_counts[i])) { return false; } + for (uint8_t i = 0; i < SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_STATE_COUNTS_MAX; + i++) { + if (!sbp_u16_decode(ctx, &msg->socket_state_counts[i])) { + return false; + } + } + for (uint8_t i = 0; i < SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_TYPE_COUNTS_MAX; + i++) { + if (!sbp_u16_decode(ctx, &msg->socket_type_counts[i])) { + return false; + } } return true; } -s8 sbp_msg_linux_socket_usage_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_socket_usage_t *msg) { +s8 sbp_msg_linux_socket_usage_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_linux_socket_usage_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -804,122 +1167,171 @@ s8 sbp_msg_linux_socket_usage_decode(const uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } - -s8 sbp_msg_linux_socket_usage_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_socket_usage_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_linux_socket_usage_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_linux_socket_usage_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_linux_socket_usage_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_LINUX_SOCKET_USAGE, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_linux_socket_usage_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_LINUX_SOCKET_USAGE, sender_id, payload_len, + payload, write); } -int sbp_msg_linux_socket_usage_cmp(const sbp_msg_linux_socket_usage_t *a, const sbp_msg_linux_socket_usage_t *b) { +int sbp_msg_linux_socket_usage_cmp(const sbp_msg_linux_socket_usage_t *a, + const sbp_msg_linux_socket_usage_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->avg_queue_depth, &b->avg_queue_depth); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->max_queue_depth, &b->max_queue_depth); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_STATE_COUNTS_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_STATE_COUNTS_MAX; + i++) { ret = sbp_u16_cmp(&a->socket_state_counts[i], &b->socket_state_counts[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_TYPE_COUNTS_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_LINUX_SOCKET_USAGE_SOCKET_TYPE_COUNTS_MAX; i++) { ret = sbp_u16_cmp(&a->socket_type_counts[i], &b->socket_type_counts[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_linux_process_fd_count_cmdline_init(sbp_msg_linux_process_fd_count_t *msg) -{ +void sbp_msg_linux_process_fd_count_cmdline_init( + sbp_msg_linux_process_fd_count_t *msg) { sbp_unterminated_string_init(&msg->cmdline); } -bool sbp_msg_linux_process_fd_count_cmdline_valid(const sbp_msg_linux_process_fd_count_t *msg) -{ - return sbp_unterminated_string_valid(&msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX); +bool sbp_msg_linux_process_fd_count_cmdline_valid( + const sbp_msg_linux_process_fd_count_t *msg) { + return sbp_unterminated_string_valid( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX); } -int sbp_msg_linux_process_fd_count_cmdline_strcmp(const sbp_msg_linux_process_fd_count_t *a, const sbp_msg_linux_process_fd_count_t *b) -{ - return sbp_unterminated_string_strcmp(&a->cmdline, &b->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX); +int sbp_msg_linux_process_fd_count_cmdline_strcmp( + const sbp_msg_linux_process_fd_count_t *a, + const sbp_msg_linux_process_fd_count_t *b) { + return sbp_unterminated_string_strcmp( + &a->cmdline, &b->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX); } -size_t sbp_msg_linux_process_fd_count_cmdline_encoded_len(const sbp_msg_linux_process_fd_count_t *msg) -{ - return sbp_unterminated_string_encoded_len(&msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX); +size_t sbp_msg_linux_process_fd_count_cmdline_encoded_len( + const sbp_msg_linux_process_fd_count_t *msg) { + return sbp_unterminated_string_encoded_len( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX); } -size_t sbp_msg_linux_process_fd_count_cmdline_space_remaining(const sbp_msg_linux_process_fd_count_t *msg) -{ - return sbp_unterminated_string_space_remaining(&msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX); +size_t sbp_msg_linux_process_fd_count_cmdline_space_remaining( + const sbp_msg_linux_process_fd_count_t *msg) { + return sbp_unterminated_string_space_remaining( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX); } - bool sbp_msg_linux_process_fd_count_cmdline_set(sbp_msg_linux_process_fd_count_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set(&msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, should_trunc, n_written, new_str); +bool sbp_msg_linux_process_fd_count_cmdline_set( + sbp_msg_linux_process_fd_count_t *msg, const char *new_str, + bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set(&msg->cmdline, + SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_linux_process_fd_count_cmdline_set_raw(sbp_msg_linux_process_fd_count_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set_raw(&msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_linux_process_fd_count_cmdline_set_raw( + sbp_msg_linux_process_fd_count_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set_raw( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, should_trunc, + n_written, new_buf, new_buf_len); } - -bool sbp_msg_linux_process_fd_count_cmdline_printf(sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_linux_process_fd_count_cmdline_printf( + sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_vprintf(&msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_vprintf( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_linux_process_fd_count_cmdline_vprintf(sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_vprintf(&msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_linux_process_fd_count_cmdline_vprintf( + sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_vprintf( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); } -bool sbp_msg_linux_process_fd_count_cmdline_append_printf(sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_linux_process_fd_count_cmdline_append_printf( + sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_append_vprintf(&msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_append_vprintf( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_linux_process_fd_count_cmdline_append_vprintf(sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_append_vprintf(&msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_linux_process_fd_count_cmdline_append_vprintf( + sbp_msg_linux_process_fd_count_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_append_vprintf( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); } -const char *sbp_msg_linux_process_fd_count_cmdline_get(const sbp_msg_linux_process_fd_count_t *msg) -{ - return sbp_unterminated_string_get(&msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX); +const char *sbp_msg_linux_process_fd_count_cmdline_get( + const sbp_msg_linux_process_fd_count_t *msg) { + return sbp_unterminated_string_get( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX); } -size_t sbp_msg_linux_process_fd_count_cmdline_strlen(const sbp_msg_linux_process_fd_count_t *msg) -{ - return sbp_unterminated_string_strlen(&msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX); +size_t sbp_msg_linux_process_fd_count_cmdline_strlen( + const sbp_msg_linux_process_fd_count_t *msg) { + return sbp_unterminated_string_strlen( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX); } -bool sbp_msg_linux_process_fd_count_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_fd_count_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->index)) { return false; } - if (!sbp_u16_encode(ctx, &msg->pid)) { return false; } - if (!sbp_u16_encode(ctx, &msg->fd_count)) { return false; } - if (!sbp_unterminated_string_encode(&msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, ctx)) { return false; } +bool sbp_msg_linux_process_fd_count_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_fd_count_t *msg) { + if (!sbp_u8_encode(ctx, &msg->index)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->pid)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->fd_count)) { + return false; + } + if (!sbp_unterminated_string_encode( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_linux_process_fd_count_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_process_fd_count_t *msg) { +s8 sbp_msg_linux_process_fd_count_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_process_fd_count_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -933,16 +1345,27 @@ s8 sbp_msg_linux_process_fd_count_encode(uint8_t *buf, uint8_t len, uint8_t *n_w return SBP_OK; } -bool sbp_msg_linux_process_fd_count_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_process_fd_count_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->index)) { return false; } - if (!sbp_u16_decode(ctx, &msg->pid)) { return false; } - if (!sbp_u16_decode(ctx, &msg->fd_count)) { return false; } - if (!sbp_unterminated_string_decode(&msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, ctx)) { return false; } +bool sbp_msg_linux_process_fd_count_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_process_fd_count_t *msg) { + if (!sbp_u8_decode(ctx, &msg->index)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->pid)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->fd_count)) { + return false; + } + if (!sbp_unterminated_string_decode( + &msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_linux_process_fd_count_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_process_fd_count_t *msg) { +s8 sbp_msg_linux_process_fd_count_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_process_fd_count_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -956,118 +1379,162 @@ s8 sbp_msg_linux_process_fd_count_decode(const uint8_t *buf, uint8_t len, uint8_ return SBP_OK; } - -s8 sbp_msg_linux_process_fd_count_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_process_fd_count_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_linux_process_fd_count_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_linux_process_fd_count_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_linux_process_fd_count_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_LINUX_PROCESS_FD_COUNT, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_linux_process_fd_count_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_LINUX_PROCESS_FD_COUNT, sender_id, + payload_len, payload, write); } -int sbp_msg_linux_process_fd_count_cmp(const sbp_msg_linux_process_fd_count_t *a, const sbp_msg_linux_process_fd_count_t *b) { +int sbp_msg_linux_process_fd_count_cmp( + const sbp_msg_linux_process_fd_count_t *a, + const sbp_msg_linux_process_fd_count_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->index, &b->index); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->pid, &b->pid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->fd_count, &b->fd_count); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_linux_process_fd_count_cmdline_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_linux_process_fd_summary_most_opened_init(sbp_msg_linux_process_fd_summary_t *msg) -{ +void sbp_msg_linux_process_fd_summary_most_opened_init( + sbp_msg_linux_process_fd_summary_t *msg) { sbp_double_null_terminated_string_init(&msg->most_opened); } -bool sbp_msg_linux_process_fd_summary_most_opened_valid(const sbp_msg_linux_process_fd_summary_t *msg) -{ - return sbp_double_null_terminated_string_valid(&msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX); +bool sbp_msg_linux_process_fd_summary_most_opened_valid( + const sbp_msg_linux_process_fd_summary_t *msg) { + return sbp_double_null_terminated_string_valid( + &msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX); } -int sbp_msg_linux_process_fd_summary_most_opened_strcmp(const sbp_msg_linux_process_fd_summary_t *a, const sbp_msg_linux_process_fd_summary_t *b) -{ - return sbp_double_null_terminated_string_strcmp(&a->most_opened, &b->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX); +int sbp_msg_linux_process_fd_summary_most_opened_strcmp( + const sbp_msg_linux_process_fd_summary_t *a, + const sbp_msg_linux_process_fd_summary_t *b) { + return sbp_double_null_terminated_string_strcmp( + &a->most_opened, &b->most_opened, + SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX); } -size_t sbp_msg_linux_process_fd_summary_most_opened_encoded_len(const sbp_msg_linux_process_fd_summary_t *msg) -{ - return sbp_double_null_terminated_string_encoded_len(&msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX); +size_t sbp_msg_linux_process_fd_summary_most_opened_encoded_len( + const sbp_msg_linux_process_fd_summary_t *msg) { + return sbp_double_null_terminated_string_encoded_len( + &msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX); } -size_t sbp_msg_linux_process_fd_summary_most_opened_space_remaining(const sbp_msg_linux_process_fd_summary_t *msg) -{ - return sbp_double_null_terminated_string_space_remaining(&msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX); +size_t sbp_msg_linux_process_fd_summary_most_opened_space_remaining( + const sbp_msg_linux_process_fd_summary_t *msg) { + return sbp_double_null_terminated_string_space_remaining( + &msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX); } -size_t sbp_msg_linux_process_fd_summary_most_opened_count_sections(const sbp_msg_linux_process_fd_summary_t *msg) -{ - return sbp_double_null_terminated_string_count_sections(&msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX); +size_t sbp_msg_linux_process_fd_summary_most_opened_count_sections( + const sbp_msg_linux_process_fd_summary_t *msg) { + return sbp_double_null_terminated_string_count_sections( + &msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX); } -bool sbp_msg_linux_process_fd_summary_most_opened_add_section(sbp_msg_linux_process_fd_summary_t *msg, const char *new_str) -{ - return sbp_double_null_terminated_string_add_section(&msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, new_str); +bool sbp_msg_linux_process_fd_summary_most_opened_add_section( + sbp_msg_linux_process_fd_summary_t *msg, const char *new_str) { + return sbp_double_null_terminated_string_add_section( + &msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, + new_str); } -bool sbp_msg_linux_process_fd_summary_most_opened_add_section_printf(sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, ...) -{ +bool sbp_msg_linux_process_fd_summary_most_opened_add_section_printf( + sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_double_null_terminated_string_add_section_vprintf(&msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, fmt, ap); + bool ret = sbp_double_null_terminated_string_add_section_vprintf( + &msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, fmt, + ap); va_end(ap); return ret; } -bool sbp_msg_linux_process_fd_summary_most_opened_add_section_vprintf(sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, va_list ap) -{ - return sbp_double_null_terminated_string_add_section_vprintf(&msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, fmt, ap); +bool sbp_msg_linux_process_fd_summary_most_opened_add_section_vprintf( + sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, va_list ap) { + return sbp_double_null_terminated_string_add_section_vprintf( + &msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, fmt, + ap); } -bool sbp_msg_linux_process_fd_summary_most_opened_append(sbp_msg_linux_process_fd_summary_t *msg, const char *str) -{ - return sbp_double_null_terminated_string_append(&msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, str); +bool sbp_msg_linux_process_fd_summary_most_opened_append( + sbp_msg_linux_process_fd_summary_t *msg, const char *str) { + return sbp_double_null_terminated_string_append( + &msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, str); } -bool sbp_msg_linux_process_fd_summary_most_opened_append_printf(sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, ...) -{ +bool sbp_msg_linux_process_fd_summary_most_opened_append_printf( + sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_double_null_terminated_string_append_vprintf(&msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, fmt, ap); + bool ret = sbp_double_null_terminated_string_append_vprintf( + &msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, fmt, + ap); va_end(ap); return ret; } -bool sbp_msg_linux_process_fd_summary_most_opened_append_vprintf(sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, va_list ap) -{ - return sbp_double_null_terminated_string_append_vprintf(&msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, fmt, ap); +bool sbp_msg_linux_process_fd_summary_most_opened_append_vprintf( + sbp_msg_linux_process_fd_summary_t *msg, const char *fmt, va_list ap) { + return sbp_double_null_terminated_string_append_vprintf( + &msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, fmt, + ap); } -const char *sbp_msg_linux_process_fd_summary_most_opened_get_section(const sbp_msg_linux_process_fd_summary_t *msg, size_t section) -{ - return sbp_double_null_terminated_string_get_section(&msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, section); +const char *sbp_msg_linux_process_fd_summary_most_opened_get_section( + const sbp_msg_linux_process_fd_summary_t *msg, size_t section) { + return sbp_double_null_terminated_string_get_section( + &msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, + section); } -size_t sbp_msg_linux_process_fd_summary_most_opened_section_strlen(const sbp_msg_linux_process_fd_summary_t *msg, size_t section) -{ - return sbp_double_null_terminated_string_section_strlen(&msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, section); +size_t sbp_msg_linux_process_fd_summary_most_opened_section_strlen( + const sbp_msg_linux_process_fd_summary_t *msg, size_t section) { + return sbp_double_null_terminated_string_section_strlen( + &msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, + section); } -bool sbp_msg_linux_process_fd_summary_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_fd_summary_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->sys_fd_count)) { return false; } - if (!sbp_double_null_terminated_string_encode(&msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, ctx)) { return false; } +bool sbp_msg_linux_process_fd_summary_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_process_fd_summary_t *msg) { + if (!sbp_u32_encode(ctx, &msg->sys_fd_count)) { + return false; + } + if (!sbp_double_null_terminated_string_encode( + &msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, + ctx)) { + return false; + } return true; } -s8 sbp_msg_linux_process_fd_summary_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_process_fd_summary_t *msg) { +s8 sbp_msg_linux_process_fd_summary_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_process_fd_summary_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1081,14 +1548,22 @@ s8 sbp_msg_linux_process_fd_summary_encode(uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } -bool sbp_msg_linux_process_fd_summary_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_process_fd_summary_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->sys_fd_count)) { return false; } - if (!sbp_double_null_terminated_string_decode(&msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, ctx)) { return false; } +bool sbp_msg_linux_process_fd_summary_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_linux_process_fd_summary_t *msg) { + if (!sbp_u32_decode(ctx, &msg->sys_fd_count)) { + return false; + } + if (!sbp_double_null_terminated_string_decode( + &msg->most_opened, SBP_MSG_LINUX_PROCESS_FD_SUMMARY_MOST_OPENED_MAX, + ctx)) { + return false; + } return true; } -s8 sbp_msg_linux_process_fd_summary_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_process_fd_summary_t *msg) { +s8 sbp_msg_linux_process_fd_summary_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_linux_process_fd_summary_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1102,116 +1577,167 @@ s8 sbp_msg_linux_process_fd_summary_decode(const uint8_t *buf, uint8_t len, uint return SBP_OK; } - -s8 sbp_msg_linux_process_fd_summary_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_process_fd_summary_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_linux_process_fd_summary_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_linux_process_fd_summary_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_linux_process_fd_summary_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_LINUX_PROCESS_FD_SUMMARY, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_linux_process_fd_summary_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_LINUX_PROCESS_FD_SUMMARY, sender_id, + payload_len, payload, write); } -int sbp_msg_linux_process_fd_summary_cmp(const sbp_msg_linux_process_fd_summary_t *a, const sbp_msg_linux_process_fd_summary_t *b) { +int sbp_msg_linux_process_fd_summary_cmp( + const sbp_msg_linux_process_fd_summary_t *a, + const sbp_msg_linux_process_fd_summary_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->sys_fd_count, &b->sys_fd_count); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_linux_process_fd_summary_most_opened_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_linux_cpu_state_cmdline_init(sbp_msg_linux_cpu_state_t *msg) -{ +void sbp_msg_linux_cpu_state_cmdline_init(sbp_msg_linux_cpu_state_t *msg) { sbp_unterminated_string_init(&msg->cmdline); } -bool sbp_msg_linux_cpu_state_cmdline_valid(const sbp_msg_linux_cpu_state_t *msg) -{ - return sbp_unterminated_string_valid(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX); +bool sbp_msg_linux_cpu_state_cmdline_valid( + const sbp_msg_linux_cpu_state_t *msg) { + return sbp_unterminated_string_valid(&msg->cmdline, + SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX); } -int sbp_msg_linux_cpu_state_cmdline_strcmp(const sbp_msg_linux_cpu_state_t *a, const sbp_msg_linux_cpu_state_t *b) -{ - return sbp_unterminated_string_strcmp(&a->cmdline, &b->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX); +int sbp_msg_linux_cpu_state_cmdline_strcmp(const sbp_msg_linux_cpu_state_t *a, + const sbp_msg_linux_cpu_state_t *b) { + return sbp_unterminated_string_strcmp(&a->cmdline, &b->cmdline, + SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX); } -size_t sbp_msg_linux_cpu_state_cmdline_encoded_len(const sbp_msg_linux_cpu_state_t *msg) -{ - return sbp_unterminated_string_encoded_len(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX); +size_t sbp_msg_linux_cpu_state_cmdline_encoded_len( + const sbp_msg_linux_cpu_state_t *msg) { + return sbp_unterminated_string_encoded_len( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX); } -size_t sbp_msg_linux_cpu_state_cmdline_space_remaining(const sbp_msg_linux_cpu_state_t *msg) -{ - return sbp_unterminated_string_space_remaining(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX); +size_t sbp_msg_linux_cpu_state_cmdline_space_remaining( + const sbp_msg_linux_cpu_state_t *msg) { + return sbp_unterminated_string_space_remaining( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX); } - bool sbp_msg_linux_cpu_state_cmdline_set(sbp_msg_linux_cpu_state_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, should_trunc, n_written, new_str); +bool sbp_msg_linux_cpu_state_cmdline_set(sbp_msg_linux_cpu_state_t *msg, + const char *new_str, bool should_trunc, + size_t *n_written) { + return sbp_unterminated_string_set(&msg->cmdline, + SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_linux_cpu_state_cmdline_set_raw(sbp_msg_linux_cpu_state_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set_raw(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_linux_cpu_state_cmdline_set_raw(sbp_msg_linux_cpu_state_t *msg, + const char *new_buf, + size_t new_buf_len, + bool should_trunc, + size_t *n_written) { + return sbp_unterminated_string_set_raw( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, should_trunc, + n_written, new_buf, new_buf_len); } - -bool sbp_msg_linux_cpu_state_cmdline_printf(sbp_msg_linux_cpu_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_linux_cpu_state_cmdline_printf(sbp_msg_linux_cpu_state_t *msg, + bool should_trunc, + size_t *n_written, const char *fmt, + ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_vprintf(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_vprintf( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_linux_cpu_state_cmdline_vprintf(sbp_msg_linux_cpu_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_vprintf(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_linux_cpu_state_cmdline_vprintf(sbp_msg_linux_cpu_state_t *msg, + bool should_trunc, + size_t *n_written, const char *fmt, + va_list ap) { + return sbp_unterminated_string_vprintf(&msg->cmdline, + SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, + should_trunc, n_written, fmt, ap); } -bool sbp_msg_linux_cpu_state_cmdline_append_printf(sbp_msg_linux_cpu_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_linux_cpu_state_cmdline_append_printf( + sbp_msg_linux_cpu_state_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_append_vprintf(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_append_vprintf( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_linux_cpu_state_cmdline_append_vprintf(sbp_msg_linux_cpu_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_append_vprintf(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_linux_cpu_state_cmdline_append_vprintf( + sbp_msg_linux_cpu_state_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_append_vprintf( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); } -const char *sbp_msg_linux_cpu_state_cmdline_get(const sbp_msg_linux_cpu_state_t *msg) -{ - return sbp_unterminated_string_get(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX); +const char *sbp_msg_linux_cpu_state_cmdline_get( + const sbp_msg_linux_cpu_state_t *msg) { + return sbp_unterminated_string_get(&msg->cmdline, + SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX); } -size_t sbp_msg_linux_cpu_state_cmdline_strlen(const sbp_msg_linux_cpu_state_t *msg) -{ - return sbp_unterminated_string_strlen(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX); +size_t sbp_msg_linux_cpu_state_cmdline_strlen( + const sbp_msg_linux_cpu_state_t *msg) { + return sbp_unterminated_string_strlen(&msg->cmdline, + SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX); } -bool sbp_msg_linux_cpu_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_cpu_state_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->index)) { return false; } - if (!sbp_u16_encode(ctx, &msg->pid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->pcpu)) { return false; } - if (!sbp_u32_encode(ctx, &msg->time)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } - for (size_t i = 0; i < SBP_MSG_LINUX_CPU_STATE_TNAME_MAX; i++) - { - if (!sbp_char_encode(ctx, &msg->tname[i])) { return false; } +bool sbp_msg_linux_cpu_state_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_cpu_state_t *msg) { + if (!sbp_u8_encode(ctx, &msg->index)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->pid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->pcpu)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_LINUX_CPU_STATE_TNAME_MAX; i++) { + if (!sbp_char_encode(ctx, &msg->tname[i])) { + return false; + } + } + if (!sbp_unterminated_string_encode( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, ctx)) { + return false; } - if (!sbp_unterminated_string_encode(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, ctx)) { return false; } return true; } -s8 sbp_msg_linux_cpu_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_cpu_state_t *msg) { +s8 sbp_msg_linux_cpu_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_cpu_state_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1225,21 +1751,38 @@ s8 sbp_msg_linux_cpu_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_linux_cpu_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_cpu_state_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->index)) { return false; } - if (!sbp_u16_decode(ctx, &msg->pid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->pcpu)) { return false; } - if (!sbp_u32_decode(ctx, &msg->time)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_linux_cpu_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_linux_cpu_state_t *msg) { + if (!sbp_u8_decode(ctx, &msg->index)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->pid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->pcpu)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_LINUX_CPU_STATE_TNAME_MAX; i++) { - if (!sbp_char_decode(ctx, &msg->tname[i])) { return false; } + if (!sbp_char_decode(ctx, &msg->tname[i])) { + return false; + } + } + if (!sbp_unterminated_string_decode( + &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, ctx)) { + return false; } - if (!sbp_unterminated_string_decode(&msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, ctx)) { return false; } return true; } -s8 sbp_msg_linux_cpu_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_cpu_state_t *msg) { +s8 sbp_msg_linux_cpu_state_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_linux_cpu_state_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1253,134 +1796,193 @@ s8 sbp_msg_linux_cpu_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_linux_cpu_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_cpu_state_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_linux_cpu_state_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_linux_cpu_state_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_linux_cpu_state_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_LINUX_CPU_STATE, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_linux_cpu_state_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_LINUX_CPU_STATE, sender_id, payload_len, + payload, write); } -int sbp_msg_linux_cpu_state_cmp(const sbp_msg_linux_cpu_state_t *a, const sbp_msg_linux_cpu_state_t *b) { +int sbp_msg_linux_cpu_state_cmp(const sbp_msg_linux_cpu_state_t *a, + const sbp_msg_linux_cpu_state_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->index, &b->index); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->pid, &b->pid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->pcpu, &b->pcpu); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_LINUX_CPU_STATE_TNAME_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_LINUX_CPU_STATE_TNAME_MAX; i++) { ret = sbp_char_cmp(&a->tname[i], &b->tname[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_linux_cpu_state_cmdline_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_linux_mem_state_cmdline_init(sbp_msg_linux_mem_state_t *msg) -{ +void sbp_msg_linux_mem_state_cmdline_init(sbp_msg_linux_mem_state_t *msg) { sbp_unterminated_string_init(&msg->cmdline); } -bool sbp_msg_linux_mem_state_cmdline_valid(const sbp_msg_linux_mem_state_t *msg) -{ - return sbp_unterminated_string_valid(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX); +bool sbp_msg_linux_mem_state_cmdline_valid( + const sbp_msg_linux_mem_state_t *msg) { + return sbp_unterminated_string_valid(&msg->cmdline, + SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX); } -int sbp_msg_linux_mem_state_cmdline_strcmp(const sbp_msg_linux_mem_state_t *a, const sbp_msg_linux_mem_state_t *b) -{ - return sbp_unterminated_string_strcmp(&a->cmdline, &b->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX); +int sbp_msg_linux_mem_state_cmdline_strcmp(const sbp_msg_linux_mem_state_t *a, + const sbp_msg_linux_mem_state_t *b) { + return sbp_unterminated_string_strcmp(&a->cmdline, &b->cmdline, + SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX); } -size_t sbp_msg_linux_mem_state_cmdline_encoded_len(const sbp_msg_linux_mem_state_t *msg) -{ - return sbp_unterminated_string_encoded_len(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX); +size_t sbp_msg_linux_mem_state_cmdline_encoded_len( + const sbp_msg_linux_mem_state_t *msg) { + return sbp_unterminated_string_encoded_len( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX); } -size_t sbp_msg_linux_mem_state_cmdline_space_remaining(const sbp_msg_linux_mem_state_t *msg) -{ - return sbp_unterminated_string_space_remaining(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX); +size_t sbp_msg_linux_mem_state_cmdline_space_remaining( + const sbp_msg_linux_mem_state_t *msg) { + return sbp_unterminated_string_space_remaining( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX); } - bool sbp_msg_linux_mem_state_cmdline_set(sbp_msg_linux_mem_state_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, should_trunc, n_written, new_str); +bool sbp_msg_linux_mem_state_cmdline_set(sbp_msg_linux_mem_state_t *msg, + const char *new_str, bool should_trunc, + size_t *n_written) { + return sbp_unterminated_string_set(&msg->cmdline, + SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_linux_mem_state_cmdline_set_raw(sbp_msg_linux_mem_state_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set_raw(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_linux_mem_state_cmdline_set_raw(sbp_msg_linux_mem_state_t *msg, + const char *new_buf, + size_t new_buf_len, + bool should_trunc, + size_t *n_written) { + return sbp_unterminated_string_set_raw( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, should_trunc, + n_written, new_buf, new_buf_len); } - -bool sbp_msg_linux_mem_state_cmdline_printf(sbp_msg_linux_mem_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_linux_mem_state_cmdline_printf(sbp_msg_linux_mem_state_t *msg, + bool should_trunc, + size_t *n_written, const char *fmt, + ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_vprintf(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_vprintf( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_linux_mem_state_cmdline_vprintf(sbp_msg_linux_mem_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_vprintf(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_linux_mem_state_cmdline_vprintf(sbp_msg_linux_mem_state_t *msg, + bool should_trunc, + size_t *n_written, const char *fmt, + va_list ap) { + return sbp_unterminated_string_vprintf(&msg->cmdline, + SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, + should_trunc, n_written, fmt, ap); } -bool sbp_msg_linux_mem_state_cmdline_append_printf(sbp_msg_linux_mem_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_linux_mem_state_cmdline_append_printf( + sbp_msg_linux_mem_state_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_append_vprintf(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_append_vprintf( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_linux_mem_state_cmdline_append_vprintf(sbp_msg_linux_mem_state_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_append_vprintf(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_linux_mem_state_cmdline_append_vprintf( + sbp_msg_linux_mem_state_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_append_vprintf( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, should_trunc, + n_written, fmt, ap); } -const char *sbp_msg_linux_mem_state_cmdline_get(const sbp_msg_linux_mem_state_t *msg) -{ - return sbp_unterminated_string_get(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX); +const char *sbp_msg_linux_mem_state_cmdline_get( + const sbp_msg_linux_mem_state_t *msg) { + return sbp_unterminated_string_get(&msg->cmdline, + SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX); } -size_t sbp_msg_linux_mem_state_cmdline_strlen(const sbp_msg_linux_mem_state_t *msg) -{ - return sbp_unterminated_string_strlen(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX); +size_t sbp_msg_linux_mem_state_cmdline_strlen( + const sbp_msg_linux_mem_state_t *msg) { + return sbp_unterminated_string_strlen(&msg->cmdline, + SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX); } -bool sbp_msg_linux_mem_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_mem_state_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->index)) { return false; } - if (!sbp_u16_encode(ctx, &msg->pid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->pmem)) { return false; } - if (!sbp_u32_encode(ctx, &msg->time)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } - for (size_t i = 0; i < SBP_MSG_LINUX_MEM_STATE_TNAME_MAX; i++) - { - if (!sbp_char_encode(ctx, &msg->tname[i])) { return false; } +bool sbp_msg_linux_mem_state_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_mem_state_t *msg) { + if (!sbp_u8_encode(ctx, &msg->index)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->pid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->pmem)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_LINUX_MEM_STATE_TNAME_MAX; i++) { + if (!sbp_char_encode(ctx, &msg->tname[i])) { + return false; + } + } + if (!sbp_unterminated_string_encode( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, ctx)) { + return false; } - if (!sbp_unterminated_string_encode(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, ctx)) { return false; } return true; } -s8 sbp_msg_linux_mem_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_mem_state_t *msg) { +s8 sbp_msg_linux_mem_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_mem_state_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1394,21 +1996,38 @@ s8 sbp_msg_linux_mem_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_linux_mem_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_mem_state_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->index)) { return false; } - if (!sbp_u16_decode(ctx, &msg->pid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->pmem)) { return false; } - if (!sbp_u32_decode(ctx, &msg->time)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_linux_mem_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_linux_mem_state_t *msg) { + if (!sbp_u8_decode(ctx, &msg->index)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->pid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->pmem)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_LINUX_MEM_STATE_TNAME_MAX; i++) { - if (!sbp_char_decode(ctx, &msg->tname[i])) { return false; } + if (!sbp_char_decode(ctx, &msg->tname[i])) { + return false; + } + } + if (!sbp_unterminated_string_decode( + &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, ctx)) { + return false; } - if (!sbp_unterminated_string_decode(&msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, ctx)) { return false; } return true; } -s8 sbp_msg_linux_mem_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_mem_state_t *msg) { +s8 sbp_msg_linux_mem_state_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_linux_mem_state_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1422,59 +2041,94 @@ s8 sbp_msg_linux_mem_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_linux_mem_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_mem_state_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_linux_mem_state_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_linux_mem_state_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_linux_mem_state_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_LINUX_MEM_STATE, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_linux_mem_state_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_LINUX_MEM_STATE, sender_id, payload_len, + payload, write); } -int sbp_msg_linux_mem_state_cmp(const sbp_msg_linux_mem_state_t *a, const sbp_msg_linux_mem_state_t *b) { +int sbp_msg_linux_mem_state_cmp(const sbp_msg_linux_mem_state_t *a, + const sbp_msg_linux_mem_state_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->index, &b->index); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->pid, &b->pid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->pmem, &b->pmem); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_LINUX_MEM_STATE_TNAME_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_LINUX_MEM_STATE_TNAME_MAX; i++) { ret = sbp_char_cmp(&a->tname[i], &b->tname[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_linux_mem_state_cmdline_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_linux_sys_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_linux_sys_state_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->mem_total)) { return false; } - if (!sbp_u8_encode(ctx, &msg->pcpu)) { return false; } - if (!sbp_u8_encode(ctx, &msg->pmem)) { return false; } - if (!sbp_u16_encode(ctx, &msg->procs_starting)) { return false; } - if (!sbp_u16_encode(ctx, &msg->procs_stopping)) { return false; } - if (!sbp_u16_encode(ctx, &msg->pid_count)) { return false; } - if (!sbp_u32_encode(ctx, &msg->time)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_linux_sys_state_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_linux_sys_state_t *msg) { + if (!sbp_u16_encode(ctx, &msg->mem_total)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->pcpu)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->pmem)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->procs_starting)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->procs_stopping)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->pid_count)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_linux_sys_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_linux_sys_state_t *msg) { +s8 sbp_msg_linux_sys_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_linux_sys_state_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1488,20 +2142,38 @@ s8 sbp_msg_linux_sys_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_linux_sys_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_linux_sys_state_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->mem_total)) { return false; } - if (!sbp_u8_decode(ctx, &msg->pcpu)) { return false; } - if (!sbp_u8_decode(ctx, &msg->pmem)) { return false; } - if (!sbp_u16_decode(ctx, &msg->procs_starting)) { return false; } - if (!sbp_u16_decode(ctx, &msg->procs_stopping)) { return false; } - if (!sbp_u16_decode(ctx, &msg->pid_count)) { return false; } - if (!sbp_u32_decode(ctx, &msg->time)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_linux_sys_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_linux_sys_state_t *msg) { + if (!sbp_u16_decode(ctx, &msg->mem_total)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->pcpu)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->pmem)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->procs_starting)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->procs_stopping)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->pid_count)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_linux_sys_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_linux_sys_state_t *msg) { +s8 sbp_msg_linux_sys_state_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_linux_sys_state_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1515,41 +2187,62 @@ s8 sbp_msg_linux_sys_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_linux_sys_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_linux_sys_state_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_linux_sys_state_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_linux_sys_state_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_linux_sys_state_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_LINUX_SYS_STATE, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_linux_sys_state_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_LINUX_SYS_STATE, sender_id, payload_len, + payload, write); } -int sbp_msg_linux_sys_state_cmp(const sbp_msg_linux_sys_state_t *a, const sbp_msg_linux_sys_state_t *b) { +int sbp_msg_linux_sys_state_cmp(const sbp_msg_linux_sys_state_t *a, + const sbp_msg_linux_sys_state_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->mem_total, &b->mem_total); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->pcpu, &b->pcpu); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->pmem, &b->pmem); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->procs_starting, &b->procs_starting); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->procs_stopping, &b->procs_stopping); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->pid_count, &b->pid_count); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/logging.c b/c/src/logging.c index 0b2c30c6b..3bf25a516 100644 --- a/c/src/logging.c +++ b/c/src/logging.c @@ -3,101 +3,109 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include #include +#include +#include #include #include -#include #include +#include +#include -void sbp_msg_log_text_init(sbp_msg_log_t *msg) -{ +void sbp_msg_log_text_init(sbp_msg_log_t *msg) { sbp_unterminated_string_init(&msg->text); } -bool sbp_msg_log_text_valid(const sbp_msg_log_t *msg) -{ +bool sbp_msg_log_text_valid(const sbp_msg_log_t *msg) { return sbp_unterminated_string_valid(&msg->text, SBP_MSG_LOG_TEXT_MAX); } -int sbp_msg_log_text_strcmp(const sbp_msg_log_t *a, const sbp_msg_log_t *b) -{ - return sbp_unterminated_string_strcmp(&a->text, &b->text, SBP_MSG_LOG_TEXT_MAX); +int sbp_msg_log_text_strcmp(const sbp_msg_log_t *a, const sbp_msg_log_t *b) { + return sbp_unterminated_string_strcmp(&a->text, &b->text, + SBP_MSG_LOG_TEXT_MAX); } -size_t sbp_msg_log_text_encoded_len(const sbp_msg_log_t *msg) -{ +size_t sbp_msg_log_text_encoded_len(const sbp_msg_log_t *msg) { return sbp_unterminated_string_encoded_len(&msg->text, SBP_MSG_LOG_TEXT_MAX); } -size_t sbp_msg_log_text_space_remaining(const sbp_msg_log_t *msg) -{ - return sbp_unterminated_string_space_remaining(&msg->text, SBP_MSG_LOG_TEXT_MAX); +size_t sbp_msg_log_text_space_remaining(const sbp_msg_log_t *msg) { + return sbp_unterminated_string_space_remaining(&msg->text, + SBP_MSG_LOG_TEXT_MAX); } - bool sbp_msg_log_text_set(sbp_msg_log_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set(&msg->text, SBP_MSG_LOG_TEXT_MAX, should_trunc, n_written, new_str); +bool sbp_msg_log_text_set(sbp_msg_log_t *msg, const char *new_str, + bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set(&msg->text, SBP_MSG_LOG_TEXT_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_log_text_set_raw(sbp_msg_log_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set_raw(&msg->text, SBP_MSG_LOG_TEXT_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_log_text_set_raw(sbp_msg_log_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, + size_t *n_written) { + return sbp_unterminated_string_set_raw(&msg->text, SBP_MSG_LOG_TEXT_MAX, + should_trunc, n_written, new_buf, + new_buf_len); } - -bool sbp_msg_log_text_printf(sbp_msg_log_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_log_text_printf(sbp_msg_log_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_vprintf(&msg->text, SBP_MSG_LOG_TEXT_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_vprintf(&msg->text, SBP_MSG_LOG_TEXT_MAX, + should_trunc, n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_log_text_vprintf(sbp_msg_log_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_vprintf(&msg->text, SBP_MSG_LOG_TEXT_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_log_text_vprintf(sbp_msg_log_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, va_list ap) { + return sbp_unterminated_string_vprintf(&msg->text, SBP_MSG_LOG_TEXT_MAX, + should_trunc, n_written, fmt, ap); } -bool sbp_msg_log_text_append_printf(sbp_msg_log_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_log_text_append_printf(sbp_msg_log_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_append_vprintf(&msg->text, SBP_MSG_LOG_TEXT_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_append_vprintf( + &msg->text, SBP_MSG_LOG_TEXT_MAX, should_trunc, n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_log_text_append_vprintf(sbp_msg_log_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_append_vprintf(&msg->text, SBP_MSG_LOG_TEXT_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_log_text_append_vprintf(sbp_msg_log_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, + va_list ap) { + return sbp_unterminated_string_append_vprintf( + &msg->text, SBP_MSG_LOG_TEXT_MAX, should_trunc, n_written, fmt, ap); } -const char *sbp_msg_log_text_get(const sbp_msg_log_t *msg) -{ +const char *sbp_msg_log_text_get(const sbp_msg_log_t *msg) { return sbp_unterminated_string_get(&msg->text, SBP_MSG_LOG_TEXT_MAX); } -size_t sbp_msg_log_text_strlen(const sbp_msg_log_t *msg) -{ +size_t sbp_msg_log_text_strlen(const sbp_msg_log_t *msg) { return sbp_unterminated_string_strlen(&msg->text, SBP_MSG_LOG_TEXT_MAX); } -bool sbp_msg_log_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_log_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->level)) { return false; } - if (!sbp_unterminated_string_encode(&msg->text, SBP_MSG_LOG_TEXT_MAX, ctx)) { return false; } +bool sbp_msg_log_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_log_t *msg) { + if (!sbp_u8_encode(ctx, &msg->level)) { + return false; + } + if (!sbp_unterminated_string_encode(&msg->text, SBP_MSG_LOG_TEXT_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_log_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_log_t *msg) { +s8 sbp_msg_log_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_log_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -111,14 +119,18 @@ s8 sbp_msg_log_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_m return SBP_OK; } -bool sbp_msg_log_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_log_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->level)) { return false; } - if (!sbp_unterminated_string_decode(&msg->text, SBP_MSG_LOG_TEXT_MAX, ctx)) { return false; } +bool sbp_msg_log_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_log_t *msg) { + if (!sbp_u8_decode(ctx, &msg->level)) { + return false; + } + if (!sbp_unterminated_string_decode(&msg->text, SBP_MSG_LOG_TEXT_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_log_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_log_t *msg) { +s8 sbp_msg_log_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_log_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -132,39 +144,51 @@ s8 sbp_msg_log_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ return SBP_OK; } - -s8 sbp_msg_log_send(sbp_state_t *s, u16 sender_id, const sbp_msg_log_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_log_send(sbp_state_t *s, u16 sender_id, const sbp_msg_log_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_log_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_LOG, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_LOG, sender_id, payload_len, payload, + write); } int sbp_msg_log_cmp(const sbp_msg_log_t *a, const sbp_msg_log_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->level, &b->level); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_log_text_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_fwd_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_fwd_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->source)) { return false; } - if (!sbp_u8_encode(ctx, &msg->protocol)) { return false; } - for (size_t i = 0; i < msg->n_fwd_payload; i++) - { - if (!sbp_u8_encode(ctx, &msg->fwd_payload[i])) { return false; } +bool sbp_msg_fwd_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_fwd_t *msg) { + if (!sbp_u8_encode(ctx, &msg->source)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->protocol)) { + return false; + } + for (size_t i = 0; i < msg->n_fwd_payload; i++) { + if (!sbp_u8_encode(ctx, &msg->fwd_payload[i])) { + return false; + } } return true; } -s8 sbp_msg_fwd_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_fwd_t *msg) { +s8 sbp_msg_fwd_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_fwd_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -178,21 +202,28 @@ s8 sbp_msg_fwd_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_m return SBP_OK; } -bool sbp_msg_fwd_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fwd_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->source)) { return false; } - if (!sbp_u8_decode(ctx, &msg->protocol)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { +bool sbp_msg_fwd_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_fwd_t *msg) { + if (!sbp_u8_decode(ctx, &msg->source)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->protocol)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + return false; + } + msg->n_fwd_payload = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->n_fwd_payload; i++) { + if (!sbp_u8_decode(ctx, &msg->fwd_payload[i])) { return false; } - msg->n_fwd_payload = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); - for (uint8_t i = 0; i < msg->n_fwd_payload; i++) { - if (!sbp_u8_decode(ctx, &msg->fwd_payload[i])) { return false; } - } + } return true; } -s8 sbp_msg_fwd_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_fwd_t *msg) { +s8 sbp_msg_fwd_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_fwd_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -206,114 +237,132 @@ s8 sbp_msg_fwd_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ return SBP_OK; } - -s8 sbp_msg_fwd_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fwd_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_fwd_send(sbp_state_t *s, u16 sender_id, const sbp_msg_fwd_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_fwd_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FWD, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FWD, sender_id, payload_len, payload, + write); } int sbp_msg_fwd_cmp(const sbp_msg_fwd_t *a, const sbp_msg_fwd_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->source, &b->source); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->protocol, &b->protocol); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_fwd_payload, &b->n_fwd_payload); - for (uint8_t i = 0; ret == 0 && i < a->n_fwd_payload; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_fwd_payload; i++) { ret = sbp_u8_cmp(&a->fwd_payload[i], &b->fwd_payload[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_print_dep_text_init(sbp_msg_print_dep_t *msg) -{ +void sbp_msg_print_dep_text_init(sbp_msg_print_dep_t *msg) { sbp_unterminated_string_init(&msg->text); } -bool sbp_msg_print_dep_text_valid(const sbp_msg_print_dep_t *msg) -{ +bool sbp_msg_print_dep_text_valid(const sbp_msg_print_dep_t *msg) { return sbp_unterminated_string_valid(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX); } -int sbp_msg_print_dep_text_strcmp(const sbp_msg_print_dep_t *a, const sbp_msg_print_dep_t *b) -{ - return sbp_unterminated_string_strcmp(&a->text, &b->text, SBP_MSG_PRINT_DEP_TEXT_MAX); +int sbp_msg_print_dep_text_strcmp(const sbp_msg_print_dep_t *a, + const sbp_msg_print_dep_t *b) { + return sbp_unterminated_string_strcmp(&a->text, &b->text, + SBP_MSG_PRINT_DEP_TEXT_MAX); } -size_t sbp_msg_print_dep_text_encoded_len(const sbp_msg_print_dep_t *msg) -{ - return sbp_unterminated_string_encoded_len(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX); +size_t sbp_msg_print_dep_text_encoded_len(const sbp_msg_print_dep_t *msg) { + return sbp_unterminated_string_encoded_len(&msg->text, + SBP_MSG_PRINT_DEP_TEXT_MAX); } -size_t sbp_msg_print_dep_text_space_remaining(const sbp_msg_print_dep_t *msg) -{ - return sbp_unterminated_string_space_remaining(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX); +size_t sbp_msg_print_dep_text_space_remaining(const sbp_msg_print_dep_t *msg) { + return sbp_unterminated_string_space_remaining(&msg->text, + SBP_MSG_PRINT_DEP_TEXT_MAX); } - bool sbp_msg_print_dep_text_set(sbp_msg_print_dep_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, should_trunc, n_written, new_str); +bool sbp_msg_print_dep_text_set(sbp_msg_print_dep_t *msg, const char *new_str, + bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_print_dep_text_set_raw(sbp_msg_print_dep_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set_raw(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_print_dep_text_set_raw(sbp_msg_print_dep_t *msg, + const char *new_buf, size_t new_buf_len, + bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set_raw(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, + should_trunc, n_written, new_buf, + new_buf_len); } - -bool sbp_msg_print_dep_text_printf(sbp_msg_print_dep_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_print_dep_text_printf(sbp_msg_print_dep_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_vprintf(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_vprintf( + &msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, should_trunc, n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_print_dep_text_vprintf(sbp_msg_print_dep_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_vprintf(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_print_dep_text_vprintf(sbp_msg_print_dep_t *msg, bool should_trunc, + size_t *n_written, const char *fmt, + va_list ap) { + return sbp_unterminated_string_vprintf(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, + should_trunc, n_written, fmt, ap); } -bool sbp_msg_print_dep_text_append_printf(sbp_msg_print_dep_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_print_dep_text_append_printf(sbp_msg_print_dep_t *msg, + bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_append_vprintf(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_append_vprintf( + &msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, should_trunc, n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_print_dep_text_append_vprintf(sbp_msg_print_dep_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_append_vprintf(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_print_dep_text_append_vprintf(sbp_msg_print_dep_t *msg, + bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_append_vprintf( + &msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, should_trunc, n_written, fmt, ap); } -const char *sbp_msg_print_dep_text_get(const sbp_msg_print_dep_t *msg) -{ +const char *sbp_msg_print_dep_text_get(const sbp_msg_print_dep_t *msg) { return sbp_unterminated_string_get(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX); } -size_t sbp_msg_print_dep_text_strlen(const sbp_msg_print_dep_t *msg) -{ +size_t sbp_msg_print_dep_text_strlen(const sbp_msg_print_dep_t *msg) { return sbp_unterminated_string_strlen(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX); } -bool sbp_msg_print_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_print_dep_t *msg) -{ - if (!sbp_unterminated_string_encode(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, ctx)) { return false; } +bool sbp_msg_print_dep_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_print_dep_t *msg) { + if (!sbp_unterminated_string_encode(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, + ctx)) { + return false; + } return true; } -s8 sbp_msg_print_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_print_dep_t *msg) { +s8 sbp_msg_print_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_print_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -327,13 +376,17 @@ s8 sbp_msg_print_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_print_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_print_dep_t *msg) -{ - if (!sbp_unterminated_string_decode(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, ctx)) { return false; } +bool sbp_msg_print_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_print_dep_t *msg) { + if (!sbp_unterminated_string_decode(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, + ctx)) { + return false; + } return true; } -s8 sbp_msg_print_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_print_dep_t *msg) { +s8 sbp_msg_print_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_print_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -347,20 +400,27 @@ s8 sbp_msg_print_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - -s8 sbp_msg_print_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_print_dep_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_print_dep_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_print_dep_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_print_dep_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_PRINT_DEP, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_print_dep_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_PRINT_DEP, sender_id, payload_len, payload, + write); } -int sbp_msg_print_dep_cmp(const sbp_msg_print_dep_t *a, const sbp_msg_print_dep_t *b) { +int sbp_msg_print_dep_cmp(const sbp_msg_print_dep_t *a, + const sbp_msg_print_dep_t *b) { int ret = 0; - + ret = sbp_msg_print_dep_text_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/mag.c b/c/src/mag.c index 448f27869..f7012489f 100644 --- a/c/src/mag.c +++ b/c/src/mag.c @@ -3,31 +3,42 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include #include +#include +#include #include #include -#include #include +#include +#include -bool sbp_msg_mag_raw_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_mag_raw_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u8_encode(ctx, &msg->tow_f)) { return false; } - if (!sbp_s16_encode(ctx, &msg->mag_x)) { return false; } - if (!sbp_s16_encode(ctx, &msg->mag_y)) { return false; } - if (!sbp_s16_encode(ctx, &msg->mag_z)) { return false; } +bool sbp_msg_mag_raw_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_mag_raw_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->tow_f)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->mag_x)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->mag_y)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->mag_z)) { + return false; + } return true; } -s8 sbp_msg_mag_raw_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_mag_raw_t *msg) { +s8 sbp_msg_mag_raw_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_mag_raw_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -41,17 +52,28 @@ s8 sbp_msg_mag_raw_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const s return SBP_OK; } -bool sbp_msg_mag_raw_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_mag_raw_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u8_decode(ctx, &msg->tow_f)) { return false; } - if (!sbp_s16_decode(ctx, &msg->mag_x)) { return false; } - if (!sbp_s16_decode(ctx, &msg->mag_y)) { return false; } - if (!sbp_s16_decode(ctx, &msg->mag_z)) { return false; } +bool sbp_msg_mag_raw_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_mag_raw_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->tow_f)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->mag_x)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->mag_y)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->mag_z)) { + return false; + } return true; } -s8 sbp_msg_mag_raw_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_mag_raw_t *msg) { +s8 sbp_msg_mag_raw_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_mag_raw_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -65,32 +87,45 @@ s8 sbp_msg_mag_raw_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ return SBP_OK; } - -s8 sbp_msg_mag_raw_send(sbp_state_t *s, u16 sender_id, const sbp_msg_mag_raw_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_mag_raw_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_mag_raw_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_mag_raw_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_MAG_RAW, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_MAG_RAW, sender_id, payload_len, payload, + write); } -int sbp_msg_mag_raw_cmp(const sbp_msg_mag_raw_t *a, const sbp_msg_mag_raw_t *b) { +int sbp_msg_mag_raw_cmp(const sbp_msg_mag_raw_t *a, + const sbp_msg_mag_raw_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->tow_f, &b->tow_f); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->mag_x, &b->mag_x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->mag_y, &b->mag_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->mag_z, &b->mag_z); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/navigation.c b/c/src/navigation.c index 5195d8a52..404859963 100644 --- a/c/src/navigation.c +++ b/c/src/navigation.c @@ -3,30 +3,39 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include #include +#include +#include #include #include -#include #include +#include +#include -bool sbp_msg_gps_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_gps_time_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->wn)) { return false; } - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->ns_residual)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_gps_time_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_gps_time_t *msg) { + if (!sbp_u16_encode(ctx, &msg->wn)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->ns_residual)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_gps_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_gps_time_t *msg) { +s8 sbp_msg_gps_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_gps_time_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -40,16 +49,25 @@ s8 sbp_msg_gps_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_gps_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gps_time_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->wn)) { return false; } - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->ns_residual)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_gps_time_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_gps_time_t *msg) { + if (!sbp_u16_decode(ctx, &msg->wn)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->ns_residual)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_gps_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_gps_time_t *msg) { +s8 sbp_msg_gps_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_gps_time_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -63,43 +81,63 @@ s8 sbp_msg_gps_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp return SBP_OK; } - -s8 sbp_msg_gps_time_send(sbp_state_t *s, u16 sender_id, const sbp_msg_gps_time_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_gps_time_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_gps_time_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_gps_time_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_GPS_TIME, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_GPS_TIME, sender_id, payload_len, payload, + write); } -int sbp_msg_gps_time_cmp(const sbp_msg_gps_time_t *a, const sbp_msg_gps_time_t *b) { +int sbp_msg_gps_time_cmp(const sbp_msg_gps_time_t *a, + const sbp_msg_gps_time_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->wn, &b->wn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->ns_residual, &b->ns_residual); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_gps_time_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_gps_time_gnss_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->wn)) { return false; } - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->ns_residual)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_gps_time_gnss_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_gps_time_gnss_t *msg) { + if (!sbp_u16_encode(ctx, &msg->wn)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->ns_residual)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_gps_time_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_gps_time_gnss_t *msg) { +s8 sbp_msg_gps_time_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_gps_time_gnss_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -113,16 +151,25 @@ s8 sbp_msg_gps_time_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_gps_time_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gps_time_gnss_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->wn)) { return false; } - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->ns_residual)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_gps_time_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_gps_time_gnss_t *msg) { + if (!sbp_u16_decode(ctx, &msg->wn)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->ns_residual)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_gps_time_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_gps_time_gnss_t *msg) { +s8 sbp_msg_gps_time_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_gps_time_gnss_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -136,48 +183,80 @@ s8 sbp_msg_gps_time_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_gps_time_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_gps_time_gnss_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_gps_time_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_gps_time_gnss_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_gps_time_gnss_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_GPS_TIME_GNSS, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_gps_time_gnss_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_GPS_TIME_GNSS, sender_id, payload_len, + payload, write); } -int sbp_msg_gps_time_gnss_cmp(const sbp_msg_gps_time_gnss_t *a, const sbp_msg_gps_time_gnss_t *b) { +int sbp_msg_gps_time_gnss_cmp(const sbp_msg_gps_time_gnss_t *a, + const sbp_msg_gps_time_gnss_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->wn, &b->wn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->ns_residual, &b->ns_residual); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_utc_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_utc_time_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->year)) { return false; } - if (!sbp_u8_encode(ctx, &msg->month)) { return false; } - if (!sbp_u8_encode(ctx, &msg->day)) { return false; } - if (!sbp_u8_encode(ctx, &msg->hours)) { return false; } - if (!sbp_u8_encode(ctx, &msg->minutes)) { return false; } - if (!sbp_u8_encode(ctx, &msg->seconds)) { return false; } - if (!sbp_u32_encode(ctx, &msg->ns)) { return false; } +bool sbp_msg_utc_time_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_utc_time_t *msg) { + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->year)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->month)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->day)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->hours)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->minutes)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->seconds)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->ns)) { + return false; + } return true; } -s8 sbp_msg_utc_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_utc_time_t *msg) { +s8 sbp_msg_utc_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_utc_time_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -191,21 +270,40 @@ s8 sbp_msg_utc_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_utc_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_utc_time_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->year)) { return false; } - if (!sbp_u8_decode(ctx, &msg->month)) { return false; } - if (!sbp_u8_decode(ctx, &msg->day)) { return false; } - if (!sbp_u8_decode(ctx, &msg->hours)) { return false; } - if (!sbp_u8_decode(ctx, &msg->minutes)) { return false; } - if (!sbp_u8_decode(ctx, &msg->seconds)) { return false; } - if (!sbp_u32_decode(ctx, &msg->ns)) { return false; } +bool sbp_msg_utc_time_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_utc_time_t *msg) { + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->year)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->month)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->day)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->hours)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->minutes)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->seconds)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->ns)) { + return false; + } return true; } -s8 sbp_msg_utc_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_utc_time_t *msg) { +s8 sbp_msg_utc_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_utc_time_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -219,63 +317,103 @@ s8 sbp_msg_utc_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp return SBP_OK; } - -s8 sbp_msg_utc_time_send(sbp_state_t *s, u16 sender_id, const sbp_msg_utc_time_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_utc_time_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_utc_time_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_utc_time_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_UTC_TIME, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_UTC_TIME, sender_id, payload_len, payload, + write); } -int sbp_msg_utc_time_cmp(const sbp_msg_utc_time_t *a, const sbp_msg_utc_time_t *b) { +int sbp_msg_utc_time_cmp(const sbp_msg_utc_time_t *a, + const sbp_msg_utc_time_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->year, &b->year); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->month, &b->month); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->day, &b->day); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->hours, &b->hours); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->minutes, &b->minutes); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->seconds, &b->seconds); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->ns, &b->ns); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_utc_time_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_utc_time_gnss_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->year)) { return false; } - if (!sbp_u8_encode(ctx, &msg->month)) { return false; } - if (!sbp_u8_encode(ctx, &msg->day)) { return false; } - if (!sbp_u8_encode(ctx, &msg->hours)) { return false; } - if (!sbp_u8_encode(ctx, &msg->minutes)) { return false; } - if (!sbp_u8_encode(ctx, &msg->seconds)) { return false; } - if (!sbp_u32_encode(ctx, &msg->ns)) { return false; } +bool sbp_msg_utc_time_gnss_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_utc_time_gnss_t *msg) { + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->year)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->month)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->day)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->hours)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->minutes)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->seconds)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->ns)) { + return false; + } return true; } -s8 sbp_msg_utc_time_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_utc_time_gnss_t *msg) { +s8 sbp_msg_utc_time_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_utc_time_gnss_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -289,21 +427,40 @@ s8 sbp_msg_utc_time_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_utc_time_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_utc_time_gnss_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->year)) { return false; } - if (!sbp_u8_decode(ctx, &msg->month)) { return false; } - if (!sbp_u8_decode(ctx, &msg->day)) { return false; } - if (!sbp_u8_decode(ctx, &msg->hours)) { return false; } - if (!sbp_u8_decode(ctx, &msg->minutes)) { return false; } - if (!sbp_u8_decode(ctx, &msg->seconds)) { return false; } - if (!sbp_u32_decode(ctx, &msg->ns)) { return false; } +bool sbp_msg_utc_time_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_utc_time_gnss_t *msg) { + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->year)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->month)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->day)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->hours)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->minutes)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->seconds)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->ns)) { + return false; + } return true; } -s8 sbp_msg_utc_time_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_utc_time_gnss_t *msg) { +s8 sbp_msg_utc_time_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_utc_time_gnss_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -317,61 +474,99 @@ s8 sbp_msg_utc_time_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_utc_time_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_utc_time_gnss_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_utc_time_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_utc_time_gnss_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_utc_time_gnss_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_UTC_TIME_GNSS, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_utc_time_gnss_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_UTC_TIME_GNSS, sender_id, payload_len, + payload, write); } -int sbp_msg_utc_time_gnss_cmp(const sbp_msg_utc_time_gnss_t *a, const sbp_msg_utc_time_gnss_t *b) { +int sbp_msg_utc_time_gnss_cmp(const sbp_msg_utc_time_gnss_t *a, + const sbp_msg_utc_time_gnss_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->year, &b->year); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->month, &b->month); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->day, &b->day); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->hours, &b->hours); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->minutes, &b->minutes); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->seconds, &b->seconds); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->ns, &b->ns); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_dops_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_dops_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->gdop)) { return false; } - if (!sbp_u16_encode(ctx, &msg->pdop)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tdop)) { return false; } - if (!sbp_u16_encode(ctx, &msg->hdop)) { return false; } - if (!sbp_u16_encode(ctx, &msg->vdop)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_dops_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_dops_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->gdop)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->pdop)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tdop)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->hdop)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->vdop)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_dops_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_dops_t *msg) { +s8 sbp_msg_dops_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_dops_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -385,19 +580,33 @@ s8 sbp_msg_dops_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_ return SBP_OK; } -bool sbp_msg_dops_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_dops_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->gdop)) { return false; } - if (!sbp_u16_decode(ctx, &msg->pdop)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tdop)) { return false; } - if (!sbp_u16_decode(ctx, &msg->hdop)) { return false; } - if (!sbp_u16_decode(ctx, &msg->vdop)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_dops_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_dops_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->gdop)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->pdop)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tdop)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->hdop)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->vdop)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_dops_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_dops_t *msg) { +s8 sbp_msg_dops_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_dops_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -411,55 +620,86 @@ s8 sbp_msg_dops_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg return SBP_OK; } - -s8 sbp_msg_dops_send(sbp_state_t *s, u16 sender_id, const sbp_msg_dops_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_dops_send(sbp_state_t *s, u16 sender_id, const sbp_msg_dops_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_dops_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_DOPS, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_DOPS, sender_id, payload_len, payload, + write); } int sbp_msg_dops_cmp(const sbp_msg_dops_t *a, const sbp_msg_dops_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->gdop, &b->gdop); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->pdop, &b->pdop); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tdop, &b->tdop); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->hdop, &b->hdop); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->vdop, &b->vdop); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_pos_ecef_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_ecef_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_double_encode(ctx, &msg->x)) { return false; } - if (!sbp_double_encode(ctx, &msg->y)) { return false; } - if (!sbp_double_encode(ctx, &msg->z)) { return false; } - if (!sbp_u16_encode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_ecef_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_ecef_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_ecef_t *msg) { +s8 sbp_msg_pos_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_ecef_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -473,19 +713,34 @@ s8 sbp_msg_pos_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_pos_ecef_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_ecef_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_double_decode(ctx, &msg->x)) { return false; } - if (!sbp_double_decode(ctx, &msg->y)) { return false; } - if (!sbp_double_decode(ctx, &msg->z)) { return false; } - if (!sbp_u16_decode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_ecef_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_ecef_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_ecef_t *msg) { +s8 sbp_msg_pos_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_ecef_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -499,60 +754,102 @@ s8 sbp_msg_pos_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp return SBP_OK; } - -s8 sbp_msg_pos_ecef_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_ecef_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_pos_ecef_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_ecef_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_pos_ecef_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_POS_ECEF, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_POS_ECEF, sender_id, payload_len, payload, + write); } -int sbp_msg_pos_ecef_cmp(const sbp_msg_pos_ecef_t *a, const sbp_msg_pos_ecef_t *b) { +int sbp_msg_pos_ecef_cmp(const sbp_msg_pos_ecef_t *a, + const sbp_msg_pos_ecef_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->accuracy, &b->accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_pos_ecef_cov_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_ecef_cov_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_double_encode(ctx, &msg->x)) { return false; } - if (!sbp_double_encode(ctx, &msg->y)) { return false; } - if (!sbp_double_encode(ctx, &msg->z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_x_x)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_x_y)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_x_z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_y_y)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_y_z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_z_z)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_ecef_cov_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_ecef_cov_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_x_x)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_x_y)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_x_z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_y_y)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_y_z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_z_z)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_ecef_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_ecef_cov_t *msg) { +s8 sbp_msg_pos_ecef_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_ecef_cov_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -566,24 +863,49 @@ s8 sbp_msg_pos_ecef_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, co return SBP_OK; } -bool sbp_msg_pos_ecef_cov_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_ecef_cov_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_double_decode(ctx, &msg->x)) { return false; } - if (!sbp_double_decode(ctx, &msg->y)) { return false; } - if (!sbp_double_decode(ctx, &msg->z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_x_x)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_x_y)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_x_z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_y_y)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_y_z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_z_z)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_ecef_cov_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_ecef_cov_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_x_x)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_x_y)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_x_z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_y_y)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_y_z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_z_z)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_ecef_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_ecef_cov_t *msg) { +s8 sbp_msg_pos_ecef_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_ecef_cov_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -597,71 +919,117 @@ s8 sbp_msg_pos_ecef_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_pos_ecef_cov_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_ecef_cov_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_pos_ecef_cov_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_ecef_cov_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_pos_ecef_cov_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_POS_ECEF_COV, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_pos_ecef_cov_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_POS_ECEF_COV, sender_id, payload_len, + payload, write); } -int sbp_msg_pos_ecef_cov_cmp(const sbp_msg_pos_ecef_cov_t *a, const sbp_msg_pos_ecef_cov_t *b) { +int sbp_msg_pos_ecef_cov_cmp(const sbp_msg_pos_ecef_cov_t *a, + const sbp_msg_pos_ecef_cov_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_x_x, &b->cov_x_x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_x_y, &b->cov_x_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_x_z, &b->cov_x_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_y_y, &b->cov_y_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_y_z, &b->cov_y_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_z_z, &b->cov_z_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_pos_llh_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_llh_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_double_encode(ctx, &msg->lat)) { return false; } - if (!sbp_double_encode(ctx, &msg->lon)) { return false; } - if (!sbp_double_encode(ctx, &msg->height)) { return false; } - if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_llh_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_llh_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->height)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_llh_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_t *msg) { +s8 sbp_msg_pos_llh_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_llh_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -675,20 +1043,37 @@ s8 sbp_msg_pos_llh_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const s return SBP_OK; } -bool sbp_msg_pos_llh_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_double_decode(ctx, &msg->lat)) { return false; } - if (!sbp_double_decode(ctx, &msg->lon)) { return false; } - if (!sbp_double_decode(ctx, &msg->height)) { return false; } - if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_llh_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_llh_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->height)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_llh_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_t *msg) { +s8 sbp_msg_pos_llh_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_llh_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -702,63 +1087,107 @@ s8 sbp_msg_pos_llh_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ return SBP_OK; } - -s8 sbp_msg_pos_llh_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_llh_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_pos_llh_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_llh_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_pos_llh_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_POS_LLH, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_POS_LLH, sender_id, payload_len, payload, + write); } -int sbp_msg_pos_llh_cmp(const sbp_msg_pos_llh_t *a, const sbp_msg_pos_llh_t *b) { +int sbp_msg_pos_llh_cmp(const sbp_msg_pos_llh_t *a, + const sbp_msg_pos_llh_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lat, &b->lat); - if (ret != 0) { return ret; } - - ret = sbp_double_cmp(&a->lon, &b->lon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + + ret = sbp_double_cmp(&a->lon, &b->lon); + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->height, &b->height); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->h_accuracy, &b->h_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->v_accuracy, &b->v_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_pos_llh_cov_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_llh_cov_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_double_encode(ctx, &msg->lat)) { return false; } - if (!sbp_double_encode(ctx, &msg->lon)) { return false; } - if (!sbp_double_encode(ctx, &msg->height)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_n_n)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_n_e)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_n_d)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_e_e)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_e_d)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_d_d)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_llh_cov_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_llh_cov_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->height)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_n_n)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_n_e)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_n_d)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_e_e)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_e_d)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_d_d)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_llh_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_cov_t *msg) { +s8 sbp_msg_pos_llh_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_llh_cov_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -772,24 +1201,49 @@ s8 sbp_msg_pos_llh_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, con return SBP_OK; } -bool sbp_msg_pos_llh_cov_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh_cov_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_double_decode(ctx, &msg->lat)) { return false; } - if (!sbp_double_decode(ctx, &msg->lon)) { return false; } - if (!sbp_double_decode(ctx, &msg->height)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_n_n)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_n_e)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_n_d)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_e_e)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_e_d)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_d_d)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_llh_cov_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_llh_cov_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->height)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_n_n)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_n_e)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_n_d)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_e_e)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_e_d)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_d_d)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_llh_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_cov_t *msg) { +s8 sbp_msg_pos_llh_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_llh_cov_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -803,66 +1257,104 @@ s8 sbp_msg_pos_llh_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_pos_llh_cov_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_llh_cov_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_pos_llh_cov_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_llh_cov_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_pos_llh_cov_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_POS_LLH_COV, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_pos_llh_cov_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_POS_LLH_COV, sender_id, payload_len, + payload, write); } -int sbp_msg_pos_llh_cov_cmp(const sbp_msg_pos_llh_cov_t *a, const sbp_msg_pos_llh_cov_t *b) { +int sbp_msg_pos_llh_cov_cmp(const sbp_msg_pos_llh_cov_t *a, + const sbp_msg_pos_llh_cov_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lat, &b->lat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lon, &b->lon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->height, &b->height); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_n_n, &b->cov_n_n); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_n_e, &b->cov_n_e); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_n_d, &b->cov_n_d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_e_e, &b->cov_e_e); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_e_d, &b->cov_e_d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_d_d, &b->cov_d_d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_estimated_horizontal_error_ellipse_encode_internal(sbp_encode_ctx_t *ctx, const sbp_estimated_horizontal_error_ellipse_t *msg) -{ - if (!sbp_float_encode(ctx, &msg->semi_major)) { return false; } - if (!sbp_float_encode(ctx, &msg->semi_minor)) { return false; } - if (!sbp_float_encode(ctx, &msg->orientation)) { return false; } +bool sbp_estimated_horizontal_error_ellipse_encode_internal( + sbp_encode_ctx_t *ctx, + const sbp_estimated_horizontal_error_ellipse_t *msg) { + if (!sbp_float_encode(ctx, &msg->semi_major)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->semi_minor)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->orientation)) { + return false; + } return true; } -s8 sbp_estimated_horizontal_error_ellipse_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_estimated_horizontal_error_ellipse_t *msg) { +s8 sbp_estimated_horizontal_error_ellipse_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_estimated_horizontal_error_ellipse_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -876,15 +1368,23 @@ s8 sbp_estimated_horizontal_error_ellipse_encode(uint8_t *buf, uint8_t len, uint return SBP_OK; } -bool sbp_estimated_horizontal_error_ellipse_decode_internal(sbp_decode_ctx_t *ctx, sbp_estimated_horizontal_error_ellipse_t *msg) -{ - if (!sbp_float_decode(ctx, &msg->semi_major)) { return false; } - if (!sbp_float_decode(ctx, &msg->semi_minor)) { return false; } - if (!sbp_float_decode(ctx, &msg->orientation)) { return false; } +bool sbp_estimated_horizontal_error_ellipse_decode_internal( + sbp_decode_ctx_t *ctx, sbp_estimated_horizontal_error_ellipse_t *msg) { + if (!sbp_float_decode(ctx, &msg->semi_major)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->semi_minor)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->orientation)) { + return false; + } return true; } -s8 sbp_estimated_horizontal_error_ellipse_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_estimated_horizontal_error_ellipse_t *msg) { +s8 sbp_estimated_horizontal_error_ellipse_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_estimated_horizontal_error_ellipse_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -898,41 +1398,75 @@ s8 sbp_estimated_horizontal_error_ellipse_decode(const uint8_t *buf, uint8_t len return SBP_OK; } - - -int sbp_estimated_horizontal_error_ellipse_cmp(const sbp_estimated_horizontal_error_ellipse_t *a, const sbp_estimated_horizontal_error_ellipse_t *b) { +int sbp_estimated_horizontal_error_ellipse_cmp( + const sbp_estimated_horizontal_error_ellipse_t *a, + const sbp_estimated_horizontal_error_ellipse_t *b) { int ret = 0; - + ret = sbp_float_cmp(&a->semi_major, &b->semi_major); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->semi_minor, &b->semi_minor); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->orientation, &b->orientation); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_pos_llh_acc_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_llh_acc_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_double_encode(ctx, &msg->lat)) { return false; } - if (!sbp_double_encode(ctx, &msg->lon)) { return false; } - if (!sbp_double_encode(ctx, &msg->height)) { return false; } - if (!sbp_double_encode(ctx, &msg->orthometric_height)) { return false; } - if (!sbp_float_encode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_float_encode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_float_encode(ctx, &msg->ct_accuracy)) { return false; } - if (!sbp_float_encode(ctx, &msg->at_accuracy)) { return false; } - if (!sbp_estimated_horizontal_error_ellipse_encode_internal(ctx, &msg->h_ellipse)) { return false; } - if (!sbp_u8_encode(ctx, &msg->confidence_and_geoid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_llh_acc_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_llh_acc_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->height)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->orthometric_height)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->ct_accuracy)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->at_accuracy)) { + return false; + } + if (!sbp_estimated_horizontal_error_ellipse_encode_internal( + ctx, &msg->h_ellipse)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->confidence_and_geoid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_llh_acc_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_acc_t *msg) { +s8 sbp_msg_pos_llh_acc_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_llh_acc_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -946,25 +1480,53 @@ s8 sbp_msg_pos_llh_acc_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, con return SBP_OK; } -bool sbp_msg_pos_llh_acc_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh_acc_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_double_decode(ctx, &msg->lat)) { return false; } - if (!sbp_double_decode(ctx, &msg->lon)) { return false; } - if (!sbp_double_decode(ctx, &msg->height)) { return false; } - if (!sbp_double_decode(ctx, &msg->orthometric_height)) { return false; } - if (!sbp_float_decode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_float_decode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_float_decode(ctx, &msg->ct_accuracy)) { return false; } - if (!sbp_float_decode(ctx, &msg->at_accuracy)) { return false; } - if (!sbp_estimated_horizontal_error_ellipse_decode_internal(ctx, &msg->h_ellipse)) { return false; } - if (!sbp_u8_decode(ctx, &msg->confidence_and_geoid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_llh_acc_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_llh_acc_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->height)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->orthometric_height)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->ct_accuracy)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->at_accuracy)) { + return false; + } + if (!sbp_estimated_horizontal_error_ellipse_decode_internal( + ctx, &msg->h_ellipse)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->confidence_and_geoid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_llh_acc_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_acc_t *msg) { +s8 sbp_msg_pos_llh_acc_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_llh_acc_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -978,73 +1540,120 @@ s8 sbp_msg_pos_llh_acc_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_pos_llh_acc_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_llh_acc_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_pos_llh_acc_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_llh_acc_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_pos_llh_acc_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_POS_LLH_ACC, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_pos_llh_acc_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_POS_LLH_ACC, sender_id, payload_len, + payload, write); } -int sbp_msg_pos_llh_acc_cmp(const sbp_msg_pos_llh_acc_t *a, const sbp_msg_pos_llh_acc_t *b) { +int sbp_msg_pos_llh_acc_cmp(const sbp_msg_pos_llh_acc_t *a, + const sbp_msg_pos_llh_acc_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lat, &b->lat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lon, &b->lon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->height, &b->height); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->orthometric_height, &b->orthometric_height); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->h_accuracy, &b->h_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->v_accuracy, &b->v_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->ct_accuracy, &b->ct_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->at_accuracy, &b->at_accuracy); - if (ret != 0) { return ret; } - - ret = sbp_estimated_horizontal_error_ellipse_cmp(&a->h_ellipse, &b->h_ellipse); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + + ret = + sbp_estimated_horizontal_error_ellipse_cmp(&a->h_ellipse, &b->h_ellipse); + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->confidence_and_geoid, &b->confidence_and_geoid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_baseline_ecef_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_baseline_ecef_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->x)) { return false; } - if (!sbp_s32_encode(ctx, &msg->y)) { return false; } - if (!sbp_s32_encode(ctx, &msg->z)) { return false; } - if (!sbp_u16_encode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_baseline_ecef_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_baseline_ecef_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_baseline_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_ecef_t *msg) { +s8 sbp_msg_baseline_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_baseline_ecef_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1058,19 +1667,34 @@ s8 sbp_msg_baseline_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_baseline_ecef_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_baseline_ecef_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->x)) { return false; } - if (!sbp_s32_decode(ctx, &msg->y)) { return false; } - if (!sbp_s32_decode(ctx, &msg->z)) { return false; } - if (!sbp_u16_decode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_baseline_ecef_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_baseline_ecef_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_baseline_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_ecef_t *msg) { +s8 sbp_msg_baseline_ecef_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_baseline_ecef_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1084,56 +1708,92 @@ s8 sbp_msg_baseline_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_baseline_ecef_send(sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_ecef_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_baseline_ecef_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_baseline_ecef_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_baseline_ecef_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_BASELINE_ECEF, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_baseline_ecef_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_BASELINE_ECEF, sender_id, payload_len, + payload, write); } -int sbp_msg_baseline_ecef_cmp(const sbp_msg_baseline_ecef_t *a, const sbp_msg_baseline_ecef_t *b) { +int sbp_msg_baseline_ecef_cmp(const sbp_msg_baseline_ecef_t *a, + const sbp_msg_baseline_ecef_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->accuracy, &b->accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_baseline_ned_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_baseline_ned_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->n)) { return false; } - if (!sbp_s32_encode(ctx, &msg->e)) { return false; } - if (!sbp_s32_encode(ctx, &msg->d)) { return false; } - if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_baseline_ned_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_baseline_ned_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->n)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->e)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->d)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_baseline_ned_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_ned_t *msg) { +s8 sbp_msg_baseline_ned_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_baseline_ned_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1147,20 +1807,37 @@ s8 sbp_msg_baseline_ned_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, co return SBP_OK; } -bool sbp_msg_baseline_ned_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_baseline_ned_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->n)) { return false; } - if (!sbp_s32_decode(ctx, &msg->e)) { return false; } - if (!sbp_s32_decode(ctx, &msg->d)) { return false; } - if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_baseline_ned_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_baseline_ned_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->n)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->e)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->d)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_baseline_ned_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_ned_t *msg) { +s8 sbp_msg_baseline_ned_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_baseline_ned_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1174,58 +1851,94 @@ s8 sbp_msg_baseline_ned_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_baseline_ned_send(sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_ned_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_baseline_ned_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_baseline_ned_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_baseline_ned_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_BASELINE_NED, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_baseline_ned_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_BASELINE_NED, sender_id, payload_len, + payload, write); } -int sbp_msg_baseline_ned_cmp(const sbp_msg_baseline_ned_t *a, const sbp_msg_baseline_ned_t *b) { +int sbp_msg_baseline_ned_cmp(const sbp_msg_baseline_ned_t *a, + const sbp_msg_baseline_ned_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->n, &b->n); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->e, &b->e); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->d, &b->d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->h_accuracy, &b->h_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->v_accuracy, &b->v_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_vel_ecef_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ecef_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->x)) { return false; } - if (!sbp_s32_encode(ctx, &msg->y)) { return false; } - if (!sbp_s32_encode(ctx, &msg->z)) { return false; } - if (!sbp_u16_encode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ecef_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_ecef_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ecef_t *msg) { +s8 sbp_msg_vel_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ecef_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1239,19 +1952,34 @@ s8 sbp_msg_vel_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_vel_ecef_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ecef_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->x)) { return false; } - if (!sbp_s32_decode(ctx, &msg->y)) { return false; } - if (!sbp_s32_decode(ctx, &msg->z)) { return false; } - if (!sbp_u16_decode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ecef_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ecef_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ecef_t *msg) { +s8 sbp_msg_vel_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ecef_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1265,60 +1993,102 @@ s8 sbp_msg_vel_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp return SBP_OK; } - -s8 sbp_msg_vel_ecef_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ecef_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_vel_ecef_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ecef_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_vel_ecef_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_VEL_ECEF, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_VEL_ECEF, sender_id, payload_len, payload, + write); } -int sbp_msg_vel_ecef_cmp(const sbp_msg_vel_ecef_t *a, const sbp_msg_vel_ecef_t *b) { +int sbp_msg_vel_ecef_cmp(const sbp_msg_vel_ecef_t *a, + const sbp_msg_vel_ecef_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->accuracy, &b->accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_vel_ecef_cov_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ecef_cov_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->x)) { return false; } - if (!sbp_s32_encode(ctx, &msg->y)) { return false; } - if (!sbp_s32_encode(ctx, &msg->z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_x_x)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_x_y)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_x_z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_y_y)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_y_z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_z_z)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ecef_cov_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_ecef_cov_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_x_x)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_x_y)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_x_z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_y_y)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_y_z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_z_z)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ecef_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ecef_cov_t *msg) { +s8 sbp_msg_vel_ecef_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ecef_cov_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1332,24 +2102,49 @@ s8 sbp_msg_vel_ecef_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, co return SBP_OK; } -bool sbp_msg_vel_ecef_cov_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ecef_cov_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->x)) { return false; } - if (!sbp_s32_decode(ctx, &msg->y)) { return false; } - if (!sbp_s32_decode(ctx, &msg->z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_x_x)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_x_y)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_x_z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_y_y)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_y_z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_z_z)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ecef_cov_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ecef_cov_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_x_x)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_x_y)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_x_z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_y_y)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_y_z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_z_z)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ecef_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ecef_cov_t *msg) { +s8 sbp_msg_vel_ecef_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ecef_cov_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1363,71 +2158,117 @@ s8 sbp_msg_vel_ecef_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_vel_ecef_cov_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ecef_cov_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_vel_ecef_cov_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ecef_cov_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_vel_ecef_cov_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_VEL_ECEF_COV, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_vel_ecef_cov_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_VEL_ECEF_COV, sender_id, payload_len, + payload, write); } -int sbp_msg_vel_ecef_cov_cmp(const sbp_msg_vel_ecef_cov_t *a, const sbp_msg_vel_ecef_cov_t *b) { +int sbp_msg_vel_ecef_cov_cmp(const sbp_msg_vel_ecef_cov_t *a, + const sbp_msg_vel_ecef_cov_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - - ret = sbp_s32_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + + ret = sbp_s32_cmp(&a->y, &b->y); + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_x_x, &b->cov_x_x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_x_y, &b->cov_x_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_x_z, &b->cov_x_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_y_y, &b->cov_y_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_y_z, &b->cov_y_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_z_z, &b->cov_z_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_vel_ned_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ned_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->n)) { return false; } - if (!sbp_s32_encode(ctx, &msg->e)) { return false; } - if (!sbp_s32_encode(ctx, &msg->d)) { return false; } - if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ned_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_ned_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->n)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->e)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->d)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ned_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ned_t *msg) { +s8 sbp_msg_vel_ned_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ned_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1441,20 +2282,37 @@ s8 sbp_msg_vel_ned_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const s return SBP_OK; } -bool sbp_msg_vel_ned_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ned_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->n)) { return false; } - if (!sbp_s32_decode(ctx, &msg->e)) { return false; } - if (!sbp_s32_decode(ctx, &msg->d)) { return false; } - if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ned_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ned_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->n)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->e)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->d)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ned_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ned_t *msg) { +s8 sbp_msg_vel_ned_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ned_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1468,63 +2326,107 @@ s8 sbp_msg_vel_ned_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ return SBP_OK; } - -s8 sbp_msg_vel_ned_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ned_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_vel_ned_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ned_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_vel_ned_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_VEL_NED, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_VEL_NED, sender_id, payload_len, payload, + write); } -int sbp_msg_vel_ned_cmp(const sbp_msg_vel_ned_t *a, const sbp_msg_vel_ned_t *b) { +int sbp_msg_vel_ned_cmp(const sbp_msg_vel_ned_t *a, + const sbp_msg_vel_ned_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->n, &b->n); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->e, &b->e); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->d, &b->d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->h_accuracy, &b->h_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->v_accuracy, &b->v_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_vel_ned_cov_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ned_cov_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->n)) { return false; } - if (!sbp_s32_encode(ctx, &msg->e)) { return false; } - if (!sbp_s32_encode(ctx, &msg->d)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_n_n)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_n_e)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_n_d)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_e_e)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_e_d)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_d_d)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ned_cov_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_ned_cov_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->n)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->e)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->d)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_n_n)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_n_e)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_n_d)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_e_e)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_e_d)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_d_d)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ned_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ned_cov_t *msg) { +s8 sbp_msg_vel_ned_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ned_cov_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1538,24 +2440,49 @@ s8 sbp_msg_vel_ned_cov_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, con return SBP_OK; } -bool sbp_msg_vel_ned_cov_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ned_cov_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->n)) { return false; } - if (!sbp_s32_decode(ctx, &msg->e)) { return false; } - if (!sbp_s32_decode(ctx, &msg->d)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_n_n)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_n_e)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_n_d)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_e_e)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_e_d)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_d_d)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ned_cov_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ned_cov_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->n)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->e)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->d)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_n_n)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_n_e)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_n_d)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_e_e)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_e_d)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_d_d)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ned_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ned_cov_t *msg) { +s8 sbp_msg_vel_ned_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ned_cov_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1569,70 +2496,114 @@ s8 sbp_msg_vel_ned_cov_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_vel_ned_cov_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ned_cov_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_vel_ned_cov_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ned_cov_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_vel_ned_cov_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_VEL_NED_COV, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_vel_ned_cov_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_VEL_NED_COV, sender_id, payload_len, + payload, write); } -int sbp_msg_vel_ned_cov_cmp(const sbp_msg_vel_ned_cov_t *a, const sbp_msg_vel_ned_cov_t *b) { +int sbp_msg_vel_ned_cov_cmp(const sbp_msg_vel_ned_cov_t *a, + const sbp_msg_vel_ned_cov_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->n, &b->n); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->e, &b->e); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->d, &b->d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_n_n, &b->cov_n_n); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_n_e, &b->cov_n_e); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_n_d, &b->cov_n_d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_e_e, &b->cov_e_e); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_e_d, &b->cov_e_d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_d_d, &b->cov_d_d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_pos_ecef_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_ecef_gnss_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_double_encode(ctx, &msg->x)) { return false; } - if (!sbp_double_encode(ctx, &msg->y)) { return false; } - if (!sbp_double_encode(ctx, &msg->z)) { return false; } - if (!sbp_u16_encode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_ecef_gnss_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_ecef_gnss_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_ecef_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_ecef_gnss_t *msg) { +s8 sbp_msg_pos_ecef_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_ecef_gnss_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1646,19 +2617,34 @@ s8 sbp_msg_pos_ecef_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_pos_ecef_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_ecef_gnss_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_double_decode(ctx, &msg->x)) { return false; } - if (!sbp_double_decode(ctx, &msg->y)) { return false; } - if (!sbp_double_decode(ctx, &msg->z)) { return false; } - if (!sbp_u16_decode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_ecef_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_ecef_gnss_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_ecef_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_ecef_gnss_t *msg) { +s8 sbp_msg_pos_ecef_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_pos_ecef_gnss_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1672,60 +2658,105 @@ s8 sbp_msg_pos_ecef_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_pos_ecef_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_ecef_gnss_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_pos_ecef_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_ecef_gnss_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_pos_ecef_gnss_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_POS_ECEF_GNSS, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_pos_ecef_gnss_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_POS_ECEF_GNSS, sender_id, payload_len, + payload, write); } -int sbp_msg_pos_ecef_gnss_cmp(const sbp_msg_pos_ecef_gnss_t *a, const sbp_msg_pos_ecef_gnss_t *b) { +int sbp_msg_pos_ecef_gnss_cmp(const sbp_msg_pos_ecef_gnss_t *a, + const sbp_msg_pos_ecef_gnss_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->accuracy, &b->accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_pos_ecef_cov_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_ecef_cov_gnss_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_double_encode(ctx, &msg->x)) { return false; } - if (!sbp_double_encode(ctx, &msg->y)) { return false; } - if (!sbp_double_encode(ctx, &msg->z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_x_x)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_x_y)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_x_z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_y_y)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_y_z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_z_z)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_ecef_cov_gnss_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_pos_ecef_cov_gnss_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_x_x)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_x_y)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_x_z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_y_y)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_y_z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_z_z)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_ecef_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_ecef_cov_gnss_t *msg) { +s8 sbp_msg_pos_ecef_cov_gnss_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_pos_ecef_cov_gnss_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1739,24 +2770,50 @@ s8 sbp_msg_pos_ecef_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_pos_ecef_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_ecef_cov_gnss_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_double_decode(ctx, &msg->x)) { return false; } - if (!sbp_double_decode(ctx, &msg->y)) { return false; } - if (!sbp_double_decode(ctx, &msg->z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_x_x)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_x_y)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_x_z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_y_y)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_y_z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_z_z)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_ecef_cov_gnss_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_pos_ecef_cov_gnss_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_x_x)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_x_y)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_x_z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_y_y)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_y_z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_z_z)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_ecef_cov_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_ecef_cov_gnss_t *msg) { +s8 sbp_msg_pos_ecef_cov_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_pos_ecef_cov_gnss_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1770,71 +2827,117 @@ s8 sbp_msg_pos_ecef_cov_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_pos_ecef_cov_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_ecef_cov_gnss_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_pos_ecef_cov_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_ecef_cov_gnss_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_pos_ecef_cov_gnss_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_POS_ECEF_COV_GNSS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_pos_ecef_cov_gnss_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_POS_ECEF_COV_GNSS, sender_id, payload_len, + payload, write); } -int sbp_msg_pos_ecef_cov_gnss_cmp(const sbp_msg_pos_ecef_cov_gnss_t *a, const sbp_msg_pos_ecef_cov_gnss_t *b) { +int sbp_msg_pos_ecef_cov_gnss_cmp(const sbp_msg_pos_ecef_cov_gnss_t *a, + const sbp_msg_pos_ecef_cov_gnss_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_x_x, &b->cov_x_x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_x_y, &b->cov_x_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_x_z, &b->cov_x_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_y_y, &b->cov_y_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_y_z, &b->cov_y_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_z_z, &b->cov_z_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_pos_llh_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_llh_gnss_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_double_encode(ctx, &msg->lat)) { return false; } - if (!sbp_double_encode(ctx, &msg->lon)) { return false; } - if (!sbp_double_encode(ctx, &msg->height)) { return false; } - if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_llh_gnss_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_llh_gnss_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->height)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_llh_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_gnss_t *msg) { +s8 sbp_msg_pos_llh_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_llh_gnss_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1848,20 +2951,37 @@ s8 sbp_msg_pos_llh_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, co return SBP_OK; } -bool sbp_msg_pos_llh_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh_gnss_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_double_decode(ctx, &msg->lat)) { return false; } - if (!sbp_double_decode(ctx, &msg->lon)) { return false; } - if (!sbp_double_decode(ctx, &msg->height)) { return false; } - if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_llh_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_llh_gnss_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->height)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_llh_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_gnss_t *msg) { +s8 sbp_msg_pos_llh_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pos_llh_gnss_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1875,63 +2995,110 @@ s8 sbp_msg_pos_llh_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_pos_llh_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_llh_gnss_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_pos_llh_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_llh_gnss_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_pos_llh_gnss_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_POS_LLH_GNSS, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_pos_llh_gnss_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_POS_LLH_GNSS, sender_id, payload_len, + payload, write); } -int sbp_msg_pos_llh_gnss_cmp(const sbp_msg_pos_llh_gnss_t *a, const sbp_msg_pos_llh_gnss_t *b) { +int sbp_msg_pos_llh_gnss_cmp(const sbp_msg_pos_llh_gnss_t *a, + const sbp_msg_pos_llh_gnss_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lat, &b->lat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lon, &b->lon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->height, &b->height); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->h_accuracy, &b->h_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->v_accuracy, &b->v_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_pos_llh_cov_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_llh_cov_gnss_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_double_encode(ctx, &msg->lat)) { return false; } - if (!sbp_double_encode(ctx, &msg->lon)) { return false; } - if (!sbp_double_encode(ctx, &msg->height)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_n_n)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_n_e)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_n_d)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_e_e)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_e_d)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_d_d)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_llh_cov_gnss_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_pos_llh_cov_gnss_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->height)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_n_n)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_n_e)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_n_d)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_e_e)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_e_d)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_d_d)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_llh_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_cov_gnss_t *msg) { +s8 sbp_msg_pos_llh_cov_gnss_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_pos_llh_cov_gnss_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1945,24 +3112,50 @@ s8 sbp_msg_pos_llh_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written return SBP_OK; } -bool sbp_msg_pos_llh_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh_cov_gnss_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_double_decode(ctx, &msg->lat)) { return false; } - if (!sbp_double_decode(ctx, &msg->lon)) { return false; } - if (!sbp_double_decode(ctx, &msg->height)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_n_n)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_n_e)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_n_d)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_e_e)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_e_d)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_d_d)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_llh_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_llh_cov_gnss_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->height)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_n_n)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_n_e)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_n_d)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_e_e)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_e_d)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_d_d)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_llh_cov_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_cov_gnss_t *msg) { +s8 sbp_msg_pos_llh_cov_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_pos_llh_cov_gnss_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1976,70 +3169,114 @@ s8 sbp_msg_pos_llh_cov_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r return SBP_OK; } - -s8 sbp_msg_pos_llh_cov_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_llh_cov_gnss_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_pos_llh_cov_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_llh_cov_gnss_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_pos_llh_cov_gnss_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_POS_LLH_COV_GNSS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_pos_llh_cov_gnss_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_POS_LLH_COV_GNSS, sender_id, payload_len, + payload, write); } -int sbp_msg_pos_llh_cov_gnss_cmp(const sbp_msg_pos_llh_cov_gnss_t *a, const sbp_msg_pos_llh_cov_gnss_t *b) { +int sbp_msg_pos_llh_cov_gnss_cmp(const sbp_msg_pos_llh_cov_gnss_t *a, + const sbp_msg_pos_llh_cov_gnss_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lat, &b->lat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lon, &b->lon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->height, &b->height); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_n_n, &b->cov_n_n); - if (ret != 0) { return ret; } - - ret = sbp_float_cmp(&a->cov_n_e, &b->cov_n_e); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + + ret = sbp_float_cmp(&a->cov_n_e, &b->cov_n_e); + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_n_d, &b->cov_n_d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_e_e, &b->cov_e_e); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_e_d, &b->cov_e_d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_d_d, &b->cov_d_d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_vel_ecef_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ecef_gnss_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->x)) { return false; } - if (!sbp_s32_encode(ctx, &msg->y)) { return false; } - if (!sbp_s32_encode(ctx, &msg->z)) { return false; } - if (!sbp_u16_encode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ecef_gnss_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_ecef_gnss_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ecef_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ecef_gnss_t *msg) { +s8 sbp_msg_vel_ecef_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ecef_gnss_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2053,19 +3290,34 @@ s8 sbp_msg_vel_ecef_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_vel_ecef_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ecef_gnss_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->x)) { return false; } - if (!sbp_s32_decode(ctx, &msg->y)) { return false; } - if (!sbp_s32_decode(ctx, &msg->z)) { return false; } - if (!sbp_u16_decode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ecef_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ecef_gnss_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ecef_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ecef_gnss_t *msg) { +s8 sbp_msg_vel_ecef_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_vel_ecef_gnss_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2079,60 +3331,105 @@ s8 sbp_msg_vel_ecef_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_vel_ecef_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ecef_gnss_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_vel_ecef_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ecef_gnss_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_vel_ecef_gnss_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_VEL_ECEF_GNSS, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_vel_ecef_gnss_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_VEL_ECEF_GNSS, sender_id, payload_len, + payload, write); } -int sbp_msg_vel_ecef_gnss_cmp(const sbp_msg_vel_ecef_gnss_t *a, const sbp_msg_vel_ecef_gnss_t *b) { +int sbp_msg_vel_ecef_gnss_cmp(const sbp_msg_vel_ecef_gnss_t *a, + const sbp_msg_vel_ecef_gnss_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->accuracy, &b->accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_vel_ecef_cov_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ecef_cov_gnss_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->x)) { return false; } - if (!sbp_s32_encode(ctx, &msg->y)) { return false; } - if (!sbp_s32_encode(ctx, &msg->z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_x_x)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_x_y)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_x_z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_y_y)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_y_z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_z_z)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ecef_cov_gnss_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_vel_ecef_cov_gnss_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_x_x)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_x_y)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_x_z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_y_y)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_y_z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_z_z)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ecef_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ecef_cov_gnss_t *msg) { +s8 sbp_msg_vel_ecef_cov_gnss_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_vel_ecef_cov_gnss_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2146,24 +3443,50 @@ s8 sbp_msg_vel_ecef_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_vel_ecef_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ecef_cov_gnss_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->x)) { return false; } - if (!sbp_s32_decode(ctx, &msg->y)) { return false; } - if (!sbp_s32_decode(ctx, &msg->z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_x_x)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_x_y)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_x_z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_y_y)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_y_z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_z_z)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ecef_cov_gnss_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_vel_ecef_cov_gnss_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_x_x)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_x_y)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_x_z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_y_y)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_y_z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_z_z)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ecef_cov_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ecef_cov_gnss_t *msg) { +s8 sbp_msg_vel_ecef_cov_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_vel_ecef_cov_gnss_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2177,71 +3500,117 @@ s8 sbp_msg_vel_ecef_cov_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_vel_ecef_cov_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ecef_cov_gnss_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_vel_ecef_cov_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ecef_cov_gnss_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_vel_ecef_cov_gnss_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_VEL_ECEF_COV_GNSS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_vel_ecef_cov_gnss_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_VEL_ECEF_COV_GNSS, sender_id, payload_len, + payload, write); } -int sbp_msg_vel_ecef_cov_gnss_cmp(const sbp_msg_vel_ecef_cov_gnss_t *a, const sbp_msg_vel_ecef_cov_gnss_t *b) { +int sbp_msg_vel_ecef_cov_gnss_cmp(const sbp_msg_vel_ecef_cov_gnss_t *a, + const sbp_msg_vel_ecef_cov_gnss_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_x_x, &b->cov_x_x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_x_y, &b->cov_x_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_x_z, &b->cov_x_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_y_y, &b->cov_y_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_y_z, &b->cov_y_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_z_z, &b->cov_z_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_vel_ned_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ned_gnss_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->n)) { return false; } - if (!sbp_s32_encode(ctx, &msg->e)) { return false; } - if (!sbp_s32_encode(ctx, &msg->d)) { return false; } - if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ned_gnss_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_ned_gnss_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->n)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->e)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->d)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ned_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ned_gnss_t *msg) { +s8 sbp_msg_vel_ned_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ned_gnss_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2255,20 +3624,37 @@ s8 sbp_msg_vel_ned_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, co return SBP_OK; } -bool sbp_msg_vel_ned_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ned_gnss_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->n)) { return false; } - if (!sbp_s32_decode(ctx, &msg->e)) { return false; } - if (!sbp_s32_decode(ctx, &msg->d)) { return false; } - if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ned_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ned_gnss_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->n)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->e)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->d)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ned_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ned_gnss_t *msg) { +s8 sbp_msg_vel_ned_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_ned_gnss_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2282,63 +3668,110 @@ s8 sbp_msg_vel_ned_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_vel_ned_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ned_gnss_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_vel_ned_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ned_gnss_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_vel_ned_gnss_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_VEL_NED_GNSS, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_vel_ned_gnss_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_VEL_NED_GNSS, sender_id, payload_len, + payload, write); } -int sbp_msg_vel_ned_gnss_cmp(const sbp_msg_vel_ned_gnss_t *a, const sbp_msg_vel_ned_gnss_t *b) { +int sbp_msg_vel_ned_gnss_cmp(const sbp_msg_vel_ned_gnss_t *a, + const sbp_msg_vel_ned_gnss_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->n, &b->n); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->e, &b->e); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->d, &b->d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->h_accuracy, &b->h_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->v_accuracy, &b->v_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_vel_ned_cov_gnss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ned_cov_gnss_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->n)) { return false; } - if (!sbp_s32_encode(ctx, &msg->e)) { return false; } - if (!sbp_s32_encode(ctx, &msg->d)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_n_n)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_n_e)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_n_d)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_e_e)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_e_d)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_d_d)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ned_cov_gnss_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_vel_ned_cov_gnss_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->n)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->e)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->d)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_n_n)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_n_e)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_n_d)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_e_e)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_e_d)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_d_d)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ned_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ned_cov_gnss_t *msg) { +s8 sbp_msg_vel_ned_cov_gnss_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_vel_ned_cov_gnss_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2352,24 +3785,50 @@ s8 sbp_msg_vel_ned_cov_gnss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written return SBP_OK; } -bool sbp_msg_vel_ned_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ned_cov_gnss_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->n)) { return false; } - if (!sbp_s32_decode(ctx, &msg->e)) { return false; } - if (!sbp_s32_decode(ctx, &msg->d)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_n_n)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_n_e)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_n_d)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_e_e)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_e_d)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_d_d)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ned_cov_gnss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ned_cov_gnss_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->n)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->e)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->d)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_n_n)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_n_e)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_n_d)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_e_e)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_e_d)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_d_d)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ned_cov_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ned_cov_gnss_t *msg) { +s8 sbp_msg_vel_ned_cov_gnss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_vel_ned_cov_gnss_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2383,75 +3842,129 @@ s8 sbp_msg_vel_ned_cov_gnss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r return SBP_OK; } - -s8 sbp_msg_vel_ned_cov_gnss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ned_cov_gnss_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_vel_ned_cov_gnss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ned_cov_gnss_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_vel_ned_cov_gnss_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_VEL_NED_COV_GNSS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_vel_ned_cov_gnss_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_VEL_NED_COV_GNSS, sender_id, payload_len, + payload, write); } -int sbp_msg_vel_ned_cov_gnss_cmp(const sbp_msg_vel_ned_cov_gnss_t *a, const sbp_msg_vel_ned_cov_gnss_t *b) { +int sbp_msg_vel_ned_cov_gnss_cmp(const sbp_msg_vel_ned_cov_gnss_t *a, + const sbp_msg_vel_ned_cov_gnss_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->n, &b->n); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->e, &b->e); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->d, &b->d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_n_n, &b->cov_n_n); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_n_e, &b->cov_n_e); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_n_d, &b->cov_n_d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_e_e, &b->cov_e_e); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_e_d, &b->cov_e_d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_d_d, &b->cov_d_d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_vel_body_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_body_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->x)) { return false; } - if (!sbp_s32_encode(ctx, &msg->y)) { return false; } - if (!sbp_s32_encode(ctx, &msg->z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_x_x)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_x_y)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_x_z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_y_y)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_y_z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_z_z)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_body_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_body_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_x_x)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_x_y)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_x_z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_y_y)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_y_z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_z_z)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_body_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_body_t *msg) { +s8 sbp_msg_vel_body_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_body_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2465,24 +3978,49 @@ s8 sbp_msg_vel_body_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_vel_body_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_body_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->x)) { return false; } - if (!sbp_s32_decode(ctx, &msg->y)) { return false; } - if (!sbp_s32_decode(ctx, &msg->z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_x_x)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_x_y)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_x_z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_y_y)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_y_z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_z_z)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_body_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_body_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_x_x)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_x_y)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_x_z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_y_y)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_y_z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_z_z)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_body_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_body_t *msg) { +s8 sbp_msg_vel_body_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_body_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2496,71 +4034,115 @@ s8 sbp_msg_vel_body_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp return SBP_OK; } - -s8 sbp_msg_vel_body_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_body_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_vel_body_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_body_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_vel_body_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_VEL_BODY, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_VEL_BODY, sender_id, payload_len, payload, + write); } -int sbp_msg_vel_body_cmp(const sbp_msg_vel_body_t *a, const sbp_msg_vel_body_t *b) { +int sbp_msg_vel_body_cmp(const sbp_msg_vel_body_t *a, + const sbp_msg_vel_body_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_x_x, &b->cov_x_x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_x_y, &b->cov_x_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_x_z, &b->cov_x_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_y_y, &b->cov_y_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_y_z, &b->cov_y_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_z_z, &b->cov_z_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_vel_cog_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_cog_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u32_encode(ctx, &msg->cog)) { return false; } - if (!sbp_u32_encode(ctx, &msg->sog)) { return false; } - if (!sbp_s32_encode(ctx, &msg->v_up)) { return false; } - if (!sbp_u32_encode(ctx, &msg->cog_accuracy)) { return false; } - if (!sbp_u32_encode(ctx, &msg->sog_accuracy)) { return false; } - if (!sbp_u32_encode(ctx, &msg->v_up_accuracy)) { return false; } - if (!sbp_u16_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_cog_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_cog_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->cog)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->sog)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->v_up)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->cog_accuracy)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->sog_accuracy)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->v_up_accuracy)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_cog_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_cog_t *msg) { +s8 sbp_msg_vel_cog_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_cog_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2574,20 +4156,37 @@ s8 sbp_msg_vel_cog_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const s return SBP_OK; } -bool sbp_msg_vel_cog_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_cog_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u32_decode(ctx, &msg->cog)) { return false; } - if (!sbp_u32_decode(ctx, &msg->sog)) { return false; } - if (!sbp_s32_decode(ctx, &msg->v_up)) { return false; } - if (!sbp_u32_decode(ctx, &msg->cog_accuracy)) { return false; } - if (!sbp_u32_decode(ctx, &msg->sog_accuracy)) { return false; } - if (!sbp_u32_decode(ctx, &msg->v_up_accuracy)) { return false; } - if (!sbp_u16_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_cog_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_cog_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->cog)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->sog)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->v_up)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->cog_accuracy)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->sog_accuracy)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->v_up_accuracy)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_cog_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_cog_t *msg) { +s8 sbp_msg_vel_cog_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_vel_cog_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2601,53 +4200,77 @@ s8 sbp_msg_vel_cog_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ return SBP_OK; } - -s8 sbp_msg_vel_cog_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_cog_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_vel_cog_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_cog_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_vel_cog_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_VEL_COG, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_VEL_COG, sender_id, payload_len, payload, + write); } -int sbp_msg_vel_cog_cmp(const sbp_msg_vel_cog_t *a, const sbp_msg_vel_cog_t *b) { +int sbp_msg_vel_cog_cmp(const sbp_msg_vel_cog_t *a, + const sbp_msg_vel_cog_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->cog, &b->cog); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->sog, &b->sog); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->v_up, &b->v_up); - if (ret != 0) { return ret; } - - ret = sbp_u32_cmp(&a->cog_accuracy, &b->cog_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + + ret = sbp_u32_cmp(&a->cog_accuracy, &b->cog_accuracy); + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->sog_accuracy, &b->sog_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->v_up_accuracy, &b->v_up_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_age_corrections_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_age_corrections_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->age)) { return false; } +bool sbp_msg_age_corrections_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_age_corrections_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->age)) { + return false; + } return true; } -s8 sbp_msg_age_corrections_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_age_corrections_t *msg) { +s8 sbp_msg_age_corrections_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_age_corrections_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2661,14 +4284,20 @@ s8 sbp_msg_age_corrections_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_age_corrections_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_age_corrections_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->age)) { return false; } +bool sbp_msg_age_corrections_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_age_corrections_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->age)) { + return false; + } return true; } -s8 sbp_msg_age_corrections_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_age_corrections_t *msg) { +s8 sbp_msg_age_corrections_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_age_corrections_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2682,37 +4311,55 @@ s8 sbp_msg_age_corrections_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_age_corrections_send(sbp_state_t *s, u16 sender_id, const sbp_msg_age_corrections_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_age_corrections_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_age_corrections_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_age_corrections_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_AGE_CORRECTIONS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_age_corrections_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_AGE_CORRECTIONS, sender_id, payload_len, + payload, write); } -int sbp_msg_age_corrections_cmp(const sbp_msg_age_corrections_t *a, const sbp_msg_age_corrections_t *b) { +int sbp_msg_age_corrections_cmp(const sbp_msg_age_corrections_t *a, + const sbp_msg_age_corrections_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->age, &b->age); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_gps_time_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_gps_time_dep_a_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->wn)) { return false; } - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->ns_residual)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_gps_time_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_gps_time_dep_a_t *msg) { + if (!sbp_u16_encode(ctx, &msg->wn)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->ns_residual)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_gps_time_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_gps_time_dep_a_t *msg) { +s8 sbp_msg_gps_time_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_gps_time_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2726,16 +4373,26 @@ s8 sbp_msg_gps_time_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_gps_time_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gps_time_dep_a_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->wn)) { return false; } - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->ns_residual)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_gps_time_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_gps_time_dep_a_t *msg) { + if (!sbp_u16_decode(ctx, &msg->wn)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->ns_residual)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_gps_time_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_gps_time_dep_a_t *msg) { +s8 sbp_msg_gps_time_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_gps_time_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2749,45 +4406,71 @@ s8 sbp_msg_gps_time_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - -s8 sbp_msg_gps_time_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_gps_time_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_gps_time_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_gps_time_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_gps_time_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_GPS_TIME_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_gps_time_dep_a_encode(payload, sizeof(payload), &payload_len, + msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_GPS_TIME_DEP_A, sender_id, payload_len, + payload, write); } -int sbp_msg_gps_time_dep_a_cmp(const sbp_msg_gps_time_dep_a_t *a, const sbp_msg_gps_time_dep_a_t *b) { +int sbp_msg_gps_time_dep_a_cmp(const sbp_msg_gps_time_dep_a_t *a, + const sbp_msg_gps_time_dep_a_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->wn, &b->wn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->ns_residual, &b->ns_residual); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_dops_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_dops_dep_a_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->gdop)) { return false; } - if (!sbp_u16_encode(ctx, &msg->pdop)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tdop)) { return false; } - if (!sbp_u16_encode(ctx, &msg->hdop)) { return false; } - if (!sbp_u16_encode(ctx, &msg->vdop)) { return false; } +bool sbp_msg_dops_dep_a_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_dops_dep_a_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->gdop)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->pdop)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tdop)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->hdop)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->vdop)) { + return false; + } return true; } -s8 sbp_msg_dops_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_dops_dep_a_t *msg) { +s8 sbp_msg_dops_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_dops_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2801,18 +4484,31 @@ s8 sbp_msg_dops_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, cons return SBP_OK; } -bool sbp_msg_dops_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_dops_dep_a_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->gdop)) { return false; } - if (!sbp_u16_decode(ctx, &msg->pdop)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tdop)) { return false; } - if (!sbp_u16_decode(ctx, &msg->hdop)) { return false; } - if (!sbp_u16_decode(ctx, &msg->vdop)) { return false; } +bool sbp_msg_dops_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_dops_dep_a_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->gdop)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->pdop)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tdop)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->hdop)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->vdop)) { + return false; + } return true; } -s8 sbp_msg_dops_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_dops_dep_a_t *msg) { +s8 sbp_msg_dops_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_dops_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2826,52 +4522,84 @@ s8 sbp_msg_dops_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, s return SBP_OK; } - -s8 sbp_msg_dops_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_dops_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_dops_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_dops_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_dops_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_DOPS_DEP_A, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_dops_dep_a_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_DOPS_DEP_A, sender_id, payload_len, + payload, write); } -int sbp_msg_dops_dep_a_cmp(const sbp_msg_dops_dep_a_t *a, const sbp_msg_dops_dep_a_t *b) { +int sbp_msg_dops_dep_a_cmp(const sbp_msg_dops_dep_a_t *a, + const sbp_msg_dops_dep_a_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->gdop, &b->gdop); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->pdop, &b->pdop); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tdop, &b->tdop); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->hdop, &b->hdop); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->vdop, &b->vdop); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_pos_ecef_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_ecef_dep_a_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_double_encode(ctx, &msg->x)) { return false; } - if (!sbp_double_encode(ctx, &msg->y)) { return false; } - if (!sbp_double_encode(ctx, &msg->z)) { return false; } - if (!sbp_u16_encode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_ecef_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_pos_ecef_dep_a_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_ecef_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_ecef_dep_a_t *msg) { +s8 sbp_msg_pos_ecef_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_ecef_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2885,19 +4613,35 @@ s8 sbp_msg_pos_ecef_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_pos_ecef_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_ecef_dep_a_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_double_decode(ctx, &msg->x)) { return false; } - if (!sbp_double_decode(ctx, &msg->y)) { return false; } - if (!sbp_double_decode(ctx, &msg->z)) { return false; } - if (!sbp_u16_decode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_ecef_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_ecef_dep_a_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_ecef_dep_a_t *msg) { +s8 sbp_msg_pos_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_pos_ecef_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2911,56 +4655,92 @@ s8 sbp_msg_pos_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - -s8 sbp_msg_pos_ecef_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_ecef_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_pos_ecef_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_ecef_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_pos_ecef_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_POS_ECEF_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_pos_ecef_dep_a_encode(payload, sizeof(payload), &payload_len, + msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_POS_ECEF_DEP_A, sender_id, payload_len, + payload, write); } -int sbp_msg_pos_ecef_dep_a_cmp(const sbp_msg_pos_ecef_dep_a_t *a, const sbp_msg_pos_ecef_dep_a_t *b) { +int sbp_msg_pos_ecef_dep_a_cmp(const sbp_msg_pos_ecef_dep_a_t *a, + const sbp_msg_pos_ecef_dep_a_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->accuracy, &b->accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_pos_llh_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pos_llh_dep_a_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_double_encode(ctx, &msg->lat)) { return false; } - if (!sbp_double_encode(ctx, &msg->lon)) { return false; } - if (!sbp_double_encode(ctx, &msg->height)) { return false; } - if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_llh_dep_a_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pos_llh_dep_a_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->height)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_llh_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pos_llh_dep_a_t *msg) { +s8 sbp_msg_pos_llh_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pos_llh_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2974,20 +4754,37 @@ s8 sbp_msg_pos_llh_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_pos_llh_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pos_llh_dep_a_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_double_decode(ctx, &msg->lat)) { return false; } - if (!sbp_double_decode(ctx, &msg->lon)) { return false; } - if (!sbp_double_decode(ctx, &msg->height)) { return false; } - if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pos_llh_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pos_llh_dep_a_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->height)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pos_llh_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pos_llh_dep_a_t *msg) { +s8 sbp_msg_pos_llh_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_pos_llh_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3001,58 +4798,95 @@ s8 sbp_msg_pos_llh_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_pos_llh_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pos_llh_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_pos_llh_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pos_llh_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_pos_llh_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_POS_LLH_DEP_A, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_pos_llh_dep_a_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_POS_LLH_DEP_A, sender_id, payload_len, + payload, write); } -int sbp_msg_pos_llh_dep_a_cmp(const sbp_msg_pos_llh_dep_a_t *a, const sbp_msg_pos_llh_dep_a_t *b) { +int sbp_msg_pos_llh_dep_a_cmp(const sbp_msg_pos_llh_dep_a_t *a, + const sbp_msg_pos_llh_dep_a_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lat, &b->lat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lon, &b->lon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->height, &b->height); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->h_accuracy, &b->h_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->v_accuracy, &b->v_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_baseline_ecef_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_baseline_ecef_dep_a_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->x)) { return false; } - if (!sbp_s32_encode(ctx, &msg->y)) { return false; } - if (!sbp_s32_encode(ctx, &msg->z)) { return false; } - if (!sbp_u16_encode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_baseline_ecef_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_baseline_ecef_dep_a_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_baseline_ecef_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_ecef_dep_a_t *msg) { +s8 sbp_msg_baseline_ecef_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_baseline_ecef_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3066,19 +4900,35 @@ s8 sbp_msg_baseline_ecef_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_writ return SBP_OK; } -bool sbp_msg_baseline_ecef_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_baseline_ecef_dep_a_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->x)) { return false; } - if (!sbp_s32_decode(ctx, &msg->y)) { return false; } - if (!sbp_s32_decode(ctx, &msg->z)) { return false; } - if (!sbp_u16_decode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_baseline_ecef_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_baseline_ecef_dep_a_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_baseline_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_ecef_dep_a_t *msg) { +s8 sbp_msg_baseline_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_baseline_ecef_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3092,56 +4942,93 @@ s8 sbp_msg_baseline_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } - -s8 sbp_msg_baseline_ecef_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_ecef_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_baseline_ecef_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_baseline_ecef_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_baseline_ecef_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_BASELINE_ECEF_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_baseline_ecef_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_BASELINE_ECEF_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_baseline_ecef_dep_a_cmp(const sbp_msg_baseline_ecef_dep_a_t *a, const sbp_msg_baseline_ecef_dep_a_t *b) { +int sbp_msg_baseline_ecef_dep_a_cmp(const sbp_msg_baseline_ecef_dep_a_t *a, + const sbp_msg_baseline_ecef_dep_a_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->accuracy, &b->accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_baseline_ned_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_baseline_ned_dep_a_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->n)) { return false; } - if (!sbp_s32_encode(ctx, &msg->e)) { return false; } - if (!sbp_s32_encode(ctx, &msg->d)) { return false; } - if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_baseline_ned_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_baseline_ned_dep_a_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->n)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->e)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->d)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_baseline_ned_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_ned_dep_a_t *msg) { +s8 sbp_msg_baseline_ned_dep_a_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_baseline_ned_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3155,20 +5042,38 @@ s8 sbp_msg_baseline_ned_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_writt return SBP_OK; } -bool sbp_msg_baseline_ned_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_baseline_ned_dep_a_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->n)) { return false; } - if (!sbp_s32_decode(ctx, &msg->e)) { return false; } - if (!sbp_s32_decode(ctx, &msg->d)) { return false; } - if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_baseline_ned_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_baseline_ned_dep_a_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->n)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->e)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->d)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_baseline_ned_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_ned_dep_a_t *msg) { +s8 sbp_msg_baseline_ned_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_baseline_ned_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3182,58 +5087,94 @@ s8 sbp_msg_baseline_ned_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } - -s8 sbp_msg_baseline_ned_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_ned_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_baseline_ned_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_baseline_ned_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_baseline_ned_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_BASELINE_NED_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_baseline_ned_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_BASELINE_NED_DEP_A, sender_id, payload_len, + payload, write); } -int sbp_msg_baseline_ned_dep_a_cmp(const sbp_msg_baseline_ned_dep_a_t *a, const sbp_msg_baseline_ned_dep_a_t *b) { +int sbp_msg_baseline_ned_dep_a_cmp(const sbp_msg_baseline_ned_dep_a_t *a, + const sbp_msg_baseline_ned_dep_a_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->n, &b->n); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->e, &b->e); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->d, &b->d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->h_accuracy, &b->h_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->v_accuracy, &b->v_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_vel_ecef_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ecef_dep_a_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->x)) { return false; } - if (!sbp_s32_encode(ctx, &msg->y)) { return false; } - if (!sbp_s32_encode(ctx, &msg->z)) { return false; } - if (!sbp_u16_encode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ecef_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_vel_ecef_dep_a_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ecef_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ecef_dep_a_t *msg) { +s8 sbp_msg_vel_ecef_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ecef_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3247,19 +5188,35 @@ s8 sbp_msg_vel_ecef_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_vel_ecef_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ecef_dep_a_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->x)) { return false; } - if (!sbp_s32_decode(ctx, &msg->y)) { return false; } - if (!sbp_s32_decode(ctx, &msg->z)) { return false; } - if (!sbp_u16_decode(ctx, &msg->accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ecef_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ecef_dep_a_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ecef_dep_a_t *msg) { +s8 sbp_msg_vel_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_vel_ecef_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3273,56 +5230,92 @@ s8 sbp_msg_vel_ecef_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - -s8 sbp_msg_vel_ecef_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ecef_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_vel_ecef_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ecef_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_vel_ecef_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_VEL_ECEF_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_vel_ecef_dep_a_encode(payload, sizeof(payload), &payload_len, + msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_VEL_ECEF_DEP_A, sender_id, payload_len, + payload, write); } -int sbp_msg_vel_ecef_dep_a_cmp(const sbp_msg_vel_ecef_dep_a_t *a, const sbp_msg_vel_ecef_dep_a_t *b) { +int sbp_msg_vel_ecef_dep_a_cmp(const sbp_msg_vel_ecef_dep_a_t *a, + const sbp_msg_vel_ecef_dep_a_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->accuracy, &b->accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_vel_ned_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_vel_ned_dep_a_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->n)) { return false; } - if (!sbp_s32_encode(ctx, &msg->e)) { return false; } - if (!sbp_s32_encode(ctx, &msg->d)) { return false; } - if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ned_dep_a_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_vel_ned_dep_a_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->n)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->e)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->d)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ned_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_vel_ned_dep_a_t *msg) { +s8 sbp_msg_vel_ned_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_vel_ned_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3336,20 +5329,37 @@ s8 sbp_msg_vel_ned_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_vel_ned_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_vel_ned_dep_a_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->n)) { return false; } - if (!sbp_s32_decode(ctx, &msg->e)) { return false; } - if (!sbp_s32_decode(ctx, &msg->d)) { return false; } - if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { return false; } - if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_vel_ned_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_vel_ned_dep_a_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->n)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->e)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->d)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->h_accuracy)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->v_accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_vel_ned_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_vel_ned_dep_a_t *msg) { +s8 sbp_msg_vel_ned_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_vel_ned_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3363,55 +5373,86 @@ s8 sbp_msg_vel_ned_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_vel_ned_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_vel_ned_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_vel_ned_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_vel_ned_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_vel_ned_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_VEL_NED_DEP_A, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_vel_ned_dep_a_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_VEL_NED_DEP_A, sender_id, payload_len, + payload, write); } -int sbp_msg_vel_ned_dep_a_cmp(const sbp_msg_vel_ned_dep_a_t *a, const sbp_msg_vel_ned_dep_a_t *b) { +int sbp_msg_vel_ned_dep_a_cmp(const sbp_msg_vel_ned_dep_a_t *a, + const sbp_msg_vel_ned_dep_a_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->n, &b->n); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->e, &b->e); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->d, &b->d); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->h_accuracy, &b->h_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->v_accuracy, &b->v_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_baseline_heading_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_baseline_heading_dep_a_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u32_encode(ctx, &msg->heading)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_baseline_heading_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_baseline_heading_dep_a_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->heading)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_baseline_heading_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_heading_dep_a_t *msg) { +s8 sbp_msg_baseline_heading_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_baseline_heading_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3425,16 +5466,26 @@ s8 sbp_msg_baseline_heading_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_w return SBP_OK; } -bool sbp_msg_baseline_heading_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_baseline_heading_dep_a_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u32_decode(ctx, &msg->heading)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_baseline_heading_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_baseline_heading_dep_a_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->heading)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_baseline_heading_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_heading_dep_a_t *msg) { +s8 sbp_msg_baseline_heading_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_baseline_heading_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3448,46 +5499,76 @@ s8 sbp_msg_baseline_heading_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_ return SBP_OK; } - -s8 sbp_msg_baseline_heading_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_heading_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_baseline_heading_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_heading_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_baseline_heading_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_BASELINE_HEADING_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_baseline_heading_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_BASELINE_HEADING_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_baseline_heading_dep_a_cmp(const sbp_msg_baseline_heading_dep_a_t *a, const sbp_msg_baseline_heading_dep_a_t *b) { +int sbp_msg_baseline_heading_dep_a_cmp( + const sbp_msg_baseline_heading_dep_a_t *a, + const sbp_msg_baseline_heading_dep_a_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->heading, &b->heading); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_protection_level_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_protection_level_dep_a_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->vpl)) { return false; } - if (!sbp_u16_encode(ctx, &msg->hpl)) { return false; } - if (!sbp_double_encode(ctx, &msg->lat)) { return false; } - if (!sbp_double_encode(ctx, &msg->lon)) { return false; } - if (!sbp_double_encode(ctx, &msg->height)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_protection_level_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_protection_level_dep_a_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->vpl)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->hpl)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->height)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_protection_level_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_protection_level_dep_a_t *msg) { +s8 sbp_msg_protection_level_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_protection_level_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3501,19 +5582,35 @@ s8 sbp_msg_protection_level_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_w return SBP_OK; } -bool sbp_msg_protection_level_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_protection_level_dep_a_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->vpl)) { return false; } - if (!sbp_u16_decode(ctx, &msg->hpl)) { return false; } - if (!sbp_double_decode(ctx, &msg->lat)) { return false; } - if (!sbp_double_decode(ctx, &msg->lon)) { return false; } - if (!sbp_double_decode(ctx, &msg->height)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_protection_level_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_protection_level_dep_a_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->vpl)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->hpl)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->height)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_protection_level_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_protection_level_dep_a_t *msg) { +s8 sbp_msg_protection_level_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_protection_level_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3527,69 +5624,133 @@ s8 sbp_msg_protection_level_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_ return SBP_OK; } - -s8 sbp_msg_protection_level_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_protection_level_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_protection_level_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_protection_level_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_protection_level_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_PROTECTION_LEVEL_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_protection_level_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_PROTECTION_LEVEL_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_protection_level_dep_a_cmp(const sbp_msg_protection_level_dep_a_t *a, const sbp_msg_protection_level_dep_a_t *b) { +int sbp_msg_protection_level_dep_a_cmp( + const sbp_msg_protection_level_dep_a_t *a, + const sbp_msg_protection_level_dep_a_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->vpl, &b->vpl); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->hpl, &b->hpl); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lat, &b->lat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lon, &b->lon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->height, &b->height); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_protection_level_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_protection_level_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s16_encode(ctx, &msg->wn)) { return false; } - if (!sbp_u16_encode(ctx, &msg->hpl)) { return false; } - if (!sbp_u16_encode(ctx, &msg->vpl)) { return false; } - if (!sbp_u16_encode(ctx, &msg->atpl)) { return false; } - if (!sbp_u16_encode(ctx, &msg->ctpl)) { return false; } - if (!sbp_u16_encode(ctx, &msg->hvpl)) { return false; } - if (!sbp_u16_encode(ctx, &msg->vvpl)) { return false; } - if (!sbp_u16_encode(ctx, &msg->hopl)) { return false; } - if (!sbp_u16_encode(ctx, &msg->popl)) { return false; } - if (!sbp_u16_encode(ctx, &msg->ropl)) { return false; } - if (!sbp_double_encode(ctx, &msg->lat)) { return false; } - if (!sbp_double_encode(ctx, &msg->lon)) { return false; } - if (!sbp_double_encode(ctx, &msg->height)) { return false; } - if (!sbp_s32_encode(ctx, &msg->v_x)) { return false; } - if (!sbp_s32_encode(ctx, &msg->v_y)) { return false; } - if (!sbp_s32_encode(ctx, &msg->v_z)) { return false; } - if (!sbp_s32_encode(ctx, &msg->roll)) { return false; } - if (!sbp_s32_encode(ctx, &msg->pitch)) { return false; } - if (!sbp_s32_encode(ctx, &msg->heading)) { return false; } - if (!sbp_u32_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_protection_level_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_protection_level_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->wn)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->hpl)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->vpl)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->atpl)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->ctpl)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->hvpl)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->vvpl)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->hopl)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->popl)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->ropl)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->height)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->v_x)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->v_y)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->v_z)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->roll)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->pitch)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->heading)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_protection_level_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_protection_level_t *msg) { +s8 sbp_msg_protection_level_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_protection_level_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3603,33 +5764,77 @@ s8 sbp_msg_protection_level_encode(uint8_t *buf, uint8_t len, uint8_t *n_written return SBP_OK; } -bool sbp_msg_protection_level_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_protection_level_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s16_decode(ctx, &msg->wn)) { return false; } - if (!sbp_u16_decode(ctx, &msg->hpl)) { return false; } - if (!sbp_u16_decode(ctx, &msg->vpl)) { return false; } - if (!sbp_u16_decode(ctx, &msg->atpl)) { return false; } - if (!sbp_u16_decode(ctx, &msg->ctpl)) { return false; } - if (!sbp_u16_decode(ctx, &msg->hvpl)) { return false; } - if (!sbp_u16_decode(ctx, &msg->vvpl)) { return false; } - if (!sbp_u16_decode(ctx, &msg->hopl)) { return false; } - if (!sbp_u16_decode(ctx, &msg->popl)) { return false; } - if (!sbp_u16_decode(ctx, &msg->ropl)) { return false; } - if (!sbp_double_decode(ctx, &msg->lat)) { return false; } - if (!sbp_double_decode(ctx, &msg->lon)) { return false; } - if (!sbp_double_decode(ctx, &msg->height)) { return false; } - if (!sbp_s32_decode(ctx, &msg->v_x)) { return false; } - if (!sbp_s32_decode(ctx, &msg->v_y)) { return false; } - if (!sbp_s32_decode(ctx, &msg->v_z)) { return false; } - if (!sbp_s32_decode(ctx, &msg->roll)) { return false; } - if (!sbp_s32_decode(ctx, &msg->pitch)) { return false; } - if (!sbp_s32_decode(ctx, &msg->heading)) { return false; } - if (!sbp_u32_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_protection_level_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_protection_level_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->wn)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->hpl)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->vpl)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->atpl)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->ctpl)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->hvpl)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->vvpl)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->hopl)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->popl)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->ropl)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->height)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->v_x)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->v_y)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->v_z)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->roll)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->pitch)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->heading)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_protection_level_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_protection_level_t *msg) { +s8 sbp_msg_protection_level_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_protection_level_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3643,99 +5848,165 @@ s8 sbp_msg_protection_level_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r return SBP_OK; } - -s8 sbp_msg_protection_level_send(sbp_state_t *s, u16 sender_id, const sbp_msg_protection_level_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_protection_level_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_protection_level_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_protection_level_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_PROTECTION_LEVEL, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_protection_level_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_PROTECTION_LEVEL, sender_id, payload_len, + payload, write); } -int sbp_msg_protection_level_cmp(const sbp_msg_protection_level_t *a, const sbp_msg_protection_level_t *b) { +int sbp_msg_protection_level_cmp(const sbp_msg_protection_level_t *a, + const sbp_msg_protection_level_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->wn, &b->wn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->hpl, &b->hpl); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->vpl, &b->vpl); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->atpl, &b->atpl); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->ctpl, &b->ctpl); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->hvpl, &b->hvpl); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->vvpl, &b->vvpl); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->hopl, &b->hopl); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->popl, &b->popl); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->ropl, &b->ropl); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lat, &b->lat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lon, &b->lon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->height, &b->height); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->v_x, &b->v_x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->v_y, &b->v_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->v_z, &b->v_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->roll, &b->roll); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->pitch, &b->pitch); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->heading, &b->heading); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_utc_leap_second_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_utc_leap_second_t *msg) -{ - if (!sbp_s16_encode(ctx, &msg->reserved_0)) { return false; } - if (!sbp_s16_encode(ctx, &msg->reserved_1)) { return false; } - if (!sbp_s8_encode(ctx, &msg->reserved_2)) { return false; } - if (!sbp_s8_encode(ctx, &msg->count_before)) { return false; } - if (!sbp_u16_encode(ctx, &msg->reserved_3)) { return false; } - if (!sbp_u16_encode(ctx, &msg->reserved_4)) { return false; } - if (!sbp_u16_encode(ctx, &msg->ref_wn)) { return false; } - if (!sbp_u8_encode(ctx, &msg->ref_dn)) { return false; } - if (!sbp_s8_encode(ctx, &msg->count_after)) { return false; } +bool sbp_msg_utc_leap_second_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_utc_leap_second_t *msg) { + if (!sbp_s16_encode(ctx, &msg->reserved_0)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->reserved_1)) { + return false; + } + if (!sbp_s8_encode(ctx, &msg->reserved_2)) { + return false; + } + if (!sbp_s8_encode(ctx, &msg->count_before)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->reserved_3)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->reserved_4)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->ref_wn)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->ref_dn)) { + return false; + } + if (!sbp_s8_encode(ctx, &msg->count_after)) { + return false; + } return true; } -s8 sbp_msg_utc_leap_second_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_utc_leap_second_t *msg) { +s8 sbp_msg_utc_leap_second_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_utc_leap_second_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3749,21 +6020,41 @@ s8 sbp_msg_utc_leap_second_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_utc_leap_second_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_utc_leap_second_t *msg) -{ - if (!sbp_s16_decode(ctx, &msg->reserved_0)) { return false; } - if (!sbp_s16_decode(ctx, &msg->reserved_1)) { return false; } - if (!sbp_s8_decode(ctx, &msg->reserved_2)) { return false; } - if (!sbp_s8_decode(ctx, &msg->count_before)) { return false; } - if (!sbp_u16_decode(ctx, &msg->reserved_3)) { return false; } - if (!sbp_u16_decode(ctx, &msg->reserved_4)) { return false; } - if (!sbp_u16_decode(ctx, &msg->ref_wn)) { return false; } - if (!sbp_u8_decode(ctx, &msg->ref_dn)) { return false; } - if (!sbp_s8_decode(ctx, &msg->count_after)) { return false; } +bool sbp_msg_utc_leap_second_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_utc_leap_second_t *msg) { + if (!sbp_s16_decode(ctx, &msg->reserved_0)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->reserved_1)) { + return false; + } + if (!sbp_s8_decode(ctx, &msg->reserved_2)) { + return false; + } + if (!sbp_s8_decode(ctx, &msg->count_before)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->reserved_3)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->reserved_4)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->ref_wn)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->ref_dn)) { + return false; + } + if (!sbp_s8_decode(ctx, &msg->count_after)) { + return false; + } return true; } -s8 sbp_msg_utc_leap_second_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_utc_leap_second_t *msg) { +s8 sbp_msg_utc_leap_second_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_utc_leap_second_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3777,80 +6068,143 @@ s8 sbp_msg_utc_leap_second_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_utc_leap_second_send(sbp_state_t *s, u16 sender_id, const sbp_msg_utc_leap_second_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_utc_leap_second_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_utc_leap_second_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_utc_leap_second_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_UTC_LEAP_SECOND, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_utc_leap_second_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_UTC_LEAP_SECOND, sender_id, payload_len, + payload, write); } -int sbp_msg_utc_leap_second_cmp(const sbp_msg_utc_leap_second_t *a, const sbp_msg_utc_leap_second_t *b) { +int sbp_msg_utc_leap_second_cmp(const sbp_msg_utc_leap_second_t *a, + const sbp_msg_utc_leap_second_t *b) { int ret = 0; - + ret = sbp_s16_cmp(&a->reserved_0, &b->reserved_0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->reserved_1, &b->reserved_1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s8_cmp(&a->reserved_2, &b->reserved_2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s8_cmp(&a->count_before, &b->count_before); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->reserved_3, &b->reserved_3); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->reserved_4, &b->reserved_4); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->ref_wn, &b->ref_wn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->ref_dn, &b->ref_dn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s8_cmp(&a->count_after, &b->count_after); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_reference_frame_param_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_reference_frame_param_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->ssr_iod)) { return false; } - for (size_t i = 0; i < SBP_MSG_REFERENCE_FRAME_PARAM_SN_MAX; i++) - { - if (!sbp_char_encode(ctx, &msg->sn[i])) { return false; } - } - for (size_t i = 0; i < SBP_MSG_REFERENCE_FRAME_PARAM_TN_MAX; i++) - { - if (!sbp_char_encode(ctx, &msg->tn[i])) { return false; } - } - if (!sbp_u8_encode(ctx, &msg->sin)) { return false; } - if (!sbp_u16_encode(ctx, &msg->utn)) { return false; } - if (!sbp_u16_encode(ctx, &msg->re_t0)) { return false; } - if (!sbp_s32_encode(ctx, &msg->delta_X0)) { return false; } - if (!sbp_s32_encode(ctx, &msg->delta_Y0)) { return false; } - if (!sbp_s32_encode(ctx, &msg->delta_Z0)) { return false; } - if (!sbp_s32_encode(ctx, &msg->theta_01)) { return false; } - if (!sbp_s32_encode(ctx, &msg->theta_02)) { return false; } - if (!sbp_s32_encode(ctx, &msg->theta_03)) { return false; } - if (!sbp_s32_encode(ctx, &msg->scale)) { return false; } - if (!sbp_s32_encode(ctx, &msg->dot_delta_X0)) { return false; } - if (!sbp_s32_encode(ctx, &msg->dot_delta_Y0)) { return false; } - if (!sbp_s32_encode(ctx, &msg->dot_delta_Z0)) { return false; } - if (!sbp_s32_encode(ctx, &msg->dot_theta_01)) { return false; } - if (!sbp_s32_encode(ctx, &msg->dot_theta_02)) { return false; } - if (!sbp_s32_encode(ctx, &msg->dot_theta_03)) { return false; } - if (!sbp_s16_encode(ctx, &msg->dot_scale)) { return false; } +bool sbp_msg_reference_frame_param_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_reference_frame_param_t *msg) { + if (!sbp_u8_encode(ctx, &msg->ssr_iod)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_REFERENCE_FRAME_PARAM_SN_MAX; i++) { + if (!sbp_char_encode(ctx, &msg->sn[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_REFERENCE_FRAME_PARAM_TN_MAX; i++) { + if (!sbp_char_encode(ctx, &msg->tn[i])) { + return false; + } + } + if (!sbp_u8_encode(ctx, &msg->sin)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->utn)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->re_t0)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->delta_X0)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->delta_Y0)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->delta_Z0)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->theta_01)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->theta_02)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->theta_03)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->scale)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->dot_delta_X0)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->dot_delta_Y0)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->dot_delta_Z0)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->dot_theta_01)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->dot_theta_02)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->dot_theta_03)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->dot_scale)) { + return false; + } return true; } -s8 sbp_msg_reference_frame_param_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_reference_frame_param_t *msg) { +s8 sbp_msg_reference_frame_param_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_reference_frame_param_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3864,36 +6218,78 @@ s8 sbp_msg_reference_frame_param_encode(uint8_t *buf, uint8_t len, uint8_t *n_wr return SBP_OK; } -bool sbp_msg_reference_frame_param_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_reference_frame_param_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->ssr_iod)) { return false; } +bool sbp_msg_reference_frame_param_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_reference_frame_param_t *msg) { + if (!sbp_u8_decode(ctx, &msg->ssr_iod)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_REFERENCE_FRAME_PARAM_SN_MAX; i++) { - if (!sbp_char_decode(ctx, &msg->sn[i])) { return false; } + if (!sbp_char_decode(ctx, &msg->sn[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_REFERENCE_FRAME_PARAM_TN_MAX; i++) { - if (!sbp_char_decode(ctx, &msg->tn[i])) { return false; } - } - if (!sbp_u8_decode(ctx, &msg->sin)) { return false; } - if (!sbp_u16_decode(ctx, &msg->utn)) { return false; } - if (!sbp_u16_decode(ctx, &msg->re_t0)) { return false; } - if (!sbp_s32_decode(ctx, &msg->delta_X0)) { return false; } - if (!sbp_s32_decode(ctx, &msg->delta_Y0)) { return false; } - if (!sbp_s32_decode(ctx, &msg->delta_Z0)) { return false; } - if (!sbp_s32_decode(ctx, &msg->theta_01)) { return false; } - if (!sbp_s32_decode(ctx, &msg->theta_02)) { return false; } - if (!sbp_s32_decode(ctx, &msg->theta_03)) { return false; } - if (!sbp_s32_decode(ctx, &msg->scale)) { return false; } - if (!sbp_s32_decode(ctx, &msg->dot_delta_X0)) { return false; } - if (!sbp_s32_decode(ctx, &msg->dot_delta_Y0)) { return false; } - if (!sbp_s32_decode(ctx, &msg->dot_delta_Z0)) { return false; } - if (!sbp_s32_decode(ctx, &msg->dot_theta_01)) { return false; } - if (!sbp_s32_decode(ctx, &msg->dot_theta_02)) { return false; } - if (!sbp_s32_decode(ctx, &msg->dot_theta_03)) { return false; } - if (!sbp_s16_decode(ctx, &msg->dot_scale)) { return false; } + if (!sbp_char_decode(ctx, &msg->tn[i])) { + return false; + } + } + if (!sbp_u8_decode(ctx, &msg->sin)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->utn)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->re_t0)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->delta_X0)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->delta_Y0)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->delta_Z0)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->theta_01)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->theta_02)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->theta_03)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->scale)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->dot_delta_X0)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->dot_delta_Y0)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->dot_delta_Z0)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->dot_theta_01)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->dot_theta_02)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->dot_theta_03)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->dot_scale)) { + return false; + } return true; } -s8 sbp_msg_reference_frame_param_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_reference_frame_param_t *msg) { +s8 sbp_msg_reference_frame_param_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_reference_frame_param_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3907,118 +6303,208 @@ s8 sbp_msg_reference_frame_param_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_reference_frame_param_send(sbp_state_t *s, u16 sender_id, const sbp_msg_reference_frame_param_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_reference_frame_param_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_reference_frame_param_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_reference_frame_param_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_REFERENCE_FRAME_PARAM, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_reference_frame_param_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_REFERENCE_FRAME_PARAM, sender_id, + payload_len, payload, write); } -int sbp_msg_reference_frame_param_cmp(const sbp_msg_reference_frame_param_t *a, const sbp_msg_reference_frame_param_t *b) { +int sbp_msg_reference_frame_param_cmp( + const sbp_msg_reference_frame_param_t *a, + const sbp_msg_reference_frame_param_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->ssr_iod, &b->ssr_iod); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_REFERENCE_FRAME_PARAM_SN_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_REFERENCE_FRAME_PARAM_SN_MAX; + i++) { ret = sbp_char_cmp(&a->sn[i], &b->sn[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_REFERENCE_FRAME_PARAM_TN_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_REFERENCE_FRAME_PARAM_TN_MAX; + i++) { ret = sbp_char_cmp(&a->tn[i], &b->tn[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->sin, &b->sin); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->utn, &b->utn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->re_t0, &b->re_t0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->delta_X0, &b->delta_X0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->delta_Y0, &b->delta_Y0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->delta_Z0, &b->delta_Z0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->theta_01, &b->theta_01); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->theta_02, &b->theta_02); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->theta_03, &b->theta_03); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->scale, &b->scale); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->dot_delta_X0, &b->dot_delta_X0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->dot_delta_Y0, &b->dot_delta_Y0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->dot_delta_Z0, &b->dot_delta_Z0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->dot_theta_01, &b->dot_theta_01); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->dot_theta_02, &b->dot_theta_02); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->dot_theta_03, &b->dot_theta_03); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->dot_scale, &b->dot_scale); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_pose_relative_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pose_relative_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u8_encode(ctx, &msg->sensor_id)) { return false; } - if (!sbp_u32_encode(ctx, &msg->timestamp_1)) { return false; } - if (!sbp_u32_encode(ctx, &msg->timestamp_2)) { return false; } - for (size_t i = 0; i < SBP_MSG_POSE_RELATIVE_TRANS_MAX; i++) - { - if (!sbp_s32_encode(ctx, &msg->trans[i])) { return false; } - } - if (!sbp_s32_encode(ctx, &msg->w)) { return false; } - if (!sbp_s32_encode(ctx, &msg->x)) { return false; } - if (!sbp_s32_encode(ctx, &msg->y)) { return false; } - if (!sbp_s32_encode(ctx, &msg->z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_r_x_x)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_r_x_y)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_r_x_z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_r_y_y)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_r_y_z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_r_z_z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_c_x_x)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_c_x_y)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_c_x_z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_c_y_y)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_c_y_z)) { return false; } - if (!sbp_float_encode(ctx, &msg->cov_c_z_z)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pose_relative_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pose_relative_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->sensor_id)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->timestamp_1)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->timestamp_2)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_POSE_RELATIVE_TRANS_MAX; i++) { + if (!sbp_s32_encode(ctx, &msg->trans[i])) { + return false; + } + } + if (!sbp_s32_encode(ctx, &msg->w)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_r_x_x)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_r_x_y)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_r_x_z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_r_y_y)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_r_y_z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_r_z_z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_c_x_x)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_c_x_y)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_c_x_z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_c_y_y)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_c_y_z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cov_c_z_z)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pose_relative_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pose_relative_t *msg) { +s8 sbp_msg_pose_relative_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pose_relative_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4032,36 +6518,81 @@ s8 sbp_msg_pose_relative_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_pose_relative_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pose_relative_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u8_decode(ctx, &msg->sensor_id)) { return false; } - if (!sbp_u32_decode(ctx, &msg->timestamp_1)) { return false; } - if (!sbp_u32_decode(ctx, &msg->timestamp_2)) { return false; } +bool sbp_msg_pose_relative_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pose_relative_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->sensor_id)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->timestamp_1)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->timestamp_2)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_POSE_RELATIVE_TRANS_MAX; i++) { - if (!sbp_s32_decode(ctx, &msg->trans[i])) { return false; } - } - if (!sbp_s32_decode(ctx, &msg->w)) { return false; } - if (!sbp_s32_decode(ctx, &msg->x)) { return false; } - if (!sbp_s32_decode(ctx, &msg->y)) { return false; } - if (!sbp_s32_decode(ctx, &msg->z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_r_x_x)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_r_x_y)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_r_x_z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_r_y_y)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_r_y_z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_r_z_z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_c_x_x)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_c_x_y)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_c_x_z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_c_y_y)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_c_y_z)) { return false; } - if (!sbp_float_decode(ctx, &msg->cov_c_z_z)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } + if (!sbp_s32_decode(ctx, &msg->trans[i])) { + return false; + } + } + if (!sbp_s32_decode(ctx, &msg->w)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_r_x_x)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_r_x_y)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_r_x_z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_r_y_y)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_r_y_z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_r_z_z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_c_x_x)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_c_x_y)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_c_x_z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_c_y_y)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_c_y_z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cov_c_z_z)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pose_relative_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pose_relative_t *msg) { +s8 sbp_msg_pose_relative_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_pose_relative_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4075,86 +6606,134 @@ s8 sbp_msg_pose_relative_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_pose_relative_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pose_relative_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_pose_relative_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pose_relative_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_pose_relative_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_POSE_RELATIVE, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_pose_relative_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_POSE_RELATIVE, sender_id, payload_len, + payload, write); } -int sbp_msg_pose_relative_cmp(const sbp_msg_pose_relative_t *a, const sbp_msg_pose_relative_t *b) { +int sbp_msg_pose_relative_cmp(const sbp_msg_pose_relative_t *a, + const sbp_msg_pose_relative_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->sensor_id, &b->sensor_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->timestamp_1, &b->timestamp_1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->timestamp_2, &b->timestamp_2); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_POSE_RELATIVE_TRANS_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_POSE_RELATIVE_TRANS_MAX; i++) { ret = sbp_s32_cmp(&a->trans[i], &b->trans[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->w, &b->w); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_r_x_x, &b->cov_r_x_x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_r_x_y, &b->cov_r_x_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_r_x_z, &b->cov_r_x_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_r_y_y, &b->cov_r_y_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_r_y_z, &b->cov_r_y_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_r_z_z, &b->cov_r_z_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_c_x_x, &b->cov_c_x_x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_c_x_y, &b->cov_c_x_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_c_x_z, &b->cov_c_x_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_c_y_y, &b->cov_c_y_y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_c_y_z, &b->cov_c_y_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cov_c_z_z, &b->cov_c_z_z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/ndb.c b/c/src/ndb.c index c46b31f09..d939ad844 100644 --- a/c/src/ndb.c +++ b/c/src/ndb.c @@ -3,34 +3,51 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include #include +#include +#include #include #include -#include #include +#include +#include -bool sbp_msg_ndb_event_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ndb_event_t *msg) -{ - if (!sbp_u64_encode(ctx, &msg->recv_time)) { return false; } - if (!sbp_u8_encode(ctx, &msg->event)) { return false; } - if (!sbp_u8_encode(ctx, &msg->object_type)) { return false; } - if (!sbp_u8_encode(ctx, &msg->result)) { return false; } - if (!sbp_u8_encode(ctx, &msg->data_source)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->object_sid)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->src_sid)) { return false; } - if (!sbp_u16_encode(ctx, &msg->original_sender)) { return false; } +bool sbp_msg_ndb_event_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ndb_event_t *msg) { + if (!sbp_u64_encode(ctx, &msg->recv_time)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->event)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->object_type)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->result)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->data_source)) { + return false; + } + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->object_sid)) { + return false; + } + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->src_sid)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->original_sender)) { + return false; + } return true; } -s8 sbp_msg_ndb_event_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ndb_event_t *msg) { +s8 sbp_msg_ndb_event_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ndb_event_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -44,20 +61,37 @@ s8 sbp_msg_ndb_event_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_ndb_event_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ndb_event_t *msg) -{ - if (!sbp_u64_decode(ctx, &msg->recv_time)) { return false; } - if (!sbp_u8_decode(ctx, &msg->event)) { return false; } - if (!sbp_u8_decode(ctx, &msg->object_type)) { return false; } - if (!sbp_u8_decode(ctx, &msg->result)) { return false; } - if (!sbp_u8_decode(ctx, &msg->data_source)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->object_sid)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->src_sid)) { return false; } - if (!sbp_u16_decode(ctx, &msg->original_sender)) { return false; } +bool sbp_msg_ndb_event_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ndb_event_t *msg) { + if (!sbp_u64_decode(ctx, &msg->recv_time)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->event)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->object_type)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->result)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->data_source)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->object_sid)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->src_sid)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->original_sender)) { + return false; + } return true; } -s8 sbp_msg_ndb_event_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ndb_event_t *msg) { +s8 sbp_msg_ndb_event_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ndb_event_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -71,41 +105,62 @@ s8 sbp_msg_ndb_event_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - -s8 sbp_msg_ndb_event_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ndb_event_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ndb_event_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ndb_event_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ndb_event_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_NDB_EVENT, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_ndb_event_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_NDB_EVENT, sender_id, payload_len, payload, + write); } -int sbp_msg_ndb_event_cmp(const sbp_msg_ndb_event_t *a, const sbp_msg_ndb_event_t *b) { +int sbp_msg_ndb_event_cmp(const sbp_msg_ndb_event_t *a, + const sbp_msg_ndb_event_t *b) { int ret = 0; - + ret = sbp_u64_cmp(&a->recv_time, &b->recv_time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->event, &b->event); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->object_type, &b->object_type); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->result, &b->result); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->data_source, &b->data_source); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->object_sid, &b->object_sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->src_sid, &b->src_sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->original_sender, &b->original_sender); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/observation.c b/c/src/observation.c index adc2c994a..281977838 100644 --- a/c/src/observation.c +++ b/c/src/observation.c @@ -3,28 +3,33 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include #include +#include +#include #include #include -#include #include +#include +#include -bool sbp_observation_header_encode_internal(sbp_encode_ctx_t *ctx, const sbp_observation_header_t *msg) -{ - if (!sbp_v4_gps_time_encode_internal(ctx, &msg->t)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_obs)) { return false; } +bool sbp_observation_header_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_observation_header_t *msg) { + if (!sbp_v4_gps_time_encode_internal(ctx, &msg->t)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_obs)) { + return false; + } return true; } -s8 sbp_observation_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_observation_header_t *msg) { +s8 sbp_observation_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_observation_header_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -38,14 +43,20 @@ s8 sbp_observation_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_observation_header_decode_internal(sbp_decode_ctx_t *ctx, sbp_observation_header_t *msg) -{ - if (!sbp_v4_gps_time_decode_internal(ctx, &msg->t)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_obs)) { return false; } +bool sbp_observation_header_decode_internal(sbp_decode_ctx_t *ctx, + sbp_observation_header_t *msg) { + if (!sbp_v4_gps_time_decode_internal(ctx, &msg->t)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_obs)) { + return false; + } return true; } -s8 sbp_observation_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_observation_header_t *msg) { +s8 sbp_observation_header_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_observation_header_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -59,27 +70,35 @@ s8 sbp_observation_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - - -int sbp_observation_header_cmp(const sbp_observation_header_t *a, const sbp_observation_header_t *b) { +int sbp_observation_header_cmp(const sbp_observation_header_t *a, + const sbp_observation_header_t *b) { int ret = 0; - + ret = sbp_v4_gps_time_cmp(&a->t, &b->t); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_obs, &b->n_obs); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_doppler_encode_internal(sbp_encode_ctx_t *ctx, const sbp_doppler_t *msg) -{ - if (!sbp_s16_encode(ctx, &msg->i)) { return false; } - if (!sbp_u8_encode(ctx, &msg->f)) { return false; } +bool sbp_doppler_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_doppler_t *msg) { + if (!sbp_s16_encode(ctx, &msg->i)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->f)) { + return false; + } return true; } -s8 sbp_doppler_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_doppler_t *msg) { +s8 sbp_doppler_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_doppler_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -93,14 +112,18 @@ s8 sbp_doppler_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_d return SBP_OK; } -bool sbp_doppler_decode_internal(sbp_decode_ctx_t *ctx, sbp_doppler_t *msg) -{ - if (!sbp_s16_decode(ctx, &msg->i)) { return false; } - if (!sbp_u8_decode(ctx, &msg->f)) { return false; } +bool sbp_doppler_decode_internal(sbp_decode_ctx_t *ctx, sbp_doppler_t *msg) { + if (!sbp_s16_decode(ctx, &msg->i)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->f)) { + return false; + } return true; } -s8 sbp_doppler_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_doppler_t *msg) { +s8 sbp_doppler_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_doppler_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -114,32 +137,49 @@ s8 sbp_doppler_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_dopp return SBP_OK; } - - int sbp_doppler_cmp(const sbp_doppler_t *a, const sbp_doppler_t *b) { int ret = 0; - + ret = sbp_s16_cmp(&a->i, &b->i); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->f, &b->f); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_packed_obs_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->P)) { return false; } - if (!sbp_carrier_phase_encode_internal(ctx, &msg->L)) { return false; } - if (!sbp_doppler_encode_internal(ctx, &msg->D)) { return false; } - if (!sbp_u8_encode(ctx, &msg->cn0)) { return false; } - if (!sbp_u8_encode(ctx, &msg->lock)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } +bool sbp_packed_obs_content_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_t *msg) { + if (!sbp_u32_encode(ctx, &msg->P)) { + return false; + } + if (!sbp_carrier_phase_encode_internal(ctx, &msg->L)) { + return false; + } + if (!sbp_doppler_encode_internal(ctx, &msg->D)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->lock)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_packed_obs_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_packed_obs_content_t *msg) { +s8 sbp_packed_obs_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_packed_obs_content_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -153,19 +193,35 @@ s8 sbp_packed_obs_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_packed_obs_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_packed_obs_content_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->P)) { return false; } - if (!sbp_carrier_phase_decode_internal(ctx, &msg->L)) { return false; } - if (!sbp_doppler_decode_internal(ctx, &msg->D)) { return false; } - if (!sbp_u8_decode(ctx, &msg->cn0)) { return false; } - if (!sbp_u8_decode(ctx, &msg->lock)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } +bool sbp_packed_obs_content_decode_internal(sbp_decode_ctx_t *ctx, + sbp_packed_obs_content_t *msg) { + if (!sbp_u32_decode(ctx, &msg->P)) { + return false; + } + if (!sbp_carrier_phase_decode_internal(ctx, &msg->L)) { + return false; + } + if (!sbp_doppler_decode_internal(ctx, &msg->D)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->lock)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_packed_obs_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_packed_obs_content_t *msg) { +s8 sbp_packed_obs_content_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_packed_obs_content_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -179,48 +235,78 @@ s8 sbp_packed_obs_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - - -int sbp_packed_obs_content_cmp(const sbp_packed_obs_content_t *a, const sbp_packed_obs_content_t *b) { +int sbp_packed_obs_content_cmp(const sbp_packed_obs_content_t *a, + const sbp_packed_obs_content_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->P, &b->P); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_carrier_phase_cmp(&a->L, &b->L); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_doppler_cmp(&a->D, &b->D); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->cn0, &b->cn0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->lock, &b->lock); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_packed_osr_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_packed_osr_content_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->P)) { return false; } - if (!sbp_carrier_phase_encode_internal(ctx, &msg->L)) { return false; } - if (!sbp_u8_encode(ctx, &msg->lock)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u16_encode(ctx, &msg->iono_std)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tropo_std)) { return false; } - if (!sbp_u16_encode(ctx, &msg->range_std)) { return false; } +bool sbp_packed_osr_content_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_packed_osr_content_t *msg) { + if (!sbp_u32_encode(ctx, &msg->P)) { + return false; + } + if (!sbp_carrier_phase_encode_internal(ctx, &msg->L)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->lock)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->iono_std)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tropo_std)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->range_std)) { + return false; + } return true; } -s8 sbp_packed_osr_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_packed_osr_content_t *msg) { +s8 sbp_packed_osr_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_packed_osr_content_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -234,20 +320,38 @@ s8 sbp_packed_osr_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_packed_osr_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_packed_osr_content_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->P)) { return false; } - if (!sbp_carrier_phase_decode_internal(ctx, &msg->L)) { return false; } - if (!sbp_u8_decode(ctx, &msg->lock)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u16_decode(ctx, &msg->iono_std)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tropo_std)) { return false; } - if (!sbp_u16_decode(ctx, &msg->range_std)) { return false; } +bool sbp_packed_osr_content_decode_internal(sbp_decode_ctx_t *ctx, + sbp_packed_osr_content_t *msg) { + if (!sbp_u32_decode(ctx, &msg->P)) { + return false; + } + if (!sbp_carrier_phase_decode_internal(ctx, &msg->L)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->lock)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->iono_std)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tropo_std)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->range_std)) { + return false; + } return true; } -s8 sbp_packed_osr_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_packed_osr_content_t *msg) { +s8 sbp_packed_osr_content_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_packed_osr_content_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -261,48 +365,67 @@ s8 sbp_packed_osr_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - - -int sbp_packed_osr_content_cmp(const sbp_packed_osr_content_t *a, const sbp_packed_osr_content_t *b) { +int sbp_packed_osr_content_cmp(const sbp_packed_osr_content_t *a, + const sbp_packed_osr_content_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->P, &b->P); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_carrier_phase_cmp(&a->L, &b->L); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->lock, &b->lock); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->iono_std, &b->iono_std); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tropo_std, &b->tropo_std); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->range_std, &b->range_std); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_obs_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_obs_t *msg) -{ - if (!sbp_observation_header_encode_internal(ctx, &msg->header)) { return false; } - for (size_t i = 0; i < msg->n_obs; i++) - { - if (!sbp_packed_obs_content_encode_internal(ctx, &msg->obs[i])) { return false; } +bool sbp_msg_obs_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_obs_t *msg) { + if (!sbp_observation_header_encode_internal(ctx, &msg->header)) { + return false; + } + for (size_t i = 0; i < msg->n_obs; i++) { + if (!sbp_packed_obs_content_encode_internal(ctx, &msg->obs[i])) { + return false; + } } return true; } -s8 sbp_msg_obs_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_obs_t *msg) { +s8 sbp_msg_obs_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_obs_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -316,20 +439,26 @@ s8 sbp_msg_obs_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_m return SBP_OK; } -bool sbp_msg_obs_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_obs_t *msg) -{ - if (!sbp_observation_header_decode_internal(ctx, &msg->header)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_PACKED_OBS_CONTENT_ENCODED_LEN) != 0) { +bool sbp_msg_obs_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_obs_t *msg) { + if (!sbp_observation_header_decode_internal(ctx, &msg->header)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_PACKED_OBS_CONTENT_ENCODED_LEN) != + 0) { + return false; + } + msg->n_obs = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_PACKED_OBS_CONTENT_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_obs; i++) { + if (!sbp_packed_obs_content_decode_internal(ctx, &msg->obs[i])) { return false; } - msg->n_obs = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_PACKED_OBS_CONTENT_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_obs; i++) { - if (!sbp_packed_obs_content_decode_internal(ctx, &msg->obs[i])) { return false; } - } + } return true; } -s8 sbp_msg_obs_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_obs_t *msg) { +s8 sbp_msg_obs_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_obs_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -343,40 +472,52 @@ s8 sbp_msg_obs_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ return SBP_OK; } - -s8 sbp_msg_obs_send(sbp_state_t *s, u16 sender_id, const sbp_msg_obs_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_obs_send(sbp_state_t *s, u16 sender_id, const sbp_msg_obs_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_obs_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_OBS, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_OBS, sender_id, payload_len, payload, + write); } int sbp_msg_obs_cmp(const sbp_msg_obs_t *a, const sbp_msg_obs_t *b) { int ret = 0; - + ret = sbp_observation_header_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_obs, &b->n_obs); - for (uint8_t i = 0; ret == 0 && i < a->n_obs; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_obs; i++) { ret = sbp_packed_obs_content_cmp(&a->obs[i], &b->obs[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_base_pos_llh_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_base_pos_llh_t *msg) -{ - if (!sbp_double_encode(ctx, &msg->lat)) { return false; } - if (!sbp_double_encode(ctx, &msg->lon)) { return false; } - if (!sbp_double_encode(ctx, &msg->height)) { return false; } +bool sbp_msg_base_pos_llh_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_base_pos_llh_t *msg) { + if (!sbp_double_encode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->height)) { + return false; + } return true; } -s8 sbp_msg_base_pos_llh_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_base_pos_llh_t *msg) { +s8 sbp_msg_base_pos_llh_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_base_pos_llh_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -390,15 +531,22 @@ s8 sbp_msg_base_pos_llh_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, co return SBP_OK; } -bool sbp_msg_base_pos_llh_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_base_pos_llh_t *msg) -{ - if (!sbp_double_decode(ctx, &msg->lat)) { return false; } - if (!sbp_double_decode(ctx, &msg->lon)) { return false; } - if (!sbp_double_decode(ctx, &msg->height)) { return false; } +bool sbp_msg_base_pos_llh_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_base_pos_llh_t *msg) { + if (!sbp_double_decode(ctx, &msg->lat)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lon)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->height)) { + return false; + } return true; } -s8 sbp_msg_base_pos_llh_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_base_pos_llh_t *msg) { +s8 sbp_msg_base_pos_llh_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_base_pos_llh_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -412,39 +560,57 @@ s8 sbp_msg_base_pos_llh_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_base_pos_llh_send(sbp_state_t *s, u16 sender_id, const sbp_msg_base_pos_llh_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_base_pos_llh_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_base_pos_llh_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_base_pos_llh_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_BASE_POS_LLH, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_base_pos_llh_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_BASE_POS_LLH, sender_id, payload_len, + payload, write); } -int sbp_msg_base_pos_llh_cmp(const sbp_msg_base_pos_llh_t *a, const sbp_msg_base_pos_llh_t *b) { +int sbp_msg_base_pos_llh_cmp(const sbp_msg_base_pos_llh_t *a, + const sbp_msg_base_pos_llh_t *b) { int ret = 0; - + ret = sbp_double_cmp(&a->lat, &b->lat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lon, &b->lon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->height, &b->height); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_base_pos_ecef_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_base_pos_ecef_t *msg) -{ - if (!sbp_double_encode(ctx, &msg->x)) { return false; } - if (!sbp_double_encode(ctx, &msg->y)) { return false; } - if (!sbp_double_encode(ctx, &msg->z)) { return false; } +bool sbp_msg_base_pos_ecef_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_base_pos_ecef_t *msg) { + if (!sbp_double_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->z)) { + return false; + } return true; } -s8 sbp_msg_base_pos_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_base_pos_ecef_t *msg) { +s8 sbp_msg_base_pos_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_base_pos_ecef_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -458,15 +624,22 @@ s8 sbp_msg_base_pos_ecef_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_base_pos_ecef_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_base_pos_ecef_t *msg) -{ - if (!sbp_double_decode(ctx, &msg->x)) { return false; } - if (!sbp_double_decode(ctx, &msg->y)) { return false; } - if (!sbp_double_decode(ctx, &msg->z)) { return false; } +bool sbp_msg_base_pos_ecef_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_base_pos_ecef_t *msg) { + if (!sbp_double_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->z)) { + return false; + } return true; } -s8 sbp_msg_base_pos_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_base_pos_ecef_t *msg) { +s8 sbp_msg_base_pos_ecef_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_base_pos_ecef_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -480,42 +653,67 @@ s8 sbp_msg_base_pos_ecef_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_base_pos_ecef_send(sbp_state_t *s, u16 sender_id, const sbp_msg_base_pos_ecef_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_base_pos_ecef_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_base_pos_ecef_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_base_pos_ecef_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_BASE_POS_ECEF, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_base_pos_ecef_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_BASE_POS_ECEF, sender_id, payload_len, + payload, write); } -int sbp_msg_base_pos_ecef_cmp(const sbp_msg_base_pos_ecef_t *a, const sbp_msg_base_pos_ecef_t *b) { +int sbp_msg_base_pos_ecef_cmp(const sbp_msg_base_pos_ecef_t *a, + const sbp_msg_base_pos_ecef_t *b) { int ret = 0; - + ret = sbp_double_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_ephemeris_common_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ephemeris_common_content_t *msg) -{ - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toe)) { return false; } - if (!sbp_float_encode(ctx, &msg->ura)) { return false; } - if (!sbp_u32_encode(ctx, &msg->fit_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->health_bits)) { return false; } +bool sbp_ephemeris_common_content_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_ephemeris_common_content_t *msg) { + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toe)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->ura)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->fit_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->health_bits)) { + return false; + } return true; } -s8 sbp_ephemeris_common_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_ephemeris_common_content_t *msg) { +s8 sbp_ephemeris_common_content_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_ephemeris_common_content_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -529,18 +727,32 @@ s8 sbp_ephemeris_common_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_wri return SBP_OK; } -bool sbp_ephemeris_common_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_ephemeris_common_content_t *msg) -{ - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toe)) { return false; } - if (!sbp_float_decode(ctx, &msg->ura)) { return false; } - if (!sbp_u32_decode(ctx, &msg->fit_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->health_bits)) { return false; } +bool sbp_ephemeris_common_content_decode_internal( + sbp_decode_ctx_t *ctx, sbp_ephemeris_common_content_t *msg) { + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toe)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->ura)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->fit_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->health_bits)) { + return false; + } return true; } -s8 sbp_ephemeris_common_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ephemeris_common_content_t *msg) { +s8 sbp_ephemeris_common_content_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_ephemeris_common_content_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -554,43 +766,68 @@ s8 sbp_ephemeris_common_content_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - - -int sbp_ephemeris_common_content_cmp(const sbp_ephemeris_common_content_t *a, const sbp_ephemeris_common_content_t *b) { +int sbp_ephemeris_common_content_cmp(const sbp_ephemeris_common_content_t *a, + const sbp_ephemeris_common_content_t *b) { int ret = 0; - + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_sec_cmp(&a->toe, &b->toe); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->ura, &b->ura); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->fit_interval, &b->fit_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->valid, &b->valid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->health_bits, &b->health_bits); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_ephemeris_common_content_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ephemeris_common_content_dep_b_t *msg) -{ - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toe)) { return false; } - if (!sbp_double_encode(ctx, &msg->ura)) { return false; } - if (!sbp_u32_encode(ctx, &msg->fit_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->health_bits)) { return false; } +bool sbp_ephemeris_common_content_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_ephemeris_common_content_dep_b_t *msg) { + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toe)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ura)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->fit_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->health_bits)) { + return false; + } return true; } -s8 sbp_ephemeris_common_content_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_ephemeris_common_content_dep_b_t *msg) { +s8 sbp_ephemeris_common_content_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_ephemeris_common_content_dep_b_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -604,18 +841,32 @@ s8 sbp_ephemeris_common_content_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } -bool sbp_ephemeris_common_content_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_ephemeris_common_content_dep_b_t *msg) -{ - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toe)) { return false; } - if (!sbp_double_decode(ctx, &msg->ura)) { return false; } - if (!sbp_u32_decode(ctx, &msg->fit_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->health_bits)) { return false; } +bool sbp_ephemeris_common_content_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_ephemeris_common_content_dep_b_t *msg) { + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toe)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ura)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->fit_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->health_bits)) { + return false; + } return true; } -s8 sbp_ephemeris_common_content_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ephemeris_common_content_dep_b_t *msg) { +s8 sbp_ephemeris_common_content_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_ephemeris_common_content_dep_b_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -629,43 +880,69 @@ s8 sbp_ephemeris_common_content_dep_b_decode(const uint8_t *buf, uint8_t len, ui return SBP_OK; } - - -int sbp_ephemeris_common_content_dep_b_cmp(const sbp_ephemeris_common_content_dep_b_t *a, const sbp_ephemeris_common_content_dep_b_t *b) { +int sbp_ephemeris_common_content_dep_b_cmp( + const sbp_ephemeris_common_content_dep_b_t *a, + const sbp_ephemeris_common_content_dep_b_t *b) { int ret = 0; - + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_sec_cmp(&a->toe, &b->toe); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ura, &b->ura); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->fit_interval, &b->fit_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->valid, &b->valid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->health_bits, &b->health_bits); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_ephemeris_common_content_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ephemeris_common_content_dep_a_t *msg) -{ - if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_gps_time_dep_encode_internal(ctx, &msg->toe)) { return false; } - if (!sbp_double_encode(ctx, &msg->ura)) { return false; } - if (!sbp_u32_encode(ctx, &msg->fit_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->health_bits)) { return false; } +bool sbp_ephemeris_common_content_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_ephemeris_common_content_dep_a_t *msg) { + if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_gps_time_dep_encode_internal(ctx, &msg->toe)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ura)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->fit_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->health_bits)) { + return false; + } return true; } -s8 sbp_ephemeris_common_content_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_ephemeris_common_content_dep_a_t *msg) { +s8 sbp_ephemeris_common_content_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_ephemeris_common_content_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -679,18 +956,32 @@ s8 sbp_ephemeris_common_content_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } -bool sbp_ephemeris_common_content_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_ephemeris_common_content_dep_a_t *msg) -{ - if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_gps_time_dep_decode_internal(ctx, &msg->toe)) { return false; } - if (!sbp_double_decode(ctx, &msg->ura)) { return false; } - if (!sbp_u32_decode(ctx, &msg->fit_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->health_bits)) { return false; } +bool sbp_ephemeris_common_content_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_ephemeris_common_content_dep_a_t *msg) { + if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_gps_time_dep_decode_internal(ctx, &msg->toe)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ura)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->fit_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->health_bits)) { + return false; + } return true; } -s8 sbp_ephemeris_common_content_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ephemeris_common_content_dep_a_t *msg) { +s8 sbp_ephemeris_common_content_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_ephemeris_common_content_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -704,60 +995,120 @@ s8 sbp_ephemeris_common_content_dep_a_decode(const uint8_t *buf, uint8_t len, ui return SBP_OK; } - - -int sbp_ephemeris_common_content_dep_a_cmp(const sbp_ephemeris_common_content_dep_a_t *a, const sbp_ephemeris_common_content_dep_a_t *b) { +int sbp_ephemeris_common_content_dep_a_cmp( + const sbp_ephemeris_common_content_dep_a_t *a, + const sbp_ephemeris_common_content_dep_a_t *b) { int ret = 0; - + ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_dep_cmp(&a->toe, &b->toe); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ura, &b->ura); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->fit_interval, &b->fit_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->valid, &b->valid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->health_bits, &b->health_bits); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_gps_dep_e_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gps_dep_e_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_a_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_encode(ctx, &msg->tgd)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_rs)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_rc)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_uc)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_us)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_ic)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_encode(ctx, &msg->dn)) { return false; } - if (!sbp_double_encode(ctx, &msg->m0)) { return false; } - if (!sbp_double_encode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_encode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_encode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_encode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_encode(ctx, &msg->w)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_encode(ctx, &msg->af0)) { return false; } - if (!sbp_double_encode(ctx, &msg->af1)) { return false; } - if (!sbp_double_encode(ctx, &msg->af2)) { return false; } - if (!sbp_gps_time_dep_encode_internal(ctx, &msg->toc)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_encode(ctx, &msg->iodc)) { return false; } +bool sbp_msg_ephemeris_gps_dep_e_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gps_dep_e_t *msg) { + if (!sbp_ephemeris_common_content_dep_a_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af1)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af2)) { + return false; + } + if (!sbp_gps_time_dep_encode_internal(ctx, &msg->toc)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->iodc)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_gps_dep_e_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_gps_dep_e_t *msg) { +s8 sbp_msg_ephemeris_gps_dep_e_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_gps_dep_e_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -771,161 +1122,308 @@ s8 sbp_msg_ephemeris_gps_dep_e_encode(uint8_t *buf, uint8_t len, uint8_t *n_writ return SBP_OK; } -bool sbp_msg_ephemeris_gps_dep_e_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gps_dep_e_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_a_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_decode(ctx, &msg->tgd)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_rs)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_rc)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_uc)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_us)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_ic)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_decode(ctx, &msg->dn)) { return false; } - if (!sbp_double_decode(ctx, &msg->m0)) { return false; } - if (!sbp_double_decode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_decode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_decode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_decode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_decode(ctx, &msg->w)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_decode(ctx, &msg->af0)) { return false; } - if (!sbp_double_decode(ctx, &msg->af1)) { return false; } - if (!sbp_double_decode(ctx, &msg->af2)) { return false; } - if (!sbp_gps_time_dep_decode_internal(ctx, &msg->toc)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_decode(ctx, &msg->iodc)) { return false; } - return true; -} - -s8 sbp_msg_ephemeris_gps_dep_e_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_gps_dep_e_t *msg) { - sbp_decode_ctx_t ctx; - ctx.buf = buf; - ctx.buf_len = len; - ctx.offset = 0; - if (!sbp_msg_ephemeris_gps_dep_e_decode_internal(&ctx, msg)) { - return SBP_DECODE_ERROR; +bool sbp_msg_ephemeris_gps_dep_e_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gps_dep_e_t *msg) { + if (!sbp_ephemeris_common_content_dep_a_decode_internal(ctx, &msg->common)) { + return false; } - if (n_read != NULL) { - *n_read = (uint8_t)ctx.offset; + if (!sbp_double_decode(ctx, &msg->tgd)) { + return false; } - return SBP_OK; -} - - -s8 sbp_msg_ephemeris_gps_dep_e_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_gps_dep_e_t *msg, sbp_write_fn_t write) -{ - uint8_t payload[SBP_MAX_PAYLOAD_LEN]; - uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_gps_dep_e_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GPS_DEP_E, sender_id, payload_len, payload, write); -} + if (!sbp_double_decode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af1)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af2)) { + return false; + } + if (!sbp_gps_time_dep_decode_internal(ctx, &msg->toc)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->iodc)) { + return false; + } + return true; +} -int sbp_msg_ephemeris_gps_dep_e_cmp(const sbp_msg_ephemeris_gps_dep_e_t *a, const sbp_msg_ephemeris_gps_dep_e_t *b) { +s8 sbp_msg_ephemeris_gps_dep_e_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_gps_dep_e_t *msg) { + sbp_decode_ctx_t ctx; + ctx.buf = buf; + ctx.buf_len = len; + ctx.offset = 0; + if (!sbp_msg_ephemeris_gps_dep_e_decode_internal(&ctx, msg)) { + return SBP_DECODE_ERROR; + } + if (n_read != NULL) { + *n_read = (uint8_t)ctx.offset; + } + return SBP_OK; +} + +s8 sbp_msg_ephemeris_gps_dep_e_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_gps_dep_e_t *msg, + sbp_write_fn_t write) { + uint8_t payload[SBP_MAX_PAYLOAD_LEN]; + uint8_t payload_len; + s8 ret = sbp_msg_ephemeris_gps_dep_e_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GPS_DEP_E, sender_id, + payload_len, payload, write); +} + +int sbp_msg_ephemeris_gps_dep_e_cmp(const sbp_msg_ephemeris_gps_dep_e_t *a, + const sbp_msg_ephemeris_gps_dep_e_t *b) { int ret = 0; - + ret = sbp_ephemeris_common_content_dep_a_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->tgd, &b->tgd); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_rs, &b->c_rs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_rc, &b->c_rc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_uc, &b->c_uc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_us, &b->c_us); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_ic, &b->c_ic); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_is, &b->c_is); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->dn, &b->dn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->m0, &b->m0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ecc, &b->ecc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->sqrta, &b->sqrta); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omega0, &b->omega0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omegadot, &b->omegadot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->w, &b->w); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc, &b->inc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc_dot, &b->inc_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af0, &b->af0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af1, &b->af1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af2, &b->af2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_dep_cmp(&a->toc, &b->toc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iode, &b->iode); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->iodc, &b->iodc); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_gps_dep_f_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gps_dep_f_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_b_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_encode(ctx, &msg->tgd)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_rs)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_rc)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_uc)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_us)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_ic)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_encode(ctx, &msg->dn)) { return false; } - if (!sbp_double_encode(ctx, &msg->m0)) { return false; } - if (!sbp_double_encode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_encode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_encode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_encode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_encode(ctx, &msg->w)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_encode(ctx, &msg->af0)) { return false; } - if (!sbp_double_encode(ctx, &msg->af1)) { return false; } - if (!sbp_double_encode(ctx, &msg->af2)) { return false; } - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toc)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_encode(ctx, &msg->iodc)) { return false; } +bool sbp_msg_ephemeris_gps_dep_f_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gps_dep_f_t *msg) { + if (!sbp_ephemeris_common_content_dep_b_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af1)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af2)) { + return false; + } + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toc)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->iodc)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_gps_dep_f_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_gps_dep_f_t *msg) { +s8 sbp_msg_ephemeris_gps_dep_f_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_gps_dep_f_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -939,35 +1437,83 @@ s8 sbp_msg_ephemeris_gps_dep_f_encode(uint8_t *buf, uint8_t len, uint8_t *n_writ return SBP_OK; } -bool sbp_msg_ephemeris_gps_dep_f_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gps_dep_f_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_b_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_decode(ctx, &msg->tgd)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_rs)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_rc)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_uc)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_us)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_ic)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_decode(ctx, &msg->dn)) { return false; } - if (!sbp_double_decode(ctx, &msg->m0)) { return false; } - if (!sbp_double_decode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_decode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_decode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_decode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_decode(ctx, &msg->w)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_decode(ctx, &msg->af0)) { return false; } - if (!sbp_double_decode(ctx, &msg->af1)) { return false; } - if (!sbp_double_decode(ctx, &msg->af2)) { return false; } - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toc)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_decode(ctx, &msg->iodc)) { return false; } +bool sbp_msg_ephemeris_gps_dep_f_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gps_dep_f_t *msg) { + if (!sbp_ephemeris_common_content_dep_b_decode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af1)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af2)) { + return false; + } + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toc)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->iodc)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_gps_dep_f_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_gps_dep_f_t *msg) { +s8 sbp_msg_ephemeris_gps_dep_f_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_gps_dep_f_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -981,119 +1527,217 @@ s8 sbp_msg_ephemeris_gps_dep_f_decode(const uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } - -s8 sbp_msg_ephemeris_gps_dep_f_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_gps_dep_f_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_gps_dep_f_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_gps_dep_f_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_gps_dep_f_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GPS_DEP_F, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ephemeris_gps_dep_f_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GPS_DEP_F, sender_id, + payload_len, payload, write); } -int sbp_msg_ephemeris_gps_dep_f_cmp(const sbp_msg_ephemeris_gps_dep_f_t *a, const sbp_msg_ephemeris_gps_dep_f_t *b) { +int sbp_msg_ephemeris_gps_dep_f_cmp(const sbp_msg_ephemeris_gps_dep_f_t *a, + const sbp_msg_ephemeris_gps_dep_f_t *b) { int ret = 0; - + ret = sbp_ephemeris_common_content_dep_b_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->tgd, &b->tgd); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_rs, &b->c_rs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_rc, &b->c_rc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_uc, &b->c_uc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_us, &b->c_us); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_ic, &b->c_ic); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_is, &b->c_is); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->dn, &b->dn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->m0, &b->m0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ecc, &b->ecc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->sqrta, &b->sqrta); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omega0, &b->omega0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omegadot, &b->omegadot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->w, &b->w); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc, &b->inc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc_dot, &b->inc_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af0, &b->af0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af1, &b->af1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af2, &b->af2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_sec_cmp(&a->toc, &b->toc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iode, &b->iode); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->iodc, &b->iodc); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_gps_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gps_t *msg) -{ - if (!sbp_ephemeris_common_content_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_float_encode(ctx, &msg->tgd)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_rs)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_rc)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_uc)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_us)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_ic)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_encode(ctx, &msg->dn)) { return false; } - if (!sbp_double_encode(ctx, &msg->m0)) { return false; } - if (!sbp_double_encode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_encode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_encode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_encode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_encode(ctx, &msg->w)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_float_encode(ctx, &msg->af0)) { return false; } - if (!sbp_float_encode(ctx, &msg->af1)) { return false; } - if (!sbp_float_encode(ctx, &msg->af2)) { return false; } - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toc)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_encode(ctx, &msg->iodc)) { return false; } +bool sbp_msg_ephemeris_gps_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ephemeris_gps_t *msg) { + if (!sbp_ephemeris_common_content_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->af0)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->af1)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->af2)) { + return false; + } + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toc)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->iodc)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_gps_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_gps_t *msg) { +s8 sbp_msg_ephemeris_gps_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_gps_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1107,35 +1751,82 @@ s8 sbp_msg_ephemeris_gps_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_ephemeris_gps_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gps_t *msg) -{ - if (!sbp_ephemeris_common_content_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_float_decode(ctx, &msg->tgd)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_rs)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_rc)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_uc)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_us)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_ic)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_decode(ctx, &msg->dn)) { return false; } - if (!sbp_double_decode(ctx, &msg->m0)) { return false; } - if (!sbp_double_decode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_decode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_decode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_decode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_decode(ctx, &msg->w)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_float_decode(ctx, &msg->af0)) { return false; } - if (!sbp_float_decode(ctx, &msg->af1)) { return false; } - if (!sbp_float_decode(ctx, &msg->af2)) { return false; } - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toc)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_decode(ctx, &msg->iodc)) { return false; } +bool sbp_msg_ephemeris_gps_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_gps_t *msg) { + if (!sbp_ephemeris_common_content_decode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->af0)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->af1)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->af2)) { + return false; + } + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toc)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->iodc)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_gps_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_gps_t *msg) { +s8 sbp_msg_ephemeris_gps_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_ephemeris_gps_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1149,119 +1840,217 @@ s8 sbp_msg_ephemeris_gps_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_ephemeris_gps_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_gps_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_gps_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_gps_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_gps_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GPS, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_ephemeris_gps_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GPS, sender_id, payload_len, + payload, write); } -int sbp_msg_ephemeris_gps_cmp(const sbp_msg_ephemeris_gps_t *a, const sbp_msg_ephemeris_gps_t *b) { +int sbp_msg_ephemeris_gps_cmp(const sbp_msg_ephemeris_gps_t *a, + const sbp_msg_ephemeris_gps_t *b) { int ret = 0; - + ret = sbp_ephemeris_common_content_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->tgd, &b->tgd); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_rs, &b->c_rs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_rc, &b->c_rc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_uc, &b->c_uc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_us, &b->c_us); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_ic, &b->c_ic); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_is, &b->c_is); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->dn, &b->dn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->m0, &b->m0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ecc, &b->ecc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->sqrta, &b->sqrta); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omega0, &b->omega0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omegadot, &b->omegadot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->w, &b->w); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc, &b->inc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc_dot, &b->inc_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->af0, &b->af0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->af1, &b->af1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->af2, &b->af2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_sec_cmp(&a->toc, &b->toc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iode, &b->iode); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->iodc, &b->iodc); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_qzss_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_qzss_t *msg) -{ - if (!sbp_ephemeris_common_content_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_float_encode(ctx, &msg->tgd)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_rs)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_rc)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_uc)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_us)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_ic)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_encode(ctx, &msg->dn)) { return false; } - if (!sbp_double_encode(ctx, &msg->m0)) { return false; } - if (!sbp_double_encode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_encode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_encode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_encode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_encode(ctx, &msg->w)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_float_encode(ctx, &msg->af0)) { return false; } - if (!sbp_float_encode(ctx, &msg->af1)) { return false; } - if (!sbp_float_encode(ctx, &msg->af2)) { return false; } - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toc)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_encode(ctx, &msg->iodc)) { return false; } +bool sbp_msg_ephemeris_qzss_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_qzss_t *msg) { + if (!sbp_ephemeris_common_content_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->af0)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->af1)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->af2)) { + return false; + } + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toc)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->iodc)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_qzss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_qzss_t *msg) { +s8 sbp_msg_ephemeris_qzss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_qzss_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1275,35 +2064,83 @@ s8 sbp_msg_ephemeris_qzss_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_ephemeris_qzss_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_qzss_t *msg) -{ - if (!sbp_ephemeris_common_content_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_float_decode(ctx, &msg->tgd)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_rs)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_rc)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_uc)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_us)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_ic)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_decode(ctx, &msg->dn)) { return false; } - if (!sbp_double_decode(ctx, &msg->m0)) { return false; } - if (!sbp_double_decode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_decode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_decode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_decode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_decode(ctx, &msg->w)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_float_decode(ctx, &msg->af0)) { return false; } - if (!sbp_float_decode(ctx, &msg->af1)) { return false; } - if (!sbp_float_decode(ctx, &msg->af2)) { return false; } - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toc)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_decode(ctx, &msg->iodc)) { return false; } +bool sbp_msg_ephemeris_qzss_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_qzss_t *msg) { + if (!sbp_ephemeris_common_content_decode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->af0)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->af1)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->af2)) { + return false; + } + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toc)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->iodc)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_qzss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_qzss_t *msg) { +s8 sbp_msg_ephemeris_qzss_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_qzss_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1317,120 +2154,220 @@ s8 sbp_msg_ephemeris_qzss_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - -s8 sbp_msg_ephemeris_qzss_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_qzss_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_qzss_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_qzss_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_qzss_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_QZSS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ephemeris_qzss_encode(payload, sizeof(payload), &payload_len, + msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_QZSS, sender_id, payload_len, + payload, write); } -int sbp_msg_ephemeris_qzss_cmp(const sbp_msg_ephemeris_qzss_t *a, const sbp_msg_ephemeris_qzss_t *b) { +int sbp_msg_ephemeris_qzss_cmp(const sbp_msg_ephemeris_qzss_t *a, + const sbp_msg_ephemeris_qzss_t *b) { int ret = 0; - + ret = sbp_ephemeris_common_content_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->tgd, &b->tgd); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_rs, &b->c_rs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_rc, &b->c_rc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_uc, &b->c_uc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_us, &b->c_us); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_ic, &b->c_ic); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_is, &b->c_is); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->dn, &b->dn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->m0, &b->m0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ecc, &b->ecc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->sqrta, &b->sqrta); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omega0, &b->omega0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omegadot, &b->omegadot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->w, &b->w); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc, &b->inc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc_dot, &b->inc_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->af0, &b->af0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->af1, &b->af1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->af2, &b->af2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_sec_cmp(&a->toc, &b->toc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iode, &b->iode); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->iodc, &b->iodc); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_bds_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_bds_t *msg) -{ - if (!sbp_ephemeris_common_content_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_float_encode(ctx, &msg->tgd1)) { return false; } - if (!sbp_float_encode(ctx, &msg->tgd2)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_rs)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_rc)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_uc)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_us)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_ic)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_encode(ctx, &msg->dn)) { return false; } - if (!sbp_double_encode(ctx, &msg->m0)) { return false; } - if (!sbp_double_encode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_encode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_encode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_encode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_encode(ctx, &msg->w)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_encode(ctx, &msg->af0)) { return false; } - if (!sbp_float_encode(ctx, &msg->af1)) { return false; } - if (!sbp_float_encode(ctx, &msg->af2)) { return false; } - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toc)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_encode(ctx, &msg->iodc)) { return false; } +bool sbp_msg_ephemeris_bds_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ephemeris_bds_t *msg) { + if (!sbp_ephemeris_common_content_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->tgd1)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->tgd2)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af0)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->af1)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->af2)) { + return false; + } + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toc)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->iodc)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_bds_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_bds_t *msg) { +s8 sbp_msg_ephemeris_bds_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_bds_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1444,36 +2381,85 @@ s8 sbp_msg_ephemeris_bds_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_ephemeris_bds_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_bds_t *msg) -{ - if (!sbp_ephemeris_common_content_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_float_decode(ctx, &msg->tgd1)) { return false; } - if (!sbp_float_decode(ctx, &msg->tgd2)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_rs)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_rc)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_uc)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_us)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_ic)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_decode(ctx, &msg->dn)) { return false; } - if (!sbp_double_decode(ctx, &msg->m0)) { return false; } - if (!sbp_double_decode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_decode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_decode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_decode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_decode(ctx, &msg->w)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_decode(ctx, &msg->af0)) { return false; } - if (!sbp_float_decode(ctx, &msg->af1)) { return false; } - if (!sbp_float_decode(ctx, &msg->af2)) { return false; } - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toc)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_decode(ctx, &msg->iodc)) { return false; } +bool sbp_msg_ephemeris_bds_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_bds_t *msg) { + if (!sbp_ephemeris_common_content_decode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->tgd1)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->tgd2)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af0)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->af1)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->af2)) { + return false; + } + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toc)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->iodc)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_bds_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_bds_t *msg) { +s8 sbp_msg_ephemeris_bds_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_ephemeris_bds_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1487,123 +2473,226 @@ s8 sbp_msg_ephemeris_bds_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_ephemeris_bds_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_bds_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_bds_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_bds_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_bds_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_BDS, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_ephemeris_bds_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_BDS, sender_id, payload_len, + payload, write); } -int sbp_msg_ephemeris_bds_cmp(const sbp_msg_ephemeris_bds_t *a, const sbp_msg_ephemeris_bds_t *b) { +int sbp_msg_ephemeris_bds_cmp(const sbp_msg_ephemeris_bds_t *a, + const sbp_msg_ephemeris_bds_t *b) { int ret = 0; - + ret = sbp_ephemeris_common_content_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->tgd1, &b->tgd1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->tgd2, &b->tgd2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_rs, &b->c_rs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_rc, &b->c_rc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_uc, &b->c_uc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_us, &b->c_us); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_ic, &b->c_ic); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_is, &b->c_is); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->dn, &b->dn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->m0, &b->m0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ecc, &b->ecc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->sqrta, &b->sqrta); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omega0, &b->omega0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omegadot, &b->omegadot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->w, &b->w); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc, &b->inc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc_dot, &b->inc_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af0, &b->af0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->af1, &b->af1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->af2, &b->af2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_sec_cmp(&a->toc, &b->toc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iode, &b->iode); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->iodc, &b->iodc); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_gal_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gal_dep_a_t *msg) -{ - if (!sbp_ephemeris_common_content_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_float_encode(ctx, &msg->bgd_e1e5a)) { return false; } - if (!sbp_float_encode(ctx, &msg->bgd_e1e5b)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_rs)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_rc)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_uc)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_us)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_ic)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_encode(ctx, &msg->dn)) { return false; } - if (!sbp_double_encode(ctx, &msg->m0)) { return false; } - if (!sbp_double_encode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_encode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_encode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_encode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_encode(ctx, &msg->w)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_encode(ctx, &msg->af0)) { return false; } - if (!sbp_double_encode(ctx, &msg->af1)) { return false; } - if (!sbp_float_encode(ctx, &msg->af2)) { return false; } - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toc)) { return false; } - if (!sbp_u16_encode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_encode(ctx, &msg->iodc)) { return false; } +bool sbp_msg_ephemeris_gal_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gal_dep_a_t *msg) { + if (!sbp_ephemeris_common_content_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->bgd_e1e5a)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->bgd_e1e5b)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af1)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->af2)) { + return false; + } + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toc)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->iodc)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_gal_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_gal_dep_a_t *msg) { +s8 sbp_msg_ephemeris_gal_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_gal_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1617,36 +2706,86 @@ s8 sbp_msg_ephemeris_gal_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_writ return SBP_OK; } -bool sbp_msg_ephemeris_gal_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gal_dep_a_t *msg) -{ - if (!sbp_ephemeris_common_content_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_float_decode(ctx, &msg->bgd_e1e5a)) { return false; } - if (!sbp_float_decode(ctx, &msg->bgd_e1e5b)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_rs)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_rc)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_uc)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_us)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_ic)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_decode(ctx, &msg->dn)) { return false; } - if (!sbp_double_decode(ctx, &msg->m0)) { return false; } - if (!sbp_double_decode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_decode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_decode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_decode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_decode(ctx, &msg->w)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_decode(ctx, &msg->af0)) { return false; } - if (!sbp_double_decode(ctx, &msg->af1)) { return false; } - if (!sbp_float_decode(ctx, &msg->af2)) { return false; } - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toc)) { return false; } - if (!sbp_u16_decode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_decode(ctx, &msg->iodc)) { return false; } +bool sbp_msg_ephemeris_gal_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gal_dep_a_t *msg) { + if (!sbp_ephemeris_common_content_decode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->bgd_e1e5a)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->bgd_e1e5b)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af1)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->af2)) { + return false; + } + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toc)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->iodc)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_gal_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_gal_dep_a_t *msg) { +s8 sbp_msg_ephemeris_gal_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_gal_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1660,124 +2799,228 @@ s8 sbp_msg_ephemeris_gal_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } - -s8 sbp_msg_ephemeris_gal_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_gal_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_gal_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_gal_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_gal_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GAL_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ephemeris_gal_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GAL_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_ephemeris_gal_dep_a_cmp(const sbp_msg_ephemeris_gal_dep_a_t *a, const sbp_msg_ephemeris_gal_dep_a_t *b) { +int sbp_msg_ephemeris_gal_dep_a_cmp(const sbp_msg_ephemeris_gal_dep_a_t *a, + const sbp_msg_ephemeris_gal_dep_a_t *b) { int ret = 0; - + ret = sbp_ephemeris_common_content_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->bgd_e1e5a, &b->bgd_e1e5a); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->bgd_e1e5b, &b->bgd_e1e5b); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_rs, &b->c_rs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_rc, &b->c_rc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_uc, &b->c_uc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_us, &b->c_us); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_ic, &b->c_ic); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_is, &b->c_is); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->dn, &b->dn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->m0, &b->m0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ecc, &b->ecc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->sqrta, &b->sqrta); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omega0, &b->omega0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omegadot, &b->omegadot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->w, &b->w); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc, &b->inc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc_dot, &b->inc_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af0, &b->af0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af1, &b->af1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->af2, &b->af2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_sec_cmp(&a->toc, &b->toc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->iode, &b->iode); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->iodc, &b->iodc); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_gal_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_gal_t *msg) -{ - if (!sbp_ephemeris_common_content_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_float_encode(ctx, &msg->bgd_e1e5a)) { return false; } - if (!sbp_float_encode(ctx, &msg->bgd_e1e5b)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_rs)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_rc)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_uc)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_us)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_ic)) { return false; } - if (!sbp_float_encode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_encode(ctx, &msg->dn)) { return false; } - if (!sbp_double_encode(ctx, &msg->m0)) { return false; } - if (!sbp_double_encode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_encode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_encode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_encode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_encode(ctx, &msg->w)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_encode(ctx, &msg->af0)) { return false; } - if (!sbp_double_encode(ctx, &msg->af1)) { return false; } - if (!sbp_float_encode(ctx, &msg->af2)) { return false; } - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toc)) { return false; } - if (!sbp_u16_encode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_encode(ctx, &msg->iodc)) { return false; } - if (!sbp_u8_encode(ctx, &msg->source)) { return false; } +bool sbp_msg_ephemeris_gal_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ephemeris_gal_t *msg) { + if (!sbp_ephemeris_common_content_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->bgd_e1e5a)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->bgd_e1e5b)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af1)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->af2)) { + return false; + } + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toc)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->iodc)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->source)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_gal_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_gal_t *msg) { +s8 sbp_msg_ephemeris_gal_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_gal_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1791,37 +3034,88 @@ s8 sbp_msg_ephemeris_gal_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_ephemeris_gal_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_gal_t *msg) -{ - if (!sbp_ephemeris_common_content_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_float_decode(ctx, &msg->bgd_e1e5a)) { return false; } - if (!sbp_float_decode(ctx, &msg->bgd_e1e5b)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_rs)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_rc)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_uc)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_us)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_ic)) { return false; } - if (!sbp_float_decode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_decode(ctx, &msg->dn)) { return false; } - if (!sbp_double_decode(ctx, &msg->m0)) { return false; } - if (!sbp_double_decode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_decode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_decode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_decode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_decode(ctx, &msg->w)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_decode(ctx, &msg->af0)) { return false; } - if (!sbp_double_decode(ctx, &msg->af1)) { return false; } - if (!sbp_float_decode(ctx, &msg->af2)) { return false; } - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toc)) { return false; } - if (!sbp_u16_decode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_decode(ctx, &msg->iodc)) { return false; } - if (!sbp_u8_decode(ctx, &msg->source)) { return false; } +bool sbp_msg_ephemeris_gal_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_gal_t *msg) { + if (!sbp_ephemeris_common_content_decode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->bgd_e1e5a)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->bgd_e1e5b)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af1)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->af2)) { + return false; + } + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toc)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->iodc)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->source)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_gal_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_gal_t *msg) { +s8 sbp_msg_ephemeris_gal_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_ephemeris_gal_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1835,117 +3129,183 @@ s8 sbp_msg_ephemeris_gal_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_ephemeris_gal_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_gal_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_gal_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_gal_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_gal_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GAL, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_ephemeris_gal_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GAL, sender_id, payload_len, + payload, write); } -int sbp_msg_ephemeris_gal_cmp(const sbp_msg_ephemeris_gal_t *a, const sbp_msg_ephemeris_gal_t *b) { +int sbp_msg_ephemeris_gal_cmp(const sbp_msg_ephemeris_gal_t *a, + const sbp_msg_ephemeris_gal_t *b) { int ret = 0; - + ret = sbp_ephemeris_common_content_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->bgd_e1e5a, &b->bgd_e1e5a); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->bgd_e1e5b, &b->bgd_e1e5b); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_rs, &b->c_rs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_rc, &b->c_rc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_uc, &b->c_uc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_us, &b->c_us); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_ic, &b->c_ic); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->c_is, &b->c_is); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->dn, &b->dn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->m0, &b->m0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ecc, &b->ecc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->sqrta, &b->sqrta); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omega0, &b->omega0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omegadot, &b->omegadot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->w, &b->w); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc, &b->inc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc_dot, &b->inc_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af0, &b->af0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af1, &b->af1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->af2, &b->af2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_sec_cmp(&a->toc, &b->toc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->iode, &b->iode); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->iodc, &b->iodc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->source, &b->source); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_sbas_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_sbas_dep_a_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_a_encode_internal(ctx, &msg->common)) { return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_A_POS_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->pos[i])) { return false; } +bool sbp_msg_ephemeris_sbas_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_sbas_dep_a_t *msg) { + if (!sbp_ephemeris_common_content_dep_a_encode_internal(ctx, &msg->common)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_A_POS_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->pos[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_A_VEL_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->vel[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_A_ACC_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->acc[i])) { + return false; + } } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_A_VEL_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->vel[i])) { return false; } + if (!sbp_double_encode(ctx, &msg->a_gf0)) { + return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_A_ACC_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->acc[i])) { return false; } + if (!sbp_double_encode(ctx, &msg->a_gf1)) { + return false; } - if (!sbp_double_encode(ctx, &msg->a_gf0)) { return false; } - if (!sbp_double_encode(ctx, &msg->a_gf1)) { return false; } return true; } -s8 sbp_msg_ephemeris_sbas_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_sbas_dep_a_t *msg) { +s8 sbp_msg_ephemeris_sbas_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_sbas_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1959,24 +3319,38 @@ s8 sbp_msg_ephemeris_sbas_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_wri return SBP_OK; } -bool sbp_msg_ephemeris_sbas_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_sbas_dep_a_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_a_decode_internal(ctx, &msg->common)) { return false; } +bool sbp_msg_ephemeris_sbas_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_sbas_dep_a_t *msg) { + if (!sbp_ephemeris_common_content_dep_a_decode_internal(ctx, &msg->common)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_A_POS_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->pos[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->pos[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_A_VEL_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->vel[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->vel[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_A_ACC_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->acc[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->acc[i])) { + return false; + } + } + if (!sbp_double_decode(ctx, &msg->a_gf0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->a_gf1)) { + return false; } - if (!sbp_double_decode(ctx, &msg->a_gf0)) { return false; } - if (!sbp_double_decode(ctx, &msg->a_gf1)) { return false; } return true; } -s8 sbp_msg_ephemeris_sbas_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_sbas_dep_a_t *msg) { +s8 sbp_msg_ephemeris_sbas_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_sbas_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1990,69 +3364,97 @@ s8 sbp_msg_ephemeris_sbas_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_ephemeris_sbas_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_sbas_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_sbas_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_sbas_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_sbas_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_SBAS_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ephemeris_sbas_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_SBAS_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_ephemeris_sbas_dep_a_cmp(const sbp_msg_ephemeris_sbas_dep_a_t *a, const sbp_msg_ephemeris_sbas_dep_a_t *b) { +int sbp_msg_ephemeris_sbas_dep_a_cmp(const sbp_msg_ephemeris_sbas_dep_a_t *a, + const sbp_msg_ephemeris_sbas_dep_a_t *b) { int ret = 0; - + ret = sbp_ephemeris_common_content_dep_a_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_DEP_A_POS_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_DEP_A_POS_MAX; + i++) { ret = sbp_double_cmp(&a->pos[i], &b->pos[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_DEP_A_VEL_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_DEP_A_VEL_MAX; + i++) { ret = sbp_double_cmp(&a->vel[i], &b->vel[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_DEP_A_ACC_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_DEP_A_ACC_MAX; + i++) { ret = sbp_double_cmp(&a->acc[i], &b->acc[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->a_gf0, &b->a_gf0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->a_gf1, &b->a_gf1); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_glo_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_a_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_a_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_encode(ctx, &msg->gamma)) { return false; } - if (!sbp_double_encode(ctx, &msg->tau)) { return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_A_POS_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->pos[i])) { return false; } +bool sbp_msg_ephemeris_glo_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_a_t *msg) { + if (!sbp_ephemeris_common_content_dep_a_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->gamma)) { + return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_A_VEL_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->vel[i])) { return false; } + if (!sbp_double_encode(ctx, &msg->tau)) { + return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_A_ACC_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->acc[i])) { return false; } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_A_POS_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->pos[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_A_VEL_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->vel[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_A_ACC_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->acc[i])) { + return false; + } } return true; } -s8 sbp_msg_ephemeris_glo_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_glo_dep_a_t *msg) { +s8 sbp_msg_ephemeris_glo_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_glo_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2066,24 +3468,38 @@ s8 sbp_msg_ephemeris_glo_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_writ return SBP_OK; } -bool sbp_msg_ephemeris_glo_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_a_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_a_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_decode(ctx, &msg->gamma)) { return false; } - if (!sbp_double_decode(ctx, &msg->tau)) { return false; } +bool sbp_msg_ephemeris_glo_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_a_t *msg) { + if (!sbp_ephemeris_common_content_dep_a_decode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->gamma)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->tau)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_A_POS_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->pos[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->pos[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_A_VEL_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->vel[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->vel[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_A_ACC_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->acc[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->acc[i])) { + return false; + } } return true; } -s8 sbp_msg_ephemeris_glo_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_glo_dep_a_t *msg) { +s8 sbp_msg_ephemeris_glo_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_glo_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2097,69 +3513,97 @@ s8 sbp_msg_ephemeris_glo_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } - -s8 sbp_msg_ephemeris_glo_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_glo_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_glo_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_glo_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_glo_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GLO_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ephemeris_glo_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GLO_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_ephemeris_glo_dep_a_cmp(const sbp_msg_ephemeris_glo_dep_a_t *a, const sbp_msg_ephemeris_glo_dep_a_t *b) { +int sbp_msg_ephemeris_glo_dep_a_cmp(const sbp_msg_ephemeris_glo_dep_a_t *a, + const sbp_msg_ephemeris_glo_dep_a_t *b) { int ret = 0; - + ret = sbp_ephemeris_common_content_dep_a_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->gamma, &b->gamma); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->tau, &b->tau); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_A_POS_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_A_POS_MAX; + i++) { ret = sbp_double_cmp(&a->pos[i], &b->pos[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_A_VEL_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_A_VEL_MAX; + i++) { ret = sbp_double_cmp(&a->vel[i], &b->vel[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_A_ACC_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_A_ACC_MAX; + i++) { ret = sbp_double_cmp(&a->acc[i], &b->acc[i]); } - if (ret != 0) { return ret; } - return ret; -} - -bool sbp_msg_ephemeris_sbas_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_sbas_dep_b_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_b_encode_internal(ctx, &msg->common)) { return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_B_POS_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->pos[i])) { return false; } + if (ret != 0) { + return ret; + } + return ret; +} + +bool sbp_msg_ephemeris_sbas_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_sbas_dep_b_t *msg) { + if (!sbp_ephemeris_common_content_dep_b_encode_internal(ctx, &msg->common)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_B_POS_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->pos[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_B_VEL_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->vel[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_B_ACC_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->acc[i])) { + return false; + } } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_B_VEL_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->vel[i])) { return false; } + if (!sbp_double_encode(ctx, &msg->a_gf0)) { + return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_B_ACC_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->acc[i])) { return false; } + if (!sbp_double_encode(ctx, &msg->a_gf1)) { + return false; } - if (!sbp_double_encode(ctx, &msg->a_gf0)) { return false; } - if (!sbp_double_encode(ctx, &msg->a_gf1)) { return false; } return true; } -s8 sbp_msg_ephemeris_sbas_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_sbas_dep_b_t *msg) { +s8 sbp_msg_ephemeris_sbas_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_sbas_dep_b_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2173,24 +3617,38 @@ s8 sbp_msg_ephemeris_sbas_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_wri return SBP_OK; } -bool sbp_msg_ephemeris_sbas_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_sbas_dep_b_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_b_decode_internal(ctx, &msg->common)) { return false; } +bool sbp_msg_ephemeris_sbas_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_sbas_dep_b_t *msg) { + if (!sbp_ephemeris_common_content_dep_b_decode_internal(ctx, &msg->common)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_B_POS_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->pos[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->pos[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_B_VEL_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->vel[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->vel[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_DEP_B_ACC_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->acc[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->acc[i])) { + return false; + } + } + if (!sbp_double_decode(ctx, &msg->a_gf0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->a_gf1)) { + return false; } - if (!sbp_double_decode(ctx, &msg->a_gf0)) { return false; } - if (!sbp_double_decode(ctx, &msg->a_gf1)) { return false; } return true; } -s8 sbp_msg_ephemeris_sbas_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_sbas_dep_b_t *msg) { +s8 sbp_msg_ephemeris_sbas_dep_b_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_sbas_dep_b_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2204,69 +3662,96 @@ s8 sbp_msg_ephemeris_sbas_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_ephemeris_sbas_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_sbas_dep_b_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_sbas_dep_b_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_sbas_dep_b_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_sbas_dep_b_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_SBAS_DEP_B, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ephemeris_sbas_dep_b_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_SBAS_DEP_B, sender_id, + payload_len, payload, write); } -int sbp_msg_ephemeris_sbas_dep_b_cmp(const sbp_msg_ephemeris_sbas_dep_b_t *a, const sbp_msg_ephemeris_sbas_dep_b_t *b) { +int sbp_msg_ephemeris_sbas_dep_b_cmp(const sbp_msg_ephemeris_sbas_dep_b_t *a, + const sbp_msg_ephemeris_sbas_dep_b_t *b) { int ret = 0; - + ret = sbp_ephemeris_common_content_dep_b_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_DEP_B_POS_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_DEP_B_POS_MAX; + i++) { ret = sbp_double_cmp(&a->pos[i], &b->pos[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_DEP_B_VEL_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_DEP_B_VEL_MAX; + i++) { ret = sbp_double_cmp(&a->vel[i], &b->vel[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_DEP_B_ACC_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_DEP_B_ACC_MAX; + i++) { ret = sbp_double_cmp(&a->acc[i], &b->acc[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->a_gf0, &b->a_gf0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->a_gf1, &b->a_gf1); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_sbas_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_sbas_t *msg) -{ - if (!sbp_ephemeris_common_content_encode_internal(ctx, &msg->common)) { return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_POS_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->pos[i])) { return false; } +bool sbp_msg_ephemeris_sbas_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_sbas_t *msg) { + if (!sbp_ephemeris_common_content_encode_internal(ctx, &msg->common)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_POS_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->pos[i])) { + return false; + } } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_VEL_MAX; i++) - { - if (!sbp_float_encode(ctx, &msg->vel[i])) { return false; } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_VEL_MAX; i++) { + if (!sbp_float_encode(ctx, &msg->vel[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_ACC_MAX; i++) { + if (!sbp_float_encode(ctx, &msg->acc[i])) { + return false; + } + } + if (!sbp_float_encode(ctx, &msg->a_gf0)) { + return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_ACC_MAX; i++) - { - if (!sbp_float_encode(ctx, &msg->acc[i])) { return false; } + if (!sbp_float_encode(ctx, &msg->a_gf1)) { + return false; } - if (!sbp_float_encode(ctx, &msg->a_gf0)) { return false; } - if (!sbp_float_encode(ctx, &msg->a_gf1)) { return false; } return true; } -s8 sbp_msg_ephemeris_sbas_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_sbas_t *msg) { +s8 sbp_msg_ephemeris_sbas_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_sbas_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2280,24 +3765,38 @@ s8 sbp_msg_ephemeris_sbas_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_ephemeris_sbas_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_sbas_t *msg) -{ - if (!sbp_ephemeris_common_content_decode_internal(ctx, &msg->common)) { return false; } +bool sbp_msg_ephemeris_sbas_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_sbas_t *msg) { + if (!sbp_ephemeris_common_content_decode_internal(ctx, &msg->common)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_POS_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->pos[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->pos[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_VEL_MAX; i++) { - if (!sbp_float_decode(ctx, &msg->vel[i])) { return false; } + if (!sbp_float_decode(ctx, &msg->vel[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_SBAS_ACC_MAX; i++) { - if (!sbp_float_decode(ctx, &msg->acc[i])) { return false; } + if (!sbp_float_decode(ctx, &msg->acc[i])) { + return false; + } + } + if (!sbp_float_decode(ctx, &msg->a_gf0)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->a_gf1)) { + return false; } - if (!sbp_float_decode(ctx, &msg->a_gf0)) { return false; } - if (!sbp_float_decode(ctx, &msg->a_gf1)) { return false; } return true; } -s8 sbp_msg_ephemeris_sbas_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_sbas_t *msg) { +s8 sbp_msg_ephemeris_sbas_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_sbas_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2311,69 +3810,94 @@ s8 sbp_msg_ephemeris_sbas_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - -s8 sbp_msg_ephemeris_sbas_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_sbas_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_sbas_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_sbas_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_sbas_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_SBAS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ephemeris_sbas_encode(payload, sizeof(payload), &payload_len, + msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_SBAS, sender_id, payload_len, + payload, write); } -int sbp_msg_ephemeris_sbas_cmp(const sbp_msg_ephemeris_sbas_t *a, const sbp_msg_ephemeris_sbas_t *b) { +int sbp_msg_ephemeris_sbas_cmp(const sbp_msg_ephemeris_sbas_t *a, + const sbp_msg_ephemeris_sbas_t *b) { int ret = 0; - + ret = sbp_ephemeris_common_content_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_POS_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_POS_MAX; i++) { ret = sbp_double_cmp(&a->pos[i], &b->pos[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_VEL_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_VEL_MAX; i++) { ret = sbp_float_cmp(&a->vel[i], &b->vel[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_ACC_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_SBAS_ACC_MAX; i++) { ret = sbp_float_cmp(&a->acc[i], &b->acc[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->a_gf0, &b->a_gf0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->a_gf1, &b->a_gf1); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_glo_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_b_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_b_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_encode(ctx, &msg->gamma)) { return false; } - if (!sbp_double_encode(ctx, &msg->tau)) { return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_B_POS_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->pos[i])) { return false; } +bool sbp_msg_ephemeris_glo_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_b_t *msg) { + if (!sbp_ephemeris_common_content_dep_b_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->gamma)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->tau)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_B_POS_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->pos[i])) { + return false; + } } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_B_VEL_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->vel[i])) { return false; } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_B_VEL_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->vel[i])) { + return false; + } } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_B_ACC_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->acc[i])) { return false; } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_B_ACC_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->acc[i])) { + return false; + } } return true; } -s8 sbp_msg_ephemeris_glo_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_glo_dep_b_t *msg) { +s8 sbp_msg_ephemeris_glo_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_glo_dep_b_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2387,24 +3911,38 @@ s8 sbp_msg_ephemeris_glo_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_writ return SBP_OK; } -bool sbp_msg_ephemeris_glo_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_b_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_b_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_decode(ctx, &msg->gamma)) { return false; } - if (!sbp_double_decode(ctx, &msg->tau)) { return false; } +bool sbp_msg_ephemeris_glo_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_b_t *msg) { + if (!sbp_ephemeris_common_content_dep_b_decode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->gamma)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->tau)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_B_POS_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->pos[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->pos[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_B_VEL_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->vel[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->vel[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_B_ACC_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->acc[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->acc[i])) { + return false; + } } return true; } -s8 sbp_msg_ephemeris_glo_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_glo_dep_b_t *msg) { +s8 sbp_msg_ephemeris_glo_dep_b_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_glo_dep_b_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2418,71 +3956,103 @@ s8 sbp_msg_ephemeris_glo_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } - -s8 sbp_msg_ephemeris_glo_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_glo_dep_b_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_glo_dep_b_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_glo_dep_b_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_glo_dep_b_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GLO_DEP_B, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ephemeris_glo_dep_b_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GLO_DEP_B, sender_id, + payload_len, payload, write); } -int sbp_msg_ephemeris_glo_dep_b_cmp(const sbp_msg_ephemeris_glo_dep_b_t *a, const sbp_msg_ephemeris_glo_dep_b_t *b) { +int sbp_msg_ephemeris_glo_dep_b_cmp(const sbp_msg_ephemeris_glo_dep_b_t *a, + const sbp_msg_ephemeris_glo_dep_b_t *b) { int ret = 0; - + ret = sbp_ephemeris_common_content_dep_b_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->gamma, &b->gamma); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->tau, &b->tau); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_B_POS_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_B_POS_MAX; + i++) { ret = sbp_double_cmp(&a->pos[i], &b->pos[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_B_VEL_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_B_VEL_MAX; + i++) { ret = sbp_double_cmp(&a->vel[i], &b->vel[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_B_ACC_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_B_ACC_MAX; + i++) { ret = sbp_double_cmp(&a->acc[i], &b->acc[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_glo_dep_c_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_c_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_b_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_encode(ctx, &msg->gamma)) { return false; } - if (!sbp_double_encode(ctx, &msg->tau)) { return false; } - if (!sbp_double_encode(ctx, &msg->d_tau)) { return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_C_POS_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->pos[i])) { return false; } +bool sbp_msg_ephemeris_glo_dep_c_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_c_t *msg) { + if (!sbp_ephemeris_common_content_dep_b_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->gamma)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->tau)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->d_tau)) { + return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_C_VEL_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->vel[i])) { return false; } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_C_POS_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->pos[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_C_VEL_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->vel[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_C_ACC_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->acc[i])) { + return false; + } } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_C_ACC_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->acc[i])) { return false; } + if (!sbp_u8_encode(ctx, &msg->fcn)) { + return false; } - if (!sbp_u8_encode(ctx, &msg->fcn)) { return false; } return true; } -s8 sbp_msg_ephemeris_glo_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_glo_dep_c_t *msg) { +s8 sbp_msg_ephemeris_glo_dep_c_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_glo_dep_c_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2496,26 +4066,44 @@ s8 sbp_msg_ephemeris_glo_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_writ return SBP_OK; } -bool sbp_msg_ephemeris_glo_dep_c_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_c_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_b_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_decode(ctx, &msg->gamma)) { return false; } - if (!sbp_double_decode(ctx, &msg->tau)) { return false; } - if (!sbp_double_decode(ctx, &msg->d_tau)) { return false; } +bool sbp_msg_ephemeris_glo_dep_c_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_c_t *msg) { + if (!sbp_ephemeris_common_content_dep_b_decode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->gamma)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->tau)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->d_tau)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_C_POS_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->pos[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->pos[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_C_VEL_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->vel[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->vel[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_C_ACC_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->acc[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->acc[i])) { + return false; + } + } + if (!sbp_u8_decode(ctx, &msg->fcn)) { + return false; } - if (!sbp_u8_decode(ctx, &msg->fcn)) { return false; } return true; } -s8 sbp_msg_ephemeris_glo_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_glo_dep_c_t *msg) { +s8 sbp_msg_ephemeris_glo_dep_c_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_glo_dep_c_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2529,78 +4117,116 @@ s8 sbp_msg_ephemeris_glo_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } - -s8 sbp_msg_ephemeris_glo_dep_c_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_glo_dep_c_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_glo_dep_c_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_glo_dep_c_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_glo_dep_c_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GLO_DEP_C, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ephemeris_glo_dep_c_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GLO_DEP_C, sender_id, + payload_len, payload, write); } -int sbp_msg_ephemeris_glo_dep_c_cmp(const sbp_msg_ephemeris_glo_dep_c_t *a, const sbp_msg_ephemeris_glo_dep_c_t *b) { +int sbp_msg_ephemeris_glo_dep_c_cmp(const sbp_msg_ephemeris_glo_dep_c_t *a, + const sbp_msg_ephemeris_glo_dep_c_t *b) { int ret = 0; - + ret = sbp_ephemeris_common_content_dep_b_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->gamma, &b->gamma); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->tau, &b->tau); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->d_tau, &b->d_tau); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_C_POS_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_C_POS_MAX; + i++) { ret = sbp_double_cmp(&a->pos[i], &b->pos[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_C_VEL_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_C_VEL_MAX; + i++) { ret = sbp_double_cmp(&a->vel[i], &b->vel[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_C_ACC_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_C_ACC_MAX; + i++) { ret = sbp_double_cmp(&a->acc[i], &b->acc[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->fcn, &b->fcn); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_glo_dep_d_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_d_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_b_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_encode(ctx, &msg->gamma)) { return false; } - if (!sbp_double_encode(ctx, &msg->tau)) { return false; } - if (!sbp_double_encode(ctx, &msg->d_tau)) { return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_D_POS_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->pos[i])) { return false; } +bool sbp_msg_ephemeris_glo_dep_d_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_dep_d_t *msg) { + if (!sbp_ephemeris_common_content_dep_b_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->gamma)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->tau)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->d_tau)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_D_POS_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->pos[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_D_VEL_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->vel[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_D_ACC_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->acc[i])) { + return false; + } } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_D_VEL_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->vel[i])) { return false; } + if (!sbp_u8_encode(ctx, &msg->fcn)) { + return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_D_ACC_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->acc[i])) { return false; } + if (!sbp_u8_encode(ctx, &msg->iod)) { + return false; } - if (!sbp_u8_encode(ctx, &msg->fcn)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iod)) { return false; } return true; } -s8 sbp_msg_ephemeris_glo_dep_d_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_glo_dep_d_t *msg) { +s8 sbp_msg_ephemeris_glo_dep_d_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_glo_dep_d_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2614,27 +4240,47 @@ s8 sbp_msg_ephemeris_glo_dep_d_encode(uint8_t *buf, uint8_t len, uint8_t *n_writ return SBP_OK; } -bool sbp_msg_ephemeris_glo_dep_d_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_d_t *msg) -{ - if (!sbp_ephemeris_common_content_dep_b_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_decode(ctx, &msg->gamma)) { return false; } - if (!sbp_double_decode(ctx, &msg->tau)) { return false; } - if (!sbp_double_decode(ctx, &msg->d_tau)) { return false; } +bool sbp_msg_ephemeris_glo_dep_d_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_dep_d_t *msg) { + if (!sbp_ephemeris_common_content_dep_b_decode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->gamma)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->tau)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->d_tau)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_D_POS_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->pos[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->pos[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_D_VEL_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->vel[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->vel[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_DEP_D_ACC_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->acc[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->acc[i])) { + return false; + } + } + if (!sbp_u8_decode(ctx, &msg->fcn)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iod)) { + return false; } - if (!sbp_u8_decode(ctx, &msg->fcn)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iod)) { return false; } return true; } -s8 sbp_msg_ephemeris_glo_dep_d_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_glo_dep_d_t *msg) { +s8 sbp_msg_ephemeris_glo_dep_d_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_glo_dep_d_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2648,81 +4294,120 @@ s8 sbp_msg_ephemeris_glo_dep_d_decode(const uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } - -s8 sbp_msg_ephemeris_glo_dep_d_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_glo_dep_d_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_glo_dep_d_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_glo_dep_d_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_glo_dep_d_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GLO_DEP_D, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ephemeris_glo_dep_d_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GLO_DEP_D, sender_id, + payload_len, payload, write); } -int sbp_msg_ephemeris_glo_dep_d_cmp(const sbp_msg_ephemeris_glo_dep_d_t *a, const sbp_msg_ephemeris_glo_dep_d_t *b) { +int sbp_msg_ephemeris_glo_dep_d_cmp(const sbp_msg_ephemeris_glo_dep_d_t *a, + const sbp_msg_ephemeris_glo_dep_d_t *b) { int ret = 0; - + ret = sbp_ephemeris_common_content_dep_b_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->gamma, &b->gamma); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->tau, &b->tau); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->d_tau, &b->d_tau); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_D_POS_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_D_POS_MAX; + i++) { ret = sbp_double_cmp(&a->pos[i], &b->pos[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_D_VEL_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_D_VEL_MAX; + i++) { ret = sbp_double_cmp(&a->vel[i], &b->vel[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_D_ACC_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_DEP_D_ACC_MAX; + i++) { ret = sbp_double_cmp(&a->acc[i], &b->acc[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->fcn, &b->fcn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iod, &b->iod); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_glo_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_glo_t *msg) -{ - if (!sbp_ephemeris_common_content_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_float_encode(ctx, &msg->gamma)) { return false; } - if (!sbp_float_encode(ctx, &msg->tau)) { return false; } - if (!sbp_float_encode(ctx, &msg->d_tau)) { return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_POS_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->pos[i])) { return false; } +bool sbp_msg_ephemeris_glo_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ephemeris_glo_t *msg) { + if (!sbp_ephemeris_common_content_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->gamma)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->tau)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->d_tau)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_POS_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->pos[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_VEL_MAX; i++) { + if (!sbp_double_encode(ctx, &msg->vel[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_ACC_MAX; i++) { + if (!sbp_float_encode(ctx, &msg->acc[i])) { + return false; + } } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_VEL_MAX; i++) - { - if (!sbp_double_encode(ctx, &msg->vel[i])) { return false; } + if (!sbp_u8_encode(ctx, &msg->fcn)) { + return false; } - for (size_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_ACC_MAX; i++) - { - if (!sbp_float_encode(ctx, &msg->acc[i])) { return false; } + if (!sbp_u8_encode(ctx, &msg->iod)) { + return false; } - if (!sbp_u8_encode(ctx, &msg->fcn)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iod)) { return false; } return true; } -s8 sbp_msg_ephemeris_glo_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_glo_t *msg) { +s8 sbp_msg_ephemeris_glo_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_glo_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2736,27 +4421,46 @@ s8 sbp_msg_ephemeris_glo_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_ephemeris_glo_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_glo_t *msg) -{ - if (!sbp_ephemeris_common_content_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_float_decode(ctx, &msg->gamma)) { return false; } - if (!sbp_float_decode(ctx, &msg->tau)) { return false; } - if (!sbp_float_decode(ctx, &msg->d_tau)) { return false; } +bool sbp_msg_ephemeris_glo_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_glo_t *msg) { + if (!sbp_ephemeris_common_content_decode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->gamma)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->tau)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->d_tau)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_POS_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->pos[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->pos[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_VEL_MAX; i++) { - if (!sbp_double_decode(ctx, &msg->vel[i])) { return false; } + if (!sbp_double_decode(ctx, &msg->vel[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_EPHEMERIS_GLO_ACC_MAX; i++) { - if (!sbp_float_decode(ctx, &msg->acc[i])) { return false; } + if (!sbp_float_decode(ctx, &msg->acc[i])) { + return false; + } + } + if (!sbp_u8_decode(ctx, &msg->fcn)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iod)) { + return false; } - if (!sbp_u8_decode(ctx, &msg->fcn)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iod)) { return false; } return true; } -s8 sbp_msg_ephemeris_glo_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_glo_t *msg) { +s8 sbp_msg_ephemeris_glo_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_ephemeris_glo_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2770,92 +4474,171 @@ s8 sbp_msg_ephemeris_glo_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_ephemeris_glo_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_glo_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_glo_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_glo_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_glo_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GLO, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_ephemeris_glo_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_GLO, sender_id, payload_len, + payload, write); } -int sbp_msg_ephemeris_glo_cmp(const sbp_msg_ephemeris_glo_t *a, const sbp_msg_ephemeris_glo_t *b) { +int sbp_msg_ephemeris_glo_cmp(const sbp_msg_ephemeris_glo_t *a, + const sbp_msg_ephemeris_glo_t *b) { int ret = 0; - + ret = sbp_ephemeris_common_content_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->gamma, &b->gamma); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->tau, &b->tau); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->d_tau, &b->d_tau); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_POS_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_POS_MAX; i++) { ret = sbp_double_cmp(&a->pos[i], &b->pos[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_VEL_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_VEL_MAX; i++) { ret = sbp_double_cmp(&a->vel[i], &b->vel[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_ACC_MAX; i++) - { - ret = sbp_float_cmp(&a->acc[i], &b->acc[i]); + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_EPHEMERIS_GLO_ACC_MAX; i++) { + ret = sbp_float_cmp(&a->acc[i], &b->acc[i]); + } + if (ret != 0) { + return ret; + } + + ret = sbp_u8_cmp(&a->fcn, &b->fcn); + if (ret != 0) { + return ret; + } + + ret = sbp_u8_cmp(&a->iod, &b->iod); + if (ret != 0) { + return ret; + } + return ret; +} + +bool sbp_msg_ephemeris_dep_d_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_d_t *msg) { + if (!sbp_double_encode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af1)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af2)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->toe_tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->toe_wn)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->toc_tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->toc_wn)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->healthy)) { + return false; + } + if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->iodc)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->reserved)) { + return false; } - if (ret != 0) { return ret; } - - ret = sbp_u8_cmp(&a->fcn, &b->fcn); - if (ret != 0) { return ret; } - - ret = sbp_u8_cmp(&a->iod, &b->iod); - if (ret != 0) { return ret; } - return ret; -} - -bool sbp_msg_ephemeris_dep_d_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_d_t *msg) -{ - if (!sbp_double_encode(ctx, &msg->tgd)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_rs)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_rc)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_uc)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_us)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_ic)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_encode(ctx, &msg->dn)) { return false; } - if (!sbp_double_encode(ctx, &msg->m0)) { return false; } - if (!sbp_double_encode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_encode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_encode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_encode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_encode(ctx, &msg->w)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_encode(ctx, &msg->af0)) { return false; } - if (!sbp_double_encode(ctx, &msg->af1)) { return false; } - if (!sbp_double_encode(ctx, &msg->af2)) { return false; } - if (!sbp_double_encode(ctx, &msg->toe_tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->toe_wn)) { return false; } - if (!sbp_double_encode(ctx, &msg->toc_tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->toc_wn)) { return false; } - if (!sbp_u8_encode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->healthy)) { return false; } - if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_encode(ctx, &msg->iodc)) { return false; } - if (!sbp_u32_encode(ctx, &msg->reserved)) { return false; } return true; } -s8 sbp_msg_ephemeris_dep_d_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_dep_d_t *msg) { +s8 sbp_msg_ephemeris_dep_d_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_dep_d_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2869,41 +4652,101 @@ s8 sbp_msg_ephemeris_dep_d_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_ephemeris_dep_d_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_dep_d_t *msg) -{ - if (!sbp_double_decode(ctx, &msg->tgd)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_rs)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_rc)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_uc)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_us)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_ic)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_decode(ctx, &msg->dn)) { return false; } - if (!sbp_double_decode(ctx, &msg->m0)) { return false; } - if (!sbp_double_decode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_decode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_decode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_decode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_decode(ctx, &msg->w)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_decode(ctx, &msg->af0)) { return false; } - if (!sbp_double_decode(ctx, &msg->af1)) { return false; } - if (!sbp_double_decode(ctx, &msg->af2)) { return false; } - if (!sbp_double_decode(ctx, &msg->toe_tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->toe_wn)) { return false; } - if (!sbp_double_decode(ctx, &msg->toc_tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->toc_wn)) { return false; } - if (!sbp_u8_decode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->healthy)) { return false; } - if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_decode(ctx, &msg->iodc)) { return false; } - if (!sbp_u32_decode(ctx, &msg->reserved)) { return false; } +bool sbp_msg_ephemeris_dep_d_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_dep_d_t *msg) { + if (!sbp_double_decode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af1)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af2)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->toe_tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->toe_wn)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->toc_tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->toc_wn)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->healthy)) { + return false; + } + if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->iodc)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->reserved)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_dep_d_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_dep_d_t *msg) { +s8 sbp_msg_ephemeris_dep_d_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_dep_d_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2917,140 +4760,256 @@ s8 sbp_msg_ephemeris_dep_d_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_ephemeris_dep_d_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_dep_d_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_dep_d_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_dep_d_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_dep_d_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_DEP_D, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ephemeris_dep_d_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_DEP_D, sender_id, payload_len, + payload, write); } -int sbp_msg_ephemeris_dep_d_cmp(const sbp_msg_ephemeris_dep_d_t *a, const sbp_msg_ephemeris_dep_d_t *b) { +int sbp_msg_ephemeris_dep_d_cmp(const sbp_msg_ephemeris_dep_d_t *a, + const sbp_msg_ephemeris_dep_d_t *b) { int ret = 0; - + ret = sbp_double_cmp(&a->tgd, &b->tgd); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_rs, &b->c_rs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_rc, &b->c_rc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_uc, &b->c_uc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_us, &b->c_us); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_ic, &b->c_ic); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_is, &b->c_is); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->dn, &b->dn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->m0, &b->m0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ecc, &b->ecc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->sqrta, &b->sqrta); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omega0, &b->omega0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omegadot, &b->omegadot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->w, &b->w); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc, &b->inc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc_dot, &b->inc_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af0, &b->af0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af1, &b->af1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af2, &b->af2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->toe_tow, &b->toe_tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->toe_wn, &b->toe_wn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->toc_tow, &b->toc_tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->toc_wn, &b->toc_wn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->valid, &b->valid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->healthy, &b->healthy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iode, &b->iode); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->iodc, &b->iodc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->reserved, &b->reserved); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_a_t *msg) -{ - if (!sbp_double_encode(ctx, &msg->tgd)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_rs)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_rc)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_uc)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_us)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_ic)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_encode(ctx, &msg->dn)) { return false; } - if (!sbp_double_encode(ctx, &msg->m0)) { return false; } - if (!sbp_double_encode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_encode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_encode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_encode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_encode(ctx, &msg->w)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_encode(ctx, &msg->af0)) { return false; } - if (!sbp_double_encode(ctx, &msg->af1)) { return false; } - if (!sbp_double_encode(ctx, &msg->af2)) { return false; } - if (!sbp_double_encode(ctx, &msg->toe_tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->toe_wn)) { return false; } - if (!sbp_double_encode(ctx, &msg->toc_tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->toc_wn)) { return false; } - if (!sbp_u8_encode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->healthy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->prn)) { return false; } +bool sbp_msg_ephemeris_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_a_t *msg) { + if (!sbp_double_encode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af1)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af2)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->toe_tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->toe_wn)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->toc_tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->toc_wn)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->healthy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->prn)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_dep_a_t *msg) { +s8 sbp_msg_ephemeris_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3064,38 +5023,92 @@ s8 sbp_msg_ephemeris_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_ephemeris_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_dep_a_t *msg) -{ - if (!sbp_double_decode(ctx, &msg->tgd)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_rs)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_rc)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_uc)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_us)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_ic)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_decode(ctx, &msg->dn)) { return false; } - if (!sbp_double_decode(ctx, &msg->m0)) { return false; } - if (!sbp_double_decode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_decode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_decode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_decode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_decode(ctx, &msg->w)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_decode(ctx, &msg->af0)) { return false; } - if (!sbp_double_decode(ctx, &msg->af1)) { return false; } - if (!sbp_double_decode(ctx, &msg->af2)) { return false; } - if (!sbp_double_decode(ctx, &msg->toe_tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->toe_wn)) { return false; } - if (!sbp_double_decode(ctx, &msg->toc_tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->toc_wn)) { return false; } - if (!sbp_u8_decode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->healthy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->prn)) { return false; } +bool sbp_msg_ephemeris_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_dep_a_t *msg) { + if (!sbp_double_decode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af1)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af2)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->toe_tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->toe_wn)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->toc_tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->toc_wn)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->healthy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->prn)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_dep_a_t *msg) { +s8 sbp_msg_ephemeris_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3109,132 +5122,244 @@ s8 sbp_msg_ephemeris_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_ephemeris_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ephemeris_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_DEP_A, sender_id, payload_len, + payload, write); } -int sbp_msg_ephemeris_dep_a_cmp(const sbp_msg_ephemeris_dep_a_t *a, const sbp_msg_ephemeris_dep_a_t *b) { +int sbp_msg_ephemeris_dep_a_cmp(const sbp_msg_ephemeris_dep_a_t *a, + const sbp_msg_ephemeris_dep_a_t *b) { int ret = 0; - + ret = sbp_double_cmp(&a->tgd, &b->tgd); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_rs, &b->c_rs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_rc, &b->c_rc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_uc, &b->c_uc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_us, &b->c_us); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_ic, &b->c_ic); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_is, &b->c_is); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->dn, &b->dn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->m0, &b->m0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ecc, &b->ecc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->sqrta, &b->sqrta); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omega0, &b->omega0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omegadot, &b->omegadot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->w, &b->w); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc, &b->inc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc_dot, &b->inc_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af0, &b->af0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af1, &b->af1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af2, &b->af2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->toe_tow, &b->toe_tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->toe_wn, &b->toe_wn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->toc_tow, &b->toc_tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->toc_wn, &b->toc_wn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->valid, &b->valid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->healthy, &b->healthy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->prn, &b->prn); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_b_t *msg) -{ - if (!sbp_double_encode(ctx, &msg->tgd)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_rs)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_rc)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_uc)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_us)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_ic)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_encode(ctx, &msg->dn)) { return false; } - if (!sbp_double_encode(ctx, &msg->m0)) { return false; } - if (!sbp_double_encode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_encode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_encode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_encode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_encode(ctx, &msg->w)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_encode(ctx, &msg->af0)) { return false; } - if (!sbp_double_encode(ctx, &msg->af1)) { return false; } - if (!sbp_double_encode(ctx, &msg->af2)) { return false; } - if (!sbp_double_encode(ctx, &msg->toe_tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->toe_wn)) { return false; } - if (!sbp_double_encode(ctx, &msg->toc_tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->toc_wn)) { return false; } - if (!sbp_u8_encode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->healthy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->prn)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iode)) { return false; } +bool sbp_msg_ephemeris_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_b_t *msg) { + if (!sbp_double_encode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af1)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af2)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->toe_tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->toe_wn)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->toc_tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->toc_wn)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->healthy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->prn)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iode)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_dep_b_t *msg) { +s8 sbp_msg_ephemeris_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_dep_b_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3242,45 +5367,101 @@ s8 sbp_msg_ephemeris_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, if (!sbp_msg_ephemeris_dep_b_encode_internal(&ctx, msg)) { return SBP_ENCODE_ERROR; } - if (n_written != NULL) { - *n_written = (uint8_t)ctx.offset; + if (n_written != NULL) { + *n_written = (uint8_t)ctx.offset; + } + return SBP_OK; +} + +bool sbp_msg_ephemeris_dep_b_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_dep_b_t *msg) { + if (!sbp_double_decode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af1)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af2)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->toe_tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->toe_wn)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->toc_tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->toc_wn)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->healthy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->prn)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iode)) { + return false; } - return SBP_OK; -} - -bool sbp_msg_ephemeris_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_dep_b_t *msg) -{ - if (!sbp_double_decode(ctx, &msg->tgd)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_rs)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_rc)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_uc)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_us)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_ic)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_decode(ctx, &msg->dn)) { return false; } - if (!sbp_double_decode(ctx, &msg->m0)) { return false; } - if (!sbp_double_decode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_decode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_decode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_decode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_decode(ctx, &msg->w)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_decode(ctx, &msg->af0)) { return false; } - if (!sbp_double_decode(ctx, &msg->af1)) { return false; } - if (!sbp_double_decode(ctx, &msg->af2)) { return false; } - if (!sbp_double_decode(ctx, &msg->toe_tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->toe_wn)) { return false; } - if (!sbp_double_decode(ctx, &msg->toc_tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->toc_wn)) { return false; } - if (!sbp_u8_decode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->healthy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->prn)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iode)) { return false; } return true; } -s8 sbp_msg_ephemeris_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_dep_b_t *msg) { +s8 sbp_msg_ephemeris_dep_b_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_dep_b_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3294,137 +5475,255 @@ s8 sbp_msg_ephemeris_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_ephemeris_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_dep_b_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_dep_b_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_dep_b_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_dep_b_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_DEP_B, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ephemeris_dep_b_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_DEP_B, sender_id, payload_len, + payload, write); } -int sbp_msg_ephemeris_dep_b_cmp(const sbp_msg_ephemeris_dep_b_t *a, const sbp_msg_ephemeris_dep_b_t *b) { +int sbp_msg_ephemeris_dep_b_cmp(const sbp_msg_ephemeris_dep_b_t *a, + const sbp_msg_ephemeris_dep_b_t *b) { int ret = 0; - + ret = sbp_double_cmp(&a->tgd, &b->tgd); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_rs, &b->c_rs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_rc, &b->c_rc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_uc, &b->c_uc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_us, &b->c_us); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_ic, &b->c_ic); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_is, &b->c_is); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->dn, &b->dn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->m0, &b->m0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ecc, &b->ecc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->sqrta, &b->sqrta); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omega0, &b->omega0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omegadot, &b->omegadot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->w, &b->w); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc, &b->inc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc_dot, &b->inc_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af0, &b->af0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af1, &b->af1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af2, &b->af2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->toe_tow, &b->toe_tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->toe_wn, &b->toe_wn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->toc_tow, &b->toc_tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->toc_wn, &b->toc_wn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->valid, &b->valid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->healthy, &b->healthy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->prn, &b->prn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iode, &b->iode); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ephemeris_dep_c_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_c_t *msg) -{ - if (!sbp_double_encode(ctx, &msg->tgd)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_rs)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_rc)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_uc)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_us)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_ic)) { return false; } - if (!sbp_double_encode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_encode(ctx, &msg->dn)) { return false; } - if (!sbp_double_encode(ctx, &msg->m0)) { return false; } - if (!sbp_double_encode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_encode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_encode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_encode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_encode(ctx, &msg->w)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_encode(ctx, &msg->af0)) { return false; } - if (!sbp_double_encode(ctx, &msg->af1)) { return false; } - if (!sbp_double_encode(ctx, &msg->af2)) { return false; } - if (!sbp_double_encode(ctx, &msg->toe_tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->toe_wn)) { return false; } - if (!sbp_double_encode(ctx, &msg->toc_tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->toc_wn)) { return false; } - if (!sbp_u8_encode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->healthy)) { return false; } - if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_encode(ctx, &msg->iodc)) { return false; } - if (!sbp_u32_encode(ctx, &msg->reserved)) { return false; } +bool sbp_msg_ephemeris_dep_c_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ephemeris_dep_c_t *msg) { + if (!sbp_double_encode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af1)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af2)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->toe_tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->toe_wn)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->toc_tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->toc_wn)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->healthy)) { + return false; + } + if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->iodc)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->reserved)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ephemeris_dep_c_t *msg) { +s8 sbp_msg_ephemeris_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ephemeris_dep_c_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3438,41 +5737,101 @@ s8 sbp_msg_ephemeris_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_ephemeris_dep_c_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ephemeris_dep_c_t *msg) -{ - if (!sbp_double_decode(ctx, &msg->tgd)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_rs)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_rc)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_uc)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_us)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_ic)) { return false; } - if (!sbp_double_decode(ctx, &msg->c_is)) { return false; } - if (!sbp_double_decode(ctx, &msg->dn)) { return false; } - if (!sbp_double_decode(ctx, &msg->m0)) { return false; } - if (!sbp_double_decode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_decode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_decode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_decode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_decode(ctx, &msg->w)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc_dot)) { return false; } - if (!sbp_double_decode(ctx, &msg->af0)) { return false; } - if (!sbp_double_decode(ctx, &msg->af1)) { return false; } - if (!sbp_double_decode(ctx, &msg->af2)) { return false; } - if (!sbp_double_decode(ctx, &msg->toe_tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->toe_wn)) { return false; } - if (!sbp_double_decode(ctx, &msg->toc_tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->toc_wn)) { return false; } - if (!sbp_u8_decode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->healthy)) { return false; } - if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iode)) { return false; } - if (!sbp_u16_decode(ctx, &msg->iodc)) { return false; } - if (!sbp_u32_decode(ctx, &msg->reserved)) { return false; } +bool sbp_msg_ephemeris_dep_c_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ephemeris_dep_c_t *msg) { + if (!sbp_double_decode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_rs)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_rc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_uc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_us)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_ic)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->c_is)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->dn)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc_dot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af1)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af2)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->toe_tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->toe_wn)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->toc_tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->toc_wn)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->healthy)) { + return false; + } + if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iode)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->iodc)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->reserved)) { + return false; + } return true; } -s8 sbp_msg_ephemeris_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ephemeris_dep_c_t *msg) { +s8 sbp_msg_ephemeris_dep_c_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ephemeris_dep_c_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3486,116 +5845,185 @@ s8 sbp_msg_ephemeris_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_ephemeris_dep_c_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ephemeris_dep_c_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ephemeris_dep_c_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ephemeris_dep_c_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ephemeris_dep_c_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_EPHEMERIS_DEP_C, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ephemeris_dep_c_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_EPHEMERIS_DEP_C, sender_id, payload_len, + payload, write); } -int sbp_msg_ephemeris_dep_c_cmp(const sbp_msg_ephemeris_dep_c_t *a, const sbp_msg_ephemeris_dep_c_t *b) { +int sbp_msg_ephemeris_dep_c_cmp(const sbp_msg_ephemeris_dep_c_t *a, + const sbp_msg_ephemeris_dep_c_t *b) { int ret = 0; - + ret = sbp_double_cmp(&a->tgd, &b->tgd); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_rs, &b->c_rs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_rc, &b->c_rc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_uc, &b->c_uc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_us, &b->c_us); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_ic, &b->c_ic); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->c_is, &b->c_is); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->dn, &b->dn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->m0, &b->m0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ecc, &b->ecc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->sqrta, &b->sqrta); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omega0, &b->omega0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omegadot, &b->omegadot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->w, &b->w); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc, &b->inc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc_dot, &b->inc_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af0, &b->af0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af1, &b->af1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af2, &b->af2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->toe_tow, &b->toe_tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->toe_wn, &b->toe_wn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->toc_tow, &b->toc_tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->toc_wn, &b->toc_wn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->valid, &b->valid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->healthy, &b->healthy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iode, &b->iode); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->iodc, &b->iodc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->reserved, &b->reserved); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_observation_header_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_observation_header_dep_t *msg) -{ - if (!sbp_gps_time_dep_encode_internal(ctx, &msg->t)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_obs)) { return false; } +bool sbp_observation_header_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_observation_header_dep_t *msg) { + if (!sbp_gps_time_dep_encode_internal(ctx, &msg->t)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_obs)) { + return false; + } return true; } -s8 sbp_observation_header_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_observation_header_dep_t *msg) { +s8 sbp_observation_header_dep_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_observation_header_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3609,14 +6037,20 @@ s8 sbp_observation_header_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_writt return SBP_OK; } -bool sbp_observation_header_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_observation_header_dep_t *msg) -{ - if (!sbp_gps_time_dep_decode_internal(ctx, &msg->t)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_obs)) { return false; } +bool sbp_observation_header_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_observation_header_dep_t *msg) { + if (!sbp_gps_time_dep_decode_internal(ctx, &msg->t)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_obs)) { + return false; + } return true; } -s8 sbp_observation_header_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_observation_header_dep_t *msg) { +s8 sbp_observation_header_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_observation_header_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3630,27 +6064,35 @@ s8 sbp_observation_header_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } - - -int sbp_observation_header_dep_cmp(const sbp_observation_header_dep_t *a, const sbp_observation_header_dep_t *b) { +int sbp_observation_header_dep_cmp(const sbp_observation_header_dep_t *a, + const sbp_observation_header_dep_t *b) { int ret = 0; - + ret = sbp_gps_time_dep_cmp(&a->t, &b->t); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_obs, &b->n_obs); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_carrier_phase_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_carrier_phase_dep_a_t *msg) -{ - if (!sbp_s32_encode(ctx, &msg->i)) { return false; } - if (!sbp_u8_encode(ctx, &msg->f)) { return false; } +bool sbp_carrier_phase_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_carrier_phase_dep_a_t *msg) { + if (!sbp_s32_encode(ctx, &msg->i)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->f)) { + return false; + } return true; } -s8 sbp_carrier_phase_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_carrier_phase_dep_a_t *msg) { +s8 sbp_carrier_phase_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_carrier_phase_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3664,14 +6106,20 @@ s8 sbp_carrier_phase_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_carrier_phase_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_carrier_phase_dep_a_t *msg) -{ - if (!sbp_s32_decode(ctx, &msg->i)) { return false; } - if (!sbp_u8_decode(ctx, &msg->f)) { return false; } +bool sbp_carrier_phase_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_carrier_phase_dep_a_t *msg) { + if (!sbp_s32_decode(ctx, &msg->i)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->f)) { + return false; + } return true; } -s8 sbp_carrier_phase_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_carrier_phase_dep_a_t *msg) { +s8 sbp_carrier_phase_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_carrier_phase_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3685,30 +6133,45 @@ s8 sbp_carrier_phase_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - - -int sbp_carrier_phase_dep_a_cmp(const sbp_carrier_phase_dep_a_t *a, const sbp_carrier_phase_dep_a_t *b) { +int sbp_carrier_phase_dep_a_cmp(const sbp_carrier_phase_dep_a_t *a, + const sbp_carrier_phase_dep_a_t *b) { int ret = 0; - + ret = sbp_s32_cmp(&a->i, &b->i); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->f, &b->f); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_packed_obs_content_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_dep_a_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->P)) { return false; } - if (!sbp_carrier_phase_dep_a_encode_internal(ctx, &msg->L)) { return false; } - if (!sbp_u8_encode(ctx, &msg->cn0)) { return false; } - if (!sbp_u16_encode(ctx, &msg->lock)) { return false; } - if (!sbp_u8_encode(ctx, &msg->prn)) { return false; } +bool sbp_packed_obs_content_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_dep_a_t *msg) { + if (!sbp_u32_encode(ctx, &msg->P)) { + return false; + } + if (!sbp_carrier_phase_dep_a_encode_internal(ctx, &msg->L)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->lock)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->prn)) { + return false; + } return true; } -s8 sbp_packed_obs_content_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_packed_obs_content_dep_a_t *msg) { +s8 sbp_packed_obs_content_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_packed_obs_content_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3722,17 +6185,29 @@ s8 sbp_packed_obs_content_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_wri return SBP_OK; } -bool sbp_packed_obs_content_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_packed_obs_content_dep_a_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->P)) { return false; } - if (!sbp_carrier_phase_dep_a_decode_internal(ctx, &msg->L)) { return false; } - if (!sbp_u8_decode(ctx, &msg->cn0)) { return false; } - if (!sbp_u16_decode(ctx, &msg->lock)) { return false; } - if (!sbp_u8_decode(ctx, &msg->prn)) { return false; } +bool sbp_packed_obs_content_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_packed_obs_content_dep_a_t *msg) { + if (!sbp_u32_decode(ctx, &msg->P)) { + return false; + } + if (!sbp_carrier_phase_dep_a_decode_internal(ctx, &msg->L)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->lock)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->prn)) { + return false; + } return true; } -s8 sbp_packed_obs_content_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_packed_obs_content_dep_a_t *msg) { +s8 sbp_packed_obs_content_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_packed_obs_content_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3746,39 +6221,60 @@ s8 sbp_packed_obs_content_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - - -int sbp_packed_obs_content_dep_a_cmp(const sbp_packed_obs_content_dep_a_t *a, const sbp_packed_obs_content_dep_a_t *b) { +int sbp_packed_obs_content_dep_a_cmp(const sbp_packed_obs_content_dep_a_t *a, + const sbp_packed_obs_content_dep_a_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->P, &b->P); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_carrier_phase_dep_a_cmp(&a->L, &b->L); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->cn0, &b->cn0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->lock, &b->lock); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->prn, &b->prn); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_packed_obs_content_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_dep_b_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->P)) { return false; } - if (!sbp_carrier_phase_dep_a_encode_internal(ctx, &msg->L)) { return false; } - if (!sbp_u8_encode(ctx, &msg->cn0)) { return false; } - if (!sbp_u16_encode(ctx, &msg->lock)) { return false; } - if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { return false; } +bool sbp_packed_obs_content_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_dep_b_t *msg) { + if (!sbp_u32_encode(ctx, &msg->P)) { + return false; + } + if (!sbp_carrier_phase_dep_a_encode_internal(ctx, &msg->L)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->lock)) { + return false; + } + if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_packed_obs_content_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_packed_obs_content_dep_b_t *msg) { +s8 sbp_packed_obs_content_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_packed_obs_content_dep_b_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3792,17 +6288,29 @@ s8 sbp_packed_obs_content_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_wri return SBP_OK; } -bool sbp_packed_obs_content_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_packed_obs_content_dep_b_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->P)) { return false; } - if (!sbp_carrier_phase_dep_a_decode_internal(ctx, &msg->L)) { return false; } - if (!sbp_u8_decode(ctx, &msg->cn0)) { return false; } - if (!sbp_u16_decode(ctx, &msg->lock)) { return false; } - if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { return false; } +bool sbp_packed_obs_content_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_packed_obs_content_dep_b_t *msg) { + if (!sbp_u32_decode(ctx, &msg->P)) { + return false; + } + if (!sbp_carrier_phase_dep_a_decode_internal(ctx, &msg->L)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->lock)) { + return false; + } + if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_packed_obs_content_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_packed_obs_content_dep_b_t *msg) { +s8 sbp_packed_obs_content_dep_b_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_packed_obs_content_dep_b_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3816,39 +6324,60 @@ s8 sbp_packed_obs_content_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - - -int sbp_packed_obs_content_dep_b_cmp(const sbp_packed_obs_content_dep_b_t *a, const sbp_packed_obs_content_dep_b_t *b) { +int sbp_packed_obs_content_dep_b_cmp(const sbp_packed_obs_content_dep_b_t *a, + const sbp_packed_obs_content_dep_b_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->P, &b->P); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_carrier_phase_dep_a_cmp(&a->L, &b->L); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->cn0, &b->cn0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->lock, &b->lock); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_packed_obs_content_dep_c_encode_internal(sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_dep_c_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->P)) { return false; } - if (!sbp_carrier_phase_encode_internal(ctx, &msg->L)) { return false; } - if (!sbp_u8_encode(ctx, &msg->cn0)) { return false; } - if (!sbp_u16_encode(ctx, &msg->lock)) { return false; } - if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { return false; } +bool sbp_packed_obs_content_dep_c_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_packed_obs_content_dep_c_t *msg) { + if (!sbp_u32_encode(ctx, &msg->P)) { + return false; + } + if (!sbp_carrier_phase_encode_internal(ctx, &msg->L)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->lock)) { + return false; + } + if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_packed_obs_content_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_packed_obs_content_dep_c_t *msg) { +s8 sbp_packed_obs_content_dep_c_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_packed_obs_content_dep_c_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3862,17 +6391,29 @@ s8 sbp_packed_obs_content_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_wri return SBP_OK; } -bool sbp_packed_obs_content_dep_c_decode_internal(sbp_decode_ctx_t *ctx, sbp_packed_obs_content_dep_c_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->P)) { return false; } - if (!sbp_carrier_phase_decode_internal(ctx, &msg->L)) { return false; } - if (!sbp_u8_decode(ctx, &msg->cn0)) { return false; } - if (!sbp_u16_decode(ctx, &msg->lock)) { return false; } - if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { return false; } +bool sbp_packed_obs_content_dep_c_decode_internal( + sbp_decode_ctx_t *ctx, sbp_packed_obs_content_dep_c_t *msg) { + if (!sbp_u32_decode(ctx, &msg->P)) { + return false; + } + if (!sbp_carrier_phase_decode_internal(ctx, &msg->L)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->lock)) { + return false; + } + if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_packed_obs_content_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_packed_obs_content_dep_c_t *msg) { +s8 sbp_packed_obs_content_dep_c_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_packed_obs_content_dep_c_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3886,39 +6427,52 @@ s8 sbp_packed_obs_content_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - - -int sbp_packed_obs_content_dep_c_cmp(const sbp_packed_obs_content_dep_c_t *a, const sbp_packed_obs_content_dep_c_t *b) { +int sbp_packed_obs_content_dep_c_cmp(const sbp_packed_obs_content_dep_c_t *a, + const sbp_packed_obs_content_dep_c_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->P, &b->P); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_carrier_phase_cmp(&a->L, &b->L); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->cn0, &b->cn0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->lock, &b->lock); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_obs_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_obs_dep_a_t *msg) -{ - if (!sbp_observation_header_dep_encode_internal(ctx, &msg->header)) { return false; } - for (size_t i = 0; i < msg->n_obs; i++) - { - if (!sbp_packed_obs_content_dep_a_encode_internal(ctx, &msg->obs[i])) { return false; } +bool sbp_msg_obs_dep_a_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_obs_dep_a_t *msg) { + if (!sbp_observation_header_dep_encode_internal(ctx, &msg->header)) { + return false; + } + for (size_t i = 0; i < msg->n_obs; i++) { + if (!sbp_packed_obs_content_dep_a_encode_internal(ctx, &msg->obs[i])) { + return false; + } } return true; } -s8 sbp_msg_obs_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_obs_dep_a_t *msg) { +s8 sbp_msg_obs_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_obs_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3932,20 +6486,27 @@ s8 sbp_msg_obs_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_obs_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_obs_dep_a_t *msg) -{ - if (!sbp_observation_header_dep_decode_internal(ctx, &msg->header)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_PACKED_OBS_CONTENT_DEP_A_ENCODED_LEN) != 0) { +bool sbp_msg_obs_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_obs_dep_a_t *msg) { + if (!sbp_observation_header_dep_decode_internal(ctx, &msg->header)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % + SBP_PACKED_OBS_CONTENT_DEP_A_ENCODED_LEN) != 0) { + return false; + } + msg->n_obs = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_PACKED_OBS_CONTENT_DEP_A_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_obs; i++) { + if (!sbp_packed_obs_content_dep_a_decode_internal(ctx, &msg->obs[i])) { return false; } - msg->n_obs = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_PACKED_OBS_CONTENT_DEP_A_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_obs; i++) { - if (!sbp_packed_obs_content_dep_a_decode_internal(ctx, &msg->obs[i])) { return false; } - } + } return true; } -s8 sbp_msg_obs_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_obs_dep_a_t *msg) { +s8 sbp_msg_obs_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_obs_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3959,42 +6520,54 @@ s8 sbp_msg_obs_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - -s8 sbp_msg_obs_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_obs_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_obs_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_obs_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_obs_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_OBS_DEP_A, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_obs_dep_a_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_OBS_DEP_A, sender_id, payload_len, payload, + write); } -int sbp_msg_obs_dep_a_cmp(const sbp_msg_obs_dep_a_t *a, const sbp_msg_obs_dep_a_t *b) { +int sbp_msg_obs_dep_a_cmp(const sbp_msg_obs_dep_a_t *a, + const sbp_msg_obs_dep_a_t *b) { int ret = 0; - + ret = sbp_observation_header_dep_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_obs, &b->n_obs); - for (uint8_t i = 0; ret == 0 && i < a->n_obs; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_obs; i++) { ret = sbp_packed_obs_content_dep_a_cmp(&a->obs[i], &b->obs[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_obs_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_obs_dep_b_t *msg) -{ - if (!sbp_observation_header_dep_encode_internal(ctx, &msg->header)) { return false; } - for (size_t i = 0; i < msg->n_obs; i++) - { - if (!sbp_packed_obs_content_dep_b_encode_internal(ctx, &msg->obs[i])) { return false; } +bool sbp_msg_obs_dep_b_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_obs_dep_b_t *msg) { + if (!sbp_observation_header_dep_encode_internal(ctx, &msg->header)) { + return false; + } + for (size_t i = 0; i < msg->n_obs; i++) { + if (!sbp_packed_obs_content_dep_b_encode_internal(ctx, &msg->obs[i])) { + return false; + } } return true; } -s8 sbp_msg_obs_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_obs_dep_b_t *msg) { +s8 sbp_msg_obs_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_obs_dep_b_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4008,20 +6581,27 @@ s8 sbp_msg_obs_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_obs_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_obs_dep_b_t *msg) -{ - if (!sbp_observation_header_dep_decode_internal(ctx, &msg->header)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_PACKED_OBS_CONTENT_DEP_B_ENCODED_LEN) != 0) { +bool sbp_msg_obs_dep_b_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_obs_dep_b_t *msg) { + if (!sbp_observation_header_dep_decode_internal(ctx, &msg->header)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % + SBP_PACKED_OBS_CONTENT_DEP_B_ENCODED_LEN) != 0) { + return false; + } + msg->n_obs = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_PACKED_OBS_CONTENT_DEP_B_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_obs; i++) { + if (!sbp_packed_obs_content_dep_b_decode_internal(ctx, &msg->obs[i])) { return false; } - msg->n_obs = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_PACKED_OBS_CONTENT_DEP_B_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_obs; i++) { - if (!sbp_packed_obs_content_dep_b_decode_internal(ctx, &msg->obs[i])) { return false; } - } + } return true; } -s8 sbp_msg_obs_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_obs_dep_b_t *msg) { +s8 sbp_msg_obs_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_obs_dep_b_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4035,42 +6615,54 @@ s8 sbp_msg_obs_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - -s8 sbp_msg_obs_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_obs_dep_b_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_obs_dep_b_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_obs_dep_b_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_obs_dep_b_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_OBS_DEP_B, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_obs_dep_b_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_OBS_DEP_B, sender_id, payload_len, payload, + write); } -int sbp_msg_obs_dep_b_cmp(const sbp_msg_obs_dep_b_t *a, const sbp_msg_obs_dep_b_t *b) { +int sbp_msg_obs_dep_b_cmp(const sbp_msg_obs_dep_b_t *a, + const sbp_msg_obs_dep_b_t *b) { int ret = 0; - + ret = sbp_observation_header_dep_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_obs, &b->n_obs); - for (uint8_t i = 0; ret == 0 && i < a->n_obs; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_obs; i++) { ret = sbp_packed_obs_content_dep_b_cmp(&a->obs[i], &b->obs[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_obs_dep_c_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_obs_dep_c_t *msg) -{ - if (!sbp_observation_header_dep_encode_internal(ctx, &msg->header)) { return false; } - for (size_t i = 0; i < msg->n_obs; i++) - { - if (!sbp_packed_obs_content_dep_c_encode_internal(ctx, &msg->obs[i])) { return false; } +bool sbp_msg_obs_dep_c_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_obs_dep_c_t *msg) { + if (!sbp_observation_header_dep_encode_internal(ctx, &msg->header)) { + return false; + } + for (size_t i = 0; i < msg->n_obs; i++) { + if (!sbp_packed_obs_content_dep_c_encode_internal(ctx, &msg->obs[i])) { + return false; + } } return true; } -s8 sbp_msg_obs_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_obs_dep_c_t *msg) { +s8 sbp_msg_obs_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_obs_dep_c_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4084,20 +6676,27 @@ s8 sbp_msg_obs_dep_c_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_obs_dep_c_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_obs_dep_c_t *msg) -{ - if (!sbp_observation_header_dep_decode_internal(ctx, &msg->header)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_PACKED_OBS_CONTENT_DEP_C_ENCODED_LEN) != 0) { +bool sbp_msg_obs_dep_c_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_obs_dep_c_t *msg) { + if (!sbp_observation_header_dep_decode_internal(ctx, &msg->header)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % + SBP_PACKED_OBS_CONTENT_DEP_C_ENCODED_LEN) != 0) { + return false; + } + msg->n_obs = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_PACKED_OBS_CONTENT_DEP_C_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_obs; i++) { + if (!sbp_packed_obs_content_dep_c_decode_internal(ctx, &msg->obs[i])) { return false; } - msg->n_obs = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_PACKED_OBS_CONTENT_DEP_C_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_obs; i++) { - if (!sbp_packed_obs_content_dep_c_decode_internal(ctx, &msg->obs[i])) { return false; } - } + } return true; } -s8 sbp_msg_obs_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_obs_dep_c_t *msg) { +s8 sbp_msg_obs_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_obs_dep_c_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4111,46 +6710,73 @@ s8 sbp_msg_obs_dep_c_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - -s8 sbp_msg_obs_dep_c_send(sbp_state_t *s, u16 sender_id, const sbp_msg_obs_dep_c_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_obs_dep_c_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_obs_dep_c_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_obs_dep_c_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_OBS_DEP_C, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_obs_dep_c_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_OBS_DEP_C, sender_id, payload_len, payload, + write); } -int sbp_msg_obs_dep_c_cmp(const sbp_msg_obs_dep_c_t *a, const sbp_msg_obs_dep_c_t *b) { +int sbp_msg_obs_dep_c_cmp(const sbp_msg_obs_dep_c_t *a, + const sbp_msg_obs_dep_c_t *b) { int ret = 0; - + ret = sbp_observation_header_dep_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_obs, &b->n_obs); - for (uint8_t i = 0; ret == 0 && i < a->n_obs; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_obs; i++) { ret = sbp_packed_obs_content_dep_c_cmp(&a->obs[i], &b->obs[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_iono_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_iono_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->t_nmct)) { return false; } - if (!sbp_double_encode(ctx, &msg->a0)) { return false; } - if (!sbp_double_encode(ctx, &msg->a1)) { return false; } - if (!sbp_double_encode(ctx, &msg->a2)) { return false; } - if (!sbp_double_encode(ctx, &msg->a3)) { return false; } - if (!sbp_double_encode(ctx, &msg->b0)) { return false; } - if (!sbp_double_encode(ctx, &msg->b1)) { return false; } - if (!sbp_double_encode(ctx, &msg->b2)) { return false; } - if (!sbp_double_encode(ctx, &msg->b3)) { return false; } +bool sbp_msg_iono_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_iono_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->t_nmct)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->a0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->a1)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->a2)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->a3)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->b0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->b1)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->b2)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->b3)) { + return false; + } return true; } -s8 sbp_msg_iono_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_iono_t *msg) { +s8 sbp_msg_iono_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_iono_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4164,21 +6790,39 @@ s8 sbp_msg_iono_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_ return SBP_OK; } -bool sbp_msg_iono_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_iono_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->t_nmct)) { return false; } - if (!sbp_double_decode(ctx, &msg->a0)) { return false; } - if (!sbp_double_decode(ctx, &msg->a1)) { return false; } - if (!sbp_double_decode(ctx, &msg->a2)) { return false; } - if (!sbp_double_decode(ctx, &msg->a3)) { return false; } - if (!sbp_double_decode(ctx, &msg->b0)) { return false; } - if (!sbp_double_decode(ctx, &msg->b1)) { return false; } - if (!sbp_double_decode(ctx, &msg->b2)) { return false; } - if (!sbp_double_decode(ctx, &msg->b3)) { return false; } +bool sbp_msg_iono_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_iono_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->t_nmct)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->a0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->a1)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->a2)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->a3)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->b0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->b1)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->b2)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->b3)) { + return false; + } return true; } -s8 sbp_msg_iono_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_iono_t *msg) { +s8 sbp_msg_iono_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_iono_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4192,56 +6836,82 @@ s8 sbp_msg_iono_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg return SBP_OK; } - -s8 sbp_msg_iono_send(sbp_state_t *s, u16 sender_id, const sbp_msg_iono_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_iono_send(sbp_state_t *s, u16 sender_id, const sbp_msg_iono_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_iono_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_IONO, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_IONO, sender_id, payload_len, payload, + write); } int sbp_msg_iono_cmp(const sbp_msg_iono_t *a, const sbp_msg_iono_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->t_nmct, &b->t_nmct); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->a0, &b->a0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->a1, &b->a1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->a2, &b->a2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->a3, &b->a3); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->b0, &b->b0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->b1, &b->b1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->b2, &b->b2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->b3, &b->b3); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_sv_configuration_gps_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_sv_configuration_gps_dep_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->t_nmct)) { return false; } - if (!sbp_u32_encode(ctx, &msg->l2c_mask)) { return false; } +bool sbp_msg_sv_configuration_gps_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_sv_configuration_gps_dep_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->t_nmct)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->l2c_mask)) { + return false; + } return true; } -s8 sbp_msg_sv_configuration_gps_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_sv_configuration_gps_dep_t *msg) { +s8 sbp_msg_sv_configuration_gps_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_sv_configuration_gps_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4255,14 +6925,20 @@ s8 sbp_msg_sv_configuration_gps_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } -bool sbp_msg_sv_configuration_gps_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_sv_configuration_gps_dep_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->t_nmct)) { return false; } - if (!sbp_u32_decode(ctx, &msg->l2c_mask)) { return false; } +bool sbp_msg_sv_configuration_gps_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_sv_configuration_gps_dep_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->t_nmct)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->l2c_mask)) { + return false; + } return true; } -s8 sbp_msg_sv_configuration_gps_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_sv_configuration_gps_dep_t *msg) { +s8 sbp_msg_sv_configuration_gps_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_sv_configuration_gps_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4276,48 +6952,89 @@ s8 sbp_msg_sv_configuration_gps_dep_decode(const uint8_t *buf, uint8_t len, uint return SBP_OK; } - -s8 sbp_msg_sv_configuration_gps_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_sv_configuration_gps_dep_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_sv_configuration_gps_dep_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_sv_configuration_gps_dep_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_sv_configuration_gps_dep_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SV_CONFIGURATION_GPS_DEP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_sv_configuration_gps_dep_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SV_CONFIGURATION_GPS_DEP, sender_id, + payload_len, payload, write); } -int sbp_msg_sv_configuration_gps_dep_cmp(const sbp_msg_sv_configuration_gps_dep_t *a, const sbp_msg_sv_configuration_gps_dep_t *b) { +int sbp_msg_sv_configuration_gps_dep_cmp( + const sbp_msg_sv_configuration_gps_dep_t *a, + const sbp_msg_sv_configuration_gps_dep_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->t_nmct, &b->t_nmct); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->l2c_mask, &b->l2c_mask); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_gnss_capb_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gnss_capb_t *msg) -{ - if (!sbp_u64_encode(ctx, &msg->gps_active)) { return false; } - if (!sbp_u64_encode(ctx, &msg->gps_l2c)) { return false; } - if (!sbp_u64_encode(ctx, &msg->gps_l5)) { return false; } - if (!sbp_u32_encode(ctx, &msg->glo_active)) { return false; } - if (!sbp_u32_encode(ctx, &msg->glo_l2of)) { return false; } - if (!sbp_u32_encode(ctx, &msg->glo_l3)) { return false; } - if (!sbp_u64_encode(ctx, &msg->sbas_active)) { return false; } - if (!sbp_u64_encode(ctx, &msg->sbas_l5)) { return false; } - if (!sbp_u64_encode(ctx, &msg->bds_active)) { return false; } - if (!sbp_u64_encode(ctx, &msg->bds_d2nav)) { return false; } - if (!sbp_u64_encode(ctx, &msg->bds_b2)) { return false; } - if (!sbp_u64_encode(ctx, &msg->bds_b2a)) { return false; } - if (!sbp_u32_encode(ctx, &msg->qzss_active)) { return false; } - if (!sbp_u64_encode(ctx, &msg->gal_active)) { return false; } - if (!sbp_u64_encode(ctx, &msg->gal_e5)) { return false; } +bool sbp_gnss_capb_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_gnss_capb_t *msg) { + if (!sbp_u64_encode(ctx, &msg->gps_active)) { + return false; + } + if (!sbp_u64_encode(ctx, &msg->gps_l2c)) { + return false; + } + if (!sbp_u64_encode(ctx, &msg->gps_l5)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->glo_active)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->glo_l2of)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->glo_l3)) { + return false; + } + if (!sbp_u64_encode(ctx, &msg->sbas_active)) { + return false; + } + if (!sbp_u64_encode(ctx, &msg->sbas_l5)) { + return false; + } + if (!sbp_u64_encode(ctx, &msg->bds_active)) { + return false; + } + if (!sbp_u64_encode(ctx, &msg->bds_d2nav)) { + return false; + } + if (!sbp_u64_encode(ctx, &msg->bds_b2)) { + return false; + } + if (!sbp_u64_encode(ctx, &msg->bds_b2a)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->qzss_active)) { + return false; + } + if (!sbp_u64_encode(ctx, &msg->gal_active)) { + return false; + } + if (!sbp_u64_encode(ctx, &msg->gal_e5)) { + return false; + } return true; } -s8 sbp_gnss_capb_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_gnss_capb_t *msg) { +s8 sbp_gnss_capb_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_gnss_capb_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4331,27 +7048,58 @@ s8 sbp_gnss_capb_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp return SBP_OK; } -bool sbp_gnss_capb_decode_internal(sbp_decode_ctx_t *ctx, sbp_gnss_capb_t *msg) -{ - if (!sbp_u64_decode(ctx, &msg->gps_active)) { return false; } - if (!sbp_u64_decode(ctx, &msg->gps_l2c)) { return false; } - if (!sbp_u64_decode(ctx, &msg->gps_l5)) { return false; } - if (!sbp_u32_decode(ctx, &msg->glo_active)) { return false; } - if (!sbp_u32_decode(ctx, &msg->glo_l2of)) { return false; } - if (!sbp_u32_decode(ctx, &msg->glo_l3)) { return false; } - if (!sbp_u64_decode(ctx, &msg->sbas_active)) { return false; } - if (!sbp_u64_decode(ctx, &msg->sbas_l5)) { return false; } - if (!sbp_u64_decode(ctx, &msg->bds_active)) { return false; } - if (!sbp_u64_decode(ctx, &msg->bds_d2nav)) { return false; } - if (!sbp_u64_decode(ctx, &msg->bds_b2)) { return false; } - if (!sbp_u64_decode(ctx, &msg->bds_b2a)) { return false; } - if (!sbp_u32_decode(ctx, &msg->qzss_active)) { return false; } - if (!sbp_u64_decode(ctx, &msg->gal_active)) { return false; } - if (!sbp_u64_decode(ctx, &msg->gal_e5)) { return false; } +bool sbp_gnss_capb_decode_internal(sbp_decode_ctx_t *ctx, + sbp_gnss_capb_t *msg) { + if (!sbp_u64_decode(ctx, &msg->gps_active)) { + return false; + } + if (!sbp_u64_decode(ctx, &msg->gps_l2c)) { + return false; + } + if (!sbp_u64_decode(ctx, &msg->gps_l5)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->glo_active)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->glo_l2of)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->glo_l3)) { + return false; + } + if (!sbp_u64_decode(ctx, &msg->sbas_active)) { + return false; + } + if (!sbp_u64_decode(ctx, &msg->sbas_l5)) { + return false; + } + if (!sbp_u64_decode(ctx, &msg->bds_active)) { + return false; + } + if (!sbp_u64_decode(ctx, &msg->bds_d2nav)) { + return false; + } + if (!sbp_u64_decode(ctx, &msg->bds_b2)) { + return false; + } + if (!sbp_u64_decode(ctx, &msg->bds_b2a)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->qzss_active)) { + return false; + } + if (!sbp_u64_decode(ctx, &msg->gal_active)) { + return false; + } + if (!sbp_u64_decode(ctx, &msg->gal_e5)) { + return false; + } return true; } -s8 sbp_gnss_capb_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_gnss_capb_t *msg) { +s8 sbp_gnss_capb_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_gnss_capb_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4365,66 +7113,99 @@ s8 sbp_gnss_capb_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_gn return SBP_OK; } - - int sbp_gnss_capb_cmp(const sbp_gnss_capb_t *a, const sbp_gnss_capb_t *b) { int ret = 0; - + ret = sbp_u64_cmp(&a->gps_active, &b->gps_active); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u64_cmp(&a->gps_l2c, &b->gps_l2c); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u64_cmp(&a->gps_l5, &b->gps_l5); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->glo_active, &b->glo_active); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->glo_l2of, &b->glo_l2of); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->glo_l3, &b->glo_l3); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u64_cmp(&a->sbas_active, &b->sbas_active); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u64_cmp(&a->sbas_l5, &b->sbas_l5); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u64_cmp(&a->bds_active, &b->bds_active); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u64_cmp(&a->bds_d2nav, &b->bds_d2nav); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u64_cmp(&a->bds_b2, &b->bds_b2); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u64_cmp(&a->bds_b2a, &b->bds_b2a); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->qzss_active, &b->qzss_active); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u64_cmp(&a->gal_active, &b->gal_active); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u64_cmp(&a->gal_e5, &b->gal_e5); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_gnss_capb_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_gnss_capb_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->t_nmct)) { return false; } - if (!sbp_gnss_capb_encode_internal(ctx, &msg->gc)) { return false; } +bool sbp_msg_gnss_capb_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_gnss_capb_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->t_nmct)) { + return false; + } + if (!sbp_gnss_capb_encode_internal(ctx, &msg->gc)) { + return false; + } return true; } -s8 sbp_msg_gnss_capb_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_gnss_capb_t *msg) { +s8 sbp_msg_gnss_capb_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_gnss_capb_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4438,14 +7219,19 @@ s8 sbp_msg_gnss_capb_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_gnss_capb_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gnss_capb_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->t_nmct)) { return false; } - if (!sbp_gnss_capb_decode_internal(ctx, &msg->gc)) { return false; } +bool sbp_msg_gnss_capb_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_gnss_capb_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->t_nmct)) { + return false; + } + if (!sbp_gnss_capb_decode_internal(ctx, &msg->gc)) { + return false; + } return true; } -s8 sbp_msg_gnss_capb_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_gnss_capb_t *msg) { +s8 sbp_msg_gnss_capb_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_gnss_capb_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4459,39 +7245,62 @@ s8 sbp_msg_gnss_capb_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - -s8 sbp_msg_gnss_capb_send(sbp_state_t *s, u16 sender_id, const sbp_msg_gnss_capb_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_gnss_capb_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_gnss_capb_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_gnss_capb_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_GNSS_CAPB, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_gnss_capb_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_GNSS_CAPB, sender_id, payload_len, payload, + write); } -int sbp_msg_gnss_capb_cmp(const sbp_msg_gnss_capb_t *a, const sbp_msg_gnss_capb_t *b) { +int sbp_msg_gnss_capb_cmp(const sbp_msg_gnss_capb_t *a, + const sbp_msg_gnss_capb_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->t_nmct, &b->t_nmct); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gnss_capb_cmp(&a->gc, &b->gc); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_group_delay_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_group_delay_dep_a_t *msg) -{ - if (!sbp_gps_time_dep_encode_internal(ctx, &msg->t_op)) { return false; } - if (!sbp_u8_encode(ctx, &msg->prn)) { return false; } - if (!sbp_u8_encode(ctx, &msg->valid)) { return false; } - if (!sbp_s16_encode(ctx, &msg->tgd)) { return false; } - if (!sbp_s16_encode(ctx, &msg->isc_l1ca)) { return false; } - if (!sbp_s16_encode(ctx, &msg->isc_l2c)) { return false; } +bool sbp_msg_group_delay_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_group_delay_dep_a_t *msg) { + if (!sbp_gps_time_dep_encode_internal(ctx, &msg->t_op)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->prn)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->valid)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->isc_l1ca)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->isc_l2c)) { + return false; + } return true; } -s8 sbp_msg_group_delay_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_group_delay_dep_a_t *msg) { +s8 sbp_msg_group_delay_dep_a_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_group_delay_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4505,18 +7314,32 @@ s8 sbp_msg_group_delay_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_group_delay_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_group_delay_dep_a_t *msg) -{ - if (!sbp_gps_time_dep_decode_internal(ctx, &msg->t_op)) { return false; } - if (!sbp_u8_decode(ctx, &msg->prn)) { return false; } - if (!sbp_u8_decode(ctx, &msg->valid)) { return false; } - if (!sbp_s16_decode(ctx, &msg->tgd)) { return false; } - if (!sbp_s16_decode(ctx, &msg->isc_l1ca)) { return false; } - if (!sbp_s16_decode(ctx, &msg->isc_l2c)) { return false; } +bool sbp_msg_group_delay_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_group_delay_dep_a_t *msg) { + if (!sbp_gps_time_dep_decode_internal(ctx, &msg->t_op)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->prn)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->valid)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->isc_l1ca)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->isc_l2c)) { + return false; + } return true; } -s8 sbp_msg_group_delay_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_group_delay_dep_a_t *msg) { +s8 sbp_msg_group_delay_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_group_delay_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4530,51 +7353,82 @@ s8 sbp_msg_group_delay_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_group_delay_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_group_delay_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_group_delay_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_group_delay_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_group_delay_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_GROUP_DELAY_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_group_delay_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_GROUP_DELAY_DEP_A, sender_id, payload_len, + payload, write); } -int sbp_msg_group_delay_dep_a_cmp(const sbp_msg_group_delay_dep_a_t *a, const sbp_msg_group_delay_dep_a_t *b) { +int sbp_msg_group_delay_dep_a_cmp(const sbp_msg_group_delay_dep_a_t *a, + const sbp_msg_group_delay_dep_a_t *b) { int ret = 0; - + ret = sbp_gps_time_dep_cmp(&a->t_op, &b->t_op); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->prn, &b->prn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->valid, &b->valid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->tgd, &b->tgd); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->isc_l1ca, &b->isc_l1ca); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->isc_l2c, &b->isc_l2c); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_group_delay_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_group_delay_dep_b_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->t_op)) { return false; } - if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->valid)) { return false; } - if (!sbp_s16_encode(ctx, &msg->tgd)) { return false; } - if (!sbp_s16_encode(ctx, &msg->isc_l1ca)) { return false; } - if (!sbp_s16_encode(ctx, &msg->isc_l2c)) { return false; } +bool sbp_msg_group_delay_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_group_delay_dep_b_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->t_op)) { + return false; + } + if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->valid)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->isc_l1ca)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->isc_l2c)) { + return false; + } return true; } -s8 sbp_msg_group_delay_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_group_delay_dep_b_t *msg) { +s8 sbp_msg_group_delay_dep_b_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_group_delay_dep_b_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4588,18 +7442,32 @@ s8 sbp_msg_group_delay_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_group_delay_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_group_delay_dep_b_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->t_op)) { return false; } - if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->valid)) { return false; } - if (!sbp_s16_decode(ctx, &msg->tgd)) { return false; } - if (!sbp_s16_decode(ctx, &msg->isc_l1ca)) { return false; } - if (!sbp_s16_decode(ctx, &msg->isc_l2c)) { return false; } +bool sbp_msg_group_delay_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_group_delay_dep_b_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->t_op)) { + return false; + } + if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->valid)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->isc_l1ca)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->isc_l2c)) { + return false; + } return true; } -s8 sbp_msg_group_delay_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_group_delay_dep_b_t *msg) { +s8 sbp_msg_group_delay_dep_b_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_group_delay_dep_b_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4613,51 +7481,81 @@ s8 sbp_msg_group_delay_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_group_delay_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_group_delay_dep_b_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_group_delay_dep_b_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_group_delay_dep_b_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_group_delay_dep_b_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_GROUP_DELAY_DEP_B, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_group_delay_dep_b_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_GROUP_DELAY_DEP_B, sender_id, payload_len, + payload, write); } -int sbp_msg_group_delay_dep_b_cmp(const sbp_msg_group_delay_dep_b_t *a, const sbp_msg_group_delay_dep_b_t *b) { +int sbp_msg_group_delay_dep_b_cmp(const sbp_msg_group_delay_dep_b_t *a, + const sbp_msg_group_delay_dep_b_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->t_op, &b->t_op); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->valid, &b->valid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->tgd, &b->tgd); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->isc_l1ca, &b->isc_l1ca); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->isc_l2c, &b->isc_l2c); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_group_delay_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_group_delay_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->t_op)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->valid)) { return false; } - if (!sbp_s16_encode(ctx, &msg->tgd)) { return false; } - if (!sbp_s16_encode(ctx, &msg->isc_l1ca)) { return false; } - if (!sbp_s16_encode(ctx, &msg->isc_l2c)) { return false; } +bool sbp_msg_group_delay_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_group_delay_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->t_op)) { + return false; + } + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->valid)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->isc_l1ca)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->isc_l2c)) { + return false; + } return true; } -s8 sbp_msg_group_delay_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_group_delay_t *msg) { +s8 sbp_msg_group_delay_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_group_delay_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4671,18 +7569,31 @@ s8 sbp_msg_group_delay_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, con return SBP_OK; } -bool sbp_msg_group_delay_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_group_delay_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->t_op)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->valid)) { return false; } - if (!sbp_s16_decode(ctx, &msg->tgd)) { return false; } - if (!sbp_s16_decode(ctx, &msg->isc_l1ca)) { return false; } - if (!sbp_s16_decode(ctx, &msg->isc_l2c)) { return false; } +bool sbp_msg_group_delay_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_group_delay_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->t_op)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->valid)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->tgd)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->isc_l1ca)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->isc_l2c)) { + return false; + } return true; } -s8 sbp_msg_group_delay_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_group_delay_t *msg) { +s8 sbp_msg_group_delay_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_group_delay_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4696,51 +7607,82 @@ s8 sbp_msg_group_delay_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_group_delay_send(sbp_state_t *s, u16 sender_id, const sbp_msg_group_delay_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_group_delay_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_group_delay_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_group_delay_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_GROUP_DELAY, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_group_delay_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_GROUP_DELAY, sender_id, payload_len, + payload, write); } -int sbp_msg_group_delay_cmp(const sbp_msg_group_delay_t *a, const sbp_msg_group_delay_t *b) { +int sbp_msg_group_delay_cmp(const sbp_msg_group_delay_t *a, + const sbp_msg_group_delay_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->t_op, &b->t_op); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->valid, &b->valid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->tgd, &b->tgd); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->isc_l1ca, &b->isc_l1ca); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->isc_l2c, &b->isc_l2c); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_almanac_common_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_almanac_common_content_t *msg) -{ - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toa)) { return false; } - if (!sbp_double_encode(ctx, &msg->ura)) { return false; } - if (!sbp_u32_encode(ctx, &msg->fit_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->health_bits)) { return false; } +bool sbp_almanac_common_content_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_almanac_common_content_t *msg) { + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toa)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ura)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->fit_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->health_bits)) { + return false; + } return true; } -s8 sbp_almanac_common_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_almanac_common_content_t *msg) { +s8 sbp_almanac_common_content_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_almanac_common_content_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4754,18 +7696,32 @@ s8 sbp_almanac_common_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_writt return SBP_OK; } -bool sbp_almanac_common_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_almanac_common_content_t *msg) -{ - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toa)) { return false; } - if (!sbp_double_decode(ctx, &msg->ura)) { return false; } - if (!sbp_u32_decode(ctx, &msg->fit_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->health_bits)) { return false; } +bool sbp_almanac_common_content_decode_internal( + sbp_decode_ctx_t *ctx, sbp_almanac_common_content_t *msg) { + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toa)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ura)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->fit_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->health_bits)) { + return false; + } return true; } -s8 sbp_almanac_common_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_almanac_common_content_t *msg) { +s8 sbp_almanac_common_content_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_almanac_common_content_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4779,43 +7735,68 @@ s8 sbp_almanac_common_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } - - -int sbp_almanac_common_content_cmp(const sbp_almanac_common_content_t *a, const sbp_almanac_common_content_t *b) { +int sbp_almanac_common_content_cmp(const sbp_almanac_common_content_t *a, + const sbp_almanac_common_content_t *b) { int ret = 0; - + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_sec_cmp(&a->toa, &b->toa); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ura, &b->ura); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->fit_interval, &b->fit_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->valid, &b->valid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->health_bits, &b->health_bits); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_almanac_common_content_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_almanac_common_content_dep_t *msg) -{ - if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toa)) { return false; } - if (!sbp_double_encode(ctx, &msg->ura)) { return false; } - if (!sbp_u32_encode(ctx, &msg->fit_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->health_bits)) { return false; } +bool sbp_almanac_common_content_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_almanac_common_content_dep_t *msg) { + if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->toa)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ura)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->fit_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->health_bits)) { + return false; + } return true; } -s8 sbp_almanac_common_content_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_almanac_common_content_dep_t *msg) { +s8 sbp_almanac_common_content_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_almanac_common_content_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4829,18 +7810,32 @@ s8 sbp_almanac_common_content_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_w return SBP_OK; } -bool sbp_almanac_common_content_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_almanac_common_content_dep_t *msg) -{ - if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toa)) { return false; } - if (!sbp_double_decode(ctx, &msg->ura)) { return false; } - if (!sbp_u32_decode(ctx, &msg->fit_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->valid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->health_bits)) { return false; } +bool sbp_almanac_common_content_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_almanac_common_content_dep_t *msg) { + if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->toa)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ura)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->fit_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->valid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->health_bits)) { + return false; + } return true; } -s8 sbp_almanac_common_content_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_almanac_common_content_dep_t *msg) { +s8 sbp_almanac_common_content_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_almanac_common_content_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4854,47 +7849,80 @@ s8 sbp_almanac_common_content_dep_decode(const uint8_t *buf, uint8_t len, uint8_ return SBP_OK; } - - -int sbp_almanac_common_content_dep_cmp(const sbp_almanac_common_content_dep_t *a, const sbp_almanac_common_content_dep_t *b) { +int sbp_almanac_common_content_dep_cmp( + const sbp_almanac_common_content_dep_t *a, + const sbp_almanac_common_content_dep_t *b) { int ret = 0; - + ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_sec_cmp(&a->toa, &b->toa); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ura, &b->ura); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->fit_interval, &b->fit_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->valid, &b->valid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->health_bits, &b->health_bits); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_almanac_gps_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_almanac_gps_dep_t *msg) -{ - if (!sbp_almanac_common_content_dep_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_encode(ctx, &msg->m0)) { return false; } - if (!sbp_double_encode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_encode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_encode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_encode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_encode(ctx, &msg->w)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc)) { return false; } - if (!sbp_double_encode(ctx, &msg->af0)) { return false; } - if (!sbp_double_encode(ctx, &msg->af1)) { return false; } +bool sbp_msg_almanac_gps_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_almanac_gps_dep_t *msg) { + if (!sbp_almanac_common_content_dep_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af1)) { + return false; + } return true; } -s8 sbp_msg_almanac_gps_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_almanac_gps_dep_t *msg) { +s8 sbp_msg_almanac_gps_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_almanac_gps_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4908,22 +7936,44 @@ s8 sbp_msg_almanac_gps_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_almanac_gps_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_almanac_gps_dep_t *msg) -{ - if (!sbp_almanac_common_content_dep_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_decode(ctx, &msg->m0)) { return false; } - if (!sbp_double_decode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_decode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_decode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_decode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_decode(ctx, &msg->w)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc)) { return false; } - if (!sbp_double_decode(ctx, &msg->af0)) { return false; } - if (!sbp_double_decode(ctx, &msg->af1)) { return false; } +bool sbp_msg_almanac_gps_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_almanac_gps_dep_t *msg) { + if (!sbp_almanac_common_content_dep_decode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af1)) { + return false; + } return true; } -s8 sbp_msg_almanac_gps_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_almanac_gps_dep_t *msg) { +s8 sbp_msg_almanac_gps_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_almanac_gps_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -4937,67 +7987,113 @@ s8 sbp_msg_almanac_gps_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_almanac_gps_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_almanac_gps_dep_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_almanac_gps_dep_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_almanac_gps_dep_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_almanac_gps_dep_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ALMANAC_GPS_DEP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_almanac_gps_dep_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ALMANAC_GPS_DEP, sender_id, payload_len, + payload, write); } -int sbp_msg_almanac_gps_dep_cmp(const sbp_msg_almanac_gps_dep_t *a, const sbp_msg_almanac_gps_dep_t *b) { +int sbp_msg_almanac_gps_dep_cmp(const sbp_msg_almanac_gps_dep_t *a, + const sbp_msg_almanac_gps_dep_t *b) { int ret = 0; - + ret = sbp_almanac_common_content_dep_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->m0, &b->m0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ecc, &b->ecc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->sqrta, &b->sqrta); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omega0, &b->omega0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omegadot, &b->omegadot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->w, &b->w); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc, &b->inc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af0, &b->af0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af1, &b->af1); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_almanac_gps_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_almanac_gps_t *msg) -{ - if (!sbp_almanac_common_content_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_encode(ctx, &msg->m0)) { return false; } - if (!sbp_double_encode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_encode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_encode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_encode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_encode(ctx, &msg->w)) { return false; } - if (!sbp_double_encode(ctx, &msg->inc)) { return false; } - if (!sbp_double_encode(ctx, &msg->af0)) { return false; } - if (!sbp_double_encode(ctx, &msg->af1)) { return false; } +bool sbp_msg_almanac_gps_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_almanac_gps_t *msg) { + if (!sbp_almanac_common_content_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->af1)) { + return false; + } return true; } -s8 sbp_msg_almanac_gps_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_almanac_gps_t *msg) { +s8 sbp_msg_almanac_gps_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_almanac_gps_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -5011,22 +8107,43 @@ s8 sbp_msg_almanac_gps_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, con return SBP_OK; } -bool sbp_msg_almanac_gps_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_almanac_gps_t *msg) -{ - if (!sbp_almanac_common_content_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_decode(ctx, &msg->m0)) { return false; } - if (!sbp_double_decode(ctx, &msg->ecc)) { return false; } - if (!sbp_double_decode(ctx, &msg->sqrta)) { return false; } - if (!sbp_double_decode(ctx, &msg->omega0)) { return false; } - if (!sbp_double_decode(ctx, &msg->omegadot)) { return false; } - if (!sbp_double_decode(ctx, &msg->w)) { return false; } - if (!sbp_double_decode(ctx, &msg->inc)) { return false; } - if (!sbp_double_decode(ctx, &msg->af0)) { return false; } - if (!sbp_double_decode(ctx, &msg->af1)) { return false; } +bool sbp_msg_almanac_gps_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_almanac_gps_t *msg) { + if (!sbp_almanac_common_content_decode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->m0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->ecc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->sqrta)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omega0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omegadot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->w)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->inc)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af0)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->af1)) { + return false; + } return true; } -s8 sbp_msg_almanac_gps_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_almanac_gps_t *msg) { +s8 sbp_msg_almanac_gps_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_almanac_gps_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -5040,65 +8157,107 @@ s8 sbp_msg_almanac_gps_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_almanac_gps_send(sbp_state_t *s, u16 sender_id, const sbp_msg_almanac_gps_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_almanac_gps_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_almanac_gps_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_almanac_gps_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ALMANAC_GPS, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_almanac_gps_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ALMANAC_GPS, sender_id, payload_len, + payload, write); } -int sbp_msg_almanac_gps_cmp(const sbp_msg_almanac_gps_t *a, const sbp_msg_almanac_gps_t *b) { +int sbp_msg_almanac_gps_cmp(const sbp_msg_almanac_gps_t *a, + const sbp_msg_almanac_gps_t *b) { int ret = 0; - + ret = sbp_almanac_common_content_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->m0, &b->m0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->ecc, &b->ecc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->sqrta, &b->sqrta); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omega0, &b->omega0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omegadot, &b->omegadot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->w, &b->w); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->inc, &b->inc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af0, &b->af0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->af1, &b->af1); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_almanac_glo_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_almanac_glo_dep_t *msg) -{ - if (!sbp_almanac_common_content_dep_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_encode(ctx, &msg->lambda_na)) { return false; } - if (!sbp_double_encode(ctx, &msg->t_lambda_na)) { return false; } - if (!sbp_double_encode(ctx, &msg->i)) { return false; } - if (!sbp_double_encode(ctx, &msg->t)) { return false; } - if (!sbp_double_encode(ctx, &msg->t_dot)) { return false; } - if (!sbp_double_encode(ctx, &msg->epsilon)) { return false; } - if (!sbp_double_encode(ctx, &msg->omega)) { return false; } +bool sbp_msg_almanac_glo_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_almanac_glo_dep_t *msg) { + if (!sbp_almanac_common_content_dep_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lambda_na)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->t_lambda_na)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->i)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->t)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->t_dot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->epsilon)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omega)) { + return false; + } return true; } -s8 sbp_msg_almanac_glo_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_almanac_glo_dep_t *msg) { +s8 sbp_msg_almanac_glo_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_almanac_glo_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -5112,20 +8271,38 @@ s8 sbp_msg_almanac_glo_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_almanac_glo_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_almanac_glo_dep_t *msg) -{ - if (!sbp_almanac_common_content_dep_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_decode(ctx, &msg->lambda_na)) { return false; } - if (!sbp_double_decode(ctx, &msg->t_lambda_na)) { return false; } - if (!sbp_double_decode(ctx, &msg->i)) { return false; } - if (!sbp_double_decode(ctx, &msg->t)) { return false; } - if (!sbp_double_decode(ctx, &msg->t_dot)) { return false; } - if (!sbp_double_decode(ctx, &msg->epsilon)) { return false; } - if (!sbp_double_decode(ctx, &msg->omega)) { return false; } +bool sbp_msg_almanac_glo_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_almanac_glo_dep_t *msg) { + if (!sbp_almanac_common_content_dep_decode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lambda_na)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->t_lambda_na)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->i)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->t)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->t_dot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->epsilon)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omega)) { + return false; + } return true; } -s8 sbp_msg_almanac_glo_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_almanac_glo_dep_t *msg) { +s8 sbp_msg_almanac_glo_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_almanac_glo_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -5139,59 +8316,97 @@ s8 sbp_msg_almanac_glo_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_almanac_glo_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_almanac_glo_dep_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_almanac_glo_dep_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_almanac_glo_dep_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_almanac_glo_dep_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ALMANAC_GLO_DEP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_almanac_glo_dep_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ALMANAC_GLO_DEP, sender_id, payload_len, + payload, write); } -int sbp_msg_almanac_glo_dep_cmp(const sbp_msg_almanac_glo_dep_t *a, const sbp_msg_almanac_glo_dep_t *b) { +int sbp_msg_almanac_glo_dep_cmp(const sbp_msg_almanac_glo_dep_t *a, + const sbp_msg_almanac_glo_dep_t *b) { int ret = 0; - + ret = sbp_almanac_common_content_dep_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lambda_na, &b->lambda_na); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->t_lambda_na, &b->t_lambda_na); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->i, &b->i); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->t, &b->t); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->t_dot, &b->t_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->epsilon, &b->epsilon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omega, &b->omega); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_almanac_glo_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_almanac_glo_t *msg) -{ - if (!sbp_almanac_common_content_encode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_encode(ctx, &msg->lambda_na)) { return false; } - if (!sbp_double_encode(ctx, &msg->t_lambda_na)) { return false; } - if (!sbp_double_encode(ctx, &msg->i)) { return false; } - if (!sbp_double_encode(ctx, &msg->t)) { return false; } - if (!sbp_double_encode(ctx, &msg->t_dot)) { return false; } - if (!sbp_double_encode(ctx, &msg->epsilon)) { return false; } - if (!sbp_double_encode(ctx, &msg->omega)) { return false; } +bool sbp_msg_almanac_glo_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_almanac_glo_t *msg) { + if (!sbp_almanac_common_content_encode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->lambda_na)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->t_lambda_na)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->i)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->t)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->t_dot)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->epsilon)) { + return false; + } + if (!sbp_double_encode(ctx, &msg->omega)) { + return false; + } return true; } -s8 sbp_msg_almanac_glo_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_almanac_glo_t *msg) { +s8 sbp_msg_almanac_glo_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_almanac_glo_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -5205,20 +8420,37 @@ s8 sbp_msg_almanac_glo_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, con return SBP_OK; } -bool sbp_msg_almanac_glo_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_almanac_glo_t *msg) -{ - if (!sbp_almanac_common_content_decode_internal(ctx, &msg->common)) { return false; } - if (!sbp_double_decode(ctx, &msg->lambda_na)) { return false; } - if (!sbp_double_decode(ctx, &msg->t_lambda_na)) { return false; } - if (!sbp_double_decode(ctx, &msg->i)) { return false; } - if (!sbp_double_decode(ctx, &msg->t)) { return false; } - if (!sbp_double_decode(ctx, &msg->t_dot)) { return false; } - if (!sbp_double_decode(ctx, &msg->epsilon)) { return false; } - if (!sbp_double_decode(ctx, &msg->omega)) { return false; } +bool sbp_msg_almanac_glo_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_almanac_glo_t *msg) { + if (!sbp_almanac_common_content_decode_internal(ctx, &msg->common)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->lambda_na)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->t_lambda_na)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->i)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->t)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->t_dot)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->epsilon)) { + return false; + } + if (!sbp_double_decode(ctx, &msg->omega)) { + return false; + } return true; } -s8 sbp_msg_almanac_glo_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_almanac_glo_t *msg) { +s8 sbp_msg_almanac_glo_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_almanac_glo_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -5232,56 +8464,88 @@ s8 sbp_msg_almanac_glo_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_almanac_glo_send(sbp_state_t *s, u16 sender_id, const sbp_msg_almanac_glo_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_almanac_glo_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_almanac_glo_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_almanac_glo_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ALMANAC_GLO, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_almanac_glo_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ALMANAC_GLO, sender_id, payload_len, + payload, write); } -int sbp_msg_almanac_glo_cmp(const sbp_msg_almanac_glo_t *a, const sbp_msg_almanac_glo_t *b) { +int sbp_msg_almanac_glo_cmp(const sbp_msg_almanac_glo_t *a, + const sbp_msg_almanac_glo_t *b) { int ret = 0; - + ret = sbp_almanac_common_content_cmp(&a->common, &b->common); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->lambda_na, &b->lambda_na); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->t_lambda_na, &b->t_lambda_na); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->i, &b->i); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->t, &b->t); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->t_dot, &b->t_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->epsilon, &b->epsilon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_double_cmp(&a->omega, &b->omega); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_glo_biases_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_glo_biases_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->mask)) { return false; } - if (!sbp_s16_encode(ctx, &msg->l1ca_bias)) { return false; } - if (!sbp_s16_encode(ctx, &msg->l1p_bias)) { return false; } - if (!sbp_s16_encode(ctx, &msg->l2ca_bias)) { return false; } - if (!sbp_s16_encode(ctx, &msg->l2p_bias)) { return false; } +bool sbp_msg_glo_biases_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_glo_biases_t *msg) { + if (!sbp_u8_encode(ctx, &msg->mask)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->l1ca_bias)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->l1p_bias)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->l2ca_bias)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->l2p_bias)) { + return false; + } return true; } -s8 sbp_msg_glo_biases_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_glo_biases_t *msg) { +s8 sbp_msg_glo_biases_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_glo_biases_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -5295,17 +8559,28 @@ s8 sbp_msg_glo_biases_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, cons return SBP_OK; } -bool sbp_msg_glo_biases_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_glo_biases_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->mask)) { return false; } - if (!sbp_s16_decode(ctx, &msg->l1ca_bias)) { return false; } - if (!sbp_s16_decode(ctx, &msg->l1p_bias)) { return false; } - if (!sbp_s16_decode(ctx, &msg->l2ca_bias)) { return false; } - if (!sbp_s16_decode(ctx, &msg->l2p_bias)) { return false; } +bool sbp_msg_glo_biases_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_glo_biases_t *msg) { + if (!sbp_u8_decode(ctx, &msg->mask)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->l1ca_bias)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->l1p_bias)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->l2ca_bias)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->l2p_bias)) { + return false; + } return true; } -s8 sbp_msg_glo_biases_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_glo_biases_t *msg) { +s8 sbp_msg_glo_biases_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_glo_biases_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -5319,45 +8594,67 @@ s8 sbp_msg_glo_biases_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, s return SBP_OK; } - -s8 sbp_msg_glo_biases_send(sbp_state_t *s, u16 sender_id, const sbp_msg_glo_biases_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_glo_biases_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_glo_biases_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_glo_biases_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_GLO_BIASES, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_glo_biases_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_GLO_BIASES, sender_id, payload_len, + payload, write); } -int sbp_msg_glo_biases_cmp(const sbp_msg_glo_biases_t *a, const sbp_msg_glo_biases_t *b) { +int sbp_msg_glo_biases_cmp(const sbp_msg_glo_biases_t *a, + const sbp_msg_glo_biases_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->mask, &b->mask); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->l1ca_bias, &b->l1ca_bias); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->l1p_bias, &b->l1p_bias); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->l2ca_bias, &b->l2ca_bias); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->l2p_bias, &b->l2p_bias); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_sv_az_el_encode_internal(sbp_encode_ctx_t *ctx, const sbp_sv_az_el_t *msg) -{ - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->az)) { return false; } - if (!sbp_s8_encode(ctx, &msg->el)) { return false; } +bool sbp_sv_az_el_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_sv_az_el_t *msg) { + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->az)) { + return false; + } + if (!sbp_s8_encode(ctx, &msg->el)) { + return false; + } return true; } -s8 sbp_sv_az_el_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_sv_az_el_t *msg) { +s8 sbp_sv_az_el_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_sv_az_el_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -5371,15 +8668,21 @@ s8 sbp_sv_az_el_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_ return SBP_OK; } -bool sbp_sv_az_el_decode_internal(sbp_decode_ctx_t *ctx, sbp_sv_az_el_t *msg) -{ - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->az)) { return false; } - if (!sbp_s8_decode(ctx, &msg->el)) { return false; } +bool sbp_sv_az_el_decode_internal(sbp_decode_ctx_t *ctx, sbp_sv_az_el_t *msg) { + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->az)) { + return false; + } + if (!sbp_s8_decode(ctx, &msg->el)) { + return false; + } return true; } -s8 sbp_sv_az_el_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_sv_az_el_t *msg) { +s8 sbp_sv_az_el_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_sv_az_el_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -5393,32 +8696,38 @@ s8 sbp_sv_az_el_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_sv_ return SBP_OK; } - - int sbp_sv_az_el_cmp(const sbp_sv_az_el_t *a, const sbp_sv_az_el_t *b) { int ret = 0; - + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->az, &b->az); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s8_cmp(&a->el, &b->el); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_sv_az_el_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_sv_az_el_t *msg) -{ - for (size_t i = 0; i < msg->n_azel; i++) - { - if (!sbp_sv_az_el_encode_internal(ctx, &msg->azel[i])) { return false; } +bool sbp_msg_sv_az_el_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_sv_az_el_t *msg) { + for (size_t i = 0; i < msg->n_azel; i++) { + if (!sbp_sv_az_el_encode_internal(ctx, &msg->azel[i])) { + return false; + } } return true; } -s8 sbp_msg_sv_az_el_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_sv_az_el_t *msg) { +s8 sbp_msg_sv_az_el_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_sv_az_el_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -5432,19 +8741,23 @@ s8 sbp_msg_sv_az_el_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_sv_az_el_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_sv_az_el_t *msg) -{ - if ( ((ctx->buf_len - ctx->offset) % SBP_SV_AZ_EL_ENCODED_LEN) != 0) { +bool sbp_msg_sv_az_el_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_sv_az_el_t *msg) { + if (((ctx->buf_len - ctx->offset) % SBP_SV_AZ_EL_ENCODED_LEN) != 0) { + return false; + } + msg->n_azel = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_SV_AZ_EL_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_azel; i++) { + if (!sbp_sv_az_el_decode_internal(ctx, &msg->azel[i])) { return false; } - msg->n_azel = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_SV_AZ_EL_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_azel; i++) { - if (!sbp_sv_az_el_decode_internal(ctx, &msg->azel[i])) { return false; } - } + } return true; } -s8 sbp_msg_sv_az_el_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_sv_az_el_t *msg) { +s8 sbp_msg_sv_az_el_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_sv_az_el_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -5458,39 +8771,47 @@ s8 sbp_msg_sv_az_el_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp return SBP_OK; } - -s8 sbp_msg_sv_az_el_send(sbp_state_t *s, u16 sender_id, const sbp_msg_sv_az_el_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_sv_az_el_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_sv_az_el_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_sv_az_el_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SV_AZ_EL, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SV_AZ_EL, sender_id, payload_len, payload, + write); } -int sbp_msg_sv_az_el_cmp(const sbp_msg_sv_az_el_t *a, const sbp_msg_sv_az_el_t *b) { +int sbp_msg_sv_az_el_cmp(const sbp_msg_sv_az_el_t *a, + const sbp_msg_sv_az_el_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->n_azel, &b->n_azel); - for (uint8_t i = 0; ret == 0 && i < a->n_azel; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_azel; i++) { ret = sbp_sv_az_el_cmp(&a->azel[i], &b->azel[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_osr_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_osr_t *msg) -{ - if (!sbp_observation_header_encode_internal(ctx, &msg->header)) { return false; } - for (size_t i = 0; i < msg->n_obs; i++) - { - if (!sbp_packed_osr_content_encode_internal(ctx, &msg->obs[i])) { return false; } +bool sbp_msg_osr_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_osr_t *msg) { + if (!sbp_observation_header_encode_internal(ctx, &msg->header)) { + return false; + } + for (size_t i = 0; i < msg->n_obs; i++) { + if (!sbp_packed_osr_content_encode_internal(ctx, &msg->obs[i])) { + return false; + } } return true; } -s8 sbp_msg_osr_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_osr_t *msg) { +s8 sbp_msg_osr_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_osr_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -5504,20 +8825,26 @@ s8 sbp_msg_osr_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_m return SBP_OK; } -bool sbp_msg_osr_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_osr_t *msg) -{ - if (!sbp_observation_header_decode_internal(ctx, &msg->header)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_PACKED_OSR_CONTENT_ENCODED_LEN) != 0) { +bool sbp_msg_osr_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_osr_t *msg) { + if (!sbp_observation_header_decode_internal(ctx, &msg->header)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_PACKED_OSR_CONTENT_ENCODED_LEN) != + 0) { + return false; + } + msg->n_obs = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_PACKED_OSR_CONTENT_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_obs; i++) { + if (!sbp_packed_osr_content_decode_internal(ctx, &msg->obs[i])) { return false; } - msg->n_obs = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_PACKED_OSR_CONTENT_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_obs; i++) { - if (!sbp_packed_osr_content_decode_internal(ctx, &msg->obs[i])) { return false; } - } + } return true; } -s8 sbp_msg_osr_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_osr_t *msg) { +s8 sbp_msg_osr_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_osr_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -5531,27 +8858,32 @@ s8 sbp_msg_osr_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ return SBP_OK; } - -s8 sbp_msg_osr_send(sbp_state_t *s, u16 sender_id, const sbp_msg_osr_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_osr_send(sbp_state_t *s, u16 sender_id, const sbp_msg_osr_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_osr_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_OSR, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_OSR, sender_id, payload_len, payload, + write); } int sbp_msg_osr_cmp(const sbp_msg_osr_t *a, const sbp_msg_osr_t *b) { int ret = 0; - + ret = sbp_observation_header_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_obs, &b->n_obs); - for (uint8_t i = 0; ret == 0 && i < a->n_obs; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_obs; i++) { ret = sbp_packed_osr_content_cmp(&a->obs[i], &b->obs[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/orientation.c b/c/src/orientation.c index 21cbce6e3..00710cb68 100644 --- a/c/src/orientation.c +++ b/c/src/orientation.c @@ -3,30 +3,40 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include #include +#include +#include #include #include -#include #include +#include +#include -bool sbp_msg_baseline_heading_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_baseline_heading_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u32_encode(ctx, &msg->heading)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_baseline_heading_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_baseline_heading_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->heading)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_baseline_heading_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_baseline_heading_t *msg) { +s8 sbp_msg_baseline_heading_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_baseline_heading_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -40,16 +50,26 @@ s8 sbp_msg_baseline_heading_encode(uint8_t *buf, uint8_t len, uint8_t *n_written return SBP_OK; } -bool sbp_msg_baseline_heading_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_baseline_heading_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u32_decode(ctx, &msg->heading)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_baseline_heading_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_baseline_heading_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->heading)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_baseline_heading_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_baseline_heading_t *msg) { +s8 sbp_msg_baseline_heading_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_baseline_heading_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -63,49 +83,83 @@ s8 sbp_msg_baseline_heading_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r return SBP_OK; } - -s8 sbp_msg_baseline_heading_send(sbp_state_t *s, u16 sender_id, const sbp_msg_baseline_heading_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_baseline_heading_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_baseline_heading_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_baseline_heading_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_BASELINE_HEADING, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_baseline_heading_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_BASELINE_HEADING, sender_id, payload_len, + payload, write); } -int sbp_msg_baseline_heading_cmp(const sbp_msg_baseline_heading_t *a, const sbp_msg_baseline_heading_t *b) { +int sbp_msg_baseline_heading_cmp(const sbp_msg_baseline_heading_t *a, + const sbp_msg_baseline_heading_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->heading, &b->heading); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_orient_quat_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_orient_quat_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->w)) { return false; } - if (!sbp_s32_encode(ctx, &msg->x)) { return false; } - if (!sbp_s32_encode(ctx, &msg->y)) { return false; } - if (!sbp_s32_encode(ctx, &msg->z)) { return false; } - if (!sbp_float_encode(ctx, &msg->w_accuracy)) { return false; } - if (!sbp_float_encode(ctx, &msg->x_accuracy)) { return false; } - if (!sbp_float_encode(ctx, &msg->y_accuracy)) { return false; } - if (!sbp_float_encode(ctx, &msg->z_accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_orient_quat_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_orient_quat_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->w)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->w_accuracy)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->x_accuracy)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->y_accuracy)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->z_accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_orient_quat_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_orient_quat_t *msg) { +s8 sbp_msg_orient_quat_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_orient_quat_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -119,22 +173,43 @@ s8 sbp_msg_orient_quat_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, con return SBP_OK; } -bool sbp_msg_orient_quat_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_orient_quat_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->w)) { return false; } - if (!sbp_s32_decode(ctx, &msg->x)) { return false; } - if (!sbp_s32_decode(ctx, &msg->y)) { return false; } - if (!sbp_s32_decode(ctx, &msg->z)) { return false; } - if (!sbp_float_decode(ctx, &msg->w_accuracy)) { return false; } - if (!sbp_float_decode(ctx, &msg->x_accuracy)) { return false; } - if (!sbp_float_decode(ctx, &msg->y_accuracy)) { return false; } - if (!sbp_float_decode(ctx, &msg->z_accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_orient_quat_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_orient_quat_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->w)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->w_accuracy)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->x_accuracy)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->y_accuracy)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->z_accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_orient_quat_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_orient_quat_t *msg) { +s8 sbp_msg_orient_quat_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_orient_quat_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -148,65 +223,107 @@ s8 sbp_msg_orient_quat_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_orient_quat_send(sbp_state_t *s, u16 sender_id, const sbp_msg_orient_quat_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_orient_quat_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_orient_quat_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_orient_quat_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ORIENT_QUAT, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_orient_quat_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ORIENT_QUAT, sender_id, payload_len, + payload, write); } -int sbp_msg_orient_quat_cmp(const sbp_msg_orient_quat_t *a, const sbp_msg_orient_quat_t *b) { +int sbp_msg_orient_quat_cmp(const sbp_msg_orient_quat_t *a, + const sbp_msg_orient_quat_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->w, &b->w); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->w_accuracy, &b->w_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->x_accuracy, &b->x_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->y_accuracy, &b->y_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->z_accuracy, &b->z_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_orient_euler_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_orient_euler_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->roll)) { return false; } - if (!sbp_s32_encode(ctx, &msg->pitch)) { return false; } - if (!sbp_s32_encode(ctx, &msg->yaw)) { return false; } - if (!sbp_float_encode(ctx, &msg->roll_accuracy)) { return false; } - if (!sbp_float_encode(ctx, &msg->pitch_accuracy)) { return false; } - if (!sbp_float_encode(ctx, &msg->yaw_accuracy)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_orient_euler_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_orient_euler_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->roll)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->pitch)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->yaw)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->roll_accuracy)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->pitch_accuracy)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->yaw_accuracy)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_orient_euler_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_orient_euler_t *msg) { +s8 sbp_msg_orient_euler_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_orient_euler_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -220,20 +337,37 @@ s8 sbp_msg_orient_euler_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, co return SBP_OK; } -bool sbp_msg_orient_euler_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_orient_euler_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->roll)) { return false; } - if (!sbp_s32_decode(ctx, &msg->pitch)) { return false; } - if (!sbp_s32_decode(ctx, &msg->yaw)) { return false; } - if (!sbp_float_decode(ctx, &msg->roll_accuracy)) { return false; } - if (!sbp_float_decode(ctx, &msg->pitch_accuracy)) { return false; } - if (!sbp_float_decode(ctx, &msg->yaw_accuracy)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_orient_euler_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_orient_euler_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->roll)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->pitch)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->yaw)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->roll_accuracy)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->pitch_accuracy)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->yaw_accuracy)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_orient_euler_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_orient_euler_t *msg) { +s8 sbp_msg_orient_euler_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_orient_euler_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -247,56 +381,88 @@ s8 sbp_msg_orient_euler_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_orient_euler_send(sbp_state_t *s, u16 sender_id, const sbp_msg_orient_euler_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_orient_euler_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_orient_euler_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_orient_euler_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ORIENT_EULER, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_orient_euler_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ORIENT_EULER, sender_id, payload_len, + payload, write); } -int sbp_msg_orient_euler_cmp(const sbp_msg_orient_euler_t *a, const sbp_msg_orient_euler_t *b) { +int sbp_msg_orient_euler_cmp(const sbp_msg_orient_euler_t *a, + const sbp_msg_orient_euler_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->roll, &b->roll); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->pitch, &b->pitch); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->yaw, &b->yaw); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->roll_accuracy, &b->roll_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->pitch_accuracy, &b->pitch_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->yaw_accuracy, &b->yaw_accuracy); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_angular_rate_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_angular_rate_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->x)) { return false; } - if (!sbp_s32_encode(ctx, &msg->y)) { return false; } - if (!sbp_s32_encode(ctx, &msg->z)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_angular_rate_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_angular_rate_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->z)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_angular_rate_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_angular_rate_t *msg) { +s8 sbp_msg_angular_rate_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_angular_rate_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -310,17 +476,28 @@ s8 sbp_msg_angular_rate_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, co return SBP_OK; } -bool sbp_msg_angular_rate_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_angular_rate_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->x)) { return false; } - if (!sbp_s32_decode(ctx, &msg->y)) { return false; } - if (!sbp_s32_decode(ctx, &msg->z)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_angular_rate_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_angular_rate_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->x)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->y)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->z)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_angular_rate_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_angular_rate_t *msg) { +s8 sbp_msg_angular_rate_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_angular_rate_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -334,32 +511,47 @@ s8 sbp_msg_angular_rate_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_angular_rate_send(sbp_state_t *s, u16 sender_id, const sbp_msg_angular_rate_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_angular_rate_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_angular_rate_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_angular_rate_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ANGULAR_RATE, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_angular_rate_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ANGULAR_RATE, sender_id, payload_len, + payload, write); } -int sbp_msg_angular_rate_cmp(const sbp_msg_angular_rate_t *a, const sbp_msg_angular_rate_t *b) { +int sbp_msg_angular_rate_cmp(const sbp_msg_angular_rate_t *a, + const sbp_msg_angular_rate_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->x, &b->x); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->y, &b->y); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->z, &b->z); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/piksi.c b/c/src/piksi.c index 0dd1d6d24..3f046e434 100644 --- a/c/src/piksi.c +++ b/c/src/piksi.c @@ -3,28 +3,29 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include #include +#include +#include #include #include -#include #include +#include +#include -bool sbp_msg_almanac_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_almanac_t *msg) -{ +bool sbp_msg_almanac_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_almanac_t *msg) { (void)ctx; (void)msg; return true; } -s8 sbp_msg_almanac_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_almanac_t *msg) { +s8 sbp_msg_almanac_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_almanac_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -38,14 +39,15 @@ s8 sbp_msg_almanac_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const s return SBP_OK; } -bool sbp_msg_almanac_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_almanac_t *msg) -{ - (void)ctx; +bool sbp_msg_almanac_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_almanac_t *msg) { + (void)ctx; (void)msg; return true; } -s8 sbp_msg_almanac_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_almanac_t *msg) { +s8 sbp_msg_almanac_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_almanac_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -59,31 +61,35 @@ s8 sbp_msg_almanac_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ return SBP_OK; } - -s8 sbp_msg_almanac_send(sbp_state_t *s, u16 sender_id, const sbp_msg_almanac_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_almanac_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_almanac_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_almanac_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ALMANAC, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ALMANAC, sender_id, payload_len, payload, + write); } -int sbp_msg_almanac_cmp(const sbp_msg_almanac_t *a, const sbp_msg_almanac_t *b) { +int sbp_msg_almanac_cmp(const sbp_msg_almanac_t *a, + const sbp_msg_almanac_t *b) { (void)a; (void)b; int ret = 0; return ret; } -bool sbp_msg_set_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_set_time_t *msg) -{ +bool sbp_msg_set_time_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_set_time_t *msg) { (void)ctx; (void)msg; return true; } -s8 sbp_msg_set_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_set_time_t *msg) { +s8 sbp_msg_set_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_set_time_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -97,14 +103,15 @@ s8 sbp_msg_set_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_set_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_set_time_t *msg) -{ - (void)ctx; +bool sbp_msg_set_time_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_set_time_t *msg) { + (void)ctx; (void)msg; return true; } -s8 sbp_msg_set_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_set_time_t *msg) { +s8 sbp_msg_set_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_set_time_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -118,30 +125,36 @@ s8 sbp_msg_set_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp return SBP_OK; } - -s8 sbp_msg_set_time_send(sbp_state_t *s, u16 sender_id, const sbp_msg_set_time_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_set_time_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_set_time_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_set_time_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SET_TIME, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SET_TIME, sender_id, payload_len, payload, + write); } -int sbp_msg_set_time_cmp(const sbp_msg_set_time_t *a, const sbp_msg_set_time_t *b) { +int sbp_msg_set_time_cmp(const sbp_msg_set_time_t *a, + const sbp_msg_set_time_t *b) { (void)a; (void)b; int ret = 0; return ret; } -bool sbp_msg_reset_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_reset_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_reset_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_reset_t *msg) { + if (!sbp_u32_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_reset_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_reset_t *msg) { +s8 sbp_msg_reset_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_reset_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -155,13 +168,16 @@ s8 sbp_msg_reset_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp return SBP_OK; } -bool sbp_msg_reset_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_reset_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_reset_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_reset_t *msg) { + if (!sbp_u32_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_reset_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_reset_t *msg) { +s8 sbp_msg_reset_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_reset_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -175,32 +191,37 @@ s8 sbp_msg_reset_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ms return SBP_OK; } - -s8 sbp_msg_reset_send(sbp_state_t *s, u16 sender_id, const sbp_msg_reset_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_reset_send(sbp_state_t *s, u16 sender_id, const sbp_msg_reset_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_reset_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_RESET, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_RESET, sender_id, payload_len, payload, + write); } int sbp_msg_reset_cmp(const sbp_msg_reset_t *a, const sbp_msg_reset_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_reset_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_reset_dep_t *msg) -{ +bool sbp_msg_reset_dep_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_reset_dep_t *msg) { (void)ctx; (void)msg; return true; } -s8 sbp_msg_reset_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_reset_dep_t *msg) { +s8 sbp_msg_reset_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_reset_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -214,14 +235,15 @@ s8 sbp_msg_reset_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_reset_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_reset_dep_t *msg) -{ - (void)ctx; +bool sbp_msg_reset_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_reset_dep_t *msg) { + (void)ctx; (void)msg; return true; } -s8 sbp_msg_reset_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_reset_dep_t *msg) { +s8 sbp_msg_reset_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_reset_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -235,31 +257,37 @@ s8 sbp_msg_reset_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - -s8 sbp_msg_reset_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_reset_dep_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_reset_dep_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_reset_dep_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_reset_dep_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_RESET_DEP, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_reset_dep_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_RESET_DEP, sender_id, payload_len, payload, + write); } -int sbp_msg_reset_dep_cmp(const sbp_msg_reset_dep_t *a, const sbp_msg_reset_dep_t *b) { +int sbp_msg_reset_dep_cmp(const sbp_msg_reset_dep_t *a, + const sbp_msg_reset_dep_t *b) { (void)a; (void)b; int ret = 0; return ret; } -bool sbp_msg_cw_results_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_cw_results_t *msg) -{ +bool sbp_msg_cw_results_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_cw_results_t *msg) { (void)ctx; (void)msg; return true; } -s8 sbp_msg_cw_results_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_cw_results_t *msg) { +s8 sbp_msg_cw_results_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_cw_results_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -273,14 +301,15 @@ s8 sbp_msg_cw_results_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, cons return SBP_OK; } -bool sbp_msg_cw_results_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_cw_results_t *msg) -{ - (void)ctx; +bool sbp_msg_cw_results_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_cw_results_t *msg) { + (void)ctx; (void)msg; return true; } -s8 sbp_msg_cw_results_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_cw_results_t *msg) { +s8 sbp_msg_cw_results_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_cw_results_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -294,31 +323,37 @@ s8 sbp_msg_cw_results_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, s return SBP_OK; } - -s8 sbp_msg_cw_results_send(sbp_state_t *s, u16 sender_id, const sbp_msg_cw_results_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_cw_results_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_cw_results_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_cw_results_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_CW_RESULTS, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_cw_results_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_CW_RESULTS, sender_id, payload_len, + payload, write); } -int sbp_msg_cw_results_cmp(const sbp_msg_cw_results_t *a, const sbp_msg_cw_results_t *b) { +int sbp_msg_cw_results_cmp(const sbp_msg_cw_results_t *a, + const sbp_msg_cw_results_t *b) { (void)a; (void)b; int ret = 0; return ret; } -bool sbp_msg_cw_start_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_cw_start_t *msg) -{ +bool sbp_msg_cw_start_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_cw_start_t *msg) { (void)ctx; (void)msg; return true; } -s8 sbp_msg_cw_start_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_cw_start_t *msg) { +s8 sbp_msg_cw_start_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_cw_start_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -332,14 +367,15 @@ s8 sbp_msg_cw_start_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_cw_start_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_cw_start_t *msg) -{ - (void)ctx; +bool sbp_msg_cw_start_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_cw_start_t *msg) { + (void)ctx; (void)msg; return true; } -s8 sbp_msg_cw_start_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_cw_start_t *msg) { +s8 sbp_msg_cw_start_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_cw_start_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -353,30 +389,36 @@ s8 sbp_msg_cw_start_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp return SBP_OK; } - -s8 sbp_msg_cw_start_send(sbp_state_t *s, u16 sender_id, const sbp_msg_cw_start_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_cw_start_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_cw_start_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_cw_start_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_CW_START, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_CW_START, sender_id, payload_len, payload, + write); } -int sbp_msg_cw_start_cmp(const sbp_msg_cw_start_t *a, const sbp_msg_cw_start_t *b) { +int sbp_msg_cw_start_cmp(const sbp_msg_cw_start_t *a, + const sbp_msg_cw_start_t *b) { (void)a; (void)b; int ret = 0; return ret; } -bool sbp_msg_reset_filters_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_reset_filters_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->filter)) { return false; } +bool sbp_msg_reset_filters_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_reset_filters_t *msg) { + if (!sbp_u8_encode(ctx, &msg->filter)) { + return false; + } return true; } -s8 sbp_msg_reset_filters_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_reset_filters_t *msg) { +s8 sbp_msg_reset_filters_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_reset_filters_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -390,13 +432,16 @@ s8 sbp_msg_reset_filters_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_reset_filters_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_reset_filters_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->filter)) { return false; } +bool sbp_msg_reset_filters_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_reset_filters_t *msg) { + if (!sbp_u8_decode(ctx, &msg->filter)) { + return false; + } return true; } -s8 sbp_msg_reset_filters_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_reset_filters_t *msg) { +s8 sbp_msg_reset_filters_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_reset_filters_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -410,32 +455,40 @@ s8 sbp_msg_reset_filters_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_reset_filters_send(sbp_state_t *s, u16 sender_id, const sbp_msg_reset_filters_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_reset_filters_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_reset_filters_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_reset_filters_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_RESET_FILTERS, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_reset_filters_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_RESET_FILTERS, sender_id, payload_len, + payload, write); } -int sbp_msg_reset_filters_cmp(const sbp_msg_reset_filters_t *a, const sbp_msg_reset_filters_t *b) { +int sbp_msg_reset_filters_cmp(const sbp_msg_reset_filters_t *a, + const sbp_msg_reset_filters_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->filter, &b->filter); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_init_base_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_init_base_dep_t *msg) -{ +bool sbp_msg_init_base_dep_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_init_base_dep_t *msg) { (void)ctx; (void)msg; return true; } -s8 sbp_msg_init_base_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_init_base_dep_t *msg) { +s8 sbp_msg_init_base_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_init_base_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -449,14 +502,15 @@ s8 sbp_msg_init_base_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_init_base_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_init_base_dep_t *msg) -{ - (void)ctx; +bool sbp_msg_init_base_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_init_base_dep_t *msg) { + (void)ctx; (void)msg; return true; } -s8 sbp_msg_init_base_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_init_base_dep_t *msg) { +s8 sbp_msg_init_base_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_init_base_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -470,35 +524,46 @@ s8 sbp_msg_init_base_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_init_base_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_init_base_dep_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_init_base_dep_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_init_base_dep_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_init_base_dep_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_INIT_BASE_DEP, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_init_base_dep_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_INIT_BASE_DEP, sender_id, payload_len, + payload, write); } -int sbp_msg_init_base_dep_cmp(const sbp_msg_init_base_dep_t *a, const sbp_msg_init_base_dep_t *b) { +int sbp_msg_init_base_dep_cmp(const sbp_msg_init_base_dep_t *a, + const sbp_msg_init_base_dep_t *b) { (void)a; (void)b; int ret = 0; return ret; } -bool sbp_msg_thread_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_thread_state_t *msg) -{ - for (size_t i = 0; i < SBP_MSG_THREAD_STATE_NAME_MAX; i++) - { - if (!sbp_char_encode(ctx, &msg->name[i])) { return false; } +bool sbp_msg_thread_state_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_thread_state_t *msg) { + for (size_t i = 0; i < SBP_MSG_THREAD_STATE_NAME_MAX; i++) { + if (!sbp_char_encode(ctx, &msg->name[i])) { + return false; + } + } + if (!sbp_u16_encode(ctx, &msg->cpu)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->stack_free)) { + return false; } - if (!sbp_u16_encode(ctx, &msg->cpu)) { return false; } - if (!sbp_u32_encode(ctx, &msg->stack_free)) { return false; } return true; } -s8 sbp_msg_thread_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_thread_state_t *msg) { +s8 sbp_msg_thread_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_thread_state_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -512,17 +577,24 @@ s8 sbp_msg_thread_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, co return SBP_OK; } -bool sbp_msg_thread_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_thread_state_t *msg) -{ +bool sbp_msg_thread_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_thread_state_t *msg) { for (uint8_t i = 0; i < SBP_MSG_THREAD_STATE_NAME_MAX; i++) { - if (!sbp_char_decode(ctx, &msg->name[i])) { return false; } + if (!sbp_char_decode(ctx, &msg->name[i])) { + return false; + } + } + if (!sbp_u16_decode(ctx, &msg->cpu)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->stack_free)) { + return false; } - if (!sbp_u16_decode(ctx, &msg->cpu)) { return false; } - if (!sbp_u32_decode(ctx, &msg->stack_free)) { return false; } return true; } -s8 sbp_msg_thread_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_thread_state_t *msg) { +s8 sbp_msg_thread_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_thread_state_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -536,45 +608,68 @@ s8 sbp_msg_thread_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_thread_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_thread_state_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_thread_state_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_thread_state_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_thread_state_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_THREAD_STATE, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_thread_state_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_THREAD_STATE, sender_id, payload_len, + payload, write); } -int sbp_msg_thread_state_cmp(const sbp_msg_thread_state_t *a, const sbp_msg_thread_state_t *b) { +int sbp_msg_thread_state_cmp(const sbp_msg_thread_state_t *a, + const sbp_msg_thread_state_t *b) { int ret = 0; - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_THREAD_STATE_NAME_MAX; i++) - { + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_THREAD_STATE_NAME_MAX; i++) { ret = sbp_char_cmp(&a->name[i], &b->name[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->cpu, &b->cpu); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->stack_free, &b->stack_free); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_uart_channel_encode_internal(sbp_encode_ctx_t *ctx, const sbp_uart_channel_t *msg) -{ - if (!sbp_float_encode(ctx, &msg->tx_throughput)) { return false; } - if (!sbp_float_encode(ctx, &msg->rx_throughput)) { return false; } - if (!sbp_u16_encode(ctx, &msg->crc_error_count)) { return false; } - if (!sbp_u16_encode(ctx, &msg->io_error_count)) { return false; } - if (!sbp_u8_encode(ctx, &msg->tx_buffer_level)) { return false; } - if (!sbp_u8_encode(ctx, &msg->rx_buffer_level)) { return false; } +bool sbp_uart_channel_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_uart_channel_t *msg) { + if (!sbp_float_encode(ctx, &msg->tx_throughput)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->rx_throughput)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->crc_error_count)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->io_error_count)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->tx_buffer_level)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->rx_buffer_level)) { + return false; + } return true; } -s8 sbp_uart_channel_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_uart_channel_t *msg) { +s8 sbp_uart_channel_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_uart_channel_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -588,18 +683,31 @@ s8 sbp_uart_channel_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_uart_channel_decode_internal(sbp_decode_ctx_t *ctx, sbp_uart_channel_t *msg) -{ - if (!sbp_float_decode(ctx, &msg->tx_throughput)) { return false; } - if (!sbp_float_decode(ctx, &msg->rx_throughput)) { return false; } - if (!sbp_u16_decode(ctx, &msg->crc_error_count)) { return false; } - if (!sbp_u16_decode(ctx, &msg->io_error_count)) { return false; } - if (!sbp_u8_decode(ctx, &msg->tx_buffer_level)) { return false; } - if (!sbp_u8_decode(ctx, &msg->rx_buffer_level)) { return false; } +bool sbp_uart_channel_decode_internal(sbp_decode_ctx_t *ctx, + sbp_uart_channel_t *msg) { + if (!sbp_float_decode(ctx, &msg->tx_throughput)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->rx_throughput)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->crc_error_count)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->io_error_count)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->tx_buffer_level)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->rx_buffer_level)) { + return false; + } return true; } -s8 sbp_uart_channel_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_uart_channel_t *msg) { +s8 sbp_uart_channel_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_uart_channel_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -613,41 +721,61 @@ s8 sbp_uart_channel_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp return SBP_OK; } - - -int sbp_uart_channel_cmp(const sbp_uart_channel_t *a, const sbp_uart_channel_t *b) { +int sbp_uart_channel_cmp(const sbp_uart_channel_t *a, + const sbp_uart_channel_t *b) { int ret = 0; - + ret = sbp_float_cmp(&a->tx_throughput, &b->tx_throughput); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->rx_throughput, &b->rx_throughput); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->crc_error_count, &b->crc_error_count); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->io_error_count, &b->io_error_count); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->tx_buffer_level, &b->tx_buffer_level); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->rx_buffer_level, &b->rx_buffer_level); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_period_encode_internal(sbp_encode_ctx_t *ctx, const sbp_period_t *msg) -{ - if (!sbp_s32_encode(ctx, &msg->avg)) { return false; } - if (!sbp_s32_encode(ctx, &msg->pmin)) { return false; } - if (!sbp_s32_encode(ctx, &msg->pmax)) { return false; } - if (!sbp_s32_encode(ctx, &msg->current)) { return false; } +bool sbp_period_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_period_t *msg) { + if (!sbp_s32_encode(ctx, &msg->avg)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->pmin)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->pmax)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->current)) { + return false; + } return true; } -s8 sbp_period_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_period_t *msg) { +s8 sbp_period_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_period_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -661,16 +789,24 @@ s8 sbp_period_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_pe return SBP_OK; } -bool sbp_period_decode_internal(sbp_decode_ctx_t *ctx, sbp_period_t *msg) -{ - if (!sbp_s32_decode(ctx, &msg->avg)) { return false; } - if (!sbp_s32_decode(ctx, &msg->pmin)) { return false; } - if (!sbp_s32_decode(ctx, &msg->pmax)) { return false; } - if (!sbp_s32_decode(ctx, &msg->current)) { return false; } +bool sbp_period_decode_internal(sbp_decode_ctx_t *ctx, sbp_period_t *msg) { + if (!sbp_s32_decode(ctx, &msg->avg)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->pmin)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->pmax)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->current)) { + return false; + } return true; } -s8 sbp_period_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_period_t *msg) { +s8 sbp_period_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_period_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -684,35 +820,50 @@ s8 sbp_period_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_perio return SBP_OK; } - - int sbp_period_cmp(const sbp_period_t *a, const sbp_period_t *b) { int ret = 0; - + ret = sbp_s32_cmp(&a->avg, &b->avg); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->pmin, &b->pmin); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->pmax, &b->pmax); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->current, &b->current); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_latency_encode_internal(sbp_encode_ctx_t *ctx, const sbp_latency_t *msg) -{ - if (!sbp_s32_encode(ctx, &msg->avg)) { return false; } - if (!sbp_s32_encode(ctx, &msg->lmin)) { return false; } - if (!sbp_s32_encode(ctx, &msg->lmax)) { return false; } - if (!sbp_s32_encode(ctx, &msg->current)) { return false; } +bool sbp_latency_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_latency_t *msg) { + if (!sbp_s32_encode(ctx, &msg->avg)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->lmin)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->lmax)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->current)) { + return false; + } return true; } -s8 sbp_latency_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_latency_t *msg) { +s8 sbp_latency_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_latency_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -726,16 +877,24 @@ s8 sbp_latency_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_l return SBP_OK; } -bool sbp_latency_decode_internal(sbp_decode_ctx_t *ctx, sbp_latency_t *msg) -{ - if (!sbp_s32_decode(ctx, &msg->avg)) { return false; } - if (!sbp_s32_decode(ctx, &msg->lmin)) { return false; } - if (!sbp_s32_decode(ctx, &msg->lmax)) { return false; } - if (!sbp_s32_decode(ctx, &msg->current)) { return false; } +bool sbp_latency_decode_internal(sbp_decode_ctx_t *ctx, sbp_latency_t *msg) { + if (!sbp_s32_decode(ctx, &msg->avg)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->lmin)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->lmax)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->current)) { + return false; + } return true; } -s8 sbp_latency_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_latency_t *msg) { +s8 sbp_latency_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_latency_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -749,36 +908,53 @@ s8 sbp_latency_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_late return SBP_OK; } - - int sbp_latency_cmp(const sbp_latency_t *a, const sbp_latency_t *b) { int ret = 0; - + ret = sbp_s32_cmp(&a->avg, &b->avg); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->lmin, &b->lmin); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->lmax, &b->lmax); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->current, &b->current); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_uart_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_uart_state_t *msg) -{ - if (!sbp_uart_channel_encode_internal(ctx, &msg->uart_a)) { return false; } - if (!sbp_uart_channel_encode_internal(ctx, &msg->uart_b)) { return false; } - if (!sbp_uart_channel_encode_internal(ctx, &msg->uart_ftdi)) { return false; } - if (!sbp_latency_encode_internal(ctx, &msg->latency)) { return false; } - if (!sbp_period_encode_internal(ctx, &msg->obs_period)) { return false; } +bool sbp_msg_uart_state_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_uart_state_t *msg) { + if (!sbp_uart_channel_encode_internal(ctx, &msg->uart_a)) { + return false; + } + if (!sbp_uart_channel_encode_internal(ctx, &msg->uart_b)) { + return false; + } + if (!sbp_uart_channel_encode_internal(ctx, &msg->uart_ftdi)) { + return false; + } + if (!sbp_latency_encode_internal(ctx, &msg->latency)) { + return false; + } + if (!sbp_period_encode_internal(ctx, &msg->obs_period)) { + return false; + } return true; } -s8 sbp_msg_uart_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_uart_state_t *msg) { +s8 sbp_msg_uart_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_uart_state_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -792,17 +968,28 @@ s8 sbp_msg_uart_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, cons return SBP_OK; } -bool sbp_msg_uart_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_uart_state_t *msg) -{ - if (!sbp_uart_channel_decode_internal(ctx, &msg->uart_a)) { return false; } - if (!sbp_uart_channel_decode_internal(ctx, &msg->uart_b)) { return false; } - if (!sbp_uart_channel_decode_internal(ctx, &msg->uart_ftdi)) { return false; } - if (!sbp_latency_decode_internal(ctx, &msg->latency)) { return false; } - if (!sbp_period_decode_internal(ctx, &msg->obs_period)) { return false; } +bool sbp_msg_uart_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_uart_state_t *msg) { + if (!sbp_uart_channel_decode_internal(ctx, &msg->uart_a)) { + return false; + } + if (!sbp_uart_channel_decode_internal(ctx, &msg->uart_b)) { + return false; + } + if (!sbp_uart_channel_decode_internal(ctx, &msg->uart_ftdi)) { + return false; + } + if (!sbp_latency_decode_internal(ctx, &msg->latency)) { + return false; + } + if (!sbp_period_decode_internal(ctx, &msg->obs_period)) { + return false; + } return true; } -s8 sbp_msg_uart_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_uart_state_t *msg) { +s8 sbp_msg_uart_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_uart_state_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -816,46 +1003,70 @@ s8 sbp_msg_uart_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, s return SBP_OK; } - -s8 sbp_msg_uart_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_uart_state_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_uart_state_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_uart_state_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_uart_state_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_UART_STATE, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_uart_state_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_UART_STATE, sender_id, payload_len, + payload, write); } -int sbp_msg_uart_state_cmp(const sbp_msg_uart_state_t *a, const sbp_msg_uart_state_t *b) { +int sbp_msg_uart_state_cmp(const sbp_msg_uart_state_t *a, + const sbp_msg_uart_state_t *b) { int ret = 0; - + ret = sbp_uart_channel_cmp(&a->uart_a, &b->uart_a); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_uart_channel_cmp(&a->uart_b, &b->uart_b); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_uart_channel_cmp(&a->uart_ftdi, &b->uart_ftdi); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_latency_cmp(&a->latency, &b->latency); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_period_cmp(&a->obs_period, &b->obs_period); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_uart_state_depa_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_uart_state_depa_t *msg) -{ - if (!sbp_uart_channel_encode_internal(ctx, &msg->uart_a)) { return false; } - if (!sbp_uart_channel_encode_internal(ctx, &msg->uart_b)) { return false; } - if (!sbp_uart_channel_encode_internal(ctx, &msg->uart_ftdi)) { return false; } - if (!sbp_latency_encode_internal(ctx, &msg->latency)) { return false; } +bool sbp_msg_uart_state_depa_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_uart_state_depa_t *msg) { + if (!sbp_uart_channel_encode_internal(ctx, &msg->uart_a)) { + return false; + } + if (!sbp_uart_channel_encode_internal(ctx, &msg->uart_b)) { + return false; + } + if (!sbp_uart_channel_encode_internal(ctx, &msg->uart_ftdi)) { + return false; + } + if (!sbp_latency_encode_internal(ctx, &msg->latency)) { + return false; + } return true; } -s8 sbp_msg_uart_state_depa_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_uart_state_depa_t *msg) { +s8 sbp_msg_uart_state_depa_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_uart_state_depa_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -869,16 +1080,26 @@ s8 sbp_msg_uart_state_depa_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_uart_state_depa_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_uart_state_depa_t *msg) -{ - if (!sbp_uart_channel_decode_internal(ctx, &msg->uart_a)) { return false; } - if (!sbp_uart_channel_decode_internal(ctx, &msg->uart_b)) { return false; } - if (!sbp_uart_channel_decode_internal(ctx, &msg->uart_ftdi)) { return false; } - if (!sbp_latency_decode_internal(ctx, &msg->latency)) { return false; } +bool sbp_msg_uart_state_depa_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_uart_state_depa_t *msg) { + if (!sbp_uart_channel_decode_internal(ctx, &msg->uart_a)) { + return false; + } + if (!sbp_uart_channel_decode_internal(ctx, &msg->uart_b)) { + return false; + } + if (!sbp_uart_channel_decode_internal(ctx, &msg->uart_ftdi)) { + return false; + } + if (!sbp_latency_decode_internal(ctx, &msg->latency)) { + return false; + } return true; } -s8 sbp_msg_uart_state_depa_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_uart_state_depa_t *msg) { +s8 sbp_msg_uart_state_depa_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_uart_state_depa_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -892,40 +1113,56 @@ s8 sbp_msg_uart_state_depa_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_uart_state_depa_send(sbp_state_t *s, u16 sender_id, const sbp_msg_uart_state_depa_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_uart_state_depa_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_uart_state_depa_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_uart_state_depa_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_UART_STATE_DEPA, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_uart_state_depa_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_UART_STATE_DEPA, sender_id, payload_len, + payload, write); } -int sbp_msg_uart_state_depa_cmp(const sbp_msg_uart_state_depa_t *a, const sbp_msg_uart_state_depa_t *b) { +int sbp_msg_uart_state_depa_cmp(const sbp_msg_uart_state_depa_t *a, + const sbp_msg_uart_state_depa_t *b) { int ret = 0; - + ret = sbp_uart_channel_cmp(&a->uart_a, &b->uart_a); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_uart_channel_cmp(&a->uart_b, &b->uart_b); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_uart_channel_cmp(&a->uart_ftdi, &b->uart_ftdi); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_latency_cmp(&a->latency, &b->latency); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_iar_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_iar_state_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->num_hyps)) { return false; } +bool sbp_msg_iar_state_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_iar_state_t *msg) { + if (!sbp_u32_encode(ctx, &msg->num_hyps)) { + return false; + } return true; } -s8 sbp_msg_iar_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_iar_state_t *msg) { +s8 sbp_msg_iar_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_iar_state_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -939,13 +1176,16 @@ s8 sbp_msg_iar_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_iar_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_iar_state_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->num_hyps)) { return false; } +bool sbp_msg_iar_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_iar_state_t *msg) { + if (!sbp_u32_decode(ctx, &msg->num_hyps)) { + return false; + } return true; } -s8 sbp_msg_iar_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_iar_state_t *msg) { +s8 sbp_msg_iar_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_iar_state_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -959,32 +1199,44 @@ s8 sbp_msg_iar_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - -s8 sbp_msg_iar_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_iar_state_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_iar_state_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_iar_state_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_iar_state_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_IAR_STATE, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_iar_state_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_IAR_STATE, sender_id, payload_len, payload, + write); } -int sbp_msg_iar_state_cmp(const sbp_msg_iar_state_t *a, const sbp_msg_iar_state_t *b) { +int sbp_msg_iar_state_cmp(const sbp_msg_iar_state_t *a, + const sbp_msg_iar_state_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->num_hyps, &b->num_hyps); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_mask_satellite_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_mask_satellite_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->mask)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } +bool sbp_msg_mask_satellite_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_mask_satellite_t *msg) { + if (!sbp_u8_encode(ctx, &msg->mask)) { + return false; + } + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_msg_mask_satellite_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_mask_satellite_t *msg) { +s8 sbp_msg_mask_satellite_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_mask_satellite_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -998,14 +1250,20 @@ s8 sbp_msg_mask_satellite_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_mask_satellite_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_mask_satellite_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->mask)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } +bool sbp_msg_mask_satellite_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_mask_satellite_t *msg) { + if (!sbp_u8_decode(ctx, &msg->mask)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_msg_mask_satellite_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_mask_satellite_t *msg) { +s8 sbp_msg_mask_satellite_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_mask_satellite_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1019,35 +1277,50 @@ s8 sbp_msg_mask_satellite_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - -s8 sbp_msg_mask_satellite_send(sbp_state_t *s, u16 sender_id, const sbp_msg_mask_satellite_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_mask_satellite_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_mask_satellite_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_mask_satellite_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_MASK_SATELLITE, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_mask_satellite_encode(payload, sizeof(payload), &payload_len, + msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_MASK_SATELLITE, sender_id, payload_len, + payload, write); } -int sbp_msg_mask_satellite_cmp(const sbp_msg_mask_satellite_t *a, const sbp_msg_mask_satellite_t *b) { +int sbp_msg_mask_satellite_cmp(const sbp_msg_mask_satellite_t *a, + const sbp_msg_mask_satellite_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->mask, &b->mask); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_mask_satellite_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_mask_satellite_dep_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->mask)) { return false; } - if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { return false; } +bool sbp_msg_mask_satellite_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_mask_satellite_dep_t *msg) { + if (!sbp_u8_encode(ctx, &msg->mask)) { + return false; + } + if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_msg_mask_satellite_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_mask_satellite_dep_t *msg) { +s8 sbp_msg_mask_satellite_dep_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_mask_satellite_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1061,14 +1334,20 @@ s8 sbp_msg_mask_satellite_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_writt return SBP_OK; } -bool sbp_msg_mask_satellite_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_mask_satellite_dep_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->mask)) { return false; } - if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { return false; } +bool sbp_msg_mask_satellite_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_mask_satellite_dep_t *msg) { + if (!sbp_u8_decode(ctx, &msg->mask)) { + return false; + } + if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_msg_mask_satellite_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_mask_satellite_dep_t *msg) { +s8 sbp_msg_mask_satellite_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_mask_satellite_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1082,38 +1361,58 @@ s8 sbp_msg_mask_satellite_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } - -s8 sbp_msg_mask_satellite_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_mask_satellite_dep_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_mask_satellite_dep_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_mask_satellite_dep_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_mask_satellite_dep_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_MASK_SATELLITE_DEP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_mask_satellite_dep_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_MASK_SATELLITE_DEP, sender_id, payload_len, + payload, write); } -int sbp_msg_mask_satellite_dep_cmp(const sbp_msg_mask_satellite_dep_t *a, const sbp_msg_mask_satellite_dep_t *b) { +int sbp_msg_mask_satellite_dep_cmp(const sbp_msg_mask_satellite_dep_t *a, + const sbp_msg_mask_satellite_dep_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->mask, &b->mask); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_device_monitor_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_device_monitor_t *msg) -{ - if (!sbp_s16_encode(ctx, &msg->dev_vin)) { return false; } - if (!sbp_s16_encode(ctx, &msg->cpu_vint)) { return false; } - if (!sbp_s16_encode(ctx, &msg->cpu_vaux)) { return false; } - if (!sbp_s16_encode(ctx, &msg->cpu_temperature)) { return false; } - if (!sbp_s16_encode(ctx, &msg->fe_temperature)) { return false; } +bool sbp_msg_device_monitor_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_device_monitor_t *msg) { + if (!sbp_s16_encode(ctx, &msg->dev_vin)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->cpu_vint)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->cpu_vaux)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->cpu_temperature)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->fe_temperature)) { + return false; + } return true; } -s8 sbp_msg_device_monitor_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_device_monitor_t *msg) { +s8 sbp_msg_device_monitor_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_device_monitor_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1127,17 +1426,29 @@ s8 sbp_msg_device_monitor_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_device_monitor_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_device_monitor_t *msg) -{ - if (!sbp_s16_decode(ctx, &msg->dev_vin)) { return false; } - if (!sbp_s16_decode(ctx, &msg->cpu_vint)) { return false; } - if (!sbp_s16_decode(ctx, &msg->cpu_vaux)) { return false; } - if (!sbp_s16_decode(ctx, &msg->cpu_temperature)) { return false; } - if (!sbp_s16_decode(ctx, &msg->fe_temperature)) { return false; } +bool sbp_msg_device_monitor_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_device_monitor_t *msg) { + if (!sbp_s16_decode(ctx, &msg->dev_vin)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->cpu_vint)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->cpu_vaux)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->cpu_temperature)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->fe_temperature)) { + return false; + } return true; } -s8 sbp_msg_device_monitor_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_device_monitor_t *msg) { +s8 sbp_msg_device_monitor_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_device_monitor_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1151,117 +1462,160 @@ s8 sbp_msg_device_monitor_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - -s8 sbp_msg_device_monitor_send(sbp_state_t *s, u16 sender_id, const sbp_msg_device_monitor_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_device_monitor_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_device_monitor_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_device_monitor_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_DEVICE_MONITOR, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_device_monitor_encode(payload, sizeof(payload), &payload_len, + msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_DEVICE_MONITOR, sender_id, payload_len, + payload, write); } -int sbp_msg_device_monitor_cmp(const sbp_msg_device_monitor_t *a, const sbp_msg_device_monitor_t *b) { +int sbp_msg_device_monitor_cmp(const sbp_msg_device_monitor_t *a, + const sbp_msg_device_monitor_t *b) { int ret = 0; - + ret = sbp_s16_cmp(&a->dev_vin, &b->dev_vin); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->cpu_vint, &b->cpu_vint); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->cpu_vaux, &b->cpu_vaux); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->cpu_temperature, &b->cpu_temperature); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->fe_temperature, &b->fe_temperature); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_command_req_command_init(sbp_msg_command_req_t *msg) -{ +void sbp_msg_command_req_command_init(sbp_msg_command_req_t *msg) { sbp_null_terminated_string_init(&msg->command); } -bool sbp_msg_command_req_command_valid(const sbp_msg_command_req_t *msg) -{ - return sbp_null_terminated_string_valid(&msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX); +bool sbp_msg_command_req_command_valid(const sbp_msg_command_req_t *msg) { + return sbp_null_terminated_string_valid(&msg->command, + SBP_MSG_COMMAND_REQ_COMMAND_MAX); } -int sbp_msg_command_req_command_strcmp(const sbp_msg_command_req_t *a, const sbp_msg_command_req_t *b) -{ - return sbp_null_terminated_string_strcmp(&a->command, &b->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX); +int sbp_msg_command_req_command_strcmp(const sbp_msg_command_req_t *a, + const sbp_msg_command_req_t *b) { + return sbp_null_terminated_string_strcmp(&a->command, &b->command, + SBP_MSG_COMMAND_REQ_COMMAND_MAX); } -size_t sbp_msg_command_req_command_encoded_len(const sbp_msg_command_req_t *msg) -{ - return sbp_null_terminated_string_encoded_len(&msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX); +size_t sbp_msg_command_req_command_encoded_len( + const sbp_msg_command_req_t *msg) { + return sbp_null_terminated_string_encoded_len( + &msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX); } -size_t sbp_msg_command_req_command_space_remaining(const sbp_msg_command_req_t *msg) -{ - return sbp_null_terminated_string_space_remaining(&msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX); +size_t sbp_msg_command_req_command_space_remaining( + const sbp_msg_command_req_t *msg) { + return sbp_null_terminated_string_space_remaining( + &msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX); } - bool sbp_msg_command_req_command_set(sbp_msg_command_req_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_null_terminated_string_set(&msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX, should_trunc, n_written, new_str); +bool sbp_msg_command_req_command_set(sbp_msg_command_req_t *msg, + const char *new_str, bool should_trunc, + size_t *n_written) { + return sbp_null_terminated_string_set(&msg->command, + SBP_MSG_COMMAND_REQ_COMMAND_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_command_req_command_set_raw(sbp_msg_command_req_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_null_terminated_string_set_raw(&msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_command_req_command_set_raw(sbp_msg_command_req_t *msg, + const char *new_buf, + size_t new_buf_len, bool should_trunc, + size_t *n_written) { + return sbp_null_terminated_string_set_raw( + &msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX, should_trunc, n_written, + new_buf, new_buf_len); } - -bool sbp_msg_command_req_command_printf(sbp_msg_command_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_command_req_command_printf(sbp_msg_command_req_t *msg, + bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_null_terminated_string_vprintf(&msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_null_terminated_string_vprintf( + &msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX, should_trunc, n_written, + fmt, ap); va_end(ap); return ret; } - bool sbp_msg_command_req_command_vprintf(sbp_msg_command_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_null_terminated_string_vprintf(&msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_command_req_command_vprintf(sbp_msg_command_req_t *msg, + bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_null_terminated_string_vprintf(&msg->command, + SBP_MSG_COMMAND_REQ_COMMAND_MAX, + should_trunc, n_written, fmt, ap); } -bool sbp_msg_command_req_command_append_printf(sbp_msg_command_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_command_req_command_append_printf(sbp_msg_command_req_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_null_terminated_string_append_vprintf(&msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_null_terminated_string_append_vprintf( + &msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX, should_trunc, n_written, + fmt, ap); va_end(ap); return ret; } - bool sbp_msg_command_req_command_append_vprintf(sbp_msg_command_req_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_null_terminated_string_append_vprintf(&msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_command_req_command_append_vprintf(sbp_msg_command_req_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, va_list ap) { + return sbp_null_terminated_string_append_vprintf( + &msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX, should_trunc, n_written, + fmt, ap); } -const char *sbp_msg_command_req_command_get(const sbp_msg_command_req_t *msg) -{ - return sbp_null_terminated_string_get(&msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX); +const char *sbp_msg_command_req_command_get(const sbp_msg_command_req_t *msg) { + return sbp_null_terminated_string_get(&msg->command, + SBP_MSG_COMMAND_REQ_COMMAND_MAX); } -size_t sbp_msg_command_req_command_strlen(const sbp_msg_command_req_t *msg) -{ - return sbp_null_terminated_string_strlen(&msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX); +size_t sbp_msg_command_req_command_strlen(const sbp_msg_command_req_t *msg) { + return sbp_null_terminated_string_strlen(&msg->command, + SBP_MSG_COMMAND_REQ_COMMAND_MAX); } -bool sbp_msg_command_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_command_req_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->sequence)) { return false; } - if (!sbp_null_terminated_string_encode(&msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX, ctx)) { return false; } +bool sbp_msg_command_req_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_command_req_t *msg) { + if (!sbp_u32_encode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_null_terminated_string_encode( + &msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_command_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_command_req_t *msg) { +s8 sbp_msg_command_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_command_req_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1275,14 +1629,20 @@ s8 sbp_msg_command_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, con return SBP_OK; } -bool sbp_msg_command_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_command_req_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->sequence)) { return false; } - if (!sbp_null_terminated_string_decode(&msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX, ctx)) { return false; } +bool sbp_msg_command_req_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_command_req_t *msg) { + if (!sbp_u32_decode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_null_terminated_string_decode( + &msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_command_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_command_req_t *msg) { +s8 sbp_msg_command_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_command_req_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1296,35 +1656,49 @@ s8 sbp_msg_command_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_command_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_command_req_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_command_req_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_command_req_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_command_req_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_COMMAND_REQ, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_command_req_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_COMMAND_REQ, sender_id, payload_len, + payload, write); } -int sbp_msg_command_req_cmp(const sbp_msg_command_req_t *a, const sbp_msg_command_req_t *b) { +int sbp_msg_command_req_cmp(const sbp_msg_command_req_t *a, + const sbp_msg_command_req_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->sequence, &b->sequence); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_command_req_command_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_command_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_command_resp_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->sequence)) { return false; } - if (!sbp_s32_encode(ctx, &msg->code)) { return false; } +bool sbp_msg_command_resp_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_command_resp_t *msg) { + if (!sbp_u32_encode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->code)) { + return false; + } return true; } -s8 sbp_msg_command_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_command_resp_t *msg) { +s8 sbp_msg_command_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_command_resp_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1338,14 +1712,19 @@ s8 sbp_msg_command_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, co return SBP_OK; } -bool sbp_msg_command_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_command_resp_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->sequence)) { return false; } - if (!sbp_s32_decode(ctx, &msg->code)) { return false; } +bool sbp_msg_command_resp_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_command_resp_t *msg) { + if (!sbp_u32_decode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->code)) { + return false; + } return true; } -s8 sbp_msg_command_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_command_resp_t *msg) { +s8 sbp_msg_command_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_command_resp_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1359,108 +1738,146 @@ s8 sbp_msg_command_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_command_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_command_resp_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_command_resp_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_command_resp_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_command_resp_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_COMMAND_RESP, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_command_resp_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_COMMAND_RESP, sender_id, payload_len, + payload, write); } -int sbp_msg_command_resp_cmp(const sbp_msg_command_resp_t *a, const sbp_msg_command_resp_t *b) { +int sbp_msg_command_resp_cmp(const sbp_msg_command_resp_t *a, + const sbp_msg_command_resp_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->sequence, &b->sequence); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->code, &b->code); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_command_output_line_init(sbp_msg_command_output_t *msg) -{ +void sbp_msg_command_output_line_init(sbp_msg_command_output_t *msg) { sbp_unterminated_string_init(&msg->line); } -bool sbp_msg_command_output_line_valid(const sbp_msg_command_output_t *msg) -{ - return sbp_unterminated_string_valid(&msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX); +bool sbp_msg_command_output_line_valid(const sbp_msg_command_output_t *msg) { + return sbp_unterminated_string_valid(&msg->line, + SBP_MSG_COMMAND_OUTPUT_LINE_MAX); } -int sbp_msg_command_output_line_strcmp(const sbp_msg_command_output_t *a, const sbp_msg_command_output_t *b) -{ - return sbp_unterminated_string_strcmp(&a->line, &b->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX); +int sbp_msg_command_output_line_strcmp(const sbp_msg_command_output_t *a, + const sbp_msg_command_output_t *b) { + return sbp_unterminated_string_strcmp(&a->line, &b->line, + SBP_MSG_COMMAND_OUTPUT_LINE_MAX); } -size_t sbp_msg_command_output_line_encoded_len(const sbp_msg_command_output_t *msg) -{ - return sbp_unterminated_string_encoded_len(&msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX); +size_t sbp_msg_command_output_line_encoded_len( + const sbp_msg_command_output_t *msg) { + return sbp_unterminated_string_encoded_len(&msg->line, + SBP_MSG_COMMAND_OUTPUT_LINE_MAX); } -size_t sbp_msg_command_output_line_space_remaining(const sbp_msg_command_output_t *msg) -{ - return sbp_unterminated_string_space_remaining(&msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX); +size_t sbp_msg_command_output_line_space_remaining( + const sbp_msg_command_output_t *msg) { + return sbp_unterminated_string_space_remaining( + &msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX); } - bool sbp_msg_command_output_line_set(sbp_msg_command_output_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set(&msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX, should_trunc, n_written, new_str); +bool sbp_msg_command_output_line_set(sbp_msg_command_output_t *msg, + const char *new_str, bool should_trunc, + size_t *n_written) { + return sbp_unterminated_string_set(&msg->line, + SBP_MSG_COMMAND_OUTPUT_LINE_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_command_output_line_set_raw(sbp_msg_command_output_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set_raw(&msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_command_output_line_set_raw(sbp_msg_command_output_t *msg, + const char *new_buf, + size_t new_buf_len, bool should_trunc, + size_t *n_written) { + return sbp_unterminated_string_set_raw( + &msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX, should_trunc, n_written, + new_buf, new_buf_len); } - -bool sbp_msg_command_output_line_printf(sbp_msg_command_output_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_command_output_line_printf(sbp_msg_command_output_t *msg, + bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_vprintf(&msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_vprintf(&msg->line, + SBP_MSG_COMMAND_OUTPUT_LINE_MAX, + should_trunc, n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_command_output_line_vprintf(sbp_msg_command_output_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_vprintf(&msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_command_output_line_vprintf(sbp_msg_command_output_t *msg, + bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_vprintf(&msg->line, + SBP_MSG_COMMAND_OUTPUT_LINE_MAX, + should_trunc, n_written, fmt, ap); } -bool sbp_msg_command_output_line_append_printf(sbp_msg_command_output_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_command_output_line_append_printf(sbp_msg_command_output_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_append_vprintf(&msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_append_vprintf( + &msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX, should_trunc, n_written, fmt, + ap); va_end(ap); return ret; } - bool sbp_msg_command_output_line_append_vprintf(sbp_msg_command_output_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_append_vprintf(&msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_command_output_line_append_vprintf(sbp_msg_command_output_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_append_vprintf( + &msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX, should_trunc, n_written, fmt, + ap); } -const char *sbp_msg_command_output_line_get(const sbp_msg_command_output_t *msg) -{ - return sbp_unterminated_string_get(&msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX); +const char *sbp_msg_command_output_line_get( + const sbp_msg_command_output_t *msg) { + return sbp_unterminated_string_get(&msg->line, + SBP_MSG_COMMAND_OUTPUT_LINE_MAX); } -size_t sbp_msg_command_output_line_strlen(const sbp_msg_command_output_t *msg) -{ - return sbp_unterminated_string_strlen(&msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX); +size_t sbp_msg_command_output_line_strlen(const sbp_msg_command_output_t *msg) { + return sbp_unterminated_string_strlen(&msg->line, + SBP_MSG_COMMAND_OUTPUT_LINE_MAX); } -bool sbp_msg_command_output_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_command_output_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->sequence)) { return false; } - if (!sbp_unterminated_string_encode(&msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX, ctx)) { return false; } +bool sbp_msg_command_output_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_command_output_t *msg) { + if (!sbp_u32_encode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_unterminated_string_encode(&msg->line, + SBP_MSG_COMMAND_OUTPUT_LINE_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_command_output_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_command_output_t *msg) { +s8 sbp_msg_command_output_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_command_output_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1474,14 +1891,21 @@ s8 sbp_msg_command_output_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_command_output_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_command_output_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->sequence)) { return false; } - if (!sbp_unterminated_string_decode(&msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX, ctx)) { return false; } +bool sbp_msg_command_output_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_command_output_t *msg) { + if (!sbp_u32_decode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_unterminated_string_decode(&msg->line, + SBP_MSG_COMMAND_OUTPUT_LINE_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_command_output_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_command_output_t *msg) { +s8 sbp_msg_command_output_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_command_output_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1495,35 +1919,46 @@ s8 sbp_msg_command_output_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - -s8 sbp_msg_command_output_send(sbp_state_t *s, u16 sender_id, const sbp_msg_command_output_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_command_output_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_command_output_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_command_output_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_COMMAND_OUTPUT, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_command_output_encode(payload, sizeof(payload), &payload_len, + msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_COMMAND_OUTPUT, sender_id, payload_len, + payload, write); } -int sbp_msg_command_output_cmp(const sbp_msg_command_output_t *a, const sbp_msg_command_output_t *b) { +int sbp_msg_command_output_cmp(const sbp_msg_command_output_t *a, + const sbp_msg_command_output_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->sequence, &b->sequence); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_command_output_line_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_network_state_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_network_state_req_t *msg) -{ +bool sbp_msg_network_state_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_network_state_req_t *msg) { (void)ctx; (void)msg; return true; } -s8 sbp_msg_network_state_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_network_state_req_t *msg) { +s8 sbp_msg_network_state_req_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_network_state_req_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1537,14 +1972,16 @@ s8 sbp_msg_network_state_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_network_state_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_network_state_req_t *msg) -{ - (void)ctx; +bool sbp_msg_network_state_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_network_state_req_t *msg) { + (void)ctx; (void)msg; return true; } -s8 sbp_msg_network_state_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_network_state_req_t *msg) { +s8 sbp_msg_network_state_req_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_network_state_req_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1558,46 +1995,66 @@ s8 sbp_msg_network_state_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_network_state_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_network_state_req_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_network_state_req_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_network_state_req_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_network_state_req_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_NETWORK_STATE_REQ, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_network_state_req_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_NETWORK_STATE_REQ, sender_id, payload_len, + payload, write); } -int sbp_msg_network_state_req_cmp(const sbp_msg_network_state_req_t *a, const sbp_msg_network_state_req_t *b) { +int sbp_msg_network_state_req_cmp(const sbp_msg_network_state_req_t *a, + const sbp_msg_network_state_req_t *b) { (void)a; (void)b; int ret = 0; return ret; } -bool sbp_msg_network_state_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_network_state_resp_t *msg) -{ - for (size_t i = 0; i < SBP_MSG_NETWORK_STATE_RESP_IPV4_ADDRESS_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->ipv4_address[i])) { return false; } +bool sbp_msg_network_state_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_network_state_resp_t *msg) { + for (size_t i = 0; i < SBP_MSG_NETWORK_STATE_RESP_IPV4_ADDRESS_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->ipv4_address[i])) { + return false; + } + } + if (!sbp_u8_encode(ctx, &msg->ipv4_mask_size)) { + return false; } - if (!sbp_u8_encode(ctx, &msg->ipv4_mask_size)) { return false; } - for (size_t i = 0; i < SBP_MSG_NETWORK_STATE_RESP_IPV6_ADDRESS_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->ipv6_address[i])) { return false; } + for (size_t i = 0; i < SBP_MSG_NETWORK_STATE_RESP_IPV6_ADDRESS_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->ipv6_address[i])) { + return false; + } + } + if (!sbp_u8_encode(ctx, &msg->ipv6_mask_size)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->rx_bytes)) { + return false; } - if (!sbp_u8_encode(ctx, &msg->ipv6_mask_size)) { return false; } - if (!sbp_u32_encode(ctx, &msg->rx_bytes)) { return false; } - if (!sbp_u32_encode(ctx, &msg->tx_bytes)) { return false; } - for (size_t i = 0; i < SBP_MSG_NETWORK_STATE_RESP_INTERFACE_NAME_MAX; i++) - { - if (!sbp_char_encode(ctx, &msg->interface_name[i])) { return false; } + if (!sbp_u32_encode(ctx, &msg->tx_bytes)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_NETWORK_STATE_RESP_INTERFACE_NAME_MAX; i++) { + if (!sbp_char_encode(ctx, &msg->interface_name[i])) { + return false; + } + } + if (!sbp_u32_encode(ctx, &msg->flags)) { + return false; } - if (!sbp_u32_encode(ctx, &msg->flags)) { return false; } return true; } -s8 sbp_msg_network_state_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_network_state_resp_t *msg) { +s8 sbp_msg_network_state_resp_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_network_state_resp_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1611,26 +2068,44 @@ s8 sbp_msg_network_state_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_writt return SBP_OK; } -bool sbp_msg_network_state_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_network_state_resp_t *msg) -{ +bool sbp_msg_network_state_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_network_state_resp_t *msg) { for (uint8_t i = 0; i < SBP_MSG_NETWORK_STATE_RESP_IPV4_ADDRESS_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->ipv4_address[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->ipv4_address[i])) { + return false; + } + } + if (!sbp_u8_decode(ctx, &msg->ipv4_mask_size)) { + return false; } - if (!sbp_u8_decode(ctx, &msg->ipv4_mask_size)) { return false; } for (uint8_t i = 0; i < SBP_MSG_NETWORK_STATE_RESP_IPV6_ADDRESS_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->ipv6_address[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->ipv6_address[i])) { + return false; + } + } + if (!sbp_u8_decode(ctx, &msg->ipv6_mask_size)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->rx_bytes)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->tx_bytes)) { + return false; } - if (!sbp_u8_decode(ctx, &msg->ipv6_mask_size)) { return false; } - if (!sbp_u32_decode(ctx, &msg->rx_bytes)) { return false; } - if (!sbp_u32_decode(ctx, &msg->tx_bytes)) { return false; } for (uint8_t i = 0; i < SBP_MSG_NETWORK_STATE_RESP_INTERFACE_NAME_MAX; i++) { - if (!sbp_char_decode(ctx, &msg->interface_name[i])) { return false; } + if (!sbp_char_decode(ctx, &msg->interface_name[i])) { + return false; + } + } + if (!sbp_u32_decode(ctx, &msg->flags)) { + return false; } - if (!sbp_u32_decode(ctx, &msg->flags)) { return false; } return true; } -s8 sbp_msg_network_state_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_network_state_resp_t *msg) { +s8 sbp_msg_network_state_resp_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_network_state_resp_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1644,68 +2119,99 @@ s8 sbp_msg_network_state_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } - -s8 sbp_msg_network_state_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_network_state_resp_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_network_state_resp_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_network_state_resp_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_network_state_resp_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_NETWORK_STATE_RESP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_network_state_resp_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_NETWORK_STATE_RESP, sender_id, payload_len, + payload, write); } -int sbp_msg_network_state_resp_cmp(const sbp_msg_network_state_resp_t *a, const sbp_msg_network_state_resp_t *b) { +int sbp_msg_network_state_resp_cmp(const sbp_msg_network_state_resp_t *a, + const sbp_msg_network_state_resp_t *b) { int ret = 0; - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_NETWORK_STATE_RESP_IPV4_ADDRESS_MAX; i++) - { + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_NETWORK_STATE_RESP_IPV4_ADDRESS_MAX; i++) { ret = sbp_u8_cmp(&a->ipv4_address[i], &b->ipv4_address[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->ipv4_mask_size, &b->ipv4_mask_size); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_NETWORK_STATE_RESP_IPV6_ADDRESS_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_NETWORK_STATE_RESP_IPV6_ADDRESS_MAX; i++) { ret = sbp_u8_cmp(&a->ipv6_address[i], &b->ipv6_address[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->ipv6_mask_size, &b->ipv6_mask_size); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->rx_bytes, &b->rx_bytes); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->tx_bytes, &b->tx_bytes); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_NETWORK_STATE_RESP_INTERFACE_NAME_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_NETWORK_STATE_RESP_INTERFACE_NAME_MAX; i++) { ret = sbp_char_cmp(&a->interface_name[i], &b->interface_name[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_network_usage_encode_internal(sbp_encode_ctx_t *ctx, const sbp_network_usage_t *msg) -{ - if (!sbp_u64_encode(ctx, &msg->duration)) { return false; } - if (!sbp_u64_encode(ctx, &msg->total_bytes)) { return false; } - if (!sbp_u32_encode(ctx, &msg->rx_bytes)) { return false; } - if (!sbp_u32_encode(ctx, &msg->tx_bytes)) { return false; } - for (size_t i = 0; i < SBP_NETWORK_USAGE_INTERFACE_NAME_MAX; i++) - { - if (!sbp_char_encode(ctx, &msg->interface_name[i])) { return false; } +bool sbp_network_usage_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_network_usage_t *msg) { + if (!sbp_u64_encode(ctx, &msg->duration)) { + return false; + } + if (!sbp_u64_encode(ctx, &msg->total_bytes)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->rx_bytes)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->tx_bytes)) { + return false; + } + for (size_t i = 0; i < SBP_NETWORK_USAGE_INTERFACE_NAME_MAX; i++) { + if (!sbp_char_encode(ctx, &msg->interface_name[i])) { + return false; + } } return true; } -s8 sbp_network_usage_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_network_usage_t *msg) { +s8 sbp_network_usage_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_network_usage_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1719,19 +2225,30 @@ s8 sbp_network_usage_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_network_usage_decode_internal(sbp_decode_ctx_t *ctx, sbp_network_usage_t *msg) -{ - if (!sbp_u64_decode(ctx, &msg->duration)) { return false; } - if (!sbp_u64_decode(ctx, &msg->total_bytes)) { return false; } - if (!sbp_u32_decode(ctx, &msg->rx_bytes)) { return false; } - if (!sbp_u32_decode(ctx, &msg->tx_bytes)) { return false; } +bool sbp_network_usage_decode_internal(sbp_decode_ctx_t *ctx, + sbp_network_usage_t *msg) { + if (!sbp_u64_decode(ctx, &msg->duration)) { + return false; + } + if (!sbp_u64_decode(ctx, &msg->total_bytes)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->rx_bytes)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->tx_bytes)) { + return false; + } for (uint8_t i = 0; i < SBP_NETWORK_USAGE_INTERFACE_NAME_MAX; i++) { - if (!sbp_char_decode(ctx, &msg->interface_name[i])) { return false; } + if (!sbp_char_decode(ctx, &msg->interface_name[i])) { + return false; + } } return true; } -s8 sbp_network_usage_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_network_usage_t *msg) { +s8 sbp_network_usage_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_network_usage_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1745,41 +2262,53 @@ s8 sbp_network_usage_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - - -int sbp_network_usage_cmp(const sbp_network_usage_t *a, const sbp_network_usage_t *b) { +int sbp_network_usage_cmp(const sbp_network_usage_t *a, + const sbp_network_usage_t *b) { int ret = 0; - + ret = sbp_u64_cmp(&a->duration, &b->duration); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u64_cmp(&a->total_bytes, &b->total_bytes); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->rx_bytes, &b->rx_bytes); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->tx_bytes, &b->tx_bytes); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_NETWORK_USAGE_INTERFACE_NAME_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_NETWORK_USAGE_INTERFACE_NAME_MAX; + i++) { ret = sbp_char_cmp(&a->interface_name[i], &b->interface_name[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_network_bandwidth_usage_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_network_bandwidth_usage_t *msg) -{ - for (size_t i = 0; i < msg->n_interfaces; i++) - { - if (!sbp_network_usage_encode_internal(ctx, &msg->interfaces[i])) { return false; } +bool sbp_msg_network_bandwidth_usage_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_network_bandwidth_usage_t *msg) { + for (size_t i = 0; i < msg->n_interfaces; i++) { + if (!sbp_network_usage_encode_internal(ctx, &msg->interfaces[i])) { + return false; + } } return true; } -s8 sbp_msg_network_bandwidth_usage_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_network_bandwidth_usage_t *msg) { +s8 sbp_msg_network_bandwidth_usage_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_network_bandwidth_usage_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1793,19 +2322,24 @@ s8 sbp_msg_network_bandwidth_usage_encode(uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } -bool sbp_msg_network_bandwidth_usage_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_network_bandwidth_usage_t *msg) -{ - if ( ((ctx->buf_len - ctx->offset) % SBP_NETWORK_USAGE_ENCODED_LEN) != 0) { +bool sbp_msg_network_bandwidth_usage_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_network_bandwidth_usage_t *msg) { + if (((ctx->buf_len - ctx->offset) % SBP_NETWORK_USAGE_ENCODED_LEN) != 0) { + return false; + } + msg->n_interfaces = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_NETWORK_USAGE_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_interfaces; i++) { + if (!sbp_network_usage_decode_internal(ctx, &msg->interfaces[i])) { return false; } - msg->n_interfaces = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_NETWORK_USAGE_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_interfaces; i++) { - if (!sbp_network_usage_decode_internal(ctx, &msg->interfaces[i])) { return false; } - } + } return true; } -s8 sbp_msg_network_bandwidth_usage_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_network_bandwidth_usage_t *msg) { +s8 sbp_msg_network_bandwidth_usage_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_network_bandwidth_usage_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1819,40 +2353,54 @@ s8 sbp_msg_network_bandwidth_usage_decode(const uint8_t *buf, uint8_t len, uint8 return SBP_OK; } - -s8 sbp_msg_network_bandwidth_usage_send(sbp_state_t *s, u16 sender_id, const sbp_msg_network_bandwidth_usage_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_network_bandwidth_usage_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_network_bandwidth_usage_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_network_bandwidth_usage_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_NETWORK_BANDWIDTH_USAGE, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_network_bandwidth_usage_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_NETWORK_BANDWIDTH_USAGE, sender_id, + payload_len, payload, write); } -int sbp_msg_network_bandwidth_usage_cmp(const sbp_msg_network_bandwidth_usage_t *a, const sbp_msg_network_bandwidth_usage_t *b) { +int sbp_msg_network_bandwidth_usage_cmp( + const sbp_msg_network_bandwidth_usage_t *a, + const sbp_msg_network_bandwidth_usage_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->n_interfaces, &b->n_interfaces); - for (uint8_t i = 0; ret == 0 && i < a->n_interfaces; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_interfaces; i++) { ret = sbp_network_usage_cmp(&a->interfaces[i], &b->interfaces[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_cell_modem_status_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_cell_modem_status_t *msg) -{ - if (!sbp_s8_encode(ctx, &msg->signal_strength)) { return false; } - if (!sbp_float_encode(ctx, &msg->signal_error_rate)) { return false; } - for (size_t i = 0; i < msg->n_reserved; i++) - { - if (!sbp_u8_encode(ctx, &msg->reserved[i])) { return false; } +bool sbp_msg_cell_modem_status_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_cell_modem_status_t *msg) { + if (!sbp_s8_encode(ctx, &msg->signal_strength)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->signal_error_rate)) { + return false; + } + for (size_t i = 0; i < msg->n_reserved; i++) { + if (!sbp_u8_encode(ctx, &msg->reserved[i])) { + return false; + } } return true; } -s8 sbp_msg_cell_modem_status_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_cell_modem_status_t *msg) { +s8 sbp_msg_cell_modem_status_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_cell_modem_status_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1866,21 +2414,30 @@ s8 sbp_msg_cell_modem_status_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_cell_modem_status_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_cell_modem_status_t *msg) -{ - if (!sbp_s8_decode(ctx, &msg->signal_strength)) { return false; } - if (!sbp_float_decode(ctx, &msg->signal_error_rate)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { +bool sbp_msg_cell_modem_status_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_cell_modem_status_t *msg) { + if (!sbp_s8_decode(ctx, &msg->signal_strength)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->signal_error_rate)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + return false; + } + msg->n_reserved = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->n_reserved; i++) { + if (!sbp_u8_decode(ctx, &msg->reserved[i])) { return false; } - msg->n_reserved = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); - for (uint8_t i = 0; i < msg->n_reserved; i++) { - if (!sbp_u8_decode(ctx, &msg->reserved[i])) { return false; } - } + } return true; } -s8 sbp_msg_cell_modem_status_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_cell_modem_status_t *msg) { +s8 sbp_msg_cell_modem_status_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_cell_modem_status_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1894,50 +2451,74 @@ s8 sbp_msg_cell_modem_status_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_cell_modem_status_send(sbp_state_t *s, u16 sender_id, const sbp_msg_cell_modem_status_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_cell_modem_status_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_cell_modem_status_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_cell_modem_status_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_CELL_MODEM_STATUS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_cell_modem_status_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_CELL_MODEM_STATUS, sender_id, payload_len, + payload, write); } -int sbp_msg_cell_modem_status_cmp(const sbp_msg_cell_modem_status_t *a, const sbp_msg_cell_modem_status_t *b) { +int sbp_msg_cell_modem_status_cmp(const sbp_msg_cell_modem_status_t *a, + const sbp_msg_cell_modem_status_t *b) { int ret = 0; - + ret = sbp_s8_cmp(&a->signal_strength, &b->signal_strength); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->signal_error_rate, &b->signal_error_rate); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_reserved, &b->n_reserved); - for (uint8_t i = 0; ret == 0 && i < a->n_reserved; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_reserved; i++) { ret = sbp_u8_cmp(&a->reserved[i], &b->reserved[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_specan_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_specan_dep_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->channel_tag)) { return false; } - if (!sbp_gps_time_dep_encode_internal(ctx, &msg->t)) { return false; } - if (!sbp_float_encode(ctx, &msg->freq_ref)) { return false; } - if (!sbp_float_encode(ctx, &msg->freq_step)) { return false; } - if (!sbp_float_encode(ctx, &msg->amplitude_ref)) { return false; } - if (!sbp_float_encode(ctx, &msg->amplitude_unit)) { return false; } - for (size_t i = 0; i < msg->n_amplitude_value; i++) - { - if (!sbp_u8_encode(ctx, &msg->amplitude_value[i])) { return false; } +bool sbp_msg_specan_dep_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_specan_dep_t *msg) { + if (!sbp_u16_encode(ctx, &msg->channel_tag)) { + return false; + } + if (!sbp_gps_time_dep_encode_internal(ctx, &msg->t)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->freq_ref)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->freq_step)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->amplitude_ref)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->amplitude_unit)) { + return false; + } + for (size_t i = 0; i < msg->n_amplitude_value; i++) { + if (!sbp_u8_encode(ctx, &msg->amplitude_value[i])) { + return false; + } } return true; } -s8 sbp_msg_specan_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_specan_dep_t *msg) { +s8 sbp_msg_specan_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_specan_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1951,25 +2532,41 @@ s8 sbp_msg_specan_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, cons return SBP_OK; } -bool sbp_msg_specan_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_specan_dep_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->channel_tag)) { return false; } - if (!sbp_gps_time_dep_decode_internal(ctx, &msg->t)) { return false; } - if (!sbp_float_decode(ctx, &msg->freq_ref)) { return false; } - if (!sbp_float_decode(ctx, &msg->freq_step)) { return false; } - if (!sbp_float_decode(ctx, &msg->amplitude_ref)) { return false; } - if (!sbp_float_decode(ctx, &msg->amplitude_unit)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { +bool sbp_msg_specan_dep_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_specan_dep_t *msg) { + if (!sbp_u16_decode(ctx, &msg->channel_tag)) { + return false; + } + if (!sbp_gps_time_dep_decode_internal(ctx, &msg->t)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->freq_ref)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->freq_step)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->amplitude_ref)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->amplitude_unit)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + return false; + } + msg->n_amplitude_value = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->n_amplitude_value; i++) { + if (!sbp_u8_decode(ctx, &msg->amplitude_value[i])) { return false; } - msg->n_amplitude_value = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); - for (uint8_t i = 0; i < msg->n_amplitude_value; i++) { - if (!sbp_u8_decode(ctx, &msg->amplitude_value[i])) { return false; } - } + } return true; } -s8 sbp_msg_specan_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_specan_dep_t *msg) { +s8 sbp_msg_specan_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_specan_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1983,62 +2580,94 @@ s8 sbp_msg_specan_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, s return SBP_OK; } - -s8 sbp_msg_specan_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_specan_dep_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_specan_dep_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_specan_dep_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_specan_dep_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SPECAN_DEP, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_specan_dep_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SPECAN_DEP, sender_id, payload_len, + payload, write); } -int sbp_msg_specan_dep_cmp(const sbp_msg_specan_dep_t *a, const sbp_msg_specan_dep_t *b) { +int sbp_msg_specan_dep_cmp(const sbp_msg_specan_dep_t *a, + const sbp_msg_specan_dep_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->channel_tag, &b->channel_tag); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_dep_cmp(&a->t, &b->t); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->freq_ref, &b->freq_ref); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->freq_step, &b->freq_step); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->amplitude_ref, &b->amplitude_ref); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->amplitude_unit, &b->amplitude_unit); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_amplitude_value, &b->n_amplitude_value); - for (uint8_t i = 0; ret == 0 && i < a->n_amplitude_value; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_amplitude_value; i++) { ret = sbp_u8_cmp(&a->amplitude_value[i], &b->amplitude_value[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_specan_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_specan_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->channel_tag)) { return false; } - if (!sbp_v4_gps_time_encode_internal(ctx, &msg->t)) { return false; } - if (!sbp_float_encode(ctx, &msg->freq_ref)) { return false; } - if (!sbp_float_encode(ctx, &msg->freq_step)) { return false; } - if (!sbp_float_encode(ctx, &msg->amplitude_ref)) { return false; } - if (!sbp_float_encode(ctx, &msg->amplitude_unit)) { return false; } - for (size_t i = 0; i < msg->n_amplitude_value; i++) - { - if (!sbp_u8_encode(ctx, &msg->amplitude_value[i])) { return false; } +bool sbp_msg_specan_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_specan_t *msg) { + if (!sbp_u16_encode(ctx, &msg->channel_tag)) { + return false; + } + if (!sbp_v4_gps_time_encode_internal(ctx, &msg->t)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->freq_ref)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->freq_step)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->amplitude_ref)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->amplitude_unit)) { + return false; + } + for (size_t i = 0; i < msg->n_amplitude_value; i++) { + if (!sbp_u8_encode(ctx, &msg->amplitude_value[i])) { + return false; + } } return true; } -s8 sbp_msg_specan_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_specan_t *msg) { +s8 sbp_msg_specan_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_specan_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2052,25 +2681,41 @@ s8 sbp_msg_specan_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sb return SBP_OK; } -bool sbp_msg_specan_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_specan_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->channel_tag)) { return false; } - if (!sbp_v4_gps_time_decode_internal(ctx, &msg->t)) { return false; } - if (!sbp_float_decode(ctx, &msg->freq_ref)) { return false; } - if (!sbp_float_decode(ctx, &msg->freq_step)) { return false; } - if (!sbp_float_decode(ctx, &msg->amplitude_ref)) { return false; } - if (!sbp_float_decode(ctx, &msg->amplitude_unit)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { +bool sbp_msg_specan_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_specan_t *msg) { + if (!sbp_u16_decode(ctx, &msg->channel_tag)) { + return false; + } + if (!sbp_v4_gps_time_decode_internal(ctx, &msg->t)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->freq_ref)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->freq_step)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->amplitude_ref)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->amplitude_unit)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + return false; + } + msg->n_amplitude_value = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->n_amplitude_value; i++) { + if (!sbp_u8_decode(ctx, &msg->amplitude_value[i])) { return false; } - msg->n_amplitude_value = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); - for (uint8_t i = 0; i < msg->n_amplitude_value; i++) { - if (!sbp_u8_decode(ctx, &msg->amplitude_value[i])) { return false; } - } + } return true; } -s8 sbp_msg_specan_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_specan_t *msg) { +s8 sbp_msg_specan_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_specan_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2084,60 +2729,78 @@ s8 sbp_msg_specan_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_m return SBP_OK; } - -s8 sbp_msg_specan_send(sbp_state_t *s, u16 sender_id, const sbp_msg_specan_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_specan_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_specan_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_specan_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SPECAN, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SPECAN, sender_id, payload_len, payload, + write); } int sbp_msg_specan_cmp(const sbp_msg_specan_t *a, const sbp_msg_specan_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->channel_tag, &b->channel_tag); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gps_time_cmp(&a->t, &b->t); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->freq_ref, &b->freq_ref); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->freq_step, &b->freq_step); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->amplitude_ref, &b->amplitude_ref); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->amplitude_unit, &b->amplitude_unit); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_amplitude_value, &b->n_amplitude_value); - for (uint8_t i = 0; ret == 0 && i < a->n_amplitude_value; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_amplitude_value; i++) { ret = sbp_u8_cmp(&a->amplitude_value[i], &b->amplitude_value[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_front_end_gain_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_front_end_gain_t *msg) -{ - for (size_t i = 0; i < SBP_MSG_FRONT_END_GAIN_RF_GAIN_MAX; i++) - { - if (!sbp_s8_encode(ctx, &msg->rf_gain[i])) { return false; } +bool sbp_msg_front_end_gain_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_front_end_gain_t *msg) { + for (size_t i = 0; i < SBP_MSG_FRONT_END_GAIN_RF_GAIN_MAX; i++) { + if (!sbp_s8_encode(ctx, &msg->rf_gain[i])) { + return false; + } } - for (size_t i = 0; i < SBP_MSG_FRONT_END_GAIN_IF_GAIN_MAX; i++) - { - if (!sbp_s8_encode(ctx, &msg->if_gain[i])) { return false; } + for (size_t i = 0; i < SBP_MSG_FRONT_END_GAIN_IF_GAIN_MAX; i++) { + if (!sbp_s8_encode(ctx, &msg->if_gain[i])) { + return false; + } } return true; } -s8 sbp_msg_front_end_gain_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_front_end_gain_t *msg) { +s8 sbp_msg_front_end_gain_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_front_end_gain_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2151,18 +2814,24 @@ s8 sbp_msg_front_end_gain_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_front_end_gain_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_front_end_gain_t *msg) -{ +bool sbp_msg_front_end_gain_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_front_end_gain_t *msg) { for (uint8_t i = 0; i < SBP_MSG_FRONT_END_GAIN_RF_GAIN_MAX; i++) { - if (!sbp_s8_decode(ctx, &msg->rf_gain[i])) { return false; } + if (!sbp_s8_decode(ctx, &msg->rf_gain[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_MSG_FRONT_END_GAIN_IF_GAIN_MAX; i++) { - if (!sbp_s8_decode(ctx, &msg->if_gain[i])) { return false; } + if (!sbp_s8_decode(ctx, &msg->if_gain[i])) { + return false; + } } return true; } -s8 sbp_msg_front_end_gain_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_front_end_gain_t *msg) { +s8 sbp_msg_front_end_gain_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_front_end_gain_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2176,29 +2845,36 @@ s8 sbp_msg_front_end_gain_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - -s8 sbp_msg_front_end_gain_send(sbp_state_t *s, u16 sender_id, const sbp_msg_front_end_gain_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_front_end_gain_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_front_end_gain_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_front_end_gain_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_FRONT_END_GAIN, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_front_end_gain_encode(payload, sizeof(payload), &payload_len, + msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_FRONT_END_GAIN, sender_id, payload_len, + payload, write); } -int sbp_msg_front_end_gain_cmp(const sbp_msg_front_end_gain_t *a, const sbp_msg_front_end_gain_t *b) { +int sbp_msg_front_end_gain_cmp(const sbp_msg_front_end_gain_t *a, + const sbp_msg_front_end_gain_t *b) { int ret = 0; - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_FRONT_END_GAIN_RF_GAIN_MAX; i++) - { + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_FRONT_END_GAIN_RF_GAIN_MAX; i++) { ret = sbp_s8_cmp(&a->rf_gain[i], &b->rf_gain[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_FRONT_END_GAIN_IF_GAIN_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_FRONT_END_GAIN_IF_GAIN_MAX; i++) { ret = sbp_s8_cmp(&a->if_gain[i], &b->if_gain[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/sbas.c b/c/src/sbas.c index fd4da1ded..3217eefea 100644 --- a/c/src/sbas.c +++ b/c/src/sbas.c @@ -3,33 +3,41 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include #include +#include +#include #include #include -#include #include +#include +#include -bool sbp_msg_sbas_raw_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_sbas_raw_t *msg) -{ - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u8_encode(ctx, &msg->message_type)) { return false; } - for (size_t i = 0; i < SBP_MSG_SBAS_RAW_DATA_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->data[i])) { return false; } +bool sbp_msg_sbas_raw_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_sbas_raw_t *msg) { + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->message_type)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_SBAS_RAW_DATA_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->data[i])) { + return false; + } } return true; } -s8 sbp_msg_sbas_raw_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_sbas_raw_t *msg) { +s8 sbp_msg_sbas_raw_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_sbas_raw_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -43,18 +51,27 @@ s8 sbp_msg_sbas_raw_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_sbas_raw_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_sbas_raw_t *msg) -{ - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u8_decode(ctx, &msg->message_type)) { return false; } +bool sbp_msg_sbas_raw_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_sbas_raw_t *msg) { + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->message_type)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_SBAS_RAW_DATA_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->data[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->data[i])) { + return false; + } } return true; } -s8 sbp_msg_sbas_raw_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_sbas_raw_t *msg) { +s8 sbp_msg_sbas_raw_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_sbas_raw_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -68,32 +85,42 @@ s8 sbp_msg_sbas_raw_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp return SBP_OK; } - -s8 sbp_msg_sbas_raw_send(sbp_state_t *s, u16 sender_id, const sbp_msg_sbas_raw_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_sbas_raw_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_sbas_raw_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_sbas_raw_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SBAS_RAW, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SBAS_RAW, sender_id, payload_len, payload, + write); } -int sbp_msg_sbas_raw_cmp(const sbp_msg_sbas_raw_t *a, const sbp_msg_sbas_raw_t *b) { +int sbp_msg_sbas_raw_cmp(const sbp_msg_sbas_raw_t *a, + const sbp_msg_sbas_raw_t *b) { int ret = 0; - + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->message_type, &b->message_type); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_SBAS_RAW_DATA_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_SBAS_RAW_DATA_MAX; i++) { ret = sbp_u8_cmp(&a->data[i], &b->data[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/settings.c b/c/src/settings.c index 3cdda5188..d71137d75 100644 --- a/c/src/settings.c +++ b/c/src/settings.c @@ -3,28 +3,29 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include +#include #include +#include #include #include -#include #include +#include +#include -bool sbp_msg_settings_save_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_save_t *msg) -{ +bool sbp_msg_settings_save_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_settings_save_t *msg) { (void)ctx; (void)msg; return true; } -s8 sbp_msg_settings_save_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_save_t *msg) { +s8 sbp_msg_settings_save_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_save_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -38,14 +39,15 @@ s8 sbp_msg_settings_save_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_settings_save_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_save_t *msg) -{ - (void)ctx; +bool sbp_msg_settings_save_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_settings_save_t *msg) { + (void)ctx; (void)msg; return true; } -s8 sbp_msg_settings_save_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_save_t *msg) { +s8 sbp_msg_settings_save_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_settings_save_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -59,107 +61,127 @@ s8 sbp_msg_settings_save_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_settings_save_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_save_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_settings_save_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_settings_save_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_settings_save_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SETTINGS_SAVE, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_settings_save_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SETTINGS_SAVE, sender_id, payload_len, + payload, write); } -int sbp_msg_settings_save_cmp(const sbp_msg_settings_save_t *a, const sbp_msg_settings_save_t *b) { +int sbp_msg_settings_save_cmp(const sbp_msg_settings_save_t *a, + const sbp_msg_settings_save_t *b) { (void)a; (void)b; int ret = 0; return ret; } -void sbp_msg_settings_write_setting_init(sbp_msg_settings_write_t *msg) -{ +void sbp_msg_settings_write_setting_init(sbp_msg_settings_write_t *msg) { sbp_multipart_string_init(&msg->setting); } -bool sbp_msg_settings_write_setting_valid(const sbp_msg_settings_write_t *msg) -{ - return sbp_multipart_string_valid(&msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX); +bool sbp_msg_settings_write_setting_valid(const sbp_msg_settings_write_t *msg) { + return sbp_multipart_string_valid(&msg->setting, + SBP_MSG_SETTINGS_WRITE_SETTING_MAX); } -int sbp_msg_settings_write_setting_strcmp(const sbp_msg_settings_write_t *a, const sbp_msg_settings_write_t *b) -{ - return sbp_multipart_string_strcmp(&a->setting, &b->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX); +int sbp_msg_settings_write_setting_strcmp(const sbp_msg_settings_write_t *a, + const sbp_msg_settings_write_t *b) { + return sbp_multipart_string_strcmp(&a->setting, &b->setting, + SBP_MSG_SETTINGS_WRITE_SETTING_MAX); } -size_t sbp_msg_settings_write_setting_encoded_len(const sbp_msg_settings_write_t *msg) -{ - return sbp_multipart_string_encoded_len(&msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX); +size_t sbp_msg_settings_write_setting_encoded_len( + const sbp_msg_settings_write_t *msg) { + return sbp_multipart_string_encoded_len(&msg->setting, + SBP_MSG_SETTINGS_WRITE_SETTING_MAX); } -size_t sbp_msg_settings_write_setting_space_remaining(const sbp_msg_settings_write_t *msg) -{ - return sbp_multipart_string_space_remaining(&msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX); +size_t sbp_msg_settings_write_setting_space_remaining( + const sbp_msg_settings_write_t *msg) { + return sbp_multipart_string_space_remaining( + &msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX); } -size_t sbp_msg_settings_write_setting_count_sections(const sbp_msg_settings_write_t *msg) -{ - return sbp_multipart_string_count_sections(&msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX); +size_t sbp_msg_settings_write_setting_count_sections( + const sbp_msg_settings_write_t *msg) { + return sbp_multipart_string_count_sections( + &msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX); } -bool sbp_msg_settings_write_setting_add_section(sbp_msg_settings_write_t *msg, const char *new_str) -{ - return sbp_multipart_string_add_section(&msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, new_str); +bool sbp_msg_settings_write_setting_add_section(sbp_msg_settings_write_t *msg, + const char *new_str) { + return sbp_multipart_string_add_section( + &msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, new_str); } -bool sbp_msg_settings_write_setting_add_section_printf(sbp_msg_settings_write_t *msg, const char *fmt, ...) -{ +bool sbp_msg_settings_write_setting_add_section_printf( + sbp_msg_settings_write_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_add_section_vprintf(&msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, fmt, ap); + bool ret = sbp_multipart_string_add_section_vprintf( + &msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_settings_write_setting_add_section_vprintf(sbp_msg_settings_write_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_add_section_vprintf(&msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, fmt, ap); +bool sbp_msg_settings_write_setting_add_section_vprintf( + sbp_msg_settings_write_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_add_section_vprintf( + &msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, fmt, ap); } -bool sbp_msg_settings_write_setting_append(sbp_msg_settings_write_t *msg, const char *str) -{ - return sbp_multipart_string_append(&msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, str); +bool sbp_msg_settings_write_setting_append(sbp_msg_settings_write_t *msg, + const char *str) { + return sbp_multipart_string_append(&msg->setting, + SBP_MSG_SETTINGS_WRITE_SETTING_MAX, str); } -bool sbp_msg_settings_write_setting_append_printf(sbp_msg_settings_write_t *msg, const char *fmt, ...) -{ +bool sbp_msg_settings_write_setting_append_printf(sbp_msg_settings_write_t *msg, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_append_vprintf(&msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, fmt, ap); + bool ret = sbp_multipart_string_append_vprintf( + &msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_settings_write_setting_append_vprintf(sbp_msg_settings_write_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_append_vprintf(&msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, fmt, ap); +bool sbp_msg_settings_write_setting_append_vprintf( + sbp_msg_settings_write_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_append_vprintf( + &msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, fmt, ap); } -const char *sbp_msg_settings_write_setting_get_section(const sbp_msg_settings_write_t *msg, size_t section) -{ - return sbp_multipart_string_get_section(&msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, section); +const char *sbp_msg_settings_write_setting_get_section( + const sbp_msg_settings_write_t *msg, size_t section) { + return sbp_multipart_string_get_section( + &msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, section); } -size_t sbp_msg_settings_write_setting_section_strlen(const sbp_msg_settings_write_t *msg, size_t section) -{ - return sbp_multipart_string_section_strlen(&msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, section); +size_t sbp_msg_settings_write_setting_section_strlen( + const sbp_msg_settings_write_t *msg, size_t section) { + return sbp_multipart_string_section_strlen( + &msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, section); } -bool sbp_msg_settings_write_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_write_t *msg) -{ - if (!sbp_multipart_string_encode(&msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, ctx)) { return false; } +bool sbp_msg_settings_write_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_write_t *msg) { + if (!sbp_multipart_string_encode(&msg->setting, + SBP_MSG_SETTINGS_WRITE_SETTING_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_settings_write_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_write_t *msg) { +s8 sbp_msg_settings_write_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_write_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -173,13 +195,18 @@ s8 sbp_msg_settings_write_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_settings_write_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_write_t *msg) -{ - if (!sbp_multipart_string_decode(&msg->setting, SBP_MSG_SETTINGS_WRITE_SETTING_MAX, ctx)) { return false; } +bool sbp_msg_settings_write_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_settings_write_t *msg) { + if (!sbp_multipart_string_decode(&msg->setting, + SBP_MSG_SETTINGS_WRITE_SETTING_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_settings_write_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_write_t *msg) { +s8 sbp_msg_settings_write_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_settings_write_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -193,109 +220,137 @@ s8 sbp_msg_settings_write_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - -s8 sbp_msg_settings_write_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_write_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_settings_write_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_settings_write_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_settings_write_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SETTINGS_WRITE, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_settings_write_encode(payload, sizeof(payload), &payload_len, + msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SETTINGS_WRITE, sender_id, payload_len, + payload, write); } -int sbp_msg_settings_write_cmp(const sbp_msg_settings_write_t *a, const sbp_msg_settings_write_t *b) { +int sbp_msg_settings_write_cmp(const sbp_msg_settings_write_t *a, + const sbp_msg_settings_write_t *b) { int ret = 0; - + ret = sbp_msg_settings_write_setting_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_settings_write_resp_setting_init(sbp_msg_settings_write_resp_t *msg) -{ +void sbp_msg_settings_write_resp_setting_init( + sbp_msg_settings_write_resp_t *msg) { sbp_multipart_string_init(&msg->setting); } -bool sbp_msg_settings_write_resp_setting_valid(const sbp_msg_settings_write_resp_t *msg) -{ - return sbp_multipart_string_valid(&msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX); +bool sbp_msg_settings_write_resp_setting_valid( + const sbp_msg_settings_write_resp_t *msg) { + return sbp_multipart_string_valid(&msg->setting, + SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX); } -int sbp_msg_settings_write_resp_setting_strcmp(const sbp_msg_settings_write_resp_t *a, const sbp_msg_settings_write_resp_t *b) -{ - return sbp_multipart_string_strcmp(&a->setting, &b->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX); +int sbp_msg_settings_write_resp_setting_strcmp( + const sbp_msg_settings_write_resp_t *a, + const sbp_msg_settings_write_resp_t *b) { + return sbp_multipart_string_strcmp(&a->setting, &b->setting, + SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX); } -size_t sbp_msg_settings_write_resp_setting_encoded_len(const sbp_msg_settings_write_resp_t *msg) -{ - return sbp_multipart_string_encoded_len(&msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX); +size_t sbp_msg_settings_write_resp_setting_encoded_len( + const sbp_msg_settings_write_resp_t *msg) { + return sbp_multipart_string_encoded_len( + &msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX); } -size_t sbp_msg_settings_write_resp_setting_space_remaining(const sbp_msg_settings_write_resp_t *msg) -{ - return sbp_multipart_string_space_remaining(&msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX); +size_t sbp_msg_settings_write_resp_setting_space_remaining( + const sbp_msg_settings_write_resp_t *msg) { + return sbp_multipart_string_space_remaining( + &msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX); } -size_t sbp_msg_settings_write_resp_setting_count_sections(const sbp_msg_settings_write_resp_t *msg) -{ - return sbp_multipart_string_count_sections(&msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX); +size_t sbp_msg_settings_write_resp_setting_count_sections( + const sbp_msg_settings_write_resp_t *msg) { + return sbp_multipart_string_count_sections( + &msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX); } -bool sbp_msg_settings_write_resp_setting_add_section(sbp_msg_settings_write_resp_t *msg, const char *new_str) -{ - return sbp_multipart_string_add_section(&msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, new_str); +bool sbp_msg_settings_write_resp_setting_add_section( + sbp_msg_settings_write_resp_t *msg, const char *new_str) { + return sbp_multipart_string_add_section( + &msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, new_str); } -bool sbp_msg_settings_write_resp_setting_add_section_printf(sbp_msg_settings_write_resp_t *msg, const char *fmt, ...) -{ +bool sbp_msg_settings_write_resp_setting_add_section_printf( + sbp_msg_settings_write_resp_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_add_section_vprintf(&msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, fmt, ap); + bool ret = sbp_multipart_string_add_section_vprintf( + &msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_settings_write_resp_setting_add_section_vprintf(sbp_msg_settings_write_resp_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_add_section_vprintf(&msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, fmt, ap); +bool sbp_msg_settings_write_resp_setting_add_section_vprintf( + sbp_msg_settings_write_resp_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_add_section_vprintf( + &msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, fmt, ap); } -bool sbp_msg_settings_write_resp_setting_append(sbp_msg_settings_write_resp_t *msg, const char *str) -{ - return sbp_multipart_string_append(&msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, str); +bool sbp_msg_settings_write_resp_setting_append( + sbp_msg_settings_write_resp_t *msg, const char *str) { + return sbp_multipart_string_append( + &msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, str); } -bool sbp_msg_settings_write_resp_setting_append_printf(sbp_msg_settings_write_resp_t *msg, const char *fmt, ...) -{ +bool sbp_msg_settings_write_resp_setting_append_printf( + sbp_msg_settings_write_resp_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_append_vprintf(&msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, fmt, ap); + bool ret = sbp_multipart_string_append_vprintf( + &msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_settings_write_resp_setting_append_vprintf(sbp_msg_settings_write_resp_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_append_vprintf(&msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, fmt, ap); +bool sbp_msg_settings_write_resp_setting_append_vprintf( + sbp_msg_settings_write_resp_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_append_vprintf( + &msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, fmt, ap); } -const char *sbp_msg_settings_write_resp_setting_get_section(const sbp_msg_settings_write_resp_t *msg, size_t section) -{ - return sbp_multipart_string_get_section(&msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, section); +const char *sbp_msg_settings_write_resp_setting_get_section( + const sbp_msg_settings_write_resp_t *msg, size_t section) { + return sbp_multipart_string_get_section( + &msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, section); } -size_t sbp_msg_settings_write_resp_setting_section_strlen(const sbp_msg_settings_write_resp_t *msg, size_t section) -{ - return sbp_multipart_string_section_strlen(&msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, section); +size_t sbp_msg_settings_write_resp_setting_section_strlen( + const sbp_msg_settings_write_resp_t *msg, size_t section) { + return sbp_multipart_string_section_strlen( + &msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, section); } -bool sbp_msg_settings_write_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_write_resp_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->status)) { return false; } - if (!sbp_multipart_string_encode(&msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, ctx)) { return false; } +bool sbp_msg_settings_write_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_write_resp_t *msg) { + if (!sbp_u8_encode(ctx, &msg->status)) { + return false; + } + if (!sbp_multipart_string_encode( + &msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_settings_write_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_write_resp_t *msg) { +s8 sbp_msg_settings_write_resp_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_write_resp_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -309,14 +364,21 @@ s8 sbp_msg_settings_write_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_writ return SBP_OK; } -bool sbp_msg_settings_write_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_write_resp_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->status)) { return false; } - if (!sbp_multipart_string_decode(&msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, ctx)) { return false; } +bool sbp_msg_settings_write_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_write_resp_t *msg) { + if (!sbp_u8_decode(ctx, &msg->status)) { + return false; + } + if (!sbp_multipart_string_decode( + &msg->setting, SBP_MSG_SETTINGS_WRITE_RESP_SETTING_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_settings_write_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_write_resp_t *msg) { +s8 sbp_msg_settings_write_resp_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_settings_write_resp_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -330,111 +392,138 @@ s8 sbp_msg_settings_write_resp_decode(const uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } - -s8 sbp_msg_settings_write_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_write_resp_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_settings_write_resp_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_settings_write_resp_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_settings_write_resp_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SETTINGS_WRITE_RESP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_settings_write_resp_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SETTINGS_WRITE_RESP, sender_id, + payload_len, payload, write); } -int sbp_msg_settings_write_resp_cmp(const sbp_msg_settings_write_resp_t *a, const sbp_msg_settings_write_resp_t *b) { +int sbp_msg_settings_write_resp_cmp(const sbp_msg_settings_write_resp_t *a, + const sbp_msg_settings_write_resp_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->status, &b->status); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_settings_write_resp_setting_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_settings_read_req_setting_init(sbp_msg_settings_read_req_t *msg) -{ +void sbp_msg_settings_read_req_setting_init(sbp_msg_settings_read_req_t *msg) { sbp_multipart_string_init(&msg->setting); } -bool sbp_msg_settings_read_req_setting_valid(const sbp_msg_settings_read_req_t *msg) -{ - return sbp_multipart_string_valid(&msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX); +bool sbp_msg_settings_read_req_setting_valid( + const sbp_msg_settings_read_req_t *msg) { + return sbp_multipart_string_valid(&msg->setting, + SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX); } -int sbp_msg_settings_read_req_setting_strcmp(const sbp_msg_settings_read_req_t *a, const sbp_msg_settings_read_req_t *b) -{ - return sbp_multipart_string_strcmp(&a->setting, &b->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX); +int sbp_msg_settings_read_req_setting_strcmp( + const sbp_msg_settings_read_req_t *a, + const sbp_msg_settings_read_req_t *b) { + return sbp_multipart_string_strcmp(&a->setting, &b->setting, + SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX); } -size_t sbp_msg_settings_read_req_setting_encoded_len(const sbp_msg_settings_read_req_t *msg) -{ - return sbp_multipart_string_encoded_len(&msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX); +size_t sbp_msg_settings_read_req_setting_encoded_len( + const sbp_msg_settings_read_req_t *msg) { + return sbp_multipart_string_encoded_len( + &msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX); } -size_t sbp_msg_settings_read_req_setting_space_remaining(const sbp_msg_settings_read_req_t *msg) -{ - return sbp_multipart_string_space_remaining(&msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX); +size_t sbp_msg_settings_read_req_setting_space_remaining( + const sbp_msg_settings_read_req_t *msg) { + return sbp_multipart_string_space_remaining( + &msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX); } -size_t sbp_msg_settings_read_req_setting_count_sections(const sbp_msg_settings_read_req_t *msg) -{ - return sbp_multipart_string_count_sections(&msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX); +size_t sbp_msg_settings_read_req_setting_count_sections( + const sbp_msg_settings_read_req_t *msg) { + return sbp_multipart_string_count_sections( + &msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX); } -bool sbp_msg_settings_read_req_setting_add_section(sbp_msg_settings_read_req_t *msg, const char *new_str) -{ - return sbp_multipart_string_add_section(&msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, new_str); +bool sbp_msg_settings_read_req_setting_add_section( + sbp_msg_settings_read_req_t *msg, const char *new_str) { + return sbp_multipart_string_add_section( + &msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, new_str); } -bool sbp_msg_settings_read_req_setting_add_section_printf(sbp_msg_settings_read_req_t *msg, const char *fmt, ...) -{ +bool sbp_msg_settings_read_req_setting_add_section_printf( + sbp_msg_settings_read_req_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_add_section_vprintf(&msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, fmt, ap); + bool ret = sbp_multipart_string_add_section_vprintf( + &msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_settings_read_req_setting_add_section_vprintf(sbp_msg_settings_read_req_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_add_section_vprintf(&msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, fmt, ap); +bool sbp_msg_settings_read_req_setting_add_section_vprintf( + sbp_msg_settings_read_req_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_add_section_vprintf( + &msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, fmt, ap); } -bool sbp_msg_settings_read_req_setting_append(sbp_msg_settings_read_req_t *msg, const char *str) -{ - return sbp_multipart_string_append(&msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, str); +bool sbp_msg_settings_read_req_setting_append(sbp_msg_settings_read_req_t *msg, + const char *str) { + return sbp_multipart_string_append( + &msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, str); } -bool sbp_msg_settings_read_req_setting_append_printf(sbp_msg_settings_read_req_t *msg, const char *fmt, ...) -{ +bool sbp_msg_settings_read_req_setting_append_printf( + sbp_msg_settings_read_req_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_append_vprintf(&msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, fmt, ap); + bool ret = sbp_multipart_string_append_vprintf( + &msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_settings_read_req_setting_append_vprintf(sbp_msg_settings_read_req_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_append_vprintf(&msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, fmt, ap); +bool sbp_msg_settings_read_req_setting_append_vprintf( + sbp_msg_settings_read_req_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_append_vprintf( + &msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, fmt, ap); } -const char *sbp_msg_settings_read_req_setting_get_section(const sbp_msg_settings_read_req_t *msg, size_t section) -{ - return sbp_multipart_string_get_section(&msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, section); +const char *sbp_msg_settings_read_req_setting_get_section( + const sbp_msg_settings_read_req_t *msg, size_t section) { + return sbp_multipart_string_get_section( + &msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, section); } -size_t sbp_msg_settings_read_req_setting_section_strlen(const sbp_msg_settings_read_req_t *msg, size_t section) -{ - return sbp_multipart_string_section_strlen(&msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, section); +size_t sbp_msg_settings_read_req_setting_section_strlen( + const sbp_msg_settings_read_req_t *msg, size_t section) { + return sbp_multipart_string_section_strlen( + &msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, section); } -bool sbp_msg_settings_read_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_req_t *msg) -{ - if (!sbp_multipart_string_encode(&msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, ctx)) { return false; } +bool sbp_msg_settings_read_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_req_t *msg) { + if (!sbp_multipart_string_encode( + &msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_settings_read_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_req_t *msg) { +s8 sbp_msg_settings_read_req_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_settings_read_req_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -448,13 +537,18 @@ s8 sbp_msg_settings_read_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_settings_read_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_read_req_t *msg) -{ - if (!sbp_multipart_string_decode(&msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, ctx)) { return false; } +bool sbp_msg_settings_read_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_read_req_t *msg) { + if (!sbp_multipart_string_decode( + &msg->setting, SBP_MSG_SETTINGS_READ_REQ_SETTING_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_settings_read_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_req_t *msg) { +s8 sbp_msg_settings_read_req_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_settings_read_req_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -468,108 +562,134 @@ s8 sbp_msg_settings_read_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_settings_read_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_read_req_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_settings_read_req_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_settings_read_req_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_settings_read_req_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SETTINGS_READ_REQ, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_settings_read_req_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SETTINGS_READ_REQ, sender_id, payload_len, + payload, write); } -int sbp_msg_settings_read_req_cmp(const sbp_msg_settings_read_req_t *a, const sbp_msg_settings_read_req_t *b) { +int sbp_msg_settings_read_req_cmp(const sbp_msg_settings_read_req_t *a, + const sbp_msg_settings_read_req_t *b) { int ret = 0; - + ret = sbp_msg_settings_read_req_setting_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_settings_read_resp_setting_init(sbp_msg_settings_read_resp_t *msg) -{ +void sbp_msg_settings_read_resp_setting_init( + sbp_msg_settings_read_resp_t *msg) { sbp_multipart_string_init(&msg->setting); } -bool sbp_msg_settings_read_resp_setting_valid(const sbp_msg_settings_read_resp_t *msg) -{ - return sbp_multipart_string_valid(&msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX); +bool sbp_msg_settings_read_resp_setting_valid( + const sbp_msg_settings_read_resp_t *msg) { + return sbp_multipart_string_valid(&msg->setting, + SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX); } -int sbp_msg_settings_read_resp_setting_strcmp(const sbp_msg_settings_read_resp_t *a, const sbp_msg_settings_read_resp_t *b) -{ - return sbp_multipart_string_strcmp(&a->setting, &b->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX); +int sbp_msg_settings_read_resp_setting_strcmp( + const sbp_msg_settings_read_resp_t *a, + const sbp_msg_settings_read_resp_t *b) { + return sbp_multipart_string_strcmp(&a->setting, &b->setting, + SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX); } -size_t sbp_msg_settings_read_resp_setting_encoded_len(const sbp_msg_settings_read_resp_t *msg) -{ - return sbp_multipart_string_encoded_len(&msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX); +size_t sbp_msg_settings_read_resp_setting_encoded_len( + const sbp_msg_settings_read_resp_t *msg) { + return sbp_multipart_string_encoded_len( + &msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX); } -size_t sbp_msg_settings_read_resp_setting_space_remaining(const sbp_msg_settings_read_resp_t *msg) -{ - return sbp_multipart_string_space_remaining(&msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX); +size_t sbp_msg_settings_read_resp_setting_space_remaining( + const sbp_msg_settings_read_resp_t *msg) { + return sbp_multipart_string_space_remaining( + &msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX); } -size_t sbp_msg_settings_read_resp_setting_count_sections(const sbp_msg_settings_read_resp_t *msg) -{ - return sbp_multipart_string_count_sections(&msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX); +size_t sbp_msg_settings_read_resp_setting_count_sections( + const sbp_msg_settings_read_resp_t *msg) { + return sbp_multipart_string_count_sections( + &msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX); } -bool sbp_msg_settings_read_resp_setting_add_section(sbp_msg_settings_read_resp_t *msg, const char *new_str) -{ - return sbp_multipart_string_add_section(&msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, new_str); +bool sbp_msg_settings_read_resp_setting_add_section( + sbp_msg_settings_read_resp_t *msg, const char *new_str) { + return sbp_multipart_string_add_section( + &msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, new_str); } -bool sbp_msg_settings_read_resp_setting_add_section_printf(sbp_msg_settings_read_resp_t *msg, const char *fmt, ...) -{ +bool sbp_msg_settings_read_resp_setting_add_section_printf( + sbp_msg_settings_read_resp_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_add_section_vprintf(&msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, fmt, ap); + bool ret = sbp_multipart_string_add_section_vprintf( + &msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_settings_read_resp_setting_add_section_vprintf(sbp_msg_settings_read_resp_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_add_section_vprintf(&msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, fmt, ap); +bool sbp_msg_settings_read_resp_setting_add_section_vprintf( + sbp_msg_settings_read_resp_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_add_section_vprintf( + &msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, fmt, ap); } -bool sbp_msg_settings_read_resp_setting_append(sbp_msg_settings_read_resp_t *msg, const char *str) -{ - return sbp_multipart_string_append(&msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, str); +bool sbp_msg_settings_read_resp_setting_append( + sbp_msg_settings_read_resp_t *msg, const char *str) { + return sbp_multipart_string_append( + &msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, str); } -bool sbp_msg_settings_read_resp_setting_append_printf(sbp_msg_settings_read_resp_t *msg, const char *fmt, ...) -{ +bool sbp_msg_settings_read_resp_setting_append_printf( + sbp_msg_settings_read_resp_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_append_vprintf(&msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, fmt, ap); + bool ret = sbp_multipart_string_append_vprintf( + &msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_settings_read_resp_setting_append_vprintf(sbp_msg_settings_read_resp_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_append_vprintf(&msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, fmt, ap); +bool sbp_msg_settings_read_resp_setting_append_vprintf( + sbp_msg_settings_read_resp_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_append_vprintf( + &msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, fmt, ap); } -const char *sbp_msg_settings_read_resp_setting_get_section(const sbp_msg_settings_read_resp_t *msg, size_t section) -{ - return sbp_multipart_string_get_section(&msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, section); +const char *sbp_msg_settings_read_resp_setting_get_section( + const sbp_msg_settings_read_resp_t *msg, size_t section) { + return sbp_multipart_string_get_section( + &msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, section); } -size_t sbp_msg_settings_read_resp_setting_section_strlen(const sbp_msg_settings_read_resp_t *msg, size_t section) -{ - return sbp_multipart_string_section_strlen(&msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, section); +size_t sbp_msg_settings_read_resp_setting_section_strlen( + const sbp_msg_settings_read_resp_t *msg, size_t section) { + return sbp_multipart_string_section_strlen( + &msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, section); } -bool sbp_msg_settings_read_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_resp_t *msg) -{ - if (!sbp_multipart_string_encode(&msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, ctx)) { return false; } +bool sbp_msg_settings_read_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_resp_t *msg) { + if (!sbp_multipart_string_encode( + &msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_settings_read_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_resp_t *msg) { +s8 sbp_msg_settings_read_resp_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_settings_read_resp_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -583,13 +703,18 @@ s8 sbp_msg_settings_read_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_writt return SBP_OK; } -bool sbp_msg_settings_read_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_read_resp_t *msg) -{ - if (!sbp_multipart_string_decode(&msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, ctx)) { return false; } +bool sbp_msg_settings_read_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_read_resp_t *msg) { + if (!sbp_multipart_string_decode( + &msg->setting, SBP_MSG_SETTINGS_READ_RESP_SETTING_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_settings_read_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_resp_t *msg) { +s8 sbp_msg_settings_read_resp_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_settings_read_resp_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -603,31 +728,42 @@ s8 sbp_msg_settings_read_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } - -s8 sbp_msg_settings_read_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_read_resp_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_settings_read_resp_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_settings_read_resp_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_settings_read_resp_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SETTINGS_READ_RESP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_settings_read_resp_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SETTINGS_READ_RESP, sender_id, payload_len, + payload, write); } -int sbp_msg_settings_read_resp_cmp(const sbp_msg_settings_read_resp_t *a, const sbp_msg_settings_read_resp_t *b) { +int sbp_msg_settings_read_resp_cmp(const sbp_msg_settings_read_resp_t *a, + const sbp_msg_settings_read_resp_t *b) { int ret = 0; - + ret = sbp_msg_settings_read_resp_setting_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_settings_read_by_index_req_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_by_index_req_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->index)) { return false; } +bool sbp_msg_settings_read_by_index_req_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_by_index_req_t *msg) { + if (!sbp_u16_encode(ctx, &msg->index)) { + return false; + } return true; } -s8 sbp_msg_settings_read_by_index_req_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_by_index_req_t *msg) { +s8 sbp_msg_settings_read_by_index_req_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_read_by_index_req_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -641,13 +777,17 @@ s8 sbp_msg_settings_read_by_index_req_encode(uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } -bool sbp_msg_settings_read_by_index_req_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_read_by_index_req_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->index)) { return false; } +bool sbp_msg_settings_read_by_index_req_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_read_by_index_req_t *msg) { + if (!sbp_u16_decode(ctx, &msg->index)) { + return false; + } return true; } -s8 sbp_msg_settings_read_by_index_req_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_by_index_req_t *msg) { +s8 sbp_msg_settings_read_by_index_req_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_read_by_index_req_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -661,109 +801,140 @@ s8 sbp_msg_settings_read_by_index_req_decode(const uint8_t *buf, uint8_t len, ui return SBP_OK; } - -s8 sbp_msg_settings_read_by_index_req_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_read_by_index_req_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_settings_read_by_index_req_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_settings_read_by_index_req_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_settings_read_by_index_req_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SETTINGS_READ_BY_INDEX_REQ, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_settings_read_by_index_req_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SETTINGS_READ_BY_INDEX_REQ, sender_id, + payload_len, payload, write); } -int sbp_msg_settings_read_by_index_req_cmp(const sbp_msg_settings_read_by_index_req_t *a, const sbp_msg_settings_read_by_index_req_t *b) { +int sbp_msg_settings_read_by_index_req_cmp( + const sbp_msg_settings_read_by_index_req_t *a, + const sbp_msg_settings_read_by_index_req_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->index, &b->index); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_settings_read_by_index_resp_setting_init(sbp_msg_settings_read_by_index_resp_t *msg) -{ +void sbp_msg_settings_read_by_index_resp_setting_init( + sbp_msg_settings_read_by_index_resp_t *msg) { sbp_multipart_string_init(&msg->setting); } -bool sbp_msg_settings_read_by_index_resp_setting_valid(const sbp_msg_settings_read_by_index_resp_t *msg) -{ - return sbp_multipart_string_valid(&msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX); +bool sbp_msg_settings_read_by_index_resp_setting_valid( + const sbp_msg_settings_read_by_index_resp_t *msg) { + return sbp_multipart_string_valid( + &msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX); } -int sbp_msg_settings_read_by_index_resp_setting_strcmp(const sbp_msg_settings_read_by_index_resp_t *a, const sbp_msg_settings_read_by_index_resp_t *b) -{ - return sbp_multipart_string_strcmp(&a->setting, &b->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX); +int sbp_msg_settings_read_by_index_resp_setting_strcmp( + const sbp_msg_settings_read_by_index_resp_t *a, + const sbp_msg_settings_read_by_index_resp_t *b) { + return sbp_multipart_string_strcmp( + &a->setting, &b->setting, + SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX); } -size_t sbp_msg_settings_read_by_index_resp_setting_encoded_len(const sbp_msg_settings_read_by_index_resp_t *msg) -{ - return sbp_multipart_string_encoded_len(&msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX); +size_t sbp_msg_settings_read_by_index_resp_setting_encoded_len( + const sbp_msg_settings_read_by_index_resp_t *msg) { + return sbp_multipart_string_encoded_len( + &msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX); } -size_t sbp_msg_settings_read_by_index_resp_setting_space_remaining(const sbp_msg_settings_read_by_index_resp_t *msg) -{ - return sbp_multipart_string_space_remaining(&msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX); +size_t sbp_msg_settings_read_by_index_resp_setting_space_remaining( + const sbp_msg_settings_read_by_index_resp_t *msg) { + return sbp_multipart_string_space_remaining( + &msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX); } -size_t sbp_msg_settings_read_by_index_resp_setting_count_sections(const sbp_msg_settings_read_by_index_resp_t *msg) -{ - return sbp_multipart_string_count_sections(&msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX); +size_t sbp_msg_settings_read_by_index_resp_setting_count_sections( + const sbp_msg_settings_read_by_index_resp_t *msg) { + return sbp_multipart_string_count_sections( + &msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX); } -bool sbp_msg_settings_read_by_index_resp_setting_add_section(sbp_msg_settings_read_by_index_resp_t *msg, const char *new_str) -{ - return sbp_multipart_string_add_section(&msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, new_str); +bool sbp_msg_settings_read_by_index_resp_setting_add_section( + sbp_msg_settings_read_by_index_resp_t *msg, const char *new_str) { + return sbp_multipart_string_add_section( + &msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, new_str); } -bool sbp_msg_settings_read_by_index_resp_setting_add_section_printf(sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, ...) -{ +bool sbp_msg_settings_read_by_index_resp_setting_add_section_printf( + sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_add_section_vprintf(&msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, fmt, ap); + bool ret = sbp_multipart_string_add_section_vprintf( + &msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_settings_read_by_index_resp_setting_add_section_vprintf(sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_add_section_vprintf(&msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, fmt, ap); +bool sbp_msg_settings_read_by_index_resp_setting_add_section_vprintf( + sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_add_section_vprintf( + &msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, fmt, ap); } -bool sbp_msg_settings_read_by_index_resp_setting_append(sbp_msg_settings_read_by_index_resp_t *msg, const char *str) -{ - return sbp_multipart_string_append(&msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, str); +bool sbp_msg_settings_read_by_index_resp_setting_append( + sbp_msg_settings_read_by_index_resp_t *msg, const char *str) { + return sbp_multipart_string_append( + &msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, str); } -bool sbp_msg_settings_read_by_index_resp_setting_append_printf(sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, ...) -{ +bool sbp_msg_settings_read_by_index_resp_setting_append_printf( + sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_append_vprintf(&msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, fmt, ap); + bool ret = sbp_multipart_string_append_vprintf( + &msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_settings_read_by_index_resp_setting_append_vprintf(sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_append_vprintf(&msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, fmt, ap); +bool sbp_msg_settings_read_by_index_resp_setting_append_vprintf( + sbp_msg_settings_read_by_index_resp_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_append_vprintf( + &msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, fmt, ap); } -const char *sbp_msg_settings_read_by_index_resp_setting_get_section(const sbp_msg_settings_read_by_index_resp_t *msg, size_t section) -{ - return sbp_multipart_string_get_section(&msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, section); +const char *sbp_msg_settings_read_by_index_resp_setting_get_section( + const sbp_msg_settings_read_by_index_resp_t *msg, size_t section) { + return sbp_multipart_string_get_section( + &msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, section); } -size_t sbp_msg_settings_read_by_index_resp_setting_section_strlen(const sbp_msg_settings_read_by_index_resp_t *msg, size_t section) -{ - return sbp_multipart_string_section_strlen(&msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, section); +size_t sbp_msg_settings_read_by_index_resp_setting_section_strlen( + const sbp_msg_settings_read_by_index_resp_t *msg, size_t section) { + return sbp_multipart_string_section_strlen( + &msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, section); } -bool sbp_msg_settings_read_by_index_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_by_index_resp_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->index)) { return false; } - if (!sbp_multipart_string_encode(&msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, ctx)) { return false; } +bool sbp_msg_settings_read_by_index_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_by_index_resp_t *msg) { + if (!sbp_u16_encode(ctx, &msg->index)) { + return false; + } + if (!sbp_multipart_string_encode( + &msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, + ctx)) { + return false; + } return true; } -s8 sbp_msg_settings_read_by_index_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_by_index_resp_t *msg) { +s8 sbp_msg_settings_read_by_index_resp_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_read_by_index_resp_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -777,14 +948,22 @@ s8 sbp_msg_settings_read_by_index_resp_encode(uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } -bool sbp_msg_settings_read_by_index_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_read_by_index_resp_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->index)) { return false; } - if (!sbp_multipart_string_decode(&msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, ctx)) { return false; } +bool sbp_msg_settings_read_by_index_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_read_by_index_resp_t *msg) { + if (!sbp_u16_decode(ctx, &msg->index)) { + return false; + } + if (!sbp_multipart_string_decode( + &msg->setting, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP_SETTING_MAX, + ctx)) { + return false; + } return true; } -s8 sbp_msg_settings_read_by_index_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_by_index_resp_t *msg) { +s8 sbp_msg_settings_read_by_index_resp_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_read_by_index_resp_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -798,35 +977,47 @@ s8 sbp_msg_settings_read_by_index_resp_decode(const uint8_t *buf, uint8_t len, u return SBP_OK; } - -s8 sbp_msg_settings_read_by_index_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_read_by_index_resp_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_settings_read_by_index_resp_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_settings_read_by_index_resp_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_settings_read_by_index_resp_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_settings_read_by_index_resp_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SETTINGS_READ_BY_INDEX_RESP, sender_id, + payload_len, payload, write); } -int sbp_msg_settings_read_by_index_resp_cmp(const sbp_msg_settings_read_by_index_resp_t *a, const sbp_msg_settings_read_by_index_resp_t *b) { +int sbp_msg_settings_read_by_index_resp_cmp( + const sbp_msg_settings_read_by_index_resp_t *a, + const sbp_msg_settings_read_by_index_resp_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->index, &b->index); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_settings_read_by_index_resp_setting_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_settings_read_by_index_done_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_by_index_done_t *msg) -{ +bool sbp_msg_settings_read_by_index_done_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_read_by_index_done_t *msg) { (void)ctx; (void)msg; return true; } -s8 sbp_msg_settings_read_by_index_done_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_read_by_index_done_t *msg) { +s8 sbp_msg_settings_read_by_index_done_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_read_by_index_done_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -840,14 +1031,16 @@ s8 sbp_msg_settings_read_by_index_done_encode(uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } -bool sbp_msg_settings_read_by_index_done_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_read_by_index_done_t *msg) -{ - (void)ctx; +bool sbp_msg_settings_read_by_index_done_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_read_by_index_done_t *msg) { + (void)ctx; (void)msg; return true; } -s8 sbp_msg_settings_read_by_index_done_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_read_by_index_done_t *msg) { +s8 sbp_msg_settings_read_by_index_done_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_read_by_index_done_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -861,107 +1054,131 @@ s8 sbp_msg_settings_read_by_index_done_decode(const uint8_t *buf, uint8_t len, u return SBP_OK; } - -s8 sbp_msg_settings_read_by_index_done_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_read_by_index_done_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_settings_read_by_index_done_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_settings_read_by_index_done_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_settings_read_by_index_done_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SETTINGS_READ_BY_INDEX_DONE, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_settings_read_by_index_done_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SETTINGS_READ_BY_INDEX_DONE, sender_id, + payload_len, payload, write); } -int sbp_msg_settings_read_by_index_done_cmp(const sbp_msg_settings_read_by_index_done_t *a, const sbp_msg_settings_read_by_index_done_t *b) { +int sbp_msg_settings_read_by_index_done_cmp( + const sbp_msg_settings_read_by_index_done_t *a, + const sbp_msg_settings_read_by_index_done_t *b) { (void)a; (void)b; int ret = 0; return ret; } -void sbp_msg_settings_register_setting_init(sbp_msg_settings_register_t *msg) -{ +void sbp_msg_settings_register_setting_init(sbp_msg_settings_register_t *msg) { sbp_multipart_string_init(&msg->setting); } -bool sbp_msg_settings_register_setting_valid(const sbp_msg_settings_register_t *msg) -{ - return sbp_multipart_string_valid(&msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX); +bool sbp_msg_settings_register_setting_valid( + const sbp_msg_settings_register_t *msg) { + return sbp_multipart_string_valid(&msg->setting, + SBP_MSG_SETTINGS_REGISTER_SETTING_MAX); } -int sbp_msg_settings_register_setting_strcmp(const sbp_msg_settings_register_t *a, const sbp_msg_settings_register_t *b) -{ - return sbp_multipart_string_strcmp(&a->setting, &b->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX); +int sbp_msg_settings_register_setting_strcmp( + const sbp_msg_settings_register_t *a, + const sbp_msg_settings_register_t *b) { + return sbp_multipart_string_strcmp(&a->setting, &b->setting, + SBP_MSG_SETTINGS_REGISTER_SETTING_MAX); } -size_t sbp_msg_settings_register_setting_encoded_len(const sbp_msg_settings_register_t *msg) -{ - return sbp_multipart_string_encoded_len(&msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX); +size_t sbp_msg_settings_register_setting_encoded_len( + const sbp_msg_settings_register_t *msg) { + return sbp_multipart_string_encoded_len( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX); } -size_t sbp_msg_settings_register_setting_space_remaining(const sbp_msg_settings_register_t *msg) -{ - return sbp_multipart_string_space_remaining(&msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX); +size_t sbp_msg_settings_register_setting_space_remaining( + const sbp_msg_settings_register_t *msg) { + return sbp_multipart_string_space_remaining( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX); } -size_t sbp_msg_settings_register_setting_count_sections(const sbp_msg_settings_register_t *msg) -{ - return sbp_multipart_string_count_sections(&msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX); +size_t sbp_msg_settings_register_setting_count_sections( + const sbp_msg_settings_register_t *msg) { + return sbp_multipart_string_count_sections( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX); } -bool sbp_msg_settings_register_setting_add_section(sbp_msg_settings_register_t *msg, const char *new_str) -{ - return sbp_multipart_string_add_section(&msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, new_str); +bool sbp_msg_settings_register_setting_add_section( + sbp_msg_settings_register_t *msg, const char *new_str) { + return sbp_multipart_string_add_section( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, new_str); } -bool sbp_msg_settings_register_setting_add_section_printf(sbp_msg_settings_register_t *msg, const char *fmt, ...) -{ +bool sbp_msg_settings_register_setting_add_section_printf( + sbp_msg_settings_register_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_add_section_vprintf(&msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, fmt, ap); + bool ret = sbp_multipart_string_add_section_vprintf( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_settings_register_setting_add_section_vprintf(sbp_msg_settings_register_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_add_section_vprintf(&msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, fmt, ap); +bool sbp_msg_settings_register_setting_add_section_vprintf( + sbp_msg_settings_register_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_add_section_vprintf( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, fmt, ap); } -bool sbp_msg_settings_register_setting_append(sbp_msg_settings_register_t *msg, const char *str) -{ - return sbp_multipart_string_append(&msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, str); +bool sbp_msg_settings_register_setting_append(sbp_msg_settings_register_t *msg, + const char *str) { + return sbp_multipart_string_append( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, str); } -bool sbp_msg_settings_register_setting_append_printf(sbp_msg_settings_register_t *msg, const char *fmt, ...) -{ +bool sbp_msg_settings_register_setting_append_printf( + sbp_msg_settings_register_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_append_vprintf(&msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, fmt, ap); + bool ret = sbp_multipart_string_append_vprintf( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_settings_register_setting_append_vprintf(sbp_msg_settings_register_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_append_vprintf(&msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, fmt, ap); +bool sbp_msg_settings_register_setting_append_vprintf( + sbp_msg_settings_register_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_append_vprintf( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, fmt, ap); } -const char *sbp_msg_settings_register_setting_get_section(const sbp_msg_settings_register_t *msg, size_t section) -{ - return sbp_multipart_string_get_section(&msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, section); +const char *sbp_msg_settings_register_setting_get_section( + const sbp_msg_settings_register_t *msg, size_t section) { + return sbp_multipart_string_get_section( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, section); } -size_t sbp_msg_settings_register_setting_section_strlen(const sbp_msg_settings_register_t *msg, size_t section) -{ - return sbp_multipart_string_section_strlen(&msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, section); +size_t sbp_msg_settings_register_setting_section_strlen( + const sbp_msg_settings_register_t *msg, size_t section) { + return sbp_multipart_string_section_strlen( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, section); } -bool sbp_msg_settings_register_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_register_t *msg) -{ - if (!sbp_multipart_string_encode(&msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, ctx)) { return false; } +bool sbp_msg_settings_register_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_register_t *msg) { + if (!sbp_multipart_string_encode( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_settings_register_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_register_t *msg) { +s8 sbp_msg_settings_register_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_settings_register_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -975,13 +1192,18 @@ s8 sbp_msg_settings_register_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_settings_register_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_register_t *msg) -{ - if (!sbp_multipart_string_decode(&msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, ctx)) { return false; } +bool sbp_msg_settings_register_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_register_t *msg) { + if (!sbp_multipart_string_decode( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_SETTING_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_settings_register_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_register_t *msg) { +s8 sbp_msg_settings_register_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_settings_register_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -995,109 +1217,137 @@ s8 sbp_msg_settings_register_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_settings_register_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_register_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_settings_register_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_settings_register_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_settings_register_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SETTINGS_REGISTER, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_settings_register_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SETTINGS_REGISTER, sender_id, payload_len, + payload, write); } -int sbp_msg_settings_register_cmp(const sbp_msg_settings_register_t *a, const sbp_msg_settings_register_t *b) { +int sbp_msg_settings_register_cmp(const sbp_msg_settings_register_t *a, + const sbp_msg_settings_register_t *b) { int ret = 0; - + ret = sbp_msg_settings_register_setting_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_settings_register_resp_setting_init(sbp_msg_settings_register_resp_t *msg) -{ +void sbp_msg_settings_register_resp_setting_init( + sbp_msg_settings_register_resp_t *msg) { sbp_multipart_string_init(&msg->setting); } -bool sbp_msg_settings_register_resp_setting_valid(const sbp_msg_settings_register_resp_t *msg) -{ - return sbp_multipart_string_valid(&msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX); +bool sbp_msg_settings_register_resp_setting_valid( + const sbp_msg_settings_register_resp_t *msg) { + return sbp_multipart_string_valid(&msg->setting, + SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX); } -int sbp_msg_settings_register_resp_setting_strcmp(const sbp_msg_settings_register_resp_t *a, const sbp_msg_settings_register_resp_t *b) -{ - return sbp_multipart_string_strcmp(&a->setting, &b->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX); +int sbp_msg_settings_register_resp_setting_strcmp( + const sbp_msg_settings_register_resp_t *a, + const sbp_msg_settings_register_resp_t *b) { + return sbp_multipart_string_strcmp( + &a->setting, &b->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX); } -size_t sbp_msg_settings_register_resp_setting_encoded_len(const sbp_msg_settings_register_resp_t *msg) -{ - return sbp_multipart_string_encoded_len(&msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX); +size_t sbp_msg_settings_register_resp_setting_encoded_len( + const sbp_msg_settings_register_resp_t *msg) { + return sbp_multipart_string_encoded_len( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX); } -size_t sbp_msg_settings_register_resp_setting_space_remaining(const sbp_msg_settings_register_resp_t *msg) -{ - return sbp_multipart_string_space_remaining(&msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX); +size_t sbp_msg_settings_register_resp_setting_space_remaining( + const sbp_msg_settings_register_resp_t *msg) { + return sbp_multipart_string_space_remaining( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX); } -size_t sbp_msg_settings_register_resp_setting_count_sections(const sbp_msg_settings_register_resp_t *msg) -{ - return sbp_multipart_string_count_sections(&msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX); +size_t sbp_msg_settings_register_resp_setting_count_sections( + const sbp_msg_settings_register_resp_t *msg) { + return sbp_multipart_string_count_sections( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX); } -bool sbp_msg_settings_register_resp_setting_add_section(sbp_msg_settings_register_resp_t *msg, const char *new_str) -{ - return sbp_multipart_string_add_section(&msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, new_str); +bool sbp_msg_settings_register_resp_setting_add_section( + sbp_msg_settings_register_resp_t *msg, const char *new_str) { + return sbp_multipart_string_add_section( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, new_str); } -bool sbp_msg_settings_register_resp_setting_add_section_printf(sbp_msg_settings_register_resp_t *msg, const char *fmt, ...) -{ +bool sbp_msg_settings_register_resp_setting_add_section_printf( + sbp_msg_settings_register_resp_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_add_section_vprintf(&msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, fmt, ap); + bool ret = sbp_multipart_string_add_section_vprintf( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_settings_register_resp_setting_add_section_vprintf(sbp_msg_settings_register_resp_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_add_section_vprintf(&msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, fmt, ap); +bool sbp_msg_settings_register_resp_setting_add_section_vprintf( + sbp_msg_settings_register_resp_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_add_section_vprintf( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, fmt, ap); } -bool sbp_msg_settings_register_resp_setting_append(sbp_msg_settings_register_resp_t *msg, const char *str) -{ - return sbp_multipart_string_append(&msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, str); +bool sbp_msg_settings_register_resp_setting_append( + sbp_msg_settings_register_resp_t *msg, const char *str) { + return sbp_multipart_string_append( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, str); } -bool sbp_msg_settings_register_resp_setting_append_printf(sbp_msg_settings_register_resp_t *msg, const char *fmt, ...) -{ +bool sbp_msg_settings_register_resp_setting_append_printf( + sbp_msg_settings_register_resp_t *msg, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_multipart_string_append_vprintf(&msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, fmt, ap); + bool ret = sbp_multipart_string_append_vprintf( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, fmt, ap); va_end(ap); return ret; } -bool sbp_msg_settings_register_resp_setting_append_vprintf(sbp_msg_settings_register_resp_t *msg, const char *fmt, va_list ap) -{ - return sbp_multipart_string_append_vprintf(&msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, fmt, ap); +bool sbp_msg_settings_register_resp_setting_append_vprintf( + sbp_msg_settings_register_resp_t *msg, const char *fmt, va_list ap) { + return sbp_multipart_string_append_vprintf( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, fmt, ap); } -const char *sbp_msg_settings_register_resp_setting_get_section(const sbp_msg_settings_register_resp_t *msg, size_t section) -{ - return sbp_multipart_string_get_section(&msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, section); +const char *sbp_msg_settings_register_resp_setting_get_section( + const sbp_msg_settings_register_resp_t *msg, size_t section) { + return sbp_multipart_string_get_section( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, section); } -size_t sbp_msg_settings_register_resp_setting_section_strlen(const sbp_msg_settings_register_resp_t *msg, size_t section) -{ - return sbp_multipart_string_section_strlen(&msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, section); +size_t sbp_msg_settings_register_resp_setting_section_strlen( + const sbp_msg_settings_register_resp_t *msg, size_t section) { + return sbp_multipart_string_section_strlen( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, section); } -bool sbp_msg_settings_register_resp_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_settings_register_resp_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->status)) { return false; } - if (!sbp_multipart_string_encode(&msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, ctx)) { return false; } +bool sbp_msg_settings_register_resp_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_settings_register_resp_t *msg) { + if (!sbp_u8_encode(ctx, &msg->status)) { + return false; + } + if (!sbp_multipart_string_encode( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_settings_register_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_settings_register_resp_t *msg) { +s8 sbp_msg_settings_register_resp_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_settings_register_resp_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1111,14 +1361,21 @@ s8 sbp_msg_settings_register_resp_encode(uint8_t *buf, uint8_t len, uint8_t *n_w return SBP_OK; } -bool sbp_msg_settings_register_resp_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_settings_register_resp_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->status)) { return false; } - if (!sbp_multipart_string_decode(&msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, ctx)) { return false; } +bool sbp_msg_settings_register_resp_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_settings_register_resp_t *msg) { + if (!sbp_u8_decode(ctx, &msg->status)) { + return false; + } + if (!sbp_multipart_string_decode( + &msg->setting, SBP_MSG_SETTINGS_REGISTER_RESP_SETTING_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_settings_register_resp_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_settings_register_resp_t *msg) { +s8 sbp_msg_settings_register_resp_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_settings_register_resp_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1132,23 +1389,33 @@ s8 sbp_msg_settings_register_resp_decode(const uint8_t *buf, uint8_t len, uint8_ return SBP_OK; } - -s8 sbp_msg_settings_register_resp_send(sbp_state_t *s, u16 sender_id, const sbp_msg_settings_register_resp_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_settings_register_resp_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_settings_register_resp_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_settings_register_resp_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SETTINGS_REGISTER_RESP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_settings_register_resp_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SETTINGS_REGISTER_RESP, sender_id, + payload_len, payload, write); } -int sbp_msg_settings_register_resp_cmp(const sbp_msg_settings_register_resp_t *a, const sbp_msg_settings_register_resp_t *b) { +int sbp_msg_settings_register_resp_cmp( + const sbp_msg_settings_register_resp_t *a, + const sbp_msg_settings_register_resp_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->status, &b->status); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_settings_register_resp_setting_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/signing.c b/c/src/signing.c index 6550de6ee..50b5fa4fd 100644 --- a/c/src/signing.c +++ b/c/src/signing.c @@ -3,33 +3,48 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include +#include #include +#include #include #include -#include #include +#include +#include -bool sbp_utc_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_utc_time_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->year)) { return false; } - if (!sbp_u8_encode(ctx, &msg->month)) { return false; } - if (!sbp_u8_encode(ctx, &msg->day)) { return false; } - if (!sbp_u8_encode(ctx, &msg->hours)) { return false; } - if (!sbp_u8_encode(ctx, &msg->minutes)) { return false; } - if (!sbp_u8_encode(ctx, &msg->seconds)) { return false; } - if (!sbp_u32_encode(ctx, &msg->ns)) { return false; } +bool sbp_utc_time_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_utc_time_t *msg) { + if (!sbp_u16_encode(ctx, &msg->year)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->month)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->day)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->hours)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->minutes)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->seconds)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->ns)) { + return false; + } return true; } -s8 sbp_utc_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_utc_time_t *msg) { +s8 sbp_utc_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_utc_time_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -43,19 +58,33 @@ s8 sbp_utc_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_ return SBP_OK; } -bool sbp_utc_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_utc_time_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->year)) { return false; } - if (!sbp_u8_decode(ctx, &msg->month)) { return false; } - if (!sbp_u8_decode(ctx, &msg->day)) { return false; } - if (!sbp_u8_decode(ctx, &msg->hours)) { return false; } - if (!sbp_u8_decode(ctx, &msg->minutes)) { return false; } - if (!sbp_u8_decode(ctx, &msg->seconds)) { return false; } - if (!sbp_u32_decode(ctx, &msg->ns)) { return false; } +bool sbp_utc_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_utc_time_t *msg) { + if (!sbp_u16_decode(ctx, &msg->year)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->month)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->day)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->hours)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->minutes)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->seconds)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->ns)) { + return false; + } return true; } -s8 sbp_utc_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_utc_time_t *msg) { +s8 sbp_utc_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_utc_time_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -69,45 +98,61 @@ s8 sbp_utc_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_utc return SBP_OK; } - - int sbp_utc_time_cmp(const sbp_utc_time_t *a, const sbp_utc_time_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->year, &b->year); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->month, &b->month); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->day, &b->day); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->hours, &b->hours); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->minutes, &b->minutes); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->seconds, &b->seconds); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->ns, &b->ns); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_ecdsa_signature_encode_internal(sbp_encode_ctx_t *ctx, const sbp_ecdsa_signature_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->len)) { return false; } - for (size_t i = 0; i < SBP_ECDSA_SIGNATURE_DATA_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->data[i])) { return false; } +bool sbp_ecdsa_signature_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_ecdsa_signature_t *msg) { + if (!sbp_u8_encode(ctx, &msg->len)) { + return false; + } + for (size_t i = 0; i < SBP_ECDSA_SIGNATURE_DATA_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->data[i])) { + return false; + } } return true; } -s8 sbp_ecdsa_signature_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_ecdsa_signature_t *msg) { +s8 sbp_ecdsa_signature_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_ecdsa_signature_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -121,16 +166,21 @@ s8 sbp_ecdsa_signature_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, con return SBP_OK; } -bool sbp_ecdsa_signature_decode_internal(sbp_decode_ctx_t *ctx, sbp_ecdsa_signature_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->len)) { return false; } +bool sbp_ecdsa_signature_decode_internal(sbp_decode_ctx_t *ctx, + sbp_ecdsa_signature_t *msg) { + if (!sbp_u8_decode(ctx, &msg->len)) { + return false; + } for (uint8_t i = 0; i < SBP_ECDSA_SIGNATURE_DATA_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->data[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->data[i])) { + return false; + } } return true; } -s8 sbp_ecdsa_signature_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ecdsa_signature_t *msg) { +s8 sbp_ecdsa_signature_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_ecdsa_signature_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -144,38 +194,48 @@ s8 sbp_ecdsa_signature_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - - -int sbp_ecdsa_signature_cmp(const sbp_ecdsa_signature_t *a, const sbp_ecdsa_signature_t *b) { +int sbp_ecdsa_signature_cmp(const sbp_ecdsa_signature_t *a, + const sbp_ecdsa_signature_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->len, &b->len); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_ECDSA_SIGNATURE_DATA_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_ECDSA_SIGNATURE_DATA_MAX; i++) { ret = sbp_u8_cmp(&a->data[i], &b->data[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ecdsa_certificate_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_certificate_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->n_msg)) { return false; } - for (size_t i = 0; i < SBP_MSG_ECDSA_CERTIFICATE_CERTIFICATE_ID_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->certificate_id[i])) { return false; } +bool sbp_msg_ecdsa_certificate_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_certificate_t *msg) { + if (!sbp_u8_encode(ctx, &msg->n_msg)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_ECDSA_CERTIFICATE_CERTIFICATE_ID_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->certificate_id[i])) { + return false; + } } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } - for (size_t i = 0; i < msg->n_certificate_bytes; i++) - { - if (!sbp_u8_encode(ctx, &msg->certificate_bytes[i])) { return false; } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } + for (size_t i = 0; i < msg->n_certificate_bytes; i++) { + if (!sbp_u8_encode(ctx, &msg->certificate_bytes[i])) { + return false; + } } return true; } -s8 sbp_msg_ecdsa_certificate_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ecdsa_certificate_t *msg) { +s8 sbp_msg_ecdsa_certificate_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_ecdsa_certificate_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -189,24 +249,35 @@ s8 sbp_msg_ecdsa_certificate_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_ecdsa_certificate_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_certificate_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->n_msg)) { return false; } - for (uint8_t i = 0; i < SBP_MSG_ECDSA_CERTIFICATE_CERTIFICATE_ID_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->certificate_id[i])) { return false; } +bool sbp_msg_ecdsa_certificate_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_certificate_t *msg) { + if (!sbp_u8_decode(ctx, &msg->n_msg)) { + return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + for (uint8_t i = 0; i < SBP_MSG_ECDSA_CERTIFICATE_CERTIFICATE_ID_MAX; i++) { + if (!sbp_u8_decode(ctx, &msg->certificate_id[i])) { return false; } - msg->n_certificate_bytes = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); - for (uint8_t i = 0; i < msg->n_certificate_bytes; i++) { - if (!sbp_u8_decode(ctx, &msg->certificate_bytes[i])) { return false; } + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + return false; + } + msg->n_certificate_bytes = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->n_certificate_bytes; i++) { + if (!sbp_u8_decode(ctx, &msg->certificate_bytes[i])) { + return false; } + } return true; } -s8 sbp_msg_ecdsa_certificate_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ecdsa_certificate_t *msg) { +s8 sbp_msg_ecdsa_certificate_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ecdsa_certificate_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -220,60 +291,83 @@ s8 sbp_msg_ecdsa_certificate_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_ecdsa_certificate_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_certificate_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ecdsa_certificate_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ecdsa_certificate_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ecdsa_certificate_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ECDSA_CERTIFICATE, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ecdsa_certificate_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ECDSA_CERTIFICATE, sender_id, payload_len, + payload, write); } -int sbp_msg_ecdsa_certificate_cmp(const sbp_msg_ecdsa_certificate_t *a, const sbp_msg_ecdsa_certificate_t *b) { +int sbp_msg_ecdsa_certificate_cmp(const sbp_msg_ecdsa_certificate_t *a, + const sbp_msg_ecdsa_certificate_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->n_msg, &b->n_msg); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_ECDSA_CERTIFICATE_CERTIFICATE_ID_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_ECDSA_CERTIFICATE_CERTIFICATE_ID_MAX; i++) { ret = sbp_u8_cmp(&a->certificate_id[i], &b->certificate_id[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_certificate_bytes, &b->n_certificate_bytes); - for (uint8_t i = 0; ret == 0 && i < a->n_certificate_bytes; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_certificate_bytes; i++) { ret = sbp_u8_cmp(&a->certificate_bytes[i], &b->certificate_bytes[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_certificate_chain_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_certificate_chain_t *msg) -{ - for (size_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_ROOT_CERTIFICATE_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->root_certificate[i])) { return false; } +bool sbp_msg_certificate_chain_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_certificate_chain_t *msg) { + for (size_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_ROOT_CERTIFICATE_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->root_certificate[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_INTERMEDIATE_CERTIFICATE_MAX; + i++) { + if (!sbp_u8_encode(ctx, &msg->intermediate_certificate[i])) { + return false; + } } - for (size_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_INTERMEDIATE_CERTIFICATE_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->intermediate_certificate[i])) { return false; } + for (size_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_CORRECTIONS_CERTIFICATE_MAX; + i++) { + if (!sbp_u8_encode(ctx, &msg->corrections_certificate[i])) { + return false; + } } - for (size_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_CORRECTIONS_CERTIFICATE_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->corrections_certificate[i])) { return false; } + if (!sbp_utc_time_encode_internal(ctx, &msg->expiration)) { + return false; + } + if (!sbp_ecdsa_signature_encode_internal(ctx, &msg->signature)) { + return false; } - if (!sbp_utc_time_encode_internal(ctx, &msg->expiration)) { return false; } - if (!sbp_ecdsa_signature_encode_internal(ctx, &msg->signature)) { return false; } return true; } -s8 sbp_msg_certificate_chain_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_certificate_chain_t *msg) { +s8 sbp_msg_certificate_chain_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_certificate_chain_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -287,23 +381,37 @@ s8 sbp_msg_certificate_chain_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_certificate_chain_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_certificate_chain_t *msg) -{ +bool sbp_msg_certificate_chain_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_certificate_chain_t *msg) { for (uint8_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_ROOT_CERTIFICATE_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->root_certificate[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->root_certificate[i])) { + return false; + } } - for (uint8_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_INTERMEDIATE_CERTIFICATE_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->intermediate_certificate[i])) { return false; } + for (uint8_t i = 0; + i < SBP_MSG_CERTIFICATE_CHAIN_INTERMEDIATE_CERTIFICATE_MAX; i++) { + if (!sbp_u8_decode(ctx, &msg->intermediate_certificate[i])) { + return false; + } } - for (uint8_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_CORRECTIONS_CERTIFICATE_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->corrections_certificate[i])) { return false; } + for (uint8_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_CORRECTIONS_CERTIFICATE_MAX; + i++) { + if (!sbp_u8_decode(ctx, &msg->corrections_certificate[i])) { + return false; + } + } + if (!sbp_utc_time_decode_internal(ctx, &msg->expiration)) { + return false; + } + if (!sbp_ecdsa_signature_decode_internal(ctx, &msg->signature)) { + return false; } - if (!sbp_utc_time_decode_internal(ctx, &msg->expiration)) { return false; } - if (!sbp_ecdsa_signature_decode_internal(ctx, &msg->signature)) { return false; } return true; } -s8 sbp_msg_certificate_chain_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_certificate_chain_t *msg) { +s8 sbp_msg_certificate_chain_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_certificate_chain_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -317,68 +425,98 @@ s8 sbp_msg_certificate_chain_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_certificate_chain_send(sbp_state_t *s, u16 sender_id, const sbp_msg_certificate_chain_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_certificate_chain_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_certificate_chain_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_certificate_chain_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_CERTIFICATE_CHAIN, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_certificate_chain_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_CERTIFICATE_CHAIN, sender_id, payload_len, + payload, write); } -int sbp_msg_certificate_chain_cmp(const sbp_msg_certificate_chain_t *a, const sbp_msg_certificate_chain_t *b) { +int sbp_msg_certificate_chain_cmp(const sbp_msg_certificate_chain_t *a, + const sbp_msg_certificate_chain_t *b) { int ret = 0; - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_CERTIFICATE_CHAIN_ROOT_CERTIFICATE_MAX; i++) - { + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_CERTIFICATE_CHAIN_ROOT_CERTIFICATE_MAX; i++) { ret = sbp_u8_cmp(&a->root_certificate[i], &b->root_certificate[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_CERTIFICATE_CHAIN_INTERMEDIATE_CERTIFICATE_MAX; i++) - { - ret = sbp_u8_cmp(&a->intermediate_certificate[i], &b->intermediate_certificate[i]); + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_CERTIFICATE_CHAIN_INTERMEDIATE_CERTIFICATE_MAX; + i++) { + ret = sbp_u8_cmp(&a->intermediate_certificate[i], + &b->intermediate_certificate[i]); + } + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_CERTIFICATE_CHAIN_CORRECTIONS_CERTIFICATE_MAX; + i++) { + ret = sbp_u8_cmp(&a->corrections_certificate[i], + &b->corrections_certificate[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_CERTIFICATE_CHAIN_CORRECTIONS_CERTIFICATE_MAX; i++) - { - ret = sbp_u8_cmp(&a->corrections_certificate[i], &b->corrections_certificate[i]); + if (ret != 0) { + return ret; } - if (ret != 0) { return ret; } - + ret = sbp_utc_time_cmp(&a->expiration, &b->expiration); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_ecdsa_signature_cmp(&a->signature, &b->signature); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_certificate_chain_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_certificate_chain_dep_t *msg) -{ - for (size_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_DEP_ROOT_CERTIFICATE_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->root_certificate[i])) { return false; } +bool sbp_msg_certificate_chain_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_certificate_chain_dep_t *msg) { + for (size_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_DEP_ROOT_CERTIFICATE_MAX; + i++) { + if (!sbp_u8_encode(ctx, &msg->root_certificate[i])) { + return false; + } } - for (size_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_DEP_INTERMEDIATE_CERTIFICATE_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->intermediate_certificate[i])) { return false; } + for (size_t i = 0; + i < SBP_MSG_CERTIFICATE_CHAIN_DEP_INTERMEDIATE_CERTIFICATE_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->intermediate_certificate[i])) { + return false; + } } - for (size_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_DEP_CORRECTIONS_CERTIFICATE_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->corrections_certificate[i])) { return false; } + for (size_t i = 0; + i < SBP_MSG_CERTIFICATE_CHAIN_DEP_CORRECTIONS_CERTIFICATE_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->corrections_certificate[i])) { + return false; + } + } + if (!sbp_utc_time_encode_internal(ctx, &msg->expiration)) { + return false; } - if (!sbp_utc_time_encode_internal(ctx, &msg->expiration)) { return false; } - for (size_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_DEP_SIGNATURE_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->signature[i])) { return false; } + for (size_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_DEP_SIGNATURE_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->signature[i])) { + return false; + } } return true; } -s8 sbp_msg_certificate_chain_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_certificate_chain_dep_t *msg) { +s8 sbp_msg_certificate_chain_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_certificate_chain_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -392,25 +530,40 @@ s8 sbp_msg_certificate_chain_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_wr return SBP_OK; } -bool sbp_msg_certificate_chain_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_certificate_chain_dep_t *msg) -{ - for (uint8_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_DEP_ROOT_CERTIFICATE_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->root_certificate[i])) { return false; } +bool sbp_msg_certificate_chain_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_certificate_chain_dep_t *msg) { + for (uint8_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_DEP_ROOT_CERTIFICATE_MAX; + i++) { + if (!sbp_u8_decode(ctx, &msg->root_certificate[i])) { + return false; + } + } + for (uint8_t i = 0; + i < SBP_MSG_CERTIFICATE_CHAIN_DEP_INTERMEDIATE_CERTIFICATE_MAX; i++) { + if (!sbp_u8_decode(ctx, &msg->intermediate_certificate[i])) { + return false; + } } - for (uint8_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_DEP_INTERMEDIATE_CERTIFICATE_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->intermediate_certificate[i])) { return false; } + for (uint8_t i = 0; + i < SBP_MSG_CERTIFICATE_CHAIN_DEP_CORRECTIONS_CERTIFICATE_MAX; i++) { + if (!sbp_u8_decode(ctx, &msg->corrections_certificate[i])) { + return false; + } } - for (uint8_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_DEP_CORRECTIONS_CERTIFICATE_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->corrections_certificate[i])) { return false; } + if (!sbp_utc_time_decode_internal(ctx, &msg->expiration)) { + return false; } - if (!sbp_utc_time_decode_internal(ctx, &msg->expiration)) { return false; } for (uint8_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_DEP_SIGNATURE_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->signature[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->signature[i])) { + return false; + } } return true; } -s8 sbp_msg_certificate_chain_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_certificate_chain_dep_t *msg) { +s8 sbp_msg_certificate_chain_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_certificate_chain_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -424,66 +577,100 @@ s8 sbp_msg_certificate_chain_dep_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_certificate_chain_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_certificate_chain_dep_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_certificate_chain_dep_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_certificate_chain_dep_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_certificate_chain_dep_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_CERTIFICATE_CHAIN_DEP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_certificate_chain_dep_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_CERTIFICATE_CHAIN_DEP, sender_id, + payload_len, payload, write); } -int sbp_msg_certificate_chain_dep_cmp(const sbp_msg_certificate_chain_dep_t *a, const sbp_msg_certificate_chain_dep_t *b) { +int sbp_msg_certificate_chain_dep_cmp( + const sbp_msg_certificate_chain_dep_t *a, + const sbp_msg_certificate_chain_dep_t *b) { int ret = 0; - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_CERTIFICATE_CHAIN_DEP_ROOT_CERTIFICATE_MAX; i++) - { + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_CERTIFICATE_CHAIN_DEP_ROOT_CERTIFICATE_MAX; + i++) { ret = sbp_u8_cmp(&a->root_certificate[i], &b->root_certificate[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_CERTIFICATE_CHAIN_DEP_INTERMEDIATE_CERTIFICATE_MAX; i++) - { - ret = sbp_u8_cmp(&a->intermediate_certificate[i], &b->intermediate_certificate[i]); + if (ret != 0) { + return ret; } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_CERTIFICATE_CHAIN_DEP_CORRECTIONS_CERTIFICATE_MAX; i++) - { - ret = sbp_u8_cmp(&a->corrections_certificate[i], &b->corrections_certificate[i]); + + for (uint8_t i = 0; + ret == 0 && + i < SBP_MSG_CERTIFICATE_CHAIN_DEP_INTERMEDIATE_CERTIFICATE_MAX; + i++) { + ret = sbp_u8_cmp(&a->intermediate_certificate[i], + &b->intermediate_certificate[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && + i < SBP_MSG_CERTIFICATE_CHAIN_DEP_CORRECTIONS_CERTIFICATE_MAX; + i++) { + ret = sbp_u8_cmp(&a->corrections_certificate[i], + &b->corrections_certificate[i]); + } + if (ret != 0) { + return ret; + } + ret = sbp_utc_time_cmp(&a->expiration, &b->expiration); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_CERTIFICATE_CHAIN_DEP_SIGNATURE_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_CERTIFICATE_CHAIN_DEP_SIGNATURE_MAX; i++) { ret = sbp_u8_cmp(&a->signature[i], &b->signature[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ecdsa_signature_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->stream_counter)) { return false; } - if (!sbp_u8_encode(ctx, &msg->on_demand_counter)) { return false; } - for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_CERTIFICATE_ID_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->certificate_id[i])) { return false; } +bool sbp_msg_ecdsa_signature_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_t *msg) { + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->stream_counter)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->on_demand_counter)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_CERTIFICATE_ID_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->certificate_id[i])) { + return false; + } + } + if (!sbp_ecdsa_signature_encode_internal(ctx, &msg->signature)) { + return false; } - if (!sbp_ecdsa_signature_encode_internal(ctx, &msg->signature)) { return false; } - for (size_t i = 0; i < msg->n_signed_messages; i++) - { - if (!sbp_u8_encode(ctx, &msg->signed_messages[i])) { return false; } + for (size_t i = 0; i < msg->n_signed_messages; i++) { + if (!sbp_u8_encode(ctx, &msg->signed_messages[i])) { + return false; + } } return true; } -s8 sbp_msg_ecdsa_signature_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ecdsa_signature_t *msg) { +s8 sbp_msg_ecdsa_signature_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ecdsa_signature_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -497,26 +684,41 @@ s8 sbp_msg_ecdsa_signature_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_ecdsa_signature_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->stream_counter)) { return false; } - if (!sbp_u8_decode(ctx, &msg->on_demand_counter)) { return false; } - for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_CERTIFICATE_ID_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->certificate_id[i])) { return false; } +bool sbp_msg_ecdsa_signature_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ecdsa_signature_t *msg) { + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->stream_counter)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->on_demand_counter)) { + return false; } - if (!sbp_ecdsa_signature_decode_internal(ctx, &msg->signature)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_CERTIFICATE_ID_MAX; i++) { + if (!sbp_u8_decode(ctx, &msg->certificate_id[i])) { return false; } - msg->n_signed_messages = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); - for (uint8_t i = 0; i < msg->n_signed_messages; i++) { - if (!sbp_u8_decode(ctx, &msg->signed_messages[i])) { return false; } + } + if (!sbp_ecdsa_signature_decode_internal(ctx, &msg->signature)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + return false; + } + msg->n_signed_messages = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->n_signed_messages; i++) { + if (!sbp_u8_decode(ctx, &msg->signed_messages[i])) { + return false; } + } return true; } -s8 sbp_msg_ecdsa_signature_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ecdsa_signature_t *msg) { +s8 sbp_msg_ecdsa_signature_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ecdsa_signature_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -530,68 +732,98 @@ s8 sbp_msg_ecdsa_signature_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_ecdsa_signature_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_signature_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ecdsa_signature_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ecdsa_signature_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ecdsa_signature_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ECDSA_SIGNATURE, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ecdsa_signature_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ECDSA_SIGNATURE, sender_id, payload_len, + payload, write); } -int sbp_msg_ecdsa_signature_cmp(const sbp_msg_ecdsa_signature_t *a, const sbp_msg_ecdsa_signature_t *b) { +int sbp_msg_ecdsa_signature_cmp(const sbp_msg_ecdsa_signature_t *a, + const sbp_msg_ecdsa_signature_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->stream_counter, &b->stream_counter); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->on_demand_counter, &b->on_demand_counter); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_CERTIFICATE_ID_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_CERTIFICATE_ID_MAX; i++) { ret = sbp_u8_cmp(&a->certificate_id[i], &b->certificate_id[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_ecdsa_signature_cmp(&a->signature, &b->signature); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_signed_messages, &b->n_signed_messages); - for (uint8_t i = 0; ret == 0 && i < a->n_signed_messages; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_signed_messages; i++) { ret = sbp_u8_cmp(&a->signed_messages[i], &b->signed_messages[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ecdsa_signature_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_dep_b_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->stream_counter)) { return false; } - if (!sbp_u8_encode(ctx, &msg->on_demand_counter)) { return false; } - for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_CERTIFICATE_ID_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->certificate_id[i])) { return false; } +bool sbp_msg_ecdsa_signature_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_dep_b_t *msg) { + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->stream_counter)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->on_demand_counter)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_CERTIFICATE_ID_MAX; + i++) { + if (!sbp_u8_encode(ctx, &msg->certificate_id[i])) { + return false; + } } - if (!sbp_u8_encode(ctx, &msg->n_signature_bytes)) { return false; } - for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNATURE_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->signature[i])) { return false; } + if (!sbp_u8_encode(ctx, &msg->n_signature_bytes)) { + return false; } - for (size_t i = 0; i < msg->n_signed_messages; i++) - { - if (!sbp_u8_encode(ctx, &msg->signed_messages[i])) { return false; } + for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNATURE_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->signature[i])) { + return false; + } + } + for (size_t i = 0; i < msg->n_signed_messages; i++) { + if (!sbp_u8_encode(ctx, &msg->signed_messages[i])) { + return false; + } } return true; } -s8 sbp_msg_ecdsa_signature_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ecdsa_signature_dep_b_t *msg) { +s8 sbp_msg_ecdsa_signature_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ecdsa_signature_dep_b_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -605,29 +837,47 @@ s8 sbp_msg_ecdsa_signature_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_wr return SBP_OK; } -bool sbp_msg_ecdsa_signature_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_dep_b_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->stream_counter)) { return false; } - if (!sbp_u8_decode(ctx, &msg->on_demand_counter)) { return false; } - for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_CERTIFICATE_ID_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->certificate_id[i])) { return false; } +bool sbp_msg_ecdsa_signature_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_dep_b_t *msg) { + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; } - if (!sbp_u8_decode(ctx, &msg->n_signature_bytes)) { return false; } - for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNATURE_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->signature[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->stream_counter)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->on_demand_counter)) { + return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_CERTIFICATE_ID_MAX; + i++) { + if (!sbp_u8_decode(ctx, &msg->certificate_id[i])) { return false; } - msg->n_signed_messages = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); - for (uint8_t i = 0; i < msg->n_signed_messages; i++) { - if (!sbp_u8_decode(ctx, &msg->signed_messages[i])) { return false; } + } + if (!sbp_u8_decode(ctx, &msg->n_signature_bytes)) { + return false; + } + for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNATURE_MAX; i++) { + if (!sbp_u8_decode(ctx, &msg->signature[i])) { + return false; + } + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + return false; + } + msg->n_signed_messages = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->n_signed_messages; i++) { + if (!sbp_u8_decode(ctx, &msg->signed_messages[i])) { + return false; } + } return true; } -s8 sbp_msg_ecdsa_signature_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ecdsa_signature_dep_b_t *msg) { +s8 sbp_msg_ecdsa_signature_dep_b_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ecdsa_signature_dep_b_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -641,73 +891,104 @@ s8 sbp_msg_ecdsa_signature_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_ecdsa_signature_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_signature_dep_b_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ecdsa_signature_dep_b_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_signature_dep_b_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ecdsa_signature_dep_b_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ECDSA_SIGNATURE_DEP_B, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ecdsa_signature_dep_b_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ECDSA_SIGNATURE_DEP_B, sender_id, + payload_len, payload, write); } -int sbp_msg_ecdsa_signature_dep_b_cmp(const sbp_msg_ecdsa_signature_dep_b_t *a, const sbp_msg_ecdsa_signature_dep_b_t *b) { +int sbp_msg_ecdsa_signature_dep_b_cmp( + const sbp_msg_ecdsa_signature_dep_b_t *a, + const sbp_msg_ecdsa_signature_dep_b_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->stream_counter, &b->stream_counter); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->on_demand_counter, &b->on_demand_counter); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_CERTIFICATE_ID_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_CERTIFICATE_ID_MAX; i++) { ret = sbp_u8_cmp(&a->certificate_id[i], &b->certificate_id[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_signature_bytes, &b->n_signature_bytes); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNATURE_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNATURE_MAX; i++) { ret = sbp_u8_cmp(&a->signature[i], &b->signature[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_signed_messages, &b->n_signed_messages); - for (uint8_t i = 0; ret == 0 && i < a->n_signed_messages; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_signed_messages; i++) { ret = sbp_u8_cmp(&a->signed_messages[i], &b->signed_messages[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ecdsa_signature_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_dep_a_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->stream_counter)) { return false; } - if (!sbp_u8_encode(ctx, &msg->on_demand_counter)) { return false; } - for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_CERTIFICATE_ID_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->certificate_id[i])) { return false; } +bool sbp_msg_ecdsa_signature_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_dep_a_t *msg) { + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->stream_counter)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->on_demand_counter)) { + return false; } - for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNATURE_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->signature[i])) { return false; } + for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_CERTIFICATE_ID_MAX; + i++) { + if (!sbp_u8_encode(ctx, &msg->certificate_id[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNATURE_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->signature[i])) { + return false; + } } - for (size_t i = 0; i < msg->n_signed_messages; i++) - { - if (!sbp_u8_encode(ctx, &msg->signed_messages[i])) { return false; } + for (size_t i = 0; i < msg->n_signed_messages; i++) { + if (!sbp_u8_encode(ctx, &msg->signed_messages[i])) { + return false; + } } return true; } -s8 sbp_msg_ecdsa_signature_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ecdsa_signature_dep_a_t *msg) { +s8 sbp_msg_ecdsa_signature_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ecdsa_signature_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -721,28 +1002,44 @@ s8 sbp_msg_ecdsa_signature_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_wr return SBP_OK; } -bool sbp_msg_ecdsa_signature_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_dep_a_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->stream_counter)) { return false; } - if (!sbp_u8_decode(ctx, &msg->on_demand_counter)) { return false; } - for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_CERTIFICATE_ID_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->certificate_id[i])) { return false; } +bool sbp_msg_ecdsa_signature_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_dep_a_t *msg) { + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; } - for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNATURE_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->signature[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->stream_counter)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->on_demand_counter)) { + return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_CERTIFICATE_ID_MAX; + i++) { + if (!sbp_u8_decode(ctx, &msg->certificate_id[i])) { return false; } - msg->n_signed_messages = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); - for (uint8_t i = 0; i < msg->n_signed_messages; i++) { - if (!sbp_u8_decode(ctx, &msg->signed_messages[i])) { return false; } + } + for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNATURE_MAX; i++) { + if (!sbp_u8_decode(ctx, &msg->signature[i])) { + return false; } + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + return false; + } + msg->n_signed_messages = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->n_signed_messages; i++) { + if (!sbp_u8_decode(ctx, &msg->signed_messages[i])) { + return false; + } + } return true; } -s8 sbp_msg_ecdsa_signature_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ecdsa_signature_dep_a_t *msg) { +s8 sbp_msg_ecdsa_signature_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ecdsa_signature_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -756,64 +1053,87 @@ s8 sbp_msg_ecdsa_signature_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_ecdsa_signature_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_signature_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ecdsa_signature_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_signature_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ecdsa_signature_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ECDSA_SIGNATURE_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ecdsa_signature_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ECDSA_SIGNATURE_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_ecdsa_signature_dep_a_cmp(const sbp_msg_ecdsa_signature_dep_a_t *a, const sbp_msg_ecdsa_signature_dep_a_t *b) { +int sbp_msg_ecdsa_signature_dep_a_cmp( + const sbp_msg_ecdsa_signature_dep_a_t *a, + const sbp_msg_ecdsa_signature_dep_a_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->stream_counter, &b->stream_counter); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->on_demand_counter, &b->on_demand_counter); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_CERTIFICATE_ID_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_CERTIFICATE_ID_MAX; i++) { ret = sbp_u8_cmp(&a->certificate_id[i], &b->certificate_id[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNATURE_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNATURE_MAX; i++) { ret = sbp_u8_cmp(&a->signature[i], &b->signature[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_signed_messages, &b->n_signed_messages); - for (uint8_t i = 0; ret == 0 && i < a->n_signed_messages; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_signed_messages; i++) { ret = sbp_u8_cmp(&a->signed_messages[i], &b->signed_messages[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ed25519_certificate_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ed25519_certificate_dep_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->n_msg)) { return false; } - for (size_t i = 0; i < SBP_MSG_ED25519_CERTIFICATE_DEP_FINGERPRINT_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->fingerprint[i])) { return false; } +bool sbp_msg_ed25519_certificate_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ed25519_certificate_dep_t *msg) { + if (!sbp_u8_encode(ctx, &msg->n_msg)) { + return false; } - for (size_t i = 0; i < msg->n_certificate_bytes; i++) - { - if (!sbp_u8_encode(ctx, &msg->certificate_bytes[i])) { return false; } + for (size_t i = 0; i < SBP_MSG_ED25519_CERTIFICATE_DEP_FINGERPRINT_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->fingerprint[i])) { + return false; + } + } + for (size_t i = 0; i < msg->n_certificate_bytes; i++) { + if (!sbp_u8_encode(ctx, &msg->certificate_bytes[i])) { + return false; + } } return true; } -s8 sbp_msg_ed25519_certificate_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ed25519_certificate_dep_t *msg) { +s8 sbp_msg_ed25519_certificate_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ed25519_certificate_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -827,23 +1147,33 @@ s8 sbp_msg_ed25519_certificate_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } -bool sbp_msg_ed25519_certificate_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ed25519_certificate_dep_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->n_msg)) { return false; } - for (uint8_t i = 0; i < SBP_MSG_ED25519_CERTIFICATE_DEP_FINGERPRINT_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->fingerprint[i])) { return false; } +bool sbp_msg_ed25519_certificate_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ed25519_certificate_dep_t *msg) { + if (!sbp_u8_decode(ctx, &msg->n_msg)) { + return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + for (uint8_t i = 0; i < SBP_MSG_ED25519_CERTIFICATE_DEP_FINGERPRINT_MAX; + i++) { + if (!sbp_u8_decode(ctx, &msg->fingerprint[i])) { return false; } - msg->n_certificate_bytes = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); - for (uint8_t i = 0; i < msg->n_certificate_bytes; i++) { - if (!sbp_u8_decode(ctx, &msg->certificate_bytes[i])) { return false; } + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + return false; + } + msg->n_certificate_bytes = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->n_certificate_bytes; i++) { + if (!sbp_u8_decode(ctx, &msg->certificate_bytes[i])) { + return false; } + } return true; } -s8 sbp_msg_ed25519_certificate_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ed25519_certificate_dep_t *msg) { +s8 sbp_msg_ed25519_certificate_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ed25519_certificate_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -857,55 +1187,71 @@ s8 sbp_msg_ed25519_certificate_dep_decode(const uint8_t *buf, uint8_t len, uint8 return SBP_OK; } - -s8 sbp_msg_ed25519_certificate_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ed25519_certificate_dep_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ed25519_certificate_dep_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ed25519_certificate_dep_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ed25519_certificate_dep_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ED25519_CERTIFICATE_DEP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ed25519_certificate_dep_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ED25519_CERTIFICATE_DEP, sender_id, + payload_len, payload, write); } -int sbp_msg_ed25519_certificate_dep_cmp(const sbp_msg_ed25519_certificate_dep_t *a, const sbp_msg_ed25519_certificate_dep_t *b) { +int sbp_msg_ed25519_certificate_dep_cmp( + const sbp_msg_ed25519_certificate_dep_t *a, + const sbp_msg_ed25519_certificate_dep_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->n_msg, &b->n_msg); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_ED25519_CERTIFICATE_DEP_FINGERPRINT_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_ED25519_CERTIFICATE_DEP_FINGERPRINT_MAX; i++) { ret = sbp_u8_cmp(&a->fingerprint[i], &b->fingerprint[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_certificate_bytes, &b->n_certificate_bytes); - for (uint8_t i = 0; ret == 0 && i < a->n_certificate_bytes; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_certificate_bytes; i++) { ret = sbp_u8_cmp(&a->certificate_bytes[i], &b->certificate_bytes[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ed25519_signature_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ed25519_signature_dep_a_t *msg) -{ - for (size_t i = 0; i < SBP_MSG_ED25519_SIGNATURE_DEP_A_SIGNATURE_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->signature[i])) { return false; } +bool sbp_msg_ed25519_signature_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ed25519_signature_dep_a_t *msg) { + for (size_t i = 0; i < SBP_MSG_ED25519_SIGNATURE_DEP_A_SIGNATURE_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->signature[i])) { + return false; + } } - for (size_t i = 0; i < SBP_MSG_ED25519_SIGNATURE_DEP_A_FINGERPRINT_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->fingerprint[i])) { return false; } + for (size_t i = 0; i < SBP_MSG_ED25519_SIGNATURE_DEP_A_FINGERPRINT_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->fingerprint[i])) { + return false; + } } - for (size_t i = 0; i < msg->n_signed_messages; i++) - { - if (!sbp_u32_encode(ctx, &msg->signed_messages[i])) { return false; } + for (size_t i = 0; i < msg->n_signed_messages; i++) { + if (!sbp_u32_encode(ctx, &msg->signed_messages[i])) { + return false; + } } return true; } -s8 sbp_msg_ed25519_signature_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ed25519_signature_dep_a_t *msg) { +s8 sbp_msg_ed25519_signature_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ed25519_signature_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -919,25 +1265,35 @@ s8 sbp_msg_ed25519_signature_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } -bool sbp_msg_ed25519_signature_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ed25519_signature_dep_a_t *msg) -{ +bool sbp_msg_ed25519_signature_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ed25519_signature_dep_a_t *msg) { for (uint8_t i = 0; i < SBP_MSG_ED25519_SIGNATURE_DEP_A_SIGNATURE_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->signature[i])) { return false; } - } - for (uint8_t i = 0; i < SBP_MSG_ED25519_SIGNATURE_DEP_A_FINGERPRINT_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->fingerprint[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->signature[i])) { + return false; + } } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U32) != 0) { + for (uint8_t i = 0; i < SBP_MSG_ED25519_SIGNATURE_DEP_A_FINGERPRINT_MAX; + i++) { + if (!sbp_u8_decode(ctx, &msg->fingerprint[i])) { return false; } - msg->n_signed_messages = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U32); - for (uint8_t i = 0; i < msg->n_signed_messages; i++) { - if (!sbp_u32_decode(ctx, &msg->signed_messages[i])) { return false; } + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U32) != 0) { + return false; + } + msg->n_signed_messages = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U32); + for (uint8_t i = 0; i < msg->n_signed_messages; i++) { + if (!sbp_u32_decode(ctx, &msg->signed_messages[i])) { + return false; } + } return true; } -s8 sbp_msg_ed25519_signature_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ed25519_signature_dep_a_t *msg) { +s8 sbp_msg_ed25519_signature_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ed25519_signature_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -951,60 +1307,80 @@ s8 sbp_msg_ed25519_signature_dep_a_decode(const uint8_t *buf, uint8_t len, uint8 return SBP_OK; } - -s8 sbp_msg_ed25519_signature_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ed25519_signature_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ed25519_signature_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ed25519_signature_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ed25519_signature_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ED25519_SIGNATURE_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ed25519_signature_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ED25519_SIGNATURE_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_ed25519_signature_dep_a_cmp(const sbp_msg_ed25519_signature_dep_a_t *a, const sbp_msg_ed25519_signature_dep_a_t *b) { +int sbp_msg_ed25519_signature_dep_a_cmp( + const sbp_msg_ed25519_signature_dep_a_t *a, + const sbp_msg_ed25519_signature_dep_a_t *b) { int ret = 0; - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_ED25519_SIGNATURE_DEP_A_SIGNATURE_MAX; i++) - { + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_ED25519_SIGNATURE_DEP_A_SIGNATURE_MAX; i++) { ret = sbp_u8_cmp(&a->signature[i], &b->signature[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_ED25519_SIGNATURE_DEP_A_FINGERPRINT_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_ED25519_SIGNATURE_DEP_A_FINGERPRINT_MAX; i++) { ret = sbp_u8_cmp(&a->fingerprint[i], &b->fingerprint[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_signed_messages, &b->n_signed_messages); - for (uint8_t i = 0; ret == 0 && i < a->n_signed_messages; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_signed_messages; i++) { ret = sbp_u32_cmp(&a->signed_messages[i], &b->signed_messages[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ed25519_signature_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ed25519_signature_dep_b_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->stream_counter)) { return false; } - if (!sbp_u8_encode(ctx, &msg->on_demand_counter)) { return false; } - for (size_t i = 0; i < SBP_MSG_ED25519_SIGNATURE_DEP_B_SIGNATURE_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->signature[i])) { return false; } +bool sbp_msg_ed25519_signature_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ed25519_signature_dep_b_t *msg) { + if (!sbp_u8_encode(ctx, &msg->stream_counter)) { + return false; } - for (size_t i = 0; i < SBP_MSG_ED25519_SIGNATURE_DEP_B_FINGERPRINT_MAX; i++) - { - if (!sbp_u8_encode(ctx, &msg->fingerprint[i])) { return false; } + if (!sbp_u8_encode(ctx, &msg->on_demand_counter)) { + return false; } - for (size_t i = 0; i < msg->n_signed_messages; i++) - { - if (!sbp_u32_encode(ctx, &msg->signed_messages[i])) { return false; } + for (size_t i = 0; i < SBP_MSG_ED25519_SIGNATURE_DEP_B_SIGNATURE_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->signature[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_MSG_ED25519_SIGNATURE_DEP_B_FINGERPRINT_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->fingerprint[i])) { + return false; + } + } + for (size_t i = 0; i < msg->n_signed_messages; i++) { + if (!sbp_u32_encode(ctx, &msg->signed_messages[i])) { + return false; + } } return true; } -s8 sbp_msg_ed25519_signature_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ed25519_signature_dep_b_t *msg) { +s8 sbp_msg_ed25519_signature_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ed25519_signature_dep_b_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1018,27 +1394,41 @@ s8 sbp_msg_ed25519_signature_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } -bool sbp_msg_ed25519_signature_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ed25519_signature_dep_b_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->stream_counter)) { return false; } - if (!sbp_u8_decode(ctx, &msg->on_demand_counter)) { return false; } - for (uint8_t i = 0; i < SBP_MSG_ED25519_SIGNATURE_DEP_B_SIGNATURE_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->signature[i])) { return false; } +bool sbp_msg_ed25519_signature_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ed25519_signature_dep_b_t *msg) { + if (!sbp_u8_decode(ctx, &msg->stream_counter)) { + return false; } - for (uint8_t i = 0; i < SBP_MSG_ED25519_SIGNATURE_DEP_B_FINGERPRINT_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->fingerprint[i])) { return false; } + if (!sbp_u8_decode(ctx, &msg->on_demand_counter)) { + return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U32) != 0) { + for (uint8_t i = 0; i < SBP_MSG_ED25519_SIGNATURE_DEP_B_SIGNATURE_MAX; i++) { + if (!sbp_u8_decode(ctx, &msg->signature[i])) { return false; } - msg->n_signed_messages = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U32); - for (uint8_t i = 0; i < msg->n_signed_messages; i++) { - if (!sbp_u32_decode(ctx, &msg->signed_messages[i])) { return false; } + } + for (uint8_t i = 0; i < SBP_MSG_ED25519_SIGNATURE_DEP_B_FINGERPRINT_MAX; + i++) { + if (!sbp_u8_decode(ctx, &msg->fingerprint[i])) { + return false; + } + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U32) != 0) { + return false; + } + msg->n_signed_messages = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U32); + for (uint8_t i = 0; i < msg->n_signed_messages; i++) { + if (!sbp_u32_decode(ctx, &msg->signed_messages[i])) { + return false; } + } return true; } -s8 sbp_msg_ed25519_signature_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ed25519_signature_dep_b_t *msg) { +s8 sbp_msg_ed25519_signature_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ed25519_signature_dep_b_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1052,42 +1442,57 @@ s8 sbp_msg_ed25519_signature_dep_b_decode(const uint8_t *buf, uint8_t len, uint8 return SBP_OK; } - -s8 sbp_msg_ed25519_signature_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ed25519_signature_dep_b_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ed25519_signature_dep_b_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ed25519_signature_dep_b_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ed25519_signature_dep_b_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ED25519_SIGNATURE_DEP_B, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ed25519_signature_dep_b_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ED25519_SIGNATURE_DEP_B, sender_id, + payload_len, payload, write); } -int sbp_msg_ed25519_signature_dep_b_cmp(const sbp_msg_ed25519_signature_dep_b_t *a, const sbp_msg_ed25519_signature_dep_b_t *b) { +int sbp_msg_ed25519_signature_dep_b_cmp( + const sbp_msg_ed25519_signature_dep_b_t *a, + const sbp_msg_ed25519_signature_dep_b_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->stream_counter, &b->stream_counter); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->on_demand_counter, &b->on_demand_counter); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_ED25519_SIGNATURE_DEP_B_SIGNATURE_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_ED25519_SIGNATURE_DEP_B_SIGNATURE_MAX; i++) { ret = sbp_u8_cmp(&a->signature[i], &b->signature[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_ED25519_SIGNATURE_DEP_B_FINGERPRINT_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_ED25519_SIGNATURE_DEP_B_FINGERPRINT_MAX; i++) { ret = sbp_u8_cmp(&a->fingerprint[i], &b->fingerprint[i]); } - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_signed_messages, &b->n_signed_messages); - for (uint8_t i = 0; ret == 0 && i < a->n_signed_messages; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_signed_messages; i++) { ret = sbp_u32_cmp(&a->signed_messages[i], &b->signed_messages[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/solution_meta.c b/c/src/solution_meta.c index 0bfabca4b..662fd8799 100644 --- a/c/src/solution_meta.c +++ b/c/src/solution_meta.c @@ -3,28 +3,33 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include +#include #include +#include #include #include -#include #include +#include +#include -bool sbp_solution_input_type_encode_internal(sbp_encode_ctx_t *ctx, const sbp_solution_input_type_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->sensor_type)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_solution_input_type_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_solution_input_type_t *msg) { + if (!sbp_u8_encode(ctx, &msg->sensor_type)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_solution_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_solution_input_type_t *msg) { +s8 sbp_solution_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_solution_input_type_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -38,14 +43,20 @@ s8 sbp_solution_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_solution_input_type_decode_internal(sbp_decode_ctx_t *ctx, sbp_solution_input_type_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->sensor_type)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_solution_input_type_decode_internal(sbp_decode_ctx_t *ctx, + sbp_solution_input_type_t *msg) { + if (!sbp_u8_decode(ctx, &msg->sensor_type)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_solution_input_type_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_solution_input_type_t *msg) { +s8 sbp_solution_input_type_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_solution_input_type_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -59,37 +70,58 @@ s8 sbp_solution_input_type_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - - -int sbp_solution_input_type_cmp(const sbp_solution_input_type_t *a, const sbp_solution_input_type_t *b) { +int sbp_solution_input_type_cmp(const sbp_solution_input_type_t *a, + const sbp_solution_input_type_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->sensor_type, &b->sensor_type); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_soln_meta_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_soln_meta_dep_a_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->pdop)) { return false; } - if (!sbp_u16_encode(ctx, &msg->hdop)) { return false; } - if (!sbp_u16_encode(ctx, &msg->vdop)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u16_encode(ctx, &msg->age_corrections)) { return false; } - if (!sbp_u8_encode(ctx, &msg->alignment_status)) { return false; } - if (!sbp_u32_encode(ctx, &msg->last_used_gnss_pos_tow)) { return false; } - if (!sbp_u32_encode(ctx, &msg->last_used_gnss_vel_tow)) { return false; } - for (size_t i = 0; i < msg->n_sol_in; i++) - { - if (!sbp_solution_input_type_encode_internal(ctx, &msg->sol_in[i])) { return false; } +bool sbp_msg_soln_meta_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_soln_meta_dep_a_t *msg) { + if (!sbp_u16_encode(ctx, &msg->pdop)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->hdop)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->vdop)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->age_corrections)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->alignment_status)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->last_used_gnss_pos_tow)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->last_used_gnss_vel_tow)) { + return false; + } + for (size_t i = 0; i < msg->n_sol_in; i++) { + if (!sbp_solution_input_type_encode_internal(ctx, &msg->sol_in[i])) { + return false; + } } return true; } -s8 sbp_msg_soln_meta_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_soln_meta_dep_a_t *msg) { +s8 sbp_msg_soln_meta_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_soln_meta_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -103,27 +135,49 @@ s8 sbp_msg_soln_meta_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_soln_meta_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_soln_meta_dep_a_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->pdop)) { return false; } - if (!sbp_u16_decode(ctx, &msg->hdop)) { return false; } - if (!sbp_u16_decode(ctx, &msg->vdop)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if (!sbp_u16_decode(ctx, &msg->age_corrections)) { return false; } - if (!sbp_u8_decode(ctx, &msg->alignment_status)) { return false; } - if (!sbp_u32_decode(ctx, &msg->last_used_gnss_pos_tow)) { return false; } - if (!sbp_u32_decode(ctx, &msg->last_used_gnss_vel_tow)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_SOLUTION_INPUT_TYPE_ENCODED_LEN) != 0) { +bool sbp_msg_soln_meta_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_soln_meta_dep_a_t *msg) { + if (!sbp_u16_decode(ctx, &msg->pdop)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->hdop)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->vdop)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->age_corrections)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->alignment_status)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->last_used_gnss_pos_tow)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->last_used_gnss_vel_tow)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_SOLUTION_INPUT_TYPE_ENCODED_LEN) != + 0) { + return false; + } + msg->n_sol_in = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_SOLUTION_INPUT_TYPE_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_sol_in; i++) { + if (!sbp_solution_input_type_decode_internal(ctx, &msg->sol_in[i])) { return false; } - msg->n_sol_in = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_SOLUTION_INPUT_TYPE_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_sol_in; i++) { - if (!sbp_solution_input_type_decode_internal(ctx, &msg->sol_in[i])) { return false; } - } + } return true; } -s8 sbp_msg_soln_meta_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_soln_meta_dep_a_t *msg) { +s8 sbp_msg_soln_meta_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_soln_meta_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -137,68 +191,104 @@ s8 sbp_msg_soln_meta_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_soln_meta_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_soln_meta_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_soln_meta_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_soln_meta_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_soln_meta_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SOLN_META_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_soln_meta_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SOLN_META_DEP_A, sender_id, payload_len, + payload, write); } -int sbp_msg_soln_meta_dep_a_cmp(const sbp_msg_soln_meta_dep_a_t *a, const sbp_msg_soln_meta_dep_a_t *b) { +int sbp_msg_soln_meta_dep_a_cmp(const sbp_msg_soln_meta_dep_a_t *a, + const sbp_msg_soln_meta_dep_a_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->pdop, &b->pdop); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->hdop, &b->hdop); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->vdop, &b->vdop); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->age_corrections, &b->age_corrections); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->alignment_status, &b->alignment_status); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->last_used_gnss_pos_tow, &b->last_used_gnss_pos_tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->last_used_gnss_vel_tow, &b->last_used_gnss_vel_tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sol_in, &b->n_sol_in); - for (uint8_t i = 0; ret == 0 && i < a->n_sol_in; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_sol_in; i++) { ret = sbp_solution_input_type_cmp(&a->sol_in[i], &b->sol_in[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_soln_meta_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_soln_meta_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_encode(ctx, &msg->pdop)) { return false; } - if (!sbp_u16_encode(ctx, &msg->hdop)) { return false; } - if (!sbp_u16_encode(ctx, &msg->vdop)) { return false; } - if (!sbp_u16_encode(ctx, &msg->age_corrections)) { return false; } - if (!sbp_u32_encode(ctx, &msg->age_gnss)) { return false; } - for (size_t i = 0; i < msg->n_sol_in; i++) - { - if (!sbp_solution_input_type_encode_internal(ctx, &msg->sol_in[i])) { return false; } +bool sbp_msg_soln_meta_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_soln_meta_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->pdop)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->hdop)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->vdop)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->age_corrections)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->age_gnss)) { + return false; + } + for (size_t i = 0; i < msg->n_sol_in; i++) { + if (!sbp_solution_input_type_encode_internal(ctx, &msg->sol_in[i])) { + return false; + } } return true; } -s8 sbp_msg_soln_meta_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_soln_meta_t *msg) { +s8 sbp_msg_soln_meta_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_soln_meta_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -212,25 +302,42 @@ s8 sbp_msg_soln_meta_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_soln_meta_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_soln_meta_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u16_decode(ctx, &msg->pdop)) { return false; } - if (!sbp_u16_decode(ctx, &msg->hdop)) { return false; } - if (!sbp_u16_decode(ctx, &msg->vdop)) { return false; } - if (!sbp_u16_decode(ctx, &msg->age_corrections)) { return false; } - if (!sbp_u32_decode(ctx, &msg->age_gnss)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_SOLUTION_INPUT_TYPE_ENCODED_LEN) != 0) { +bool sbp_msg_soln_meta_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_soln_meta_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->pdop)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->hdop)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->vdop)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->age_corrections)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->age_gnss)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_SOLUTION_INPUT_TYPE_ENCODED_LEN) != + 0) { + return false; + } + msg->n_sol_in = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_SOLUTION_INPUT_TYPE_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_sol_in; i++) { + if (!sbp_solution_input_type_decode_internal(ctx, &msg->sol_in[i])) { return false; } - msg->n_sol_in = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_SOLUTION_INPUT_TYPE_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_sol_in; i++) { - if (!sbp_solution_input_type_decode_internal(ctx, &msg->sol_in[i])) { return false; } - } + } return true; } -s8 sbp_msg_soln_meta_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_soln_meta_t *msg) { +s8 sbp_msg_soln_meta_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_soln_meta_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -244,53 +351,74 @@ s8 sbp_msg_soln_meta_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - -s8 sbp_msg_soln_meta_send(sbp_state_t *s, u16 sender_id, const sbp_msg_soln_meta_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_soln_meta_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_soln_meta_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_soln_meta_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SOLN_META, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_soln_meta_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SOLN_META, sender_id, payload_len, payload, + write); } -int sbp_msg_soln_meta_cmp(const sbp_msg_soln_meta_t *a, const sbp_msg_soln_meta_t *b) { +int sbp_msg_soln_meta_cmp(const sbp_msg_soln_meta_t *a, + const sbp_msg_soln_meta_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->pdop, &b->pdop); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->hdop, &b->hdop); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->vdop, &b->vdop); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->age_corrections, &b->age_corrections); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->age_gnss, &b->age_gnss); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sol_in, &b->n_sol_in); - for (uint8_t i = 0; ret == 0 && i < a->n_sol_in; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_sol_in; i++) { ret = sbp_solution_input_type_cmp(&a->sol_in[i], &b->sol_in[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_gnss_input_type_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gnss_input_type_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_gnss_input_type_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_gnss_input_type_t *msg) { + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_gnss_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_gnss_input_type_t *msg) { +s8 sbp_gnss_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_gnss_input_type_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -304,13 +432,16 @@ s8 sbp_gnss_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, con return SBP_OK; } -bool sbp_gnss_input_type_decode_internal(sbp_decode_ctx_t *ctx, sbp_gnss_input_type_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_gnss_input_type_decode_internal(sbp_decode_ctx_t *ctx, + sbp_gnss_input_type_t *msg) { + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_gnss_input_type_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_gnss_input_type_t *msg) { +s8 sbp_gnss_input_type_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_gnss_input_type_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -324,23 +455,27 @@ s8 sbp_gnss_input_type_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - - -int sbp_gnss_input_type_cmp(const sbp_gnss_input_type_t *a, const sbp_gnss_input_type_t *b) { +int sbp_gnss_input_type_cmp(const sbp_gnss_input_type_t *a, + const sbp_gnss_input_type_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_imu_input_type_encode_internal(sbp_encode_ctx_t *ctx, const sbp_imu_input_type_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_imu_input_type_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_imu_input_type_t *msg) { + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_imu_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_imu_input_type_t *msg) { +s8 sbp_imu_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_imu_input_type_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -354,13 +489,16 @@ s8 sbp_imu_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, cons return SBP_OK; } -bool sbp_imu_input_type_decode_internal(sbp_decode_ctx_t *ctx, sbp_imu_input_type_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_imu_input_type_decode_internal(sbp_decode_ctx_t *ctx, + sbp_imu_input_type_t *msg) { + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_imu_input_type_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_imu_input_type_t *msg) { +s8 sbp_imu_input_type_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_imu_input_type_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -374,23 +512,27 @@ s8 sbp_imu_input_type_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, s return SBP_OK; } - - -int sbp_imu_input_type_cmp(const sbp_imu_input_type_t *a, const sbp_imu_input_type_t *b) { +int sbp_imu_input_type_cmp(const sbp_imu_input_type_t *a, + const sbp_imu_input_type_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_odo_input_type_encode_internal(sbp_encode_ctx_t *ctx, const sbp_odo_input_type_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_odo_input_type_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_odo_input_type_t *msg) { + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_odo_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_odo_input_type_t *msg) { +s8 sbp_odo_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_odo_input_type_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -404,13 +546,16 @@ s8 sbp_odo_input_type_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, cons return SBP_OK; } -bool sbp_odo_input_type_decode_internal(sbp_decode_ctx_t *ctx, sbp_odo_input_type_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_odo_input_type_decode_internal(sbp_decode_ctx_t *ctx, + sbp_odo_input_type_t *msg) { + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_odo_input_type_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_odo_input_type_t *msg) { +s8 sbp_odo_input_type_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_odo_input_type_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -424,12 +569,13 @@ s8 sbp_odo_input_type_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, s return SBP_OK; } - - -int sbp_odo_input_type_cmp(const sbp_odo_input_type_t *a, const sbp_odo_input_type_t *b) { +int sbp_odo_input_type_cmp(const sbp_odo_input_type_t *a, + const sbp_odo_input_type_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/ssr.c b/c/src/ssr.c index cb9d81cb1..817db9c50 100644 --- a/c/src/ssr.c +++ b/c/src/ssr.c @@ -3,28 +3,33 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include +#include #include +#include #include #include -#include #include +#include +#include -bool sbp_code_biases_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_code_biases_content_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->code)) { return false; } - if (!sbp_s16_encode(ctx, &msg->value)) { return false; } +bool sbp_code_biases_content_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_code_biases_content_t *msg) { + if (!sbp_u8_encode(ctx, &msg->code)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->value)) { + return false; + } return true; } -s8 sbp_code_biases_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_code_biases_content_t *msg) { +s8 sbp_code_biases_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_code_biases_content_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -38,14 +43,20 @@ s8 sbp_code_biases_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_code_biases_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_code_biases_content_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->code)) { return false; } - if (!sbp_s16_decode(ctx, &msg->value)) { return false; } +bool sbp_code_biases_content_decode_internal(sbp_decode_ctx_t *ctx, + sbp_code_biases_content_t *msg) { + if (!sbp_u8_decode(ctx, &msg->code)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->value)) { + return false; + } return true; } -s8 sbp_code_biases_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_code_biases_content_t *msg) { +s8 sbp_code_biases_content_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_code_biases_content_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -59,30 +70,45 @@ s8 sbp_code_biases_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - - -int sbp_code_biases_content_cmp(const sbp_code_biases_content_t *a, const sbp_code_biases_content_t *b) { +int sbp_code_biases_content_cmp(const sbp_code_biases_content_t *a, + const sbp_code_biases_content_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->code, &b->code); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->value, &b->value); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_phase_biases_content_encode_internal(sbp_encode_ctx_t *ctx, const sbp_phase_biases_content_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->code)) { return false; } - if (!sbp_u8_encode(ctx, &msg->integer_indicator)) { return false; } - if (!sbp_u8_encode(ctx, &msg->widelane_integer_indicator)) { return false; } - if (!sbp_u8_encode(ctx, &msg->discontinuity_counter)) { return false; } - if (!sbp_s32_encode(ctx, &msg->bias)) { return false; } +bool sbp_phase_biases_content_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_phase_biases_content_t *msg) { + if (!sbp_u8_encode(ctx, &msg->code)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->integer_indicator)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->widelane_integer_indicator)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->discontinuity_counter)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->bias)) { + return false; + } return true; } -s8 sbp_phase_biases_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_phase_biases_content_t *msg) { +s8 sbp_phase_biases_content_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_phase_biases_content_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -96,17 +122,29 @@ s8 sbp_phase_biases_content_encode(uint8_t *buf, uint8_t len, uint8_t *n_written return SBP_OK; } -bool sbp_phase_biases_content_decode_internal(sbp_decode_ctx_t *ctx, sbp_phase_biases_content_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->code)) { return false; } - if (!sbp_u8_decode(ctx, &msg->integer_indicator)) { return false; } - if (!sbp_u8_decode(ctx, &msg->widelane_integer_indicator)) { return false; } - if (!sbp_u8_decode(ctx, &msg->discontinuity_counter)) { return false; } - if (!sbp_s32_decode(ctx, &msg->bias)) { return false; } +bool sbp_phase_biases_content_decode_internal(sbp_decode_ctx_t *ctx, + sbp_phase_biases_content_t *msg) { + if (!sbp_u8_decode(ctx, &msg->code)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->integer_indicator)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->widelane_integer_indicator)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->discontinuity_counter)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->bias)) { + return false; + } return true; } -s8 sbp_phase_biases_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_phase_biases_content_t *msg) { +s8 sbp_phase_biases_content_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_phase_biases_content_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -120,41 +158,66 @@ s8 sbp_phase_biases_content_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r return SBP_OK; } - - -int sbp_phase_biases_content_cmp(const sbp_phase_biases_content_t *a, const sbp_phase_biases_content_t *b) { +int sbp_phase_biases_content_cmp(const sbp_phase_biases_content_t *a, + const sbp_phase_biases_content_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->code, &b->code); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->integer_indicator, &b->integer_indicator); - if (ret != 0) { return ret; } - - ret = sbp_u8_cmp(&a->widelane_integer_indicator, &b->widelane_integer_indicator); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + + ret = sbp_u8_cmp(&a->widelane_integer_indicator, + &b->widelane_integer_indicator); + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->discontinuity_counter, &b->discontinuity_counter); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->bias, &b->bias); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_stec_header_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec_header_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tile_id)) { return false; } - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { return false; } - if (!sbp_u8_encode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u8_encode(ctx, &msg->seq_num)) { return false; } - if (!sbp_u8_encode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iod_atmo)) { return false; } +bool sbp_stec_header_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_stec_header_t *msg) { + if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->seq_num)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iod_atmo)) { + return false; + } return true; } -s8 sbp_stec_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_stec_header_t *msg) { +s8 sbp_stec_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_stec_header_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -168,19 +231,34 @@ s8 sbp_stec_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const s return SBP_OK; } -bool sbp_stec_header_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_header_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tile_id)) { return false; } - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { return false; } - if (!sbp_u8_decode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u8_decode(ctx, &msg->seq_num)) { return false; } - if (!sbp_u8_decode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iod_atmo)) { return false; } +bool sbp_stec_header_decode_internal(sbp_decode_ctx_t *ctx, + sbp_stec_header_t *msg) { + if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->seq_num)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iod_atmo)) { + return false; + } return true; } -s8 sbp_stec_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_stec_header_t *msg) { +s8 sbp_stec_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_stec_header_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -194,48 +272,79 @@ s8 sbp_stec_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ return SBP_OK; } - - -int sbp_stec_header_cmp(const sbp_stec_header_t *a, const sbp_stec_header_t *b) { +int sbp_stec_header_cmp(const sbp_stec_header_t *a, + const sbp_stec_header_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->tile_set_id, &b->tile_set_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tile_id, &b->tile_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_sec_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->num_msgs, &b->num_msgs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->seq_num, &b->seq_num); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->update_interval, &b->update_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iod_atmo, &b->iod_atmo); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_gridded_correction_header_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gridded_correction_header_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tile_id)) { return false; } - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { return false; } - if (!sbp_u16_encode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u16_encode(ctx, &msg->seq_num)) { return false; } - if (!sbp_u8_encode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iod_atmo)) { return false; } - if (!sbp_u8_encode(ctx, &msg->tropo_quality_indicator)) { return false; } +bool sbp_gridded_correction_header_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_gridded_correction_header_t *msg) { + if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->seq_num)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iod_atmo)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->tropo_quality_indicator)) { + return false; + } return true; } -s8 sbp_gridded_correction_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_gridded_correction_header_t *msg) { +s8 sbp_gridded_correction_header_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_gridded_correction_header_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -249,20 +358,38 @@ s8 sbp_gridded_correction_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_wr return SBP_OK; } -bool sbp_gridded_correction_header_decode_internal(sbp_decode_ctx_t *ctx, sbp_gridded_correction_header_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tile_id)) { return false; } - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { return false; } - if (!sbp_u16_decode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u16_decode(ctx, &msg->seq_num)) { return false; } - if (!sbp_u8_decode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iod_atmo)) { return false; } - if (!sbp_u8_decode(ctx, &msg->tropo_quality_indicator)) { return false; } +bool sbp_gridded_correction_header_decode_internal( + sbp_decode_ctx_t *ctx, sbp_gridded_correction_header_t *msg) { + if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->seq_num)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iod_atmo)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->tropo_quality_indicator)) { + return false; + } return true; } -s8 sbp_gridded_correction_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_gridded_correction_header_t *msg) { +s8 sbp_gridded_correction_header_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_gridded_correction_header_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -276,49 +403,71 @@ s8 sbp_gridded_correction_header_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - - -int sbp_gridded_correction_header_cmp(const sbp_gridded_correction_header_t *a, const sbp_gridded_correction_header_t *b) { +int sbp_gridded_correction_header_cmp( + const sbp_gridded_correction_header_t *a, + const sbp_gridded_correction_header_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->tile_set_id, &b->tile_set_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tile_id, &b->tile_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_sec_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->num_msgs, &b->num_msgs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->seq_num, &b->seq_num); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->update_interval, &b->update_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iod_atmo, &b->iod_atmo); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->tropo_quality_indicator, &b->tropo_quality_indicator); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_stec_sat_element_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec_sat_element_t *msg) -{ - if (!sbp_sv_id_encode_internal(ctx, &msg->sv_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->stec_quality_indicator)) { return false; } - for (size_t i = 0; i < SBP_STEC_SAT_ELEMENT_STEC_COEFF_MAX; i++) - { - if (!sbp_s16_encode(ctx, &msg->stec_coeff[i])) { return false; } +bool sbp_stec_sat_element_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_stec_sat_element_t *msg) { + if (!sbp_sv_id_encode_internal(ctx, &msg->sv_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->stec_quality_indicator)) { + return false; + } + for (size_t i = 0; i < SBP_STEC_SAT_ELEMENT_STEC_COEFF_MAX; i++) { + if (!sbp_s16_encode(ctx, &msg->stec_coeff[i])) { + return false; + } } return true; } -s8 sbp_stec_sat_element_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_stec_sat_element_t *msg) { +s8 sbp_stec_sat_element_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_stec_sat_element_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -332,17 +481,24 @@ s8 sbp_stec_sat_element_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, co return SBP_OK; } -bool sbp_stec_sat_element_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_sat_element_t *msg) -{ - if (!sbp_sv_id_decode_internal(ctx, &msg->sv_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->stec_quality_indicator)) { return false; } +bool sbp_stec_sat_element_decode_internal(sbp_decode_ctx_t *ctx, + sbp_stec_sat_element_t *msg) { + if (!sbp_sv_id_decode_internal(ctx, &msg->sv_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->stec_quality_indicator)) { + return false; + } for (uint8_t i = 0; i < SBP_STEC_SAT_ELEMENT_STEC_COEFF_MAX; i++) { - if (!sbp_s16_decode(ctx, &msg->stec_coeff[i])) { return false; } + if (!sbp_s16_decode(ctx, &msg->stec_coeff[i])) { + return false; + } } return true; } -s8 sbp_stec_sat_element_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_stec_sat_element_t *msg) { +s8 sbp_stec_sat_element_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_stec_sat_element_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -356,33 +512,45 @@ s8 sbp_stec_sat_element_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - - -int sbp_stec_sat_element_cmp(const sbp_stec_sat_element_t *a, const sbp_stec_sat_element_t *b) { +int sbp_stec_sat_element_cmp(const sbp_stec_sat_element_t *a, + const sbp_stec_sat_element_t *b) { int ret = 0; - + ret = sbp_sv_id_cmp(&a->sv_id, &b->sv_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->stec_quality_indicator, &b->stec_quality_indicator); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_STEC_SAT_ELEMENT_STEC_COEFF_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_STEC_SAT_ELEMENT_STEC_COEFF_MAX; + i++) { ret = sbp_s16_cmp(&a->stec_coeff[i], &b->stec_coeff[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_tropospheric_delay_correction_no_std_encode_internal(sbp_encode_ctx_t *ctx, const sbp_tropospheric_delay_correction_no_std_t *msg) -{ - if (!sbp_s16_encode(ctx, &msg->hydro)) { return false; } - if (!sbp_s8_encode(ctx, &msg->wet)) { return false; } +bool sbp_tropospheric_delay_correction_no_std_encode_internal( + sbp_encode_ctx_t *ctx, + const sbp_tropospheric_delay_correction_no_std_t *msg) { + if (!sbp_s16_encode(ctx, &msg->hydro)) { + return false; + } + if (!sbp_s8_encode(ctx, &msg->wet)) { + return false; + } return true; } -s8 sbp_tropospheric_delay_correction_no_std_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_tropospheric_delay_correction_no_std_t *msg) { +s8 sbp_tropospheric_delay_correction_no_std_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_tropospheric_delay_correction_no_std_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -396,14 +564,20 @@ s8 sbp_tropospheric_delay_correction_no_std_encode(uint8_t *buf, uint8_t len, ui return SBP_OK; } -bool sbp_tropospheric_delay_correction_no_std_decode_internal(sbp_decode_ctx_t *ctx, sbp_tropospheric_delay_correction_no_std_t *msg) -{ - if (!sbp_s16_decode(ctx, &msg->hydro)) { return false; } - if (!sbp_s8_decode(ctx, &msg->wet)) { return false; } +bool sbp_tropospheric_delay_correction_no_std_decode_internal( + sbp_decode_ctx_t *ctx, sbp_tropospheric_delay_correction_no_std_t *msg) { + if (!sbp_s16_decode(ctx, &msg->hydro)) { + return false; + } + if (!sbp_s8_decode(ctx, &msg->wet)) { + return false; + } return true; } -s8 sbp_tropospheric_delay_correction_no_std_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_tropospheric_delay_correction_no_std_t *msg) { +s8 sbp_tropospheric_delay_correction_no_std_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_tropospheric_delay_correction_no_std_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -417,28 +591,40 @@ s8 sbp_tropospheric_delay_correction_no_std_decode(const uint8_t *buf, uint8_t l return SBP_OK; } - - -int sbp_tropospheric_delay_correction_no_std_cmp(const sbp_tropospheric_delay_correction_no_std_t *a, const sbp_tropospheric_delay_correction_no_std_t *b) { +int sbp_tropospheric_delay_correction_no_std_cmp( + const sbp_tropospheric_delay_correction_no_std_t *a, + const sbp_tropospheric_delay_correction_no_std_t *b) { int ret = 0; - + ret = sbp_s16_cmp(&a->hydro, &b->hydro); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s8_cmp(&a->wet, &b->wet); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_tropospheric_delay_correction_encode_internal(sbp_encode_ctx_t *ctx, const sbp_tropospheric_delay_correction_t *msg) -{ - if (!sbp_s16_encode(ctx, &msg->hydro)) { return false; } - if (!sbp_s8_encode(ctx, &msg->wet)) { return false; } - if (!sbp_u8_encode(ctx, &msg->stddev)) { return false; } +bool sbp_tropospheric_delay_correction_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_tropospheric_delay_correction_t *msg) { + if (!sbp_s16_encode(ctx, &msg->hydro)) { + return false; + } + if (!sbp_s8_encode(ctx, &msg->wet)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->stddev)) { + return false; + } return true; } -s8 sbp_tropospheric_delay_correction_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_tropospheric_delay_correction_t *msg) { +s8 sbp_tropospheric_delay_correction_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_tropospheric_delay_correction_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -452,15 +638,23 @@ s8 sbp_tropospheric_delay_correction_encode(uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } -bool sbp_tropospheric_delay_correction_decode_internal(sbp_decode_ctx_t *ctx, sbp_tropospheric_delay_correction_t *msg) -{ - if (!sbp_s16_decode(ctx, &msg->hydro)) { return false; } - if (!sbp_s8_decode(ctx, &msg->wet)) { return false; } - if (!sbp_u8_decode(ctx, &msg->stddev)) { return false; } +bool sbp_tropospheric_delay_correction_decode_internal( + sbp_decode_ctx_t *ctx, sbp_tropospheric_delay_correction_t *msg) { + if (!sbp_s16_decode(ctx, &msg->hydro)) { + return false; + } + if (!sbp_s8_decode(ctx, &msg->wet)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->stddev)) { + return false; + } return true; } -s8 sbp_tropospheric_delay_correction_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_tropospheric_delay_correction_t *msg) { +s8 sbp_tropospheric_delay_correction_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_tropospheric_delay_correction_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -474,30 +668,42 @@ s8 sbp_tropospheric_delay_correction_decode(const uint8_t *buf, uint8_t len, uin return SBP_OK; } - - -int sbp_tropospheric_delay_correction_cmp(const sbp_tropospheric_delay_correction_t *a, const sbp_tropospheric_delay_correction_t *b) { +int sbp_tropospheric_delay_correction_cmp( + const sbp_tropospheric_delay_correction_t *a, + const sbp_tropospheric_delay_correction_t *b) { int ret = 0; - + ret = sbp_s16_cmp(&a->hydro, &b->hydro); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s8_cmp(&a->wet, &b->wet); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->stddev, &b->stddev); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_stec_residual_no_std_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec_residual_no_std_t *msg) -{ - if (!sbp_sv_id_encode_internal(ctx, &msg->sv_id)) { return false; } - if (!sbp_s16_encode(ctx, &msg->residual)) { return false; } +bool sbp_stec_residual_no_std_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_stec_residual_no_std_t *msg) { + if (!sbp_sv_id_encode_internal(ctx, &msg->sv_id)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->residual)) { + return false; + } return true; } -s8 sbp_stec_residual_no_std_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_stec_residual_no_std_t *msg) { +s8 sbp_stec_residual_no_std_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_stec_residual_no_std_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -511,14 +717,20 @@ s8 sbp_stec_residual_no_std_encode(uint8_t *buf, uint8_t len, uint8_t *n_written return SBP_OK; } -bool sbp_stec_residual_no_std_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_residual_no_std_t *msg) -{ - if (!sbp_sv_id_decode_internal(ctx, &msg->sv_id)) { return false; } - if (!sbp_s16_decode(ctx, &msg->residual)) { return false; } +bool sbp_stec_residual_no_std_decode_internal(sbp_decode_ctx_t *ctx, + sbp_stec_residual_no_std_t *msg) { + if (!sbp_sv_id_decode_internal(ctx, &msg->sv_id)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->residual)) { + return false; + } return true; } -s8 sbp_stec_residual_no_std_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_stec_residual_no_std_t *msg) { +s8 sbp_stec_residual_no_std_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_stec_residual_no_std_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -532,28 +744,38 @@ s8 sbp_stec_residual_no_std_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r return SBP_OK; } - - -int sbp_stec_residual_no_std_cmp(const sbp_stec_residual_no_std_t *a, const sbp_stec_residual_no_std_t *b) { +int sbp_stec_residual_no_std_cmp(const sbp_stec_residual_no_std_t *a, + const sbp_stec_residual_no_std_t *b) { int ret = 0; - + ret = sbp_sv_id_cmp(&a->sv_id, &b->sv_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->residual, &b->residual); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_stec_residual_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec_residual_t *msg) -{ - if (!sbp_sv_id_encode_internal(ctx, &msg->sv_id)) { return false; } - if (!sbp_s16_encode(ctx, &msg->residual)) { return false; } - if (!sbp_u8_encode(ctx, &msg->stddev)) { return false; } +bool sbp_stec_residual_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_stec_residual_t *msg) { + if (!sbp_sv_id_encode_internal(ctx, &msg->sv_id)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->residual)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->stddev)) { + return false; + } return true; } -s8 sbp_stec_residual_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_stec_residual_t *msg) { +s8 sbp_stec_residual_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_stec_residual_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -567,15 +789,22 @@ s8 sbp_stec_residual_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_stec_residual_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_residual_t *msg) -{ - if (!sbp_sv_id_decode_internal(ctx, &msg->sv_id)) { return false; } - if (!sbp_s16_decode(ctx, &msg->residual)) { return false; } - if (!sbp_u8_decode(ctx, &msg->stddev)) { return false; } +bool sbp_stec_residual_decode_internal(sbp_decode_ctx_t *ctx, + sbp_stec_residual_t *msg) { + if (!sbp_sv_id_decode_internal(ctx, &msg->sv_id)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->residual)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->stddev)) { + return false; + } return true; } -s8 sbp_stec_residual_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_stec_residual_t *msg) { +s8 sbp_stec_residual_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_stec_residual_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -589,42 +818,76 @@ s8 sbp_stec_residual_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - - -int sbp_stec_residual_cmp(const sbp_stec_residual_t *a, const sbp_stec_residual_t *b) { +int sbp_stec_residual_cmp(const sbp_stec_residual_t *a, + const sbp_stec_residual_t *b) { int ret = 0; - + ret = sbp_sv_id_cmp(&a->sv_id, &b->sv_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->residual, &b->residual); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->stddev, &b->stddev); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_orbit_clock_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_orbit_clock_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iod_ssr)) { return false; } - if (!sbp_u32_encode(ctx, &msg->iod)) { return false; } - if (!sbp_s32_encode(ctx, &msg->radial)) { return false; } - if (!sbp_s32_encode(ctx, &msg->along)) { return false; } - if (!sbp_s32_encode(ctx, &msg->cross)) { return false; } - if (!sbp_s32_encode(ctx, &msg->dot_radial)) { return false; } - if (!sbp_s32_encode(ctx, &msg->dot_along)) { return false; } - if (!sbp_s32_encode(ctx, &msg->dot_cross)) { return false; } - if (!sbp_s32_encode(ctx, &msg->c0)) { return false; } - if (!sbp_s32_encode(ctx, &msg->c1)) { return false; } - if (!sbp_s32_encode(ctx, &msg->c2)) { return false; } +bool sbp_msg_ssr_orbit_clock_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_orbit_clock_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iod_ssr)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->iod)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->radial)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->along)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->cross)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->dot_radial)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->dot_along)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->dot_cross)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->c0)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->c1)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->c2)) { + return false; + } return true; } -s8 sbp_msg_ssr_orbit_clock_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_orbit_clock_t *msg) { +s8 sbp_msg_ssr_orbit_clock_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_orbit_clock_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -638,26 +901,56 @@ s8 sbp_msg_ssr_orbit_clock_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_ssr_orbit_clock_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_orbit_clock_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iod_ssr)) { return false; } - if (!sbp_u32_decode(ctx, &msg->iod)) { return false; } - if (!sbp_s32_decode(ctx, &msg->radial)) { return false; } - if (!sbp_s32_decode(ctx, &msg->along)) { return false; } - if (!sbp_s32_decode(ctx, &msg->cross)) { return false; } - if (!sbp_s32_decode(ctx, &msg->dot_radial)) { return false; } - if (!sbp_s32_decode(ctx, &msg->dot_along)) { return false; } - if (!sbp_s32_decode(ctx, &msg->dot_cross)) { return false; } - if (!sbp_s32_decode(ctx, &msg->c0)) { return false; } - if (!sbp_s32_decode(ctx, &msg->c1)) { return false; } - if (!sbp_s32_decode(ctx, &msg->c2)) { return false; } +bool sbp_msg_ssr_orbit_clock_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ssr_orbit_clock_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iod_ssr)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->iod)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->radial)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->along)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->cross)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->dot_radial)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->dot_along)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->dot_cross)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->c0)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->c1)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->c2)) { + return false; + } return true; } -s8 sbp_msg_ssr_orbit_clock_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_orbit_clock_t *msg) { +s8 sbp_msg_ssr_orbit_clock_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ssr_orbit_clock_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -671,77 +964,120 @@ s8 sbp_msg_ssr_orbit_clock_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_ssr_orbit_clock_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_orbit_clock_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_orbit_clock_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_orbit_clock_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_orbit_clock_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_ORBIT_CLOCK, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_orbit_clock_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_ORBIT_CLOCK, sender_id, payload_len, + payload, write); } -int sbp_msg_ssr_orbit_clock_cmp(const sbp_msg_ssr_orbit_clock_t *a, const sbp_msg_ssr_orbit_clock_t *b) { +int sbp_msg_ssr_orbit_clock_cmp(const sbp_msg_ssr_orbit_clock_t *a, + const sbp_msg_ssr_orbit_clock_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->update_interval, &b->update_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iod_ssr, &b->iod_ssr); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->iod, &b->iod); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->radial, &b->radial); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->along, &b->along); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->cross, &b->cross); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->dot_radial, &b->dot_radial); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->dot_along, &b->dot_along); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->dot_cross, &b->dot_cross); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->c0, &b->c0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->c1, &b->c1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->c2, &b->c2); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_code_biases_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_code_biases_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iod_ssr)) { return false; } - for (size_t i = 0; i < msg->n_biases; i++) - { - if (!sbp_code_biases_content_encode_internal(ctx, &msg->biases[i])) { return false; } +bool sbp_msg_ssr_code_biases_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_code_biases_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iod_ssr)) { + return false; + } + for (size_t i = 0; i < msg->n_biases; i++) { + if (!sbp_code_biases_content_encode_internal(ctx, &msg->biases[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_code_biases_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_code_biases_t *msg) { +s8 sbp_msg_ssr_code_biases_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_code_biases_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -755,23 +1091,37 @@ s8 sbp_msg_ssr_code_biases_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_ssr_code_biases_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_code_biases_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iod_ssr)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_CODE_BIASES_CONTENT_ENCODED_LEN) != 0) { +bool sbp_msg_ssr_code_biases_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ssr_code_biases_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iod_ssr)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_CODE_BIASES_CONTENT_ENCODED_LEN) != + 0) { + return false; + } + msg->n_biases = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_CODE_BIASES_CONTENT_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_biases; i++) { + if (!sbp_code_biases_content_decode_internal(ctx, &msg->biases[i])) { return false; } - msg->n_biases = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_CODE_BIASES_CONTENT_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_biases; i++) { - if (!sbp_code_biases_content_decode_internal(ctx, &msg->biases[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_code_biases_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_code_biases_t *msg) { +s8 sbp_msg_ssr_code_biases_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ssr_code_biases_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -785,58 +1135,91 @@ s8 sbp_msg_ssr_code_biases_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - -s8 sbp_msg_ssr_code_biases_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_code_biases_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_code_biases_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_code_biases_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_code_biases_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_CODE_BIASES, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_code_biases_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_CODE_BIASES, sender_id, payload_len, + payload, write); } -int sbp_msg_ssr_code_biases_cmp(const sbp_msg_ssr_code_biases_t *a, const sbp_msg_ssr_code_biases_t *b) { +int sbp_msg_ssr_code_biases_cmp(const sbp_msg_ssr_code_biases_t *a, + const sbp_msg_ssr_code_biases_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->update_interval, &b->update_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iod_ssr, &b->iod_ssr); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_biases, &b->n_biases); - for (uint8_t i = 0; ret == 0 && i < a->n_biases; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_biases; i++) { ret = sbp_code_biases_content_cmp(&a->biases[i], &b->biases[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_phase_biases_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_phase_biases_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iod_ssr)) { return false; } - if (!sbp_u8_encode(ctx, &msg->dispersive_bias)) { return false; } - if (!sbp_u8_encode(ctx, &msg->mw_consistency)) { return false; } - if (!sbp_u16_encode(ctx, &msg->yaw)) { return false; } - if (!sbp_s8_encode(ctx, &msg->yaw_rate)) { return false; } - for (size_t i = 0; i < msg->n_biases; i++) - { - if (!sbp_phase_biases_content_encode_internal(ctx, &msg->biases[i])) { return false; } +bool sbp_msg_ssr_phase_biases_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_phase_biases_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { + return false; } - return true; + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iod_ssr)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->dispersive_bias)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->mw_consistency)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->yaw)) { + return false; + } + if (!sbp_s8_encode(ctx, &msg->yaw_rate)) { + return false; + } + for (size_t i = 0; i < msg->n_biases; i++) { + if (!sbp_phase_biases_content_encode_internal(ctx, &msg->biases[i])) { + return false; + } + } + return true; } -s8 sbp_msg_ssr_phase_biases_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_phase_biases_t *msg) { +s8 sbp_msg_ssr_phase_biases_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_ssr_phase_biases_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -850,27 +1233,49 @@ s8 sbp_msg_ssr_phase_biases_encode(uint8_t *buf, uint8_t len, uint8_t *n_written return SBP_OK; } -bool sbp_msg_ssr_phase_biases_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_phase_biases_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iod_ssr)) { return false; } - if (!sbp_u8_decode(ctx, &msg->dispersive_bias)) { return false; } - if (!sbp_u8_decode(ctx, &msg->mw_consistency)) { return false; } - if (!sbp_u16_decode(ctx, &msg->yaw)) { return false; } - if (!sbp_s8_decode(ctx, &msg->yaw_rate)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_PHASE_BIASES_CONTENT_ENCODED_LEN) != 0) { +bool sbp_msg_ssr_phase_biases_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ssr_phase_biases_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iod_ssr)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->dispersive_bias)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->mw_consistency)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->yaw)) { + return false; + } + if (!sbp_s8_decode(ctx, &msg->yaw_rate)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_PHASE_BIASES_CONTENT_ENCODED_LEN) != + 0) { + return false; + } + msg->n_biases = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_PHASE_BIASES_CONTENT_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_biases; i++) { + if (!sbp_phase_biases_content_decode_internal(ctx, &msg->biases[i])) { return false; } - msg->n_biases = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_PHASE_BIASES_CONTENT_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_biases; i++) { - if (!sbp_phase_biases_content_decode_internal(ctx, &msg->biases[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_phase_biases_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_phase_biases_t *msg) { +s8 sbp_msg_ssr_phase_biases_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ssr_phase_biases_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -884,63 +1289,90 @@ s8 sbp_msg_ssr_phase_biases_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r return SBP_OK; } - -s8 sbp_msg_ssr_phase_biases_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_phase_biases_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_phase_biases_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_phase_biases_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_phase_biases_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_PHASE_BIASES, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_phase_biases_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_PHASE_BIASES, sender_id, payload_len, + payload, write); } -int sbp_msg_ssr_phase_biases_cmp(const sbp_msg_ssr_phase_biases_t *a, const sbp_msg_ssr_phase_biases_t *b) { +int sbp_msg_ssr_phase_biases_cmp(const sbp_msg_ssr_phase_biases_t *a, + const sbp_msg_ssr_phase_biases_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->update_interval, &b->update_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iod_ssr, &b->iod_ssr); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->dispersive_bias, &b->dispersive_bias); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->mw_consistency, &b->mw_consistency); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->yaw, &b->yaw); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s8_cmp(&a->yaw_rate, &b->yaw_rate); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_biases, &b->n_biases); - for (uint8_t i = 0; ret == 0 && i < a->n_biases; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_biases; i++) { ret = sbp_phase_biases_content_cmp(&a->biases[i], &b->biases[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_stec_correction_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_stec_correction_dep_t *msg) -{ - if (!sbp_stec_header_encode_internal(ctx, &msg->header)) { return false; } - for (size_t i = 0; i < msg->n_stec_sat_list; i++) - { - if (!sbp_stec_sat_element_encode_internal(ctx, &msg->stec_sat_list[i])) { return false; } +bool sbp_msg_ssr_stec_correction_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_stec_correction_dep_t *msg) { + if (!sbp_stec_header_encode_internal(ctx, &msg->header)) { + return false; + } + for (size_t i = 0; i < msg->n_stec_sat_list; i++) { + if (!sbp_stec_sat_element_encode_internal(ctx, &msg->stec_sat_list[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_stec_correction_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_stec_correction_dep_t *msg) { +s8 sbp_msg_ssr_stec_correction_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_stec_correction_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -954,20 +1386,27 @@ s8 sbp_msg_ssr_stec_correction_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } -bool sbp_msg_ssr_stec_correction_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_stec_correction_dep_t *msg) -{ - if (!sbp_stec_header_decode_internal(ctx, &msg->header)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_STEC_SAT_ELEMENT_ENCODED_LEN) != 0) { +bool sbp_msg_ssr_stec_correction_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_stec_correction_dep_t *msg) { + if (!sbp_stec_header_decode_internal(ctx, &msg->header)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_STEC_SAT_ELEMENT_ENCODED_LEN) != 0) { + return false; + } + msg->n_stec_sat_list = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_STEC_SAT_ELEMENT_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_stec_sat_list; i++) { + if (!sbp_stec_sat_element_decode_internal(ctx, &msg->stec_sat_list[i])) { return false; } - msg->n_stec_sat_list = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_STEC_SAT_ELEMENT_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_stec_sat_list; i++) { - if (!sbp_stec_sat_element_decode_internal(ctx, &msg->stec_sat_list[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_stec_correction_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_stec_correction_dep_t *msg) { +s8 sbp_msg_ssr_stec_correction_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_stec_correction_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -981,42 +1420,62 @@ s8 sbp_msg_ssr_stec_correction_dep_decode(const uint8_t *buf, uint8_t len, uint8 return SBP_OK; } - -s8 sbp_msg_ssr_stec_correction_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_stec_correction_dep_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_stec_correction_dep_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_stec_correction_dep_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_stec_correction_dep_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_STEC_CORRECTION_DEP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_stec_correction_dep_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_STEC_CORRECTION_DEP, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_stec_correction_dep_cmp(const sbp_msg_ssr_stec_correction_dep_t *a, const sbp_msg_ssr_stec_correction_dep_t *b) { +int sbp_msg_ssr_stec_correction_dep_cmp( + const sbp_msg_ssr_stec_correction_dep_t *a, + const sbp_msg_ssr_stec_correction_dep_t *b) { int ret = 0; - + ret = sbp_stec_header_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_stec_sat_list, &b->n_stec_sat_list); - for (uint8_t i = 0; ret == 0 && i < a->n_stec_sat_list; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_stec_sat_list; i++) { ret = sbp_stec_sat_element_cmp(&a->stec_sat_list[i], &b->stec_sat_list[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_bounds_header_encode_internal(sbp_encode_ctx_t *ctx, const sbp_bounds_header_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { return false; } - if (!sbp_u8_encode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u8_encode(ctx, &msg->seq_num)) { return false; } - if (!sbp_u8_encode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->sol_id)) { return false; } +bool sbp_bounds_header_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_bounds_header_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->seq_num)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->sol_id)) { + return false; + } return true; } -s8 sbp_bounds_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_bounds_header_t *msg) { +s8 sbp_bounds_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_bounds_header_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1030,17 +1489,28 @@ s8 sbp_bounds_header_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_bounds_header_decode_internal(sbp_decode_ctx_t *ctx, sbp_bounds_header_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { return false; } - if (!sbp_u8_decode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u8_decode(ctx, &msg->seq_num)) { return false; } - if (!sbp_u8_decode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->sol_id)) { return false; } +bool sbp_bounds_header_decode_internal(sbp_decode_ctx_t *ctx, + sbp_bounds_header_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->seq_num)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->sol_id)) { + return false; + } return true; } -s8 sbp_bounds_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_bounds_header_t *msg) { +s8 sbp_bounds_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_bounds_header_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1054,43 +1524,65 @@ s8 sbp_bounds_header_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - - -int sbp_bounds_header_cmp(const sbp_bounds_header_t *a, const sbp_bounds_header_t *b) { +int sbp_bounds_header_cmp(const sbp_bounds_header_t *a, + const sbp_bounds_header_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->num_msgs, &b->num_msgs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->seq_num, &b->seq_num); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->update_interval, &b->update_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->sol_id, &b->sol_id); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_stec_correction_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_stec_correction_t *msg) -{ - if (!sbp_bounds_header_encode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_encode(ctx, &msg->ssr_iod_atmo)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tile_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - for (size_t i = 0; i < msg->n_sats; i++) - { - if (!sbp_stec_sat_element_encode_internal(ctx, &msg->stec_sat_list[i])) { return false; } +bool sbp_msg_ssr_stec_correction_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_stec_correction_t *msg) { + if (!sbp_bounds_header_encode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->ssr_iod_atmo)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + for (size_t i = 0; i < msg->n_sats; i++) { + if (!sbp_stec_sat_element_encode_internal(ctx, &msg->stec_sat_list[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_stec_correction_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_stec_correction_t *msg) { +s8 sbp_msg_ssr_stec_correction_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_stec_correction_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1104,24 +1596,39 @@ s8 sbp_msg_ssr_stec_correction_encode(uint8_t *buf, uint8_t len, uint8_t *n_writ return SBP_OK; } -bool sbp_msg_ssr_stec_correction_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_stec_correction_t *msg) -{ - if (!sbp_bounds_header_decode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_decode(ctx, &msg->ssr_iod_atmo)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tile_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_STEC_SAT_ELEMENT_ENCODED_LEN) != 0) { +bool sbp_msg_ssr_stec_correction_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_stec_correction_t *msg) { + if (!sbp_bounds_header_decode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->ssr_iod_atmo)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_STEC_SAT_ELEMENT_ENCODED_LEN) != 0) { + return false; + } + msg->n_sats = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_STEC_SAT_ELEMENT_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_sats; i++) { + if (!sbp_stec_sat_element_decode_internal(ctx, &msg->stec_sat_list[i])) { return false; } - msg->n_sats = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_STEC_SAT_ELEMENT_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_sats; i++) { - if (!sbp_stec_sat_element_decode_internal(ctx, &msg->stec_sat_list[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_stec_correction_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_stec_correction_t *msg) { +s8 sbp_msg_ssr_stec_correction_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ssr_stec_correction_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1135,56 +1642,82 @@ s8 sbp_msg_ssr_stec_correction_decode(const uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } - -s8 sbp_msg_ssr_stec_correction_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_stec_correction_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_stec_correction_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_stec_correction_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_stec_correction_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_STEC_CORRECTION, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_stec_correction_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_STEC_CORRECTION, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_stec_correction_cmp(const sbp_msg_ssr_stec_correction_t *a, const sbp_msg_ssr_stec_correction_t *b) { +int sbp_msg_ssr_stec_correction_cmp(const sbp_msg_ssr_stec_correction_t *a, + const sbp_msg_ssr_stec_correction_t *b) { int ret = 0; - + ret = sbp_bounds_header_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->ssr_iod_atmo, &b->ssr_iod_atmo); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tile_set_id, &b->tile_set_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tile_id, &b->tile_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - for (uint8_t i = 0; ret == 0 && i < a->n_sats; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_sats; i++) { ret = sbp_stec_sat_element_cmp(&a->stec_sat_list[i], &b->stec_sat_list[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_gridded_correction_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_gridded_correction_t *msg) -{ - if (!sbp_gridded_correction_header_encode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u16_encode(ctx, &msg->index)) { return false; } - if (!sbp_tropospheric_delay_correction_encode_internal(ctx, &msg->tropo_delay_correction)) { return false; } - for (size_t i = 0; i < msg->n_stec_residuals; i++) - { - if (!sbp_stec_residual_encode_internal(ctx, &msg->stec_residuals[i])) { return false; } +bool sbp_msg_ssr_gridded_correction_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_gridded_correction_t *msg) { + if (!sbp_gridded_correction_header_encode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->index)) { + return false; + } + if (!sbp_tropospheric_delay_correction_encode_internal( + ctx, &msg->tropo_delay_correction)) { + return false; + } + for (size_t i = 0; i < msg->n_stec_residuals; i++) { + if (!sbp_stec_residual_encode_internal(ctx, &msg->stec_residuals[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_gridded_correction_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_gridded_correction_t *msg) { +s8 sbp_msg_ssr_gridded_correction_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_gridded_correction_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1198,22 +1731,34 @@ s8 sbp_msg_ssr_gridded_correction_encode(uint8_t *buf, uint8_t len, uint8_t *n_w return SBP_OK; } -bool sbp_msg_ssr_gridded_correction_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_t *msg) -{ - if (!sbp_gridded_correction_header_decode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u16_decode(ctx, &msg->index)) { return false; } - if (!sbp_tropospheric_delay_correction_decode_internal(ctx, &msg->tropo_delay_correction)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_STEC_RESIDUAL_ENCODED_LEN) != 0) { +bool sbp_msg_ssr_gridded_correction_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_t *msg) { + if (!sbp_gridded_correction_header_decode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->index)) { + return false; + } + if (!sbp_tropospheric_delay_correction_decode_internal( + ctx, &msg->tropo_delay_correction)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_STEC_RESIDUAL_ENCODED_LEN) != 0) { + return false; + } + msg->n_stec_residuals = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_STEC_RESIDUAL_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_stec_residuals; i++) { + if (!sbp_stec_residual_decode_internal(ctx, &msg->stec_residuals[i])) { return false; } - msg->n_stec_residuals = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_STEC_RESIDUAL_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_stec_residuals; i++) { - if (!sbp_stec_residual_decode_internal(ctx, &msg->stec_residuals[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_gridded_correction_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_gridded_correction_t *msg) { +s8 sbp_msg_ssr_gridded_correction_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_gridded_correction_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1227,48 +1772,74 @@ s8 sbp_msg_ssr_gridded_correction_decode(const uint8_t *buf, uint8_t len, uint8_ return SBP_OK; } - -s8 sbp_msg_ssr_gridded_correction_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_gridded_correction_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_gridded_correction_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_gridded_correction_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_gridded_correction_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_GRIDDED_CORRECTION, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_gridded_correction_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_GRIDDED_CORRECTION, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_gridded_correction_cmp(const sbp_msg_ssr_gridded_correction_t *a, const sbp_msg_ssr_gridded_correction_t *b) { +int sbp_msg_ssr_gridded_correction_cmp( + const sbp_msg_ssr_gridded_correction_t *a, + const sbp_msg_ssr_gridded_correction_t *b) { int ret = 0; - + ret = sbp_gridded_correction_header_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->index, &b->index); - if (ret != 0) { return ret; } - - ret = sbp_tropospheric_delay_correction_cmp(&a->tropo_delay_correction, &b->tropo_delay_correction); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + + ret = sbp_tropospheric_delay_correction_cmp(&a->tropo_delay_correction, + &b->tropo_delay_correction); + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_stec_residuals, &b->n_stec_residuals); - for (uint8_t i = 0; ret == 0 && i < a->n_stec_residuals; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_stec_residuals; i++) { ret = sbp_stec_residual_cmp(&a->stec_residuals[i], &b->stec_residuals[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_stec_sat_element_integrity_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec_sat_element_integrity_t *msg) -{ - if (!sbp_stec_residual_encode_internal(ctx, &msg->stec_residual)) { return false; } - if (!sbp_u8_encode(ctx, &msg->stec_bound_mu)) { return false; } - if (!sbp_u8_encode(ctx, &msg->stec_bound_sig)) { return false; } - if (!sbp_u8_encode(ctx, &msg->stec_bound_mu_dot)) { return false; } - if (!sbp_u8_encode(ctx, &msg->stec_bound_sig_dot)) { return false; } +bool sbp_stec_sat_element_integrity_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_stec_sat_element_integrity_t *msg) { + if (!sbp_stec_residual_encode_internal(ctx, &msg->stec_residual)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->stec_bound_mu)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->stec_bound_sig)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->stec_bound_mu_dot)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->stec_bound_sig_dot)) { + return false; + } return true; } -s8 sbp_stec_sat_element_integrity_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_stec_sat_element_integrity_t *msg) { +s8 sbp_stec_sat_element_integrity_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_stec_sat_element_integrity_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1282,17 +1853,29 @@ s8 sbp_stec_sat_element_integrity_encode(uint8_t *buf, uint8_t len, uint8_t *n_w return SBP_OK; } -bool sbp_stec_sat_element_integrity_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_sat_element_integrity_t *msg) -{ - if (!sbp_stec_residual_decode_internal(ctx, &msg->stec_residual)) { return false; } - if (!sbp_u8_decode(ctx, &msg->stec_bound_mu)) { return false; } - if (!sbp_u8_decode(ctx, &msg->stec_bound_sig)) { return false; } - if (!sbp_u8_decode(ctx, &msg->stec_bound_mu_dot)) { return false; } - if (!sbp_u8_decode(ctx, &msg->stec_bound_sig_dot)) { return false; } +bool sbp_stec_sat_element_integrity_decode_internal( + sbp_decode_ctx_t *ctx, sbp_stec_sat_element_integrity_t *msg) { + if (!sbp_stec_residual_decode_internal(ctx, &msg->stec_residual)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->stec_bound_mu)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->stec_bound_sig)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->stec_bound_mu_dot)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->stec_bound_sig_dot)) { + return false; + } return true; } -s8 sbp_stec_sat_element_integrity_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_stec_sat_element_integrity_t *msg) { +s8 sbp_stec_sat_element_integrity_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_stec_sat_element_integrity_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1306,50 +1889,89 @@ s8 sbp_stec_sat_element_integrity_decode(const uint8_t *buf, uint8_t len, uint8_ return SBP_OK; } - - -int sbp_stec_sat_element_integrity_cmp(const sbp_stec_sat_element_integrity_t *a, const sbp_stec_sat_element_integrity_t *b) { +int sbp_stec_sat_element_integrity_cmp( + const sbp_stec_sat_element_integrity_t *a, + const sbp_stec_sat_element_integrity_t *b) { int ret = 0; - + ret = sbp_stec_residual_cmp(&a->stec_residual, &b->stec_residual); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->stec_bound_mu, &b->stec_bound_mu); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->stec_bound_sig, &b->stec_bound_sig); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->stec_bound_mu_dot, &b->stec_bound_mu_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->stec_bound_sig_dot, &b->stec_bound_sig_dot); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_gridded_correction_bounds_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_gridded_correction_bounds_t *msg) -{ - if (!sbp_bounds_header_encode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_encode(ctx, &msg->ssr_iod_atmo)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tile_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->tropo_qi)) { return false; } - if (!sbp_u16_encode(ctx, &msg->grid_point_id)) { return false; } - if (!sbp_tropospheric_delay_correction_encode_internal(ctx, &msg->tropo_delay_correction)) { return false; } - if (!sbp_u8_encode(ctx, &msg->tropo_v_hydro_bound_mu)) { return false; } - if (!sbp_u8_encode(ctx, &msg->tropo_v_hydro_bound_sig)) { return false; } - if (!sbp_u8_encode(ctx, &msg->tropo_v_wet_bound_mu)) { return false; } - if (!sbp_u8_encode(ctx, &msg->tropo_v_wet_bound_sig)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - for (size_t i = 0; i < msg->n_sats; i++) - { - if (!sbp_stec_sat_element_integrity_encode_internal(ctx, &msg->stec_sat_list[i])) { return false; } +bool sbp_msg_ssr_gridded_correction_bounds_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_gridded_correction_bounds_t *msg) { + if (!sbp_bounds_header_encode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->ssr_iod_atmo)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->tropo_qi)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->grid_point_id)) { + return false; + } + if (!sbp_tropospheric_delay_correction_encode_internal( + ctx, &msg->tropo_delay_correction)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->tropo_v_hydro_bound_mu)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->tropo_v_hydro_bound_sig)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->tropo_v_wet_bound_mu)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->tropo_v_wet_bound_sig)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + for (size_t i = 0; i < msg->n_sats; i++) { + if (!sbp_stec_sat_element_integrity_encode_internal( + ctx, &msg->stec_sat_list[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_gridded_correction_bounds_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_gridded_correction_bounds_t *msg) { +s8 sbp_msg_ssr_gridded_correction_bounds_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_gridded_correction_bounds_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1363,31 +1985,63 @@ s8 sbp_msg_ssr_gridded_correction_bounds_encode(uint8_t *buf, uint8_t len, uint8 return SBP_OK; } -bool sbp_msg_ssr_gridded_correction_bounds_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_bounds_t *msg) -{ - if (!sbp_bounds_header_decode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_decode(ctx, &msg->ssr_iod_atmo)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tile_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->tropo_qi)) { return false; } - if (!sbp_u16_decode(ctx, &msg->grid_point_id)) { return false; } - if (!sbp_tropospheric_delay_correction_decode_internal(ctx, &msg->tropo_delay_correction)) { return false; } - if (!sbp_u8_decode(ctx, &msg->tropo_v_hydro_bound_mu)) { return false; } - if (!sbp_u8_decode(ctx, &msg->tropo_v_hydro_bound_sig)) { return false; } - if (!sbp_u8_decode(ctx, &msg->tropo_v_wet_bound_mu)) { return false; } - if (!sbp_u8_decode(ctx, &msg->tropo_v_wet_bound_sig)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_STEC_SAT_ELEMENT_INTEGRITY_ENCODED_LEN) != 0) { +bool sbp_msg_ssr_gridded_correction_bounds_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_bounds_t *msg) { + if (!sbp_bounds_header_decode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->ssr_iod_atmo)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->tropo_qi)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->grid_point_id)) { + return false; + } + if (!sbp_tropospheric_delay_correction_decode_internal( + ctx, &msg->tropo_delay_correction)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->tropo_v_hydro_bound_mu)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->tropo_v_hydro_bound_sig)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->tropo_v_wet_bound_mu)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->tropo_v_wet_bound_sig)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % + SBP_STEC_SAT_ELEMENT_INTEGRITY_ENCODED_LEN) != 0) { + return false; + } + msg->n_sats = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_STEC_SAT_ELEMENT_INTEGRITY_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_sats; i++) { + if (!sbp_stec_sat_element_integrity_decode_internal( + ctx, &msg->stec_sat_list[i])) { return false; } - msg->n_sats = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_STEC_SAT_ELEMENT_INTEGRITY_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_sats; i++) { - if (!sbp_stec_sat_element_integrity_decode_internal(ctx, &msg->stec_sat_list[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_gridded_correction_bounds_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_gridded_correction_bounds_t *msg) { +s8 sbp_msg_ssr_gridded_correction_bounds_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_gridded_correction_bounds_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1401,79 +2055,132 @@ s8 sbp_msg_ssr_gridded_correction_bounds_decode(const uint8_t *buf, uint8_t len, return SBP_OK; } - -s8 sbp_msg_ssr_gridded_correction_bounds_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_gridded_correction_bounds_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_gridded_correction_bounds_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_gridded_correction_bounds_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_gridded_correction_bounds_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_GRIDDED_CORRECTION_BOUNDS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_gridded_correction_bounds_encode( + payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_GRIDDED_CORRECTION_BOUNDS, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_gridded_correction_bounds_cmp(const sbp_msg_ssr_gridded_correction_bounds_t *a, const sbp_msg_ssr_gridded_correction_bounds_t *b) { +int sbp_msg_ssr_gridded_correction_bounds_cmp( + const sbp_msg_ssr_gridded_correction_bounds_t *a, + const sbp_msg_ssr_gridded_correction_bounds_t *b) { int ret = 0; - + ret = sbp_bounds_header_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->ssr_iod_atmo, &b->ssr_iod_atmo); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tile_set_id, &b->tile_set_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tile_id, &b->tile_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->tropo_qi, &b->tropo_qi); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->grid_point_id, &b->grid_point_id); - if (ret != 0) { return ret; } - - ret = sbp_tropospheric_delay_correction_cmp(&a->tropo_delay_correction, &b->tropo_delay_correction); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + + ret = sbp_tropospheric_delay_correction_cmp(&a->tropo_delay_correction, + &b->tropo_delay_correction); + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->tropo_v_hydro_bound_mu, &b->tropo_v_hydro_bound_mu); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->tropo_v_hydro_bound_sig, &b->tropo_v_hydro_bound_sig); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->tropo_v_wet_bound_mu, &b->tropo_v_wet_bound_mu); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->tropo_v_wet_bound_sig, &b->tropo_v_wet_bound_sig); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - for (uint8_t i = 0; ret == 0 && i < a->n_sats; i++) - { - ret = sbp_stec_sat_element_integrity_cmp(&a->stec_sat_list[i], &b->stec_sat_list[i]); + for (uint8_t i = 0; ret == 0 && i < a->n_sats; i++) { + ret = sbp_stec_sat_element_integrity_cmp(&a->stec_sat_list[i], + &b->stec_sat_list[i]); + } + if (ret != 0) { + return ret; } - if (ret != 0) { return ret; } return ret; } -bool sbp_msg_ssr_tile_definition_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_tile_definition_dep_a_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tile_id)) { return false; } - if (!sbp_s16_encode(ctx, &msg->corner_nw_lat)) { return false; } - if (!sbp_s16_encode(ctx, &msg->corner_nw_lon)) { return false; } - if (!sbp_u16_encode(ctx, &msg->spacing_lat)) { return false; } - if (!sbp_u16_encode(ctx, &msg->spacing_lon)) { return false; } - if (!sbp_u16_encode(ctx, &msg->rows)) { return false; } - if (!sbp_u16_encode(ctx, &msg->cols)) { return false; } - if (!sbp_u64_encode(ctx, &msg->bitmask)) { return false; } +bool sbp_msg_ssr_tile_definition_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_tile_definition_dep_a_t *msg) { + if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->corner_nw_lat)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->corner_nw_lon)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->spacing_lat)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->spacing_lon)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->rows)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->cols)) { + return false; + } + if (!sbp_u64_encode(ctx, &msg->bitmask)) { + return false; + } return true; } -s8 sbp_msg_ssr_tile_definition_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_tile_definition_dep_a_t *msg) { +s8 sbp_msg_ssr_tile_definition_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_tile_definition_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1487,21 +2194,41 @@ s8 sbp_msg_ssr_tile_definition_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } -bool sbp_msg_ssr_tile_definition_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_tile_definition_dep_a_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tile_id)) { return false; } - if (!sbp_s16_decode(ctx, &msg->corner_nw_lat)) { return false; } - if (!sbp_s16_decode(ctx, &msg->corner_nw_lon)) { return false; } - if (!sbp_u16_decode(ctx, &msg->spacing_lat)) { return false; } - if (!sbp_u16_decode(ctx, &msg->spacing_lon)) { return false; } - if (!sbp_u16_decode(ctx, &msg->rows)) { return false; } - if (!sbp_u16_decode(ctx, &msg->cols)) { return false; } - if (!sbp_u64_decode(ctx, &msg->bitmask)) { return false; } +bool sbp_msg_ssr_tile_definition_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_tile_definition_dep_a_t *msg) { + if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->corner_nw_lat)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->corner_nw_lon)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->spacing_lat)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->spacing_lon)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->rows)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->cols)) { + return false; + } + if (!sbp_u64_decode(ctx, &msg->bitmask)) { + return false; + } return true; } -s8 sbp_msg_ssr_tile_definition_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_tile_definition_dep_a_t *msg) { +s8 sbp_msg_ssr_tile_definition_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_tile_definition_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1515,64 +2242,110 @@ s8 sbp_msg_ssr_tile_definition_dep_a_decode(const uint8_t *buf, uint8_t len, uin return SBP_OK; } - -s8 sbp_msg_ssr_tile_definition_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_tile_definition_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_tile_definition_dep_a_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_tile_definition_dep_a_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_tile_definition_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_TILE_DEFINITION_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_tile_definition_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_TILE_DEFINITION_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_tile_definition_dep_a_cmp(const sbp_msg_ssr_tile_definition_dep_a_t *a, const sbp_msg_ssr_tile_definition_dep_a_t *b) { +int sbp_msg_ssr_tile_definition_dep_a_cmp( + const sbp_msg_ssr_tile_definition_dep_a_t *a, + const sbp_msg_ssr_tile_definition_dep_a_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->tile_set_id, &b->tile_set_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tile_id, &b->tile_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->corner_nw_lat, &b->corner_nw_lat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->corner_nw_lon, &b->corner_nw_lon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->spacing_lat, &b->spacing_lat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->spacing_lon, &b->spacing_lon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->rows, &b->rows); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->cols, &b->cols); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u64_cmp(&a->bitmask, &b->bitmask); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_tile_definition_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_tile_definition_dep_b_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->ssr_sol_id)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tile_id)) { return false; } - if (!sbp_s16_encode(ctx, &msg->corner_nw_lat)) { return false; } - if (!sbp_s16_encode(ctx, &msg->corner_nw_lon)) { return false; } - if (!sbp_u16_encode(ctx, &msg->spacing_lat)) { return false; } - if (!sbp_u16_encode(ctx, &msg->spacing_lon)) { return false; } - if (!sbp_u16_encode(ctx, &msg->rows)) { return false; } - if (!sbp_u16_encode(ctx, &msg->cols)) { return false; } - if (!sbp_u64_encode(ctx, &msg->bitmask)) { return false; } +bool sbp_msg_ssr_tile_definition_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_tile_definition_dep_b_t *msg) { + if (!sbp_u8_encode(ctx, &msg->ssr_sol_id)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->corner_nw_lat)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->corner_nw_lon)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->spacing_lat)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->spacing_lon)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->rows)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->cols)) { + return false; + } + if (!sbp_u64_encode(ctx, &msg->bitmask)) { + return false; + } return true; } -s8 sbp_msg_ssr_tile_definition_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_tile_definition_dep_b_t *msg) { +s8 sbp_msg_ssr_tile_definition_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_tile_definition_dep_b_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1586,22 +2359,44 @@ s8 sbp_msg_ssr_tile_definition_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } -bool sbp_msg_ssr_tile_definition_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_tile_definition_dep_b_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->ssr_sol_id)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tile_id)) { return false; } - if (!sbp_s16_decode(ctx, &msg->corner_nw_lat)) { return false; } - if (!sbp_s16_decode(ctx, &msg->corner_nw_lon)) { return false; } - if (!sbp_u16_decode(ctx, &msg->spacing_lat)) { return false; } - if (!sbp_u16_decode(ctx, &msg->spacing_lon)) { return false; } - if (!sbp_u16_decode(ctx, &msg->rows)) { return false; } - if (!sbp_u16_decode(ctx, &msg->cols)) { return false; } - if (!sbp_u64_decode(ctx, &msg->bitmask)) { return false; } - return true; -} +bool sbp_msg_ssr_tile_definition_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_tile_definition_dep_b_t *msg) { + if (!sbp_u8_decode(ctx, &msg->ssr_sol_id)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->corner_nw_lat)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->corner_nw_lon)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->spacing_lat)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->spacing_lon)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->rows)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->cols)) { + return false; + } + if (!sbp_u64_decode(ctx, &msg->bitmask)) { + return false; + } + return true; +} -s8 sbp_msg_ssr_tile_definition_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_tile_definition_dep_b_t *msg) { +s8 sbp_msg_ssr_tile_definition_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_tile_definition_dep_b_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1615,70 +2410,124 @@ s8 sbp_msg_ssr_tile_definition_dep_b_decode(const uint8_t *buf, uint8_t len, uin return SBP_OK; } - -s8 sbp_msg_ssr_tile_definition_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_tile_definition_dep_b_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_tile_definition_dep_b_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_tile_definition_dep_b_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_tile_definition_dep_b_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_TILE_DEFINITION_DEP_B, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_tile_definition_dep_b_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_TILE_DEFINITION_DEP_B, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_tile_definition_dep_b_cmp(const sbp_msg_ssr_tile_definition_dep_b_t *a, const sbp_msg_ssr_tile_definition_dep_b_t *b) { +int sbp_msg_ssr_tile_definition_dep_b_cmp( + const sbp_msg_ssr_tile_definition_dep_b_t *a, + const sbp_msg_ssr_tile_definition_dep_b_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->ssr_sol_id, &b->ssr_sol_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tile_set_id, &b->tile_set_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tile_id, &b->tile_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->corner_nw_lat, &b->corner_nw_lat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->corner_nw_lon, &b->corner_nw_lon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->spacing_lat, &b->spacing_lat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->spacing_lon, &b->spacing_lon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->rows, &b->rows); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->cols, &b->cols); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u64_cmp(&a->bitmask, &b->bitmask); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_tile_definition_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_tile_definition_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { return false; } - if (!sbp_u8_encode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->sol_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iod_atmo)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_encode(ctx, &msg->tile_id)) { return false; } - if (!sbp_s16_encode(ctx, &msg->corner_nw_lat)) { return false; } - if (!sbp_s16_encode(ctx, &msg->corner_nw_lon)) { return false; } - if (!sbp_u16_encode(ctx, &msg->spacing_lat)) { return false; } - if (!sbp_u16_encode(ctx, &msg->spacing_lon)) { return false; } - if (!sbp_u16_encode(ctx, &msg->rows)) { return false; } - if (!sbp_u16_encode(ctx, &msg->cols)) { return false; } - if (!sbp_u64_encode(ctx, &msg->bitmask)) { return false; } +bool sbp_msg_ssr_tile_definition_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_tile_definition_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->sol_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iod_atmo)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->corner_nw_lat)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->corner_nw_lon)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->spacing_lat)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->spacing_lon)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->rows)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->cols)) { + return false; + } + if (!sbp_u64_encode(ctx, &msg->bitmask)) { + return false; + } return true; } -s8 sbp_msg_ssr_tile_definition_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_tile_definition_t *msg) { +s8 sbp_msg_ssr_tile_definition_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_tile_definition_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1692,25 +2541,53 @@ s8 sbp_msg_ssr_tile_definition_encode(uint8_t *buf, uint8_t len, uint8_t *n_writ return SBP_OK; } -bool sbp_msg_ssr_tile_definition_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_tile_definition_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { return false; } - if (!sbp_u8_decode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->sol_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iod_atmo)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { return false; } - if (!sbp_u16_decode(ctx, &msg->tile_id)) { return false; } - if (!sbp_s16_decode(ctx, &msg->corner_nw_lat)) { return false; } - if (!sbp_s16_decode(ctx, &msg->corner_nw_lon)) { return false; } - if (!sbp_u16_decode(ctx, &msg->spacing_lat)) { return false; } - if (!sbp_u16_decode(ctx, &msg->spacing_lon)) { return false; } - if (!sbp_u16_decode(ctx, &msg->rows)) { return false; } - if (!sbp_u16_decode(ctx, &msg->cols)) { return false; } - if (!sbp_u64_decode(ctx, &msg->bitmask)) { return false; } +bool sbp_msg_ssr_tile_definition_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_tile_definition_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->sol_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iod_atmo)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tile_set_id)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->tile_id)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->corner_nw_lat)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->corner_nw_lon)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->spacing_lat)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->spacing_lon)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->rows)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->cols)) { + return false; + } + if (!sbp_u64_decode(ctx, &msg->bitmask)) { + return false; + } return true; } -s8 sbp_msg_ssr_tile_definition_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_tile_definition_t *msg) { +s8 sbp_msg_ssr_tile_definition_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ssr_tile_definition_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1724,77 +2601,117 @@ s8 sbp_msg_ssr_tile_definition_decode(const uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } - -s8 sbp_msg_ssr_tile_definition_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_tile_definition_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_tile_definition_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_tile_definition_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_tile_definition_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_TILE_DEFINITION, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_tile_definition_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_TILE_DEFINITION, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_tile_definition_cmp(const sbp_msg_ssr_tile_definition_t *a, const sbp_msg_ssr_tile_definition_t *b) { +int sbp_msg_ssr_tile_definition_cmp(const sbp_msg_ssr_tile_definition_t *a, + const sbp_msg_ssr_tile_definition_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->update_interval, &b->update_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->sol_id, &b->sol_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iod_atmo, &b->iod_atmo); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tile_set_id, &b->tile_set_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->tile_id, &b->tile_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->corner_nw_lat, &b->corner_nw_lat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->corner_nw_lon, &b->corner_nw_lon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->spacing_lat, &b->spacing_lat); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->spacing_lon, &b->spacing_lon); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->rows, &b->rows); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->cols, &b->cols); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u64_cmp(&a->bitmask, &b->bitmask); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_satellite_apc_encode_internal(sbp_encode_ctx_t *ctx, const sbp_satellite_apc_t *msg) -{ - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->sat_info)) { return false; } - if (!sbp_u16_encode(ctx, &msg->svn)) { return false; } - for (size_t i = 0; i < SBP_SATELLITE_APC_PCO_MAX; i++) - { - if (!sbp_s16_encode(ctx, &msg->pco[i])) { return false; } +bool sbp_satellite_apc_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_satellite_apc_t *msg) { + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->sat_info)) { + return false; } - for (size_t i = 0; i < SBP_SATELLITE_APC_PCV_MAX; i++) - { - if (!sbp_s8_encode(ctx, &msg->pcv[i])) { return false; } + if (!sbp_u16_encode(ctx, &msg->svn)) { + return false; + } + for (size_t i = 0; i < SBP_SATELLITE_APC_PCO_MAX; i++) { + if (!sbp_s16_encode(ctx, &msg->pco[i])) { + return false; + } + } + for (size_t i = 0; i < SBP_SATELLITE_APC_PCV_MAX; i++) { + if (!sbp_s8_encode(ctx, &msg->pcv[i])) { + return false; + } } return true; } -s8 sbp_satellite_apc_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_satellite_apc_t *msg) { +s8 sbp_satellite_apc_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_satellite_apc_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1808,21 +2725,32 @@ s8 sbp_satellite_apc_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_satellite_apc_decode_internal(sbp_decode_ctx_t *ctx, sbp_satellite_apc_t *msg) -{ - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->sat_info)) { return false; } - if (!sbp_u16_decode(ctx, &msg->svn)) { return false; } +bool sbp_satellite_apc_decode_internal(sbp_decode_ctx_t *ctx, + sbp_satellite_apc_t *msg) { + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->sat_info)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->svn)) { + return false; + } for (uint8_t i = 0; i < SBP_SATELLITE_APC_PCO_MAX; i++) { - if (!sbp_s16_decode(ctx, &msg->pco[i])) { return false; } + if (!sbp_s16_decode(ctx, &msg->pco[i])) { + return false; + } } for (uint8_t i = 0; i < SBP_SATELLITE_APC_PCV_MAX; i++) { - if (!sbp_s8_decode(ctx, &msg->pcv[i])) { return false; } + if (!sbp_s8_decode(ctx, &msg->pcv[i])) { + return false; + } } return true; } -s8 sbp_satellite_apc_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_satellite_apc_t *msg) { +s8 sbp_satellite_apc_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_satellite_apc_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1836,44 +2764,54 @@ s8 sbp_satellite_apc_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - - -int sbp_satellite_apc_cmp(const sbp_satellite_apc_t *a, const sbp_satellite_apc_t *b) { +int sbp_satellite_apc_cmp(const sbp_satellite_apc_t *a, + const sbp_satellite_apc_t *b) { int ret = 0; - + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->sat_info, &b->sat_info); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->svn, &b->svn); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_SATELLITE_APC_PCO_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_SATELLITE_APC_PCO_MAX; i++) { ret = sbp_s16_cmp(&a->pco[i], &b->pco[i]); } - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_SATELLITE_APC_PCV_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_SATELLITE_APC_PCV_MAX; i++) { ret = sbp_s8_cmp(&a->pcv[i], &b->pcv[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_satellite_apc_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_satellite_apc_dep_t *msg) -{ - for (size_t i = 0; i < msg->n_apc; i++) - { - if (!sbp_satellite_apc_encode_internal(ctx, &msg->apc[i])) { return false; } +bool sbp_msg_ssr_satellite_apc_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_satellite_apc_dep_t *msg) { + for (size_t i = 0; i < msg->n_apc; i++) { + if (!sbp_satellite_apc_encode_internal(ctx, &msg->apc[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_satellite_apc_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_satellite_apc_dep_t *msg) { +s8 sbp_msg_ssr_satellite_apc_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_satellite_apc_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1887,19 +2825,24 @@ s8 sbp_msg_ssr_satellite_apc_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_wr return SBP_OK; } -bool sbp_msg_ssr_satellite_apc_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_satellite_apc_dep_t *msg) -{ - if ( ((ctx->buf_len - ctx->offset) % SBP_SATELLITE_APC_ENCODED_LEN) != 0) { +bool sbp_msg_ssr_satellite_apc_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_satellite_apc_dep_t *msg) { + if (((ctx->buf_len - ctx->offset) % SBP_SATELLITE_APC_ENCODED_LEN) != 0) { + return false; + } + msg->n_apc = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_SATELLITE_APC_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_apc; i++) { + if (!sbp_satellite_apc_decode_internal(ctx, &msg->apc[i])) { return false; } - msg->n_apc = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_SATELLITE_APC_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_apc; i++) { - if (!sbp_satellite_apc_decode_internal(ctx, &msg->apc[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_satellite_apc_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_satellite_apc_dep_t *msg) { +s8 sbp_msg_ssr_satellite_apc_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ssr_satellite_apc_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1913,42 +2856,60 @@ s8 sbp_msg_ssr_satellite_apc_dep_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_ssr_satellite_apc_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_satellite_apc_dep_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_satellite_apc_dep_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_satellite_apc_dep_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_satellite_apc_dep_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_SATELLITE_APC_DEP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_satellite_apc_dep_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_SATELLITE_APC_DEP, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_satellite_apc_dep_cmp(const sbp_msg_ssr_satellite_apc_dep_t *a, const sbp_msg_ssr_satellite_apc_dep_t *b) { +int sbp_msg_ssr_satellite_apc_dep_cmp( + const sbp_msg_ssr_satellite_apc_dep_t *a, + const sbp_msg_ssr_satellite_apc_dep_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->n_apc, &b->n_apc); - for (uint8_t i = 0; ret == 0 && i < a->n_apc; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_apc; i++) { ret = sbp_satellite_apc_cmp(&a->apc[i], &b->apc[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_satellite_apc_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_satellite_apc_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { return false; } - if (!sbp_u8_encode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->sol_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iod_ssr)) { return false; } - for (size_t i = 0; i < msg->n_apc; i++) - { - if (!sbp_satellite_apc_encode_internal(ctx, &msg->apc[i])) { return false; } +bool sbp_msg_ssr_satellite_apc_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_satellite_apc_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->sol_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iod_ssr)) { + return false; + } + for (size_t i = 0; i < msg->n_apc; i++) { + if (!sbp_satellite_apc_encode_internal(ctx, &msg->apc[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_satellite_apc_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_satellite_apc_t *msg) { +s8 sbp_msg_ssr_satellite_apc_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_ssr_satellite_apc_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1962,23 +2923,36 @@ s8 sbp_msg_ssr_satellite_apc_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_ssr_satellite_apc_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_satellite_apc_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { return false; } - if (!sbp_u8_decode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->sol_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iod_ssr)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_SATELLITE_APC_ENCODED_LEN) != 0) { +bool sbp_msg_ssr_satellite_apc_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_satellite_apc_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->sol_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iod_ssr)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_SATELLITE_APC_ENCODED_LEN) != 0) { + return false; + } + msg->n_apc = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_SATELLITE_APC_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_apc; i++) { + if (!sbp_satellite_apc_decode_internal(ctx, &msg->apc[i])) { return false; } - msg->n_apc = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_SATELLITE_APC_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_apc; i++) { - if (!sbp_satellite_apc_decode_internal(ctx, &msg->apc[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_satellite_apc_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_satellite_apc_t *msg) { +s8 sbp_msg_ssr_satellite_apc_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ssr_satellite_apc_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1992,60 +2966,104 @@ s8 sbp_msg_ssr_satellite_apc_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_ssr_satellite_apc_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_satellite_apc_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_satellite_apc_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_satellite_apc_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_satellite_apc_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_SATELLITE_APC, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_satellite_apc_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_SATELLITE_APC, sender_id, payload_len, + payload, write); } -int sbp_msg_ssr_satellite_apc_cmp(const sbp_msg_ssr_satellite_apc_t *a, const sbp_msg_ssr_satellite_apc_t *b) { +int sbp_msg_ssr_satellite_apc_cmp(const sbp_msg_ssr_satellite_apc_t *a, + const sbp_msg_ssr_satellite_apc_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->update_interval, &b->update_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->sol_id, &b->sol_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iod_ssr, &b->iod_ssr); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_apc, &b->n_apc); - for (uint8_t i = 0; ret == 0 && i < a->n_apc; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_apc; i++) { ret = sbp_satellite_apc_cmp(&a->apc[i], &b->apc[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_orbit_clock_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_orbit_clock_dep_a_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iod_ssr)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iod)) { return false; } - if (!sbp_s32_encode(ctx, &msg->radial)) { return false; } - if (!sbp_s32_encode(ctx, &msg->along)) { return false; } - if (!sbp_s32_encode(ctx, &msg->cross)) { return false; } - if (!sbp_s32_encode(ctx, &msg->dot_radial)) { return false; } - if (!sbp_s32_encode(ctx, &msg->dot_along)) { return false; } - if (!sbp_s32_encode(ctx, &msg->dot_cross)) { return false; } - if (!sbp_s32_encode(ctx, &msg->c0)) { return false; } - if (!sbp_s32_encode(ctx, &msg->c1)) { return false; } - if (!sbp_s32_encode(ctx, &msg->c2)) { return false; } +bool sbp_msg_ssr_orbit_clock_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_orbit_clock_dep_a_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iod_ssr)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iod)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->radial)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->along)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->cross)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->dot_radial)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->dot_along)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->dot_cross)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->c0)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->c1)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->c2)) { + return false; + } return true; } -s8 sbp_msg_ssr_orbit_clock_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_orbit_clock_dep_a_t *msg) { +s8 sbp_msg_ssr_orbit_clock_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_orbit_clock_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2059,26 +3077,56 @@ s8 sbp_msg_ssr_orbit_clock_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_wr return SBP_OK; } -bool sbp_msg_ssr_orbit_clock_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_orbit_clock_dep_a_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iod_ssr)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iod)) { return false; } - if (!sbp_s32_decode(ctx, &msg->radial)) { return false; } - if (!sbp_s32_decode(ctx, &msg->along)) { return false; } - if (!sbp_s32_decode(ctx, &msg->cross)) { return false; } - if (!sbp_s32_decode(ctx, &msg->dot_radial)) { return false; } - if (!sbp_s32_decode(ctx, &msg->dot_along)) { return false; } - if (!sbp_s32_decode(ctx, &msg->dot_cross)) { return false; } - if (!sbp_s32_decode(ctx, &msg->c0)) { return false; } - if (!sbp_s32_decode(ctx, &msg->c1)) { return false; } - if (!sbp_s32_decode(ctx, &msg->c2)) { return false; } +bool sbp_msg_ssr_orbit_clock_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_orbit_clock_dep_a_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iod_ssr)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iod)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->radial)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->along)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->cross)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->dot_radial)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->dot_along)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->dot_cross)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->c0)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->c1)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->c2)) { + return false; + } return true; } -s8 sbp_msg_ssr_orbit_clock_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_orbit_clock_dep_a_t *msg) { +s8 sbp_msg_ssr_orbit_clock_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ssr_orbit_clock_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2092,74 +3140,119 @@ s8 sbp_msg_ssr_orbit_clock_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_ssr_orbit_clock_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_orbit_clock_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_orbit_clock_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_orbit_clock_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_orbit_clock_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_ORBIT_CLOCK_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_orbit_clock_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_ORBIT_CLOCK_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_orbit_clock_dep_a_cmp(const sbp_msg_ssr_orbit_clock_dep_a_t *a, const sbp_msg_ssr_orbit_clock_dep_a_t *b) { +int sbp_msg_ssr_orbit_clock_dep_a_cmp( + const sbp_msg_ssr_orbit_clock_dep_a_t *a, + const sbp_msg_ssr_orbit_clock_dep_a_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->update_interval, &b->update_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iod_ssr, &b->iod_ssr); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iod, &b->iod); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->radial, &b->radial); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->along, &b->along); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->cross, &b->cross); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->dot_radial, &b->dot_radial); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->dot_along, &b->dot_along); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->dot_cross, &b->dot_cross); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->c0, &b->c0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->c1, &b->c1); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->c2, &b->c2); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_stec_header_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_stec_header_dep_a_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { return false; } - if (!sbp_u8_encode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u8_encode(ctx, &msg->seq_num)) { return false; } - if (!sbp_u8_encode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iod_atmo)) { return false; } +bool sbp_stec_header_dep_a_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_stec_header_dep_a_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->seq_num)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iod_atmo)) { + return false; + } return true; } -s8 sbp_stec_header_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_stec_header_dep_a_t *msg) { +s8 sbp_stec_header_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_stec_header_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2173,17 +3266,28 @@ s8 sbp_stec_header_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_stec_header_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_stec_header_dep_a_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { return false; } - if (!sbp_u8_decode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u8_decode(ctx, &msg->seq_num)) { return false; } - if (!sbp_u8_decode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iod_atmo)) { return false; } +bool sbp_stec_header_dep_a_decode_internal(sbp_decode_ctx_t *ctx, + sbp_stec_header_dep_a_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->seq_num)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iod_atmo)) { + return false; + } return true; } -s8 sbp_stec_header_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_stec_header_dep_a_t *msg) { +s8 sbp_stec_header_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_stec_header_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2197,40 +3301,63 @@ s8 sbp_stec_header_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - - -int sbp_stec_header_dep_a_cmp(const sbp_stec_header_dep_a_t *a, const sbp_stec_header_dep_a_t *b) { +int sbp_stec_header_dep_a_cmp(const sbp_stec_header_dep_a_t *a, + const sbp_stec_header_dep_a_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->num_msgs, &b->num_msgs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->seq_num, &b->seq_num); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->update_interval, &b->update_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iod_atmo, &b->iod_atmo); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_gridded_correction_header_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_gridded_correction_header_dep_a_t *msg) -{ - if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { return false; } - if (!sbp_u16_encode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u16_encode(ctx, &msg->seq_num)) { return false; } - if (!sbp_u8_encode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_encode(ctx, &msg->iod_atmo)) { return false; } - if (!sbp_u8_encode(ctx, &msg->tropo_quality_indicator)) { return false; } +bool sbp_gridded_correction_header_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_gridded_correction_header_dep_a_t *msg) { + if (!sbp_gps_time_sec_encode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->seq_num)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->iod_atmo)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->tropo_quality_indicator)) { + return false; + } return true; } -s8 sbp_gridded_correction_header_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_gridded_correction_header_dep_a_t *msg) { +s8 sbp_gridded_correction_header_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_gridded_correction_header_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2244,18 +3371,32 @@ s8 sbp_gridded_correction_header_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } -bool sbp_gridded_correction_header_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_gridded_correction_header_dep_a_t *msg) -{ - if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { return false; } - if (!sbp_u16_decode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u16_decode(ctx, &msg->seq_num)) { return false; } - if (!sbp_u8_decode(ctx, &msg->update_interval)) { return false; } - if (!sbp_u8_decode(ctx, &msg->iod_atmo)) { return false; } - if (!sbp_u8_decode(ctx, &msg->tropo_quality_indicator)) { return false; } +bool sbp_gridded_correction_header_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_gridded_correction_header_dep_a_t *msg) { + if (!sbp_gps_time_sec_decode_internal(ctx, &msg->time)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->seq_num)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->update_interval)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->iod_atmo)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->tropo_quality_indicator)) { + return false; + } return true; } -s8 sbp_gridded_correction_header_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_gridded_correction_header_dep_a_t *msg) { +s8 sbp_gridded_correction_header_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_gridded_correction_header_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2269,43 +3410,69 @@ s8 sbp_gridded_correction_header_dep_a_decode(const uint8_t *buf, uint8_t len, u return SBP_OK; } - - -int sbp_gridded_correction_header_dep_a_cmp(const sbp_gridded_correction_header_dep_a_t *a, const sbp_gridded_correction_header_dep_a_t *b) { +int sbp_gridded_correction_header_dep_a_cmp( + const sbp_gridded_correction_header_dep_a_t *a, + const sbp_gridded_correction_header_dep_a_t *b) { int ret = 0; - + ret = sbp_gps_time_sec_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->num_msgs, &b->num_msgs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->seq_num, &b->seq_num); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->update_interval, &b->update_interval); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->iod_atmo, &b->iod_atmo); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->tropo_quality_indicator, &b->tropo_quality_indicator); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_grid_definition_header_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_grid_definition_header_dep_a_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->region_size_inverse)) { return false; } - if (!sbp_u16_encode(ctx, &msg->area_width)) { return false; } - if (!sbp_u16_encode(ctx, &msg->lat_nw_corner_enc)) { return false; } - if (!sbp_u16_encode(ctx, &msg->lon_nw_corner_enc)) { return false; } - if (!sbp_u8_encode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u8_encode(ctx, &msg->seq_num)) { return false; } +bool sbp_grid_definition_header_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_grid_definition_header_dep_a_t *msg) { + if (!sbp_u8_encode(ctx, &msg->region_size_inverse)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->area_width)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->lat_nw_corner_enc)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->lon_nw_corner_enc)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->seq_num)) { + return false; + } return true; } -s8 sbp_grid_definition_header_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_grid_definition_header_dep_a_t *msg) { +s8 sbp_grid_definition_header_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_grid_definition_header_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2316,21 +3483,35 @@ s8 sbp_grid_definition_header_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n if (n_written != NULL) { *n_written = (uint8_t)ctx.offset; } - return SBP_OK; -} - -bool sbp_grid_definition_header_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_grid_definition_header_dep_a_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->region_size_inverse)) { return false; } - if (!sbp_u16_decode(ctx, &msg->area_width)) { return false; } - if (!sbp_u16_decode(ctx, &msg->lat_nw_corner_enc)) { return false; } - if (!sbp_u16_decode(ctx, &msg->lon_nw_corner_enc)) { return false; } - if (!sbp_u8_decode(ctx, &msg->num_msgs)) { return false; } - if (!sbp_u8_decode(ctx, &msg->seq_num)) { return false; } + return SBP_OK; +} + +bool sbp_grid_definition_header_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_grid_definition_header_dep_a_t *msg) { + if (!sbp_u8_decode(ctx, &msg->region_size_inverse)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->area_width)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->lat_nw_corner_enc)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->lon_nw_corner_enc)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->num_msgs)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->seq_num)) { + return false; + } return true; } -s8 sbp_grid_definition_header_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_grid_definition_header_dep_a_t *msg) { +s8 sbp_grid_definition_header_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_grid_definition_header_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2344,42 +3525,59 @@ s8 sbp_grid_definition_header_dep_a_decode(const uint8_t *buf, uint8_t len, uint return SBP_OK; } - - -int sbp_grid_definition_header_dep_a_cmp(const sbp_grid_definition_header_dep_a_t *a, const sbp_grid_definition_header_dep_a_t *b) { +int sbp_grid_definition_header_dep_a_cmp( + const sbp_grid_definition_header_dep_a_t *a, + const sbp_grid_definition_header_dep_a_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->region_size_inverse, &b->region_size_inverse); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->area_width, &b->area_width); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->lat_nw_corner_enc, &b->lat_nw_corner_enc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->lon_nw_corner_enc, &b->lon_nw_corner_enc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->num_msgs, &b->num_msgs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->seq_num, &b->seq_num); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_stec_correction_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_stec_correction_dep_a_t *msg) -{ - if (!sbp_stec_header_dep_a_encode_internal(ctx, &msg->header)) { return false; } - for (size_t i = 0; i < msg->n_stec_sat_list; i++) - { - if (!sbp_stec_sat_element_encode_internal(ctx, &msg->stec_sat_list[i])) { return false; } +bool sbp_msg_ssr_stec_correction_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_stec_correction_dep_a_t *msg) { + if (!sbp_stec_header_dep_a_encode_internal(ctx, &msg->header)) { + return false; + } + for (size_t i = 0; i < msg->n_stec_sat_list; i++) { + if (!sbp_stec_sat_element_encode_internal(ctx, &msg->stec_sat_list[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_stec_correction_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_stec_correction_dep_a_t *msg) { +s8 sbp_msg_ssr_stec_correction_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_stec_correction_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2393,20 +3591,27 @@ s8 sbp_msg_ssr_stec_correction_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } -bool sbp_msg_ssr_stec_correction_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_stec_correction_dep_a_t *msg) -{ - if (!sbp_stec_header_dep_a_decode_internal(ctx, &msg->header)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_STEC_SAT_ELEMENT_ENCODED_LEN) != 0) { +bool sbp_msg_ssr_stec_correction_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_stec_correction_dep_a_t *msg) { + if (!sbp_stec_header_dep_a_decode_internal(ctx, &msg->header)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_STEC_SAT_ELEMENT_ENCODED_LEN) != 0) { + return false; + } + msg->n_stec_sat_list = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_STEC_SAT_ELEMENT_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_stec_sat_list; i++) { + if (!sbp_stec_sat_element_decode_internal(ctx, &msg->stec_sat_list[i])) { return false; } - msg->n_stec_sat_list = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_STEC_SAT_ELEMENT_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_stec_sat_list; i++) { - if (!sbp_stec_sat_element_decode_internal(ctx, &msg->stec_sat_list[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_stec_correction_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_stec_correction_dep_a_t *msg) { +s8 sbp_msg_ssr_stec_correction_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_stec_correction_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2420,44 +3625,65 @@ s8 sbp_msg_ssr_stec_correction_dep_a_decode(const uint8_t *buf, uint8_t len, uin return SBP_OK; } - -s8 sbp_msg_ssr_stec_correction_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_stec_correction_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_stec_correction_dep_a_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_stec_correction_dep_a_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_stec_correction_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_STEC_CORRECTION_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_stec_correction_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_STEC_CORRECTION_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_stec_correction_dep_a_cmp(const sbp_msg_ssr_stec_correction_dep_a_t *a, const sbp_msg_ssr_stec_correction_dep_a_t *b) { +int sbp_msg_ssr_stec_correction_dep_a_cmp( + const sbp_msg_ssr_stec_correction_dep_a_t *a, + const sbp_msg_ssr_stec_correction_dep_a_t *b) { int ret = 0; - + ret = sbp_stec_header_dep_a_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_stec_sat_list, &b->n_stec_sat_list); - for (uint8_t i = 0; ret == 0 && i < a->n_stec_sat_list; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_stec_sat_list; i++) { ret = sbp_stec_sat_element_cmp(&a->stec_sat_list[i], &b->stec_sat_list[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_gridded_correction_no_std_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg) -{ - if (!sbp_gridded_correction_header_dep_a_encode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u16_encode(ctx, &msg->index)) { return false; } - if (!sbp_tropospheric_delay_correction_no_std_encode_internal(ctx, &msg->tropo_delay_correction)) { return false; } - for (size_t i = 0; i < msg->n_stec_residuals; i++) - { - if (!sbp_stec_residual_no_std_encode_internal(ctx, &msg->stec_residuals[i])) { return false; } +bool sbp_msg_ssr_gridded_correction_no_std_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg) { + if (!sbp_gridded_correction_header_dep_a_encode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->index)) { + return false; + } + if (!sbp_tropospheric_delay_correction_no_std_encode_internal( + ctx, &msg->tropo_delay_correction)) { + return false; + } + for (size_t i = 0; i < msg->n_stec_residuals; i++) { + if (!sbp_stec_residual_no_std_encode_internal(ctx, + &msg->stec_residuals[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_gridded_correction_no_std_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg) { +s8 sbp_msg_ssr_gridded_correction_no_std_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2471,22 +3697,36 @@ s8 sbp_msg_ssr_gridded_correction_no_std_dep_a_encode(uint8_t *buf, uint8_t len, return SBP_OK; } -bool sbp_msg_ssr_gridded_correction_no_std_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg) -{ - if (!sbp_gridded_correction_header_dep_a_decode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u16_decode(ctx, &msg->index)) { return false; } - if (!sbp_tropospheric_delay_correction_no_std_decode_internal(ctx, &msg->tropo_delay_correction)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_STEC_RESIDUAL_NO_STD_ENCODED_LEN) != 0) { +bool sbp_msg_ssr_gridded_correction_no_std_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg) { + if (!sbp_gridded_correction_header_dep_a_decode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->index)) { + return false; + } + if (!sbp_tropospheric_delay_correction_no_std_decode_internal( + ctx, &msg->tropo_delay_correction)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_STEC_RESIDUAL_NO_STD_ENCODED_LEN) != + 0) { + return false; + } + msg->n_stec_residuals = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_STEC_RESIDUAL_NO_STD_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_stec_residuals; i++) { + if (!sbp_stec_residual_no_std_decode_internal(ctx, + &msg->stec_residuals[i])) { return false; } - msg->n_stec_residuals = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_STEC_RESIDUAL_NO_STD_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_stec_residuals; i++) { - if (!sbp_stec_residual_no_std_decode_internal(ctx, &msg->stec_residuals[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_gridded_correction_no_std_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg) { +s8 sbp_msg_ssr_gridded_correction_no_std_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2500,50 +3740,76 @@ s8 sbp_msg_ssr_gridded_correction_no_std_dep_a_decode(const uint8_t *buf, uint8_ return SBP_OK; } - -s8 sbp_msg_ssr_gridded_correction_no_std_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_gridded_correction_no_std_dep_a_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_gridded_correction_no_std_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_gridded_correction_no_std_dep_a_encode( + payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A, + sender_id, payload_len, payload, write); } -int sbp_msg_ssr_gridded_correction_no_std_dep_a_cmp(const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *a, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *b) { +int sbp_msg_ssr_gridded_correction_no_std_dep_a_cmp( + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *a, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t *b) { int ret = 0; - + ret = sbp_gridded_correction_header_dep_a_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->index, &b->index); - if (ret != 0) { return ret; } - - ret = sbp_tropospheric_delay_correction_no_std_cmp(&a->tropo_delay_correction, &b->tropo_delay_correction); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + + ret = sbp_tropospheric_delay_correction_no_std_cmp( + &a->tropo_delay_correction, &b->tropo_delay_correction); + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_stec_residuals, &b->n_stec_residuals); - for (uint8_t i = 0; ret == 0 && i < a->n_stec_residuals; i++) - { - ret = sbp_stec_residual_no_std_cmp(&a->stec_residuals[i], &b->stec_residuals[i]); + for (uint8_t i = 0; ret == 0 && i < a->n_stec_residuals; i++) { + ret = sbp_stec_residual_no_std_cmp(&a->stec_residuals[i], + &b->stec_residuals[i]); + } + if (ret != 0) { + return ret; } - if (ret != 0) { return ret; } return ret; } -bool sbp_msg_ssr_gridded_correction_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_gridded_correction_dep_a_t *msg) -{ - if (!sbp_gridded_correction_header_dep_a_encode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u16_encode(ctx, &msg->index)) { return false; } - if (!sbp_tropospheric_delay_correction_encode_internal(ctx, &msg->tropo_delay_correction)) { return false; } - for (size_t i = 0; i < msg->n_stec_residuals; i++) - { - if (!sbp_stec_residual_encode_internal(ctx, &msg->stec_residuals[i])) { return false; } +bool sbp_msg_ssr_gridded_correction_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_gridded_correction_dep_a_t *msg) { + if (!sbp_gridded_correction_header_dep_a_encode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->index)) { + return false; + } + if (!sbp_tropospheric_delay_correction_encode_internal( + ctx, &msg->tropo_delay_correction)) { + return false; + } + for (size_t i = 0; i < msg->n_stec_residuals; i++) { + if (!sbp_stec_residual_encode_internal(ctx, &msg->stec_residuals[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_gridded_correction_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_gridded_correction_dep_a_t *msg) { +s8 sbp_msg_ssr_gridded_correction_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_gridded_correction_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2557,22 +3823,34 @@ s8 sbp_msg_ssr_gridded_correction_dep_a_encode(uint8_t *buf, uint8_t len, uint8_ return SBP_OK; } -bool sbp_msg_ssr_gridded_correction_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_dep_a_t *msg) -{ - if (!sbp_gridded_correction_header_dep_a_decode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u16_decode(ctx, &msg->index)) { return false; } - if (!sbp_tropospheric_delay_correction_decode_internal(ctx, &msg->tropo_delay_correction)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_STEC_RESIDUAL_ENCODED_LEN) != 0) { +bool sbp_msg_ssr_gridded_correction_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_gridded_correction_dep_a_t *msg) { + if (!sbp_gridded_correction_header_dep_a_decode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->index)) { + return false; + } + if (!sbp_tropospheric_delay_correction_decode_internal( + ctx, &msg->tropo_delay_correction)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_STEC_RESIDUAL_ENCODED_LEN) != 0) { + return false; + } + msg->n_stec_residuals = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_STEC_RESIDUAL_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_stec_residuals; i++) { + if (!sbp_stec_residual_decode_internal(ctx, &msg->stec_residuals[i])) { return false; } - msg->n_stec_residuals = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_STEC_RESIDUAL_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_stec_residuals; i++) { - if (!sbp_stec_residual_decode_internal(ctx, &msg->stec_residuals[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_gridded_correction_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_gridded_correction_dep_a_t *msg) { +s8 sbp_msg_ssr_gridded_correction_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_gridded_correction_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2586,48 +3864,67 @@ s8 sbp_msg_ssr_gridded_correction_dep_a_decode(const uint8_t *buf, uint8_t len, return SBP_OK; } - -s8 sbp_msg_ssr_gridded_correction_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_gridded_correction_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_gridded_correction_dep_a_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_gridded_correction_dep_a_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_gridded_correction_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_GRIDDED_CORRECTION_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_gridded_correction_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_GRIDDED_CORRECTION_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_gridded_correction_dep_a_cmp(const sbp_msg_ssr_gridded_correction_dep_a_t *a, const sbp_msg_ssr_gridded_correction_dep_a_t *b) { +int sbp_msg_ssr_gridded_correction_dep_a_cmp( + const sbp_msg_ssr_gridded_correction_dep_a_t *a, + const sbp_msg_ssr_gridded_correction_dep_a_t *b) { int ret = 0; - + ret = sbp_gridded_correction_header_dep_a_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->index, &b->index); - if (ret != 0) { return ret; } - - ret = sbp_tropospheric_delay_correction_cmp(&a->tropo_delay_correction, &b->tropo_delay_correction); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + + ret = sbp_tropospheric_delay_correction_cmp(&a->tropo_delay_correction, + &b->tropo_delay_correction); + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_stec_residuals, &b->n_stec_residuals); - for (uint8_t i = 0; ret == 0 && i < a->n_stec_residuals; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_stec_residuals; i++) { ret = sbp_stec_residual_cmp(&a->stec_residuals[i], &b->stec_residuals[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_grid_definition_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_grid_definition_dep_a_t *msg) -{ - if (!sbp_grid_definition_header_dep_a_encode_internal(ctx, &msg->header)) { return false; } - for (size_t i = 0; i < msg->n_rle_list; i++) - { - if (!sbp_u8_encode(ctx, &msg->rle_list[i])) { return false; } +bool sbp_msg_ssr_grid_definition_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_grid_definition_dep_a_t *msg) { + if (!sbp_grid_definition_header_dep_a_encode_internal(ctx, &msg->header)) { + return false; + } + for (size_t i = 0; i < msg->n_rle_list; i++) { + if (!sbp_u8_encode(ctx, &msg->rle_list[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_grid_definition_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_grid_definition_dep_a_t *msg) { +s8 sbp_msg_ssr_grid_definition_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_grid_definition_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2641,20 +3938,27 @@ s8 sbp_msg_ssr_grid_definition_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } -bool sbp_msg_ssr_grid_definition_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_grid_definition_dep_a_t *msg) -{ - if (!sbp_grid_definition_header_dep_a_decode_internal(ctx, &msg->header)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { +bool sbp_msg_ssr_grid_definition_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_grid_definition_dep_a_t *msg) { + if (!sbp_grid_definition_header_dep_a_decode_internal(ctx, &msg->header)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + return false; + } + msg->n_rle_list = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->n_rle_list; i++) { + if (!sbp_u8_decode(ctx, &msg->rle_list[i])) { return false; } - msg->n_rle_list = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); - for (uint8_t i = 0; i < msg->n_rle_list; i++) { - if (!sbp_u8_decode(ctx, &msg->rle_list[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_grid_definition_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_grid_definition_dep_a_t *msg) { +s8 sbp_msg_ssr_grid_definition_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_grid_definition_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2668,46 +3972,74 @@ s8 sbp_msg_ssr_grid_definition_dep_a_decode(const uint8_t *buf, uint8_t len, uin return SBP_OK; } - -s8 sbp_msg_ssr_grid_definition_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_grid_definition_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_grid_definition_dep_a_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_grid_definition_dep_a_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_grid_definition_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_GRID_DEFINITION_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_grid_definition_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_GRID_DEFINITION_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_grid_definition_dep_a_cmp(const sbp_msg_ssr_grid_definition_dep_a_t *a, const sbp_msg_ssr_grid_definition_dep_a_t *b) { +int sbp_msg_ssr_grid_definition_dep_a_cmp( + const sbp_msg_ssr_grid_definition_dep_a_t *a, + const sbp_msg_ssr_grid_definition_dep_a_t *b) { int ret = 0; - + ret = sbp_grid_definition_header_dep_a_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_rle_list, &b->n_rle_list); - for (uint8_t i = 0; ret == 0 && i < a->n_rle_list; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_rle_list; i++) { ret = sbp_u8_cmp(&a->rle_list[i], &b->rle_list[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_orbit_clock_bound_encode_internal(sbp_encode_ctx_t *ctx, const sbp_orbit_clock_bound_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->sat_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->orb_radial_bound_mu)) { return false; } - if (!sbp_u8_encode(ctx, &msg->orb_along_bound_mu)) { return false; } - if (!sbp_u8_encode(ctx, &msg->orb_cross_bound_mu)) { return false; } - if (!sbp_u8_encode(ctx, &msg->orb_radial_bound_sig)) { return false; } - if (!sbp_u8_encode(ctx, &msg->orb_along_bound_sig)) { return false; } - if (!sbp_u8_encode(ctx, &msg->orb_cross_bound_sig)) { return false; } - if (!sbp_u8_encode(ctx, &msg->clock_bound_mu)) { return false; } - if (!sbp_u8_encode(ctx, &msg->clock_bound_sig)) { return false; } +bool sbp_orbit_clock_bound_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_orbit_clock_bound_t *msg) { + if (!sbp_u8_encode(ctx, &msg->sat_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->orb_radial_bound_mu)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->orb_along_bound_mu)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->orb_cross_bound_mu)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->orb_radial_bound_sig)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->orb_along_bound_sig)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->orb_cross_bound_sig)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->clock_bound_mu)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->clock_bound_sig)) { + return false; + } return true; } -s8 sbp_orbit_clock_bound_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_orbit_clock_bound_t *msg) { +s8 sbp_orbit_clock_bound_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_orbit_clock_bound_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2721,21 +4053,40 @@ s8 sbp_orbit_clock_bound_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_orbit_clock_bound_decode_internal(sbp_decode_ctx_t *ctx, sbp_orbit_clock_bound_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->sat_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->orb_radial_bound_mu)) { return false; } - if (!sbp_u8_decode(ctx, &msg->orb_along_bound_mu)) { return false; } - if (!sbp_u8_decode(ctx, &msg->orb_cross_bound_mu)) { return false; } - if (!sbp_u8_decode(ctx, &msg->orb_radial_bound_sig)) { return false; } - if (!sbp_u8_decode(ctx, &msg->orb_along_bound_sig)) { return false; } - if (!sbp_u8_decode(ctx, &msg->orb_cross_bound_sig)) { return false; } - if (!sbp_u8_decode(ctx, &msg->clock_bound_mu)) { return false; } - if (!sbp_u8_decode(ctx, &msg->clock_bound_sig)) { return false; } +bool sbp_orbit_clock_bound_decode_internal(sbp_decode_ctx_t *ctx, + sbp_orbit_clock_bound_t *msg) { + if (!sbp_u8_decode(ctx, &msg->sat_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->orb_radial_bound_mu)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->orb_along_bound_mu)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->orb_cross_bound_mu)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->orb_radial_bound_sig)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->orb_along_bound_sig)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->orb_cross_bound_sig)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->clock_bound_mu)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->clock_bound_sig)) { + return false; + } return true; } -s8 sbp_orbit_clock_bound_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_orbit_clock_bound_t *msg) { +s8 sbp_orbit_clock_bound_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_orbit_clock_bound_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2749,54 +4100,83 @@ s8 sbp_orbit_clock_bound_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - - -int sbp_orbit_clock_bound_cmp(const sbp_orbit_clock_bound_t *a, const sbp_orbit_clock_bound_t *b) { +int sbp_orbit_clock_bound_cmp(const sbp_orbit_clock_bound_t *a, + const sbp_orbit_clock_bound_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->sat_id, &b->sat_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->orb_radial_bound_mu, &b->orb_radial_bound_mu); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->orb_along_bound_mu, &b->orb_along_bound_mu); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->orb_cross_bound_mu, &b->orb_cross_bound_mu); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->orb_radial_bound_sig, &b->orb_radial_bound_sig); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->orb_along_bound_sig, &b->orb_along_bound_sig); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->orb_cross_bound_sig, &b->orb_cross_bound_sig); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->clock_bound_mu, &b->clock_bound_mu); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->clock_bound_sig, &b->clock_bound_sig); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_orbit_clock_bounds_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_orbit_clock_bounds_t *msg) -{ - if (!sbp_bounds_header_encode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_encode(ctx, &msg->ssr_iod)) { return false; } - if (!sbp_u8_encode(ctx, &msg->const_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats)) { return false; } - for (size_t i = 0; i < msg->n_sats; i++) - { - if (!sbp_orbit_clock_bound_encode_internal(ctx, &msg->orbit_clock_bounds[i])) { return false; } +bool sbp_msg_ssr_orbit_clock_bounds_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_orbit_clock_bounds_t *msg) { + if (!sbp_bounds_header_encode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->ssr_iod)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->const_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats)) { + return false; + } + for (size_t i = 0; i < msg->n_sats; i++) { + if (!sbp_orbit_clock_bound_encode_internal(ctx, + &msg->orbit_clock_bounds[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_orbit_clock_bounds_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_orbit_clock_bounds_t *msg) { +s8 sbp_msg_ssr_orbit_clock_bounds_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_orbit_clock_bounds_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2810,23 +4190,37 @@ s8 sbp_msg_ssr_orbit_clock_bounds_encode(uint8_t *buf, uint8_t len, uint8_t *n_w return SBP_OK; } -bool sbp_msg_ssr_orbit_clock_bounds_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_orbit_clock_bounds_t *msg) -{ - if (!sbp_bounds_header_decode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_decode(ctx, &msg->ssr_iod)) { return false; } - if (!sbp_u8_decode(ctx, &msg->const_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ORBIT_CLOCK_BOUND_ENCODED_LEN) != 0) { +bool sbp_msg_ssr_orbit_clock_bounds_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_orbit_clock_bounds_t *msg) { + if (!sbp_bounds_header_decode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->ssr_iod)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->const_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_ORBIT_CLOCK_BOUND_ENCODED_LEN) != 0) { + return false; + } + msg->n_sats = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_ORBIT_CLOCK_BOUND_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_sats; i++) { + if (!sbp_orbit_clock_bound_decode_internal(ctx, + &msg->orbit_clock_bounds[i])) { return false; } - msg->n_sats = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ORBIT_CLOCK_BOUND_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_sats; i++) { - if (!sbp_orbit_clock_bound_decode_internal(ctx, &msg->orbit_clock_bounds[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_orbit_clock_bounds_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_orbit_clock_bounds_t *msg) { +s8 sbp_msg_ssr_orbit_clock_bounds_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_orbit_clock_bounds_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2840,52 +4234,82 @@ s8 sbp_msg_ssr_orbit_clock_bounds_decode(const uint8_t *buf, uint8_t len, uint8_ return SBP_OK; } - -s8 sbp_msg_ssr_orbit_clock_bounds_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_orbit_clock_bounds_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_orbit_clock_bounds_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_orbit_clock_bounds_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_orbit_clock_bounds_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_orbit_clock_bounds_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_orbit_clock_bounds_cmp(const sbp_msg_ssr_orbit_clock_bounds_t *a, const sbp_msg_ssr_orbit_clock_bounds_t *b) { +int sbp_msg_ssr_orbit_clock_bounds_cmp( + const sbp_msg_ssr_orbit_clock_bounds_t *a, + const sbp_msg_ssr_orbit_clock_bounds_t *b) { int ret = 0; - + ret = sbp_bounds_header_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->ssr_iod, &b->ssr_iod); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->const_id, &b->const_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats, &b->n_sats); - for (uint8_t i = 0; ret == 0 && i < a->n_sats; i++) - { - ret = sbp_orbit_clock_bound_cmp(&a->orbit_clock_bounds[i], &b->orbit_clock_bounds[i]); + for (uint8_t i = 0; ret == 0 && i < a->n_sats; i++) { + ret = sbp_orbit_clock_bound_cmp(&a->orbit_clock_bounds[i], + &b->orbit_clock_bounds[i]); + } + if (ret != 0) { + return ret; } - if (ret != 0) { return ret; } return ret; } -bool sbp_code_phase_biases_sat_sig_encode_internal(sbp_encode_ctx_t *ctx, const sbp_code_phase_biases_sat_sig_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->sat_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->signal_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->code_bias_bound_mu)) { return false; } - if (!sbp_u8_encode(ctx, &msg->code_bias_bound_sig)) { return false; } - if (!sbp_u8_encode(ctx, &msg->phase_bias_bound_mu)) { return false; } - if (!sbp_u8_encode(ctx, &msg->phase_bias_bound_sig)) { return false; } +bool sbp_code_phase_biases_sat_sig_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_code_phase_biases_sat_sig_t *msg) { + if (!sbp_u8_encode(ctx, &msg->sat_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->signal_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->code_bias_bound_mu)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->code_bias_bound_sig)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->phase_bias_bound_mu)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->phase_bias_bound_sig)) { + return false; + } return true; } -s8 sbp_code_phase_biases_sat_sig_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_code_phase_biases_sat_sig_t *msg) { +s8 sbp_code_phase_biases_sat_sig_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_code_phase_biases_sat_sig_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2899,18 +4323,32 @@ s8 sbp_code_phase_biases_sat_sig_encode(uint8_t *buf, uint8_t len, uint8_t *n_wr return SBP_OK; } -bool sbp_code_phase_biases_sat_sig_decode_internal(sbp_decode_ctx_t *ctx, sbp_code_phase_biases_sat_sig_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->sat_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->signal_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->code_bias_bound_mu)) { return false; } - if (!sbp_u8_decode(ctx, &msg->code_bias_bound_sig)) { return false; } - if (!sbp_u8_decode(ctx, &msg->phase_bias_bound_mu)) { return false; } - if (!sbp_u8_decode(ctx, &msg->phase_bias_bound_sig)) { return false; } +bool sbp_code_phase_biases_sat_sig_decode_internal( + sbp_decode_ctx_t *ctx, sbp_code_phase_biases_sat_sig_t *msg) { + if (!sbp_u8_decode(ctx, &msg->sat_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->signal_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->code_bias_bound_mu)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->code_bias_bound_sig)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->phase_bias_bound_mu)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->phase_bias_bound_sig)) { + return false; + } return true; } -s8 sbp_code_phase_biases_sat_sig_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_code_phase_biases_sat_sig_t *msg) { +s8 sbp_code_phase_biases_sat_sig_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_code_phase_biases_sat_sig_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2924,45 +4362,69 @@ s8 sbp_code_phase_biases_sat_sig_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - - -int sbp_code_phase_biases_sat_sig_cmp(const sbp_code_phase_biases_sat_sig_t *a, const sbp_code_phase_biases_sat_sig_t *b) { +int sbp_code_phase_biases_sat_sig_cmp( + const sbp_code_phase_biases_sat_sig_t *a, + const sbp_code_phase_biases_sat_sig_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->sat_id, &b->sat_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->signal_id, &b->signal_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->code_bias_bound_mu, &b->code_bias_bound_mu); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->code_bias_bound_sig, &b->code_bias_bound_sig); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->phase_bias_bound_mu, &b->phase_bias_bound_mu); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->phase_bias_bound_sig, &b->phase_bias_bound_sig); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_code_phase_biases_bounds_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_code_phase_biases_bounds_t *msg) -{ - if (!sbp_bounds_header_encode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_encode(ctx, &msg->ssr_iod)) { return false; } - if (!sbp_u8_encode(ctx, &msg->const_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_sats_signals)) { return false; } - for (size_t i = 0; i < msg->n_sats_signals; i++) - { - if (!sbp_code_phase_biases_sat_sig_encode_internal(ctx, &msg->satellites_signals[i])) { return false; } +bool sbp_msg_ssr_code_phase_biases_bounds_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ssr_code_phase_biases_bounds_t *msg) { + if (!sbp_bounds_header_encode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->ssr_iod)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->const_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_sats_signals)) { + return false; + } + for (size_t i = 0; i < msg->n_sats_signals; i++) { + if (!sbp_code_phase_biases_sat_sig_encode_internal( + ctx, &msg->satellites_signals[i])) { + return false; + } } return true; } -s8 sbp_msg_ssr_code_phase_biases_bounds_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_code_phase_biases_bounds_t *msg) { +s8 sbp_msg_ssr_code_phase_biases_bounds_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_code_phase_biases_bounds_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -2976,23 +4438,38 @@ s8 sbp_msg_ssr_code_phase_biases_bounds_encode(uint8_t *buf, uint8_t len, uint8_ return SBP_OK; } -bool sbp_msg_ssr_code_phase_biases_bounds_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_code_phase_biases_bounds_t *msg) -{ - if (!sbp_bounds_header_decode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_decode(ctx, &msg->ssr_iod)) { return false; } - if (!sbp_u8_decode(ctx, &msg->const_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_sats_signals)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_CODE_PHASE_BIASES_SAT_SIG_ENCODED_LEN) != 0) { +bool sbp_msg_ssr_code_phase_biases_bounds_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_code_phase_biases_bounds_t *msg) { + if (!sbp_bounds_header_decode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->ssr_iod)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->const_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_sats_signals)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % + SBP_CODE_PHASE_BIASES_SAT_SIG_ENCODED_LEN) != 0) { + return false; + } + msg->n_sats_signals = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_CODE_PHASE_BIASES_SAT_SIG_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_sats_signals; i++) { + if (!sbp_code_phase_biases_sat_sig_decode_internal( + ctx, &msg->satellites_signals[i])) { return false; } - msg->n_sats_signals = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_CODE_PHASE_BIASES_SAT_SIG_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_sats_signals; i++) { - if (!sbp_code_phase_biases_sat_sig_decode_internal(ctx, &msg->satellites_signals[i])) { return false; } - } + } return true; } -s8 sbp_msg_ssr_code_phase_biases_bounds_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_code_phase_biases_bounds_t *msg) { +s8 sbp_msg_ssr_code_phase_biases_bounds_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_code_phase_biases_bounds_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3006,54 +4483,88 @@ s8 sbp_msg_ssr_code_phase_biases_bounds_decode(const uint8_t *buf, uint8_t len, return SBP_OK; } - -s8 sbp_msg_ssr_code_phase_biases_bounds_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_code_phase_biases_bounds_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_code_phase_biases_bounds_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_code_phase_biases_bounds_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_code_phase_biases_bounds_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_CODE_PHASE_BIASES_BOUNDS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_code_phase_biases_bounds_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_CODE_PHASE_BIASES_BOUNDS, sender_id, + payload_len, payload, write); } -int sbp_msg_ssr_code_phase_biases_bounds_cmp(const sbp_msg_ssr_code_phase_biases_bounds_t *a, const sbp_msg_ssr_code_phase_biases_bounds_t *b) { +int sbp_msg_ssr_code_phase_biases_bounds_cmp( + const sbp_msg_ssr_code_phase_biases_bounds_t *a, + const sbp_msg_ssr_code_phase_biases_bounds_t *b) { int ret = 0; - + ret = sbp_bounds_header_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->ssr_iod, &b->ssr_iod); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->const_id, &b->const_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats_signals, &b->n_sats_signals); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sats_signals, &b->n_sats_signals); - for (uint8_t i = 0; ret == 0 && i < a->n_sats_signals; i++) - { - ret = sbp_code_phase_biases_sat_sig_cmp(&a->satellites_signals[i], &b->satellites_signals[i]); + for (uint8_t i = 0; ret == 0 && i < a->n_sats_signals; i++) { + ret = sbp_code_phase_biases_sat_sig_cmp(&a->satellites_signals[i], + &b->satellites_signals[i]); + } + if (ret != 0) { + return ret; } - if (ret != 0) { return ret; } return ret; } -bool sbp_orbit_clock_bound_degradation_encode_internal(sbp_encode_ctx_t *ctx, const sbp_orbit_clock_bound_degradation_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->orb_radial_bound_mu_dot)) { return false; } - if (!sbp_u8_encode(ctx, &msg->orb_along_bound_mu_dot)) { return false; } - if (!sbp_u8_encode(ctx, &msg->orb_cross_bound_mu_dot)) { return false; } - if (!sbp_u8_encode(ctx, &msg->orb_radial_bound_sig_dot)) { return false; } - if (!sbp_u8_encode(ctx, &msg->orb_along_bound_sig_dot)) { return false; } - if (!sbp_u8_encode(ctx, &msg->orb_cross_bound_sig_dot)) { return false; } - if (!sbp_u8_encode(ctx, &msg->clock_bound_mu_dot)) { return false; } - if (!sbp_u8_encode(ctx, &msg->clock_bound_sig_dot)) { return false; } +bool sbp_orbit_clock_bound_degradation_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_orbit_clock_bound_degradation_t *msg) { + if (!sbp_u8_encode(ctx, &msg->orb_radial_bound_mu_dot)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->orb_along_bound_mu_dot)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->orb_cross_bound_mu_dot)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->orb_radial_bound_sig_dot)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->orb_along_bound_sig_dot)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->orb_cross_bound_sig_dot)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->clock_bound_mu_dot)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->clock_bound_sig_dot)) { + return false; + } return true; } -s8 sbp_orbit_clock_bound_degradation_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_orbit_clock_bound_degradation_t *msg) { +s8 sbp_orbit_clock_bound_degradation_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_orbit_clock_bound_degradation_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3067,20 +4578,38 @@ s8 sbp_orbit_clock_bound_degradation_encode(uint8_t *buf, uint8_t len, uint8_t * return SBP_OK; } -bool sbp_orbit_clock_bound_degradation_decode_internal(sbp_decode_ctx_t *ctx, sbp_orbit_clock_bound_degradation_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->orb_radial_bound_mu_dot)) { return false; } - if (!sbp_u8_decode(ctx, &msg->orb_along_bound_mu_dot)) { return false; } - if (!sbp_u8_decode(ctx, &msg->orb_cross_bound_mu_dot)) { return false; } - if (!sbp_u8_decode(ctx, &msg->orb_radial_bound_sig_dot)) { return false; } - if (!sbp_u8_decode(ctx, &msg->orb_along_bound_sig_dot)) { return false; } - if (!sbp_u8_decode(ctx, &msg->orb_cross_bound_sig_dot)) { return false; } - if (!sbp_u8_decode(ctx, &msg->clock_bound_mu_dot)) { return false; } - if (!sbp_u8_decode(ctx, &msg->clock_bound_sig_dot)) { return false; } +bool sbp_orbit_clock_bound_degradation_decode_internal( + sbp_decode_ctx_t *ctx, sbp_orbit_clock_bound_degradation_t *msg) { + if (!sbp_u8_decode(ctx, &msg->orb_radial_bound_mu_dot)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->orb_along_bound_mu_dot)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->orb_cross_bound_mu_dot)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->orb_radial_bound_sig_dot)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->orb_along_bound_sig_dot)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->orb_cross_bound_sig_dot)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->clock_bound_mu_dot)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->clock_bound_sig_dot)) { + return false; + } return true; } -s8 sbp_orbit_clock_bound_degradation_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_orbit_clock_bound_degradation_t *msg) { +s8 sbp_orbit_clock_bound_degradation_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_orbit_clock_bound_degradation_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3094,48 +4623,78 @@ s8 sbp_orbit_clock_bound_degradation_decode(const uint8_t *buf, uint8_t len, uin return SBP_OK; } - - -int sbp_orbit_clock_bound_degradation_cmp(const sbp_orbit_clock_bound_degradation_t *a, const sbp_orbit_clock_bound_degradation_t *b) { +int sbp_orbit_clock_bound_degradation_cmp( + const sbp_orbit_clock_bound_degradation_t *a, + const sbp_orbit_clock_bound_degradation_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->orb_radial_bound_mu_dot, &b->orb_radial_bound_mu_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->orb_along_bound_mu_dot, &b->orb_along_bound_mu_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->orb_cross_bound_mu_dot, &b->orb_cross_bound_mu_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->orb_radial_bound_sig_dot, &b->orb_radial_bound_sig_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->orb_along_bound_sig_dot, &b->orb_along_bound_sig_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->orb_cross_bound_sig_dot, &b->orb_cross_bound_sig_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->clock_bound_mu_dot, &b->clock_bound_mu_dot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->clock_bound_sig_dot, &b->clock_bound_sig_dot); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ssr_orbit_clock_bounds_degradation_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg) -{ - if (!sbp_bounds_header_encode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_encode(ctx, &msg->ssr_iod)) { return false; } - if (!sbp_u8_encode(ctx, &msg->const_id)) { return false; } - if (!sbp_u64_encode(ctx, &msg->sat_bitmask)) { return false; } - if (!sbp_orbit_clock_bound_degradation_encode_internal(ctx, &msg->orbit_clock_bounds_degradation)) { return false; } +bool sbp_msg_ssr_orbit_clock_bounds_degradation_encode_internal( + sbp_encode_ctx_t *ctx, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg) { + if (!sbp_bounds_header_encode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->ssr_iod)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->const_id)) { + return false; + } + if (!sbp_u64_encode(ctx, &msg->sat_bitmask)) { + return false; + } + if (!sbp_orbit_clock_bound_degradation_encode_internal( + ctx, &msg->orbit_clock_bounds_degradation)) { + return false; + } return true; } -s8 sbp_msg_ssr_orbit_clock_bounds_degradation_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg) { +s8 sbp_msg_ssr_orbit_clock_bounds_degradation_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3149,17 +4708,30 @@ s8 sbp_msg_ssr_orbit_clock_bounds_degradation_encode(uint8_t *buf, uint8_t len, return SBP_OK; } -bool sbp_msg_ssr_orbit_clock_bounds_degradation_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg) -{ - if (!sbp_bounds_header_decode_internal(ctx, &msg->header)) { return false; } - if (!sbp_u8_decode(ctx, &msg->ssr_iod)) { return false; } - if (!sbp_u8_decode(ctx, &msg->const_id)) { return false; } - if (!sbp_u64_decode(ctx, &msg->sat_bitmask)) { return false; } - if (!sbp_orbit_clock_bound_degradation_decode_internal(ctx, &msg->orbit_clock_bounds_degradation)) { return false; } +bool sbp_msg_ssr_orbit_clock_bounds_degradation_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg) { + if (!sbp_bounds_header_decode_internal(ctx, &msg->header)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->ssr_iod)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->const_id)) { + return false; + } + if (!sbp_u64_decode(ctx, &msg->sat_bitmask)) { + return false; + } + if (!sbp_orbit_clock_bound_degradation_decode_internal( + ctx, &msg->orbit_clock_bounds_degradation)) { + return false; + } return true; } -s8 sbp_msg_ssr_orbit_clock_bounds_degradation_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg) { +s8 sbp_msg_ssr_orbit_clock_bounds_degradation_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -3173,32 +4745,50 @@ s8 sbp_msg_ssr_orbit_clock_bounds_degradation_decode(const uint8_t *buf, uint8_t return SBP_OK; } - -s8 sbp_msg_ssr_orbit_clock_bounds_degradation_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ssr_orbit_clock_bounds_degradation_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ssr_orbit_clock_bounds_degradation_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_ssr_orbit_clock_bounds_degradation_encode( + payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION, + sender_id, payload_len, payload, write); } -int sbp_msg_ssr_orbit_clock_bounds_degradation_cmp(const sbp_msg_ssr_orbit_clock_bounds_degradation_t *a, const sbp_msg_ssr_orbit_clock_bounds_degradation_t *b) { +int sbp_msg_ssr_orbit_clock_bounds_degradation_cmp( + const sbp_msg_ssr_orbit_clock_bounds_degradation_t *a, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t *b) { int ret = 0; - + ret = sbp_bounds_header_cmp(&a->header, &b->header); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->ssr_iod, &b->ssr_iod); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->const_id, &b->const_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u64_cmp(&a->sat_bitmask, &b->sat_bitmask); - if (ret != 0) { return ret; } - - ret = sbp_orbit_clock_bound_degradation_cmp(&a->orbit_clock_bounds_degradation, &b->orbit_clock_bounds_degradation); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } + + ret = sbp_orbit_clock_bound_degradation_cmp( + &a->orbit_clock_bounds_degradation, &b->orbit_clock_bounds_degradation); + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/system.c b/c/src/system.c index 3b0e33316..a73445141 100644 --- a/c/src/system.c +++ b/c/src/system.c @@ -3,29 +3,36 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include -#include +#include +#include #include #include -#include #include +#include +#include +#include -bool sbp_msg_startup_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_startup_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->cause)) { return false; } - if (!sbp_u8_encode(ctx, &msg->startup_type)) { return false; } - if (!sbp_u16_encode(ctx, &msg->reserved)) { return false; } +bool sbp_msg_startup_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_startup_t *msg) { + if (!sbp_u8_encode(ctx, &msg->cause)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->startup_type)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->reserved)) { + return false; + } return true; } -s8 sbp_msg_startup_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_startup_t *msg) { +s8 sbp_msg_startup_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_startup_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -39,15 +46,22 @@ s8 sbp_msg_startup_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const s return SBP_OK; } -bool sbp_msg_startup_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_startup_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->cause)) { return false; } - if (!sbp_u8_decode(ctx, &msg->startup_type)) { return false; } - if (!sbp_u16_decode(ctx, &msg->reserved)) { return false; } +bool sbp_msg_startup_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_startup_t *msg) { + if (!sbp_u8_decode(ctx, &msg->cause)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->startup_type)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->reserved)) { + return false; + } return true; } -s8 sbp_msg_startup_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_startup_t *msg) { +s8 sbp_msg_startup_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_startup_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -61,113 +75,154 @@ s8 sbp_msg_startup_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_ return SBP_OK; } - -s8 sbp_msg_startup_send(sbp_state_t *s, u16 sender_id, const sbp_msg_startup_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_startup_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_startup_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_startup_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_STARTUP, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_STARTUP, sender_id, payload_len, payload, + write); } -int sbp_msg_startup_cmp(const sbp_msg_startup_t *a, const sbp_msg_startup_t *b) { +int sbp_msg_startup_cmp(const sbp_msg_startup_t *a, + const sbp_msg_startup_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->cause, &b->cause); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->startup_type, &b->startup_type); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->reserved, &b->reserved); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_dgnss_status_source_init(sbp_msg_dgnss_status_t *msg) -{ +void sbp_msg_dgnss_status_source_init(sbp_msg_dgnss_status_t *msg) { sbp_unterminated_string_init(&msg->source); } -bool sbp_msg_dgnss_status_source_valid(const sbp_msg_dgnss_status_t *msg) -{ - return sbp_unterminated_string_valid(&msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX); +bool sbp_msg_dgnss_status_source_valid(const sbp_msg_dgnss_status_t *msg) { + return sbp_unterminated_string_valid(&msg->source, + SBP_MSG_DGNSS_STATUS_SOURCE_MAX); } -int sbp_msg_dgnss_status_source_strcmp(const sbp_msg_dgnss_status_t *a, const sbp_msg_dgnss_status_t *b) -{ - return sbp_unterminated_string_strcmp(&a->source, &b->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX); +int sbp_msg_dgnss_status_source_strcmp(const sbp_msg_dgnss_status_t *a, + const sbp_msg_dgnss_status_t *b) { + return sbp_unterminated_string_strcmp(&a->source, &b->source, + SBP_MSG_DGNSS_STATUS_SOURCE_MAX); } -size_t sbp_msg_dgnss_status_source_encoded_len(const sbp_msg_dgnss_status_t *msg) -{ - return sbp_unterminated_string_encoded_len(&msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX); +size_t sbp_msg_dgnss_status_source_encoded_len( + const sbp_msg_dgnss_status_t *msg) { + return sbp_unterminated_string_encoded_len(&msg->source, + SBP_MSG_DGNSS_STATUS_SOURCE_MAX); } -size_t sbp_msg_dgnss_status_source_space_remaining(const sbp_msg_dgnss_status_t *msg) -{ - return sbp_unterminated_string_space_remaining(&msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX); +size_t sbp_msg_dgnss_status_source_space_remaining( + const sbp_msg_dgnss_status_t *msg) { + return sbp_unterminated_string_space_remaining( + &msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX); } - bool sbp_msg_dgnss_status_source_set(sbp_msg_dgnss_status_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set(&msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX, should_trunc, n_written, new_str); +bool sbp_msg_dgnss_status_source_set(sbp_msg_dgnss_status_t *msg, + const char *new_str, bool should_trunc, + size_t *n_written) { + return sbp_unterminated_string_set(&msg->source, + SBP_MSG_DGNSS_STATUS_SOURCE_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_dgnss_status_source_set_raw(sbp_msg_dgnss_status_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set_raw(&msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_dgnss_status_source_set_raw(sbp_msg_dgnss_status_t *msg, + const char *new_buf, + size_t new_buf_len, bool should_trunc, + size_t *n_written) { + return sbp_unterminated_string_set_raw( + &msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX, should_trunc, n_written, + new_buf, new_buf_len); } - -bool sbp_msg_dgnss_status_source_printf(sbp_msg_dgnss_status_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_dgnss_status_source_printf(sbp_msg_dgnss_status_t *msg, + bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_vprintf(&msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_vprintf(&msg->source, + SBP_MSG_DGNSS_STATUS_SOURCE_MAX, + should_trunc, n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_dgnss_status_source_vprintf(sbp_msg_dgnss_status_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_vprintf(&msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_dgnss_status_source_vprintf(sbp_msg_dgnss_status_t *msg, + bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_vprintf(&msg->source, + SBP_MSG_DGNSS_STATUS_SOURCE_MAX, + should_trunc, n_written, fmt, ap); } -bool sbp_msg_dgnss_status_source_append_printf(sbp_msg_dgnss_status_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_dgnss_status_source_append_printf(sbp_msg_dgnss_status_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_append_vprintf(&msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_append_vprintf( + &msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX, should_trunc, n_written, + fmt, ap); va_end(ap); return ret; } - bool sbp_msg_dgnss_status_source_append_vprintf(sbp_msg_dgnss_status_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_append_vprintf(&msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_dgnss_status_source_append_vprintf(sbp_msg_dgnss_status_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_append_vprintf( + &msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX, should_trunc, n_written, + fmt, ap); } -const char *sbp_msg_dgnss_status_source_get(const sbp_msg_dgnss_status_t *msg) -{ - return sbp_unterminated_string_get(&msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX); +const char *sbp_msg_dgnss_status_source_get(const sbp_msg_dgnss_status_t *msg) { + return sbp_unterminated_string_get(&msg->source, + SBP_MSG_DGNSS_STATUS_SOURCE_MAX); } -size_t sbp_msg_dgnss_status_source_strlen(const sbp_msg_dgnss_status_t *msg) -{ - return sbp_unterminated_string_strlen(&msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX); +size_t sbp_msg_dgnss_status_source_strlen(const sbp_msg_dgnss_status_t *msg) { + return sbp_unterminated_string_strlen(&msg->source, + SBP_MSG_DGNSS_STATUS_SOURCE_MAX); } -bool sbp_msg_dgnss_status_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_dgnss_status_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } - if (!sbp_u16_encode(ctx, &msg->latency)) { return false; } - if (!sbp_u8_encode(ctx, &msg->num_signals)) { return false; } - if (!sbp_unterminated_string_encode(&msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX, ctx)) { return false; } +bool sbp_msg_dgnss_status_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_dgnss_status_t *msg) { + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->latency)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->num_signals)) { + return false; + } + if (!sbp_unterminated_string_encode(&msg->source, + SBP_MSG_DGNSS_STATUS_SOURCE_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_dgnss_status_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_dgnss_status_t *msg) { +s8 sbp_msg_dgnss_status_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_dgnss_status_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -181,16 +236,26 @@ s8 sbp_msg_dgnss_status_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, co return SBP_OK; } -bool sbp_msg_dgnss_status_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_dgnss_status_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } - if (!sbp_u16_decode(ctx, &msg->latency)) { return false; } - if (!sbp_u8_decode(ctx, &msg->num_signals)) { return false; } - if (!sbp_unterminated_string_decode(&msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX, ctx)) { return false; } +bool sbp_msg_dgnss_status_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_dgnss_status_t *msg) { + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->latency)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->num_signals)) { + return false; + } + if (!sbp_unterminated_string_decode(&msg->source, + SBP_MSG_DGNSS_STATUS_SOURCE_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_dgnss_status_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_dgnss_status_t *msg) { +s8 sbp_msg_dgnss_status_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_dgnss_status_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -204,40 +269,56 @@ s8 sbp_msg_dgnss_status_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_dgnss_status_send(sbp_state_t *s, u16 sender_id, const sbp_msg_dgnss_status_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_dgnss_status_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_dgnss_status_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_dgnss_status_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_DGNSS_STATUS, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_dgnss_status_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_DGNSS_STATUS, sender_id, payload_len, + payload, write); } -int sbp_msg_dgnss_status_cmp(const sbp_msg_dgnss_status_t *a, const sbp_msg_dgnss_status_t *b) { +int sbp_msg_dgnss_status_cmp(const sbp_msg_dgnss_status_t *a, + const sbp_msg_dgnss_status_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->latency, &b->latency); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->num_signals, &b->num_signals); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_dgnss_status_source_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_heartbeat_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_heartbeat_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_heartbeat_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_heartbeat_t *msg) { + if (!sbp_u32_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_heartbeat_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_heartbeat_t *msg) { +s8 sbp_msg_heartbeat_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_heartbeat_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -251,13 +332,16 @@ s8 sbp_msg_heartbeat_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_heartbeat_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_heartbeat_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_heartbeat_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_heartbeat_t *msg) { + if (!sbp_u32_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_heartbeat_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_heartbeat_t *msg) { +s8 sbp_msg_heartbeat_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_heartbeat_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -271,33 +355,47 @@ s8 sbp_msg_heartbeat_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - -s8 sbp_msg_heartbeat_send(sbp_state_t *s, u16 sender_id, const sbp_msg_heartbeat_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_heartbeat_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_heartbeat_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_heartbeat_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_HEARTBEAT, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_heartbeat_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_HEARTBEAT, sender_id, payload_len, payload, + write); } -int sbp_msg_heartbeat_cmp(const sbp_msg_heartbeat_t *a, const sbp_msg_heartbeat_t *b) { +int sbp_msg_heartbeat_cmp(const sbp_msg_heartbeat_t *a, + const sbp_msg_heartbeat_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_sub_system_report_encode_internal(sbp_encode_ctx_t *ctx, const sbp_sub_system_report_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->component)) { return false; } - if (!sbp_u8_encode(ctx, &msg->generic)) { return false; } - if (!sbp_u8_encode(ctx, &msg->specific)) { return false; } +bool sbp_sub_system_report_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_sub_system_report_t *msg) { + if (!sbp_u16_encode(ctx, &msg->component)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->generic)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->specific)) { + return false; + } return true; } -s8 sbp_sub_system_report_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_sub_system_report_t *msg) { +s8 sbp_sub_system_report_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_sub_system_report_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -311,15 +409,22 @@ s8 sbp_sub_system_report_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_sub_system_report_decode_internal(sbp_decode_ctx_t *ctx, sbp_sub_system_report_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->component)) { return false; } - if (!sbp_u8_decode(ctx, &msg->generic)) { return false; } - if (!sbp_u8_decode(ctx, &msg->specific)) { return false; } +bool sbp_sub_system_report_decode_internal(sbp_decode_ctx_t *ctx, + sbp_sub_system_report_t *msg) { + if (!sbp_u16_decode(ctx, &msg->component)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->generic)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->specific)) { + return false; + } return true; } -s8 sbp_sub_system_report_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_sub_system_report_t *msg) { +s8 sbp_sub_system_report_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_sub_system_report_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -333,36 +438,51 @@ s8 sbp_sub_system_report_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - - -int sbp_sub_system_report_cmp(const sbp_sub_system_report_t *a, const sbp_sub_system_report_t *b) { +int sbp_sub_system_report_cmp(const sbp_sub_system_report_t *a, + const sbp_sub_system_report_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->component, &b->component); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->generic, &b->generic); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->specific, &b->specific); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_status_report_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_status_report_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->reporting_system)) { return false; } - if (!sbp_u16_encode(ctx, &msg->sbp_version)) { return false; } - if (!sbp_u32_encode(ctx, &msg->sequence)) { return false; } - if (!sbp_u32_encode(ctx, &msg->uptime)) { return false; } - for (size_t i = 0; i < msg->n_status; i++) - { - if (!sbp_sub_system_report_encode_internal(ctx, &msg->status[i])) { return false; } +bool sbp_msg_status_report_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_status_report_t *msg) { + if (!sbp_u16_encode(ctx, &msg->reporting_system)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->sbp_version)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->uptime)) { + return false; + } + for (size_t i = 0; i < msg->n_status; i++) { + if (!sbp_sub_system_report_encode_internal(ctx, &msg->status[i])) { + return false; + } } return true; } -s8 sbp_msg_status_report_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_status_report_t *msg) { +s8 sbp_msg_status_report_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_status_report_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -376,23 +496,35 @@ s8 sbp_msg_status_report_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_msg_status_report_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_status_report_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->reporting_system)) { return false; } - if (!sbp_u16_decode(ctx, &msg->sbp_version)) { return false; } - if (!sbp_u32_decode(ctx, &msg->sequence)) { return false; } - if (!sbp_u32_decode(ctx, &msg->uptime)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_SUB_SYSTEM_REPORT_ENCODED_LEN) != 0) { +bool sbp_msg_status_report_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_status_report_t *msg) { + if (!sbp_u16_decode(ctx, &msg->reporting_system)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->sbp_version)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->sequence)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->uptime)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_SUB_SYSTEM_REPORT_ENCODED_LEN) != 0) { + return false; + } + msg->n_status = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_SUB_SYSTEM_REPORT_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_status; i++) { + if (!sbp_sub_system_report_decode_internal(ctx, &msg->status[i])) { return false; } - msg->n_status = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_SUB_SYSTEM_REPORT_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_status; i++) { - if (!sbp_sub_system_report_decode_internal(ctx, &msg->status[i])) { return false; } - } + } return true; } -s8 sbp_msg_status_report_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_status_report_t *msg) { +s8 sbp_msg_status_report_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_msg_status_report_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -406,48 +538,67 @@ s8 sbp_msg_status_report_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - -s8 sbp_msg_status_report_send(sbp_state_t *s, u16 sender_id, const sbp_msg_status_report_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_status_report_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_status_report_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_status_report_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_STATUS_REPORT, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_status_report_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_STATUS_REPORT, sender_id, payload_len, + payload, write); } -int sbp_msg_status_report_cmp(const sbp_msg_status_report_t *a, const sbp_msg_status_report_t *b) { +int sbp_msg_status_report_cmp(const sbp_msg_status_report_t *a, + const sbp_msg_status_report_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->reporting_system, &b->reporting_system); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->sbp_version, &b->sbp_version); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->sequence, &b->sequence); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->uptime, &b->uptime); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_status, &b->n_status); - for (uint8_t i = 0; ret == 0 && i < a->n_status; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_status; i++) { ret = sbp_sub_system_report_cmp(&a->status[i], &b->status[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_status_journal_item_encode_internal(sbp_encode_ctx_t *ctx, const sbp_status_journal_item_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->uptime)) { return false; } - if (!sbp_sub_system_report_encode_internal(ctx, &msg->report)) { return false; } +bool sbp_status_journal_item_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_status_journal_item_t *msg) { + if (!sbp_u32_encode(ctx, &msg->uptime)) { + return false; + } + if (!sbp_sub_system_report_encode_internal(ctx, &msg->report)) { + return false; + } return true; } -s8 sbp_status_journal_item_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_status_journal_item_t *msg) { +s8 sbp_status_journal_item_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_status_journal_item_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -461,14 +612,20 @@ s8 sbp_status_journal_item_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_status_journal_item_decode_internal(sbp_decode_ctx_t *ctx, sbp_status_journal_item_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->uptime)) { return false; } - if (!sbp_sub_system_report_decode_internal(ctx, &msg->report)) { return false; } +bool sbp_status_journal_item_decode_internal(sbp_decode_ctx_t *ctx, + sbp_status_journal_item_t *msg) { + if (!sbp_u32_decode(ctx, &msg->uptime)) { + return false; + } + if (!sbp_sub_system_report_decode_internal(ctx, &msg->report)) { + return false; + } return true; } -s8 sbp_status_journal_item_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_status_journal_item_t *msg) { +s8 sbp_status_journal_item_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_status_journal_item_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -482,33 +639,46 @@ s8 sbp_status_journal_item_decode(const uint8_t *buf, uint8_t len, uint8_t *n_re return SBP_OK; } - - -int sbp_status_journal_item_cmp(const sbp_status_journal_item_t *a, const sbp_status_journal_item_t *b) { +int sbp_status_journal_item_cmp(const sbp_status_journal_item_t *a, + const sbp_status_journal_item_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->uptime, &b->uptime); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_sub_system_report_cmp(&a->report, &b->report); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_status_journal_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_status_journal_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->reporting_system)) { return false; } - if (!sbp_u16_encode(ctx, &msg->sbp_version)) { return false; } - if (!sbp_u32_encode(ctx, &msg->total_status_reports)) { return false; } - if (!sbp_u8_encode(ctx, &msg->sequence_descriptor)) { return false; } - for (size_t i = 0; i < msg->n_journal; i++) - { - if (!sbp_status_journal_item_encode_internal(ctx, &msg->journal[i])) { return false; } +bool sbp_msg_status_journal_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_status_journal_t *msg) { + if (!sbp_u16_encode(ctx, &msg->reporting_system)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->sbp_version)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->total_status_reports)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->sequence_descriptor)) { + return false; + } + for (size_t i = 0; i < msg->n_journal; i++) { + if (!sbp_status_journal_item_encode_internal(ctx, &msg->journal[i])) { + return false; + } } return true; } -s8 sbp_msg_status_journal_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_status_journal_t *msg) { +s8 sbp_msg_status_journal_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_status_journal_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -522,23 +692,37 @@ s8 sbp_msg_status_journal_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_status_journal_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_status_journal_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->reporting_system)) { return false; } - if (!sbp_u16_decode(ctx, &msg->sbp_version)) { return false; } - if (!sbp_u32_decode(ctx, &msg->total_status_reports)) { return false; } - if (!sbp_u8_decode(ctx, &msg->sequence_descriptor)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_STATUS_JOURNAL_ITEM_ENCODED_LEN) != 0) { +bool sbp_msg_status_journal_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_status_journal_t *msg) { + if (!sbp_u16_decode(ctx, &msg->reporting_system)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->sbp_version)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->total_status_reports)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->sequence_descriptor)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_STATUS_JOURNAL_ITEM_ENCODED_LEN) != + 0) { + return false; + } + msg->n_journal = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_STATUS_JOURNAL_ITEM_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_journal; i++) { + if (!sbp_status_journal_item_decode_internal(ctx, &msg->journal[i])) { return false; } - msg->n_journal = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_STATUS_JOURNAL_ITEM_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_journal; i++) { - if (!sbp_status_journal_item_decode_internal(ctx, &msg->journal[i])) { return false; } - } + } return true; } -s8 sbp_msg_status_journal_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_status_journal_t *msg) { +s8 sbp_msg_status_journal_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_status_journal_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -552,47 +736,64 @@ s8 sbp_msg_status_journal_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - -s8 sbp_msg_status_journal_send(sbp_state_t *s, u16 sender_id, const sbp_msg_status_journal_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_status_journal_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_status_journal_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_status_journal_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_STATUS_JOURNAL, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_status_journal_encode(payload, sizeof(payload), &payload_len, + msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_STATUS_JOURNAL, sender_id, payload_len, + payload, write); } -int sbp_msg_status_journal_cmp(const sbp_msg_status_journal_t *a, const sbp_msg_status_journal_t *b) { +int sbp_msg_status_journal_cmp(const sbp_msg_status_journal_t *a, + const sbp_msg_status_journal_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->reporting_system, &b->reporting_system); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->sbp_version, &b->sbp_version); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->total_status_reports, &b->total_status_reports); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->sequence_descriptor, &b->sequence_descriptor); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_journal, &b->n_journal); - for (uint8_t i = 0; ret == 0 && i < a->n_journal; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_journal; i++) { ret = sbp_status_journal_item_cmp(&a->journal[i], &b->journal[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ins_status_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ins_status_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_ins_status_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ins_status_t *msg) { + if (!sbp_u32_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_ins_status_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ins_status_t *msg) { +s8 sbp_msg_ins_status_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ins_status_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -606,13 +807,16 @@ s8 sbp_msg_ins_status_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, cons return SBP_OK; } -bool sbp_msg_ins_status_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ins_status_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_ins_status_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ins_status_t *msg) { + if (!sbp_u32_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_ins_status_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ins_status_t *msg) { +s8 sbp_msg_ins_status_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ins_status_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -626,105 +830,145 @@ s8 sbp_msg_ins_status_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, s return SBP_OK; } - -s8 sbp_msg_ins_status_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ins_status_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ins_status_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ins_status_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ins_status_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_INS_STATUS, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_ins_status_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_INS_STATUS, sender_id, payload_len, + payload, write); } -int sbp_msg_ins_status_cmp(const sbp_msg_ins_status_t *a, const sbp_msg_ins_status_t *b) { +int sbp_msg_ins_status_cmp(const sbp_msg_ins_status_t *a, + const sbp_msg_ins_status_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_csac_telemetry_telemetry_init(sbp_msg_csac_telemetry_t *msg) -{ +void sbp_msg_csac_telemetry_telemetry_init(sbp_msg_csac_telemetry_t *msg) { sbp_unterminated_string_init(&msg->telemetry); } -bool sbp_msg_csac_telemetry_telemetry_valid(const sbp_msg_csac_telemetry_t *msg) -{ - return sbp_unterminated_string_valid(&msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX); +bool sbp_msg_csac_telemetry_telemetry_valid( + const sbp_msg_csac_telemetry_t *msg) { + return sbp_unterminated_string_valid(&msg->telemetry, + SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX); } -int sbp_msg_csac_telemetry_telemetry_strcmp(const sbp_msg_csac_telemetry_t *a, const sbp_msg_csac_telemetry_t *b) -{ - return sbp_unterminated_string_strcmp(&a->telemetry, &b->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX); +int sbp_msg_csac_telemetry_telemetry_strcmp(const sbp_msg_csac_telemetry_t *a, + const sbp_msg_csac_telemetry_t *b) { + return sbp_unterminated_string_strcmp(&a->telemetry, &b->telemetry, + SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX); } -size_t sbp_msg_csac_telemetry_telemetry_encoded_len(const sbp_msg_csac_telemetry_t *msg) -{ - return sbp_unterminated_string_encoded_len(&msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX); +size_t sbp_msg_csac_telemetry_telemetry_encoded_len( + const sbp_msg_csac_telemetry_t *msg) { + return sbp_unterminated_string_encoded_len( + &msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX); } -size_t sbp_msg_csac_telemetry_telemetry_space_remaining(const sbp_msg_csac_telemetry_t *msg) -{ - return sbp_unterminated_string_space_remaining(&msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX); +size_t sbp_msg_csac_telemetry_telemetry_space_remaining( + const sbp_msg_csac_telemetry_t *msg) { + return sbp_unterminated_string_space_remaining( + &msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX); } - bool sbp_msg_csac_telemetry_telemetry_set(sbp_msg_csac_telemetry_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set(&msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, should_trunc, n_written, new_str); +bool sbp_msg_csac_telemetry_telemetry_set(sbp_msg_csac_telemetry_t *msg, + const char *new_str, + bool should_trunc, + size_t *n_written) { + return sbp_unterminated_string_set(&msg->telemetry, + SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, + should_trunc, n_written, new_str); } - bool sbp_msg_csac_telemetry_telemetry_set_raw(sbp_msg_csac_telemetry_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set_raw(&msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_csac_telemetry_telemetry_set_raw(sbp_msg_csac_telemetry_t *msg, + const char *new_buf, + size_t new_buf_len, + bool should_trunc, + size_t *n_written) { + return sbp_unterminated_string_set_raw( + &msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, should_trunc, + n_written, new_buf, new_buf_len); } - -bool sbp_msg_csac_telemetry_telemetry_printf(sbp_msg_csac_telemetry_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_csac_telemetry_telemetry_printf(sbp_msg_csac_telemetry_t *msg, + bool should_trunc, + size_t *n_written, const char *fmt, + ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_vprintf(&msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_vprintf( + &msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_csac_telemetry_telemetry_vprintf(sbp_msg_csac_telemetry_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_vprintf(&msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_csac_telemetry_telemetry_vprintf(sbp_msg_csac_telemetry_t *msg, + bool should_trunc, + size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_vprintf(&msg->telemetry, + SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, + should_trunc, n_written, fmt, ap); } -bool sbp_msg_csac_telemetry_telemetry_append_printf(sbp_msg_csac_telemetry_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_csac_telemetry_telemetry_append_printf( + sbp_msg_csac_telemetry_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_append_vprintf(&msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_append_vprintf( + &msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_csac_telemetry_telemetry_append_vprintf(sbp_msg_csac_telemetry_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_append_vprintf(&msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_csac_telemetry_telemetry_append_vprintf( + sbp_msg_csac_telemetry_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_append_vprintf( + &msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, should_trunc, + n_written, fmt, ap); } -const char *sbp_msg_csac_telemetry_telemetry_get(const sbp_msg_csac_telemetry_t *msg) -{ - return sbp_unterminated_string_get(&msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX); +const char *sbp_msg_csac_telemetry_telemetry_get( + const sbp_msg_csac_telemetry_t *msg) { + return sbp_unterminated_string_get(&msg->telemetry, + SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX); } -size_t sbp_msg_csac_telemetry_telemetry_strlen(const sbp_msg_csac_telemetry_t *msg) -{ - return sbp_unterminated_string_strlen(&msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX); +size_t sbp_msg_csac_telemetry_telemetry_strlen( + const sbp_msg_csac_telemetry_t *msg) { + return sbp_unterminated_string_strlen(&msg->telemetry, + SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX); } -bool sbp_msg_csac_telemetry_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_csac_telemetry_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->id)) { return false; } - if (!sbp_unterminated_string_encode(&msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, ctx)) { return false; } +bool sbp_msg_csac_telemetry_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_csac_telemetry_t *msg) { + if (!sbp_u8_encode(ctx, &msg->id)) { + return false; + } + if (!sbp_unterminated_string_encode( + &msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_csac_telemetry_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_csac_telemetry_t *msg) { +s8 sbp_msg_csac_telemetry_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_csac_telemetry_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -738,14 +982,21 @@ s8 sbp_msg_csac_telemetry_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_csac_telemetry_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_csac_telemetry_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->id)) { return false; } - if (!sbp_unterminated_string_decode(&msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, ctx)) { return false; } +bool sbp_msg_csac_telemetry_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_csac_telemetry_t *msg) { + if (!sbp_u8_decode(ctx, &msg->id)) { + return false; + } + if (!sbp_unterminated_string_decode( + &msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_csac_telemetry_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_csac_telemetry_t *msg) { +s8 sbp_msg_csac_telemetry_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_csac_telemetry_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -759,108 +1010,161 @@ s8 sbp_msg_csac_telemetry_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - -s8 sbp_msg_csac_telemetry_send(sbp_state_t *s, u16 sender_id, const sbp_msg_csac_telemetry_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_csac_telemetry_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_csac_telemetry_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_csac_telemetry_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_CSAC_TELEMETRY, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_csac_telemetry_encode(payload, sizeof(payload), &payload_len, + msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_CSAC_TELEMETRY, sender_id, payload_len, + payload, write); } -int sbp_msg_csac_telemetry_cmp(const sbp_msg_csac_telemetry_t *a, const sbp_msg_csac_telemetry_t *b) { +int sbp_msg_csac_telemetry_cmp(const sbp_msg_csac_telemetry_t *a, + const sbp_msg_csac_telemetry_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->id, &b->id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_csac_telemetry_telemetry_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -void sbp_msg_csac_telemetry_labels_telemetry_labels_init(sbp_msg_csac_telemetry_labels_t *msg) -{ +void sbp_msg_csac_telemetry_labels_telemetry_labels_init( + sbp_msg_csac_telemetry_labels_t *msg) { sbp_unterminated_string_init(&msg->telemetry_labels); } -bool sbp_msg_csac_telemetry_labels_telemetry_labels_valid(const sbp_msg_csac_telemetry_labels_t *msg) -{ - return sbp_unterminated_string_valid(&msg->telemetry_labels, SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX); +bool sbp_msg_csac_telemetry_labels_telemetry_labels_valid( + const sbp_msg_csac_telemetry_labels_t *msg) { + return sbp_unterminated_string_valid( + &msg->telemetry_labels, + SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX); } -int sbp_msg_csac_telemetry_labels_telemetry_labels_strcmp(const sbp_msg_csac_telemetry_labels_t *a, const sbp_msg_csac_telemetry_labels_t *b) -{ - return sbp_unterminated_string_strcmp(&a->telemetry_labels, &b->telemetry_labels, SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX); +int sbp_msg_csac_telemetry_labels_telemetry_labels_strcmp( + const sbp_msg_csac_telemetry_labels_t *a, + const sbp_msg_csac_telemetry_labels_t *b) { + return sbp_unterminated_string_strcmp( + &a->telemetry_labels, &b->telemetry_labels, + SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX); } -size_t sbp_msg_csac_telemetry_labels_telemetry_labels_encoded_len(const sbp_msg_csac_telemetry_labels_t *msg) -{ - return sbp_unterminated_string_encoded_len(&msg->telemetry_labels, SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX); +size_t sbp_msg_csac_telemetry_labels_telemetry_labels_encoded_len( + const sbp_msg_csac_telemetry_labels_t *msg) { + return sbp_unterminated_string_encoded_len( + &msg->telemetry_labels, + SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX); } -size_t sbp_msg_csac_telemetry_labels_telemetry_labels_space_remaining(const sbp_msg_csac_telemetry_labels_t *msg) -{ - return sbp_unterminated_string_space_remaining(&msg->telemetry_labels, SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX); +size_t sbp_msg_csac_telemetry_labels_telemetry_labels_space_remaining( + const sbp_msg_csac_telemetry_labels_t *msg) { + return sbp_unterminated_string_space_remaining( + &msg->telemetry_labels, + SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX); } - bool sbp_msg_csac_telemetry_labels_telemetry_labels_set(sbp_msg_csac_telemetry_labels_t *msg, const char *new_str, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set(&msg->telemetry_labels, SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, should_trunc, n_written, new_str); +bool sbp_msg_csac_telemetry_labels_telemetry_labels_set( + sbp_msg_csac_telemetry_labels_t *msg, const char *new_str, + bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set( + &msg->telemetry_labels, + SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, should_trunc, + n_written, new_str); } - bool sbp_msg_csac_telemetry_labels_telemetry_labels_set_raw(sbp_msg_csac_telemetry_labels_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) -{ - return sbp_unterminated_string_set_raw(&msg->telemetry_labels, SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, should_trunc, n_written, new_buf, new_buf_len); +bool sbp_msg_csac_telemetry_labels_telemetry_labels_set_raw( + sbp_msg_csac_telemetry_labels_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { + return sbp_unterminated_string_set_raw( + &msg->telemetry_labels, + SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, should_trunc, + n_written, new_buf, new_buf_len); } - -bool sbp_msg_csac_telemetry_labels_telemetry_labels_printf(sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_csac_telemetry_labels_telemetry_labels_printf( + sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_vprintf(&msg->telemetry_labels, SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_vprintf( + &msg->telemetry_labels, + SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_csac_telemetry_labels_telemetry_labels_vprintf(sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_vprintf(&msg->telemetry_labels, SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_csac_telemetry_labels_telemetry_labels_vprintf( + sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_vprintf( + &msg->telemetry_labels, + SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, should_trunc, + n_written, fmt, ap); } -bool sbp_msg_csac_telemetry_labels_telemetry_labels_append_printf(sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, const char *fmt, ...) -{ +bool sbp_msg_csac_telemetry_labels_telemetry_labels_append_printf( + sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); - bool ret = sbp_unterminated_string_append_vprintf(&msg->telemetry_labels, SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, should_trunc, n_written, fmt, ap); + bool ret = sbp_unterminated_string_append_vprintf( + &msg->telemetry_labels, + SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, should_trunc, + n_written, fmt, ap); va_end(ap); return ret; } - bool sbp_msg_csac_telemetry_labels_telemetry_labels_append_vprintf(sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, const char *fmt, va_list ap) -{ - return sbp_unterminated_string_append_vprintf(&msg->telemetry_labels, SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, should_trunc, n_written, fmt, ap); +bool sbp_msg_csac_telemetry_labels_telemetry_labels_append_vprintf( + sbp_msg_csac_telemetry_labels_t *msg, bool should_trunc, size_t *n_written, + const char *fmt, va_list ap) { + return sbp_unterminated_string_append_vprintf( + &msg->telemetry_labels, + SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, should_trunc, + n_written, fmt, ap); } -const char *sbp_msg_csac_telemetry_labels_telemetry_labels_get(const sbp_msg_csac_telemetry_labels_t *msg) -{ - return sbp_unterminated_string_get(&msg->telemetry_labels, SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX); +const char *sbp_msg_csac_telemetry_labels_telemetry_labels_get( + const sbp_msg_csac_telemetry_labels_t *msg) { + return sbp_unterminated_string_get( + &msg->telemetry_labels, + SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX); } -size_t sbp_msg_csac_telemetry_labels_telemetry_labels_strlen(const sbp_msg_csac_telemetry_labels_t *msg) -{ - return sbp_unterminated_string_strlen(&msg->telemetry_labels, SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX); +size_t sbp_msg_csac_telemetry_labels_telemetry_labels_strlen( + const sbp_msg_csac_telemetry_labels_t *msg) { + return sbp_unterminated_string_strlen( + &msg->telemetry_labels, + SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX); } -bool sbp_msg_csac_telemetry_labels_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_csac_telemetry_labels_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->id)) { return false; } - if (!sbp_unterminated_string_encode(&msg->telemetry_labels, SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, ctx)) { return false; } +bool sbp_msg_csac_telemetry_labels_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_csac_telemetry_labels_t *msg) { + if (!sbp_u8_encode(ctx, &msg->id)) { + return false; + } + if (!sbp_unterminated_string_encode( + &msg->telemetry_labels, + SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_csac_telemetry_labels_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_csac_telemetry_labels_t *msg) { +s8 sbp_msg_csac_telemetry_labels_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_csac_telemetry_labels_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -874,14 +1178,22 @@ s8 sbp_msg_csac_telemetry_labels_encode(uint8_t *buf, uint8_t len, uint8_t *n_wr return SBP_OK; } -bool sbp_msg_csac_telemetry_labels_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_csac_telemetry_labels_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->id)) { return false; } - if (!sbp_unterminated_string_decode(&msg->telemetry_labels, SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, ctx)) { return false; } +bool sbp_msg_csac_telemetry_labels_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_csac_telemetry_labels_t *msg) { + if (!sbp_u8_decode(ctx, &msg->id)) { + return false; + } + if (!sbp_unterminated_string_decode( + &msg->telemetry_labels, + SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, ctx)) { + return false; + } return true; } -s8 sbp_msg_csac_telemetry_labels_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_csac_telemetry_labels_t *msg) { +s8 sbp_msg_csac_telemetry_labels_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_csac_telemetry_labels_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -895,40 +1207,65 @@ s8 sbp_msg_csac_telemetry_labels_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_csac_telemetry_labels_send(sbp_state_t *s, u16 sender_id, const sbp_msg_csac_telemetry_labels_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_csac_telemetry_labels_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_csac_telemetry_labels_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_csac_telemetry_labels_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_CSAC_TELEMETRY_LABELS, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_csac_telemetry_labels_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_CSAC_TELEMETRY_LABELS, sender_id, + payload_len, payload, write); } -int sbp_msg_csac_telemetry_labels_cmp(const sbp_msg_csac_telemetry_labels_t *a, const sbp_msg_csac_telemetry_labels_t *b) { +int sbp_msg_csac_telemetry_labels_cmp( + const sbp_msg_csac_telemetry_labels_t *a, + const sbp_msg_csac_telemetry_labels_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->id, &b->id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_msg_csac_telemetry_labels_telemetry_labels_strcmp(a, b); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_ins_updates_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_ins_updates_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u8_encode(ctx, &msg->gnsspos)) { return false; } - if (!sbp_u8_encode(ctx, &msg->gnssvel)) { return false; } - if (!sbp_u8_encode(ctx, &msg->wheelticks)) { return false; } - if (!sbp_u8_encode(ctx, &msg->speed)) { return false; } - if (!sbp_u8_encode(ctx, &msg->nhc)) { return false; } - if (!sbp_u8_encode(ctx, &msg->zerovel)) { return false; } +bool sbp_msg_ins_updates_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_ins_updates_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->gnsspos)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->gnssvel)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->wheelticks)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->speed)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->nhc)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->zerovel)) { + return false; + } return true; } -s8 sbp_msg_ins_updates_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_ins_updates_t *msg) { +s8 sbp_msg_ins_updates_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ins_updates_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -942,19 +1279,34 @@ s8 sbp_msg_ins_updates_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, con return SBP_OK; } -bool sbp_msg_ins_updates_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_ins_updates_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u8_decode(ctx, &msg->gnsspos)) { return false; } - if (!sbp_u8_decode(ctx, &msg->gnssvel)) { return false; } - if (!sbp_u8_decode(ctx, &msg->wheelticks)) { return false; } - if (!sbp_u8_decode(ctx, &msg->speed)) { return false; } - if (!sbp_u8_decode(ctx, &msg->nhc)) { return false; } - if (!sbp_u8_decode(ctx, &msg->zerovel)) { return false; } +bool sbp_msg_ins_updates_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_ins_updates_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->gnsspos)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->gnssvel)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->wheelticks)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->speed)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->nhc)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->zerovel)) { + return false; + } return true; } -s8 sbp_msg_ins_updates_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_ins_updates_t *msg) { +s8 sbp_msg_ins_updates_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ins_updates_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -968,52 +1320,81 @@ s8 sbp_msg_ins_updates_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_ins_updates_send(sbp_state_t *s, u16 sender_id, const sbp_msg_ins_updates_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_ins_updates_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_ins_updates_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ins_updates_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_INS_UPDATES, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_ins_updates_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_INS_UPDATES, sender_id, payload_len, + payload, write); } -int sbp_msg_ins_updates_cmp(const sbp_msg_ins_updates_t *a, const sbp_msg_ins_updates_t *b) { +int sbp_msg_ins_updates_cmp(const sbp_msg_ins_updates_t *a, + const sbp_msg_ins_updates_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->gnsspos, &b->gnsspos); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->gnssvel, &b->gnssvel); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->wheelticks, &b->wheelticks); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->speed, &b->speed); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->nhc, &b->nhc); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->zerovel, &b->zerovel); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_gnss_time_offset_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_gnss_time_offset_t *msg) -{ - if (!sbp_s16_encode(ctx, &msg->weeks)) { return false; } - if (!sbp_s32_encode(ctx, &msg->milliseconds)) { return false; } - if (!sbp_s16_encode(ctx, &msg->microseconds)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_gnss_time_offset_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_gnss_time_offset_t *msg) { + if (!sbp_s16_encode(ctx, &msg->weeks)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->milliseconds)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->microseconds)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_gnss_time_offset_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_gnss_time_offset_t *msg) { +s8 sbp_msg_gnss_time_offset_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_gnss_time_offset_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1027,16 +1408,26 @@ s8 sbp_msg_gnss_time_offset_encode(uint8_t *buf, uint8_t len, uint8_t *n_written return SBP_OK; } -bool sbp_msg_gnss_time_offset_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_gnss_time_offset_t *msg) -{ - if (!sbp_s16_decode(ctx, &msg->weeks)) { return false; } - if (!sbp_s32_decode(ctx, &msg->milliseconds)) { return false; } - if (!sbp_s16_decode(ctx, &msg->microseconds)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_gnss_time_offset_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_gnss_time_offset_t *msg) { + if (!sbp_s16_decode(ctx, &msg->weeks)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->milliseconds)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->microseconds)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_gnss_time_offset_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_gnss_time_offset_t *msg) { +s8 sbp_msg_gnss_time_offset_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_gnss_time_offset_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1050,41 +1441,59 @@ s8 sbp_msg_gnss_time_offset_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r return SBP_OK; } - -s8 sbp_msg_gnss_time_offset_send(sbp_state_t *s, u16 sender_id, const sbp_msg_gnss_time_offset_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_gnss_time_offset_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_gnss_time_offset_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_gnss_time_offset_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_GNSS_TIME_OFFSET, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_gnss_time_offset_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_GNSS_TIME_OFFSET, sender_id, payload_len, + payload, write); } -int sbp_msg_gnss_time_offset_cmp(const sbp_msg_gnss_time_offset_t *a, const sbp_msg_gnss_time_offset_t *b) { +int sbp_msg_gnss_time_offset_cmp(const sbp_msg_gnss_time_offset_t *a, + const sbp_msg_gnss_time_offset_t *b) { int ret = 0; - + ret = sbp_s16_cmp(&a->weeks, &b->weeks); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->milliseconds, &b->milliseconds); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->microseconds, &b->microseconds); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_pps_time_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_pps_time_t *msg) -{ - if (!sbp_u64_encode(ctx, &msg->time)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pps_time_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_pps_time_t *msg) { + if (!sbp_u64_encode(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pps_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_pps_time_t *msg) { +s8 sbp_msg_pps_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_pps_time_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1098,14 +1507,19 @@ s8 sbp_msg_pps_time_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_pps_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_pps_time_t *msg) -{ - if (!sbp_u64_decode(ctx, &msg->time)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_pps_time_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_pps_time_t *msg) { + if (!sbp_u64_decode(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_pps_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_pps_time_t *msg) { +s8 sbp_msg_pps_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_pps_time_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1119,41 +1533,66 @@ s8 sbp_msg_pps_time_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp return SBP_OK; } - -s8 sbp_msg_pps_time_send(sbp_state_t *s, u16 sender_id, const sbp_msg_pps_time_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_pps_time_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_pps_time_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_pps_time_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_PPS_TIME, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_PPS_TIME, sender_id, payload_len, payload, + write); } -int sbp_msg_pps_time_cmp(const sbp_msg_pps_time_t *a, const sbp_msg_pps_time_t *b) { +int sbp_msg_pps_time_cmp(const sbp_msg_pps_time_t *a, + const sbp_msg_pps_time_t *b) { int ret = 0; - + ret = sbp_u64_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_sensor_aid_event_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_sensor_aid_event_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->time)) { return false; } - if (!sbp_u8_encode(ctx, &msg->sensor_type)) { return false; } - if (!sbp_u16_encode(ctx, &msg->sensor_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->sensor_state)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_available_meas)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_attempted_meas)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_accepted_meas)) { return false; } - if (!sbp_u32_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_sensor_aid_event_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_sensor_aid_event_t *msg) { + if (!sbp_u32_encode(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->sensor_type)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->sensor_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->sensor_state)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_available_meas)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_attempted_meas)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_accepted_meas)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_sensor_aid_event_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_sensor_aid_event_t *msg) { +s8 sbp_msg_sensor_aid_event_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_sensor_aid_event_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1167,20 +1606,38 @@ s8 sbp_msg_sensor_aid_event_encode(uint8_t *buf, uint8_t len, uint8_t *n_written return SBP_OK; } -bool sbp_msg_sensor_aid_event_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_sensor_aid_event_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->time)) { return false; } - if (!sbp_u8_decode(ctx, &msg->sensor_type)) { return false; } - if (!sbp_u16_decode(ctx, &msg->sensor_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->sensor_state)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_available_meas)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_attempted_meas)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_accepted_meas)) { return false; } - if (!sbp_u32_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_sensor_aid_event_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_sensor_aid_event_t *msg) { + if (!sbp_u32_decode(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->sensor_type)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->sensor_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->sensor_state)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_available_meas)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_attempted_meas)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_accepted_meas)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_sensor_aid_event_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_sensor_aid_event_t *msg) { +s8 sbp_msg_sensor_aid_event_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_sensor_aid_event_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1194,58 +1651,87 @@ s8 sbp_msg_sensor_aid_event_decode(const uint8_t *buf, uint8_t len, uint8_t *n_r return SBP_OK; } - -s8 sbp_msg_sensor_aid_event_send(sbp_state_t *s, u16 sender_id, const sbp_msg_sensor_aid_event_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_sensor_aid_event_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_sensor_aid_event_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_sensor_aid_event_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_SENSOR_AID_EVENT, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_sensor_aid_event_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_SENSOR_AID_EVENT, sender_id, payload_len, + payload, write); } -int sbp_msg_sensor_aid_event_cmp(const sbp_msg_sensor_aid_event_t *a, const sbp_msg_sensor_aid_event_t *b) { +int sbp_msg_sensor_aid_event_cmp(const sbp_msg_sensor_aid_event_t *a, + const sbp_msg_sensor_aid_event_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->sensor_type, &b->sensor_type); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->sensor_id, &b->sensor_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->sensor_state, &b->sensor_state); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_available_meas, &b->n_available_meas); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_attempted_meas, &b->n_attempted_meas); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_accepted_meas, &b->n_accepted_meas); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_group_meta_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_group_meta_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->group_id)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_group_msgs)) { return false; } - for (size_t i = 0; i < msg->n_group_msgs; i++) - { - if (!sbp_u16_encode(ctx, &msg->group_msgs[i])) { return false; } +bool sbp_msg_group_meta_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_group_meta_t *msg) { + if (!sbp_u8_encode(ctx, &msg->group_id)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_group_msgs)) { + return false; + } + for (size_t i = 0; i < msg->n_group_msgs; i++) { + if (!sbp_u16_encode(ctx, &msg->group_msgs[i])) { + return false; + } } return true; } -s8 sbp_msg_group_meta_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_group_meta_t *msg) { +s8 sbp_msg_group_meta_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_group_meta_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1259,22 +1745,32 @@ s8 sbp_msg_group_meta_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, cons return SBP_OK; } -bool sbp_msg_group_meta_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_group_meta_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->group_id)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_group_msgs)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U16) != 0) { +bool sbp_msg_group_meta_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_group_meta_t *msg) { + if (!sbp_u8_decode(ctx, &msg->group_id)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_group_msgs)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U16) != 0) { + return false; + } + msg->n_group_msgs = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U16); + for (uint8_t i = 0; i < msg->n_group_msgs; i++) { + if (!sbp_u16_decode(ctx, &msg->group_msgs[i])) { return false; } - msg->n_group_msgs = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U16); - for (uint8_t i = 0; i < msg->n_group_msgs; i++) { - if (!sbp_u16_decode(ctx, &msg->group_msgs[i])) { return false; } - } + } return true; } -s8 sbp_msg_group_meta_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_group_meta_t *msg) { +s8 sbp_msg_group_meta_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_group_meta_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1288,33 +1784,45 @@ s8 sbp_msg_group_meta_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, s return SBP_OK; } - -s8 sbp_msg_group_meta_send(sbp_state_t *s, u16 sender_id, const sbp_msg_group_meta_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_group_meta_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_group_meta_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_group_meta_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_GROUP_META, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_group_meta_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_GROUP_META, sender_id, payload_len, + payload, write); } -int sbp_msg_group_meta_cmp(const sbp_msg_group_meta_t *a, const sbp_msg_group_meta_t *b) { +int sbp_msg_group_meta_cmp(const sbp_msg_group_meta_t *a, + const sbp_msg_group_meta_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->group_id, &b->group_id); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_group_msgs, &b->n_group_msgs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_group_msgs, &b->n_group_msgs); - for (uint8_t i = 0; ret == 0 && i < a->n_group_msgs; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_group_msgs; i++) { ret = sbp_u16_cmp(&a->group_msgs[i], &b->group_msgs[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/telemetry.c b/c/src/telemetry.c index c37880e23..70f07dd4e 100644 --- a/c/src/telemetry.c +++ b/c/src/telemetry.c @@ -3,35 +3,54 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include -#include +#include +#include #include #include -#include #include +#include +#include +#include -bool sbp_telemetry_sv_encode_internal(sbp_encode_ctx_t *ctx, const sbp_telemetry_sv_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->az)) { return false; } - if (!sbp_s8_encode(ctx, &msg->el)) { return false; } - if (!sbp_u8_encode(ctx, &msg->availability_flags)) { return false; } - if (!sbp_s16_encode(ctx, &msg->pseudorange_residual)) { return false; } - if (!sbp_s16_encode(ctx, &msg->phase_residual)) { return false; } - if (!sbp_u8_encode(ctx, &msg->outlier_flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->ephemeris_flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->correction_flags)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } +bool sbp_telemetry_sv_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_telemetry_sv_t *msg) { + if (!sbp_u8_encode(ctx, &msg->az)) { + return false; + } + if (!sbp_s8_encode(ctx, &msg->el)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->availability_flags)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->pseudorange_residual)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->phase_residual)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->outlier_flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->ephemeris_flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->correction_flags)) { + return false; + } + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_telemetry_sv_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_telemetry_sv_t *msg) { +s8 sbp_telemetry_sv_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_telemetry_sv_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -45,21 +64,40 @@ s8 sbp_telemetry_sv_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_telemetry_sv_decode_internal(sbp_decode_ctx_t *ctx, sbp_telemetry_sv_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->az)) { return false; } - if (!sbp_s8_decode(ctx, &msg->el)) { return false; } - if (!sbp_u8_decode(ctx, &msg->availability_flags)) { return false; } - if (!sbp_s16_decode(ctx, &msg->pseudorange_residual)) { return false; } - if (!sbp_s16_decode(ctx, &msg->phase_residual)) { return false; } - if (!sbp_u8_decode(ctx, &msg->outlier_flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->ephemeris_flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->correction_flags)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } +bool sbp_telemetry_sv_decode_internal(sbp_decode_ctx_t *ctx, + sbp_telemetry_sv_t *msg) { + if (!sbp_u8_decode(ctx, &msg->az)) { + return false; + } + if (!sbp_s8_decode(ctx, &msg->el)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->availability_flags)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->pseudorange_residual)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->phase_residual)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->outlier_flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->ephemeris_flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->correction_flags)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } return true; } -s8 sbp_telemetry_sv_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_telemetry_sv_t *msg) { +s8 sbp_telemetry_sv_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_telemetry_sv_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -73,54 +111,81 @@ s8 sbp_telemetry_sv_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp return SBP_OK; } - - -int sbp_telemetry_sv_cmp(const sbp_telemetry_sv_t *a, const sbp_telemetry_sv_t *b) { +int sbp_telemetry_sv_cmp(const sbp_telemetry_sv_t *a, + const sbp_telemetry_sv_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->az, &b->az); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s8_cmp(&a->el, &b->el); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->availability_flags, &b->availability_flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->pseudorange_residual, &b->pseudorange_residual); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->phase_residual, &b->phase_residual); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->outlier_flags, &b->outlier_flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->ephemeris_flags, &b->ephemeris_flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->correction_flags, &b->correction_flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_tel_sv_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tel_sv_t *msg) -{ - if (!sbp_u16_encode(ctx, &msg->wn)) { return false; } - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_u8_encode(ctx, &msg->n_obs)) { return false; } - if (!sbp_u8_encode(ctx, &msg->origin_flags)) { return false; } - for (size_t i = 0; i < msg->n_sv_tel; i++) - { - if (!sbp_telemetry_sv_encode_internal(ctx, &msg->sv_tel[i])) { return false; } +bool sbp_msg_tel_sv_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_tel_sv_t *msg) { + if (!sbp_u16_encode(ctx, &msg->wn)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->n_obs)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->origin_flags)) { + return false; + } + for (size_t i = 0; i < msg->n_sv_tel; i++) { + if (!sbp_telemetry_sv_encode_internal(ctx, &msg->sv_tel[i])) { + return false; + } } return true; } -s8 sbp_msg_tel_sv_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tel_sv_t *msg) { +s8 sbp_msg_tel_sv_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tel_sv_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -134,23 +199,35 @@ s8 sbp_msg_tel_sv_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sb return SBP_OK; } -bool sbp_msg_tel_sv_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tel_sv_t *msg) -{ - if (!sbp_u16_decode(ctx, &msg->wn)) { return false; } - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_u8_decode(ctx, &msg->n_obs)) { return false; } - if (!sbp_u8_decode(ctx, &msg->origin_flags)) { return false; } - if ( ((ctx->buf_len - ctx->offset) % SBP_TELEMETRY_SV_ENCODED_LEN) != 0) { +bool sbp_msg_tel_sv_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_tel_sv_t *msg) { + if (!sbp_u16_decode(ctx, &msg->wn)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->n_obs)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->origin_flags)) { + return false; + } + if (((ctx->buf_len - ctx->offset) % SBP_TELEMETRY_SV_ENCODED_LEN) != 0) { + return false; + } + msg->n_sv_tel = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_TELEMETRY_SV_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_sv_tel; i++) { + if (!sbp_telemetry_sv_decode_internal(ctx, &msg->sv_tel[i])) { return false; } - msg->n_sv_tel = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_TELEMETRY_SV_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_sv_tel; i++) { - if (!sbp_telemetry_sv_decode_internal(ctx, &msg->sv_tel[i])) { return false; } - } + } return true; } -s8 sbp_msg_tel_sv_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tel_sv_t *msg) { +s8 sbp_msg_tel_sv_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tel_sv_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -164,36 +241,47 @@ s8 sbp_msg_tel_sv_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_m return SBP_OK; } - -s8 sbp_msg_tel_sv_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tel_sv_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_tel_sv_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_tel_sv_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_tel_sv_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_TEL_SV, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_TEL_SV, sender_id, payload_len, payload, + write); } int sbp_msg_tel_sv_cmp(const sbp_msg_tel_sv_t *a, const sbp_msg_tel_sv_t *b) { int ret = 0; - + ret = sbp_u16_cmp(&a->wn, &b->wn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_obs, &b->n_obs); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->origin_flags, &b->origin_flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->n_sv_tel, &b->n_sv_tel); - for (uint8_t i = 0; ret == 0 && i < a->n_sv_tel; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_sv_tel; i++) { ret = sbp_telemetry_sv_cmp(&a->sv_tel[i], &b->sv_tel[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/tracking.c b/c/src/tracking.c index 36191a3e2..c79b9fd67 100644 --- a/c/src/tracking.c +++ b/c/src/tracking.c @@ -3,47 +3,91 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include -#include +#include +#include #include #include -#include #include +#include +#include +#include -bool sbp_msg_tracking_state_detailed_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_detailed_dep_a_t *msg) -{ - if (!sbp_u64_encode(ctx, &msg->recv_time)) { return false; } - if (!sbp_v4_gps_time_encode_internal(ctx, &msg->tot)) { return false; } - if (!sbp_u32_encode(ctx, &msg->P)) { return false; } - if (!sbp_u16_encode(ctx, &msg->P_std)) { return false; } - if (!sbp_carrier_phase_encode_internal(ctx, &msg->L)) { return false; } - if (!sbp_u8_encode(ctx, &msg->cn0)) { return false; } - if (!sbp_u16_encode(ctx, &msg->lock)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_s32_encode(ctx, &msg->doppler)) { return false; } - if (!sbp_u16_encode(ctx, &msg->doppler_std)) { return false; } - if (!sbp_u32_encode(ctx, &msg->uptime)) { return false; } - if (!sbp_s16_encode(ctx, &msg->clock_offset)) { return false; } - if (!sbp_s16_encode(ctx, &msg->clock_drift)) { return false; } - if (!sbp_u16_encode(ctx, &msg->corr_spacing)) { return false; } - if (!sbp_s8_encode(ctx, &msg->acceleration)) { return false; } - if (!sbp_u8_encode(ctx, &msg->sync_flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->tow_flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->track_flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->nav_flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->pset_flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->misc_flags)) { return false; } +bool sbp_msg_tracking_state_detailed_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_detailed_dep_a_t *msg) { + if (!sbp_u64_encode(ctx, &msg->recv_time)) { + return false; + } + if (!sbp_v4_gps_time_encode_internal(ctx, &msg->tot)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->P)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->P_std)) { + return false; + } + if (!sbp_carrier_phase_encode_internal(ctx, &msg->L)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->lock)) { + return false; + } + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->doppler)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->doppler_std)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->uptime)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->clock_offset)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->clock_drift)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->corr_spacing)) { + return false; + } + if (!sbp_s8_encode(ctx, &msg->acceleration)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->sync_flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->tow_flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->track_flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->nav_flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->pset_flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->misc_flags)) { + return false; + } return true; } -s8 sbp_msg_tracking_state_detailed_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_state_detailed_dep_a_t *msg) { +s8 sbp_msg_tracking_state_detailed_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_state_detailed_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -57,33 +101,77 @@ s8 sbp_msg_tracking_state_detailed_dep_a_encode(uint8_t *buf, uint8_t len, uint8 return SBP_OK; } -bool sbp_msg_tracking_state_detailed_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_detailed_dep_a_t *msg) -{ - if (!sbp_u64_decode(ctx, &msg->recv_time)) { return false; } - if (!sbp_v4_gps_time_decode_internal(ctx, &msg->tot)) { return false; } - if (!sbp_u32_decode(ctx, &msg->P)) { return false; } - if (!sbp_u16_decode(ctx, &msg->P_std)) { return false; } - if (!sbp_carrier_phase_decode_internal(ctx, &msg->L)) { return false; } - if (!sbp_u8_decode(ctx, &msg->cn0)) { return false; } - if (!sbp_u16_decode(ctx, &msg->lock)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_s32_decode(ctx, &msg->doppler)) { return false; } - if (!sbp_u16_decode(ctx, &msg->doppler_std)) { return false; } - if (!sbp_u32_decode(ctx, &msg->uptime)) { return false; } - if (!sbp_s16_decode(ctx, &msg->clock_offset)) { return false; } - if (!sbp_s16_decode(ctx, &msg->clock_drift)) { return false; } - if (!sbp_u16_decode(ctx, &msg->corr_spacing)) { return false; } - if (!sbp_s8_decode(ctx, &msg->acceleration)) { return false; } - if (!sbp_u8_decode(ctx, &msg->sync_flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->tow_flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->track_flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->nav_flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->pset_flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->misc_flags)) { return false; } +bool sbp_msg_tracking_state_detailed_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_detailed_dep_a_t *msg) { + if (!sbp_u64_decode(ctx, &msg->recv_time)) { + return false; + } + if (!sbp_v4_gps_time_decode_internal(ctx, &msg->tot)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->P)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->P_std)) { + return false; + } + if (!sbp_carrier_phase_decode_internal(ctx, &msg->L)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->lock)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->doppler)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->doppler_std)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->uptime)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->clock_offset)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->clock_drift)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->corr_spacing)) { + return false; + } + if (!sbp_s8_decode(ctx, &msg->acceleration)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->sync_flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->tow_flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->track_flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->nav_flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->pset_flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->misc_flags)) { + return false; + } return true; } -s8 sbp_msg_tracking_state_detailed_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_state_detailed_dep_a_t *msg) { +s8 sbp_msg_tracking_state_detailed_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_state_detailed_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -97,111 +185,203 @@ s8 sbp_msg_tracking_state_detailed_dep_a_decode(const uint8_t *buf, uint8_t len, return SBP_OK; } - -s8 sbp_msg_tracking_state_detailed_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_state_detailed_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_tracking_state_detailed_dep_a_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_tracking_state_detailed_dep_a_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_tracking_state_detailed_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_TRACKING_STATE_DETAILED_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_tracking_state_detailed_dep_a_encode( + payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_TRACKING_STATE_DETAILED_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_tracking_state_detailed_dep_a_cmp(const sbp_msg_tracking_state_detailed_dep_a_t *a, const sbp_msg_tracking_state_detailed_dep_a_t *b) { +int sbp_msg_tracking_state_detailed_dep_a_cmp( + const sbp_msg_tracking_state_detailed_dep_a_t *a, + const sbp_msg_tracking_state_detailed_dep_a_t *b) { int ret = 0; - + ret = sbp_u64_cmp(&a->recv_time, &b->recv_time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gps_time_cmp(&a->tot, &b->tot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->P, &b->P); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->P_std, &b->P_std); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_carrier_phase_cmp(&a->L, &b->L); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->cn0, &b->cn0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->lock, &b->lock); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->doppler, &b->doppler); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->doppler_std, &b->doppler_std); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->uptime, &b->uptime); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->clock_offset, &b->clock_offset); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->clock_drift, &b->clock_drift); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->corr_spacing, &b->corr_spacing); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s8_cmp(&a->acceleration, &b->acceleration); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->sync_flags, &b->sync_flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->tow_flags, &b->tow_flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->track_flags, &b->track_flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->nav_flags, &b->nav_flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->pset_flags, &b->pset_flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->misc_flags, &b->misc_flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_tracking_state_detailed_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_detailed_dep_t *msg) -{ - if (!sbp_u64_encode(ctx, &msg->recv_time)) { return false; } - if (!sbp_gps_time_dep_encode_internal(ctx, &msg->tot)) { return false; } - if (!sbp_u32_encode(ctx, &msg->P)) { return false; } - if (!sbp_u16_encode(ctx, &msg->P_std)) { return false; } - if (!sbp_carrier_phase_encode_internal(ctx, &msg->L)) { return false; } - if (!sbp_u8_encode(ctx, &msg->cn0)) { return false; } - if (!sbp_u16_encode(ctx, &msg->lock)) { return false; } - if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_s32_encode(ctx, &msg->doppler)) { return false; } - if (!sbp_u16_encode(ctx, &msg->doppler_std)) { return false; } - if (!sbp_u32_encode(ctx, &msg->uptime)) { return false; } - if (!sbp_s16_encode(ctx, &msg->clock_offset)) { return false; } - if (!sbp_s16_encode(ctx, &msg->clock_drift)) { return false; } - if (!sbp_u16_encode(ctx, &msg->corr_spacing)) { return false; } - if (!sbp_s8_encode(ctx, &msg->acceleration)) { return false; } - if (!sbp_u8_encode(ctx, &msg->sync_flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->tow_flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->track_flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->nav_flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->pset_flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->misc_flags)) { return false; } +bool sbp_msg_tracking_state_detailed_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_detailed_dep_t *msg) { + if (!sbp_u64_encode(ctx, &msg->recv_time)) { + return false; + } + if (!sbp_gps_time_dep_encode_internal(ctx, &msg->tot)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->P)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->P_std)) { + return false; + } + if (!sbp_carrier_phase_encode_internal(ctx, &msg->L)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->lock)) { + return false; + } + if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->doppler)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->doppler_std)) { + return false; + } + if (!sbp_u32_encode(ctx, &msg->uptime)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->clock_offset)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->clock_drift)) { + return false; + } + if (!sbp_u16_encode(ctx, &msg->corr_spacing)) { + return false; + } + if (!sbp_s8_encode(ctx, &msg->acceleration)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->sync_flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->tow_flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->track_flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->nav_flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->pset_flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->misc_flags)) { + return false; + } return true; } -s8 sbp_msg_tracking_state_detailed_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_state_detailed_dep_t *msg) { +s8 sbp_msg_tracking_state_detailed_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_state_detailed_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -215,33 +395,77 @@ s8 sbp_msg_tracking_state_detailed_dep_encode(uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } -bool sbp_msg_tracking_state_detailed_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_detailed_dep_t *msg) -{ - if (!sbp_u64_decode(ctx, &msg->recv_time)) { return false; } - if (!sbp_gps_time_dep_decode_internal(ctx, &msg->tot)) { return false; } - if (!sbp_u32_decode(ctx, &msg->P)) { return false; } - if (!sbp_u16_decode(ctx, &msg->P_std)) { return false; } - if (!sbp_carrier_phase_decode_internal(ctx, &msg->L)) { return false; } - if (!sbp_u8_decode(ctx, &msg->cn0)) { return false; } - if (!sbp_u16_decode(ctx, &msg->lock)) { return false; } - if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_s32_decode(ctx, &msg->doppler)) { return false; } - if (!sbp_u16_decode(ctx, &msg->doppler_std)) { return false; } - if (!sbp_u32_decode(ctx, &msg->uptime)) { return false; } - if (!sbp_s16_decode(ctx, &msg->clock_offset)) { return false; } - if (!sbp_s16_decode(ctx, &msg->clock_drift)) { return false; } - if (!sbp_u16_decode(ctx, &msg->corr_spacing)) { return false; } - if (!sbp_s8_decode(ctx, &msg->acceleration)) { return false; } - if (!sbp_u8_decode(ctx, &msg->sync_flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->tow_flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->track_flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->nav_flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->pset_flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->misc_flags)) { return false; } +bool sbp_msg_tracking_state_detailed_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_detailed_dep_t *msg) { + if (!sbp_u64_decode(ctx, &msg->recv_time)) { + return false; + } + if (!sbp_gps_time_dep_decode_internal(ctx, &msg->tot)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->P)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->P_std)) { + return false; + } + if (!sbp_carrier_phase_decode_internal(ctx, &msg->L)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->cn0)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->lock)) { + return false; + } + if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->doppler)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->doppler_std)) { + return false; + } + if (!sbp_u32_decode(ctx, &msg->uptime)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->clock_offset)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->clock_drift)) { + return false; + } + if (!sbp_u16_decode(ctx, &msg->corr_spacing)) { + return false; + } + if (!sbp_s8_decode(ctx, &msg->acceleration)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->sync_flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->tow_flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->track_flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->nav_flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->pset_flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->misc_flags)) { + return false; + } return true; } -s8 sbp_msg_tracking_state_detailed_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_state_detailed_dep_t *msg) { +s8 sbp_msg_tracking_state_detailed_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_state_detailed_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -255,93 +479,149 @@ s8 sbp_msg_tracking_state_detailed_dep_decode(const uint8_t *buf, uint8_t len, u return SBP_OK; } - -s8 sbp_msg_tracking_state_detailed_dep_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_state_detailed_dep_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_tracking_state_detailed_dep_send( + sbp_state_t *s, u16 sender_id, + const sbp_msg_tracking_state_detailed_dep_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_tracking_state_detailed_dep_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_TRACKING_STATE_DETAILED_DEP, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_tracking_state_detailed_dep_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_TRACKING_STATE_DETAILED_DEP, sender_id, + payload_len, payload, write); } -int sbp_msg_tracking_state_detailed_dep_cmp(const sbp_msg_tracking_state_detailed_dep_t *a, const sbp_msg_tracking_state_detailed_dep_t *b) { +int sbp_msg_tracking_state_detailed_dep_cmp( + const sbp_msg_tracking_state_detailed_dep_t *a, + const sbp_msg_tracking_state_detailed_dep_t *b) { int ret = 0; - + ret = sbp_u64_cmp(&a->recv_time, &b->recv_time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gps_time_dep_cmp(&a->tot, &b->tot); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->P, &b->P); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->P_std, &b->P_std); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_carrier_phase_cmp(&a->L, &b->L); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->cn0, &b->cn0); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->lock, &b->lock); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->doppler, &b->doppler); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->doppler_std, &b->doppler_std); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u32_cmp(&a->uptime, &b->uptime); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->clock_offset, &b->clock_offset); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->clock_drift, &b->clock_drift); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u16_cmp(&a->corr_spacing, &b->corr_spacing); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s8_cmp(&a->acceleration, &b->acceleration); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->sync_flags, &b->sync_flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->tow_flags, &b->tow_flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->track_flags, &b->track_flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->nav_flags, &b->nav_flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->pset_flags, &b->pset_flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->misc_flags, &b->misc_flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_tracking_channel_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_tracking_channel_state_t *msg) -{ - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->fcn)) { return false; } - if (!sbp_u8_encode(ctx, &msg->cn0)) { return false; } +bool sbp_tracking_channel_state_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_tracking_channel_state_t *msg) { + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->fcn)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->cn0)) { + return false; + } return true; } -s8 sbp_tracking_channel_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_tracking_channel_state_t *msg) { +s8 sbp_tracking_channel_state_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_tracking_channel_state_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -355,15 +635,23 @@ s8 sbp_tracking_channel_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_writt return SBP_OK; } -bool sbp_tracking_channel_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_tracking_channel_state_t *msg) -{ - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->fcn)) { return false; } - if (!sbp_u8_decode(ctx, &msg->cn0)) { return false; } +bool sbp_tracking_channel_state_decode_internal( + sbp_decode_ctx_t *ctx, sbp_tracking_channel_state_t *msg) { + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->fcn)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->cn0)) { + return false; + } return true; } -s8 sbp_tracking_channel_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_tracking_channel_state_t *msg) { +s8 sbp_tracking_channel_state_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_tracking_channel_state_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -377,32 +665,39 @@ s8 sbp_tracking_channel_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } - - -int sbp_tracking_channel_state_cmp(const sbp_tracking_channel_state_t *a, const sbp_tracking_channel_state_t *b) { +int sbp_tracking_channel_state_cmp(const sbp_tracking_channel_state_t *a, + const sbp_tracking_channel_state_t *b) { int ret = 0; - + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->fcn, &b->fcn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->cn0, &b->cn0); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_tracking_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_t *msg) -{ - for (size_t i = 0; i < msg->n_states; i++) - { - if (!sbp_tracking_channel_state_encode_internal(ctx, &msg->states[i])) { return false; } +bool sbp_msg_tracking_state_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_t *msg) { + for (size_t i = 0; i < msg->n_states; i++) { + if (!sbp_tracking_channel_state_encode_internal(ctx, &msg->states[i])) { + return false; + } } return true; } -s8 sbp_msg_tracking_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_state_t *msg) { +s8 sbp_msg_tracking_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_state_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -416,19 +711,25 @@ s8 sbp_msg_tracking_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, return SBP_OK; } -bool sbp_msg_tracking_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_t *msg) -{ - if ( ((ctx->buf_len - ctx->offset) % SBP_TRACKING_CHANNEL_STATE_ENCODED_LEN) != 0) { +bool sbp_msg_tracking_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_tracking_state_t *msg) { + if (((ctx->buf_len - ctx->offset) % SBP_TRACKING_CHANNEL_STATE_ENCODED_LEN) != + 0) { + return false; + } + msg->n_states = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_TRACKING_CHANNEL_STATE_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_states; i++) { + if (!sbp_tracking_channel_state_decode_internal(ctx, &msg->states[i])) { return false; } - msg->n_states = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_TRACKING_CHANNEL_STATE_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_states; i++) { - if (!sbp_tracking_channel_state_decode_internal(ctx, &msg->states[i])) { return false; } - } + } return true; } -s8 sbp_msg_tracking_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_state_t *msg) { +s8 sbp_msg_tracking_state_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_tracking_state_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -442,36 +743,47 @@ s8 sbp_msg_tracking_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_rea return SBP_OK; } - -s8 sbp_msg_tracking_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_state_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_tracking_state_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_tracking_state_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_tracking_state_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_TRACKING_STATE, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_tracking_state_encode(payload, sizeof(payload), &payload_len, + msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_TRACKING_STATE, sender_id, payload_len, + payload, write); } -int sbp_msg_tracking_state_cmp(const sbp_msg_tracking_state_t *a, const sbp_msg_tracking_state_t *b) { +int sbp_msg_tracking_state_cmp(const sbp_msg_tracking_state_t *a, + const sbp_msg_tracking_state_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->n_states, &b->n_states); - for (uint8_t i = 0; ret == 0 && i < a->n_states; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_states; i++) { ret = sbp_tracking_channel_state_cmp(&a->states[i], &b->states[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_measurement_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_measurement_state_t *msg) -{ - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->mesid)) { return false; } - if (!sbp_u8_encode(ctx, &msg->cn0)) { return false; } +bool sbp_measurement_state_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_measurement_state_t *msg) { + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->mesid)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->cn0)) { + return false; + } return true; } -s8 sbp_measurement_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_measurement_state_t *msg) { +s8 sbp_measurement_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_measurement_state_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -485,14 +797,19 @@ s8 sbp_measurement_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, c return SBP_OK; } -bool sbp_measurement_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_measurement_state_t *msg) -{ - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->mesid)) { return false; } - if (!sbp_u8_decode(ctx, &msg->cn0)) { return false; } +bool sbp_measurement_state_decode_internal(sbp_decode_ctx_t *ctx, + sbp_measurement_state_t *msg) { + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->mesid)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->cn0)) { + return false; + } return true; } -s8 sbp_measurement_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_measurement_state_t *msg) { +s8 sbp_measurement_state_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, sbp_measurement_state_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -506,29 +823,35 @@ s8 sbp_measurement_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read return SBP_OK; } - - -int sbp_measurement_state_cmp(const sbp_measurement_state_t *a, const sbp_measurement_state_t *b) { +int sbp_measurement_state_cmp(const sbp_measurement_state_t *a, + const sbp_measurement_state_t *b) { int ret = 0; - + ret = sbp_v4_gnss_signal_cmp(&a->mesid, &b->mesid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->cn0, &b->cn0); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_measurement_state_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_measurement_state_t *msg) -{ - for (size_t i = 0; i < msg->n_states; i++) - { - if (!sbp_measurement_state_encode_internal(ctx, &msg->states[i])) { return false; } +bool sbp_msg_measurement_state_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_measurement_state_t *msg) { + for (size_t i = 0; i < msg->n_states; i++) { + if (!sbp_measurement_state_encode_internal(ctx, &msg->states[i])) { + return false; + } } return true; } -s8 sbp_msg_measurement_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_measurement_state_t *msg) { +s8 sbp_msg_measurement_state_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_measurement_state_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -542,19 +865,24 @@ s8 sbp_msg_measurement_state_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_measurement_state_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_measurement_state_t *msg) -{ - if ( ((ctx->buf_len - ctx->offset) % SBP_MEASUREMENT_STATE_ENCODED_LEN) != 0) { +bool sbp_msg_measurement_state_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_measurement_state_t *msg) { + if (((ctx->buf_len - ctx->offset) % SBP_MEASUREMENT_STATE_ENCODED_LEN) != 0) { + return false; + } + msg->n_states = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_MEASUREMENT_STATE_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_states; i++) { + if (!sbp_measurement_state_decode_internal(ctx, &msg->states[i])) { return false; } - msg->n_states = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_MEASUREMENT_STATE_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_states; i++) { - if (!sbp_measurement_state_decode_internal(ctx, &msg->states[i])) { return false; } - } + } return true; } -s8 sbp_msg_measurement_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_measurement_state_t *msg) { +s8 sbp_msg_measurement_state_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_measurement_state_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -568,36 +896,48 @@ s8 sbp_msg_measurement_state_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_measurement_state_send(sbp_state_t *s, u16 sender_id, const sbp_msg_measurement_state_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_measurement_state_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_measurement_state_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_measurement_state_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_MEASUREMENT_STATE, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_measurement_state_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_MEASUREMENT_STATE, sender_id, payload_len, + payload, write); } -int sbp_msg_measurement_state_cmp(const sbp_msg_measurement_state_t *a, const sbp_msg_measurement_state_t *b) { +int sbp_msg_measurement_state_cmp(const sbp_msg_measurement_state_t *a, + const sbp_msg_measurement_state_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->n_states, &b->n_states); - for (uint8_t i = 0; ret == 0 && i < a->n_states; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_states; i++) { ret = sbp_measurement_state_cmp(&a->states[i], &b->states[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_tracking_channel_correlation_encode_internal(sbp_encode_ctx_t *ctx, const sbp_tracking_channel_correlation_t *msg) -{ - if (!sbp_s16_encode(ctx, &msg->I)) { return false; } - if (!sbp_s16_encode(ctx, &msg->Q)) { return false; } +bool sbp_tracking_channel_correlation_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_tracking_channel_correlation_t *msg) { + if (!sbp_s16_encode(ctx, &msg->I)) { + return false; + } + if (!sbp_s16_encode(ctx, &msg->Q)) { + return false; + } return true; } -s8 sbp_tracking_channel_correlation_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_tracking_channel_correlation_t *msg) { +s8 sbp_tracking_channel_correlation_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_tracking_channel_correlation_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -611,14 +951,20 @@ s8 sbp_tracking_channel_correlation_encode(uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } -bool sbp_tracking_channel_correlation_decode_internal(sbp_decode_ctx_t *ctx, sbp_tracking_channel_correlation_t *msg) -{ - if (!sbp_s16_decode(ctx, &msg->I)) { return false; } - if (!sbp_s16_decode(ctx, &msg->Q)) { return false; } +bool sbp_tracking_channel_correlation_decode_internal( + sbp_decode_ctx_t *ctx, sbp_tracking_channel_correlation_t *msg) { + if (!sbp_s16_decode(ctx, &msg->I)) { + return false; + } + if (!sbp_s16_decode(ctx, &msg->Q)) { + return false; + } return true; } -s8 sbp_tracking_channel_correlation_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_tracking_channel_correlation_t *msg) { +s8 sbp_tracking_channel_correlation_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_tracking_channel_correlation_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -632,31 +978,42 @@ s8 sbp_tracking_channel_correlation_decode(const uint8_t *buf, uint8_t len, uint return SBP_OK; } - - -int sbp_tracking_channel_correlation_cmp(const sbp_tracking_channel_correlation_t *a, const sbp_tracking_channel_correlation_t *b) { +int sbp_tracking_channel_correlation_cmp( + const sbp_tracking_channel_correlation_t *a, + const sbp_tracking_channel_correlation_t *b) { int ret = 0; - + ret = sbp_s16_cmp(&a->I, &b->I); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s16_cmp(&a->Q, &b->Q); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_tracking_iq_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_iq_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->channel)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - for (size_t i = 0; i < SBP_MSG_TRACKING_IQ_CORRS_MAX; i++) - { - if (!sbp_tracking_channel_correlation_encode_internal(ctx, &msg->corrs[i])) { return false; } +bool sbp_msg_tracking_iq_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_tracking_iq_t *msg) { + if (!sbp_u8_encode(ctx, &msg->channel)) { + return false; + } + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_TRACKING_IQ_CORRS_MAX; i++) { + if (!sbp_tracking_channel_correlation_encode_internal(ctx, + &msg->corrs[i])) { + return false; + } } return true; } -s8 sbp_msg_tracking_iq_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_iq_t *msg) { +s8 sbp_msg_tracking_iq_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_iq_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -670,17 +1027,25 @@ s8 sbp_msg_tracking_iq_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, con return SBP_OK; } -bool sbp_msg_tracking_iq_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_iq_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->channel)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } +bool sbp_msg_tracking_iq_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_tracking_iq_t *msg) { + if (!sbp_u8_decode(ctx, &msg->channel)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_TRACKING_IQ_CORRS_MAX; i++) { - if (!sbp_tracking_channel_correlation_decode_internal(ctx, &msg->corrs[i])) { return false; } + if (!sbp_tracking_channel_correlation_decode_internal(ctx, + &msg->corrs[i])) { + return false; + } } return true; } -s8 sbp_msg_tracking_iq_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_iq_t *msg) { +s8 sbp_msg_tracking_iq_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_tracking_iq_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -694,41 +1059,57 @@ s8 sbp_msg_tracking_iq_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, return SBP_OK; } - -s8 sbp_msg_tracking_iq_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_iq_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_tracking_iq_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_tracking_iq_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_tracking_iq_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_TRACKING_IQ, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_tracking_iq_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_TRACKING_IQ, sender_id, payload_len, + payload, write); } -int sbp_msg_tracking_iq_cmp(const sbp_msg_tracking_iq_t *a, const sbp_msg_tracking_iq_t *b) { +int sbp_msg_tracking_iq_cmp(const sbp_msg_tracking_iq_t *a, + const sbp_msg_tracking_iq_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->channel, &b->channel); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_TRACKING_IQ_CORRS_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_TRACKING_IQ_CORRS_MAX; i++) { ret = sbp_tracking_channel_correlation_cmp(&a->corrs[i], &b->corrs[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_tracking_channel_correlation_dep_encode_internal(sbp_encode_ctx_t *ctx, const sbp_tracking_channel_correlation_dep_t *msg) -{ - if (!sbp_s32_encode(ctx, &msg->I)) { return false; } - if (!sbp_s32_encode(ctx, &msg->Q)) { return false; } +bool sbp_tracking_channel_correlation_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_tracking_channel_correlation_dep_t *msg) { + if (!sbp_s32_encode(ctx, &msg->I)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->Q)) { + return false; + } return true; } -s8 sbp_tracking_channel_correlation_dep_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_tracking_channel_correlation_dep_t *msg) { +s8 sbp_tracking_channel_correlation_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_tracking_channel_correlation_dep_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -742,14 +1123,20 @@ s8 sbp_tracking_channel_correlation_dep_encode(uint8_t *buf, uint8_t len, uint8_ return SBP_OK; } -bool sbp_tracking_channel_correlation_dep_decode_internal(sbp_decode_ctx_t *ctx, sbp_tracking_channel_correlation_dep_t *msg) -{ - if (!sbp_s32_decode(ctx, &msg->I)) { return false; } - if (!sbp_s32_decode(ctx, &msg->Q)) { return false; } +bool sbp_tracking_channel_correlation_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_tracking_channel_correlation_dep_t *msg) { + if (!sbp_s32_decode(ctx, &msg->I)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->Q)) { + return false; + } return true; } -s8 sbp_tracking_channel_correlation_dep_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_tracking_channel_correlation_dep_t *msg) { +s8 sbp_tracking_channel_correlation_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_tracking_channel_correlation_dep_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -763,31 +1150,43 @@ s8 sbp_tracking_channel_correlation_dep_decode(const uint8_t *buf, uint8_t len, return SBP_OK; } - - -int sbp_tracking_channel_correlation_dep_cmp(const sbp_tracking_channel_correlation_dep_t *a, const sbp_tracking_channel_correlation_dep_t *b) { +int sbp_tracking_channel_correlation_dep_cmp( + const sbp_tracking_channel_correlation_dep_t *a, + const sbp_tracking_channel_correlation_dep_t *b) { int ret = 0; - + ret = sbp_s32_cmp(&a->I, &b->I); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->Q, &b->Q); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_tracking_iq_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_iq_dep_b_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->channel)) { return false; } - if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { return false; } - for (size_t i = 0; i < SBP_MSG_TRACKING_IQ_DEP_B_CORRS_MAX; i++) - { - if (!sbp_tracking_channel_correlation_dep_encode_internal(ctx, &msg->corrs[i])) { return false; } +bool sbp_msg_tracking_iq_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_tracking_iq_dep_b_t *msg) { + if (!sbp_u8_encode(ctx, &msg->channel)) { + return false; + } + if (!sbp_v4_gnss_signal_encode_internal(ctx, &msg->sid)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_TRACKING_IQ_DEP_B_CORRS_MAX; i++) { + if (!sbp_tracking_channel_correlation_dep_encode_internal(ctx, + &msg->corrs[i])) { + return false; + } } return true; } -s8 sbp_msg_tracking_iq_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_iq_dep_b_t *msg) { +s8 sbp_msg_tracking_iq_dep_b_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_tracking_iq_dep_b_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -801,17 +1200,26 @@ s8 sbp_msg_tracking_iq_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_tracking_iq_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_iq_dep_b_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->channel)) { return false; } - if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { return false; } +bool sbp_msg_tracking_iq_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_tracking_iq_dep_b_t *msg) { + if (!sbp_u8_decode(ctx, &msg->channel)) { + return false; + } + if (!sbp_v4_gnss_signal_decode_internal(ctx, &msg->sid)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_TRACKING_IQ_DEP_B_CORRS_MAX; i++) { - if (!sbp_tracking_channel_correlation_dep_decode_internal(ctx, &msg->corrs[i])) { return false; } + if (!sbp_tracking_channel_correlation_dep_decode_internal(ctx, + &msg->corrs[i])) { + return false; + } } return true; } -s8 sbp_msg_tracking_iq_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_iq_dep_b_t *msg) { +s8 sbp_msg_tracking_iq_dep_b_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_tracking_iq_dep_b_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -825,45 +1233,64 @@ s8 sbp_msg_tracking_iq_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_tracking_iq_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_iq_dep_b_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_tracking_iq_dep_b_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_tracking_iq_dep_b_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_tracking_iq_dep_b_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_TRACKING_IQ_DEP_B, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_tracking_iq_dep_b_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_TRACKING_IQ_DEP_B, sender_id, payload_len, + payload, write); } -int sbp_msg_tracking_iq_dep_b_cmp(const sbp_msg_tracking_iq_dep_b_t *a, const sbp_msg_tracking_iq_dep_b_t *b) { +int sbp_msg_tracking_iq_dep_b_cmp(const sbp_msg_tracking_iq_dep_b_t *a, + const sbp_msg_tracking_iq_dep_b_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->channel, &b->channel); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_v4_gnss_signal_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_TRACKING_IQ_DEP_B_CORRS_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_TRACKING_IQ_DEP_B_CORRS_MAX; + i++) { ret = sbp_tracking_channel_correlation_dep_cmp(&a->corrs[i], &b->corrs[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_tracking_iq_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_iq_dep_a_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->channel)) { return false; } - if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { return false; } - for (size_t i = 0; i < SBP_MSG_TRACKING_IQ_DEP_A_CORRS_MAX; i++) - { - if (!sbp_tracking_channel_correlation_dep_encode_internal(ctx, &msg->corrs[i])) { return false; } +bool sbp_msg_tracking_iq_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_tracking_iq_dep_a_t *msg) { + if (!sbp_u8_encode(ctx, &msg->channel)) { + return false; + } + if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_TRACKING_IQ_DEP_A_CORRS_MAX; i++) { + if (!sbp_tracking_channel_correlation_dep_encode_internal(ctx, + &msg->corrs[i])) { + return false; + } } return true; } -s8 sbp_msg_tracking_iq_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_iq_dep_a_t *msg) { +s8 sbp_msg_tracking_iq_dep_a_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_msg_tracking_iq_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -877,17 +1304,26 @@ s8 sbp_msg_tracking_iq_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_writte return SBP_OK; } -bool sbp_msg_tracking_iq_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_iq_dep_a_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->channel)) { return false; } - if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { return false; } +bool sbp_msg_tracking_iq_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_tracking_iq_dep_a_t *msg) { + if (!sbp_u8_decode(ctx, &msg->channel)) { + return false; + } + if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { + return false; + } for (uint8_t i = 0; i < SBP_MSG_TRACKING_IQ_DEP_A_CORRS_MAX; i++) { - if (!sbp_tracking_channel_correlation_dep_decode_internal(ctx, &msg->corrs[i])) { return false; } + if (!sbp_tracking_channel_correlation_dep_decode_internal(ctx, + &msg->corrs[i])) { + return false; + } } return true; } -s8 sbp_msg_tracking_iq_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_iq_dep_a_t *msg) { +s8 sbp_msg_tracking_iq_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_tracking_iq_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -901,42 +1337,61 @@ s8 sbp_msg_tracking_iq_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_ return SBP_OK; } - -s8 sbp_msg_tracking_iq_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_iq_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_tracking_iq_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_tracking_iq_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_tracking_iq_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_TRACKING_IQ_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_tracking_iq_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_TRACKING_IQ_DEP_A, sender_id, payload_len, + payload, write); } -int sbp_msg_tracking_iq_dep_a_cmp(const sbp_msg_tracking_iq_dep_a_t *a, const sbp_msg_tracking_iq_dep_a_t *b) { +int sbp_msg_tracking_iq_dep_a_cmp(const sbp_msg_tracking_iq_dep_a_t *a, + const sbp_msg_tracking_iq_dep_a_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->channel, &b->channel); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_TRACKING_IQ_DEP_A_CORRS_MAX; i++) - { + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_MSG_TRACKING_IQ_DEP_A_CORRS_MAX; + i++) { ret = sbp_tracking_channel_correlation_dep_cmp(&a->corrs[i], &b->corrs[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_tracking_channel_state_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_tracking_channel_state_dep_a_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->state)) { return false; } - if (!sbp_u8_encode(ctx, &msg->prn)) { return false; } - if (!sbp_float_encode(ctx, &msg->cn0)) { return false; } +bool sbp_tracking_channel_state_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_tracking_channel_state_dep_a_t *msg) { + if (!sbp_u8_encode(ctx, &msg->state)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->prn)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cn0)) { + return false; + } return true; } -s8 sbp_tracking_channel_state_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_tracking_channel_state_dep_a_t *msg) { +s8 sbp_tracking_channel_state_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_tracking_channel_state_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -950,15 +1405,23 @@ s8 sbp_tracking_channel_state_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } -bool sbp_tracking_channel_state_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_tracking_channel_state_dep_a_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->state)) { return false; } - if (!sbp_u8_decode(ctx, &msg->prn)) { return false; } - if (!sbp_float_decode(ctx, &msg->cn0)) { return false; } +bool sbp_tracking_channel_state_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_tracking_channel_state_dep_a_t *msg) { + if (!sbp_u8_decode(ctx, &msg->state)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->prn)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cn0)) { + return false; + } return true; } -s8 sbp_tracking_channel_state_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_tracking_channel_state_dep_a_t *msg) { +s8 sbp_tracking_channel_state_dep_a_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_tracking_channel_state_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -972,32 +1435,42 @@ s8 sbp_tracking_channel_state_dep_a_decode(const uint8_t *buf, uint8_t len, uint return SBP_OK; } - - -int sbp_tracking_channel_state_dep_a_cmp(const sbp_tracking_channel_state_dep_a_t *a, const sbp_tracking_channel_state_dep_a_t *b) { +int sbp_tracking_channel_state_dep_a_cmp( + const sbp_tracking_channel_state_dep_a_t *a, + const sbp_tracking_channel_state_dep_a_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->state, &b->state); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->prn, &b->prn); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cn0, &b->cn0); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_tracking_state_dep_a_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_dep_a_t *msg) -{ - for (size_t i = 0; i < msg->n_states; i++) - { - if (!sbp_tracking_channel_state_dep_a_encode_internal(ctx, &msg->states[i])) { return false; } +bool sbp_msg_tracking_state_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_dep_a_t *msg) { + for (size_t i = 0; i < msg->n_states; i++) { + if (!sbp_tracking_channel_state_dep_a_encode_internal(ctx, + &msg->states[i])) { + return false; + } } return true; } -s8 sbp_msg_tracking_state_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_state_dep_a_t *msg) { +s8 sbp_msg_tracking_state_dep_a_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_state_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1011,19 +1484,26 @@ s8 sbp_msg_tracking_state_dep_a_encode(uint8_t *buf, uint8_t len, uint8_t *n_wri return SBP_OK; } -bool sbp_msg_tracking_state_dep_a_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_dep_a_t *msg) -{ - if ( ((ctx->buf_len - ctx->offset) % SBP_TRACKING_CHANNEL_STATE_DEP_A_ENCODED_LEN) != 0) { +bool sbp_msg_tracking_state_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_dep_a_t *msg) { + if (((ctx->buf_len - ctx->offset) % + SBP_TRACKING_CHANNEL_STATE_DEP_A_ENCODED_LEN) != 0) { + return false; + } + msg->n_states = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_TRACKING_CHANNEL_STATE_DEP_A_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_states; i++) { + if (!sbp_tracking_channel_state_dep_a_decode_internal(ctx, + &msg->states[i])) { return false; } - msg->n_states = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_TRACKING_CHANNEL_STATE_DEP_A_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_states; i++) { - if (!sbp_tracking_channel_state_dep_a_decode_internal(ctx, &msg->states[i])) { return false; } - } + } return true; } -s8 sbp_msg_tracking_state_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_state_dep_a_t *msg) { +s8 sbp_msg_tracking_state_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_tracking_state_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1037,37 +1517,51 @@ s8 sbp_msg_tracking_state_dep_a_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_tracking_state_dep_a_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_state_dep_a_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_tracking_state_dep_a_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_tracking_state_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_tracking_state_dep_a_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_TRACKING_STATE_DEP_A, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_tracking_state_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_TRACKING_STATE_DEP_A, sender_id, + payload_len, payload, write); } -int sbp_msg_tracking_state_dep_a_cmp(const sbp_msg_tracking_state_dep_a_t *a, const sbp_msg_tracking_state_dep_a_t *b) { +int sbp_msg_tracking_state_dep_a_cmp(const sbp_msg_tracking_state_dep_a_t *a, + const sbp_msg_tracking_state_dep_a_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->n_states, &b->n_states); - for (uint8_t i = 0; ret == 0 && i < a->n_states; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_states; i++) { ret = sbp_tracking_channel_state_dep_a_cmp(&a->states[i], &b->states[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_tracking_channel_state_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_tracking_channel_state_dep_b_t *msg) -{ - if (!sbp_u8_encode(ctx, &msg->state)) { return false; } - if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_float_encode(ctx, &msg->cn0)) { return false; } +bool sbp_tracking_channel_state_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_tracking_channel_state_dep_b_t *msg) { + if (!sbp_u8_encode(ctx, &msg->state)) { + return false; + } + if (!sbp_gnss_signal_dep_encode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_float_encode(ctx, &msg->cn0)) { + return false; + } return true; } -s8 sbp_tracking_channel_state_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_tracking_channel_state_dep_b_t *msg) { +s8 sbp_tracking_channel_state_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_tracking_channel_state_dep_b_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1081,15 +1575,23 @@ s8 sbp_tracking_channel_state_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n return SBP_OK; } -bool sbp_tracking_channel_state_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_tracking_channel_state_dep_b_t *msg) -{ - if (!sbp_u8_decode(ctx, &msg->state)) { return false; } - if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { return false; } - if (!sbp_float_decode(ctx, &msg->cn0)) { return false; } +bool sbp_tracking_channel_state_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_tracking_channel_state_dep_b_t *msg) { + if (!sbp_u8_decode(ctx, &msg->state)) { + return false; + } + if (!sbp_gnss_signal_dep_decode_internal(ctx, &msg->sid)) { + return false; + } + if (!sbp_float_decode(ctx, &msg->cn0)) { + return false; + } return true; } -s8 sbp_tracking_channel_state_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_tracking_channel_state_dep_b_t *msg) { +s8 sbp_tracking_channel_state_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_tracking_channel_state_dep_b_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1103,32 +1605,42 @@ s8 sbp_tracking_channel_state_dep_b_decode(const uint8_t *buf, uint8_t len, uint return SBP_OK; } - - -int sbp_tracking_channel_state_dep_b_cmp(const sbp_tracking_channel_state_dep_b_t *a, const sbp_tracking_channel_state_dep_b_t *b) { +int sbp_tracking_channel_state_dep_b_cmp( + const sbp_tracking_channel_state_dep_b_t *a, + const sbp_tracking_channel_state_dep_b_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->state, &b->state); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_gnss_signal_dep_cmp(&a->sid, &b->sid); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_float_cmp(&a->cn0, &b->cn0); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_tracking_state_dep_b_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_dep_b_t *msg) -{ - for (size_t i = 0; i < msg->n_states; i++) - { - if (!sbp_tracking_channel_state_dep_b_encode_internal(ctx, &msg->states[i])) { return false; } +bool sbp_msg_tracking_state_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_tracking_state_dep_b_t *msg) { + for (size_t i = 0; i < msg->n_states; i++) { + if (!sbp_tracking_channel_state_dep_b_encode_internal(ctx, + &msg->states[i])) { + return false; + } } return true; } -s8 sbp_msg_tracking_state_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_tracking_state_dep_b_t *msg) { +s8 sbp_msg_tracking_state_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_tracking_state_dep_b_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1142,19 +1654,26 @@ s8 sbp_msg_tracking_state_dep_b_encode(uint8_t *buf, uint8_t len, uint8_t *n_wri return SBP_OK; } -bool sbp_msg_tracking_state_dep_b_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_dep_b_t *msg) -{ - if ( ((ctx->buf_len - ctx->offset) % SBP_TRACKING_CHANNEL_STATE_DEP_B_ENCODED_LEN) != 0) { +bool sbp_msg_tracking_state_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_tracking_state_dep_b_t *msg) { + if (((ctx->buf_len - ctx->offset) % + SBP_TRACKING_CHANNEL_STATE_DEP_B_ENCODED_LEN) != 0) { + return false; + } + msg->n_states = (uint8_t)((ctx->buf_len - ctx->offset) / + SBP_TRACKING_CHANNEL_STATE_DEP_B_ENCODED_LEN); + for (uint8_t i = 0; i < msg->n_states; i++) { + if (!sbp_tracking_channel_state_dep_b_decode_internal(ctx, + &msg->states[i])) { return false; } - msg->n_states = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_TRACKING_CHANNEL_STATE_DEP_B_ENCODED_LEN); - for (uint8_t i = 0; i < msg->n_states; i++) { - if (!sbp_tracking_channel_state_dep_b_decode_internal(ctx, &msg->states[i])) { return false; } - } + } return true; } -s8 sbp_msg_tracking_state_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_tracking_state_dep_b_t *msg) { +s8 sbp_msg_tracking_state_dep_b_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_tracking_state_dep_b_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -1168,24 +1687,30 @@ s8 sbp_msg_tracking_state_dep_b_decode(const uint8_t *buf, uint8_t len, uint8_t return SBP_OK; } - -s8 sbp_msg_tracking_state_dep_b_send(sbp_state_t *s, u16 sender_id, const sbp_msg_tracking_state_dep_b_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_tracking_state_dep_b_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_tracking_state_dep_b_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_tracking_state_dep_b_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_TRACKING_STATE_DEP_B, sender_id, payload_len, payload, write); + s8 ret = sbp_msg_tracking_state_dep_b_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_TRACKING_STATE_DEP_B, sender_id, + payload_len, payload, write); } -int sbp_msg_tracking_state_dep_b_cmp(const sbp_msg_tracking_state_dep_b_t *a, const sbp_msg_tracking_state_dep_b_t *b) { +int sbp_msg_tracking_state_dep_b_cmp(const sbp_msg_tracking_state_dep_b_t *a, + const sbp_msg_tracking_state_dep_b_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->n_states, &b->n_states); - for (uint8_t i = 0; ret == 0 && i < a->n_states; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_states; i++) { ret = sbp_tracking_channel_state_dep_b_cmp(&a->states[i], &b->states[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/user.c b/c/src/user.c index 51de9dc72..d865d1391 100644 --- a/c/src/user.c +++ b/c/src/user.c @@ -3,30 +3,32 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include -#include +#include +#include #include #include -#include #include +#include +#include +#include -bool sbp_msg_user_data_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_user_data_t *msg) -{ - for (size_t i = 0; i < msg->n_contents; i++) - { - if (!sbp_u8_encode(ctx, &msg->contents[i])) { return false; } +bool sbp_msg_user_data_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_user_data_t *msg) { + for (size_t i = 0; i < msg->n_contents; i++) { + if (!sbp_u8_encode(ctx, &msg->contents[i])) { + return false; + } } return true; } -s8 sbp_msg_user_data_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_user_data_t *msg) { +s8 sbp_msg_user_data_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_user_data_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -40,19 +42,23 @@ s8 sbp_msg_user_data_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_user_data_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_user_data_t *msg) -{ - if ( ((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { +bool sbp_msg_user_data_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_user_data_t *msg) { + if (((ctx->buf_len - ctx->offset) % SBP_ENCODED_LEN_U8) != 0) { + return false; + } + msg->n_contents = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->n_contents; i++) { + if (!sbp_u8_decode(ctx, &msg->contents[i])) { return false; } - msg->n_contents = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); - for (uint8_t i = 0; i < msg->n_contents; i++) { - if (!sbp_u8_decode(ctx, &msg->contents[i])) { return false; } - } + } return true; } -s8 sbp_msg_user_data_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_user_data_t *msg) { +s8 sbp_msg_user_data_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_user_data_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -66,24 +72,30 @@ s8 sbp_msg_user_data_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - -s8 sbp_msg_user_data_send(sbp_state_t *s, u16 sender_id, const sbp_msg_user_data_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_user_data_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_user_data_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_user_data_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_USER_DATA, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_user_data_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_USER_DATA, sender_id, payload_len, payload, + write); } -int sbp_msg_user_data_cmp(const sbp_msg_user_data_t *a, const sbp_msg_user_data_t *b) { +int sbp_msg_user_data_cmp(const sbp_msg_user_data_t *a, + const sbp_msg_user_data_t *b) { int ret = 0; - + ret = sbp_u8_cmp(&a->n_contents, &b->n_contents); - for (uint8_t i = 0; ret == 0 && i < a->n_contents; i++) - { + for (uint8_t i = 0; ret == 0 && i < a->n_contents; i++) { ret = sbp_u8_cmp(&a->contents[i], &b->contents[i]); } - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/src/vehicle.c b/c/src/vehicle.c index 2523ed4db..02ab6d742 100644 --- a/c/src/vehicle.c +++ b/c/src/vehicle.c @@ -3,29 +3,36 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#include -#include #include +#include +#include -#include -#include #include -#include -#include +#include +#include #include #include -#include #include +#include +#include +#include -bool sbp_msg_odometry_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_odometry_t *msg) -{ - if (!sbp_u32_encode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_encode(ctx, &msg->velocity)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } +bool sbp_msg_odometry_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_odometry_t *msg) { + if (!sbp_u32_encode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->velocity)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_odometry_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_odometry_t *msg) { +s8 sbp_msg_odometry_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_odometry_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -39,15 +46,22 @@ s8 sbp_msg_odometry_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_odometry_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_odometry_t *msg) -{ - if (!sbp_u32_decode(ctx, &msg->tow)) { return false; } - if (!sbp_s32_decode(ctx, &msg->velocity)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } +bool sbp_msg_odometry_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_odometry_t *msg) { + if (!sbp_u32_decode(ctx, &msg->tow)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->velocity)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } return true; } -s8 sbp_msg_odometry_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_odometry_t *msg) { +s8 sbp_msg_odometry_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_odometry_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -61,40 +75,58 @@ s8 sbp_msg_odometry_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp return SBP_OK; } - -s8 sbp_msg_odometry_send(sbp_state_t *s, u16 sender_id, const sbp_msg_odometry_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_odometry_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_odometry_t *msg, sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; s8 ret = sbp_msg_odometry_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_ODOMETRY, sender_id, payload_len, payload, write); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_ODOMETRY, sender_id, payload_len, payload, + write); } -int sbp_msg_odometry_cmp(const sbp_msg_odometry_t *a, const sbp_msg_odometry_t *b) { +int sbp_msg_odometry_cmp(const sbp_msg_odometry_t *a, + const sbp_msg_odometry_t *b) { int ret = 0; - + ret = sbp_u32_cmp(&a->tow, &b->tow); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->velocity, &b->velocity); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } -bool sbp_msg_wheeltick_encode_internal(sbp_encode_ctx_t *ctx, const sbp_msg_wheeltick_t *msg) -{ - if (!sbp_u64_encode(ctx, &msg->time)) { return false; } - if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } - if (!sbp_u8_encode(ctx, &msg->source)) { return false; } - if (!sbp_s32_encode(ctx, &msg->ticks)) { return false; } +bool sbp_msg_wheeltick_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_msg_wheeltick_t *msg) { + if (!sbp_u64_encode(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->source)) { + return false; + } + if (!sbp_s32_encode(ctx, &msg->ticks)) { + return false; + } return true; } -s8 sbp_msg_wheeltick_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const sbp_msg_wheeltick_t *msg) { +s8 sbp_msg_wheeltick_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_wheeltick_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -108,16 +140,25 @@ s8 sbp_msg_wheeltick_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, const return SBP_OK; } -bool sbp_msg_wheeltick_decode_internal(sbp_decode_ctx_t *ctx, sbp_msg_wheeltick_t *msg) -{ - if (!sbp_u64_decode(ctx, &msg->time)) { return false; } - if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } - if (!sbp_u8_decode(ctx, &msg->source)) { return false; } - if (!sbp_s32_decode(ctx, &msg->ticks)) { return false; } +bool sbp_msg_wheeltick_decode_internal(sbp_decode_ctx_t *ctx, + sbp_msg_wheeltick_t *msg) { + if (!sbp_u64_decode(ctx, &msg->time)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->source)) { + return false; + } + if (!sbp_s32_decode(ctx, &msg->ticks)) { + return false; + } return true; } -s8 sbp_msg_wheeltick_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sbp_msg_wheeltick_t *msg) { +s8 sbp_msg_wheeltick_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_wheeltick_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; @@ -131,29 +172,42 @@ s8 sbp_msg_wheeltick_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, sb return SBP_OK; } - -s8 sbp_msg_wheeltick_send(sbp_state_t *s, u16 sender_id, const sbp_msg_wheeltick_t *msg, sbp_write_fn_t write) -{ +s8 sbp_msg_wheeltick_send(sbp_state_t *s, u16 sender_id, + const sbp_msg_wheeltick_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_wheeltick_encode(payload, sizeof(payload), &payload_len, msg); - if (ret != SBP_OK) { return ret; } - return sbp_send_payload(s, SBP_MSG_WHEELTICK, sender_id, payload_len, payload, write); + s8 ret = + sbp_msg_wheeltick_encode(payload, sizeof(payload), &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_send_payload(s, SBP_MSG_WHEELTICK, sender_id, payload_len, payload, + write); } -int sbp_msg_wheeltick_cmp(const sbp_msg_wheeltick_t *a, const sbp_msg_wheeltick_t *b) { +int sbp_msg_wheeltick_cmp(const sbp_msg_wheeltick_t *a, + const sbp_msg_wheeltick_t *b) { int ret = 0; - + ret = sbp_u64_cmp(&a->time, &b->time); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->flags, &b->flags); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_u8_cmp(&a->source, &b->source); - if (ret != 0) { return ret; } - + if (ret != 0) { + return ret; + } + ret = sbp_s32_cmp(&a->ticks, &b->ticks); - if (ret != 0) { return ret; } + if (ret != 0) { + return ret; + } return ret; } diff --git a/c/test/auto_check_sbp_acquisition_MsgAcqResult.c b/c/test/auto_check_sbp_acquisition_MsgAcqResult.c index b2e1d7840..334a93e10 100644 --- a/c/test/auto_check_sbp_acquisition_MsgAcqResult.c +++ b/c/test/auto_check_sbp_acquisition_MsgAcqResult.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResult.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResult.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_acquisition_MsgAcqResult ) -{ +START_TEST(test_auto_check_sbp_acquisition_MsgAcqResult) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResult ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,65 +90,88 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResult ) logging_reset(); - sbp_callback_register(&sbp_state, 0x2f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x2f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,47,0,195,4,14,0,0,104,65,102,102,144,66,205,196,0,70,8,0,207,189, }; + u8 encoded_frame[] = { + 85, 47, 0, 195, 4, 14, 0, 0, 104, 65, 102, + 102, 144, 66, 205, 196, 0, 70, 8, 0, 207, 189, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result.cf = 8241.2001953125; - + test_msg.acq_result.cn0 = 14.5; - + test_msg.acq_result.cp = 72.19999694824219; - - + test_msg.acq_result.sid.code = 0; - + test_msg.acq_result.sid.sat = 8; - sbp_message_send(&sbp_state, SbpMsgAcqResult, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResult, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResult, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResult, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result.cf * 100 - 8241.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result.cf, expected 8241.20019531, is %s", last_msg.msg.acq_result.cf); - - ck_assert_msg((last_msg.msg.acq_result.cn0 * 100 - 14.5 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result.cn0, expected 14.5, is %s", last_msg.msg.acq_result.cn0); - - ck_assert_msg((last_msg.msg.acq_result.cp * 100 - 72.1999969482 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result.cp, expected 72.1999969482, is %s", last_msg.msg.acq_result.cp); - - - ck_assert_msg(last_msg.msg.acq_result.sid.code == 0, "incorrect value for last_msg.msg.acq_result.sid.code, expected 0, is %d", last_msg.msg.acq_result.sid.code); - - ck_assert_msg(last_msg.msg.acq_result.sid.sat == 8, "incorrect value for last_msg.msg.acq_result.sid.sat, expected 8, is %d", last_msg.msg.acq_result.sid.sat); + ck_assert_msg( + (last_msg.msg.acq_result.cf * 100 - 8241.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result.cf, expected " + "8241.20019531, is %s", + last_msg.msg.acq_result.cf); + + ck_assert_msg( + (last_msg.msg.acq_result.cn0 * 100 - 14.5 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result.cn0, expected 14.5, is %s", + last_msg.msg.acq_result.cn0); + + ck_assert_msg( + (last_msg.msg.acq_result.cp * 100 - 72.1999969482 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result.cp, expected " + "72.1999969482, is %s", + last_msg.msg.acq_result.cp); + + ck_assert_msg(last_msg.msg.acq_result.sid.code == 0, + "incorrect value for last_msg.msg.acq_result.sid.code, " + "expected 0, is %d", + last_msg.msg.acq_result.sid.code); + + ck_assert_msg(last_msg.msg.acq_result.sid.sat == 8, + "incorrect value for last_msg.msg.acq_result.sid.sat, " + "expected 8, is %d", + last_msg.msg.acq_result.sid.sat); } } END_TEST -Suite* auto_check_sbp_acquisition_MsgAcqResult_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_acquisition_MsgAcqResult"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_acquisition_MsgAcqResult"); +Suite *auto_check_sbp_acquisition_MsgAcqResult_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_acquisition_MsgAcqResult"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_acquisition_MsgAcqResult"); tcase_add_test(tc_acq, test_auto_check_sbp_acquisition_MsgAcqResult); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_acquisition_MsgAcqResultDepA.c b/c/test/auto_check_sbp_acquisition_MsgAcqResultDepA.c index 50b2119ce..de918b511 100644 --- a/c/test/auto_check_sbp_acquisition_MsgAcqResultDepA.c +++ b/c/test/auto_check_sbp_acquisition_MsgAcqResultDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepA ) -{ +START_TEST(test_auto_check_sbp_acquisition_MsgAcqResultDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,56 +90,77 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x15, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x15, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,21,0,195,4,13,0,0,104,65,0,192,53,68,198,199,0,70,8,2,68, }; + u8 encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 0, 0, 104, 65, 0, + 192, 53, 68, 198, 199, 0, 70, 8, 2, 68, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_a.cf = 8241.943359375; - + test_msg.acq_result_dep_a.cp = 727.0; - + test_msg.acq_result_dep_a.prn = 8; - + test_msg.acq_result_dep_a.snr = 14.5; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.cf * 100 - 8241.94335938 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.cf, expected 8241.94335938, is %s", last_msg.msg.acq_result_dep_a.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.cp * 100 - 727.0 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.cp, expected 727.0, is %s", last_msg.msg.acq_result_dep_a.cp); - - ck_assert_msg(last_msg.msg.acq_result_dep_a.prn == 8, "incorrect value for last_msg.msg.acq_result_dep_a.prn, expected 8, is %d", last_msg.msg.acq_result_dep_a.prn); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.snr * 100 - 14.5 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.snr, expected 14.5, is %s", last_msg.msg.acq_result_dep_a.snr); + ck_assert_msg( + (last_msg.msg.acq_result_dep_a.cf * 100 - 8241.94335938 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.cf, expected " + "8241.94335938, is %s", + last_msg.msg.acq_result_dep_a.cf); + + ck_assert_msg((last_msg.msg.acq_result_dep_a.cp * 100 - 727.0 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.cp, " + "expected 727.0, is %s", + last_msg.msg.acq_result_dep_a.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_a.prn == 8, + "incorrect value for last_msg.msg.acq_result_dep_a.prn, " + "expected 8, is %d", + last_msg.msg.acq_result_dep_a.prn); + + ck_assert_msg((last_msg.msg.acq_result_dep_a.snr * 100 - 14.5 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.snr, " + "expected 14.5, is %s", + last_msg.msg.acq_result_dep_a.snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -151,56 +168,78 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x15, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x15, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,21,0,195,4,13,205,204,116,65,0,192,179,67,33,81,59,68,9,219,27, }; + u8 encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 116, 65, 0, + 192, 179, 67, 33, 81, 59, 68, 9, 219, 27, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_a.cf = 749.2676391601562; - + test_msg.acq_result_dep_a.cp = 359.5; - + test_msg.acq_result_dep_a.prn = 9; - + test_msg.acq_result_dep_a.snr = 15.300000190734863; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.cf * 100 - 749.26763916 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.cf, expected 749.26763916, is %s", last_msg.msg.acq_result_dep_a.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.cp * 100 - 359.5 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.cp, expected 359.5, is %s", last_msg.msg.acq_result_dep_a.cp); - - ck_assert_msg(last_msg.msg.acq_result_dep_a.prn == 9, "incorrect value for last_msg.msg.acq_result_dep_a.prn, expected 9, is %d", last_msg.msg.acq_result_dep_a.prn); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.snr * 100 - 15.3000001907 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.snr, expected 15.3000001907, is %s", last_msg.msg.acq_result_dep_a.snr); + ck_assert_msg( + (last_msg.msg.acq_result_dep_a.cf * 100 - 749.26763916 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.cf, expected " + "749.26763916, is %s", + last_msg.msg.acq_result_dep_a.cf); + + ck_assert_msg((last_msg.msg.acq_result_dep_a.cp * 100 - 359.5 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.cp, " + "expected 359.5, is %s", + last_msg.msg.acq_result_dep_a.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_a.prn == 9, + "incorrect value for last_msg.msg.acq_result_dep_a.prn, " + "expected 9, is %d", + last_msg.msg.acq_result_dep_a.prn); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_a.snr * 100 - 15.3000001907 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.snr, expected " + "15.3000001907, is %s", + last_msg.msg.acq_result_dep_a.snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -208,56 +247,78 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x15, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x15, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,21,0,195,4,13,205,204,144,65,0,0,34,66,57,237,202,197,11,150,35, }; + u8 encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 144, 65, 0, + 0, 34, 66, 57, 237, 202, 197, 11, 150, 35, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_a.cf = -6493.65283203125; - + test_msg.acq_result_dep_a.cp = 40.5; - + test_msg.acq_result_dep_a.prn = 11; - + test_msg.acq_result_dep_a.snr = 18.100000381469727; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.cf * 100 - -6493.65283203 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.cf, expected -6493.65283203, is %s", last_msg.msg.acq_result_dep_a.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.cp * 100 - 40.5 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.cp, expected 40.5, is %s", last_msg.msg.acq_result_dep_a.cp); - - ck_assert_msg(last_msg.msg.acq_result_dep_a.prn == 11, "incorrect value for last_msg.msg.acq_result_dep_a.prn, expected 11, is %d", last_msg.msg.acq_result_dep_a.prn); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.snr * 100 - 18.1000003815 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.snr, expected 18.1000003815, is %s", last_msg.msg.acq_result_dep_a.snr); + ck_assert_msg( + (last_msg.msg.acq_result_dep_a.cf * 100 - -6493.65283203 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.cf, expected " + "-6493.65283203, is %s", + last_msg.msg.acq_result_dep_a.cf); + + ck_assert_msg((last_msg.msg.acq_result_dep_a.cp * 100 - 40.5 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.cp, " + "expected 40.5, is %s", + last_msg.msg.acq_result_dep_a.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_a.prn == 11, + "incorrect value for last_msg.msg.acq_result_dep_a.prn, " + "expected 11, is %d", + last_msg.msg.acq_result_dep_a.prn); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_a.snr * 100 - 18.1000003815 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.snr, expected " + "18.1000003815, is %s", + last_msg.msg.acq_result_dep_a.snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -265,56 +326,78 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x15, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x15, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,21,0,195,4,13,205,204,116,65,0,32,9,68,129,193,121,196,12,146,118, }; + u8 encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 116, 65, 0, + 32, 9, 68, 129, 193, 121, 196, 12, 146, 118, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_a.cf = -999.0234985351562; - + test_msg.acq_result_dep_a.cp = 548.5; - + test_msg.acq_result_dep_a.prn = 12; - + test_msg.acq_result_dep_a.snr = 15.300000190734863; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.cf * 100 - -999.023498535 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.cf, expected -999.023498535, is %s", last_msg.msg.acq_result_dep_a.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.cp * 100 - 548.5 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.cp, expected 548.5, is %s", last_msg.msg.acq_result_dep_a.cp); - - ck_assert_msg(last_msg.msg.acq_result_dep_a.prn == 12, "incorrect value for last_msg.msg.acq_result_dep_a.prn, expected 12, is %d", last_msg.msg.acq_result_dep_a.prn); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.snr * 100 - 15.3000001907 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.snr, expected 15.3000001907, is %s", last_msg.msg.acq_result_dep_a.snr); + ck_assert_msg( + (last_msg.msg.acq_result_dep_a.cf * 100 - -999.023498535 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.cf, expected " + "-999.023498535, is %s", + last_msg.msg.acq_result_dep_a.cf); + + ck_assert_msg((last_msg.msg.acq_result_dep_a.cp * 100 - 548.5 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.cp, " + "expected 548.5, is %s", + last_msg.msg.acq_result_dep_a.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_a.prn == 12, + "incorrect value for last_msg.msg.acq_result_dep_a.prn, " + "expected 12, is %d", + last_msg.msg.acq_result_dep_a.prn); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_a.snr * 100 - 15.3000001907 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.snr, expected " + "15.3000001907, is %s", + last_msg.msg.acq_result_dep_a.snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -322,56 +405,78 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x15, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x15, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,21,0,195,4,13,205,204,116,65,0,32,67,68,228,74,148,69,14,23,75, }; + u8 encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 116, 65, 0, + 32, 67, 68, 228, 74, 148, 69, 14, 23, 75, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_a.cf = 4745.361328125; - + test_msg.acq_result_dep_a.cp = 780.5; - + test_msg.acq_result_dep_a.prn = 14; - + test_msg.acq_result_dep_a.snr = 15.300000190734863; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.cf * 100 - 4745.36132812 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.cf, expected 4745.36132812, is %s", last_msg.msg.acq_result_dep_a.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.cp * 100 - 780.5 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.cp, expected 780.5, is %s", last_msg.msg.acq_result_dep_a.cp); - - ck_assert_msg(last_msg.msg.acq_result_dep_a.prn == 14, "incorrect value for last_msg.msg.acq_result_dep_a.prn, expected 14, is %d", last_msg.msg.acq_result_dep_a.prn); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.snr * 100 - 15.3000001907 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.snr, expected 15.3000001907, is %s", last_msg.msg.acq_result_dep_a.snr); + ck_assert_msg( + (last_msg.msg.acq_result_dep_a.cf * 100 - 4745.36132812 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.cf, expected " + "4745.36132812, is %s", + last_msg.msg.acq_result_dep_a.cf); + + ck_assert_msg((last_msg.msg.acq_result_dep_a.cp * 100 - 780.5 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.cp, " + "expected 780.5, is %s", + last_msg.msg.acq_result_dep_a.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_a.prn == 14, + "incorrect value for last_msg.msg.acq_result_dep_a.prn, " + "expected 14, is %d", + last_msg.msg.acq_result_dep_a.prn); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_a.snr * 100 - 15.3000001907 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.snr, expected " + "15.3000001907, is %s", + last_msg.msg.acq_result_dep_a.snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -379,59 +484,81 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x15, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x15, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,21,0,195,4,13,228,56,35,67,0,32,18,68,129,193,249,195,0,204,207, }; + u8 encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 228, 56, 35, 67, 0, + 32, 18, 68, 129, 193, 249, 195, 0, 204, 207, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_a.cf = -499.5117492675781; - + test_msg.acq_result_dep_a.cp = 584.5; - + test_msg.acq_result_dep_a.prn = 0; - + test_msg.acq_result_dep_a.snr = 163.22222900390625; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.cf * 100 - -499.511749268 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.cf, expected -499.511749268, is %s", last_msg.msg.acq_result_dep_a.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.cp * 100 - 584.5 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.cp, expected 584.5, is %s", last_msg.msg.acq_result_dep_a.cp); - - ck_assert_msg(last_msg.msg.acq_result_dep_a.prn == 0, "incorrect value for last_msg.msg.acq_result_dep_a.prn, expected 0, is %d", last_msg.msg.acq_result_dep_a.prn); - - ck_assert_msg((last_msg.msg.acq_result_dep_a.snr * 100 - 163.222229004 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_a.snr, expected 163.222229004, is %s", last_msg.msg.acq_result_dep_a.snr); + ck_assert_msg( + (last_msg.msg.acq_result_dep_a.cf * 100 - -499.511749268 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.cf, expected " + "-499.511749268, is %s", + last_msg.msg.acq_result_dep_a.cf); + + ck_assert_msg((last_msg.msg.acq_result_dep_a.cp * 100 - 584.5 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.cp, " + "expected 584.5, is %s", + last_msg.msg.acq_result_dep_a.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_a.prn == 0, + "incorrect value for last_msg.msg.acq_result_dep_a.prn, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_a.prn); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_a.snr * 100 - 163.222229004 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_a.snr, expected " + "163.222229004, is %s", + last_msg.msg.acq_result_dep_a.snr); } } END_TEST -Suite* auto_check_sbp_acquisition_MsgAcqResultDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_acquisition_MsgAcqResultDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_acquisition_MsgAcqResultDepA"); +Suite *auto_check_sbp_acquisition_MsgAcqResultDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_acquisition_MsgAcqResultDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_acquisition_MsgAcqResultDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_acquisition_MsgAcqResultDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_acquisition_MsgAcqResultDepB.c b/c/test/auto_check_sbp_acquisition_MsgAcqResultDepB.c index b86c08aa3..ee6ab1f83 100644 --- a/c/test/auto_check_sbp_acquisition_MsgAcqResultDepB.c +++ b/c/test/auto_check_sbp_acquisition_MsgAcqResultDepB.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepB.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepB ) -{ +START_TEST(test_auto_check_sbp_acquisition_MsgAcqResultDepB) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,66 +90,93 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x14, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x14, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,20,0,246,215,16,137,167,18,66,0,0,161,67,240,24,156,69,9,0,0,0,80,195, }; + u8 encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 137, 167, 18, 66, 0, 0, + 161, 67, 240, 24, 156, 69, 9, 0, 0, 0, 80, 195, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_b.cf = 4995.1171875; - + test_msg.acq_result_dep_b.cp = 322.0; - - + test_msg.acq_result_dep_b.sid.code = 0; - + test_msg.acq_result_dep_b.sid.reserved = 0; - + test_msg.acq_result_dep_b.sid.sat = 9; - + test_msg.acq_result_dep_b.snr = 36.66360855102539; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepB, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepB, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_b.cf * 100 - 4995.1171875 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_b.cf, expected 4995.1171875, is %s", last_msg.msg.acq_result_dep_b.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_b.cp * 100 - 322.0 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_b.cp, expected 322.0, is %s", last_msg.msg.acq_result_dep_b.cp); - - - ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.code == 0, "incorrect value for last_msg.msg.acq_result_dep_b.sid.code, expected 0, is %d", last_msg.msg.acq_result_dep_b.sid.code); - - ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.reserved == 0, "incorrect value for last_msg.msg.acq_result_dep_b.sid.reserved, expected 0, is %d", last_msg.msg.acq_result_dep_b.sid.reserved); - - ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.sat == 9, "incorrect value for last_msg.msg.acq_result_dep_b.sid.sat, expected 9, is %d", last_msg.msg.acq_result_dep_b.sid.sat); - - ck_assert_msg((last_msg.msg.acq_result_dep_b.snr * 100 - 36.663608551 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_b.snr, expected 36.663608551, is %s", last_msg.msg.acq_result_dep_b.snr); + ck_assert_msg( + (last_msg.msg.acq_result_dep_b.cf * 100 - 4995.1171875 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_b.cf, expected " + "4995.1171875, is %s", + last_msg.msg.acq_result_dep_b.cf); + + ck_assert_msg((last_msg.msg.acq_result_dep_b.cp * 100 - 322.0 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_b.cp, " + "expected 322.0, is %s", + last_msg.msg.acq_result_dep_b.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.code == 0, + "incorrect value for last_msg.msg.acq_result_dep_b.sid.code, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_b.sid.code); + + ck_assert_msg( + last_msg.msg.acq_result_dep_b.sid.reserved == 0, + "incorrect value for last_msg.msg.acq_result_dep_b.sid.reserved, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_b.sid.reserved); + + ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.sat == 9, + "incorrect value for last_msg.msg.acq_result_dep_b.sid.sat, " + "expected 9, is %d", + last_msg.msg.acq_result_dep_b.sid.sat); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_b.snr * 100 - 36.663608551 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_b.snr, expected " + "36.663608551, is %s", + last_msg.msg.acq_result_dep_b.snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -161,66 +184,93 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x14, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x14, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,20,0,246,215,16,206,172,16,66,0,192,82,68,198,199,0,198,3,0,0,0,149,143, }; + u8 encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 206, 172, 16, 66, 0, 192, + 82, 68, 198, 199, 0, 198, 3, 0, 0, 0, 149, 143, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_b.cf = -8241.943359375; - + test_msg.acq_result_dep_b.cp = 843.0; - - + test_msg.acq_result_dep_b.sid.code = 0; - + test_msg.acq_result_dep_b.sid.reserved = 0; - + test_msg.acq_result_dep_b.sid.sat = 3; - + test_msg.acq_result_dep_b.snr = 36.16875457763672; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepB, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepB, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_b.cf * 100 - -8241.94335938 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_b.cf, expected -8241.94335938, is %s", last_msg.msg.acq_result_dep_b.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_b.cp * 100 - 843.0 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_b.cp, expected 843.0, is %s", last_msg.msg.acq_result_dep_b.cp); - - - ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.code == 0, "incorrect value for last_msg.msg.acq_result_dep_b.sid.code, expected 0, is %d", last_msg.msg.acq_result_dep_b.sid.code); - - ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.reserved == 0, "incorrect value for last_msg.msg.acq_result_dep_b.sid.reserved, expected 0, is %d", last_msg.msg.acq_result_dep_b.sid.reserved); - - ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.sat == 3, "incorrect value for last_msg.msg.acq_result_dep_b.sid.sat, expected 3, is %d", last_msg.msg.acq_result_dep_b.sid.sat); - - ck_assert_msg((last_msg.msg.acq_result_dep_b.snr * 100 - 36.1687545776 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_b.snr, expected 36.1687545776, is %s", last_msg.msg.acq_result_dep_b.snr); + ck_assert_msg( + (last_msg.msg.acq_result_dep_b.cf * 100 - -8241.94335938 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_b.cf, expected " + "-8241.94335938, is %s", + last_msg.msg.acq_result_dep_b.cf); + + ck_assert_msg((last_msg.msg.acq_result_dep_b.cp * 100 - 843.0 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_b.cp, " + "expected 843.0, is %s", + last_msg.msg.acq_result_dep_b.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.code == 0, + "incorrect value for last_msg.msg.acq_result_dep_b.sid.code, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_b.sid.code); + + ck_assert_msg( + last_msg.msg.acq_result_dep_b.sid.reserved == 0, + "incorrect value for last_msg.msg.acq_result_dep_b.sid.reserved, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_b.sid.reserved); + + ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.sat == 3, + "incorrect value for last_msg.msg.acq_result_dep_b.sid.sat, " + "expected 3, is %d", + last_msg.msg.acq_result_dep_b.sid.sat); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_b.snr * 100 - 36.1687545776 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_b.snr, expected " + "36.1687545776, is %s", + last_msg.msg.acq_result_dep_b.snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -228,66 +278,93 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x14, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x14, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,20,0,246,215,16,228,27,15,66,0,128,70,68,228,74,148,69,18,0,0,0,179,155, }; + u8 encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 228, 27, 15, 66, 0, 128, + 70, 68, 228, 74, 148, 69, 18, 0, 0, 0, 179, 155, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_b.cf = 4745.361328125; - + test_msg.acq_result_dep_b.cp = 794.0; - - + test_msg.acq_result_dep_b.sid.code = 0; - + test_msg.acq_result_dep_b.sid.reserved = 0; - + test_msg.acq_result_dep_b.sid.sat = 18; - + test_msg.acq_result_dep_b.snr = 35.77723693847656; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepB, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepB, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_b.cf * 100 - 4745.36132812 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_b.cf, expected 4745.36132812, is %s", last_msg.msg.acq_result_dep_b.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_b.cp * 100 - 794.0 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_b.cp, expected 794.0, is %s", last_msg.msg.acq_result_dep_b.cp); - - - ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.code == 0, "incorrect value for last_msg.msg.acq_result_dep_b.sid.code, expected 0, is %d", last_msg.msg.acq_result_dep_b.sid.code); - - ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.reserved == 0, "incorrect value for last_msg.msg.acq_result_dep_b.sid.reserved, expected 0, is %d", last_msg.msg.acq_result_dep_b.sid.reserved); - - ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.sat == 18, "incorrect value for last_msg.msg.acq_result_dep_b.sid.sat, expected 18, is %d", last_msg.msg.acq_result_dep_b.sid.sat); - - ck_assert_msg((last_msg.msg.acq_result_dep_b.snr * 100 - 35.7772369385 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_b.snr, expected 35.7772369385, is %s", last_msg.msg.acq_result_dep_b.snr); + ck_assert_msg( + (last_msg.msg.acq_result_dep_b.cf * 100 - 4745.36132812 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_b.cf, expected " + "4745.36132812, is %s", + last_msg.msg.acq_result_dep_b.cf); + + ck_assert_msg((last_msg.msg.acq_result_dep_b.cp * 100 - 794.0 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_b.cp, " + "expected 794.0, is %s", + last_msg.msg.acq_result_dep_b.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.code == 0, + "incorrect value for last_msg.msg.acq_result_dep_b.sid.code, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_b.sid.code); + + ck_assert_msg( + last_msg.msg.acq_result_dep_b.sid.reserved == 0, + "incorrect value for last_msg.msg.acq_result_dep_b.sid.reserved, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_b.sid.reserved); + + ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.sat == 18, + "incorrect value for last_msg.msg.acq_result_dep_b.sid.sat, " + "expected 18, is %d", + last_msg.msg.acq_result_dep_b.sid.sat); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_b.snr * 100 - 35.7772369385 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_b.snr, expected " + "35.7772369385, is %s", + last_msg.msg.acq_result_dep_b.snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -295,66 +372,93 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x14, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x14, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,20,0,246,215,16,46,199,14,66,0,64,129,67,240,24,28,69,17,0,0,0,18,181, }; + u8 encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 46, 199, 14, 66, 0, 64, + 129, 67, 240, 24, 28, 69, 17, 0, 0, 0, 18, 181, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_b.cf = 2497.55859375; - + test_msg.acq_result_dep_b.cp = 258.5; - - + test_msg.acq_result_dep_b.sid.code = 0; - + test_msg.acq_result_dep_b.sid.reserved = 0; - + test_msg.acq_result_dep_b.sid.sat = 17; - + test_msg.acq_result_dep_b.snr = 35.69451141357422; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepB, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepB, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_b.cf * 100 - 2497.55859375 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_b.cf, expected 2497.55859375, is %s", last_msg.msg.acq_result_dep_b.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_b.cp * 100 - 258.5 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_b.cp, expected 258.5, is %s", last_msg.msg.acq_result_dep_b.cp); - - - ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.code == 0, "incorrect value for last_msg.msg.acq_result_dep_b.sid.code, expected 0, is %d", last_msg.msg.acq_result_dep_b.sid.code); - - ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.reserved == 0, "incorrect value for last_msg.msg.acq_result_dep_b.sid.reserved, expected 0, is %d", last_msg.msg.acq_result_dep_b.sid.reserved); - - ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.sat == 17, "incorrect value for last_msg.msg.acq_result_dep_b.sid.sat, expected 17, is %d", last_msg.msg.acq_result_dep_b.sid.sat); - - ck_assert_msg((last_msg.msg.acq_result_dep_b.snr * 100 - 35.6945114136 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_b.snr, expected 35.6945114136, is %s", last_msg.msg.acq_result_dep_b.snr); + ck_assert_msg( + (last_msg.msg.acq_result_dep_b.cf * 100 - 2497.55859375 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_b.cf, expected " + "2497.55859375, is %s", + last_msg.msg.acq_result_dep_b.cf); + + ck_assert_msg((last_msg.msg.acq_result_dep_b.cp * 100 - 258.5 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_b.cp, " + "expected 258.5, is %s", + last_msg.msg.acq_result_dep_b.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.code == 0, + "incorrect value for last_msg.msg.acq_result_dep_b.sid.code, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_b.sid.code); + + ck_assert_msg( + last_msg.msg.acq_result_dep_b.sid.reserved == 0, + "incorrect value for last_msg.msg.acq_result_dep_b.sid.reserved, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_b.sid.reserved); + + ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.sat == 17, + "incorrect value for last_msg.msg.acq_result_dep_b.sid.sat, " + "expected 17, is %d", + last_msg.msg.acq_result_dep_b.sid.sat); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_b.snr * 100 - 35.6945114136 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_b.snr, expected " + "35.6945114136, is %s", + last_msg.msg.acq_result_dep_b.snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -362,69 +466,96 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x14, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x14, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,20,0,246,215,16,194,24,14,66,0,128,2,68,129,193,249,195,5,0,0,0,35,203, }; + u8 encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 194, 24, 14, 66, 0, 128, + 2, 68, 129, 193, 249, 195, 5, 0, 0, 0, 35, 203, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_b.cf = -499.5117492675781; - + test_msg.acq_result_dep_b.cp = 522.0; - - + test_msg.acq_result_dep_b.sid.code = 0; - + test_msg.acq_result_dep_b.sid.reserved = 0; - + test_msg.acq_result_dep_b.sid.sat = 5; - + test_msg.acq_result_dep_b.snr = 35.52417755126953; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepB, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepB, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_b.cf * 100 - -499.511749268 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_b.cf, expected -499.511749268, is %s", last_msg.msg.acq_result_dep_b.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_b.cp * 100 - 522.0 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_b.cp, expected 522.0, is %s", last_msg.msg.acq_result_dep_b.cp); - - - ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.code == 0, "incorrect value for last_msg.msg.acq_result_dep_b.sid.code, expected 0, is %d", last_msg.msg.acq_result_dep_b.sid.code); - - ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.reserved == 0, "incorrect value for last_msg.msg.acq_result_dep_b.sid.reserved, expected 0, is %d", last_msg.msg.acq_result_dep_b.sid.reserved); - - ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.sat == 5, "incorrect value for last_msg.msg.acq_result_dep_b.sid.sat, expected 5, is %d", last_msg.msg.acq_result_dep_b.sid.sat); - - ck_assert_msg((last_msg.msg.acq_result_dep_b.snr * 100 - 35.5241775513 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_b.snr, expected 35.5241775513, is %s", last_msg.msg.acq_result_dep_b.snr); + ck_assert_msg( + (last_msg.msg.acq_result_dep_b.cf * 100 - -499.511749268 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_b.cf, expected " + "-499.511749268, is %s", + last_msg.msg.acq_result_dep_b.cf); + + ck_assert_msg((last_msg.msg.acq_result_dep_b.cp * 100 - 522.0 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_b.cp, " + "expected 522.0, is %s", + last_msg.msg.acq_result_dep_b.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.code == 0, + "incorrect value for last_msg.msg.acq_result_dep_b.sid.code, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_b.sid.code); + + ck_assert_msg( + last_msg.msg.acq_result_dep_b.sid.reserved == 0, + "incorrect value for last_msg.msg.acq_result_dep_b.sid.reserved, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_b.sid.reserved); + + ck_assert_msg(last_msg.msg.acq_result_dep_b.sid.sat == 5, + "incorrect value for last_msg.msg.acq_result_dep_b.sid.sat, " + "expected 5, is %d", + last_msg.msg.acq_result_dep_b.sid.sat); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_b.snr * 100 - 35.5241775513 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_b.snr, expected " + "35.5241775513, is %s", + last_msg.msg.acq_result_dep_b.snr); } } END_TEST -Suite* auto_check_sbp_acquisition_MsgAcqResultDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_acquisition_MsgAcqResultDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_acquisition_MsgAcqResultDepB"); +Suite *auto_check_sbp_acquisition_MsgAcqResultDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_acquisition_MsgAcqResultDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_acquisition_MsgAcqResultDepB"); tcase_add_test(tc_acq, test_auto_check_sbp_acquisition_MsgAcqResultDepB); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_acquisition_MsgAcqResultDepC.c b/c/test/auto_check_sbp_acquisition_MsgAcqResultDepC.c index 8c64e01a3..44aea2270 100644 --- a/c/test/auto_check_sbp_acquisition_MsgAcqResultDepC.c +++ b/c/test/auto_check_sbp_acquisition_MsgAcqResultDepC.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepC.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepC ) -{ +START_TEST(test_auto_check_sbp_acquisition_MsgAcqResultDepC) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepC ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,66 +90,94 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepC ) logging_reset(); - sbp_callback_register(&sbp_state, 0x1f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x1f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,31,0,40,12,16,72,9,34,66,155,152,228,67,28,34,221,68,10,0,0,0,9,189, }; + u8 encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 72, 9, 34, 66, 155, 152, + 228, 67, 28, 34, 221, 68, 10, 0, 0, 0, 9, 189, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_c.cf = 1769.06591796875; - + test_msg.acq_result_dep_c.cn0 = 40.509063720703125; - + test_msg.acq_result_dep_c.cp = 457.1922302246094; - - + test_msg.acq_result_dep_c.sid.code = 0; - + test_msg.acq_result_dep_c.sid.reserved = 0; - + test_msg.acq_result_dep_c.sid.sat = 10; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepC, 3112, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepC, 3112, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 3112, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepC, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepC, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_c.cf * 100 - 1769.06591797 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_c.cf, expected 1769.06591797, is %s", last_msg.msg.acq_result_dep_c.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_c.cn0 * 100 - 40.5090637207 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_c.cn0, expected 40.5090637207, is %s", last_msg.msg.acq_result_dep_c.cn0); - - ck_assert_msg((last_msg.msg.acq_result_dep_c.cp * 100 - 457.192230225 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_c.cp, expected 457.192230225, is %s", last_msg.msg.acq_result_dep_c.cp); - - - ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.code == 0, "incorrect value for last_msg.msg.acq_result_dep_c.sid.code, expected 0, is %d", last_msg.msg.acq_result_dep_c.sid.code); - - ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.reserved == 0, "incorrect value for last_msg.msg.acq_result_dep_c.sid.reserved, expected 0, is %d", last_msg.msg.acq_result_dep_c.sid.reserved); - - ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.sat == 10, "incorrect value for last_msg.msg.acq_result_dep_c.sid.sat, expected 10, is %d", last_msg.msg.acq_result_dep_c.sid.sat); + ck_assert_msg( + (last_msg.msg.acq_result_dep_c.cf * 100 - 1769.06591797 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_c.cf, expected " + "1769.06591797, is %s", + last_msg.msg.acq_result_dep_c.cf); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_c.cn0 * 100 - 40.5090637207 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_c.cn0, expected " + "40.5090637207, is %s", + last_msg.msg.acq_result_dep_c.cn0); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_c.cp * 100 - 457.192230225 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_c.cp, expected " + "457.192230225, is %s", + last_msg.msg.acq_result_dep_c.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.code == 0, + "incorrect value for last_msg.msg.acq_result_dep_c.sid.code, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_c.sid.code); + + ck_assert_msg( + last_msg.msg.acq_result_dep_c.sid.reserved == 0, + "incorrect value for last_msg.msg.acq_result_dep_c.sid.reserved, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_c.sid.reserved); + + ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.sat == 10, + "incorrect value for last_msg.msg.acq_result_dep_c.sid.sat, " + "expected 10, is %d", + last_msg.msg.acq_result_dep_c.sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -161,66 +185,94 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepC ) logging_reset(); - sbp_callback_register(&sbp_state, 0x1f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x1f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,31,0,40,12,16,132,250,45,66,207,93,88,68,68,185,252,195,6,0,0,0,136,185, }; + u8 encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 132, 250, 45, 66, 207, 93, + 88, 68, 68, 185, 252, 195, 6, 0, 0, 0, 136, 185, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_c.cf = -505.4473876953125; - + test_msg.acq_result_dep_c.cn0 = 43.49464416503906; - + test_msg.acq_result_dep_c.cp = 865.4657592773438; - - + test_msg.acq_result_dep_c.sid.code = 0; - + test_msg.acq_result_dep_c.sid.reserved = 0; - + test_msg.acq_result_dep_c.sid.sat = 6; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepC, 3112, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepC, 3112, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 3112, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepC, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepC, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_c.cf * 100 - -505.447387695 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_c.cf, expected -505.447387695, is %s", last_msg.msg.acq_result_dep_c.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_c.cn0 * 100 - 43.494644165 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_c.cn0, expected 43.494644165, is %s", last_msg.msg.acq_result_dep_c.cn0); - - ck_assert_msg((last_msg.msg.acq_result_dep_c.cp * 100 - 865.465759277 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_c.cp, expected 865.465759277, is %s", last_msg.msg.acq_result_dep_c.cp); - - - ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.code == 0, "incorrect value for last_msg.msg.acq_result_dep_c.sid.code, expected 0, is %d", last_msg.msg.acq_result_dep_c.sid.code); - - ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.reserved == 0, "incorrect value for last_msg.msg.acq_result_dep_c.sid.reserved, expected 0, is %d", last_msg.msg.acq_result_dep_c.sid.reserved); - - ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.sat == 6, "incorrect value for last_msg.msg.acq_result_dep_c.sid.sat, expected 6, is %d", last_msg.msg.acq_result_dep_c.sid.sat); + ck_assert_msg( + (last_msg.msg.acq_result_dep_c.cf * 100 - -505.447387695 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_c.cf, expected " + "-505.447387695, is %s", + last_msg.msg.acq_result_dep_c.cf); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_c.cn0 * 100 - 43.494644165 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_c.cn0, expected " + "43.494644165, is %s", + last_msg.msg.acq_result_dep_c.cn0); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_c.cp * 100 - 865.465759277 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_c.cp, expected " + "865.465759277, is %s", + last_msg.msg.acq_result_dep_c.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.code == 0, + "incorrect value for last_msg.msg.acq_result_dep_c.sid.code, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_c.sid.code); + + ck_assert_msg( + last_msg.msg.acq_result_dep_c.sid.reserved == 0, + "incorrect value for last_msg.msg.acq_result_dep_c.sid.reserved, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_c.sid.reserved); + + ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.sat == 6, + "incorrect value for last_msg.msg.acq_result_dep_c.sid.sat, " + "expected 6, is %d", + last_msg.msg.acq_result_dep_c.sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -228,66 +280,94 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepC ) logging_reset(); - sbp_callback_register(&sbp_state, 0x1f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x1f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,31,0,40,12,16,163,223,24,66,64,91,102,67,202,243,157,196,13,0,0,0,150,161, }; + u8 encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 163, 223, 24, 66, 64, 91, + 102, 67, 202, 243, 157, 196, 13, 0, 0, 0, 150, 161, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_c.cf = -1263.618408203125; - + test_msg.acq_result_dep_c.cn0 = 38.2183952331543; - + test_msg.acq_result_dep_c.cp = 230.3564453125; - - + test_msg.acq_result_dep_c.sid.code = 0; - + test_msg.acq_result_dep_c.sid.reserved = 0; - + test_msg.acq_result_dep_c.sid.sat = 13; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepC, 3112, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepC, 3112, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 3112, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepC, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepC, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_c.cf * 100 - -1263.6184082 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_c.cf, expected -1263.6184082, is %s", last_msg.msg.acq_result_dep_c.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_c.cn0 * 100 - 38.2183952332 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_c.cn0, expected 38.2183952332, is %s", last_msg.msg.acq_result_dep_c.cn0); - - ck_assert_msg((last_msg.msg.acq_result_dep_c.cp * 100 - 230.356445312 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_c.cp, expected 230.356445312, is %s", last_msg.msg.acq_result_dep_c.cp); - - - ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.code == 0, "incorrect value for last_msg.msg.acq_result_dep_c.sid.code, expected 0, is %d", last_msg.msg.acq_result_dep_c.sid.code); - - ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.reserved == 0, "incorrect value for last_msg.msg.acq_result_dep_c.sid.reserved, expected 0, is %d", last_msg.msg.acq_result_dep_c.sid.reserved); - - ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.sat == 13, "incorrect value for last_msg.msg.acq_result_dep_c.sid.sat, expected 13, is %d", last_msg.msg.acq_result_dep_c.sid.sat); + ck_assert_msg( + (last_msg.msg.acq_result_dep_c.cf * 100 - -1263.6184082 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_c.cf, expected " + "-1263.6184082, is %s", + last_msg.msg.acq_result_dep_c.cf); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_c.cn0 * 100 - 38.2183952332 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_c.cn0, expected " + "38.2183952332, is %s", + last_msg.msg.acq_result_dep_c.cn0); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_c.cp * 100 - 230.356445312 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_c.cp, expected " + "230.356445312, is %s", + last_msg.msg.acq_result_dep_c.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.code == 0, + "incorrect value for last_msg.msg.acq_result_dep_c.sid.code, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_c.sid.code); + + ck_assert_msg( + last_msg.msg.acq_result_dep_c.sid.reserved == 0, + "incorrect value for last_msg.msg.acq_result_dep_c.sid.reserved, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_c.sid.reserved); + + ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.sat == 13, + "incorrect value for last_msg.msg.acq_result_dep_c.sid.sat, " + "expected 13, is %d", + last_msg.msg.acq_result_dep_c.sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -295,66 +375,94 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepC ) logging_reset(); - sbp_callback_register(&sbp_state, 0x1f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x1f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,31,0,40,12,16,129,65,21,66,224,214,124,67,243,138,61,69,1,0,0,0,109,209, }; + u8 encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 129, 65, 21, 66, 224, 214, + 124, 67, 243, 138, 61, 69, 1, 0, 0, 0, 109, 209, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_c.cf = 3032.684326171875; - + test_msg.acq_result_dep_c.cn0 = 37.313968658447266; - + test_msg.acq_result_dep_c.cp = 252.83935546875; - - + test_msg.acq_result_dep_c.sid.code = 0; - + test_msg.acq_result_dep_c.sid.reserved = 0; - + test_msg.acq_result_dep_c.sid.sat = 1; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepC, 3112, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepC, 3112, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 3112, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepC, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepC, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_c.cf * 100 - 3032.68432617 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_c.cf, expected 3032.68432617, is %s", last_msg.msg.acq_result_dep_c.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_c.cn0 * 100 - 37.3139686584 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_c.cn0, expected 37.3139686584, is %s", last_msg.msg.acq_result_dep_c.cn0); - - ck_assert_msg((last_msg.msg.acq_result_dep_c.cp * 100 - 252.839355469 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_c.cp, expected 252.839355469, is %s", last_msg.msg.acq_result_dep_c.cp); - - - ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.code == 0, "incorrect value for last_msg.msg.acq_result_dep_c.sid.code, expected 0, is %d", last_msg.msg.acq_result_dep_c.sid.code); - - ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.reserved == 0, "incorrect value for last_msg.msg.acq_result_dep_c.sid.reserved, expected 0, is %d", last_msg.msg.acq_result_dep_c.sid.reserved); - - ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.sat == 1, "incorrect value for last_msg.msg.acq_result_dep_c.sid.sat, expected 1, is %d", last_msg.msg.acq_result_dep_c.sid.sat); + ck_assert_msg( + (last_msg.msg.acq_result_dep_c.cf * 100 - 3032.68432617 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_c.cf, expected " + "3032.68432617, is %s", + last_msg.msg.acq_result_dep_c.cf); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_c.cn0 * 100 - 37.3139686584 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_c.cn0, expected " + "37.3139686584, is %s", + last_msg.msg.acq_result_dep_c.cn0); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_c.cp * 100 - 252.839355469 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_c.cp, expected " + "252.839355469, is %s", + last_msg.msg.acq_result_dep_c.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.code == 0, + "incorrect value for last_msg.msg.acq_result_dep_c.sid.code, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_c.sid.code); + + ck_assert_msg( + last_msg.msg.acq_result_dep_c.sid.reserved == 0, + "incorrect value for last_msg.msg.acq_result_dep_c.sid.reserved, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_c.sid.reserved); + + ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.sat == 1, + "incorrect value for last_msg.msg.acq_result_dep_c.sid.sat, " + "expected 1, is %d", + last_msg.msg.acq_result_dep_c.sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -362,69 +470,97 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqResultDepC ) logging_reset(); - sbp_callback_register(&sbp_state, 0x1f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x1f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,31,0,40,12,16,126,35,62,66,226,37,102,68,202,243,29,69,27,0,0,0,91,67, }; + u8 encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 126, 35, 62, 66, 226, 37, + 102, 68, 202, 243, 29, 69, 27, 0, 0, 0, 91, 67, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acq_result_dep_c.cf = 2527.23681640625; - + test_msg.acq_result_dep_c.cn0 = 47.53466033935547; - + test_msg.acq_result_dep_c.cp = 920.5919189453125; - - + test_msg.acq_result_dep_c.sid.code = 0; - + test_msg.acq_result_dep_c.sid.reserved = 0; - + test_msg.acq_result_dep_c.sid.sat = 27; - sbp_message_send(&sbp_state, SbpMsgAcqResultDepC, 3112, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqResultDepC, 3112, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 3112, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqResultDepC, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqResultDepC, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.acq_result_dep_c.cf * 100 - 2527.23681641 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_c.cf, expected 2527.23681641, is %s", last_msg.msg.acq_result_dep_c.cf); - - ck_assert_msg((last_msg.msg.acq_result_dep_c.cn0 * 100 - 47.5346603394 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_c.cn0, expected 47.5346603394, is %s", last_msg.msg.acq_result_dep_c.cn0); - - ck_assert_msg((last_msg.msg.acq_result_dep_c.cp * 100 - 920.591918945 * 100) < 0.05, "incorrect value for last_msg.msg.acq_result_dep_c.cp, expected 920.591918945, is %s", last_msg.msg.acq_result_dep_c.cp); - - - ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.code == 0, "incorrect value for last_msg.msg.acq_result_dep_c.sid.code, expected 0, is %d", last_msg.msg.acq_result_dep_c.sid.code); - - ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.reserved == 0, "incorrect value for last_msg.msg.acq_result_dep_c.sid.reserved, expected 0, is %d", last_msg.msg.acq_result_dep_c.sid.reserved); - - ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.sat == 27, "incorrect value for last_msg.msg.acq_result_dep_c.sid.sat, expected 27, is %d", last_msg.msg.acq_result_dep_c.sid.sat); + ck_assert_msg( + (last_msg.msg.acq_result_dep_c.cf * 100 - 2527.23681641 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_c.cf, expected " + "2527.23681641, is %s", + last_msg.msg.acq_result_dep_c.cf); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_c.cn0 * 100 - 47.5346603394 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_c.cn0, expected " + "47.5346603394, is %s", + last_msg.msg.acq_result_dep_c.cn0); + + ck_assert_msg( + (last_msg.msg.acq_result_dep_c.cp * 100 - 920.591918945 * 100) < 0.05, + "incorrect value for last_msg.msg.acq_result_dep_c.cp, expected " + "920.591918945, is %s", + last_msg.msg.acq_result_dep_c.cp); + + ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.code == 0, + "incorrect value for last_msg.msg.acq_result_dep_c.sid.code, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_c.sid.code); + + ck_assert_msg( + last_msg.msg.acq_result_dep_c.sid.reserved == 0, + "incorrect value for last_msg.msg.acq_result_dep_c.sid.reserved, " + "expected 0, is %d", + last_msg.msg.acq_result_dep_c.sid.reserved); + + ck_assert_msg(last_msg.msg.acq_result_dep_c.sid.sat == 27, + "incorrect value for last_msg.msg.acq_result_dep_c.sid.sat, " + "expected 27, is %d", + last_msg.msg.acq_result_dep_c.sid.sat); } } END_TEST -Suite* auto_check_sbp_acquisition_MsgAcqResultDepC_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_acquisition_MsgAcqResultDepC"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_acquisition_MsgAcqResultDepC"); +Suite *auto_check_sbp_acquisition_MsgAcqResultDepC_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_acquisition_MsgAcqResultDepC"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_acquisition_MsgAcqResultDepC"); tcase_add_test(tc_acq, test_auto_check_sbp_acquisition_MsgAcqResultDepC); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_acquisition_MsgAcqSvProfile.c b/c/test/auto_check_sbp_acquisition_MsgAcqSvProfile.c index de5448014..0eff16edd 100644 --- a/c/test/auto_check_sbp_acquisition_MsgAcqSvProfile.c +++ b/c/test/auto_check_sbp_acquisition_MsgAcqSvProfile.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfile.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfile.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_acquisition_MsgAcqSvProfile ) -{ +START_TEST(test_auto_check_sbp_acquisition_MsgAcqSvProfile) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqSvProfile ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,214 +90,384 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqSvProfile ) logging_reset(); - sbp_callback_register(&sbp_state, 0x2e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x2e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,46,0,195,4,99,7,13,38,0,97,22,0,174,0,52,0,0,0,49,0,0,0,61,0,0,0,147,0,0,0,47,0,0,0,140,0,0,0,166,210,59,0,253,23,1,121,0,190,0,0,0,175,0,0,0,175,0,0,0,142,0,0,0,237,0,0,0,12,0,0,0,126,88,21,0,153,24,0,8,0,130,0,0,0,172,0,0,0,91,0,0,0,191,0,0,0,84,0,0,0,82,0,0,0,168,177, }; + u8 encoded_frame[] = { + 85, 46, 0, 195, 4, 99, 7, 13, 38, 0, 97, 22, 0, 174, + 0, 52, 0, 0, 0, 49, 0, 0, 0, 61, 0, 0, 0, 147, + 0, 0, 0, 47, 0, 0, 0, 140, 0, 0, 0, 166, 210, 59, + 0, 253, 23, 1, 121, 0, 190, 0, 0, 0, 175, 0, 0, 0, + 175, 0, 0, 0, 142, 0, 0, 0, 237, 0, 0, 0, 12, 0, + 0, 0, 126, 88, 21, 0, 153, 24, 0, 8, 0, 130, 0, 0, + 0, 172, 0, 0, 0, 91, 0, 0, 0, 191, 0, 0, 0, 84, + 0, 0, 0, 82, 0, 0, 0, 168, 177, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - + test_msg.acq_sv_profile.acq_sv_profile[0].bin_width = 174; - + test_msg.acq_sv_profile.acq_sv_profile[0].cf = 47; - + test_msg.acq_sv_profile.acq_sv_profile[0].cf_max = 147; - + test_msg.acq_sv_profile.acq_sv_profile[0].cf_min = 61; - + test_msg.acq_sv_profile.acq_sv_profile[0].cn0 = 38; - + test_msg.acq_sv_profile.acq_sv_profile[0].cp = 140; - + test_msg.acq_sv_profile.acq_sv_profile[0].int_time = 97; - + test_msg.acq_sv_profile.acq_sv_profile[0].job_type = 7; - - + test_msg.acq_sv_profile.acq_sv_profile[0].sid.code = 0; - + test_msg.acq_sv_profile.acq_sv_profile[0].sid.sat = 22; - + test_msg.acq_sv_profile.acq_sv_profile[0].status = 13; - + test_msg.acq_sv_profile.acq_sv_profile[0].time_spent = 49; - + test_msg.acq_sv_profile.acq_sv_profile[0].timestamp = 52; - - + test_msg.acq_sv_profile.acq_sv_profile[1].bin_width = 121; - + test_msg.acq_sv_profile.acq_sv_profile[1].cf = 237; - + test_msg.acq_sv_profile.acq_sv_profile[1].cf_max = 142; - + test_msg.acq_sv_profile.acq_sv_profile[1].cf_min = 175; - + test_msg.acq_sv_profile.acq_sv_profile[1].cn0 = 59; - + test_msg.acq_sv_profile.acq_sv_profile[1].cp = 12; - + test_msg.acq_sv_profile.acq_sv_profile[1].int_time = 253; - + test_msg.acq_sv_profile.acq_sv_profile[1].job_type = 166; - - + test_msg.acq_sv_profile.acq_sv_profile[1].sid.code = 1; - + test_msg.acq_sv_profile.acq_sv_profile[1].sid.sat = 23; - + test_msg.acq_sv_profile.acq_sv_profile[1].status = 210; - + test_msg.acq_sv_profile.acq_sv_profile[1].time_spent = 175; - + test_msg.acq_sv_profile.acq_sv_profile[1].timestamp = 190; - - + test_msg.acq_sv_profile.acq_sv_profile[2].bin_width = 8; - + test_msg.acq_sv_profile.acq_sv_profile[2].cf = 84; - + test_msg.acq_sv_profile.acq_sv_profile[2].cf_max = 191; - + test_msg.acq_sv_profile.acq_sv_profile[2].cf_min = 91; - + test_msg.acq_sv_profile.acq_sv_profile[2].cn0 = 21; - + test_msg.acq_sv_profile.acq_sv_profile[2].cp = 82; - + test_msg.acq_sv_profile.acq_sv_profile[2].int_time = 153; - + test_msg.acq_sv_profile.acq_sv_profile[2].job_type = 126; - - + test_msg.acq_sv_profile.acq_sv_profile[2].sid.code = 0; - + test_msg.acq_sv_profile.acq_sv_profile[2].sid.sat = 24; - + test_msg.acq_sv_profile.acq_sv_profile[2].status = 88; - + test_msg.acq_sv_profile.acq_sv_profile[2].time_spent = 172; - + test_msg.acq_sv_profile.acq_sv_profile[2].timestamp = 130; - + test_msg.acq_sv_profile.n_acq_sv_profile = 3; - sbp_message_send(&sbp_state, SbpMsgAcqSvProfile, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqSvProfile, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqSvProfile, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqSvProfile, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].bin_width == 174, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[0].bin_width, expected 174, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[0].bin_width); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf == 47, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf, expected 47, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf_max == 147, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf_max, expected 147, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf_max); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf_min == 61, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf_min, expected 61, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf_min); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].cn0 == 38, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[0].cn0, expected 38, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[0].cn0); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].cp == 140, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[0].cp, expected 140, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[0].cp); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].int_time == 97, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[0].int_time, expected 97, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[0].int_time); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].job_type == 7, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[0].job_type, expected 7, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[0].job_type); - - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].sid.code == 0, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[0].sid.code, expected 0, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[0].sid.code); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].sid.sat == 22, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[0].sid.sat, expected 22, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[0].sid.sat); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].status == 13, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[0].status, expected 13, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[0].status); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].time_spent == 49, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[0].time_spent, expected 49, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[0].time_spent); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].timestamp == 52, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[0].timestamp, expected 52, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[0].timestamp); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].bin_width == 121, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[1].bin_width, expected 121, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[1].bin_width); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf == 237, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf, expected 237, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf_max == 142, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf_max, expected 142, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf_max); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf_min == 175, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf_min, expected 175, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf_min); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].cn0 == 59, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[1].cn0, expected 59, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[1].cn0); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].cp == 12, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[1].cp, expected 12, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[1].cp); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].int_time == 253, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[1].int_time, expected 253, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[1].int_time); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].job_type == 166, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[1].job_type, expected 166, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[1].job_type); - - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].sid.code == 1, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[1].sid.code, expected 1, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[1].sid.code); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].sid.sat == 23, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[1].sid.sat, expected 23, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[1].sid.sat); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].status == 210, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[1].status, expected 210, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[1].status); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].time_spent == 175, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[1].time_spent, expected 175, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[1].time_spent); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].timestamp == 190, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[1].timestamp, expected 190, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[1].timestamp); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].bin_width == 8, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[2].bin_width, expected 8, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[2].bin_width); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf == 84, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf, expected 84, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf_max == 191, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf_max, expected 191, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf_max); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf_min == 91, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf_min, expected 91, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf_min); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].cn0 == 21, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[2].cn0, expected 21, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[2].cn0); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].cp == 82, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[2].cp, expected 82, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[2].cp); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].int_time == 153, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[2].int_time, expected 153, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[2].int_time); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].job_type == 126, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[2].job_type, expected 126, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[2].job_type); - - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].sid.code == 0, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[2].sid.code, expected 0, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[2].sid.code); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].sid.sat == 24, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[2].sid.sat, expected 24, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[2].sid.sat); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].status == 88, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[2].status, expected 88, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[2].status); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].time_spent == 172, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[2].time_spent, expected 172, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[2].time_spent); - - ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].timestamp == 130, "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[2].timestamp, expected 130, is %d", last_msg.msg.acq_sv_profile.acq_sv_profile[2].timestamp); - - ck_assert_msg(last_msg.msg.acq_sv_profile.n_acq_sv_profile == 3, "incorrect value for last_msg.msg.acq_sv_profile.n_acq_sv_profile, expected 3, is %d", last_msg.msg.acq_sv_profile.n_acq_sv_profile); + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[0].bin_width == 174, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[0].bin_width, expected " + "174, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[0].bin_width); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf == 47, + "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf, " + "expected 47, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf_max == 147, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf_max, " + "expected 147, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf_max); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf_min == 61, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf_min, " + "expected 61, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[0].cf_min); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[0].cn0 == 38, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[0].cn0, expected 38, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[0].cn0); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[0].cp == 140, + "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[0].cp, " + "expected 140, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[0].cp); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].int_time == 97, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[0].int_time, " + "expected 97, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[0].int_time); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].job_type == 7, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[0].job_type, " + "expected 7, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[0].job_type); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].sid.code == 0, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[0].sid.code, " + "expected 0, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[0].sid.code); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].sid.sat == 22, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[0].sid.sat, " + "expected 22, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[0].sid.sat); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].status == 13, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[0].status, " + "expected 13, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[0].status); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[0].time_spent == 49, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[0].time_spent, expected " + "49, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[0].time_spent); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[0].timestamp == 52, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[0].timestamp, " + "expected 52, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[0].timestamp); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[1].bin_width == 121, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[1].bin_width, expected " + "121, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[1].bin_width); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf == 237, + "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf, " + "expected 237, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf_max == 142, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf_max, " + "expected 142, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf_max); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf_min == 175, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf_min, " + "expected 175, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[1].cf_min); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[1].cn0 == 59, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[1].cn0, expected 59, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[1].cn0); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[1].cp == 12, + "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[1].cp, " + "expected 12, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[1].cp); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].int_time == 253, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[1].int_time, " + "expected 253, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[1].int_time); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].job_type == 166, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[1].job_type, " + "expected 166, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[1].job_type); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].sid.code == 1, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[1].sid.code, " + "expected 1, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[1].sid.code); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].sid.sat == 23, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[1].sid.sat, " + "expected 23, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[1].sid.sat); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[1].status == 210, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[1].status, " + "expected 210, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[1].status); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[1].time_spent == 175, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[1].time_spent, expected " + "175, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[1].time_spent); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[1].timestamp == 190, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[1].timestamp, expected " + "190, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[1].timestamp); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].bin_width == 8, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[2].bin_width, " + "expected 8, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[2].bin_width); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf == 84, + "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf, " + "expected 84, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf_max == 191, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf_max, " + "expected 191, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf_max); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf_min == 91, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf_min, " + "expected 91, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[2].cf_min); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[2].cn0 == 21, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[2].cn0, expected 21, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[2].cn0); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[2].cp == 82, + "incorrect value for last_msg.msg.acq_sv_profile.acq_sv_profile[2].cp, " + "expected 82, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[2].cp); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].int_time == 153, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[2].int_time, " + "expected 153, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[2].int_time); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].job_type == 126, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[2].job_type, " + "expected 126, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[2].job_type); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].sid.code == 0, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[2].sid.code, " + "expected 0, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[2].sid.code); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].sid.sat == 24, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[2].sid.sat, " + "expected 24, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[2].sid.sat); + + ck_assert_msg(last_msg.msg.acq_sv_profile.acq_sv_profile[2].status == 88, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[2].status, " + "expected 88, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[2].status); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[2].time_spent == 172, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[2].time_spent, expected " + "172, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[2].time_spent); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.acq_sv_profile[2].timestamp == 130, + "incorrect value for " + "last_msg.msg.acq_sv_profile.acq_sv_profile[2].timestamp, expected " + "130, is %d", + last_msg.msg.acq_sv_profile.acq_sv_profile[2].timestamp); + + ck_assert_msg( + last_msg.msg.acq_sv_profile.n_acq_sv_profile == 3, + "incorrect value for last_msg.msg.acq_sv_profile.n_acq_sv_profile, " + "expected 3, is %d", + last_msg.msg.acq_sv_profile.n_acq_sv_profile); } } END_TEST -Suite* auto_check_sbp_acquisition_MsgAcqSvProfile_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_acquisition_MsgAcqSvProfile"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_acquisition_MsgAcqSvProfile"); +Suite *auto_check_sbp_acquisition_MsgAcqSvProfile_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_acquisition_MsgAcqSvProfile"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_acquisition_MsgAcqSvProfile"); tcase_add_test(tc_acq, test_auto_check_sbp_acquisition_MsgAcqSvProfile); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_acquisition_MsgAcqSvProfileDep.c b/c/test/auto_check_sbp_acquisition_MsgAcqSvProfileDep.c index 742660f9c..baf8b718b 100644 --- a/c/test/auto_check_sbp_acquisition_MsgAcqSvProfileDep.c +++ b/c/test/auto_check_sbp_acquisition_MsgAcqSvProfileDep.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfileDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfileDep.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_acquisition_MsgAcqSvProfileDep ) -{ +START_TEST(test_auto_check_sbp_acquisition_MsgAcqSvProfileDep) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqSvProfileDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,226 +90,435 @@ START_TEST( test_auto_check_sbp_acquisition_MsgAcqSvProfileDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x1e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x1e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,30,0,195,4,105,67,103,151,0,12,22,0,0,0,187,0,91,0,0,0,75,0,0,0,132,0,0,0,36,0,0,0,60,0,0,0,241,0,0,0,238,38,111,0,179,23,0,1,0,176,0,166,0,0,0,234,0,0,0,155,0,0,0,24,0,0,0,212,0,0,0,247,0,0,0,142,213,68,0,53,24,0,0,0,52,0,49,0,0,0,245,0,0,0,76,0,0,0,248,0,0,0,212,0,0,0,101,0,0,0,67,132, }; + u8 encoded_frame[] = { + 85, 30, 0, 195, 4, 105, 67, 103, 151, 0, 12, 22, 0, 0, 0, + 187, 0, 91, 0, 0, 0, 75, 0, 0, 0, 132, 0, 0, 0, 36, + 0, 0, 0, 60, 0, 0, 0, 241, 0, 0, 0, 238, 38, 111, 0, + 179, 23, 0, 1, 0, 176, 0, 166, 0, 0, 0, 234, 0, 0, 0, + 155, 0, 0, 0, 24, 0, 0, 0, 212, 0, 0, 0, 247, 0, 0, + 0, 142, 213, 68, 0, 53, 24, 0, 0, 0, 52, 0, 49, 0, 0, + 0, 245, 0, 0, 0, 76, 0, 0, 0, 248, 0, 0, 0, 212, 0, + 0, 0, 101, 0, 0, 0, 67, 132, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - + test_msg.acq_sv_profile_dep.acq_sv_profile[0].bin_width = 187; - + test_msg.acq_sv_profile_dep.acq_sv_profile[0].cf = 60; - + test_msg.acq_sv_profile_dep.acq_sv_profile[0].cf_max = 36; - + test_msg.acq_sv_profile_dep.acq_sv_profile[0].cf_min = 132; - + test_msg.acq_sv_profile_dep.acq_sv_profile[0].cn0 = 151; - + test_msg.acq_sv_profile_dep.acq_sv_profile[0].cp = 241; - + test_msg.acq_sv_profile_dep.acq_sv_profile[0].int_time = 12; - + test_msg.acq_sv_profile_dep.acq_sv_profile[0].job_type = 67; - - + test_msg.acq_sv_profile_dep.acq_sv_profile[0].sid.code = 0; - + test_msg.acq_sv_profile_dep.acq_sv_profile[0].sid.reserved = 0; - + test_msg.acq_sv_profile_dep.acq_sv_profile[0].sid.sat = 22; - + test_msg.acq_sv_profile_dep.acq_sv_profile[0].status = 103; - + test_msg.acq_sv_profile_dep.acq_sv_profile[0].time_spent = 75; - + test_msg.acq_sv_profile_dep.acq_sv_profile[0].timestamp = 91; - - + test_msg.acq_sv_profile_dep.acq_sv_profile[1].bin_width = 176; - + test_msg.acq_sv_profile_dep.acq_sv_profile[1].cf = 212; - + test_msg.acq_sv_profile_dep.acq_sv_profile[1].cf_max = 24; - + test_msg.acq_sv_profile_dep.acq_sv_profile[1].cf_min = 155; - + test_msg.acq_sv_profile_dep.acq_sv_profile[1].cn0 = 111; - + test_msg.acq_sv_profile_dep.acq_sv_profile[1].cp = 247; - + test_msg.acq_sv_profile_dep.acq_sv_profile[1].int_time = 179; - + test_msg.acq_sv_profile_dep.acq_sv_profile[1].job_type = 238; - - + test_msg.acq_sv_profile_dep.acq_sv_profile[1].sid.code = 1; - + test_msg.acq_sv_profile_dep.acq_sv_profile[1].sid.reserved = 0; - + test_msg.acq_sv_profile_dep.acq_sv_profile[1].sid.sat = 23; - + test_msg.acq_sv_profile_dep.acq_sv_profile[1].status = 38; - + test_msg.acq_sv_profile_dep.acq_sv_profile[1].time_spent = 234; - + test_msg.acq_sv_profile_dep.acq_sv_profile[1].timestamp = 166; - - + test_msg.acq_sv_profile_dep.acq_sv_profile[2].bin_width = 52; - + test_msg.acq_sv_profile_dep.acq_sv_profile[2].cf = 212; - + test_msg.acq_sv_profile_dep.acq_sv_profile[2].cf_max = 248; - + test_msg.acq_sv_profile_dep.acq_sv_profile[2].cf_min = 76; - + test_msg.acq_sv_profile_dep.acq_sv_profile[2].cn0 = 68; - + test_msg.acq_sv_profile_dep.acq_sv_profile[2].cp = 101; - + test_msg.acq_sv_profile_dep.acq_sv_profile[2].int_time = 53; - + test_msg.acq_sv_profile_dep.acq_sv_profile[2].job_type = 142; - - + test_msg.acq_sv_profile_dep.acq_sv_profile[2].sid.code = 0; - + test_msg.acq_sv_profile_dep.acq_sv_profile[2].sid.reserved = 0; - + test_msg.acq_sv_profile_dep.acq_sv_profile[2].sid.sat = 24; - + test_msg.acq_sv_profile_dep.acq_sv_profile[2].status = 213; - + test_msg.acq_sv_profile_dep.acq_sv_profile[2].time_spent = 245; - + test_msg.acq_sv_profile_dep.acq_sv_profile[2].timestamp = 49; - + test_msg.acq_sv_profile_dep.n_acq_sv_profile = 3; - sbp_message_send(&sbp_state, SbpMsgAcqSvProfileDep, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcqSvProfileDep, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcqSvProfileDep, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcqSvProfileDep, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].bin_width == 187, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].bin_width, expected 187, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].bin_width); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf == 60, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf, expected 60, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf_max == 36, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf_max, expected 36, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf_max); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf_min == 132, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf_min, expected 132, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf_min); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cn0 == 151, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cn0, expected 151, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cn0); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cp == 241, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cp, expected 241, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cp); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].int_time == 12, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].int_time, expected 12, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].int_time); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].job_type == 67, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].job_type, expected 67, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].job_type); - - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.code == 0, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.code, expected 0, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.code); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.reserved == 0, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.reserved, expected 0, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.reserved); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.sat == 22, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.sat, expected 22, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.sat); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].status == 103, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].status, expected 103, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].status); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].time_spent == 75, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].time_spent, expected 75, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].time_spent); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].timestamp == 91, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].timestamp, expected 91, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].timestamp); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].bin_width == 176, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].bin_width, expected 176, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].bin_width); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf == 212, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf, expected 212, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf_max == 24, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf_max, expected 24, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf_max); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf_min == 155, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf_min, expected 155, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf_min); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cn0 == 111, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cn0, expected 111, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cn0); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cp == 247, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cp, expected 247, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cp); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].int_time == 179, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].int_time, expected 179, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].int_time); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].job_type == 238, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].job_type, expected 238, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].job_type); - - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.code == 1, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.code, expected 1, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.code); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.reserved == 0, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.reserved, expected 0, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.reserved); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.sat == 23, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.sat, expected 23, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.sat); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].status == 38, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].status, expected 38, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].status); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].time_spent == 234, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].time_spent, expected 234, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].time_spent); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].timestamp == 166, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].timestamp, expected 166, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].timestamp); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].bin_width == 52, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].bin_width, expected 52, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].bin_width); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf == 212, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf, expected 212, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf_max == 248, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf_max, expected 248, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf_max); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf_min == 76, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf_min, expected 76, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf_min); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cn0 == 68, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cn0, expected 68, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cn0); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cp == 101, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cp, expected 101, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cp); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].int_time == 53, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].int_time, expected 53, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].int_time); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].job_type == 142, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].job_type, expected 142, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].job_type); - - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.code == 0, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.code, expected 0, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.code); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.reserved == 0, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.reserved, expected 0, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.reserved); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.sat == 24, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.sat, expected 24, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.sat); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].status == 213, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].status, expected 213, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].status); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].time_spent == 245, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].time_spent, expected 245, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].time_spent); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].timestamp == 49, "incorrect value for last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].timestamp, expected 49, is %d", last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].timestamp); - - ck_assert_msg(last_msg.msg.acq_sv_profile_dep.n_acq_sv_profile == 3, "incorrect value for last_msg.msg.acq_sv_profile_dep.n_acq_sv_profile, expected 3, is %d", last_msg.msg.acq_sv_profile_dep.n_acq_sv_profile); + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].bin_width == 187, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].bin_width, expected " + "187, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].bin_width); + + ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf == 60, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf, " + "expected 60, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf_max == 36, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf_max, expected " + "36, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf_max); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf_min == 132, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf_min, expected " + "132, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cf_min); + + ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cn0 == 151, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cn0, " + "expected 151, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cn0); + + ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cp == 241, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cp, " + "expected 241, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].cp); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].int_time == 12, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].int_time, expected " + "12, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].int_time); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].job_type == 67, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].job_type, expected " + "67, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].job_type); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.code == 0, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.code, expected " + "0, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.code); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.reserved == 0, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.reserved, " + "expected 0, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.reserved); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.sat == 22, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.sat, expected " + "22, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].sid.sat); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].status == 103, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].status, expected " + "103, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].status); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].time_spent == 75, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].time_spent, " + "expected 75, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].time_spent); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].timestamp == 91, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].timestamp, expected " + "91, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[0].timestamp); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].bin_width == 176, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].bin_width, expected " + "176, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].bin_width); + + ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf == 212, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf, " + "expected 212, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf_max == 24, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf_max, expected " + "24, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf_max); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf_min == 155, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf_min, expected " + "155, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cf_min); + + ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cn0 == 111, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cn0, " + "expected 111, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cn0); + + ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cp == 247, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cp, " + "expected 247, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].cp); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].int_time == 179, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].int_time, expected " + "179, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].int_time); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].job_type == 238, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].job_type, expected " + "238, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].job_type); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.code == 1, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.code, expected " + "1, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.code); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.reserved == 0, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.reserved, " + "expected 0, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.reserved); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.sat == 23, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.sat, expected " + "23, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].sid.sat); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].status == 38, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].status, expected " + "38, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].status); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].time_spent == 234, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].time_spent, " + "expected 234, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].time_spent); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].timestamp == 166, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].timestamp, expected " + "166, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[1].timestamp); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].bin_width == 52, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].bin_width, expected " + "52, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].bin_width); + + ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf == 212, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf, " + "expected 212, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf_max == 248, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf_max, expected " + "248, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf_max); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf_min == 76, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf_min, expected " + "76, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cf_min); + + ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cn0 == 68, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cn0, " + "expected 68, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cn0); + + ck_assert_msg(last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cp == 101, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cp, " + "expected 101, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].cp); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].int_time == 53, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].int_time, expected " + "53, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].int_time); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].job_type == 142, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].job_type, expected " + "142, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].job_type); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.code == 0, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.code, expected " + "0, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.code); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.reserved == 0, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.reserved, " + "expected 0, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.reserved); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.sat == 24, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.sat, expected " + "24, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].sid.sat); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].status == 213, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].status, expected " + "213, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].status); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].time_spent == 245, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].time_spent, " + "expected 245, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].time_spent); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].timestamp == 49, + "incorrect value for " + "last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].timestamp, expected " + "49, is %d", + last_msg.msg.acq_sv_profile_dep.acq_sv_profile[2].timestamp); + + ck_assert_msg( + last_msg.msg.acq_sv_profile_dep.n_acq_sv_profile == 3, + "incorrect value for last_msg.msg.acq_sv_profile_dep.n_acq_sv_profile, " + "expected 3, is %d", + last_msg.msg.acq_sv_profile_dep.n_acq_sv_profile); } } END_TEST -Suite* auto_check_sbp_acquisition_MsgAcqSvProfileDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_acquisition_MsgAcqSvProfileDep"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_acquisition_MsgAcqSvProfileDep"); +Suite *auto_check_sbp_acquisition_MsgAcqSvProfileDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_acquisition_MsgAcqSvProfileDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_acquisition_MsgAcqSvProfileDep"); tcase_add_test(tc_acq, test_auto_check_sbp_acquisition_MsgAcqSvProfileDep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.c b/c/test/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.c index 4d51206f8..c68b79669 100644 --- a/c/test/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.c +++ b/c/test/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeReq.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_bootload_MsgBootloaderHandshakeReq ) -{ +START_TEST(test_auto_check_sbp_bootload_MsgBootloaderHandshakeReq) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_bootload_MsgBootloaderHandshakeReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,44 +90,53 @@ START_TEST( test_auto_check_sbp_bootload_MsgBootloaderHandshakeReq ) logging_reset(); - sbp_callback_register(&sbp_state, 0xb3, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xb3, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,179,0,136,247,0,65,216, }; + u8 encoded_frame[] = { + 85, 179, 0, 136, 247, 0, 65, 216, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - sbp_message_send(&sbp_state, SbpMsgBootloaderHandshakeReq, 63368, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBootloaderHandshakeReq, 63368, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 63368, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgBootloaderHandshakeReq, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); + "msg_callback: sender_id decoded incorrectly"); + ck_assert_msg(sbp_message_cmp(SbpMsgBootloaderHandshakeReq, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); } } END_TEST -Suite* auto_check_sbp_bootload_MsgBootloaderHandshakeReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_bootload_MsgBootloaderHandshakeReq"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_bootload_MsgBootloaderHandshakeReq"); - tcase_add_test(tc_acq, test_auto_check_sbp_bootload_MsgBootloaderHandshakeReq); +Suite *auto_check_sbp_bootload_MsgBootloaderHandshakeReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_bootload_MsgBootloaderHandshakeReq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_bootload_MsgBootloaderHandshakeReq"); + tcase_add_test(tc_acq, + test_auto_check_sbp_bootload_MsgBootloaderHandshakeReq); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.c b/c/test/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.c index 8fc83a0ef..d8e60c70a 100644 --- a/c/test/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.c +++ b/c/test/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeResp.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp ) -{ +START_TEST(test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,54 +90,73 @@ START_TEST( test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xb4, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xb4, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,180,0,0,0,9,0,0,0,0,118,49,46,50,10,201,1, }; + u8 encoded_frame[] = { + 85, 180, 0, 0, 0, 9, 0, 0, 0, 0, 118, 49, 46, 50, 10, 201, 1, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.bootloader_handshake_resp.flags = 0; - - + size_t written; - ck_assert_msg(sbp_msg_bootloader_handshake_resp_version_set(&test_msg.bootloader_handshake_resp, "v1.2\n", false, &written), "Can't assign text"); + ck_assert_msg( + sbp_msg_bootloader_handshake_resp_version_set( + &test_msg.bootloader_handshake_resp, "v1.2\n", false, &written), + "Can't assign text"); ck_assert_msg(written == strlen("v1.2\n"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_bootloader_handshake_resp_version_encoded_len(&test_msg.bootloader_handshake_resp) == 5, "String not encoded properly"); + ck_assert_msg(sbp_msg_bootloader_handshake_resp_version_encoded_len( + &test_msg.bootloader_handshake_resp) == 5, + "String not encoded properly"); - sbp_message_send(&sbp_state, SbpMsgBootloaderHandshakeResp, 0, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBootloaderHandshakeResp, 0, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgBootloaderHandshakeResp, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.bootloader_handshake_resp.flags == 0, "incorrect value for last_msg.msg.bootloader_handshake_resp.flags, expected 0, is %d", last_msg.msg.bootloader_handshake_resp.flags); - - - ck_assert_msg(sbp_msg_bootloader_handshake_resp_version_encoded_len(&last_msg.msg.bootloader_handshake_resp) == 5, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_bootloader_handshake_resp_version_get(&last_msg.msg.bootloader_handshake_resp), "v1.2\n") == 0, "String not decoded properly"); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgBootloaderHandshakeResp, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.bootloader_handshake_resp.flags == 0, + "incorrect value for last_msg.msg.bootloader_handshake_resp.flags, " + "expected 0, is %d", + last_msg.msg.bootloader_handshake_resp.flags); + + ck_assert_msg(sbp_msg_bootloader_handshake_resp_version_encoded_len( + &last_msg.msg.bootloader_handshake_resp) == 5, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_bootloader_handshake_resp_version_get( + &last_msg.msg.bootloader_handshake_resp), + "v1.2\n") == 0, + "String not decoded properly"); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -149,54 +164,71 @@ START_TEST( test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xb0, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xb0, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,176,0,195,4,4,118,49,46,50,1,206, }; + u8 encoded_frame[] = { + 85, 176, 0, 195, 4, 4, 118, 49, 46, 50, 1, 206, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_bootloader_handshake_dep_a_handshake_set(&test_msg.bootloader_handshake_dep_a, "v1.2", false, &written), "Can't assign text"); + ck_assert_msg( + sbp_msg_bootloader_handshake_dep_a_handshake_set( + &test_msg.bootloader_handshake_dep_a, "v1.2", false, &written), + "Can't assign text"); ck_assert_msg(written == strlen("v1.2"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_bootloader_handshake_dep_a_handshake_encoded_len(&test_msg.bootloader_handshake_dep_a) == 4, "String not encoded properly"); + ck_assert_msg(sbp_msg_bootloader_handshake_dep_a_handshake_encoded_len( + &test_msg.bootloader_handshake_dep_a) == 4, + "String not encoded properly"); - sbp_message_send(&sbp_state, SbpMsgBootloaderHandshakeDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBootloaderHandshakeDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgBootloaderHandshakeDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_bootloader_handshake_dep_a_handshake_encoded_len(&last_msg.msg.bootloader_handshake_dep_a) == 4, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_bootloader_handshake_dep_a_handshake_get(&last_msg.msg.bootloader_handshake_dep_a), "v1.2") == 0, "String not decoded properly"); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgBootloaderHandshakeDepA, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(sbp_msg_bootloader_handshake_dep_a_handshake_encoded_len( + &last_msg.msg.bootloader_handshake_dep_a) == 4, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_bootloader_handshake_dep_a_handshake_get( + &last_msg.msg.bootloader_handshake_dep_a), + "v1.2") == 0, + "String not decoded properly"); } } END_TEST -Suite* auto_check_sbp_bootload_MsgBootloaderHandshakeResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_bootload_MsgBootloaderHandshakeResp"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_bootload_MsgBootloaderHandshakeResp"); - tcase_add_test(tc_acq, test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp); +Suite *auto_check_sbp_bootload_MsgBootloaderHandshakeResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_bootload_MsgBootloaderHandshakeResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_bootload_MsgBootloaderHandshakeResp"); + tcase_add_test(tc_acq, + test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/auto_check_sbp_bootload_MsgBootloaderJumptoApp.c b/c/test/auto_check_sbp_bootload_MsgBootloaderJumptoApp.c index 72033c945..e9bd5d5ff 100644 --- a/c/test/auto_check_sbp_bootload_MsgBootloaderJumptoApp.c +++ b/c/test/auto_check_sbp_bootload_MsgBootloaderJumptoApp.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderJumptoApp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderJumptoApp.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_bootload_MsgBootloaderJumptoApp ) -{ +START_TEST(test_auto_check_sbp_bootload_MsgBootloaderJumptoApp) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_bootload_MsgBootloaderJumptoApp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,47 +90,59 @@ START_TEST( test_auto_check_sbp_bootload_MsgBootloaderJumptoApp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xb1, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xb1, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,177,0,205,18,1,216,105,96, }; + u8 encoded_frame[] = { + 85, 177, 0, 205, 18, 1, 216, 105, 96, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.bootloader_jump_to_app.jump = 216; - sbp_message_send(&sbp_state, SbpMsgBootloaderJumpToApp, 4813, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBootloaderJumpToApp, 4813, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4813, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBootloaderJumpToApp, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.bootloader_jump_to_app.jump == 216, "incorrect value for last_msg.msg.bootloader_jump_to_app.jump, expected 216, is %d", last_msg.msg.bootloader_jump_to_app.jump); + ck_assert_msg(sbp_message_cmp(SbpMsgBootloaderJumpToApp, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + ck_assert_msg( + last_msg.msg.bootloader_jump_to_app.jump == 216, + "incorrect value for last_msg.msg.bootloader_jump_to_app.jump, " + "expected 216, is %d", + last_msg.msg.bootloader_jump_to_app.jump); } } END_TEST -Suite* auto_check_sbp_bootload_MsgBootloaderJumptoApp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_bootload_MsgBootloaderJumptoApp"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_bootload_MsgBootloaderJumptoApp"); +Suite *auto_check_sbp_bootload_MsgBootloaderJumptoApp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_bootload_MsgBootloaderJumptoApp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_bootload_MsgBootloaderJumptoApp"); tcase_add_test(tc_acq, test_auto_check_sbp_bootload_MsgBootloaderJumptoApp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_bootload_MsgNapDeviceDnaReq.c b/c/test/auto_check_sbp_bootload_MsgNapDeviceDnaReq.c index 7e82d6079..905be8378 100644 --- a/c/test/auto_check_sbp_bootload_MsgNapDeviceDnaReq.c +++ b/c/test/auto_check_sbp_bootload_MsgNapDeviceDnaReq.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaReq.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_bootload_MsgNapDeviceDnaReq ) -{ +START_TEST(test_auto_check_sbp_bootload_MsgNapDeviceDnaReq) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_bootload_MsgNapDeviceDnaReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,43 +90,50 @@ START_TEST( test_auto_check_sbp_bootload_MsgNapDeviceDnaReq ) logging_reset(); - sbp_callback_register(&sbp_state, 0xde, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xde, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,222,0,128,50,0,231,160, }; + u8 encoded_frame[] = { + 85, 222, 0, 128, 50, 0, 231, 160, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - sbp_message_send(&sbp_state, SbpMsgNapDeviceDnaReq, 12928, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgNapDeviceDnaReq, 12928, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 12928, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgNapDeviceDnaReq, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgNapDeviceDnaReq, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - } } END_TEST -Suite* auto_check_sbp_bootload_MsgNapDeviceDnaReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_bootload_MsgNapDeviceDnaReq"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_bootload_MsgNapDeviceDnaReq"); +Suite *auto_check_sbp_bootload_MsgNapDeviceDnaReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_bootload_MsgNapDeviceDnaReq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_bootload_MsgNapDeviceDnaReq"); tcase_add_test(tc_acq, test_auto_check_sbp_bootload_MsgNapDeviceDnaReq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_bootload_MsgNapDeviceDnaResp.c b/c/test/auto_check_sbp_bootload_MsgNapDeviceDnaResp.c index df68bfacc..220b6c3bf 100644 --- a/c/test/auto_check_sbp_bootload_MsgNapDeviceDnaResp.c +++ b/c/test/auto_check_sbp_bootload_MsgNapDeviceDnaResp.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaResp.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_bootload_MsgNapDeviceDnaResp ) -{ +START_TEST(test_auto_check_sbp_bootload_MsgNapDeviceDnaResp) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_bootload_MsgNapDeviceDnaResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,69 +90,104 @@ START_TEST( test_auto_check_sbp_bootload_MsgNapDeviceDnaResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xdd, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xdd, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,221,0,169,56,8,2,187,1,130,173,244,67,122,70,91, }; + u8 encoded_frame[] = { + 85, 221, 0, 169, 56, 8, 2, 187, 1, 130, 173, 244, 67, 122, 70, 91, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.nap_device_dna_resp.dna[0] = 2; - + test_msg.nap_device_dna_resp.dna[1] = 187; - + test_msg.nap_device_dna_resp.dna[2] = 1; - + test_msg.nap_device_dna_resp.dna[3] = 130; - + test_msg.nap_device_dna_resp.dna[4] = 173; - + test_msg.nap_device_dna_resp.dna[5] = 244; - + test_msg.nap_device_dna_resp.dna[6] = 67; - + test_msg.nap_device_dna_resp.dna[7] = 122; - sbp_message_send(&sbp_state, SbpMsgNapDeviceDnaResp, 14505, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgNapDeviceDnaResp, 14505, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 14505, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgNapDeviceDnaResp, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgNapDeviceDnaResp, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.nap_device_dna_resp.dna[0] == 2, "incorrect value for last_msg.msg.nap_device_dna_resp.dna[0], expected 2, is %d", last_msg.msg.nap_device_dna_resp.dna[0]); - ck_assert_msg(last_msg.msg.nap_device_dna_resp.dna[1] == 187, "incorrect value for last_msg.msg.nap_device_dna_resp.dna[1], expected 187, is %d", last_msg.msg.nap_device_dna_resp.dna[1]); - ck_assert_msg(last_msg.msg.nap_device_dna_resp.dna[2] == 1, "incorrect value for last_msg.msg.nap_device_dna_resp.dna[2], expected 1, is %d", last_msg.msg.nap_device_dna_resp.dna[2]); - ck_assert_msg(last_msg.msg.nap_device_dna_resp.dna[3] == 130, "incorrect value for last_msg.msg.nap_device_dna_resp.dna[3], expected 130, is %d", last_msg.msg.nap_device_dna_resp.dna[3]); - ck_assert_msg(last_msg.msg.nap_device_dna_resp.dna[4] == 173, "incorrect value for last_msg.msg.nap_device_dna_resp.dna[4], expected 173, is %d", last_msg.msg.nap_device_dna_resp.dna[4]); - ck_assert_msg(last_msg.msg.nap_device_dna_resp.dna[5] == 244, "incorrect value for last_msg.msg.nap_device_dna_resp.dna[5], expected 244, is %d", last_msg.msg.nap_device_dna_resp.dna[5]); - ck_assert_msg(last_msg.msg.nap_device_dna_resp.dna[6] == 67, "incorrect value for last_msg.msg.nap_device_dna_resp.dna[6], expected 67, is %d", last_msg.msg.nap_device_dna_resp.dna[6]); - ck_assert_msg(last_msg.msg.nap_device_dna_resp.dna[7] == 122, "incorrect value for last_msg.msg.nap_device_dna_resp.dna[7], expected 122, is %d", last_msg.msg.nap_device_dna_resp.dna[7]); + ck_assert_msg(last_msg.msg.nap_device_dna_resp.dna[0] == 2, + "incorrect value for " + "last_msg.msg.nap_device_dna_resp.dna[0], expected 2, is %d", + last_msg.msg.nap_device_dna_resp.dna[0]); + ck_assert_msg( + last_msg.msg.nap_device_dna_resp.dna[1] == 187, + "incorrect value for last_msg.msg.nap_device_dna_resp.dna[1], expected " + "187, is %d", + last_msg.msg.nap_device_dna_resp.dna[1]); + ck_assert_msg(last_msg.msg.nap_device_dna_resp.dna[2] == 1, + "incorrect value for " + "last_msg.msg.nap_device_dna_resp.dna[2], expected 1, is %d", + last_msg.msg.nap_device_dna_resp.dna[2]); + ck_assert_msg( + last_msg.msg.nap_device_dna_resp.dna[3] == 130, + "incorrect value for last_msg.msg.nap_device_dna_resp.dna[3], expected " + "130, is %d", + last_msg.msg.nap_device_dna_resp.dna[3]); + ck_assert_msg( + last_msg.msg.nap_device_dna_resp.dna[4] == 173, + "incorrect value for last_msg.msg.nap_device_dna_resp.dna[4], expected " + "173, is %d", + last_msg.msg.nap_device_dna_resp.dna[4]); + ck_assert_msg( + last_msg.msg.nap_device_dna_resp.dna[5] == 244, + "incorrect value for last_msg.msg.nap_device_dna_resp.dna[5], expected " + "244, is %d", + last_msg.msg.nap_device_dna_resp.dna[5]); + ck_assert_msg(last_msg.msg.nap_device_dna_resp.dna[6] == 67, + "incorrect value for " + "last_msg.msg.nap_device_dna_resp.dna[6], expected 67, is %d", + last_msg.msg.nap_device_dna_resp.dna[6]); + ck_assert_msg( + last_msg.msg.nap_device_dna_resp.dna[7] == 122, + "incorrect value for last_msg.msg.nap_device_dna_resp.dna[7], expected " + "122, is %d", + last_msg.msg.nap_device_dna_resp.dna[7]); } } END_TEST -Suite* auto_check_sbp_bootload_MsgNapDeviceDnaResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_bootload_MsgNapDeviceDnaResp"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_bootload_MsgNapDeviceDnaResp"); +Suite *auto_check_sbp_bootload_MsgNapDeviceDnaResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_bootload_MsgNapDeviceDnaResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_bootload_MsgNapDeviceDnaResp"); tcase_add_test(tc_acq, test_auto_check_sbp_bootload_MsgNapDeviceDnaResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ext_events_MsgExtEvent.c b/c/test/auto_check_sbp_ext_events_MsgExtEvent.c index 08e8e1264..cc0b2315d 100644 --- a/c/test/auto_check_sbp_ext_events_MsgExtEvent.c +++ b/c/test/auto_check_sbp_ext_events_MsgExtEvent.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ext_events/test_MsgExtEvent.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ext_events/test_MsgExtEvent.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ext_events_MsgExtEvent ) -{ +START_TEST(test_auto_check_sbp_ext_events_MsgExtEvent) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ext_events_MsgExtEvent ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,63 +90,85 @@ START_TEST( test_auto_check_sbp_ext_events_MsgExtEvent ) logging_reset(); - sbp_callback_register(&sbp_state, 0x101, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x101, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,1,245,6,12,48,7,199,216,49,15,202,65,15,0,3,0,62,204, }; + u8 encoded_frame[] = { + 85, 1, 1, 245, 6, 12, 48, 7, 199, 216, + 49, 15, 202, 65, 15, 0, 3, 0, 62, 204, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ext_event.flags = 3; - + test_msg.ext_event.ns_residual = 999882; - + test_msg.ext_event.pin = 0; - + test_msg.ext_event.tow = 254924999; - + test_msg.ext_event.wn = 1840; sbp_message_send(&sbp_state, SbpMsgExtEvent, 1781, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1781, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgExtEvent, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgExtEvent, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ext_event.flags == 3, "incorrect value for last_msg.msg.ext_event.flags, expected 3, is %d", last_msg.msg.ext_event.flags); - - ck_assert_msg(last_msg.msg.ext_event.ns_residual == 999882, "incorrect value for last_msg.msg.ext_event.ns_residual, expected 999882, is %d", last_msg.msg.ext_event.ns_residual); - - ck_assert_msg(last_msg.msg.ext_event.pin == 0, "incorrect value for last_msg.msg.ext_event.pin, expected 0, is %d", last_msg.msg.ext_event.pin); - - ck_assert_msg(last_msg.msg.ext_event.tow == 254924999, "incorrect value for last_msg.msg.ext_event.tow, expected 254924999, is %d", last_msg.msg.ext_event.tow); - - ck_assert_msg(last_msg.msg.ext_event.wn == 1840, "incorrect value for last_msg.msg.ext_event.wn, expected 1840, is %d", last_msg.msg.ext_event.wn); + ck_assert_msg( + last_msg.msg.ext_event.flags == 3, + "incorrect value for last_msg.msg.ext_event.flags, expected 3, is %d", + last_msg.msg.ext_event.flags); + + ck_assert_msg(last_msg.msg.ext_event.ns_residual == 999882, + "incorrect value for last_msg.msg.ext_event.ns_residual, " + "expected 999882, is %d", + last_msg.msg.ext_event.ns_residual); + + ck_assert_msg( + last_msg.msg.ext_event.pin == 0, + "incorrect value for last_msg.msg.ext_event.pin, expected 0, is %d", + last_msg.msg.ext_event.pin); + + ck_assert_msg(last_msg.msg.ext_event.tow == 254924999, + "incorrect value for last_msg.msg.ext_event.tow, expected " + "254924999, is %d", + last_msg.msg.ext_event.tow); + + ck_assert_msg( + last_msg.msg.ext_event.wn == 1840, + "incorrect value for last_msg.msg.ext_event.wn, expected 1840, is %d", + last_msg.msg.ext_event.wn); } } END_TEST -Suite* auto_check_sbp_ext_events_MsgExtEvent_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ext_events_MsgExtEvent"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ext_events_MsgExtEvent"); +Suite *auto_check_sbp_ext_events_MsgExtEvent_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ext_events_MsgExtEvent"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_ext_events_MsgExtEvent"); tcase_add_test(tc_acq, test_auto_check_sbp_ext_events_MsgExtEvent); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_file_io_MsgFileioConfigReq.c b/c/test/auto_check_sbp_file_io_MsgFileioConfigReq.c index d63e2313f..4467e2ff2 100644 --- a/c/test/auto_check_sbp_file_io_MsgFileioConfigReq.c +++ b/c/test/auto_check_sbp_file_io_MsgFileioConfigReq.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigReq.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_file_io_MsgFileioConfigReq ) -{ +START_TEST(test_auto_check_sbp_file_io_MsgFileioConfigReq) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioConfigReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,47 +90,58 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioConfigReq ) logging_reset(); - sbp_callback_register(&sbp_state, 0x1001, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x1001, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,16,195,4,4,107,218,69,90,185,27, }; + u8 encoded_frame[] = { + 85, 1, 16, 195, 4, 4, 107, 218, 69, 90, 185, 27, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.fileio_config_req.sequence = 1514527339; - sbp_message_send(&sbp_state, SbpMsgFileioConfigReq, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgFileioConfigReq, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgFileioConfigReq, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgFileioConfigReq, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.fileio_config_req.sequence == 1514527339, "incorrect value for last_msg.msg.fileio_config_req.sequence, expected 1514527339, is %d", last_msg.msg.fileio_config_req.sequence); + ck_assert_msg( + last_msg.msg.fileio_config_req.sequence == 1514527339, + "incorrect value for last_msg.msg.fileio_config_req.sequence, expected " + "1514527339, is %d", + last_msg.msg.fileio_config_req.sequence); } } END_TEST -Suite* auto_check_sbp_file_io_MsgFileioConfigReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_file_io_MsgFileioConfigReq"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_file_io_MsgFileioConfigReq"); +Suite *auto_check_sbp_file_io_MsgFileioConfigReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_file_io_MsgFileioConfigReq"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_file_io_MsgFileioConfigReq"); tcase_add_test(tc_acq, test_auto_check_sbp_file_io_MsgFileioConfigReq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_file_io_MsgFileioConfigResp.c b/c/test/auto_check_sbp_file_io_MsgFileioConfigResp.c index 978753c72..5da2e39cb 100644 --- a/c/test/auto_check_sbp_file_io_MsgFileioConfigResp.c +++ b/c/test/auto_check_sbp_file_io_MsgFileioConfigResp.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigResp.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_file_io_MsgFileioConfigResp ) -{ +START_TEST(test_auto_check_sbp_file_io_MsgFileioConfigResp) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioConfigResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,59 +90,83 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioConfigResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0x1002, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x1002, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,16,195,4,16,170,76,52,91,149,186,44,3,216,151,255,61,12,97,66,144,239,115, }; + u8 encoded_frame[] = { + 85, 2, 16, 195, 4, 16, 170, 76, 52, 91, 149, 186, + 44, 3, 216, 151, 255, 61, 12, 97, 66, 144, 239, 115, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.fileio_config_resp.batch_size = 1040160728; - + test_msg.fileio_config_resp.fileio_version = 2420269324; - + test_msg.fileio_config_resp.sequence = 1530154154; - + test_msg.fileio_config_resp.window_size = 53262997; - sbp_message_send(&sbp_state, SbpMsgFileioConfigResp, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgFileioConfigResp, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgFileioConfigResp, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgFileioConfigResp, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.fileio_config_resp.batch_size == 1040160728, "incorrect value for last_msg.msg.fileio_config_resp.batch_size, expected 1040160728, is %d", last_msg.msg.fileio_config_resp.batch_size); - - ck_assert_msg(last_msg.msg.fileio_config_resp.fileio_version == 2420269324, "incorrect value for last_msg.msg.fileio_config_resp.fileio_version, expected 2420269324, is %d", last_msg.msg.fileio_config_resp.fileio_version); - - ck_assert_msg(last_msg.msg.fileio_config_resp.sequence == 1530154154, "incorrect value for last_msg.msg.fileio_config_resp.sequence, expected 1530154154, is %d", last_msg.msg.fileio_config_resp.sequence); - - ck_assert_msg(last_msg.msg.fileio_config_resp.window_size == 53262997, "incorrect value for last_msg.msg.fileio_config_resp.window_size, expected 53262997, is %d", last_msg.msg.fileio_config_resp.window_size); + ck_assert_msg( + last_msg.msg.fileio_config_resp.batch_size == 1040160728, + "incorrect value for last_msg.msg.fileio_config_resp.batch_size, " + "expected 1040160728, is %d", + last_msg.msg.fileio_config_resp.batch_size); + + ck_assert_msg( + last_msg.msg.fileio_config_resp.fileio_version == 2420269324, + "incorrect value for last_msg.msg.fileio_config_resp.fileio_version, " + "expected 2420269324, is %d", + last_msg.msg.fileio_config_resp.fileio_version); + + ck_assert_msg( + last_msg.msg.fileio_config_resp.sequence == 1530154154, + "incorrect value for last_msg.msg.fileio_config_resp.sequence, " + "expected 1530154154, is %d", + last_msg.msg.fileio_config_resp.sequence); + + ck_assert_msg( + last_msg.msg.fileio_config_resp.window_size == 53262997, + "incorrect value for last_msg.msg.fileio_config_resp.window_size, " + "expected 53262997, is %d", + last_msg.msg.fileio_config_resp.window_size); } } END_TEST -Suite* auto_check_sbp_file_io_MsgFileioConfigResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_file_io_MsgFileioConfigResp"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_file_io_MsgFileioConfigResp"); +Suite *auto_check_sbp_file_io_MsgFileioConfigResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_file_io_MsgFileioConfigResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_file_io_MsgFileioConfigResp"); tcase_add_test(tc_acq, test_auto_check_sbp_file_io_MsgFileioConfigResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_file_io_MsgFileioReadDirReq.c b/c/test/auto_check_sbp_file_io_MsgFileioReadDirReq.c index 2cdb2cc54..f053708b6 100644 --- a/c/test/auto_check_sbp_file_io_MsgFileioReadDirReq.c +++ b/c/test/auto_check_sbp_file_io_MsgFileioReadDirReq.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirReq.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_file_io_MsgFileioReadDirReq ) -{ +START_TEST(test_auto_check_sbp_file_io_MsgFileioReadDirReq) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioReadDirReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,61 +90,87 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioReadDirReq ) logging_reset(); - sbp_callback_register(&sbp_state, 0xa9, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xa9, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,169,0,195,4,26,130,231,255,90,196,134,47,134,47,115,111,109,101,47,114,97,110,100,111,109,47,112,97,116,104,0,26,186, }; + u8 encoded_frame[] = { + 85, 169, 0, 195, 4, 26, 130, 231, 255, 90, 196, 134, + 47, 134, 47, 115, 111, 109, 101, 47, 114, 97, 110, 100, + 111, 109, 47, 112, 97, 116, 104, 0, 26, 186, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_fileio_read_dir_req_dirname_set(&test_msg.fileio_read_dir_req, "/some/random/path", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("/some/random/path"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_fileio_read_dir_req_dirname_encoded_len(&test_msg.fileio_read_dir_req) == 18, "String not encoded properly"); - + ck_assert_msg(sbp_msg_fileio_read_dir_req_dirname_set( + &test_msg.fileio_read_dir_req, "/some/random/path", false, + &written), + "Can't assign text"); + ck_assert_msg(written == strlen("/some/random/path"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_fileio_read_dir_req_dirname_encoded_len( + &test_msg.fileio_read_dir_req) == 18, + "String not encoded properly"); + test_msg.fileio_read_dir_req.offset = 2251261636; - + test_msg.fileio_read_dir_req.sequence = 1526720386; - sbp_message_send(&sbp_state, SbpMsgFileioReadDirReq, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgFileioReadDirReq, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgFileioReadDirReq, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgFileioReadDirReq, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_fileio_read_dir_req_dirname_encoded_len(&last_msg.msg.fileio_read_dir_req) == 18, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_fileio_read_dir_req_dirname_get(&last_msg.msg.fileio_read_dir_req), "/some/random/path") == 0, "String not decoded properly"); - - ck_assert_msg(last_msg.msg.fileio_read_dir_req.offset == 2251261636, "incorrect value for last_msg.msg.fileio_read_dir_req.offset, expected 2251261636, is %d", last_msg.msg.fileio_read_dir_req.offset); - - ck_assert_msg(last_msg.msg.fileio_read_dir_req.sequence == 1526720386, "incorrect value for last_msg.msg.fileio_read_dir_req.sequence, expected 1526720386, is %d", last_msg.msg.fileio_read_dir_req.sequence); + ck_assert_msg(sbp_msg_fileio_read_dir_req_dirname_encoded_len( + &last_msg.msg.fileio_read_dir_req) == 18, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_fileio_read_dir_req_dirname_get( + &last_msg.msg.fileio_read_dir_req), + "/some/random/path") == 0, + "String not decoded properly"); + + ck_assert_msg( + last_msg.msg.fileio_read_dir_req.offset == 2251261636, + "incorrect value for last_msg.msg.fileio_read_dir_req.offset, expected " + "2251261636, is %d", + last_msg.msg.fileio_read_dir_req.offset); + + ck_assert_msg( + last_msg.msg.fileio_read_dir_req.sequence == 1526720386, + "incorrect value for last_msg.msg.fileio_read_dir_req.sequence, " + "expected 1526720386, is %d", + last_msg.msg.fileio_read_dir_req.sequence); } } END_TEST -Suite* auto_check_sbp_file_io_MsgFileioReadDirReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_file_io_MsgFileioReadDirReq"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_file_io_MsgFileioReadDirReq"); +Suite *auto_check_sbp_file_io_MsgFileioReadDirReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_file_io_MsgFileioReadDirReq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_file_io_MsgFileioReadDirReq"); tcase_add_test(tc_acq, test_auto_check_sbp_file_io_MsgFileioReadDirReq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_file_io_MsgFileioReadDirResp.c b/c/test/auto_check_sbp_file_io_MsgFileioReadDirResp.c index 39b18b989..a857a383b 100644 --- a/c/test/auto_check_sbp_file_io_MsgFileioReadDirResp.c +++ b/c/test/auto_check_sbp_file_io_MsgFileioReadDirResp.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirResp.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_file_io_MsgFileioReadDirResp ) -{ +START_TEST(test_auto_check_sbp_file_io_MsgFileioReadDirResp) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioReadDirResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,59 +90,91 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioReadDirResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xaa, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xaa, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,170,0,195,4,45,78,253,224,235,102,105,108,101,49,0,97,110,111,116,104,101,114,32,102,105,108,101,0,100,101,102,105,110,105,116,101,108,121,32,110,111,116,32,97,32,102,105,108,101,0,186,137, }; + u8 encoded_frame[] = { + 85, 170, 0, 195, 4, 45, 78, 253, 224, 235, 102, 105, 108, 101, + 49, 0, 97, 110, 111, 116, 104, 101, 114, 32, 102, 105, 108, 101, + 0, 100, 101, 102, 105, 110, 105, 116, 101, 108, 121, 32, 110, 111, + 116, 32, 97, 32, 102, 105, 108, 101, 0, 186, 137, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - ck_assert_msg(sbp_msg_fileio_read_dir_resp_contents_add_section(&test_msg.fileio_read_dir_resp, "file1") == true, "Can't assign section 0"); - ck_assert_msg(sbp_msg_fileio_read_dir_resp_contents_add_section(&test_msg.fileio_read_dir_resp, "another file") == true, "Can't assign section 1"); - ck_assert_msg(sbp_msg_fileio_read_dir_resp_contents_add_section(&test_msg.fileio_read_dir_resp, "definitely not a file") == true, "Can't assign section 2"); - ck_assert_msg(sbp_msg_fileio_read_dir_resp_contents_encoded_len(&test_msg.fileio_read_dir_resp) == 41, "String not encoded properly"); - + + ck_assert_msg(sbp_msg_fileio_read_dir_resp_contents_add_section( + &test_msg.fileio_read_dir_resp, "file1") == true, + "Can't assign section 0"); + ck_assert_msg(sbp_msg_fileio_read_dir_resp_contents_add_section( + &test_msg.fileio_read_dir_resp, "another file") == true, + "Can't assign section 1"); + ck_assert_msg( + sbp_msg_fileio_read_dir_resp_contents_add_section( + &test_msg.fileio_read_dir_resp, "definitely not a file") == true, + "Can't assign section 2"); + ck_assert_msg(sbp_msg_fileio_read_dir_resp_contents_encoded_len( + &test_msg.fileio_read_dir_resp) == 41, + "String not encoded properly"); + test_msg.fileio_read_dir_resp.sequence = 3957390670; - sbp_message_send(&sbp_state, SbpMsgFileioReadDirResp, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgFileioReadDirResp, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgFileioReadDirResp, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgFileioReadDirResp, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_fileio_read_dir_resp_contents_encoded_len(&last_msg.msg.fileio_read_dir_resp) == 41, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_fileio_read_dir_resp_contents_get_section(&last_msg.msg.fileio_read_dir_resp, 0), "file1") == 0, "Section 0 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_fileio_read_dir_resp_contents_get_section(&last_msg.msg.fileio_read_dir_resp, 1), "another file") == 0, "Section 1 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_fileio_read_dir_resp_contents_get_section(&last_msg.msg.fileio_read_dir_resp, 2), "definitely not a file") == 0, "Section 2 not decoded properly"); - - ck_assert_msg(last_msg.msg.fileio_read_dir_resp.sequence == 3957390670, "incorrect value for last_msg.msg.fileio_read_dir_resp.sequence, expected 3957390670, is %d", last_msg.msg.fileio_read_dir_resp.sequence); + ck_assert_msg(sbp_msg_fileio_read_dir_resp_contents_encoded_len( + &last_msg.msg.fileio_read_dir_resp) == 41, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_fileio_read_dir_resp_contents_get_section( + &last_msg.msg.fileio_read_dir_resp, 0), + "file1") == 0, + "Section 0 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_fileio_read_dir_resp_contents_get_section( + &last_msg.msg.fileio_read_dir_resp, 1), + "another file") == 0, + "Section 1 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_fileio_read_dir_resp_contents_get_section( + &last_msg.msg.fileio_read_dir_resp, 2), + "definitely not a file") == 0, + "Section 2 not decoded properly"); + + ck_assert_msg( + last_msg.msg.fileio_read_dir_resp.sequence == 3957390670, + "incorrect value for last_msg.msg.fileio_read_dir_resp.sequence, " + "expected 3957390670, is %d", + last_msg.msg.fileio_read_dir_resp.sequence); } } END_TEST -Suite* auto_check_sbp_file_io_MsgFileioReadDirResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_file_io_MsgFileioReadDirResp"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_file_io_MsgFileioReadDirResp"); +Suite *auto_check_sbp_file_io_MsgFileioReadDirResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_file_io_MsgFileioReadDirResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_file_io_MsgFileioReadDirResp"); tcase_add_test(tc_acq, test_auto_check_sbp_file_io_MsgFileioReadDirResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_file_io_MsgFileioReadReq.c b/c/test/auto_check_sbp_file_io_MsgFileioReadReq.c index 4fcb81879..112191cce 100644 --- a/c/test/auto_check_sbp_file_io_MsgFileioReadReq.c +++ b/c/test/auto_check_sbp_file_io_MsgFileioReadReq.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadReq.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_file_io_MsgFileioReadReq ) -{ +START_TEST(test_auto_check_sbp_file_io_MsgFileioReadReq) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioReadReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,65 +90,92 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioReadReq ) logging_reset(); - sbp_callback_register(&sbp_state, 0xa8, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xa8, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,168,0,195,4,28,34,156,130,40,98,178,190,23,53,47,112,97,116,104,47,116,111,47,115,111,109,101,47,102,105,108,101,0,86,100, }; + u8 encoded_frame[] = { + 85, 168, 0, 195, 4, 28, 34, 156, 130, 40, 98, 178, + 190, 23, 53, 47, 112, 97, 116, 104, 47, 116, 111, 47, + 115, 111, 109, 101, 47, 102, 105, 108, 101, 0, 86, 100, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.fileio_read_req.chunk_size = 53; - - + size_t written; - ck_assert_msg(sbp_msg_fileio_read_req_filename_set(&test_msg.fileio_read_req, "/path/to/some/file", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("/path/to/some/file"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_fileio_read_req_filename_encoded_len(&test_msg.fileio_read_req) == 19, "String not encoded properly"); - + ck_assert_msg( + sbp_msg_fileio_read_req_filename_set( + &test_msg.fileio_read_req, "/path/to/some/file", false, &written), + "Can't assign text"); + ck_assert_msg(written == strlen("/path/to/some/file"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_fileio_read_req_filename_encoded_len( + &test_msg.fileio_read_req) == 19, + "String not encoded properly"); + test_msg.fileio_read_req.offset = 398373474; - + test_msg.fileio_read_req.sequence = 679648290; - sbp_message_send(&sbp_state, SbpMsgFileioReadReq, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgFileioReadReq, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgFileioReadReq, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgFileioReadReq, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.fileio_read_req.chunk_size == 53, "incorrect value for last_msg.msg.fileio_read_req.chunk_size, expected 53, is %d", last_msg.msg.fileio_read_req.chunk_size); - - - ck_assert_msg(sbp_msg_fileio_read_req_filename_encoded_len(&last_msg.msg.fileio_read_req) == 19, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_fileio_read_req_filename_get(&last_msg.msg.fileio_read_req), "/path/to/some/file") == 0, "String not decoded properly"); - - ck_assert_msg(last_msg.msg.fileio_read_req.offset == 398373474, "incorrect value for last_msg.msg.fileio_read_req.offset, expected 398373474, is %d", last_msg.msg.fileio_read_req.offset); - - ck_assert_msg(last_msg.msg.fileio_read_req.sequence == 679648290, "incorrect value for last_msg.msg.fileio_read_req.sequence, expected 679648290, is %d", last_msg.msg.fileio_read_req.sequence); + ck_assert_msg(last_msg.msg.fileio_read_req.chunk_size == 53, + "incorrect value for " + "last_msg.msg.fileio_read_req.chunk_size, expected 53, is %d", + last_msg.msg.fileio_read_req.chunk_size); + + ck_assert_msg(sbp_msg_fileio_read_req_filename_encoded_len( + &last_msg.msg.fileio_read_req) == 19, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_fileio_read_req_filename_get( + &last_msg.msg.fileio_read_req), + "/path/to/some/file") == 0, + "String not decoded properly"); + + ck_assert_msg(last_msg.msg.fileio_read_req.offset == 398373474, + "incorrect value for last_msg.msg.fileio_read_req.offset, " + "expected 398373474, is %d", + last_msg.msg.fileio_read_req.offset); + + ck_assert_msg(last_msg.msg.fileio_read_req.sequence == 679648290, + "incorrect value for last_msg.msg.fileio_read_req.sequence, " + "expected 679648290, is %d", + last_msg.msg.fileio_read_req.sequence); } } END_TEST -Suite* auto_check_sbp_file_io_MsgFileioReadReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_file_io_MsgFileioReadReq"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_file_io_MsgFileioReadReq"); +Suite *auto_check_sbp_file_io_MsgFileioReadReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_file_io_MsgFileioReadReq"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_file_io_MsgFileioReadReq"); tcase_add_test(tc_acq, test_auto_check_sbp_file_io_MsgFileioReadReq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_file_io_MsgFileioReadResp.c b/c/test/auto_check_sbp_file_io_MsgFileioReadResp.c index 95692eca7..c85846985 100644 --- a/c/test/auto_check_sbp_file_io_MsgFileioReadResp.c +++ b/c/test/auto_check_sbp_file_io_MsgFileioReadResp.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadResp.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_file_io_MsgFileioReadResp ) -{ +START_TEST(test_auto_check_sbp_file_io_MsgFileioReadResp) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioReadResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,806 +90,1841 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioReadResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xa3, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xa3, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,163,0,195,4,255,67,183,115,15,73,231,227,179,18,76,68,229,216,21,98,183,69,190,5,252,176,55,32,78,8,52,127,50,71,106,61,79,191,106,46,79,118,248,118,207,206,210,91,73,251,81,131,205,193,146,206,185,140,249,163,231,65,67,94,250,109,152,95,123,77,224,124,238,205,65,103,35,104,209,5,191,47,249,176,166,213,46,192,86,32,103,146,252,4,16,54,161,60,6,13,191,116,182,42,191,213,20,217,8,142,187,238,120,184,250,31,151,37,51,177,130,190,155,71,68,56,238,92,130,37,137,146,246,114,116,138,165,217,79,10,189,128,189,2,240,92,28,126,105,236,228,194,0,51,61,74,41,10,239,133,106,190,30,27,3,240,205,253,113,25,28,187,81,101,216,121,41,179,120,152,18,116,53,212,100,2,114,198,200,10,147,25,33,115,208,113,60,179,183,0,41,217,206,255,211,225,142,191,133,81,15,248,193,66,191,244,221,248,199,241,112,51,1,180,180,125,97,145,25,72,210,215,208,15,126,56,38,65,4,64,19,74,223,111,109,52,43,167,186,202,111,11,91,21,236,234,196,36,171,147,10,240, }; + u8 encoded_frame[] = { + 85, 163, 0, 195, 4, 255, 67, 183, 115, 15, 73, 231, 227, 179, + 18, 76, 68, 229, 216, 21, 98, 183, 69, 190, 5, 252, 176, 55, + 32, 78, 8, 52, 127, 50, 71, 106, 61, 79, 191, 106, 46, 79, + 118, 248, 118, 207, 206, 210, 91, 73, 251, 81, 131, 205, 193, 146, + 206, 185, 140, 249, 163, 231, 65, 67, 94, 250, 109, 152, 95, 123, + 77, 224, 124, 238, 205, 65, 103, 35, 104, 209, 5, 191, 47, 249, + 176, 166, 213, 46, 192, 86, 32, 103, 146, 252, 4, 16, 54, 161, + 60, 6, 13, 191, 116, 182, 42, 191, 213, 20, 217, 8, 142, 187, + 238, 120, 184, 250, 31, 151, 37, 51, 177, 130, 190, 155, 71, 68, + 56, 238, 92, 130, 37, 137, 146, 246, 114, 116, 138, 165, 217, 79, + 10, 189, 128, 189, 2, 240, 92, 28, 126, 105, 236, 228, 194, 0, + 51, 61, 74, 41, 10, 239, 133, 106, 190, 30, 27, 3, 240, 205, + 253, 113, 25, 28, 187, 81, 101, 216, 121, 41, 179, 120, 152, 18, + 116, 53, 212, 100, 2, 114, 198, 200, 10, 147, 25, 33, 115, 208, + 113, 60, 179, 183, 0, 41, 217, 206, 255, 211, 225, 142, 191, 133, + 81, 15, 248, 193, 66, 191, 244, 221, 248, 199, 241, 112, 51, 1, + 180, 180, 125, 97, 145, 25, 72, 210, 215, 208, 15, 126, 56, 38, + 65, 4, 64, 19, 74, 223, 111, 109, 52, 43, 167, 186, 202, 111, + 11, 91, 21, 236, 234, 196, 36, 171, 147, 10, 240, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.fileio_read_resp.contents[0] = 73; - + test_msg.fileio_read_resp.contents[1] = 231; - + test_msg.fileio_read_resp.contents[2] = 227; - + test_msg.fileio_read_resp.contents[3] = 179; - + test_msg.fileio_read_resp.contents[4] = 18; - + test_msg.fileio_read_resp.contents[5] = 76; - + test_msg.fileio_read_resp.contents[6] = 68; - + test_msg.fileio_read_resp.contents[7] = 229; - + test_msg.fileio_read_resp.contents[8] = 216; - + test_msg.fileio_read_resp.contents[9] = 21; - + test_msg.fileio_read_resp.contents[10] = 98; - + test_msg.fileio_read_resp.contents[11] = 183; - + test_msg.fileio_read_resp.contents[12] = 69; - + test_msg.fileio_read_resp.contents[13] = 190; - + test_msg.fileio_read_resp.contents[14] = 5; - + test_msg.fileio_read_resp.contents[15] = 252; - + test_msg.fileio_read_resp.contents[16] = 176; - + test_msg.fileio_read_resp.contents[17] = 55; - + test_msg.fileio_read_resp.contents[18] = 32; - + test_msg.fileio_read_resp.contents[19] = 78; - + test_msg.fileio_read_resp.contents[20] = 8; - + test_msg.fileio_read_resp.contents[21] = 52; - + test_msg.fileio_read_resp.contents[22] = 127; - + test_msg.fileio_read_resp.contents[23] = 50; - + test_msg.fileio_read_resp.contents[24] = 71; - + test_msg.fileio_read_resp.contents[25] = 106; - + test_msg.fileio_read_resp.contents[26] = 61; - + test_msg.fileio_read_resp.contents[27] = 79; - + test_msg.fileio_read_resp.contents[28] = 191; - + test_msg.fileio_read_resp.contents[29] = 106; - + test_msg.fileio_read_resp.contents[30] = 46; - + test_msg.fileio_read_resp.contents[31] = 79; - + test_msg.fileio_read_resp.contents[32] = 118; - + test_msg.fileio_read_resp.contents[33] = 248; - + test_msg.fileio_read_resp.contents[34] = 118; - + test_msg.fileio_read_resp.contents[35] = 207; - + test_msg.fileio_read_resp.contents[36] = 206; - + test_msg.fileio_read_resp.contents[37] = 210; - + test_msg.fileio_read_resp.contents[38] = 91; - + test_msg.fileio_read_resp.contents[39] = 73; - + test_msg.fileio_read_resp.contents[40] = 251; - + test_msg.fileio_read_resp.contents[41] = 81; - + test_msg.fileio_read_resp.contents[42] = 131; - + test_msg.fileio_read_resp.contents[43] = 205; - + test_msg.fileio_read_resp.contents[44] = 193; - + test_msg.fileio_read_resp.contents[45] = 146; - + test_msg.fileio_read_resp.contents[46] = 206; - + test_msg.fileio_read_resp.contents[47] = 185; - + test_msg.fileio_read_resp.contents[48] = 140; - + test_msg.fileio_read_resp.contents[49] = 249; - + test_msg.fileio_read_resp.contents[50] = 163; - + test_msg.fileio_read_resp.contents[51] = 231; - + test_msg.fileio_read_resp.contents[52] = 65; - + test_msg.fileio_read_resp.contents[53] = 67; - + test_msg.fileio_read_resp.contents[54] = 94; - + test_msg.fileio_read_resp.contents[55] = 250; - + test_msg.fileio_read_resp.contents[56] = 109; - + test_msg.fileio_read_resp.contents[57] = 152; - + test_msg.fileio_read_resp.contents[58] = 95; - + test_msg.fileio_read_resp.contents[59] = 123; - + test_msg.fileio_read_resp.contents[60] = 77; - + test_msg.fileio_read_resp.contents[61] = 224; - + test_msg.fileio_read_resp.contents[62] = 124; - + test_msg.fileio_read_resp.contents[63] = 238; - + test_msg.fileio_read_resp.contents[64] = 205; - + test_msg.fileio_read_resp.contents[65] = 65; - + test_msg.fileio_read_resp.contents[66] = 103; - + test_msg.fileio_read_resp.contents[67] = 35; - + test_msg.fileio_read_resp.contents[68] = 104; - + test_msg.fileio_read_resp.contents[69] = 209; - + test_msg.fileio_read_resp.contents[70] = 5; - + test_msg.fileio_read_resp.contents[71] = 191; - + test_msg.fileio_read_resp.contents[72] = 47; - + test_msg.fileio_read_resp.contents[73] = 249; - + test_msg.fileio_read_resp.contents[74] = 176; - + test_msg.fileio_read_resp.contents[75] = 166; - + test_msg.fileio_read_resp.contents[76] = 213; - + test_msg.fileio_read_resp.contents[77] = 46; - + test_msg.fileio_read_resp.contents[78] = 192; - + test_msg.fileio_read_resp.contents[79] = 86; - + test_msg.fileio_read_resp.contents[80] = 32; - + test_msg.fileio_read_resp.contents[81] = 103; - + test_msg.fileio_read_resp.contents[82] = 146; - + test_msg.fileio_read_resp.contents[83] = 252; - + test_msg.fileio_read_resp.contents[84] = 4; - + test_msg.fileio_read_resp.contents[85] = 16; - + test_msg.fileio_read_resp.contents[86] = 54; - + test_msg.fileio_read_resp.contents[87] = 161; - + test_msg.fileio_read_resp.contents[88] = 60; - + test_msg.fileio_read_resp.contents[89] = 6; - + test_msg.fileio_read_resp.contents[90] = 13; - + test_msg.fileio_read_resp.contents[91] = 191; - + test_msg.fileio_read_resp.contents[92] = 116; - + test_msg.fileio_read_resp.contents[93] = 182; - + test_msg.fileio_read_resp.contents[94] = 42; - + test_msg.fileio_read_resp.contents[95] = 191; - + test_msg.fileio_read_resp.contents[96] = 213; - + test_msg.fileio_read_resp.contents[97] = 20; - + test_msg.fileio_read_resp.contents[98] = 217; - + test_msg.fileio_read_resp.contents[99] = 8; - + test_msg.fileio_read_resp.contents[100] = 142; - + test_msg.fileio_read_resp.contents[101] = 187; - + test_msg.fileio_read_resp.contents[102] = 238; - + test_msg.fileio_read_resp.contents[103] = 120; - + test_msg.fileio_read_resp.contents[104] = 184; - + test_msg.fileio_read_resp.contents[105] = 250; - + test_msg.fileio_read_resp.contents[106] = 31; - + test_msg.fileio_read_resp.contents[107] = 151; - + test_msg.fileio_read_resp.contents[108] = 37; - + test_msg.fileio_read_resp.contents[109] = 51; - + test_msg.fileio_read_resp.contents[110] = 177; - + test_msg.fileio_read_resp.contents[111] = 130; - + test_msg.fileio_read_resp.contents[112] = 190; - + test_msg.fileio_read_resp.contents[113] = 155; - + test_msg.fileio_read_resp.contents[114] = 71; - + test_msg.fileio_read_resp.contents[115] = 68; - + test_msg.fileio_read_resp.contents[116] = 56; - + test_msg.fileio_read_resp.contents[117] = 238; - + test_msg.fileio_read_resp.contents[118] = 92; - + test_msg.fileio_read_resp.contents[119] = 130; - + test_msg.fileio_read_resp.contents[120] = 37; - + test_msg.fileio_read_resp.contents[121] = 137; - + test_msg.fileio_read_resp.contents[122] = 146; - + test_msg.fileio_read_resp.contents[123] = 246; - + test_msg.fileio_read_resp.contents[124] = 114; - + test_msg.fileio_read_resp.contents[125] = 116; - + test_msg.fileio_read_resp.contents[126] = 138; - + test_msg.fileio_read_resp.contents[127] = 165; - + test_msg.fileio_read_resp.contents[128] = 217; - + test_msg.fileio_read_resp.contents[129] = 79; - + test_msg.fileio_read_resp.contents[130] = 10; - + test_msg.fileio_read_resp.contents[131] = 189; - + test_msg.fileio_read_resp.contents[132] = 128; - + test_msg.fileio_read_resp.contents[133] = 189; - + test_msg.fileio_read_resp.contents[134] = 2; - + test_msg.fileio_read_resp.contents[135] = 240; - + test_msg.fileio_read_resp.contents[136] = 92; - + test_msg.fileio_read_resp.contents[137] = 28; - + test_msg.fileio_read_resp.contents[138] = 126; - + test_msg.fileio_read_resp.contents[139] = 105; - + test_msg.fileio_read_resp.contents[140] = 236; - + test_msg.fileio_read_resp.contents[141] = 228; - + test_msg.fileio_read_resp.contents[142] = 194; - + test_msg.fileio_read_resp.contents[143] = 0; - + test_msg.fileio_read_resp.contents[144] = 51; - + test_msg.fileio_read_resp.contents[145] = 61; - + test_msg.fileio_read_resp.contents[146] = 74; - + test_msg.fileio_read_resp.contents[147] = 41; - + test_msg.fileio_read_resp.contents[148] = 10; - + test_msg.fileio_read_resp.contents[149] = 239; - + test_msg.fileio_read_resp.contents[150] = 133; - + test_msg.fileio_read_resp.contents[151] = 106; - + test_msg.fileio_read_resp.contents[152] = 190; - + test_msg.fileio_read_resp.contents[153] = 30; - + test_msg.fileio_read_resp.contents[154] = 27; - + test_msg.fileio_read_resp.contents[155] = 3; - + test_msg.fileio_read_resp.contents[156] = 240; - + test_msg.fileio_read_resp.contents[157] = 205; - + test_msg.fileio_read_resp.contents[158] = 253; - + test_msg.fileio_read_resp.contents[159] = 113; - + test_msg.fileio_read_resp.contents[160] = 25; - + test_msg.fileio_read_resp.contents[161] = 28; - + test_msg.fileio_read_resp.contents[162] = 187; - + test_msg.fileio_read_resp.contents[163] = 81; - + test_msg.fileio_read_resp.contents[164] = 101; - + test_msg.fileio_read_resp.contents[165] = 216; - + test_msg.fileio_read_resp.contents[166] = 121; - + test_msg.fileio_read_resp.contents[167] = 41; - + test_msg.fileio_read_resp.contents[168] = 179; - + test_msg.fileio_read_resp.contents[169] = 120; - + test_msg.fileio_read_resp.contents[170] = 152; - + test_msg.fileio_read_resp.contents[171] = 18; - + test_msg.fileio_read_resp.contents[172] = 116; - + test_msg.fileio_read_resp.contents[173] = 53; - + test_msg.fileio_read_resp.contents[174] = 212; - + test_msg.fileio_read_resp.contents[175] = 100; - + test_msg.fileio_read_resp.contents[176] = 2; - + test_msg.fileio_read_resp.contents[177] = 114; - + test_msg.fileio_read_resp.contents[178] = 198; - + test_msg.fileio_read_resp.contents[179] = 200; - + test_msg.fileio_read_resp.contents[180] = 10; - + test_msg.fileio_read_resp.contents[181] = 147; - + test_msg.fileio_read_resp.contents[182] = 25; - + test_msg.fileio_read_resp.contents[183] = 33; - + test_msg.fileio_read_resp.contents[184] = 115; - + test_msg.fileio_read_resp.contents[185] = 208; - + test_msg.fileio_read_resp.contents[186] = 113; - + test_msg.fileio_read_resp.contents[187] = 60; - + test_msg.fileio_read_resp.contents[188] = 179; - + test_msg.fileio_read_resp.contents[189] = 183; - + test_msg.fileio_read_resp.contents[190] = 0; - + test_msg.fileio_read_resp.contents[191] = 41; - + test_msg.fileio_read_resp.contents[192] = 217; - + test_msg.fileio_read_resp.contents[193] = 206; - + test_msg.fileio_read_resp.contents[194] = 255; - + test_msg.fileio_read_resp.contents[195] = 211; - + test_msg.fileio_read_resp.contents[196] = 225; - + test_msg.fileio_read_resp.contents[197] = 142; - + test_msg.fileio_read_resp.contents[198] = 191; - + test_msg.fileio_read_resp.contents[199] = 133; - + test_msg.fileio_read_resp.contents[200] = 81; - + test_msg.fileio_read_resp.contents[201] = 15; - + test_msg.fileio_read_resp.contents[202] = 248; - + test_msg.fileio_read_resp.contents[203] = 193; - + test_msg.fileio_read_resp.contents[204] = 66; - + test_msg.fileio_read_resp.contents[205] = 191; - + test_msg.fileio_read_resp.contents[206] = 244; - + test_msg.fileio_read_resp.contents[207] = 221; - + test_msg.fileio_read_resp.contents[208] = 248; - + test_msg.fileio_read_resp.contents[209] = 199; - + test_msg.fileio_read_resp.contents[210] = 241; - + test_msg.fileio_read_resp.contents[211] = 112; - + test_msg.fileio_read_resp.contents[212] = 51; - + test_msg.fileio_read_resp.contents[213] = 1; - + test_msg.fileio_read_resp.contents[214] = 180; - + test_msg.fileio_read_resp.contents[215] = 180; - + test_msg.fileio_read_resp.contents[216] = 125; - + test_msg.fileio_read_resp.contents[217] = 97; - + test_msg.fileio_read_resp.contents[218] = 145; - + test_msg.fileio_read_resp.contents[219] = 25; - + test_msg.fileio_read_resp.contents[220] = 72; - + test_msg.fileio_read_resp.contents[221] = 210; - + test_msg.fileio_read_resp.contents[222] = 215; - + test_msg.fileio_read_resp.contents[223] = 208; - + test_msg.fileio_read_resp.contents[224] = 15; - + test_msg.fileio_read_resp.contents[225] = 126; - + test_msg.fileio_read_resp.contents[226] = 56; - + test_msg.fileio_read_resp.contents[227] = 38; - + test_msg.fileio_read_resp.contents[228] = 65; - + test_msg.fileio_read_resp.contents[229] = 4; - + test_msg.fileio_read_resp.contents[230] = 64; - + test_msg.fileio_read_resp.contents[231] = 19; - + test_msg.fileio_read_resp.contents[232] = 74; - + test_msg.fileio_read_resp.contents[233] = 223; - + test_msg.fileio_read_resp.contents[234] = 111; - + test_msg.fileio_read_resp.contents[235] = 109; - + test_msg.fileio_read_resp.contents[236] = 52; - + test_msg.fileio_read_resp.contents[237] = 43; - + test_msg.fileio_read_resp.contents[238] = 167; - + test_msg.fileio_read_resp.contents[239] = 186; - + test_msg.fileio_read_resp.contents[240] = 202; - + test_msg.fileio_read_resp.contents[241] = 111; - + test_msg.fileio_read_resp.contents[242] = 11; - + test_msg.fileio_read_resp.contents[243] = 91; - + test_msg.fileio_read_resp.contents[244] = 21; - + test_msg.fileio_read_resp.contents[245] = 236; - + test_msg.fileio_read_resp.contents[246] = 234; - + test_msg.fileio_read_resp.contents[247] = 196; - + test_msg.fileio_read_resp.contents[248] = 36; - + test_msg.fileio_read_resp.contents[249] = 171; - + test_msg.fileio_read_resp.contents[250] = 147; - + test_msg.fileio_read_resp.n_contents = 251; - + test_msg.fileio_read_resp.sequence = 259241795; - sbp_message_send(&sbp_state, SbpMsgFileioReadResp, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgFileioReadResp, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgFileioReadResp, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgFileioReadResp, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[0] == 73, "incorrect value for last_msg.msg.fileio_read_resp.contents[0], expected 73, is %d", last_msg.msg.fileio_read_resp.contents[0]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[1] == 231, "incorrect value for last_msg.msg.fileio_read_resp.contents[1], expected 231, is %d", last_msg.msg.fileio_read_resp.contents[1]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[2] == 227, "incorrect value for last_msg.msg.fileio_read_resp.contents[2], expected 227, is %d", last_msg.msg.fileio_read_resp.contents[2]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[3] == 179, "incorrect value for last_msg.msg.fileio_read_resp.contents[3], expected 179, is %d", last_msg.msg.fileio_read_resp.contents[3]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[4] == 18, "incorrect value for last_msg.msg.fileio_read_resp.contents[4], expected 18, is %d", last_msg.msg.fileio_read_resp.contents[4]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[5] == 76, "incorrect value for last_msg.msg.fileio_read_resp.contents[5], expected 76, is %d", last_msg.msg.fileio_read_resp.contents[5]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[6] == 68, "incorrect value for last_msg.msg.fileio_read_resp.contents[6], expected 68, is %d", last_msg.msg.fileio_read_resp.contents[6]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[7] == 229, "incorrect value for last_msg.msg.fileio_read_resp.contents[7], expected 229, is %d", last_msg.msg.fileio_read_resp.contents[7]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[8] == 216, "incorrect value for last_msg.msg.fileio_read_resp.contents[8], expected 216, is %d", last_msg.msg.fileio_read_resp.contents[8]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[9] == 21, "incorrect value for last_msg.msg.fileio_read_resp.contents[9], expected 21, is %d", last_msg.msg.fileio_read_resp.contents[9]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[10] == 98, "incorrect value for last_msg.msg.fileio_read_resp.contents[10], expected 98, is %d", last_msg.msg.fileio_read_resp.contents[10]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[11] == 183, "incorrect value for last_msg.msg.fileio_read_resp.contents[11], expected 183, is %d", last_msg.msg.fileio_read_resp.contents[11]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[12] == 69, "incorrect value for last_msg.msg.fileio_read_resp.contents[12], expected 69, is %d", last_msg.msg.fileio_read_resp.contents[12]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[13] == 190, "incorrect value for last_msg.msg.fileio_read_resp.contents[13], expected 190, is %d", last_msg.msg.fileio_read_resp.contents[13]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[14] == 5, "incorrect value for last_msg.msg.fileio_read_resp.contents[14], expected 5, is %d", last_msg.msg.fileio_read_resp.contents[14]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[15] == 252, "incorrect value for last_msg.msg.fileio_read_resp.contents[15], expected 252, is %d", last_msg.msg.fileio_read_resp.contents[15]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[16] == 176, "incorrect value for last_msg.msg.fileio_read_resp.contents[16], expected 176, is %d", last_msg.msg.fileio_read_resp.contents[16]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[17] == 55, "incorrect value for last_msg.msg.fileio_read_resp.contents[17], expected 55, is %d", last_msg.msg.fileio_read_resp.contents[17]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[18] == 32, "incorrect value for last_msg.msg.fileio_read_resp.contents[18], expected 32, is %d", last_msg.msg.fileio_read_resp.contents[18]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[19] == 78, "incorrect value for last_msg.msg.fileio_read_resp.contents[19], expected 78, is %d", last_msg.msg.fileio_read_resp.contents[19]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[20] == 8, "incorrect value for last_msg.msg.fileio_read_resp.contents[20], expected 8, is %d", last_msg.msg.fileio_read_resp.contents[20]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[21] == 52, "incorrect value for last_msg.msg.fileio_read_resp.contents[21], expected 52, is %d", last_msg.msg.fileio_read_resp.contents[21]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[22] == 127, "incorrect value for last_msg.msg.fileio_read_resp.contents[22], expected 127, is %d", last_msg.msg.fileio_read_resp.contents[22]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[23] == 50, "incorrect value for last_msg.msg.fileio_read_resp.contents[23], expected 50, is %d", last_msg.msg.fileio_read_resp.contents[23]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[24] == 71, "incorrect value for last_msg.msg.fileio_read_resp.contents[24], expected 71, is %d", last_msg.msg.fileio_read_resp.contents[24]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[25] == 106, "incorrect value for last_msg.msg.fileio_read_resp.contents[25], expected 106, is %d", last_msg.msg.fileio_read_resp.contents[25]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[26] == 61, "incorrect value for last_msg.msg.fileio_read_resp.contents[26], expected 61, is %d", last_msg.msg.fileio_read_resp.contents[26]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[27] == 79, "incorrect value for last_msg.msg.fileio_read_resp.contents[27], expected 79, is %d", last_msg.msg.fileio_read_resp.contents[27]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[28] == 191, "incorrect value for last_msg.msg.fileio_read_resp.contents[28], expected 191, is %d", last_msg.msg.fileio_read_resp.contents[28]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[29] == 106, "incorrect value for last_msg.msg.fileio_read_resp.contents[29], expected 106, is %d", last_msg.msg.fileio_read_resp.contents[29]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[30] == 46, "incorrect value for last_msg.msg.fileio_read_resp.contents[30], expected 46, is %d", last_msg.msg.fileio_read_resp.contents[30]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[31] == 79, "incorrect value for last_msg.msg.fileio_read_resp.contents[31], expected 79, is %d", last_msg.msg.fileio_read_resp.contents[31]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[32] == 118, "incorrect value for last_msg.msg.fileio_read_resp.contents[32], expected 118, is %d", last_msg.msg.fileio_read_resp.contents[32]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[33] == 248, "incorrect value for last_msg.msg.fileio_read_resp.contents[33], expected 248, is %d", last_msg.msg.fileio_read_resp.contents[33]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[34] == 118, "incorrect value for last_msg.msg.fileio_read_resp.contents[34], expected 118, is %d", last_msg.msg.fileio_read_resp.contents[34]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[35] == 207, "incorrect value for last_msg.msg.fileio_read_resp.contents[35], expected 207, is %d", last_msg.msg.fileio_read_resp.contents[35]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[36] == 206, "incorrect value for last_msg.msg.fileio_read_resp.contents[36], expected 206, is %d", last_msg.msg.fileio_read_resp.contents[36]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[37] == 210, "incorrect value for last_msg.msg.fileio_read_resp.contents[37], expected 210, is %d", last_msg.msg.fileio_read_resp.contents[37]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[38] == 91, "incorrect value for last_msg.msg.fileio_read_resp.contents[38], expected 91, is %d", last_msg.msg.fileio_read_resp.contents[38]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[39] == 73, "incorrect value for last_msg.msg.fileio_read_resp.contents[39], expected 73, is %d", last_msg.msg.fileio_read_resp.contents[39]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[40] == 251, "incorrect value for last_msg.msg.fileio_read_resp.contents[40], expected 251, is %d", last_msg.msg.fileio_read_resp.contents[40]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[41] == 81, "incorrect value for last_msg.msg.fileio_read_resp.contents[41], expected 81, is %d", last_msg.msg.fileio_read_resp.contents[41]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[42] == 131, "incorrect value for last_msg.msg.fileio_read_resp.contents[42], expected 131, is %d", last_msg.msg.fileio_read_resp.contents[42]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[43] == 205, "incorrect value for last_msg.msg.fileio_read_resp.contents[43], expected 205, is %d", last_msg.msg.fileio_read_resp.contents[43]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[44] == 193, "incorrect value for last_msg.msg.fileio_read_resp.contents[44], expected 193, is %d", last_msg.msg.fileio_read_resp.contents[44]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[45] == 146, "incorrect value for last_msg.msg.fileio_read_resp.contents[45], expected 146, is %d", last_msg.msg.fileio_read_resp.contents[45]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[46] == 206, "incorrect value for last_msg.msg.fileio_read_resp.contents[46], expected 206, is %d", last_msg.msg.fileio_read_resp.contents[46]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[47] == 185, "incorrect value for last_msg.msg.fileio_read_resp.contents[47], expected 185, is %d", last_msg.msg.fileio_read_resp.contents[47]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[48] == 140, "incorrect value for last_msg.msg.fileio_read_resp.contents[48], expected 140, is %d", last_msg.msg.fileio_read_resp.contents[48]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[49] == 249, "incorrect value for last_msg.msg.fileio_read_resp.contents[49], expected 249, is %d", last_msg.msg.fileio_read_resp.contents[49]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[50] == 163, "incorrect value for last_msg.msg.fileio_read_resp.contents[50], expected 163, is %d", last_msg.msg.fileio_read_resp.contents[50]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[51] == 231, "incorrect value for last_msg.msg.fileio_read_resp.contents[51], expected 231, is %d", last_msg.msg.fileio_read_resp.contents[51]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[52] == 65, "incorrect value for last_msg.msg.fileio_read_resp.contents[52], expected 65, is %d", last_msg.msg.fileio_read_resp.contents[52]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[53] == 67, "incorrect value for last_msg.msg.fileio_read_resp.contents[53], expected 67, is %d", last_msg.msg.fileio_read_resp.contents[53]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[54] == 94, "incorrect value for last_msg.msg.fileio_read_resp.contents[54], expected 94, is %d", last_msg.msg.fileio_read_resp.contents[54]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[55] == 250, "incorrect value for last_msg.msg.fileio_read_resp.contents[55], expected 250, is %d", last_msg.msg.fileio_read_resp.contents[55]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[56] == 109, "incorrect value for last_msg.msg.fileio_read_resp.contents[56], expected 109, is %d", last_msg.msg.fileio_read_resp.contents[56]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[57] == 152, "incorrect value for last_msg.msg.fileio_read_resp.contents[57], expected 152, is %d", last_msg.msg.fileio_read_resp.contents[57]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[58] == 95, "incorrect value for last_msg.msg.fileio_read_resp.contents[58], expected 95, is %d", last_msg.msg.fileio_read_resp.contents[58]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[59] == 123, "incorrect value for last_msg.msg.fileio_read_resp.contents[59], expected 123, is %d", last_msg.msg.fileio_read_resp.contents[59]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[60] == 77, "incorrect value for last_msg.msg.fileio_read_resp.contents[60], expected 77, is %d", last_msg.msg.fileio_read_resp.contents[60]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[61] == 224, "incorrect value for last_msg.msg.fileio_read_resp.contents[61], expected 224, is %d", last_msg.msg.fileio_read_resp.contents[61]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[62] == 124, "incorrect value for last_msg.msg.fileio_read_resp.contents[62], expected 124, is %d", last_msg.msg.fileio_read_resp.contents[62]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[63] == 238, "incorrect value for last_msg.msg.fileio_read_resp.contents[63], expected 238, is %d", last_msg.msg.fileio_read_resp.contents[63]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[64] == 205, "incorrect value for last_msg.msg.fileio_read_resp.contents[64], expected 205, is %d", last_msg.msg.fileio_read_resp.contents[64]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[65] == 65, "incorrect value for last_msg.msg.fileio_read_resp.contents[65], expected 65, is %d", last_msg.msg.fileio_read_resp.contents[65]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[66] == 103, "incorrect value for last_msg.msg.fileio_read_resp.contents[66], expected 103, is %d", last_msg.msg.fileio_read_resp.contents[66]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[67] == 35, "incorrect value for last_msg.msg.fileio_read_resp.contents[67], expected 35, is %d", last_msg.msg.fileio_read_resp.contents[67]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[68] == 104, "incorrect value for last_msg.msg.fileio_read_resp.contents[68], expected 104, is %d", last_msg.msg.fileio_read_resp.contents[68]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[69] == 209, "incorrect value for last_msg.msg.fileio_read_resp.contents[69], expected 209, is %d", last_msg.msg.fileio_read_resp.contents[69]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[70] == 5, "incorrect value for last_msg.msg.fileio_read_resp.contents[70], expected 5, is %d", last_msg.msg.fileio_read_resp.contents[70]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[71] == 191, "incorrect value for last_msg.msg.fileio_read_resp.contents[71], expected 191, is %d", last_msg.msg.fileio_read_resp.contents[71]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[72] == 47, "incorrect value for last_msg.msg.fileio_read_resp.contents[72], expected 47, is %d", last_msg.msg.fileio_read_resp.contents[72]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[73] == 249, "incorrect value for last_msg.msg.fileio_read_resp.contents[73], expected 249, is %d", last_msg.msg.fileio_read_resp.contents[73]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[74] == 176, "incorrect value for last_msg.msg.fileio_read_resp.contents[74], expected 176, is %d", last_msg.msg.fileio_read_resp.contents[74]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[75] == 166, "incorrect value for last_msg.msg.fileio_read_resp.contents[75], expected 166, is %d", last_msg.msg.fileio_read_resp.contents[75]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[76] == 213, "incorrect value for last_msg.msg.fileio_read_resp.contents[76], expected 213, is %d", last_msg.msg.fileio_read_resp.contents[76]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[77] == 46, "incorrect value for last_msg.msg.fileio_read_resp.contents[77], expected 46, is %d", last_msg.msg.fileio_read_resp.contents[77]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[78] == 192, "incorrect value for last_msg.msg.fileio_read_resp.contents[78], expected 192, is %d", last_msg.msg.fileio_read_resp.contents[78]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[79] == 86, "incorrect value for last_msg.msg.fileio_read_resp.contents[79], expected 86, is %d", last_msg.msg.fileio_read_resp.contents[79]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[80] == 32, "incorrect value for last_msg.msg.fileio_read_resp.contents[80], expected 32, is %d", last_msg.msg.fileio_read_resp.contents[80]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[81] == 103, "incorrect value for last_msg.msg.fileio_read_resp.contents[81], expected 103, is %d", last_msg.msg.fileio_read_resp.contents[81]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[82] == 146, "incorrect value for last_msg.msg.fileio_read_resp.contents[82], expected 146, is %d", last_msg.msg.fileio_read_resp.contents[82]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[83] == 252, "incorrect value for last_msg.msg.fileio_read_resp.contents[83], expected 252, is %d", last_msg.msg.fileio_read_resp.contents[83]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[84] == 4, "incorrect value for last_msg.msg.fileio_read_resp.contents[84], expected 4, is %d", last_msg.msg.fileio_read_resp.contents[84]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[85] == 16, "incorrect value for last_msg.msg.fileio_read_resp.contents[85], expected 16, is %d", last_msg.msg.fileio_read_resp.contents[85]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[86] == 54, "incorrect value for last_msg.msg.fileio_read_resp.contents[86], expected 54, is %d", last_msg.msg.fileio_read_resp.contents[86]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[87] == 161, "incorrect value for last_msg.msg.fileio_read_resp.contents[87], expected 161, is %d", last_msg.msg.fileio_read_resp.contents[87]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[88] == 60, "incorrect value for last_msg.msg.fileio_read_resp.contents[88], expected 60, is %d", last_msg.msg.fileio_read_resp.contents[88]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[89] == 6, "incorrect value for last_msg.msg.fileio_read_resp.contents[89], expected 6, is %d", last_msg.msg.fileio_read_resp.contents[89]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[90] == 13, "incorrect value for last_msg.msg.fileio_read_resp.contents[90], expected 13, is %d", last_msg.msg.fileio_read_resp.contents[90]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[91] == 191, "incorrect value for last_msg.msg.fileio_read_resp.contents[91], expected 191, is %d", last_msg.msg.fileio_read_resp.contents[91]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[92] == 116, "incorrect value for last_msg.msg.fileio_read_resp.contents[92], expected 116, is %d", last_msg.msg.fileio_read_resp.contents[92]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[93] == 182, "incorrect value for last_msg.msg.fileio_read_resp.contents[93], expected 182, is %d", last_msg.msg.fileio_read_resp.contents[93]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[94] == 42, "incorrect value for last_msg.msg.fileio_read_resp.contents[94], expected 42, is %d", last_msg.msg.fileio_read_resp.contents[94]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[95] == 191, "incorrect value for last_msg.msg.fileio_read_resp.contents[95], expected 191, is %d", last_msg.msg.fileio_read_resp.contents[95]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[96] == 213, "incorrect value for last_msg.msg.fileio_read_resp.contents[96], expected 213, is %d", last_msg.msg.fileio_read_resp.contents[96]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[97] == 20, "incorrect value for last_msg.msg.fileio_read_resp.contents[97], expected 20, is %d", last_msg.msg.fileio_read_resp.contents[97]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[98] == 217, "incorrect value for last_msg.msg.fileio_read_resp.contents[98], expected 217, is %d", last_msg.msg.fileio_read_resp.contents[98]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[99] == 8, "incorrect value for last_msg.msg.fileio_read_resp.contents[99], expected 8, is %d", last_msg.msg.fileio_read_resp.contents[99]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[100] == 142, "incorrect value for last_msg.msg.fileio_read_resp.contents[100], expected 142, is %d", last_msg.msg.fileio_read_resp.contents[100]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[101] == 187, "incorrect value for last_msg.msg.fileio_read_resp.contents[101], expected 187, is %d", last_msg.msg.fileio_read_resp.contents[101]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[102] == 238, "incorrect value for last_msg.msg.fileio_read_resp.contents[102], expected 238, is %d", last_msg.msg.fileio_read_resp.contents[102]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[103] == 120, "incorrect value for last_msg.msg.fileio_read_resp.contents[103], expected 120, is %d", last_msg.msg.fileio_read_resp.contents[103]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[104] == 184, "incorrect value for last_msg.msg.fileio_read_resp.contents[104], expected 184, is %d", last_msg.msg.fileio_read_resp.contents[104]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[105] == 250, "incorrect value for last_msg.msg.fileio_read_resp.contents[105], expected 250, is %d", last_msg.msg.fileio_read_resp.contents[105]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[106] == 31, "incorrect value for last_msg.msg.fileio_read_resp.contents[106], expected 31, is %d", last_msg.msg.fileio_read_resp.contents[106]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[107] == 151, "incorrect value for last_msg.msg.fileio_read_resp.contents[107], expected 151, is %d", last_msg.msg.fileio_read_resp.contents[107]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[108] == 37, "incorrect value for last_msg.msg.fileio_read_resp.contents[108], expected 37, is %d", last_msg.msg.fileio_read_resp.contents[108]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[109] == 51, "incorrect value for last_msg.msg.fileio_read_resp.contents[109], expected 51, is %d", last_msg.msg.fileio_read_resp.contents[109]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[110] == 177, "incorrect value for last_msg.msg.fileio_read_resp.contents[110], expected 177, is %d", last_msg.msg.fileio_read_resp.contents[110]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[111] == 130, "incorrect value for last_msg.msg.fileio_read_resp.contents[111], expected 130, is %d", last_msg.msg.fileio_read_resp.contents[111]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[112] == 190, "incorrect value for last_msg.msg.fileio_read_resp.contents[112], expected 190, is %d", last_msg.msg.fileio_read_resp.contents[112]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[113] == 155, "incorrect value for last_msg.msg.fileio_read_resp.contents[113], expected 155, is %d", last_msg.msg.fileio_read_resp.contents[113]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[114] == 71, "incorrect value for last_msg.msg.fileio_read_resp.contents[114], expected 71, is %d", last_msg.msg.fileio_read_resp.contents[114]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[115] == 68, "incorrect value for last_msg.msg.fileio_read_resp.contents[115], expected 68, is %d", last_msg.msg.fileio_read_resp.contents[115]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[116] == 56, "incorrect value for last_msg.msg.fileio_read_resp.contents[116], expected 56, is %d", last_msg.msg.fileio_read_resp.contents[116]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[117] == 238, "incorrect value for last_msg.msg.fileio_read_resp.contents[117], expected 238, is %d", last_msg.msg.fileio_read_resp.contents[117]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[118] == 92, "incorrect value for last_msg.msg.fileio_read_resp.contents[118], expected 92, is %d", last_msg.msg.fileio_read_resp.contents[118]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[119] == 130, "incorrect value for last_msg.msg.fileio_read_resp.contents[119], expected 130, is %d", last_msg.msg.fileio_read_resp.contents[119]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[120] == 37, "incorrect value for last_msg.msg.fileio_read_resp.contents[120], expected 37, is %d", last_msg.msg.fileio_read_resp.contents[120]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[121] == 137, "incorrect value for last_msg.msg.fileio_read_resp.contents[121], expected 137, is %d", last_msg.msg.fileio_read_resp.contents[121]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[122] == 146, "incorrect value for last_msg.msg.fileio_read_resp.contents[122], expected 146, is %d", last_msg.msg.fileio_read_resp.contents[122]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[123] == 246, "incorrect value for last_msg.msg.fileio_read_resp.contents[123], expected 246, is %d", last_msg.msg.fileio_read_resp.contents[123]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[124] == 114, "incorrect value for last_msg.msg.fileio_read_resp.contents[124], expected 114, is %d", last_msg.msg.fileio_read_resp.contents[124]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[125] == 116, "incorrect value for last_msg.msg.fileio_read_resp.contents[125], expected 116, is %d", last_msg.msg.fileio_read_resp.contents[125]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[126] == 138, "incorrect value for last_msg.msg.fileio_read_resp.contents[126], expected 138, is %d", last_msg.msg.fileio_read_resp.contents[126]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[127] == 165, "incorrect value for last_msg.msg.fileio_read_resp.contents[127], expected 165, is %d", last_msg.msg.fileio_read_resp.contents[127]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[128] == 217, "incorrect value for last_msg.msg.fileio_read_resp.contents[128], expected 217, is %d", last_msg.msg.fileio_read_resp.contents[128]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[129] == 79, "incorrect value for last_msg.msg.fileio_read_resp.contents[129], expected 79, is %d", last_msg.msg.fileio_read_resp.contents[129]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[130] == 10, "incorrect value for last_msg.msg.fileio_read_resp.contents[130], expected 10, is %d", last_msg.msg.fileio_read_resp.contents[130]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[131] == 189, "incorrect value for last_msg.msg.fileio_read_resp.contents[131], expected 189, is %d", last_msg.msg.fileio_read_resp.contents[131]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[132] == 128, "incorrect value for last_msg.msg.fileio_read_resp.contents[132], expected 128, is %d", last_msg.msg.fileio_read_resp.contents[132]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[133] == 189, "incorrect value for last_msg.msg.fileio_read_resp.contents[133], expected 189, is %d", last_msg.msg.fileio_read_resp.contents[133]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[134] == 2, "incorrect value for last_msg.msg.fileio_read_resp.contents[134], expected 2, is %d", last_msg.msg.fileio_read_resp.contents[134]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[135] == 240, "incorrect value for last_msg.msg.fileio_read_resp.contents[135], expected 240, is %d", last_msg.msg.fileio_read_resp.contents[135]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[136] == 92, "incorrect value for last_msg.msg.fileio_read_resp.contents[136], expected 92, is %d", last_msg.msg.fileio_read_resp.contents[136]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[137] == 28, "incorrect value for last_msg.msg.fileio_read_resp.contents[137], expected 28, is %d", last_msg.msg.fileio_read_resp.contents[137]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[138] == 126, "incorrect value for last_msg.msg.fileio_read_resp.contents[138], expected 126, is %d", last_msg.msg.fileio_read_resp.contents[138]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[139] == 105, "incorrect value for last_msg.msg.fileio_read_resp.contents[139], expected 105, is %d", last_msg.msg.fileio_read_resp.contents[139]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[140] == 236, "incorrect value for last_msg.msg.fileio_read_resp.contents[140], expected 236, is %d", last_msg.msg.fileio_read_resp.contents[140]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[141] == 228, "incorrect value for last_msg.msg.fileio_read_resp.contents[141], expected 228, is %d", last_msg.msg.fileio_read_resp.contents[141]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[142] == 194, "incorrect value for last_msg.msg.fileio_read_resp.contents[142], expected 194, is %d", last_msg.msg.fileio_read_resp.contents[142]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[143] == 0, "incorrect value for last_msg.msg.fileio_read_resp.contents[143], expected 0, is %d", last_msg.msg.fileio_read_resp.contents[143]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[144] == 51, "incorrect value for last_msg.msg.fileio_read_resp.contents[144], expected 51, is %d", last_msg.msg.fileio_read_resp.contents[144]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[145] == 61, "incorrect value for last_msg.msg.fileio_read_resp.contents[145], expected 61, is %d", last_msg.msg.fileio_read_resp.contents[145]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[146] == 74, "incorrect value for last_msg.msg.fileio_read_resp.contents[146], expected 74, is %d", last_msg.msg.fileio_read_resp.contents[146]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[147] == 41, "incorrect value for last_msg.msg.fileio_read_resp.contents[147], expected 41, is %d", last_msg.msg.fileio_read_resp.contents[147]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[148] == 10, "incorrect value for last_msg.msg.fileio_read_resp.contents[148], expected 10, is %d", last_msg.msg.fileio_read_resp.contents[148]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[149] == 239, "incorrect value for last_msg.msg.fileio_read_resp.contents[149], expected 239, is %d", last_msg.msg.fileio_read_resp.contents[149]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[150] == 133, "incorrect value for last_msg.msg.fileio_read_resp.contents[150], expected 133, is %d", last_msg.msg.fileio_read_resp.contents[150]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[151] == 106, "incorrect value for last_msg.msg.fileio_read_resp.contents[151], expected 106, is %d", last_msg.msg.fileio_read_resp.contents[151]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[152] == 190, "incorrect value for last_msg.msg.fileio_read_resp.contents[152], expected 190, is %d", last_msg.msg.fileio_read_resp.contents[152]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[153] == 30, "incorrect value for last_msg.msg.fileio_read_resp.contents[153], expected 30, is %d", last_msg.msg.fileio_read_resp.contents[153]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[154] == 27, "incorrect value for last_msg.msg.fileio_read_resp.contents[154], expected 27, is %d", last_msg.msg.fileio_read_resp.contents[154]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[155] == 3, "incorrect value for last_msg.msg.fileio_read_resp.contents[155], expected 3, is %d", last_msg.msg.fileio_read_resp.contents[155]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[156] == 240, "incorrect value for last_msg.msg.fileio_read_resp.contents[156], expected 240, is %d", last_msg.msg.fileio_read_resp.contents[156]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[157] == 205, "incorrect value for last_msg.msg.fileio_read_resp.contents[157], expected 205, is %d", last_msg.msg.fileio_read_resp.contents[157]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[158] == 253, "incorrect value for last_msg.msg.fileio_read_resp.contents[158], expected 253, is %d", last_msg.msg.fileio_read_resp.contents[158]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[159] == 113, "incorrect value for last_msg.msg.fileio_read_resp.contents[159], expected 113, is %d", last_msg.msg.fileio_read_resp.contents[159]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[160] == 25, "incorrect value for last_msg.msg.fileio_read_resp.contents[160], expected 25, is %d", last_msg.msg.fileio_read_resp.contents[160]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[161] == 28, "incorrect value for last_msg.msg.fileio_read_resp.contents[161], expected 28, is %d", last_msg.msg.fileio_read_resp.contents[161]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[162] == 187, "incorrect value for last_msg.msg.fileio_read_resp.contents[162], expected 187, is %d", last_msg.msg.fileio_read_resp.contents[162]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[163] == 81, "incorrect value for last_msg.msg.fileio_read_resp.contents[163], expected 81, is %d", last_msg.msg.fileio_read_resp.contents[163]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[164] == 101, "incorrect value for last_msg.msg.fileio_read_resp.contents[164], expected 101, is %d", last_msg.msg.fileio_read_resp.contents[164]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[165] == 216, "incorrect value for last_msg.msg.fileio_read_resp.contents[165], expected 216, is %d", last_msg.msg.fileio_read_resp.contents[165]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[166] == 121, "incorrect value for last_msg.msg.fileio_read_resp.contents[166], expected 121, is %d", last_msg.msg.fileio_read_resp.contents[166]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[167] == 41, "incorrect value for last_msg.msg.fileio_read_resp.contents[167], expected 41, is %d", last_msg.msg.fileio_read_resp.contents[167]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[168] == 179, "incorrect value for last_msg.msg.fileio_read_resp.contents[168], expected 179, is %d", last_msg.msg.fileio_read_resp.contents[168]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[169] == 120, "incorrect value for last_msg.msg.fileio_read_resp.contents[169], expected 120, is %d", last_msg.msg.fileio_read_resp.contents[169]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[170] == 152, "incorrect value for last_msg.msg.fileio_read_resp.contents[170], expected 152, is %d", last_msg.msg.fileio_read_resp.contents[170]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[171] == 18, "incorrect value for last_msg.msg.fileio_read_resp.contents[171], expected 18, is %d", last_msg.msg.fileio_read_resp.contents[171]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[172] == 116, "incorrect value for last_msg.msg.fileio_read_resp.contents[172], expected 116, is %d", last_msg.msg.fileio_read_resp.contents[172]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[173] == 53, "incorrect value for last_msg.msg.fileio_read_resp.contents[173], expected 53, is %d", last_msg.msg.fileio_read_resp.contents[173]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[174] == 212, "incorrect value for last_msg.msg.fileio_read_resp.contents[174], expected 212, is %d", last_msg.msg.fileio_read_resp.contents[174]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[175] == 100, "incorrect value for last_msg.msg.fileio_read_resp.contents[175], expected 100, is %d", last_msg.msg.fileio_read_resp.contents[175]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[176] == 2, "incorrect value for last_msg.msg.fileio_read_resp.contents[176], expected 2, is %d", last_msg.msg.fileio_read_resp.contents[176]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[177] == 114, "incorrect value for last_msg.msg.fileio_read_resp.contents[177], expected 114, is %d", last_msg.msg.fileio_read_resp.contents[177]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[178] == 198, "incorrect value for last_msg.msg.fileio_read_resp.contents[178], expected 198, is %d", last_msg.msg.fileio_read_resp.contents[178]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[179] == 200, "incorrect value for last_msg.msg.fileio_read_resp.contents[179], expected 200, is %d", last_msg.msg.fileio_read_resp.contents[179]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[180] == 10, "incorrect value for last_msg.msg.fileio_read_resp.contents[180], expected 10, is %d", last_msg.msg.fileio_read_resp.contents[180]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[181] == 147, "incorrect value for last_msg.msg.fileio_read_resp.contents[181], expected 147, is %d", last_msg.msg.fileio_read_resp.contents[181]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[182] == 25, "incorrect value for last_msg.msg.fileio_read_resp.contents[182], expected 25, is %d", last_msg.msg.fileio_read_resp.contents[182]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[183] == 33, "incorrect value for last_msg.msg.fileio_read_resp.contents[183], expected 33, is %d", last_msg.msg.fileio_read_resp.contents[183]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[184] == 115, "incorrect value for last_msg.msg.fileio_read_resp.contents[184], expected 115, is %d", last_msg.msg.fileio_read_resp.contents[184]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[185] == 208, "incorrect value for last_msg.msg.fileio_read_resp.contents[185], expected 208, is %d", last_msg.msg.fileio_read_resp.contents[185]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[186] == 113, "incorrect value for last_msg.msg.fileio_read_resp.contents[186], expected 113, is %d", last_msg.msg.fileio_read_resp.contents[186]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[187] == 60, "incorrect value for last_msg.msg.fileio_read_resp.contents[187], expected 60, is %d", last_msg.msg.fileio_read_resp.contents[187]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[188] == 179, "incorrect value for last_msg.msg.fileio_read_resp.contents[188], expected 179, is %d", last_msg.msg.fileio_read_resp.contents[188]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[189] == 183, "incorrect value for last_msg.msg.fileio_read_resp.contents[189], expected 183, is %d", last_msg.msg.fileio_read_resp.contents[189]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[190] == 0, "incorrect value for last_msg.msg.fileio_read_resp.contents[190], expected 0, is %d", last_msg.msg.fileio_read_resp.contents[190]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[191] == 41, "incorrect value for last_msg.msg.fileio_read_resp.contents[191], expected 41, is %d", last_msg.msg.fileio_read_resp.contents[191]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[192] == 217, "incorrect value for last_msg.msg.fileio_read_resp.contents[192], expected 217, is %d", last_msg.msg.fileio_read_resp.contents[192]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[193] == 206, "incorrect value for last_msg.msg.fileio_read_resp.contents[193], expected 206, is %d", last_msg.msg.fileio_read_resp.contents[193]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[194] == 255, "incorrect value for last_msg.msg.fileio_read_resp.contents[194], expected 255, is %d", last_msg.msg.fileio_read_resp.contents[194]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[195] == 211, "incorrect value for last_msg.msg.fileio_read_resp.contents[195], expected 211, is %d", last_msg.msg.fileio_read_resp.contents[195]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[196] == 225, "incorrect value for last_msg.msg.fileio_read_resp.contents[196], expected 225, is %d", last_msg.msg.fileio_read_resp.contents[196]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[197] == 142, "incorrect value for last_msg.msg.fileio_read_resp.contents[197], expected 142, is %d", last_msg.msg.fileio_read_resp.contents[197]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[198] == 191, "incorrect value for last_msg.msg.fileio_read_resp.contents[198], expected 191, is %d", last_msg.msg.fileio_read_resp.contents[198]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[199] == 133, "incorrect value for last_msg.msg.fileio_read_resp.contents[199], expected 133, is %d", last_msg.msg.fileio_read_resp.contents[199]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[200] == 81, "incorrect value for last_msg.msg.fileio_read_resp.contents[200], expected 81, is %d", last_msg.msg.fileio_read_resp.contents[200]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[201] == 15, "incorrect value for last_msg.msg.fileio_read_resp.contents[201], expected 15, is %d", last_msg.msg.fileio_read_resp.contents[201]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[202] == 248, "incorrect value for last_msg.msg.fileio_read_resp.contents[202], expected 248, is %d", last_msg.msg.fileio_read_resp.contents[202]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[203] == 193, "incorrect value for last_msg.msg.fileio_read_resp.contents[203], expected 193, is %d", last_msg.msg.fileio_read_resp.contents[203]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[204] == 66, "incorrect value for last_msg.msg.fileio_read_resp.contents[204], expected 66, is %d", last_msg.msg.fileio_read_resp.contents[204]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[205] == 191, "incorrect value for last_msg.msg.fileio_read_resp.contents[205], expected 191, is %d", last_msg.msg.fileio_read_resp.contents[205]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[206] == 244, "incorrect value for last_msg.msg.fileio_read_resp.contents[206], expected 244, is %d", last_msg.msg.fileio_read_resp.contents[206]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[207] == 221, "incorrect value for last_msg.msg.fileio_read_resp.contents[207], expected 221, is %d", last_msg.msg.fileio_read_resp.contents[207]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[208] == 248, "incorrect value for last_msg.msg.fileio_read_resp.contents[208], expected 248, is %d", last_msg.msg.fileio_read_resp.contents[208]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[209] == 199, "incorrect value for last_msg.msg.fileio_read_resp.contents[209], expected 199, is %d", last_msg.msg.fileio_read_resp.contents[209]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[210] == 241, "incorrect value for last_msg.msg.fileio_read_resp.contents[210], expected 241, is %d", last_msg.msg.fileio_read_resp.contents[210]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[211] == 112, "incorrect value for last_msg.msg.fileio_read_resp.contents[211], expected 112, is %d", last_msg.msg.fileio_read_resp.contents[211]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[212] == 51, "incorrect value for last_msg.msg.fileio_read_resp.contents[212], expected 51, is %d", last_msg.msg.fileio_read_resp.contents[212]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[213] == 1, "incorrect value for last_msg.msg.fileio_read_resp.contents[213], expected 1, is %d", last_msg.msg.fileio_read_resp.contents[213]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[214] == 180, "incorrect value for last_msg.msg.fileio_read_resp.contents[214], expected 180, is %d", last_msg.msg.fileio_read_resp.contents[214]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[215] == 180, "incorrect value for last_msg.msg.fileio_read_resp.contents[215], expected 180, is %d", last_msg.msg.fileio_read_resp.contents[215]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[216] == 125, "incorrect value for last_msg.msg.fileio_read_resp.contents[216], expected 125, is %d", last_msg.msg.fileio_read_resp.contents[216]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[217] == 97, "incorrect value for last_msg.msg.fileio_read_resp.contents[217], expected 97, is %d", last_msg.msg.fileio_read_resp.contents[217]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[218] == 145, "incorrect value for last_msg.msg.fileio_read_resp.contents[218], expected 145, is %d", last_msg.msg.fileio_read_resp.contents[218]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[219] == 25, "incorrect value for last_msg.msg.fileio_read_resp.contents[219], expected 25, is %d", last_msg.msg.fileio_read_resp.contents[219]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[220] == 72, "incorrect value for last_msg.msg.fileio_read_resp.contents[220], expected 72, is %d", last_msg.msg.fileio_read_resp.contents[220]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[221] == 210, "incorrect value for last_msg.msg.fileio_read_resp.contents[221], expected 210, is %d", last_msg.msg.fileio_read_resp.contents[221]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[222] == 215, "incorrect value for last_msg.msg.fileio_read_resp.contents[222], expected 215, is %d", last_msg.msg.fileio_read_resp.contents[222]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[223] == 208, "incorrect value for last_msg.msg.fileio_read_resp.contents[223], expected 208, is %d", last_msg.msg.fileio_read_resp.contents[223]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[224] == 15, "incorrect value for last_msg.msg.fileio_read_resp.contents[224], expected 15, is %d", last_msg.msg.fileio_read_resp.contents[224]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[225] == 126, "incorrect value for last_msg.msg.fileio_read_resp.contents[225], expected 126, is %d", last_msg.msg.fileio_read_resp.contents[225]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[226] == 56, "incorrect value for last_msg.msg.fileio_read_resp.contents[226], expected 56, is %d", last_msg.msg.fileio_read_resp.contents[226]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[227] == 38, "incorrect value for last_msg.msg.fileio_read_resp.contents[227], expected 38, is %d", last_msg.msg.fileio_read_resp.contents[227]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[228] == 65, "incorrect value for last_msg.msg.fileio_read_resp.contents[228], expected 65, is %d", last_msg.msg.fileio_read_resp.contents[228]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[229] == 4, "incorrect value for last_msg.msg.fileio_read_resp.contents[229], expected 4, is %d", last_msg.msg.fileio_read_resp.contents[229]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[230] == 64, "incorrect value for last_msg.msg.fileio_read_resp.contents[230], expected 64, is %d", last_msg.msg.fileio_read_resp.contents[230]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[231] == 19, "incorrect value for last_msg.msg.fileio_read_resp.contents[231], expected 19, is %d", last_msg.msg.fileio_read_resp.contents[231]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[232] == 74, "incorrect value for last_msg.msg.fileio_read_resp.contents[232], expected 74, is %d", last_msg.msg.fileio_read_resp.contents[232]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[233] == 223, "incorrect value for last_msg.msg.fileio_read_resp.contents[233], expected 223, is %d", last_msg.msg.fileio_read_resp.contents[233]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[234] == 111, "incorrect value for last_msg.msg.fileio_read_resp.contents[234], expected 111, is %d", last_msg.msg.fileio_read_resp.contents[234]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[235] == 109, "incorrect value for last_msg.msg.fileio_read_resp.contents[235], expected 109, is %d", last_msg.msg.fileio_read_resp.contents[235]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[236] == 52, "incorrect value for last_msg.msg.fileio_read_resp.contents[236], expected 52, is %d", last_msg.msg.fileio_read_resp.contents[236]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[237] == 43, "incorrect value for last_msg.msg.fileio_read_resp.contents[237], expected 43, is %d", last_msg.msg.fileio_read_resp.contents[237]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[238] == 167, "incorrect value for last_msg.msg.fileio_read_resp.contents[238], expected 167, is %d", last_msg.msg.fileio_read_resp.contents[238]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[239] == 186, "incorrect value for last_msg.msg.fileio_read_resp.contents[239], expected 186, is %d", last_msg.msg.fileio_read_resp.contents[239]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[240] == 202, "incorrect value for last_msg.msg.fileio_read_resp.contents[240], expected 202, is %d", last_msg.msg.fileio_read_resp.contents[240]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[241] == 111, "incorrect value for last_msg.msg.fileio_read_resp.contents[241], expected 111, is %d", last_msg.msg.fileio_read_resp.contents[241]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[242] == 11, "incorrect value for last_msg.msg.fileio_read_resp.contents[242], expected 11, is %d", last_msg.msg.fileio_read_resp.contents[242]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[243] == 91, "incorrect value for last_msg.msg.fileio_read_resp.contents[243], expected 91, is %d", last_msg.msg.fileio_read_resp.contents[243]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[244] == 21, "incorrect value for last_msg.msg.fileio_read_resp.contents[244], expected 21, is %d", last_msg.msg.fileio_read_resp.contents[244]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[245] == 236, "incorrect value for last_msg.msg.fileio_read_resp.contents[245], expected 236, is %d", last_msg.msg.fileio_read_resp.contents[245]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[246] == 234, "incorrect value for last_msg.msg.fileio_read_resp.contents[246], expected 234, is %d", last_msg.msg.fileio_read_resp.contents[246]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[247] == 196, "incorrect value for last_msg.msg.fileio_read_resp.contents[247], expected 196, is %d", last_msg.msg.fileio_read_resp.contents[247]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[248] == 36, "incorrect value for last_msg.msg.fileio_read_resp.contents[248], expected 36, is %d", last_msg.msg.fileio_read_resp.contents[248]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[249] == 171, "incorrect value for last_msg.msg.fileio_read_resp.contents[249], expected 171, is %d", last_msg.msg.fileio_read_resp.contents[249]); - ck_assert_msg(last_msg.msg.fileio_read_resp.contents[250] == 147, "incorrect value for last_msg.msg.fileio_read_resp.contents[250], expected 147, is %d", last_msg.msg.fileio_read_resp.contents[250]); - - ck_assert_msg(last_msg.msg.fileio_read_resp.n_contents == 251, "incorrect value for last_msg.msg.fileio_read_resp.n_contents, expected 251, is %d", last_msg.msg.fileio_read_resp.n_contents); - - ck_assert_msg(last_msg.msg.fileio_read_resp.sequence == 259241795, "incorrect value for last_msg.msg.fileio_read_resp.sequence, expected 259241795, is %d", last_msg.msg.fileio_read_resp.sequence); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[0] == 73, + "incorrect value for last_msg.msg.fileio_read_resp.contents[0], " + "expected 73, is %d", + last_msg.msg.fileio_read_resp.contents[0]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[1] == 231, + "incorrect value for last_msg.msg.fileio_read_resp.contents[1], " + "expected 231, is %d", + last_msg.msg.fileio_read_resp.contents[1]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[2] == 227, + "incorrect value for last_msg.msg.fileio_read_resp.contents[2], " + "expected 227, is %d", + last_msg.msg.fileio_read_resp.contents[2]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[3] == 179, + "incorrect value for last_msg.msg.fileio_read_resp.contents[3], " + "expected 179, is %d", + last_msg.msg.fileio_read_resp.contents[3]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[4] == 18, + "incorrect value for last_msg.msg.fileio_read_resp.contents[4], " + "expected 18, is %d", + last_msg.msg.fileio_read_resp.contents[4]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[5] == 76, + "incorrect value for last_msg.msg.fileio_read_resp.contents[5], " + "expected 76, is %d", + last_msg.msg.fileio_read_resp.contents[5]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[6] == 68, + "incorrect value for last_msg.msg.fileio_read_resp.contents[6], " + "expected 68, is %d", + last_msg.msg.fileio_read_resp.contents[6]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[7] == 229, + "incorrect value for last_msg.msg.fileio_read_resp.contents[7], " + "expected 229, is %d", + last_msg.msg.fileio_read_resp.contents[7]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[8] == 216, + "incorrect value for last_msg.msg.fileio_read_resp.contents[8], " + "expected 216, is %d", + last_msg.msg.fileio_read_resp.contents[8]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[9] == 21, + "incorrect value for last_msg.msg.fileio_read_resp.contents[9], " + "expected 21, is %d", + last_msg.msg.fileio_read_resp.contents[9]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[10] == 98, + "incorrect value for last_msg.msg.fileio_read_resp.contents[10], " + "expected 98, is %d", + last_msg.msg.fileio_read_resp.contents[10]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[11] == 183, + "incorrect value for last_msg.msg.fileio_read_resp.contents[11], " + "expected 183, is %d", + last_msg.msg.fileio_read_resp.contents[11]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[12] == 69, + "incorrect value for last_msg.msg.fileio_read_resp.contents[12], " + "expected 69, is %d", + last_msg.msg.fileio_read_resp.contents[12]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[13] == 190, + "incorrect value for last_msg.msg.fileio_read_resp.contents[13], " + "expected 190, is %d", + last_msg.msg.fileio_read_resp.contents[13]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[14] == 5, + "incorrect value for last_msg.msg.fileio_read_resp.contents[14], " + "expected 5, is %d", + last_msg.msg.fileio_read_resp.contents[14]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[15] == 252, + "incorrect value for last_msg.msg.fileio_read_resp.contents[15], " + "expected 252, is %d", + last_msg.msg.fileio_read_resp.contents[15]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[16] == 176, + "incorrect value for last_msg.msg.fileio_read_resp.contents[16], " + "expected 176, is %d", + last_msg.msg.fileio_read_resp.contents[16]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[17] == 55, + "incorrect value for last_msg.msg.fileio_read_resp.contents[17], " + "expected 55, is %d", + last_msg.msg.fileio_read_resp.contents[17]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[18] == 32, + "incorrect value for last_msg.msg.fileio_read_resp.contents[18], " + "expected 32, is %d", + last_msg.msg.fileio_read_resp.contents[18]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[19] == 78, + "incorrect value for last_msg.msg.fileio_read_resp.contents[19], " + "expected 78, is %d", + last_msg.msg.fileio_read_resp.contents[19]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[20] == 8, + "incorrect value for last_msg.msg.fileio_read_resp.contents[20], " + "expected 8, is %d", + last_msg.msg.fileio_read_resp.contents[20]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[21] == 52, + "incorrect value for last_msg.msg.fileio_read_resp.contents[21], " + "expected 52, is %d", + last_msg.msg.fileio_read_resp.contents[21]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[22] == 127, + "incorrect value for last_msg.msg.fileio_read_resp.contents[22], " + "expected 127, is %d", + last_msg.msg.fileio_read_resp.contents[22]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[23] == 50, + "incorrect value for last_msg.msg.fileio_read_resp.contents[23], " + "expected 50, is %d", + last_msg.msg.fileio_read_resp.contents[23]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[24] == 71, + "incorrect value for last_msg.msg.fileio_read_resp.contents[24], " + "expected 71, is %d", + last_msg.msg.fileio_read_resp.contents[24]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[25] == 106, + "incorrect value for last_msg.msg.fileio_read_resp.contents[25], " + "expected 106, is %d", + last_msg.msg.fileio_read_resp.contents[25]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[26] == 61, + "incorrect value for last_msg.msg.fileio_read_resp.contents[26], " + "expected 61, is %d", + last_msg.msg.fileio_read_resp.contents[26]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[27] == 79, + "incorrect value for last_msg.msg.fileio_read_resp.contents[27], " + "expected 79, is %d", + last_msg.msg.fileio_read_resp.contents[27]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[28] == 191, + "incorrect value for last_msg.msg.fileio_read_resp.contents[28], " + "expected 191, is %d", + last_msg.msg.fileio_read_resp.contents[28]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[29] == 106, + "incorrect value for last_msg.msg.fileio_read_resp.contents[29], " + "expected 106, is %d", + last_msg.msg.fileio_read_resp.contents[29]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[30] == 46, + "incorrect value for last_msg.msg.fileio_read_resp.contents[30], " + "expected 46, is %d", + last_msg.msg.fileio_read_resp.contents[30]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[31] == 79, + "incorrect value for last_msg.msg.fileio_read_resp.contents[31], " + "expected 79, is %d", + last_msg.msg.fileio_read_resp.contents[31]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[32] == 118, + "incorrect value for last_msg.msg.fileio_read_resp.contents[32], " + "expected 118, is %d", + last_msg.msg.fileio_read_resp.contents[32]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[33] == 248, + "incorrect value for last_msg.msg.fileio_read_resp.contents[33], " + "expected 248, is %d", + last_msg.msg.fileio_read_resp.contents[33]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[34] == 118, + "incorrect value for last_msg.msg.fileio_read_resp.contents[34], " + "expected 118, is %d", + last_msg.msg.fileio_read_resp.contents[34]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[35] == 207, + "incorrect value for last_msg.msg.fileio_read_resp.contents[35], " + "expected 207, is %d", + last_msg.msg.fileio_read_resp.contents[35]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[36] == 206, + "incorrect value for last_msg.msg.fileio_read_resp.contents[36], " + "expected 206, is %d", + last_msg.msg.fileio_read_resp.contents[36]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[37] == 210, + "incorrect value for last_msg.msg.fileio_read_resp.contents[37], " + "expected 210, is %d", + last_msg.msg.fileio_read_resp.contents[37]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[38] == 91, + "incorrect value for last_msg.msg.fileio_read_resp.contents[38], " + "expected 91, is %d", + last_msg.msg.fileio_read_resp.contents[38]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[39] == 73, + "incorrect value for last_msg.msg.fileio_read_resp.contents[39], " + "expected 73, is %d", + last_msg.msg.fileio_read_resp.contents[39]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[40] == 251, + "incorrect value for last_msg.msg.fileio_read_resp.contents[40], " + "expected 251, is %d", + last_msg.msg.fileio_read_resp.contents[40]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[41] == 81, + "incorrect value for last_msg.msg.fileio_read_resp.contents[41], " + "expected 81, is %d", + last_msg.msg.fileio_read_resp.contents[41]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[42] == 131, + "incorrect value for last_msg.msg.fileio_read_resp.contents[42], " + "expected 131, is %d", + last_msg.msg.fileio_read_resp.contents[42]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[43] == 205, + "incorrect value for last_msg.msg.fileio_read_resp.contents[43], " + "expected 205, is %d", + last_msg.msg.fileio_read_resp.contents[43]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[44] == 193, + "incorrect value for last_msg.msg.fileio_read_resp.contents[44], " + "expected 193, is %d", + last_msg.msg.fileio_read_resp.contents[44]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[45] == 146, + "incorrect value for last_msg.msg.fileio_read_resp.contents[45], " + "expected 146, is %d", + last_msg.msg.fileio_read_resp.contents[45]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[46] == 206, + "incorrect value for last_msg.msg.fileio_read_resp.contents[46], " + "expected 206, is %d", + last_msg.msg.fileio_read_resp.contents[46]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[47] == 185, + "incorrect value for last_msg.msg.fileio_read_resp.contents[47], " + "expected 185, is %d", + last_msg.msg.fileio_read_resp.contents[47]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[48] == 140, + "incorrect value for last_msg.msg.fileio_read_resp.contents[48], " + "expected 140, is %d", + last_msg.msg.fileio_read_resp.contents[48]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[49] == 249, + "incorrect value for last_msg.msg.fileio_read_resp.contents[49], " + "expected 249, is %d", + last_msg.msg.fileio_read_resp.contents[49]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[50] == 163, + "incorrect value for last_msg.msg.fileio_read_resp.contents[50], " + "expected 163, is %d", + last_msg.msg.fileio_read_resp.contents[50]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[51] == 231, + "incorrect value for last_msg.msg.fileio_read_resp.contents[51], " + "expected 231, is %d", + last_msg.msg.fileio_read_resp.contents[51]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[52] == 65, + "incorrect value for last_msg.msg.fileio_read_resp.contents[52], " + "expected 65, is %d", + last_msg.msg.fileio_read_resp.contents[52]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[53] == 67, + "incorrect value for last_msg.msg.fileio_read_resp.contents[53], " + "expected 67, is %d", + last_msg.msg.fileio_read_resp.contents[53]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[54] == 94, + "incorrect value for last_msg.msg.fileio_read_resp.contents[54], " + "expected 94, is %d", + last_msg.msg.fileio_read_resp.contents[54]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[55] == 250, + "incorrect value for last_msg.msg.fileio_read_resp.contents[55], " + "expected 250, is %d", + last_msg.msg.fileio_read_resp.contents[55]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[56] == 109, + "incorrect value for last_msg.msg.fileio_read_resp.contents[56], " + "expected 109, is %d", + last_msg.msg.fileio_read_resp.contents[56]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[57] == 152, + "incorrect value for last_msg.msg.fileio_read_resp.contents[57], " + "expected 152, is %d", + last_msg.msg.fileio_read_resp.contents[57]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[58] == 95, + "incorrect value for last_msg.msg.fileio_read_resp.contents[58], " + "expected 95, is %d", + last_msg.msg.fileio_read_resp.contents[58]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[59] == 123, + "incorrect value for last_msg.msg.fileio_read_resp.contents[59], " + "expected 123, is %d", + last_msg.msg.fileio_read_resp.contents[59]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[60] == 77, + "incorrect value for last_msg.msg.fileio_read_resp.contents[60], " + "expected 77, is %d", + last_msg.msg.fileio_read_resp.contents[60]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[61] == 224, + "incorrect value for last_msg.msg.fileio_read_resp.contents[61], " + "expected 224, is %d", + last_msg.msg.fileio_read_resp.contents[61]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[62] == 124, + "incorrect value for last_msg.msg.fileio_read_resp.contents[62], " + "expected 124, is %d", + last_msg.msg.fileio_read_resp.contents[62]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[63] == 238, + "incorrect value for last_msg.msg.fileio_read_resp.contents[63], " + "expected 238, is %d", + last_msg.msg.fileio_read_resp.contents[63]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[64] == 205, + "incorrect value for last_msg.msg.fileio_read_resp.contents[64], " + "expected 205, is %d", + last_msg.msg.fileio_read_resp.contents[64]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[65] == 65, + "incorrect value for last_msg.msg.fileio_read_resp.contents[65], " + "expected 65, is %d", + last_msg.msg.fileio_read_resp.contents[65]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[66] == 103, + "incorrect value for last_msg.msg.fileio_read_resp.contents[66], " + "expected 103, is %d", + last_msg.msg.fileio_read_resp.contents[66]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[67] == 35, + "incorrect value for last_msg.msg.fileio_read_resp.contents[67], " + "expected 35, is %d", + last_msg.msg.fileio_read_resp.contents[67]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[68] == 104, + "incorrect value for last_msg.msg.fileio_read_resp.contents[68], " + "expected 104, is %d", + last_msg.msg.fileio_read_resp.contents[68]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[69] == 209, + "incorrect value for last_msg.msg.fileio_read_resp.contents[69], " + "expected 209, is %d", + last_msg.msg.fileio_read_resp.contents[69]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[70] == 5, + "incorrect value for last_msg.msg.fileio_read_resp.contents[70], " + "expected 5, is %d", + last_msg.msg.fileio_read_resp.contents[70]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[71] == 191, + "incorrect value for last_msg.msg.fileio_read_resp.contents[71], " + "expected 191, is %d", + last_msg.msg.fileio_read_resp.contents[71]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[72] == 47, + "incorrect value for last_msg.msg.fileio_read_resp.contents[72], " + "expected 47, is %d", + last_msg.msg.fileio_read_resp.contents[72]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[73] == 249, + "incorrect value for last_msg.msg.fileio_read_resp.contents[73], " + "expected 249, is %d", + last_msg.msg.fileio_read_resp.contents[73]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[74] == 176, + "incorrect value for last_msg.msg.fileio_read_resp.contents[74], " + "expected 176, is %d", + last_msg.msg.fileio_read_resp.contents[74]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[75] == 166, + "incorrect value for last_msg.msg.fileio_read_resp.contents[75], " + "expected 166, is %d", + last_msg.msg.fileio_read_resp.contents[75]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[76] == 213, + "incorrect value for last_msg.msg.fileio_read_resp.contents[76], " + "expected 213, is %d", + last_msg.msg.fileio_read_resp.contents[76]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[77] == 46, + "incorrect value for last_msg.msg.fileio_read_resp.contents[77], " + "expected 46, is %d", + last_msg.msg.fileio_read_resp.contents[77]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[78] == 192, + "incorrect value for last_msg.msg.fileio_read_resp.contents[78], " + "expected 192, is %d", + last_msg.msg.fileio_read_resp.contents[78]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[79] == 86, + "incorrect value for last_msg.msg.fileio_read_resp.contents[79], " + "expected 86, is %d", + last_msg.msg.fileio_read_resp.contents[79]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[80] == 32, + "incorrect value for last_msg.msg.fileio_read_resp.contents[80], " + "expected 32, is %d", + last_msg.msg.fileio_read_resp.contents[80]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[81] == 103, + "incorrect value for last_msg.msg.fileio_read_resp.contents[81], " + "expected 103, is %d", + last_msg.msg.fileio_read_resp.contents[81]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[82] == 146, + "incorrect value for last_msg.msg.fileio_read_resp.contents[82], " + "expected 146, is %d", + last_msg.msg.fileio_read_resp.contents[82]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[83] == 252, + "incorrect value for last_msg.msg.fileio_read_resp.contents[83], " + "expected 252, is %d", + last_msg.msg.fileio_read_resp.contents[83]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[84] == 4, + "incorrect value for last_msg.msg.fileio_read_resp.contents[84], " + "expected 4, is %d", + last_msg.msg.fileio_read_resp.contents[84]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[85] == 16, + "incorrect value for last_msg.msg.fileio_read_resp.contents[85], " + "expected 16, is %d", + last_msg.msg.fileio_read_resp.contents[85]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[86] == 54, + "incorrect value for last_msg.msg.fileio_read_resp.contents[86], " + "expected 54, is %d", + last_msg.msg.fileio_read_resp.contents[86]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[87] == 161, + "incorrect value for last_msg.msg.fileio_read_resp.contents[87], " + "expected 161, is %d", + last_msg.msg.fileio_read_resp.contents[87]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[88] == 60, + "incorrect value for last_msg.msg.fileio_read_resp.contents[88], " + "expected 60, is %d", + last_msg.msg.fileio_read_resp.contents[88]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[89] == 6, + "incorrect value for last_msg.msg.fileio_read_resp.contents[89], " + "expected 6, is %d", + last_msg.msg.fileio_read_resp.contents[89]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[90] == 13, + "incorrect value for last_msg.msg.fileio_read_resp.contents[90], " + "expected 13, is %d", + last_msg.msg.fileio_read_resp.contents[90]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[91] == 191, + "incorrect value for last_msg.msg.fileio_read_resp.contents[91], " + "expected 191, is %d", + last_msg.msg.fileio_read_resp.contents[91]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[92] == 116, + "incorrect value for last_msg.msg.fileio_read_resp.contents[92], " + "expected 116, is %d", + last_msg.msg.fileio_read_resp.contents[92]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[93] == 182, + "incorrect value for last_msg.msg.fileio_read_resp.contents[93], " + "expected 182, is %d", + last_msg.msg.fileio_read_resp.contents[93]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[94] == 42, + "incorrect value for last_msg.msg.fileio_read_resp.contents[94], " + "expected 42, is %d", + last_msg.msg.fileio_read_resp.contents[94]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[95] == 191, + "incorrect value for last_msg.msg.fileio_read_resp.contents[95], " + "expected 191, is %d", + last_msg.msg.fileio_read_resp.contents[95]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[96] == 213, + "incorrect value for last_msg.msg.fileio_read_resp.contents[96], " + "expected 213, is %d", + last_msg.msg.fileio_read_resp.contents[96]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[97] == 20, + "incorrect value for last_msg.msg.fileio_read_resp.contents[97], " + "expected 20, is %d", + last_msg.msg.fileio_read_resp.contents[97]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[98] == 217, + "incorrect value for last_msg.msg.fileio_read_resp.contents[98], " + "expected 217, is %d", + last_msg.msg.fileio_read_resp.contents[98]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[99] == 8, + "incorrect value for last_msg.msg.fileio_read_resp.contents[99], " + "expected 8, is %d", + last_msg.msg.fileio_read_resp.contents[99]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[100] == 142, + "incorrect value for last_msg.msg.fileio_read_resp.contents[100], " + "expected 142, is %d", + last_msg.msg.fileio_read_resp.contents[100]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[101] == 187, + "incorrect value for last_msg.msg.fileio_read_resp.contents[101], " + "expected 187, is %d", + last_msg.msg.fileio_read_resp.contents[101]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[102] == 238, + "incorrect value for last_msg.msg.fileio_read_resp.contents[102], " + "expected 238, is %d", + last_msg.msg.fileio_read_resp.contents[102]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[103] == 120, + "incorrect value for last_msg.msg.fileio_read_resp.contents[103], " + "expected 120, is %d", + last_msg.msg.fileio_read_resp.contents[103]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[104] == 184, + "incorrect value for last_msg.msg.fileio_read_resp.contents[104], " + "expected 184, is %d", + last_msg.msg.fileio_read_resp.contents[104]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[105] == 250, + "incorrect value for last_msg.msg.fileio_read_resp.contents[105], " + "expected 250, is %d", + last_msg.msg.fileio_read_resp.contents[105]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[106] == 31, + "incorrect value for last_msg.msg.fileio_read_resp.contents[106], " + "expected 31, is %d", + last_msg.msg.fileio_read_resp.contents[106]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[107] == 151, + "incorrect value for last_msg.msg.fileio_read_resp.contents[107], " + "expected 151, is %d", + last_msg.msg.fileio_read_resp.contents[107]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[108] == 37, + "incorrect value for last_msg.msg.fileio_read_resp.contents[108], " + "expected 37, is %d", + last_msg.msg.fileio_read_resp.contents[108]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[109] == 51, + "incorrect value for last_msg.msg.fileio_read_resp.contents[109], " + "expected 51, is %d", + last_msg.msg.fileio_read_resp.contents[109]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[110] == 177, + "incorrect value for last_msg.msg.fileio_read_resp.contents[110], " + "expected 177, is %d", + last_msg.msg.fileio_read_resp.contents[110]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[111] == 130, + "incorrect value for last_msg.msg.fileio_read_resp.contents[111], " + "expected 130, is %d", + last_msg.msg.fileio_read_resp.contents[111]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[112] == 190, + "incorrect value for last_msg.msg.fileio_read_resp.contents[112], " + "expected 190, is %d", + last_msg.msg.fileio_read_resp.contents[112]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[113] == 155, + "incorrect value for last_msg.msg.fileio_read_resp.contents[113], " + "expected 155, is %d", + last_msg.msg.fileio_read_resp.contents[113]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[114] == 71, + "incorrect value for last_msg.msg.fileio_read_resp.contents[114], " + "expected 71, is %d", + last_msg.msg.fileio_read_resp.contents[114]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[115] == 68, + "incorrect value for last_msg.msg.fileio_read_resp.contents[115], " + "expected 68, is %d", + last_msg.msg.fileio_read_resp.contents[115]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[116] == 56, + "incorrect value for last_msg.msg.fileio_read_resp.contents[116], " + "expected 56, is %d", + last_msg.msg.fileio_read_resp.contents[116]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[117] == 238, + "incorrect value for last_msg.msg.fileio_read_resp.contents[117], " + "expected 238, is %d", + last_msg.msg.fileio_read_resp.contents[117]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[118] == 92, + "incorrect value for last_msg.msg.fileio_read_resp.contents[118], " + "expected 92, is %d", + last_msg.msg.fileio_read_resp.contents[118]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[119] == 130, + "incorrect value for last_msg.msg.fileio_read_resp.contents[119], " + "expected 130, is %d", + last_msg.msg.fileio_read_resp.contents[119]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[120] == 37, + "incorrect value for last_msg.msg.fileio_read_resp.contents[120], " + "expected 37, is %d", + last_msg.msg.fileio_read_resp.contents[120]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[121] == 137, + "incorrect value for last_msg.msg.fileio_read_resp.contents[121], " + "expected 137, is %d", + last_msg.msg.fileio_read_resp.contents[121]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[122] == 146, + "incorrect value for last_msg.msg.fileio_read_resp.contents[122], " + "expected 146, is %d", + last_msg.msg.fileio_read_resp.contents[122]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[123] == 246, + "incorrect value for last_msg.msg.fileio_read_resp.contents[123], " + "expected 246, is %d", + last_msg.msg.fileio_read_resp.contents[123]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[124] == 114, + "incorrect value for last_msg.msg.fileio_read_resp.contents[124], " + "expected 114, is %d", + last_msg.msg.fileio_read_resp.contents[124]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[125] == 116, + "incorrect value for last_msg.msg.fileio_read_resp.contents[125], " + "expected 116, is %d", + last_msg.msg.fileio_read_resp.contents[125]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[126] == 138, + "incorrect value for last_msg.msg.fileio_read_resp.contents[126], " + "expected 138, is %d", + last_msg.msg.fileio_read_resp.contents[126]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[127] == 165, + "incorrect value for last_msg.msg.fileio_read_resp.contents[127], " + "expected 165, is %d", + last_msg.msg.fileio_read_resp.contents[127]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[128] == 217, + "incorrect value for last_msg.msg.fileio_read_resp.contents[128], " + "expected 217, is %d", + last_msg.msg.fileio_read_resp.contents[128]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[129] == 79, + "incorrect value for last_msg.msg.fileio_read_resp.contents[129], " + "expected 79, is %d", + last_msg.msg.fileio_read_resp.contents[129]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[130] == 10, + "incorrect value for last_msg.msg.fileio_read_resp.contents[130], " + "expected 10, is %d", + last_msg.msg.fileio_read_resp.contents[130]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[131] == 189, + "incorrect value for last_msg.msg.fileio_read_resp.contents[131], " + "expected 189, is %d", + last_msg.msg.fileio_read_resp.contents[131]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[132] == 128, + "incorrect value for last_msg.msg.fileio_read_resp.contents[132], " + "expected 128, is %d", + last_msg.msg.fileio_read_resp.contents[132]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[133] == 189, + "incorrect value for last_msg.msg.fileio_read_resp.contents[133], " + "expected 189, is %d", + last_msg.msg.fileio_read_resp.contents[133]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[134] == 2, + "incorrect value for last_msg.msg.fileio_read_resp.contents[134], " + "expected 2, is %d", + last_msg.msg.fileio_read_resp.contents[134]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[135] == 240, + "incorrect value for last_msg.msg.fileio_read_resp.contents[135], " + "expected 240, is %d", + last_msg.msg.fileio_read_resp.contents[135]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[136] == 92, + "incorrect value for last_msg.msg.fileio_read_resp.contents[136], " + "expected 92, is %d", + last_msg.msg.fileio_read_resp.contents[136]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[137] == 28, + "incorrect value for last_msg.msg.fileio_read_resp.contents[137], " + "expected 28, is %d", + last_msg.msg.fileio_read_resp.contents[137]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[138] == 126, + "incorrect value for last_msg.msg.fileio_read_resp.contents[138], " + "expected 126, is %d", + last_msg.msg.fileio_read_resp.contents[138]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[139] == 105, + "incorrect value for last_msg.msg.fileio_read_resp.contents[139], " + "expected 105, is %d", + last_msg.msg.fileio_read_resp.contents[139]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[140] == 236, + "incorrect value for last_msg.msg.fileio_read_resp.contents[140], " + "expected 236, is %d", + last_msg.msg.fileio_read_resp.contents[140]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[141] == 228, + "incorrect value for last_msg.msg.fileio_read_resp.contents[141], " + "expected 228, is %d", + last_msg.msg.fileio_read_resp.contents[141]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[142] == 194, + "incorrect value for last_msg.msg.fileio_read_resp.contents[142], " + "expected 194, is %d", + last_msg.msg.fileio_read_resp.contents[142]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[143] == 0, + "incorrect value for last_msg.msg.fileio_read_resp.contents[143], " + "expected 0, is %d", + last_msg.msg.fileio_read_resp.contents[143]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[144] == 51, + "incorrect value for last_msg.msg.fileio_read_resp.contents[144], " + "expected 51, is %d", + last_msg.msg.fileio_read_resp.contents[144]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[145] == 61, + "incorrect value for last_msg.msg.fileio_read_resp.contents[145], " + "expected 61, is %d", + last_msg.msg.fileio_read_resp.contents[145]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[146] == 74, + "incorrect value for last_msg.msg.fileio_read_resp.contents[146], " + "expected 74, is %d", + last_msg.msg.fileio_read_resp.contents[146]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[147] == 41, + "incorrect value for last_msg.msg.fileio_read_resp.contents[147], " + "expected 41, is %d", + last_msg.msg.fileio_read_resp.contents[147]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[148] == 10, + "incorrect value for last_msg.msg.fileio_read_resp.contents[148], " + "expected 10, is %d", + last_msg.msg.fileio_read_resp.contents[148]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[149] == 239, + "incorrect value for last_msg.msg.fileio_read_resp.contents[149], " + "expected 239, is %d", + last_msg.msg.fileio_read_resp.contents[149]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[150] == 133, + "incorrect value for last_msg.msg.fileio_read_resp.contents[150], " + "expected 133, is %d", + last_msg.msg.fileio_read_resp.contents[150]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[151] == 106, + "incorrect value for last_msg.msg.fileio_read_resp.contents[151], " + "expected 106, is %d", + last_msg.msg.fileio_read_resp.contents[151]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[152] == 190, + "incorrect value for last_msg.msg.fileio_read_resp.contents[152], " + "expected 190, is %d", + last_msg.msg.fileio_read_resp.contents[152]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[153] == 30, + "incorrect value for last_msg.msg.fileio_read_resp.contents[153], " + "expected 30, is %d", + last_msg.msg.fileio_read_resp.contents[153]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[154] == 27, + "incorrect value for last_msg.msg.fileio_read_resp.contents[154], " + "expected 27, is %d", + last_msg.msg.fileio_read_resp.contents[154]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[155] == 3, + "incorrect value for last_msg.msg.fileio_read_resp.contents[155], " + "expected 3, is %d", + last_msg.msg.fileio_read_resp.contents[155]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[156] == 240, + "incorrect value for last_msg.msg.fileio_read_resp.contents[156], " + "expected 240, is %d", + last_msg.msg.fileio_read_resp.contents[156]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[157] == 205, + "incorrect value for last_msg.msg.fileio_read_resp.contents[157], " + "expected 205, is %d", + last_msg.msg.fileio_read_resp.contents[157]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[158] == 253, + "incorrect value for last_msg.msg.fileio_read_resp.contents[158], " + "expected 253, is %d", + last_msg.msg.fileio_read_resp.contents[158]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[159] == 113, + "incorrect value for last_msg.msg.fileio_read_resp.contents[159], " + "expected 113, is %d", + last_msg.msg.fileio_read_resp.contents[159]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[160] == 25, + "incorrect value for last_msg.msg.fileio_read_resp.contents[160], " + "expected 25, is %d", + last_msg.msg.fileio_read_resp.contents[160]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[161] == 28, + "incorrect value for last_msg.msg.fileio_read_resp.contents[161], " + "expected 28, is %d", + last_msg.msg.fileio_read_resp.contents[161]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[162] == 187, + "incorrect value for last_msg.msg.fileio_read_resp.contents[162], " + "expected 187, is %d", + last_msg.msg.fileio_read_resp.contents[162]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[163] == 81, + "incorrect value for last_msg.msg.fileio_read_resp.contents[163], " + "expected 81, is %d", + last_msg.msg.fileio_read_resp.contents[163]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[164] == 101, + "incorrect value for last_msg.msg.fileio_read_resp.contents[164], " + "expected 101, is %d", + last_msg.msg.fileio_read_resp.contents[164]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[165] == 216, + "incorrect value for last_msg.msg.fileio_read_resp.contents[165], " + "expected 216, is %d", + last_msg.msg.fileio_read_resp.contents[165]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[166] == 121, + "incorrect value for last_msg.msg.fileio_read_resp.contents[166], " + "expected 121, is %d", + last_msg.msg.fileio_read_resp.contents[166]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[167] == 41, + "incorrect value for last_msg.msg.fileio_read_resp.contents[167], " + "expected 41, is %d", + last_msg.msg.fileio_read_resp.contents[167]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[168] == 179, + "incorrect value for last_msg.msg.fileio_read_resp.contents[168], " + "expected 179, is %d", + last_msg.msg.fileio_read_resp.contents[168]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[169] == 120, + "incorrect value for last_msg.msg.fileio_read_resp.contents[169], " + "expected 120, is %d", + last_msg.msg.fileio_read_resp.contents[169]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[170] == 152, + "incorrect value for last_msg.msg.fileio_read_resp.contents[170], " + "expected 152, is %d", + last_msg.msg.fileio_read_resp.contents[170]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[171] == 18, + "incorrect value for last_msg.msg.fileio_read_resp.contents[171], " + "expected 18, is %d", + last_msg.msg.fileio_read_resp.contents[171]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[172] == 116, + "incorrect value for last_msg.msg.fileio_read_resp.contents[172], " + "expected 116, is %d", + last_msg.msg.fileio_read_resp.contents[172]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[173] == 53, + "incorrect value for last_msg.msg.fileio_read_resp.contents[173], " + "expected 53, is %d", + last_msg.msg.fileio_read_resp.contents[173]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[174] == 212, + "incorrect value for last_msg.msg.fileio_read_resp.contents[174], " + "expected 212, is %d", + last_msg.msg.fileio_read_resp.contents[174]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[175] == 100, + "incorrect value for last_msg.msg.fileio_read_resp.contents[175], " + "expected 100, is %d", + last_msg.msg.fileio_read_resp.contents[175]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[176] == 2, + "incorrect value for last_msg.msg.fileio_read_resp.contents[176], " + "expected 2, is %d", + last_msg.msg.fileio_read_resp.contents[176]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[177] == 114, + "incorrect value for last_msg.msg.fileio_read_resp.contents[177], " + "expected 114, is %d", + last_msg.msg.fileio_read_resp.contents[177]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[178] == 198, + "incorrect value for last_msg.msg.fileio_read_resp.contents[178], " + "expected 198, is %d", + last_msg.msg.fileio_read_resp.contents[178]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[179] == 200, + "incorrect value for last_msg.msg.fileio_read_resp.contents[179], " + "expected 200, is %d", + last_msg.msg.fileio_read_resp.contents[179]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[180] == 10, + "incorrect value for last_msg.msg.fileio_read_resp.contents[180], " + "expected 10, is %d", + last_msg.msg.fileio_read_resp.contents[180]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[181] == 147, + "incorrect value for last_msg.msg.fileio_read_resp.contents[181], " + "expected 147, is %d", + last_msg.msg.fileio_read_resp.contents[181]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[182] == 25, + "incorrect value for last_msg.msg.fileio_read_resp.contents[182], " + "expected 25, is %d", + last_msg.msg.fileio_read_resp.contents[182]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[183] == 33, + "incorrect value for last_msg.msg.fileio_read_resp.contents[183], " + "expected 33, is %d", + last_msg.msg.fileio_read_resp.contents[183]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[184] == 115, + "incorrect value for last_msg.msg.fileio_read_resp.contents[184], " + "expected 115, is %d", + last_msg.msg.fileio_read_resp.contents[184]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[185] == 208, + "incorrect value for last_msg.msg.fileio_read_resp.contents[185], " + "expected 208, is %d", + last_msg.msg.fileio_read_resp.contents[185]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[186] == 113, + "incorrect value for last_msg.msg.fileio_read_resp.contents[186], " + "expected 113, is %d", + last_msg.msg.fileio_read_resp.contents[186]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[187] == 60, + "incorrect value for last_msg.msg.fileio_read_resp.contents[187], " + "expected 60, is %d", + last_msg.msg.fileio_read_resp.contents[187]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[188] == 179, + "incorrect value for last_msg.msg.fileio_read_resp.contents[188], " + "expected 179, is %d", + last_msg.msg.fileio_read_resp.contents[188]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[189] == 183, + "incorrect value for last_msg.msg.fileio_read_resp.contents[189], " + "expected 183, is %d", + last_msg.msg.fileio_read_resp.contents[189]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[190] == 0, + "incorrect value for last_msg.msg.fileio_read_resp.contents[190], " + "expected 0, is %d", + last_msg.msg.fileio_read_resp.contents[190]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[191] == 41, + "incorrect value for last_msg.msg.fileio_read_resp.contents[191], " + "expected 41, is %d", + last_msg.msg.fileio_read_resp.contents[191]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[192] == 217, + "incorrect value for last_msg.msg.fileio_read_resp.contents[192], " + "expected 217, is %d", + last_msg.msg.fileio_read_resp.contents[192]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[193] == 206, + "incorrect value for last_msg.msg.fileio_read_resp.contents[193], " + "expected 206, is %d", + last_msg.msg.fileio_read_resp.contents[193]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[194] == 255, + "incorrect value for last_msg.msg.fileio_read_resp.contents[194], " + "expected 255, is %d", + last_msg.msg.fileio_read_resp.contents[194]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[195] == 211, + "incorrect value for last_msg.msg.fileio_read_resp.contents[195], " + "expected 211, is %d", + last_msg.msg.fileio_read_resp.contents[195]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[196] == 225, + "incorrect value for last_msg.msg.fileio_read_resp.contents[196], " + "expected 225, is %d", + last_msg.msg.fileio_read_resp.contents[196]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[197] == 142, + "incorrect value for last_msg.msg.fileio_read_resp.contents[197], " + "expected 142, is %d", + last_msg.msg.fileio_read_resp.contents[197]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[198] == 191, + "incorrect value for last_msg.msg.fileio_read_resp.contents[198], " + "expected 191, is %d", + last_msg.msg.fileio_read_resp.contents[198]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[199] == 133, + "incorrect value for last_msg.msg.fileio_read_resp.contents[199], " + "expected 133, is %d", + last_msg.msg.fileio_read_resp.contents[199]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[200] == 81, + "incorrect value for last_msg.msg.fileio_read_resp.contents[200], " + "expected 81, is %d", + last_msg.msg.fileio_read_resp.contents[200]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[201] == 15, + "incorrect value for last_msg.msg.fileio_read_resp.contents[201], " + "expected 15, is %d", + last_msg.msg.fileio_read_resp.contents[201]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[202] == 248, + "incorrect value for last_msg.msg.fileio_read_resp.contents[202], " + "expected 248, is %d", + last_msg.msg.fileio_read_resp.contents[202]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[203] == 193, + "incorrect value for last_msg.msg.fileio_read_resp.contents[203], " + "expected 193, is %d", + last_msg.msg.fileio_read_resp.contents[203]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[204] == 66, + "incorrect value for last_msg.msg.fileio_read_resp.contents[204], " + "expected 66, is %d", + last_msg.msg.fileio_read_resp.contents[204]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[205] == 191, + "incorrect value for last_msg.msg.fileio_read_resp.contents[205], " + "expected 191, is %d", + last_msg.msg.fileio_read_resp.contents[205]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[206] == 244, + "incorrect value for last_msg.msg.fileio_read_resp.contents[206], " + "expected 244, is %d", + last_msg.msg.fileio_read_resp.contents[206]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[207] == 221, + "incorrect value for last_msg.msg.fileio_read_resp.contents[207], " + "expected 221, is %d", + last_msg.msg.fileio_read_resp.contents[207]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[208] == 248, + "incorrect value for last_msg.msg.fileio_read_resp.contents[208], " + "expected 248, is %d", + last_msg.msg.fileio_read_resp.contents[208]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[209] == 199, + "incorrect value for last_msg.msg.fileio_read_resp.contents[209], " + "expected 199, is %d", + last_msg.msg.fileio_read_resp.contents[209]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[210] == 241, + "incorrect value for last_msg.msg.fileio_read_resp.contents[210], " + "expected 241, is %d", + last_msg.msg.fileio_read_resp.contents[210]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[211] == 112, + "incorrect value for last_msg.msg.fileio_read_resp.contents[211], " + "expected 112, is %d", + last_msg.msg.fileio_read_resp.contents[211]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[212] == 51, + "incorrect value for last_msg.msg.fileio_read_resp.contents[212], " + "expected 51, is %d", + last_msg.msg.fileio_read_resp.contents[212]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[213] == 1, + "incorrect value for last_msg.msg.fileio_read_resp.contents[213], " + "expected 1, is %d", + last_msg.msg.fileio_read_resp.contents[213]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[214] == 180, + "incorrect value for last_msg.msg.fileio_read_resp.contents[214], " + "expected 180, is %d", + last_msg.msg.fileio_read_resp.contents[214]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[215] == 180, + "incorrect value for last_msg.msg.fileio_read_resp.contents[215], " + "expected 180, is %d", + last_msg.msg.fileio_read_resp.contents[215]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[216] == 125, + "incorrect value for last_msg.msg.fileio_read_resp.contents[216], " + "expected 125, is %d", + last_msg.msg.fileio_read_resp.contents[216]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[217] == 97, + "incorrect value for last_msg.msg.fileio_read_resp.contents[217], " + "expected 97, is %d", + last_msg.msg.fileio_read_resp.contents[217]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[218] == 145, + "incorrect value for last_msg.msg.fileio_read_resp.contents[218], " + "expected 145, is %d", + last_msg.msg.fileio_read_resp.contents[218]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[219] == 25, + "incorrect value for last_msg.msg.fileio_read_resp.contents[219], " + "expected 25, is %d", + last_msg.msg.fileio_read_resp.contents[219]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[220] == 72, + "incorrect value for last_msg.msg.fileio_read_resp.contents[220], " + "expected 72, is %d", + last_msg.msg.fileio_read_resp.contents[220]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[221] == 210, + "incorrect value for last_msg.msg.fileio_read_resp.contents[221], " + "expected 210, is %d", + last_msg.msg.fileio_read_resp.contents[221]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[222] == 215, + "incorrect value for last_msg.msg.fileio_read_resp.contents[222], " + "expected 215, is %d", + last_msg.msg.fileio_read_resp.contents[222]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[223] == 208, + "incorrect value for last_msg.msg.fileio_read_resp.contents[223], " + "expected 208, is %d", + last_msg.msg.fileio_read_resp.contents[223]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[224] == 15, + "incorrect value for last_msg.msg.fileio_read_resp.contents[224], " + "expected 15, is %d", + last_msg.msg.fileio_read_resp.contents[224]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[225] == 126, + "incorrect value for last_msg.msg.fileio_read_resp.contents[225], " + "expected 126, is %d", + last_msg.msg.fileio_read_resp.contents[225]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[226] == 56, + "incorrect value for last_msg.msg.fileio_read_resp.contents[226], " + "expected 56, is %d", + last_msg.msg.fileio_read_resp.contents[226]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[227] == 38, + "incorrect value for last_msg.msg.fileio_read_resp.contents[227], " + "expected 38, is %d", + last_msg.msg.fileio_read_resp.contents[227]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[228] == 65, + "incorrect value for last_msg.msg.fileio_read_resp.contents[228], " + "expected 65, is %d", + last_msg.msg.fileio_read_resp.contents[228]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[229] == 4, + "incorrect value for last_msg.msg.fileio_read_resp.contents[229], " + "expected 4, is %d", + last_msg.msg.fileio_read_resp.contents[229]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[230] == 64, + "incorrect value for last_msg.msg.fileio_read_resp.contents[230], " + "expected 64, is %d", + last_msg.msg.fileio_read_resp.contents[230]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[231] == 19, + "incorrect value for last_msg.msg.fileio_read_resp.contents[231], " + "expected 19, is %d", + last_msg.msg.fileio_read_resp.contents[231]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[232] == 74, + "incorrect value for last_msg.msg.fileio_read_resp.contents[232], " + "expected 74, is %d", + last_msg.msg.fileio_read_resp.contents[232]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[233] == 223, + "incorrect value for last_msg.msg.fileio_read_resp.contents[233], " + "expected 223, is %d", + last_msg.msg.fileio_read_resp.contents[233]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[234] == 111, + "incorrect value for last_msg.msg.fileio_read_resp.contents[234], " + "expected 111, is %d", + last_msg.msg.fileio_read_resp.contents[234]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[235] == 109, + "incorrect value for last_msg.msg.fileio_read_resp.contents[235], " + "expected 109, is %d", + last_msg.msg.fileio_read_resp.contents[235]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[236] == 52, + "incorrect value for last_msg.msg.fileio_read_resp.contents[236], " + "expected 52, is %d", + last_msg.msg.fileio_read_resp.contents[236]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[237] == 43, + "incorrect value for last_msg.msg.fileio_read_resp.contents[237], " + "expected 43, is %d", + last_msg.msg.fileio_read_resp.contents[237]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[238] == 167, + "incorrect value for last_msg.msg.fileio_read_resp.contents[238], " + "expected 167, is %d", + last_msg.msg.fileio_read_resp.contents[238]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[239] == 186, + "incorrect value for last_msg.msg.fileio_read_resp.contents[239], " + "expected 186, is %d", + last_msg.msg.fileio_read_resp.contents[239]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[240] == 202, + "incorrect value for last_msg.msg.fileio_read_resp.contents[240], " + "expected 202, is %d", + last_msg.msg.fileio_read_resp.contents[240]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[241] == 111, + "incorrect value for last_msg.msg.fileio_read_resp.contents[241], " + "expected 111, is %d", + last_msg.msg.fileio_read_resp.contents[241]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[242] == 11, + "incorrect value for last_msg.msg.fileio_read_resp.contents[242], " + "expected 11, is %d", + last_msg.msg.fileio_read_resp.contents[242]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[243] == 91, + "incorrect value for last_msg.msg.fileio_read_resp.contents[243], " + "expected 91, is %d", + last_msg.msg.fileio_read_resp.contents[243]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[244] == 21, + "incorrect value for last_msg.msg.fileio_read_resp.contents[244], " + "expected 21, is %d", + last_msg.msg.fileio_read_resp.contents[244]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[245] == 236, + "incorrect value for last_msg.msg.fileio_read_resp.contents[245], " + "expected 236, is %d", + last_msg.msg.fileio_read_resp.contents[245]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[246] == 234, + "incorrect value for last_msg.msg.fileio_read_resp.contents[246], " + "expected 234, is %d", + last_msg.msg.fileio_read_resp.contents[246]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[247] == 196, + "incorrect value for last_msg.msg.fileio_read_resp.contents[247], " + "expected 196, is %d", + last_msg.msg.fileio_read_resp.contents[247]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[248] == 36, + "incorrect value for last_msg.msg.fileio_read_resp.contents[248], " + "expected 36, is %d", + last_msg.msg.fileio_read_resp.contents[248]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[249] == 171, + "incorrect value for last_msg.msg.fileio_read_resp.contents[249], " + "expected 171, is %d", + last_msg.msg.fileio_read_resp.contents[249]); + ck_assert_msg( + last_msg.msg.fileio_read_resp.contents[250] == 147, + "incorrect value for last_msg.msg.fileio_read_resp.contents[250], " + "expected 147, is %d", + last_msg.msg.fileio_read_resp.contents[250]); + + ck_assert_msg( + last_msg.msg.fileio_read_resp.n_contents == 251, + "incorrect value for last_msg.msg.fileio_read_resp.n_contents, " + "expected 251, is %d", + last_msg.msg.fileio_read_resp.n_contents); + + ck_assert_msg(last_msg.msg.fileio_read_resp.sequence == 259241795, + "incorrect value for last_msg.msg.fileio_read_resp.sequence, " + "expected 259241795, is %d", + last_msg.msg.fileio_read_resp.sequence); } } END_TEST -Suite* auto_check_sbp_file_io_MsgFileioReadResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_file_io_MsgFileioReadResp"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_file_io_MsgFileioReadResp"); +Suite *auto_check_sbp_file_io_MsgFileioReadResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_file_io_MsgFileioReadResp"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_file_io_MsgFileioReadResp"); tcase_add_test(tc_acq, test_auto_check_sbp_file_io_MsgFileioReadResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_file_io_MsgFileioRemove.c b/c/test/auto_check_sbp_file_io_MsgFileioRemove.c index 135c8699c..ee4961b55 100644 --- a/c/test/auto_check_sbp_file_io_MsgFileioRemove.c +++ b/c/test/auto_check_sbp_file_io_MsgFileioRemove.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioRemove.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioRemove.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_file_io_MsgFileioRemove ) -{ +START_TEST(test_auto_check_sbp_file_io_MsgFileioRemove) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioRemove ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,53 +90,70 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioRemove ) logging_reset(); - sbp_callback_register(&sbp_state, 0xac, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xac, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,172,0,195,4,14,47,112,97,116,104,47,116,111,47,102,105,108,101,0,46,243, }; + u8 encoded_frame[] = { + 85, 172, 0, 195, 4, 14, 47, 112, 97, 116, 104, + 47, 116, 111, 47, 102, 105, 108, 101, 0, 46, 243, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - size_t written; - ck_assert_msg(sbp_msg_fileio_remove_filename_set(&test_msg.fileio_remove, "/path/to/file", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("/path/to/file"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_fileio_remove_filename_encoded_len(&test_msg.fileio_remove) == 14, "String not encoded properly"); - sbp_message_send(&sbp_state, SbpMsgFileioRemove, 1219, &test_msg, &dummy_write); + size_t written; + ck_assert_msg( + sbp_msg_fileio_remove_filename_set(&test_msg.fileio_remove, + "/path/to/file", false, &written), + "Can't assign text"); + ck_assert_msg(written == strlen("/path/to/file"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_fileio_remove_filename_encoded_len( + &test_msg.fileio_remove) == 14, + "String not encoded properly"); + + sbp_message_send(&sbp_state, SbpMsgFileioRemove, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgFileioRemove, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgFileioRemove, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_fileio_remove_filename_encoded_len(&last_msg.msg.fileio_remove) == 14, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_fileio_remove_filename_get(&last_msg.msg.fileio_remove), "/path/to/file") == 0, "String not decoded properly"); + ck_assert_msg(sbp_msg_fileio_remove_filename_encoded_len( + &last_msg.msg.fileio_remove) == 14, + "Invalid encoded len"); + ck_assert_msg( + strcmp(sbp_msg_fileio_remove_filename_get(&last_msg.msg.fileio_remove), + "/path/to/file") == 0, + "String not decoded properly"); } } END_TEST -Suite* auto_check_sbp_file_io_MsgFileioRemove_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_file_io_MsgFileioRemove"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_file_io_MsgFileioRemove"); +Suite *auto_check_sbp_file_io_MsgFileioRemove_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_file_io_MsgFileioRemove"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_file_io_MsgFileioRemove"); tcase_add_test(tc_acq, test_auto_check_sbp_file_io_MsgFileioRemove); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_file_io_MsgFileioWriteResp.c b/c/test/auto_check_sbp_file_io_MsgFileioWriteResp.c index 8cc51f1dc..c7236893d 100644 --- a/c/test/auto_check_sbp_file_io_MsgFileioWriteResp.c +++ b/c/test/auto_check_sbp_file_io_MsgFileioWriteResp.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioWriteResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioWriteResp.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_file_io_MsgFileioWriteResp ) -{ +START_TEST(test_auto_check_sbp_file_io_MsgFileioWriteResp) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioWriteResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,47 +90,58 @@ START_TEST( test_auto_check_sbp_file_io_MsgFileioWriteResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xab, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xab, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,171,0,66,0,4,202,0,0,0,243,243, }; + u8 encoded_frame[] = { + 85, 171, 0, 66, 0, 4, 202, 0, 0, 0, 243, 243, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.fileio_write_resp.sequence = 202; - sbp_message_send(&sbp_state, SbpMsgFileioWriteResp, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgFileioWriteResp, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgFileioWriteResp, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgFileioWriteResp, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.fileio_write_resp.sequence == 202, "incorrect value for last_msg.msg.fileio_write_resp.sequence, expected 202, is %d", last_msg.msg.fileio_write_resp.sequence); + ck_assert_msg( + last_msg.msg.fileio_write_resp.sequence == 202, + "incorrect value for last_msg.msg.fileio_write_resp.sequence, expected " + "202, is %d", + last_msg.msg.fileio_write_resp.sequence); } } END_TEST -Suite* auto_check_sbp_file_io_MsgFileioWriteResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_file_io_MsgFileioWriteResp"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_file_io_MsgFileioWriteResp"); +Suite *auto_check_sbp_file_io_MsgFileioWriteResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_file_io_MsgFileioWriteResp"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_file_io_MsgFileioWriteResp"); tcase_add_test(tc_acq, test_auto_check_sbp_file_io_MsgFileioWriteResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_flash_MsgFlashDone.c b/c/test/auto_check_sbp_flash_MsgFlashDone.c index 712ccdfe0..e0dfe86db 100644 --- a/c/test/auto_check_sbp_flash_MsgFlashDone.c +++ b/c/test/auto_check_sbp_flash_MsgFlashDone.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashDone.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashDone.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_flash_MsgFlashDone ) -{ +START_TEST(test_auto_check_sbp_flash_MsgFlashDone) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_flash_MsgFlashDone ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,47 +90,57 @@ START_TEST( test_auto_check_sbp_flash_MsgFlashDone ) logging_reset(); - sbp_callback_register(&sbp_state, 0xe0, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xe0, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,224,0,195,4,1,82,6,54, }; + u8 encoded_frame[] = { + 85, 224, 0, 195, 4, 1, 82, 6, 54, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.flash_done.response = 82; - sbp_message_send(&sbp_state, SbpMsgFlashDone, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgFlashDone, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgFlashDone, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgFlashDone, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.flash_done.response == 82, "incorrect value for last_msg.msg.flash_done.response, expected 82, is %d", last_msg.msg.flash_done.response); + ck_assert_msg(last_msg.msg.flash_done.response == 82, + "incorrect value for last_msg.msg.flash_done.response, " + "expected 82, is %d", + last_msg.msg.flash_done.response); } } END_TEST -Suite* auto_check_sbp_flash_MsgFlashDone_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_flash_MsgFlashDone"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_flash_MsgFlashDone"); +Suite *auto_check_sbp_flash_MsgFlashDone_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_flash_MsgFlashDone"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_flash_MsgFlashDone"); tcase_add_test(tc_acq, test_auto_check_sbp_flash_MsgFlashDone); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_flash_MsgFlashErase.c b/c/test/auto_check_sbp_flash_MsgFlashErase.c index 03a1bc8be..29008ef61 100644 --- a/c/test/auto_check_sbp_flash_MsgFlashErase.c +++ b/c/test/auto_check_sbp_flash_MsgFlashErase.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashErase.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashErase.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_flash_MsgFlashErase ) -{ +START_TEST(test_auto_check_sbp_flash_MsgFlashErase) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_flash_MsgFlashErase ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,51 +90,64 @@ START_TEST( test_auto_check_sbp_flash_MsgFlashErase ) logging_reset(); - sbp_callback_register(&sbp_state, 0xe2, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xe2, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,226,0,195,4,5,74,238,177,118,132,0,251, }; + u8 encoded_frame[] = { + 85, 226, 0, 195, 4, 5, 74, 238, 177, 118, 132, 0, 251, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.flash_erase.sector_num = 2222371310; - + test_msg.flash_erase.target = 74; - sbp_message_send(&sbp_state, SbpMsgFlashErase, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgFlashErase, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgFlashErase, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgFlashErase, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.flash_erase.sector_num == 2222371310, "incorrect value for last_msg.msg.flash_erase.sector_num, expected 2222371310, is %d", last_msg.msg.flash_erase.sector_num); - - ck_assert_msg(last_msg.msg.flash_erase.target == 74, "incorrect value for last_msg.msg.flash_erase.target, expected 74, is %d", last_msg.msg.flash_erase.target); + ck_assert_msg(last_msg.msg.flash_erase.sector_num == 2222371310, + "incorrect value for last_msg.msg.flash_erase.sector_num, " + "expected 2222371310, is %d", + last_msg.msg.flash_erase.sector_num); + + ck_assert_msg(last_msg.msg.flash_erase.target == 74, + "incorrect value for last_msg.msg.flash_erase.target, " + "expected 74, is %d", + last_msg.msg.flash_erase.target); } } END_TEST -Suite* auto_check_sbp_flash_MsgFlashErase_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_flash_MsgFlashErase"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_flash_MsgFlashErase"); +Suite *auto_check_sbp_flash_MsgFlashErase_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_flash_MsgFlashErase"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_flash_MsgFlashErase"); tcase_add_test(tc_acq, test_auto_check_sbp_flash_MsgFlashErase); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_flash_MsgFlashProgram.c b/c/test/auto_check_sbp_flash_MsgFlashProgram.c index 4093b2a13..b34af9132 100644 --- a/c/test/auto_check_sbp_flash_MsgFlashProgram.c +++ b/c/test/auto_check_sbp_flash_MsgFlashProgram.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashProgram.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashProgram.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_flash_MsgFlashProgram ) -{ +START_TEST(test_auto_check_sbp_flash_MsgFlashProgram) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_flash_MsgFlashProgram ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,814 +90,1605 @@ START_TEST( test_auto_check_sbp_flash_MsgFlashProgram ) logging_reset(); - sbp_callback_register(&sbp_state, 0xe6, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xe6, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,230,0,195,4,255,212,87,52,244,250,176,222,235,106,144,29,141,255,3,16,192,237,172,254,213,4,220,98,34,222,230,214,6,217,172,122,46,13,38,240,236,60,121,47,252,163,141,222,29,168,214,118,55,201,233,21,214,57,245,246,19,3,121,49,231,37,186,58,238,98,39,70,232,133,25,10,134,129,69,228,134,9,88,183,133,171,255,166,100,152,231,92,9,196,106,246,29,145,156,151,32,67,188,63,233,142,174,139,154,127,35,60,56,187,121,103,135,152,182,88,160,255,227,240,54,100,91,31,141,102,130,254,54,227,229,62,53,225,143,88,139,126,235,235,35,54,134,163,92,57,87,130,178,22,158,18,237,209,187,226,1,46,64,226,235,213,186,159,221,186,25,115,84,131,167,201,104,1,200,13,50,71,73,193,201,250,172,193,13,20,238,130,243,68,4,72,46,194,113,255,238,15,230,64,178,127,217,92,160,201,118,163,144,58,28,174,65,73,45,123,118,83,107,239,168,32,212,191,81,93,186,223,32,19,58,137,72,217,151,251,83,20,113,37,151,34,37,71,95,105,235,144,164,83,197,254,183,223,91,19,45,227, }; + u8 encoded_frame[] = { + 85, 230, 0, 195, 4, 255, 212, 87, 52, 244, 250, 176, 222, 235, + 106, 144, 29, 141, 255, 3, 16, 192, 237, 172, 254, 213, 4, 220, + 98, 34, 222, 230, 214, 6, 217, 172, 122, 46, 13, 38, 240, 236, + 60, 121, 47, 252, 163, 141, 222, 29, 168, 214, 118, 55, 201, 233, + 21, 214, 57, 245, 246, 19, 3, 121, 49, 231, 37, 186, 58, 238, + 98, 39, 70, 232, 133, 25, 10, 134, 129, 69, 228, 134, 9, 88, + 183, 133, 171, 255, 166, 100, 152, 231, 92, 9, 196, 106, 246, 29, + 145, 156, 151, 32, 67, 188, 63, 233, 142, 174, 139, 154, 127, 35, + 60, 56, 187, 121, 103, 135, 152, 182, 88, 160, 255, 227, 240, 54, + 100, 91, 31, 141, 102, 130, 254, 54, 227, 229, 62, 53, 225, 143, + 88, 139, 126, 235, 235, 35, 54, 134, 163, 92, 57, 87, 130, 178, + 22, 158, 18, 237, 209, 187, 226, 1, 46, 64, 226, 235, 213, 186, + 159, 221, 186, 25, 115, 84, 131, 167, 201, 104, 1, 200, 13, 50, + 71, 73, 193, 201, 250, 172, 193, 13, 20, 238, 130, 243, 68, 4, + 72, 46, 194, 113, 255, 238, 15, 230, 64, 178, 127, 217, 92, 160, + 201, 118, 163, 144, 58, 28, 174, 65, 73, 45, 123, 118, 83, 107, + 239, 168, 32, 212, 191, 81, 93, 186, 223, 32, 19, 58, 137, 72, + 217, 151, 251, 83, 20, 113, 37, 151, 34, 37, 71, 95, 105, 235, + 144, 164, 83, 197, 254, 183, 223, 91, 19, 45, 227, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.flash_program.addr_len = 250; - - + test_msg.flash_program.addr_start[0] = 87; - + test_msg.flash_program.addr_start[1] = 52; - + test_msg.flash_program.addr_start[2] = 244; - - + test_msg.flash_program.data[0] = 176; - + test_msg.flash_program.data[1] = 222; - + test_msg.flash_program.data[2] = 235; - + test_msg.flash_program.data[3] = 106; - + test_msg.flash_program.data[4] = 144; - + test_msg.flash_program.data[5] = 29; - + test_msg.flash_program.data[6] = 141; - + test_msg.flash_program.data[7] = 255; - + test_msg.flash_program.data[8] = 3; - + test_msg.flash_program.data[9] = 16; - + test_msg.flash_program.data[10] = 192; - + test_msg.flash_program.data[11] = 237; - + test_msg.flash_program.data[12] = 172; - + test_msg.flash_program.data[13] = 254; - + test_msg.flash_program.data[14] = 213; - + test_msg.flash_program.data[15] = 4; - + test_msg.flash_program.data[16] = 220; - + test_msg.flash_program.data[17] = 98; - + test_msg.flash_program.data[18] = 34; - + test_msg.flash_program.data[19] = 222; - + test_msg.flash_program.data[20] = 230; - + test_msg.flash_program.data[21] = 214; - + test_msg.flash_program.data[22] = 6; - + test_msg.flash_program.data[23] = 217; - + test_msg.flash_program.data[24] = 172; - + test_msg.flash_program.data[25] = 122; - + test_msg.flash_program.data[26] = 46; - + test_msg.flash_program.data[27] = 13; - + test_msg.flash_program.data[28] = 38; - + test_msg.flash_program.data[29] = 240; - + test_msg.flash_program.data[30] = 236; - + test_msg.flash_program.data[31] = 60; - + test_msg.flash_program.data[32] = 121; - + test_msg.flash_program.data[33] = 47; - + test_msg.flash_program.data[34] = 252; - + test_msg.flash_program.data[35] = 163; - + test_msg.flash_program.data[36] = 141; - + test_msg.flash_program.data[37] = 222; - + test_msg.flash_program.data[38] = 29; - + test_msg.flash_program.data[39] = 168; - + test_msg.flash_program.data[40] = 214; - + test_msg.flash_program.data[41] = 118; - + test_msg.flash_program.data[42] = 55; - + test_msg.flash_program.data[43] = 201; - + test_msg.flash_program.data[44] = 233; - + test_msg.flash_program.data[45] = 21; - + test_msg.flash_program.data[46] = 214; - + test_msg.flash_program.data[47] = 57; - + test_msg.flash_program.data[48] = 245; - + test_msg.flash_program.data[49] = 246; - + test_msg.flash_program.data[50] = 19; - + test_msg.flash_program.data[51] = 3; - + test_msg.flash_program.data[52] = 121; - + test_msg.flash_program.data[53] = 49; - + test_msg.flash_program.data[54] = 231; - + test_msg.flash_program.data[55] = 37; - + test_msg.flash_program.data[56] = 186; - + test_msg.flash_program.data[57] = 58; - + test_msg.flash_program.data[58] = 238; - + test_msg.flash_program.data[59] = 98; - + test_msg.flash_program.data[60] = 39; - + test_msg.flash_program.data[61] = 70; - + test_msg.flash_program.data[62] = 232; - + test_msg.flash_program.data[63] = 133; - + test_msg.flash_program.data[64] = 25; - + test_msg.flash_program.data[65] = 10; - + test_msg.flash_program.data[66] = 134; - + test_msg.flash_program.data[67] = 129; - + test_msg.flash_program.data[68] = 69; - + test_msg.flash_program.data[69] = 228; - + test_msg.flash_program.data[70] = 134; - + test_msg.flash_program.data[71] = 9; - + test_msg.flash_program.data[72] = 88; - + test_msg.flash_program.data[73] = 183; - + test_msg.flash_program.data[74] = 133; - + test_msg.flash_program.data[75] = 171; - + test_msg.flash_program.data[76] = 255; - + test_msg.flash_program.data[77] = 166; - + test_msg.flash_program.data[78] = 100; - + test_msg.flash_program.data[79] = 152; - + test_msg.flash_program.data[80] = 231; - + test_msg.flash_program.data[81] = 92; - + test_msg.flash_program.data[82] = 9; - + test_msg.flash_program.data[83] = 196; - + test_msg.flash_program.data[84] = 106; - + test_msg.flash_program.data[85] = 246; - + test_msg.flash_program.data[86] = 29; - + test_msg.flash_program.data[87] = 145; - + test_msg.flash_program.data[88] = 156; - + test_msg.flash_program.data[89] = 151; - + test_msg.flash_program.data[90] = 32; - + test_msg.flash_program.data[91] = 67; - + test_msg.flash_program.data[92] = 188; - + test_msg.flash_program.data[93] = 63; - + test_msg.flash_program.data[94] = 233; - + test_msg.flash_program.data[95] = 142; - + test_msg.flash_program.data[96] = 174; - + test_msg.flash_program.data[97] = 139; - + test_msg.flash_program.data[98] = 154; - + test_msg.flash_program.data[99] = 127; - + test_msg.flash_program.data[100] = 35; - + test_msg.flash_program.data[101] = 60; - + test_msg.flash_program.data[102] = 56; - + test_msg.flash_program.data[103] = 187; - + test_msg.flash_program.data[104] = 121; - + test_msg.flash_program.data[105] = 103; - + test_msg.flash_program.data[106] = 135; - + test_msg.flash_program.data[107] = 152; - + test_msg.flash_program.data[108] = 182; - + test_msg.flash_program.data[109] = 88; - + test_msg.flash_program.data[110] = 160; - + test_msg.flash_program.data[111] = 255; - + test_msg.flash_program.data[112] = 227; - + test_msg.flash_program.data[113] = 240; - + test_msg.flash_program.data[114] = 54; - + test_msg.flash_program.data[115] = 100; - + test_msg.flash_program.data[116] = 91; - + test_msg.flash_program.data[117] = 31; - + test_msg.flash_program.data[118] = 141; - + test_msg.flash_program.data[119] = 102; - + test_msg.flash_program.data[120] = 130; - + test_msg.flash_program.data[121] = 254; - + test_msg.flash_program.data[122] = 54; - + test_msg.flash_program.data[123] = 227; - + test_msg.flash_program.data[124] = 229; - + test_msg.flash_program.data[125] = 62; - + test_msg.flash_program.data[126] = 53; - + test_msg.flash_program.data[127] = 225; - + test_msg.flash_program.data[128] = 143; - + test_msg.flash_program.data[129] = 88; - + test_msg.flash_program.data[130] = 139; - + test_msg.flash_program.data[131] = 126; - + test_msg.flash_program.data[132] = 235; - + test_msg.flash_program.data[133] = 235; - + test_msg.flash_program.data[134] = 35; - + test_msg.flash_program.data[135] = 54; - + test_msg.flash_program.data[136] = 134; - + test_msg.flash_program.data[137] = 163; - + test_msg.flash_program.data[138] = 92; - + test_msg.flash_program.data[139] = 57; - + test_msg.flash_program.data[140] = 87; - + test_msg.flash_program.data[141] = 130; - + test_msg.flash_program.data[142] = 178; - + test_msg.flash_program.data[143] = 22; - + test_msg.flash_program.data[144] = 158; - + test_msg.flash_program.data[145] = 18; - + test_msg.flash_program.data[146] = 237; - + test_msg.flash_program.data[147] = 209; - + test_msg.flash_program.data[148] = 187; - + test_msg.flash_program.data[149] = 226; - + test_msg.flash_program.data[150] = 1; - + test_msg.flash_program.data[151] = 46; - + test_msg.flash_program.data[152] = 64; - + test_msg.flash_program.data[153] = 226; - + test_msg.flash_program.data[154] = 235; - + test_msg.flash_program.data[155] = 213; - + test_msg.flash_program.data[156] = 186; - + test_msg.flash_program.data[157] = 159; - + test_msg.flash_program.data[158] = 221; - + test_msg.flash_program.data[159] = 186; - + test_msg.flash_program.data[160] = 25; - + test_msg.flash_program.data[161] = 115; - + test_msg.flash_program.data[162] = 84; - + test_msg.flash_program.data[163] = 131; - + test_msg.flash_program.data[164] = 167; - + test_msg.flash_program.data[165] = 201; - + test_msg.flash_program.data[166] = 104; - + test_msg.flash_program.data[167] = 1; - + test_msg.flash_program.data[168] = 200; - + test_msg.flash_program.data[169] = 13; - + test_msg.flash_program.data[170] = 50; - + test_msg.flash_program.data[171] = 71; - + test_msg.flash_program.data[172] = 73; - + test_msg.flash_program.data[173] = 193; - + test_msg.flash_program.data[174] = 201; - + test_msg.flash_program.data[175] = 250; - + test_msg.flash_program.data[176] = 172; - + test_msg.flash_program.data[177] = 193; - + test_msg.flash_program.data[178] = 13; - + test_msg.flash_program.data[179] = 20; - + test_msg.flash_program.data[180] = 238; - + test_msg.flash_program.data[181] = 130; - + test_msg.flash_program.data[182] = 243; - + test_msg.flash_program.data[183] = 68; - + test_msg.flash_program.data[184] = 4; - + test_msg.flash_program.data[185] = 72; - + test_msg.flash_program.data[186] = 46; - + test_msg.flash_program.data[187] = 194; - + test_msg.flash_program.data[188] = 113; - + test_msg.flash_program.data[189] = 255; - + test_msg.flash_program.data[190] = 238; - + test_msg.flash_program.data[191] = 15; - + test_msg.flash_program.data[192] = 230; - + test_msg.flash_program.data[193] = 64; - + test_msg.flash_program.data[194] = 178; - + test_msg.flash_program.data[195] = 127; - + test_msg.flash_program.data[196] = 217; - + test_msg.flash_program.data[197] = 92; - + test_msg.flash_program.data[198] = 160; - + test_msg.flash_program.data[199] = 201; - + test_msg.flash_program.data[200] = 118; - + test_msg.flash_program.data[201] = 163; - + test_msg.flash_program.data[202] = 144; - + test_msg.flash_program.data[203] = 58; - + test_msg.flash_program.data[204] = 28; - + test_msg.flash_program.data[205] = 174; - + test_msg.flash_program.data[206] = 65; - + test_msg.flash_program.data[207] = 73; - + test_msg.flash_program.data[208] = 45; - + test_msg.flash_program.data[209] = 123; - + test_msg.flash_program.data[210] = 118; - + test_msg.flash_program.data[211] = 83; - + test_msg.flash_program.data[212] = 107; - + test_msg.flash_program.data[213] = 239; - + test_msg.flash_program.data[214] = 168; - + test_msg.flash_program.data[215] = 32; - + test_msg.flash_program.data[216] = 212; - + test_msg.flash_program.data[217] = 191; - + test_msg.flash_program.data[218] = 81; - + test_msg.flash_program.data[219] = 93; - + test_msg.flash_program.data[220] = 186; - + test_msg.flash_program.data[221] = 223; - + test_msg.flash_program.data[222] = 32; - + test_msg.flash_program.data[223] = 19; - + test_msg.flash_program.data[224] = 58; - + test_msg.flash_program.data[225] = 137; - + test_msg.flash_program.data[226] = 72; - + test_msg.flash_program.data[227] = 217; - + test_msg.flash_program.data[228] = 151; - + test_msg.flash_program.data[229] = 251; - + test_msg.flash_program.data[230] = 83; - + test_msg.flash_program.data[231] = 20; - + test_msg.flash_program.data[232] = 113; - + test_msg.flash_program.data[233] = 37; - + test_msg.flash_program.data[234] = 151; - + test_msg.flash_program.data[235] = 34; - + test_msg.flash_program.data[236] = 37; - + test_msg.flash_program.data[237] = 71; - + test_msg.flash_program.data[238] = 95; - + test_msg.flash_program.data[239] = 105; - + test_msg.flash_program.data[240] = 235; - + test_msg.flash_program.data[241] = 144; - + test_msg.flash_program.data[242] = 164; - + test_msg.flash_program.data[243] = 83; - + test_msg.flash_program.data[244] = 197; - + test_msg.flash_program.data[245] = 254; - + test_msg.flash_program.data[246] = 183; - + test_msg.flash_program.data[247] = 223; - + test_msg.flash_program.data[248] = 91; - + test_msg.flash_program.data[249] = 19; - + test_msg.flash_program.target = 212; - sbp_message_send(&sbp_state, SbpMsgFlashProgram, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgFlashProgram, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgFlashProgram, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgFlashProgram, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.flash_program.addr_len == 250, "incorrect value for last_msg.msg.flash_program.addr_len, expected 250, is %d", last_msg.msg.flash_program.addr_len); - - ck_assert_msg(last_msg.msg.flash_program.addr_start[0] == 87, "incorrect value for last_msg.msg.flash_program.addr_start[0], expected 87, is %d", last_msg.msg.flash_program.addr_start[0]); - ck_assert_msg(last_msg.msg.flash_program.addr_start[1] == 52, "incorrect value for last_msg.msg.flash_program.addr_start[1], expected 52, is %d", last_msg.msg.flash_program.addr_start[1]); - ck_assert_msg(last_msg.msg.flash_program.addr_start[2] == 244, "incorrect value for last_msg.msg.flash_program.addr_start[2], expected 244, is %d", last_msg.msg.flash_program.addr_start[2]); - - ck_assert_msg(last_msg.msg.flash_program.data[0] == 176, "incorrect value for last_msg.msg.flash_program.data[0], expected 176, is %d", last_msg.msg.flash_program.data[0]); - ck_assert_msg(last_msg.msg.flash_program.data[1] == 222, "incorrect value for last_msg.msg.flash_program.data[1], expected 222, is %d", last_msg.msg.flash_program.data[1]); - ck_assert_msg(last_msg.msg.flash_program.data[2] == 235, "incorrect value for last_msg.msg.flash_program.data[2], expected 235, is %d", last_msg.msg.flash_program.data[2]); - ck_assert_msg(last_msg.msg.flash_program.data[3] == 106, "incorrect value for last_msg.msg.flash_program.data[3], expected 106, is %d", last_msg.msg.flash_program.data[3]); - ck_assert_msg(last_msg.msg.flash_program.data[4] == 144, "incorrect value for last_msg.msg.flash_program.data[4], expected 144, is %d", last_msg.msg.flash_program.data[4]); - ck_assert_msg(last_msg.msg.flash_program.data[5] == 29, "incorrect value for last_msg.msg.flash_program.data[5], expected 29, is %d", last_msg.msg.flash_program.data[5]); - ck_assert_msg(last_msg.msg.flash_program.data[6] == 141, "incorrect value for last_msg.msg.flash_program.data[6], expected 141, is %d", last_msg.msg.flash_program.data[6]); - ck_assert_msg(last_msg.msg.flash_program.data[7] == 255, "incorrect value for last_msg.msg.flash_program.data[7], expected 255, is %d", last_msg.msg.flash_program.data[7]); - ck_assert_msg(last_msg.msg.flash_program.data[8] == 3, "incorrect value for last_msg.msg.flash_program.data[8], expected 3, is %d", last_msg.msg.flash_program.data[8]); - ck_assert_msg(last_msg.msg.flash_program.data[9] == 16, "incorrect value for last_msg.msg.flash_program.data[9], expected 16, is %d", last_msg.msg.flash_program.data[9]); - ck_assert_msg(last_msg.msg.flash_program.data[10] == 192, "incorrect value for last_msg.msg.flash_program.data[10], expected 192, is %d", last_msg.msg.flash_program.data[10]); - ck_assert_msg(last_msg.msg.flash_program.data[11] == 237, "incorrect value for last_msg.msg.flash_program.data[11], expected 237, is %d", last_msg.msg.flash_program.data[11]); - ck_assert_msg(last_msg.msg.flash_program.data[12] == 172, "incorrect value for last_msg.msg.flash_program.data[12], expected 172, is %d", last_msg.msg.flash_program.data[12]); - ck_assert_msg(last_msg.msg.flash_program.data[13] == 254, "incorrect value for last_msg.msg.flash_program.data[13], expected 254, is %d", last_msg.msg.flash_program.data[13]); - ck_assert_msg(last_msg.msg.flash_program.data[14] == 213, "incorrect value for last_msg.msg.flash_program.data[14], expected 213, is %d", last_msg.msg.flash_program.data[14]); - ck_assert_msg(last_msg.msg.flash_program.data[15] == 4, "incorrect value for last_msg.msg.flash_program.data[15], expected 4, is %d", last_msg.msg.flash_program.data[15]); - ck_assert_msg(last_msg.msg.flash_program.data[16] == 220, "incorrect value for last_msg.msg.flash_program.data[16], expected 220, is %d", last_msg.msg.flash_program.data[16]); - ck_assert_msg(last_msg.msg.flash_program.data[17] == 98, "incorrect value for last_msg.msg.flash_program.data[17], expected 98, is %d", last_msg.msg.flash_program.data[17]); - ck_assert_msg(last_msg.msg.flash_program.data[18] == 34, "incorrect value for last_msg.msg.flash_program.data[18], expected 34, is %d", last_msg.msg.flash_program.data[18]); - ck_assert_msg(last_msg.msg.flash_program.data[19] == 222, "incorrect value for last_msg.msg.flash_program.data[19], expected 222, is %d", last_msg.msg.flash_program.data[19]); - ck_assert_msg(last_msg.msg.flash_program.data[20] == 230, "incorrect value for last_msg.msg.flash_program.data[20], expected 230, is %d", last_msg.msg.flash_program.data[20]); - ck_assert_msg(last_msg.msg.flash_program.data[21] == 214, "incorrect value for last_msg.msg.flash_program.data[21], expected 214, is %d", last_msg.msg.flash_program.data[21]); - ck_assert_msg(last_msg.msg.flash_program.data[22] == 6, "incorrect value for last_msg.msg.flash_program.data[22], expected 6, is %d", last_msg.msg.flash_program.data[22]); - ck_assert_msg(last_msg.msg.flash_program.data[23] == 217, "incorrect value for last_msg.msg.flash_program.data[23], expected 217, is %d", last_msg.msg.flash_program.data[23]); - ck_assert_msg(last_msg.msg.flash_program.data[24] == 172, "incorrect value for last_msg.msg.flash_program.data[24], expected 172, is %d", last_msg.msg.flash_program.data[24]); - ck_assert_msg(last_msg.msg.flash_program.data[25] == 122, "incorrect value for last_msg.msg.flash_program.data[25], expected 122, is %d", last_msg.msg.flash_program.data[25]); - ck_assert_msg(last_msg.msg.flash_program.data[26] == 46, "incorrect value for last_msg.msg.flash_program.data[26], expected 46, is %d", last_msg.msg.flash_program.data[26]); - ck_assert_msg(last_msg.msg.flash_program.data[27] == 13, "incorrect value for last_msg.msg.flash_program.data[27], expected 13, is %d", last_msg.msg.flash_program.data[27]); - ck_assert_msg(last_msg.msg.flash_program.data[28] == 38, "incorrect value for last_msg.msg.flash_program.data[28], expected 38, is %d", last_msg.msg.flash_program.data[28]); - ck_assert_msg(last_msg.msg.flash_program.data[29] == 240, "incorrect value for last_msg.msg.flash_program.data[29], expected 240, is %d", last_msg.msg.flash_program.data[29]); - ck_assert_msg(last_msg.msg.flash_program.data[30] == 236, "incorrect value for last_msg.msg.flash_program.data[30], expected 236, is %d", last_msg.msg.flash_program.data[30]); - ck_assert_msg(last_msg.msg.flash_program.data[31] == 60, "incorrect value for last_msg.msg.flash_program.data[31], expected 60, is %d", last_msg.msg.flash_program.data[31]); - ck_assert_msg(last_msg.msg.flash_program.data[32] == 121, "incorrect value for last_msg.msg.flash_program.data[32], expected 121, is %d", last_msg.msg.flash_program.data[32]); - ck_assert_msg(last_msg.msg.flash_program.data[33] == 47, "incorrect value for last_msg.msg.flash_program.data[33], expected 47, is %d", last_msg.msg.flash_program.data[33]); - ck_assert_msg(last_msg.msg.flash_program.data[34] == 252, "incorrect value for last_msg.msg.flash_program.data[34], expected 252, is %d", last_msg.msg.flash_program.data[34]); - ck_assert_msg(last_msg.msg.flash_program.data[35] == 163, "incorrect value for last_msg.msg.flash_program.data[35], expected 163, is %d", last_msg.msg.flash_program.data[35]); - ck_assert_msg(last_msg.msg.flash_program.data[36] == 141, "incorrect value for last_msg.msg.flash_program.data[36], expected 141, is %d", last_msg.msg.flash_program.data[36]); - ck_assert_msg(last_msg.msg.flash_program.data[37] == 222, "incorrect value for last_msg.msg.flash_program.data[37], expected 222, is %d", last_msg.msg.flash_program.data[37]); - ck_assert_msg(last_msg.msg.flash_program.data[38] == 29, "incorrect value for last_msg.msg.flash_program.data[38], expected 29, is %d", last_msg.msg.flash_program.data[38]); - ck_assert_msg(last_msg.msg.flash_program.data[39] == 168, "incorrect value for last_msg.msg.flash_program.data[39], expected 168, is %d", last_msg.msg.flash_program.data[39]); - ck_assert_msg(last_msg.msg.flash_program.data[40] == 214, "incorrect value for last_msg.msg.flash_program.data[40], expected 214, is %d", last_msg.msg.flash_program.data[40]); - ck_assert_msg(last_msg.msg.flash_program.data[41] == 118, "incorrect value for last_msg.msg.flash_program.data[41], expected 118, is %d", last_msg.msg.flash_program.data[41]); - ck_assert_msg(last_msg.msg.flash_program.data[42] == 55, "incorrect value for last_msg.msg.flash_program.data[42], expected 55, is %d", last_msg.msg.flash_program.data[42]); - ck_assert_msg(last_msg.msg.flash_program.data[43] == 201, "incorrect value for last_msg.msg.flash_program.data[43], expected 201, is %d", last_msg.msg.flash_program.data[43]); - ck_assert_msg(last_msg.msg.flash_program.data[44] == 233, "incorrect value for last_msg.msg.flash_program.data[44], expected 233, is %d", last_msg.msg.flash_program.data[44]); - ck_assert_msg(last_msg.msg.flash_program.data[45] == 21, "incorrect value for last_msg.msg.flash_program.data[45], expected 21, is %d", last_msg.msg.flash_program.data[45]); - ck_assert_msg(last_msg.msg.flash_program.data[46] == 214, "incorrect value for last_msg.msg.flash_program.data[46], expected 214, is %d", last_msg.msg.flash_program.data[46]); - ck_assert_msg(last_msg.msg.flash_program.data[47] == 57, "incorrect value for last_msg.msg.flash_program.data[47], expected 57, is %d", last_msg.msg.flash_program.data[47]); - ck_assert_msg(last_msg.msg.flash_program.data[48] == 245, "incorrect value for last_msg.msg.flash_program.data[48], expected 245, is %d", last_msg.msg.flash_program.data[48]); - ck_assert_msg(last_msg.msg.flash_program.data[49] == 246, "incorrect value for last_msg.msg.flash_program.data[49], expected 246, is %d", last_msg.msg.flash_program.data[49]); - ck_assert_msg(last_msg.msg.flash_program.data[50] == 19, "incorrect value for last_msg.msg.flash_program.data[50], expected 19, is %d", last_msg.msg.flash_program.data[50]); - ck_assert_msg(last_msg.msg.flash_program.data[51] == 3, "incorrect value for last_msg.msg.flash_program.data[51], expected 3, is %d", last_msg.msg.flash_program.data[51]); - ck_assert_msg(last_msg.msg.flash_program.data[52] == 121, "incorrect value for last_msg.msg.flash_program.data[52], expected 121, is %d", last_msg.msg.flash_program.data[52]); - ck_assert_msg(last_msg.msg.flash_program.data[53] == 49, "incorrect value for last_msg.msg.flash_program.data[53], expected 49, is %d", last_msg.msg.flash_program.data[53]); - ck_assert_msg(last_msg.msg.flash_program.data[54] == 231, "incorrect value for last_msg.msg.flash_program.data[54], expected 231, is %d", last_msg.msg.flash_program.data[54]); - ck_assert_msg(last_msg.msg.flash_program.data[55] == 37, "incorrect value for last_msg.msg.flash_program.data[55], expected 37, is %d", last_msg.msg.flash_program.data[55]); - ck_assert_msg(last_msg.msg.flash_program.data[56] == 186, "incorrect value for last_msg.msg.flash_program.data[56], expected 186, is %d", last_msg.msg.flash_program.data[56]); - ck_assert_msg(last_msg.msg.flash_program.data[57] == 58, "incorrect value for last_msg.msg.flash_program.data[57], expected 58, is %d", last_msg.msg.flash_program.data[57]); - ck_assert_msg(last_msg.msg.flash_program.data[58] == 238, "incorrect value for last_msg.msg.flash_program.data[58], expected 238, is %d", last_msg.msg.flash_program.data[58]); - ck_assert_msg(last_msg.msg.flash_program.data[59] == 98, "incorrect value for last_msg.msg.flash_program.data[59], expected 98, is %d", last_msg.msg.flash_program.data[59]); - ck_assert_msg(last_msg.msg.flash_program.data[60] == 39, "incorrect value for last_msg.msg.flash_program.data[60], expected 39, is %d", last_msg.msg.flash_program.data[60]); - ck_assert_msg(last_msg.msg.flash_program.data[61] == 70, "incorrect value for last_msg.msg.flash_program.data[61], expected 70, is %d", last_msg.msg.flash_program.data[61]); - ck_assert_msg(last_msg.msg.flash_program.data[62] == 232, "incorrect value for last_msg.msg.flash_program.data[62], expected 232, is %d", last_msg.msg.flash_program.data[62]); - ck_assert_msg(last_msg.msg.flash_program.data[63] == 133, "incorrect value for last_msg.msg.flash_program.data[63], expected 133, is %d", last_msg.msg.flash_program.data[63]); - ck_assert_msg(last_msg.msg.flash_program.data[64] == 25, "incorrect value for last_msg.msg.flash_program.data[64], expected 25, is %d", last_msg.msg.flash_program.data[64]); - ck_assert_msg(last_msg.msg.flash_program.data[65] == 10, "incorrect value for last_msg.msg.flash_program.data[65], expected 10, is %d", last_msg.msg.flash_program.data[65]); - ck_assert_msg(last_msg.msg.flash_program.data[66] == 134, "incorrect value for last_msg.msg.flash_program.data[66], expected 134, is %d", last_msg.msg.flash_program.data[66]); - ck_assert_msg(last_msg.msg.flash_program.data[67] == 129, "incorrect value for last_msg.msg.flash_program.data[67], expected 129, is %d", last_msg.msg.flash_program.data[67]); - ck_assert_msg(last_msg.msg.flash_program.data[68] == 69, "incorrect value for last_msg.msg.flash_program.data[68], expected 69, is %d", last_msg.msg.flash_program.data[68]); - ck_assert_msg(last_msg.msg.flash_program.data[69] == 228, "incorrect value for last_msg.msg.flash_program.data[69], expected 228, is %d", last_msg.msg.flash_program.data[69]); - ck_assert_msg(last_msg.msg.flash_program.data[70] == 134, "incorrect value for last_msg.msg.flash_program.data[70], expected 134, is %d", last_msg.msg.flash_program.data[70]); - ck_assert_msg(last_msg.msg.flash_program.data[71] == 9, "incorrect value for last_msg.msg.flash_program.data[71], expected 9, is %d", last_msg.msg.flash_program.data[71]); - ck_assert_msg(last_msg.msg.flash_program.data[72] == 88, "incorrect value for last_msg.msg.flash_program.data[72], expected 88, is %d", last_msg.msg.flash_program.data[72]); - ck_assert_msg(last_msg.msg.flash_program.data[73] == 183, "incorrect value for last_msg.msg.flash_program.data[73], expected 183, is %d", last_msg.msg.flash_program.data[73]); - ck_assert_msg(last_msg.msg.flash_program.data[74] == 133, "incorrect value for last_msg.msg.flash_program.data[74], expected 133, is %d", last_msg.msg.flash_program.data[74]); - ck_assert_msg(last_msg.msg.flash_program.data[75] == 171, "incorrect value for last_msg.msg.flash_program.data[75], expected 171, is %d", last_msg.msg.flash_program.data[75]); - ck_assert_msg(last_msg.msg.flash_program.data[76] == 255, "incorrect value for last_msg.msg.flash_program.data[76], expected 255, is %d", last_msg.msg.flash_program.data[76]); - ck_assert_msg(last_msg.msg.flash_program.data[77] == 166, "incorrect value for last_msg.msg.flash_program.data[77], expected 166, is %d", last_msg.msg.flash_program.data[77]); - ck_assert_msg(last_msg.msg.flash_program.data[78] == 100, "incorrect value for last_msg.msg.flash_program.data[78], expected 100, is %d", last_msg.msg.flash_program.data[78]); - ck_assert_msg(last_msg.msg.flash_program.data[79] == 152, "incorrect value for last_msg.msg.flash_program.data[79], expected 152, is %d", last_msg.msg.flash_program.data[79]); - ck_assert_msg(last_msg.msg.flash_program.data[80] == 231, "incorrect value for last_msg.msg.flash_program.data[80], expected 231, is %d", last_msg.msg.flash_program.data[80]); - ck_assert_msg(last_msg.msg.flash_program.data[81] == 92, "incorrect value for last_msg.msg.flash_program.data[81], expected 92, is %d", last_msg.msg.flash_program.data[81]); - ck_assert_msg(last_msg.msg.flash_program.data[82] == 9, "incorrect value for last_msg.msg.flash_program.data[82], expected 9, is %d", last_msg.msg.flash_program.data[82]); - ck_assert_msg(last_msg.msg.flash_program.data[83] == 196, "incorrect value for last_msg.msg.flash_program.data[83], expected 196, is %d", last_msg.msg.flash_program.data[83]); - ck_assert_msg(last_msg.msg.flash_program.data[84] == 106, "incorrect value for last_msg.msg.flash_program.data[84], expected 106, is %d", last_msg.msg.flash_program.data[84]); - ck_assert_msg(last_msg.msg.flash_program.data[85] == 246, "incorrect value for last_msg.msg.flash_program.data[85], expected 246, is %d", last_msg.msg.flash_program.data[85]); - ck_assert_msg(last_msg.msg.flash_program.data[86] == 29, "incorrect value for last_msg.msg.flash_program.data[86], expected 29, is %d", last_msg.msg.flash_program.data[86]); - ck_assert_msg(last_msg.msg.flash_program.data[87] == 145, "incorrect value for last_msg.msg.flash_program.data[87], expected 145, is %d", last_msg.msg.flash_program.data[87]); - ck_assert_msg(last_msg.msg.flash_program.data[88] == 156, "incorrect value for last_msg.msg.flash_program.data[88], expected 156, is %d", last_msg.msg.flash_program.data[88]); - ck_assert_msg(last_msg.msg.flash_program.data[89] == 151, "incorrect value for last_msg.msg.flash_program.data[89], expected 151, is %d", last_msg.msg.flash_program.data[89]); - ck_assert_msg(last_msg.msg.flash_program.data[90] == 32, "incorrect value for last_msg.msg.flash_program.data[90], expected 32, is %d", last_msg.msg.flash_program.data[90]); - ck_assert_msg(last_msg.msg.flash_program.data[91] == 67, "incorrect value for last_msg.msg.flash_program.data[91], expected 67, is %d", last_msg.msg.flash_program.data[91]); - ck_assert_msg(last_msg.msg.flash_program.data[92] == 188, "incorrect value for last_msg.msg.flash_program.data[92], expected 188, is %d", last_msg.msg.flash_program.data[92]); - ck_assert_msg(last_msg.msg.flash_program.data[93] == 63, "incorrect value for last_msg.msg.flash_program.data[93], expected 63, is %d", last_msg.msg.flash_program.data[93]); - ck_assert_msg(last_msg.msg.flash_program.data[94] == 233, "incorrect value for last_msg.msg.flash_program.data[94], expected 233, is %d", last_msg.msg.flash_program.data[94]); - ck_assert_msg(last_msg.msg.flash_program.data[95] == 142, "incorrect value for last_msg.msg.flash_program.data[95], expected 142, is %d", last_msg.msg.flash_program.data[95]); - ck_assert_msg(last_msg.msg.flash_program.data[96] == 174, "incorrect value for last_msg.msg.flash_program.data[96], expected 174, is %d", last_msg.msg.flash_program.data[96]); - ck_assert_msg(last_msg.msg.flash_program.data[97] == 139, "incorrect value for last_msg.msg.flash_program.data[97], expected 139, is %d", last_msg.msg.flash_program.data[97]); - ck_assert_msg(last_msg.msg.flash_program.data[98] == 154, "incorrect value for last_msg.msg.flash_program.data[98], expected 154, is %d", last_msg.msg.flash_program.data[98]); - ck_assert_msg(last_msg.msg.flash_program.data[99] == 127, "incorrect value for last_msg.msg.flash_program.data[99], expected 127, is %d", last_msg.msg.flash_program.data[99]); - ck_assert_msg(last_msg.msg.flash_program.data[100] == 35, "incorrect value for last_msg.msg.flash_program.data[100], expected 35, is %d", last_msg.msg.flash_program.data[100]); - ck_assert_msg(last_msg.msg.flash_program.data[101] == 60, "incorrect value for last_msg.msg.flash_program.data[101], expected 60, is %d", last_msg.msg.flash_program.data[101]); - ck_assert_msg(last_msg.msg.flash_program.data[102] == 56, "incorrect value for last_msg.msg.flash_program.data[102], expected 56, is %d", last_msg.msg.flash_program.data[102]); - ck_assert_msg(last_msg.msg.flash_program.data[103] == 187, "incorrect value for last_msg.msg.flash_program.data[103], expected 187, is %d", last_msg.msg.flash_program.data[103]); - ck_assert_msg(last_msg.msg.flash_program.data[104] == 121, "incorrect value for last_msg.msg.flash_program.data[104], expected 121, is %d", last_msg.msg.flash_program.data[104]); - ck_assert_msg(last_msg.msg.flash_program.data[105] == 103, "incorrect value for last_msg.msg.flash_program.data[105], expected 103, is %d", last_msg.msg.flash_program.data[105]); - ck_assert_msg(last_msg.msg.flash_program.data[106] == 135, "incorrect value for last_msg.msg.flash_program.data[106], expected 135, is %d", last_msg.msg.flash_program.data[106]); - ck_assert_msg(last_msg.msg.flash_program.data[107] == 152, "incorrect value for last_msg.msg.flash_program.data[107], expected 152, is %d", last_msg.msg.flash_program.data[107]); - ck_assert_msg(last_msg.msg.flash_program.data[108] == 182, "incorrect value for last_msg.msg.flash_program.data[108], expected 182, is %d", last_msg.msg.flash_program.data[108]); - ck_assert_msg(last_msg.msg.flash_program.data[109] == 88, "incorrect value for last_msg.msg.flash_program.data[109], expected 88, is %d", last_msg.msg.flash_program.data[109]); - ck_assert_msg(last_msg.msg.flash_program.data[110] == 160, "incorrect value for last_msg.msg.flash_program.data[110], expected 160, is %d", last_msg.msg.flash_program.data[110]); - ck_assert_msg(last_msg.msg.flash_program.data[111] == 255, "incorrect value for last_msg.msg.flash_program.data[111], expected 255, is %d", last_msg.msg.flash_program.data[111]); - ck_assert_msg(last_msg.msg.flash_program.data[112] == 227, "incorrect value for last_msg.msg.flash_program.data[112], expected 227, is %d", last_msg.msg.flash_program.data[112]); - ck_assert_msg(last_msg.msg.flash_program.data[113] == 240, "incorrect value for last_msg.msg.flash_program.data[113], expected 240, is %d", last_msg.msg.flash_program.data[113]); - ck_assert_msg(last_msg.msg.flash_program.data[114] == 54, "incorrect value for last_msg.msg.flash_program.data[114], expected 54, is %d", last_msg.msg.flash_program.data[114]); - ck_assert_msg(last_msg.msg.flash_program.data[115] == 100, "incorrect value for last_msg.msg.flash_program.data[115], expected 100, is %d", last_msg.msg.flash_program.data[115]); - ck_assert_msg(last_msg.msg.flash_program.data[116] == 91, "incorrect value for last_msg.msg.flash_program.data[116], expected 91, is %d", last_msg.msg.flash_program.data[116]); - ck_assert_msg(last_msg.msg.flash_program.data[117] == 31, "incorrect value for last_msg.msg.flash_program.data[117], expected 31, is %d", last_msg.msg.flash_program.data[117]); - ck_assert_msg(last_msg.msg.flash_program.data[118] == 141, "incorrect value for last_msg.msg.flash_program.data[118], expected 141, is %d", last_msg.msg.flash_program.data[118]); - ck_assert_msg(last_msg.msg.flash_program.data[119] == 102, "incorrect value for last_msg.msg.flash_program.data[119], expected 102, is %d", last_msg.msg.flash_program.data[119]); - ck_assert_msg(last_msg.msg.flash_program.data[120] == 130, "incorrect value for last_msg.msg.flash_program.data[120], expected 130, is %d", last_msg.msg.flash_program.data[120]); - ck_assert_msg(last_msg.msg.flash_program.data[121] == 254, "incorrect value for last_msg.msg.flash_program.data[121], expected 254, is %d", last_msg.msg.flash_program.data[121]); - ck_assert_msg(last_msg.msg.flash_program.data[122] == 54, "incorrect value for last_msg.msg.flash_program.data[122], expected 54, is %d", last_msg.msg.flash_program.data[122]); - ck_assert_msg(last_msg.msg.flash_program.data[123] == 227, "incorrect value for last_msg.msg.flash_program.data[123], expected 227, is %d", last_msg.msg.flash_program.data[123]); - ck_assert_msg(last_msg.msg.flash_program.data[124] == 229, "incorrect value for last_msg.msg.flash_program.data[124], expected 229, is %d", last_msg.msg.flash_program.data[124]); - ck_assert_msg(last_msg.msg.flash_program.data[125] == 62, "incorrect value for last_msg.msg.flash_program.data[125], expected 62, is %d", last_msg.msg.flash_program.data[125]); - ck_assert_msg(last_msg.msg.flash_program.data[126] == 53, "incorrect value for last_msg.msg.flash_program.data[126], expected 53, is %d", last_msg.msg.flash_program.data[126]); - ck_assert_msg(last_msg.msg.flash_program.data[127] == 225, "incorrect value for last_msg.msg.flash_program.data[127], expected 225, is %d", last_msg.msg.flash_program.data[127]); - ck_assert_msg(last_msg.msg.flash_program.data[128] == 143, "incorrect value for last_msg.msg.flash_program.data[128], expected 143, is %d", last_msg.msg.flash_program.data[128]); - ck_assert_msg(last_msg.msg.flash_program.data[129] == 88, "incorrect value for last_msg.msg.flash_program.data[129], expected 88, is %d", last_msg.msg.flash_program.data[129]); - ck_assert_msg(last_msg.msg.flash_program.data[130] == 139, "incorrect value for last_msg.msg.flash_program.data[130], expected 139, is %d", last_msg.msg.flash_program.data[130]); - ck_assert_msg(last_msg.msg.flash_program.data[131] == 126, "incorrect value for last_msg.msg.flash_program.data[131], expected 126, is %d", last_msg.msg.flash_program.data[131]); - ck_assert_msg(last_msg.msg.flash_program.data[132] == 235, "incorrect value for last_msg.msg.flash_program.data[132], expected 235, is %d", last_msg.msg.flash_program.data[132]); - ck_assert_msg(last_msg.msg.flash_program.data[133] == 235, "incorrect value for last_msg.msg.flash_program.data[133], expected 235, is %d", last_msg.msg.flash_program.data[133]); - ck_assert_msg(last_msg.msg.flash_program.data[134] == 35, "incorrect value for last_msg.msg.flash_program.data[134], expected 35, is %d", last_msg.msg.flash_program.data[134]); - ck_assert_msg(last_msg.msg.flash_program.data[135] == 54, "incorrect value for last_msg.msg.flash_program.data[135], expected 54, is %d", last_msg.msg.flash_program.data[135]); - ck_assert_msg(last_msg.msg.flash_program.data[136] == 134, "incorrect value for last_msg.msg.flash_program.data[136], expected 134, is %d", last_msg.msg.flash_program.data[136]); - ck_assert_msg(last_msg.msg.flash_program.data[137] == 163, "incorrect value for last_msg.msg.flash_program.data[137], expected 163, is %d", last_msg.msg.flash_program.data[137]); - ck_assert_msg(last_msg.msg.flash_program.data[138] == 92, "incorrect value for last_msg.msg.flash_program.data[138], expected 92, is %d", last_msg.msg.flash_program.data[138]); - ck_assert_msg(last_msg.msg.flash_program.data[139] == 57, "incorrect value for last_msg.msg.flash_program.data[139], expected 57, is %d", last_msg.msg.flash_program.data[139]); - ck_assert_msg(last_msg.msg.flash_program.data[140] == 87, "incorrect value for last_msg.msg.flash_program.data[140], expected 87, is %d", last_msg.msg.flash_program.data[140]); - ck_assert_msg(last_msg.msg.flash_program.data[141] == 130, "incorrect value for last_msg.msg.flash_program.data[141], expected 130, is %d", last_msg.msg.flash_program.data[141]); - ck_assert_msg(last_msg.msg.flash_program.data[142] == 178, "incorrect value for last_msg.msg.flash_program.data[142], expected 178, is %d", last_msg.msg.flash_program.data[142]); - ck_assert_msg(last_msg.msg.flash_program.data[143] == 22, "incorrect value for last_msg.msg.flash_program.data[143], expected 22, is %d", last_msg.msg.flash_program.data[143]); - ck_assert_msg(last_msg.msg.flash_program.data[144] == 158, "incorrect value for last_msg.msg.flash_program.data[144], expected 158, is %d", last_msg.msg.flash_program.data[144]); - ck_assert_msg(last_msg.msg.flash_program.data[145] == 18, "incorrect value for last_msg.msg.flash_program.data[145], expected 18, is %d", last_msg.msg.flash_program.data[145]); - ck_assert_msg(last_msg.msg.flash_program.data[146] == 237, "incorrect value for last_msg.msg.flash_program.data[146], expected 237, is %d", last_msg.msg.flash_program.data[146]); - ck_assert_msg(last_msg.msg.flash_program.data[147] == 209, "incorrect value for last_msg.msg.flash_program.data[147], expected 209, is %d", last_msg.msg.flash_program.data[147]); - ck_assert_msg(last_msg.msg.flash_program.data[148] == 187, "incorrect value for last_msg.msg.flash_program.data[148], expected 187, is %d", last_msg.msg.flash_program.data[148]); - ck_assert_msg(last_msg.msg.flash_program.data[149] == 226, "incorrect value for last_msg.msg.flash_program.data[149], expected 226, is %d", last_msg.msg.flash_program.data[149]); - ck_assert_msg(last_msg.msg.flash_program.data[150] == 1, "incorrect value for last_msg.msg.flash_program.data[150], expected 1, is %d", last_msg.msg.flash_program.data[150]); - ck_assert_msg(last_msg.msg.flash_program.data[151] == 46, "incorrect value for last_msg.msg.flash_program.data[151], expected 46, is %d", last_msg.msg.flash_program.data[151]); - ck_assert_msg(last_msg.msg.flash_program.data[152] == 64, "incorrect value for last_msg.msg.flash_program.data[152], expected 64, is %d", last_msg.msg.flash_program.data[152]); - ck_assert_msg(last_msg.msg.flash_program.data[153] == 226, "incorrect value for last_msg.msg.flash_program.data[153], expected 226, is %d", last_msg.msg.flash_program.data[153]); - ck_assert_msg(last_msg.msg.flash_program.data[154] == 235, "incorrect value for last_msg.msg.flash_program.data[154], expected 235, is %d", last_msg.msg.flash_program.data[154]); - ck_assert_msg(last_msg.msg.flash_program.data[155] == 213, "incorrect value for last_msg.msg.flash_program.data[155], expected 213, is %d", last_msg.msg.flash_program.data[155]); - ck_assert_msg(last_msg.msg.flash_program.data[156] == 186, "incorrect value for last_msg.msg.flash_program.data[156], expected 186, is %d", last_msg.msg.flash_program.data[156]); - ck_assert_msg(last_msg.msg.flash_program.data[157] == 159, "incorrect value for last_msg.msg.flash_program.data[157], expected 159, is %d", last_msg.msg.flash_program.data[157]); - ck_assert_msg(last_msg.msg.flash_program.data[158] == 221, "incorrect value for last_msg.msg.flash_program.data[158], expected 221, is %d", last_msg.msg.flash_program.data[158]); - ck_assert_msg(last_msg.msg.flash_program.data[159] == 186, "incorrect value for last_msg.msg.flash_program.data[159], expected 186, is %d", last_msg.msg.flash_program.data[159]); - ck_assert_msg(last_msg.msg.flash_program.data[160] == 25, "incorrect value for last_msg.msg.flash_program.data[160], expected 25, is %d", last_msg.msg.flash_program.data[160]); - ck_assert_msg(last_msg.msg.flash_program.data[161] == 115, "incorrect value for last_msg.msg.flash_program.data[161], expected 115, is %d", last_msg.msg.flash_program.data[161]); - ck_assert_msg(last_msg.msg.flash_program.data[162] == 84, "incorrect value for last_msg.msg.flash_program.data[162], expected 84, is %d", last_msg.msg.flash_program.data[162]); - ck_assert_msg(last_msg.msg.flash_program.data[163] == 131, "incorrect value for last_msg.msg.flash_program.data[163], expected 131, is %d", last_msg.msg.flash_program.data[163]); - ck_assert_msg(last_msg.msg.flash_program.data[164] == 167, "incorrect value for last_msg.msg.flash_program.data[164], expected 167, is %d", last_msg.msg.flash_program.data[164]); - ck_assert_msg(last_msg.msg.flash_program.data[165] == 201, "incorrect value for last_msg.msg.flash_program.data[165], expected 201, is %d", last_msg.msg.flash_program.data[165]); - ck_assert_msg(last_msg.msg.flash_program.data[166] == 104, "incorrect value for last_msg.msg.flash_program.data[166], expected 104, is %d", last_msg.msg.flash_program.data[166]); - ck_assert_msg(last_msg.msg.flash_program.data[167] == 1, "incorrect value for last_msg.msg.flash_program.data[167], expected 1, is %d", last_msg.msg.flash_program.data[167]); - ck_assert_msg(last_msg.msg.flash_program.data[168] == 200, "incorrect value for last_msg.msg.flash_program.data[168], expected 200, is %d", last_msg.msg.flash_program.data[168]); - ck_assert_msg(last_msg.msg.flash_program.data[169] == 13, "incorrect value for last_msg.msg.flash_program.data[169], expected 13, is %d", last_msg.msg.flash_program.data[169]); - ck_assert_msg(last_msg.msg.flash_program.data[170] == 50, "incorrect value for last_msg.msg.flash_program.data[170], expected 50, is %d", last_msg.msg.flash_program.data[170]); - ck_assert_msg(last_msg.msg.flash_program.data[171] == 71, "incorrect value for last_msg.msg.flash_program.data[171], expected 71, is %d", last_msg.msg.flash_program.data[171]); - ck_assert_msg(last_msg.msg.flash_program.data[172] == 73, "incorrect value for last_msg.msg.flash_program.data[172], expected 73, is %d", last_msg.msg.flash_program.data[172]); - ck_assert_msg(last_msg.msg.flash_program.data[173] == 193, "incorrect value for last_msg.msg.flash_program.data[173], expected 193, is %d", last_msg.msg.flash_program.data[173]); - ck_assert_msg(last_msg.msg.flash_program.data[174] == 201, "incorrect value for last_msg.msg.flash_program.data[174], expected 201, is %d", last_msg.msg.flash_program.data[174]); - ck_assert_msg(last_msg.msg.flash_program.data[175] == 250, "incorrect value for last_msg.msg.flash_program.data[175], expected 250, is %d", last_msg.msg.flash_program.data[175]); - ck_assert_msg(last_msg.msg.flash_program.data[176] == 172, "incorrect value for last_msg.msg.flash_program.data[176], expected 172, is %d", last_msg.msg.flash_program.data[176]); - ck_assert_msg(last_msg.msg.flash_program.data[177] == 193, "incorrect value for last_msg.msg.flash_program.data[177], expected 193, is %d", last_msg.msg.flash_program.data[177]); - ck_assert_msg(last_msg.msg.flash_program.data[178] == 13, "incorrect value for last_msg.msg.flash_program.data[178], expected 13, is %d", last_msg.msg.flash_program.data[178]); - ck_assert_msg(last_msg.msg.flash_program.data[179] == 20, "incorrect value for last_msg.msg.flash_program.data[179], expected 20, is %d", last_msg.msg.flash_program.data[179]); - ck_assert_msg(last_msg.msg.flash_program.data[180] == 238, "incorrect value for last_msg.msg.flash_program.data[180], expected 238, is %d", last_msg.msg.flash_program.data[180]); - ck_assert_msg(last_msg.msg.flash_program.data[181] == 130, "incorrect value for last_msg.msg.flash_program.data[181], expected 130, is %d", last_msg.msg.flash_program.data[181]); - ck_assert_msg(last_msg.msg.flash_program.data[182] == 243, "incorrect value for last_msg.msg.flash_program.data[182], expected 243, is %d", last_msg.msg.flash_program.data[182]); - ck_assert_msg(last_msg.msg.flash_program.data[183] == 68, "incorrect value for last_msg.msg.flash_program.data[183], expected 68, is %d", last_msg.msg.flash_program.data[183]); - ck_assert_msg(last_msg.msg.flash_program.data[184] == 4, "incorrect value for last_msg.msg.flash_program.data[184], expected 4, is %d", last_msg.msg.flash_program.data[184]); - ck_assert_msg(last_msg.msg.flash_program.data[185] == 72, "incorrect value for last_msg.msg.flash_program.data[185], expected 72, is %d", last_msg.msg.flash_program.data[185]); - ck_assert_msg(last_msg.msg.flash_program.data[186] == 46, "incorrect value for last_msg.msg.flash_program.data[186], expected 46, is %d", last_msg.msg.flash_program.data[186]); - ck_assert_msg(last_msg.msg.flash_program.data[187] == 194, "incorrect value for last_msg.msg.flash_program.data[187], expected 194, is %d", last_msg.msg.flash_program.data[187]); - ck_assert_msg(last_msg.msg.flash_program.data[188] == 113, "incorrect value for last_msg.msg.flash_program.data[188], expected 113, is %d", last_msg.msg.flash_program.data[188]); - ck_assert_msg(last_msg.msg.flash_program.data[189] == 255, "incorrect value for last_msg.msg.flash_program.data[189], expected 255, is %d", last_msg.msg.flash_program.data[189]); - ck_assert_msg(last_msg.msg.flash_program.data[190] == 238, "incorrect value for last_msg.msg.flash_program.data[190], expected 238, is %d", last_msg.msg.flash_program.data[190]); - ck_assert_msg(last_msg.msg.flash_program.data[191] == 15, "incorrect value for last_msg.msg.flash_program.data[191], expected 15, is %d", last_msg.msg.flash_program.data[191]); - ck_assert_msg(last_msg.msg.flash_program.data[192] == 230, "incorrect value for last_msg.msg.flash_program.data[192], expected 230, is %d", last_msg.msg.flash_program.data[192]); - ck_assert_msg(last_msg.msg.flash_program.data[193] == 64, "incorrect value for last_msg.msg.flash_program.data[193], expected 64, is %d", last_msg.msg.flash_program.data[193]); - ck_assert_msg(last_msg.msg.flash_program.data[194] == 178, "incorrect value for last_msg.msg.flash_program.data[194], expected 178, is %d", last_msg.msg.flash_program.data[194]); - ck_assert_msg(last_msg.msg.flash_program.data[195] == 127, "incorrect value for last_msg.msg.flash_program.data[195], expected 127, is %d", last_msg.msg.flash_program.data[195]); - ck_assert_msg(last_msg.msg.flash_program.data[196] == 217, "incorrect value for last_msg.msg.flash_program.data[196], expected 217, is %d", last_msg.msg.flash_program.data[196]); - ck_assert_msg(last_msg.msg.flash_program.data[197] == 92, "incorrect value for last_msg.msg.flash_program.data[197], expected 92, is %d", last_msg.msg.flash_program.data[197]); - ck_assert_msg(last_msg.msg.flash_program.data[198] == 160, "incorrect value for last_msg.msg.flash_program.data[198], expected 160, is %d", last_msg.msg.flash_program.data[198]); - ck_assert_msg(last_msg.msg.flash_program.data[199] == 201, "incorrect value for last_msg.msg.flash_program.data[199], expected 201, is %d", last_msg.msg.flash_program.data[199]); - ck_assert_msg(last_msg.msg.flash_program.data[200] == 118, "incorrect value for last_msg.msg.flash_program.data[200], expected 118, is %d", last_msg.msg.flash_program.data[200]); - ck_assert_msg(last_msg.msg.flash_program.data[201] == 163, "incorrect value for last_msg.msg.flash_program.data[201], expected 163, is %d", last_msg.msg.flash_program.data[201]); - ck_assert_msg(last_msg.msg.flash_program.data[202] == 144, "incorrect value for last_msg.msg.flash_program.data[202], expected 144, is %d", last_msg.msg.flash_program.data[202]); - ck_assert_msg(last_msg.msg.flash_program.data[203] == 58, "incorrect value for last_msg.msg.flash_program.data[203], expected 58, is %d", last_msg.msg.flash_program.data[203]); - ck_assert_msg(last_msg.msg.flash_program.data[204] == 28, "incorrect value for last_msg.msg.flash_program.data[204], expected 28, is %d", last_msg.msg.flash_program.data[204]); - ck_assert_msg(last_msg.msg.flash_program.data[205] == 174, "incorrect value for last_msg.msg.flash_program.data[205], expected 174, is %d", last_msg.msg.flash_program.data[205]); - ck_assert_msg(last_msg.msg.flash_program.data[206] == 65, "incorrect value for last_msg.msg.flash_program.data[206], expected 65, is %d", last_msg.msg.flash_program.data[206]); - ck_assert_msg(last_msg.msg.flash_program.data[207] == 73, "incorrect value for last_msg.msg.flash_program.data[207], expected 73, is %d", last_msg.msg.flash_program.data[207]); - ck_assert_msg(last_msg.msg.flash_program.data[208] == 45, "incorrect value for last_msg.msg.flash_program.data[208], expected 45, is %d", last_msg.msg.flash_program.data[208]); - ck_assert_msg(last_msg.msg.flash_program.data[209] == 123, "incorrect value for last_msg.msg.flash_program.data[209], expected 123, is %d", last_msg.msg.flash_program.data[209]); - ck_assert_msg(last_msg.msg.flash_program.data[210] == 118, "incorrect value for last_msg.msg.flash_program.data[210], expected 118, is %d", last_msg.msg.flash_program.data[210]); - ck_assert_msg(last_msg.msg.flash_program.data[211] == 83, "incorrect value for last_msg.msg.flash_program.data[211], expected 83, is %d", last_msg.msg.flash_program.data[211]); - ck_assert_msg(last_msg.msg.flash_program.data[212] == 107, "incorrect value for last_msg.msg.flash_program.data[212], expected 107, is %d", last_msg.msg.flash_program.data[212]); - ck_assert_msg(last_msg.msg.flash_program.data[213] == 239, "incorrect value for last_msg.msg.flash_program.data[213], expected 239, is %d", last_msg.msg.flash_program.data[213]); - ck_assert_msg(last_msg.msg.flash_program.data[214] == 168, "incorrect value for last_msg.msg.flash_program.data[214], expected 168, is %d", last_msg.msg.flash_program.data[214]); - ck_assert_msg(last_msg.msg.flash_program.data[215] == 32, "incorrect value for last_msg.msg.flash_program.data[215], expected 32, is %d", last_msg.msg.flash_program.data[215]); - ck_assert_msg(last_msg.msg.flash_program.data[216] == 212, "incorrect value for last_msg.msg.flash_program.data[216], expected 212, is %d", last_msg.msg.flash_program.data[216]); - ck_assert_msg(last_msg.msg.flash_program.data[217] == 191, "incorrect value for last_msg.msg.flash_program.data[217], expected 191, is %d", last_msg.msg.flash_program.data[217]); - ck_assert_msg(last_msg.msg.flash_program.data[218] == 81, "incorrect value for last_msg.msg.flash_program.data[218], expected 81, is %d", last_msg.msg.flash_program.data[218]); - ck_assert_msg(last_msg.msg.flash_program.data[219] == 93, "incorrect value for last_msg.msg.flash_program.data[219], expected 93, is %d", last_msg.msg.flash_program.data[219]); - ck_assert_msg(last_msg.msg.flash_program.data[220] == 186, "incorrect value for last_msg.msg.flash_program.data[220], expected 186, is %d", last_msg.msg.flash_program.data[220]); - ck_assert_msg(last_msg.msg.flash_program.data[221] == 223, "incorrect value for last_msg.msg.flash_program.data[221], expected 223, is %d", last_msg.msg.flash_program.data[221]); - ck_assert_msg(last_msg.msg.flash_program.data[222] == 32, "incorrect value for last_msg.msg.flash_program.data[222], expected 32, is %d", last_msg.msg.flash_program.data[222]); - ck_assert_msg(last_msg.msg.flash_program.data[223] == 19, "incorrect value for last_msg.msg.flash_program.data[223], expected 19, is %d", last_msg.msg.flash_program.data[223]); - ck_assert_msg(last_msg.msg.flash_program.data[224] == 58, "incorrect value for last_msg.msg.flash_program.data[224], expected 58, is %d", last_msg.msg.flash_program.data[224]); - ck_assert_msg(last_msg.msg.flash_program.data[225] == 137, "incorrect value for last_msg.msg.flash_program.data[225], expected 137, is %d", last_msg.msg.flash_program.data[225]); - ck_assert_msg(last_msg.msg.flash_program.data[226] == 72, "incorrect value for last_msg.msg.flash_program.data[226], expected 72, is %d", last_msg.msg.flash_program.data[226]); - ck_assert_msg(last_msg.msg.flash_program.data[227] == 217, "incorrect value for last_msg.msg.flash_program.data[227], expected 217, is %d", last_msg.msg.flash_program.data[227]); - ck_assert_msg(last_msg.msg.flash_program.data[228] == 151, "incorrect value for last_msg.msg.flash_program.data[228], expected 151, is %d", last_msg.msg.flash_program.data[228]); - ck_assert_msg(last_msg.msg.flash_program.data[229] == 251, "incorrect value for last_msg.msg.flash_program.data[229], expected 251, is %d", last_msg.msg.flash_program.data[229]); - ck_assert_msg(last_msg.msg.flash_program.data[230] == 83, "incorrect value for last_msg.msg.flash_program.data[230], expected 83, is %d", last_msg.msg.flash_program.data[230]); - ck_assert_msg(last_msg.msg.flash_program.data[231] == 20, "incorrect value for last_msg.msg.flash_program.data[231], expected 20, is %d", last_msg.msg.flash_program.data[231]); - ck_assert_msg(last_msg.msg.flash_program.data[232] == 113, "incorrect value for last_msg.msg.flash_program.data[232], expected 113, is %d", last_msg.msg.flash_program.data[232]); - ck_assert_msg(last_msg.msg.flash_program.data[233] == 37, "incorrect value for last_msg.msg.flash_program.data[233], expected 37, is %d", last_msg.msg.flash_program.data[233]); - ck_assert_msg(last_msg.msg.flash_program.data[234] == 151, "incorrect value for last_msg.msg.flash_program.data[234], expected 151, is %d", last_msg.msg.flash_program.data[234]); - ck_assert_msg(last_msg.msg.flash_program.data[235] == 34, "incorrect value for last_msg.msg.flash_program.data[235], expected 34, is %d", last_msg.msg.flash_program.data[235]); - ck_assert_msg(last_msg.msg.flash_program.data[236] == 37, "incorrect value for last_msg.msg.flash_program.data[236], expected 37, is %d", last_msg.msg.flash_program.data[236]); - ck_assert_msg(last_msg.msg.flash_program.data[237] == 71, "incorrect value for last_msg.msg.flash_program.data[237], expected 71, is %d", last_msg.msg.flash_program.data[237]); - ck_assert_msg(last_msg.msg.flash_program.data[238] == 95, "incorrect value for last_msg.msg.flash_program.data[238], expected 95, is %d", last_msg.msg.flash_program.data[238]); - ck_assert_msg(last_msg.msg.flash_program.data[239] == 105, "incorrect value for last_msg.msg.flash_program.data[239], expected 105, is %d", last_msg.msg.flash_program.data[239]); - ck_assert_msg(last_msg.msg.flash_program.data[240] == 235, "incorrect value for last_msg.msg.flash_program.data[240], expected 235, is %d", last_msg.msg.flash_program.data[240]); - ck_assert_msg(last_msg.msg.flash_program.data[241] == 144, "incorrect value for last_msg.msg.flash_program.data[241], expected 144, is %d", last_msg.msg.flash_program.data[241]); - ck_assert_msg(last_msg.msg.flash_program.data[242] == 164, "incorrect value for last_msg.msg.flash_program.data[242], expected 164, is %d", last_msg.msg.flash_program.data[242]); - ck_assert_msg(last_msg.msg.flash_program.data[243] == 83, "incorrect value for last_msg.msg.flash_program.data[243], expected 83, is %d", last_msg.msg.flash_program.data[243]); - ck_assert_msg(last_msg.msg.flash_program.data[244] == 197, "incorrect value for last_msg.msg.flash_program.data[244], expected 197, is %d", last_msg.msg.flash_program.data[244]); - ck_assert_msg(last_msg.msg.flash_program.data[245] == 254, "incorrect value for last_msg.msg.flash_program.data[245], expected 254, is %d", last_msg.msg.flash_program.data[245]); - ck_assert_msg(last_msg.msg.flash_program.data[246] == 183, "incorrect value for last_msg.msg.flash_program.data[246], expected 183, is %d", last_msg.msg.flash_program.data[246]); - ck_assert_msg(last_msg.msg.flash_program.data[247] == 223, "incorrect value for last_msg.msg.flash_program.data[247], expected 223, is %d", last_msg.msg.flash_program.data[247]); - ck_assert_msg(last_msg.msg.flash_program.data[248] == 91, "incorrect value for last_msg.msg.flash_program.data[248], expected 91, is %d", last_msg.msg.flash_program.data[248]); - ck_assert_msg(last_msg.msg.flash_program.data[249] == 19, "incorrect value for last_msg.msg.flash_program.data[249], expected 19, is %d", last_msg.msg.flash_program.data[249]); - - ck_assert_msg(last_msg.msg.flash_program.target == 212, "incorrect value for last_msg.msg.flash_program.target, expected 212, is %d", last_msg.msg.flash_program.target); + ck_assert_msg(last_msg.msg.flash_program.addr_len == 250, + "incorrect value for last_msg.msg.flash_program.addr_len, " + "expected 250, is %d", + last_msg.msg.flash_program.addr_len); + + ck_assert_msg( + last_msg.msg.flash_program.addr_start[0] == 87, + "incorrect value for last_msg.msg.flash_program.addr_start[0], " + "expected 87, is %d", + last_msg.msg.flash_program.addr_start[0]); + ck_assert_msg( + last_msg.msg.flash_program.addr_start[1] == 52, + "incorrect value for last_msg.msg.flash_program.addr_start[1], " + "expected 52, is %d", + last_msg.msg.flash_program.addr_start[1]); + ck_assert_msg( + last_msg.msg.flash_program.addr_start[2] == 244, + "incorrect value for last_msg.msg.flash_program.addr_start[2], " + "expected 244, is %d", + last_msg.msg.flash_program.addr_start[2]); + + ck_assert_msg(last_msg.msg.flash_program.data[0] == 176, + "incorrect value for last_msg.msg.flash_program.data[0], " + "expected 176, is %d", + last_msg.msg.flash_program.data[0]); + ck_assert_msg(last_msg.msg.flash_program.data[1] == 222, + "incorrect value for last_msg.msg.flash_program.data[1], " + "expected 222, is %d", + last_msg.msg.flash_program.data[1]); + ck_assert_msg(last_msg.msg.flash_program.data[2] == 235, + "incorrect value for last_msg.msg.flash_program.data[2], " + "expected 235, is %d", + last_msg.msg.flash_program.data[2]); + ck_assert_msg(last_msg.msg.flash_program.data[3] == 106, + "incorrect value for last_msg.msg.flash_program.data[3], " + "expected 106, is %d", + last_msg.msg.flash_program.data[3]); + ck_assert_msg(last_msg.msg.flash_program.data[4] == 144, + "incorrect value for last_msg.msg.flash_program.data[4], " + "expected 144, is %d", + last_msg.msg.flash_program.data[4]); + ck_assert_msg(last_msg.msg.flash_program.data[5] == 29, + "incorrect value for last_msg.msg.flash_program.data[5], " + "expected 29, is %d", + last_msg.msg.flash_program.data[5]); + ck_assert_msg(last_msg.msg.flash_program.data[6] == 141, + "incorrect value for last_msg.msg.flash_program.data[6], " + "expected 141, is %d", + last_msg.msg.flash_program.data[6]); + ck_assert_msg(last_msg.msg.flash_program.data[7] == 255, + "incorrect value for last_msg.msg.flash_program.data[7], " + "expected 255, is %d", + last_msg.msg.flash_program.data[7]); + ck_assert_msg(last_msg.msg.flash_program.data[8] == 3, + "incorrect value for last_msg.msg.flash_program.data[8], " + "expected 3, is %d", + last_msg.msg.flash_program.data[8]); + ck_assert_msg(last_msg.msg.flash_program.data[9] == 16, + "incorrect value for last_msg.msg.flash_program.data[9], " + "expected 16, is %d", + last_msg.msg.flash_program.data[9]); + ck_assert_msg(last_msg.msg.flash_program.data[10] == 192, + "incorrect value for last_msg.msg.flash_program.data[10], " + "expected 192, is %d", + last_msg.msg.flash_program.data[10]); + ck_assert_msg(last_msg.msg.flash_program.data[11] == 237, + "incorrect value for last_msg.msg.flash_program.data[11], " + "expected 237, is %d", + last_msg.msg.flash_program.data[11]); + ck_assert_msg(last_msg.msg.flash_program.data[12] == 172, + "incorrect value for last_msg.msg.flash_program.data[12], " + "expected 172, is %d", + last_msg.msg.flash_program.data[12]); + ck_assert_msg(last_msg.msg.flash_program.data[13] == 254, + "incorrect value for last_msg.msg.flash_program.data[13], " + "expected 254, is %d", + last_msg.msg.flash_program.data[13]); + ck_assert_msg(last_msg.msg.flash_program.data[14] == 213, + "incorrect value for last_msg.msg.flash_program.data[14], " + "expected 213, is %d", + last_msg.msg.flash_program.data[14]); + ck_assert_msg(last_msg.msg.flash_program.data[15] == 4, + "incorrect value for last_msg.msg.flash_program.data[15], " + "expected 4, is %d", + last_msg.msg.flash_program.data[15]); + ck_assert_msg(last_msg.msg.flash_program.data[16] == 220, + "incorrect value for last_msg.msg.flash_program.data[16], " + "expected 220, is %d", + last_msg.msg.flash_program.data[16]); + ck_assert_msg(last_msg.msg.flash_program.data[17] == 98, + "incorrect value for last_msg.msg.flash_program.data[17], " + "expected 98, is %d", + last_msg.msg.flash_program.data[17]); + ck_assert_msg(last_msg.msg.flash_program.data[18] == 34, + "incorrect value for last_msg.msg.flash_program.data[18], " + "expected 34, is %d", + last_msg.msg.flash_program.data[18]); + ck_assert_msg(last_msg.msg.flash_program.data[19] == 222, + "incorrect value for last_msg.msg.flash_program.data[19], " + "expected 222, is %d", + last_msg.msg.flash_program.data[19]); + ck_assert_msg(last_msg.msg.flash_program.data[20] == 230, + "incorrect value for last_msg.msg.flash_program.data[20], " + "expected 230, is %d", + last_msg.msg.flash_program.data[20]); + ck_assert_msg(last_msg.msg.flash_program.data[21] == 214, + "incorrect value for last_msg.msg.flash_program.data[21], " + "expected 214, is %d", + last_msg.msg.flash_program.data[21]); + ck_assert_msg(last_msg.msg.flash_program.data[22] == 6, + "incorrect value for last_msg.msg.flash_program.data[22], " + "expected 6, is %d", + last_msg.msg.flash_program.data[22]); + ck_assert_msg(last_msg.msg.flash_program.data[23] == 217, + "incorrect value for last_msg.msg.flash_program.data[23], " + "expected 217, is %d", + last_msg.msg.flash_program.data[23]); + ck_assert_msg(last_msg.msg.flash_program.data[24] == 172, + "incorrect value for last_msg.msg.flash_program.data[24], " + "expected 172, is %d", + last_msg.msg.flash_program.data[24]); + ck_assert_msg(last_msg.msg.flash_program.data[25] == 122, + "incorrect value for last_msg.msg.flash_program.data[25], " + "expected 122, is %d", + last_msg.msg.flash_program.data[25]); + ck_assert_msg(last_msg.msg.flash_program.data[26] == 46, + "incorrect value for last_msg.msg.flash_program.data[26], " + "expected 46, is %d", + last_msg.msg.flash_program.data[26]); + ck_assert_msg(last_msg.msg.flash_program.data[27] == 13, + "incorrect value for last_msg.msg.flash_program.data[27], " + "expected 13, is %d", + last_msg.msg.flash_program.data[27]); + ck_assert_msg(last_msg.msg.flash_program.data[28] == 38, + "incorrect value for last_msg.msg.flash_program.data[28], " + "expected 38, is %d", + last_msg.msg.flash_program.data[28]); + ck_assert_msg(last_msg.msg.flash_program.data[29] == 240, + "incorrect value for last_msg.msg.flash_program.data[29], " + "expected 240, is %d", + last_msg.msg.flash_program.data[29]); + ck_assert_msg(last_msg.msg.flash_program.data[30] == 236, + "incorrect value for last_msg.msg.flash_program.data[30], " + "expected 236, is %d", + last_msg.msg.flash_program.data[30]); + ck_assert_msg(last_msg.msg.flash_program.data[31] == 60, + "incorrect value for last_msg.msg.flash_program.data[31], " + "expected 60, is %d", + last_msg.msg.flash_program.data[31]); + ck_assert_msg(last_msg.msg.flash_program.data[32] == 121, + "incorrect value for last_msg.msg.flash_program.data[32], " + "expected 121, is %d", + last_msg.msg.flash_program.data[32]); + ck_assert_msg(last_msg.msg.flash_program.data[33] == 47, + "incorrect value for last_msg.msg.flash_program.data[33], " + "expected 47, is %d", + last_msg.msg.flash_program.data[33]); + ck_assert_msg(last_msg.msg.flash_program.data[34] == 252, + "incorrect value for last_msg.msg.flash_program.data[34], " + "expected 252, is %d", + last_msg.msg.flash_program.data[34]); + ck_assert_msg(last_msg.msg.flash_program.data[35] == 163, + "incorrect value for last_msg.msg.flash_program.data[35], " + "expected 163, is %d", + last_msg.msg.flash_program.data[35]); + ck_assert_msg(last_msg.msg.flash_program.data[36] == 141, + "incorrect value for last_msg.msg.flash_program.data[36], " + "expected 141, is %d", + last_msg.msg.flash_program.data[36]); + ck_assert_msg(last_msg.msg.flash_program.data[37] == 222, + "incorrect value for last_msg.msg.flash_program.data[37], " + "expected 222, is %d", + last_msg.msg.flash_program.data[37]); + ck_assert_msg(last_msg.msg.flash_program.data[38] == 29, + "incorrect value for last_msg.msg.flash_program.data[38], " + "expected 29, is %d", + last_msg.msg.flash_program.data[38]); + ck_assert_msg(last_msg.msg.flash_program.data[39] == 168, + "incorrect value for last_msg.msg.flash_program.data[39], " + "expected 168, is %d", + last_msg.msg.flash_program.data[39]); + ck_assert_msg(last_msg.msg.flash_program.data[40] == 214, + "incorrect value for last_msg.msg.flash_program.data[40], " + "expected 214, is %d", + last_msg.msg.flash_program.data[40]); + ck_assert_msg(last_msg.msg.flash_program.data[41] == 118, + "incorrect value for last_msg.msg.flash_program.data[41], " + "expected 118, is %d", + last_msg.msg.flash_program.data[41]); + ck_assert_msg(last_msg.msg.flash_program.data[42] == 55, + "incorrect value for last_msg.msg.flash_program.data[42], " + "expected 55, is %d", + last_msg.msg.flash_program.data[42]); + ck_assert_msg(last_msg.msg.flash_program.data[43] == 201, + "incorrect value for last_msg.msg.flash_program.data[43], " + "expected 201, is %d", + last_msg.msg.flash_program.data[43]); + ck_assert_msg(last_msg.msg.flash_program.data[44] == 233, + "incorrect value for last_msg.msg.flash_program.data[44], " + "expected 233, is %d", + last_msg.msg.flash_program.data[44]); + ck_assert_msg(last_msg.msg.flash_program.data[45] == 21, + "incorrect value for last_msg.msg.flash_program.data[45], " + "expected 21, is %d", + last_msg.msg.flash_program.data[45]); + ck_assert_msg(last_msg.msg.flash_program.data[46] == 214, + "incorrect value for last_msg.msg.flash_program.data[46], " + "expected 214, is %d", + last_msg.msg.flash_program.data[46]); + ck_assert_msg(last_msg.msg.flash_program.data[47] == 57, + "incorrect value for last_msg.msg.flash_program.data[47], " + "expected 57, is %d", + last_msg.msg.flash_program.data[47]); + ck_assert_msg(last_msg.msg.flash_program.data[48] == 245, + "incorrect value for last_msg.msg.flash_program.data[48], " + "expected 245, is %d", + last_msg.msg.flash_program.data[48]); + ck_assert_msg(last_msg.msg.flash_program.data[49] == 246, + "incorrect value for last_msg.msg.flash_program.data[49], " + "expected 246, is %d", + last_msg.msg.flash_program.data[49]); + ck_assert_msg(last_msg.msg.flash_program.data[50] == 19, + "incorrect value for last_msg.msg.flash_program.data[50], " + "expected 19, is %d", + last_msg.msg.flash_program.data[50]); + ck_assert_msg(last_msg.msg.flash_program.data[51] == 3, + "incorrect value for last_msg.msg.flash_program.data[51], " + "expected 3, is %d", + last_msg.msg.flash_program.data[51]); + ck_assert_msg(last_msg.msg.flash_program.data[52] == 121, + "incorrect value for last_msg.msg.flash_program.data[52], " + "expected 121, is %d", + last_msg.msg.flash_program.data[52]); + ck_assert_msg(last_msg.msg.flash_program.data[53] == 49, + "incorrect value for last_msg.msg.flash_program.data[53], " + "expected 49, is %d", + last_msg.msg.flash_program.data[53]); + ck_assert_msg(last_msg.msg.flash_program.data[54] == 231, + "incorrect value for last_msg.msg.flash_program.data[54], " + "expected 231, is %d", + last_msg.msg.flash_program.data[54]); + ck_assert_msg(last_msg.msg.flash_program.data[55] == 37, + "incorrect value for last_msg.msg.flash_program.data[55], " + "expected 37, is %d", + last_msg.msg.flash_program.data[55]); + ck_assert_msg(last_msg.msg.flash_program.data[56] == 186, + "incorrect value for last_msg.msg.flash_program.data[56], " + "expected 186, is %d", + last_msg.msg.flash_program.data[56]); + ck_assert_msg(last_msg.msg.flash_program.data[57] == 58, + "incorrect value for last_msg.msg.flash_program.data[57], " + "expected 58, is %d", + last_msg.msg.flash_program.data[57]); + ck_assert_msg(last_msg.msg.flash_program.data[58] == 238, + "incorrect value for last_msg.msg.flash_program.data[58], " + "expected 238, is %d", + last_msg.msg.flash_program.data[58]); + ck_assert_msg(last_msg.msg.flash_program.data[59] == 98, + "incorrect value for last_msg.msg.flash_program.data[59], " + "expected 98, is %d", + last_msg.msg.flash_program.data[59]); + ck_assert_msg(last_msg.msg.flash_program.data[60] == 39, + "incorrect value for last_msg.msg.flash_program.data[60], " + "expected 39, is %d", + last_msg.msg.flash_program.data[60]); + ck_assert_msg(last_msg.msg.flash_program.data[61] == 70, + "incorrect value for last_msg.msg.flash_program.data[61], " + "expected 70, is %d", + last_msg.msg.flash_program.data[61]); + ck_assert_msg(last_msg.msg.flash_program.data[62] == 232, + "incorrect value for last_msg.msg.flash_program.data[62], " + "expected 232, is %d", + last_msg.msg.flash_program.data[62]); + ck_assert_msg(last_msg.msg.flash_program.data[63] == 133, + "incorrect value for last_msg.msg.flash_program.data[63], " + "expected 133, is %d", + last_msg.msg.flash_program.data[63]); + ck_assert_msg(last_msg.msg.flash_program.data[64] == 25, + "incorrect value for last_msg.msg.flash_program.data[64], " + "expected 25, is %d", + last_msg.msg.flash_program.data[64]); + ck_assert_msg(last_msg.msg.flash_program.data[65] == 10, + "incorrect value for last_msg.msg.flash_program.data[65], " + "expected 10, is %d", + last_msg.msg.flash_program.data[65]); + ck_assert_msg(last_msg.msg.flash_program.data[66] == 134, + "incorrect value for last_msg.msg.flash_program.data[66], " + "expected 134, is %d", + last_msg.msg.flash_program.data[66]); + ck_assert_msg(last_msg.msg.flash_program.data[67] == 129, + "incorrect value for last_msg.msg.flash_program.data[67], " + "expected 129, is %d", + last_msg.msg.flash_program.data[67]); + ck_assert_msg(last_msg.msg.flash_program.data[68] == 69, + "incorrect value for last_msg.msg.flash_program.data[68], " + "expected 69, is %d", + last_msg.msg.flash_program.data[68]); + ck_assert_msg(last_msg.msg.flash_program.data[69] == 228, + "incorrect value for last_msg.msg.flash_program.data[69], " + "expected 228, is %d", + last_msg.msg.flash_program.data[69]); + ck_assert_msg(last_msg.msg.flash_program.data[70] == 134, + "incorrect value for last_msg.msg.flash_program.data[70], " + "expected 134, is %d", + last_msg.msg.flash_program.data[70]); + ck_assert_msg(last_msg.msg.flash_program.data[71] == 9, + "incorrect value for last_msg.msg.flash_program.data[71], " + "expected 9, is %d", + last_msg.msg.flash_program.data[71]); + ck_assert_msg(last_msg.msg.flash_program.data[72] == 88, + "incorrect value for last_msg.msg.flash_program.data[72], " + "expected 88, is %d", + last_msg.msg.flash_program.data[72]); + ck_assert_msg(last_msg.msg.flash_program.data[73] == 183, + "incorrect value for last_msg.msg.flash_program.data[73], " + "expected 183, is %d", + last_msg.msg.flash_program.data[73]); + ck_assert_msg(last_msg.msg.flash_program.data[74] == 133, + "incorrect value for last_msg.msg.flash_program.data[74], " + "expected 133, is %d", + last_msg.msg.flash_program.data[74]); + ck_assert_msg(last_msg.msg.flash_program.data[75] == 171, + "incorrect value for last_msg.msg.flash_program.data[75], " + "expected 171, is %d", + last_msg.msg.flash_program.data[75]); + ck_assert_msg(last_msg.msg.flash_program.data[76] == 255, + "incorrect value for last_msg.msg.flash_program.data[76], " + "expected 255, is %d", + last_msg.msg.flash_program.data[76]); + ck_assert_msg(last_msg.msg.flash_program.data[77] == 166, + "incorrect value for last_msg.msg.flash_program.data[77], " + "expected 166, is %d", + last_msg.msg.flash_program.data[77]); + ck_assert_msg(last_msg.msg.flash_program.data[78] == 100, + "incorrect value for last_msg.msg.flash_program.data[78], " + "expected 100, is %d", + last_msg.msg.flash_program.data[78]); + ck_assert_msg(last_msg.msg.flash_program.data[79] == 152, + "incorrect value for last_msg.msg.flash_program.data[79], " + "expected 152, is %d", + last_msg.msg.flash_program.data[79]); + ck_assert_msg(last_msg.msg.flash_program.data[80] == 231, + "incorrect value for last_msg.msg.flash_program.data[80], " + "expected 231, is %d", + last_msg.msg.flash_program.data[80]); + ck_assert_msg(last_msg.msg.flash_program.data[81] == 92, + "incorrect value for last_msg.msg.flash_program.data[81], " + "expected 92, is %d", + last_msg.msg.flash_program.data[81]); + ck_assert_msg(last_msg.msg.flash_program.data[82] == 9, + "incorrect value for last_msg.msg.flash_program.data[82], " + "expected 9, is %d", + last_msg.msg.flash_program.data[82]); + ck_assert_msg(last_msg.msg.flash_program.data[83] == 196, + "incorrect value for last_msg.msg.flash_program.data[83], " + "expected 196, is %d", + last_msg.msg.flash_program.data[83]); + ck_assert_msg(last_msg.msg.flash_program.data[84] == 106, + "incorrect value for last_msg.msg.flash_program.data[84], " + "expected 106, is %d", + last_msg.msg.flash_program.data[84]); + ck_assert_msg(last_msg.msg.flash_program.data[85] == 246, + "incorrect value for last_msg.msg.flash_program.data[85], " + "expected 246, is %d", + last_msg.msg.flash_program.data[85]); + ck_assert_msg(last_msg.msg.flash_program.data[86] == 29, + "incorrect value for last_msg.msg.flash_program.data[86], " + "expected 29, is %d", + last_msg.msg.flash_program.data[86]); + ck_assert_msg(last_msg.msg.flash_program.data[87] == 145, + "incorrect value for last_msg.msg.flash_program.data[87], " + "expected 145, is %d", + last_msg.msg.flash_program.data[87]); + ck_assert_msg(last_msg.msg.flash_program.data[88] == 156, + "incorrect value for last_msg.msg.flash_program.data[88], " + "expected 156, is %d", + last_msg.msg.flash_program.data[88]); + ck_assert_msg(last_msg.msg.flash_program.data[89] == 151, + "incorrect value for last_msg.msg.flash_program.data[89], " + "expected 151, is %d", + last_msg.msg.flash_program.data[89]); + ck_assert_msg(last_msg.msg.flash_program.data[90] == 32, + "incorrect value for last_msg.msg.flash_program.data[90], " + "expected 32, is %d", + last_msg.msg.flash_program.data[90]); + ck_assert_msg(last_msg.msg.flash_program.data[91] == 67, + "incorrect value for last_msg.msg.flash_program.data[91], " + "expected 67, is %d", + last_msg.msg.flash_program.data[91]); + ck_assert_msg(last_msg.msg.flash_program.data[92] == 188, + "incorrect value for last_msg.msg.flash_program.data[92], " + "expected 188, is %d", + last_msg.msg.flash_program.data[92]); + ck_assert_msg(last_msg.msg.flash_program.data[93] == 63, + "incorrect value for last_msg.msg.flash_program.data[93], " + "expected 63, is %d", + last_msg.msg.flash_program.data[93]); + ck_assert_msg(last_msg.msg.flash_program.data[94] == 233, + "incorrect value for last_msg.msg.flash_program.data[94], " + "expected 233, is %d", + last_msg.msg.flash_program.data[94]); + ck_assert_msg(last_msg.msg.flash_program.data[95] == 142, + "incorrect value for last_msg.msg.flash_program.data[95], " + "expected 142, is %d", + last_msg.msg.flash_program.data[95]); + ck_assert_msg(last_msg.msg.flash_program.data[96] == 174, + "incorrect value for last_msg.msg.flash_program.data[96], " + "expected 174, is %d", + last_msg.msg.flash_program.data[96]); + ck_assert_msg(last_msg.msg.flash_program.data[97] == 139, + "incorrect value for last_msg.msg.flash_program.data[97], " + "expected 139, is %d", + last_msg.msg.flash_program.data[97]); + ck_assert_msg(last_msg.msg.flash_program.data[98] == 154, + "incorrect value for last_msg.msg.flash_program.data[98], " + "expected 154, is %d", + last_msg.msg.flash_program.data[98]); + ck_assert_msg(last_msg.msg.flash_program.data[99] == 127, + "incorrect value for last_msg.msg.flash_program.data[99], " + "expected 127, is %d", + last_msg.msg.flash_program.data[99]); + ck_assert_msg(last_msg.msg.flash_program.data[100] == 35, + "incorrect value for last_msg.msg.flash_program.data[100], " + "expected 35, is %d", + last_msg.msg.flash_program.data[100]); + ck_assert_msg(last_msg.msg.flash_program.data[101] == 60, + "incorrect value for last_msg.msg.flash_program.data[101], " + "expected 60, is %d", + last_msg.msg.flash_program.data[101]); + ck_assert_msg(last_msg.msg.flash_program.data[102] == 56, + "incorrect value for last_msg.msg.flash_program.data[102], " + "expected 56, is %d", + last_msg.msg.flash_program.data[102]); + ck_assert_msg(last_msg.msg.flash_program.data[103] == 187, + "incorrect value for last_msg.msg.flash_program.data[103], " + "expected 187, is %d", + last_msg.msg.flash_program.data[103]); + ck_assert_msg(last_msg.msg.flash_program.data[104] == 121, + "incorrect value for last_msg.msg.flash_program.data[104], " + "expected 121, is %d", + last_msg.msg.flash_program.data[104]); + ck_assert_msg(last_msg.msg.flash_program.data[105] == 103, + "incorrect value for last_msg.msg.flash_program.data[105], " + "expected 103, is %d", + last_msg.msg.flash_program.data[105]); + ck_assert_msg(last_msg.msg.flash_program.data[106] == 135, + "incorrect value for last_msg.msg.flash_program.data[106], " + "expected 135, is %d", + last_msg.msg.flash_program.data[106]); + ck_assert_msg(last_msg.msg.flash_program.data[107] == 152, + "incorrect value for last_msg.msg.flash_program.data[107], " + "expected 152, is %d", + last_msg.msg.flash_program.data[107]); + ck_assert_msg(last_msg.msg.flash_program.data[108] == 182, + "incorrect value for last_msg.msg.flash_program.data[108], " + "expected 182, is %d", + last_msg.msg.flash_program.data[108]); + ck_assert_msg(last_msg.msg.flash_program.data[109] == 88, + "incorrect value for last_msg.msg.flash_program.data[109], " + "expected 88, is %d", + last_msg.msg.flash_program.data[109]); + ck_assert_msg(last_msg.msg.flash_program.data[110] == 160, + "incorrect value for last_msg.msg.flash_program.data[110], " + "expected 160, is %d", + last_msg.msg.flash_program.data[110]); + ck_assert_msg(last_msg.msg.flash_program.data[111] == 255, + "incorrect value for last_msg.msg.flash_program.data[111], " + "expected 255, is %d", + last_msg.msg.flash_program.data[111]); + ck_assert_msg(last_msg.msg.flash_program.data[112] == 227, + "incorrect value for last_msg.msg.flash_program.data[112], " + "expected 227, is %d", + last_msg.msg.flash_program.data[112]); + ck_assert_msg(last_msg.msg.flash_program.data[113] == 240, + "incorrect value for last_msg.msg.flash_program.data[113], " + "expected 240, is %d", + last_msg.msg.flash_program.data[113]); + ck_assert_msg(last_msg.msg.flash_program.data[114] == 54, + "incorrect value for last_msg.msg.flash_program.data[114], " + "expected 54, is %d", + last_msg.msg.flash_program.data[114]); + ck_assert_msg(last_msg.msg.flash_program.data[115] == 100, + "incorrect value for last_msg.msg.flash_program.data[115], " + "expected 100, is %d", + last_msg.msg.flash_program.data[115]); + ck_assert_msg(last_msg.msg.flash_program.data[116] == 91, + "incorrect value for last_msg.msg.flash_program.data[116], " + "expected 91, is %d", + last_msg.msg.flash_program.data[116]); + ck_assert_msg(last_msg.msg.flash_program.data[117] == 31, + "incorrect value for last_msg.msg.flash_program.data[117], " + "expected 31, is %d", + last_msg.msg.flash_program.data[117]); + ck_assert_msg(last_msg.msg.flash_program.data[118] == 141, + "incorrect value for last_msg.msg.flash_program.data[118], " + "expected 141, is %d", + last_msg.msg.flash_program.data[118]); + ck_assert_msg(last_msg.msg.flash_program.data[119] == 102, + "incorrect value for last_msg.msg.flash_program.data[119], " + "expected 102, is %d", + last_msg.msg.flash_program.data[119]); + ck_assert_msg(last_msg.msg.flash_program.data[120] == 130, + "incorrect value for last_msg.msg.flash_program.data[120], " + "expected 130, is %d", + last_msg.msg.flash_program.data[120]); + ck_assert_msg(last_msg.msg.flash_program.data[121] == 254, + "incorrect value for last_msg.msg.flash_program.data[121], " + "expected 254, is %d", + last_msg.msg.flash_program.data[121]); + ck_assert_msg(last_msg.msg.flash_program.data[122] == 54, + "incorrect value for last_msg.msg.flash_program.data[122], " + "expected 54, is %d", + last_msg.msg.flash_program.data[122]); + ck_assert_msg(last_msg.msg.flash_program.data[123] == 227, + "incorrect value for last_msg.msg.flash_program.data[123], " + "expected 227, is %d", + last_msg.msg.flash_program.data[123]); + ck_assert_msg(last_msg.msg.flash_program.data[124] == 229, + "incorrect value for last_msg.msg.flash_program.data[124], " + "expected 229, is %d", + last_msg.msg.flash_program.data[124]); + ck_assert_msg(last_msg.msg.flash_program.data[125] == 62, + "incorrect value for last_msg.msg.flash_program.data[125], " + "expected 62, is %d", + last_msg.msg.flash_program.data[125]); + ck_assert_msg(last_msg.msg.flash_program.data[126] == 53, + "incorrect value for last_msg.msg.flash_program.data[126], " + "expected 53, is %d", + last_msg.msg.flash_program.data[126]); + ck_assert_msg(last_msg.msg.flash_program.data[127] == 225, + "incorrect value for last_msg.msg.flash_program.data[127], " + "expected 225, is %d", + last_msg.msg.flash_program.data[127]); + ck_assert_msg(last_msg.msg.flash_program.data[128] == 143, + "incorrect value for last_msg.msg.flash_program.data[128], " + "expected 143, is %d", + last_msg.msg.flash_program.data[128]); + ck_assert_msg(last_msg.msg.flash_program.data[129] == 88, + "incorrect value for last_msg.msg.flash_program.data[129], " + "expected 88, is %d", + last_msg.msg.flash_program.data[129]); + ck_assert_msg(last_msg.msg.flash_program.data[130] == 139, + "incorrect value for last_msg.msg.flash_program.data[130], " + "expected 139, is %d", + last_msg.msg.flash_program.data[130]); + ck_assert_msg(last_msg.msg.flash_program.data[131] == 126, + "incorrect value for last_msg.msg.flash_program.data[131], " + "expected 126, is %d", + last_msg.msg.flash_program.data[131]); + ck_assert_msg(last_msg.msg.flash_program.data[132] == 235, + "incorrect value for last_msg.msg.flash_program.data[132], " + "expected 235, is %d", + last_msg.msg.flash_program.data[132]); + ck_assert_msg(last_msg.msg.flash_program.data[133] == 235, + "incorrect value for last_msg.msg.flash_program.data[133], " + "expected 235, is %d", + last_msg.msg.flash_program.data[133]); + ck_assert_msg(last_msg.msg.flash_program.data[134] == 35, + "incorrect value for last_msg.msg.flash_program.data[134], " + "expected 35, is %d", + last_msg.msg.flash_program.data[134]); + ck_assert_msg(last_msg.msg.flash_program.data[135] == 54, + "incorrect value for last_msg.msg.flash_program.data[135], " + "expected 54, is %d", + last_msg.msg.flash_program.data[135]); + ck_assert_msg(last_msg.msg.flash_program.data[136] == 134, + "incorrect value for last_msg.msg.flash_program.data[136], " + "expected 134, is %d", + last_msg.msg.flash_program.data[136]); + ck_assert_msg(last_msg.msg.flash_program.data[137] == 163, + "incorrect value for last_msg.msg.flash_program.data[137], " + "expected 163, is %d", + last_msg.msg.flash_program.data[137]); + ck_assert_msg(last_msg.msg.flash_program.data[138] == 92, + "incorrect value for last_msg.msg.flash_program.data[138], " + "expected 92, is %d", + last_msg.msg.flash_program.data[138]); + ck_assert_msg(last_msg.msg.flash_program.data[139] == 57, + "incorrect value for last_msg.msg.flash_program.data[139], " + "expected 57, is %d", + last_msg.msg.flash_program.data[139]); + ck_assert_msg(last_msg.msg.flash_program.data[140] == 87, + "incorrect value for last_msg.msg.flash_program.data[140], " + "expected 87, is %d", + last_msg.msg.flash_program.data[140]); + ck_assert_msg(last_msg.msg.flash_program.data[141] == 130, + "incorrect value for last_msg.msg.flash_program.data[141], " + "expected 130, is %d", + last_msg.msg.flash_program.data[141]); + ck_assert_msg(last_msg.msg.flash_program.data[142] == 178, + "incorrect value for last_msg.msg.flash_program.data[142], " + "expected 178, is %d", + last_msg.msg.flash_program.data[142]); + ck_assert_msg(last_msg.msg.flash_program.data[143] == 22, + "incorrect value for last_msg.msg.flash_program.data[143], " + "expected 22, is %d", + last_msg.msg.flash_program.data[143]); + ck_assert_msg(last_msg.msg.flash_program.data[144] == 158, + "incorrect value for last_msg.msg.flash_program.data[144], " + "expected 158, is %d", + last_msg.msg.flash_program.data[144]); + ck_assert_msg(last_msg.msg.flash_program.data[145] == 18, + "incorrect value for last_msg.msg.flash_program.data[145], " + "expected 18, is %d", + last_msg.msg.flash_program.data[145]); + ck_assert_msg(last_msg.msg.flash_program.data[146] == 237, + "incorrect value for last_msg.msg.flash_program.data[146], " + "expected 237, is %d", + last_msg.msg.flash_program.data[146]); + ck_assert_msg(last_msg.msg.flash_program.data[147] == 209, + "incorrect value for last_msg.msg.flash_program.data[147], " + "expected 209, is %d", + last_msg.msg.flash_program.data[147]); + ck_assert_msg(last_msg.msg.flash_program.data[148] == 187, + "incorrect value for last_msg.msg.flash_program.data[148], " + "expected 187, is %d", + last_msg.msg.flash_program.data[148]); + ck_assert_msg(last_msg.msg.flash_program.data[149] == 226, + "incorrect value for last_msg.msg.flash_program.data[149], " + "expected 226, is %d", + last_msg.msg.flash_program.data[149]); + ck_assert_msg(last_msg.msg.flash_program.data[150] == 1, + "incorrect value for last_msg.msg.flash_program.data[150], " + "expected 1, is %d", + last_msg.msg.flash_program.data[150]); + ck_assert_msg(last_msg.msg.flash_program.data[151] == 46, + "incorrect value for last_msg.msg.flash_program.data[151], " + "expected 46, is %d", + last_msg.msg.flash_program.data[151]); + ck_assert_msg(last_msg.msg.flash_program.data[152] == 64, + "incorrect value for last_msg.msg.flash_program.data[152], " + "expected 64, is %d", + last_msg.msg.flash_program.data[152]); + ck_assert_msg(last_msg.msg.flash_program.data[153] == 226, + "incorrect value for last_msg.msg.flash_program.data[153], " + "expected 226, is %d", + last_msg.msg.flash_program.data[153]); + ck_assert_msg(last_msg.msg.flash_program.data[154] == 235, + "incorrect value for last_msg.msg.flash_program.data[154], " + "expected 235, is %d", + last_msg.msg.flash_program.data[154]); + ck_assert_msg(last_msg.msg.flash_program.data[155] == 213, + "incorrect value for last_msg.msg.flash_program.data[155], " + "expected 213, is %d", + last_msg.msg.flash_program.data[155]); + ck_assert_msg(last_msg.msg.flash_program.data[156] == 186, + "incorrect value for last_msg.msg.flash_program.data[156], " + "expected 186, is %d", + last_msg.msg.flash_program.data[156]); + ck_assert_msg(last_msg.msg.flash_program.data[157] == 159, + "incorrect value for last_msg.msg.flash_program.data[157], " + "expected 159, is %d", + last_msg.msg.flash_program.data[157]); + ck_assert_msg(last_msg.msg.flash_program.data[158] == 221, + "incorrect value for last_msg.msg.flash_program.data[158], " + "expected 221, is %d", + last_msg.msg.flash_program.data[158]); + ck_assert_msg(last_msg.msg.flash_program.data[159] == 186, + "incorrect value for last_msg.msg.flash_program.data[159], " + "expected 186, is %d", + last_msg.msg.flash_program.data[159]); + ck_assert_msg(last_msg.msg.flash_program.data[160] == 25, + "incorrect value for last_msg.msg.flash_program.data[160], " + "expected 25, is %d", + last_msg.msg.flash_program.data[160]); + ck_assert_msg(last_msg.msg.flash_program.data[161] == 115, + "incorrect value for last_msg.msg.flash_program.data[161], " + "expected 115, is %d", + last_msg.msg.flash_program.data[161]); + ck_assert_msg(last_msg.msg.flash_program.data[162] == 84, + "incorrect value for last_msg.msg.flash_program.data[162], " + "expected 84, is %d", + last_msg.msg.flash_program.data[162]); + ck_assert_msg(last_msg.msg.flash_program.data[163] == 131, + "incorrect value for last_msg.msg.flash_program.data[163], " + "expected 131, is %d", + last_msg.msg.flash_program.data[163]); + ck_assert_msg(last_msg.msg.flash_program.data[164] == 167, + "incorrect value for last_msg.msg.flash_program.data[164], " + "expected 167, is %d", + last_msg.msg.flash_program.data[164]); + ck_assert_msg(last_msg.msg.flash_program.data[165] == 201, + "incorrect value for last_msg.msg.flash_program.data[165], " + "expected 201, is %d", + last_msg.msg.flash_program.data[165]); + ck_assert_msg(last_msg.msg.flash_program.data[166] == 104, + "incorrect value for last_msg.msg.flash_program.data[166], " + "expected 104, is %d", + last_msg.msg.flash_program.data[166]); + ck_assert_msg(last_msg.msg.flash_program.data[167] == 1, + "incorrect value for last_msg.msg.flash_program.data[167], " + "expected 1, is %d", + last_msg.msg.flash_program.data[167]); + ck_assert_msg(last_msg.msg.flash_program.data[168] == 200, + "incorrect value for last_msg.msg.flash_program.data[168], " + "expected 200, is %d", + last_msg.msg.flash_program.data[168]); + ck_assert_msg(last_msg.msg.flash_program.data[169] == 13, + "incorrect value for last_msg.msg.flash_program.data[169], " + "expected 13, is %d", + last_msg.msg.flash_program.data[169]); + ck_assert_msg(last_msg.msg.flash_program.data[170] == 50, + "incorrect value for last_msg.msg.flash_program.data[170], " + "expected 50, is %d", + last_msg.msg.flash_program.data[170]); + ck_assert_msg(last_msg.msg.flash_program.data[171] == 71, + "incorrect value for last_msg.msg.flash_program.data[171], " + "expected 71, is %d", + last_msg.msg.flash_program.data[171]); + ck_assert_msg(last_msg.msg.flash_program.data[172] == 73, + "incorrect value for last_msg.msg.flash_program.data[172], " + "expected 73, is %d", + last_msg.msg.flash_program.data[172]); + ck_assert_msg(last_msg.msg.flash_program.data[173] == 193, + "incorrect value for last_msg.msg.flash_program.data[173], " + "expected 193, is %d", + last_msg.msg.flash_program.data[173]); + ck_assert_msg(last_msg.msg.flash_program.data[174] == 201, + "incorrect value for last_msg.msg.flash_program.data[174], " + "expected 201, is %d", + last_msg.msg.flash_program.data[174]); + ck_assert_msg(last_msg.msg.flash_program.data[175] == 250, + "incorrect value for last_msg.msg.flash_program.data[175], " + "expected 250, is %d", + last_msg.msg.flash_program.data[175]); + ck_assert_msg(last_msg.msg.flash_program.data[176] == 172, + "incorrect value for last_msg.msg.flash_program.data[176], " + "expected 172, is %d", + last_msg.msg.flash_program.data[176]); + ck_assert_msg(last_msg.msg.flash_program.data[177] == 193, + "incorrect value for last_msg.msg.flash_program.data[177], " + "expected 193, is %d", + last_msg.msg.flash_program.data[177]); + ck_assert_msg(last_msg.msg.flash_program.data[178] == 13, + "incorrect value for last_msg.msg.flash_program.data[178], " + "expected 13, is %d", + last_msg.msg.flash_program.data[178]); + ck_assert_msg(last_msg.msg.flash_program.data[179] == 20, + "incorrect value for last_msg.msg.flash_program.data[179], " + "expected 20, is %d", + last_msg.msg.flash_program.data[179]); + ck_assert_msg(last_msg.msg.flash_program.data[180] == 238, + "incorrect value for last_msg.msg.flash_program.data[180], " + "expected 238, is %d", + last_msg.msg.flash_program.data[180]); + ck_assert_msg(last_msg.msg.flash_program.data[181] == 130, + "incorrect value for last_msg.msg.flash_program.data[181], " + "expected 130, is %d", + last_msg.msg.flash_program.data[181]); + ck_assert_msg(last_msg.msg.flash_program.data[182] == 243, + "incorrect value for last_msg.msg.flash_program.data[182], " + "expected 243, is %d", + last_msg.msg.flash_program.data[182]); + ck_assert_msg(last_msg.msg.flash_program.data[183] == 68, + "incorrect value for last_msg.msg.flash_program.data[183], " + "expected 68, is %d", + last_msg.msg.flash_program.data[183]); + ck_assert_msg(last_msg.msg.flash_program.data[184] == 4, + "incorrect value for last_msg.msg.flash_program.data[184], " + "expected 4, is %d", + last_msg.msg.flash_program.data[184]); + ck_assert_msg(last_msg.msg.flash_program.data[185] == 72, + "incorrect value for last_msg.msg.flash_program.data[185], " + "expected 72, is %d", + last_msg.msg.flash_program.data[185]); + ck_assert_msg(last_msg.msg.flash_program.data[186] == 46, + "incorrect value for last_msg.msg.flash_program.data[186], " + "expected 46, is %d", + last_msg.msg.flash_program.data[186]); + ck_assert_msg(last_msg.msg.flash_program.data[187] == 194, + "incorrect value for last_msg.msg.flash_program.data[187], " + "expected 194, is %d", + last_msg.msg.flash_program.data[187]); + ck_assert_msg(last_msg.msg.flash_program.data[188] == 113, + "incorrect value for last_msg.msg.flash_program.data[188], " + "expected 113, is %d", + last_msg.msg.flash_program.data[188]); + ck_assert_msg(last_msg.msg.flash_program.data[189] == 255, + "incorrect value for last_msg.msg.flash_program.data[189], " + "expected 255, is %d", + last_msg.msg.flash_program.data[189]); + ck_assert_msg(last_msg.msg.flash_program.data[190] == 238, + "incorrect value for last_msg.msg.flash_program.data[190], " + "expected 238, is %d", + last_msg.msg.flash_program.data[190]); + ck_assert_msg(last_msg.msg.flash_program.data[191] == 15, + "incorrect value for last_msg.msg.flash_program.data[191], " + "expected 15, is %d", + last_msg.msg.flash_program.data[191]); + ck_assert_msg(last_msg.msg.flash_program.data[192] == 230, + "incorrect value for last_msg.msg.flash_program.data[192], " + "expected 230, is %d", + last_msg.msg.flash_program.data[192]); + ck_assert_msg(last_msg.msg.flash_program.data[193] == 64, + "incorrect value for last_msg.msg.flash_program.data[193], " + "expected 64, is %d", + last_msg.msg.flash_program.data[193]); + ck_assert_msg(last_msg.msg.flash_program.data[194] == 178, + "incorrect value for last_msg.msg.flash_program.data[194], " + "expected 178, is %d", + last_msg.msg.flash_program.data[194]); + ck_assert_msg(last_msg.msg.flash_program.data[195] == 127, + "incorrect value for last_msg.msg.flash_program.data[195], " + "expected 127, is %d", + last_msg.msg.flash_program.data[195]); + ck_assert_msg(last_msg.msg.flash_program.data[196] == 217, + "incorrect value for last_msg.msg.flash_program.data[196], " + "expected 217, is %d", + last_msg.msg.flash_program.data[196]); + ck_assert_msg(last_msg.msg.flash_program.data[197] == 92, + "incorrect value for last_msg.msg.flash_program.data[197], " + "expected 92, is %d", + last_msg.msg.flash_program.data[197]); + ck_assert_msg(last_msg.msg.flash_program.data[198] == 160, + "incorrect value for last_msg.msg.flash_program.data[198], " + "expected 160, is %d", + last_msg.msg.flash_program.data[198]); + ck_assert_msg(last_msg.msg.flash_program.data[199] == 201, + "incorrect value for last_msg.msg.flash_program.data[199], " + "expected 201, is %d", + last_msg.msg.flash_program.data[199]); + ck_assert_msg(last_msg.msg.flash_program.data[200] == 118, + "incorrect value for last_msg.msg.flash_program.data[200], " + "expected 118, is %d", + last_msg.msg.flash_program.data[200]); + ck_assert_msg(last_msg.msg.flash_program.data[201] == 163, + "incorrect value for last_msg.msg.flash_program.data[201], " + "expected 163, is %d", + last_msg.msg.flash_program.data[201]); + ck_assert_msg(last_msg.msg.flash_program.data[202] == 144, + "incorrect value for last_msg.msg.flash_program.data[202], " + "expected 144, is %d", + last_msg.msg.flash_program.data[202]); + ck_assert_msg(last_msg.msg.flash_program.data[203] == 58, + "incorrect value for last_msg.msg.flash_program.data[203], " + "expected 58, is %d", + last_msg.msg.flash_program.data[203]); + ck_assert_msg(last_msg.msg.flash_program.data[204] == 28, + "incorrect value for last_msg.msg.flash_program.data[204], " + "expected 28, is %d", + last_msg.msg.flash_program.data[204]); + ck_assert_msg(last_msg.msg.flash_program.data[205] == 174, + "incorrect value for last_msg.msg.flash_program.data[205], " + "expected 174, is %d", + last_msg.msg.flash_program.data[205]); + ck_assert_msg(last_msg.msg.flash_program.data[206] == 65, + "incorrect value for last_msg.msg.flash_program.data[206], " + "expected 65, is %d", + last_msg.msg.flash_program.data[206]); + ck_assert_msg(last_msg.msg.flash_program.data[207] == 73, + "incorrect value for last_msg.msg.flash_program.data[207], " + "expected 73, is %d", + last_msg.msg.flash_program.data[207]); + ck_assert_msg(last_msg.msg.flash_program.data[208] == 45, + "incorrect value for last_msg.msg.flash_program.data[208], " + "expected 45, is %d", + last_msg.msg.flash_program.data[208]); + ck_assert_msg(last_msg.msg.flash_program.data[209] == 123, + "incorrect value for last_msg.msg.flash_program.data[209], " + "expected 123, is %d", + last_msg.msg.flash_program.data[209]); + ck_assert_msg(last_msg.msg.flash_program.data[210] == 118, + "incorrect value for last_msg.msg.flash_program.data[210], " + "expected 118, is %d", + last_msg.msg.flash_program.data[210]); + ck_assert_msg(last_msg.msg.flash_program.data[211] == 83, + "incorrect value for last_msg.msg.flash_program.data[211], " + "expected 83, is %d", + last_msg.msg.flash_program.data[211]); + ck_assert_msg(last_msg.msg.flash_program.data[212] == 107, + "incorrect value for last_msg.msg.flash_program.data[212], " + "expected 107, is %d", + last_msg.msg.flash_program.data[212]); + ck_assert_msg(last_msg.msg.flash_program.data[213] == 239, + "incorrect value for last_msg.msg.flash_program.data[213], " + "expected 239, is %d", + last_msg.msg.flash_program.data[213]); + ck_assert_msg(last_msg.msg.flash_program.data[214] == 168, + "incorrect value for last_msg.msg.flash_program.data[214], " + "expected 168, is %d", + last_msg.msg.flash_program.data[214]); + ck_assert_msg(last_msg.msg.flash_program.data[215] == 32, + "incorrect value for last_msg.msg.flash_program.data[215], " + "expected 32, is %d", + last_msg.msg.flash_program.data[215]); + ck_assert_msg(last_msg.msg.flash_program.data[216] == 212, + "incorrect value for last_msg.msg.flash_program.data[216], " + "expected 212, is %d", + last_msg.msg.flash_program.data[216]); + ck_assert_msg(last_msg.msg.flash_program.data[217] == 191, + "incorrect value for last_msg.msg.flash_program.data[217], " + "expected 191, is %d", + last_msg.msg.flash_program.data[217]); + ck_assert_msg(last_msg.msg.flash_program.data[218] == 81, + "incorrect value for last_msg.msg.flash_program.data[218], " + "expected 81, is %d", + last_msg.msg.flash_program.data[218]); + ck_assert_msg(last_msg.msg.flash_program.data[219] == 93, + "incorrect value for last_msg.msg.flash_program.data[219], " + "expected 93, is %d", + last_msg.msg.flash_program.data[219]); + ck_assert_msg(last_msg.msg.flash_program.data[220] == 186, + "incorrect value for last_msg.msg.flash_program.data[220], " + "expected 186, is %d", + last_msg.msg.flash_program.data[220]); + ck_assert_msg(last_msg.msg.flash_program.data[221] == 223, + "incorrect value for last_msg.msg.flash_program.data[221], " + "expected 223, is %d", + last_msg.msg.flash_program.data[221]); + ck_assert_msg(last_msg.msg.flash_program.data[222] == 32, + "incorrect value for last_msg.msg.flash_program.data[222], " + "expected 32, is %d", + last_msg.msg.flash_program.data[222]); + ck_assert_msg(last_msg.msg.flash_program.data[223] == 19, + "incorrect value for last_msg.msg.flash_program.data[223], " + "expected 19, is %d", + last_msg.msg.flash_program.data[223]); + ck_assert_msg(last_msg.msg.flash_program.data[224] == 58, + "incorrect value for last_msg.msg.flash_program.data[224], " + "expected 58, is %d", + last_msg.msg.flash_program.data[224]); + ck_assert_msg(last_msg.msg.flash_program.data[225] == 137, + "incorrect value for last_msg.msg.flash_program.data[225], " + "expected 137, is %d", + last_msg.msg.flash_program.data[225]); + ck_assert_msg(last_msg.msg.flash_program.data[226] == 72, + "incorrect value for last_msg.msg.flash_program.data[226], " + "expected 72, is %d", + last_msg.msg.flash_program.data[226]); + ck_assert_msg(last_msg.msg.flash_program.data[227] == 217, + "incorrect value for last_msg.msg.flash_program.data[227], " + "expected 217, is %d", + last_msg.msg.flash_program.data[227]); + ck_assert_msg(last_msg.msg.flash_program.data[228] == 151, + "incorrect value for last_msg.msg.flash_program.data[228], " + "expected 151, is %d", + last_msg.msg.flash_program.data[228]); + ck_assert_msg(last_msg.msg.flash_program.data[229] == 251, + "incorrect value for last_msg.msg.flash_program.data[229], " + "expected 251, is %d", + last_msg.msg.flash_program.data[229]); + ck_assert_msg(last_msg.msg.flash_program.data[230] == 83, + "incorrect value for last_msg.msg.flash_program.data[230], " + "expected 83, is %d", + last_msg.msg.flash_program.data[230]); + ck_assert_msg(last_msg.msg.flash_program.data[231] == 20, + "incorrect value for last_msg.msg.flash_program.data[231], " + "expected 20, is %d", + last_msg.msg.flash_program.data[231]); + ck_assert_msg(last_msg.msg.flash_program.data[232] == 113, + "incorrect value for last_msg.msg.flash_program.data[232], " + "expected 113, is %d", + last_msg.msg.flash_program.data[232]); + ck_assert_msg(last_msg.msg.flash_program.data[233] == 37, + "incorrect value for last_msg.msg.flash_program.data[233], " + "expected 37, is %d", + last_msg.msg.flash_program.data[233]); + ck_assert_msg(last_msg.msg.flash_program.data[234] == 151, + "incorrect value for last_msg.msg.flash_program.data[234], " + "expected 151, is %d", + last_msg.msg.flash_program.data[234]); + ck_assert_msg(last_msg.msg.flash_program.data[235] == 34, + "incorrect value for last_msg.msg.flash_program.data[235], " + "expected 34, is %d", + last_msg.msg.flash_program.data[235]); + ck_assert_msg(last_msg.msg.flash_program.data[236] == 37, + "incorrect value for last_msg.msg.flash_program.data[236], " + "expected 37, is %d", + last_msg.msg.flash_program.data[236]); + ck_assert_msg(last_msg.msg.flash_program.data[237] == 71, + "incorrect value for last_msg.msg.flash_program.data[237], " + "expected 71, is %d", + last_msg.msg.flash_program.data[237]); + ck_assert_msg(last_msg.msg.flash_program.data[238] == 95, + "incorrect value for last_msg.msg.flash_program.data[238], " + "expected 95, is %d", + last_msg.msg.flash_program.data[238]); + ck_assert_msg(last_msg.msg.flash_program.data[239] == 105, + "incorrect value for last_msg.msg.flash_program.data[239], " + "expected 105, is %d", + last_msg.msg.flash_program.data[239]); + ck_assert_msg(last_msg.msg.flash_program.data[240] == 235, + "incorrect value for last_msg.msg.flash_program.data[240], " + "expected 235, is %d", + last_msg.msg.flash_program.data[240]); + ck_assert_msg(last_msg.msg.flash_program.data[241] == 144, + "incorrect value for last_msg.msg.flash_program.data[241], " + "expected 144, is %d", + last_msg.msg.flash_program.data[241]); + ck_assert_msg(last_msg.msg.flash_program.data[242] == 164, + "incorrect value for last_msg.msg.flash_program.data[242], " + "expected 164, is %d", + last_msg.msg.flash_program.data[242]); + ck_assert_msg(last_msg.msg.flash_program.data[243] == 83, + "incorrect value for last_msg.msg.flash_program.data[243], " + "expected 83, is %d", + last_msg.msg.flash_program.data[243]); + ck_assert_msg(last_msg.msg.flash_program.data[244] == 197, + "incorrect value for last_msg.msg.flash_program.data[244], " + "expected 197, is %d", + last_msg.msg.flash_program.data[244]); + ck_assert_msg(last_msg.msg.flash_program.data[245] == 254, + "incorrect value for last_msg.msg.flash_program.data[245], " + "expected 254, is %d", + last_msg.msg.flash_program.data[245]); + ck_assert_msg(last_msg.msg.flash_program.data[246] == 183, + "incorrect value for last_msg.msg.flash_program.data[246], " + "expected 183, is %d", + last_msg.msg.flash_program.data[246]); + ck_assert_msg(last_msg.msg.flash_program.data[247] == 223, + "incorrect value for last_msg.msg.flash_program.data[247], " + "expected 223, is %d", + last_msg.msg.flash_program.data[247]); + ck_assert_msg(last_msg.msg.flash_program.data[248] == 91, + "incorrect value for last_msg.msg.flash_program.data[248], " + "expected 91, is %d", + last_msg.msg.flash_program.data[248]); + ck_assert_msg(last_msg.msg.flash_program.data[249] == 19, + "incorrect value for last_msg.msg.flash_program.data[249], " + "expected 19, is %d", + last_msg.msg.flash_program.data[249]); + + ck_assert_msg(last_msg.msg.flash_program.target == 212, + "incorrect value for last_msg.msg.flash_program.target, " + "expected 212, is %d", + last_msg.msg.flash_program.target); } } END_TEST -Suite* auto_check_sbp_flash_MsgFlashProgram_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_flash_MsgFlashProgram"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_flash_MsgFlashProgram"); +Suite *auto_check_sbp_flash_MsgFlashProgram_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_flash_MsgFlashProgram"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_flash_MsgFlashProgram"); tcase_add_test(tc_acq, test_auto_check_sbp_flash_MsgFlashProgram); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_flash_MsgFlashReadReq.c b/c/test/auto_check_sbp_flash_MsgFlashReadReq.c index 6716c7bcf..5214632d7 100644 --- a/c/test/auto_check_sbp_flash_MsgFlashReadReq.c +++ b/c/test/auto_check_sbp_flash_MsgFlashReadReq.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadReq.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_flash_MsgFlashReadReq ) -{ +START_TEST(test_auto_check_sbp_flash_MsgFlashReadReq) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_flash_MsgFlashReadReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,62 +90,86 @@ START_TEST( test_auto_check_sbp_flash_MsgFlashReadReq ) logging_reset(); - sbp_callback_register(&sbp_state, 0xe7, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xe7, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,231,0,195,4,5,241,28,75,244,71,210,57, }; + u8 encoded_frame[] = { + 85, 231, 0, 195, 4, 5, 241, 28, 75, 244, 71, 210, 57, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.flash_read_req.addr_len = 71; - - + test_msg.flash_read_req.addr_start[0] = 28; - + test_msg.flash_read_req.addr_start[1] = 75; - + test_msg.flash_read_req.addr_start[2] = 244; - + test_msg.flash_read_req.target = 241; - sbp_message_send(&sbp_state, SbpMsgFlashReadReq, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgFlashReadReq, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgFlashReadReq, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgFlashReadReq, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.flash_read_req.addr_len == 71, "incorrect value for last_msg.msg.flash_read_req.addr_len, expected 71, is %d", last_msg.msg.flash_read_req.addr_len); - - ck_assert_msg(last_msg.msg.flash_read_req.addr_start[0] == 28, "incorrect value for last_msg.msg.flash_read_req.addr_start[0], expected 28, is %d", last_msg.msg.flash_read_req.addr_start[0]); - ck_assert_msg(last_msg.msg.flash_read_req.addr_start[1] == 75, "incorrect value for last_msg.msg.flash_read_req.addr_start[1], expected 75, is %d", last_msg.msg.flash_read_req.addr_start[1]); - ck_assert_msg(last_msg.msg.flash_read_req.addr_start[2] == 244, "incorrect value for last_msg.msg.flash_read_req.addr_start[2], expected 244, is %d", last_msg.msg.flash_read_req.addr_start[2]); - - ck_assert_msg(last_msg.msg.flash_read_req.target == 241, "incorrect value for last_msg.msg.flash_read_req.target, expected 241, is %d", last_msg.msg.flash_read_req.target); + ck_assert_msg(last_msg.msg.flash_read_req.addr_len == 71, + "incorrect value for last_msg.msg.flash_read_req.addr_len, " + "expected 71, is %d", + last_msg.msg.flash_read_req.addr_len); + + ck_assert_msg( + last_msg.msg.flash_read_req.addr_start[0] == 28, + "incorrect value for last_msg.msg.flash_read_req.addr_start[0], " + "expected 28, is %d", + last_msg.msg.flash_read_req.addr_start[0]); + ck_assert_msg( + last_msg.msg.flash_read_req.addr_start[1] == 75, + "incorrect value for last_msg.msg.flash_read_req.addr_start[1], " + "expected 75, is %d", + last_msg.msg.flash_read_req.addr_start[1]); + ck_assert_msg( + last_msg.msg.flash_read_req.addr_start[2] == 244, + "incorrect value for last_msg.msg.flash_read_req.addr_start[2], " + "expected 244, is %d", + last_msg.msg.flash_read_req.addr_start[2]); + + ck_assert_msg(last_msg.msg.flash_read_req.target == 241, + "incorrect value for last_msg.msg.flash_read_req.target, " + "expected 241, is %d", + last_msg.msg.flash_read_req.target); } } END_TEST -Suite* auto_check_sbp_flash_MsgFlashReadReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_flash_MsgFlashReadReq"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_flash_MsgFlashReadReq"); +Suite *auto_check_sbp_flash_MsgFlashReadReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_flash_MsgFlashReadReq"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_flash_MsgFlashReadReq"); tcase_add_test(tc_acq, test_auto_check_sbp_flash_MsgFlashReadReq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_flash_MsgFlashReadResp.c b/c/test/auto_check_sbp_flash_MsgFlashReadResp.c index 743f4c475..09b2a92f6 100644 --- a/c/test/auto_check_sbp_flash_MsgFlashReadResp.c +++ b/c/test/auto_check_sbp_flash_MsgFlashReadResp.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadResp.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_flash_MsgFlashReadResp ) -{ +START_TEST(test_auto_check_sbp_flash_MsgFlashReadResp) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_flash_MsgFlashReadResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,62 +90,86 @@ START_TEST( test_auto_check_sbp_flash_MsgFlashReadResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xe1, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xe1, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,225,0,195,4,5,136,155,52,172,124,149,135, }; + u8 encoded_frame[] = { + 85, 225, 0, 195, 4, 5, 136, 155, 52, 172, 124, 149, 135, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.flash_read_resp.addr_len = 124; - - + test_msg.flash_read_resp.addr_start[0] = 155; - + test_msg.flash_read_resp.addr_start[1] = 52; - + test_msg.flash_read_resp.addr_start[2] = 172; - + test_msg.flash_read_resp.target = 136; - sbp_message_send(&sbp_state, SbpMsgFlashReadResp, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgFlashReadResp, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgFlashReadResp, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgFlashReadResp, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.flash_read_resp.addr_len == 124, "incorrect value for last_msg.msg.flash_read_resp.addr_len, expected 124, is %d", last_msg.msg.flash_read_resp.addr_len); - - ck_assert_msg(last_msg.msg.flash_read_resp.addr_start[0] == 155, "incorrect value for last_msg.msg.flash_read_resp.addr_start[0], expected 155, is %d", last_msg.msg.flash_read_resp.addr_start[0]); - ck_assert_msg(last_msg.msg.flash_read_resp.addr_start[1] == 52, "incorrect value for last_msg.msg.flash_read_resp.addr_start[1], expected 52, is %d", last_msg.msg.flash_read_resp.addr_start[1]); - ck_assert_msg(last_msg.msg.flash_read_resp.addr_start[2] == 172, "incorrect value for last_msg.msg.flash_read_resp.addr_start[2], expected 172, is %d", last_msg.msg.flash_read_resp.addr_start[2]); - - ck_assert_msg(last_msg.msg.flash_read_resp.target == 136, "incorrect value for last_msg.msg.flash_read_resp.target, expected 136, is %d", last_msg.msg.flash_read_resp.target); + ck_assert_msg(last_msg.msg.flash_read_resp.addr_len == 124, + "incorrect value for last_msg.msg.flash_read_resp.addr_len, " + "expected 124, is %d", + last_msg.msg.flash_read_resp.addr_len); + + ck_assert_msg( + last_msg.msg.flash_read_resp.addr_start[0] == 155, + "incorrect value for last_msg.msg.flash_read_resp.addr_start[0], " + "expected 155, is %d", + last_msg.msg.flash_read_resp.addr_start[0]); + ck_assert_msg( + last_msg.msg.flash_read_resp.addr_start[1] == 52, + "incorrect value for last_msg.msg.flash_read_resp.addr_start[1], " + "expected 52, is %d", + last_msg.msg.flash_read_resp.addr_start[1]); + ck_assert_msg( + last_msg.msg.flash_read_resp.addr_start[2] == 172, + "incorrect value for last_msg.msg.flash_read_resp.addr_start[2], " + "expected 172, is %d", + last_msg.msg.flash_read_resp.addr_start[2]); + + ck_assert_msg(last_msg.msg.flash_read_resp.target == 136, + "incorrect value for last_msg.msg.flash_read_resp.target, " + "expected 136, is %d", + last_msg.msg.flash_read_resp.target); } } END_TEST -Suite* auto_check_sbp_flash_MsgFlashReadResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_flash_MsgFlashReadResp"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_flash_MsgFlashReadResp"); +Suite *auto_check_sbp_flash_MsgFlashReadResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_flash_MsgFlashReadResp"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_flash_MsgFlashReadResp"); tcase_add_test(tc_acq, test_auto_check_sbp_flash_MsgFlashReadResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_flash_MsgM25FlashWriteStatus.c b/c/test/auto_check_sbp_flash_MsgM25FlashWriteStatus.c index 31e31c494..37a346084 100644 --- a/c/test/auto_check_sbp_flash_MsgM25FlashWriteStatus.c +++ b/c/test/auto_check_sbp_flash_MsgM25FlashWriteStatus.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgM25FlashWriteStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgM25FlashWriteStatus.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_flash_MsgM25FlashWriteStatus ) -{ +START_TEST(test_auto_check_sbp_flash_MsgM25FlashWriteStatus) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_flash_MsgM25FlashWriteStatus ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,48 +90,58 @@ START_TEST( test_auto_check_sbp_flash_MsgM25FlashWriteStatus ) logging_reset(); - sbp_callback_register(&sbp_state, 0xf3, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xf3, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,243,0,195,4,1,5,112,200, }; + u8 encoded_frame[] = { + 85, 243, 0, 195, 4, 1, 5, 112, 200, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.m25_flash_write_status.status[0] = 5; - sbp_message_send(&sbp_state, SbpMsgM25FlashWriteStatus, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgM25FlashWriteStatus, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgM25FlashWriteStatus, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.m25_flash_write_status.status[0] == 5, "incorrect value for last_msg.msg.m25_flash_write_status.status[0], expected 5, is %d", last_msg.msg.m25_flash_write_status.status[0]); + ck_assert_msg(sbp_message_cmp(SbpMsgM25FlashWriteStatus, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + ck_assert_msg( + last_msg.msg.m25_flash_write_status.status[0] == 5, + "incorrect value for last_msg.msg.m25_flash_write_status.status[0], " + "expected 5, is %d", + last_msg.msg.m25_flash_write_status.status[0]); } } END_TEST -Suite* auto_check_sbp_flash_MsgM25FlashWriteStatus_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_flash_MsgM25FlashWriteStatus"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_flash_MsgM25FlashWriteStatus"); +Suite *auto_check_sbp_flash_MsgM25FlashWriteStatus_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_flash_MsgM25FlashWriteStatus"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_flash_MsgM25FlashWriteStatus"); tcase_add_test(tc_acq, test_auto_check_sbp_flash_MsgM25FlashWriteStatus); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_flash_MsgStmFlashLockSector.c b/c/test/auto_check_sbp_flash_MsgStmFlashLockSector.c index a1f049e1e..79c41fed3 100644 --- a/c/test/auto_check_sbp_flash_MsgStmFlashLockSector.c +++ b/c/test/auto_check_sbp_flash_MsgStmFlashLockSector.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashLockSector.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashLockSector.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_flash_MsgStmFlashLockSector ) -{ +START_TEST(test_auto_check_sbp_flash_MsgStmFlashLockSector) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_flash_MsgStmFlashLockSector ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,47 +90,58 @@ START_TEST( test_auto_check_sbp_flash_MsgStmFlashLockSector ) logging_reset(); - sbp_callback_register(&sbp_state, 0xe3, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xe3, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,227,0,195,4,4,161,247,197,67,229,32, }; + u8 encoded_frame[] = { + 85, 227, 0, 195, 4, 4, 161, 247, 197, 67, 229, 32, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.stm_flash_lock_sector.sector = 1137047457; - sbp_message_send(&sbp_state, SbpMsgStmFlashLockSector, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgStmFlashLockSector, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgStmFlashLockSector, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.stm_flash_lock_sector.sector == 1137047457, "incorrect value for last_msg.msg.stm_flash_lock_sector.sector, expected 1137047457, is %d", last_msg.msg.stm_flash_lock_sector.sector); + ck_assert_msg(sbp_message_cmp(SbpMsgStmFlashLockSector, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + ck_assert_msg( + last_msg.msg.stm_flash_lock_sector.sector == 1137047457, + "incorrect value for last_msg.msg.stm_flash_lock_sector.sector, " + "expected 1137047457, is %d", + last_msg.msg.stm_flash_lock_sector.sector); } } END_TEST -Suite* auto_check_sbp_flash_MsgStmFlashLockSector_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_flash_MsgStmFlashLockSector"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_flash_MsgStmFlashLockSector"); +Suite *auto_check_sbp_flash_MsgStmFlashLockSector_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_flash_MsgStmFlashLockSector"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_flash_MsgStmFlashLockSector"); tcase_add_test(tc_acq, test_auto_check_sbp_flash_MsgStmFlashLockSector); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_flash_MsgStmFlashUnlockSector.c b/c/test/auto_check_sbp_flash_MsgStmFlashUnlockSector.c index 8f634c6dc..78a06c8de 100644 --- a/c/test/auto_check_sbp_flash_MsgStmFlashUnlockSector.c +++ b/c/test/auto_check_sbp_flash_MsgStmFlashUnlockSector.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashUnlockSector.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashUnlockSector.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_flash_MsgStmFlashUnlockSector ) -{ +START_TEST(test_auto_check_sbp_flash_MsgStmFlashUnlockSector) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_flash_MsgStmFlashUnlockSector ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,47 +90,58 @@ START_TEST( test_auto_check_sbp_flash_MsgStmFlashUnlockSector ) logging_reset(); - sbp_callback_register(&sbp_state, 0xe4, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xe4, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,228,0,195,4,4,31,16,231,49,53,217, }; + u8 encoded_frame[] = { + 85, 228, 0, 195, 4, 4, 31, 16, 231, 49, 53, 217, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.stm_flash_unlock_sector.sector = 837226527; - sbp_message_send(&sbp_state, SbpMsgStmFlashUnlockSector, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgStmFlashUnlockSector, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgStmFlashUnlockSector, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.stm_flash_unlock_sector.sector == 837226527, "incorrect value for last_msg.msg.stm_flash_unlock_sector.sector, expected 837226527, is %d", last_msg.msg.stm_flash_unlock_sector.sector); + ck_assert_msg(sbp_message_cmp(SbpMsgStmFlashUnlockSector, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + ck_assert_msg( + last_msg.msg.stm_flash_unlock_sector.sector == 837226527, + "incorrect value for last_msg.msg.stm_flash_unlock_sector.sector, " + "expected 837226527, is %d", + last_msg.msg.stm_flash_unlock_sector.sector); } } END_TEST -Suite* auto_check_sbp_flash_MsgStmFlashUnlockSector_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_flash_MsgStmFlashUnlockSector"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_flash_MsgStmFlashUnlockSector"); +Suite *auto_check_sbp_flash_MsgStmFlashUnlockSector_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_flash_MsgStmFlashUnlockSector"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_flash_MsgStmFlashUnlockSector"); tcase_add_test(tc_acq, test_auto_check_sbp_flash_MsgStmFlashUnlockSector); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_flash_MsgStmUniqueIdReq.c b/c/test/auto_check_sbp_flash_MsgStmUniqueIdReq.c index 6f977e173..473d80111 100644 --- a/c/test/auto_check_sbp_flash_MsgStmUniqueIdReq.c +++ b/c/test/auto_check_sbp_flash_MsgStmUniqueIdReq.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdReq.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_flash_MsgStmUniqueIdReq ) -{ +START_TEST(test_auto_check_sbp_flash_MsgStmUniqueIdReq) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_flash_MsgStmUniqueIdReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,43 +90,50 @@ START_TEST( test_auto_check_sbp_flash_MsgStmUniqueIdReq ) logging_reset(); - sbp_callback_register(&sbp_state, 0xe8, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xe8, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,232,0,195,4,0,66,138, }; + u8 encoded_frame[] = { + 85, 232, 0, 195, 4, 0, 66, 138, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - sbp_message_send(&sbp_state, SbpMsgStmUniqueIdReq, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgStmUniqueIdReq, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgStmUniqueIdReq, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgStmUniqueIdReq, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - } } END_TEST -Suite* auto_check_sbp_flash_MsgStmUniqueIdReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_flash_MsgStmUniqueIdReq"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_flash_MsgStmUniqueIdReq"); +Suite *auto_check_sbp_flash_MsgStmUniqueIdReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_flash_MsgStmUniqueIdReq"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_flash_MsgStmUniqueIdReq"); tcase_add_test(tc_acq, test_auto_check_sbp_flash_MsgStmUniqueIdReq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_flash_MsgStmUniqueIdResp.c b/c/test/auto_check_sbp_flash_MsgStmUniqueIdResp.c index 92e4a8fc0..c0c475a1a 100644 --- a/c/test/auto_check_sbp_flash_MsgStmUniqueIdResp.c +++ b/c/test/auto_check_sbp_flash_MsgStmUniqueIdResp.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdResp.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_flash_MsgStmUniqueIdResp ) -{ +START_TEST(test_auto_check_sbp_flash_MsgStmUniqueIdResp) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_flash_MsgStmUniqueIdResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,81 +90,136 @@ START_TEST( test_auto_check_sbp_flash_MsgStmUniqueIdResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xe5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xe5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,229,0,195,4,12,196,16,15,163,85,221,119,102,32,194,56,144,221,196, }; + u8 encoded_frame[] = { + 85, 229, 0, 195, 4, 12, 196, 16, 15, 163, + 85, 221, 119, 102, 32, 194, 56, 144, 221, 196, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.stm_unique_id_resp.stm_id[0] = 196; - + test_msg.stm_unique_id_resp.stm_id[1] = 16; - + test_msg.stm_unique_id_resp.stm_id[2] = 15; - + test_msg.stm_unique_id_resp.stm_id[3] = 163; - + test_msg.stm_unique_id_resp.stm_id[4] = 85; - + test_msg.stm_unique_id_resp.stm_id[5] = 221; - + test_msg.stm_unique_id_resp.stm_id[6] = 119; - + test_msg.stm_unique_id_resp.stm_id[7] = 102; - + test_msg.stm_unique_id_resp.stm_id[8] = 32; - + test_msg.stm_unique_id_resp.stm_id[9] = 194; - + test_msg.stm_unique_id_resp.stm_id[10] = 56; - + test_msg.stm_unique_id_resp.stm_id[11] = 144; - sbp_message_send(&sbp_state, SbpMsgStmUniqueIdResp, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgStmUniqueIdResp, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgStmUniqueIdResp, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgStmUniqueIdResp, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.stm_unique_id_resp.stm_id[0] == 196, "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[0], expected 196, is %d", last_msg.msg.stm_unique_id_resp.stm_id[0]); - ck_assert_msg(last_msg.msg.stm_unique_id_resp.stm_id[1] == 16, "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[1], expected 16, is %d", last_msg.msg.stm_unique_id_resp.stm_id[1]); - ck_assert_msg(last_msg.msg.stm_unique_id_resp.stm_id[2] == 15, "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[2], expected 15, is %d", last_msg.msg.stm_unique_id_resp.stm_id[2]); - ck_assert_msg(last_msg.msg.stm_unique_id_resp.stm_id[3] == 163, "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[3], expected 163, is %d", last_msg.msg.stm_unique_id_resp.stm_id[3]); - ck_assert_msg(last_msg.msg.stm_unique_id_resp.stm_id[4] == 85, "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[4], expected 85, is %d", last_msg.msg.stm_unique_id_resp.stm_id[4]); - ck_assert_msg(last_msg.msg.stm_unique_id_resp.stm_id[5] == 221, "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[5], expected 221, is %d", last_msg.msg.stm_unique_id_resp.stm_id[5]); - ck_assert_msg(last_msg.msg.stm_unique_id_resp.stm_id[6] == 119, "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[6], expected 119, is %d", last_msg.msg.stm_unique_id_resp.stm_id[6]); - ck_assert_msg(last_msg.msg.stm_unique_id_resp.stm_id[7] == 102, "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[7], expected 102, is %d", last_msg.msg.stm_unique_id_resp.stm_id[7]); - ck_assert_msg(last_msg.msg.stm_unique_id_resp.stm_id[8] == 32, "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[8], expected 32, is %d", last_msg.msg.stm_unique_id_resp.stm_id[8]); - ck_assert_msg(last_msg.msg.stm_unique_id_resp.stm_id[9] == 194, "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[9], expected 194, is %d", last_msg.msg.stm_unique_id_resp.stm_id[9]); - ck_assert_msg(last_msg.msg.stm_unique_id_resp.stm_id[10] == 56, "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[10], expected 56, is %d", last_msg.msg.stm_unique_id_resp.stm_id[10]); - ck_assert_msg(last_msg.msg.stm_unique_id_resp.stm_id[11] == 144, "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[11], expected 144, is %d", last_msg.msg.stm_unique_id_resp.stm_id[11]); + ck_assert_msg( + last_msg.msg.stm_unique_id_resp.stm_id[0] == 196, + "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[0], " + "expected 196, is %d", + last_msg.msg.stm_unique_id_resp.stm_id[0]); + ck_assert_msg( + last_msg.msg.stm_unique_id_resp.stm_id[1] == 16, + "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[1], " + "expected 16, is %d", + last_msg.msg.stm_unique_id_resp.stm_id[1]); + ck_assert_msg( + last_msg.msg.stm_unique_id_resp.stm_id[2] == 15, + "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[2], " + "expected 15, is %d", + last_msg.msg.stm_unique_id_resp.stm_id[2]); + ck_assert_msg( + last_msg.msg.stm_unique_id_resp.stm_id[3] == 163, + "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[3], " + "expected 163, is %d", + last_msg.msg.stm_unique_id_resp.stm_id[3]); + ck_assert_msg( + last_msg.msg.stm_unique_id_resp.stm_id[4] == 85, + "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[4], " + "expected 85, is %d", + last_msg.msg.stm_unique_id_resp.stm_id[4]); + ck_assert_msg( + last_msg.msg.stm_unique_id_resp.stm_id[5] == 221, + "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[5], " + "expected 221, is %d", + last_msg.msg.stm_unique_id_resp.stm_id[5]); + ck_assert_msg( + last_msg.msg.stm_unique_id_resp.stm_id[6] == 119, + "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[6], " + "expected 119, is %d", + last_msg.msg.stm_unique_id_resp.stm_id[6]); + ck_assert_msg( + last_msg.msg.stm_unique_id_resp.stm_id[7] == 102, + "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[7], " + "expected 102, is %d", + last_msg.msg.stm_unique_id_resp.stm_id[7]); + ck_assert_msg( + last_msg.msg.stm_unique_id_resp.stm_id[8] == 32, + "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[8], " + "expected 32, is %d", + last_msg.msg.stm_unique_id_resp.stm_id[8]); + ck_assert_msg( + last_msg.msg.stm_unique_id_resp.stm_id[9] == 194, + "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[9], " + "expected 194, is %d", + last_msg.msg.stm_unique_id_resp.stm_id[9]); + ck_assert_msg( + last_msg.msg.stm_unique_id_resp.stm_id[10] == 56, + "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[10], " + "expected 56, is %d", + last_msg.msg.stm_unique_id_resp.stm_id[10]); + ck_assert_msg( + last_msg.msg.stm_unique_id_resp.stm_id[11] == 144, + "incorrect value for last_msg.msg.stm_unique_id_resp.stm_id[11], " + "expected 144, is %d", + last_msg.msg.stm_unique_id_resp.stm_id[11]); } } END_TEST -Suite* auto_check_sbp_flash_MsgStmUniqueIdResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_flash_MsgStmUniqueIdResp"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_flash_MsgStmUniqueIdResp"); +Suite *auto_check_sbp_flash_MsgStmUniqueIdResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_flash_MsgStmUniqueIdResp"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_flash_MsgStmUniqueIdResp"); tcase_add_test(tc_acq, test_auto_check_sbp_flash_MsgStmUniqueIdResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_imu_MsgImuAux.c b/c/test/auto_check_sbp_imu_MsgImuAux.c index 7884b2eff..cd3a16447 100644 --- a/c/test/auto_check_sbp_imu_MsgImuAux.c +++ b/c/test/auto_check_sbp_imu_MsgImuAux.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuAux.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuAux.yaml by generate.py. Do not +// modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_imu_MsgImuAux ) -{ +START_TEST(test_auto_check_sbp_imu_MsgImuAux) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_imu_MsgImuAux ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,54 +90,67 @@ START_TEST( test_auto_check_sbp_imu_MsgImuAux ) logging_reset(); - sbp_callback_register(&sbp_state, 0x901, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x901, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,9,52,18,4,1,244,10,66,200,252, }; + u8 encoded_frame[] = { + 85, 1, 9, 52, 18, 4, 1, 244, 10, 66, 200, 252, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.imu_aux.imu_conf = 66; - + test_msg.imu_aux.imu_type = 1; - + test_msg.imu_aux.temp = 2804; sbp_message_send(&sbp_state, SbpMsgImuAux, 4660, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4660, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgImuAux, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.imu_aux.imu_conf == 66, "incorrect value for last_msg.msg.imu_aux.imu_conf, expected 66, is %d", last_msg.msg.imu_aux.imu_conf); - - ck_assert_msg(last_msg.msg.imu_aux.imu_type == 1, "incorrect value for last_msg.msg.imu_aux.imu_type, expected 1, is %d", last_msg.msg.imu_aux.imu_type); - - ck_assert_msg(last_msg.msg.imu_aux.temp == 2804, "incorrect value for last_msg.msg.imu_aux.temp, expected 2804, is %d", last_msg.msg.imu_aux.temp); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.imu_aux.imu_conf == 66, + "incorrect value for last_msg.msg.imu_aux.imu_conf, expected 66, is %d", + last_msg.msg.imu_aux.imu_conf); + + ck_assert_msg( + last_msg.msg.imu_aux.imu_type == 1, + "incorrect value for last_msg.msg.imu_aux.imu_type, expected 1, is %d", + last_msg.msg.imu_aux.imu_type); + + ck_assert_msg( + last_msg.msg.imu_aux.temp == 2804, + "incorrect value for last_msg.msg.imu_aux.temp, expected 2804, is %d", + last_msg.msg.imu_aux.temp); } } END_TEST -Suite* auto_check_sbp_imu_MsgImuAux_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_imu_MsgImuAux"); +Suite *auto_check_sbp_imu_MsgImuAux_suite(void) { + Suite *s = + suite_create("SBP generated test suite: auto_check_sbp_imu_MsgImuAux"); TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_imu_MsgImuAux"); tcase_add_test(tc_acq, test_auto_check_sbp_imu_MsgImuAux); suite_add_tcase(s, tc_acq); diff --git a/c/test/auto_check_sbp_imu_MsgImuRaw.c b/c/test/auto_check_sbp_imu_MsgImuRaw.c index 67b4c29da..66d8612cd 100644 --- a/c/test/auto_check_sbp_imu_MsgImuRaw.c +++ b/c/test/auto_check_sbp_imu_MsgImuRaw.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuRaw.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuRaw.yaml by generate.py. Do not +// modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_imu_MsgImuRaw ) -{ +START_TEST(test_auto_check_sbp_imu_MsgImuRaw) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_imu_MsgImuRaw ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,74 +90,103 @@ START_TEST( test_auto_check_sbp_imu_MsgImuRaw ) logging_reset(); - sbp_callback_register(&sbp_state, 0x900, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x900, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,9,52,18,17,26,1,0,192,206,96,0,223,255,44,16,60,0,208,254,238,255,70,135, }; + u8 encoded_frame[] = { + 85, 0, 9, 52, 18, 17, 26, 1, 0, 192, 206, 96, 0, + 223, 255, 44, 16, 60, 0, 208, 254, 238, 255, 70, 135, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.imu_raw.acc_x = 96; - + test_msg.imu_raw.acc_y = -33; - + test_msg.imu_raw.acc_z = 4140; - + test_msg.imu_raw.gyr_x = 60; - + test_msg.imu_raw.gyr_y = -304; - + test_msg.imu_raw.gyr_z = -18; - + test_msg.imu_raw.tow = 3221225754; - + test_msg.imu_raw.tow_f = 206; sbp_message_send(&sbp_state, SbpMsgImuRaw, 4660, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4660, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgImuRaw, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.imu_raw.acc_x == 96, "incorrect value for last_msg.msg.imu_raw.acc_x, expected 96, is %d", last_msg.msg.imu_raw.acc_x); - - ck_assert_msg(last_msg.msg.imu_raw.acc_y == -33, "incorrect value for last_msg.msg.imu_raw.acc_y, expected -33, is %d", last_msg.msg.imu_raw.acc_y); - - ck_assert_msg(last_msg.msg.imu_raw.acc_z == 4140, "incorrect value for last_msg.msg.imu_raw.acc_z, expected 4140, is %d", last_msg.msg.imu_raw.acc_z); - - ck_assert_msg(last_msg.msg.imu_raw.gyr_x == 60, "incorrect value for last_msg.msg.imu_raw.gyr_x, expected 60, is %d", last_msg.msg.imu_raw.gyr_x); - - ck_assert_msg(last_msg.msg.imu_raw.gyr_y == -304, "incorrect value for last_msg.msg.imu_raw.gyr_y, expected -304, is %d", last_msg.msg.imu_raw.gyr_y); - - ck_assert_msg(last_msg.msg.imu_raw.gyr_z == -18, "incorrect value for last_msg.msg.imu_raw.gyr_z, expected -18, is %d", last_msg.msg.imu_raw.gyr_z); - - ck_assert_msg(last_msg.msg.imu_raw.tow == 3221225754, "incorrect value for last_msg.msg.imu_raw.tow, expected 3221225754, is %d", last_msg.msg.imu_raw.tow); - - ck_assert_msg(last_msg.msg.imu_raw.tow_f == 206, "incorrect value for last_msg.msg.imu_raw.tow_f, expected 206, is %d", last_msg.msg.imu_raw.tow_f); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.imu_raw.acc_x == 96, + "incorrect value for last_msg.msg.imu_raw.acc_x, expected 96, is %d", + last_msg.msg.imu_raw.acc_x); + + ck_assert_msg( + last_msg.msg.imu_raw.acc_y == -33, + "incorrect value for last_msg.msg.imu_raw.acc_y, expected -33, is %d", + last_msg.msg.imu_raw.acc_y); + + ck_assert_msg( + last_msg.msg.imu_raw.acc_z == 4140, + "incorrect value for last_msg.msg.imu_raw.acc_z, expected 4140, is %d", + last_msg.msg.imu_raw.acc_z); + + ck_assert_msg( + last_msg.msg.imu_raw.gyr_x == 60, + "incorrect value for last_msg.msg.imu_raw.gyr_x, expected 60, is %d", + last_msg.msg.imu_raw.gyr_x); + + ck_assert_msg( + last_msg.msg.imu_raw.gyr_y == -304, + "incorrect value for last_msg.msg.imu_raw.gyr_y, expected -304, is %d", + last_msg.msg.imu_raw.gyr_y); + + ck_assert_msg( + last_msg.msg.imu_raw.gyr_z == -18, + "incorrect value for last_msg.msg.imu_raw.gyr_z, expected -18, is %d", + last_msg.msg.imu_raw.gyr_z); + + ck_assert_msg(last_msg.msg.imu_raw.tow == 3221225754, + "incorrect value for last_msg.msg.imu_raw.tow, expected " + "3221225754, is %d", + last_msg.msg.imu_raw.tow); + + ck_assert_msg( + last_msg.msg.imu_raw.tow_f == 206, + "incorrect value for last_msg.msg.imu_raw.tow_f, expected 206, is %d", + last_msg.msg.imu_raw.tow_f); } } END_TEST -Suite* auto_check_sbp_imu_MsgImuRaw_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_imu_MsgImuRaw"); +Suite *auto_check_sbp_imu_MsgImuRaw_suite(void) { + Suite *s = + suite_create("SBP generated test suite: auto_check_sbp_imu_MsgImuRaw"); TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_imu_MsgImuRaw"); tcase_add_test(tc_acq, test_auto_check_sbp_imu_MsgImuRaw); suite_add_tcase(s, tc_acq); diff --git a/c/test/auto_check_sbp_integrity_MsgAcknowledge.c b/c/test/auto_check_sbp_integrity_MsgAcknowledge.c index 96ab80f75..af83ca5bf 100644 --- a/c/test/auto_check_sbp_integrity_MsgAcknowledge.c +++ b/c/test/auto_check_sbp_integrity_MsgAcknowledge.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgAcknowledge.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgAcknowledge.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_integrity_MsgAcknowledge ) -{ +START_TEST(test_auto_check_sbp_integrity_MsgAcknowledge) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_integrity_MsgAcknowledge ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,67 +90,94 @@ START_TEST( test_auto_check_sbp_integrity_MsgAcknowledge ) logging_reset(); - sbp_callback_register(&sbp_state, 0xBD2, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xBD2, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,210,11,42,0,11,30,64,226,1,0,0,1,0,1,0,2,86,178, }; + u8 encoded_frame[] = { + 85, 210, 11, 42, 0, 11, 30, 64, 226, 1, 0, 0, 1, 0, 1, 0, 2, 86, 178, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.acknowledge.area_id = 123456; - + test_msg.acknowledge.correction_mask_on_demand = 1; - + test_msg.acknowledge.correction_mask_stream = 1; - + test_msg.acknowledge.request_id = 30; - + test_msg.acknowledge.response_code = 0; - + test_msg.acknowledge.solution_id = 2; - sbp_message_send(&sbp_state, SbpMsgAcknowledge, 42, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAcknowledge, 42, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 42, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAcknowledge, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAcknowledge, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.acknowledge.area_id == 123456, "incorrect value for last_msg.msg.acknowledge.area_id, expected 123456, is %d", last_msg.msg.acknowledge.area_id); - - ck_assert_msg(last_msg.msg.acknowledge.correction_mask_on_demand == 1, "incorrect value for last_msg.msg.acknowledge.correction_mask_on_demand, expected 1, is %d", last_msg.msg.acknowledge.correction_mask_on_demand); - - ck_assert_msg(last_msg.msg.acknowledge.correction_mask_stream == 1, "incorrect value for last_msg.msg.acknowledge.correction_mask_stream, expected 1, is %d", last_msg.msg.acknowledge.correction_mask_stream); - - ck_assert_msg(last_msg.msg.acknowledge.request_id == 30, "incorrect value for last_msg.msg.acknowledge.request_id, expected 30, is %d", last_msg.msg.acknowledge.request_id); - - ck_assert_msg(last_msg.msg.acknowledge.response_code == 0, "incorrect value for last_msg.msg.acknowledge.response_code, expected 0, is %d", last_msg.msg.acknowledge.response_code); - - ck_assert_msg(last_msg.msg.acknowledge.solution_id == 2, "incorrect value for last_msg.msg.acknowledge.solution_id, expected 2, is %d", last_msg.msg.acknowledge.solution_id); + ck_assert_msg(last_msg.msg.acknowledge.area_id == 123456, + "incorrect value for last_msg.msg.acknowledge.area_id, " + "expected 123456, is %d", + last_msg.msg.acknowledge.area_id); + + ck_assert_msg( + last_msg.msg.acknowledge.correction_mask_on_demand == 1, + "incorrect value for " + "last_msg.msg.acknowledge.correction_mask_on_demand, expected 1, is %d", + last_msg.msg.acknowledge.correction_mask_on_demand); + + ck_assert_msg( + last_msg.msg.acknowledge.correction_mask_stream == 1, + "incorrect value for last_msg.msg.acknowledge.correction_mask_stream, " + "expected 1, is %d", + last_msg.msg.acknowledge.correction_mask_stream); + + ck_assert_msg(last_msg.msg.acknowledge.request_id == 30, + "incorrect value for last_msg.msg.acknowledge.request_id, " + "expected 30, is %d", + last_msg.msg.acknowledge.request_id); + + ck_assert_msg(last_msg.msg.acknowledge.response_code == 0, + "incorrect value for last_msg.msg.acknowledge.response_code, " + "expected 0, is %d", + last_msg.msg.acknowledge.response_code); + + ck_assert_msg(last_msg.msg.acknowledge.solution_id == 2, + "incorrect value for last_msg.msg.acknowledge.solution_id, " + "expected 2, is %d", + last_msg.msg.acknowledge.solution_id); } } END_TEST -Suite* auto_check_sbp_integrity_MsgAcknowledge_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_integrity_MsgAcknowledge"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_integrity_MsgAcknowledge"); +Suite *auto_check_sbp_integrity_MsgAcknowledge_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_integrity_MsgAcknowledge"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_integrity_MsgAcknowledge"); tcase_add_test(tc_acq, test_auto_check_sbp_integrity_MsgAcknowledge); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_integrity_MsgSsrFlagHighLevel.c b/c/test/auto_check_sbp_integrity_MsgSsrFlagHighLevel.c index 50aaedd50..79f354f16 100644 --- a/c/test/auto_check_sbp_integrity_MsgSsrFlagHighLevel.c +++ b/c/test/auto_check_sbp_integrity_MsgSsrFlagHighLevel.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagHighLevel.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagHighLevel.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagHighLevel ) -{ +START_TEST(test_auto_check_sbp_integrity_MsgSsrFlagHighLevel) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagHighLevel ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,127 +90,216 @@ START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagHighLevel ) logging_reset(); - sbp_callback_register(&sbp_state, 3001, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 3001, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,185,11,66,0,31,180,0,0,0,3,0,104,1,0,0,6,0,10,20,0,30,0,40,1,2,3,0,0,0,0,0,0,4,5,6,7,102,67, }; + u8 encoded_frame[] = { + 85, 185, 11, 66, 0, 31, 180, 0, 0, 0, 3, 0, 104, + 1, 0, 0, 6, 0, 10, 20, 0, 30, 0, 40, 1, 2, + 3, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7, 102, 67, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ssr_flag_high_level.chain_id = 40; - - + test_msg.ssr_flag_high_level.corr_time.tow = 360; - + test_msg.ssr_flag_high_level.corr_time.wn = 6; - - + test_msg.ssr_flag_high_level.obs_time.tow = 180; - + test_msg.ssr_flag_high_level.obs_time.wn = 3; - - + test_msg.ssr_flag_high_level.reserved[0] = 0; - + test_msg.ssr_flag_high_level.reserved[1] = 0; - + test_msg.ssr_flag_high_level.reserved[2] = 0; - + test_msg.ssr_flag_high_level.reserved[3] = 0; - + test_msg.ssr_flag_high_level.reserved[4] = 0; - + test_msg.ssr_flag_high_level.reserved[5] = 0; - + test_msg.ssr_flag_high_level.ssr_sol_id = 10; - + test_msg.ssr_flag_high_level.tile_id = 30; - + test_msg.ssr_flag_high_level.tile_set_id = 20; - + test_msg.ssr_flag_high_level.use_bds_sat = 3; - + test_msg.ssr_flag_high_level.use_gal_sat = 2; - + test_msg.ssr_flag_high_level.use_gps_sat = 1; - + test_msg.ssr_flag_high_level.use_iono_grid_point_sat_los = 7; - + test_msg.ssr_flag_high_level.use_iono_grid_points = 5; - + test_msg.ssr_flag_high_level.use_iono_tile_sat_los = 6; - + test_msg.ssr_flag_high_level.use_tropo_grid_points = 4; - sbp_message_send(&sbp_state, SbpMsgSsrFlagHighLevel, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrFlagHighLevel, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSsrFlagHighLevel, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSsrFlagHighLevel, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.chain_id == 40, "incorrect value for last_msg.msg.ssr_flag_high_level.chain_id, expected 40, is %d", last_msg.msg.ssr_flag_high_level.chain_id); - - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.corr_time.tow == 360, "incorrect value for last_msg.msg.ssr_flag_high_level.corr_time.tow, expected 360, is %d", last_msg.msg.ssr_flag_high_level.corr_time.tow); - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.corr_time.wn == 6, "incorrect value for last_msg.msg.ssr_flag_high_level.corr_time.wn, expected 6, is %d", last_msg.msg.ssr_flag_high_level.corr_time.wn); - - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.obs_time.tow == 180, "incorrect value for last_msg.msg.ssr_flag_high_level.obs_time.tow, expected 180, is %d", last_msg.msg.ssr_flag_high_level.obs_time.tow); - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.obs_time.wn == 3, "incorrect value for last_msg.msg.ssr_flag_high_level.obs_time.wn, expected 3, is %d", last_msg.msg.ssr_flag_high_level.obs_time.wn); - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.reserved[0] == 0, "incorrect value for last_msg.msg.ssr_flag_high_level.reserved[0], expected 0, is %d", last_msg.msg.ssr_flag_high_level.reserved[0]); - ck_assert_msg(last_msg.msg.ssr_flag_high_level.reserved[1] == 0, "incorrect value for last_msg.msg.ssr_flag_high_level.reserved[1], expected 0, is %d", last_msg.msg.ssr_flag_high_level.reserved[1]); - ck_assert_msg(last_msg.msg.ssr_flag_high_level.reserved[2] == 0, "incorrect value for last_msg.msg.ssr_flag_high_level.reserved[2], expected 0, is %d", last_msg.msg.ssr_flag_high_level.reserved[2]); - ck_assert_msg(last_msg.msg.ssr_flag_high_level.reserved[3] == 0, "incorrect value for last_msg.msg.ssr_flag_high_level.reserved[3], expected 0, is %d", last_msg.msg.ssr_flag_high_level.reserved[3]); - ck_assert_msg(last_msg.msg.ssr_flag_high_level.reserved[4] == 0, "incorrect value for last_msg.msg.ssr_flag_high_level.reserved[4], expected 0, is %d", last_msg.msg.ssr_flag_high_level.reserved[4]); - ck_assert_msg(last_msg.msg.ssr_flag_high_level.reserved[5] == 0, "incorrect value for last_msg.msg.ssr_flag_high_level.reserved[5], expected 0, is %d", last_msg.msg.ssr_flag_high_level.reserved[5]); - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.ssr_sol_id == 10, "incorrect value for last_msg.msg.ssr_flag_high_level.ssr_sol_id, expected 10, is %d", last_msg.msg.ssr_flag_high_level.ssr_sol_id); - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.tile_id == 30, "incorrect value for last_msg.msg.ssr_flag_high_level.tile_id, expected 30, is %d", last_msg.msg.ssr_flag_high_level.tile_id); - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.tile_set_id == 20, "incorrect value for last_msg.msg.ssr_flag_high_level.tile_set_id, expected 20, is %d", last_msg.msg.ssr_flag_high_level.tile_set_id); - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.use_bds_sat == 3, "incorrect value for last_msg.msg.ssr_flag_high_level.use_bds_sat, expected 3, is %d", last_msg.msg.ssr_flag_high_level.use_bds_sat); - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.use_gal_sat == 2, "incorrect value for last_msg.msg.ssr_flag_high_level.use_gal_sat, expected 2, is %d", last_msg.msg.ssr_flag_high_level.use_gal_sat); - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.use_gps_sat == 1, "incorrect value for last_msg.msg.ssr_flag_high_level.use_gps_sat, expected 1, is %d", last_msg.msg.ssr_flag_high_level.use_gps_sat); - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.use_iono_grid_point_sat_los == 7, "incorrect value for last_msg.msg.ssr_flag_high_level.use_iono_grid_point_sat_los, expected 7, is %d", last_msg.msg.ssr_flag_high_level.use_iono_grid_point_sat_los); - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.use_iono_grid_points == 5, "incorrect value for last_msg.msg.ssr_flag_high_level.use_iono_grid_points, expected 5, is %d", last_msg.msg.ssr_flag_high_level.use_iono_grid_points); - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.use_iono_tile_sat_los == 6, "incorrect value for last_msg.msg.ssr_flag_high_level.use_iono_tile_sat_los, expected 6, is %d", last_msg.msg.ssr_flag_high_level.use_iono_tile_sat_los); - - ck_assert_msg(last_msg.msg.ssr_flag_high_level.use_tropo_grid_points == 4, "incorrect value for last_msg.msg.ssr_flag_high_level.use_tropo_grid_points, expected 4, is %d", last_msg.msg.ssr_flag_high_level.use_tropo_grid_points); + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.chain_id == 40, + "incorrect value for last_msg.msg.ssr_flag_high_level.chain_id, " + "expected 40, is %d", + last_msg.msg.ssr_flag_high_level.chain_id); + + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.corr_time.tow == 360, + "incorrect value for last_msg.msg.ssr_flag_high_level.corr_time.tow, " + "expected 360, is %d", + last_msg.msg.ssr_flag_high_level.corr_time.tow); + + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.corr_time.wn == 6, + "incorrect value for last_msg.msg.ssr_flag_high_level.corr_time.wn, " + "expected 6, is %d", + last_msg.msg.ssr_flag_high_level.corr_time.wn); + + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.obs_time.tow == 180, + "incorrect value for last_msg.msg.ssr_flag_high_level.obs_time.tow, " + "expected 180, is %d", + last_msg.msg.ssr_flag_high_level.obs_time.tow); + + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.obs_time.wn == 3, + "incorrect value for last_msg.msg.ssr_flag_high_level.obs_time.wn, " + "expected 3, is %d", + last_msg.msg.ssr_flag_high_level.obs_time.wn); + + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.reserved[0] == 0, + "incorrect value for last_msg.msg.ssr_flag_high_level.reserved[0], " + "expected 0, is %d", + last_msg.msg.ssr_flag_high_level.reserved[0]); + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.reserved[1] == 0, + "incorrect value for last_msg.msg.ssr_flag_high_level.reserved[1], " + "expected 0, is %d", + last_msg.msg.ssr_flag_high_level.reserved[1]); + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.reserved[2] == 0, + "incorrect value for last_msg.msg.ssr_flag_high_level.reserved[2], " + "expected 0, is %d", + last_msg.msg.ssr_flag_high_level.reserved[2]); + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.reserved[3] == 0, + "incorrect value for last_msg.msg.ssr_flag_high_level.reserved[3], " + "expected 0, is %d", + last_msg.msg.ssr_flag_high_level.reserved[3]); + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.reserved[4] == 0, + "incorrect value for last_msg.msg.ssr_flag_high_level.reserved[4], " + "expected 0, is %d", + last_msg.msg.ssr_flag_high_level.reserved[4]); + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.reserved[5] == 0, + "incorrect value for last_msg.msg.ssr_flag_high_level.reserved[5], " + "expected 0, is %d", + last_msg.msg.ssr_flag_high_level.reserved[5]); + + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.ssr_sol_id == 10, + "incorrect value for last_msg.msg.ssr_flag_high_level.ssr_sol_id, " + "expected 10, is %d", + last_msg.msg.ssr_flag_high_level.ssr_sol_id); + + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.tile_id == 30, + "incorrect value for last_msg.msg.ssr_flag_high_level.tile_id, " + "expected 30, is %d", + last_msg.msg.ssr_flag_high_level.tile_id); + + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.tile_set_id == 20, + "incorrect value for last_msg.msg.ssr_flag_high_level.tile_set_id, " + "expected 20, is %d", + last_msg.msg.ssr_flag_high_level.tile_set_id); + + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.use_bds_sat == 3, + "incorrect value for last_msg.msg.ssr_flag_high_level.use_bds_sat, " + "expected 3, is %d", + last_msg.msg.ssr_flag_high_level.use_bds_sat); + + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.use_gal_sat == 2, + "incorrect value for last_msg.msg.ssr_flag_high_level.use_gal_sat, " + "expected 2, is %d", + last_msg.msg.ssr_flag_high_level.use_gal_sat); + + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.use_gps_sat == 1, + "incorrect value for last_msg.msg.ssr_flag_high_level.use_gps_sat, " + "expected 1, is %d", + last_msg.msg.ssr_flag_high_level.use_gps_sat); + + ck_assert_msg( + last_msg.msg.ssr_flag_high_level.use_iono_grid_point_sat_los == 7, + "incorrect value for " + "last_msg.msg.ssr_flag_high_level.use_iono_grid_point_sat_los, " + "expected 7, is %d", + last_msg.msg.ssr_flag_high_level.use_iono_grid_point_sat_los); + + ck_assert_msg(last_msg.msg.ssr_flag_high_level.use_iono_grid_points == 5, + "incorrect value for " + "last_msg.msg.ssr_flag_high_level.use_iono_grid_points, " + "expected 5, is %d", + last_msg.msg.ssr_flag_high_level.use_iono_grid_points); + + ck_assert_msg(last_msg.msg.ssr_flag_high_level.use_iono_tile_sat_los == 6, + "incorrect value for " + "last_msg.msg.ssr_flag_high_level.use_iono_tile_sat_los, " + "expected 6, is %d", + last_msg.msg.ssr_flag_high_level.use_iono_tile_sat_los); + + ck_assert_msg(last_msg.msg.ssr_flag_high_level.use_tropo_grid_points == 4, + "incorrect value for " + "last_msg.msg.ssr_flag_high_level.use_tropo_grid_points, " + "expected 4, is %d", + last_msg.msg.ssr_flag_high_level.use_tropo_grid_points); } } END_TEST -Suite* auto_check_sbp_integrity_MsgSsrFlagHighLevel_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_integrity_MsgSsrFlagHighLevel"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_integrity_MsgSsrFlagHighLevel"); +Suite *auto_check_sbp_integrity_MsgSsrFlagHighLevel_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_integrity_MsgSsrFlagHighLevel"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_integrity_MsgSsrFlagHighLevel"); tcase_add_test(tc_acq, test_auto_check_sbp_integrity_MsgSsrFlagHighLevel); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.c b/c/test/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.c index 0cb45e970..30d550c23 100644 --- a/c/test/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.c +++ b/c/test/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPointSatLos.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPointSatLos.yaml +// by generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos ) -{ +START_TEST(test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,108 +90,183 @@ START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos ) logging_reset(); - sbp_callback_register(&sbp_state, 3025, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 3025, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,209,11,66,0,21,180,0,0,0,3,0,1,2,3,4,0,5,0,6,30,0,2,10,11,15,14,98,148, }; + u8 encoded_frame[] = { + 85, 209, 11, 66, 0, 21, 180, 0, 0, 0, 3, 0, 1, 2, 3, + 4, 0, 5, 0, 6, 30, 0, 2, 10, 11, 15, 14, 98, 148, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - + test_msg.ssr_flag_iono_grid_point_sat_los.faulty_los[0].constellation = 11; - + test_msg.ssr_flag_iono_grid_point_sat_los.faulty_los[0].satId = 10; - - + test_msg.ssr_flag_iono_grid_point_sat_los.faulty_los[1].constellation = 14; - + test_msg.ssr_flag_iono_grid_point_sat_los.faulty_los[1].satId = 15; - + test_msg.ssr_flag_iono_grid_point_sat_los.grid_point_id = 30; - - + test_msg.ssr_flag_iono_grid_point_sat_los.header.chain_id = 6; - + test_msg.ssr_flag_iono_grid_point_sat_los.header.num_msgs = 1; - - + test_msg.ssr_flag_iono_grid_point_sat_los.header.obs_time.tow = 180; - + test_msg.ssr_flag_iono_grid_point_sat_los.header.obs_time.wn = 3; - + test_msg.ssr_flag_iono_grid_point_sat_los.header.seq_num = 2; - + test_msg.ssr_flag_iono_grid_point_sat_los.header.ssr_sol_id = 3; - + test_msg.ssr_flag_iono_grid_point_sat_los.header.tile_id = 5; - + test_msg.ssr_flag_iono_grid_point_sat_los.header.tile_set_id = 4; - + test_msg.ssr_flag_iono_grid_point_sat_los.n_faulty_los = 2; - sbp_message_send(&sbp_state, SbpMsgSsrFlagIonoGridPointSatLos, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrFlagIonoGridPointSatLos, 66, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrFlagIonoGridPointSatLos, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[0].constellation == 11, "incorrect value for last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[0].constellation, expected 11, is %d", last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[0].constellation); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[0].satId == 10, "incorrect value for last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[0].satId, expected 10, is %d", last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[0].satId); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[1].constellation == 14, "incorrect value for last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[1].constellation, expected 14, is %d", last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[1].constellation); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[1].satId == 15, "incorrect value for last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[1].satId, expected 15, is %d", last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[1].satId); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.grid_point_id == 30, "incorrect value for last_msg.msg.ssr_flag_iono_grid_point_sat_los.grid_point_id, expected 30, is %d", last_msg.msg.ssr_flag_iono_grid_point_sat_los.grid_point_id); - - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.chain_id == 6, "incorrect value for last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.chain_id, expected 6, is %d", last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.chain_id); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.num_msgs == 1, "incorrect value for last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.num_msgs, expected 1, is %d", last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.num_msgs); - - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.obs_time.tow == 180, "incorrect value for last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.obs_time.tow, expected 180, is %d", last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.obs_time.tow); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.obs_time.wn == 3, "incorrect value for last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.obs_time.wn, expected 3, is %d", last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.obs_time.wn); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.seq_num == 2, "incorrect value for last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.seq_num, expected 2, is %d", last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.seq_num); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.ssr_sol_id == 3, "incorrect value for last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.ssr_sol_id, expected 3, is %d", last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.ssr_sol_id); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.tile_id == 5, "incorrect value for last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.tile_id, expected 5, is %d", last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.tile_id); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.tile_set_id == 4, "incorrect value for last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.tile_set_id, expected 4, is %d", last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.tile_set_id); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.n_faulty_los == 2, "incorrect value for last_msg.msg.ssr_flag_iono_grid_point_sat_los.n_faulty_los, expected 2, is %d", last_msg.msg.ssr_flag_iono_grid_point_sat_los.n_faulty_los); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrFlagIonoGridPointSatLos, + &last_msg.msg, &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[0] + .constellation == 11, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[0]." + "constellation, expected 11, is %d", + last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[0] + .constellation); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[0].satId == 10, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[0].satId, " + "expected 10, is %d", + last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[0].satId); + + ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[1] + .constellation == 14, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[1]." + "constellation, expected 14, is %d", + last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[1] + .constellation); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[1].satId == 15, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[1].satId, " + "expected 15, is %d", + last_msg.msg.ssr_flag_iono_grid_point_sat_los.faulty_los[1].satId); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_grid_point_sat_los.grid_point_id == 30, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_point_sat_los.grid_point_id, expected " + "30, is %d", + last_msg.msg.ssr_flag_iono_grid_point_sat_los.grid_point_id); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.chain_id == 6, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.chain_id, " + "expected 6, is %d", + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.chain_id); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.num_msgs == 1, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.num_msgs, " + "expected 1, is %d", + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.num_msgs); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.obs_time.tow == + 180, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.obs_time.tow, " + "expected 180, is %d", + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.obs_time.tow); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.obs_time.wn == 3, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.obs_time.wn, " + "expected 3, is %d", + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.obs_time.wn); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.seq_num == 2, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.seq_num, " + "expected 2, is %d", + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.seq_num); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.ssr_sol_id == 3, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.ssr_sol_id, " + "expected 3, is %d", + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.ssr_sol_id); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.tile_id == 5, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.tile_id, " + "expected 5, is %d", + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.tile_id); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.tile_set_id == 4, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.tile_set_id, " + "expected 4, is %d", + last_msg.msg.ssr_flag_iono_grid_point_sat_los.header.tile_set_id); + ck_assert_msg( + last_msg.msg.ssr_flag_iono_grid_point_sat_los.n_faulty_los == 2, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_point_sat_los.n_faulty_los, expected " + "2, is %d", + last_msg.msg.ssr_flag_iono_grid_point_sat_los.n_faulty_los); } } END_TEST -Suite* auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos"); - tcase_add_test(tc_acq, test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos); +Suite *auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos"); + tcase_add_test(tc_acq, + test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.c b/c/test/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.c index 263c6cb8f..7f0c18625 100644 --- a/c/test/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.c +++ b/c/test/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPoints.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPoints.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints ) -{ +START_TEST(test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,95 +90,151 @@ START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints ) logging_reset(); - sbp_callback_register(&sbp_state, 3015, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 3015, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,199,11,66,0,21,180,0,0,0,3,0,1,2,3,4,0,5,0,6,3,10,0,11,0,12,0,53,7, }; + u8 encoded_frame[] = { + 85, 199, 11, 66, 0, 21, 180, 0, 0, 0, 3, 0, 1, 2, 3, + 4, 0, 5, 0, 6, 3, 10, 0, 11, 0, 12, 0, 53, 7, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ssr_flag_iono_grid_points.faulty_points[0] = 10; - + test_msg.ssr_flag_iono_grid_points.faulty_points[1] = 11; - + test_msg.ssr_flag_iono_grid_points.faulty_points[2] = 12; - - + test_msg.ssr_flag_iono_grid_points.header.chain_id = 6; - + test_msg.ssr_flag_iono_grid_points.header.num_msgs = 1; - - + test_msg.ssr_flag_iono_grid_points.header.obs_time.tow = 180; - + test_msg.ssr_flag_iono_grid_points.header.obs_time.wn = 3; - + test_msg.ssr_flag_iono_grid_points.header.seq_num = 2; - + test_msg.ssr_flag_iono_grid_points.header.ssr_sol_id = 3; - + test_msg.ssr_flag_iono_grid_points.header.tile_id = 5; - + test_msg.ssr_flag_iono_grid_points.header.tile_set_id = 4; - + test_msg.ssr_flag_iono_grid_points.n_faulty_points = 3; - sbp_message_send(&sbp_state, SbpMsgSsrFlagIonoGridPoints, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrFlagIonoGridPoints, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrFlagIonoGridPoints, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.faulty_points[0] == 10, "incorrect value for last_msg.msg.ssr_flag_iono_grid_points.faulty_points[0], expected 10, is %d", last_msg.msg.ssr_flag_iono_grid_points.faulty_points[0]); - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.faulty_points[1] == 11, "incorrect value for last_msg.msg.ssr_flag_iono_grid_points.faulty_points[1], expected 11, is %d", last_msg.msg.ssr_flag_iono_grid_points.faulty_points[1]); - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.faulty_points[2] == 12, "incorrect value for last_msg.msg.ssr_flag_iono_grid_points.faulty_points[2], expected 12, is %d", last_msg.msg.ssr_flag_iono_grid_points.faulty_points[2]); - - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.header.chain_id == 6, "incorrect value for last_msg.msg.ssr_flag_iono_grid_points.header.chain_id, expected 6, is %d", last_msg.msg.ssr_flag_iono_grid_points.header.chain_id); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.header.num_msgs == 1, "incorrect value for last_msg.msg.ssr_flag_iono_grid_points.header.num_msgs, expected 1, is %d", last_msg.msg.ssr_flag_iono_grid_points.header.num_msgs); - - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.header.obs_time.tow == 180, "incorrect value for last_msg.msg.ssr_flag_iono_grid_points.header.obs_time.tow, expected 180, is %d", last_msg.msg.ssr_flag_iono_grid_points.header.obs_time.tow); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.header.obs_time.wn == 3, "incorrect value for last_msg.msg.ssr_flag_iono_grid_points.header.obs_time.wn, expected 3, is %d", last_msg.msg.ssr_flag_iono_grid_points.header.obs_time.wn); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.header.seq_num == 2, "incorrect value for last_msg.msg.ssr_flag_iono_grid_points.header.seq_num, expected 2, is %d", last_msg.msg.ssr_flag_iono_grid_points.header.seq_num); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.header.ssr_sol_id == 3, "incorrect value for last_msg.msg.ssr_flag_iono_grid_points.header.ssr_sol_id, expected 3, is %d", last_msg.msg.ssr_flag_iono_grid_points.header.ssr_sol_id); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.header.tile_id == 5, "incorrect value for last_msg.msg.ssr_flag_iono_grid_points.header.tile_id, expected 5, is %d", last_msg.msg.ssr_flag_iono_grid_points.header.tile_id); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.header.tile_set_id == 4, "incorrect value for last_msg.msg.ssr_flag_iono_grid_points.header.tile_set_id, expected 4, is %d", last_msg.msg.ssr_flag_iono_grid_points.header.tile_set_id); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.n_faulty_points == 3, "incorrect value for last_msg.msg.ssr_flag_iono_grid_points.n_faulty_points, expected 3, is %d", last_msg.msg.ssr_flag_iono_grid_points.n_faulty_points); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrFlagIonoGridPoints, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.faulty_points[0] == 10, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_points.faulty_points[0], " + "expected 10, is %d", + last_msg.msg.ssr_flag_iono_grid_points.faulty_points[0]); + ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.faulty_points[1] == 11, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_points.faulty_points[1], " + "expected 11, is %d", + last_msg.msg.ssr_flag_iono_grid_points.faulty_points[1]); + ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.faulty_points[2] == 12, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_points.faulty_points[2], " + "expected 12, is %d", + last_msg.msg.ssr_flag_iono_grid_points.faulty_points[2]); + + ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.header.chain_id == 6, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_points.header.chain_id, " + "expected 6, is %d", + last_msg.msg.ssr_flag_iono_grid_points.header.chain_id); + + ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.header.num_msgs == 1, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_points.header.num_msgs, " + "expected 1, is %d", + last_msg.msg.ssr_flag_iono_grid_points.header.num_msgs); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_grid_points.header.obs_time.tow == 180, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_points.header.obs_time.tow, expected " + "180, is %d", + last_msg.msg.ssr_flag_iono_grid_points.header.obs_time.tow); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_grid_points.header.obs_time.wn == 3, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_points.header.obs_time.wn, expected " + "3, is %d", + last_msg.msg.ssr_flag_iono_grid_points.header.obs_time.wn); + + ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.header.seq_num == 2, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_points.header.seq_num, " + "expected 2, is %d", + last_msg.msg.ssr_flag_iono_grid_points.header.seq_num); + + ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.header.ssr_sol_id == 3, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_points.header.ssr_sol_id, " + "expected 3, is %d", + last_msg.msg.ssr_flag_iono_grid_points.header.ssr_sol_id); + + ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.header.tile_id == 5, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_points.header.tile_id, " + "expected 5, is %d", + last_msg.msg.ssr_flag_iono_grid_points.header.tile_id); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_grid_points.header.tile_set_id == 4, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_points.header.tile_set_id, expected " + "4, is %d", + last_msg.msg.ssr_flag_iono_grid_points.header.tile_set_id); + + ck_assert_msg(last_msg.msg.ssr_flag_iono_grid_points.n_faulty_points == 3, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_grid_points.n_faulty_points, " + "expected 3, is %d", + last_msg.msg.ssr_flag_iono_grid_points.n_faulty_points); } } END_TEST -Suite* auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints"); - tcase_add_test(tc_acq, test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints); +Suite *auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints"); + tcase_add_test(tc_acq, + test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.c b/c/test/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.c index 79f9e5ab6..e47f8a332 100644 --- a/c/test/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.c +++ b/c/test/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoTileSatLos.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoTileSatLos.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos ) -{ +START_TEST(test_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,104 +90,168 @@ START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos ) logging_reset(); - sbp_callback_register(&sbp_state, 3021, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 3021, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,205,11,66,0,19,180,0,0,0,3,0,1,2,3,4,0,5,0,6,2,10,11,15,14,239,235, }; + u8 encoded_frame[] = { + 85, 205, 11, 66, 0, 19, 180, 0, 0, 0, 3, 0, 1, 2, + 3, 4, 0, 5, 0, 6, 2, 10, 11, 15, 14, 239, 235, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - + test_msg.ssr_flag_iono_tile_sat_los.faulty_los[0].constellation = 11; - + test_msg.ssr_flag_iono_tile_sat_los.faulty_los[0].satId = 10; - - + test_msg.ssr_flag_iono_tile_sat_los.faulty_los[1].constellation = 14; - + test_msg.ssr_flag_iono_tile_sat_los.faulty_los[1].satId = 15; - - + test_msg.ssr_flag_iono_tile_sat_los.header.chain_id = 6; - + test_msg.ssr_flag_iono_tile_sat_los.header.num_msgs = 1; - - + test_msg.ssr_flag_iono_tile_sat_los.header.obs_time.tow = 180; - + test_msg.ssr_flag_iono_tile_sat_los.header.obs_time.wn = 3; - + test_msg.ssr_flag_iono_tile_sat_los.header.seq_num = 2; - + test_msg.ssr_flag_iono_tile_sat_los.header.ssr_sol_id = 3; - + test_msg.ssr_flag_iono_tile_sat_los.header.tile_id = 5; - + test_msg.ssr_flag_iono_tile_sat_los.header.tile_set_id = 4; - + test_msg.ssr_flag_iono_tile_sat_los.n_faulty_los = 2; - sbp_message_send(&sbp_state, SbpMsgSsrFlagIonoTileSatLos, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrFlagIonoTileSatLos, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrFlagIonoTileSatLos, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[0].constellation == 11, "incorrect value for last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[0].constellation, expected 11, is %d", last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[0].constellation); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[0].satId == 10, "incorrect value for last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[0].satId, expected 10, is %d", last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[0].satId); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[1].constellation == 14, "incorrect value for last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[1].constellation, expected 14, is %d", last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[1].constellation); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[1].satId == 15, "incorrect value for last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[1].satId, expected 15, is %d", last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[1].satId); - - - ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.header.chain_id == 6, "incorrect value for last_msg.msg.ssr_flag_iono_tile_sat_los.header.chain_id, expected 6, is %d", last_msg.msg.ssr_flag_iono_tile_sat_los.header.chain_id); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.header.num_msgs == 1, "incorrect value for last_msg.msg.ssr_flag_iono_tile_sat_los.header.num_msgs, expected 1, is %d", last_msg.msg.ssr_flag_iono_tile_sat_los.header.num_msgs); - - - ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.header.obs_time.tow == 180, "incorrect value for last_msg.msg.ssr_flag_iono_tile_sat_los.header.obs_time.tow, expected 180, is %d", last_msg.msg.ssr_flag_iono_tile_sat_los.header.obs_time.tow); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.header.obs_time.wn == 3, "incorrect value for last_msg.msg.ssr_flag_iono_tile_sat_los.header.obs_time.wn, expected 3, is %d", last_msg.msg.ssr_flag_iono_tile_sat_los.header.obs_time.wn); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.header.seq_num == 2, "incorrect value for last_msg.msg.ssr_flag_iono_tile_sat_los.header.seq_num, expected 2, is %d", last_msg.msg.ssr_flag_iono_tile_sat_los.header.seq_num); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.header.ssr_sol_id == 3, "incorrect value for last_msg.msg.ssr_flag_iono_tile_sat_los.header.ssr_sol_id, expected 3, is %d", last_msg.msg.ssr_flag_iono_tile_sat_los.header.ssr_sol_id); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.header.tile_id == 5, "incorrect value for last_msg.msg.ssr_flag_iono_tile_sat_los.header.tile_id, expected 5, is %d", last_msg.msg.ssr_flag_iono_tile_sat_los.header.tile_id); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.header.tile_set_id == 4, "incorrect value for last_msg.msg.ssr_flag_iono_tile_sat_los.header.tile_set_id, expected 4, is %d", last_msg.msg.ssr_flag_iono_tile_sat_los.header.tile_set_id); - - ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.n_faulty_los == 2, "incorrect value for last_msg.msg.ssr_flag_iono_tile_sat_los.n_faulty_los, expected 2, is %d", last_msg.msg.ssr_flag_iono_tile_sat_los.n_faulty_los); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrFlagIonoTileSatLos, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[0].constellation == + 11, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[0].constellation, " + "expected 11, is %d", + last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[0].constellation); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[0].satId == 10, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[0].satId, expected " + "10, is %d", + last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[0].satId); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[1].constellation == + 14, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[1].constellation, " + "expected 14, is %d", + last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[1].constellation); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[1].satId == 15, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[1].satId, expected " + "15, is %d", + last_msg.msg.ssr_flag_iono_tile_sat_los.faulty_los[1].satId); + + ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.header.chain_id == 6, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_tile_sat_los.header.chain_id, " + "expected 6, is %d", + last_msg.msg.ssr_flag_iono_tile_sat_los.header.chain_id); + + ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.header.num_msgs == 1, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_tile_sat_los.header.num_msgs, " + "expected 1, is %d", + last_msg.msg.ssr_flag_iono_tile_sat_los.header.num_msgs); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_tile_sat_los.header.obs_time.tow == 180, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_tile_sat_los.header.obs_time.tow, expected " + "180, is %d", + last_msg.msg.ssr_flag_iono_tile_sat_los.header.obs_time.tow); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_tile_sat_los.header.obs_time.wn == 3, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_tile_sat_los.header.obs_time.wn, expected " + "3, is %d", + last_msg.msg.ssr_flag_iono_tile_sat_los.header.obs_time.wn); + + ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.header.seq_num == 2, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_tile_sat_los.header.seq_num, " + "expected 2, is %d", + last_msg.msg.ssr_flag_iono_tile_sat_los.header.seq_num); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_tile_sat_los.header.ssr_sol_id == 3, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_tile_sat_los.header.ssr_sol_id, expected " + "3, is %d", + last_msg.msg.ssr_flag_iono_tile_sat_los.header.ssr_sol_id); + + ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.header.tile_id == 5, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_tile_sat_los.header.tile_id, " + "expected 5, is %d", + last_msg.msg.ssr_flag_iono_tile_sat_los.header.tile_id); + + ck_assert_msg( + last_msg.msg.ssr_flag_iono_tile_sat_los.header.tile_set_id == 4, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_tile_sat_los.header.tile_set_id, expected " + "4, is %d", + last_msg.msg.ssr_flag_iono_tile_sat_los.header.tile_set_id); + ck_assert_msg(last_msg.msg.ssr_flag_iono_tile_sat_los.n_faulty_los == 2, + "incorrect value for " + "last_msg.msg.ssr_flag_iono_tile_sat_los.n_faulty_los, " + "expected 2, is %d", + last_msg.msg.ssr_flag_iono_tile_sat_los.n_faulty_los); } } END_TEST -Suite* auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos"); - tcase_add_test(tc_acq, test_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos); +Suite *auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos"); + tcase_add_test(tc_acq, + test_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/auto_check_sbp_integrity_MsgSsrFlagSatellites.c b/c/test/auto_check_sbp_integrity_MsgSsrFlagSatellites.c index 91fff8c8c..95b690f3e 100644 --- a/c/test/auto_check_sbp_integrity_MsgSsrFlagSatellites.c +++ b/c/test/auto_check_sbp_integrity_MsgSsrFlagSatellites.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagSatellites.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagSatellites.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagSatellites ) -{ +START_TEST(test_auto_check_sbp_integrity_MsgSsrFlagSatellites) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagSatellites ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,88 +90,137 @@ START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagSatellites ) logging_reset(); - sbp_callback_register(&sbp_state, 3005, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 3005, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,189,11,66,0,15,180,0,0,0,3,0,1,2,3,4,5,3,10,11,12,110,165, }; + u8 encoded_frame[] = { + 85, 189, 11, 66, 0, 15, 180, 0, 0, 0, 3, 0, + 1, 2, 3, 4, 5, 3, 10, 11, 12, 110, 165, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ssr_flag_satellites.chain_id = 4; - + test_msg.ssr_flag_satellites.const_id = 5; - - + test_msg.ssr_flag_satellites.faulty_sats[0] = 10; - + test_msg.ssr_flag_satellites.faulty_sats[1] = 11; - + test_msg.ssr_flag_satellites.faulty_sats[2] = 12; - + test_msg.ssr_flag_satellites.n_faulty_sats = 3; - + test_msg.ssr_flag_satellites.num_msgs = 1; - - + test_msg.ssr_flag_satellites.obs_time.tow = 180; - + test_msg.ssr_flag_satellites.obs_time.wn = 3; - + test_msg.ssr_flag_satellites.seq_num = 2; - + test_msg.ssr_flag_satellites.ssr_sol_id = 3; - sbp_message_send(&sbp_state, SbpMsgSsrFlagSatellites, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrFlagSatellites, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSsrFlagSatellites, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSsrFlagSatellites, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ssr_flag_satellites.chain_id == 4, "incorrect value for last_msg.msg.ssr_flag_satellites.chain_id, expected 4, is %d", last_msg.msg.ssr_flag_satellites.chain_id); - - ck_assert_msg(last_msg.msg.ssr_flag_satellites.const_id == 5, "incorrect value for last_msg.msg.ssr_flag_satellites.const_id, expected 5, is %d", last_msg.msg.ssr_flag_satellites.const_id); - - ck_assert_msg(last_msg.msg.ssr_flag_satellites.faulty_sats[0] == 10, "incorrect value for last_msg.msg.ssr_flag_satellites.faulty_sats[0], expected 10, is %d", last_msg.msg.ssr_flag_satellites.faulty_sats[0]); - ck_assert_msg(last_msg.msg.ssr_flag_satellites.faulty_sats[1] == 11, "incorrect value for last_msg.msg.ssr_flag_satellites.faulty_sats[1], expected 11, is %d", last_msg.msg.ssr_flag_satellites.faulty_sats[1]); - ck_assert_msg(last_msg.msg.ssr_flag_satellites.faulty_sats[2] == 12, "incorrect value for last_msg.msg.ssr_flag_satellites.faulty_sats[2], expected 12, is %d", last_msg.msg.ssr_flag_satellites.faulty_sats[2]); - - ck_assert_msg(last_msg.msg.ssr_flag_satellites.n_faulty_sats == 3, "incorrect value for last_msg.msg.ssr_flag_satellites.n_faulty_sats, expected 3, is %d", last_msg.msg.ssr_flag_satellites.n_faulty_sats); - - ck_assert_msg(last_msg.msg.ssr_flag_satellites.num_msgs == 1, "incorrect value for last_msg.msg.ssr_flag_satellites.num_msgs, expected 1, is %d", last_msg.msg.ssr_flag_satellites.num_msgs); - - - ck_assert_msg(last_msg.msg.ssr_flag_satellites.obs_time.tow == 180, "incorrect value for last_msg.msg.ssr_flag_satellites.obs_time.tow, expected 180, is %d", last_msg.msg.ssr_flag_satellites.obs_time.tow); - - ck_assert_msg(last_msg.msg.ssr_flag_satellites.obs_time.wn == 3, "incorrect value for last_msg.msg.ssr_flag_satellites.obs_time.wn, expected 3, is %d", last_msg.msg.ssr_flag_satellites.obs_time.wn); - - ck_assert_msg(last_msg.msg.ssr_flag_satellites.seq_num == 2, "incorrect value for last_msg.msg.ssr_flag_satellites.seq_num, expected 2, is %d", last_msg.msg.ssr_flag_satellites.seq_num); - - ck_assert_msg(last_msg.msg.ssr_flag_satellites.ssr_sol_id == 3, "incorrect value for last_msg.msg.ssr_flag_satellites.ssr_sol_id, expected 3, is %d", last_msg.msg.ssr_flag_satellites.ssr_sol_id); + ck_assert_msg( + last_msg.msg.ssr_flag_satellites.chain_id == 4, + "incorrect value for last_msg.msg.ssr_flag_satellites.chain_id, " + "expected 4, is %d", + last_msg.msg.ssr_flag_satellites.chain_id); + + ck_assert_msg( + last_msg.msg.ssr_flag_satellites.const_id == 5, + "incorrect value for last_msg.msg.ssr_flag_satellites.const_id, " + "expected 5, is %d", + last_msg.msg.ssr_flag_satellites.const_id); + + ck_assert_msg( + last_msg.msg.ssr_flag_satellites.faulty_sats[0] == 10, + "incorrect value for last_msg.msg.ssr_flag_satellites.faulty_sats[0], " + "expected 10, is %d", + last_msg.msg.ssr_flag_satellites.faulty_sats[0]); + ck_assert_msg( + last_msg.msg.ssr_flag_satellites.faulty_sats[1] == 11, + "incorrect value for last_msg.msg.ssr_flag_satellites.faulty_sats[1], " + "expected 11, is %d", + last_msg.msg.ssr_flag_satellites.faulty_sats[1]); + ck_assert_msg( + last_msg.msg.ssr_flag_satellites.faulty_sats[2] == 12, + "incorrect value for last_msg.msg.ssr_flag_satellites.faulty_sats[2], " + "expected 12, is %d", + last_msg.msg.ssr_flag_satellites.faulty_sats[2]); + + ck_assert_msg( + last_msg.msg.ssr_flag_satellites.n_faulty_sats == 3, + "incorrect value for last_msg.msg.ssr_flag_satellites.n_faulty_sats, " + "expected 3, is %d", + last_msg.msg.ssr_flag_satellites.n_faulty_sats); + + ck_assert_msg( + last_msg.msg.ssr_flag_satellites.num_msgs == 1, + "incorrect value for last_msg.msg.ssr_flag_satellites.num_msgs, " + "expected 1, is %d", + last_msg.msg.ssr_flag_satellites.num_msgs); + + ck_assert_msg( + last_msg.msg.ssr_flag_satellites.obs_time.tow == 180, + "incorrect value for last_msg.msg.ssr_flag_satellites.obs_time.tow, " + "expected 180, is %d", + last_msg.msg.ssr_flag_satellites.obs_time.tow); + + ck_assert_msg( + last_msg.msg.ssr_flag_satellites.obs_time.wn == 3, + "incorrect value for last_msg.msg.ssr_flag_satellites.obs_time.wn, " + "expected 3, is %d", + last_msg.msg.ssr_flag_satellites.obs_time.wn); + + ck_assert_msg(last_msg.msg.ssr_flag_satellites.seq_num == 2, + "incorrect value for " + "last_msg.msg.ssr_flag_satellites.seq_num, expected 2, is %d", + last_msg.msg.ssr_flag_satellites.seq_num); + + ck_assert_msg( + last_msg.msg.ssr_flag_satellites.ssr_sol_id == 3, + "incorrect value for last_msg.msg.ssr_flag_satellites.ssr_sol_id, " + "expected 3, is %d", + last_msg.msg.ssr_flag_satellites.ssr_sol_id); } } END_TEST -Suite* auto_check_sbp_integrity_MsgSsrFlagSatellites_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_integrity_MsgSsrFlagSatellites"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_integrity_MsgSsrFlagSatellites"); +Suite *auto_check_sbp_integrity_MsgSsrFlagSatellites_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_integrity_MsgSsrFlagSatellites"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_integrity_MsgSsrFlagSatellites"); tcase_add_test(tc_acq, test_auto_check_sbp_integrity_MsgSsrFlagSatellites); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.c b/c/test/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.c index b1829d4bd..cd0b4b9ff 100644 --- a/c/test/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.c +++ b/c/test/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagTropoGridPoints.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagTropoGridPoints.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints ) -{ +START_TEST(test_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,95 +90,155 @@ START_TEST( test_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints ) logging_reset(); - sbp_callback_register(&sbp_state, 3011, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 3011, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,195,11,66,0,21,180,0,0,0,3,0,1,2,3,4,0,5,0,6,3,10,0,11,0,12,0,243,150, }; + u8 encoded_frame[] = { + 85, 195, 11, 66, 0, 21, 180, 0, 0, 0, 3, 0, 1, 2, 3, + 4, 0, 5, 0, 6, 3, 10, 0, 11, 0, 12, 0, 243, 150, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ssr_flag_tropo_grid_points.faulty_points[0] = 10; - + test_msg.ssr_flag_tropo_grid_points.faulty_points[1] = 11; - + test_msg.ssr_flag_tropo_grid_points.faulty_points[2] = 12; - - + test_msg.ssr_flag_tropo_grid_points.header.chain_id = 6; - + test_msg.ssr_flag_tropo_grid_points.header.num_msgs = 1; - - + test_msg.ssr_flag_tropo_grid_points.header.obs_time.tow = 180; - + test_msg.ssr_flag_tropo_grid_points.header.obs_time.wn = 3; - + test_msg.ssr_flag_tropo_grid_points.header.seq_num = 2; - + test_msg.ssr_flag_tropo_grid_points.header.ssr_sol_id = 3; - + test_msg.ssr_flag_tropo_grid_points.header.tile_id = 5; - + test_msg.ssr_flag_tropo_grid_points.header.tile_set_id = 4; - + test_msg.ssr_flag_tropo_grid_points.n_faulty_points = 3; - sbp_message_send(&sbp_state, SbpMsgSsrFlagTropoGridPoints, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrFlagTropoGridPoints, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrFlagTropoGridPoints, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[0] == 10, "incorrect value for last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[0], expected 10, is %d", last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[0]); - ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[1] == 11, "incorrect value for last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[1], expected 11, is %d", last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[1]); - ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[2] == 12, "incorrect value for last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[2], expected 12, is %d", last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[2]); - - - ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.header.chain_id == 6, "incorrect value for last_msg.msg.ssr_flag_tropo_grid_points.header.chain_id, expected 6, is %d", last_msg.msg.ssr_flag_tropo_grid_points.header.chain_id); - - ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.header.num_msgs == 1, "incorrect value for last_msg.msg.ssr_flag_tropo_grid_points.header.num_msgs, expected 1, is %d", last_msg.msg.ssr_flag_tropo_grid_points.header.num_msgs); - - - ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.header.obs_time.tow == 180, "incorrect value for last_msg.msg.ssr_flag_tropo_grid_points.header.obs_time.tow, expected 180, is %d", last_msg.msg.ssr_flag_tropo_grid_points.header.obs_time.tow); - - ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.header.obs_time.wn == 3, "incorrect value for last_msg.msg.ssr_flag_tropo_grid_points.header.obs_time.wn, expected 3, is %d", last_msg.msg.ssr_flag_tropo_grid_points.header.obs_time.wn); - - ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.header.seq_num == 2, "incorrect value for last_msg.msg.ssr_flag_tropo_grid_points.header.seq_num, expected 2, is %d", last_msg.msg.ssr_flag_tropo_grid_points.header.seq_num); - - ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.header.ssr_sol_id == 3, "incorrect value for last_msg.msg.ssr_flag_tropo_grid_points.header.ssr_sol_id, expected 3, is %d", last_msg.msg.ssr_flag_tropo_grid_points.header.ssr_sol_id); - - ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.header.tile_id == 5, "incorrect value for last_msg.msg.ssr_flag_tropo_grid_points.header.tile_id, expected 5, is %d", last_msg.msg.ssr_flag_tropo_grid_points.header.tile_id); - - ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.header.tile_set_id == 4, "incorrect value for last_msg.msg.ssr_flag_tropo_grid_points.header.tile_set_id, expected 4, is %d", last_msg.msg.ssr_flag_tropo_grid_points.header.tile_set_id); - - ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.n_faulty_points == 3, "incorrect value for last_msg.msg.ssr_flag_tropo_grid_points.n_faulty_points, expected 3, is %d", last_msg.msg.ssr_flag_tropo_grid_points.n_faulty_points); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrFlagTropoGridPoints, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[0] == 10, + "incorrect value for " + "last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[0], expected " + "10, is %d", + last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[0]); + ck_assert_msg( + last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[1] == 11, + "incorrect value for " + "last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[1], expected " + "11, is %d", + last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[1]); + ck_assert_msg( + last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[2] == 12, + "incorrect value for " + "last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[2], expected " + "12, is %d", + last_msg.msg.ssr_flag_tropo_grid_points.faulty_points[2]); + + ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.header.chain_id == 6, + "incorrect value for " + "last_msg.msg.ssr_flag_tropo_grid_points.header.chain_id, " + "expected 6, is %d", + last_msg.msg.ssr_flag_tropo_grid_points.header.chain_id); + + ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.header.num_msgs == 1, + "incorrect value for " + "last_msg.msg.ssr_flag_tropo_grid_points.header.num_msgs, " + "expected 1, is %d", + last_msg.msg.ssr_flag_tropo_grid_points.header.num_msgs); + + ck_assert_msg( + last_msg.msg.ssr_flag_tropo_grid_points.header.obs_time.tow == 180, + "incorrect value for " + "last_msg.msg.ssr_flag_tropo_grid_points.header.obs_time.tow, expected " + "180, is %d", + last_msg.msg.ssr_flag_tropo_grid_points.header.obs_time.tow); + + ck_assert_msg( + last_msg.msg.ssr_flag_tropo_grid_points.header.obs_time.wn == 3, + "incorrect value for " + "last_msg.msg.ssr_flag_tropo_grid_points.header.obs_time.wn, expected " + "3, is %d", + last_msg.msg.ssr_flag_tropo_grid_points.header.obs_time.wn); + + ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.header.seq_num == 2, + "incorrect value for " + "last_msg.msg.ssr_flag_tropo_grid_points.header.seq_num, " + "expected 2, is %d", + last_msg.msg.ssr_flag_tropo_grid_points.header.seq_num); + + ck_assert_msg( + last_msg.msg.ssr_flag_tropo_grid_points.header.ssr_sol_id == 3, + "incorrect value for " + "last_msg.msg.ssr_flag_tropo_grid_points.header.ssr_sol_id, expected " + "3, is %d", + last_msg.msg.ssr_flag_tropo_grid_points.header.ssr_sol_id); + + ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.header.tile_id == 5, + "incorrect value for " + "last_msg.msg.ssr_flag_tropo_grid_points.header.tile_id, " + "expected 5, is %d", + last_msg.msg.ssr_flag_tropo_grid_points.header.tile_id); + + ck_assert_msg( + last_msg.msg.ssr_flag_tropo_grid_points.header.tile_set_id == 4, + "incorrect value for " + "last_msg.msg.ssr_flag_tropo_grid_points.header.tile_set_id, expected " + "4, is %d", + last_msg.msg.ssr_flag_tropo_grid_points.header.tile_set_id); + + ck_assert_msg(last_msg.msg.ssr_flag_tropo_grid_points.n_faulty_points == 3, + "incorrect value for " + "last_msg.msg.ssr_flag_tropo_grid_points.n_faulty_points, " + "expected 3, is %d", + last_msg.msg.ssr_flag_tropo_grid_points.n_faulty_points); } } END_TEST -Suite* auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints"); - tcase_add_test(tc_acq, test_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints); +Suite *auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints"); + tcase_add_test(tc_acq, + test_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/auto_check_sbp_linux_MsgLinuxCpuState.c b/c/test/auto_check_sbp_linux_MsgLinuxCpuState.c index 3c86f2473..8af416f41 100644 --- a/c/test/auto_check_sbp_linux_MsgLinuxCpuState.c +++ b/c/test/auto_check_sbp_linux_MsgLinuxCpuState.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuState.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_linux_MsgLinuxCpuState ) -{ +START_TEST(test_auto_check_sbp_linux_MsgLinuxCpuState) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxCpuState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,83 +90,132 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxCpuState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x7f08, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x7f08, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,8,127,148,133,70,101,122,195,98,215,35,94,235,20,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,68,229, }; + u8 encoded_frame[] = { + 85, 8, 127, 148, 133, 70, 101, 122, 195, 98, 215, 35, 94, + 235, 20, 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, + 101, 0, 0, 0, 47, 112, 97, 116, 104, 47, 116, 111, 47, + 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, + 97, 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, + 50, 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 68, 229, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_linux_cpu_state_cmdline_set(&test_msg.linux_cpu_state, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_linux_cpu_state_cmdline_encoded_len(&test_msg.linux_cpu_state) == 46, "String not encoded properly"); - + ck_assert_msg( + sbp_msg_linux_cpu_state_cmdline_set( + &test_msg.linux_cpu_state, + "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written), + "Can't assign text"); + ck_assert_msg( + written == strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_linux_cpu_state_cmdline_encoded_len( + &test_msg.linux_cpu_state) == 46, + "String not encoded properly"); + test_msg.linux_cpu_state.flags = 20; - + test_msg.linux_cpu_state.index = 101; - + test_msg.linux_cpu_state.pcpu = 98; - + test_msg.linux_cpu_state.pid = 50042; - + test_msg.linux_cpu_state.time = 3948815319; - + { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - memcpy(test_msg.linux_cpu_state.tname, assign_string, sizeof(assign_string)); + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + memcpy(test_msg.linux_cpu_state.tname, assign_string, + sizeof(assign_string)); } - sbp_message_send(&sbp_state, SbpMsgLinuxCpuState, 34196, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgLinuxCpuState, 34196, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 34196, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgLinuxCpuState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgLinuxCpuState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_linux_cpu_state_cmdline_encoded_len(&last_msg.msg.linux_cpu_state) == 46, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_linux_cpu_state_cmdline_get(&last_msg.msg.linux_cpu_state), "/path/to/process-name arg0 arg1 arg2 arg3 arg4") == 0, "String not decoded properly"); - - ck_assert_msg(last_msg.msg.linux_cpu_state.flags == 20, "incorrect value for last_msg.msg.linux_cpu_state.flags, expected 20, is %d", last_msg.msg.linux_cpu_state.flags); - - ck_assert_msg(last_msg.msg.linux_cpu_state.index == 101, "incorrect value for last_msg.msg.linux_cpu_state.index, expected 101, is %d", last_msg.msg.linux_cpu_state.index); - - ck_assert_msg(last_msg.msg.linux_cpu_state.pcpu == 98, "incorrect value for last_msg.msg.linux_cpu_state.pcpu, expected 98, is %d", last_msg.msg.linux_cpu_state.pcpu); - - ck_assert_msg(last_msg.msg.linux_cpu_state.pid == 50042, "incorrect value for last_msg.msg.linux_cpu_state.pid, expected 50042, is %d", last_msg.msg.linux_cpu_state.pid); - - ck_assert_msg(last_msg.msg.linux_cpu_state.time == 3948815319, "incorrect value for last_msg.msg.linux_cpu_state.time, expected 3948815319, is %d", last_msg.msg.linux_cpu_state.time); - + + ck_assert_msg(sbp_msg_linux_cpu_state_cmdline_encoded_len( + &last_msg.msg.linux_cpu_state) == 46, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_linux_cpu_state_cmdline_get( + &last_msg.msg.linux_cpu_state), + "/path/to/process-name arg0 arg1 arg2 arg3 arg4") == 0, + "String not decoded properly"); + + ck_assert_msg(last_msg.msg.linux_cpu_state.flags == 20, + "incorrect value for last_msg.msg.linux_cpu_state.flags, " + "expected 20, is %d", + last_msg.msg.linux_cpu_state.flags); + + ck_assert_msg(last_msg.msg.linux_cpu_state.index == 101, + "incorrect value for last_msg.msg.linux_cpu_state.index, " + "expected 101, is %d", + last_msg.msg.linux_cpu_state.index); + + ck_assert_msg(last_msg.msg.linux_cpu_state.pcpu == 98, + "incorrect value for last_msg.msg.linux_cpu_state.pcpu, " + "expected 98, is %d", + last_msg.msg.linux_cpu_state.pcpu); + + ck_assert_msg(last_msg.msg.linux_cpu_state.pid == 50042, + "incorrect value for last_msg.msg.linux_cpu_state.pid, " + "expected 50042, is %d", + last_msg.msg.linux_cpu_state.pid); + + ck_assert_msg(last_msg.msg.linux_cpu_state.time == 3948815319, + "incorrect value for last_msg.msg.linux_cpu_state.time, " + "expected 3948815319, is %d", + last_msg.msg.linux_cpu_state.time); + { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.linux_cpu_state.tname, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.linux_cpu_state.tname, expected string '%s', is '%s'", check_string, last_msg.msg.linux_cpu_state.tname); + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + ck_assert_msg(memcmp(&last_msg.msg.linux_cpu_state.tname, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.linux_cpu_state.tname, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.linux_cpu_state.tname); } - } } END_TEST -Suite* auto_check_sbp_linux_MsgLinuxCpuState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_linux_MsgLinuxCpuState"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxCpuState"); +Suite *auto_check_sbp_linux_MsgLinuxCpuState_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_linux_MsgLinuxCpuState"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxCpuState"); tcase_add_test(tc_acq, test_auto_check_sbp_linux_MsgLinuxCpuState); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_linux_MsgLinuxCpuStateDepA.c b/c/test/auto_check_sbp_linux_MsgLinuxCpuStateDepA.c index d45fda204..1daa29105 100644 --- a/c/test/auto_check_sbp_linux_MsgLinuxCpuStateDepA.c +++ b/c/test/auto_check_sbp_linux_MsgLinuxCpuStateDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuStateDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_linux_MsgLinuxCpuStateDepA ) -{ +START_TEST(test_auto_check_sbp_linux_MsgLinuxCpuStateDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxCpuStateDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,75 +90,121 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxCpuStateDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x7f00, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x7f00, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,127,12,91,65,51,240,250,178,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,80,48, }; + u8 encoded_frame[] = { + 85, 0, 127, 12, 91, 65, 51, 240, 250, 178, 112, 114, 111, + 99, 101, 115, 115, 45, 110, 97, 109, 101, 0, 0, 0, 47, + 112, 97, 116, 104, 47, 116, 111, 47, 112, 114, 111, 99, 101, + 115, 115, 45, 110, 97, 109, 101, 32, 97, 114, 103, 48, 32, + 97, 114, 103, 49, 32, 97, 114, 103, 50, 32, 97, 114, 103, + 51, 32, 97, 114, 103, 52, 80, 48, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_linux_cpu_state_dep_a_cmdline_set(&test_msg.linux_cpu_state_dep_a, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_linux_cpu_state_dep_a_cmdline_encoded_len(&test_msg.linux_cpu_state_dep_a) == 46, "String not encoded properly"); - + ck_assert_msg( + sbp_msg_linux_cpu_state_dep_a_cmdline_set( + &test_msg.linux_cpu_state_dep_a, + "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written), + "Can't assign text"); + ck_assert_msg( + written == strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_linux_cpu_state_dep_a_cmdline_encoded_len( + &test_msg.linux_cpu_state_dep_a) == 46, + "String not encoded properly"); + test_msg.linux_cpu_state_dep_a.index = 51; - + test_msg.linux_cpu_state_dep_a.pcpu = 178; - + test_msg.linux_cpu_state_dep_a.pid = 64240; - + { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - memcpy(test_msg.linux_cpu_state_dep_a.tname, assign_string, sizeof(assign_string)); + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + memcpy(test_msg.linux_cpu_state_dep_a.tname, assign_string, + sizeof(assign_string)); } - sbp_message_send(&sbp_state, SbpMsgLinuxCpuStateDepA, 23308, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgLinuxCpuStateDepA, 23308, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 23308, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgLinuxCpuStateDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgLinuxCpuStateDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_linux_cpu_state_dep_a_cmdline_encoded_len(&last_msg.msg.linux_cpu_state_dep_a) == 46, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_linux_cpu_state_dep_a_cmdline_get(&last_msg.msg.linux_cpu_state_dep_a), "/path/to/process-name arg0 arg1 arg2 arg3 arg4") == 0, "String not decoded properly"); - - ck_assert_msg(last_msg.msg.linux_cpu_state_dep_a.index == 51, "incorrect value for last_msg.msg.linux_cpu_state_dep_a.index, expected 51, is %d", last_msg.msg.linux_cpu_state_dep_a.index); - - ck_assert_msg(last_msg.msg.linux_cpu_state_dep_a.pcpu == 178, "incorrect value for last_msg.msg.linux_cpu_state_dep_a.pcpu, expected 178, is %d", last_msg.msg.linux_cpu_state_dep_a.pcpu); - - ck_assert_msg(last_msg.msg.linux_cpu_state_dep_a.pid == 64240, "incorrect value for last_msg.msg.linux_cpu_state_dep_a.pid, expected 64240, is %d", last_msg.msg.linux_cpu_state_dep_a.pid); - + + ck_assert_msg(sbp_msg_linux_cpu_state_dep_a_cmdline_encoded_len( + &last_msg.msg.linux_cpu_state_dep_a) == 46, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_linux_cpu_state_dep_a_cmdline_get( + &last_msg.msg.linux_cpu_state_dep_a), + "/path/to/process-name arg0 arg1 arg2 arg3 arg4") == 0, + "String not decoded properly"); + + ck_assert_msg( + last_msg.msg.linux_cpu_state_dep_a.index == 51, + "incorrect value for last_msg.msg.linux_cpu_state_dep_a.index, " + "expected 51, is %d", + last_msg.msg.linux_cpu_state_dep_a.index); + + ck_assert_msg( + last_msg.msg.linux_cpu_state_dep_a.pcpu == 178, + "incorrect value for last_msg.msg.linux_cpu_state_dep_a.pcpu, expected " + "178, is %d", + last_msg.msg.linux_cpu_state_dep_a.pcpu); + + ck_assert_msg(last_msg.msg.linux_cpu_state_dep_a.pid == 64240, + "incorrect value for last_msg.msg.linux_cpu_state_dep_a.pid, " + "expected 64240, is %d", + last_msg.msg.linux_cpu_state_dep_a.pid); + { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.linux_cpu_state_dep_a.tname, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.linux_cpu_state_dep_a.tname, expected string '%s', is '%s'", check_string, last_msg.msg.linux_cpu_state_dep_a.tname); + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(&last_msg.msg.linux_cpu_state_dep_a.tname, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.linux_cpu_state_dep_a.tname, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.linux_cpu_state_dep_a.tname); } - } } END_TEST -Suite* auto_check_sbp_linux_MsgLinuxCpuStateDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_linux_MsgLinuxCpuStateDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxCpuStateDepA"); +Suite *auto_check_sbp_linux_MsgLinuxCpuStateDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_linux_MsgLinuxCpuStateDepA"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxCpuStateDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_linux_MsgLinuxCpuStateDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_linux_MsgLinuxMemState.c b/c/test/auto_check_sbp_linux_MsgLinuxMemState.c index 91f4b9397..4c960ae63 100644 --- a/c/test/auto_check_sbp_linux_MsgLinuxMemState.c +++ b/c/test/auto_check_sbp_linux_MsgLinuxMemState.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemState.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_linux_MsgLinuxMemState ) -{ +START_TEST(test_auto_check_sbp_linux_MsgLinuxMemState) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxMemState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,83 +90,132 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxMemState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x7f09, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x7f09, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,9,127,95,253,70,154,191,223,19,247,53,26,187,76,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,3,181, }; + u8 encoded_frame[] = { + 85, 9, 127, 95, 253, 70, 154, 191, 223, 19, 247, 53, 26, + 187, 76, 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, + 101, 0, 0, 0, 47, 112, 97, 116, 104, 47, 116, 111, 47, + 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, + 97, 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, + 50, 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 3, 181, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_linux_mem_state_cmdline_set(&test_msg.linux_mem_state, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_linux_mem_state_cmdline_encoded_len(&test_msg.linux_mem_state) == 46, "String not encoded properly"); - + ck_assert_msg( + sbp_msg_linux_mem_state_cmdline_set( + &test_msg.linux_mem_state, + "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written), + "Can't assign text"); + ck_assert_msg( + written == strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_linux_mem_state_cmdline_encoded_len( + &test_msg.linux_mem_state) == 46, + "String not encoded properly"); + test_msg.linux_mem_state.flags = 76; - + test_msg.linux_mem_state.index = 154; - + test_msg.linux_mem_state.pid = 57279; - + test_msg.linux_mem_state.pmem = 19; - + test_msg.linux_mem_state.time = 3139057143; - + { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - memcpy(test_msg.linux_mem_state.tname, assign_string, sizeof(assign_string)); + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + memcpy(test_msg.linux_mem_state.tname, assign_string, + sizeof(assign_string)); } - sbp_message_send(&sbp_state, SbpMsgLinuxMemState, 64863, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgLinuxMemState, 64863, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 64863, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgLinuxMemState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgLinuxMemState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_linux_mem_state_cmdline_encoded_len(&last_msg.msg.linux_mem_state) == 46, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_linux_mem_state_cmdline_get(&last_msg.msg.linux_mem_state), "/path/to/process-name arg0 arg1 arg2 arg3 arg4") == 0, "String not decoded properly"); - - ck_assert_msg(last_msg.msg.linux_mem_state.flags == 76, "incorrect value for last_msg.msg.linux_mem_state.flags, expected 76, is %d", last_msg.msg.linux_mem_state.flags); - - ck_assert_msg(last_msg.msg.linux_mem_state.index == 154, "incorrect value for last_msg.msg.linux_mem_state.index, expected 154, is %d", last_msg.msg.linux_mem_state.index); - - ck_assert_msg(last_msg.msg.linux_mem_state.pid == 57279, "incorrect value for last_msg.msg.linux_mem_state.pid, expected 57279, is %d", last_msg.msg.linux_mem_state.pid); - - ck_assert_msg(last_msg.msg.linux_mem_state.pmem == 19, "incorrect value for last_msg.msg.linux_mem_state.pmem, expected 19, is %d", last_msg.msg.linux_mem_state.pmem); - - ck_assert_msg(last_msg.msg.linux_mem_state.time == 3139057143, "incorrect value for last_msg.msg.linux_mem_state.time, expected 3139057143, is %d", last_msg.msg.linux_mem_state.time); - + + ck_assert_msg(sbp_msg_linux_mem_state_cmdline_encoded_len( + &last_msg.msg.linux_mem_state) == 46, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_linux_mem_state_cmdline_get( + &last_msg.msg.linux_mem_state), + "/path/to/process-name arg0 arg1 arg2 arg3 arg4") == 0, + "String not decoded properly"); + + ck_assert_msg(last_msg.msg.linux_mem_state.flags == 76, + "incorrect value for last_msg.msg.linux_mem_state.flags, " + "expected 76, is %d", + last_msg.msg.linux_mem_state.flags); + + ck_assert_msg(last_msg.msg.linux_mem_state.index == 154, + "incorrect value for last_msg.msg.linux_mem_state.index, " + "expected 154, is %d", + last_msg.msg.linux_mem_state.index); + + ck_assert_msg(last_msg.msg.linux_mem_state.pid == 57279, + "incorrect value for last_msg.msg.linux_mem_state.pid, " + "expected 57279, is %d", + last_msg.msg.linux_mem_state.pid); + + ck_assert_msg(last_msg.msg.linux_mem_state.pmem == 19, + "incorrect value for last_msg.msg.linux_mem_state.pmem, " + "expected 19, is %d", + last_msg.msg.linux_mem_state.pmem); + + ck_assert_msg(last_msg.msg.linux_mem_state.time == 3139057143, + "incorrect value for last_msg.msg.linux_mem_state.time, " + "expected 3139057143, is %d", + last_msg.msg.linux_mem_state.time); + { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.linux_mem_state.tname, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.linux_mem_state.tname, expected string '%s', is '%s'", check_string, last_msg.msg.linux_mem_state.tname); + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + ck_assert_msg(memcmp(&last_msg.msg.linux_mem_state.tname, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.linux_mem_state.tname, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.linux_mem_state.tname); } - } } END_TEST -Suite* auto_check_sbp_linux_MsgLinuxMemState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_linux_MsgLinuxMemState"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxMemState"); +Suite *auto_check_sbp_linux_MsgLinuxMemState_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_linux_MsgLinuxMemState"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxMemState"); tcase_add_test(tc_acq, test_auto_check_sbp_linux_MsgLinuxMemState); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_linux_MsgLinuxMemStateDepA.c b/c/test/auto_check_sbp_linux_MsgLinuxMemStateDepA.c index 403060ae1..02a487ef3 100644 --- a/c/test/auto_check_sbp_linux_MsgLinuxMemStateDepA.c +++ b/c/test/auto_check_sbp_linux_MsgLinuxMemStateDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemStateDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_linux_MsgLinuxMemStateDepA ) -{ +START_TEST(test_auto_check_sbp_linux_MsgLinuxMemStateDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxMemStateDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,75 +90,121 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxMemStateDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x7f01, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x7f01, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,127,185,109,65,247,93,48,193,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,17,137, }; + u8 encoded_frame[] = { + 85, 1, 127, 185, 109, 65, 247, 93, 48, 193, 112, 114, 111, + 99, 101, 115, 115, 45, 110, 97, 109, 101, 0, 0, 0, 47, + 112, 97, 116, 104, 47, 116, 111, 47, 112, 114, 111, 99, 101, + 115, 115, 45, 110, 97, 109, 101, 32, 97, 114, 103, 48, 32, + 97, 114, 103, 49, 32, 97, 114, 103, 50, 32, 97, 114, 103, + 51, 32, 97, 114, 103, 52, 17, 137, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_linux_mem_state_dep_a_cmdline_set(&test_msg.linux_mem_state_dep_a, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_linux_mem_state_dep_a_cmdline_encoded_len(&test_msg.linux_mem_state_dep_a) == 46, "String not encoded properly"); - + ck_assert_msg( + sbp_msg_linux_mem_state_dep_a_cmdline_set( + &test_msg.linux_mem_state_dep_a, + "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written), + "Can't assign text"); + ck_assert_msg( + written == strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_linux_mem_state_dep_a_cmdline_encoded_len( + &test_msg.linux_mem_state_dep_a) == 46, + "String not encoded properly"); + test_msg.linux_mem_state_dep_a.index = 247; - + test_msg.linux_mem_state_dep_a.pid = 12381; - + test_msg.linux_mem_state_dep_a.pmem = 193; - + { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - memcpy(test_msg.linux_mem_state_dep_a.tname, assign_string, sizeof(assign_string)); + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + memcpy(test_msg.linux_mem_state_dep_a.tname, assign_string, + sizeof(assign_string)); } - sbp_message_send(&sbp_state, SbpMsgLinuxMemStateDepA, 28089, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgLinuxMemStateDepA, 28089, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 28089, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgLinuxMemStateDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgLinuxMemStateDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_linux_mem_state_dep_a_cmdline_encoded_len(&last_msg.msg.linux_mem_state_dep_a) == 46, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_linux_mem_state_dep_a_cmdline_get(&last_msg.msg.linux_mem_state_dep_a), "/path/to/process-name arg0 arg1 arg2 arg3 arg4") == 0, "String not decoded properly"); - - ck_assert_msg(last_msg.msg.linux_mem_state_dep_a.index == 247, "incorrect value for last_msg.msg.linux_mem_state_dep_a.index, expected 247, is %d", last_msg.msg.linux_mem_state_dep_a.index); - - ck_assert_msg(last_msg.msg.linux_mem_state_dep_a.pid == 12381, "incorrect value for last_msg.msg.linux_mem_state_dep_a.pid, expected 12381, is %d", last_msg.msg.linux_mem_state_dep_a.pid); - - ck_assert_msg(last_msg.msg.linux_mem_state_dep_a.pmem == 193, "incorrect value for last_msg.msg.linux_mem_state_dep_a.pmem, expected 193, is %d", last_msg.msg.linux_mem_state_dep_a.pmem); - + + ck_assert_msg(sbp_msg_linux_mem_state_dep_a_cmdline_encoded_len( + &last_msg.msg.linux_mem_state_dep_a) == 46, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_linux_mem_state_dep_a_cmdline_get( + &last_msg.msg.linux_mem_state_dep_a), + "/path/to/process-name arg0 arg1 arg2 arg3 arg4") == 0, + "String not decoded properly"); + + ck_assert_msg( + last_msg.msg.linux_mem_state_dep_a.index == 247, + "incorrect value for last_msg.msg.linux_mem_state_dep_a.index, " + "expected 247, is %d", + last_msg.msg.linux_mem_state_dep_a.index); + + ck_assert_msg(last_msg.msg.linux_mem_state_dep_a.pid == 12381, + "incorrect value for last_msg.msg.linux_mem_state_dep_a.pid, " + "expected 12381, is %d", + last_msg.msg.linux_mem_state_dep_a.pid); + + ck_assert_msg( + last_msg.msg.linux_mem_state_dep_a.pmem == 193, + "incorrect value for last_msg.msg.linux_mem_state_dep_a.pmem, expected " + "193, is %d", + last_msg.msg.linux_mem_state_dep_a.pmem); + { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.linux_mem_state_dep_a.tname, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.linux_mem_state_dep_a.tname, expected string '%s', is '%s'", check_string, last_msg.msg.linux_mem_state_dep_a.tname); + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(&last_msg.msg.linux_mem_state_dep_a.tname, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.linux_mem_state_dep_a.tname, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.linux_mem_state_dep_a.tname); } - } } END_TEST -Suite* auto_check_sbp_linux_MsgLinuxMemStateDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_linux_MsgLinuxMemStateDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxMemStateDepA"); +Suite *auto_check_sbp_linux_MsgLinuxMemStateDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_linux_MsgLinuxMemStateDepA"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxMemStateDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_linux_MsgLinuxMemStateDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_linux_MsgLinuxProcessFdCount.c b/c/test/auto_check_sbp_linux_MsgLinuxProcessFdCount.c index 265959dc2..104438661 100644 --- a/c/test/auto_check_sbp_linux_MsgLinuxProcessFdCount.c +++ b/c/test/auto_check_sbp_linux_MsgLinuxProcessFdCount.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdCount.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdCount.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_linux_MsgLinuxProcessFdCount ) -{ +START_TEST(test_auto_check_sbp_linux_MsgLinuxProcessFdCount) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxProcessFdCount ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,65 +90,99 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxProcessFdCount ) logging_reset(); - sbp_callback_register(&sbp_state, 0x7f06, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x7f06, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,6,127,30,195,51,164,189,165,5,139,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,2,94, }; + u8 encoded_frame[] = { + 85, 6, 127, 30, 195, 51, 164, 189, 165, 5, 139, 47, + 112, 97, 116, 104, 47, 116, 111, 47, 112, 114, 111, 99, + 101, 115, 115, 45, 110, 97, 109, 101, 32, 97, 114, 103, + 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, 50, 32, + 97, 114, 103, 51, 32, 97, 114, 103, 52, 2, 94, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_linux_process_fd_count_cmdline_set(&test_msg.linux_process_fd_count, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_linux_process_fd_count_cmdline_encoded_len(&test_msg.linux_process_fd_count) == 46, "String not encoded properly"); - + ck_assert_msg( + sbp_msg_linux_process_fd_count_cmdline_set( + &test_msg.linux_process_fd_count, + "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written), + "Can't assign text"); + ck_assert_msg( + written == strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_linux_process_fd_count_cmdline_encoded_len( + &test_msg.linux_process_fd_count) == 46, + "String not encoded properly"); + test_msg.linux_process_fd_count.fd_count = 35589; - + test_msg.linux_process_fd_count.index = 164; - + test_msg.linux_process_fd_count.pid = 42429; - sbp_message_send(&sbp_state, SbpMsgLinuxProcessFdCount, 49950, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgLinuxProcessFdCount, 49950, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 49950, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgLinuxProcessFdCount, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_linux_process_fd_count_cmdline_encoded_len(&last_msg.msg.linux_process_fd_count) == 46, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_linux_process_fd_count_cmdline_get(&last_msg.msg.linux_process_fd_count), "/path/to/process-name arg0 arg1 arg2 arg3 arg4") == 0, "String not decoded properly"); - - ck_assert_msg(last_msg.msg.linux_process_fd_count.fd_count == 35589, "incorrect value for last_msg.msg.linux_process_fd_count.fd_count, expected 35589, is %d", last_msg.msg.linux_process_fd_count.fd_count); - - ck_assert_msg(last_msg.msg.linux_process_fd_count.index == 164, "incorrect value for last_msg.msg.linux_process_fd_count.index, expected 164, is %d", last_msg.msg.linux_process_fd_count.index); - - ck_assert_msg(last_msg.msg.linux_process_fd_count.pid == 42429, "incorrect value for last_msg.msg.linux_process_fd_count.pid, expected 42429, is %d", last_msg.msg.linux_process_fd_count.pid); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgLinuxProcessFdCount, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(sbp_msg_linux_process_fd_count_cmdline_encoded_len( + &last_msg.msg.linux_process_fd_count) == 46, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_linux_process_fd_count_cmdline_get( + &last_msg.msg.linux_process_fd_count), + "/path/to/process-name arg0 arg1 arg2 arg3 arg4") == 0, + "String not decoded properly"); + + ck_assert_msg( + last_msg.msg.linux_process_fd_count.fd_count == 35589, + "incorrect value for last_msg.msg.linux_process_fd_count.fd_count, " + "expected 35589, is %d", + last_msg.msg.linux_process_fd_count.fd_count); + + ck_assert_msg( + last_msg.msg.linux_process_fd_count.index == 164, + "incorrect value for last_msg.msg.linux_process_fd_count.index, " + "expected 164, is %d", + last_msg.msg.linux_process_fd_count.index); + + ck_assert_msg( + last_msg.msg.linux_process_fd_count.pid == 42429, + "incorrect value for last_msg.msg.linux_process_fd_count.pid, expected " + "42429, is %d", + last_msg.msg.linux_process_fd_count.pid); } } END_TEST -Suite* auto_check_sbp_linux_MsgLinuxProcessFdCount_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_linux_MsgLinuxProcessFdCount"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxProcessFdCount"); +Suite *auto_check_sbp_linux_MsgLinuxProcessFdCount_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_linux_MsgLinuxProcessFdCount"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_linux_MsgLinuxProcessFdCount"); tcase_add_test(tc_acq, test_auto_check_sbp_linux_MsgLinuxProcessFdCount); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_linux_MsgLinuxProcessFdSummary.c b/c/test/auto_check_sbp_linux_MsgLinuxProcessFdSummary.c index 33eb94429..ea962490f 100644 --- a/c/test/auto_check_sbp_linux_MsgLinuxProcessFdSummary.c +++ b/c/test/auto_check_sbp_linux_MsgLinuxProcessFdSummary.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdSummary.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdSummary.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_linux_MsgLinuxProcessFdSummary ) -{ +START_TEST(test_auto_check_sbp_linux_MsgLinuxProcessFdSummary) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxProcessFdSummary ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,65 +90,118 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxProcessFdSummary ) logging_reset(); - sbp_callback_register(&sbp_state, 0x7f07, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x7f07, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,7,127,103,248,29,19,131,200,77,102,100,49,0,102,100,50,0,102,100,51,0,102,100,52,0,102,100,53,0,102,100,54,0,0,129,80, }; + u8 encoded_frame[] = { + 85, 7, 127, 103, 248, 29, 19, 131, 200, 77, 102, 100, 49, + 0, 102, 100, 50, 0, 102, 100, 51, 0, 102, 100, 52, 0, + 102, 100, 53, 0, 102, 100, 54, 0, 0, 129, 80, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_add_section(&test_msg.linux_process_fd_summary, "fd1") == true, "Can't assign section 0"); - ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_add_section(&test_msg.linux_process_fd_summary, "fd2") == true, "Can't assign section 1"); - ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_add_section(&test_msg.linux_process_fd_summary, "fd3") == true, "Can't assign section 2"); - ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_add_section(&test_msg.linux_process_fd_summary, "fd4") == true, "Can't assign section 3"); - ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_add_section(&test_msg.linux_process_fd_summary, "fd5") == true, "Can't assign section 4"); - ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_add_section(&test_msg.linux_process_fd_summary, "fd6") == true, "Can't assign section 5"); - ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_encoded_len(&test_msg.linux_process_fd_summary) == 25, "String not encoded properly"); - + + ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_add_section( + &test_msg.linux_process_fd_summary, "fd1") == true, + "Can't assign section 0"); + ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_add_section( + &test_msg.linux_process_fd_summary, "fd2") == true, + "Can't assign section 1"); + ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_add_section( + &test_msg.linux_process_fd_summary, "fd3") == true, + "Can't assign section 2"); + ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_add_section( + &test_msg.linux_process_fd_summary, "fd4") == true, + "Can't assign section 3"); + ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_add_section( + &test_msg.linux_process_fd_summary, "fd5") == true, + "Can't assign section 4"); + ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_add_section( + &test_msg.linux_process_fd_summary, "fd6") == true, + "Can't assign section 5"); + ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_encoded_len( + &test_msg.linux_process_fd_summary) == 25, + "String not encoded properly"); + test_msg.linux_process_fd_summary.sys_fd_count = 1304986387; - sbp_message_send(&sbp_state, SbpMsgLinuxProcessFdSummary, 63591, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgLinuxProcessFdSummary, 63591, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 63591, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgLinuxProcessFdSummary, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_encoded_len(&last_msg.msg.linux_process_fd_summary) == 25, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg.msg.linux_process_fd_summary, 0), "fd1") == 0, "Section 0 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg.msg.linux_process_fd_summary, 1), "fd2") == 0, "Section 1 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg.msg.linux_process_fd_summary, 2), "fd3") == 0, "Section 2 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg.msg.linux_process_fd_summary, 3), "fd4") == 0, "Section 3 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg.msg.linux_process_fd_summary, 4), "fd5") == 0, "Section 4 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg.msg.linux_process_fd_summary, 5), "fd6") == 0, "Section 5 not decoded properly"); - - ck_assert_msg(last_msg.msg.linux_process_fd_summary.sys_fd_count == 1304986387, "incorrect value for last_msg.msg.linux_process_fd_summary.sys_fd_count, expected 1304986387, is %d", last_msg.msg.linux_process_fd_summary.sys_fd_count); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgLinuxProcessFdSummary, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(sbp_msg_linux_process_fd_summary_most_opened_encoded_len( + &last_msg.msg.linux_process_fd_summary) == 25, + "Invalid encoded len"); + ck_assert_msg( + strcmp(sbp_msg_linux_process_fd_summary_most_opened_get_section( + &last_msg.msg.linux_process_fd_summary, 0), + "fd1") == 0, + "Section 0 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_linux_process_fd_summary_most_opened_get_section( + &last_msg.msg.linux_process_fd_summary, 1), + "fd2") == 0, + "Section 1 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_linux_process_fd_summary_most_opened_get_section( + &last_msg.msg.linux_process_fd_summary, 2), + "fd3") == 0, + "Section 2 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_linux_process_fd_summary_most_opened_get_section( + &last_msg.msg.linux_process_fd_summary, 3), + "fd4") == 0, + "Section 3 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_linux_process_fd_summary_most_opened_get_section( + &last_msg.msg.linux_process_fd_summary, 4), + "fd5") == 0, + "Section 4 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_linux_process_fd_summary_most_opened_get_section( + &last_msg.msg.linux_process_fd_summary, 5), + "fd6") == 0, + "Section 5 not decoded properly"); + + ck_assert_msg( + last_msg.msg.linux_process_fd_summary.sys_fd_count == 1304986387, + "incorrect value for " + "last_msg.msg.linux_process_fd_summary.sys_fd_count, expected " + "1304986387, is %d", + last_msg.msg.linux_process_fd_summary.sys_fd_count); } } END_TEST -Suite* auto_check_sbp_linux_MsgLinuxProcessFdSummary_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_linux_MsgLinuxProcessFdSummary"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxProcessFdSummary"); +Suite *auto_check_sbp_linux_MsgLinuxProcessFdSummary_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_linux_MsgLinuxProcessFdSummary"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_linux_MsgLinuxProcessFdSummary"); tcase_add_test(tc_acq, test_auto_check_sbp_linux_MsgLinuxProcessFdSummary); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.c b/c/test/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.c index 53e8a6776..5e5cb5f9d 100644 --- a/c/test/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.c +++ b/c/test/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketCounts.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketCounts.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_linux_MsgLinuxProcessSocketCounts ) -{ +START_TEST(test_auto_check_sbp_linux_MsgLinuxProcessSocketCounts) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxProcessSocketCounts ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,73 +90,119 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxProcessSocketCounts ) logging_reset(); - sbp_callback_register(&sbp_state, 0x7f03, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x7f03, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,127,108,9,55,51,137,111,79,118,3,140,114,115,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,180,131, }; + u8 encoded_frame[] = { + 85, 3, 127, 108, 9, 55, 51, 137, 111, 79, 118, 3, 140, + 114, 115, 47, 112, 97, 116, 104, 47, 116, 111, 47, 112, 114, + 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, 97, 114, + 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, 50, 32, + 97, 114, 103, 51, 32, 97, 114, 103, 52, 180, 131, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_linux_process_socket_counts_cmdline_set(&test_msg.linux_process_socket_counts, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_linux_process_socket_counts_cmdline_encoded_len(&test_msg.linux_process_socket_counts) == 46, "String not encoded properly"); - + ck_assert_msg( + sbp_msg_linux_process_socket_counts_cmdline_set( + &test_msg.linux_process_socket_counts, + "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written), + "Can't assign text"); + ck_assert_msg( + written == strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_linux_process_socket_counts_cmdline_encoded_len( + &test_msg.linux_process_socket_counts) == 46, + "String not encoded properly"); + test_msg.linux_process_socket_counts.index = 51; - + test_msg.linux_process_socket_counts.pid = 28553; - + test_msg.linux_process_socket_counts.socket_count = 30287; - + test_msg.linux_process_socket_counts.socket_states = 29554; - + test_msg.linux_process_socket_counts.socket_types = 35843; - sbp_message_send(&sbp_state, SbpMsgLinuxProcessSocketCounts, 2412, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgLinuxProcessSocketCounts, 2412, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 2412, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgLinuxProcessSocketCounts, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_linux_process_socket_counts_cmdline_encoded_len(&last_msg.msg.linux_process_socket_counts) == 46, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_linux_process_socket_counts_cmdline_get(&last_msg.msg.linux_process_socket_counts), "/path/to/process-name arg0 arg1 arg2 arg3 arg4") == 0, "String not decoded properly"); - - ck_assert_msg(last_msg.msg.linux_process_socket_counts.index == 51, "incorrect value for last_msg.msg.linux_process_socket_counts.index, expected 51, is %d", last_msg.msg.linux_process_socket_counts.index); - - ck_assert_msg(last_msg.msg.linux_process_socket_counts.pid == 28553, "incorrect value for last_msg.msg.linux_process_socket_counts.pid, expected 28553, is %d", last_msg.msg.linux_process_socket_counts.pid); - - ck_assert_msg(last_msg.msg.linux_process_socket_counts.socket_count == 30287, "incorrect value for last_msg.msg.linux_process_socket_counts.socket_count, expected 30287, is %d", last_msg.msg.linux_process_socket_counts.socket_count); - - ck_assert_msg(last_msg.msg.linux_process_socket_counts.socket_states == 29554, "incorrect value for last_msg.msg.linux_process_socket_counts.socket_states, expected 29554, is %d", last_msg.msg.linux_process_socket_counts.socket_states); - - ck_assert_msg(last_msg.msg.linux_process_socket_counts.socket_types == 35843, "incorrect value for last_msg.msg.linux_process_socket_counts.socket_types, expected 35843, is %d", last_msg.msg.linux_process_socket_counts.socket_types); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgLinuxProcessSocketCounts, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(sbp_msg_linux_process_socket_counts_cmdline_encoded_len( + &last_msg.msg.linux_process_socket_counts) == 46, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_linux_process_socket_counts_cmdline_get( + &last_msg.msg.linux_process_socket_counts), + "/path/to/process-name arg0 arg1 arg2 arg3 arg4") == 0, + "String not decoded properly"); + + ck_assert_msg( + last_msg.msg.linux_process_socket_counts.index == 51, + "incorrect value for last_msg.msg.linux_process_socket_counts.index, " + "expected 51, is %d", + last_msg.msg.linux_process_socket_counts.index); + + ck_assert_msg( + last_msg.msg.linux_process_socket_counts.pid == 28553, + "incorrect value for last_msg.msg.linux_process_socket_counts.pid, " + "expected 28553, is %d", + last_msg.msg.linux_process_socket_counts.pid); + + ck_assert_msg( + last_msg.msg.linux_process_socket_counts.socket_count == 30287, + "incorrect value for " + "last_msg.msg.linux_process_socket_counts.socket_count, expected " + "30287, is %d", + last_msg.msg.linux_process_socket_counts.socket_count); + + ck_assert_msg( + last_msg.msg.linux_process_socket_counts.socket_states == 29554, + "incorrect value for " + "last_msg.msg.linux_process_socket_counts.socket_states, expected " + "29554, is %d", + last_msg.msg.linux_process_socket_counts.socket_states); + + ck_assert_msg( + last_msg.msg.linux_process_socket_counts.socket_types == 35843, + "incorrect value for " + "last_msg.msg.linux_process_socket_counts.socket_types, expected " + "35843, is %d", + last_msg.msg.linux_process_socket_counts.socket_types); } } END_TEST -Suite* auto_check_sbp_linux_MsgLinuxProcessSocketCounts_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_linux_MsgLinuxProcessSocketCounts"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxProcessSocketCounts"); +Suite *auto_check_sbp_linux_MsgLinuxProcessSocketCounts_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_linux_MsgLinuxProcessSocketCounts"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_linux_MsgLinuxProcessSocketCounts"); tcase_add_test(tc_acq, test_auto_check_sbp_linux_MsgLinuxProcessSocketCounts); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.c b/c/test/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.c index 605fdcc54..e2e9fc2a8 100644 --- a/c/test/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.c +++ b/c/test/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketQueues.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketQueues.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_linux_MsgLinuxProcessSocketQueues ) -{ +START_TEST(test_auto_check_sbp_linux_MsgLinuxProcessSocketQueues) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxProcessSocketQueues ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,87 +90,171 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxProcessSocketQueues ) logging_reset(); - sbp_callback_register(&sbp_state, 0x7f04, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x7f04, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,127,187,232,121,181,135,75,249,211,35,252,80,109,15,223,97,100,100,114,101,115,115,32,111,102,32,108,97,114,103,101,115,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,2,247, }; + u8 encoded_frame[] = { + 85, 4, 127, 187, 232, 121, 181, 135, 75, 249, 211, 35, 252, + 80, 109, 15, 223, 97, 100, 100, 114, 101, 115, 115, 32, 111, + 102, 32, 108, 97, 114, 103, 101, 115, 116, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 47, 112, 97, 116, 104, 47, 116, 111, 47, 112, + 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, 97, + 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, 50, + 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 2, 247, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + { - const char assign_string[] = { (char)97,(char)100,(char)100,(char)114,(char)101,(char)115,(char)115,(char)32,(char)111,(char)102,(char)32,(char)108,(char)97,(char)114,(char)103,(char)101,(char)115,(char)116,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.linux_process_socket_queues.address_of_largest, assign_string, sizeof(assign_string)); + const char assign_string[] = { + (char)97, (char)100, (char)100, (char)114, (char)101, (char)115, + (char)115, (char)32, (char)111, (char)102, (char)32, (char)108, + (char)97, (char)114, (char)103, (char)101, (char)115, (char)116, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.linux_process_socket_queues.address_of_largest, + assign_string, sizeof(assign_string)); } - - + size_t written; - ck_assert_msg(sbp_msg_linux_process_socket_queues_cmdline_set(&test_msg.linux_process_socket_queues, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_linux_process_socket_queues_cmdline_encoded_len(&test_msg.linux_process_socket_queues) == 46, "String not encoded properly"); - + ck_assert_msg( + sbp_msg_linux_process_socket_queues_cmdline_set( + &test_msg.linux_process_socket_queues, + "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written), + "Can't assign text"); + ck_assert_msg( + written == strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_linux_process_socket_queues_cmdline_encoded_len( + &test_msg.linux_process_socket_queues) == 46, + "String not encoded properly"); + test_msg.linux_process_socket_queues.index = 181; - + test_msg.linux_process_socket_queues.pid = 19335; - + test_msg.linux_process_socket_queues.recv_queued = 54265; - + test_msg.linux_process_socket_queues.send_queued = 64547; - + test_msg.linux_process_socket_queues.socket_states = 57103; - + test_msg.linux_process_socket_queues.socket_types = 27984; - sbp_message_send(&sbp_state, SbpMsgLinuxProcessSocketQueues, 59579, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgLinuxProcessSocketQueues, 59579, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 59579, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgLinuxProcessSocketQueues, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); - ck_assert_msg(sbp_message_cmp(SbpMsgLinuxProcessSocketQueues, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - { - const char check_string[] = { (char)97,(char)100,(char)100,(char)114,(char)101,(char)115,(char)115,(char)32,(char)111,(char)102,(char)32,(char)108,(char)97,(char)114,(char)103,(char)101,(char)115,(char)116,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.linux_process_socket_queues.address_of_largest, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.linux_process_socket_queues.address_of_largest, expected string '%s', is '%s'", check_string, last_msg.msg.linux_process_socket_queues.address_of_largest); + const char check_string[] = { + (char)97, (char)100, (char)100, (char)114, (char)101, (char)115, + (char)115, (char)32, (char)111, (char)102, (char)32, (char)108, + (char)97, (char)114, (char)103, (char)101, (char)115, (char)116, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(&last_msg.msg.linux_process_socket_queues.address_of_largest, + check_string, sizeof(check_string)) == 0, + "incorrect value for " + "last_msg.msg.linux_process_socket_queues.address_of_largest, " + "expected string '%s', is '%s'", + check_string, + last_msg.msg.linux_process_socket_queues.address_of_largest); } - - - ck_assert_msg(sbp_msg_linux_process_socket_queues_cmdline_encoded_len(&last_msg.msg.linux_process_socket_queues) == 46, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_linux_process_socket_queues_cmdline_get(&last_msg.msg.linux_process_socket_queues), "/path/to/process-name arg0 arg1 arg2 arg3 arg4") == 0, "String not decoded properly"); - - ck_assert_msg(last_msg.msg.linux_process_socket_queues.index == 181, "incorrect value for last_msg.msg.linux_process_socket_queues.index, expected 181, is %d", last_msg.msg.linux_process_socket_queues.index); - - ck_assert_msg(last_msg.msg.linux_process_socket_queues.pid == 19335, "incorrect value for last_msg.msg.linux_process_socket_queues.pid, expected 19335, is %d", last_msg.msg.linux_process_socket_queues.pid); - - ck_assert_msg(last_msg.msg.linux_process_socket_queues.recv_queued == 54265, "incorrect value for last_msg.msg.linux_process_socket_queues.recv_queued, expected 54265, is %d", last_msg.msg.linux_process_socket_queues.recv_queued); - - ck_assert_msg(last_msg.msg.linux_process_socket_queues.send_queued == 64547, "incorrect value for last_msg.msg.linux_process_socket_queues.send_queued, expected 64547, is %d", last_msg.msg.linux_process_socket_queues.send_queued); - - ck_assert_msg(last_msg.msg.linux_process_socket_queues.socket_states == 57103, "incorrect value for last_msg.msg.linux_process_socket_queues.socket_states, expected 57103, is %d", last_msg.msg.linux_process_socket_queues.socket_states); - - ck_assert_msg(last_msg.msg.linux_process_socket_queues.socket_types == 27984, "incorrect value for last_msg.msg.linux_process_socket_queues.socket_types, expected 27984, is %d", last_msg.msg.linux_process_socket_queues.socket_types); + ck_assert_msg(sbp_msg_linux_process_socket_queues_cmdline_encoded_len( + &last_msg.msg.linux_process_socket_queues) == 46, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_linux_process_socket_queues_cmdline_get( + &last_msg.msg.linux_process_socket_queues), + "/path/to/process-name arg0 arg1 arg2 arg3 arg4") == 0, + "String not decoded properly"); + + ck_assert_msg( + last_msg.msg.linux_process_socket_queues.index == 181, + "incorrect value for last_msg.msg.linux_process_socket_queues.index, " + "expected 181, is %d", + last_msg.msg.linux_process_socket_queues.index); + + ck_assert_msg( + last_msg.msg.linux_process_socket_queues.pid == 19335, + "incorrect value for last_msg.msg.linux_process_socket_queues.pid, " + "expected 19335, is %d", + last_msg.msg.linux_process_socket_queues.pid); + + ck_assert_msg(last_msg.msg.linux_process_socket_queues.recv_queued == 54265, + "incorrect value for " + "last_msg.msg.linux_process_socket_queues.recv_queued, " + "expected 54265, is %d", + last_msg.msg.linux_process_socket_queues.recv_queued); + + ck_assert_msg(last_msg.msg.linux_process_socket_queues.send_queued == 64547, + "incorrect value for " + "last_msg.msg.linux_process_socket_queues.send_queued, " + "expected 64547, is %d", + last_msg.msg.linux_process_socket_queues.send_queued); + + ck_assert_msg( + last_msg.msg.linux_process_socket_queues.socket_states == 57103, + "incorrect value for " + "last_msg.msg.linux_process_socket_queues.socket_states, expected " + "57103, is %d", + last_msg.msg.linux_process_socket_queues.socket_states); + + ck_assert_msg( + last_msg.msg.linux_process_socket_queues.socket_types == 27984, + "incorrect value for " + "last_msg.msg.linux_process_socket_queues.socket_types, expected " + "27984, is %d", + last_msg.msg.linux_process_socket_queues.socket_types); } } END_TEST -Suite* auto_check_sbp_linux_MsgLinuxProcessSocketQueues_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_linux_MsgLinuxProcessSocketQueues"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxProcessSocketQueues"); +Suite *auto_check_sbp_linux_MsgLinuxProcessSocketQueues_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_linux_MsgLinuxProcessSocketQueues"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_linux_MsgLinuxProcessSocketQueues"); tcase_add_test(tc_acq, test_auto_check_sbp_linux_MsgLinuxProcessSocketQueues); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_linux_MsgLinuxSocketUsage.c b/c/test/auto_check_sbp_linux_MsgLinuxSocketUsage.c index 8d18aed54..3995738d5 100644 --- a/c/test/auto_check_sbp_linux_MsgLinuxSocketUsage.c +++ b/c/test/auto_check_sbp_linux_MsgLinuxSocketUsage.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSocketUsage.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSocketUsage.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_linux_MsgLinuxSocketUsage ) -{ +START_TEST(test_auto_check_sbp_linux_MsgLinuxSocketUsage) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxSocketUsage ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,151 +90,327 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxSocketUsage ) logging_reset(); - sbp_callback_register(&sbp_state, 0x7f05, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x7f05, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,127,114,138,72,13,196,69,173,67,222,186,181,246,154,251,17,224,179,26,169,177,90,149,213,214,6,126,64,120,185,84,131,200,111,32,141,217,209,52,14,190,147,159,246,141,122,212,119,131,30,120,47,25,109,154,65,132,164,39,30,30,175,8,44,28,111,236,240,176,74,159,129,154,153,162,229,130,154, }; + u8 encoded_frame[] = { + 85, 5, 127, 114, 138, 72, 13, 196, 69, 173, 67, 222, 186, 181, + 246, 154, 251, 17, 224, 179, 26, 169, 177, 90, 149, 213, 214, 6, + 126, 64, 120, 185, 84, 131, 200, 111, 32, 141, 217, 209, 52, 14, + 190, 147, 159, 246, 141, 122, 212, 119, 131, 30, 120, 47, 25, 109, + 154, 65, 132, 164, 39, 30, 30, 175, 8, 44, 28, 111, 236, 240, + 176, 74, 159, 129, 154, 153, 162, 229, 130, 154, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.linux_socket_usage.avg_queue_depth = 2907030541; - + test_msg.linux_socket_usage.max_queue_depth = 3048922691; - - + test_msg.linux_socket_usage.socket_state_counts[0] = 39670; - + test_msg.linux_socket_usage.socket_state_counts[1] = 4603; - + test_msg.linux_socket_usage.socket_state_counts[2] = 46048; - + test_msg.linux_socket_usage.socket_state_counts[3] = 43290; - + test_msg.linux_socket_usage.socket_state_counts[4] = 23217; - + test_msg.linux_socket_usage.socket_state_counts[5] = 54677; - + test_msg.linux_socket_usage.socket_state_counts[6] = 1750; - + test_msg.linux_socket_usage.socket_state_counts[7] = 16510; - + test_msg.linux_socket_usage.socket_state_counts[8] = 47480; - + test_msg.linux_socket_usage.socket_state_counts[9] = 33620; - + test_msg.linux_socket_usage.socket_state_counts[10] = 28616; - + test_msg.linux_socket_usage.socket_state_counts[11] = 36128; - + test_msg.linux_socket_usage.socket_state_counts[12] = 53721; - + test_msg.linux_socket_usage.socket_state_counts[13] = 3636; - + test_msg.linux_socket_usage.socket_state_counts[14] = 37822; - + test_msg.linux_socket_usage.socket_state_counts[15] = 63135; - - + test_msg.linux_socket_usage.socket_type_counts[0] = 31373; - + test_msg.linux_socket_usage.socket_type_counts[1] = 30676; - + test_msg.linux_socket_usage.socket_type_counts[2] = 7811; - + test_msg.linux_socket_usage.socket_type_counts[3] = 12152; - + test_msg.linux_socket_usage.socket_type_counts[4] = 27929; - + test_msg.linux_socket_usage.socket_type_counts[5] = 16794; - + test_msg.linux_socket_usage.socket_type_counts[6] = 42116; - + test_msg.linux_socket_usage.socket_type_counts[7] = 7719; - + test_msg.linux_socket_usage.socket_type_counts[8] = 44830; - + test_msg.linux_socket_usage.socket_type_counts[9] = 11272; - + test_msg.linux_socket_usage.socket_type_counts[10] = 28444; - + test_msg.linux_socket_usage.socket_type_counts[11] = 61676; - + test_msg.linux_socket_usage.socket_type_counts[12] = 19120; - + test_msg.linux_socket_usage.socket_type_counts[13] = 33183; - + test_msg.linux_socket_usage.socket_type_counts[14] = 39322; - + test_msg.linux_socket_usage.socket_type_counts[15] = 58786; - sbp_message_send(&sbp_state, SbpMsgLinuxSocketUsage, 35442, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgLinuxSocketUsage, 35442, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35442, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgLinuxSocketUsage, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgLinuxSocketUsage, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.linux_socket_usage.avg_queue_depth == 2907030541, "incorrect value for last_msg.msg.linux_socket_usage.avg_queue_depth, expected 2907030541, is %d", last_msg.msg.linux_socket_usage.avg_queue_depth); - - ck_assert_msg(last_msg.msg.linux_socket_usage.max_queue_depth == 3048922691, "incorrect value for last_msg.msg.linux_socket_usage.max_queue_depth, expected 3048922691, is %d", last_msg.msg.linux_socket_usage.max_queue_depth); - - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[0] == 39670, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[0], expected 39670, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[0]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[1] == 4603, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[1], expected 4603, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[1]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[2] == 46048, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[2], expected 46048, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[2]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[3] == 43290, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[3], expected 43290, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[3]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[4] == 23217, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[4], expected 23217, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[4]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[5] == 54677, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[5], expected 54677, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[5]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[6] == 1750, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[6], expected 1750, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[6]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[7] == 16510, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[7], expected 16510, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[7]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[8] == 47480, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[8], expected 47480, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[8]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[9] == 33620, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[9], expected 33620, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[9]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[10] == 28616, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[10], expected 28616, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[10]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[11] == 36128, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[11], expected 36128, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[11]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[12] == 53721, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[12], expected 53721, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[12]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[13] == 3636, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[13], expected 3636, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[13]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[14] == 37822, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[14], expected 37822, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[14]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_state_counts[15] == 63135, "incorrect value for last_msg.msg.linux_socket_usage.socket_state_counts[15], expected 63135, is %d", last_msg.msg.linux_socket_usage.socket_state_counts[15]); - - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[0] == 31373, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[0], expected 31373, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[0]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[1] == 30676, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[1], expected 30676, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[1]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[2] == 7811, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[2], expected 7811, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[2]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[3] == 12152, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[3], expected 12152, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[3]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[4] == 27929, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[4], expected 27929, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[4]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[5] == 16794, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[5], expected 16794, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[5]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[6] == 42116, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[6], expected 42116, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[6]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[7] == 7719, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[7], expected 7719, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[7]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[8] == 44830, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[8], expected 44830, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[8]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[9] == 11272, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[9], expected 11272, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[9]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[10] == 28444, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[10], expected 28444, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[10]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[11] == 61676, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[11], expected 61676, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[11]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[12] == 19120, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[12], expected 19120, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[12]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[13] == 33183, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[13], expected 33183, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[13]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[14] == 39322, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[14], expected 39322, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[14]); - ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[15] == 58786, "incorrect value for last_msg.msg.linux_socket_usage.socket_type_counts[15], expected 58786, is %d", last_msg.msg.linux_socket_usage.socket_type_counts[15]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.avg_queue_depth == 2907030541, + "incorrect value for last_msg.msg.linux_socket_usage.avg_queue_depth, " + "expected 2907030541, is %d", + last_msg.msg.linux_socket_usage.avg_queue_depth); + + ck_assert_msg( + last_msg.msg.linux_socket_usage.max_queue_depth == 3048922691, + "incorrect value for last_msg.msg.linux_socket_usage.max_queue_depth, " + "expected 3048922691, is %d", + last_msg.msg.linux_socket_usage.max_queue_depth); + + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[0] == 39670, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[0], expected " + "39670, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[0]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[1] == 4603, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[1], expected " + "4603, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[1]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[2] == 46048, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[2], expected " + "46048, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[2]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[3] == 43290, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[3], expected " + "43290, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[3]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[4] == 23217, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[4], expected " + "23217, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[4]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[5] == 54677, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[5], expected " + "54677, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[5]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[6] == 1750, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[6], expected " + "1750, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[6]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[7] == 16510, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[7], expected " + "16510, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[7]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[8] == 47480, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[8], expected " + "47480, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[8]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[9] == 33620, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[9], expected " + "33620, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[9]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[10] == 28616, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[10], expected " + "28616, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[10]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[11] == 36128, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[11], expected " + "36128, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[11]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[12] == 53721, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[12], expected " + "53721, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[12]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[13] == 3636, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[13], expected " + "3636, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[13]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[14] == 37822, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[14], expected " + "37822, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[14]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_state_counts[15] == 63135, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_state_counts[15], expected " + "63135, is %d", + last_msg.msg.linux_socket_usage.socket_state_counts[15]); + + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_type_counts[0] == 31373, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[0], expected " + "31373, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[0]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_type_counts[1] == 30676, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[1], expected " + "30676, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[1]); + ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[2] == 7811, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[2], " + "expected 7811, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[2]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_type_counts[3] == 12152, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[3], expected " + "12152, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[3]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_type_counts[4] == 27929, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[4], expected " + "27929, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[4]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_type_counts[5] == 16794, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[5], expected " + "16794, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[5]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_type_counts[6] == 42116, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[6], expected " + "42116, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[6]); + ck_assert_msg(last_msg.msg.linux_socket_usage.socket_type_counts[7] == 7719, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[7], " + "expected 7719, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[7]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_type_counts[8] == 44830, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[8], expected " + "44830, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[8]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_type_counts[9] == 11272, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[9], expected " + "11272, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[9]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_type_counts[10] == 28444, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[10], expected " + "28444, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[10]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_type_counts[11] == 61676, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[11], expected " + "61676, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[11]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_type_counts[12] == 19120, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[12], expected " + "19120, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[12]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_type_counts[13] == 33183, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[13], expected " + "33183, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[13]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_type_counts[14] == 39322, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[14], expected " + "39322, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[14]); + ck_assert_msg( + last_msg.msg.linux_socket_usage.socket_type_counts[15] == 58786, + "incorrect value for " + "last_msg.msg.linux_socket_usage.socket_type_counts[15], expected " + "58786, is %d", + last_msg.msg.linux_socket_usage.socket_type_counts[15]); } } END_TEST -Suite* auto_check_sbp_linux_MsgLinuxSocketUsage_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_linux_MsgLinuxSocketUsage"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxSocketUsage"); +Suite *auto_check_sbp_linux_MsgLinuxSocketUsage_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_linux_MsgLinuxSocketUsage"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxSocketUsage"); tcase_add_test(tc_acq, test_auto_check_sbp_linux_MsgLinuxSocketUsage); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_linux_MsgLinuxSysState.c b/c/test/auto_check_sbp_linux_MsgLinuxSysState.c index 3a4d25009..38429d7ba 100644 --- a/c/test/auto_check_sbp_linux_MsgLinuxSysState.c +++ b/c/test/auto_check_sbp_linux_MsgLinuxSysState.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysState.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_linux_MsgLinuxSysState ) -{ +START_TEST(test_auto_check_sbp_linux_MsgLinuxSysState) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxSysState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,75 +90,109 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxSysState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x7f0a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x7f0a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,10,127,85,167,15,20,207,125,215,196,71,161,229,250,186,108,30,106,5,9,229,242, }; + u8 encoded_frame[] = { + 85, 10, 127, 85, 167, 15, 20, 207, 125, 215, 196, 71, + 161, 229, 250, 186, 108, 30, 106, 5, 9, 229, 242, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.linux_sys_state.flags = 9; - + test_msg.linux_sys_state.mem_total = 53012; - + test_msg.linux_sys_state.pcpu = 125; - + test_msg.linux_sys_state.pid_count = 47866; - + test_msg.linux_sys_state.pmem = 215; - + test_msg.linux_sys_state.procs_starting = 18372; - + test_msg.linux_sys_state.procs_stopping = 58785; - + test_msg.linux_sys_state.time = 90840684; - sbp_message_send(&sbp_state, SbpMsgLinuxSysState, 42837, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgLinuxSysState, 42837, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 42837, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgLinuxSysState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgLinuxSysState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.linux_sys_state.flags == 9, "incorrect value for last_msg.msg.linux_sys_state.flags, expected 9, is %d", last_msg.msg.linux_sys_state.flags); - - ck_assert_msg(last_msg.msg.linux_sys_state.mem_total == 53012, "incorrect value for last_msg.msg.linux_sys_state.mem_total, expected 53012, is %d", last_msg.msg.linux_sys_state.mem_total); - - ck_assert_msg(last_msg.msg.linux_sys_state.pcpu == 125, "incorrect value for last_msg.msg.linux_sys_state.pcpu, expected 125, is %d", last_msg.msg.linux_sys_state.pcpu); - - ck_assert_msg(last_msg.msg.linux_sys_state.pid_count == 47866, "incorrect value for last_msg.msg.linux_sys_state.pid_count, expected 47866, is %d", last_msg.msg.linux_sys_state.pid_count); - - ck_assert_msg(last_msg.msg.linux_sys_state.pmem == 215, "incorrect value for last_msg.msg.linux_sys_state.pmem, expected 215, is %d", last_msg.msg.linux_sys_state.pmem); - - ck_assert_msg(last_msg.msg.linux_sys_state.procs_starting == 18372, "incorrect value for last_msg.msg.linux_sys_state.procs_starting, expected 18372, is %d", last_msg.msg.linux_sys_state.procs_starting); - - ck_assert_msg(last_msg.msg.linux_sys_state.procs_stopping == 58785, "incorrect value for last_msg.msg.linux_sys_state.procs_stopping, expected 58785, is %d", last_msg.msg.linux_sys_state.procs_stopping); - - ck_assert_msg(last_msg.msg.linux_sys_state.time == 90840684, "incorrect value for last_msg.msg.linux_sys_state.time, expected 90840684, is %d", last_msg.msg.linux_sys_state.time); + ck_assert_msg(last_msg.msg.linux_sys_state.flags == 9, + "incorrect value for last_msg.msg.linux_sys_state.flags, " + "expected 9, is %d", + last_msg.msg.linux_sys_state.flags); + + ck_assert_msg(last_msg.msg.linux_sys_state.mem_total == 53012, + "incorrect value for last_msg.msg.linux_sys_state.mem_total, " + "expected 53012, is %d", + last_msg.msg.linux_sys_state.mem_total); + + ck_assert_msg(last_msg.msg.linux_sys_state.pcpu == 125, + "incorrect value for last_msg.msg.linux_sys_state.pcpu, " + "expected 125, is %d", + last_msg.msg.linux_sys_state.pcpu); + + ck_assert_msg(last_msg.msg.linux_sys_state.pid_count == 47866, + "incorrect value for last_msg.msg.linux_sys_state.pid_count, " + "expected 47866, is %d", + last_msg.msg.linux_sys_state.pid_count); + + ck_assert_msg(last_msg.msg.linux_sys_state.pmem == 215, + "incorrect value for last_msg.msg.linux_sys_state.pmem, " + "expected 215, is %d", + last_msg.msg.linux_sys_state.pmem); + + ck_assert_msg( + last_msg.msg.linux_sys_state.procs_starting == 18372, + "incorrect value for last_msg.msg.linux_sys_state.procs_starting, " + "expected 18372, is %d", + last_msg.msg.linux_sys_state.procs_starting); + + ck_assert_msg( + last_msg.msg.linux_sys_state.procs_stopping == 58785, + "incorrect value for last_msg.msg.linux_sys_state.procs_stopping, " + "expected 58785, is %d", + last_msg.msg.linux_sys_state.procs_stopping); + + ck_assert_msg(last_msg.msg.linux_sys_state.time == 90840684, + "incorrect value for last_msg.msg.linux_sys_state.time, " + "expected 90840684, is %d", + last_msg.msg.linux_sys_state.time); } } END_TEST -Suite* auto_check_sbp_linux_MsgLinuxSysState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_linux_MsgLinuxSysState"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxSysState"); +Suite *auto_check_sbp_linux_MsgLinuxSysState_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_linux_MsgLinuxSysState"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxSysState"); tcase_add_test(tc_acq, test_auto_check_sbp_linux_MsgLinuxSysState); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_linux_MsgLinuxSysStateDepA.c b/c/test/auto_check_sbp_linux_MsgLinuxSysStateDepA.c index 60b36309c..7a08ea035 100644 --- a/c/test/auto_check_sbp_linux_MsgLinuxSysStateDepA.c +++ b/c/test/auto_check_sbp_linux_MsgLinuxSysStateDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysStateDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_linux_MsgLinuxSysStateDepA ) -{ +START_TEST(test_auto_check_sbp_linux_MsgLinuxSysStateDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxSysStateDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,67 +90,99 @@ START_TEST( test_auto_check_sbp_linux_MsgLinuxSysStateDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x7f02, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x7f02, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,127,84,56,10,188,163,211,194,115,71,101,103,124,201,223,223, }; + u8 encoded_frame[] = { + 85, 2, 127, 84, 56, 10, 188, 163, 211, + 194, 115, 71, 101, 103, 124, 201, 223, 223, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.linux_sys_state_dep_a.mem_total = 41916; - + test_msg.linux_sys_state_dep_a.pcpu = 211; - + test_msg.linux_sys_state_dep_a.pid_count = 51580; - + test_msg.linux_sys_state_dep_a.pmem = 194; - + test_msg.linux_sys_state_dep_a.procs_starting = 18291; - + test_msg.linux_sys_state_dep_a.procs_stopping = 26469; - sbp_message_send(&sbp_state, SbpMsgLinuxSysStateDepA, 14420, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgLinuxSysStateDepA, 14420, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 14420, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgLinuxSysStateDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgLinuxSysStateDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.linux_sys_state_dep_a.mem_total == 41916, "incorrect value for last_msg.msg.linux_sys_state_dep_a.mem_total, expected 41916, is %d", last_msg.msg.linux_sys_state_dep_a.mem_total); - - ck_assert_msg(last_msg.msg.linux_sys_state_dep_a.pcpu == 211, "incorrect value for last_msg.msg.linux_sys_state_dep_a.pcpu, expected 211, is %d", last_msg.msg.linux_sys_state_dep_a.pcpu); - - ck_assert_msg(last_msg.msg.linux_sys_state_dep_a.pid_count == 51580, "incorrect value for last_msg.msg.linux_sys_state_dep_a.pid_count, expected 51580, is %d", last_msg.msg.linux_sys_state_dep_a.pid_count); - - ck_assert_msg(last_msg.msg.linux_sys_state_dep_a.pmem == 194, "incorrect value for last_msg.msg.linux_sys_state_dep_a.pmem, expected 194, is %d", last_msg.msg.linux_sys_state_dep_a.pmem); - - ck_assert_msg(last_msg.msg.linux_sys_state_dep_a.procs_starting == 18291, "incorrect value for last_msg.msg.linux_sys_state_dep_a.procs_starting, expected 18291, is %d", last_msg.msg.linux_sys_state_dep_a.procs_starting); - - ck_assert_msg(last_msg.msg.linux_sys_state_dep_a.procs_stopping == 26469, "incorrect value for last_msg.msg.linux_sys_state_dep_a.procs_stopping, expected 26469, is %d", last_msg.msg.linux_sys_state_dep_a.procs_stopping); + ck_assert_msg( + last_msg.msg.linux_sys_state_dep_a.mem_total == 41916, + "incorrect value for last_msg.msg.linux_sys_state_dep_a.mem_total, " + "expected 41916, is %d", + last_msg.msg.linux_sys_state_dep_a.mem_total); + + ck_assert_msg( + last_msg.msg.linux_sys_state_dep_a.pcpu == 211, + "incorrect value for last_msg.msg.linux_sys_state_dep_a.pcpu, expected " + "211, is %d", + last_msg.msg.linux_sys_state_dep_a.pcpu); + + ck_assert_msg( + last_msg.msg.linux_sys_state_dep_a.pid_count == 51580, + "incorrect value for last_msg.msg.linux_sys_state_dep_a.pid_count, " + "expected 51580, is %d", + last_msg.msg.linux_sys_state_dep_a.pid_count); + + ck_assert_msg( + last_msg.msg.linux_sys_state_dep_a.pmem == 194, + "incorrect value for last_msg.msg.linux_sys_state_dep_a.pmem, expected " + "194, is %d", + last_msg.msg.linux_sys_state_dep_a.pmem); + + ck_assert_msg(last_msg.msg.linux_sys_state_dep_a.procs_starting == 18291, + "incorrect value for " + "last_msg.msg.linux_sys_state_dep_a.procs_starting, expected " + "18291, is %d", + last_msg.msg.linux_sys_state_dep_a.procs_starting); + + ck_assert_msg(last_msg.msg.linux_sys_state_dep_a.procs_stopping == 26469, + "incorrect value for " + "last_msg.msg.linux_sys_state_dep_a.procs_stopping, expected " + "26469, is %d", + last_msg.msg.linux_sys_state_dep_a.procs_stopping); } } END_TEST -Suite* auto_check_sbp_linux_MsgLinuxSysStateDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_linux_MsgLinuxSysStateDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxSysStateDepA"); +Suite *auto_check_sbp_linux_MsgLinuxSysStateDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_linux_MsgLinuxSysStateDepA"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_linux_MsgLinuxSysStateDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_linux_MsgLinuxSysStateDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_logging_MsgFwd.c b/c/test/auto_check_sbp_logging_MsgFwd.c index dcb5e3a7f..193f7e082 100644 --- a/c/test/auto_check_sbp_logging_MsgFwd.c +++ b/c/test/auto_check_sbp_logging_MsgFwd.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/logging/test_MsgFwd.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/logging/test_MsgFwd.yaml by generate.py. Do not +// modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_logging_MsgFwd ) -{ +START_TEST(test_auto_check_sbp_logging_MsgFwd) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_logging_MsgFwd ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,104 +90,165 @@ START_TEST( test_auto_check_sbp_logging_MsgFwd ) logging_reset(); - sbp_callback_register(&sbp_state, 0x402, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x402, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,4,66,0,18,0,0,86,81,68,47,81,103,65,69,65,65,65,65,65,69,97,103,125,95, }; + u8 encoded_frame[] = { + 85, 2, 4, 66, 0, 18, 0, 0, 86, 81, 68, 47, 81, + 103, 65, 69, 65, 65, 65, 65, 65, 69, 97, 103, 125, 95, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.fwd.fwd_payload[0] = 86; - + test_msg.fwd.fwd_payload[1] = 81; - + test_msg.fwd.fwd_payload[2] = 68; - + test_msg.fwd.fwd_payload[3] = 47; - + test_msg.fwd.fwd_payload[4] = 81; - + test_msg.fwd.fwd_payload[5] = 103; - + test_msg.fwd.fwd_payload[6] = 65; - + test_msg.fwd.fwd_payload[7] = 69; - + test_msg.fwd.fwd_payload[8] = 65; - + test_msg.fwd.fwd_payload[9] = 65; - + test_msg.fwd.fwd_payload[10] = 65; - + test_msg.fwd.fwd_payload[11] = 65; - + test_msg.fwd.fwd_payload[12] = 65; - + test_msg.fwd.fwd_payload[13] = 69; - + test_msg.fwd.fwd_payload[14] = 97; - + test_msg.fwd.fwd_payload[15] = 103; - + test_msg.fwd.n_fwd_payload = 16; - + test_msg.fwd.protocol = 0; - + test_msg.fwd.source = 0; sbp_message_send(&sbp_state, SbpMsgFwd, 66, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgFwd, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.fwd.fwd_payload[0] == 86, "incorrect value for last_msg.msg.fwd.fwd_payload[0], expected 86, is %d", last_msg.msg.fwd.fwd_payload[0]); - ck_assert_msg(last_msg.msg.fwd.fwd_payload[1] == 81, "incorrect value for last_msg.msg.fwd.fwd_payload[1], expected 81, is %d", last_msg.msg.fwd.fwd_payload[1]); - ck_assert_msg(last_msg.msg.fwd.fwd_payload[2] == 68, "incorrect value for last_msg.msg.fwd.fwd_payload[2], expected 68, is %d", last_msg.msg.fwd.fwd_payload[2]); - ck_assert_msg(last_msg.msg.fwd.fwd_payload[3] == 47, "incorrect value for last_msg.msg.fwd.fwd_payload[3], expected 47, is %d", last_msg.msg.fwd.fwd_payload[3]); - ck_assert_msg(last_msg.msg.fwd.fwd_payload[4] == 81, "incorrect value for last_msg.msg.fwd.fwd_payload[4], expected 81, is %d", last_msg.msg.fwd.fwd_payload[4]); - ck_assert_msg(last_msg.msg.fwd.fwd_payload[5] == 103, "incorrect value for last_msg.msg.fwd.fwd_payload[5], expected 103, is %d", last_msg.msg.fwd.fwd_payload[5]); - ck_assert_msg(last_msg.msg.fwd.fwd_payload[6] == 65, "incorrect value for last_msg.msg.fwd.fwd_payload[6], expected 65, is %d", last_msg.msg.fwd.fwd_payload[6]); - ck_assert_msg(last_msg.msg.fwd.fwd_payload[7] == 69, "incorrect value for last_msg.msg.fwd.fwd_payload[7], expected 69, is %d", last_msg.msg.fwd.fwd_payload[7]); - ck_assert_msg(last_msg.msg.fwd.fwd_payload[8] == 65, "incorrect value for last_msg.msg.fwd.fwd_payload[8], expected 65, is %d", last_msg.msg.fwd.fwd_payload[8]); - ck_assert_msg(last_msg.msg.fwd.fwd_payload[9] == 65, "incorrect value for last_msg.msg.fwd.fwd_payload[9], expected 65, is %d", last_msg.msg.fwd.fwd_payload[9]); - ck_assert_msg(last_msg.msg.fwd.fwd_payload[10] == 65, "incorrect value for last_msg.msg.fwd.fwd_payload[10], expected 65, is %d", last_msg.msg.fwd.fwd_payload[10]); - ck_assert_msg(last_msg.msg.fwd.fwd_payload[11] == 65, "incorrect value for last_msg.msg.fwd.fwd_payload[11], expected 65, is %d", last_msg.msg.fwd.fwd_payload[11]); - ck_assert_msg(last_msg.msg.fwd.fwd_payload[12] == 65, "incorrect value for last_msg.msg.fwd.fwd_payload[12], expected 65, is %d", last_msg.msg.fwd.fwd_payload[12]); - ck_assert_msg(last_msg.msg.fwd.fwd_payload[13] == 69, "incorrect value for last_msg.msg.fwd.fwd_payload[13], expected 69, is %d", last_msg.msg.fwd.fwd_payload[13]); - ck_assert_msg(last_msg.msg.fwd.fwd_payload[14] == 97, "incorrect value for last_msg.msg.fwd.fwd_payload[14], expected 97, is %d", last_msg.msg.fwd.fwd_payload[14]); - ck_assert_msg(last_msg.msg.fwd.fwd_payload[15] == 103, "incorrect value for last_msg.msg.fwd.fwd_payload[15], expected 103, is %d", last_msg.msg.fwd.fwd_payload[15]); - - ck_assert_msg(last_msg.msg.fwd.n_fwd_payload == 16, "incorrect value for last_msg.msg.fwd.n_fwd_payload, expected 16, is %d", last_msg.msg.fwd.n_fwd_payload); - - ck_assert_msg(last_msg.msg.fwd.protocol == 0, "incorrect value for last_msg.msg.fwd.protocol, expected 0, is %d", last_msg.msg.fwd.protocol); - - ck_assert_msg(last_msg.msg.fwd.source == 0, "incorrect value for last_msg.msg.fwd.source, expected 0, is %d", last_msg.msg.fwd.source); + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.fwd.fwd_payload[0] == 86, + "incorrect value for last_msg.msg.fwd.fwd_payload[0], " + "expected 86, is %d", + last_msg.msg.fwd.fwd_payload[0]); + ck_assert_msg(last_msg.msg.fwd.fwd_payload[1] == 81, + "incorrect value for last_msg.msg.fwd.fwd_payload[1], " + "expected 81, is %d", + last_msg.msg.fwd.fwd_payload[1]); + ck_assert_msg(last_msg.msg.fwd.fwd_payload[2] == 68, + "incorrect value for last_msg.msg.fwd.fwd_payload[2], " + "expected 68, is %d", + last_msg.msg.fwd.fwd_payload[2]); + ck_assert_msg(last_msg.msg.fwd.fwd_payload[3] == 47, + "incorrect value for last_msg.msg.fwd.fwd_payload[3], " + "expected 47, is %d", + last_msg.msg.fwd.fwd_payload[3]); + ck_assert_msg(last_msg.msg.fwd.fwd_payload[4] == 81, + "incorrect value for last_msg.msg.fwd.fwd_payload[4], " + "expected 81, is %d", + last_msg.msg.fwd.fwd_payload[4]); + ck_assert_msg(last_msg.msg.fwd.fwd_payload[5] == 103, + "incorrect value for last_msg.msg.fwd.fwd_payload[5], " + "expected 103, is %d", + last_msg.msg.fwd.fwd_payload[5]); + ck_assert_msg(last_msg.msg.fwd.fwd_payload[6] == 65, + "incorrect value for last_msg.msg.fwd.fwd_payload[6], " + "expected 65, is %d", + last_msg.msg.fwd.fwd_payload[6]); + ck_assert_msg(last_msg.msg.fwd.fwd_payload[7] == 69, + "incorrect value for last_msg.msg.fwd.fwd_payload[7], " + "expected 69, is %d", + last_msg.msg.fwd.fwd_payload[7]); + ck_assert_msg(last_msg.msg.fwd.fwd_payload[8] == 65, + "incorrect value for last_msg.msg.fwd.fwd_payload[8], " + "expected 65, is %d", + last_msg.msg.fwd.fwd_payload[8]); + ck_assert_msg(last_msg.msg.fwd.fwd_payload[9] == 65, + "incorrect value for last_msg.msg.fwd.fwd_payload[9], " + "expected 65, is %d", + last_msg.msg.fwd.fwd_payload[9]); + ck_assert_msg(last_msg.msg.fwd.fwd_payload[10] == 65, + "incorrect value for last_msg.msg.fwd.fwd_payload[10], " + "expected 65, is %d", + last_msg.msg.fwd.fwd_payload[10]); + ck_assert_msg(last_msg.msg.fwd.fwd_payload[11] == 65, + "incorrect value for last_msg.msg.fwd.fwd_payload[11], " + "expected 65, is %d", + last_msg.msg.fwd.fwd_payload[11]); + ck_assert_msg(last_msg.msg.fwd.fwd_payload[12] == 65, + "incorrect value for last_msg.msg.fwd.fwd_payload[12], " + "expected 65, is %d", + last_msg.msg.fwd.fwd_payload[12]); + ck_assert_msg(last_msg.msg.fwd.fwd_payload[13] == 69, + "incorrect value for last_msg.msg.fwd.fwd_payload[13], " + "expected 69, is %d", + last_msg.msg.fwd.fwd_payload[13]); + ck_assert_msg(last_msg.msg.fwd.fwd_payload[14] == 97, + "incorrect value for last_msg.msg.fwd.fwd_payload[14], " + "expected 97, is %d", + last_msg.msg.fwd.fwd_payload[14]); + ck_assert_msg(last_msg.msg.fwd.fwd_payload[15] == 103, + "incorrect value for last_msg.msg.fwd.fwd_payload[15], " + "expected 103, is %d", + last_msg.msg.fwd.fwd_payload[15]); + + ck_assert_msg(last_msg.msg.fwd.n_fwd_payload == 16, + "incorrect value for last_msg.msg.fwd.n_fwd_payload, " + "expected 16, is %d", + last_msg.msg.fwd.n_fwd_payload); + + ck_assert_msg( + last_msg.msg.fwd.protocol == 0, + "incorrect value for last_msg.msg.fwd.protocol, expected 0, is %d", + last_msg.msg.fwd.protocol); + ck_assert_msg( + last_msg.msg.fwd.source == 0, + "incorrect value for last_msg.msg.fwd.source, expected 0, is %d", + last_msg.msg.fwd.source); } } END_TEST -Suite* auto_check_sbp_logging_MsgFwd_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_logging_MsgFwd"); +Suite *auto_check_sbp_logging_MsgFwd_suite(void) { + Suite *s = + suite_create("SBP generated test suite: auto_check_sbp_logging_MsgFwd"); TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_logging_MsgFwd"); tcase_add_test(tc_acq, test_auto_check_sbp_logging_MsgFwd); suite_add_tcase(s, tc_acq); diff --git a/c/test/auto_check_sbp_logging_MsgLog.c b/c/test/auto_check_sbp_logging_MsgLog.c index 262eee543..d4384ff1f 100644 --- a/c/test/auto_check_sbp_logging_MsgLog.c +++ b/c/test/auto_check_sbp_logging_MsgLog.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/logging/test_MsgLog.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/logging/test_MsgLog.yaml by generate.py. Do not +// modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_logging_MsgLog ) -{ +START_TEST(test_auto_check_sbp_logging_MsgLog) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_logging_MsgLog ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,56 +90,74 @@ START_TEST( test_auto_check_sbp_logging_MsgLog ) logging_reset(); - sbp_callback_register(&sbp_state, 0x0401, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x0401, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,4,10,9,44,6,70,105,108,116,101,114,101,100,32,97,108,108,32,111,98,115,32,102,114,111,109,32,50,51,49,52,32,97,116,32,116,111,119,32,56,51,46,53,51,57,48,49,57,177,163, }; + u8 encoded_frame[] = { + 85, 1, 4, 10, 9, 44, 6, 70, 105, 108, 116, 101, 114, + 101, 100, 32, 97, 108, 108, 32, 111, 98, 115, 32, 102, 114, + 111, 109, 32, 50, 51, 49, 52, 32, 97, 116, 32, 116, 111, + 119, 32, 56, 51, 46, 53, 51, 57, 48, 49, 57, 177, 163, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.log.level = 6; - - + size_t written; - ck_assert_msg(sbp_msg_log_text_set(&test_msg.log, "Filtered all obs from 2314 at tow 83.539019", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("Filtered all obs from 2314 at tow 83.539019"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_log_text_encoded_len(&test_msg.log) == 43, "String not encoded properly"); + ck_assert_msg( + sbp_msg_log_text_set(&test_msg.log, + "Filtered all obs from 2314 at tow 83.539019", + false, &written), + "Can't assign text"); + ck_assert_msg( + written == strlen("Filtered all obs from 2314 at tow 83.539019"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_log_text_encoded_len(&test_msg.log) == 43, + "String not encoded properly"); sbp_message_send(&sbp_state, SbpMsgLog, 2314, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 2314, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgLog, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.log.level == 6, "incorrect value for last_msg.msg.log.level, expected 6, is %d", last_msg.msg.log.level); - - - ck_assert_msg(sbp_msg_log_text_encoded_len(&last_msg.msg.log) == 43, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_log_text_get(&last_msg.msg.log), "Filtered all obs from 2314 at tow 83.539019") == 0, "String not decoded properly"); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.log.level == 6, + "incorrect value for last_msg.msg.log.level, expected 6, is %d", + last_msg.msg.log.level); + + ck_assert_msg(sbp_msg_log_text_encoded_len(&last_msg.msg.log) == 43, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_log_text_get(&last_msg.msg.log), + "Filtered all obs from 2314 at tow 83.539019") == 0, + "String not decoded properly"); } } END_TEST -Suite* auto_check_sbp_logging_MsgLog_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_logging_MsgLog"); +Suite *auto_check_sbp_logging_MsgLog_suite(void) { + Suite *s = + suite_create("SBP generated test suite: auto_check_sbp_logging_MsgLog"); TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_logging_MsgLog"); tcase_add_test(tc_acq, test_auto_check_sbp_logging_MsgLog); suite_add_tcase(s, tc_acq); diff --git a/c/test/auto_check_sbp_logging_MsgPrintDep.c b/c/test/auto_check_sbp_logging_MsgPrintDep.c index 7b04764be..c2b2802d4 100644 --- a/c/test/auto_check_sbp_logging_MsgPrintDep.c +++ b/c/test/auto_check_sbp_logging_MsgPrintDep.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/logging/test_MsgPrintDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/logging/test_MsgPrintDep.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_logging_MsgPrintDep ) -{ +START_TEST(test_auto_check_sbp_logging_MsgPrintDep) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_logging_MsgPrintDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,50 +90,68 @@ START_TEST( test_auto_check_sbp_logging_MsgPrintDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x10, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x10, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,16,0,34,34,43,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,49,53,32,102,111,117,110,100,32,64,32,45,50,52,57,55,32,72,122,44,32,50,48,32,83,78,82,10,116,103, }; + u8 encoded_frame[] = { + 85, 16, 0, 34, 34, 43, 73, 78, 70, 79, 58, 32, 97, + 99, 113, 58, 32, 80, 82, 78, 32, 49, 53, 32, 102, 111, + 117, 110, 100, 32, 64, 32, 45, 50, 52, 57, 55, 32, 72, + 122, 44, 32, 50, 48, 32, 83, 78, 82, 10, 116, 103, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_print_dep_text_set(&test_msg.print_dep, "INFO: acq: PRN 15 found @ -2497 Hz, 20 SNR\n", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("INFO: acq: PRN 15 found @ -2497 Hz, 20 SNR\n"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&test_msg.print_dep) == 43, "String not encoded properly"); + ck_assert_msg( + sbp_msg_print_dep_text_set( + &test_msg.print_dep, "INFO: acq: PRN 15 found @ -2497 Hz, 20 SNR\n", + false, &written), + "Can't assign text"); + ck_assert_msg( + written == strlen("INFO: acq: PRN 15 found @ -2497 Hz, 20 SNR\n"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&test_msg.print_dep) == 43, + "String not encoded properly"); sbp_message_send(&sbp_state, SbpMsgPrintDep, 8738, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 8738, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPrintDep, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPrintDep, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&last_msg.msg.print_dep) == 43, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_print_dep_text_get(&last_msg.msg.print_dep), "INFO: acq: PRN 15 found @ -2497 Hz, 20 SNR\n") == 0, "String not decoded properly"); + ck_assert_msg( + sbp_msg_print_dep_text_encoded_len(&last_msg.msg.print_dep) == 43, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_print_dep_text_get(&last_msg.msg.print_dep), + "INFO: acq: PRN 15 found @ -2497 Hz, 20 SNR\n") == 0, + "String not decoded properly"); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -145,50 +159,68 @@ START_TEST( test_auto_check_sbp_logging_MsgPrintDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x10, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x10, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,16,0,34,34,42,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,51,49,32,102,111,117,110,100,32,64,32,52,50,52,53,32,72,122,44,32,50,49,32,83,78,82,10,140,43, }; + u8 encoded_frame[] = { + 85, 16, 0, 34, 34, 42, 73, 78, 70, 79, 58, 32, 97, + 99, 113, 58, 32, 80, 82, 78, 32, 51, 49, 32, 102, 111, + 117, 110, 100, 32, 64, 32, 52, 50, 52, 53, 32, 72, 122, + 44, 32, 50, 49, 32, 83, 78, 82, 10, 140, 43, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_print_dep_text_set(&test_msg.print_dep, "INFO: acq: PRN 31 found @ 4245 Hz, 21 SNR\n", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("INFO: acq: PRN 31 found @ 4245 Hz, 21 SNR\n"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&test_msg.print_dep) == 42, "String not encoded properly"); + ck_assert_msg( + sbp_msg_print_dep_text_set( + &test_msg.print_dep, "INFO: acq: PRN 31 found @ 4245 Hz, 21 SNR\n", + false, &written), + "Can't assign text"); + ck_assert_msg( + written == strlen("INFO: acq: PRN 31 found @ 4245 Hz, 21 SNR\n"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&test_msg.print_dep) == 42, + "String not encoded properly"); sbp_message_send(&sbp_state, SbpMsgPrintDep, 8738, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 8738, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPrintDep, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPrintDep, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&last_msg.msg.print_dep) == 42, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_print_dep_text_get(&last_msg.msg.print_dep), "INFO: acq: PRN 31 found @ 4245 Hz, 21 SNR\n") == 0, "String not decoded properly"); + ck_assert_msg( + sbp_msg_print_dep_text_encoded_len(&last_msg.msg.print_dep) == 42, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_print_dep_text_get(&last_msg.msg.print_dep), + "INFO: acq: PRN 31 found @ 4245 Hz, 21 SNR\n") == 0, + "String not decoded properly"); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -196,50 +228,65 @@ START_TEST( test_auto_check_sbp_logging_MsgPrintDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x10, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x10, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,16,0,34,34,35,73,78,70,79,58,32,68,105,115,97,98,108,105,110,103,32,99,104,97,110,110,101,108,32,48,32,40,80,82,78,32,49,49,41,10,23,143, }; + u8 encoded_frame[] = { + 85, 16, 0, 34, 34, 35, 73, 78, 70, 79, 58, 32, 68, 105, 115, + 97, 98, 108, 105, 110, 103, 32, 99, 104, 97, 110, 110, 101, 108, 32, + 48, 32, 40, 80, 82, 78, 32, 49, 49, 41, 10, 23, 143, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_print_dep_text_set(&test_msg.print_dep, "INFO: Disabling channel 0 (PRN 11)\n", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("INFO: Disabling channel 0 (PRN 11)\n"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&test_msg.print_dep) == 35, "String not encoded properly"); + ck_assert_msg(sbp_msg_print_dep_text_set( + &test_msg.print_dep, + "INFO: Disabling channel 0 (PRN 11)\n", false, &written), + "Can't assign text"); + ck_assert_msg(written == strlen("INFO: Disabling channel 0 (PRN 11)\n"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&test_msg.print_dep) == 35, + "String not encoded properly"); sbp_message_send(&sbp_state, SbpMsgPrintDep, 8738, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 8738, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPrintDep, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPrintDep, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&last_msg.msg.print_dep) == 35, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_print_dep_text_get(&last_msg.msg.print_dep), "INFO: Disabling channel 0 (PRN 11)\n") == 0, "String not decoded properly"); + ck_assert_msg( + sbp_msg_print_dep_text_encoded_len(&last_msg.msg.print_dep) == 35, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_print_dep_text_get(&last_msg.msg.print_dep), + "INFO: Disabling channel 0 (PRN 11)\n") == 0, + "String not decoded properly"); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -247,50 +294,68 @@ START_TEST( test_auto_check_sbp_logging_MsgPrintDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x10, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x10, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,16,0,34,34,41,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,50,32,102,111,117,110,100,32,64,32,51,57,57,54,32,72,122,44,32,50,48,32,83,78,82,10,239,48, }; + u8 encoded_frame[] = { + 85, 16, 0, 34, 34, 41, 73, 78, 70, 79, 58, 32, 97, + 99, 113, 58, 32, 80, 82, 78, 32, 50, 32, 102, 111, 117, + 110, 100, 32, 64, 32, 51, 57, 57, 54, 32, 72, 122, 44, + 32, 50, 48, 32, 83, 78, 82, 10, 239, 48, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_print_dep_text_set(&test_msg.print_dep, "INFO: acq: PRN 2 found @ 3996 Hz, 20 SNR\n", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("INFO: acq: PRN 2 found @ 3996 Hz, 20 SNR\n"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&test_msg.print_dep) == 41, "String not encoded properly"); + ck_assert_msg( + sbp_msg_print_dep_text_set(&test_msg.print_dep, + "INFO: acq: PRN 2 found @ 3996 Hz, 20 SNR\n", + false, &written), + "Can't assign text"); + ck_assert_msg( + written == strlen("INFO: acq: PRN 2 found @ 3996 Hz, 20 SNR\n"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&test_msg.print_dep) == 41, + "String not encoded properly"); sbp_message_send(&sbp_state, SbpMsgPrintDep, 8738, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 8738, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPrintDep, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPrintDep, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&last_msg.msg.print_dep) == 41, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_print_dep_text_get(&last_msg.msg.print_dep), "INFO: acq: PRN 2 found @ 3996 Hz, 20 SNR\n") == 0, "String not decoded properly"); + ck_assert_msg( + sbp_msg_print_dep_text_encoded_len(&last_msg.msg.print_dep) == 41, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_print_dep_text_get(&last_msg.msg.print_dep), + "INFO: acq: PRN 2 found @ 3996 Hz, 20 SNR\n") == 0, + "String not decoded properly"); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -298,50 +363,68 @@ START_TEST( test_auto_check_sbp_logging_MsgPrintDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x10, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x10, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,16,0,34,34,42,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,52,32,102,111,117,110,100,32,64,32,45,55,52,57,50,32,72,122,44,32,50,48,32,83,78,82,10,47,248, }; + u8 encoded_frame[] = { + 85, 16, 0, 34, 34, 42, 73, 78, 70, 79, 58, 32, 97, + 99, 113, 58, 32, 80, 82, 78, 32, 52, 32, 102, 111, 117, + 110, 100, 32, 64, 32, 45, 55, 52, 57, 50, 32, 72, 122, + 44, 32, 50, 48, 32, 83, 78, 82, 10, 47, 248, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_print_dep_text_set(&test_msg.print_dep, "INFO: acq: PRN 4 found @ -7492 Hz, 20 SNR\n", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("INFO: acq: PRN 4 found @ -7492 Hz, 20 SNR\n"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&test_msg.print_dep) == 42, "String not encoded properly"); + ck_assert_msg( + sbp_msg_print_dep_text_set( + &test_msg.print_dep, "INFO: acq: PRN 4 found @ -7492 Hz, 20 SNR\n", + false, &written), + "Can't assign text"); + ck_assert_msg( + written == strlen("INFO: acq: PRN 4 found @ -7492 Hz, 20 SNR\n"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&test_msg.print_dep) == 42, + "String not encoded properly"); sbp_message_send(&sbp_state, SbpMsgPrintDep, 8738, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 8738, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPrintDep, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPrintDep, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&last_msg.msg.print_dep) == 42, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_print_dep_text_get(&last_msg.msg.print_dep), "INFO: acq: PRN 4 found @ -7492 Hz, 20 SNR\n") == 0, "String not decoded properly"); + ck_assert_msg( + sbp_msg_print_dep_text_encoded_len(&last_msg.msg.print_dep) == 42, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_print_dep_text_get(&last_msg.msg.print_dep), + "INFO: acq: PRN 4 found @ -7492 Hz, 20 SNR\n") == 0, + "String not decoded properly"); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -349,53 +432,68 @@ START_TEST( test_auto_check_sbp_logging_MsgPrintDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x10, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x10, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,16,0,34,34,35,73,78,70,79,58,32,68,105,115,97,98,108,105,110,103,32,99,104,97,110,110,101,108,32,49,32,40,80,82,78,32,49,53,41,10,158,139, }; + u8 encoded_frame[] = { + 85, 16, 0, 34, 34, 35, 73, 78, 70, 79, 58, 32, 68, 105, 115, + 97, 98, 108, 105, 110, 103, 32, 99, 104, 97, 110, 110, 101, 108, 32, + 49, 32, 40, 80, 82, 78, 32, 49, 53, 41, 10, 158, 139, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_print_dep_text_set(&test_msg.print_dep, "INFO: Disabling channel 1 (PRN 15)\n", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("INFO: Disabling channel 1 (PRN 15)\n"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&test_msg.print_dep) == 35, "String not encoded properly"); + ck_assert_msg(sbp_msg_print_dep_text_set( + &test_msg.print_dep, + "INFO: Disabling channel 1 (PRN 15)\n", false, &written), + "Can't assign text"); + ck_assert_msg(written == strlen("INFO: Disabling channel 1 (PRN 15)\n"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&test_msg.print_dep) == 35, + "String not encoded properly"); sbp_message_send(&sbp_state, SbpMsgPrintDep, 8738, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 8738, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPrintDep, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPrintDep, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_print_dep_text_encoded_len(&last_msg.msg.print_dep) == 35, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_print_dep_text_get(&last_msg.msg.print_dep), "INFO: Disabling channel 1 (PRN 15)\n") == 0, "String not decoded properly"); + ck_assert_msg( + sbp_msg_print_dep_text_encoded_len(&last_msg.msg.print_dep) == 35, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_print_dep_text_get(&last_msg.msg.print_dep), + "INFO: Disabling channel 1 (PRN 15)\n") == 0, + "String not decoded properly"); } } END_TEST -Suite* auto_check_sbp_logging_MsgPrintDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_logging_MsgPrintDep"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_logging_MsgPrintDep"); +Suite *auto_check_sbp_logging_MsgPrintDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_logging_MsgPrintDep"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_logging_MsgPrintDep"); tcase_add_test(tc_acq, test_auto_check_sbp_logging_MsgPrintDep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_mag_MsgMagRaw.c b/c/test/auto_check_sbp_mag_MsgMagRaw.c index 1fdb20901..5192c4c3e 100644 --- a/c/test/auto_check_sbp_mag_MsgMagRaw.c +++ b/c/test/auto_check_sbp_mag_MsgMagRaw.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/mag/test_MsgMagRaw.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/mag/test_MsgMagRaw.yaml by generate.py. Do not +// modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_mag_MsgMagRaw ) -{ +START_TEST(test_auto_check_sbp_mag_MsgMagRaw) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_mag_MsgMagRaw ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,62 +90,82 @@ START_TEST( test_auto_check_sbp_mag_MsgMagRaw ) logging_reset(); - sbp_callback_register(&sbp_state, 0x902, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x902, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,9,195,4,11,173,227,158,198,206,98,3,230,2,110,229,159,23, }; + u8 encoded_frame[] = { + 85, 2, 9, 195, 4, 11, 173, 227, 158, 198, + 206, 98, 3, 230, 2, 110, 229, 159, 23, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.mag_raw.mag_x = 866; - + test_msg.mag_raw.mag_y = 742; - + test_msg.mag_raw.mag_z = -6802; - + test_msg.mag_raw.tow = 3332301741; - + test_msg.mag_raw.tow_f = 206; sbp_message_send(&sbp_state, SbpMsgMagRaw, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgMagRaw, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.mag_raw.mag_x == 866, "incorrect value for last_msg.msg.mag_raw.mag_x, expected 866, is %d", last_msg.msg.mag_raw.mag_x); - - ck_assert_msg(last_msg.msg.mag_raw.mag_y == 742, "incorrect value for last_msg.msg.mag_raw.mag_y, expected 742, is %d", last_msg.msg.mag_raw.mag_y); - - ck_assert_msg(last_msg.msg.mag_raw.mag_z == -6802, "incorrect value for last_msg.msg.mag_raw.mag_z, expected -6802, is %d", last_msg.msg.mag_raw.mag_z); - - ck_assert_msg(last_msg.msg.mag_raw.tow == 3332301741, "incorrect value for last_msg.msg.mag_raw.tow, expected 3332301741, is %d", last_msg.msg.mag_raw.tow); - - ck_assert_msg(last_msg.msg.mag_raw.tow_f == 206, "incorrect value for last_msg.msg.mag_raw.tow_f, expected 206, is %d", last_msg.msg.mag_raw.tow_f); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.mag_raw.mag_x == 866, + "incorrect value for last_msg.msg.mag_raw.mag_x, expected 866, is %d", + last_msg.msg.mag_raw.mag_x); + + ck_assert_msg( + last_msg.msg.mag_raw.mag_y == 742, + "incorrect value for last_msg.msg.mag_raw.mag_y, expected 742, is %d", + last_msg.msg.mag_raw.mag_y); + + ck_assert_msg( + last_msg.msg.mag_raw.mag_z == -6802, + "incorrect value for last_msg.msg.mag_raw.mag_z, expected -6802, is %d", + last_msg.msg.mag_raw.mag_z); + + ck_assert_msg(last_msg.msg.mag_raw.tow == 3332301741, + "incorrect value for last_msg.msg.mag_raw.tow, expected " + "3332301741, is %d", + last_msg.msg.mag_raw.tow); + + ck_assert_msg( + last_msg.msg.mag_raw.tow_f == 206, + "incorrect value for last_msg.msg.mag_raw.tow_f, expected 206, is %d", + last_msg.msg.mag_raw.tow_f); } } END_TEST -Suite* auto_check_sbp_mag_MsgMagRaw_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_mag_MsgMagRaw"); +Suite *auto_check_sbp_mag_MsgMagRaw_suite(void) { + Suite *s = + suite_create("SBP generated test suite: auto_check_sbp_mag_MsgMagRaw"); TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_mag_MsgMagRaw"); tcase_add_test(tc_acq, test_auto_check_sbp_mag_MsgMagRaw); suite_add_tcase(s, tc_acq); diff --git a/c/test/auto_check_sbp_navigation_MsgAgeCorrections.c b/c/test/auto_check_sbp_navigation_MsgAgeCorrections.c index 7d50e90a0..d80c5f9ed 100644 --- a/c/test/auto_check_sbp_navigation_MsgAgeCorrections.c +++ b/c/test/auto_check_sbp_navigation_MsgAgeCorrections.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgAgeCorrections.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgAgeCorrections.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgAgeCorrections ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgAgeCorrections) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgAgeCorrections ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,51 +90,64 @@ START_TEST( test_auto_check_sbp_navigation_MsgAgeCorrections ) logging_reset(); - sbp_callback_register(&sbp_state, 0x210, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x210, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,16,2,66,0,6,100,0,0,0,30,0,233,202, }; + u8 encoded_frame[] = { + 85, 16, 2, 66, 0, 6, 100, 0, 0, 0, 30, 0, 233, 202, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.age_corrections.age = 30; - + test_msg.age_corrections.tow = 100; - sbp_message_send(&sbp_state, SbpMsgAgeCorrections, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAgeCorrections, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAgeCorrections, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAgeCorrections, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.age_corrections.age == 30, "incorrect value for last_msg.msg.age_corrections.age, expected 30, is %d", last_msg.msg.age_corrections.age); - - ck_assert_msg(last_msg.msg.age_corrections.tow == 100, "incorrect value for last_msg.msg.age_corrections.tow, expected 100, is %d", last_msg.msg.age_corrections.tow); + ck_assert_msg(last_msg.msg.age_corrections.age == 30, + "incorrect value for last_msg.msg.age_corrections.age, " + "expected 30, is %d", + last_msg.msg.age_corrections.age); + + ck_assert_msg(last_msg.msg.age_corrections.tow == 100, + "incorrect value for last_msg.msg.age_corrections.tow, " + "expected 100, is %d", + last_msg.msg.age_corrections.tow); } } END_TEST -Suite* auto_check_sbp_navigation_MsgAgeCorrections_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgAgeCorrections"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgAgeCorrections"); +Suite *auto_check_sbp_navigation_MsgAgeCorrections_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgAgeCorrections"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_navigation_MsgAgeCorrections"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgAgeCorrections); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgBaselineECEF.c b/c/test/auto_check_sbp_navigation_MsgBaselineECEF.c index 7b3b5f321..07dab28ae 100644 --- a/c/test/auto_check_sbp_navigation_MsgBaselineECEF.c +++ b/c/test/auto_check_sbp_navigation_MsgBaselineECEF.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEF.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEF ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgBaselineECEF) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEF ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,68 +90,97 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEF ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,11,2,211,136,20,40,244,122,19,150,98,238,255,190,64,20,0,246,163,9,0,0,0,14,0,219,191, }; + u8 encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 40, 244, 122, 19, 150, 98, 238, 255, + 190, 64, 20, 0, 246, 163, 9, 0, 0, 0, 14, 0, 219, 191, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef.accuracy = 0; - + test_msg.baseline_ecef.flags = 0; - + test_msg.baseline_ecef.n_sats = 14; - + test_msg.baseline_ecef.tow = 326825000; - + test_msg.baseline_ecef.x = -1154410; - + test_msg.baseline_ecef.y = 1327294; - + test_msg.baseline_ecef.z = 631798; - sbp_message_send(&sbp_state, SbpMsgBaselineEcef, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcef, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcef, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcef, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef.flags == 0, "incorrect value for last_msg.msg.baseline_ecef.flags, expected 0, is %d", last_msg.msg.baseline_ecef.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef.n_sats == 14, "incorrect value for last_msg.msg.baseline_ecef.n_sats, expected 14, is %d", last_msg.msg.baseline_ecef.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef.tow == 326825000, "incorrect value for last_msg.msg.baseline_ecef.tow, expected 326825000, is %d", last_msg.msg.baseline_ecef.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef.x == -1154410, "incorrect value for last_msg.msg.baseline_ecef.x, expected -1154410, is %d", last_msg.msg.baseline_ecef.x); - - ck_assert_msg(last_msg.msg.baseline_ecef.y == 1327294, "incorrect value for last_msg.msg.baseline_ecef.y, expected 1327294, is %d", last_msg.msg.baseline_ecef.y); - - ck_assert_msg(last_msg.msg.baseline_ecef.z == 631798, "incorrect value for last_msg.msg.baseline_ecef.z, expected 631798, is %d", last_msg.msg.baseline_ecef.z); + ck_assert_msg(last_msg.msg.baseline_ecef.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef.flags == 0, + "incorrect value for last_msg.msg.baseline_ecef.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ecef.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef.n_sats == 14, + "incorrect value for last_msg.msg.baseline_ecef.n_sats, " + "expected 14, is %d", + last_msg.msg.baseline_ecef.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef.tow == 326825000, + "incorrect value for last_msg.msg.baseline_ecef.tow, " + "expected 326825000, is %d", + last_msg.msg.baseline_ecef.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef.x == -1154410, + "incorrect value for last_msg.msg.baseline_ecef.x, expected " + "-1154410, is %d", + last_msg.msg.baseline_ecef.x); + + ck_assert_msg(last_msg.msg.baseline_ecef.y == 1327294, + "incorrect value for last_msg.msg.baseline_ecef.y, expected " + "1327294, is %d", + last_msg.msg.baseline_ecef.y); + + ck_assert_msg(last_msg.msg.baseline_ecef.z == 631798, + "incorrect value for last_msg.msg.baseline_ecef.z, expected " + "631798, is %d", + last_msg.msg.baseline_ecef.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -163,68 +188,97 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEF ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,11,2,211,136,20,16,248,122,19,72,99,238,255,191,65,20,0,138,162,9,0,0,0,15,0,240,78, }; + u8 encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 16, 248, 122, 19, 72, 99, 238, 255, + 191, 65, 20, 0, 138, 162, 9, 0, 0, 0, 15, 0, 240, 78, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef.accuracy = 0; - + test_msg.baseline_ecef.flags = 0; - + test_msg.baseline_ecef.n_sats = 15; - + test_msg.baseline_ecef.tow = 326826000; - + test_msg.baseline_ecef.x = -1154232; - + test_msg.baseline_ecef.y = 1327551; - + test_msg.baseline_ecef.z = 631434; - sbp_message_send(&sbp_state, SbpMsgBaselineEcef, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcef, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcef, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcef, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef.flags == 0, "incorrect value for last_msg.msg.baseline_ecef.flags, expected 0, is %d", last_msg.msg.baseline_ecef.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef.n_sats == 15, "incorrect value for last_msg.msg.baseline_ecef.n_sats, expected 15, is %d", last_msg.msg.baseline_ecef.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef.tow == 326826000, "incorrect value for last_msg.msg.baseline_ecef.tow, expected 326826000, is %d", last_msg.msg.baseline_ecef.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef.x == -1154232, "incorrect value for last_msg.msg.baseline_ecef.x, expected -1154232, is %d", last_msg.msg.baseline_ecef.x); - - ck_assert_msg(last_msg.msg.baseline_ecef.y == 1327551, "incorrect value for last_msg.msg.baseline_ecef.y, expected 1327551, is %d", last_msg.msg.baseline_ecef.y); - - ck_assert_msg(last_msg.msg.baseline_ecef.z == 631434, "incorrect value for last_msg.msg.baseline_ecef.z, expected 631434, is %d", last_msg.msg.baseline_ecef.z); + ck_assert_msg(last_msg.msg.baseline_ecef.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef.flags == 0, + "incorrect value for last_msg.msg.baseline_ecef.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ecef.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef.n_sats == 15, + "incorrect value for last_msg.msg.baseline_ecef.n_sats, " + "expected 15, is %d", + last_msg.msg.baseline_ecef.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef.tow == 326826000, + "incorrect value for last_msg.msg.baseline_ecef.tow, " + "expected 326826000, is %d", + last_msg.msg.baseline_ecef.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef.x == -1154232, + "incorrect value for last_msg.msg.baseline_ecef.x, expected " + "-1154232, is %d", + last_msg.msg.baseline_ecef.x); + + ck_assert_msg(last_msg.msg.baseline_ecef.y == 1327551, + "incorrect value for last_msg.msg.baseline_ecef.y, expected " + "1327551, is %d", + last_msg.msg.baseline_ecef.y); + + ck_assert_msg(last_msg.msg.baseline_ecef.z == 631434, + "incorrect value for last_msg.msg.baseline_ecef.z, expected " + "631434, is %d", + last_msg.msg.baseline_ecef.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -232,68 +286,97 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEF ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,11,2,211,136,20,248,251,122,19,41,99,238,255,181,65,20,0,148,161,9,0,0,0,15,0,4,132, }; + u8 encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 248, 251, 122, 19, 41, 99, 238, 255, + 181, 65, 20, 0, 148, 161, 9, 0, 0, 0, 15, 0, 4, 132, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef.accuracy = 0; - + test_msg.baseline_ecef.flags = 0; - + test_msg.baseline_ecef.n_sats = 15; - + test_msg.baseline_ecef.tow = 326827000; - + test_msg.baseline_ecef.x = -1154263; - + test_msg.baseline_ecef.y = 1327541; - + test_msg.baseline_ecef.z = 631188; - sbp_message_send(&sbp_state, SbpMsgBaselineEcef, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcef, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcef, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcef, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef.flags == 0, "incorrect value for last_msg.msg.baseline_ecef.flags, expected 0, is %d", last_msg.msg.baseline_ecef.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef.n_sats == 15, "incorrect value for last_msg.msg.baseline_ecef.n_sats, expected 15, is %d", last_msg.msg.baseline_ecef.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef.tow == 326827000, "incorrect value for last_msg.msg.baseline_ecef.tow, expected 326827000, is %d", last_msg.msg.baseline_ecef.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef.x == -1154263, "incorrect value for last_msg.msg.baseline_ecef.x, expected -1154263, is %d", last_msg.msg.baseline_ecef.x); - - ck_assert_msg(last_msg.msg.baseline_ecef.y == 1327541, "incorrect value for last_msg.msg.baseline_ecef.y, expected 1327541, is %d", last_msg.msg.baseline_ecef.y); - - ck_assert_msg(last_msg.msg.baseline_ecef.z == 631188, "incorrect value for last_msg.msg.baseline_ecef.z, expected 631188, is %d", last_msg.msg.baseline_ecef.z); + ck_assert_msg(last_msg.msg.baseline_ecef.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef.flags == 0, + "incorrect value for last_msg.msg.baseline_ecef.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ecef.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef.n_sats == 15, + "incorrect value for last_msg.msg.baseline_ecef.n_sats, " + "expected 15, is %d", + last_msg.msg.baseline_ecef.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef.tow == 326827000, + "incorrect value for last_msg.msg.baseline_ecef.tow, " + "expected 326827000, is %d", + last_msg.msg.baseline_ecef.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef.x == -1154263, + "incorrect value for last_msg.msg.baseline_ecef.x, expected " + "-1154263, is %d", + last_msg.msg.baseline_ecef.x); + + ck_assert_msg(last_msg.msg.baseline_ecef.y == 1327541, + "incorrect value for last_msg.msg.baseline_ecef.y, expected " + "1327541, is %d", + last_msg.msg.baseline_ecef.y); + + ck_assert_msg(last_msg.msg.baseline_ecef.z == 631188, + "incorrect value for last_msg.msg.baseline_ecef.z, expected " + "631188, is %d", + last_msg.msg.baseline_ecef.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -301,68 +384,97 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEF ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,11,2,211,136,20,224,255,122,19,188,97,238,255,81,64,20,0,65,160,9,0,0,0,15,0,67,94, }; + u8 encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 224, 255, 122, 19, 188, 97, 238, 255, + 81, 64, 20, 0, 65, 160, 9, 0, 0, 0, 15, 0, 67, 94, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef.accuracy = 0; - + test_msg.baseline_ecef.flags = 0; - + test_msg.baseline_ecef.n_sats = 15; - + test_msg.baseline_ecef.tow = 326828000; - + test_msg.baseline_ecef.x = -1154628; - + test_msg.baseline_ecef.y = 1327185; - + test_msg.baseline_ecef.z = 630849; - sbp_message_send(&sbp_state, SbpMsgBaselineEcef, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcef, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcef, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcef, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef.flags == 0, "incorrect value for last_msg.msg.baseline_ecef.flags, expected 0, is %d", last_msg.msg.baseline_ecef.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef.n_sats == 15, "incorrect value for last_msg.msg.baseline_ecef.n_sats, expected 15, is %d", last_msg.msg.baseline_ecef.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef.tow == 326828000, "incorrect value for last_msg.msg.baseline_ecef.tow, expected 326828000, is %d", last_msg.msg.baseline_ecef.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef.x == -1154628, "incorrect value for last_msg.msg.baseline_ecef.x, expected -1154628, is %d", last_msg.msg.baseline_ecef.x); - - ck_assert_msg(last_msg.msg.baseline_ecef.y == 1327185, "incorrect value for last_msg.msg.baseline_ecef.y, expected 1327185, is %d", last_msg.msg.baseline_ecef.y); - - ck_assert_msg(last_msg.msg.baseline_ecef.z == 630849, "incorrect value for last_msg.msg.baseline_ecef.z, expected 630849, is %d", last_msg.msg.baseline_ecef.z); + ck_assert_msg(last_msg.msg.baseline_ecef.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef.flags == 0, + "incorrect value for last_msg.msg.baseline_ecef.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ecef.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef.n_sats == 15, + "incorrect value for last_msg.msg.baseline_ecef.n_sats, " + "expected 15, is %d", + last_msg.msg.baseline_ecef.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef.tow == 326828000, + "incorrect value for last_msg.msg.baseline_ecef.tow, " + "expected 326828000, is %d", + last_msg.msg.baseline_ecef.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef.x == -1154628, + "incorrect value for last_msg.msg.baseline_ecef.x, expected " + "-1154628, is %d", + last_msg.msg.baseline_ecef.x); + + ck_assert_msg(last_msg.msg.baseline_ecef.y == 1327185, + "incorrect value for last_msg.msg.baseline_ecef.y, expected " + "1327185, is %d", + last_msg.msg.baseline_ecef.y); + + ck_assert_msg(last_msg.msg.baseline_ecef.z == 630849, + "incorrect value for last_msg.msg.baseline_ecef.z, expected " + "630849, is %d", + last_msg.msg.baseline_ecef.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -370,71 +482,100 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEF ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,11,2,211,136,20,200,3,123,19,189,96,238,255,93,63,20,0,98,159,9,0,0,0,15,0,106,94, }; + u8 encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 200, 3, 123, 19, 189, 96, 238, 255, + 93, 63, 20, 0, 98, 159, 9, 0, 0, 0, 15, 0, 106, 94, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef.accuracy = 0; - + test_msg.baseline_ecef.flags = 0; - + test_msg.baseline_ecef.n_sats = 15; - + test_msg.baseline_ecef.tow = 326829000; - + test_msg.baseline_ecef.x = -1154883; - + test_msg.baseline_ecef.y = 1326941; - + test_msg.baseline_ecef.z = 630626; - sbp_message_send(&sbp_state, SbpMsgBaselineEcef, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcef, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcef, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcef, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef.flags == 0, "incorrect value for last_msg.msg.baseline_ecef.flags, expected 0, is %d", last_msg.msg.baseline_ecef.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef.n_sats == 15, "incorrect value for last_msg.msg.baseline_ecef.n_sats, expected 15, is %d", last_msg.msg.baseline_ecef.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef.tow == 326829000, "incorrect value for last_msg.msg.baseline_ecef.tow, expected 326829000, is %d", last_msg.msg.baseline_ecef.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef.x == -1154883, "incorrect value for last_msg.msg.baseline_ecef.x, expected -1154883, is %d", last_msg.msg.baseline_ecef.x); - - ck_assert_msg(last_msg.msg.baseline_ecef.y == 1326941, "incorrect value for last_msg.msg.baseline_ecef.y, expected 1326941, is %d", last_msg.msg.baseline_ecef.y); - - ck_assert_msg(last_msg.msg.baseline_ecef.z == 630626, "incorrect value for last_msg.msg.baseline_ecef.z, expected 630626, is %d", last_msg.msg.baseline_ecef.z); + ck_assert_msg(last_msg.msg.baseline_ecef.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef.flags == 0, + "incorrect value for last_msg.msg.baseline_ecef.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ecef.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef.n_sats == 15, + "incorrect value for last_msg.msg.baseline_ecef.n_sats, " + "expected 15, is %d", + last_msg.msg.baseline_ecef.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef.tow == 326829000, + "incorrect value for last_msg.msg.baseline_ecef.tow, " + "expected 326829000, is %d", + last_msg.msg.baseline_ecef.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef.x == -1154883, + "incorrect value for last_msg.msg.baseline_ecef.x, expected " + "-1154883, is %d", + last_msg.msg.baseline_ecef.x); + + ck_assert_msg(last_msg.msg.baseline_ecef.y == 1326941, + "incorrect value for last_msg.msg.baseline_ecef.y, expected " + "1326941, is %d", + last_msg.msg.baseline_ecef.y); + + ck_assert_msg(last_msg.msg.baseline_ecef.z == 630626, + "incorrect value for last_msg.msg.baseline_ecef.z, expected " + "630626, is %d", + last_msg.msg.baseline_ecef.z); } } END_TEST -Suite* auto_check_sbp_navigation_MsgBaselineECEF_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgBaselineECEF"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgBaselineECEF"); +Suite *auto_check_sbp_navigation_MsgBaselineECEF_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgBaselineECEF"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgBaselineECEF"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgBaselineECEF); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgBaselineECEFDepA.c b/c/test/auto_check_sbp_navigation_MsgBaselineECEFDepA.c index 8286200da..f35880211 100644 --- a/c/test/auto_check_sbp_navigation_MsgBaselineECEFDepA.c +++ b/c/test/auto_check_sbp_navigation_MsgBaselineECEFDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEFDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEFDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEFDepA ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgBaselineECEFDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEFDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,68 +90,98 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,2,246,215,20,20,46,39,0,21,48,255,255,52,117,255,255,216,211,254,255,0,0,9,1,50,137, }; + u8 encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 20, 46, 39, 0, 21, 48, 255, 255, + 52, 117, 255, 255, 216, 211, 254, 255, 0, 0, 9, 1, 50, 137, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef_dep_a.accuracy = 0; - + test_msg.baseline_ecef_dep_a.flags = 1; - + test_msg.baseline_ecef_dep_a.n_sats = 9; - + test_msg.baseline_ecef_dep_a.tow = 2567700; - + test_msg.baseline_ecef_dep_a.x = -53227; - + test_msg.baseline_ecef_dep_a.y = -35532; - + test_msg.baseline_ecef_dep_a.z = -76840; - sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 1, "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, expected 1, is %d", last_msg.msg.baseline_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 9, "incorrect value for last_msg.msg.baseline_ecef_dep_a.n_sats, expected 9, is %d", last_msg.msg.baseline_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 2567700, "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, expected 2567700, is %d", last_msg.msg.baseline_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -53227, "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, expected -53227, is %d", last_msg.msg.baseline_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -35532, "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, expected -35532, is %d", last_msg.msg.baseline_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == -76840, "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, expected -76840, is %d", last_msg.msg.baseline_ecef_dep_a.z); + ck_assert_msg( + last_msg.msg.baseline_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 1, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, " + "expected 1, is %d", + last_msg.msg.baseline_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 9, + "incorrect value for " + "last_msg.msg.baseline_ecef_dep_a.n_sats, expected 9, is %d", + last_msg.msg.baseline_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 2567700, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, " + "expected 2567700, is %d", + last_msg.msg.baseline_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -53227, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, " + "expected -53227, is %d", + last_msg.msg.baseline_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -35532, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, " + "expected -35532, is %d", + last_msg.msg.baseline_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == -76840, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, " + "expected -76840, is %d", + last_msg.msg.baseline_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -163,68 +189,98 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,2,246,215,20,120,46,39,0,58,49,255,255,49,116,255,255,134,211,254,255,0,0,9,1,227,155, }; + u8 encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 120, 46, 39, 0, 58, 49, 255, 255, + 49, 116, 255, 255, 134, 211, 254, 255, 0, 0, 9, 1, 227, 155, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef_dep_a.accuracy = 0; - + test_msg.baseline_ecef_dep_a.flags = 1; - + test_msg.baseline_ecef_dep_a.n_sats = 9; - + test_msg.baseline_ecef_dep_a.tow = 2567800; - + test_msg.baseline_ecef_dep_a.x = -52934; - + test_msg.baseline_ecef_dep_a.y = -35791; - + test_msg.baseline_ecef_dep_a.z = -76922; - sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 1, "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, expected 1, is %d", last_msg.msg.baseline_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 9, "incorrect value for last_msg.msg.baseline_ecef_dep_a.n_sats, expected 9, is %d", last_msg.msg.baseline_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 2567800, "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, expected 2567800, is %d", last_msg.msg.baseline_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -52934, "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, expected -52934, is %d", last_msg.msg.baseline_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -35791, "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, expected -35791, is %d", last_msg.msg.baseline_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == -76922, "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, expected -76922, is %d", last_msg.msg.baseline_ecef_dep_a.z); + ck_assert_msg( + last_msg.msg.baseline_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 1, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, " + "expected 1, is %d", + last_msg.msg.baseline_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 9, + "incorrect value for " + "last_msg.msg.baseline_ecef_dep_a.n_sats, expected 9, is %d", + last_msg.msg.baseline_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 2567800, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, " + "expected 2567800, is %d", + last_msg.msg.baseline_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -52934, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, " + "expected -52934, is %d", + last_msg.msg.baseline_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -35791, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, " + "expected -35791, is %d", + last_msg.msg.baseline_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == -76922, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, " + "expected -76922, is %d", + last_msg.msg.baseline_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -232,68 +288,98 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,2,246,215,20,220,46,39,0,97,50,255,255,47,115,255,255,52,211,254,255,0,0,9,1,61,126, }; + u8 encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 220, 46, 39, 0, 97, 50, 255, 255, + 47, 115, 255, 255, 52, 211, 254, 255, 0, 0, 9, 1, 61, 126, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef_dep_a.accuracy = 0; - + test_msg.baseline_ecef_dep_a.flags = 1; - + test_msg.baseline_ecef_dep_a.n_sats = 9; - + test_msg.baseline_ecef_dep_a.tow = 2567900; - + test_msg.baseline_ecef_dep_a.x = -52639; - + test_msg.baseline_ecef_dep_a.y = -36049; - + test_msg.baseline_ecef_dep_a.z = -77004; - sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 1, "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, expected 1, is %d", last_msg.msg.baseline_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 9, "incorrect value for last_msg.msg.baseline_ecef_dep_a.n_sats, expected 9, is %d", last_msg.msg.baseline_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 2567900, "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, expected 2567900, is %d", last_msg.msg.baseline_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -52639, "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, expected -52639, is %d", last_msg.msg.baseline_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -36049, "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, expected -36049, is %d", last_msg.msg.baseline_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == -77004, "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, expected -77004, is %d", last_msg.msg.baseline_ecef_dep_a.z); + ck_assert_msg( + last_msg.msg.baseline_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 1, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, " + "expected 1, is %d", + last_msg.msg.baseline_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 9, + "incorrect value for " + "last_msg.msg.baseline_ecef_dep_a.n_sats, expected 9, is %d", + last_msg.msg.baseline_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 2567900, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, " + "expected 2567900, is %d", + last_msg.msg.baseline_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -52639, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, " + "expected -52639, is %d", + last_msg.msg.baseline_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -36049, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, " + "expected -36049, is %d", + last_msg.msg.baseline_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == -77004, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, " + "expected -77004, is %d", + last_msg.msg.baseline_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -301,68 +387,98 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,2,246,215,20,64,47,39,0,136,51,255,255,45,114,255,255,228,210,254,255,0,0,9,1,200,79, }; + u8 encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 64, 47, 39, 0, 136, 51, 255, 255, + 45, 114, 255, 255, 228, 210, 254, 255, 0, 0, 9, 1, 200, 79, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef_dep_a.accuracy = 0; - + test_msg.baseline_ecef_dep_a.flags = 1; - + test_msg.baseline_ecef_dep_a.n_sats = 9; - + test_msg.baseline_ecef_dep_a.tow = 2568000; - + test_msg.baseline_ecef_dep_a.x = -52344; - + test_msg.baseline_ecef_dep_a.y = -36307; - + test_msg.baseline_ecef_dep_a.z = -77084; - sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 1, "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, expected 1, is %d", last_msg.msg.baseline_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 9, "incorrect value for last_msg.msg.baseline_ecef_dep_a.n_sats, expected 9, is %d", last_msg.msg.baseline_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 2568000, "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, expected 2568000, is %d", last_msg.msg.baseline_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -52344, "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, expected -52344, is %d", last_msg.msg.baseline_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -36307, "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, expected -36307, is %d", last_msg.msg.baseline_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == -77084, "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, expected -77084, is %d", last_msg.msg.baseline_ecef_dep_a.z); + ck_assert_msg( + last_msg.msg.baseline_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 1, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, " + "expected 1, is %d", + last_msg.msg.baseline_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 9, + "incorrect value for " + "last_msg.msg.baseline_ecef_dep_a.n_sats, expected 9, is %d", + last_msg.msg.baseline_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 2568000, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, " + "expected 2568000, is %d", + last_msg.msg.baseline_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -52344, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, " + "expected -52344, is %d", + last_msg.msg.baseline_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -36307, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, " + "expected -36307, is %d", + last_msg.msg.baseline_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == -77084, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, " + "expected -77084, is %d", + last_msg.msg.baseline_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -370,68 +486,98 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,2,246,215,20,164,47,39,0,176,52,255,255,44,113,255,255,149,210,254,255,0,0,9,1,104,24, }; + u8 encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 164, 47, 39, 0, 176, 52, 255, 255, + 44, 113, 255, 255, 149, 210, 254, 255, 0, 0, 9, 1, 104, 24, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef_dep_a.accuracy = 0; - + test_msg.baseline_ecef_dep_a.flags = 1; - + test_msg.baseline_ecef_dep_a.n_sats = 9; - + test_msg.baseline_ecef_dep_a.tow = 2568100; - + test_msg.baseline_ecef_dep_a.x = -52048; - + test_msg.baseline_ecef_dep_a.y = -36564; - + test_msg.baseline_ecef_dep_a.z = -77163; - sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 1, "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, expected 1, is %d", last_msg.msg.baseline_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 9, "incorrect value for last_msg.msg.baseline_ecef_dep_a.n_sats, expected 9, is %d", last_msg.msg.baseline_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 2568100, "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, expected 2568100, is %d", last_msg.msg.baseline_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -52048, "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, expected -52048, is %d", last_msg.msg.baseline_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -36564, "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, expected -36564, is %d", last_msg.msg.baseline_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == -77163, "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, expected -77163, is %d", last_msg.msg.baseline_ecef_dep_a.z); + ck_assert_msg( + last_msg.msg.baseline_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 1, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, " + "expected 1, is %d", + last_msg.msg.baseline_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 9, + "incorrect value for " + "last_msg.msg.baseline_ecef_dep_a.n_sats, expected 9, is %d", + last_msg.msg.baseline_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 2568100, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, " + "expected 2568100, is %d", + last_msg.msg.baseline_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -52048, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, " + "expected -52048, is %d", + last_msg.msg.baseline_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -36564, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, " + "expected -36564, is %d", + last_msg.msg.baseline_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == -77163, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, " + "expected -77163, is %d", + last_msg.msg.baseline_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -439,68 +585,98 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,2,195,4,20,156,21,69,24,169,231,255,255,102,208,255,255,251,28,0,0,0,0,6,0,146,168, }; + u8 encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 156, 21, 69, 24, 169, 231, 255, 255, + 102, 208, 255, 255, 251, 28, 0, 0, 0, 0, 6, 0, 146, 168, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef_dep_a.accuracy = 0; - + test_msg.baseline_ecef_dep_a.flags = 0; - + test_msg.baseline_ecef_dep_a.n_sats = 6; - + test_msg.baseline_ecef_dep_a.tow = 407180700; - + test_msg.baseline_ecef_dep_a.x = -6231; - + test_msg.baseline_ecef_dep_a.y = -12186; - + test_msg.baseline_ecef_dep_a.z = 7419; - sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 6, "incorrect value for last_msg.msg.baseline_ecef_dep_a.n_sats, expected 6, is %d", last_msg.msg.baseline_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 407180700, "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, expected 407180700, is %d", last_msg.msg.baseline_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -6231, "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, expected -6231, is %d", last_msg.msg.baseline_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -12186, "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, expected -12186, is %d", last_msg.msg.baseline_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == 7419, "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, expected 7419, is %d", last_msg.msg.baseline_ecef_dep_a.z); + ck_assert_msg( + last_msg.msg.baseline_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 6, + "incorrect value for " + "last_msg.msg.baseline_ecef_dep_a.n_sats, expected 6, is %d", + last_msg.msg.baseline_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 407180700, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, " + "expected 407180700, is %d", + last_msg.msg.baseline_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -6231, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, " + "expected -6231, is %d", + last_msg.msg.baseline_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -12186, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, " + "expected -12186, is %d", + last_msg.msg.baseline_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == 7419, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, " + "expected 7419, is %d", + last_msg.msg.baseline_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -508,68 +684,98 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,2,195,4,20,0,22,69,24,169,231,255,255,103,208,255,255,252,28,0,0,0,0,6,0,34,116, }; + u8 encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 0, 22, 69, 24, 169, 231, 255, 255, + 103, 208, 255, 255, 252, 28, 0, 0, 0, 0, 6, 0, 34, 116, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef_dep_a.accuracy = 0; - + test_msg.baseline_ecef_dep_a.flags = 0; - + test_msg.baseline_ecef_dep_a.n_sats = 6; - + test_msg.baseline_ecef_dep_a.tow = 407180800; - + test_msg.baseline_ecef_dep_a.x = -6231; - + test_msg.baseline_ecef_dep_a.y = -12185; - + test_msg.baseline_ecef_dep_a.z = 7420; - sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 6, "incorrect value for last_msg.msg.baseline_ecef_dep_a.n_sats, expected 6, is %d", last_msg.msg.baseline_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 407180800, "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, expected 407180800, is %d", last_msg.msg.baseline_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -6231, "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, expected -6231, is %d", last_msg.msg.baseline_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -12185, "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, expected -12185, is %d", last_msg.msg.baseline_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == 7420, "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, expected 7420, is %d", last_msg.msg.baseline_ecef_dep_a.z); + ck_assert_msg( + last_msg.msg.baseline_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 6, + "incorrect value for " + "last_msg.msg.baseline_ecef_dep_a.n_sats, expected 6, is %d", + last_msg.msg.baseline_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 407180800, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, " + "expected 407180800, is %d", + last_msg.msg.baseline_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -6231, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, " + "expected -6231, is %d", + last_msg.msg.baseline_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -12185, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, " + "expected -12185, is %d", + last_msg.msg.baseline_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == 7420, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, " + "expected 7420, is %d", + last_msg.msg.baseline_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -577,68 +783,98 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,2,195,4,20,100,22,69,24,30,224,255,255,192,183,255,255,239,53,0,0,0,0,6,0,225,15, }; + u8 encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 100, 22, 69, 24, 30, 224, 255, 255, + 192, 183, 255, 255, 239, 53, 0, 0, 0, 0, 6, 0, 225, 15, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef_dep_a.accuracy = 0; - + test_msg.baseline_ecef_dep_a.flags = 0; - + test_msg.baseline_ecef_dep_a.n_sats = 6; - + test_msg.baseline_ecef_dep_a.tow = 407180900; - + test_msg.baseline_ecef_dep_a.x = -8162; - + test_msg.baseline_ecef_dep_a.y = -18496; - + test_msg.baseline_ecef_dep_a.z = 13807; - sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 6, "incorrect value for last_msg.msg.baseline_ecef_dep_a.n_sats, expected 6, is %d", last_msg.msg.baseline_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 407180900, "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, expected 407180900, is %d", last_msg.msg.baseline_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -8162, "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, expected -8162, is %d", last_msg.msg.baseline_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -18496, "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, expected -18496, is %d", last_msg.msg.baseline_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == 13807, "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, expected 13807, is %d", last_msg.msg.baseline_ecef_dep_a.z); + ck_assert_msg( + last_msg.msg.baseline_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 6, + "incorrect value for " + "last_msg.msg.baseline_ecef_dep_a.n_sats, expected 6, is %d", + last_msg.msg.baseline_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 407180900, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, " + "expected 407180900, is %d", + last_msg.msg.baseline_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -8162, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, " + "expected -8162, is %d", + last_msg.msg.baseline_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -18496, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, " + "expected -18496, is %d", + last_msg.msg.baseline_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == 13807, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, " + "expected 13807, is %d", + last_msg.msg.baseline_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -646,68 +882,98 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,2,195,4,20,200,22,69,24,28,224,255,255,191,183,255,255,242,53,0,0,0,0,6,0,35,100, }; + u8 encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 200, 22, 69, 24, 28, 224, 255, 255, + 191, 183, 255, 255, 242, 53, 0, 0, 0, 0, 6, 0, 35, 100, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef_dep_a.accuracy = 0; - + test_msg.baseline_ecef_dep_a.flags = 0; - + test_msg.baseline_ecef_dep_a.n_sats = 6; - + test_msg.baseline_ecef_dep_a.tow = 407181000; - + test_msg.baseline_ecef_dep_a.x = -8164; - + test_msg.baseline_ecef_dep_a.y = -18497; - + test_msg.baseline_ecef_dep_a.z = 13810; - sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 6, "incorrect value for last_msg.msg.baseline_ecef_dep_a.n_sats, expected 6, is %d", last_msg.msg.baseline_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 407181000, "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, expected 407181000, is %d", last_msg.msg.baseline_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -8164, "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, expected -8164, is %d", last_msg.msg.baseline_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -18497, "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, expected -18497, is %d", last_msg.msg.baseline_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == 13810, "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, expected 13810, is %d", last_msg.msg.baseline_ecef_dep_a.z); + ck_assert_msg( + last_msg.msg.baseline_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 6, + "incorrect value for " + "last_msg.msg.baseline_ecef_dep_a.n_sats, expected 6, is %d", + last_msg.msg.baseline_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 407181000, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, " + "expected 407181000, is %d", + last_msg.msg.baseline_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -8164, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, " + "expected -8164, is %d", + last_msg.msg.baseline_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -18497, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, " + "expected -18497, is %d", + last_msg.msg.baseline_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == 13810, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, " + "expected 13810, is %d", + last_msg.msg.baseline_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -715,68 +981,98 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,2,195,4,20,44,23,69,24,24,227,255,255,25,195,255,255,153,59,0,0,0,0,6,0,66,66, }; + u8 encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 44, 23, 69, 24, 24, 227, 255, 255, + 25, 195, 255, 255, 153, 59, 0, 0, 0, 0, 6, 0, 66, 66, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef_dep_a.accuracy = 0; - + test_msg.baseline_ecef_dep_a.flags = 0; - + test_msg.baseline_ecef_dep_a.n_sats = 6; - + test_msg.baseline_ecef_dep_a.tow = 407181100; - + test_msg.baseline_ecef_dep_a.x = -7400; - + test_msg.baseline_ecef_dep_a.y = -15591; - + test_msg.baseline_ecef_dep_a.z = 15257; - sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 6, "incorrect value for last_msg.msg.baseline_ecef_dep_a.n_sats, expected 6, is %d", last_msg.msg.baseline_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 407181100, "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, expected 407181100, is %d", last_msg.msg.baseline_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -7400, "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, expected -7400, is %d", last_msg.msg.baseline_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -15591, "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, expected -15591, is %d", last_msg.msg.baseline_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == 15257, "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, expected 15257, is %d", last_msg.msg.baseline_ecef_dep_a.z); + ck_assert_msg( + last_msg.msg.baseline_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 6, + "incorrect value for " + "last_msg.msg.baseline_ecef_dep_a.n_sats, expected 6, is %d", + last_msg.msg.baseline_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 407181100, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, " + "expected 407181100, is %d", + last_msg.msg.baseline_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -7400, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, " + "expected -7400, is %d", + last_msg.msg.baseline_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -15591, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, " + "expected -15591, is %d", + last_msg.msg.baseline_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == 15257, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, " + "expected 15257, is %d", + last_msg.msg.baseline_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -784,71 +1080,102 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,2,195,4,20,144,23,69,24,23,227,255,255,25,195,255,255,153,59,0,0,0,0,6,0,35,135, }; + u8 encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 144, 23, 69, 24, 23, 227, 255, 255, + 25, 195, 255, 255, 153, 59, 0, 0, 0, 0, 6, 0, 35, 135, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ecef_dep_a.accuracy = 0; - + test_msg.baseline_ecef_dep_a.flags = 0; - + test_msg.baseline_ecef_dep_a.n_sats = 6; - + test_msg.baseline_ecef_dep_a.tow = 407181200; - + test_msg.baseline_ecef_dep_a.x = -7401; - + test_msg.baseline_ecef_dep_a.y = -15591; - + test_msg.baseline_ecef_dep_a.z = 15257; - sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.baseline_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 6, "incorrect value for last_msg.msg.baseline_ecef_dep_a.n_sats, expected 6, is %d", last_msg.msg.baseline_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 407181200, "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, expected 407181200, is %d", last_msg.msg.baseline_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -7401, "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, expected -7401, is %d", last_msg.msg.baseline_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -15591, "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, expected -15591, is %d", last_msg.msg.baseline_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == 15257, "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, expected 15257, is %d", last_msg.msg.baseline_ecef_dep_a.z); + ck_assert_msg( + last_msg.msg.baseline_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.n_sats == 6, + "incorrect value for " + "last_msg.msg.baseline_ecef_dep_a.n_sats, expected 6, is %d", + last_msg.msg.baseline_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.tow == 407181200, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.tow, " + "expected 407181200, is %d", + last_msg.msg.baseline_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.x == -7401, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.x, " + "expected -7401, is %d", + last_msg.msg.baseline_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.y == -15591, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.y, " + "expected -15591, is %d", + last_msg.msg.baseline_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.baseline_ecef_dep_a.z == 15257, + "incorrect value for last_msg.msg.baseline_ecef_dep_a.z, " + "expected 15257, is %d", + last_msg.msg.baseline_ecef_dep_a.z); } } END_TEST -Suite* auto_check_sbp_navigation_MsgBaselineECEFDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgBaselineECEFDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgBaselineECEFDepA"); +Suite *auto_check_sbp_navigation_MsgBaselineECEFDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_navigation_MsgBaselineECEFDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_navigation_MsgBaselineECEFDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgBaselineECEFDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgBaselineHeadingDepA.c b/c/test/auto_check_sbp_navigation_MsgBaselineHeadingDepA.c index 5d356ebb5..1562fb99c 100644 --- a/c/test/auto_check_sbp_navigation_MsgBaselineHeadingDepA.c +++ b/c/test/auto_check_sbp_navigation_MsgBaselineHeadingDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineHeadingDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineHeadingDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgBaselineHeadingDepA ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgBaselineHeadingDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineHeadingDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,59 +90,84 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineHeadingDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x207, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x207, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,7,2,124,206,10,82,109,88,176,68,14,82,203,186,58,173,182, }; + u8 encoded_frame[] = { + 85, 7, 2, 124, 206, 10, 82, 109, 88, + 176, 68, 14, 82, 203, 186, 58, 173, 182, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_heading_dep_a.flags = 58; - + test_msg.baseline_heading_dep_a.heading = 3411152452; - + test_msg.baseline_heading_dep_a.n_sats = 186; - + test_msg.baseline_heading_dep_a.tow = 2958585170; - sbp_message_send(&sbp_state, SbpMsgBaselineHeadingDepA, 52860, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineHeadingDepA, 52860, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 52860, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineHeadingDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_heading_dep_a.flags == 58, "incorrect value for last_msg.msg.baseline_heading_dep_a.flags, expected 58, is %d", last_msg.msg.baseline_heading_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_heading_dep_a.heading == 3411152452, "incorrect value for last_msg.msg.baseline_heading_dep_a.heading, expected 3411152452, is %d", last_msg.msg.baseline_heading_dep_a.heading); - - ck_assert_msg(last_msg.msg.baseline_heading_dep_a.n_sats == 186, "incorrect value for last_msg.msg.baseline_heading_dep_a.n_sats, expected 186, is %d", last_msg.msg.baseline_heading_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_heading_dep_a.tow == 2958585170, "incorrect value for last_msg.msg.baseline_heading_dep_a.tow, expected 2958585170, is %d", last_msg.msg.baseline_heading_dep_a.tow); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgBaselineHeadingDepA, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.baseline_heading_dep_a.flags == 58, + "incorrect value for last_msg.msg.baseline_heading_dep_a.flags, " + "expected 58, is %d", + last_msg.msg.baseline_heading_dep_a.flags); + + ck_assert_msg( + last_msg.msg.baseline_heading_dep_a.heading == 3411152452, + "incorrect value for last_msg.msg.baseline_heading_dep_a.heading, " + "expected 3411152452, is %d", + last_msg.msg.baseline_heading_dep_a.heading); + + ck_assert_msg( + last_msg.msg.baseline_heading_dep_a.n_sats == 186, + "incorrect value for last_msg.msg.baseline_heading_dep_a.n_sats, " + "expected 186, is %d", + last_msg.msg.baseline_heading_dep_a.n_sats); + + ck_assert_msg( + last_msg.msg.baseline_heading_dep_a.tow == 2958585170, + "incorrect value for last_msg.msg.baseline_heading_dep_a.tow, expected " + "2958585170, is %d", + last_msg.msg.baseline_heading_dep_a.tow); } } END_TEST -Suite* auto_check_sbp_navigation_MsgBaselineHeadingDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgBaselineHeadingDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgBaselineHeadingDepA"); +Suite *auto_check_sbp_navigation_MsgBaselineHeadingDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_navigation_MsgBaselineHeadingDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_navigation_MsgBaselineHeadingDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgBaselineHeadingDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgBaselineNED.c b/c/test/auto_check_sbp_navigation_MsgBaselineNED.c index 65b98d40b..a19bc4bd9 100644 --- a/c/test/auto_check_sbp_navigation_MsgBaselineNED.c +++ b/c/test/auto_check_sbp_navigation_MsgBaselineNED.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNED.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNED.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgBaselineNED ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgBaselineNED) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNED ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,72 +90,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNED ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,12,2,211,136,22,40,244,122,19,201,115,12,0,179,88,230,255,153,125,0,0,0,0,0,0,14,0,226,70, }; + u8 encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 40, 244, 122, 19, 201, 115, 12, 0, 179, + 88, 230, 255, 153, 125, 0, 0, 0, 0, 0, 0, 14, 0, 226, 70, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned.d = 32153; - + test_msg.baseline_ned.e = -1681229; - + test_msg.baseline_ned.flags = 0; - + test_msg.baseline_ned.h_accuracy = 0; - + test_msg.baseline_ned.n = 816073; - + test_msg.baseline_ned.n_sats = 14; - + test_msg.baseline_ned.tow = 326825000; - + test_msg.baseline_ned.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNed, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNed, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNed, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNed, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned.d == 32153, "incorrect value for last_msg.msg.baseline_ned.d, expected 32153, is %d", last_msg.msg.baseline_ned.d); - - ck_assert_msg(last_msg.msg.baseline_ned.e == -1681229, "incorrect value for last_msg.msg.baseline_ned.e, expected -1681229, is %d", last_msg.msg.baseline_ned.e); - - ck_assert_msg(last_msg.msg.baseline_ned.flags == 0, "incorrect value for last_msg.msg.baseline_ned.flags, expected 0, is %d", last_msg.msg.baseline_ned.flags); - - ck_assert_msg(last_msg.msg.baseline_ned.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned.n == 816073, "incorrect value for last_msg.msg.baseline_ned.n, expected 816073, is %d", last_msg.msg.baseline_ned.n); - - ck_assert_msg(last_msg.msg.baseline_ned.n_sats == 14, "incorrect value for last_msg.msg.baseline_ned.n_sats, expected 14, is %d", last_msg.msg.baseline_ned.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned.tow == 326825000, "incorrect value for last_msg.msg.baseline_ned.tow, expected 326825000, is %d", last_msg.msg.baseline_ned.tow); - - ck_assert_msg(last_msg.msg.baseline_ned.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned.d == 32153, + "incorrect value for last_msg.msg.baseline_ned.d, expected " + "32153, is %d", + last_msg.msg.baseline_ned.d); + + ck_assert_msg(last_msg.msg.baseline_ned.e == -1681229, + "incorrect value for last_msg.msg.baseline_ned.e, expected " + "-1681229, is %d", + last_msg.msg.baseline_ned.e); + + ck_assert_msg(last_msg.msg.baseline_ned.flags == 0, + "incorrect value for last_msg.msg.baseline_ned.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ned.flags); + + ck_assert_msg(last_msg.msg.baseline_ned.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned.n == 816073, + "incorrect value for last_msg.msg.baseline_ned.n, expected " + "816073, is %d", + last_msg.msg.baseline_ned.n); + + ck_assert_msg(last_msg.msg.baseline_ned.n_sats == 14, + "incorrect value for last_msg.msg.baseline_ned.n_sats, " + "expected 14, is %d", + last_msg.msg.baseline_ned.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned.tow == 326825000, + "incorrect value for last_msg.msg.baseline_ned.tow, expected " + "326825000, is %d", + last_msg.msg.baseline_ned.tow); + + ck_assert_msg(last_msg.msg.baseline_ned.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -167,72 +195,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNED ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,12,2,211,136,22,16,248,122,19,98,115,12,0,194,88,230,255,110,127,0,0,0,0,0,0,15,0,69,93, }; + u8 encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 16, 248, 122, 19, 98, 115, 12, 0, 194, + 88, 230, 255, 110, 127, 0, 0, 0, 0, 0, 0, 15, 0, 69, 93, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned.d = 32622; - + test_msg.baseline_ned.e = -1681214; - + test_msg.baseline_ned.flags = 0; - + test_msg.baseline_ned.h_accuracy = 0; - + test_msg.baseline_ned.n = 815970; - + test_msg.baseline_ned.n_sats = 15; - + test_msg.baseline_ned.tow = 326826000; - + test_msg.baseline_ned.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNed, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNed, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNed, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNed, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned.d == 32622, "incorrect value for last_msg.msg.baseline_ned.d, expected 32622, is %d", last_msg.msg.baseline_ned.d); - - ck_assert_msg(last_msg.msg.baseline_ned.e == -1681214, "incorrect value for last_msg.msg.baseline_ned.e, expected -1681214, is %d", last_msg.msg.baseline_ned.e); - - ck_assert_msg(last_msg.msg.baseline_ned.flags == 0, "incorrect value for last_msg.msg.baseline_ned.flags, expected 0, is %d", last_msg.msg.baseline_ned.flags); - - ck_assert_msg(last_msg.msg.baseline_ned.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned.n == 815970, "incorrect value for last_msg.msg.baseline_ned.n, expected 815970, is %d", last_msg.msg.baseline_ned.n); - - ck_assert_msg(last_msg.msg.baseline_ned.n_sats == 15, "incorrect value for last_msg.msg.baseline_ned.n_sats, expected 15, is %d", last_msg.msg.baseline_ned.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned.tow == 326826000, "incorrect value for last_msg.msg.baseline_ned.tow, expected 326826000, is %d", last_msg.msg.baseline_ned.tow); - - ck_assert_msg(last_msg.msg.baseline_ned.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned.d == 32622, + "incorrect value for last_msg.msg.baseline_ned.d, expected " + "32622, is %d", + last_msg.msg.baseline_ned.d); + + ck_assert_msg(last_msg.msg.baseline_ned.e == -1681214, + "incorrect value for last_msg.msg.baseline_ned.e, expected " + "-1681214, is %d", + last_msg.msg.baseline_ned.e); + + ck_assert_msg(last_msg.msg.baseline_ned.flags == 0, + "incorrect value for last_msg.msg.baseline_ned.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ned.flags); + + ck_assert_msg(last_msg.msg.baseline_ned.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned.n == 815970, + "incorrect value for last_msg.msg.baseline_ned.n, expected " + "815970, is %d", + last_msg.msg.baseline_ned.n); + + ck_assert_msg(last_msg.msg.baseline_ned.n_sats == 15, + "incorrect value for last_msg.msg.baseline_ned.n_sats, " + "expected 15, is %d", + last_msg.msg.baseline_ned.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned.tow == 326826000, + "incorrect value for last_msg.msg.baseline_ned.tow, expected " + "326826000, is %d", + last_msg.msg.baseline_ned.tow); + + ck_assert_msg(last_msg.msg.baseline_ned.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -240,72 +300,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNED ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,12,2,211,136,22,248,251,122,19,143,114,12,0,173,88,230,255,238,127,0,0,0,0,0,0,15,0,210,169, }; + u8 encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 248, 251, 122, 19, 143, 114, 12, 0, 173, + 88, 230, 255, 238, 127, 0, 0, 0, 0, 0, 0, 15, 0, 210, 169, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned.d = 32750; - + test_msg.baseline_ned.e = -1681235; - + test_msg.baseline_ned.flags = 0; - + test_msg.baseline_ned.h_accuracy = 0; - + test_msg.baseline_ned.n = 815759; - + test_msg.baseline_ned.n_sats = 15; - + test_msg.baseline_ned.tow = 326827000; - + test_msg.baseline_ned.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNed, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNed, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNed, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNed, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned.d == 32750, "incorrect value for last_msg.msg.baseline_ned.d, expected 32750, is %d", last_msg.msg.baseline_ned.d); - - ck_assert_msg(last_msg.msg.baseline_ned.e == -1681235, "incorrect value for last_msg.msg.baseline_ned.e, expected -1681235, is %d", last_msg.msg.baseline_ned.e); - - ck_assert_msg(last_msg.msg.baseline_ned.flags == 0, "incorrect value for last_msg.msg.baseline_ned.flags, expected 0, is %d", last_msg.msg.baseline_ned.flags); - - ck_assert_msg(last_msg.msg.baseline_ned.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned.n == 815759, "incorrect value for last_msg.msg.baseline_ned.n, expected 815759, is %d", last_msg.msg.baseline_ned.n); - - ck_assert_msg(last_msg.msg.baseline_ned.n_sats == 15, "incorrect value for last_msg.msg.baseline_ned.n_sats, expected 15, is %d", last_msg.msg.baseline_ned.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned.tow == 326827000, "incorrect value for last_msg.msg.baseline_ned.tow, expected 326827000, is %d", last_msg.msg.baseline_ned.tow); - - ck_assert_msg(last_msg.msg.baseline_ned.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned.d == 32750, + "incorrect value for last_msg.msg.baseline_ned.d, expected " + "32750, is %d", + last_msg.msg.baseline_ned.d); + + ck_assert_msg(last_msg.msg.baseline_ned.e == -1681235, + "incorrect value for last_msg.msg.baseline_ned.e, expected " + "-1681235, is %d", + last_msg.msg.baseline_ned.e); + + ck_assert_msg(last_msg.msg.baseline_ned.flags == 0, + "incorrect value for last_msg.msg.baseline_ned.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ned.flags); + + ck_assert_msg(last_msg.msg.baseline_ned.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned.n == 815759, + "incorrect value for last_msg.msg.baseline_ned.n, expected " + "815759, is %d", + last_msg.msg.baseline_ned.n); + + ck_assert_msg(last_msg.msg.baseline_ned.n_sats == 15, + "incorrect value for last_msg.msg.baseline_ned.n_sats, " + "expected 15, is %d", + last_msg.msg.baseline_ned.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned.tow == 326827000, + "incorrect value for last_msg.msg.baseline_ned.tow, expected " + "326827000, is %d", + last_msg.msg.baseline_ned.tow); + + ck_assert_msg(last_msg.msg.baseline_ned.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -313,72 +405,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNED ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,12,2,211,136,22,224,255,122,19,86,112,12,0,51,88,230,255,47,127,0,0,0,0,0,0,15,0,135,107, }; + u8 encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 224, 255, 122, 19, 86, 112, 12, 0, 51, + 88, 230, 255, 47, 127, 0, 0, 0, 0, 0, 0, 15, 0, 135, 107, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned.d = 32559; - + test_msg.baseline_ned.e = -1681357; - + test_msg.baseline_ned.flags = 0; - + test_msg.baseline_ned.h_accuracy = 0; - + test_msg.baseline_ned.n = 815190; - + test_msg.baseline_ned.n_sats = 15; - + test_msg.baseline_ned.tow = 326828000; - + test_msg.baseline_ned.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNed, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNed, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNed, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNed, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned.d == 32559, "incorrect value for last_msg.msg.baseline_ned.d, expected 32559, is %d", last_msg.msg.baseline_ned.d); - - ck_assert_msg(last_msg.msg.baseline_ned.e == -1681357, "incorrect value for last_msg.msg.baseline_ned.e, expected -1681357, is %d", last_msg.msg.baseline_ned.e); - - ck_assert_msg(last_msg.msg.baseline_ned.flags == 0, "incorrect value for last_msg.msg.baseline_ned.flags, expected 0, is %d", last_msg.msg.baseline_ned.flags); - - ck_assert_msg(last_msg.msg.baseline_ned.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned.n == 815190, "incorrect value for last_msg.msg.baseline_ned.n, expected 815190, is %d", last_msg.msg.baseline_ned.n); - - ck_assert_msg(last_msg.msg.baseline_ned.n_sats == 15, "incorrect value for last_msg.msg.baseline_ned.n_sats, expected 15, is %d", last_msg.msg.baseline_ned.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned.tow == 326828000, "incorrect value for last_msg.msg.baseline_ned.tow, expected 326828000, is %d", last_msg.msg.baseline_ned.tow); - - ck_assert_msg(last_msg.msg.baseline_ned.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned.d == 32559, + "incorrect value for last_msg.msg.baseline_ned.d, expected " + "32559, is %d", + last_msg.msg.baseline_ned.d); + + ck_assert_msg(last_msg.msg.baseline_ned.e == -1681357, + "incorrect value for last_msg.msg.baseline_ned.e, expected " + "-1681357, is %d", + last_msg.msg.baseline_ned.e); + + ck_assert_msg(last_msg.msg.baseline_ned.flags == 0, + "incorrect value for last_msg.msg.baseline_ned.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ned.flags); + + ck_assert_msg(last_msg.msg.baseline_ned.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned.n == 815190, + "incorrect value for last_msg.msg.baseline_ned.n, expected " + "815190, is %d", + last_msg.msg.baseline_ned.n); + + ck_assert_msg(last_msg.msg.baseline_ned.n_sats == 15, + "incorrect value for last_msg.msg.baseline_ned.n_sats, " + "expected 15, is %d", + last_msg.msg.baseline_ned.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned.tow == 326828000, + "incorrect value for last_msg.msg.baseline_ned.tow, expected " + "326828000, is %d", + last_msg.msg.baseline_ned.tow); + + ck_assert_msg(last_msg.msg.baseline_ned.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -386,75 +510,107 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNED ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,12,2,211,136,22,200,3,123,19,214,110,12,0,220,87,230,255,165,126,0,0,0,0,0,0,15,0,190,80, }; + u8 encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 200, 3, 123, 19, 214, 110, 12, 0, 220, + 87, 230, 255, 165, 126, 0, 0, 0, 0, 0, 0, 15, 0, 190, 80, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned.d = 32421; - + test_msg.baseline_ned.e = -1681444; - + test_msg.baseline_ned.flags = 0; - + test_msg.baseline_ned.h_accuracy = 0; - + test_msg.baseline_ned.n = 814806; - + test_msg.baseline_ned.n_sats = 15; - + test_msg.baseline_ned.tow = 326829000; - + test_msg.baseline_ned.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNed, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNed, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNed, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNed, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned.d == 32421, "incorrect value for last_msg.msg.baseline_ned.d, expected 32421, is %d", last_msg.msg.baseline_ned.d); - - ck_assert_msg(last_msg.msg.baseline_ned.e == -1681444, "incorrect value for last_msg.msg.baseline_ned.e, expected -1681444, is %d", last_msg.msg.baseline_ned.e); - - ck_assert_msg(last_msg.msg.baseline_ned.flags == 0, "incorrect value for last_msg.msg.baseline_ned.flags, expected 0, is %d", last_msg.msg.baseline_ned.flags); - - ck_assert_msg(last_msg.msg.baseline_ned.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned.n == 814806, "incorrect value for last_msg.msg.baseline_ned.n, expected 814806, is %d", last_msg.msg.baseline_ned.n); - - ck_assert_msg(last_msg.msg.baseline_ned.n_sats == 15, "incorrect value for last_msg.msg.baseline_ned.n_sats, expected 15, is %d", last_msg.msg.baseline_ned.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned.tow == 326829000, "incorrect value for last_msg.msg.baseline_ned.tow, expected 326829000, is %d", last_msg.msg.baseline_ned.tow); - - ck_assert_msg(last_msg.msg.baseline_ned.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned.d == 32421, + "incorrect value for last_msg.msg.baseline_ned.d, expected " + "32421, is %d", + last_msg.msg.baseline_ned.d); + + ck_assert_msg(last_msg.msg.baseline_ned.e == -1681444, + "incorrect value for last_msg.msg.baseline_ned.e, expected " + "-1681444, is %d", + last_msg.msg.baseline_ned.e); + + ck_assert_msg(last_msg.msg.baseline_ned.flags == 0, + "incorrect value for last_msg.msg.baseline_ned.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ned.flags); + + ck_assert_msg(last_msg.msg.baseline_ned.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned.n == 814806, + "incorrect value for last_msg.msg.baseline_ned.n, expected " + "814806, is %d", + last_msg.msg.baseline_ned.n); + + ck_assert_msg(last_msg.msg.baseline_ned.n_sats == 15, + "incorrect value for last_msg.msg.baseline_ned.n_sats, " + "expected 15, is %d", + last_msg.msg.baseline_ned.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned.tow == 326829000, + "incorrect value for last_msg.msg.baseline_ned.tow, expected " + "326829000, is %d", + last_msg.msg.baseline_ned.tow); + + ck_assert_msg(last_msg.msg.baseline_ned.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned.v_accuracy); } } END_TEST -Suite* auto_check_sbp_navigation_MsgBaselineNED_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgBaselineNED"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgBaselineNED"); +Suite *auto_check_sbp_navigation_MsgBaselineNED_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgBaselineNED"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgBaselineNED"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgBaselineNED); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgBaselineNEDDepA.c b/c/test/auto_check_sbp_navigation_MsgBaselineNEDDepA.c index 83bf10b9e..b36d047fe 100644 --- a/c/test/auto_check_sbp_navigation_MsgBaselineNEDDepA.c +++ b/c/test/auto_check_sbp_navigation_MsgBaselineNEDDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNEDDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNEDDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgBaselineNEDDepA ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgBaselineNEDDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNEDDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,72 +90,106 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,2,246,215,22,20,46,39,0,243,134,254,255,234,153,255,255,0,0,0,0,0,0,0,0,9,1,93,193, }; + u8 encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 20, 46, 39, 0, 243, 134, 254, 255, 234, + 153, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 93, 193, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned_dep_a.d = 0; - + test_msg.baseline_ned_dep_a.e = -26134; - + test_msg.baseline_ned_dep_a.flags = 1; - + test_msg.baseline_ned_dep_a.h_accuracy = 0; - + test_msg.baseline_ned_dep_a.n = -96525; - + test_msg.baseline_ned_dep_a.n_sats = 9; - + test_msg.baseline_ned_dep_a.tow = 2567700; - + test_msg.baseline_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.d, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == -26134, "incorrect value for last_msg.msg.baseline_ned_dep_a.e, expected -26134, is %d", last_msg.msg.baseline_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 1, "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, expected 1, is %d", last_msg.msg.baseline_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -96525, "incorrect value for last_msg.msg.baseline_ned_dep_a.n, expected -96525, is %d", last_msg.msg.baseline_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 9, "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, expected 9, is %d", last_msg.msg.baseline_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 2567700, "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, expected 2567700, is %d", last_msg.msg.baseline_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.d, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == -26134, + "incorrect value for last_msg.msg.baseline_ned_dep_a.e, " + "expected -26134, is %d", + last_msg.msg.baseline_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 1, + "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, " + "expected 1, is %d", + last_msg.msg.baseline_ned_dep_a.flags); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -96525, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n, " + "expected -96525, is %d", + last_msg.msg.baseline_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.baseline_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 2567700, + "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, " + "expected 2567700, is %d", + last_msg.msg.baseline_ned_dep_a.tow); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -167,72 +197,106 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,2,246,215,22,120,46,39,0,139,134,254,255,109,155,255,255,0,0,0,0,0,0,0,0,9,1,38,39, }; + u8 encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 120, 46, 39, 0, 139, 134, 254, 255, 109, + 155, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 38, 39, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned_dep_a.d = 0; - + test_msg.baseline_ned_dep_a.e = -25747; - + test_msg.baseline_ned_dep_a.flags = 1; - + test_msg.baseline_ned_dep_a.h_accuracy = 0; - + test_msg.baseline_ned_dep_a.n = -96629; - + test_msg.baseline_ned_dep_a.n_sats = 9; - + test_msg.baseline_ned_dep_a.tow = 2567800; - + test_msg.baseline_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.d, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == -25747, "incorrect value for last_msg.msg.baseline_ned_dep_a.e, expected -25747, is %d", last_msg.msg.baseline_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 1, "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, expected 1, is %d", last_msg.msg.baseline_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -96629, "incorrect value for last_msg.msg.baseline_ned_dep_a.n, expected -96629, is %d", last_msg.msg.baseline_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 9, "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, expected 9, is %d", last_msg.msg.baseline_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 2567800, "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, expected 2567800, is %d", last_msg.msg.baseline_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.d, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == -25747, + "incorrect value for last_msg.msg.baseline_ned_dep_a.e, " + "expected -25747, is %d", + last_msg.msg.baseline_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 1, + "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, " + "expected 1, is %d", + last_msg.msg.baseline_ned_dep_a.flags); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -96629, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n, " + "expected -96629, is %d", + last_msg.msg.baseline_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.baseline_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 2567800, + "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, " + "expected 2567800, is %d", + last_msg.msg.baseline_ned_dep_a.tow); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -240,72 +304,106 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,2,246,215,22,220,46,39,0,37,134,254,255,240,156,255,255,0,0,0,0,0,0,0,0,9,1,58,133, }; + u8 encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 220, 46, 39, 0, 37, 134, 254, 255, 240, + 156, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 58, 133, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned_dep_a.d = 0; - + test_msg.baseline_ned_dep_a.e = -25360; - + test_msg.baseline_ned_dep_a.flags = 1; - + test_msg.baseline_ned_dep_a.h_accuracy = 0; - + test_msg.baseline_ned_dep_a.n = -96731; - + test_msg.baseline_ned_dep_a.n_sats = 9; - + test_msg.baseline_ned_dep_a.tow = 2567900; - + test_msg.baseline_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.d, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == -25360, "incorrect value for last_msg.msg.baseline_ned_dep_a.e, expected -25360, is %d", last_msg.msg.baseline_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 1, "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, expected 1, is %d", last_msg.msg.baseline_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -96731, "incorrect value for last_msg.msg.baseline_ned_dep_a.n, expected -96731, is %d", last_msg.msg.baseline_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 9, "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, expected 9, is %d", last_msg.msg.baseline_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 2567900, "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, expected 2567900, is %d", last_msg.msg.baseline_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.d, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == -25360, + "incorrect value for last_msg.msg.baseline_ned_dep_a.e, " + "expected -25360, is %d", + last_msg.msg.baseline_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 1, + "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, " + "expected 1, is %d", + last_msg.msg.baseline_ned_dep_a.flags); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -96731, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n, " + "expected -96731, is %d", + last_msg.msg.baseline_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.baseline_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 2567900, + "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, " + "expected 2567900, is %d", + last_msg.msg.baseline_ned_dep_a.tow); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -313,72 +411,106 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,2,246,215,22,64,47,39,0,193,133,254,255,115,158,255,255,0,0,0,0,0,0,0,0,9,1,56,214, }; + u8 encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 64, 47, 39, 0, 193, 133, 254, 255, 115, + 158, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 56, 214, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned_dep_a.d = 0; - + test_msg.baseline_ned_dep_a.e = -24973; - + test_msg.baseline_ned_dep_a.flags = 1; - + test_msg.baseline_ned_dep_a.h_accuracy = 0; - + test_msg.baseline_ned_dep_a.n = -96831; - + test_msg.baseline_ned_dep_a.n_sats = 9; - + test_msg.baseline_ned_dep_a.tow = 2568000; - + test_msg.baseline_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.d, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == -24973, "incorrect value for last_msg.msg.baseline_ned_dep_a.e, expected -24973, is %d", last_msg.msg.baseline_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 1, "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, expected 1, is %d", last_msg.msg.baseline_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -96831, "incorrect value for last_msg.msg.baseline_ned_dep_a.n, expected -96831, is %d", last_msg.msg.baseline_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 9, "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, expected 9, is %d", last_msg.msg.baseline_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 2568000, "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, expected 2568000, is %d", last_msg.msg.baseline_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.d, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == -24973, + "incorrect value for last_msg.msg.baseline_ned_dep_a.e, " + "expected -24973, is %d", + last_msg.msg.baseline_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 1, + "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, " + "expected 1, is %d", + last_msg.msg.baseline_ned_dep_a.flags); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -96831, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n, " + "expected -96831, is %d", + last_msg.msg.baseline_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.baseline_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 2568000, + "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, " + "expected 2568000, is %d", + last_msg.msg.baseline_ned_dep_a.tow); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -386,72 +518,106 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,2,246,215,22,164,47,39,0,93,133,254,255,246,159,255,255,0,0,0,0,0,0,0,0,9,1,234,244, }; + u8 encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 164, 47, 39, 0, 93, 133, 254, 255, 246, + 159, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 234, 244, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned_dep_a.d = 0; - + test_msg.baseline_ned_dep_a.e = -24586; - + test_msg.baseline_ned_dep_a.flags = 1; - + test_msg.baseline_ned_dep_a.h_accuracy = 0; - + test_msg.baseline_ned_dep_a.n = -96931; - + test_msg.baseline_ned_dep_a.n_sats = 9; - + test_msg.baseline_ned_dep_a.tow = 2568100; - + test_msg.baseline_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.d, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == -24586, "incorrect value for last_msg.msg.baseline_ned_dep_a.e, expected -24586, is %d", last_msg.msg.baseline_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 1, "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, expected 1, is %d", last_msg.msg.baseline_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -96931, "incorrect value for last_msg.msg.baseline_ned_dep_a.n, expected -96931, is %d", last_msg.msg.baseline_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 9, "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, expected 9, is %d", last_msg.msg.baseline_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 2568100, "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, expected 2568100, is %d", last_msg.msg.baseline_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.d, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == -24586, + "incorrect value for last_msg.msg.baseline_ned_dep_a.e, " + "expected -24586, is %d", + last_msg.msg.baseline_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 1, + "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, " + "expected 1, is %d", + last_msg.msg.baseline_ned_dep_a.flags); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -96931, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n, " + "expected -96931, is %d", + last_msg.msg.baseline_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.baseline_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 2568100, + "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, " + "expected 2568100, is %d", + last_msg.msg.baseline_ned_dep_a.tow); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -459,72 +625,106 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,2,195,4,22,156,21,69,24,130,246,255,255,241,4,0,0,35,196,255,255,0,0,0,0,6,0,250,21, }; + u8 encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 156, 21, 69, 24, 130, 246, 255, 255, 241, + 4, 0, 0, 35, 196, 255, 255, 0, 0, 0, 0, 6, 0, 250, 21, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned_dep_a.d = -15325; - + test_msg.baseline_ned_dep_a.e = 1265; - + test_msg.baseline_ned_dep_a.flags = 0; - + test_msg.baseline_ned_dep_a.h_accuracy = 0; - + test_msg.baseline_ned_dep_a.n = -2430; - + test_msg.baseline_ned_dep_a.n_sats = 6; - + test_msg.baseline_ned_dep_a.tow = 407180700; - + test_msg.baseline_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == -15325, "incorrect value for last_msg.msg.baseline_ned_dep_a.d, expected -15325, is %d", last_msg.msg.baseline_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == 1265, "incorrect value for last_msg.msg.baseline_ned_dep_a.e, expected 1265, is %d", last_msg.msg.baseline_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -2430, "incorrect value for last_msg.msg.baseline_ned_dep_a.n, expected -2430, is %d", last_msg.msg.baseline_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 6, "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, expected 6, is %d", last_msg.msg.baseline_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 407180700, "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, expected 407180700, is %d", last_msg.msg.baseline_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == -15325, + "incorrect value for last_msg.msg.baseline_ned_dep_a.d, " + "expected -15325, is %d", + last_msg.msg.baseline_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == 1265, + "incorrect value for last_msg.msg.baseline_ned_dep_a.e, " + "expected 1265, is %d", + last_msg.msg.baseline_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.flags); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -2430, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n, " + "expected -2430, is %d", + last_msg.msg.baseline_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 6, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, " + "expected 6, is %d", + last_msg.msg.baseline_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 407180700, + "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, " + "expected 407180700, is %d", + last_msg.msg.baseline_ned_dep_a.tow); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -532,72 +732,106 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,2,195,4,22,0,22,69,24,130,246,255,255,241,4,0,0,35,196,255,255,0,0,0,0,6,0,240,133, }; + u8 encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 0, 22, 69, 24, 130, 246, 255, 255, 241, + 4, 0, 0, 35, 196, 255, 255, 0, 0, 0, 0, 6, 0, 240, 133, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned_dep_a.d = -15325; - + test_msg.baseline_ned_dep_a.e = 1265; - + test_msg.baseline_ned_dep_a.flags = 0; - + test_msg.baseline_ned_dep_a.h_accuracy = 0; - + test_msg.baseline_ned_dep_a.n = -2430; - + test_msg.baseline_ned_dep_a.n_sats = 6; - + test_msg.baseline_ned_dep_a.tow = 407180800; - + test_msg.baseline_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == -15325, "incorrect value for last_msg.msg.baseline_ned_dep_a.d, expected -15325, is %d", last_msg.msg.baseline_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == 1265, "incorrect value for last_msg.msg.baseline_ned_dep_a.e, expected 1265, is %d", last_msg.msg.baseline_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -2430, "incorrect value for last_msg.msg.baseline_ned_dep_a.n, expected -2430, is %d", last_msg.msg.baseline_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 6, "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, expected 6, is %d", last_msg.msg.baseline_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 407180800, "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, expected 407180800, is %d", last_msg.msg.baseline_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == -15325, + "incorrect value for last_msg.msg.baseline_ned_dep_a.d, " + "expected -15325, is %d", + last_msg.msg.baseline_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == 1265, + "incorrect value for last_msg.msg.baseline_ned_dep_a.e, " + "expected 1265, is %d", + last_msg.msg.baseline_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.flags); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -2430, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n, " + "expected -2430, is %d", + last_msg.msg.baseline_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 6, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, " + "expected 6, is %d", + last_msg.msg.baseline_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 407180800, + "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, " + "expected 407180800, is %d", + last_msg.msg.baseline_ned_dep_a.tow); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -605,72 +839,106 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,2,195,4,22,100,22,69,24,32,251,255,255,199,11,0,0,57,161,255,255,0,0,0,0,6,0,12,181, }; + u8 encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 100, 22, 69, 24, 32, 251, 255, 255, 199, + 11, 0, 0, 57, 161, 255, 255, 0, 0, 0, 0, 6, 0, 12, 181, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned_dep_a.d = -24263; - + test_msg.baseline_ned_dep_a.e = 3015; - + test_msg.baseline_ned_dep_a.flags = 0; - + test_msg.baseline_ned_dep_a.h_accuracy = 0; - + test_msg.baseline_ned_dep_a.n = -1248; - + test_msg.baseline_ned_dep_a.n_sats = 6; - + test_msg.baseline_ned_dep_a.tow = 407180900; - + test_msg.baseline_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == -24263, "incorrect value for last_msg.msg.baseline_ned_dep_a.d, expected -24263, is %d", last_msg.msg.baseline_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == 3015, "incorrect value for last_msg.msg.baseline_ned_dep_a.e, expected 3015, is %d", last_msg.msg.baseline_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -1248, "incorrect value for last_msg.msg.baseline_ned_dep_a.n, expected -1248, is %d", last_msg.msg.baseline_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 6, "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, expected 6, is %d", last_msg.msg.baseline_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 407180900, "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, expected 407180900, is %d", last_msg.msg.baseline_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == -24263, + "incorrect value for last_msg.msg.baseline_ned_dep_a.d, " + "expected -24263, is %d", + last_msg.msg.baseline_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == 3015, + "incorrect value for last_msg.msg.baseline_ned_dep_a.e, " + "expected 3015, is %d", + last_msg.msg.baseline_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.flags); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -1248, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n, " + "expected -1248, is %d", + last_msg.msg.baseline_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 6, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, " + "expected 6, is %d", + last_msg.msg.baseline_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 407180900, + "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, " + "expected 407180900, is %d", + last_msg.msg.baseline_ned_dep_a.tow); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -678,72 +946,106 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,2,195,4,22,200,22,69,24,33,251,255,255,199,11,0,0,54,161,255,255,0,0,0,0,6,0,86,58, }; + u8 encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 200, 22, 69, 24, 33, 251, 255, 255, 199, + 11, 0, 0, 54, 161, 255, 255, 0, 0, 0, 0, 6, 0, 86, 58, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned_dep_a.d = -24266; - + test_msg.baseline_ned_dep_a.e = 3015; - + test_msg.baseline_ned_dep_a.flags = 0; - + test_msg.baseline_ned_dep_a.h_accuracy = 0; - + test_msg.baseline_ned_dep_a.n = -1247; - + test_msg.baseline_ned_dep_a.n_sats = 6; - + test_msg.baseline_ned_dep_a.tow = 407181000; - + test_msg.baseline_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == -24266, "incorrect value for last_msg.msg.baseline_ned_dep_a.d, expected -24266, is %d", last_msg.msg.baseline_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == 3015, "incorrect value for last_msg.msg.baseline_ned_dep_a.e, expected 3015, is %d", last_msg.msg.baseline_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -1247, "incorrect value for last_msg.msg.baseline_ned_dep_a.n, expected -1247, is %d", last_msg.msg.baseline_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 6, "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, expected 6, is %d", last_msg.msg.baseline_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 407181000, "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, expected 407181000, is %d", last_msg.msg.baseline_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == -24266, + "incorrect value for last_msg.msg.baseline_ned_dep_a.d, " + "expected -24266, is %d", + last_msg.msg.baseline_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == 3015, + "incorrect value for last_msg.msg.baseline_ned_dep_a.e, " + "expected 3015, is %d", + last_msg.msg.baseline_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.flags); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == -1247, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n, " + "expected -1247, is %d", + last_msg.msg.baseline_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 6, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, " + "expected 6, is %d", + last_msg.msg.baseline_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 407181000, + "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, " + "expected 407181000, is %d", + last_msg.msg.baseline_ned_dep_a.tow); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -751,72 +1053,106 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,2,195,4,22,44,23,69,24,110,6,0,0,55,8,0,0,160,166,255,255,0,0,0,0,6,0,51,249, }; + u8 encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 44, 23, 69, 24, 110, 6, 0, 0, 55, + 8, 0, 0, 160, 166, 255, 255, 0, 0, 0, 0, 6, 0, 51, 249, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned_dep_a.d = -22880; - + test_msg.baseline_ned_dep_a.e = 2103; - + test_msg.baseline_ned_dep_a.flags = 0; - + test_msg.baseline_ned_dep_a.h_accuracy = 0; - + test_msg.baseline_ned_dep_a.n = 1646; - + test_msg.baseline_ned_dep_a.n_sats = 6; - + test_msg.baseline_ned_dep_a.tow = 407181100; - + test_msg.baseline_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == -22880, "incorrect value for last_msg.msg.baseline_ned_dep_a.d, expected -22880, is %d", last_msg.msg.baseline_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == 2103, "incorrect value for last_msg.msg.baseline_ned_dep_a.e, expected 2103, is %d", last_msg.msg.baseline_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == 1646, "incorrect value for last_msg.msg.baseline_ned_dep_a.n, expected 1646, is %d", last_msg.msg.baseline_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 6, "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, expected 6, is %d", last_msg.msg.baseline_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 407181100, "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, expected 407181100, is %d", last_msg.msg.baseline_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == -22880, + "incorrect value for last_msg.msg.baseline_ned_dep_a.d, " + "expected -22880, is %d", + last_msg.msg.baseline_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == 2103, + "incorrect value for last_msg.msg.baseline_ned_dep_a.e, " + "expected 2103, is %d", + last_msg.msg.baseline_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.flags); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == 1646, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n, " + "expected 1646, is %d", + last_msg.msg.baseline_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 6, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, " + "expected 6, is %d", + last_msg.msg.baseline_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 407181100, + "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, " + "expected 407181100, is %d", + last_msg.msg.baseline_ned_dep_a.tow); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -824,75 +1160,109 @@ START_TEST( test_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,2,195,4,22,144,23,69,24,110,6,0,0,54,8,0,0,160,166,255,255,0,0,0,0,6,0,206,22, }; + u8 encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 144, 23, 69, 24, 110, 6, 0, 0, 54, + 8, 0, 0, 160, 166, 255, 255, 0, 0, 0, 0, 6, 0, 206, 22, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_ned_dep_a.d = -22880; - + test_msg.baseline_ned_dep_a.e = 2102; - + test_msg.baseline_ned_dep_a.flags = 0; - + test_msg.baseline_ned_dep_a.h_accuracy = 0; - + test_msg.baseline_ned_dep_a.n = 1646; - + test_msg.baseline_ned_dep_a.n_sats = 6; - + test_msg.baseline_ned_dep_a.tow = 407181200; - + test_msg.baseline_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineNedDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == -22880, "incorrect value for last_msg.msg.baseline_ned_dep_a.d, expected -22880, is %d", last_msg.msg.baseline_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == 2102, "incorrect value for last_msg.msg.baseline_ned_dep_a.e, expected 2102, is %d", last_msg.msg.baseline_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == 1646, "incorrect value for last_msg.msg.baseline_ned_dep_a.n, expected 1646, is %d", last_msg.msg.baseline_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 6, "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, expected 6, is %d", last_msg.msg.baseline_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 407181200, "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, expected 407181200, is %d", last_msg.msg.baseline_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.baseline_ned_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.d == -22880, + "incorrect value for last_msg.msg.baseline_ned_dep_a.d, " + "expected -22880, is %d", + last_msg.msg.baseline_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.e == 2102, + "incorrect value for last_msg.msg.baseline_ned_dep_a.e, " + "expected 2102, is %d", + last_msg.msg.baseline_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.flags); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n == 1646, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n, " + "expected 1646, is %d", + last_msg.msg.baseline_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.n_sats == 6, + "incorrect value for last_msg.msg.baseline_ned_dep_a.n_sats, " + "expected 6, is %d", + last_msg.msg.baseline_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.baseline_ned_dep_a.tow == 407181200, + "incorrect value for last_msg.msg.baseline_ned_dep_a.tow, " + "expected 407181200, is %d", + last_msg.msg.baseline_ned_dep_a.tow); + + ck_assert_msg( + last_msg.msg.baseline_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.baseline_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.baseline_ned_dep_a.v_accuracy); } } END_TEST -Suite* auto_check_sbp_navigation_MsgBaselineNEDDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgBaselineNEDDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgBaselineNEDDepA"); +Suite *auto_check_sbp_navigation_MsgBaselineNEDDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgBaselineNEDDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_navigation_MsgBaselineNEDDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgBaselineNEDDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgDops.c b/c/test/auto_check_sbp_navigation_MsgDops.c index 815e007ca..0b8ada12f 100644 --- a/c/test/auto_check_sbp_navigation_MsgDops.c +++ b/c/test/auto_check_sbp_navigation_MsgDops.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDops.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDops.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgDops ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgDops) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgDops ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,71 +90,98 @@ START_TEST( test_auto_check_sbp_navigation_MsgDops ) logging_reset(); - sbp_callback_register(&sbp_state, 0x208, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x208, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,8,2,66,0,15,100,0,0,0,2,0,6,0,5,0,5,0,5,0,0,244,4, }; + u8 encoded_frame[] = { + 85, 8, 2, 66, 0, 15, 100, 0, 0, 0, 2, 0, + 6, 0, 5, 0, 5, 0, 5, 0, 0, 244, 4, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.dops.flags = 0; - + test_msg.dops.gdop = 2; - + test_msg.dops.hdop = 5; - + test_msg.dops.pdop = 6; - + test_msg.dops.tdop = 5; - + test_msg.dops.tow = 100; - + test_msg.dops.vdop = 5; sbp_message_send(&sbp_state, SbpMsgDops, 66, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgDops, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.dops.flags == 0, "incorrect value for last_msg.msg.dops.flags, expected 0, is %d", last_msg.msg.dops.flags); - - ck_assert_msg(last_msg.msg.dops.gdop == 2, "incorrect value for last_msg.msg.dops.gdop, expected 2, is %d", last_msg.msg.dops.gdop); - - ck_assert_msg(last_msg.msg.dops.hdop == 5, "incorrect value for last_msg.msg.dops.hdop, expected 5, is %d", last_msg.msg.dops.hdop); - - ck_assert_msg(last_msg.msg.dops.pdop == 6, "incorrect value for last_msg.msg.dops.pdop, expected 6, is %d", last_msg.msg.dops.pdop); - - ck_assert_msg(last_msg.msg.dops.tdop == 5, "incorrect value for last_msg.msg.dops.tdop, expected 5, is %d", last_msg.msg.dops.tdop); - - ck_assert_msg(last_msg.msg.dops.tow == 100, "incorrect value for last_msg.msg.dops.tow, expected 100, is %d", last_msg.msg.dops.tow); - - ck_assert_msg(last_msg.msg.dops.vdop == 5, "incorrect value for last_msg.msg.dops.vdop, expected 5, is %d", last_msg.msg.dops.vdop); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.dops.flags == 0, + "incorrect value for last_msg.msg.dops.flags, expected 0, is %d", + last_msg.msg.dops.flags); + + ck_assert_msg( + last_msg.msg.dops.gdop == 2, + "incorrect value for last_msg.msg.dops.gdop, expected 2, is %d", + last_msg.msg.dops.gdop); + + ck_assert_msg( + last_msg.msg.dops.hdop == 5, + "incorrect value for last_msg.msg.dops.hdop, expected 5, is %d", + last_msg.msg.dops.hdop); + + ck_assert_msg( + last_msg.msg.dops.pdop == 6, + "incorrect value for last_msg.msg.dops.pdop, expected 6, is %d", + last_msg.msg.dops.pdop); + + ck_assert_msg( + last_msg.msg.dops.tdop == 5, + "incorrect value for last_msg.msg.dops.tdop, expected 5, is %d", + last_msg.msg.dops.tdop); + + ck_assert_msg( + last_msg.msg.dops.tow == 100, + "incorrect value for last_msg.msg.dops.tow, expected 100, is %d", + last_msg.msg.dops.tow); + + ck_assert_msg( + last_msg.msg.dops.vdop == 5, + "incorrect value for last_msg.msg.dops.vdop, expected 5, is %d", + last_msg.msg.dops.vdop); } } END_TEST -Suite* auto_check_sbp_navigation_MsgDops_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgDops"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgDops"); +Suite *auto_check_sbp_navigation_MsgDops_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgDops"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgDops"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgDops); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgDopsDepA.c b/c/test/auto_check_sbp_navigation_MsgDopsDepA.c index d2124c15b..9a8c647a0 100644 --- a/c/test/auto_check_sbp_navigation_MsgDopsDepA.c +++ b/c/test/auto_check_sbp_navigation_MsgDopsDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDopsDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDopsDepA.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgDopsDepA ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgDopsDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgDopsDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,64 +90,90 @@ START_TEST( test_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,6,2,246,215,14,8,48,39,0,180,0,190,0,170,0,160,0,150,0,121,170, }; + u8 encoded_frame[] = { + 85, 6, 2, 246, 215, 14, 8, 48, 39, 0, 180, + 0, 190, 0, 170, 0, 160, 0, 150, 0, 121, 170, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.dops_dep_a.gdop = 180; - + test_msg.dops_dep_a.hdop = 160; - + test_msg.dops_dep_a.pdop = 190; - + test_msg.dops_dep_a.tdop = 170; - + test_msg.dops_dep_a.tow = 2568200; - + test_msg.dops_dep_a.vdop = 150; - sbp_message_send(&sbp_state, SbpMsgDopsDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgDopsDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.dops_dep_a.gdop == 180, "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 180, is %d", last_msg.msg.dops_dep_a.gdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.hdop == 160, "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 160, is %d", last_msg.msg.dops_dep_a.hdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.pdop == 190, "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 190, is %d", last_msg.msg.dops_dep_a.pdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tdop == 170, "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 170, is %d", last_msg.msg.dops_dep_a.tdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tow == 2568200, "incorrect value for last_msg.msg.dops_dep_a.tow, expected 2568200, is %d", last_msg.msg.dops_dep_a.tow); - - ck_assert_msg(last_msg.msg.dops_dep_a.vdop == 150, "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 150, is %d", last_msg.msg.dops_dep_a.vdop); + ck_assert_msg( + last_msg.msg.dops_dep_a.gdop == 180, + "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 180, is %d", + last_msg.msg.dops_dep_a.gdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.hdop == 160, + "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 160, is %d", + last_msg.msg.dops_dep_a.hdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.pdop == 190, + "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 190, is %d", + last_msg.msg.dops_dep_a.pdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.tdop == 170, + "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 170, is %d", + last_msg.msg.dops_dep_a.tdop); + + ck_assert_msg(last_msg.msg.dops_dep_a.tow == 2568200, + "incorrect value for last_msg.msg.dops_dep_a.tow, expected " + "2568200, is %d", + last_msg.msg.dops_dep_a.tow); + + ck_assert_msg( + last_msg.msg.dops_dep_a.vdop == 150, + "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 150, is %d", + last_msg.msg.dops_dep_a.vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -159,64 +181,90 @@ START_TEST( test_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,6,2,246,215,14,240,51,39,0,180,0,190,0,170,0,160,0,150,0,78,169, }; + u8 encoded_frame[] = { + 85, 6, 2, 246, 215, 14, 240, 51, 39, 0, 180, + 0, 190, 0, 170, 0, 160, 0, 150, 0, 78, 169, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.dops_dep_a.gdop = 180; - + test_msg.dops_dep_a.hdop = 160; - + test_msg.dops_dep_a.pdop = 190; - + test_msg.dops_dep_a.tdop = 170; - + test_msg.dops_dep_a.tow = 2569200; - + test_msg.dops_dep_a.vdop = 150; - sbp_message_send(&sbp_state, SbpMsgDopsDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgDopsDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.dops_dep_a.gdop == 180, "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 180, is %d", last_msg.msg.dops_dep_a.gdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.hdop == 160, "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 160, is %d", last_msg.msg.dops_dep_a.hdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.pdop == 190, "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 190, is %d", last_msg.msg.dops_dep_a.pdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tdop == 170, "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 170, is %d", last_msg.msg.dops_dep_a.tdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tow == 2569200, "incorrect value for last_msg.msg.dops_dep_a.tow, expected 2569200, is %d", last_msg.msg.dops_dep_a.tow); - - ck_assert_msg(last_msg.msg.dops_dep_a.vdop == 150, "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 150, is %d", last_msg.msg.dops_dep_a.vdop); + ck_assert_msg( + last_msg.msg.dops_dep_a.gdop == 180, + "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 180, is %d", + last_msg.msg.dops_dep_a.gdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.hdop == 160, + "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 160, is %d", + last_msg.msg.dops_dep_a.hdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.pdop == 190, + "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 190, is %d", + last_msg.msg.dops_dep_a.pdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.tdop == 170, + "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 170, is %d", + last_msg.msg.dops_dep_a.tdop); + + ck_assert_msg(last_msg.msg.dops_dep_a.tow == 2569200, + "incorrect value for last_msg.msg.dops_dep_a.tow, expected " + "2569200, is %d", + last_msg.msg.dops_dep_a.tow); + + ck_assert_msg( + last_msg.msg.dops_dep_a.vdop == 150, + "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 150, is %d", + last_msg.msg.dops_dep_a.vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -224,64 +272,90 @@ START_TEST( test_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,6,2,246,215,14,216,55,39,0,180,0,190,0,170,0,160,0,150,0,71,218, }; + u8 encoded_frame[] = { + 85, 6, 2, 246, 215, 14, 216, 55, 39, 0, 180, + 0, 190, 0, 170, 0, 160, 0, 150, 0, 71, 218, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.dops_dep_a.gdop = 180; - + test_msg.dops_dep_a.hdop = 160; - + test_msg.dops_dep_a.pdop = 190; - + test_msg.dops_dep_a.tdop = 170; - + test_msg.dops_dep_a.tow = 2570200; - + test_msg.dops_dep_a.vdop = 150; - sbp_message_send(&sbp_state, SbpMsgDopsDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgDopsDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.dops_dep_a.gdop == 180, "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 180, is %d", last_msg.msg.dops_dep_a.gdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.hdop == 160, "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 160, is %d", last_msg.msg.dops_dep_a.hdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.pdop == 190, "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 190, is %d", last_msg.msg.dops_dep_a.pdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tdop == 170, "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 170, is %d", last_msg.msg.dops_dep_a.tdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tow == 2570200, "incorrect value for last_msg.msg.dops_dep_a.tow, expected 2570200, is %d", last_msg.msg.dops_dep_a.tow); - - ck_assert_msg(last_msg.msg.dops_dep_a.vdop == 150, "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 150, is %d", last_msg.msg.dops_dep_a.vdop); + ck_assert_msg( + last_msg.msg.dops_dep_a.gdop == 180, + "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 180, is %d", + last_msg.msg.dops_dep_a.gdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.hdop == 160, + "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 160, is %d", + last_msg.msg.dops_dep_a.hdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.pdop == 190, + "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 190, is %d", + last_msg.msg.dops_dep_a.pdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.tdop == 170, + "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 170, is %d", + last_msg.msg.dops_dep_a.tdop); + + ck_assert_msg(last_msg.msg.dops_dep_a.tow == 2570200, + "incorrect value for last_msg.msg.dops_dep_a.tow, expected " + "2570200, is %d", + last_msg.msg.dops_dep_a.tow); + + ck_assert_msg( + last_msg.msg.dops_dep_a.vdop == 150, + "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 150, is %d", + last_msg.msg.dops_dep_a.vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -289,64 +363,89 @@ START_TEST( test_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,6,2,195,4,14,212,157,67,24,247,0,215,0,123,0,17,1,44,0,206,21, }; + u8 encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 212, 157, 67, 24, 247, + 0, 215, 0, 123, 0, 17, 1, 44, 0, 206, 21, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.dops_dep_a.gdop = 247; - + test_msg.dops_dep_a.hdop = 273; - + test_msg.dops_dep_a.pdop = 215; - + test_msg.dops_dep_a.tdop = 123; - + test_msg.dops_dep_a.tow = 407084500; - + test_msg.dops_dep_a.vdop = 44; sbp_message_send(&sbp_state, SbpMsgDopsDepA, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.dops_dep_a.gdop == 247, "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 247, is %d", last_msg.msg.dops_dep_a.gdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.hdop == 273, "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 273, is %d", last_msg.msg.dops_dep_a.hdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.pdop == 215, "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 215, is %d", last_msg.msg.dops_dep_a.pdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tdop == 123, "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 123, is %d", last_msg.msg.dops_dep_a.tdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tow == 407084500, "incorrect value for last_msg.msg.dops_dep_a.tow, expected 407084500, is %d", last_msg.msg.dops_dep_a.tow); - - ck_assert_msg(last_msg.msg.dops_dep_a.vdop == 44, "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 44, is %d", last_msg.msg.dops_dep_a.vdop); + ck_assert_msg( + last_msg.msg.dops_dep_a.gdop == 247, + "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 247, is %d", + last_msg.msg.dops_dep_a.gdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.hdop == 273, + "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 273, is %d", + last_msg.msg.dops_dep_a.hdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.pdop == 215, + "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 215, is %d", + last_msg.msg.dops_dep_a.pdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.tdop == 123, + "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 123, is %d", + last_msg.msg.dops_dep_a.tdop); + + ck_assert_msg(last_msg.msg.dops_dep_a.tow == 407084500, + "incorrect value for last_msg.msg.dops_dep_a.tow, expected " + "407084500, is %d", + last_msg.msg.dops_dep_a.tow); + + ck_assert_msg( + last_msg.msg.dops_dep_a.vdop == 44, + "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 44, is %d", + last_msg.msg.dops_dep_a.vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -354,64 +453,89 @@ START_TEST( test_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,6,2,195,4,14,0,0,0,0,255,255,255,255,0,0,0,0,0,0,146,12, }; + u8 encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 0, 0, 0, 0, 255, + 255, 255, 255, 0, 0, 0, 0, 0, 0, 146, 12, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.dops_dep_a.gdop = 65535; - + test_msg.dops_dep_a.hdop = 0; - + test_msg.dops_dep_a.pdop = 65535; - + test_msg.dops_dep_a.tdop = 0; - + test_msg.dops_dep_a.tow = 0; - + test_msg.dops_dep_a.vdop = 0; sbp_message_send(&sbp_state, SbpMsgDopsDepA, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.dops_dep_a.gdop == 65535, "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 65535, is %d", last_msg.msg.dops_dep_a.gdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.hdop == 0, "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 0, is %d", last_msg.msg.dops_dep_a.hdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.pdop == 65535, "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 65535, is %d", last_msg.msg.dops_dep_a.pdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tdop == 0, "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 0, is %d", last_msg.msg.dops_dep_a.tdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tow == 0, "incorrect value for last_msg.msg.dops_dep_a.tow, expected 0, is %d", last_msg.msg.dops_dep_a.tow); - - ck_assert_msg(last_msg.msg.dops_dep_a.vdop == 0, "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 0, is %d", last_msg.msg.dops_dep_a.vdop); + ck_assert_msg(last_msg.msg.dops_dep_a.gdop == 65535, + "incorrect value for last_msg.msg.dops_dep_a.gdop, expected " + "65535, is %d", + last_msg.msg.dops_dep_a.gdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.hdop == 0, + "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 0, is %d", + last_msg.msg.dops_dep_a.hdop); + + ck_assert_msg(last_msg.msg.dops_dep_a.pdop == 65535, + "incorrect value for last_msg.msg.dops_dep_a.pdop, expected " + "65535, is %d", + last_msg.msg.dops_dep_a.pdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.tdop == 0, + "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 0, is %d", + last_msg.msg.dops_dep_a.tdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.tow == 0, + "incorrect value for last_msg.msg.dops_dep_a.tow, expected 0, is %d", + last_msg.msg.dops_dep_a.tow); + + ck_assert_msg( + last_msg.msg.dops_dep_a.vdop == 0, + "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 0, is %d", + last_msg.msg.dops_dep_a.vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -419,64 +543,89 @@ START_TEST( test_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,6,2,195,4,14,128,165,68,24,92,1,56,1,155,0,125,2,113,0,129,93, }; + u8 encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 128, 165, 68, 24, 92, + 1, 56, 1, 155, 0, 125, 2, 113, 0, 129, 93, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.dops_dep_a.gdop = 348; - + test_msg.dops_dep_a.hdop = 637; - + test_msg.dops_dep_a.pdop = 312; - + test_msg.dops_dep_a.tdop = 155; - + test_msg.dops_dep_a.tow = 407152000; - + test_msg.dops_dep_a.vdop = 113; sbp_message_send(&sbp_state, SbpMsgDopsDepA, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.dops_dep_a.gdop == 348, "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 348, is %d", last_msg.msg.dops_dep_a.gdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.hdop == 637, "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 637, is %d", last_msg.msg.dops_dep_a.hdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.pdop == 312, "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 312, is %d", last_msg.msg.dops_dep_a.pdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tdop == 155, "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 155, is %d", last_msg.msg.dops_dep_a.tdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tow == 407152000, "incorrect value for last_msg.msg.dops_dep_a.tow, expected 407152000, is %d", last_msg.msg.dops_dep_a.tow); - - ck_assert_msg(last_msg.msg.dops_dep_a.vdop == 113, "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 113, is %d", last_msg.msg.dops_dep_a.vdop); + ck_assert_msg( + last_msg.msg.dops_dep_a.gdop == 348, + "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 348, is %d", + last_msg.msg.dops_dep_a.gdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.hdop == 637, + "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 637, is %d", + last_msg.msg.dops_dep_a.hdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.pdop == 312, + "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 312, is %d", + last_msg.msg.dops_dep_a.pdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.tdop == 155, + "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 155, is %d", + last_msg.msg.dops_dep_a.tdop); + + ck_assert_msg(last_msg.msg.dops_dep_a.tow == 407152000, + "incorrect value for last_msg.msg.dops_dep_a.tow, expected " + "407152000, is %d", + last_msg.msg.dops_dep_a.tow); + + ck_assert_msg( + last_msg.msg.dops_dep_a.vdop == 113, + "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 113, is %d", + last_msg.msg.dops_dep_a.vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -484,64 +633,89 @@ START_TEST( test_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,6,2,195,4,14,104,169,68,24,92,1,55,1,155,0,125,2,113,0,209,128, }; + u8 encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 104, 169, 68, 24, 92, + 1, 55, 1, 155, 0, 125, 2, 113, 0, 209, 128, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.dops_dep_a.gdop = 348; - + test_msg.dops_dep_a.hdop = 637; - + test_msg.dops_dep_a.pdop = 311; - + test_msg.dops_dep_a.tdop = 155; - + test_msg.dops_dep_a.tow = 407153000; - + test_msg.dops_dep_a.vdop = 113; sbp_message_send(&sbp_state, SbpMsgDopsDepA, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.dops_dep_a.gdop == 348, "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 348, is %d", last_msg.msg.dops_dep_a.gdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.hdop == 637, "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 637, is %d", last_msg.msg.dops_dep_a.hdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.pdop == 311, "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 311, is %d", last_msg.msg.dops_dep_a.pdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tdop == 155, "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 155, is %d", last_msg.msg.dops_dep_a.tdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tow == 407153000, "incorrect value for last_msg.msg.dops_dep_a.tow, expected 407153000, is %d", last_msg.msg.dops_dep_a.tow); - - ck_assert_msg(last_msg.msg.dops_dep_a.vdop == 113, "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 113, is %d", last_msg.msg.dops_dep_a.vdop); + ck_assert_msg( + last_msg.msg.dops_dep_a.gdop == 348, + "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 348, is %d", + last_msg.msg.dops_dep_a.gdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.hdop == 637, + "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 637, is %d", + last_msg.msg.dops_dep_a.hdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.pdop == 311, + "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 311, is %d", + last_msg.msg.dops_dep_a.pdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.tdop == 155, + "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 155, is %d", + last_msg.msg.dops_dep_a.tdop); + + ck_assert_msg(last_msg.msg.dops_dep_a.tow == 407153000, + "incorrect value for last_msg.msg.dops_dep_a.tow, expected " + "407153000, is %d", + last_msg.msg.dops_dep_a.tow); + + ck_assert_msg( + last_msg.msg.dops_dep_a.vdop == 113, + "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 113, is %d", + last_msg.msg.dops_dep_a.vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -549,64 +723,89 @@ START_TEST( test_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,6,2,195,4,14,80,173,68,24,92,1,55,1,155,0,125,2,112,0,30,6, }; + u8 encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 80, 173, 68, 24, 92, + 1, 55, 1, 155, 0, 125, 2, 112, 0, 30, 6, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.dops_dep_a.gdop = 348; - + test_msg.dops_dep_a.hdop = 637; - + test_msg.dops_dep_a.pdop = 311; - + test_msg.dops_dep_a.tdop = 155; - + test_msg.dops_dep_a.tow = 407154000; - + test_msg.dops_dep_a.vdop = 112; sbp_message_send(&sbp_state, SbpMsgDopsDepA, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.dops_dep_a.gdop == 348, "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 348, is %d", last_msg.msg.dops_dep_a.gdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.hdop == 637, "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 637, is %d", last_msg.msg.dops_dep_a.hdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.pdop == 311, "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 311, is %d", last_msg.msg.dops_dep_a.pdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tdop == 155, "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 155, is %d", last_msg.msg.dops_dep_a.tdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tow == 407154000, "incorrect value for last_msg.msg.dops_dep_a.tow, expected 407154000, is %d", last_msg.msg.dops_dep_a.tow); - - ck_assert_msg(last_msg.msg.dops_dep_a.vdop == 112, "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 112, is %d", last_msg.msg.dops_dep_a.vdop); + ck_assert_msg( + last_msg.msg.dops_dep_a.gdop == 348, + "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 348, is %d", + last_msg.msg.dops_dep_a.gdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.hdop == 637, + "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 637, is %d", + last_msg.msg.dops_dep_a.hdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.pdop == 311, + "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 311, is %d", + last_msg.msg.dops_dep_a.pdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.tdop == 155, + "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 155, is %d", + last_msg.msg.dops_dep_a.tdop); + + ck_assert_msg(last_msg.msg.dops_dep_a.tow == 407154000, + "incorrect value for last_msg.msg.dops_dep_a.tow, expected " + "407154000, is %d", + last_msg.msg.dops_dep_a.tow); + + ck_assert_msg( + last_msg.msg.dops_dep_a.vdop == 112, + "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 112, is %d", + last_msg.msg.dops_dep_a.vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -614,67 +813,92 @@ START_TEST( test_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,6,2,195,4,14,56,177,68,24,92,1,55,1,155,0,125,2,112,0,70,67, }; + u8 encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 56, 177, 68, 24, 92, + 1, 55, 1, 155, 0, 125, 2, 112, 0, 70, 67, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.dops_dep_a.gdop = 348; - + test_msg.dops_dep_a.hdop = 637; - + test_msg.dops_dep_a.pdop = 311; - + test_msg.dops_dep_a.tdop = 155; - + test_msg.dops_dep_a.tow = 407155000; - + test_msg.dops_dep_a.vdop = 112; sbp_message_send(&sbp_state, SbpMsgDopsDepA, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgDopsDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.dops_dep_a.gdop == 348, "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 348, is %d", last_msg.msg.dops_dep_a.gdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.hdop == 637, "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 637, is %d", last_msg.msg.dops_dep_a.hdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.pdop == 311, "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 311, is %d", last_msg.msg.dops_dep_a.pdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tdop == 155, "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 155, is %d", last_msg.msg.dops_dep_a.tdop); - - ck_assert_msg(last_msg.msg.dops_dep_a.tow == 407155000, "incorrect value for last_msg.msg.dops_dep_a.tow, expected 407155000, is %d", last_msg.msg.dops_dep_a.tow); - - ck_assert_msg(last_msg.msg.dops_dep_a.vdop == 112, "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 112, is %d", last_msg.msg.dops_dep_a.vdop); + ck_assert_msg( + last_msg.msg.dops_dep_a.gdop == 348, + "incorrect value for last_msg.msg.dops_dep_a.gdop, expected 348, is %d", + last_msg.msg.dops_dep_a.gdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.hdop == 637, + "incorrect value for last_msg.msg.dops_dep_a.hdop, expected 637, is %d", + last_msg.msg.dops_dep_a.hdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.pdop == 311, + "incorrect value for last_msg.msg.dops_dep_a.pdop, expected 311, is %d", + last_msg.msg.dops_dep_a.pdop); + + ck_assert_msg( + last_msg.msg.dops_dep_a.tdop == 155, + "incorrect value for last_msg.msg.dops_dep_a.tdop, expected 155, is %d", + last_msg.msg.dops_dep_a.tdop); + + ck_assert_msg(last_msg.msg.dops_dep_a.tow == 407155000, + "incorrect value for last_msg.msg.dops_dep_a.tow, expected " + "407155000, is %d", + last_msg.msg.dops_dep_a.tow); + + ck_assert_msg( + last_msg.msg.dops_dep_a.vdop == 112, + "incorrect value for last_msg.msg.dops_dep_a.vdop, expected 112, is %d", + last_msg.msg.dops_dep_a.vdop); } } END_TEST -Suite* auto_check_sbp_navigation_MsgDopsDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgDopsDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgDopsDepA"); +Suite *auto_check_sbp_navigation_MsgDopsDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgDopsDepA"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgDopsDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgDopsDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgGPSTime.c b/c/test/auto_check_sbp_navigation_MsgGPSTime.c index 05ed51d4e..91164ff3b 100644 --- a/c/test/auto_check_sbp_navigation_MsgGPSTime.c +++ b/c/test/auto_check_sbp_navigation_MsgGPSTime.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTime.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgGPSTime ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgGPSTime) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTime ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,56 +90,74 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTime ) logging_reset(); - sbp_callback_register(&sbp_state, 0x102, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x102, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,1,211,136,11,128,7,40,244,122,19,244,139,2,0,0,34,152, }; + u8 encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 40, 244, + 122, 19, 244, 139, 2, 0, 0, 34, 152, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time.flags = 0; - + test_msg.gps_time.ns_residual = 166900; - + test_msg.gps_time.tow = 326825000; - + test_msg.gps_time.wn = 1920; sbp_message_send(&sbp_state, SbpMsgGpsTime, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgGpsTime, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time.flags == 0, "incorrect value for last_msg.msg.gps_time.flags, expected 0, is %d", last_msg.msg.gps_time.flags); - - ck_assert_msg(last_msg.msg.gps_time.ns_residual == 166900, "incorrect value for last_msg.msg.gps_time.ns_residual, expected 166900, is %d", last_msg.msg.gps_time.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time.tow == 326825000, "incorrect value for last_msg.msg.gps_time.tow, expected 326825000, is %d", last_msg.msg.gps_time.tow); - - ck_assert_msg(last_msg.msg.gps_time.wn == 1920, "incorrect value for last_msg.msg.gps_time.wn, expected 1920, is %d", last_msg.msg.gps_time.wn); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.gps_time.flags == 0, + "incorrect value for last_msg.msg.gps_time.flags, expected 0, is %d", + last_msg.msg.gps_time.flags); + + ck_assert_msg(last_msg.msg.gps_time.ns_residual == 166900, + "incorrect value for last_msg.msg.gps_time.ns_residual, " + "expected 166900, is %d", + last_msg.msg.gps_time.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time.tow == 326825000, + "incorrect value for last_msg.msg.gps_time.tow, expected " + "326825000, is %d", + last_msg.msg.gps_time.tow); + + ck_assert_msg( + last_msg.msg.gps_time.wn == 1920, + "incorrect value for last_msg.msg.gps_time.wn, expected 1920, is %d", + last_msg.msg.gps_time.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -151,56 +165,74 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTime ) logging_reset(); - sbp_callback_register(&sbp_state, 0x102, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x102, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,1,211,136,11,128,7,28,246,122,19,126,234,3,0,0,65,3, }; + u8 encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 28, 246, + 122, 19, 126, 234, 3, 0, 0, 65, 3, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time.flags = 0; - + test_msg.gps_time.ns_residual = 256638; - + test_msg.gps_time.tow = 326825500; - + test_msg.gps_time.wn = 1920; sbp_message_send(&sbp_state, SbpMsgGpsTime, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgGpsTime, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time.flags == 0, "incorrect value for last_msg.msg.gps_time.flags, expected 0, is %d", last_msg.msg.gps_time.flags); - - ck_assert_msg(last_msg.msg.gps_time.ns_residual == 256638, "incorrect value for last_msg.msg.gps_time.ns_residual, expected 256638, is %d", last_msg.msg.gps_time.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time.tow == 326825500, "incorrect value for last_msg.msg.gps_time.tow, expected 326825500, is %d", last_msg.msg.gps_time.tow); - - ck_assert_msg(last_msg.msg.gps_time.wn == 1920, "incorrect value for last_msg.msg.gps_time.wn, expected 1920, is %d", last_msg.msg.gps_time.wn); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.gps_time.flags == 0, + "incorrect value for last_msg.msg.gps_time.flags, expected 0, is %d", + last_msg.msg.gps_time.flags); + + ck_assert_msg(last_msg.msg.gps_time.ns_residual == 256638, + "incorrect value for last_msg.msg.gps_time.ns_residual, " + "expected 256638, is %d", + last_msg.msg.gps_time.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time.tow == 326825500, + "incorrect value for last_msg.msg.gps_time.tow, expected " + "326825500, is %d", + last_msg.msg.gps_time.tow); + + ck_assert_msg( + last_msg.msg.gps_time.wn == 1920, + "incorrect value for last_msg.msg.gps_time.wn, expected 1920, is %d", + last_msg.msg.gps_time.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -208,56 +240,74 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTime ) logging_reset(); - sbp_callback_register(&sbp_state, 0x102, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x102, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,1,211,136,11,128,7,16,248,122,19,129,12,4,0,0,12,84, }; + u8 encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 16, 248, + 122, 19, 129, 12, 4, 0, 0, 12, 84, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time.flags = 0; - + test_msg.gps_time.ns_residual = 265345; - + test_msg.gps_time.tow = 326826000; - + test_msg.gps_time.wn = 1920; sbp_message_send(&sbp_state, SbpMsgGpsTime, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgGpsTime, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time.flags == 0, "incorrect value for last_msg.msg.gps_time.flags, expected 0, is %d", last_msg.msg.gps_time.flags); - - ck_assert_msg(last_msg.msg.gps_time.ns_residual == 265345, "incorrect value for last_msg.msg.gps_time.ns_residual, expected 265345, is %d", last_msg.msg.gps_time.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time.tow == 326826000, "incorrect value for last_msg.msg.gps_time.tow, expected 326826000, is %d", last_msg.msg.gps_time.tow); - - ck_assert_msg(last_msg.msg.gps_time.wn == 1920, "incorrect value for last_msg.msg.gps_time.wn, expected 1920, is %d", last_msg.msg.gps_time.wn); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.gps_time.flags == 0, + "incorrect value for last_msg.msg.gps_time.flags, expected 0, is %d", + last_msg.msg.gps_time.flags); + + ck_assert_msg(last_msg.msg.gps_time.ns_residual == 265345, + "incorrect value for last_msg.msg.gps_time.ns_residual, " + "expected 265345, is %d", + last_msg.msg.gps_time.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time.tow == 326826000, + "incorrect value for last_msg.msg.gps_time.tow, expected " + "326826000, is %d", + last_msg.msg.gps_time.tow); + + ck_assert_msg( + last_msg.msg.gps_time.wn == 1920, + "incorrect value for last_msg.msg.gps_time.wn, expected 1920, is %d", + last_msg.msg.gps_time.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -265,56 +315,74 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTime ) logging_reset(); - sbp_callback_register(&sbp_state, 0x102, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x102, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,1,211,136,11,128,7,4,250,122,19,137,204,4,0,0,50,165, }; + u8 encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 4, 250, + 122, 19, 137, 204, 4, 0, 0, 50, 165, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time.flags = 0; - + test_msg.gps_time.ns_residual = 314505; - + test_msg.gps_time.tow = 326826500; - + test_msg.gps_time.wn = 1920; sbp_message_send(&sbp_state, SbpMsgGpsTime, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgGpsTime, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time.flags == 0, "incorrect value for last_msg.msg.gps_time.flags, expected 0, is %d", last_msg.msg.gps_time.flags); - - ck_assert_msg(last_msg.msg.gps_time.ns_residual == 314505, "incorrect value for last_msg.msg.gps_time.ns_residual, expected 314505, is %d", last_msg.msg.gps_time.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time.tow == 326826500, "incorrect value for last_msg.msg.gps_time.tow, expected 326826500, is %d", last_msg.msg.gps_time.tow); - - ck_assert_msg(last_msg.msg.gps_time.wn == 1920, "incorrect value for last_msg.msg.gps_time.wn, expected 1920, is %d", last_msg.msg.gps_time.wn); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.gps_time.flags == 0, + "incorrect value for last_msg.msg.gps_time.flags, expected 0, is %d", + last_msg.msg.gps_time.flags); + + ck_assert_msg(last_msg.msg.gps_time.ns_residual == 314505, + "incorrect value for last_msg.msg.gps_time.ns_residual, " + "expected 314505, is %d", + last_msg.msg.gps_time.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time.tow == 326826500, + "incorrect value for last_msg.msg.gps_time.tow, expected " + "326826500, is %d", + last_msg.msg.gps_time.tow); + + ck_assert_msg( + last_msg.msg.gps_time.wn == 1920, + "incorrect value for last_msg.msg.gps_time.wn, expected 1920, is %d", + last_msg.msg.gps_time.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -322,59 +390,77 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTime ) logging_reset(); - sbp_callback_register(&sbp_state, 0x102, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x102, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,1,211,136,11,128,7,248,251,122,19,181,137,5,0,0,180,33, }; + u8 encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 248, 251, + 122, 19, 181, 137, 5, 0, 0, 180, 33, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time.flags = 0; - + test_msg.gps_time.ns_residual = 362933; - + test_msg.gps_time.tow = 326827000; - + test_msg.gps_time.wn = 1920; sbp_message_send(&sbp_state, SbpMsgGpsTime, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgGpsTime, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time.flags == 0, "incorrect value for last_msg.msg.gps_time.flags, expected 0, is %d", last_msg.msg.gps_time.flags); - - ck_assert_msg(last_msg.msg.gps_time.ns_residual == 362933, "incorrect value for last_msg.msg.gps_time.ns_residual, expected 362933, is %d", last_msg.msg.gps_time.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time.tow == 326827000, "incorrect value for last_msg.msg.gps_time.tow, expected 326827000, is %d", last_msg.msg.gps_time.tow); - - ck_assert_msg(last_msg.msg.gps_time.wn == 1920, "incorrect value for last_msg.msg.gps_time.wn, expected 1920, is %d", last_msg.msg.gps_time.wn); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.gps_time.flags == 0, + "incorrect value for last_msg.msg.gps_time.flags, expected 0, is %d", + last_msg.msg.gps_time.flags); + + ck_assert_msg(last_msg.msg.gps_time.ns_residual == 362933, + "incorrect value for last_msg.msg.gps_time.ns_residual, " + "expected 362933, is %d", + last_msg.msg.gps_time.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time.tow == 326827000, + "incorrect value for last_msg.msg.gps_time.tow, expected " + "326827000, is %d", + last_msg.msg.gps_time.tow); + + ck_assert_msg( + last_msg.msg.gps_time.wn == 1920, + "incorrect value for last_msg.msg.gps_time.wn, expected 1920, is %d", + last_msg.msg.gps_time.wn); } } END_TEST -Suite* auto_check_sbp_navigation_MsgGPSTime_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgGPSTime"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgGPSTime"); +Suite *auto_check_sbp_navigation_MsgGPSTime_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgGPSTime"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgGPSTime"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgGPSTime); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgGPSTimeDepA.c b/c/test/auto_check_sbp_navigation_MsgGPSTimeDepA.c index db206aa5f..e681c1652 100644 --- a/c/test/auto_check_sbp_navigation_MsgGPSTimeDepA.c +++ b/c/test/auto_check_sbp_navigation_MsgGPSTimeDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeDepA ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgGPSTimeDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,56 +90,75 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,1,246,215,11,251,6,120,46,39,0,0,0,0,0,0,133,36, }; + u8 encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 120, 46, 39, 0, 0, 0, 0, 0, 0, 133, 36, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_dep_a.flags = 0; - + test_msg.gps_time_dep_a.ns_residual = 0; - + test_msg.gps_time_dep_a.tow = 2567800; - + test_msg.gps_time_dep_a.wn = 1787; - sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, "incorrect value for last_msg.msg.gps_time_dep_a.flags, expected 0, is %d", last_msg.msg.gps_time_dep_a.flags); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == 0, "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected 0, is %d", last_msg.msg.gps_time_dep_a.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 2567800, "incorrect value for last_msg.msg.gps_time_dep_a.tow, expected 2567800, is %d", last_msg.msg.gps_time_dep_a.tow); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1787, "incorrect value for last_msg.msg.gps_time_dep_a.wn, expected 1787, is %d", last_msg.msg.gps_time_dep_a.wn); + ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, + "incorrect value for last_msg.msg.gps_time_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_dep_a.flags); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == 0, + "incorrect value for " + "last_msg.msg.gps_time_dep_a.ns_residual, expected 0, is %d", + last_msg.msg.gps_time_dep_a.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 2567800, + "incorrect value for last_msg.msg.gps_time_dep_a.tow, " + "expected 2567800, is %d", + last_msg.msg.gps_time_dep_a.tow); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1787, + "incorrect value for last_msg.msg.gps_time_dep_a.wn, " + "expected 1787, is %d", + last_msg.msg.gps_time_dep_a.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -151,56 +166,75 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,1,246,215,11,251,6,220,46,39,0,0,0,0,0,0,36,160, }; + u8 encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 220, 46, 39, 0, 0, 0, 0, 0, 0, 36, 160, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_dep_a.flags = 0; - + test_msg.gps_time_dep_a.ns_residual = 0; - + test_msg.gps_time_dep_a.tow = 2567900; - + test_msg.gps_time_dep_a.wn = 1787; - sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, "incorrect value for last_msg.msg.gps_time_dep_a.flags, expected 0, is %d", last_msg.msg.gps_time_dep_a.flags); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == 0, "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected 0, is %d", last_msg.msg.gps_time_dep_a.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 2567900, "incorrect value for last_msg.msg.gps_time_dep_a.tow, expected 2567900, is %d", last_msg.msg.gps_time_dep_a.tow); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1787, "incorrect value for last_msg.msg.gps_time_dep_a.wn, expected 1787, is %d", last_msg.msg.gps_time_dep_a.wn); + ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, + "incorrect value for last_msg.msg.gps_time_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_dep_a.flags); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == 0, + "incorrect value for " + "last_msg.msg.gps_time_dep_a.ns_residual, expected 0, is %d", + last_msg.msg.gps_time_dep_a.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 2567900, + "incorrect value for last_msg.msg.gps_time_dep_a.tow, " + "expected 2567900, is %d", + last_msg.msg.gps_time_dep_a.tow); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1787, + "incorrect value for last_msg.msg.gps_time_dep_a.wn, " + "expected 1787, is %d", + last_msg.msg.gps_time_dep_a.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -208,56 +242,75 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,1,246,215,11,251,6,64,47,39,0,0,0,0,0,0,171,190, }; + u8 encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 64, 47, 39, 0, 0, 0, 0, 0, 0, 171, 190, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_dep_a.flags = 0; - + test_msg.gps_time_dep_a.ns_residual = 0; - + test_msg.gps_time_dep_a.tow = 2568000; - + test_msg.gps_time_dep_a.wn = 1787; - sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, "incorrect value for last_msg.msg.gps_time_dep_a.flags, expected 0, is %d", last_msg.msg.gps_time_dep_a.flags); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == 0, "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected 0, is %d", last_msg.msg.gps_time_dep_a.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 2568000, "incorrect value for last_msg.msg.gps_time_dep_a.tow, expected 2568000, is %d", last_msg.msg.gps_time_dep_a.tow); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1787, "incorrect value for last_msg.msg.gps_time_dep_a.wn, expected 1787, is %d", last_msg.msg.gps_time_dep_a.wn); + ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, + "incorrect value for last_msg.msg.gps_time_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_dep_a.flags); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == 0, + "incorrect value for " + "last_msg.msg.gps_time_dep_a.ns_residual, expected 0, is %d", + last_msg.msg.gps_time_dep_a.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 2568000, + "incorrect value for last_msg.msg.gps_time_dep_a.tow, " + "expected 2568000, is %d", + last_msg.msg.gps_time_dep_a.tow); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1787, + "incorrect value for last_msg.msg.gps_time_dep_a.wn, " + "expected 1787, is %d", + last_msg.msg.gps_time_dep_a.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -265,56 +318,75 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,1,246,215,11,251,6,164,47,39,0,0,0,0,0,0,211,101, }; + u8 encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 164, 47, 39, 0, 0, 0, 0, 0, 0, 211, 101, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_dep_a.flags = 0; - + test_msg.gps_time_dep_a.ns_residual = 0; - + test_msg.gps_time_dep_a.tow = 2568100; - + test_msg.gps_time_dep_a.wn = 1787; - sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, "incorrect value for last_msg.msg.gps_time_dep_a.flags, expected 0, is %d", last_msg.msg.gps_time_dep_a.flags); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == 0, "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected 0, is %d", last_msg.msg.gps_time_dep_a.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 2568100, "incorrect value for last_msg.msg.gps_time_dep_a.tow, expected 2568100, is %d", last_msg.msg.gps_time_dep_a.tow); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1787, "incorrect value for last_msg.msg.gps_time_dep_a.wn, expected 1787, is %d", last_msg.msg.gps_time_dep_a.wn); + ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, + "incorrect value for last_msg.msg.gps_time_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_dep_a.flags); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == 0, + "incorrect value for " + "last_msg.msg.gps_time_dep_a.ns_residual, expected 0, is %d", + last_msg.msg.gps_time_dep_a.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 2568100, + "incorrect value for last_msg.msg.gps_time_dep_a.tow, " + "expected 2568100, is %d", + last_msg.msg.gps_time_dep_a.tow); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1787, + "incorrect value for last_msg.msg.gps_time_dep_a.wn, " + "expected 1787, is %d", + last_msg.msg.gps_time_dep_a.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -322,56 +394,75 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,1,246,215,11,251,6,8,48,39,0,0,0,0,0,0,251,44, }; + u8 encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 8, 48, 39, 0, 0, 0, 0, 0, 0, 251, 44, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_dep_a.flags = 0; - + test_msg.gps_time_dep_a.ns_residual = 0; - + test_msg.gps_time_dep_a.tow = 2568200; - + test_msg.gps_time_dep_a.wn = 1787; - sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, "incorrect value for last_msg.msg.gps_time_dep_a.flags, expected 0, is %d", last_msg.msg.gps_time_dep_a.flags); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == 0, "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected 0, is %d", last_msg.msg.gps_time_dep_a.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 2568200, "incorrect value for last_msg.msg.gps_time_dep_a.tow, expected 2568200, is %d", last_msg.msg.gps_time_dep_a.tow); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1787, "incorrect value for last_msg.msg.gps_time_dep_a.wn, expected 1787, is %d", last_msg.msg.gps_time_dep_a.wn); + ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, + "incorrect value for last_msg.msg.gps_time_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_dep_a.flags); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == 0, + "incorrect value for " + "last_msg.msg.gps_time_dep_a.ns_residual, expected 0, is %d", + last_msg.msg.gps_time_dep_a.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 2568200, + "incorrect value for last_msg.msg.gps_time_dep_a.tow, " + "expected 2568200, is %d", + last_msg.msg.gps_time_dep_a.tow); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1787, + "incorrect value for last_msg.msg.gps_time_dep_a.wn, " + "expected 1787, is %d", + last_msg.msg.gps_time_dep_a.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -379,56 +470,77 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,1,195,4,11,46,7,212,157,67,24,111,147,252,255,0,215,190, }; + u8 encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 212, 157, + 67, 24, 111, 147, 252, 255, 0, 215, 190, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_dep_a.flags = 0; - + test_msg.gps_time_dep_a.ns_residual = -224401; - + test_msg.gps_time_dep_a.tow = 407084500; - + test_msg.gps_time_dep_a.wn = 1838; - sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, "incorrect value for last_msg.msg.gps_time_dep_a.flags, expected 0, is %d", last_msg.msg.gps_time_dep_a.flags); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == -224401, "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected -224401, is %d", last_msg.msg.gps_time_dep_a.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 407084500, "incorrect value for last_msg.msg.gps_time_dep_a.tow, expected 407084500, is %d", last_msg.msg.gps_time_dep_a.tow); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1838, "incorrect value for last_msg.msg.gps_time_dep_a.wn, expected 1838, is %d", last_msg.msg.gps_time_dep_a.wn); + ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, + "incorrect value for last_msg.msg.gps_time_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_dep_a.flags); + + ck_assert_msg( + last_msg.msg.gps_time_dep_a.ns_residual == -224401, + "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected " + "-224401, is %d", + last_msg.msg.gps_time_dep_a.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 407084500, + "incorrect value for last_msg.msg.gps_time_dep_a.tow, " + "expected 407084500, is %d", + last_msg.msg.gps_time_dep_a.tow); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1838, + "incorrect value for last_msg.msg.gps_time_dep_a.wn, " + "expected 1838, is %d", + last_msg.msg.gps_time_dep_a.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -436,56 +548,77 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,1,195,4,11,46,7,56,158,67,24,109,103,3,0,0,134,89, }; + u8 encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 56, 158, + 67, 24, 109, 103, 3, 0, 0, 134, 89, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_dep_a.flags = 0; - + test_msg.gps_time_dep_a.ns_residual = 223085; - + test_msg.gps_time_dep_a.tow = 407084600; - + test_msg.gps_time_dep_a.wn = 1838; - sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, "incorrect value for last_msg.msg.gps_time_dep_a.flags, expected 0, is %d", last_msg.msg.gps_time_dep_a.flags); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == 223085, "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected 223085, is %d", last_msg.msg.gps_time_dep_a.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 407084600, "incorrect value for last_msg.msg.gps_time_dep_a.tow, expected 407084600, is %d", last_msg.msg.gps_time_dep_a.tow); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1838, "incorrect value for last_msg.msg.gps_time_dep_a.wn, expected 1838, is %d", last_msg.msg.gps_time_dep_a.wn); + ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, + "incorrect value for last_msg.msg.gps_time_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_dep_a.flags); + + ck_assert_msg( + last_msg.msg.gps_time_dep_a.ns_residual == 223085, + "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected " + "223085, is %d", + last_msg.msg.gps_time_dep_a.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 407084600, + "incorrect value for last_msg.msg.gps_time_dep_a.tow, " + "expected 407084600, is %d", + last_msg.msg.gps_time_dep_a.tow); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1838, + "incorrect value for last_msg.msg.gps_time_dep_a.wn, " + "expected 1838, is %d", + last_msg.msg.gps_time_dep_a.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -493,56 +626,77 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,1,195,4,11,46,7,156,158,67,24,233,152,252,255,0,206,241, }; + u8 encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 156, 158, + 67, 24, 233, 152, 252, 255, 0, 206, 241, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_dep_a.flags = 0; - + test_msg.gps_time_dep_a.ns_residual = -222999; - + test_msg.gps_time_dep_a.tow = 407084700; - + test_msg.gps_time_dep_a.wn = 1838; - sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, "incorrect value for last_msg.msg.gps_time_dep_a.flags, expected 0, is %d", last_msg.msg.gps_time_dep_a.flags); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == -222999, "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected -222999, is %d", last_msg.msg.gps_time_dep_a.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 407084700, "incorrect value for last_msg.msg.gps_time_dep_a.tow, expected 407084700, is %d", last_msg.msg.gps_time_dep_a.tow); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1838, "incorrect value for last_msg.msg.gps_time_dep_a.wn, expected 1838, is %d", last_msg.msg.gps_time_dep_a.wn); + ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, + "incorrect value for last_msg.msg.gps_time_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_dep_a.flags); + + ck_assert_msg( + last_msg.msg.gps_time_dep_a.ns_residual == -222999, + "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected " + "-222999, is %d", + last_msg.msg.gps_time_dep_a.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 407084700, + "incorrect value for last_msg.msg.gps_time_dep_a.tow, " + "expected 407084700, is %d", + last_msg.msg.gps_time_dep_a.tow); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1838, + "incorrect value for last_msg.msg.gps_time_dep_a.wn, " + "expected 1838, is %d", + last_msg.msg.gps_time_dep_a.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -550,56 +704,76 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,1,195,4,11,46,7,0,159,67,24,240,154,3,0,0,147,98, }; + u8 encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 0, 159, 67, 24, 240, 154, 3, 0, 0, 147, 98, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_dep_a.flags = 0; - + test_msg.gps_time_dep_a.ns_residual = 236272; - + test_msg.gps_time_dep_a.tow = 407084800; - + test_msg.gps_time_dep_a.wn = 1838; - sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, "incorrect value for last_msg.msg.gps_time_dep_a.flags, expected 0, is %d", last_msg.msg.gps_time_dep_a.flags); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == 236272, "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected 236272, is %d", last_msg.msg.gps_time_dep_a.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 407084800, "incorrect value for last_msg.msg.gps_time_dep_a.tow, expected 407084800, is %d", last_msg.msg.gps_time_dep_a.tow); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1838, "incorrect value for last_msg.msg.gps_time_dep_a.wn, expected 1838, is %d", last_msg.msg.gps_time_dep_a.wn); + ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, + "incorrect value for last_msg.msg.gps_time_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_dep_a.flags); + + ck_assert_msg( + last_msg.msg.gps_time_dep_a.ns_residual == 236272, + "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected " + "236272, is %d", + last_msg.msg.gps_time_dep_a.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 407084800, + "incorrect value for last_msg.msg.gps_time_dep_a.tow, " + "expected 407084800, is %d", + last_msg.msg.gps_time_dep_a.tow); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1838, + "incorrect value for last_msg.msg.gps_time_dep_a.wn, " + "expected 1838, is %d", + last_msg.msg.gps_time_dep_a.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -607,56 +781,77 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,1,195,4,11,46,7,100,159,67,24,144,101,252,255,0,186,152, }; + u8 encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 100, 159, + 67, 24, 144, 101, 252, 255, 0, 186, 152, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_dep_a.flags = 0; - + test_msg.gps_time_dep_a.ns_residual = -236144; - + test_msg.gps_time_dep_a.tow = 407084900; - + test_msg.gps_time_dep_a.wn = 1838; - sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, "incorrect value for last_msg.msg.gps_time_dep_a.flags, expected 0, is %d", last_msg.msg.gps_time_dep_a.flags); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == -236144, "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected -236144, is %d", last_msg.msg.gps_time_dep_a.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 407084900, "incorrect value for last_msg.msg.gps_time_dep_a.tow, expected 407084900, is %d", last_msg.msg.gps_time_dep_a.tow); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1838, "incorrect value for last_msg.msg.gps_time_dep_a.wn, expected 1838, is %d", last_msg.msg.gps_time_dep_a.wn); + ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, + "incorrect value for last_msg.msg.gps_time_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_dep_a.flags); + + ck_assert_msg( + last_msg.msg.gps_time_dep_a.ns_residual == -236144, + "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected " + "-236144, is %d", + last_msg.msg.gps_time_dep_a.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 407084900, + "incorrect value for last_msg.msg.gps_time_dep_a.tow, " + "expected 407084900, is %d", + last_msg.msg.gps_time_dep_a.tow); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1838, + "incorrect value for last_msg.msg.gps_time_dep_a.wn, " + "expected 1838, is %d", + last_msg.msg.gps_time_dep_a.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -664,59 +859,80 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,1,195,4,11,46,7,46,162,68,24,205,230,250,255,0,11,225, }; + u8 encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 46, 162, + 68, 24, 205, 230, 250, 255, 0, 11, 225, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_dep_a.flags = 0; - + test_msg.gps_time_dep_a.ns_residual = -334131; - + test_msg.gps_time_dep_a.tow = 407151150; - + test_msg.gps_time_dep_a.wn = 1838; - sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, "incorrect value for last_msg.msg.gps_time_dep_a.flags, expected 0, is %d", last_msg.msg.gps_time_dep_a.flags); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.ns_residual == -334131, "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected -334131, is %d", last_msg.msg.gps_time_dep_a.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 407151150, "incorrect value for last_msg.msg.gps_time_dep_a.tow, expected 407151150, is %d", last_msg.msg.gps_time_dep_a.tow); - - ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1838, "incorrect value for last_msg.msg.gps_time_dep_a.wn, expected 1838, is %d", last_msg.msg.gps_time_dep_a.wn); + ck_assert_msg(last_msg.msg.gps_time_dep_a.flags == 0, + "incorrect value for last_msg.msg.gps_time_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_dep_a.flags); + + ck_assert_msg( + last_msg.msg.gps_time_dep_a.ns_residual == -334131, + "incorrect value for last_msg.msg.gps_time_dep_a.ns_residual, expected " + "-334131, is %d", + last_msg.msg.gps_time_dep_a.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.tow == 407151150, + "incorrect value for last_msg.msg.gps_time_dep_a.tow, " + "expected 407151150, is %d", + last_msg.msg.gps_time_dep_a.tow); + + ck_assert_msg(last_msg.msg.gps_time_dep_a.wn == 1838, + "incorrect value for last_msg.msg.gps_time_dep_a.wn, " + "expected 1838, is %d", + last_msg.msg.gps_time_dep_a.wn); } } END_TEST -Suite* auto_check_sbp_navigation_MsgGPSTimeDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgGPSTimeDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgGPSTimeDepA"); +Suite *auto_check_sbp_navigation_MsgGPSTimeDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgGPSTimeDepA"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgGPSTimeDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgGPSTimeDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgGPSTimeGNSS.c b/c/test/auto_check_sbp_navigation_MsgGPSTimeGNSS.c index 922cc96e2..768f01fe3 100644 --- a/c/test/auto_check_sbp_navigation_MsgGPSTimeGNSS.c +++ b/c/test/auto_check_sbp_navigation_MsgGPSTimeGNSS.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeGNSS.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeGNSS ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgGPSTimeGNSS) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeGNSS ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,56 +90,76 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeGNSS ) logging_reset(); - sbp_callback_register(&sbp_state, 0x104, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x104, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,1,211,136,11,128,7,40,244,122,19,244,139,2,0,0,153,88, }; + u8 encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 40, 244, + 122, 19, 244, 139, 2, 0, 0, 153, 88, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_gnss.flags = 0; - + test_msg.gps_time_gnss.ns_residual = 166900; - + test_msg.gps_time_gnss.tow = 326825000; - + test_msg.gps_time_gnss.wn = 1920; - sbp_message_send(&sbp_state, SbpMsgGpsTimeGnss, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeGnss, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeGnss, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeGnss, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_gnss.flags == 0, "incorrect value for last_msg.msg.gps_time_gnss.flags, expected 0, is %d", last_msg.msg.gps_time_gnss.flags); - - ck_assert_msg(last_msg.msg.gps_time_gnss.ns_residual == 166900, "incorrect value for last_msg.msg.gps_time_gnss.ns_residual, expected 166900, is %d", last_msg.msg.gps_time_gnss.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_gnss.tow == 326825000, "incorrect value for last_msg.msg.gps_time_gnss.tow, expected 326825000, is %d", last_msg.msg.gps_time_gnss.tow); - - ck_assert_msg(last_msg.msg.gps_time_gnss.wn == 1920, "incorrect value for last_msg.msg.gps_time_gnss.wn, expected 1920, is %d", last_msg.msg.gps_time_gnss.wn); + ck_assert_msg(last_msg.msg.gps_time_gnss.flags == 0, + "incorrect value for last_msg.msg.gps_time_gnss.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_gnss.flags); + + ck_assert_msg(last_msg.msg.gps_time_gnss.ns_residual == 166900, + "incorrect value for last_msg.msg.gps_time_gnss.ns_residual, " + "expected 166900, is %d", + last_msg.msg.gps_time_gnss.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_gnss.tow == 326825000, + "incorrect value for last_msg.msg.gps_time_gnss.tow, " + "expected 326825000, is %d", + last_msg.msg.gps_time_gnss.tow); + + ck_assert_msg(last_msg.msg.gps_time_gnss.wn == 1920, + "incorrect value for last_msg.msg.gps_time_gnss.wn, expected " + "1920, is %d", + last_msg.msg.gps_time_gnss.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -151,56 +167,76 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeGNSS ) logging_reset(); - sbp_callback_register(&sbp_state, 0x104, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x104, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,1,211,136,11,128,7,28,246,122,19,126,234,3,0,0,250,195, }; + u8 encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 28, 246, + 122, 19, 126, 234, 3, 0, 0, 250, 195, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_gnss.flags = 0; - + test_msg.gps_time_gnss.ns_residual = 256638; - + test_msg.gps_time_gnss.tow = 326825500; - + test_msg.gps_time_gnss.wn = 1920; - sbp_message_send(&sbp_state, SbpMsgGpsTimeGnss, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeGnss, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeGnss, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeGnss, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_gnss.flags == 0, "incorrect value for last_msg.msg.gps_time_gnss.flags, expected 0, is %d", last_msg.msg.gps_time_gnss.flags); - - ck_assert_msg(last_msg.msg.gps_time_gnss.ns_residual == 256638, "incorrect value for last_msg.msg.gps_time_gnss.ns_residual, expected 256638, is %d", last_msg.msg.gps_time_gnss.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_gnss.tow == 326825500, "incorrect value for last_msg.msg.gps_time_gnss.tow, expected 326825500, is %d", last_msg.msg.gps_time_gnss.tow); - - ck_assert_msg(last_msg.msg.gps_time_gnss.wn == 1920, "incorrect value for last_msg.msg.gps_time_gnss.wn, expected 1920, is %d", last_msg.msg.gps_time_gnss.wn); + ck_assert_msg(last_msg.msg.gps_time_gnss.flags == 0, + "incorrect value for last_msg.msg.gps_time_gnss.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_gnss.flags); + + ck_assert_msg(last_msg.msg.gps_time_gnss.ns_residual == 256638, + "incorrect value for last_msg.msg.gps_time_gnss.ns_residual, " + "expected 256638, is %d", + last_msg.msg.gps_time_gnss.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_gnss.tow == 326825500, + "incorrect value for last_msg.msg.gps_time_gnss.tow, " + "expected 326825500, is %d", + last_msg.msg.gps_time_gnss.tow); + + ck_assert_msg(last_msg.msg.gps_time_gnss.wn == 1920, + "incorrect value for last_msg.msg.gps_time_gnss.wn, expected " + "1920, is %d", + last_msg.msg.gps_time_gnss.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -208,56 +244,76 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeGNSS ) logging_reset(); - sbp_callback_register(&sbp_state, 0x104, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x104, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,1,211,136,11,128,7,16,248,122,19,129,12,4,0,0,183,148, }; + u8 encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 16, 248, + 122, 19, 129, 12, 4, 0, 0, 183, 148, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_gnss.flags = 0; - + test_msg.gps_time_gnss.ns_residual = 265345; - + test_msg.gps_time_gnss.tow = 326826000; - + test_msg.gps_time_gnss.wn = 1920; - sbp_message_send(&sbp_state, SbpMsgGpsTimeGnss, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeGnss, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeGnss, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeGnss, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_gnss.flags == 0, "incorrect value for last_msg.msg.gps_time_gnss.flags, expected 0, is %d", last_msg.msg.gps_time_gnss.flags); - - ck_assert_msg(last_msg.msg.gps_time_gnss.ns_residual == 265345, "incorrect value for last_msg.msg.gps_time_gnss.ns_residual, expected 265345, is %d", last_msg.msg.gps_time_gnss.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_gnss.tow == 326826000, "incorrect value for last_msg.msg.gps_time_gnss.tow, expected 326826000, is %d", last_msg.msg.gps_time_gnss.tow); - - ck_assert_msg(last_msg.msg.gps_time_gnss.wn == 1920, "incorrect value for last_msg.msg.gps_time_gnss.wn, expected 1920, is %d", last_msg.msg.gps_time_gnss.wn); + ck_assert_msg(last_msg.msg.gps_time_gnss.flags == 0, + "incorrect value for last_msg.msg.gps_time_gnss.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_gnss.flags); + + ck_assert_msg(last_msg.msg.gps_time_gnss.ns_residual == 265345, + "incorrect value for last_msg.msg.gps_time_gnss.ns_residual, " + "expected 265345, is %d", + last_msg.msg.gps_time_gnss.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_gnss.tow == 326826000, + "incorrect value for last_msg.msg.gps_time_gnss.tow, " + "expected 326826000, is %d", + last_msg.msg.gps_time_gnss.tow); + + ck_assert_msg(last_msg.msg.gps_time_gnss.wn == 1920, + "incorrect value for last_msg.msg.gps_time_gnss.wn, expected " + "1920, is %d", + last_msg.msg.gps_time_gnss.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -265,56 +321,76 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeGNSS ) logging_reset(); - sbp_callback_register(&sbp_state, 0x104, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x104, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,1,211,136,11,128,7,4,250,122,19,137,204,4,0,0,137,101, }; + u8 encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 4, 250, + 122, 19, 137, 204, 4, 0, 0, 137, 101, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_gnss.flags = 0; - + test_msg.gps_time_gnss.ns_residual = 314505; - + test_msg.gps_time_gnss.tow = 326826500; - + test_msg.gps_time_gnss.wn = 1920; - sbp_message_send(&sbp_state, SbpMsgGpsTimeGnss, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeGnss, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeGnss, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeGnss, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_gnss.flags == 0, "incorrect value for last_msg.msg.gps_time_gnss.flags, expected 0, is %d", last_msg.msg.gps_time_gnss.flags); - - ck_assert_msg(last_msg.msg.gps_time_gnss.ns_residual == 314505, "incorrect value for last_msg.msg.gps_time_gnss.ns_residual, expected 314505, is %d", last_msg.msg.gps_time_gnss.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_gnss.tow == 326826500, "incorrect value for last_msg.msg.gps_time_gnss.tow, expected 326826500, is %d", last_msg.msg.gps_time_gnss.tow); - - ck_assert_msg(last_msg.msg.gps_time_gnss.wn == 1920, "incorrect value for last_msg.msg.gps_time_gnss.wn, expected 1920, is %d", last_msg.msg.gps_time_gnss.wn); + ck_assert_msg(last_msg.msg.gps_time_gnss.flags == 0, + "incorrect value for last_msg.msg.gps_time_gnss.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_gnss.flags); + + ck_assert_msg(last_msg.msg.gps_time_gnss.ns_residual == 314505, + "incorrect value for last_msg.msg.gps_time_gnss.ns_residual, " + "expected 314505, is %d", + last_msg.msg.gps_time_gnss.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_gnss.tow == 326826500, + "incorrect value for last_msg.msg.gps_time_gnss.tow, " + "expected 326826500, is %d", + last_msg.msg.gps_time_gnss.tow); + + ck_assert_msg(last_msg.msg.gps_time_gnss.wn == 1920, + "incorrect value for last_msg.msg.gps_time_gnss.wn, expected " + "1920, is %d", + last_msg.msg.gps_time_gnss.wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -322,59 +398,79 @@ START_TEST( test_auto_check_sbp_navigation_MsgGPSTimeGNSS ) logging_reset(); - sbp_callback_register(&sbp_state, 0x104, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x104, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,1,211,136,11,128,7,248,251,122,19,181,137,5,0,0,15,225, }; + u8 encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 248, 251, + 122, 19, 181, 137, 5, 0, 0, 15, 225, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gps_time_gnss.flags = 0; - + test_msg.gps_time_gnss.ns_residual = 362933; - + test_msg.gps_time_gnss.tow = 326827000; - + test_msg.gps_time_gnss.wn = 1920; - sbp_message_send(&sbp_state, SbpMsgGpsTimeGnss, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGpsTimeGnss, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGpsTimeGnss, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGpsTimeGnss, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gps_time_gnss.flags == 0, "incorrect value for last_msg.msg.gps_time_gnss.flags, expected 0, is %d", last_msg.msg.gps_time_gnss.flags); - - ck_assert_msg(last_msg.msg.gps_time_gnss.ns_residual == 362933, "incorrect value for last_msg.msg.gps_time_gnss.ns_residual, expected 362933, is %d", last_msg.msg.gps_time_gnss.ns_residual); - - ck_assert_msg(last_msg.msg.gps_time_gnss.tow == 326827000, "incorrect value for last_msg.msg.gps_time_gnss.tow, expected 326827000, is %d", last_msg.msg.gps_time_gnss.tow); - - ck_assert_msg(last_msg.msg.gps_time_gnss.wn == 1920, "incorrect value for last_msg.msg.gps_time_gnss.wn, expected 1920, is %d", last_msg.msg.gps_time_gnss.wn); + ck_assert_msg(last_msg.msg.gps_time_gnss.flags == 0, + "incorrect value for last_msg.msg.gps_time_gnss.flags, " + "expected 0, is %d", + last_msg.msg.gps_time_gnss.flags); + + ck_assert_msg(last_msg.msg.gps_time_gnss.ns_residual == 362933, + "incorrect value for last_msg.msg.gps_time_gnss.ns_residual, " + "expected 362933, is %d", + last_msg.msg.gps_time_gnss.ns_residual); + + ck_assert_msg(last_msg.msg.gps_time_gnss.tow == 326827000, + "incorrect value for last_msg.msg.gps_time_gnss.tow, " + "expected 326827000, is %d", + last_msg.msg.gps_time_gnss.tow); + + ck_assert_msg(last_msg.msg.gps_time_gnss.wn == 1920, + "incorrect value for last_msg.msg.gps_time_gnss.wn, expected " + "1920, is %d", + last_msg.msg.gps_time_gnss.wn); } } END_TEST -Suite* auto_check_sbp_navigation_MsgGPSTimeGNSS_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgGPSTimeGNSS"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgGPSTimeGNSS"); +Suite *auto_check_sbp_navigation_MsgGPSTimeGNSS_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgGPSTimeGNSS"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgGPSTimeGNSS"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgGPSTimeGNSS); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgPosECEF.c b/c/test/auto_check_sbp_navigation_MsgPosECEF.c index d14aa3cec..b8517596b 100644 --- a/c/test/auto_check_sbp_navigation_MsgPosECEF.c +++ b/c/test/auto_check_sbp_navigation_MsgPosECEF.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEF.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgPosECEF ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgPosECEF) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEF ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,68 +90,96 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEF ) logging_reset(); - sbp_callback_register(&sbp_state, 0x209, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x209, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,9,2,211,136,32,16,248,122,19,73,29,46,132,182,122,68,193,219,192,29,176,121,119,80,193,83,11,210,90,79,75,77,65,0,0,15,2,84,6, }; + u8 encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 16, 248, 122, 19, 73, 29, 46, 132, + 182, 122, 68, 193, 219, 192, 29, 176, 121, 119, 80, 193, 83, 11, + 210, 90, 79, 75, 77, 65, 0, 0, 15, 2, 84, 6, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef.accuracy = 0; - + test_msg.pos_ecef.flags = 2; - + test_msg.pos_ecef.n_sats = 15; - + test_msg.pos_ecef.tow = 326826000; - + test_msg.pos_ecef.x = -2684269.0326572997; - + test_msg.pos_ecef.y = -4316646.751816; - + test_msg.pos_ecef.z = 3839646.7095350414; sbp_message_send(&sbp_state, SbpMsgPosEcef, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgPosEcef, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef.accuracy == 0, "incorrect value for last_msg.msg.pos_ecef.accuracy, expected 0, is %d", last_msg.msg.pos_ecef.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef.flags == 2, "incorrect value for last_msg.msg.pos_ecef.flags, expected 2, is %d", last_msg.msg.pos_ecef.flags); - - ck_assert_msg(last_msg.msg.pos_ecef.n_sats == 15, "incorrect value for last_msg.msg.pos_ecef.n_sats, expected 15, is %d", last_msg.msg.pos_ecef.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef.tow == 326826000, "incorrect value for last_msg.msg.pos_ecef.tow, expected 326826000, is %d", last_msg.msg.pos_ecef.tow); - - ck_assert_msg((last_msg.msg.pos_ecef.x * 100 - -2684269.03266 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef.x, expected -2684269.03266, is %s", last_msg.msg.pos_ecef.x); - - ck_assert_msg((last_msg.msg.pos_ecef.y * 100 - -4316646.75182 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef.y, expected -4316646.75182, is %s", last_msg.msg.pos_ecef.y); - - ck_assert_msg((last_msg.msg.pos_ecef.z * 100 - 3839646.70954 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef.z, expected 3839646.70954, is %s", last_msg.msg.pos_ecef.z); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.pos_ecef.accuracy == 0, + "incorrect value for last_msg.msg.pos_ecef.accuracy, expected 0, is %d", + last_msg.msg.pos_ecef.accuracy); + + ck_assert_msg( + last_msg.msg.pos_ecef.flags == 2, + "incorrect value for last_msg.msg.pos_ecef.flags, expected 2, is %d", + last_msg.msg.pos_ecef.flags); + + ck_assert_msg( + last_msg.msg.pos_ecef.n_sats == 15, + "incorrect value for last_msg.msg.pos_ecef.n_sats, expected 15, is %d", + last_msg.msg.pos_ecef.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef.tow == 326826000, + "incorrect value for last_msg.msg.pos_ecef.tow, expected " + "326826000, is %d", + last_msg.msg.pos_ecef.tow); + + ck_assert_msg((last_msg.msg.pos_ecef.x * 100 - -2684269.03266 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef.x, expected " + "-2684269.03266, is %s", + last_msg.msg.pos_ecef.x); + + ck_assert_msg((last_msg.msg.pos_ecef.y * 100 - -4316646.75182 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef.y, expected " + "-4316646.75182, is %s", + last_msg.msg.pos_ecef.y); + + ck_assert_msg((last_msg.msg.pos_ecef.z * 100 - 3839646.70954 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef.z, expected " + "3839646.70954, is %s", + last_msg.msg.pos_ecef.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -163,68 +187,96 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEF ) logging_reset(); - sbp_callback_register(&sbp_state, 0x209, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x209, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,9,2,211,136,32,248,251,122,19,103,106,57,136,182,122,68,193,176,242,200,176,121,119,80,193,244,135,97,59,79,75,77,65,0,0,15,2,147,216, }; + u8 encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 248, 251, 122, 19, 103, 106, 57, 136, + 182, 122, 68, 193, 176, 242, 200, 176, 121, 119, 80, 193, 244, 135, + 97, 59, 79, 75, 77, 65, 0, 0, 15, 2, 147, 216, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef.accuracy = 0; - + test_msg.pos_ecef.flags = 2; - + test_msg.pos_ecef.n_sats = 15; - + test_msg.pos_ecef.tow = 326827000; - + test_msg.pos_ecef.x = -2684269.064252186; - + test_msg.pos_ecef.y = -4316646.762264892; - + test_msg.pos_ecef.z = 3839646.463913912; sbp_message_send(&sbp_state, SbpMsgPosEcef, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgPosEcef, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef.accuracy == 0, "incorrect value for last_msg.msg.pos_ecef.accuracy, expected 0, is %d", last_msg.msg.pos_ecef.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef.flags == 2, "incorrect value for last_msg.msg.pos_ecef.flags, expected 2, is %d", last_msg.msg.pos_ecef.flags); - - ck_assert_msg(last_msg.msg.pos_ecef.n_sats == 15, "incorrect value for last_msg.msg.pos_ecef.n_sats, expected 15, is %d", last_msg.msg.pos_ecef.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef.tow == 326827000, "incorrect value for last_msg.msg.pos_ecef.tow, expected 326827000, is %d", last_msg.msg.pos_ecef.tow); - - ck_assert_msg((last_msg.msg.pos_ecef.x * 100 - -2684269.06425 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef.x, expected -2684269.06425, is %s", last_msg.msg.pos_ecef.x); - - ck_assert_msg((last_msg.msg.pos_ecef.y * 100 - -4316646.76226 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef.y, expected -4316646.76226, is %s", last_msg.msg.pos_ecef.y); - - ck_assert_msg((last_msg.msg.pos_ecef.z * 100 - 3839646.46391 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef.z, expected 3839646.46391, is %s", last_msg.msg.pos_ecef.z); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.pos_ecef.accuracy == 0, + "incorrect value for last_msg.msg.pos_ecef.accuracy, expected 0, is %d", + last_msg.msg.pos_ecef.accuracy); + + ck_assert_msg( + last_msg.msg.pos_ecef.flags == 2, + "incorrect value for last_msg.msg.pos_ecef.flags, expected 2, is %d", + last_msg.msg.pos_ecef.flags); + + ck_assert_msg( + last_msg.msg.pos_ecef.n_sats == 15, + "incorrect value for last_msg.msg.pos_ecef.n_sats, expected 15, is %d", + last_msg.msg.pos_ecef.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef.tow == 326827000, + "incorrect value for last_msg.msg.pos_ecef.tow, expected " + "326827000, is %d", + last_msg.msg.pos_ecef.tow); + + ck_assert_msg((last_msg.msg.pos_ecef.x * 100 - -2684269.06425 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef.x, expected " + "-2684269.06425, is %s", + last_msg.msg.pos_ecef.x); + + ck_assert_msg((last_msg.msg.pos_ecef.y * 100 - -4316646.76226 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef.y, expected " + "-4316646.76226, is %s", + last_msg.msg.pos_ecef.y); + + ck_assert_msg((last_msg.msg.pos_ecef.z * 100 - 3839646.46391 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef.z, expected " + "3839646.46391, is %s", + last_msg.msg.pos_ecef.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -232,68 +284,96 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEF ) logging_reset(); - sbp_callback_register(&sbp_state, 0x209, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x209, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,9,2,211,136,32,224,255,122,19,101,179,242,182,182,122,68,193,130,196,145,199,121,119,80,193,212,10,253,15,79,75,77,65,0,0,15,2,40,201, }; + u8 encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 224, 255, 122, 19, 101, 179, 242, 182, + 182, 122, 68, 193, 130, 196, 145, 199, 121, 119, 80, 193, 212, 10, + 253, 15, 79, 75, 77, 65, 0, 0, 15, 2, 40, 201, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef.accuracy = 0; - + test_msg.pos_ecef.flags = 2; - + test_msg.pos_ecef.n_sats = 15; - + test_msg.pos_ecef.tow = 326828000; - + test_msg.pos_ecef.x = -2684269.4292816394; - + test_msg.pos_ecef.y = -4316647.118271949; - + test_msg.pos_ecef.z = 3839646.124909738; sbp_message_send(&sbp_state, SbpMsgPosEcef, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgPosEcef, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef.accuracy == 0, "incorrect value for last_msg.msg.pos_ecef.accuracy, expected 0, is %d", last_msg.msg.pos_ecef.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef.flags == 2, "incorrect value for last_msg.msg.pos_ecef.flags, expected 2, is %d", last_msg.msg.pos_ecef.flags); - - ck_assert_msg(last_msg.msg.pos_ecef.n_sats == 15, "incorrect value for last_msg.msg.pos_ecef.n_sats, expected 15, is %d", last_msg.msg.pos_ecef.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef.tow == 326828000, "incorrect value for last_msg.msg.pos_ecef.tow, expected 326828000, is %d", last_msg.msg.pos_ecef.tow); - - ck_assert_msg((last_msg.msg.pos_ecef.x * 100 - -2684269.42928 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef.x, expected -2684269.42928, is %s", last_msg.msg.pos_ecef.x); - - ck_assert_msg((last_msg.msg.pos_ecef.y * 100 - -4316647.11827 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef.y, expected -4316647.11827, is %s", last_msg.msg.pos_ecef.y); - - ck_assert_msg((last_msg.msg.pos_ecef.z * 100 - 3839646.12491 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef.z, expected 3839646.12491, is %s", last_msg.msg.pos_ecef.z); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.pos_ecef.accuracy == 0, + "incorrect value for last_msg.msg.pos_ecef.accuracy, expected 0, is %d", + last_msg.msg.pos_ecef.accuracy); + + ck_assert_msg( + last_msg.msg.pos_ecef.flags == 2, + "incorrect value for last_msg.msg.pos_ecef.flags, expected 2, is %d", + last_msg.msg.pos_ecef.flags); + + ck_assert_msg( + last_msg.msg.pos_ecef.n_sats == 15, + "incorrect value for last_msg.msg.pos_ecef.n_sats, expected 15, is %d", + last_msg.msg.pos_ecef.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef.tow == 326828000, + "incorrect value for last_msg.msg.pos_ecef.tow, expected " + "326828000, is %d", + last_msg.msg.pos_ecef.tow); + + ck_assert_msg((last_msg.msg.pos_ecef.x * 100 - -2684269.42928 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef.x, expected " + "-2684269.42928, is %s", + last_msg.msg.pos_ecef.x); + + ck_assert_msg((last_msg.msg.pos_ecef.y * 100 - -4316647.11827 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef.y, expected " + "-4316647.11827, is %s", + last_msg.msg.pos_ecef.y); + + ck_assert_msg((last_msg.msg.pos_ecef.z * 100 - 3839646.12491 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef.z, expected " + "3839646.12491, is %s", + last_msg.msg.pos_ecef.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -301,71 +381,99 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEF ) logging_reset(); - sbp_callback_register(&sbp_state, 0x209, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x209, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,9,2,211,136,32,200,3,123,19,146,214,132,215,182,122,68,193,213,68,49,215,121,119,80,193,71,34,110,243,78,75,77,65,0,0,15,2,187,86, }; + u8 encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 200, 3, 123, 19, 146, 214, 132, 215, + 182, 122, 68, 193, 213, 68, 49, 215, 121, 119, 80, 193, 71, 34, + 110, 243, 78, 75, 77, 65, 0, 0, 15, 2, 187, 86, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef.accuracy = 0; - + test_msg.pos_ecef.flags = 2; - + test_msg.pos_ecef.n_sats = 15; - + test_msg.pos_ecef.tow = 326829000; - + test_msg.pos_ecef.x = -2684269.683741399; - + test_msg.pos_ecef.y = -4316647.3623821335; - + test_msg.pos_ecef.z = 3839645.90179852; sbp_message_send(&sbp_state, SbpMsgPosEcef, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgPosEcef, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef.accuracy == 0, "incorrect value for last_msg.msg.pos_ecef.accuracy, expected 0, is %d", last_msg.msg.pos_ecef.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef.flags == 2, "incorrect value for last_msg.msg.pos_ecef.flags, expected 2, is %d", last_msg.msg.pos_ecef.flags); - - ck_assert_msg(last_msg.msg.pos_ecef.n_sats == 15, "incorrect value for last_msg.msg.pos_ecef.n_sats, expected 15, is %d", last_msg.msg.pos_ecef.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef.tow == 326829000, "incorrect value for last_msg.msg.pos_ecef.tow, expected 326829000, is %d", last_msg.msg.pos_ecef.tow); - - ck_assert_msg((last_msg.msg.pos_ecef.x * 100 - -2684269.68374 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef.x, expected -2684269.68374, is %s", last_msg.msg.pos_ecef.x); - - ck_assert_msg((last_msg.msg.pos_ecef.y * 100 - -4316647.36238 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef.y, expected -4316647.36238, is %s", last_msg.msg.pos_ecef.y); - - ck_assert_msg((last_msg.msg.pos_ecef.z * 100 - 3839645.9018 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef.z, expected 3839645.9018, is %s", last_msg.msg.pos_ecef.z); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.pos_ecef.accuracy == 0, + "incorrect value for last_msg.msg.pos_ecef.accuracy, expected 0, is %d", + last_msg.msg.pos_ecef.accuracy); + + ck_assert_msg( + last_msg.msg.pos_ecef.flags == 2, + "incorrect value for last_msg.msg.pos_ecef.flags, expected 2, is %d", + last_msg.msg.pos_ecef.flags); + + ck_assert_msg( + last_msg.msg.pos_ecef.n_sats == 15, + "incorrect value for last_msg.msg.pos_ecef.n_sats, expected 15, is %d", + last_msg.msg.pos_ecef.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef.tow == 326829000, + "incorrect value for last_msg.msg.pos_ecef.tow, expected " + "326829000, is %d", + last_msg.msg.pos_ecef.tow); + + ck_assert_msg((last_msg.msg.pos_ecef.x * 100 - -2684269.68374 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef.x, expected " + "-2684269.68374, is %s", + last_msg.msg.pos_ecef.x); + + ck_assert_msg((last_msg.msg.pos_ecef.y * 100 - -4316647.36238 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef.y, expected " + "-4316647.36238, is %s", + last_msg.msg.pos_ecef.y); + + ck_assert_msg((last_msg.msg.pos_ecef.z * 100 - 3839645.9018 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef.z, expected " + "3839645.9018, is %s", + last_msg.msg.pos_ecef.z); } } END_TEST -Suite* auto_check_sbp_navigation_MsgPosECEF_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgPosECEF"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosECEF"); +Suite *auto_check_sbp_navigation_MsgPosECEF_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgPosECEF"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosECEF"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgPosECEF); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgPosECEFCov.c b/c/test/auto_check_sbp_navigation_MsgPosECEFCov.c index 6a20a535b..c1de64488 100644 --- a/c/test/auto_check_sbp_navigation_MsgPosECEFCov.c +++ b/c/test/auto_check_sbp_navigation_MsgPosECEFCov.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCov.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCov.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgPosECEFCov ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgPosECEFCov) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFCov ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,91 +90,136 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFCov ) logging_reset(); - sbp_callback_register(&sbp_state, 0x214, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x214, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,20,2,66,0,54,7,0,0,0,0,0,0,0,0,0,24,64,0,0,0,0,0,0,240,63,0,0,0,0,0,0,16,64,0,0,0,65,0,0,224,64,0,0,0,64,0,0,192,64,0,0,0,65,0,0,160,64,4,5,249,167, }; + u8 encoded_frame[] = { + 85, 20, 2, 66, 0, 54, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 24, 64, 0, 0, 0, 0, 0, 0, 240, 63, 0, 0, 0, 0, 0, 0, + 16, 64, 0, 0, 0, 65, 0, 0, 224, 64, 0, 0, 0, 64, 0, 0, + 192, 64, 0, 0, 0, 65, 0, 0, 160, 64, 4, 5, 249, 167, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef_cov.cov_x_x = 8.0; - + test_msg.pos_ecef_cov.cov_x_y = 7.0; - + test_msg.pos_ecef_cov.cov_x_z = 2.0; - + test_msg.pos_ecef_cov.cov_y_y = 6.0; - + test_msg.pos_ecef_cov.cov_y_z = 8.0; - + test_msg.pos_ecef_cov.cov_z_z = 5.0; - + test_msg.pos_ecef_cov.flags = 5; - + test_msg.pos_ecef_cov.n_sats = 4; - + test_msg.pos_ecef_cov.tow = 7; - + test_msg.pos_ecef_cov.x = 6.0; - + test_msg.pos_ecef_cov.y = 1.0; - + test_msg.pos_ecef_cov.z = 4.0; sbp_message_send(&sbp_state, SbpMsgPosEcefCov, 66, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosEcefCov, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosEcefCov, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.pos_ecef_cov.cov_x_x * 100 - 8.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov.cov_x_x, expected 8.0, is %s", last_msg.msg.pos_ecef_cov.cov_x_x); - - ck_assert_msg((last_msg.msg.pos_ecef_cov.cov_x_y * 100 - 7.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov.cov_x_y, expected 7.0, is %s", last_msg.msg.pos_ecef_cov.cov_x_y); - - ck_assert_msg((last_msg.msg.pos_ecef_cov.cov_x_z * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov.cov_x_z, expected 2.0, is %s", last_msg.msg.pos_ecef_cov.cov_x_z); - - ck_assert_msg((last_msg.msg.pos_ecef_cov.cov_y_y * 100 - 6.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov.cov_y_y, expected 6.0, is %s", last_msg.msg.pos_ecef_cov.cov_y_y); - - ck_assert_msg((last_msg.msg.pos_ecef_cov.cov_y_z * 100 - 8.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov.cov_y_z, expected 8.0, is %s", last_msg.msg.pos_ecef_cov.cov_y_z); - - ck_assert_msg((last_msg.msg.pos_ecef_cov.cov_z_z * 100 - 5.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov.cov_z_z, expected 5.0, is %s", last_msg.msg.pos_ecef_cov.cov_z_z); - - ck_assert_msg(last_msg.msg.pos_ecef_cov.flags == 5, "incorrect value for last_msg.msg.pos_ecef_cov.flags, expected 5, is %d", last_msg.msg.pos_ecef_cov.flags); - - ck_assert_msg(last_msg.msg.pos_ecef_cov.n_sats == 4, "incorrect value for last_msg.msg.pos_ecef_cov.n_sats, expected 4, is %d", last_msg.msg.pos_ecef_cov.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef_cov.tow == 7, "incorrect value for last_msg.msg.pos_ecef_cov.tow, expected 7, is %d", last_msg.msg.pos_ecef_cov.tow); - - ck_assert_msg((last_msg.msg.pos_ecef_cov.x * 100 - 6.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov.x, expected 6.0, is %s", last_msg.msg.pos_ecef_cov.x); - - ck_assert_msg((last_msg.msg.pos_ecef_cov.y * 100 - 1.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov.y, expected 1.0, is %s", last_msg.msg.pos_ecef_cov.y); - - ck_assert_msg((last_msg.msg.pos_ecef_cov.z * 100 - 4.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov.z, expected 4.0, is %s", last_msg.msg.pos_ecef_cov.z); + ck_assert_msg((last_msg.msg.pos_ecef_cov.cov_x_x * 100 - 8.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov.cov_x_x, " + "expected 8.0, is %s", + last_msg.msg.pos_ecef_cov.cov_x_x); + + ck_assert_msg((last_msg.msg.pos_ecef_cov.cov_x_y * 100 - 7.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov.cov_x_y, " + "expected 7.0, is %s", + last_msg.msg.pos_ecef_cov.cov_x_y); + + ck_assert_msg((last_msg.msg.pos_ecef_cov.cov_x_z * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov.cov_x_z, " + "expected 2.0, is %s", + last_msg.msg.pos_ecef_cov.cov_x_z); + + ck_assert_msg((last_msg.msg.pos_ecef_cov.cov_y_y * 100 - 6.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov.cov_y_y, " + "expected 6.0, is %s", + last_msg.msg.pos_ecef_cov.cov_y_y); + + ck_assert_msg((last_msg.msg.pos_ecef_cov.cov_y_z * 100 - 8.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov.cov_y_z, " + "expected 8.0, is %s", + last_msg.msg.pos_ecef_cov.cov_y_z); + + ck_assert_msg((last_msg.msg.pos_ecef_cov.cov_z_z * 100 - 5.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov.cov_z_z, " + "expected 5.0, is %s", + last_msg.msg.pos_ecef_cov.cov_z_z); + + ck_assert_msg(last_msg.msg.pos_ecef_cov.flags == 5, + "incorrect value for last_msg.msg.pos_ecef_cov.flags, " + "expected 5, is %d", + last_msg.msg.pos_ecef_cov.flags); + + ck_assert_msg(last_msg.msg.pos_ecef_cov.n_sats == 4, + "incorrect value for last_msg.msg.pos_ecef_cov.n_sats, " + "expected 4, is %d", + last_msg.msg.pos_ecef_cov.n_sats); + + ck_assert_msg( + last_msg.msg.pos_ecef_cov.tow == 7, + "incorrect value for last_msg.msg.pos_ecef_cov.tow, expected 7, is %d", + last_msg.msg.pos_ecef_cov.tow); + + ck_assert_msg( + (last_msg.msg.pos_ecef_cov.x * 100 - 6.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov.x, expected 6.0, is %s", + last_msg.msg.pos_ecef_cov.x); + + ck_assert_msg( + (last_msg.msg.pos_ecef_cov.y * 100 - 1.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov.y, expected 1.0, is %s", + last_msg.msg.pos_ecef_cov.y); + + ck_assert_msg( + (last_msg.msg.pos_ecef_cov.z * 100 - 4.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov.z, expected 4.0, is %s", + last_msg.msg.pos_ecef_cov.z); } } END_TEST -Suite* auto_check_sbp_navigation_MsgPosECEFCov_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgPosECEFCov"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosECEFCov"); +Suite *auto_check_sbp_navigation_MsgPosECEFCov_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgPosECEFCov"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosECEFCov"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgPosECEFCov); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgPosECEFCovGNSS.c b/c/test/auto_check_sbp_navigation_MsgPosECEFCovGNSS.c index 8221c251b..966cce4f5 100644 --- a/c/test/auto_check_sbp_navigation_MsgPosECEFCovGNSS.c +++ b/c/test/auto_check_sbp_navigation_MsgPosECEFCovGNSS.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCovGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCovGNSS.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgPosECEFCovGNSS ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgPosECEFCovGNSS) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFCovGNSS ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,91 +90,147 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFCovGNSS ) logging_reset(); - sbp_callback_register(&sbp_state, 0x234, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x234, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,52,2,0,16,54,24,229,233,29,52,254,158,218,42,142,68,193,69,162,89,91,34,68,80,193,131,21,176,129,239,174,77,65,158,232,30,60,218,221,20,60,129,136,198,187,205,120,166,60,5,166,35,188,122,177,115,60,18,4,159,102, }; + u8 encoded_frame[] = { + 85, 52, 2, 0, 16, 54, 24, 229, 233, 29, 52, 254, 158, + 218, 42, 142, 68, 193, 69, 162, 89, 91, 34, 68, 80, 193, + 131, 21, 176, 129, 239, 174, 77, 65, 158, 232, 30, 60, 218, + 221, 20, 60, 129, 136, 198, 187, 205, 120, 166, 60, 5, 166, + 35, 188, 122, 177, 115, 60, 18, 4, 159, 102, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef_cov_gnss.cov_x_x = 0.009699014946818352; - + test_msg.pos_ecef_cov_gnss.cov_x_y = 0.009086096659302711; - + test_msg.pos_ecef_cov_gnss.cov_x_z = -0.006058753002434969; - + test_msg.pos_ecef_cov_gnss.cov_y_y = 0.020321274176239967; - + test_msg.pos_ecef_cov_gnss.cov_y_z = -0.009988312609493732; - + test_msg.pos_ecef_cov_gnss.cov_z_z = 0.01487385667860508; - + test_msg.pos_ecef_cov_gnss.flags = 4; - + test_msg.pos_ecef_cov_gnss.n_sats = 18; - + test_msg.pos_ecef_cov_gnss.tow = 501867800; - + test_msg.pos_ecef_cov_gnss.x = -2694229.7079770807; - + test_msg.pos_ecef_cov_gnss.y = -4264073.427345817; - + test_msg.pos_ecef_cov_gnss.z = 3890655.013186158; - sbp_message_send(&sbp_state, SbpMsgPosEcefCovGnss, 4096, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosEcefCovGnss, 4096, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosEcefCovGnss, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosEcefCovGnss, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.pos_ecef_cov_gnss.cov_x_x * 100 - 0.00969901494682 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov_gnss.cov_x_x, expected 0.00969901494682, is %s", last_msg.msg.pos_ecef_cov_gnss.cov_x_x); - - ck_assert_msg((last_msg.msg.pos_ecef_cov_gnss.cov_x_y * 100 - 0.0090860966593 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov_gnss.cov_x_y, expected 0.0090860966593, is %s", last_msg.msg.pos_ecef_cov_gnss.cov_x_y); - - ck_assert_msg((last_msg.msg.pos_ecef_cov_gnss.cov_x_z * 100 - -0.00605875300243 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov_gnss.cov_x_z, expected -0.00605875300243, is %s", last_msg.msg.pos_ecef_cov_gnss.cov_x_z); - - ck_assert_msg((last_msg.msg.pos_ecef_cov_gnss.cov_y_y * 100 - 0.0203212741762 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov_gnss.cov_y_y, expected 0.0203212741762, is %s", last_msg.msg.pos_ecef_cov_gnss.cov_y_y); - - ck_assert_msg((last_msg.msg.pos_ecef_cov_gnss.cov_y_z * 100 - -0.00998831260949 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov_gnss.cov_y_z, expected -0.00998831260949, is %s", last_msg.msg.pos_ecef_cov_gnss.cov_y_z); - - ck_assert_msg((last_msg.msg.pos_ecef_cov_gnss.cov_z_z * 100 - 0.0148738566786 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov_gnss.cov_z_z, expected 0.0148738566786, is %s", last_msg.msg.pos_ecef_cov_gnss.cov_z_z); - - ck_assert_msg(last_msg.msg.pos_ecef_cov_gnss.flags == 4, "incorrect value for last_msg.msg.pos_ecef_cov_gnss.flags, expected 4, is %d", last_msg.msg.pos_ecef_cov_gnss.flags); - - ck_assert_msg(last_msg.msg.pos_ecef_cov_gnss.n_sats == 18, "incorrect value for last_msg.msg.pos_ecef_cov_gnss.n_sats, expected 18, is %d", last_msg.msg.pos_ecef_cov_gnss.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef_cov_gnss.tow == 501867800, "incorrect value for last_msg.msg.pos_ecef_cov_gnss.tow, expected 501867800, is %d", last_msg.msg.pos_ecef_cov_gnss.tow); - - ck_assert_msg((last_msg.msg.pos_ecef_cov_gnss.x * 100 - -2694229.70798 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov_gnss.x, expected -2694229.70798, is %s", last_msg.msg.pos_ecef_cov_gnss.x); - - ck_assert_msg((last_msg.msg.pos_ecef_cov_gnss.y * 100 - -4264073.42735 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov_gnss.y, expected -4264073.42735, is %s", last_msg.msg.pos_ecef_cov_gnss.y); - - ck_assert_msg((last_msg.msg.pos_ecef_cov_gnss.z * 100 - 3890655.01319 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_cov_gnss.z, expected 3890655.01319, is %s", last_msg.msg.pos_ecef_cov_gnss.z); + ck_assert_msg((last_msg.msg.pos_ecef_cov_gnss.cov_x_x * 100 - + 0.00969901494682 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov_gnss.cov_x_x, " + "expected 0.00969901494682, is %s", + last_msg.msg.pos_ecef_cov_gnss.cov_x_x); + + ck_assert_msg((last_msg.msg.pos_ecef_cov_gnss.cov_x_y * 100 - + 0.0090860966593 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov_gnss.cov_x_y, " + "expected 0.0090860966593, is %s", + last_msg.msg.pos_ecef_cov_gnss.cov_x_y); + + ck_assert_msg((last_msg.msg.pos_ecef_cov_gnss.cov_x_z * 100 - + -0.00605875300243 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov_gnss.cov_x_z, " + "expected -0.00605875300243, is %s", + last_msg.msg.pos_ecef_cov_gnss.cov_x_z); + + ck_assert_msg((last_msg.msg.pos_ecef_cov_gnss.cov_y_y * 100 - + 0.0203212741762 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov_gnss.cov_y_y, " + "expected 0.0203212741762, is %s", + last_msg.msg.pos_ecef_cov_gnss.cov_y_y); + + ck_assert_msg((last_msg.msg.pos_ecef_cov_gnss.cov_y_z * 100 - + -0.00998831260949 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov_gnss.cov_y_z, " + "expected -0.00998831260949, is %s", + last_msg.msg.pos_ecef_cov_gnss.cov_y_z); + + ck_assert_msg((last_msg.msg.pos_ecef_cov_gnss.cov_z_z * 100 - + 0.0148738566786 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov_gnss.cov_z_z, " + "expected 0.0148738566786, is %s", + last_msg.msg.pos_ecef_cov_gnss.cov_z_z); + + ck_assert_msg(last_msg.msg.pos_ecef_cov_gnss.flags == 4, + "incorrect value for last_msg.msg.pos_ecef_cov_gnss.flags, " + "expected 4, is %d", + last_msg.msg.pos_ecef_cov_gnss.flags); + + ck_assert_msg(last_msg.msg.pos_ecef_cov_gnss.n_sats == 18, + "incorrect value for last_msg.msg.pos_ecef_cov_gnss.n_sats, " + "expected 18, is %d", + last_msg.msg.pos_ecef_cov_gnss.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef_cov_gnss.tow == 501867800, + "incorrect value for last_msg.msg.pos_ecef_cov_gnss.tow, " + "expected 501867800, is %d", + last_msg.msg.pos_ecef_cov_gnss.tow); + + ck_assert_msg( + (last_msg.msg.pos_ecef_cov_gnss.x * 100 - -2694229.70798 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov_gnss.x, expected " + "-2694229.70798, is %s", + last_msg.msg.pos_ecef_cov_gnss.x); + + ck_assert_msg( + (last_msg.msg.pos_ecef_cov_gnss.y * 100 - -4264073.42735 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov_gnss.y, expected " + "-4264073.42735, is %s", + last_msg.msg.pos_ecef_cov_gnss.y); + + ck_assert_msg( + (last_msg.msg.pos_ecef_cov_gnss.z * 100 - 3890655.01319 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_cov_gnss.z, expected " + "3890655.01319, is %s", + last_msg.msg.pos_ecef_cov_gnss.z); } } END_TEST -Suite* auto_check_sbp_navigation_MsgPosECEFCovGNSS_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgPosECEFCovGNSS"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosECEFCovGNSS"); +Suite *auto_check_sbp_navigation_MsgPosECEFCovGNSS_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgPosECEFCovGNSS"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_navigation_MsgPosECEFCovGNSS"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgPosECEFCovGNSS); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgPosECEFDepA.c b/c/test/auto_check_sbp_navigation_MsgPosECEFDepA.c index c98116c39..15cfea642 100644 --- a/c/test/auto_check_sbp_navigation_MsgPosECEFDepA.c +++ b/c/test/auto_check_sbp_navigation_MsgPosECEFDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgPosECEFDepA ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgPosECEFDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,68 +90,101 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,2,246,215,32,20,46,39,0,195,122,175,75,33,154,68,193,164,14,230,176,231,95,80,193,78,220,22,253,254,105,77,65,0,0,9,0,13,86, }; + u8 encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 20, 46, 39, 0, 195, 122, 175, 75, + 33, 154, 68, 193, 164, 14, 230, 176, 231, 95, 80, 193, 78, 220, + 22, 253, 254, 105, 77, 65, 0, 0, 9, 0, 13, 86, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef_dep_a.accuracy = 0; - + test_msg.pos_ecef_dep_a.flags = 0; - + test_msg.pos_ecef_dep_a.n_sats = 9; - + test_msg.pos_ecef_dep_a.tow = 2567700; - + test_msg.pos_ecef_dep_a.x = -2700354.5912927105; - + test_msg.pos_ecef_dep_a.y = -4292510.764041577; - + test_msg.pos_ecef_dep_a.z = 3855357.977260149; - sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 9, "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, expected 9, is %d", last_msg.msg.pos_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 2567700, "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, expected 2567700, is %d", last_msg.msg.pos_ecef_dep_a.tow); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.x * 100 - -2700354.59129 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected -2700354.59129, is %s", last_msg.msg.pos_ecef_dep_a.x); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.y * 100 - -4292510.76404 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected -4292510.76404, is %s", last_msg.msg.pos_ecef_dep_a.y); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.z * 100 - 3855357.97726 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected 3855357.97726, is %s", last_msg.msg.pos_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.pos_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 2567700, + "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, " + "expected 2567700, is %d", + last_msg.msg.pos_ecef_dep_a.tow); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.x * 100 - -2700354.59129 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected " + "-2700354.59129, is %s", + last_msg.msg.pos_ecef_dep_a.x); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.y * 100 - -4292510.76404 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected " + "-4292510.76404, is %s", + last_msg.msg.pos_ecef_dep_a.y); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.z * 100 - 3855357.97726 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected " + "3855357.97726, is %s", + last_msg.msg.pos_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -163,68 +192,101 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,2,246,215,32,20,46,39,0,212,196,12,42,34,154,68,193,9,113,112,123,231,95,80,193,54,97,38,192,254,105,77,65,0,0,9,1,75,143, }; + u8 encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 20, 46, 39, 0, 212, 196, 12, 42, + 34, 154, 68, 193, 9, 113, 112, 123, 231, 95, 80, 193, 54, 97, + 38, 192, 254, 105, 77, 65, 0, 0, 9, 1, 75, 143, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef_dep_a.accuracy = 0; - + test_msg.pos_ecef_dep_a.flags = 1; - + test_msg.pos_ecef_dep_a.n_sats = 9; - + test_msg.pos_ecef_dep_a.tow = 2567700; - + test_msg.pos_ecef_dep_a.x = -2700356.3285146747; - + test_msg.pos_ecef_dep_a.y = -4292509.928737887; - + test_msg.pos_ecef_dep_a.z = 3855357.5011712564; - sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 1, "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, expected 1, is %d", last_msg.msg.pos_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 9, "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, expected 9, is %d", last_msg.msg.pos_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 2567700, "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, expected 2567700, is %d", last_msg.msg.pos_ecef_dep_a.tow); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.x * 100 - -2700356.32851 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected -2700356.32851, is %s", last_msg.msg.pos_ecef_dep_a.x); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.y * 100 - -4292509.92874 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected -4292509.92874, is %s", last_msg.msg.pos_ecef_dep_a.y); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.z * 100 - 3855357.50117 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected 3855357.50117, is %s", last_msg.msg.pos_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 1, + "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, " + "expected 1, is %d", + last_msg.msg.pos_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.pos_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 2567700, + "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, " + "expected 2567700, is %d", + last_msg.msg.pos_ecef_dep_a.tow); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.x * 100 - -2700356.32851 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected " + "-2700356.32851, is %s", + last_msg.msg.pos_ecef_dep_a.x); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.y * 100 - -4292509.92874 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected " + "-4292509.92874, is %s", + last_msg.msg.pos_ecef_dep_a.y); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.z * 100 - 3855357.50117 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected " + "3855357.50117, is %s", + last_msg.msg.pos_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -232,68 +294,101 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,2,246,215,32,120,46,39,0,112,97,39,190,34,154,68,193,230,43,119,115,231,95,80,193,50,199,76,66,254,105,77,65,0,0,9,0,204,113, }; + u8 encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 120, 46, 39, 0, 112, 97, 39, 190, + 34, 154, 68, 193, 230, 43, 119, 115, 231, 95, 80, 193, 50, 199, + 76, 66, 254, 105, 77, 65, 0, 0, 9, 0, 204, 113, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef_dep_a.accuracy = 0; - + test_msg.pos_ecef_dep_a.flags = 0; - + test_msg.pos_ecef_dep_a.n_sats = 9; - + test_msg.pos_ecef_dep_a.tow = 2567800; - + test_msg.pos_ecef_dep_a.x = -2700357.485576801; - + test_msg.pos_ecef_dep_a.y = -4292509.80414865; - + test_msg.pos_ecef_dep_a.z = 3855356.517968082; - sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 9, "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, expected 9, is %d", last_msg.msg.pos_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 2567800, "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, expected 2567800, is %d", last_msg.msg.pos_ecef_dep_a.tow); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.x * 100 - -2700357.48558 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected -2700357.48558, is %s", last_msg.msg.pos_ecef_dep_a.x); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.y * 100 - -4292509.80415 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected -4292509.80415, is %s", last_msg.msg.pos_ecef_dep_a.y); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.z * 100 - 3855356.51797 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected 3855356.51797, is %s", last_msg.msg.pos_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.pos_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 2567800, + "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, " + "expected 2567800, is %d", + last_msg.msg.pos_ecef_dep_a.tow); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.x * 100 - -2700357.48558 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected " + "-2700357.48558, is %s", + last_msg.msg.pos_ecef_dep_a.x); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.y * 100 - -4292509.80415 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected " + "-4292509.80415, is %s", + last_msg.msg.pos_ecef_dep_a.y); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.z * 100 - 3855356.51797 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected " + "3855356.51797, is %s", + last_msg.msg.pos_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -301,68 +396,101 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,2,246,215,32,120,46,39,0,194,82,121,4,34,154,68,193,223,186,1,140,231,95,80,193,176,152,147,181,254,105,77,65,0,0,9,1,97,71, }; + u8 encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 120, 46, 39, 0, 194, 82, 121, 4, + 34, 154, 68, 193, 223, 186, 1, 140, 231, 95, 80, 193, 176, 152, + 147, 181, 254, 105, 77, 65, 0, 0, 9, 1, 97, 71, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef_dep_a.accuracy = 0; - + test_msg.pos_ecef_dep_a.flags = 1; - + test_msg.pos_ecef_dep_a.n_sats = 9; - + test_msg.pos_ecef_dep_a.tow = 2567800; - + test_msg.pos_ecef_dep_a.x = -2700356.0349524925; - + test_msg.pos_ecef_dep_a.y = -4292510.187605589; - + test_msg.pos_ecef_dep_a.z = 3855357.4185667858; - sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 1, "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, expected 1, is %d", last_msg.msg.pos_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 9, "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, expected 9, is %d", last_msg.msg.pos_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 2567800, "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, expected 2567800, is %d", last_msg.msg.pos_ecef_dep_a.tow); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.x * 100 - -2700356.03495 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected -2700356.03495, is %s", last_msg.msg.pos_ecef_dep_a.x); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.y * 100 - -4292510.18761 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected -4292510.18761, is %s", last_msg.msg.pos_ecef_dep_a.y); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.z * 100 - 3855357.41857 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected 3855357.41857, is %s", last_msg.msg.pos_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 1, + "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, " + "expected 1, is %d", + last_msg.msg.pos_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.pos_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 2567800, + "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, " + "expected 2567800, is %d", + last_msg.msg.pos_ecef_dep_a.tow); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.x * 100 - -2700356.03495 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected " + "-2700356.03495, is %s", + last_msg.msg.pos_ecef_dep_a.x); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.y * 100 - -4292510.18761 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected " + "-4292510.18761, is %s", + last_msg.msg.pos_ecef_dep_a.y); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.z * 100 - 3855357.41857 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected " + "3855357.41857, is %s", + last_msg.msg.pos_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -370,68 +498,101 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,2,246,215,32,220,46,39,0,216,41,227,254,33,154,68,193,9,151,154,124,231,95,80,193,1,183,214,139,255,105,77,65,0,0,9,0,7,98, }; + u8 encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 220, 46, 39, 0, 216, 41, 227, 254, + 33, 154, 68, 193, 9, 151, 154, 124, 231, 95, 80, 193, 1, 183, + 214, 139, 255, 105, 77, 65, 0, 0, 9, 0, 7, 98, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef_dep_a.accuracy = 0; - + test_msg.pos_ecef_dep_a.flags = 0; - + test_msg.pos_ecef_dep_a.n_sats = 9; - + test_msg.pos_ecef_dep_a.tow = 2567900; - + test_msg.pos_ecef_dep_a.x = -2700355.9913074784; - + test_msg.pos_ecef_dep_a.y = -4292509.946935424; - + test_msg.pos_ecef_dep_a.z = 3855359.0924900775; - sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 9, "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, expected 9, is %d", last_msg.msg.pos_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 2567900, "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, expected 2567900, is %d", last_msg.msg.pos_ecef_dep_a.tow); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.x * 100 - -2700355.99131 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected -2700355.99131, is %s", last_msg.msg.pos_ecef_dep_a.x); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.y * 100 - -4292509.94694 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected -4292509.94694, is %s", last_msg.msg.pos_ecef_dep_a.y); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.z * 100 - 3855359.09249 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected 3855359.09249, is %s", last_msg.msg.pos_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.pos_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 2567900, + "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, " + "expected 2567900, is %d", + last_msg.msg.pos_ecef_dep_a.tow); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.x * 100 - -2700355.99131 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected " + "-2700355.99131, is %s", + last_msg.msg.pos_ecef_dep_a.x); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.y * 100 - -4292509.94694 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected " + "-4292509.94694, is %s", + last_msg.msg.pos_ecef_dep_a.y); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.z * 100 - 3855359.09249 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected " + "3855359.09249, is %s", + last_msg.msg.pos_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -439,68 +600,101 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,2,195,4,32,212,157,67,24,153,222,105,1,252,161,68,193,254,247,52,112,74,67,80,193,164,207,47,146,44,163,77,65,0,0,8,0,145,4, }; + u8 encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 212, 157, 67, 24, 153, 222, 105, 1, + 252, 161, 68, 193, 254, 247, 52, 112, 74, 67, 80, 193, 164, 207, + 47, 146, 44, 163, 77, 65, 0, 0, 8, 0, 145, 4, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef_dep_a.accuracy = 0; - + test_msg.pos_ecef_dep_a.flags = 0; - + test_msg.pos_ecef_dep_a.n_sats = 8; - + test_msg.pos_ecef_dep_a.tow = 407084500; - + test_msg.pos_ecef_dep_a.x = -2704376.0110433814; - + test_msg.pos_ecef_dep_a.y = -4263209.753232954; - + test_msg.pos_ecef_dep_a.z = 3884633.142084079; - sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 8, "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, expected 8, is %d", last_msg.msg.pos_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 407084500, "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, expected 407084500, is %d", last_msg.msg.pos_ecef_dep_a.tow); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.x * 100 - -2704376.01104 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected -2704376.01104, is %s", last_msg.msg.pos_ecef_dep_a.x); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.y * 100 - -4263209.75323 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected -4263209.75323, is %s", last_msg.msg.pos_ecef_dep_a.y); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.z * 100 - 3884633.14208 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected 3884633.14208, is %s", last_msg.msg.pos_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.pos_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 407084500, + "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, " + "expected 407084500, is %d", + last_msg.msg.pos_ecef_dep_a.tow); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.x * 100 - -2704376.01104 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected " + "-2704376.01104, is %s", + last_msg.msg.pos_ecef_dep_a.x); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.y * 100 - -4263209.75323 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected " + "-4263209.75323, is %s", + last_msg.msg.pos_ecef_dep_a.y); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.z * 100 - 3884633.14208 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected " + "3884633.14208, is %s", + last_msg.msg.pos_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -508,68 +702,101 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,2,195,4,32,56,158,67,24,215,184,223,246,251,161,68,193,36,126,17,39,74,67,80,193,19,179,70,80,44,163,77,65,0,0,8,0,245,66, }; + u8 encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 56, 158, 67, 24, 215, 184, 223, 246, + 251, 161, 68, 193, 36, 126, 17, 39, 74, 67, 80, 193, 19, 179, + 70, 80, 44, 163, 77, 65, 0, 0, 8, 0, 245, 66, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef_dep_a.accuracy = 0; - + test_msg.pos_ecef_dep_a.flags = 0; - + test_msg.pos_ecef_dep_a.n_sats = 8; - + test_msg.pos_ecef_dep_a.tow = 407084600; - + test_msg.pos_ecef_dep_a.x = -2704375.9287024545; - + test_msg.pos_ecef_dep_a.y = -4263208.610442672; - + test_msg.pos_ecef_dep_a.z = 3884632.627157578; - sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 8, "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, expected 8, is %d", last_msg.msg.pos_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 407084600, "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, expected 407084600, is %d", last_msg.msg.pos_ecef_dep_a.tow); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.x * 100 - -2704375.9287 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected -2704375.9287, is %s", last_msg.msg.pos_ecef_dep_a.x); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.y * 100 - -4263208.61044 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected -4263208.61044, is %s", last_msg.msg.pos_ecef_dep_a.y); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.z * 100 - 3884632.62716 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected 3884632.62716, is %s", last_msg.msg.pos_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.pos_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 407084600, + "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, " + "expected 407084600, is %d", + last_msg.msg.pos_ecef_dep_a.tow); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.x * 100 - -2704375.9287 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected " + "-2704375.9287, is %s", + last_msg.msg.pos_ecef_dep_a.x); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.y * 100 - -4263208.61044 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected " + "-4263208.61044, is %s", + last_msg.msg.pos_ecef_dep_a.y); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.z * 100 - 3884632.62716 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected " + "3884632.62716, is %s", + last_msg.msg.pos_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -577,68 +804,101 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,2,195,4,32,156,158,67,24,73,74,214,148,251,161,68,193,213,151,184,215,73,67,80,193,110,99,38,164,43,163,77,65,0,0,8,0,5,223, }; + u8 encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 156, 158, 67, 24, 73, 74, 214, 148, + 251, 161, 68, 193, 213, 151, 184, 215, 73, 67, 80, 193, 110, 99, + 38, 164, 43, 163, 77, 65, 0, 0, 8, 0, 5, 223, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef_dep_a.accuracy = 0; - + test_msg.pos_ecef_dep_a.flags = 0; - + test_msg.pos_ecef_dep_a.n_sats = 8; - + test_msg.pos_ecef_dep_a.tow = 407084700; - + test_msg.pos_ecef_dep_a.x = -2704375.162789617; - + test_msg.pos_ecef_dep_a.y = -4263207.370641668; - + test_msg.pos_ecef_dep_a.z = 3884631.282421521; - sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 8, "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, expected 8, is %d", last_msg.msg.pos_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 407084700, "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, expected 407084700, is %d", last_msg.msg.pos_ecef_dep_a.tow); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.x * 100 - -2704375.16279 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected -2704375.16279, is %s", last_msg.msg.pos_ecef_dep_a.x); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.y * 100 - -4263207.37064 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected -4263207.37064, is %s", last_msg.msg.pos_ecef_dep_a.y); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.z * 100 - 3884631.28242 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected 3884631.28242, is %s", last_msg.msg.pos_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.pos_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 407084700, + "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, " + "expected 407084700, is %d", + last_msg.msg.pos_ecef_dep_a.tow); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.x * 100 - -2704375.16279 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected " + "-2704375.16279, is %s", + last_msg.msg.pos_ecef_dep_a.x); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.y * 100 - -4263207.37064 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected " + "-4263207.37064, is %s", + last_msg.msg.pos_ecef_dep_a.y); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.z * 100 - 3884631.28242 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected " + "3884631.28242, is %s", + last_msg.msg.pos_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -646,68 +906,101 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,2,195,4,32,0,159,67,24,177,111,112,45,252,161,68,193,213,168,198,253,73,67,80,193,245,12,228,12,44,163,77,65,0,0,8,0,143,212, }; + u8 encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 0, 159, 67, 24, 177, 111, 112, 45, + 252, 161, 68, 193, 213, 168, 198, 253, 73, 67, 80, 193, 245, 12, + 228, 12, 44, 163, 77, 65, 0, 0, 8, 0, 143, 212, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef_dep_a.accuracy = 0; - + test_msg.pos_ecef_dep_a.flags = 0; - + test_msg.pos_ecef_dep_a.n_sats = 8; - + test_msg.pos_ecef_dep_a.tow = 407084800; - + test_msg.pos_ecef_dep_a.x = -2704376.3549937834; - + test_msg.pos_ecef_dep_a.y = -4263207.965250214; - + test_msg.pos_ecef_dep_a.z = 3884632.1007095524; - sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 8, "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, expected 8, is %d", last_msg.msg.pos_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 407084800, "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, expected 407084800, is %d", last_msg.msg.pos_ecef_dep_a.tow); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.x * 100 - -2704376.35499 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected -2704376.35499, is %s", last_msg.msg.pos_ecef_dep_a.x); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.y * 100 - -4263207.96525 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected -4263207.96525, is %s", last_msg.msg.pos_ecef_dep_a.y); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.z * 100 - 3884632.10071 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected 3884632.10071, is %s", last_msg.msg.pos_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.pos_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 407084800, + "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, " + "expected 407084800, is %d", + last_msg.msg.pos_ecef_dep_a.tow); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.x * 100 - -2704376.35499 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected " + "-2704376.35499, is %s", + last_msg.msg.pos_ecef_dep_a.x); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.y * 100 - -4263207.96525 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected " + "-4263207.96525, is %s", + last_msg.msg.pos_ecef_dep_a.y); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.z * 100 - 3884632.10071 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected " + "3884632.10071, is %s", + last_msg.msg.pos_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -715,68 +1008,101 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,2,195,4,32,100,159,67,24,67,231,72,165,251,161,68,193,150,210,36,212,73,67,80,193,234,33,25,189,43,163,77,65,0,0,8,0,70,221, }; + u8 encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 100, 159, 67, 24, 67, 231, 72, 165, + 251, 161, 68, 193, 150, 210, 36, 212, 73, 67, 80, 193, 234, 33, + 25, 189, 43, 163, 77, 65, 0, 0, 8, 0, 70, 221, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef_dep_a.accuracy = 0; - + test_msg.pos_ecef_dep_a.flags = 0; - + test_msg.pos_ecef_dep_a.n_sats = 8; - + test_msg.pos_ecef_dep_a.tow = 407084900; - + test_msg.pos_ecef_dep_a.x = -2704375.291287334; - + test_msg.pos_ecef_dep_a.y = -4263207.314747473; - + test_msg.pos_ecef_dep_a.z = 3884631.4773294823; - sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 8, "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, expected 8, is %d", last_msg.msg.pos_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 407084900, "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, expected 407084900, is %d", last_msg.msg.pos_ecef_dep_a.tow); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.x * 100 - -2704375.29129 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected -2704375.29129, is %s", last_msg.msg.pos_ecef_dep_a.x); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.y * 100 - -4263207.31475 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected -4263207.31475, is %s", last_msg.msg.pos_ecef_dep_a.y); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.z * 100 - 3884631.47733 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected 3884631.47733, is %s", last_msg.msg.pos_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.pos_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 407084900, + "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, " + "expected 407084900, is %d", + last_msg.msg.pos_ecef_dep_a.tow); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.x * 100 - -2704375.29129 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected " + "-2704375.29129, is %s", + last_msg.msg.pos_ecef_dep_a.x); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.y * 100 - -4263207.31475 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected " + "-4263207.31475, is %s", + last_msg.msg.pos_ecef_dep_a.y); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.z * 100 - 3884631.47733 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected " + "3884631.47733, is %s", + last_msg.msg.pos_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -784,71 +1110,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,2,195,4,32,46,162,68,24,224,72,131,215,251,161,68,193,180,123,222,94,74,67,80,193,191,3,131,193,45,163,77,65,0,0,5,0,17,221, }; + u8 encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 46, 162, 68, 24, 224, 72, 131, 215, + 251, 161, 68, 193, 180, 123, 222, 94, 74, 67, 80, 193, 191, 3, + 131, 193, 45, 163, 77, 65, 0, 0, 5, 0, 17, 221, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef_dep_a.accuracy = 0; - + test_msg.pos_ecef_dep_a.flags = 0; - + test_msg.pos_ecef_dep_a.n_sats = 5; - + test_msg.pos_ecef_dep_a.tow = 407151150; - + test_msg.pos_ecef_dep_a.x = -2704375.68369399; - + test_msg.pos_ecef_dep_a.y = -4263209.482329298; - + test_msg.pos_ecef_dep_a.z = 3884635.5118107493; - sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.pos_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 5, "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, expected 5, is %d", last_msg.msg.pos_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 407151150, "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, expected 407151150, is %d", last_msg.msg.pos_ecef_dep_a.tow); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.x * 100 - -2704375.68369 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected -2704375.68369, is %s", last_msg.msg.pos_ecef_dep_a.x); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.y * 100 - -4263209.48233 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected -4263209.48233, is %s", last_msg.msg.pos_ecef_dep_a.y); - - ck_assert_msg((last_msg.msg.pos_ecef_dep_a.z * 100 - 3884635.51181 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected 3884635.51181, is %s", last_msg.msg.pos_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.n_sats == 5, + "incorrect value for last_msg.msg.pos_ecef_dep_a.n_sats, " + "expected 5, is %d", + last_msg.msg.pos_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef_dep_a.tow == 407151150, + "incorrect value for last_msg.msg.pos_ecef_dep_a.tow, " + "expected 407151150, is %d", + last_msg.msg.pos_ecef_dep_a.tow); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.x * 100 - -2704375.68369 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.x, expected " + "-2704375.68369, is %s", + last_msg.msg.pos_ecef_dep_a.x); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.y * 100 - -4263209.48233 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.y, expected " + "-4263209.48233, is %s", + last_msg.msg.pos_ecef_dep_a.y); + + ck_assert_msg( + (last_msg.msg.pos_ecef_dep_a.z * 100 - 3884635.51181 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_dep_a.z, expected " + "3884635.51181, is %s", + last_msg.msg.pos_ecef_dep_a.z); } } END_TEST -Suite* auto_check_sbp_navigation_MsgPosECEFDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgPosECEFDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosECEFDepA"); +Suite *auto_check_sbp_navigation_MsgPosECEFDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgPosECEFDepA"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosECEFDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgPosECEFDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgPosECEFGNSS.c b/c/test/auto_check_sbp_navigation_MsgPosECEFGNSS.c index 308710c33..8602e24e7 100644 --- a/c/test/auto_check_sbp_navigation_MsgPosECEFGNSS.c +++ b/c/test/auto_check_sbp_navigation_MsgPosECEFGNSS.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFGNSS.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgPosECEFGNSS ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgPosECEFGNSS) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFGNSS ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,71 +90,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosECEFGNSS ) logging_reset(); - sbp_callback_register(&sbp_state, 0x229, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x229, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,41,2,0,16,32,24,229,233,29,52,254,158,218,42,142,68,193,69,162,89,91,34,68,80,193,131,21,176,129,239,174,77,65,182,0,18,4,135,2, }; + u8 encoded_frame[] = { + 85, 41, 2, 0, 16, 32, 24, 229, 233, 29, 52, 254, 158, 218, + 42, 142, 68, 193, 69, 162, 89, 91, 34, 68, 80, 193, 131, 21, + 176, 129, 239, 174, 77, 65, 182, 0, 18, 4, 135, 2, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_ecef_gnss.accuracy = 182; - + test_msg.pos_ecef_gnss.flags = 4; - + test_msg.pos_ecef_gnss.n_sats = 18; - + test_msg.pos_ecef_gnss.tow = 501867800; - + test_msg.pos_ecef_gnss.x = -2694229.7079770807; - + test_msg.pos_ecef_gnss.y = -4264073.427345817; - + test_msg.pos_ecef_gnss.z = 3890655.013186158; - sbp_message_send(&sbp_state, SbpMsgPosEcefGnss, 4096, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosEcefGnss, 4096, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosEcefGnss, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosEcefGnss, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_ecef_gnss.accuracy == 182, "incorrect value for last_msg.msg.pos_ecef_gnss.accuracy, expected 182, is %d", last_msg.msg.pos_ecef_gnss.accuracy); - - ck_assert_msg(last_msg.msg.pos_ecef_gnss.flags == 4, "incorrect value for last_msg.msg.pos_ecef_gnss.flags, expected 4, is %d", last_msg.msg.pos_ecef_gnss.flags); - - ck_assert_msg(last_msg.msg.pos_ecef_gnss.n_sats == 18, "incorrect value for last_msg.msg.pos_ecef_gnss.n_sats, expected 18, is %d", last_msg.msg.pos_ecef_gnss.n_sats); - - ck_assert_msg(last_msg.msg.pos_ecef_gnss.tow == 501867800, "incorrect value for last_msg.msg.pos_ecef_gnss.tow, expected 501867800, is %d", last_msg.msg.pos_ecef_gnss.tow); - - ck_assert_msg((last_msg.msg.pos_ecef_gnss.x * 100 - -2694229.70798 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_gnss.x, expected -2694229.70798, is %s", last_msg.msg.pos_ecef_gnss.x); - - ck_assert_msg((last_msg.msg.pos_ecef_gnss.y * 100 - -4264073.42735 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_gnss.y, expected -4264073.42735, is %s", last_msg.msg.pos_ecef_gnss.y); - - ck_assert_msg((last_msg.msg.pos_ecef_gnss.z * 100 - 3890655.01319 * 100) < 0.05, "incorrect value for last_msg.msg.pos_ecef_gnss.z, expected 3890655.01319, is %s", last_msg.msg.pos_ecef_gnss.z); + ck_assert_msg(last_msg.msg.pos_ecef_gnss.accuracy == 182, + "incorrect value for last_msg.msg.pos_ecef_gnss.accuracy, " + "expected 182, is %d", + last_msg.msg.pos_ecef_gnss.accuracy); + + ck_assert_msg(last_msg.msg.pos_ecef_gnss.flags == 4, + "incorrect value for last_msg.msg.pos_ecef_gnss.flags, " + "expected 4, is %d", + last_msg.msg.pos_ecef_gnss.flags); + + ck_assert_msg(last_msg.msg.pos_ecef_gnss.n_sats == 18, + "incorrect value for last_msg.msg.pos_ecef_gnss.n_sats, " + "expected 18, is %d", + last_msg.msg.pos_ecef_gnss.n_sats); + + ck_assert_msg(last_msg.msg.pos_ecef_gnss.tow == 501867800, + "incorrect value for last_msg.msg.pos_ecef_gnss.tow, " + "expected 501867800, is %d", + last_msg.msg.pos_ecef_gnss.tow); + + ck_assert_msg( + (last_msg.msg.pos_ecef_gnss.x * 100 - -2694229.70798 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_gnss.x, expected " + "-2694229.70798, is %s", + last_msg.msg.pos_ecef_gnss.x); + + ck_assert_msg( + (last_msg.msg.pos_ecef_gnss.y * 100 - -4264073.42735 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_gnss.y, expected " + "-4264073.42735, is %s", + last_msg.msg.pos_ecef_gnss.y); + + ck_assert_msg( + (last_msg.msg.pos_ecef_gnss.z * 100 - 3890655.01319 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_ecef_gnss.z, expected " + "3890655.01319, is %s", + last_msg.msg.pos_ecef_gnss.z); } } END_TEST -Suite* auto_check_sbp_navigation_MsgPosECEFGNSS_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgPosECEFGNSS"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosECEFGNSS"); +Suite *auto_check_sbp_navigation_MsgPosECEFGNSS_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgPosECEFGNSS"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosECEFGNSS"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgPosECEFGNSS); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgPosLLH.c b/c/test/auto_check_sbp_navigation_MsgPosLLH.c index 65d982e1d..4b80017fc 100644 --- a/c/test/auto_check_sbp_navigation_MsgPosLLH.c +++ b/c/test/auto_check_sbp_navigation_MsgPosLLH.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLH.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLH.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgPosLLH ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgPosLLH) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLH ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,72 +90,105 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLH ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,10,2,211,136,34,40,244,122,19,201,106,155,186,42,160,66,64,168,109,26,225,0,120,94,192,130,102,237,230,43,54,60,64,0,0,0,0,14,2,175,162, }; + u8 encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 40, 244, 122, 19, 201, 106, 155, 186, + 42, 160, 66, 64, 168, 109, 26, 225, 0, 120, 94, 192, 130, 102, + 237, 230, 43, 54, 60, 64, 0, 0, 0, 0, 14, 2, 175, 162, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh.flags = 2; - + test_msg.pos_llh.h_accuracy = 0; - + test_msg.pos_llh.height = 28.21160739227208; - + test_msg.pos_llh.lat = 37.25130398358085; - + test_msg.pos_llh.lon = -121.87505366879361; - + test_msg.pos_llh.n_sats = 14; - + test_msg.pos_llh.tow = 326825000; - + test_msg.pos_llh.v_accuracy = 0; sbp_message_send(&sbp_state, SbpMsgPosLlh, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgPosLlh, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh.flags == 2, "incorrect value for last_msg.msg.pos_llh.flags, expected 2, is %d", last_msg.msg.pos_llh.flags); - - ck_assert_msg(last_msg.msg.pos_llh.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh.height * 100 - 28.2116073923 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh.height, expected 28.2116073923, is %s", last_msg.msg.pos_llh.height); - - ck_assert_msg((last_msg.msg.pos_llh.lat * 100 - 37.2513039836 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh.lat, expected 37.2513039836, is %s", last_msg.msg.pos_llh.lat); - - ck_assert_msg((last_msg.msg.pos_llh.lon * 100 - -121.875053669 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh.lon, expected -121.875053669, is %s", last_msg.msg.pos_llh.lon); - - ck_assert_msg(last_msg.msg.pos_llh.n_sats == 14, "incorrect value for last_msg.msg.pos_llh.n_sats, expected 14, is %d", last_msg.msg.pos_llh.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh.tow == 326825000, "incorrect value for last_msg.msg.pos_llh.tow, expected 326825000, is %d", last_msg.msg.pos_llh.tow); - - ck_assert_msg(last_msg.msg.pos_llh.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh.v_accuracy); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.pos_llh.flags == 2, + "incorrect value for last_msg.msg.pos_llh.flags, expected 2, is %d", + last_msg.msg.pos_llh.flags); + + ck_assert_msg(last_msg.msg.pos_llh.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh.height * 100 - 28.2116073923 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh.height, expected " + "28.2116073923, is %s", + last_msg.msg.pos_llh.height); + + ck_assert_msg((last_msg.msg.pos_llh.lat * 100 - 37.2513039836 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh.lat, expected " + "37.2513039836, is %s", + last_msg.msg.pos_llh.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh.lon * 100 - -121.875053669 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh.lon, expected " + "-121.875053669, is %s", + last_msg.msg.pos_llh.lon); + + ck_assert_msg( + last_msg.msg.pos_llh.n_sats == 14, + "incorrect value for last_msg.msg.pos_llh.n_sats, expected 14, is %d", + last_msg.msg.pos_llh.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh.tow == 326825000, + "incorrect value for last_msg.msg.pos_llh.tow, expected " + "326825000, is %d", + last_msg.msg.pos_llh.tow); + + ck_assert_msg(last_msg.msg.pos_llh.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -167,72 +196,105 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLH ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,10,2,211,136,34,16,248,122,19,52,177,251,178,42,160,66,64,237,22,97,224,0,120,94,192,107,188,109,90,247,189,59,64,0,0,0,0,15,2,38,177, }; + u8 encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 16, 248, 122, 19, 52, 177, 251, 178, + 42, 160, 66, 64, 237, 22, 97, 224, 0, 120, 94, 192, 107, 188, + 109, 90, 247, 189, 59, 64, 0, 0, 0, 0, 15, 2, 38, 177, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh.flags = 2; - + test_msg.pos_llh.h_accuracy = 0; - + test_msg.pos_llh.height = 27.742055560866373; - + test_msg.pos_llh.lat = 37.251303074738104; - + test_msg.pos_llh.lon = -121.87505349618341; - + test_msg.pos_llh.n_sats = 15; - + test_msg.pos_llh.tow = 326826000; - + test_msg.pos_llh.v_accuracy = 0; sbp_message_send(&sbp_state, SbpMsgPosLlh, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgPosLlh, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh.flags == 2, "incorrect value for last_msg.msg.pos_llh.flags, expected 2, is %d", last_msg.msg.pos_llh.flags); - - ck_assert_msg(last_msg.msg.pos_llh.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh.height * 100 - 27.7420555609 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh.height, expected 27.7420555609, is %s", last_msg.msg.pos_llh.height); - - ck_assert_msg((last_msg.msg.pos_llh.lat * 100 - 37.2513030747 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh.lat, expected 37.2513030747, is %s", last_msg.msg.pos_llh.lat); - - ck_assert_msg((last_msg.msg.pos_llh.lon * 100 - -121.875053496 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh.lon, expected -121.875053496, is %s", last_msg.msg.pos_llh.lon); - - ck_assert_msg(last_msg.msg.pos_llh.n_sats == 15, "incorrect value for last_msg.msg.pos_llh.n_sats, expected 15, is %d", last_msg.msg.pos_llh.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh.tow == 326826000, "incorrect value for last_msg.msg.pos_llh.tow, expected 326826000, is %d", last_msg.msg.pos_llh.tow); - - ck_assert_msg(last_msg.msg.pos_llh.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh.v_accuracy); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.pos_llh.flags == 2, + "incorrect value for last_msg.msg.pos_llh.flags, expected 2, is %d", + last_msg.msg.pos_llh.flags); + + ck_assert_msg(last_msg.msg.pos_llh.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh.height * 100 - 27.7420555609 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh.height, expected " + "27.7420555609, is %s", + last_msg.msg.pos_llh.height); + + ck_assert_msg((last_msg.msg.pos_llh.lat * 100 - 37.2513030747 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh.lat, expected " + "37.2513030747, is %s", + last_msg.msg.pos_llh.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh.lon * 100 - -121.875053496 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh.lon, expected " + "-121.875053496, is %s", + last_msg.msg.pos_llh.lon); + + ck_assert_msg( + last_msg.msg.pos_llh.n_sats == 15, + "incorrect value for last_msg.msg.pos_llh.n_sats, expected 15, is %d", + last_msg.msg.pos_llh.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh.tow == 326826000, + "incorrect value for last_msg.msg.pos_llh.tow, expected " + "326826000, is %d", + last_msg.msg.pos_llh.tow); + + ck_assert_msg(last_msg.msg.pos_llh.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -240,72 +302,105 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLH ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,10,2,211,136,34,248,251,122,19,135,66,9,163,42,160,66,64,146,8,99,225,0,120,94,192,45,181,143,219,28,157,59,64,0,0,0,0,15,2,51,40, }; + u8 encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 248, 251, 122, 19, 135, 66, 9, 163, + 42, 160, 66, 64, 146, 8, 99, 225, 0, 120, 94, 192, 45, 181, + 143, 219, 28, 157, 59, 64, 0, 0, 0, 0, 15, 2, 51, 40, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh.flags = 2; - + test_msg.pos_llh.h_accuracy = 0; - + test_msg.pos_llh.height = 27.613721582970516; - + test_msg.pos_llh.lat = 37.25130117370741; - + test_msg.pos_llh.lon = -121.87505373641241; - + test_msg.pos_llh.n_sats = 15; - + test_msg.pos_llh.tow = 326827000; - + test_msg.pos_llh.v_accuracy = 0; sbp_message_send(&sbp_state, SbpMsgPosLlh, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgPosLlh, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh.flags == 2, "incorrect value for last_msg.msg.pos_llh.flags, expected 2, is %d", last_msg.msg.pos_llh.flags); - - ck_assert_msg(last_msg.msg.pos_llh.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh.height * 100 - 27.613721583 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh.height, expected 27.613721583, is %s", last_msg.msg.pos_llh.height); - - ck_assert_msg((last_msg.msg.pos_llh.lat * 100 - 37.2513011737 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh.lat, expected 37.2513011737, is %s", last_msg.msg.pos_llh.lat); - - ck_assert_msg((last_msg.msg.pos_llh.lon * 100 - -121.875053736 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh.lon, expected -121.875053736, is %s", last_msg.msg.pos_llh.lon); - - ck_assert_msg(last_msg.msg.pos_llh.n_sats == 15, "incorrect value for last_msg.msg.pos_llh.n_sats, expected 15, is %d", last_msg.msg.pos_llh.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh.tow == 326827000, "incorrect value for last_msg.msg.pos_llh.tow, expected 326827000, is %d", last_msg.msg.pos_llh.tow); - - ck_assert_msg(last_msg.msg.pos_llh.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh.v_accuracy); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.pos_llh.flags == 2, + "incorrect value for last_msg.msg.pos_llh.flags, expected 2, is %d", + last_msg.msg.pos_llh.flags); + + ck_assert_msg(last_msg.msg.pos_llh.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh.height * 100 - 27.613721583 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh.height, expected " + "27.613721583, is %s", + last_msg.msg.pos_llh.height); + + ck_assert_msg((last_msg.msg.pos_llh.lat * 100 - 37.2513011737 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh.lat, expected " + "37.2513011737, is %s", + last_msg.msg.pos_llh.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh.lon * 100 - -121.875053736 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh.lon, expected " + "-121.875053736, is %s", + last_msg.msg.pos_llh.lon); + + ck_assert_msg( + last_msg.msg.pos_llh.n_sats == 15, + "incorrect value for last_msg.msg.pos_llh.n_sats, expected 15, is %d", + last_msg.msg.pos_llh.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh.tow == 326827000, + "incorrect value for last_msg.msg.pos_llh.tow, expected " + "326827000, is %d", + last_msg.msg.pos_llh.tow); + + ck_assert_msg(last_msg.msg.pos_llh.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -313,72 +408,105 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLH ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,10,2,211,136,34,224,255,122,19,18,44,253,119,42,160,66,64,48,109,39,231,0,120,94,192,185,76,48,17,119,205,59,64,0,0,0,0,15,2,12,194, }; + u8 encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 224, 255, 122, 19, 18, 44, 253, 119, + 42, 160, 66, 64, 48, 109, 39, 231, 0, 120, 94, 192, 185, 76, + 48, 17, 119, 205, 59, 64, 0, 0, 0, 0, 15, 2, 12, 194, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh.flags = 2; - + test_msg.pos_llh.h_accuracy = 0; - + test_msg.pos_llh.height = 27.80259807042305; - + test_msg.pos_llh.lat = 37.251296042079176; - + test_msg.pos_llh.lon = -121.87505511141057; - + test_msg.pos_llh.n_sats = 15; - + test_msg.pos_llh.tow = 326828000; - + test_msg.pos_llh.v_accuracy = 0; sbp_message_send(&sbp_state, SbpMsgPosLlh, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgPosLlh, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh.flags == 2, "incorrect value for last_msg.msg.pos_llh.flags, expected 2, is %d", last_msg.msg.pos_llh.flags); - - ck_assert_msg(last_msg.msg.pos_llh.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh.height * 100 - 27.8025980704 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh.height, expected 27.8025980704, is %s", last_msg.msg.pos_llh.height); - - ck_assert_msg((last_msg.msg.pos_llh.lat * 100 - 37.2512960421 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh.lat, expected 37.2512960421, is %s", last_msg.msg.pos_llh.lat); - - ck_assert_msg((last_msg.msg.pos_llh.lon * 100 - -121.875055111 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh.lon, expected -121.875055111, is %s", last_msg.msg.pos_llh.lon); - - ck_assert_msg(last_msg.msg.pos_llh.n_sats == 15, "incorrect value for last_msg.msg.pos_llh.n_sats, expected 15, is %d", last_msg.msg.pos_llh.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh.tow == 326828000, "incorrect value for last_msg.msg.pos_llh.tow, expected 326828000, is %d", last_msg.msg.pos_llh.tow); - - ck_assert_msg(last_msg.msg.pos_llh.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh.v_accuracy); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.pos_llh.flags == 2, + "incorrect value for last_msg.msg.pos_llh.flags, expected 2, is %d", + last_msg.msg.pos_llh.flags); + + ck_assert_msg(last_msg.msg.pos_llh.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh.height * 100 - 27.8025980704 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh.height, expected " + "27.8025980704, is %s", + last_msg.msg.pos_llh.height); + + ck_assert_msg((last_msg.msg.pos_llh.lat * 100 - 37.2512960421 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh.lat, expected " + "37.2512960421, is %s", + last_msg.msg.pos_llh.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh.lon * 100 - -121.875055111 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh.lon, expected " + "-121.875055111, is %s", + last_msg.msg.pos_llh.lon); + + ck_assert_msg( + last_msg.msg.pos_llh.n_sats == 15, + "incorrect value for last_msg.msg.pos_llh.n_sats, expected 15, is %d", + last_msg.msg.pos_llh.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh.tow == 326828000, + "incorrect value for last_msg.msg.pos_llh.tow, expected " + "326828000, is %d", + last_msg.msg.pos_llh.tow); + + ck_assert_msg(last_msg.msg.pos_llh.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -386,75 +514,108 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLH ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,10,2,211,136,34,200,3,123,19,225,237,238,90,42,160,66,64,59,143,70,235,0,120,94,192,101,106,249,224,131,240,59,64,0,0,0,0,15,2,34,103, }; + u8 encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 200, 3, 123, 19, 225, 237, 238, 90, + 42, 160, 66, 64, 59, 143, 70, 235, 0, 120, 94, 192, 101, 106, + 249, 224, 131, 240, 59, 64, 0, 0, 0, 0, 15, 2, 34, 103, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh.flags = 2; - + test_msg.pos_llh.h_accuracy = 0; - + test_msg.pos_llh.height = 27.939512310879213; - + test_msg.pos_llh.lat = 37.251292578377395; - + test_msg.pos_llh.lon = -121.87505609407974; - + test_msg.pos_llh.n_sats = 15; - + test_msg.pos_llh.tow = 326829000; - + test_msg.pos_llh.v_accuracy = 0; sbp_message_send(&sbp_state, SbpMsgPosLlh, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgPosLlh, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh.flags == 2, "incorrect value for last_msg.msg.pos_llh.flags, expected 2, is %d", last_msg.msg.pos_llh.flags); - - ck_assert_msg(last_msg.msg.pos_llh.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh.height * 100 - 27.9395123109 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh.height, expected 27.9395123109, is %s", last_msg.msg.pos_llh.height); - - ck_assert_msg((last_msg.msg.pos_llh.lat * 100 - 37.2512925784 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh.lat, expected 37.2512925784, is %s", last_msg.msg.pos_llh.lat); - - ck_assert_msg((last_msg.msg.pos_llh.lon * 100 - -121.875056094 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh.lon, expected -121.875056094, is %s", last_msg.msg.pos_llh.lon); - - ck_assert_msg(last_msg.msg.pos_llh.n_sats == 15, "incorrect value for last_msg.msg.pos_llh.n_sats, expected 15, is %d", last_msg.msg.pos_llh.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh.tow == 326829000, "incorrect value for last_msg.msg.pos_llh.tow, expected 326829000, is %d", last_msg.msg.pos_llh.tow); - - ck_assert_msg(last_msg.msg.pos_llh.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh.v_accuracy); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.pos_llh.flags == 2, + "incorrect value for last_msg.msg.pos_llh.flags, expected 2, is %d", + last_msg.msg.pos_llh.flags); + + ck_assert_msg(last_msg.msg.pos_llh.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh.height * 100 - 27.9395123109 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh.height, expected " + "27.9395123109, is %s", + last_msg.msg.pos_llh.height); + + ck_assert_msg((last_msg.msg.pos_llh.lat * 100 - 37.2512925784 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh.lat, expected " + "37.2512925784, is %s", + last_msg.msg.pos_llh.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh.lon * 100 - -121.875056094 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh.lon, expected " + "-121.875056094, is %s", + last_msg.msg.pos_llh.lon); + + ck_assert_msg( + last_msg.msg.pos_llh.n_sats == 15, + "incorrect value for last_msg.msg.pos_llh.n_sats, expected 15, is %d", + last_msg.msg.pos_llh.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh.tow == 326829000, + "incorrect value for last_msg.msg.pos_llh.tow, expected " + "326829000, is %d", + last_msg.msg.pos_llh.tow); + + ck_assert_msg(last_msg.msg.pos_llh.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh.v_accuracy); } } END_TEST -Suite* auto_check_sbp_navigation_MsgPosLLH_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgPosLLH"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosLLH"); +Suite *auto_check_sbp_navigation_MsgPosLLH_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgPosLLH"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosLLH"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgPosLLH); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgPosLLHCov.c b/c/test/auto_check_sbp_navigation_MsgPosLLHCov.c index 152136aab..dc1a92a2e 100644 --- a/c/test/auto_check_sbp_navigation_MsgPosLLHCov.c +++ b/c/test/auto_check_sbp_navigation_MsgPosLLHCov.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHCov.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHCov.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgPosLLHCov ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgPosLLHCov) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLHCov ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,91 +90,136 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLHCov ) logging_reset(); - sbp_callback_register(&sbp_state, 0x211, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x211, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,17,2,66,0,54,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,64,0,0,0,0,0,0,0,0,0,0,224,64,0,0,160,64,0,0,0,65,0,0,192,64,0,0,128,63,0,0,0,64,5,5,151,98, }; + u8 encoded_frame[] = { + 85, 17, 2, 66, 0, 54, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 28, 64, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 224, 64, 0, 0, 160, 64, 0, 0, 0, 65, 0, 0, + 192, 64, 0, 0, 128, 63, 0, 0, 0, 64, 5, 5, 151, 98, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh_cov.cov_d_d = 2.0; - + test_msg.pos_llh_cov.cov_e_d = 1.0; - + test_msg.pos_llh_cov.cov_e_e = 6.0; - + test_msg.pos_llh_cov.cov_n_d = 8.0; - + test_msg.pos_llh_cov.cov_n_e = 5.0; - + test_msg.pos_llh_cov.cov_n_n = 7.0; - + test_msg.pos_llh_cov.flags = 5; - + test_msg.pos_llh_cov.height = 0.0; - + test_msg.pos_llh_cov.lat = 0.0; - + test_msg.pos_llh_cov.lon = 7.0; - + test_msg.pos_llh_cov.n_sats = 5; - + test_msg.pos_llh_cov.tow = 7; sbp_message_send(&sbp_state, SbpMsgPosLlhCov, 66, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosLlhCov, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosLlhCov, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.pos_llh_cov.cov_d_d * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov.cov_d_d, expected 2.0, is %s", last_msg.msg.pos_llh_cov.cov_d_d); - - ck_assert_msg((last_msg.msg.pos_llh_cov.cov_e_d * 100 - 1.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov.cov_e_d, expected 1.0, is %s", last_msg.msg.pos_llh_cov.cov_e_d); - - ck_assert_msg((last_msg.msg.pos_llh_cov.cov_e_e * 100 - 6.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov.cov_e_e, expected 6.0, is %s", last_msg.msg.pos_llh_cov.cov_e_e); - - ck_assert_msg((last_msg.msg.pos_llh_cov.cov_n_d * 100 - 8.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov.cov_n_d, expected 8.0, is %s", last_msg.msg.pos_llh_cov.cov_n_d); - - ck_assert_msg((last_msg.msg.pos_llh_cov.cov_n_e * 100 - 5.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov.cov_n_e, expected 5.0, is %s", last_msg.msg.pos_llh_cov.cov_n_e); - - ck_assert_msg((last_msg.msg.pos_llh_cov.cov_n_n * 100 - 7.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov.cov_n_n, expected 7.0, is %s", last_msg.msg.pos_llh_cov.cov_n_n); - - ck_assert_msg(last_msg.msg.pos_llh_cov.flags == 5, "incorrect value for last_msg.msg.pos_llh_cov.flags, expected 5, is %d", last_msg.msg.pos_llh_cov.flags); - - ck_assert_msg((last_msg.msg.pos_llh_cov.height * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov.height, expected 0.0, is %s", last_msg.msg.pos_llh_cov.height); - - ck_assert_msg((last_msg.msg.pos_llh_cov.lat * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov.lat, expected 0.0, is %s", last_msg.msg.pos_llh_cov.lat); - - ck_assert_msg((last_msg.msg.pos_llh_cov.lon * 100 - 7.0 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov.lon, expected 7.0, is %s", last_msg.msg.pos_llh_cov.lon); - - ck_assert_msg(last_msg.msg.pos_llh_cov.n_sats == 5, "incorrect value for last_msg.msg.pos_llh_cov.n_sats, expected 5, is %d", last_msg.msg.pos_llh_cov.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh_cov.tow == 7, "incorrect value for last_msg.msg.pos_llh_cov.tow, expected 7, is %d", last_msg.msg.pos_llh_cov.tow); + ck_assert_msg((last_msg.msg.pos_llh_cov.cov_d_d * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov.cov_d_d, " + "expected 2.0, is %s", + last_msg.msg.pos_llh_cov.cov_d_d); + + ck_assert_msg((last_msg.msg.pos_llh_cov.cov_e_d * 100 - 1.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov.cov_e_d, " + "expected 1.0, is %s", + last_msg.msg.pos_llh_cov.cov_e_d); + + ck_assert_msg((last_msg.msg.pos_llh_cov.cov_e_e * 100 - 6.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov.cov_e_e, " + "expected 6.0, is %s", + last_msg.msg.pos_llh_cov.cov_e_e); + + ck_assert_msg((last_msg.msg.pos_llh_cov.cov_n_d * 100 - 8.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov.cov_n_d, " + "expected 8.0, is %s", + last_msg.msg.pos_llh_cov.cov_n_d); + + ck_assert_msg((last_msg.msg.pos_llh_cov.cov_n_e * 100 - 5.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov.cov_n_e, " + "expected 5.0, is %s", + last_msg.msg.pos_llh_cov.cov_n_e); + + ck_assert_msg((last_msg.msg.pos_llh_cov.cov_n_n * 100 - 7.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov.cov_n_n, " + "expected 7.0, is %s", + last_msg.msg.pos_llh_cov.cov_n_n); + + ck_assert_msg( + last_msg.msg.pos_llh_cov.flags == 5, + "incorrect value for last_msg.msg.pos_llh_cov.flags, expected 5, is %d", + last_msg.msg.pos_llh_cov.flags); + + ck_assert_msg((last_msg.msg.pos_llh_cov.height * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov.height, " + "expected 0.0, is %s", + last_msg.msg.pos_llh_cov.height); + + ck_assert_msg( + (last_msg.msg.pos_llh_cov.lat * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov.lat, expected 0.0, is %s", + last_msg.msg.pos_llh_cov.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh_cov.lon * 100 - 7.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov.lon, expected 7.0, is %s", + last_msg.msg.pos_llh_cov.lon); + + ck_assert_msg(last_msg.msg.pos_llh_cov.n_sats == 5, + "incorrect value for last_msg.msg.pos_llh_cov.n_sats, " + "expected 5, is %d", + last_msg.msg.pos_llh_cov.n_sats); + + ck_assert_msg( + last_msg.msg.pos_llh_cov.tow == 7, + "incorrect value for last_msg.msg.pos_llh_cov.tow, expected 7, is %d", + last_msg.msg.pos_llh_cov.tow); } } END_TEST -Suite* auto_check_sbp_navigation_MsgPosLLHCov_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgPosLLHCov"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosLLHCov"); +Suite *auto_check_sbp_navigation_MsgPosLLHCov_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgPosLLHCov"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosLLHCov"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgPosLLHCov); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgPosLLHDepA.c b/c/test/auto_check_sbp_navigation_MsgPosLLHDepA.c index de25aa63c..67cf11f66 100644 --- a/c/test/auto_check_sbp_navigation_MsgPosLLHDepA.c +++ b/c/test/auto_check_sbp_navigation_MsgPosLLHDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgPosLLHDepA ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgPosLLHDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLHDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,72 +90,108 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,2,246,215,34,20,46,39,0,250,29,226,186,235,182,66,64,19,203,51,196,24,139,94,192,31,157,160,232,122,115,81,64,0,0,0,0,9,0,236,139, }; + u8 encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 20, 46, 39, 0, 250, 29, 226, 186, + 235, 182, 66, 64, 19, 203, 51, 196, 24, 139, 94, 192, 31, 157, + 160, 232, 122, 115, 81, 64, 0, 0, 0, 0, 9, 0, 236, 139, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh_dep_a.flags = 0; - + test_msg.pos_llh_dep_a.h_accuracy = 0; - + test_msg.pos_llh_dep_a.height = 69.80437675175607; - + test_msg.pos_llh_dep_a.lat = 37.42906890908121; - + test_msg.pos_llh_dep_a.lon = -122.17338662202773; - + test_msg.pos_llh_dep_a.n_sats = 9; - + test_msg.pos_llh_dep_a.tow = 2567700; - + test_msg.pos_llh_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.flags, expected 0, is %d", last_msg.msg.pos_llh_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.height * 100 - 69.8043767518 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected 69.8043767518, is %s", last_msg.msg.pos_llh_dep_a.height); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lat * 100 - 37.4290689091 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected 37.4290689091, is %s", last_msg.msg.pos_llh_dep_a.lat); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lon * 100 - -122.173386622 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected -122.173386622, is %s", last_msg.msg.pos_llh_dep_a.lon); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 9, "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, expected 9, is %d", last_msg.msg.pos_llh_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 2567700, "incorrect value for last_msg.msg.pos_llh_dep_a.tow, expected 2567700, is %d", last_msg.msg.pos_llh_dep_a.tow); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.height * 100 - 69.8043767518 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected " + "69.8043767518, is %s", + last_msg.msg.pos_llh_dep_a.height); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lat * 100 - 37.4290689091 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected " + "37.4290689091, is %s", + last_msg.msg.pos_llh_dep_a.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lon * 100 - -122.173386622 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected " + "-122.173386622, is %s", + last_msg.msg.pos_llh_dep_a.lon); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.pos_llh_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 2567700, + "incorrect value for last_msg.msg.pos_llh_dep_a.tow, " + "expected 2567700, is %d", + last_msg.msg.pos_llh_dep_a.tow); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -167,72 +199,108 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,2,246,215,34,20,46,39,0,161,51,75,148,235,182,66,64,36,41,246,30,25,139,94,192,254,218,49,127,10,108,81,64,0,0,0,0,9,1,25,117, }; + u8 encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 20, 46, 39, 0, 161, 51, 75, 148, + 235, 182, 66, 64, 36, 41, 246, 30, 25, 139, 94, 192, 254, 218, + 49, 127, 10, 108, 81, 64, 0, 0, 0, 0, 9, 1, 25, 117, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh_dep_a.flags = 1; - + test_msg.pos_llh_dep_a.h_accuracy = 0; - + test_msg.pos_llh_dep_a.height = 69.68814067715354; - + test_msg.pos_llh_dep_a.lat = 37.42906430885274; - + test_msg.pos_llh_dep_a.lon = -122.17340826071865; - + test_msg.pos_llh_dep_a.n_sats = 9; - + test_msg.pos_llh_dep_a.tow = 2567700; - + test_msg.pos_llh_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 1, "incorrect value for last_msg.msg.pos_llh_dep_a.flags, expected 1, is %d", last_msg.msg.pos_llh_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.height * 100 - 69.6881406772 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected 69.6881406772, is %s", last_msg.msg.pos_llh_dep_a.height); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lat * 100 - 37.4290643089 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected 37.4290643089, is %s", last_msg.msg.pos_llh_dep_a.lat); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lon * 100 - -122.173408261 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected -122.173408261, is %s", last_msg.msg.pos_llh_dep_a.lon); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 9, "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, expected 9, is %d", last_msg.msg.pos_llh_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 2567700, "incorrect value for last_msg.msg.pos_llh_dep_a.tow, expected 2567700, is %d", last_msg.msg.pos_llh_dep_a.tow); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 1, + "incorrect value for last_msg.msg.pos_llh_dep_a.flags, " + "expected 1, is %d", + last_msg.msg.pos_llh_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.height * 100 - 69.6881406772 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected " + "69.6881406772, is %s", + last_msg.msg.pos_llh_dep_a.height); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lat * 100 - 37.4290643089 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected " + "37.4290643089, is %s", + last_msg.msg.pos_llh_dep_a.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lon * 100 - -122.173408261 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected " + "-122.173408261, is %s", + last_msg.msg.pos_llh_dep_a.lon); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.pos_llh_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 2567700, + "incorrect value for last_msg.msg.pos_llh_dep_a.tow, " + "expected 2567700, is %d", + last_msg.msg.pos_llh_dep_a.tow); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -240,72 +308,108 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,2,246,215,34,120,46,39,0,56,214,210,65,235,182,66,64,13,46,132,80,25,139,94,192,22,143,46,234,191,95,81,64,0,0,0,0,9,0,174,105, }; + u8 encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 120, 46, 39, 0, 56, 214, 210, 65, + 235, 182, 66, 64, 13, 46, 132, 80, 25, 139, 94, 192, 22, 143, + 46, 234, 191, 95, 81, 64, 0, 0, 0, 0, 9, 0, 174, 105, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh_dep_a.flags = 0; - + test_msg.pos_llh_dep_a.h_accuracy = 0; - + test_msg.pos_llh_dep_a.height = 69.49608854815264; - + test_msg.pos_llh_dep_a.lat = 37.42905447764173; - + test_msg.pos_llh_dep_a.lon = -122.17342007549469; - + test_msg.pos_llh_dep_a.n_sats = 9; - + test_msg.pos_llh_dep_a.tow = 2567800; - + test_msg.pos_llh_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.flags, expected 0, is %d", last_msg.msg.pos_llh_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.height * 100 - 69.4960885482 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected 69.4960885482, is %s", last_msg.msg.pos_llh_dep_a.height); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lat * 100 - 37.4290544776 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected 37.4290544776, is %s", last_msg.msg.pos_llh_dep_a.lat); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lon * 100 - -122.173420075 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected -122.173420075, is %s", last_msg.msg.pos_llh_dep_a.lon); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 9, "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, expected 9, is %d", last_msg.msg.pos_llh_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 2567800, "incorrect value for last_msg.msg.pos_llh_dep_a.tow, expected 2567800, is %d", last_msg.msg.pos_llh_dep_a.tow); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.height * 100 - 69.4960885482 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected " + "69.4960885482, is %s", + last_msg.msg.pos_llh_dep_a.height); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lat * 100 - 37.4290544776 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected " + "37.4290544776, is %s", + last_msg.msg.pos_llh_dep_a.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lon * 100 - -122.173420075 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected " + "-122.173420075, is %s", + last_msg.msg.pos_llh_dep_a.lon); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.pos_llh_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 2567800, + "incorrect value for last_msg.msg.pos_llh_dep_a.tow, " + "expected 2567800, is %d", + last_msg.msg.pos_llh_dep_a.tow); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -313,72 +417,108 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,2,246,215,34,120,46,39,0,251,117,115,140,235,182,66,64,152,134,167,12,25,139,94,192,160,22,137,253,4,108,81,64,0,0,0,0,9,1,122,127, }; + u8 encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 120, 46, 39, 0, 251, 117, 115, 140, + 235, 182, 66, 64, 152, 134, 167, 12, 25, 139, 94, 192, 160, 22, + 137, 253, 4, 108, 81, 64, 0, 0, 0, 0, 9, 1, 122, 127, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh_dep_a.flags = 1; - + test_msg.pos_llh_dep_a.h_accuracy = 0; - + test_msg.pos_llh_dep_a.height = 69.68780458819901; - + test_msg.pos_llh_dep_a.lat = 37.429063373925565; - + test_msg.pos_llh_dep_a.lon = -122.17340389594972; - + test_msg.pos_llh_dep_a.n_sats = 9; - + test_msg.pos_llh_dep_a.tow = 2567800; - + test_msg.pos_llh_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 1, "incorrect value for last_msg.msg.pos_llh_dep_a.flags, expected 1, is %d", last_msg.msg.pos_llh_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.height * 100 - 69.6878045882 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected 69.6878045882, is %s", last_msg.msg.pos_llh_dep_a.height); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lat * 100 - 37.4290633739 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected 37.4290633739, is %s", last_msg.msg.pos_llh_dep_a.lat); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lon * 100 - -122.173403896 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected -122.173403896, is %s", last_msg.msg.pos_llh_dep_a.lon); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 9, "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, expected 9, is %d", last_msg.msg.pos_llh_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 2567800, "incorrect value for last_msg.msg.pos_llh_dep_a.tow, expected 2567800, is %d", last_msg.msg.pos_llh_dep_a.tow); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 1, + "incorrect value for last_msg.msg.pos_llh_dep_a.flags, " + "expected 1, is %d", + last_msg.msg.pos_llh_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.height * 100 - 69.6878045882 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected " + "69.6878045882, is %s", + last_msg.msg.pos_llh_dep_a.height); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lat * 100 - 37.4290633739 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected " + "37.4290633739, is %s", + last_msg.msg.pos_llh_dep_a.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lon * 100 - -122.173403896 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected " + "-122.173403896, is %s", + last_msg.msg.pos_llh_dep_a.lon); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.pos_llh_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 2567800, + "incorrect value for last_msg.msg.pos_llh_dep_a.tow, " + "expected 2567800, is %d", + last_msg.msg.pos_llh_dep_a.tow); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -386,72 +526,108 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,2,246,215,34,220,46,39,0,51,124,88,251,235,182,66,64,153,5,250,16,25,139,94,192,146,60,187,219,152,161,81,64,0,0,0,0,9,0,194,158, }; + u8 encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 220, 46, 39, 0, 51, 124, 88, 251, + 235, 182, 66, 64, 153, 5, 250, 16, 25, 139, 94, 192, 146, 60, + 187, 219, 152, 161, 81, 64, 0, 0, 0, 0, 9, 0, 194, 158, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh_dep_a.flags = 0; - + test_msg.pos_llh_dep_a.h_accuracy = 0; - + test_msg.pos_llh_dep_a.height = 70.5249547317965; - + test_msg.pos_llh_dep_a.lat = 37.42907659359516; - + test_msg.pos_llh_dep_a.lon = -122.17340492645452; - + test_msg.pos_llh_dep_a.n_sats = 9; - + test_msg.pos_llh_dep_a.tow = 2567900; - + test_msg.pos_llh_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.flags, expected 0, is %d", last_msg.msg.pos_llh_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.height * 100 - 70.5249547318 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected 70.5249547318, is %s", last_msg.msg.pos_llh_dep_a.height); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lat * 100 - 37.4290765936 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected 37.4290765936, is %s", last_msg.msg.pos_llh_dep_a.lat); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lon * 100 - -122.173404926 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected -122.173404926, is %s", last_msg.msg.pos_llh_dep_a.lon); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 9, "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, expected 9, is %d", last_msg.msg.pos_llh_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 2567900, "incorrect value for last_msg.msg.pos_llh_dep_a.tow, expected 2567900, is %d", last_msg.msg.pos_llh_dep_a.tow); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.height * 100 - 70.5249547318 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected " + "70.5249547318, is %s", + last_msg.msg.pos_llh_dep_a.height); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lat * 100 - 37.4290765936 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected " + "37.4290765936, is %s", + last_msg.msg.pos_llh_dep_a.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lon * 100 - -122.173404926 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected " + "-122.173404926, is %s", + last_msg.msg.pos_llh_dep_a.lon); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.pos_llh_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 2567900, + "incorrect value for last_msg.msg.pos_llh_dep_a.tow, " + "expected 2567900, is %d", + last_msg.msg.pos_llh_dep_a.tow); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -459,72 +635,108 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,2,195,4,34,212,157,67,24,8,23,228,8,151,225,66,64,156,174,42,194,230,152,94,192,153,23,72,47,196,40,16,64,0,0,0,0,8,0,237,169, }; + u8 encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 212, 157, 67, 24, 8, 23, 228, 8, + 151, 225, 66, 64, 156, 174, 42, 194, 230, 152, 94, 192, 153, 23, + 72, 47, 196, 40, 16, 64, 0, 0, 0, 0, 8, 0, 237, 169, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh_dep_a.flags = 0; - + test_msg.pos_llh_dep_a.h_accuracy = 0; - + test_msg.pos_llh_dep_a.height = 4.039810885214956; - + test_msg.pos_llh_dep_a.lat = 37.76242171418386; - + test_msg.pos_llh_dep_a.lon = -122.38908437889262; - + test_msg.pos_llh_dep_a.n_sats = 8; - + test_msg.pos_llh_dep_a.tow = 407084500; - + test_msg.pos_llh_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.flags, expected 0, is %d", last_msg.msg.pos_llh_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.height * 100 - 4.03981088521 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected 4.03981088521, is %s", last_msg.msg.pos_llh_dep_a.height); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lat * 100 - 37.7624217142 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected 37.7624217142, is %s", last_msg.msg.pos_llh_dep_a.lat); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lon * 100 - -122.389084379 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected -122.389084379, is %s", last_msg.msg.pos_llh_dep_a.lon); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 8, "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, expected 8, is %d", last_msg.msg.pos_llh_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 407084500, "incorrect value for last_msg.msg.pos_llh_dep_a.tow, expected 407084500, is %d", last_msg.msg.pos_llh_dep_a.tow); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.height * 100 - 4.03981088521 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected " + "4.03981088521, is %s", + last_msg.msg.pos_llh_dep_a.height); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lat * 100 - 37.7624217142 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected " + "37.7624217142, is %s", + last_msg.msg.pos_llh_dep_a.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lon * 100 - -122.389084379 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected " + "-122.389084379, is %s", + last_msg.msg.pos_llh_dep_a.lon); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.pos_llh_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 407084500, + "incorrect value for last_msg.msg.pos_llh_dep_a.tow, " + "expected 407084500, is %d", + last_msg.msg.pos_llh_dep_a.tow); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -532,72 +744,108 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,2,195,4,34,56,158,67,24,220,109,212,24,151,225,66,64,159,231,254,219,230,152,94,192,128,151,67,19,233,105,7,64,0,0,0,0,8,0,152,11, }; + u8 encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 56, 158, 67, 24, 220, 109, 212, 24, + 151, 225, 66, 64, 159, 231, 254, 219, 230, 152, 94, 192, 128, 151, + 67, 19, 233, 105, 7, 64, 0, 0, 0, 0, 8, 0, 152, 11, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh_dep_a.flags = 0; - + test_msg.pos_llh_dep_a.h_accuracy = 0; - + test_msg.pos_llh_dep_a.height = 2.926714087009657; - + test_msg.pos_llh_dep_a.lat = 37.76242361423985; - + test_msg.pos_llh_dep_a.lon = -122.38909053700489; - + test_msg.pos_llh_dep_a.n_sats = 8; - + test_msg.pos_llh_dep_a.tow = 407084600; - + test_msg.pos_llh_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.flags, expected 0, is %d", last_msg.msg.pos_llh_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.height * 100 - 2.92671408701 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected 2.92671408701, is %s", last_msg.msg.pos_llh_dep_a.height); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lat * 100 - 37.7624236142 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected 37.7624236142, is %s", last_msg.msg.pos_llh_dep_a.lat); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lon * 100 - -122.389090537 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected -122.389090537, is %s", last_msg.msg.pos_llh_dep_a.lon); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 8, "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, expected 8, is %d", last_msg.msg.pos_llh_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 407084600, "incorrect value for last_msg.msg.pos_llh_dep_a.tow, expected 407084600, is %d", last_msg.msg.pos_llh_dep_a.tow); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.height * 100 - 2.92671408701 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected " + "2.92671408701, is %s", + last_msg.msg.pos_llh_dep_a.height); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lat * 100 - 37.7624236142 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected " + "37.7624236142, is %s", + last_msg.msg.pos_llh_dep_a.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lon * 100 - -122.389090537 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected " + "-122.389090537, is %s", + last_msg.msg.pos_llh_dep_a.lon); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.pos_llh_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 407084600, + "incorrect value for last_msg.msg.pos_llh_dep_a.tow, " + "expected 407084600, is %d", + last_msg.msg.pos_llh_dep_a.tow); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -605,72 +853,108 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,2,195,4,34,156,158,67,24,13,91,237,11,151,225,66,64,75,113,210,220,230,152,94,192,37,6,145,188,89,112,238,63,0,0,0,0,8,0,221,155, }; + u8 encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 156, 158, 67, 24, 13, 91, 237, 11, + 151, 225, 66, 64, 75, 113, 210, 220, 230, 152, 94, 192, 37, 6, + 145, 188, 89, 112, 238, 63, 0, 0, 0, 0, 8, 0, 221, 155, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh_dep_a.flags = 0; - + test_msg.pos_llh_dep_a.h_accuracy = 0; - + test_msg.pos_llh_dep_a.height = 0.9512146647395566; - + test_msg.pos_llh_dep_a.lat = 37.762422076126406; - + test_msg.pos_llh_dep_a.lon = -122.3890907340148; - + test_msg.pos_llh_dep_a.n_sats = 8; - + test_msg.pos_llh_dep_a.tow = 407084700; - + test_msg.pos_llh_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.flags, expected 0, is %d", last_msg.msg.pos_llh_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.height * 100 - 0.95121466474 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected 0.95121466474, is %s", last_msg.msg.pos_llh_dep_a.height); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lat * 100 - 37.7624220761 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected 37.7624220761, is %s", last_msg.msg.pos_llh_dep_a.lat); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lon * 100 - -122.389090734 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected -122.389090734, is %s", last_msg.msg.pos_llh_dep_a.lon); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 8, "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, expected 8, is %d", last_msg.msg.pos_llh_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 407084700, "incorrect value for last_msg.msg.pos_llh_dep_a.tow, expected 407084700, is %d", last_msg.msg.pos_llh_dep_a.tow); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.height * 100 - 0.95121466474 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected " + "0.95121466474, is %s", + last_msg.msg.pos_llh_dep_a.height); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lat * 100 - 37.7624220761 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected " + "37.7624220761, is %s", + last_msg.msg.pos_llh_dep_a.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lon * 100 - -122.389090734 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected " + "-122.389090734, is %s", + last_msg.msg.pos_llh_dep_a.lon); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.pos_llh_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 407084700, + "incorrect value for last_msg.msg.pos_llh_dep_a.tow, " + "expected 407084700, is %d", + last_msg.msg.pos_llh_dep_a.tow); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -678,72 +962,108 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,2,195,4,34,0,159,67,24,51,183,5,8,151,225,66,64,13,226,148,253,230,152,94,192,187,27,11,32,69,213,2,64,0,0,0,0,8,0,82,94, }; + u8 encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 0, 159, 67, 24, 51, 183, 5, 8, + 151, 225, 66, 64, 13, 226, 148, 253, 230, 152, 94, 192, 187, 27, + 11, 32, 69, 213, 2, 64, 0, 0, 0, 0, 8, 0, 82, 94, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh_dep_a.flags = 0; - + test_msg.pos_llh_dep_a.h_accuracy = 0; - + test_msg.pos_llh_dep_a.height = 2.354135752047538; - + test_msg.pos_llh_dep_a.lat = 37.762421610632735; - + test_msg.pos_llh_dep_a.lon = -122.38909854449612; - + test_msg.pos_llh_dep_a.n_sats = 8; - + test_msg.pos_llh_dep_a.tow = 407084800; - + test_msg.pos_llh_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.flags, expected 0, is %d", last_msg.msg.pos_llh_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.height * 100 - 2.35413575205 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected 2.35413575205, is %s", last_msg.msg.pos_llh_dep_a.height); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lat * 100 - 37.7624216106 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected 37.7624216106, is %s", last_msg.msg.pos_llh_dep_a.lat); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lon * 100 - -122.389098544 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected -122.389098544, is %s", last_msg.msg.pos_llh_dep_a.lon); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 8, "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, expected 8, is %d", last_msg.msg.pos_llh_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 407084800, "incorrect value for last_msg.msg.pos_llh_dep_a.tow, expected 407084800, is %d", last_msg.msg.pos_llh_dep_a.tow); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.height * 100 - 2.35413575205 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected " + "2.35413575205, is %s", + last_msg.msg.pos_llh_dep_a.height); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lat * 100 - 37.7624216106 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected " + "37.7624216106, is %s", + last_msg.msg.pos_llh_dep_a.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lon * 100 - -122.389098544 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected " + "-122.389098544, is %s", + last_msg.msg.pos_llh_dep_a.lon); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.pos_llh_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 407084800, + "incorrect value for last_msg.msg.pos_llh_dep_a.tow, " + "expected 407084800, is %d", + last_msg.msg.pos_llh_dep_a.tow); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -751,72 +1071,108 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,2,195,4,34,100,159,67,24,22,77,146,22,151,225,66,64,64,134,105,227,230,152,94,192,37,99,114,72,31,103,241,63,0,0,0,0,8,0,70,60, }; + u8 encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 100, 159, 67, 24, 22, 77, 146, 22, + 151, 225, 66, 64, 64, 134, 105, 227, 230, 152, 94, 192, 37, 99, + 114, 72, 31, 103, 241, 63, 0, 0, 0, 0, 8, 0, 70, 60, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh_dep_a.flags = 0; - + test_msg.pos_llh_dep_a.h_accuracy = 0; - + test_msg.pos_llh_dep_a.height = 1.0876763181642641; - + test_msg.pos_llh_dep_a.lat = 37.76242334502801; - + test_msg.pos_llh_dep_a.lon = -122.38909230523223; - + test_msg.pos_llh_dep_a.n_sats = 8; - + test_msg.pos_llh_dep_a.tow = 407084900; - + test_msg.pos_llh_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.flags, expected 0, is %d", last_msg.msg.pos_llh_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.height * 100 - 1.08767631816 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected 1.08767631816, is %s", last_msg.msg.pos_llh_dep_a.height); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lat * 100 - 37.762423345 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected 37.762423345, is %s", last_msg.msg.pos_llh_dep_a.lat); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lon * 100 - -122.389092305 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected -122.389092305, is %s", last_msg.msg.pos_llh_dep_a.lon); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 8, "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, expected 8, is %d", last_msg.msg.pos_llh_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 407084900, "incorrect value for last_msg.msg.pos_llh_dep_a.tow, expected 407084900, is %d", last_msg.msg.pos_llh_dep_a.tow); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.height * 100 - 1.08767631816 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected " + "1.08767631816, is %s", + last_msg.msg.pos_llh_dep_a.height); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lat * 100 - 37.762423345 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected " + "37.762423345, is %s", + last_msg.msg.pos_llh_dep_a.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lon * 100 - -122.389092305 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected " + "-122.389092305, is %s", + last_msg.msg.pos_llh_dep_a.lon); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.pos_llh_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 407084900, + "incorrect value for last_msg.msg.pos_llh_dep_a.tow, " + "expected 407084900, is %d", + last_msg.msg.pos_llh_dep_a.tow); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -824,75 +1180,111 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,2,195,4,34,46,162,68,24,124,245,46,169,151,225,66,64,135,149,234,187,230,152,94,192,194,201,115,145,166,175,20,64,0,0,0,0,5,0,212,121, }; + u8 encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 46, 162, 68, 24, 124, 245, 46, 169, + 151, 225, 66, 64, 135, 149, 234, 187, 230, 152, 94, 192, 194, 201, + 115, 145, 166, 175, 20, 64, 0, 0, 0, 0, 5, 0, 212, 121, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh_dep_a.flags = 0; - + test_msg.pos_llh_dep_a.h_accuracy = 0; - + test_msg.pos_llh_dep_a.height = 5.171533844654222; - + test_msg.pos_llh_dep_a.lat = 37.76244082253376; - + test_msg.pos_llh_dep_a.lon = -122.38908288868525; - + test_msg.pos_llh_dep_a.n_sats = 5; - + test_msg.pos_llh_dep_a.tow = 407151150; - + test_msg.pos_llh_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosLlhDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosLlhDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.flags, expected 0, is %d", last_msg.msg.pos_llh_dep_a.flags); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.height * 100 - 5.17153384465 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected 5.17153384465, is %s", last_msg.msg.pos_llh_dep_a.height); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lat * 100 - 37.7624408225 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected 37.7624408225, is %s", last_msg.msg.pos_llh_dep_a.lat); - - ck_assert_msg((last_msg.msg.pos_llh_dep_a.lon * 100 - -122.389082889 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected -122.389082889, is %s", last_msg.msg.pos_llh_dep_a.lon); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 5, "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, expected 5, is %d", last_msg.msg.pos_llh_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 407151150, "incorrect value for last_msg.msg.pos_llh_dep_a.tow, expected 407151150, is %d", last_msg.msg.pos_llh_dep_a.tow); - - ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.pos_llh_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.pos_llh_dep_a.flags == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.flags); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.height * 100 - 5.17153384465 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.height, expected " + "5.17153384465, is %s", + last_msg.msg.pos_llh_dep_a.height); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lat * 100 - 37.7624408225 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lat, expected " + "37.7624408225, is %s", + last_msg.msg.pos_llh_dep_a.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh_dep_a.lon * 100 - -122.389082889 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_dep_a.lon, expected " + "-122.389082889, is %s", + last_msg.msg.pos_llh_dep_a.lon); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.n_sats == 5, + "incorrect value for last_msg.msg.pos_llh_dep_a.n_sats, " + "expected 5, is %d", + last_msg.msg.pos_llh_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.tow == 407151150, + "incorrect value for last_msg.msg.pos_llh_dep_a.tow, " + "expected 407151150, is %d", + last_msg.msg.pos_llh_dep_a.tow); + + ck_assert_msg(last_msg.msg.pos_llh_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.pos_llh_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.pos_llh_dep_a.v_accuracy); } } END_TEST -Suite* auto_check_sbp_navigation_MsgPosLLHDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgPosLLHDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosLLHDepA"); +Suite *auto_check_sbp_navigation_MsgPosLLHDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgPosLLHDepA"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosLLHDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgPosLLHDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgPosLlhAcc.c b/c/test/auto_check_sbp_navigation_MsgPosLlhAcc.c index cc97f57e2..cb047c3db 100644 --- a/c/test/auto_check_sbp_navigation_MsgPosLlhAcc.c +++ b/c/test/auto_check_sbp_navigation_MsgPosLlhAcc.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhAcc.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhAcc.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgPosLlhAcc ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgPosLlhAcc) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLlhAcc ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,105 +90,173 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLlhAcc ) logging_reset(); - sbp_callback_register(&sbp_state, 0x218, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x218, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,24,2,2,28,67,39,120,110,18,51,51,51,51,51,139,189,64,154,153,153,153,25,151,192,64,51,51,51,51,51,161,176,64,51,51,51,51,51,101,179,64,51,163,22,69,154,25,173,69,102,134,243,68,154,201,196,69,205,224,0,70,51,35,72,69,51,99,31,69,95,27,72,220,177, }; + u8 encoded_frame[] = { + 85, 24, 2, 2, 28, 67, 39, 120, 110, 18, 51, 51, 51, + 51, 51, 139, 189, 64, 154, 153, 153, 153, 25, 151, 192, 64, + 51, 51, 51, 51, 51, 161, 176, 64, 51, 51, 51, 51, 51, + 101, 179, 64, 51, 163, 22, 69, 154, 25, 173, 69, 102, 134, + 243, 68, 154, 201, 196, 69, 205, 224, 0, 70, 51, 35, 72, + 69, 51, 99, 31, 69, 95, 27, 72, 220, 177, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh_acc.at_accuracy = 6297.2001953125; - + test_msg.pos_llh_acc.confidence_and_geoid = 95; - + test_msg.pos_llh_acc.ct_accuracy = 1948.199951171875; - + test_msg.pos_llh_acc.flags = 72; - + test_msg.pos_llh_acc.h_accuracy = 2410.199951171875; - - + test_msg.pos_llh_acc.h_ellipse.orientation = 2550.199951171875; - + test_msg.pos_llh_acc.h_ellipse.semi_major = 8248.2001953125; - + test_msg.pos_llh_acc.h_ellipse.semi_minor = 3202.199951171875; - + test_msg.pos_llh_acc.height = 4257.2; - + test_msg.pos_llh_acc.lat = 7563.2; - + test_msg.pos_llh_acc.lon = 8494.2; - + test_msg.pos_llh_acc.n_sats = 27; - + test_msg.pos_llh_acc.orthometric_height = 4965.2; - + test_msg.pos_llh_acc.tow = 309229607; - + test_msg.pos_llh_acc.v_accuracy = 5539.2001953125; - sbp_message_send(&sbp_state, SbpMsgPosLlhAcc, 7170, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosLlhAcc, 7170, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 7170, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosLlhAcc, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosLlhAcc, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.pos_llh_acc.at_accuracy * 100 - 6297.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_acc.at_accuracy, expected 6297.20019531, is %s", last_msg.msg.pos_llh_acc.at_accuracy); - - ck_assert_msg(last_msg.msg.pos_llh_acc.confidence_and_geoid == 95, "incorrect value for last_msg.msg.pos_llh_acc.confidence_and_geoid, expected 95, is %d", last_msg.msg.pos_llh_acc.confidence_and_geoid); - - ck_assert_msg((last_msg.msg.pos_llh_acc.ct_accuracy * 100 - 1948.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_acc.ct_accuracy, expected 1948.19995117, is %s", last_msg.msg.pos_llh_acc.ct_accuracy); - - ck_assert_msg(last_msg.msg.pos_llh_acc.flags == 72, "incorrect value for last_msg.msg.pos_llh_acc.flags, expected 72, is %d", last_msg.msg.pos_llh_acc.flags); - - ck_assert_msg((last_msg.msg.pos_llh_acc.h_accuracy * 100 - 2410.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_acc.h_accuracy, expected 2410.19995117, is %s", last_msg.msg.pos_llh_acc.h_accuracy); - - - ck_assert_msg((last_msg.msg.pos_llh_acc.h_ellipse.orientation * 100 - 2550.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_acc.h_ellipse.orientation, expected 2550.19995117, is %s", last_msg.msg.pos_llh_acc.h_ellipse.orientation); - - ck_assert_msg((last_msg.msg.pos_llh_acc.h_ellipse.semi_major * 100 - 8248.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_acc.h_ellipse.semi_major, expected 8248.20019531, is %s", last_msg.msg.pos_llh_acc.h_ellipse.semi_major); - - ck_assert_msg((last_msg.msg.pos_llh_acc.h_ellipse.semi_minor * 100 - 3202.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_acc.h_ellipse.semi_minor, expected 3202.19995117, is %s", last_msg.msg.pos_llh_acc.h_ellipse.semi_minor); - - ck_assert_msg((last_msg.msg.pos_llh_acc.height * 100 - 4257.2 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_acc.height, expected 4257.2, is %s", last_msg.msg.pos_llh_acc.height); - - ck_assert_msg((last_msg.msg.pos_llh_acc.lat * 100 - 7563.2 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_acc.lat, expected 7563.2, is %s", last_msg.msg.pos_llh_acc.lat); - - ck_assert_msg((last_msg.msg.pos_llh_acc.lon * 100 - 8494.2 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_acc.lon, expected 8494.2, is %s", last_msg.msg.pos_llh_acc.lon); - - ck_assert_msg(last_msg.msg.pos_llh_acc.n_sats == 27, "incorrect value for last_msg.msg.pos_llh_acc.n_sats, expected 27, is %d", last_msg.msg.pos_llh_acc.n_sats); - - ck_assert_msg((last_msg.msg.pos_llh_acc.orthometric_height * 100 - 4965.2 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_acc.orthometric_height, expected 4965.2, is %s", last_msg.msg.pos_llh_acc.orthometric_height); - - ck_assert_msg(last_msg.msg.pos_llh_acc.tow == 309229607, "incorrect value for last_msg.msg.pos_llh_acc.tow, expected 309229607, is %d", last_msg.msg.pos_llh_acc.tow); - - ck_assert_msg((last_msg.msg.pos_llh_acc.v_accuracy * 100 - 5539.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_acc.v_accuracy, expected 5539.20019531, is %s", last_msg.msg.pos_llh_acc.v_accuracy); + ck_assert_msg((last_msg.msg.pos_llh_acc.at_accuracy * 100 - + 6297.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_acc.at_accuracy, " + "expected 6297.20019531, is %s", + last_msg.msg.pos_llh_acc.at_accuracy); + + ck_assert_msg( + last_msg.msg.pos_llh_acc.confidence_and_geoid == 95, + "incorrect value for last_msg.msg.pos_llh_acc.confidence_and_geoid, " + "expected 95, is %d", + last_msg.msg.pos_llh_acc.confidence_and_geoid); + + ck_assert_msg((last_msg.msg.pos_llh_acc.ct_accuracy * 100 - + 1948.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_acc.ct_accuracy, " + "expected 1948.19995117, is %s", + last_msg.msg.pos_llh_acc.ct_accuracy); + + ck_assert_msg(last_msg.msg.pos_llh_acc.flags == 72, + "incorrect value for last_msg.msg.pos_llh_acc.flags, " + "expected 72, is %d", + last_msg.msg.pos_llh_acc.flags); + + ck_assert_msg((last_msg.msg.pos_llh_acc.h_accuracy * 100 - + 2410.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_acc.h_accuracy, " + "expected 2410.19995117, is %s", + last_msg.msg.pos_llh_acc.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh_acc.h_ellipse.orientation * 100 - + 2550.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_acc.h_ellipse.orientation, " + "expected 2550.19995117, is %s", + last_msg.msg.pos_llh_acc.h_ellipse.orientation); + + ck_assert_msg( + (last_msg.msg.pos_llh_acc.h_ellipse.semi_major * 100 - + 8248.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_acc.h_ellipse.semi_major, " + "expected 8248.20019531, is %s", + last_msg.msg.pos_llh_acc.h_ellipse.semi_major); + + ck_assert_msg( + (last_msg.msg.pos_llh_acc.h_ellipse.semi_minor * 100 - + 3202.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_acc.h_ellipse.semi_minor, " + "expected 3202.19995117, is %s", + last_msg.msg.pos_llh_acc.h_ellipse.semi_minor); + + ck_assert_msg((last_msg.msg.pos_llh_acc.height * 100 - 4257.2 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_acc.height, " + "expected 4257.2, is %s", + last_msg.msg.pos_llh_acc.height); + + ck_assert_msg((last_msg.msg.pos_llh_acc.lat * 100 - 7563.2 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_acc.lat, expected " + "7563.2, is %s", + last_msg.msg.pos_llh_acc.lat); + + ck_assert_msg((last_msg.msg.pos_llh_acc.lon * 100 - 8494.2 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_acc.lon, expected " + "8494.2, is %s", + last_msg.msg.pos_llh_acc.lon); + + ck_assert_msg(last_msg.msg.pos_llh_acc.n_sats == 27, + "incorrect value for last_msg.msg.pos_llh_acc.n_sats, " + "expected 27, is %d", + last_msg.msg.pos_llh_acc.n_sats); + + ck_assert_msg( + (last_msg.msg.pos_llh_acc.orthometric_height * 100 - 4965.2 * 100) < + 0.05, + "incorrect value for last_msg.msg.pos_llh_acc.orthometric_height, " + "expected 4965.2, is %s", + last_msg.msg.pos_llh_acc.orthometric_height); + + ck_assert_msg(last_msg.msg.pos_llh_acc.tow == 309229607, + "incorrect value for last_msg.msg.pos_llh_acc.tow, expected " + "309229607, is %d", + last_msg.msg.pos_llh_acc.tow); + + ck_assert_msg((last_msg.msg.pos_llh_acc.v_accuracy * 100 - + 5539.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_acc.v_accuracy, " + "expected 5539.20019531, is %s", + last_msg.msg.pos_llh_acc.v_accuracy); } } END_TEST -Suite* auto_check_sbp_navigation_MsgPosLlhAcc_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgPosLlhAcc"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosLlhAcc"); +Suite *auto_check_sbp_navigation_MsgPosLlhAcc_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgPosLlhAcc"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosLlhAcc"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgPosLlhAcc); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgPosLlhCovGnss.c b/c/test/auto_check_sbp_navigation_MsgPosLlhCovGnss.c index 1387169a6..1799084a4 100644 --- a/c/test/auto_check_sbp_navigation_MsgPosLlhCovGnss.c +++ b/c/test/auto_check_sbp_navigation_MsgPosLlhCovGnss.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhCovGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhCovGnss.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgPosLlhCovGnss ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgPosLlhCovGnss) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLlhCovGnss ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,91 +90,147 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLlhCovGnss ) logging_reset(); - sbp_callback_register(&sbp_state, 0x231, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x231, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,49,2,0,16,54,24,229,233,29,73,123,28,207,101,234,66,64,100,168,19,20,86,146,94,192,214,198,35,120,209,100,49,192,12,102,245,59,6,181,192,185,168,79,243,58,96,60,148,59,253,58,93,186,159,174,6,61,18,4,10,196, }; + u8 encoded_frame[] = { + 85, 49, 2, 0, 16, 54, 24, 229, 233, 29, 73, 123, 28, + 207, 101, 234, 66, 64, 100, 168, 19, 20, 86, 146, 94, 192, + 214, 198, 35, 120, 209, 100, 49, 192, 12, 102, 245, 59, 6, + 181, 192, 185, 168, 79, 243, 58, 96, 60, 148, 59, 253, 58, + 93, 186, 159, 174, 6, 61, 18, 4, 10, 196, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh_cov_gnss.cov_d_d = 0.03288137540221214; - + test_msg.pos_llh_cov_gnss.cov_e_d = -0.0008439270895905793; - + test_msg.pos_llh_cov_gnss.cov_e_e = 0.004523798823356628; - + test_msg.pos_llh_cov_gnss.cov_n_d = 0.0018563168123364449; - + test_msg.pos_llh_cov_gnss.cov_n_e = -0.00036755966721102595; - + test_msg.pos_llh_cov_gnss.cov_n_n = 0.007488971576094627; - + test_msg.pos_llh_cov_gnss.flags = 4; - + test_msg.pos_llh_cov_gnss.height = -17.39382124780135; - + test_msg.pos_llh_cov_gnss.lat = 37.83123196497633; - + test_msg.pos_llh_cov_gnss.lon = -122.28650381011681; - + test_msg.pos_llh_cov_gnss.n_sats = 18; - + test_msg.pos_llh_cov_gnss.tow = 501867800; - sbp_message_send(&sbp_state, SbpMsgPosLlhCovGnss, 4096, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosLlhCovGnss, 4096, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosLlhCovGnss, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosLlhCovGnss, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.cov_d_d * 100 - 0.0328813754022 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov_gnss.cov_d_d, expected 0.0328813754022, is %s", last_msg.msg.pos_llh_cov_gnss.cov_d_d); - - ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.cov_e_d * 100 - -0.000843927089591 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov_gnss.cov_e_d, expected -0.000843927089591, is %s", last_msg.msg.pos_llh_cov_gnss.cov_e_d); - - ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.cov_e_e * 100 - 0.00452379882336 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov_gnss.cov_e_e, expected 0.00452379882336, is %s", last_msg.msg.pos_llh_cov_gnss.cov_e_e); - - ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.cov_n_d * 100 - 0.00185631681234 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov_gnss.cov_n_d, expected 0.00185631681234, is %s", last_msg.msg.pos_llh_cov_gnss.cov_n_d); - - ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.cov_n_e * 100 - -0.000367559667211 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov_gnss.cov_n_e, expected -0.000367559667211, is %s", last_msg.msg.pos_llh_cov_gnss.cov_n_e); - - ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.cov_n_n * 100 - 0.00748897157609 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov_gnss.cov_n_n, expected 0.00748897157609, is %s", last_msg.msg.pos_llh_cov_gnss.cov_n_n); - - ck_assert_msg(last_msg.msg.pos_llh_cov_gnss.flags == 4, "incorrect value for last_msg.msg.pos_llh_cov_gnss.flags, expected 4, is %d", last_msg.msg.pos_llh_cov_gnss.flags); - - ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.height * 100 - -17.3938212478 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov_gnss.height, expected -17.3938212478, is %s", last_msg.msg.pos_llh_cov_gnss.height); - - ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.lat * 100 - 37.831231965 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov_gnss.lat, expected 37.831231965, is %s", last_msg.msg.pos_llh_cov_gnss.lat); - - ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.lon * 100 - -122.28650381 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_cov_gnss.lon, expected -122.28650381, is %s", last_msg.msg.pos_llh_cov_gnss.lon); - - ck_assert_msg(last_msg.msg.pos_llh_cov_gnss.n_sats == 18, "incorrect value for last_msg.msg.pos_llh_cov_gnss.n_sats, expected 18, is %d", last_msg.msg.pos_llh_cov_gnss.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh_cov_gnss.tow == 501867800, "incorrect value for last_msg.msg.pos_llh_cov_gnss.tow, expected 501867800, is %d", last_msg.msg.pos_llh_cov_gnss.tow); + ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.cov_d_d * 100 - + 0.0328813754022 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov_gnss.cov_d_d, " + "expected 0.0328813754022, is %s", + last_msg.msg.pos_llh_cov_gnss.cov_d_d); + + ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.cov_e_d * 100 - + -0.000843927089591 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov_gnss.cov_e_d, " + "expected -0.000843927089591, is %s", + last_msg.msg.pos_llh_cov_gnss.cov_e_d); + + ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.cov_e_e * 100 - + 0.00452379882336 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov_gnss.cov_e_e, " + "expected 0.00452379882336, is %s", + last_msg.msg.pos_llh_cov_gnss.cov_e_e); + + ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.cov_n_d * 100 - + 0.00185631681234 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov_gnss.cov_n_d, " + "expected 0.00185631681234, is %s", + last_msg.msg.pos_llh_cov_gnss.cov_n_d); + + ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.cov_n_e * 100 - + -0.000367559667211 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov_gnss.cov_n_e, " + "expected -0.000367559667211, is %s", + last_msg.msg.pos_llh_cov_gnss.cov_n_e); + + ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.cov_n_n * 100 - + 0.00748897157609 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov_gnss.cov_n_n, " + "expected 0.00748897157609, is %s", + last_msg.msg.pos_llh_cov_gnss.cov_n_n); + + ck_assert_msg(last_msg.msg.pos_llh_cov_gnss.flags == 4, + "incorrect value for last_msg.msg.pos_llh_cov_gnss.flags, " + "expected 4, is %d", + last_msg.msg.pos_llh_cov_gnss.flags); + + ck_assert_msg((last_msg.msg.pos_llh_cov_gnss.height * 100 - + -17.3938212478 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov_gnss.height, " + "expected -17.3938212478, is %s", + last_msg.msg.pos_llh_cov_gnss.height); + + ck_assert_msg( + (last_msg.msg.pos_llh_cov_gnss.lat * 100 - 37.831231965 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov_gnss.lat, expected " + "37.831231965, is %s", + last_msg.msg.pos_llh_cov_gnss.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh_cov_gnss.lon * 100 - -122.28650381 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_cov_gnss.lon, expected " + "-122.28650381, is %s", + last_msg.msg.pos_llh_cov_gnss.lon); + + ck_assert_msg(last_msg.msg.pos_llh_cov_gnss.n_sats == 18, + "incorrect value for last_msg.msg.pos_llh_cov_gnss.n_sats, " + "expected 18, is %d", + last_msg.msg.pos_llh_cov_gnss.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh_cov_gnss.tow == 501867800, + "incorrect value for last_msg.msg.pos_llh_cov_gnss.tow, " + "expected 501867800, is %d", + last_msg.msg.pos_llh_cov_gnss.tow); } } END_TEST -Suite* auto_check_sbp_navigation_MsgPosLlhCovGnss_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgPosLlhCovGnss"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosLlhCovGnss"); +Suite *auto_check_sbp_navigation_MsgPosLlhCovGnss_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgPosLlhCovGnss"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_navigation_MsgPosLlhCovGnss"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgPosLlhCovGnss); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgPosLlhGnss.c b/c/test/auto_check_sbp_navigation_MsgPosLlhGnss.c index e2fdcb134..f5fc629f8 100644 --- a/c/test/auto_check_sbp_navigation_MsgPosLlhGnss.c +++ b/c/test/auto_check_sbp_navigation_MsgPosLlhGnss.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhGnss.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgPosLlhGnss ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgPosLlhGnss) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLlhGnss ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,75 +90,111 @@ START_TEST( test_auto_check_sbp_navigation_MsgPosLlhGnss ) logging_reset(); - sbp_callback_register(&sbp_state, 0x22a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x22a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,42,2,0,16,34,24,229,233,29,73,123,28,207,101,234,66,64,100,168,19,20,86,146,94,192,214,198,35,120,209,100,49,192,87,0,181,0,18,4,105,55, }; + u8 encoded_frame[] = { + 85, 42, 2, 0, 16, 34, 24, 229, 233, 29, 73, 123, 28, 207, + 101, 234, 66, 64, 100, 168, 19, 20, 86, 146, 94, 192, 214, 198, + 35, 120, 209, 100, 49, 192, 87, 0, 181, 0, 18, 4, 105, 55, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pos_llh_gnss.flags = 4; - + test_msg.pos_llh_gnss.h_accuracy = 87; - + test_msg.pos_llh_gnss.height = -17.39382124780135; - + test_msg.pos_llh_gnss.lat = 37.83123196497633; - + test_msg.pos_llh_gnss.lon = -122.28650381011681; - + test_msg.pos_llh_gnss.n_sats = 18; - + test_msg.pos_llh_gnss.tow = 501867800; - + test_msg.pos_llh_gnss.v_accuracy = 181; - sbp_message_send(&sbp_state, SbpMsgPosLlhGnss, 4096, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPosLlhGnss, 4096, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPosLlhGnss, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPosLlhGnss, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pos_llh_gnss.flags == 4, "incorrect value for last_msg.msg.pos_llh_gnss.flags, expected 4, is %d", last_msg.msg.pos_llh_gnss.flags); - - ck_assert_msg(last_msg.msg.pos_llh_gnss.h_accuracy == 87, "incorrect value for last_msg.msg.pos_llh_gnss.h_accuracy, expected 87, is %d", last_msg.msg.pos_llh_gnss.h_accuracy); - - ck_assert_msg((last_msg.msg.pos_llh_gnss.height * 100 - -17.3938212478 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_gnss.height, expected -17.3938212478, is %s", last_msg.msg.pos_llh_gnss.height); - - ck_assert_msg((last_msg.msg.pos_llh_gnss.lat * 100 - 37.831231965 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_gnss.lat, expected 37.831231965, is %s", last_msg.msg.pos_llh_gnss.lat); - - ck_assert_msg((last_msg.msg.pos_llh_gnss.lon * 100 - -122.28650381 * 100) < 0.05, "incorrect value for last_msg.msg.pos_llh_gnss.lon, expected -122.28650381, is %s", last_msg.msg.pos_llh_gnss.lon); - - ck_assert_msg(last_msg.msg.pos_llh_gnss.n_sats == 18, "incorrect value for last_msg.msg.pos_llh_gnss.n_sats, expected 18, is %d", last_msg.msg.pos_llh_gnss.n_sats); - - ck_assert_msg(last_msg.msg.pos_llh_gnss.tow == 501867800, "incorrect value for last_msg.msg.pos_llh_gnss.tow, expected 501867800, is %d", last_msg.msg.pos_llh_gnss.tow); - - ck_assert_msg(last_msg.msg.pos_llh_gnss.v_accuracy == 181, "incorrect value for last_msg.msg.pos_llh_gnss.v_accuracy, expected 181, is %d", last_msg.msg.pos_llh_gnss.v_accuracy); + ck_assert_msg(last_msg.msg.pos_llh_gnss.flags == 4, + "incorrect value for last_msg.msg.pos_llh_gnss.flags, " + "expected 4, is %d", + last_msg.msg.pos_llh_gnss.flags); + + ck_assert_msg(last_msg.msg.pos_llh_gnss.h_accuracy == 87, + "incorrect value for last_msg.msg.pos_llh_gnss.h_accuracy, " + "expected 87, is %d", + last_msg.msg.pos_llh_gnss.h_accuracy); + + ck_assert_msg( + (last_msg.msg.pos_llh_gnss.height * 100 - -17.3938212478 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_gnss.height, expected " + "-17.3938212478, is %s", + last_msg.msg.pos_llh_gnss.height); + + ck_assert_msg( + (last_msg.msg.pos_llh_gnss.lat * 100 - 37.831231965 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_gnss.lat, expected " + "37.831231965, is %s", + last_msg.msg.pos_llh_gnss.lat); + + ck_assert_msg( + (last_msg.msg.pos_llh_gnss.lon * 100 - -122.28650381 * 100) < 0.05, + "incorrect value for last_msg.msg.pos_llh_gnss.lon, expected " + "-122.28650381, is %s", + last_msg.msg.pos_llh_gnss.lon); + + ck_assert_msg(last_msg.msg.pos_llh_gnss.n_sats == 18, + "incorrect value for last_msg.msg.pos_llh_gnss.n_sats, " + "expected 18, is %d", + last_msg.msg.pos_llh_gnss.n_sats); + + ck_assert_msg(last_msg.msg.pos_llh_gnss.tow == 501867800, + "incorrect value for last_msg.msg.pos_llh_gnss.tow, expected " + "501867800, is %d", + last_msg.msg.pos_llh_gnss.tow); + + ck_assert_msg(last_msg.msg.pos_llh_gnss.v_accuracy == 181, + "incorrect value for last_msg.msg.pos_llh_gnss.v_accuracy, " + "expected 181, is %d", + last_msg.msg.pos_llh_gnss.v_accuracy); } } END_TEST -Suite* auto_check_sbp_navigation_MsgPosLlhGnss_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgPosLlhGnss"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosLlhGnss"); +Suite *auto_check_sbp_navigation_MsgPosLlhGnss_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgPosLlhGnss"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPosLlhGnss"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgPosLlhGnss); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgPoseRelative.c b/c/test/auto_check_sbp_navigation_MsgPoseRelative.c index 8a43f37fe..c0a1aa0d3 100644 --- a/c/test/auto_check_sbp_navigation_MsgPoseRelative.c +++ b/c/test/auto_check_sbp_navigation_MsgPoseRelative.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPoseRelative.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPoseRelative.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgPoseRelative ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgPoseRelative) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgPoseRelative ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,138 +90,234 @@ START_TEST( test_auto_check_sbp_navigation_MsgPoseRelative ) logging_reset(); - sbp_callback_register(&sbp_state, 0x245, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x245, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,69,2,66,0,90,86,4,0,0,0,86,4,0,0,172,8,0,0,76,4,0,0,38,2,0,0,100,0,0,0,100,3,200,204,252,168,157,255,115,53,186,144,190,48,34,37,0,0,128,63,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,128,63,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,5,171,187, }; + u8 encoded_frame[] = { + 85, 69, 2, 66, 0, 90, 86, 4, 0, 0, 0, 86, 4, 0, + 0, 172, 8, 0, 0, 76, 4, 0, 0, 38, 2, 0, 0, 100, + 0, 0, 0, 100, 3, 200, 204, 252, 168, 157, 255, 115, 53, 186, + 144, 190, 48, 34, 37, 0, 0, 128, 63, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 128, + 63, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 64, 5, 171, 187, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pose_relative.cov_c_x_x = 2.0; - + test_msg.pose_relative.cov_c_x_y = 0.0; - + test_msg.pose_relative.cov_c_x_z = 0.0; - + test_msg.pose_relative.cov_c_y_y = 2.0; - + test_msg.pose_relative.cov_c_y_z = 0.0; - + test_msg.pose_relative.cov_c_z_z = 2.0; - + test_msg.pose_relative.cov_r_x_x = 1.0; - + test_msg.pose_relative.cov_r_x_y = 0.0; - + test_msg.pose_relative.cov_r_x_z = 0.0; - + test_msg.pose_relative.cov_r_y_y = 1.0; - + test_msg.pose_relative.cov_r_y_z = 0.0; - + test_msg.pose_relative.cov_r_z_z = 1.0; - + test_msg.pose_relative.flags = 5; - + test_msg.pose_relative.sensor_id = 0; - + test_msg.pose_relative.timestamp_1 = 1110; - + test_msg.pose_relative.timestamp_2 = 2220; - + test_msg.pose_relative.tow = 1110; - - + test_msg.pose_relative.trans[0] = 1100; - + test_msg.pose_relative.trans[1] = 550; - + test_msg.pose_relative.trans[2] = 100; - + test_msg.pose_relative.w = -859307164; - + test_msg.pose_relative.x = -6444804; - + test_msg.pose_relative.y = -1866844813; - + test_msg.pose_relative.z = 622997694; - sbp_message_send(&sbp_state, SbpMsgPoseRelative, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgPoseRelative, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgPoseRelative, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgPoseRelative, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.pose_relative.cov_c_x_x * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.pose_relative.cov_c_x_x, expected 2.0, is %s", last_msg.msg.pose_relative.cov_c_x_x); - - ck_assert_msg((last_msg.msg.pose_relative.cov_c_x_y * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.pose_relative.cov_c_x_y, expected 0.0, is %s", last_msg.msg.pose_relative.cov_c_x_y); - - ck_assert_msg((last_msg.msg.pose_relative.cov_c_x_z * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.pose_relative.cov_c_x_z, expected 0.0, is %s", last_msg.msg.pose_relative.cov_c_x_z); - - ck_assert_msg((last_msg.msg.pose_relative.cov_c_y_y * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.pose_relative.cov_c_y_y, expected 2.0, is %s", last_msg.msg.pose_relative.cov_c_y_y); - - ck_assert_msg((last_msg.msg.pose_relative.cov_c_y_z * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.pose_relative.cov_c_y_z, expected 0.0, is %s", last_msg.msg.pose_relative.cov_c_y_z); - - ck_assert_msg((last_msg.msg.pose_relative.cov_c_z_z * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.pose_relative.cov_c_z_z, expected 2.0, is %s", last_msg.msg.pose_relative.cov_c_z_z); - - ck_assert_msg((last_msg.msg.pose_relative.cov_r_x_x * 100 - 1.0 * 100) < 0.05, "incorrect value for last_msg.msg.pose_relative.cov_r_x_x, expected 1.0, is %s", last_msg.msg.pose_relative.cov_r_x_x); - - ck_assert_msg((last_msg.msg.pose_relative.cov_r_x_y * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.pose_relative.cov_r_x_y, expected 0.0, is %s", last_msg.msg.pose_relative.cov_r_x_y); - - ck_assert_msg((last_msg.msg.pose_relative.cov_r_x_z * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.pose_relative.cov_r_x_z, expected 0.0, is %s", last_msg.msg.pose_relative.cov_r_x_z); - - ck_assert_msg((last_msg.msg.pose_relative.cov_r_y_y * 100 - 1.0 * 100) < 0.05, "incorrect value for last_msg.msg.pose_relative.cov_r_y_y, expected 1.0, is %s", last_msg.msg.pose_relative.cov_r_y_y); - - ck_assert_msg((last_msg.msg.pose_relative.cov_r_y_z * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.pose_relative.cov_r_y_z, expected 0.0, is %s", last_msg.msg.pose_relative.cov_r_y_z); - - ck_assert_msg((last_msg.msg.pose_relative.cov_r_z_z * 100 - 1.0 * 100) < 0.05, "incorrect value for last_msg.msg.pose_relative.cov_r_z_z, expected 1.0, is %s", last_msg.msg.pose_relative.cov_r_z_z); - - ck_assert_msg(last_msg.msg.pose_relative.flags == 5, "incorrect value for last_msg.msg.pose_relative.flags, expected 5, is %d", last_msg.msg.pose_relative.flags); - - ck_assert_msg(last_msg.msg.pose_relative.sensor_id == 0, "incorrect value for last_msg.msg.pose_relative.sensor_id, expected 0, is %d", last_msg.msg.pose_relative.sensor_id); - - ck_assert_msg(last_msg.msg.pose_relative.timestamp_1 == 1110, "incorrect value for last_msg.msg.pose_relative.timestamp_1, expected 1110, is %d", last_msg.msg.pose_relative.timestamp_1); - - ck_assert_msg(last_msg.msg.pose_relative.timestamp_2 == 2220, "incorrect value for last_msg.msg.pose_relative.timestamp_2, expected 2220, is %d", last_msg.msg.pose_relative.timestamp_2); - - ck_assert_msg(last_msg.msg.pose_relative.tow == 1110, "incorrect value for last_msg.msg.pose_relative.tow, expected 1110, is %d", last_msg.msg.pose_relative.tow); - - ck_assert_msg(last_msg.msg.pose_relative.trans[0] == 1100, "incorrect value for last_msg.msg.pose_relative.trans[0], expected 1100, is %d", last_msg.msg.pose_relative.trans[0]); - ck_assert_msg(last_msg.msg.pose_relative.trans[1] == 550, "incorrect value for last_msg.msg.pose_relative.trans[1], expected 550, is %d", last_msg.msg.pose_relative.trans[1]); - ck_assert_msg(last_msg.msg.pose_relative.trans[2] == 100, "incorrect value for last_msg.msg.pose_relative.trans[2], expected 100, is %d", last_msg.msg.pose_relative.trans[2]); - - ck_assert_msg(last_msg.msg.pose_relative.w == -859307164, "incorrect value for last_msg.msg.pose_relative.w, expected -859307164, is %d", last_msg.msg.pose_relative.w); - - ck_assert_msg(last_msg.msg.pose_relative.x == -6444804, "incorrect value for last_msg.msg.pose_relative.x, expected -6444804, is %d", last_msg.msg.pose_relative.x); - - ck_assert_msg(last_msg.msg.pose_relative.y == -1866844813, "incorrect value for last_msg.msg.pose_relative.y, expected -1866844813, is %d", last_msg.msg.pose_relative.y); - - ck_assert_msg(last_msg.msg.pose_relative.z == 622997694, "incorrect value for last_msg.msg.pose_relative.z, expected 622997694, is %d", last_msg.msg.pose_relative.z); + ck_assert_msg( + (last_msg.msg.pose_relative.cov_c_x_x * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pose_relative.cov_c_x_x, expected " + "2.0, is %s", + last_msg.msg.pose_relative.cov_c_x_x); + + ck_assert_msg( + (last_msg.msg.pose_relative.cov_c_x_y * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pose_relative.cov_c_x_y, expected " + "0.0, is %s", + last_msg.msg.pose_relative.cov_c_x_y); + + ck_assert_msg( + (last_msg.msg.pose_relative.cov_c_x_z * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pose_relative.cov_c_x_z, expected " + "0.0, is %s", + last_msg.msg.pose_relative.cov_c_x_z); + + ck_assert_msg( + (last_msg.msg.pose_relative.cov_c_y_y * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pose_relative.cov_c_y_y, expected " + "2.0, is %s", + last_msg.msg.pose_relative.cov_c_y_y); + + ck_assert_msg( + (last_msg.msg.pose_relative.cov_c_y_z * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pose_relative.cov_c_y_z, expected " + "0.0, is %s", + last_msg.msg.pose_relative.cov_c_y_z); + + ck_assert_msg( + (last_msg.msg.pose_relative.cov_c_z_z * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pose_relative.cov_c_z_z, expected " + "2.0, is %s", + last_msg.msg.pose_relative.cov_c_z_z); + + ck_assert_msg( + (last_msg.msg.pose_relative.cov_r_x_x * 100 - 1.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pose_relative.cov_r_x_x, expected " + "1.0, is %s", + last_msg.msg.pose_relative.cov_r_x_x); + + ck_assert_msg( + (last_msg.msg.pose_relative.cov_r_x_y * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pose_relative.cov_r_x_y, expected " + "0.0, is %s", + last_msg.msg.pose_relative.cov_r_x_y); + + ck_assert_msg( + (last_msg.msg.pose_relative.cov_r_x_z * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pose_relative.cov_r_x_z, expected " + "0.0, is %s", + last_msg.msg.pose_relative.cov_r_x_z); + + ck_assert_msg( + (last_msg.msg.pose_relative.cov_r_y_y * 100 - 1.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pose_relative.cov_r_y_y, expected " + "1.0, is %s", + last_msg.msg.pose_relative.cov_r_y_y); + + ck_assert_msg( + (last_msg.msg.pose_relative.cov_r_y_z * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pose_relative.cov_r_y_z, expected " + "0.0, is %s", + last_msg.msg.pose_relative.cov_r_y_z); + + ck_assert_msg( + (last_msg.msg.pose_relative.cov_r_z_z * 100 - 1.0 * 100) < 0.05, + "incorrect value for last_msg.msg.pose_relative.cov_r_z_z, expected " + "1.0, is %s", + last_msg.msg.pose_relative.cov_r_z_z); + + ck_assert_msg(last_msg.msg.pose_relative.flags == 5, + "incorrect value for last_msg.msg.pose_relative.flags, " + "expected 5, is %d", + last_msg.msg.pose_relative.flags); + + ck_assert_msg(last_msg.msg.pose_relative.sensor_id == 0, + "incorrect value for last_msg.msg.pose_relative.sensor_id, " + "expected 0, is %d", + last_msg.msg.pose_relative.sensor_id); + + ck_assert_msg(last_msg.msg.pose_relative.timestamp_1 == 1110, + "incorrect value for last_msg.msg.pose_relative.timestamp_1, " + "expected 1110, is %d", + last_msg.msg.pose_relative.timestamp_1); + + ck_assert_msg(last_msg.msg.pose_relative.timestamp_2 == 2220, + "incorrect value for last_msg.msg.pose_relative.timestamp_2, " + "expected 2220, is %d", + last_msg.msg.pose_relative.timestamp_2); + + ck_assert_msg(last_msg.msg.pose_relative.tow == 1110, + "incorrect value for last_msg.msg.pose_relative.tow, " + "expected 1110, is %d", + last_msg.msg.pose_relative.tow); + + ck_assert_msg(last_msg.msg.pose_relative.trans[0] == 1100, + "incorrect value for last_msg.msg.pose_relative.trans[0], " + "expected 1100, is %d", + last_msg.msg.pose_relative.trans[0]); + ck_assert_msg(last_msg.msg.pose_relative.trans[1] == 550, + "incorrect value for last_msg.msg.pose_relative.trans[1], " + "expected 550, is %d", + last_msg.msg.pose_relative.trans[1]); + ck_assert_msg(last_msg.msg.pose_relative.trans[2] == 100, + "incorrect value for last_msg.msg.pose_relative.trans[2], " + "expected 100, is %d", + last_msg.msg.pose_relative.trans[2]); + + ck_assert_msg(last_msg.msg.pose_relative.w == -859307164, + "incorrect value for last_msg.msg.pose_relative.w, expected " + "-859307164, is %d", + last_msg.msg.pose_relative.w); + + ck_assert_msg(last_msg.msg.pose_relative.x == -6444804, + "incorrect value for last_msg.msg.pose_relative.x, expected " + "-6444804, is %d", + last_msg.msg.pose_relative.x); + + ck_assert_msg(last_msg.msg.pose_relative.y == -1866844813, + "incorrect value for last_msg.msg.pose_relative.y, expected " + "-1866844813, is %d", + last_msg.msg.pose_relative.y); + + ck_assert_msg(last_msg.msg.pose_relative.z == 622997694, + "incorrect value for last_msg.msg.pose_relative.z, expected " + "622997694, is %d", + last_msg.msg.pose_relative.z); } } END_TEST -Suite* auto_check_sbp_navigation_MsgPoseRelative_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgPoseRelative"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPoseRelative"); +Suite *auto_check_sbp_navigation_MsgPoseRelative_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgPoseRelative"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgPoseRelative"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgPoseRelative); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgProtectionLevel.c b/c/test/auto_check_sbp_navigation_MsgProtectionLevel.c index 3b82058e0..9d4541d9a 100644 --- a/c/test/auto_check_sbp_navigation_MsgProtectionLevel.c +++ b/c/test/auto_check_sbp_navigation_MsgProtectionLevel.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevel.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevel.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgProtectionLevel ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgProtectionLevel) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgProtectionLevel ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,127 +90,205 @@ START_TEST( test_auto_check_sbp_navigation_MsgProtectionLevel ) logging_reset(); - sbp_callback_register(&sbp_state, 0x217, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x217, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,23,2,45,3,76,110,84,4,242,46,51,53,160,89,84,167,41,57,21,217,244,61,161,83,104,140,137,90,246,51,51,51,51,51,170,180,64,154,153,153,153,25,88,195,64,51,51,51,51,51,195,121,64,231,251,38,221,208,183,167,80,223,26,97,164,45,46,186,60,235,227,183,160,187,93,116,224,105,40,32,33,133,188, }; + u8 encoded_frame[] = { + 85, 23, 2, 45, 3, 76, 110, 84, 4, 242, 46, 51, 53, 160, + 89, 84, 167, 41, 57, 21, 217, 244, 61, 161, 83, 104, 140, 137, + 90, 246, 51, 51, 51, 51, 51, 170, 180, 64, 154, 153, 153, 153, + 25, 88, 195, 64, 51, 51, 51, 51, 51, 195, 121, 64, 231, 251, + 38, 221, 208, 183, 167, 80, 223, 26, 97, 164, 45, 46, 186, 60, + 235, 227, 183, 160, 187, 93, 116, 224, 105, 40, 32, 33, 133, 188, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.protection_level.atpl = 10663; - + test_msg.protection_level.ctpl = 5433; - + test_msg.protection_level.flags = 555755625; - + test_msg.protection_level.heading = -529244741; - + test_msg.protection_level.height = 412.2; - + test_msg.protection_level.hopl = 26707; - + test_msg.protection_level.hpl = 41013; - + test_msg.protection_level.hvpl = 62681; - + test_msg.protection_level.lat = 5290.2; - + test_msg.protection_level.lon = 9904.2; - + test_msg.protection_level.pitch = -1598561301; - + test_msg.protection_level.popl = 35212; - + test_msg.protection_level.roll = 1018834477; - + test_msg.protection_level.ropl = 63066; - + test_msg.protection_level.tow = 4060370030; - + test_msg.protection_level.v_x = -584647705; - + test_msg.protection_level.v_y = 1353168848; - + test_msg.protection_level.v_z = -1537140001; - + test_msg.protection_level.vpl = 21593; - + test_msg.protection_level.vvpl = 41277; - + test_msg.protection_level.wn = 13102; - sbp_message_send(&sbp_state, SbpMsgProtectionLevel, 813, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgProtectionLevel, 813, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 813, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgProtectionLevel, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgProtectionLevel, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.protection_level.atpl == 10663, "incorrect value for last_msg.msg.protection_level.atpl, expected 10663, is %d", last_msg.msg.protection_level.atpl); - - ck_assert_msg(last_msg.msg.protection_level.ctpl == 5433, "incorrect value for last_msg.msg.protection_level.ctpl, expected 5433, is %d", last_msg.msg.protection_level.ctpl); - - ck_assert_msg(last_msg.msg.protection_level.flags == 555755625, "incorrect value for last_msg.msg.protection_level.flags, expected 555755625, is %d", last_msg.msg.protection_level.flags); - - ck_assert_msg(last_msg.msg.protection_level.heading == -529244741, "incorrect value for last_msg.msg.protection_level.heading, expected -529244741, is %d", last_msg.msg.protection_level.heading); - - ck_assert_msg((last_msg.msg.protection_level.height * 100 - 412.2 * 100) < 0.05, "incorrect value for last_msg.msg.protection_level.height, expected 412.2, is %s", last_msg.msg.protection_level.height); - - ck_assert_msg(last_msg.msg.protection_level.hopl == 26707, "incorrect value for last_msg.msg.protection_level.hopl, expected 26707, is %d", last_msg.msg.protection_level.hopl); - - ck_assert_msg(last_msg.msg.protection_level.hpl == 41013, "incorrect value for last_msg.msg.protection_level.hpl, expected 41013, is %d", last_msg.msg.protection_level.hpl); - - ck_assert_msg(last_msg.msg.protection_level.hvpl == 62681, "incorrect value for last_msg.msg.protection_level.hvpl, expected 62681, is %d", last_msg.msg.protection_level.hvpl); - - ck_assert_msg((last_msg.msg.protection_level.lat * 100 - 5290.2 * 100) < 0.05, "incorrect value for last_msg.msg.protection_level.lat, expected 5290.2, is %s", last_msg.msg.protection_level.lat); - - ck_assert_msg((last_msg.msg.protection_level.lon * 100 - 9904.2 * 100) < 0.05, "incorrect value for last_msg.msg.protection_level.lon, expected 9904.2, is %s", last_msg.msg.protection_level.lon); - - ck_assert_msg(last_msg.msg.protection_level.pitch == -1598561301, "incorrect value for last_msg.msg.protection_level.pitch, expected -1598561301, is %d", last_msg.msg.protection_level.pitch); - - ck_assert_msg(last_msg.msg.protection_level.popl == 35212, "incorrect value for last_msg.msg.protection_level.popl, expected 35212, is %d", last_msg.msg.protection_level.popl); - - ck_assert_msg(last_msg.msg.protection_level.roll == 1018834477, "incorrect value for last_msg.msg.protection_level.roll, expected 1018834477, is %d", last_msg.msg.protection_level.roll); - - ck_assert_msg(last_msg.msg.protection_level.ropl == 63066, "incorrect value for last_msg.msg.protection_level.ropl, expected 63066, is %d", last_msg.msg.protection_level.ropl); - - ck_assert_msg(last_msg.msg.protection_level.tow == 4060370030, "incorrect value for last_msg.msg.protection_level.tow, expected 4060370030, is %d", last_msg.msg.protection_level.tow); - - ck_assert_msg(last_msg.msg.protection_level.v_x == -584647705, "incorrect value for last_msg.msg.protection_level.v_x, expected -584647705, is %d", last_msg.msg.protection_level.v_x); - - ck_assert_msg(last_msg.msg.protection_level.v_y == 1353168848, "incorrect value for last_msg.msg.protection_level.v_y, expected 1353168848, is %d", last_msg.msg.protection_level.v_y); - - ck_assert_msg(last_msg.msg.protection_level.v_z == -1537140001, "incorrect value for last_msg.msg.protection_level.v_z, expected -1537140001, is %d", last_msg.msg.protection_level.v_z); - - ck_assert_msg(last_msg.msg.protection_level.vpl == 21593, "incorrect value for last_msg.msg.protection_level.vpl, expected 21593, is %d", last_msg.msg.protection_level.vpl); - - ck_assert_msg(last_msg.msg.protection_level.vvpl == 41277, "incorrect value for last_msg.msg.protection_level.vvpl, expected 41277, is %d", last_msg.msg.protection_level.vvpl); - - ck_assert_msg(last_msg.msg.protection_level.wn == 13102, "incorrect value for last_msg.msg.protection_level.wn, expected 13102, is %d", last_msg.msg.protection_level.wn); + ck_assert_msg(last_msg.msg.protection_level.atpl == 10663, + "incorrect value for last_msg.msg.protection_level.atpl, " + "expected 10663, is %d", + last_msg.msg.protection_level.atpl); + + ck_assert_msg(last_msg.msg.protection_level.ctpl == 5433, + "incorrect value for last_msg.msg.protection_level.ctpl, " + "expected 5433, is %d", + last_msg.msg.protection_level.ctpl); + + ck_assert_msg(last_msg.msg.protection_level.flags == 555755625, + "incorrect value for last_msg.msg.protection_level.flags, " + "expected 555755625, is %d", + last_msg.msg.protection_level.flags); + + ck_assert_msg(last_msg.msg.protection_level.heading == -529244741, + "incorrect value for last_msg.msg.protection_level.heading, " + "expected -529244741, is %d", + last_msg.msg.protection_level.heading); + + ck_assert_msg( + (last_msg.msg.protection_level.height * 100 - 412.2 * 100) < 0.05, + "incorrect value for last_msg.msg.protection_level.height, expected " + "412.2, is %s", + last_msg.msg.protection_level.height); + + ck_assert_msg(last_msg.msg.protection_level.hopl == 26707, + "incorrect value for last_msg.msg.protection_level.hopl, " + "expected 26707, is %d", + last_msg.msg.protection_level.hopl); + + ck_assert_msg(last_msg.msg.protection_level.hpl == 41013, + "incorrect value for last_msg.msg.protection_level.hpl, " + "expected 41013, is %d", + last_msg.msg.protection_level.hpl); + + ck_assert_msg(last_msg.msg.protection_level.hvpl == 62681, + "incorrect value for last_msg.msg.protection_level.hvpl, " + "expected 62681, is %d", + last_msg.msg.protection_level.hvpl); + + ck_assert_msg( + (last_msg.msg.protection_level.lat * 100 - 5290.2 * 100) < 0.05, + "incorrect value for last_msg.msg.protection_level.lat, expected " + "5290.2, is %s", + last_msg.msg.protection_level.lat); + + ck_assert_msg( + (last_msg.msg.protection_level.lon * 100 - 9904.2 * 100) < 0.05, + "incorrect value for last_msg.msg.protection_level.lon, expected " + "9904.2, is %s", + last_msg.msg.protection_level.lon); + + ck_assert_msg(last_msg.msg.protection_level.pitch == -1598561301, + "incorrect value for last_msg.msg.protection_level.pitch, " + "expected -1598561301, is %d", + last_msg.msg.protection_level.pitch); + + ck_assert_msg(last_msg.msg.protection_level.popl == 35212, + "incorrect value for last_msg.msg.protection_level.popl, " + "expected 35212, is %d", + last_msg.msg.protection_level.popl); + + ck_assert_msg(last_msg.msg.protection_level.roll == 1018834477, + "incorrect value for last_msg.msg.protection_level.roll, " + "expected 1018834477, is %d", + last_msg.msg.protection_level.roll); + + ck_assert_msg(last_msg.msg.protection_level.ropl == 63066, + "incorrect value for last_msg.msg.protection_level.ropl, " + "expected 63066, is %d", + last_msg.msg.protection_level.ropl); + + ck_assert_msg(last_msg.msg.protection_level.tow == 4060370030, + "incorrect value for last_msg.msg.protection_level.tow, " + "expected 4060370030, is %d", + last_msg.msg.protection_level.tow); + + ck_assert_msg(last_msg.msg.protection_level.v_x == -584647705, + "incorrect value for last_msg.msg.protection_level.v_x, " + "expected -584647705, is %d", + last_msg.msg.protection_level.v_x); + + ck_assert_msg(last_msg.msg.protection_level.v_y == 1353168848, + "incorrect value for last_msg.msg.protection_level.v_y, " + "expected 1353168848, is %d", + last_msg.msg.protection_level.v_y); + + ck_assert_msg(last_msg.msg.protection_level.v_z == -1537140001, + "incorrect value for last_msg.msg.protection_level.v_z, " + "expected -1537140001, is %d", + last_msg.msg.protection_level.v_z); + + ck_assert_msg(last_msg.msg.protection_level.vpl == 21593, + "incorrect value for last_msg.msg.protection_level.vpl, " + "expected 21593, is %d", + last_msg.msg.protection_level.vpl); + + ck_assert_msg(last_msg.msg.protection_level.vvpl == 41277, + "incorrect value for last_msg.msg.protection_level.vvpl, " + "expected 41277, is %d", + last_msg.msg.protection_level.vvpl); + + ck_assert_msg(last_msg.msg.protection_level.wn == 13102, + "incorrect value for last_msg.msg.protection_level.wn, " + "expected 13102, is %d", + last_msg.msg.protection_level.wn); } } END_TEST -Suite* auto_check_sbp_navigation_MsgProtectionLevel_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgProtectionLevel"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgProtectionLevel"); +Suite *auto_check_sbp_navigation_MsgProtectionLevel_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgProtectionLevel"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_navigation_MsgProtectionLevel"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgProtectionLevel); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgProtectionLevelDepA.c b/c/test/auto_check_sbp_navigation_MsgProtectionLevelDepA.c index 068aba161..3916007a7 100644 --- a/c/test/auto_check_sbp_navigation_MsgProtectionLevelDepA.c +++ b/c/test/auto_check_sbp_navigation_MsgProtectionLevelDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevelDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevelDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgProtectionLevelDepA ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgProtectionLevelDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgProtectionLevelDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,71 +90,110 @@ START_TEST( test_auto_check_sbp_navigation_MsgProtectionLevelDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x216, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x216, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,22,2,148,22,33,52,126,69,185,47,85,4,139,51,51,51,51,51,244,190,64,102,102,102,102,102,204,168,64,154,153,153,153,25,39,192,64,248,81,104, }; + u8 encoded_frame[] = { + 85, 22, 2, 148, 22, 33, 52, 126, 69, 185, 47, 85, 4, 139, + 51, 51, 51, 51, 51, 244, 190, 64, 102, 102, 102, 102, 102, 204, + 168, 64, 154, 153, 153, 153, 25, 39, 192, 64, 248, 81, 104, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.protection_level_dep_a.flags = 248; - + test_msg.protection_level_dep_a.height = 8270.2; - + test_msg.protection_level_dep_a.hpl = 35588; - + test_msg.protection_level_dep_a.lat = 7924.2; - + test_msg.protection_level_dep_a.lon = 3174.2; - + test_msg.protection_level_dep_a.tow = 3108339252; - + test_msg.protection_level_dep_a.vpl = 21807; - sbp_message_send(&sbp_state, SbpMsgProtectionLevelDepA, 5780, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgProtectionLevelDepA, 5780, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 5780, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgProtectionLevelDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.protection_level_dep_a.flags == 248, "incorrect value for last_msg.msg.protection_level_dep_a.flags, expected 248, is %d", last_msg.msg.protection_level_dep_a.flags); - - ck_assert_msg((last_msg.msg.protection_level_dep_a.height * 100 - 8270.2 * 100) < 0.05, "incorrect value for last_msg.msg.protection_level_dep_a.height, expected 8270.2, is %s", last_msg.msg.protection_level_dep_a.height); - - ck_assert_msg(last_msg.msg.protection_level_dep_a.hpl == 35588, "incorrect value for last_msg.msg.protection_level_dep_a.hpl, expected 35588, is %d", last_msg.msg.protection_level_dep_a.hpl); - - ck_assert_msg((last_msg.msg.protection_level_dep_a.lat * 100 - 7924.2 * 100) < 0.05, "incorrect value for last_msg.msg.protection_level_dep_a.lat, expected 7924.2, is %s", last_msg.msg.protection_level_dep_a.lat); - - ck_assert_msg((last_msg.msg.protection_level_dep_a.lon * 100 - 3174.2 * 100) < 0.05, "incorrect value for last_msg.msg.protection_level_dep_a.lon, expected 3174.2, is %s", last_msg.msg.protection_level_dep_a.lon); - - ck_assert_msg(last_msg.msg.protection_level_dep_a.tow == 3108339252, "incorrect value for last_msg.msg.protection_level_dep_a.tow, expected 3108339252, is %d", last_msg.msg.protection_level_dep_a.tow); - - ck_assert_msg(last_msg.msg.protection_level_dep_a.vpl == 21807, "incorrect value for last_msg.msg.protection_level_dep_a.vpl, expected 21807, is %d", last_msg.msg.protection_level_dep_a.vpl); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgProtectionLevelDepA, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.protection_level_dep_a.flags == 248, + "incorrect value for last_msg.msg.protection_level_dep_a.flags, " + "expected 248, is %d", + last_msg.msg.protection_level_dep_a.flags); + + ck_assert_msg( + (last_msg.msg.protection_level_dep_a.height * 100 - 8270.2 * 100) < + 0.05, + "incorrect value for last_msg.msg.protection_level_dep_a.height, " + "expected 8270.2, is %s", + last_msg.msg.protection_level_dep_a.height); + + ck_assert_msg( + last_msg.msg.protection_level_dep_a.hpl == 35588, + "incorrect value for last_msg.msg.protection_level_dep_a.hpl, expected " + "35588, is %d", + last_msg.msg.protection_level_dep_a.hpl); + + ck_assert_msg( + (last_msg.msg.protection_level_dep_a.lat * 100 - 7924.2 * 100) < 0.05, + "incorrect value for last_msg.msg.protection_level_dep_a.lat, expected " + "7924.2, is %s", + last_msg.msg.protection_level_dep_a.lat); + + ck_assert_msg( + (last_msg.msg.protection_level_dep_a.lon * 100 - 3174.2 * 100) < 0.05, + "incorrect value for last_msg.msg.protection_level_dep_a.lon, expected " + "3174.2, is %s", + last_msg.msg.protection_level_dep_a.lon); + + ck_assert_msg( + last_msg.msg.protection_level_dep_a.tow == 3108339252, + "incorrect value for last_msg.msg.protection_level_dep_a.tow, expected " + "3108339252, is %d", + last_msg.msg.protection_level_dep_a.tow); + + ck_assert_msg( + last_msg.msg.protection_level_dep_a.vpl == 21807, + "incorrect value for last_msg.msg.protection_level_dep_a.vpl, expected " + "21807, is %d", + last_msg.msg.protection_level_dep_a.vpl); } } END_TEST -Suite* auto_check_sbp_navigation_MsgProtectionLevelDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgProtectionLevelDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgProtectionLevelDepA"); +Suite *auto_check_sbp_navigation_MsgProtectionLevelDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_navigation_MsgProtectionLevelDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_navigation_MsgProtectionLevelDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgProtectionLevelDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgReferenceFrameParam.c b/c/test/auto_check_sbp_navigation_MsgReferenceFrameParam.c index b4325bd6b..833fd2f9d 100644 --- a/c/test/auto_check_sbp_navigation_MsgReferenceFrameParam.c +++ b/c/test/auto_check_sbp_navigation_MsgReferenceFrameParam.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgReferenceFrameParam.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgReferenceFrameParam.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgReferenceFrameParam ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgReferenceFrameParam) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgReferenceFrameParam ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,135 +90,251 @@ START_TEST( test_auto_check_sbp_navigation_MsgReferenceFrameParam ) logging_reset(); - sbp_callback_register(&sbp_state, 580, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 580, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,68,2,66,0,124,1,102,111,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,98,97,114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,0,6,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,6,161, }; + u8 encoded_frame[] = { + 85, 68, 2, 66, 0, 124, 1, 102, 111, 111, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 98, 97, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 4, 5, 0, 6, 0, 7, 0, 0, 0, 8, 0, 0, 0, 9, + 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 12, 0, 0, 0, 13, 0, + 0, 0, 14, 0, 0, 0, 15, 0, 0, 0, 16, 0, 0, 0, 17, 0, 0, + 0, 18, 0, 0, 0, 19, 0, 0, 0, 20, 0, 6, 161, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.reference_frame_param.delta_X0 = 7; - + test_msg.reference_frame_param.delta_Y0 = 8; - + test_msg.reference_frame_param.delta_Z0 = 9; - + test_msg.reference_frame_param.dot_delta_X0 = 14; - + test_msg.reference_frame_param.dot_delta_Y0 = 15; - + test_msg.reference_frame_param.dot_delta_Z0 = 16; - + test_msg.reference_frame_param.dot_scale = 20; - + test_msg.reference_frame_param.dot_theta_01 = 17; - + test_msg.reference_frame_param.dot_theta_02 = 18; - + test_msg.reference_frame_param.dot_theta_03 = 19; - + test_msg.reference_frame_param.re_t0 = 6; - + test_msg.reference_frame_param.scale = 13; - + test_msg.reference_frame_param.sin = 4; - + { - const char assign_string[] = { (char)102,(char)111,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.reference_frame_param.sn, assign_string, sizeof(assign_string)); + const char assign_string[] = { + (char)102, (char)111, (char)111, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.reference_frame_param.sn, assign_string, + sizeof(assign_string)); } - + test_msg.reference_frame_param.ssr_iod = 1; - + test_msg.reference_frame_param.theta_01 = 10; - + test_msg.reference_frame_param.theta_02 = 11; - + test_msg.reference_frame_param.theta_03 = 12; - + { - const char assign_string[] = { (char)98,(char)97,(char)114,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.reference_frame_param.tn, assign_string, sizeof(assign_string)); + const char assign_string[] = { + (char)98, (char)97, (char)114, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.reference_frame_param.tn, assign_string, + sizeof(assign_string)); } - + test_msg.reference_frame_param.utn = 5; - sbp_message_send(&sbp_state, SbpMsgReferenceFrameParam, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgReferenceFrameParam, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgReferenceFrameParam, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.reference_frame_param.delta_X0 == 7, "incorrect value for last_msg.msg.reference_frame_param.delta_X0, expected 7, is %d", last_msg.msg.reference_frame_param.delta_X0); - - ck_assert_msg(last_msg.msg.reference_frame_param.delta_Y0 == 8, "incorrect value for last_msg.msg.reference_frame_param.delta_Y0, expected 8, is %d", last_msg.msg.reference_frame_param.delta_Y0); - - ck_assert_msg(last_msg.msg.reference_frame_param.delta_Z0 == 9, "incorrect value for last_msg.msg.reference_frame_param.delta_Z0, expected 9, is %d", last_msg.msg.reference_frame_param.delta_Z0); - - ck_assert_msg(last_msg.msg.reference_frame_param.dot_delta_X0 == 14, "incorrect value for last_msg.msg.reference_frame_param.dot_delta_X0, expected 14, is %d", last_msg.msg.reference_frame_param.dot_delta_X0); - - ck_assert_msg(last_msg.msg.reference_frame_param.dot_delta_Y0 == 15, "incorrect value for last_msg.msg.reference_frame_param.dot_delta_Y0, expected 15, is %d", last_msg.msg.reference_frame_param.dot_delta_Y0); - - ck_assert_msg(last_msg.msg.reference_frame_param.dot_delta_Z0 == 16, "incorrect value for last_msg.msg.reference_frame_param.dot_delta_Z0, expected 16, is %d", last_msg.msg.reference_frame_param.dot_delta_Z0); - - ck_assert_msg(last_msg.msg.reference_frame_param.dot_scale == 20, "incorrect value for last_msg.msg.reference_frame_param.dot_scale, expected 20, is %d", last_msg.msg.reference_frame_param.dot_scale); - - ck_assert_msg(last_msg.msg.reference_frame_param.dot_theta_01 == 17, "incorrect value for last_msg.msg.reference_frame_param.dot_theta_01, expected 17, is %d", last_msg.msg.reference_frame_param.dot_theta_01); - - ck_assert_msg(last_msg.msg.reference_frame_param.dot_theta_02 == 18, "incorrect value for last_msg.msg.reference_frame_param.dot_theta_02, expected 18, is %d", last_msg.msg.reference_frame_param.dot_theta_02); - - ck_assert_msg(last_msg.msg.reference_frame_param.dot_theta_03 == 19, "incorrect value for last_msg.msg.reference_frame_param.dot_theta_03, expected 19, is %d", last_msg.msg.reference_frame_param.dot_theta_03); - - ck_assert_msg(last_msg.msg.reference_frame_param.re_t0 == 6, "incorrect value for last_msg.msg.reference_frame_param.re_t0, expected 6, is %d", last_msg.msg.reference_frame_param.re_t0); - - ck_assert_msg(last_msg.msg.reference_frame_param.scale == 13, "incorrect value for last_msg.msg.reference_frame_param.scale, expected 13, is %d", last_msg.msg.reference_frame_param.scale); - - ck_assert_msg(last_msg.msg.reference_frame_param.sin == 4, "incorrect value for last_msg.msg.reference_frame_param.sin, expected 4, is %d", last_msg.msg.reference_frame_param.sin); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgReferenceFrameParam, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.reference_frame_param.delta_X0 == 7, + "incorrect value for last_msg.msg.reference_frame_param.delta_X0, " + "expected 7, is %d", + last_msg.msg.reference_frame_param.delta_X0); + + ck_assert_msg( + last_msg.msg.reference_frame_param.delta_Y0 == 8, + "incorrect value for last_msg.msg.reference_frame_param.delta_Y0, " + "expected 8, is %d", + last_msg.msg.reference_frame_param.delta_Y0); + + ck_assert_msg( + last_msg.msg.reference_frame_param.delta_Z0 == 9, + "incorrect value for last_msg.msg.reference_frame_param.delta_Z0, " + "expected 9, is %d", + last_msg.msg.reference_frame_param.delta_Z0); + + ck_assert_msg( + last_msg.msg.reference_frame_param.dot_delta_X0 == 14, + "incorrect value for last_msg.msg.reference_frame_param.dot_delta_X0, " + "expected 14, is %d", + last_msg.msg.reference_frame_param.dot_delta_X0); + + ck_assert_msg( + last_msg.msg.reference_frame_param.dot_delta_Y0 == 15, + "incorrect value for last_msg.msg.reference_frame_param.dot_delta_Y0, " + "expected 15, is %d", + last_msg.msg.reference_frame_param.dot_delta_Y0); + + ck_assert_msg( + last_msg.msg.reference_frame_param.dot_delta_Z0 == 16, + "incorrect value for last_msg.msg.reference_frame_param.dot_delta_Z0, " + "expected 16, is %d", + last_msg.msg.reference_frame_param.dot_delta_Z0); + + ck_assert_msg( + last_msg.msg.reference_frame_param.dot_scale == 20, + "incorrect value for last_msg.msg.reference_frame_param.dot_scale, " + "expected 20, is %d", + last_msg.msg.reference_frame_param.dot_scale); + + ck_assert_msg( + last_msg.msg.reference_frame_param.dot_theta_01 == 17, + "incorrect value for last_msg.msg.reference_frame_param.dot_theta_01, " + "expected 17, is %d", + last_msg.msg.reference_frame_param.dot_theta_01); + + ck_assert_msg( + last_msg.msg.reference_frame_param.dot_theta_02 == 18, + "incorrect value for last_msg.msg.reference_frame_param.dot_theta_02, " + "expected 18, is %d", + last_msg.msg.reference_frame_param.dot_theta_02); + + ck_assert_msg( + last_msg.msg.reference_frame_param.dot_theta_03 == 19, + "incorrect value for last_msg.msg.reference_frame_param.dot_theta_03, " + "expected 19, is %d", + last_msg.msg.reference_frame_param.dot_theta_03); + + ck_assert_msg(last_msg.msg.reference_frame_param.re_t0 == 6, + "incorrect value for " + "last_msg.msg.reference_frame_param.re_t0, expected 6, is %d", + last_msg.msg.reference_frame_param.re_t0); + + ck_assert_msg( + last_msg.msg.reference_frame_param.scale == 13, + "incorrect value for last_msg.msg.reference_frame_param.scale, " + "expected 13, is %d", + last_msg.msg.reference_frame_param.scale); + + ck_assert_msg(last_msg.msg.reference_frame_param.sin == 4, + "incorrect value for last_msg.msg.reference_frame_param.sin, " + "expected 4, is %d", + last_msg.msg.reference_frame_param.sin); + { - const char check_string[] = { (char)102,(char)111,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.reference_frame_param.sn, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.reference_frame_param.sn, expected string '%s', is '%s'", check_string, last_msg.msg.reference_frame_param.sn); + const char check_string[] = { + (char)102, (char)111, (char)111, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(&last_msg.msg.reference_frame_param.sn, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.reference_frame_param.sn, expected " + "string '%s', is '%s'", + check_string, last_msg.msg.reference_frame_param.sn); } - - ck_assert_msg(last_msg.msg.reference_frame_param.ssr_iod == 1, "incorrect value for last_msg.msg.reference_frame_param.ssr_iod, expected 1, is %d", last_msg.msg.reference_frame_param.ssr_iod); - - ck_assert_msg(last_msg.msg.reference_frame_param.theta_01 == 10, "incorrect value for last_msg.msg.reference_frame_param.theta_01, expected 10, is %d", last_msg.msg.reference_frame_param.theta_01); - - ck_assert_msg(last_msg.msg.reference_frame_param.theta_02 == 11, "incorrect value for last_msg.msg.reference_frame_param.theta_02, expected 11, is %d", last_msg.msg.reference_frame_param.theta_02); - - ck_assert_msg(last_msg.msg.reference_frame_param.theta_03 == 12, "incorrect value for last_msg.msg.reference_frame_param.theta_03, expected 12, is %d", last_msg.msg.reference_frame_param.theta_03); - + + ck_assert_msg( + last_msg.msg.reference_frame_param.ssr_iod == 1, + "incorrect value for last_msg.msg.reference_frame_param.ssr_iod, " + "expected 1, is %d", + last_msg.msg.reference_frame_param.ssr_iod); + + ck_assert_msg( + last_msg.msg.reference_frame_param.theta_01 == 10, + "incorrect value for last_msg.msg.reference_frame_param.theta_01, " + "expected 10, is %d", + last_msg.msg.reference_frame_param.theta_01); + + ck_assert_msg( + last_msg.msg.reference_frame_param.theta_02 == 11, + "incorrect value for last_msg.msg.reference_frame_param.theta_02, " + "expected 11, is %d", + last_msg.msg.reference_frame_param.theta_02); + + ck_assert_msg( + last_msg.msg.reference_frame_param.theta_03 == 12, + "incorrect value for last_msg.msg.reference_frame_param.theta_03, " + "expected 12, is %d", + last_msg.msg.reference_frame_param.theta_03); + { - const char check_string[] = { (char)98,(char)97,(char)114,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.reference_frame_param.tn, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.reference_frame_param.tn, expected string '%s', is '%s'", check_string, last_msg.msg.reference_frame_param.tn); + const char check_string[] = { + (char)98, (char)97, (char)114, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(&last_msg.msg.reference_frame_param.tn, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.reference_frame_param.tn, expected " + "string '%s', is '%s'", + check_string, last_msg.msg.reference_frame_param.tn); } - - ck_assert_msg(last_msg.msg.reference_frame_param.utn == 5, "incorrect value for last_msg.msg.reference_frame_param.utn, expected 5, is %d", last_msg.msg.reference_frame_param.utn); + ck_assert_msg(last_msg.msg.reference_frame_param.utn == 5, + "incorrect value for last_msg.msg.reference_frame_param.utn, " + "expected 5, is %d", + last_msg.msg.reference_frame_param.utn); } } END_TEST -Suite* auto_check_sbp_navigation_MsgReferenceFrameParam_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgReferenceFrameParam"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgReferenceFrameParam"); +Suite *auto_check_sbp_navigation_MsgReferenceFrameParam_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_navigation_MsgReferenceFrameParam"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_navigation_MsgReferenceFrameParam"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgReferenceFrameParam); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgUTCLeapSecond.c b/c/test/auto_check_sbp_navigation_MsgUTCLeapSecond.c index f8fde7fdc..1c0d26f56 100644 --- a/c/test/auto_check_sbp_navigation_MsgUTCLeapSecond.c +++ b/c/test/auto_check_sbp_navigation_MsgUTCLeapSecond.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCLeapSecond.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCLeapSecond.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgUTCLeapSecond ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgUTCLeapSecond) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgUTCLeapSecond ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,79 +90,114 @@ START_TEST( test_auto_check_sbp_navigation_MsgUTCLeapSecond ) logging_reset(); - sbp_callback_register(&sbp_state, 570, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 570, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,58,2,66,0,14,1,0,2,0,3,4,5,0,6,0,7,0,8,9,50,232, }; + u8 encoded_frame[] = { + 85, 58, 2, 66, 0, 14, 1, 0, 2, 0, 3, 4, 5, 0, 6, 0, 7, 0, 8, 9, 50, 232, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.utc_leap_second.count_after = 9; - + test_msg.utc_leap_second.count_before = 4; - + test_msg.utc_leap_second.ref_dn = 8; - + test_msg.utc_leap_second.ref_wn = 7; - + test_msg.utc_leap_second.reserved_0 = 1; - + test_msg.utc_leap_second.reserved_1 = 2; - + test_msg.utc_leap_second.reserved_2 = 3; - + test_msg.utc_leap_second.reserved_3 = 5; - + test_msg.utc_leap_second.reserved_4 = 6; - sbp_message_send(&sbp_state, SbpMsgUtcLeapSecond, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgUtcLeapSecond, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgUtcLeapSecond, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgUtcLeapSecond, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.utc_leap_second.count_after == 9, "incorrect value for last_msg.msg.utc_leap_second.count_after, expected 9, is %d", last_msg.msg.utc_leap_second.count_after); - - ck_assert_msg(last_msg.msg.utc_leap_second.count_before == 4, "incorrect value for last_msg.msg.utc_leap_second.count_before, expected 4, is %d", last_msg.msg.utc_leap_second.count_before); - - ck_assert_msg(last_msg.msg.utc_leap_second.ref_dn == 8, "incorrect value for last_msg.msg.utc_leap_second.ref_dn, expected 8, is %d", last_msg.msg.utc_leap_second.ref_dn); - - ck_assert_msg(last_msg.msg.utc_leap_second.ref_wn == 7, "incorrect value for last_msg.msg.utc_leap_second.ref_wn, expected 7, is %d", last_msg.msg.utc_leap_second.ref_wn); - - ck_assert_msg(last_msg.msg.utc_leap_second.reserved_0 == 1, "incorrect value for last_msg.msg.utc_leap_second.reserved_0, expected 1, is %d", last_msg.msg.utc_leap_second.reserved_0); - - ck_assert_msg(last_msg.msg.utc_leap_second.reserved_1 == 2, "incorrect value for last_msg.msg.utc_leap_second.reserved_1, expected 2, is %d", last_msg.msg.utc_leap_second.reserved_1); - - ck_assert_msg(last_msg.msg.utc_leap_second.reserved_2 == 3, "incorrect value for last_msg.msg.utc_leap_second.reserved_2, expected 3, is %d", last_msg.msg.utc_leap_second.reserved_2); - - ck_assert_msg(last_msg.msg.utc_leap_second.reserved_3 == 5, "incorrect value for last_msg.msg.utc_leap_second.reserved_3, expected 5, is %d", last_msg.msg.utc_leap_second.reserved_3); - - ck_assert_msg(last_msg.msg.utc_leap_second.reserved_4 == 6, "incorrect value for last_msg.msg.utc_leap_second.reserved_4, expected 6, is %d", last_msg.msg.utc_leap_second.reserved_4); + ck_assert_msg(last_msg.msg.utc_leap_second.count_after == 9, + "incorrect value for " + "last_msg.msg.utc_leap_second.count_after, expected 9, is %d", + last_msg.msg.utc_leap_second.count_after); + + ck_assert_msg( + last_msg.msg.utc_leap_second.count_before == 4, + "incorrect value for last_msg.msg.utc_leap_second.count_before, " + "expected 4, is %d", + last_msg.msg.utc_leap_second.count_before); + + ck_assert_msg(last_msg.msg.utc_leap_second.ref_dn == 8, + "incorrect value for last_msg.msg.utc_leap_second.ref_dn, " + "expected 8, is %d", + last_msg.msg.utc_leap_second.ref_dn); + + ck_assert_msg(last_msg.msg.utc_leap_second.ref_wn == 7, + "incorrect value for last_msg.msg.utc_leap_second.ref_wn, " + "expected 7, is %d", + last_msg.msg.utc_leap_second.ref_wn); + + ck_assert_msg(last_msg.msg.utc_leap_second.reserved_0 == 1, + "incorrect value for " + "last_msg.msg.utc_leap_second.reserved_0, expected 1, is %d", + last_msg.msg.utc_leap_second.reserved_0); + + ck_assert_msg(last_msg.msg.utc_leap_second.reserved_1 == 2, + "incorrect value for " + "last_msg.msg.utc_leap_second.reserved_1, expected 2, is %d", + last_msg.msg.utc_leap_second.reserved_1); + + ck_assert_msg(last_msg.msg.utc_leap_second.reserved_2 == 3, + "incorrect value for " + "last_msg.msg.utc_leap_second.reserved_2, expected 3, is %d", + last_msg.msg.utc_leap_second.reserved_2); + + ck_assert_msg(last_msg.msg.utc_leap_second.reserved_3 == 5, + "incorrect value for " + "last_msg.msg.utc_leap_second.reserved_3, expected 5, is %d", + last_msg.msg.utc_leap_second.reserved_3); + + ck_assert_msg(last_msg.msg.utc_leap_second.reserved_4 == 6, + "incorrect value for " + "last_msg.msg.utc_leap_second.reserved_4, expected 6, is %d", + last_msg.msg.utc_leap_second.reserved_4); } } END_TEST -Suite* auto_check_sbp_navigation_MsgUTCLeapSecond_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgUTCLeapSecond"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgUTCLeapSecond"); +Suite *auto_check_sbp_navigation_MsgUTCLeapSecond_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgUTCLeapSecond"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_navigation_MsgUTCLeapSecond"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgUTCLeapSecond); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgUTCTime.c b/c/test/auto_check_sbp_navigation_MsgUTCTime.c index 435eb53d1..34969f57d 100644 --- a/c/test/auto_check_sbp_navigation_MsgUTCTime.c +++ b/c/test/auto_check_sbp_navigation_MsgUTCTime.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTime.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgUTCTime ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgUTCTime) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgUTCTime ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,79 +90,112 @@ START_TEST( test_auto_check_sbp_navigation_MsgUTCTime ) logging_reset(); - sbp_callback_register(&sbp_state, 0x103, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x103, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,1,21,3,16,1,24,229,233,29,229,7,4,9,19,24,9,0,8,175,47,199,253, }; + u8 encoded_frame[] = { + 85, 3, 1, 21, 3, 16, 1, 24, 229, 233, 29, 229, + 7, 4, 9, 19, 24, 9, 0, 8, 175, 47, 199, 253, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.utc_time.day = 9; - + test_msg.utc_time.flags = 1; - + test_msg.utc_time.hours = 19; - + test_msg.utc_time.minutes = 24; - + test_msg.utc_time.month = 4; - + test_msg.utc_time.ns = 800000000; - + test_msg.utc_time.seconds = 9; - + test_msg.utc_time.tow = 501867800; - + test_msg.utc_time.year = 2021; sbp_message_send(&sbp_state, SbpMsgUtcTime, 789, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 789, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgUtcTime, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.utc_time.day == 9, "incorrect value for last_msg.msg.utc_time.day, expected 9, is %d", last_msg.msg.utc_time.day); - - ck_assert_msg(last_msg.msg.utc_time.flags == 1, "incorrect value for last_msg.msg.utc_time.flags, expected 1, is %d", last_msg.msg.utc_time.flags); - - ck_assert_msg(last_msg.msg.utc_time.hours == 19, "incorrect value for last_msg.msg.utc_time.hours, expected 19, is %d", last_msg.msg.utc_time.hours); - - ck_assert_msg(last_msg.msg.utc_time.minutes == 24, "incorrect value for last_msg.msg.utc_time.minutes, expected 24, is %d", last_msg.msg.utc_time.minutes); - - ck_assert_msg(last_msg.msg.utc_time.month == 4, "incorrect value for last_msg.msg.utc_time.month, expected 4, is %d", last_msg.msg.utc_time.month); - - ck_assert_msg(last_msg.msg.utc_time.ns == 800000000, "incorrect value for last_msg.msg.utc_time.ns, expected 800000000, is %d", last_msg.msg.utc_time.ns); - - ck_assert_msg(last_msg.msg.utc_time.seconds == 9, "incorrect value for last_msg.msg.utc_time.seconds, expected 9, is %d", last_msg.msg.utc_time.seconds); - - ck_assert_msg(last_msg.msg.utc_time.tow == 501867800, "incorrect value for last_msg.msg.utc_time.tow, expected 501867800, is %d", last_msg.msg.utc_time.tow); - - ck_assert_msg(last_msg.msg.utc_time.year == 2021, "incorrect value for last_msg.msg.utc_time.year, expected 2021, is %d", last_msg.msg.utc_time.year); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.utc_time.day == 9, + "incorrect value for last_msg.msg.utc_time.day, expected 9, is %d", + last_msg.msg.utc_time.day); + + ck_assert_msg( + last_msg.msg.utc_time.flags == 1, + "incorrect value for last_msg.msg.utc_time.flags, expected 1, is %d", + last_msg.msg.utc_time.flags); + + ck_assert_msg( + last_msg.msg.utc_time.hours == 19, + "incorrect value for last_msg.msg.utc_time.hours, expected 19, is %d", + last_msg.msg.utc_time.hours); + + ck_assert_msg( + last_msg.msg.utc_time.minutes == 24, + "incorrect value for last_msg.msg.utc_time.minutes, expected 24, is %d", + last_msg.msg.utc_time.minutes); + + ck_assert_msg( + last_msg.msg.utc_time.month == 4, + "incorrect value for last_msg.msg.utc_time.month, expected 4, is %d", + last_msg.msg.utc_time.month); + + ck_assert_msg(last_msg.msg.utc_time.ns == 800000000, + "incorrect value for last_msg.msg.utc_time.ns, expected " + "800000000, is %d", + last_msg.msg.utc_time.ns); + + ck_assert_msg( + last_msg.msg.utc_time.seconds == 9, + "incorrect value for last_msg.msg.utc_time.seconds, expected 9, is %d", + last_msg.msg.utc_time.seconds); + + ck_assert_msg(last_msg.msg.utc_time.tow == 501867800, + "incorrect value for last_msg.msg.utc_time.tow, expected " + "501867800, is %d", + last_msg.msg.utc_time.tow); + + ck_assert_msg( + last_msg.msg.utc_time.year == 2021, + "incorrect value for last_msg.msg.utc_time.year, expected 2021, is %d", + last_msg.msg.utc_time.year); } } END_TEST -Suite* auto_check_sbp_navigation_MsgUTCTime_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgUTCTime"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgUTCTime"); +Suite *auto_check_sbp_navigation_MsgUTCTime_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgUTCTime"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgUTCTime"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgUTCTime); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgUTCTimeGNSS.c b/c/test/auto_check_sbp_navigation_MsgUTCTimeGNSS.c index d0bbb0b1e..9be63e2aa 100644 --- a/c/test/auto_check_sbp_navigation_MsgUTCTimeGNSS.c +++ b/c/test/auto_check_sbp_navigation_MsgUTCTimeGNSS.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTimeGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTimeGNSS.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgUTCTimeGNSS ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgUTCTimeGNSS) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgUTCTimeGNSS ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,79 +90,114 @@ START_TEST( test_auto_check_sbp_navigation_MsgUTCTimeGNSS ) logging_reset(); - sbp_callback_register(&sbp_state, 0x105, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x105, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,1,21,3,16,1,24,229,233,29,229,7,4,9,19,24,9,0,8,175,47,177,33, }; + u8 encoded_frame[] = { + 85, 5, 1, 21, 3, 16, 1, 24, 229, 233, 29, 229, + 7, 4, 9, 19, 24, 9, 0, 8, 175, 47, 177, 33, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.utc_time_gnss.day = 9; - + test_msg.utc_time_gnss.flags = 1; - + test_msg.utc_time_gnss.hours = 19; - + test_msg.utc_time_gnss.minutes = 24; - + test_msg.utc_time_gnss.month = 4; - + test_msg.utc_time_gnss.ns = 800000000; - + test_msg.utc_time_gnss.seconds = 9; - + test_msg.utc_time_gnss.tow = 501867800; - + test_msg.utc_time_gnss.year = 2021; - sbp_message_send(&sbp_state, SbpMsgUtcTimeGnss, 789, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgUtcTimeGnss, 789, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 789, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgUtcTimeGnss, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgUtcTimeGnss, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.utc_time_gnss.day == 9, "incorrect value for last_msg.msg.utc_time_gnss.day, expected 9, is %d", last_msg.msg.utc_time_gnss.day); - - ck_assert_msg(last_msg.msg.utc_time_gnss.flags == 1, "incorrect value for last_msg.msg.utc_time_gnss.flags, expected 1, is %d", last_msg.msg.utc_time_gnss.flags); - - ck_assert_msg(last_msg.msg.utc_time_gnss.hours == 19, "incorrect value for last_msg.msg.utc_time_gnss.hours, expected 19, is %d", last_msg.msg.utc_time_gnss.hours); - - ck_assert_msg(last_msg.msg.utc_time_gnss.minutes == 24, "incorrect value for last_msg.msg.utc_time_gnss.minutes, expected 24, is %d", last_msg.msg.utc_time_gnss.minutes); - - ck_assert_msg(last_msg.msg.utc_time_gnss.month == 4, "incorrect value for last_msg.msg.utc_time_gnss.month, expected 4, is %d", last_msg.msg.utc_time_gnss.month); - - ck_assert_msg(last_msg.msg.utc_time_gnss.ns == 800000000, "incorrect value for last_msg.msg.utc_time_gnss.ns, expected 800000000, is %d", last_msg.msg.utc_time_gnss.ns); - - ck_assert_msg(last_msg.msg.utc_time_gnss.seconds == 9, "incorrect value for last_msg.msg.utc_time_gnss.seconds, expected 9, is %d", last_msg.msg.utc_time_gnss.seconds); - - ck_assert_msg(last_msg.msg.utc_time_gnss.tow == 501867800, "incorrect value for last_msg.msg.utc_time_gnss.tow, expected 501867800, is %d", last_msg.msg.utc_time_gnss.tow); - - ck_assert_msg(last_msg.msg.utc_time_gnss.year == 2021, "incorrect value for last_msg.msg.utc_time_gnss.year, expected 2021, is %d", last_msg.msg.utc_time_gnss.year); + ck_assert_msg( + last_msg.msg.utc_time_gnss.day == 9, + "incorrect value for last_msg.msg.utc_time_gnss.day, expected 9, is %d", + last_msg.msg.utc_time_gnss.day); + + ck_assert_msg(last_msg.msg.utc_time_gnss.flags == 1, + "incorrect value for last_msg.msg.utc_time_gnss.flags, " + "expected 1, is %d", + last_msg.msg.utc_time_gnss.flags); + + ck_assert_msg(last_msg.msg.utc_time_gnss.hours == 19, + "incorrect value for last_msg.msg.utc_time_gnss.hours, " + "expected 19, is %d", + last_msg.msg.utc_time_gnss.hours); + + ck_assert_msg(last_msg.msg.utc_time_gnss.minutes == 24, + "incorrect value for last_msg.msg.utc_time_gnss.minutes, " + "expected 24, is %d", + last_msg.msg.utc_time_gnss.minutes); + + ck_assert_msg(last_msg.msg.utc_time_gnss.month == 4, + "incorrect value for last_msg.msg.utc_time_gnss.month, " + "expected 4, is %d", + last_msg.msg.utc_time_gnss.month); + + ck_assert_msg(last_msg.msg.utc_time_gnss.ns == 800000000, + "incorrect value for last_msg.msg.utc_time_gnss.ns, expected " + "800000000, is %d", + last_msg.msg.utc_time_gnss.ns); + + ck_assert_msg(last_msg.msg.utc_time_gnss.seconds == 9, + "incorrect value for last_msg.msg.utc_time_gnss.seconds, " + "expected 9, is %d", + last_msg.msg.utc_time_gnss.seconds); + + ck_assert_msg(last_msg.msg.utc_time_gnss.tow == 501867800, + "incorrect value for last_msg.msg.utc_time_gnss.tow, " + "expected 501867800, is %d", + last_msg.msg.utc_time_gnss.tow); + + ck_assert_msg(last_msg.msg.utc_time_gnss.year == 2021, + "incorrect value for last_msg.msg.utc_time_gnss.year, " + "expected 2021, is %d", + last_msg.msg.utc_time_gnss.year); } } END_TEST -Suite* auto_check_sbp_navigation_MsgUTCTimeGNSS_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgUTCTimeGNSS"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgUTCTimeGNSS"); +Suite *auto_check_sbp_navigation_MsgUTCTimeGNSS_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgUTCTimeGNSS"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgUTCTimeGNSS"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgUTCTimeGNSS); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgVelBody.c b/c/test/auto_check_sbp_navigation_MsgVelBody.c index b758dcccb..079645a54 100644 --- a/c/test/auto_check_sbp_navigation_MsgVelBody.c +++ b/c/test/auto_check_sbp_navigation_MsgVelBody.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelBody.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelBody.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgVelBody ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgVelBody) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelBody ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,91 +90,134 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelBody ) logging_reset(); - sbp_callback_register(&sbp_state, 0x213, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x213, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,19,2,66,0,42,1,0,0,0,4,0,0,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,160,64,0,0,224,64,0,0,224,64,0,0,64,64,0,0,0,64,3,8,120,144, }; + u8 encoded_frame[] = { + 85, 19, 2, 66, 0, 42, 1, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 224, 64, + 0, 0, 224, 64, 0, 0, 64, 64, 0, 0, 0, 64, 3, 8, 120, 144, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_body.cov_x_x = 0.0; - + test_msg.vel_body.cov_x_y = 5.0; - + test_msg.vel_body.cov_x_z = 7.0; - + test_msg.vel_body.cov_y_y = 7.0; - + test_msg.vel_body.cov_y_z = 3.0; - + test_msg.vel_body.cov_z_z = 2.0; - + test_msg.vel_body.flags = 8; - + test_msg.vel_body.n_sats = 3; - + test_msg.vel_body.tow = 1; - + test_msg.vel_body.x = 4; - + test_msg.vel_body.y = 2; - + test_msg.vel_body.z = 1; sbp_message_send(&sbp_state, SbpMsgVelBody, 66, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgVelBody, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.vel_body.cov_x_x * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_body.cov_x_x, expected 0.0, is %s", last_msg.msg.vel_body.cov_x_x); - - ck_assert_msg((last_msg.msg.vel_body.cov_x_y * 100 - 5.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_body.cov_x_y, expected 5.0, is %s", last_msg.msg.vel_body.cov_x_y); - - ck_assert_msg((last_msg.msg.vel_body.cov_x_z * 100 - 7.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_body.cov_x_z, expected 7.0, is %s", last_msg.msg.vel_body.cov_x_z); - - ck_assert_msg((last_msg.msg.vel_body.cov_y_y * 100 - 7.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_body.cov_y_y, expected 7.0, is %s", last_msg.msg.vel_body.cov_y_y); - - ck_assert_msg((last_msg.msg.vel_body.cov_y_z * 100 - 3.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_body.cov_y_z, expected 3.0, is %s", last_msg.msg.vel_body.cov_y_z); - - ck_assert_msg((last_msg.msg.vel_body.cov_z_z * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_body.cov_z_z, expected 2.0, is %s", last_msg.msg.vel_body.cov_z_z); - - ck_assert_msg(last_msg.msg.vel_body.flags == 8, "incorrect value for last_msg.msg.vel_body.flags, expected 8, is %d", last_msg.msg.vel_body.flags); - - ck_assert_msg(last_msg.msg.vel_body.n_sats == 3, "incorrect value for last_msg.msg.vel_body.n_sats, expected 3, is %d", last_msg.msg.vel_body.n_sats); - - ck_assert_msg(last_msg.msg.vel_body.tow == 1, "incorrect value for last_msg.msg.vel_body.tow, expected 1, is %d", last_msg.msg.vel_body.tow); - - ck_assert_msg(last_msg.msg.vel_body.x == 4, "incorrect value for last_msg.msg.vel_body.x, expected 4, is %d", last_msg.msg.vel_body.x); - - ck_assert_msg(last_msg.msg.vel_body.y == 2, "incorrect value for last_msg.msg.vel_body.y, expected 2, is %d", last_msg.msg.vel_body.y); - - ck_assert_msg(last_msg.msg.vel_body.z == 1, "incorrect value for last_msg.msg.vel_body.z, expected 1, is %d", last_msg.msg.vel_body.z); - + "Sent and received messages did not compare equal"); + + ck_assert_msg((last_msg.msg.vel_body.cov_x_x * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_body.cov_x_x, expected " + "0.0, is %s", + last_msg.msg.vel_body.cov_x_x); + + ck_assert_msg((last_msg.msg.vel_body.cov_x_y * 100 - 5.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_body.cov_x_y, expected " + "5.0, is %s", + last_msg.msg.vel_body.cov_x_y); + + ck_assert_msg((last_msg.msg.vel_body.cov_x_z * 100 - 7.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_body.cov_x_z, expected " + "7.0, is %s", + last_msg.msg.vel_body.cov_x_z); + + ck_assert_msg((last_msg.msg.vel_body.cov_y_y * 100 - 7.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_body.cov_y_y, expected " + "7.0, is %s", + last_msg.msg.vel_body.cov_y_y); + + ck_assert_msg((last_msg.msg.vel_body.cov_y_z * 100 - 3.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_body.cov_y_z, expected " + "3.0, is %s", + last_msg.msg.vel_body.cov_y_z); + + ck_assert_msg((last_msg.msg.vel_body.cov_z_z * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_body.cov_z_z, expected " + "2.0, is %s", + last_msg.msg.vel_body.cov_z_z); + + ck_assert_msg( + last_msg.msg.vel_body.flags == 8, + "incorrect value for last_msg.msg.vel_body.flags, expected 8, is %d", + last_msg.msg.vel_body.flags); + + ck_assert_msg( + last_msg.msg.vel_body.n_sats == 3, + "incorrect value for last_msg.msg.vel_body.n_sats, expected 3, is %d", + last_msg.msg.vel_body.n_sats); + + ck_assert_msg( + last_msg.msg.vel_body.tow == 1, + "incorrect value for last_msg.msg.vel_body.tow, expected 1, is %d", + last_msg.msg.vel_body.tow); + + ck_assert_msg( + last_msg.msg.vel_body.x == 4, + "incorrect value for last_msg.msg.vel_body.x, expected 4, is %d", + last_msg.msg.vel_body.x); + + ck_assert_msg( + last_msg.msg.vel_body.y == 2, + "incorrect value for last_msg.msg.vel_body.y, expected 2, is %d", + last_msg.msg.vel_body.y); + + ck_assert_msg( + last_msg.msg.vel_body.z == 1, + "incorrect value for last_msg.msg.vel_body.z, expected 1, is %d", + last_msg.msg.vel_body.z); } } END_TEST -Suite* auto_check_sbp_navigation_MsgVelBody_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgVelBody"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelBody"); +Suite *auto_check_sbp_navigation_MsgVelBody_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgVelBody"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelBody"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgVelBody); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgVelCog.c b/c/test/auto_check_sbp_navigation_MsgVelCog.c index 518f4b729..486b2c1c4 100644 --- a/c/test/auto_check_sbp_navigation_MsgVelCog.c +++ b/c/test/auto_check_sbp_navigation_MsgVelCog.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelCog.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelCog.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgVelCog ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgVelCog) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelCog ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,72 +90,103 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelCog ) logging_reset(); - sbp_callback_register(&sbp_state, 0x21C, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x21C, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,28,2,211,136,30,48,246,122,19,232,3,0,0,208,7,0,0,184,11,0,0,160,15,0,0,136,19,0,0,112,23,0,0,62,0,212,193, }; + u8 encoded_frame[] = { + 85, 28, 2, 211, 136, 30, 48, 246, 122, 19, 232, 3, 0, + 0, 208, 7, 0, 0, 184, 11, 0, 0, 160, 15, 0, 0, + 136, 19, 0, 0, 112, 23, 0, 0, 62, 0, 212, 193, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_cog.cog = 1000; - + test_msg.vel_cog.cog_accuracy = 4000; - + test_msg.vel_cog.flags = 62; - + test_msg.vel_cog.sog = 2000; - + test_msg.vel_cog.sog_accuracy = 5000; - + test_msg.vel_cog.tow = 326825520; - + test_msg.vel_cog.v_up = 3000; - + test_msg.vel_cog.v_up_accuracy = 6000; sbp_message_send(&sbp_state, SbpMsgVelCog, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgVelCog, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_cog.cog == 1000, "incorrect value for last_msg.msg.vel_cog.cog, expected 1000, is %d", last_msg.msg.vel_cog.cog); - - ck_assert_msg(last_msg.msg.vel_cog.cog_accuracy == 4000, "incorrect value for last_msg.msg.vel_cog.cog_accuracy, expected 4000, is %d", last_msg.msg.vel_cog.cog_accuracy); - - ck_assert_msg(last_msg.msg.vel_cog.flags == 62, "incorrect value for last_msg.msg.vel_cog.flags, expected 62, is %d", last_msg.msg.vel_cog.flags); - - ck_assert_msg(last_msg.msg.vel_cog.sog == 2000, "incorrect value for last_msg.msg.vel_cog.sog, expected 2000, is %d", last_msg.msg.vel_cog.sog); - - ck_assert_msg(last_msg.msg.vel_cog.sog_accuracy == 5000, "incorrect value for last_msg.msg.vel_cog.sog_accuracy, expected 5000, is %d", last_msg.msg.vel_cog.sog_accuracy); - - ck_assert_msg(last_msg.msg.vel_cog.tow == 326825520, "incorrect value for last_msg.msg.vel_cog.tow, expected 326825520, is %d", last_msg.msg.vel_cog.tow); - - ck_assert_msg(last_msg.msg.vel_cog.v_up == 3000, "incorrect value for last_msg.msg.vel_cog.v_up, expected 3000, is %d", last_msg.msg.vel_cog.v_up); - - ck_assert_msg(last_msg.msg.vel_cog.v_up_accuracy == 6000, "incorrect value for last_msg.msg.vel_cog.v_up_accuracy, expected 6000, is %d", last_msg.msg.vel_cog.v_up_accuracy); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.vel_cog.cog == 1000, + "incorrect value for last_msg.msg.vel_cog.cog, expected 1000, is %d", + last_msg.msg.vel_cog.cog); + + ck_assert_msg(last_msg.msg.vel_cog.cog_accuracy == 4000, + "incorrect value for last_msg.msg.vel_cog.cog_accuracy, " + "expected 4000, is %d", + last_msg.msg.vel_cog.cog_accuracy); + + ck_assert_msg( + last_msg.msg.vel_cog.flags == 62, + "incorrect value for last_msg.msg.vel_cog.flags, expected 62, is %d", + last_msg.msg.vel_cog.flags); + + ck_assert_msg( + last_msg.msg.vel_cog.sog == 2000, + "incorrect value for last_msg.msg.vel_cog.sog, expected 2000, is %d", + last_msg.msg.vel_cog.sog); + + ck_assert_msg(last_msg.msg.vel_cog.sog_accuracy == 5000, + "incorrect value for last_msg.msg.vel_cog.sog_accuracy, " + "expected 5000, is %d", + last_msg.msg.vel_cog.sog_accuracy); + + ck_assert_msg(last_msg.msg.vel_cog.tow == 326825520, + "incorrect value for last_msg.msg.vel_cog.tow, expected " + "326825520, is %d", + last_msg.msg.vel_cog.tow); + + ck_assert_msg( + last_msg.msg.vel_cog.v_up == 3000, + "incorrect value for last_msg.msg.vel_cog.v_up, expected 3000, is %d", + last_msg.msg.vel_cog.v_up); + + ck_assert_msg(last_msg.msg.vel_cog.v_up_accuracy == 6000, + "incorrect value for last_msg.msg.vel_cog.v_up_accuracy, " + "expected 6000, is %d", + last_msg.msg.vel_cog.v_up_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -167,72 +194,103 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelCog ) logging_reset(); - sbp_callback_register(&sbp_state, 0x21C, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x21C, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,28,2,211,136,30,48,246,122,19,123,0,0,0,200,1,0,0,24,252,255,255,0,149,186,10,100,0,0,0,100,0,0,0,0,0,90,114, }; + u8 encoded_frame[] = { + 85, 28, 2, 211, 136, 30, 48, 246, 122, 19, 123, 0, 0, + 0, 200, 1, 0, 0, 24, 252, 255, 255, 0, 149, 186, 10, + 100, 0, 0, 0, 100, 0, 0, 0, 0, 0, 90, 114, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_cog.cog = 123; - + test_msg.vel_cog.cog_accuracy = 180000000; - + test_msg.vel_cog.flags = 0; - + test_msg.vel_cog.sog = 456; - + test_msg.vel_cog.sog_accuracy = 100; - + test_msg.vel_cog.tow = 326825520; - + test_msg.vel_cog.v_up = -1000; - + test_msg.vel_cog.v_up_accuracy = 100; sbp_message_send(&sbp_state, SbpMsgVelCog, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgVelCog, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_cog.cog == 123, "incorrect value for last_msg.msg.vel_cog.cog, expected 123, is %d", last_msg.msg.vel_cog.cog); - - ck_assert_msg(last_msg.msg.vel_cog.cog_accuracy == 180000000, "incorrect value for last_msg.msg.vel_cog.cog_accuracy, expected 180000000, is %d", last_msg.msg.vel_cog.cog_accuracy); - - ck_assert_msg(last_msg.msg.vel_cog.flags == 0, "incorrect value for last_msg.msg.vel_cog.flags, expected 0, is %d", last_msg.msg.vel_cog.flags); - - ck_assert_msg(last_msg.msg.vel_cog.sog == 456, "incorrect value for last_msg.msg.vel_cog.sog, expected 456, is %d", last_msg.msg.vel_cog.sog); - - ck_assert_msg(last_msg.msg.vel_cog.sog_accuracy == 100, "incorrect value for last_msg.msg.vel_cog.sog_accuracy, expected 100, is %d", last_msg.msg.vel_cog.sog_accuracy); - - ck_assert_msg(last_msg.msg.vel_cog.tow == 326825520, "incorrect value for last_msg.msg.vel_cog.tow, expected 326825520, is %d", last_msg.msg.vel_cog.tow); - - ck_assert_msg(last_msg.msg.vel_cog.v_up == -1000, "incorrect value for last_msg.msg.vel_cog.v_up, expected -1000, is %d", last_msg.msg.vel_cog.v_up); - - ck_assert_msg(last_msg.msg.vel_cog.v_up_accuracy == 100, "incorrect value for last_msg.msg.vel_cog.v_up_accuracy, expected 100, is %d", last_msg.msg.vel_cog.v_up_accuracy); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.vel_cog.cog == 123, + "incorrect value for last_msg.msg.vel_cog.cog, expected 123, is %d", + last_msg.msg.vel_cog.cog); + + ck_assert_msg(last_msg.msg.vel_cog.cog_accuracy == 180000000, + "incorrect value for last_msg.msg.vel_cog.cog_accuracy, " + "expected 180000000, is %d", + last_msg.msg.vel_cog.cog_accuracy); + + ck_assert_msg( + last_msg.msg.vel_cog.flags == 0, + "incorrect value for last_msg.msg.vel_cog.flags, expected 0, is %d", + last_msg.msg.vel_cog.flags); + + ck_assert_msg( + last_msg.msg.vel_cog.sog == 456, + "incorrect value for last_msg.msg.vel_cog.sog, expected 456, is %d", + last_msg.msg.vel_cog.sog); + + ck_assert_msg(last_msg.msg.vel_cog.sog_accuracy == 100, + "incorrect value for last_msg.msg.vel_cog.sog_accuracy, " + "expected 100, is %d", + last_msg.msg.vel_cog.sog_accuracy); + + ck_assert_msg(last_msg.msg.vel_cog.tow == 326825520, + "incorrect value for last_msg.msg.vel_cog.tow, expected " + "326825520, is %d", + last_msg.msg.vel_cog.tow); + + ck_assert_msg( + last_msg.msg.vel_cog.v_up == -1000, + "incorrect value for last_msg.msg.vel_cog.v_up, expected -1000, is %d", + last_msg.msg.vel_cog.v_up); + + ck_assert_msg(last_msg.msg.vel_cog.v_up_accuracy == 100, + "incorrect value for last_msg.msg.vel_cog.v_up_accuracy, " + "expected 100, is %d", + last_msg.msg.vel_cog.v_up_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -240,75 +298,105 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelCog ) logging_reset(); - sbp_callback_register(&sbp_state, 0x21C, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x21C, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,28,2,211,136,30,48,246,122,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,210, }; + u8 encoded_frame[] = { + 85, 28, 2, 211, 136, 30, 48, 246, 122, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 210, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_cog.cog = 0; - + test_msg.vel_cog.cog_accuracy = 0; - + test_msg.vel_cog.flags = 0; - + test_msg.vel_cog.sog = 0; - + test_msg.vel_cog.sog_accuracy = 0; - + test_msg.vel_cog.tow = 326825520; - + test_msg.vel_cog.v_up = 0; - + test_msg.vel_cog.v_up_accuracy = 0; sbp_message_send(&sbp_state, SbpMsgVelCog, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgVelCog, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_cog.cog == 0, "incorrect value for last_msg.msg.vel_cog.cog, expected 0, is %d", last_msg.msg.vel_cog.cog); - - ck_assert_msg(last_msg.msg.vel_cog.cog_accuracy == 0, "incorrect value for last_msg.msg.vel_cog.cog_accuracy, expected 0, is %d", last_msg.msg.vel_cog.cog_accuracy); - - ck_assert_msg(last_msg.msg.vel_cog.flags == 0, "incorrect value for last_msg.msg.vel_cog.flags, expected 0, is %d", last_msg.msg.vel_cog.flags); - - ck_assert_msg(last_msg.msg.vel_cog.sog == 0, "incorrect value for last_msg.msg.vel_cog.sog, expected 0, is %d", last_msg.msg.vel_cog.sog); - - ck_assert_msg(last_msg.msg.vel_cog.sog_accuracy == 0, "incorrect value for last_msg.msg.vel_cog.sog_accuracy, expected 0, is %d", last_msg.msg.vel_cog.sog_accuracy); - - ck_assert_msg(last_msg.msg.vel_cog.tow == 326825520, "incorrect value for last_msg.msg.vel_cog.tow, expected 326825520, is %d", last_msg.msg.vel_cog.tow); - - ck_assert_msg(last_msg.msg.vel_cog.v_up == 0, "incorrect value for last_msg.msg.vel_cog.v_up, expected 0, is %d", last_msg.msg.vel_cog.v_up); - - ck_assert_msg(last_msg.msg.vel_cog.v_up_accuracy == 0, "incorrect value for last_msg.msg.vel_cog.v_up_accuracy, expected 0, is %d", last_msg.msg.vel_cog.v_up_accuracy); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.vel_cog.cog == 0, + "incorrect value for last_msg.msg.vel_cog.cog, expected 0, is %d", + last_msg.msg.vel_cog.cog); + + ck_assert_msg(last_msg.msg.vel_cog.cog_accuracy == 0, + "incorrect value for last_msg.msg.vel_cog.cog_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_cog.cog_accuracy); + + ck_assert_msg( + last_msg.msg.vel_cog.flags == 0, + "incorrect value for last_msg.msg.vel_cog.flags, expected 0, is %d", + last_msg.msg.vel_cog.flags); + + ck_assert_msg( + last_msg.msg.vel_cog.sog == 0, + "incorrect value for last_msg.msg.vel_cog.sog, expected 0, is %d", + last_msg.msg.vel_cog.sog); + + ck_assert_msg(last_msg.msg.vel_cog.sog_accuracy == 0, + "incorrect value for last_msg.msg.vel_cog.sog_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_cog.sog_accuracy); + + ck_assert_msg(last_msg.msg.vel_cog.tow == 326825520, + "incorrect value for last_msg.msg.vel_cog.tow, expected " + "326825520, is %d", + last_msg.msg.vel_cog.tow); + + ck_assert_msg( + last_msg.msg.vel_cog.v_up == 0, + "incorrect value for last_msg.msg.vel_cog.v_up, expected 0, is %d", + last_msg.msg.vel_cog.v_up); + + ck_assert_msg(last_msg.msg.vel_cog.v_up_accuracy == 0, + "incorrect value for last_msg.msg.vel_cog.v_up_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_cog.v_up_accuracy); } } END_TEST -Suite* auto_check_sbp_navigation_MsgVelCog_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgVelCog"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelCog"); +Suite *auto_check_sbp_navigation_MsgVelCog_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgVelCog"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelCog"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgVelCog); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgVelECEF.c b/c/test/auto_check_sbp_navigation_MsgVelECEF.c index 9fa7c8320..d7c4d4420 100644 --- a/c/test/auto_check_sbp_navigation_MsgVelECEF.c +++ b/c/test/auto_check_sbp_navigation_MsgVelECEF.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEF.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgVelECEF ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgVelECEF) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEF ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,68 +90,95 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEF ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,13,2,211,136,20,40,244,122,19,248,255,255,255,251,255,255,255,10,0,0,0,0,0,14,0,181,99, }; + u8 encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 40, 244, 122, 19, 248, 255, 255, 255, + 251, 255, 255, 255, 10, 0, 0, 0, 0, 0, 14, 0, 181, 99, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef.accuracy = 0; - + test_msg.vel_ecef.flags = 0; - + test_msg.vel_ecef.n_sats = 14; - + test_msg.vel_ecef.tow = 326825000; - + test_msg.vel_ecef.x = -8; - + test_msg.vel_ecef.y = -5; - + test_msg.vel_ecef.z = 10; sbp_message_send(&sbp_state, SbpMsgVelEcef, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgVelEcef, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef.accuracy, expected 0, is %d", last_msg.msg.vel_ecef.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef.flags == 0, "incorrect value for last_msg.msg.vel_ecef.flags, expected 0, is %d", last_msg.msg.vel_ecef.flags); - - ck_assert_msg(last_msg.msg.vel_ecef.n_sats == 14, "incorrect value for last_msg.msg.vel_ecef.n_sats, expected 14, is %d", last_msg.msg.vel_ecef.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef.tow == 326825000, "incorrect value for last_msg.msg.vel_ecef.tow, expected 326825000, is %d", last_msg.msg.vel_ecef.tow); - - ck_assert_msg(last_msg.msg.vel_ecef.x == -8, "incorrect value for last_msg.msg.vel_ecef.x, expected -8, is %d", last_msg.msg.vel_ecef.x); - - ck_assert_msg(last_msg.msg.vel_ecef.y == -5, "incorrect value for last_msg.msg.vel_ecef.y, expected -5, is %d", last_msg.msg.vel_ecef.y); - - ck_assert_msg(last_msg.msg.vel_ecef.z == 10, "incorrect value for last_msg.msg.vel_ecef.z, expected 10, is %d", last_msg.msg.vel_ecef.z); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.vel_ecef.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef.accuracy, expected 0, is %d", + last_msg.msg.vel_ecef.accuracy); + + ck_assert_msg( + last_msg.msg.vel_ecef.flags == 0, + "incorrect value for last_msg.msg.vel_ecef.flags, expected 0, is %d", + last_msg.msg.vel_ecef.flags); + + ck_assert_msg( + last_msg.msg.vel_ecef.n_sats == 14, + "incorrect value for last_msg.msg.vel_ecef.n_sats, expected 14, is %d", + last_msg.msg.vel_ecef.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef.tow == 326825000, + "incorrect value for last_msg.msg.vel_ecef.tow, expected " + "326825000, is %d", + last_msg.msg.vel_ecef.tow); + + ck_assert_msg( + last_msg.msg.vel_ecef.x == -8, + "incorrect value for last_msg.msg.vel_ecef.x, expected -8, is %d", + last_msg.msg.vel_ecef.x); + + ck_assert_msg( + last_msg.msg.vel_ecef.y == -5, + "incorrect value for last_msg.msg.vel_ecef.y, expected -5, is %d", + last_msg.msg.vel_ecef.y); + + ck_assert_msg( + last_msg.msg.vel_ecef.z == 10, + "incorrect value for last_msg.msg.vel_ecef.z, expected 10, is %d", + last_msg.msg.vel_ecef.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -163,68 +186,95 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEF ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,13,2,211,136,20,28,246,122,19,244,255,255,255,238,255,255,255,11,0,0,0,0,0,15,0,215,120, }; + u8 encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 28, 246, 122, 19, 244, 255, 255, 255, + 238, 255, 255, 255, 11, 0, 0, 0, 0, 0, 15, 0, 215, 120, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef.accuracy = 0; - + test_msg.vel_ecef.flags = 0; - + test_msg.vel_ecef.n_sats = 15; - + test_msg.vel_ecef.tow = 326825500; - + test_msg.vel_ecef.x = -12; - + test_msg.vel_ecef.y = -18; - + test_msg.vel_ecef.z = 11; sbp_message_send(&sbp_state, SbpMsgVelEcef, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgVelEcef, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef.accuracy, expected 0, is %d", last_msg.msg.vel_ecef.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef.flags == 0, "incorrect value for last_msg.msg.vel_ecef.flags, expected 0, is %d", last_msg.msg.vel_ecef.flags); - - ck_assert_msg(last_msg.msg.vel_ecef.n_sats == 15, "incorrect value for last_msg.msg.vel_ecef.n_sats, expected 15, is %d", last_msg.msg.vel_ecef.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef.tow == 326825500, "incorrect value for last_msg.msg.vel_ecef.tow, expected 326825500, is %d", last_msg.msg.vel_ecef.tow); - - ck_assert_msg(last_msg.msg.vel_ecef.x == -12, "incorrect value for last_msg.msg.vel_ecef.x, expected -12, is %d", last_msg.msg.vel_ecef.x); - - ck_assert_msg(last_msg.msg.vel_ecef.y == -18, "incorrect value for last_msg.msg.vel_ecef.y, expected -18, is %d", last_msg.msg.vel_ecef.y); - - ck_assert_msg(last_msg.msg.vel_ecef.z == 11, "incorrect value for last_msg.msg.vel_ecef.z, expected 11, is %d", last_msg.msg.vel_ecef.z); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.vel_ecef.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef.accuracy, expected 0, is %d", + last_msg.msg.vel_ecef.accuracy); + + ck_assert_msg( + last_msg.msg.vel_ecef.flags == 0, + "incorrect value for last_msg.msg.vel_ecef.flags, expected 0, is %d", + last_msg.msg.vel_ecef.flags); + + ck_assert_msg( + last_msg.msg.vel_ecef.n_sats == 15, + "incorrect value for last_msg.msg.vel_ecef.n_sats, expected 15, is %d", + last_msg.msg.vel_ecef.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef.tow == 326825500, + "incorrect value for last_msg.msg.vel_ecef.tow, expected " + "326825500, is %d", + last_msg.msg.vel_ecef.tow); + + ck_assert_msg( + last_msg.msg.vel_ecef.x == -12, + "incorrect value for last_msg.msg.vel_ecef.x, expected -12, is %d", + last_msg.msg.vel_ecef.x); + + ck_assert_msg( + last_msg.msg.vel_ecef.y == -18, + "incorrect value for last_msg.msg.vel_ecef.y, expected -18, is %d", + last_msg.msg.vel_ecef.y); + + ck_assert_msg( + last_msg.msg.vel_ecef.z == 11, + "incorrect value for last_msg.msg.vel_ecef.z, expected 11, is %d", + last_msg.msg.vel_ecef.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -232,68 +282,95 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEF ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,13,2,211,136,20,16,248,122,19,248,255,255,255,250,255,255,255,7,0,0,0,0,0,15,0,248,221, }; + u8 encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 16, 248, 122, 19, 248, 255, 255, 255, + 250, 255, 255, 255, 7, 0, 0, 0, 0, 0, 15, 0, 248, 221, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef.accuracy = 0; - + test_msg.vel_ecef.flags = 0; - + test_msg.vel_ecef.n_sats = 15; - + test_msg.vel_ecef.tow = 326826000; - + test_msg.vel_ecef.x = -8; - + test_msg.vel_ecef.y = -6; - + test_msg.vel_ecef.z = 7; sbp_message_send(&sbp_state, SbpMsgVelEcef, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgVelEcef, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef.accuracy, expected 0, is %d", last_msg.msg.vel_ecef.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef.flags == 0, "incorrect value for last_msg.msg.vel_ecef.flags, expected 0, is %d", last_msg.msg.vel_ecef.flags); - - ck_assert_msg(last_msg.msg.vel_ecef.n_sats == 15, "incorrect value for last_msg.msg.vel_ecef.n_sats, expected 15, is %d", last_msg.msg.vel_ecef.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef.tow == 326826000, "incorrect value for last_msg.msg.vel_ecef.tow, expected 326826000, is %d", last_msg.msg.vel_ecef.tow); - - ck_assert_msg(last_msg.msg.vel_ecef.x == -8, "incorrect value for last_msg.msg.vel_ecef.x, expected -8, is %d", last_msg.msg.vel_ecef.x); - - ck_assert_msg(last_msg.msg.vel_ecef.y == -6, "incorrect value for last_msg.msg.vel_ecef.y, expected -6, is %d", last_msg.msg.vel_ecef.y); - - ck_assert_msg(last_msg.msg.vel_ecef.z == 7, "incorrect value for last_msg.msg.vel_ecef.z, expected 7, is %d", last_msg.msg.vel_ecef.z); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.vel_ecef.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef.accuracy, expected 0, is %d", + last_msg.msg.vel_ecef.accuracy); + + ck_assert_msg( + last_msg.msg.vel_ecef.flags == 0, + "incorrect value for last_msg.msg.vel_ecef.flags, expected 0, is %d", + last_msg.msg.vel_ecef.flags); + + ck_assert_msg( + last_msg.msg.vel_ecef.n_sats == 15, + "incorrect value for last_msg.msg.vel_ecef.n_sats, expected 15, is %d", + last_msg.msg.vel_ecef.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef.tow == 326826000, + "incorrect value for last_msg.msg.vel_ecef.tow, expected " + "326826000, is %d", + last_msg.msg.vel_ecef.tow); + + ck_assert_msg( + last_msg.msg.vel_ecef.x == -8, + "incorrect value for last_msg.msg.vel_ecef.x, expected -8, is %d", + last_msg.msg.vel_ecef.x); + + ck_assert_msg( + last_msg.msg.vel_ecef.y == -6, + "incorrect value for last_msg.msg.vel_ecef.y, expected -6, is %d", + last_msg.msg.vel_ecef.y); + + ck_assert_msg( + last_msg.msg.vel_ecef.z == 7, + "incorrect value for last_msg.msg.vel_ecef.z, expected 7, is %d", + last_msg.msg.vel_ecef.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -301,68 +378,95 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEF ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,13,2,211,136,20,4,250,122,19,249,255,255,255,239,255,255,255,16,0,0,0,0,0,15,0,1,167, }; + u8 encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 4, 250, 122, 19, 249, 255, 255, 255, + 239, 255, 255, 255, 16, 0, 0, 0, 0, 0, 15, 0, 1, 167, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef.accuracy = 0; - + test_msg.vel_ecef.flags = 0; - + test_msg.vel_ecef.n_sats = 15; - + test_msg.vel_ecef.tow = 326826500; - + test_msg.vel_ecef.x = -7; - + test_msg.vel_ecef.y = -17; - + test_msg.vel_ecef.z = 16; sbp_message_send(&sbp_state, SbpMsgVelEcef, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgVelEcef, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef.accuracy, expected 0, is %d", last_msg.msg.vel_ecef.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef.flags == 0, "incorrect value for last_msg.msg.vel_ecef.flags, expected 0, is %d", last_msg.msg.vel_ecef.flags); - - ck_assert_msg(last_msg.msg.vel_ecef.n_sats == 15, "incorrect value for last_msg.msg.vel_ecef.n_sats, expected 15, is %d", last_msg.msg.vel_ecef.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef.tow == 326826500, "incorrect value for last_msg.msg.vel_ecef.tow, expected 326826500, is %d", last_msg.msg.vel_ecef.tow); - - ck_assert_msg(last_msg.msg.vel_ecef.x == -7, "incorrect value for last_msg.msg.vel_ecef.x, expected -7, is %d", last_msg.msg.vel_ecef.x); - - ck_assert_msg(last_msg.msg.vel_ecef.y == -17, "incorrect value for last_msg.msg.vel_ecef.y, expected -17, is %d", last_msg.msg.vel_ecef.y); - - ck_assert_msg(last_msg.msg.vel_ecef.z == 16, "incorrect value for last_msg.msg.vel_ecef.z, expected 16, is %d", last_msg.msg.vel_ecef.z); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.vel_ecef.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef.accuracy, expected 0, is %d", + last_msg.msg.vel_ecef.accuracy); + + ck_assert_msg( + last_msg.msg.vel_ecef.flags == 0, + "incorrect value for last_msg.msg.vel_ecef.flags, expected 0, is %d", + last_msg.msg.vel_ecef.flags); + + ck_assert_msg( + last_msg.msg.vel_ecef.n_sats == 15, + "incorrect value for last_msg.msg.vel_ecef.n_sats, expected 15, is %d", + last_msg.msg.vel_ecef.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef.tow == 326826500, + "incorrect value for last_msg.msg.vel_ecef.tow, expected " + "326826500, is %d", + last_msg.msg.vel_ecef.tow); + + ck_assert_msg( + last_msg.msg.vel_ecef.x == -7, + "incorrect value for last_msg.msg.vel_ecef.x, expected -7, is %d", + last_msg.msg.vel_ecef.x); + + ck_assert_msg( + last_msg.msg.vel_ecef.y == -17, + "incorrect value for last_msg.msg.vel_ecef.y, expected -17, is %d", + last_msg.msg.vel_ecef.y); + + ck_assert_msg( + last_msg.msg.vel_ecef.z == 16, + "incorrect value for last_msg.msg.vel_ecef.z, expected 16, is %d", + last_msg.msg.vel_ecef.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -370,71 +474,98 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEF ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,13,2,211,136,20,248,251,122,19,247,255,255,255,243,255,255,255,14,0,0,0,0,0,15,0,191,43, }; + u8 encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 248, 251, 122, 19, 247, 255, 255, 255, + 243, 255, 255, 255, 14, 0, 0, 0, 0, 0, 15, 0, 191, 43, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef.accuracy = 0; - + test_msg.vel_ecef.flags = 0; - + test_msg.vel_ecef.n_sats = 15; - + test_msg.vel_ecef.tow = 326827000; - + test_msg.vel_ecef.x = -9; - + test_msg.vel_ecef.y = -13; - + test_msg.vel_ecef.z = 14; sbp_message_send(&sbp_state, SbpMsgVelEcef, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgVelEcef, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef.accuracy, expected 0, is %d", last_msg.msg.vel_ecef.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef.flags == 0, "incorrect value for last_msg.msg.vel_ecef.flags, expected 0, is %d", last_msg.msg.vel_ecef.flags); - - ck_assert_msg(last_msg.msg.vel_ecef.n_sats == 15, "incorrect value for last_msg.msg.vel_ecef.n_sats, expected 15, is %d", last_msg.msg.vel_ecef.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef.tow == 326827000, "incorrect value for last_msg.msg.vel_ecef.tow, expected 326827000, is %d", last_msg.msg.vel_ecef.tow); - - ck_assert_msg(last_msg.msg.vel_ecef.x == -9, "incorrect value for last_msg.msg.vel_ecef.x, expected -9, is %d", last_msg.msg.vel_ecef.x); - - ck_assert_msg(last_msg.msg.vel_ecef.y == -13, "incorrect value for last_msg.msg.vel_ecef.y, expected -13, is %d", last_msg.msg.vel_ecef.y); - - ck_assert_msg(last_msg.msg.vel_ecef.z == 14, "incorrect value for last_msg.msg.vel_ecef.z, expected 14, is %d", last_msg.msg.vel_ecef.z); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.vel_ecef.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef.accuracy, expected 0, is %d", + last_msg.msg.vel_ecef.accuracy); + + ck_assert_msg( + last_msg.msg.vel_ecef.flags == 0, + "incorrect value for last_msg.msg.vel_ecef.flags, expected 0, is %d", + last_msg.msg.vel_ecef.flags); + + ck_assert_msg( + last_msg.msg.vel_ecef.n_sats == 15, + "incorrect value for last_msg.msg.vel_ecef.n_sats, expected 15, is %d", + last_msg.msg.vel_ecef.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef.tow == 326827000, + "incorrect value for last_msg.msg.vel_ecef.tow, expected " + "326827000, is %d", + last_msg.msg.vel_ecef.tow); + + ck_assert_msg( + last_msg.msg.vel_ecef.x == -9, + "incorrect value for last_msg.msg.vel_ecef.x, expected -9, is %d", + last_msg.msg.vel_ecef.x); + + ck_assert_msg( + last_msg.msg.vel_ecef.y == -13, + "incorrect value for last_msg.msg.vel_ecef.y, expected -13, is %d", + last_msg.msg.vel_ecef.y); + + ck_assert_msg( + last_msg.msg.vel_ecef.z == 14, + "incorrect value for last_msg.msg.vel_ecef.z, expected 14, is %d", + last_msg.msg.vel_ecef.z); } } END_TEST -Suite* auto_check_sbp_navigation_MsgVelECEF_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgVelECEF"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelECEF"); +Suite *auto_check_sbp_navigation_MsgVelECEF_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgVelECEF"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelECEF"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgVelECEF); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgVelECEFCov.c b/c/test/auto_check_sbp_navigation_MsgVelECEFCov.c index 12dfe7dce..6fef1c7a4 100644 --- a/c/test/auto_check_sbp_navigation_MsgVelECEFCov.c +++ b/c/test/auto_check_sbp_navigation_MsgVelECEFCov.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFCov.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFCov.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgVelECEFCov ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgVelECEFCov) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEFCov ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,91 +90,135 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEFCov ) logging_reset(); - sbp_callback_register(&sbp_state, 0x215, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x215, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,21,2,66,0,42,2,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,64,0,0,0,64,0,0,0,64,0,0,0,64,0,0,128,63,0,0,64,64,3,4,91,254, }; + u8 encoded_frame[] = { + 85, 21, 2, 66, 0, 42, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0, 64, + 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 64, 64, 3, 4, 91, 254, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef_cov.cov_x_x = 2.0; - + test_msg.vel_ecef_cov.cov_x_y = 2.0; - + test_msg.vel_ecef_cov.cov_x_z = 2.0; - + test_msg.vel_ecef_cov.cov_y_y = 2.0; - + test_msg.vel_ecef_cov.cov_y_z = 1.0; - + test_msg.vel_ecef_cov.cov_z_z = 3.0; - + test_msg.vel_ecef_cov.flags = 4; - + test_msg.vel_ecef_cov.n_sats = 3; - + test_msg.vel_ecef_cov.tow = 2; - + test_msg.vel_ecef_cov.x = 0; - + test_msg.vel_ecef_cov.y = 0; - + test_msg.vel_ecef_cov.z = 6; sbp_message_send(&sbp_state, SbpMsgVelEcefCov, 66, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelEcefCov, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelEcefCov, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.vel_ecef_cov.cov_x_x * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ecef_cov.cov_x_x, expected 2.0, is %s", last_msg.msg.vel_ecef_cov.cov_x_x); - - ck_assert_msg((last_msg.msg.vel_ecef_cov.cov_x_y * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ecef_cov.cov_x_y, expected 2.0, is %s", last_msg.msg.vel_ecef_cov.cov_x_y); - - ck_assert_msg((last_msg.msg.vel_ecef_cov.cov_x_z * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ecef_cov.cov_x_z, expected 2.0, is %s", last_msg.msg.vel_ecef_cov.cov_x_z); - - ck_assert_msg((last_msg.msg.vel_ecef_cov.cov_y_y * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ecef_cov.cov_y_y, expected 2.0, is %s", last_msg.msg.vel_ecef_cov.cov_y_y); - - ck_assert_msg((last_msg.msg.vel_ecef_cov.cov_y_z * 100 - 1.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ecef_cov.cov_y_z, expected 1.0, is %s", last_msg.msg.vel_ecef_cov.cov_y_z); - - ck_assert_msg((last_msg.msg.vel_ecef_cov.cov_z_z * 100 - 3.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ecef_cov.cov_z_z, expected 3.0, is %s", last_msg.msg.vel_ecef_cov.cov_z_z); - - ck_assert_msg(last_msg.msg.vel_ecef_cov.flags == 4, "incorrect value for last_msg.msg.vel_ecef_cov.flags, expected 4, is %d", last_msg.msg.vel_ecef_cov.flags); - - ck_assert_msg(last_msg.msg.vel_ecef_cov.n_sats == 3, "incorrect value for last_msg.msg.vel_ecef_cov.n_sats, expected 3, is %d", last_msg.msg.vel_ecef_cov.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef_cov.tow == 2, "incorrect value for last_msg.msg.vel_ecef_cov.tow, expected 2, is %d", last_msg.msg.vel_ecef_cov.tow); - - ck_assert_msg(last_msg.msg.vel_ecef_cov.x == 0, "incorrect value for last_msg.msg.vel_ecef_cov.x, expected 0, is %d", last_msg.msg.vel_ecef_cov.x); - - ck_assert_msg(last_msg.msg.vel_ecef_cov.y == 0, "incorrect value for last_msg.msg.vel_ecef_cov.y, expected 0, is %d", last_msg.msg.vel_ecef_cov.y); - - ck_assert_msg(last_msg.msg.vel_ecef_cov.z == 6, "incorrect value for last_msg.msg.vel_ecef_cov.z, expected 6, is %d", last_msg.msg.vel_ecef_cov.z); + ck_assert_msg((last_msg.msg.vel_ecef_cov.cov_x_x * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ecef_cov.cov_x_x, " + "expected 2.0, is %s", + last_msg.msg.vel_ecef_cov.cov_x_x); + + ck_assert_msg((last_msg.msg.vel_ecef_cov.cov_x_y * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ecef_cov.cov_x_y, " + "expected 2.0, is %s", + last_msg.msg.vel_ecef_cov.cov_x_y); + + ck_assert_msg((last_msg.msg.vel_ecef_cov.cov_x_z * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ecef_cov.cov_x_z, " + "expected 2.0, is %s", + last_msg.msg.vel_ecef_cov.cov_x_z); + + ck_assert_msg((last_msg.msg.vel_ecef_cov.cov_y_y * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ecef_cov.cov_y_y, " + "expected 2.0, is %s", + last_msg.msg.vel_ecef_cov.cov_y_y); + + ck_assert_msg((last_msg.msg.vel_ecef_cov.cov_y_z * 100 - 1.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ecef_cov.cov_y_z, " + "expected 1.0, is %s", + last_msg.msg.vel_ecef_cov.cov_y_z); + + ck_assert_msg((last_msg.msg.vel_ecef_cov.cov_z_z * 100 - 3.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ecef_cov.cov_z_z, " + "expected 3.0, is %s", + last_msg.msg.vel_ecef_cov.cov_z_z); + + ck_assert_msg(last_msg.msg.vel_ecef_cov.flags == 4, + "incorrect value for last_msg.msg.vel_ecef_cov.flags, " + "expected 4, is %d", + last_msg.msg.vel_ecef_cov.flags); + + ck_assert_msg(last_msg.msg.vel_ecef_cov.n_sats == 3, + "incorrect value for last_msg.msg.vel_ecef_cov.n_sats, " + "expected 3, is %d", + last_msg.msg.vel_ecef_cov.n_sats); + + ck_assert_msg( + last_msg.msg.vel_ecef_cov.tow == 2, + "incorrect value for last_msg.msg.vel_ecef_cov.tow, expected 2, is %d", + last_msg.msg.vel_ecef_cov.tow); + + ck_assert_msg( + last_msg.msg.vel_ecef_cov.x == 0, + "incorrect value for last_msg.msg.vel_ecef_cov.x, expected 0, is %d", + last_msg.msg.vel_ecef_cov.x); + + ck_assert_msg( + last_msg.msg.vel_ecef_cov.y == 0, + "incorrect value for last_msg.msg.vel_ecef_cov.y, expected 0, is %d", + last_msg.msg.vel_ecef_cov.y); + + ck_assert_msg( + last_msg.msg.vel_ecef_cov.z == 6, + "incorrect value for last_msg.msg.vel_ecef_cov.z, expected 6, is %d", + last_msg.msg.vel_ecef_cov.z); } } END_TEST -Suite* auto_check_sbp_navigation_MsgVelECEFCov_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgVelECEFCov"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelECEFCov"); +Suite *auto_check_sbp_navigation_MsgVelECEFCov_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgVelECEFCov"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelECEFCov"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgVelECEFCov); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgVelECEFDepA.c b/c/test/auto_check_sbp_navigation_MsgVelECEFDepA.c index e289328aa..5f100481a 100644 --- a/c/test/auto_check_sbp_navigation_MsgVelECEFDepA.c +++ b/c/test/auto_check_sbp_navigation_MsgVelECEFDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgVelECEFDepA ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgVelECEFDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEFDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,68 +90,97 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,2,246,215,20,20,46,39,0,218,11,0,0,134,245,255,255,163,252,255,255,0,0,9,0,80,236, }; + u8 encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 20, 46, 39, 0, 218, 11, 0, 0, + 134, 245, 255, 255, 163, 252, 255, 255, 0, 0, 9, 0, 80, 236, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef_dep_a.accuracy = 0; - + test_msg.vel_ecef_dep_a.flags = 0; - + test_msg.vel_ecef_dep_a.n_sats = 9; - + test_msg.vel_ecef_dep_a.tow = 2567700; - + test_msg.vel_ecef_dep_a.x = 3034; - + test_msg.vel_ecef_dep_a.y = -2682; - + test_msg.vel_ecef_dep_a.z = -861; - sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 9, "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, expected 9, is %d", last_msg.msg.vel_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 2567700, "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, expected 2567700, is %d", last_msg.msg.vel_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == 3034, "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected 3034, is %d", last_msg.msg.vel_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -2682, "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected -2682, is %d", last_msg.msg.vel_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == -861, "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected -861, is %d", last_msg.msg.vel_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.vel_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 2567700, + "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, " + "expected 2567700, is %d", + last_msg.msg.vel_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == 3034, + "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected " + "3034, is %d", + last_msg.msg.vel_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -2682, + "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected " + "-2682, is %d", + last_msg.msg.vel_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == -861, + "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected " + "-861, is %d", + last_msg.msg.vel_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -163,68 +188,97 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,2,246,215,20,120,46,39,0,68,11,0,0,24,246,255,255,220,252,255,255,0,0,9,0,248,138, }; + u8 encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 120, 46, 39, 0, 68, 11, 0, 0, + 24, 246, 255, 255, 220, 252, 255, 255, 0, 0, 9, 0, 248, 138, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef_dep_a.accuracy = 0; - + test_msg.vel_ecef_dep_a.flags = 0; - + test_msg.vel_ecef_dep_a.n_sats = 9; - + test_msg.vel_ecef_dep_a.tow = 2567800; - + test_msg.vel_ecef_dep_a.x = 2884; - + test_msg.vel_ecef_dep_a.y = -2536; - + test_msg.vel_ecef_dep_a.z = -804; - sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 9, "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, expected 9, is %d", last_msg.msg.vel_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 2567800, "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, expected 2567800, is %d", last_msg.msg.vel_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == 2884, "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected 2884, is %d", last_msg.msg.vel_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -2536, "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected -2536, is %d", last_msg.msg.vel_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == -804, "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected -804, is %d", last_msg.msg.vel_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.vel_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 2567800, + "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, " + "expected 2567800, is %d", + last_msg.msg.vel_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == 2884, + "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected " + "2884, is %d", + last_msg.msg.vel_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -2536, + "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected " + "-2536, is %d", + last_msg.msg.vel_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == -804, + "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected " + "-804, is %d", + last_msg.msg.vel_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -232,68 +286,97 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,2,246,215,20,220,46,39,0,21,11,0,0,77,246,255,255,247,252,255,255,0,0,9,0,25,174, }; + u8 encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 220, 46, 39, 0, 21, 11, 0, 0, + 77, 246, 255, 255, 247, 252, 255, 255, 0, 0, 9, 0, 25, 174, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef_dep_a.accuracy = 0; - + test_msg.vel_ecef_dep_a.flags = 0; - + test_msg.vel_ecef_dep_a.n_sats = 9; - + test_msg.vel_ecef_dep_a.tow = 2567900; - + test_msg.vel_ecef_dep_a.x = 2837; - + test_msg.vel_ecef_dep_a.y = -2483; - + test_msg.vel_ecef_dep_a.z = -777; - sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 9, "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, expected 9, is %d", last_msg.msg.vel_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 2567900, "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, expected 2567900, is %d", last_msg.msg.vel_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == 2837, "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected 2837, is %d", last_msg.msg.vel_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -2483, "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected -2483, is %d", last_msg.msg.vel_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == -777, "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected -777, is %d", last_msg.msg.vel_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.vel_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 2567900, + "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, " + "expected 2567900, is %d", + last_msg.msg.vel_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == 2837, + "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected " + "2837, is %d", + last_msg.msg.vel_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -2483, + "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected " + "-2483, is %d", + last_msg.msg.vel_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == -777, + "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected " + "-777, is %d", + last_msg.msg.vel_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -301,68 +384,97 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,2,246,215,20,64,47,39,0,121,11,0,0,2,246,255,255,234,252,255,255,0,0,9,0,195,228, }; + u8 encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 64, 47, 39, 0, 121, 11, 0, 0, + 2, 246, 255, 255, 234, 252, 255, 255, 0, 0, 9, 0, 195, 228, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef_dep_a.accuracy = 0; - + test_msg.vel_ecef_dep_a.flags = 0; - + test_msg.vel_ecef_dep_a.n_sats = 9; - + test_msg.vel_ecef_dep_a.tow = 2568000; - + test_msg.vel_ecef_dep_a.x = 2937; - + test_msg.vel_ecef_dep_a.y = -2558; - + test_msg.vel_ecef_dep_a.z = -790; - sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 9, "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, expected 9, is %d", last_msg.msg.vel_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 2568000, "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, expected 2568000, is %d", last_msg.msg.vel_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == 2937, "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected 2937, is %d", last_msg.msg.vel_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -2558, "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected -2558, is %d", last_msg.msg.vel_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == -790, "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected -790, is %d", last_msg.msg.vel_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.vel_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 2568000, + "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, " + "expected 2568000, is %d", + last_msg.msg.vel_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == 2937, + "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected " + "2937, is %d", + last_msg.msg.vel_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -2558, + "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected " + "-2558, is %d", + last_msg.msg.vel_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == -790, + "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected " + "-790, is %d", + last_msg.msg.vel_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -370,68 +482,97 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,2,246,215,20,164,47,39,0,31,11,0,0,93,246,255,255,16,253,255,255,0,0,9,0,219,164, }; + u8 encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 164, 47, 39, 0, 31, 11, 0, 0, + 93, 246, 255, 255, 16, 253, 255, 255, 0, 0, 9, 0, 219, 164, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef_dep_a.accuracy = 0; - + test_msg.vel_ecef_dep_a.flags = 0; - + test_msg.vel_ecef_dep_a.n_sats = 9; - + test_msg.vel_ecef_dep_a.tow = 2568100; - + test_msg.vel_ecef_dep_a.x = 2847; - + test_msg.vel_ecef_dep_a.y = -2467; - + test_msg.vel_ecef_dep_a.z = -752; - sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 9, "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, expected 9, is %d", last_msg.msg.vel_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 2568100, "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, expected 2568100, is %d", last_msg.msg.vel_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == 2847, "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected 2847, is %d", last_msg.msg.vel_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -2467, "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected -2467, is %d", last_msg.msg.vel_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == -752, "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected -752, is %d", last_msg.msg.vel_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.vel_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 2568100, + "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, " + "expected 2568100, is %d", + last_msg.msg.vel_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == 2847, + "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected " + "2847, is %d", + last_msg.msg.vel_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -2467, + "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected " + "-2467, is %d", + last_msg.msg.vel_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == -752, + "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected " + "-752, is %d", + last_msg.msg.vel_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -439,68 +580,97 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,2,195,4,20,212,157,67,24,24,0,0,0,245,255,255,255,219,255,255,255,0,0,8,0,68,255, }; + u8 encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 212, 157, 67, 24, 24, 0, 0, 0, + 245, 255, 255, 255, 219, 255, 255, 255, 0, 0, 8, 0, 68, 255, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef_dep_a.accuracy = 0; - + test_msg.vel_ecef_dep_a.flags = 0; - + test_msg.vel_ecef_dep_a.n_sats = 8; - + test_msg.vel_ecef_dep_a.tow = 407084500; - + test_msg.vel_ecef_dep_a.x = 24; - + test_msg.vel_ecef_dep_a.y = -11; - + test_msg.vel_ecef_dep_a.z = -37; - sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 8, "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, expected 8, is %d", last_msg.msg.vel_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 407084500, "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, expected 407084500, is %d", last_msg.msg.vel_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == 24, "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected 24, is %d", last_msg.msg.vel_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -11, "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected -11, is %d", last_msg.msg.vel_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == -37, "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected -37, is %d", last_msg.msg.vel_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.vel_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 407084500, + "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, " + "expected 407084500, is %d", + last_msg.msg.vel_ecef_dep_a.tow); + + ck_assert_msg( + last_msg.msg.vel_ecef_dep_a.x == 24, + "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected 24, is %d", + last_msg.msg.vel_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -11, + "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected " + "-11, is %d", + last_msg.msg.vel_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == -37, + "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected " + "-37, is %d", + last_msg.msg.vel_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -508,68 +678,97 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,2,195,4,20,56,158,67,24,4,0,0,0,234,255,255,255,18,0,0,0,0,0,8,0,214,136, }; + u8 encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 56, 158, 67, 24, 4, 0, 0, 0, + 234, 255, 255, 255, 18, 0, 0, 0, 0, 0, 8, 0, 214, 136, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef_dep_a.accuracy = 0; - + test_msg.vel_ecef_dep_a.flags = 0; - + test_msg.vel_ecef_dep_a.n_sats = 8; - + test_msg.vel_ecef_dep_a.tow = 407084600; - + test_msg.vel_ecef_dep_a.x = 4; - + test_msg.vel_ecef_dep_a.y = -22; - + test_msg.vel_ecef_dep_a.z = 18; - sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 8, "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, expected 8, is %d", last_msg.msg.vel_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 407084600, "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, expected 407084600, is %d", last_msg.msg.vel_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == 4, "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected 4, is %d", last_msg.msg.vel_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -22, "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected -22, is %d", last_msg.msg.vel_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == 18, "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected 18, is %d", last_msg.msg.vel_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.vel_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 407084600, + "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, " + "expected 407084600, is %d", + last_msg.msg.vel_ecef_dep_a.tow); + + ck_assert_msg( + last_msg.msg.vel_ecef_dep_a.x == 4, + "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected 4, is %d", + last_msg.msg.vel_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -22, + "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected " + "-22, is %d", + last_msg.msg.vel_ecef_dep_a.y); + + ck_assert_msg( + last_msg.msg.vel_ecef_dep_a.z == 18, + "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected 18, is %d", + last_msg.msg.vel_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -577,68 +776,97 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,2,195,4,20,156,158,67,24,230,255,255,255,4,0,0,0,1,0,0,0,0,0,8,0,122,159, }; + u8 encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 156, 158, 67, 24, 230, 255, 255, 255, + 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8, 0, 122, 159, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef_dep_a.accuracy = 0; - + test_msg.vel_ecef_dep_a.flags = 0; - + test_msg.vel_ecef_dep_a.n_sats = 8; - + test_msg.vel_ecef_dep_a.tow = 407084700; - + test_msg.vel_ecef_dep_a.x = -26; - + test_msg.vel_ecef_dep_a.y = 4; - + test_msg.vel_ecef_dep_a.z = 1; - sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 8, "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, expected 8, is %d", last_msg.msg.vel_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 407084700, "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, expected 407084700, is %d", last_msg.msg.vel_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == -26, "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected -26, is %d", last_msg.msg.vel_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == 4, "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected 4, is %d", last_msg.msg.vel_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == 1, "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected 1, is %d", last_msg.msg.vel_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.vel_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 407084700, + "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, " + "expected 407084700, is %d", + last_msg.msg.vel_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == -26, + "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected " + "-26, is %d", + last_msg.msg.vel_ecef_dep_a.x); + + ck_assert_msg( + last_msg.msg.vel_ecef_dep_a.y == 4, + "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected 4, is %d", + last_msg.msg.vel_ecef_dep_a.y); + + ck_assert_msg( + last_msg.msg.vel_ecef_dep_a.z == 1, + "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected 1, is %d", + last_msg.msg.vel_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -646,68 +874,97 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,2,195,4,20,0,159,67,24,247,255,255,255,237,255,255,255,28,0,0,0,0,0,8,0,232,146, }; + u8 encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 0, 159, 67, 24, 247, 255, 255, 255, + 237, 255, 255, 255, 28, 0, 0, 0, 0, 0, 8, 0, 232, 146, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef_dep_a.accuracy = 0; - + test_msg.vel_ecef_dep_a.flags = 0; - + test_msg.vel_ecef_dep_a.n_sats = 8; - + test_msg.vel_ecef_dep_a.tow = 407084800; - + test_msg.vel_ecef_dep_a.x = -9; - + test_msg.vel_ecef_dep_a.y = -19; - + test_msg.vel_ecef_dep_a.z = 28; - sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 8, "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, expected 8, is %d", last_msg.msg.vel_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 407084800, "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, expected 407084800, is %d", last_msg.msg.vel_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == -9, "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected -9, is %d", last_msg.msg.vel_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -19, "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected -19, is %d", last_msg.msg.vel_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == 28, "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected 28, is %d", last_msg.msg.vel_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.vel_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 407084800, + "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, " + "expected 407084800, is %d", + last_msg.msg.vel_ecef_dep_a.tow); + + ck_assert_msg( + last_msg.msg.vel_ecef_dep_a.x == -9, + "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected -9, is %d", + last_msg.msg.vel_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -19, + "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected " + "-19, is %d", + last_msg.msg.vel_ecef_dep_a.y); + + ck_assert_msg( + last_msg.msg.vel_ecef_dep_a.z == 28, + "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected 28, is %d", + last_msg.msg.vel_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -715,68 +972,97 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,2,195,4,20,100,159,67,24,255,255,255,255,2,0,0,0,245,255,255,255,0,0,8,0,171,238, }; + u8 encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 100, 159, 67, 24, 255, 255, 255, 255, + 2, 0, 0, 0, 245, 255, 255, 255, 0, 0, 8, 0, 171, 238, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef_dep_a.accuracy = 0; - + test_msg.vel_ecef_dep_a.flags = 0; - + test_msg.vel_ecef_dep_a.n_sats = 8; - + test_msg.vel_ecef_dep_a.tow = 407084900; - + test_msg.vel_ecef_dep_a.x = -1; - + test_msg.vel_ecef_dep_a.y = 2; - + test_msg.vel_ecef_dep_a.z = -11; - sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 8, "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, expected 8, is %d", last_msg.msg.vel_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 407084900, "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, expected 407084900, is %d", last_msg.msg.vel_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == -1, "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected -1, is %d", last_msg.msg.vel_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == 2, "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected 2, is %d", last_msg.msg.vel_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == -11, "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected -11, is %d", last_msg.msg.vel_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.vel_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 407084900, + "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, " + "expected 407084900, is %d", + last_msg.msg.vel_ecef_dep_a.tow); + + ck_assert_msg( + last_msg.msg.vel_ecef_dep_a.x == -1, + "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected -1, is %d", + last_msg.msg.vel_ecef_dep_a.x); + + ck_assert_msg( + last_msg.msg.vel_ecef_dep_a.y == 2, + "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected 2, is %d", + last_msg.msg.vel_ecef_dep_a.y); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == -11, + "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected " + "-11, is %d", + last_msg.msg.vel_ecef_dep_a.z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -784,71 +1070,100 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,2,195,4,20,46,162,68,24,207,255,255,255,185,255,255,255,65,0,0,0,0,0,5,0,82,154, }; + u8 encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 46, 162, 68, 24, 207, 255, 255, 255, + 185, 255, 255, 255, 65, 0, 0, 0, 0, 0, 5, 0, 82, 154, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef_dep_a.accuracy = 0; - + test_msg.vel_ecef_dep_a.flags = 0; - + test_msg.vel_ecef_dep_a.n_sats = 5; - + test_msg.vel_ecef_dep_a.tow = 407151150; - + test_msg.vel_ecef_dep_a.x = -49; - + test_msg.vel_ecef_dep_a.y = -71; - + test_msg.vel_ecef_dep_a.z = 65; - sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelEcefDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelEcefDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ecef_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 5, "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, expected 5, is %d", last_msg.msg.vel_ecef_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 407151150, "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, expected 407151150, is %d", last_msg.msg.vel_ecef_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == -49, "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected -49, is %d", last_msg.msg.vel_ecef_dep_a.x); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -71, "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected -71, is %d", last_msg.msg.vel_ecef_dep_a.y); - - ck_assert_msg(last_msg.msg.vel_ecef_dep_a.z == 65, "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected 65, is %d", last_msg.msg.vel_ecef_dep_a.z); + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.accuracy == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.accuracy); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ecef_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ecef_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.n_sats == 5, + "incorrect value for last_msg.msg.vel_ecef_dep_a.n_sats, " + "expected 5, is %d", + last_msg.msg.vel_ecef_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.tow == 407151150, + "incorrect value for last_msg.msg.vel_ecef_dep_a.tow, " + "expected 407151150, is %d", + last_msg.msg.vel_ecef_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.x == -49, + "incorrect value for last_msg.msg.vel_ecef_dep_a.x, expected " + "-49, is %d", + last_msg.msg.vel_ecef_dep_a.x); + + ck_assert_msg(last_msg.msg.vel_ecef_dep_a.y == -71, + "incorrect value for last_msg.msg.vel_ecef_dep_a.y, expected " + "-71, is %d", + last_msg.msg.vel_ecef_dep_a.y); + + ck_assert_msg( + last_msg.msg.vel_ecef_dep_a.z == 65, + "incorrect value for last_msg.msg.vel_ecef_dep_a.z, expected 65, is %d", + last_msg.msg.vel_ecef_dep_a.z); } } END_TEST -Suite* auto_check_sbp_navigation_MsgVelECEFDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgVelECEFDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelECEFDepA"); +Suite *auto_check_sbp_navigation_MsgVelECEFDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgVelECEFDepA"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelECEFDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgVelECEFDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgVelEcefCovGnss.c b/c/test/auto_check_sbp_navigation_MsgVelEcefCovGnss.c index 8fb58a382..f4f08d277 100644 --- a/c/test/auto_check_sbp_navigation_MsgVelEcefCovGnss.c +++ b/c/test/auto_check_sbp_navigation_MsgVelEcefCovGnss.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefCovGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefCovGnss.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgVelEcefCovGnss ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgVelEcefCovGnss) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelEcefCovGnss ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,91 +90,143 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelEcefCovGnss ) logging_reset(); - sbp_callback_register(&sbp_state, 0x235, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x235, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,53,2,0,16,42,224,229,233,29,253,255,255,255,1,0,0,0,4,0,0,0,46,224,32,59,32,214,14,59,150,147,220,186,19,63,138,59,26,150,35,187,11,193,119,59,21,2,22,230, }; + u8 encoded_frame[] = { + 85, 53, 2, 0, 16, 42, 224, 229, 233, 29, 253, 255, 255, + 255, 1, 0, 0, 0, 4, 0, 0, 0, 46, 224, 32, 59, + 32, 214, 14, 59, 150, 147, 220, 186, 19, 63, 138, 59, 26, + 150, 35, 187, 11, 193, 119, 59, 21, 2, 22, 230, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef_cov_gnss.cov_x_x = 0.0024547684006392956; - + test_msg.vel_ecef_cov_gnss.cov_x_y = 0.0021795108914375305; - + test_msg.vel_ecef_cov_gnss.cov_x_z = -0.0016828652005642653; - + test_msg.vel_ecef_cov_gnss.cov_y_y = 0.004218944814056158; - + test_msg.vel_ecef_cov_gnss.cov_y_z = -0.0024961293675005436; - + test_msg.vel_ecef_cov_gnss.cov_z_z = 0.0037804271560162306; - + test_msg.vel_ecef_cov_gnss.flags = 2; - + test_msg.vel_ecef_cov_gnss.n_sats = 21; - + test_msg.vel_ecef_cov_gnss.tow = 501868000; - + test_msg.vel_ecef_cov_gnss.x = -3; - + test_msg.vel_ecef_cov_gnss.y = 1; - + test_msg.vel_ecef_cov_gnss.z = 4; - sbp_message_send(&sbp_state, SbpMsgVelEcefCovGnss, 4096, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelEcefCovGnss, 4096, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelEcefCovGnss, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelEcefCovGnss, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.vel_ecef_cov_gnss.cov_x_x * 100 - 0.00245476840064 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ecef_cov_gnss.cov_x_x, expected 0.00245476840064, is %s", last_msg.msg.vel_ecef_cov_gnss.cov_x_x); - - ck_assert_msg((last_msg.msg.vel_ecef_cov_gnss.cov_x_y * 100 - 0.00217951089144 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ecef_cov_gnss.cov_x_y, expected 0.00217951089144, is %s", last_msg.msg.vel_ecef_cov_gnss.cov_x_y); - - ck_assert_msg((last_msg.msg.vel_ecef_cov_gnss.cov_x_z * 100 - -0.00168286520056 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ecef_cov_gnss.cov_x_z, expected -0.00168286520056, is %s", last_msg.msg.vel_ecef_cov_gnss.cov_x_z); - - ck_assert_msg((last_msg.msg.vel_ecef_cov_gnss.cov_y_y * 100 - 0.00421894481406 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ecef_cov_gnss.cov_y_y, expected 0.00421894481406, is %s", last_msg.msg.vel_ecef_cov_gnss.cov_y_y); - - ck_assert_msg((last_msg.msg.vel_ecef_cov_gnss.cov_y_z * 100 - -0.0024961293675 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ecef_cov_gnss.cov_y_z, expected -0.0024961293675, is %s", last_msg.msg.vel_ecef_cov_gnss.cov_y_z); - - ck_assert_msg((last_msg.msg.vel_ecef_cov_gnss.cov_z_z * 100 - 0.00378042715602 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ecef_cov_gnss.cov_z_z, expected 0.00378042715602, is %s", last_msg.msg.vel_ecef_cov_gnss.cov_z_z); - - ck_assert_msg(last_msg.msg.vel_ecef_cov_gnss.flags == 2, "incorrect value for last_msg.msg.vel_ecef_cov_gnss.flags, expected 2, is %d", last_msg.msg.vel_ecef_cov_gnss.flags); - - ck_assert_msg(last_msg.msg.vel_ecef_cov_gnss.n_sats == 21, "incorrect value for last_msg.msg.vel_ecef_cov_gnss.n_sats, expected 21, is %d", last_msg.msg.vel_ecef_cov_gnss.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef_cov_gnss.tow == 501868000, "incorrect value for last_msg.msg.vel_ecef_cov_gnss.tow, expected 501868000, is %d", last_msg.msg.vel_ecef_cov_gnss.tow); - - ck_assert_msg(last_msg.msg.vel_ecef_cov_gnss.x == -3, "incorrect value for last_msg.msg.vel_ecef_cov_gnss.x, expected -3, is %d", last_msg.msg.vel_ecef_cov_gnss.x); - - ck_assert_msg(last_msg.msg.vel_ecef_cov_gnss.y == 1, "incorrect value for last_msg.msg.vel_ecef_cov_gnss.y, expected 1, is %d", last_msg.msg.vel_ecef_cov_gnss.y); - - ck_assert_msg(last_msg.msg.vel_ecef_cov_gnss.z == 4, "incorrect value for last_msg.msg.vel_ecef_cov_gnss.z, expected 4, is %d", last_msg.msg.vel_ecef_cov_gnss.z); + ck_assert_msg((last_msg.msg.vel_ecef_cov_gnss.cov_x_x * 100 - + 0.00245476840064 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ecef_cov_gnss.cov_x_x, " + "expected 0.00245476840064, is %s", + last_msg.msg.vel_ecef_cov_gnss.cov_x_x); + + ck_assert_msg((last_msg.msg.vel_ecef_cov_gnss.cov_x_y * 100 - + 0.00217951089144 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ecef_cov_gnss.cov_x_y, " + "expected 0.00217951089144, is %s", + last_msg.msg.vel_ecef_cov_gnss.cov_x_y); + + ck_assert_msg((last_msg.msg.vel_ecef_cov_gnss.cov_x_z * 100 - + -0.00168286520056 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ecef_cov_gnss.cov_x_z, " + "expected -0.00168286520056, is %s", + last_msg.msg.vel_ecef_cov_gnss.cov_x_z); + + ck_assert_msg((last_msg.msg.vel_ecef_cov_gnss.cov_y_y * 100 - + 0.00421894481406 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ecef_cov_gnss.cov_y_y, " + "expected 0.00421894481406, is %s", + last_msg.msg.vel_ecef_cov_gnss.cov_y_y); + + ck_assert_msg((last_msg.msg.vel_ecef_cov_gnss.cov_y_z * 100 - + -0.0024961293675 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ecef_cov_gnss.cov_y_z, " + "expected -0.0024961293675, is %s", + last_msg.msg.vel_ecef_cov_gnss.cov_y_z); + + ck_assert_msg((last_msg.msg.vel_ecef_cov_gnss.cov_z_z * 100 - + 0.00378042715602 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ecef_cov_gnss.cov_z_z, " + "expected 0.00378042715602, is %s", + last_msg.msg.vel_ecef_cov_gnss.cov_z_z); + + ck_assert_msg(last_msg.msg.vel_ecef_cov_gnss.flags == 2, + "incorrect value for last_msg.msg.vel_ecef_cov_gnss.flags, " + "expected 2, is %d", + last_msg.msg.vel_ecef_cov_gnss.flags); + + ck_assert_msg(last_msg.msg.vel_ecef_cov_gnss.n_sats == 21, + "incorrect value for last_msg.msg.vel_ecef_cov_gnss.n_sats, " + "expected 21, is %d", + last_msg.msg.vel_ecef_cov_gnss.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef_cov_gnss.tow == 501868000, + "incorrect value for last_msg.msg.vel_ecef_cov_gnss.tow, " + "expected 501868000, is %d", + last_msg.msg.vel_ecef_cov_gnss.tow); + + ck_assert_msg(last_msg.msg.vel_ecef_cov_gnss.x == -3, + "incorrect value for last_msg.msg.vel_ecef_cov_gnss.x, " + "expected -3, is %d", + last_msg.msg.vel_ecef_cov_gnss.x); + + ck_assert_msg(last_msg.msg.vel_ecef_cov_gnss.y == 1, + "incorrect value for last_msg.msg.vel_ecef_cov_gnss.y, " + "expected 1, is %d", + last_msg.msg.vel_ecef_cov_gnss.y); + + ck_assert_msg(last_msg.msg.vel_ecef_cov_gnss.z == 4, + "incorrect value for last_msg.msg.vel_ecef_cov_gnss.z, " + "expected 4, is %d", + last_msg.msg.vel_ecef_cov_gnss.z); } } END_TEST -Suite* auto_check_sbp_navigation_MsgVelEcefCovGnss_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgVelEcefCovGnss"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelEcefCovGnss"); +Suite *auto_check_sbp_navigation_MsgVelEcefCovGnss_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgVelEcefCovGnss"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_navigation_MsgVelEcefCovGnss"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgVelEcefCovGnss); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgVelEcefGnss.c b/c/test/auto_check_sbp_navigation_MsgVelEcefGnss.c index 69c296a73..255c7c375 100644 --- a/c/test/auto_check_sbp_navigation_MsgVelEcefGnss.c +++ b/c/test/auto_check_sbp_navigation_MsgVelEcefGnss.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefGnss.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgVelEcefGnss ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgVelEcefGnss) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelEcefGnss ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,71 +90,100 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelEcefGnss ) logging_reset(); - sbp_callback_register(&sbp_state, 0x22d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x22d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,45,2,0,16,20,224,229,233,29,253,255,255,255,1,0,0,0,4,0,0,0,89,0,21,2,205,16, }; + u8 encoded_frame[] = { + 85, 45, 2, 0, 16, 20, 224, 229, 233, 29, 253, 255, 255, 255, + 1, 0, 0, 0, 4, 0, 0, 0, 89, 0, 21, 2, 205, 16, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ecef_gnss.accuracy = 89; - + test_msg.vel_ecef_gnss.flags = 2; - + test_msg.vel_ecef_gnss.n_sats = 21; - + test_msg.vel_ecef_gnss.tow = 501868000; - + test_msg.vel_ecef_gnss.x = -3; - + test_msg.vel_ecef_gnss.y = 1; - + test_msg.vel_ecef_gnss.z = 4; - sbp_message_send(&sbp_state, SbpMsgVelEcefGnss, 4096, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelEcefGnss, 4096, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelEcefGnss, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelEcefGnss, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ecef_gnss.accuracy == 89, "incorrect value for last_msg.msg.vel_ecef_gnss.accuracy, expected 89, is %d", last_msg.msg.vel_ecef_gnss.accuracy); - - ck_assert_msg(last_msg.msg.vel_ecef_gnss.flags == 2, "incorrect value for last_msg.msg.vel_ecef_gnss.flags, expected 2, is %d", last_msg.msg.vel_ecef_gnss.flags); - - ck_assert_msg(last_msg.msg.vel_ecef_gnss.n_sats == 21, "incorrect value for last_msg.msg.vel_ecef_gnss.n_sats, expected 21, is %d", last_msg.msg.vel_ecef_gnss.n_sats); - - ck_assert_msg(last_msg.msg.vel_ecef_gnss.tow == 501868000, "incorrect value for last_msg.msg.vel_ecef_gnss.tow, expected 501868000, is %d", last_msg.msg.vel_ecef_gnss.tow); - - ck_assert_msg(last_msg.msg.vel_ecef_gnss.x == -3, "incorrect value for last_msg.msg.vel_ecef_gnss.x, expected -3, is %d", last_msg.msg.vel_ecef_gnss.x); - - ck_assert_msg(last_msg.msg.vel_ecef_gnss.y == 1, "incorrect value for last_msg.msg.vel_ecef_gnss.y, expected 1, is %d", last_msg.msg.vel_ecef_gnss.y); - - ck_assert_msg(last_msg.msg.vel_ecef_gnss.z == 4, "incorrect value for last_msg.msg.vel_ecef_gnss.z, expected 4, is %d", last_msg.msg.vel_ecef_gnss.z); + ck_assert_msg(last_msg.msg.vel_ecef_gnss.accuracy == 89, + "incorrect value for last_msg.msg.vel_ecef_gnss.accuracy, " + "expected 89, is %d", + last_msg.msg.vel_ecef_gnss.accuracy); + + ck_assert_msg(last_msg.msg.vel_ecef_gnss.flags == 2, + "incorrect value for last_msg.msg.vel_ecef_gnss.flags, " + "expected 2, is %d", + last_msg.msg.vel_ecef_gnss.flags); + + ck_assert_msg(last_msg.msg.vel_ecef_gnss.n_sats == 21, + "incorrect value for last_msg.msg.vel_ecef_gnss.n_sats, " + "expected 21, is %d", + last_msg.msg.vel_ecef_gnss.n_sats); + + ck_assert_msg(last_msg.msg.vel_ecef_gnss.tow == 501868000, + "incorrect value for last_msg.msg.vel_ecef_gnss.tow, " + "expected 501868000, is %d", + last_msg.msg.vel_ecef_gnss.tow); + + ck_assert_msg( + last_msg.msg.vel_ecef_gnss.x == -3, + "incorrect value for last_msg.msg.vel_ecef_gnss.x, expected -3, is %d", + last_msg.msg.vel_ecef_gnss.x); + + ck_assert_msg( + last_msg.msg.vel_ecef_gnss.y == 1, + "incorrect value for last_msg.msg.vel_ecef_gnss.y, expected 1, is %d", + last_msg.msg.vel_ecef_gnss.y); + + ck_assert_msg( + last_msg.msg.vel_ecef_gnss.z == 4, + "incorrect value for last_msg.msg.vel_ecef_gnss.z, expected 4, is %d", + last_msg.msg.vel_ecef_gnss.z); } } END_TEST -Suite* auto_check_sbp_navigation_MsgVelEcefGnss_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgVelEcefGnss"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelEcefGnss"); +Suite *auto_check_sbp_navigation_MsgVelEcefGnss_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgVelEcefGnss"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelEcefGnss"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgVelEcefGnss); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgVelNED.c b/c/test/auto_check_sbp_navigation_MsgVelNED.c index 6da175df0..8f038abd6 100644 --- a/c/test/auto_check_sbp_navigation_MsgVelNED.c +++ b/c/test/auto_check_sbp_navigation_MsgVelNED.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNED.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNED.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgVelNED ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgVelNED) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNED ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,72 +90,102 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNED ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,14,2,211,136,22,40,244,122,19,3,0,0,0,252,255,255,255,243,255,255,255,0,0,0,0,14,0,86,209, }; + u8 encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 40, 244, 122, 19, 3, 0, 0, 0, 252, + 255, 255, 255, 243, 255, 255, 255, 0, 0, 0, 0, 14, 0, 86, 209, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned.d = -13; - + test_msg.vel_ned.e = -4; - + test_msg.vel_ned.flags = 0; - + test_msg.vel_ned.h_accuracy = 0; - + test_msg.vel_ned.n = 3; - + test_msg.vel_ned.n_sats = 14; - + test_msg.vel_ned.tow = 326825000; - + test_msg.vel_ned.v_accuracy = 0; sbp_message_send(&sbp_state, SbpMsgVelNed, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgVelNed, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned.d == -13, "incorrect value for last_msg.msg.vel_ned.d, expected -13, is %d", last_msg.msg.vel_ned.d); - - ck_assert_msg(last_msg.msg.vel_ned.e == -4, "incorrect value for last_msg.msg.vel_ned.e, expected -4, is %d", last_msg.msg.vel_ned.e); - - ck_assert_msg(last_msg.msg.vel_ned.flags == 0, "incorrect value for last_msg.msg.vel_ned.flags, expected 0, is %d", last_msg.msg.vel_ned.flags); - - ck_assert_msg(last_msg.msg.vel_ned.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned.n == 3, "incorrect value for last_msg.msg.vel_ned.n, expected 3, is %d", last_msg.msg.vel_ned.n); - - ck_assert_msg(last_msg.msg.vel_ned.n_sats == 14, "incorrect value for last_msg.msg.vel_ned.n_sats, expected 14, is %d", last_msg.msg.vel_ned.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned.tow == 326825000, "incorrect value for last_msg.msg.vel_ned.tow, expected 326825000, is %d", last_msg.msg.vel_ned.tow); - - ck_assert_msg(last_msg.msg.vel_ned.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned.v_accuracy); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.vel_ned.d == -13, + "incorrect value for last_msg.msg.vel_ned.d, expected -13, is %d", + last_msg.msg.vel_ned.d); + + ck_assert_msg( + last_msg.msg.vel_ned.e == -4, + "incorrect value for last_msg.msg.vel_ned.e, expected -4, is %d", + last_msg.msg.vel_ned.e); + + ck_assert_msg( + last_msg.msg.vel_ned.flags == 0, + "incorrect value for last_msg.msg.vel_ned.flags, expected 0, is %d", + last_msg.msg.vel_ned.flags); + + ck_assert_msg(last_msg.msg.vel_ned.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned.h_accuracy); + + ck_assert_msg( + last_msg.msg.vel_ned.n == 3, + "incorrect value for last_msg.msg.vel_ned.n, expected 3, is %d", + last_msg.msg.vel_ned.n); + + ck_assert_msg( + last_msg.msg.vel_ned.n_sats == 14, + "incorrect value for last_msg.msg.vel_ned.n_sats, expected 14, is %d", + last_msg.msg.vel_ned.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned.tow == 326825000, + "incorrect value for last_msg.msg.vel_ned.tow, expected " + "326825000, is %d", + last_msg.msg.vel_ned.tow); + + ck_assert_msg(last_msg.msg.vel_ned.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -167,72 +193,103 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNED ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,14,2,211,136,22,28,246,122,19,252,255,255,255,255,255,255,255,232,255,255,255,0,0,0,0,15,0,16,228, }; + u8 encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 28, 246, 122, 19, + 252, 255, 255, 255, 255, 255, 255, 255, 232, 255, + 255, 255, 0, 0, 0, 0, 15, 0, 16, 228, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned.d = -24; - + test_msg.vel_ned.e = -1; - + test_msg.vel_ned.flags = 0; - + test_msg.vel_ned.h_accuracy = 0; - + test_msg.vel_ned.n = -4; - + test_msg.vel_ned.n_sats = 15; - + test_msg.vel_ned.tow = 326825500; - + test_msg.vel_ned.v_accuracy = 0; sbp_message_send(&sbp_state, SbpMsgVelNed, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgVelNed, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned.d == -24, "incorrect value for last_msg.msg.vel_ned.d, expected -24, is %d", last_msg.msg.vel_ned.d); - - ck_assert_msg(last_msg.msg.vel_ned.e == -1, "incorrect value for last_msg.msg.vel_ned.e, expected -1, is %d", last_msg.msg.vel_ned.e); - - ck_assert_msg(last_msg.msg.vel_ned.flags == 0, "incorrect value for last_msg.msg.vel_ned.flags, expected 0, is %d", last_msg.msg.vel_ned.flags); - - ck_assert_msg(last_msg.msg.vel_ned.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned.n == -4, "incorrect value for last_msg.msg.vel_ned.n, expected -4, is %d", last_msg.msg.vel_ned.n); - - ck_assert_msg(last_msg.msg.vel_ned.n_sats == 15, "incorrect value for last_msg.msg.vel_ned.n_sats, expected 15, is %d", last_msg.msg.vel_ned.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned.tow == 326825500, "incorrect value for last_msg.msg.vel_ned.tow, expected 326825500, is %d", last_msg.msg.vel_ned.tow); - - ck_assert_msg(last_msg.msg.vel_ned.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned.v_accuracy); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.vel_ned.d == -24, + "incorrect value for last_msg.msg.vel_ned.d, expected -24, is %d", + last_msg.msg.vel_ned.d); + + ck_assert_msg( + last_msg.msg.vel_ned.e == -1, + "incorrect value for last_msg.msg.vel_ned.e, expected -1, is %d", + last_msg.msg.vel_ned.e); + + ck_assert_msg( + last_msg.msg.vel_ned.flags == 0, + "incorrect value for last_msg.msg.vel_ned.flags, expected 0, is %d", + last_msg.msg.vel_ned.flags); + + ck_assert_msg(last_msg.msg.vel_ned.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned.h_accuracy); + + ck_assert_msg( + last_msg.msg.vel_ned.n == -4, + "incorrect value for last_msg.msg.vel_ned.n, expected -4, is %d", + last_msg.msg.vel_ned.n); + + ck_assert_msg( + last_msg.msg.vel_ned.n_sats == 15, + "incorrect value for last_msg.msg.vel_ned.n_sats, expected 15, is %d", + last_msg.msg.vel_ned.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned.tow == 326825500, + "incorrect value for last_msg.msg.vel_ned.tow, expected " + "326825500, is %d", + last_msg.msg.vel_ned.tow); + + ck_assert_msg(last_msg.msg.vel_ned.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -240,72 +297,102 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNED ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,14,2,211,136,22,16,248,122,19,0,0,0,0,253,255,255,255,244,255,255,255,0,0,0,0,15,0,11,164, }; + u8 encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 16, 248, 122, 19, 0, 0, 0, 0, 253, + 255, 255, 255, 244, 255, 255, 255, 0, 0, 0, 0, 15, 0, 11, 164, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned.d = -12; - + test_msg.vel_ned.e = -3; - + test_msg.vel_ned.flags = 0; - + test_msg.vel_ned.h_accuracy = 0; - + test_msg.vel_ned.n = 0; - + test_msg.vel_ned.n_sats = 15; - + test_msg.vel_ned.tow = 326826000; - + test_msg.vel_ned.v_accuracy = 0; sbp_message_send(&sbp_state, SbpMsgVelNed, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgVelNed, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned.d == -12, "incorrect value for last_msg.msg.vel_ned.d, expected -12, is %d", last_msg.msg.vel_ned.d); - - ck_assert_msg(last_msg.msg.vel_ned.e == -3, "incorrect value for last_msg.msg.vel_ned.e, expected -3, is %d", last_msg.msg.vel_ned.e); - - ck_assert_msg(last_msg.msg.vel_ned.flags == 0, "incorrect value for last_msg.msg.vel_ned.flags, expected 0, is %d", last_msg.msg.vel_ned.flags); - - ck_assert_msg(last_msg.msg.vel_ned.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned.n == 0, "incorrect value for last_msg.msg.vel_ned.n, expected 0, is %d", last_msg.msg.vel_ned.n); - - ck_assert_msg(last_msg.msg.vel_ned.n_sats == 15, "incorrect value for last_msg.msg.vel_ned.n_sats, expected 15, is %d", last_msg.msg.vel_ned.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned.tow == 326826000, "incorrect value for last_msg.msg.vel_ned.tow, expected 326826000, is %d", last_msg.msg.vel_ned.tow); - - ck_assert_msg(last_msg.msg.vel_ned.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned.v_accuracy); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.vel_ned.d == -12, + "incorrect value for last_msg.msg.vel_ned.d, expected -12, is %d", + last_msg.msg.vel_ned.d); + + ck_assert_msg( + last_msg.msg.vel_ned.e == -3, + "incorrect value for last_msg.msg.vel_ned.e, expected -3, is %d", + last_msg.msg.vel_ned.e); + + ck_assert_msg( + last_msg.msg.vel_ned.flags == 0, + "incorrect value for last_msg.msg.vel_ned.flags, expected 0, is %d", + last_msg.msg.vel_ned.flags); + + ck_assert_msg(last_msg.msg.vel_ned.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned.h_accuracy); + + ck_assert_msg( + last_msg.msg.vel_ned.n == 0, + "incorrect value for last_msg.msg.vel_ned.n, expected 0, is %d", + last_msg.msg.vel_ned.n); + + ck_assert_msg( + last_msg.msg.vel_ned.n_sats == 15, + "incorrect value for last_msg.msg.vel_ned.n_sats, expected 15, is %d", + last_msg.msg.vel_ned.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned.tow == 326826000, + "incorrect value for last_msg.msg.vel_ned.tow, expected " + "326826000, is %d", + last_msg.msg.vel_ned.tow); + + ck_assert_msg(last_msg.msg.vel_ned.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -313,72 +400,102 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNED ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,14,2,211,136,22,4,250,122,19,2,0,0,0,3,0,0,0,232,255,255,255,0,0,0,0,15,0,152,208, }; + u8 encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 4, 250, 122, 19, 2, 0, 0, 0, 3, + 0, 0, 0, 232, 255, 255, 255, 0, 0, 0, 0, 15, 0, 152, 208, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned.d = -24; - + test_msg.vel_ned.e = 3; - + test_msg.vel_ned.flags = 0; - + test_msg.vel_ned.h_accuracy = 0; - + test_msg.vel_ned.n = 2; - + test_msg.vel_ned.n_sats = 15; - + test_msg.vel_ned.tow = 326826500; - + test_msg.vel_ned.v_accuracy = 0; sbp_message_send(&sbp_state, SbpMsgVelNed, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgVelNed, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned.d == -24, "incorrect value for last_msg.msg.vel_ned.d, expected -24, is %d", last_msg.msg.vel_ned.d); - - ck_assert_msg(last_msg.msg.vel_ned.e == 3, "incorrect value for last_msg.msg.vel_ned.e, expected 3, is %d", last_msg.msg.vel_ned.e); - - ck_assert_msg(last_msg.msg.vel_ned.flags == 0, "incorrect value for last_msg.msg.vel_ned.flags, expected 0, is %d", last_msg.msg.vel_ned.flags); - - ck_assert_msg(last_msg.msg.vel_ned.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned.n == 2, "incorrect value for last_msg.msg.vel_ned.n, expected 2, is %d", last_msg.msg.vel_ned.n); - - ck_assert_msg(last_msg.msg.vel_ned.n_sats == 15, "incorrect value for last_msg.msg.vel_ned.n_sats, expected 15, is %d", last_msg.msg.vel_ned.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned.tow == 326826500, "incorrect value for last_msg.msg.vel_ned.tow, expected 326826500, is %d", last_msg.msg.vel_ned.tow); - - ck_assert_msg(last_msg.msg.vel_ned.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned.v_accuracy); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.vel_ned.d == -24, + "incorrect value for last_msg.msg.vel_ned.d, expected -24, is %d", + last_msg.msg.vel_ned.d); + + ck_assert_msg( + last_msg.msg.vel_ned.e == 3, + "incorrect value for last_msg.msg.vel_ned.e, expected 3, is %d", + last_msg.msg.vel_ned.e); + + ck_assert_msg( + last_msg.msg.vel_ned.flags == 0, + "incorrect value for last_msg.msg.vel_ned.flags, expected 0, is %d", + last_msg.msg.vel_ned.flags); + + ck_assert_msg(last_msg.msg.vel_ned.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned.h_accuracy); + + ck_assert_msg( + last_msg.msg.vel_ned.n == 2, + "incorrect value for last_msg.msg.vel_ned.n, expected 2, is %d", + last_msg.msg.vel_ned.n); + + ck_assert_msg( + last_msg.msg.vel_ned.n_sats == 15, + "incorrect value for last_msg.msg.vel_ned.n_sats, expected 15, is %d", + last_msg.msg.vel_ned.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned.tow == 326826500, + "incorrect value for last_msg.msg.vel_ned.tow, expected " + "326826500, is %d", + last_msg.msg.vel_ned.tow); + + ck_assert_msg(last_msg.msg.vel_ned.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -386,75 +503,105 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNED ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,14,2,211,136,22,248,251,122,19,1,0,0,0,0,0,0,0,235,255,255,255,0,0,0,0,15,0,182,120, }; + u8 encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 248, 251, 122, 19, 1, 0, 0, 0, 0, + 0, 0, 0, 235, 255, 255, 255, 0, 0, 0, 0, 15, 0, 182, 120, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned.d = -21; - + test_msg.vel_ned.e = 0; - + test_msg.vel_ned.flags = 0; - + test_msg.vel_ned.h_accuracy = 0; - + test_msg.vel_ned.n = 1; - + test_msg.vel_ned.n_sats = 15; - + test_msg.vel_ned.tow = 326827000; - + test_msg.vel_ned.v_accuracy = 0; sbp_message_send(&sbp_state, SbpMsgVelNed, 35027, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgVelNed, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned.d == -21, "incorrect value for last_msg.msg.vel_ned.d, expected -21, is %d", last_msg.msg.vel_ned.d); - - ck_assert_msg(last_msg.msg.vel_ned.e == 0, "incorrect value for last_msg.msg.vel_ned.e, expected 0, is %d", last_msg.msg.vel_ned.e); - - ck_assert_msg(last_msg.msg.vel_ned.flags == 0, "incorrect value for last_msg.msg.vel_ned.flags, expected 0, is %d", last_msg.msg.vel_ned.flags); - - ck_assert_msg(last_msg.msg.vel_ned.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned.n == 1, "incorrect value for last_msg.msg.vel_ned.n, expected 1, is %d", last_msg.msg.vel_ned.n); - - ck_assert_msg(last_msg.msg.vel_ned.n_sats == 15, "incorrect value for last_msg.msg.vel_ned.n_sats, expected 15, is %d", last_msg.msg.vel_ned.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned.tow == 326827000, "incorrect value for last_msg.msg.vel_ned.tow, expected 326827000, is %d", last_msg.msg.vel_ned.tow); - - ck_assert_msg(last_msg.msg.vel_ned.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned.v_accuracy); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.vel_ned.d == -21, + "incorrect value for last_msg.msg.vel_ned.d, expected -21, is %d", + last_msg.msg.vel_ned.d); + + ck_assert_msg( + last_msg.msg.vel_ned.e == 0, + "incorrect value for last_msg.msg.vel_ned.e, expected 0, is %d", + last_msg.msg.vel_ned.e); + + ck_assert_msg( + last_msg.msg.vel_ned.flags == 0, + "incorrect value for last_msg.msg.vel_ned.flags, expected 0, is %d", + last_msg.msg.vel_ned.flags); + + ck_assert_msg(last_msg.msg.vel_ned.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned.h_accuracy); + + ck_assert_msg( + last_msg.msg.vel_ned.n == 1, + "incorrect value for last_msg.msg.vel_ned.n, expected 1, is %d", + last_msg.msg.vel_ned.n); + + ck_assert_msg( + last_msg.msg.vel_ned.n_sats == 15, + "incorrect value for last_msg.msg.vel_ned.n_sats, expected 15, is %d", + last_msg.msg.vel_ned.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned.tow == 326827000, + "incorrect value for last_msg.msg.vel_ned.tow, expected " + "326827000, is %d", + last_msg.msg.vel_ned.tow); + + ck_assert_msg(last_msg.msg.vel_ned.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned.v_accuracy); } } END_TEST -Suite* auto_check_sbp_navigation_MsgVelNED_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgVelNED"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelNED"); +Suite *auto_check_sbp_navigation_MsgVelNED_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgVelNED"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelNED"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgVelNED); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgVelNEDCOV.c b/c/test/auto_check_sbp_navigation_MsgVelNEDCOV.c index 7ff82e926..f36f83398 100644 --- a/c/test/auto_check_sbp_navigation_MsgVelNEDCOV.c +++ b/c/test/auto_check_sbp_navigation_MsgVelNEDCOV.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDCOV.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDCOV.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgVelNEDCOV ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgVelNEDCOV) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNEDCOV ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,91 +90,135 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNEDCOV ) logging_reset(); - sbp_callback_register(&sbp_state, 0x212, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x212, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,18,2,66,0,42,100,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,10,0,88,205, }; + u8 encoded_frame[] = { + 85, 18, 2, 66, 0, 42, 100, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, 10, 0, 88, 205, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned_cov.cov_d_d = 1.0; - + test_msg.vel_ned_cov.cov_e_d = 1.0; - + test_msg.vel_ned_cov.cov_e_e = 1.0; - + test_msg.vel_ned_cov.cov_n_d = 1.0; - + test_msg.vel_ned_cov.cov_n_e = 1.0; - + test_msg.vel_ned_cov.cov_n_n = 1.0; - + test_msg.vel_ned_cov.d = 1; - + test_msg.vel_ned_cov.e = 1; - + test_msg.vel_ned_cov.flags = 0; - + test_msg.vel_ned_cov.n = 1; - + test_msg.vel_ned_cov.n_sats = 10; - + test_msg.vel_ned_cov.tow = 100; sbp_message_send(&sbp_state, SbpMsgVelNedCov, 66, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelNedCov, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelNedCov, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.vel_ned_cov.cov_d_d * 100 - 1.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ned_cov.cov_d_d, expected 1.0, is %s", last_msg.msg.vel_ned_cov.cov_d_d); - - ck_assert_msg((last_msg.msg.vel_ned_cov.cov_e_d * 100 - 1.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ned_cov.cov_e_d, expected 1.0, is %s", last_msg.msg.vel_ned_cov.cov_e_d); - - ck_assert_msg((last_msg.msg.vel_ned_cov.cov_e_e * 100 - 1.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ned_cov.cov_e_e, expected 1.0, is %s", last_msg.msg.vel_ned_cov.cov_e_e); - - ck_assert_msg((last_msg.msg.vel_ned_cov.cov_n_d * 100 - 1.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ned_cov.cov_n_d, expected 1.0, is %s", last_msg.msg.vel_ned_cov.cov_n_d); - - ck_assert_msg((last_msg.msg.vel_ned_cov.cov_n_e * 100 - 1.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ned_cov.cov_n_e, expected 1.0, is %s", last_msg.msg.vel_ned_cov.cov_n_e); - - ck_assert_msg((last_msg.msg.vel_ned_cov.cov_n_n * 100 - 1.0 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ned_cov.cov_n_n, expected 1.0, is %s", last_msg.msg.vel_ned_cov.cov_n_n); - - ck_assert_msg(last_msg.msg.vel_ned_cov.d == 1, "incorrect value for last_msg.msg.vel_ned_cov.d, expected 1, is %d", last_msg.msg.vel_ned_cov.d); - - ck_assert_msg(last_msg.msg.vel_ned_cov.e == 1, "incorrect value for last_msg.msg.vel_ned_cov.e, expected 1, is %d", last_msg.msg.vel_ned_cov.e); - - ck_assert_msg(last_msg.msg.vel_ned_cov.flags == 0, "incorrect value for last_msg.msg.vel_ned_cov.flags, expected 0, is %d", last_msg.msg.vel_ned_cov.flags); - - ck_assert_msg(last_msg.msg.vel_ned_cov.n == 1, "incorrect value for last_msg.msg.vel_ned_cov.n, expected 1, is %d", last_msg.msg.vel_ned_cov.n); - - ck_assert_msg(last_msg.msg.vel_ned_cov.n_sats == 10, "incorrect value for last_msg.msg.vel_ned_cov.n_sats, expected 10, is %d", last_msg.msg.vel_ned_cov.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned_cov.tow == 100, "incorrect value for last_msg.msg.vel_ned_cov.tow, expected 100, is %d", last_msg.msg.vel_ned_cov.tow); + ck_assert_msg((last_msg.msg.vel_ned_cov.cov_d_d * 100 - 1.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ned_cov.cov_d_d, " + "expected 1.0, is %s", + last_msg.msg.vel_ned_cov.cov_d_d); + + ck_assert_msg((last_msg.msg.vel_ned_cov.cov_e_d * 100 - 1.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ned_cov.cov_e_d, " + "expected 1.0, is %s", + last_msg.msg.vel_ned_cov.cov_e_d); + + ck_assert_msg((last_msg.msg.vel_ned_cov.cov_e_e * 100 - 1.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ned_cov.cov_e_e, " + "expected 1.0, is %s", + last_msg.msg.vel_ned_cov.cov_e_e); + + ck_assert_msg((last_msg.msg.vel_ned_cov.cov_n_d * 100 - 1.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ned_cov.cov_n_d, " + "expected 1.0, is %s", + last_msg.msg.vel_ned_cov.cov_n_d); + + ck_assert_msg((last_msg.msg.vel_ned_cov.cov_n_e * 100 - 1.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ned_cov.cov_n_e, " + "expected 1.0, is %s", + last_msg.msg.vel_ned_cov.cov_n_e); + + ck_assert_msg((last_msg.msg.vel_ned_cov.cov_n_n * 100 - 1.0 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ned_cov.cov_n_n, " + "expected 1.0, is %s", + last_msg.msg.vel_ned_cov.cov_n_n); + + ck_assert_msg( + last_msg.msg.vel_ned_cov.d == 1, + "incorrect value for last_msg.msg.vel_ned_cov.d, expected 1, is %d", + last_msg.msg.vel_ned_cov.d); + + ck_assert_msg( + last_msg.msg.vel_ned_cov.e == 1, + "incorrect value for last_msg.msg.vel_ned_cov.e, expected 1, is %d", + last_msg.msg.vel_ned_cov.e); + + ck_assert_msg( + last_msg.msg.vel_ned_cov.flags == 0, + "incorrect value for last_msg.msg.vel_ned_cov.flags, expected 0, is %d", + last_msg.msg.vel_ned_cov.flags); + + ck_assert_msg( + last_msg.msg.vel_ned_cov.n == 1, + "incorrect value for last_msg.msg.vel_ned_cov.n, expected 1, is %d", + last_msg.msg.vel_ned_cov.n); + + ck_assert_msg(last_msg.msg.vel_ned_cov.n_sats == 10, + "incorrect value for last_msg.msg.vel_ned_cov.n_sats, " + "expected 10, is %d", + last_msg.msg.vel_ned_cov.n_sats); + + ck_assert_msg( + last_msg.msg.vel_ned_cov.tow == 100, + "incorrect value for last_msg.msg.vel_ned_cov.tow, expected 100, is %d", + last_msg.msg.vel_ned_cov.tow); } } END_TEST -Suite* auto_check_sbp_navigation_MsgVelNEDCOV_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgVelNEDCOV"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelNEDCOV"); +Suite *auto_check_sbp_navigation_MsgVelNEDCOV_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgVelNEDCOV"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelNEDCOV"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgVelNEDCOV); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgVelNEDDepA.c b/c/test/auto_check_sbp_navigation_MsgVelNEDDepA.c index 4882fac4c..9544ad786 100644 --- a/c/test/auto_check_sbp_navigation_MsgVelNEDDepA.c +++ b/c/test/auto_check_sbp_navigation_MsgVelNEDDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgVelNEDDepA ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgVelNEDDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNEDDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,72 +90,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,2,246,215,22,20,46,39,0,198,251,255,255,156,15,0,0,0,0,0,0,0,0,0,0,9,0,161,92, }; + u8 encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 20, 46, 39, 0, 198, 251, 255, 255, 156, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 161, 92, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned_dep_a.d = 0; - + test_msg.vel_ned_dep_a.e = 3996; - + test_msg.vel_ned_dep_a.flags = 0; - + test_msg.vel_ned_dep_a.h_accuracy = 0; - + test_msg.vel_ned_dep_a.n = -1082; - + test_msg.vel_ned_dep_a.n_sats = 9; - + test_msg.vel_ned_dep_a.tow = 2567700; - + test_msg.vel_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.d == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected 0, is %d", last_msg.msg.vel_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == 3996, "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected 3996, is %d", last_msg.msg.vel_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == -1082, "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected -1082, is %d", last_msg.msg.vel_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 9, "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, expected 9, is %d", last_msg.msg.vel_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 2567700, "incorrect value for last_msg.msg.vel_ned_dep_a.tow, expected 2567700, is %d", last_msg.msg.vel_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.v_accuracy); + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.d == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected 0, is %d", + last_msg.msg.vel_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == 3996, + "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected " + "3996, is %d", + last_msg.msg.vel_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == -1082, + "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected " + "-1082, is %d", + last_msg.msg.vel_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.vel_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 2567700, + "incorrect value for last_msg.msg.vel_ned_dep_a.tow, " + "expected 2567700, is %d", + last_msg.msg.vel_ned_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -167,72 +195,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,2,246,215,22,120,46,39,0,14,252,255,255,207,14,0,0,0,0,0,0,0,0,0,0,9,0,125,160, }; + u8 encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 120, 46, 39, 0, 14, 252, 255, 255, 207, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 125, 160, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned_dep_a.d = 0; - + test_msg.vel_ned_dep_a.e = 3791; - + test_msg.vel_ned_dep_a.flags = 0; - + test_msg.vel_ned_dep_a.h_accuracy = 0; - + test_msg.vel_ned_dep_a.n = -1010; - + test_msg.vel_ned_dep_a.n_sats = 9; - + test_msg.vel_ned_dep_a.tow = 2567800; - + test_msg.vel_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.d == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected 0, is %d", last_msg.msg.vel_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == 3791, "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected 3791, is %d", last_msg.msg.vel_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == -1010, "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected -1010, is %d", last_msg.msg.vel_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 9, "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, expected 9, is %d", last_msg.msg.vel_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 2567800, "incorrect value for last_msg.msg.vel_ned_dep_a.tow, expected 2567800, is %d", last_msg.msg.vel_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.v_accuracy); + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.d == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected 0, is %d", + last_msg.msg.vel_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == 3791, + "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected " + "3791, is %d", + last_msg.msg.vel_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == -1010, + "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected " + "-1010, is %d", + last_msg.msg.vel_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.vel_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 2567800, + "incorrect value for last_msg.msg.vel_ned_dep_a.tow, " + "expected 2567800, is %d", + last_msg.msg.vel_ned_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -240,72 +300,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,2,246,215,22,220,46,39,0,48,252,255,255,140,14,0,0,0,0,0,0,0,0,0,0,9,0,179,135, }; + u8 encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 220, 46, 39, 0, 48, 252, 255, 255, 140, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 179, 135, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned_dep_a.d = 0; - + test_msg.vel_ned_dep_a.e = 3724; - + test_msg.vel_ned_dep_a.flags = 0; - + test_msg.vel_ned_dep_a.h_accuracy = 0; - + test_msg.vel_ned_dep_a.n = -976; - + test_msg.vel_ned_dep_a.n_sats = 9; - + test_msg.vel_ned_dep_a.tow = 2567900; - + test_msg.vel_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.d == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected 0, is %d", last_msg.msg.vel_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == 3724, "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected 3724, is %d", last_msg.msg.vel_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == -976, "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected -976, is %d", last_msg.msg.vel_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 9, "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, expected 9, is %d", last_msg.msg.vel_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 2567900, "incorrect value for last_msg.msg.vel_ned_dep_a.tow, expected 2567900, is %d", last_msg.msg.vel_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.v_accuracy); + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.d == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected 0, is %d", + last_msg.msg.vel_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == 3724, + "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected " + "3724, is %d", + last_msg.msg.vel_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == -976, + "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected " + "-976, is %d", + last_msg.msg.vel_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.vel_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 2567900, + "incorrect value for last_msg.msg.vel_ned_dep_a.tow, " + "expected 2567900, is %d", + last_msg.msg.vel_ned_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -313,72 +405,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,2,246,215,22,64,47,39,0,32,252,255,255,8,15,0,0,0,0,0,0,0,0,0,0,9,0,51,177, }; + u8 encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 64, 47, 39, 0, 32, 252, 255, 255, 8, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 51, 177, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned_dep_a.d = 0; - + test_msg.vel_ned_dep_a.e = 3848; - + test_msg.vel_ned_dep_a.flags = 0; - + test_msg.vel_ned_dep_a.h_accuracy = 0; - + test_msg.vel_ned_dep_a.n = -992; - + test_msg.vel_ned_dep_a.n_sats = 9; - + test_msg.vel_ned_dep_a.tow = 2568000; - + test_msg.vel_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.d == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected 0, is %d", last_msg.msg.vel_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == 3848, "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected 3848, is %d", last_msg.msg.vel_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == -992, "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected -992, is %d", last_msg.msg.vel_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 9, "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, expected 9, is %d", last_msg.msg.vel_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 2568000, "incorrect value for last_msg.msg.vel_ned_dep_a.tow, expected 2568000, is %d", last_msg.msg.vel_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.v_accuracy); + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.d == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected 0, is %d", + last_msg.msg.vel_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == 3848, + "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected " + "3848, is %d", + last_msg.msg.vel_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == -992, + "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected " + "-992, is %d", + last_msg.msg.vel_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.vel_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 2568000, + "incorrect value for last_msg.msg.vel_ned_dep_a.tow, " + "expected 2568000, is %d", + last_msg.msg.vel_ned_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -386,72 +510,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,2,246,215,22,164,47,39,0,80,252,255,255,140,14,0,0,0,0,0,0,0,0,0,0,9,0,23,0, }; + u8 encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 164, 47, 39, 0, 80, 252, 255, 255, 140, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 23, 0, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned_dep_a.d = 0; - + test_msg.vel_ned_dep_a.e = 3724; - + test_msg.vel_ned_dep_a.flags = 0; - + test_msg.vel_ned_dep_a.h_accuracy = 0; - + test_msg.vel_ned_dep_a.n = -944; - + test_msg.vel_ned_dep_a.n_sats = 9; - + test_msg.vel_ned_dep_a.tow = 2568100; - + test_msg.vel_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.d == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected 0, is %d", last_msg.msg.vel_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == 3724, "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected 3724, is %d", last_msg.msg.vel_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == -944, "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected -944, is %d", last_msg.msg.vel_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 9, "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, expected 9, is %d", last_msg.msg.vel_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 2568100, "incorrect value for last_msg.msg.vel_ned_dep_a.tow, expected 2568100, is %d", last_msg.msg.vel_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.v_accuracy); + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.d == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected 0, is %d", + last_msg.msg.vel_ned_dep_a.d); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == 3724, + "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected " + "3724, is %d", + last_msg.msg.vel_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.h_accuracy); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == -944, + "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected " + "-944, is %d", + last_msg.msg.vel_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 9, + "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, " + "expected 9, is %d", + last_msg.msg.vel_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 2568100, + "incorrect value for last_msg.msg.vel_ned_dep_a.tow, " + "expected 2568100, is %d", + last_msg.msg.vel_ned_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -459,72 +615,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,2,195,4,22,212,157,67,24,229,255,255,255,26,0,0,0,25,0,0,0,0,0,0,0,8,0,132,25, }; + u8 encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 212, 157, 67, 24, 229, 255, 255, 255, 26, + 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 8, 0, 132, 25, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned_dep_a.d = 25; - + test_msg.vel_ned_dep_a.e = 26; - + test_msg.vel_ned_dep_a.flags = 0; - + test_msg.vel_ned_dep_a.h_accuracy = 0; - + test_msg.vel_ned_dep_a.n = -27; - + test_msg.vel_ned_dep_a.n_sats = 8; - + test_msg.vel_ned_dep_a.tow = 407084500; - + test_msg.vel_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.d == 25, "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected 25, is %d", last_msg.msg.vel_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == 26, "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected 26, is %d", last_msg.msg.vel_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == -27, "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected -27, is %d", last_msg.msg.vel_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 8, "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, expected 8, is %d", last_msg.msg.vel_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 407084500, "incorrect value for last_msg.msg.vel_ned_dep_a.tow, expected 407084500, is %d", last_msg.msg.vel_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.v_accuracy); + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.d == 25, + "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected 25, is %d", + last_msg.msg.vel_ned_dep_a.d); + + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.e == 26, + "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected 26, is %d", + last_msg.msg.vel_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.h_accuracy); + + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.n == -27, + "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected -27, is %d", + last_msg.msg.vel_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.vel_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 407084500, + "incorrect value for last_msg.msg.vel_ned_dep_a.tow, " + "expected 407084500, is %d", + last_msg.msg.vel_ned_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -532,72 +720,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,2,195,4,22,56,158,67,24,4,0,0,0,15,0,0,0,232,255,255,255,0,0,0,0,8,0,42,14, }; + u8 encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 56, 158, 67, 24, 4, 0, 0, 0, 15, + 0, 0, 0, 232, 255, 255, 255, 0, 0, 0, 0, 8, 0, 42, 14, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned_dep_a.d = -24; - + test_msg.vel_ned_dep_a.e = 15; - + test_msg.vel_ned_dep_a.flags = 0; - + test_msg.vel_ned_dep_a.h_accuracy = 0; - + test_msg.vel_ned_dep_a.n = 4; - + test_msg.vel_ned_dep_a.n_sats = 8; - + test_msg.vel_ned_dep_a.tow = 407084600; - + test_msg.vel_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.d == -24, "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected -24, is %d", last_msg.msg.vel_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == 15, "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected 15, is %d", last_msg.msg.vel_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == 4, "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected 4, is %d", last_msg.msg.vel_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 8, "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, expected 8, is %d", last_msg.msg.vel_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 407084600, "incorrect value for last_msg.msg.vel_ned_dep_a.tow, expected 407084600, is %d", last_msg.msg.vel_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.v_accuracy); + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.d == -24, + "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected -24, is %d", + last_msg.msg.vel_ned_dep_a.d); + + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.e == 15, + "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected 15, is %d", + last_msg.msg.vel_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.h_accuracy); + + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.n == 4, + "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected 4, is %d", + last_msg.msg.vel_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.vel_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 407084600, + "incorrect value for last_msg.msg.vel_ned_dep_a.tow, " + "expected 407084600, is %d", + last_msg.msg.vel_ned_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -605,72 +825,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,2,195,4,22,156,158,67,24,251,255,255,255,232,255,255,255,247,255,255,255,0,0,0,0,8,0,218,148, }; + u8 encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 156, 158, 67, 24, 251, 255, 255, 255, 232, + 255, 255, 255, 247, 255, 255, 255, 0, 0, 0, 0, 8, 0, 218, 148, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned_dep_a.d = -9; - + test_msg.vel_ned_dep_a.e = -24; - + test_msg.vel_ned_dep_a.flags = 0; - + test_msg.vel_ned_dep_a.h_accuracy = 0; - + test_msg.vel_ned_dep_a.n = -5; - + test_msg.vel_ned_dep_a.n_sats = 8; - + test_msg.vel_ned_dep_a.tow = 407084700; - + test_msg.vel_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.d == -9, "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected -9, is %d", last_msg.msg.vel_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == -24, "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected -24, is %d", last_msg.msg.vel_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == -5, "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected -5, is %d", last_msg.msg.vel_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 8, "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, expected 8, is %d", last_msg.msg.vel_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 407084700, "incorrect value for last_msg.msg.vel_ned_dep_a.tow, expected 407084700, is %d", last_msg.msg.vel_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.v_accuracy); + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.d == -9, + "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected -9, is %d", + last_msg.msg.vel_ned_dep_a.d); + + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.e == -24, + "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected -24, is %d", + last_msg.msg.vel_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.h_accuracy); + + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.n == -5, + "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected -5, is %d", + last_msg.msg.vel_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.vel_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 407084700, + "incorrect value for last_msg.msg.vel_ned_dep_a.tow, " + "expected 407084700, is %d", + last_msg.msg.vel_ned_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -678,72 +930,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,2,195,4,22,0,159,67,24,10,0,0,0,2,0,0,0,222,255,255,255,0,0,0,0,8,0,148,16, }; + u8 encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 0, 159, 67, 24, 10, 0, 0, 0, 2, + 0, 0, 0, 222, 255, 255, 255, 0, 0, 0, 0, 8, 0, 148, 16, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned_dep_a.d = -34; - + test_msg.vel_ned_dep_a.e = 2; - + test_msg.vel_ned_dep_a.flags = 0; - + test_msg.vel_ned_dep_a.h_accuracy = 0; - + test_msg.vel_ned_dep_a.n = 10; - + test_msg.vel_ned_dep_a.n_sats = 8; - + test_msg.vel_ned_dep_a.tow = 407084800; - + test_msg.vel_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.d == -34, "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected -34, is %d", last_msg.msg.vel_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == 2, "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected 2, is %d", last_msg.msg.vel_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == 10, "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected 10, is %d", last_msg.msg.vel_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 8, "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, expected 8, is %d", last_msg.msg.vel_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 407084800, "incorrect value for last_msg.msg.vel_ned_dep_a.tow, expected 407084800, is %d", last_msg.msg.vel_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.v_accuracy); + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.d == -34, + "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected -34, is %d", + last_msg.msg.vel_ned_dep_a.d); + + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.e == 2, + "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected 2, is %d", + last_msg.msg.vel_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.h_accuracy); + + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.n == 10, + "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected 10, is %d", + last_msg.msg.vel_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.vel_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 407084800, + "incorrect value for last_msg.msg.vel_ned_dep_a.tow, " + "expected 407084800, is %d", + last_msg.msg.vel_ned_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -751,72 +1035,104 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,2,195,4,22,100,159,67,24,248,255,255,255,254,255,255,255,7,0,0,0,0,0,0,0,8,0,255,236, }; + u8 encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 100, 159, 67, 24, 248, 255, 255, 255, 254, + 255, 255, 255, 7, 0, 0, 0, 0, 0, 0, 0, 8, 0, 255, 236, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned_dep_a.d = 7; - + test_msg.vel_ned_dep_a.e = -2; - + test_msg.vel_ned_dep_a.flags = 0; - + test_msg.vel_ned_dep_a.h_accuracy = 0; - + test_msg.vel_ned_dep_a.n = -8; - + test_msg.vel_ned_dep_a.n_sats = 8; - + test_msg.vel_ned_dep_a.tow = 407084900; - + test_msg.vel_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.d == 7, "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected 7, is %d", last_msg.msg.vel_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == -2, "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected -2, is %d", last_msg.msg.vel_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == -8, "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected -8, is %d", last_msg.msg.vel_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 8, "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, expected 8, is %d", last_msg.msg.vel_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 407084900, "incorrect value for last_msg.msg.vel_ned_dep_a.tow, expected 407084900, is %d", last_msg.msg.vel_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.v_accuracy); + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.d == 7, + "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected 7, is %d", + last_msg.msg.vel_ned_dep_a.d); + + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.e == -2, + "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected -2, is %d", + last_msg.msg.vel_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.h_accuracy); + + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.n == -8, + "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected -8, is %d", + last_msg.msg.vel_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 8, + "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, " + "expected 8, is %d", + last_msg.msg.vel_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 407084900, + "incorrect value for last_msg.msg.vel_ned_dep_a.tow, " + "expected 407084900, is %d", + last_msg.msg.vel_ned_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -824,75 +1140,107 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,2,195,4,22,46,162,68,24,255,255,255,255,253,255,255,255,148,255,255,255,0,0,0,0,5,0,166,189, }; + u8 encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 46, 162, 68, 24, 255, 255, 255, 255, 253, + 255, 255, 255, 148, 255, 255, 255, 0, 0, 0, 0, 5, 0, 166, 189, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned_dep_a.d = -108; - + test_msg.vel_ned_dep_a.e = -3; - + test_msg.vel_ned_dep_a.flags = 0; - + test_msg.vel_ned_dep_a.h_accuracy = 0; - + test_msg.vel_ned_dep_a.n = -1; - + test_msg.vel_ned_dep_a.n_sats = 5; - + test_msg.vel_ned_dep_a.tow = 407151150; - + test_msg.vel_ned_dep_a.v_accuracy = 0; - sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelNedDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelNedDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.d == -108, "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected -108, is %d", last_msg.msg.vel_ned_dep_a.d); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.e == -3, "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected -3, is %d", last_msg.msg.vel_ned_dep_a.e); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.flags, expected 0, is %d", last_msg.msg.vel_ned_dep_a.flags); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n == -1, "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected -1, is %d", last_msg.msg.vel_ned_dep_a.n); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 5, "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, expected 5, is %d", last_msg.msg.vel_ned_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 407151150, "incorrect value for last_msg.msg.vel_ned_dep_a.tow, expected 407151150, is %d", last_msg.msg.vel_ned_dep_a.tow); - - ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, expected 0, is %d", last_msg.msg.vel_ned_dep_a.v_accuracy); + ck_assert_msg(last_msg.msg.vel_ned_dep_a.d == -108, + "incorrect value for last_msg.msg.vel_ned_dep_a.d, expected " + "-108, is %d", + last_msg.msg.vel_ned_dep_a.d); + + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.e == -3, + "incorrect value for last_msg.msg.vel_ned_dep_a.e, expected -3, is %d", + last_msg.msg.vel_ned_dep_a.e); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.flags == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.flags, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.flags); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.h_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.h_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.h_accuracy); + + ck_assert_msg( + last_msg.msg.vel_ned_dep_a.n == -1, + "incorrect value for last_msg.msg.vel_ned_dep_a.n, expected -1, is %d", + last_msg.msg.vel_ned_dep_a.n); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.n_sats == 5, + "incorrect value for last_msg.msg.vel_ned_dep_a.n_sats, " + "expected 5, is %d", + last_msg.msg.vel_ned_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.tow == 407151150, + "incorrect value for last_msg.msg.vel_ned_dep_a.tow, " + "expected 407151150, is %d", + last_msg.msg.vel_ned_dep_a.tow); + + ck_assert_msg(last_msg.msg.vel_ned_dep_a.v_accuracy == 0, + "incorrect value for last_msg.msg.vel_ned_dep_a.v_accuracy, " + "expected 0, is %d", + last_msg.msg.vel_ned_dep_a.v_accuracy); } } END_TEST -Suite* auto_check_sbp_navigation_MsgVelNEDDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgVelNEDDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelNEDDepA"); +Suite *auto_check_sbp_navigation_MsgVelNEDDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgVelNEDDepA"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelNEDDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgVelNEDDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgVelNedCovGnss.c b/c/test/auto_check_sbp_navigation_MsgVelNedCovGnss.c index bc048d778..225087138 100644 --- a/c/test/auto_check_sbp_navigation_MsgVelNedCovGnss.c +++ b/c/test/auto_check_sbp_navigation_MsgVelNedCovGnss.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedCovGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedCovGnss.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgVelNedCovGnss ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgVelNedCovGnss) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNedCovGnss ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,91 +90,143 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNedCovGnss ) logging_reset(); - sbp_callback_register(&sbp_state, 0x232, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x232, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,50,2,0,16,42,168,230,233,29,251,255,255,255,0,0,0,0,246,255,255,255,15,58,207,58,248,139,116,55,103,197,57,57,203,186,129,58,109,171,44,57,135,39,1,60,21,2,155,3, }; + u8 encoded_frame[] = { + 85, 50, 2, 0, 16, 42, 168, 230, 233, 29, 251, 255, 255, + 255, 0, 0, 0, 0, 246, 255, 255, 255, 15, 58, 207, 58, + 248, 139, 116, 55, 103, 197, 57, 57, 203, 186, 129, 58, 109, + 171, 44, 57, 135, 39, 1, 60, 21, 2, 155, 3, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned_cov_gnss.cov_d_d = 0.007882959209382534; - + test_msg.vel_ned_cov_gnss.cov_e_d = 0.00016467059322167188; - + test_msg.vel_ned_cov_gnss.cov_e_e = 0.0009897587588056922; - + test_msg.vel_ned_cov_gnss.cov_n_d = 0.00017716512957122177; - + test_msg.vel_ned_cov_gnss.cov_n_e = 1.457612233934924e-05; - + test_msg.vel_ned_cov_gnss.cov_n_n = 0.0015810149488970637; - + test_msg.vel_ned_cov_gnss.d = -10; - + test_msg.vel_ned_cov_gnss.e = 0; - + test_msg.vel_ned_cov_gnss.flags = 2; - + test_msg.vel_ned_cov_gnss.n = -5; - + test_msg.vel_ned_cov_gnss.n_sats = 21; - + test_msg.vel_ned_cov_gnss.tow = 501868200; - sbp_message_send(&sbp_state, SbpMsgVelNedCovGnss, 4096, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelNedCovGnss, 4096, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelNedCovGnss, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelNedCovGnss, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.vel_ned_cov_gnss.cov_d_d * 100 - 0.00788295920938 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ned_cov_gnss.cov_d_d, expected 0.00788295920938, is %s", last_msg.msg.vel_ned_cov_gnss.cov_d_d); - - ck_assert_msg((last_msg.msg.vel_ned_cov_gnss.cov_e_d * 100 - 0.000164670593222 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ned_cov_gnss.cov_e_d, expected 0.000164670593222, is %s", last_msg.msg.vel_ned_cov_gnss.cov_e_d); - - ck_assert_msg((last_msg.msg.vel_ned_cov_gnss.cov_e_e * 100 - 0.000989758758806 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ned_cov_gnss.cov_e_e, expected 0.000989758758806, is %s", last_msg.msg.vel_ned_cov_gnss.cov_e_e); - - ck_assert_msg((last_msg.msg.vel_ned_cov_gnss.cov_n_d * 100 - 0.000177165129571 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ned_cov_gnss.cov_n_d, expected 0.000177165129571, is %s", last_msg.msg.vel_ned_cov_gnss.cov_n_d); - - ck_assert_msg((last_msg.msg.vel_ned_cov_gnss.cov_n_e * 100 - 1.45761223393e-05 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ned_cov_gnss.cov_n_e, expected 1.45761223393e-05, is %s", last_msg.msg.vel_ned_cov_gnss.cov_n_e); - - ck_assert_msg((last_msg.msg.vel_ned_cov_gnss.cov_n_n * 100 - 0.0015810149489 * 100) < 0.05, "incorrect value for last_msg.msg.vel_ned_cov_gnss.cov_n_n, expected 0.0015810149489, is %s", last_msg.msg.vel_ned_cov_gnss.cov_n_n); - - ck_assert_msg(last_msg.msg.vel_ned_cov_gnss.d == -10, "incorrect value for last_msg.msg.vel_ned_cov_gnss.d, expected -10, is %d", last_msg.msg.vel_ned_cov_gnss.d); - - ck_assert_msg(last_msg.msg.vel_ned_cov_gnss.e == 0, "incorrect value for last_msg.msg.vel_ned_cov_gnss.e, expected 0, is %d", last_msg.msg.vel_ned_cov_gnss.e); - - ck_assert_msg(last_msg.msg.vel_ned_cov_gnss.flags == 2, "incorrect value for last_msg.msg.vel_ned_cov_gnss.flags, expected 2, is %d", last_msg.msg.vel_ned_cov_gnss.flags); - - ck_assert_msg(last_msg.msg.vel_ned_cov_gnss.n == -5, "incorrect value for last_msg.msg.vel_ned_cov_gnss.n, expected -5, is %d", last_msg.msg.vel_ned_cov_gnss.n); - - ck_assert_msg(last_msg.msg.vel_ned_cov_gnss.n_sats == 21, "incorrect value for last_msg.msg.vel_ned_cov_gnss.n_sats, expected 21, is %d", last_msg.msg.vel_ned_cov_gnss.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned_cov_gnss.tow == 501868200, "incorrect value for last_msg.msg.vel_ned_cov_gnss.tow, expected 501868200, is %d", last_msg.msg.vel_ned_cov_gnss.tow); + ck_assert_msg((last_msg.msg.vel_ned_cov_gnss.cov_d_d * 100 - + 0.00788295920938 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ned_cov_gnss.cov_d_d, " + "expected 0.00788295920938, is %s", + last_msg.msg.vel_ned_cov_gnss.cov_d_d); + + ck_assert_msg((last_msg.msg.vel_ned_cov_gnss.cov_e_d * 100 - + 0.000164670593222 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ned_cov_gnss.cov_e_d, " + "expected 0.000164670593222, is %s", + last_msg.msg.vel_ned_cov_gnss.cov_e_d); + + ck_assert_msg((last_msg.msg.vel_ned_cov_gnss.cov_e_e * 100 - + 0.000989758758806 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ned_cov_gnss.cov_e_e, " + "expected 0.000989758758806, is %s", + last_msg.msg.vel_ned_cov_gnss.cov_e_e); + + ck_assert_msg((last_msg.msg.vel_ned_cov_gnss.cov_n_d * 100 - + 0.000177165129571 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ned_cov_gnss.cov_n_d, " + "expected 0.000177165129571, is %s", + last_msg.msg.vel_ned_cov_gnss.cov_n_d); + + ck_assert_msg((last_msg.msg.vel_ned_cov_gnss.cov_n_e * 100 - + 1.45761223393e-05 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ned_cov_gnss.cov_n_e, " + "expected 1.45761223393e-05, is %s", + last_msg.msg.vel_ned_cov_gnss.cov_n_e); + + ck_assert_msg((last_msg.msg.vel_ned_cov_gnss.cov_n_n * 100 - + 0.0015810149489 * 100) < 0.05, + "incorrect value for last_msg.msg.vel_ned_cov_gnss.cov_n_n, " + "expected 0.0015810149489, is %s", + last_msg.msg.vel_ned_cov_gnss.cov_n_n); + + ck_assert_msg(last_msg.msg.vel_ned_cov_gnss.d == -10, + "incorrect value for last_msg.msg.vel_ned_cov_gnss.d, " + "expected -10, is %d", + last_msg.msg.vel_ned_cov_gnss.d); + + ck_assert_msg(last_msg.msg.vel_ned_cov_gnss.e == 0, + "incorrect value for last_msg.msg.vel_ned_cov_gnss.e, " + "expected 0, is %d", + last_msg.msg.vel_ned_cov_gnss.e); + + ck_assert_msg(last_msg.msg.vel_ned_cov_gnss.flags == 2, + "incorrect value for last_msg.msg.vel_ned_cov_gnss.flags, " + "expected 2, is %d", + last_msg.msg.vel_ned_cov_gnss.flags); + + ck_assert_msg(last_msg.msg.vel_ned_cov_gnss.n == -5, + "incorrect value for last_msg.msg.vel_ned_cov_gnss.n, " + "expected -5, is %d", + last_msg.msg.vel_ned_cov_gnss.n); + + ck_assert_msg(last_msg.msg.vel_ned_cov_gnss.n_sats == 21, + "incorrect value for last_msg.msg.vel_ned_cov_gnss.n_sats, " + "expected 21, is %d", + last_msg.msg.vel_ned_cov_gnss.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned_cov_gnss.tow == 501868200, + "incorrect value for last_msg.msg.vel_ned_cov_gnss.tow, " + "expected 501868200, is %d", + last_msg.msg.vel_ned_cov_gnss.tow); } } END_TEST -Suite* auto_check_sbp_navigation_MsgVelNedCovGnss_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgVelNedCovGnss"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelNedCovGnss"); +Suite *auto_check_sbp_navigation_MsgVelNedCovGnss_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgVelNedCovGnss"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_navigation_MsgVelNedCovGnss"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgVelNedCovGnss); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_navigation_MsgVelNedGnss.c b/c/test/auto_check_sbp_navigation_MsgVelNedGnss.c index 2b8ae4a75..354251e35 100644 --- a/c/test/auto_check_sbp_navigation_MsgVelNedGnss.c +++ b/c/test/auto_check_sbp_navigation_MsgVelNedGnss.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedGnss.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_navigation_MsgVelNedGnss ) -{ +START_TEST(test_auto_check_sbp_navigation_MsgVelNedGnss) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNedGnss ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,75 +90,107 @@ START_TEST( test_auto_check_sbp_navigation_MsgVelNedGnss ) logging_reset(); - sbp_callback_register(&sbp_state, 0x22e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x22e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,46,2,0,16,22,168,230,233,29,251,255,255,255,0,0,0,0,246,255,255,255,40,0,89,0,21,2,99,171, }; + u8 encoded_frame[] = { + 85, 46, 2, 0, 16, 22, 168, 230, 233, 29, 251, 255, 255, 255, 0, + 0, 0, 0, 246, 255, 255, 255, 40, 0, 89, 0, 21, 2, 99, 171, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.vel_ned_gnss.d = -10; - + test_msg.vel_ned_gnss.e = 0; - + test_msg.vel_ned_gnss.flags = 2; - + test_msg.vel_ned_gnss.h_accuracy = 40; - + test_msg.vel_ned_gnss.n = -5; - + test_msg.vel_ned_gnss.n_sats = 21; - + test_msg.vel_ned_gnss.tow = 501868200; - + test_msg.vel_ned_gnss.v_accuracy = 89; - sbp_message_send(&sbp_state, SbpMsgVelNedGnss, 4096, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgVelNedGnss, 4096, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgVelNedGnss, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgVelNedGnss, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.vel_ned_gnss.d == -10, "incorrect value for last_msg.msg.vel_ned_gnss.d, expected -10, is %d", last_msg.msg.vel_ned_gnss.d); - - ck_assert_msg(last_msg.msg.vel_ned_gnss.e == 0, "incorrect value for last_msg.msg.vel_ned_gnss.e, expected 0, is %d", last_msg.msg.vel_ned_gnss.e); - - ck_assert_msg(last_msg.msg.vel_ned_gnss.flags == 2, "incorrect value for last_msg.msg.vel_ned_gnss.flags, expected 2, is %d", last_msg.msg.vel_ned_gnss.flags); - - ck_assert_msg(last_msg.msg.vel_ned_gnss.h_accuracy == 40, "incorrect value for last_msg.msg.vel_ned_gnss.h_accuracy, expected 40, is %d", last_msg.msg.vel_ned_gnss.h_accuracy); - - ck_assert_msg(last_msg.msg.vel_ned_gnss.n == -5, "incorrect value for last_msg.msg.vel_ned_gnss.n, expected -5, is %d", last_msg.msg.vel_ned_gnss.n); - - ck_assert_msg(last_msg.msg.vel_ned_gnss.n_sats == 21, "incorrect value for last_msg.msg.vel_ned_gnss.n_sats, expected 21, is %d", last_msg.msg.vel_ned_gnss.n_sats); - - ck_assert_msg(last_msg.msg.vel_ned_gnss.tow == 501868200, "incorrect value for last_msg.msg.vel_ned_gnss.tow, expected 501868200, is %d", last_msg.msg.vel_ned_gnss.tow); - - ck_assert_msg(last_msg.msg.vel_ned_gnss.v_accuracy == 89, "incorrect value for last_msg.msg.vel_ned_gnss.v_accuracy, expected 89, is %d", last_msg.msg.vel_ned_gnss.v_accuracy); + ck_assert_msg( + last_msg.msg.vel_ned_gnss.d == -10, + "incorrect value for last_msg.msg.vel_ned_gnss.d, expected -10, is %d", + last_msg.msg.vel_ned_gnss.d); + + ck_assert_msg( + last_msg.msg.vel_ned_gnss.e == 0, + "incorrect value for last_msg.msg.vel_ned_gnss.e, expected 0, is %d", + last_msg.msg.vel_ned_gnss.e); + + ck_assert_msg(last_msg.msg.vel_ned_gnss.flags == 2, + "incorrect value for last_msg.msg.vel_ned_gnss.flags, " + "expected 2, is %d", + last_msg.msg.vel_ned_gnss.flags); + + ck_assert_msg(last_msg.msg.vel_ned_gnss.h_accuracy == 40, + "incorrect value for last_msg.msg.vel_ned_gnss.h_accuracy, " + "expected 40, is %d", + last_msg.msg.vel_ned_gnss.h_accuracy); + + ck_assert_msg( + last_msg.msg.vel_ned_gnss.n == -5, + "incorrect value for last_msg.msg.vel_ned_gnss.n, expected -5, is %d", + last_msg.msg.vel_ned_gnss.n); + + ck_assert_msg(last_msg.msg.vel_ned_gnss.n_sats == 21, + "incorrect value for last_msg.msg.vel_ned_gnss.n_sats, " + "expected 21, is %d", + last_msg.msg.vel_ned_gnss.n_sats); + + ck_assert_msg(last_msg.msg.vel_ned_gnss.tow == 501868200, + "incorrect value for last_msg.msg.vel_ned_gnss.tow, expected " + "501868200, is %d", + last_msg.msg.vel_ned_gnss.tow); + + ck_assert_msg(last_msg.msg.vel_ned_gnss.v_accuracy == 89, + "incorrect value for last_msg.msg.vel_ned_gnss.v_accuracy, " + "expected 89, is %d", + last_msg.msg.vel_ned_gnss.v_accuracy); } } END_TEST -Suite* auto_check_sbp_navigation_MsgVelNedGnss_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_navigation_MsgVelNedGnss"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelNedGnss"); +Suite *auto_check_sbp_navigation_MsgVelNedGnss_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_navigation_MsgVelNedGnss"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_navigation_MsgVelNedGnss"); tcase_add_test(tc_acq, test_auto_check_sbp_navigation_MsgVelNedGnss); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ndb_MsgNdbEvent.c b/c/test/auto_check_sbp_ndb_MsgNdbEvent.c index 20c58a11c..fe4a5dbd0 100644 --- a/c/test/auto_check_sbp_ndb_MsgNdbEvent.c +++ b/c/test/auto_check_sbp_ndb_MsgNdbEvent.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ndb/test_MsgNdbEvent.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ndb/test_MsgNdbEvent.yaml by generate.py. Do not +// modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ndb_MsgNdbEvent ) -{ +START_TEST(test_auto_check_sbp_ndb_MsgNdbEvent) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ndb_MsgNdbEvent ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,87 +90,121 @@ START_TEST( test_auto_check_sbp_ndb_MsgNdbEvent ) logging_reset(); - sbp_callback_register(&sbp_state, 0x400, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x400, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,4,164,174,18,254,188,70,185,69,0,0,0,249,73,205,115,238,74,98,66,182,148,16,166, }; + u8 encoded_frame[] = { + 85, 0, 4, 164, 174, 18, 254, 188, 70, 185, 69, 0, 0, + 0, 249, 73, 205, 115, 238, 74, 98, 66, 182, 148, 16, 166, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ndb_event.data_source = 115; - + test_msg.ndb_event.event = 249; - - + test_msg.ndb_event.object_sid.code = 74; - + test_msg.ndb_event.object_sid.sat = 238; - + test_msg.ndb_event.object_type = 73; - + test_msg.ndb_event.original_sender = 38070; - + test_msg.ndb_event.recv_time = 299461164286; - + test_msg.ndb_event.result = 205; - - + test_msg.ndb_event.src_sid.code = 66; - + test_msg.ndb_event.src_sid.sat = 98; - sbp_message_send(&sbp_state, SbpMsgNdbEvent, 44708, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgNdbEvent, 44708, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 44708, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgNdbEvent, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgNdbEvent, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ndb_event.data_source == 115, "incorrect value for last_msg.msg.ndb_event.data_source, expected 115, is %d", last_msg.msg.ndb_event.data_source); - - ck_assert_msg(last_msg.msg.ndb_event.event == 249, "incorrect value for last_msg.msg.ndb_event.event, expected 249, is %d", last_msg.msg.ndb_event.event); - - - ck_assert_msg(last_msg.msg.ndb_event.object_sid.code == 74, "incorrect value for last_msg.msg.ndb_event.object_sid.code, expected 74, is %d", last_msg.msg.ndb_event.object_sid.code); - - ck_assert_msg(last_msg.msg.ndb_event.object_sid.sat == 238, "incorrect value for last_msg.msg.ndb_event.object_sid.sat, expected 238, is %d", last_msg.msg.ndb_event.object_sid.sat); - - ck_assert_msg(last_msg.msg.ndb_event.object_type == 73, "incorrect value for last_msg.msg.ndb_event.object_type, expected 73, is %d", last_msg.msg.ndb_event.object_type); - - ck_assert_msg(last_msg.msg.ndb_event.original_sender == 38070, "incorrect value for last_msg.msg.ndb_event.original_sender, expected 38070, is %d", last_msg.msg.ndb_event.original_sender); - - ck_assert_msg(last_msg.msg.ndb_event.recv_time == 299461164286, "incorrect value for last_msg.msg.ndb_event.recv_time, expected 299461164286, is %d", last_msg.msg.ndb_event.recv_time); - - ck_assert_msg(last_msg.msg.ndb_event.result == 205, "incorrect value for last_msg.msg.ndb_event.result, expected 205, is %d", last_msg.msg.ndb_event.result); - - - ck_assert_msg(last_msg.msg.ndb_event.src_sid.code == 66, "incorrect value for last_msg.msg.ndb_event.src_sid.code, expected 66, is %d", last_msg.msg.ndb_event.src_sid.code); - - ck_assert_msg(last_msg.msg.ndb_event.src_sid.sat == 98, "incorrect value for last_msg.msg.ndb_event.src_sid.sat, expected 98, is %d", last_msg.msg.ndb_event.src_sid.sat); + ck_assert_msg(last_msg.msg.ndb_event.data_source == 115, + "incorrect value for last_msg.msg.ndb_event.data_source, " + "expected 115, is %d", + last_msg.msg.ndb_event.data_source); + + ck_assert_msg( + last_msg.msg.ndb_event.event == 249, + "incorrect value for last_msg.msg.ndb_event.event, expected 249, is %d", + last_msg.msg.ndb_event.event); + + ck_assert_msg(last_msg.msg.ndb_event.object_sid.code == 74, + "incorrect value for last_msg.msg.ndb_event.object_sid.code, " + "expected 74, is %d", + last_msg.msg.ndb_event.object_sid.code); + + ck_assert_msg(last_msg.msg.ndb_event.object_sid.sat == 238, + "incorrect value for last_msg.msg.ndb_event.object_sid.sat, " + "expected 238, is %d", + last_msg.msg.ndb_event.object_sid.sat); + + ck_assert_msg(last_msg.msg.ndb_event.object_type == 73, + "incorrect value for last_msg.msg.ndb_event.object_type, " + "expected 73, is %d", + last_msg.msg.ndb_event.object_type); + + ck_assert_msg(last_msg.msg.ndb_event.original_sender == 38070, + "incorrect value for last_msg.msg.ndb_event.original_sender, " + "expected 38070, is %d", + last_msg.msg.ndb_event.original_sender); + + ck_assert_msg(last_msg.msg.ndb_event.recv_time == 299461164286, + "incorrect value for last_msg.msg.ndb_event.recv_time, " + "expected 299461164286, is %d", + last_msg.msg.ndb_event.recv_time); + + ck_assert_msg(last_msg.msg.ndb_event.result == 205, + "incorrect value for last_msg.msg.ndb_event.result, expected " + "205, is %d", + last_msg.msg.ndb_event.result); + + ck_assert_msg(last_msg.msg.ndb_event.src_sid.code == 66, + "incorrect value for last_msg.msg.ndb_event.src_sid.code, " + "expected 66, is %d", + last_msg.msg.ndb_event.src_sid.code); + + ck_assert_msg(last_msg.msg.ndb_event.src_sid.sat == 98, + "incorrect value for last_msg.msg.ndb_event.src_sid.sat, " + "expected 98, is %d", + last_msg.msg.ndb_event.src_sid.sat); } } END_TEST -Suite* auto_check_sbp_ndb_MsgNdbEvent_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ndb_MsgNdbEvent"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ndb_MsgNdbEvent"); +Suite *auto_check_sbp_ndb_MsgNdbEvent_suite(void) { + Suite *s = + suite_create("SBP generated test suite: auto_check_sbp_ndb_MsgNdbEvent"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_ndb_MsgNdbEvent"); tcase_add_test(tc_acq, test_auto_check_sbp_ndb_MsgNdbEvent); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgAlmanacGLO.c b/c/test/auto_check_sbp_observation_MsgAlmanacGLO.c index 9024e7463..45feafb40 100644 --- a/c/test/auto_check_sbp_observation_MsgAlmanacGLO.c +++ b/c/test/auto_check_sbp_observation_MsgAlmanacGLO.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLO.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLO.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgAlmanacGLO ) -{ +START_TEST(test_auto_check_sbp_observation_MsgAlmanacGLO) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgAlmanacGLO ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,109 +90,172 @@ START_TEST( test_auto_check_sbp_observation_MsgAlmanacGLO ) logging_reset(); - sbp_callback_register(&sbp_state, 0x73, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x73, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,115,0,195,4,78,22,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,155,87, }; + u8 encoded_frame[] = { + 85, 115, 0, 195, 4, 78, 22, 0, 176, 207, 6, 0, 106, + 8, 154, 153, 153, 153, 153, 153, 1, 64, 64, 56, 0, 0, + 1, 0, 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, + 32, 191, 247, 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, + 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, 54, 204, + 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, 71, 11, + 217, 147, 145, 228, 237, 63, 155, 87, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.almanac_glo.common.fit_interval = 14400; - + test_msg.almanac_glo.common.health_bits = 0; - - + test_msg.almanac_glo.common.sid.code = 0; - + test_msg.almanac_glo.common.sid.sat = 22; - - + test_msg.almanac_glo.common.toa.tow = 446384; - + test_msg.almanac_glo.common.toa.wn = 2154; - + test_msg.almanac_glo.common.ura = 2.2; - + test_msg.almanac_glo.common.valid = 1; - + test_msg.almanac_glo.epsilon = -0.9893036629599647; - + test_msg.almanac_glo.i = 5153.550029754639; - + test_msg.almanac_glo.lambda_na = -0.02200078842114688; - + test_msg.almanac_glo.omega = 0.9341514480259797; - + test_msg.almanac_glo.t = -1.8731818448797617; - + test_msg.almanac_glo.t_dot = -8.903585155774196e-09; - + test_msg.almanac_glo.t_lambda_na = 0.007072207052260637; - sbp_message_send(&sbp_state, SbpMsgAlmanacGlo, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAlmanacGlo, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAlmanacGlo, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAlmanacGlo, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.almanac_glo.common.fit_interval == 14400, "incorrect value for last_msg.msg.almanac_glo.common.fit_interval, expected 14400, is %d", last_msg.msg.almanac_glo.common.fit_interval); - - ck_assert_msg(last_msg.msg.almanac_glo.common.health_bits == 0, "incorrect value for last_msg.msg.almanac_glo.common.health_bits, expected 0, is %d", last_msg.msg.almanac_glo.common.health_bits); - - - ck_assert_msg(last_msg.msg.almanac_glo.common.sid.code == 0, "incorrect value for last_msg.msg.almanac_glo.common.sid.code, expected 0, is %d", last_msg.msg.almanac_glo.common.sid.code); - - ck_assert_msg(last_msg.msg.almanac_glo.common.sid.sat == 22, "incorrect value for last_msg.msg.almanac_glo.common.sid.sat, expected 22, is %d", last_msg.msg.almanac_glo.common.sid.sat); - - - ck_assert_msg(last_msg.msg.almanac_glo.common.toa.tow == 446384, "incorrect value for last_msg.msg.almanac_glo.common.toa.tow, expected 446384, is %d", last_msg.msg.almanac_glo.common.toa.tow); - - ck_assert_msg(last_msg.msg.almanac_glo.common.toa.wn == 2154, "incorrect value for last_msg.msg.almanac_glo.common.toa.wn, expected 2154, is %d", last_msg.msg.almanac_glo.common.toa.wn); - - ck_assert_msg((last_msg.msg.almanac_glo.common.ura * 100 - 2.2 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo.common.ura, expected 2.2, is %s", last_msg.msg.almanac_glo.common.ura); - - ck_assert_msg(last_msg.msg.almanac_glo.common.valid == 1, "incorrect value for last_msg.msg.almanac_glo.common.valid, expected 1, is %d", last_msg.msg.almanac_glo.common.valid); - - ck_assert_msg((last_msg.msg.almanac_glo.epsilon * 100 - -0.98930366296 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo.epsilon, expected -0.98930366296, is %s", last_msg.msg.almanac_glo.epsilon); - - ck_assert_msg((last_msg.msg.almanac_glo.i * 100 - 5153.55002975 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo.i, expected 5153.55002975, is %s", last_msg.msg.almanac_glo.i); - - ck_assert_msg((last_msg.msg.almanac_glo.lambda_na * 100 - -0.0220007884211 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo.lambda_na, expected -0.0220007884211, is %s", last_msg.msg.almanac_glo.lambda_na); - - ck_assert_msg((last_msg.msg.almanac_glo.omega * 100 - 0.934151448026 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo.omega, expected 0.934151448026, is %s", last_msg.msg.almanac_glo.omega); - - ck_assert_msg((last_msg.msg.almanac_glo.t * 100 - -1.87318184488 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo.t, expected -1.87318184488, is %s", last_msg.msg.almanac_glo.t); - - ck_assert_msg((last_msg.msg.almanac_glo.t_dot * 100 - -8.90358515577e-09 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo.t_dot, expected -8.90358515577e-09, is %s", last_msg.msg.almanac_glo.t_dot); - - ck_assert_msg((last_msg.msg.almanac_glo.t_lambda_na * 100 - 0.00707220705226 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo.t_lambda_na, expected 0.00707220705226, is %s", last_msg.msg.almanac_glo.t_lambda_na); + ck_assert_msg( + last_msg.msg.almanac_glo.common.fit_interval == 14400, + "incorrect value for last_msg.msg.almanac_glo.common.fit_interval, " + "expected 14400, is %d", + last_msg.msg.almanac_glo.common.fit_interval); + + ck_assert_msg( + last_msg.msg.almanac_glo.common.health_bits == 0, + "incorrect value for last_msg.msg.almanac_glo.common.health_bits, " + "expected 0, is %d", + last_msg.msg.almanac_glo.common.health_bits); + + ck_assert_msg(last_msg.msg.almanac_glo.common.sid.code == 0, + "incorrect value for " + "last_msg.msg.almanac_glo.common.sid.code, expected 0, is %d", + last_msg.msg.almanac_glo.common.sid.code); + + ck_assert_msg(last_msg.msg.almanac_glo.common.sid.sat == 22, + "incorrect value for " + "last_msg.msg.almanac_glo.common.sid.sat, expected 22, is %d", + last_msg.msg.almanac_glo.common.sid.sat); + + ck_assert_msg( + last_msg.msg.almanac_glo.common.toa.tow == 446384, + "incorrect value for last_msg.msg.almanac_glo.common.toa.tow, expected " + "446384, is %d", + last_msg.msg.almanac_glo.common.toa.tow); + + ck_assert_msg(last_msg.msg.almanac_glo.common.toa.wn == 2154, + "incorrect value for last_msg.msg.almanac_glo.common.toa.wn, " + "expected 2154, is %d", + last_msg.msg.almanac_glo.common.toa.wn); + + ck_assert_msg( + (last_msg.msg.almanac_glo.common.ura * 100 - 2.2 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo.common.ura, expected " + "2.2, is %s", + last_msg.msg.almanac_glo.common.ura); + + ck_assert_msg(last_msg.msg.almanac_glo.common.valid == 1, + "incorrect value for last_msg.msg.almanac_glo.common.valid, " + "expected 1, is %d", + last_msg.msg.almanac_glo.common.valid); + + ck_assert_msg( + (last_msg.msg.almanac_glo.epsilon * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo.epsilon, expected " + "-0.98930366296, is %s", + last_msg.msg.almanac_glo.epsilon); + + ck_assert_msg( + (last_msg.msg.almanac_glo.i * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo.i, expected " + "5153.55002975, is %s", + last_msg.msg.almanac_glo.i); + + ck_assert_msg((last_msg.msg.almanac_glo.lambda_na * 100 - + -0.0220007884211 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo.lambda_na, " + "expected -0.0220007884211, is %s", + last_msg.msg.almanac_glo.lambda_na); + + ck_assert_msg( + (last_msg.msg.almanac_glo.omega * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo.omega, expected " + "0.934151448026, is %s", + last_msg.msg.almanac_glo.omega); + + ck_assert_msg( + (last_msg.msg.almanac_glo.t * 100 - -1.87318184488 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo.t, expected " + "-1.87318184488, is %s", + last_msg.msg.almanac_glo.t); + + ck_assert_msg((last_msg.msg.almanac_glo.t_dot * 100 - + -8.90358515577e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo.t_dot, " + "expected -8.90358515577e-09, is %s", + last_msg.msg.almanac_glo.t_dot); + + ck_assert_msg((last_msg.msg.almanac_glo.t_lambda_na * 100 - + 0.00707220705226 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo.t_lambda_na, " + "expected 0.00707220705226, is %s", + last_msg.msg.almanac_glo.t_lambda_na); } } END_TEST -Suite* auto_check_sbp_observation_MsgAlmanacGLO_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgAlmanacGLO"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgAlmanacGLO"); +Suite *auto_check_sbp_observation_MsgAlmanacGLO_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgAlmanacGLO"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_observation_MsgAlmanacGLO"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgAlmanacGLO); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgAlmanacGLODep.c b/c/test/auto_check_sbp_observation_MsgAlmanacGLODep.c index ce8f67991..992ddcd74 100644 --- a/c/test/auto_check_sbp_observation_MsgAlmanacGLODep.c +++ b/c/test/auto_check_sbp_observation_MsgAlmanacGLODep.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLODep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLODep.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgAlmanacGLODep ) -{ +START_TEST(test_auto_check_sbp_observation_MsgAlmanacGLODep) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgAlmanacGLODep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,113 +90,185 @@ START_TEST( test_auto_check_sbp_observation_MsgAlmanacGLODep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x71, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x71, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,113,0,195,4,80,22,0,0,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,203,178, }; + u8 encoded_frame[] = { + 85, 113, 0, 195, 4, 80, 22, 0, 0, 0, 176, 207, 6, + 0, 106, 8, 154, 153, 153, 153, 153, 153, 1, 64, 64, 56, + 0, 0, 1, 0, 142, 41, 5, 235, 95, 135, 150, 191, 0, + 0, 0, 32, 191, 247, 124, 63, 0, 0, 192, 206, 140, 33, + 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, + 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, + 71, 11, 217, 147, 145, 228, 237, 63, 203, 178, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.almanac_glo_dep.common.fit_interval = 14400; - + test_msg.almanac_glo_dep.common.health_bits = 0; - - + test_msg.almanac_glo_dep.common.sid.code = 0; - + test_msg.almanac_glo_dep.common.sid.reserved = 0; - + test_msg.almanac_glo_dep.common.sid.sat = 22; - - + test_msg.almanac_glo_dep.common.toa.tow = 446384; - + test_msg.almanac_glo_dep.common.toa.wn = 2154; - + test_msg.almanac_glo_dep.common.ura = 2.2; - + test_msg.almanac_glo_dep.common.valid = 1; - + test_msg.almanac_glo_dep.epsilon = -0.9893036629599647; - + test_msg.almanac_glo_dep.i = 5153.550029754639; - + test_msg.almanac_glo_dep.lambda_na = -0.02200078842114688; - + test_msg.almanac_glo_dep.omega = 0.9341514480259797; - + test_msg.almanac_glo_dep.t = -1.8731818448797617; - + test_msg.almanac_glo_dep.t_dot = -8.903585155774196e-09; - + test_msg.almanac_glo_dep.t_lambda_na = 0.007072207052260637; - sbp_message_send(&sbp_state, SbpMsgAlmanacGloDep, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAlmanacGloDep, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAlmanacGloDep, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAlmanacGloDep, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.almanac_glo_dep.common.fit_interval == 14400, "incorrect value for last_msg.msg.almanac_glo_dep.common.fit_interval, expected 14400, is %d", last_msg.msg.almanac_glo_dep.common.fit_interval); - - ck_assert_msg(last_msg.msg.almanac_glo_dep.common.health_bits == 0, "incorrect value for last_msg.msg.almanac_glo_dep.common.health_bits, expected 0, is %d", last_msg.msg.almanac_glo_dep.common.health_bits); - - - ck_assert_msg(last_msg.msg.almanac_glo_dep.common.sid.code == 0, "incorrect value for last_msg.msg.almanac_glo_dep.common.sid.code, expected 0, is %d", last_msg.msg.almanac_glo_dep.common.sid.code); - - ck_assert_msg(last_msg.msg.almanac_glo_dep.common.sid.reserved == 0, "incorrect value for last_msg.msg.almanac_glo_dep.common.sid.reserved, expected 0, is %d", last_msg.msg.almanac_glo_dep.common.sid.reserved); - - ck_assert_msg(last_msg.msg.almanac_glo_dep.common.sid.sat == 22, "incorrect value for last_msg.msg.almanac_glo_dep.common.sid.sat, expected 22, is %d", last_msg.msg.almanac_glo_dep.common.sid.sat); - - - ck_assert_msg(last_msg.msg.almanac_glo_dep.common.toa.tow == 446384, "incorrect value for last_msg.msg.almanac_glo_dep.common.toa.tow, expected 446384, is %d", last_msg.msg.almanac_glo_dep.common.toa.tow); - - ck_assert_msg(last_msg.msg.almanac_glo_dep.common.toa.wn == 2154, "incorrect value for last_msg.msg.almanac_glo_dep.common.toa.wn, expected 2154, is %d", last_msg.msg.almanac_glo_dep.common.toa.wn); - - ck_assert_msg((last_msg.msg.almanac_glo_dep.common.ura * 100 - 2.2 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo_dep.common.ura, expected 2.2, is %s", last_msg.msg.almanac_glo_dep.common.ura); - - ck_assert_msg(last_msg.msg.almanac_glo_dep.common.valid == 1, "incorrect value for last_msg.msg.almanac_glo_dep.common.valid, expected 1, is %d", last_msg.msg.almanac_glo_dep.common.valid); - - ck_assert_msg((last_msg.msg.almanac_glo_dep.epsilon * 100 - -0.98930366296 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo_dep.epsilon, expected -0.98930366296, is %s", last_msg.msg.almanac_glo_dep.epsilon); - - ck_assert_msg((last_msg.msg.almanac_glo_dep.i * 100 - 5153.55002975 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo_dep.i, expected 5153.55002975, is %s", last_msg.msg.almanac_glo_dep.i); - - ck_assert_msg((last_msg.msg.almanac_glo_dep.lambda_na * 100 - -0.0220007884211 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo_dep.lambda_na, expected -0.0220007884211, is %s", last_msg.msg.almanac_glo_dep.lambda_na); - - ck_assert_msg((last_msg.msg.almanac_glo_dep.omega * 100 - 0.934151448026 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo_dep.omega, expected 0.934151448026, is %s", last_msg.msg.almanac_glo_dep.omega); - - ck_assert_msg((last_msg.msg.almanac_glo_dep.t * 100 - -1.87318184488 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo_dep.t, expected -1.87318184488, is %s", last_msg.msg.almanac_glo_dep.t); - - ck_assert_msg((last_msg.msg.almanac_glo_dep.t_dot * 100 - -8.90358515577e-09 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo_dep.t_dot, expected -8.90358515577e-09, is %s", last_msg.msg.almanac_glo_dep.t_dot); - - ck_assert_msg((last_msg.msg.almanac_glo_dep.t_lambda_na * 100 - 0.00707220705226 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_glo_dep.t_lambda_na, expected 0.00707220705226, is %s", last_msg.msg.almanac_glo_dep.t_lambda_na); + ck_assert_msg( + last_msg.msg.almanac_glo_dep.common.fit_interval == 14400, + "incorrect value for last_msg.msg.almanac_glo_dep.common.fit_interval, " + "expected 14400, is %d", + last_msg.msg.almanac_glo_dep.common.fit_interval); + + ck_assert_msg( + last_msg.msg.almanac_glo_dep.common.health_bits == 0, + "incorrect value for last_msg.msg.almanac_glo_dep.common.health_bits, " + "expected 0, is %d", + last_msg.msg.almanac_glo_dep.common.health_bits); + + ck_assert_msg( + last_msg.msg.almanac_glo_dep.common.sid.code == 0, + "incorrect value for last_msg.msg.almanac_glo_dep.common.sid.code, " + "expected 0, is %d", + last_msg.msg.almanac_glo_dep.common.sid.code); + + ck_assert_msg( + last_msg.msg.almanac_glo_dep.common.sid.reserved == 0, + "incorrect value for last_msg.msg.almanac_glo_dep.common.sid.reserved, " + "expected 0, is %d", + last_msg.msg.almanac_glo_dep.common.sid.reserved); + + ck_assert_msg( + last_msg.msg.almanac_glo_dep.common.sid.sat == 22, + "incorrect value for last_msg.msg.almanac_glo_dep.common.sid.sat, " + "expected 22, is %d", + last_msg.msg.almanac_glo_dep.common.sid.sat); + + ck_assert_msg( + last_msg.msg.almanac_glo_dep.common.toa.tow == 446384, + "incorrect value for last_msg.msg.almanac_glo_dep.common.toa.tow, " + "expected 446384, is %d", + last_msg.msg.almanac_glo_dep.common.toa.tow); + + ck_assert_msg( + last_msg.msg.almanac_glo_dep.common.toa.wn == 2154, + "incorrect value for last_msg.msg.almanac_glo_dep.common.toa.wn, " + "expected 2154, is %d", + last_msg.msg.almanac_glo_dep.common.toa.wn); + + ck_assert_msg( + (last_msg.msg.almanac_glo_dep.common.ura * 100 - 2.2 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo_dep.common.ura, expected " + "2.2, is %s", + last_msg.msg.almanac_glo_dep.common.ura); + + ck_assert_msg( + last_msg.msg.almanac_glo_dep.common.valid == 1, + "incorrect value for last_msg.msg.almanac_glo_dep.common.valid, " + "expected 1, is %d", + last_msg.msg.almanac_glo_dep.common.valid); + + ck_assert_msg((last_msg.msg.almanac_glo_dep.epsilon * 100 - + -0.98930366296 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo_dep.epsilon, " + "expected -0.98930366296, is %s", + last_msg.msg.almanac_glo_dep.epsilon); + + ck_assert_msg( + (last_msg.msg.almanac_glo_dep.i * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo_dep.i, expected " + "5153.55002975, is %s", + last_msg.msg.almanac_glo_dep.i); + + ck_assert_msg((last_msg.msg.almanac_glo_dep.lambda_na * 100 - + -0.0220007884211 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo_dep.lambda_na, " + "expected -0.0220007884211, is %s", + last_msg.msg.almanac_glo_dep.lambda_na); + + ck_assert_msg((last_msg.msg.almanac_glo_dep.omega * 100 - + 0.934151448026 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo_dep.omega, " + "expected 0.934151448026, is %s", + last_msg.msg.almanac_glo_dep.omega); + + ck_assert_msg( + (last_msg.msg.almanac_glo_dep.t * 100 - -1.87318184488 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo_dep.t, expected " + "-1.87318184488, is %s", + last_msg.msg.almanac_glo_dep.t); + + ck_assert_msg((last_msg.msg.almanac_glo_dep.t_dot * 100 - + -8.90358515577e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo_dep.t_dot, " + "expected -8.90358515577e-09, is %s", + last_msg.msg.almanac_glo_dep.t_dot); + + ck_assert_msg( + (last_msg.msg.almanac_glo_dep.t_lambda_na * 100 - + 0.00707220705226 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_glo_dep.t_lambda_na, " + "expected 0.00707220705226, is %s", + last_msg.msg.almanac_glo_dep.t_lambda_na); } } END_TEST -Suite* auto_check_sbp_observation_MsgAlmanacGLODep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgAlmanacGLODep"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgAlmanacGLODep"); +Suite *auto_check_sbp_observation_MsgAlmanacGLODep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgAlmanacGLODep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgAlmanacGLODep"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgAlmanacGLODep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgAlmanacGPS.c b/c/test/auto_check_sbp_observation_MsgAlmanacGPS.c index 344c648bb..0f07f4fe7 100644 --- a/c/test/auto_check_sbp_observation_MsgAlmanacGPS.c +++ b/c/test/auto_check_sbp_observation_MsgAlmanacGPS.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPS.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgAlmanacGPS ) -{ +START_TEST(test_auto_check_sbp_observation_MsgAlmanacGPS) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgAlmanacGPS ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,117 +90,189 @@ START_TEST( test_auto_check_sbp_observation_MsgAlmanacGPS ) logging_reset(); - sbp_callback_register(&sbp_state, 0x72, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x72, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,114,0,195,4,94,22,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,190,45, }; + u8 encoded_frame[] = { + 85, 114, 0, 195, 4, 94, 22, 0, 176, 207, 6, 0, 106, + 8, 154, 153, 153, 153, 153, 153, 1, 64, 64, 56, 0, 0, + 1, 0, 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, + 32, 191, 247, 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, + 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, 54, 204, + 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, 71, 11, + 217, 147, 145, 228, 237, 63, 0, 0, 0, 0, 108, 177, 68, + 191, 0, 0, 0, 0, 0, 192, 163, 61, 190, 45, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.almanac_gps.af0 = -0.0006315018981695175; - + test_msg.almanac_gps.af1 = 8.981260180007666e-12; - - + test_msg.almanac_gps.common.fit_interval = 14400; - + test_msg.almanac_gps.common.health_bits = 0; - - + test_msg.almanac_gps.common.sid.code = 0; - + test_msg.almanac_gps.common.sid.sat = 22; - - + test_msg.almanac_gps.common.toa.tow = 446384; - + test_msg.almanac_gps.common.toa.wn = 2154; - + test_msg.almanac_gps.common.ura = 2.2; - + test_msg.almanac_gps.common.valid = 1; - + test_msg.almanac_gps.ecc = 0.007072207052260637; - + test_msg.almanac_gps.inc = 0.9341514480259797; - + test_msg.almanac_gps.m0 = -0.02200078842114688; - + test_msg.almanac_gps.omega0 = -1.8731818448797617; - + test_msg.almanac_gps.omegadot = -8.903585155774196e-09; - + test_msg.almanac_gps.sqrta = 5153.550029754639; - + test_msg.almanac_gps.w = -0.9893036629599647; - sbp_message_send(&sbp_state, SbpMsgAlmanacGps, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAlmanacGps, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAlmanacGps, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAlmanacGps, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.almanac_gps.af0 * 100 - -0.00063150189817 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps.af0, expected -0.00063150189817, is %s", last_msg.msg.almanac_gps.af0); - - ck_assert_msg((last_msg.msg.almanac_gps.af1 * 100 - 8.98126018001e-12 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps.af1, expected 8.98126018001e-12, is %s", last_msg.msg.almanac_gps.af1); - - - ck_assert_msg(last_msg.msg.almanac_gps.common.fit_interval == 14400, "incorrect value for last_msg.msg.almanac_gps.common.fit_interval, expected 14400, is %d", last_msg.msg.almanac_gps.common.fit_interval); - - ck_assert_msg(last_msg.msg.almanac_gps.common.health_bits == 0, "incorrect value for last_msg.msg.almanac_gps.common.health_bits, expected 0, is %d", last_msg.msg.almanac_gps.common.health_bits); - - - ck_assert_msg(last_msg.msg.almanac_gps.common.sid.code == 0, "incorrect value for last_msg.msg.almanac_gps.common.sid.code, expected 0, is %d", last_msg.msg.almanac_gps.common.sid.code); - - ck_assert_msg(last_msg.msg.almanac_gps.common.sid.sat == 22, "incorrect value for last_msg.msg.almanac_gps.common.sid.sat, expected 22, is %d", last_msg.msg.almanac_gps.common.sid.sat); - - - ck_assert_msg(last_msg.msg.almanac_gps.common.toa.tow == 446384, "incorrect value for last_msg.msg.almanac_gps.common.toa.tow, expected 446384, is %d", last_msg.msg.almanac_gps.common.toa.tow); - - ck_assert_msg(last_msg.msg.almanac_gps.common.toa.wn == 2154, "incorrect value for last_msg.msg.almanac_gps.common.toa.wn, expected 2154, is %d", last_msg.msg.almanac_gps.common.toa.wn); - - ck_assert_msg((last_msg.msg.almanac_gps.common.ura * 100 - 2.2 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps.common.ura, expected 2.2, is %s", last_msg.msg.almanac_gps.common.ura); - - ck_assert_msg(last_msg.msg.almanac_gps.common.valid == 1, "incorrect value for last_msg.msg.almanac_gps.common.valid, expected 1, is %d", last_msg.msg.almanac_gps.common.valid); - - ck_assert_msg((last_msg.msg.almanac_gps.ecc * 100 - 0.00707220705226 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps.ecc, expected 0.00707220705226, is %s", last_msg.msg.almanac_gps.ecc); - - ck_assert_msg((last_msg.msg.almanac_gps.inc * 100 - 0.934151448026 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps.inc, expected 0.934151448026, is %s", last_msg.msg.almanac_gps.inc); - - ck_assert_msg((last_msg.msg.almanac_gps.m0 * 100 - -0.0220007884211 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps.m0, expected -0.0220007884211, is %s", last_msg.msg.almanac_gps.m0); - - ck_assert_msg((last_msg.msg.almanac_gps.omega0 * 100 - -1.87318184488 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps.omega0, expected -1.87318184488, is %s", last_msg.msg.almanac_gps.omega0); - - ck_assert_msg((last_msg.msg.almanac_gps.omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps.omegadot, expected -8.90358515577e-09, is %s", last_msg.msg.almanac_gps.omegadot); - - ck_assert_msg((last_msg.msg.almanac_gps.sqrta * 100 - 5153.55002975 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps.sqrta, expected 5153.55002975, is %s", last_msg.msg.almanac_gps.sqrta); - - ck_assert_msg((last_msg.msg.almanac_gps.w * 100 - -0.98930366296 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps.w, expected -0.98930366296, is %s", last_msg.msg.almanac_gps.w); + ck_assert_msg( + (last_msg.msg.almanac_gps.af0 * 100 - -0.00063150189817 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps.af0, expected " + "-0.00063150189817, is %s", + last_msg.msg.almanac_gps.af0); + + ck_assert_msg( + (last_msg.msg.almanac_gps.af1 * 100 - 8.98126018001e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps.af1, expected " + "8.98126018001e-12, is %s", + last_msg.msg.almanac_gps.af1); + + ck_assert_msg( + last_msg.msg.almanac_gps.common.fit_interval == 14400, + "incorrect value for last_msg.msg.almanac_gps.common.fit_interval, " + "expected 14400, is %d", + last_msg.msg.almanac_gps.common.fit_interval); + + ck_assert_msg( + last_msg.msg.almanac_gps.common.health_bits == 0, + "incorrect value for last_msg.msg.almanac_gps.common.health_bits, " + "expected 0, is %d", + last_msg.msg.almanac_gps.common.health_bits); + + ck_assert_msg(last_msg.msg.almanac_gps.common.sid.code == 0, + "incorrect value for " + "last_msg.msg.almanac_gps.common.sid.code, expected 0, is %d", + last_msg.msg.almanac_gps.common.sid.code); + + ck_assert_msg(last_msg.msg.almanac_gps.common.sid.sat == 22, + "incorrect value for " + "last_msg.msg.almanac_gps.common.sid.sat, expected 22, is %d", + last_msg.msg.almanac_gps.common.sid.sat); + + ck_assert_msg( + last_msg.msg.almanac_gps.common.toa.tow == 446384, + "incorrect value for last_msg.msg.almanac_gps.common.toa.tow, expected " + "446384, is %d", + last_msg.msg.almanac_gps.common.toa.tow); + + ck_assert_msg(last_msg.msg.almanac_gps.common.toa.wn == 2154, + "incorrect value for last_msg.msg.almanac_gps.common.toa.wn, " + "expected 2154, is %d", + last_msg.msg.almanac_gps.common.toa.wn); + + ck_assert_msg( + (last_msg.msg.almanac_gps.common.ura * 100 - 2.2 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps.common.ura, expected " + "2.2, is %s", + last_msg.msg.almanac_gps.common.ura); + + ck_assert_msg(last_msg.msg.almanac_gps.common.valid == 1, + "incorrect value for last_msg.msg.almanac_gps.common.valid, " + "expected 1, is %d", + last_msg.msg.almanac_gps.common.valid); + + ck_assert_msg( + (last_msg.msg.almanac_gps.ecc * 100 - 0.00707220705226 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps.ecc, expected " + "0.00707220705226, is %s", + last_msg.msg.almanac_gps.ecc); + + ck_assert_msg( + (last_msg.msg.almanac_gps.inc * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps.inc, expected " + "0.934151448026, is %s", + last_msg.msg.almanac_gps.inc); + + ck_assert_msg( + (last_msg.msg.almanac_gps.m0 * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps.m0, expected " + "-0.0220007884211, is %s", + last_msg.msg.almanac_gps.m0); + + ck_assert_msg( + (last_msg.msg.almanac_gps.omega0 * 100 - -1.87318184488 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps.omega0, expected " + "-1.87318184488, is %s", + last_msg.msg.almanac_gps.omega0); + + ck_assert_msg((last_msg.msg.almanac_gps.omegadot * 100 - + -8.90358515577e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps.omegadot, " + "expected -8.90358515577e-09, is %s", + last_msg.msg.almanac_gps.omegadot); + + ck_assert_msg( + (last_msg.msg.almanac_gps.sqrta * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps.sqrta, expected " + "5153.55002975, is %s", + last_msg.msg.almanac_gps.sqrta); + + ck_assert_msg( + (last_msg.msg.almanac_gps.w * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps.w, expected " + "-0.98930366296, is %s", + last_msg.msg.almanac_gps.w); } } END_TEST -Suite* auto_check_sbp_observation_MsgAlmanacGPS_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgAlmanacGPS"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgAlmanacGPS"); +Suite *auto_check_sbp_observation_MsgAlmanacGPS_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgAlmanacGPS"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_observation_MsgAlmanacGPS"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgAlmanacGPS); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgAlmanacGPSDep.c b/c/test/auto_check_sbp_observation_MsgAlmanacGPSDep.c index 26de9fd79..e29a21a6a 100644 --- a/c/test/auto_check_sbp_observation_MsgAlmanacGPSDep.c +++ b/c/test/auto_check_sbp_observation_MsgAlmanacGPSDep.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPSDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPSDep.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgAlmanacGPSDep ) -{ +START_TEST(test_auto_check_sbp_observation_MsgAlmanacGPSDep) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgAlmanacGPSDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,121 +90,201 @@ START_TEST( test_auto_check_sbp_observation_MsgAlmanacGPSDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x70, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x70, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,112,0,195,4,96,22,0,0,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,144,232, }; + u8 encoded_frame[] = { + 85, 112, 0, 195, 4, 96, 22, 0, 0, 0, 176, 207, 6, + 0, 106, 8, 154, 153, 153, 153, 153, 153, 1, 64, 64, 56, + 0, 0, 1, 0, 142, 41, 5, 235, 95, 135, 150, 191, 0, + 0, 0, 32, 191, 247, 124, 63, 0, 0, 192, 206, 140, 33, + 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, + 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, + 71, 11, 217, 147, 145, 228, 237, 63, 0, 0, 0, 0, 108, + 177, 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 144, 232, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.almanac_gps_dep.af0 = -0.0006315018981695175; - + test_msg.almanac_gps_dep.af1 = 8.981260180007666e-12; - - + test_msg.almanac_gps_dep.common.fit_interval = 14400; - + test_msg.almanac_gps_dep.common.health_bits = 0; - - + test_msg.almanac_gps_dep.common.sid.code = 0; - + test_msg.almanac_gps_dep.common.sid.reserved = 0; - + test_msg.almanac_gps_dep.common.sid.sat = 22; - - + test_msg.almanac_gps_dep.common.toa.tow = 446384; - + test_msg.almanac_gps_dep.common.toa.wn = 2154; - + test_msg.almanac_gps_dep.common.ura = 2.2; - + test_msg.almanac_gps_dep.common.valid = 1; - + test_msg.almanac_gps_dep.ecc = 0.007072207052260637; - + test_msg.almanac_gps_dep.inc = 0.9341514480259797; - + test_msg.almanac_gps_dep.m0 = -0.02200078842114688; - + test_msg.almanac_gps_dep.omega0 = -1.8731818448797617; - + test_msg.almanac_gps_dep.omegadot = -8.903585155774196e-09; - + test_msg.almanac_gps_dep.sqrta = 5153.550029754639; - + test_msg.almanac_gps_dep.w = -0.9893036629599647; - sbp_message_send(&sbp_state, SbpMsgAlmanacGpsDep, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAlmanacGpsDep, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAlmanacGpsDep, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAlmanacGpsDep, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.almanac_gps_dep.af0 * 100 - -0.00063150189817 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps_dep.af0, expected -0.00063150189817, is %s", last_msg.msg.almanac_gps_dep.af0); - - ck_assert_msg((last_msg.msg.almanac_gps_dep.af1 * 100 - 8.98126018001e-12 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps_dep.af1, expected 8.98126018001e-12, is %s", last_msg.msg.almanac_gps_dep.af1); - - - ck_assert_msg(last_msg.msg.almanac_gps_dep.common.fit_interval == 14400, "incorrect value for last_msg.msg.almanac_gps_dep.common.fit_interval, expected 14400, is %d", last_msg.msg.almanac_gps_dep.common.fit_interval); - - ck_assert_msg(last_msg.msg.almanac_gps_dep.common.health_bits == 0, "incorrect value for last_msg.msg.almanac_gps_dep.common.health_bits, expected 0, is %d", last_msg.msg.almanac_gps_dep.common.health_bits); - - - ck_assert_msg(last_msg.msg.almanac_gps_dep.common.sid.code == 0, "incorrect value for last_msg.msg.almanac_gps_dep.common.sid.code, expected 0, is %d", last_msg.msg.almanac_gps_dep.common.sid.code); - - ck_assert_msg(last_msg.msg.almanac_gps_dep.common.sid.reserved == 0, "incorrect value for last_msg.msg.almanac_gps_dep.common.sid.reserved, expected 0, is %d", last_msg.msg.almanac_gps_dep.common.sid.reserved); - - ck_assert_msg(last_msg.msg.almanac_gps_dep.common.sid.sat == 22, "incorrect value for last_msg.msg.almanac_gps_dep.common.sid.sat, expected 22, is %d", last_msg.msg.almanac_gps_dep.common.sid.sat); - - - ck_assert_msg(last_msg.msg.almanac_gps_dep.common.toa.tow == 446384, "incorrect value for last_msg.msg.almanac_gps_dep.common.toa.tow, expected 446384, is %d", last_msg.msg.almanac_gps_dep.common.toa.tow); - - ck_assert_msg(last_msg.msg.almanac_gps_dep.common.toa.wn == 2154, "incorrect value for last_msg.msg.almanac_gps_dep.common.toa.wn, expected 2154, is %d", last_msg.msg.almanac_gps_dep.common.toa.wn); - - ck_assert_msg((last_msg.msg.almanac_gps_dep.common.ura * 100 - 2.2 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps_dep.common.ura, expected 2.2, is %s", last_msg.msg.almanac_gps_dep.common.ura); - - ck_assert_msg(last_msg.msg.almanac_gps_dep.common.valid == 1, "incorrect value for last_msg.msg.almanac_gps_dep.common.valid, expected 1, is %d", last_msg.msg.almanac_gps_dep.common.valid); - - ck_assert_msg((last_msg.msg.almanac_gps_dep.ecc * 100 - 0.00707220705226 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps_dep.ecc, expected 0.00707220705226, is %s", last_msg.msg.almanac_gps_dep.ecc); - - ck_assert_msg((last_msg.msg.almanac_gps_dep.inc * 100 - 0.934151448026 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps_dep.inc, expected 0.934151448026, is %s", last_msg.msg.almanac_gps_dep.inc); - - ck_assert_msg((last_msg.msg.almanac_gps_dep.m0 * 100 - -0.0220007884211 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps_dep.m0, expected -0.0220007884211, is %s", last_msg.msg.almanac_gps_dep.m0); - - ck_assert_msg((last_msg.msg.almanac_gps_dep.omega0 * 100 - -1.87318184488 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps_dep.omega0, expected -1.87318184488, is %s", last_msg.msg.almanac_gps_dep.omega0); - - ck_assert_msg((last_msg.msg.almanac_gps_dep.omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps_dep.omegadot, expected -8.90358515577e-09, is %s", last_msg.msg.almanac_gps_dep.omegadot); - - ck_assert_msg((last_msg.msg.almanac_gps_dep.sqrta * 100 - 5153.55002975 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps_dep.sqrta, expected 5153.55002975, is %s", last_msg.msg.almanac_gps_dep.sqrta); - - ck_assert_msg((last_msg.msg.almanac_gps_dep.w * 100 - -0.98930366296 * 100) < 0.05, "incorrect value for last_msg.msg.almanac_gps_dep.w, expected -0.98930366296, is %s", last_msg.msg.almanac_gps_dep.w); + ck_assert_msg((last_msg.msg.almanac_gps_dep.af0 * 100 - + -0.00063150189817 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps_dep.af0, " + "expected -0.00063150189817, is %s", + last_msg.msg.almanac_gps_dep.af0); + + ck_assert_msg((last_msg.msg.almanac_gps_dep.af1 * 100 - + 8.98126018001e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps_dep.af1, " + "expected 8.98126018001e-12, is %s", + last_msg.msg.almanac_gps_dep.af1); + + ck_assert_msg( + last_msg.msg.almanac_gps_dep.common.fit_interval == 14400, + "incorrect value for last_msg.msg.almanac_gps_dep.common.fit_interval, " + "expected 14400, is %d", + last_msg.msg.almanac_gps_dep.common.fit_interval); + + ck_assert_msg( + last_msg.msg.almanac_gps_dep.common.health_bits == 0, + "incorrect value for last_msg.msg.almanac_gps_dep.common.health_bits, " + "expected 0, is %d", + last_msg.msg.almanac_gps_dep.common.health_bits); + + ck_assert_msg( + last_msg.msg.almanac_gps_dep.common.sid.code == 0, + "incorrect value for last_msg.msg.almanac_gps_dep.common.sid.code, " + "expected 0, is %d", + last_msg.msg.almanac_gps_dep.common.sid.code); + + ck_assert_msg( + last_msg.msg.almanac_gps_dep.common.sid.reserved == 0, + "incorrect value for last_msg.msg.almanac_gps_dep.common.sid.reserved, " + "expected 0, is %d", + last_msg.msg.almanac_gps_dep.common.sid.reserved); + + ck_assert_msg( + last_msg.msg.almanac_gps_dep.common.sid.sat == 22, + "incorrect value for last_msg.msg.almanac_gps_dep.common.sid.sat, " + "expected 22, is %d", + last_msg.msg.almanac_gps_dep.common.sid.sat); + + ck_assert_msg( + last_msg.msg.almanac_gps_dep.common.toa.tow == 446384, + "incorrect value for last_msg.msg.almanac_gps_dep.common.toa.tow, " + "expected 446384, is %d", + last_msg.msg.almanac_gps_dep.common.toa.tow); + + ck_assert_msg( + last_msg.msg.almanac_gps_dep.common.toa.wn == 2154, + "incorrect value for last_msg.msg.almanac_gps_dep.common.toa.wn, " + "expected 2154, is %d", + last_msg.msg.almanac_gps_dep.common.toa.wn); + + ck_assert_msg( + (last_msg.msg.almanac_gps_dep.common.ura * 100 - 2.2 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps_dep.common.ura, expected " + "2.2, is %s", + last_msg.msg.almanac_gps_dep.common.ura); + + ck_assert_msg( + last_msg.msg.almanac_gps_dep.common.valid == 1, + "incorrect value for last_msg.msg.almanac_gps_dep.common.valid, " + "expected 1, is %d", + last_msg.msg.almanac_gps_dep.common.valid); + + ck_assert_msg((last_msg.msg.almanac_gps_dep.ecc * 100 - + 0.00707220705226 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps_dep.ecc, " + "expected 0.00707220705226, is %s", + last_msg.msg.almanac_gps_dep.ecc); + + ck_assert_msg( + (last_msg.msg.almanac_gps_dep.inc * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps_dep.inc, expected " + "0.934151448026, is %s", + last_msg.msg.almanac_gps_dep.inc); + + ck_assert_msg( + (last_msg.msg.almanac_gps_dep.m0 * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps_dep.m0, expected " + "-0.0220007884211, is %s", + last_msg.msg.almanac_gps_dep.m0); + + ck_assert_msg((last_msg.msg.almanac_gps_dep.omega0 * 100 - + -1.87318184488 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps_dep.omega0, " + "expected -1.87318184488, is %s", + last_msg.msg.almanac_gps_dep.omega0); + + ck_assert_msg((last_msg.msg.almanac_gps_dep.omegadot * 100 - + -8.90358515577e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps_dep.omegadot, " + "expected -8.90358515577e-09, is %s", + last_msg.msg.almanac_gps_dep.omegadot); + + ck_assert_msg( + (last_msg.msg.almanac_gps_dep.sqrta * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps_dep.sqrta, expected " + "5153.55002975, is %s", + last_msg.msg.almanac_gps_dep.sqrta); + + ck_assert_msg( + (last_msg.msg.almanac_gps_dep.w * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for last_msg.msg.almanac_gps_dep.w, expected " + "-0.98930366296, is %s", + last_msg.msg.almanac_gps_dep.w); } } END_TEST -Suite* auto_check_sbp_observation_MsgAlmanacGPSDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgAlmanacGPSDep"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgAlmanacGPSDep"); +Suite *auto_check_sbp_observation_MsgAlmanacGPSDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgAlmanacGPSDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgAlmanacGPSDep"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgAlmanacGPSDep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgBasePosEcef.c b/c/test/auto_check_sbp_observation_MsgBasePosEcef.c index a45670b5c..52e831745 100644 --- a/c/test/auto_check_sbp_observation_MsgBasePosEcef.c +++ b/c/test/auto_check_sbp_observation_MsgBasePosEcef.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosEcef.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosEcef.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgBasePosEcef ) -{ +START_TEST(test_auto_check_sbp_observation_MsgBasePosEcef) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgBasePosEcef ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,55 +90,75 @@ START_TEST( test_auto_check_sbp_observation_MsgBasePosEcef ) logging_reset(); - sbp_callback_register(&sbp_state, 0x48, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x48, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,72,0,0,0,24,228,131,158,245,87,205,68,193,66,62,232,209,32,118,80,193,213,231,106,251,63,20,77,65,194,125, }; + u8 encoded_frame[] = { + 85, 72, 0, 0, 0, 24, 228, 131, 158, 245, 87, + 205, 68, 193, 66, 62, 232, 209, 32, 118, 80, 193, + 213, 231, 106, 251, 63, 20, 77, 65, 194, 125, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.base_pos_ecef.x = -2726575.9189; - + test_msg.base_pos_ecef.y = -4315267.2798; - + test_msg.base_pos_ecef.z = 3811455.9642; sbp_message_send(&sbp_state, SbpMsgBasePosEcef, 0, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBasePosEcef, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBasePosEcef, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.base_pos_ecef.x * 100 - -2726575.9189 * 100) < 0.05, "incorrect value for last_msg.msg.base_pos_ecef.x, expected -2726575.9189, is %s", last_msg.msg.base_pos_ecef.x); - - ck_assert_msg((last_msg.msg.base_pos_ecef.y * 100 - -4315267.2798 * 100) < 0.05, "incorrect value for last_msg.msg.base_pos_ecef.y, expected -4315267.2798, is %s", last_msg.msg.base_pos_ecef.y); - - ck_assert_msg((last_msg.msg.base_pos_ecef.z * 100 - 3811455.9642 * 100) < 0.05, "incorrect value for last_msg.msg.base_pos_ecef.z, expected 3811455.9642, is %s", last_msg.msg.base_pos_ecef.z); + ck_assert_msg( + (last_msg.msg.base_pos_ecef.x * 100 - -2726575.9189 * 100) < 0.05, + "incorrect value for last_msg.msg.base_pos_ecef.x, expected " + "-2726575.9189, is %s", + last_msg.msg.base_pos_ecef.x); + + ck_assert_msg( + (last_msg.msg.base_pos_ecef.y * 100 - -4315267.2798 * 100) < 0.05, + "incorrect value for last_msg.msg.base_pos_ecef.y, expected " + "-4315267.2798, is %s", + last_msg.msg.base_pos_ecef.y); + + ck_assert_msg( + (last_msg.msg.base_pos_ecef.z * 100 - 3811455.9642 * 100) < 0.05, + "incorrect value for last_msg.msg.base_pos_ecef.z, expected " + "3811455.9642, is %s", + last_msg.msg.base_pos_ecef.z); } } END_TEST -Suite* auto_check_sbp_observation_MsgBasePosEcef_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgBasePosEcef"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgBasePosEcef"); +Suite *auto_check_sbp_observation_MsgBasePosEcef_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgBasePosEcef"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_observation_MsgBasePosEcef"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgBasePosEcef); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgBasePosLLH.c b/c/test/auto_check_sbp_observation_MsgBasePosLLH.c index f7e30cec0..dcb9b910f 100644 --- a/c/test/auto_check_sbp_observation_MsgBasePosLLH.c +++ b/c/test/auto_check_sbp_observation_MsgBasePosLLH.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosLLH.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosLLH.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgBasePosLLH ) -{ +START_TEST(test_auto_check_sbp_observation_MsgBasePosLLH) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgBasePosLLH ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,55 +90,75 @@ START_TEST( test_auto_check_sbp_observation_MsgBasePosLLH ) logging_reset(); - sbp_callback_register(&sbp_state, 0x44, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x44, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,68,0,123,0,24,225,237,238,90,42,160,66,64,59,143,70,235,0,120,94,192,51,181,124,240,65,248,66,64,82,230, }; + u8 encoded_frame[] = { + 85, 68, 0, 123, 0, 24, 225, 237, 238, 90, 42, 160, 66, 64, 59, 143, + 70, 235, 0, 120, 94, 192, 51, 181, 124, 240, 65, 248, 66, 64, 82, 230, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.base_pos_llh.height = 37.939512310879216; - + test_msg.base_pos_llh.lat = 37.251292578377395; - + test_msg.base_pos_llh.lon = -121.87505609407974; - sbp_message_send(&sbp_state, SbpMsgBasePosLlh, 123, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBasePosLlh, 123, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBasePosLlh, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBasePosLlh, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.base_pos_llh.height * 100 - 37.9395123109 * 100) < 0.05, "incorrect value for last_msg.msg.base_pos_llh.height, expected 37.9395123109, is %s", last_msg.msg.base_pos_llh.height); - - ck_assert_msg((last_msg.msg.base_pos_llh.lat * 100 - 37.2512925784 * 100) < 0.05, "incorrect value for last_msg.msg.base_pos_llh.lat, expected 37.2512925784, is %s", last_msg.msg.base_pos_llh.lat); - - ck_assert_msg((last_msg.msg.base_pos_llh.lon * 100 - -121.875056094 * 100) < 0.05, "incorrect value for last_msg.msg.base_pos_llh.lon, expected -121.875056094, is %s", last_msg.msg.base_pos_llh.lon); + ck_assert_msg( + (last_msg.msg.base_pos_llh.height * 100 - 37.9395123109 * 100) < 0.05, + "incorrect value for last_msg.msg.base_pos_llh.height, expected " + "37.9395123109, is %s", + last_msg.msg.base_pos_llh.height); + + ck_assert_msg( + (last_msg.msg.base_pos_llh.lat * 100 - 37.2512925784 * 100) < 0.05, + "incorrect value for last_msg.msg.base_pos_llh.lat, expected " + "37.2512925784, is %s", + last_msg.msg.base_pos_llh.lat); + + ck_assert_msg( + (last_msg.msg.base_pos_llh.lon * 100 - -121.875056094 * 100) < 0.05, + "incorrect value for last_msg.msg.base_pos_llh.lon, expected " + "-121.875056094, is %s", + last_msg.msg.base_pos_llh.lon); } } END_TEST -Suite* auto_check_sbp_observation_MsgBasePosLLH_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgBasePosLLH"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgBasePosLLH"); +Suite *auto_check_sbp_observation_MsgBasePosLLH_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgBasePosLLH"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_observation_MsgBasePosLLH"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgBasePosLLH); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisBds.c b/c/test/auto_check_sbp_observation_MsgEphemerisBds.c index 57564afc8..cb7f4f73e 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisBds.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisBds.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisBds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisBds.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisBds ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisBds) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisBds ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,179 +90,312 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisBds ) logging_reset(); - sbp_callback_register(&sbp_state, 0x89, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x89, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,137,0,128,240,147,8,12,174,179,6,0,106,8,0,0,0,64,48,42,0,0,1,0,125,99,52,50,207,46,151,176,0,112,96,67,0,164,106,67,0,60,255,54,0,224,47,53,0,0,143,179,0,192,190,52,146,101,162,196,109,104,19,62,253,87,86,202,62,28,251,63,0,0,0,96,151,60,117,63,0,0,128,154,127,93,185,64,151,193,64,0,10,166,4,192,160,75,174,98,8,201,35,190,205,29,12,71,189,150,5,192,176,72,249,189,193,172,240,63,72,249,188,180,160,203,9,62,0,0,0,0,92,51,77,191,0,128,174,43,0,0,88,161,174,179,6,0,106,8,6,5,0,157,249, }; + u8 encoded_frame[] = { + 85, 137, 0, 128, 240, 147, 8, 12, 174, 179, 6, 0, 106, + 8, 0, 0, 0, 64, 48, 42, 0, 0, 1, 0, 125, 99, + 52, 50, 207, 46, 151, 176, 0, 112, 96, 67, 0, 164, 106, + 67, 0, 60, 255, 54, 0, 224, 47, 53, 0, 0, 143, 179, + 0, 192, 190, 52, 146, 101, 162, 196, 109, 104, 19, 62, 253, + 87, 86, 202, 62, 28, 251, 63, 0, 0, 0, 96, 151, 60, + 117, 63, 0, 0, 128, 154, 127, 93, 185, 64, 151, 193, 64, + 0, 10, 166, 4, 192, 160, 75, 174, 98, 8, 201, 35, 190, + 205, 29, 12, 71, 189, 150, 5, 192, 176, 72, 249, 189, 193, + 172, 240, 63, 72, 249, 188, 180, 160, 203, 9, 62, 0, 0, + 0, 0, 92, 51, 77, 191, 0, 128, 174, 43, 0, 0, 88, + 161, 174, 179, 6, 0, 106, 8, 6, 5, 0, 157, 249, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_bds.af0 = -0.0008911322802305222; - + test_msg.ephemeris_bds.af1 = 1.2398970739013748e-12; - + test_msg.ephemeris_bds.af2 = -7.318364664277155e-19; - + test_msg.ephemeris_bds.c_ic = -6.658956408500671e-08; - + test_msg.ephemeris_bds.c_is = 3.5529956221580505e-07; - + test_msg.ephemeris_bds.c_rc = 234.640625; - + test_msg.ephemeris_bds.c_rs = 224.4375; - + test_msg.ephemeris_bds.c_uc = 7.606577128171921e-06; - + test_msg.ephemeris_bds.c_us = 6.551854312419891e-07; - - + test_msg.ephemeris_bds.common.fit_interval = 10800; - + test_msg.ephemeris_bds.common.health_bits = 0; - - + test_msg.ephemeris_bds.common.sid.code = 12; - + test_msg.ephemeris_bds.common.sid.sat = 8; - - + test_msg.ephemeris_bds.common.toe.tow = 439214; - + test_msg.ephemeris_bds.common.toe.wn = 2154; - + test_msg.ephemeris_bds.common.ura = 2.0; - + test_msg.ephemeris_bds.common.valid = 1; - + test_msg.ephemeris_bds.dn = 1.1296899132622133e-09; - + test_msg.ephemeris_bds.ecc = 0.005184737499803305; - + test_msg.ephemeris_bds.inc = 1.0421769543504915; - + test_msg.ephemeris_bds.inc_dot = 7.507455572801683e-10; - + test_msg.ephemeris_bds.iodc = 5; - + test_msg.ephemeris_bds.iode = 6; - + test_msg.ephemeris_bds.m0 = 1.6943958190727237; - + test_msg.ephemeris_bds.omega0 = -2.581073762870982; - + test_msg.ephemeris_bds.omegadot = -2.303310227830545e-09; - + test_msg.ephemeris_bds.sqrta = 6493.49845123291; - + test_msg.ephemeris_bds.tgd1 = 1.0499999980595476e-08; - + test_msg.ephemeris_bds.tgd2 = -1.0999999799921056e-09; - - + test_msg.ephemeris_bds.toc.tow = 439214; - + test_msg.ephemeris_bds.toc.wn = 2154; - + test_msg.ephemeris_bds.w = -2.698603205735458; - sbp_message_send(&sbp_state, SbpMsgEphemerisBds, 61568, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisBds, 61568, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61568, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisBds, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisBds, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_bds.af0 * 100 - -0.000891132280231 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.af0, expected -0.000891132280231, is %s", last_msg.msg.ephemeris_bds.af0); - - ck_assert_msg((last_msg.msg.ephemeris_bds.af1 * 100 - 1.2398970739e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.af1, expected 1.2398970739e-12, is %s", last_msg.msg.ephemeris_bds.af1); - - ck_assert_msg((last_msg.msg.ephemeris_bds.af2 * 100 - -7.31836466428e-19 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.af2, expected -7.31836466428e-19, is %s", last_msg.msg.ephemeris_bds.af2); - - ck_assert_msg((last_msg.msg.ephemeris_bds.c_ic * 100 - -6.6589564085e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.c_ic, expected -6.6589564085e-08, is %s", last_msg.msg.ephemeris_bds.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_bds.c_is * 100 - 3.55299562216e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.c_is, expected 3.55299562216e-07, is %s", last_msg.msg.ephemeris_bds.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_bds.c_rc * 100 - 234.640625 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.c_rc, expected 234.640625, is %s", last_msg.msg.ephemeris_bds.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_bds.c_rs * 100 - 224.4375 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.c_rs, expected 224.4375, is %s", last_msg.msg.ephemeris_bds.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_bds.c_uc * 100 - 7.60657712817e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.c_uc, expected 7.60657712817e-06, is %s", last_msg.msg.ephemeris_bds.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_bds.c_us * 100 - 6.55185431242e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.c_us, expected 6.55185431242e-07, is %s", last_msg.msg.ephemeris_bds.c_us); - - - ck_assert_msg(last_msg.msg.ephemeris_bds.common.fit_interval == 10800, "incorrect value for last_msg.msg.ephemeris_bds.common.fit_interval, expected 10800, is %d", last_msg.msg.ephemeris_bds.common.fit_interval); - - ck_assert_msg(last_msg.msg.ephemeris_bds.common.health_bits == 0, "incorrect value for last_msg.msg.ephemeris_bds.common.health_bits, expected 0, is %d", last_msg.msg.ephemeris_bds.common.health_bits); - - - ck_assert_msg(last_msg.msg.ephemeris_bds.common.sid.code == 12, "incorrect value for last_msg.msg.ephemeris_bds.common.sid.code, expected 12, is %d", last_msg.msg.ephemeris_bds.common.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_bds.common.sid.sat == 8, "incorrect value for last_msg.msg.ephemeris_bds.common.sid.sat, expected 8, is %d", last_msg.msg.ephemeris_bds.common.sid.sat); - - - ck_assert_msg(last_msg.msg.ephemeris_bds.common.toe.tow == 439214, "incorrect value for last_msg.msg.ephemeris_bds.common.toe.tow, expected 439214, is %d", last_msg.msg.ephemeris_bds.common.toe.tow); - - ck_assert_msg(last_msg.msg.ephemeris_bds.common.toe.wn == 2154, "incorrect value for last_msg.msg.ephemeris_bds.common.toe.wn, expected 2154, is %d", last_msg.msg.ephemeris_bds.common.toe.wn); - - ck_assert_msg((last_msg.msg.ephemeris_bds.common.ura * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.common.ura, expected 2.0, is %s", last_msg.msg.ephemeris_bds.common.ura); - - ck_assert_msg(last_msg.msg.ephemeris_bds.common.valid == 1, "incorrect value for last_msg.msg.ephemeris_bds.common.valid, expected 1, is %d", last_msg.msg.ephemeris_bds.common.valid); - - ck_assert_msg((last_msg.msg.ephemeris_bds.dn * 100 - 1.12968991326e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.dn, expected 1.12968991326e-09, is %s", last_msg.msg.ephemeris_bds.dn); - - ck_assert_msg((last_msg.msg.ephemeris_bds.ecc * 100 - 0.0051847374998 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.ecc, expected 0.0051847374998, is %s", last_msg.msg.ephemeris_bds.ecc); - - ck_assert_msg((last_msg.msg.ephemeris_bds.inc * 100 - 1.04217695435 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.inc, expected 1.04217695435, is %s", last_msg.msg.ephemeris_bds.inc); - - ck_assert_msg((last_msg.msg.ephemeris_bds.inc_dot * 100 - 7.5074555728e-10 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.inc_dot, expected 7.5074555728e-10, is %s", last_msg.msg.ephemeris_bds.inc_dot); - - ck_assert_msg(last_msg.msg.ephemeris_bds.iodc == 5, "incorrect value for last_msg.msg.ephemeris_bds.iodc, expected 5, is %d", last_msg.msg.ephemeris_bds.iodc); - - ck_assert_msg(last_msg.msg.ephemeris_bds.iode == 6, "incorrect value for last_msg.msg.ephemeris_bds.iode, expected 6, is %d", last_msg.msg.ephemeris_bds.iode); - - ck_assert_msg((last_msg.msg.ephemeris_bds.m0 * 100 - 1.69439581907 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.m0, expected 1.69439581907, is %s", last_msg.msg.ephemeris_bds.m0); - - ck_assert_msg((last_msg.msg.ephemeris_bds.omega0 * 100 - -2.58107376287 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.omega0, expected -2.58107376287, is %s", last_msg.msg.ephemeris_bds.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_bds.omegadot * 100 - -2.30331022783e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.omegadot, expected -2.30331022783e-09, is %s", last_msg.msg.ephemeris_bds.omegadot); - - ck_assert_msg((last_msg.msg.ephemeris_bds.sqrta * 100 - 6493.49845123 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.sqrta, expected 6493.49845123, is %s", last_msg.msg.ephemeris_bds.sqrta); - - ck_assert_msg((last_msg.msg.ephemeris_bds.tgd1 * 100 - 1.04999999806e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.tgd1, expected 1.04999999806e-08, is %s", last_msg.msg.ephemeris_bds.tgd1); - - ck_assert_msg((last_msg.msg.ephemeris_bds.tgd2 * 100 - -1.09999997999e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.tgd2, expected -1.09999997999e-09, is %s", last_msg.msg.ephemeris_bds.tgd2); - - - ck_assert_msg(last_msg.msg.ephemeris_bds.toc.tow == 439214, "incorrect value for last_msg.msg.ephemeris_bds.toc.tow, expected 439214, is %d", last_msg.msg.ephemeris_bds.toc.tow); - - ck_assert_msg(last_msg.msg.ephemeris_bds.toc.wn == 2154, "incorrect value for last_msg.msg.ephemeris_bds.toc.wn, expected 2154, is %d", last_msg.msg.ephemeris_bds.toc.wn); - - ck_assert_msg((last_msg.msg.ephemeris_bds.w * 100 - -2.69860320574 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_bds.w, expected -2.69860320574, is %s", last_msg.msg.ephemeris_bds.w); + ck_assert_msg((last_msg.msg.ephemeris_bds.af0 * 100 - + -0.000891132280231 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.af0, " + "expected -0.000891132280231, is %s", + last_msg.msg.ephemeris_bds.af0); + + ck_assert_msg( + (last_msg.msg.ephemeris_bds.af1 * 100 - 1.2398970739e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.af1, expected " + "1.2398970739e-12, is %s", + last_msg.msg.ephemeris_bds.af1); + + ck_assert_msg((last_msg.msg.ephemeris_bds.af2 * 100 - + -7.31836466428e-19 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.af2, " + "expected -7.31836466428e-19, is %s", + last_msg.msg.ephemeris_bds.af2); + + ck_assert_msg((last_msg.msg.ephemeris_bds.c_ic * 100 - + -6.6589564085e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.c_ic, " + "expected -6.6589564085e-08, is %s", + last_msg.msg.ephemeris_bds.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_bds.c_is * 100 - + 3.55299562216e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.c_is, " + "expected 3.55299562216e-07, is %s", + last_msg.msg.ephemeris_bds.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_bds.c_rc * 100 - 234.640625 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.c_rc, expected " + "234.640625, is %s", + last_msg.msg.ephemeris_bds.c_rc); + + ck_assert_msg( + (last_msg.msg.ephemeris_bds.c_rs * 100 - 224.4375 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.c_rs, expected " + "224.4375, is %s", + last_msg.msg.ephemeris_bds.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_bds.c_uc * 100 - + 7.60657712817e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.c_uc, " + "expected 7.60657712817e-06, is %s", + last_msg.msg.ephemeris_bds.c_uc); + + ck_assert_msg((last_msg.msg.ephemeris_bds.c_us * 100 - + 6.55185431242e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.c_us, " + "expected 6.55185431242e-07, is %s", + last_msg.msg.ephemeris_bds.c_us); + + ck_assert_msg( + last_msg.msg.ephemeris_bds.common.fit_interval == 10800, + "incorrect value for last_msg.msg.ephemeris_bds.common.fit_interval, " + "expected 10800, is %d", + last_msg.msg.ephemeris_bds.common.fit_interval); + + ck_assert_msg( + last_msg.msg.ephemeris_bds.common.health_bits == 0, + "incorrect value for last_msg.msg.ephemeris_bds.common.health_bits, " + "expected 0, is %d", + last_msg.msg.ephemeris_bds.common.health_bits); + + ck_assert_msg( + last_msg.msg.ephemeris_bds.common.sid.code == 12, + "incorrect value for last_msg.msg.ephemeris_bds.common.sid.code, " + "expected 12, is %d", + last_msg.msg.ephemeris_bds.common.sid.code); + + ck_assert_msg( + last_msg.msg.ephemeris_bds.common.sid.sat == 8, + "incorrect value for last_msg.msg.ephemeris_bds.common.sid.sat, " + "expected 8, is %d", + last_msg.msg.ephemeris_bds.common.sid.sat); + + ck_assert_msg( + last_msg.msg.ephemeris_bds.common.toe.tow == 439214, + "incorrect value for last_msg.msg.ephemeris_bds.common.toe.tow, " + "expected 439214, is %d", + last_msg.msg.ephemeris_bds.common.toe.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_bds.common.toe.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_bds.common.toe.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_bds.common.toe.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_bds.common.ura * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.common.ura, expected " + "2.0, is %s", + last_msg.msg.ephemeris_bds.common.ura); + + ck_assert_msg(last_msg.msg.ephemeris_bds.common.valid == 1, + "incorrect value for " + "last_msg.msg.ephemeris_bds.common.valid, expected 1, is %d", + last_msg.msg.ephemeris_bds.common.valid); + + ck_assert_msg( + (last_msg.msg.ephemeris_bds.dn * 100 - 1.12968991326e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.dn, expected " + "1.12968991326e-09, is %s", + last_msg.msg.ephemeris_bds.dn); + + ck_assert_msg( + (last_msg.msg.ephemeris_bds.ecc * 100 - 0.0051847374998 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.ecc, expected " + "0.0051847374998, is %s", + last_msg.msg.ephemeris_bds.ecc); + + ck_assert_msg( + (last_msg.msg.ephemeris_bds.inc * 100 - 1.04217695435 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.inc, expected " + "1.04217695435, is %s", + last_msg.msg.ephemeris_bds.inc); + + ck_assert_msg((last_msg.msg.ephemeris_bds.inc_dot * 100 - + 7.5074555728e-10 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.inc_dot, " + "expected 7.5074555728e-10, is %s", + last_msg.msg.ephemeris_bds.inc_dot); + + ck_assert_msg(last_msg.msg.ephemeris_bds.iodc == 5, + "incorrect value for last_msg.msg.ephemeris_bds.iodc, " + "expected 5, is %d", + last_msg.msg.ephemeris_bds.iodc); + + ck_assert_msg(last_msg.msg.ephemeris_bds.iode == 6, + "incorrect value for last_msg.msg.ephemeris_bds.iode, " + "expected 6, is %d", + last_msg.msg.ephemeris_bds.iode); + + ck_assert_msg( + (last_msg.msg.ephemeris_bds.m0 * 100 - 1.69439581907 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.m0, expected " + "1.69439581907, is %s", + last_msg.msg.ephemeris_bds.m0); + + ck_assert_msg( + (last_msg.msg.ephemeris_bds.omega0 * 100 - -2.58107376287 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.omega0, expected " + "-2.58107376287, is %s", + last_msg.msg.ephemeris_bds.omega0); + + ck_assert_msg((last_msg.msg.ephemeris_bds.omegadot * 100 - + -2.30331022783e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.omegadot, " + "expected -2.30331022783e-09, is %s", + last_msg.msg.ephemeris_bds.omegadot); + + ck_assert_msg( + (last_msg.msg.ephemeris_bds.sqrta * 100 - 6493.49845123 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.sqrta, expected " + "6493.49845123, is %s", + last_msg.msg.ephemeris_bds.sqrta); + + ck_assert_msg((last_msg.msg.ephemeris_bds.tgd1 * 100 - + 1.04999999806e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.tgd1, " + "expected 1.04999999806e-08, is %s", + last_msg.msg.ephemeris_bds.tgd1); + + ck_assert_msg((last_msg.msg.ephemeris_bds.tgd2 * 100 - + -1.09999997999e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.tgd2, " + "expected -1.09999997999e-09, is %s", + last_msg.msg.ephemeris_bds.tgd2); + + ck_assert_msg(last_msg.msg.ephemeris_bds.toc.tow == 439214, + "incorrect value for last_msg.msg.ephemeris_bds.toc.tow, " + "expected 439214, is %d", + last_msg.msg.ephemeris_bds.toc.tow); + + ck_assert_msg(last_msg.msg.ephemeris_bds.toc.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_bds.toc.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_bds.toc.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_bds.w * 100 - -2.69860320574 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_bds.w, expected " + "-2.69860320574, is %s", + last_msg.msg.ephemeris_bds.w); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisBds_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisBds"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisBds"); +Suite *auto_check_sbp_observation_MsgEphemerisBds_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgEphemerisBds"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisBds"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisBds); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisDepA.c b/c/test/auto_check_sbp_observation_MsgEphemerisDepA.c index 8be9cf8a8..f3babc5e0 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisDepA.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisDepA ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,147 +90,265 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x1a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x1a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,26,0,195,4,175,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,154,153,153,153,153,153,201,63,205,204,204,204,192,62,27,65,106,8,205,204,204,204,192,62,27,65,106,8,1,0,22,242,84, }; + u8 encoded_frame[] = { + 85, 26, 0, 195, 4, 175, 0, 0, 0, 0, 0, 0, 83, 190, + 0, 0, 0, 0, 0, 40, 74, 192, 0, 0, 0, 0, 0, 74, + 115, 64, 0, 0, 0, 0, 0, 4, 199, 190, 0, 0, 0, 0, + 0, 80, 202, 62, 0, 0, 0, 0, 0, 0, 64, 62, 0, 0, + 0, 0, 0, 0, 127, 190, 114, 216, 96, 180, 49, 117, 56, 62, + 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, + 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, + 141, 248, 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, + 199, 39, 96, 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, + 221, 47, 100, 224, 255, 47, 198, 189, 0, 0, 0, 0, 108, 177, + 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 154, 153, 153, 153, + 153, 153, 201, 63, 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, + 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, 1, 0, 22, 242, + 84, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_dep_a.af0 = -0.0006315018981695175; - + test_msg.ephemeris_dep_a.af1 = 8.981260180007666e-12; - + test_msg.ephemeris_dep_a.af2 = 0.2; - + test_msg.ephemeris_dep_a.c_ic = 7.450580596923828e-09; - + test_msg.ephemeris_dep_a.c_is = -1.1548399925231934e-07; - + test_msg.ephemeris_dep_a.c_rc = 308.625; - + test_msg.ephemeris_dep_a.c_rs = -52.3125; - + test_msg.ephemeris_dep_a.c_uc = -2.7436763048171997e-06; - + test_msg.ephemeris_dep_a.c_us = 3.1366944313049316e-06; - + test_msg.ephemeris_dep_a.dn = 5.694522914022375e-09; - + test_msg.ephemeris_dep_a.ecc = 0.007072207052260637; - + test_msg.ephemeris_dep_a.healthy = 0; - + test_msg.ephemeris_dep_a.inc = 0.9341514480259797; - + test_msg.ephemeris_dep_a.inc_dot = -4.035882396415757e-11; - + test_msg.ephemeris_dep_a.m0 = -0.02200078842114688; - + test_msg.ephemeris_dep_a.omega0 = -1.8731818448797617; - + test_msg.ephemeris_dep_a.omegadot = -8.903585155774196e-09; - + test_msg.ephemeris_dep_a.prn = 22; - + test_msg.ephemeris_dep_a.sqrta = 5153.550029754639; - + test_msg.ephemeris_dep_a.tgd = -1.7695128917694092e-08; - + test_msg.ephemeris_dep_a.toc_tow = 446384.2; - + test_msg.ephemeris_dep_a.toc_wn = 2154; - + test_msg.ephemeris_dep_a.toe_tow = 446384.2; - + test_msg.ephemeris_dep_a.toe_wn = 2154; - + test_msg.ephemeris_dep_a.valid = 1; - + test_msg.ephemeris_dep_a.w = -0.9893036629599647; - sbp_message_send(&sbp_state, SbpMsgEphemerisDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.af0 * 100 - -0.00063150189817 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.af0, expected -0.00063150189817, is %s", last_msg.msg.ephemeris_dep_a.af0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.af1 * 100 - 8.98126018001e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.af1, expected 8.98126018001e-12, is %s", last_msg.msg.ephemeris_dep_a.af1); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.af2 * 100 - 0.2 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.af2, expected 0.2, is %s", last_msg.msg.ephemeris_dep_a.af2); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.c_ic * 100 - 7.45058059692e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.c_ic, expected 7.45058059692e-09, is %s", last_msg.msg.ephemeris_dep_a.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.c_is * 100 - -1.15483999252e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.c_is, expected -1.15483999252e-07, is %s", last_msg.msg.ephemeris_dep_a.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.c_rc * 100 - 308.625 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.c_rc, expected 308.625, is %s", last_msg.msg.ephemeris_dep_a.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.c_rs * 100 - -52.3125 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.c_rs, expected -52.3125, is %s", last_msg.msg.ephemeris_dep_a.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.c_uc * 100 - -2.74367630482e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.c_uc, expected -2.74367630482e-06, is %s", last_msg.msg.ephemeris_dep_a.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.c_us * 100 - 3.1366944313e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.c_us, expected 3.1366944313e-06, is %s", last_msg.msg.ephemeris_dep_a.c_us); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.dn * 100 - 5.69452291402e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.dn, expected 5.69452291402e-09, is %s", last_msg.msg.ephemeris_dep_a.dn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.ecc * 100 - 0.00707220705226 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.ecc, expected 0.00707220705226, is %s", last_msg.msg.ephemeris_dep_a.ecc); - - ck_assert_msg(last_msg.msg.ephemeris_dep_a.healthy == 0, "incorrect value for last_msg.msg.ephemeris_dep_a.healthy, expected 0, is %d", last_msg.msg.ephemeris_dep_a.healthy); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.inc * 100 - 0.934151448026 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.inc, expected 0.934151448026, is %s", last_msg.msg.ephemeris_dep_a.inc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.inc_dot * 100 - -4.03588239642e-11 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.inc_dot, expected -4.03588239642e-11, is %s", last_msg.msg.ephemeris_dep_a.inc_dot); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.m0 * 100 - -0.0220007884211 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.m0, expected -0.0220007884211, is %s", last_msg.msg.ephemeris_dep_a.m0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.omega0 * 100 - -1.87318184488 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.omega0, expected -1.87318184488, is %s", last_msg.msg.ephemeris_dep_a.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.omegadot, expected -8.90358515577e-09, is %s", last_msg.msg.ephemeris_dep_a.omegadot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_a.prn == 22, "incorrect value for last_msg.msg.ephemeris_dep_a.prn, expected 22, is %d", last_msg.msg.ephemeris_dep_a.prn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.sqrta * 100 - 5153.55002975 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.sqrta, expected 5153.55002975, is %s", last_msg.msg.ephemeris_dep_a.sqrta); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.tgd * 100 - -1.76951289177e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.tgd, expected -1.76951289177e-08, is %s", last_msg.msg.ephemeris_dep_a.tgd); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.toc_tow * 100 - 446384.2 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.toc_tow, expected 446384.2, is %s", last_msg.msg.ephemeris_dep_a.toc_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_a.toc_wn == 2154, "incorrect value for last_msg.msg.ephemeris_dep_a.toc_wn, expected 2154, is %d", last_msg.msg.ephemeris_dep_a.toc_wn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.toe_tow * 100 - 446384.2 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.toe_tow, expected 446384.2, is %s", last_msg.msg.ephemeris_dep_a.toe_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_a.toe_wn == 2154, "incorrect value for last_msg.msg.ephemeris_dep_a.toe_wn, expected 2154, is %d", last_msg.msg.ephemeris_dep_a.toe_wn); - - ck_assert_msg(last_msg.msg.ephemeris_dep_a.valid == 1, "incorrect value for last_msg.msg.ephemeris_dep_a.valid, expected 1, is %d", last_msg.msg.ephemeris_dep_a.valid); - - ck_assert_msg((last_msg.msg.ephemeris_dep_a.w * 100 - -0.98930366296 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_a.w, expected -0.98930366296, is %s", last_msg.msg.ephemeris_dep_a.w); + ck_assert_msg((last_msg.msg.ephemeris_dep_a.af0 * 100 - + -0.00063150189817 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.af0, " + "expected -0.00063150189817, is %s", + last_msg.msg.ephemeris_dep_a.af0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_a.af1 * 100 - + 8.98126018001e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.af1, " + "expected 8.98126018001e-12, is %s", + last_msg.msg.ephemeris_dep_a.af1); + + ck_assert_msg((last_msg.msg.ephemeris_dep_a.af2 * 100 - 0.2 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.af2, " + "expected 0.2, is %s", + last_msg.msg.ephemeris_dep_a.af2); + + ck_assert_msg((last_msg.msg.ephemeris_dep_a.c_ic * 100 - + 7.45058059692e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.c_ic, " + "expected 7.45058059692e-09, is %s", + last_msg.msg.ephemeris_dep_a.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_dep_a.c_is * 100 - + -1.15483999252e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.c_is, " + "expected -1.15483999252e-07, is %s", + last_msg.msg.ephemeris_dep_a.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_a.c_rc * 100 - 308.625 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.c_rc, expected " + "308.625, is %s", + last_msg.msg.ephemeris_dep_a.c_rc); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_a.c_rs * 100 - -52.3125 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.c_rs, expected " + "-52.3125, is %s", + last_msg.msg.ephemeris_dep_a.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_dep_a.c_uc * 100 - + -2.74367630482e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.c_uc, " + "expected -2.74367630482e-06, is %s", + last_msg.msg.ephemeris_dep_a.c_uc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_a.c_us * 100 - + 3.1366944313e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.c_us, " + "expected 3.1366944313e-06, is %s", + last_msg.msg.ephemeris_dep_a.c_us); + + ck_assert_msg((last_msg.msg.ephemeris_dep_a.dn * 100 - + 5.69452291402e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.dn, " + "expected 5.69452291402e-09, is %s", + last_msg.msg.ephemeris_dep_a.dn); + + ck_assert_msg((last_msg.msg.ephemeris_dep_a.ecc * 100 - + 0.00707220705226 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.ecc, " + "expected 0.00707220705226, is %s", + last_msg.msg.ephemeris_dep_a.ecc); + + ck_assert_msg(last_msg.msg.ephemeris_dep_a.healthy == 0, + "incorrect value for last_msg.msg.ephemeris_dep_a.healthy, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_a.healthy); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_a.inc * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.inc, expected " + "0.934151448026, is %s", + last_msg.msg.ephemeris_dep_a.inc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_a.inc_dot * 100 - + -4.03588239642e-11 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.inc_dot, " + "expected -4.03588239642e-11, is %s", + last_msg.msg.ephemeris_dep_a.inc_dot); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_a.m0 * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.m0, expected " + "-0.0220007884211, is %s", + last_msg.msg.ephemeris_dep_a.m0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_a.omega0 * 100 - + -1.87318184488 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.omega0, " + "expected -1.87318184488, is %s", + last_msg.msg.ephemeris_dep_a.omega0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_a.omegadot * 100 - + -8.90358515577e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.omegadot, " + "expected -8.90358515577e-09, is %s", + last_msg.msg.ephemeris_dep_a.omegadot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_a.prn == 22, + "incorrect value for last_msg.msg.ephemeris_dep_a.prn, " + "expected 22, is %d", + last_msg.msg.ephemeris_dep_a.prn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_a.sqrta * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.sqrta, expected " + "5153.55002975, is %s", + last_msg.msg.ephemeris_dep_a.sqrta); + + ck_assert_msg((last_msg.msg.ephemeris_dep_a.tgd * 100 - + -1.76951289177e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.tgd, " + "expected -1.76951289177e-08, is %s", + last_msg.msg.ephemeris_dep_a.tgd); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_a.toc_tow * 100 - 446384.2 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.toc_tow, expected " + "446384.2, is %s", + last_msg.msg.ephemeris_dep_a.toc_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_a.toc_wn == 2154, + "incorrect value for last_msg.msg.ephemeris_dep_a.toc_wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_dep_a.toc_wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_a.toe_tow * 100 - 446384.2 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.toe_tow, expected " + "446384.2, is %s", + last_msg.msg.ephemeris_dep_a.toe_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_a.toe_wn == 2154, + "incorrect value for last_msg.msg.ephemeris_dep_a.toe_wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_dep_a.toe_wn); + + ck_assert_msg(last_msg.msg.ephemeris_dep_a.valid == 1, + "incorrect value for last_msg.msg.ephemeris_dep_a.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_dep_a.valid); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_a.w * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_a.w, expected " + "-0.98930366296, is %s", + last_msg.msg.ephemeris_dep_a.w); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisDepA"); +Suite *auto_check_sbp_observation_MsgEphemerisDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgEphemerisDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisDepC.c b/c/test/auto_check_sbp_observation_MsgEphemerisDepC.c index a90f00517..bcc5fc086 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisDepC.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisDepC.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepC.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisDepC ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisDepC) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisDepC ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,169 +90,301 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisDepC ) logging_reset(); - sbp_callback_register(&sbp_state, 0x47, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x47, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,71,0,195,4,185,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,154,153,153,153,153,153,201,63,205,204,204,204,192,62,27,65,106,8,205,204,204,204,192,62,27,65,106,8,1,0,22,0,0,0,45,45,0,0,0,0,0,23,170, }; + u8 encoded_frame[] = { + 85, 71, 0, 195, 4, 185, 0, 0, 0, 0, 0, 0, 83, 190, + 0, 0, 0, 0, 0, 40, 74, 192, 0, 0, 0, 0, 0, 74, + 115, 64, 0, 0, 0, 0, 0, 4, 199, 190, 0, 0, 0, 0, + 0, 80, 202, 62, 0, 0, 0, 0, 0, 0, 64, 62, 0, 0, + 0, 0, 0, 0, 127, 190, 114, 216, 96, 180, 49, 117, 56, 62, + 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, + 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, + 141, 248, 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, + 199, 39, 96, 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, + 221, 47, 100, 224, 255, 47, 198, 189, 0, 0, 0, 0, 108, 177, + 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 154, 153, 153, 153, + 153, 153, 201, 63, 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, + 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, 1, 0, 22, 0, + 0, 0, 45, 45, 0, 0, 0, 0, 0, 23, 170, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_dep_c.af0 = -0.0006315018981695175; - + test_msg.ephemeris_dep_c.af1 = 8.981260180007666e-12; - + test_msg.ephemeris_dep_c.af2 = 0.2; - + test_msg.ephemeris_dep_c.c_ic = 7.450580596923828e-09; - + test_msg.ephemeris_dep_c.c_is = -1.1548399925231934e-07; - + test_msg.ephemeris_dep_c.c_rc = 308.625; - + test_msg.ephemeris_dep_c.c_rs = -52.3125; - + test_msg.ephemeris_dep_c.c_uc = -2.7436763048171997e-06; - + test_msg.ephemeris_dep_c.c_us = 3.1366944313049316e-06; - + test_msg.ephemeris_dep_c.dn = 5.694522914022375e-09; - + test_msg.ephemeris_dep_c.ecc = 0.007072207052260637; - + test_msg.ephemeris_dep_c.healthy = 0; - + test_msg.ephemeris_dep_c.inc = 0.9341514480259797; - + test_msg.ephemeris_dep_c.inc_dot = -4.035882396415757e-11; - + test_msg.ephemeris_dep_c.iodc = 45; - + test_msg.ephemeris_dep_c.iode = 45; - + test_msg.ephemeris_dep_c.m0 = -0.02200078842114688; - + test_msg.ephemeris_dep_c.omega0 = -1.8731818448797617; - + test_msg.ephemeris_dep_c.omegadot = -8.903585155774196e-09; - + test_msg.ephemeris_dep_c.reserved = 0; - - + test_msg.ephemeris_dep_c.sid.code = 0; - + test_msg.ephemeris_dep_c.sid.reserved = 0; - + test_msg.ephemeris_dep_c.sid.sat = 22; - + test_msg.ephemeris_dep_c.sqrta = 5153.550029754639; - + test_msg.ephemeris_dep_c.tgd = -1.7695128917694092e-08; - + test_msg.ephemeris_dep_c.toc_tow = 446384.2; - + test_msg.ephemeris_dep_c.toc_wn = 2154; - + test_msg.ephemeris_dep_c.toe_tow = 446384.2; - + test_msg.ephemeris_dep_c.toe_wn = 2154; - + test_msg.ephemeris_dep_c.valid = 1; - + test_msg.ephemeris_dep_c.w = -0.9893036629599647; - sbp_message_send(&sbp_state, SbpMsgEphemerisDepC, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisDepC, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisDepC, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisDepC, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.af0 * 100 - -0.00063150189817 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.af0, expected -0.00063150189817, is %s", last_msg.msg.ephemeris_dep_c.af0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.af1 * 100 - 8.98126018001e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.af1, expected 8.98126018001e-12, is %s", last_msg.msg.ephemeris_dep_c.af1); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.af2 * 100 - 0.2 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.af2, expected 0.2, is %s", last_msg.msg.ephemeris_dep_c.af2); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.c_ic * 100 - 7.45058059692e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.c_ic, expected 7.45058059692e-09, is %s", last_msg.msg.ephemeris_dep_c.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.c_is * 100 - -1.15483999252e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.c_is, expected -1.15483999252e-07, is %s", last_msg.msg.ephemeris_dep_c.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.c_rc * 100 - 308.625 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.c_rc, expected 308.625, is %s", last_msg.msg.ephemeris_dep_c.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.c_rs * 100 - -52.3125 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.c_rs, expected -52.3125, is %s", last_msg.msg.ephemeris_dep_c.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.c_uc * 100 - -2.74367630482e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.c_uc, expected -2.74367630482e-06, is %s", last_msg.msg.ephemeris_dep_c.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.c_us * 100 - 3.1366944313e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.c_us, expected 3.1366944313e-06, is %s", last_msg.msg.ephemeris_dep_c.c_us); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.dn * 100 - 5.69452291402e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.dn, expected 5.69452291402e-09, is %s", last_msg.msg.ephemeris_dep_c.dn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.ecc * 100 - 0.00707220705226 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.ecc, expected 0.00707220705226, is %s", last_msg.msg.ephemeris_dep_c.ecc); - - ck_assert_msg(last_msg.msg.ephemeris_dep_c.healthy == 0, "incorrect value for last_msg.msg.ephemeris_dep_c.healthy, expected 0, is %d", last_msg.msg.ephemeris_dep_c.healthy); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.inc * 100 - 0.934151448026 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.inc, expected 0.934151448026, is %s", last_msg.msg.ephemeris_dep_c.inc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.inc_dot * 100 - -4.03588239642e-11 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.inc_dot, expected -4.03588239642e-11, is %s", last_msg.msg.ephemeris_dep_c.inc_dot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_c.iodc == 45, "incorrect value for last_msg.msg.ephemeris_dep_c.iodc, expected 45, is %d", last_msg.msg.ephemeris_dep_c.iodc); - - ck_assert_msg(last_msg.msg.ephemeris_dep_c.iode == 45, "incorrect value for last_msg.msg.ephemeris_dep_c.iode, expected 45, is %d", last_msg.msg.ephemeris_dep_c.iode); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.m0 * 100 - -0.0220007884211 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.m0, expected -0.0220007884211, is %s", last_msg.msg.ephemeris_dep_c.m0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.omega0 * 100 - -1.87318184488 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.omega0, expected -1.87318184488, is %s", last_msg.msg.ephemeris_dep_c.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.omegadot, expected -8.90358515577e-09, is %s", last_msg.msg.ephemeris_dep_c.omegadot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_c.reserved == 0, "incorrect value for last_msg.msg.ephemeris_dep_c.reserved, expected 0, is %d", last_msg.msg.ephemeris_dep_c.reserved); - - - ck_assert_msg(last_msg.msg.ephemeris_dep_c.sid.code == 0, "incorrect value for last_msg.msg.ephemeris_dep_c.sid.code, expected 0, is %d", last_msg.msg.ephemeris_dep_c.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_dep_c.sid.reserved == 0, "incorrect value for last_msg.msg.ephemeris_dep_c.sid.reserved, expected 0, is %d", last_msg.msg.ephemeris_dep_c.sid.reserved); - - ck_assert_msg(last_msg.msg.ephemeris_dep_c.sid.sat == 22, "incorrect value for last_msg.msg.ephemeris_dep_c.sid.sat, expected 22, is %d", last_msg.msg.ephemeris_dep_c.sid.sat); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.sqrta * 100 - 5153.55002975 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.sqrta, expected 5153.55002975, is %s", last_msg.msg.ephemeris_dep_c.sqrta); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.tgd * 100 - -1.76951289177e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.tgd, expected -1.76951289177e-08, is %s", last_msg.msg.ephemeris_dep_c.tgd); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.toc_tow * 100 - 446384.2 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.toc_tow, expected 446384.2, is %s", last_msg.msg.ephemeris_dep_c.toc_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_c.toc_wn == 2154, "incorrect value for last_msg.msg.ephemeris_dep_c.toc_wn, expected 2154, is %d", last_msg.msg.ephemeris_dep_c.toc_wn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.toe_tow * 100 - 446384.2 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.toe_tow, expected 446384.2, is %s", last_msg.msg.ephemeris_dep_c.toe_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_c.toe_wn == 2154, "incorrect value for last_msg.msg.ephemeris_dep_c.toe_wn, expected 2154, is %d", last_msg.msg.ephemeris_dep_c.toe_wn); - - ck_assert_msg(last_msg.msg.ephemeris_dep_c.valid == 1, "incorrect value for last_msg.msg.ephemeris_dep_c.valid, expected 1, is %d", last_msg.msg.ephemeris_dep_c.valid); - - ck_assert_msg((last_msg.msg.ephemeris_dep_c.w * 100 - -0.98930366296 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_c.w, expected -0.98930366296, is %s", last_msg.msg.ephemeris_dep_c.w); + ck_assert_msg((last_msg.msg.ephemeris_dep_c.af0 * 100 - + -0.00063150189817 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.af0, " + "expected -0.00063150189817, is %s", + last_msg.msg.ephemeris_dep_c.af0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_c.af1 * 100 - + 8.98126018001e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.af1, " + "expected 8.98126018001e-12, is %s", + last_msg.msg.ephemeris_dep_c.af1); + + ck_assert_msg((last_msg.msg.ephemeris_dep_c.af2 * 100 - 0.2 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.af2, " + "expected 0.2, is %s", + last_msg.msg.ephemeris_dep_c.af2); + + ck_assert_msg((last_msg.msg.ephemeris_dep_c.c_ic * 100 - + 7.45058059692e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.c_ic, " + "expected 7.45058059692e-09, is %s", + last_msg.msg.ephemeris_dep_c.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_dep_c.c_is * 100 - + -1.15483999252e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.c_is, " + "expected -1.15483999252e-07, is %s", + last_msg.msg.ephemeris_dep_c.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_c.c_rc * 100 - 308.625 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.c_rc, expected " + "308.625, is %s", + last_msg.msg.ephemeris_dep_c.c_rc); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_c.c_rs * 100 - -52.3125 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.c_rs, expected " + "-52.3125, is %s", + last_msg.msg.ephemeris_dep_c.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_dep_c.c_uc * 100 - + -2.74367630482e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.c_uc, " + "expected -2.74367630482e-06, is %s", + last_msg.msg.ephemeris_dep_c.c_uc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_c.c_us * 100 - + 3.1366944313e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.c_us, " + "expected 3.1366944313e-06, is %s", + last_msg.msg.ephemeris_dep_c.c_us); + + ck_assert_msg((last_msg.msg.ephemeris_dep_c.dn * 100 - + 5.69452291402e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.dn, " + "expected 5.69452291402e-09, is %s", + last_msg.msg.ephemeris_dep_c.dn); + + ck_assert_msg((last_msg.msg.ephemeris_dep_c.ecc * 100 - + 0.00707220705226 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.ecc, " + "expected 0.00707220705226, is %s", + last_msg.msg.ephemeris_dep_c.ecc); + + ck_assert_msg(last_msg.msg.ephemeris_dep_c.healthy == 0, + "incorrect value for last_msg.msg.ephemeris_dep_c.healthy, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_c.healthy); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_c.inc * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.inc, expected " + "0.934151448026, is %s", + last_msg.msg.ephemeris_dep_c.inc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_c.inc_dot * 100 - + -4.03588239642e-11 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.inc_dot, " + "expected -4.03588239642e-11, is %s", + last_msg.msg.ephemeris_dep_c.inc_dot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_c.iodc == 45, + "incorrect value for last_msg.msg.ephemeris_dep_c.iodc, " + "expected 45, is %d", + last_msg.msg.ephemeris_dep_c.iodc); + + ck_assert_msg(last_msg.msg.ephemeris_dep_c.iode == 45, + "incorrect value for last_msg.msg.ephemeris_dep_c.iode, " + "expected 45, is %d", + last_msg.msg.ephemeris_dep_c.iode); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_c.m0 * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.m0, expected " + "-0.0220007884211, is %s", + last_msg.msg.ephemeris_dep_c.m0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_c.omega0 * 100 - + -1.87318184488 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.omega0, " + "expected -1.87318184488, is %s", + last_msg.msg.ephemeris_dep_c.omega0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_c.omegadot * 100 - + -8.90358515577e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.omegadot, " + "expected -8.90358515577e-09, is %s", + last_msg.msg.ephemeris_dep_c.omegadot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_c.reserved == 0, + "incorrect value for last_msg.msg.ephemeris_dep_c.reserved, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_c.reserved); + + ck_assert_msg(last_msg.msg.ephemeris_dep_c.sid.code == 0, + "incorrect value for last_msg.msg.ephemeris_dep_c.sid.code, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_c.sid.code); + + ck_assert_msg( + last_msg.msg.ephemeris_dep_c.sid.reserved == 0, + "incorrect value for last_msg.msg.ephemeris_dep_c.sid.reserved, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_c.sid.reserved); + + ck_assert_msg(last_msg.msg.ephemeris_dep_c.sid.sat == 22, + "incorrect value for last_msg.msg.ephemeris_dep_c.sid.sat, " + "expected 22, is %d", + last_msg.msg.ephemeris_dep_c.sid.sat); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_c.sqrta * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.sqrta, expected " + "5153.55002975, is %s", + last_msg.msg.ephemeris_dep_c.sqrta); + + ck_assert_msg((last_msg.msg.ephemeris_dep_c.tgd * 100 - + -1.76951289177e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.tgd, " + "expected -1.76951289177e-08, is %s", + last_msg.msg.ephemeris_dep_c.tgd); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_c.toc_tow * 100 - 446384.2 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.toc_tow, expected " + "446384.2, is %s", + last_msg.msg.ephemeris_dep_c.toc_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_c.toc_wn == 2154, + "incorrect value for last_msg.msg.ephemeris_dep_c.toc_wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_dep_c.toc_wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_c.toe_tow * 100 - 446384.2 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.toe_tow, expected " + "446384.2, is %s", + last_msg.msg.ephemeris_dep_c.toe_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_c.toe_wn == 2154, + "incorrect value for last_msg.msg.ephemeris_dep_c.toe_wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_dep_c.toe_wn); + + ck_assert_msg(last_msg.msg.ephemeris_dep_c.valid == 1, + "incorrect value for last_msg.msg.ephemeris_dep_c.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_dep_c.valid); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_c.w * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_c.w, expected " + "-0.98930366296, is %s", + last_msg.msg.ephemeris_dep_c.w); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisDepC_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisDepC"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisDepC"); +Suite *auto_check_sbp_observation_MsgEphemerisDepC_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgEphemerisDepC"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisDepC"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisDepC); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisDepD.c b/c/test/auto_check_sbp_observation_MsgEphemerisDepD.c index c3b7416bd..38ba882a2 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisDepD.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisDepD.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepD.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepD.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisDepD ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisDepD) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisDepD ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,169 +90,301 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisDepD ) logging_reset(); - sbp_callback_register(&sbp_state, 0x80, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x80, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,128,0,195,4,185,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,154,153,153,153,153,153,201,63,205,204,204,204,192,62,27,65,106,8,205,204,204,204,192,62,27,65,106,8,1,0,22,0,0,0,45,45,0,0,0,0,0,95,7, }; + u8 encoded_frame[] = { + 85, 128, 0, 195, 4, 185, 0, 0, 0, 0, 0, 0, 83, 190, + 0, 0, 0, 0, 0, 40, 74, 192, 0, 0, 0, 0, 0, 74, + 115, 64, 0, 0, 0, 0, 0, 4, 199, 190, 0, 0, 0, 0, + 0, 80, 202, 62, 0, 0, 0, 0, 0, 0, 64, 62, 0, 0, + 0, 0, 0, 0, 127, 190, 114, 216, 96, 180, 49, 117, 56, 62, + 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, + 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, + 141, 248, 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, + 199, 39, 96, 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, + 221, 47, 100, 224, 255, 47, 198, 189, 0, 0, 0, 0, 108, 177, + 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 154, 153, 153, 153, + 153, 153, 201, 63, 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, + 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, 1, 0, 22, 0, + 0, 0, 45, 45, 0, 0, 0, 0, 0, 95, 7, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_dep_d.af0 = -0.0006315018981695175; - + test_msg.ephemeris_dep_d.af1 = 8.981260180007666e-12; - + test_msg.ephemeris_dep_d.af2 = 0.2; - + test_msg.ephemeris_dep_d.c_ic = 7.450580596923828e-09; - + test_msg.ephemeris_dep_d.c_is = -1.1548399925231934e-07; - + test_msg.ephemeris_dep_d.c_rc = 308.625; - + test_msg.ephemeris_dep_d.c_rs = -52.3125; - + test_msg.ephemeris_dep_d.c_uc = -2.7436763048171997e-06; - + test_msg.ephemeris_dep_d.c_us = 3.1366944313049316e-06; - + test_msg.ephemeris_dep_d.dn = 5.694522914022375e-09; - + test_msg.ephemeris_dep_d.ecc = 0.007072207052260637; - + test_msg.ephemeris_dep_d.healthy = 0; - + test_msg.ephemeris_dep_d.inc = 0.9341514480259797; - + test_msg.ephemeris_dep_d.inc_dot = -4.035882396415757e-11; - + test_msg.ephemeris_dep_d.iodc = 45; - + test_msg.ephemeris_dep_d.iode = 45; - + test_msg.ephemeris_dep_d.m0 = -0.02200078842114688; - + test_msg.ephemeris_dep_d.omega0 = -1.8731818448797617; - + test_msg.ephemeris_dep_d.omegadot = -8.903585155774196e-09; - + test_msg.ephemeris_dep_d.reserved = 0; - - + test_msg.ephemeris_dep_d.sid.code = 0; - + test_msg.ephemeris_dep_d.sid.reserved = 0; - + test_msg.ephemeris_dep_d.sid.sat = 22; - + test_msg.ephemeris_dep_d.sqrta = 5153.550029754639; - + test_msg.ephemeris_dep_d.tgd = -1.7695128917694092e-08; - + test_msg.ephemeris_dep_d.toc_tow = 446384.2; - + test_msg.ephemeris_dep_d.toc_wn = 2154; - + test_msg.ephemeris_dep_d.toe_tow = 446384.2; - + test_msg.ephemeris_dep_d.toe_wn = 2154; - + test_msg.ephemeris_dep_d.valid = 1; - + test_msg.ephemeris_dep_d.w = -0.9893036629599647; - sbp_message_send(&sbp_state, SbpMsgEphemerisDepD, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisDepD, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisDepD, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisDepD, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.af0 * 100 - -0.00063150189817 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.af0, expected -0.00063150189817, is %s", last_msg.msg.ephemeris_dep_d.af0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.af1 * 100 - 8.98126018001e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.af1, expected 8.98126018001e-12, is %s", last_msg.msg.ephemeris_dep_d.af1); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.af2 * 100 - 0.2 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.af2, expected 0.2, is %s", last_msg.msg.ephemeris_dep_d.af2); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.c_ic * 100 - 7.45058059692e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.c_ic, expected 7.45058059692e-09, is %s", last_msg.msg.ephemeris_dep_d.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.c_is * 100 - -1.15483999252e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.c_is, expected -1.15483999252e-07, is %s", last_msg.msg.ephemeris_dep_d.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.c_rc * 100 - 308.625 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.c_rc, expected 308.625, is %s", last_msg.msg.ephemeris_dep_d.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.c_rs * 100 - -52.3125 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.c_rs, expected -52.3125, is %s", last_msg.msg.ephemeris_dep_d.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.c_uc * 100 - -2.74367630482e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.c_uc, expected -2.74367630482e-06, is %s", last_msg.msg.ephemeris_dep_d.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.c_us * 100 - 3.1366944313e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.c_us, expected 3.1366944313e-06, is %s", last_msg.msg.ephemeris_dep_d.c_us); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.dn * 100 - 5.69452291402e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.dn, expected 5.69452291402e-09, is %s", last_msg.msg.ephemeris_dep_d.dn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.ecc * 100 - 0.00707220705226 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.ecc, expected 0.00707220705226, is %s", last_msg.msg.ephemeris_dep_d.ecc); - - ck_assert_msg(last_msg.msg.ephemeris_dep_d.healthy == 0, "incorrect value for last_msg.msg.ephemeris_dep_d.healthy, expected 0, is %d", last_msg.msg.ephemeris_dep_d.healthy); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.inc * 100 - 0.934151448026 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.inc, expected 0.934151448026, is %s", last_msg.msg.ephemeris_dep_d.inc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.inc_dot * 100 - -4.03588239642e-11 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.inc_dot, expected -4.03588239642e-11, is %s", last_msg.msg.ephemeris_dep_d.inc_dot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_d.iodc == 45, "incorrect value for last_msg.msg.ephemeris_dep_d.iodc, expected 45, is %d", last_msg.msg.ephemeris_dep_d.iodc); - - ck_assert_msg(last_msg.msg.ephemeris_dep_d.iode == 45, "incorrect value for last_msg.msg.ephemeris_dep_d.iode, expected 45, is %d", last_msg.msg.ephemeris_dep_d.iode); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.m0 * 100 - -0.0220007884211 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.m0, expected -0.0220007884211, is %s", last_msg.msg.ephemeris_dep_d.m0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.omega0 * 100 - -1.87318184488 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.omega0, expected -1.87318184488, is %s", last_msg.msg.ephemeris_dep_d.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.omegadot, expected -8.90358515577e-09, is %s", last_msg.msg.ephemeris_dep_d.omegadot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_d.reserved == 0, "incorrect value for last_msg.msg.ephemeris_dep_d.reserved, expected 0, is %d", last_msg.msg.ephemeris_dep_d.reserved); - - - ck_assert_msg(last_msg.msg.ephemeris_dep_d.sid.code == 0, "incorrect value for last_msg.msg.ephemeris_dep_d.sid.code, expected 0, is %d", last_msg.msg.ephemeris_dep_d.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_dep_d.sid.reserved == 0, "incorrect value for last_msg.msg.ephemeris_dep_d.sid.reserved, expected 0, is %d", last_msg.msg.ephemeris_dep_d.sid.reserved); - - ck_assert_msg(last_msg.msg.ephemeris_dep_d.sid.sat == 22, "incorrect value for last_msg.msg.ephemeris_dep_d.sid.sat, expected 22, is %d", last_msg.msg.ephemeris_dep_d.sid.sat); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.sqrta * 100 - 5153.55002975 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.sqrta, expected 5153.55002975, is %s", last_msg.msg.ephemeris_dep_d.sqrta); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.tgd * 100 - -1.76951289177e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.tgd, expected -1.76951289177e-08, is %s", last_msg.msg.ephemeris_dep_d.tgd); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.toc_tow * 100 - 446384.2 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.toc_tow, expected 446384.2, is %s", last_msg.msg.ephemeris_dep_d.toc_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_d.toc_wn == 2154, "incorrect value for last_msg.msg.ephemeris_dep_d.toc_wn, expected 2154, is %d", last_msg.msg.ephemeris_dep_d.toc_wn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.toe_tow * 100 - 446384.2 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.toe_tow, expected 446384.2, is %s", last_msg.msg.ephemeris_dep_d.toe_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_d.toe_wn == 2154, "incorrect value for last_msg.msg.ephemeris_dep_d.toe_wn, expected 2154, is %d", last_msg.msg.ephemeris_dep_d.toe_wn); - - ck_assert_msg(last_msg.msg.ephemeris_dep_d.valid == 1, "incorrect value for last_msg.msg.ephemeris_dep_d.valid, expected 1, is %d", last_msg.msg.ephemeris_dep_d.valid); - - ck_assert_msg((last_msg.msg.ephemeris_dep_d.w * 100 - -0.98930366296 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_d.w, expected -0.98930366296, is %s", last_msg.msg.ephemeris_dep_d.w); + ck_assert_msg((last_msg.msg.ephemeris_dep_d.af0 * 100 - + -0.00063150189817 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.af0, " + "expected -0.00063150189817, is %s", + last_msg.msg.ephemeris_dep_d.af0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_d.af1 * 100 - + 8.98126018001e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.af1, " + "expected 8.98126018001e-12, is %s", + last_msg.msg.ephemeris_dep_d.af1); + + ck_assert_msg((last_msg.msg.ephemeris_dep_d.af2 * 100 - 0.2 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.af2, " + "expected 0.2, is %s", + last_msg.msg.ephemeris_dep_d.af2); + + ck_assert_msg((last_msg.msg.ephemeris_dep_d.c_ic * 100 - + 7.45058059692e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.c_ic, " + "expected 7.45058059692e-09, is %s", + last_msg.msg.ephemeris_dep_d.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_dep_d.c_is * 100 - + -1.15483999252e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.c_is, " + "expected -1.15483999252e-07, is %s", + last_msg.msg.ephemeris_dep_d.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_d.c_rc * 100 - 308.625 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.c_rc, expected " + "308.625, is %s", + last_msg.msg.ephemeris_dep_d.c_rc); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_d.c_rs * 100 - -52.3125 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.c_rs, expected " + "-52.3125, is %s", + last_msg.msg.ephemeris_dep_d.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_dep_d.c_uc * 100 - + -2.74367630482e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.c_uc, " + "expected -2.74367630482e-06, is %s", + last_msg.msg.ephemeris_dep_d.c_uc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_d.c_us * 100 - + 3.1366944313e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.c_us, " + "expected 3.1366944313e-06, is %s", + last_msg.msg.ephemeris_dep_d.c_us); + + ck_assert_msg((last_msg.msg.ephemeris_dep_d.dn * 100 - + 5.69452291402e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.dn, " + "expected 5.69452291402e-09, is %s", + last_msg.msg.ephemeris_dep_d.dn); + + ck_assert_msg((last_msg.msg.ephemeris_dep_d.ecc * 100 - + 0.00707220705226 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.ecc, " + "expected 0.00707220705226, is %s", + last_msg.msg.ephemeris_dep_d.ecc); + + ck_assert_msg(last_msg.msg.ephemeris_dep_d.healthy == 0, + "incorrect value for last_msg.msg.ephemeris_dep_d.healthy, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_d.healthy); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_d.inc * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.inc, expected " + "0.934151448026, is %s", + last_msg.msg.ephemeris_dep_d.inc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_d.inc_dot * 100 - + -4.03588239642e-11 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.inc_dot, " + "expected -4.03588239642e-11, is %s", + last_msg.msg.ephemeris_dep_d.inc_dot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_d.iodc == 45, + "incorrect value for last_msg.msg.ephemeris_dep_d.iodc, " + "expected 45, is %d", + last_msg.msg.ephemeris_dep_d.iodc); + + ck_assert_msg(last_msg.msg.ephemeris_dep_d.iode == 45, + "incorrect value for last_msg.msg.ephemeris_dep_d.iode, " + "expected 45, is %d", + last_msg.msg.ephemeris_dep_d.iode); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_d.m0 * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.m0, expected " + "-0.0220007884211, is %s", + last_msg.msg.ephemeris_dep_d.m0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_d.omega0 * 100 - + -1.87318184488 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.omega0, " + "expected -1.87318184488, is %s", + last_msg.msg.ephemeris_dep_d.omega0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_d.omegadot * 100 - + -8.90358515577e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.omegadot, " + "expected -8.90358515577e-09, is %s", + last_msg.msg.ephemeris_dep_d.omegadot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_d.reserved == 0, + "incorrect value for last_msg.msg.ephemeris_dep_d.reserved, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_d.reserved); + + ck_assert_msg(last_msg.msg.ephemeris_dep_d.sid.code == 0, + "incorrect value for last_msg.msg.ephemeris_dep_d.sid.code, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_d.sid.code); + + ck_assert_msg( + last_msg.msg.ephemeris_dep_d.sid.reserved == 0, + "incorrect value for last_msg.msg.ephemeris_dep_d.sid.reserved, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_d.sid.reserved); + + ck_assert_msg(last_msg.msg.ephemeris_dep_d.sid.sat == 22, + "incorrect value for last_msg.msg.ephemeris_dep_d.sid.sat, " + "expected 22, is %d", + last_msg.msg.ephemeris_dep_d.sid.sat); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_d.sqrta * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.sqrta, expected " + "5153.55002975, is %s", + last_msg.msg.ephemeris_dep_d.sqrta); + + ck_assert_msg((last_msg.msg.ephemeris_dep_d.tgd * 100 - + -1.76951289177e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.tgd, " + "expected -1.76951289177e-08, is %s", + last_msg.msg.ephemeris_dep_d.tgd); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_d.toc_tow * 100 - 446384.2 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.toc_tow, expected " + "446384.2, is %s", + last_msg.msg.ephemeris_dep_d.toc_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_d.toc_wn == 2154, + "incorrect value for last_msg.msg.ephemeris_dep_d.toc_wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_dep_d.toc_wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_d.toe_tow * 100 - 446384.2 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.toe_tow, expected " + "446384.2, is %s", + last_msg.msg.ephemeris_dep_d.toe_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_d.toe_wn == 2154, + "incorrect value for last_msg.msg.ephemeris_dep_d.toe_wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_dep_d.toe_wn); + + ck_assert_msg(last_msg.msg.ephemeris_dep_d.valid == 1, + "incorrect value for last_msg.msg.ephemeris_dep_d.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_dep_d.valid); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_d.w * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_d.w, expected " + "-0.98930366296, is %s", + last_msg.msg.ephemeris_dep_d.w); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisDepD_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisDepD"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisDepD"); +Suite *auto_check_sbp_observation_MsgEphemerisDepD_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgEphemerisDepD"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisDepD"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisDepD); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisGLO.c b/c/test/auto_check_sbp_observation_MsgEphemerisGLO.c index 46baf577d..40e33f882 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisGLO.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisGLO.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLO.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLO.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisGLO ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisGLO) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGLO ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,134 +90,224 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGLO ) logging_reset(); - sbp_callback_register(&sbp_state, 0x8b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x8b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,139,0,10,9,92,4,3,70,197,6,0,106,8,0,0,160,64,96,9,0,0,1,0,0,0,128,43,128,97,175,184,0,0,64,177,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,122,53,0,0,122,53,0,128,59,54,14,100,89,149, }; + u8 encoded_frame[] = { + 85, 139, 0, 10, 9, 92, 4, 3, 70, 197, 6, 0, 106, + 8, 0, 0, 160, 64, 96, 9, 0, 0, 1, 0, 0, 0, + 128, 43, 128, 97, 175, 184, 0, 0, 64, 177, 0, 0, 128, + 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, 34, 65, + 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, 0, 98, 6, + 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, 192, 0, 0, + 0, 184, 138, 46, 139, 64, 0, 0, 122, 53, 0, 0, 122, + 53, 0, 128, 59, 54, 14, 100, 89, 149, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ephemeris_glo.acc[0] = 9.313225746154785e-07; - + test_msg.ephemeris_glo.acc[1] = 9.313225746154785e-07; - + test_msg.ephemeris_glo.acc[2] = 2.7939677238464355e-06; - - + test_msg.ephemeris_glo.common.fit_interval = 2400; - + test_msg.ephemeris_glo.common.health_bits = 0; - - + test_msg.ephemeris_glo.common.sid.code = 3; - + test_msg.ephemeris_glo.common.sid.sat = 4; - - + test_msg.ephemeris_glo.common.toe.tow = 443718; - + test_msg.ephemeris_glo.common.toe.wn = 2154; - + test_msg.ephemeris_glo.common.ura = 5.0; - + test_msg.ephemeris_glo.common.valid = 1; - + test_msg.ephemeris_glo.d_tau = -2.7939677238464355e-09; - + test_msg.ephemeris_glo.fcn = 14; - + test_msg.ephemeris_glo.gamma = 9.094947017729282e-13; - + test_msg.ephemeris_glo.iod = 100; - - + test_msg.ephemeris_glo.pos[0] = -12177330.078125; - + test_msg.ephemeris_glo.pos[1] = 599893.06640625; - + test_msg.ephemeris_glo.pos[2] = -22373708.49609375; - + test_msg.ephemeris_glo.tau = -8.36281105875969e-05; - - + test_msg.ephemeris_glo.vel[0] = -1726.506233215332; - + test_msg.ephemeris_glo.vel[1] = -2542.6149368286133; - + test_msg.ephemeris_glo.vel[2] = 869.8177337646484; - sbp_message_send(&sbp_state, SbpMsgEphemerisGlo, 2314, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisGlo, 2314, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 2314, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisGlo, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisGlo, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_glo.acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo.acc[0], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_glo.acc[0]); - ck_assert_msg((last_msg.msg.ephemeris_glo.acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo.acc[1], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_glo.acc[1]); - ck_assert_msg((last_msg.msg.ephemeris_glo.acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo.acc[2], expected 2.79396772385e-06, is %s", last_msg.msg.ephemeris_glo.acc[2]); - - - ck_assert_msg(last_msg.msg.ephemeris_glo.common.fit_interval == 2400, "incorrect value for last_msg.msg.ephemeris_glo.common.fit_interval, expected 2400, is %d", last_msg.msg.ephemeris_glo.common.fit_interval); - - ck_assert_msg(last_msg.msg.ephemeris_glo.common.health_bits == 0, "incorrect value for last_msg.msg.ephemeris_glo.common.health_bits, expected 0, is %d", last_msg.msg.ephemeris_glo.common.health_bits); - - - ck_assert_msg(last_msg.msg.ephemeris_glo.common.sid.code == 3, "incorrect value for last_msg.msg.ephemeris_glo.common.sid.code, expected 3, is %d", last_msg.msg.ephemeris_glo.common.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_glo.common.sid.sat == 4, "incorrect value for last_msg.msg.ephemeris_glo.common.sid.sat, expected 4, is %d", last_msg.msg.ephemeris_glo.common.sid.sat); - - - ck_assert_msg(last_msg.msg.ephemeris_glo.common.toe.tow == 443718, "incorrect value for last_msg.msg.ephemeris_glo.common.toe.tow, expected 443718, is %d", last_msg.msg.ephemeris_glo.common.toe.tow); - - ck_assert_msg(last_msg.msg.ephemeris_glo.common.toe.wn == 2154, "incorrect value for last_msg.msg.ephemeris_glo.common.toe.wn, expected 2154, is %d", last_msg.msg.ephemeris_glo.common.toe.wn); - - ck_assert_msg((last_msg.msg.ephemeris_glo.common.ura * 100 - 5.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo.common.ura, expected 5.0, is %s", last_msg.msg.ephemeris_glo.common.ura); - - ck_assert_msg(last_msg.msg.ephemeris_glo.common.valid == 1, "incorrect value for last_msg.msg.ephemeris_glo.common.valid, expected 1, is %d", last_msg.msg.ephemeris_glo.common.valid); - - ck_assert_msg((last_msg.msg.ephemeris_glo.d_tau * 100 - -2.79396772385e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo.d_tau, expected -2.79396772385e-09, is %s", last_msg.msg.ephemeris_glo.d_tau); - - ck_assert_msg(last_msg.msg.ephemeris_glo.fcn == 14, "incorrect value for last_msg.msg.ephemeris_glo.fcn, expected 14, is %d", last_msg.msg.ephemeris_glo.fcn); - - ck_assert_msg((last_msg.msg.ephemeris_glo.gamma * 100 - 9.09494701773e-13 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo.gamma, expected 9.09494701773e-13, is %s", last_msg.msg.ephemeris_glo.gamma); - - ck_assert_msg(last_msg.msg.ephemeris_glo.iod == 100, "incorrect value for last_msg.msg.ephemeris_glo.iod, expected 100, is %d", last_msg.msg.ephemeris_glo.iod); - - ck_assert_msg((last_msg.msg.ephemeris_glo.pos[0] * 100 - -12177330.0781 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo.pos[0], expected -12177330.0781, is %s", last_msg.msg.ephemeris_glo.pos[0]); - ck_assert_msg((last_msg.msg.ephemeris_glo.pos[1] * 100 - 599893.066406 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo.pos[1], expected 599893.066406, is %s", last_msg.msg.ephemeris_glo.pos[1]); - ck_assert_msg((last_msg.msg.ephemeris_glo.pos[2] * 100 - -22373708.4961 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo.pos[2], expected -22373708.4961, is %s", last_msg.msg.ephemeris_glo.pos[2]); - - ck_assert_msg((last_msg.msg.ephemeris_glo.tau * 100 - -8.36281105876e-05 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo.tau, expected -8.36281105876e-05, is %s", last_msg.msg.ephemeris_glo.tau); - - ck_assert_msg((last_msg.msg.ephemeris_glo.vel[0] * 100 - -1726.50623322 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo.vel[0], expected -1726.50623322, is %s", last_msg.msg.ephemeris_glo.vel[0]); - ck_assert_msg((last_msg.msg.ephemeris_glo.vel[1] * 100 - -2542.61493683 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo.vel[1], expected -2542.61493683, is %s", last_msg.msg.ephemeris_glo.vel[1]); - ck_assert_msg((last_msg.msg.ephemeris_glo.vel[2] * 100 - 869.817733765 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo.vel[2], expected 869.817733765, is %s", last_msg.msg.ephemeris_glo.vel[2]); + ck_assert_msg((last_msg.msg.ephemeris_glo.acc[0] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo.acc[0], " + "expected 9.31322574615e-07, is %s", + last_msg.msg.ephemeris_glo.acc[0]); + ck_assert_msg((last_msg.msg.ephemeris_glo.acc[1] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo.acc[1], " + "expected 9.31322574615e-07, is %s", + last_msg.msg.ephemeris_glo.acc[1]); + ck_assert_msg((last_msg.msg.ephemeris_glo.acc[2] * 100 - + 2.79396772385e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo.acc[2], " + "expected 2.79396772385e-06, is %s", + last_msg.msg.ephemeris_glo.acc[2]); + + ck_assert_msg( + last_msg.msg.ephemeris_glo.common.fit_interval == 2400, + "incorrect value for last_msg.msg.ephemeris_glo.common.fit_interval, " + "expected 2400, is %d", + last_msg.msg.ephemeris_glo.common.fit_interval); + + ck_assert_msg( + last_msg.msg.ephemeris_glo.common.health_bits == 0, + "incorrect value for last_msg.msg.ephemeris_glo.common.health_bits, " + "expected 0, is %d", + last_msg.msg.ephemeris_glo.common.health_bits); + + ck_assert_msg( + last_msg.msg.ephemeris_glo.common.sid.code == 3, + "incorrect value for last_msg.msg.ephemeris_glo.common.sid.code, " + "expected 3, is %d", + last_msg.msg.ephemeris_glo.common.sid.code); + + ck_assert_msg( + last_msg.msg.ephemeris_glo.common.sid.sat == 4, + "incorrect value for last_msg.msg.ephemeris_glo.common.sid.sat, " + "expected 4, is %d", + last_msg.msg.ephemeris_glo.common.sid.sat); + + ck_assert_msg( + last_msg.msg.ephemeris_glo.common.toe.tow == 443718, + "incorrect value for last_msg.msg.ephemeris_glo.common.toe.tow, " + "expected 443718, is %d", + last_msg.msg.ephemeris_glo.common.toe.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_glo.common.toe.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_glo.common.toe.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_glo.common.toe.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_glo.common.ura * 100 - 5.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo.common.ura, expected " + "5.0, is %s", + last_msg.msg.ephemeris_glo.common.ura); + + ck_assert_msg(last_msg.msg.ephemeris_glo.common.valid == 1, + "incorrect value for " + "last_msg.msg.ephemeris_glo.common.valid, expected 1, is %d", + last_msg.msg.ephemeris_glo.common.valid); + + ck_assert_msg((last_msg.msg.ephemeris_glo.d_tau * 100 - + -2.79396772385e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo.d_tau, " + "expected -2.79396772385e-09, is %s", + last_msg.msg.ephemeris_glo.d_tau); + + ck_assert_msg(last_msg.msg.ephemeris_glo.fcn == 14, + "incorrect value for last_msg.msg.ephemeris_glo.fcn, " + "expected 14, is %d", + last_msg.msg.ephemeris_glo.fcn); + + ck_assert_msg((last_msg.msg.ephemeris_glo.gamma * 100 - + 9.09494701773e-13 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo.gamma, " + "expected 9.09494701773e-13, is %s", + last_msg.msg.ephemeris_glo.gamma); + + ck_assert_msg(last_msg.msg.ephemeris_glo.iod == 100, + "incorrect value for last_msg.msg.ephemeris_glo.iod, " + "expected 100, is %d", + last_msg.msg.ephemeris_glo.iod); + + ck_assert_msg( + (last_msg.msg.ephemeris_glo.pos[0] * 100 - -12177330.0781 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo.pos[0], expected " + "-12177330.0781, is %s", + last_msg.msg.ephemeris_glo.pos[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo.pos[1] * 100 - 599893.066406 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo.pos[1], expected " + "599893.066406, is %s", + last_msg.msg.ephemeris_glo.pos[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo.pos[2] * 100 - -22373708.4961 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo.pos[2], expected " + "-22373708.4961, is %s", + last_msg.msg.ephemeris_glo.pos[2]); + + ck_assert_msg((last_msg.msg.ephemeris_glo.tau * 100 - + -8.36281105876e-05 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo.tau, " + "expected -8.36281105876e-05, is %s", + last_msg.msg.ephemeris_glo.tau); + + ck_assert_msg( + (last_msg.msg.ephemeris_glo.vel[0] * 100 - -1726.50623322 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo.vel[0], expected " + "-1726.50623322, is %s", + last_msg.msg.ephemeris_glo.vel[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo.vel[1] * 100 - -2542.61493683 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo.vel[1], expected " + "-2542.61493683, is %s", + last_msg.msg.ephemeris_glo.vel[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo.vel[2] * 100 - 869.817733765 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo.vel[2], expected " + "869.817733765, is %s", + last_msg.msg.ephemeris_glo.vel[2]); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisGLO_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisGLO"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisGLO"); +Suite *auto_check_sbp_observation_MsgEphemerisGLO_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgEphemerisGLO"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisGLO"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisGLO); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisGLODepA.c b/c/test/auto_check_sbp_observation_MsgEphemerisGLODepA.c index fec56530e..517ff56e1 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisGLODepA.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisGLODepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisGLODepA ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisGLODepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGLODepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,126 +90,222 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGLODepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x83, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x83, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,131,0,195,4,112,4,0,3,0,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,202,238, }; + u8 encoded_frame[] = { + 85, 131, 0, 195, 4, 112, 4, 0, 3, 0, 70, 197, 6, 0, + 106, 8, 205, 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 112, 61, 0, 0, 0, 0, + 48, 236, 21, 191, 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, + 0, 34, 170, 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, + 0, 0, 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, + 163, 192, 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, + 0, 64, 175, 62, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, + 0, 0, 0, 112, 199, 62, 202, 238, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ephemeris_glo_dep_a.acc[0] = 9.313225746154785e-07; - + test_msg.ephemeris_glo_dep_a.acc[1] = 9.313225746154785e-07; - + test_msg.ephemeris_glo_dep_a.acc[2] = 2.7939677238464355e-06; - - + test_msg.ephemeris_glo_dep_a.common.fit_interval = 2400; - + test_msg.ephemeris_glo_dep_a.common.health_bits = 0; - - + test_msg.ephemeris_glo_dep_a.common.sid.code = 3; - + test_msg.ephemeris_glo_dep_a.common.sid.reserved = 0; - + test_msg.ephemeris_glo_dep_a.common.sid.sat = 4; - - + test_msg.ephemeris_glo_dep_a.common.toe.tow = 443718; - + test_msg.ephemeris_glo_dep_a.common.toe.wn = 2154; - + test_msg.ephemeris_glo_dep_a.common.ura = 5.2; - + test_msg.ephemeris_glo_dep_a.common.valid = 1; - + test_msg.ephemeris_glo_dep_a.gamma = 9.094947017729282e-13; - - + test_msg.ephemeris_glo_dep_a.pos[0] = -12177330.078125; - + test_msg.ephemeris_glo_dep_a.pos[1] = 599893.06640625; - + test_msg.ephemeris_glo_dep_a.pos[2] = -22373708.49609375; - + test_msg.ephemeris_glo_dep_a.tau = -8.36281105875969e-05; - - + test_msg.ephemeris_glo_dep_a.vel[0] = -1726.506233215332; - + test_msg.ephemeris_glo_dep_a.vel[1] = -2542.6149368286133; - + test_msg.ephemeris_glo_dep_a.vel[2] = 869.8177337646484; - sbp_message_send(&sbp_state, SbpMsgEphemerisGloDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisGloDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisGloDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisGloDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_a.acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.acc[0], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_glo_dep_a.acc[0]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_a.acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.acc[1], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_glo_dep_a.acc[1]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_a.acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.acc[2], expected 2.79396772385e-06, is %s", last_msg.msg.ephemeris_glo_dep_a.acc[2]); - - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_a.common.fit_interval == 2400, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.common.fit_interval, expected 2400, is %d", last_msg.msg.ephemeris_glo_dep_a.common.fit_interval); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_a.common.health_bits == 0, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.common.health_bits, expected 0, is %d", last_msg.msg.ephemeris_glo_dep_a.common.health_bits); - - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_a.common.sid.code == 3, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.common.sid.code, expected 3, is %d", last_msg.msg.ephemeris_glo_dep_a.common.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_a.common.sid.reserved == 0, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.common.sid.reserved, expected 0, is %d", last_msg.msg.ephemeris_glo_dep_a.common.sid.reserved); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_a.common.sid.sat == 4, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.common.sid.sat, expected 4, is %d", last_msg.msg.ephemeris_glo_dep_a.common.sid.sat); - - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_a.common.toe.tow == 443718, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.common.toe.tow, expected 443718, is %d", last_msg.msg.ephemeris_glo_dep_a.common.toe.tow); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_a.common.toe.wn == 2154, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.common.toe.wn, expected 2154, is %d", last_msg.msg.ephemeris_glo_dep_a.common.toe.wn); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_a.common.ura * 100 - 5.2 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.common.ura, expected 5.2, is %s", last_msg.msg.ephemeris_glo_dep_a.common.ura); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_a.common.valid == 1, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.common.valid, expected 1, is %d", last_msg.msg.ephemeris_glo_dep_a.common.valid); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_a.gamma * 100 - 9.09494701773e-13 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.gamma, expected 9.09494701773e-13, is %s", last_msg.msg.ephemeris_glo_dep_a.gamma); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_a.pos[0] * 100 - -12177330.0781 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.pos[0], expected -12177330.0781, is %s", last_msg.msg.ephemeris_glo_dep_a.pos[0]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_a.pos[1] * 100 - 599893.066406 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.pos[1], expected 599893.066406, is %s", last_msg.msg.ephemeris_glo_dep_a.pos[1]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_a.pos[2] * 100 - -22373708.4961 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.pos[2], expected -22373708.4961, is %s", last_msg.msg.ephemeris_glo_dep_a.pos[2]); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_a.tau * 100 - -8.36281105876e-05 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.tau, expected -8.36281105876e-05, is %s", last_msg.msg.ephemeris_glo_dep_a.tau); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_a.vel[0] * 100 - -1726.50623322 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.vel[0], expected -1726.50623322, is %s", last_msg.msg.ephemeris_glo_dep_a.vel[0]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_a.vel[1] * 100 - -2542.61493683 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.vel[1], expected -2542.61493683, is %s", last_msg.msg.ephemeris_glo_dep_a.vel[1]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_a.vel[2] * 100 - 869.817733765 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_a.vel[2], expected 869.817733765, is %s", last_msg.msg.ephemeris_glo_dep_a.vel[2]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_a.acc[0] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.acc[0], expected " + "9.31322574615e-07, is %s", + last_msg.msg.ephemeris_glo_dep_a.acc[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_a.acc[1] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.acc[1], expected " + "9.31322574615e-07, is %s", + last_msg.msg.ephemeris_glo_dep_a.acc[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_a.acc[2] * 100 - + 2.79396772385e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.acc[2], expected " + "2.79396772385e-06, is %s", + last_msg.msg.ephemeris_glo_dep_a.acc[2]); + + ck_assert_msg(last_msg.msg.ephemeris_glo_dep_a.common.fit_interval == 2400, + "incorrect value for " + "last_msg.msg.ephemeris_glo_dep_a.common.fit_interval, " + "expected 2400, is %d", + last_msg.msg.ephemeris_glo_dep_a.common.fit_interval); + + ck_assert_msg(last_msg.msg.ephemeris_glo_dep_a.common.health_bits == 0, + "incorrect value for " + "last_msg.msg.ephemeris_glo_dep_a.common.health_bits, " + "expected 0, is %d", + last_msg.msg.ephemeris_glo_dep_a.common.health_bits); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_a.common.sid.code == 3, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.common.sid.code, " + "expected 3, is %d", + last_msg.msg.ephemeris_glo_dep_a.common.sid.code); + + ck_assert_msg(last_msg.msg.ephemeris_glo_dep_a.common.sid.reserved == 0, + "incorrect value for " + "last_msg.msg.ephemeris_glo_dep_a.common.sid.reserved, " + "expected 0, is %d", + last_msg.msg.ephemeris_glo_dep_a.common.sid.reserved); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_a.common.sid.sat == 4, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.common.sid.sat, " + "expected 4, is %d", + last_msg.msg.ephemeris_glo_dep_a.common.sid.sat); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_a.common.toe.tow == 443718, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.common.toe.tow, " + "expected 443718, is %d", + last_msg.msg.ephemeris_glo_dep_a.common.toe.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_a.common.toe.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.common.toe.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_glo_dep_a.common.toe.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_a.common.ura * 100 - 5.2 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.common.ura, " + "expected 5.2, is %s", + last_msg.msg.ephemeris_glo_dep_a.common.ura); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_a.common.valid == 1, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.common.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_glo_dep_a.common.valid); + + ck_assert_msg((last_msg.msg.ephemeris_glo_dep_a.gamma * 100 - + 9.09494701773e-13 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.gamma, " + "expected 9.09494701773e-13, is %s", + last_msg.msg.ephemeris_glo_dep_a.gamma); + + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_a.pos[0] * 100 - -12177330.0781 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.pos[0], expected " + "-12177330.0781, is %s", + last_msg.msg.ephemeris_glo_dep_a.pos[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_a.pos[1] * 100 - 599893.066406 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.pos[1], expected " + "599893.066406, is %s", + last_msg.msg.ephemeris_glo_dep_a.pos[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_a.pos[2] * 100 - -22373708.4961 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.pos[2], expected " + "-22373708.4961, is %s", + last_msg.msg.ephemeris_glo_dep_a.pos[2]); + + ck_assert_msg((last_msg.msg.ephemeris_glo_dep_a.tau * 100 - + -8.36281105876e-05 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.tau, " + "expected -8.36281105876e-05, is %s", + last_msg.msg.ephemeris_glo_dep_a.tau); + + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_a.vel[0] * 100 - -1726.50623322 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.vel[0], expected " + "-1726.50623322, is %s", + last_msg.msg.ephemeris_glo_dep_a.vel[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_a.vel[1] * 100 - -2542.61493683 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.vel[1], expected " + "-2542.61493683, is %s", + last_msg.msg.ephemeris_glo_dep_a.vel[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_a.vel[2] * 100 - 869.817733765 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_a.vel[2], expected " + "869.817733765, is %s", + last_msg.msg.ephemeris_glo_dep_a.vel[2]); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisGLODepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisGLODepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisGLODepA"); +Suite *auto_check_sbp_observation_MsgEphemerisGLODepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_observation_MsgEphemerisGLODepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisGLODepA"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisGLODepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisGLODepB.c b/c/test/auto_check_sbp_observation_MsgEphemerisGLODepB.c index e76790b46..54c5a713e 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisGLODepB.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisGLODepB.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepB.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisGLODepB ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisGLODepB) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGLODepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,122 +90,214 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGLODepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x85, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x85, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,133,0,195,4,110,4,3,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,122,127, }; + u8 encoded_frame[] = { + 85, 133, 0, 195, 4, 110, 4, 3, 70, 197, 6, 0, 106, 8, + 205, 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 112, 61, 0, 0, 0, 0, 48, 236, + 21, 191, 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, + 170, 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, + 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, 192, + 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, 0, 64, + 175, 62, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, + 0, 112, 199, 62, 122, 127, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ephemeris_glo_dep_b.acc[0] = 9.313225746154785e-07; - + test_msg.ephemeris_glo_dep_b.acc[1] = 9.313225746154785e-07; - + test_msg.ephemeris_glo_dep_b.acc[2] = 2.7939677238464355e-06; - - + test_msg.ephemeris_glo_dep_b.common.fit_interval = 2400; - + test_msg.ephemeris_glo_dep_b.common.health_bits = 0; - - + test_msg.ephemeris_glo_dep_b.common.sid.code = 3; - + test_msg.ephemeris_glo_dep_b.common.sid.sat = 4; - - + test_msg.ephemeris_glo_dep_b.common.toe.tow = 443718; - + test_msg.ephemeris_glo_dep_b.common.toe.wn = 2154; - + test_msg.ephemeris_glo_dep_b.common.ura = 5.2; - + test_msg.ephemeris_glo_dep_b.common.valid = 1; - + test_msg.ephemeris_glo_dep_b.gamma = 9.094947017729282e-13; - - + test_msg.ephemeris_glo_dep_b.pos[0] = -12177330.078125; - + test_msg.ephemeris_glo_dep_b.pos[1] = 599893.06640625; - + test_msg.ephemeris_glo_dep_b.pos[2] = -22373708.49609375; - + test_msg.ephemeris_glo_dep_b.tau = -8.36281105875969e-05; - - + test_msg.ephemeris_glo_dep_b.vel[0] = -1726.506233215332; - + test_msg.ephemeris_glo_dep_b.vel[1] = -2542.6149368286133; - + test_msg.ephemeris_glo_dep_b.vel[2] = 869.8177337646484; - sbp_message_send(&sbp_state, SbpMsgEphemerisGloDepB, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisGloDepB, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisGloDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisGloDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_b.acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.acc[0], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_glo_dep_b.acc[0]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_b.acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.acc[1], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_glo_dep_b.acc[1]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_b.acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.acc[2], expected 2.79396772385e-06, is %s", last_msg.msg.ephemeris_glo_dep_b.acc[2]); - - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_b.common.fit_interval == 2400, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.common.fit_interval, expected 2400, is %d", last_msg.msg.ephemeris_glo_dep_b.common.fit_interval); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_b.common.health_bits == 0, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.common.health_bits, expected 0, is %d", last_msg.msg.ephemeris_glo_dep_b.common.health_bits); - - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_b.common.sid.code == 3, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.common.sid.code, expected 3, is %d", last_msg.msg.ephemeris_glo_dep_b.common.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_b.common.sid.sat == 4, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.common.sid.sat, expected 4, is %d", last_msg.msg.ephemeris_glo_dep_b.common.sid.sat); - - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_b.common.toe.tow == 443718, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.common.toe.tow, expected 443718, is %d", last_msg.msg.ephemeris_glo_dep_b.common.toe.tow); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_b.common.toe.wn == 2154, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.common.toe.wn, expected 2154, is %d", last_msg.msg.ephemeris_glo_dep_b.common.toe.wn); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_b.common.ura * 100 - 5.2 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.common.ura, expected 5.2, is %s", last_msg.msg.ephemeris_glo_dep_b.common.ura); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_b.common.valid == 1, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.common.valid, expected 1, is %d", last_msg.msg.ephemeris_glo_dep_b.common.valid); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_b.gamma * 100 - 9.09494701773e-13 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.gamma, expected 9.09494701773e-13, is %s", last_msg.msg.ephemeris_glo_dep_b.gamma); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_b.pos[0] * 100 - -12177330.0781 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.pos[0], expected -12177330.0781, is %s", last_msg.msg.ephemeris_glo_dep_b.pos[0]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_b.pos[1] * 100 - 599893.066406 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.pos[1], expected 599893.066406, is %s", last_msg.msg.ephemeris_glo_dep_b.pos[1]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_b.pos[2] * 100 - -22373708.4961 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.pos[2], expected -22373708.4961, is %s", last_msg.msg.ephemeris_glo_dep_b.pos[2]); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_b.tau * 100 - -8.36281105876e-05 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.tau, expected -8.36281105876e-05, is %s", last_msg.msg.ephemeris_glo_dep_b.tau); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_b.vel[0] * 100 - -1726.50623322 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.vel[0], expected -1726.50623322, is %s", last_msg.msg.ephemeris_glo_dep_b.vel[0]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_b.vel[1] * 100 - -2542.61493683 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.vel[1], expected -2542.61493683, is %s", last_msg.msg.ephemeris_glo_dep_b.vel[1]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_b.vel[2] * 100 - 869.817733765 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_b.vel[2], expected 869.817733765, is %s", last_msg.msg.ephemeris_glo_dep_b.vel[2]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_b.acc[0] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.acc[0], expected " + "9.31322574615e-07, is %s", + last_msg.msg.ephemeris_glo_dep_b.acc[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_b.acc[1] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.acc[1], expected " + "9.31322574615e-07, is %s", + last_msg.msg.ephemeris_glo_dep_b.acc[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_b.acc[2] * 100 - + 2.79396772385e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.acc[2], expected " + "2.79396772385e-06, is %s", + last_msg.msg.ephemeris_glo_dep_b.acc[2]); + + ck_assert_msg(last_msg.msg.ephemeris_glo_dep_b.common.fit_interval == 2400, + "incorrect value for " + "last_msg.msg.ephemeris_glo_dep_b.common.fit_interval, " + "expected 2400, is %d", + last_msg.msg.ephemeris_glo_dep_b.common.fit_interval); + + ck_assert_msg(last_msg.msg.ephemeris_glo_dep_b.common.health_bits == 0, + "incorrect value for " + "last_msg.msg.ephemeris_glo_dep_b.common.health_bits, " + "expected 0, is %d", + last_msg.msg.ephemeris_glo_dep_b.common.health_bits); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_b.common.sid.code == 3, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.common.sid.code, " + "expected 3, is %d", + last_msg.msg.ephemeris_glo_dep_b.common.sid.code); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_b.common.sid.sat == 4, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.common.sid.sat, " + "expected 4, is %d", + last_msg.msg.ephemeris_glo_dep_b.common.sid.sat); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_b.common.toe.tow == 443718, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.common.toe.tow, " + "expected 443718, is %d", + last_msg.msg.ephemeris_glo_dep_b.common.toe.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_b.common.toe.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.common.toe.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_glo_dep_b.common.toe.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_b.common.ura * 100 - 5.2 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.common.ura, " + "expected 5.2, is %s", + last_msg.msg.ephemeris_glo_dep_b.common.ura); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_b.common.valid == 1, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.common.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_glo_dep_b.common.valid); + + ck_assert_msg((last_msg.msg.ephemeris_glo_dep_b.gamma * 100 - + 9.09494701773e-13 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.gamma, " + "expected 9.09494701773e-13, is %s", + last_msg.msg.ephemeris_glo_dep_b.gamma); + + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_b.pos[0] * 100 - -12177330.0781 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.pos[0], expected " + "-12177330.0781, is %s", + last_msg.msg.ephemeris_glo_dep_b.pos[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_b.pos[1] * 100 - 599893.066406 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.pos[1], expected " + "599893.066406, is %s", + last_msg.msg.ephemeris_glo_dep_b.pos[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_b.pos[2] * 100 - -22373708.4961 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.pos[2], expected " + "-22373708.4961, is %s", + last_msg.msg.ephemeris_glo_dep_b.pos[2]); + + ck_assert_msg((last_msg.msg.ephemeris_glo_dep_b.tau * 100 - + -8.36281105876e-05 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.tau, " + "expected -8.36281105876e-05, is %s", + last_msg.msg.ephemeris_glo_dep_b.tau); + + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_b.vel[0] * 100 - -1726.50623322 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.vel[0], expected " + "-1726.50623322, is %s", + last_msg.msg.ephemeris_glo_dep_b.vel[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_b.vel[1] * 100 - -2542.61493683 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.vel[1], expected " + "-2542.61493683, is %s", + last_msg.msg.ephemeris_glo_dep_b.vel[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_b.vel[2] * 100 - 869.817733765 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_b.vel[2], expected " + "869.817733765, is %s", + last_msg.msg.ephemeris_glo_dep_b.vel[2]); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisGLODepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisGLODepB"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisGLODepB"); +Suite *auto_check_sbp_observation_MsgEphemerisGLODepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_observation_MsgEphemerisGLODepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisGLODepB"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisGLODepB); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisGLODepC.c b/c/test/auto_check_sbp_observation_MsgEphemerisGLODepC.c index 0b7f0eae5..79ea5856e 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisGLODepC.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisGLODepC.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepC.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisGLODepC ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisGLODepC) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGLODepC ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,130 +90,230 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGLODepC ) logging_reset(); - sbp_callback_register(&sbp_state, 0x87, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x87, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,135,0,195,4,119,4,3,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,0,0,0,0,40,190,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,14,151,65, }; + u8 encoded_frame[] = { + 85, 135, 0, 195, 4, 119, 4, 3, 70, 197, 6, 0, 106, + 8, 205, 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 112, 61, 0, 0, 0, + 0, 48, 236, 21, 191, 0, 0, 0, 0, 0, 0, 40, 190, + 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, + 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, + 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, + 192, 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, + 0, 64, 175, 62, 0, 0, 0, 0, 0, 64, 175, 62, 0, + 0, 0, 0, 0, 112, 199, 62, 14, 151, 65, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ephemeris_glo_dep_c.acc[0] = 9.313225746154785e-07; - + test_msg.ephemeris_glo_dep_c.acc[1] = 9.313225746154785e-07; - + test_msg.ephemeris_glo_dep_c.acc[2] = 2.7939677238464355e-06; - - + test_msg.ephemeris_glo_dep_c.common.fit_interval = 2400; - + test_msg.ephemeris_glo_dep_c.common.health_bits = 0; - - + test_msg.ephemeris_glo_dep_c.common.sid.code = 3; - + test_msg.ephemeris_glo_dep_c.common.sid.sat = 4; - - + test_msg.ephemeris_glo_dep_c.common.toe.tow = 443718; - + test_msg.ephemeris_glo_dep_c.common.toe.wn = 2154; - + test_msg.ephemeris_glo_dep_c.common.ura = 5.2; - + test_msg.ephemeris_glo_dep_c.common.valid = 1; - + test_msg.ephemeris_glo_dep_c.d_tau = -2.7939677238464355e-09; - + test_msg.ephemeris_glo_dep_c.fcn = 14; - + test_msg.ephemeris_glo_dep_c.gamma = 9.094947017729282e-13; - - + test_msg.ephemeris_glo_dep_c.pos[0] = -12177330.078125; - + test_msg.ephemeris_glo_dep_c.pos[1] = 599893.06640625; - + test_msg.ephemeris_glo_dep_c.pos[2] = -22373708.49609375; - + test_msg.ephemeris_glo_dep_c.tau = -8.36281105875969e-05; - - + test_msg.ephemeris_glo_dep_c.vel[0] = -1726.506233215332; - + test_msg.ephemeris_glo_dep_c.vel[1] = -2542.6149368286133; - + test_msg.ephemeris_glo_dep_c.vel[2] = 869.8177337646484; - sbp_message_send(&sbp_state, SbpMsgEphemerisGloDepC, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisGloDepC, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisGloDepC, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisGloDepC, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.acc[0], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_glo_dep_c.acc[0]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.acc[1], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_glo_dep_c.acc[1]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.acc[2], expected 2.79396772385e-06, is %s", last_msg.msg.ephemeris_glo_dep_c.acc[2]); - - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_c.common.fit_interval == 2400, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.common.fit_interval, expected 2400, is %d", last_msg.msg.ephemeris_glo_dep_c.common.fit_interval); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_c.common.health_bits == 0, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.common.health_bits, expected 0, is %d", last_msg.msg.ephemeris_glo_dep_c.common.health_bits); - - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_c.common.sid.code == 3, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.common.sid.code, expected 3, is %d", last_msg.msg.ephemeris_glo_dep_c.common.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_c.common.sid.sat == 4, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.common.sid.sat, expected 4, is %d", last_msg.msg.ephemeris_glo_dep_c.common.sid.sat); - - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_c.common.toe.tow == 443718, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.common.toe.tow, expected 443718, is %d", last_msg.msg.ephemeris_glo_dep_c.common.toe.tow); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_c.common.toe.wn == 2154, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.common.toe.wn, expected 2154, is %d", last_msg.msg.ephemeris_glo_dep_c.common.toe.wn); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.common.ura * 100 - 5.2 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.common.ura, expected 5.2, is %s", last_msg.msg.ephemeris_glo_dep_c.common.ura); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_c.common.valid == 1, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.common.valid, expected 1, is %d", last_msg.msg.ephemeris_glo_dep_c.common.valid); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.d_tau * 100 - -2.79396772385e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.d_tau, expected -2.79396772385e-09, is %s", last_msg.msg.ephemeris_glo_dep_c.d_tau); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_c.fcn == 14, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.fcn, expected 14, is %d", last_msg.msg.ephemeris_glo_dep_c.fcn); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.gamma * 100 - 9.09494701773e-13 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.gamma, expected 9.09494701773e-13, is %s", last_msg.msg.ephemeris_glo_dep_c.gamma); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.pos[0] * 100 - -12177330.0781 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.pos[0], expected -12177330.0781, is %s", last_msg.msg.ephemeris_glo_dep_c.pos[0]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.pos[1] * 100 - 599893.066406 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.pos[1], expected 599893.066406, is %s", last_msg.msg.ephemeris_glo_dep_c.pos[1]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.pos[2] * 100 - -22373708.4961 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.pos[2], expected -22373708.4961, is %s", last_msg.msg.ephemeris_glo_dep_c.pos[2]); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.tau * 100 - -8.36281105876e-05 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.tau, expected -8.36281105876e-05, is %s", last_msg.msg.ephemeris_glo_dep_c.tau); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.vel[0] * 100 - -1726.50623322 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.vel[0], expected -1726.50623322, is %s", last_msg.msg.ephemeris_glo_dep_c.vel[0]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.vel[1] * 100 - -2542.61493683 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.vel[1], expected -2542.61493683, is %s", last_msg.msg.ephemeris_glo_dep_c.vel[1]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.vel[2] * 100 - 869.817733765 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_c.vel[2], expected 869.817733765, is %s", last_msg.msg.ephemeris_glo_dep_c.vel[2]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_c.acc[0] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.acc[0], expected " + "9.31322574615e-07, is %s", + last_msg.msg.ephemeris_glo_dep_c.acc[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_c.acc[1] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.acc[1], expected " + "9.31322574615e-07, is %s", + last_msg.msg.ephemeris_glo_dep_c.acc[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_c.acc[2] * 100 - + 2.79396772385e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.acc[2], expected " + "2.79396772385e-06, is %s", + last_msg.msg.ephemeris_glo_dep_c.acc[2]); + + ck_assert_msg(last_msg.msg.ephemeris_glo_dep_c.common.fit_interval == 2400, + "incorrect value for " + "last_msg.msg.ephemeris_glo_dep_c.common.fit_interval, " + "expected 2400, is %d", + last_msg.msg.ephemeris_glo_dep_c.common.fit_interval); + + ck_assert_msg(last_msg.msg.ephemeris_glo_dep_c.common.health_bits == 0, + "incorrect value for " + "last_msg.msg.ephemeris_glo_dep_c.common.health_bits, " + "expected 0, is %d", + last_msg.msg.ephemeris_glo_dep_c.common.health_bits); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_c.common.sid.code == 3, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.common.sid.code, " + "expected 3, is %d", + last_msg.msg.ephemeris_glo_dep_c.common.sid.code); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_c.common.sid.sat == 4, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.common.sid.sat, " + "expected 4, is %d", + last_msg.msg.ephemeris_glo_dep_c.common.sid.sat); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_c.common.toe.tow == 443718, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.common.toe.tow, " + "expected 443718, is %d", + last_msg.msg.ephemeris_glo_dep_c.common.toe.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_c.common.toe.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.common.toe.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_glo_dep_c.common.toe.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_c.common.ura * 100 - 5.2 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.common.ura, " + "expected 5.2, is %s", + last_msg.msg.ephemeris_glo_dep_c.common.ura); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_c.common.valid == 1, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.common.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_glo_dep_c.common.valid); + + ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.d_tau * 100 - + -2.79396772385e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.d_tau, " + "expected -2.79396772385e-09, is %s", + last_msg.msg.ephemeris_glo_dep_c.d_tau); + + ck_assert_msg(last_msg.msg.ephemeris_glo_dep_c.fcn == 14, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.fcn, " + "expected 14, is %d", + last_msg.msg.ephemeris_glo_dep_c.fcn); + + ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.gamma * 100 - + 9.09494701773e-13 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.gamma, " + "expected 9.09494701773e-13, is %s", + last_msg.msg.ephemeris_glo_dep_c.gamma); + + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_c.pos[0] * 100 - -12177330.0781 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.pos[0], expected " + "-12177330.0781, is %s", + last_msg.msg.ephemeris_glo_dep_c.pos[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_c.pos[1] * 100 - 599893.066406 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.pos[1], expected " + "599893.066406, is %s", + last_msg.msg.ephemeris_glo_dep_c.pos[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_c.pos[2] * 100 - -22373708.4961 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.pos[2], expected " + "-22373708.4961, is %s", + last_msg.msg.ephemeris_glo_dep_c.pos[2]); + + ck_assert_msg((last_msg.msg.ephemeris_glo_dep_c.tau * 100 - + -8.36281105876e-05 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.tau, " + "expected -8.36281105876e-05, is %s", + last_msg.msg.ephemeris_glo_dep_c.tau); + + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_c.vel[0] * 100 - -1726.50623322 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.vel[0], expected " + "-1726.50623322, is %s", + last_msg.msg.ephemeris_glo_dep_c.vel[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_c.vel[1] * 100 - -2542.61493683 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.vel[1], expected " + "-2542.61493683, is %s", + last_msg.msg.ephemeris_glo_dep_c.vel[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_c.vel[2] * 100 - 869.817733765 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_c.vel[2], expected " + "869.817733765, is %s", + last_msg.msg.ephemeris_glo_dep_c.vel[2]); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisGLODepC_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisGLODepC"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisGLODepC"); +Suite *auto_check_sbp_observation_MsgEphemerisGLODepC_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_observation_MsgEphemerisGLODepC"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisGLODepC"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisGLODepC); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisGLODepD.c b/c/test/auto_check_sbp_observation_MsgEphemerisGLODepD.c index 3d2b7a682..d28ffd3d3 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisGLODepD.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisGLODepD.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepD.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepD.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisGLODepD ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisGLODepD) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGLODepD ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,134 +90,237 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGLODepD ) logging_reset(); - sbp_callback_register(&sbp_state, 0x88, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x88, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,136,0,195,4,120,4,3,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,0,0,0,0,40,190,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,14,100,82,64, }; + u8 encoded_frame[] = { + 85, 136, 0, 195, 4, 120, 4, 3, 70, 197, 6, 0, 106, + 8, 205, 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 112, 61, 0, 0, 0, + 0, 48, 236, 21, 191, 0, 0, 0, 0, 0, 0, 40, 190, + 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, + 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, + 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, + 192, 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, + 0, 64, 175, 62, 0, 0, 0, 0, 0, 64, 175, 62, 0, + 0, 0, 0, 0, 112, 199, 62, 14, 100, 82, 64, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ephemeris_glo_dep_d.acc[0] = 9.313225746154785e-07; - + test_msg.ephemeris_glo_dep_d.acc[1] = 9.313225746154785e-07; - + test_msg.ephemeris_glo_dep_d.acc[2] = 2.7939677238464355e-06; - - + test_msg.ephemeris_glo_dep_d.common.fit_interval = 2400; - + test_msg.ephemeris_glo_dep_d.common.health_bits = 0; - - + test_msg.ephemeris_glo_dep_d.common.sid.code = 3; - + test_msg.ephemeris_glo_dep_d.common.sid.sat = 4; - - + test_msg.ephemeris_glo_dep_d.common.toe.tow = 443718; - + test_msg.ephemeris_glo_dep_d.common.toe.wn = 2154; - + test_msg.ephemeris_glo_dep_d.common.ura = 5.2; - + test_msg.ephemeris_glo_dep_d.common.valid = 1; - + test_msg.ephemeris_glo_dep_d.d_tau = -2.7939677238464355e-09; - + test_msg.ephemeris_glo_dep_d.fcn = 14; - + test_msg.ephemeris_glo_dep_d.gamma = 9.094947017729282e-13; - + test_msg.ephemeris_glo_dep_d.iod = 100; - - + test_msg.ephemeris_glo_dep_d.pos[0] = -12177330.078125; - + test_msg.ephemeris_glo_dep_d.pos[1] = 599893.06640625; - + test_msg.ephemeris_glo_dep_d.pos[2] = -22373708.49609375; - + test_msg.ephemeris_glo_dep_d.tau = -8.36281105875969e-05; - - + test_msg.ephemeris_glo_dep_d.vel[0] = -1726.506233215332; - + test_msg.ephemeris_glo_dep_d.vel[1] = -2542.6149368286133; - + test_msg.ephemeris_glo_dep_d.vel[2] = 869.8177337646484; - sbp_message_send(&sbp_state, SbpMsgEphemerisGloDepD, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisGloDepD, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisGloDepD, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisGloDepD, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.acc[0], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_glo_dep_d.acc[0]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.acc[1], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_glo_dep_d.acc[1]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.acc[2], expected 2.79396772385e-06, is %s", last_msg.msg.ephemeris_glo_dep_d.acc[2]); - - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_d.common.fit_interval == 2400, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.common.fit_interval, expected 2400, is %d", last_msg.msg.ephemeris_glo_dep_d.common.fit_interval); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_d.common.health_bits == 0, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.common.health_bits, expected 0, is %d", last_msg.msg.ephemeris_glo_dep_d.common.health_bits); - - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_d.common.sid.code == 3, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.common.sid.code, expected 3, is %d", last_msg.msg.ephemeris_glo_dep_d.common.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_d.common.sid.sat == 4, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.common.sid.sat, expected 4, is %d", last_msg.msg.ephemeris_glo_dep_d.common.sid.sat); - - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_d.common.toe.tow == 443718, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.common.toe.tow, expected 443718, is %d", last_msg.msg.ephemeris_glo_dep_d.common.toe.tow); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_d.common.toe.wn == 2154, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.common.toe.wn, expected 2154, is %d", last_msg.msg.ephemeris_glo_dep_d.common.toe.wn); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.common.ura * 100 - 5.2 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.common.ura, expected 5.2, is %s", last_msg.msg.ephemeris_glo_dep_d.common.ura); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_d.common.valid == 1, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.common.valid, expected 1, is %d", last_msg.msg.ephemeris_glo_dep_d.common.valid); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.d_tau * 100 - -2.79396772385e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.d_tau, expected -2.79396772385e-09, is %s", last_msg.msg.ephemeris_glo_dep_d.d_tau); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_d.fcn == 14, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.fcn, expected 14, is %d", last_msg.msg.ephemeris_glo_dep_d.fcn); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.gamma * 100 - 9.09494701773e-13 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.gamma, expected 9.09494701773e-13, is %s", last_msg.msg.ephemeris_glo_dep_d.gamma); - - ck_assert_msg(last_msg.msg.ephemeris_glo_dep_d.iod == 100, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.iod, expected 100, is %d", last_msg.msg.ephemeris_glo_dep_d.iod); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.pos[0] * 100 - -12177330.0781 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.pos[0], expected -12177330.0781, is %s", last_msg.msg.ephemeris_glo_dep_d.pos[0]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.pos[1] * 100 - 599893.066406 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.pos[1], expected 599893.066406, is %s", last_msg.msg.ephemeris_glo_dep_d.pos[1]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.pos[2] * 100 - -22373708.4961 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.pos[2], expected -22373708.4961, is %s", last_msg.msg.ephemeris_glo_dep_d.pos[2]); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.tau * 100 - -8.36281105876e-05 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.tau, expected -8.36281105876e-05, is %s", last_msg.msg.ephemeris_glo_dep_d.tau); - - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.vel[0] * 100 - -1726.50623322 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.vel[0], expected -1726.50623322, is %s", last_msg.msg.ephemeris_glo_dep_d.vel[0]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.vel[1] * 100 - -2542.61493683 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.vel[1], expected -2542.61493683, is %s", last_msg.msg.ephemeris_glo_dep_d.vel[1]); - ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.vel[2] * 100 - 869.817733765 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_glo_dep_d.vel[2], expected 869.817733765, is %s", last_msg.msg.ephemeris_glo_dep_d.vel[2]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_d.acc[0] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.acc[0], expected " + "9.31322574615e-07, is %s", + last_msg.msg.ephemeris_glo_dep_d.acc[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_d.acc[1] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.acc[1], expected " + "9.31322574615e-07, is %s", + last_msg.msg.ephemeris_glo_dep_d.acc[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_d.acc[2] * 100 - + 2.79396772385e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.acc[2], expected " + "2.79396772385e-06, is %s", + last_msg.msg.ephemeris_glo_dep_d.acc[2]); + + ck_assert_msg(last_msg.msg.ephemeris_glo_dep_d.common.fit_interval == 2400, + "incorrect value for " + "last_msg.msg.ephemeris_glo_dep_d.common.fit_interval, " + "expected 2400, is %d", + last_msg.msg.ephemeris_glo_dep_d.common.fit_interval); + + ck_assert_msg(last_msg.msg.ephemeris_glo_dep_d.common.health_bits == 0, + "incorrect value for " + "last_msg.msg.ephemeris_glo_dep_d.common.health_bits, " + "expected 0, is %d", + last_msg.msg.ephemeris_glo_dep_d.common.health_bits); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_d.common.sid.code == 3, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.common.sid.code, " + "expected 3, is %d", + last_msg.msg.ephemeris_glo_dep_d.common.sid.code); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_d.common.sid.sat == 4, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.common.sid.sat, " + "expected 4, is %d", + last_msg.msg.ephemeris_glo_dep_d.common.sid.sat); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_d.common.toe.tow == 443718, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.common.toe.tow, " + "expected 443718, is %d", + last_msg.msg.ephemeris_glo_dep_d.common.toe.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_d.common.toe.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.common.toe.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_glo_dep_d.common.toe.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_d.common.ura * 100 - 5.2 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.common.ura, " + "expected 5.2, is %s", + last_msg.msg.ephemeris_glo_dep_d.common.ura); + + ck_assert_msg( + last_msg.msg.ephemeris_glo_dep_d.common.valid == 1, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.common.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_glo_dep_d.common.valid); + + ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.d_tau * 100 - + -2.79396772385e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.d_tau, " + "expected -2.79396772385e-09, is %s", + last_msg.msg.ephemeris_glo_dep_d.d_tau); + + ck_assert_msg(last_msg.msg.ephemeris_glo_dep_d.fcn == 14, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.fcn, " + "expected 14, is %d", + last_msg.msg.ephemeris_glo_dep_d.fcn); + + ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.gamma * 100 - + 9.09494701773e-13 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.gamma, " + "expected 9.09494701773e-13, is %s", + last_msg.msg.ephemeris_glo_dep_d.gamma); + + ck_assert_msg(last_msg.msg.ephemeris_glo_dep_d.iod == 100, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.iod, " + "expected 100, is %d", + last_msg.msg.ephemeris_glo_dep_d.iod); + + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_d.pos[0] * 100 - -12177330.0781 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.pos[0], expected " + "-12177330.0781, is %s", + last_msg.msg.ephemeris_glo_dep_d.pos[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_d.pos[1] * 100 - 599893.066406 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.pos[1], expected " + "599893.066406, is %s", + last_msg.msg.ephemeris_glo_dep_d.pos[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_d.pos[2] * 100 - -22373708.4961 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.pos[2], expected " + "-22373708.4961, is %s", + last_msg.msg.ephemeris_glo_dep_d.pos[2]); + + ck_assert_msg((last_msg.msg.ephemeris_glo_dep_d.tau * 100 - + -8.36281105876e-05 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.tau, " + "expected -8.36281105876e-05, is %s", + last_msg.msg.ephemeris_glo_dep_d.tau); + + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_d.vel[0] * 100 - -1726.50623322 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.vel[0], expected " + "-1726.50623322, is %s", + last_msg.msg.ephemeris_glo_dep_d.vel[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_d.vel[1] * 100 - -2542.61493683 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.vel[1], expected " + "-2542.61493683, is %s", + last_msg.msg.ephemeris_glo_dep_d.vel[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_glo_dep_d.vel[2] * 100 - 869.817733765 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_glo_dep_d.vel[2], expected " + "869.817733765, is %s", + last_msg.msg.ephemeris_glo_dep_d.vel[2]); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisGLODepD_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisGLODepD"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisGLODepD"); +Suite *auto_check_sbp_observation_MsgEphemerisGLODepD_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_observation_MsgEphemerisGLODepD"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisGLODepD"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisGLODepD); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisGPS.c b/c/test/auto_check_sbp_observation_MsgEphemerisGPS.c index 5ec386b51..7fcab8d7b 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisGPS.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisGPS.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPS.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisGPS ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisGPS) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGPS ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,175 +90,302 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGPS ) logging_reset(); - sbp_callback_register(&sbp_state, 0x8a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x8a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,138,0,10,9,139,22,0,176,207,6,0,106,8,0,0,0,64,64,56,0,0,1,0,0,0,152,178,0,64,81,194,0,80,154,67,0,32,56,182,0,128,82,54,0,0,0,50,0,0,248,179,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,96,139,37,186,0,0,30,45,0,0,0,0,176,207,6,0,106,8,45,45,0,170,4, }; + u8 encoded_frame[] = { + 85, 138, 0, 10, 9, 139, 22, 0, 176, 207, 6, 0, 106, 8, + 0, 0, 0, 64, 64, 56, 0, 0, 1, 0, 0, 0, 152, 178, + 0, 64, 81, 194, 0, 80, 154, 67, 0, 32, 56, 182, 0, 128, + 82, 54, 0, 0, 0, 50, 0, 0, 248, 179, 114, 216, 96, 180, + 49, 117, 56, 62, 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, + 0, 32, 191, 247, 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, + 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, 54, 204, 30, + 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, 71, 11, 217, 147, + 145, 228, 237, 63, 221, 47, 100, 224, 255, 47, 198, 189, 96, 139, + 37, 186, 0, 0, 30, 45, 0, 0, 0, 0, 176, 207, 6, 0, + 106, 8, 45, 45, 0, 170, 4, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_gps.af0 = -0.0006315018981695175; - + test_msg.ephemeris_gps.af1 = 8.981260180007666e-12; - + test_msg.ephemeris_gps.af2 = 0.0; - + test_msg.ephemeris_gps.c_ic = 7.450580596923828e-09; - + test_msg.ephemeris_gps.c_is = -1.1548399925231934e-07; - + test_msg.ephemeris_gps.c_rc = 308.625; - + test_msg.ephemeris_gps.c_rs = -52.3125; - + test_msg.ephemeris_gps.c_uc = -2.7436763048171997e-06; - + test_msg.ephemeris_gps.c_us = 3.1366944313049316e-06; - - + test_msg.ephemeris_gps.common.fit_interval = 14400; - + test_msg.ephemeris_gps.common.health_bits = 0; - - + test_msg.ephemeris_gps.common.sid.code = 0; - + test_msg.ephemeris_gps.common.sid.sat = 22; - - + test_msg.ephemeris_gps.common.toe.tow = 446384; - + test_msg.ephemeris_gps.common.toe.wn = 2154; - + test_msg.ephemeris_gps.common.ura = 2.0; - + test_msg.ephemeris_gps.common.valid = 1; - + test_msg.ephemeris_gps.dn = 5.694522914022375e-09; - + test_msg.ephemeris_gps.ecc = 0.007072207052260637; - + test_msg.ephemeris_gps.inc = 0.9341514480259797; - + test_msg.ephemeris_gps.inc_dot = -4.035882396415757e-11; - + test_msg.ephemeris_gps.iodc = 45; - + test_msg.ephemeris_gps.iode = 45; - + test_msg.ephemeris_gps.m0 = -0.02200078842114688; - + test_msg.ephemeris_gps.omega0 = -1.8731818448797617; - + test_msg.ephemeris_gps.omegadot = -8.903585155774196e-09; - + test_msg.ephemeris_gps.sqrta = 5153.550029754639; - + test_msg.ephemeris_gps.tgd = -1.7695128917694092e-08; - - + test_msg.ephemeris_gps.toc.tow = 446384; - + test_msg.ephemeris_gps.toc.wn = 2154; - + test_msg.ephemeris_gps.w = -0.9893036629599647; - sbp_message_send(&sbp_state, SbpMsgEphemerisGps, 2314, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisGps, 2314, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 2314, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisGps, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisGps, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_gps.af0 * 100 - -0.00063150189817 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.af0, expected -0.00063150189817, is %s", last_msg.msg.ephemeris_gps.af0); - - ck_assert_msg((last_msg.msg.ephemeris_gps.af1 * 100 - 8.98126018001e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.af1, expected 8.98126018001e-12, is %s", last_msg.msg.ephemeris_gps.af1); - - ck_assert_msg((last_msg.msg.ephemeris_gps.af2 * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.af2, expected 0.0, is %s", last_msg.msg.ephemeris_gps.af2); - - ck_assert_msg((last_msg.msg.ephemeris_gps.c_ic * 100 - 7.45058059692e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.c_ic, expected 7.45058059692e-09, is %s", last_msg.msg.ephemeris_gps.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_gps.c_is * 100 - -1.15483999252e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.c_is, expected -1.15483999252e-07, is %s", last_msg.msg.ephemeris_gps.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_gps.c_rc * 100 - 308.625 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.c_rc, expected 308.625, is %s", last_msg.msg.ephemeris_gps.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_gps.c_rs * 100 - -52.3125 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.c_rs, expected -52.3125, is %s", last_msg.msg.ephemeris_gps.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_gps.c_uc * 100 - -2.74367630482e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.c_uc, expected -2.74367630482e-06, is %s", last_msg.msg.ephemeris_gps.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_gps.c_us * 100 - 3.1366944313e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.c_us, expected 3.1366944313e-06, is %s", last_msg.msg.ephemeris_gps.c_us); - - - ck_assert_msg(last_msg.msg.ephemeris_gps.common.fit_interval == 14400, "incorrect value for last_msg.msg.ephemeris_gps.common.fit_interval, expected 14400, is %d", last_msg.msg.ephemeris_gps.common.fit_interval); - - ck_assert_msg(last_msg.msg.ephemeris_gps.common.health_bits == 0, "incorrect value for last_msg.msg.ephemeris_gps.common.health_bits, expected 0, is %d", last_msg.msg.ephemeris_gps.common.health_bits); - - - ck_assert_msg(last_msg.msg.ephemeris_gps.common.sid.code == 0, "incorrect value for last_msg.msg.ephemeris_gps.common.sid.code, expected 0, is %d", last_msg.msg.ephemeris_gps.common.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_gps.common.sid.sat == 22, "incorrect value for last_msg.msg.ephemeris_gps.common.sid.sat, expected 22, is %d", last_msg.msg.ephemeris_gps.common.sid.sat); - - - ck_assert_msg(last_msg.msg.ephemeris_gps.common.toe.tow == 446384, "incorrect value for last_msg.msg.ephemeris_gps.common.toe.tow, expected 446384, is %d", last_msg.msg.ephemeris_gps.common.toe.tow); - - ck_assert_msg(last_msg.msg.ephemeris_gps.common.toe.wn == 2154, "incorrect value for last_msg.msg.ephemeris_gps.common.toe.wn, expected 2154, is %d", last_msg.msg.ephemeris_gps.common.toe.wn); - - ck_assert_msg((last_msg.msg.ephemeris_gps.common.ura * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.common.ura, expected 2.0, is %s", last_msg.msg.ephemeris_gps.common.ura); - - ck_assert_msg(last_msg.msg.ephemeris_gps.common.valid == 1, "incorrect value for last_msg.msg.ephemeris_gps.common.valid, expected 1, is %d", last_msg.msg.ephemeris_gps.common.valid); - - ck_assert_msg((last_msg.msg.ephemeris_gps.dn * 100 - 5.69452291402e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.dn, expected 5.69452291402e-09, is %s", last_msg.msg.ephemeris_gps.dn); - - ck_assert_msg((last_msg.msg.ephemeris_gps.ecc * 100 - 0.00707220705226 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.ecc, expected 0.00707220705226, is %s", last_msg.msg.ephemeris_gps.ecc); - - ck_assert_msg((last_msg.msg.ephemeris_gps.inc * 100 - 0.934151448026 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.inc, expected 0.934151448026, is %s", last_msg.msg.ephemeris_gps.inc); - - ck_assert_msg((last_msg.msg.ephemeris_gps.inc_dot * 100 - -4.03588239642e-11 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.inc_dot, expected -4.03588239642e-11, is %s", last_msg.msg.ephemeris_gps.inc_dot); - - ck_assert_msg(last_msg.msg.ephemeris_gps.iodc == 45, "incorrect value for last_msg.msg.ephemeris_gps.iodc, expected 45, is %d", last_msg.msg.ephemeris_gps.iodc); - - ck_assert_msg(last_msg.msg.ephemeris_gps.iode == 45, "incorrect value for last_msg.msg.ephemeris_gps.iode, expected 45, is %d", last_msg.msg.ephemeris_gps.iode); - - ck_assert_msg((last_msg.msg.ephemeris_gps.m0 * 100 - -0.0220007884211 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.m0, expected -0.0220007884211, is %s", last_msg.msg.ephemeris_gps.m0); - - ck_assert_msg((last_msg.msg.ephemeris_gps.omega0 * 100 - -1.87318184488 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.omega0, expected -1.87318184488, is %s", last_msg.msg.ephemeris_gps.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_gps.omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.omegadot, expected -8.90358515577e-09, is %s", last_msg.msg.ephemeris_gps.omegadot); - - ck_assert_msg((last_msg.msg.ephemeris_gps.sqrta * 100 - 5153.55002975 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.sqrta, expected 5153.55002975, is %s", last_msg.msg.ephemeris_gps.sqrta); - - ck_assert_msg((last_msg.msg.ephemeris_gps.tgd * 100 - -1.76951289177e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.tgd, expected -1.76951289177e-08, is %s", last_msg.msg.ephemeris_gps.tgd); - - - ck_assert_msg(last_msg.msg.ephemeris_gps.toc.tow == 446384, "incorrect value for last_msg.msg.ephemeris_gps.toc.tow, expected 446384, is %d", last_msg.msg.ephemeris_gps.toc.tow); - - ck_assert_msg(last_msg.msg.ephemeris_gps.toc.wn == 2154, "incorrect value for last_msg.msg.ephemeris_gps.toc.wn, expected 2154, is %d", last_msg.msg.ephemeris_gps.toc.wn); - - ck_assert_msg((last_msg.msg.ephemeris_gps.w * 100 - -0.98930366296 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps.w, expected -0.98930366296, is %s", last_msg.msg.ephemeris_gps.w); + ck_assert_msg( + (last_msg.msg.ephemeris_gps.af0 * 100 - -0.00063150189817 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.af0, expected " + "-0.00063150189817, is %s", + last_msg.msg.ephemeris_gps.af0); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps.af1 * 100 - 8.98126018001e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.af1, expected " + "8.98126018001e-12, is %s", + last_msg.msg.ephemeris_gps.af1); + + ck_assert_msg((last_msg.msg.ephemeris_gps.af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.af2, " + "expected 0.0, is %s", + last_msg.msg.ephemeris_gps.af2); + + ck_assert_msg((last_msg.msg.ephemeris_gps.c_ic * 100 - + 7.45058059692e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.c_ic, " + "expected 7.45058059692e-09, is %s", + last_msg.msg.ephemeris_gps.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_gps.c_is * 100 - + -1.15483999252e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.c_is, " + "expected -1.15483999252e-07, is %s", + last_msg.msg.ephemeris_gps.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps.c_rc * 100 - 308.625 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.c_rc, expected " + "308.625, is %s", + last_msg.msg.ephemeris_gps.c_rc); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps.c_rs * 100 - -52.3125 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.c_rs, expected " + "-52.3125, is %s", + last_msg.msg.ephemeris_gps.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_gps.c_uc * 100 - + -2.74367630482e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.c_uc, " + "expected -2.74367630482e-06, is %s", + last_msg.msg.ephemeris_gps.c_uc); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps.c_us * 100 - 3.1366944313e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.c_us, expected " + "3.1366944313e-06, is %s", + last_msg.msg.ephemeris_gps.c_us); + + ck_assert_msg( + last_msg.msg.ephemeris_gps.common.fit_interval == 14400, + "incorrect value for last_msg.msg.ephemeris_gps.common.fit_interval, " + "expected 14400, is %d", + last_msg.msg.ephemeris_gps.common.fit_interval); + + ck_assert_msg( + last_msg.msg.ephemeris_gps.common.health_bits == 0, + "incorrect value for last_msg.msg.ephemeris_gps.common.health_bits, " + "expected 0, is %d", + last_msg.msg.ephemeris_gps.common.health_bits); + + ck_assert_msg( + last_msg.msg.ephemeris_gps.common.sid.code == 0, + "incorrect value for last_msg.msg.ephemeris_gps.common.sid.code, " + "expected 0, is %d", + last_msg.msg.ephemeris_gps.common.sid.code); + + ck_assert_msg( + last_msg.msg.ephemeris_gps.common.sid.sat == 22, + "incorrect value for last_msg.msg.ephemeris_gps.common.sid.sat, " + "expected 22, is %d", + last_msg.msg.ephemeris_gps.common.sid.sat); + + ck_assert_msg( + last_msg.msg.ephemeris_gps.common.toe.tow == 446384, + "incorrect value for last_msg.msg.ephemeris_gps.common.toe.tow, " + "expected 446384, is %d", + last_msg.msg.ephemeris_gps.common.toe.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_gps.common.toe.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_gps.common.toe.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_gps.common.toe.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps.common.ura * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.common.ura, expected " + "2.0, is %s", + last_msg.msg.ephemeris_gps.common.ura); + + ck_assert_msg(last_msg.msg.ephemeris_gps.common.valid == 1, + "incorrect value for " + "last_msg.msg.ephemeris_gps.common.valid, expected 1, is %d", + last_msg.msg.ephemeris_gps.common.valid); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps.dn * 100 - 5.69452291402e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.dn, expected " + "5.69452291402e-09, is %s", + last_msg.msg.ephemeris_gps.dn); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps.ecc * 100 - 0.00707220705226 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.ecc, expected " + "0.00707220705226, is %s", + last_msg.msg.ephemeris_gps.ecc); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps.inc * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.inc, expected " + "0.934151448026, is %s", + last_msg.msg.ephemeris_gps.inc); + + ck_assert_msg((last_msg.msg.ephemeris_gps.inc_dot * 100 - + -4.03588239642e-11 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.inc_dot, " + "expected -4.03588239642e-11, is %s", + last_msg.msg.ephemeris_gps.inc_dot); + + ck_assert_msg(last_msg.msg.ephemeris_gps.iodc == 45, + "incorrect value for last_msg.msg.ephemeris_gps.iodc, " + "expected 45, is %d", + last_msg.msg.ephemeris_gps.iodc); + + ck_assert_msg(last_msg.msg.ephemeris_gps.iode == 45, + "incorrect value for last_msg.msg.ephemeris_gps.iode, " + "expected 45, is %d", + last_msg.msg.ephemeris_gps.iode); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps.m0 * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.m0, expected " + "-0.0220007884211, is %s", + last_msg.msg.ephemeris_gps.m0); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps.omega0 * 100 - -1.87318184488 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.omega0, expected " + "-1.87318184488, is %s", + last_msg.msg.ephemeris_gps.omega0); + + ck_assert_msg((last_msg.msg.ephemeris_gps.omegadot * 100 - + -8.90358515577e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.omegadot, " + "expected -8.90358515577e-09, is %s", + last_msg.msg.ephemeris_gps.omegadot); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps.sqrta * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.sqrta, expected " + "5153.55002975, is %s", + last_msg.msg.ephemeris_gps.sqrta); + + ck_assert_msg((last_msg.msg.ephemeris_gps.tgd * 100 - + -1.76951289177e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.tgd, " + "expected -1.76951289177e-08, is %s", + last_msg.msg.ephemeris_gps.tgd); + + ck_assert_msg(last_msg.msg.ephemeris_gps.toc.tow == 446384, + "incorrect value for last_msg.msg.ephemeris_gps.toc.tow, " + "expected 446384, is %d", + last_msg.msg.ephemeris_gps.toc.tow); + + ck_assert_msg(last_msg.msg.ephemeris_gps.toc.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_gps.toc.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_gps.toc.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps.w * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps.w, expected " + "-0.98930366296, is %s", + last_msg.msg.ephemeris_gps.w); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisGPS_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisGPS"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisGPS"); +Suite *auto_check_sbp_observation_MsgEphemerisGPS_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgEphemerisGPS"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisGPS"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisGPS); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisGPSDepE.c b/c/test/auto_check_sbp_observation_MsgEphemerisGPSDepE.c index f39150174..3e88a46ae 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisGPSDepE.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisGPSDepE.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepE.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepE.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisGPSDepE ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisGPSDepE) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGPSDepE ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,179 +90,321 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGPSDepE ) logging_reset(); - sbp_callback_register(&sbp_state, 0x81, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x81, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,129,0,123,0,185,22,0,0,0,176,207,6,0,106,8,0,0,0,0,0,0,0,64,64,56,0,0,1,0,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,0,0,0,0,0,0,0,0,176,207,6,0,106,8,45,45,0,6,238, }; + u8 encoded_frame[] = { + 85, 129, 0, 123, 0, 185, 22, 0, 0, 0, 176, 207, 6, 0, + 106, 8, 0, 0, 0, 0, 0, 0, 0, 64, 64, 56, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 83, 190, 0, 0, 0, 0, + 0, 40, 74, 192, 0, 0, 0, 0, 0, 74, 115, 64, 0, 0, + 0, 0, 0, 4, 199, 190, 0, 0, 0, 0, 0, 80, 202, 62, + 0, 0, 0, 0, 0, 0, 64, 62, 0, 0, 0, 0, 0, 0, + 127, 190, 114, 216, 96, 180, 49, 117, 56, 62, 142, 41, 5, 235, + 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, 63, 0, 0, + 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, + 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, + 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, 221, 47, 100, 224, + 255, 47, 198, 189, 0, 0, 0, 0, 108, 177, 68, 191, 0, 0, + 0, 0, 0, 192, 163, 61, 0, 0, 0, 0, 0, 0, 0, 0, + 176, 207, 6, 0, 106, 8, 45, 45, 0, 6, 238, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_gps_dep_e.af0 = -0.0006315018981695175; - + test_msg.ephemeris_gps_dep_e.af1 = 8.981260180007666e-12; - + test_msg.ephemeris_gps_dep_e.af2 = 0.0; - + test_msg.ephemeris_gps_dep_e.c_ic = 7.450580596923828e-09; - + test_msg.ephemeris_gps_dep_e.c_is = -1.1548399925231934e-07; - + test_msg.ephemeris_gps_dep_e.c_rc = 308.625; - + test_msg.ephemeris_gps_dep_e.c_rs = -52.3125; - + test_msg.ephemeris_gps_dep_e.c_uc = -2.7436763048171997e-06; - + test_msg.ephemeris_gps_dep_e.c_us = 3.1366944313049316e-06; - - + test_msg.ephemeris_gps_dep_e.common.fit_interval = 14400; - + test_msg.ephemeris_gps_dep_e.common.health_bits = 0; - - + test_msg.ephemeris_gps_dep_e.common.sid.code = 0; - + test_msg.ephemeris_gps_dep_e.common.sid.reserved = 0; - + test_msg.ephemeris_gps_dep_e.common.sid.sat = 22; - - + test_msg.ephemeris_gps_dep_e.common.toe.tow = 446384; - + test_msg.ephemeris_gps_dep_e.common.toe.wn = 2154; - + test_msg.ephemeris_gps_dep_e.common.ura = 2.0; - + test_msg.ephemeris_gps_dep_e.common.valid = 1; - + test_msg.ephemeris_gps_dep_e.dn = 5.694522914022375e-09; - + test_msg.ephemeris_gps_dep_e.ecc = 0.007072207052260637; - + test_msg.ephemeris_gps_dep_e.inc = 0.9341514480259797; - + test_msg.ephemeris_gps_dep_e.inc_dot = -4.035882396415757e-11; - + test_msg.ephemeris_gps_dep_e.iodc = 45; - + test_msg.ephemeris_gps_dep_e.iode = 45; - + test_msg.ephemeris_gps_dep_e.m0 = -0.02200078842114688; - + test_msg.ephemeris_gps_dep_e.omega0 = -1.8731818448797617; - + test_msg.ephemeris_gps_dep_e.omegadot = -8.903585155774196e-09; - + test_msg.ephemeris_gps_dep_e.sqrta = 5153.550029754639; - + test_msg.ephemeris_gps_dep_e.tgd = -1.7695128917694092e-08; - - + test_msg.ephemeris_gps_dep_e.toc.tow = 446384; - + test_msg.ephemeris_gps_dep_e.toc.wn = 2154; - + test_msg.ephemeris_gps_dep_e.w = -0.9893036629599647; - sbp_message_send(&sbp_state, SbpMsgEphemerisGpsDepE, 123, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisGpsDepE, 123, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisGpsDepE, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisGpsDepE, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.af0 * 100 - -0.00063150189817 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.af0, expected -0.00063150189817, is %s", last_msg.msg.ephemeris_gps_dep_e.af0); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.af1 * 100 - 8.98126018001e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.af1, expected 8.98126018001e-12, is %s", last_msg.msg.ephemeris_gps_dep_e.af1); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.af2 * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.af2, expected 0.0, is %s", last_msg.msg.ephemeris_gps_dep_e.af2); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.c_ic * 100 - 7.45058059692e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.c_ic, expected 7.45058059692e-09, is %s", last_msg.msg.ephemeris_gps_dep_e.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.c_is * 100 - -1.15483999252e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.c_is, expected -1.15483999252e-07, is %s", last_msg.msg.ephemeris_gps_dep_e.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.c_rc * 100 - 308.625 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.c_rc, expected 308.625, is %s", last_msg.msg.ephemeris_gps_dep_e.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.c_rs * 100 - -52.3125 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.c_rs, expected -52.3125, is %s", last_msg.msg.ephemeris_gps_dep_e.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.c_uc * 100 - -2.74367630482e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.c_uc, expected -2.74367630482e-06, is %s", last_msg.msg.ephemeris_gps_dep_e.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.c_us * 100 - 3.1366944313e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.c_us, expected 3.1366944313e-06, is %s", last_msg.msg.ephemeris_gps_dep_e.c_us); - - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.common.fit_interval == 14400, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.common.fit_interval, expected 14400, is %d", last_msg.msg.ephemeris_gps_dep_e.common.fit_interval); - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.common.health_bits == 0, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.common.health_bits, expected 0, is %d", last_msg.msg.ephemeris_gps_dep_e.common.health_bits); - - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.common.sid.code == 0, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.common.sid.code, expected 0, is %d", last_msg.msg.ephemeris_gps_dep_e.common.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.common.sid.reserved == 0, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.common.sid.reserved, expected 0, is %d", last_msg.msg.ephemeris_gps_dep_e.common.sid.reserved); - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.common.sid.sat == 22, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.common.sid.sat, expected 22, is %d", last_msg.msg.ephemeris_gps_dep_e.common.sid.sat); - - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.common.toe.tow == 446384, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.common.toe.tow, expected 446384, is %d", last_msg.msg.ephemeris_gps_dep_e.common.toe.tow); - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.common.toe.wn == 2154, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.common.toe.wn, expected 2154, is %d", last_msg.msg.ephemeris_gps_dep_e.common.toe.wn); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.common.ura * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.common.ura, expected 2.0, is %s", last_msg.msg.ephemeris_gps_dep_e.common.ura); - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.common.valid == 1, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.common.valid, expected 1, is %d", last_msg.msg.ephemeris_gps_dep_e.common.valid); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.dn * 100 - 5.69452291402e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.dn, expected 5.69452291402e-09, is %s", last_msg.msg.ephemeris_gps_dep_e.dn); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.ecc * 100 - 0.00707220705226 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.ecc, expected 0.00707220705226, is %s", last_msg.msg.ephemeris_gps_dep_e.ecc); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.inc * 100 - 0.934151448026 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.inc, expected 0.934151448026, is %s", last_msg.msg.ephemeris_gps_dep_e.inc); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.inc_dot * 100 - -4.03588239642e-11 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.inc_dot, expected -4.03588239642e-11, is %s", last_msg.msg.ephemeris_gps_dep_e.inc_dot); - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.iodc == 45, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.iodc, expected 45, is %d", last_msg.msg.ephemeris_gps_dep_e.iodc); - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.iode == 45, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.iode, expected 45, is %d", last_msg.msg.ephemeris_gps_dep_e.iode); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.m0 * 100 - -0.0220007884211 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.m0, expected -0.0220007884211, is %s", last_msg.msg.ephemeris_gps_dep_e.m0); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.omega0 * 100 - -1.87318184488 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.omega0, expected -1.87318184488, is %s", last_msg.msg.ephemeris_gps_dep_e.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.omegadot, expected -8.90358515577e-09, is %s", last_msg.msg.ephemeris_gps_dep_e.omegadot); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.sqrta * 100 - 5153.55002975 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.sqrta, expected 5153.55002975, is %s", last_msg.msg.ephemeris_gps_dep_e.sqrta); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.tgd * 100 - -1.76951289177e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.tgd, expected -1.76951289177e-08, is %s", last_msg.msg.ephemeris_gps_dep_e.tgd); - - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.toc.tow == 446384, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.toc.tow, expected 446384, is %d", last_msg.msg.ephemeris_gps_dep_e.toc.tow); - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.toc.wn == 2154, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.toc.wn, expected 2154, is %d", last_msg.msg.ephemeris_gps_dep_e.toc.wn); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.w * 100 - -0.98930366296 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_e.w, expected -0.98930366296, is %s", last_msg.msg.ephemeris_gps_dep_e.w); + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.af0 * 100 - + -0.00063150189817 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.af0, " + "expected -0.00063150189817, is %s", + last_msg.msg.ephemeris_gps_dep_e.af0); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.af1 * 100 - + 8.98126018001e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.af1, " + "expected 8.98126018001e-12, is %s", + last_msg.msg.ephemeris_gps_dep_e.af1); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps_dep_e.af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.af2, expected " + "0.0, is %s", + last_msg.msg.ephemeris_gps_dep_e.af2); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.c_ic * 100 - + 7.45058059692e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.c_ic, " + "expected 7.45058059692e-09, is %s", + last_msg.msg.ephemeris_gps_dep_e.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.c_is * 100 - + -1.15483999252e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.c_is, " + "expected -1.15483999252e-07, is %s", + last_msg.msg.ephemeris_gps_dep_e.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps_dep_e.c_rc * 100 - 308.625 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.c_rc, expected " + "308.625, is %s", + last_msg.msg.ephemeris_gps_dep_e.c_rc); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps_dep_e.c_rs * 100 - -52.3125 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.c_rs, expected " + "-52.3125, is %s", + last_msg.msg.ephemeris_gps_dep_e.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.c_uc * 100 - + -2.74367630482e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.c_uc, " + "expected -2.74367630482e-06, is %s", + last_msg.msg.ephemeris_gps_dep_e.c_uc); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.c_us * 100 - + 3.1366944313e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.c_us, " + "expected 3.1366944313e-06, is %s", + last_msg.msg.ephemeris_gps_dep_e.c_us); + + ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.common.fit_interval == 14400, + "incorrect value for " + "last_msg.msg.ephemeris_gps_dep_e.common.fit_interval, " + "expected 14400, is %d", + last_msg.msg.ephemeris_gps_dep_e.common.fit_interval); + + ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.common.health_bits == 0, + "incorrect value for " + "last_msg.msg.ephemeris_gps_dep_e.common.health_bits, " + "expected 0, is %d", + last_msg.msg.ephemeris_gps_dep_e.common.health_bits); + + ck_assert_msg( + last_msg.msg.ephemeris_gps_dep_e.common.sid.code == 0, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.common.sid.code, " + "expected 0, is %d", + last_msg.msg.ephemeris_gps_dep_e.common.sid.code); + + ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.common.sid.reserved == 0, + "incorrect value for " + "last_msg.msg.ephemeris_gps_dep_e.common.sid.reserved, " + "expected 0, is %d", + last_msg.msg.ephemeris_gps_dep_e.common.sid.reserved); + + ck_assert_msg( + last_msg.msg.ephemeris_gps_dep_e.common.sid.sat == 22, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.common.sid.sat, " + "expected 22, is %d", + last_msg.msg.ephemeris_gps_dep_e.common.sid.sat); + + ck_assert_msg( + last_msg.msg.ephemeris_gps_dep_e.common.toe.tow == 446384, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.common.toe.tow, " + "expected 446384, is %d", + last_msg.msg.ephemeris_gps_dep_e.common.toe.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_gps_dep_e.common.toe.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.common.toe.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_gps_dep_e.common.toe.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps_dep_e.common.ura * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.common.ura, " + "expected 2.0, is %s", + last_msg.msg.ephemeris_gps_dep_e.common.ura); + + ck_assert_msg( + last_msg.msg.ephemeris_gps_dep_e.common.valid == 1, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.common.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_gps_dep_e.common.valid); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.dn * 100 - + 5.69452291402e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.dn, " + "expected 5.69452291402e-09, is %s", + last_msg.msg.ephemeris_gps_dep_e.dn); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.ecc * 100 - + 0.00707220705226 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.ecc, " + "expected 0.00707220705226, is %s", + last_msg.msg.ephemeris_gps_dep_e.ecc); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.inc * 100 - + 0.934151448026 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.inc, " + "expected 0.934151448026, is %s", + last_msg.msg.ephemeris_gps_dep_e.inc); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps_dep_e.inc_dot * 100 - + -4.03588239642e-11 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.inc_dot, " + "expected -4.03588239642e-11, is %s", + last_msg.msg.ephemeris_gps_dep_e.inc_dot); + + ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.iodc == 45, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.iodc, " + "expected 45, is %d", + last_msg.msg.ephemeris_gps_dep_e.iodc); + + ck_assert_msg(last_msg.msg.ephemeris_gps_dep_e.iode == 45, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.iode, " + "expected 45, is %d", + last_msg.msg.ephemeris_gps_dep_e.iode); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.m0 * 100 - + -0.0220007884211 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.m0, " + "expected -0.0220007884211, is %s", + last_msg.msg.ephemeris_gps_dep_e.m0); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps_dep_e.omega0 * 100 - -1.87318184488 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.omega0, expected " + "-1.87318184488, is %s", + last_msg.msg.ephemeris_gps_dep_e.omega0); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps_dep_e.omegadot * 100 - + -8.90358515577e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.omegadot, " + "expected -8.90358515577e-09, is %s", + last_msg.msg.ephemeris_gps_dep_e.omegadot); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.sqrta * 100 - + 5153.55002975 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.sqrta, " + "expected 5153.55002975, is %s", + last_msg.msg.ephemeris_gps_dep_e.sqrta); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.tgd * 100 - + -1.76951289177e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.tgd, " + "expected -1.76951289177e-08, is %s", + last_msg.msg.ephemeris_gps_dep_e.tgd); + + ck_assert_msg( + last_msg.msg.ephemeris_gps_dep_e.toc.tow == 446384, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.toc.tow, " + "expected 446384, is %d", + last_msg.msg.ephemeris_gps_dep_e.toc.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_gps_dep_e.toc.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.toc.wn, expected " + "2154, is %d", + last_msg.msg.ephemeris_gps_dep_e.toc.wn); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_e.w * 100 - + -0.98930366296 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_e.w, " + "expected -0.98930366296, is %s", + last_msg.msg.ephemeris_gps_dep_e.w); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisGPSDepE_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisGPSDepE"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisGPSDepE"); +Suite *auto_check_sbp_observation_MsgEphemerisGPSDepE_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_observation_MsgEphemerisGPSDepE"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisGPSDepE"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisGPSDepE); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisGPSDepF.c b/c/test/auto_check_sbp_observation_MsgEphemerisGPSDepF.c index c4edbb97e..60b23036e 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisGPSDepF.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisGPSDepF.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepF.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisGPSDepF ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisGPSDepF) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGPSDepF ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,175 +90,313 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGPSDepF ) logging_reset(); - sbp_callback_register(&sbp_state, 0x86, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x86, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,134,0,123,0,183,22,0,176,207,6,0,106,8,0,0,0,0,0,0,0,64,64,56,0,0,1,0,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,0,0,0,0,0,0,0,0,176,207,6,0,106,8,45,45,0,115,254, }; + u8 encoded_frame[] = { + 85, 134, 0, 123, 0, 183, 22, 0, 176, 207, 6, 0, 106, 8, + 0, 0, 0, 0, 0, 0, 0, 64, 64, 56, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 83, 190, 0, 0, 0, 0, 0, 40, + 74, 192, 0, 0, 0, 0, 0, 74, 115, 64, 0, 0, 0, 0, + 0, 4, 199, 190, 0, 0, 0, 0, 0, 80, 202, 62, 0, 0, + 0, 0, 0, 0, 64, 62, 0, 0, 0, 0, 0, 0, 127, 190, + 114, 216, 96, 180, 49, 117, 56, 62, 142, 41, 5, 235, 95, 135, + 150, 191, 0, 0, 0, 32, 191, 247, 124, 63, 0, 0, 192, 206, + 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, + 81, 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, + 71, 11, 217, 147, 145, 228, 237, 63, 221, 47, 100, 224, 255, 47, + 198, 189, 0, 0, 0, 0, 108, 177, 68, 191, 0, 0, 0, 0, + 0, 192, 163, 61, 0, 0, 0, 0, 0, 0, 0, 0, 176, 207, + 6, 0, 106, 8, 45, 45, 0, 115, 254, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_gps_dep_f.af0 = -0.0006315018981695175; - + test_msg.ephemeris_gps_dep_f.af1 = 8.981260180007666e-12; - + test_msg.ephemeris_gps_dep_f.af2 = 0.0; - + test_msg.ephemeris_gps_dep_f.c_ic = 7.450580596923828e-09; - + test_msg.ephemeris_gps_dep_f.c_is = -1.1548399925231934e-07; - + test_msg.ephemeris_gps_dep_f.c_rc = 308.625; - + test_msg.ephemeris_gps_dep_f.c_rs = -52.3125; - + test_msg.ephemeris_gps_dep_f.c_uc = -2.7436763048171997e-06; - + test_msg.ephemeris_gps_dep_f.c_us = 3.1366944313049316e-06; - - + test_msg.ephemeris_gps_dep_f.common.fit_interval = 14400; - + test_msg.ephemeris_gps_dep_f.common.health_bits = 0; - - + test_msg.ephemeris_gps_dep_f.common.sid.code = 0; - + test_msg.ephemeris_gps_dep_f.common.sid.sat = 22; - - + test_msg.ephemeris_gps_dep_f.common.toe.tow = 446384; - + test_msg.ephemeris_gps_dep_f.common.toe.wn = 2154; - + test_msg.ephemeris_gps_dep_f.common.ura = 2.0; - + test_msg.ephemeris_gps_dep_f.common.valid = 1; - + test_msg.ephemeris_gps_dep_f.dn = 5.694522914022375e-09; - + test_msg.ephemeris_gps_dep_f.ecc = 0.007072207052260637; - + test_msg.ephemeris_gps_dep_f.inc = 0.9341514480259797; - + test_msg.ephemeris_gps_dep_f.inc_dot = -4.035882396415757e-11; - + test_msg.ephemeris_gps_dep_f.iodc = 45; - + test_msg.ephemeris_gps_dep_f.iode = 45; - + test_msg.ephemeris_gps_dep_f.m0 = -0.02200078842114688; - + test_msg.ephemeris_gps_dep_f.omega0 = -1.8731818448797617; - + test_msg.ephemeris_gps_dep_f.omegadot = -8.903585155774196e-09; - + test_msg.ephemeris_gps_dep_f.sqrta = 5153.550029754639; - + test_msg.ephemeris_gps_dep_f.tgd = -1.7695128917694092e-08; - - + test_msg.ephemeris_gps_dep_f.toc.tow = 446384; - + test_msg.ephemeris_gps_dep_f.toc.wn = 2154; - + test_msg.ephemeris_gps_dep_f.w = -0.9893036629599647; - sbp_message_send(&sbp_state, SbpMsgEphemerisGpsDepF, 123, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisGpsDepF, 123, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisGpsDepF, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisGpsDepF, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.af0 * 100 - -0.00063150189817 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.af0, expected -0.00063150189817, is %s", last_msg.msg.ephemeris_gps_dep_f.af0); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.af1 * 100 - 8.98126018001e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.af1, expected 8.98126018001e-12, is %s", last_msg.msg.ephemeris_gps_dep_f.af1); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.af2 * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.af2, expected 0.0, is %s", last_msg.msg.ephemeris_gps_dep_f.af2); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.c_ic * 100 - 7.45058059692e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.c_ic, expected 7.45058059692e-09, is %s", last_msg.msg.ephemeris_gps_dep_f.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.c_is * 100 - -1.15483999252e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.c_is, expected -1.15483999252e-07, is %s", last_msg.msg.ephemeris_gps_dep_f.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.c_rc * 100 - 308.625 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.c_rc, expected 308.625, is %s", last_msg.msg.ephemeris_gps_dep_f.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.c_rs * 100 - -52.3125 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.c_rs, expected -52.3125, is %s", last_msg.msg.ephemeris_gps_dep_f.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.c_uc * 100 - -2.74367630482e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.c_uc, expected -2.74367630482e-06, is %s", last_msg.msg.ephemeris_gps_dep_f.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.c_us * 100 - 3.1366944313e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.c_us, expected 3.1366944313e-06, is %s", last_msg.msg.ephemeris_gps_dep_f.c_us); - - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_f.common.fit_interval == 14400, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.common.fit_interval, expected 14400, is %d", last_msg.msg.ephemeris_gps_dep_f.common.fit_interval); - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_f.common.health_bits == 0, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.common.health_bits, expected 0, is %d", last_msg.msg.ephemeris_gps_dep_f.common.health_bits); - - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_f.common.sid.code == 0, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.common.sid.code, expected 0, is %d", last_msg.msg.ephemeris_gps_dep_f.common.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_f.common.sid.sat == 22, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.common.sid.sat, expected 22, is %d", last_msg.msg.ephemeris_gps_dep_f.common.sid.sat); - - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_f.common.toe.tow == 446384, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.common.toe.tow, expected 446384, is %d", last_msg.msg.ephemeris_gps_dep_f.common.toe.tow); - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_f.common.toe.wn == 2154, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.common.toe.wn, expected 2154, is %d", last_msg.msg.ephemeris_gps_dep_f.common.toe.wn); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.common.ura * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.common.ura, expected 2.0, is %s", last_msg.msg.ephemeris_gps_dep_f.common.ura); - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_f.common.valid == 1, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.common.valid, expected 1, is %d", last_msg.msg.ephemeris_gps_dep_f.common.valid); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.dn * 100 - 5.69452291402e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.dn, expected 5.69452291402e-09, is %s", last_msg.msg.ephemeris_gps_dep_f.dn); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.ecc * 100 - 0.00707220705226 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.ecc, expected 0.00707220705226, is %s", last_msg.msg.ephemeris_gps_dep_f.ecc); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.inc * 100 - 0.934151448026 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.inc, expected 0.934151448026, is %s", last_msg.msg.ephemeris_gps_dep_f.inc); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.inc_dot * 100 - -4.03588239642e-11 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.inc_dot, expected -4.03588239642e-11, is %s", last_msg.msg.ephemeris_gps_dep_f.inc_dot); - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_f.iodc == 45, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.iodc, expected 45, is %d", last_msg.msg.ephemeris_gps_dep_f.iodc); - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_f.iode == 45, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.iode, expected 45, is %d", last_msg.msg.ephemeris_gps_dep_f.iode); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.m0 * 100 - -0.0220007884211 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.m0, expected -0.0220007884211, is %s", last_msg.msg.ephemeris_gps_dep_f.m0); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.omega0 * 100 - -1.87318184488 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.omega0, expected -1.87318184488, is %s", last_msg.msg.ephemeris_gps_dep_f.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.omegadot, expected -8.90358515577e-09, is %s", last_msg.msg.ephemeris_gps_dep_f.omegadot); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.sqrta * 100 - 5153.55002975 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.sqrta, expected 5153.55002975, is %s", last_msg.msg.ephemeris_gps_dep_f.sqrta); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.tgd * 100 - -1.76951289177e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.tgd, expected -1.76951289177e-08, is %s", last_msg.msg.ephemeris_gps_dep_f.tgd); - - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_f.toc.tow == 446384, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.toc.tow, expected 446384, is %d", last_msg.msg.ephemeris_gps_dep_f.toc.tow); - - ck_assert_msg(last_msg.msg.ephemeris_gps_dep_f.toc.wn == 2154, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.toc.wn, expected 2154, is %d", last_msg.msg.ephemeris_gps_dep_f.toc.wn); - - ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.w * 100 - -0.98930366296 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gps_dep_f.w, expected -0.98930366296, is %s", last_msg.msg.ephemeris_gps_dep_f.w); + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.af0 * 100 - + -0.00063150189817 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.af0, " + "expected -0.00063150189817, is %s", + last_msg.msg.ephemeris_gps_dep_f.af0); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.af1 * 100 - + 8.98126018001e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.af1, " + "expected 8.98126018001e-12, is %s", + last_msg.msg.ephemeris_gps_dep_f.af1); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps_dep_f.af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.af2, expected " + "0.0, is %s", + last_msg.msg.ephemeris_gps_dep_f.af2); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.c_ic * 100 - + 7.45058059692e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.c_ic, " + "expected 7.45058059692e-09, is %s", + last_msg.msg.ephemeris_gps_dep_f.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.c_is * 100 - + -1.15483999252e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.c_is, " + "expected -1.15483999252e-07, is %s", + last_msg.msg.ephemeris_gps_dep_f.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps_dep_f.c_rc * 100 - 308.625 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.c_rc, expected " + "308.625, is %s", + last_msg.msg.ephemeris_gps_dep_f.c_rc); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps_dep_f.c_rs * 100 - -52.3125 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.c_rs, expected " + "-52.3125, is %s", + last_msg.msg.ephemeris_gps_dep_f.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.c_uc * 100 - + -2.74367630482e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.c_uc, " + "expected -2.74367630482e-06, is %s", + last_msg.msg.ephemeris_gps_dep_f.c_uc); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.c_us * 100 - + 3.1366944313e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.c_us, " + "expected 3.1366944313e-06, is %s", + last_msg.msg.ephemeris_gps_dep_f.c_us); + + ck_assert_msg(last_msg.msg.ephemeris_gps_dep_f.common.fit_interval == 14400, + "incorrect value for " + "last_msg.msg.ephemeris_gps_dep_f.common.fit_interval, " + "expected 14400, is %d", + last_msg.msg.ephemeris_gps_dep_f.common.fit_interval); + + ck_assert_msg(last_msg.msg.ephemeris_gps_dep_f.common.health_bits == 0, + "incorrect value for " + "last_msg.msg.ephemeris_gps_dep_f.common.health_bits, " + "expected 0, is %d", + last_msg.msg.ephemeris_gps_dep_f.common.health_bits); + + ck_assert_msg( + last_msg.msg.ephemeris_gps_dep_f.common.sid.code == 0, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.common.sid.code, " + "expected 0, is %d", + last_msg.msg.ephemeris_gps_dep_f.common.sid.code); + + ck_assert_msg( + last_msg.msg.ephemeris_gps_dep_f.common.sid.sat == 22, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.common.sid.sat, " + "expected 22, is %d", + last_msg.msg.ephemeris_gps_dep_f.common.sid.sat); + + ck_assert_msg( + last_msg.msg.ephemeris_gps_dep_f.common.toe.tow == 446384, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.common.toe.tow, " + "expected 446384, is %d", + last_msg.msg.ephemeris_gps_dep_f.common.toe.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_gps_dep_f.common.toe.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.common.toe.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_gps_dep_f.common.toe.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps_dep_f.common.ura * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.common.ura, " + "expected 2.0, is %s", + last_msg.msg.ephemeris_gps_dep_f.common.ura); + + ck_assert_msg( + last_msg.msg.ephemeris_gps_dep_f.common.valid == 1, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.common.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_gps_dep_f.common.valid); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.dn * 100 - + 5.69452291402e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.dn, " + "expected 5.69452291402e-09, is %s", + last_msg.msg.ephemeris_gps_dep_f.dn); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.ecc * 100 - + 0.00707220705226 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.ecc, " + "expected 0.00707220705226, is %s", + last_msg.msg.ephemeris_gps_dep_f.ecc); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.inc * 100 - + 0.934151448026 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.inc, " + "expected 0.934151448026, is %s", + last_msg.msg.ephemeris_gps_dep_f.inc); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps_dep_f.inc_dot * 100 - + -4.03588239642e-11 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.inc_dot, " + "expected -4.03588239642e-11, is %s", + last_msg.msg.ephemeris_gps_dep_f.inc_dot); + + ck_assert_msg(last_msg.msg.ephemeris_gps_dep_f.iodc == 45, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.iodc, " + "expected 45, is %d", + last_msg.msg.ephemeris_gps_dep_f.iodc); + + ck_assert_msg(last_msg.msg.ephemeris_gps_dep_f.iode == 45, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.iode, " + "expected 45, is %d", + last_msg.msg.ephemeris_gps_dep_f.iode); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.m0 * 100 - + -0.0220007884211 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.m0, " + "expected -0.0220007884211, is %s", + last_msg.msg.ephemeris_gps_dep_f.m0); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps_dep_f.omega0 * 100 - -1.87318184488 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.omega0, expected " + "-1.87318184488, is %s", + last_msg.msg.ephemeris_gps_dep_f.omega0); + + ck_assert_msg( + (last_msg.msg.ephemeris_gps_dep_f.omegadot * 100 - + -8.90358515577e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.omegadot, " + "expected -8.90358515577e-09, is %s", + last_msg.msg.ephemeris_gps_dep_f.omegadot); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.sqrta * 100 - + 5153.55002975 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.sqrta, " + "expected 5153.55002975, is %s", + last_msg.msg.ephemeris_gps_dep_f.sqrta); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.tgd * 100 - + -1.76951289177e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.tgd, " + "expected -1.76951289177e-08, is %s", + last_msg.msg.ephemeris_gps_dep_f.tgd); + + ck_assert_msg( + last_msg.msg.ephemeris_gps_dep_f.toc.tow == 446384, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.toc.tow, " + "expected 446384, is %d", + last_msg.msg.ephemeris_gps_dep_f.toc.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_gps_dep_f.toc.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.toc.wn, expected " + "2154, is %d", + last_msg.msg.ephemeris_gps_dep_f.toc.wn); + + ck_assert_msg((last_msg.msg.ephemeris_gps_dep_f.w * 100 - + -0.98930366296 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gps_dep_f.w, " + "expected -0.98930366296, is %s", + last_msg.msg.ephemeris_gps_dep_f.w); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisGPSDepF_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisGPSDepF"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisGPSDepF"); +Suite *auto_check_sbp_observation_MsgEphemerisGPSDepF_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_observation_MsgEphemerisGPSDepF"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisGPSDepF"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisGPSDepF); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisGal.c b/c/test/auto_check_sbp_observation_MsgEphemerisGal.c index b2c7158de..6fbfc9ace 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisGal.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisGal.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGal.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGal.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisGal ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisGal) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGal ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,183 +90,317 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGal ) logging_reset(); - sbp_callback_register(&sbp_state, 0x8d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x8d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,141,0,128,240,153,27,14,32,217,6,0,106,8,20,174,71,64,64,56,0,0,1,0,0,0,16,49,0,0,16,49,0,0,34,65,0,184,132,67,0,0,16,53,0,0,134,54,0,0,8,179,0,0,8,179,217,204,130,105,128,182,43,62,248,106,31,220,8,136,253,191,0,0,0,0,151,92,38,63,0,0,0,55,154,64,181,64,56,38,1,141,255,182,242,63,222,147,136,39,79,186,56,190,80,114,204,251,193,92,191,63,237,55,19,41,177,73,239,63,49,65,189,240,8,216,245,189,255,255,255,255,67,235,241,190,255,255,255,255,255,255,161,189,0,0,0,0,32,217,6,0,106,8,108,0,108,0,0,71,208, }; + u8 encoded_frame[] = { + 85, 141, 0, 128, 240, 153, 27, 14, 32, 217, 6, 0, 106, 8, + 20, 174, 71, 64, 64, 56, 0, 0, 1, 0, 0, 0, 16, 49, + 0, 0, 16, 49, 0, 0, 34, 65, 0, 184, 132, 67, 0, 0, + 16, 53, 0, 0, 134, 54, 0, 0, 8, 179, 0, 0, 8, 179, + 217, 204, 130, 105, 128, 182, 43, 62, 248, 106, 31, 220, 8, 136, + 253, 191, 0, 0, 0, 0, 151, 92, 38, 63, 0, 0, 0, 55, + 154, 64, 181, 64, 56, 38, 1, 141, 255, 182, 242, 63, 222, 147, + 136, 39, 79, 186, 56, 190, 80, 114, 204, 251, 193, 92, 191, 63, + 237, 55, 19, 41, 177, 73, 239, 63, 49, 65, 189, 240, 8, 216, + 245, 189, 255, 255, 255, 255, 67, 235, 241, 190, 255, 255, 255, 255, + 255, 255, 161, 189, 0, 0, 0, 0, 32, 217, 6, 0, 106, 8, + 108, 0, 108, 0, 0, 71, 208, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_gal.af0 = -1.7088896129280325e-05; - + test_msg.ephemeris_gal.af1 = -8.185452315956353e-12; - + test_msg.ephemeris_gal.af2 = 0.0; - + test_msg.ephemeris_gal.bgd_e1e5a = 2.0954757928848267e-09; - + test_msg.ephemeris_gal.bgd_e1e5b = 2.0954757928848267e-09; - + test_msg.ephemeris_gal.c_ic = -3.166496753692627e-08; - + test_msg.ephemeris_gal.c_is = -3.166496753692627e-08; - + test_msg.ephemeris_gal.c_rc = 265.4375; - + test_msg.ephemeris_gal.c_rs = 10.125; - + test_msg.ephemeris_gal.c_uc = 5.364418029785156e-07; - + test_msg.ephemeris_gal.c_us = 3.993511199951172e-06; - - + test_msg.ephemeris_gal.common.fit_interval = 14400; - + test_msg.ephemeris_gal.common.health_bits = 0; - - + test_msg.ephemeris_gal.common.sid.code = 14; - + test_msg.ephemeris_gal.common.sid.sat = 27; - - + test_msg.ephemeris_gal.common.toe.tow = 448800; - + test_msg.ephemeris_gal.common.toe.wn = 2154; - + test_msg.ephemeris_gal.common.ura = 3.119999885559082; - + test_msg.ephemeris_gal.common.valid = 1; - + test_msg.ephemeris_gal.dn = 3.2262058129932258e-09; - + test_msg.ephemeris_gal.ecc = 0.00017060607206076384; - + test_msg.ephemeris_gal.inc = 0.9777456094977858; - + test_msg.ephemeris_gal.inc_dot = -3.1787038343451465e-10; - + test_msg.ephemeris_gal.iodc = 108; - + test_msg.ephemeris_gal.iode = 108; - + test_msg.ephemeris_gal.m0 = -1.8457115744155868; - + test_msg.ephemeris_gal.omega0 = 1.16967730598334; - + test_msg.ephemeris_gal.omegadot = -5.757382675240872e-09; - + test_msg.ephemeris_gal.source = 0; - + test_msg.ephemeris_gal.sqrta = 5440.602401733398; - - + test_msg.ephemeris_gal.toc.tow = 448800; - + test_msg.ephemeris_gal.toc.wn = 2154; - + test_msg.ephemeris_gal.w = 0.12250912091662625; - sbp_message_send(&sbp_state, SbpMsgEphemerisGal, 61568, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisGal, 61568, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61568, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisGal, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisGal, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_gal.af0 * 100 - -1.70888961293e-05 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.af0, expected -1.70888961293e-05, is %s", last_msg.msg.ephemeris_gal.af0); - - ck_assert_msg((last_msg.msg.ephemeris_gal.af1 * 100 - -8.18545231596e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.af1, expected -8.18545231596e-12, is %s", last_msg.msg.ephemeris_gal.af1); - - ck_assert_msg((last_msg.msg.ephemeris_gal.af2 * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.af2, expected 0.0, is %s", last_msg.msg.ephemeris_gal.af2); - - ck_assert_msg((last_msg.msg.ephemeris_gal.bgd_e1e5a * 100 - 2.09547579288e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.bgd_e1e5a, expected 2.09547579288e-09, is %s", last_msg.msg.ephemeris_gal.bgd_e1e5a); - - ck_assert_msg((last_msg.msg.ephemeris_gal.bgd_e1e5b * 100 - 2.09547579288e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.bgd_e1e5b, expected 2.09547579288e-09, is %s", last_msg.msg.ephemeris_gal.bgd_e1e5b); - - ck_assert_msg((last_msg.msg.ephemeris_gal.c_ic * 100 - -3.16649675369e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.c_ic, expected -3.16649675369e-08, is %s", last_msg.msg.ephemeris_gal.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_gal.c_is * 100 - -3.16649675369e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.c_is, expected -3.16649675369e-08, is %s", last_msg.msg.ephemeris_gal.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_gal.c_rc * 100 - 265.4375 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.c_rc, expected 265.4375, is %s", last_msg.msg.ephemeris_gal.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_gal.c_rs * 100 - 10.125 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.c_rs, expected 10.125, is %s", last_msg.msg.ephemeris_gal.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_gal.c_uc * 100 - 5.36441802979e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.c_uc, expected 5.36441802979e-07, is %s", last_msg.msg.ephemeris_gal.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_gal.c_us * 100 - 3.99351119995e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.c_us, expected 3.99351119995e-06, is %s", last_msg.msg.ephemeris_gal.c_us); - - - ck_assert_msg(last_msg.msg.ephemeris_gal.common.fit_interval == 14400, "incorrect value for last_msg.msg.ephemeris_gal.common.fit_interval, expected 14400, is %d", last_msg.msg.ephemeris_gal.common.fit_interval); - - ck_assert_msg(last_msg.msg.ephemeris_gal.common.health_bits == 0, "incorrect value for last_msg.msg.ephemeris_gal.common.health_bits, expected 0, is %d", last_msg.msg.ephemeris_gal.common.health_bits); - - - ck_assert_msg(last_msg.msg.ephemeris_gal.common.sid.code == 14, "incorrect value for last_msg.msg.ephemeris_gal.common.sid.code, expected 14, is %d", last_msg.msg.ephemeris_gal.common.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_gal.common.sid.sat == 27, "incorrect value for last_msg.msg.ephemeris_gal.common.sid.sat, expected 27, is %d", last_msg.msg.ephemeris_gal.common.sid.sat); - - - ck_assert_msg(last_msg.msg.ephemeris_gal.common.toe.tow == 448800, "incorrect value for last_msg.msg.ephemeris_gal.common.toe.tow, expected 448800, is %d", last_msg.msg.ephemeris_gal.common.toe.tow); - - ck_assert_msg(last_msg.msg.ephemeris_gal.common.toe.wn == 2154, "incorrect value for last_msg.msg.ephemeris_gal.common.toe.wn, expected 2154, is %d", last_msg.msg.ephemeris_gal.common.toe.wn); - - ck_assert_msg((last_msg.msg.ephemeris_gal.common.ura * 100 - 3.11999988556 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.common.ura, expected 3.11999988556, is %s", last_msg.msg.ephemeris_gal.common.ura); - - ck_assert_msg(last_msg.msg.ephemeris_gal.common.valid == 1, "incorrect value for last_msg.msg.ephemeris_gal.common.valid, expected 1, is %d", last_msg.msg.ephemeris_gal.common.valid); - - ck_assert_msg((last_msg.msg.ephemeris_gal.dn * 100 - 3.22620581299e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.dn, expected 3.22620581299e-09, is %s", last_msg.msg.ephemeris_gal.dn); - - ck_assert_msg((last_msg.msg.ephemeris_gal.ecc * 100 - 0.000170606072061 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.ecc, expected 0.000170606072061, is %s", last_msg.msg.ephemeris_gal.ecc); - - ck_assert_msg((last_msg.msg.ephemeris_gal.inc * 100 - 0.977745609498 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.inc, expected 0.977745609498, is %s", last_msg.msg.ephemeris_gal.inc); - - ck_assert_msg((last_msg.msg.ephemeris_gal.inc_dot * 100 - -3.17870383435e-10 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.inc_dot, expected -3.17870383435e-10, is %s", last_msg.msg.ephemeris_gal.inc_dot); - - ck_assert_msg(last_msg.msg.ephemeris_gal.iodc == 108, "incorrect value for last_msg.msg.ephemeris_gal.iodc, expected 108, is %d", last_msg.msg.ephemeris_gal.iodc); - - ck_assert_msg(last_msg.msg.ephemeris_gal.iode == 108, "incorrect value for last_msg.msg.ephemeris_gal.iode, expected 108, is %d", last_msg.msg.ephemeris_gal.iode); - - ck_assert_msg((last_msg.msg.ephemeris_gal.m0 * 100 - -1.84571157442 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.m0, expected -1.84571157442, is %s", last_msg.msg.ephemeris_gal.m0); - - ck_assert_msg((last_msg.msg.ephemeris_gal.omega0 * 100 - 1.16967730598 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.omega0, expected 1.16967730598, is %s", last_msg.msg.ephemeris_gal.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_gal.omegadot * 100 - -5.75738267524e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.omegadot, expected -5.75738267524e-09, is %s", last_msg.msg.ephemeris_gal.omegadot); - - ck_assert_msg(last_msg.msg.ephemeris_gal.source == 0, "incorrect value for last_msg.msg.ephemeris_gal.source, expected 0, is %d", last_msg.msg.ephemeris_gal.source); - - ck_assert_msg((last_msg.msg.ephemeris_gal.sqrta * 100 - 5440.60240173 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.sqrta, expected 5440.60240173, is %s", last_msg.msg.ephemeris_gal.sqrta); - - - ck_assert_msg(last_msg.msg.ephemeris_gal.toc.tow == 448800, "incorrect value for last_msg.msg.ephemeris_gal.toc.tow, expected 448800, is %d", last_msg.msg.ephemeris_gal.toc.tow); - - ck_assert_msg(last_msg.msg.ephemeris_gal.toc.wn == 2154, "incorrect value for last_msg.msg.ephemeris_gal.toc.wn, expected 2154, is %d", last_msg.msg.ephemeris_gal.toc.wn); - - ck_assert_msg((last_msg.msg.ephemeris_gal.w * 100 - 0.122509120917 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal.w, expected 0.122509120917, is %s", last_msg.msg.ephemeris_gal.w); + ck_assert_msg((last_msg.msg.ephemeris_gal.af0 * 100 - + -1.70888961293e-05 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.af0, " + "expected -1.70888961293e-05, is %s", + last_msg.msg.ephemeris_gal.af0); + + ck_assert_msg((last_msg.msg.ephemeris_gal.af1 * 100 - + -8.18545231596e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.af1, " + "expected -8.18545231596e-12, is %s", + last_msg.msg.ephemeris_gal.af1); + + ck_assert_msg((last_msg.msg.ephemeris_gal.af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.af2, " + "expected 0.0, is %s", + last_msg.msg.ephemeris_gal.af2); + + ck_assert_msg((last_msg.msg.ephemeris_gal.bgd_e1e5a * 100 - + 2.09547579288e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.bgd_e1e5a, " + "expected 2.09547579288e-09, is %s", + last_msg.msg.ephemeris_gal.bgd_e1e5a); + + ck_assert_msg((last_msg.msg.ephemeris_gal.bgd_e1e5b * 100 - + 2.09547579288e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.bgd_e1e5b, " + "expected 2.09547579288e-09, is %s", + last_msg.msg.ephemeris_gal.bgd_e1e5b); + + ck_assert_msg((last_msg.msg.ephemeris_gal.c_ic * 100 - + -3.16649675369e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.c_ic, " + "expected -3.16649675369e-08, is %s", + last_msg.msg.ephemeris_gal.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_gal.c_is * 100 - + -3.16649675369e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.c_is, " + "expected -3.16649675369e-08, is %s", + last_msg.msg.ephemeris_gal.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal.c_rc * 100 - 265.4375 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.c_rc, expected " + "265.4375, is %s", + last_msg.msg.ephemeris_gal.c_rc); + + ck_assert_msg((last_msg.msg.ephemeris_gal.c_rs * 100 - 10.125 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.c_rs, " + "expected 10.125, is %s", + last_msg.msg.ephemeris_gal.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_gal.c_uc * 100 - + 5.36441802979e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.c_uc, " + "expected 5.36441802979e-07, is %s", + last_msg.msg.ephemeris_gal.c_uc); + + ck_assert_msg((last_msg.msg.ephemeris_gal.c_us * 100 - + 3.99351119995e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.c_us, " + "expected 3.99351119995e-06, is %s", + last_msg.msg.ephemeris_gal.c_us); + + ck_assert_msg( + last_msg.msg.ephemeris_gal.common.fit_interval == 14400, + "incorrect value for last_msg.msg.ephemeris_gal.common.fit_interval, " + "expected 14400, is %d", + last_msg.msg.ephemeris_gal.common.fit_interval); + + ck_assert_msg( + last_msg.msg.ephemeris_gal.common.health_bits == 0, + "incorrect value for last_msg.msg.ephemeris_gal.common.health_bits, " + "expected 0, is %d", + last_msg.msg.ephemeris_gal.common.health_bits); + + ck_assert_msg( + last_msg.msg.ephemeris_gal.common.sid.code == 14, + "incorrect value for last_msg.msg.ephemeris_gal.common.sid.code, " + "expected 14, is %d", + last_msg.msg.ephemeris_gal.common.sid.code); + + ck_assert_msg( + last_msg.msg.ephemeris_gal.common.sid.sat == 27, + "incorrect value for last_msg.msg.ephemeris_gal.common.sid.sat, " + "expected 27, is %d", + last_msg.msg.ephemeris_gal.common.sid.sat); + + ck_assert_msg( + last_msg.msg.ephemeris_gal.common.toe.tow == 448800, + "incorrect value for last_msg.msg.ephemeris_gal.common.toe.tow, " + "expected 448800, is %d", + last_msg.msg.ephemeris_gal.common.toe.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_gal.common.toe.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_gal.common.toe.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_gal.common.toe.wn); + + ck_assert_msg((last_msg.msg.ephemeris_gal.common.ura * 100 - + 3.11999988556 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.common.ura, " + "expected 3.11999988556, is %s", + last_msg.msg.ephemeris_gal.common.ura); + + ck_assert_msg(last_msg.msg.ephemeris_gal.common.valid == 1, + "incorrect value for " + "last_msg.msg.ephemeris_gal.common.valid, expected 1, is %d", + last_msg.msg.ephemeris_gal.common.valid); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal.dn * 100 - 3.22620581299e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.dn, expected " + "3.22620581299e-09, is %s", + last_msg.msg.ephemeris_gal.dn); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal.ecc * 100 - 0.000170606072061 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.ecc, expected " + "0.000170606072061, is %s", + last_msg.msg.ephemeris_gal.ecc); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal.inc * 100 - 0.977745609498 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.inc, expected " + "0.977745609498, is %s", + last_msg.msg.ephemeris_gal.inc); + + ck_assert_msg((last_msg.msg.ephemeris_gal.inc_dot * 100 - + -3.17870383435e-10 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.inc_dot, " + "expected -3.17870383435e-10, is %s", + last_msg.msg.ephemeris_gal.inc_dot); + + ck_assert_msg(last_msg.msg.ephemeris_gal.iodc == 108, + "incorrect value for last_msg.msg.ephemeris_gal.iodc, " + "expected 108, is %d", + last_msg.msg.ephemeris_gal.iodc); + + ck_assert_msg(last_msg.msg.ephemeris_gal.iode == 108, + "incorrect value for last_msg.msg.ephemeris_gal.iode, " + "expected 108, is %d", + last_msg.msg.ephemeris_gal.iode); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal.m0 * 100 - -1.84571157442 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.m0, expected " + "-1.84571157442, is %s", + last_msg.msg.ephemeris_gal.m0); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal.omega0 * 100 - 1.16967730598 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.omega0, expected " + "1.16967730598, is %s", + last_msg.msg.ephemeris_gal.omega0); + + ck_assert_msg((last_msg.msg.ephemeris_gal.omegadot * 100 - + -5.75738267524e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.omegadot, " + "expected -5.75738267524e-09, is %s", + last_msg.msg.ephemeris_gal.omegadot); + + ck_assert_msg(last_msg.msg.ephemeris_gal.source == 0, + "incorrect value for last_msg.msg.ephemeris_gal.source, " + "expected 0, is %d", + last_msg.msg.ephemeris_gal.source); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal.sqrta * 100 - 5440.60240173 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.sqrta, expected " + "5440.60240173, is %s", + last_msg.msg.ephemeris_gal.sqrta); + + ck_assert_msg(last_msg.msg.ephemeris_gal.toc.tow == 448800, + "incorrect value for last_msg.msg.ephemeris_gal.toc.tow, " + "expected 448800, is %d", + last_msg.msg.ephemeris_gal.toc.tow); + + ck_assert_msg(last_msg.msg.ephemeris_gal.toc.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_gal.toc.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_gal.toc.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal.w * 100 - 0.122509120917 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal.w, expected " + "0.122509120917, is %s", + last_msg.msg.ephemeris_gal.w); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisGal_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisGal"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisGal"); +Suite *auto_check_sbp_observation_MsgEphemerisGal_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgEphemerisGal"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisGal"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisGal); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisGalDepA.c b/c/test/auto_check_sbp_observation_MsgEphemerisGalDepA.c index 2f3ba6280..d4fd352cb 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisGalDepA.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisGalDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGalDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGalDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisGalDepA ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisGalDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGalDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,179 +90,322 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisGalDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x95, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x95, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,149,0,195,4,152,27,14,32,217,6,0,106,8,102,102,230,64,64,56,0,0,1,0,154,153,153,63,205,204,12,64,0,0,34,65,0,184,132,67,102,102,166,64,102,102,198,64,205,204,76,64,102,102,134,64,217,204,130,105,128,182,43,62,248,106,31,220,8,136,253,191,0,0,0,0,151,92,38,63,0,0,0,55,154,64,181,64,56,38,1,141,255,182,242,63,222,147,136,39,79,186,56,190,80,114,204,251,193,92,191,63,237,55,19,41,177,73,239,63,49,65,189,240,8,216,245,189,255,255,255,255,67,235,241,190,255,255,255,255,255,255,161,189,205,204,76,62,32,217,6,0,106,8,108,0,108,0,168,49, }; + u8 encoded_frame[] = { + 85, 149, 0, 195, 4, 152, 27, 14, 32, 217, 6, 0, 106, 8, + 102, 102, 230, 64, 64, 56, 0, 0, 1, 0, 154, 153, 153, 63, + 205, 204, 12, 64, 0, 0, 34, 65, 0, 184, 132, 67, 102, 102, + 166, 64, 102, 102, 198, 64, 205, 204, 76, 64, 102, 102, 134, 64, + 217, 204, 130, 105, 128, 182, 43, 62, 248, 106, 31, 220, 8, 136, + 253, 191, 0, 0, 0, 0, 151, 92, 38, 63, 0, 0, 0, 55, + 154, 64, 181, 64, 56, 38, 1, 141, 255, 182, 242, 63, 222, 147, + 136, 39, 79, 186, 56, 190, 80, 114, 204, 251, 193, 92, 191, 63, + 237, 55, 19, 41, 177, 73, 239, 63, 49, 65, 189, 240, 8, 216, + 245, 189, 255, 255, 255, 255, 67, 235, 241, 190, 255, 255, 255, 255, + 255, 255, 161, 189, 205, 204, 76, 62, 32, 217, 6, 0, 106, 8, + 108, 0, 108, 0, 168, 49, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_gal_dep_a.af0 = -1.7088896129280325e-05; - + test_msg.ephemeris_gal_dep_a.af1 = -8.185452315956353e-12; - + test_msg.ephemeris_gal_dep_a.af2 = 0.20000000298023224; - + test_msg.ephemeris_gal_dep_a.bgd_e1e5a = 1.2000000476837158; - + test_msg.ephemeris_gal_dep_a.bgd_e1e5b = 2.200000047683716; - + test_msg.ephemeris_gal_dep_a.c_ic = 3.200000047683716; - + test_msg.ephemeris_gal_dep_a.c_is = 4.199999809265137; - + test_msg.ephemeris_gal_dep_a.c_rc = 265.4375; - + test_msg.ephemeris_gal_dep_a.c_rs = 10.125; - + test_msg.ephemeris_gal_dep_a.c_uc = 5.199999809265137; - + test_msg.ephemeris_gal_dep_a.c_us = 6.199999809265137; - - + test_msg.ephemeris_gal_dep_a.common.fit_interval = 14400; - + test_msg.ephemeris_gal_dep_a.common.health_bits = 0; - - + test_msg.ephemeris_gal_dep_a.common.sid.code = 14; - + test_msg.ephemeris_gal_dep_a.common.sid.sat = 27; - - + test_msg.ephemeris_gal_dep_a.common.toe.tow = 448800; - + test_msg.ephemeris_gal_dep_a.common.toe.wn = 2154; - + test_msg.ephemeris_gal_dep_a.common.ura = 7.199999809265137; - + test_msg.ephemeris_gal_dep_a.common.valid = 1; - + test_msg.ephemeris_gal_dep_a.dn = 3.2262058129932258e-09; - + test_msg.ephemeris_gal_dep_a.ecc = 0.00017060607206076384; - + test_msg.ephemeris_gal_dep_a.inc = 0.9777456094977858; - + test_msg.ephemeris_gal_dep_a.inc_dot = -3.1787038343451465e-10; - + test_msg.ephemeris_gal_dep_a.iodc = 108; - + test_msg.ephemeris_gal_dep_a.iode = 108; - + test_msg.ephemeris_gal_dep_a.m0 = -1.8457115744155868; - + test_msg.ephemeris_gal_dep_a.omega0 = 1.16967730598334; - + test_msg.ephemeris_gal_dep_a.omegadot = -5.757382675240872e-09; - + test_msg.ephemeris_gal_dep_a.sqrta = 5440.602401733398; - - + test_msg.ephemeris_gal_dep_a.toc.tow = 448800; - + test_msg.ephemeris_gal_dep_a.toc.wn = 2154; - + test_msg.ephemeris_gal_dep_a.w = 0.12250912091662625; - sbp_message_send(&sbp_state, SbpMsgEphemerisGalDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisGalDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisGalDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisGalDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.af0 * 100 - -1.70888961293e-05 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.af0, expected -1.70888961293e-05, is %s", last_msg.msg.ephemeris_gal_dep_a.af0); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.af1 * 100 - -8.18545231596e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.af1, expected -8.18545231596e-12, is %s", last_msg.msg.ephemeris_gal_dep_a.af1); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.af2 * 100 - 0.20000000298 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.af2, expected 0.20000000298, is %s", last_msg.msg.ephemeris_gal_dep_a.af2); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.bgd_e1e5a * 100 - 1.20000004768 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.bgd_e1e5a, expected 1.20000004768, is %s", last_msg.msg.ephemeris_gal_dep_a.bgd_e1e5a); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.bgd_e1e5b * 100 - 2.20000004768 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.bgd_e1e5b, expected 2.20000004768, is %s", last_msg.msg.ephemeris_gal_dep_a.bgd_e1e5b); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.c_ic * 100 - 3.20000004768 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.c_ic, expected 3.20000004768, is %s", last_msg.msg.ephemeris_gal_dep_a.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.c_is * 100 - 4.19999980927 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.c_is, expected 4.19999980927, is %s", last_msg.msg.ephemeris_gal_dep_a.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.c_rc * 100 - 265.4375 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.c_rc, expected 265.4375, is %s", last_msg.msg.ephemeris_gal_dep_a.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.c_rs * 100 - 10.125 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.c_rs, expected 10.125, is %s", last_msg.msg.ephemeris_gal_dep_a.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.c_uc * 100 - 5.19999980927 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.c_uc, expected 5.19999980927, is %s", last_msg.msg.ephemeris_gal_dep_a.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.c_us * 100 - 6.19999980927 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.c_us, expected 6.19999980927, is %s", last_msg.msg.ephemeris_gal_dep_a.c_us); - - - ck_assert_msg(last_msg.msg.ephemeris_gal_dep_a.common.fit_interval == 14400, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.common.fit_interval, expected 14400, is %d", last_msg.msg.ephemeris_gal_dep_a.common.fit_interval); - - ck_assert_msg(last_msg.msg.ephemeris_gal_dep_a.common.health_bits == 0, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.common.health_bits, expected 0, is %d", last_msg.msg.ephemeris_gal_dep_a.common.health_bits); - - - ck_assert_msg(last_msg.msg.ephemeris_gal_dep_a.common.sid.code == 14, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.common.sid.code, expected 14, is %d", last_msg.msg.ephemeris_gal_dep_a.common.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_gal_dep_a.common.sid.sat == 27, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.common.sid.sat, expected 27, is %d", last_msg.msg.ephemeris_gal_dep_a.common.sid.sat); - - - ck_assert_msg(last_msg.msg.ephemeris_gal_dep_a.common.toe.tow == 448800, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.common.toe.tow, expected 448800, is %d", last_msg.msg.ephemeris_gal_dep_a.common.toe.tow); - - ck_assert_msg(last_msg.msg.ephemeris_gal_dep_a.common.toe.wn == 2154, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.common.toe.wn, expected 2154, is %d", last_msg.msg.ephemeris_gal_dep_a.common.toe.wn); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.common.ura * 100 - 7.19999980927 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.common.ura, expected 7.19999980927, is %s", last_msg.msg.ephemeris_gal_dep_a.common.ura); - - ck_assert_msg(last_msg.msg.ephemeris_gal_dep_a.common.valid == 1, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.common.valid, expected 1, is %d", last_msg.msg.ephemeris_gal_dep_a.common.valid); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.dn * 100 - 3.22620581299e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.dn, expected 3.22620581299e-09, is %s", last_msg.msg.ephemeris_gal_dep_a.dn); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.ecc * 100 - 0.000170606072061 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.ecc, expected 0.000170606072061, is %s", last_msg.msg.ephemeris_gal_dep_a.ecc); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.inc * 100 - 0.977745609498 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.inc, expected 0.977745609498, is %s", last_msg.msg.ephemeris_gal_dep_a.inc); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.inc_dot * 100 - -3.17870383435e-10 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.inc_dot, expected -3.17870383435e-10, is %s", last_msg.msg.ephemeris_gal_dep_a.inc_dot); - - ck_assert_msg(last_msg.msg.ephemeris_gal_dep_a.iodc == 108, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.iodc, expected 108, is %d", last_msg.msg.ephemeris_gal_dep_a.iodc); - - ck_assert_msg(last_msg.msg.ephemeris_gal_dep_a.iode == 108, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.iode, expected 108, is %d", last_msg.msg.ephemeris_gal_dep_a.iode); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.m0 * 100 - -1.84571157442 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.m0, expected -1.84571157442, is %s", last_msg.msg.ephemeris_gal_dep_a.m0); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.omega0 * 100 - 1.16967730598 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.omega0, expected 1.16967730598, is %s", last_msg.msg.ephemeris_gal_dep_a.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.omegadot * 100 - -5.75738267524e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.omegadot, expected -5.75738267524e-09, is %s", last_msg.msg.ephemeris_gal_dep_a.omegadot); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.sqrta * 100 - 5440.60240173 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.sqrta, expected 5440.60240173, is %s", last_msg.msg.ephemeris_gal_dep_a.sqrta); - - - ck_assert_msg(last_msg.msg.ephemeris_gal_dep_a.toc.tow == 448800, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.toc.tow, expected 448800, is %d", last_msg.msg.ephemeris_gal_dep_a.toc.tow); - - ck_assert_msg(last_msg.msg.ephemeris_gal_dep_a.toc.wn == 2154, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.toc.wn, expected 2154, is %d", last_msg.msg.ephemeris_gal_dep_a.toc.wn); - - ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.w * 100 - 0.122509120917 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_gal_dep_a.w, expected 0.122509120917, is %s", last_msg.msg.ephemeris_gal_dep_a.w); + ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.af0 * 100 - + -1.70888961293e-05 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.af0, " + "expected -1.70888961293e-05, is %s", + last_msg.msg.ephemeris_gal_dep_a.af0); + + ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.af1 * 100 - + -8.18545231596e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.af1, " + "expected -8.18545231596e-12, is %s", + last_msg.msg.ephemeris_gal_dep_a.af1); + + ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.af2 * 100 - + 0.20000000298 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.af2, " + "expected 0.20000000298, is %s", + last_msg.msg.ephemeris_gal_dep_a.af2); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal_dep_a.bgd_e1e5a * 100 - + 1.20000004768 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.bgd_e1e5a, " + "expected 1.20000004768, is %s", + last_msg.msg.ephemeris_gal_dep_a.bgd_e1e5a); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal_dep_a.bgd_e1e5b * 100 - + 2.20000004768 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.bgd_e1e5b, " + "expected 2.20000004768, is %s", + last_msg.msg.ephemeris_gal_dep_a.bgd_e1e5b); + + ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.c_ic * 100 - + 3.20000004768 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.c_ic, " + "expected 3.20000004768, is %s", + last_msg.msg.ephemeris_gal_dep_a.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.c_is * 100 - + 4.19999980927 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.c_is, " + "expected 4.19999980927, is %s", + last_msg.msg.ephemeris_gal_dep_a.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal_dep_a.c_rc * 100 - 265.4375 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.c_rc, expected " + "265.4375, is %s", + last_msg.msg.ephemeris_gal_dep_a.c_rc); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal_dep_a.c_rs * 100 - 10.125 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.c_rs, expected " + "10.125, is %s", + last_msg.msg.ephemeris_gal_dep_a.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.c_uc * 100 - + 5.19999980927 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.c_uc, " + "expected 5.19999980927, is %s", + last_msg.msg.ephemeris_gal_dep_a.c_uc); + + ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.c_us * 100 - + 6.19999980927 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.c_us, " + "expected 6.19999980927, is %s", + last_msg.msg.ephemeris_gal_dep_a.c_us); + + ck_assert_msg(last_msg.msg.ephemeris_gal_dep_a.common.fit_interval == 14400, + "incorrect value for " + "last_msg.msg.ephemeris_gal_dep_a.common.fit_interval, " + "expected 14400, is %d", + last_msg.msg.ephemeris_gal_dep_a.common.fit_interval); + + ck_assert_msg(last_msg.msg.ephemeris_gal_dep_a.common.health_bits == 0, + "incorrect value for " + "last_msg.msg.ephemeris_gal_dep_a.common.health_bits, " + "expected 0, is %d", + last_msg.msg.ephemeris_gal_dep_a.common.health_bits); + + ck_assert_msg( + last_msg.msg.ephemeris_gal_dep_a.common.sid.code == 14, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.common.sid.code, " + "expected 14, is %d", + last_msg.msg.ephemeris_gal_dep_a.common.sid.code); + + ck_assert_msg( + last_msg.msg.ephemeris_gal_dep_a.common.sid.sat == 27, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.common.sid.sat, " + "expected 27, is %d", + last_msg.msg.ephemeris_gal_dep_a.common.sid.sat); + + ck_assert_msg( + last_msg.msg.ephemeris_gal_dep_a.common.toe.tow == 448800, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.common.toe.tow, " + "expected 448800, is %d", + last_msg.msg.ephemeris_gal_dep_a.common.toe.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_gal_dep_a.common.toe.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.common.toe.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_gal_dep_a.common.toe.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal_dep_a.common.ura * 100 - + 7.19999980927 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.common.ura, " + "expected 7.19999980927, is %s", + last_msg.msg.ephemeris_gal_dep_a.common.ura); + + ck_assert_msg( + last_msg.msg.ephemeris_gal_dep_a.common.valid == 1, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.common.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_gal_dep_a.common.valid); + + ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.dn * 100 - + 3.22620581299e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.dn, " + "expected 3.22620581299e-09, is %s", + last_msg.msg.ephemeris_gal_dep_a.dn); + + ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.ecc * 100 - + 0.000170606072061 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.ecc, " + "expected 0.000170606072061, is %s", + last_msg.msg.ephemeris_gal_dep_a.ecc); + + ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.inc * 100 - + 0.977745609498 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.inc, " + "expected 0.977745609498, is %s", + last_msg.msg.ephemeris_gal_dep_a.inc); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal_dep_a.inc_dot * 100 - + -3.17870383435e-10 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.inc_dot, " + "expected -3.17870383435e-10, is %s", + last_msg.msg.ephemeris_gal_dep_a.inc_dot); + + ck_assert_msg(last_msg.msg.ephemeris_gal_dep_a.iodc == 108, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.iodc, " + "expected 108, is %d", + last_msg.msg.ephemeris_gal_dep_a.iodc); + + ck_assert_msg(last_msg.msg.ephemeris_gal_dep_a.iode == 108, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.iode, " + "expected 108, is %d", + last_msg.msg.ephemeris_gal_dep_a.iode); + + ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.m0 * 100 - + -1.84571157442 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.m0, " + "expected -1.84571157442, is %s", + last_msg.msg.ephemeris_gal_dep_a.m0); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal_dep_a.omega0 * 100 - 1.16967730598 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.omega0, expected " + "1.16967730598, is %s", + last_msg.msg.ephemeris_gal_dep_a.omega0); + + ck_assert_msg( + (last_msg.msg.ephemeris_gal_dep_a.omegadot * 100 - + -5.75738267524e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.omegadot, " + "expected -5.75738267524e-09, is %s", + last_msg.msg.ephemeris_gal_dep_a.omegadot); + + ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.sqrta * 100 - + 5440.60240173 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.sqrta, " + "expected 5440.60240173, is %s", + last_msg.msg.ephemeris_gal_dep_a.sqrta); + + ck_assert_msg( + last_msg.msg.ephemeris_gal_dep_a.toc.tow == 448800, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.toc.tow, " + "expected 448800, is %d", + last_msg.msg.ephemeris_gal_dep_a.toc.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_gal_dep_a.toc.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.toc.wn, expected " + "2154, is %d", + last_msg.msg.ephemeris_gal_dep_a.toc.wn); + + ck_assert_msg((last_msg.msg.ephemeris_gal_dep_a.w * 100 - + 0.122509120917 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_gal_dep_a.w, " + "expected 0.122509120917, is %s", + last_msg.msg.ephemeris_gal_dep_a.w); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisGalDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisGalDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisGalDepA"); +Suite *auto_check_sbp_observation_MsgEphemerisGalDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_observation_MsgEphemerisGalDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisGalDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisGalDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisSbas.c b/c/test/auto_check_sbp_observation_MsgEphemerisSbas.c index 5518ea98f..09d059521 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisSbas.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisSbas.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbas.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbas.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisSbas ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisSbas) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisSbas ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,122 +90,200 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisSbas ) logging_reset(); - sbp_callback_register(&sbp_state, 0x8c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x8c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,140,0,195,4,74,22,6,176,207,6,0,106,8,0,0,64,177,0,0,0,0,1,0,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,51,208,215,196,215,233,30,197,86,116,89,68,0,0,122,53,0,0,122,53,0,128,59,54,96,139,37,186,0,0,30,45,192,147, }; + u8 encoded_frame[] = { + 85, 140, 0, 195, 4, 74, 22, 6, 176, 207, 6, 0, 106, 8, + 0, 0, 64, 177, 0, 0, 0, 0, 1, 0, 0, 0, 128, 66, + 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, 34, 65, 0, 0, + 240, 199, 84, 86, 117, 193, 51, 208, 215, 196, 215, 233, 30, 197, + 86, 116, 89, 68, 0, 0, 122, 53, 0, 0, 122, 53, 0, 128, + 59, 54, 96, 139, 37, 186, 0, 0, 30, 45, 192, 147, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_sbas.a_gf0 = -0.0006315018981695175; - + test_msg.ephemeris_sbas.a_gf1 = 8.981260180007666e-12; - - + test_msg.ephemeris_sbas.acc[0] = 9.313225746154785e-07; - + test_msg.ephemeris_sbas.acc[1] = 9.313225746154785e-07; - + test_msg.ephemeris_sbas.acc[2] = 2.7939677238464355e-06; - - + test_msg.ephemeris_sbas.common.fit_interval = 0; - + test_msg.ephemeris_sbas.common.health_bits = 0; - - + test_msg.ephemeris_sbas.common.sid.code = 6; - + test_msg.ephemeris_sbas.common.sid.sat = 22; - - + test_msg.ephemeris_sbas.common.toe.tow = 446384; - + test_msg.ephemeris_sbas.common.toe.wn = 2154; - + test_msg.ephemeris_sbas.common.ura = -2.7939677238464355e-09; - + test_msg.ephemeris_sbas.common.valid = 1; - - + test_msg.ephemeris_sbas.pos[0] = -12177330.078125; - + test_msg.ephemeris_sbas.pos[1] = 599893.06640625; - + test_msg.ephemeris_sbas.pos[2] = -22373708.49609375; - - + test_msg.ephemeris_sbas.vel[0] = -1726.5062255859375; - + test_msg.ephemeris_sbas.vel[1] = -2542.614990234375; - + test_msg.ephemeris_sbas.vel[2] = 869.8177490234375; - sbp_message_send(&sbp_state, SbpMsgEphemerisSbas, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisSbas, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisSbas, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisSbas, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_sbas.a_gf0 * 100 - -0.00063150189817 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas.a_gf0, expected -0.00063150189817, is %s", last_msg.msg.ephemeris_sbas.a_gf0); - - ck_assert_msg((last_msg.msg.ephemeris_sbas.a_gf1 * 100 - 8.98126018001e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas.a_gf1, expected 8.98126018001e-12, is %s", last_msg.msg.ephemeris_sbas.a_gf1); - - ck_assert_msg((last_msg.msg.ephemeris_sbas.acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas.acc[0], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_sbas.acc[0]); - ck_assert_msg((last_msg.msg.ephemeris_sbas.acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas.acc[1], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_sbas.acc[1]); - ck_assert_msg((last_msg.msg.ephemeris_sbas.acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas.acc[2], expected 2.79396772385e-06, is %s", last_msg.msg.ephemeris_sbas.acc[2]); - - - ck_assert_msg(last_msg.msg.ephemeris_sbas.common.fit_interval == 0, "incorrect value for last_msg.msg.ephemeris_sbas.common.fit_interval, expected 0, is %d", last_msg.msg.ephemeris_sbas.common.fit_interval); - - ck_assert_msg(last_msg.msg.ephemeris_sbas.common.health_bits == 0, "incorrect value for last_msg.msg.ephemeris_sbas.common.health_bits, expected 0, is %d", last_msg.msg.ephemeris_sbas.common.health_bits); - - - ck_assert_msg(last_msg.msg.ephemeris_sbas.common.sid.code == 6, "incorrect value for last_msg.msg.ephemeris_sbas.common.sid.code, expected 6, is %d", last_msg.msg.ephemeris_sbas.common.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_sbas.common.sid.sat == 22, "incorrect value for last_msg.msg.ephemeris_sbas.common.sid.sat, expected 22, is %d", last_msg.msg.ephemeris_sbas.common.sid.sat); - - - ck_assert_msg(last_msg.msg.ephemeris_sbas.common.toe.tow == 446384, "incorrect value for last_msg.msg.ephemeris_sbas.common.toe.tow, expected 446384, is %d", last_msg.msg.ephemeris_sbas.common.toe.tow); - - ck_assert_msg(last_msg.msg.ephemeris_sbas.common.toe.wn == 2154, "incorrect value for last_msg.msg.ephemeris_sbas.common.toe.wn, expected 2154, is %d", last_msg.msg.ephemeris_sbas.common.toe.wn); - - ck_assert_msg((last_msg.msg.ephemeris_sbas.common.ura * 100 - -2.79396772385e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas.common.ura, expected -2.79396772385e-09, is %s", last_msg.msg.ephemeris_sbas.common.ura); - - ck_assert_msg(last_msg.msg.ephemeris_sbas.common.valid == 1, "incorrect value for last_msg.msg.ephemeris_sbas.common.valid, expected 1, is %d", last_msg.msg.ephemeris_sbas.common.valid); - - ck_assert_msg((last_msg.msg.ephemeris_sbas.pos[0] * 100 - -12177330.0781 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas.pos[0], expected -12177330.0781, is %s", last_msg.msg.ephemeris_sbas.pos[0]); - ck_assert_msg((last_msg.msg.ephemeris_sbas.pos[1] * 100 - 599893.066406 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas.pos[1], expected 599893.066406, is %s", last_msg.msg.ephemeris_sbas.pos[1]); - ck_assert_msg((last_msg.msg.ephemeris_sbas.pos[2] * 100 - -22373708.4961 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas.pos[2], expected -22373708.4961, is %s", last_msg.msg.ephemeris_sbas.pos[2]); - - ck_assert_msg((last_msg.msg.ephemeris_sbas.vel[0] * 100 - -1726.50622559 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas.vel[0], expected -1726.50622559, is %s", last_msg.msg.ephemeris_sbas.vel[0]); - ck_assert_msg((last_msg.msg.ephemeris_sbas.vel[1] * 100 - -2542.61499023 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas.vel[1], expected -2542.61499023, is %s", last_msg.msg.ephemeris_sbas.vel[1]); - ck_assert_msg((last_msg.msg.ephemeris_sbas.vel[2] * 100 - 869.817749023 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas.vel[2], expected 869.817749023, is %s", last_msg.msg.ephemeris_sbas.vel[2]); + ck_assert_msg((last_msg.msg.ephemeris_sbas.a_gf0 * 100 - + -0.00063150189817 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas.a_gf0, " + "expected -0.00063150189817, is %s", + last_msg.msg.ephemeris_sbas.a_gf0); + + ck_assert_msg((last_msg.msg.ephemeris_sbas.a_gf1 * 100 - + 8.98126018001e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas.a_gf1, " + "expected 8.98126018001e-12, is %s", + last_msg.msg.ephemeris_sbas.a_gf1); + + ck_assert_msg((last_msg.msg.ephemeris_sbas.acc[0] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas.acc[0], " + "expected 9.31322574615e-07, is %s", + last_msg.msg.ephemeris_sbas.acc[0]); + ck_assert_msg((last_msg.msg.ephemeris_sbas.acc[1] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas.acc[1], " + "expected 9.31322574615e-07, is %s", + last_msg.msg.ephemeris_sbas.acc[1]); + ck_assert_msg((last_msg.msg.ephemeris_sbas.acc[2] * 100 - + 2.79396772385e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas.acc[2], " + "expected 2.79396772385e-06, is %s", + last_msg.msg.ephemeris_sbas.acc[2]); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas.common.fit_interval == 0, + "incorrect value for last_msg.msg.ephemeris_sbas.common.fit_interval, " + "expected 0, is %d", + last_msg.msg.ephemeris_sbas.common.fit_interval); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas.common.health_bits == 0, + "incorrect value for last_msg.msg.ephemeris_sbas.common.health_bits, " + "expected 0, is %d", + last_msg.msg.ephemeris_sbas.common.health_bits); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas.common.sid.code == 6, + "incorrect value for last_msg.msg.ephemeris_sbas.common.sid.code, " + "expected 6, is %d", + last_msg.msg.ephemeris_sbas.common.sid.code); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas.common.sid.sat == 22, + "incorrect value for last_msg.msg.ephemeris_sbas.common.sid.sat, " + "expected 22, is %d", + last_msg.msg.ephemeris_sbas.common.sid.sat); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas.common.toe.tow == 446384, + "incorrect value for last_msg.msg.ephemeris_sbas.common.toe.tow, " + "expected 446384, is %d", + last_msg.msg.ephemeris_sbas.common.toe.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas.common.toe.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_sbas.common.toe.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_sbas.common.toe.wn); + + ck_assert_msg((last_msg.msg.ephemeris_sbas.common.ura * 100 - + -2.79396772385e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas.common.ura, " + "expected -2.79396772385e-09, is %s", + last_msg.msg.ephemeris_sbas.common.ura); + + ck_assert_msg(last_msg.msg.ephemeris_sbas.common.valid == 1, + "incorrect value for " + "last_msg.msg.ephemeris_sbas.common.valid, expected 1, is %d", + last_msg.msg.ephemeris_sbas.common.valid); + + ck_assert_msg((last_msg.msg.ephemeris_sbas.pos[0] * 100 - + -12177330.0781 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas.pos[0], " + "expected -12177330.0781, is %s", + last_msg.msg.ephemeris_sbas.pos[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas.pos[1] * 100 - 599893.066406 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas.pos[1], expected " + "599893.066406, is %s", + last_msg.msg.ephemeris_sbas.pos[1]); + ck_assert_msg((last_msg.msg.ephemeris_sbas.pos[2] * 100 - + -22373708.4961 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas.pos[2], " + "expected -22373708.4961, is %s", + last_msg.msg.ephemeris_sbas.pos[2]); + + ck_assert_msg((last_msg.msg.ephemeris_sbas.vel[0] * 100 - + -1726.50622559 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas.vel[0], " + "expected -1726.50622559, is %s", + last_msg.msg.ephemeris_sbas.vel[0]); + ck_assert_msg((last_msg.msg.ephemeris_sbas.vel[1] * 100 - + -2542.61499023 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas.vel[1], " + "expected -2542.61499023, is %s", + last_msg.msg.ephemeris_sbas.vel[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas.vel[2] * 100 - 869.817749023 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas.vel[2], expected " + "869.817749023, is %s", + last_msg.msg.ephemeris_sbas.vel[2]); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisSbas_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisSbas"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisSbas"); +Suite *auto_check_sbp_observation_MsgEphemerisSbas_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgEphemerisSbas"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisSbas"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisSbas); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisSbasDepA.c b/c/test/auto_check_sbp_observation_MsgEphemerisSbasDepA.c index 26024aad8..b9e51cc91 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisSbasDepA.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisSbasDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisSbasDepA ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisSbasDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisSbasDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,126 +90,224 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisSbasDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x82, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x82, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,130,0,123,0,112,22,0,6,0,176,207,6,0,106,8,0,0,0,0,0,0,0,64,0,0,0,0,1,0,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,178,180, }; + u8 encoded_frame[] = { + 85, 130, 0, 123, 0, 112, 22, 0, 6, 0, 176, 207, 6, 0, + 106, 8, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, + 1, 0, 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, + 170, 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, + 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, 192, + 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, 0, 64, + 175, 62, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, + 0, 112, 199, 62, 0, 0, 0, 0, 108, 177, 68, 191, 0, 0, + 0, 0, 0, 192, 163, 61, 178, 180, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_sbas_dep_a.a_gf0 = -0.0006315018981695175; - + test_msg.ephemeris_sbas_dep_a.a_gf1 = 8.981260180007666e-12; - - + test_msg.ephemeris_sbas_dep_a.acc[0] = 9.313225746154785e-07; - + test_msg.ephemeris_sbas_dep_a.acc[1] = 9.313225746154785e-07; - + test_msg.ephemeris_sbas_dep_a.acc[2] = 2.7939677238464355e-06; - - + test_msg.ephemeris_sbas_dep_a.common.fit_interval = 0; - + test_msg.ephemeris_sbas_dep_a.common.health_bits = 0; - - + test_msg.ephemeris_sbas_dep_a.common.sid.code = 6; - + test_msg.ephemeris_sbas_dep_a.common.sid.reserved = 0; - + test_msg.ephemeris_sbas_dep_a.common.sid.sat = 22; - - + test_msg.ephemeris_sbas_dep_a.common.toe.tow = 446384; - + test_msg.ephemeris_sbas_dep_a.common.toe.wn = 2154; - + test_msg.ephemeris_sbas_dep_a.common.ura = 2.0; - + test_msg.ephemeris_sbas_dep_a.common.valid = 1; - - + test_msg.ephemeris_sbas_dep_a.pos[0] = -12177330.078125; - + test_msg.ephemeris_sbas_dep_a.pos[1] = 599893.06640625; - + test_msg.ephemeris_sbas_dep_a.pos[2] = -22373708.49609375; - - + test_msg.ephemeris_sbas_dep_a.vel[0] = -1726.506233215332; - + test_msg.ephemeris_sbas_dep_a.vel[1] = -2542.6149368286133; - + test_msg.ephemeris_sbas_dep_a.vel[2] = 869.8177337646484; - sbp_message_send(&sbp_state, SbpMsgEphemerisSbasDepA, 123, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisSbasDepA, 123, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisSbasDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisSbasDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_a.a_gf0 * 100 - -0.00063150189817 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.a_gf0, expected -0.00063150189817, is %s", last_msg.msg.ephemeris_sbas_dep_a.a_gf0); - - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_a.a_gf1 * 100 - 8.98126018001e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.a_gf1, expected 8.98126018001e-12, is %s", last_msg.msg.ephemeris_sbas_dep_a.a_gf1); - - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_a.acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.acc[0], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_sbas_dep_a.acc[0]); - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_a.acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.acc[1], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_sbas_dep_a.acc[1]); - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_a.acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.acc[2], expected 2.79396772385e-06, is %s", last_msg.msg.ephemeris_sbas_dep_a.acc[2]); - - - ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_a.common.fit_interval == 0, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.common.fit_interval, expected 0, is %d", last_msg.msg.ephemeris_sbas_dep_a.common.fit_interval); - - ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_a.common.health_bits == 0, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.common.health_bits, expected 0, is %d", last_msg.msg.ephemeris_sbas_dep_a.common.health_bits); - - - ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_a.common.sid.code == 6, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.common.sid.code, expected 6, is %d", last_msg.msg.ephemeris_sbas_dep_a.common.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_a.common.sid.reserved == 0, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.common.sid.reserved, expected 0, is %d", last_msg.msg.ephemeris_sbas_dep_a.common.sid.reserved); - - ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_a.common.sid.sat == 22, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.common.sid.sat, expected 22, is %d", last_msg.msg.ephemeris_sbas_dep_a.common.sid.sat); - - - ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_a.common.toe.tow == 446384, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.common.toe.tow, expected 446384, is %d", last_msg.msg.ephemeris_sbas_dep_a.common.toe.tow); - - ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_a.common.toe.wn == 2154, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.common.toe.wn, expected 2154, is %d", last_msg.msg.ephemeris_sbas_dep_a.common.toe.wn); - - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_a.common.ura * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.common.ura, expected 2.0, is %s", last_msg.msg.ephemeris_sbas_dep_a.common.ura); - - ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_a.common.valid == 1, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.common.valid, expected 1, is %d", last_msg.msg.ephemeris_sbas_dep_a.common.valid); - - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_a.pos[0] * 100 - -12177330.0781 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.pos[0], expected -12177330.0781, is %s", last_msg.msg.ephemeris_sbas_dep_a.pos[0]); - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_a.pos[1] * 100 - 599893.066406 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.pos[1], expected 599893.066406, is %s", last_msg.msg.ephemeris_sbas_dep_a.pos[1]); - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_a.pos[2] * 100 - -22373708.4961 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.pos[2], expected -22373708.4961, is %s", last_msg.msg.ephemeris_sbas_dep_a.pos[2]); - - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_a.vel[0] * 100 - -1726.50623322 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.vel[0], expected -1726.50623322, is %s", last_msg.msg.ephemeris_sbas_dep_a.vel[0]); - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_a.vel[1] * 100 - -2542.61493683 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.vel[1], expected -2542.61493683, is %s", last_msg.msg.ephemeris_sbas_dep_a.vel[1]); - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_a.vel[2] * 100 - 869.817733765 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.vel[2], expected 869.817733765, is %s", last_msg.msg.ephemeris_sbas_dep_a.vel[2]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_a.a_gf0 * 100 - + -0.00063150189817 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.a_gf0, expected " + "-0.00063150189817, is %s", + last_msg.msg.ephemeris_sbas_dep_a.a_gf0); + + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_a.a_gf1 * 100 - + 8.98126018001e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.a_gf1, expected " + "8.98126018001e-12, is %s", + last_msg.msg.ephemeris_sbas_dep_a.a_gf1); + + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_a.acc[0] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.acc[0], " + "expected 9.31322574615e-07, is %s", + last_msg.msg.ephemeris_sbas_dep_a.acc[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_a.acc[1] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.acc[1], " + "expected 9.31322574615e-07, is %s", + last_msg.msg.ephemeris_sbas_dep_a.acc[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_a.acc[2] * 100 - + 2.79396772385e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.acc[2], " + "expected 2.79396772385e-06, is %s", + last_msg.msg.ephemeris_sbas_dep_a.acc[2]); + + ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_a.common.fit_interval == 0, + "incorrect value for " + "last_msg.msg.ephemeris_sbas_dep_a.common.fit_interval, " + "expected 0, is %d", + last_msg.msg.ephemeris_sbas_dep_a.common.fit_interval); + + ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_a.common.health_bits == 0, + "incorrect value for " + "last_msg.msg.ephemeris_sbas_dep_a.common.health_bits, " + "expected 0, is %d", + last_msg.msg.ephemeris_sbas_dep_a.common.health_bits); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas_dep_a.common.sid.code == 6, + "incorrect value for " + "last_msg.msg.ephemeris_sbas_dep_a.common.sid.code, expected 6, is %d", + last_msg.msg.ephemeris_sbas_dep_a.common.sid.code); + + ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_a.common.sid.reserved == 0, + "incorrect value for " + "last_msg.msg.ephemeris_sbas_dep_a.common.sid.reserved, " + "expected 0, is %d", + last_msg.msg.ephemeris_sbas_dep_a.common.sid.reserved); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas_dep_a.common.sid.sat == 22, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.common.sid.sat, " + "expected 22, is %d", + last_msg.msg.ephemeris_sbas_dep_a.common.sid.sat); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas_dep_a.common.toe.tow == 446384, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.common.toe.tow, " + "expected 446384, is %d", + last_msg.msg.ephemeris_sbas_dep_a.common.toe.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas_dep_a.common.toe.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.common.toe.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_sbas_dep_a.common.toe.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_a.common.ura * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.common.ura, " + "expected 2.0, is %s", + last_msg.msg.ephemeris_sbas_dep_a.common.ura); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas_dep_a.common.valid == 1, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.common.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_sbas_dep_a.common.valid); + + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_a.pos[0] * 100 - + -12177330.0781 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.pos[0], " + "expected -12177330.0781, is %s", + last_msg.msg.ephemeris_sbas_dep_a.pos[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_a.pos[1] * 100 - 599893.066406 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.pos[1], " + "expected 599893.066406, is %s", + last_msg.msg.ephemeris_sbas_dep_a.pos[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_a.pos[2] * 100 - + -22373708.4961 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.pos[2], " + "expected -22373708.4961, is %s", + last_msg.msg.ephemeris_sbas_dep_a.pos[2]); + + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_a.vel[0] * 100 - + -1726.50623322 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.vel[0], " + "expected -1726.50623322, is %s", + last_msg.msg.ephemeris_sbas_dep_a.vel[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_a.vel[1] * 100 - + -2542.61493683 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.vel[1], " + "expected -2542.61493683, is %s", + last_msg.msg.ephemeris_sbas_dep_a.vel[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_a.vel[2] * 100 - 869.817733765 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_a.vel[2], " + "expected 869.817733765, is %s", + last_msg.msg.ephemeris_sbas_dep_a.vel[2]); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisSbasDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisSbasDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisSbasDepA"); +Suite *auto_check_sbp_observation_MsgEphemerisSbasDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_observation_MsgEphemerisSbasDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisSbasDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisSbasDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgEphemerisSbasDepB.c b/c/test/auto_check_sbp_observation_MsgEphemerisSbasDepB.c index 965b7f71a..8fa95f64c 100644 --- a/c/test/auto_check_sbp_observation_MsgEphemerisSbasDepB.c +++ b/c/test/auto_check_sbp_observation_MsgEphemerisSbasDepB.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepB.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgEphemerisSbasDepB ) -{ +START_TEST(test_auto_check_sbp_observation_MsgEphemerisSbasDepB) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisSbasDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,122 +90,216 @@ START_TEST( test_auto_check_sbp_observation_MsgEphemerisSbasDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x84, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x84, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,132,0,123,0,110,22,6,176,207,6,0,106,8,0,0,0,0,0,0,0,64,0,0,0,0,1,0,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,145,104, }; + u8 encoded_frame[] = { + 85, 132, 0, 123, 0, 110, 22, 6, 176, 207, 6, 0, 106, 8, + 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 1, 0, + 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, + 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, 0, 98, + 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, 192, 0, 0, + 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, 0, 64, 175, 62, + 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, 0, 112, + 199, 62, 0, 0, 0, 0, 108, 177, 68, 191, 0, 0, 0, 0, + 0, 192, 163, 61, 145, 104, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_sbas_dep_b.a_gf0 = -0.0006315018981695175; - + test_msg.ephemeris_sbas_dep_b.a_gf1 = 8.981260180007666e-12; - - + test_msg.ephemeris_sbas_dep_b.acc[0] = 9.313225746154785e-07; - + test_msg.ephemeris_sbas_dep_b.acc[1] = 9.313225746154785e-07; - + test_msg.ephemeris_sbas_dep_b.acc[2] = 2.7939677238464355e-06; - - + test_msg.ephemeris_sbas_dep_b.common.fit_interval = 0; - + test_msg.ephemeris_sbas_dep_b.common.health_bits = 0; - - + test_msg.ephemeris_sbas_dep_b.common.sid.code = 6; - + test_msg.ephemeris_sbas_dep_b.common.sid.sat = 22; - - + test_msg.ephemeris_sbas_dep_b.common.toe.tow = 446384; - + test_msg.ephemeris_sbas_dep_b.common.toe.wn = 2154; - + test_msg.ephemeris_sbas_dep_b.common.ura = 2.0; - + test_msg.ephemeris_sbas_dep_b.common.valid = 1; - - + test_msg.ephemeris_sbas_dep_b.pos[0] = -12177330.078125; - + test_msg.ephemeris_sbas_dep_b.pos[1] = 599893.06640625; - + test_msg.ephemeris_sbas_dep_b.pos[2] = -22373708.49609375; - - + test_msg.ephemeris_sbas_dep_b.vel[0] = -1726.506233215332; - + test_msg.ephemeris_sbas_dep_b.vel[1] = -2542.6149368286133; - + test_msg.ephemeris_sbas_dep_b.vel[2] = 869.8177337646484; - sbp_message_send(&sbp_state, SbpMsgEphemerisSbasDepB, 123, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisSbasDepB, 123, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisSbasDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisSbasDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_b.a_gf0 * 100 - -0.00063150189817 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.a_gf0, expected -0.00063150189817, is %s", last_msg.msg.ephemeris_sbas_dep_b.a_gf0); - - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_b.a_gf1 * 100 - 8.98126018001e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.a_gf1, expected 8.98126018001e-12, is %s", last_msg.msg.ephemeris_sbas_dep_b.a_gf1); - - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_b.acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.acc[0], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_sbas_dep_b.acc[0]); - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_b.acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.acc[1], expected 9.31322574615e-07, is %s", last_msg.msg.ephemeris_sbas_dep_b.acc[1]); - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_b.acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.acc[2], expected 2.79396772385e-06, is %s", last_msg.msg.ephemeris_sbas_dep_b.acc[2]); - - - ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_b.common.fit_interval == 0, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.common.fit_interval, expected 0, is %d", last_msg.msg.ephemeris_sbas_dep_b.common.fit_interval); - - ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_b.common.health_bits == 0, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.common.health_bits, expected 0, is %d", last_msg.msg.ephemeris_sbas_dep_b.common.health_bits); - - - ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_b.common.sid.code == 6, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.common.sid.code, expected 6, is %d", last_msg.msg.ephemeris_sbas_dep_b.common.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_b.common.sid.sat == 22, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.common.sid.sat, expected 22, is %d", last_msg.msg.ephemeris_sbas_dep_b.common.sid.sat); - - - ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_b.common.toe.tow == 446384, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.common.toe.tow, expected 446384, is %d", last_msg.msg.ephemeris_sbas_dep_b.common.toe.tow); - - ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_b.common.toe.wn == 2154, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.common.toe.wn, expected 2154, is %d", last_msg.msg.ephemeris_sbas_dep_b.common.toe.wn); - - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_b.common.ura * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.common.ura, expected 2.0, is %s", last_msg.msg.ephemeris_sbas_dep_b.common.ura); - - ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_b.common.valid == 1, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.common.valid, expected 1, is %d", last_msg.msg.ephemeris_sbas_dep_b.common.valid); - - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_b.pos[0] * 100 - -12177330.0781 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.pos[0], expected -12177330.0781, is %s", last_msg.msg.ephemeris_sbas_dep_b.pos[0]); - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_b.pos[1] * 100 - 599893.066406 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.pos[1], expected 599893.066406, is %s", last_msg.msg.ephemeris_sbas_dep_b.pos[1]); - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_b.pos[2] * 100 - -22373708.4961 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.pos[2], expected -22373708.4961, is %s", last_msg.msg.ephemeris_sbas_dep_b.pos[2]); - - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_b.vel[0] * 100 - -1726.50623322 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.vel[0], expected -1726.50623322, is %s", last_msg.msg.ephemeris_sbas_dep_b.vel[0]); - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_b.vel[1] * 100 - -2542.61493683 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.vel[1], expected -2542.61493683, is %s", last_msg.msg.ephemeris_sbas_dep_b.vel[1]); - ck_assert_msg((last_msg.msg.ephemeris_sbas_dep_b.vel[2] * 100 - 869.817733765 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.vel[2], expected 869.817733765, is %s", last_msg.msg.ephemeris_sbas_dep_b.vel[2]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_b.a_gf0 * 100 - + -0.00063150189817 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.a_gf0, expected " + "-0.00063150189817, is %s", + last_msg.msg.ephemeris_sbas_dep_b.a_gf0); + + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_b.a_gf1 * 100 - + 8.98126018001e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.a_gf1, expected " + "8.98126018001e-12, is %s", + last_msg.msg.ephemeris_sbas_dep_b.a_gf1); + + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_b.acc[0] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.acc[0], " + "expected 9.31322574615e-07, is %s", + last_msg.msg.ephemeris_sbas_dep_b.acc[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_b.acc[1] * 100 - + 9.31322574615e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.acc[1], " + "expected 9.31322574615e-07, is %s", + last_msg.msg.ephemeris_sbas_dep_b.acc[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_b.acc[2] * 100 - + 2.79396772385e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.acc[2], " + "expected 2.79396772385e-06, is %s", + last_msg.msg.ephemeris_sbas_dep_b.acc[2]); + + ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_b.common.fit_interval == 0, + "incorrect value for " + "last_msg.msg.ephemeris_sbas_dep_b.common.fit_interval, " + "expected 0, is %d", + last_msg.msg.ephemeris_sbas_dep_b.common.fit_interval); + + ck_assert_msg(last_msg.msg.ephemeris_sbas_dep_b.common.health_bits == 0, + "incorrect value for " + "last_msg.msg.ephemeris_sbas_dep_b.common.health_bits, " + "expected 0, is %d", + last_msg.msg.ephemeris_sbas_dep_b.common.health_bits); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas_dep_b.common.sid.code == 6, + "incorrect value for " + "last_msg.msg.ephemeris_sbas_dep_b.common.sid.code, expected 6, is %d", + last_msg.msg.ephemeris_sbas_dep_b.common.sid.code); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas_dep_b.common.sid.sat == 22, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.common.sid.sat, " + "expected 22, is %d", + last_msg.msg.ephemeris_sbas_dep_b.common.sid.sat); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas_dep_b.common.toe.tow == 446384, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.common.toe.tow, " + "expected 446384, is %d", + last_msg.msg.ephemeris_sbas_dep_b.common.toe.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas_dep_b.common.toe.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.common.toe.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_sbas_dep_b.common.toe.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_b.common.ura * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.common.ura, " + "expected 2.0, is %s", + last_msg.msg.ephemeris_sbas_dep_b.common.ura); + + ck_assert_msg( + last_msg.msg.ephemeris_sbas_dep_b.common.valid == 1, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.common.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_sbas_dep_b.common.valid); + + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_b.pos[0] * 100 - + -12177330.0781 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.pos[0], " + "expected -12177330.0781, is %s", + last_msg.msg.ephemeris_sbas_dep_b.pos[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_b.pos[1] * 100 - 599893.066406 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.pos[1], " + "expected 599893.066406, is %s", + last_msg.msg.ephemeris_sbas_dep_b.pos[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_b.pos[2] * 100 - + -22373708.4961 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.pos[2], " + "expected -22373708.4961, is %s", + last_msg.msg.ephemeris_sbas_dep_b.pos[2]); + + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_b.vel[0] * 100 - + -1726.50623322 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.vel[0], " + "expected -1726.50623322, is %s", + last_msg.msg.ephemeris_sbas_dep_b.vel[0]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_b.vel[1] * 100 - + -2542.61493683 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.vel[1], " + "expected -2542.61493683, is %s", + last_msg.msg.ephemeris_sbas_dep_b.vel[1]); + ck_assert_msg( + (last_msg.msg.ephemeris_sbas_dep_b.vel[2] * 100 - 869.817733765 * 100) < + 0.05, + "incorrect value for last_msg.msg.ephemeris_sbas_dep_b.vel[2], " + "expected 869.817733765, is %s", + last_msg.msg.ephemeris_sbas_dep_b.vel[2]); } } END_TEST -Suite* auto_check_sbp_observation_MsgEphemerisSbasDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgEphemerisSbasDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgEphemerisSbasDepB"); +Suite *auto_check_sbp_observation_MsgEphemerisSbasDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_observation_MsgEphemerisSbasDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgEphemerisSbasDepB"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgEphemerisSbasDepB); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgGloBiases.c b/c/test/auto_check_sbp_observation_MsgGloBiases.c index 140c47298..6570be813 100644 --- a/c/test/auto_check_sbp_observation_MsgGloBiases.c +++ b/c/test/auto_check_sbp_observation_MsgGloBiases.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGloBiases.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGloBiases.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgGloBiases ) -{ +START_TEST(test_auto_check_sbp_observation_MsgGloBiases) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgGloBiases ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,63 +90,84 @@ START_TEST( test_auto_check_sbp_observation_MsgGloBiases ) logging_reset(); - sbp_callback_register(&sbp_state, 0x75, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x75, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,117,0,0,0,9,0,0,0,0,0,0,0,0,0,77,211, }; + u8 encoded_frame[] = { + 85, 117, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 211, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.glo_biases.l1ca_bias = 0; - + test_msg.glo_biases.l1p_bias = 0; - + test_msg.glo_biases.l2ca_bias = 0; - + test_msg.glo_biases.l2p_bias = 0; - + test_msg.glo_biases.mask = 0; sbp_message_send(&sbp_state, SbpMsgGloBiases, 0, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGloBiases, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGloBiases, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.glo_biases.l1ca_bias == 0, "incorrect value for last_msg.msg.glo_biases.l1ca_bias, expected 0, is %d", last_msg.msg.glo_biases.l1ca_bias); - - ck_assert_msg(last_msg.msg.glo_biases.l1p_bias == 0, "incorrect value for last_msg.msg.glo_biases.l1p_bias, expected 0, is %d", last_msg.msg.glo_biases.l1p_bias); - - ck_assert_msg(last_msg.msg.glo_biases.l2ca_bias == 0, "incorrect value for last_msg.msg.glo_biases.l2ca_bias, expected 0, is %d", last_msg.msg.glo_biases.l2ca_bias); - - ck_assert_msg(last_msg.msg.glo_biases.l2p_bias == 0, "incorrect value for last_msg.msg.glo_biases.l2p_bias, expected 0, is %d", last_msg.msg.glo_biases.l2p_bias); - - ck_assert_msg(last_msg.msg.glo_biases.mask == 0, "incorrect value for last_msg.msg.glo_biases.mask, expected 0, is %d", last_msg.msg.glo_biases.mask); + ck_assert_msg(last_msg.msg.glo_biases.l1ca_bias == 0, + "incorrect value for last_msg.msg.glo_biases.l1ca_bias, " + "expected 0, is %d", + last_msg.msg.glo_biases.l1ca_bias); + + ck_assert_msg(last_msg.msg.glo_biases.l1p_bias == 0, + "incorrect value for last_msg.msg.glo_biases.l1p_bias, " + "expected 0, is %d", + last_msg.msg.glo_biases.l1p_bias); + + ck_assert_msg(last_msg.msg.glo_biases.l2ca_bias == 0, + "incorrect value for last_msg.msg.glo_biases.l2ca_bias, " + "expected 0, is %d", + last_msg.msg.glo_biases.l2ca_bias); + + ck_assert_msg(last_msg.msg.glo_biases.l2p_bias == 0, + "incorrect value for last_msg.msg.glo_biases.l2p_bias, " + "expected 0, is %d", + last_msg.msg.glo_biases.l2p_bias); + + ck_assert_msg( + last_msg.msg.glo_biases.mask == 0, + "incorrect value for last_msg.msg.glo_biases.mask, expected 0, is %d", + last_msg.msg.glo_biases.mask); } } END_TEST -Suite* auto_check_sbp_observation_MsgGloBiases_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgGloBiases"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgGloBiases"); +Suite *auto_check_sbp_observation_MsgGloBiases_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgGloBiases"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_observation_MsgGloBiases"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgGloBiases); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgGnssCapb.c b/c/test/auto_check_sbp_observation_MsgGnssCapb.c index d5f05e824..a2c6ffb1a 100644 --- a/c/test/auto_check_sbp_observation_MsgGnssCapb.c +++ b/c/test/auto_check_sbp_observation_MsgGnssCapb.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGnssCapb.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGnssCapb.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgGnssCapb ) -{ +START_TEST(test_auto_check_sbp_observation_MsgGnssCapb) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgGnssCapb ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,115 +90,175 @@ START_TEST( test_auto_check_sbp_observation_MsgGnssCapb ) logging_reset(); - sbp_callback_register(&sbp_state, 0x96, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x96, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,150,0,123,0,110,176,207,6,0,106,8,26,171,80,64,0,0,0,0,81,173,144,46,0,0,0,0,209,139,93,108,0,0,0,0,252,204,200,0,205,92,30,49,240,203,21,24,212,93,182,32,0,0,0,0,105,32,192,27,0,0,0,0,40,75,250,114,0,0,0,0,119,147,123,81,0,0,0,0,85,89,4,2,0,0,0,0,233,116,137,22,0,0,0,0,199,109,219,11,221,171,248,82,0,0,0,0,252,62,221,28,0,0,0,0,163,90, }; + u8 encoded_frame[] = { + 85, 150, 0, 123, 0, 110, 176, 207, 6, 0, 106, 8, 26, 171, 80, + 64, 0, 0, 0, 0, 81, 173, 144, 46, 0, 0, 0, 0, 209, 139, + 93, 108, 0, 0, 0, 0, 252, 204, 200, 0, 205, 92, 30, 49, 240, + 203, 21, 24, 212, 93, 182, 32, 0, 0, 0, 0, 105, 32, 192, 27, + 0, 0, 0, 0, 40, 75, 250, 114, 0, 0, 0, 0, 119, 147, 123, + 81, 0, 0, 0, 0, 85, 89, 4, 2, 0, 0, 0, 0, 233, 116, + 137, 22, 0, 0, 0, 0, 199, 109, 219, 11, 221, 171, 248, 82, 0, + 0, 0, 0, 252, 62, 221, 28, 0, 0, 0, 0, 163, 90, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.gnss_capb.gc.bds_active = 1929005864; - + test_msg.gnss_capb.gc.bds_b2 = 33839445; - + test_msg.gnss_capb.gc.bds_b2a = 378107113; - + test_msg.gnss_capb.gc.bds_d2nav = 1367053175; - + test_msg.gnss_capb.gc.gal_active = 1392028637; - + test_msg.gnss_capb.gc.gal_e5 = 484261628; - + test_msg.gnss_capb.gc.glo_active = 13159676; - + test_msg.gnss_capb.gc.glo_l2of = 824073421; - + test_msg.gnss_capb.gc.glo_l3 = 404081648; - + test_msg.gnss_capb.gc.gps_active = 1079028506; - + test_msg.gnss_capb.gc.gps_l2c = 781233489; - + test_msg.gnss_capb.gc.gps_l5 = 1818069969; - + test_msg.gnss_capb.gc.qzss_active = 198929863; - + test_msg.gnss_capb.gc.sbas_active = 548822484; - + test_msg.gnss_capb.gc.sbas_l5 = 465576041; - - + test_msg.gnss_capb.t_nmct.tow = 446384; - + test_msg.gnss_capb.t_nmct.wn = 2154; sbp_message_send(&sbp_state, SbpMsgGnssCapb, 123, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGnssCapb, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGnssCapb, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.gnss_capb.gc.bds_active == 1929005864, "incorrect value for last_msg.msg.gnss_capb.gc.bds_active, expected 1929005864, is %d", last_msg.msg.gnss_capb.gc.bds_active); - - ck_assert_msg(last_msg.msg.gnss_capb.gc.bds_b2 == 33839445, "incorrect value for last_msg.msg.gnss_capb.gc.bds_b2, expected 33839445, is %d", last_msg.msg.gnss_capb.gc.bds_b2); - - ck_assert_msg(last_msg.msg.gnss_capb.gc.bds_b2a == 378107113, "incorrect value for last_msg.msg.gnss_capb.gc.bds_b2a, expected 378107113, is %d", last_msg.msg.gnss_capb.gc.bds_b2a); - - ck_assert_msg(last_msg.msg.gnss_capb.gc.bds_d2nav == 1367053175, "incorrect value for last_msg.msg.gnss_capb.gc.bds_d2nav, expected 1367053175, is %d", last_msg.msg.gnss_capb.gc.bds_d2nav); - - ck_assert_msg(last_msg.msg.gnss_capb.gc.gal_active == 1392028637, "incorrect value for last_msg.msg.gnss_capb.gc.gal_active, expected 1392028637, is %d", last_msg.msg.gnss_capb.gc.gal_active); - - ck_assert_msg(last_msg.msg.gnss_capb.gc.gal_e5 == 484261628, "incorrect value for last_msg.msg.gnss_capb.gc.gal_e5, expected 484261628, is %d", last_msg.msg.gnss_capb.gc.gal_e5); - - ck_assert_msg(last_msg.msg.gnss_capb.gc.glo_active == 13159676, "incorrect value for last_msg.msg.gnss_capb.gc.glo_active, expected 13159676, is %d", last_msg.msg.gnss_capb.gc.glo_active); - - ck_assert_msg(last_msg.msg.gnss_capb.gc.glo_l2of == 824073421, "incorrect value for last_msg.msg.gnss_capb.gc.glo_l2of, expected 824073421, is %d", last_msg.msg.gnss_capb.gc.glo_l2of); - - ck_assert_msg(last_msg.msg.gnss_capb.gc.glo_l3 == 404081648, "incorrect value for last_msg.msg.gnss_capb.gc.glo_l3, expected 404081648, is %d", last_msg.msg.gnss_capb.gc.glo_l3); - - ck_assert_msg(last_msg.msg.gnss_capb.gc.gps_active == 1079028506, "incorrect value for last_msg.msg.gnss_capb.gc.gps_active, expected 1079028506, is %d", last_msg.msg.gnss_capb.gc.gps_active); - - ck_assert_msg(last_msg.msg.gnss_capb.gc.gps_l2c == 781233489, "incorrect value for last_msg.msg.gnss_capb.gc.gps_l2c, expected 781233489, is %d", last_msg.msg.gnss_capb.gc.gps_l2c); - - ck_assert_msg(last_msg.msg.gnss_capb.gc.gps_l5 == 1818069969, "incorrect value for last_msg.msg.gnss_capb.gc.gps_l5, expected 1818069969, is %d", last_msg.msg.gnss_capb.gc.gps_l5); - - ck_assert_msg(last_msg.msg.gnss_capb.gc.qzss_active == 198929863, "incorrect value for last_msg.msg.gnss_capb.gc.qzss_active, expected 198929863, is %d", last_msg.msg.gnss_capb.gc.qzss_active); - - ck_assert_msg(last_msg.msg.gnss_capb.gc.sbas_active == 548822484, "incorrect value for last_msg.msg.gnss_capb.gc.sbas_active, expected 548822484, is %d", last_msg.msg.gnss_capb.gc.sbas_active); - - ck_assert_msg(last_msg.msg.gnss_capb.gc.sbas_l5 == 465576041, "incorrect value for last_msg.msg.gnss_capb.gc.sbas_l5, expected 465576041, is %d", last_msg.msg.gnss_capb.gc.sbas_l5); - - - ck_assert_msg(last_msg.msg.gnss_capb.t_nmct.tow == 446384, "incorrect value for last_msg.msg.gnss_capb.t_nmct.tow, expected 446384, is %d", last_msg.msg.gnss_capb.t_nmct.tow); - - ck_assert_msg(last_msg.msg.gnss_capb.t_nmct.wn == 2154, "incorrect value for last_msg.msg.gnss_capb.t_nmct.wn, expected 2154, is %d", last_msg.msg.gnss_capb.t_nmct.wn); + ck_assert_msg(last_msg.msg.gnss_capb.gc.bds_active == 1929005864, + "incorrect value for last_msg.msg.gnss_capb.gc.bds_active, " + "expected 1929005864, is %d", + last_msg.msg.gnss_capb.gc.bds_active); + + ck_assert_msg(last_msg.msg.gnss_capb.gc.bds_b2 == 33839445, + "incorrect value for last_msg.msg.gnss_capb.gc.bds_b2, " + "expected 33839445, is %d", + last_msg.msg.gnss_capb.gc.bds_b2); + + ck_assert_msg(last_msg.msg.gnss_capb.gc.bds_b2a == 378107113, + "incorrect value for last_msg.msg.gnss_capb.gc.bds_b2a, " + "expected 378107113, is %d", + last_msg.msg.gnss_capb.gc.bds_b2a); + + ck_assert_msg(last_msg.msg.gnss_capb.gc.bds_d2nav == 1367053175, + "incorrect value for last_msg.msg.gnss_capb.gc.bds_d2nav, " + "expected 1367053175, is %d", + last_msg.msg.gnss_capb.gc.bds_d2nav); + + ck_assert_msg(last_msg.msg.gnss_capb.gc.gal_active == 1392028637, + "incorrect value for last_msg.msg.gnss_capb.gc.gal_active, " + "expected 1392028637, is %d", + last_msg.msg.gnss_capb.gc.gal_active); + + ck_assert_msg(last_msg.msg.gnss_capb.gc.gal_e5 == 484261628, + "incorrect value for last_msg.msg.gnss_capb.gc.gal_e5, " + "expected 484261628, is %d", + last_msg.msg.gnss_capb.gc.gal_e5); + + ck_assert_msg(last_msg.msg.gnss_capb.gc.glo_active == 13159676, + "incorrect value for last_msg.msg.gnss_capb.gc.glo_active, " + "expected 13159676, is %d", + last_msg.msg.gnss_capb.gc.glo_active); + + ck_assert_msg(last_msg.msg.gnss_capb.gc.glo_l2of == 824073421, + "incorrect value for last_msg.msg.gnss_capb.gc.glo_l2of, " + "expected 824073421, is %d", + last_msg.msg.gnss_capb.gc.glo_l2of); + + ck_assert_msg(last_msg.msg.gnss_capb.gc.glo_l3 == 404081648, + "incorrect value for last_msg.msg.gnss_capb.gc.glo_l3, " + "expected 404081648, is %d", + last_msg.msg.gnss_capb.gc.glo_l3); + + ck_assert_msg(last_msg.msg.gnss_capb.gc.gps_active == 1079028506, + "incorrect value for last_msg.msg.gnss_capb.gc.gps_active, " + "expected 1079028506, is %d", + last_msg.msg.gnss_capb.gc.gps_active); + + ck_assert_msg(last_msg.msg.gnss_capb.gc.gps_l2c == 781233489, + "incorrect value for last_msg.msg.gnss_capb.gc.gps_l2c, " + "expected 781233489, is %d", + last_msg.msg.gnss_capb.gc.gps_l2c); + + ck_assert_msg(last_msg.msg.gnss_capb.gc.gps_l5 == 1818069969, + "incorrect value for last_msg.msg.gnss_capb.gc.gps_l5, " + "expected 1818069969, is %d", + last_msg.msg.gnss_capb.gc.gps_l5); + + ck_assert_msg(last_msg.msg.gnss_capb.gc.qzss_active == 198929863, + "incorrect value for last_msg.msg.gnss_capb.gc.qzss_active, " + "expected 198929863, is %d", + last_msg.msg.gnss_capb.gc.qzss_active); + + ck_assert_msg(last_msg.msg.gnss_capb.gc.sbas_active == 548822484, + "incorrect value for last_msg.msg.gnss_capb.gc.sbas_active, " + "expected 548822484, is %d", + last_msg.msg.gnss_capb.gc.sbas_active); + + ck_assert_msg(last_msg.msg.gnss_capb.gc.sbas_l5 == 465576041, + "incorrect value for last_msg.msg.gnss_capb.gc.sbas_l5, " + "expected 465576041, is %d", + last_msg.msg.gnss_capb.gc.sbas_l5); + + ck_assert_msg(last_msg.msg.gnss_capb.t_nmct.tow == 446384, + "incorrect value for last_msg.msg.gnss_capb.t_nmct.tow, " + "expected 446384, is %d", + last_msg.msg.gnss_capb.t_nmct.tow); + + ck_assert_msg(last_msg.msg.gnss_capb.t_nmct.wn == 2154, + "incorrect value for last_msg.msg.gnss_capb.t_nmct.wn, " + "expected 2154, is %d", + last_msg.msg.gnss_capb.t_nmct.wn); } } END_TEST -Suite* auto_check_sbp_observation_MsgGnssCapb_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgGnssCapb"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgGnssCapb"); +Suite *auto_check_sbp_observation_MsgGnssCapb_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgGnssCapb"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_observation_MsgGnssCapb"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgGnssCapb); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgGroupDelay.c b/c/test/auto_check_sbp_observation_MsgGroupDelay.c index 9dba44bd2..a441b6574 100644 --- a/c/test/auto_check_sbp_observation_MsgGroupDelay.c +++ b/c/test/auto_check_sbp_observation_MsgGroupDelay.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelay.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelay.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgGroupDelay ) -{ +START_TEST(test_auto_check_sbp_observation_MsgGroupDelay) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgGroupDelay ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,79 +90,107 @@ START_TEST( test_auto_check_sbp_observation_MsgGroupDelay ) logging_reset(); - sbp_callback_register(&sbp_state, 0x94, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x94, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,148,0,123,0,15,176,207,6,0,106,8,22,0,1,254,253,165,255,237,23,2,201, }; + u8 encoded_frame[] = { + 85, 148, 0, 123, 0, 15, 176, 207, 6, 0, 106, 8, + 22, 0, 1, 254, 253, 165, 255, 237, 23, 2, 201, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.group_delay.isc_l1ca = -91; - + test_msg.group_delay.isc_l2c = 6125; - - + test_msg.group_delay.sid.code = 0; - + test_msg.group_delay.sid.sat = 22; - - + test_msg.group_delay.t_op.tow = 446384; - + test_msg.group_delay.t_op.wn = 2154; - + test_msg.group_delay.tgd = -514; - + test_msg.group_delay.valid = 1; - sbp_message_send(&sbp_state, SbpMsgGroupDelay, 123, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGroupDelay, 123, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGroupDelay, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGroupDelay, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.group_delay.isc_l1ca == -91, "incorrect value for last_msg.msg.group_delay.isc_l1ca, expected -91, is %d", last_msg.msg.group_delay.isc_l1ca); - - ck_assert_msg(last_msg.msg.group_delay.isc_l2c == 6125, "incorrect value for last_msg.msg.group_delay.isc_l2c, expected 6125, is %d", last_msg.msg.group_delay.isc_l2c); - - - ck_assert_msg(last_msg.msg.group_delay.sid.code == 0, "incorrect value for last_msg.msg.group_delay.sid.code, expected 0, is %d", last_msg.msg.group_delay.sid.code); - - ck_assert_msg(last_msg.msg.group_delay.sid.sat == 22, "incorrect value for last_msg.msg.group_delay.sid.sat, expected 22, is %d", last_msg.msg.group_delay.sid.sat); - - - ck_assert_msg(last_msg.msg.group_delay.t_op.tow == 446384, "incorrect value for last_msg.msg.group_delay.t_op.tow, expected 446384, is %d", last_msg.msg.group_delay.t_op.tow); - - ck_assert_msg(last_msg.msg.group_delay.t_op.wn == 2154, "incorrect value for last_msg.msg.group_delay.t_op.wn, expected 2154, is %d", last_msg.msg.group_delay.t_op.wn); - - ck_assert_msg(last_msg.msg.group_delay.tgd == -514, "incorrect value for last_msg.msg.group_delay.tgd, expected -514, is %d", last_msg.msg.group_delay.tgd); - - ck_assert_msg(last_msg.msg.group_delay.valid == 1, "incorrect value for last_msg.msg.group_delay.valid, expected 1, is %d", last_msg.msg.group_delay.valid); + ck_assert_msg(last_msg.msg.group_delay.isc_l1ca == -91, + "incorrect value for last_msg.msg.group_delay.isc_l1ca, " + "expected -91, is %d", + last_msg.msg.group_delay.isc_l1ca); + + ck_assert_msg(last_msg.msg.group_delay.isc_l2c == 6125, + "incorrect value for last_msg.msg.group_delay.isc_l2c, " + "expected 6125, is %d", + last_msg.msg.group_delay.isc_l2c); + + ck_assert_msg(last_msg.msg.group_delay.sid.code == 0, + "incorrect value for last_msg.msg.group_delay.sid.code, " + "expected 0, is %d", + last_msg.msg.group_delay.sid.code); + + ck_assert_msg(last_msg.msg.group_delay.sid.sat == 22, + "incorrect value for last_msg.msg.group_delay.sid.sat, " + "expected 22, is %d", + last_msg.msg.group_delay.sid.sat); + + ck_assert_msg(last_msg.msg.group_delay.t_op.tow == 446384, + "incorrect value for last_msg.msg.group_delay.t_op.tow, " + "expected 446384, is %d", + last_msg.msg.group_delay.t_op.tow); + + ck_assert_msg(last_msg.msg.group_delay.t_op.wn == 2154, + "incorrect value for last_msg.msg.group_delay.t_op.wn, " + "expected 2154, is %d", + last_msg.msg.group_delay.t_op.wn); + + ck_assert_msg(last_msg.msg.group_delay.tgd == -514, + "incorrect value for last_msg.msg.group_delay.tgd, expected " + "-514, is %d", + last_msg.msg.group_delay.tgd); + + ck_assert_msg( + last_msg.msg.group_delay.valid == 1, + "incorrect value for last_msg.msg.group_delay.valid, expected 1, is %d", + last_msg.msg.group_delay.valid); } } END_TEST -Suite* auto_check_sbp_observation_MsgGroupDelay_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgGroupDelay"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgGroupDelay"); +Suite *auto_check_sbp_observation_MsgGroupDelay_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgGroupDelay"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_observation_MsgGroupDelay"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgGroupDelay); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgGroupDelayDepA.c b/c/test/auto_check_sbp_observation_MsgGroupDelayDepA.c index d255c1c60..d730a9075 100644 --- a/c/test/auto_check_sbp_observation_MsgGroupDelayDepA.c +++ b/c/test/auto_check_sbp_observation_MsgGroupDelayDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgGroupDelayDepA ) -{ +START_TEST(test_auto_check_sbp_observation_MsgGroupDelayDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgGroupDelayDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,73 +90,102 @@ START_TEST( test_auto_check_sbp_observation_MsgGroupDelayDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x92, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x92, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,146,0,123,0,14,176,207,6,0,106,8,22,1,254,253,165,255,237,23,162,91, }; + u8 encoded_frame[] = { + 85, 146, 0, 123, 0, 14, 176, 207, 6, 0, 106, + 8, 22, 1, 254, 253, 165, 255, 237, 23, 162, 91, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.group_delay_dep_a.isc_l1ca = -91; - + test_msg.group_delay_dep_a.isc_l2c = 6125; - + test_msg.group_delay_dep_a.prn = 22; - - + test_msg.group_delay_dep_a.t_op.tow = 446384; - + test_msg.group_delay_dep_a.t_op.wn = 2154; - + test_msg.group_delay_dep_a.tgd = -514; - + test_msg.group_delay_dep_a.valid = 1; - sbp_message_send(&sbp_state, SbpMsgGroupDelayDepA, 123, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGroupDelayDepA, 123, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGroupDelayDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGroupDelayDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.group_delay_dep_a.isc_l1ca == -91, "incorrect value for last_msg.msg.group_delay_dep_a.isc_l1ca, expected -91, is %d", last_msg.msg.group_delay_dep_a.isc_l1ca); - - ck_assert_msg(last_msg.msg.group_delay_dep_a.isc_l2c == 6125, "incorrect value for last_msg.msg.group_delay_dep_a.isc_l2c, expected 6125, is %d", last_msg.msg.group_delay_dep_a.isc_l2c); - - ck_assert_msg(last_msg.msg.group_delay_dep_a.prn == 22, "incorrect value for last_msg.msg.group_delay_dep_a.prn, expected 22, is %d", last_msg.msg.group_delay_dep_a.prn); - - - ck_assert_msg(last_msg.msg.group_delay_dep_a.t_op.tow == 446384, "incorrect value for last_msg.msg.group_delay_dep_a.t_op.tow, expected 446384, is %d", last_msg.msg.group_delay_dep_a.t_op.tow); - - ck_assert_msg(last_msg.msg.group_delay_dep_a.t_op.wn == 2154, "incorrect value for last_msg.msg.group_delay_dep_a.t_op.wn, expected 2154, is %d", last_msg.msg.group_delay_dep_a.t_op.wn); - - ck_assert_msg(last_msg.msg.group_delay_dep_a.tgd == -514, "incorrect value for last_msg.msg.group_delay_dep_a.tgd, expected -514, is %d", last_msg.msg.group_delay_dep_a.tgd); - - ck_assert_msg(last_msg.msg.group_delay_dep_a.valid == 1, "incorrect value for last_msg.msg.group_delay_dep_a.valid, expected 1, is %d", last_msg.msg.group_delay_dep_a.valid); + ck_assert_msg( + last_msg.msg.group_delay_dep_a.isc_l1ca == -91, + "incorrect value for last_msg.msg.group_delay_dep_a.isc_l1ca, expected " + "-91, is %d", + last_msg.msg.group_delay_dep_a.isc_l1ca); + + ck_assert_msg(last_msg.msg.group_delay_dep_a.isc_l2c == 6125, + "incorrect value for last_msg.msg.group_delay_dep_a.isc_l2c, " + "expected 6125, is %d", + last_msg.msg.group_delay_dep_a.isc_l2c); + + ck_assert_msg(last_msg.msg.group_delay_dep_a.prn == 22, + "incorrect value for last_msg.msg.group_delay_dep_a.prn, " + "expected 22, is %d", + last_msg.msg.group_delay_dep_a.prn); + + ck_assert_msg( + last_msg.msg.group_delay_dep_a.t_op.tow == 446384, + "incorrect value for last_msg.msg.group_delay_dep_a.t_op.tow, expected " + "446384, is %d", + last_msg.msg.group_delay_dep_a.t_op.tow); + + ck_assert_msg(last_msg.msg.group_delay_dep_a.t_op.wn == 2154, + "incorrect value for last_msg.msg.group_delay_dep_a.t_op.wn, " + "expected 2154, is %d", + last_msg.msg.group_delay_dep_a.t_op.wn); + + ck_assert_msg(last_msg.msg.group_delay_dep_a.tgd == -514, + "incorrect value for last_msg.msg.group_delay_dep_a.tgd, " + "expected -514, is %d", + last_msg.msg.group_delay_dep_a.tgd); + + ck_assert_msg(last_msg.msg.group_delay_dep_a.valid == 1, + "incorrect value for last_msg.msg.group_delay_dep_a.valid, " + "expected 1, is %d", + last_msg.msg.group_delay_dep_a.valid); } } END_TEST -Suite* auto_check_sbp_observation_MsgGroupDelayDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgGroupDelayDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgGroupDelayDepA"); +Suite *auto_check_sbp_observation_MsgGroupDelayDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgGroupDelayDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgGroupDelayDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgGroupDelayDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgGroupDelayDepB.c b/c/test/auto_check_sbp_observation_MsgGroupDelayDepB.c index 1556557bd..7e362926c 100644 --- a/c/test/auto_check_sbp_observation_MsgGroupDelayDepB.c +++ b/c/test/auto_check_sbp_observation_MsgGroupDelayDepB.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepB.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgGroupDelayDepB ) -{ +START_TEST(test_auto_check_sbp_observation_MsgGroupDelayDepB) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgGroupDelayDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,83 +90,117 @@ START_TEST( test_auto_check_sbp_observation_MsgGroupDelayDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x93, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x93, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,147,0,123,0,17,176,207,6,0,106,8,22,0,0,0,1,254,253,165,255,237,23,221,202, }; + u8 encoded_frame[] = { + 85, 147, 0, 123, 0, 17, 176, 207, 6, 0, 106, 8, 22, + 0, 0, 0, 1, 254, 253, 165, 255, 237, 23, 221, 202, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.group_delay_dep_b.isc_l1ca = -91; - + test_msg.group_delay_dep_b.isc_l2c = 6125; - - + test_msg.group_delay_dep_b.sid.code = 0; - + test_msg.group_delay_dep_b.sid.reserved = 0; - + test_msg.group_delay_dep_b.sid.sat = 22; - - + test_msg.group_delay_dep_b.t_op.tow = 446384; - + test_msg.group_delay_dep_b.t_op.wn = 2154; - + test_msg.group_delay_dep_b.tgd = -514; - + test_msg.group_delay_dep_b.valid = 1; - sbp_message_send(&sbp_state, SbpMsgGroupDelayDepB, 123, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGroupDelayDepB, 123, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGroupDelayDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGroupDelayDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.group_delay_dep_b.isc_l1ca == -91, "incorrect value for last_msg.msg.group_delay_dep_b.isc_l1ca, expected -91, is %d", last_msg.msg.group_delay_dep_b.isc_l1ca); - - ck_assert_msg(last_msg.msg.group_delay_dep_b.isc_l2c == 6125, "incorrect value for last_msg.msg.group_delay_dep_b.isc_l2c, expected 6125, is %d", last_msg.msg.group_delay_dep_b.isc_l2c); - - - ck_assert_msg(last_msg.msg.group_delay_dep_b.sid.code == 0, "incorrect value for last_msg.msg.group_delay_dep_b.sid.code, expected 0, is %d", last_msg.msg.group_delay_dep_b.sid.code); - - ck_assert_msg(last_msg.msg.group_delay_dep_b.sid.reserved == 0, "incorrect value for last_msg.msg.group_delay_dep_b.sid.reserved, expected 0, is %d", last_msg.msg.group_delay_dep_b.sid.reserved); - - ck_assert_msg(last_msg.msg.group_delay_dep_b.sid.sat == 22, "incorrect value for last_msg.msg.group_delay_dep_b.sid.sat, expected 22, is %d", last_msg.msg.group_delay_dep_b.sid.sat); - - - ck_assert_msg(last_msg.msg.group_delay_dep_b.t_op.tow == 446384, "incorrect value for last_msg.msg.group_delay_dep_b.t_op.tow, expected 446384, is %d", last_msg.msg.group_delay_dep_b.t_op.tow); - - ck_assert_msg(last_msg.msg.group_delay_dep_b.t_op.wn == 2154, "incorrect value for last_msg.msg.group_delay_dep_b.t_op.wn, expected 2154, is %d", last_msg.msg.group_delay_dep_b.t_op.wn); - - ck_assert_msg(last_msg.msg.group_delay_dep_b.tgd == -514, "incorrect value for last_msg.msg.group_delay_dep_b.tgd, expected -514, is %d", last_msg.msg.group_delay_dep_b.tgd); - - ck_assert_msg(last_msg.msg.group_delay_dep_b.valid == 1, "incorrect value for last_msg.msg.group_delay_dep_b.valid, expected 1, is %d", last_msg.msg.group_delay_dep_b.valid); + ck_assert_msg( + last_msg.msg.group_delay_dep_b.isc_l1ca == -91, + "incorrect value for last_msg.msg.group_delay_dep_b.isc_l1ca, expected " + "-91, is %d", + last_msg.msg.group_delay_dep_b.isc_l1ca); + + ck_assert_msg(last_msg.msg.group_delay_dep_b.isc_l2c == 6125, + "incorrect value for last_msg.msg.group_delay_dep_b.isc_l2c, " + "expected 6125, is %d", + last_msg.msg.group_delay_dep_b.isc_l2c); + + ck_assert_msg(last_msg.msg.group_delay_dep_b.sid.code == 0, + "incorrect value for " + "last_msg.msg.group_delay_dep_b.sid.code, expected 0, is %d", + last_msg.msg.group_delay_dep_b.sid.code); + + ck_assert_msg( + last_msg.msg.group_delay_dep_b.sid.reserved == 0, + "incorrect value for last_msg.msg.group_delay_dep_b.sid.reserved, " + "expected 0, is %d", + last_msg.msg.group_delay_dep_b.sid.reserved); + + ck_assert_msg(last_msg.msg.group_delay_dep_b.sid.sat == 22, + "incorrect value for last_msg.msg.group_delay_dep_b.sid.sat, " + "expected 22, is %d", + last_msg.msg.group_delay_dep_b.sid.sat); + + ck_assert_msg( + last_msg.msg.group_delay_dep_b.t_op.tow == 446384, + "incorrect value for last_msg.msg.group_delay_dep_b.t_op.tow, expected " + "446384, is %d", + last_msg.msg.group_delay_dep_b.t_op.tow); + + ck_assert_msg(last_msg.msg.group_delay_dep_b.t_op.wn == 2154, + "incorrect value for last_msg.msg.group_delay_dep_b.t_op.wn, " + "expected 2154, is %d", + last_msg.msg.group_delay_dep_b.t_op.wn); + + ck_assert_msg(last_msg.msg.group_delay_dep_b.tgd == -514, + "incorrect value for last_msg.msg.group_delay_dep_b.tgd, " + "expected -514, is %d", + last_msg.msg.group_delay_dep_b.tgd); + + ck_assert_msg(last_msg.msg.group_delay_dep_b.valid == 1, + "incorrect value for last_msg.msg.group_delay_dep_b.valid, " + "expected 1, is %d", + last_msg.msg.group_delay_dep_b.valid); } } END_TEST -Suite* auto_check_sbp_observation_MsgGroupDelayDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgGroupDelayDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgGroupDelayDepB"); +Suite *auto_check_sbp_observation_MsgGroupDelayDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgGroupDelayDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgGroupDelayDepB"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgGroupDelayDepB); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgIono.c b/c/test/auto_check_sbp_observation_MsgIono.c index f919f91b9..ce271a0f9 100644 --- a/c/test/auto_check_sbp_observation_MsgIono.c +++ b/c/test/auto_check_sbp_observation_MsgIono.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgIono.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgIono.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgIono ) -{ +START_TEST(test_auto_check_sbp_observation_MsgIono) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgIono ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,85 +90,124 @@ START_TEST( test_auto_check_sbp_observation_MsgIono ) logging_reset(); - sbp_callback_register(&sbp_state, 0x90, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x90, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,144,0,123,0,70,0,0,0,0,0,0,0,0,0,0,0,0,52,62,0,0,0,0,0,0,80,62,0,0,0,0,0,0,112,190,0,0,0,0,0,0,112,190,0,0,0,0,0,0,243,64,0,0,0,0,0,0,232,64,0,0,0,0,0,0,240,192,0,0,0,0,0,0,20,193,101,31, }; + u8 encoded_frame[] = { + 85, 144, 0, 123, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 62, 0, 0, 0, 0, 0, 0, 80, 62, 0, 0, 0, 0, + 0, 0, 112, 190, 0, 0, 0, 0, 0, 0, 112, 190, 0, 0, 0, 0, + 0, 0, 243, 64, 0, 0, 0, 0, 0, 0, 232, 64, 0, 0, 0, 0, + 0, 0, 240, 192, 0, 0, 0, 0, 0, 0, 20, 193, 101, 31, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.iono.a0 = 4.6566128730773926e-09; - + test_msg.iono.a1 = 1.4901161193847656e-08; - + test_msg.iono.a2 = -5.960464477539063e-08; - + test_msg.iono.a3 = -5.960464477539063e-08; - + test_msg.iono.b0 = 77824.0; - + test_msg.iono.b1 = 49152.0; - + test_msg.iono.b2 = -65536.0; - + test_msg.iono.b3 = -327680.0; - - + test_msg.iono.t_nmct.tow = 0; - + test_msg.iono.t_nmct.wn = 0; sbp_message_send(&sbp_state, SbpMsgIono, 123, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgIono, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.iono.a0 * 100 - 4.65661287308e-09 * 100) < 0.05, "incorrect value for last_msg.msg.iono.a0, expected 4.65661287308e-09, is %s", last_msg.msg.iono.a0); - - ck_assert_msg((last_msg.msg.iono.a1 * 100 - 1.49011611938e-08 * 100) < 0.05, "incorrect value for last_msg.msg.iono.a1, expected 1.49011611938e-08, is %s", last_msg.msg.iono.a1); - - ck_assert_msg((last_msg.msg.iono.a2 * 100 - -5.96046447754e-08 * 100) < 0.05, "incorrect value for last_msg.msg.iono.a2, expected -5.96046447754e-08, is %s", last_msg.msg.iono.a2); - - ck_assert_msg((last_msg.msg.iono.a3 * 100 - -5.96046447754e-08 * 100) < 0.05, "incorrect value for last_msg.msg.iono.a3, expected -5.96046447754e-08, is %s", last_msg.msg.iono.a3); - - ck_assert_msg((last_msg.msg.iono.b0 * 100 - 77824.0 * 100) < 0.05, "incorrect value for last_msg.msg.iono.b0, expected 77824.0, is %s", last_msg.msg.iono.b0); - - ck_assert_msg((last_msg.msg.iono.b1 * 100 - 49152.0 * 100) < 0.05, "incorrect value for last_msg.msg.iono.b1, expected 49152.0, is %s", last_msg.msg.iono.b1); - - ck_assert_msg((last_msg.msg.iono.b2 * 100 - -65536.0 * 100) < 0.05, "incorrect value for last_msg.msg.iono.b2, expected -65536.0, is %s", last_msg.msg.iono.b2); - - ck_assert_msg((last_msg.msg.iono.b3 * 100 - -327680.0 * 100) < 0.05, "incorrect value for last_msg.msg.iono.b3, expected -327680.0, is %s", last_msg.msg.iono.b3); - - - ck_assert_msg(last_msg.msg.iono.t_nmct.tow == 0, "incorrect value for last_msg.msg.iono.t_nmct.tow, expected 0, is %d", last_msg.msg.iono.t_nmct.tow); - - ck_assert_msg(last_msg.msg.iono.t_nmct.wn == 0, "incorrect value for last_msg.msg.iono.t_nmct.wn, expected 0, is %d", last_msg.msg.iono.t_nmct.wn); - + "Sent and received messages did not compare equal"); + + ck_assert_msg((last_msg.msg.iono.a0 * 100 - 4.65661287308e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.iono.a0, expected " + "4.65661287308e-09, is %s", + last_msg.msg.iono.a0); + + ck_assert_msg((last_msg.msg.iono.a1 * 100 - 1.49011611938e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.iono.a1, expected " + "1.49011611938e-08, is %s", + last_msg.msg.iono.a1); + + ck_assert_msg( + (last_msg.msg.iono.a2 * 100 - -5.96046447754e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.iono.a2, expected " + "-5.96046447754e-08, is %s", + last_msg.msg.iono.a2); + + ck_assert_msg( + (last_msg.msg.iono.a3 * 100 - -5.96046447754e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.iono.a3, expected " + "-5.96046447754e-08, is %s", + last_msg.msg.iono.a3); + + ck_assert_msg( + (last_msg.msg.iono.b0 * 100 - 77824.0 * 100) < 0.05, + "incorrect value for last_msg.msg.iono.b0, expected 77824.0, is %s", + last_msg.msg.iono.b0); + + ck_assert_msg( + (last_msg.msg.iono.b1 * 100 - 49152.0 * 100) < 0.05, + "incorrect value for last_msg.msg.iono.b1, expected 49152.0, is %s", + last_msg.msg.iono.b1); + + ck_assert_msg( + (last_msg.msg.iono.b2 * 100 - -65536.0 * 100) < 0.05, + "incorrect value for last_msg.msg.iono.b2, expected -65536.0, is %s", + last_msg.msg.iono.b2); + + ck_assert_msg( + (last_msg.msg.iono.b3 * 100 - -327680.0 * 100) < 0.05, + "incorrect value for last_msg.msg.iono.b3, expected -327680.0, is %s", + last_msg.msg.iono.b3); + + ck_assert_msg( + last_msg.msg.iono.t_nmct.tow == 0, + "incorrect value for last_msg.msg.iono.t_nmct.tow, expected 0, is %d", + last_msg.msg.iono.t_nmct.tow); + + ck_assert_msg( + last_msg.msg.iono.t_nmct.wn == 0, + "incorrect value for last_msg.msg.iono.t_nmct.wn, expected 0, is %d", + last_msg.msg.iono.t_nmct.wn); } } END_TEST -Suite* auto_check_sbp_observation_MsgIono_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgIono"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgIono"); +Suite *auto_check_sbp_observation_MsgIono_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgIono"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_observation_MsgIono"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgIono); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgObs.c b/c/test/auto_check_sbp_observation_MsgObs.c index 495daf1c0..7eebc84e7 100644 --- a/c/test/auto_check_sbp_observation_MsgObs.c +++ b/c/test/auto_check_sbp_observation_MsgObs.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgObs.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgObs.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgObs ) -{ +START_TEST(test_auto_check_sbp_observation_MsgObs) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgObs ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,724 +90,1078 @@ START_TEST( test_auto_check_sbp_observation_MsgObs ) logging_reset(); - sbp_callback_register(&sbp_state, 0x4a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x4a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,74,0,129,240,249,152,202,226,25,0,0,0,0,106,8,32,49,227,254,62,121,242,158,6,146,0,250,172,182,10,15,10,0,30,228,254,62,12,189,40,5,59,83,251,172,178,10,15,10,1,215,205,144,72,106,111,160,7,243,109,243,119,158,10,15,18,0,25,207,144,72,223,96,241,5,12,52,246,27,125,9,11,18,1,34,184,223,74,150,138,222,7,53,13,11,245,114,9,15,22,0,113,80,6,69,162,41,65,7,70,127,246,246,189,9,15,23,0,247,80,6,69,213,35,167,5,221,152,248,231,158,9,11,23,1,8,146,166,64,12,122,203,6,114,51,248,67,93,3,11,27,0,221,172,173,75,217,47,244,7,232,225,11,237,123,5,15,31,0,250,174,173,75,216,163,50,6,40,70,9,62,120,3,11,31,1,135,16,6,66,99,218,11,7,7,138,242,96,176,10,15,2,3,148,130,6,58,217,88,54,6,203,21,252,96,170,10,15,3,3,186,108,197,63,127,54,211,6,80,4,241,219,200,10,15,17,3,167,195,8,57,19,204,22,6,105,51,254,182,152,10,15,18,3,237,248, }; + u8 encoded_frame[] = { + 85, 74, 0, 129, 240, 249, 152, 202, 226, 25, 0, 0, 0, 0, + 106, 8, 32, 49, 227, 254, 62, 121, 242, 158, 6, 146, 0, 250, + 172, 182, 10, 15, 10, 0, 30, 228, 254, 62, 12, 189, 40, 5, + 59, 83, 251, 172, 178, 10, 15, 10, 1, 215, 205, 144, 72, 106, + 111, 160, 7, 243, 109, 243, 119, 158, 10, 15, 18, 0, 25, 207, + 144, 72, 223, 96, 241, 5, 12, 52, 246, 27, 125, 9, 11, 18, + 1, 34, 184, 223, 74, 150, 138, 222, 7, 53, 13, 11, 245, 114, + 9, 15, 22, 0, 113, 80, 6, 69, 162, 41, 65, 7, 70, 127, + 246, 246, 189, 9, 15, 23, 0, 247, 80, 6, 69, 213, 35, 167, + 5, 221, 152, 248, 231, 158, 9, 11, 23, 1, 8, 146, 166, 64, + 12, 122, 203, 6, 114, 51, 248, 67, 93, 3, 11, 27, 0, 221, + 172, 173, 75, 217, 47, 244, 7, 232, 225, 11, 237, 123, 5, 15, + 31, 0, 250, 174, 173, 75, 216, 163, 50, 6, 40, 70, 9, 62, + 120, 3, 11, 31, 1, 135, 16, 6, 66, 99, 218, 11, 7, 7, + 138, 242, 96, 176, 10, 15, 2, 3, 148, 130, 6, 58, 217, 88, + 54, 6, 203, 21, 252, 96, 170, 10, 15, 3, 3, 186, 108, 197, + 63, 127, 54, 211, 6, 80, 4, 241, 219, 200, 10, 15, 17, 3, + 167, 195, 8, 57, 19, 204, 22, 6, 105, 51, 254, 182, 152, 10, + 15, 18, 3, 237, 248, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs.header.n_obs = 32; - - + test_msg.obs.header.t.ns_residual = 0; - + test_msg.obs.header.t.tow = 434293400; - + test_msg.obs.header.t.wn = 2154; - + test_msg.obs.n_obs = 14; - - - - + test_msg.obs.obs[0].D.f = 172; - + test_msg.obs.obs[0].D.i = -1536; - - + test_msg.obs.obs[0].L.f = 146; - + test_msg.obs.obs[0].L.i = 111080057; - + test_msg.obs.obs[0].P = 1056891697; - + test_msg.obs.obs[0].cn0 = 182; - + test_msg.obs.obs[0].flags = 15; - + test_msg.obs.obs[0].lock = 10; - - + test_msg.obs.obs[0].sid.code = 0; - + test_msg.obs.obs[0].sid.sat = 10; - - - + test_msg.obs.obs[1].D.f = 172; - + test_msg.obs.obs[1].D.i = -1197; - - + test_msg.obs.obs[1].L.f = 59; - + test_msg.obs.obs[1].L.i = 86555916; - + test_msg.obs.obs[1].P = 1056891934; - + test_msg.obs.obs[1].cn0 = 178; - + test_msg.obs.obs[1].flags = 15; - + test_msg.obs.obs[1].lock = 10; - - + test_msg.obs.obs[1].sid.code = 1; - + test_msg.obs.obs[1].sid.sat = 10; - - - + test_msg.obs.obs[2].D.f = 119; - + test_msg.obs.obs[2].D.i = -3219; - - + test_msg.obs.obs[2].L.f = 243; - + test_msg.obs.obs[2].L.i = 127954794; - + test_msg.obs.obs[2].P = 1217449431; - + test_msg.obs.obs[2].cn0 = 158; - + test_msg.obs.obs[2].flags = 15; - + test_msg.obs.obs[2].lock = 10; - - + test_msg.obs.obs[2].sid.code = 0; - + test_msg.obs.obs[2].sid.sat = 18; - - - + test_msg.obs.obs[3].D.f = 27; - + test_msg.obs.obs[3].D.i = -2508; - - + test_msg.obs.obs[3].L.f = 12; - + test_msg.obs.obs[3].L.i = 99705055; - + test_msg.obs.obs[3].P = 1217449753; - + test_msg.obs.obs[3].cn0 = 125; - + test_msg.obs.obs[3].flags = 11; - + test_msg.obs.obs[3].lock = 9; - - + test_msg.obs.obs[3].sid.code = 1; - + test_msg.obs.obs[3].sid.sat = 18; - - - + test_msg.obs.obs[4].D.f = 245; - + test_msg.obs.obs[4].D.i = 2829; - - + test_msg.obs.obs[4].L.f = 53; - + test_msg.obs.obs[4].L.i = 132024982; - + test_msg.obs.obs[4].P = 1256175650; - + test_msg.obs.obs[4].cn0 = 114; - + test_msg.obs.obs[4].flags = 15; - + test_msg.obs.obs[4].lock = 9; - - + test_msg.obs.obs[4].sid.code = 0; - + test_msg.obs.obs[4].sid.sat = 22; - - - + test_msg.obs.obs[5].D.f = 246; - + test_msg.obs.obs[5].D.i = -2433; - - + test_msg.obs.obs[5].L.f = 70; - + test_msg.obs.obs[5].L.i = 121711010; - + test_msg.obs.obs[5].P = 1158041713; - + test_msg.obs.obs[5].cn0 = 189; - + test_msg.obs.obs[5].flags = 15; - + test_msg.obs.obs[5].lock = 9; - - + test_msg.obs.obs[5].sid.code = 0; - + test_msg.obs.obs[5].sid.sat = 23; - - - + test_msg.obs.obs[6].D.f = 231; - + test_msg.obs.obs[6].D.i = -1896; - - + test_msg.obs.obs[6].L.f = 221; - + test_msg.obs.obs[6].L.i = 94839765; - + test_msg.obs.obs[6].P = 1158041847; - + test_msg.obs.obs[6].cn0 = 158; - + test_msg.obs.obs[6].flags = 11; - + test_msg.obs.obs[6].lock = 9; - - + test_msg.obs.obs[6].sid.code = 1; - + test_msg.obs.obs[6].sid.sat = 23; - - - + test_msg.obs.obs[7].D.f = 67; - + test_msg.obs.obs[7].D.i = -1997; - - + test_msg.obs.obs[7].L.f = 114; - + test_msg.obs.obs[7].L.i = 113998348; - + test_msg.obs.obs[7].P = 1084658184; - + test_msg.obs.obs[7].cn0 = 93; - + test_msg.obs.obs[7].flags = 11; - + test_msg.obs.obs[7].lock = 3; - - + test_msg.obs.obs[7].sid.code = 0; - + test_msg.obs.obs[7].sid.sat = 27; - - - + test_msg.obs.obs[8].D.f = 237; - + test_msg.obs.obs[8].D.i = 3041; - - + test_msg.obs.obs[8].L.f = 232; - + test_msg.obs.obs[8].L.i = 133443545; - + test_msg.obs.obs[8].P = 1269673181; - + test_msg.obs.obs[8].cn0 = 123; - + test_msg.obs.obs[8].flags = 15; - + test_msg.obs.obs[8].lock = 5; - - + test_msg.obs.obs[8].sid.code = 0; - + test_msg.obs.obs[8].sid.sat = 31; - - - + test_msg.obs.obs[9].D.f = 62; - + test_msg.obs.obs[9].D.i = 2374; - - + test_msg.obs.obs[9].L.f = 40; - + test_msg.obs.obs[9].L.i = 103982040; - + test_msg.obs.obs[9].P = 1269673722; - + test_msg.obs.obs[9].cn0 = 120; - + test_msg.obs.obs[9].flags = 11; - + test_msg.obs.obs[9].lock = 3; - - + test_msg.obs.obs[9].sid.code = 1; - + test_msg.obs.obs[9].sid.sat = 31; - - - + test_msg.obs.obs[10].D.f = 96; - + test_msg.obs.obs[10].D.i = -3446; - - + test_msg.obs.obs[10].L.f = 7; - + test_msg.obs.obs[10].L.i = 118217315; - + test_msg.obs.obs[10].P = 1107693703; - + test_msg.obs.obs[10].cn0 = 176; - + test_msg.obs.obs[10].flags = 15; - + test_msg.obs.obs[10].lock = 10; - - + test_msg.obs.obs[10].sid.code = 3; - + test_msg.obs.obs[10].sid.sat = 2; - - - + test_msg.obs.obs[11].D.f = 96; - + test_msg.obs.obs[11].D.i = -1003; - - + test_msg.obs.obs[11].L.f = 203; - + test_msg.obs.obs[11].L.i = 104224985; - + test_msg.obs.obs[11].P = 973505172; - + test_msg.obs.obs[11].cn0 = 170; - + test_msg.obs.obs[11].flags = 15; - + test_msg.obs.obs[11].lock = 10; - - + test_msg.obs.obs[11].sid.code = 3; - + test_msg.obs.obs[11].sid.sat = 3; - - - + test_msg.obs.obs[12].D.f = 219; - + test_msg.obs.obs[12].D.i = -3836; - - + test_msg.obs.obs[12].L.f = 80; - + test_msg.obs.obs[12].L.i = 114505343; - + test_msg.obs.obs[12].P = 1069903034; - + test_msg.obs.obs[12].cn0 = 200; - + test_msg.obs.obs[12].flags = 15; - + test_msg.obs.obs[12].lock = 10; - - + test_msg.obs.obs[12].sid.code = 3; - + test_msg.obs.obs[12].sid.sat = 17; - - - + test_msg.obs.obs[13].D.f = 182; - + test_msg.obs.obs[13].D.i = -461; - - + test_msg.obs.obs[13].L.f = 105; - + test_msg.obs.obs[13].L.i = 102157331; - + test_msg.obs.obs[13].P = 956875687; - + test_msg.obs.obs[13].cn0 = 152; - + test_msg.obs.obs[13].flags = 15; - + test_msg.obs.obs[13].lock = 10; - - + test_msg.obs.obs[13].sid.code = 3; - + test_msg.obs.obs[13].sid.sat = 18; sbp_message_send(&sbp_state, SbpMsgObs, 61569, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61569, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObs, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs.header.n_obs == 32, "incorrect value for last_msg.msg.obs.header.n_obs, expected 32, is %d", last_msg.msg.obs.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs.header.t.ns_residual == 0, "incorrect value for last_msg.msg.obs.header.t.ns_residual, expected 0, is %d", last_msg.msg.obs.header.t.ns_residual); - - ck_assert_msg(last_msg.msg.obs.header.t.tow == 434293400, "incorrect value for last_msg.msg.obs.header.t.tow, expected 434293400, is %d", last_msg.msg.obs.header.t.tow); - - ck_assert_msg(last_msg.msg.obs.header.t.wn == 2154, "incorrect value for last_msg.msg.obs.header.t.wn, expected 2154, is %d", last_msg.msg.obs.header.t.wn); - - ck_assert_msg(last_msg.msg.obs.n_obs == 14, "incorrect value for last_msg.msg.obs.n_obs, expected 14, is %d", last_msg.msg.obs.n_obs); - - - - ck_assert_msg(last_msg.msg.obs.obs[0].D.f == 172, "incorrect value for last_msg.msg.obs.obs[0].D.f, expected 172, is %d", last_msg.msg.obs.obs[0].D.f); - - ck_assert_msg(last_msg.msg.obs.obs[0].D.i == -1536, "incorrect value for last_msg.msg.obs.obs[0].D.i, expected -1536, is %d", last_msg.msg.obs.obs[0].D.i); - - - ck_assert_msg(last_msg.msg.obs.obs[0].L.f == 146, "incorrect value for last_msg.msg.obs.obs[0].L.f, expected 146, is %d", last_msg.msg.obs.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs.obs[0].L.i == 111080057, "incorrect value for last_msg.msg.obs.obs[0].L.i, expected 111080057, is %d", last_msg.msg.obs.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs.obs[0].P == 1056891697, "incorrect value for last_msg.msg.obs.obs[0].P, expected 1056891697, is %d", last_msg.msg.obs.obs[0].P); - - ck_assert_msg(last_msg.msg.obs.obs[0].cn0 == 182, "incorrect value for last_msg.msg.obs.obs[0].cn0, expected 182, is %d", last_msg.msg.obs.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs.obs[0].flags == 15, "incorrect value for last_msg.msg.obs.obs[0].flags, expected 15, is %d", last_msg.msg.obs.obs[0].flags); - - ck_assert_msg(last_msg.msg.obs.obs[0].lock == 10, "incorrect value for last_msg.msg.obs.obs[0].lock, expected 10, is %d", last_msg.msg.obs.obs[0].lock); - - - ck_assert_msg(last_msg.msg.obs.obs[0].sid.code == 0, "incorrect value for last_msg.msg.obs.obs[0].sid.code, expected 0, is %d", last_msg.msg.obs.obs[0].sid.code); - - ck_assert_msg(last_msg.msg.obs.obs[0].sid.sat == 10, "incorrect value for last_msg.msg.obs.obs[0].sid.sat, expected 10, is %d", last_msg.msg.obs.obs[0].sid.sat); - - - ck_assert_msg(last_msg.msg.obs.obs[1].D.f == 172, "incorrect value for last_msg.msg.obs.obs[1].D.f, expected 172, is %d", last_msg.msg.obs.obs[1].D.f); - - ck_assert_msg(last_msg.msg.obs.obs[1].D.i == -1197, "incorrect value for last_msg.msg.obs.obs[1].D.i, expected -1197, is %d", last_msg.msg.obs.obs[1].D.i); - - - ck_assert_msg(last_msg.msg.obs.obs[1].L.f == 59, "incorrect value for last_msg.msg.obs.obs[1].L.f, expected 59, is %d", last_msg.msg.obs.obs[1].L.f); - - ck_assert_msg(last_msg.msg.obs.obs[1].L.i == 86555916, "incorrect value for last_msg.msg.obs.obs[1].L.i, expected 86555916, is %d", last_msg.msg.obs.obs[1].L.i); - - ck_assert_msg(last_msg.msg.obs.obs[1].P == 1056891934, "incorrect value for last_msg.msg.obs.obs[1].P, expected 1056891934, is %d", last_msg.msg.obs.obs[1].P); - - ck_assert_msg(last_msg.msg.obs.obs[1].cn0 == 178, "incorrect value for last_msg.msg.obs.obs[1].cn0, expected 178, is %d", last_msg.msg.obs.obs[1].cn0); - - ck_assert_msg(last_msg.msg.obs.obs[1].flags == 15, "incorrect value for last_msg.msg.obs.obs[1].flags, expected 15, is %d", last_msg.msg.obs.obs[1].flags); - - ck_assert_msg(last_msg.msg.obs.obs[1].lock == 10, "incorrect value for last_msg.msg.obs.obs[1].lock, expected 10, is %d", last_msg.msg.obs.obs[1].lock); - - - ck_assert_msg(last_msg.msg.obs.obs[1].sid.code == 1, "incorrect value for last_msg.msg.obs.obs[1].sid.code, expected 1, is %d", last_msg.msg.obs.obs[1].sid.code); - - ck_assert_msg(last_msg.msg.obs.obs[1].sid.sat == 10, "incorrect value for last_msg.msg.obs.obs[1].sid.sat, expected 10, is %d", last_msg.msg.obs.obs[1].sid.sat); - - - ck_assert_msg(last_msg.msg.obs.obs[2].D.f == 119, "incorrect value for last_msg.msg.obs.obs[2].D.f, expected 119, is %d", last_msg.msg.obs.obs[2].D.f); - - ck_assert_msg(last_msg.msg.obs.obs[2].D.i == -3219, "incorrect value for last_msg.msg.obs.obs[2].D.i, expected -3219, is %d", last_msg.msg.obs.obs[2].D.i); - - - ck_assert_msg(last_msg.msg.obs.obs[2].L.f == 243, "incorrect value for last_msg.msg.obs.obs[2].L.f, expected 243, is %d", last_msg.msg.obs.obs[2].L.f); - - ck_assert_msg(last_msg.msg.obs.obs[2].L.i == 127954794, "incorrect value for last_msg.msg.obs.obs[2].L.i, expected 127954794, is %d", last_msg.msg.obs.obs[2].L.i); - - ck_assert_msg(last_msg.msg.obs.obs[2].P == 1217449431, "incorrect value for last_msg.msg.obs.obs[2].P, expected 1217449431, is %d", last_msg.msg.obs.obs[2].P); - - ck_assert_msg(last_msg.msg.obs.obs[2].cn0 == 158, "incorrect value for last_msg.msg.obs.obs[2].cn0, expected 158, is %d", last_msg.msg.obs.obs[2].cn0); - - ck_assert_msg(last_msg.msg.obs.obs[2].flags == 15, "incorrect value for last_msg.msg.obs.obs[2].flags, expected 15, is %d", last_msg.msg.obs.obs[2].flags); - - ck_assert_msg(last_msg.msg.obs.obs[2].lock == 10, "incorrect value for last_msg.msg.obs.obs[2].lock, expected 10, is %d", last_msg.msg.obs.obs[2].lock); - - - ck_assert_msg(last_msg.msg.obs.obs[2].sid.code == 0, "incorrect value for last_msg.msg.obs.obs[2].sid.code, expected 0, is %d", last_msg.msg.obs.obs[2].sid.code); - - ck_assert_msg(last_msg.msg.obs.obs[2].sid.sat == 18, "incorrect value for last_msg.msg.obs.obs[2].sid.sat, expected 18, is %d", last_msg.msg.obs.obs[2].sid.sat); - - - ck_assert_msg(last_msg.msg.obs.obs[3].D.f == 27, "incorrect value for last_msg.msg.obs.obs[3].D.f, expected 27, is %d", last_msg.msg.obs.obs[3].D.f); - - ck_assert_msg(last_msg.msg.obs.obs[3].D.i == -2508, "incorrect value for last_msg.msg.obs.obs[3].D.i, expected -2508, is %d", last_msg.msg.obs.obs[3].D.i); - - - ck_assert_msg(last_msg.msg.obs.obs[3].L.f == 12, "incorrect value for last_msg.msg.obs.obs[3].L.f, expected 12, is %d", last_msg.msg.obs.obs[3].L.f); - - ck_assert_msg(last_msg.msg.obs.obs[3].L.i == 99705055, "incorrect value for last_msg.msg.obs.obs[3].L.i, expected 99705055, is %d", last_msg.msg.obs.obs[3].L.i); - - ck_assert_msg(last_msg.msg.obs.obs[3].P == 1217449753, "incorrect value for last_msg.msg.obs.obs[3].P, expected 1217449753, is %d", last_msg.msg.obs.obs[3].P); - - ck_assert_msg(last_msg.msg.obs.obs[3].cn0 == 125, "incorrect value for last_msg.msg.obs.obs[3].cn0, expected 125, is %d", last_msg.msg.obs.obs[3].cn0); - - ck_assert_msg(last_msg.msg.obs.obs[3].flags == 11, "incorrect value for last_msg.msg.obs.obs[3].flags, expected 11, is %d", last_msg.msg.obs.obs[3].flags); - - ck_assert_msg(last_msg.msg.obs.obs[3].lock == 9, "incorrect value for last_msg.msg.obs.obs[3].lock, expected 9, is %d", last_msg.msg.obs.obs[3].lock); - - - ck_assert_msg(last_msg.msg.obs.obs[3].sid.code == 1, "incorrect value for last_msg.msg.obs.obs[3].sid.code, expected 1, is %d", last_msg.msg.obs.obs[3].sid.code); - - ck_assert_msg(last_msg.msg.obs.obs[3].sid.sat == 18, "incorrect value for last_msg.msg.obs.obs[3].sid.sat, expected 18, is %d", last_msg.msg.obs.obs[3].sid.sat); - - - ck_assert_msg(last_msg.msg.obs.obs[4].D.f == 245, "incorrect value for last_msg.msg.obs.obs[4].D.f, expected 245, is %d", last_msg.msg.obs.obs[4].D.f); - - ck_assert_msg(last_msg.msg.obs.obs[4].D.i == 2829, "incorrect value for last_msg.msg.obs.obs[4].D.i, expected 2829, is %d", last_msg.msg.obs.obs[4].D.i); - - - ck_assert_msg(last_msg.msg.obs.obs[4].L.f == 53, "incorrect value for last_msg.msg.obs.obs[4].L.f, expected 53, is %d", last_msg.msg.obs.obs[4].L.f); - - ck_assert_msg(last_msg.msg.obs.obs[4].L.i == 132024982, "incorrect value for last_msg.msg.obs.obs[4].L.i, expected 132024982, is %d", last_msg.msg.obs.obs[4].L.i); - - ck_assert_msg(last_msg.msg.obs.obs[4].P == 1256175650, "incorrect value for last_msg.msg.obs.obs[4].P, expected 1256175650, is %d", last_msg.msg.obs.obs[4].P); - - ck_assert_msg(last_msg.msg.obs.obs[4].cn0 == 114, "incorrect value for last_msg.msg.obs.obs[4].cn0, expected 114, is %d", last_msg.msg.obs.obs[4].cn0); - - ck_assert_msg(last_msg.msg.obs.obs[4].flags == 15, "incorrect value for last_msg.msg.obs.obs[4].flags, expected 15, is %d", last_msg.msg.obs.obs[4].flags); - - ck_assert_msg(last_msg.msg.obs.obs[4].lock == 9, "incorrect value for last_msg.msg.obs.obs[4].lock, expected 9, is %d", last_msg.msg.obs.obs[4].lock); - - - ck_assert_msg(last_msg.msg.obs.obs[4].sid.code == 0, "incorrect value for last_msg.msg.obs.obs[4].sid.code, expected 0, is %d", last_msg.msg.obs.obs[4].sid.code); - - ck_assert_msg(last_msg.msg.obs.obs[4].sid.sat == 22, "incorrect value for last_msg.msg.obs.obs[4].sid.sat, expected 22, is %d", last_msg.msg.obs.obs[4].sid.sat); - - - ck_assert_msg(last_msg.msg.obs.obs[5].D.f == 246, "incorrect value for last_msg.msg.obs.obs[5].D.f, expected 246, is %d", last_msg.msg.obs.obs[5].D.f); - - ck_assert_msg(last_msg.msg.obs.obs[5].D.i == -2433, "incorrect value for last_msg.msg.obs.obs[5].D.i, expected -2433, is %d", last_msg.msg.obs.obs[5].D.i); - - - ck_assert_msg(last_msg.msg.obs.obs[5].L.f == 70, "incorrect value for last_msg.msg.obs.obs[5].L.f, expected 70, is %d", last_msg.msg.obs.obs[5].L.f); - - ck_assert_msg(last_msg.msg.obs.obs[5].L.i == 121711010, "incorrect value for last_msg.msg.obs.obs[5].L.i, expected 121711010, is %d", last_msg.msg.obs.obs[5].L.i); - - ck_assert_msg(last_msg.msg.obs.obs[5].P == 1158041713, "incorrect value for last_msg.msg.obs.obs[5].P, expected 1158041713, is %d", last_msg.msg.obs.obs[5].P); - - ck_assert_msg(last_msg.msg.obs.obs[5].cn0 == 189, "incorrect value for last_msg.msg.obs.obs[5].cn0, expected 189, is %d", last_msg.msg.obs.obs[5].cn0); - - ck_assert_msg(last_msg.msg.obs.obs[5].flags == 15, "incorrect value for last_msg.msg.obs.obs[5].flags, expected 15, is %d", last_msg.msg.obs.obs[5].flags); - - ck_assert_msg(last_msg.msg.obs.obs[5].lock == 9, "incorrect value for last_msg.msg.obs.obs[5].lock, expected 9, is %d", last_msg.msg.obs.obs[5].lock); - - - ck_assert_msg(last_msg.msg.obs.obs[5].sid.code == 0, "incorrect value for last_msg.msg.obs.obs[5].sid.code, expected 0, is %d", last_msg.msg.obs.obs[5].sid.code); - - ck_assert_msg(last_msg.msg.obs.obs[5].sid.sat == 23, "incorrect value for last_msg.msg.obs.obs[5].sid.sat, expected 23, is %d", last_msg.msg.obs.obs[5].sid.sat); - - - ck_assert_msg(last_msg.msg.obs.obs[6].D.f == 231, "incorrect value for last_msg.msg.obs.obs[6].D.f, expected 231, is %d", last_msg.msg.obs.obs[6].D.f); - - ck_assert_msg(last_msg.msg.obs.obs[6].D.i == -1896, "incorrect value for last_msg.msg.obs.obs[6].D.i, expected -1896, is %d", last_msg.msg.obs.obs[6].D.i); - - - ck_assert_msg(last_msg.msg.obs.obs[6].L.f == 221, "incorrect value for last_msg.msg.obs.obs[6].L.f, expected 221, is %d", last_msg.msg.obs.obs[6].L.f); - - ck_assert_msg(last_msg.msg.obs.obs[6].L.i == 94839765, "incorrect value for last_msg.msg.obs.obs[6].L.i, expected 94839765, is %d", last_msg.msg.obs.obs[6].L.i); - - ck_assert_msg(last_msg.msg.obs.obs[6].P == 1158041847, "incorrect value for last_msg.msg.obs.obs[6].P, expected 1158041847, is %d", last_msg.msg.obs.obs[6].P); - - ck_assert_msg(last_msg.msg.obs.obs[6].cn0 == 158, "incorrect value for last_msg.msg.obs.obs[6].cn0, expected 158, is %d", last_msg.msg.obs.obs[6].cn0); - - ck_assert_msg(last_msg.msg.obs.obs[6].flags == 11, "incorrect value for last_msg.msg.obs.obs[6].flags, expected 11, is %d", last_msg.msg.obs.obs[6].flags); - - ck_assert_msg(last_msg.msg.obs.obs[6].lock == 9, "incorrect value for last_msg.msg.obs.obs[6].lock, expected 9, is %d", last_msg.msg.obs.obs[6].lock); - - - ck_assert_msg(last_msg.msg.obs.obs[6].sid.code == 1, "incorrect value for last_msg.msg.obs.obs[6].sid.code, expected 1, is %d", last_msg.msg.obs.obs[6].sid.code); - - ck_assert_msg(last_msg.msg.obs.obs[6].sid.sat == 23, "incorrect value for last_msg.msg.obs.obs[6].sid.sat, expected 23, is %d", last_msg.msg.obs.obs[6].sid.sat); - - - ck_assert_msg(last_msg.msg.obs.obs[7].D.f == 67, "incorrect value for last_msg.msg.obs.obs[7].D.f, expected 67, is %d", last_msg.msg.obs.obs[7].D.f); - - ck_assert_msg(last_msg.msg.obs.obs[7].D.i == -1997, "incorrect value for last_msg.msg.obs.obs[7].D.i, expected -1997, is %d", last_msg.msg.obs.obs[7].D.i); - - - ck_assert_msg(last_msg.msg.obs.obs[7].L.f == 114, "incorrect value for last_msg.msg.obs.obs[7].L.f, expected 114, is %d", last_msg.msg.obs.obs[7].L.f); - - ck_assert_msg(last_msg.msg.obs.obs[7].L.i == 113998348, "incorrect value for last_msg.msg.obs.obs[7].L.i, expected 113998348, is %d", last_msg.msg.obs.obs[7].L.i); - - ck_assert_msg(last_msg.msg.obs.obs[7].P == 1084658184, "incorrect value for last_msg.msg.obs.obs[7].P, expected 1084658184, is %d", last_msg.msg.obs.obs[7].P); - - ck_assert_msg(last_msg.msg.obs.obs[7].cn0 == 93, "incorrect value for last_msg.msg.obs.obs[7].cn0, expected 93, is %d", last_msg.msg.obs.obs[7].cn0); - - ck_assert_msg(last_msg.msg.obs.obs[7].flags == 11, "incorrect value for last_msg.msg.obs.obs[7].flags, expected 11, is %d", last_msg.msg.obs.obs[7].flags); - - ck_assert_msg(last_msg.msg.obs.obs[7].lock == 3, "incorrect value for last_msg.msg.obs.obs[7].lock, expected 3, is %d", last_msg.msg.obs.obs[7].lock); - - - ck_assert_msg(last_msg.msg.obs.obs[7].sid.code == 0, "incorrect value for last_msg.msg.obs.obs[7].sid.code, expected 0, is %d", last_msg.msg.obs.obs[7].sid.code); - - ck_assert_msg(last_msg.msg.obs.obs[7].sid.sat == 27, "incorrect value for last_msg.msg.obs.obs[7].sid.sat, expected 27, is %d", last_msg.msg.obs.obs[7].sid.sat); - - - ck_assert_msg(last_msg.msg.obs.obs[8].D.f == 237, "incorrect value for last_msg.msg.obs.obs[8].D.f, expected 237, is %d", last_msg.msg.obs.obs[8].D.f); - - ck_assert_msg(last_msg.msg.obs.obs[8].D.i == 3041, "incorrect value for last_msg.msg.obs.obs[8].D.i, expected 3041, is %d", last_msg.msg.obs.obs[8].D.i); - - - ck_assert_msg(last_msg.msg.obs.obs[8].L.f == 232, "incorrect value for last_msg.msg.obs.obs[8].L.f, expected 232, is %d", last_msg.msg.obs.obs[8].L.f); - - ck_assert_msg(last_msg.msg.obs.obs[8].L.i == 133443545, "incorrect value for last_msg.msg.obs.obs[8].L.i, expected 133443545, is %d", last_msg.msg.obs.obs[8].L.i); - - ck_assert_msg(last_msg.msg.obs.obs[8].P == 1269673181, "incorrect value for last_msg.msg.obs.obs[8].P, expected 1269673181, is %d", last_msg.msg.obs.obs[8].P); - - ck_assert_msg(last_msg.msg.obs.obs[8].cn0 == 123, "incorrect value for last_msg.msg.obs.obs[8].cn0, expected 123, is %d", last_msg.msg.obs.obs[8].cn0); - - ck_assert_msg(last_msg.msg.obs.obs[8].flags == 15, "incorrect value for last_msg.msg.obs.obs[8].flags, expected 15, is %d", last_msg.msg.obs.obs[8].flags); - - ck_assert_msg(last_msg.msg.obs.obs[8].lock == 5, "incorrect value for last_msg.msg.obs.obs[8].lock, expected 5, is %d", last_msg.msg.obs.obs[8].lock); - - - ck_assert_msg(last_msg.msg.obs.obs[8].sid.code == 0, "incorrect value for last_msg.msg.obs.obs[8].sid.code, expected 0, is %d", last_msg.msg.obs.obs[8].sid.code); - - ck_assert_msg(last_msg.msg.obs.obs[8].sid.sat == 31, "incorrect value for last_msg.msg.obs.obs[8].sid.sat, expected 31, is %d", last_msg.msg.obs.obs[8].sid.sat); - - - ck_assert_msg(last_msg.msg.obs.obs[9].D.f == 62, "incorrect value for last_msg.msg.obs.obs[9].D.f, expected 62, is %d", last_msg.msg.obs.obs[9].D.f); - - ck_assert_msg(last_msg.msg.obs.obs[9].D.i == 2374, "incorrect value for last_msg.msg.obs.obs[9].D.i, expected 2374, is %d", last_msg.msg.obs.obs[9].D.i); - - - ck_assert_msg(last_msg.msg.obs.obs[9].L.f == 40, "incorrect value for last_msg.msg.obs.obs[9].L.f, expected 40, is %d", last_msg.msg.obs.obs[9].L.f); - - ck_assert_msg(last_msg.msg.obs.obs[9].L.i == 103982040, "incorrect value for last_msg.msg.obs.obs[9].L.i, expected 103982040, is %d", last_msg.msg.obs.obs[9].L.i); - - ck_assert_msg(last_msg.msg.obs.obs[9].P == 1269673722, "incorrect value for last_msg.msg.obs.obs[9].P, expected 1269673722, is %d", last_msg.msg.obs.obs[9].P); - - ck_assert_msg(last_msg.msg.obs.obs[9].cn0 == 120, "incorrect value for last_msg.msg.obs.obs[9].cn0, expected 120, is %d", last_msg.msg.obs.obs[9].cn0); - - ck_assert_msg(last_msg.msg.obs.obs[9].flags == 11, "incorrect value for last_msg.msg.obs.obs[9].flags, expected 11, is %d", last_msg.msg.obs.obs[9].flags); - - ck_assert_msg(last_msg.msg.obs.obs[9].lock == 3, "incorrect value for last_msg.msg.obs.obs[9].lock, expected 3, is %d", last_msg.msg.obs.obs[9].lock); - - - ck_assert_msg(last_msg.msg.obs.obs[9].sid.code == 1, "incorrect value for last_msg.msg.obs.obs[9].sid.code, expected 1, is %d", last_msg.msg.obs.obs[9].sid.code); - - ck_assert_msg(last_msg.msg.obs.obs[9].sid.sat == 31, "incorrect value for last_msg.msg.obs.obs[9].sid.sat, expected 31, is %d", last_msg.msg.obs.obs[9].sid.sat); - - - ck_assert_msg(last_msg.msg.obs.obs[10].D.f == 96, "incorrect value for last_msg.msg.obs.obs[10].D.f, expected 96, is %d", last_msg.msg.obs.obs[10].D.f); - - ck_assert_msg(last_msg.msg.obs.obs[10].D.i == -3446, "incorrect value for last_msg.msg.obs.obs[10].D.i, expected -3446, is %d", last_msg.msg.obs.obs[10].D.i); - - - ck_assert_msg(last_msg.msg.obs.obs[10].L.f == 7, "incorrect value for last_msg.msg.obs.obs[10].L.f, expected 7, is %d", last_msg.msg.obs.obs[10].L.f); - - ck_assert_msg(last_msg.msg.obs.obs[10].L.i == 118217315, "incorrect value for last_msg.msg.obs.obs[10].L.i, expected 118217315, is %d", last_msg.msg.obs.obs[10].L.i); - - ck_assert_msg(last_msg.msg.obs.obs[10].P == 1107693703, "incorrect value for last_msg.msg.obs.obs[10].P, expected 1107693703, is %d", last_msg.msg.obs.obs[10].P); - - ck_assert_msg(last_msg.msg.obs.obs[10].cn0 == 176, "incorrect value for last_msg.msg.obs.obs[10].cn0, expected 176, is %d", last_msg.msg.obs.obs[10].cn0); - - ck_assert_msg(last_msg.msg.obs.obs[10].flags == 15, "incorrect value for last_msg.msg.obs.obs[10].flags, expected 15, is %d", last_msg.msg.obs.obs[10].flags); - - ck_assert_msg(last_msg.msg.obs.obs[10].lock == 10, "incorrect value for last_msg.msg.obs.obs[10].lock, expected 10, is %d", last_msg.msg.obs.obs[10].lock); - - - ck_assert_msg(last_msg.msg.obs.obs[10].sid.code == 3, "incorrect value for last_msg.msg.obs.obs[10].sid.code, expected 3, is %d", last_msg.msg.obs.obs[10].sid.code); - - ck_assert_msg(last_msg.msg.obs.obs[10].sid.sat == 2, "incorrect value for last_msg.msg.obs.obs[10].sid.sat, expected 2, is %d", last_msg.msg.obs.obs[10].sid.sat); - - - ck_assert_msg(last_msg.msg.obs.obs[11].D.f == 96, "incorrect value for last_msg.msg.obs.obs[11].D.f, expected 96, is %d", last_msg.msg.obs.obs[11].D.f); - - ck_assert_msg(last_msg.msg.obs.obs[11].D.i == -1003, "incorrect value for last_msg.msg.obs.obs[11].D.i, expected -1003, is %d", last_msg.msg.obs.obs[11].D.i); - - - ck_assert_msg(last_msg.msg.obs.obs[11].L.f == 203, "incorrect value for last_msg.msg.obs.obs[11].L.f, expected 203, is %d", last_msg.msg.obs.obs[11].L.f); - - ck_assert_msg(last_msg.msg.obs.obs[11].L.i == 104224985, "incorrect value for last_msg.msg.obs.obs[11].L.i, expected 104224985, is %d", last_msg.msg.obs.obs[11].L.i); - - ck_assert_msg(last_msg.msg.obs.obs[11].P == 973505172, "incorrect value for last_msg.msg.obs.obs[11].P, expected 973505172, is %d", last_msg.msg.obs.obs[11].P); - - ck_assert_msg(last_msg.msg.obs.obs[11].cn0 == 170, "incorrect value for last_msg.msg.obs.obs[11].cn0, expected 170, is %d", last_msg.msg.obs.obs[11].cn0); - - ck_assert_msg(last_msg.msg.obs.obs[11].flags == 15, "incorrect value for last_msg.msg.obs.obs[11].flags, expected 15, is %d", last_msg.msg.obs.obs[11].flags); - - ck_assert_msg(last_msg.msg.obs.obs[11].lock == 10, "incorrect value for last_msg.msg.obs.obs[11].lock, expected 10, is %d", last_msg.msg.obs.obs[11].lock); - - - ck_assert_msg(last_msg.msg.obs.obs[11].sid.code == 3, "incorrect value for last_msg.msg.obs.obs[11].sid.code, expected 3, is %d", last_msg.msg.obs.obs[11].sid.code); - - ck_assert_msg(last_msg.msg.obs.obs[11].sid.sat == 3, "incorrect value for last_msg.msg.obs.obs[11].sid.sat, expected 3, is %d", last_msg.msg.obs.obs[11].sid.sat); - - - ck_assert_msg(last_msg.msg.obs.obs[12].D.f == 219, "incorrect value for last_msg.msg.obs.obs[12].D.f, expected 219, is %d", last_msg.msg.obs.obs[12].D.f); - - ck_assert_msg(last_msg.msg.obs.obs[12].D.i == -3836, "incorrect value for last_msg.msg.obs.obs[12].D.i, expected -3836, is %d", last_msg.msg.obs.obs[12].D.i); - - - ck_assert_msg(last_msg.msg.obs.obs[12].L.f == 80, "incorrect value for last_msg.msg.obs.obs[12].L.f, expected 80, is %d", last_msg.msg.obs.obs[12].L.f); - - ck_assert_msg(last_msg.msg.obs.obs[12].L.i == 114505343, "incorrect value for last_msg.msg.obs.obs[12].L.i, expected 114505343, is %d", last_msg.msg.obs.obs[12].L.i); - - ck_assert_msg(last_msg.msg.obs.obs[12].P == 1069903034, "incorrect value for last_msg.msg.obs.obs[12].P, expected 1069903034, is %d", last_msg.msg.obs.obs[12].P); - - ck_assert_msg(last_msg.msg.obs.obs[12].cn0 == 200, "incorrect value for last_msg.msg.obs.obs[12].cn0, expected 200, is %d", last_msg.msg.obs.obs[12].cn0); - - ck_assert_msg(last_msg.msg.obs.obs[12].flags == 15, "incorrect value for last_msg.msg.obs.obs[12].flags, expected 15, is %d", last_msg.msg.obs.obs[12].flags); - - ck_assert_msg(last_msg.msg.obs.obs[12].lock == 10, "incorrect value for last_msg.msg.obs.obs[12].lock, expected 10, is %d", last_msg.msg.obs.obs[12].lock); - - - ck_assert_msg(last_msg.msg.obs.obs[12].sid.code == 3, "incorrect value for last_msg.msg.obs.obs[12].sid.code, expected 3, is %d", last_msg.msg.obs.obs[12].sid.code); - - ck_assert_msg(last_msg.msg.obs.obs[12].sid.sat == 17, "incorrect value for last_msg.msg.obs.obs[12].sid.sat, expected 17, is %d", last_msg.msg.obs.obs[12].sid.sat); - - - ck_assert_msg(last_msg.msg.obs.obs[13].D.f == 182, "incorrect value for last_msg.msg.obs.obs[13].D.f, expected 182, is %d", last_msg.msg.obs.obs[13].D.f); - - ck_assert_msg(last_msg.msg.obs.obs[13].D.i == -461, "incorrect value for last_msg.msg.obs.obs[13].D.i, expected -461, is %d", last_msg.msg.obs.obs[13].D.i); - - - ck_assert_msg(last_msg.msg.obs.obs[13].L.f == 105, "incorrect value for last_msg.msg.obs.obs[13].L.f, expected 105, is %d", last_msg.msg.obs.obs[13].L.f); - - ck_assert_msg(last_msg.msg.obs.obs[13].L.i == 102157331, "incorrect value for last_msg.msg.obs.obs[13].L.i, expected 102157331, is %d", last_msg.msg.obs.obs[13].L.i); - - ck_assert_msg(last_msg.msg.obs.obs[13].P == 956875687, "incorrect value for last_msg.msg.obs.obs[13].P, expected 956875687, is %d", last_msg.msg.obs.obs[13].P); - - ck_assert_msg(last_msg.msg.obs.obs[13].cn0 == 152, "incorrect value for last_msg.msg.obs.obs[13].cn0, expected 152, is %d", last_msg.msg.obs.obs[13].cn0); - - ck_assert_msg(last_msg.msg.obs.obs[13].flags == 15, "incorrect value for last_msg.msg.obs.obs[13].flags, expected 15, is %d", last_msg.msg.obs.obs[13].flags); - - ck_assert_msg(last_msg.msg.obs.obs[13].lock == 10, "incorrect value for last_msg.msg.obs.obs[13].lock, expected 10, is %d", last_msg.msg.obs.obs[13].lock); - - - ck_assert_msg(last_msg.msg.obs.obs[13].sid.code == 3, "incorrect value for last_msg.msg.obs.obs[13].sid.code, expected 3, is %d", last_msg.msg.obs.obs[13].sid.code); - - ck_assert_msg(last_msg.msg.obs.obs[13].sid.sat == 18, "incorrect value for last_msg.msg.obs.obs[13].sid.sat, expected 18, is %d", last_msg.msg.obs.obs[13].sid.sat); + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.obs.header.n_obs == 32, + "incorrect value for last_msg.msg.obs.header.n_obs, expected 32, is %d", + last_msg.msg.obs.header.n_obs); + + ck_assert_msg(last_msg.msg.obs.header.t.ns_residual == 0, + "incorrect value for last_msg.msg.obs.header.t.ns_residual, " + "expected 0, is %d", + last_msg.msg.obs.header.t.ns_residual); + ck_assert_msg(last_msg.msg.obs.header.t.tow == 434293400, + "incorrect value for last_msg.msg.obs.header.t.tow, expected " + "434293400, is %d", + last_msg.msg.obs.header.t.tow); + + ck_assert_msg(last_msg.msg.obs.header.t.wn == 2154, + "incorrect value for last_msg.msg.obs.header.t.wn, expected " + "2154, is %d", + last_msg.msg.obs.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs.n_obs == 14, + "incorrect value for last_msg.msg.obs.n_obs, expected 14, is %d", + last_msg.msg.obs.n_obs); + + ck_assert_msg( + last_msg.msg.obs.obs[0].D.f == 172, + "incorrect value for last_msg.msg.obs.obs[0].D.f, expected 172, is %d", + last_msg.msg.obs.obs[0].D.f); + + ck_assert_msg(last_msg.msg.obs.obs[0].D.i == -1536, + "incorrect value for last_msg.msg.obs.obs[0].D.i, expected " + "-1536, is %d", + last_msg.msg.obs.obs[0].D.i); + + ck_assert_msg( + last_msg.msg.obs.obs[0].L.f == 146, + "incorrect value for last_msg.msg.obs.obs[0].L.f, expected 146, is %d", + last_msg.msg.obs.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs.obs[0].L.i == 111080057, + "incorrect value for last_msg.msg.obs.obs[0].L.i, expected " + "111080057, is %d", + last_msg.msg.obs.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs.obs[0].P == 1056891697, + "incorrect value for last_msg.msg.obs.obs[0].P, expected " + "1056891697, is %d", + last_msg.msg.obs.obs[0].P); + + ck_assert_msg( + last_msg.msg.obs.obs[0].cn0 == 182, + "incorrect value for last_msg.msg.obs.obs[0].cn0, expected 182, is %d", + last_msg.msg.obs.obs[0].cn0); + + ck_assert_msg( + last_msg.msg.obs.obs[0].flags == 15, + "incorrect value for last_msg.msg.obs.obs[0].flags, expected 15, is %d", + last_msg.msg.obs.obs[0].flags); + + ck_assert_msg( + last_msg.msg.obs.obs[0].lock == 10, + "incorrect value for last_msg.msg.obs.obs[0].lock, expected 10, is %d", + last_msg.msg.obs.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs.obs[0].sid.code == 0, + "incorrect value for last_msg.msg.obs.obs[0].sid.code, " + "expected 0, is %d", + last_msg.msg.obs.obs[0].sid.code); + + ck_assert_msg(last_msg.msg.obs.obs[0].sid.sat == 10, + "incorrect value for last_msg.msg.obs.obs[0].sid.sat, " + "expected 10, is %d", + last_msg.msg.obs.obs[0].sid.sat); + + ck_assert_msg( + last_msg.msg.obs.obs[1].D.f == 172, + "incorrect value for last_msg.msg.obs.obs[1].D.f, expected 172, is %d", + last_msg.msg.obs.obs[1].D.f); + + ck_assert_msg(last_msg.msg.obs.obs[1].D.i == -1197, + "incorrect value for last_msg.msg.obs.obs[1].D.i, expected " + "-1197, is %d", + last_msg.msg.obs.obs[1].D.i); + + ck_assert_msg( + last_msg.msg.obs.obs[1].L.f == 59, + "incorrect value for last_msg.msg.obs.obs[1].L.f, expected 59, is %d", + last_msg.msg.obs.obs[1].L.f); + + ck_assert_msg(last_msg.msg.obs.obs[1].L.i == 86555916, + "incorrect value for last_msg.msg.obs.obs[1].L.i, expected " + "86555916, is %d", + last_msg.msg.obs.obs[1].L.i); + + ck_assert_msg(last_msg.msg.obs.obs[1].P == 1056891934, + "incorrect value for last_msg.msg.obs.obs[1].P, expected " + "1056891934, is %d", + last_msg.msg.obs.obs[1].P); + + ck_assert_msg( + last_msg.msg.obs.obs[1].cn0 == 178, + "incorrect value for last_msg.msg.obs.obs[1].cn0, expected 178, is %d", + last_msg.msg.obs.obs[1].cn0); + + ck_assert_msg( + last_msg.msg.obs.obs[1].flags == 15, + "incorrect value for last_msg.msg.obs.obs[1].flags, expected 15, is %d", + last_msg.msg.obs.obs[1].flags); + + ck_assert_msg( + last_msg.msg.obs.obs[1].lock == 10, + "incorrect value for last_msg.msg.obs.obs[1].lock, expected 10, is %d", + last_msg.msg.obs.obs[1].lock); + + ck_assert_msg(last_msg.msg.obs.obs[1].sid.code == 1, + "incorrect value for last_msg.msg.obs.obs[1].sid.code, " + "expected 1, is %d", + last_msg.msg.obs.obs[1].sid.code); + + ck_assert_msg(last_msg.msg.obs.obs[1].sid.sat == 10, + "incorrect value for last_msg.msg.obs.obs[1].sid.sat, " + "expected 10, is %d", + last_msg.msg.obs.obs[1].sid.sat); + + ck_assert_msg( + last_msg.msg.obs.obs[2].D.f == 119, + "incorrect value for last_msg.msg.obs.obs[2].D.f, expected 119, is %d", + last_msg.msg.obs.obs[2].D.f); + + ck_assert_msg(last_msg.msg.obs.obs[2].D.i == -3219, + "incorrect value for last_msg.msg.obs.obs[2].D.i, expected " + "-3219, is %d", + last_msg.msg.obs.obs[2].D.i); + + ck_assert_msg( + last_msg.msg.obs.obs[2].L.f == 243, + "incorrect value for last_msg.msg.obs.obs[2].L.f, expected 243, is %d", + last_msg.msg.obs.obs[2].L.f); + + ck_assert_msg(last_msg.msg.obs.obs[2].L.i == 127954794, + "incorrect value for last_msg.msg.obs.obs[2].L.i, expected " + "127954794, is %d", + last_msg.msg.obs.obs[2].L.i); + + ck_assert_msg(last_msg.msg.obs.obs[2].P == 1217449431, + "incorrect value for last_msg.msg.obs.obs[2].P, expected " + "1217449431, is %d", + last_msg.msg.obs.obs[2].P); + + ck_assert_msg( + last_msg.msg.obs.obs[2].cn0 == 158, + "incorrect value for last_msg.msg.obs.obs[2].cn0, expected 158, is %d", + last_msg.msg.obs.obs[2].cn0); + + ck_assert_msg( + last_msg.msg.obs.obs[2].flags == 15, + "incorrect value for last_msg.msg.obs.obs[2].flags, expected 15, is %d", + last_msg.msg.obs.obs[2].flags); + + ck_assert_msg( + last_msg.msg.obs.obs[2].lock == 10, + "incorrect value for last_msg.msg.obs.obs[2].lock, expected 10, is %d", + last_msg.msg.obs.obs[2].lock); + + ck_assert_msg(last_msg.msg.obs.obs[2].sid.code == 0, + "incorrect value for last_msg.msg.obs.obs[2].sid.code, " + "expected 0, is %d", + last_msg.msg.obs.obs[2].sid.code); + + ck_assert_msg(last_msg.msg.obs.obs[2].sid.sat == 18, + "incorrect value for last_msg.msg.obs.obs[2].sid.sat, " + "expected 18, is %d", + last_msg.msg.obs.obs[2].sid.sat); + + ck_assert_msg( + last_msg.msg.obs.obs[3].D.f == 27, + "incorrect value for last_msg.msg.obs.obs[3].D.f, expected 27, is %d", + last_msg.msg.obs.obs[3].D.f); + + ck_assert_msg(last_msg.msg.obs.obs[3].D.i == -2508, + "incorrect value for last_msg.msg.obs.obs[3].D.i, expected " + "-2508, is %d", + last_msg.msg.obs.obs[3].D.i); + + ck_assert_msg( + last_msg.msg.obs.obs[3].L.f == 12, + "incorrect value for last_msg.msg.obs.obs[3].L.f, expected 12, is %d", + last_msg.msg.obs.obs[3].L.f); + + ck_assert_msg(last_msg.msg.obs.obs[3].L.i == 99705055, + "incorrect value for last_msg.msg.obs.obs[3].L.i, expected " + "99705055, is %d", + last_msg.msg.obs.obs[3].L.i); + + ck_assert_msg(last_msg.msg.obs.obs[3].P == 1217449753, + "incorrect value for last_msg.msg.obs.obs[3].P, expected " + "1217449753, is %d", + last_msg.msg.obs.obs[3].P); + + ck_assert_msg( + last_msg.msg.obs.obs[3].cn0 == 125, + "incorrect value for last_msg.msg.obs.obs[3].cn0, expected 125, is %d", + last_msg.msg.obs.obs[3].cn0); + + ck_assert_msg( + last_msg.msg.obs.obs[3].flags == 11, + "incorrect value for last_msg.msg.obs.obs[3].flags, expected 11, is %d", + last_msg.msg.obs.obs[3].flags); + + ck_assert_msg( + last_msg.msg.obs.obs[3].lock == 9, + "incorrect value for last_msg.msg.obs.obs[3].lock, expected 9, is %d", + last_msg.msg.obs.obs[3].lock); + + ck_assert_msg(last_msg.msg.obs.obs[3].sid.code == 1, + "incorrect value for last_msg.msg.obs.obs[3].sid.code, " + "expected 1, is %d", + last_msg.msg.obs.obs[3].sid.code); + + ck_assert_msg(last_msg.msg.obs.obs[3].sid.sat == 18, + "incorrect value for last_msg.msg.obs.obs[3].sid.sat, " + "expected 18, is %d", + last_msg.msg.obs.obs[3].sid.sat); + + ck_assert_msg( + last_msg.msg.obs.obs[4].D.f == 245, + "incorrect value for last_msg.msg.obs.obs[4].D.f, expected 245, is %d", + last_msg.msg.obs.obs[4].D.f); + + ck_assert_msg( + last_msg.msg.obs.obs[4].D.i == 2829, + "incorrect value for last_msg.msg.obs.obs[4].D.i, expected 2829, is %d", + last_msg.msg.obs.obs[4].D.i); + + ck_assert_msg( + last_msg.msg.obs.obs[4].L.f == 53, + "incorrect value for last_msg.msg.obs.obs[4].L.f, expected 53, is %d", + last_msg.msg.obs.obs[4].L.f); + + ck_assert_msg(last_msg.msg.obs.obs[4].L.i == 132024982, + "incorrect value for last_msg.msg.obs.obs[4].L.i, expected " + "132024982, is %d", + last_msg.msg.obs.obs[4].L.i); + + ck_assert_msg(last_msg.msg.obs.obs[4].P == 1256175650, + "incorrect value for last_msg.msg.obs.obs[4].P, expected " + "1256175650, is %d", + last_msg.msg.obs.obs[4].P); + + ck_assert_msg( + last_msg.msg.obs.obs[4].cn0 == 114, + "incorrect value for last_msg.msg.obs.obs[4].cn0, expected 114, is %d", + last_msg.msg.obs.obs[4].cn0); + + ck_assert_msg( + last_msg.msg.obs.obs[4].flags == 15, + "incorrect value for last_msg.msg.obs.obs[4].flags, expected 15, is %d", + last_msg.msg.obs.obs[4].flags); + + ck_assert_msg( + last_msg.msg.obs.obs[4].lock == 9, + "incorrect value for last_msg.msg.obs.obs[4].lock, expected 9, is %d", + last_msg.msg.obs.obs[4].lock); + + ck_assert_msg(last_msg.msg.obs.obs[4].sid.code == 0, + "incorrect value for last_msg.msg.obs.obs[4].sid.code, " + "expected 0, is %d", + last_msg.msg.obs.obs[4].sid.code); + + ck_assert_msg(last_msg.msg.obs.obs[4].sid.sat == 22, + "incorrect value for last_msg.msg.obs.obs[4].sid.sat, " + "expected 22, is %d", + last_msg.msg.obs.obs[4].sid.sat); + + ck_assert_msg( + last_msg.msg.obs.obs[5].D.f == 246, + "incorrect value for last_msg.msg.obs.obs[5].D.f, expected 246, is %d", + last_msg.msg.obs.obs[5].D.f); + + ck_assert_msg(last_msg.msg.obs.obs[5].D.i == -2433, + "incorrect value for last_msg.msg.obs.obs[5].D.i, expected " + "-2433, is %d", + last_msg.msg.obs.obs[5].D.i); + + ck_assert_msg( + last_msg.msg.obs.obs[5].L.f == 70, + "incorrect value for last_msg.msg.obs.obs[5].L.f, expected 70, is %d", + last_msg.msg.obs.obs[5].L.f); + + ck_assert_msg(last_msg.msg.obs.obs[5].L.i == 121711010, + "incorrect value for last_msg.msg.obs.obs[5].L.i, expected " + "121711010, is %d", + last_msg.msg.obs.obs[5].L.i); + + ck_assert_msg(last_msg.msg.obs.obs[5].P == 1158041713, + "incorrect value for last_msg.msg.obs.obs[5].P, expected " + "1158041713, is %d", + last_msg.msg.obs.obs[5].P); + + ck_assert_msg( + last_msg.msg.obs.obs[5].cn0 == 189, + "incorrect value for last_msg.msg.obs.obs[5].cn0, expected 189, is %d", + last_msg.msg.obs.obs[5].cn0); + + ck_assert_msg( + last_msg.msg.obs.obs[5].flags == 15, + "incorrect value for last_msg.msg.obs.obs[5].flags, expected 15, is %d", + last_msg.msg.obs.obs[5].flags); + + ck_assert_msg( + last_msg.msg.obs.obs[5].lock == 9, + "incorrect value for last_msg.msg.obs.obs[5].lock, expected 9, is %d", + last_msg.msg.obs.obs[5].lock); + + ck_assert_msg(last_msg.msg.obs.obs[5].sid.code == 0, + "incorrect value for last_msg.msg.obs.obs[5].sid.code, " + "expected 0, is %d", + last_msg.msg.obs.obs[5].sid.code); + + ck_assert_msg(last_msg.msg.obs.obs[5].sid.sat == 23, + "incorrect value for last_msg.msg.obs.obs[5].sid.sat, " + "expected 23, is %d", + last_msg.msg.obs.obs[5].sid.sat); + + ck_assert_msg( + last_msg.msg.obs.obs[6].D.f == 231, + "incorrect value for last_msg.msg.obs.obs[6].D.f, expected 231, is %d", + last_msg.msg.obs.obs[6].D.f); + + ck_assert_msg(last_msg.msg.obs.obs[6].D.i == -1896, + "incorrect value for last_msg.msg.obs.obs[6].D.i, expected " + "-1896, is %d", + last_msg.msg.obs.obs[6].D.i); + + ck_assert_msg( + last_msg.msg.obs.obs[6].L.f == 221, + "incorrect value for last_msg.msg.obs.obs[6].L.f, expected 221, is %d", + last_msg.msg.obs.obs[6].L.f); + + ck_assert_msg(last_msg.msg.obs.obs[6].L.i == 94839765, + "incorrect value for last_msg.msg.obs.obs[6].L.i, expected " + "94839765, is %d", + last_msg.msg.obs.obs[6].L.i); + + ck_assert_msg(last_msg.msg.obs.obs[6].P == 1158041847, + "incorrect value for last_msg.msg.obs.obs[6].P, expected " + "1158041847, is %d", + last_msg.msg.obs.obs[6].P); + + ck_assert_msg( + last_msg.msg.obs.obs[6].cn0 == 158, + "incorrect value for last_msg.msg.obs.obs[6].cn0, expected 158, is %d", + last_msg.msg.obs.obs[6].cn0); + + ck_assert_msg( + last_msg.msg.obs.obs[6].flags == 11, + "incorrect value for last_msg.msg.obs.obs[6].flags, expected 11, is %d", + last_msg.msg.obs.obs[6].flags); + + ck_assert_msg( + last_msg.msg.obs.obs[6].lock == 9, + "incorrect value for last_msg.msg.obs.obs[6].lock, expected 9, is %d", + last_msg.msg.obs.obs[6].lock); + + ck_assert_msg(last_msg.msg.obs.obs[6].sid.code == 1, + "incorrect value for last_msg.msg.obs.obs[6].sid.code, " + "expected 1, is %d", + last_msg.msg.obs.obs[6].sid.code); + + ck_assert_msg(last_msg.msg.obs.obs[6].sid.sat == 23, + "incorrect value for last_msg.msg.obs.obs[6].sid.sat, " + "expected 23, is %d", + last_msg.msg.obs.obs[6].sid.sat); + + ck_assert_msg( + last_msg.msg.obs.obs[7].D.f == 67, + "incorrect value for last_msg.msg.obs.obs[7].D.f, expected 67, is %d", + last_msg.msg.obs.obs[7].D.f); + + ck_assert_msg(last_msg.msg.obs.obs[7].D.i == -1997, + "incorrect value for last_msg.msg.obs.obs[7].D.i, expected " + "-1997, is %d", + last_msg.msg.obs.obs[7].D.i); + + ck_assert_msg( + last_msg.msg.obs.obs[7].L.f == 114, + "incorrect value for last_msg.msg.obs.obs[7].L.f, expected 114, is %d", + last_msg.msg.obs.obs[7].L.f); + + ck_assert_msg(last_msg.msg.obs.obs[7].L.i == 113998348, + "incorrect value for last_msg.msg.obs.obs[7].L.i, expected " + "113998348, is %d", + last_msg.msg.obs.obs[7].L.i); + + ck_assert_msg(last_msg.msg.obs.obs[7].P == 1084658184, + "incorrect value for last_msg.msg.obs.obs[7].P, expected " + "1084658184, is %d", + last_msg.msg.obs.obs[7].P); + + ck_assert_msg( + last_msg.msg.obs.obs[7].cn0 == 93, + "incorrect value for last_msg.msg.obs.obs[7].cn0, expected 93, is %d", + last_msg.msg.obs.obs[7].cn0); + + ck_assert_msg( + last_msg.msg.obs.obs[7].flags == 11, + "incorrect value for last_msg.msg.obs.obs[7].flags, expected 11, is %d", + last_msg.msg.obs.obs[7].flags); + + ck_assert_msg( + last_msg.msg.obs.obs[7].lock == 3, + "incorrect value for last_msg.msg.obs.obs[7].lock, expected 3, is %d", + last_msg.msg.obs.obs[7].lock); + + ck_assert_msg(last_msg.msg.obs.obs[7].sid.code == 0, + "incorrect value for last_msg.msg.obs.obs[7].sid.code, " + "expected 0, is %d", + last_msg.msg.obs.obs[7].sid.code); + + ck_assert_msg(last_msg.msg.obs.obs[7].sid.sat == 27, + "incorrect value for last_msg.msg.obs.obs[7].sid.sat, " + "expected 27, is %d", + last_msg.msg.obs.obs[7].sid.sat); + + ck_assert_msg( + last_msg.msg.obs.obs[8].D.f == 237, + "incorrect value for last_msg.msg.obs.obs[8].D.f, expected 237, is %d", + last_msg.msg.obs.obs[8].D.f); + + ck_assert_msg( + last_msg.msg.obs.obs[8].D.i == 3041, + "incorrect value for last_msg.msg.obs.obs[8].D.i, expected 3041, is %d", + last_msg.msg.obs.obs[8].D.i); + + ck_assert_msg( + last_msg.msg.obs.obs[8].L.f == 232, + "incorrect value for last_msg.msg.obs.obs[8].L.f, expected 232, is %d", + last_msg.msg.obs.obs[8].L.f); + + ck_assert_msg(last_msg.msg.obs.obs[8].L.i == 133443545, + "incorrect value for last_msg.msg.obs.obs[8].L.i, expected " + "133443545, is %d", + last_msg.msg.obs.obs[8].L.i); + + ck_assert_msg(last_msg.msg.obs.obs[8].P == 1269673181, + "incorrect value for last_msg.msg.obs.obs[8].P, expected " + "1269673181, is %d", + last_msg.msg.obs.obs[8].P); + + ck_assert_msg( + last_msg.msg.obs.obs[8].cn0 == 123, + "incorrect value for last_msg.msg.obs.obs[8].cn0, expected 123, is %d", + last_msg.msg.obs.obs[8].cn0); + + ck_assert_msg( + last_msg.msg.obs.obs[8].flags == 15, + "incorrect value for last_msg.msg.obs.obs[8].flags, expected 15, is %d", + last_msg.msg.obs.obs[8].flags); + + ck_assert_msg( + last_msg.msg.obs.obs[8].lock == 5, + "incorrect value for last_msg.msg.obs.obs[8].lock, expected 5, is %d", + last_msg.msg.obs.obs[8].lock); + + ck_assert_msg(last_msg.msg.obs.obs[8].sid.code == 0, + "incorrect value for last_msg.msg.obs.obs[8].sid.code, " + "expected 0, is %d", + last_msg.msg.obs.obs[8].sid.code); + + ck_assert_msg(last_msg.msg.obs.obs[8].sid.sat == 31, + "incorrect value for last_msg.msg.obs.obs[8].sid.sat, " + "expected 31, is %d", + last_msg.msg.obs.obs[8].sid.sat); + + ck_assert_msg( + last_msg.msg.obs.obs[9].D.f == 62, + "incorrect value for last_msg.msg.obs.obs[9].D.f, expected 62, is %d", + last_msg.msg.obs.obs[9].D.f); + + ck_assert_msg( + last_msg.msg.obs.obs[9].D.i == 2374, + "incorrect value for last_msg.msg.obs.obs[9].D.i, expected 2374, is %d", + last_msg.msg.obs.obs[9].D.i); + + ck_assert_msg( + last_msg.msg.obs.obs[9].L.f == 40, + "incorrect value for last_msg.msg.obs.obs[9].L.f, expected 40, is %d", + last_msg.msg.obs.obs[9].L.f); + + ck_assert_msg(last_msg.msg.obs.obs[9].L.i == 103982040, + "incorrect value for last_msg.msg.obs.obs[9].L.i, expected " + "103982040, is %d", + last_msg.msg.obs.obs[9].L.i); + + ck_assert_msg(last_msg.msg.obs.obs[9].P == 1269673722, + "incorrect value for last_msg.msg.obs.obs[9].P, expected " + "1269673722, is %d", + last_msg.msg.obs.obs[9].P); + + ck_assert_msg( + last_msg.msg.obs.obs[9].cn0 == 120, + "incorrect value for last_msg.msg.obs.obs[9].cn0, expected 120, is %d", + last_msg.msg.obs.obs[9].cn0); + + ck_assert_msg( + last_msg.msg.obs.obs[9].flags == 11, + "incorrect value for last_msg.msg.obs.obs[9].flags, expected 11, is %d", + last_msg.msg.obs.obs[9].flags); + + ck_assert_msg( + last_msg.msg.obs.obs[9].lock == 3, + "incorrect value for last_msg.msg.obs.obs[9].lock, expected 3, is %d", + last_msg.msg.obs.obs[9].lock); + + ck_assert_msg(last_msg.msg.obs.obs[9].sid.code == 1, + "incorrect value for last_msg.msg.obs.obs[9].sid.code, " + "expected 1, is %d", + last_msg.msg.obs.obs[9].sid.code); + + ck_assert_msg(last_msg.msg.obs.obs[9].sid.sat == 31, + "incorrect value for last_msg.msg.obs.obs[9].sid.sat, " + "expected 31, is %d", + last_msg.msg.obs.obs[9].sid.sat); + + ck_assert_msg( + last_msg.msg.obs.obs[10].D.f == 96, + "incorrect value for last_msg.msg.obs.obs[10].D.f, expected 96, is %d", + last_msg.msg.obs.obs[10].D.f); + + ck_assert_msg(last_msg.msg.obs.obs[10].D.i == -3446, + "incorrect value for last_msg.msg.obs.obs[10].D.i, expected " + "-3446, is %d", + last_msg.msg.obs.obs[10].D.i); + + ck_assert_msg( + last_msg.msg.obs.obs[10].L.f == 7, + "incorrect value for last_msg.msg.obs.obs[10].L.f, expected 7, is %d", + last_msg.msg.obs.obs[10].L.f); + + ck_assert_msg(last_msg.msg.obs.obs[10].L.i == 118217315, + "incorrect value for last_msg.msg.obs.obs[10].L.i, expected " + "118217315, is %d", + last_msg.msg.obs.obs[10].L.i); + + ck_assert_msg(last_msg.msg.obs.obs[10].P == 1107693703, + "incorrect value for last_msg.msg.obs.obs[10].P, expected " + "1107693703, is %d", + last_msg.msg.obs.obs[10].P); + + ck_assert_msg( + last_msg.msg.obs.obs[10].cn0 == 176, + "incorrect value for last_msg.msg.obs.obs[10].cn0, expected 176, is %d", + last_msg.msg.obs.obs[10].cn0); + + ck_assert_msg(last_msg.msg.obs.obs[10].flags == 15, + "incorrect value for last_msg.msg.obs.obs[10].flags, " + "expected 15, is %d", + last_msg.msg.obs.obs[10].flags); + + ck_assert_msg( + last_msg.msg.obs.obs[10].lock == 10, + "incorrect value for last_msg.msg.obs.obs[10].lock, expected 10, is %d", + last_msg.msg.obs.obs[10].lock); + + ck_assert_msg(last_msg.msg.obs.obs[10].sid.code == 3, + "incorrect value for last_msg.msg.obs.obs[10].sid.code, " + "expected 3, is %d", + last_msg.msg.obs.obs[10].sid.code); + + ck_assert_msg(last_msg.msg.obs.obs[10].sid.sat == 2, + "incorrect value for last_msg.msg.obs.obs[10].sid.sat, " + "expected 2, is %d", + last_msg.msg.obs.obs[10].sid.sat); + + ck_assert_msg( + last_msg.msg.obs.obs[11].D.f == 96, + "incorrect value for last_msg.msg.obs.obs[11].D.f, expected 96, is %d", + last_msg.msg.obs.obs[11].D.f); + + ck_assert_msg(last_msg.msg.obs.obs[11].D.i == -1003, + "incorrect value for last_msg.msg.obs.obs[11].D.i, expected " + "-1003, is %d", + last_msg.msg.obs.obs[11].D.i); + + ck_assert_msg( + last_msg.msg.obs.obs[11].L.f == 203, + "incorrect value for last_msg.msg.obs.obs[11].L.f, expected 203, is %d", + last_msg.msg.obs.obs[11].L.f); + + ck_assert_msg(last_msg.msg.obs.obs[11].L.i == 104224985, + "incorrect value for last_msg.msg.obs.obs[11].L.i, expected " + "104224985, is %d", + last_msg.msg.obs.obs[11].L.i); + + ck_assert_msg(last_msg.msg.obs.obs[11].P == 973505172, + "incorrect value for last_msg.msg.obs.obs[11].P, expected " + "973505172, is %d", + last_msg.msg.obs.obs[11].P); + + ck_assert_msg( + last_msg.msg.obs.obs[11].cn0 == 170, + "incorrect value for last_msg.msg.obs.obs[11].cn0, expected 170, is %d", + last_msg.msg.obs.obs[11].cn0); + + ck_assert_msg(last_msg.msg.obs.obs[11].flags == 15, + "incorrect value for last_msg.msg.obs.obs[11].flags, " + "expected 15, is %d", + last_msg.msg.obs.obs[11].flags); + + ck_assert_msg( + last_msg.msg.obs.obs[11].lock == 10, + "incorrect value for last_msg.msg.obs.obs[11].lock, expected 10, is %d", + last_msg.msg.obs.obs[11].lock); + + ck_assert_msg(last_msg.msg.obs.obs[11].sid.code == 3, + "incorrect value for last_msg.msg.obs.obs[11].sid.code, " + "expected 3, is %d", + last_msg.msg.obs.obs[11].sid.code); + + ck_assert_msg(last_msg.msg.obs.obs[11].sid.sat == 3, + "incorrect value for last_msg.msg.obs.obs[11].sid.sat, " + "expected 3, is %d", + last_msg.msg.obs.obs[11].sid.sat); + + ck_assert_msg( + last_msg.msg.obs.obs[12].D.f == 219, + "incorrect value for last_msg.msg.obs.obs[12].D.f, expected 219, is %d", + last_msg.msg.obs.obs[12].D.f); + + ck_assert_msg(last_msg.msg.obs.obs[12].D.i == -3836, + "incorrect value for last_msg.msg.obs.obs[12].D.i, expected " + "-3836, is %d", + last_msg.msg.obs.obs[12].D.i); + + ck_assert_msg( + last_msg.msg.obs.obs[12].L.f == 80, + "incorrect value for last_msg.msg.obs.obs[12].L.f, expected 80, is %d", + last_msg.msg.obs.obs[12].L.f); + + ck_assert_msg(last_msg.msg.obs.obs[12].L.i == 114505343, + "incorrect value for last_msg.msg.obs.obs[12].L.i, expected " + "114505343, is %d", + last_msg.msg.obs.obs[12].L.i); + + ck_assert_msg(last_msg.msg.obs.obs[12].P == 1069903034, + "incorrect value for last_msg.msg.obs.obs[12].P, expected " + "1069903034, is %d", + last_msg.msg.obs.obs[12].P); + + ck_assert_msg( + last_msg.msg.obs.obs[12].cn0 == 200, + "incorrect value for last_msg.msg.obs.obs[12].cn0, expected 200, is %d", + last_msg.msg.obs.obs[12].cn0); + + ck_assert_msg(last_msg.msg.obs.obs[12].flags == 15, + "incorrect value for last_msg.msg.obs.obs[12].flags, " + "expected 15, is %d", + last_msg.msg.obs.obs[12].flags); + + ck_assert_msg( + last_msg.msg.obs.obs[12].lock == 10, + "incorrect value for last_msg.msg.obs.obs[12].lock, expected 10, is %d", + last_msg.msg.obs.obs[12].lock); + + ck_assert_msg(last_msg.msg.obs.obs[12].sid.code == 3, + "incorrect value for last_msg.msg.obs.obs[12].sid.code, " + "expected 3, is %d", + last_msg.msg.obs.obs[12].sid.code); + + ck_assert_msg(last_msg.msg.obs.obs[12].sid.sat == 17, + "incorrect value for last_msg.msg.obs.obs[12].sid.sat, " + "expected 17, is %d", + last_msg.msg.obs.obs[12].sid.sat); + + ck_assert_msg( + last_msg.msg.obs.obs[13].D.f == 182, + "incorrect value for last_msg.msg.obs.obs[13].D.f, expected 182, is %d", + last_msg.msg.obs.obs[13].D.f); + + ck_assert_msg(last_msg.msg.obs.obs[13].D.i == -461, + "incorrect value for last_msg.msg.obs.obs[13].D.i, expected " + "-461, is %d", + last_msg.msg.obs.obs[13].D.i); + + ck_assert_msg( + last_msg.msg.obs.obs[13].L.f == 105, + "incorrect value for last_msg.msg.obs.obs[13].L.f, expected 105, is %d", + last_msg.msg.obs.obs[13].L.f); + + ck_assert_msg(last_msg.msg.obs.obs[13].L.i == 102157331, + "incorrect value for last_msg.msg.obs.obs[13].L.i, expected " + "102157331, is %d", + last_msg.msg.obs.obs[13].L.i); + + ck_assert_msg(last_msg.msg.obs.obs[13].P == 956875687, + "incorrect value for last_msg.msg.obs.obs[13].P, expected " + "956875687, is %d", + last_msg.msg.obs.obs[13].P); + + ck_assert_msg( + last_msg.msg.obs.obs[13].cn0 == 152, + "incorrect value for last_msg.msg.obs.obs[13].cn0, expected 152, is %d", + last_msg.msg.obs.obs[13].cn0); + + ck_assert_msg(last_msg.msg.obs.obs[13].flags == 15, + "incorrect value for last_msg.msg.obs.obs[13].flags, " + "expected 15, is %d", + last_msg.msg.obs.obs[13].flags); + + ck_assert_msg( + last_msg.msg.obs.obs[13].lock == 10, + "incorrect value for last_msg.msg.obs.obs[13].lock, expected 10, is %d", + last_msg.msg.obs.obs[13].lock); + + ck_assert_msg(last_msg.msg.obs.obs[13].sid.code == 3, + "incorrect value for last_msg.msg.obs.obs[13].sid.code, " + "expected 3, is %d", + last_msg.msg.obs.obs[13].sid.code); + + ck_assert_msg(last_msg.msg.obs.obs[13].sid.sat == 18, + "incorrect value for last_msg.msg.obs.obs[13].sid.sat, " + "expected 18, is %d", + last_msg.msg.obs.obs[13].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -819,65 +1169,77 @@ START_TEST( test_auto_check_sbp_observation_MsgObs ) logging_reset(); - sbp_callback_register(&sbp_state, 0x4a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x4a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,74,0,129,240,11,152,202,226,25,0,0,0,0,106,8,16,201,101, }; + u8 encoded_frame[] = { + 85, 74, 0, 129, 240, 11, 152, 202, 226, 25, + 0, 0, 0, 0, 106, 8, 16, 201, 101, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs.header.n_obs = 16; - - + test_msg.obs.header.t.ns_residual = 0; - + test_msg.obs.header.t.tow = 434293400; - + test_msg.obs.header.t.wn = 2154; - sbp_message_send(&sbp_state, SbpMsgObs, 61569, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61569, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObs, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs.header.n_obs == 16, "incorrect value for last_msg.msg.obs.header.n_obs, expected 16, is %d", last_msg.msg.obs.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs.header.t.ns_residual == 0, "incorrect value for last_msg.msg.obs.header.t.ns_residual, expected 0, is %d", last_msg.msg.obs.header.t.ns_residual); - - ck_assert_msg(last_msg.msg.obs.header.t.tow == 434293400, "incorrect value for last_msg.msg.obs.header.t.tow, expected 434293400, is %d", last_msg.msg.obs.header.t.tow); - - ck_assert_msg(last_msg.msg.obs.header.t.wn == 2154, "incorrect value for last_msg.msg.obs.header.t.wn, expected 2154, is %d", last_msg.msg.obs.header.t.wn); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.obs.header.n_obs == 16, + "incorrect value for last_msg.msg.obs.header.n_obs, expected 16, is %d", + last_msg.msg.obs.header.n_obs); + + ck_assert_msg(last_msg.msg.obs.header.t.ns_residual == 0, + "incorrect value for last_msg.msg.obs.header.t.ns_residual, " + "expected 0, is %d", + last_msg.msg.obs.header.t.ns_residual); + + ck_assert_msg(last_msg.msg.obs.header.t.tow == 434293400, + "incorrect value for last_msg.msg.obs.header.t.tow, expected " + "434293400, is %d", + last_msg.msg.obs.header.t.tow); + ck_assert_msg(last_msg.msg.obs.header.t.wn == 2154, + "incorrect value for last_msg.msg.obs.header.t.wn, expected " + "2154, is %d", + last_msg.msg.obs.header.t.wn); } } END_TEST -Suite* auto_check_sbp_observation_MsgObs_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgObs"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgObs"); +Suite *auto_check_sbp_observation_MsgObs_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgObs"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_observation_MsgObs"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgObs); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgObsDepB.c b/c/test/auto_check_sbp_observation_MsgObsDepB.c index c305be41e..ee3df4f50 100644 --- a/c/test/auto_check_sbp_observation_MsgObsDepB.c +++ b/c/test/auto_check_sbp_observation_MsgObsDepB.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepB.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgObsDepB ) -{ +START_TEST(test_auto_check_sbp_observation_MsgObsDepB) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgObsDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,284 +90,422 @@ START_TEST( test_auto_check_sbp_observation_MsgObsDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x43, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x43, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,67,0,246,215,103,120,46,39,0,251,6,32,180,175,187,133,223,53,7,7,27,157,0,0,202,0,0,0,58,140,85,147,88,28,190,7,175,144,0,0,203,0,0,0,220,140,248,138,208,172,77,7,135,151,0,0,208,0,0,0,173,194,72,135,115,18,28,7,242,156,0,0,212,0,0,0,164,144,105,124,18,196,137,6,120,168,0,0,217,0,0,0,30,232,228,139,210,7,90,7,87,150,0,0,218,0,0,0,169,85, }; + u8 encoded_frame[] = { + 85, 67, 0, 246, 215, 103, 120, 46, 39, 0, 251, 6, 32, 180, + 175, 187, 133, 223, 53, 7, 7, 27, 157, 0, 0, 202, 0, 0, + 0, 58, 140, 85, 147, 88, 28, 190, 7, 175, 144, 0, 0, 203, + 0, 0, 0, 220, 140, 248, 138, 208, 172, 77, 7, 135, 151, 0, + 0, 208, 0, 0, 0, 173, 194, 72, 135, 115, 18, 28, 7, 242, + 156, 0, 0, 212, 0, 0, 0, 164, 144, 105, 124, 18, 196, 137, + 6, 120, 168, 0, 0, 217, 0, 0, 0, 30, 232, 228, 139, 210, + 7, 90, 7, 87, 150, 0, 0, 218, 0, 0, 0, 169, 85, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_b.header.n_obs = 32; - - + test_msg.obs_dep_b.header.t.tow = 2567800; - + test_msg.obs_dep_b.header.t.wn = 1787; - + test_msg.obs_dep_b.n_obs = 6; - - - - + test_msg.obs_dep_b.obs[0].L.f = 27; - + test_msg.obs_dep_b.obs[0].L.i = 117913055; - + test_msg.obs_dep_b.obs[0].P = 2243669940; - + test_msg.obs_dep_b.obs[0].cn0 = 157; - + test_msg.obs_dep_b.obs[0].lock = 0; - - + test_msg.obs_dep_b.obs[0].sid.code = 0; - + test_msg.obs_dep_b.obs[0].sid.reserved = 0; - + test_msg.obs_dep_b.obs[0].sid.sat = 202; - - - + test_msg.obs_dep_b.obs[1].L.f = 175; - + test_msg.obs_dep_b.obs[1].L.i = 129899608; - + test_msg.obs_dep_b.obs[1].P = 2471857210; - + test_msg.obs_dep_b.obs[1].cn0 = 144; - + test_msg.obs_dep_b.obs[1].lock = 0; - - + test_msg.obs_dep_b.obs[1].sid.code = 0; - + test_msg.obs_dep_b.obs[1].sid.reserved = 0; - + test_msg.obs_dep_b.obs[1].sid.sat = 203; - - - + test_msg.obs_dep_b.obs[2].L.f = 135; - + test_msg.obs_dep_b.obs[2].L.i = 122531024; - + test_msg.obs_dep_b.obs[2].P = 2331544796; - + test_msg.obs_dep_b.obs[2].cn0 = 151; - + test_msg.obs_dep_b.obs[2].lock = 0; - - + test_msg.obs_dep_b.obs[2].sid.code = 0; - + test_msg.obs_dep_b.obs[2].sid.reserved = 0; - + test_msg.obs_dep_b.obs[2].sid.sat = 208; - - - + test_msg.obs_dep_b.obs[3].L.f = 242; - + test_msg.obs_dep_b.obs[3].L.i = 119280243; - + test_msg.obs_dep_b.obs[3].P = 2269692589; - + test_msg.obs_dep_b.obs[3].cn0 = 156; - + test_msg.obs_dep_b.obs[3].lock = 0; - - + test_msg.obs_dep_b.obs[3].sid.code = 0; - + test_msg.obs_dep_b.obs[3].sid.reserved = 0; - + test_msg.obs_dep_b.obs[3].sid.sat = 212; - - - + test_msg.obs_dep_b.obs[4].L.f = 120; - + test_msg.obs_dep_b.obs[4].L.i = 109691922; - + test_msg.obs_dep_b.obs[4].P = 2087293092; - + test_msg.obs_dep_b.obs[4].cn0 = 168; - + test_msg.obs_dep_b.obs[4].lock = 0; - - + test_msg.obs_dep_b.obs[4].sid.code = 0; - + test_msg.obs_dep_b.obs[4].sid.reserved = 0; - + test_msg.obs_dep_b.obs[4].sid.sat = 217; - - - + test_msg.obs_dep_b.obs[5].L.f = 87; - + test_msg.obs_dep_b.obs[5].L.i = 123340754; - + test_msg.obs_dep_b.obs[5].P = 2347034654; - + test_msg.obs_dep_b.obs[5].cn0 = 150; - + test_msg.obs_dep_b.obs[5].lock = 0; - - + test_msg.obs_dep_b.obs[5].sid.code = 0; - + test_msg.obs_dep_b.obs[5].sid.reserved = 0; - + test_msg.obs_dep_b.obs[5].sid.sat = 218; sbp_message_send(&sbp_state, SbpMsgObsDepB, 55286, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepB, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_b.header.n_obs == 32, "incorrect value for last_msg.msg.obs_dep_b.header.n_obs, expected 32, is %d", last_msg.msg.obs_dep_b.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_b.header.t.tow == 2567800, "incorrect value for last_msg.msg.obs_dep_b.header.t.tow, expected 2567800, is %d", last_msg.msg.obs_dep_b.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_b.header.t.wn == 1787, "incorrect value for last_msg.msg.obs_dep_b.header.t.wn, expected 1787, is %d", last_msg.msg.obs_dep_b.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_b.n_obs == 6, "incorrect value for last_msg.msg.obs_dep_b.n_obs, expected 6, is %d", last_msg.msg.obs_dep_b.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.f == 27, "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.f, expected 27, is %d", last_msg.msg.obs_dep_b.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.i == 117913055, "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.i, expected 117913055, is %d", last_msg.msg.obs_dep_b.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].P == 2243669940, "incorrect value for last_msg.msg.obs_dep_b.obs[0].P, expected 2243669940, is %d", last_msg.msg.obs_dep_b.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].cn0 == 157, "incorrect value for last_msg.msg.obs_dep_b.obs[0].cn0, expected 157, is %d", last_msg.msg.obs_dep_b.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[0].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[0].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[0].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[0].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.sat == 202, "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.sat, expected 202, is %d", last_msg.msg.obs_dep_b.obs[0].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.f == 175, "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.f, expected 175, is %d", last_msg.msg.obs_dep_b.obs[1].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.i == 129899608, "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.i, expected 129899608, is %d", last_msg.msg.obs_dep_b.obs[1].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].P == 2471857210, "incorrect value for last_msg.msg.obs_dep_b.obs[1].P, expected 2471857210, is %d", last_msg.msg.obs_dep_b.obs[1].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].cn0 == 144, "incorrect value for last_msg.msg.obs_dep_b.obs[1].cn0, expected 144, is %d", last_msg.msg.obs_dep_b.obs[1].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[1].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[1].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[1].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[1].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.sat == 203, "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.sat, expected 203, is %d", last_msg.msg.obs_dep_b.obs[1].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.f == 135, "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.f, expected 135, is %d", last_msg.msg.obs_dep_b.obs[2].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.i == 122531024, "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.i, expected 122531024, is %d", last_msg.msg.obs_dep_b.obs[2].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].P == 2331544796, "incorrect value for last_msg.msg.obs_dep_b.obs[2].P, expected 2331544796, is %d", last_msg.msg.obs_dep_b.obs[2].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].cn0 == 151, "incorrect value for last_msg.msg.obs_dep_b.obs[2].cn0, expected 151, is %d", last_msg.msg.obs_dep_b.obs[2].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[2].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[2].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[2].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[2].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.sat == 208, "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.sat, expected 208, is %d", last_msg.msg.obs_dep_b.obs[2].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].L.f == 242, "incorrect value for last_msg.msg.obs_dep_b.obs[3].L.f, expected 242, is %d", last_msg.msg.obs_dep_b.obs[3].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].L.i == 119280243, "incorrect value for last_msg.msg.obs_dep_b.obs[3].L.i, expected 119280243, is %d", last_msg.msg.obs_dep_b.obs[3].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].P == 2269692589, "incorrect value for last_msg.msg.obs_dep_b.obs[3].P, expected 2269692589, is %d", last_msg.msg.obs_dep_b.obs[3].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].cn0 == 156, "incorrect value for last_msg.msg.obs_dep_b.obs[3].cn0, expected 156, is %d", last_msg.msg.obs_dep_b.obs[3].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[3].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[3].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[3].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[3].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].sid.sat == 212, "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.sat, expected 212, is %d", last_msg.msg.obs_dep_b.obs[3].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].L.f == 120, "incorrect value for last_msg.msg.obs_dep_b.obs[4].L.f, expected 120, is %d", last_msg.msg.obs_dep_b.obs[4].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].L.i == 109691922, "incorrect value for last_msg.msg.obs_dep_b.obs[4].L.i, expected 109691922, is %d", last_msg.msg.obs_dep_b.obs[4].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].P == 2087293092, "incorrect value for last_msg.msg.obs_dep_b.obs[4].P, expected 2087293092, is %d", last_msg.msg.obs_dep_b.obs[4].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].cn0 == 168, "incorrect value for last_msg.msg.obs_dep_b.obs[4].cn0, expected 168, is %d", last_msg.msg.obs_dep_b.obs[4].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[4].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[4].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[4].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[4].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].sid.sat == 217, "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.sat, expected 217, is %d", last_msg.msg.obs_dep_b.obs[4].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].L.f == 87, "incorrect value for last_msg.msg.obs_dep_b.obs[5].L.f, expected 87, is %d", last_msg.msg.obs_dep_b.obs[5].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].L.i == 123340754, "incorrect value for last_msg.msg.obs_dep_b.obs[5].L.i, expected 123340754, is %d", last_msg.msg.obs_dep_b.obs[5].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].P == 2347034654, "incorrect value for last_msg.msg.obs_dep_b.obs[5].P, expected 2347034654, is %d", last_msg.msg.obs_dep_b.obs[5].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].cn0 == 150, "incorrect value for last_msg.msg.obs_dep_b.obs[5].cn0, expected 150, is %d", last_msg.msg.obs_dep_b.obs[5].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[5].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[5].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[5].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[5].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].sid.sat == 218, "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.sat, expected 218, is %d", last_msg.msg.obs_dep_b.obs[5].sid.sat); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_b.header.n_obs == 32, + "incorrect value for last_msg.msg.obs_dep_b.header.n_obs, " + "expected 32, is %d", + last_msg.msg.obs_dep_b.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_b.header.t.tow == 2567800, + "incorrect value for last_msg.msg.obs_dep_b.header.t.tow, " + "expected 2567800, is %d", + last_msg.msg.obs_dep_b.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_b.header.t.wn == 1787, + "incorrect value for last_msg.msg.obs_dep_b.header.t.wn, " + "expected 1787, is %d", + last_msg.msg.obs_dep_b.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_b.n_obs == 6, + "incorrect value for last_msg.msg.obs_dep_b.n_obs, expected 6, is %d", + last_msg.msg.obs_dep_b.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.f == 27, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.f, " + "expected 27, is %d", + last_msg.msg.obs_dep_b.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.i == 117913055, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.i, " + "expected 117913055, is %d", + last_msg.msg.obs_dep_b.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].P == 2243669940, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].P, " + "expected 2243669940, is %d", + last_msg.msg.obs_dep_b.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].cn0 == 157, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].cn0, " + "expected 157, is %d", + last_msg.msg.obs_dep_b.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[0].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[0].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[0].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.sat == 202, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.sat, " + "expected 202, is %d", + last_msg.msg.obs_dep_b.obs[0].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.f == 175, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.f, " + "expected 175, is %d", + last_msg.msg.obs_dep_b.obs[1].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.i == 129899608, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.i, " + "expected 129899608, is %d", + last_msg.msg.obs_dep_b.obs[1].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].P == 2471857210, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].P, " + "expected 2471857210, is %d", + last_msg.msg.obs_dep_b.obs[1].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].cn0 == 144, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].cn0, " + "expected 144, is %d", + last_msg.msg.obs_dep_b.obs[1].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[1].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[1].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[1].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[1].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.sat == 203, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.sat, " + "expected 203, is %d", + last_msg.msg.obs_dep_b.obs[1].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.f == 135, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.f, " + "expected 135, is %d", + last_msg.msg.obs_dep_b.obs[2].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.i == 122531024, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.i, " + "expected 122531024, is %d", + last_msg.msg.obs_dep_b.obs[2].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].P == 2331544796, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].P, " + "expected 2331544796, is %d", + last_msg.msg.obs_dep_b.obs[2].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].cn0 == 151, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].cn0, " + "expected 151, is %d", + last_msg.msg.obs_dep_b.obs[2].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[2].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[2].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[2].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[2].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.sat == 208, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.sat, " + "expected 208, is %d", + last_msg.msg.obs_dep_b.obs[2].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].L.f == 242, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].L.f, " + "expected 242, is %d", + last_msg.msg.obs_dep_b.obs[3].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].L.i == 119280243, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].L.i, " + "expected 119280243, is %d", + last_msg.msg.obs_dep_b.obs[3].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].P == 2269692589, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].P, " + "expected 2269692589, is %d", + last_msg.msg.obs_dep_b.obs[3].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].cn0 == 156, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].cn0, " + "expected 156, is %d", + last_msg.msg.obs_dep_b.obs[3].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[3].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[3].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[3].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[3].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].sid.sat == 212, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.sat, " + "expected 212, is %d", + last_msg.msg.obs_dep_b.obs[3].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].L.f == 120, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].L.f, " + "expected 120, is %d", + last_msg.msg.obs_dep_b.obs[4].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].L.i == 109691922, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].L.i, " + "expected 109691922, is %d", + last_msg.msg.obs_dep_b.obs[4].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].P == 2087293092, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].P, " + "expected 2087293092, is %d", + last_msg.msg.obs_dep_b.obs[4].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].cn0 == 168, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].cn0, " + "expected 168, is %d", + last_msg.msg.obs_dep_b.obs[4].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[4].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[4].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[4].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[4].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].sid.sat == 217, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.sat, " + "expected 217, is %d", + last_msg.msg.obs_dep_b.obs[4].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].L.f == 87, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].L.f, " + "expected 87, is %d", + last_msg.msg.obs_dep_b.obs[5].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].L.i == 123340754, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].L.i, " + "expected 123340754, is %d", + last_msg.msg.obs_dep_b.obs[5].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].P == 2347034654, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].P, " + "expected 2347034654, is %d", + last_msg.msg.obs_dep_b.obs[5].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].cn0 == 150, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].cn0, " + "expected 150, is %d", + last_msg.msg.obs_dep_b.obs[5].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[5].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[5].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[5].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[5].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].sid.sat == 218, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.sat, " + "expected 218, is %d", + last_msg.msg.obs_dep_b.obs[5].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -379,173 +513,248 @@ START_TEST( test_auto_check_sbp_observation_MsgObsDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x43, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x43, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,67,0,246,215,55,120,46,39,0,251,6,33,68,199,101,136,133,247,42,7,219,154,0,0,220,0,0,0,219,14,123,133,96,215,3,7,235,156,0,0,222,0,0,0,87,166,81,122,5,173,109,6,174,170,0,0,225,0,0,0,11,233, }; + u8 encoded_frame[] = { + 85, 67, 0, 246, 215, 55, 120, 46, 39, 0, 251, 6, 33, + 68, 199, 101, 136, 133, 247, 42, 7, 219, 154, 0, 0, 220, + 0, 0, 0, 219, 14, 123, 133, 96, 215, 3, 7, 235, 156, + 0, 0, 222, 0, 0, 0, 87, 166, 81, 122, 5, 173, 109, + 6, 174, 170, 0, 0, 225, 0, 0, 0, 11, 233, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_b.header.n_obs = 33; - - + test_msg.obs_dep_b.header.t.tow = 2567800; - + test_msg.obs_dep_b.header.t.wn = 1787; - + test_msg.obs_dep_b.n_obs = 3; - - - - + test_msg.obs_dep_b.obs[0].L.f = 219; - + test_msg.obs_dep_b.obs[0].L.i = 120256389; - + test_msg.obs_dep_b.obs[0].P = 2288371524; - + test_msg.obs_dep_b.obs[0].cn0 = 154; - + test_msg.obs_dep_b.obs[0].lock = 0; - - + test_msg.obs_dep_b.obs[0].sid.code = 0; - + test_msg.obs_dep_b.obs[0].sid.reserved = 0; - + test_msg.obs_dep_b.obs[0].sid.sat = 220; - - - + test_msg.obs_dep_b.obs[1].L.f = 235; - + test_msg.obs_dep_b.obs[1].L.i = 117692256; - + test_msg.obs_dep_b.obs[1].P = 2239434459; - + test_msg.obs_dep_b.obs[1].cn0 = 156; - + test_msg.obs_dep_b.obs[1].lock = 0; - - + test_msg.obs_dep_b.obs[1].sid.code = 0; - + test_msg.obs_dep_b.obs[1].sid.reserved = 0; - + test_msg.obs_dep_b.obs[1].sid.sat = 222; - - - + test_msg.obs_dep_b.obs[2].L.f = 174; - + test_msg.obs_dep_b.obs[2].L.i = 107851013; - + test_msg.obs_dep_b.obs[2].P = 2052171351; - + test_msg.obs_dep_b.obs[2].cn0 = 170; - + test_msg.obs_dep_b.obs[2].lock = 0; - - + test_msg.obs_dep_b.obs[2].sid.code = 0; - + test_msg.obs_dep_b.obs[2].sid.reserved = 0; - + test_msg.obs_dep_b.obs[2].sid.sat = 225; sbp_message_send(&sbp_state, SbpMsgObsDepB, 55286, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepB, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_b.header.n_obs == 33, "incorrect value for last_msg.msg.obs_dep_b.header.n_obs, expected 33, is %d", last_msg.msg.obs_dep_b.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_b.header.t.tow == 2567800, "incorrect value for last_msg.msg.obs_dep_b.header.t.tow, expected 2567800, is %d", last_msg.msg.obs_dep_b.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_b.header.t.wn == 1787, "incorrect value for last_msg.msg.obs_dep_b.header.t.wn, expected 1787, is %d", last_msg.msg.obs_dep_b.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_b.n_obs == 3, "incorrect value for last_msg.msg.obs_dep_b.n_obs, expected 3, is %d", last_msg.msg.obs_dep_b.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.f == 219, "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.f, expected 219, is %d", last_msg.msg.obs_dep_b.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.i == 120256389, "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.i, expected 120256389, is %d", last_msg.msg.obs_dep_b.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].P == 2288371524, "incorrect value for last_msg.msg.obs_dep_b.obs[0].P, expected 2288371524, is %d", last_msg.msg.obs_dep_b.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].cn0 == 154, "incorrect value for last_msg.msg.obs_dep_b.obs[0].cn0, expected 154, is %d", last_msg.msg.obs_dep_b.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[0].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[0].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[0].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[0].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.sat == 220, "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.sat, expected 220, is %d", last_msg.msg.obs_dep_b.obs[0].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.f == 235, "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.f, expected 235, is %d", last_msg.msg.obs_dep_b.obs[1].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.i == 117692256, "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.i, expected 117692256, is %d", last_msg.msg.obs_dep_b.obs[1].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].P == 2239434459, "incorrect value for last_msg.msg.obs_dep_b.obs[1].P, expected 2239434459, is %d", last_msg.msg.obs_dep_b.obs[1].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].cn0 == 156, "incorrect value for last_msg.msg.obs_dep_b.obs[1].cn0, expected 156, is %d", last_msg.msg.obs_dep_b.obs[1].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[1].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[1].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[1].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[1].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.sat == 222, "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.sat, expected 222, is %d", last_msg.msg.obs_dep_b.obs[1].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.f == 174, "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.f, expected 174, is %d", last_msg.msg.obs_dep_b.obs[2].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.i == 107851013, "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.i, expected 107851013, is %d", last_msg.msg.obs_dep_b.obs[2].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].P == 2052171351, "incorrect value for last_msg.msg.obs_dep_b.obs[2].P, expected 2052171351, is %d", last_msg.msg.obs_dep_b.obs[2].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].cn0 == 170, "incorrect value for last_msg.msg.obs_dep_b.obs[2].cn0, expected 170, is %d", last_msg.msg.obs_dep_b.obs[2].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[2].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[2].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[2].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[2].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.sat == 225, "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.sat, expected 225, is %d", last_msg.msg.obs_dep_b.obs[2].sid.sat); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_b.header.n_obs == 33, + "incorrect value for last_msg.msg.obs_dep_b.header.n_obs, " + "expected 33, is %d", + last_msg.msg.obs_dep_b.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_b.header.t.tow == 2567800, + "incorrect value for last_msg.msg.obs_dep_b.header.t.tow, " + "expected 2567800, is %d", + last_msg.msg.obs_dep_b.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_b.header.t.wn == 1787, + "incorrect value for last_msg.msg.obs_dep_b.header.t.wn, " + "expected 1787, is %d", + last_msg.msg.obs_dep_b.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_b.n_obs == 3, + "incorrect value for last_msg.msg.obs_dep_b.n_obs, expected 3, is %d", + last_msg.msg.obs_dep_b.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.f == 219, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.f, " + "expected 219, is %d", + last_msg.msg.obs_dep_b.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.i == 120256389, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.i, " + "expected 120256389, is %d", + last_msg.msg.obs_dep_b.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].P == 2288371524, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].P, " + "expected 2288371524, is %d", + last_msg.msg.obs_dep_b.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].cn0 == 154, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].cn0, " + "expected 154, is %d", + last_msg.msg.obs_dep_b.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[0].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[0].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[0].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.sat == 220, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.sat, " + "expected 220, is %d", + last_msg.msg.obs_dep_b.obs[0].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.f == 235, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.f, " + "expected 235, is %d", + last_msg.msg.obs_dep_b.obs[1].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.i == 117692256, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.i, " + "expected 117692256, is %d", + last_msg.msg.obs_dep_b.obs[1].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].P == 2239434459, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].P, " + "expected 2239434459, is %d", + last_msg.msg.obs_dep_b.obs[1].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].cn0 == 156, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].cn0, " + "expected 156, is %d", + last_msg.msg.obs_dep_b.obs[1].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[1].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[1].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[1].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[1].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.sat == 222, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.sat, " + "expected 222, is %d", + last_msg.msg.obs_dep_b.obs[1].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.f == 174, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.f, " + "expected 174, is %d", + last_msg.msg.obs_dep_b.obs[2].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.i == 107851013, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.i, " + "expected 107851013, is %d", + last_msg.msg.obs_dep_b.obs[2].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].P == 2052171351, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].P, " + "expected 2052171351, is %d", + last_msg.msg.obs_dep_b.obs[2].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].cn0 == 170, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].cn0, " + "expected 170, is %d", + last_msg.msg.obs_dep_b.obs[2].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[2].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[2].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[2].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[2].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.sat == 225, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.sat, " + "expected 225, is %d", + last_msg.msg.obs_dep_b.obs[2].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -553,284 +762,422 @@ START_TEST( test_auto_check_sbp_observation_MsgObsDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x43, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x43, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,67,0,246,215,103,64,47,39,0,251,6,32,100,132,187,133,236,51,7,7,94,156,0,0,202,0,0,0,97,184,85,147,178,30,190,7,40,140,0,0,203,0,0,0,135,111,248,138,90,171,77,7,2,150,0,0,208,0,0,0,180,238,72,135,190,20,28,7,241,155,0,0,212,0,0,0,15,153,105,124,92,196,137,6,153,168,0,0,217,0,0,0,49,185,228,139,144,5,90,7,41,150,0,0,218,0,0,0,241,98, }; + u8 encoded_frame[] = { + 85, 67, 0, 246, 215, 103, 64, 47, 39, 0, 251, 6, 32, 100, + 132, 187, 133, 236, 51, 7, 7, 94, 156, 0, 0, 202, 0, 0, + 0, 97, 184, 85, 147, 178, 30, 190, 7, 40, 140, 0, 0, 203, + 0, 0, 0, 135, 111, 248, 138, 90, 171, 77, 7, 2, 150, 0, + 0, 208, 0, 0, 0, 180, 238, 72, 135, 190, 20, 28, 7, 241, + 155, 0, 0, 212, 0, 0, 0, 15, 153, 105, 124, 92, 196, 137, + 6, 153, 168, 0, 0, 217, 0, 0, 0, 49, 185, 228, 139, 144, + 5, 90, 7, 41, 150, 0, 0, 218, 0, 0, 0, 241, 98, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_b.header.n_obs = 32; - - + test_msg.obs_dep_b.header.t.tow = 2568000; - + test_msg.obs_dep_b.header.t.wn = 1787; - + test_msg.obs_dep_b.n_obs = 6; - - - - + test_msg.obs_dep_b.obs[0].L.f = 94; - + test_msg.obs_dep_b.obs[0].L.i = 117912556; - + test_msg.obs_dep_b.obs[0].P = 2243658852; - + test_msg.obs_dep_b.obs[0].cn0 = 156; - + test_msg.obs_dep_b.obs[0].lock = 0; - - + test_msg.obs_dep_b.obs[0].sid.code = 0; - + test_msg.obs_dep_b.obs[0].sid.reserved = 0; - + test_msg.obs_dep_b.obs[0].sid.sat = 202; - - - + test_msg.obs_dep_b.obs[1].L.f = 40; - + test_msg.obs_dep_b.obs[1].L.i = 129900210; - + test_msg.obs_dep_b.obs[1].P = 2471868513; - + test_msg.obs_dep_b.obs[1].cn0 = 140; - + test_msg.obs_dep_b.obs[1].lock = 0; - - + test_msg.obs_dep_b.obs[1].sid.code = 0; - + test_msg.obs_dep_b.obs[1].sid.reserved = 0; - + test_msg.obs_dep_b.obs[1].sid.sat = 203; - - - + test_msg.obs_dep_b.obs[2].L.f = 2; - + test_msg.obs_dep_b.obs[2].L.i = 122530650; - + test_msg.obs_dep_b.obs[2].P = 2331537287; - + test_msg.obs_dep_b.obs[2].cn0 = 150; - + test_msg.obs_dep_b.obs[2].lock = 0; - - + test_msg.obs_dep_b.obs[2].sid.code = 0; - + test_msg.obs_dep_b.obs[2].sid.reserved = 0; - + test_msg.obs_dep_b.obs[2].sid.sat = 208; - - - + test_msg.obs_dep_b.obs[3].L.f = 241; - + test_msg.obs_dep_b.obs[3].L.i = 119280830; - + test_msg.obs_dep_b.obs[3].P = 2269703860; - + test_msg.obs_dep_b.obs[3].cn0 = 155; - + test_msg.obs_dep_b.obs[3].lock = 0; - - + test_msg.obs_dep_b.obs[3].sid.code = 0; - + test_msg.obs_dep_b.obs[3].sid.reserved = 0; - + test_msg.obs_dep_b.obs[3].sid.sat = 212; - - - + test_msg.obs_dep_b.obs[4].L.f = 153; - + test_msg.obs_dep_b.obs[4].L.i = 109691996; - + test_msg.obs_dep_b.obs[4].P = 2087295247; - + test_msg.obs_dep_b.obs[4].cn0 = 168; - + test_msg.obs_dep_b.obs[4].lock = 0; - - + test_msg.obs_dep_b.obs[4].sid.code = 0; - + test_msg.obs_dep_b.obs[4].sid.reserved = 0; - + test_msg.obs_dep_b.obs[4].sid.sat = 217; - - - + test_msg.obs_dep_b.obs[5].L.f = 41; - + test_msg.obs_dep_b.obs[5].L.i = 123340176; - + test_msg.obs_dep_b.obs[5].P = 2347022641; - + test_msg.obs_dep_b.obs[5].cn0 = 150; - + test_msg.obs_dep_b.obs[5].lock = 0; - - + test_msg.obs_dep_b.obs[5].sid.code = 0; - + test_msg.obs_dep_b.obs[5].sid.reserved = 0; - + test_msg.obs_dep_b.obs[5].sid.sat = 218; sbp_message_send(&sbp_state, SbpMsgObsDepB, 55286, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepB, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_b.header.n_obs == 32, "incorrect value for last_msg.msg.obs_dep_b.header.n_obs, expected 32, is %d", last_msg.msg.obs_dep_b.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_b.header.t.tow == 2568000, "incorrect value for last_msg.msg.obs_dep_b.header.t.tow, expected 2568000, is %d", last_msg.msg.obs_dep_b.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_b.header.t.wn == 1787, "incorrect value for last_msg.msg.obs_dep_b.header.t.wn, expected 1787, is %d", last_msg.msg.obs_dep_b.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_b.n_obs == 6, "incorrect value for last_msg.msg.obs_dep_b.n_obs, expected 6, is %d", last_msg.msg.obs_dep_b.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.f == 94, "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.f, expected 94, is %d", last_msg.msg.obs_dep_b.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.i == 117912556, "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.i, expected 117912556, is %d", last_msg.msg.obs_dep_b.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].P == 2243658852, "incorrect value for last_msg.msg.obs_dep_b.obs[0].P, expected 2243658852, is %d", last_msg.msg.obs_dep_b.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].cn0 == 156, "incorrect value for last_msg.msg.obs_dep_b.obs[0].cn0, expected 156, is %d", last_msg.msg.obs_dep_b.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[0].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[0].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[0].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[0].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.sat == 202, "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.sat, expected 202, is %d", last_msg.msg.obs_dep_b.obs[0].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.f == 40, "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.f, expected 40, is %d", last_msg.msg.obs_dep_b.obs[1].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.i == 129900210, "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.i, expected 129900210, is %d", last_msg.msg.obs_dep_b.obs[1].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].P == 2471868513, "incorrect value for last_msg.msg.obs_dep_b.obs[1].P, expected 2471868513, is %d", last_msg.msg.obs_dep_b.obs[1].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].cn0 == 140, "incorrect value for last_msg.msg.obs_dep_b.obs[1].cn0, expected 140, is %d", last_msg.msg.obs_dep_b.obs[1].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[1].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[1].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[1].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[1].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.sat == 203, "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.sat, expected 203, is %d", last_msg.msg.obs_dep_b.obs[1].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.f == 2, "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.f, expected 2, is %d", last_msg.msg.obs_dep_b.obs[2].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.i == 122530650, "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.i, expected 122530650, is %d", last_msg.msg.obs_dep_b.obs[2].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].P == 2331537287, "incorrect value for last_msg.msg.obs_dep_b.obs[2].P, expected 2331537287, is %d", last_msg.msg.obs_dep_b.obs[2].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].cn0 == 150, "incorrect value for last_msg.msg.obs_dep_b.obs[2].cn0, expected 150, is %d", last_msg.msg.obs_dep_b.obs[2].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[2].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[2].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[2].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[2].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.sat == 208, "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.sat, expected 208, is %d", last_msg.msg.obs_dep_b.obs[2].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].L.f == 241, "incorrect value for last_msg.msg.obs_dep_b.obs[3].L.f, expected 241, is %d", last_msg.msg.obs_dep_b.obs[3].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].L.i == 119280830, "incorrect value for last_msg.msg.obs_dep_b.obs[3].L.i, expected 119280830, is %d", last_msg.msg.obs_dep_b.obs[3].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].P == 2269703860, "incorrect value for last_msg.msg.obs_dep_b.obs[3].P, expected 2269703860, is %d", last_msg.msg.obs_dep_b.obs[3].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].cn0 == 155, "incorrect value for last_msg.msg.obs_dep_b.obs[3].cn0, expected 155, is %d", last_msg.msg.obs_dep_b.obs[3].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[3].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[3].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[3].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[3].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].sid.sat == 212, "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.sat, expected 212, is %d", last_msg.msg.obs_dep_b.obs[3].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].L.f == 153, "incorrect value for last_msg.msg.obs_dep_b.obs[4].L.f, expected 153, is %d", last_msg.msg.obs_dep_b.obs[4].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].L.i == 109691996, "incorrect value for last_msg.msg.obs_dep_b.obs[4].L.i, expected 109691996, is %d", last_msg.msg.obs_dep_b.obs[4].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].P == 2087295247, "incorrect value for last_msg.msg.obs_dep_b.obs[4].P, expected 2087295247, is %d", last_msg.msg.obs_dep_b.obs[4].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].cn0 == 168, "incorrect value for last_msg.msg.obs_dep_b.obs[4].cn0, expected 168, is %d", last_msg.msg.obs_dep_b.obs[4].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[4].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[4].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[4].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[4].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].sid.sat == 217, "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.sat, expected 217, is %d", last_msg.msg.obs_dep_b.obs[4].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].L.f == 41, "incorrect value for last_msg.msg.obs_dep_b.obs[5].L.f, expected 41, is %d", last_msg.msg.obs_dep_b.obs[5].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].L.i == 123340176, "incorrect value for last_msg.msg.obs_dep_b.obs[5].L.i, expected 123340176, is %d", last_msg.msg.obs_dep_b.obs[5].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].P == 2347022641, "incorrect value for last_msg.msg.obs_dep_b.obs[5].P, expected 2347022641, is %d", last_msg.msg.obs_dep_b.obs[5].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].cn0 == 150, "incorrect value for last_msg.msg.obs_dep_b.obs[5].cn0, expected 150, is %d", last_msg.msg.obs_dep_b.obs[5].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[5].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[5].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[5].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[5].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].sid.sat == 218, "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.sat, expected 218, is %d", last_msg.msg.obs_dep_b.obs[5].sid.sat); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_b.header.n_obs == 32, + "incorrect value for last_msg.msg.obs_dep_b.header.n_obs, " + "expected 32, is %d", + last_msg.msg.obs_dep_b.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_b.header.t.tow == 2568000, + "incorrect value for last_msg.msg.obs_dep_b.header.t.tow, " + "expected 2568000, is %d", + last_msg.msg.obs_dep_b.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_b.header.t.wn == 1787, + "incorrect value for last_msg.msg.obs_dep_b.header.t.wn, " + "expected 1787, is %d", + last_msg.msg.obs_dep_b.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_b.n_obs == 6, + "incorrect value for last_msg.msg.obs_dep_b.n_obs, expected 6, is %d", + last_msg.msg.obs_dep_b.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.f == 94, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.f, " + "expected 94, is %d", + last_msg.msg.obs_dep_b.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.i == 117912556, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.i, " + "expected 117912556, is %d", + last_msg.msg.obs_dep_b.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].P == 2243658852, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].P, " + "expected 2243658852, is %d", + last_msg.msg.obs_dep_b.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].cn0 == 156, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].cn0, " + "expected 156, is %d", + last_msg.msg.obs_dep_b.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[0].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[0].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[0].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.sat == 202, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.sat, " + "expected 202, is %d", + last_msg.msg.obs_dep_b.obs[0].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.f == 40, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.f, " + "expected 40, is %d", + last_msg.msg.obs_dep_b.obs[1].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.i == 129900210, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.i, " + "expected 129900210, is %d", + last_msg.msg.obs_dep_b.obs[1].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].P == 2471868513, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].P, " + "expected 2471868513, is %d", + last_msg.msg.obs_dep_b.obs[1].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].cn0 == 140, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].cn0, " + "expected 140, is %d", + last_msg.msg.obs_dep_b.obs[1].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[1].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[1].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[1].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[1].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.sat == 203, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.sat, " + "expected 203, is %d", + last_msg.msg.obs_dep_b.obs[1].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.f == 2, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.f, " + "expected 2, is %d", + last_msg.msg.obs_dep_b.obs[2].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.i == 122530650, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.i, " + "expected 122530650, is %d", + last_msg.msg.obs_dep_b.obs[2].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].P == 2331537287, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].P, " + "expected 2331537287, is %d", + last_msg.msg.obs_dep_b.obs[2].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].cn0 == 150, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].cn0, " + "expected 150, is %d", + last_msg.msg.obs_dep_b.obs[2].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[2].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[2].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[2].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[2].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.sat == 208, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.sat, " + "expected 208, is %d", + last_msg.msg.obs_dep_b.obs[2].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].L.f == 241, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].L.f, " + "expected 241, is %d", + last_msg.msg.obs_dep_b.obs[3].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].L.i == 119280830, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].L.i, " + "expected 119280830, is %d", + last_msg.msg.obs_dep_b.obs[3].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].P == 2269703860, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].P, " + "expected 2269703860, is %d", + last_msg.msg.obs_dep_b.obs[3].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].cn0 == 155, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].cn0, " + "expected 155, is %d", + last_msg.msg.obs_dep_b.obs[3].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[3].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[3].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[3].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[3].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].sid.sat == 212, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.sat, " + "expected 212, is %d", + last_msg.msg.obs_dep_b.obs[3].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].L.f == 153, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].L.f, " + "expected 153, is %d", + last_msg.msg.obs_dep_b.obs[4].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].L.i == 109691996, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].L.i, " + "expected 109691996, is %d", + last_msg.msg.obs_dep_b.obs[4].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].P == 2087295247, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].P, " + "expected 2087295247, is %d", + last_msg.msg.obs_dep_b.obs[4].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].cn0 == 168, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].cn0, " + "expected 168, is %d", + last_msg.msg.obs_dep_b.obs[4].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[4].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[4].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[4].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[4].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].sid.sat == 217, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.sat, " + "expected 217, is %d", + last_msg.msg.obs_dep_b.obs[4].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].L.f == 41, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].L.f, " + "expected 41, is %d", + last_msg.msg.obs_dep_b.obs[5].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].L.i == 123340176, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].L.i, " + "expected 123340176, is %d", + last_msg.msg.obs_dep_b.obs[5].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].P == 2347022641, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].P, " + "expected 2347022641, is %d", + last_msg.msg.obs_dep_b.obs[5].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].cn0 == 150, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].cn0, " + "expected 150, is %d", + last_msg.msg.obs_dep_b.obs[5].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[5].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[5].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[5].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[5].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].sid.sat == 218, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.sat, " + "expected 218, is %d", + last_msg.msg.obs_dep_b.obs[5].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -838,173 +1185,247 @@ START_TEST( test_auto_check_sbp_observation_MsgObsDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x43, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x43, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,67,0,246,215,55,64,47,39,0,251,6,33,234,148,101,136,15,245,42,7,20,154,0,0,220,0,0,0,208,247,122,133,16,214,3,7,38,156,0,0,222,0,0,0,15,150,81,122,22,172,109,6,7,172,0,0,225,0,0,0,201,13, }; + u8 encoded_frame[] = { + 85, 67, 0, 246, 215, 55, 64, 47, 39, 0, 251, 6, 33, 234, 148, 101, + 136, 15, 245, 42, 7, 20, 154, 0, 0, 220, 0, 0, 0, 208, 247, 122, + 133, 16, 214, 3, 7, 38, 156, 0, 0, 222, 0, 0, 0, 15, 150, 81, + 122, 22, 172, 109, 6, 7, 172, 0, 0, 225, 0, 0, 0, 201, 13, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_b.header.n_obs = 33; - - + test_msg.obs_dep_b.header.t.tow = 2568000; - + test_msg.obs_dep_b.header.t.wn = 1787; - + test_msg.obs_dep_b.n_obs = 3; - - - - + test_msg.obs_dep_b.obs[0].L.f = 20; - + test_msg.obs_dep_b.obs[0].L.i = 120255759; - + test_msg.obs_dep_b.obs[0].P = 2288358634; - + test_msg.obs_dep_b.obs[0].cn0 = 154; - + test_msg.obs_dep_b.obs[0].lock = 0; - - + test_msg.obs_dep_b.obs[0].sid.code = 0; - + test_msg.obs_dep_b.obs[0].sid.reserved = 0; - + test_msg.obs_dep_b.obs[0].sid.sat = 220; - - - + test_msg.obs_dep_b.obs[1].L.f = 38; - + test_msg.obs_dep_b.obs[1].L.i = 117691920; - + test_msg.obs_dep_b.obs[1].P = 2239428560; - + test_msg.obs_dep_b.obs[1].cn0 = 156; - + test_msg.obs_dep_b.obs[1].lock = 0; - - + test_msg.obs_dep_b.obs[1].sid.code = 0; - + test_msg.obs_dep_b.obs[1].sid.reserved = 0; - + test_msg.obs_dep_b.obs[1].sid.sat = 222; - - - + test_msg.obs_dep_b.obs[2].L.f = 7; - + test_msg.obs_dep_b.obs[2].L.i = 107850774; - + test_msg.obs_dep_b.obs[2].P = 2052167183; - + test_msg.obs_dep_b.obs[2].cn0 = 172; - + test_msg.obs_dep_b.obs[2].lock = 0; - - + test_msg.obs_dep_b.obs[2].sid.code = 0; - + test_msg.obs_dep_b.obs[2].sid.reserved = 0; - + test_msg.obs_dep_b.obs[2].sid.sat = 225; sbp_message_send(&sbp_state, SbpMsgObsDepB, 55286, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepB, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_b.header.n_obs == 33, "incorrect value for last_msg.msg.obs_dep_b.header.n_obs, expected 33, is %d", last_msg.msg.obs_dep_b.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_b.header.t.tow == 2568000, "incorrect value for last_msg.msg.obs_dep_b.header.t.tow, expected 2568000, is %d", last_msg.msg.obs_dep_b.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_b.header.t.wn == 1787, "incorrect value for last_msg.msg.obs_dep_b.header.t.wn, expected 1787, is %d", last_msg.msg.obs_dep_b.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_b.n_obs == 3, "incorrect value for last_msg.msg.obs_dep_b.n_obs, expected 3, is %d", last_msg.msg.obs_dep_b.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.f == 20, "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.f, expected 20, is %d", last_msg.msg.obs_dep_b.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.i == 120255759, "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.i, expected 120255759, is %d", last_msg.msg.obs_dep_b.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].P == 2288358634, "incorrect value for last_msg.msg.obs_dep_b.obs[0].P, expected 2288358634, is %d", last_msg.msg.obs_dep_b.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].cn0 == 154, "incorrect value for last_msg.msg.obs_dep_b.obs[0].cn0, expected 154, is %d", last_msg.msg.obs_dep_b.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[0].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[0].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[0].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[0].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.sat == 220, "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.sat, expected 220, is %d", last_msg.msg.obs_dep_b.obs[0].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.f == 38, "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.f, expected 38, is %d", last_msg.msg.obs_dep_b.obs[1].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.i == 117691920, "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.i, expected 117691920, is %d", last_msg.msg.obs_dep_b.obs[1].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].P == 2239428560, "incorrect value for last_msg.msg.obs_dep_b.obs[1].P, expected 2239428560, is %d", last_msg.msg.obs_dep_b.obs[1].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].cn0 == 156, "incorrect value for last_msg.msg.obs_dep_b.obs[1].cn0, expected 156, is %d", last_msg.msg.obs_dep_b.obs[1].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[1].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[1].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[1].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[1].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.sat == 222, "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.sat, expected 222, is %d", last_msg.msg.obs_dep_b.obs[1].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.f == 7, "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.f, expected 7, is %d", last_msg.msg.obs_dep_b.obs[2].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.i == 107850774, "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.i, expected 107850774, is %d", last_msg.msg.obs_dep_b.obs[2].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].P == 2052167183, "incorrect value for last_msg.msg.obs_dep_b.obs[2].P, expected 2052167183, is %d", last_msg.msg.obs_dep_b.obs[2].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].cn0 == 172, "incorrect value for last_msg.msg.obs_dep_b.obs[2].cn0, expected 172, is %d", last_msg.msg.obs_dep_b.obs[2].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[2].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[2].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[2].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[2].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.sat == 225, "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.sat, expected 225, is %d", last_msg.msg.obs_dep_b.obs[2].sid.sat); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_b.header.n_obs == 33, + "incorrect value for last_msg.msg.obs_dep_b.header.n_obs, " + "expected 33, is %d", + last_msg.msg.obs_dep_b.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_b.header.t.tow == 2568000, + "incorrect value for last_msg.msg.obs_dep_b.header.t.tow, " + "expected 2568000, is %d", + last_msg.msg.obs_dep_b.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_b.header.t.wn == 1787, + "incorrect value for last_msg.msg.obs_dep_b.header.t.wn, " + "expected 1787, is %d", + last_msg.msg.obs_dep_b.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_b.n_obs == 3, + "incorrect value for last_msg.msg.obs_dep_b.n_obs, expected 3, is %d", + last_msg.msg.obs_dep_b.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.f == 20, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.f, " + "expected 20, is %d", + last_msg.msg.obs_dep_b.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.i == 120255759, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.i, " + "expected 120255759, is %d", + last_msg.msg.obs_dep_b.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].P == 2288358634, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].P, " + "expected 2288358634, is %d", + last_msg.msg.obs_dep_b.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].cn0 == 154, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].cn0, " + "expected 154, is %d", + last_msg.msg.obs_dep_b.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[0].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[0].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[0].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.sat == 220, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.sat, " + "expected 220, is %d", + last_msg.msg.obs_dep_b.obs[0].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.f == 38, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.f, " + "expected 38, is %d", + last_msg.msg.obs_dep_b.obs[1].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.i == 117691920, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.i, " + "expected 117691920, is %d", + last_msg.msg.obs_dep_b.obs[1].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].P == 2239428560, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].P, " + "expected 2239428560, is %d", + last_msg.msg.obs_dep_b.obs[1].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].cn0 == 156, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].cn0, " + "expected 156, is %d", + last_msg.msg.obs_dep_b.obs[1].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[1].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[1].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[1].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[1].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.sat == 222, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.sat, " + "expected 222, is %d", + last_msg.msg.obs_dep_b.obs[1].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.f == 7, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.f, " + "expected 7, is %d", + last_msg.msg.obs_dep_b.obs[2].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.i == 107850774, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.i, " + "expected 107850774, is %d", + last_msg.msg.obs_dep_b.obs[2].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].P == 2052167183, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].P, " + "expected 2052167183, is %d", + last_msg.msg.obs_dep_b.obs[2].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].cn0 == 172, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].cn0, " + "expected 172, is %d", + last_msg.msg.obs_dep_b.obs[2].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[2].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[2].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[2].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[2].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.sat == 225, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.sat, " + "expected 225, is %d", + last_msg.msg.obs_dep_b.obs[2].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -1012,287 +1433,425 @@ START_TEST( test_auto_check_sbp_observation_MsgObsDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x43, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x43, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,67,0,246,215,103,8,48,39,0,251,6,32,254,96,187,133,249,49,7,7,165,156,0,0,202,0,0,0,113,229,85,147,11,33,190,7,106,143,0,0,203,0,0,0,182,85,248,138,227,169,77,7,159,150,0,0,208,0,0,0,17,24,73,135,10,23,28,7,7,156,0,0,212,0,0,0,108,155,105,124,166,196,137,6,186,170,0,0,217,0,0,0,214,142,228,139,77,3,90,7,236,151,0,0,218,0,0,0,59,118, }; + u8 encoded_frame[] = { + 85, 67, 0, 246, 215, 103, 8, 48, 39, 0, 251, 6, 32, 254, + 96, 187, 133, 249, 49, 7, 7, 165, 156, 0, 0, 202, 0, 0, + 0, 113, 229, 85, 147, 11, 33, 190, 7, 106, 143, 0, 0, 203, + 0, 0, 0, 182, 85, 248, 138, 227, 169, 77, 7, 159, 150, 0, + 0, 208, 0, 0, 0, 17, 24, 73, 135, 10, 23, 28, 7, 7, + 156, 0, 0, 212, 0, 0, 0, 108, 155, 105, 124, 166, 196, 137, + 6, 186, 170, 0, 0, 217, 0, 0, 0, 214, 142, 228, 139, 77, + 3, 90, 7, 236, 151, 0, 0, 218, 0, 0, 0, 59, 118, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_b.header.n_obs = 32; - - + test_msg.obs_dep_b.header.t.tow = 2568200; - + test_msg.obs_dep_b.header.t.wn = 1787; - + test_msg.obs_dep_b.n_obs = 6; - - - - + test_msg.obs_dep_b.obs[0].L.f = 165; - + test_msg.obs_dep_b.obs[0].L.i = 117912057; - + test_msg.obs_dep_b.obs[0].P = 2243649790; - + test_msg.obs_dep_b.obs[0].cn0 = 156; - + test_msg.obs_dep_b.obs[0].lock = 0; - - + test_msg.obs_dep_b.obs[0].sid.code = 0; - + test_msg.obs_dep_b.obs[0].sid.reserved = 0; - + test_msg.obs_dep_b.obs[0].sid.sat = 202; - - - + test_msg.obs_dep_b.obs[1].L.f = 106; - + test_msg.obs_dep_b.obs[1].L.i = 129900811; - + test_msg.obs_dep_b.obs[1].P = 2471880049; - + test_msg.obs_dep_b.obs[1].cn0 = 143; - + test_msg.obs_dep_b.obs[1].lock = 0; - - + test_msg.obs_dep_b.obs[1].sid.code = 0; - + test_msg.obs_dep_b.obs[1].sid.reserved = 0; - + test_msg.obs_dep_b.obs[1].sid.sat = 203; - - - + test_msg.obs_dep_b.obs[2].L.f = 159; - + test_msg.obs_dep_b.obs[2].L.i = 122530275; - + test_msg.obs_dep_b.obs[2].P = 2331530678; - + test_msg.obs_dep_b.obs[2].cn0 = 150; - + test_msg.obs_dep_b.obs[2].lock = 0; - - + test_msg.obs_dep_b.obs[2].sid.code = 0; - + test_msg.obs_dep_b.obs[2].sid.reserved = 0; - + test_msg.obs_dep_b.obs[2].sid.sat = 208; - - - + test_msg.obs_dep_b.obs[3].L.f = 7; - + test_msg.obs_dep_b.obs[3].L.i = 119281418; - + test_msg.obs_dep_b.obs[3].P = 2269714449; - + test_msg.obs_dep_b.obs[3].cn0 = 156; - + test_msg.obs_dep_b.obs[3].lock = 0; - - + test_msg.obs_dep_b.obs[3].sid.code = 0; - + test_msg.obs_dep_b.obs[3].sid.reserved = 0; - + test_msg.obs_dep_b.obs[3].sid.sat = 212; - - - + test_msg.obs_dep_b.obs[4].L.f = 186; - + test_msg.obs_dep_b.obs[4].L.i = 109692070; - + test_msg.obs_dep_b.obs[4].P = 2087295852; - + test_msg.obs_dep_b.obs[4].cn0 = 170; - + test_msg.obs_dep_b.obs[4].lock = 0; - - + test_msg.obs_dep_b.obs[4].sid.code = 0; - + test_msg.obs_dep_b.obs[4].sid.reserved = 0; - + test_msg.obs_dep_b.obs[4].sid.sat = 217; - - - + test_msg.obs_dep_b.obs[5].L.f = 236; - + test_msg.obs_dep_b.obs[5].L.i = 123339597; - + test_msg.obs_dep_b.obs[5].P = 2347011798; - + test_msg.obs_dep_b.obs[5].cn0 = 151; - + test_msg.obs_dep_b.obs[5].lock = 0; - - + test_msg.obs_dep_b.obs[5].sid.code = 0; - + test_msg.obs_dep_b.obs[5].sid.reserved = 0; - + test_msg.obs_dep_b.obs[5].sid.sat = 218; sbp_message_send(&sbp_state, SbpMsgObsDepB, 55286, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepB, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_b.header.n_obs == 32, "incorrect value for last_msg.msg.obs_dep_b.header.n_obs, expected 32, is %d", last_msg.msg.obs_dep_b.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_b.header.t.tow == 2568200, "incorrect value for last_msg.msg.obs_dep_b.header.t.tow, expected 2568200, is %d", last_msg.msg.obs_dep_b.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_b.header.t.wn == 1787, "incorrect value for last_msg.msg.obs_dep_b.header.t.wn, expected 1787, is %d", last_msg.msg.obs_dep_b.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_b.n_obs == 6, "incorrect value for last_msg.msg.obs_dep_b.n_obs, expected 6, is %d", last_msg.msg.obs_dep_b.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.f == 165, "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.f, expected 165, is %d", last_msg.msg.obs_dep_b.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.i == 117912057, "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.i, expected 117912057, is %d", last_msg.msg.obs_dep_b.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].P == 2243649790, "incorrect value for last_msg.msg.obs_dep_b.obs[0].P, expected 2243649790, is %d", last_msg.msg.obs_dep_b.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].cn0 == 156, "incorrect value for last_msg.msg.obs_dep_b.obs[0].cn0, expected 156, is %d", last_msg.msg.obs_dep_b.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[0].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[0].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[0].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[0].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.sat == 202, "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.sat, expected 202, is %d", last_msg.msg.obs_dep_b.obs[0].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.f == 106, "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.f, expected 106, is %d", last_msg.msg.obs_dep_b.obs[1].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.i == 129900811, "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.i, expected 129900811, is %d", last_msg.msg.obs_dep_b.obs[1].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].P == 2471880049, "incorrect value for last_msg.msg.obs_dep_b.obs[1].P, expected 2471880049, is %d", last_msg.msg.obs_dep_b.obs[1].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].cn0 == 143, "incorrect value for last_msg.msg.obs_dep_b.obs[1].cn0, expected 143, is %d", last_msg.msg.obs_dep_b.obs[1].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[1].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[1].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[1].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[1].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.sat == 203, "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.sat, expected 203, is %d", last_msg.msg.obs_dep_b.obs[1].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.f == 159, "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.f, expected 159, is %d", last_msg.msg.obs_dep_b.obs[2].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.i == 122530275, "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.i, expected 122530275, is %d", last_msg.msg.obs_dep_b.obs[2].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].P == 2331530678, "incorrect value for last_msg.msg.obs_dep_b.obs[2].P, expected 2331530678, is %d", last_msg.msg.obs_dep_b.obs[2].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].cn0 == 150, "incorrect value for last_msg.msg.obs_dep_b.obs[2].cn0, expected 150, is %d", last_msg.msg.obs_dep_b.obs[2].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[2].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[2].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[2].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[2].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.sat == 208, "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.sat, expected 208, is %d", last_msg.msg.obs_dep_b.obs[2].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].L.f == 7, "incorrect value for last_msg.msg.obs_dep_b.obs[3].L.f, expected 7, is %d", last_msg.msg.obs_dep_b.obs[3].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].L.i == 119281418, "incorrect value for last_msg.msg.obs_dep_b.obs[3].L.i, expected 119281418, is %d", last_msg.msg.obs_dep_b.obs[3].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].P == 2269714449, "incorrect value for last_msg.msg.obs_dep_b.obs[3].P, expected 2269714449, is %d", last_msg.msg.obs_dep_b.obs[3].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].cn0 == 156, "incorrect value for last_msg.msg.obs_dep_b.obs[3].cn0, expected 156, is %d", last_msg.msg.obs_dep_b.obs[3].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[3].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[3].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[3].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[3].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].sid.sat == 212, "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.sat, expected 212, is %d", last_msg.msg.obs_dep_b.obs[3].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].L.f == 186, "incorrect value for last_msg.msg.obs_dep_b.obs[4].L.f, expected 186, is %d", last_msg.msg.obs_dep_b.obs[4].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].L.i == 109692070, "incorrect value for last_msg.msg.obs_dep_b.obs[4].L.i, expected 109692070, is %d", last_msg.msg.obs_dep_b.obs[4].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].P == 2087295852, "incorrect value for last_msg.msg.obs_dep_b.obs[4].P, expected 2087295852, is %d", last_msg.msg.obs_dep_b.obs[4].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].cn0 == 170, "incorrect value for last_msg.msg.obs_dep_b.obs[4].cn0, expected 170, is %d", last_msg.msg.obs_dep_b.obs[4].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[4].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[4].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[4].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[4].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].sid.sat == 217, "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.sat, expected 217, is %d", last_msg.msg.obs_dep_b.obs[4].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].L.f == 236, "incorrect value for last_msg.msg.obs_dep_b.obs[5].L.f, expected 236, is %d", last_msg.msg.obs_dep_b.obs[5].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].L.i == 123339597, "incorrect value for last_msg.msg.obs_dep_b.obs[5].L.i, expected 123339597, is %d", last_msg.msg.obs_dep_b.obs[5].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].P == 2347011798, "incorrect value for last_msg.msg.obs_dep_b.obs[5].P, expected 2347011798, is %d", last_msg.msg.obs_dep_b.obs[5].P); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].cn0 == 151, "incorrect value for last_msg.msg.obs_dep_b.obs[5].cn0, expected 151, is %d", last_msg.msg.obs_dep_b.obs[5].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].lock == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[5].lock, expected 0, is %d", last_msg.msg.obs_dep_b.obs[5].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.code, expected 0, is %d", last_msg.msg.obs_dep_b.obs[5].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_b.obs[5].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].sid.sat == 218, "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.sat, expected 218, is %d", last_msg.msg.obs_dep_b.obs[5].sid.sat); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_b.header.n_obs == 32, + "incorrect value for last_msg.msg.obs_dep_b.header.n_obs, " + "expected 32, is %d", + last_msg.msg.obs_dep_b.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_b.header.t.tow == 2568200, + "incorrect value for last_msg.msg.obs_dep_b.header.t.tow, " + "expected 2568200, is %d", + last_msg.msg.obs_dep_b.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_b.header.t.wn == 1787, + "incorrect value for last_msg.msg.obs_dep_b.header.t.wn, " + "expected 1787, is %d", + last_msg.msg.obs_dep_b.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_b.n_obs == 6, + "incorrect value for last_msg.msg.obs_dep_b.n_obs, expected 6, is %d", + last_msg.msg.obs_dep_b.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.f == 165, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.f, " + "expected 165, is %d", + last_msg.msg.obs_dep_b.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].L.i == 117912057, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].L.i, " + "expected 117912057, is %d", + last_msg.msg.obs_dep_b.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].P == 2243649790, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].P, " + "expected 2243649790, is %d", + last_msg.msg.obs_dep_b.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].cn0 == 156, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].cn0, " + "expected 156, is %d", + last_msg.msg.obs_dep_b.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[0].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[0].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[0].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[0].sid.sat == 202, + "incorrect value for last_msg.msg.obs_dep_b.obs[0].sid.sat, " + "expected 202, is %d", + last_msg.msg.obs_dep_b.obs[0].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.f == 106, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.f, " + "expected 106, is %d", + last_msg.msg.obs_dep_b.obs[1].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].L.i == 129900811, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].L.i, " + "expected 129900811, is %d", + last_msg.msg.obs_dep_b.obs[1].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].P == 2471880049, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].P, " + "expected 2471880049, is %d", + last_msg.msg.obs_dep_b.obs[1].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].cn0 == 143, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].cn0, " + "expected 143, is %d", + last_msg.msg.obs_dep_b.obs[1].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[1].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[1].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[1].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[1].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[1].sid.sat == 203, + "incorrect value for last_msg.msg.obs_dep_b.obs[1].sid.sat, " + "expected 203, is %d", + last_msg.msg.obs_dep_b.obs[1].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.f == 159, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.f, " + "expected 159, is %d", + last_msg.msg.obs_dep_b.obs[2].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].L.i == 122530275, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].L.i, " + "expected 122530275, is %d", + last_msg.msg.obs_dep_b.obs[2].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].P == 2331530678, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].P, " + "expected 2331530678, is %d", + last_msg.msg.obs_dep_b.obs[2].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].cn0 == 150, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].cn0, " + "expected 150, is %d", + last_msg.msg.obs_dep_b.obs[2].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[2].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[2].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[2].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[2].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[2].sid.sat == 208, + "incorrect value for last_msg.msg.obs_dep_b.obs[2].sid.sat, " + "expected 208, is %d", + last_msg.msg.obs_dep_b.obs[2].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].L.f == 7, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].L.f, " + "expected 7, is %d", + last_msg.msg.obs_dep_b.obs[3].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].L.i == 119281418, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].L.i, " + "expected 119281418, is %d", + last_msg.msg.obs_dep_b.obs[3].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].P == 2269714449, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].P, " + "expected 2269714449, is %d", + last_msg.msg.obs_dep_b.obs[3].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].cn0 == 156, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].cn0, " + "expected 156, is %d", + last_msg.msg.obs_dep_b.obs[3].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[3].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[3].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[3].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[3].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[3].sid.sat == 212, + "incorrect value for last_msg.msg.obs_dep_b.obs[3].sid.sat, " + "expected 212, is %d", + last_msg.msg.obs_dep_b.obs[3].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].L.f == 186, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].L.f, " + "expected 186, is %d", + last_msg.msg.obs_dep_b.obs[4].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].L.i == 109692070, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].L.i, " + "expected 109692070, is %d", + last_msg.msg.obs_dep_b.obs[4].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].P == 2087295852, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].P, " + "expected 2087295852, is %d", + last_msg.msg.obs_dep_b.obs[4].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].cn0 == 170, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].cn0, " + "expected 170, is %d", + last_msg.msg.obs_dep_b.obs[4].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[4].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[4].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[4].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[4].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[4].sid.sat == 217, + "incorrect value for last_msg.msg.obs_dep_b.obs[4].sid.sat, " + "expected 217, is %d", + last_msg.msg.obs_dep_b.obs[4].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].L.f == 236, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].L.f, " + "expected 236, is %d", + last_msg.msg.obs_dep_b.obs[5].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].L.i == 123339597, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].L.i, " + "expected 123339597, is %d", + last_msg.msg.obs_dep_b.obs[5].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].P == 2347011798, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].P, " + "expected 2347011798, is %d", + last_msg.msg.obs_dep_b.obs[5].P); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].cn0 == 151, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].cn0, " + "expected 151, is %d", + last_msg.msg.obs_dep_b.obs[5].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].lock == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].lock, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[5].lock); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[5].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_b.obs[5].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_b.obs[5].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_b.obs[5].sid.sat == 218, + "incorrect value for last_msg.msg.obs_dep_b.obs[5].sid.sat, " + "expected 218, is %d", + last_msg.msg.obs_dep_b.obs[5].sid.sat); } } END_TEST -Suite* auto_check_sbp_observation_MsgObsDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgObsDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgObsDepB"); +Suite *auto_check_sbp_observation_MsgObsDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgObsDepB"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_observation_MsgObsDepB"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgObsDepB); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgObsDepC.c b/c/test/auto_check_sbp_observation_MsgObsDepC.c index 0430e9679..d444e7a50 100644 --- a/c/test/auto_check_sbp_observation_MsgObsDepC.c +++ b/c/test/auto_check_sbp_observation_MsgObsDepC.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepC.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgObsDepC ) -{ +START_TEST(test_auto_check_sbp_observation_MsgObsDepC) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgObsDepC ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,247 +90,364 @@ START_TEST( test_auto_check_sbp_observation_MsgObsDepC ) logging_reset(); - sbp_callback_register(&sbp_state, 0x49, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x49, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,73,0,70,152,87,8,95,183,24,106,7,32,126,250,73,80,113,94,247,255,231,163,229,229,4,0,0,0,60,220,96,70,81,147,250,255,196,208,20,28,6,0,0,0,248,61,62,77,28,60,242,255,110,171,180,178,7,0,0,0,237,84,190,77,172,37,13,0,41,170,233,164,10,0,0,0,36,85,9,75,240,188,21,0,19,182,196,209,12,0,0,0,190,175, }; + u8 encoded_frame[] = { + 85, 73, 0, 70, 152, 87, 8, 95, 183, 24, 106, 7, 32, 126, + 250, 73, 80, 113, 94, 247, 255, 231, 163, 229, 229, 4, 0, 0, + 0, 60, 220, 96, 70, 81, 147, 250, 255, 196, 208, 20, 28, 6, + 0, 0, 0, 248, 61, 62, 77, 28, 60, 242, 255, 110, 171, 180, + 178, 7, 0, 0, 0, 237, 84, 190, 77, 172, 37, 13, 0, 41, + 170, 233, 164, 10, 0, 0, 0, 36, 85, 9, 75, 240, 188, 21, + 0, 19, 182, 196, 209, 12, 0, 0, 0, 190, 175, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_c.header.n_obs = 32; - - + test_msg.obs_dep_c.header.t.tow = 414670600; - + test_msg.obs_dep_c.header.t.wn = 1898; - + test_msg.obs_dep_c.n_obs = 5; - - - - + test_msg.obs_dep_c.obs[0].L.f = 231; - + test_msg.obs_dep_c.obs[0].L.i = -565647; - + test_msg.obs_dep_c.obs[0].P = 1347025534; - + test_msg.obs_dep_c.obs[0].cn0 = 163; - + test_msg.obs_dep_c.obs[0].lock = 58853; - - + test_msg.obs_dep_c.obs[0].sid.code = 0; - + test_msg.obs_dep_c.obs[0].sid.reserved = 0; - + test_msg.obs_dep_c.obs[0].sid.sat = 4; - - - + test_msg.obs_dep_c.obs[1].L.f = 196; - + test_msg.obs_dep_c.obs[1].L.i = -355503; - + test_msg.obs_dep_c.obs[1].P = 1180752956; - + test_msg.obs_dep_c.obs[1].cn0 = 208; - + test_msg.obs_dep_c.obs[1].lock = 7188; - - + test_msg.obs_dep_c.obs[1].sid.code = 0; - + test_msg.obs_dep_c.obs[1].sid.reserved = 0; - + test_msg.obs_dep_c.obs[1].sid.sat = 6; - - - + test_msg.obs_dep_c.obs[2].L.f = 110; - + test_msg.obs_dep_c.obs[2].L.i = -902116; - + test_msg.obs_dep_c.obs[2].P = 1295924728; - + test_msg.obs_dep_c.obs[2].cn0 = 171; - + test_msg.obs_dep_c.obs[2].lock = 45748; - - + test_msg.obs_dep_c.obs[2].sid.code = 0; - + test_msg.obs_dep_c.obs[2].sid.reserved = 0; - + test_msg.obs_dep_c.obs[2].sid.sat = 7; - - - + test_msg.obs_dep_c.obs[3].L.f = 41; - + test_msg.obs_dep_c.obs[3].L.i = 861612; - + test_msg.obs_dep_c.obs[3].P = 1304319213; - + test_msg.obs_dep_c.obs[3].cn0 = 170; - + test_msg.obs_dep_c.obs[3].lock = 42217; - - + test_msg.obs_dep_c.obs[3].sid.code = 0; - + test_msg.obs_dep_c.obs[3].sid.reserved = 0; - + test_msg.obs_dep_c.obs[3].sid.sat = 10; - - - + test_msg.obs_dep_c.obs[4].L.f = 19; - + test_msg.obs_dep_c.obs[4].L.i = 1424624; - + test_msg.obs_dep_c.obs[4].P = 1258902820; - + test_msg.obs_dep_c.obs[4].cn0 = 182; - + test_msg.obs_dep_c.obs[4].lock = 53700; - - + test_msg.obs_dep_c.obs[4].sid.code = 0; - + test_msg.obs_dep_c.obs[4].sid.reserved = 0; - + test_msg.obs_dep_c.obs[4].sid.sat = 12; sbp_message_send(&sbp_state, SbpMsgObsDepC, 38982, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 38982, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepC, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_c.header.n_obs == 32, "incorrect value for last_msg.msg.obs_dep_c.header.n_obs, expected 32, is %d", last_msg.msg.obs_dep_c.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_c.header.t.tow == 414670600, "incorrect value for last_msg.msg.obs_dep_c.header.t.tow, expected 414670600, is %d", last_msg.msg.obs_dep_c.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_c.header.t.wn == 1898, "incorrect value for last_msg.msg.obs_dep_c.header.t.wn, expected 1898, is %d", last_msg.msg.obs_dep_c.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_c.n_obs == 5, "incorrect value for last_msg.msg.obs_dep_c.n_obs, expected 5, is %d", last_msg.msg.obs_dep_c.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.f == 231, "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.f, expected 231, is %d", last_msg.msg.obs_dep_c.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.i == -565647, "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.i, expected -565647, is %d", last_msg.msg.obs_dep_c.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].P == 1347025534, "incorrect value for last_msg.msg.obs_dep_c.obs[0].P, expected 1347025534, is %d", last_msg.msg.obs_dep_c.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].cn0 == 163, "incorrect value for last_msg.msg.obs_dep_c.obs[0].cn0, expected 163, is %d", last_msg.msg.obs_dep_c.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].lock == 58853, "incorrect value for last_msg.msg.obs_dep_c.obs[0].lock, expected 58853, is %d", last_msg.msg.obs_dep_c.obs[0].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[0].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[0].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.sat == 4, "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.sat, expected 4, is %d", last_msg.msg.obs_dep_c.obs[0].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.f == 196, "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.f, expected 196, is %d", last_msg.msg.obs_dep_c.obs[1].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.i == -355503, "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.i, expected -355503, is %d", last_msg.msg.obs_dep_c.obs[1].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].P == 1180752956, "incorrect value for last_msg.msg.obs_dep_c.obs[1].P, expected 1180752956, is %d", last_msg.msg.obs_dep_c.obs[1].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].cn0 == 208, "incorrect value for last_msg.msg.obs_dep_c.obs[1].cn0, expected 208, is %d", last_msg.msg.obs_dep_c.obs[1].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].lock == 7188, "incorrect value for last_msg.msg.obs_dep_c.obs[1].lock, expected 7188, is %d", last_msg.msg.obs_dep_c.obs[1].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[1].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[1].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.sat == 6, "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.sat, expected 6, is %d", last_msg.msg.obs_dep_c.obs[1].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.f == 110, "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.f, expected 110, is %d", last_msg.msg.obs_dep_c.obs[2].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.i == -902116, "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.i, expected -902116, is %d", last_msg.msg.obs_dep_c.obs[2].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].P == 1295924728, "incorrect value for last_msg.msg.obs_dep_c.obs[2].P, expected 1295924728, is %d", last_msg.msg.obs_dep_c.obs[2].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].cn0 == 171, "incorrect value for last_msg.msg.obs_dep_c.obs[2].cn0, expected 171, is %d", last_msg.msg.obs_dep_c.obs[2].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].lock == 45748, "incorrect value for last_msg.msg.obs_dep_c.obs[2].lock, expected 45748, is %d", last_msg.msg.obs_dep_c.obs[2].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[2].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[2].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.sat == 7, "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.sat, expected 7, is %d", last_msg.msg.obs_dep_c.obs[2].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].L.f == 41, "incorrect value for last_msg.msg.obs_dep_c.obs[3].L.f, expected 41, is %d", last_msg.msg.obs_dep_c.obs[3].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].L.i == 861612, "incorrect value for last_msg.msg.obs_dep_c.obs[3].L.i, expected 861612, is %d", last_msg.msg.obs_dep_c.obs[3].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].P == 1304319213, "incorrect value for last_msg.msg.obs_dep_c.obs[3].P, expected 1304319213, is %d", last_msg.msg.obs_dep_c.obs[3].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].cn0 == 170, "incorrect value for last_msg.msg.obs_dep_c.obs[3].cn0, expected 170, is %d", last_msg.msg.obs_dep_c.obs[3].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].lock == 42217, "incorrect value for last_msg.msg.obs_dep_c.obs[3].lock, expected 42217, is %d", last_msg.msg.obs_dep_c.obs[3].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[3].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[3].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].sid.sat == 10, "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.sat, expected 10, is %d", last_msg.msg.obs_dep_c.obs[3].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].L.f == 19, "incorrect value for last_msg.msg.obs_dep_c.obs[4].L.f, expected 19, is %d", last_msg.msg.obs_dep_c.obs[4].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].L.i == 1424624, "incorrect value for last_msg.msg.obs_dep_c.obs[4].L.i, expected 1424624, is %d", last_msg.msg.obs_dep_c.obs[4].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].P == 1258902820, "incorrect value for last_msg.msg.obs_dep_c.obs[4].P, expected 1258902820, is %d", last_msg.msg.obs_dep_c.obs[4].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].cn0 == 182, "incorrect value for last_msg.msg.obs_dep_c.obs[4].cn0, expected 182, is %d", last_msg.msg.obs_dep_c.obs[4].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].lock == 53700, "incorrect value for last_msg.msg.obs_dep_c.obs[4].lock, expected 53700, is %d", last_msg.msg.obs_dep_c.obs[4].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[4].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[4].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].sid.sat == 12, "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.sat, expected 12, is %d", last_msg.msg.obs_dep_c.obs[4].sid.sat); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_c.header.n_obs == 32, + "incorrect value for last_msg.msg.obs_dep_c.header.n_obs, " + "expected 32, is %d", + last_msg.msg.obs_dep_c.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_c.header.t.tow == 414670600, + "incorrect value for last_msg.msg.obs_dep_c.header.t.tow, " + "expected 414670600, is %d", + last_msg.msg.obs_dep_c.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_c.header.t.wn == 1898, + "incorrect value for last_msg.msg.obs_dep_c.header.t.wn, " + "expected 1898, is %d", + last_msg.msg.obs_dep_c.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_c.n_obs == 5, + "incorrect value for last_msg.msg.obs_dep_c.n_obs, expected 5, is %d", + last_msg.msg.obs_dep_c.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.f == 231, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.f, " + "expected 231, is %d", + last_msg.msg.obs_dep_c.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.i == -565647, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.i, " + "expected -565647, is %d", + last_msg.msg.obs_dep_c.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].P == 1347025534, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].P, " + "expected 1347025534, is %d", + last_msg.msg.obs_dep_c.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].cn0 == 163, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].cn0, " + "expected 163, is %d", + last_msg.msg.obs_dep_c.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].lock == 58853, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].lock, " + "expected 58853, is %d", + last_msg.msg.obs_dep_c.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[0].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[0].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[0].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.sat == 4, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.sat, " + "expected 4, is %d", + last_msg.msg.obs_dep_c.obs[0].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.f == 196, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.f, " + "expected 196, is %d", + last_msg.msg.obs_dep_c.obs[1].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.i == -355503, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.i, " + "expected -355503, is %d", + last_msg.msg.obs_dep_c.obs[1].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].P == 1180752956, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].P, " + "expected 1180752956, is %d", + last_msg.msg.obs_dep_c.obs[1].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].cn0 == 208, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].cn0, " + "expected 208, is %d", + last_msg.msg.obs_dep_c.obs[1].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].lock == 7188, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].lock, " + "expected 7188, is %d", + last_msg.msg.obs_dep_c.obs[1].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[1].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[1].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[1].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.sat == 6, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.sat, " + "expected 6, is %d", + last_msg.msg.obs_dep_c.obs[1].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.f == 110, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.f, " + "expected 110, is %d", + last_msg.msg.obs_dep_c.obs[2].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.i == -902116, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.i, " + "expected -902116, is %d", + last_msg.msg.obs_dep_c.obs[2].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].P == 1295924728, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].P, " + "expected 1295924728, is %d", + last_msg.msg.obs_dep_c.obs[2].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].cn0 == 171, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].cn0, " + "expected 171, is %d", + last_msg.msg.obs_dep_c.obs[2].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].lock == 45748, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].lock, " + "expected 45748, is %d", + last_msg.msg.obs_dep_c.obs[2].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[2].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[2].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[2].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.sat == 7, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.sat, " + "expected 7, is %d", + last_msg.msg.obs_dep_c.obs[2].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].L.f == 41, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].L.f, " + "expected 41, is %d", + last_msg.msg.obs_dep_c.obs[3].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].L.i == 861612, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].L.i, " + "expected 861612, is %d", + last_msg.msg.obs_dep_c.obs[3].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].P == 1304319213, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].P, " + "expected 1304319213, is %d", + last_msg.msg.obs_dep_c.obs[3].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].cn0 == 170, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].cn0, " + "expected 170, is %d", + last_msg.msg.obs_dep_c.obs[3].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].lock == 42217, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].lock, " + "expected 42217, is %d", + last_msg.msg.obs_dep_c.obs[3].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[3].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[3].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[3].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].sid.sat == 10, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.sat, " + "expected 10, is %d", + last_msg.msg.obs_dep_c.obs[3].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].L.f == 19, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].L.f, " + "expected 19, is %d", + last_msg.msg.obs_dep_c.obs[4].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].L.i == 1424624, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].L.i, " + "expected 1424624, is %d", + last_msg.msg.obs_dep_c.obs[4].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].P == 1258902820, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].P, " + "expected 1258902820, is %d", + last_msg.msg.obs_dep_c.obs[4].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].cn0 == 182, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].cn0, " + "expected 182, is %d", + last_msg.msg.obs_dep_c.obs[4].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].lock == 53700, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].lock, " + "expected 53700, is %d", + last_msg.msg.obs_dep_c.obs[4].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[4].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[4].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[4].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].sid.sat == 12, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.sat, " + "expected 12, is %d", + last_msg.msg.obs_dep_c.obs[4].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -342,173 +455,247 @@ START_TEST( test_auto_check_sbp_observation_MsgObsDepC ) logging_reset(); - sbp_callback_register(&sbp_state, 0x49, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x49, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,73,0,70,152,55,8,95,183,24,106,7,33,68,166,75,77,186,230,24,0,101,186,162,102,16,0,0,0,87,255,155,69,74,158,5,0,26,190,206,30,27,0,0,0,64,89,124,68,26,22,3,0,114,217,225,73,29,0,0,0,37,179, }; + u8 encoded_frame[] = { + 85, 73, 0, 70, 152, 55, 8, 95, 183, 24, 106, 7, 33, 68, 166, 75, + 77, 186, 230, 24, 0, 101, 186, 162, 102, 16, 0, 0, 0, 87, 255, 155, + 69, 74, 158, 5, 0, 26, 190, 206, 30, 27, 0, 0, 0, 64, 89, 124, + 68, 26, 22, 3, 0, 114, 217, 225, 73, 29, 0, 0, 0, 37, 179, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_c.header.n_obs = 33; - - + test_msg.obs_dep_c.header.t.tow = 414670600; - + test_msg.obs_dep_c.header.t.wn = 1898; - + test_msg.obs_dep_c.n_obs = 3; - - - - + test_msg.obs_dep_c.obs[0].L.f = 101; - + test_msg.obs_dep_c.obs[0].L.i = 1631930; - + test_msg.obs_dep_c.obs[0].P = 1296803396; - + test_msg.obs_dep_c.obs[0].cn0 = 186; - + test_msg.obs_dep_c.obs[0].lock = 26274; - - + test_msg.obs_dep_c.obs[0].sid.code = 0; - + test_msg.obs_dep_c.obs[0].sid.reserved = 0; - + test_msg.obs_dep_c.obs[0].sid.sat = 16; - - - + test_msg.obs_dep_c.obs[1].L.f = 26; - + test_msg.obs_dep_c.obs[1].L.i = 368202; - + test_msg.obs_dep_c.obs[1].P = 1167851351; - + test_msg.obs_dep_c.obs[1].cn0 = 190; - + test_msg.obs_dep_c.obs[1].lock = 7886; - - + test_msg.obs_dep_c.obs[1].sid.code = 0; - + test_msg.obs_dep_c.obs[1].sid.reserved = 0; - + test_msg.obs_dep_c.obs[1].sid.sat = 27; - - - + test_msg.obs_dep_c.obs[2].L.f = 114; - + test_msg.obs_dep_c.obs[2].L.i = 202266; - + test_msg.obs_dep_c.obs[2].P = 1149000000; - + test_msg.obs_dep_c.obs[2].cn0 = 217; - + test_msg.obs_dep_c.obs[2].lock = 18913; - - + test_msg.obs_dep_c.obs[2].sid.code = 0; - + test_msg.obs_dep_c.obs[2].sid.reserved = 0; - + test_msg.obs_dep_c.obs[2].sid.sat = 29; sbp_message_send(&sbp_state, SbpMsgObsDepC, 38982, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 38982, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepC, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_c.header.n_obs == 33, "incorrect value for last_msg.msg.obs_dep_c.header.n_obs, expected 33, is %d", last_msg.msg.obs_dep_c.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_c.header.t.tow == 414670600, "incorrect value for last_msg.msg.obs_dep_c.header.t.tow, expected 414670600, is %d", last_msg.msg.obs_dep_c.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_c.header.t.wn == 1898, "incorrect value for last_msg.msg.obs_dep_c.header.t.wn, expected 1898, is %d", last_msg.msg.obs_dep_c.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_c.n_obs == 3, "incorrect value for last_msg.msg.obs_dep_c.n_obs, expected 3, is %d", last_msg.msg.obs_dep_c.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.f == 101, "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.f, expected 101, is %d", last_msg.msg.obs_dep_c.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.i == 1631930, "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.i, expected 1631930, is %d", last_msg.msg.obs_dep_c.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].P == 1296803396, "incorrect value for last_msg.msg.obs_dep_c.obs[0].P, expected 1296803396, is %d", last_msg.msg.obs_dep_c.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].cn0 == 186, "incorrect value for last_msg.msg.obs_dep_c.obs[0].cn0, expected 186, is %d", last_msg.msg.obs_dep_c.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].lock == 26274, "incorrect value for last_msg.msg.obs_dep_c.obs[0].lock, expected 26274, is %d", last_msg.msg.obs_dep_c.obs[0].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[0].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[0].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.sat == 16, "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.sat, expected 16, is %d", last_msg.msg.obs_dep_c.obs[0].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.f == 26, "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.f, expected 26, is %d", last_msg.msg.obs_dep_c.obs[1].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.i == 368202, "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.i, expected 368202, is %d", last_msg.msg.obs_dep_c.obs[1].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].P == 1167851351, "incorrect value for last_msg.msg.obs_dep_c.obs[1].P, expected 1167851351, is %d", last_msg.msg.obs_dep_c.obs[1].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].cn0 == 190, "incorrect value for last_msg.msg.obs_dep_c.obs[1].cn0, expected 190, is %d", last_msg.msg.obs_dep_c.obs[1].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].lock == 7886, "incorrect value for last_msg.msg.obs_dep_c.obs[1].lock, expected 7886, is %d", last_msg.msg.obs_dep_c.obs[1].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[1].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[1].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.sat == 27, "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.sat, expected 27, is %d", last_msg.msg.obs_dep_c.obs[1].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.f == 114, "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.f, expected 114, is %d", last_msg.msg.obs_dep_c.obs[2].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.i == 202266, "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.i, expected 202266, is %d", last_msg.msg.obs_dep_c.obs[2].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].P == 1149000000, "incorrect value for last_msg.msg.obs_dep_c.obs[2].P, expected 1149000000, is %d", last_msg.msg.obs_dep_c.obs[2].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].cn0 == 217, "incorrect value for last_msg.msg.obs_dep_c.obs[2].cn0, expected 217, is %d", last_msg.msg.obs_dep_c.obs[2].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].lock == 18913, "incorrect value for last_msg.msg.obs_dep_c.obs[2].lock, expected 18913, is %d", last_msg.msg.obs_dep_c.obs[2].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[2].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[2].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.sat == 29, "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.sat, expected 29, is %d", last_msg.msg.obs_dep_c.obs[2].sid.sat); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_c.header.n_obs == 33, + "incorrect value for last_msg.msg.obs_dep_c.header.n_obs, " + "expected 33, is %d", + last_msg.msg.obs_dep_c.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_c.header.t.tow == 414670600, + "incorrect value for last_msg.msg.obs_dep_c.header.t.tow, " + "expected 414670600, is %d", + last_msg.msg.obs_dep_c.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_c.header.t.wn == 1898, + "incorrect value for last_msg.msg.obs_dep_c.header.t.wn, " + "expected 1898, is %d", + last_msg.msg.obs_dep_c.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_c.n_obs == 3, + "incorrect value for last_msg.msg.obs_dep_c.n_obs, expected 3, is %d", + last_msg.msg.obs_dep_c.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.f == 101, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.f, " + "expected 101, is %d", + last_msg.msg.obs_dep_c.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.i == 1631930, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.i, " + "expected 1631930, is %d", + last_msg.msg.obs_dep_c.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].P == 1296803396, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].P, " + "expected 1296803396, is %d", + last_msg.msg.obs_dep_c.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].cn0 == 186, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].cn0, " + "expected 186, is %d", + last_msg.msg.obs_dep_c.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].lock == 26274, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].lock, " + "expected 26274, is %d", + last_msg.msg.obs_dep_c.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[0].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[0].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[0].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.sat == 16, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.sat, " + "expected 16, is %d", + last_msg.msg.obs_dep_c.obs[0].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.f == 26, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.f, " + "expected 26, is %d", + last_msg.msg.obs_dep_c.obs[1].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.i == 368202, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.i, " + "expected 368202, is %d", + last_msg.msg.obs_dep_c.obs[1].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].P == 1167851351, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].P, " + "expected 1167851351, is %d", + last_msg.msg.obs_dep_c.obs[1].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].cn0 == 190, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].cn0, " + "expected 190, is %d", + last_msg.msg.obs_dep_c.obs[1].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].lock == 7886, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].lock, " + "expected 7886, is %d", + last_msg.msg.obs_dep_c.obs[1].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[1].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[1].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[1].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.sat == 27, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.sat, " + "expected 27, is %d", + last_msg.msg.obs_dep_c.obs[1].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.f == 114, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.f, " + "expected 114, is %d", + last_msg.msg.obs_dep_c.obs[2].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.i == 202266, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.i, " + "expected 202266, is %d", + last_msg.msg.obs_dep_c.obs[2].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].P == 1149000000, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].P, " + "expected 1149000000, is %d", + last_msg.msg.obs_dep_c.obs[2].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].cn0 == 217, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].cn0, " + "expected 217, is %d", + last_msg.msg.obs_dep_c.obs[2].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].lock == 18913, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].lock, " + "expected 18913, is %d", + last_msg.msg.obs_dep_c.obs[2].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[2].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[2].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[2].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.sat == 29, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.sat, " + "expected 29, is %d", + last_msg.msg.obs_dep_c.obs[2].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -516,247 +703,364 @@ START_TEST( test_auto_check_sbp_observation_MsgObsDepC ) logging_reset(); - sbp_callback_register(&sbp_state, 0x49, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x49, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,73,0,0,0,87,8,95,183,24,106,7,32,217,251,73,80,9,72,248,255,30,168,113,81,4,0,0,0,211,220,96,70,198,107,251,255,115,195,53,144,6,0,0,0,77,61,62,77,40,161,243,255,130,176,93,142,7,0,0,0,1,86,190,77,88,77,12,0,116,199,229,213,10,0,0,0,93,85,9,75,64,139,20,0,120,177,196,194,12,0,0,0,141,161, }; + u8 encoded_frame[] = { + 85, 73, 0, 0, 0, 87, 8, 95, 183, 24, 106, 7, 32, 217, + 251, 73, 80, 9, 72, 248, 255, 30, 168, 113, 81, 4, 0, 0, + 0, 211, 220, 96, 70, 198, 107, 251, 255, 115, 195, 53, 144, 6, + 0, 0, 0, 77, 61, 62, 77, 40, 161, 243, 255, 130, 176, 93, + 142, 7, 0, 0, 0, 1, 86, 190, 77, 88, 77, 12, 0, 116, + 199, 229, 213, 10, 0, 0, 0, 93, 85, 9, 75, 64, 139, 20, + 0, 120, 177, 196, 194, 12, 0, 0, 0, 141, 161, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_c.header.n_obs = 32; - - + test_msg.obs_dep_c.header.t.tow = 414670600; - + test_msg.obs_dep_c.header.t.wn = 1898; - + test_msg.obs_dep_c.n_obs = 5; - - - - + test_msg.obs_dep_c.obs[0].L.f = 30; - + test_msg.obs_dep_c.obs[0].L.i = -505847; - + test_msg.obs_dep_c.obs[0].P = 1347025881; - + test_msg.obs_dep_c.obs[0].cn0 = 168; - + test_msg.obs_dep_c.obs[0].lock = 20849; - - + test_msg.obs_dep_c.obs[0].sid.code = 0; - + test_msg.obs_dep_c.obs[0].sid.reserved = 0; - + test_msg.obs_dep_c.obs[0].sid.sat = 4; - - - + test_msg.obs_dep_c.obs[1].L.f = 115; - + test_msg.obs_dep_c.obs[1].L.i = -300090; - + test_msg.obs_dep_c.obs[1].P = 1180753107; - + test_msg.obs_dep_c.obs[1].cn0 = 195; - + test_msg.obs_dep_c.obs[1].lock = 36917; - - + test_msg.obs_dep_c.obs[1].sid.code = 0; - + test_msg.obs_dep_c.obs[1].sid.reserved = 0; - + test_msg.obs_dep_c.obs[1].sid.sat = 6; - - - + test_msg.obs_dep_c.obs[2].L.f = 130; - + test_msg.obs_dep_c.obs[2].L.i = -810712; - + test_msg.obs_dep_c.obs[2].P = 1295924557; - + test_msg.obs_dep_c.obs[2].cn0 = 176; - + test_msg.obs_dep_c.obs[2].lock = 36445; - - + test_msg.obs_dep_c.obs[2].sid.code = 0; - + test_msg.obs_dep_c.obs[2].sid.reserved = 0; - + test_msg.obs_dep_c.obs[2].sid.sat = 7; - - - + test_msg.obs_dep_c.obs[3].L.f = 116; - + test_msg.obs_dep_c.obs[3].L.i = 806232; - + test_msg.obs_dep_c.obs[3].P = 1304319489; - + test_msg.obs_dep_c.obs[3].cn0 = 199; - + test_msg.obs_dep_c.obs[3].lock = 54757; - - + test_msg.obs_dep_c.obs[3].sid.code = 0; - + test_msg.obs_dep_c.obs[3].sid.reserved = 0; - + test_msg.obs_dep_c.obs[3].sid.sat = 10; - - - + test_msg.obs_dep_c.obs[4].L.f = 120; - + test_msg.obs_dep_c.obs[4].L.i = 1346368; - + test_msg.obs_dep_c.obs[4].P = 1258902877; - + test_msg.obs_dep_c.obs[4].cn0 = 177; - + test_msg.obs_dep_c.obs[4].lock = 49860; - - + test_msg.obs_dep_c.obs[4].sid.code = 0; - + test_msg.obs_dep_c.obs[4].sid.reserved = 0; - + test_msg.obs_dep_c.obs[4].sid.sat = 12; sbp_message_send(&sbp_state, SbpMsgObsDepC, 0, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepC, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_c.header.n_obs == 32, "incorrect value for last_msg.msg.obs_dep_c.header.n_obs, expected 32, is %d", last_msg.msg.obs_dep_c.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_c.header.t.tow == 414670600, "incorrect value for last_msg.msg.obs_dep_c.header.t.tow, expected 414670600, is %d", last_msg.msg.obs_dep_c.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_c.header.t.wn == 1898, "incorrect value for last_msg.msg.obs_dep_c.header.t.wn, expected 1898, is %d", last_msg.msg.obs_dep_c.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_c.n_obs == 5, "incorrect value for last_msg.msg.obs_dep_c.n_obs, expected 5, is %d", last_msg.msg.obs_dep_c.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.f == 30, "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.f, expected 30, is %d", last_msg.msg.obs_dep_c.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.i == -505847, "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.i, expected -505847, is %d", last_msg.msg.obs_dep_c.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].P == 1347025881, "incorrect value for last_msg.msg.obs_dep_c.obs[0].P, expected 1347025881, is %d", last_msg.msg.obs_dep_c.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].cn0 == 168, "incorrect value for last_msg.msg.obs_dep_c.obs[0].cn0, expected 168, is %d", last_msg.msg.obs_dep_c.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].lock == 20849, "incorrect value for last_msg.msg.obs_dep_c.obs[0].lock, expected 20849, is %d", last_msg.msg.obs_dep_c.obs[0].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[0].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[0].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.sat == 4, "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.sat, expected 4, is %d", last_msg.msg.obs_dep_c.obs[0].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.f == 115, "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.f, expected 115, is %d", last_msg.msg.obs_dep_c.obs[1].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.i == -300090, "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.i, expected -300090, is %d", last_msg.msg.obs_dep_c.obs[1].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].P == 1180753107, "incorrect value for last_msg.msg.obs_dep_c.obs[1].P, expected 1180753107, is %d", last_msg.msg.obs_dep_c.obs[1].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].cn0 == 195, "incorrect value for last_msg.msg.obs_dep_c.obs[1].cn0, expected 195, is %d", last_msg.msg.obs_dep_c.obs[1].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].lock == 36917, "incorrect value for last_msg.msg.obs_dep_c.obs[1].lock, expected 36917, is %d", last_msg.msg.obs_dep_c.obs[1].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[1].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[1].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.sat == 6, "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.sat, expected 6, is %d", last_msg.msg.obs_dep_c.obs[1].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.f == 130, "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.f, expected 130, is %d", last_msg.msg.obs_dep_c.obs[2].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.i == -810712, "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.i, expected -810712, is %d", last_msg.msg.obs_dep_c.obs[2].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].P == 1295924557, "incorrect value for last_msg.msg.obs_dep_c.obs[2].P, expected 1295924557, is %d", last_msg.msg.obs_dep_c.obs[2].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].cn0 == 176, "incorrect value for last_msg.msg.obs_dep_c.obs[2].cn0, expected 176, is %d", last_msg.msg.obs_dep_c.obs[2].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].lock == 36445, "incorrect value for last_msg.msg.obs_dep_c.obs[2].lock, expected 36445, is %d", last_msg.msg.obs_dep_c.obs[2].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[2].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[2].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.sat == 7, "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.sat, expected 7, is %d", last_msg.msg.obs_dep_c.obs[2].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].L.f == 116, "incorrect value for last_msg.msg.obs_dep_c.obs[3].L.f, expected 116, is %d", last_msg.msg.obs_dep_c.obs[3].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].L.i == 806232, "incorrect value for last_msg.msg.obs_dep_c.obs[3].L.i, expected 806232, is %d", last_msg.msg.obs_dep_c.obs[3].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].P == 1304319489, "incorrect value for last_msg.msg.obs_dep_c.obs[3].P, expected 1304319489, is %d", last_msg.msg.obs_dep_c.obs[3].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].cn0 == 199, "incorrect value for last_msg.msg.obs_dep_c.obs[3].cn0, expected 199, is %d", last_msg.msg.obs_dep_c.obs[3].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].lock == 54757, "incorrect value for last_msg.msg.obs_dep_c.obs[3].lock, expected 54757, is %d", last_msg.msg.obs_dep_c.obs[3].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[3].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[3].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].sid.sat == 10, "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.sat, expected 10, is %d", last_msg.msg.obs_dep_c.obs[3].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].L.f == 120, "incorrect value for last_msg.msg.obs_dep_c.obs[4].L.f, expected 120, is %d", last_msg.msg.obs_dep_c.obs[4].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].L.i == 1346368, "incorrect value for last_msg.msg.obs_dep_c.obs[4].L.i, expected 1346368, is %d", last_msg.msg.obs_dep_c.obs[4].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].P == 1258902877, "incorrect value for last_msg.msg.obs_dep_c.obs[4].P, expected 1258902877, is %d", last_msg.msg.obs_dep_c.obs[4].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].cn0 == 177, "incorrect value for last_msg.msg.obs_dep_c.obs[4].cn0, expected 177, is %d", last_msg.msg.obs_dep_c.obs[4].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].lock == 49860, "incorrect value for last_msg.msg.obs_dep_c.obs[4].lock, expected 49860, is %d", last_msg.msg.obs_dep_c.obs[4].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[4].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[4].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].sid.sat == 12, "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.sat, expected 12, is %d", last_msg.msg.obs_dep_c.obs[4].sid.sat); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_c.header.n_obs == 32, + "incorrect value for last_msg.msg.obs_dep_c.header.n_obs, " + "expected 32, is %d", + last_msg.msg.obs_dep_c.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_c.header.t.tow == 414670600, + "incorrect value for last_msg.msg.obs_dep_c.header.t.tow, " + "expected 414670600, is %d", + last_msg.msg.obs_dep_c.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_c.header.t.wn == 1898, + "incorrect value for last_msg.msg.obs_dep_c.header.t.wn, " + "expected 1898, is %d", + last_msg.msg.obs_dep_c.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_c.n_obs == 5, + "incorrect value for last_msg.msg.obs_dep_c.n_obs, expected 5, is %d", + last_msg.msg.obs_dep_c.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.f == 30, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.f, " + "expected 30, is %d", + last_msg.msg.obs_dep_c.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.i == -505847, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.i, " + "expected -505847, is %d", + last_msg.msg.obs_dep_c.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].P == 1347025881, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].P, " + "expected 1347025881, is %d", + last_msg.msg.obs_dep_c.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].cn0 == 168, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].cn0, " + "expected 168, is %d", + last_msg.msg.obs_dep_c.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].lock == 20849, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].lock, " + "expected 20849, is %d", + last_msg.msg.obs_dep_c.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[0].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[0].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[0].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.sat == 4, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.sat, " + "expected 4, is %d", + last_msg.msg.obs_dep_c.obs[0].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.f == 115, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.f, " + "expected 115, is %d", + last_msg.msg.obs_dep_c.obs[1].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.i == -300090, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.i, " + "expected -300090, is %d", + last_msg.msg.obs_dep_c.obs[1].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].P == 1180753107, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].P, " + "expected 1180753107, is %d", + last_msg.msg.obs_dep_c.obs[1].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].cn0 == 195, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].cn0, " + "expected 195, is %d", + last_msg.msg.obs_dep_c.obs[1].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].lock == 36917, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].lock, " + "expected 36917, is %d", + last_msg.msg.obs_dep_c.obs[1].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[1].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[1].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[1].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.sat == 6, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.sat, " + "expected 6, is %d", + last_msg.msg.obs_dep_c.obs[1].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.f == 130, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.f, " + "expected 130, is %d", + last_msg.msg.obs_dep_c.obs[2].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.i == -810712, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.i, " + "expected -810712, is %d", + last_msg.msg.obs_dep_c.obs[2].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].P == 1295924557, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].P, " + "expected 1295924557, is %d", + last_msg.msg.obs_dep_c.obs[2].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].cn0 == 176, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].cn0, " + "expected 176, is %d", + last_msg.msg.obs_dep_c.obs[2].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].lock == 36445, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].lock, " + "expected 36445, is %d", + last_msg.msg.obs_dep_c.obs[2].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[2].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[2].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[2].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.sat == 7, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.sat, " + "expected 7, is %d", + last_msg.msg.obs_dep_c.obs[2].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].L.f == 116, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].L.f, " + "expected 116, is %d", + last_msg.msg.obs_dep_c.obs[3].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].L.i == 806232, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].L.i, " + "expected 806232, is %d", + last_msg.msg.obs_dep_c.obs[3].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].P == 1304319489, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].P, " + "expected 1304319489, is %d", + last_msg.msg.obs_dep_c.obs[3].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].cn0 == 199, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].cn0, " + "expected 199, is %d", + last_msg.msg.obs_dep_c.obs[3].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].lock == 54757, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].lock, " + "expected 54757, is %d", + last_msg.msg.obs_dep_c.obs[3].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[3].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[3].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[3].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].sid.sat == 10, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.sat, " + "expected 10, is %d", + last_msg.msg.obs_dep_c.obs[3].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].L.f == 120, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].L.f, " + "expected 120, is %d", + last_msg.msg.obs_dep_c.obs[4].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].L.i == 1346368, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].L.i, " + "expected 1346368, is %d", + last_msg.msg.obs_dep_c.obs[4].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].P == 1258902877, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].P, " + "expected 1258902877, is %d", + last_msg.msg.obs_dep_c.obs[4].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].cn0 == 177, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].cn0, " + "expected 177, is %d", + last_msg.msg.obs_dep_c.obs[4].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].lock == 49860, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].lock, " + "expected 49860, is %d", + last_msg.msg.obs_dep_c.obs[4].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[4].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[4].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[4].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].sid.sat == 12, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.sat, " + "expected 12, is %d", + last_msg.msg.obs_dep_c.obs[4].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -764,173 +1068,247 @@ START_TEST( test_auto_check_sbp_observation_MsgObsDepC ) logging_reset(); - sbp_callback_register(&sbp_state, 0x49, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x49, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,73,0,0,0,55,8,95,183,24,106,7,33,70,167,75,77,140,136,23,0,90,187,158,129,16,0,0,0,232,255,155,69,45,175,5,0,17,208,175,56,27,0,0,0,64,89,124,68,45,96,3,0,75,185,73,206,29,0,0,0,220,158, }; + u8 encoded_frame[] = { + 85, 73, 0, 0, 0, 55, 8, 95, 183, 24, 106, 7, 33, 70, 167, 75, + 77, 140, 136, 23, 0, 90, 187, 158, 129, 16, 0, 0, 0, 232, 255, 155, + 69, 45, 175, 5, 0, 17, 208, 175, 56, 27, 0, 0, 0, 64, 89, 124, + 68, 45, 96, 3, 0, 75, 185, 73, 206, 29, 0, 0, 0, 220, 158, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_c.header.n_obs = 33; - - + test_msg.obs_dep_c.header.t.tow = 414670600; - + test_msg.obs_dep_c.header.t.wn = 1898; - + test_msg.obs_dep_c.n_obs = 3; - - - - + test_msg.obs_dep_c.obs[0].L.f = 90; - + test_msg.obs_dep_c.obs[0].L.i = 1542284; - + test_msg.obs_dep_c.obs[0].P = 1296803654; - + test_msg.obs_dep_c.obs[0].cn0 = 187; - + test_msg.obs_dep_c.obs[0].lock = 33182; - - + test_msg.obs_dep_c.obs[0].sid.code = 0; - + test_msg.obs_dep_c.obs[0].sid.reserved = 0; - + test_msg.obs_dep_c.obs[0].sid.sat = 16; - - - + test_msg.obs_dep_c.obs[1].L.f = 17; - + test_msg.obs_dep_c.obs[1].L.i = 372525; - + test_msg.obs_dep_c.obs[1].P = 1167851496; - + test_msg.obs_dep_c.obs[1].cn0 = 208; - + test_msg.obs_dep_c.obs[1].lock = 14511; - - + test_msg.obs_dep_c.obs[1].sid.code = 0; - + test_msg.obs_dep_c.obs[1].sid.reserved = 0; - + test_msg.obs_dep_c.obs[1].sid.sat = 27; - - - + test_msg.obs_dep_c.obs[2].L.f = 75; - + test_msg.obs_dep_c.obs[2].L.i = 221229; - + test_msg.obs_dep_c.obs[2].P = 1149000000; - + test_msg.obs_dep_c.obs[2].cn0 = 185; - + test_msg.obs_dep_c.obs[2].lock = 52809; - - + test_msg.obs_dep_c.obs[2].sid.code = 0; - + test_msg.obs_dep_c.obs[2].sid.reserved = 0; - + test_msg.obs_dep_c.obs[2].sid.sat = 29; sbp_message_send(&sbp_state, SbpMsgObsDepC, 0, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepC, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_c.header.n_obs == 33, "incorrect value for last_msg.msg.obs_dep_c.header.n_obs, expected 33, is %d", last_msg.msg.obs_dep_c.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_c.header.t.tow == 414670600, "incorrect value for last_msg.msg.obs_dep_c.header.t.tow, expected 414670600, is %d", last_msg.msg.obs_dep_c.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_c.header.t.wn == 1898, "incorrect value for last_msg.msg.obs_dep_c.header.t.wn, expected 1898, is %d", last_msg.msg.obs_dep_c.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_c.n_obs == 3, "incorrect value for last_msg.msg.obs_dep_c.n_obs, expected 3, is %d", last_msg.msg.obs_dep_c.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.f == 90, "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.f, expected 90, is %d", last_msg.msg.obs_dep_c.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.i == 1542284, "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.i, expected 1542284, is %d", last_msg.msg.obs_dep_c.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].P == 1296803654, "incorrect value for last_msg.msg.obs_dep_c.obs[0].P, expected 1296803654, is %d", last_msg.msg.obs_dep_c.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].cn0 == 187, "incorrect value for last_msg.msg.obs_dep_c.obs[0].cn0, expected 187, is %d", last_msg.msg.obs_dep_c.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].lock == 33182, "incorrect value for last_msg.msg.obs_dep_c.obs[0].lock, expected 33182, is %d", last_msg.msg.obs_dep_c.obs[0].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[0].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[0].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.sat == 16, "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.sat, expected 16, is %d", last_msg.msg.obs_dep_c.obs[0].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.f == 17, "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.f, expected 17, is %d", last_msg.msg.obs_dep_c.obs[1].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.i == 372525, "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.i, expected 372525, is %d", last_msg.msg.obs_dep_c.obs[1].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].P == 1167851496, "incorrect value for last_msg.msg.obs_dep_c.obs[1].P, expected 1167851496, is %d", last_msg.msg.obs_dep_c.obs[1].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].cn0 == 208, "incorrect value for last_msg.msg.obs_dep_c.obs[1].cn0, expected 208, is %d", last_msg.msg.obs_dep_c.obs[1].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].lock == 14511, "incorrect value for last_msg.msg.obs_dep_c.obs[1].lock, expected 14511, is %d", last_msg.msg.obs_dep_c.obs[1].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[1].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[1].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.sat == 27, "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.sat, expected 27, is %d", last_msg.msg.obs_dep_c.obs[1].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.f == 75, "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.f, expected 75, is %d", last_msg.msg.obs_dep_c.obs[2].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.i == 221229, "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.i, expected 221229, is %d", last_msg.msg.obs_dep_c.obs[2].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].P == 1149000000, "incorrect value for last_msg.msg.obs_dep_c.obs[2].P, expected 1149000000, is %d", last_msg.msg.obs_dep_c.obs[2].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].cn0 == 185, "incorrect value for last_msg.msg.obs_dep_c.obs[2].cn0, expected 185, is %d", last_msg.msg.obs_dep_c.obs[2].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].lock == 52809, "incorrect value for last_msg.msg.obs_dep_c.obs[2].lock, expected 52809, is %d", last_msg.msg.obs_dep_c.obs[2].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[2].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[2].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.sat == 29, "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.sat, expected 29, is %d", last_msg.msg.obs_dep_c.obs[2].sid.sat); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_c.header.n_obs == 33, + "incorrect value for last_msg.msg.obs_dep_c.header.n_obs, " + "expected 33, is %d", + last_msg.msg.obs_dep_c.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_c.header.t.tow == 414670600, + "incorrect value for last_msg.msg.obs_dep_c.header.t.tow, " + "expected 414670600, is %d", + last_msg.msg.obs_dep_c.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_c.header.t.wn == 1898, + "incorrect value for last_msg.msg.obs_dep_c.header.t.wn, " + "expected 1898, is %d", + last_msg.msg.obs_dep_c.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_c.n_obs == 3, + "incorrect value for last_msg.msg.obs_dep_c.n_obs, expected 3, is %d", + last_msg.msg.obs_dep_c.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.f == 90, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.f, " + "expected 90, is %d", + last_msg.msg.obs_dep_c.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.i == 1542284, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.i, " + "expected 1542284, is %d", + last_msg.msg.obs_dep_c.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].P == 1296803654, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].P, " + "expected 1296803654, is %d", + last_msg.msg.obs_dep_c.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].cn0 == 187, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].cn0, " + "expected 187, is %d", + last_msg.msg.obs_dep_c.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].lock == 33182, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].lock, " + "expected 33182, is %d", + last_msg.msg.obs_dep_c.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[0].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[0].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[0].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.sat == 16, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.sat, " + "expected 16, is %d", + last_msg.msg.obs_dep_c.obs[0].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.f == 17, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.f, " + "expected 17, is %d", + last_msg.msg.obs_dep_c.obs[1].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.i == 372525, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.i, " + "expected 372525, is %d", + last_msg.msg.obs_dep_c.obs[1].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].P == 1167851496, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].P, " + "expected 1167851496, is %d", + last_msg.msg.obs_dep_c.obs[1].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].cn0 == 208, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].cn0, " + "expected 208, is %d", + last_msg.msg.obs_dep_c.obs[1].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].lock == 14511, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].lock, " + "expected 14511, is %d", + last_msg.msg.obs_dep_c.obs[1].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[1].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[1].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[1].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.sat == 27, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.sat, " + "expected 27, is %d", + last_msg.msg.obs_dep_c.obs[1].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.f == 75, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.f, " + "expected 75, is %d", + last_msg.msg.obs_dep_c.obs[2].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.i == 221229, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.i, " + "expected 221229, is %d", + last_msg.msg.obs_dep_c.obs[2].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].P == 1149000000, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].P, " + "expected 1149000000, is %d", + last_msg.msg.obs_dep_c.obs[2].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].cn0 == 185, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].cn0, " + "expected 185, is %d", + last_msg.msg.obs_dep_c.obs[2].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].lock == 52809, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].lock, " + "expected 52809, is %d", + last_msg.msg.obs_dep_c.obs[2].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[2].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[2].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[2].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.sat == 29, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.sat, " + "expected 29, is %d", + last_msg.msg.obs_dep_c.obs[2].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -938,250 +1316,367 @@ START_TEST( test_auto_check_sbp_observation_MsgObsDepC ) logging_reset(); - sbp_callback_register(&sbp_state, 0x49, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x49, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,73,0,70,152,87,208,95,183,24,106,7,32,44,8,74,80,86,93,247,255,57,158,229,229,4,0,0,0,224,229,96,70,156,146,250,255,221,200,20,28,6,0,0,0,60,82,62,77,93,58,242,255,39,164,180,178,7,0,0,0,222,73,190,77,46,39,13,0,202,181,233,164,10,0,0,0,149,64,9,75,114,191,21,0,249,182,196,209,12,0,0,0,112,8, }; + u8 encoded_frame[] = { + 85, 73, 0, 70, 152, 87, 208, 95, 183, 24, 106, 7, 32, 44, + 8, 74, 80, 86, 93, 247, 255, 57, 158, 229, 229, 4, 0, 0, + 0, 224, 229, 96, 70, 156, 146, 250, 255, 221, 200, 20, 28, 6, + 0, 0, 0, 60, 82, 62, 77, 93, 58, 242, 255, 39, 164, 180, + 178, 7, 0, 0, 0, 222, 73, 190, 77, 46, 39, 13, 0, 202, + 181, 233, 164, 10, 0, 0, 0, 149, 64, 9, 75, 114, 191, 21, + 0, 249, 182, 196, 209, 12, 0, 0, 0, 112, 8, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_c.header.n_obs = 32; - - + test_msg.obs_dep_c.header.t.tow = 414670800; - + test_msg.obs_dep_c.header.t.wn = 1898; - + test_msg.obs_dep_c.n_obs = 5; - - - - + test_msg.obs_dep_c.obs[0].L.f = 57; - + test_msg.obs_dep_c.obs[0].L.i = -565930; - + test_msg.obs_dep_c.obs[0].P = 1347029036; - + test_msg.obs_dep_c.obs[0].cn0 = 158; - + test_msg.obs_dep_c.obs[0].lock = 58853; - - + test_msg.obs_dep_c.obs[0].sid.code = 0; - + test_msg.obs_dep_c.obs[0].sid.reserved = 0; - + test_msg.obs_dep_c.obs[0].sid.sat = 4; - - - + test_msg.obs_dep_c.obs[1].L.f = 221; - + test_msg.obs_dep_c.obs[1].L.i = -355684; - + test_msg.obs_dep_c.obs[1].P = 1180755424; - + test_msg.obs_dep_c.obs[1].cn0 = 200; - + test_msg.obs_dep_c.obs[1].lock = 7188; - - + test_msg.obs_dep_c.obs[1].sid.code = 0; - + test_msg.obs_dep_c.obs[1].sid.reserved = 0; - + test_msg.obs_dep_c.obs[1].sid.sat = 6; - - - + test_msg.obs_dep_c.obs[2].L.f = 39; - + test_msg.obs_dep_c.obs[2].L.i = -902563; - + test_msg.obs_dep_c.obs[2].P = 1295929916; - + test_msg.obs_dep_c.obs[2].cn0 = 164; - + test_msg.obs_dep_c.obs[2].lock = 45748; - - + test_msg.obs_dep_c.obs[2].sid.code = 0; - + test_msg.obs_dep_c.obs[2].sid.reserved = 0; - + test_msg.obs_dep_c.obs[2].sid.sat = 7; - - - + test_msg.obs_dep_c.obs[3].L.f = 202; - + test_msg.obs_dep_c.obs[3].L.i = 861998; - + test_msg.obs_dep_c.obs[3].P = 1304316382; - + test_msg.obs_dep_c.obs[3].cn0 = 181; - + test_msg.obs_dep_c.obs[3].lock = 42217; - - + test_msg.obs_dep_c.obs[3].sid.code = 0; - + test_msg.obs_dep_c.obs[3].sid.reserved = 0; - + test_msg.obs_dep_c.obs[3].sid.sat = 10; - - - + test_msg.obs_dep_c.obs[4].L.f = 249; - + test_msg.obs_dep_c.obs[4].L.i = 1425266; - + test_msg.obs_dep_c.obs[4].P = 1258897557; - + test_msg.obs_dep_c.obs[4].cn0 = 182; - + test_msg.obs_dep_c.obs[4].lock = 53700; - - + test_msg.obs_dep_c.obs[4].sid.code = 0; - + test_msg.obs_dep_c.obs[4].sid.reserved = 0; - + test_msg.obs_dep_c.obs[4].sid.sat = 12; sbp_message_send(&sbp_state, SbpMsgObsDepC, 38982, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 38982, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepC, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_c.header.n_obs == 32, "incorrect value for last_msg.msg.obs_dep_c.header.n_obs, expected 32, is %d", last_msg.msg.obs_dep_c.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_c.header.t.tow == 414670800, "incorrect value for last_msg.msg.obs_dep_c.header.t.tow, expected 414670800, is %d", last_msg.msg.obs_dep_c.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_c.header.t.wn == 1898, "incorrect value for last_msg.msg.obs_dep_c.header.t.wn, expected 1898, is %d", last_msg.msg.obs_dep_c.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_c.n_obs == 5, "incorrect value for last_msg.msg.obs_dep_c.n_obs, expected 5, is %d", last_msg.msg.obs_dep_c.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.f == 57, "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.f, expected 57, is %d", last_msg.msg.obs_dep_c.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.i == -565930, "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.i, expected -565930, is %d", last_msg.msg.obs_dep_c.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].P == 1347029036, "incorrect value for last_msg.msg.obs_dep_c.obs[0].P, expected 1347029036, is %d", last_msg.msg.obs_dep_c.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].cn0 == 158, "incorrect value for last_msg.msg.obs_dep_c.obs[0].cn0, expected 158, is %d", last_msg.msg.obs_dep_c.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].lock == 58853, "incorrect value for last_msg.msg.obs_dep_c.obs[0].lock, expected 58853, is %d", last_msg.msg.obs_dep_c.obs[0].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[0].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[0].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.sat == 4, "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.sat, expected 4, is %d", last_msg.msg.obs_dep_c.obs[0].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.f == 221, "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.f, expected 221, is %d", last_msg.msg.obs_dep_c.obs[1].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.i == -355684, "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.i, expected -355684, is %d", last_msg.msg.obs_dep_c.obs[1].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].P == 1180755424, "incorrect value for last_msg.msg.obs_dep_c.obs[1].P, expected 1180755424, is %d", last_msg.msg.obs_dep_c.obs[1].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].cn0 == 200, "incorrect value for last_msg.msg.obs_dep_c.obs[1].cn0, expected 200, is %d", last_msg.msg.obs_dep_c.obs[1].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].lock == 7188, "incorrect value for last_msg.msg.obs_dep_c.obs[1].lock, expected 7188, is %d", last_msg.msg.obs_dep_c.obs[1].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[1].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[1].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.sat == 6, "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.sat, expected 6, is %d", last_msg.msg.obs_dep_c.obs[1].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.f == 39, "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.f, expected 39, is %d", last_msg.msg.obs_dep_c.obs[2].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.i == -902563, "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.i, expected -902563, is %d", last_msg.msg.obs_dep_c.obs[2].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].P == 1295929916, "incorrect value for last_msg.msg.obs_dep_c.obs[2].P, expected 1295929916, is %d", last_msg.msg.obs_dep_c.obs[2].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].cn0 == 164, "incorrect value for last_msg.msg.obs_dep_c.obs[2].cn0, expected 164, is %d", last_msg.msg.obs_dep_c.obs[2].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].lock == 45748, "incorrect value for last_msg.msg.obs_dep_c.obs[2].lock, expected 45748, is %d", last_msg.msg.obs_dep_c.obs[2].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[2].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[2].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.sat == 7, "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.sat, expected 7, is %d", last_msg.msg.obs_dep_c.obs[2].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].L.f == 202, "incorrect value for last_msg.msg.obs_dep_c.obs[3].L.f, expected 202, is %d", last_msg.msg.obs_dep_c.obs[3].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].L.i == 861998, "incorrect value for last_msg.msg.obs_dep_c.obs[3].L.i, expected 861998, is %d", last_msg.msg.obs_dep_c.obs[3].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].P == 1304316382, "incorrect value for last_msg.msg.obs_dep_c.obs[3].P, expected 1304316382, is %d", last_msg.msg.obs_dep_c.obs[3].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].cn0 == 181, "incorrect value for last_msg.msg.obs_dep_c.obs[3].cn0, expected 181, is %d", last_msg.msg.obs_dep_c.obs[3].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].lock == 42217, "incorrect value for last_msg.msg.obs_dep_c.obs[3].lock, expected 42217, is %d", last_msg.msg.obs_dep_c.obs[3].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[3].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[3].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].sid.sat == 10, "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.sat, expected 10, is %d", last_msg.msg.obs_dep_c.obs[3].sid.sat); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].L.f == 249, "incorrect value for last_msg.msg.obs_dep_c.obs[4].L.f, expected 249, is %d", last_msg.msg.obs_dep_c.obs[4].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].L.i == 1425266, "incorrect value for last_msg.msg.obs_dep_c.obs[4].L.i, expected 1425266, is %d", last_msg.msg.obs_dep_c.obs[4].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].P == 1258897557, "incorrect value for last_msg.msg.obs_dep_c.obs[4].P, expected 1258897557, is %d", last_msg.msg.obs_dep_c.obs[4].P); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].cn0 == 182, "incorrect value for last_msg.msg.obs_dep_c.obs[4].cn0, expected 182, is %d", last_msg.msg.obs_dep_c.obs[4].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].lock == 53700, "incorrect value for last_msg.msg.obs_dep_c.obs[4].lock, expected 53700, is %d", last_msg.msg.obs_dep_c.obs[4].lock); - - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].sid.code == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.code, expected 0, is %d", last_msg.msg.obs_dep_c.obs[4].sid.code); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].sid.reserved == 0, "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.reserved, expected 0, is %d", last_msg.msg.obs_dep_c.obs[4].sid.reserved); - - ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].sid.sat == 12, "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.sat, expected 12, is %d", last_msg.msg.obs_dep_c.obs[4].sid.sat); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_c.header.n_obs == 32, + "incorrect value for last_msg.msg.obs_dep_c.header.n_obs, " + "expected 32, is %d", + last_msg.msg.obs_dep_c.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_c.header.t.tow == 414670800, + "incorrect value for last_msg.msg.obs_dep_c.header.t.tow, " + "expected 414670800, is %d", + last_msg.msg.obs_dep_c.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_c.header.t.wn == 1898, + "incorrect value for last_msg.msg.obs_dep_c.header.t.wn, " + "expected 1898, is %d", + last_msg.msg.obs_dep_c.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_c.n_obs == 5, + "incorrect value for last_msg.msg.obs_dep_c.n_obs, expected 5, is %d", + last_msg.msg.obs_dep_c.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.f == 57, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.f, " + "expected 57, is %d", + last_msg.msg.obs_dep_c.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].L.i == -565930, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].L.i, " + "expected -565930, is %d", + last_msg.msg.obs_dep_c.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].P == 1347029036, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].P, " + "expected 1347029036, is %d", + last_msg.msg.obs_dep_c.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].cn0 == 158, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].cn0, " + "expected 158, is %d", + last_msg.msg.obs_dep_c.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].lock == 58853, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].lock, " + "expected 58853, is %d", + last_msg.msg.obs_dep_c.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[0].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[0].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[0].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[0].sid.sat == 4, + "incorrect value for last_msg.msg.obs_dep_c.obs[0].sid.sat, " + "expected 4, is %d", + last_msg.msg.obs_dep_c.obs[0].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.f == 221, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.f, " + "expected 221, is %d", + last_msg.msg.obs_dep_c.obs[1].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].L.i == -355684, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].L.i, " + "expected -355684, is %d", + last_msg.msg.obs_dep_c.obs[1].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].P == 1180755424, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].P, " + "expected 1180755424, is %d", + last_msg.msg.obs_dep_c.obs[1].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].cn0 == 200, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].cn0, " + "expected 200, is %d", + last_msg.msg.obs_dep_c.obs[1].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].lock == 7188, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].lock, " + "expected 7188, is %d", + last_msg.msg.obs_dep_c.obs[1].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[1].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[1].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[1].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[1].sid.sat == 6, + "incorrect value for last_msg.msg.obs_dep_c.obs[1].sid.sat, " + "expected 6, is %d", + last_msg.msg.obs_dep_c.obs[1].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.f == 39, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.f, " + "expected 39, is %d", + last_msg.msg.obs_dep_c.obs[2].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].L.i == -902563, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].L.i, " + "expected -902563, is %d", + last_msg.msg.obs_dep_c.obs[2].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].P == 1295929916, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].P, " + "expected 1295929916, is %d", + last_msg.msg.obs_dep_c.obs[2].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].cn0 == 164, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].cn0, " + "expected 164, is %d", + last_msg.msg.obs_dep_c.obs[2].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].lock == 45748, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].lock, " + "expected 45748, is %d", + last_msg.msg.obs_dep_c.obs[2].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[2].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[2].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[2].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[2].sid.sat == 7, + "incorrect value for last_msg.msg.obs_dep_c.obs[2].sid.sat, " + "expected 7, is %d", + last_msg.msg.obs_dep_c.obs[2].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].L.f == 202, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].L.f, " + "expected 202, is %d", + last_msg.msg.obs_dep_c.obs[3].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].L.i == 861998, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].L.i, " + "expected 861998, is %d", + last_msg.msg.obs_dep_c.obs[3].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].P == 1304316382, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].P, " + "expected 1304316382, is %d", + last_msg.msg.obs_dep_c.obs[3].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].cn0 == 181, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].cn0, " + "expected 181, is %d", + last_msg.msg.obs_dep_c.obs[3].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].lock == 42217, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].lock, " + "expected 42217, is %d", + last_msg.msg.obs_dep_c.obs[3].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[3].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[3].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[3].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[3].sid.sat == 10, + "incorrect value for last_msg.msg.obs_dep_c.obs[3].sid.sat, " + "expected 10, is %d", + last_msg.msg.obs_dep_c.obs[3].sid.sat); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].L.f == 249, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].L.f, " + "expected 249, is %d", + last_msg.msg.obs_dep_c.obs[4].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].L.i == 1425266, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].L.i, " + "expected 1425266, is %d", + last_msg.msg.obs_dep_c.obs[4].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].P == 1258897557, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].P, " + "expected 1258897557, is %d", + last_msg.msg.obs_dep_c.obs[4].P); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].cn0 == 182, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].cn0, " + "expected 182, is %d", + last_msg.msg.obs_dep_c.obs[4].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].lock == 53700, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].lock, " + "expected 53700, is %d", + last_msg.msg.obs_dep_c.obs[4].lock); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].sid.code == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.code, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[4].sid.code); + + ck_assert_msg( + last_msg.msg.obs_dep_c.obs[4].sid.reserved == 0, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.reserved, " + "expected 0, is %d", + last_msg.msg.obs_dep_c.obs[4].sid.reserved); + + ck_assert_msg(last_msg.msg.obs_dep_c.obs[4].sid.sat == 12, + "incorrect value for last_msg.msg.obs_dep_c.obs[4].sid.sat, " + "expected 12, is %d", + last_msg.msg.obs_dep_c.obs[4].sid.sat); } } END_TEST -Suite* auto_check_sbp_observation_MsgObsDepC_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgObsDepC"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgObsDepC"); +Suite *auto_check_sbp_observation_MsgObsDepC_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgObsDepC"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_observation_MsgObsDepC"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgObsDepC); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgOsr.c b/c/test/auto_check_sbp_observation_MsgOsr.c index 234916a07..b833f789d 100644 --- a/c/test/auto_check_sbp_observation_MsgOsr.c +++ b/c/test/auto_check_sbp_observation_MsgOsr.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgOsr.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgOsr.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgOsr ) -{ +START_TEST(test_auto_check_sbp_observation_MsgOsr) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgOsr ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,609 +90,940 @@ START_TEST( test_auto_check_sbp_observation_MsgOsr ) logging_reset(); - sbp_callback_register(&sbp_state, 0x640, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x640, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,64,6,0,0,239,248,225,233,29,0,0,0,0,104,8,64,75,143,241,68,230,250,62,7,66,15,3,1,0,13,0,7,0,7,0,206,232,105,63,236,49,170,6,75,15,3,13,0,13,0,3,0,3,0,45,145,198,62,33,7,153,6,128,15,3,14,0,13,0,3,0,3,0,89,132,204,67,143,46,32,7,127,15,3,15,0,13,0,5,0,5,0,244,254,164,60,22,176,95,6,55,15,3,17,0,0,0,2,0,2,0,106,157,101,62,151,214,142,6,108,15,3,19,0,13,0,3,0,3,0,81,237,60,63,181,119,165,6,206,15,3,28,0,13,0,3,0,3,0,134,228,110,64,183,159,197,6,200,15,3,30,0,13,0,3,0,3,0,53,144,241,68,78,112,165,5,170,15,3,1,6,21,0,7,0,7,0,251,232,105,63,163,128,49,5,129,15,3,13,6,21,0,3,0,3,0,112,145,198,62,37,32,36,5,46,15,3,14,6,21,0,3,0,3,0,166,132,204,67,184,112,141,5,95,15,3,15,6,21,0,5,0,5,0,121,227, }; + u8 encoded_frame[] = { + 85, 64, 6, 0, 0, 239, 248, 225, 233, 29, 0, 0, 0, 0, + 104, 8, 64, 75, 143, 241, 68, 230, 250, 62, 7, 66, 15, 3, + 1, 0, 13, 0, 7, 0, 7, 0, 206, 232, 105, 63, 236, 49, + 170, 6, 75, 15, 3, 13, 0, 13, 0, 3, 0, 3, 0, 45, + 145, 198, 62, 33, 7, 153, 6, 128, 15, 3, 14, 0, 13, 0, + 3, 0, 3, 0, 89, 132, 204, 67, 143, 46, 32, 7, 127, 15, + 3, 15, 0, 13, 0, 5, 0, 5, 0, 244, 254, 164, 60, 22, + 176, 95, 6, 55, 15, 3, 17, 0, 0, 0, 2, 0, 2, 0, + 106, 157, 101, 62, 151, 214, 142, 6, 108, 15, 3, 19, 0, 13, + 0, 3, 0, 3, 0, 81, 237, 60, 63, 181, 119, 165, 6, 206, + 15, 3, 28, 0, 13, 0, 3, 0, 3, 0, 134, 228, 110, 64, + 183, 159, 197, 6, 200, 15, 3, 30, 0, 13, 0, 3, 0, 3, + 0, 53, 144, 241, 68, 78, 112, 165, 5, 170, 15, 3, 1, 6, + 21, 0, 7, 0, 7, 0, 251, 232, 105, 63, 163, 128, 49, 5, + 129, 15, 3, 13, 6, 21, 0, 3, 0, 3, 0, 112, 145, 198, + 62, 37, 32, 36, 5, 46, 15, 3, 14, 6, 21, 0, 3, 0, + 3, 0, 166, 132, 204, 67, 184, 112, 141, 5, 95, 15, 3, 15, + 6, 21, 0, 5, 0, 5, 0, 121, 227, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.osr.header.n_obs = 64; - - + test_msg.osr.header.t.ns_residual = 0; - + test_msg.osr.header.t.tow = 501867000; - + test_msg.osr.header.t.wn = 2152; - + test_msg.osr.n_obs = 12; - - - - + test_msg.osr.obs[0].L.f = 66; - + test_msg.osr.obs[0].L.i = 121567974; - + test_msg.osr.obs[0].P = 1156681547; - + test_msg.osr.obs[0].flags = 3; - + test_msg.osr.obs[0].iono_std = 13; - + test_msg.osr.obs[0].lock = 15; - + test_msg.osr.obs[0].range_std = 7; - - + test_msg.osr.obs[0].sid.code = 0; - + test_msg.osr.obs[0].sid.sat = 1; - + test_msg.osr.obs[0].tropo_std = 7; - - - + test_msg.osr.obs[1].L.f = 75; - + test_msg.osr.obs[1].L.i = 111817196; - + test_msg.osr.obs[1].P = 1063905486; - + test_msg.osr.obs[1].flags = 3; - + test_msg.osr.obs[1].iono_std = 13; - + test_msg.osr.obs[1].lock = 15; - + test_msg.osr.obs[1].range_std = 3; - - + test_msg.osr.obs[1].sid.code = 0; - + test_msg.osr.obs[1].sid.sat = 13; - + test_msg.osr.obs[1].tropo_std = 3; - - - + test_msg.osr.obs[2].L.f = 128; - + test_msg.osr.obs[2].L.i = 110692129; - + test_msg.osr.obs[2].P = 1053200685; - + test_msg.osr.obs[2].flags = 3; - + test_msg.osr.obs[2].iono_std = 13; - + test_msg.osr.obs[2].lock = 15; - + test_msg.osr.obs[2].range_std = 3; - - + test_msg.osr.obs[2].sid.code = 0; - + test_msg.osr.obs[2].sid.sat = 14; - + test_msg.osr.obs[2].tropo_std = 3; - - - + test_msg.osr.obs[3].L.f = 127; - + test_msg.osr.obs[3].L.i = 119549583; - + test_msg.osr.obs[3].P = 1137476697; - + test_msg.osr.obs[3].flags = 3; - + test_msg.osr.obs[3].iono_std = 13; - + test_msg.osr.obs[3].lock = 15; - + test_msg.osr.obs[3].range_std = 5; - - + test_msg.osr.obs[3].sid.code = 0; - + test_msg.osr.obs[3].sid.sat = 15; - + test_msg.osr.obs[3].tropo_std = 5; - - - + test_msg.osr.obs[4].L.f = 55; - + test_msg.osr.obs[4].L.i = 106934294; - + test_msg.osr.obs[4].P = 1017446132; - + test_msg.osr.obs[4].flags = 3; - + test_msg.osr.obs[4].iono_std = 0; - + test_msg.osr.obs[4].lock = 15; - + test_msg.osr.obs[4].range_std = 2; - - + test_msg.osr.obs[4].sid.code = 0; - + test_msg.osr.obs[4].sid.sat = 17; - + test_msg.osr.obs[4].tropo_std = 2; - - - + test_msg.osr.obs[5].L.f = 108; - + test_msg.osr.obs[5].L.i = 110024343; - + test_msg.osr.obs[5].P = 1046846826; - + test_msg.osr.obs[5].flags = 3; - + test_msg.osr.obs[5].iono_std = 13; - + test_msg.osr.obs[5].lock = 15; - + test_msg.osr.obs[5].range_std = 3; - - + test_msg.osr.obs[5].sid.code = 0; - + test_msg.osr.obs[5].sid.sat = 19; - + test_msg.osr.obs[5].tropo_std = 3; - - - + test_msg.osr.obs[6].L.f = 206; - + test_msg.osr.obs[6].L.i = 111507381; - + test_msg.osr.obs[6].P = 1060957521; - + test_msg.osr.obs[6].flags = 3; - + test_msg.osr.obs[6].iono_std = 13; - + test_msg.osr.obs[6].lock = 15; - + test_msg.osr.obs[6].range_std = 3; - - + test_msg.osr.obs[6].sid.code = 0; - + test_msg.osr.obs[6].sid.sat = 28; - + test_msg.osr.obs[6].tropo_std = 3; - - - + test_msg.osr.obs[7].L.f = 200; - + test_msg.osr.obs[7].L.i = 113614775; - + test_msg.osr.obs[7].P = 1081009286; - + test_msg.osr.obs[7].flags = 3; - + test_msg.osr.obs[7].iono_std = 13; - + test_msg.osr.obs[7].lock = 15; - + test_msg.osr.obs[7].range_std = 3; - - + test_msg.osr.obs[7].sid.code = 0; - + test_msg.osr.obs[7].sid.sat = 30; - + test_msg.osr.obs[7].tropo_std = 3; - - - + test_msg.osr.obs[8].L.f = 170; - + test_msg.osr.obs[8].L.i = 94728270; - + test_msg.osr.obs[8].P = 1156681781; - + test_msg.osr.obs[8].flags = 3; - + test_msg.osr.obs[8].iono_std = 21; - + test_msg.osr.obs[8].lock = 15; - + test_msg.osr.obs[8].range_std = 7; - - + test_msg.osr.obs[8].sid.code = 6; - + test_msg.osr.obs[8].sid.sat = 1; - + test_msg.osr.obs[8].tropo_std = 7; - - - + test_msg.osr.obs[9].L.f = 129; - + test_msg.osr.obs[9].L.i = 87130275; - + test_msg.osr.obs[9].P = 1063905531; - + test_msg.osr.obs[9].flags = 3; - + test_msg.osr.obs[9].iono_std = 21; - + test_msg.osr.obs[9].lock = 15; - + test_msg.osr.obs[9].range_std = 3; - - + test_msg.osr.obs[9].sid.code = 6; - + test_msg.osr.obs[9].sid.sat = 13; - + test_msg.osr.obs[9].tropo_std = 3; - - - + test_msg.osr.obs[10].L.f = 46; - + test_msg.osr.obs[10].L.i = 86253605; - + test_msg.osr.obs[10].P = 1053200752; - + test_msg.osr.obs[10].flags = 3; - + test_msg.osr.obs[10].iono_std = 21; - + test_msg.osr.obs[10].lock = 15; - + test_msg.osr.obs[10].range_std = 3; - - + test_msg.osr.obs[10].sid.code = 6; - + test_msg.osr.obs[10].sid.sat = 14; - + test_msg.osr.obs[10].tropo_std = 3; - - - + test_msg.osr.obs[11].L.f = 95; - + test_msg.osr.obs[11].L.i = 93155512; - + test_msg.osr.obs[11].P = 1137476774; - + test_msg.osr.obs[11].flags = 3; - + test_msg.osr.obs[11].iono_std = 21; - + test_msg.osr.obs[11].lock = 15; - + test_msg.osr.obs[11].range_std = 5; - - + test_msg.osr.obs[11].sid.code = 6; - + test_msg.osr.obs[11].sid.sat = 15; - + test_msg.osr.obs[11].tropo_std = 5; sbp_message_send(&sbp_state, SbpMsgOsr, 0, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgOsr, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.osr.header.n_obs == 64, "incorrect value for last_msg.msg.osr.header.n_obs, expected 64, is %d", last_msg.msg.osr.header.n_obs); - - - ck_assert_msg(last_msg.msg.osr.header.t.ns_residual == 0, "incorrect value for last_msg.msg.osr.header.t.ns_residual, expected 0, is %d", last_msg.msg.osr.header.t.ns_residual); - - ck_assert_msg(last_msg.msg.osr.header.t.tow == 501867000, "incorrect value for last_msg.msg.osr.header.t.tow, expected 501867000, is %d", last_msg.msg.osr.header.t.tow); - - ck_assert_msg(last_msg.msg.osr.header.t.wn == 2152, "incorrect value for last_msg.msg.osr.header.t.wn, expected 2152, is %d", last_msg.msg.osr.header.t.wn); - - ck_assert_msg(last_msg.msg.osr.n_obs == 12, "incorrect value for last_msg.msg.osr.n_obs, expected 12, is %d", last_msg.msg.osr.n_obs); - - - - ck_assert_msg(last_msg.msg.osr.obs[0].L.f == 66, "incorrect value for last_msg.msg.osr.obs[0].L.f, expected 66, is %d", last_msg.msg.osr.obs[0].L.f); - - ck_assert_msg(last_msg.msg.osr.obs[0].L.i == 121567974, "incorrect value for last_msg.msg.osr.obs[0].L.i, expected 121567974, is %d", last_msg.msg.osr.obs[0].L.i); - - ck_assert_msg(last_msg.msg.osr.obs[0].P == 1156681547, "incorrect value for last_msg.msg.osr.obs[0].P, expected 1156681547, is %d", last_msg.msg.osr.obs[0].P); - - ck_assert_msg(last_msg.msg.osr.obs[0].flags == 3, "incorrect value for last_msg.msg.osr.obs[0].flags, expected 3, is %d", last_msg.msg.osr.obs[0].flags); - - ck_assert_msg(last_msg.msg.osr.obs[0].iono_std == 13, "incorrect value for last_msg.msg.osr.obs[0].iono_std, expected 13, is %d", last_msg.msg.osr.obs[0].iono_std); - - ck_assert_msg(last_msg.msg.osr.obs[0].lock == 15, "incorrect value for last_msg.msg.osr.obs[0].lock, expected 15, is %d", last_msg.msg.osr.obs[0].lock); - - ck_assert_msg(last_msg.msg.osr.obs[0].range_std == 7, "incorrect value for last_msg.msg.osr.obs[0].range_std, expected 7, is %d", last_msg.msg.osr.obs[0].range_std); - - - ck_assert_msg(last_msg.msg.osr.obs[0].sid.code == 0, "incorrect value for last_msg.msg.osr.obs[0].sid.code, expected 0, is %d", last_msg.msg.osr.obs[0].sid.code); - - ck_assert_msg(last_msg.msg.osr.obs[0].sid.sat == 1, "incorrect value for last_msg.msg.osr.obs[0].sid.sat, expected 1, is %d", last_msg.msg.osr.obs[0].sid.sat); - - ck_assert_msg(last_msg.msg.osr.obs[0].tropo_std == 7, "incorrect value for last_msg.msg.osr.obs[0].tropo_std, expected 7, is %d", last_msg.msg.osr.obs[0].tropo_std); - - - ck_assert_msg(last_msg.msg.osr.obs[1].L.f == 75, "incorrect value for last_msg.msg.osr.obs[1].L.f, expected 75, is %d", last_msg.msg.osr.obs[1].L.f); - - ck_assert_msg(last_msg.msg.osr.obs[1].L.i == 111817196, "incorrect value for last_msg.msg.osr.obs[1].L.i, expected 111817196, is %d", last_msg.msg.osr.obs[1].L.i); - - ck_assert_msg(last_msg.msg.osr.obs[1].P == 1063905486, "incorrect value for last_msg.msg.osr.obs[1].P, expected 1063905486, is %d", last_msg.msg.osr.obs[1].P); - - ck_assert_msg(last_msg.msg.osr.obs[1].flags == 3, "incorrect value for last_msg.msg.osr.obs[1].flags, expected 3, is %d", last_msg.msg.osr.obs[1].flags); - - ck_assert_msg(last_msg.msg.osr.obs[1].iono_std == 13, "incorrect value for last_msg.msg.osr.obs[1].iono_std, expected 13, is %d", last_msg.msg.osr.obs[1].iono_std); - - ck_assert_msg(last_msg.msg.osr.obs[1].lock == 15, "incorrect value for last_msg.msg.osr.obs[1].lock, expected 15, is %d", last_msg.msg.osr.obs[1].lock); - - ck_assert_msg(last_msg.msg.osr.obs[1].range_std == 3, "incorrect value for last_msg.msg.osr.obs[1].range_std, expected 3, is %d", last_msg.msg.osr.obs[1].range_std); - - - ck_assert_msg(last_msg.msg.osr.obs[1].sid.code == 0, "incorrect value for last_msg.msg.osr.obs[1].sid.code, expected 0, is %d", last_msg.msg.osr.obs[1].sid.code); - - ck_assert_msg(last_msg.msg.osr.obs[1].sid.sat == 13, "incorrect value for last_msg.msg.osr.obs[1].sid.sat, expected 13, is %d", last_msg.msg.osr.obs[1].sid.sat); - - ck_assert_msg(last_msg.msg.osr.obs[1].tropo_std == 3, "incorrect value for last_msg.msg.osr.obs[1].tropo_std, expected 3, is %d", last_msg.msg.osr.obs[1].tropo_std); - - - ck_assert_msg(last_msg.msg.osr.obs[2].L.f == 128, "incorrect value for last_msg.msg.osr.obs[2].L.f, expected 128, is %d", last_msg.msg.osr.obs[2].L.f); - - ck_assert_msg(last_msg.msg.osr.obs[2].L.i == 110692129, "incorrect value for last_msg.msg.osr.obs[2].L.i, expected 110692129, is %d", last_msg.msg.osr.obs[2].L.i); - - ck_assert_msg(last_msg.msg.osr.obs[2].P == 1053200685, "incorrect value for last_msg.msg.osr.obs[2].P, expected 1053200685, is %d", last_msg.msg.osr.obs[2].P); - - ck_assert_msg(last_msg.msg.osr.obs[2].flags == 3, "incorrect value for last_msg.msg.osr.obs[2].flags, expected 3, is %d", last_msg.msg.osr.obs[2].flags); - - ck_assert_msg(last_msg.msg.osr.obs[2].iono_std == 13, "incorrect value for last_msg.msg.osr.obs[2].iono_std, expected 13, is %d", last_msg.msg.osr.obs[2].iono_std); - - ck_assert_msg(last_msg.msg.osr.obs[2].lock == 15, "incorrect value for last_msg.msg.osr.obs[2].lock, expected 15, is %d", last_msg.msg.osr.obs[2].lock); - - ck_assert_msg(last_msg.msg.osr.obs[2].range_std == 3, "incorrect value for last_msg.msg.osr.obs[2].range_std, expected 3, is %d", last_msg.msg.osr.obs[2].range_std); - - - ck_assert_msg(last_msg.msg.osr.obs[2].sid.code == 0, "incorrect value for last_msg.msg.osr.obs[2].sid.code, expected 0, is %d", last_msg.msg.osr.obs[2].sid.code); - - ck_assert_msg(last_msg.msg.osr.obs[2].sid.sat == 14, "incorrect value for last_msg.msg.osr.obs[2].sid.sat, expected 14, is %d", last_msg.msg.osr.obs[2].sid.sat); - - ck_assert_msg(last_msg.msg.osr.obs[2].tropo_std == 3, "incorrect value for last_msg.msg.osr.obs[2].tropo_std, expected 3, is %d", last_msg.msg.osr.obs[2].tropo_std); - - - ck_assert_msg(last_msg.msg.osr.obs[3].L.f == 127, "incorrect value for last_msg.msg.osr.obs[3].L.f, expected 127, is %d", last_msg.msg.osr.obs[3].L.f); - - ck_assert_msg(last_msg.msg.osr.obs[3].L.i == 119549583, "incorrect value for last_msg.msg.osr.obs[3].L.i, expected 119549583, is %d", last_msg.msg.osr.obs[3].L.i); - - ck_assert_msg(last_msg.msg.osr.obs[3].P == 1137476697, "incorrect value for last_msg.msg.osr.obs[3].P, expected 1137476697, is %d", last_msg.msg.osr.obs[3].P); - - ck_assert_msg(last_msg.msg.osr.obs[3].flags == 3, "incorrect value for last_msg.msg.osr.obs[3].flags, expected 3, is %d", last_msg.msg.osr.obs[3].flags); - - ck_assert_msg(last_msg.msg.osr.obs[3].iono_std == 13, "incorrect value for last_msg.msg.osr.obs[3].iono_std, expected 13, is %d", last_msg.msg.osr.obs[3].iono_std); - - ck_assert_msg(last_msg.msg.osr.obs[3].lock == 15, "incorrect value for last_msg.msg.osr.obs[3].lock, expected 15, is %d", last_msg.msg.osr.obs[3].lock); - - ck_assert_msg(last_msg.msg.osr.obs[3].range_std == 5, "incorrect value for last_msg.msg.osr.obs[3].range_std, expected 5, is %d", last_msg.msg.osr.obs[3].range_std); - - - ck_assert_msg(last_msg.msg.osr.obs[3].sid.code == 0, "incorrect value for last_msg.msg.osr.obs[3].sid.code, expected 0, is %d", last_msg.msg.osr.obs[3].sid.code); - - ck_assert_msg(last_msg.msg.osr.obs[3].sid.sat == 15, "incorrect value for last_msg.msg.osr.obs[3].sid.sat, expected 15, is %d", last_msg.msg.osr.obs[3].sid.sat); - - ck_assert_msg(last_msg.msg.osr.obs[3].tropo_std == 5, "incorrect value for last_msg.msg.osr.obs[3].tropo_std, expected 5, is %d", last_msg.msg.osr.obs[3].tropo_std); - - - ck_assert_msg(last_msg.msg.osr.obs[4].L.f == 55, "incorrect value for last_msg.msg.osr.obs[4].L.f, expected 55, is %d", last_msg.msg.osr.obs[4].L.f); - - ck_assert_msg(last_msg.msg.osr.obs[4].L.i == 106934294, "incorrect value for last_msg.msg.osr.obs[4].L.i, expected 106934294, is %d", last_msg.msg.osr.obs[4].L.i); - - ck_assert_msg(last_msg.msg.osr.obs[4].P == 1017446132, "incorrect value for last_msg.msg.osr.obs[4].P, expected 1017446132, is %d", last_msg.msg.osr.obs[4].P); - - ck_assert_msg(last_msg.msg.osr.obs[4].flags == 3, "incorrect value for last_msg.msg.osr.obs[4].flags, expected 3, is %d", last_msg.msg.osr.obs[4].flags); - - ck_assert_msg(last_msg.msg.osr.obs[4].iono_std == 0, "incorrect value for last_msg.msg.osr.obs[4].iono_std, expected 0, is %d", last_msg.msg.osr.obs[4].iono_std); - - ck_assert_msg(last_msg.msg.osr.obs[4].lock == 15, "incorrect value for last_msg.msg.osr.obs[4].lock, expected 15, is %d", last_msg.msg.osr.obs[4].lock); - - ck_assert_msg(last_msg.msg.osr.obs[4].range_std == 2, "incorrect value for last_msg.msg.osr.obs[4].range_std, expected 2, is %d", last_msg.msg.osr.obs[4].range_std); - - - ck_assert_msg(last_msg.msg.osr.obs[4].sid.code == 0, "incorrect value for last_msg.msg.osr.obs[4].sid.code, expected 0, is %d", last_msg.msg.osr.obs[4].sid.code); - - ck_assert_msg(last_msg.msg.osr.obs[4].sid.sat == 17, "incorrect value for last_msg.msg.osr.obs[4].sid.sat, expected 17, is %d", last_msg.msg.osr.obs[4].sid.sat); - - ck_assert_msg(last_msg.msg.osr.obs[4].tropo_std == 2, "incorrect value for last_msg.msg.osr.obs[4].tropo_std, expected 2, is %d", last_msg.msg.osr.obs[4].tropo_std); - - - ck_assert_msg(last_msg.msg.osr.obs[5].L.f == 108, "incorrect value for last_msg.msg.osr.obs[5].L.f, expected 108, is %d", last_msg.msg.osr.obs[5].L.f); - - ck_assert_msg(last_msg.msg.osr.obs[5].L.i == 110024343, "incorrect value for last_msg.msg.osr.obs[5].L.i, expected 110024343, is %d", last_msg.msg.osr.obs[5].L.i); - - ck_assert_msg(last_msg.msg.osr.obs[5].P == 1046846826, "incorrect value for last_msg.msg.osr.obs[5].P, expected 1046846826, is %d", last_msg.msg.osr.obs[5].P); - - ck_assert_msg(last_msg.msg.osr.obs[5].flags == 3, "incorrect value for last_msg.msg.osr.obs[5].flags, expected 3, is %d", last_msg.msg.osr.obs[5].flags); - - ck_assert_msg(last_msg.msg.osr.obs[5].iono_std == 13, "incorrect value for last_msg.msg.osr.obs[5].iono_std, expected 13, is %d", last_msg.msg.osr.obs[5].iono_std); - - ck_assert_msg(last_msg.msg.osr.obs[5].lock == 15, "incorrect value for last_msg.msg.osr.obs[5].lock, expected 15, is %d", last_msg.msg.osr.obs[5].lock); - - ck_assert_msg(last_msg.msg.osr.obs[5].range_std == 3, "incorrect value for last_msg.msg.osr.obs[5].range_std, expected 3, is %d", last_msg.msg.osr.obs[5].range_std); - - - ck_assert_msg(last_msg.msg.osr.obs[5].sid.code == 0, "incorrect value for last_msg.msg.osr.obs[5].sid.code, expected 0, is %d", last_msg.msg.osr.obs[5].sid.code); - - ck_assert_msg(last_msg.msg.osr.obs[5].sid.sat == 19, "incorrect value for last_msg.msg.osr.obs[5].sid.sat, expected 19, is %d", last_msg.msg.osr.obs[5].sid.sat); - - ck_assert_msg(last_msg.msg.osr.obs[5].tropo_std == 3, "incorrect value for last_msg.msg.osr.obs[5].tropo_std, expected 3, is %d", last_msg.msg.osr.obs[5].tropo_std); - - - ck_assert_msg(last_msg.msg.osr.obs[6].L.f == 206, "incorrect value for last_msg.msg.osr.obs[6].L.f, expected 206, is %d", last_msg.msg.osr.obs[6].L.f); - - ck_assert_msg(last_msg.msg.osr.obs[6].L.i == 111507381, "incorrect value for last_msg.msg.osr.obs[6].L.i, expected 111507381, is %d", last_msg.msg.osr.obs[6].L.i); - - ck_assert_msg(last_msg.msg.osr.obs[6].P == 1060957521, "incorrect value for last_msg.msg.osr.obs[6].P, expected 1060957521, is %d", last_msg.msg.osr.obs[6].P); - - ck_assert_msg(last_msg.msg.osr.obs[6].flags == 3, "incorrect value for last_msg.msg.osr.obs[6].flags, expected 3, is %d", last_msg.msg.osr.obs[6].flags); - - ck_assert_msg(last_msg.msg.osr.obs[6].iono_std == 13, "incorrect value for last_msg.msg.osr.obs[6].iono_std, expected 13, is %d", last_msg.msg.osr.obs[6].iono_std); - - ck_assert_msg(last_msg.msg.osr.obs[6].lock == 15, "incorrect value for last_msg.msg.osr.obs[6].lock, expected 15, is %d", last_msg.msg.osr.obs[6].lock); - - ck_assert_msg(last_msg.msg.osr.obs[6].range_std == 3, "incorrect value for last_msg.msg.osr.obs[6].range_std, expected 3, is %d", last_msg.msg.osr.obs[6].range_std); - - - ck_assert_msg(last_msg.msg.osr.obs[6].sid.code == 0, "incorrect value for last_msg.msg.osr.obs[6].sid.code, expected 0, is %d", last_msg.msg.osr.obs[6].sid.code); - - ck_assert_msg(last_msg.msg.osr.obs[6].sid.sat == 28, "incorrect value for last_msg.msg.osr.obs[6].sid.sat, expected 28, is %d", last_msg.msg.osr.obs[6].sid.sat); - - ck_assert_msg(last_msg.msg.osr.obs[6].tropo_std == 3, "incorrect value for last_msg.msg.osr.obs[6].tropo_std, expected 3, is %d", last_msg.msg.osr.obs[6].tropo_std); - - - ck_assert_msg(last_msg.msg.osr.obs[7].L.f == 200, "incorrect value for last_msg.msg.osr.obs[7].L.f, expected 200, is %d", last_msg.msg.osr.obs[7].L.f); - - ck_assert_msg(last_msg.msg.osr.obs[7].L.i == 113614775, "incorrect value for last_msg.msg.osr.obs[7].L.i, expected 113614775, is %d", last_msg.msg.osr.obs[7].L.i); - - ck_assert_msg(last_msg.msg.osr.obs[7].P == 1081009286, "incorrect value for last_msg.msg.osr.obs[7].P, expected 1081009286, is %d", last_msg.msg.osr.obs[7].P); - - ck_assert_msg(last_msg.msg.osr.obs[7].flags == 3, "incorrect value for last_msg.msg.osr.obs[7].flags, expected 3, is %d", last_msg.msg.osr.obs[7].flags); - - ck_assert_msg(last_msg.msg.osr.obs[7].iono_std == 13, "incorrect value for last_msg.msg.osr.obs[7].iono_std, expected 13, is %d", last_msg.msg.osr.obs[7].iono_std); - - ck_assert_msg(last_msg.msg.osr.obs[7].lock == 15, "incorrect value for last_msg.msg.osr.obs[7].lock, expected 15, is %d", last_msg.msg.osr.obs[7].lock); - - ck_assert_msg(last_msg.msg.osr.obs[7].range_std == 3, "incorrect value for last_msg.msg.osr.obs[7].range_std, expected 3, is %d", last_msg.msg.osr.obs[7].range_std); - - - ck_assert_msg(last_msg.msg.osr.obs[7].sid.code == 0, "incorrect value for last_msg.msg.osr.obs[7].sid.code, expected 0, is %d", last_msg.msg.osr.obs[7].sid.code); - - ck_assert_msg(last_msg.msg.osr.obs[7].sid.sat == 30, "incorrect value for last_msg.msg.osr.obs[7].sid.sat, expected 30, is %d", last_msg.msg.osr.obs[7].sid.sat); - - ck_assert_msg(last_msg.msg.osr.obs[7].tropo_std == 3, "incorrect value for last_msg.msg.osr.obs[7].tropo_std, expected 3, is %d", last_msg.msg.osr.obs[7].tropo_std); - - - ck_assert_msg(last_msg.msg.osr.obs[8].L.f == 170, "incorrect value for last_msg.msg.osr.obs[8].L.f, expected 170, is %d", last_msg.msg.osr.obs[8].L.f); - - ck_assert_msg(last_msg.msg.osr.obs[8].L.i == 94728270, "incorrect value for last_msg.msg.osr.obs[8].L.i, expected 94728270, is %d", last_msg.msg.osr.obs[8].L.i); - - ck_assert_msg(last_msg.msg.osr.obs[8].P == 1156681781, "incorrect value for last_msg.msg.osr.obs[8].P, expected 1156681781, is %d", last_msg.msg.osr.obs[8].P); - - ck_assert_msg(last_msg.msg.osr.obs[8].flags == 3, "incorrect value for last_msg.msg.osr.obs[8].flags, expected 3, is %d", last_msg.msg.osr.obs[8].flags); - - ck_assert_msg(last_msg.msg.osr.obs[8].iono_std == 21, "incorrect value for last_msg.msg.osr.obs[8].iono_std, expected 21, is %d", last_msg.msg.osr.obs[8].iono_std); - - ck_assert_msg(last_msg.msg.osr.obs[8].lock == 15, "incorrect value for last_msg.msg.osr.obs[8].lock, expected 15, is %d", last_msg.msg.osr.obs[8].lock); - - ck_assert_msg(last_msg.msg.osr.obs[8].range_std == 7, "incorrect value for last_msg.msg.osr.obs[8].range_std, expected 7, is %d", last_msg.msg.osr.obs[8].range_std); - - - ck_assert_msg(last_msg.msg.osr.obs[8].sid.code == 6, "incorrect value for last_msg.msg.osr.obs[8].sid.code, expected 6, is %d", last_msg.msg.osr.obs[8].sid.code); - - ck_assert_msg(last_msg.msg.osr.obs[8].sid.sat == 1, "incorrect value for last_msg.msg.osr.obs[8].sid.sat, expected 1, is %d", last_msg.msg.osr.obs[8].sid.sat); - - ck_assert_msg(last_msg.msg.osr.obs[8].tropo_std == 7, "incorrect value for last_msg.msg.osr.obs[8].tropo_std, expected 7, is %d", last_msg.msg.osr.obs[8].tropo_std); - - - ck_assert_msg(last_msg.msg.osr.obs[9].L.f == 129, "incorrect value for last_msg.msg.osr.obs[9].L.f, expected 129, is %d", last_msg.msg.osr.obs[9].L.f); - - ck_assert_msg(last_msg.msg.osr.obs[9].L.i == 87130275, "incorrect value for last_msg.msg.osr.obs[9].L.i, expected 87130275, is %d", last_msg.msg.osr.obs[9].L.i); - - ck_assert_msg(last_msg.msg.osr.obs[9].P == 1063905531, "incorrect value for last_msg.msg.osr.obs[9].P, expected 1063905531, is %d", last_msg.msg.osr.obs[9].P); - - ck_assert_msg(last_msg.msg.osr.obs[9].flags == 3, "incorrect value for last_msg.msg.osr.obs[9].flags, expected 3, is %d", last_msg.msg.osr.obs[9].flags); - - ck_assert_msg(last_msg.msg.osr.obs[9].iono_std == 21, "incorrect value for last_msg.msg.osr.obs[9].iono_std, expected 21, is %d", last_msg.msg.osr.obs[9].iono_std); - - ck_assert_msg(last_msg.msg.osr.obs[9].lock == 15, "incorrect value for last_msg.msg.osr.obs[9].lock, expected 15, is %d", last_msg.msg.osr.obs[9].lock); - - ck_assert_msg(last_msg.msg.osr.obs[9].range_std == 3, "incorrect value for last_msg.msg.osr.obs[9].range_std, expected 3, is %d", last_msg.msg.osr.obs[9].range_std); - - - ck_assert_msg(last_msg.msg.osr.obs[9].sid.code == 6, "incorrect value for last_msg.msg.osr.obs[9].sid.code, expected 6, is %d", last_msg.msg.osr.obs[9].sid.code); - - ck_assert_msg(last_msg.msg.osr.obs[9].sid.sat == 13, "incorrect value for last_msg.msg.osr.obs[9].sid.sat, expected 13, is %d", last_msg.msg.osr.obs[9].sid.sat); - - ck_assert_msg(last_msg.msg.osr.obs[9].tropo_std == 3, "incorrect value for last_msg.msg.osr.obs[9].tropo_std, expected 3, is %d", last_msg.msg.osr.obs[9].tropo_std); - - - ck_assert_msg(last_msg.msg.osr.obs[10].L.f == 46, "incorrect value for last_msg.msg.osr.obs[10].L.f, expected 46, is %d", last_msg.msg.osr.obs[10].L.f); - - ck_assert_msg(last_msg.msg.osr.obs[10].L.i == 86253605, "incorrect value for last_msg.msg.osr.obs[10].L.i, expected 86253605, is %d", last_msg.msg.osr.obs[10].L.i); - - ck_assert_msg(last_msg.msg.osr.obs[10].P == 1053200752, "incorrect value for last_msg.msg.osr.obs[10].P, expected 1053200752, is %d", last_msg.msg.osr.obs[10].P); - - ck_assert_msg(last_msg.msg.osr.obs[10].flags == 3, "incorrect value for last_msg.msg.osr.obs[10].flags, expected 3, is %d", last_msg.msg.osr.obs[10].flags); - - ck_assert_msg(last_msg.msg.osr.obs[10].iono_std == 21, "incorrect value for last_msg.msg.osr.obs[10].iono_std, expected 21, is %d", last_msg.msg.osr.obs[10].iono_std); - - ck_assert_msg(last_msg.msg.osr.obs[10].lock == 15, "incorrect value for last_msg.msg.osr.obs[10].lock, expected 15, is %d", last_msg.msg.osr.obs[10].lock); - - ck_assert_msg(last_msg.msg.osr.obs[10].range_std == 3, "incorrect value for last_msg.msg.osr.obs[10].range_std, expected 3, is %d", last_msg.msg.osr.obs[10].range_std); - - - ck_assert_msg(last_msg.msg.osr.obs[10].sid.code == 6, "incorrect value for last_msg.msg.osr.obs[10].sid.code, expected 6, is %d", last_msg.msg.osr.obs[10].sid.code); - - ck_assert_msg(last_msg.msg.osr.obs[10].sid.sat == 14, "incorrect value for last_msg.msg.osr.obs[10].sid.sat, expected 14, is %d", last_msg.msg.osr.obs[10].sid.sat); - - ck_assert_msg(last_msg.msg.osr.obs[10].tropo_std == 3, "incorrect value for last_msg.msg.osr.obs[10].tropo_std, expected 3, is %d", last_msg.msg.osr.obs[10].tropo_std); - - - ck_assert_msg(last_msg.msg.osr.obs[11].L.f == 95, "incorrect value for last_msg.msg.osr.obs[11].L.f, expected 95, is %d", last_msg.msg.osr.obs[11].L.f); - - ck_assert_msg(last_msg.msg.osr.obs[11].L.i == 93155512, "incorrect value for last_msg.msg.osr.obs[11].L.i, expected 93155512, is %d", last_msg.msg.osr.obs[11].L.i); - - ck_assert_msg(last_msg.msg.osr.obs[11].P == 1137476774, "incorrect value for last_msg.msg.osr.obs[11].P, expected 1137476774, is %d", last_msg.msg.osr.obs[11].P); - - ck_assert_msg(last_msg.msg.osr.obs[11].flags == 3, "incorrect value for last_msg.msg.osr.obs[11].flags, expected 3, is %d", last_msg.msg.osr.obs[11].flags); - - ck_assert_msg(last_msg.msg.osr.obs[11].iono_std == 21, "incorrect value for last_msg.msg.osr.obs[11].iono_std, expected 21, is %d", last_msg.msg.osr.obs[11].iono_std); - - ck_assert_msg(last_msg.msg.osr.obs[11].lock == 15, "incorrect value for last_msg.msg.osr.obs[11].lock, expected 15, is %d", last_msg.msg.osr.obs[11].lock); - - ck_assert_msg(last_msg.msg.osr.obs[11].range_std == 5, "incorrect value for last_msg.msg.osr.obs[11].range_std, expected 5, is %d", last_msg.msg.osr.obs[11].range_std); - - - ck_assert_msg(last_msg.msg.osr.obs[11].sid.code == 6, "incorrect value for last_msg.msg.osr.obs[11].sid.code, expected 6, is %d", last_msg.msg.osr.obs[11].sid.code); - - ck_assert_msg(last_msg.msg.osr.obs[11].sid.sat == 15, "incorrect value for last_msg.msg.osr.obs[11].sid.sat, expected 15, is %d", last_msg.msg.osr.obs[11].sid.sat); - - ck_assert_msg(last_msg.msg.osr.obs[11].tropo_std == 5, "incorrect value for last_msg.msg.osr.obs[11].tropo_std, expected 5, is %d", last_msg.msg.osr.obs[11].tropo_std); + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.osr.header.n_obs == 64, + "incorrect value for last_msg.msg.osr.header.n_obs, expected 64, is %d", + last_msg.msg.osr.header.n_obs); + + ck_assert_msg(last_msg.msg.osr.header.t.ns_residual == 0, + "incorrect value for last_msg.msg.osr.header.t.ns_residual, " + "expected 0, is %d", + last_msg.msg.osr.header.t.ns_residual); + + ck_assert_msg(last_msg.msg.osr.header.t.tow == 501867000, + "incorrect value for last_msg.msg.osr.header.t.tow, expected " + "501867000, is %d", + last_msg.msg.osr.header.t.tow); + + ck_assert_msg(last_msg.msg.osr.header.t.wn == 2152, + "incorrect value for last_msg.msg.osr.header.t.wn, expected " + "2152, is %d", + last_msg.msg.osr.header.t.wn); + + ck_assert_msg( + last_msg.msg.osr.n_obs == 12, + "incorrect value for last_msg.msg.osr.n_obs, expected 12, is %d", + last_msg.msg.osr.n_obs); + + ck_assert_msg( + last_msg.msg.osr.obs[0].L.f == 66, + "incorrect value for last_msg.msg.osr.obs[0].L.f, expected 66, is %d", + last_msg.msg.osr.obs[0].L.f); + + ck_assert_msg(last_msg.msg.osr.obs[0].L.i == 121567974, + "incorrect value for last_msg.msg.osr.obs[0].L.i, expected " + "121567974, is %d", + last_msg.msg.osr.obs[0].L.i); + + ck_assert_msg(last_msg.msg.osr.obs[0].P == 1156681547, + "incorrect value for last_msg.msg.osr.obs[0].P, expected " + "1156681547, is %d", + last_msg.msg.osr.obs[0].P); + + ck_assert_msg( + last_msg.msg.osr.obs[0].flags == 3, + "incorrect value for last_msg.msg.osr.obs[0].flags, expected 3, is %d", + last_msg.msg.osr.obs[0].flags); + + ck_assert_msg(last_msg.msg.osr.obs[0].iono_std == 13, + "incorrect value for last_msg.msg.osr.obs[0].iono_std, " + "expected 13, is %d", + last_msg.msg.osr.obs[0].iono_std); + + ck_assert_msg( + last_msg.msg.osr.obs[0].lock == 15, + "incorrect value for last_msg.msg.osr.obs[0].lock, expected 15, is %d", + last_msg.msg.osr.obs[0].lock); + + ck_assert_msg(last_msg.msg.osr.obs[0].range_std == 7, + "incorrect value for last_msg.msg.osr.obs[0].range_std, " + "expected 7, is %d", + last_msg.msg.osr.obs[0].range_std); + + ck_assert_msg(last_msg.msg.osr.obs[0].sid.code == 0, + "incorrect value for last_msg.msg.osr.obs[0].sid.code, " + "expected 0, is %d", + last_msg.msg.osr.obs[0].sid.code); + + ck_assert_msg(last_msg.msg.osr.obs[0].sid.sat == 1, + "incorrect value for last_msg.msg.osr.obs[0].sid.sat, " + "expected 1, is %d", + last_msg.msg.osr.obs[0].sid.sat); + + ck_assert_msg(last_msg.msg.osr.obs[0].tropo_std == 7, + "incorrect value for last_msg.msg.osr.obs[0].tropo_std, " + "expected 7, is %d", + last_msg.msg.osr.obs[0].tropo_std); + + ck_assert_msg( + last_msg.msg.osr.obs[1].L.f == 75, + "incorrect value for last_msg.msg.osr.obs[1].L.f, expected 75, is %d", + last_msg.msg.osr.obs[1].L.f); + + ck_assert_msg(last_msg.msg.osr.obs[1].L.i == 111817196, + "incorrect value for last_msg.msg.osr.obs[1].L.i, expected " + "111817196, is %d", + last_msg.msg.osr.obs[1].L.i); + + ck_assert_msg(last_msg.msg.osr.obs[1].P == 1063905486, + "incorrect value for last_msg.msg.osr.obs[1].P, expected " + "1063905486, is %d", + last_msg.msg.osr.obs[1].P); + + ck_assert_msg( + last_msg.msg.osr.obs[1].flags == 3, + "incorrect value for last_msg.msg.osr.obs[1].flags, expected 3, is %d", + last_msg.msg.osr.obs[1].flags); + + ck_assert_msg(last_msg.msg.osr.obs[1].iono_std == 13, + "incorrect value for last_msg.msg.osr.obs[1].iono_std, " + "expected 13, is %d", + last_msg.msg.osr.obs[1].iono_std); + + ck_assert_msg( + last_msg.msg.osr.obs[1].lock == 15, + "incorrect value for last_msg.msg.osr.obs[1].lock, expected 15, is %d", + last_msg.msg.osr.obs[1].lock); + + ck_assert_msg(last_msg.msg.osr.obs[1].range_std == 3, + "incorrect value for last_msg.msg.osr.obs[1].range_std, " + "expected 3, is %d", + last_msg.msg.osr.obs[1].range_std); + + ck_assert_msg(last_msg.msg.osr.obs[1].sid.code == 0, + "incorrect value for last_msg.msg.osr.obs[1].sid.code, " + "expected 0, is %d", + last_msg.msg.osr.obs[1].sid.code); + + ck_assert_msg(last_msg.msg.osr.obs[1].sid.sat == 13, + "incorrect value for last_msg.msg.osr.obs[1].sid.sat, " + "expected 13, is %d", + last_msg.msg.osr.obs[1].sid.sat); + + ck_assert_msg(last_msg.msg.osr.obs[1].tropo_std == 3, + "incorrect value for last_msg.msg.osr.obs[1].tropo_std, " + "expected 3, is %d", + last_msg.msg.osr.obs[1].tropo_std); + + ck_assert_msg( + last_msg.msg.osr.obs[2].L.f == 128, + "incorrect value for last_msg.msg.osr.obs[2].L.f, expected 128, is %d", + last_msg.msg.osr.obs[2].L.f); + + ck_assert_msg(last_msg.msg.osr.obs[2].L.i == 110692129, + "incorrect value for last_msg.msg.osr.obs[2].L.i, expected " + "110692129, is %d", + last_msg.msg.osr.obs[2].L.i); + + ck_assert_msg(last_msg.msg.osr.obs[2].P == 1053200685, + "incorrect value for last_msg.msg.osr.obs[2].P, expected " + "1053200685, is %d", + last_msg.msg.osr.obs[2].P); + + ck_assert_msg( + last_msg.msg.osr.obs[2].flags == 3, + "incorrect value for last_msg.msg.osr.obs[2].flags, expected 3, is %d", + last_msg.msg.osr.obs[2].flags); + + ck_assert_msg(last_msg.msg.osr.obs[2].iono_std == 13, + "incorrect value for last_msg.msg.osr.obs[2].iono_std, " + "expected 13, is %d", + last_msg.msg.osr.obs[2].iono_std); + + ck_assert_msg( + last_msg.msg.osr.obs[2].lock == 15, + "incorrect value for last_msg.msg.osr.obs[2].lock, expected 15, is %d", + last_msg.msg.osr.obs[2].lock); + + ck_assert_msg(last_msg.msg.osr.obs[2].range_std == 3, + "incorrect value for last_msg.msg.osr.obs[2].range_std, " + "expected 3, is %d", + last_msg.msg.osr.obs[2].range_std); + + ck_assert_msg(last_msg.msg.osr.obs[2].sid.code == 0, + "incorrect value for last_msg.msg.osr.obs[2].sid.code, " + "expected 0, is %d", + last_msg.msg.osr.obs[2].sid.code); + + ck_assert_msg(last_msg.msg.osr.obs[2].sid.sat == 14, + "incorrect value for last_msg.msg.osr.obs[2].sid.sat, " + "expected 14, is %d", + last_msg.msg.osr.obs[2].sid.sat); + + ck_assert_msg(last_msg.msg.osr.obs[2].tropo_std == 3, + "incorrect value for last_msg.msg.osr.obs[2].tropo_std, " + "expected 3, is %d", + last_msg.msg.osr.obs[2].tropo_std); + + ck_assert_msg( + last_msg.msg.osr.obs[3].L.f == 127, + "incorrect value for last_msg.msg.osr.obs[3].L.f, expected 127, is %d", + last_msg.msg.osr.obs[3].L.f); + + ck_assert_msg(last_msg.msg.osr.obs[3].L.i == 119549583, + "incorrect value for last_msg.msg.osr.obs[3].L.i, expected " + "119549583, is %d", + last_msg.msg.osr.obs[3].L.i); + + ck_assert_msg(last_msg.msg.osr.obs[3].P == 1137476697, + "incorrect value for last_msg.msg.osr.obs[3].P, expected " + "1137476697, is %d", + last_msg.msg.osr.obs[3].P); + + ck_assert_msg( + last_msg.msg.osr.obs[3].flags == 3, + "incorrect value for last_msg.msg.osr.obs[3].flags, expected 3, is %d", + last_msg.msg.osr.obs[3].flags); + + ck_assert_msg(last_msg.msg.osr.obs[3].iono_std == 13, + "incorrect value for last_msg.msg.osr.obs[3].iono_std, " + "expected 13, is %d", + last_msg.msg.osr.obs[3].iono_std); + + ck_assert_msg( + last_msg.msg.osr.obs[3].lock == 15, + "incorrect value for last_msg.msg.osr.obs[3].lock, expected 15, is %d", + last_msg.msg.osr.obs[3].lock); + + ck_assert_msg(last_msg.msg.osr.obs[3].range_std == 5, + "incorrect value for last_msg.msg.osr.obs[3].range_std, " + "expected 5, is %d", + last_msg.msg.osr.obs[3].range_std); + + ck_assert_msg(last_msg.msg.osr.obs[3].sid.code == 0, + "incorrect value for last_msg.msg.osr.obs[3].sid.code, " + "expected 0, is %d", + last_msg.msg.osr.obs[3].sid.code); + + ck_assert_msg(last_msg.msg.osr.obs[3].sid.sat == 15, + "incorrect value for last_msg.msg.osr.obs[3].sid.sat, " + "expected 15, is %d", + last_msg.msg.osr.obs[3].sid.sat); + + ck_assert_msg(last_msg.msg.osr.obs[3].tropo_std == 5, + "incorrect value for last_msg.msg.osr.obs[3].tropo_std, " + "expected 5, is %d", + last_msg.msg.osr.obs[3].tropo_std); + + ck_assert_msg( + last_msg.msg.osr.obs[4].L.f == 55, + "incorrect value for last_msg.msg.osr.obs[4].L.f, expected 55, is %d", + last_msg.msg.osr.obs[4].L.f); + + ck_assert_msg(last_msg.msg.osr.obs[4].L.i == 106934294, + "incorrect value for last_msg.msg.osr.obs[4].L.i, expected " + "106934294, is %d", + last_msg.msg.osr.obs[4].L.i); + + ck_assert_msg(last_msg.msg.osr.obs[4].P == 1017446132, + "incorrect value for last_msg.msg.osr.obs[4].P, expected " + "1017446132, is %d", + last_msg.msg.osr.obs[4].P); + + ck_assert_msg( + last_msg.msg.osr.obs[4].flags == 3, + "incorrect value for last_msg.msg.osr.obs[4].flags, expected 3, is %d", + last_msg.msg.osr.obs[4].flags); + + ck_assert_msg(last_msg.msg.osr.obs[4].iono_std == 0, + "incorrect value for last_msg.msg.osr.obs[4].iono_std, " + "expected 0, is %d", + last_msg.msg.osr.obs[4].iono_std); + + ck_assert_msg( + last_msg.msg.osr.obs[4].lock == 15, + "incorrect value for last_msg.msg.osr.obs[4].lock, expected 15, is %d", + last_msg.msg.osr.obs[4].lock); + + ck_assert_msg(last_msg.msg.osr.obs[4].range_std == 2, + "incorrect value for last_msg.msg.osr.obs[4].range_std, " + "expected 2, is %d", + last_msg.msg.osr.obs[4].range_std); + + ck_assert_msg(last_msg.msg.osr.obs[4].sid.code == 0, + "incorrect value for last_msg.msg.osr.obs[4].sid.code, " + "expected 0, is %d", + last_msg.msg.osr.obs[4].sid.code); + + ck_assert_msg(last_msg.msg.osr.obs[4].sid.sat == 17, + "incorrect value for last_msg.msg.osr.obs[4].sid.sat, " + "expected 17, is %d", + last_msg.msg.osr.obs[4].sid.sat); + + ck_assert_msg(last_msg.msg.osr.obs[4].tropo_std == 2, + "incorrect value for last_msg.msg.osr.obs[4].tropo_std, " + "expected 2, is %d", + last_msg.msg.osr.obs[4].tropo_std); + + ck_assert_msg( + last_msg.msg.osr.obs[5].L.f == 108, + "incorrect value for last_msg.msg.osr.obs[5].L.f, expected 108, is %d", + last_msg.msg.osr.obs[5].L.f); + + ck_assert_msg(last_msg.msg.osr.obs[5].L.i == 110024343, + "incorrect value for last_msg.msg.osr.obs[5].L.i, expected " + "110024343, is %d", + last_msg.msg.osr.obs[5].L.i); + + ck_assert_msg(last_msg.msg.osr.obs[5].P == 1046846826, + "incorrect value for last_msg.msg.osr.obs[5].P, expected " + "1046846826, is %d", + last_msg.msg.osr.obs[5].P); + + ck_assert_msg( + last_msg.msg.osr.obs[5].flags == 3, + "incorrect value for last_msg.msg.osr.obs[5].flags, expected 3, is %d", + last_msg.msg.osr.obs[5].flags); + + ck_assert_msg(last_msg.msg.osr.obs[5].iono_std == 13, + "incorrect value for last_msg.msg.osr.obs[5].iono_std, " + "expected 13, is %d", + last_msg.msg.osr.obs[5].iono_std); + + ck_assert_msg( + last_msg.msg.osr.obs[5].lock == 15, + "incorrect value for last_msg.msg.osr.obs[5].lock, expected 15, is %d", + last_msg.msg.osr.obs[5].lock); + + ck_assert_msg(last_msg.msg.osr.obs[5].range_std == 3, + "incorrect value for last_msg.msg.osr.obs[5].range_std, " + "expected 3, is %d", + last_msg.msg.osr.obs[5].range_std); + + ck_assert_msg(last_msg.msg.osr.obs[5].sid.code == 0, + "incorrect value for last_msg.msg.osr.obs[5].sid.code, " + "expected 0, is %d", + last_msg.msg.osr.obs[5].sid.code); + + ck_assert_msg(last_msg.msg.osr.obs[5].sid.sat == 19, + "incorrect value for last_msg.msg.osr.obs[5].sid.sat, " + "expected 19, is %d", + last_msg.msg.osr.obs[5].sid.sat); + + ck_assert_msg(last_msg.msg.osr.obs[5].tropo_std == 3, + "incorrect value for last_msg.msg.osr.obs[5].tropo_std, " + "expected 3, is %d", + last_msg.msg.osr.obs[5].tropo_std); + + ck_assert_msg( + last_msg.msg.osr.obs[6].L.f == 206, + "incorrect value for last_msg.msg.osr.obs[6].L.f, expected 206, is %d", + last_msg.msg.osr.obs[6].L.f); + + ck_assert_msg(last_msg.msg.osr.obs[6].L.i == 111507381, + "incorrect value for last_msg.msg.osr.obs[6].L.i, expected " + "111507381, is %d", + last_msg.msg.osr.obs[6].L.i); + + ck_assert_msg(last_msg.msg.osr.obs[6].P == 1060957521, + "incorrect value for last_msg.msg.osr.obs[6].P, expected " + "1060957521, is %d", + last_msg.msg.osr.obs[6].P); + + ck_assert_msg( + last_msg.msg.osr.obs[6].flags == 3, + "incorrect value for last_msg.msg.osr.obs[6].flags, expected 3, is %d", + last_msg.msg.osr.obs[6].flags); + + ck_assert_msg(last_msg.msg.osr.obs[6].iono_std == 13, + "incorrect value for last_msg.msg.osr.obs[6].iono_std, " + "expected 13, is %d", + last_msg.msg.osr.obs[6].iono_std); + + ck_assert_msg( + last_msg.msg.osr.obs[6].lock == 15, + "incorrect value for last_msg.msg.osr.obs[6].lock, expected 15, is %d", + last_msg.msg.osr.obs[6].lock); + + ck_assert_msg(last_msg.msg.osr.obs[6].range_std == 3, + "incorrect value for last_msg.msg.osr.obs[6].range_std, " + "expected 3, is %d", + last_msg.msg.osr.obs[6].range_std); + + ck_assert_msg(last_msg.msg.osr.obs[6].sid.code == 0, + "incorrect value for last_msg.msg.osr.obs[6].sid.code, " + "expected 0, is %d", + last_msg.msg.osr.obs[6].sid.code); + + ck_assert_msg(last_msg.msg.osr.obs[6].sid.sat == 28, + "incorrect value for last_msg.msg.osr.obs[6].sid.sat, " + "expected 28, is %d", + last_msg.msg.osr.obs[6].sid.sat); + + ck_assert_msg(last_msg.msg.osr.obs[6].tropo_std == 3, + "incorrect value for last_msg.msg.osr.obs[6].tropo_std, " + "expected 3, is %d", + last_msg.msg.osr.obs[6].tropo_std); + + ck_assert_msg( + last_msg.msg.osr.obs[7].L.f == 200, + "incorrect value for last_msg.msg.osr.obs[7].L.f, expected 200, is %d", + last_msg.msg.osr.obs[7].L.f); + + ck_assert_msg(last_msg.msg.osr.obs[7].L.i == 113614775, + "incorrect value for last_msg.msg.osr.obs[7].L.i, expected " + "113614775, is %d", + last_msg.msg.osr.obs[7].L.i); + + ck_assert_msg(last_msg.msg.osr.obs[7].P == 1081009286, + "incorrect value for last_msg.msg.osr.obs[7].P, expected " + "1081009286, is %d", + last_msg.msg.osr.obs[7].P); + + ck_assert_msg( + last_msg.msg.osr.obs[7].flags == 3, + "incorrect value for last_msg.msg.osr.obs[7].flags, expected 3, is %d", + last_msg.msg.osr.obs[7].flags); + + ck_assert_msg(last_msg.msg.osr.obs[7].iono_std == 13, + "incorrect value for last_msg.msg.osr.obs[7].iono_std, " + "expected 13, is %d", + last_msg.msg.osr.obs[7].iono_std); + + ck_assert_msg( + last_msg.msg.osr.obs[7].lock == 15, + "incorrect value for last_msg.msg.osr.obs[7].lock, expected 15, is %d", + last_msg.msg.osr.obs[7].lock); + + ck_assert_msg(last_msg.msg.osr.obs[7].range_std == 3, + "incorrect value for last_msg.msg.osr.obs[7].range_std, " + "expected 3, is %d", + last_msg.msg.osr.obs[7].range_std); + + ck_assert_msg(last_msg.msg.osr.obs[7].sid.code == 0, + "incorrect value for last_msg.msg.osr.obs[7].sid.code, " + "expected 0, is %d", + last_msg.msg.osr.obs[7].sid.code); + + ck_assert_msg(last_msg.msg.osr.obs[7].sid.sat == 30, + "incorrect value for last_msg.msg.osr.obs[7].sid.sat, " + "expected 30, is %d", + last_msg.msg.osr.obs[7].sid.sat); + + ck_assert_msg(last_msg.msg.osr.obs[7].tropo_std == 3, + "incorrect value for last_msg.msg.osr.obs[7].tropo_std, " + "expected 3, is %d", + last_msg.msg.osr.obs[7].tropo_std); + + ck_assert_msg( + last_msg.msg.osr.obs[8].L.f == 170, + "incorrect value for last_msg.msg.osr.obs[8].L.f, expected 170, is %d", + last_msg.msg.osr.obs[8].L.f); + + ck_assert_msg(last_msg.msg.osr.obs[8].L.i == 94728270, + "incorrect value for last_msg.msg.osr.obs[8].L.i, expected " + "94728270, is %d", + last_msg.msg.osr.obs[8].L.i); + + ck_assert_msg(last_msg.msg.osr.obs[8].P == 1156681781, + "incorrect value for last_msg.msg.osr.obs[8].P, expected " + "1156681781, is %d", + last_msg.msg.osr.obs[8].P); + + ck_assert_msg( + last_msg.msg.osr.obs[8].flags == 3, + "incorrect value for last_msg.msg.osr.obs[8].flags, expected 3, is %d", + last_msg.msg.osr.obs[8].flags); + + ck_assert_msg(last_msg.msg.osr.obs[8].iono_std == 21, + "incorrect value for last_msg.msg.osr.obs[8].iono_std, " + "expected 21, is %d", + last_msg.msg.osr.obs[8].iono_std); + + ck_assert_msg( + last_msg.msg.osr.obs[8].lock == 15, + "incorrect value for last_msg.msg.osr.obs[8].lock, expected 15, is %d", + last_msg.msg.osr.obs[8].lock); + + ck_assert_msg(last_msg.msg.osr.obs[8].range_std == 7, + "incorrect value for last_msg.msg.osr.obs[8].range_std, " + "expected 7, is %d", + last_msg.msg.osr.obs[8].range_std); + + ck_assert_msg(last_msg.msg.osr.obs[8].sid.code == 6, + "incorrect value for last_msg.msg.osr.obs[8].sid.code, " + "expected 6, is %d", + last_msg.msg.osr.obs[8].sid.code); + + ck_assert_msg(last_msg.msg.osr.obs[8].sid.sat == 1, + "incorrect value for last_msg.msg.osr.obs[8].sid.sat, " + "expected 1, is %d", + last_msg.msg.osr.obs[8].sid.sat); + + ck_assert_msg(last_msg.msg.osr.obs[8].tropo_std == 7, + "incorrect value for last_msg.msg.osr.obs[8].tropo_std, " + "expected 7, is %d", + last_msg.msg.osr.obs[8].tropo_std); + + ck_assert_msg( + last_msg.msg.osr.obs[9].L.f == 129, + "incorrect value for last_msg.msg.osr.obs[9].L.f, expected 129, is %d", + last_msg.msg.osr.obs[9].L.f); + + ck_assert_msg(last_msg.msg.osr.obs[9].L.i == 87130275, + "incorrect value for last_msg.msg.osr.obs[9].L.i, expected " + "87130275, is %d", + last_msg.msg.osr.obs[9].L.i); + + ck_assert_msg(last_msg.msg.osr.obs[9].P == 1063905531, + "incorrect value for last_msg.msg.osr.obs[9].P, expected " + "1063905531, is %d", + last_msg.msg.osr.obs[9].P); + + ck_assert_msg( + last_msg.msg.osr.obs[9].flags == 3, + "incorrect value for last_msg.msg.osr.obs[9].flags, expected 3, is %d", + last_msg.msg.osr.obs[9].flags); + + ck_assert_msg(last_msg.msg.osr.obs[9].iono_std == 21, + "incorrect value for last_msg.msg.osr.obs[9].iono_std, " + "expected 21, is %d", + last_msg.msg.osr.obs[9].iono_std); + + ck_assert_msg( + last_msg.msg.osr.obs[9].lock == 15, + "incorrect value for last_msg.msg.osr.obs[9].lock, expected 15, is %d", + last_msg.msg.osr.obs[9].lock); + + ck_assert_msg(last_msg.msg.osr.obs[9].range_std == 3, + "incorrect value for last_msg.msg.osr.obs[9].range_std, " + "expected 3, is %d", + last_msg.msg.osr.obs[9].range_std); + + ck_assert_msg(last_msg.msg.osr.obs[9].sid.code == 6, + "incorrect value for last_msg.msg.osr.obs[9].sid.code, " + "expected 6, is %d", + last_msg.msg.osr.obs[9].sid.code); + + ck_assert_msg(last_msg.msg.osr.obs[9].sid.sat == 13, + "incorrect value for last_msg.msg.osr.obs[9].sid.sat, " + "expected 13, is %d", + last_msg.msg.osr.obs[9].sid.sat); + + ck_assert_msg(last_msg.msg.osr.obs[9].tropo_std == 3, + "incorrect value for last_msg.msg.osr.obs[9].tropo_std, " + "expected 3, is %d", + last_msg.msg.osr.obs[9].tropo_std); + + ck_assert_msg( + last_msg.msg.osr.obs[10].L.f == 46, + "incorrect value for last_msg.msg.osr.obs[10].L.f, expected 46, is %d", + last_msg.msg.osr.obs[10].L.f); + + ck_assert_msg(last_msg.msg.osr.obs[10].L.i == 86253605, + "incorrect value for last_msg.msg.osr.obs[10].L.i, expected " + "86253605, is %d", + last_msg.msg.osr.obs[10].L.i); + + ck_assert_msg(last_msg.msg.osr.obs[10].P == 1053200752, + "incorrect value for last_msg.msg.osr.obs[10].P, expected " + "1053200752, is %d", + last_msg.msg.osr.obs[10].P); + + ck_assert_msg( + last_msg.msg.osr.obs[10].flags == 3, + "incorrect value for last_msg.msg.osr.obs[10].flags, expected 3, is %d", + last_msg.msg.osr.obs[10].flags); + + ck_assert_msg(last_msg.msg.osr.obs[10].iono_std == 21, + "incorrect value for last_msg.msg.osr.obs[10].iono_std, " + "expected 21, is %d", + last_msg.msg.osr.obs[10].iono_std); + + ck_assert_msg( + last_msg.msg.osr.obs[10].lock == 15, + "incorrect value for last_msg.msg.osr.obs[10].lock, expected 15, is %d", + last_msg.msg.osr.obs[10].lock); + + ck_assert_msg(last_msg.msg.osr.obs[10].range_std == 3, + "incorrect value for last_msg.msg.osr.obs[10].range_std, " + "expected 3, is %d", + last_msg.msg.osr.obs[10].range_std); + + ck_assert_msg(last_msg.msg.osr.obs[10].sid.code == 6, + "incorrect value for last_msg.msg.osr.obs[10].sid.code, " + "expected 6, is %d", + last_msg.msg.osr.obs[10].sid.code); + + ck_assert_msg(last_msg.msg.osr.obs[10].sid.sat == 14, + "incorrect value for last_msg.msg.osr.obs[10].sid.sat, " + "expected 14, is %d", + last_msg.msg.osr.obs[10].sid.sat); + + ck_assert_msg(last_msg.msg.osr.obs[10].tropo_std == 3, + "incorrect value for last_msg.msg.osr.obs[10].tropo_std, " + "expected 3, is %d", + last_msg.msg.osr.obs[10].tropo_std); + + ck_assert_msg( + last_msg.msg.osr.obs[11].L.f == 95, + "incorrect value for last_msg.msg.osr.obs[11].L.f, expected 95, is %d", + last_msg.msg.osr.obs[11].L.f); + + ck_assert_msg(last_msg.msg.osr.obs[11].L.i == 93155512, + "incorrect value for last_msg.msg.osr.obs[11].L.i, expected " + "93155512, is %d", + last_msg.msg.osr.obs[11].L.i); + + ck_assert_msg(last_msg.msg.osr.obs[11].P == 1137476774, + "incorrect value for last_msg.msg.osr.obs[11].P, expected " + "1137476774, is %d", + last_msg.msg.osr.obs[11].P); + + ck_assert_msg( + last_msg.msg.osr.obs[11].flags == 3, + "incorrect value for last_msg.msg.osr.obs[11].flags, expected 3, is %d", + last_msg.msg.osr.obs[11].flags); + + ck_assert_msg(last_msg.msg.osr.obs[11].iono_std == 21, + "incorrect value for last_msg.msg.osr.obs[11].iono_std, " + "expected 21, is %d", + last_msg.msg.osr.obs[11].iono_std); + + ck_assert_msg( + last_msg.msg.osr.obs[11].lock == 15, + "incorrect value for last_msg.msg.osr.obs[11].lock, expected 15, is %d", + last_msg.msg.osr.obs[11].lock); + + ck_assert_msg(last_msg.msg.osr.obs[11].range_std == 5, + "incorrect value for last_msg.msg.osr.obs[11].range_std, " + "expected 5, is %d", + last_msg.msg.osr.obs[11].range_std); + + ck_assert_msg(last_msg.msg.osr.obs[11].sid.code == 6, + "incorrect value for last_msg.msg.osr.obs[11].sid.code, " + "expected 6, is %d", + last_msg.msg.osr.obs[11].sid.code); + + ck_assert_msg(last_msg.msg.osr.obs[11].sid.sat == 15, + "incorrect value for last_msg.msg.osr.obs[11].sid.sat, " + "expected 15, is %d", + last_msg.msg.osr.obs[11].sid.sat); + ck_assert_msg(last_msg.msg.osr.obs[11].tropo_std == 5, + "incorrect value for last_msg.msg.osr.obs[11].tropo_std, " + "expected 5, is %d", + last_msg.msg.osr.obs[11].tropo_std); } } END_TEST -Suite* auto_check_sbp_observation_MsgOsr_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgOsr"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgOsr"); +Suite *auto_check_sbp_observation_MsgOsr_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgOsr"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_observation_MsgOsr"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgOsr); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgSvAzEl.c b/c/test/auto_check_sbp_observation_MsgSvAzEl.c index 095ce994a..0eac66ce0 100644 --- a/c/test/auto_check_sbp_observation_MsgSvAzEl.c +++ b/c/test/auto_check_sbp_observation_MsgSvAzEl.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvAzEl.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvAzEl.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgSvAzEl ) -{ +START_TEST(test_auto_check_sbp_observation_MsgSvAzEl) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgSvAzEl ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,676 +90,987 @@ START_TEST( test_auto_check_sbp_observation_MsgSvAzEl ) logging_reset(); - sbp_callback_register(&sbp_state, 0x97, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x97, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,151,0,207,121,132,8,0,160,12,10,0,139,66,13,0,16,1,15,0,24,25,16,0,127,18,18,0,42,53,20,0,31,16,23,0,12,67,24,0,47,10,26,0,116,8,27,0,153,43,29,0,77,10,32,0,94,26,1,3,16,58,2,3,108,53,8,3,17,13,17,3,165,40,23,3,63,35,24,3,41,73,20,12,114,26,27,12,72,54,28,12,69,3,29,12,158,14,30,12,152,68,32,12,120,82,2,14,131,6,4,14,27,44,5,14,101,21,9,14,81,65,11,14,49,56,12,14,59,6,30,14,154,4,36,14,165,62,168,36, }; + u8 encoded_frame[] = { + 85, 151, 0, 207, 121, 132, 8, 0, 160, 12, 10, 0, 139, 66, 13, 0, + 16, 1, 15, 0, 24, 25, 16, 0, 127, 18, 18, 0, 42, 53, 20, 0, + 31, 16, 23, 0, 12, 67, 24, 0, 47, 10, 26, 0, 116, 8, 27, 0, + 153, 43, 29, 0, 77, 10, 32, 0, 94, 26, 1, 3, 16, 58, 2, 3, + 108, 53, 8, 3, 17, 13, 17, 3, 165, 40, 23, 3, 63, 35, 24, 3, + 41, 73, 20, 12, 114, 26, 27, 12, 72, 54, 28, 12, 69, 3, 29, 12, + 158, 14, 30, 12, 152, 68, 32, 12, 120, 82, 2, 14, 131, 6, 4, 14, + 27, 44, 5, 14, 101, 21, 9, 14, 81, 65, 11, 14, 49, 56, 12, 14, + 59, 6, 30, 14, 154, 4, 36, 14, 165, 62, 168, 36, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - + test_msg.sv_az_el.azel[0].az = 160; - + test_msg.sv_az_el.azel[0].el = 12; - - + test_msg.sv_az_el.azel[0].sid.code = 0; - + test_msg.sv_az_el.azel[0].sid.sat = 8; - - + test_msg.sv_az_el.azel[1].az = 139; - + test_msg.sv_az_el.azel[1].el = 66; - - + test_msg.sv_az_el.azel[1].sid.code = 0; - + test_msg.sv_az_el.azel[1].sid.sat = 10; - - + test_msg.sv_az_el.azel[2].az = 16; - + test_msg.sv_az_el.azel[2].el = 1; - - + test_msg.sv_az_el.azel[2].sid.code = 0; - + test_msg.sv_az_el.azel[2].sid.sat = 13; - - + test_msg.sv_az_el.azel[3].az = 24; - + test_msg.sv_az_el.azel[3].el = 25; - - + test_msg.sv_az_el.azel[3].sid.code = 0; - + test_msg.sv_az_el.azel[3].sid.sat = 15; - - + test_msg.sv_az_el.azel[4].az = 127; - + test_msg.sv_az_el.azel[4].el = 18; - - + test_msg.sv_az_el.azel[4].sid.code = 0; - + test_msg.sv_az_el.azel[4].sid.sat = 16; - - + test_msg.sv_az_el.azel[5].az = 42; - + test_msg.sv_az_el.azel[5].el = 53; - - + test_msg.sv_az_el.azel[5].sid.code = 0; - + test_msg.sv_az_el.azel[5].sid.sat = 18; - - + test_msg.sv_az_el.azel[6].az = 31; - + test_msg.sv_az_el.azel[6].el = 16; - - + test_msg.sv_az_el.azel[6].sid.code = 0; - + test_msg.sv_az_el.azel[6].sid.sat = 20; - - + test_msg.sv_az_el.azel[7].az = 12; - + test_msg.sv_az_el.azel[7].el = 67; - - + test_msg.sv_az_el.azel[7].sid.code = 0; - + test_msg.sv_az_el.azel[7].sid.sat = 23; - - + test_msg.sv_az_el.azel[8].az = 47; - + test_msg.sv_az_el.azel[8].el = 10; - - + test_msg.sv_az_el.azel[8].sid.code = 0; - + test_msg.sv_az_el.azel[8].sid.sat = 24; - - + test_msg.sv_az_el.azel[9].az = 116; - + test_msg.sv_az_el.azel[9].el = 8; - - + test_msg.sv_az_el.azel[9].sid.code = 0; - + test_msg.sv_az_el.azel[9].sid.sat = 26; - - + test_msg.sv_az_el.azel[10].az = 153; - + test_msg.sv_az_el.azel[10].el = 43; - - + test_msg.sv_az_el.azel[10].sid.code = 0; - + test_msg.sv_az_el.azel[10].sid.sat = 27; - - + test_msg.sv_az_el.azel[11].az = 77; - + test_msg.sv_az_el.azel[11].el = 10; - - + test_msg.sv_az_el.azel[11].sid.code = 0; - + test_msg.sv_az_el.azel[11].sid.sat = 29; - - + test_msg.sv_az_el.azel[12].az = 94; - + test_msg.sv_az_el.azel[12].el = 26; - - + test_msg.sv_az_el.azel[12].sid.code = 0; - + test_msg.sv_az_el.azel[12].sid.sat = 32; - - + test_msg.sv_az_el.azel[13].az = 16; - + test_msg.sv_az_el.azel[13].el = 58; - - + test_msg.sv_az_el.azel[13].sid.code = 3; - + test_msg.sv_az_el.azel[13].sid.sat = 1; - - + test_msg.sv_az_el.azel[14].az = 108; - + test_msg.sv_az_el.azel[14].el = 53; - - + test_msg.sv_az_el.azel[14].sid.code = 3; - + test_msg.sv_az_el.azel[14].sid.sat = 2; - - + test_msg.sv_az_el.azel[15].az = 17; - + test_msg.sv_az_el.azel[15].el = 13; - - + test_msg.sv_az_el.azel[15].sid.code = 3; - + test_msg.sv_az_el.azel[15].sid.sat = 8; - - + test_msg.sv_az_el.azel[16].az = 165; - + test_msg.sv_az_el.azel[16].el = 40; - - + test_msg.sv_az_el.azel[16].sid.code = 3; - + test_msg.sv_az_el.azel[16].sid.sat = 17; - - + test_msg.sv_az_el.azel[17].az = 63; - + test_msg.sv_az_el.azel[17].el = 35; - - + test_msg.sv_az_el.azel[17].sid.code = 3; - + test_msg.sv_az_el.azel[17].sid.sat = 23; - - + test_msg.sv_az_el.azel[18].az = 41; - + test_msg.sv_az_el.azel[18].el = 73; - - + test_msg.sv_az_el.azel[18].sid.code = 3; - + test_msg.sv_az_el.azel[18].sid.sat = 24; - - + test_msg.sv_az_el.azel[19].az = 114; - + test_msg.sv_az_el.azel[19].el = 26; - - + test_msg.sv_az_el.azel[19].sid.code = 12; - + test_msg.sv_az_el.azel[19].sid.sat = 20; - - + test_msg.sv_az_el.azel[20].az = 72; - + test_msg.sv_az_el.azel[20].el = 54; - - + test_msg.sv_az_el.azel[20].sid.code = 12; - + test_msg.sv_az_el.azel[20].sid.sat = 27; - - + test_msg.sv_az_el.azel[21].az = 69; - + test_msg.sv_az_el.azel[21].el = 3; - - + test_msg.sv_az_el.azel[21].sid.code = 12; - + test_msg.sv_az_el.azel[21].sid.sat = 28; - - + test_msg.sv_az_el.azel[22].az = 158; - + test_msg.sv_az_el.azel[22].el = 14; - - + test_msg.sv_az_el.azel[22].sid.code = 12; - + test_msg.sv_az_el.azel[22].sid.sat = 29; - - + test_msg.sv_az_el.azel[23].az = 152; - + test_msg.sv_az_el.azel[23].el = 68; - - + test_msg.sv_az_el.azel[23].sid.code = 12; - + test_msg.sv_az_el.azel[23].sid.sat = 30; - - + test_msg.sv_az_el.azel[24].az = 120; - + test_msg.sv_az_el.azel[24].el = 82; - - + test_msg.sv_az_el.azel[24].sid.code = 12; - + test_msg.sv_az_el.azel[24].sid.sat = 32; - - + test_msg.sv_az_el.azel[25].az = 131; - + test_msg.sv_az_el.azel[25].el = 6; - - + test_msg.sv_az_el.azel[25].sid.code = 14; - + test_msg.sv_az_el.azel[25].sid.sat = 2; - - + test_msg.sv_az_el.azel[26].az = 27; - + test_msg.sv_az_el.azel[26].el = 44; - - + test_msg.sv_az_el.azel[26].sid.code = 14; - + test_msg.sv_az_el.azel[26].sid.sat = 4; - - + test_msg.sv_az_el.azel[27].az = 101; - + test_msg.sv_az_el.azel[27].el = 21; - - + test_msg.sv_az_el.azel[27].sid.code = 14; - + test_msg.sv_az_el.azel[27].sid.sat = 5; - - + test_msg.sv_az_el.azel[28].az = 81; - + test_msg.sv_az_el.azel[28].el = 65; - - + test_msg.sv_az_el.azel[28].sid.code = 14; - + test_msg.sv_az_el.azel[28].sid.sat = 9; - - + test_msg.sv_az_el.azel[29].az = 49; - + test_msg.sv_az_el.azel[29].el = 56; - - + test_msg.sv_az_el.azel[29].sid.code = 14; - + test_msg.sv_az_el.azel[29].sid.sat = 11; - - + test_msg.sv_az_el.azel[30].az = 59; - + test_msg.sv_az_el.azel[30].el = 6; - - + test_msg.sv_az_el.azel[30].sid.code = 14; - + test_msg.sv_az_el.azel[30].sid.sat = 12; - - + test_msg.sv_az_el.azel[31].az = 154; - + test_msg.sv_az_el.azel[31].el = 4; - - + test_msg.sv_az_el.azel[31].sid.code = 14; - + test_msg.sv_az_el.azel[31].sid.sat = 30; - - + test_msg.sv_az_el.azel[32].az = 165; - + test_msg.sv_az_el.azel[32].el = 62; - - + test_msg.sv_az_el.azel[32].sid.code = 14; - + test_msg.sv_az_el.azel[32].sid.sat = 36; - + test_msg.sv_az_el.n_azel = 33; sbp_message_send(&sbp_state, SbpMsgSvAzEl, 31183, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 31183, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgSvAzEl, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[0].az == 160, "incorrect value for last_msg.msg.sv_az_el.azel[0].az, expected 160, is %d", last_msg.msg.sv_az_el.azel[0].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[0].el == 12, "incorrect value for last_msg.msg.sv_az_el.azel[0].el, expected 12, is %d", last_msg.msg.sv_az_el.azel[0].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[0].sid.code == 0, "incorrect value for last_msg.msg.sv_az_el.azel[0].sid.code, expected 0, is %d", last_msg.msg.sv_az_el.azel[0].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[0].sid.sat == 8, "incorrect value for last_msg.msg.sv_az_el.azel[0].sid.sat, expected 8, is %d", last_msg.msg.sv_az_el.azel[0].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[1].az == 139, "incorrect value for last_msg.msg.sv_az_el.azel[1].az, expected 139, is %d", last_msg.msg.sv_az_el.azel[1].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[1].el == 66, "incorrect value for last_msg.msg.sv_az_el.azel[1].el, expected 66, is %d", last_msg.msg.sv_az_el.azel[1].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[1].sid.code == 0, "incorrect value for last_msg.msg.sv_az_el.azel[1].sid.code, expected 0, is %d", last_msg.msg.sv_az_el.azel[1].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[1].sid.sat == 10, "incorrect value for last_msg.msg.sv_az_el.azel[1].sid.sat, expected 10, is %d", last_msg.msg.sv_az_el.azel[1].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[2].az == 16, "incorrect value for last_msg.msg.sv_az_el.azel[2].az, expected 16, is %d", last_msg.msg.sv_az_el.azel[2].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[2].el == 1, "incorrect value for last_msg.msg.sv_az_el.azel[2].el, expected 1, is %d", last_msg.msg.sv_az_el.azel[2].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[2].sid.code == 0, "incorrect value for last_msg.msg.sv_az_el.azel[2].sid.code, expected 0, is %d", last_msg.msg.sv_az_el.azel[2].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[2].sid.sat == 13, "incorrect value for last_msg.msg.sv_az_el.azel[2].sid.sat, expected 13, is %d", last_msg.msg.sv_az_el.azel[2].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[3].az == 24, "incorrect value for last_msg.msg.sv_az_el.azel[3].az, expected 24, is %d", last_msg.msg.sv_az_el.azel[3].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[3].el == 25, "incorrect value for last_msg.msg.sv_az_el.azel[3].el, expected 25, is %d", last_msg.msg.sv_az_el.azel[3].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[3].sid.code == 0, "incorrect value for last_msg.msg.sv_az_el.azel[3].sid.code, expected 0, is %d", last_msg.msg.sv_az_el.azel[3].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[3].sid.sat == 15, "incorrect value for last_msg.msg.sv_az_el.azel[3].sid.sat, expected 15, is %d", last_msg.msg.sv_az_el.azel[3].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[4].az == 127, "incorrect value for last_msg.msg.sv_az_el.azel[4].az, expected 127, is %d", last_msg.msg.sv_az_el.azel[4].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[4].el == 18, "incorrect value for last_msg.msg.sv_az_el.azel[4].el, expected 18, is %d", last_msg.msg.sv_az_el.azel[4].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[4].sid.code == 0, "incorrect value for last_msg.msg.sv_az_el.azel[4].sid.code, expected 0, is %d", last_msg.msg.sv_az_el.azel[4].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[4].sid.sat == 16, "incorrect value for last_msg.msg.sv_az_el.azel[4].sid.sat, expected 16, is %d", last_msg.msg.sv_az_el.azel[4].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[5].az == 42, "incorrect value for last_msg.msg.sv_az_el.azel[5].az, expected 42, is %d", last_msg.msg.sv_az_el.azel[5].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[5].el == 53, "incorrect value for last_msg.msg.sv_az_el.azel[5].el, expected 53, is %d", last_msg.msg.sv_az_el.azel[5].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[5].sid.code == 0, "incorrect value for last_msg.msg.sv_az_el.azel[5].sid.code, expected 0, is %d", last_msg.msg.sv_az_el.azel[5].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[5].sid.sat == 18, "incorrect value for last_msg.msg.sv_az_el.azel[5].sid.sat, expected 18, is %d", last_msg.msg.sv_az_el.azel[5].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[6].az == 31, "incorrect value for last_msg.msg.sv_az_el.azel[6].az, expected 31, is %d", last_msg.msg.sv_az_el.azel[6].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[6].el == 16, "incorrect value for last_msg.msg.sv_az_el.azel[6].el, expected 16, is %d", last_msg.msg.sv_az_el.azel[6].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[6].sid.code == 0, "incorrect value for last_msg.msg.sv_az_el.azel[6].sid.code, expected 0, is %d", last_msg.msg.sv_az_el.azel[6].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[6].sid.sat == 20, "incorrect value for last_msg.msg.sv_az_el.azel[6].sid.sat, expected 20, is %d", last_msg.msg.sv_az_el.azel[6].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[7].az == 12, "incorrect value for last_msg.msg.sv_az_el.azel[7].az, expected 12, is %d", last_msg.msg.sv_az_el.azel[7].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[7].el == 67, "incorrect value for last_msg.msg.sv_az_el.azel[7].el, expected 67, is %d", last_msg.msg.sv_az_el.azel[7].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[7].sid.code == 0, "incorrect value for last_msg.msg.sv_az_el.azel[7].sid.code, expected 0, is %d", last_msg.msg.sv_az_el.azel[7].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[7].sid.sat == 23, "incorrect value for last_msg.msg.sv_az_el.azel[7].sid.sat, expected 23, is %d", last_msg.msg.sv_az_el.azel[7].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[8].az == 47, "incorrect value for last_msg.msg.sv_az_el.azel[8].az, expected 47, is %d", last_msg.msg.sv_az_el.azel[8].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[8].el == 10, "incorrect value for last_msg.msg.sv_az_el.azel[8].el, expected 10, is %d", last_msg.msg.sv_az_el.azel[8].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[8].sid.code == 0, "incorrect value for last_msg.msg.sv_az_el.azel[8].sid.code, expected 0, is %d", last_msg.msg.sv_az_el.azel[8].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[8].sid.sat == 24, "incorrect value for last_msg.msg.sv_az_el.azel[8].sid.sat, expected 24, is %d", last_msg.msg.sv_az_el.azel[8].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[9].az == 116, "incorrect value for last_msg.msg.sv_az_el.azel[9].az, expected 116, is %d", last_msg.msg.sv_az_el.azel[9].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[9].el == 8, "incorrect value for last_msg.msg.sv_az_el.azel[9].el, expected 8, is %d", last_msg.msg.sv_az_el.azel[9].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[9].sid.code == 0, "incorrect value for last_msg.msg.sv_az_el.azel[9].sid.code, expected 0, is %d", last_msg.msg.sv_az_el.azel[9].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[9].sid.sat == 26, "incorrect value for last_msg.msg.sv_az_el.azel[9].sid.sat, expected 26, is %d", last_msg.msg.sv_az_el.azel[9].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[10].az == 153, "incorrect value for last_msg.msg.sv_az_el.azel[10].az, expected 153, is %d", last_msg.msg.sv_az_el.azel[10].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[10].el == 43, "incorrect value for last_msg.msg.sv_az_el.azel[10].el, expected 43, is %d", last_msg.msg.sv_az_el.azel[10].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[10].sid.code == 0, "incorrect value for last_msg.msg.sv_az_el.azel[10].sid.code, expected 0, is %d", last_msg.msg.sv_az_el.azel[10].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[10].sid.sat == 27, "incorrect value for last_msg.msg.sv_az_el.azel[10].sid.sat, expected 27, is %d", last_msg.msg.sv_az_el.azel[10].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[11].az == 77, "incorrect value for last_msg.msg.sv_az_el.azel[11].az, expected 77, is %d", last_msg.msg.sv_az_el.azel[11].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[11].el == 10, "incorrect value for last_msg.msg.sv_az_el.azel[11].el, expected 10, is %d", last_msg.msg.sv_az_el.azel[11].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[11].sid.code == 0, "incorrect value for last_msg.msg.sv_az_el.azel[11].sid.code, expected 0, is %d", last_msg.msg.sv_az_el.azel[11].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[11].sid.sat == 29, "incorrect value for last_msg.msg.sv_az_el.azel[11].sid.sat, expected 29, is %d", last_msg.msg.sv_az_el.azel[11].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[12].az == 94, "incorrect value for last_msg.msg.sv_az_el.azel[12].az, expected 94, is %d", last_msg.msg.sv_az_el.azel[12].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[12].el == 26, "incorrect value for last_msg.msg.sv_az_el.azel[12].el, expected 26, is %d", last_msg.msg.sv_az_el.azel[12].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[12].sid.code == 0, "incorrect value for last_msg.msg.sv_az_el.azel[12].sid.code, expected 0, is %d", last_msg.msg.sv_az_el.azel[12].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[12].sid.sat == 32, "incorrect value for last_msg.msg.sv_az_el.azel[12].sid.sat, expected 32, is %d", last_msg.msg.sv_az_el.azel[12].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[13].az == 16, "incorrect value for last_msg.msg.sv_az_el.azel[13].az, expected 16, is %d", last_msg.msg.sv_az_el.azel[13].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[13].el == 58, "incorrect value for last_msg.msg.sv_az_el.azel[13].el, expected 58, is %d", last_msg.msg.sv_az_el.azel[13].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[13].sid.code == 3, "incorrect value for last_msg.msg.sv_az_el.azel[13].sid.code, expected 3, is %d", last_msg.msg.sv_az_el.azel[13].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[13].sid.sat == 1, "incorrect value for last_msg.msg.sv_az_el.azel[13].sid.sat, expected 1, is %d", last_msg.msg.sv_az_el.azel[13].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[14].az == 108, "incorrect value for last_msg.msg.sv_az_el.azel[14].az, expected 108, is %d", last_msg.msg.sv_az_el.azel[14].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[14].el == 53, "incorrect value for last_msg.msg.sv_az_el.azel[14].el, expected 53, is %d", last_msg.msg.sv_az_el.azel[14].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[14].sid.code == 3, "incorrect value for last_msg.msg.sv_az_el.azel[14].sid.code, expected 3, is %d", last_msg.msg.sv_az_el.azel[14].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[14].sid.sat == 2, "incorrect value for last_msg.msg.sv_az_el.azel[14].sid.sat, expected 2, is %d", last_msg.msg.sv_az_el.azel[14].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[15].az == 17, "incorrect value for last_msg.msg.sv_az_el.azel[15].az, expected 17, is %d", last_msg.msg.sv_az_el.azel[15].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[15].el == 13, "incorrect value for last_msg.msg.sv_az_el.azel[15].el, expected 13, is %d", last_msg.msg.sv_az_el.azel[15].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[15].sid.code == 3, "incorrect value for last_msg.msg.sv_az_el.azel[15].sid.code, expected 3, is %d", last_msg.msg.sv_az_el.azel[15].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[15].sid.sat == 8, "incorrect value for last_msg.msg.sv_az_el.azel[15].sid.sat, expected 8, is %d", last_msg.msg.sv_az_el.azel[15].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[16].az == 165, "incorrect value for last_msg.msg.sv_az_el.azel[16].az, expected 165, is %d", last_msg.msg.sv_az_el.azel[16].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[16].el == 40, "incorrect value for last_msg.msg.sv_az_el.azel[16].el, expected 40, is %d", last_msg.msg.sv_az_el.azel[16].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[16].sid.code == 3, "incorrect value for last_msg.msg.sv_az_el.azel[16].sid.code, expected 3, is %d", last_msg.msg.sv_az_el.azel[16].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[16].sid.sat == 17, "incorrect value for last_msg.msg.sv_az_el.azel[16].sid.sat, expected 17, is %d", last_msg.msg.sv_az_el.azel[16].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[17].az == 63, "incorrect value for last_msg.msg.sv_az_el.azel[17].az, expected 63, is %d", last_msg.msg.sv_az_el.azel[17].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[17].el == 35, "incorrect value for last_msg.msg.sv_az_el.azel[17].el, expected 35, is %d", last_msg.msg.sv_az_el.azel[17].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[17].sid.code == 3, "incorrect value for last_msg.msg.sv_az_el.azel[17].sid.code, expected 3, is %d", last_msg.msg.sv_az_el.azel[17].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[17].sid.sat == 23, "incorrect value for last_msg.msg.sv_az_el.azel[17].sid.sat, expected 23, is %d", last_msg.msg.sv_az_el.azel[17].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[18].az == 41, "incorrect value for last_msg.msg.sv_az_el.azel[18].az, expected 41, is %d", last_msg.msg.sv_az_el.azel[18].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[18].el == 73, "incorrect value for last_msg.msg.sv_az_el.azel[18].el, expected 73, is %d", last_msg.msg.sv_az_el.azel[18].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[18].sid.code == 3, "incorrect value for last_msg.msg.sv_az_el.azel[18].sid.code, expected 3, is %d", last_msg.msg.sv_az_el.azel[18].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[18].sid.sat == 24, "incorrect value for last_msg.msg.sv_az_el.azel[18].sid.sat, expected 24, is %d", last_msg.msg.sv_az_el.azel[18].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[19].az == 114, "incorrect value for last_msg.msg.sv_az_el.azel[19].az, expected 114, is %d", last_msg.msg.sv_az_el.azel[19].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[19].el == 26, "incorrect value for last_msg.msg.sv_az_el.azel[19].el, expected 26, is %d", last_msg.msg.sv_az_el.azel[19].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[19].sid.code == 12, "incorrect value for last_msg.msg.sv_az_el.azel[19].sid.code, expected 12, is %d", last_msg.msg.sv_az_el.azel[19].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[19].sid.sat == 20, "incorrect value for last_msg.msg.sv_az_el.azel[19].sid.sat, expected 20, is %d", last_msg.msg.sv_az_el.azel[19].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[20].az == 72, "incorrect value for last_msg.msg.sv_az_el.azel[20].az, expected 72, is %d", last_msg.msg.sv_az_el.azel[20].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[20].el == 54, "incorrect value for last_msg.msg.sv_az_el.azel[20].el, expected 54, is %d", last_msg.msg.sv_az_el.azel[20].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[20].sid.code == 12, "incorrect value for last_msg.msg.sv_az_el.azel[20].sid.code, expected 12, is %d", last_msg.msg.sv_az_el.azel[20].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[20].sid.sat == 27, "incorrect value for last_msg.msg.sv_az_el.azel[20].sid.sat, expected 27, is %d", last_msg.msg.sv_az_el.azel[20].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[21].az == 69, "incorrect value for last_msg.msg.sv_az_el.azel[21].az, expected 69, is %d", last_msg.msg.sv_az_el.azel[21].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[21].el == 3, "incorrect value for last_msg.msg.sv_az_el.azel[21].el, expected 3, is %d", last_msg.msg.sv_az_el.azel[21].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[21].sid.code == 12, "incorrect value for last_msg.msg.sv_az_el.azel[21].sid.code, expected 12, is %d", last_msg.msg.sv_az_el.azel[21].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[21].sid.sat == 28, "incorrect value for last_msg.msg.sv_az_el.azel[21].sid.sat, expected 28, is %d", last_msg.msg.sv_az_el.azel[21].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[22].az == 158, "incorrect value for last_msg.msg.sv_az_el.azel[22].az, expected 158, is %d", last_msg.msg.sv_az_el.azel[22].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[22].el == 14, "incorrect value for last_msg.msg.sv_az_el.azel[22].el, expected 14, is %d", last_msg.msg.sv_az_el.azel[22].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[22].sid.code == 12, "incorrect value for last_msg.msg.sv_az_el.azel[22].sid.code, expected 12, is %d", last_msg.msg.sv_az_el.azel[22].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[22].sid.sat == 29, "incorrect value for last_msg.msg.sv_az_el.azel[22].sid.sat, expected 29, is %d", last_msg.msg.sv_az_el.azel[22].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[23].az == 152, "incorrect value for last_msg.msg.sv_az_el.azel[23].az, expected 152, is %d", last_msg.msg.sv_az_el.azel[23].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[23].el == 68, "incorrect value for last_msg.msg.sv_az_el.azel[23].el, expected 68, is %d", last_msg.msg.sv_az_el.azel[23].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[23].sid.code == 12, "incorrect value for last_msg.msg.sv_az_el.azel[23].sid.code, expected 12, is %d", last_msg.msg.sv_az_el.azel[23].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[23].sid.sat == 30, "incorrect value for last_msg.msg.sv_az_el.azel[23].sid.sat, expected 30, is %d", last_msg.msg.sv_az_el.azel[23].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[24].az == 120, "incorrect value for last_msg.msg.sv_az_el.azel[24].az, expected 120, is %d", last_msg.msg.sv_az_el.azel[24].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[24].el == 82, "incorrect value for last_msg.msg.sv_az_el.azel[24].el, expected 82, is %d", last_msg.msg.sv_az_el.azel[24].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[24].sid.code == 12, "incorrect value for last_msg.msg.sv_az_el.azel[24].sid.code, expected 12, is %d", last_msg.msg.sv_az_el.azel[24].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[24].sid.sat == 32, "incorrect value for last_msg.msg.sv_az_el.azel[24].sid.sat, expected 32, is %d", last_msg.msg.sv_az_el.azel[24].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[25].az == 131, "incorrect value for last_msg.msg.sv_az_el.azel[25].az, expected 131, is %d", last_msg.msg.sv_az_el.azel[25].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[25].el == 6, "incorrect value for last_msg.msg.sv_az_el.azel[25].el, expected 6, is %d", last_msg.msg.sv_az_el.azel[25].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[25].sid.code == 14, "incorrect value for last_msg.msg.sv_az_el.azel[25].sid.code, expected 14, is %d", last_msg.msg.sv_az_el.azel[25].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[25].sid.sat == 2, "incorrect value for last_msg.msg.sv_az_el.azel[25].sid.sat, expected 2, is %d", last_msg.msg.sv_az_el.azel[25].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[26].az == 27, "incorrect value for last_msg.msg.sv_az_el.azel[26].az, expected 27, is %d", last_msg.msg.sv_az_el.azel[26].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[26].el == 44, "incorrect value for last_msg.msg.sv_az_el.azel[26].el, expected 44, is %d", last_msg.msg.sv_az_el.azel[26].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[26].sid.code == 14, "incorrect value for last_msg.msg.sv_az_el.azel[26].sid.code, expected 14, is %d", last_msg.msg.sv_az_el.azel[26].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[26].sid.sat == 4, "incorrect value for last_msg.msg.sv_az_el.azel[26].sid.sat, expected 4, is %d", last_msg.msg.sv_az_el.azel[26].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[27].az == 101, "incorrect value for last_msg.msg.sv_az_el.azel[27].az, expected 101, is %d", last_msg.msg.sv_az_el.azel[27].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[27].el == 21, "incorrect value for last_msg.msg.sv_az_el.azel[27].el, expected 21, is %d", last_msg.msg.sv_az_el.azel[27].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[27].sid.code == 14, "incorrect value for last_msg.msg.sv_az_el.azel[27].sid.code, expected 14, is %d", last_msg.msg.sv_az_el.azel[27].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[27].sid.sat == 5, "incorrect value for last_msg.msg.sv_az_el.azel[27].sid.sat, expected 5, is %d", last_msg.msg.sv_az_el.azel[27].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[28].az == 81, "incorrect value for last_msg.msg.sv_az_el.azel[28].az, expected 81, is %d", last_msg.msg.sv_az_el.azel[28].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[28].el == 65, "incorrect value for last_msg.msg.sv_az_el.azel[28].el, expected 65, is %d", last_msg.msg.sv_az_el.azel[28].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[28].sid.code == 14, "incorrect value for last_msg.msg.sv_az_el.azel[28].sid.code, expected 14, is %d", last_msg.msg.sv_az_el.azel[28].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[28].sid.sat == 9, "incorrect value for last_msg.msg.sv_az_el.azel[28].sid.sat, expected 9, is %d", last_msg.msg.sv_az_el.azel[28].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[29].az == 49, "incorrect value for last_msg.msg.sv_az_el.azel[29].az, expected 49, is %d", last_msg.msg.sv_az_el.azel[29].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[29].el == 56, "incorrect value for last_msg.msg.sv_az_el.azel[29].el, expected 56, is %d", last_msg.msg.sv_az_el.azel[29].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[29].sid.code == 14, "incorrect value for last_msg.msg.sv_az_el.azel[29].sid.code, expected 14, is %d", last_msg.msg.sv_az_el.azel[29].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[29].sid.sat == 11, "incorrect value for last_msg.msg.sv_az_el.azel[29].sid.sat, expected 11, is %d", last_msg.msg.sv_az_el.azel[29].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[30].az == 59, "incorrect value for last_msg.msg.sv_az_el.azel[30].az, expected 59, is %d", last_msg.msg.sv_az_el.azel[30].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[30].el == 6, "incorrect value for last_msg.msg.sv_az_el.azel[30].el, expected 6, is %d", last_msg.msg.sv_az_el.azel[30].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[30].sid.code == 14, "incorrect value for last_msg.msg.sv_az_el.azel[30].sid.code, expected 14, is %d", last_msg.msg.sv_az_el.azel[30].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[30].sid.sat == 12, "incorrect value for last_msg.msg.sv_az_el.azel[30].sid.sat, expected 12, is %d", last_msg.msg.sv_az_el.azel[30].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[31].az == 154, "incorrect value for last_msg.msg.sv_az_el.azel[31].az, expected 154, is %d", last_msg.msg.sv_az_el.azel[31].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[31].el == 4, "incorrect value for last_msg.msg.sv_az_el.azel[31].el, expected 4, is %d", last_msg.msg.sv_az_el.azel[31].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[31].sid.code == 14, "incorrect value for last_msg.msg.sv_az_el.azel[31].sid.code, expected 14, is %d", last_msg.msg.sv_az_el.azel[31].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[31].sid.sat == 30, "incorrect value for last_msg.msg.sv_az_el.azel[31].sid.sat, expected 30, is %d", last_msg.msg.sv_az_el.azel[31].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[32].az == 165, "incorrect value for last_msg.msg.sv_az_el.azel[32].az, expected 165, is %d", last_msg.msg.sv_az_el.azel[32].az); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[32].el == 62, "incorrect value for last_msg.msg.sv_az_el.azel[32].el, expected 62, is %d", last_msg.msg.sv_az_el.azel[32].el); - - - ck_assert_msg(last_msg.msg.sv_az_el.azel[32].sid.code == 14, "incorrect value for last_msg.msg.sv_az_el.azel[32].sid.code, expected 14, is %d", last_msg.msg.sv_az_el.azel[32].sid.code); - - ck_assert_msg(last_msg.msg.sv_az_el.azel[32].sid.sat == 36, "incorrect value for last_msg.msg.sv_az_el.azel[32].sid.sat, expected 36, is %d", last_msg.msg.sv_az_el.azel[32].sid.sat); - - ck_assert_msg(last_msg.msg.sv_az_el.n_azel == 33, "incorrect value for last_msg.msg.sv_az_el.n_azel, expected 33, is %d", last_msg.msg.sv_az_el.n_azel); + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[0].az == 160, + "incorrect value for last_msg.msg.sv_az_el.azel[0].az, " + "expected 160, is %d", + last_msg.msg.sv_az_el.azel[0].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[0].el == 12, + "incorrect value for last_msg.msg.sv_az_el.azel[0].el, " + "expected 12, is %d", + last_msg.msg.sv_az_el.azel[0].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[0].sid.code == 0, + "incorrect value for last_msg.msg.sv_az_el.azel[0].sid.code, " + "expected 0, is %d", + last_msg.msg.sv_az_el.azel[0].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[0].sid.sat == 8, + "incorrect value for last_msg.msg.sv_az_el.azel[0].sid.sat, " + "expected 8, is %d", + last_msg.msg.sv_az_el.azel[0].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[1].az == 139, + "incorrect value for last_msg.msg.sv_az_el.azel[1].az, " + "expected 139, is %d", + last_msg.msg.sv_az_el.azel[1].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[1].el == 66, + "incorrect value for last_msg.msg.sv_az_el.azel[1].el, " + "expected 66, is %d", + last_msg.msg.sv_az_el.azel[1].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[1].sid.code == 0, + "incorrect value for last_msg.msg.sv_az_el.azel[1].sid.code, " + "expected 0, is %d", + last_msg.msg.sv_az_el.azel[1].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[1].sid.sat == 10, + "incorrect value for last_msg.msg.sv_az_el.azel[1].sid.sat, " + "expected 10, is %d", + last_msg.msg.sv_az_el.azel[1].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[2].az == 16, + "incorrect value for last_msg.msg.sv_az_el.azel[2].az, " + "expected 16, is %d", + last_msg.msg.sv_az_el.azel[2].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[2].el == 1, + "incorrect value for last_msg.msg.sv_az_el.azel[2].el, " + "expected 1, is %d", + last_msg.msg.sv_az_el.azel[2].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[2].sid.code == 0, + "incorrect value for last_msg.msg.sv_az_el.azel[2].sid.code, " + "expected 0, is %d", + last_msg.msg.sv_az_el.azel[2].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[2].sid.sat == 13, + "incorrect value for last_msg.msg.sv_az_el.azel[2].sid.sat, " + "expected 13, is %d", + last_msg.msg.sv_az_el.azel[2].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[3].az == 24, + "incorrect value for last_msg.msg.sv_az_el.azel[3].az, " + "expected 24, is %d", + last_msg.msg.sv_az_el.azel[3].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[3].el == 25, + "incorrect value for last_msg.msg.sv_az_el.azel[3].el, " + "expected 25, is %d", + last_msg.msg.sv_az_el.azel[3].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[3].sid.code == 0, + "incorrect value for last_msg.msg.sv_az_el.azel[3].sid.code, " + "expected 0, is %d", + last_msg.msg.sv_az_el.azel[3].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[3].sid.sat == 15, + "incorrect value for last_msg.msg.sv_az_el.azel[3].sid.sat, " + "expected 15, is %d", + last_msg.msg.sv_az_el.azel[3].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[4].az == 127, + "incorrect value for last_msg.msg.sv_az_el.azel[4].az, " + "expected 127, is %d", + last_msg.msg.sv_az_el.azel[4].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[4].el == 18, + "incorrect value for last_msg.msg.sv_az_el.azel[4].el, " + "expected 18, is %d", + last_msg.msg.sv_az_el.azel[4].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[4].sid.code == 0, + "incorrect value for last_msg.msg.sv_az_el.azel[4].sid.code, " + "expected 0, is %d", + last_msg.msg.sv_az_el.azel[4].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[4].sid.sat == 16, + "incorrect value for last_msg.msg.sv_az_el.azel[4].sid.sat, " + "expected 16, is %d", + last_msg.msg.sv_az_el.azel[4].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[5].az == 42, + "incorrect value for last_msg.msg.sv_az_el.azel[5].az, " + "expected 42, is %d", + last_msg.msg.sv_az_el.azel[5].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[5].el == 53, + "incorrect value for last_msg.msg.sv_az_el.azel[5].el, " + "expected 53, is %d", + last_msg.msg.sv_az_el.azel[5].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[5].sid.code == 0, + "incorrect value for last_msg.msg.sv_az_el.azel[5].sid.code, " + "expected 0, is %d", + last_msg.msg.sv_az_el.azel[5].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[5].sid.sat == 18, + "incorrect value for last_msg.msg.sv_az_el.azel[5].sid.sat, " + "expected 18, is %d", + last_msg.msg.sv_az_el.azel[5].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[6].az == 31, + "incorrect value for last_msg.msg.sv_az_el.azel[6].az, " + "expected 31, is %d", + last_msg.msg.sv_az_el.azel[6].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[6].el == 16, + "incorrect value for last_msg.msg.sv_az_el.azel[6].el, " + "expected 16, is %d", + last_msg.msg.sv_az_el.azel[6].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[6].sid.code == 0, + "incorrect value for last_msg.msg.sv_az_el.azel[6].sid.code, " + "expected 0, is %d", + last_msg.msg.sv_az_el.azel[6].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[6].sid.sat == 20, + "incorrect value for last_msg.msg.sv_az_el.azel[6].sid.sat, " + "expected 20, is %d", + last_msg.msg.sv_az_el.azel[6].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[7].az == 12, + "incorrect value for last_msg.msg.sv_az_el.azel[7].az, " + "expected 12, is %d", + last_msg.msg.sv_az_el.azel[7].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[7].el == 67, + "incorrect value for last_msg.msg.sv_az_el.azel[7].el, " + "expected 67, is %d", + last_msg.msg.sv_az_el.azel[7].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[7].sid.code == 0, + "incorrect value for last_msg.msg.sv_az_el.azel[7].sid.code, " + "expected 0, is %d", + last_msg.msg.sv_az_el.azel[7].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[7].sid.sat == 23, + "incorrect value for last_msg.msg.sv_az_el.azel[7].sid.sat, " + "expected 23, is %d", + last_msg.msg.sv_az_el.azel[7].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[8].az == 47, + "incorrect value for last_msg.msg.sv_az_el.azel[8].az, " + "expected 47, is %d", + last_msg.msg.sv_az_el.azel[8].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[8].el == 10, + "incorrect value for last_msg.msg.sv_az_el.azel[8].el, " + "expected 10, is %d", + last_msg.msg.sv_az_el.azel[8].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[8].sid.code == 0, + "incorrect value for last_msg.msg.sv_az_el.azel[8].sid.code, " + "expected 0, is %d", + last_msg.msg.sv_az_el.azel[8].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[8].sid.sat == 24, + "incorrect value for last_msg.msg.sv_az_el.azel[8].sid.sat, " + "expected 24, is %d", + last_msg.msg.sv_az_el.azel[8].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[9].az == 116, + "incorrect value for last_msg.msg.sv_az_el.azel[9].az, " + "expected 116, is %d", + last_msg.msg.sv_az_el.azel[9].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[9].el == 8, + "incorrect value for last_msg.msg.sv_az_el.azel[9].el, " + "expected 8, is %d", + last_msg.msg.sv_az_el.azel[9].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[9].sid.code == 0, + "incorrect value for last_msg.msg.sv_az_el.azel[9].sid.code, " + "expected 0, is %d", + last_msg.msg.sv_az_el.azel[9].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[9].sid.sat == 26, + "incorrect value for last_msg.msg.sv_az_el.azel[9].sid.sat, " + "expected 26, is %d", + last_msg.msg.sv_az_el.azel[9].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[10].az == 153, + "incorrect value for last_msg.msg.sv_az_el.azel[10].az, " + "expected 153, is %d", + last_msg.msg.sv_az_el.azel[10].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[10].el == 43, + "incorrect value for last_msg.msg.sv_az_el.azel[10].el, " + "expected 43, is %d", + last_msg.msg.sv_az_el.azel[10].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[10].sid.code == 0, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[10].sid.code, expected 0, is %d", + last_msg.msg.sv_az_el.azel[10].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[10].sid.sat == 27, + "incorrect value for last_msg.msg.sv_az_el.azel[10].sid.sat, " + "expected 27, is %d", + last_msg.msg.sv_az_el.azel[10].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[11].az == 77, + "incorrect value for last_msg.msg.sv_az_el.azel[11].az, " + "expected 77, is %d", + last_msg.msg.sv_az_el.azel[11].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[11].el == 10, + "incorrect value for last_msg.msg.sv_az_el.azel[11].el, " + "expected 10, is %d", + last_msg.msg.sv_az_el.azel[11].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[11].sid.code == 0, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[11].sid.code, expected 0, is %d", + last_msg.msg.sv_az_el.azel[11].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[11].sid.sat == 29, + "incorrect value for last_msg.msg.sv_az_el.azel[11].sid.sat, " + "expected 29, is %d", + last_msg.msg.sv_az_el.azel[11].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[12].az == 94, + "incorrect value for last_msg.msg.sv_az_el.azel[12].az, " + "expected 94, is %d", + last_msg.msg.sv_az_el.azel[12].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[12].el == 26, + "incorrect value for last_msg.msg.sv_az_el.azel[12].el, " + "expected 26, is %d", + last_msg.msg.sv_az_el.azel[12].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[12].sid.code == 0, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[12].sid.code, expected 0, is %d", + last_msg.msg.sv_az_el.azel[12].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[12].sid.sat == 32, + "incorrect value for last_msg.msg.sv_az_el.azel[12].sid.sat, " + "expected 32, is %d", + last_msg.msg.sv_az_el.azel[12].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[13].az == 16, + "incorrect value for last_msg.msg.sv_az_el.azel[13].az, " + "expected 16, is %d", + last_msg.msg.sv_az_el.azel[13].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[13].el == 58, + "incorrect value for last_msg.msg.sv_az_el.azel[13].el, " + "expected 58, is %d", + last_msg.msg.sv_az_el.azel[13].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[13].sid.code == 3, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[13].sid.code, expected 3, is %d", + last_msg.msg.sv_az_el.azel[13].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[13].sid.sat == 1, + "incorrect value for last_msg.msg.sv_az_el.azel[13].sid.sat, " + "expected 1, is %d", + last_msg.msg.sv_az_el.azel[13].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[14].az == 108, + "incorrect value for last_msg.msg.sv_az_el.azel[14].az, " + "expected 108, is %d", + last_msg.msg.sv_az_el.azel[14].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[14].el == 53, + "incorrect value for last_msg.msg.sv_az_el.azel[14].el, " + "expected 53, is %d", + last_msg.msg.sv_az_el.azel[14].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[14].sid.code == 3, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[14].sid.code, expected 3, is %d", + last_msg.msg.sv_az_el.azel[14].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[14].sid.sat == 2, + "incorrect value for last_msg.msg.sv_az_el.azel[14].sid.sat, " + "expected 2, is %d", + last_msg.msg.sv_az_el.azel[14].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[15].az == 17, + "incorrect value for last_msg.msg.sv_az_el.azel[15].az, " + "expected 17, is %d", + last_msg.msg.sv_az_el.azel[15].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[15].el == 13, + "incorrect value for last_msg.msg.sv_az_el.azel[15].el, " + "expected 13, is %d", + last_msg.msg.sv_az_el.azel[15].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[15].sid.code == 3, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[15].sid.code, expected 3, is %d", + last_msg.msg.sv_az_el.azel[15].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[15].sid.sat == 8, + "incorrect value for last_msg.msg.sv_az_el.azel[15].sid.sat, " + "expected 8, is %d", + last_msg.msg.sv_az_el.azel[15].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[16].az == 165, + "incorrect value for last_msg.msg.sv_az_el.azel[16].az, " + "expected 165, is %d", + last_msg.msg.sv_az_el.azel[16].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[16].el == 40, + "incorrect value for last_msg.msg.sv_az_el.azel[16].el, " + "expected 40, is %d", + last_msg.msg.sv_az_el.azel[16].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[16].sid.code == 3, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[16].sid.code, expected 3, is %d", + last_msg.msg.sv_az_el.azel[16].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[16].sid.sat == 17, + "incorrect value for last_msg.msg.sv_az_el.azel[16].sid.sat, " + "expected 17, is %d", + last_msg.msg.sv_az_el.azel[16].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[17].az == 63, + "incorrect value for last_msg.msg.sv_az_el.azel[17].az, " + "expected 63, is %d", + last_msg.msg.sv_az_el.azel[17].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[17].el == 35, + "incorrect value for last_msg.msg.sv_az_el.azel[17].el, " + "expected 35, is %d", + last_msg.msg.sv_az_el.azel[17].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[17].sid.code == 3, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[17].sid.code, expected 3, is %d", + last_msg.msg.sv_az_el.azel[17].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[17].sid.sat == 23, + "incorrect value for last_msg.msg.sv_az_el.azel[17].sid.sat, " + "expected 23, is %d", + last_msg.msg.sv_az_el.azel[17].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[18].az == 41, + "incorrect value for last_msg.msg.sv_az_el.azel[18].az, " + "expected 41, is %d", + last_msg.msg.sv_az_el.azel[18].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[18].el == 73, + "incorrect value for last_msg.msg.sv_az_el.azel[18].el, " + "expected 73, is %d", + last_msg.msg.sv_az_el.azel[18].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[18].sid.code == 3, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[18].sid.code, expected 3, is %d", + last_msg.msg.sv_az_el.azel[18].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[18].sid.sat == 24, + "incorrect value for last_msg.msg.sv_az_el.azel[18].sid.sat, " + "expected 24, is %d", + last_msg.msg.sv_az_el.azel[18].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[19].az == 114, + "incorrect value for last_msg.msg.sv_az_el.azel[19].az, " + "expected 114, is %d", + last_msg.msg.sv_az_el.azel[19].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[19].el == 26, + "incorrect value for last_msg.msg.sv_az_el.azel[19].el, " + "expected 26, is %d", + last_msg.msg.sv_az_el.azel[19].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[19].sid.code == 12, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[19].sid.code, expected 12, is %d", + last_msg.msg.sv_az_el.azel[19].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[19].sid.sat == 20, + "incorrect value for last_msg.msg.sv_az_el.azel[19].sid.sat, " + "expected 20, is %d", + last_msg.msg.sv_az_el.azel[19].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[20].az == 72, + "incorrect value for last_msg.msg.sv_az_el.azel[20].az, " + "expected 72, is %d", + last_msg.msg.sv_az_el.azel[20].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[20].el == 54, + "incorrect value for last_msg.msg.sv_az_el.azel[20].el, " + "expected 54, is %d", + last_msg.msg.sv_az_el.azel[20].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[20].sid.code == 12, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[20].sid.code, expected 12, is %d", + last_msg.msg.sv_az_el.azel[20].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[20].sid.sat == 27, + "incorrect value for last_msg.msg.sv_az_el.azel[20].sid.sat, " + "expected 27, is %d", + last_msg.msg.sv_az_el.azel[20].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[21].az == 69, + "incorrect value for last_msg.msg.sv_az_el.azel[21].az, " + "expected 69, is %d", + last_msg.msg.sv_az_el.azel[21].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[21].el == 3, + "incorrect value for last_msg.msg.sv_az_el.azel[21].el, " + "expected 3, is %d", + last_msg.msg.sv_az_el.azel[21].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[21].sid.code == 12, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[21].sid.code, expected 12, is %d", + last_msg.msg.sv_az_el.azel[21].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[21].sid.sat == 28, + "incorrect value for last_msg.msg.sv_az_el.azel[21].sid.sat, " + "expected 28, is %d", + last_msg.msg.sv_az_el.azel[21].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[22].az == 158, + "incorrect value for last_msg.msg.sv_az_el.azel[22].az, " + "expected 158, is %d", + last_msg.msg.sv_az_el.azel[22].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[22].el == 14, + "incorrect value for last_msg.msg.sv_az_el.azel[22].el, " + "expected 14, is %d", + last_msg.msg.sv_az_el.azel[22].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[22].sid.code == 12, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[22].sid.code, expected 12, is %d", + last_msg.msg.sv_az_el.azel[22].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[22].sid.sat == 29, + "incorrect value for last_msg.msg.sv_az_el.azel[22].sid.sat, " + "expected 29, is %d", + last_msg.msg.sv_az_el.azel[22].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[23].az == 152, + "incorrect value for last_msg.msg.sv_az_el.azel[23].az, " + "expected 152, is %d", + last_msg.msg.sv_az_el.azel[23].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[23].el == 68, + "incorrect value for last_msg.msg.sv_az_el.azel[23].el, " + "expected 68, is %d", + last_msg.msg.sv_az_el.azel[23].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[23].sid.code == 12, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[23].sid.code, expected 12, is %d", + last_msg.msg.sv_az_el.azel[23].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[23].sid.sat == 30, + "incorrect value for last_msg.msg.sv_az_el.azel[23].sid.sat, " + "expected 30, is %d", + last_msg.msg.sv_az_el.azel[23].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[24].az == 120, + "incorrect value for last_msg.msg.sv_az_el.azel[24].az, " + "expected 120, is %d", + last_msg.msg.sv_az_el.azel[24].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[24].el == 82, + "incorrect value for last_msg.msg.sv_az_el.azel[24].el, " + "expected 82, is %d", + last_msg.msg.sv_az_el.azel[24].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[24].sid.code == 12, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[24].sid.code, expected 12, is %d", + last_msg.msg.sv_az_el.azel[24].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[24].sid.sat == 32, + "incorrect value for last_msg.msg.sv_az_el.azel[24].sid.sat, " + "expected 32, is %d", + last_msg.msg.sv_az_el.azel[24].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[25].az == 131, + "incorrect value for last_msg.msg.sv_az_el.azel[25].az, " + "expected 131, is %d", + last_msg.msg.sv_az_el.azel[25].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[25].el == 6, + "incorrect value for last_msg.msg.sv_az_el.azel[25].el, " + "expected 6, is %d", + last_msg.msg.sv_az_el.azel[25].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[25].sid.code == 14, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[25].sid.code, expected 14, is %d", + last_msg.msg.sv_az_el.azel[25].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[25].sid.sat == 2, + "incorrect value for last_msg.msg.sv_az_el.azel[25].sid.sat, " + "expected 2, is %d", + last_msg.msg.sv_az_el.azel[25].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[26].az == 27, + "incorrect value for last_msg.msg.sv_az_el.azel[26].az, " + "expected 27, is %d", + last_msg.msg.sv_az_el.azel[26].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[26].el == 44, + "incorrect value for last_msg.msg.sv_az_el.azel[26].el, " + "expected 44, is %d", + last_msg.msg.sv_az_el.azel[26].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[26].sid.code == 14, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[26].sid.code, expected 14, is %d", + last_msg.msg.sv_az_el.azel[26].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[26].sid.sat == 4, + "incorrect value for last_msg.msg.sv_az_el.azel[26].sid.sat, " + "expected 4, is %d", + last_msg.msg.sv_az_el.azel[26].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[27].az == 101, + "incorrect value for last_msg.msg.sv_az_el.azel[27].az, " + "expected 101, is %d", + last_msg.msg.sv_az_el.azel[27].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[27].el == 21, + "incorrect value for last_msg.msg.sv_az_el.azel[27].el, " + "expected 21, is %d", + last_msg.msg.sv_az_el.azel[27].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[27].sid.code == 14, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[27].sid.code, expected 14, is %d", + last_msg.msg.sv_az_el.azel[27].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[27].sid.sat == 5, + "incorrect value for last_msg.msg.sv_az_el.azel[27].sid.sat, " + "expected 5, is %d", + last_msg.msg.sv_az_el.azel[27].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[28].az == 81, + "incorrect value for last_msg.msg.sv_az_el.azel[28].az, " + "expected 81, is %d", + last_msg.msg.sv_az_el.azel[28].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[28].el == 65, + "incorrect value for last_msg.msg.sv_az_el.azel[28].el, " + "expected 65, is %d", + last_msg.msg.sv_az_el.azel[28].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[28].sid.code == 14, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[28].sid.code, expected 14, is %d", + last_msg.msg.sv_az_el.azel[28].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[28].sid.sat == 9, + "incorrect value for last_msg.msg.sv_az_el.azel[28].sid.sat, " + "expected 9, is %d", + last_msg.msg.sv_az_el.azel[28].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[29].az == 49, + "incorrect value for last_msg.msg.sv_az_el.azel[29].az, " + "expected 49, is %d", + last_msg.msg.sv_az_el.azel[29].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[29].el == 56, + "incorrect value for last_msg.msg.sv_az_el.azel[29].el, " + "expected 56, is %d", + last_msg.msg.sv_az_el.azel[29].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[29].sid.code == 14, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[29].sid.code, expected 14, is %d", + last_msg.msg.sv_az_el.azel[29].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[29].sid.sat == 11, + "incorrect value for last_msg.msg.sv_az_el.azel[29].sid.sat, " + "expected 11, is %d", + last_msg.msg.sv_az_el.azel[29].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[30].az == 59, + "incorrect value for last_msg.msg.sv_az_el.azel[30].az, " + "expected 59, is %d", + last_msg.msg.sv_az_el.azel[30].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[30].el == 6, + "incorrect value for last_msg.msg.sv_az_el.azel[30].el, " + "expected 6, is %d", + last_msg.msg.sv_az_el.azel[30].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[30].sid.code == 14, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[30].sid.code, expected 14, is %d", + last_msg.msg.sv_az_el.azel[30].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[30].sid.sat == 12, + "incorrect value for last_msg.msg.sv_az_el.azel[30].sid.sat, " + "expected 12, is %d", + last_msg.msg.sv_az_el.azel[30].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[31].az == 154, + "incorrect value for last_msg.msg.sv_az_el.azel[31].az, " + "expected 154, is %d", + last_msg.msg.sv_az_el.azel[31].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[31].el == 4, + "incorrect value for last_msg.msg.sv_az_el.azel[31].el, " + "expected 4, is %d", + last_msg.msg.sv_az_el.azel[31].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[31].sid.code == 14, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[31].sid.code, expected 14, is %d", + last_msg.msg.sv_az_el.azel[31].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[31].sid.sat == 30, + "incorrect value for last_msg.msg.sv_az_el.azel[31].sid.sat, " + "expected 30, is %d", + last_msg.msg.sv_az_el.azel[31].sid.sat); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[32].az == 165, + "incorrect value for last_msg.msg.sv_az_el.azel[32].az, " + "expected 165, is %d", + last_msg.msg.sv_az_el.azel[32].az); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[32].el == 62, + "incorrect value for last_msg.msg.sv_az_el.azel[32].el, " + "expected 62, is %d", + last_msg.msg.sv_az_el.azel[32].el); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[32].sid.code == 14, + "incorrect value for " + "last_msg.msg.sv_az_el.azel[32].sid.code, expected 14, is %d", + last_msg.msg.sv_az_el.azel[32].sid.code); + + ck_assert_msg(last_msg.msg.sv_az_el.azel[32].sid.sat == 36, + "incorrect value for last_msg.msg.sv_az_el.azel[32].sid.sat, " + "expected 36, is %d", + last_msg.msg.sv_az_el.azel[32].sid.sat); + ck_assert_msg( + last_msg.msg.sv_az_el.n_azel == 33, + "incorrect value for last_msg.msg.sv_az_el.n_azel, expected 33, is %d", + last_msg.msg.sv_az_el.n_azel); } } END_TEST -Suite* auto_check_sbp_observation_MsgSvAzEl_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgSvAzEl"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgSvAzEl"); +Suite *auto_check_sbp_observation_MsgSvAzEl_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_MsgSvAzEl"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_observation_MsgSvAzEl"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgSvAzEl); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_MsgSvConfigurationGpsDep.c b/c/test/auto_check_sbp_observation_MsgSvConfigurationGpsDep.c index 8582fd18d..c08407b72 100644 --- a/c/test/auto_check_sbp_observation_MsgSvConfigurationGpsDep.c +++ b/c/test/auto_check_sbp_observation_MsgSvConfigurationGpsDep.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvConfigurationGpsDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvConfigurationGpsDep.yaml +// by generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_MsgSvConfigurationGpsDep ) -{ +START_TEST(test_auto_check_sbp_observation_MsgSvConfigurationGpsDep) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_MsgSvConfigurationGpsDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,58 +90,77 @@ START_TEST( test_auto_check_sbp_observation_MsgSvConfigurationGpsDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x91, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x91, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,145,0,123,0,10,0,0,0,0,0,0,66,188,101,167,18,42, }; + u8 encoded_frame[] = { + 85, 145, 0, 123, 0, 10, 0, 0, 0, 0, 0, 0, 66, 188, 101, 167, 18, 42, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.sv_configuration_gps_dep.l2c_mask = 2808462402; - - + test_msg.sv_configuration_gps_dep.t_nmct.tow = 0; - + test_msg.sv_configuration_gps_dep.t_nmct.wn = 0; - sbp_message_send(&sbp_state, SbpMsgSvConfigurationGpsDep, 123, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSvConfigurationGpsDep, 123, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSvConfigurationGpsDep, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.sv_configuration_gps_dep.l2c_mask == 2808462402, "incorrect value for last_msg.msg.sv_configuration_gps_dep.l2c_mask, expected 2808462402, is %d", last_msg.msg.sv_configuration_gps_dep.l2c_mask); - - - ck_assert_msg(last_msg.msg.sv_configuration_gps_dep.t_nmct.tow == 0, "incorrect value for last_msg.msg.sv_configuration_gps_dep.t_nmct.tow, expected 0, is %d", last_msg.msg.sv_configuration_gps_dep.t_nmct.tow); - - ck_assert_msg(last_msg.msg.sv_configuration_gps_dep.t_nmct.wn == 0, "incorrect value for last_msg.msg.sv_configuration_gps_dep.t_nmct.wn, expected 0, is %d", last_msg.msg.sv_configuration_gps_dep.t_nmct.wn); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSvConfigurationGpsDep, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.sv_configuration_gps_dep.l2c_mask == 2808462402, + "incorrect value for last_msg.msg.sv_configuration_gps_dep.l2c_mask, " + "expected 2808462402, is %d", + last_msg.msg.sv_configuration_gps_dep.l2c_mask); + + ck_assert_msg( + last_msg.msg.sv_configuration_gps_dep.t_nmct.tow == 0, + "incorrect value for last_msg.msg.sv_configuration_gps_dep.t_nmct.tow, " + "expected 0, is %d", + last_msg.msg.sv_configuration_gps_dep.t_nmct.tow); + + ck_assert_msg( + last_msg.msg.sv_configuration_gps_dep.t_nmct.wn == 0, + "incorrect value for last_msg.msg.sv_configuration_gps_dep.t_nmct.wn, " + "expected 0, is %d", + last_msg.msg.sv_configuration_gps_dep.t_nmct.wn); } } END_TEST -Suite* auto_check_sbp_observation_MsgSvConfigurationGpsDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_MsgSvConfigurationGpsDep"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_MsgSvConfigurationGpsDep"); - tcase_add_test(tc_acq, test_auto_check_sbp_observation_MsgSvConfigurationGpsDep); +Suite *auto_check_sbp_observation_MsgSvConfigurationGpsDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_observation_MsgSvConfigurationGpsDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_MsgSvConfigurationGpsDep"); + tcase_add_test(tc_acq, + test_auto_check_sbp_observation_MsgSvConfigurationGpsDep); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/auto_check_sbp_observation_msgEphemerisDepB.c b/c/test/auto_check_sbp_observation_msgEphemerisDepB.c index cfd78e5e2..fbc74743a 100644 --- a/c/test/auto_check_sbp_observation_msgEphemerisDepB.c +++ b/c/test/auto_check_sbp_observation_msgEphemerisDepB.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisDepB.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_msgEphemerisDepB ) -{ +START_TEST(test_auto_check_sbp_observation_msgEphemerisDepB) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_msgEphemerisDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,148 +90,269 @@ START_TEST( test_auto_check_sbp_observation_msgEphemerisDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x46, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - - u8 encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,60,190,0,0,0,0,0,186,82,192,0,0,0,0,0,76,109,64,0,0,0,0,0,132,208,190,0,0,0,0,0,254,220,62,0,0,0,0,0,0,113,62,0,0,0,0,0,0,133,190,28,36,25,81,223,254,52,62,220,116,216,39,33,189,3,64,0,0,0,156,177,204,134,63,0,0,160,220,182,33,180,64,152,225,192,44,254,76,238,191,41,150,24,2,148,156,65,190,252,90,119,48,15,215,240,63,124,127,115,94,208,16,238,63,165,115,52,74,97,167,246,189,0,0,0,0,192,180,229,190,0,0,0,0,0,0,112,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,3,0,225,156, }; + sbp_callback_register(&sbp_state, 0x46, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + + u8 encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 60, 190, + 0, 0, 0, 0, 0, 186, 82, 192, 0, 0, 0, 0, 0, 76, + 109, 64, 0, 0, 0, 0, 0, 132, 208, 190, 0, 0, 0, 0, + 0, 254, 220, 62, 0, 0, 0, 0, 0, 0, 113, 62, 0, 0, + 0, 0, 0, 0, 133, 190, 28, 36, 25, 81, 223, 254, 52, 62, + 220, 116, 216, 39, 33, 189, 3, 64, 0, 0, 0, 156, 177, 204, + 134, 63, 0, 0, 160, 220, 182, 33, 180, 64, 152, 225, 192, 44, + 254, 76, 238, 191, 41, 150, 24, 2, 148, 156, 65, 190, 252, 90, + 119, 48, 15, 215, 240, 63, 124, 127, 115, 94, 208, 16, 238, 63, + 165, 115, 52, 74, 97, 167, 246, 189, 0, 0, 0, 0, 192, 180, + 229, 190, 0, 0, 0, 0, 0, 0, 112, 189, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, + 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, 3, 0, + 225, 156, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_dep_b.af0 = -1.035025343298912e-05; - + test_msg.ephemeris_dep_b.af1 = -9.094947017729282e-13; - + test_msg.ephemeris_dep_b.af2 = 0.0; - + test_msg.ephemeris_dep_b.c_ic = 6.332993507385254e-08; - + test_msg.ephemeris_dep_b.c_is = -1.564621925354004e-07; - + test_msg.ephemeris_dep_b.c_rc = 234.375; - + test_msg.ephemeris_dep_b.c_rs = -74.90625; - + test_msg.ephemeris_dep_b.c_uc = -3.937631845474243e-06; - + test_msg.ephemeris_dep_b.c_us = 6.9122761487960815e-06; - + test_msg.ephemeris_dep_b.dn = 4.8884179079418005e-09; - + test_msg.ephemeris_dep_b.ecc = 0.011132609914056957; - + test_msg.ephemeris_dep_b.healthy = 1; - + test_msg.ephemeris_dep_b.inc = 0.9395524830579087; - + test_msg.ephemeris_dep_b.inc_dot = -3.296565886629854e-10; - + test_msg.ephemeris_dep_b.iode = 0; - + test_msg.ephemeris_dep_b.m0 = 2.467348395627239; - + test_msg.ephemeris_dep_b.omega0 = -0.9468985437479658; - + test_msg.ephemeris_dep_b.omegadot = -8.201055892610478e-09; - + test_msg.ephemeris_dep_b.prn = 3; - + test_msg.ephemeris_dep_b.sqrta = 5153.714303970337; - + test_msg.ephemeris_dep_b.tgd = -6.51925802230835e-09; - + test_msg.ephemeris_dep_b.toc_tow = 410400.0; - + test_msg.ephemeris_dep_b.toc_wn = 1838; - + test_msg.ephemeris_dep_b.toe_tow = 410400.0; - + test_msg.ephemeris_dep_b.toe_wn = 1838; - + test_msg.ephemeris_dep_b.valid = 1; - + test_msg.ephemeris_dep_b.w = 1.0525047200405302; - sbp_message_send(&sbp_state, SbpMsgEphemerisDepB, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisDepB, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af0 * 100 - -1.0350253433e-05 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af0, expected -1.0350253433e-05, is %s", last_msg.msg.ephemeris_dep_b.af0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af1 * 100 - -9.09494701773e-13 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af1, expected -9.09494701773e-13, is %s", last_msg.msg.ephemeris_dep_b.af1); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af2 * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af2, expected 0.0, is %s", last_msg.msg.ephemeris_dep_b.af2); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_ic * 100 - 6.33299350739e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_ic, expected 6.33299350739e-08, is %s", last_msg.msg.ephemeris_dep_b.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_is * 100 - -1.56462192535e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_is, expected -1.56462192535e-07, is %s", last_msg.msg.ephemeris_dep_b.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_rc * 100 - 234.375 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_rc, expected 234.375, is %s", last_msg.msg.ephemeris_dep_b.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_rs * 100 - -74.90625 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_rs, expected -74.90625, is %s", last_msg.msg.ephemeris_dep_b.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_uc * 100 - -3.93763184547e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_uc, expected -3.93763184547e-06, is %s", last_msg.msg.ephemeris_dep_b.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_us * 100 - 6.9122761488e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_us, expected 6.9122761488e-06, is %s", last_msg.msg.ephemeris_dep_b.c_us); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.dn * 100 - 4.88841790794e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.dn, expected 4.88841790794e-09, is %s", last_msg.msg.ephemeris_dep_b.dn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.ecc * 100 - 0.0111326099141 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.ecc, expected 0.0111326099141, is %s", last_msg.msg.ephemeris_dep_b.ecc); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.healthy == 1, "incorrect value for last_msg.msg.ephemeris_dep_b.healthy, expected 1, is %d", last_msg.msg.ephemeris_dep_b.healthy); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc * 100 - 0.939552483058 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.inc, expected 0.939552483058, is %s", last_msg.msg.ephemeris_dep_b.inc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc_dot * 100 - -3.29656588663e-10 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.inc_dot, expected -3.29656588663e-10, is %s", last_msg.msg.ephemeris_dep_b.inc_dot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.iode == 0, "incorrect value for last_msg.msg.ephemeris_dep_b.iode, expected 0, is %d", last_msg.msg.ephemeris_dep_b.iode); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.m0 * 100 - 2.46734839563 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.m0, expected 2.46734839563, is %s", last_msg.msg.ephemeris_dep_b.m0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.omega0 * 100 - -0.946898543748 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.omega0, expected -0.946898543748, is %s", last_msg.msg.ephemeris_dep_b.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.omegadot * 100 - -8.20105589261e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.omegadot, expected -8.20105589261e-09, is %s", last_msg.msg.ephemeris_dep_b.omegadot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.prn == 3, "incorrect value for last_msg.msg.ephemeris_dep_b.prn, expected 3, is %d", last_msg.msg.ephemeris_dep_b.prn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.sqrta * 100 - 5153.71430397 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.sqrta, expected 5153.71430397, is %s", last_msg.msg.ephemeris_dep_b.sqrta); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.tgd * 100 - -6.51925802231e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.tgd, expected -6.51925802231e-09, is %s", last_msg.msg.ephemeris_dep_b.tgd); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.toc_tow * 100 - 410400.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.toc_tow, expected 410400.0, is %s", last_msg.msg.ephemeris_dep_b.toc_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.toc_wn == 1838, "incorrect value for last_msg.msg.ephemeris_dep_b.toc_wn, expected 1838, is %d", last_msg.msg.ephemeris_dep_b.toc_wn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.toe_tow * 100 - 410400.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.toe_tow, expected 410400.0, is %s", last_msg.msg.ephemeris_dep_b.toe_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.toe_wn == 1838, "incorrect value for last_msg.msg.ephemeris_dep_b.toe_wn, expected 1838, is %d", last_msg.msg.ephemeris_dep_b.toe_wn); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.valid == 1, "incorrect value for last_msg.msg.ephemeris_dep_b.valid, expected 1, is %d", last_msg.msg.ephemeris_dep_b.valid); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.w * 100 - 1.05250472004 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.w, expected 1.05250472004, is %s", last_msg.msg.ephemeris_dep_b.w); + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af0 * 100 - + -1.0350253433e-05 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af0, " + "expected -1.0350253433e-05, is %s", + last_msg.msg.ephemeris_dep_b.af0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af1 * 100 - + -9.09494701773e-13 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af1, " + "expected -9.09494701773e-13, is %s", + last_msg.msg.ephemeris_dep_b.af1); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af2, " + "expected 0.0, is %s", + last_msg.msg.ephemeris_dep_b.af2); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_ic * 100 - + 6.33299350739e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_ic, " + "expected 6.33299350739e-08, is %s", + last_msg.msg.ephemeris_dep_b.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_is * 100 - + -1.56462192535e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_is, " + "expected -1.56462192535e-07, is %s", + last_msg.msg.ephemeris_dep_b.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.c_rc * 100 - 234.375 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_rc, expected " + "234.375, is %s", + last_msg.msg.ephemeris_dep_b.c_rc); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.c_rs * 100 - -74.90625 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_rs, expected " + "-74.90625, is %s", + last_msg.msg.ephemeris_dep_b.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_uc * 100 - + -3.93763184547e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_uc, " + "expected -3.93763184547e-06, is %s", + last_msg.msg.ephemeris_dep_b.c_uc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_us * 100 - + 6.9122761488e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_us, " + "expected 6.9122761488e-06, is %s", + last_msg.msg.ephemeris_dep_b.c_us); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.dn * 100 - + 4.88841790794e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.dn, " + "expected 4.88841790794e-09, is %s", + last_msg.msg.ephemeris_dep_b.dn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.ecc * 100 - 0.0111326099141 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.ecc, expected " + "0.0111326099141, is %s", + last_msg.msg.ephemeris_dep_b.ecc); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.healthy == 1, + "incorrect value for last_msg.msg.ephemeris_dep_b.healthy, " + "expected 1, is %d", + last_msg.msg.ephemeris_dep_b.healthy); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.inc * 100 - 0.939552483058 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.inc, expected " + "0.939552483058, is %s", + last_msg.msg.ephemeris_dep_b.inc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc_dot * 100 - + -3.29656588663e-10 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.inc_dot, " + "expected -3.29656588663e-10, is %s", + last_msg.msg.ephemeris_dep_b.inc_dot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.iode == 0, + "incorrect value for last_msg.msg.ephemeris_dep_b.iode, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_b.iode); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.m0 * 100 - 2.46734839563 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.m0, expected " + "2.46734839563, is %s", + last_msg.msg.ephemeris_dep_b.m0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.omega0 * 100 - + -0.946898543748 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.omega0, " + "expected -0.946898543748, is %s", + last_msg.msg.ephemeris_dep_b.omega0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.omegadot * 100 - + -8.20105589261e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.omegadot, " + "expected -8.20105589261e-09, is %s", + last_msg.msg.ephemeris_dep_b.omegadot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.prn == 3, + "incorrect value for last_msg.msg.ephemeris_dep_b.prn, " + "expected 3, is %d", + last_msg.msg.ephemeris_dep_b.prn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.sqrta * 100 - 5153.71430397 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.sqrta, expected " + "5153.71430397, is %s", + last_msg.msg.ephemeris_dep_b.sqrta); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.tgd * 100 - + -6.51925802231e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.tgd, " + "expected -6.51925802231e-09, is %s", + last_msg.msg.ephemeris_dep_b.tgd); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.toc_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.toc_tow, expected " + "410400.0, is %s", + last_msg.msg.ephemeris_dep_b.toc_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.toc_wn == 1838, + "incorrect value for last_msg.msg.ephemeris_dep_b.toc_wn, " + "expected 1838, is %d", + last_msg.msg.ephemeris_dep_b.toc_wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.toe_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.toe_tow, expected " + "410400.0, is %s", + last_msg.msg.ephemeris_dep_b.toe_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.toe_wn == 1838, + "incorrect value for last_msg.msg.ephemeris_dep_b.toe_wn, " + "expected 1838, is %d", + last_msg.msg.ephemeris_dep_b.toe_wn); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.valid == 1, + "incorrect value for last_msg.msg.ephemeris_dep_b.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_dep_b.valid); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.w * 100 - 1.05250472004 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.w, expected " + "1.05250472004, is %s", + last_msg.msg.ephemeris_dep_b.w); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -243,148 +360,269 @@ START_TEST( test_auto_check_sbp_observation_msgEphemerisDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x46, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - - u8 encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,68,190,0,0,0,0,0,72,66,64,0,0,0,0,128,188,115,64,0,0,0,0,0,80,193,62,0,0,0,0,0,164,204,62,0,0,0,0,0,0,130,62,0,0,0,0,0,0,128,62,72,181,127,6,208,225,52,62,158,174,129,91,27,105,249,191,0,0,0,96,204,57,128,63,0,0,160,35,146,33,180,64,247,169,1,36,133,206,243,63,79,11,109,92,156,208,65,190,103,78,3,253,223,147,255,191,164,214,90,250,218,240,238,63,94,239,187,37,36,10,242,61,0,0,0,0,176,91,19,63,0,0,0,0,0,0,137,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,13,0,180,21, }; + sbp_callback_register(&sbp_state, 0x46, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + + u8 encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 68, 190, + 0, 0, 0, 0, 0, 72, 66, 64, 0, 0, 0, 0, 128, 188, + 115, 64, 0, 0, 0, 0, 0, 80, 193, 62, 0, 0, 0, 0, + 0, 164, 204, 62, 0, 0, 0, 0, 0, 0, 130, 62, 0, 0, + 0, 0, 0, 0, 128, 62, 72, 181, 127, 6, 208, 225, 52, 62, + 158, 174, 129, 91, 27, 105, 249, 191, 0, 0, 0, 96, 204, 57, + 128, 63, 0, 0, 160, 35, 146, 33, 180, 64, 247, 169, 1, 36, + 133, 206, 243, 63, 79, 11, 109, 92, 156, 208, 65, 190, 103, 78, + 3, 253, 223, 147, 255, 191, 164, 214, 90, 250, 218, 240, 238, 63, + 94, 239, 187, 37, 36, 10, 242, 61, 0, 0, 0, 0, 176, 91, + 19, 63, 0, 0, 0, 0, 0, 0, 137, 189, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, + 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, 13, 0, + 180, 21, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_dep_b.af0 = 7.384549826383591e-05; - + test_msg.ephemeris_dep_b.af1 = -2.8421709430404007e-12; - + test_msg.ephemeris_dep_b.af2 = 0.0; - + test_msg.ephemeris_dep_b.c_ic = 1.341104507446289e-07; - + test_msg.ephemeris_dep_b.c_is = 1.1920928955078125e-07; - + test_msg.ephemeris_dep_b.c_rc = 315.78125; - + test_msg.ephemeris_dep_b.c_rs = 36.5625; - + test_msg.ephemeris_dep_b.c_uc = 2.0638108253479004e-06; - + test_msg.ephemeris_dep_b.c_us = 3.4142285585403442e-06; - + test_msg.ephemeris_dep_b.dn = 4.86198823561129e-09; - + test_msg.ephemeris_dep_b.ecc = 0.007922741584479809; - + test_msg.ephemeris_dep_b.healthy = 1; - + test_msg.ephemeris_dep_b.inc = 0.9669012918227122; - + test_msg.ephemeris_dep_b.inc_dot = 2.6251093463412166e-10; - + test_msg.ephemeris_dep_b.iode = 0; - + test_msg.ephemeris_dep_b.m0 = -1.588160855720083; - + test_msg.ephemeris_dep_b.omega0 = 1.237919941568746; - + test_msg.ephemeris_dep_b.omegadot = -8.295702692172441e-09; - + test_msg.ephemeris_dep_b.prn = 13; - + test_msg.ephemeris_dep_b.sqrta = 5153.57085609436; - + test_msg.ephemeris_dep_b.tgd = -9.313225746154785e-09; - + test_msg.ephemeris_dep_b.toc_tow = 410400.0; - + test_msg.ephemeris_dep_b.toc_wn = 1838; - + test_msg.ephemeris_dep_b.toe_tow = 410400.0; - + test_msg.ephemeris_dep_b.toe_wn = 1838; - + test_msg.ephemeris_dep_b.valid = 1; - + test_msg.ephemeris_dep_b.w = -1.9736022837941165; - sbp_message_send(&sbp_state, SbpMsgEphemerisDepB, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisDepB, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af0 * 100 - 7.38454982638e-05 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af0, expected 7.38454982638e-05, is %s", last_msg.msg.ephemeris_dep_b.af0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af1 * 100 - -2.84217094304e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af1, expected -2.84217094304e-12, is %s", last_msg.msg.ephemeris_dep_b.af1); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af2 * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af2, expected 0.0, is %s", last_msg.msg.ephemeris_dep_b.af2); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_ic * 100 - 1.34110450745e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_ic, expected 1.34110450745e-07, is %s", last_msg.msg.ephemeris_dep_b.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_is * 100 - 1.19209289551e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_is, expected 1.19209289551e-07, is %s", last_msg.msg.ephemeris_dep_b.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_rc * 100 - 315.78125 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_rc, expected 315.78125, is %s", last_msg.msg.ephemeris_dep_b.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_rs * 100 - 36.5625 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_rs, expected 36.5625, is %s", last_msg.msg.ephemeris_dep_b.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_uc * 100 - 2.06381082535e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_uc, expected 2.06381082535e-06, is %s", last_msg.msg.ephemeris_dep_b.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_us * 100 - 3.41422855854e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_us, expected 3.41422855854e-06, is %s", last_msg.msg.ephemeris_dep_b.c_us); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.dn * 100 - 4.86198823561e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.dn, expected 4.86198823561e-09, is %s", last_msg.msg.ephemeris_dep_b.dn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.ecc * 100 - 0.00792274158448 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.ecc, expected 0.00792274158448, is %s", last_msg.msg.ephemeris_dep_b.ecc); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.healthy == 1, "incorrect value for last_msg.msg.ephemeris_dep_b.healthy, expected 1, is %d", last_msg.msg.ephemeris_dep_b.healthy); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc * 100 - 0.966901291823 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.inc, expected 0.966901291823, is %s", last_msg.msg.ephemeris_dep_b.inc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc_dot * 100 - 2.62510934634e-10 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.inc_dot, expected 2.62510934634e-10, is %s", last_msg.msg.ephemeris_dep_b.inc_dot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.iode == 0, "incorrect value for last_msg.msg.ephemeris_dep_b.iode, expected 0, is %d", last_msg.msg.ephemeris_dep_b.iode); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.m0 * 100 - -1.58816085572 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.m0, expected -1.58816085572, is %s", last_msg.msg.ephemeris_dep_b.m0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.omega0 * 100 - 1.23791994157 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.omega0, expected 1.23791994157, is %s", last_msg.msg.ephemeris_dep_b.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.omegadot * 100 - -8.29570269217e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.omegadot, expected -8.29570269217e-09, is %s", last_msg.msg.ephemeris_dep_b.omegadot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.prn == 13, "incorrect value for last_msg.msg.ephemeris_dep_b.prn, expected 13, is %d", last_msg.msg.ephemeris_dep_b.prn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.sqrta * 100 - 5153.57085609 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.sqrta, expected 5153.57085609, is %s", last_msg.msg.ephemeris_dep_b.sqrta); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.tgd * 100 - -9.31322574615e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.tgd, expected -9.31322574615e-09, is %s", last_msg.msg.ephemeris_dep_b.tgd); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.toc_tow * 100 - 410400.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.toc_tow, expected 410400.0, is %s", last_msg.msg.ephemeris_dep_b.toc_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.toc_wn == 1838, "incorrect value for last_msg.msg.ephemeris_dep_b.toc_wn, expected 1838, is %d", last_msg.msg.ephemeris_dep_b.toc_wn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.toe_tow * 100 - 410400.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.toe_tow, expected 410400.0, is %s", last_msg.msg.ephemeris_dep_b.toe_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.toe_wn == 1838, "incorrect value for last_msg.msg.ephemeris_dep_b.toe_wn, expected 1838, is %d", last_msg.msg.ephemeris_dep_b.toe_wn); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.valid == 1, "incorrect value for last_msg.msg.ephemeris_dep_b.valid, expected 1, is %d", last_msg.msg.ephemeris_dep_b.valid); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.w * 100 - -1.97360228379 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.w, expected -1.97360228379, is %s", last_msg.msg.ephemeris_dep_b.w); + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af0 * 100 - + 7.38454982638e-05 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af0, " + "expected 7.38454982638e-05, is %s", + last_msg.msg.ephemeris_dep_b.af0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af1 * 100 - + -2.84217094304e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af1, " + "expected -2.84217094304e-12, is %s", + last_msg.msg.ephemeris_dep_b.af1); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af2, " + "expected 0.0, is %s", + last_msg.msg.ephemeris_dep_b.af2); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_ic * 100 - + 1.34110450745e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_ic, " + "expected 1.34110450745e-07, is %s", + last_msg.msg.ephemeris_dep_b.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_is * 100 - + 1.19209289551e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_is, " + "expected 1.19209289551e-07, is %s", + last_msg.msg.ephemeris_dep_b.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.c_rc * 100 - 315.78125 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_rc, expected " + "315.78125, is %s", + last_msg.msg.ephemeris_dep_b.c_rc); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.c_rs * 100 - 36.5625 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_rs, expected " + "36.5625, is %s", + last_msg.msg.ephemeris_dep_b.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_uc * 100 - + 2.06381082535e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_uc, " + "expected 2.06381082535e-06, is %s", + last_msg.msg.ephemeris_dep_b.c_uc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_us * 100 - + 3.41422855854e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_us, " + "expected 3.41422855854e-06, is %s", + last_msg.msg.ephemeris_dep_b.c_us); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.dn * 100 - + 4.86198823561e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.dn, " + "expected 4.86198823561e-09, is %s", + last_msg.msg.ephemeris_dep_b.dn); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.ecc * 100 - + 0.00792274158448 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.ecc, " + "expected 0.00792274158448, is %s", + last_msg.msg.ephemeris_dep_b.ecc); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.healthy == 1, + "incorrect value for last_msg.msg.ephemeris_dep_b.healthy, " + "expected 1, is %d", + last_msg.msg.ephemeris_dep_b.healthy); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.inc * 100 - 0.966901291823 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.inc, expected " + "0.966901291823, is %s", + last_msg.msg.ephemeris_dep_b.inc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc_dot * 100 - + 2.62510934634e-10 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.inc_dot, " + "expected 2.62510934634e-10, is %s", + last_msg.msg.ephemeris_dep_b.inc_dot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.iode == 0, + "incorrect value for last_msg.msg.ephemeris_dep_b.iode, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_b.iode); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.m0 * 100 - -1.58816085572 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.m0, expected " + "-1.58816085572, is %s", + last_msg.msg.ephemeris_dep_b.m0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.omega0 * 100 - + 1.23791994157 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.omega0, " + "expected 1.23791994157, is %s", + last_msg.msg.ephemeris_dep_b.omega0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.omegadot * 100 - + -8.29570269217e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.omegadot, " + "expected -8.29570269217e-09, is %s", + last_msg.msg.ephemeris_dep_b.omegadot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.prn == 13, + "incorrect value for last_msg.msg.ephemeris_dep_b.prn, " + "expected 13, is %d", + last_msg.msg.ephemeris_dep_b.prn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.sqrta * 100 - 5153.57085609 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.sqrta, expected " + "5153.57085609, is %s", + last_msg.msg.ephemeris_dep_b.sqrta); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.tgd * 100 - + -9.31322574615e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.tgd, " + "expected -9.31322574615e-09, is %s", + last_msg.msg.ephemeris_dep_b.tgd); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.toc_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.toc_tow, expected " + "410400.0, is %s", + last_msg.msg.ephemeris_dep_b.toc_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.toc_wn == 1838, + "incorrect value for last_msg.msg.ephemeris_dep_b.toc_wn, " + "expected 1838, is %d", + last_msg.msg.ephemeris_dep_b.toc_wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.toe_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.toe_tow, expected " + "410400.0, is %s", + last_msg.msg.ephemeris_dep_b.toe_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.toe_wn == 1838, + "incorrect value for last_msg.msg.ephemeris_dep_b.toe_wn, " + "expected 1838, is %d", + last_msg.msg.ephemeris_dep_b.toe_wn); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.valid == 1, + "incorrect value for last_msg.msg.ephemeris_dep_b.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_dep_b.valid); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.w * 100 - -1.97360228379 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.w, expected " + "-1.97360228379, is %s", + last_msg.msg.ephemeris_dep_b.w); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -392,148 +630,269 @@ START_TEST( test_auto_check_sbp_observation_msgEphemerisDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x46, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - - u8 encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,56,62,0,0,0,0,0,40,81,192,0,0,0,0,0,129,109,64,0,0,0,0,0,28,205,190,0,0,0,0,0,76,223,62,0,0,0,0,0,0,105,190,0,0,0,0,0,0,92,190,134,161,223,255,243,43,51,62,146,176,113,142,234,164,5,64,0,0,0,56,175,140,112,63,0,0,192,90,171,33,180,64,36,38,237,255,200,160,237,191,204,92,63,154,49,91,65,190,125,94,251,132,52,61,216,63,2,139,28,27,231,199,238,63,124,183,4,180,194,30,247,189,0,0,0,0,0,104,222,190,0,0,0,0,0,0,96,61,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,0,0,222,152, }; + sbp_callback_register(&sbp_state, 0x46, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + + u8 encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 56, 62, + 0, 0, 0, 0, 0, 40, 81, 192, 0, 0, 0, 0, 0, 129, + 109, 64, 0, 0, 0, 0, 0, 28, 205, 190, 0, 0, 0, 0, + 0, 76, 223, 62, 0, 0, 0, 0, 0, 0, 105, 190, 0, 0, + 0, 0, 0, 0, 92, 190, 134, 161, 223, 255, 243, 43, 51, 62, + 146, 176, 113, 142, 234, 164, 5, 64, 0, 0, 0, 56, 175, 140, + 112, 63, 0, 0, 192, 90, 171, 33, 180, 64, 36, 38, 237, 255, + 200, 160, 237, 191, 204, 92, 63, 154, 49, 91, 65, 190, 125, 94, + 251, 132, 52, 61, 216, 63, 2, 139, 28, 27, 231, 199, 238, 63, + 124, 183, 4, 180, 194, 30, 247, 189, 0, 0, 0, 0, 0, 104, + 222, 190, 0, 0, 0, 0, 0, 0, 96, 61, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, + 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, 0, 0, + 222, 152, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_dep_b.af0 = -7.249414920806885e-06; - + test_msg.ephemeris_dep_b.af1 = 4.547473508864641e-13; - + test_msg.ephemeris_dep_b.af2 = 0.0; - + test_msg.ephemeris_dep_b.c_ic = -4.6566128730773926e-08; - + test_msg.ephemeris_dep_b.c_is = -2.60770320892334e-08; - + test_msg.ephemeris_dep_b.c_rc = 236.03125; - + test_msg.ephemeris_dep_b.c_rs = -68.625; - + test_msg.ephemeris_dep_b.c_uc = -3.470107913017273e-06; - + test_msg.ephemeris_dep_b.c_us = 7.461756467819214e-06; - + test_msg.ephemeris_dep_b.dn = 4.4637573619826565e-09; - + test_msg.ephemeris_dep_b.ecc = 0.004040417145006359; - + test_msg.ephemeris_dep_b.healthy = 1; - + test_msg.ephemeris_dep_b.inc = 0.9619021920701416; - + test_msg.ephemeris_dep_b.inc_dot = -3.3644258561271105e-10; - + test_msg.ephemeris_dep_b.iode = 0; - + test_msg.ephemeris_dep_b.m0 = 2.7055255058713295; - + test_msg.ephemeris_dep_b.omega0 = -0.9258770941316397; - + test_msg.ephemeris_dep_b.omegadot = -8.082122367123182e-09; - + test_msg.ephemeris_dep_b.prn = 0; - + test_msg.ephemeris_dep_b.sqrta = 5153.669353485107; - + test_msg.ephemeris_dep_b.tgd = 5.587935447692871e-09; - + test_msg.ephemeris_dep_b.toc_tow = 410400.0; - + test_msg.ephemeris_dep_b.toc_wn = 1838; - + test_msg.ephemeris_dep_b.toe_tow = 410400.0; - + test_msg.ephemeris_dep_b.toe_wn = 1838; - + test_msg.ephemeris_dep_b.valid = 1; - + test_msg.ephemeris_dep_b.w = 0.37873566614641857; - sbp_message_send(&sbp_state, SbpMsgEphemerisDepB, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisDepB, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af0 * 100 - -7.24941492081e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af0, expected -7.24941492081e-06, is %s", last_msg.msg.ephemeris_dep_b.af0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af1 * 100 - 4.54747350886e-13 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af1, expected 4.54747350886e-13, is %s", last_msg.msg.ephemeris_dep_b.af1); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af2 * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af2, expected 0.0, is %s", last_msg.msg.ephemeris_dep_b.af2); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_ic * 100 - -4.65661287308e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_ic, expected -4.65661287308e-08, is %s", last_msg.msg.ephemeris_dep_b.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_is * 100 - -2.60770320892e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_is, expected -2.60770320892e-08, is %s", last_msg.msg.ephemeris_dep_b.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_rc * 100 - 236.03125 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_rc, expected 236.03125, is %s", last_msg.msg.ephemeris_dep_b.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_rs * 100 - -68.625 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_rs, expected -68.625, is %s", last_msg.msg.ephemeris_dep_b.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_uc * 100 - -3.47010791302e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_uc, expected -3.47010791302e-06, is %s", last_msg.msg.ephemeris_dep_b.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_us * 100 - 7.46175646782e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_us, expected 7.46175646782e-06, is %s", last_msg.msg.ephemeris_dep_b.c_us); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.dn * 100 - 4.46375736198e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.dn, expected 4.46375736198e-09, is %s", last_msg.msg.ephemeris_dep_b.dn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.ecc * 100 - 0.00404041714501 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.ecc, expected 0.00404041714501, is %s", last_msg.msg.ephemeris_dep_b.ecc); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.healthy == 1, "incorrect value for last_msg.msg.ephemeris_dep_b.healthy, expected 1, is %d", last_msg.msg.ephemeris_dep_b.healthy); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc * 100 - 0.96190219207 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.inc, expected 0.96190219207, is %s", last_msg.msg.ephemeris_dep_b.inc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc_dot * 100 - -3.36442585613e-10 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.inc_dot, expected -3.36442585613e-10, is %s", last_msg.msg.ephemeris_dep_b.inc_dot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.iode == 0, "incorrect value for last_msg.msg.ephemeris_dep_b.iode, expected 0, is %d", last_msg.msg.ephemeris_dep_b.iode); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.m0 * 100 - 2.70552550587 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.m0, expected 2.70552550587, is %s", last_msg.msg.ephemeris_dep_b.m0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.omega0 * 100 - -0.925877094132 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.omega0, expected -0.925877094132, is %s", last_msg.msg.ephemeris_dep_b.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.omegadot * 100 - -8.08212236712e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.omegadot, expected -8.08212236712e-09, is %s", last_msg.msg.ephemeris_dep_b.omegadot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.prn == 0, "incorrect value for last_msg.msg.ephemeris_dep_b.prn, expected 0, is %d", last_msg.msg.ephemeris_dep_b.prn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.sqrta * 100 - 5153.66935349 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.sqrta, expected 5153.66935349, is %s", last_msg.msg.ephemeris_dep_b.sqrta); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.tgd * 100 - 5.58793544769e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.tgd, expected 5.58793544769e-09, is %s", last_msg.msg.ephemeris_dep_b.tgd); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.toc_tow * 100 - 410400.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.toc_tow, expected 410400.0, is %s", last_msg.msg.ephemeris_dep_b.toc_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.toc_wn == 1838, "incorrect value for last_msg.msg.ephemeris_dep_b.toc_wn, expected 1838, is %d", last_msg.msg.ephemeris_dep_b.toc_wn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.toe_tow * 100 - 410400.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.toe_tow, expected 410400.0, is %s", last_msg.msg.ephemeris_dep_b.toe_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.toe_wn == 1838, "incorrect value for last_msg.msg.ephemeris_dep_b.toe_wn, expected 1838, is %d", last_msg.msg.ephemeris_dep_b.toe_wn); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.valid == 1, "incorrect value for last_msg.msg.ephemeris_dep_b.valid, expected 1, is %d", last_msg.msg.ephemeris_dep_b.valid); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.w * 100 - 0.378735666146 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.w, expected 0.378735666146, is %s", last_msg.msg.ephemeris_dep_b.w); + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af0 * 100 - + -7.24941492081e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af0, " + "expected -7.24941492081e-06, is %s", + last_msg.msg.ephemeris_dep_b.af0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af1 * 100 - + 4.54747350886e-13 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af1, " + "expected 4.54747350886e-13, is %s", + last_msg.msg.ephemeris_dep_b.af1); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af2, " + "expected 0.0, is %s", + last_msg.msg.ephemeris_dep_b.af2); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_ic * 100 - + -4.65661287308e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_ic, " + "expected -4.65661287308e-08, is %s", + last_msg.msg.ephemeris_dep_b.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_is * 100 - + -2.60770320892e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_is, " + "expected -2.60770320892e-08, is %s", + last_msg.msg.ephemeris_dep_b.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.c_rc * 100 - 236.03125 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_rc, expected " + "236.03125, is %s", + last_msg.msg.ephemeris_dep_b.c_rc); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.c_rs * 100 - -68.625 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_rs, expected " + "-68.625, is %s", + last_msg.msg.ephemeris_dep_b.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_uc * 100 - + -3.47010791302e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_uc, " + "expected -3.47010791302e-06, is %s", + last_msg.msg.ephemeris_dep_b.c_uc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_us * 100 - + 7.46175646782e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_us, " + "expected 7.46175646782e-06, is %s", + last_msg.msg.ephemeris_dep_b.c_us); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.dn * 100 - + 4.46375736198e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.dn, " + "expected 4.46375736198e-09, is %s", + last_msg.msg.ephemeris_dep_b.dn); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.ecc * 100 - + 0.00404041714501 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.ecc, " + "expected 0.00404041714501, is %s", + last_msg.msg.ephemeris_dep_b.ecc); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.healthy == 1, + "incorrect value for last_msg.msg.ephemeris_dep_b.healthy, " + "expected 1, is %d", + last_msg.msg.ephemeris_dep_b.healthy); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.inc * 100 - 0.96190219207 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.inc, expected " + "0.96190219207, is %s", + last_msg.msg.ephemeris_dep_b.inc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc_dot * 100 - + -3.36442585613e-10 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.inc_dot, " + "expected -3.36442585613e-10, is %s", + last_msg.msg.ephemeris_dep_b.inc_dot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.iode == 0, + "incorrect value for last_msg.msg.ephemeris_dep_b.iode, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_b.iode); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.m0 * 100 - 2.70552550587 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.m0, expected " + "2.70552550587, is %s", + last_msg.msg.ephemeris_dep_b.m0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.omega0 * 100 - + -0.925877094132 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.omega0, " + "expected -0.925877094132, is %s", + last_msg.msg.ephemeris_dep_b.omega0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.omegadot * 100 - + -8.08212236712e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.omegadot, " + "expected -8.08212236712e-09, is %s", + last_msg.msg.ephemeris_dep_b.omegadot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.prn == 0, + "incorrect value for last_msg.msg.ephemeris_dep_b.prn, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_b.prn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.sqrta * 100 - 5153.66935349 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.sqrta, expected " + "5153.66935349, is %s", + last_msg.msg.ephemeris_dep_b.sqrta); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.tgd * 100 - + 5.58793544769e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.tgd, " + "expected 5.58793544769e-09, is %s", + last_msg.msg.ephemeris_dep_b.tgd); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.toc_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.toc_tow, expected " + "410400.0, is %s", + last_msg.msg.ephemeris_dep_b.toc_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.toc_wn == 1838, + "incorrect value for last_msg.msg.ephemeris_dep_b.toc_wn, " + "expected 1838, is %d", + last_msg.msg.ephemeris_dep_b.toc_wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.toe_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.toe_tow, expected " + "410400.0, is %s", + last_msg.msg.ephemeris_dep_b.toe_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.toe_wn == 1838, + "incorrect value for last_msg.msg.ephemeris_dep_b.toe_wn, " + "expected 1838, is %d", + last_msg.msg.ephemeris_dep_b.toe_wn); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.valid == 1, + "incorrect value for last_msg.msg.ephemeris_dep_b.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_dep_b.valid); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.w * 100 - 0.378735666146 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.w, expected " + "0.378735666146, is %s", + last_msg.msg.ephemeris_dep_b.w); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -541,148 +900,269 @@ START_TEST( test_auto_check_sbp_observation_msgEphemerisDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x46, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - - u8 encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,68,190,0,0,0,0,0,72,66,64,0,0,0,0,128,188,115,64,0,0,0,0,0,80,193,62,0,0,0,0,0,164,204,62,0,0,0,0,0,0,130,62,0,0,0,0,0,0,128,62,72,181,127,6,208,225,52,62,158,174,129,91,27,105,249,191,0,0,0,96,204,57,128,63,0,0,160,35,146,33,180,64,247,169,1,36,133,206,243,63,79,11,109,92,156,208,65,190,103,78,3,253,223,147,255,191,164,214,90,250,218,240,238,63,94,239,187,37,36,10,242,61,0,0,0,0,176,91,19,63,0,0,0,0,0,0,137,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,13,0,180,21, }; + sbp_callback_register(&sbp_state, 0x46, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + + u8 encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 68, 190, + 0, 0, 0, 0, 0, 72, 66, 64, 0, 0, 0, 0, 128, 188, + 115, 64, 0, 0, 0, 0, 0, 80, 193, 62, 0, 0, 0, 0, + 0, 164, 204, 62, 0, 0, 0, 0, 0, 0, 130, 62, 0, 0, + 0, 0, 0, 0, 128, 62, 72, 181, 127, 6, 208, 225, 52, 62, + 158, 174, 129, 91, 27, 105, 249, 191, 0, 0, 0, 96, 204, 57, + 128, 63, 0, 0, 160, 35, 146, 33, 180, 64, 247, 169, 1, 36, + 133, 206, 243, 63, 79, 11, 109, 92, 156, 208, 65, 190, 103, 78, + 3, 253, 223, 147, 255, 191, 164, 214, 90, 250, 218, 240, 238, 63, + 94, 239, 187, 37, 36, 10, 242, 61, 0, 0, 0, 0, 176, 91, + 19, 63, 0, 0, 0, 0, 0, 0, 137, 189, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, + 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, 13, 0, + 180, 21, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_dep_b.af0 = 7.384549826383591e-05; - + test_msg.ephemeris_dep_b.af1 = -2.8421709430404007e-12; - + test_msg.ephemeris_dep_b.af2 = 0.0; - + test_msg.ephemeris_dep_b.c_ic = 1.341104507446289e-07; - + test_msg.ephemeris_dep_b.c_is = 1.1920928955078125e-07; - + test_msg.ephemeris_dep_b.c_rc = 315.78125; - + test_msg.ephemeris_dep_b.c_rs = 36.5625; - + test_msg.ephemeris_dep_b.c_uc = 2.0638108253479004e-06; - + test_msg.ephemeris_dep_b.c_us = 3.4142285585403442e-06; - + test_msg.ephemeris_dep_b.dn = 4.86198823561129e-09; - + test_msg.ephemeris_dep_b.ecc = 0.007922741584479809; - + test_msg.ephemeris_dep_b.healthy = 1; - + test_msg.ephemeris_dep_b.inc = 0.9669012918227122; - + test_msg.ephemeris_dep_b.inc_dot = 2.6251093463412166e-10; - + test_msg.ephemeris_dep_b.iode = 0; - + test_msg.ephemeris_dep_b.m0 = -1.588160855720083; - + test_msg.ephemeris_dep_b.omega0 = 1.237919941568746; - + test_msg.ephemeris_dep_b.omegadot = -8.295702692172441e-09; - + test_msg.ephemeris_dep_b.prn = 13; - + test_msg.ephemeris_dep_b.sqrta = 5153.57085609436; - + test_msg.ephemeris_dep_b.tgd = -9.313225746154785e-09; - + test_msg.ephemeris_dep_b.toc_tow = 410400.0; - + test_msg.ephemeris_dep_b.toc_wn = 1838; - + test_msg.ephemeris_dep_b.toe_tow = 410400.0; - + test_msg.ephemeris_dep_b.toe_wn = 1838; - + test_msg.ephemeris_dep_b.valid = 1; - + test_msg.ephemeris_dep_b.w = -1.9736022837941165; - sbp_message_send(&sbp_state, SbpMsgEphemerisDepB, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisDepB, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af0 * 100 - 7.38454982638e-05 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af0, expected 7.38454982638e-05, is %s", last_msg.msg.ephemeris_dep_b.af0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af1 * 100 - -2.84217094304e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af1, expected -2.84217094304e-12, is %s", last_msg.msg.ephemeris_dep_b.af1); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af2 * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af2, expected 0.0, is %s", last_msg.msg.ephemeris_dep_b.af2); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_ic * 100 - 1.34110450745e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_ic, expected 1.34110450745e-07, is %s", last_msg.msg.ephemeris_dep_b.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_is * 100 - 1.19209289551e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_is, expected 1.19209289551e-07, is %s", last_msg.msg.ephemeris_dep_b.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_rc * 100 - 315.78125 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_rc, expected 315.78125, is %s", last_msg.msg.ephemeris_dep_b.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_rs * 100 - 36.5625 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_rs, expected 36.5625, is %s", last_msg.msg.ephemeris_dep_b.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_uc * 100 - 2.06381082535e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_uc, expected 2.06381082535e-06, is %s", last_msg.msg.ephemeris_dep_b.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_us * 100 - 3.41422855854e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_us, expected 3.41422855854e-06, is %s", last_msg.msg.ephemeris_dep_b.c_us); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.dn * 100 - 4.86198823561e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.dn, expected 4.86198823561e-09, is %s", last_msg.msg.ephemeris_dep_b.dn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.ecc * 100 - 0.00792274158448 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.ecc, expected 0.00792274158448, is %s", last_msg.msg.ephemeris_dep_b.ecc); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.healthy == 1, "incorrect value for last_msg.msg.ephemeris_dep_b.healthy, expected 1, is %d", last_msg.msg.ephemeris_dep_b.healthy); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc * 100 - 0.966901291823 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.inc, expected 0.966901291823, is %s", last_msg.msg.ephemeris_dep_b.inc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc_dot * 100 - 2.62510934634e-10 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.inc_dot, expected 2.62510934634e-10, is %s", last_msg.msg.ephemeris_dep_b.inc_dot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.iode == 0, "incorrect value for last_msg.msg.ephemeris_dep_b.iode, expected 0, is %d", last_msg.msg.ephemeris_dep_b.iode); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.m0 * 100 - -1.58816085572 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.m0, expected -1.58816085572, is %s", last_msg.msg.ephemeris_dep_b.m0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.omega0 * 100 - 1.23791994157 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.omega0, expected 1.23791994157, is %s", last_msg.msg.ephemeris_dep_b.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.omegadot * 100 - -8.29570269217e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.omegadot, expected -8.29570269217e-09, is %s", last_msg.msg.ephemeris_dep_b.omegadot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.prn == 13, "incorrect value for last_msg.msg.ephemeris_dep_b.prn, expected 13, is %d", last_msg.msg.ephemeris_dep_b.prn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.sqrta * 100 - 5153.57085609 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.sqrta, expected 5153.57085609, is %s", last_msg.msg.ephemeris_dep_b.sqrta); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.tgd * 100 - -9.31322574615e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.tgd, expected -9.31322574615e-09, is %s", last_msg.msg.ephemeris_dep_b.tgd); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.toc_tow * 100 - 410400.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.toc_tow, expected 410400.0, is %s", last_msg.msg.ephemeris_dep_b.toc_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.toc_wn == 1838, "incorrect value for last_msg.msg.ephemeris_dep_b.toc_wn, expected 1838, is %d", last_msg.msg.ephemeris_dep_b.toc_wn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.toe_tow * 100 - 410400.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.toe_tow, expected 410400.0, is %s", last_msg.msg.ephemeris_dep_b.toe_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.toe_wn == 1838, "incorrect value for last_msg.msg.ephemeris_dep_b.toe_wn, expected 1838, is %d", last_msg.msg.ephemeris_dep_b.toe_wn); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.valid == 1, "incorrect value for last_msg.msg.ephemeris_dep_b.valid, expected 1, is %d", last_msg.msg.ephemeris_dep_b.valid); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.w * 100 - -1.97360228379 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.w, expected -1.97360228379, is %s", last_msg.msg.ephemeris_dep_b.w); + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af0 * 100 - + 7.38454982638e-05 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af0, " + "expected 7.38454982638e-05, is %s", + last_msg.msg.ephemeris_dep_b.af0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af1 * 100 - + -2.84217094304e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af1, " + "expected -2.84217094304e-12, is %s", + last_msg.msg.ephemeris_dep_b.af1); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af2, " + "expected 0.0, is %s", + last_msg.msg.ephemeris_dep_b.af2); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_ic * 100 - + 1.34110450745e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_ic, " + "expected 1.34110450745e-07, is %s", + last_msg.msg.ephemeris_dep_b.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_is * 100 - + 1.19209289551e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_is, " + "expected 1.19209289551e-07, is %s", + last_msg.msg.ephemeris_dep_b.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.c_rc * 100 - 315.78125 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_rc, expected " + "315.78125, is %s", + last_msg.msg.ephemeris_dep_b.c_rc); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.c_rs * 100 - 36.5625 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_rs, expected " + "36.5625, is %s", + last_msg.msg.ephemeris_dep_b.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_uc * 100 - + 2.06381082535e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_uc, " + "expected 2.06381082535e-06, is %s", + last_msg.msg.ephemeris_dep_b.c_uc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_us * 100 - + 3.41422855854e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_us, " + "expected 3.41422855854e-06, is %s", + last_msg.msg.ephemeris_dep_b.c_us); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.dn * 100 - + 4.86198823561e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.dn, " + "expected 4.86198823561e-09, is %s", + last_msg.msg.ephemeris_dep_b.dn); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.ecc * 100 - + 0.00792274158448 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.ecc, " + "expected 0.00792274158448, is %s", + last_msg.msg.ephemeris_dep_b.ecc); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.healthy == 1, + "incorrect value for last_msg.msg.ephemeris_dep_b.healthy, " + "expected 1, is %d", + last_msg.msg.ephemeris_dep_b.healthy); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.inc * 100 - 0.966901291823 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.inc, expected " + "0.966901291823, is %s", + last_msg.msg.ephemeris_dep_b.inc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc_dot * 100 - + 2.62510934634e-10 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.inc_dot, " + "expected 2.62510934634e-10, is %s", + last_msg.msg.ephemeris_dep_b.inc_dot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.iode == 0, + "incorrect value for last_msg.msg.ephemeris_dep_b.iode, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_b.iode); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.m0 * 100 - -1.58816085572 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.m0, expected " + "-1.58816085572, is %s", + last_msg.msg.ephemeris_dep_b.m0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.omega0 * 100 - + 1.23791994157 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.omega0, " + "expected 1.23791994157, is %s", + last_msg.msg.ephemeris_dep_b.omega0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.omegadot * 100 - + -8.29570269217e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.omegadot, " + "expected -8.29570269217e-09, is %s", + last_msg.msg.ephemeris_dep_b.omegadot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.prn == 13, + "incorrect value for last_msg.msg.ephemeris_dep_b.prn, " + "expected 13, is %d", + last_msg.msg.ephemeris_dep_b.prn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.sqrta * 100 - 5153.57085609 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.sqrta, expected " + "5153.57085609, is %s", + last_msg.msg.ephemeris_dep_b.sqrta); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.tgd * 100 - + -9.31322574615e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.tgd, " + "expected -9.31322574615e-09, is %s", + last_msg.msg.ephemeris_dep_b.tgd); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.toc_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.toc_tow, expected " + "410400.0, is %s", + last_msg.msg.ephemeris_dep_b.toc_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.toc_wn == 1838, + "incorrect value for last_msg.msg.ephemeris_dep_b.toc_wn, " + "expected 1838, is %d", + last_msg.msg.ephemeris_dep_b.toc_wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.toe_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.toe_tow, expected " + "410400.0, is %s", + last_msg.msg.ephemeris_dep_b.toe_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.toe_wn == 1838, + "incorrect value for last_msg.msg.ephemeris_dep_b.toe_wn, " + "expected 1838, is %d", + last_msg.msg.ephemeris_dep_b.toe_wn); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.valid == 1, + "incorrect value for last_msg.msg.ephemeris_dep_b.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_dep_b.valid); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.w * 100 - -1.97360228379 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.w, expected " + "-1.97360228379, is %s", + last_msg.msg.ephemeris_dep_b.w); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -690,148 +1170,269 @@ START_TEST( test_auto_check_sbp_observation_msgEphemerisDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x46, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - - u8 encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,128,85,190,0,0,0,0,0,156,69,64,0,0,0,0,128,19,115,64,0,0,0,0,0,160,193,62,0,0,0,0,0,152,207,62,0,0,0,0,0,0,97,190,0,0,0,0,0,192,139,190,26,26,13,149,16,152,54,62,104,7,46,214,75,84,5,192,0,0,0,128,230,82,132,63,0,0,160,252,162,33,180,64,73,6,130,54,217,171,242,63,81,224,163,123,238,42,66,190,206,43,141,67,243,157,5,192,113,179,153,187,43,92,238,63,254,236,31,43,224,157,244,61,0,0,0,0,232,4,26,191,0,0,0,0,0,0,134,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,22,0,99,61, }; + sbp_callback_register(&sbp_state, 0x46, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + + u8 encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 128, 85, 190, + 0, 0, 0, 0, 0, 156, 69, 64, 0, 0, 0, 0, 128, 19, + 115, 64, 0, 0, 0, 0, 0, 160, 193, 62, 0, 0, 0, 0, + 0, 152, 207, 62, 0, 0, 0, 0, 0, 0, 97, 190, 0, 0, + 0, 0, 0, 192, 139, 190, 26, 26, 13, 149, 16, 152, 54, 62, + 104, 7, 46, 214, 75, 84, 5, 192, 0, 0, 0, 128, 230, 82, + 132, 63, 0, 0, 160, 252, 162, 33, 180, 64, 73, 6, 130, 54, + 217, 171, 242, 63, 81, 224, 163, 123, 238, 42, 66, 190, 206, 43, + 141, 67, 243, 157, 5, 192, 113, 179, 153, 187, 43, 92, 238, 63, + 254, 236, 31, 43, 224, 157, 244, 61, 0, 0, 0, 0, 232, 4, + 26, 191, 0, 0, 0, 0, 0, 0, 134, 189, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, + 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, 22, 0, + 99, 61, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_dep_b.af0 = -9.925523772835732e-05; - + test_msg.ephemeris_dep_b.af1 = -2.5011104298755527e-12; - + test_msg.ephemeris_dep_b.af2 = 0.0; - + test_msg.ephemeris_dep_b.c_ic = -3.166496753692627e-08; - + test_msg.ephemeris_dep_b.c_is = -2.0675361156463623e-07; - + test_msg.ephemeris_dep_b.c_rc = 305.21875; - + test_msg.ephemeris_dep_b.c_rs = 43.21875; - + test_msg.ephemeris_dep_b.c_uc = 2.1010637283325195e-06; - + test_msg.ephemeris_dep_b.c_us = 3.766268491744995e-06; - + test_msg.ephemeris_dep_b.dn = 5.26057626697412e-09; - + test_msg.ephemeris_dep_b.ecc = 0.009923744946718216; - + test_msg.ephemeris_dep_b.healthy = 1; - + test_msg.ephemeris_dep_b.inc = 0.9487513221807672; - + test_msg.ephemeris_dep_b.inc_dot = 3.000124967247105e-10; - + test_msg.ephemeris_dep_b.iode = 0; - + test_msg.ephemeris_dep_b.m0 = -2.666160271911327; - + test_msg.ephemeris_dep_b.omega0 = 1.1669551972594425; - + test_msg.ephemeris_dep_b.omegadot = -8.45999524990264e-09; - + test_msg.ephemeris_dep_b.prn = 22; - + test_msg.ephemeris_dep_b.sqrta = 5153.636667251587; - + test_msg.ephemeris_dep_b.tgd = -2.0023435354232788e-08; - + test_msg.ephemeris_dep_b.toc_tow = 410400.0; - + test_msg.ephemeris_dep_b.toc_wn = 1838; - + test_msg.ephemeris_dep_b.toe_tow = 410400.0; - + test_msg.ephemeris_dep_b.toe_wn = 1838; - + test_msg.ephemeris_dep_b.valid = 1; - + test_msg.ephemeris_dep_b.w = -2.7021241452652935; - sbp_message_send(&sbp_state, SbpMsgEphemerisDepB, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisDepB, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af0 * 100 - -9.92552377284e-05 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af0, expected -9.92552377284e-05, is %s", last_msg.msg.ephemeris_dep_b.af0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af1 * 100 - -2.50111042988e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af1, expected -2.50111042988e-12, is %s", last_msg.msg.ephemeris_dep_b.af1); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af2 * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af2, expected 0.0, is %s", last_msg.msg.ephemeris_dep_b.af2); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_ic * 100 - -3.16649675369e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_ic, expected -3.16649675369e-08, is %s", last_msg.msg.ephemeris_dep_b.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_is * 100 - -2.06753611565e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_is, expected -2.06753611565e-07, is %s", last_msg.msg.ephemeris_dep_b.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_rc * 100 - 305.21875 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_rc, expected 305.21875, is %s", last_msg.msg.ephemeris_dep_b.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_rs * 100 - 43.21875 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_rs, expected 43.21875, is %s", last_msg.msg.ephemeris_dep_b.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_uc * 100 - 2.10106372833e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_uc, expected 2.10106372833e-06, is %s", last_msg.msg.ephemeris_dep_b.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_us * 100 - 3.76626849174e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_us, expected 3.76626849174e-06, is %s", last_msg.msg.ephemeris_dep_b.c_us); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.dn * 100 - 5.26057626697e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.dn, expected 5.26057626697e-09, is %s", last_msg.msg.ephemeris_dep_b.dn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.ecc * 100 - 0.00992374494672 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.ecc, expected 0.00992374494672, is %s", last_msg.msg.ephemeris_dep_b.ecc); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.healthy == 1, "incorrect value for last_msg.msg.ephemeris_dep_b.healthy, expected 1, is %d", last_msg.msg.ephemeris_dep_b.healthy); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc * 100 - 0.948751322181 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.inc, expected 0.948751322181, is %s", last_msg.msg.ephemeris_dep_b.inc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc_dot * 100 - 3.00012496725e-10 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.inc_dot, expected 3.00012496725e-10, is %s", last_msg.msg.ephemeris_dep_b.inc_dot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.iode == 0, "incorrect value for last_msg.msg.ephemeris_dep_b.iode, expected 0, is %d", last_msg.msg.ephemeris_dep_b.iode); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.m0 * 100 - -2.66616027191 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.m0, expected -2.66616027191, is %s", last_msg.msg.ephemeris_dep_b.m0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.omega0 * 100 - 1.16695519726 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.omega0, expected 1.16695519726, is %s", last_msg.msg.ephemeris_dep_b.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.omegadot * 100 - -8.4599952499e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.omegadot, expected -8.4599952499e-09, is %s", last_msg.msg.ephemeris_dep_b.omegadot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.prn == 22, "incorrect value for last_msg.msg.ephemeris_dep_b.prn, expected 22, is %d", last_msg.msg.ephemeris_dep_b.prn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.sqrta * 100 - 5153.63666725 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.sqrta, expected 5153.63666725, is %s", last_msg.msg.ephemeris_dep_b.sqrta); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.tgd * 100 - -2.00234353542e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.tgd, expected -2.00234353542e-08, is %s", last_msg.msg.ephemeris_dep_b.tgd); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.toc_tow * 100 - 410400.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.toc_tow, expected 410400.0, is %s", last_msg.msg.ephemeris_dep_b.toc_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.toc_wn == 1838, "incorrect value for last_msg.msg.ephemeris_dep_b.toc_wn, expected 1838, is %d", last_msg.msg.ephemeris_dep_b.toc_wn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.toe_tow * 100 - 410400.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.toe_tow, expected 410400.0, is %s", last_msg.msg.ephemeris_dep_b.toe_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.toe_wn == 1838, "incorrect value for last_msg.msg.ephemeris_dep_b.toe_wn, expected 1838, is %d", last_msg.msg.ephemeris_dep_b.toe_wn); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.valid == 1, "incorrect value for last_msg.msg.ephemeris_dep_b.valid, expected 1, is %d", last_msg.msg.ephemeris_dep_b.valid); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.w * 100 - -2.70212414527 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.w, expected -2.70212414527, is %s", last_msg.msg.ephemeris_dep_b.w); + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af0 * 100 - + -9.92552377284e-05 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af0, " + "expected -9.92552377284e-05, is %s", + last_msg.msg.ephemeris_dep_b.af0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af1 * 100 - + -2.50111042988e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af1, " + "expected -2.50111042988e-12, is %s", + last_msg.msg.ephemeris_dep_b.af1); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af2, " + "expected 0.0, is %s", + last_msg.msg.ephemeris_dep_b.af2); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_ic * 100 - + -3.16649675369e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_ic, " + "expected -3.16649675369e-08, is %s", + last_msg.msg.ephemeris_dep_b.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_is * 100 - + -2.06753611565e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_is, " + "expected -2.06753611565e-07, is %s", + last_msg.msg.ephemeris_dep_b.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.c_rc * 100 - 305.21875 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_rc, expected " + "305.21875, is %s", + last_msg.msg.ephemeris_dep_b.c_rc); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.c_rs * 100 - 43.21875 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_rs, expected " + "43.21875, is %s", + last_msg.msg.ephemeris_dep_b.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_uc * 100 - + 2.10106372833e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_uc, " + "expected 2.10106372833e-06, is %s", + last_msg.msg.ephemeris_dep_b.c_uc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_us * 100 - + 3.76626849174e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_us, " + "expected 3.76626849174e-06, is %s", + last_msg.msg.ephemeris_dep_b.c_us); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.dn * 100 - + 5.26057626697e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.dn, " + "expected 5.26057626697e-09, is %s", + last_msg.msg.ephemeris_dep_b.dn); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.ecc * 100 - + 0.00992374494672 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.ecc, " + "expected 0.00992374494672, is %s", + last_msg.msg.ephemeris_dep_b.ecc); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.healthy == 1, + "incorrect value for last_msg.msg.ephemeris_dep_b.healthy, " + "expected 1, is %d", + last_msg.msg.ephemeris_dep_b.healthy); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.inc * 100 - 0.948751322181 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.inc, expected " + "0.948751322181, is %s", + last_msg.msg.ephemeris_dep_b.inc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc_dot * 100 - + 3.00012496725e-10 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.inc_dot, " + "expected 3.00012496725e-10, is %s", + last_msg.msg.ephemeris_dep_b.inc_dot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.iode == 0, + "incorrect value for last_msg.msg.ephemeris_dep_b.iode, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_b.iode); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.m0 * 100 - -2.66616027191 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.m0, expected " + "-2.66616027191, is %s", + last_msg.msg.ephemeris_dep_b.m0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.omega0 * 100 - + 1.16695519726 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.omega0, " + "expected 1.16695519726, is %s", + last_msg.msg.ephemeris_dep_b.omega0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.omegadot * 100 - + -8.4599952499e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.omegadot, " + "expected -8.4599952499e-09, is %s", + last_msg.msg.ephemeris_dep_b.omegadot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.prn == 22, + "incorrect value for last_msg.msg.ephemeris_dep_b.prn, " + "expected 22, is %d", + last_msg.msg.ephemeris_dep_b.prn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.sqrta * 100 - 5153.63666725 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.sqrta, expected " + "5153.63666725, is %s", + last_msg.msg.ephemeris_dep_b.sqrta); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.tgd * 100 - + -2.00234353542e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.tgd, " + "expected -2.00234353542e-08, is %s", + last_msg.msg.ephemeris_dep_b.tgd); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.toc_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.toc_tow, expected " + "410400.0, is %s", + last_msg.msg.ephemeris_dep_b.toc_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.toc_wn == 1838, + "incorrect value for last_msg.msg.ephemeris_dep_b.toc_wn, " + "expected 1838, is %d", + last_msg.msg.ephemeris_dep_b.toc_wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.toe_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.toe_tow, expected " + "410400.0, is %s", + last_msg.msg.ephemeris_dep_b.toe_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.toe_wn == 1838, + "incorrect value for last_msg.msg.ephemeris_dep_b.toe_wn, " + "expected 1838, is %d", + last_msg.msg.ephemeris_dep_b.toe_wn); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.valid == 1, + "incorrect value for last_msg.msg.ephemeris_dep_b.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_dep_b.valid); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.w * 100 - -2.70212414527 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.w, expected " + "-2.70212414527, is %s", + last_msg.msg.ephemeris_dep_b.w); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -839,151 +1440,272 @@ START_TEST( test_auto_check_sbp_observation_msgEphemerisDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x46, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - - u8 encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,77,190,0,0,0,0,0,122,83,192,0,0,0,0,0,233,110,64,0,0,0,0,0,60,207,190,0,0,0,0,0,28,222,62,0,0,0,0,0,128,120,62,0,0,0,0,0,0,108,62,10,230,183,140,214,230,50,62,54,86,196,164,252,10,255,63,0,0,0,36,247,191,128,63,0,0,160,5,193,33,180,64,186,138,81,129,88,239,1,64,94,210,120,170,106,25,65,190,103,213,32,155,227,194,224,191,156,47,104,93,101,55,239,63,196,83,100,254,51,54,4,190,0,0,0,0,50,242,52,63,0,0,0,0,0,0,114,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,30,0,170,33, }; + sbp_callback_register(&sbp_state, 0x46, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + + u8 encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 77, 190, + 0, 0, 0, 0, 0, 122, 83, 192, 0, 0, 0, 0, 0, 233, + 110, 64, 0, 0, 0, 0, 0, 60, 207, 190, 0, 0, 0, 0, + 0, 28, 222, 62, 0, 0, 0, 0, 0, 128, 120, 62, 0, 0, + 0, 0, 0, 0, 108, 62, 10, 230, 183, 140, 214, 230, 50, 62, + 54, 86, 196, 164, 252, 10, 255, 63, 0, 0, 0, 36, 247, 191, + 128, 63, 0, 0, 160, 5, 193, 33, 180, 64, 186, 138, 81, 129, + 88, 239, 1, 64, 94, 210, 120, 170, 106, 25, 65, 190, 103, 213, + 32, 155, 227, 194, 224, 191, 156, 47, 104, 93, 101, 55, 239, 63, + 196, 83, 100, 254, 51, 54, 4, 190, 0, 0, 0, 0, 50, 242, + 52, 63, 0, 0, 0, 0, 0, 0, 114, 189, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, + 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, 30, 0, + 170, 33, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_dep_b.af0 = 0.0003196117468178272; - + test_msg.ephemeris_dep_b.af1 = -1.0231815394945443e-12; - + test_msg.ephemeris_dep_b.af2 = 0.0; - + test_msg.ephemeris_dep_b.c_ic = 9.12696123123169e-08; - + test_msg.ephemeris_dep_b.c_is = 5.21540641784668e-08; - + test_msg.ephemeris_dep_b.c_rc = 247.28125; - + test_msg.ephemeris_dep_b.c_rs = -77.90625; - + test_msg.ephemeris_dep_b.c_uc = -3.723427653312683e-06; - + test_msg.ephemeris_dep_b.c_us = 7.178634405136108e-06; - + test_msg.ephemeris_dep_b.dn = 4.400897600764146e-09; - + test_msg.ephemeris_dep_b.ecc = 0.008178644930012524; - + test_msg.ephemeris_dep_b.healthy = 1; - + test_msg.ephemeris_dep_b.inc = 0.9755122017245301; - + test_msg.ephemeris_dep_b.inc_dot = -5.882387882209502e-10; - + test_msg.ephemeris_dep_b.iode = 0; - + test_msg.ephemeris_dep_b.m0 = 1.9401823459824192; - + test_msg.ephemeris_dep_b.omega0 = 2.241868028927766; - + test_msg.ephemeris_dep_b.omegadot = -7.962474526167494e-09; - + test_msg.ephemeris_dep_b.prn = 30; - + test_msg.ephemeris_dep_b.sqrta = 5153.7539920806885; - + test_msg.ephemeris_dep_b.tgd = -1.3504177331924438e-08; - + test_msg.ephemeris_dep_b.toc_tow = 410400.0; - + test_msg.ephemeris_dep_b.toc_wn = 1838; - + test_msg.ephemeris_dep_b.toe_tow = 410400.0; - + test_msg.ephemeris_dep_b.toe_wn = 1838; - + test_msg.ephemeris_dep_b.valid = 1; - + test_msg.ephemeris_dep_b.w = -0.5237901716088061; - sbp_message_send(&sbp_state, SbpMsgEphemerisDepB, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisDepB, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af0 * 100 - 0.000319611746818 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af0, expected 0.000319611746818, is %s", last_msg.msg.ephemeris_dep_b.af0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af1 * 100 - -1.02318153949e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af1, expected -1.02318153949e-12, is %s", last_msg.msg.ephemeris_dep_b.af1); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.af2 * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.af2, expected 0.0, is %s", last_msg.msg.ephemeris_dep_b.af2); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_ic * 100 - 9.12696123123e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_ic, expected 9.12696123123e-08, is %s", last_msg.msg.ephemeris_dep_b.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_is * 100 - 5.21540641785e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_is, expected 5.21540641785e-08, is %s", last_msg.msg.ephemeris_dep_b.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_rc * 100 - 247.28125 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_rc, expected 247.28125, is %s", last_msg.msg.ephemeris_dep_b.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_rs * 100 - -77.90625 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_rs, expected -77.90625, is %s", last_msg.msg.ephemeris_dep_b.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_uc * 100 - -3.72342765331e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_uc, expected -3.72342765331e-06, is %s", last_msg.msg.ephemeris_dep_b.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_us * 100 - 7.17863440514e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.c_us, expected 7.17863440514e-06, is %s", last_msg.msg.ephemeris_dep_b.c_us); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.dn * 100 - 4.40089760076e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.dn, expected 4.40089760076e-09, is %s", last_msg.msg.ephemeris_dep_b.dn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.ecc * 100 - 0.00817864493001 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.ecc, expected 0.00817864493001, is %s", last_msg.msg.ephemeris_dep_b.ecc); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.healthy == 1, "incorrect value for last_msg.msg.ephemeris_dep_b.healthy, expected 1, is %d", last_msg.msg.ephemeris_dep_b.healthy); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc * 100 - 0.975512201725 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.inc, expected 0.975512201725, is %s", last_msg.msg.ephemeris_dep_b.inc); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc_dot * 100 - -5.88238788221e-10 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.inc_dot, expected -5.88238788221e-10, is %s", last_msg.msg.ephemeris_dep_b.inc_dot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.iode == 0, "incorrect value for last_msg.msg.ephemeris_dep_b.iode, expected 0, is %d", last_msg.msg.ephemeris_dep_b.iode); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.m0 * 100 - 1.94018234598 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.m0, expected 1.94018234598, is %s", last_msg.msg.ephemeris_dep_b.m0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.omega0 * 100 - 2.24186802893 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.omega0, expected 2.24186802893, is %s", last_msg.msg.ephemeris_dep_b.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.omegadot * 100 - -7.96247452617e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.omegadot, expected -7.96247452617e-09, is %s", last_msg.msg.ephemeris_dep_b.omegadot); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.prn == 30, "incorrect value for last_msg.msg.ephemeris_dep_b.prn, expected 30, is %d", last_msg.msg.ephemeris_dep_b.prn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.sqrta * 100 - 5153.75399208 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.sqrta, expected 5153.75399208, is %s", last_msg.msg.ephemeris_dep_b.sqrta); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.tgd * 100 - -1.35041773319e-08 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.tgd, expected -1.35041773319e-08, is %s", last_msg.msg.ephemeris_dep_b.tgd); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.toc_tow * 100 - 410400.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.toc_tow, expected 410400.0, is %s", last_msg.msg.ephemeris_dep_b.toc_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.toc_wn == 1838, "incorrect value for last_msg.msg.ephemeris_dep_b.toc_wn, expected 1838, is %d", last_msg.msg.ephemeris_dep_b.toc_wn); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.toe_tow * 100 - 410400.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.toe_tow, expected 410400.0, is %s", last_msg.msg.ephemeris_dep_b.toe_tow); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.toe_wn == 1838, "incorrect value for last_msg.msg.ephemeris_dep_b.toe_wn, expected 1838, is %d", last_msg.msg.ephemeris_dep_b.toe_wn); - - ck_assert_msg(last_msg.msg.ephemeris_dep_b.valid == 1, "incorrect value for last_msg.msg.ephemeris_dep_b.valid, expected 1, is %d", last_msg.msg.ephemeris_dep_b.valid); - - ck_assert_msg((last_msg.msg.ephemeris_dep_b.w * 100 - -0.523790171609 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_dep_b.w, expected -0.523790171609, is %s", last_msg.msg.ephemeris_dep_b.w); + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af0 * 100 - + 0.000319611746818 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af0, " + "expected 0.000319611746818, is %s", + last_msg.msg.ephemeris_dep_b.af0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af1 * 100 - + -1.02318153949e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af1, " + "expected -1.02318153949e-12, is %s", + last_msg.msg.ephemeris_dep_b.af1); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.af2, " + "expected 0.0, is %s", + last_msg.msg.ephemeris_dep_b.af2); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_ic * 100 - + 9.12696123123e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_ic, " + "expected 9.12696123123e-08, is %s", + last_msg.msg.ephemeris_dep_b.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_is * 100 - + 5.21540641785e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_is, " + "expected 5.21540641785e-08, is %s", + last_msg.msg.ephemeris_dep_b.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.c_rc * 100 - 247.28125 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_rc, expected " + "247.28125, is %s", + last_msg.msg.ephemeris_dep_b.c_rc); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.c_rs * 100 - -77.90625 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_rs, expected " + "-77.90625, is %s", + last_msg.msg.ephemeris_dep_b.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_uc * 100 - + -3.72342765331e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_uc, " + "expected -3.72342765331e-06, is %s", + last_msg.msg.ephemeris_dep_b.c_uc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.c_us * 100 - + 7.17863440514e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.c_us, " + "expected 7.17863440514e-06, is %s", + last_msg.msg.ephemeris_dep_b.c_us); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.dn * 100 - + 4.40089760076e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.dn, " + "expected 4.40089760076e-09, is %s", + last_msg.msg.ephemeris_dep_b.dn); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.ecc * 100 - + 0.00817864493001 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.ecc, " + "expected 0.00817864493001, is %s", + last_msg.msg.ephemeris_dep_b.ecc); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.healthy == 1, + "incorrect value for last_msg.msg.ephemeris_dep_b.healthy, " + "expected 1, is %d", + last_msg.msg.ephemeris_dep_b.healthy); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.inc * 100 - 0.975512201725 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.inc, expected " + "0.975512201725, is %s", + last_msg.msg.ephemeris_dep_b.inc); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.inc_dot * 100 - + -5.88238788221e-10 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.inc_dot, " + "expected -5.88238788221e-10, is %s", + last_msg.msg.ephemeris_dep_b.inc_dot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.iode == 0, + "incorrect value for last_msg.msg.ephemeris_dep_b.iode, " + "expected 0, is %d", + last_msg.msg.ephemeris_dep_b.iode); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.m0 * 100 - 1.94018234598 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.m0, expected " + "1.94018234598, is %s", + last_msg.msg.ephemeris_dep_b.m0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.omega0 * 100 - + 2.24186802893 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.omega0, " + "expected 2.24186802893, is %s", + last_msg.msg.ephemeris_dep_b.omega0); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.omegadot * 100 - + -7.96247452617e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.omegadot, " + "expected -7.96247452617e-09, is %s", + last_msg.msg.ephemeris_dep_b.omegadot); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.prn == 30, + "incorrect value for last_msg.msg.ephemeris_dep_b.prn, " + "expected 30, is %d", + last_msg.msg.ephemeris_dep_b.prn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.sqrta * 100 - 5153.75399208 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.sqrta, expected " + "5153.75399208, is %s", + last_msg.msg.ephemeris_dep_b.sqrta); + + ck_assert_msg((last_msg.msg.ephemeris_dep_b.tgd * 100 - + -1.35041773319e-08 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.tgd, " + "expected -1.35041773319e-08, is %s", + last_msg.msg.ephemeris_dep_b.tgd); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.toc_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.toc_tow, expected " + "410400.0, is %s", + last_msg.msg.ephemeris_dep_b.toc_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.toc_wn == 1838, + "incorrect value for last_msg.msg.ephemeris_dep_b.toc_wn, " + "expected 1838, is %d", + last_msg.msg.ephemeris_dep_b.toc_wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.toe_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.toe_tow, expected " + "410400.0, is %s", + last_msg.msg.ephemeris_dep_b.toe_tow); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.toe_wn == 1838, + "incorrect value for last_msg.msg.ephemeris_dep_b.toe_wn, " + "expected 1838, is %d", + last_msg.msg.ephemeris_dep_b.toe_wn); + + ck_assert_msg(last_msg.msg.ephemeris_dep_b.valid == 1, + "incorrect value for last_msg.msg.ephemeris_dep_b.valid, " + "expected 1, is %d", + last_msg.msg.ephemeris_dep_b.valid); + + ck_assert_msg( + (last_msg.msg.ephemeris_dep_b.w * 100 - -0.523790171609 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_dep_b.w, expected " + "-0.523790171609, is %s", + last_msg.msg.ephemeris_dep_b.w); } } END_TEST -Suite* auto_check_sbp_observation_msgEphemerisDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_msgEphemerisDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_msgEphemerisDepB"); +Suite *auto_check_sbp_observation_msgEphemerisDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_msgEphemerisDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_msgEphemerisDepB"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_msgEphemerisDepB); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_msgEphemerisQzss.c b/c/test/auto_check_sbp_observation_msgEphemerisQzss.c index c7354582e..941acf1f3 100644 --- a/c/test/auto_check_sbp_observation_msgEphemerisQzss.c +++ b/c/test/auto_check_sbp_observation_msgEphemerisQzss.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisQzss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisQzss.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_msgEphemerisQzss ) -{ +START_TEST(test_auto_check_sbp_observation_msgEphemerisQzss) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_msgEphemerisQzss ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,175 +90,302 @@ START_TEST( test_auto_check_sbp_observation_msgEphemerisQzss ) logging_reset(); - sbp_callback_register(&sbp_state, 0x8e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x8e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,142,0,128,240,139,193,31,208,221,6,0,106,8,0,0,0,64,64,56,0,0,0,0,0,0,192,177,0,232,228,195,0,160,19,194,0,224,135,183,0,96,10,55,0,192,157,181,0,0,46,52,167,72,107,105,179,1,39,62,15,224,158,211,241,164,211,63,0,0,0,24,251,83,179,63,0,0,0,34,44,93,185,64,143,62,206,232,193,181,242,191,207,216,69,106,98,255,39,190,65,132,95,22,48,15,249,191,249,82,67,94,30,100,231,63,117,167,187,233,187,253,181,61,160,129,193,185,0,0,168,172,0,0,0,0,208,221,6,0,106,8,49,49,3,126,23, }; + u8 encoded_frame[] = { + 85, 142, 0, 128, 240, 139, 193, 31, 208, 221, 6, 0, 106, 8, + 0, 0, 0, 64, 64, 56, 0, 0, 0, 0, 0, 0, 192, 177, + 0, 232, 228, 195, 0, 160, 19, 194, 0, 224, 135, 183, 0, 96, + 10, 55, 0, 192, 157, 181, 0, 0, 46, 52, 167, 72, 107, 105, + 179, 1, 39, 62, 15, 224, 158, 211, 241, 164, 211, 63, 0, 0, + 0, 24, 251, 83, 179, 63, 0, 0, 0, 34, 44, 93, 185, 64, + 143, 62, 206, 232, 193, 181, 242, 191, 207, 216, 69, 106, 98, 255, + 39, 190, 65, 132, 95, 22, 48, 15, 249, 191, 249, 82, 67, 94, + 30, 100, 231, 63, 117, 167, 187, 233, 187, 253, 181, 61, 160, 129, + 193, 185, 0, 0, 168, 172, 0, 0, 0, 0, 208, 221, 6, 0, + 106, 8, 49, 49, 3, 126, 23, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ephemeris_qzss.af0 = -0.00036908406764268875; - + test_msg.ephemeris_qzss.af1 = -4.774847184307873e-12; - + test_msg.ephemeris_qzss.af2 = 0.0; - + test_msg.ephemeris_qzss.c_ic = -1.1753290891647339e-06; - + test_msg.ephemeris_qzss.c_is = 1.6205012798309326e-07; - + test_msg.ephemeris_qzss.c_rc = -36.90625; - + test_msg.ephemeris_qzss.c_rs = -457.8125; - + test_msg.ephemeris_qzss.c_uc = -1.6197562217712402e-05; - + test_msg.ephemeris_qzss.c_us = 8.247792720794678e-06; - - + test_msg.ephemeris_qzss.common.fit_interval = 14400; - + test_msg.ephemeris_qzss.common.health_bits = 0; - - + test_msg.ephemeris_qzss.common.sid.code = 31; - + test_msg.ephemeris_qzss.common.sid.sat = 193; - - + test_msg.ephemeris_qzss.common.toe.tow = 450000; - + test_msg.ephemeris_qzss.common.toe.wn = 2154; - + test_msg.ephemeris_qzss.common.ura = 2.0; - + test_msg.ephemeris_qzss.common.valid = 0; - + test_msg.ephemeris_qzss.dn = 2.678325848736433e-09; - + test_msg.ephemeris_qzss.ecc = 0.07550019584596157; - + test_msg.ephemeris_qzss.inc = 0.7309715119432375; - + test_msg.ephemeris_qzss.inc_dot = 2.0000833114980698e-11; - + test_msg.ephemeris_qzss.iodc = 817; - + test_msg.ephemeris_qzss.iode = 49; - + test_msg.ephemeris_qzss.m0 = 0.30694242158961144; - + test_msg.ephemeris_qzss.omega0 = -1.1693743795366662; - + test_msg.ephemeris_qzss.omegadot = -2.7936877968817684e-09; - + test_msg.ephemeris_qzss.sqrta = 6493.172393798828; - + test_msg.ephemeris_qzss.tgd = -5.587935447692871e-09; - - + test_msg.ephemeris_qzss.toc.tow = 450000; - + test_msg.ephemeris_qzss.toc.wn = 2154; - + test_msg.ephemeris_qzss.w = -1.5662079690885238; - sbp_message_send(&sbp_state, SbpMsgEphemerisQzss, 61568, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEphemerisQzss, 61568, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61568, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEphemerisQzss, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEphemerisQzss, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.af0 * 100 - -0.000369084067643 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.af0, expected -0.000369084067643, is %s", last_msg.msg.ephemeris_qzss.af0); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.af1 * 100 - -4.77484718431e-12 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.af1, expected -4.77484718431e-12, is %s", last_msg.msg.ephemeris_qzss.af1); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.af2 * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.af2, expected 0.0, is %s", last_msg.msg.ephemeris_qzss.af2); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.c_ic * 100 - -1.17532908916e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.c_ic, expected -1.17532908916e-06, is %s", last_msg.msg.ephemeris_qzss.c_ic); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.c_is * 100 - 1.62050127983e-07 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.c_is, expected 1.62050127983e-07, is %s", last_msg.msg.ephemeris_qzss.c_is); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.c_rc * 100 - -36.90625 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.c_rc, expected -36.90625, is %s", last_msg.msg.ephemeris_qzss.c_rc); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.c_rs * 100 - -457.8125 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.c_rs, expected -457.8125, is %s", last_msg.msg.ephemeris_qzss.c_rs); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.c_uc * 100 - -1.61975622177e-05 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.c_uc, expected -1.61975622177e-05, is %s", last_msg.msg.ephemeris_qzss.c_uc); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.c_us * 100 - 8.24779272079e-06 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.c_us, expected 8.24779272079e-06, is %s", last_msg.msg.ephemeris_qzss.c_us); - - - ck_assert_msg(last_msg.msg.ephemeris_qzss.common.fit_interval == 14400, "incorrect value for last_msg.msg.ephemeris_qzss.common.fit_interval, expected 14400, is %d", last_msg.msg.ephemeris_qzss.common.fit_interval); - - ck_assert_msg(last_msg.msg.ephemeris_qzss.common.health_bits == 0, "incorrect value for last_msg.msg.ephemeris_qzss.common.health_bits, expected 0, is %d", last_msg.msg.ephemeris_qzss.common.health_bits); - - - ck_assert_msg(last_msg.msg.ephemeris_qzss.common.sid.code == 31, "incorrect value for last_msg.msg.ephemeris_qzss.common.sid.code, expected 31, is %d", last_msg.msg.ephemeris_qzss.common.sid.code); - - ck_assert_msg(last_msg.msg.ephemeris_qzss.common.sid.sat == 193, "incorrect value for last_msg.msg.ephemeris_qzss.common.sid.sat, expected 193, is %d", last_msg.msg.ephemeris_qzss.common.sid.sat); - - - ck_assert_msg(last_msg.msg.ephemeris_qzss.common.toe.tow == 450000, "incorrect value for last_msg.msg.ephemeris_qzss.common.toe.tow, expected 450000, is %d", last_msg.msg.ephemeris_qzss.common.toe.tow); - - ck_assert_msg(last_msg.msg.ephemeris_qzss.common.toe.wn == 2154, "incorrect value for last_msg.msg.ephemeris_qzss.common.toe.wn, expected 2154, is %d", last_msg.msg.ephemeris_qzss.common.toe.wn); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.common.ura * 100 - 2.0 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.common.ura, expected 2.0, is %s", last_msg.msg.ephemeris_qzss.common.ura); - - ck_assert_msg(last_msg.msg.ephemeris_qzss.common.valid == 0, "incorrect value for last_msg.msg.ephemeris_qzss.common.valid, expected 0, is %d", last_msg.msg.ephemeris_qzss.common.valid); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.dn * 100 - 2.67832584874e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.dn, expected 2.67832584874e-09, is %s", last_msg.msg.ephemeris_qzss.dn); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.ecc * 100 - 0.075500195846 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.ecc, expected 0.075500195846, is %s", last_msg.msg.ephemeris_qzss.ecc); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.inc * 100 - 0.730971511943 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.inc, expected 0.730971511943, is %s", last_msg.msg.ephemeris_qzss.inc); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.inc_dot * 100 - 2.0000833115e-11 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.inc_dot, expected 2.0000833115e-11, is %s", last_msg.msg.ephemeris_qzss.inc_dot); - - ck_assert_msg(last_msg.msg.ephemeris_qzss.iodc == 817, "incorrect value for last_msg.msg.ephemeris_qzss.iodc, expected 817, is %d", last_msg.msg.ephemeris_qzss.iodc); - - ck_assert_msg(last_msg.msg.ephemeris_qzss.iode == 49, "incorrect value for last_msg.msg.ephemeris_qzss.iode, expected 49, is %d", last_msg.msg.ephemeris_qzss.iode); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.m0 * 100 - 0.30694242159 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.m0, expected 0.30694242159, is %s", last_msg.msg.ephemeris_qzss.m0); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.omega0 * 100 - -1.16937437954 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.omega0, expected -1.16937437954, is %s", last_msg.msg.ephemeris_qzss.omega0); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.omegadot * 100 - -2.79368779688e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.omegadot, expected -2.79368779688e-09, is %s", last_msg.msg.ephemeris_qzss.omegadot); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.sqrta * 100 - 6493.1723938 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.sqrta, expected 6493.1723938, is %s", last_msg.msg.ephemeris_qzss.sqrta); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.tgd * 100 - -5.58793544769e-09 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.tgd, expected -5.58793544769e-09, is %s", last_msg.msg.ephemeris_qzss.tgd); - - - ck_assert_msg(last_msg.msg.ephemeris_qzss.toc.tow == 450000, "incorrect value for last_msg.msg.ephemeris_qzss.toc.tow, expected 450000, is %d", last_msg.msg.ephemeris_qzss.toc.tow); - - ck_assert_msg(last_msg.msg.ephemeris_qzss.toc.wn == 2154, "incorrect value for last_msg.msg.ephemeris_qzss.toc.wn, expected 2154, is %d", last_msg.msg.ephemeris_qzss.toc.wn); - - ck_assert_msg((last_msg.msg.ephemeris_qzss.w * 100 - -1.56620796909 * 100) < 0.05, "incorrect value for last_msg.msg.ephemeris_qzss.w, expected -1.56620796909, is %s", last_msg.msg.ephemeris_qzss.w); + ck_assert_msg((last_msg.msg.ephemeris_qzss.af0 * 100 - + -0.000369084067643 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.af0, " + "expected -0.000369084067643, is %s", + last_msg.msg.ephemeris_qzss.af0); + + ck_assert_msg((last_msg.msg.ephemeris_qzss.af1 * 100 - + -4.77484718431e-12 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.af1, " + "expected -4.77484718431e-12, is %s", + last_msg.msg.ephemeris_qzss.af1); + + ck_assert_msg((last_msg.msg.ephemeris_qzss.af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.af2, " + "expected 0.0, is %s", + last_msg.msg.ephemeris_qzss.af2); + + ck_assert_msg((last_msg.msg.ephemeris_qzss.c_ic * 100 - + -1.17532908916e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.c_ic, " + "expected -1.17532908916e-06, is %s", + last_msg.msg.ephemeris_qzss.c_ic); + + ck_assert_msg((last_msg.msg.ephemeris_qzss.c_is * 100 - + 1.62050127983e-07 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.c_is, " + "expected 1.62050127983e-07, is %s", + last_msg.msg.ephemeris_qzss.c_is); + + ck_assert_msg( + (last_msg.msg.ephemeris_qzss.c_rc * 100 - -36.90625 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.c_rc, expected " + "-36.90625, is %s", + last_msg.msg.ephemeris_qzss.c_rc); + + ck_assert_msg( + (last_msg.msg.ephemeris_qzss.c_rs * 100 - -457.8125 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.c_rs, expected " + "-457.8125, is %s", + last_msg.msg.ephemeris_qzss.c_rs); + + ck_assert_msg((last_msg.msg.ephemeris_qzss.c_uc * 100 - + -1.61975622177e-05 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.c_uc, " + "expected -1.61975622177e-05, is %s", + last_msg.msg.ephemeris_qzss.c_uc); + + ck_assert_msg((last_msg.msg.ephemeris_qzss.c_us * 100 - + 8.24779272079e-06 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.c_us, " + "expected 8.24779272079e-06, is %s", + last_msg.msg.ephemeris_qzss.c_us); + + ck_assert_msg( + last_msg.msg.ephemeris_qzss.common.fit_interval == 14400, + "incorrect value for last_msg.msg.ephemeris_qzss.common.fit_interval, " + "expected 14400, is %d", + last_msg.msg.ephemeris_qzss.common.fit_interval); + + ck_assert_msg( + last_msg.msg.ephemeris_qzss.common.health_bits == 0, + "incorrect value for last_msg.msg.ephemeris_qzss.common.health_bits, " + "expected 0, is %d", + last_msg.msg.ephemeris_qzss.common.health_bits); + + ck_assert_msg( + last_msg.msg.ephemeris_qzss.common.sid.code == 31, + "incorrect value for last_msg.msg.ephemeris_qzss.common.sid.code, " + "expected 31, is %d", + last_msg.msg.ephemeris_qzss.common.sid.code); + + ck_assert_msg( + last_msg.msg.ephemeris_qzss.common.sid.sat == 193, + "incorrect value for last_msg.msg.ephemeris_qzss.common.sid.sat, " + "expected 193, is %d", + last_msg.msg.ephemeris_qzss.common.sid.sat); + + ck_assert_msg( + last_msg.msg.ephemeris_qzss.common.toe.tow == 450000, + "incorrect value for last_msg.msg.ephemeris_qzss.common.toe.tow, " + "expected 450000, is %d", + last_msg.msg.ephemeris_qzss.common.toe.tow); + + ck_assert_msg( + last_msg.msg.ephemeris_qzss.common.toe.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_qzss.common.toe.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_qzss.common.toe.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_qzss.common.ura * 100 - 2.0 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.common.ura, expected " + "2.0, is %s", + last_msg.msg.ephemeris_qzss.common.ura); + + ck_assert_msg(last_msg.msg.ephemeris_qzss.common.valid == 0, + "incorrect value for " + "last_msg.msg.ephemeris_qzss.common.valid, expected 0, is %d", + last_msg.msg.ephemeris_qzss.common.valid); + + ck_assert_msg( + (last_msg.msg.ephemeris_qzss.dn * 100 - 2.67832584874e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.dn, expected " + "2.67832584874e-09, is %s", + last_msg.msg.ephemeris_qzss.dn); + + ck_assert_msg( + (last_msg.msg.ephemeris_qzss.ecc * 100 - 0.075500195846 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.ecc, expected " + "0.075500195846, is %s", + last_msg.msg.ephemeris_qzss.ecc); + + ck_assert_msg( + (last_msg.msg.ephemeris_qzss.inc * 100 - 0.730971511943 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.inc, expected " + "0.730971511943, is %s", + last_msg.msg.ephemeris_qzss.inc); + + ck_assert_msg((last_msg.msg.ephemeris_qzss.inc_dot * 100 - + 2.0000833115e-11 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.inc_dot, " + "expected 2.0000833115e-11, is %s", + last_msg.msg.ephemeris_qzss.inc_dot); + + ck_assert_msg(last_msg.msg.ephemeris_qzss.iodc == 817, + "incorrect value for last_msg.msg.ephemeris_qzss.iodc, " + "expected 817, is %d", + last_msg.msg.ephemeris_qzss.iodc); + + ck_assert_msg(last_msg.msg.ephemeris_qzss.iode == 49, + "incorrect value for last_msg.msg.ephemeris_qzss.iode, " + "expected 49, is %d", + last_msg.msg.ephemeris_qzss.iode); + + ck_assert_msg( + (last_msg.msg.ephemeris_qzss.m0 * 100 - 0.30694242159 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.m0, expected " + "0.30694242159, is %s", + last_msg.msg.ephemeris_qzss.m0); + + ck_assert_msg((last_msg.msg.ephemeris_qzss.omega0 * 100 - + -1.16937437954 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.omega0, " + "expected -1.16937437954, is %s", + last_msg.msg.ephemeris_qzss.omega0); + + ck_assert_msg((last_msg.msg.ephemeris_qzss.omegadot * 100 - + -2.79368779688e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.omegadot, " + "expected -2.79368779688e-09, is %s", + last_msg.msg.ephemeris_qzss.omegadot); + + ck_assert_msg( + (last_msg.msg.ephemeris_qzss.sqrta * 100 - 6493.1723938 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.sqrta, expected " + "6493.1723938, is %s", + last_msg.msg.ephemeris_qzss.sqrta); + + ck_assert_msg((last_msg.msg.ephemeris_qzss.tgd * 100 - + -5.58793544769e-09 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.tgd, " + "expected -5.58793544769e-09, is %s", + last_msg.msg.ephemeris_qzss.tgd); + + ck_assert_msg(last_msg.msg.ephemeris_qzss.toc.tow == 450000, + "incorrect value for last_msg.msg.ephemeris_qzss.toc.tow, " + "expected 450000, is %d", + last_msg.msg.ephemeris_qzss.toc.tow); + + ck_assert_msg(last_msg.msg.ephemeris_qzss.toc.wn == 2154, + "incorrect value for last_msg.msg.ephemeris_qzss.toc.wn, " + "expected 2154, is %d", + last_msg.msg.ephemeris_qzss.toc.wn); + + ck_assert_msg( + (last_msg.msg.ephemeris_qzss.w * 100 - -1.56620796909 * 100) < 0.05, + "incorrect value for last_msg.msg.ephemeris_qzss.w, expected " + "-1.56620796909, is %s", + last_msg.msg.ephemeris_qzss.w); } } END_TEST -Suite* auto_check_sbp_observation_msgEphemerisQzss_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_msgEphemerisQzss"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_msgEphemerisQzss"); +Suite *auto_check_sbp_observation_msgEphemerisQzss_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_msgEphemerisQzss"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_observation_msgEphemerisQzss"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_msgEphemerisQzss); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_observation_msgObsDepA.c b/c/test/auto_check_sbp_observation_msgObsDepA.c index d435a4a7d..3129768ea 100644 --- a/c/test/auto_check_sbp_observation_msgObsDepA.c +++ b/c/test/auto_check_sbp_observation_msgObsDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_msgObsDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_msgObsDepA.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_observation_msgObsDepA ) -{ +START_TEST(test_auto_check_sbp_observation_msgObsDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_observation_msgObsDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,251 +90,374 @@ START_TEST( test_auto_check_sbp_observation_msgObsDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x45, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x45, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,69,0,195,4,98,56,158,67,24,46,7,32,56,235,249,121,244,114,255,255,33,46,67,218,0,238,203,70,124,22,25,3,0,98,43,184,157,2,176,133,197,125,126,71,253,255,185,39,68,55,3,60,173,162,131,98,231,253,255,139,30,33,16,10,128,178,248,136,42,113,253,255,40,20,42,71,13,246,246,17,135,255,51,3,0,64,27,108,249,22,210,41,114,118,131,48,255,255,31,52,226,58,30,23,217, }; + u8 encoded_frame[] = { + 85, 69, 0, 195, 4, 98, 56, 158, 67, 24, 46, 7, 32, 56, + 235, 249, 121, 244, 114, 255, 255, 33, 46, 67, 218, 0, 238, 203, + 70, 124, 22, 25, 3, 0, 98, 43, 184, 157, 2, 176, 133, 197, + 125, 126, 71, 253, 255, 185, 39, 68, 55, 3, 60, 173, 162, 131, + 98, 231, 253, 255, 139, 30, 33, 16, 10, 128, 178, 248, 136, 42, + 113, 253, 255, 40, 20, 42, 71, 13, 246, 246, 17, 135, 255, 51, + 3, 0, 64, 27, 108, 249, 22, 210, 41, 114, 118, 131, 48, 255, + 255, 31, 52, 226, 58, 30, 23, 217, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_a.header.n_obs = 32; - - + test_msg.obs_dep_a.header.t.tow = 407084600; - + test_msg.obs_dep_a.header.t.wn = 1838; - + test_msg.obs_dep_a.n_obs = 7; - - - - + test_msg.obs_dep_a.obs[0].L.f = 33; - + test_msg.obs_dep_a.obs[0].L.i = -36108; - + test_msg.obs_dep_a.obs[0].P = 2046421816; - + test_msg.obs_dep_a.obs[0].cn0 = 46; - + test_msg.obs_dep_a.obs[0].lock = 55875; - + test_msg.obs_dep_a.obs[0].prn = 0; - - - + test_msg.obs_dep_a.obs[1].L.f = 98; - + test_msg.obs_dep_a.obs[1].L.i = 203030; - + test_msg.obs_dep_a.obs[1].P = 2085014510; - + test_msg.obs_dep_a.obs[1].cn0 = 43; - + test_msg.obs_dep_a.obs[1].lock = 40376; - + test_msg.obs_dep_a.obs[1].prn = 2; - - - + test_msg.obs_dep_a.obs[2].L.f = 185; - + test_msg.obs_dep_a.obs[2].L.i = -178306; - + test_msg.obs_dep_a.obs[2].P = 2110096816; - + test_msg.obs_dep_a.obs[2].cn0 = 39; - + test_msg.obs_dep_a.obs[2].lock = 14148; - + test_msg.obs_dep_a.obs[2].prn = 3; - - - + test_msg.obs_dep_a.obs[3].L.f = 139; - + test_msg.obs_dep_a.obs[3].L.i = -137374; - + test_msg.obs_dep_a.obs[3].P = 2208476476; - + test_msg.obs_dep_a.obs[3].cn0 = 30; - + test_msg.obs_dep_a.obs[3].lock = 4129; - + test_msg.obs_dep_a.obs[3].prn = 10; - - - + test_msg.obs_dep_a.obs[4].L.f = 40; - + test_msg.obs_dep_a.obs[4].L.i = -167638; - + test_msg.obs_dep_a.obs[4].P = 2298000000; - + test_msg.obs_dep_a.obs[4].cn0 = 20; - + test_msg.obs_dep_a.obs[4].lock = 18218; - + test_msg.obs_dep_a.obs[4].prn = 13; - - - + test_msg.obs_dep_a.obs[5].L.f = 64; - + test_msg.obs_dep_a.obs[5].L.i = 209919; - + test_msg.obs_dep_a.obs[5].P = 2266101494; - + test_msg.obs_dep_a.obs[5].cn0 = 27; - + test_msg.obs_dep_a.obs[5].lock = 63852; - + test_msg.obs_dep_a.obs[5].prn = 22; - - - + test_msg.obs_dep_a.obs[6].L.f = 31; - + test_msg.obs_dep_a.obs[6].L.i = -53117; - + test_msg.obs_dep_a.obs[6].P = 1987193298; - + test_msg.obs_dep_a.obs[6].cn0 = 52; - + test_msg.obs_dep_a.obs[6].lock = 15074; - + test_msg.obs_dep_a.obs[6].prn = 30; sbp_message_send(&sbp_state, SbpMsgObsDepA, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_a.header.n_obs == 32, "incorrect value for last_msg.msg.obs_dep_a.header.n_obs, expected 32, is %d", last_msg.msg.obs_dep_a.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_a.header.t.tow == 407084600, "incorrect value for last_msg.msg.obs_dep_a.header.t.tow, expected 407084600, is %d", last_msg.msg.obs_dep_a.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_a.header.t.wn == 1838, "incorrect value for last_msg.msg.obs_dep_a.header.t.wn, expected 1838, is %d", last_msg.msg.obs_dep_a.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_a.n_obs == 7, "incorrect value for last_msg.msg.obs_dep_a.n_obs, expected 7, is %d", last_msg.msg.obs_dep_a.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.f == 33, "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.f, expected 33, is %d", last_msg.msg.obs_dep_a.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.i == -36108, "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.i, expected -36108, is %d", last_msg.msg.obs_dep_a.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].P == 2046421816, "incorrect value for last_msg.msg.obs_dep_a.obs[0].P, expected 2046421816, is %d", last_msg.msg.obs_dep_a.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].cn0 == 46, "incorrect value for last_msg.msg.obs_dep_a.obs[0].cn0, expected 46, is %d", last_msg.msg.obs_dep_a.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].lock == 55875, "incorrect value for last_msg.msg.obs_dep_a.obs[0].lock, expected 55875, is %d", last_msg.msg.obs_dep_a.obs[0].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].prn == 0, "incorrect value for last_msg.msg.obs_dep_a.obs[0].prn, expected 0, is %d", last_msg.msg.obs_dep_a.obs[0].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.f == 98, "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.f, expected 98, is %d", last_msg.msg.obs_dep_a.obs[1].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.i == 203030, "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.i, expected 203030, is %d", last_msg.msg.obs_dep_a.obs[1].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].P == 2085014510, "incorrect value for last_msg.msg.obs_dep_a.obs[1].P, expected 2085014510, is %d", last_msg.msg.obs_dep_a.obs[1].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].cn0 == 43, "incorrect value for last_msg.msg.obs_dep_a.obs[1].cn0, expected 43, is %d", last_msg.msg.obs_dep_a.obs[1].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].lock == 40376, "incorrect value for last_msg.msg.obs_dep_a.obs[1].lock, expected 40376, is %d", last_msg.msg.obs_dep_a.obs[1].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].prn == 2, "incorrect value for last_msg.msg.obs_dep_a.obs[1].prn, expected 2, is %d", last_msg.msg.obs_dep_a.obs[1].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.f == 185, "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.f, expected 185, is %d", last_msg.msg.obs_dep_a.obs[2].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.i == -178306, "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.i, expected -178306, is %d", last_msg.msg.obs_dep_a.obs[2].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].P == 2110096816, "incorrect value for last_msg.msg.obs_dep_a.obs[2].P, expected 2110096816, is %d", last_msg.msg.obs_dep_a.obs[2].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].cn0 == 39, "incorrect value for last_msg.msg.obs_dep_a.obs[2].cn0, expected 39, is %d", last_msg.msg.obs_dep_a.obs[2].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].lock == 14148, "incorrect value for last_msg.msg.obs_dep_a.obs[2].lock, expected 14148, is %d", last_msg.msg.obs_dep_a.obs[2].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].prn == 3, "incorrect value for last_msg.msg.obs_dep_a.obs[2].prn, expected 3, is %d", last_msg.msg.obs_dep_a.obs[2].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.f == 139, "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.f, expected 139, is %d", last_msg.msg.obs_dep_a.obs[3].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.i == -137374, "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.i, expected -137374, is %d", last_msg.msg.obs_dep_a.obs[3].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].P == 2208476476, "incorrect value for last_msg.msg.obs_dep_a.obs[3].P, expected 2208476476, is %d", last_msg.msg.obs_dep_a.obs[3].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].cn0 == 30, "incorrect value for last_msg.msg.obs_dep_a.obs[3].cn0, expected 30, is %d", last_msg.msg.obs_dep_a.obs[3].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].lock == 4129, "incorrect value for last_msg.msg.obs_dep_a.obs[3].lock, expected 4129, is %d", last_msg.msg.obs_dep_a.obs[3].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].prn == 10, "incorrect value for last_msg.msg.obs_dep_a.obs[3].prn, expected 10, is %d", last_msg.msg.obs_dep_a.obs[3].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.f == 40, "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.f, expected 40, is %d", last_msg.msg.obs_dep_a.obs[4].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.i == -167638, "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.i, expected -167638, is %d", last_msg.msg.obs_dep_a.obs[4].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].P == 2298000000, "incorrect value for last_msg.msg.obs_dep_a.obs[4].P, expected 2298000000, is %d", last_msg.msg.obs_dep_a.obs[4].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].cn0 == 20, "incorrect value for last_msg.msg.obs_dep_a.obs[4].cn0, expected 20, is %d", last_msg.msg.obs_dep_a.obs[4].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].lock == 18218, "incorrect value for last_msg.msg.obs_dep_a.obs[4].lock, expected 18218, is %d", last_msg.msg.obs_dep_a.obs[4].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].prn == 13, "incorrect value for last_msg.msg.obs_dep_a.obs[4].prn, expected 13, is %d", last_msg.msg.obs_dep_a.obs[4].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].L.f == 64, "incorrect value for last_msg.msg.obs_dep_a.obs[5].L.f, expected 64, is %d", last_msg.msg.obs_dep_a.obs[5].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].L.i == 209919, "incorrect value for last_msg.msg.obs_dep_a.obs[5].L.i, expected 209919, is %d", last_msg.msg.obs_dep_a.obs[5].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].P == 2266101494, "incorrect value for last_msg.msg.obs_dep_a.obs[5].P, expected 2266101494, is %d", last_msg.msg.obs_dep_a.obs[5].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].cn0 == 27, "incorrect value for last_msg.msg.obs_dep_a.obs[5].cn0, expected 27, is %d", last_msg.msg.obs_dep_a.obs[5].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].lock == 63852, "incorrect value for last_msg.msg.obs_dep_a.obs[5].lock, expected 63852, is %d", last_msg.msg.obs_dep_a.obs[5].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].prn == 22, "incorrect value for last_msg.msg.obs_dep_a.obs[5].prn, expected 22, is %d", last_msg.msg.obs_dep_a.obs[5].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].L.f == 31, "incorrect value for last_msg.msg.obs_dep_a.obs[6].L.f, expected 31, is %d", last_msg.msg.obs_dep_a.obs[6].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].L.i == -53117, "incorrect value for last_msg.msg.obs_dep_a.obs[6].L.i, expected -53117, is %d", last_msg.msg.obs_dep_a.obs[6].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].P == 1987193298, "incorrect value for last_msg.msg.obs_dep_a.obs[6].P, expected 1987193298, is %d", last_msg.msg.obs_dep_a.obs[6].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].cn0 == 52, "incorrect value for last_msg.msg.obs_dep_a.obs[6].cn0, expected 52, is %d", last_msg.msg.obs_dep_a.obs[6].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].lock == 15074, "incorrect value for last_msg.msg.obs_dep_a.obs[6].lock, expected 15074, is %d", last_msg.msg.obs_dep_a.obs[6].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].prn == 30, "incorrect value for last_msg.msg.obs_dep_a.obs[6].prn, expected 30, is %d", last_msg.msg.obs_dep_a.obs[6].prn); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.n_obs == 32, + "incorrect value for last_msg.msg.obs_dep_a.header.n_obs, " + "expected 32, is %d", + last_msg.msg.obs_dep_a.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.t.tow == 407084600, + "incorrect value for last_msg.msg.obs_dep_a.header.t.tow, " + "expected 407084600, is %d", + last_msg.msg.obs_dep_a.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.t.wn == 1838, + "incorrect value for last_msg.msg.obs_dep_a.header.t.wn, " + "expected 1838, is %d", + last_msg.msg.obs_dep_a.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_a.n_obs == 7, + "incorrect value for last_msg.msg.obs_dep_a.n_obs, expected 7, is %d", + last_msg.msg.obs_dep_a.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.f == 33, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.f, " + "expected 33, is %d", + last_msg.msg.obs_dep_a.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.i == -36108, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.i, " + "expected -36108, is %d", + last_msg.msg.obs_dep_a.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].P == 2046421816, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].P, " + "expected 2046421816, is %d", + last_msg.msg.obs_dep_a.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].cn0 == 46, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].cn0, " + "expected 46, is %d", + last_msg.msg.obs_dep_a.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].lock == 55875, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].lock, " + "expected 55875, is %d", + last_msg.msg.obs_dep_a.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].prn == 0, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].prn, " + "expected 0, is %d", + last_msg.msg.obs_dep_a.obs[0].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.f == 98, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.f, " + "expected 98, is %d", + last_msg.msg.obs_dep_a.obs[1].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.i == 203030, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.i, " + "expected 203030, is %d", + last_msg.msg.obs_dep_a.obs[1].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].P == 2085014510, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].P, " + "expected 2085014510, is %d", + last_msg.msg.obs_dep_a.obs[1].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].cn0 == 43, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].cn0, " + "expected 43, is %d", + last_msg.msg.obs_dep_a.obs[1].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].lock == 40376, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].lock, " + "expected 40376, is %d", + last_msg.msg.obs_dep_a.obs[1].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].prn == 2, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].prn, " + "expected 2, is %d", + last_msg.msg.obs_dep_a.obs[1].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.f == 185, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.f, " + "expected 185, is %d", + last_msg.msg.obs_dep_a.obs[2].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.i == -178306, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.i, " + "expected -178306, is %d", + last_msg.msg.obs_dep_a.obs[2].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].P == 2110096816, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].P, " + "expected 2110096816, is %d", + last_msg.msg.obs_dep_a.obs[2].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].cn0 == 39, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].cn0, " + "expected 39, is %d", + last_msg.msg.obs_dep_a.obs[2].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].lock == 14148, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].lock, " + "expected 14148, is %d", + last_msg.msg.obs_dep_a.obs[2].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].prn == 3, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].prn, " + "expected 3, is %d", + last_msg.msg.obs_dep_a.obs[2].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.f == 139, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.f, " + "expected 139, is %d", + last_msg.msg.obs_dep_a.obs[3].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.i == -137374, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.i, " + "expected -137374, is %d", + last_msg.msg.obs_dep_a.obs[3].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].P == 2208476476, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].P, " + "expected 2208476476, is %d", + last_msg.msg.obs_dep_a.obs[3].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].cn0 == 30, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].cn0, " + "expected 30, is %d", + last_msg.msg.obs_dep_a.obs[3].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].lock == 4129, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].lock, " + "expected 4129, is %d", + last_msg.msg.obs_dep_a.obs[3].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].prn == 10, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].prn, " + "expected 10, is %d", + last_msg.msg.obs_dep_a.obs[3].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.f == 40, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.f, " + "expected 40, is %d", + last_msg.msg.obs_dep_a.obs[4].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.i == -167638, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.i, " + "expected -167638, is %d", + last_msg.msg.obs_dep_a.obs[4].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].P == 2298000000, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].P, " + "expected 2298000000, is %d", + last_msg.msg.obs_dep_a.obs[4].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].cn0 == 20, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].cn0, " + "expected 20, is %d", + last_msg.msg.obs_dep_a.obs[4].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].lock == 18218, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].lock, " + "expected 18218, is %d", + last_msg.msg.obs_dep_a.obs[4].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].prn == 13, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].prn, " + "expected 13, is %d", + last_msg.msg.obs_dep_a.obs[4].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].L.f == 64, + "incorrect value for last_msg.msg.obs_dep_a.obs[5].L.f, " + "expected 64, is %d", + last_msg.msg.obs_dep_a.obs[5].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].L.i == 209919, + "incorrect value for last_msg.msg.obs_dep_a.obs[5].L.i, " + "expected 209919, is %d", + last_msg.msg.obs_dep_a.obs[5].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].P == 2266101494, + "incorrect value for last_msg.msg.obs_dep_a.obs[5].P, " + "expected 2266101494, is %d", + last_msg.msg.obs_dep_a.obs[5].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].cn0 == 27, + "incorrect value for last_msg.msg.obs_dep_a.obs[5].cn0, " + "expected 27, is %d", + last_msg.msg.obs_dep_a.obs[5].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].lock == 63852, + "incorrect value for last_msg.msg.obs_dep_a.obs[5].lock, " + "expected 63852, is %d", + last_msg.msg.obs_dep_a.obs[5].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].prn == 22, + "incorrect value for last_msg.msg.obs_dep_a.obs[5].prn, " + "expected 22, is %d", + last_msg.msg.obs_dep_a.obs[5].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].L.f == 31, + "incorrect value for last_msg.msg.obs_dep_a.obs[6].L.f, " + "expected 31, is %d", + last_msg.msg.obs_dep_a.obs[6].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].L.i == -53117, + "incorrect value for last_msg.msg.obs_dep_a.obs[6].L.i, " + "expected -53117, is %d", + last_msg.msg.obs_dep_a.obs[6].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].P == 1987193298, + "incorrect value for last_msg.msg.obs_dep_a.obs[6].P, " + "expected 1987193298, is %d", + last_msg.msg.obs_dep_a.obs[6].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].cn0 == 52, + "incorrect value for last_msg.msg.obs_dep_a.obs[6].cn0, " + "expected 52, is %d", + last_msg.msg.obs_dep_a.obs[6].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].lock == 15074, + "incorrect value for last_msg.msg.obs_dep_a.obs[6].lock, " + "expected 15074, is %d", + last_msg.msg.obs_dep_a.obs[6].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].prn == 30, + "incorrect value for last_msg.msg.obs_dep_a.obs[6].prn, " + "expected 30, is %d", + last_msg.msg.obs_dep_a.obs[6].prn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -346,89 +465,116 @@ START_TEST( test_auto_check_sbp_observation_msgObsDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x45, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x45, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,69,0,195,4,20,56,158,67,24,46,7,33,84,52,164,117,102,32,0,0,147,62,62,250,31,234,14, }; + u8 encoded_frame[] = { + 85, 69, 0, 195, 4, 20, 56, 158, 67, 24, 46, 7, 33, 84, + 52, 164, 117, 102, 32, 0, 0, 147, 62, 62, 250, 31, 234, 14, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_a.header.n_obs = 33; - - + test_msg.obs_dep_a.header.t.tow = 407084600; - + test_msg.obs_dep_a.header.t.wn = 1838; - + test_msg.obs_dep_a.n_obs = 1; - - - - + test_msg.obs_dep_a.obs[0].L.f = 147; - + test_msg.obs_dep_a.obs[0].L.i = 8294; - + test_msg.obs_dep_a.obs[0].P = 1973695572; - + test_msg.obs_dep_a.obs[0].cn0 = 62; - + test_msg.obs_dep_a.obs[0].lock = 64062; - + test_msg.obs_dep_a.obs[0].prn = 31; sbp_message_send(&sbp_state, SbpMsgObsDepA, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_a.header.n_obs == 33, "incorrect value for last_msg.msg.obs_dep_a.header.n_obs, expected 33, is %d", last_msg.msg.obs_dep_a.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_a.header.t.tow == 407084600, "incorrect value for last_msg.msg.obs_dep_a.header.t.tow, expected 407084600, is %d", last_msg.msg.obs_dep_a.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_a.header.t.wn == 1838, "incorrect value for last_msg.msg.obs_dep_a.header.t.wn, expected 1838, is %d", last_msg.msg.obs_dep_a.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_a.n_obs == 1, "incorrect value for last_msg.msg.obs_dep_a.n_obs, expected 1, is %d", last_msg.msg.obs_dep_a.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.f == 147, "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.f, expected 147, is %d", last_msg.msg.obs_dep_a.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.i == 8294, "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.i, expected 8294, is %d", last_msg.msg.obs_dep_a.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].P == 1973695572, "incorrect value for last_msg.msg.obs_dep_a.obs[0].P, expected 1973695572, is %d", last_msg.msg.obs_dep_a.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].cn0 == 62, "incorrect value for last_msg.msg.obs_dep_a.obs[0].cn0, expected 62, is %d", last_msg.msg.obs_dep_a.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].lock == 64062, "incorrect value for last_msg.msg.obs_dep_a.obs[0].lock, expected 64062, is %d", last_msg.msg.obs_dep_a.obs[0].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].prn == 31, "incorrect value for last_msg.msg.obs_dep_a.obs[0].prn, expected 31, is %d", last_msg.msg.obs_dep_a.obs[0].prn); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.n_obs == 33, + "incorrect value for last_msg.msg.obs_dep_a.header.n_obs, " + "expected 33, is %d", + last_msg.msg.obs_dep_a.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.t.tow == 407084600, + "incorrect value for last_msg.msg.obs_dep_a.header.t.tow, " + "expected 407084600, is %d", + last_msg.msg.obs_dep_a.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.t.wn == 1838, + "incorrect value for last_msg.msg.obs_dep_a.header.t.wn, " + "expected 1838, is %d", + last_msg.msg.obs_dep_a.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_a.n_obs == 1, + "incorrect value for last_msg.msg.obs_dep_a.n_obs, expected 1, is %d", + last_msg.msg.obs_dep_a.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.f == 147, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.f, " + "expected 147, is %d", + last_msg.msg.obs_dep_a.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.i == 8294, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.i, " + "expected 8294, is %d", + last_msg.msg.obs_dep_a.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].P == 1973695572, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].P, " + "expected 1973695572, is %d", + last_msg.msg.obs_dep_a.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].cn0 == 62, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].cn0, " + "expected 62, is %d", + last_msg.msg.obs_dep_a.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].lock == 64062, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].lock, " + "expected 64062, is %d", + last_msg.msg.obs_dep_a.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].prn == 31, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].prn, " + "expected 31, is %d", + last_msg.msg.obs_dep_a.obs[0].prn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -436,251 +582,374 @@ START_TEST( test_auto_check_sbp_observation_msgObsDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x45, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x45, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,69,0,195,4,98,0,159,67,24,46,7,32,32,209,249,121,145,114,255,255,141,45,67,218,0,177,128,70,124,79,27,3,0,159,44,184,157,2,59,135,197,125,175,69,253,255,77,40,68,55,3,211,172,162,131,177,229,253,255,20,31,33,16,10,128,178,248,136,116,111,253,255,94,21,42,71,13,182,173,17,135,37,54,3,0,214,27,108,249,22,91,20,114,118,240,47,255,255,129,52,226,58,30,200,119, }; + u8 encoded_frame[] = { + 85, 69, 0, 195, 4, 98, 0, 159, 67, 24, 46, 7, 32, 32, + 209, 249, 121, 145, 114, 255, 255, 141, 45, 67, 218, 0, 177, 128, + 70, 124, 79, 27, 3, 0, 159, 44, 184, 157, 2, 59, 135, 197, + 125, 175, 69, 253, 255, 77, 40, 68, 55, 3, 211, 172, 162, 131, + 177, 229, 253, 255, 20, 31, 33, 16, 10, 128, 178, 248, 136, 116, + 111, 253, 255, 94, 21, 42, 71, 13, 182, 173, 17, 135, 37, 54, + 3, 0, 214, 27, 108, 249, 22, 91, 20, 114, 118, 240, 47, 255, + 255, 129, 52, 226, 58, 30, 200, 119, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_a.header.n_obs = 32; - - + test_msg.obs_dep_a.header.t.tow = 407084800; - + test_msg.obs_dep_a.header.t.wn = 1838; - + test_msg.obs_dep_a.n_obs = 7; - - - - + test_msg.obs_dep_a.obs[0].L.f = 141; - + test_msg.obs_dep_a.obs[0].L.i = -36207; - + test_msg.obs_dep_a.obs[0].P = 2046415136; - + test_msg.obs_dep_a.obs[0].cn0 = 45; - + test_msg.obs_dep_a.obs[0].lock = 55875; - + test_msg.obs_dep_a.obs[0].prn = 0; - - - + test_msg.obs_dep_a.obs[1].L.f = 159; - + test_msg.obs_dep_a.obs[1].L.i = 203599; - + test_msg.obs_dep_a.obs[1].P = 2084995249; - + test_msg.obs_dep_a.obs[1].cn0 = 44; - + test_msg.obs_dep_a.obs[1].lock = 40376; - + test_msg.obs_dep_a.obs[1].prn = 2; - - - + test_msg.obs_dep_a.obs[2].L.f = 77; - + test_msg.obs_dep_a.obs[2].L.i = -178769; - + test_msg.obs_dep_a.obs[2].P = 2110097211; - + test_msg.obs_dep_a.obs[2].cn0 = 40; - + test_msg.obs_dep_a.obs[2].lock = 14148; - + test_msg.obs_dep_a.obs[2].prn = 3; - - - + test_msg.obs_dep_a.obs[3].L.f = 20; - + test_msg.obs_dep_a.obs[3].L.i = -137807; - + test_msg.obs_dep_a.obs[3].P = 2208476371; - + test_msg.obs_dep_a.obs[3].cn0 = 31; - + test_msg.obs_dep_a.obs[3].lock = 4129; - + test_msg.obs_dep_a.obs[3].prn = 10; - - - + test_msg.obs_dep_a.obs[4].L.f = 94; - + test_msg.obs_dep_a.obs[4].L.i = -168076; - + test_msg.obs_dep_a.obs[4].P = 2298000000; - + test_msg.obs_dep_a.obs[4].cn0 = 21; - + test_msg.obs_dep_a.obs[4].lock = 18218; - + test_msg.obs_dep_a.obs[4].prn = 13; - - - + test_msg.obs_dep_a.obs[5].L.f = 214; - + test_msg.obs_dep_a.obs[5].L.i = 210469; - + test_msg.obs_dep_a.obs[5].P = 2266082742; - + test_msg.obs_dep_a.obs[5].cn0 = 27; - + test_msg.obs_dep_a.obs[5].lock = 63852; - + test_msg.obs_dep_a.obs[5].prn = 22; - - - + test_msg.obs_dep_a.obs[6].L.f = 129; - + test_msg.obs_dep_a.obs[6].L.i = -53264; - + test_msg.obs_dep_a.obs[6].P = 1987187803; - + test_msg.obs_dep_a.obs[6].cn0 = 52; - + test_msg.obs_dep_a.obs[6].lock = 15074; - + test_msg.obs_dep_a.obs[6].prn = 30; sbp_message_send(&sbp_state, SbpMsgObsDepA, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_a.header.n_obs == 32, "incorrect value for last_msg.msg.obs_dep_a.header.n_obs, expected 32, is %d", last_msg.msg.obs_dep_a.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_a.header.t.tow == 407084800, "incorrect value for last_msg.msg.obs_dep_a.header.t.tow, expected 407084800, is %d", last_msg.msg.obs_dep_a.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_a.header.t.wn == 1838, "incorrect value for last_msg.msg.obs_dep_a.header.t.wn, expected 1838, is %d", last_msg.msg.obs_dep_a.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_a.n_obs == 7, "incorrect value for last_msg.msg.obs_dep_a.n_obs, expected 7, is %d", last_msg.msg.obs_dep_a.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.f == 141, "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.f, expected 141, is %d", last_msg.msg.obs_dep_a.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.i == -36207, "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.i, expected -36207, is %d", last_msg.msg.obs_dep_a.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].P == 2046415136, "incorrect value for last_msg.msg.obs_dep_a.obs[0].P, expected 2046415136, is %d", last_msg.msg.obs_dep_a.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].cn0 == 45, "incorrect value for last_msg.msg.obs_dep_a.obs[0].cn0, expected 45, is %d", last_msg.msg.obs_dep_a.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].lock == 55875, "incorrect value for last_msg.msg.obs_dep_a.obs[0].lock, expected 55875, is %d", last_msg.msg.obs_dep_a.obs[0].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].prn == 0, "incorrect value for last_msg.msg.obs_dep_a.obs[0].prn, expected 0, is %d", last_msg.msg.obs_dep_a.obs[0].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.f == 159, "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.f, expected 159, is %d", last_msg.msg.obs_dep_a.obs[1].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.i == 203599, "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.i, expected 203599, is %d", last_msg.msg.obs_dep_a.obs[1].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].P == 2084995249, "incorrect value for last_msg.msg.obs_dep_a.obs[1].P, expected 2084995249, is %d", last_msg.msg.obs_dep_a.obs[1].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].cn0 == 44, "incorrect value for last_msg.msg.obs_dep_a.obs[1].cn0, expected 44, is %d", last_msg.msg.obs_dep_a.obs[1].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].lock == 40376, "incorrect value for last_msg.msg.obs_dep_a.obs[1].lock, expected 40376, is %d", last_msg.msg.obs_dep_a.obs[1].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].prn == 2, "incorrect value for last_msg.msg.obs_dep_a.obs[1].prn, expected 2, is %d", last_msg.msg.obs_dep_a.obs[1].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.f == 77, "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.f, expected 77, is %d", last_msg.msg.obs_dep_a.obs[2].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.i == -178769, "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.i, expected -178769, is %d", last_msg.msg.obs_dep_a.obs[2].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].P == 2110097211, "incorrect value for last_msg.msg.obs_dep_a.obs[2].P, expected 2110097211, is %d", last_msg.msg.obs_dep_a.obs[2].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].cn0 == 40, "incorrect value for last_msg.msg.obs_dep_a.obs[2].cn0, expected 40, is %d", last_msg.msg.obs_dep_a.obs[2].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].lock == 14148, "incorrect value for last_msg.msg.obs_dep_a.obs[2].lock, expected 14148, is %d", last_msg.msg.obs_dep_a.obs[2].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].prn == 3, "incorrect value for last_msg.msg.obs_dep_a.obs[2].prn, expected 3, is %d", last_msg.msg.obs_dep_a.obs[2].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.f == 20, "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.f, expected 20, is %d", last_msg.msg.obs_dep_a.obs[3].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.i == -137807, "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.i, expected -137807, is %d", last_msg.msg.obs_dep_a.obs[3].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].P == 2208476371, "incorrect value for last_msg.msg.obs_dep_a.obs[3].P, expected 2208476371, is %d", last_msg.msg.obs_dep_a.obs[3].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].cn0 == 31, "incorrect value for last_msg.msg.obs_dep_a.obs[3].cn0, expected 31, is %d", last_msg.msg.obs_dep_a.obs[3].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].lock == 4129, "incorrect value for last_msg.msg.obs_dep_a.obs[3].lock, expected 4129, is %d", last_msg.msg.obs_dep_a.obs[3].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].prn == 10, "incorrect value for last_msg.msg.obs_dep_a.obs[3].prn, expected 10, is %d", last_msg.msg.obs_dep_a.obs[3].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.f == 94, "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.f, expected 94, is %d", last_msg.msg.obs_dep_a.obs[4].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.i == -168076, "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.i, expected -168076, is %d", last_msg.msg.obs_dep_a.obs[4].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].P == 2298000000, "incorrect value for last_msg.msg.obs_dep_a.obs[4].P, expected 2298000000, is %d", last_msg.msg.obs_dep_a.obs[4].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].cn0 == 21, "incorrect value for last_msg.msg.obs_dep_a.obs[4].cn0, expected 21, is %d", last_msg.msg.obs_dep_a.obs[4].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].lock == 18218, "incorrect value for last_msg.msg.obs_dep_a.obs[4].lock, expected 18218, is %d", last_msg.msg.obs_dep_a.obs[4].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].prn == 13, "incorrect value for last_msg.msg.obs_dep_a.obs[4].prn, expected 13, is %d", last_msg.msg.obs_dep_a.obs[4].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].L.f == 214, "incorrect value for last_msg.msg.obs_dep_a.obs[5].L.f, expected 214, is %d", last_msg.msg.obs_dep_a.obs[5].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].L.i == 210469, "incorrect value for last_msg.msg.obs_dep_a.obs[5].L.i, expected 210469, is %d", last_msg.msg.obs_dep_a.obs[5].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].P == 2266082742, "incorrect value for last_msg.msg.obs_dep_a.obs[5].P, expected 2266082742, is %d", last_msg.msg.obs_dep_a.obs[5].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].cn0 == 27, "incorrect value for last_msg.msg.obs_dep_a.obs[5].cn0, expected 27, is %d", last_msg.msg.obs_dep_a.obs[5].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].lock == 63852, "incorrect value for last_msg.msg.obs_dep_a.obs[5].lock, expected 63852, is %d", last_msg.msg.obs_dep_a.obs[5].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].prn == 22, "incorrect value for last_msg.msg.obs_dep_a.obs[5].prn, expected 22, is %d", last_msg.msg.obs_dep_a.obs[5].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].L.f == 129, "incorrect value for last_msg.msg.obs_dep_a.obs[6].L.f, expected 129, is %d", last_msg.msg.obs_dep_a.obs[6].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].L.i == -53264, "incorrect value for last_msg.msg.obs_dep_a.obs[6].L.i, expected -53264, is %d", last_msg.msg.obs_dep_a.obs[6].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].P == 1987187803, "incorrect value for last_msg.msg.obs_dep_a.obs[6].P, expected 1987187803, is %d", last_msg.msg.obs_dep_a.obs[6].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].cn0 == 52, "incorrect value for last_msg.msg.obs_dep_a.obs[6].cn0, expected 52, is %d", last_msg.msg.obs_dep_a.obs[6].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].lock == 15074, "incorrect value for last_msg.msg.obs_dep_a.obs[6].lock, expected 15074, is %d", last_msg.msg.obs_dep_a.obs[6].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].prn == 30, "incorrect value for last_msg.msg.obs_dep_a.obs[6].prn, expected 30, is %d", last_msg.msg.obs_dep_a.obs[6].prn); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.n_obs == 32, + "incorrect value for last_msg.msg.obs_dep_a.header.n_obs, " + "expected 32, is %d", + last_msg.msg.obs_dep_a.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.t.tow == 407084800, + "incorrect value for last_msg.msg.obs_dep_a.header.t.tow, " + "expected 407084800, is %d", + last_msg.msg.obs_dep_a.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.t.wn == 1838, + "incorrect value for last_msg.msg.obs_dep_a.header.t.wn, " + "expected 1838, is %d", + last_msg.msg.obs_dep_a.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_a.n_obs == 7, + "incorrect value for last_msg.msg.obs_dep_a.n_obs, expected 7, is %d", + last_msg.msg.obs_dep_a.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.f == 141, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.f, " + "expected 141, is %d", + last_msg.msg.obs_dep_a.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.i == -36207, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.i, " + "expected -36207, is %d", + last_msg.msg.obs_dep_a.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].P == 2046415136, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].P, " + "expected 2046415136, is %d", + last_msg.msg.obs_dep_a.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].cn0 == 45, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].cn0, " + "expected 45, is %d", + last_msg.msg.obs_dep_a.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].lock == 55875, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].lock, " + "expected 55875, is %d", + last_msg.msg.obs_dep_a.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].prn == 0, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].prn, " + "expected 0, is %d", + last_msg.msg.obs_dep_a.obs[0].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.f == 159, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.f, " + "expected 159, is %d", + last_msg.msg.obs_dep_a.obs[1].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.i == 203599, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.i, " + "expected 203599, is %d", + last_msg.msg.obs_dep_a.obs[1].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].P == 2084995249, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].P, " + "expected 2084995249, is %d", + last_msg.msg.obs_dep_a.obs[1].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].cn0 == 44, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].cn0, " + "expected 44, is %d", + last_msg.msg.obs_dep_a.obs[1].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].lock == 40376, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].lock, " + "expected 40376, is %d", + last_msg.msg.obs_dep_a.obs[1].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].prn == 2, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].prn, " + "expected 2, is %d", + last_msg.msg.obs_dep_a.obs[1].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.f == 77, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.f, " + "expected 77, is %d", + last_msg.msg.obs_dep_a.obs[2].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.i == -178769, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.i, " + "expected -178769, is %d", + last_msg.msg.obs_dep_a.obs[2].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].P == 2110097211, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].P, " + "expected 2110097211, is %d", + last_msg.msg.obs_dep_a.obs[2].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].cn0 == 40, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].cn0, " + "expected 40, is %d", + last_msg.msg.obs_dep_a.obs[2].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].lock == 14148, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].lock, " + "expected 14148, is %d", + last_msg.msg.obs_dep_a.obs[2].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].prn == 3, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].prn, " + "expected 3, is %d", + last_msg.msg.obs_dep_a.obs[2].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.f == 20, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.f, " + "expected 20, is %d", + last_msg.msg.obs_dep_a.obs[3].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.i == -137807, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.i, " + "expected -137807, is %d", + last_msg.msg.obs_dep_a.obs[3].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].P == 2208476371, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].P, " + "expected 2208476371, is %d", + last_msg.msg.obs_dep_a.obs[3].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].cn0 == 31, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].cn0, " + "expected 31, is %d", + last_msg.msg.obs_dep_a.obs[3].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].lock == 4129, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].lock, " + "expected 4129, is %d", + last_msg.msg.obs_dep_a.obs[3].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].prn == 10, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].prn, " + "expected 10, is %d", + last_msg.msg.obs_dep_a.obs[3].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.f == 94, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.f, " + "expected 94, is %d", + last_msg.msg.obs_dep_a.obs[4].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.i == -168076, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.i, " + "expected -168076, is %d", + last_msg.msg.obs_dep_a.obs[4].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].P == 2298000000, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].P, " + "expected 2298000000, is %d", + last_msg.msg.obs_dep_a.obs[4].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].cn0 == 21, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].cn0, " + "expected 21, is %d", + last_msg.msg.obs_dep_a.obs[4].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].lock == 18218, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].lock, " + "expected 18218, is %d", + last_msg.msg.obs_dep_a.obs[4].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].prn == 13, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].prn, " + "expected 13, is %d", + last_msg.msg.obs_dep_a.obs[4].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].L.f == 214, + "incorrect value for last_msg.msg.obs_dep_a.obs[5].L.f, " + "expected 214, is %d", + last_msg.msg.obs_dep_a.obs[5].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].L.i == 210469, + "incorrect value for last_msg.msg.obs_dep_a.obs[5].L.i, " + "expected 210469, is %d", + last_msg.msg.obs_dep_a.obs[5].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].P == 2266082742, + "incorrect value for last_msg.msg.obs_dep_a.obs[5].P, " + "expected 2266082742, is %d", + last_msg.msg.obs_dep_a.obs[5].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].cn0 == 27, + "incorrect value for last_msg.msg.obs_dep_a.obs[5].cn0, " + "expected 27, is %d", + last_msg.msg.obs_dep_a.obs[5].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].lock == 63852, + "incorrect value for last_msg.msg.obs_dep_a.obs[5].lock, " + "expected 63852, is %d", + last_msg.msg.obs_dep_a.obs[5].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[5].prn == 22, + "incorrect value for last_msg.msg.obs_dep_a.obs[5].prn, " + "expected 22, is %d", + last_msg.msg.obs_dep_a.obs[5].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].L.f == 129, + "incorrect value for last_msg.msg.obs_dep_a.obs[6].L.f, " + "expected 129, is %d", + last_msg.msg.obs_dep_a.obs[6].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].L.i == -53264, + "incorrect value for last_msg.msg.obs_dep_a.obs[6].L.i, " + "expected -53264, is %d", + last_msg.msg.obs_dep_a.obs[6].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].P == 1987187803, + "incorrect value for last_msg.msg.obs_dep_a.obs[6].P, " + "expected 1987187803, is %d", + last_msg.msg.obs_dep_a.obs[6].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].cn0 == 52, + "incorrect value for last_msg.msg.obs_dep_a.obs[6].cn0, " + "expected 52, is %d", + last_msg.msg.obs_dep_a.obs[6].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].lock == 15074, + "incorrect value for last_msg.msg.obs_dep_a.obs[6].lock, " + "expected 15074, is %d", + last_msg.msg.obs_dep_a.obs[6].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[6].prn == 30, + "incorrect value for last_msg.msg.obs_dep_a.obs[6].prn, " + "expected 30, is %d", + last_msg.msg.obs_dep_a.obs[6].prn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -688,89 +957,116 @@ START_TEST( test_auto_check_sbp_observation_msgObsDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x45, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x45, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,69,0,195,4,20,0,159,67,24,46,7,33,49,19,164,117,120,32,0,0,222,63,62,250,31,11,231, }; + u8 encoded_frame[] = { + 85, 69, 0, 195, 4, 20, 0, 159, 67, 24, 46, 7, 33, 49, + 19, 164, 117, 120, 32, 0, 0, 222, 63, 62, 250, 31, 11, 231, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_a.header.n_obs = 33; - - + test_msg.obs_dep_a.header.t.tow = 407084800; - + test_msg.obs_dep_a.header.t.wn = 1838; - + test_msg.obs_dep_a.n_obs = 1; - - - - + test_msg.obs_dep_a.obs[0].L.f = 222; - + test_msg.obs_dep_a.obs[0].L.i = 8312; - + test_msg.obs_dep_a.obs[0].P = 1973687089; - + test_msg.obs_dep_a.obs[0].cn0 = 63; - + test_msg.obs_dep_a.obs[0].lock = 64062; - + test_msg.obs_dep_a.obs[0].prn = 31; sbp_message_send(&sbp_state, SbpMsgObsDepA, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_a.header.n_obs == 33, "incorrect value for last_msg.msg.obs_dep_a.header.n_obs, expected 33, is %d", last_msg.msg.obs_dep_a.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_a.header.t.tow == 407084800, "incorrect value for last_msg.msg.obs_dep_a.header.t.tow, expected 407084800, is %d", last_msg.msg.obs_dep_a.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_a.header.t.wn == 1838, "incorrect value for last_msg.msg.obs_dep_a.header.t.wn, expected 1838, is %d", last_msg.msg.obs_dep_a.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_a.n_obs == 1, "incorrect value for last_msg.msg.obs_dep_a.n_obs, expected 1, is %d", last_msg.msg.obs_dep_a.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.f == 222, "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.f, expected 222, is %d", last_msg.msg.obs_dep_a.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.i == 8312, "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.i, expected 8312, is %d", last_msg.msg.obs_dep_a.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].P == 1973687089, "incorrect value for last_msg.msg.obs_dep_a.obs[0].P, expected 1973687089, is %d", last_msg.msg.obs_dep_a.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].cn0 == 63, "incorrect value for last_msg.msg.obs_dep_a.obs[0].cn0, expected 63, is %d", last_msg.msg.obs_dep_a.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].lock == 64062, "incorrect value for last_msg.msg.obs_dep_a.obs[0].lock, expected 64062, is %d", last_msg.msg.obs_dep_a.obs[0].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].prn == 31, "incorrect value for last_msg.msg.obs_dep_a.obs[0].prn, expected 31, is %d", last_msg.msg.obs_dep_a.obs[0].prn); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.n_obs == 33, + "incorrect value for last_msg.msg.obs_dep_a.header.n_obs, " + "expected 33, is %d", + last_msg.msg.obs_dep_a.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.t.tow == 407084800, + "incorrect value for last_msg.msg.obs_dep_a.header.t.tow, " + "expected 407084800, is %d", + last_msg.msg.obs_dep_a.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.t.wn == 1838, + "incorrect value for last_msg.msg.obs_dep_a.header.t.wn, " + "expected 1838, is %d", + last_msg.msg.obs_dep_a.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_a.n_obs == 1, + "incorrect value for last_msg.msg.obs_dep_a.n_obs, expected 1, is %d", + last_msg.msg.obs_dep_a.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.f == 222, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.f, " + "expected 222, is %d", + last_msg.msg.obs_dep_a.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.i == 8312, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.i, " + "expected 8312, is %d", + last_msg.msg.obs_dep_a.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].P == 1973687089, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].P, " + "expected 1973687089, is %d", + last_msg.msg.obs_dep_a.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].cn0 == 63, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].cn0, " + "expected 63, is %d", + last_msg.msg.obs_dep_a.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].lock == 64062, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].lock, " + "expected 64062, is %d", + last_msg.msg.obs_dep_a.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].prn == 31, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].prn, " + "expected 31, is %d", + last_msg.msg.obs_dep_a.obs[0].prn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -778,197 +1074,288 @@ START_TEST( test_auto_check_sbp_observation_msgObsDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x45, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x45, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,69,0,195,4,72,96,162,68,24,46,7,16,87,132,217,121,121,148,255,255,189,43,175,147,0,132,64,200,125,106,31,254,255,1,41,14,177,3,128,178,248,136,70,68,254,255,166,18,184,133,13,24,127,178,134,6,25,2,0,249,28,33,96,22,170,104,86,118,67,112,255,255,203,56,208,88,30,43,107, }; + u8 encoded_frame[] = { + 85, 69, 0, 195, 4, 72, 96, 162, 68, 24, 46, 7, 16, 87, + 132, 217, 121, 121, 148, 255, 255, 189, 43, 175, 147, 0, 132, 64, + 200, 125, 106, 31, 254, 255, 1, 41, 14, 177, 3, 128, 178, 248, + 136, 70, 68, 254, 255, 166, 18, 184, 133, 13, 24, 127, 178, 134, + 6, 25, 2, 0, 249, 28, 33, 96, 22, 170, 104, 86, 118, 67, + 112, 255, 255, 203, 56, 208, 88, 30, 43, 107, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_a.header.n_obs = 16; - - + test_msg.obs_dep_a.header.t.tow = 407151200; - + test_msg.obs_dep_a.header.t.wn = 1838; - + test_msg.obs_dep_a.n_obs = 5; - - - - + test_msg.obs_dep_a.obs[0].L.f = 189; - + test_msg.obs_dep_a.obs[0].L.i = -27527; - + test_msg.obs_dep_a.obs[0].P = 2044298327; - + test_msg.obs_dep_a.obs[0].cn0 = 43; - + test_msg.obs_dep_a.obs[0].lock = 37807; - + test_msg.obs_dep_a.obs[0].prn = 0; - - - + test_msg.obs_dep_a.obs[1].L.f = 1; - + test_msg.obs_dep_a.obs[1].L.i = -123030; - + test_msg.obs_dep_a.obs[1].P = 2110275716; - + test_msg.obs_dep_a.obs[1].cn0 = 41; - + test_msg.obs_dep_a.obs[1].lock = 45326; - + test_msg.obs_dep_a.obs[1].prn = 3; - - - + test_msg.obs_dep_a.obs[2].L.f = 166; - + test_msg.obs_dep_a.obs[2].L.i = -113594; - + test_msg.obs_dep_a.obs[2].P = 2298000000; - + test_msg.obs_dep_a.obs[2].cn0 = 18; - + test_msg.obs_dep_a.obs[2].lock = 34232; - + test_msg.obs_dep_a.obs[2].prn = 13; - - - + test_msg.obs_dep_a.obs[3].L.f = 249; - + test_msg.obs_dep_a.obs[3].L.i = 137478; - + test_msg.obs_dep_a.obs[3].P = 2259844888; - + test_msg.obs_dep_a.obs[3].cn0 = 28; - + test_msg.obs_dep_a.obs[3].lock = 24609; - + test_msg.obs_dep_a.obs[3].prn = 22; - - - + test_msg.obs_dep_a.obs[4].L.f = 203; - + test_msg.obs_dep_a.obs[4].L.i = -36797; - + test_msg.obs_dep_a.obs[4].P = 1985374378; - + test_msg.obs_dep_a.obs[4].cn0 = 56; - + test_msg.obs_dep_a.obs[4].lock = 22736; - + test_msg.obs_dep_a.obs[4].prn = 30; sbp_message_send(&sbp_state, SbpMsgObsDepA, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_a.header.n_obs == 16, "incorrect value for last_msg.msg.obs_dep_a.header.n_obs, expected 16, is %d", last_msg.msg.obs_dep_a.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_a.header.t.tow == 407151200, "incorrect value for last_msg.msg.obs_dep_a.header.t.tow, expected 407151200, is %d", last_msg.msg.obs_dep_a.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_a.header.t.wn == 1838, "incorrect value for last_msg.msg.obs_dep_a.header.t.wn, expected 1838, is %d", last_msg.msg.obs_dep_a.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_a.n_obs == 5, "incorrect value for last_msg.msg.obs_dep_a.n_obs, expected 5, is %d", last_msg.msg.obs_dep_a.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.f == 189, "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.f, expected 189, is %d", last_msg.msg.obs_dep_a.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.i == -27527, "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.i, expected -27527, is %d", last_msg.msg.obs_dep_a.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].P == 2044298327, "incorrect value for last_msg.msg.obs_dep_a.obs[0].P, expected 2044298327, is %d", last_msg.msg.obs_dep_a.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].cn0 == 43, "incorrect value for last_msg.msg.obs_dep_a.obs[0].cn0, expected 43, is %d", last_msg.msg.obs_dep_a.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].lock == 37807, "incorrect value for last_msg.msg.obs_dep_a.obs[0].lock, expected 37807, is %d", last_msg.msg.obs_dep_a.obs[0].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].prn == 0, "incorrect value for last_msg.msg.obs_dep_a.obs[0].prn, expected 0, is %d", last_msg.msg.obs_dep_a.obs[0].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.f == 1, "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.f, expected 1, is %d", last_msg.msg.obs_dep_a.obs[1].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.i == -123030, "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.i, expected -123030, is %d", last_msg.msg.obs_dep_a.obs[1].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].P == 2110275716, "incorrect value for last_msg.msg.obs_dep_a.obs[1].P, expected 2110275716, is %d", last_msg.msg.obs_dep_a.obs[1].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].cn0 == 41, "incorrect value for last_msg.msg.obs_dep_a.obs[1].cn0, expected 41, is %d", last_msg.msg.obs_dep_a.obs[1].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].lock == 45326, "incorrect value for last_msg.msg.obs_dep_a.obs[1].lock, expected 45326, is %d", last_msg.msg.obs_dep_a.obs[1].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].prn == 3, "incorrect value for last_msg.msg.obs_dep_a.obs[1].prn, expected 3, is %d", last_msg.msg.obs_dep_a.obs[1].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.f == 166, "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.f, expected 166, is %d", last_msg.msg.obs_dep_a.obs[2].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.i == -113594, "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.i, expected -113594, is %d", last_msg.msg.obs_dep_a.obs[2].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].P == 2298000000, "incorrect value for last_msg.msg.obs_dep_a.obs[2].P, expected 2298000000, is %d", last_msg.msg.obs_dep_a.obs[2].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].cn0 == 18, "incorrect value for last_msg.msg.obs_dep_a.obs[2].cn0, expected 18, is %d", last_msg.msg.obs_dep_a.obs[2].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].lock == 34232, "incorrect value for last_msg.msg.obs_dep_a.obs[2].lock, expected 34232, is %d", last_msg.msg.obs_dep_a.obs[2].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].prn == 13, "incorrect value for last_msg.msg.obs_dep_a.obs[2].prn, expected 13, is %d", last_msg.msg.obs_dep_a.obs[2].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.f == 249, "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.f, expected 249, is %d", last_msg.msg.obs_dep_a.obs[3].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.i == 137478, "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.i, expected 137478, is %d", last_msg.msg.obs_dep_a.obs[3].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].P == 2259844888, "incorrect value for last_msg.msg.obs_dep_a.obs[3].P, expected 2259844888, is %d", last_msg.msg.obs_dep_a.obs[3].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].cn0 == 28, "incorrect value for last_msg.msg.obs_dep_a.obs[3].cn0, expected 28, is %d", last_msg.msg.obs_dep_a.obs[3].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].lock == 24609, "incorrect value for last_msg.msg.obs_dep_a.obs[3].lock, expected 24609, is %d", last_msg.msg.obs_dep_a.obs[3].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].prn == 22, "incorrect value for last_msg.msg.obs_dep_a.obs[3].prn, expected 22, is %d", last_msg.msg.obs_dep_a.obs[3].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.f == 203, "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.f, expected 203, is %d", last_msg.msg.obs_dep_a.obs[4].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.i == -36797, "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.i, expected -36797, is %d", last_msg.msg.obs_dep_a.obs[4].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].P == 1985374378, "incorrect value for last_msg.msg.obs_dep_a.obs[4].P, expected 1985374378, is %d", last_msg.msg.obs_dep_a.obs[4].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].cn0 == 56, "incorrect value for last_msg.msg.obs_dep_a.obs[4].cn0, expected 56, is %d", last_msg.msg.obs_dep_a.obs[4].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].lock == 22736, "incorrect value for last_msg.msg.obs_dep_a.obs[4].lock, expected 22736, is %d", last_msg.msg.obs_dep_a.obs[4].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].prn == 30, "incorrect value for last_msg.msg.obs_dep_a.obs[4].prn, expected 30, is %d", last_msg.msg.obs_dep_a.obs[4].prn); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.n_obs == 16, + "incorrect value for last_msg.msg.obs_dep_a.header.n_obs, " + "expected 16, is %d", + last_msg.msg.obs_dep_a.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.t.tow == 407151200, + "incorrect value for last_msg.msg.obs_dep_a.header.t.tow, " + "expected 407151200, is %d", + last_msg.msg.obs_dep_a.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.t.wn == 1838, + "incorrect value for last_msg.msg.obs_dep_a.header.t.wn, " + "expected 1838, is %d", + last_msg.msg.obs_dep_a.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_a.n_obs == 5, + "incorrect value for last_msg.msg.obs_dep_a.n_obs, expected 5, is %d", + last_msg.msg.obs_dep_a.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.f == 189, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.f, " + "expected 189, is %d", + last_msg.msg.obs_dep_a.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.i == -27527, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.i, " + "expected -27527, is %d", + last_msg.msg.obs_dep_a.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].P == 2044298327, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].P, " + "expected 2044298327, is %d", + last_msg.msg.obs_dep_a.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].cn0 == 43, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].cn0, " + "expected 43, is %d", + last_msg.msg.obs_dep_a.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].lock == 37807, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].lock, " + "expected 37807, is %d", + last_msg.msg.obs_dep_a.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].prn == 0, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].prn, " + "expected 0, is %d", + last_msg.msg.obs_dep_a.obs[0].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.f == 1, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.f, " + "expected 1, is %d", + last_msg.msg.obs_dep_a.obs[1].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.i == -123030, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.i, " + "expected -123030, is %d", + last_msg.msg.obs_dep_a.obs[1].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].P == 2110275716, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].P, " + "expected 2110275716, is %d", + last_msg.msg.obs_dep_a.obs[1].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].cn0 == 41, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].cn0, " + "expected 41, is %d", + last_msg.msg.obs_dep_a.obs[1].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].lock == 45326, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].lock, " + "expected 45326, is %d", + last_msg.msg.obs_dep_a.obs[1].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].prn == 3, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].prn, " + "expected 3, is %d", + last_msg.msg.obs_dep_a.obs[1].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.f == 166, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.f, " + "expected 166, is %d", + last_msg.msg.obs_dep_a.obs[2].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.i == -113594, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.i, " + "expected -113594, is %d", + last_msg.msg.obs_dep_a.obs[2].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].P == 2298000000, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].P, " + "expected 2298000000, is %d", + last_msg.msg.obs_dep_a.obs[2].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].cn0 == 18, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].cn0, " + "expected 18, is %d", + last_msg.msg.obs_dep_a.obs[2].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].lock == 34232, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].lock, " + "expected 34232, is %d", + last_msg.msg.obs_dep_a.obs[2].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].prn == 13, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].prn, " + "expected 13, is %d", + last_msg.msg.obs_dep_a.obs[2].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.f == 249, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.f, " + "expected 249, is %d", + last_msg.msg.obs_dep_a.obs[3].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.i == 137478, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.i, " + "expected 137478, is %d", + last_msg.msg.obs_dep_a.obs[3].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].P == 2259844888, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].P, " + "expected 2259844888, is %d", + last_msg.msg.obs_dep_a.obs[3].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].cn0 == 28, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].cn0, " + "expected 28, is %d", + last_msg.msg.obs_dep_a.obs[3].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].lock == 24609, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].lock, " + "expected 24609, is %d", + last_msg.msg.obs_dep_a.obs[3].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].prn == 22, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].prn, " + "expected 22, is %d", + last_msg.msg.obs_dep_a.obs[3].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.f == 203, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.f, " + "expected 203, is %d", + last_msg.msg.obs_dep_a.obs[4].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.i == -36797, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.i, " + "expected -36797, is %d", + last_msg.msg.obs_dep_a.obs[4].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].P == 1985374378, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].P, " + "expected 1985374378, is %d", + last_msg.msg.obs_dep_a.obs[4].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].cn0 == 56, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].cn0, " + "expected 56, is %d", + last_msg.msg.obs_dep_a.obs[4].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].lock == 22736, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].lock, " + "expected 22736, is %d", + last_msg.msg.obs_dep_a.obs[4].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].prn == 30, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].prn, " + "expected 30, is %d", + last_msg.msg.obs_dep_a.obs[4].prn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -976,200 +1363,291 @@ START_TEST( test_auto_check_sbp_observation_msgObsDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x45, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x45, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,69,0,195,4,72,40,163,68,24,46,7,16,132,107,217,121,14,148,255,255,1,44,175,147,0,129,66,200,125,148,29,254,255,153,41,14,177,3,128,178,248,136,143,66,254,255,222,18,184,133,13,158,53,178,134,42,27,2,0,237,30,33,96,22,38,83,86,118,168,111,255,255,45,56,208,88,30,1,175, }; + u8 encoded_frame[] = { + 85, 69, 0, 195, 4, 72, 40, 163, 68, 24, 46, 7, 16, 132, + 107, 217, 121, 14, 148, 255, 255, 1, 44, 175, 147, 0, 129, 66, + 200, 125, 148, 29, 254, 255, 153, 41, 14, 177, 3, 128, 178, 248, + 136, 143, 66, 254, 255, 222, 18, 184, 133, 13, 158, 53, 178, 134, + 42, 27, 2, 0, 237, 30, 33, 96, 22, 38, 83, 86, 118, 168, + 111, 255, 255, 45, 56, 208, 88, 30, 1, 175, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.obs_dep_a.header.n_obs = 16; - - + test_msg.obs_dep_a.header.t.tow = 407151400; - + test_msg.obs_dep_a.header.t.wn = 1838; - + test_msg.obs_dep_a.n_obs = 5; - - - - + test_msg.obs_dep_a.obs[0].L.f = 1; - + test_msg.obs_dep_a.obs[0].L.i = -27634; - + test_msg.obs_dep_a.obs[0].P = 2044291972; - + test_msg.obs_dep_a.obs[0].cn0 = 44; - + test_msg.obs_dep_a.obs[0].lock = 37807; - + test_msg.obs_dep_a.obs[0].prn = 0; - - - + test_msg.obs_dep_a.obs[1].L.f = 153; - + test_msg.obs_dep_a.obs[1].L.i = -123500; - + test_msg.obs_dep_a.obs[1].P = 2110276225; - + test_msg.obs_dep_a.obs[1].cn0 = 41; - + test_msg.obs_dep_a.obs[1].lock = 45326; - + test_msg.obs_dep_a.obs[1].prn = 3; - - - + test_msg.obs_dep_a.obs[2].L.f = 222; - + test_msg.obs_dep_a.obs[2].L.i = -114033; - + test_msg.obs_dep_a.obs[2].P = 2298000000; - + test_msg.obs_dep_a.obs[2].cn0 = 18; - + test_msg.obs_dep_a.obs[2].lock = 34232; - + test_msg.obs_dep_a.obs[2].prn = 13; - - - + test_msg.obs_dep_a.obs[3].L.f = 237; - + test_msg.obs_dep_a.obs[3].L.i = 138026; - + test_msg.obs_dep_a.obs[3].P = 2259826078; - + test_msg.obs_dep_a.obs[3].cn0 = 30; - + test_msg.obs_dep_a.obs[3].lock = 24609; - + test_msg.obs_dep_a.obs[3].prn = 22; - - - + test_msg.obs_dep_a.obs[4].L.f = 45; - + test_msg.obs_dep_a.obs[4].L.i = -36952; - + test_msg.obs_dep_a.obs[4].P = 1985368870; - + test_msg.obs_dep_a.obs[4].cn0 = 56; - + test_msg.obs_dep_a.obs[4].lock = 22736; - + test_msg.obs_dep_a.obs[4].prn = 30; sbp_message_send(&sbp_state, SbpMsgObsDepA, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgObsDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.obs_dep_a.header.n_obs == 16, "incorrect value for last_msg.msg.obs_dep_a.header.n_obs, expected 16, is %d", last_msg.msg.obs_dep_a.header.n_obs); - - - ck_assert_msg(last_msg.msg.obs_dep_a.header.t.tow == 407151400, "incorrect value for last_msg.msg.obs_dep_a.header.t.tow, expected 407151400, is %d", last_msg.msg.obs_dep_a.header.t.tow); - - ck_assert_msg(last_msg.msg.obs_dep_a.header.t.wn == 1838, "incorrect value for last_msg.msg.obs_dep_a.header.t.wn, expected 1838, is %d", last_msg.msg.obs_dep_a.header.t.wn); - - ck_assert_msg(last_msg.msg.obs_dep_a.n_obs == 5, "incorrect value for last_msg.msg.obs_dep_a.n_obs, expected 5, is %d", last_msg.msg.obs_dep_a.n_obs); - - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.f == 1, "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.f, expected 1, is %d", last_msg.msg.obs_dep_a.obs[0].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.i == -27634, "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.i, expected -27634, is %d", last_msg.msg.obs_dep_a.obs[0].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].P == 2044291972, "incorrect value for last_msg.msg.obs_dep_a.obs[0].P, expected 2044291972, is %d", last_msg.msg.obs_dep_a.obs[0].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].cn0 == 44, "incorrect value for last_msg.msg.obs_dep_a.obs[0].cn0, expected 44, is %d", last_msg.msg.obs_dep_a.obs[0].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].lock == 37807, "incorrect value for last_msg.msg.obs_dep_a.obs[0].lock, expected 37807, is %d", last_msg.msg.obs_dep_a.obs[0].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].prn == 0, "incorrect value for last_msg.msg.obs_dep_a.obs[0].prn, expected 0, is %d", last_msg.msg.obs_dep_a.obs[0].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.f == 153, "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.f, expected 153, is %d", last_msg.msg.obs_dep_a.obs[1].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.i == -123500, "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.i, expected -123500, is %d", last_msg.msg.obs_dep_a.obs[1].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].P == 2110276225, "incorrect value for last_msg.msg.obs_dep_a.obs[1].P, expected 2110276225, is %d", last_msg.msg.obs_dep_a.obs[1].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].cn0 == 41, "incorrect value for last_msg.msg.obs_dep_a.obs[1].cn0, expected 41, is %d", last_msg.msg.obs_dep_a.obs[1].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].lock == 45326, "incorrect value for last_msg.msg.obs_dep_a.obs[1].lock, expected 45326, is %d", last_msg.msg.obs_dep_a.obs[1].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].prn == 3, "incorrect value for last_msg.msg.obs_dep_a.obs[1].prn, expected 3, is %d", last_msg.msg.obs_dep_a.obs[1].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.f == 222, "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.f, expected 222, is %d", last_msg.msg.obs_dep_a.obs[2].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.i == -114033, "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.i, expected -114033, is %d", last_msg.msg.obs_dep_a.obs[2].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].P == 2298000000, "incorrect value for last_msg.msg.obs_dep_a.obs[2].P, expected 2298000000, is %d", last_msg.msg.obs_dep_a.obs[2].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].cn0 == 18, "incorrect value for last_msg.msg.obs_dep_a.obs[2].cn0, expected 18, is %d", last_msg.msg.obs_dep_a.obs[2].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].lock == 34232, "incorrect value for last_msg.msg.obs_dep_a.obs[2].lock, expected 34232, is %d", last_msg.msg.obs_dep_a.obs[2].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].prn == 13, "incorrect value for last_msg.msg.obs_dep_a.obs[2].prn, expected 13, is %d", last_msg.msg.obs_dep_a.obs[2].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.f == 237, "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.f, expected 237, is %d", last_msg.msg.obs_dep_a.obs[3].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.i == 138026, "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.i, expected 138026, is %d", last_msg.msg.obs_dep_a.obs[3].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].P == 2259826078, "incorrect value for last_msg.msg.obs_dep_a.obs[3].P, expected 2259826078, is %d", last_msg.msg.obs_dep_a.obs[3].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].cn0 == 30, "incorrect value for last_msg.msg.obs_dep_a.obs[3].cn0, expected 30, is %d", last_msg.msg.obs_dep_a.obs[3].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].lock == 24609, "incorrect value for last_msg.msg.obs_dep_a.obs[3].lock, expected 24609, is %d", last_msg.msg.obs_dep_a.obs[3].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].prn == 22, "incorrect value for last_msg.msg.obs_dep_a.obs[3].prn, expected 22, is %d", last_msg.msg.obs_dep_a.obs[3].prn); - - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.f == 45, "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.f, expected 45, is %d", last_msg.msg.obs_dep_a.obs[4].L.f); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.i == -36952, "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.i, expected -36952, is %d", last_msg.msg.obs_dep_a.obs[4].L.i); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].P == 1985368870, "incorrect value for last_msg.msg.obs_dep_a.obs[4].P, expected 1985368870, is %d", last_msg.msg.obs_dep_a.obs[4].P); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].cn0 == 56, "incorrect value for last_msg.msg.obs_dep_a.obs[4].cn0, expected 56, is %d", last_msg.msg.obs_dep_a.obs[4].cn0); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].lock == 22736, "incorrect value for last_msg.msg.obs_dep_a.obs[4].lock, expected 22736, is %d", last_msg.msg.obs_dep_a.obs[4].lock); - - ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].prn == 30, "incorrect value for last_msg.msg.obs_dep_a.obs[4].prn, expected 30, is %d", last_msg.msg.obs_dep_a.obs[4].prn); - + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.n_obs == 16, + "incorrect value for last_msg.msg.obs_dep_a.header.n_obs, " + "expected 16, is %d", + last_msg.msg.obs_dep_a.header.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.t.tow == 407151400, + "incorrect value for last_msg.msg.obs_dep_a.header.t.tow, " + "expected 407151400, is %d", + last_msg.msg.obs_dep_a.header.t.tow); + + ck_assert_msg(last_msg.msg.obs_dep_a.header.t.wn == 1838, + "incorrect value for last_msg.msg.obs_dep_a.header.t.wn, " + "expected 1838, is %d", + last_msg.msg.obs_dep_a.header.t.wn); + + ck_assert_msg( + last_msg.msg.obs_dep_a.n_obs == 5, + "incorrect value for last_msg.msg.obs_dep_a.n_obs, expected 5, is %d", + last_msg.msg.obs_dep_a.n_obs); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.f == 1, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.f, " + "expected 1, is %d", + last_msg.msg.obs_dep_a.obs[0].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].L.i == -27634, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].L.i, " + "expected -27634, is %d", + last_msg.msg.obs_dep_a.obs[0].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].P == 2044291972, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].P, " + "expected 2044291972, is %d", + last_msg.msg.obs_dep_a.obs[0].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].cn0 == 44, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].cn0, " + "expected 44, is %d", + last_msg.msg.obs_dep_a.obs[0].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].lock == 37807, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].lock, " + "expected 37807, is %d", + last_msg.msg.obs_dep_a.obs[0].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[0].prn == 0, + "incorrect value for last_msg.msg.obs_dep_a.obs[0].prn, " + "expected 0, is %d", + last_msg.msg.obs_dep_a.obs[0].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.f == 153, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.f, " + "expected 153, is %d", + last_msg.msg.obs_dep_a.obs[1].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].L.i == -123500, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].L.i, " + "expected -123500, is %d", + last_msg.msg.obs_dep_a.obs[1].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].P == 2110276225, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].P, " + "expected 2110276225, is %d", + last_msg.msg.obs_dep_a.obs[1].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].cn0 == 41, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].cn0, " + "expected 41, is %d", + last_msg.msg.obs_dep_a.obs[1].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].lock == 45326, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].lock, " + "expected 45326, is %d", + last_msg.msg.obs_dep_a.obs[1].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[1].prn == 3, + "incorrect value for last_msg.msg.obs_dep_a.obs[1].prn, " + "expected 3, is %d", + last_msg.msg.obs_dep_a.obs[1].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.f == 222, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.f, " + "expected 222, is %d", + last_msg.msg.obs_dep_a.obs[2].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].L.i == -114033, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].L.i, " + "expected -114033, is %d", + last_msg.msg.obs_dep_a.obs[2].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].P == 2298000000, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].P, " + "expected 2298000000, is %d", + last_msg.msg.obs_dep_a.obs[2].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].cn0 == 18, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].cn0, " + "expected 18, is %d", + last_msg.msg.obs_dep_a.obs[2].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].lock == 34232, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].lock, " + "expected 34232, is %d", + last_msg.msg.obs_dep_a.obs[2].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[2].prn == 13, + "incorrect value for last_msg.msg.obs_dep_a.obs[2].prn, " + "expected 13, is %d", + last_msg.msg.obs_dep_a.obs[2].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.f == 237, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.f, " + "expected 237, is %d", + last_msg.msg.obs_dep_a.obs[3].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].L.i == 138026, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].L.i, " + "expected 138026, is %d", + last_msg.msg.obs_dep_a.obs[3].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].P == 2259826078, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].P, " + "expected 2259826078, is %d", + last_msg.msg.obs_dep_a.obs[3].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].cn0 == 30, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].cn0, " + "expected 30, is %d", + last_msg.msg.obs_dep_a.obs[3].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].lock == 24609, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].lock, " + "expected 24609, is %d", + last_msg.msg.obs_dep_a.obs[3].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[3].prn == 22, + "incorrect value for last_msg.msg.obs_dep_a.obs[3].prn, " + "expected 22, is %d", + last_msg.msg.obs_dep_a.obs[3].prn); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.f == 45, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.f, " + "expected 45, is %d", + last_msg.msg.obs_dep_a.obs[4].L.f); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].L.i == -36952, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].L.i, " + "expected -36952, is %d", + last_msg.msg.obs_dep_a.obs[4].L.i); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].P == 1985368870, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].P, " + "expected 1985368870, is %d", + last_msg.msg.obs_dep_a.obs[4].P); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].cn0 == 56, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].cn0, " + "expected 56, is %d", + last_msg.msg.obs_dep_a.obs[4].cn0); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].lock == 22736, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].lock, " + "expected 22736, is %d", + last_msg.msg.obs_dep_a.obs[4].lock); + + ck_assert_msg(last_msg.msg.obs_dep_a.obs[4].prn == 30, + "incorrect value for last_msg.msg.obs_dep_a.obs[4].prn, " + "expected 30, is %d", + last_msg.msg.obs_dep_a.obs[4].prn); } } END_TEST -Suite* auto_check_sbp_observation_msgObsDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_observation_msgObsDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_observation_msgObsDepA"); +Suite *auto_check_sbp_observation_msgObsDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_observation_msgObsDepA"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_observation_msgObsDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_observation_msgObsDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_orientation_MsgAngularRate.c b/c/test/auto_check_sbp_orientation_MsgAngularRate.c index c0f1997de..5d2a9e8b0 100644 --- a/c/test/auto_check_sbp_orientation_MsgAngularRate.c +++ b/c/test/auto_check_sbp_orientation_MsgAngularRate.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgAngularRate.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgAngularRate.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_orientation_MsgAngularRate ) -{ +START_TEST(test_auto_check_sbp_orientation_MsgAngularRate) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_orientation_MsgAngularRate ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,63 +90,86 @@ START_TEST( test_auto_check_sbp_orientation_MsgAngularRate ) logging_reset(); - sbp_callback_register(&sbp_state, 0x222, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x222, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,34,2,66,0,17,2,0,0,0,2,0,0,0,5,0,0,0,2,0,0,0,0,88,70, }; + u8 encoded_frame[] = { + 85, 34, 2, 66, 0, 17, 2, 0, 0, 0, 2, 0, 0, + 0, 5, 0, 0, 0, 2, 0, 0, 0, 0, 88, 70, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.angular_rate.flags = 0; - + test_msg.angular_rate.tow = 2; - + test_msg.angular_rate.x = 2; - + test_msg.angular_rate.y = 5; - + test_msg.angular_rate.z = 2; - sbp_message_send(&sbp_state, SbpMsgAngularRate, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgAngularRate, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgAngularRate, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgAngularRate, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.angular_rate.flags == 0, "incorrect value for last_msg.msg.angular_rate.flags, expected 0, is %d", last_msg.msg.angular_rate.flags); - - ck_assert_msg(last_msg.msg.angular_rate.tow == 2, "incorrect value for last_msg.msg.angular_rate.tow, expected 2, is %d", last_msg.msg.angular_rate.tow); - - ck_assert_msg(last_msg.msg.angular_rate.x == 2, "incorrect value for last_msg.msg.angular_rate.x, expected 2, is %d", last_msg.msg.angular_rate.x); - - ck_assert_msg(last_msg.msg.angular_rate.y == 5, "incorrect value for last_msg.msg.angular_rate.y, expected 5, is %d", last_msg.msg.angular_rate.y); - - ck_assert_msg(last_msg.msg.angular_rate.z == 2, "incorrect value for last_msg.msg.angular_rate.z, expected 2, is %d", last_msg.msg.angular_rate.z); + ck_assert_msg(last_msg.msg.angular_rate.flags == 0, + "incorrect value for last_msg.msg.angular_rate.flags, " + "expected 0, is %d", + last_msg.msg.angular_rate.flags); + + ck_assert_msg( + last_msg.msg.angular_rate.tow == 2, + "incorrect value for last_msg.msg.angular_rate.tow, expected 2, is %d", + last_msg.msg.angular_rate.tow); + + ck_assert_msg( + last_msg.msg.angular_rate.x == 2, + "incorrect value for last_msg.msg.angular_rate.x, expected 2, is %d", + last_msg.msg.angular_rate.x); + + ck_assert_msg( + last_msg.msg.angular_rate.y == 5, + "incorrect value for last_msg.msg.angular_rate.y, expected 5, is %d", + last_msg.msg.angular_rate.y); + + ck_assert_msg( + last_msg.msg.angular_rate.z == 2, + "incorrect value for last_msg.msg.angular_rate.z, expected 2, is %d", + last_msg.msg.angular_rate.z); } } END_TEST -Suite* auto_check_sbp_orientation_MsgAngularRate_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_orientation_MsgAngularRate"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_orientation_MsgAngularRate"); +Suite *auto_check_sbp_orientation_MsgAngularRate_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_orientation_MsgAngularRate"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_orientation_MsgAngularRate"); tcase_add_test(tc_acq, test_auto_check_sbp_orientation_MsgAngularRate); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_orientation_MsgBaselineHeading.c b/c/test/auto_check_sbp_orientation_MsgBaselineHeading.c index f193ca6df..dbbddde29 100644 --- a/c/test/auto_check_sbp_orientation_MsgBaselineHeading.c +++ b/c/test/auto_check_sbp_orientation_MsgBaselineHeading.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgBaselineHeading.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgBaselineHeading.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_orientation_MsgBaselineHeading ) -{ +START_TEST(test_auto_check_sbp_orientation_MsgBaselineHeading) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_orientation_MsgBaselineHeading ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,59 +90,80 @@ START_TEST( test_auto_check_sbp_orientation_MsgBaselineHeading ) logging_reset(); - sbp_callback_register(&sbp_state, 0x20f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x20f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,15,2,211,93,10,156,45,13,196,44,84,197,61,91,91,224,254, }; + u8 encoded_frame[] = { + 85, 15, 2, 211, 93, 10, 156, 45, 13, + 196, 44, 84, 197, 61, 91, 91, 224, 254, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.baseline_heading.flags = 91; - + test_msg.baseline_heading.heading = 1036342316; - + test_msg.baseline_heading.n_sats = 91; - + test_msg.baseline_heading.tow = 3289197980; - sbp_message_send(&sbp_state, SbpMsgBaselineHeading, 24019, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgBaselineHeading, 24019, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 24019, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgBaselineHeading, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgBaselineHeading, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.baseline_heading.flags == 91, "incorrect value for last_msg.msg.baseline_heading.flags, expected 91, is %d", last_msg.msg.baseline_heading.flags); - - ck_assert_msg(last_msg.msg.baseline_heading.heading == 1036342316, "incorrect value for last_msg.msg.baseline_heading.heading, expected 1036342316, is %d", last_msg.msg.baseline_heading.heading); - - ck_assert_msg(last_msg.msg.baseline_heading.n_sats == 91, "incorrect value for last_msg.msg.baseline_heading.n_sats, expected 91, is %d", last_msg.msg.baseline_heading.n_sats); - - ck_assert_msg(last_msg.msg.baseline_heading.tow == 3289197980, "incorrect value for last_msg.msg.baseline_heading.tow, expected 3289197980, is %d", last_msg.msg.baseline_heading.tow); + ck_assert_msg(last_msg.msg.baseline_heading.flags == 91, + "incorrect value for last_msg.msg.baseline_heading.flags, " + "expected 91, is %d", + last_msg.msg.baseline_heading.flags); + + ck_assert_msg(last_msg.msg.baseline_heading.heading == 1036342316, + "incorrect value for last_msg.msg.baseline_heading.heading, " + "expected 1036342316, is %d", + last_msg.msg.baseline_heading.heading); + + ck_assert_msg(last_msg.msg.baseline_heading.n_sats == 91, + "incorrect value for last_msg.msg.baseline_heading.n_sats, " + "expected 91, is %d", + last_msg.msg.baseline_heading.n_sats); + + ck_assert_msg(last_msg.msg.baseline_heading.tow == 3289197980, + "incorrect value for last_msg.msg.baseline_heading.tow, " + "expected 3289197980, is %d", + last_msg.msg.baseline_heading.tow); } } END_TEST -Suite* auto_check_sbp_orientation_MsgBaselineHeading_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_orientation_MsgBaselineHeading"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_orientation_MsgBaselineHeading"); +Suite *auto_check_sbp_orientation_MsgBaselineHeading_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_orientation_MsgBaselineHeading"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_orientation_MsgBaselineHeading"); tcase_add_test(tc_acq, test_auto_check_sbp_orientation_MsgBaselineHeading); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_orientation_MsgOrientEuler.c b/c/test/auto_check_sbp_orientation_MsgOrientEuler.c index 9db173ed0..bb8d6ab4c 100644 --- a/c/test/auto_check_sbp_orientation_MsgOrientEuler.c +++ b/c/test/auto_check_sbp_orientation_MsgOrientEuler.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientEuler.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientEuler.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_orientation_MsgOrientEuler ) -{ +START_TEST(test_auto_check_sbp_orientation_MsgOrientEuler) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_orientation_MsgOrientEuler ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,75 +90,110 @@ START_TEST( test_auto_check_sbp_orientation_MsgOrientEuler ) logging_reset(); - sbp_callback_register(&sbp_state, 0x221, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x221, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,33,2,66,0,29,1,0,0,0,1,0,0,0,2,0,0,0,8,0,0,0,0,0,224,64,0,0,64,64,0,0,224,64,3,44,226, }; + u8 encoded_frame[] = { + 85, 33, 2, 66, 0, 29, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 8, + 0, 0, 0, 0, 0, 224, 64, 0, 0, 64, 64, 0, 0, 224, 64, 3, 44, 226, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.orient_euler.flags = 3; - + test_msg.orient_euler.pitch = 2; - + test_msg.orient_euler.pitch_accuracy = 3.0; - + test_msg.orient_euler.roll = 1; - + test_msg.orient_euler.roll_accuracy = 7.0; - + test_msg.orient_euler.tow = 1; - + test_msg.orient_euler.yaw = 8; - + test_msg.orient_euler.yaw_accuracy = 7.0; - sbp_message_send(&sbp_state, SbpMsgOrientEuler, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgOrientEuler, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgOrientEuler, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgOrientEuler, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.orient_euler.flags == 3, "incorrect value for last_msg.msg.orient_euler.flags, expected 3, is %d", last_msg.msg.orient_euler.flags); - - ck_assert_msg(last_msg.msg.orient_euler.pitch == 2, "incorrect value for last_msg.msg.orient_euler.pitch, expected 2, is %d", last_msg.msg.orient_euler.pitch); - - ck_assert_msg((last_msg.msg.orient_euler.pitch_accuracy * 100 - 3.0 * 100) < 0.05, "incorrect value for last_msg.msg.orient_euler.pitch_accuracy, expected 3.0, is %s", last_msg.msg.orient_euler.pitch_accuracy); - - ck_assert_msg(last_msg.msg.orient_euler.roll == 1, "incorrect value for last_msg.msg.orient_euler.roll, expected 1, is %d", last_msg.msg.orient_euler.roll); - - ck_assert_msg((last_msg.msg.orient_euler.roll_accuracy * 100 - 7.0 * 100) < 0.05, "incorrect value for last_msg.msg.orient_euler.roll_accuracy, expected 7.0, is %s", last_msg.msg.orient_euler.roll_accuracy); - - ck_assert_msg(last_msg.msg.orient_euler.tow == 1, "incorrect value for last_msg.msg.orient_euler.tow, expected 1, is %d", last_msg.msg.orient_euler.tow); - - ck_assert_msg(last_msg.msg.orient_euler.yaw == 8, "incorrect value for last_msg.msg.orient_euler.yaw, expected 8, is %d", last_msg.msg.orient_euler.yaw); - - ck_assert_msg((last_msg.msg.orient_euler.yaw_accuracy * 100 - 7.0 * 100) < 0.05, "incorrect value for last_msg.msg.orient_euler.yaw_accuracy, expected 7.0, is %s", last_msg.msg.orient_euler.yaw_accuracy); + ck_assert_msg(last_msg.msg.orient_euler.flags == 3, + "incorrect value for last_msg.msg.orient_euler.flags, " + "expected 3, is %d", + last_msg.msg.orient_euler.flags); + + ck_assert_msg(last_msg.msg.orient_euler.pitch == 2, + "incorrect value for last_msg.msg.orient_euler.pitch, " + "expected 2, is %d", + last_msg.msg.orient_euler.pitch); + + ck_assert_msg( + (last_msg.msg.orient_euler.pitch_accuracy * 100 - 3.0 * 100) < 0.05, + "incorrect value for last_msg.msg.orient_euler.pitch_accuracy, " + "expected 3.0, is %s", + last_msg.msg.orient_euler.pitch_accuracy); + + ck_assert_msg( + last_msg.msg.orient_euler.roll == 1, + "incorrect value for last_msg.msg.orient_euler.roll, expected 1, is %d", + last_msg.msg.orient_euler.roll); + + ck_assert_msg( + (last_msg.msg.orient_euler.roll_accuracy * 100 - 7.0 * 100) < 0.05, + "incorrect value for last_msg.msg.orient_euler.roll_accuracy, expected " + "7.0, is %s", + last_msg.msg.orient_euler.roll_accuracy); + + ck_assert_msg( + last_msg.msg.orient_euler.tow == 1, + "incorrect value for last_msg.msg.orient_euler.tow, expected 1, is %d", + last_msg.msg.orient_euler.tow); + + ck_assert_msg( + last_msg.msg.orient_euler.yaw == 8, + "incorrect value for last_msg.msg.orient_euler.yaw, expected 8, is %d", + last_msg.msg.orient_euler.yaw); + + ck_assert_msg( + (last_msg.msg.orient_euler.yaw_accuracy * 100 - 7.0 * 100) < 0.05, + "incorrect value for last_msg.msg.orient_euler.yaw_accuracy, expected " + "7.0, is %s", + last_msg.msg.orient_euler.yaw_accuracy); } } END_TEST -Suite* auto_check_sbp_orientation_MsgOrientEuler_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_orientation_MsgOrientEuler"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_orientation_MsgOrientEuler"); +Suite *auto_check_sbp_orientation_MsgOrientEuler_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_orientation_MsgOrientEuler"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_orientation_MsgOrientEuler"); tcase_add_test(tc_acq, test_auto_check_sbp_orientation_MsgOrientEuler); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_orientation_MsgOrientQuat.c b/c/test/auto_check_sbp_orientation_MsgOrientQuat.c index a3dc21566..f9bed859f 100644 --- a/c/test/auto_check_sbp_orientation_MsgOrientQuat.c +++ b/c/test/auto_check_sbp_orientation_MsgOrientQuat.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientQuat.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientQuat.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_orientation_MsgOrientQuat ) -{ +START_TEST(test_auto_check_sbp_orientation_MsgOrientQuat) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_orientation_MsgOrientQuat ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,83 +90,125 @@ START_TEST( test_auto_check_sbp_orientation_MsgOrientQuat ) logging_reset(); - sbp_callback_register(&sbp_state, 0x220, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x220, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,32,2,66,0,37,0,0,0,0,3,0,0,0,7,0,0,0,8,0,0,0,4,0,0,0,0,0,64,64,0,0,128,64,0,0,0,65,0,0,64,64,1,186,6, }; + u8 encoded_frame[] = { + 85, 32, 2, 66, 0, 37, 0, 0, 0, 0, 3, 0, 0, 0, 7, + 0, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0, 0, 0, 64, 64, + 0, 0, 128, 64, 0, 0, 0, 65, 0, 0, 64, 64, 1, 186, 6, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.orient_quat.flags = 1; - + test_msg.orient_quat.tow = 0; - + test_msg.orient_quat.w = 3; - + test_msg.orient_quat.w_accuracy = 3.0; - + test_msg.orient_quat.x = 7; - + test_msg.orient_quat.x_accuracy = 4.0; - + test_msg.orient_quat.y = 8; - + test_msg.orient_quat.y_accuracy = 8.0; - + test_msg.orient_quat.z = 4; - + test_msg.orient_quat.z_accuracy = 3.0; sbp_message_send(&sbp_state, SbpMsgOrientQuat, 66, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgOrientQuat, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgOrientQuat, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.orient_quat.flags == 1, "incorrect value for last_msg.msg.orient_quat.flags, expected 1, is %d", last_msg.msg.orient_quat.flags); - - ck_assert_msg(last_msg.msg.orient_quat.tow == 0, "incorrect value for last_msg.msg.orient_quat.tow, expected 0, is %d", last_msg.msg.orient_quat.tow); - - ck_assert_msg(last_msg.msg.orient_quat.w == 3, "incorrect value for last_msg.msg.orient_quat.w, expected 3, is %d", last_msg.msg.orient_quat.w); - - ck_assert_msg((last_msg.msg.orient_quat.w_accuracy * 100 - 3.0 * 100) < 0.05, "incorrect value for last_msg.msg.orient_quat.w_accuracy, expected 3.0, is %s", last_msg.msg.orient_quat.w_accuracy); - - ck_assert_msg(last_msg.msg.orient_quat.x == 7, "incorrect value for last_msg.msg.orient_quat.x, expected 7, is %d", last_msg.msg.orient_quat.x); - - ck_assert_msg((last_msg.msg.orient_quat.x_accuracy * 100 - 4.0 * 100) < 0.05, "incorrect value for last_msg.msg.orient_quat.x_accuracy, expected 4.0, is %s", last_msg.msg.orient_quat.x_accuracy); - - ck_assert_msg(last_msg.msg.orient_quat.y == 8, "incorrect value for last_msg.msg.orient_quat.y, expected 8, is %d", last_msg.msg.orient_quat.y); - - ck_assert_msg((last_msg.msg.orient_quat.y_accuracy * 100 - 8.0 * 100) < 0.05, "incorrect value for last_msg.msg.orient_quat.y_accuracy, expected 8.0, is %s", last_msg.msg.orient_quat.y_accuracy); - - ck_assert_msg(last_msg.msg.orient_quat.z == 4, "incorrect value for last_msg.msg.orient_quat.z, expected 4, is %d", last_msg.msg.orient_quat.z); - - ck_assert_msg((last_msg.msg.orient_quat.z_accuracy * 100 - 3.0 * 100) < 0.05, "incorrect value for last_msg.msg.orient_quat.z_accuracy, expected 3.0, is %s", last_msg.msg.orient_quat.z_accuracy); + ck_assert_msg( + last_msg.msg.orient_quat.flags == 1, + "incorrect value for last_msg.msg.orient_quat.flags, expected 1, is %d", + last_msg.msg.orient_quat.flags); + + ck_assert_msg( + last_msg.msg.orient_quat.tow == 0, + "incorrect value for last_msg.msg.orient_quat.tow, expected 0, is %d", + last_msg.msg.orient_quat.tow); + + ck_assert_msg( + last_msg.msg.orient_quat.w == 3, + "incorrect value for last_msg.msg.orient_quat.w, expected 3, is %d", + last_msg.msg.orient_quat.w); + + ck_assert_msg( + (last_msg.msg.orient_quat.w_accuracy * 100 - 3.0 * 100) < 0.05, + "incorrect value for last_msg.msg.orient_quat.w_accuracy, expected " + "3.0, is %s", + last_msg.msg.orient_quat.w_accuracy); + + ck_assert_msg( + last_msg.msg.orient_quat.x == 7, + "incorrect value for last_msg.msg.orient_quat.x, expected 7, is %d", + last_msg.msg.orient_quat.x); + + ck_assert_msg( + (last_msg.msg.orient_quat.x_accuracy * 100 - 4.0 * 100) < 0.05, + "incorrect value for last_msg.msg.orient_quat.x_accuracy, expected " + "4.0, is %s", + last_msg.msg.orient_quat.x_accuracy); + + ck_assert_msg( + last_msg.msg.orient_quat.y == 8, + "incorrect value for last_msg.msg.orient_quat.y, expected 8, is %d", + last_msg.msg.orient_quat.y); + + ck_assert_msg( + (last_msg.msg.orient_quat.y_accuracy * 100 - 8.0 * 100) < 0.05, + "incorrect value for last_msg.msg.orient_quat.y_accuracy, expected " + "8.0, is %s", + last_msg.msg.orient_quat.y_accuracy); + + ck_assert_msg( + last_msg.msg.orient_quat.z == 4, + "incorrect value for last_msg.msg.orient_quat.z, expected 4, is %d", + last_msg.msg.orient_quat.z); + + ck_assert_msg( + (last_msg.msg.orient_quat.z_accuracy * 100 - 3.0 * 100) < 0.05, + "incorrect value for last_msg.msg.orient_quat.z_accuracy, expected " + "3.0, is %s", + last_msg.msg.orient_quat.z_accuracy); } } END_TEST -Suite* auto_check_sbp_orientation_MsgOrientQuat_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_orientation_MsgOrientQuat"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_orientation_MsgOrientQuat"); +Suite *auto_check_sbp_orientation_MsgOrientQuat_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_orientation_MsgOrientQuat"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_orientation_MsgOrientQuat"); tcase_add_test(tc_acq, test_auto_check_sbp_orientation_MsgOrientQuat); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgAlmanac.c b/c/test/auto_check_sbp_piksi_MsgAlmanac.c index 3ad2f54b8..6520e72d6 100644 --- a/c/test/auto_check_sbp_piksi_MsgAlmanac.c +++ b/c/test/auto_check_sbp_piksi_MsgAlmanac.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgAlmanac.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgAlmanac.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgAlmanac ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgAlmanac) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgAlmanac ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,9 +90,12 @@ START_TEST( test_auto_check_sbp_piksi_MsgAlmanac ) logging_reset(); - sbp_callback_register(&sbp_state, 0x69, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x69, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,105,0,108,138,0,249,171, }; + u8 encoded_frame[] = { + 85, 105, 0, 108, 138, 0, 249, 171, + }; dummy_reset(); @@ -106,31 +105,33 @@ START_TEST( test_auto_check_sbp_piksi_MsgAlmanac ) sbp_message_send(&sbp_state, SbpMsgAlmanac, 35436, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35436, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgAlmanac, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - + "Sent and received messages did not compare equal"); } } END_TEST -Suite* auto_check_sbp_piksi_MsgAlmanac_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgAlmanac"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgAlmanac"); +Suite *auto_check_sbp_piksi_MsgAlmanac_suite(void) { + Suite *s = + suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgAlmanac"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgAlmanac"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgAlmanac); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgCellModemStatus.c b/c/test/auto_check_sbp_piksi_MsgCellModemStatus.c index f0fcecdf7..97aedc95f 100644 --- a/c/test/auto_check_sbp_piksi_MsgCellModemStatus.c +++ b/c/test/auto_check_sbp_piksi_MsgCellModemStatus.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCellModemStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCellModemStatus.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgCellModemStatus ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgCellModemStatus) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgCellModemStatus ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,807 +90,1844 @@ START_TEST( test_auto_check_sbp_piksi_MsgCellModemStatus ) logging_reset(); - sbp_callback_register(&sbp_state, 0xbe, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xbe, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,190,0,19,27,255,103,205,48,6,70,123,242,46,52,64,176,154,98,43,132,196,89,253,161,250,174,204,110,47,38,187,63,102,177,162,49,80,194,37,107,60,225,52,101,178,142,246,21,17,93,75,169,86,16,209,80,243,30,206,220,206,115,47,154,91,227,88,11,1,85,146,100,190,232,207,61,61,201,220,31,78,34,57,82,59,104,65,221,0,43,210,9,32,122,29,237,11,151,223,18,81,204,172,234,127,3,82,133,169,12,176,193,0,24,121,85,55,214,198,75,234,179,214,85,94,115,21,73,121,75,46,158,63,100,122,213,20,85,212,131,50,224,218,215,215,149,2,19,129,39,164,5,175,6,62,51,78,66,248,116,88,90,128,226,177,0,47,140,33,126,221,110,144,97,74,250,181,199,27,176,65,185,110,92,34,44,131,96,178,40,176,4,90,36,7,180,244,244,23,108,171,204,196,61,51,179,242,156,81,83,16,15,134,40,245,253,150,94,150,144,197,113,5,141,232,33,101,231,38,75,178,243,119,1,248,218,86,7,88,197,148,240,227,2,65,173,122,143,251,156,217,67,239,219,31,224,176,129,81,80,40,230, }; + u8 encoded_frame[] = { + 85, 190, 0, 19, 27, 255, 103, 205, 48, 6, 70, 123, 242, 46, + 52, 64, 176, 154, 98, 43, 132, 196, 89, 253, 161, 250, 174, 204, + 110, 47, 38, 187, 63, 102, 177, 162, 49, 80, 194, 37, 107, 60, + 225, 52, 101, 178, 142, 246, 21, 17, 93, 75, 169, 86, 16, 209, + 80, 243, 30, 206, 220, 206, 115, 47, 154, 91, 227, 88, 11, 1, + 85, 146, 100, 190, 232, 207, 61, 61, 201, 220, 31, 78, 34, 57, + 82, 59, 104, 65, 221, 0, 43, 210, 9, 32, 122, 29, 237, 11, + 151, 223, 18, 81, 204, 172, 234, 127, 3, 82, 133, 169, 12, 176, + 193, 0, 24, 121, 85, 55, 214, 198, 75, 234, 179, 214, 85, 94, + 115, 21, 73, 121, 75, 46, 158, 63, 100, 122, 213, 20, 85, 212, + 131, 50, 224, 218, 215, 215, 149, 2, 19, 129, 39, 164, 5, 175, + 6, 62, 51, 78, 66, 248, 116, 88, 90, 128, 226, 177, 0, 47, + 140, 33, 126, 221, 110, 144, 97, 74, 250, 181, 199, 27, 176, 65, + 185, 110, 92, 34, 44, 131, 96, 178, 40, 176, 4, 90, 36, 7, + 180, 244, 244, 23, 108, 171, 204, 196, 61, 51, 179, 242, 156, 81, + 83, 16, 15, 134, 40, 245, 253, 150, 94, 150, 144, 197, 113, 5, + 141, 232, 33, 101, 231, 38, 75, 178, 243, 119, 1, 248, 218, 86, + 7, 88, 197, 148, 240, 227, 2, 65, 173, 122, 143, 251, 156, 217, + 67, 239, 219, 31, 224, 176, 129, 81, 80, 40, 230, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.cell_modem_status.n_reserved = 250; - - + test_msg.cell_modem_status.reserved[0] = 123; - + test_msg.cell_modem_status.reserved[1] = 242; - + test_msg.cell_modem_status.reserved[2] = 46; - + test_msg.cell_modem_status.reserved[3] = 52; - + test_msg.cell_modem_status.reserved[4] = 64; - + test_msg.cell_modem_status.reserved[5] = 176; - + test_msg.cell_modem_status.reserved[6] = 154; - + test_msg.cell_modem_status.reserved[7] = 98; - + test_msg.cell_modem_status.reserved[8] = 43; - + test_msg.cell_modem_status.reserved[9] = 132; - + test_msg.cell_modem_status.reserved[10] = 196; - + test_msg.cell_modem_status.reserved[11] = 89; - + test_msg.cell_modem_status.reserved[12] = 253; - + test_msg.cell_modem_status.reserved[13] = 161; - + test_msg.cell_modem_status.reserved[14] = 250; - + test_msg.cell_modem_status.reserved[15] = 174; - + test_msg.cell_modem_status.reserved[16] = 204; - + test_msg.cell_modem_status.reserved[17] = 110; - + test_msg.cell_modem_status.reserved[18] = 47; - + test_msg.cell_modem_status.reserved[19] = 38; - + test_msg.cell_modem_status.reserved[20] = 187; - + test_msg.cell_modem_status.reserved[21] = 63; - + test_msg.cell_modem_status.reserved[22] = 102; - + test_msg.cell_modem_status.reserved[23] = 177; - + test_msg.cell_modem_status.reserved[24] = 162; - + test_msg.cell_modem_status.reserved[25] = 49; - + test_msg.cell_modem_status.reserved[26] = 80; - + test_msg.cell_modem_status.reserved[27] = 194; - + test_msg.cell_modem_status.reserved[28] = 37; - + test_msg.cell_modem_status.reserved[29] = 107; - + test_msg.cell_modem_status.reserved[30] = 60; - + test_msg.cell_modem_status.reserved[31] = 225; - + test_msg.cell_modem_status.reserved[32] = 52; - + test_msg.cell_modem_status.reserved[33] = 101; - + test_msg.cell_modem_status.reserved[34] = 178; - + test_msg.cell_modem_status.reserved[35] = 142; - + test_msg.cell_modem_status.reserved[36] = 246; - + test_msg.cell_modem_status.reserved[37] = 21; - + test_msg.cell_modem_status.reserved[38] = 17; - + test_msg.cell_modem_status.reserved[39] = 93; - + test_msg.cell_modem_status.reserved[40] = 75; - + test_msg.cell_modem_status.reserved[41] = 169; - + test_msg.cell_modem_status.reserved[42] = 86; - + test_msg.cell_modem_status.reserved[43] = 16; - + test_msg.cell_modem_status.reserved[44] = 209; - + test_msg.cell_modem_status.reserved[45] = 80; - + test_msg.cell_modem_status.reserved[46] = 243; - + test_msg.cell_modem_status.reserved[47] = 30; - + test_msg.cell_modem_status.reserved[48] = 206; - + test_msg.cell_modem_status.reserved[49] = 220; - + test_msg.cell_modem_status.reserved[50] = 206; - + test_msg.cell_modem_status.reserved[51] = 115; - + test_msg.cell_modem_status.reserved[52] = 47; - + test_msg.cell_modem_status.reserved[53] = 154; - + test_msg.cell_modem_status.reserved[54] = 91; - + test_msg.cell_modem_status.reserved[55] = 227; - + test_msg.cell_modem_status.reserved[56] = 88; - + test_msg.cell_modem_status.reserved[57] = 11; - + test_msg.cell_modem_status.reserved[58] = 1; - + test_msg.cell_modem_status.reserved[59] = 85; - + test_msg.cell_modem_status.reserved[60] = 146; - + test_msg.cell_modem_status.reserved[61] = 100; - + test_msg.cell_modem_status.reserved[62] = 190; - + test_msg.cell_modem_status.reserved[63] = 232; - + test_msg.cell_modem_status.reserved[64] = 207; - + test_msg.cell_modem_status.reserved[65] = 61; - + test_msg.cell_modem_status.reserved[66] = 61; - + test_msg.cell_modem_status.reserved[67] = 201; - + test_msg.cell_modem_status.reserved[68] = 220; - + test_msg.cell_modem_status.reserved[69] = 31; - + test_msg.cell_modem_status.reserved[70] = 78; - + test_msg.cell_modem_status.reserved[71] = 34; - + test_msg.cell_modem_status.reserved[72] = 57; - + test_msg.cell_modem_status.reserved[73] = 82; - + test_msg.cell_modem_status.reserved[74] = 59; - + test_msg.cell_modem_status.reserved[75] = 104; - + test_msg.cell_modem_status.reserved[76] = 65; - + test_msg.cell_modem_status.reserved[77] = 221; - + test_msg.cell_modem_status.reserved[78] = 0; - + test_msg.cell_modem_status.reserved[79] = 43; - + test_msg.cell_modem_status.reserved[80] = 210; - + test_msg.cell_modem_status.reserved[81] = 9; - + test_msg.cell_modem_status.reserved[82] = 32; - + test_msg.cell_modem_status.reserved[83] = 122; - + test_msg.cell_modem_status.reserved[84] = 29; - + test_msg.cell_modem_status.reserved[85] = 237; - + test_msg.cell_modem_status.reserved[86] = 11; - + test_msg.cell_modem_status.reserved[87] = 151; - + test_msg.cell_modem_status.reserved[88] = 223; - + test_msg.cell_modem_status.reserved[89] = 18; - + test_msg.cell_modem_status.reserved[90] = 81; - + test_msg.cell_modem_status.reserved[91] = 204; - + test_msg.cell_modem_status.reserved[92] = 172; - + test_msg.cell_modem_status.reserved[93] = 234; - + test_msg.cell_modem_status.reserved[94] = 127; - + test_msg.cell_modem_status.reserved[95] = 3; - + test_msg.cell_modem_status.reserved[96] = 82; - + test_msg.cell_modem_status.reserved[97] = 133; - + test_msg.cell_modem_status.reserved[98] = 169; - + test_msg.cell_modem_status.reserved[99] = 12; - + test_msg.cell_modem_status.reserved[100] = 176; - + test_msg.cell_modem_status.reserved[101] = 193; - + test_msg.cell_modem_status.reserved[102] = 0; - + test_msg.cell_modem_status.reserved[103] = 24; - + test_msg.cell_modem_status.reserved[104] = 121; - + test_msg.cell_modem_status.reserved[105] = 85; - + test_msg.cell_modem_status.reserved[106] = 55; - + test_msg.cell_modem_status.reserved[107] = 214; - + test_msg.cell_modem_status.reserved[108] = 198; - + test_msg.cell_modem_status.reserved[109] = 75; - + test_msg.cell_modem_status.reserved[110] = 234; - + test_msg.cell_modem_status.reserved[111] = 179; - + test_msg.cell_modem_status.reserved[112] = 214; - + test_msg.cell_modem_status.reserved[113] = 85; - + test_msg.cell_modem_status.reserved[114] = 94; - + test_msg.cell_modem_status.reserved[115] = 115; - + test_msg.cell_modem_status.reserved[116] = 21; - + test_msg.cell_modem_status.reserved[117] = 73; - + test_msg.cell_modem_status.reserved[118] = 121; - + test_msg.cell_modem_status.reserved[119] = 75; - + test_msg.cell_modem_status.reserved[120] = 46; - + test_msg.cell_modem_status.reserved[121] = 158; - + test_msg.cell_modem_status.reserved[122] = 63; - + test_msg.cell_modem_status.reserved[123] = 100; - + test_msg.cell_modem_status.reserved[124] = 122; - + test_msg.cell_modem_status.reserved[125] = 213; - + test_msg.cell_modem_status.reserved[126] = 20; - + test_msg.cell_modem_status.reserved[127] = 85; - + test_msg.cell_modem_status.reserved[128] = 212; - + test_msg.cell_modem_status.reserved[129] = 131; - + test_msg.cell_modem_status.reserved[130] = 50; - + test_msg.cell_modem_status.reserved[131] = 224; - + test_msg.cell_modem_status.reserved[132] = 218; - + test_msg.cell_modem_status.reserved[133] = 215; - + test_msg.cell_modem_status.reserved[134] = 215; - + test_msg.cell_modem_status.reserved[135] = 149; - + test_msg.cell_modem_status.reserved[136] = 2; - + test_msg.cell_modem_status.reserved[137] = 19; - + test_msg.cell_modem_status.reserved[138] = 129; - + test_msg.cell_modem_status.reserved[139] = 39; - + test_msg.cell_modem_status.reserved[140] = 164; - + test_msg.cell_modem_status.reserved[141] = 5; - + test_msg.cell_modem_status.reserved[142] = 175; - + test_msg.cell_modem_status.reserved[143] = 6; - + test_msg.cell_modem_status.reserved[144] = 62; - + test_msg.cell_modem_status.reserved[145] = 51; - + test_msg.cell_modem_status.reserved[146] = 78; - + test_msg.cell_modem_status.reserved[147] = 66; - + test_msg.cell_modem_status.reserved[148] = 248; - + test_msg.cell_modem_status.reserved[149] = 116; - + test_msg.cell_modem_status.reserved[150] = 88; - + test_msg.cell_modem_status.reserved[151] = 90; - + test_msg.cell_modem_status.reserved[152] = 128; - + test_msg.cell_modem_status.reserved[153] = 226; - + test_msg.cell_modem_status.reserved[154] = 177; - + test_msg.cell_modem_status.reserved[155] = 0; - + test_msg.cell_modem_status.reserved[156] = 47; - + test_msg.cell_modem_status.reserved[157] = 140; - + test_msg.cell_modem_status.reserved[158] = 33; - + test_msg.cell_modem_status.reserved[159] = 126; - + test_msg.cell_modem_status.reserved[160] = 221; - + test_msg.cell_modem_status.reserved[161] = 110; - + test_msg.cell_modem_status.reserved[162] = 144; - + test_msg.cell_modem_status.reserved[163] = 97; - + test_msg.cell_modem_status.reserved[164] = 74; - + test_msg.cell_modem_status.reserved[165] = 250; - + test_msg.cell_modem_status.reserved[166] = 181; - + test_msg.cell_modem_status.reserved[167] = 199; - + test_msg.cell_modem_status.reserved[168] = 27; - + test_msg.cell_modem_status.reserved[169] = 176; - + test_msg.cell_modem_status.reserved[170] = 65; - + test_msg.cell_modem_status.reserved[171] = 185; - + test_msg.cell_modem_status.reserved[172] = 110; - + test_msg.cell_modem_status.reserved[173] = 92; - + test_msg.cell_modem_status.reserved[174] = 34; - + test_msg.cell_modem_status.reserved[175] = 44; - + test_msg.cell_modem_status.reserved[176] = 131; - + test_msg.cell_modem_status.reserved[177] = 96; - + test_msg.cell_modem_status.reserved[178] = 178; - + test_msg.cell_modem_status.reserved[179] = 40; - + test_msg.cell_modem_status.reserved[180] = 176; - + test_msg.cell_modem_status.reserved[181] = 4; - + test_msg.cell_modem_status.reserved[182] = 90; - + test_msg.cell_modem_status.reserved[183] = 36; - + test_msg.cell_modem_status.reserved[184] = 7; - + test_msg.cell_modem_status.reserved[185] = 180; - + test_msg.cell_modem_status.reserved[186] = 244; - + test_msg.cell_modem_status.reserved[187] = 244; - + test_msg.cell_modem_status.reserved[188] = 23; - + test_msg.cell_modem_status.reserved[189] = 108; - + test_msg.cell_modem_status.reserved[190] = 171; - + test_msg.cell_modem_status.reserved[191] = 204; - + test_msg.cell_modem_status.reserved[192] = 196; - + test_msg.cell_modem_status.reserved[193] = 61; - + test_msg.cell_modem_status.reserved[194] = 51; - + test_msg.cell_modem_status.reserved[195] = 179; - + test_msg.cell_modem_status.reserved[196] = 242; - + test_msg.cell_modem_status.reserved[197] = 156; - + test_msg.cell_modem_status.reserved[198] = 81; - + test_msg.cell_modem_status.reserved[199] = 83; - + test_msg.cell_modem_status.reserved[200] = 16; - + test_msg.cell_modem_status.reserved[201] = 15; - + test_msg.cell_modem_status.reserved[202] = 134; - + test_msg.cell_modem_status.reserved[203] = 40; - + test_msg.cell_modem_status.reserved[204] = 245; - + test_msg.cell_modem_status.reserved[205] = 253; - + test_msg.cell_modem_status.reserved[206] = 150; - + test_msg.cell_modem_status.reserved[207] = 94; - + test_msg.cell_modem_status.reserved[208] = 150; - + test_msg.cell_modem_status.reserved[209] = 144; - + test_msg.cell_modem_status.reserved[210] = 197; - + test_msg.cell_modem_status.reserved[211] = 113; - + test_msg.cell_modem_status.reserved[212] = 5; - + test_msg.cell_modem_status.reserved[213] = 141; - + test_msg.cell_modem_status.reserved[214] = 232; - + test_msg.cell_modem_status.reserved[215] = 33; - + test_msg.cell_modem_status.reserved[216] = 101; - + test_msg.cell_modem_status.reserved[217] = 231; - + test_msg.cell_modem_status.reserved[218] = 38; - + test_msg.cell_modem_status.reserved[219] = 75; - + test_msg.cell_modem_status.reserved[220] = 178; - + test_msg.cell_modem_status.reserved[221] = 243; - + test_msg.cell_modem_status.reserved[222] = 119; - + test_msg.cell_modem_status.reserved[223] = 1; - + test_msg.cell_modem_status.reserved[224] = 248; - + test_msg.cell_modem_status.reserved[225] = 218; - + test_msg.cell_modem_status.reserved[226] = 86; - + test_msg.cell_modem_status.reserved[227] = 7; - + test_msg.cell_modem_status.reserved[228] = 88; - + test_msg.cell_modem_status.reserved[229] = 197; - + test_msg.cell_modem_status.reserved[230] = 148; - + test_msg.cell_modem_status.reserved[231] = 240; - + test_msg.cell_modem_status.reserved[232] = 227; - + test_msg.cell_modem_status.reserved[233] = 2; - + test_msg.cell_modem_status.reserved[234] = 65; - + test_msg.cell_modem_status.reserved[235] = 173; - + test_msg.cell_modem_status.reserved[236] = 122; - + test_msg.cell_modem_status.reserved[237] = 143; - + test_msg.cell_modem_status.reserved[238] = 251; - + test_msg.cell_modem_status.reserved[239] = 156; - + test_msg.cell_modem_status.reserved[240] = 217; - + test_msg.cell_modem_status.reserved[241] = 67; - + test_msg.cell_modem_status.reserved[242] = 239; - + test_msg.cell_modem_status.reserved[243] = 219; - + test_msg.cell_modem_status.reserved[244] = 31; - + test_msg.cell_modem_status.reserved[245] = 224; - + test_msg.cell_modem_status.reserved[246] = 176; - + test_msg.cell_modem_status.reserved[247] = 129; - + test_msg.cell_modem_status.reserved[248] = 81; - + test_msg.cell_modem_status.reserved[249] = 80; - + test_msg.cell_modem_status.signal_error_rate = 8588.2001953125; - + test_msg.cell_modem_status.signal_strength = 103; - sbp_message_send(&sbp_state, SbpMsgCellModemStatus, 6931, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgCellModemStatus, 6931, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 6931, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgCellModemStatus, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgCellModemStatus, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.cell_modem_status.n_reserved == 250, "incorrect value for last_msg.msg.cell_modem_status.n_reserved, expected 250, is %d", last_msg.msg.cell_modem_status.n_reserved); - - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[0] == 123, "incorrect value for last_msg.msg.cell_modem_status.reserved[0], expected 123, is %d", last_msg.msg.cell_modem_status.reserved[0]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[1] == 242, "incorrect value for last_msg.msg.cell_modem_status.reserved[1], expected 242, is %d", last_msg.msg.cell_modem_status.reserved[1]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[2] == 46, "incorrect value for last_msg.msg.cell_modem_status.reserved[2], expected 46, is %d", last_msg.msg.cell_modem_status.reserved[2]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[3] == 52, "incorrect value for last_msg.msg.cell_modem_status.reserved[3], expected 52, is %d", last_msg.msg.cell_modem_status.reserved[3]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[4] == 64, "incorrect value for last_msg.msg.cell_modem_status.reserved[4], expected 64, is %d", last_msg.msg.cell_modem_status.reserved[4]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[5] == 176, "incorrect value for last_msg.msg.cell_modem_status.reserved[5], expected 176, is %d", last_msg.msg.cell_modem_status.reserved[5]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[6] == 154, "incorrect value for last_msg.msg.cell_modem_status.reserved[6], expected 154, is %d", last_msg.msg.cell_modem_status.reserved[6]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[7] == 98, "incorrect value for last_msg.msg.cell_modem_status.reserved[7], expected 98, is %d", last_msg.msg.cell_modem_status.reserved[7]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[8] == 43, "incorrect value for last_msg.msg.cell_modem_status.reserved[8], expected 43, is %d", last_msg.msg.cell_modem_status.reserved[8]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[9] == 132, "incorrect value for last_msg.msg.cell_modem_status.reserved[9], expected 132, is %d", last_msg.msg.cell_modem_status.reserved[9]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[10] == 196, "incorrect value for last_msg.msg.cell_modem_status.reserved[10], expected 196, is %d", last_msg.msg.cell_modem_status.reserved[10]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[11] == 89, "incorrect value for last_msg.msg.cell_modem_status.reserved[11], expected 89, is %d", last_msg.msg.cell_modem_status.reserved[11]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[12] == 253, "incorrect value for last_msg.msg.cell_modem_status.reserved[12], expected 253, is %d", last_msg.msg.cell_modem_status.reserved[12]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[13] == 161, "incorrect value for last_msg.msg.cell_modem_status.reserved[13], expected 161, is %d", last_msg.msg.cell_modem_status.reserved[13]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[14] == 250, "incorrect value for last_msg.msg.cell_modem_status.reserved[14], expected 250, is %d", last_msg.msg.cell_modem_status.reserved[14]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[15] == 174, "incorrect value for last_msg.msg.cell_modem_status.reserved[15], expected 174, is %d", last_msg.msg.cell_modem_status.reserved[15]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[16] == 204, "incorrect value for last_msg.msg.cell_modem_status.reserved[16], expected 204, is %d", last_msg.msg.cell_modem_status.reserved[16]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[17] == 110, "incorrect value for last_msg.msg.cell_modem_status.reserved[17], expected 110, is %d", last_msg.msg.cell_modem_status.reserved[17]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[18] == 47, "incorrect value for last_msg.msg.cell_modem_status.reserved[18], expected 47, is %d", last_msg.msg.cell_modem_status.reserved[18]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[19] == 38, "incorrect value for last_msg.msg.cell_modem_status.reserved[19], expected 38, is %d", last_msg.msg.cell_modem_status.reserved[19]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[20] == 187, "incorrect value for last_msg.msg.cell_modem_status.reserved[20], expected 187, is %d", last_msg.msg.cell_modem_status.reserved[20]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[21] == 63, "incorrect value for last_msg.msg.cell_modem_status.reserved[21], expected 63, is %d", last_msg.msg.cell_modem_status.reserved[21]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[22] == 102, "incorrect value for last_msg.msg.cell_modem_status.reserved[22], expected 102, is %d", last_msg.msg.cell_modem_status.reserved[22]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[23] == 177, "incorrect value for last_msg.msg.cell_modem_status.reserved[23], expected 177, is %d", last_msg.msg.cell_modem_status.reserved[23]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[24] == 162, "incorrect value for last_msg.msg.cell_modem_status.reserved[24], expected 162, is %d", last_msg.msg.cell_modem_status.reserved[24]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[25] == 49, "incorrect value for last_msg.msg.cell_modem_status.reserved[25], expected 49, is %d", last_msg.msg.cell_modem_status.reserved[25]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[26] == 80, "incorrect value for last_msg.msg.cell_modem_status.reserved[26], expected 80, is %d", last_msg.msg.cell_modem_status.reserved[26]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[27] == 194, "incorrect value for last_msg.msg.cell_modem_status.reserved[27], expected 194, is %d", last_msg.msg.cell_modem_status.reserved[27]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[28] == 37, "incorrect value for last_msg.msg.cell_modem_status.reserved[28], expected 37, is %d", last_msg.msg.cell_modem_status.reserved[28]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[29] == 107, "incorrect value for last_msg.msg.cell_modem_status.reserved[29], expected 107, is %d", last_msg.msg.cell_modem_status.reserved[29]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[30] == 60, "incorrect value for last_msg.msg.cell_modem_status.reserved[30], expected 60, is %d", last_msg.msg.cell_modem_status.reserved[30]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[31] == 225, "incorrect value for last_msg.msg.cell_modem_status.reserved[31], expected 225, is %d", last_msg.msg.cell_modem_status.reserved[31]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[32] == 52, "incorrect value for last_msg.msg.cell_modem_status.reserved[32], expected 52, is %d", last_msg.msg.cell_modem_status.reserved[32]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[33] == 101, "incorrect value for last_msg.msg.cell_modem_status.reserved[33], expected 101, is %d", last_msg.msg.cell_modem_status.reserved[33]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[34] == 178, "incorrect value for last_msg.msg.cell_modem_status.reserved[34], expected 178, is %d", last_msg.msg.cell_modem_status.reserved[34]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[35] == 142, "incorrect value for last_msg.msg.cell_modem_status.reserved[35], expected 142, is %d", last_msg.msg.cell_modem_status.reserved[35]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[36] == 246, "incorrect value for last_msg.msg.cell_modem_status.reserved[36], expected 246, is %d", last_msg.msg.cell_modem_status.reserved[36]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[37] == 21, "incorrect value for last_msg.msg.cell_modem_status.reserved[37], expected 21, is %d", last_msg.msg.cell_modem_status.reserved[37]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[38] == 17, "incorrect value for last_msg.msg.cell_modem_status.reserved[38], expected 17, is %d", last_msg.msg.cell_modem_status.reserved[38]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[39] == 93, "incorrect value for last_msg.msg.cell_modem_status.reserved[39], expected 93, is %d", last_msg.msg.cell_modem_status.reserved[39]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[40] == 75, "incorrect value for last_msg.msg.cell_modem_status.reserved[40], expected 75, is %d", last_msg.msg.cell_modem_status.reserved[40]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[41] == 169, "incorrect value for last_msg.msg.cell_modem_status.reserved[41], expected 169, is %d", last_msg.msg.cell_modem_status.reserved[41]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[42] == 86, "incorrect value for last_msg.msg.cell_modem_status.reserved[42], expected 86, is %d", last_msg.msg.cell_modem_status.reserved[42]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[43] == 16, "incorrect value for last_msg.msg.cell_modem_status.reserved[43], expected 16, is %d", last_msg.msg.cell_modem_status.reserved[43]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[44] == 209, "incorrect value for last_msg.msg.cell_modem_status.reserved[44], expected 209, is %d", last_msg.msg.cell_modem_status.reserved[44]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[45] == 80, "incorrect value for last_msg.msg.cell_modem_status.reserved[45], expected 80, is %d", last_msg.msg.cell_modem_status.reserved[45]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[46] == 243, "incorrect value for last_msg.msg.cell_modem_status.reserved[46], expected 243, is %d", last_msg.msg.cell_modem_status.reserved[46]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[47] == 30, "incorrect value for last_msg.msg.cell_modem_status.reserved[47], expected 30, is %d", last_msg.msg.cell_modem_status.reserved[47]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[48] == 206, "incorrect value for last_msg.msg.cell_modem_status.reserved[48], expected 206, is %d", last_msg.msg.cell_modem_status.reserved[48]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[49] == 220, "incorrect value for last_msg.msg.cell_modem_status.reserved[49], expected 220, is %d", last_msg.msg.cell_modem_status.reserved[49]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[50] == 206, "incorrect value for last_msg.msg.cell_modem_status.reserved[50], expected 206, is %d", last_msg.msg.cell_modem_status.reserved[50]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[51] == 115, "incorrect value for last_msg.msg.cell_modem_status.reserved[51], expected 115, is %d", last_msg.msg.cell_modem_status.reserved[51]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[52] == 47, "incorrect value for last_msg.msg.cell_modem_status.reserved[52], expected 47, is %d", last_msg.msg.cell_modem_status.reserved[52]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[53] == 154, "incorrect value for last_msg.msg.cell_modem_status.reserved[53], expected 154, is %d", last_msg.msg.cell_modem_status.reserved[53]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[54] == 91, "incorrect value for last_msg.msg.cell_modem_status.reserved[54], expected 91, is %d", last_msg.msg.cell_modem_status.reserved[54]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[55] == 227, "incorrect value for last_msg.msg.cell_modem_status.reserved[55], expected 227, is %d", last_msg.msg.cell_modem_status.reserved[55]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[56] == 88, "incorrect value for last_msg.msg.cell_modem_status.reserved[56], expected 88, is %d", last_msg.msg.cell_modem_status.reserved[56]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[57] == 11, "incorrect value for last_msg.msg.cell_modem_status.reserved[57], expected 11, is %d", last_msg.msg.cell_modem_status.reserved[57]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[58] == 1, "incorrect value for last_msg.msg.cell_modem_status.reserved[58], expected 1, is %d", last_msg.msg.cell_modem_status.reserved[58]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[59] == 85, "incorrect value for last_msg.msg.cell_modem_status.reserved[59], expected 85, is %d", last_msg.msg.cell_modem_status.reserved[59]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[60] == 146, "incorrect value for last_msg.msg.cell_modem_status.reserved[60], expected 146, is %d", last_msg.msg.cell_modem_status.reserved[60]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[61] == 100, "incorrect value for last_msg.msg.cell_modem_status.reserved[61], expected 100, is %d", last_msg.msg.cell_modem_status.reserved[61]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[62] == 190, "incorrect value for last_msg.msg.cell_modem_status.reserved[62], expected 190, is %d", last_msg.msg.cell_modem_status.reserved[62]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[63] == 232, "incorrect value for last_msg.msg.cell_modem_status.reserved[63], expected 232, is %d", last_msg.msg.cell_modem_status.reserved[63]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[64] == 207, "incorrect value for last_msg.msg.cell_modem_status.reserved[64], expected 207, is %d", last_msg.msg.cell_modem_status.reserved[64]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[65] == 61, "incorrect value for last_msg.msg.cell_modem_status.reserved[65], expected 61, is %d", last_msg.msg.cell_modem_status.reserved[65]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[66] == 61, "incorrect value for last_msg.msg.cell_modem_status.reserved[66], expected 61, is %d", last_msg.msg.cell_modem_status.reserved[66]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[67] == 201, "incorrect value for last_msg.msg.cell_modem_status.reserved[67], expected 201, is %d", last_msg.msg.cell_modem_status.reserved[67]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[68] == 220, "incorrect value for last_msg.msg.cell_modem_status.reserved[68], expected 220, is %d", last_msg.msg.cell_modem_status.reserved[68]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[69] == 31, "incorrect value for last_msg.msg.cell_modem_status.reserved[69], expected 31, is %d", last_msg.msg.cell_modem_status.reserved[69]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[70] == 78, "incorrect value for last_msg.msg.cell_modem_status.reserved[70], expected 78, is %d", last_msg.msg.cell_modem_status.reserved[70]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[71] == 34, "incorrect value for last_msg.msg.cell_modem_status.reserved[71], expected 34, is %d", last_msg.msg.cell_modem_status.reserved[71]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[72] == 57, "incorrect value for last_msg.msg.cell_modem_status.reserved[72], expected 57, is %d", last_msg.msg.cell_modem_status.reserved[72]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[73] == 82, "incorrect value for last_msg.msg.cell_modem_status.reserved[73], expected 82, is %d", last_msg.msg.cell_modem_status.reserved[73]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[74] == 59, "incorrect value for last_msg.msg.cell_modem_status.reserved[74], expected 59, is %d", last_msg.msg.cell_modem_status.reserved[74]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[75] == 104, "incorrect value for last_msg.msg.cell_modem_status.reserved[75], expected 104, is %d", last_msg.msg.cell_modem_status.reserved[75]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[76] == 65, "incorrect value for last_msg.msg.cell_modem_status.reserved[76], expected 65, is %d", last_msg.msg.cell_modem_status.reserved[76]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[77] == 221, "incorrect value for last_msg.msg.cell_modem_status.reserved[77], expected 221, is %d", last_msg.msg.cell_modem_status.reserved[77]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[78] == 0, "incorrect value for last_msg.msg.cell_modem_status.reserved[78], expected 0, is %d", last_msg.msg.cell_modem_status.reserved[78]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[79] == 43, "incorrect value for last_msg.msg.cell_modem_status.reserved[79], expected 43, is %d", last_msg.msg.cell_modem_status.reserved[79]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[80] == 210, "incorrect value for last_msg.msg.cell_modem_status.reserved[80], expected 210, is %d", last_msg.msg.cell_modem_status.reserved[80]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[81] == 9, "incorrect value for last_msg.msg.cell_modem_status.reserved[81], expected 9, is %d", last_msg.msg.cell_modem_status.reserved[81]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[82] == 32, "incorrect value for last_msg.msg.cell_modem_status.reserved[82], expected 32, is %d", last_msg.msg.cell_modem_status.reserved[82]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[83] == 122, "incorrect value for last_msg.msg.cell_modem_status.reserved[83], expected 122, is %d", last_msg.msg.cell_modem_status.reserved[83]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[84] == 29, "incorrect value for last_msg.msg.cell_modem_status.reserved[84], expected 29, is %d", last_msg.msg.cell_modem_status.reserved[84]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[85] == 237, "incorrect value for last_msg.msg.cell_modem_status.reserved[85], expected 237, is %d", last_msg.msg.cell_modem_status.reserved[85]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[86] == 11, "incorrect value for last_msg.msg.cell_modem_status.reserved[86], expected 11, is %d", last_msg.msg.cell_modem_status.reserved[86]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[87] == 151, "incorrect value for last_msg.msg.cell_modem_status.reserved[87], expected 151, is %d", last_msg.msg.cell_modem_status.reserved[87]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[88] == 223, "incorrect value for last_msg.msg.cell_modem_status.reserved[88], expected 223, is %d", last_msg.msg.cell_modem_status.reserved[88]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[89] == 18, "incorrect value for last_msg.msg.cell_modem_status.reserved[89], expected 18, is %d", last_msg.msg.cell_modem_status.reserved[89]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[90] == 81, "incorrect value for last_msg.msg.cell_modem_status.reserved[90], expected 81, is %d", last_msg.msg.cell_modem_status.reserved[90]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[91] == 204, "incorrect value for last_msg.msg.cell_modem_status.reserved[91], expected 204, is %d", last_msg.msg.cell_modem_status.reserved[91]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[92] == 172, "incorrect value for last_msg.msg.cell_modem_status.reserved[92], expected 172, is %d", last_msg.msg.cell_modem_status.reserved[92]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[93] == 234, "incorrect value for last_msg.msg.cell_modem_status.reserved[93], expected 234, is %d", last_msg.msg.cell_modem_status.reserved[93]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[94] == 127, "incorrect value for last_msg.msg.cell_modem_status.reserved[94], expected 127, is %d", last_msg.msg.cell_modem_status.reserved[94]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[95] == 3, "incorrect value for last_msg.msg.cell_modem_status.reserved[95], expected 3, is %d", last_msg.msg.cell_modem_status.reserved[95]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[96] == 82, "incorrect value for last_msg.msg.cell_modem_status.reserved[96], expected 82, is %d", last_msg.msg.cell_modem_status.reserved[96]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[97] == 133, "incorrect value for last_msg.msg.cell_modem_status.reserved[97], expected 133, is %d", last_msg.msg.cell_modem_status.reserved[97]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[98] == 169, "incorrect value for last_msg.msg.cell_modem_status.reserved[98], expected 169, is %d", last_msg.msg.cell_modem_status.reserved[98]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[99] == 12, "incorrect value for last_msg.msg.cell_modem_status.reserved[99], expected 12, is %d", last_msg.msg.cell_modem_status.reserved[99]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[100] == 176, "incorrect value for last_msg.msg.cell_modem_status.reserved[100], expected 176, is %d", last_msg.msg.cell_modem_status.reserved[100]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[101] == 193, "incorrect value for last_msg.msg.cell_modem_status.reserved[101], expected 193, is %d", last_msg.msg.cell_modem_status.reserved[101]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[102] == 0, "incorrect value for last_msg.msg.cell_modem_status.reserved[102], expected 0, is %d", last_msg.msg.cell_modem_status.reserved[102]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[103] == 24, "incorrect value for last_msg.msg.cell_modem_status.reserved[103], expected 24, is %d", last_msg.msg.cell_modem_status.reserved[103]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[104] == 121, "incorrect value for last_msg.msg.cell_modem_status.reserved[104], expected 121, is %d", last_msg.msg.cell_modem_status.reserved[104]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[105] == 85, "incorrect value for last_msg.msg.cell_modem_status.reserved[105], expected 85, is %d", last_msg.msg.cell_modem_status.reserved[105]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[106] == 55, "incorrect value for last_msg.msg.cell_modem_status.reserved[106], expected 55, is %d", last_msg.msg.cell_modem_status.reserved[106]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[107] == 214, "incorrect value for last_msg.msg.cell_modem_status.reserved[107], expected 214, is %d", last_msg.msg.cell_modem_status.reserved[107]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[108] == 198, "incorrect value for last_msg.msg.cell_modem_status.reserved[108], expected 198, is %d", last_msg.msg.cell_modem_status.reserved[108]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[109] == 75, "incorrect value for last_msg.msg.cell_modem_status.reserved[109], expected 75, is %d", last_msg.msg.cell_modem_status.reserved[109]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[110] == 234, "incorrect value for last_msg.msg.cell_modem_status.reserved[110], expected 234, is %d", last_msg.msg.cell_modem_status.reserved[110]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[111] == 179, "incorrect value for last_msg.msg.cell_modem_status.reserved[111], expected 179, is %d", last_msg.msg.cell_modem_status.reserved[111]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[112] == 214, "incorrect value for last_msg.msg.cell_modem_status.reserved[112], expected 214, is %d", last_msg.msg.cell_modem_status.reserved[112]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[113] == 85, "incorrect value for last_msg.msg.cell_modem_status.reserved[113], expected 85, is %d", last_msg.msg.cell_modem_status.reserved[113]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[114] == 94, "incorrect value for last_msg.msg.cell_modem_status.reserved[114], expected 94, is %d", last_msg.msg.cell_modem_status.reserved[114]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[115] == 115, "incorrect value for last_msg.msg.cell_modem_status.reserved[115], expected 115, is %d", last_msg.msg.cell_modem_status.reserved[115]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[116] == 21, "incorrect value for last_msg.msg.cell_modem_status.reserved[116], expected 21, is %d", last_msg.msg.cell_modem_status.reserved[116]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[117] == 73, "incorrect value for last_msg.msg.cell_modem_status.reserved[117], expected 73, is %d", last_msg.msg.cell_modem_status.reserved[117]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[118] == 121, "incorrect value for last_msg.msg.cell_modem_status.reserved[118], expected 121, is %d", last_msg.msg.cell_modem_status.reserved[118]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[119] == 75, "incorrect value for last_msg.msg.cell_modem_status.reserved[119], expected 75, is %d", last_msg.msg.cell_modem_status.reserved[119]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[120] == 46, "incorrect value for last_msg.msg.cell_modem_status.reserved[120], expected 46, is %d", last_msg.msg.cell_modem_status.reserved[120]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[121] == 158, "incorrect value for last_msg.msg.cell_modem_status.reserved[121], expected 158, is %d", last_msg.msg.cell_modem_status.reserved[121]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[122] == 63, "incorrect value for last_msg.msg.cell_modem_status.reserved[122], expected 63, is %d", last_msg.msg.cell_modem_status.reserved[122]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[123] == 100, "incorrect value for last_msg.msg.cell_modem_status.reserved[123], expected 100, is %d", last_msg.msg.cell_modem_status.reserved[123]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[124] == 122, "incorrect value for last_msg.msg.cell_modem_status.reserved[124], expected 122, is %d", last_msg.msg.cell_modem_status.reserved[124]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[125] == 213, "incorrect value for last_msg.msg.cell_modem_status.reserved[125], expected 213, is %d", last_msg.msg.cell_modem_status.reserved[125]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[126] == 20, "incorrect value for last_msg.msg.cell_modem_status.reserved[126], expected 20, is %d", last_msg.msg.cell_modem_status.reserved[126]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[127] == 85, "incorrect value for last_msg.msg.cell_modem_status.reserved[127], expected 85, is %d", last_msg.msg.cell_modem_status.reserved[127]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[128] == 212, "incorrect value for last_msg.msg.cell_modem_status.reserved[128], expected 212, is %d", last_msg.msg.cell_modem_status.reserved[128]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[129] == 131, "incorrect value for last_msg.msg.cell_modem_status.reserved[129], expected 131, is %d", last_msg.msg.cell_modem_status.reserved[129]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[130] == 50, "incorrect value for last_msg.msg.cell_modem_status.reserved[130], expected 50, is %d", last_msg.msg.cell_modem_status.reserved[130]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[131] == 224, "incorrect value for last_msg.msg.cell_modem_status.reserved[131], expected 224, is %d", last_msg.msg.cell_modem_status.reserved[131]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[132] == 218, "incorrect value for last_msg.msg.cell_modem_status.reserved[132], expected 218, is %d", last_msg.msg.cell_modem_status.reserved[132]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[133] == 215, "incorrect value for last_msg.msg.cell_modem_status.reserved[133], expected 215, is %d", last_msg.msg.cell_modem_status.reserved[133]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[134] == 215, "incorrect value for last_msg.msg.cell_modem_status.reserved[134], expected 215, is %d", last_msg.msg.cell_modem_status.reserved[134]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[135] == 149, "incorrect value for last_msg.msg.cell_modem_status.reserved[135], expected 149, is %d", last_msg.msg.cell_modem_status.reserved[135]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[136] == 2, "incorrect value for last_msg.msg.cell_modem_status.reserved[136], expected 2, is %d", last_msg.msg.cell_modem_status.reserved[136]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[137] == 19, "incorrect value for last_msg.msg.cell_modem_status.reserved[137], expected 19, is %d", last_msg.msg.cell_modem_status.reserved[137]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[138] == 129, "incorrect value for last_msg.msg.cell_modem_status.reserved[138], expected 129, is %d", last_msg.msg.cell_modem_status.reserved[138]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[139] == 39, "incorrect value for last_msg.msg.cell_modem_status.reserved[139], expected 39, is %d", last_msg.msg.cell_modem_status.reserved[139]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[140] == 164, "incorrect value for last_msg.msg.cell_modem_status.reserved[140], expected 164, is %d", last_msg.msg.cell_modem_status.reserved[140]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[141] == 5, "incorrect value for last_msg.msg.cell_modem_status.reserved[141], expected 5, is %d", last_msg.msg.cell_modem_status.reserved[141]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[142] == 175, "incorrect value for last_msg.msg.cell_modem_status.reserved[142], expected 175, is %d", last_msg.msg.cell_modem_status.reserved[142]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[143] == 6, "incorrect value for last_msg.msg.cell_modem_status.reserved[143], expected 6, is %d", last_msg.msg.cell_modem_status.reserved[143]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[144] == 62, "incorrect value for last_msg.msg.cell_modem_status.reserved[144], expected 62, is %d", last_msg.msg.cell_modem_status.reserved[144]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[145] == 51, "incorrect value for last_msg.msg.cell_modem_status.reserved[145], expected 51, is %d", last_msg.msg.cell_modem_status.reserved[145]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[146] == 78, "incorrect value for last_msg.msg.cell_modem_status.reserved[146], expected 78, is %d", last_msg.msg.cell_modem_status.reserved[146]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[147] == 66, "incorrect value for last_msg.msg.cell_modem_status.reserved[147], expected 66, is %d", last_msg.msg.cell_modem_status.reserved[147]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[148] == 248, "incorrect value for last_msg.msg.cell_modem_status.reserved[148], expected 248, is %d", last_msg.msg.cell_modem_status.reserved[148]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[149] == 116, "incorrect value for last_msg.msg.cell_modem_status.reserved[149], expected 116, is %d", last_msg.msg.cell_modem_status.reserved[149]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[150] == 88, "incorrect value for last_msg.msg.cell_modem_status.reserved[150], expected 88, is %d", last_msg.msg.cell_modem_status.reserved[150]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[151] == 90, "incorrect value for last_msg.msg.cell_modem_status.reserved[151], expected 90, is %d", last_msg.msg.cell_modem_status.reserved[151]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[152] == 128, "incorrect value for last_msg.msg.cell_modem_status.reserved[152], expected 128, is %d", last_msg.msg.cell_modem_status.reserved[152]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[153] == 226, "incorrect value for last_msg.msg.cell_modem_status.reserved[153], expected 226, is %d", last_msg.msg.cell_modem_status.reserved[153]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[154] == 177, "incorrect value for last_msg.msg.cell_modem_status.reserved[154], expected 177, is %d", last_msg.msg.cell_modem_status.reserved[154]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[155] == 0, "incorrect value for last_msg.msg.cell_modem_status.reserved[155], expected 0, is %d", last_msg.msg.cell_modem_status.reserved[155]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[156] == 47, "incorrect value for last_msg.msg.cell_modem_status.reserved[156], expected 47, is %d", last_msg.msg.cell_modem_status.reserved[156]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[157] == 140, "incorrect value for last_msg.msg.cell_modem_status.reserved[157], expected 140, is %d", last_msg.msg.cell_modem_status.reserved[157]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[158] == 33, "incorrect value for last_msg.msg.cell_modem_status.reserved[158], expected 33, is %d", last_msg.msg.cell_modem_status.reserved[158]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[159] == 126, "incorrect value for last_msg.msg.cell_modem_status.reserved[159], expected 126, is %d", last_msg.msg.cell_modem_status.reserved[159]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[160] == 221, "incorrect value for last_msg.msg.cell_modem_status.reserved[160], expected 221, is %d", last_msg.msg.cell_modem_status.reserved[160]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[161] == 110, "incorrect value for last_msg.msg.cell_modem_status.reserved[161], expected 110, is %d", last_msg.msg.cell_modem_status.reserved[161]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[162] == 144, "incorrect value for last_msg.msg.cell_modem_status.reserved[162], expected 144, is %d", last_msg.msg.cell_modem_status.reserved[162]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[163] == 97, "incorrect value for last_msg.msg.cell_modem_status.reserved[163], expected 97, is %d", last_msg.msg.cell_modem_status.reserved[163]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[164] == 74, "incorrect value for last_msg.msg.cell_modem_status.reserved[164], expected 74, is %d", last_msg.msg.cell_modem_status.reserved[164]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[165] == 250, "incorrect value for last_msg.msg.cell_modem_status.reserved[165], expected 250, is %d", last_msg.msg.cell_modem_status.reserved[165]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[166] == 181, "incorrect value for last_msg.msg.cell_modem_status.reserved[166], expected 181, is %d", last_msg.msg.cell_modem_status.reserved[166]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[167] == 199, "incorrect value for last_msg.msg.cell_modem_status.reserved[167], expected 199, is %d", last_msg.msg.cell_modem_status.reserved[167]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[168] == 27, "incorrect value for last_msg.msg.cell_modem_status.reserved[168], expected 27, is %d", last_msg.msg.cell_modem_status.reserved[168]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[169] == 176, "incorrect value for last_msg.msg.cell_modem_status.reserved[169], expected 176, is %d", last_msg.msg.cell_modem_status.reserved[169]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[170] == 65, "incorrect value for last_msg.msg.cell_modem_status.reserved[170], expected 65, is %d", last_msg.msg.cell_modem_status.reserved[170]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[171] == 185, "incorrect value for last_msg.msg.cell_modem_status.reserved[171], expected 185, is %d", last_msg.msg.cell_modem_status.reserved[171]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[172] == 110, "incorrect value for last_msg.msg.cell_modem_status.reserved[172], expected 110, is %d", last_msg.msg.cell_modem_status.reserved[172]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[173] == 92, "incorrect value for last_msg.msg.cell_modem_status.reserved[173], expected 92, is %d", last_msg.msg.cell_modem_status.reserved[173]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[174] == 34, "incorrect value for last_msg.msg.cell_modem_status.reserved[174], expected 34, is %d", last_msg.msg.cell_modem_status.reserved[174]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[175] == 44, "incorrect value for last_msg.msg.cell_modem_status.reserved[175], expected 44, is %d", last_msg.msg.cell_modem_status.reserved[175]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[176] == 131, "incorrect value for last_msg.msg.cell_modem_status.reserved[176], expected 131, is %d", last_msg.msg.cell_modem_status.reserved[176]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[177] == 96, "incorrect value for last_msg.msg.cell_modem_status.reserved[177], expected 96, is %d", last_msg.msg.cell_modem_status.reserved[177]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[178] == 178, "incorrect value for last_msg.msg.cell_modem_status.reserved[178], expected 178, is %d", last_msg.msg.cell_modem_status.reserved[178]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[179] == 40, "incorrect value for last_msg.msg.cell_modem_status.reserved[179], expected 40, is %d", last_msg.msg.cell_modem_status.reserved[179]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[180] == 176, "incorrect value for last_msg.msg.cell_modem_status.reserved[180], expected 176, is %d", last_msg.msg.cell_modem_status.reserved[180]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[181] == 4, "incorrect value for last_msg.msg.cell_modem_status.reserved[181], expected 4, is %d", last_msg.msg.cell_modem_status.reserved[181]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[182] == 90, "incorrect value for last_msg.msg.cell_modem_status.reserved[182], expected 90, is %d", last_msg.msg.cell_modem_status.reserved[182]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[183] == 36, "incorrect value for last_msg.msg.cell_modem_status.reserved[183], expected 36, is %d", last_msg.msg.cell_modem_status.reserved[183]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[184] == 7, "incorrect value for last_msg.msg.cell_modem_status.reserved[184], expected 7, is %d", last_msg.msg.cell_modem_status.reserved[184]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[185] == 180, "incorrect value for last_msg.msg.cell_modem_status.reserved[185], expected 180, is %d", last_msg.msg.cell_modem_status.reserved[185]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[186] == 244, "incorrect value for last_msg.msg.cell_modem_status.reserved[186], expected 244, is %d", last_msg.msg.cell_modem_status.reserved[186]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[187] == 244, "incorrect value for last_msg.msg.cell_modem_status.reserved[187], expected 244, is %d", last_msg.msg.cell_modem_status.reserved[187]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[188] == 23, "incorrect value for last_msg.msg.cell_modem_status.reserved[188], expected 23, is %d", last_msg.msg.cell_modem_status.reserved[188]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[189] == 108, "incorrect value for last_msg.msg.cell_modem_status.reserved[189], expected 108, is %d", last_msg.msg.cell_modem_status.reserved[189]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[190] == 171, "incorrect value for last_msg.msg.cell_modem_status.reserved[190], expected 171, is %d", last_msg.msg.cell_modem_status.reserved[190]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[191] == 204, "incorrect value for last_msg.msg.cell_modem_status.reserved[191], expected 204, is %d", last_msg.msg.cell_modem_status.reserved[191]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[192] == 196, "incorrect value for last_msg.msg.cell_modem_status.reserved[192], expected 196, is %d", last_msg.msg.cell_modem_status.reserved[192]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[193] == 61, "incorrect value for last_msg.msg.cell_modem_status.reserved[193], expected 61, is %d", last_msg.msg.cell_modem_status.reserved[193]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[194] == 51, "incorrect value for last_msg.msg.cell_modem_status.reserved[194], expected 51, is %d", last_msg.msg.cell_modem_status.reserved[194]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[195] == 179, "incorrect value for last_msg.msg.cell_modem_status.reserved[195], expected 179, is %d", last_msg.msg.cell_modem_status.reserved[195]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[196] == 242, "incorrect value for last_msg.msg.cell_modem_status.reserved[196], expected 242, is %d", last_msg.msg.cell_modem_status.reserved[196]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[197] == 156, "incorrect value for last_msg.msg.cell_modem_status.reserved[197], expected 156, is %d", last_msg.msg.cell_modem_status.reserved[197]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[198] == 81, "incorrect value for last_msg.msg.cell_modem_status.reserved[198], expected 81, is %d", last_msg.msg.cell_modem_status.reserved[198]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[199] == 83, "incorrect value for last_msg.msg.cell_modem_status.reserved[199], expected 83, is %d", last_msg.msg.cell_modem_status.reserved[199]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[200] == 16, "incorrect value for last_msg.msg.cell_modem_status.reserved[200], expected 16, is %d", last_msg.msg.cell_modem_status.reserved[200]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[201] == 15, "incorrect value for last_msg.msg.cell_modem_status.reserved[201], expected 15, is %d", last_msg.msg.cell_modem_status.reserved[201]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[202] == 134, "incorrect value for last_msg.msg.cell_modem_status.reserved[202], expected 134, is %d", last_msg.msg.cell_modem_status.reserved[202]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[203] == 40, "incorrect value for last_msg.msg.cell_modem_status.reserved[203], expected 40, is %d", last_msg.msg.cell_modem_status.reserved[203]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[204] == 245, "incorrect value for last_msg.msg.cell_modem_status.reserved[204], expected 245, is %d", last_msg.msg.cell_modem_status.reserved[204]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[205] == 253, "incorrect value for last_msg.msg.cell_modem_status.reserved[205], expected 253, is %d", last_msg.msg.cell_modem_status.reserved[205]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[206] == 150, "incorrect value for last_msg.msg.cell_modem_status.reserved[206], expected 150, is %d", last_msg.msg.cell_modem_status.reserved[206]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[207] == 94, "incorrect value for last_msg.msg.cell_modem_status.reserved[207], expected 94, is %d", last_msg.msg.cell_modem_status.reserved[207]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[208] == 150, "incorrect value for last_msg.msg.cell_modem_status.reserved[208], expected 150, is %d", last_msg.msg.cell_modem_status.reserved[208]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[209] == 144, "incorrect value for last_msg.msg.cell_modem_status.reserved[209], expected 144, is %d", last_msg.msg.cell_modem_status.reserved[209]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[210] == 197, "incorrect value for last_msg.msg.cell_modem_status.reserved[210], expected 197, is %d", last_msg.msg.cell_modem_status.reserved[210]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[211] == 113, "incorrect value for last_msg.msg.cell_modem_status.reserved[211], expected 113, is %d", last_msg.msg.cell_modem_status.reserved[211]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[212] == 5, "incorrect value for last_msg.msg.cell_modem_status.reserved[212], expected 5, is %d", last_msg.msg.cell_modem_status.reserved[212]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[213] == 141, "incorrect value for last_msg.msg.cell_modem_status.reserved[213], expected 141, is %d", last_msg.msg.cell_modem_status.reserved[213]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[214] == 232, "incorrect value for last_msg.msg.cell_modem_status.reserved[214], expected 232, is %d", last_msg.msg.cell_modem_status.reserved[214]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[215] == 33, "incorrect value for last_msg.msg.cell_modem_status.reserved[215], expected 33, is %d", last_msg.msg.cell_modem_status.reserved[215]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[216] == 101, "incorrect value for last_msg.msg.cell_modem_status.reserved[216], expected 101, is %d", last_msg.msg.cell_modem_status.reserved[216]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[217] == 231, "incorrect value for last_msg.msg.cell_modem_status.reserved[217], expected 231, is %d", last_msg.msg.cell_modem_status.reserved[217]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[218] == 38, "incorrect value for last_msg.msg.cell_modem_status.reserved[218], expected 38, is %d", last_msg.msg.cell_modem_status.reserved[218]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[219] == 75, "incorrect value for last_msg.msg.cell_modem_status.reserved[219], expected 75, is %d", last_msg.msg.cell_modem_status.reserved[219]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[220] == 178, "incorrect value for last_msg.msg.cell_modem_status.reserved[220], expected 178, is %d", last_msg.msg.cell_modem_status.reserved[220]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[221] == 243, "incorrect value for last_msg.msg.cell_modem_status.reserved[221], expected 243, is %d", last_msg.msg.cell_modem_status.reserved[221]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[222] == 119, "incorrect value for last_msg.msg.cell_modem_status.reserved[222], expected 119, is %d", last_msg.msg.cell_modem_status.reserved[222]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[223] == 1, "incorrect value for last_msg.msg.cell_modem_status.reserved[223], expected 1, is %d", last_msg.msg.cell_modem_status.reserved[223]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[224] == 248, "incorrect value for last_msg.msg.cell_modem_status.reserved[224], expected 248, is %d", last_msg.msg.cell_modem_status.reserved[224]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[225] == 218, "incorrect value for last_msg.msg.cell_modem_status.reserved[225], expected 218, is %d", last_msg.msg.cell_modem_status.reserved[225]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[226] == 86, "incorrect value for last_msg.msg.cell_modem_status.reserved[226], expected 86, is %d", last_msg.msg.cell_modem_status.reserved[226]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[227] == 7, "incorrect value for last_msg.msg.cell_modem_status.reserved[227], expected 7, is %d", last_msg.msg.cell_modem_status.reserved[227]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[228] == 88, "incorrect value for last_msg.msg.cell_modem_status.reserved[228], expected 88, is %d", last_msg.msg.cell_modem_status.reserved[228]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[229] == 197, "incorrect value for last_msg.msg.cell_modem_status.reserved[229], expected 197, is %d", last_msg.msg.cell_modem_status.reserved[229]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[230] == 148, "incorrect value for last_msg.msg.cell_modem_status.reserved[230], expected 148, is %d", last_msg.msg.cell_modem_status.reserved[230]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[231] == 240, "incorrect value for last_msg.msg.cell_modem_status.reserved[231], expected 240, is %d", last_msg.msg.cell_modem_status.reserved[231]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[232] == 227, "incorrect value for last_msg.msg.cell_modem_status.reserved[232], expected 227, is %d", last_msg.msg.cell_modem_status.reserved[232]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[233] == 2, "incorrect value for last_msg.msg.cell_modem_status.reserved[233], expected 2, is %d", last_msg.msg.cell_modem_status.reserved[233]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[234] == 65, "incorrect value for last_msg.msg.cell_modem_status.reserved[234], expected 65, is %d", last_msg.msg.cell_modem_status.reserved[234]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[235] == 173, "incorrect value for last_msg.msg.cell_modem_status.reserved[235], expected 173, is %d", last_msg.msg.cell_modem_status.reserved[235]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[236] == 122, "incorrect value for last_msg.msg.cell_modem_status.reserved[236], expected 122, is %d", last_msg.msg.cell_modem_status.reserved[236]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[237] == 143, "incorrect value for last_msg.msg.cell_modem_status.reserved[237], expected 143, is %d", last_msg.msg.cell_modem_status.reserved[237]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[238] == 251, "incorrect value for last_msg.msg.cell_modem_status.reserved[238], expected 251, is %d", last_msg.msg.cell_modem_status.reserved[238]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[239] == 156, "incorrect value for last_msg.msg.cell_modem_status.reserved[239], expected 156, is %d", last_msg.msg.cell_modem_status.reserved[239]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[240] == 217, "incorrect value for last_msg.msg.cell_modem_status.reserved[240], expected 217, is %d", last_msg.msg.cell_modem_status.reserved[240]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[241] == 67, "incorrect value for last_msg.msg.cell_modem_status.reserved[241], expected 67, is %d", last_msg.msg.cell_modem_status.reserved[241]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[242] == 239, "incorrect value for last_msg.msg.cell_modem_status.reserved[242], expected 239, is %d", last_msg.msg.cell_modem_status.reserved[242]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[243] == 219, "incorrect value for last_msg.msg.cell_modem_status.reserved[243], expected 219, is %d", last_msg.msg.cell_modem_status.reserved[243]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[244] == 31, "incorrect value for last_msg.msg.cell_modem_status.reserved[244], expected 31, is %d", last_msg.msg.cell_modem_status.reserved[244]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[245] == 224, "incorrect value for last_msg.msg.cell_modem_status.reserved[245], expected 224, is %d", last_msg.msg.cell_modem_status.reserved[245]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[246] == 176, "incorrect value for last_msg.msg.cell_modem_status.reserved[246], expected 176, is %d", last_msg.msg.cell_modem_status.reserved[246]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[247] == 129, "incorrect value for last_msg.msg.cell_modem_status.reserved[247], expected 129, is %d", last_msg.msg.cell_modem_status.reserved[247]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[248] == 81, "incorrect value for last_msg.msg.cell_modem_status.reserved[248], expected 81, is %d", last_msg.msg.cell_modem_status.reserved[248]); - ck_assert_msg(last_msg.msg.cell_modem_status.reserved[249] == 80, "incorrect value for last_msg.msg.cell_modem_status.reserved[249], expected 80, is %d", last_msg.msg.cell_modem_status.reserved[249]); - - ck_assert_msg((last_msg.msg.cell_modem_status.signal_error_rate * 100 - 8588.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.cell_modem_status.signal_error_rate, expected 8588.20019531, is %s", last_msg.msg.cell_modem_status.signal_error_rate); - - ck_assert_msg(last_msg.msg.cell_modem_status.signal_strength == 103, "incorrect value for last_msg.msg.cell_modem_status.signal_strength, expected 103, is %d", last_msg.msg.cell_modem_status.signal_strength); + ck_assert_msg( + last_msg.msg.cell_modem_status.n_reserved == 250, + "incorrect value for last_msg.msg.cell_modem_status.n_reserved, " + "expected 250, is %d", + last_msg.msg.cell_modem_status.n_reserved); + + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[0] == 123, + "incorrect value for last_msg.msg.cell_modem_status.reserved[0], " + "expected 123, is %d", + last_msg.msg.cell_modem_status.reserved[0]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[1] == 242, + "incorrect value for last_msg.msg.cell_modem_status.reserved[1], " + "expected 242, is %d", + last_msg.msg.cell_modem_status.reserved[1]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[2] == 46, + "incorrect value for last_msg.msg.cell_modem_status.reserved[2], " + "expected 46, is %d", + last_msg.msg.cell_modem_status.reserved[2]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[3] == 52, + "incorrect value for last_msg.msg.cell_modem_status.reserved[3], " + "expected 52, is %d", + last_msg.msg.cell_modem_status.reserved[3]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[4] == 64, + "incorrect value for last_msg.msg.cell_modem_status.reserved[4], " + "expected 64, is %d", + last_msg.msg.cell_modem_status.reserved[4]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[5] == 176, + "incorrect value for last_msg.msg.cell_modem_status.reserved[5], " + "expected 176, is %d", + last_msg.msg.cell_modem_status.reserved[5]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[6] == 154, + "incorrect value for last_msg.msg.cell_modem_status.reserved[6], " + "expected 154, is %d", + last_msg.msg.cell_modem_status.reserved[6]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[7] == 98, + "incorrect value for last_msg.msg.cell_modem_status.reserved[7], " + "expected 98, is %d", + last_msg.msg.cell_modem_status.reserved[7]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[8] == 43, + "incorrect value for last_msg.msg.cell_modem_status.reserved[8], " + "expected 43, is %d", + last_msg.msg.cell_modem_status.reserved[8]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[9] == 132, + "incorrect value for last_msg.msg.cell_modem_status.reserved[9], " + "expected 132, is %d", + last_msg.msg.cell_modem_status.reserved[9]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[10] == 196, + "incorrect value for last_msg.msg.cell_modem_status.reserved[10], " + "expected 196, is %d", + last_msg.msg.cell_modem_status.reserved[10]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[11] == 89, + "incorrect value for last_msg.msg.cell_modem_status.reserved[11], " + "expected 89, is %d", + last_msg.msg.cell_modem_status.reserved[11]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[12] == 253, + "incorrect value for last_msg.msg.cell_modem_status.reserved[12], " + "expected 253, is %d", + last_msg.msg.cell_modem_status.reserved[12]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[13] == 161, + "incorrect value for last_msg.msg.cell_modem_status.reserved[13], " + "expected 161, is %d", + last_msg.msg.cell_modem_status.reserved[13]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[14] == 250, + "incorrect value for last_msg.msg.cell_modem_status.reserved[14], " + "expected 250, is %d", + last_msg.msg.cell_modem_status.reserved[14]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[15] == 174, + "incorrect value for last_msg.msg.cell_modem_status.reserved[15], " + "expected 174, is %d", + last_msg.msg.cell_modem_status.reserved[15]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[16] == 204, + "incorrect value for last_msg.msg.cell_modem_status.reserved[16], " + "expected 204, is %d", + last_msg.msg.cell_modem_status.reserved[16]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[17] == 110, + "incorrect value for last_msg.msg.cell_modem_status.reserved[17], " + "expected 110, is %d", + last_msg.msg.cell_modem_status.reserved[17]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[18] == 47, + "incorrect value for last_msg.msg.cell_modem_status.reserved[18], " + "expected 47, is %d", + last_msg.msg.cell_modem_status.reserved[18]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[19] == 38, + "incorrect value for last_msg.msg.cell_modem_status.reserved[19], " + "expected 38, is %d", + last_msg.msg.cell_modem_status.reserved[19]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[20] == 187, + "incorrect value for last_msg.msg.cell_modem_status.reserved[20], " + "expected 187, is %d", + last_msg.msg.cell_modem_status.reserved[20]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[21] == 63, + "incorrect value for last_msg.msg.cell_modem_status.reserved[21], " + "expected 63, is %d", + last_msg.msg.cell_modem_status.reserved[21]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[22] == 102, + "incorrect value for last_msg.msg.cell_modem_status.reserved[22], " + "expected 102, is %d", + last_msg.msg.cell_modem_status.reserved[22]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[23] == 177, + "incorrect value for last_msg.msg.cell_modem_status.reserved[23], " + "expected 177, is %d", + last_msg.msg.cell_modem_status.reserved[23]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[24] == 162, + "incorrect value for last_msg.msg.cell_modem_status.reserved[24], " + "expected 162, is %d", + last_msg.msg.cell_modem_status.reserved[24]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[25] == 49, + "incorrect value for last_msg.msg.cell_modem_status.reserved[25], " + "expected 49, is %d", + last_msg.msg.cell_modem_status.reserved[25]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[26] == 80, + "incorrect value for last_msg.msg.cell_modem_status.reserved[26], " + "expected 80, is %d", + last_msg.msg.cell_modem_status.reserved[26]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[27] == 194, + "incorrect value for last_msg.msg.cell_modem_status.reserved[27], " + "expected 194, is %d", + last_msg.msg.cell_modem_status.reserved[27]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[28] == 37, + "incorrect value for last_msg.msg.cell_modem_status.reserved[28], " + "expected 37, is %d", + last_msg.msg.cell_modem_status.reserved[28]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[29] == 107, + "incorrect value for last_msg.msg.cell_modem_status.reserved[29], " + "expected 107, is %d", + last_msg.msg.cell_modem_status.reserved[29]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[30] == 60, + "incorrect value for last_msg.msg.cell_modem_status.reserved[30], " + "expected 60, is %d", + last_msg.msg.cell_modem_status.reserved[30]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[31] == 225, + "incorrect value for last_msg.msg.cell_modem_status.reserved[31], " + "expected 225, is %d", + last_msg.msg.cell_modem_status.reserved[31]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[32] == 52, + "incorrect value for last_msg.msg.cell_modem_status.reserved[32], " + "expected 52, is %d", + last_msg.msg.cell_modem_status.reserved[32]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[33] == 101, + "incorrect value for last_msg.msg.cell_modem_status.reserved[33], " + "expected 101, is %d", + last_msg.msg.cell_modem_status.reserved[33]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[34] == 178, + "incorrect value for last_msg.msg.cell_modem_status.reserved[34], " + "expected 178, is %d", + last_msg.msg.cell_modem_status.reserved[34]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[35] == 142, + "incorrect value for last_msg.msg.cell_modem_status.reserved[35], " + "expected 142, is %d", + last_msg.msg.cell_modem_status.reserved[35]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[36] == 246, + "incorrect value for last_msg.msg.cell_modem_status.reserved[36], " + "expected 246, is %d", + last_msg.msg.cell_modem_status.reserved[36]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[37] == 21, + "incorrect value for last_msg.msg.cell_modem_status.reserved[37], " + "expected 21, is %d", + last_msg.msg.cell_modem_status.reserved[37]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[38] == 17, + "incorrect value for last_msg.msg.cell_modem_status.reserved[38], " + "expected 17, is %d", + last_msg.msg.cell_modem_status.reserved[38]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[39] == 93, + "incorrect value for last_msg.msg.cell_modem_status.reserved[39], " + "expected 93, is %d", + last_msg.msg.cell_modem_status.reserved[39]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[40] == 75, + "incorrect value for last_msg.msg.cell_modem_status.reserved[40], " + "expected 75, is %d", + last_msg.msg.cell_modem_status.reserved[40]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[41] == 169, + "incorrect value for last_msg.msg.cell_modem_status.reserved[41], " + "expected 169, is %d", + last_msg.msg.cell_modem_status.reserved[41]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[42] == 86, + "incorrect value for last_msg.msg.cell_modem_status.reserved[42], " + "expected 86, is %d", + last_msg.msg.cell_modem_status.reserved[42]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[43] == 16, + "incorrect value for last_msg.msg.cell_modem_status.reserved[43], " + "expected 16, is %d", + last_msg.msg.cell_modem_status.reserved[43]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[44] == 209, + "incorrect value for last_msg.msg.cell_modem_status.reserved[44], " + "expected 209, is %d", + last_msg.msg.cell_modem_status.reserved[44]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[45] == 80, + "incorrect value for last_msg.msg.cell_modem_status.reserved[45], " + "expected 80, is %d", + last_msg.msg.cell_modem_status.reserved[45]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[46] == 243, + "incorrect value for last_msg.msg.cell_modem_status.reserved[46], " + "expected 243, is %d", + last_msg.msg.cell_modem_status.reserved[46]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[47] == 30, + "incorrect value for last_msg.msg.cell_modem_status.reserved[47], " + "expected 30, is %d", + last_msg.msg.cell_modem_status.reserved[47]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[48] == 206, + "incorrect value for last_msg.msg.cell_modem_status.reserved[48], " + "expected 206, is %d", + last_msg.msg.cell_modem_status.reserved[48]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[49] == 220, + "incorrect value for last_msg.msg.cell_modem_status.reserved[49], " + "expected 220, is %d", + last_msg.msg.cell_modem_status.reserved[49]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[50] == 206, + "incorrect value for last_msg.msg.cell_modem_status.reserved[50], " + "expected 206, is %d", + last_msg.msg.cell_modem_status.reserved[50]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[51] == 115, + "incorrect value for last_msg.msg.cell_modem_status.reserved[51], " + "expected 115, is %d", + last_msg.msg.cell_modem_status.reserved[51]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[52] == 47, + "incorrect value for last_msg.msg.cell_modem_status.reserved[52], " + "expected 47, is %d", + last_msg.msg.cell_modem_status.reserved[52]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[53] == 154, + "incorrect value for last_msg.msg.cell_modem_status.reserved[53], " + "expected 154, is %d", + last_msg.msg.cell_modem_status.reserved[53]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[54] == 91, + "incorrect value for last_msg.msg.cell_modem_status.reserved[54], " + "expected 91, is %d", + last_msg.msg.cell_modem_status.reserved[54]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[55] == 227, + "incorrect value for last_msg.msg.cell_modem_status.reserved[55], " + "expected 227, is %d", + last_msg.msg.cell_modem_status.reserved[55]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[56] == 88, + "incorrect value for last_msg.msg.cell_modem_status.reserved[56], " + "expected 88, is %d", + last_msg.msg.cell_modem_status.reserved[56]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[57] == 11, + "incorrect value for last_msg.msg.cell_modem_status.reserved[57], " + "expected 11, is %d", + last_msg.msg.cell_modem_status.reserved[57]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[58] == 1, + "incorrect value for last_msg.msg.cell_modem_status.reserved[58], " + "expected 1, is %d", + last_msg.msg.cell_modem_status.reserved[58]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[59] == 85, + "incorrect value for last_msg.msg.cell_modem_status.reserved[59], " + "expected 85, is %d", + last_msg.msg.cell_modem_status.reserved[59]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[60] == 146, + "incorrect value for last_msg.msg.cell_modem_status.reserved[60], " + "expected 146, is %d", + last_msg.msg.cell_modem_status.reserved[60]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[61] == 100, + "incorrect value for last_msg.msg.cell_modem_status.reserved[61], " + "expected 100, is %d", + last_msg.msg.cell_modem_status.reserved[61]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[62] == 190, + "incorrect value for last_msg.msg.cell_modem_status.reserved[62], " + "expected 190, is %d", + last_msg.msg.cell_modem_status.reserved[62]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[63] == 232, + "incorrect value for last_msg.msg.cell_modem_status.reserved[63], " + "expected 232, is %d", + last_msg.msg.cell_modem_status.reserved[63]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[64] == 207, + "incorrect value for last_msg.msg.cell_modem_status.reserved[64], " + "expected 207, is %d", + last_msg.msg.cell_modem_status.reserved[64]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[65] == 61, + "incorrect value for last_msg.msg.cell_modem_status.reserved[65], " + "expected 61, is %d", + last_msg.msg.cell_modem_status.reserved[65]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[66] == 61, + "incorrect value for last_msg.msg.cell_modem_status.reserved[66], " + "expected 61, is %d", + last_msg.msg.cell_modem_status.reserved[66]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[67] == 201, + "incorrect value for last_msg.msg.cell_modem_status.reserved[67], " + "expected 201, is %d", + last_msg.msg.cell_modem_status.reserved[67]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[68] == 220, + "incorrect value for last_msg.msg.cell_modem_status.reserved[68], " + "expected 220, is %d", + last_msg.msg.cell_modem_status.reserved[68]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[69] == 31, + "incorrect value for last_msg.msg.cell_modem_status.reserved[69], " + "expected 31, is %d", + last_msg.msg.cell_modem_status.reserved[69]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[70] == 78, + "incorrect value for last_msg.msg.cell_modem_status.reserved[70], " + "expected 78, is %d", + last_msg.msg.cell_modem_status.reserved[70]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[71] == 34, + "incorrect value for last_msg.msg.cell_modem_status.reserved[71], " + "expected 34, is %d", + last_msg.msg.cell_modem_status.reserved[71]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[72] == 57, + "incorrect value for last_msg.msg.cell_modem_status.reserved[72], " + "expected 57, is %d", + last_msg.msg.cell_modem_status.reserved[72]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[73] == 82, + "incorrect value for last_msg.msg.cell_modem_status.reserved[73], " + "expected 82, is %d", + last_msg.msg.cell_modem_status.reserved[73]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[74] == 59, + "incorrect value for last_msg.msg.cell_modem_status.reserved[74], " + "expected 59, is %d", + last_msg.msg.cell_modem_status.reserved[74]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[75] == 104, + "incorrect value for last_msg.msg.cell_modem_status.reserved[75], " + "expected 104, is %d", + last_msg.msg.cell_modem_status.reserved[75]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[76] == 65, + "incorrect value for last_msg.msg.cell_modem_status.reserved[76], " + "expected 65, is %d", + last_msg.msg.cell_modem_status.reserved[76]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[77] == 221, + "incorrect value for last_msg.msg.cell_modem_status.reserved[77], " + "expected 221, is %d", + last_msg.msg.cell_modem_status.reserved[77]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[78] == 0, + "incorrect value for last_msg.msg.cell_modem_status.reserved[78], " + "expected 0, is %d", + last_msg.msg.cell_modem_status.reserved[78]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[79] == 43, + "incorrect value for last_msg.msg.cell_modem_status.reserved[79], " + "expected 43, is %d", + last_msg.msg.cell_modem_status.reserved[79]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[80] == 210, + "incorrect value for last_msg.msg.cell_modem_status.reserved[80], " + "expected 210, is %d", + last_msg.msg.cell_modem_status.reserved[80]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[81] == 9, + "incorrect value for last_msg.msg.cell_modem_status.reserved[81], " + "expected 9, is %d", + last_msg.msg.cell_modem_status.reserved[81]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[82] == 32, + "incorrect value for last_msg.msg.cell_modem_status.reserved[82], " + "expected 32, is %d", + last_msg.msg.cell_modem_status.reserved[82]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[83] == 122, + "incorrect value for last_msg.msg.cell_modem_status.reserved[83], " + "expected 122, is %d", + last_msg.msg.cell_modem_status.reserved[83]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[84] == 29, + "incorrect value for last_msg.msg.cell_modem_status.reserved[84], " + "expected 29, is %d", + last_msg.msg.cell_modem_status.reserved[84]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[85] == 237, + "incorrect value for last_msg.msg.cell_modem_status.reserved[85], " + "expected 237, is %d", + last_msg.msg.cell_modem_status.reserved[85]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[86] == 11, + "incorrect value for last_msg.msg.cell_modem_status.reserved[86], " + "expected 11, is %d", + last_msg.msg.cell_modem_status.reserved[86]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[87] == 151, + "incorrect value for last_msg.msg.cell_modem_status.reserved[87], " + "expected 151, is %d", + last_msg.msg.cell_modem_status.reserved[87]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[88] == 223, + "incorrect value for last_msg.msg.cell_modem_status.reserved[88], " + "expected 223, is %d", + last_msg.msg.cell_modem_status.reserved[88]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[89] == 18, + "incorrect value for last_msg.msg.cell_modem_status.reserved[89], " + "expected 18, is %d", + last_msg.msg.cell_modem_status.reserved[89]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[90] == 81, + "incorrect value for last_msg.msg.cell_modem_status.reserved[90], " + "expected 81, is %d", + last_msg.msg.cell_modem_status.reserved[90]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[91] == 204, + "incorrect value for last_msg.msg.cell_modem_status.reserved[91], " + "expected 204, is %d", + last_msg.msg.cell_modem_status.reserved[91]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[92] == 172, + "incorrect value for last_msg.msg.cell_modem_status.reserved[92], " + "expected 172, is %d", + last_msg.msg.cell_modem_status.reserved[92]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[93] == 234, + "incorrect value for last_msg.msg.cell_modem_status.reserved[93], " + "expected 234, is %d", + last_msg.msg.cell_modem_status.reserved[93]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[94] == 127, + "incorrect value for last_msg.msg.cell_modem_status.reserved[94], " + "expected 127, is %d", + last_msg.msg.cell_modem_status.reserved[94]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[95] == 3, + "incorrect value for last_msg.msg.cell_modem_status.reserved[95], " + "expected 3, is %d", + last_msg.msg.cell_modem_status.reserved[95]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[96] == 82, + "incorrect value for last_msg.msg.cell_modem_status.reserved[96], " + "expected 82, is %d", + last_msg.msg.cell_modem_status.reserved[96]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[97] == 133, + "incorrect value for last_msg.msg.cell_modem_status.reserved[97], " + "expected 133, is %d", + last_msg.msg.cell_modem_status.reserved[97]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[98] == 169, + "incorrect value for last_msg.msg.cell_modem_status.reserved[98], " + "expected 169, is %d", + last_msg.msg.cell_modem_status.reserved[98]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[99] == 12, + "incorrect value for last_msg.msg.cell_modem_status.reserved[99], " + "expected 12, is %d", + last_msg.msg.cell_modem_status.reserved[99]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[100] == 176, + "incorrect value for last_msg.msg.cell_modem_status.reserved[100], " + "expected 176, is %d", + last_msg.msg.cell_modem_status.reserved[100]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[101] == 193, + "incorrect value for last_msg.msg.cell_modem_status.reserved[101], " + "expected 193, is %d", + last_msg.msg.cell_modem_status.reserved[101]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[102] == 0, + "incorrect value for last_msg.msg.cell_modem_status.reserved[102], " + "expected 0, is %d", + last_msg.msg.cell_modem_status.reserved[102]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[103] == 24, + "incorrect value for last_msg.msg.cell_modem_status.reserved[103], " + "expected 24, is %d", + last_msg.msg.cell_modem_status.reserved[103]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[104] == 121, + "incorrect value for last_msg.msg.cell_modem_status.reserved[104], " + "expected 121, is %d", + last_msg.msg.cell_modem_status.reserved[104]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[105] == 85, + "incorrect value for last_msg.msg.cell_modem_status.reserved[105], " + "expected 85, is %d", + last_msg.msg.cell_modem_status.reserved[105]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[106] == 55, + "incorrect value for last_msg.msg.cell_modem_status.reserved[106], " + "expected 55, is %d", + last_msg.msg.cell_modem_status.reserved[106]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[107] == 214, + "incorrect value for last_msg.msg.cell_modem_status.reserved[107], " + "expected 214, is %d", + last_msg.msg.cell_modem_status.reserved[107]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[108] == 198, + "incorrect value for last_msg.msg.cell_modem_status.reserved[108], " + "expected 198, is %d", + last_msg.msg.cell_modem_status.reserved[108]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[109] == 75, + "incorrect value for last_msg.msg.cell_modem_status.reserved[109], " + "expected 75, is %d", + last_msg.msg.cell_modem_status.reserved[109]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[110] == 234, + "incorrect value for last_msg.msg.cell_modem_status.reserved[110], " + "expected 234, is %d", + last_msg.msg.cell_modem_status.reserved[110]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[111] == 179, + "incorrect value for last_msg.msg.cell_modem_status.reserved[111], " + "expected 179, is %d", + last_msg.msg.cell_modem_status.reserved[111]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[112] == 214, + "incorrect value for last_msg.msg.cell_modem_status.reserved[112], " + "expected 214, is %d", + last_msg.msg.cell_modem_status.reserved[112]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[113] == 85, + "incorrect value for last_msg.msg.cell_modem_status.reserved[113], " + "expected 85, is %d", + last_msg.msg.cell_modem_status.reserved[113]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[114] == 94, + "incorrect value for last_msg.msg.cell_modem_status.reserved[114], " + "expected 94, is %d", + last_msg.msg.cell_modem_status.reserved[114]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[115] == 115, + "incorrect value for last_msg.msg.cell_modem_status.reserved[115], " + "expected 115, is %d", + last_msg.msg.cell_modem_status.reserved[115]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[116] == 21, + "incorrect value for last_msg.msg.cell_modem_status.reserved[116], " + "expected 21, is %d", + last_msg.msg.cell_modem_status.reserved[116]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[117] == 73, + "incorrect value for last_msg.msg.cell_modem_status.reserved[117], " + "expected 73, is %d", + last_msg.msg.cell_modem_status.reserved[117]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[118] == 121, + "incorrect value for last_msg.msg.cell_modem_status.reserved[118], " + "expected 121, is %d", + last_msg.msg.cell_modem_status.reserved[118]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[119] == 75, + "incorrect value for last_msg.msg.cell_modem_status.reserved[119], " + "expected 75, is %d", + last_msg.msg.cell_modem_status.reserved[119]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[120] == 46, + "incorrect value for last_msg.msg.cell_modem_status.reserved[120], " + "expected 46, is %d", + last_msg.msg.cell_modem_status.reserved[120]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[121] == 158, + "incorrect value for last_msg.msg.cell_modem_status.reserved[121], " + "expected 158, is %d", + last_msg.msg.cell_modem_status.reserved[121]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[122] == 63, + "incorrect value for last_msg.msg.cell_modem_status.reserved[122], " + "expected 63, is %d", + last_msg.msg.cell_modem_status.reserved[122]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[123] == 100, + "incorrect value for last_msg.msg.cell_modem_status.reserved[123], " + "expected 100, is %d", + last_msg.msg.cell_modem_status.reserved[123]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[124] == 122, + "incorrect value for last_msg.msg.cell_modem_status.reserved[124], " + "expected 122, is %d", + last_msg.msg.cell_modem_status.reserved[124]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[125] == 213, + "incorrect value for last_msg.msg.cell_modem_status.reserved[125], " + "expected 213, is %d", + last_msg.msg.cell_modem_status.reserved[125]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[126] == 20, + "incorrect value for last_msg.msg.cell_modem_status.reserved[126], " + "expected 20, is %d", + last_msg.msg.cell_modem_status.reserved[126]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[127] == 85, + "incorrect value for last_msg.msg.cell_modem_status.reserved[127], " + "expected 85, is %d", + last_msg.msg.cell_modem_status.reserved[127]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[128] == 212, + "incorrect value for last_msg.msg.cell_modem_status.reserved[128], " + "expected 212, is %d", + last_msg.msg.cell_modem_status.reserved[128]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[129] == 131, + "incorrect value for last_msg.msg.cell_modem_status.reserved[129], " + "expected 131, is %d", + last_msg.msg.cell_modem_status.reserved[129]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[130] == 50, + "incorrect value for last_msg.msg.cell_modem_status.reserved[130], " + "expected 50, is %d", + last_msg.msg.cell_modem_status.reserved[130]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[131] == 224, + "incorrect value for last_msg.msg.cell_modem_status.reserved[131], " + "expected 224, is %d", + last_msg.msg.cell_modem_status.reserved[131]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[132] == 218, + "incorrect value for last_msg.msg.cell_modem_status.reserved[132], " + "expected 218, is %d", + last_msg.msg.cell_modem_status.reserved[132]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[133] == 215, + "incorrect value for last_msg.msg.cell_modem_status.reserved[133], " + "expected 215, is %d", + last_msg.msg.cell_modem_status.reserved[133]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[134] == 215, + "incorrect value for last_msg.msg.cell_modem_status.reserved[134], " + "expected 215, is %d", + last_msg.msg.cell_modem_status.reserved[134]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[135] == 149, + "incorrect value for last_msg.msg.cell_modem_status.reserved[135], " + "expected 149, is %d", + last_msg.msg.cell_modem_status.reserved[135]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[136] == 2, + "incorrect value for last_msg.msg.cell_modem_status.reserved[136], " + "expected 2, is %d", + last_msg.msg.cell_modem_status.reserved[136]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[137] == 19, + "incorrect value for last_msg.msg.cell_modem_status.reserved[137], " + "expected 19, is %d", + last_msg.msg.cell_modem_status.reserved[137]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[138] == 129, + "incorrect value for last_msg.msg.cell_modem_status.reserved[138], " + "expected 129, is %d", + last_msg.msg.cell_modem_status.reserved[138]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[139] == 39, + "incorrect value for last_msg.msg.cell_modem_status.reserved[139], " + "expected 39, is %d", + last_msg.msg.cell_modem_status.reserved[139]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[140] == 164, + "incorrect value for last_msg.msg.cell_modem_status.reserved[140], " + "expected 164, is %d", + last_msg.msg.cell_modem_status.reserved[140]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[141] == 5, + "incorrect value for last_msg.msg.cell_modem_status.reserved[141], " + "expected 5, is %d", + last_msg.msg.cell_modem_status.reserved[141]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[142] == 175, + "incorrect value for last_msg.msg.cell_modem_status.reserved[142], " + "expected 175, is %d", + last_msg.msg.cell_modem_status.reserved[142]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[143] == 6, + "incorrect value for last_msg.msg.cell_modem_status.reserved[143], " + "expected 6, is %d", + last_msg.msg.cell_modem_status.reserved[143]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[144] == 62, + "incorrect value for last_msg.msg.cell_modem_status.reserved[144], " + "expected 62, is %d", + last_msg.msg.cell_modem_status.reserved[144]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[145] == 51, + "incorrect value for last_msg.msg.cell_modem_status.reserved[145], " + "expected 51, is %d", + last_msg.msg.cell_modem_status.reserved[145]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[146] == 78, + "incorrect value for last_msg.msg.cell_modem_status.reserved[146], " + "expected 78, is %d", + last_msg.msg.cell_modem_status.reserved[146]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[147] == 66, + "incorrect value for last_msg.msg.cell_modem_status.reserved[147], " + "expected 66, is %d", + last_msg.msg.cell_modem_status.reserved[147]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[148] == 248, + "incorrect value for last_msg.msg.cell_modem_status.reserved[148], " + "expected 248, is %d", + last_msg.msg.cell_modem_status.reserved[148]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[149] == 116, + "incorrect value for last_msg.msg.cell_modem_status.reserved[149], " + "expected 116, is %d", + last_msg.msg.cell_modem_status.reserved[149]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[150] == 88, + "incorrect value for last_msg.msg.cell_modem_status.reserved[150], " + "expected 88, is %d", + last_msg.msg.cell_modem_status.reserved[150]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[151] == 90, + "incorrect value for last_msg.msg.cell_modem_status.reserved[151], " + "expected 90, is %d", + last_msg.msg.cell_modem_status.reserved[151]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[152] == 128, + "incorrect value for last_msg.msg.cell_modem_status.reserved[152], " + "expected 128, is %d", + last_msg.msg.cell_modem_status.reserved[152]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[153] == 226, + "incorrect value for last_msg.msg.cell_modem_status.reserved[153], " + "expected 226, is %d", + last_msg.msg.cell_modem_status.reserved[153]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[154] == 177, + "incorrect value for last_msg.msg.cell_modem_status.reserved[154], " + "expected 177, is %d", + last_msg.msg.cell_modem_status.reserved[154]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[155] == 0, + "incorrect value for last_msg.msg.cell_modem_status.reserved[155], " + "expected 0, is %d", + last_msg.msg.cell_modem_status.reserved[155]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[156] == 47, + "incorrect value for last_msg.msg.cell_modem_status.reserved[156], " + "expected 47, is %d", + last_msg.msg.cell_modem_status.reserved[156]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[157] == 140, + "incorrect value for last_msg.msg.cell_modem_status.reserved[157], " + "expected 140, is %d", + last_msg.msg.cell_modem_status.reserved[157]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[158] == 33, + "incorrect value for last_msg.msg.cell_modem_status.reserved[158], " + "expected 33, is %d", + last_msg.msg.cell_modem_status.reserved[158]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[159] == 126, + "incorrect value for last_msg.msg.cell_modem_status.reserved[159], " + "expected 126, is %d", + last_msg.msg.cell_modem_status.reserved[159]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[160] == 221, + "incorrect value for last_msg.msg.cell_modem_status.reserved[160], " + "expected 221, is %d", + last_msg.msg.cell_modem_status.reserved[160]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[161] == 110, + "incorrect value for last_msg.msg.cell_modem_status.reserved[161], " + "expected 110, is %d", + last_msg.msg.cell_modem_status.reserved[161]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[162] == 144, + "incorrect value for last_msg.msg.cell_modem_status.reserved[162], " + "expected 144, is %d", + last_msg.msg.cell_modem_status.reserved[162]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[163] == 97, + "incorrect value for last_msg.msg.cell_modem_status.reserved[163], " + "expected 97, is %d", + last_msg.msg.cell_modem_status.reserved[163]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[164] == 74, + "incorrect value for last_msg.msg.cell_modem_status.reserved[164], " + "expected 74, is %d", + last_msg.msg.cell_modem_status.reserved[164]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[165] == 250, + "incorrect value for last_msg.msg.cell_modem_status.reserved[165], " + "expected 250, is %d", + last_msg.msg.cell_modem_status.reserved[165]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[166] == 181, + "incorrect value for last_msg.msg.cell_modem_status.reserved[166], " + "expected 181, is %d", + last_msg.msg.cell_modem_status.reserved[166]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[167] == 199, + "incorrect value for last_msg.msg.cell_modem_status.reserved[167], " + "expected 199, is %d", + last_msg.msg.cell_modem_status.reserved[167]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[168] == 27, + "incorrect value for last_msg.msg.cell_modem_status.reserved[168], " + "expected 27, is %d", + last_msg.msg.cell_modem_status.reserved[168]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[169] == 176, + "incorrect value for last_msg.msg.cell_modem_status.reserved[169], " + "expected 176, is %d", + last_msg.msg.cell_modem_status.reserved[169]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[170] == 65, + "incorrect value for last_msg.msg.cell_modem_status.reserved[170], " + "expected 65, is %d", + last_msg.msg.cell_modem_status.reserved[170]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[171] == 185, + "incorrect value for last_msg.msg.cell_modem_status.reserved[171], " + "expected 185, is %d", + last_msg.msg.cell_modem_status.reserved[171]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[172] == 110, + "incorrect value for last_msg.msg.cell_modem_status.reserved[172], " + "expected 110, is %d", + last_msg.msg.cell_modem_status.reserved[172]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[173] == 92, + "incorrect value for last_msg.msg.cell_modem_status.reserved[173], " + "expected 92, is %d", + last_msg.msg.cell_modem_status.reserved[173]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[174] == 34, + "incorrect value for last_msg.msg.cell_modem_status.reserved[174], " + "expected 34, is %d", + last_msg.msg.cell_modem_status.reserved[174]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[175] == 44, + "incorrect value for last_msg.msg.cell_modem_status.reserved[175], " + "expected 44, is %d", + last_msg.msg.cell_modem_status.reserved[175]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[176] == 131, + "incorrect value for last_msg.msg.cell_modem_status.reserved[176], " + "expected 131, is %d", + last_msg.msg.cell_modem_status.reserved[176]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[177] == 96, + "incorrect value for last_msg.msg.cell_modem_status.reserved[177], " + "expected 96, is %d", + last_msg.msg.cell_modem_status.reserved[177]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[178] == 178, + "incorrect value for last_msg.msg.cell_modem_status.reserved[178], " + "expected 178, is %d", + last_msg.msg.cell_modem_status.reserved[178]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[179] == 40, + "incorrect value for last_msg.msg.cell_modem_status.reserved[179], " + "expected 40, is %d", + last_msg.msg.cell_modem_status.reserved[179]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[180] == 176, + "incorrect value for last_msg.msg.cell_modem_status.reserved[180], " + "expected 176, is %d", + last_msg.msg.cell_modem_status.reserved[180]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[181] == 4, + "incorrect value for last_msg.msg.cell_modem_status.reserved[181], " + "expected 4, is %d", + last_msg.msg.cell_modem_status.reserved[181]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[182] == 90, + "incorrect value for last_msg.msg.cell_modem_status.reserved[182], " + "expected 90, is %d", + last_msg.msg.cell_modem_status.reserved[182]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[183] == 36, + "incorrect value for last_msg.msg.cell_modem_status.reserved[183], " + "expected 36, is %d", + last_msg.msg.cell_modem_status.reserved[183]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[184] == 7, + "incorrect value for last_msg.msg.cell_modem_status.reserved[184], " + "expected 7, is %d", + last_msg.msg.cell_modem_status.reserved[184]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[185] == 180, + "incorrect value for last_msg.msg.cell_modem_status.reserved[185], " + "expected 180, is %d", + last_msg.msg.cell_modem_status.reserved[185]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[186] == 244, + "incorrect value for last_msg.msg.cell_modem_status.reserved[186], " + "expected 244, is %d", + last_msg.msg.cell_modem_status.reserved[186]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[187] == 244, + "incorrect value for last_msg.msg.cell_modem_status.reserved[187], " + "expected 244, is %d", + last_msg.msg.cell_modem_status.reserved[187]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[188] == 23, + "incorrect value for last_msg.msg.cell_modem_status.reserved[188], " + "expected 23, is %d", + last_msg.msg.cell_modem_status.reserved[188]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[189] == 108, + "incorrect value for last_msg.msg.cell_modem_status.reserved[189], " + "expected 108, is %d", + last_msg.msg.cell_modem_status.reserved[189]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[190] == 171, + "incorrect value for last_msg.msg.cell_modem_status.reserved[190], " + "expected 171, is %d", + last_msg.msg.cell_modem_status.reserved[190]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[191] == 204, + "incorrect value for last_msg.msg.cell_modem_status.reserved[191], " + "expected 204, is %d", + last_msg.msg.cell_modem_status.reserved[191]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[192] == 196, + "incorrect value for last_msg.msg.cell_modem_status.reserved[192], " + "expected 196, is %d", + last_msg.msg.cell_modem_status.reserved[192]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[193] == 61, + "incorrect value for last_msg.msg.cell_modem_status.reserved[193], " + "expected 61, is %d", + last_msg.msg.cell_modem_status.reserved[193]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[194] == 51, + "incorrect value for last_msg.msg.cell_modem_status.reserved[194], " + "expected 51, is %d", + last_msg.msg.cell_modem_status.reserved[194]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[195] == 179, + "incorrect value for last_msg.msg.cell_modem_status.reserved[195], " + "expected 179, is %d", + last_msg.msg.cell_modem_status.reserved[195]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[196] == 242, + "incorrect value for last_msg.msg.cell_modem_status.reserved[196], " + "expected 242, is %d", + last_msg.msg.cell_modem_status.reserved[196]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[197] == 156, + "incorrect value for last_msg.msg.cell_modem_status.reserved[197], " + "expected 156, is %d", + last_msg.msg.cell_modem_status.reserved[197]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[198] == 81, + "incorrect value for last_msg.msg.cell_modem_status.reserved[198], " + "expected 81, is %d", + last_msg.msg.cell_modem_status.reserved[198]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[199] == 83, + "incorrect value for last_msg.msg.cell_modem_status.reserved[199], " + "expected 83, is %d", + last_msg.msg.cell_modem_status.reserved[199]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[200] == 16, + "incorrect value for last_msg.msg.cell_modem_status.reserved[200], " + "expected 16, is %d", + last_msg.msg.cell_modem_status.reserved[200]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[201] == 15, + "incorrect value for last_msg.msg.cell_modem_status.reserved[201], " + "expected 15, is %d", + last_msg.msg.cell_modem_status.reserved[201]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[202] == 134, + "incorrect value for last_msg.msg.cell_modem_status.reserved[202], " + "expected 134, is %d", + last_msg.msg.cell_modem_status.reserved[202]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[203] == 40, + "incorrect value for last_msg.msg.cell_modem_status.reserved[203], " + "expected 40, is %d", + last_msg.msg.cell_modem_status.reserved[203]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[204] == 245, + "incorrect value for last_msg.msg.cell_modem_status.reserved[204], " + "expected 245, is %d", + last_msg.msg.cell_modem_status.reserved[204]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[205] == 253, + "incorrect value for last_msg.msg.cell_modem_status.reserved[205], " + "expected 253, is %d", + last_msg.msg.cell_modem_status.reserved[205]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[206] == 150, + "incorrect value for last_msg.msg.cell_modem_status.reserved[206], " + "expected 150, is %d", + last_msg.msg.cell_modem_status.reserved[206]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[207] == 94, + "incorrect value for last_msg.msg.cell_modem_status.reserved[207], " + "expected 94, is %d", + last_msg.msg.cell_modem_status.reserved[207]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[208] == 150, + "incorrect value for last_msg.msg.cell_modem_status.reserved[208], " + "expected 150, is %d", + last_msg.msg.cell_modem_status.reserved[208]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[209] == 144, + "incorrect value for last_msg.msg.cell_modem_status.reserved[209], " + "expected 144, is %d", + last_msg.msg.cell_modem_status.reserved[209]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[210] == 197, + "incorrect value for last_msg.msg.cell_modem_status.reserved[210], " + "expected 197, is %d", + last_msg.msg.cell_modem_status.reserved[210]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[211] == 113, + "incorrect value for last_msg.msg.cell_modem_status.reserved[211], " + "expected 113, is %d", + last_msg.msg.cell_modem_status.reserved[211]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[212] == 5, + "incorrect value for last_msg.msg.cell_modem_status.reserved[212], " + "expected 5, is %d", + last_msg.msg.cell_modem_status.reserved[212]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[213] == 141, + "incorrect value for last_msg.msg.cell_modem_status.reserved[213], " + "expected 141, is %d", + last_msg.msg.cell_modem_status.reserved[213]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[214] == 232, + "incorrect value for last_msg.msg.cell_modem_status.reserved[214], " + "expected 232, is %d", + last_msg.msg.cell_modem_status.reserved[214]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[215] == 33, + "incorrect value for last_msg.msg.cell_modem_status.reserved[215], " + "expected 33, is %d", + last_msg.msg.cell_modem_status.reserved[215]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[216] == 101, + "incorrect value for last_msg.msg.cell_modem_status.reserved[216], " + "expected 101, is %d", + last_msg.msg.cell_modem_status.reserved[216]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[217] == 231, + "incorrect value for last_msg.msg.cell_modem_status.reserved[217], " + "expected 231, is %d", + last_msg.msg.cell_modem_status.reserved[217]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[218] == 38, + "incorrect value for last_msg.msg.cell_modem_status.reserved[218], " + "expected 38, is %d", + last_msg.msg.cell_modem_status.reserved[218]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[219] == 75, + "incorrect value for last_msg.msg.cell_modem_status.reserved[219], " + "expected 75, is %d", + last_msg.msg.cell_modem_status.reserved[219]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[220] == 178, + "incorrect value for last_msg.msg.cell_modem_status.reserved[220], " + "expected 178, is %d", + last_msg.msg.cell_modem_status.reserved[220]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[221] == 243, + "incorrect value for last_msg.msg.cell_modem_status.reserved[221], " + "expected 243, is %d", + last_msg.msg.cell_modem_status.reserved[221]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[222] == 119, + "incorrect value for last_msg.msg.cell_modem_status.reserved[222], " + "expected 119, is %d", + last_msg.msg.cell_modem_status.reserved[222]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[223] == 1, + "incorrect value for last_msg.msg.cell_modem_status.reserved[223], " + "expected 1, is %d", + last_msg.msg.cell_modem_status.reserved[223]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[224] == 248, + "incorrect value for last_msg.msg.cell_modem_status.reserved[224], " + "expected 248, is %d", + last_msg.msg.cell_modem_status.reserved[224]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[225] == 218, + "incorrect value for last_msg.msg.cell_modem_status.reserved[225], " + "expected 218, is %d", + last_msg.msg.cell_modem_status.reserved[225]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[226] == 86, + "incorrect value for last_msg.msg.cell_modem_status.reserved[226], " + "expected 86, is %d", + last_msg.msg.cell_modem_status.reserved[226]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[227] == 7, + "incorrect value for last_msg.msg.cell_modem_status.reserved[227], " + "expected 7, is %d", + last_msg.msg.cell_modem_status.reserved[227]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[228] == 88, + "incorrect value for last_msg.msg.cell_modem_status.reserved[228], " + "expected 88, is %d", + last_msg.msg.cell_modem_status.reserved[228]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[229] == 197, + "incorrect value for last_msg.msg.cell_modem_status.reserved[229], " + "expected 197, is %d", + last_msg.msg.cell_modem_status.reserved[229]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[230] == 148, + "incorrect value for last_msg.msg.cell_modem_status.reserved[230], " + "expected 148, is %d", + last_msg.msg.cell_modem_status.reserved[230]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[231] == 240, + "incorrect value for last_msg.msg.cell_modem_status.reserved[231], " + "expected 240, is %d", + last_msg.msg.cell_modem_status.reserved[231]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[232] == 227, + "incorrect value for last_msg.msg.cell_modem_status.reserved[232], " + "expected 227, is %d", + last_msg.msg.cell_modem_status.reserved[232]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[233] == 2, + "incorrect value for last_msg.msg.cell_modem_status.reserved[233], " + "expected 2, is %d", + last_msg.msg.cell_modem_status.reserved[233]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[234] == 65, + "incorrect value for last_msg.msg.cell_modem_status.reserved[234], " + "expected 65, is %d", + last_msg.msg.cell_modem_status.reserved[234]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[235] == 173, + "incorrect value for last_msg.msg.cell_modem_status.reserved[235], " + "expected 173, is %d", + last_msg.msg.cell_modem_status.reserved[235]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[236] == 122, + "incorrect value for last_msg.msg.cell_modem_status.reserved[236], " + "expected 122, is %d", + last_msg.msg.cell_modem_status.reserved[236]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[237] == 143, + "incorrect value for last_msg.msg.cell_modem_status.reserved[237], " + "expected 143, is %d", + last_msg.msg.cell_modem_status.reserved[237]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[238] == 251, + "incorrect value for last_msg.msg.cell_modem_status.reserved[238], " + "expected 251, is %d", + last_msg.msg.cell_modem_status.reserved[238]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[239] == 156, + "incorrect value for last_msg.msg.cell_modem_status.reserved[239], " + "expected 156, is %d", + last_msg.msg.cell_modem_status.reserved[239]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[240] == 217, + "incorrect value for last_msg.msg.cell_modem_status.reserved[240], " + "expected 217, is %d", + last_msg.msg.cell_modem_status.reserved[240]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[241] == 67, + "incorrect value for last_msg.msg.cell_modem_status.reserved[241], " + "expected 67, is %d", + last_msg.msg.cell_modem_status.reserved[241]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[242] == 239, + "incorrect value for last_msg.msg.cell_modem_status.reserved[242], " + "expected 239, is %d", + last_msg.msg.cell_modem_status.reserved[242]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[243] == 219, + "incorrect value for last_msg.msg.cell_modem_status.reserved[243], " + "expected 219, is %d", + last_msg.msg.cell_modem_status.reserved[243]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[244] == 31, + "incorrect value for last_msg.msg.cell_modem_status.reserved[244], " + "expected 31, is %d", + last_msg.msg.cell_modem_status.reserved[244]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[245] == 224, + "incorrect value for last_msg.msg.cell_modem_status.reserved[245], " + "expected 224, is %d", + last_msg.msg.cell_modem_status.reserved[245]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[246] == 176, + "incorrect value for last_msg.msg.cell_modem_status.reserved[246], " + "expected 176, is %d", + last_msg.msg.cell_modem_status.reserved[246]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[247] == 129, + "incorrect value for last_msg.msg.cell_modem_status.reserved[247], " + "expected 129, is %d", + last_msg.msg.cell_modem_status.reserved[247]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[248] == 81, + "incorrect value for last_msg.msg.cell_modem_status.reserved[248], " + "expected 81, is %d", + last_msg.msg.cell_modem_status.reserved[248]); + ck_assert_msg( + last_msg.msg.cell_modem_status.reserved[249] == 80, + "incorrect value for last_msg.msg.cell_modem_status.reserved[249], " + "expected 80, is %d", + last_msg.msg.cell_modem_status.reserved[249]); + + ck_assert_msg( + (last_msg.msg.cell_modem_status.signal_error_rate * 100 - + 8588.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.cell_modem_status.signal_error_rate, " + "expected 8588.20019531, is %s", + last_msg.msg.cell_modem_status.signal_error_rate); + + ck_assert_msg( + last_msg.msg.cell_modem_status.signal_strength == 103, + "incorrect value for last_msg.msg.cell_modem_status.signal_strength, " + "expected 103, is %d", + last_msg.msg.cell_modem_status.signal_strength); } } END_TEST -Suite* auto_check_sbp_piksi_MsgCellModemStatus_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgCellModemStatus"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgCellModemStatus"); +Suite *auto_check_sbp_piksi_MsgCellModemStatus_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgCellModemStatus"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgCellModemStatus"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgCellModemStatus); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgCommandOutput.c b/c/test/auto_check_sbp_piksi_MsgCommandOutput.c index a1575a434..ce038960d 100644 --- a/c/test/auto_check_sbp_piksi_MsgCommandOutput.c +++ b/c/test/auto_check_sbp_piksi_MsgCommandOutput.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandOutput.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandOutput.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgCommandOutput ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgCommandOutput) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgCommandOutput ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,57 +90,77 @@ START_TEST( test_auto_check_sbp_piksi_MsgCommandOutput ) logging_reset(); - sbp_callback_register(&sbp_state, 0xbc, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xbc, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,188,0,50,84,20,126,164,116,149,83,111,109,101,32,111,117,116,112,117,116,32,116,101,120,116,11,109, }; + u8 encoded_frame[] = { + 85, 188, 0, 50, 84, 20, 126, 164, 116, 149, 83, 111, 109, 101, + 32, 111, 117, 116, 112, 117, 116, 32, 116, 101, 120, 116, 11, 109, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_command_output_line_set(&test_msg.command_output, "Some output text", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("Some output text"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_command_output_line_encoded_len(&test_msg.command_output) == 16, "String not encoded properly"); - + ck_assert_msg( + sbp_msg_command_output_line_set(&test_msg.command_output, + "Some output text", false, &written), + "Can't assign text"); + ck_assert_msg(written == strlen("Some output text"), + "Wrote different to expected"); + ck_assert_msg( + sbp_msg_command_output_line_encoded_len(&test_msg.command_output) == 16, + "String not encoded properly"); + test_msg.command_output.sequence = 2507449470; - sbp_message_send(&sbp_state, SbpMsgCommandOutput, 21554, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgCommandOutput, 21554, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 21554, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgCommandOutput, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgCommandOutput, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_command_output_line_encoded_len(&last_msg.msg.command_output) == 16, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_command_output_line_get(&last_msg.msg.command_output), "Some output text") == 0, "String not decoded properly"); - - ck_assert_msg(last_msg.msg.command_output.sequence == 2507449470, "incorrect value for last_msg.msg.command_output.sequence, expected 2507449470, is %d", last_msg.msg.command_output.sequence); + ck_assert_msg(sbp_msg_command_output_line_encoded_len( + &last_msg.msg.command_output) == 16, + "Invalid encoded len"); + ck_assert_msg( + strcmp(sbp_msg_command_output_line_get(&last_msg.msg.command_output), + "Some output text") == 0, + "String not decoded properly"); + + ck_assert_msg(last_msg.msg.command_output.sequence == 2507449470, + "incorrect value for last_msg.msg.command_output.sequence, " + "expected 2507449470, is %d", + last_msg.msg.command_output.sequence); } } END_TEST -Suite* auto_check_sbp_piksi_MsgCommandOutput_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgCommandOutput"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgCommandOutput"); +Suite *auto_check_sbp_piksi_MsgCommandOutput_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgCommandOutput"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgCommandOutput"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgCommandOutput); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgCommandReq.c b/c/test/auto_check_sbp_piksi_MsgCommandReq.c index 53c170778..eabaabc96 100644 --- a/c/test/auto_check_sbp_piksi_MsgCommandReq.c +++ b/c/test/auto_check_sbp_piksi_MsgCommandReq.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandReq.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgCommandReq ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgCommandReq) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgCommandReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,57 +90,78 @@ START_TEST( test_auto_check_sbp_piksi_MsgCommandReq ) logging_reset(); - sbp_callback_register(&sbp_state, 0xb8, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xb8, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,184,0,170,184,31,51,77,163,104,47,112,97,116,104,47,116,111,47,99,111,109,109,97,110,100,32,119,105,116,104,32,97,114,103,115,0,38,24, }; + u8 encoded_frame[] = { + 85, 184, 0, 170, 184, 31, 51, 77, 163, 104, 47, 112, 97, + 116, 104, 47, 116, 111, 47, 99, 111, 109, 109, 97, 110, 100, + 32, 119, 105, 116, 104, 32, 97, 114, 103, 115, 0, 38, 24, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + size_t written; - ck_assert_msg(sbp_msg_command_req_command_set(&test_msg.command_req, "/path/to/command with args", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("/path/to/command with args"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_command_req_command_encoded_len(&test_msg.command_req) == 27, "String not encoded properly"); - + ck_assert_msg(sbp_msg_command_req_command_set(&test_msg.command_req, + "/path/to/command with args", + false, &written), + "Can't assign text"); + ck_assert_msg(written == strlen("/path/to/command with args"), + "Wrote different to expected"); + ck_assert_msg( + sbp_msg_command_req_command_encoded_len(&test_msg.command_req) == 27, + "String not encoded properly"); + test_msg.command_req.sequence = 1755532595; - sbp_message_send(&sbp_state, SbpMsgCommandReq, 47274, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgCommandReq, 47274, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 47274, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgCommandReq, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgCommandReq, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_command_req_command_encoded_len(&last_msg.msg.command_req) == 27, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_command_req_command_get(&last_msg.msg.command_req), "/path/to/command with args") == 0, "String not decoded properly"); - - ck_assert_msg(last_msg.msg.command_req.sequence == 1755532595, "incorrect value for last_msg.msg.command_req.sequence, expected 1755532595, is %d", last_msg.msg.command_req.sequence); + ck_assert_msg(sbp_msg_command_req_command_encoded_len( + &last_msg.msg.command_req) == 27, + "Invalid encoded len"); + ck_assert_msg( + strcmp(sbp_msg_command_req_command_get(&last_msg.msg.command_req), + "/path/to/command with args") == 0, + "String not decoded properly"); + + ck_assert_msg(last_msg.msg.command_req.sequence == 1755532595, + "incorrect value for last_msg.msg.command_req.sequence, " + "expected 1755532595, is %d", + last_msg.msg.command_req.sequence); } } END_TEST -Suite* auto_check_sbp_piksi_MsgCommandReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgCommandReq"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgCommandReq"); +Suite *auto_check_sbp_piksi_MsgCommandReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgCommandReq"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgCommandReq"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgCommandReq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgCommandResp.c b/c/test/auto_check_sbp_piksi_MsgCommandResp.c index 0bb991982..794fd0535 100644 --- a/c/test/auto_check_sbp_piksi_MsgCommandResp.c +++ b/c/test/auto_check_sbp_piksi_MsgCommandResp.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandResp.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgCommandResp ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgCommandResp) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgCommandResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,51 +90,65 @@ START_TEST( test_auto_check_sbp_piksi_MsgCommandResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xb9, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xb9, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,185,0,57,206,8,118,215,131,160,210,110,150,103,164,240, }; + u8 encoded_frame[] = { + 85, 185, 0, 57, 206, 8, 118, 215, + 131, 160, 210, 110, 150, 103, 164, 240, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.command_resp.code = 1737912018; - + test_msg.command_resp.sequence = 2692994934; - sbp_message_send(&sbp_state, SbpMsgCommandResp, 52793, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgCommandResp, 52793, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 52793, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgCommandResp, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgCommandResp, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.command_resp.code == 1737912018, "incorrect value for last_msg.msg.command_resp.code, expected 1737912018, is %d", last_msg.msg.command_resp.code); - - ck_assert_msg(last_msg.msg.command_resp.sequence == 2692994934, "incorrect value for last_msg.msg.command_resp.sequence, expected 2692994934, is %d", last_msg.msg.command_resp.sequence); + ck_assert_msg(last_msg.msg.command_resp.code == 1737912018, + "incorrect value for last_msg.msg.command_resp.code, " + "expected 1737912018, is %d", + last_msg.msg.command_resp.code); + + ck_assert_msg(last_msg.msg.command_resp.sequence == 2692994934, + "incorrect value for last_msg.msg.command_resp.sequence, " + "expected 2692994934, is %d", + last_msg.msg.command_resp.sequence); } } END_TEST -Suite* auto_check_sbp_piksi_MsgCommandResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgCommandResp"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgCommandResp"); +Suite *auto_check_sbp_piksi_MsgCommandResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgCommandResp"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgCommandResp"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgCommandResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgCwResults.c b/c/test/auto_check_sbp_piksi_MsgCwResults.c index 3565f5c7d..c8c429231 100644 --- a/c/test/auto_check_sbp_piksi_MsgCwResults.c +++ b/c/test/auto_check_sbp_piksi_MsgCwResults.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwResults.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwResults.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgCwResults ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgCwResults) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgCwResults ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,43 +90,50 @@ START_TEST( test_auto_check_sbp_piksi_MsgCwResults ) logging_reset(); - sbp_callback_register(&sbp_state, 0xc0, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xc0, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,192,0,99,246,0,228,72, }; + u8 encoded_frame[] = { + 85, 192, 0, 99, 246, 0, 228, 72, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - sbp_message_send(&sbp_state, SbpMsgCwResults, 63075, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgCwResults, 63075, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 63075, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgCwResults, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgCwResults, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - } } END_TEST -Suite* auto_check_sbp_piksi_MsgCwResults_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgCwResults"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgCwResults"); +Suite *auto_check_sbp_piksi_MsgCwResults_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgCwResults"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgCwResults"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgCwResults); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgCwStart.c b/c/test/auto_check_sbp_piksi_MsgCwStart.c index 7b984c35d..be318e05b 100644 --- a/c/test/auto_check_sbp_piksi_MsgCwStart.c +++ b/c/test/auto_check_sbp_piksi_MsgCwStart.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwStart.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwStart.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgCwStart ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgCwStart) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgCwStart ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,9 +90,12 @@ START_TEST( test_auto_check_sbp_piksi_MsgCwStart ) logging_reset(); - sbp_callback_register(&sbp_state, 0xc1, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xc1, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,193,0,30,179,0,213,138, }; + u8 encoded_frame[] = { + 85, 193, 0, 30, 179, 0, 213, 138, + }; dummy_reset(); @@ -106,31 +105,33 @@ START_TEST( test_auto_check_sbp_piksi_MsgCwStart ) sbp_message_send(&sbp_state, SbpMsgCwStart, 45854, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 45854, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgCwStart, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - + "Sent and received messages did not compare equal"); } } END_TEST -Suite* auto_check_sbp_piksi_MsgCwStart_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgCwStart"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgCwStart"); +Suite *auto_check_sbp_piksi_MsgCwStart_suite(void) { + Suite *s = + suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgCwStart"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgCwStart"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgCwStart); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgDeviceMonitor.c b/c/test/auto_check_sbp_piksi_MsgDeviceMonitor.c index 21e28a88b..eb0b1d4b5 100644 --- a/c/test/auto_check_sbp_piksi_MsgDeviceMonitor.c +++ b/c/test/auto_check_sbp_piksi_MsgDeviceMonitor.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgDeviceMonitor.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgDeviceMonitor.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgDeviceMonitor ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgDeviceMonitor) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgDeviceMonitor ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,60 +90,85 @@ START_TEST( test_auto_check_sbp_piksi_MsgDeviceMonitor ) logging_reset(); - sbp_callback_register(&sbp_state, 0xb5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xb5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,181,0,95,66,10,241,216,219,3,253,6,21,24,168,18,207,233, }; + u8 encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 219, + 3, 253, 6, 21, 24, 168, 18, 207, 233, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.device_monitor.cpu_temperature = 6165; - + test_msg.device_monitor.cpu_vaux = 1789; - + test_msg.device_monitor.cpu_vint = 987; - + test_msg.device_monitor.dev_vin = -9999; - + test_msg.device_monitor.fe_temperature = 4776; - sbp_message_send(&sbp_state, SbpMsgDeviceMonitor, 16991, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgDeviceMonitor, 16991, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 16991, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgDeviceMonitor, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgDeviceMonitor, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.device_monitor.cpu_temperature == 6165, "incorrect value for last_msg.msg.device_monitor.cpu_temperature, expected 6165, is %d", last_msg.msg.device_monitor.cpu_temperature); - - ck_assert_msg(last_msg.msg.device_monitor.cpu_vaux == 1789, "incorrect value for last_msg.msg.device_monitor.cpu_vaux, expected 1789, is %d", last_msg.msg.device_monitor.cpu_vaux); - - ck_assert_msg(last_msg.msg.device_monitor.cpu_vint == 987, "incorrect value for last_msg.msg.device_monitor.cpu_vint, expected 987, is %d", last_msg.msg.device_monitor.cpu_vint); - - ck_assert_msg(last_msg.msg.device_monitor.dev_vin == -9999, "incorrect value for last_msg.msg.device_monitor.dev_vin, expected -9999, is %d", last_msg.msg.device_monitor.dev_vin); - - ck_assert_msg(last_msg.msg.device_monitor.fe_temperature == 4776, "incorrect value for last_msg.msg.device_monitor.fe_temperature, expected 4776, is %d", last_msg.msg.device_monitor.fe_temperature); + ck_assert_msg( + last_msg.msg.device_monitor.cpu_temperature == 6165, + "incorrect value for last_msg.msg.device_monitor.cpu_temperature, " + "expected 6165, is %d", + last_msg.msg.device_monitor.cpu_temperature); + + ck_assert_msg(last_msg.msg.device_monitor.cpu_vaux == 1789, + "incorrect value for last_msg.msg.device_monitor.cpu_vaux, " + "expected 1789, is %d", + last_msg.msg.device_monitor.cpu_vaux); + + ck_assert_msg(last_msg.msg.device_monitor.cpu_vint == 987, + "incorrect value for last_msg.msg.device_monitor.cpu_vint, " + "expected 987, is %d", + last_msg.msg.device_monitor.cpu_vint); + + ck_assert_msg(last_msg.msg.device_monitor.dev_vin == -9999, + "incorrect value for last_msg.msg.device_monitor.dev_vin, " + "expected -9999, is %d", + last_msg.msg.device_monitor.dev_vin); + + ck_assert_msg( + last_msg.msg.device_monitor.fe_temperature == 4776, + "incorrect value for last_msg.msg.device_monitor.fe_temperature, " + "expected 4776, is %d", + last_msg.msg.device_monitor.fe_temperature); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -155,60 +176,85 @@ START_TEST( test_auto_check_sbp_piksi_MsgDeviceMonitor ) logging_reset(); - sbp_callback_register(&sbp_state, 0xb5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xb5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,181,0,95,66,10,241,216,219,3,254,6,24,24,168,18,169,30, }; + u8 encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 219, + 3, 254, 6, 24, 24, 168, 18, 169, 30, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.device_monitor.cpu_temperature = 6168; - + test_msg.device_monitor.cpu_vaux = 1790; - + test_msg.device_monitor.cpu_vint = 987; - + test_msg.device_monitor.dev_vin = -9999; - + test_msg.device_monitor.fe_temperature = 4776; - sbp_message_send(&sbp_state, SbpMsgDeviceMonitor, 16991, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgDeviceMonitor, 16991, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 16991, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgDeviceMonitor, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgDeviceMonitor, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.device_monitor.cpu_temperature == 6168, "incorrect value for last_msg.msg.device_monitor.cpu_temperature, expected 6168, is %d", last_msg.msg.device_monitor.cpu_temperature); - - ck_assert_msg(last_msg.msg.device_monitor.cpu_vaux == 1790, "incorrect value for last_msg.msg.device_monitor.cpu_vaux, expected 1790, is %d", last_msg.msg.device_monitor.cpu_vaux); - - ck_assert_msg(last_msg.msg.device_monitor.cpu_vint == 987, "incorrect value for last_msg.msg.device_monitor.cpu_vint, expected 987, is %d", last_msg.msg.device_monitor.cpu_vint); - - ck_assert_msg(last_msg.msg.device_monitor.dev_vin == -9999, "incorrect value for last_msg.msg.device_monitor.dev_vin, expected -9999, is %d", last_msg.msg.device_monitor.dev_vin); - - ck_assert_msg(last_msg.msg.device_monitor.fe_temperature == 4776, "incorrect value for last_msg.msg.device_monitor.fe_temperature, expected 4776, is %d", last_msg.msg.device_monitor.fe_temperature); + ck_assert_msg( + last_msg.msg.device_monitor.cpu_temperature == 6168, + "incorrect value for last_msg.msg.device_monitor.cpu_temperature, " + "expected 6168, is %d", + last_msg.msg.device_monitor.cpu_temperature); + + ck_assert_msg(last_msg.msg.device_monitor.cpu_vaux == 1790, + "incorrect value for last_msg.msg.device_monitor.cpu_vaux, " + "expected 1790, is %d", + last_msg.msg.device_monitor.cpu_vaux); + + ck_assert_msg(last_msg.msg.device_monitor.cpu_vint == 987, + "incorrect value for last_msg.msg.device_monitor.cpu_vint, " + "expected 987, is %d", + last_msg.msg.device_monitor.cpu_vint); + + ck_assert_msg(last_msg.msg.device_monitor.dev_vin == -9999, + "incorrect value for last_msg.msg.device_monitor.dev_vin, " + "expected -9999, is %d", + last_msg.msg.device_monitor.dev_vin); + + ck_assert_msg( + last_msg.msg.device_monitor.fe_temperature == 4776, + "incorrect value for last_msg.msg.device_monitor.fe_temperature, " + "expected 4776, is %d", + last_msg.msg.device_monitor.fe_temperature); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -216,60 +262,85 @@ START_TEST( test_auto_check_sbp_piksi_MsgDeviceMonitor ) logging_reset(); - sbp_callback_register(&sbp_state, 0xb5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xb5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,181,0,95,66,10,241,216,219,3,253,6,22,24,168,18,19,114, }; + u8 encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 219, + 3, 253, 6, 22, 24, 168, 18, 19, 114, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.device_monitor.cpu_temperature = 6166; - + test_msg.device_monitor.cpu_vaux = 1789; - + test_msg.device_monitor.cpu_vint = 987; - + test_msg.device_monitor.dev_vin = -9999; - + test_msg.device_monitor.fe_temperature = 4776; - sbp_message_send(&sbp_state, SbpMsgDeviceMonitor, 16991, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgDeviceMonitor, 16991, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 16991, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgDeviceMonitor, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgDeviceMonitor, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.device_monitor.cpu_temperature == 6166, "incorrect value for last_msg.msg.device_monitor.cpu_temperature, expected 6166, is %d", last_msg.msg.device_monitor.cpu_temperature); - - ck_assert_msg(last_msg.msg.device_monitor.cpu_vaux == 1789, "incorrect value for last_msg.msg.device_monitor.cpu_vaux, expected 1789, is %d", last_msg.msg.device_monitor.cpu_vaux); - - ck_assert_msg(last_msg.msg.device_monitor.cpu_vint == 987, "incorrect value for last_msg.msg.device_monitor.cpu_vint, expected 987, is %d", last_msg.msg.device_monitor.cpu_vint); - - ck_assert_msg(last_msg.msg.device_monitor.dev_vin == -9999, "incorrect value for last_msg.msg.device_monitor.dev_vin, expected -9999, is %d", last_msg.msg.device_monitor.dev_vin); - - ck_assert_msg(last_msg.msg.device_monitor.fe_temperature == 4776, "incorrect value for last_msg.msg.device_monitor.fe_temperature, expected 4776, is %d", last_msg.msg.device_monitor.fe_temperature); + ck_assert_msg( + last_msg.msg.device_monitor.cpu_temperature == 6166, + "incorrect value for last_msg.msg.device_monitor.cpu_temperature, " + "expected 6166, is %d", + last_msg.msg.device_monitor.cpu_temperature); + + ck_assert_msg(last_msg.msg.device_monitor.cpu_vaux == 1789, + "incorrect value for last_msg.msg.device_monitor.cpu_vaux, " + "expected 1789, is %d", + last_msg.msg.device_monitor.cpu_vaux); + + ck_assert_msg(last_msg.msg.device_monitor.cpu_vint == 987, + "incorrect value for last_msg.msg.device_monitor.cpu_vint, " + "expected 987, is %d", + last_msg.msg.device_monitor.cpu_vint); + + ck_assert_msg(last_msg.msg.device_monitor.dev_vin == -9999, + "incorrect value for last_msg.msg.device_monitor.dev_vin, " + "expected -9999, is %d", + last_msg.msg.device_monitor.dev_vin); + + ck_assert_msg( + last_msg.msg.device_monitor.fe_temperature == 4776, + "incorrect value for last_msg.msg.device_monitor.fe_temperature, " + "expected 4776, is %d", + last_msg.msg.device_monitor.fe_temperature); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -277,60 +348,85 @@ START_TEST( test_auto_check_sbp_piksi_MsgDeviceMonitor ) logging_reset(); - sbp_callback_register(&sbp_state, 0xb5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xb5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,181,0,95,66,10,241,216,218,3,252,6,6,24,168,18,199,107, }; + u8 encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 218, + 3, 252, 6, 6, 24, 168, 18, 199, 107, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.device_monitor.cpu_temperature = 6150; - + test_msg.device_monitor.cpu_vaux = 1788; - + test_msg.device_monitor.cpu_vint = 986; - + test_msg.device_monitor.dev_vin = -9999; - + test_msg.device_monitor.fe_temperature = 4776; - sbp_message_send(&sbp_state, SbpMsgDeviceMonitor, 16991, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgDeviceMonitor, 16991, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 16991, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgDeviceMonitor, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgDeviceMonitor, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.device_monitor.cpu_temperature == 6150, "incorrect value for last_msg.msg.device_monitor.cpu_temperature, expected 6150, is %d", last_msg.msg.device_monitor.cpu_temperature); - - ck_assert_msg(last_msg.msg.device_monitor.cpu_vaux == 1788, "incorrect value for last_msg.msg.device_monitor.cpu_vaux, expected 1788, is %d", last_msg.msg.device_monitor.cpu_vaux); - - ck_assert_msg(last_msg.msg.device_monitor.cpu_vint == 986, "incorrect value for last_msg.msg.device_monitor.cpu_vint, expected 986, is %d", last_msg.msg.device_monitor.cpu_vint); - - ck_assert_msg(last_msg.msg.device_monitor.dev_vin == -9999, "incorrect value for last_msg.msg.device_monitor.dev_vin, expected -9999, is %d", last_msg.msg.device_monitor.dev_vin); - - ck_assert_msg(last_msg.msg.device_monitor.fe_temperature == 4776, "incorrect value for last_msg.msg.device_monitor.fe_temperature, expected 4776, is %d", last_msg.msg.device_monitor.fe_temperature); + ck_assert_msg( + last_msg.msg.device_monitor.cpu_temperature == 6150, + "incorrect value for last_msg.msg.device_monitor.cpu_temperature, " + "expected 6150, is %d", + last_msg.msg.device_monitor.cpu_temperature); + + ck_assert_msg(last_msg.msg.device_monitor.cpu_vaux == 1788, + "incorrect value for last_msg.msg.device_monitor.cpu_vaux, " + "expected 1788, is %d", + last_msg.msg.device_monitor.cpu_vaux); + + ck_assert_msg(last_msg.msg.device_monitor.cpu_vint == 986, + "incorrect value for last_msg.msg.device_monitor.cpu_vint, " + "expected 986, is %d", + last_msg.msg.device_monitor.cpu_vint); + + ck_assert_msg(last_msg.msg.device_monitor.dev_vin == -9999, + "incorrect value for last_msg.msg.device_monitor.dev_vin, " + "expected -9999, is %d", + last_msg.msg.device_monitor.dev_vin); + + ck_assert_msg( + last_msg.msg.device_monitor.fe_temperature == 4776, + "incorrect value for last_msg.msg.device_monitor.fe_temperature, " + "expected 4776, is %d", + last_msg.msg.device_monitor.fe_temperature); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -338,63 +434,88 @@ START_TEST( test_auto_check_sbp_piksi_MsgDeviceMonitor ) logging_reset(); - sbp_callback_register(&sbp_state, 0xb5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xb5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,181,0,95,66,10,241,216,220,3,253,6,235,23,168,18,241,63, }; + u8 encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 220, + 3, 253, 6, 235, 23, 168, 18, 241, 63, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.device_monitor.cpu_temperature = 6123; - + test_msg.device_monitor.cpu_vaux = 1789; - + test_msg.device_monitor.cpu_vint = 988; - + test_msg.device_monitor.dev_vin = -9999; - + test_msg.device_monitor.fe_temperature = 4776; - sbp_message_send(&sbp_state, SbpMsgDeviceMonitor, 16991, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgDeviceMonitor, 16991, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 16991, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgDeviceMonitor, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgDeviceMonitor, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.device_monitor.cpu_temperature == 6123, "incorrect value for last_msg.msg.device_monitor.cpu_temperature, expected 6123, is %d", last_msg.msg.device_monitor.cpu_temperature); - - ck_assert_msg(last_msg.msg.device_monitor.cpu_vaux == 1789, "incorrect value for last_msg.msg.device_monitor.cpu_vaux, expected 1789, is %d", last_msg.msg.device_monitor.cpu_vaux); - - ck_assert_msg(last_msg.msg.device_monitor.cpu_vint == 988, "incorrect value for last_msg.msg.device_monitor.cpu_vint, expected 988, is %d", last_msg.msg.device_monitor.cpu_vint); - - ck_assert_msg(last_msg.msg.device_monitor.dev_vin == -9999, "incorrect value for last_msg.msg.device_monitor.dev_vin, expected -9999, is %d", last_msg.msg.device_monitor.dev_vin); - - ck_assert_msg(last_msg.msg.device_monitor.fe_temperature == 4776, "incorrect value for last_msg.msg.device_monitor.fe_temperature, expected 4776, is %d", last_msg.msg.device_monitor.fe_temperature); + ck_assert_msg( + last_msg.msg.device_monitor.cpu_temperature == 6123, + "incorrect value for last_msg.msg.device_monitor.cpu_temperature, " + "expected 6123, is %d", + last_msg.msg.device_monitor.cpu_temperature); + + ck_assert_msg(last_msg.msg.device_monitor.cpu_vaux == 1789, + "incorrect value for last_msg.msg.device_monitor.cpu_vaux, " + "expected 1789, is %d", + last_msg.msg.device_monitor.cpu_vaux); + + ck_assert_msg(last_msg.msg.device_monitor.cpu_vint == 988, + "incorrect value for last_msg.msg.device_monitor.cpu_vint, " + "expected 988, is %d", + last_msg.msg.device_monitor.cpu_vint); + + ck_assert_msg(last_msg.msg.device_monitor.dev_vin == -9999, + "incorrect value for last_msg.msg.device_monitor.dev_vin, " + "expected -9999, is %d", + last_msg.msg.device_monitor.dev_vin); + + ck_assert_msg( + last_msg.msg.device_monitor.fe_temperature == 4776, + "incorrect value for last_msg.msg.device_monitor.fe_temperature, " + "expected 4776, is %d", + last_msg.msg.device_monitor.fe_temperature); } } END_TEST -Suite* auto_check_sbp_piksi_MsgDeviceMonitor_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgDeviceMonitor"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgDeviceMonitor"); +Suite *auto_check_sbp_piksi_MsgDeviceMonitor_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgDeviceMonitor"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgDeviceMonitor"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgDeviceMonitor); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgFrontEndGain.c b/c/test/auto_check_sbp_piksi_MsgFrontEndGain.c index b8d3f0865..a415534f4 100644 --- a/c/test/auto_check_sbp_piksi_MsgFrontEndGain.c +++ b/c/test/auto_check_sbp_piksi_MsgFrontEndGain.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgFrontEndGain.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgFrontEndGain.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgFrontEndGain ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgFrontEndGain) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgFrontEndGain ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,95 +90,149 @@ START_TEST( test_auto_check_sbp_piksi_MsgFrontEndGain ) logging_reset(); - sbp_callback_register(&sbp_state, 0xbf, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xbf, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,191,0,175,245,16,41,133,134,10,105,20,38,38,246,233,216,80,187,213,85,2,235,135, }; + u8 encoded_frame[] = { + 85, 191, 0, 175, 245, 16, 41, 133, 134, 10, 105, 20, + 38, 38, 246, 233, 216, 80, 187, 213, 85, 2, 235, 135, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.front_end_gain.if_gain[0] = -10; - + test_msg.front_end_gain.if_gain[1] = -23; - + test_msg.front_end_gain.if_gain[2] = -40; - + test_msg.front_end_gain.if_gain[3] = 80; - + test_msg.front_end_gain.if_gain[4] = -69; - + test_msg.front_end_gain.if_gain[5] = -43; - + test_msg.front_end_gain.if_gain[6] = 85; - + test_msg.front_end_gain.if_gain[7] = 2; - - + test_msg.front_end_gain.rf_gain[0] = 41; - + test_msg.front_end_gain.rf_gain[1] = -123; - + test_msg.front_end_gain.rf_gain[2] = -122; - + test_msg.front_end_gain.rf_gain[3] = 10; - + test_msg.front_end_gain.rf_gain[4] = 105; - + test_msg.front_end_gain.rf_gain[5] = 20; - + test_msg.front_end_gain.rf_gain[6] = 38; - + test_msg.front_end_gain.rf_gain[7] = 38; - sbp_message_send(&sbp_state, SbpMsgFrontEndGain, 62895, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgFrontEndGain, 62895, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 62895, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgFrontEndGain, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgFrontEndGain, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.front_end_gain.if_gain[0] == -10, "incorrect value for last_msg.msg.front_end_gain.if_gain[0], expected -10, is %d", last_msg.msg.front_end_gain.if_gain[0]); - ck_assert_msg(last_msg.msg.front_end_gain.if_gain[1] == -23, "incorrect value for last_msg.msg.front_end_gain.if_gain[1], expected -23, is %d", last_msg.msg.front_end_gain.if_gain[1]); - ck_assert_msg(last_msg.msg.front_end_gain.if_gain[2] == -40, "incorrect value for last_msg.msg.front_end_gain.if_gain[2], expected -40, is %d", last_msg.msg.front_end_gain.if_gain[2]); - ck_assert_msg(last_msg.msg.front_end_gain.if_gain[3] == 80, "incorrect value for last_msg.msg.front_end_gain.if_gain[3], expected 80, is %d", last_msg.msg.front_end_gain.if_gain[3]); - ck_assert_msg(last_msg.msg.front_end_gain.if_gain[4] == -69, "incorrect value for last_msg.msg.front_end_gain.if_gain[4], expected -69, is %d", last_msg.msg.front_end_gain.if_gain[4]); - ck_assert_msg(last_msg.msg.front_end_gain.if_gain[5] == -43, "incorrect value for last_msg.msg.front_end_gain.if_gain[5], expected -43, is %d", last_msg.msg.front_end_gain.if_gain[5]); - ck_assert_msg(last_msg.msg.front_end_gain.if_gain[6] == 85, "incorrect value for last_msg.msg.front_end_gain.if_gain[6], expected 85, is %d", last_msg.msg.front_end_gain.if_gain[6]); - ck_assert_msg(last_msg.msg.front_end_gain.if_gain[7] == 2, "incorrect value for last_msg.msg.front_end_gain.if_gain[7], expected 2, is %d", last_msg.msg.front_end_gain.if_gain[7]); - - ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[0] == 41, "incorrect value for last_msg.msg.front_end_gain.rf_gain[0], expected 41, is %d", last_msg.msg.front_end_gain.rf_gain[0]); - ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[1] == -123, "incorrect value for last_msg.msg.front_end_gain.rf_gain[1], expected -123, is %d", last_msg.msg.front_end_gain.rf_gain[1]); - ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[2] == -122, "incorrect value for last_msg.msg.front_end_gain.rf_gain[2], expected -122, is %d", last_msg.msg.front_end_gain.rf_gain[2]); - ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[3] == 10, "incorrect value for last_msg.msg.front_end_gain.rf_gain[3], expected 10, is %d", last_msg.msg.front_end_gain.rf_gain[3]); - ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[4] == 105, "incorrect value for last_msg.msg.front_end_gain.rf_gain[4], expected 105, is %d", last_msg.msg.front_end_gain.rf_gain[4]); - ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[5] == 20, "incorrect value for last_msg.msg.front_end_gain.rf_gain[5], expected 20, is %d", last_msg.msg.front_end_gain.rf_gain[5]); - ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[6] == 38, "incorrect value for last_msg.msg.front_end_gain.rf_gain[6], expected 38, is %d", last_msg.msg.front_end_gain.rf_gain[6]); - ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[7] == 38, "incorrect value for last_msg.msg.front_end_gain.rf_gain[7], expected 38, is %d", last_msg.msg.front_end_gain.rf_gain[7]); + ck_assert_msg(last_msg.msg.front_end_gain.if_gain[0] == -10, + "incorrect value for last_msg.msg.front_end_gain.if_gain[0], " + "expected -10, is %d", + last_msg.msg.front_end_gain.if_gain[0]); + ck_assert_msg(last_msg.msg.front_end_gain.if_gain[1] == -23, + "incorrect value for last_msg.msg.front_end_gain.if_gain[1], " + "expected -23, is %d", + last_msg.msg.front_end_gain.if_gain[1]); + ck_assert_msg(last_msg.msg.front_end_gain.if_gain[2] == -40, + "incorrect value for last_msg.msg.front_end_gain.if_gain[2], " + "expected -40, is %d", + last_msg.msg.front_end_gain.if_gain[2]); + ck_assert_msg(last_msg.msg.front_end_gain.if_gain[3] == 80, + "incorrect value for last_msg.msg.front_end_gain.if_gain[3], " + "expected 80, is %d", + last_msg.msg.front_end_gain.if_gain[3]); + ck_assert_msg(last_msg.msg.front_end_gain.if_gain[4] == -69, + "incorrect value for last_msg.msg.front_end_gain.if_gain[4], " + "expected -69, is %d", + last_msg.msg.front_end_gain.if_gain[4]); + ck_assert_msg(last_msg.msg.front_end_gain.if_gain[5] == -43, + "incorrect value for last_msg.msg.front_end_gain.if_gain[5], " + "expected -43, is %d", + last_msg.msg.front_end_gain.if_gain[5]); + ck_assert_msg(last_msg.msg.front_end_gain.if_gain[6] == 85, + "incorrect value for last_msg.msg.front_end_gain.if_gain[6], " + "expected 85, is %d", + last_msg.msg.front_end_gain.if_gain[6]); + ck_assert_msg(last_msg.msg.front_end_gain.if_gain[7] == 2, + "incorrect value for last_msg.msg.front_end_gain.if_gain[7], " + "expected 2, is %d", + last_msg.msg.front_end_gain.if_gain[7]); + + ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[0] == 41, + "incorrect value for last_msg.msg.front_end_gain.rf_gain[0], " + "expected 41, is %d", + last_msg.msg.front_end_gain.rf_gain[0]); + ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[1] == -123, + "incorrect value for last_msg.msg.front_end_gain.rf_gain[1], " + "expected -123, is %d", + last_msg.msg.front_end_gain.rf_gain[1]); + ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[2] == -122, + "incorrect value for last_msg.msg.front_end_gain.rf_gain[2], " + "expected -122, is %d", + last_msg.msg.front_end_gain.rf_gain[2]); + ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[3] == 10, + "incorrect value for last_msg.msg.front_end_gain.rf_gain[3], " + "expected 10, is %d", + last_msg.msg.front_end_gain.rf_gain[3]); + ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[4] == 105, + "incorrect value for last_msg.msg.front_end_gain.rf_gain[4], " + "expected 105, is %d", + last_msg.msg.front_end_gain.rf_gain[4]); + ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[5] == 20, + "incorrect value for last_msg.msg.front_end_gain.rf_gain[5], " + "expected 20, is %d", + last_msg.msg.front_end_gain.rf_gain[5]); + ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[6] == 38, + "incorrect value for last_msg.msg.front_end_gain.rf_gain[6], " + "expected 38, is %d", + last_msg.msg.front_end_gain.rf_gain[6]); + ck_assert_msg(last_msg.msg.front_end_gain.rf_gain[7] == 38, + "incorrect value for last_msg.msg.front_end_gain.rf_gain[7], " + "expected 38, is %d", + last_msg.msg.front_end_gain.rf_gain[7]); } } END_TEST -Suite* auto_check_sbp_piksi_MsgFrontEndGain_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgFrontEndGain"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgFrontEndGain"); +Suite *auto_check_sbp_piksi_MsgFrontEndGain_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgFrontEndGain"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgFrontEndGain"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgFrontEndGain); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgIarState.c b/c/test/auto_check_sbp_piksi_MsgIarState.c index 704e70190..4d7adb5a3 100644 --- a/c/test/auto_check_sbp_piksi_MsgIarState.c +++ b/c/test/auto_check_sbp_piksi_MsgIarState.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgIarState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgIarState.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgIarState ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgIarState) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgIarState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,44 +90,54 @@ START_TEST( test_auto_check_sbp_piksi_MsgIarState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x19, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x19, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,25,0,246,215,4,1,0,0,0,216,140, }; + u8 encoded_frame[] = { + 85, 25, 0, 246, 215, 4, 1, 0, 0, 0, 216, 140, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.iar_state.num_hyps = 1; - sbp_message_send(&sbp_state, SbpMsgIarState, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgIarState, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgIarState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgIarState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.iar_state.num_hyps == 1, "incorrect value for last_msg.msg.iar_state.num_hyps, expected 1, is %d", last_msg.msg.iar_state.num_hyps); + ck_assert_msg(last_msg.msg.iar_state.num_hyps == 1, + "incorrect value for last_msg.msg.iar_state.num_hyps, " + "expected 1, is %d", + last_msg.msg.iar_state.num_hyps); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -139,44 +145,53 @@ START_TEST( test_auto_check_sbp_piksi_MsgIarState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x19, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x19, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,25,0,195,4,4,0,0,0,0,18,176, }; + u8 encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 0, 0, 0, 0, 18, 176, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.iar_state.num_hyps = 0; sbp_message_send(&sbp_state, SbpMsgIarState, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgIarState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgIarState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.iar_state.num_hyps == 0, "incorrect value for last_msg.msg.iar_state.num_hyps, expected 0, is %d", last_msg.msg.iar_state.num_hyps); + ck_assert_msg(last_msg.msg.iar_state.num_hyps == 0, + "incorrect value for last_msg.msg.iar_state.num_hyps, " + "expected 0, is %d", + last_msg.msg.iar_state.num_hyps); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -184,44 +199,53 @@ START_TEST( test_auto_check_sbp_piksi_MsgIarState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x19, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x19, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,25,0,195,4,4,1,0,0,0,166,198, }; + u8 encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 1, 0, 0, 0, 166, 198, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.iar_state.num_hyps = 1; sbp_message_send(&sbp_state, SbpMsgIarState, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgIarState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgIarState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.iar_state.num_hyps == 1, "incorrect value for last_msg.msg.iar_state.num_hyps, expected 1, is %d", last_msg.msg.iar_state.num_hyps); + ck_assert_msg(last_msg.msg.iar_state.num_hyps == 1, + "incorrect value for last_msg.msg.iar_state.num_hyps, " + "expected 1, is %d", + last_msg.msg.iar_state.num_hyps); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -229,44 +253,53 @@ START_TEST( test_auto_check_sbp_piksi_MsgIarState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x19, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x19, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,25,0,195,4,4,217,2,0,0,6,133, }; + u8 encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 217, 2, 0, 0, 6, 133, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.iar_state.num_hyps = 729; sbp_message_send(&sbp_state, SbpMsgIarState, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgIarState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgIarState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.iar_state.num_hyps == 729, "incorrect value for last_msg.msg.iar_state.num_hyps, expected 729, is %d", last_msg.msg.iar_state.num_hyps); + ck_assert_msg(last_msg.msg.iar_state.num_hyps == 729, + "incorrect value for last_msg.msg.iar_state.num_hyps, " + "expected 729, is %d", + last_msg.msg.iar_state.num_hyps); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -274,44 +307,53 @@ START_TEST( test_auto_check_sbp_piksi_MsgIarState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x19, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x19, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,25,0,195,4,4,216,2,0,0,178,243, }; + u8 encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 216, 2, 0, 0, 178, 243, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.iar_state.num_hyps = 728; sbp_message_send(&sbp_state, SbpMsgIarState, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgIarState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgIarState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.iar_state.num_hyps == 728, "incorrect value for last_msg.msg.iar_state.num_hyps, expected 728, is %d", last_msg.msg.iar_state.num_hyps); + ck_assert_msg(last_msg.msg.iar_state.num_hyps == 728, + "incorrect value for last_msg.msg.iar_state.num_hyps, " + "expected 728, is %d", + last_msg.msg.iar_state.num_hyps); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -319,44 +361,53 @@ START_TEST( test_auto_check_sbp_piksi_MsgIarState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x19, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x19, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,25,0,195,4,4,215,2,0,0,92,39, }; + u8 encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 215, 2, 0, 0, 92, 39, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.iar_state.num_hyps = 727; sbp_message_send(&sbp_state, SbpMsgIarState, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgIarState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgIarState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.iar_state.num_hyps == 727, "incorrect value for last_msg.msg.iar_state.num_hyps, expected 727, is %d", last_msg.msg.iar_state.num_hyps); + ck_assert_msg(last_msg.msg.iar_state.num_hyps == 727, + "incorrect value for last_msg.msg.iar_state.num_hyps, " + "expected 727, is %d", + last_msg.msg.iar_state.num_hyps); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -364,47 +415,56 @@ START_TEST( test_auto_check_sbp_piksi_MsgIarState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x19, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x19, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,25,0,195,4,4,211,2,0,0,173,237, }; + u8 encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 211, 2, 0, 0, 173, 237, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.iar_state.num_hyps = 723; sbp_message_send(&sbp_state, SbpMsgIarState, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgIarState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgIarState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.iar_state.num_hyps == 723, "incorrect value for last_msg.msg.iar_state.num_hyps, expected 723, is %d", last_msg.msg.iar_state.num_hyps); + ck_assert_msg(last_msg.msg.iar_state.num_hyps == 723, + "incorrect value for last_msg.msg.iar_state.num_hyps, " + "expected 723, is %d", + last_msg.msg.iar_state.num_hyps); } } END_TEST -Suite* auto_check_sbp_piksi_MsgIarState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgIarState"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgIarState"); +Suite *auto_check_sbp_piksi_MsgIarState_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgIarState"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgIarState"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgIarState); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgInitBaseDep.c b/c/test/auto_check_sbp_piksi_MsgInitBaseDep.c index 5eac13f70..df27d9311 100644 --- a/c/test/auto_check_sbp_piksi_MsgInitBaseDep.c +++ b/c/test/auto_check_sbp_piksi_MsgInitBaseDep.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgInitBaseDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgInitBaseDep.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgInitBaseDep ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgInitBaseDep) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgInitBaseDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,43 +90,50 @@ START_TEST( test_auto_check_sbp_piksi_MsgInitBaseDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x23, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x23, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,35,0,184,41,0,70,13, }; + u8 encoded_frame[] = { + 85, 35, 0, 184, 41, 0, 70, 13, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - sbp_message_send(&sbp_state, SbpMsgInitBaseDep, 10680, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgInitBaseDep, 10680, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 10680, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgInitBaseDep, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgInitBaseDep, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - } } END_TEST -Suite* auto_check_sbp_piksi_MsgInitBaseDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgInitBaseDep"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgInitBaseDep"); +Suite *auto_check_sbp_piksi_MsgInitBaseDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgInitBaseDep"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgInitBaseDep"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgInitBaseDep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgMaskSatellite.c b/c/test/auto_check_sbp_piksi_MsgMaskSatellite.c index e3fc8e2d7..060946330 100644 --- a/c/test/auto_check_sbp_piksi_MsgMaskSatellite.c +++ b/c/test/auto_check_sbp_piksi_MsgMaskSatellite.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatellite.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatellite.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgMaskSatellite ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgMaskSatellite) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgMaskSatellite ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,57 +90,71 @@ START_TEST( test_auto_check_sbp_piksi_MsgMaskSatellite ) logging_reset(); - sbp_callback_register(&sbp_state, 0x2b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x2b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,43,0,173,151,3,183,87,57,19,147, }; + u8 encoded_frame[] = { + 85, 43, 0, 173, 151, 3, 183, 87, 57, 19, 147, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.mask_satellite.mask = 183; - - + test_msg.mask_satellite.sid.code = 57; - + test_msg.mask_satellite.sid.sat = 87; - sbp_message_send(&sbp_state, SbpMsgMaskSatellite, 38829, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgMaskSatellite, 38829, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 38829, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgMaskSatellite, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgMaskSatellite, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.mask_satellite.mask == 183, "incorrect value for last_msg.msg.mask_satellite.mask, expected 183, is %d", last_msg.msg.mask_satellite.mask); - - - ck_assert_msg(last_msg.msg.mask_satellite.sid.code == 57, "incorrect value for last_msg.msg.mask_satellite.sid.code, expected 57, is %d", last_msg.msg.mask_satellite.sid.code); - - ck_assert_msg(last_msg.msg.mask_satellite.sid.sat == 87, "incorrect value for last_msg.msg.mask_satellite.sid.sat, expected 87, is %d", last_msg.msg.mask_satellite.sid.sat); + ck_assert_msg(last_msg.msg.mask_satellite.mask == 183, + "incorrect value for last_msg.msg.mask_satellite.mask, " + "expected 183, is %d", + last_msg.msg.mask_satellite.mask); + + ck_assert_msg(last_msg.msg.mask_satellite.sid.code == 57, + "incorrect value for last_msg.msg.mask_satellite.sid.code, " + "expected 57, is %d", + last_msg.msg.mask_satellite.sid.code); + + ck_assert_msg(last_msg.msg.mask_satellite.sid.sat == 87, + "incorrect value for last_msg.msg.mask_satellite.sid.sat, " + "expected 87, is %d", + last_msg.msg.mask_satellite.sid.sat); } } END_TEST -Suite* auto_check_sbp_piksi_MsgMaskSatellite_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgMaskSatellite"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgMaskSatellite"); +Suite *auto_check_sbp_piksi_MsgMaskSatellite_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgMaskSatellite"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgMaskSatellite"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgMaskSatellite); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgMaskSatelliteDep.c b/c/test/auto_check_sbp_piksi_MsgMaskSatelliteDep.c index 22e847a5c..2e306a952 100644 --- a/c/test/auto_check_sbp_piksi_MsgMaskSatelliteDep.c +++ b/c/test/auto_check_sbp_piksi_MsgMaskSatelliteDep.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatelliteDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatelliteDep.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgMaskSatelliteDep ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgMaskSatelliteDep) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgMaskSatelliteDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,61 +90,81 @@ START_TEST( test_auto_check_sbp_piksi_MsgMaskSatelliteDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x1b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x1b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,27,0,187,134,5,33,2,153,95,4,29,188, }; + u8 encoded_frame[] = { + 85, 27, 0, 187, 134, 5, 33, 2, 153, 95, 4, 29, 188, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.mask_satellite_dep.mask = 33; - - + test_msg.mask_satellite_dep.sid.code = 95; - + test_msg.mask_satellite_dep.sid.reserved = 4; - + test_msg.mask_satellite_dep.sid.sat = 39170; - sbp_message_send(&sbp_state, SbpMsgMaskSatelliteDep, 34491, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgMaskSatelliteDep, 34491, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 34491, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgMaskSatelliteDep, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgMaskSatelliteDep, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.mask_satellite_dep.mask == 33, "incorrect value for last_msg.msg.mask_satellite_dep.mask, expected 33, is %d", last_msg.msg.mask_satellite_dep.mask); - - - ck_assert_msg(last_msg.msg.mask_satellite_dep.sid.code == 95, "incorrect value for last_msg.msg.mask_satellite_dep.sid.code, expected 95, is %d", last_msg.msg.mask_satellite_dep.sid.code); - - ck_assert_msg(last_msg.msg.mask_satellite_dep.sid.reserved == 4, "incorrect value for last_msg.msg.mask_satellite_dep.sid.reserved, expected 4, is %d", last_msg.msg.mask_satellite_dep.sid.reserved); - - ck_assert_msg(last_msg.msg.mask_satellite_dep.sid.sat == 39170, "incorrect value for last_msg.msg.mask_satellite_dep.sid.sat, expected 39170, is %d", last_msg.msg.mask_satellite_dep.sid.sat); + ck_assert_msg(last_msg.msg.mask_satellite_dep.mask == 33, + "incorrect value for last_msg.msg.mask_satellite_dep.mask, " + "expected 33, is %d", + last_msg.msg.mask_satellite_dep.mask); + + ck_assert_msg( + last_msg.msg.mask_satellite_dep.sid.code == 95, + "incorrect value for last_msg.msg.mask_satellite_dep.sid.code, " + "expected 95, is %d", + last_msg.msg.mask_satellite_dep.sid.code); + + ck_assert_msg( + last_msg.msg.mask_satellite_dep.sid.reserved == 4, + "incorrect value for last_msg.msg.mask_satellite_dep.sid.reserved, " + "expected 4, is %d", + last_msg.msg.mask_satellite_dep.sid.reserved); + + ck_assert_msg( + last_msg.msg.mask_satellite_dep.sid.sat == 39170, + "incorrect value for last_msg.msg.mask_satellite_dep.sid.sat, expected " + "39170, is %d", + last_msg.msg.mask_satellite_dep.sid.sat); } } END_TEST -Suite* auto_check_sbp_piksi_MsgMaskSatelliteDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgMaskSatelliteDep"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgMaskSatelliteDep"); +Suite *auto_check_sbp_piksi_MsgMaskSatelliteDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgMaskSatelliteDep"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgMaskSatelliteDep"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgMaskSatelliteDep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.c b/c/test/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.c index a82e0a9cc..65806f4d3 100644 --- a/c/test/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.c +++ b/c/test/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkBandwidthUsage.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkBandwidthUsage.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgNetworkBandwidthUsage ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgNetworkBandwidthUsage) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgNetworkBandwidthUsage ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,184 +90,379 @@ START_TEST( test_auto_check_sbp_piksi_MsgNetworkBandwidthUsage ) logging_reset(); - sbp_callback_register(&sbp_state, 0xBD, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xBD, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,189,0,207,121,200,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,99,97,110,48,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,99,97,110,49,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,165,235,94,203,0,0,0,0,237,14,148,240,184,220,202,218,101,116,104,48,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,115,105,116,48,0,0,0,0,0,0,0,0,0,0,0,0,27,133, }; + u8 encoded_frame[] = { + 85, 189, 0, 207, 121, 200, 94, 105, 178, 128, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 99, 97, 110, 48, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 94, 105, 178, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 94, 105, 178, 128, 0, 0, 0, 0, 165, 235, 94, 203, + 0, 0, 0, 0, 237, 14, 148, 240, 184, 220, 202, 218, 101, 116, + 104, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 94, 105, 178, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 111, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 105, + 178, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 115, 105, 116, 48, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 133, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - + test_msg.network_bandwidth_usage.interfaces[0].duration = 2159176030; - + { - const char assign_string[] = { (char)99,(char)97,(char)110,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.network_bandwidth_usage.interfaces[0].interface_name, assign_string, sizeof(assign_string)); + const char assign_string[] = {(char)99, (char)97, (char)110, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.network_bandwidth_usage.interfaces[0].interface_name, + assign_string, sizeof(assign_string)); } - + test_msg.network_bandwidth_usage.interfaces[0].rx_bytes = 0; - + test_msg.network_bandwidth_usage.interfaces[0].total_bytes = 0; - + test_msg.network_bandwidth_usage.interfaces[0].tx_bytes = 0; - - + test_msg.network_bandwidth_usage.interfaces[1].duration = 2159176030; - + { - const char assign_string[] = { (char)99,(char)97,(char)110,(char)49,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.network_bandwidth_usage.interfaces[1].interface_name, assign_string, sizeof(assign_string)); + const char assign_string[] = {(char)99, (char)97, (char)110, (char)49, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.network_bandwidth_usage.interfaces[1].interface_name, + assign_string, sizeof(assign_string)); } - + test_msg.network_bandwidth_usage.interfaces[1].rx_bytes = 0; - + test_msg.network_bandwidth_usage.interfaces[1].total_bytes = 0; - + test_msg.network_bandwidth_usage.interfaces[1].tx_bytes = 0; - - + test_msg.network_bandwidth_usage.interfaces[2].duration = 2159176030; - + { - const char assign_string[] = { (char)101,(char)116,(char)104,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.network_bandwidth_usage.interfaces[2].interface_name, assign_string, sizeof(assign_string)); + const char assign_string[] = {(char)101, (char)116, (char)104, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.network_bandwidth_usage.interfaces[2].interface_name, + assign_string, sizeof(assign_string)); } - + test_msg.network_bandwidth_usage.interfaces[2].rx_bytes = 4036234989; - + test_msg.network_bandwidth_usage.interfaces[2].total_bytes = 3411995557; - + test_msg.network_bandwidth_usage.interfaces[2].tx_bytes = 3670727864; - - + test_msg.network_bandwidth_usage.interfaces[3].duration = 2159176030; - + { - const char assign_string[] = { (char)108,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.network_bandwidth_usage.interfaces[3].interface_name, assign_string, sizeof(assign_string)); + const char assign_string[] = {(char)108, (char)111, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.network_bandwidth_usage.interfaces[3].interface_name, + assign_string, sizeof(assign_string)); } - + test_msg.network_bandwidth_usage.interfaces[3].rx_bytes = 0; - + test_msg.network_bandwidth_usage.interfaces[3].total_bytes = 0; - + test_msg.network_bandwidth_usage.interfaces[3].tx_bytes = 0; - - + test_msg.network_bandwidth_usage.interfaces[4].duration = 2159176030; - + { - const char assign_string[] = { (char)115,(char)105,(char)116,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.network_bandwidth_usage.interfaces[4].interface_name, assign_string, sizeof(assign_string)); + const char assign_string[] = {(char)115, (char)105, (char)116, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.network_bandwidth_usage.interfaces[4].interface_name, + assign_string, sizeof(assign_string)); } - + test_msg.network_bandwidth_usage.interfaces[4].rx_bytes = 0; - + test_msg.network_bandwidth_usage.interfaces[4].total_bytes = 0; - + test_msg.network_bandwidth_usage.interfaces[4].tx_bytes = 0; - + test_msg.network_bandwidth_usage.n_interfaces = 5; - sbp_message_send(&sbp_state, SbpMsgNetworkBandwidthUsage, 31183, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgNetworkBandwidthUsage, 31183, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 31183, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgNetworkBandwidthUsage, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[0].duration == 2159176030, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[0].duration, expected 2159176030, is %d", last_msg.msg.network_bandwidth_usage.interfaces[0].duration); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgNetworkBandwidthUsage, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[0].duration == + 2159176030, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[0].duration," + " expected 2159176030, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[0].duration); + { - const char check_string[] = { (char)99,(char)97,(char)110,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.network_bandwidth_usage.interfaces[0].interface_name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[0].interface_name, expected string '%s', is '%s'", check_string, last_msg.msg.network_bandwidth_usage.interfaces[0].interface_name); + const char check_string[] = {(char)99, (char)97, (char)110, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(&last_msg.msg.network_bandwidth_usage.interfaces[0] + .interface_name, + check_string, sizeof(check_string)) == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[0].interface_name, " + "expected string '%s', is '%s'", + check_string, + last_msg.msg.network_bandwidth_usage.interfaces[0].interface_name); } - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[0].rx_bytes == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[0].rx_bytes, expected 0, is %d", last_msg.msg.network_bandwidth_usage.interfaces[0].rx_bytes); - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[0].total_bytes == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[0].total_bytes, expected 0, is %d", last_msg.msg.network_bandwidth_usage.interfaces[0].total_bytes); - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[0].tx_bytes == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[0].tx_bytes, expected 0, is %d", last_msg.msg.network_bandwidth_usage.interfaces[0].tx_bytes); - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[1].duration == 2159176030, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[1].duration, expected 2159176030, is %d", last_msg.msg.network_bandwidth_usage.interfaces[1].duration); - + + ck_assert_msg( + last_msg.msg.network_bandwidth_usage.interfaces[0].rx_bytes == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[0].rx_bytes, expected " + "0, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[0].rx_bytes); + + ck_assert_msg( + last_msg.msg.network_bandwidth_usage.interfaces[0].total_bytes == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[0].total_bytes, " + "expected 0, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[0].total_bytes); + + ck_assert_msg( + last_msg.msg.network_bandwidth_usage.interfaces[0].tx_bytes == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[0].tx_bytes, expected " + "0, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[0].tx_bytes); + + ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[1].duration == + 2159176030, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[1].duration," + " expected 2159176030, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[1].duration); + { - const char check_string[] = { (char)99,(char)97,(char)110,(char)49,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.network_bandwidth_usage.interfaces[1].interface_name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[1].interface_name, expected string '%s', is '%s'", check_string, last_msg.msg.network_bandwidth_usage.interfaces[1].interface_name); + const char check_string[] = {(char)99, (char)97, (char)110, (char)49, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(&last_msg.msg.network_bandwidth_usage.interfaces[1] + .interface_name, + check_string, sizeof(check_string)) == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[1].interface_name, " + "expected string '%s', is '%s'", + check_string, + last_msg.msg.network_bandwidth_usage.interfaces[1].interface_name); } - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[1].rx_bytes == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[1].rx_bytes, expected 0, is %d", last_msg.msg.network_bandwidth_usage.interfaces[1].rx_bytes); - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[1].total_bytes == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[1].total_bytes, expected 0, is %d", last_msg.msg.network_bandwidth_usage.interfaces[1].total_bytes); - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[1].tx_bytes == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[1].tx_bytes, expected 0, is %d", last_msg.msg.network_bandwidth_usage.interfaces[1].tx_bytes); - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[2].duration == 2159176030, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[2].duration, expected 2159176030, is %d", last_msg.msg.network_bandwidth_usage.interfaces[2].duration); - + + ck_assert_msg( + last_msg.msg.network_bandwidth_usage.interfaces[1].rx_bytes == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[1].rx_bytes, expected " + "0, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[1].rx_bytes); + + ck_assert_msg( + last_msg.msg.network_bandwidth_usage.interfaces[1].total_bytes == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[1].total_bytes, " + "expected 0, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[1].total_bytes); + + ck_assert_msg( + last_msg.msg.network_bandwidth_usage.interfaces[1].tx_bytes == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[1].tx_bytes, expected " + "0, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[1].tx_bytes); + + ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[2].duration == + 2159176030, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[2].duration," + " expected 2159176030, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[2].duration); + { - const char check_string[] = { (char)101,(char)116,(char)104,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.network_bandwidth_usage.interfaces[2].interface_name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[2].interface_name, expected string '%s', is '%s'", check_string, last_msg.msg.network_bandwidth_usage.interfaces[2].interface_name); + const char check_string[] = {(char)101, (char)116, (char)104, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(&last_msg.msg.network_bandwidth_usage.interfaces[2] + .interface_name, + check_string, sizeof(check_string)) == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[2].interface_name, " + "expected string '%s', is '%s'", + check_string, + last_msg.msg.network_bandwidth_usage.interfaces[2].interface_name); } - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[2].rx_bytes == 4036234989, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[2].rx_bytes, expected 4036234989, is %d", last_msg.msg.network_bandwidth_usage.interfaces[2].rx_bytes); - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[2].total_bytes == 3411995557, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[2].total_bytes, expected 3411995557, is %d", last_msg.msg.network_bandwidth_usage.interfaces[2].total_bytes); - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[2].tx_bytes == 3670727864, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[2].tx_bytes, expected 3670727864, is %d", last_msg.msg.network_bandwidth_usage.interfaces[2].tx_bytes); - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[3].duration == 2159176030, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[3].duration, expected 2159176030, is %d", last_msg.msg.network_bandwidth_usage.interfaces[3].duration); - + + ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[2].rx_bytes == + 4036234989, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[2].rx_bytes," + " expected 4036234989, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[2].rx_bytes); + + ck_assert_msg( + last_msg.msg.network_bandwidth_usage.interfaces[2].total_bytes == + 3411995557, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[2].total_bytes, " + "expected 3411995557, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[2].total_bytes); + + ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[2].tx_bytes == + 3670727864, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[2].tx_bytes," + " expected 3670727864, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[2].tx_bytes); + + ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[3].duration == + 2159176030, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[3].duration," + " expected 2159176030, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[3].duration); + { - const char check_string[] = { (char)108,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.network_bandwidth_usage.interfaces[3].interface_name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[3].interface_name, expected string '%s', is '%s'", check_string, last_msg.msg.network_bandwidth_usage.interfaces[3].interface_name); + const char check_string[] = {(char)108, (char)111, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(&last_msg.msg.network_bandwidth_usage.interfaces[3] + .interface_name, + check_string, sizeof(check_string)) == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[3].interface_name, " + "expected string '%s', is '%s'", + check_string, + last_msg.msg.network_bandwidth_usage.interfaces[3].interface_name); } - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[3].rx_bytes == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[3].rx_bytes, expected 0, is %d", last_msg.msg.network_bandwidth_usage.interfaces[3].rx_bytes); - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[3].total_bytes == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[3].total_bytes, expected 0, is %d", last_msg.msg.network_bandwidth_usage.interfaces[3].total_bytes); - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[3].tx_bytes == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[3].tx_bytes, expected 0, is %d", last_msg.msg.network_bandwidth_usage.interfaces[3].tx_bytes); - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[4].duration == 2159176030, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[4].duration, expected 2159176030, is %d", last_msg.msg.network_bandwidth_usage.interfaces[4].duration); - + + ck_assert_msg( + last_msg.msg.network_bandwidth_usage.interfaces[3].rx_bytes == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[3].rx_bytes, expected " + "0, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[3].rx_bytes); + + ck_assert_msg( + last_msg.msg.network_bandwidth_usage.interfaces[3].total_bytes == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[3].total_bytes, " + "expected 0, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[3].total_bytes); + + ck_assert_msg( + last_msg.msg.network_bandwidth_usage.interfaces[3].tx_bytes == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[3].tx_bytes, expected " + "0, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[3].tx_bytes); + + ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[4].duration == + 2159176030, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[4].duration," + " expected 2159176030, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[4].duration); + { - const char check_string[] = { (char)115,(char)105,(char)116,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.network_bandwidth_usage.interfaces[4].interface_name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[4].interface_name, expected string '%s', is '%s'", check_string, last_msg.msg.network_bandwidth_usage.interfaces[4].interface_name); + const char check_string[] = {(char)115, (char)105, (char)116, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(&last_msg.msg.network_bandwidth_usage.interfaces[4] + .interface_name, + check_string, sizeof(check_string)) == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[4].interface_name, " + "expected string '%s', is '%s'", + check_string, + last_msg.msg.network_bandwidth_usage.interfaces[4].interface_name); } - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[4].rx_bytes == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[4].rx_bytes, expected 0, is %d", last_msg.msg.network_bandwidth_usage.interfaces[4].rx_bytes); - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[4].total_bytes == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[4].total_bytes, expected 0, is %d", last_msg.msg.network_bandwidth_usage.interfaces[4].total_bytes); - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.interfaces[4].tx_bytes == 0, "incorrect value for last_msg.msg.network_bandwidth_usage.interfaces[4].tx_bytes, expected 0, is %d", last_msg.msg.network_bandwidth_usage.interfaces[4].tx_bytes); - - ck_assert_msg(last_msg.msg.network_bandwidth_usage.n_interfaces == 5, "incorrect value for last_msg.msg.network_bandwidth_usage.n_interfaces, expected 5, is %d", last_msg.msg.network_bandwidth_usage.n_interfaces); + ck_assert_msg( + last_msg.msg.network_bandwidth_usage.interfaces[4].rx_bytes == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[4].rx_bytes, expected " + "0, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[4].rx_bytes); + + ck_assert_msg( + last_msg.msg.network_bandwidth_usage.interfaces[4].total_bytes == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[4].total_bytes, " + "expected 0, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[4].total_bytes); + + ck_assert_msg( + last_msg.msg.network_bandwidth_usage.interfaces[4].tx_bytes == 0, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.interfaces[4].tx_bytes, expected " + "0, is %d", + last_msg.msg.network_bandwidth_usage.interfaces[4].tx_bytes); + + ck_assert_msg( + last_msg.msg.network_bandwidth_usage.n_interfaces == 5, + "incorrect value for " + "last_msg.msg.network_bandwidth_usage.n_interfaces, expected 5, is %d", + last_msg.msg.network_bandwidth_usage.n_interfaces); } } END_TEST -Suite* auto_check_sbp_piksi_MsgNetworkBandwidthUsage_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgNetworkBandwidthUsage"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgNetworkBandwidthUsage"); +Suite *auto_check_sbp_piksi_MsgNetworkBandwidthUsage_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_piksi_MsgNetworkBandwidthUsage"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_piksi_MsgNetworkBandwidthUsage"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgNetworkBandwidthUsage); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgNetworkStateReq.c b/c/test/auto_check_sbp_piksi_MsgNetworkStateReq.c index fa994d816..c9f8c0a83 100644 --- a/c/test/auto_check_sbp_piksi_MsgNetworkStateReq.c +++ b/c/test/auto_check_sbp_piksi_MsgNetworkStateReq.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateReq.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgNetworkStateReq ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgNetworkStateReq) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgNetworkStateReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,43 +90,50 @@ START_TEST( test_auto_check_sbp_piksi_MsgNetworkStateReq ) logging_reset(); - sbp_callback_register(&sbp_state, 0xba, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xba, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,186,0,83,62,0,148,73, }; + u8 encoded_frame[] = { + 85, 186, 0, 83, 62, 0, 148, 73, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - sbp_message_send(&sbp_state, SbpMsgNetworkStateReq, 15955, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgNetworkStateReq, 15955, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 15955, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgNetworkStateReq, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgNetworkStateReq, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - } } END_TEST -Suite* auto_check_sbp_piksi_MsgNetworkStateReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgNetworkStateReq"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgNetworkStateReq"); +Suite *auto_check_sbp_piksi_MsgNetworkStateReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgNetworkStateReq"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgNetworkStateReq"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgNetworkStateReq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgNetworkStateResp.c b/c/test/auto_check_sbp_piksi_MsgNetworkStateResp.c index 998268f5a..97fe887d3 100644 --- a/c/test/auto_check_sbp_piksi_MsgNetworkStateResp.c +++ b/c/test/auto_check_sbp_piksi_MsgNetworkStateResp.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateResp.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgNetworkStateResp ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgNetworkStateResp) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgNetworkStateResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,137 +90,257 @@ START_TEST( test_auto_check_sbp_piksi_MsgNetworkStateResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xbb, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xbb, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,187,0,40,15,50,143,241,84,180,152,194,137,32,44,114,147,68,222,92,192,78,235,63,208,114,53,183,24,244,231,26,105,25,136,3,105,102,48,0,0,0,0,0,0,0,0,0,0,0,0,0,195,229,80,147,118,193, }; + u8 encoded_frame[] = { + 85, 187, 0, 40, 15, 50, 143, 241, 84, 180, 152, 194, + 137, 32, 44, 114, 147, 68, 222, 92, 192, 78, 235, 63, + 208, 114, 53, 183, 24, 244, 231, 26, 105, 25, 136, 3, + 105, 102, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 195, 229, 80, 147, 118, 193, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.network_state_resp.flags = 2471552451; - + { - const char assign_string[] = { (char)105,(char)102,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.network_state_resp.interface_name, assign_string, sizeof(assign_string)); + const char assign_string[] = {(char)105, (char)102, (char)48, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.network_state_resp.interface_name, assign_string, + sizeof(assign_string)); } - - + test_msg.network_state_resp.ipv4_address[0] = 143; - + test_msg.network_state_resp.ipv4_address[1] = 241; - + test_msg.network_state_resp.ipv4_address[2] = 84; - + test_msg.network_state_resp.ipv4_address[3] = 180; - + test_msg.network_state_resp.ipv4_mask_size = 152; - - + test_msg.network_state_resp.ipv6_address[0] = 194; - + test_msg.network_state_resp.ipv6_address[1] = 137; - + test_msg.network_state_resp.ipv6_address[2] = 32; - + test_msg.network_state_resp.ipv6_address[3] = 44; - + test_msg.network_state_resp.ipv6_address[4] = 114; - + test_msg.network_state_resp.ipv6_address[5] = 147; - + test_msg.network_state_resp.ipv6_address[6] = 68; - + test_msg.network_state_resp.ipv6_address[7] = 222; - + test_msg.network_state_resp.ipv6_address[8] = 92; - + test_msg.network_state_resp.ipv6_address[9] = 192; - + test_msg.network_state_resp.ipv6_address[10] = 78; - + test_msg.network_state_resp.ipv6_address[11] = 235; - + test_msg.network_state_resp.ipv6_address[12] = 63; - + test_msg.network_state_resp.ipv6_address[13] = 208; - + test_msg.network_state_resp.ipv6_address[14] = 114; - + test_msg.network_state_resp.ipv6_address[15] = 53; - + test_msg.network_state_resp.ipv6_mask_size = 183; - + test_msg.network_state_resp.rx_bytes = 451408920; - + test_msg.network_state_resp.tx_bytes = 59251049; - sbp_message_send(&sbp_state, SbpMsgNetworkStateResp, 3880, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgNetworkStateResp, 3880, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 3880, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgNetworkStateResp, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgNetworkStateResp, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.network_state_resp.flags == 2471552451, "incorrect value for last_msg.msg.network_state_resp.flags, expected 2471552451, is %d", last_msg.msg.network_state_resp.flags); - + + ck_assert_msg(last_msg.msg.network_state_resp.flags == 2471552451, + "incorrect value for last_msg.msg.network_state_resp.flags, " + "expected 2471552451, is %d", + last_msg.msg.network_state_resp.flags); + { - const char check_string[] = { (char)105,(char)102,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.network_state_resp.interface_name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.network_state_resp.interface_name, expected string '%s', is '%s'", check_string, last_msg.msg.network_state_resp.interface_name); + const char check_string[] = {(char)105, (char)102, (char)48, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(&last_msg.msg.network_state_resp.interface_name, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.network_state_resp.interface_name, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.network_state_resp.interface_name); } - - ck_assert_msg(last_msg.msg.network_state_resp.ipv4_address[0] == 143, "incorrect value for last_msg.msg.network_state_resp.ipv4_address[0], expected 143, is %d", last_msg.msg.network_state_resp.ipv4_address[0]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv4_address[1] == 241, "incorrect value for last_msg.msg.network_state_resp.ipv4_address[1], expected 241, is %d", last_msg.msg.network_state_resp.ipv4_address[1]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv4_address[2] == 84, "incorrect value for last_msg.msg.network_state_resp.ipv4_address[2], expected 84, is %d", last_msg.msg.network_state_resp.ipv4_address[2]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv4_address[3] == 180, "incorrect value for last_msg.msg.network_state_resp.ipv4_address[3], expected 180, is %d", last_msg.msg.network_state_resp.ipv4_address[3]); - - ck_assert_msg(last_msg.msg.network_state_resp.ipv4_mask_size == 152, "incorrect value for last_msg.msg.network_state_resp.ipv4_mask_size, expected 152, is %d", last_msg.msg.network_state_resp.ipv4_mask_size); - - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[0] == 194, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[0], expected 194, is %d", last_msg.msg.network_state_resp.ipv6_address[0]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[1] == 137, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[1], expected 137, is %d", last_msg.msg.network_state_resp.ipv6_address[1]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[2] == 32, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[2], expected 32, is %d", last_msg.msg.network_state_resp.ipv6_address[2]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[3] == 44, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[3], expected 44, is %d", last_msg.msg.network_state_resp.ipv6_address[3]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[4] == 114, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[4], expected 114, is %d", last_msg.msg.network_state_resp.ipv6_address[4]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[5] == 147, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[5], expected 147, is %d", last_msg.msg.network_state_resp.ipv6_address[5]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[6] == 68, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[6], expected 68, is %d", last_msg.msg.network_state_resp.ipv6_address[6]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[7] == 222, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[7], expected 222, is %d", last_msg.msg.network_state_resp.ipv6_address[7]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[8] == 92, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[8], expected 92, is %d", last_msg.msg.network_state_resp.ipv6_address[8]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[9] == 192, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[9], expected 192, is %d", last_msg.msg.network_state_resp.ipv6_address[9]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[10] == 78, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[10], expected 78, is %d", last_msg.msg.network_state_resp.ipv6_address[10]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[11] == 235, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[11], expected 235, is %d", last_msg.msg.network_state_resp.ipv6_address[11]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[12] == 63, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[12], expected 63, is %d", last_msg.msg.network_state_resp.ipv6_address[12]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[13] == 208, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[13], expected 208, is %d", last_msg.msg.network_state_resp.ipv6_address[13]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[14] == 114, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[14], expected 114, is %d", last_msg.msg.network_state_resp.ipv6_address[14]); - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_address[15] == 53, "incorrect value for last_msg.msg.network_state_resp.ipv6_address[15], expected 53, is %d", last_msg.msg.network_state_resp.ipv6_address[15]); - - ck_assert_msg(last_msg.msg.network_state_resp.ipv6_mask_size == 183, "incorrect value for last_msg.msg.network_state_resp.ipv6_mask_size, expected 183, is %d", last_msg.msg.network_state_resp.ipv6_mask_size); - - ck_assert_msg(last_msg.msg.network_state_resp.rx_bytes == 451408920, "incorrect value for last_msg.msg.network_state_resp.rx_bytes, expected 451408920, is %d", last_msg.msg.network_state_resp.rx_bytes); - - ck_assert_msg(last_msg.msg.network_state_resp.tx_bytes == 59251049, "incorrect value for last_msg.msg.network_state_resp.tx_bytes, expected 59251049, is %d", last_msg.msg.network_state_resp.tx_bytes); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv4_address[0] == 143, + "incorrect value for last_msg.msg.network_state_resp.ipv4_address[0], " + "expected 143, is %d", + last_msg.msg.network_state_resp.ipv4_address[0]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv4_address[1] == 241, + "incorrect value for last_msg.msg.network_state_resp.ipv4_address[1], " + "expected 241, is %d", + last_msg.msg.network_state_resp.ipv4_address[1]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv4_address[2] == 84, + "incorrect value for last_msg.msg.network_state_resp.ipv4_address[2], " + "expected 84, is %d", + last_msg.msg.network_state_resp.ipv4_address[2]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv4_address[3] == 180, + "incorrect value for last_msg.msg.network_state_resp.ipv4_address[3], " + "expected 180, is %d", + last_msg.msg.network_state_resp.ipv4_address[3]); + + ck_assert_msg( + last_msg.msg.network_state_resp.ipv4_mask_size == 152, + "incorrect value for last_msg.msg.network_state_resp.ipv4_mask_size, " + "expected 152, is %d", + last_msg.msg.network_state_resp.ipv4_mask_size); + + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[0] == 194, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[0], " + "expected 194, is %d", + last_msg.msg.network_state_resp.ipv6_address[0]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[1] == 137, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[1], " + "expected 137, is %d", + last_msg.msg.network_state_resp.ipv6_address[1]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[2] == 32, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[2], " + "expected 32, is %d", + last_msg.msg.network_state_resp.ipv6_address[2]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[3] == 44, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[3], " + "expected 44, is %d", + last_msg.msg.network_state_resp.ipv6_address[3]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[4] == 114, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[4], " + "expected 114, is %d", + last_msg.msg.network_state_resp.ipv6_address[4]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[5] == 147, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[5], " + "expected 147, is %d", + last_msg.msg.network_state_resp.ipv6_address[5]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[6] == 68, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[6], " + "expected 68, is %d", + last_msg.msg.network_state_resp.ipv6_address[6]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[7] == 222, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[7], " + "expected 222, is %d", + last_msg.msg.network_state_resp.ipv6_address[7]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[8] == 92, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[8], " + "expected 92, is %d", + last_msg.msg.network_state_resp.ipv6_address[8]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[9] == 192, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[9], " + "expected 192, is %d", + last_msg.msg.network_state_resp.ipv6_address[9]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[10] == 78, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[10], " + "expected 78, is %d", + last_msg.msg.network_state_resp.ipv6_address[10]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[11] == 235, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[11], " + "expected 235, is %d", + last_msg.msg.network_state_resp.ipv6_address[11]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[12] == 63, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[12], " + "expected 63, is %d", + last_msg.msg.network_state_resp.ipv6_address[12]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[13] == 208, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[13], " + "expected 208, is %d", + last_msg.msg.network_state_resp.ipv6_address[13]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[14] == 114, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[14], " + "expected 114, is %d", + last_msg.msg.network_state_resp.ipv6_address[14]); + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_address[15] == 53, + "incorrect value for last_msg.msg.network_state_resp.ipv6_address[15], " + "expected 53, is %d", + last_msg.msg.network_state_resp.ipv6_address[15]); + + ck_assert_msg( + last_msg.msg.network_state_resp.ipv6_mask_size == 183, + "incorrect value for last_msg.msg.network_state_resp.ipv6_mask_size, " + "expected 183, is %d", + last_msg.msg.network_state_resp.ipv6_mask_size); + + ck_assert_msg( + last_msg.msg.network_state_resp.rx_bytes == 451408920, + "incorrect value for last_msg.msg.network_state_resp.rx_bytes, " + "expected 451408920, is %d", + last_msg.msg.network_state_resp.rx_bytes); + + ck_assert_msg( + last_msg.msg.network_state_resp.tx_bytes == 59251049, + "incorrect value for last_msg.msg.network_state_resp.tx_bytes, " + "expected 59251049, is %d", + last_msg.msg.network_state_resp.tx_bytes); } } END_TEST -Suite* auto_check_sbp_piksi_MsgNetworkStateResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgNetworkStateResp"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgNetworkStateResp"); +Suite *auto_check_sbp_piksi_MsgNetworkStateResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgNetworkStateResp"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgNetworkStateResp"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgNetworkStateResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgReset.c b/c/test/auto_check_sbp_piksi_MsgReset.c index 9d21951e3..4d72cc421 100644 --- a/c/test/auto_check_sbp_piksi_MsgReset.c +++ b/c/test/auto_check_sbp_piksi_MsgReset.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgReset.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgReset.yaml by generate.py. Do not +// modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgReset ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgReset) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgReset ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,46 +90,53 @@ START_TEST( test_auto_check_sbp_piksi_MsgReset ) logging_reset(); - sbp_callback_register(&sbp_state, 0xb6, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xb6, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,182,0,63,210,4,88,248,238,19,74,207, }; + u8 encoded_frame[] = { + 85, 182, 0, 63, 210, 4, 88, 248, 238, 19, 74, 207, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.reset.flags = 334428248; sbp_message_send(&sbp_state, SbpMsgReset, 53823, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 53823, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgReset, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.reset.flags == 334428248, "incorrect value for last_msg.msg.reset.flags, expected 334428248, is %d", last_msg.msg.reset.flags); + "Sent and received messages did not compare equal"); + ck_assert_msg(last_msg.msg.reset.flags == 334428248, + "incorrect value for last_msg.msg.reset.flags, expected " + "334428248, is %d", + last_msg.msg.reset.flags); } } END_TEST -Suite* auto_check_sbp_piksi_MsgReset_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgReset"); +Suite *auto_check_sbp_piksi_MsgReset_suite(void) { + Suite *s = + suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgReset"); TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgReset"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgReset); suite_add_tcase(s, tc_acq); diff --git a/c/test/auto_check_sbp_piksi_MsgResetDep.c b/c/test/auto_check_sbp_piksi_MsgResetDep.c index d86986dd5..65ffd51b1 100644 --- a/c/test/auto_check_sbp_piksi_MsgResetDep.c +++ b/c/test/auto_check_sbp_piksi_MsgResetDep.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetDep.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgResetDep ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgResetDep) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgResetDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,9 +90,12 @@ START_TEST( test_auto_check_sbp_piksi_MsgResetDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0xb2, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xb2, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,178,0,64,11,0,234,171, }; + u8 encoded_frame[] = { + 85, 178, 0, 64, 11, 0, 234, 171, + }; dummy_reset(); @@ -106,31 +105,34 @@ START_TEST( test_auto_check_sbp_piksi_MsgResetDep ) sbp_message_send(&sbp_state, SbpMsgResetDep, 2880, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 2880, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgResetDep, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgResetDep, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - } } END_TEST -Suite* auto_check_sbp_piksi_MsgResetDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgResetDep"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgResetDep"); +Suite *auto_check_sbp_piksi_MsgResetDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgResetDep"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgResetDep"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgResetDep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgResetFilters.c b/c/test/auto_check_sbp_piksi_MsgResetFilters.c index 1452a8409..dc30529ec 100644 --- a/c/test/auto_check_sbp_piksi_MsgResetFilters.c +++ b/c/test/auto_check_sbp_piksi_MsgResetFilters.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetFilters.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetFilters.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgResetFilters ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgResetFilters) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgResetFilters ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,47 +90,57 @@ START_TEST( test_auto_check_sbp_piksi_MsgResetFilters ) logging_reset(); - sbp_callback_register(&sbp_state, 0x22, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x22, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,34,0,81,200,1,100,130,45, }; + u8 encoded_frame[] = { + 85, 34, 0, 81, 200, 1, 100, 130, 45, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.reset_filters.filter = 100; - sbp_message_send(&sbp_state, SbpMsgResetFilters, 51281, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgResetFilters, 51281, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 51281, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgResetFilters, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgResetFilters, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.reset_filters.filter == 100, "incorrect value for last_msg.msg.reset_filters.filter, expected 100, is %d", last_msg.msg.reset_filters.filter); + ck_assert_msg(last_msg.msg.reset_filters.filter == 100, + "incorrect value for last_msg.msg.reset_filters.filter, " + "expected 100, is %d", + last_msg.msg.reset_filters.filter); } } END_TEST -Suite* auto_check_sbp_piksi_MsgResetFilters_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgResetFilters"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgResetFilters"); +Suite *auto_check_sbp_piksi_MsgResetFilters_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgResetFilters"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgResetFilters"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgResetFilters); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgSetTime.c b/c/test/auto_check_sbp_piksi_MsgSetTime.c index 2608e3d24..ed8a131a1 100644 --- a/c/test/auto_check_sbp_piksi_MsgSetTime.c +++ b/c/test/auto_check_sbp_piksi_MsgSetTime.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSetTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSetTime.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgSetTime ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgSetTime) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgSetTime ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,9 +90,12 @@ START_TEST( test_auto_check_sbp_piksi_MsgSetTime ) logging_reset(); - sbp_callback_register(&sbp_state, 0x68, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x68, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,104,0,21,170,0,215,65, }; + u8 encoded_frame[] = { + 85, 104, 0, 21, 170, 0, 215, 65, + }; dummy_reset(); @@ -106,31 +105,33 @@ START_TEST( test_auto_check_sbp_piksi_MsgSetTime ) sbp_message_send(&sbp_state, SbpMsgSetTime, 43541, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 43541, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgSetTime, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - + "Sent and received messages did not compare equal"); } } END_TEST -Suite* auto_check_sbp_piksi_MsgSetTime_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgSetTime"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgSetTime"); +Suite *auto_check_sbp_piksi_MsgSetTime_suite(void) { + Suite *s = + suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgSetTime"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgSetTime"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgSetTime); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgSpecan.c b/c/test/auto_check_sbp_piksi_MsgSpecan.c index 90a651bad..be500630b 100644 --- a/c/test/auto_check_sbp_piksi_MsgSpecan.c +++ b/c/test/auto_check_sbp_piksi_MsgSpecan.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecan.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecan.yaml by generate.py. Do not +// modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgSpecan ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgSpecan) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgSpecan ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,764 +90,1674 @@ START_TEST( test_auto_check_sbp_piksi_MsgSpecan ) logging_reset(); - sbp_callback_register(&sbp_state, 0x51, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x51, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,81,0,28,212,255,74,137,71,245,34,73,12,221,215,167,211,19,154,201,241,69,205,136,0,70,51,67,108,69,102,38,166,68,100,179,185,17,175,49,193,228,228,47,33,24,141,177,18,99,246,121,61,40,91,145,223,167,174,9,116,11,247,84,49,153,205,2,230,194,218,241,101,107,45,137,93,114,230,43,224,23,74,209,199,211,130,89,220,163,68,20,253,7,206,50,129,116,194,23,31,226,217,157,205,221,5,224,92,82,109,223,195,233,165,1,82,141,157,177,169,244,131,96,109,111,253,149,28,225,225,72,158,158,210,196,206,70,63,225,184,150,174,240,45,146,59,82,194,4,179,148,66,254,115,77,30,46,4,204,37,200,121,18,17,171,102,163,175,50,66,101,69,13,223,172,160,233,220,101,237,156,62,117,47,143,94,135,22,155,113,110,15,243,141,227,46,143,227,209,249,2,153,168,131,249,160,88,38,117,129,57,40,109,209,177,38,47,12,15,16,9,175,69,70,182,239,117,135,6,71,99,230,115,2,71,165,228,123,210,168,90,124,20,7,220,144,168,69,22,72,162,69,111,91,251,72,220,28,119,150,95,2, }; + u8 encoded_frame[] = { + 85, 81, 0, 28, 212, 255, 74, 137, 71, 245, 34, 73, 12, 221, + 215, 167, 211, 19, 154, 201, 241, 69, 205, 136, 0, 70, 51, 67, + 108, 69, 102, 38, 166, 68, 100, 179, 185, 17, 175, 49, 193, 228, + 228, 47, 33, 24, 141, 177, 18, 99, 246, 121, 61, 40, 91, 145, + 223, 167, 174, 9, 116, 11, 247, 84, 49, 153, 205, 2, 230, 194, + 218, 241, 101, 107, 45, 137, 93, 114, 230, 43, 224, 23, 74, 209, + 199, 211, 130, 89, 220, 163, 68, 20, 253, 7, 206, 50, 129, 116, + 194, 23, 31, 226, 217, 157, 205, 221, 5, 224, 92, 82, 109, 223, + 195, 233, 165, 1, 82, 141, 157, 177, 169, 244, 131, 96, 109, 111, + 253, 149, 28, 225, 225, 72, 158, 158, 210, 196, 206, 70, 63, 225, + 184, 150, 174, 240, 45, 146, 59, 82, 194, 4, 179, 148, 66, 254, + 115, 77, 30, 46, 4, 204, 37, 200, 121, 18, 17, 171, 102, 163, + 175, 50, 66, 101, 69, 13, 223, 172, 160, 233, 220, 101, 237, 156, + 62, 117, 47, 143, 94, 135, 22, 155, 113, 110, 15, 243, 141, 227, + 46, 143, 227, 209, 249, 2, 153, 168, 131, 249, 160, 88, 38, 117, + 129, 57, 40, 109, 209, 177, 38, 47, 12, 15, 16, 9, 175, 69, + 70, 182, 239, 117, 135, 6, 71, 99, 230, 115, 2, 71, 165, 228, + 123, 210, 168, 90, 124, 20, 7, 220, 144, 168, 69, 22, 72, 162, + 69, 111, 91, 251, 72, 220, 28, 119, 150, 95, 2, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.specan.amplitude_ref = 3780.199951171875; - + test_msg.specan.amplitude_unit = 1329.199951171875; - - + test_msg.specan.amplitude_value[0] = 100; - + test_msg.specan.amplitude_value[1] = 179; - + test_msg.specan.amplitude_value[2] = 185; - + test_msg.specan.amplitude_value[3] = 17; - + test_msg.specan.amplitude_value[4] = 175; - + test_msg.specan.amplitude_value[5] = 49; - + test_msg.specan.amplitude_value[6] = 193; - + test_msg.specan.amplitude_value[7] = 228; - + test_msg.specan.amplitude_value[8] = 228; - + test_msg.specan.amplitude_value[9] = 47; - + test_msg.specan.amplitude_value[10] = 33; - + test_msg.specan.amplitude_value[11] = 24; - + test_msg.specan.amplitude_value[12] = 141; - + test_msg.specan.amplitude_value[13] = 177; - + test_msg.specan.amplitude_value[14] = 18; - + test_msg.specan.amplitude_value[15] = 99; - + test_msg.specan.amplitude_value[16] = 246; - + test_msg.specan.amplitude_value[17] = 121; - + test_msg.specan.amplitude_value[18] = 61; - + test_msg.specan.amplitude_value[19] = 40; - + test_msg.specan.amplitude_value[20] = 91; - + test_msg.specan.amplitude_value[21] = 145; - + test_msg.specan.amplitude_value[22] = 223; - + test_msg.specan.amplitude_value[23] = 167; - + test_msg.specan.amplitude_value[24] = 174; - + test_msg.specan.amplitude_value[25] = 9; - + test_msg.specan.amplitude_value[26] = 116; - + test_msg.specan.amplitude_value[27] = 11; - + test_msg.specan.amplitude_value[28] = 247; - + test_msg.specan.amplitude_value[29] = 84; - + test_msg.specan.amplitude_value[30] = 49; - + test_msg.specan.amplitude_value[31] = 153; - + test_msg.specan.amplitude_value[32] = 205; - + test_msg.specan.amplitude_value[33] = 2; - + test_msg.specan.amplitude_value[34] = 230; - + test_msg.specan.amplitude_value[35] = 194; - + test_msg.specan.amplitude_value[36] = 218; - + test_msg.specan.amplitude_value[37] = 241; - + test_msg.specan.amplitude_value[38] = 101; - + test_msg.specan.amplitude_value[39] = 107; - + test_msg.specan.amplitude_value[40] = 45; - + test_msg.specan.amplitude_value[41] = 137; - + test_msg.specan.amplitude_value[42] = 93; - + test_msg.specan.amplitude_value[43] = 114; - + test_msg.specan.amplitude_value[44] = 230; - + test_msg.specan.amplitude_value[45] = 43; - + test_msg.specan.amplitude_value[46] = 224; - + test_msg.specan.amplitude_value[47] = 23; - + test_msg.specan.amplitude_value[48] = 74; - + test_msg.specan.amplitude_value[49] = 209; - + test_msg.specan.amplitude_value[50] = 199; - + test_msg.specan.amplitude_value[51] = 211; - + test_msg.specan.amplitude_value[52] = 130; - + test_msg.specan.amplitude_value[53] = 89; - + test_msg.specan.amplitude_value[54] = 220; - + test_msg.specan.amplitude_value[55] = 163; - + test_msg.specan.amplitude_value[56] = 68; - + test_msg.specan.amplitude_value[57] = 20; - + test_msg.specan.amplitude_value[58] = 253; - + test_msg.specan.amplitude_value[59] = 7; - + test_msg.specan.amplitude_value[60] = 206; - + test_msg.specan.amplitude_value[61] = 50; - + test_msg.specan.amplitude_value[62] = 129; - + test_msg.specan.amplitude_value[63] = 116; - + test_msg.specan.amplitude_value[64] = 194; - + test_msg.specan.amplitude_value[65] = 23; - + test_msg.specan.amplitude_value[66] = 31; - + test_msg.specan.amplitude_value[67] = 226; - + test_msg.specan.amplitude_value[68] = 217; - + test_msg.specan.amplitude_value[69] = 157; - + test_msg.specan.amplitude_value[70] = 205; - + test_msg.specan.amplitude_value[71] = 221; - + test_msg.specan.amplitude_value[72] = 5; - + test_msg.specan.amplitude_value[73] = 224; - + test_msg.specan.amplitude_value[74] = 92; - + test_msg.specan.amplitude_value[75] = 82; - + test_msg.specan.amplitude_value[76] = 109; - + test_msg.specan.amplitude_value[77] = 223; - + test_msg.specan.amplitude_value[78] = 195; - + test_msg.specan.amplitude_value[79] = 233; - + test_msg.specan.amplitude_value[80] = 165; - + test_msg.specan.amplitude_value[81] = 1; - + test_msg.specan.amplitude_value[82] = 82; - + test_msg.specan.amplitude_value[83] = 141; - + test_msg.specan.amplitude_value[84] = 157; - + test_msg.specan.amplitude_value[85] = 177; - + test_msg.specan.amplitude_value[86] = 169; - + test_msg.specan.amplitude_value[87] = 244; - + test_msg.specan.amplitude_value[88] = 131; - + test_msg.specan.amplitude_value[89] = 96; - + test_msg.specan.amplitude_value[90] = 109; - + test_msg.specan.amplitude_value[91] = 111; - + test_msg.specan.amplitude_value[92] = 253; - + test_msg.specan.amplitude_value[93] = 149; - + test_msg.specan.amplitude_value[94] = 28; - + test_msg.specan.amplitude_value[95] = 225; - + test_msg.specan.amplitude_value[96] = 225; - + test_msg.specan.amplitude_value[97] = 72; - + test_msg.specan.amplitude_value[98] = 158; - + test_msg.specan.amplitude_value[99] = 158; - + test_msg.specan.amplitude_value[100] = 210; - + test_msg.specan.amplitude_value[101] = 196; - + test_msg.specan.amplitude_value[102] = 206; - + test_msg.specan.amplitude_value[103] = 70; - + test_msg.specan.amplitude_value[104] = 63; - + test_msg.specan.amplitude_value[105] = 225; - + test_msg.specan.amplitude_value[106] = 184; - + test_msg.specan.amplitude_value[107] = 150; - + test_msg.specan.amplitude_value[108] = 174; - + test_msg.specan.amplitude_value[109] = 240; - + test_msg.specan.amplitude_value[110] = 45; - + test_msg.specan.amplitude_value[111] = 146; - + test_msg.specan.amplitude_value[112] = 59; - + test_msg.specan.amplitude_value[113] = 82; - + test_msg.specan.amplitude_value[114] = 194; - + test_msg.specan.amplitude_value[115] = 4; - + test_msg.specan.amplitude_value[116] = 179; - + test_msg.specan.amplitude_value[117] = 148; - + test_msg.specan.amplitude_value[118] = 66; - + test_msg.specan.amplitude_value[119] = 254; - + test_msg.specan.amplitude_value[120] = 115; - + test_msg.specan.amplitude_value[121] = 77; - + test_msg.specan.amplitude_value[122] = 30; - + test_msg.specan.amplitude_value[123] = 46; - + test_msg.specan.amplitude_value[124] = 4; - + test_msg.specan.amplitude_value[125] = 204; - + test_msg.specan.amplitude_value[126] = 37; - + test_msg.specan.amplitude_value[127] = 200; - + test_msg.specan.amplitude_value[128] = 121; - + test_msg.specan.amplitude_value[129] = 18; - + test_msg.specan.amplitude_value[130] = 17; - + test_msg.specan.amplitude_value[131] = 171; - + test_msg.specan.amplitude_value[132] = 102; - + test_msg.specan.amplitude_value[133] = 163; - + test_msg.specan.amplitude_value[134] = 175; - + test_msg.specan.amplitude_value[135] = 50; - + test_msg.specan.amplitude_value[136] = 66; - + test_msg.specan.amplitude_value[137] = 101; - + test_msg.specan.amplitude_value[138] = 69; - + test_msg.specan.amplitude_value[139] = 13; - + test_msg.specan.amplitude_value[140] = 223; - + test_msg.specan.amplitude_value[141] = 172; - + test_msg.specan.amplitude_value[142] = 160; - + test_msg.specan.amplitude_value[143] = 233; - + test_msg.specan.amplitude_value[144] = 220; - + test_msg.specan.amplitude_value[145] = 101; - + test_msg.specan.amplitude_value[146] = 237; - + test_msg.specan.amplitude_value[147] = 156; - + test_msg.specan.amplitude_value[148] = 62; - + test_msg.specan.amplitude_value[149] = 117; - + test_msg.specan.amplitude_value[150] = 47; - + test_msg.specan.amplitude_value[151] = 143; - + test_msg.specan.amplitude_value[152] = 94; - + test_msg.specan.amplitude_value[153] = 135; - + test_msg.specan.amplitude_value[154] = 22; - + test_msg.specan.amplitude_value[155] = 155; - + test_msg.specan.amplitude_value[156] = 113; - + test_msg.specan.amplitude_value[157] = 110; - + test_msg.specan.amplitude_value[158] = 15; - + test_msg.specan.amplitude_value[159] = 243; - + test_msg.specan.amplitude_value[160] = 141; - + test_msg.specan.amplitude_value[161] = 227; - + test_msg.specan.amplitude_value[162] = 46; - + test_msg.specan.amplitude_value[163] = 143; - + test_msg.specan.amplitude_value[164] = 227; - + test_msg.specan.amplitude_value[165] = 209; - + test_msg.specan.amplitude_value[166] = 249; - + test_msg.specan.amplitude_value[167] = 2; - + test_msg.specan.amplitude_value[168] = 153; - + test_msg.specan.amplitude_value[169] = 168; - + test_msg.specan.amplitude_value[170] = 131; - + test_msg.specan.amplitude_value[171] = 249; - + test_msg.specan.amplitude_value[172] = 160; - + test_msg.specan.amplitude_value[173] = 88; - + test_msg.specan.amplitude_value[174] = 38; - + test_msg.specan.amplitude_value[175] = 117; - + test_msg.specan.amplitude_value[176] = 129; - + test_msg.specan.amplitude_value[177] = 57; - + test_msg.specan.amplitude_value[178] = 40; - + test_msg.specan.amplitude_value[179] = 109; - + test_msg.specan.amplitude_value[180] = 209; - + test_msg.specan.amplitude_value[181] = 177; - + test_msg.specan.amplitude_value[182] = 38; - + test_msg.specan.amplitude_value[183] = 47; - + test_msg.specan.amplitude_value[184] = 12; - + test_msg.specan.amplitude_value[185] = 15; - + test_msg.specan.amplitude_value[186] = 16; - + test_msg.specan.amplitude_value[187] = 9; - + test_msg.specan.amplitude_value[188] = 175; - + test_msg.specan.amplitude_value[189] = 69; - + test_msg.specan.amplitude_value[190] = 70; - + test_msg.specan.amplitude_value[191] = 182; - + test_msg.specan.amplitude_value[192] = 239; - + test_msg.specan.amplitude_value[193] = 117; - + test_msg.specan.amplitude_value[194] = 135; - + test_msg.specan.amplitude_value[195] = 6; - + test_msg.specan.amplitude_value[196] = 71; - + test_msg.specan.amplitude_value[197] = 99; - + test_msg.specan.amplitude_value[198] = 230; - + test_msg.specan.amplitude_value[199] = 115; - + test_msg.specan.amplitude_value[200] = 2; - + test_msg.specan.amplitude_value[201] = 71; - + test_msg.specan.amplitude_value[202] = 165; - + test_msg.specan.amplitude_value[203] = 228; - + test_msg.specan.amplitude_value[204] = 123; - + test_msg.specan.amplitude_value[205] = 210; - + test_msg.specan.amplitude_value[206] = 168; - + test_msg.specan.amplitude_value[207] = 90; - + test_msg.specan.amplitude_value[208] = 124; - + test_msg.specan.amplitude_value[209] = 20; - + test_msg.specan.amplitude_value[210] = 7; - + test_msg.specan.amplitude_value[211] = 220; - + test_msg.specan.amplitude_value[212] = 144; - + test_msg.specan.amplitude_value[213] = 168; - + test_msg.specan.amplitude_value[214] = 69; - + test_msg.specan.amplitude_value[215] = 22; - + test_msg.specan.amplitude_value[216] = 72; - + test_msg.specan.amplitude_value[217] = 162; - + test_msg.specan.amplitude_value[218] = 69; - + test_msg.specan.amplitude_value[219] = 111; - + test_msg.specan.amplitude_value[220] = 91; - + test_msg.specan.amplitude_value[221] = 251; - + test_msg.specan.amplitude_value[222] = 72; - + test_msg.specan.amplitude_value[223] = 220; - + test_msg.specan.amplitude_value[224] = 28; - + test_msg.specan.amplitude_value[225] = 119; - + test_msg.specan.amplitude_value[226] = 150; - + test_msg.specan.channel_tag = 35146; - + test_msg.specan.freq_ref = 7737.2001953125; - + test_msg.specan.freq_step = 8226.2001953125; - + test_msg.specan.n_amplitude_value = 227; - - + test_msg.specan.t.ns_residual = -1479025396; - + test_msg.specan.t.tow = 1227027783; - + test_msg.specan.t.wn = 5075; sbp_message_send(&sbp_state, SbpMsgSpecan, 54300, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 54300, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgSpecan, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.specan.amplitude_ref * 100 - 3780.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.specan.amplitude_ref, expected 3780.19995117, is %s", last_msg.msg.specan.amplitude_ref); - - ck_assert_msg((last_msg.msg.specan.amplitude_unit * 100 - 1329.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.specan.amplitude_unit, expected 1329.19995117, is %s", last_msg.msg.specan.amplitude_unit); - - ck_assert_msg(last_msg.msg.specan.amplitude_value[0] == 100, "incorrect value for last_msg.msg.specan.amplitude_value[0], expected 100, is %d", last_msg.msg.specan.amplitude_value[0]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[1] == 179, "incorrect value for last_msg.msg.specan.amplitude_value[1], expected 179, is %d", last_msg.msg.specan.amplitude_value[1]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[2] == 185, "incorrect value for last_msg.msg.specan.amplitude_value[2], expected 185, is %d", last_msg.msg.specan.amplitude_value[2]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[3] == 17, "incorrect value for last_msg.msg.specan.amplitude_value[3], expected 17, is %d", last_msg.msg.specan.amplitude_value[3]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[4] == 175, "incorrect value for last_msg.msg.specan.amplitude_value[4], expected 175, is %d", last_msg.msg.specan.amplitude_value[4]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[5] == 49, "incorrect value for last_msg.msg.specan.amplitude_value[5], expected 49, is %d", last_msg.msg.specan.amplitude_value[5]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[6] == 193, "incorrect value for last_msg.msg.specan.amplitude_value[6], expected 193, is %d", last_msg.msg.specan.amplitude_value[6]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[7] == 228, "incorrect value for last_msg.msg.specan.amplitude_value[7], expected 228, is %d", last_msg.msg.specan.amplitude_value[7]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[8] == 228, "incorrect value for last_msg.msg.specan.amplitude_value[8], expected 228, is %d", last_msg.msg.specan.amplitude_value[8]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[9] == 47, "incorrect value for last_msg.msg.specan.amplitude_value[9], expected 47, is %d", last_msg.msg.specan.amplitude_value[9]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[10] == 33, "incorrect value for last_msg.msg.specan.amplitude_value[10], expected 33, is %d", last_msg.msg.specan.amplitude_value[10]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[11] == 24, "incorrect value for last_msg.msg.specan.amplitude_value[11], expected 24, is %d", last_msg.msg.specan.amplitude_value[11]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[12] == 141, "incorrect value for last_msg.msg.specan.amplitude_value[12], expected 141, is %d", last_msg.msg.specan.amplitude_value[12]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[13] == 177, "incorrect value for last_msg.msg.specan.amplitude_value[13], expected 177, is %d", last_msg.msg.specan.amplitude_value[13]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[14] == 18, "incorrect value for last_msg.msg.specan.amplitude_value[14], expected 18, is %d", last_msg.msg.specan.amplitude_value[14]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[15] == 99, "incorrect value for last_msg.msg.specan.amplitude_value[15], expected 99, is %d", last_msg.msg.specan.amplitude_value[15]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[16] == 246, "incorrect value for last_msg.msg.specan.amplitude_value[16], expected 246, is %d", last_msg.msg.specan.amplitude_value[16]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[17] == 121, "incorrect value for last_msg.msg.specan.amplitude_value[17], expected 121, is %d", last_msg.msg.specan.amplitude_value[17]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[18] == 61, "incorrect value for last_msg.msg.specan.amplitude_value[18], expected 61, is %d", last_msg.msg.specan.amplitude_value[18]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[19] == 40, "incorrect value for last_msg.msg.specan.amplitude_value[19], expected 40, is %d", last_msg.msg.specan.amplitude_value[19]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[20] == 91, "incorrect value for last_msg.msg.specan.amplitude_value[20], expected 91, is %d", last_msg.msg.specan.amplitude_value[20]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[21] == 145, "incorrect value for last_msg.msg.specan.amplitude_value[21], expected 145, is %d", last_msg.msg.specan.amplitude_value[21]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[22] == 223, "incorrect value for last_msg.msg.specan.amplitude_value[22], expected 223, is %d", last_msg.msg.specan.amplitude_value[22]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[23] == 167, "incorrect value for last_msg.msg.specan.amplitude_value[23], expected 167, is %d", last_msg.msg.specan.amplitude_value[23]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[24] == 174, "incorrect value for last_msg.msg.specan.amplitude_value[24], expected 174, is %d", last_msg.msg.specan.amplitude_value[24]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[25] == 9, "incorrect value for last_msg.msg.specan.amplitude_value[25], expected 9, is %d", last_msg.msg.specan.amplitude_value[25]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[26] == 116, "incorrect value for last_msg.msg.specan.amplitude_value[26], expected 116, is %d", last_msg.msg.specan.amplitude_value[26]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[27] == 11, "incorrect value for last_msg.msg.specan.amplitude_value[27], expected 11, is %d", last_msg.msg.specan.amplitude_value[27]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[28] == 247, "incorrect value for last_msg.msg.specan.amplitude_value[28], expected 247, is %d", last_msg.msg.specan.amplitude_value[28]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[29] == 84, "incorrect value for last_msg.msg.specan.amplitude_value[29], expected 84, is %d", last_msg.msg.specan.amplitude_value[29]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[30] == 49, "incorrect value for last_msg.msg.specan.amplitude_value[30], expected 49, is %d", last_msg.msg.specan.amplitude_value[30]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[31] == 153, "incorrect value for last_msg.msg.specan.amplitude_value[31], expected 153, is %d", last_msg.msg.specan.amplitude_value[31]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[32] == 205, "incorrect value for last_msg.msg.specan.amplitude_value[32], expected 205, is %d", last_msg.msg.specan.amplitude_value[32]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[33] == 2, "incorrect value for last_msg.msg.specan.amplitude_value[33], expected 2, is %d", last_msg.msg.specan.amplitude_value[33]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[34] == 230, "incorrect value for last_msg.msg.specan.amplitude_value[34], expected 230, is %d", last_msg.msg.specan.amplitude_value[34]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[35] == 194, "incorrect value for last_msg.msg.specan.amplitude_value[35], expected 194, is %d", last_msg.msg.specan.amplitude_value[35]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[36] == 218, "incorrect value for last_msg.msg.specan.amplitude_value[36], expected 218, is %d", last_msg.msg.specan.amplitude_value[36]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[37] == 241, "incorrect value for last_msg.msg.specan.amplitude_value[37], expected 241, is %d", last_msg.msg.specan.amplitude_value[37]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[38] == 101, "incorrect value for last_msg.msg.specan.amplitude_value[38], expected 101, is %d", last_msg.msg.specan.amplitude_value[38]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[39] == 107, "incorrect value for last_msg.msg.specan.amplitude_value[39], expected 107, is %d", last_msg.msg.specan.amplitude_value[39]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[40] == 45, "incorrect value for last_msg.msg.specan.amplitude_value[40], expected 45, is %d", last_msg.msg.specan.amplitude_value[40]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[41] == 137, "incorrect value for last_msg.msg.specan.amplitude_value[41], expected 137, is %d", last_msg.msg.specan.amplitude_value[41]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[42] == 93, "incorrect value for last_msg.msg.specan.amplitude_value[42], expected 93, is %d", last_msg.msg.specan.amplitude_value[42]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[43] == 114, "incorrect value for last_msg.msg.specan.amplitude_value[43], expected 114, is %d", last_msg.msg.specan.amplitude_value[43]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[44] == 230, "incorrect value for last_msg.msg.specan.amplitude_value[44], expected 230, is %d", last_msg.msg.specan.amplitude_value[44]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[45] == 43, "incorrect value for last_msg.msg.specan.amplitude_value[45], expected 43, is %d", last_msg.msg.specan.amplitude_value[45]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[46] == 224, "incorrect value for last_msg.msg.specan.amplitude_value[46], expected 224, is %d", last_msg.msg.specan.amplitude_value[46]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[47] == 23, "incorrect value for last_msg.msg.specan.amplitude_value[47], expected 23, is %d", last_msg.msg.specan.amplitude_value[47]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[48] == 74, "incorrect value for last_msg.msg.specan.amplitude_value[48], expected 74, is %d", last_msg.msg.specan.amplitude_value[48]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[49] == 209, "incorrect value for last_msg.msg.specan.amplitude_value[49], expected 209, is %d", last_msg.msg.specan.amplitude_value[49]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[50] == 199, "incorrect value for last_msg.msg.specan.amplitude_value[50], expected 199, is %d", last_msg.msg.specan.amplitude_value[50]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[51] == 211, "incorrect value for last_msg.msg.specan.amplitude_value[51], expected 211, is %d", last_msg.msg.specan.amplitude_value[51]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[52] == 130, "incorrect value for last_msg.msg.specan.amplitude_value[52], expected 130, is %d", last_msg.msg.specan.amplitude_value[52]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[53] == 89, "incorrect value for last_msg.msg.specan.amplitude_value[53], expected 89, is %d", last_msg.msg.specan.amplitude_value[53]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[54] == 220, "incorrect value for last_msg.msg.specan.amplitude_value[54], expected 220, is %d", last_msg.msg.specan.amplitude_value[54]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[55] == 163, "incorrect value for last_msg.msg.specan.amplitude_value[55], expected 163, is %d", last_msg.msg.specan.amplitude_value[55]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[56] == 68, "incorrect value for last_msg.msg.specan.amplitude_value[56], expected 68, is %d", last_msg.msg.specan.amplitude_value[56]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[57] == 20, "incorrect value for last_msg.msg.specan.amplitude_value[57], expected 20, is %d", last_msg.msg.specan.amplitude_value[57]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[58] == 253, "incorrect value for last_msg.msg.specan.amplitude_value[58], expected 253, is %d", last_msg.msg.specan.amplitude_value[58]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[59] == 7, "incorrect value for last_msg.msg.specan.amplitude_value[59], expected 7, is %d", last_msg.msg.specan.amplitude_value[59]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[60] == 206, "incorrect value for last_msg.msg.specan.amplitude_value[60], expected 206, is %d", last_msg.msg.specan.amplitude_value[60]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[61] == 50, "incorrect value for last_msg.msg.specan.amplitude_value[61], expected 50, is %d", last_msg.msg.specan.amplitude_value[61]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[62] == 129, "incorrect value for last_msg.msg.specan.amplitude_value[62], expected 129, is %d", last_msg.msg.specan.amplitude_value[62]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[63] == 116, "incorrect value for last_msg.msg.specan.amplitude_value[63], expected 116, is %d", last_msg.msg.specan.amplitude_value[63]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[64] == 194, "incorrect value for last_msg.msg.specan.amplitude_value[64], expected 194, is %d", last_msg.msg.specan.amplitude_value[64]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[65] == 23, "incorrect value for last_msg.msg.specan.amplitude_value[65], expected 23, is %d", last_msg.msg.specan.amplitude_value[65]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[66] == 31, "incorrect value for last_msg.msg.specan.amplitude_value[66], expected 31, is %d", last_msg.msg.specan.amplitude_value[66]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[67] == 226, "incorrect value for last_msg.msg.specan.amplitude_value[67], expected 226, is %d", last_msg.msg.specan.amplitude_value[67]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[68] == 217, "incorrect value for last_msg.msg.specan.amplitude_value[68], expected 217, is %d", last_msg.msg.specan.amplitude_value[68]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[69] == 157, "incorrect value for last_msg.msg.specan.amplitude_value[69], expected 157, is %d", last_msg.msg.specan.amplitude_value[69]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[70] == 205, "incorrect value for last_msg.msg.specan.amplitude_value[70], expected 205, is %d", last_msg.msg.specan.amplitude_value[70]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[71] == 221, "incorrect value for last_msg.msg.specan.amplitude_value[71], expected 221, is %d", last_msg.msg.specan.amplitude_value[71]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[72] == 5, "incorrect value for last_msg.msg.specan.amplitude_value[72], expected 5, is %d", last_msg.msg.specan.amplitude_value[72]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[73] == 224, "incorrect value for last_msg.msg.specan.amplitude_value[73], expected 224, is %d", last_msg.msg.specan.amplitude_value[73]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[74] == 92, "incorrect value for last_msg.msg.specan.amplitude_value[74], expected 92, is %d", last_msg.msg.specan.amplitude_value[74]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[75] == 82, "incorrect value for last_msg.msg.specan.amplitude_value[75], expected 82, is %d", last_msg.msg.specan.amplitude_value[75]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[76] == 109, "incorrect value for last_msg.msg.specan.amplitude_value[76], expected 109, is %d", last_msg.msg.specan.amplitude_value[76]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[77] == 223, "incorrect value for last_msg.msg.specan.amplitude_value[77], expected 223, is %d", last_msg.msg.specan.amplitude_value[77]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[78] == 195, "incorrect value for last_msg.msg.specan.amplitude_value[78], expected 195, is %d", last_msg.msg.specan.amplitude_value[78]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[79] == 233, "incorrect value for last_msg.msg.specan.amplitude_value[79], expected 233, is %d", last_msg.msg.specan.amplitude_value[79]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[80] == 165, "incorrect value for last_msg.msg.specan.amplitude_value[80], expected 165, is %d", last_msg.msg.specan.amplitude_value[80]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[81] == 1, "incorrect value for last_msg.msg.specan.amplitude_value[81], expected 1, is %d", last_msg.msg.specan.amplitude_value[81]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[82] == 82, "incorrect value for last_msg.msg.specan.amplitude_value[82], expected 82, is %d", last_msg.msg.specan.amplitude_value[82]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[83] == 141, "incorrect value for last_msg.msg.specan.amplitude_value[83], expected 141, is %d", last_msg.msg.specan.amplitude_value[83]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[84] == 157, "incorrect value for last_msg.msg.specan.amplitude_value[84], expected 157, is %d", last_msg.msg.specan.amplitude_value[84]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[85] == 177, "incorrect value for last_msg.msg.specan.amplitude_value[85], expected 177, is %d", last_msg.msg.specan.amplitude_value[85]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[86] == 169, "incorrect value for last_msg.msg.specan.amplitude_value[86], expected 169, is %d", last_msg.msg.specan.amplitude_value[86]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[87] == 244, "incorrect value for last_msg.msg.specan.amplitude_value[87], expected 244, is %d", last_msg.msg.specan.amplitude_value[87]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[88] == 131, "incorrect value for last_msg.msg.specan.amplitude_value[88], expected 131, is %d", last_msg.msg.specan.amplitude_value[88]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[89] == 96, "incorrect value for last_msg.msg.specan.amplitude_value[89], expected 96, is %d", last_msg.msg.specan.amplitude_value[89]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[90] == 109, "incorrect value for last_msg.msg.specan.amplitude_value[90], expected 109, is %d", last_msg.msg.specan.amplitude_value[90]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[91] == 111, "incorrect value for last_msg.msg.specan.amplitude_value[91], expected 111, is %d", last_msg.msg.specan.amplitude_value[91]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[92] == 253, "incorrect value for last_msg.msg.specan.amplitude_value[92], expected 253, is %d", last_msg.msg.specan.amplitude_value[92]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[93] == 149, "incorrect value for last_msg.msg.specan.amplitude_value[93], expected 149, is %d", last_msg.msg.specan.amplitude_value[93]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[94] == 28, "incorrect value for last_msg.msg.specan.amplitude_value[94], expected 28, is %d", last_msg.msg.specan.amplitude_value[94]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[95] == 225, "incorrect value for last_msg.msg.specan.amplitude_value[95], expected 225, is %d", last_msg.msg.specan.amplitude_value[95]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[96] == 225, "incorrect value for last_msg.msg.specan.amplitude_value[96], expected 225, is %d", last_msg.msg.specan.amplitude_value[96]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[97] == 72, "incorrect value for last_msg.msg.specan.amplitude_value[97], expected 72, is %d", last_msg.msg.specan.amplitude_value[97]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[98] == 158, "incorrect value for last_msg.msg.specan.amplitude_value[98], expected 158, is %d", last_msg.msg.specan.amplitude_value[98]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[99] == 158, "incorrect value for last_msg.msg.specan.amplitude_value[99], expected 158, is %d", last_msg.msg.specan.amplitude_value[99]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[100] == 210, "incorrect value for last_msg.msg.specan.amplitude_value[100], expected 210, is %d", last_msg.msg.specan.amplitude_value[100]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[101] == 196, "incorrect value for last_msg.msg.specan.amplitude_value[101], expected 196, is %d", last_msg.msg.specan.amplitude_value[101]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[102] == 206, "incorrect value for last_msg.msg.specan.amplitude_value[102], expected 206, is %d", last_msg.msg.specan.amplitude_value[102]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[103] == 70, "incorrect value for last_msg.msg.specan.amplitude_value[103], expected 70, is %d", last_msg.msg.specan.amplitude_value[103]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[104] == 63, "incorrect value for last_msg.msg.specan.amplitude_value[104], expected 63, is %d", last_msg.msg.specan.amplitude_value[104]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[105] == 225, "incorrect value for last_msg.msg.specan.amplitude_value[105], expected 225, is %d", last_msg.msg.specan.amplitude_value[105]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[106] == 184, "incorrect value for last_msg.msg.specan.amplitude_value[106], expected 184, is %d", last_msg.msg.specan.amplitude_value[106]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[107] == 150, "incorrect value for last_msg.msg.specan.amplitude_value[107], expected 150, is %d", last_msg.msg.specan.amplitude_value[107]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[108] == 174, "incorrect value for last_msg.msg.specan.amplitude_value[108], expected 174, is %d", last_msg.msg.specan.amplitude_value[108]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[109] == 240, "incorrect value for last_msg.msg.specan.amplitude_value[109], expected 240, is %d", last_msg.msg.specan.amplitude_value[109]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[110] == 45, "incorrect value for last_msg.msg.specan.amplitude_value[110], expected 45, is %d", last_msg.msg.specan.amplitude_value[110]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[111] == 146, "incorrect value for last_msg.msg.specan.amplitude_value[111], expected 146, is %d", last_msg.msg.specan.amplitude_value[111]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[112] == 59, "incorrect value for last_msg.msg.specan.amplitude_value[112], expected 59, is %d", last_msg.msg.specan.amplitude_value[112]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[113] == 82, "incorrect value for last_msg.msg.specan.amplitude_value[113], expected 82, is %d", last_msg.msg.specan.amplitude_value[113]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[114] == 194, "incorrect value for last_msg.msg.specan.amplitude_value[114], expected 194, is %d", last_msg.msg.specan.amplitude_value[114]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[115] == 4, "incorrect value for last_msg.msg.specan.amplitude_value[115], expected 4, is %d", last_msg.msg.specan.amplitude_value[115]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[116] == 179, "incorrect value for last_msg.msg.specan.amplitude_value[116], expected 179, is %d", last_msg.msg.specan.amplitude_value[116]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[117] == 148, "incorrect value for last_msg.msg.specan.amplitude_value[117], expected 148, is %d", last_msg.msg.specan.amplitude_value[117]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[118] == 66, "incorrect value for last_msg.msg.specan.amplitude_value[118], expected 66, is %d", last_msg.msg.specan.amplitude_value[118]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[119] == 254, "incorrect value for last_msg.msg.specan.amplitude_value[119], expected 254, is %d", last_msg.msg.specan.amplitude_value[119]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[120] == 115, "incorrect value for last_msg.msg.specan.amplitude_value[120], expected 115, is %d", last_msg.msg.specan.amplitude_value[120]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[121] == 77, "incorrect value for last_msg.msg.specan.amplitude_value[121], expected 77, is %d", last_msg.msg.specan.amplitude_value[121]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[122] == 30, "incorrect value for last_msg.msg.specan.amplitude_value[122], expected 30, is %d", last_msg.msg.specan.amplitude_value[122]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[123] == 46, "incorrect value for last_msg.msg.specan.amplitude_value[123], expected 46, is %d", last_msg.msg.specan.amplitude_value[123]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[124] == 4, "incorrect value for last_msg.msg.specan.amplitude_value[124], expected 4, is %d", last_msg.msg.specan.amplitude_value[124]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[125] == 204, "incorrect value for last_msg.msg.specan.amplitude_value[125], expected 204, is %d", last_msg.msg.specan.amplitude_value[125]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[126] == 37, "incorrect value for last_msg.msg.specan.amplitude_value[126], expected 37, is %d", last_msg.msg.specan.amplitude_value[126]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[127] == 200, "incorrect value for last_msg.msg.specan.amplitude_value[127], expected 200, is %d", last_msg.msg.specan.amplitude_value[127]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[128] == 121, "incorrect value for last_msg.msg.specan.amplitude_value[128], expected 121, is %d", last_msg.msg.specan.amplitude_value[128]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[129] == 18, "incorrect value for last_msg.msg.specan.amplitude_value[129], expected 18, is %d", last_msg.msg.specan.amplitude_value[129]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[130] == 17, "incorrect value for last_msg.msg.specan.amplitude_value[130], expected 17, is %d", last_msg.msg.specan.amplitude_value[130]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[131] == 171, "incorrect value for last_msg.msg.specan.amplitude_value[131], expected 171, is %d", last_msg.msg.specan.amplitude_value[131]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[132] == 102, "incorrect value for last_msg.msg.specan.amplitude_value[132], expected 102, is %d", last_msg.msg.specan.amplitude_value[132]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[133] == 163, "incorrect value for last_msg.msg.specan.amplitude_value[133], expected 163, is %d", last_msg.msg.specan.amplitude_value[133]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[134] == 175, "incorrect value for last_msg.msg.specan.amplitude_value[134], expected 175, is %d", last_msg.msg.specan.amplitude_value[134]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[135] == 50, "incorrect value for last_msg.msg.specan.amplitude_value[135], expected 50, is %d", last_msg.msg.specan.amplitude_value[135]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[136] == 66, "incorrect value for last_msg.msg.specan.amplitude_value[136], expected 66, is %d", last_msg.msg.specan.amplitude_value[136]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[137] == 101, "incorrect value for last_msg.msg.specan.amplitude_value[137], expected 101, is %d", last_msg.msg.specan.amplitude_value[137]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[138] == 69, "incorrect value for last_msg.msg.specan.amplitude_value[138], expected 69, is %d", last_msg.msg.specan.amplitude_value[138]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[139] == 13, "incorrect value for last_msg.msg.specan.amplitude_value[139], expected 13, is %d", last_msg.msg.specan.amplitude_value[139]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[140] == 223, "incorrect value for last_msg.msg.specan.amplitude_value[140], expected 223, is %d", last_msg.msg.specan.amplitude_value[140]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[141] == 172, "incorrect value for last_msg.msg.specan.amplitude_value[141], expected 172, is %d", last_msg.msg.specan.amplitude_value[141]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[142] == 160, "incorrect value for last_msg.msg.specan.amplitude_value[142], expected 160, is %d", last_msg.msg.specan.amplitude_value[142]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[143] == 233, "incorrect value for last_msg.msg.specan.amplitude_value[143], expected 233, is %d", last_msg.msg.specan.amplitude_value[143]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[144] == 220, "incorrect value for last_msg.msg.specan.amplitude_value[144], expected 220, is %d", last_msg.msg.specan.amplitude_value[144]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[145] == 101, "incorrect value for last_msg.msg.specan.amplitude_value[145], expected 101, is %d", last_msg.msg.specan.amplitude_value[145]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[146] == 237, "incorrect value for last_msg.msg.specan.amplitude_value[146], expected 237, is %d", last_msg.msg.specan.amplitude_value[146]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[147] == 156, "incorrect value for last_msg.msg.specan.amplitude_value[147], expected 156, is %d", last_msg.msg.specan.amplitude_value[147]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[148] == 62, "incorrect value for last_msg.msg.specan.amplitude_value[148], expected 62, is %d", last_msg.msg.specan.amplitude_value[148]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[149] == 117, "incorrect value for last_msg.msg.specan.amplitude_value[149], expected 117, is %d", last_msg.msg.specan.amplitude_value[149]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[150] == 47, "incorrect value for last_msg.msg.specan.amplitude_value[150], expected 47, is %d", last_msg.msg.specan.amplitude_value[150]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[151] == 143, "incorrect value for last_msg.msg.specan.amplitude_value[151], expected 143, is %d", last_msg.msg.specan.amplitude_value[151]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[152] == 94, "incorrect value for last_msg.msg.specan.amplitude_value[152], expected 94, is %d", last_msg.msg.specan.amplitude_value[152]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[153] == 135, "incorrect value for last_msg.msg.specan.amplitude_value[153], expected 135, is %d", last_msg.msg.specan.amplitude_value[153]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[154] == 22, "incorrect value for last_msg.msg.specan.amplitude_value[154], expected 22, is %d", last_msg.msg.specan.amplitude_value[154]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[155] == 155, "incorrect value for last_msg.msg.specan.amplitude_value[155], expected 155, is %d", last_msg.msg.specan.amplitude_value[155]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[156] == 113, "incorrect value for last_msg.msg.specan.amplitude_value[156], expected 113, is %d", last_msg.msg.specan.amplitude_value[156]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[157] == 110, "incorrect value for last_msg.msg.specan.amplitude_value[157], expected 110, is %d", last_msg.msg.specan.amplitude_value[157]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[158] == 15, "incorrect value for last_msg.msg.specan.amplitude_value[158], expected 15, is %d", last_msg.msg.specan.amplitude_value[158]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[159] == 243, "incorrect value for last_msg.msg.specan.amplitude_value[159], expected 243, is %d", last_msg.msg.specan.amplitude_value[159]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[160] == 141, "incorrect value for last_msg.msg.specan.amplitude_value[160], expected 141, is %d", last_msg.msg.specan.amplitude_value[160]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[161] == 227, "incorrect value for last_msg.msg.specan.amplitude_value[161], expected 227, is %d", last_msg.msg.specan.amplitude_value[161]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[162] == 46, "incorrect value for last_msg.msg.specan.amplitude_value[162], expected 46, is %d", last_msg.msg.specan.amplitude_value[162]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[163] == 143, "incorrect value for last_msg.msg.specan.amplitude_value[163], expected 143, is %d", last_msg.msg.specan.amplitude_value[163]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[164] == 227, "incorrect value for last_msg.msg.specan.amplitude_value[164], expected 227, is %d", last_msg.msg.specan.amplitude_value[164]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[165] == 209, "incorrect value for last_msg.msg.specan.amplitude_value[165], expected 209, is %d", last_msg.msg.specan.amplitude_value[165]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[166] == 249, "incorrect value for last_msg.msg.specan.amplitude_value[166], expected 249, is %d", last_msg.msg.specan.amplitude_value[166]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[167] == 2, "incorrect value for last_msg.msg.specan.amplitude_value[167], expected 2, is %d", last_msg.msg.specan.amplitude_value[167]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[168] == 153, "incorrect value for last_msg.msg.specan.amplitude_value[168], expected 153, is %d", last_msg.msg.specan.amplitude_value[168]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[169] == 168, "incorrect value for last_msg.msg.specan.amplitude_value[169], expected 168, is %d", last_msg.msg.specan.amplitude_value[169]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[170] == 131, "incorrect value for last_msg.msg.specan.amplitude_value[170], expected 131, is %d", last_msg.msg.specan.amplitude_value[170]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[171] == 249, "incorrect value for last_msg.msg.specan.amplitude_value[171], expected 249, is %d", last_msg.msg.specan.amplitude_value[171]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[172] == 160, "incorrect value for last_msg.msg.specan.amplitude_value[172], expected 160, is %d", last_msg.msg.specan.amplitude_value[172]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[173] == 88, "incorrect value for last_msg.msg.specan.amplitude_value[173], expected 88, is %d", last_msg.msg.specan.amplitude_value[173]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[174] == 38, "incorrect value for last_msg.msg.specan.amplitude_value[174], expected 38, is %d", last_msg.msg.specan.amplitude_value[174]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[175] == 117, "incorrect value for last_msg.msg.specan.amplitude_value[175], expected 117, is %d", last_msg.msg.specan.amplitude_value[175]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[176] == 129, "incorrect value for last_msg.msg.specan.amplitude_value[176], expected 129, is %d", last_msg.msg.specan.amplitude_value[176]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[177] == 57, "incorrect value for last_msg.msg.specan.amplitude_value[177], expected 57, is %d", last_msg.msg.specan.amplitude_value[177]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[178] == 40, "incorrect value for last_msg.msg.specan.amplitude_value[178], expected 40, is %d", last_msg.msg.specan.amplitude_value[178]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[179] == 109, "incorrect value for last_msg.msg.specan.amplitude_value[179], expected 109, is %d", last_msg.msg.specan.amplitude_value[179]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[180] == 209, "incorrect value for last_msg.msg.specan.amplitude_value[180], expected 209, is %d", last_msg.msg.specan.amplitude_value[180]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[181] == 177, "incorrect value for last_msg.msg.specan.amplitude_value[181], expected 177, is %d", last_msg.msg.specan.amplitude_value[181]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[182] == 38, "incorrect value for last_msg.msg.specan.amplitude_value[182], expected 38, is %d", last_msg.msg.specan.amplitude_value[182]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[183] == 47, "incorrect value for last_msg.msg.specan.amplitude_value[183], expected 47, is %d", last_msg.msg.specan.amplitude_value[183]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[184] == 12, "incorrect value for last_msg.msg.specan.amplitude_value[184], expected 12, is %d", last_msg.msg.specan.amplitude_value[184]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[185] == 15, "incorrect value for last_msg.msg.specan.amplitude_value[185], expected 15, is %d", last_msg.msg.specan.amplitude_value[185]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[186] == 16, "incorrect value for last_msg.msg.specan.amplitude_value[186], expected 16, is %d", last_msg.msg.specan.amplitude_value[186]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[187] == 9, "incorrect value for last_msg.msg.specan.amplitude_value[187], expected 9, is %d", last_msg.msg.specan.amplitude_value[187]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[188] == 175, "incorrect value for last_msg.msg.specan.amplitude_value[188], expected 175, is %d", last_msg.msg.specan.amplitude_value[188]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[189] == 69, "incorrect value for last_msg.msg.specan.amplitude_value[189], expected 69, is %d", last_msg.msg.specan.amplitude_value[189]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[190] == 70, "incorrect value for last_msg.msg.specan.amplitude_value[190], expected 70, is %d", last_msg.msg.specan.amplitude_value[190]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[191] == 182, "incorrect value for last_msg.msg.specan.amplitude_value[191], expected 182, is %d", last_msg.msg.specan.amplitude_value[191]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[192] == 239, "incorrect value for last_msg.msg.specan.amplitude_value[192], expected 239, is %d", last_msg.msg.specan.amplitude_value[192]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[193] == 117, "incorrect value for last_msg.msg.specan.amplitude_value[193], expected 117, is %d", last_msg.msg.specan.amplitude_value[193]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[194] == 135, "incorrect value for last_msg.msg.specan.amplitude_value[194], expected 135, is %d", last_msg.msg.specan.amplitude_value[194]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[195] == 6, "incorrect value for last_msg.msg.specan.amplitude_value[195], expected 6, is %d", last_msg.msg.specan.amplitude_value[195]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[196] == 71, "incorrect value for last_msg.msg.specan.amplitude_value[196], expected 71, is %d", last_msg.msg.specan.amplitude_value[196]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[197] == 99, "incorrect value for last_msg.msg.specan.amplitude_value[197], expected 99, is %d", last_msg.msg.specan.amplitude_value[197]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[198] == 230, "incorrect value for last_msg.msg.specan.amplitude_value[198], expected 230, is %d", last_msg.msg.specan.amplitude_value[198]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[199] == 115, "incorrect value for last_msg.msg.specan.amplitude_value[199], expected 115, is %d", last_msg.msg.specan.amplitude_value[199]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[200] == 2, "incorrect value for last_msg.msg.specan.amplitude_value[200], expected 2, is %d", last_msg.msg.specan.amplitude_value[200]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[201] == 71, "incorrect value for last_msg.msg.specan.amplitude_value[201], expected 71, is %d", last_msg.msg.specan.amplitude_value[201]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[202] == 165, "incorrect value for last_msg.msg.specan.amplitude_value[202], expected 165, is %d", last_msg.msg.specan.amplitude_value[202]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[203] == 228, "incorrect value for last_msg.msg.specan.amplitude_value[203], expected 228, is %d", last_msg.msg.specan.amplitude_value[203]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[204] == 123, "incorrect value for last_msg.msg.specan.amplitude_value[204], expected 123, is %d", last_msg.msg.specan.amplitude_value[204]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[205] == 210, "incorrect value for last_msg.msg.specan.amplitude_value[205], expected 210, is %d", last_msg.msg.specan.amplitude_value[205]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[206] == 168, "incorrect value for last_msg.msg.specan.amplitude_value[206], expected 168, is %d", last_msg.msg.specan.amplitude_value[206]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[207] == 90, "incorrect value for last_msg.msg.specan.amplitude_value[207], expected 90, is %d", last_msg.msg.specan.amplitude_value[207]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[208] == 124, "incorrect value for last_msg.msg.specan.amplitude_value[208], expected 124, is %d", last_msg.msg.specan.amplitude_value[208]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[209] == 20, "incorrect value for last_msg.msg.specan.amplitude_value[209], expected 20, is %d", last_msg.msg.specan.amplitude_value[209]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[210] == 7, "incorrect value for last_msg.msg.specan.amplitude_value[210], expected 7, is %d", last_msg.msg.specan.amplitude_value[210]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[211] == 220, "incorrect value for last_msg.msg.specan.amplitude_value[211], expected 220, is %d", last_msg.msg.specan.amplitude_value[211]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[212] == 144, "incorrect value for last_msg.msg.specan.amplitude_value[212], expected 144, is %d", last_msg.msg.specan.amplitude_value[212]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[213] == 168, "incorrect value for last_msg.msg.specan.amplitude_value[213], expected 168, is %d", last_msg.msg.specan.amplitude_value[213]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[214] == 69, "incorrect value for last_msg.msg.specan.amplitude_value[214], expected 69, is %d", last_msg.msg.specan.amplitude_value[214]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[215] == 22, "incorrect value for last_msg.msg.specan.amplitude_value[215], expected 22, is %d", last_msg.msg.specan.amplitude_value[215]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[216] == 72, "incorrect value for last_msg.msg.specan.amplitude_value[216], expected 72, is %d", last_msg.msg.specan.amplitude_value[216]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[217] == 162, "incorrect value for last_msg.msg.specan.amplitude_value[217], expected 162, is %d", last_msg.msg.specan.amplitude_value[217]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[218] == 69, "incorrect value for last_msg.msg.specan.amplitude_value[218], expected 69, is %d", last_msg.msg.specan.amplitude_value[218]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[219] == 111, "incorrect value for last_msg.msg.specan.amplitude_value[219], expected 111, is %d", last_msg.msg.specan.amplitude_value[219]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[220] == 91, "incorrect value for last_msg.msg.specan.amplitude_value[220], expected 91, is %d", last_msg.msg.specan.amplitude_value[220]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[221] == 251, "incorrect value for last_msg.msg.specan.amplitude_value[221], expected 251, is %d", last_msg.msg.specan.amplitude_value[221]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[222] == 72, "incorrect value for last_msg.msg.specan.amplitude_value[222], expected 72, is %d", last_msg.msg.specan.amplitude_value[222]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[223] == 220, "incorrect value for last_msg.msg.specan.amplitude_value[223], expected 220, is %d", last_msg.msg.specan.amplitude_value[223]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[224] == 28, "incorrect value for last_msg.msg.specan.amplitude_value[224], expected 28, is %d", last_msg.msg.specan.amplitude_value[224]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[225] == 119, "incorrect value for last_msg.msg.specan.amplitude_value[225], expected 119, is %d", last_msg.msg.specan.amplitude_value[225]); - ck_assert_msg(last_msg.msg.specan.amplitude_value[226] == 150, "incorrect value for last_msg.msg.specan.amplitude_value[226], expected 150, is %d", last_msg.msg.specan.amplitude_value[226]); - - ck_assert_msg(last_msg.msg.specan.channel_tag == 35146, "incorrect value for last_msg.msg.specan.channel_tag, expected 35146, is %d", last_msg.msg.specan.channel_tag); - - ck_assert_msg((last_msg.msg.specan.freq_ref * 100 - 7737.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.specan.freq_ref, expected 7737.20019531, is %s", last_msg.msg.specan.freq_ref); - - ck_assert_msg((last_msg.msg.specan.freq_step * 100 - 8226.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.specan.freq_step, expected 8226.20019531, is %s", last_msg.msg.specan.freq_step); - - ck_assert_msg(last_msg.msg.specan.n_amplitude_value == 227, "incorrect value for last_msg.msg.specan.n_amplitude_value, expected 227, is %d", last_msg.msg.specan.n_amplitude_value); - - - ck_assert_msg(last_msg.msg.specan.t.ns_residual == -1479025396, "incorrect value for last_msg.msg.specan.t.ns_residual, expected -1479025396, is %d", last_msg.msg.specan.t.ns_residual); - - ck_assert_msg(last_msg.msg.specan.t.tow == 1227027783, "incorrect value for last_msg.msg.specan.t.tow, expected 1227027783, is %d", last_msg.msg.specan.t.tow); - - ck_assert_msg(last_msg.msg.specan.t.wn == 5075, "incorrect value for last_msg.msg.specan.t.wn, expected 5075, is %d", last_msg.msg.specan.t.wn); + "Sent and received messages did not compare equal"); + + ck_assert_msg( + (last_msg.msg.specan.amplitude_ref * 100 - 3780.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.specan.amplitude_ref, expected " + "3780.19995117, is %s", + last_msg.msg.specan.amplitude_ref); + + ck_assert_msg( + (last_msg.msg.specan.amplitude_unit * 100 - 1329.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.specan.amplitude_unit, expected " + "1329.19995117, is %s", + last_msg.msg.specan.amplitude_unit); + + ck_assert_msg(last_msg.msg.specan.amplitude_value[0] == 100, + "incorrect value for last_msg.msg.specan.amplitude_value[0], " + "expected 100, is %d", + last_msg.msg.specan.amplitude_value[0]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[1] == 179, + "incorrect value for last_msg.msg.specan.amplitude_value[1], " + "expected 179, is %d", + last_msg.msg.specan.amplitude_value[1]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[2] == 185, + "incorrect value for last_msg.msg.specan.amplitude_value[2], " + "expected 185, is %d", + last_msg.msg.specan.amplitude_value[2]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[3] == 17, + "incorrect value for last_msg.msg.specan.amplitude_value[3], " + "expected 17, is %d", + last_msg.msg.specan.amplitude_value[3]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[4] == 175, + "incorrect value for last_msg.msg.specan.amplitude_value[4], " + "expected 175, is %d", + last_msg.msg.specan.amplitude_value[4]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[5] == 49, + "incorrect value for last_msg.msg.specan.amplitude_value[5], " + "expected 49, is %d", + last_msg.msg.specan.amplitude_value[5]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[6] == 193, + "incorrect value for last_msg.msg.specan.amplitude_value[6], " + "expected 193, is %d", + last_msg.msg.specan.amplitude_value[6]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[7] == 228, + "incorrect value for last_msg.msg.specan.amplitude_value[7], " + "expected 228, is %d", + last_msg.msg.specan.amplitude_value[7]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[8] == 228, + "incorrect value for last_msg.msg.specan.amplitude_value[8], " + "expected 228, is %d", + last_msg.msg.specan.amplitude_value[8]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[9] == 47, + "incorrect value for last_msg.msg.specan.amplitude_value[9], " + "expected 47, is %d", + last_msg.msg.specan.amplitude_value[9]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[10] == 33, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[10], expected 33, is %d", + last_msg.msg.specan.amplitude_value[10]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[11] == 24, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[11], expected 24, is %d", + last_msg.msg.specan.amplitude_value[11]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[12] == 141, + "incorrect value for last_msg.msg.specan.amplitude_value[12], expected " + "141, is %d", + last_msg.msg.specan.amplitude_value[12]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[13] == 177, + "incorrect value for last_msg.msg.specan.amplitude_value[13], expected " + "177, is %d", + last_msg.msg.specan.amplitude_value[13]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[14] == 18, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[14], expected 18, is %d", + last_msg.msg.specan.amplitude_value[14]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[15] == 99, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[15], expected 99, is %d", + last_msg.msg.specan.amplitude_value[15]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[16] == 246, + "incorrect value for last_msg.msg.specan.amplitude_value[16], expected " + "246, is %d", + last_msg.msg.specan.amplitude_value[16]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[17] == 121, + "incorrect value for last_msg.msg.specan.amplitude_value[17], expected " + "121, is %d", + last_msg.msg.specan.amplitude_value[17]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[18] == 61, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[18], expected 61, is %d", + last_msg.msg.specan.amplitude_value[18]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[19] == 40, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[19], expected 40, is %d", + last_msg.msg.specan.amplitude_value[19]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[20] == 91, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[20], expected 91, is %d", + last_msg.msg.specan.amplitude_value[20]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[21] == 145, + "incorrect value for last_msg.msg.specan.amplitude_value[21], expected " + "145, is %d", + last_msg.msg.specan.amplitude_value[21]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[22] == 223, + "incorrect value for last_msg.msg.specan.amplitude_value[22], expected " + "223, is %d", + last_msg.msg.specan.amplitude_value[22]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[23] == 167, + "incorrect value for last_msg.msg.specan.amplitude_value[23], expected " + "167, is %d", + last_msg.msg.specan.amplitude_value[23]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[24] == 174, + "incorrect value for last_msg.msg.specan.amplitude_value[24], expected " + "174, is %d", + last_msg.msg.specan.amplitude_value[24]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[25] == 9, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[25], expected 9, is %d", + last_msg.msg.specan.amplitude_value[25]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[26] == 116, + "incorrect value for last_msg.msg.specan.amplitude_value[26], expected " + "116, is %d", + last_msg.msg.specan.amplitude_value[26]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[27] == 11, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[27], expected 11, is %d", + last_msg.msg.specan.amplitude_value[27]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[28] == 247, + "incorrect value for last_msg.msg.specan.amplitude_value[28], expected " + "247, is %d", + last_msg.msg.specan.amplitude_value[28]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[29] == 84, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[29], expected 84, is %d", + last_msg.msg.specan.amplitude_value[29]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[30] == 49, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[30], expected 49, is %d", + last_msg.msg.specan.amplitude_value[30]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[31] == 153, + "incorrect value for last_msg.msg.specan.amplitude_value[31], expected " + "153, is %d", + last_msg.msg.specan.amplitude_value[31]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[32] == 205, + "incorrect value for last_msg.msg.specan.amplitude_value[32], expected " + "205, is %d", + last_msg.msg.specan.amplitude_value[32]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[33] == 2, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[33], expected 2, is %d", + last_msg.msg.specan.amplitude_value[33]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[34] == 230, + "incorrect value for last_msg.msg.specan.amplitude_value[34], expected " + "230, is %d", + last_msg.msg.specan.amplitude_value[34]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[35] == 194, + "incorrect value for last_msg.msg.specan.amplitude_value[35], expected " + "194, is %d", + last_msg.msg.specan.amplitude_value[35]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[36] == 218, + "incorrect value for last_msg.msg.specan.amplitude_value[36], expected " + "218, is %d", + last_msg.msg.specan.amplitude_value[36]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[37] == 241, + "incorrect value for last_msg.msg.specan.amplitude_value[37], expected " + "241, is %d", + last_msg.msg.specan.amplitude_value[37]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[38] == 101, + "incorrect value for last_msg.msg.specan.amplitude_value[38], expected " + "101, is %d", + last_msg.msg.specan.amplitude_value[38]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[39] == 107, + "incorrect value for last_msg.msg.specan.amplitude_value[39], expected " + "107, is %d", + last_msg.msg.specan.amplitude_value[39]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[40] == 45, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[40], expected 45, is %d", + last_msg.msg.specan.amplitude_value[40]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[41] == 137, + "incorrect value for last_msg.msg.specan.amplitude_value[41], expected " + "137, is %d", + last_msg.msg.specan.amplitude_value[41]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[42] == 93, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[42], expected 93, is %d", + last_msg.msg.specan.amplitude_value[42]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[43] == 114, + "incorrect value for last_msg.msg.specan.amplitude_value[43], expected " + "114, is %d", + last_msg.msg.specan.amplitude_value[43]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[44] == 230, + "incorrect value for last_msg.msg.specan.amplitude_value[44], expected " + "230, is %d", + last_msg.msg.specan.amplitude_value[44]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[45] == 43, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[45], expected 43, is %d", + last_msg.msg.specan.amplitude_value[45]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[46] == 224, + "incorrect value for last_msg.msg.specan.amplitude_value[46], expected " + "224, is %d", + last_msg.msg.specan.amplitude_value[46]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[47] == 23, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[47], expected 23, is %d", + last_msg.msg.specan.amplitude_value[47]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[48] == 74, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[48], expected 74, is %d", + last_msg.msg.specan.amplitude_value[48]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[49] == 209, + "incorrect value for last_msg.msg.specan.amplitude_value[49], expected " + "209, is %d", + last_msg.msg.specan.amplitude_value[49]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[50] == 199, + "incorrect value for last_msg.msg.specan.amplitude_value[50], expected " + "199, is %d", + last_msg.msg.specan.amplitude_value[50]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[51] == 211, + "incorrect value for last_msg.msg.specan.amplitude_value[51], expected " + "211, is %d", + last_msg.msg.specan.amplitude_value[51]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[52] == 130, + "incorrect value for last_msg.msg.specan.amplitude_value[52], expected " + "130, is %d", + last_msg.msg.specan.amplitude_value[52]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[53] == 89, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[53], expected 89, is %d", + last_msg.msg.specan.amplitude_value[53]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[54] == 220, + "incorrect value for last_msg.msg.specan.amplitude_value[54], expected " + "220, is %d", + last_msg.msg.specan.amplitude_value[54]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[55] == 163, + "incorrect value for last_msg.msg.specan.amplitude_value[55], expected " + "163, is %d", + last_msg.msg.specan.amplitude_value[55]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[56] == 68, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[56], expected 68, is %d", + last_msg.msg.specan.amplitude_value[56]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[57] == 20, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[57], expected 20, is %d", + last_msg.msg.specan.amplitude_value[57]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[58] == 253, + "incorrect value for last_msg.msg.specan.amplitude_value[58], expected " + "253, is %d", + last_msg.msg.specan.amplitude_value[58]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[59] == 7, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[59], expected 7, is %d", + last_msg.msg.specan.amplitude_value[59]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[60] == 206, + "incorrect value for last_msg.msg.specan.amplitude_value[60], expected " + "206, is %d", + last_msg.msg.specan.amplitude_value[60]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[61] == 50, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[61], expected 50, is %d", + last_msg.msg.specan.amplitude_value[61]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[62] == 129, + "incorrect value for last_msg.msg.specan.amplitude_value[62], expected " + "129, is %d", + last_msg.msg.specan.amplitude_value[62]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[63] == 116, + "incorrect value for last_msg.msg.specan.amplitude_value[63], expected " + "116, is %d", + last_msg.msg.specan.amplitude_value[63]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[64] == 194, + "incorrect value for last_msg.msg.specan.amplitude_value[64], expected " + "194, is %d", + last_msg.msg.specan.amplitude_value[64]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[65] == 23, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[65], expected 23, is %d", + last_msg.msg.specan.amplitude_value[65]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[66] == 31, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[66], expected 31, is %d", + last_msg.msg.specan.amplitude_value[66]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[67] == 226, + "incorrect value for last_msg.msg.specan.amplitude_value[67], expected " + "226, is %d", + last_msg.msg.specan.amplitude_value[67]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[68] == 217, + "incorrect value for last_msg.msg.specan.amplitude_value[68], expected " + "217, is %d", + last_msg.msg.specan.amplitude_value[68]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[69] == 157, + "incorrect value for last_msg.msg.specan.amplitude_value[69], expected " + "157, is %d", + last_msg.msg.specan.amplitude_value[69]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[70] == 205, + "incorrect value for last_msg.msg.specan.amplitude_value[70], expected " + "205, is %d", + last_msg.msg.specan.amplitude_value[70]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[71] == 221, + "incorrect value for last_msg.msg.specan.amplitude_value[71], expected " + "221, is %d", + last_msg.msg.specan.amplitude_value[71]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[72] == 5, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[72], expected 5, is %d", + last_msg.msg.specan.amplitude_value[72]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[73] == 224, + "incorrect value for last_msg.msg.specan.amplitude_value[73], expected " + "224, is %d", + last_msg.msg.specan.amplitude_value[73]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[74] == 92, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[74], expected 92, is %d", + last_msg.msg.specan.amplitude_value[74]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[75] == 82, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[75], expected 82, is %d", + last_msg.msg.specan.amplitude_value[75]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[76] == 109, + "incorrect value for last_msg.msg.specan.amplitude_value[76], expected " + "109, is %d", + last_msg.msg.specan.amplitude_value[76]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[77] == 223, + "incorrect value for last_msg.msg.specan.amplitude_value[77], expected " + "223, is %d", + last_msg.msg.specan.amplitude_value[77]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[78] == 195, + "incorrect value for last_msg.msg.specan.amplitude_value[78], expected " + "195, is %d", + last_msg.msg.specan.amplitude_value[78]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[79] == 233, + "incorrect value for last_msg.msg.specan.amplitude_value[79], expected " + "233, is %d", + last_msg.msg.specan.amplitude_value[79]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[80] == 165, + "incorrect value for last_msg.msg.specan.amplitude_value[80], expected " + "165, is %d", + last_msg.msg.specan.amplitude_value[80]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[81] == 1, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[81], expected 1, is %d", + last_msg.msg.specan.amplitude_value[81]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[82] == 82, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[82], expected 82, is %d", + last_msg.msg.specan.amplitude_value[82]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[83] == 141, + "incorrect value for last_msg.msg.specan.amplitude_value[83], expected " + "141, is %d", + last_msg.msg.specan.amplitude_value[83]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[84] == 157, + "incorrect value for last_msg.msg.specan.amplitude_value[84], expected " + "157, is %d", + last_msg.msg.specan.amplitude_value[84]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[85] == 177, + "incorrect value for last_msg.msg.specan.amplitude_value[85], expected " + "177, is %d", + last_msg.msg.specan.amplitude_value[85]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[86] == 169, + "incorrect value for last_msg.msg.specan.amplitude_value[86], expected " + "169, is %d", + last_msg.msg.specan.amplitude_value[86]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[87] == 244, + "incorrect value for last_msg.msg.specan.amplitude_value[87], expected " + "244, is %d", + last_msg.msg.specan.amplitude_value[87]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[88] == 131, + "incorrect value for last_msg.msg.specan.amplitude_value[88], expected " + "131, is %d", + last_msg.msg.specan.amplitude_value[88]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[89] == 96, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[89], expected 96, is %d", + last_msg.msg.specan.amplitude_value[89]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[90] == 109, + "incorrect value for last_msg.msg.specan.amplitude_value[90], expected " + "109, is %d", + last_msg.msg.specan.amplitude_value[90]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[91] == 111, + "incorrect value for last_msg.msg.specan.amplitude_value[91], expected " + "111, is %d", + last_msg.msg.specan.amplitude_value[91]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[92] == 253, + "incorrect value for last_msg.msg.specan.amplitude_value[92], expected " + "253, is %d", + last_msg.msg.specan.amplitude_value[92]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[93] == 149, + "incorrect value for last_msg.msg.specan.amplitude_value[93], expected " + "149, is %d", + last_msg.msg.specan.amplitude_value[93]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[94] == 28, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[94], expected 28, is %d", + last_msg.msg.specan.amplitude_value[94]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[95] == 225, + "incorrect value for last_msg.msg.specan.amplitude_value[95], expected " + "225, is %d", + last_msg.msg.specan.amplitude_value[95]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[96] == 225, + "incorrect value for last_msg.msg.specan.amplitude_value[96], expected " + "225, is %d", + last_msg.msg.specan.amplitude_value[96]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[97] == 72, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[97], expected 72, is %d", + last_msg.msg.specan.amplitude_value[97]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[98] == 158, + "incorrect value for last_msg.msg.specan.amplitude_value[98], expected " + "158, is %d", + last_msg.msg.specan.amplitude_value[98]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[99] == 158, + "incorrect value for last_msg.msg.specan.amplitude_value[99], expected " + "158, is %d", + last_msg.msg.specan.amplitude_value[99]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[100] == 210, + "incorrect value for last_msg.msg.specan.amplitude_value[100], " + "expected 210, is %d", + last_msg.msg.specan.amplitude_value[100]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[101] == 196, + "incorrect value for last_msg.msg.specan.amplitude_value[101], " + "expected 196, is %d", + last_msg.msg.specan.amplitude_value[101]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[102] == 206, + "incorrect value for last_msg.msg.specan.amplitude_value[102], " + "expected 206, is %d", + last_msg.msg.specan.amplitude_value[102]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[103] == 70, + "incorrect value for last_msg.msg.specan.amplitude_value[103], " + "expected 70, is %d", + last_msg.msg.specan.amplitude_value[103]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[104] == 63, + "incorrect value for last_msg.msg.specan.amplitude_value[104], " + "expected 63, is %d", + last_msg.msg.specan.amplitude_value[104]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[105] == 225, + "incorrect value for last_msg.msg.specan.amplitude_value[105], " + "expected 225, is %d", + last_msg.msg.specan.amplitude_value[105]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[106] == 184, + "incorrect value for last_msg.msg.specan.amplitude_value[106], " + "expected 184, is %d", + last_msg.msg.specan.amplitude_value[106]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[107] == 150, + "incorrect value for last_msg.msg.specan.amplitude_value[107], " + "expected 150, is %d", + last_msg.msg.specan.amplitude_value[107]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[108] == 174, + "incorrect value for last_msg.msg.specan.amplitude_value[108], " + "expected 174, is %d", + last_msg.msg.specan.amplitude_value[108]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[109] == 240, + "incorrect value for last_msg.msg.specan.amplitude_value[109], " + "expected 240, is %d", + last_msg.msg.specan.amplitude_value[109]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[110] == 45, + "incorrect value for last_msg.msg.specan.amplitude_value[110], " + "expected 45, is %d", + last_msg.msg.specan.amplitude_value[110]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[111] == 146, + "incorrect value for last_msg.msg.specan.amplitude_value[111], " + "expected 146, is %d", + last_msg.msg.specan.amplitude_value[111]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[112] == 59, + "incorrect value for last_msg.msg.specan.amplitude_value[112], " + "expected 59, is %d", + last_msg.msg.specan.amplitude_value[112]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[113] == 82, + "incorrect value for last_msg.msg.specan.amplitude_value[113], " + "expected 82, is %d", + last_msg.msg.specan.amplitude_value[113]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[114] == 194, + "incorrect value for last_msg.msg.specan.amplitude_value[114], " + "expected 194, is %d", + last_msg.msg.specan.amplitude_value[114]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[115] == 4, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[115], expected 4, is %d", + last_msg.msg.specan.amplitude_value[115]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[116] == 179, + "incorrect value for last_msg.msg.specan.amplitude_value[116], " + "expected 179, is %d", + last_msg.msg.specan.amplitude_value[116]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[117] == 148, + "incorrect value for last_msg.msg.specan.amplitude_value[117], " + "expected 148, is %d", + last_msg.msg.specan.amplitude_value[117]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[118] == 66, + "incorrect value for last_msg.msg.specan.amplitude_value[118], " + "expected 66, is %d", + last_msg.msg.specan.amplitude_value[118]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[119] == 254, + "incorrect value for last_msg.msg.specan.amplitude_value[119], " + "expected 254, is %d", + last_msg.msg.specan.amplitude_value[119]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[120] == 115, + "incorrect value for last_msg.msg.specan.amplitude_value[120], " + "expected 115, is %d", + last_msg.msg.specan.amplitude_value[120]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[121] == 77, + "incorrect value for last_msg.msg.specan.amplitude_value[121], " + "expected 77, is %d", + last_msg.msg.specan.amplitude_value[121]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[122] == 30, + "incorrect value for last_msg.msg.specan.amplitude_value[122], " + "expected 30, is %d", + last_msg.msg.specan.amplitude_value[122]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[123] == 46, + "incorrect value for last_msg.msg.specan.amplitude_value[123], " + "expected 46, is %d", + last_msg.msg.specan.amplitude_value[123]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[124] == 4, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[124], expected 4, is %d", + last_msg.msg.specan.amplitude_value[124]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[125] == 204, + "incorrect value for last_msg.msg.specan.amplitude_value[125], " + "expected 204, is %d", + last_msg.msg.specan.amplitude_value[125]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[126] == 37, + "incorrect value for last_msg.msg.specan.amplitude_value[126], " + "expected 37, is %d", + last_msg.msg.specan.amplitude_value[126]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[127] == 200, + "incorrect value for last_msg.msg.specan.amplitude_value[127], " + "expected 200, is %d", + last_msg.msg.specan.amplitude_value[127]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[128] == 121, + "incorrect value for last_msg.msg.specan.amplitude_value[128], " + "expected 121, is %d", + last_msg.msg.specan.amplitude_value[128]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[129] == 18, + "incorrect value for last_msg.msg.specan.amplitude_value[129], " + "expected 18, is %d", + last_msg.msg.specan.amplitude_value[129]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[130] == 17, + "incorrect value for last_msg.msg.specan.amplitude_value[130], " + "expected 17, is %d", + last_msg.msg.specan.amplitude_value[130]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[131] == 171, + "incorrect value for last_msg.msg.specan.amplitude_value[131], " + "expected 171, is %d", + last_msg.msg.specan.amplitude_value[131]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[132] == 102, + "incorrect value for last_msg.msg.specan.amplitude_value[132], " + "expected 102, is %d", + last_msg.msg.specan.amplitude_value[132]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[133] == 163, + "incorrect value for last_msg.msg.specan.amplitude_value[133], " + "expected 163, is %d", + last_msg.msg.specan.amplitude_value[133]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[134] == 175, + "incorrect value for last_msg.msg.specan.amplitude_value[134], " + "expected 175, is %d", + last_msg.msg.specan.amplitude_value[134]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[135] == 50, + "incorrect value for last_msg.msg.specan.amplitude_value[135], " + "expected 50, is %d", + last_msg.msg.specan.amplitude_value[135]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[136] == 66, + "incorrect value for last_msg.msg.specan.amplitude_value[136], " + "expected 66, is %d", + last_msg.msg.specan.amplitude_value[136]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[137] == 101, + "incorrect value for last_msg.msg.specan.amplitude_value[137], " + "expected 101, is %d", + last_msg.msg.specan.amplitude_value[137]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[138] == 69, + "incorrect value for last_msg.msg.specan.amplitude_value[138], " + "expected 69, is %d", + last_msg.msg.specan.amplitude_value[138]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[139] == 13, + "incorrect value for last_msg.msg.specan.amplitude_value[139], " + "expected 13, is %d", + last_msg.msg.specan.amplitude_value[139]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[140] == 223, + "incorrect value for last_msg.msg.specan.amplitude_value[140], " + "expected 223, is %d", + last_msg.msg.specan.amplitude_value[140]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[141] == 172, + "incorrect value for last_msg.msg.specan.amplitude_value[141], " + "expected 172, is %d", + last_msg.msg.specan.amplitude_value[141]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[142] == 160, + "incorrect value for last_msg.msg.specan.amplitude_value[142], " + "expected 160, is %d", + last_msg.msg.specan.amplitude_value[142]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[143] == 233, + "incorrect value for last_msg.msg.specan.amplitude_value[143], " + "expected 233, is %d", + last_msg.msg.specan.amplitude_value[143]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[144] == 220, + "incorrect value for last_msg.msg.specan.amplitude_value[144], " + "expected 220, is %d", + last_msg.msg.specan.amplitude_value[144]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[145] == 101, + "incorrect value for last_msg.msg.specan.amplitude_value[145], " + "expected 101, is %d", + last_msg.msg.specan.amplitude_value[145]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[146] == 237, + "incorrect value for last_msg.msg.specan.amplitude_value[146], " + "expected 237, is %d", + last_msg.msg.specan.amplitude_value[146]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[147] == 156, + "incorrect value for last_msg.msg.specan.amplitude_value[147], " + "expected 156, is %d", + last_msg.msg.specan.amplitude_value[147]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[148] == 62, + "incorrect value for last_msg.msg.specan.amplitude_value[148], " + "expected 62, is %d", + last_msg.msg.specan.amplitude_value[148]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[149] == 117, + "incorrect value for last_msg.msg.specan.amplitude_value[149], " + "expected 117, is %d", + last_msg.msg.specan.amplitude_value[149]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[150] == 47, + "incorrect value for last_msg.msg.specan.amplitude_value[150], " + "expected 47, is %d", + last_msg.msg.specan.amplitude_value[150]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[151] == 143, + "incorrect value for last_msg.msg.specan.amplitude_value[151], " + "expected 143, is %d", + last_msg.msg.specan.amplitude_value[151]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[152] == 94, + "incorrect value for last_msg.msg.specan.amplitude_value[152], " + "expected 94, is %d", + last_msg.msg.specan.amplitude_value[152]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[153] == 135, + "incorrect value for last_msg.msg.specan.amplitude_value[153], " + "expected 135, is %d", + last_msg.msg.specan.amplitude_value[153]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[154] == 22, + "incorrect value for last_msg.msg.specan.amplitude_value[154], " + "expected 22, is %d", + last_msg.msg.specan.amplitude_value[154]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[155] == 155, + "incorrect value for last_msg.msg.specan.amplitude_value[155], " + "expected 155, is %d", + last_msg.msg.specan.amplitude_value[155]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[156] == 113, + "incorrect value for last_msg.msg.specan.amplitude_value[156], " + "expected 113, is %d", + last_msg.msg.specan.amplitude_value[156]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[157] == 110, + "incorrect value for last_msg.msg.specan.amplitude_value[157], " + "expected 110, is %d", + last_msg.msg.specan.amplitude_value[157]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[158] == 15, + "incorrect value for last_msg.msg.specan.amplitude_value[158], " + "expected 15, is %d", + last_msg.msg.specan.amplitude_value[158]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[159] == 243, + "incorrect value for last_msg.msg.specan.amplitude_value[159], " + "expected 243, is %d", + last_msg.msg.specan.amplitude_value[159]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[160] == 141, + "incorrect value for last_msg.msg.specan.amplitude_value[160], " + "expected 141, is %d", + last_msg.msg.specan.amplitude_value[160]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[161] == 227, + "incorrect value for last_msg.msg.specan.amplitude_value[161], " + "expected 227, is %d", + last_msg.msg.specan.amplitude_value[161]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[162] == 46, + "incorrect value for last_msg.msg.specan.amplitude_value[162], " + "expected 46, is %d", + last_msg.msg.specan.amplitude_value[162]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[163] == 143, + "incorrect value for last_msg.msg.specan.amplitude_value[163], " + "expected 143, is %d", + last_msg.msg.specan.amplitude_value[163]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[164] == 227, + "incorrect value for last_msg.msg.specan.amplitude_value[164], " + "expected 227, is %d", + last_msg.msg.specan.amplitude_value[164]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[165] == 209, + "incorrect value for last_msg.msg.specan.amplitude_value[165], " + "expected 209, is %d", + last_msg.msg.specan.amplitude_value[165]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[166] == 249, + "incorrect value for last_msg.msg.specan.amplitude_value[166], " + "expected 249, is %d", + last_msg.msg.specan.amplitude_value[166]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[167] == 2, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[167], expected 2, is %d", + last_msg.msg.specan.amplitude_value[167]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[168] == 153, + "incorrect value for last_msg.msg.specan.amplitude_value[168], " + "expected 153, is %d", + last_msg.msg.specan.amplitude_value[168]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[169] == 168, + "incorrect value for last_msg.msg.specan.amplitude_value[169], " + "expected 168, is %d", + last_msg.msg.specan.amplitude_value[169]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[170] == 131, + "incorrect value for last_msg.msg.specan.amplitude_value[170], " + "expected 131, is %d", + last_msg.msg.specan.amplitude_value[170]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[171] == 249, + "incorrect value for last_msg.msg.specan.amplitude_value[171], " + "expected 249, is %d", + last_msg.msg.specan.amplitude_value[171]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[172] == 160, + "incorrect value for last_msg.msg.specan.amplitude_value[172], " + "expected 160, is %d", + last_msg.msg.specan.amplitude_value[172]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[173] == 88, + "incorrect value for last_msg.msg.specan.amplitude_value[173], " + "expected 88, is %d", + last_msg.msg.specan.amplitude_value[173]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[174] == 38, + "incorrect value for last_msg.msg.specan.amplitude_value[174], " + "expected 38, is %d", + last_msg.msg.specan.amplitude_value[174]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[175] == 117, + "incorrect value for last_msg.msg.specan.amplitude_value[175], " + "expected 117, is %d", + last_msg.msg.specan.amplitude_value[175]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[176] == 129, + "incorrect value for last_msg.msg.specan.amplitude_value[176], " + "expected 129, is %d", + last_msg.msg.specan.amplitude_value[176]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[177] == 57, + "incorrect value for last_msg.msg.specan.amplitude_value[177], " + "expected 57, is %d", + last_msg.msg.specan.amplitude_value[177]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[178] == 40, + "incorrect value for last_msg.msg.specan.amplitude_value[178], " + "expected 40, is %d", + last_msg.msg.specan.amplitude_value[178]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[179] == 109, + "incorrect value for last_msg.msg.specan.amplitude_value[179], " + "expected 109, is %d", + last_msg.msg.specan.amplitude_value[179]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[180] == 209, + "incorrect value for last_msg.msg.specan.amplitude_value[180], " + "expected 209, is %d", + last_msg.msg.specan.amplitude_value[180]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[181] == 177, + "incorrect value for last_msg.msg.specan.amplitude_value[181], " + "expected 177, is %d", + last_msg.msg.specan.amplitude_value[181]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[182] == 38, + "incorrect value for last_msg.msg.specan.amplitude_value[182], " + "expected 38, is %d", + last_msg.msg.specan.amplitude_value[182]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[183] == 47, + "incorrect value for last_msg.msg.specan.amplitude_value[183], " + "expected 47, is %d", + last_msg.msg.specan.amplitude_value[183]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[184] == 12, + "incorrect value for last_msg.msg.specan.amplitude_value[184], " + "expected 12, is %d", + last_msg.msg.specan.amplitude_value[184]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[185] == 15, + "incorrect value for last_msg.msg.specan.amplitude_value[185], " + "expected 15, is %d", + last_msg.msg.specan.amplitude_value[185]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[186] == 16, + "incorrect value for last_msg.msg.specan.amplitude_value[186], " + "expected 16, is %d", + last_msg.msg.specan.amplitude_value[186]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[187] == 9, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[187], expected 9, is %d", + last_msg.msg.specan.amplitude_value[187]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[188] == 175, + "incorrect value for last_msg.msg.specan.amplitude_value[188], " + "expected 175, is %d", + last_msg.msg.specan.amplitude_value[188]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[189] == 69, + "incorrect value for last_msg.msg.specan.amplitude_value[189], " + "expected 69, is %d", + last_msg.msg.specan.amplitude_value[189]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[190] == 70, + "incorrect value for last_msg.msg.specan.amplitude_value[190], " + "expected 70, is %d", + last_msg.msg.specan.amplitude_value[190]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[191] == 182, + "incorrect value for last_msg.msg.specan.amplitude_value[191], " + "expected 182, is %d", + last_msg.msg.specan.amplitude_value[191]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[192] == 239, + "incorrect value for last_msg.msg.specan.amplitude_value[192], " + "expected 239, is %d", + last_msg.msg.specan.amplitude_value[192]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[193] == 117, + "incorrect value for last_msg.msg.specan.amplitude_value[193], " + "expected 117, is %d", + last_msg.msg.specan.amplitude_value[193]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[194] == 135, + "incorrect value for last_msg.msg.specan.amplitude_value[194], " + "expected 135, is %d", + last_msg.msg.specan.amplitude_value[194]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[195] == 6, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[195], expected 6, is %d", + last_msg.msg.specan.amplitude_value[195]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[196] == 71, + "incorrect value for last_msg.msg.specan.amplitude_value[196], " + "expected 71, is %d", + last_msg.msg.specan.amplitude_value[196]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[197] == 99, + "incorrect value for last_msg.msg.specan.amplitude_value[197], " + "expected 99, is %d", + last_msg.msg.specan.amplitude_value[197]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[198] == 230, + "incorrect value for last_msg.msg.specan.amplitude_value[198], " + "expected 230, is %d", + last_msg.msg.specan.amplitude_value[198]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[199] == 115, + "incorrect value for last_msg.msg.specan.amplitude_value[199], " + "expected 115, is %d", + last_msg.msg.specan.amplitude_value[199]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[200] == 2, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[200], expected 2, is %d", + last_msg.msg.specan.amplitude_value[200]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[201] == 71, + "incorrect value for last_msg.msg.specan.amplitude_value[201], " + "expected 71, is %d", + last_msg.msg.specan.amplitude_value[201]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[202] == 165, + "incorrect value for last_msg.msg.specan.amplitude_value[202], " + "expected 165, is %d", + last_msg.msg.specan.amplitude_value[202]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[203] == 228, + "incorrect value for last_msg.msg.specan.amplitude_value[203], " + "expected 228, is %d", + last_msg.msg.specan.amplitude_value[203]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[204] == 123, + "incorrect value for last_msg.msg.specan.amplitude_value[204], " + "expected 123, is %d", + last_msg.msg.specan.amplitude_value[204]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[205] == 210, + "incorrect value for last_msg.msg.specan.amplitude_value[205], " + "expected 210, is %d", + last_msg.msg.specan.amplitude_value[205]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[206] == 168, + "incorrect value for last_msg.msg.specan.amplitude_value[206], " + "expected 168, is %d", + last_msg.msg.specan.amplitude_value[206]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[207] == 90, + "incorrect value for last_msg.msg.specan.amplitude_value[207], " + "expected 90, is %d", + last_msg.msg.specan.amplitude_value[207]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[208] == 124, + "incorrect value for last_msg.msg.specan.amplitude_value[208], " + "expected 124, is %d", + last_msg.msg.specan.amplitude_value[208]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[209] == 20, + "incorrect value for last_msg.msg.specan.amplitude_value[209], " + "expected 20, is %d", + last_msg.msg.specan.amplitude_value[209]); + ck_assert_msg(last_msg.msg.specan.amplitude_value[210] == 7, + "incorrect value for " + "last_msg.msg.specan.amplitude_value[210], expected 7, is %d", + last_msg.msg.specan.amplitude_value[210]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[211] == 220, + "incorrect value for last_msg.msg.specan.amplitude_value[211], " + "expected 220, is %d", + last_msg.msg.specan.amplitude_value[211]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[212] == 144, + "incorrect value for last_msg.msg.specan.amplitude_value[212], " + "expected 144, is %d", + last_msg.msg.specan.amplitude_value[212]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[213] == 168, + "incorrect value for last_msg.msg.specan.amplitude_value[213], " + "expected 168, is %d", + last_msg.msg.specan.amplitude_value[213]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[214] == 69, + "incorrect value for last_msg.msg.specan.amplitude_value[214], " + "expected 69, is %d", + last_msg.msg.specan.amplitude_value[214]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[215] == 22, + "incorrect value for last_msg.msg.specan.amplitude_value[215], " + "expected 22, is %d", + last_msg.msg.specan.amplitude_value[215]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[216] == 72, + "incorrect value for last_msg.msg.specan.amplitude_value[216], " + "expected 72, is %d", + last_msg.msg.specan.amplitude_value[216]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[217] == 162, + "incorrect value for last_msg.msg.specan.amplitude_value[217], " + "expected 162, is %d", + last_msg.msg.specan.amplitude_value[217]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[218] == 69, + "incorrect value for last_msg.msg.specan.amplitude_value[218], " + "expected 69, is %d", + last_msg.msg.specan.amplitude_value[218]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[219] == 111, + "incorrect value for last_msg.msg.specan.amplitude_value[219], " + "expected 111, is %d", + last_msg.msg.specan.amplitude_value[219]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[220] == 91, + "incorrect value for last_msg.msg.specan.amplitude_value[220], " + "expected 91, is %d", + last_msg.msg.specan.amplitude_value[220]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[221] == 251, + "incorrect value for last_msg.msg.specan.amplitude_value[221], " + "expected 251, is %d", + last_msg.msg.specan.amplitude_value[221]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[222] == 72, + "incorrect value for last_msg.msg.specan.amplitude_value[222], " + "expected 72, is %d", + last_msg.msg.specan.amplitude_value[222]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[223] == 220, + "incorrect value for last_msg.msg.specan.amplitude_value[223], " + "expected 220, is %d", + last_msg.msg.specan.amplitude_value[223]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[224] == 28, + "incorrect value for last_msg.msg.specan.amplitude_value[224], " + "expected 28, is %d", + last_msg.msg.specan.amplitude_value[224]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[225] == 119, + "incorrect value for last_msg.msg.specan.amplitude_value[225], " + "expected 119, is %d", + last_msg.msg.specan.amplitude_value[225]); + ck_assert_msg( + last_msg.msg.specan.amplitude_value[226] == 150, + "incorrect value for last_msg.msg.specan.amplitude_value[226], " + "expected 150, is %d", + last_msg.msg.specan.amplitude_value[226]); + + ck_assert_msg(last_msg.msg.specan.channel_tag == 35146, + "incorrect value for last_msg.msg.specan.channel_tag, " + "expected 35146, is %d", + last_msg.msg.specan.channel_tag); + + ck_assert_msg( + (last_msg.msg.specan.freq_ref * 100 - 7737.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.specan.freq_ref, expected " + "7737.20019531, is %s", + last_msg.msg.specan.freq_ref); + + ck_assert_msg( + (last_msg.msg.specan.freq_step * 100 - 8226.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.specan.freq_step, expected " + "8226.20019531, is %s", + last_msg.msg.specan.freq_step); + + ck_assert_msg(last_msg.msg.specan.n_amplitude_value == 227, + "incorrect value for last_msg.msg.specan.n_amplitude_value, " + "expected 227, is %d", + last_msg.msg.specan.n_amplitude_value); + + ck_assert_msg(last_msg.msg.specan.t.ns_residual == -1479025396, + "incorrect value for last_msg.msg.specan.t.ns_residual, " + "expected -1479025396, is %d", + last_msg.msg.specan.t.ns_residual); + + ck_assert_msg(last_msg.msg.specan.t.tow == 1227027783, + "incorrect value for last_msg.msg.specan.t.tow, expected " + "1227027783, is %d", + last_msg.msg.specan.t.tow); + ck_assert_msg( + last_msg.msg.specan.t.wn == 5075, + "incorrect value for last_msg.msg.specan.t.wn, expected 5075, is %d", + last_msg.msg.specan.t.wn); } } END_TEST -Suite* auto_check_sbp_piksi_MsgSpecan_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgSpecan"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgSpecan"); +Suite *auto_check_sbp_piksi_MsgSpecan_suite(void) { + Suite *s = + suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgSpecan"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgSpecan"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgSpecan); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgSpecanDep.c b/c/test/auto_check_sbp_piksi_MsgSpecanDep.c index 93670af7e..0387da025 100644 --- a/c/test/auto_check_sbp_piksi_MsgSpecanDep.c +++ b/c/test/auto_check_sbp_piksi_MsgSpecanDep.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecanDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecanDep.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgSpecanDep ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgSpecanDep) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgSpecanDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,772 +90,1747 @@ START_TEST( test_auto_check_sbp_piksi_MsgSpecanDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x50, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x50, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,80,0,112,217,255,246,22,221,56,37,59,45,27,154,97,198,69,154,1,144,69,205,20,18,70,51,211,89,69,240,14,179,186,227,244,173,240,182,71,166,117,196,13,44,27,33,28,67,254,3,249,92,44,122,169,77,186,68,135,63,168,162,89,36,186,99,63,105,116,216,44,67,212,156,75,81,53,250,225,23,205,26,34,119,50,101,64,7,231,124,183,203,102,234,84,83,208,23,68,54,179,98,96,116,244,246,94,104,94,13,56,210,18,191,22,133,81,153,159,161,219,59,21,164,121,145,203,171,132,57,180,102,101,11,229,175,145,73,72,124,4,184,228,61,234,218,62,226,217,193,7,109,44,83,201,20,101,9,140,186,162,81,91,30,231,161,81,216,114,60,231,163,163,49,237,244,185,240,89,143,174,165,211,241,13,16,61,141,101,89,37,117,189,86,118,176,228,12,14,119,135,129,243,50,29,207,198,117,100,225,6,139,110,39,210,68,199,43,132,64,17,51,173,181,12,140,16,247,84,183,105,39,157,77,30,205,194,59,64,241,183,238,105,181,170,45,8,166,164,238,83,148,173,108,228,67,89,189,67,26,39,216, }; + u8 encoded_frame[] = { + 85, 80, 0, 112, 217, 255, 246, 22, 221, 56, 37, 59, 45, 27, + 154, 97, 198, 69, 154, 1, 144, 69, 205, 20, 18, 70, 51, 211, + 89, 69, 240, 14, 179, 186, 227, 244, 173, 240, 182, 71, 166, 117, + 196, 13, 44, 27, 33, 28, 67, 254, 3, 249, 92, 44, 122, 169, + 77, 186, 68, 135, 63, 168, 162, 89, 36, 186, 99, 63, 105, 116, + 216, 44, 67, 212, 156, 75, 81, 53, 250, 225, 23, 205, 26, 34, + 119, 50, 101, 64, 7, 231, 124, 183, 203, 102, 234, 84, 83, 208, + 23, 68, 54, 179, 98, 96, 116, 244, 246, 94, 104, 94, 13, 56, + 210, 18, 191, 22, 133, 81, 153, 159, 161, 219, 59, 21, 164, 121, + 145, 203, 171, 132, 57, 180, 102, 101, 11, 229, 175, 145, 73, 72, + 124, 4, 184, 228, 61, 234, 218, 62, 226, 217, 193, 7, 109, 44, + 83, 201, 20, 101, 9, 140, 186, 162, 81, 91, 30, 231, 161, 81, + 216, 114, 60, 231, 163, 163, 49, 237, 244, 185, 240, 89, 143, 174, + 165, 211, 241, 13, 16, 61, 141, 101, 89, 37, 117, 189, 86, 118, + 176, 228, 12, 14, 119, 135, 129, 243, 50, 29, 207, 198, 117, 100, + 225, 6, 139, 110, 39, 210, 68, 199, 43, 132, 64, 17, 51, 173, + 181, 12, 140, 16, 247, 84, 183, 105, 39, 157, 77, 30, 205, 194, + 59, 64, 241, 183, 238, 105, 181, 170, 45, 8, 166, 164, 238, 83, + 148, 173, 108, 228, 67, 89, 189, 67, 26, 39, 216, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.specan_dep.amplitude_ref = 9349.2001953125; - + test_msg.specan_dep.amplitude_unit = 3485.199951171875; - - + test_msg.specan_dep.amplitude_value[0] = 240; - + test_msg.specan_dep.amplitude_value[1] = 14; - + test_msg.specan_dep.amplitude_value[2] = 179; - + test_msg.specan_dep.amplitude_value[3] = 186; - + test_msg.specan_dep.amplitude_value[4] = 227; - + test_msg.specan_dep.amplitude_value[5] = 244; - + test_msg.specan_dep.amplitude_value[6] = 173; - + test_msg.specan_dep.amplitude_value[7] = 240; - + test_msg.specan_dep.amplitude_value[8] = 182; - + test_msg.specan_dep.amplitude_value[9] = 71; - + test_msg.specan_dep.amplitude_value[10] = 166; - + test_msg.specan_dep.amplitude_value[11] = 117; - + test_msg.specan_dep.amplitude_value[12] = 196; - + test_msg.specan_dep.amplitude_value[13] = 13; - + test_msg.specan_dep.amplitude_value[14] = 44; - + test_msg.specan_dep.amplitude_value[15] = 27; - + test_msg.specan_dep.amplitude_value[16] = 33; - + test_msg.specan_dep.amplitude_value[17] = 28; - + test_msg.specan_dep.amplitude_value[18] = 67; - + test_msg.specan_dep.amplitude_value[19] = 254; - + test_msg.specan_dep.amplitude_value[20] = 3; - + test_msg.specan_dep.amplitude_value[21] = 249; - + test_msg.specan_dep.amplitude_value[22] = 92; - + test_msg.specan_dep.amplitude_value[23] = 44; - + test_msg.specan_dep.amplitude_value[24] = 122; - + test_msg.specan_dep.amplitude_value[25] = 169; - + test_msg.specan_dep.amplitude_value[26] = 77; - + test_msg.specan_dep.amplitude_value[27] = 186; - + test_msg.specan_dep.amplitude_value[28] = 68; - + test_msg.specan_dep.amplitude_value[29] = 135; - + test_msg.specan_dep.amplitude_value[30] = 63; - + test_msg.specan_dep.amplitude_value[31] = 168; - + test_msg.specan_dep.amplitude_value[32] = 162; - + test_msg.specan_dep.amplitude_value[33] = 89; - + test_msg.specan_dep.amplitude_value[34] = 36; - + test_msg.specan_dep.amplitude_value[35] = 186; - + test_msg.specan_dep.amplitude_value[36] = 99; - + test_msg.specan_dep.amplitude_value[37] = 63; - + test_msg.specan_dep.amplitude_value[38] = 105; - + test_msg.specan_dep.amplitude_value[39] = 116; - + test_msg.specan_dep.amplitude_value[40] = 216; - + test_msg.specan_dep.amplitude_value[41] = 44; - + test_msg.specan_dep.amplitude_value[42] = 67; - + test_msg.specan_dep.amplitude_value[43] = 212; - + test_msg.specan_dep.amplitude_value[44] = 156; - + test_msg.specan_dep.amplitude_value[45] = 75; - + test_msg.specan_dep.amplitude_value[46] = 81; - + test_msg.specan_dep.amplitude_value[47] = 53; - + test_msg.specan_dep.amplitude_value[48] = 250; - + test_msg.specan_dep.amplitude_value[49] = 225; - + test_msg.specan_dep.amplitude_value[50] = 23; - + test_msg.specan_dep.amplitude_value[51] = 205; - + test_msg.specan_dep.amplitude_value[52] = 26; - + test_msg.specan_dep.amplitude_value[53] = 34; - + test_msg.specan_dep.amplitude_value[54] = 119; - + test_msg.specan_dep.amplitude_value[55] = 50; - + test_msg.specan_dep.amplitude_value[56] = 101; - + test_msg.specan_dep.amplitude_value[57] = 64; - + test_msg.specan_dep.amplitude_value[58] = 7; - + test_msg.specan_dep.amplitude_value[59] = 231; - + test_msg.specan_dep.amplitude_value[60] = 124; - + test_msg.specan_dep.amplitude_value[61] = 183; - + test_msg.specan_dep.amplitude_value[62] = 203; - + test_msg.specan_dep.amplitude_value[63] = 102; - + test_msg.specan_dep.amplitude_value[64] = 234; - + test_msg.specan_dep.amplitude_value[65] = 84; - + test_msg.specan_dep.amplitude_value[66] = 83; - + test_msg.specan_dep.amplitude_value[67] = 208; - + test_msg.specan_dep.amplitude_value[68] = 23; - + test_msg.specan_dep.amplitude_value[69] = 68; - + test_msg.specan_dep.amplitude_value[70] = 54; - + test_msg.specan_dep.amplitude_value[71] = 179; - + test_msg.specan_dep.amplitude_value[72] = 98; - + test_msg.specan_dep.amplitude_value[73] = 96; - + test_msg.specan_dep.amplitude_value[74] = 116; - + test_msg.specan_dep.amplitude_value[75] = 244; - + test_msg.specan_dep.amplitude_value[76] = 246; - + test_msg.specan_dep.amplitude_value[77] = 94; - + test_msg.specan_dep.amplitude_value[78] = 104; - + test_msg.specan_dep.amplitude_value[79] = 94; - + test_msg.specan_dep.amplitude_value[80] = 13; - + test_msg.specan_dep.amplitude_value[81] = 56; - + test_msg.specan_dep.amplitude_value[82] = 210; - + test_msg.specan_dep.amplitude_value[83] = 18; - + test_msg.specan_dep.amplitude_value[84] = 191; - + test_msg.specan_dep.amplitude_value[85] = 22; - + test_msg.specan_dep.amplitude_value[86] = 133; - + test_msg.specan_dep.amplitude_value[87] = 81; - + test_msg.specan_dep.amplitude_value[88] = 153; - + test_msg.specan_dep.amplitude_value[89] = 159; - + test_msg.specan_dep.amplitude_value[90] = 161; - + test_msg.specan_dep.amplitude_value[91] = 219; - + test_msg.specan_dep.amplitude_value[92] = 59; - + test_msg.specan_dep.amplitude_value[93] = 21; - + test_msg.specan_dep.amplitude_value[94] = 164; - + test_msg.specan_dep.amplitude_value[95] = 121; - + test_msg.specan_dep.amplitude_value[96] = 145; - + test_msg.specan_dep.amplitude_value[97] = 203; - + test_msg.specan_dep.amplitude_value[98] = 171; - + test_msg.specan_dep.amplitude_value[99] = 132; - + test_msg.specan_dep.amplitude_value[100] = 57; - + test_msg.specan_dep.amplitude_value[101] = 180; - + test_msg.specan_dep.amplitude_value[102] = 102; - + test_msg.specan_dep.amplitude_value[103] = 101; - + test_msg.specan_dep.amplitude_value[104] = 11; - + test_msg.specan_dep.amplitude_value[105] = 229; - + test_msg.specan_dep.amplitude_value[106] = 175; - + test_msg.specan_dep.amplitude_value[107] = 145; - + test_msg.specan_dep.amplitude_value[108] = 73; - + test_msg.specan_dep.amplitude_value[109] = 72; - + test_msg.specan_dep.amplitude_value[110] = 124; - + test_msg.specan_dep.amplitude_value[111] = 4; - + test_msg.specan_dep.amplitude_value[112] = 184; - + test_msg.specan_dep.amplitude_value[113] = 228; - + test_msg.specan_dep.amplitude_value[114] = 61; - + test_msg.specan_dep.amplitude_value[115] = 234; - + test_msg.specan_dep.amplitude_value[116] = 218; - + test_msg.specan_dep.amplitude_value[117] = 62; - + test_msg.specan_dep.amplitude_value[118] = 226; - + test_msg.specan_dep.amplitude_value[119] = 217; - + test_msg.specan_dep.amplitude_value[120] = 193; - + test_msg.specan_dep.amplitude_value[121] = 7; - + test_msg.specan_dep.amplitude_value[122] = 109; - + test_msg.specan_dep.amplitude_value[123] = 44; - + test_msg.specan_dep.amplitude_value[124] = 83; - + test_msg.specan_dep.amplitude_value[125] = 201; - + test_msg.specan_dep.amplitude_value[126] = 20; - + test_msg.specan_dep.amplitude_value[127] = 101; - + test_msg.specan_dep.amplitude_value[128] = 9; - + test_msg.specan_dep.amplitude_value[129] = 140; - + test_msg.specan_dep.amplitude_value[130] = 186; - + test_msg.specan_dep.amplitude_value[131] = 162; - + test_msg.specan_dep.amplitude_value[132] = 81; - + test_msg.specan_dep.amplitude_value[133] = 91; - + test_msg.specan_dep.amplitude_value[134] = 30; - + test_msg.specan_dep.amplitude_value[135] = 231; - + test_msg.specan_dep.amplitude_value[136] = 161; - + test_msg.specan_dep.amplitude_value[137] = 81; - + test_msg.specan_dep.amplitude_value[138] = 216; - + test_msg.specan_dep.amplitude_value[139] = 114; - + test_msg.specan_dep.amplitude_value[140] = 60; - + test_msg.specan_dep.amplitude_value[141] = 231; - + test_msg.specan_dep.amplitude_value[142] = 163; - + test_msg.specan_dep.amplitude_value[143] = 163; - + test_msg.specan_dep.amplitude_value[144] = 49; - + test_msg.specan_dep.amplitude_value[145] = 237; - + test_msg.specan_dep.amplitude_value[146] = 244; - + test_msg.specan_dep.amplitude_value[147] = 185; - + test_msg.specan_dep.amplitude_value[148] = 240; - + test_msg.specan_dep.amplitude_value[149] = 89; - + test_msg.specan_dep.amplitude_value[150] = 143; - + test_msg.specan_dep.amplitude_value[151] = 174; - + test_msg.specan_dep.amplitude_value[152] = 165; - + test_msg.specan_dep.amplitude_value[153] = 211; - + test_msg.specan_dep.amplitude_value[154] = 241; - + test_msg.specan_dep.amplitude_value[155] = 13; - + test_msg.specan_dep.amplitude_value[156] = 16; - + test_msg.specan_dep.amplitude_value[157] = 61; - + test_msg.specan_dep.amplitude_value[158] = 141; - + test_msg.specan_dep.amplitude_value[159] = 101; - + test_msg.specan_dep.amplitude_value[160] = 89; - + test_msg.specan_dep.amplitude_value[161] = 37; - + test_msg.specan_dep.amplitude_value[162] = 117; - + test_msg.specan_dep.amplitude_value[163] = 189; - + test_msg.specan_dep.amplitude_value[164] = 86; - + test_msg.specan_dep.amplitude_value[165] = 118; - + test_msg.specan_dep.amplitude_value[166] = 176; - + test_msg.specan_dep.amplitude_value[167] = 228; - + test_msg.specan_dep.amplitude_value[168] = 12; - + test_msg.specan_dep.amplitude_value[169] = 14; - + test_msg.specan_dep.amplitude_value[170] = 119; - + test_msg.specan_dep.amplitude_value[171] = 135; - + test_msg.specan_dep.amplitude_value[172] = 129; - + test_msg.specan_dep.amplitude_value[173] = 243; - + test_msg.specan_dep.amplitude_value[174] = 50; - + test_msg.specan_dep.amplitude_value[175] = 29; - + test_msg.specan_dep.amplitude_value[176] = 207; - + test_msg.specan_dep.amplitude_value[177] = 198; - + test_msg.specan_dep.amplitude_value[178] = 117; - + test_msg.specan_dep.amplitude_value[179] = 100; - + test_msg.specan_dep.amplitude_value[180] = 225; - + test_msg.specan_dep.amplitude_value[181] = 6; - + test_msg.specan_dep.amplitude_value[182] = 139; - + test_msg.specan_dep.amplitude_value[183] = 110; - + test_msg.specan_dep.amplitude_value[184] = 39; - + test_msg.specan_dep.amplitude_value[185] = 210; - + test_msg.specan_dep.amplitude_value[186] = 68; - + test_msg.specan_dep.amplitude_value[187] = 199; - + test_msg.specan_dep.amplitude_value[188] = 43; - + test_msg.specan_dep.amplitude_value[189] = 132; - + test_msg.specan_dep.amplitude_value[190] = 64; - + test_msg.specan_dep.amplitude_value[191] = 17; - + test_msg.specan_dep.amplitude_value[192] = 51; - + test_msg.specan_dep.amplitude_value[193] = 173; - + test_msg.specan_dep.amplitude_value[194] = 181; - + test_msg.specan_dep.amplitude_value[195] = 12; - + test_msg.specan_dep.amplitude_value[196] = 140; - + test_msg.specan_dep.amplitude_value[197] = 16; - + test_msg.specan_dep.amplitude_value[198] = 247; - + test_msg.specan_dep.amplitude_value[199] = 84; - + test_msg.specan_dep.amplitude_value[200] = 183; - + test_msg.specan_dep.amplitude_value[201] = 105; - + test_msg.specan_dep.amplitude_value[202] = 39; - + test_msg.specan_dep.amplitude_value[203] = 157; - + test_msg.specan_dep.amplitude_value[204] = 77; - + test_msg.specan_dep.amplitude_value[205] = 30; - + test_msg.specan_dep.amplitude_value[206] = 205; - + test_msg.specan_dep.amplitude_value[207] = 194; - + test_msg.specan_dep.amplitude_value[208] = 59; - + test_msg.specan_dep.amplitude_value[209] = 64; - + test_msg.specan_dep.amplitude_value[210] = 241; - + test_msg.specan_dep.amplitude_value[211] = 183; - + test_msg.specan_dep.amplitude_value[212] = 238; - + test_msg.specan_dep.amplitude_value[213] = 105; - + test_msg.specan_dep.amplitude_value[214] = 181; - + test_msg.specan_dep.amplitude_value[215] = 170; - + test_msg.specan_dep.amplitude_value[216] = 45; - + test_msg.specan_dep.amplitude_value[217] = 8; - + test_msg.specan_dep.amplitude_value[218] = 166; - + test_msg.specan_dep.amplitude_value[219] = 164; - + test_msg.specan_dep.amplitude_value[220] = 238; - + test_msg.specan_dep.amplitude_value[221] = 83; - + test_msg.specan_dep.amplitude_value[222] = 148; - + test_msg.specan_dep.amplitude_value[223] = 173; - + test_msg.specan_dep.amplitude_value[224] = 108; - + test_msg.specan_dep.amplitude_value[225] = 228; - + test_msg.specan_dep.amplitude_value[226] = 67; - + test_msg.specan_dep.amplitude_value[227] = 89; - + test_msg.specan_dep.amplitude_value[228] = 189; - + test_msg.specan_dep.amplitude_value[229] = 67; - + test_msg.specan_dep.amplitude_value[230] = 26; - + test_msg.specan_dep.channel_tag = 5878; - + test_msg.specan_dep.freq_ref = 6348.2001953125; - + test_msg.specan_dep.freq_step = 4608.2001953125; - + test_msg.specan_dep.n_amplitude_value = 231; - - + test_msg.specan_dep.t.tow = 992295133; - + test_msg.specan_dep.t.wn = 6957; - sbp_message_send(&sbp_state, SbpMsgSpecanDep, 55664, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSpecanDep, 55664, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55664, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSpecanDep, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSpecanDep, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg((last_msg.msg.specan_dep.amplitude_ref * 100 - 9349.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.specan_dep.amplitude_ref, expected 9349.20019531, is %s", last_msg.msg.specan_dep.amplitude_ref); - - ck_assert_msg((last_msg.msg.specan_dep.amplitude_unit * 100 - 3485.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.specan_dep.amplitude_unit, expected 3485.19995117, is %s", last_msg.msg.specan_dep.amplitude_unit); - - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[0] == 240, "incorrect value for last_msg.msg.specan_dep.amplitude_value[0], expected 240, is %d", last_msg.msg.specan_dep.amplitude_value[0]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[1] == 14, "incorrect value for last_msg.msg.specan_dep.amplitude_value[1], expected 14, is %d", last_msg.msg.specan_dep.amplitude_value[1]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[2] == 179, "incorrect value for last_msg.msg.specan_dep.amplitude_value[2], expected 179, is %d", last_msg.msg.specan_dep.amplitude_value[2]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[3] == 186, "incorrect value for last_msg.msg.specan_dep.amplitude_value[3], expected 186, is %d", last_msg.msg.specan_dep.amplitude_value[3]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[4] == 227, "incorrect value for last_msg.msg.specan_dep.amplitude_value[4], expected 227, is %d", last_msg.msg.specan_dep.amplitude_value[4]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[5] == 244, "incorrect value for last_msg.msg.specan_dep.amplitude_value[5], expected 244, is %d", last_msg.msg.specan_dep.amplitude_value[5]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[6] == 173, "incorrect value for last_msg.msg.specan_dep.amplitude_value[6], expected 173, is %d", last_msg.msg.specan_dep.amplitude_value[6]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[7] == 240, "incorrect value for last_msg.msg.specan_dep.amplitude_value[7], expected 240, is %d", last_msg.msg.specan_dep.amplitude_value[7]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[8] == 182, "incorrect value for last_msg.msg.specan_dep.amplitude_value[8], expected 182, is %d", last_msg.msg.specan_dep.amplitude_value[8]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[9] == 71, "incorrect value for last_msg.msg.specan_dep.amplitude_value[9], expected 71, is %d", last_msg.msg.specan_dep.amplitude_value[9]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[10] == 166, "incorrect value for last_msg.msg.specan_dep.amplitude_value[10], expected 166, is %d", last_msg.msg.specan_dep.amplitude_value[10]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[11] == 117, "incorrect value for last_msg.msg.specan_dep.amplitude_value[11], expected 117, is %d", last_msg.msg.specan_dep.amplitude_value[11]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[12] == 196, "incorrect value for last_msg.msg.specan_dep.amplitude_value[12], expected 196, is %d", last_msg.msg.specan_dep.amplitude_value[12]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[13] == 13, "incorrect value for last_msg.msg.specan_dep.amplitude_value[13], expected 13, is %d", last_msg.msg.specan_dep.amplitude_value[13]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[14] == 44, "incorrect value for last_msg.msg.specan_dep.amplitude_value[14], expected 44, is %d", last_msg.msg.specan_dep.amplitude_value[14]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[15] == 27, "incorrect value for last_msg.msg.specan_dep.amplitude_value[15], expected 27, is %d", last_msg.msg.specan_dep.amplitude_value[15]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[16] == 33, "incorrect value for last_msg.msg.specan_dep.amplitude_value[16], expected 33, is %d", last_msg.msg.specan_dep.amplitude_value[16]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[17] == 28, "incorrect value for last_msg.msg.specan_dep.amplitude_value[17], expected 28, is %d", last_msg.msg.specan_dep.amplitude_value[17]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[18] == 67, "incorrect value for last_msg.msg.specan_dep.amplitude_value[18], expected 67, is %d", last_msg.msg.specan_dep.amplitude_value[18]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[19] == 254, "incorrect value for last_msg.msg.specan_dep.amplitude_value[19], expected 254, is %d", last_msg.msg.specan_dep.amplitude_value[19]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[20] == 3, "incorrect value for last_msg.msg.specan_dep.amplitude_value[20], expected 3, is %d", last_msg.msg.specan_dep.amplitude_value[20]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[21] == 249, "incorrect value for last_msg.msg.specan_dep.amplitude_value[21], expected 249, is %d", last_msg.msg.specan_dep.amplitude_value[21]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[22] == 92, "incorrect value for last_msg.msg.specan_dep.amplitude_value[22], expected 92, is %d", last_msg.msg.specan_dep.amplitude_value[22]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[23] == 44, "incorrect value for last_msg.msg.specan_dep.amplitude_value[23], expected 44, is %d", last_msg.msg.specan_dep.amplitude_value[23]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[24] == 122, "incorrect value for last_msg.msg.specan_dep.amplitude_value[24], expected 122, is %d", last_msg.msg.specan_dep.amplitude_value[24]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[25] == 169, "incorrect value for last_msg.msg.specan_dep.amplitude_value[25], expected 169, is %d", last_msg.msg.specan_dep.amplitude_value[25]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[26] == 77, "incorrect value for last_msg.msg.specan_dep.amplitude_value[26], expected 77, is %d", last_msg.msg.specan_dep.amplitude_value[26]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[27] == 186, "incorrect value for last_msg.msg.specan_dep.amplitude_value[27], expected 186, is %d", last_msg.msg.specan_dep.amplitude_value[27]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[28] == 68, "incorrect value for last_msg.msg.specan_dep.amplitude_value[28], expected 68, is %d", last_msg.msg.specan_dep.amplitude_value[28]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[29] == 135, "incorrect value for last_msg.msg.specan_dep.amplitude_value[29], expected 135, is %d", last_msg.msg.specan_dep.amplitude_value[29]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[30] == 63, "incorrect value for last_msg.msg.specan_dep.amplitude_value[30], expected 63, is %d", last_msg.msg.specan_dep.amplitude_value[30]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[31] == 168, "incorrect value for last_msg.msg.specan_dep.amplitude_value[31], expected 168, is %d", last_msg.msg.specan_dep.amplitude_value[31]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[32] == 162, "incorrect value for last_msg.msg.specan_dep.amplitude_value[32], expected 162, is %d", last_msg.msg.specan_dep.amplitude_value[32]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[33] == 89, "incorrect value for last_msg.msg.specan_dep.amplitude_value[33], expected 89, is %d", last_msg.msg.specan_dep.amplitude_value[33]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[34] == 36, "incorrect value for last_msg.msg.specan_dep.amplitude_value[34], expected 36, is %d", last_msg.msg.specan_dep.amplitude_value[34]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[35] == 186, "incorrect value for last_msg.msg.specan_dep.amplitude_value[35], expected 186, is %d", last_msg.msg.specan_dep.amplitude_value[35]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[36] == 99, "incorrect value for last_msg.msg.specan_dep.amplitude_value[36], expected 99, is %d", last_msg.msg.specan_dep.amplitude_value[36]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[37] == 63, "incorrect value for last_msg.msg.specan_dep.amplitude_value[37], expected 63, is %d", last_msg.msg.specan_dep.amplitude_value[37]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[38] == 105, "incorrect value for last_msg.msg.specan_dep.amplitude_value[38], expected 105, is %d", last_msg.msg.specan_dep.amplitude_value[38]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[39] == 116, "incorrect value for last_msg.msg.specan_dep.amplitude_value[39], expected 116, is %d", last_msg.msg.specan_dep.amplitude_value[39]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[40] == 216, "incorrect value for last_msg.msg.specan_dep.amplitude_value[40], expected 216, is %d", last_msg.msg.specan_dep.amplitude_value[40]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[41] == 44, "incorrect value for last_msg.msg.specan_dep.amplitude_value[41], expected 44, is %d", last_msg.msg.specan_dep.amplitude_value[41]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[42] == 67, "incorrect value for last_msg.msg.specan_dep.amplitude_value[42], expected 67, is %d", last_msg.msg.specan_dep.amplitude_value[42]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[43] == 212, "incorrect value for last_msg.msg.specan_dep.amplitude_value[43], expected 212, is %d", last_msg.msg.specan_dep.amplitude_value[43]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[44] == 156, "incorrect value for last_msg.msg.specan_dep.amplitude_value[44], expected 156, is %d", last_msg.msg.specan_dep.amplitude_value[44]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[45] == 75, "incorrect value for last_msg.msg.specan_dep.amplitude_value[45], expected 75, is %d", last_msg.msg.specan_dep.amplitude_value[45]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[46] == 81, "incorrect value for last_msg.msg.specan_dep.amplitude_value[46], expected 81, is %d", last_msg.msg.specan_dep.amplitude_value[46]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[47] == 53, "incorrect value for last_msg.msg.specan_dep.amplitude_value[47], expected 53, is %d", last_msg.msg.specan_dep.amplitude_value[47]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[48] == 250, "incorrect value for last_msg.msg.specan_dep.amplitude_value[48], expected 250, is %d", last_msg.msg.specan_dep.amplitude_value[48]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[49] == 225, "incorrect value for last_msg.msg.specan_dep.amplitude_value[49], expected 225, is %d", last_msg.msg.specan_dep.amplitude_value[49]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[50] == 23, "incorrect value for last_msg.msg.specan_dep.amplitude_value[50], expected 23, is %d", last_msg.msg.specan_dep.amplitude_value[50]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[51] == 205, "incorrect value for last_msg.msg.specan_dep.amplitude_value[51], expected 205, is %d", last_msg.msg.specan_dep.amplitude_value[51]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[52] == 26, "incorrect value for last_msg.msg.specan_dep.amplitude_value[52], expected 26, is %d", last_msg.msg.specan_dep.amplitude_value[52]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[53] == 34, "incorrect value for last_msg.msg.specan_dep.amplitude_value[53], expected 34, is %d", last_msg.msg.specan_dep.amplitude_value[53]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[54] == 119, "incorrect value for last_msg.msg.specan_dep.amplitude_value[54], expected 119, is %d", last_msg.msg.specan_dep.amplitude_value[54]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[55] == 50, "incorrect value for last_msg.msg.specan_dep.amplitude_value[55], expected 50, is %d", last_msg.msg.specan_dep.amplitude_value[55]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[56] == 101, "incorrect value for last_msg.msg.specan_dep.amplitude_value[56], expected 101, is %d", last_msg.msg.specan_dep.amplitude_value[56]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[57] == 64, "incorrect value for last_msg.msg.specan_dep.amplitude_value[57], expected 64, is %d", last_msg.msg.specan_dep.amplitude_value[57]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[58] == 7, "incorrect value for last_msg.msg.specan_dep.amplitude_value[58], expected 7, is %d", last_msg.msg.specan_dep.amplitude_value[58]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[59] == 231, "incorrect value for last_msg.msg.specan_dep.amplitude_value[59], expected 231, is %d", last_msg.msg.specan_dep.amplitude_value[59]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[60] == 124, "incorrect value for last_msg.msg.specan_dep.amplitude_value[60], expected 124, is %d", last_msg.msg.specan_dep.amplitude_value[60]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[61] == 183, "incorrect value for last_msg.msg.specan_dep.amplitude_value[61], expected 183, is %d", last_msg.msg.specan_dep.amplitude_value[61]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[62] == 203, "incorrect value for last_msg.msg.specan_dep.amplitude_value[62], expected 203, is %d", last_msg.msg.specan_dep.amplitude_value[62]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[63] == 102, "incorrect value for last_msg.msg.specan_dep.amplitude_value[63], expected 102, is %d", last_msg.msg.specan_dep.amplitude_value[63]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[64] == 234, "incorrect value for last_msg.msg.specan_dep.amplitude_value[64], expected 234, is %d", last_msg.msg.specan_dep.amplitude_value[64]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[65] == 84, "incorrect value for last_msg.msg.specan_dep.amplitude_value[65], expected 84, is %d", last_msg.msg.specan_dep.amplitude_value[65]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[66] == 83, "incorrect value for last_msg.msg.specan_dep.amplitude_value[66], expected 83, is %d", last_msg.msg.specan_dep.amplitude_value[66]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[67] == 208, "incorrect value for last_msg.msg.specan_dep.amplitude_value[67], expected 208, is %d", last_msg.msg.specan_dep.amplitude_value[67]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[68] == 23, "incorrect value for last_msg.msg.specan_dep.amplitude_value[68], expected 23, is %d", last_msg.msg.specan_dep.amplitude_value[68]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[69] == 68, "incorrect value for last_msg.msg.specan_dep.amplitude_value[69], expected 68, is %d", last_msg.msg.specan_dep.amplitude_value[69]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[70] == 54, "incorrect value for last_msg.msg.specan_dep.amplitude_value[70], expected 54, is %d", last_msg.msg.specan_dep.amplitude_value[70]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[71] == 179, "incorrect value for last_msg.msg.specan_dep.amplitude_value[71], expected 179, is %d", last_msg.msg.specan_dep.amplitude_value[71]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[72] == 98, "incorrect value for last_msg.msg.specan_dep.amplitude_value[72], expected 98, is %d", last_msg.msg.specan_dep.amplitude_value[72]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[73] == 96, "incorrect value for last_msg.msg.specan_dep.amplitude_value[73], expected 96, is %d", last_msg.msg.specan_dep.amplitude_value[73]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[74] == 116, "incorrect value for last_msg.msg.specan_dep.amplitude_value[74], expected 116, is %d", last_msg.msg.specan_dep.amplitude_value[74]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[75] == 244, "incorrect value for last_msg.msg.specan_dep.amplitude_value[75], expected 244, is %d", last_msg.msg.specan_dep.amplitude_value[75]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[76] == 246, "incorrect value for last_msg.msg.specan_dep.amplitude_value[76], expected 246, is %d", last_msg.msg.specan_dep.amplitude_value[76]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[77] == 94, "incorrect value for last_msg.msg.specan_dep.amplitude_value[77], expected 94, is %d", last_msg.msg.specan_dep.amplitude_value[77]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[78] == 104, "incorrect value for last_msg.msg.specan_dep.amplitude_value[78], expected 104, is %d", last_msg.msg.specan_dep.amplitude_value[78]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[79] == 94, "incorrect value for last_msg.msg.specan_dep.amplitude_value[79], expected 94, is %d", last_msg.msg.specan_dep.amplitude_value[79]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[80] == 13, "incorrect value for last_msg.msg.specan_dep.amplitude_value[80], expected 13, is %d", last_msg.msg.specan_dep.amplitude_value[80]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[81] == 56, "incorrect value for last_msg.msg.specan_dep.amplitude_value[81], expected 56, is %d", last_msg.msg.specan_dep.amplitude_value[81]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[82] == 210, "incorrect value for last_msg.msg.specan_dep.amplitude_value[82], expected 210, is %d", last_msg.msg.specan_dep.amplitude_value[82]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[83] == 18, "incorrect value for last_msg.msg.specan_dep.amplitude_value[83], expected 18, is %d", last_msg.msg.specan_dep.amplitude_value[83]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[84] == 191, "incorrect value for last_msg.msg.specan_dep.amplitude_value[84], expected 191, is %d", last_msg.msg.specan_dep.amplitude_value[84]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[85] == 22, "incorrect value for last_msg.msg.specan_dep.amplitude_value[85], expected 22, is %d", last_msg.msg.specan_dep.amplitude_value[85]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[86] == 133, "incorrect value for last_msg.msg.specan_dep.amplitude_value[86], expected 133, is %d", last_msg.msg.specan_dep.amplitude_value[86]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[87] == 81, "incorrect value for last_msg.msg.specan_dep.amplitude_value[87], expected 81, is %d", last_msg.msg.specan_dep.amplitude_value[87]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[88] == 153, "incorrect value for last_msg.msg.specan_dep.amplitude_value[88], expected 153, is %d", last_msg.msg.specan_dep.amplitude_value[88]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[89] == 159, "incorrect value for last_msg.msg.specan_dep.amplitude_value[89], expected 159, is %d", last_msg.msg.specan_dep.amplitude_value[89]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[90] == 161, "incorrect value for last_msg.msg.specan_dep.amplitude_value[90], expected 161, is %d", last_msg.msg.specan_dep.amplitude_value[90]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[91] == 219, "incorrect value for last_msg.msg.specan_dep.amplitude_value[91], expected 219, is %d", last_msg.msg.specan_dep.amplitude_value[91]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[92] == 59, "incorrect value for last_msg.msg.specan_dep.amplitude_value[92], expected 59, is %d", last_msg.msg.specan_dep.amplitude_value[92]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[93] == 21, "incorrect value for last_msg.msg.specan_dep.amplitude_value[93], expected 21, is %d", last_msg.msg.specan_dep.amplitude_value[93]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[94] == 164, "incorrect value for last_msg.msg.specan_dep.amplitude_value[94], expected 164, is %d", last_msg.msg.specan_dep.amplitude_value[94]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[95] == 121, "incorrect value for last_msg.msg.specan_dep.amplitude_value[95], expected 121, is %d", last_msg.msg.specan_dep.amplitude_value[95]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[96] == 145, "incorrect value for last_msg.msg.specan_dep.amplitude_value[96], expected 145, is %d", last_msg.msg.specan_dep.amplitude_value[96]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[97] == 203, "incorrect value for last_msg.msg.specan_dep.amplitude_value[97], expected 203, is %d", last_msg.msg.specan_dep.amplitude_value[97]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[98] == 171, "incorrect value for last_msg.msg.specan_dep.amplitude_value[98], expected 171, is %d", last_msg.msg.specan_dep.amplitude_value[98]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[99] == 132, "incorrect value for last_msg.msg.specan_dep.amplitude_value[99], expected 132, is %d", last_msg.msg.specan_dep.amplitude_value[99]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[100] == 57, "incorrect value for last_msg.msg.specan_dep.amplitude_value[100], expected 57, is %d", last_msg.msg.specan_dep.amplitude_value[100]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[101] == 180, "incorrect value for last_msg.msg.specan_dep.amplitude_value[101], expected 180, is %d", last_msg.msg.specan_dep.amplitude_value[101]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[102] == 102, "incorrect value for last_msg.msg.specan_dep.amplitude_value[102], expected 102, is %d", last_msg.msg.specan_dep.amplitude_value[102]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[103] == 101, "incorrect value for last_msg.msg.specan_dep.amplitude_value[103], expected 101, is %d", last_msg.msg.specan_dep.amplitude_value[103]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[104] == 11, "incorrect value for last_msg.msg.specan_dep.amplitude_value[104], expected 11, is %d", last_msg.msg.specan_dep.amplitude_value[104]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[105] == 229, "incorrect value for last_msg.msg.specan_dep.amplitude_value[105], expected 229, is %d", last_msg.msg.specan_dep.amplitude_value[105]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[106] == 175, "incorrect value for last_msg.msg.specan_dep.amplitude_value[106], expected 175, is %d", last_msg.msg.specan_dep.amplitude_value[106]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[107] == 145, "incorrect value for last_msg.msg.specan_dep.amplitude_value[107], expected 145, is %d", last_msg.msg.specan_dep.amplitude_value[107]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[108] == 73, "incorrect value for last_msg.msg.specan_dep.amplitude_value[108], expected 73, is %d", last_msg.msg.specan_dep.amplitude_value[108]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[109] == 72, "incorrect value for last_msg.msg.specan_dep.amplitude_value[109], expected 72, is %d", last_msg.msg.specan_dep.amplitude_value[109]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[110] == 124, "incorrect value for last_msg.msg.specan_dep.amplitude_value[110], expected 124, is %d", last_msg.msg.specan_dep.amplitude_value[110]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[111] == 4, "incorrect value for last_msg.msg.specan_dep.amplitude_value[111], expected 4, is %d", last_msg.msg.specan_dep.amplitude_value[111]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[112] == 184, "incorrect value for last_msg.msg.specan_dep.amplitude_value[112], expected 184, is %d", last_msg.msg.specan_dep.amplitude_value[112]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[113] == 228, "incorrect value for last_msg.msg.specan_dep.amplitude_value[113], expected 228, is %d", last_msg.msg.specan_dep.amplitude_value[113]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[114] == 61, "incorrect value for last_msg.msg.specan_dep.amplitude_value[114], expected 61, is %d", last_msg.msg.specan_dep.amplitude_value[114]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[115] == 234, "incorrect value for last_msg.msg.specan_dep.amplitude_value[115], expected 234, is %d", last_msg.msg.specan_dep.amplitude_value[115]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[116] == 218, "incorrect value for last_msg.msg.specan_dep.amplitude_value[116], expected 218, is %d", last_msg.msg.specan_dep.amplitude_value[116]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[117] == 62, "incorrect value for last_msg.msg.specan_dep.amplitude_value[117], expected 62, is %d", last_msg.msg.specan_dep.amplitude_value[117]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[118] == 226, "incorrect value for last_msg.msg.specan_dep.amplitude_value[118], expected 226, is %d", last_msg.msg.specan_dep.amplitude_value[118]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[119] == 217, "incorrect value for last_msg.msg.specan_dep.amplitude_value[119], expected 217, is %d", last_msg.msg.specan_dep.amplitude_value[119]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[120] == 193, "incorrect value for last_msg.msg.specan_dep.amplitude_value[120], expected 193, is %d", last_msg.msg.specan_dep.amplitude_value[120]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[121] == 7, "incorrect value for last_msg.msg.specan_dep.amplitude_value[121], expected 7, is %d", last_msg.msg.specan_dep.amplitude_value[121]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[122] == 109, "incorrect value for last_msg.msg.specan_dep.amplitude_value[122], expected 109, is %d", last_msg.msg.specan_dep.amplitude_value[122]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[123] == 44, "incorrect value for last_msg.msg.specan_dep.amplitude_value[123], expected 44, is %d", last_msg.msg.specan_dep.amplitude_value[123]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[124] == 83, "incorrect value for last_msg.msg.specan_dep.amplitude_value[124], expected 83, is %d", last_msg.msg.specan_dep.amplitude_value[124]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[125] == 201, "incorrect value for last_msg.msg.specan_dep.amplitude_value[125], expected 201, is %d", last_msg.msg.specan_dep.amplitude_value[125]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[126] == 20, "incorrect value for last_msg.msg.specan_dep.amplitude_value[126], expected 20, is %d", last_msg.msg.specan_dep.amplitude_value[126]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[127] == 101, "incorrect value for last_msg.msg.specan_dep.amplitude_value[127], expected 101, is %d", last_msg.msg.specan_dep.amplitude_value[127]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[128] == 9, "incorrect value for last_msg.msg.specan_dep.amplitude_value[128], expected 9, is %d", last_msg.msg.specan_dep.amplitude_value[128]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[129] == 140, "incorrect value for last_msg.msg.specan_dep.amplitude_value[129], expected 140, is %d", last_msg.msg.specan_dep.amplitude_value[129]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[130] == 186, "incorrect value for last_msg.msg.specan_dep.amplitude_value[130], expected 186, is %d", last_msg.msg.specan_dep.amplitude_value[130]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[131] == 162, "incorrect value for last_msg.msg.specan_dep.amplitude_value[131], expected 162, is %d", last_msg.msg.specan_dep.amplitude_value[131]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[132] == 81, "incorrect value for last_msg.msg.specan_dep.amplitude_value[132], expected 81, is %d", last_msg.msg.specan_dep.amplitude_value[132]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[133] == 91, "incorrect value for last_msg.msg.specan_dep.amplitude_value[133], expected 91, is %d", last_msg.msg.specan_dep.amplitude_value[133]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[134] == 30, "incorrect value for last_msg.msg.specan_dep.amplitude_value[134], expected 30, is %d", last_msg.msg.specan_dep.amplitude_value[134]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[135] == 231, "incorrect value for last_msg.msg.specan_dep.amplitude_value[135], expected 231, is %d", last_msg.msg.specan_dep.amplitude_value[135]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[136] == 161, "incorrect value for last_msg.msg.specan_dep.amplitude_value[136], expected 161, is %d", last_msg.msg.specan_dep.amplitude_value[136]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[137] == 81, "incorrect value for last_msg.msg.specan_dep.amplitude_value[137], expected 81, is %d", last_msg.msg.specan_dep.amplitude_value[137]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[138] == 216, "incorrect value for last_msg.msg.specan_dep.amplitude_value[138], expected 216, is %d", last_msg.msg.specan_dep.amplitude_value[138]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[139] == 114, "incorrect value for last_msg.msg.specan_dep.amplitude_value[139], expected 114, is %d", last_msg.msg.specan_dep.amplitude_value[139]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[140] == 60, "incorrect value for last_msg.msg.specan_dep.amplitude_value[140], expected 60, is %d", last_msg.msg.specan_dep.amplitude_value[140]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[141] == 231, "incorrect value for last_msg.msg.specan_dep.amplitude_value[141], expected 231, is %d", last_msg.msg.specan_dep.amplitude_value[141]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[142] == 163, "incorrect value for last_msg.msg.specan_dep.amplitude_value[142], expected 163, is %d", last_msg.msg.specan_dep.amplitude_value[142]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[143] == 163, "incorrect value for last_msg.msg.specan_dep.amplitude_value[143], expected 163, is %d", last_msg.msg.specan_dep.amplitude_value[143]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[144] == 49, "incorrect value for last_msg.msg.specan_dep.amplitude_value[144], expected 49, is %d", last_msg.msg.specan_dep.amplitude_value[144]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[145] == 237, "incorrect value for last_msg.msg.specan_dep.amplitude_value[145], expected 237, is %d", last_msg.msg.specan_dep.amplitude_value[145]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[146] == 244, "incorrect value for last_msg.msg.specan_dep.amplitude_value[146], expected 244, is %d", last_msg.msg.specan_dep.amplitude_value[146]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[147] == 185, "incorrect value for last_msg.msg.specan_dep.amplitude_value[147], expected 185, is %d", last_msg.msg.specan_dep.amplitude_value[147]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[148] == 240, "incorrect value for last_msg.msg.specan_dep.amplitude_value[148], expected 240, is %d", last_msg.msg.specan_dep.amplitude_value[148]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[149] == 89, "incorrect value for last_msg.msg.specan_dep.amplitude_value[149], expected 89, is %d", last_msg.msg.specan_dep.amplitude_value[149]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[150] == 143, "incorrect value for last_msg.msg.specan_dep.amplitude_value[150], expected 143, is %d", last_msg.msg.specan_dep.amplitude_value[150]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[151] == 174, "incorrect value for last_msg.msg.specan_dep.amplitude_value[151], expected 174, is %d", last_msg.msg.specan_dep.amplitude_value[151]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[152] == 165, "incorrect value for last_msg.msg.specan_dep.amplitude_value[152], expected 165, is %d", last_msg.msg.specan_dep.amplitude_value[152]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[153] == 211, "incorrect value for last_msg.msg.specan_dep.amplitude_value[153], expected 211, is %d", last_msg.msg.specan_dep.amplitude_value[153]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[154] == 241, "incorrect value for last_msg.msg.specan_dep.amplitude_value[154], expected 241, is %d", last_msg.msg.specan_dep.amplitude_value[154]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[155] == 13, "incorrect value for last_msg.msg.specan_dep.amplitude_value[155], expected 13, is %d", last_msg.msg.specan_dep.amplitude_value[155]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[156] == 16, "incorrect value for last_msg.msg.specan_dep.amplitude_value[156], expected 16, is %d", last_msg.msg.specan_dep.amplitude_value[156]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[157] == 61, "incorrect value for last_msg.msg.specan_dep.amplitude_value[157], expected 61, is %d", last_msg.msg.specan_dep.amplitude_value[157]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[158] == 141, "incorrect value for last_msg.msg.specan_dep.amplitude_value[158], expected 141, is %d", last_msg.msg.specan_dep.amplitude_value[158]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[159] == 101, "incorrect value for last_msg.msg.specan_dep.amplitude_value[159], expected 101, is %d", last_msg.msg.specan_dep.amplitude_value[159]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[160] == 89, "incorrect value for last_msg.msg.specan_dep.amplitude_value[160], expected 89, is %d", last_msg.msg.specan_dep.amplitude_value[160]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[161] == 37, "incorrect value for last_msg.msg.specan_dep.amplitude_value[161], expected 37, is %d", last_msg.msg.specan_dep.amplitude_value[161]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[162] == 117, "incorrect value for last_msg.msg.specan_dep.amplitude_value[162], expected 117, is %d", last_msg.msg.specan_dep.amplitude_value[162]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[163] == 189, "incorrect value for last_msg.msg.specan_dep.amplitude_value[163], expected 189, is %d", last_msg.msg.specan_dep.amplitude_value[163]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[164] == 86, "incorrect value for last_msg.msg.specan_dep.amplitude_value[164], expected 86, is %d", last_msg.msg.specan_dep.amplitude_value[164]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[165] == 118, "incorrect value for last_msg.msg.specan_dep.amplitude_value[165], expected 118, is %d", last_msg.msg.specan_dep.amplitude_value[165]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[166] == 176, "incorrect value for last_msg.msg.specan_dep.amplitude_value[166], expected 176, is %d", last_msg.msg.specan_dep.amplitude_value[166]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[167] == 228, "incorrect value for last_msg.msg.specan_dep.amplitude_value[167], expected 228, is %d", last_msg.msg.specan_dep.amplitude_value[167]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[168] == 12, "incorrect value for last_msg.msg.specan_dep.amplitude_value[168], expected 12, is %d", last_msg.msg.specan_dep.amplitude_value[168]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[169] == 14, "incorrect value for last_msg.msg.specan_dep.amplitude_value[169], expected 14, is %d", last_msg.msg.specan_dep.amplitude_value[169]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[170] == 119, "incorrect value for last_msg.msg.specan_dep.amplitude_value[170], expected 119, is %d", last_msg.msg.specan_dep.amplitude_value[170]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[171] == 135, "incorrect value for last_msg.msg.specan_dep.amplitude_value[171], expected 135, is %d", last_msg.msg.specan_dep.amplitude_value[171]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[172] == 129, "incorrect value for last_msg.msg.specan_dep.amplitude_value[172], expected 129, is %d", last_msg.msg.specan_dep.amplitude_value[172]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[173] == 243, "incorrect value for last_msg.msg.specan_dep.amplitude_value[173], expected 243, is %d", last_msg.msg.specan_dep.amplitude_value[173]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[174] == 50, "incorrect value for last_msg.msg.specan_dep.amplitude_value[174], expected 50, is %d", last_msg.msg.specan_dep.amplitude_value[174]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[175] == 29, "incorrect value for last_msg.msg.specan_dep.amplitude_value[175], expected 29, is %d", last_msg.msg.specan_dep.amplitude_value[175]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[176] == 207, "incorrect value for last_msg.msg.specan_dep.amplitude_value[176], expected 207, is %d", last_msg.msg.specan_dep.amplitude_value[176]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[177] == 198, "incorrect value for last_msg.msg.specan_dep.amplitude_value[177], expected 198, is %d", last_msg.msg.specan_dep.amplitude_value[177]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[178] == 117, "incorrect value for last_msg.msg.specan_dep.amplitude_value[178], expected 117, is %d", last_msg.msg.specan_dep.amplitude_value[178]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[179] == 100, "incorrect value for last_msg.msg.specan_dep.amplitude_value[179], expected 100, is %d", last_msg.msg.specan_dep.amplitude_value[179]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[180] == 225, "incorrect value for last_msg.msg.specan_dep.amplitude_value[180], expected 225, is %d", last_msg.msg.specan_dep.amplitude_value[180]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[181] == 6, "incorrect value for last_msg.msg.specan_dep.amplitude_value[181], expected 6, is %d", last_msg.msg.specan_dep.amplitude_value[181]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[182] == 139, "incorrect value for last_msg.msg.specan_dep.amplitude_value[182], expected 139, is %d", last_msg.msg.specan_dep.amplitude_value[182]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[183] == 110, "incorrect value for last_msg.msg.specan_dep.amplitude_value[183], expected 110, is %d", last_msg.msg.specan_dep.amplitude_value[183]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[184] == 39, "incorrect value for last_msg.msg.specan_dep.amplitude_value[184], expected 39, is %d", last_msg.msg.specan_dep.amplitude_value[184]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[185] == 210, "incorrect value for last_msg.msg.specan_dep.amplitude_value[185], expected 210, is %d", last_msg.msg.specan_dep.amplitude_value[185]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[186] == 68, "incorrect value for last_msg.msg.specan_dep.amplitude_value[186], expected 68, is %d", last_msg.msg.specan_dep.amplitude_value[186]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[187] == 199, "incorrect value for last_msg.msg.specan_dep.amplitude_value[187], expected 199, is %d", last_msg.msg.specan_dep.amplitude_value[187]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[188] == 43, "incorrect value for last_msg.msg.specan_dep.amplitude_value[188], expected 43, is %d", last_msg.msg.specan_dep.amplitude_value[188]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[189] == 132, "incorrect value for last_msg.msg.specan_dep.amplitude_value[189], expected 132, is %d", last_msg.msg.specan_dep.amplitude_value[189]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[190] == 64, "incorrect value for last_msg.msg.specan_dep.amplitude_value[190], expected 64, is %d", last_msg.msg.specan_dep.amplitude_value[190]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[191] == 17, "incorrect value for last_msg.msg.specan_dep.amplitude_value[191], expected 17, is %d", last_msg.msg.specan_dep.amplitude_value[191]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[192] == 51, "incorrect value for last_msg.msg.specan_dep.amplitude_value[192], expected 51, is %d", last_msg.msg.specan_dep.amplitude_value[192]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[193] == 173, "incorrect value for last_msg.msg.specan_dep.amplitude_value[193], expected 173, is %d", last_msg.msg.specan_dep.amplitude_value[193]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[194] == 181, "incorrect value for last_msg.msg.specan_dep.amplitude_value[194], expected 181, is %d", last_msg.msg.specan_dep.amplitude_value[194]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[195] == 12, "incorrect value for last_msg.msg.specan_dep.amplitude_value[195], expected 12, is %d", last_msg.msg.specan_dep.amplitude_value[195]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[196] == 140, "incorrect value for last_msg.msg.specan_dep.amplitude_value[196], expected 140, is %d", last_msg.msg.specan_dep.amplitude_value[196]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[197] == 16, "incorrect value for last_msg.msg.specan_dep.amplitude_value[197], expected 16, is %d", last_msg.msg.specan_dep.amplitude_value[197]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[198] == 247, "incorrect value for last_msg.msg.specan_dep.amplitude_value[198], expected 247, is %d", last_msg.msg.specan_dep.amplitude_value[198]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[199] == 84, "incorrect value for last_msg.msg.specan_dep.amplitude_value[199], expected 84, is %d", last_msg.msg.specan_dep.amplitude_value[199]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[200] == 183, "incorrect value for last_msg.msg.specan_dep.amplitude_value[200], expected 183, is %d", last_msg.msg.specan_dep.amplitude_value[200]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[201] == 105, "incorrect value for last_msg.msg.specan_dep.amplitude_value[201], expected 105, is %d", last_msg.msg.specan_dep.amplitude_value[201]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[202] == 39, "incorrect value for last_msg.msg.specan_dep.amplitude_value[202], expected 39, is %d", last_msg.msg.specan_dep.amplitude_value[202]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[203] == 157, "incorrect value for last_msg.msg.specan_dep.amplitude_value[203], expected 157, is %d", last_msg.msg.specan_dep.amplitude_value[203]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[204] == 77, "incorrect value for last_msg.msg.specan_dep.amplitude_value[204], expected 77, is %d", last_msg.msg.specan_dep.amplitude_value[204]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[205] == 30, "incorrect value for last_msg.msg.specan_dep.amplitude_value[205], expected 30, is %d", last_msg.msg.specan_dep.amplitude_value[205]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[206] == 205, "incorrect value for last_msg.msg.specan_dep.amplitude_value[206], expected 205, is %d", last_msg.msg.specan_dep.amplitude_value[206]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[207] == 194, "incorrect value for last_msg.msg.specan_dep.amplitude_value[207], expected 194, is %d", last_msg.msg.specan_dep.amplitude_value[207]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[208] == 59, "incorrect value for last_msg.msg.specan_dep.amplitude_value[208], expected 59, is %d", last_msg.msg.specan_dep.amplitude_value[208]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[209] == 64, "incorrect value for last_msg.msg.specan_dep.amplitude_value[209], expected 64, is %d", last_msg.msg.specan_dep.amplitude_value[209]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[210] == 241, "incorrect value for last_msg.msg.specan_dep.amplitude_value[210], expected 241, is %d", last_msg.msg.specan_dep.amplitude_value[210]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[211] == 183, "incorrect value for last_msg.msg.specan_dep.amplitude_value[211], expected 183, is %d", last_msg.msg.specan_dep.amplitude_value[211]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[212] == 238, "incorrect value for last_msg.msg.specan_dep.amplitude_value[212], expected 238, is %d", last_msg.msg.specan_dep.amplitude_value[212]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[213] == 105, "incorrect value for last_msg.msg.specan_dep.amplitude_value[213], expected 105, is %d", last_msg.msg.specan_dep.amplitude_value[213]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[214] == 181, "incorrect value for last_msg.msg.specan_dep.amplitude_value[214], expected 181, is %d", last_msg.msg.specan_dep.amplitude_value[214]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[215] == 170, "incorrect value for last_msg.msg.specan_dep.amplitude_value[215], expected 170, is %d", last_msg.msg.specan_dep.amplitude_value[215]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[216] == 45, "incorrect value for last_msg.msg.specan_dep.amplitude_value[216], expected 45, is %d", last_msg.msg.specan_dep.amplitude_value[216]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[217] == 8, "incorrect value for last_msg.msg.specan_dep.amplitude_value[217], expected 8, is %d", last_msg.msg.specan_dep.amplitude_value[217]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[218] == 166, "incorrect value for last_msg.msg.specan_dep.amplitude_value[218], expected 166, is %d", last_msg.msg.specan_dep.amplitude_value[218]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[219] == 164, "incorrect value for last_msg.msg.specan_dep.amplitude_value[219], expected 164, is %d", last_msg.msg.specan_dep.amplitude_value[219]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[220] == 238, "incorrect value for last_msg.msg.specan_dep.amplitude_value[220], expected 238, is %d", last_msg.msg.specan_dep.amplitude_value[220]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[221] == 83, "incorrect value for last_msg.msg.specan_dep.amplitude_value[221], expected 83, is %d", last_msg.msg.specan_dep.amplitude_value[221]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[222] == 148, "incorrect value for last_msg.msg.specan_dep.amplitude_value[222], expected 148, is %d", last_msg.msg.specan_dep.amplitude_value[222]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[223] == 173, "incorrect value for last_msg.msg.specan_dep.amplitude_value[223], expected 173, is %d", last_msg.msg.specan_dep.amplitude_value[223]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[224] == 108, "incorrect value for last_msg.msg.specan_dep.amplitude_value[224], expected 108, is %d", last_msg.msg.specan_dep.amplitude_value[224]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[225] == 228, "incorrect value for last_msg.msg.specan_dep.amplitude_value[225], expected 228, is %d", last_msg.msg.specan_dep.amplitude_value[225]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[226] == 67, "incorrect value for last_msg.msg.specan_dep.amplitude_value[226], expected 67, is %d", last_msg.msg.specan_dep.amplitude_value[226]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[227] == 89, "incorrect value for last_msg.msg.specan_dep.amplitude_value[227], expected 89, is %d", last_msg.msg.specan_dep.amplitude_value[227]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[228] == 189, "incorrect value for last_msg.msg.specan_dep.amplitude_value[228], expected 189, is %d", last_msg.msg.specan_dep.amplitude_value[228]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[229] == 67, "incorrect value for last_msg.msg.specan_dep.amplitude_value[229], expected 67, is %d", last_msg.msg.specan_dep.amplitude_value[229]); - ck_assert_msg(last_msg.msg.specan_dep.amplitude_value[230] == 26, "incorrect value for last_msg.msg.specan_dep.amplitude_value[230], expected 26, is %d", last_msg.msg.specan_dep.amplitude_value[230]); - - ck_assert_msg(last_msg.msg.specan_dep.channel_tag == 5878, "incorrect value for last_msg.msg.specan_dep.channel_tag, expected 5878, is %d", last_msg.msg.specan_dep.channel_tag); - - ck_assert_msg((last_msg.msg.specan_dep.freq_ref * 100 - 6348.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.specan_dep.freq_ref, expected 6348.20019531, is %s", last_msg.msg.specan_dep.freq_ref); - - ck_assert_msg((last_msg.msg.specan_dep.freq_step * 100 - 4608.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.specan_dep.freq_step, expected 4608.20019531, is %s", last_msg.msg.specan_dep.freq_step); - - ck_assert_msg(last_msg.msg.specan_dep.n_amplitude_value == 231, "incorrect value for last_msg.msg.specan_dep.n_amplitude_value, expected 231, is %d", last_msg.msg.specan_dep.n_amplitude_value); - - - ck_assert_msg(last_msg.msg.specan_dep.t.tow == 992295133, "incorrect value for last_msg.msg.specan_dep.t.tow, expected 992295133, is %d", last_msg.msg.specan_dep.t.tow); - - ck_assert_msg(last_msg.msg.specan_dep.t.wn == 6957, "incorrect value for last_msg.msg.specan_dep.t.wn, expected 6957, is %d", last_msg.msg.specan_dep.t.wn); + ck_assert_msg((last_msg.msg.specan_dep.amplitude_ref * 100 - + 9349.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.specan_dep.amplitude_ref, " + "expected 9349.20019531, is %s", + last_msg.msg.specan_dep.amplitude_ref); + + ck_assert_msg((last_msg.msg.specan_dep.amplitude_unit * 100 - + 3485.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.specan_dep.amplitude_unit, " + "expected 3485.19995117, is %s", + last_msg.msg.specan_dep.amplitude_unit); + + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[0] == 240, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[0], " + "expected 240, is %d", + last_msg.msg.specan_dep.amplitude_value[0]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[1] == 14, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[1], " + "expected 14, is %d", + last_msg.msg.specan_dep.amplitude_value[1]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[2] == 179, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[2], " + "expected 179, is %d", + last_msg.msg.specan_dep.amplitude_value[2]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[3] == 186, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[3], " + "expected 186, is %d", + last_msg.msg.specan_dep.amplitude_value[3]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[4] == 227, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[4], " + "expected 227, is %d", + last_msg.msg.specan_dep.amplitude_value[4]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[5] == 244, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[5], " + "expected 244, is %d", + last_msg.msg.specan_dep.amplitude_value[5]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[6] == 173, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[6], " + "expected 173, is %d", + last_msg.msg.specan_dep.amplitude_value[6]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[7] == 240, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[7], " + "expected 240, is %d", + last_msg.msg.specan_dep.amplitude_value[7]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[8] == 182, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[8], " + "expected 182, is %d", + last_msg.msg.specan_dep.amplitude_value[8]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[9] == 71, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[9], " + "expected 71, is %d", + last_msg.msg.specan_dep.amplitude_value[9]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[10] == 166, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[10], " + "expected 166, is %d", + last_msg.msg.specan_dep.amplitude_value[10]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[11] == 117, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[11], " + "expected 117, is %d", + last_msg.msg.specan_dep.amplitude_value[11]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[12] == 196, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[12], " + "expected 196, is %d", + last_msg.msg.specan_dep.amplitude_value[12]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[13] == 13, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[13], " + "expected 13, is %d", + last_msg.msg.specan_dep.amplitude_value[13]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[14] == 44, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[14], " + "expected 44, is %d", + last_msg.msg.specan_dep.amplitude_value[14]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[15] == 27, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[15], " + "expected 27, is %d", + last_msg.msg.specan_dep.amplitude_value[15]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[16] == 33, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[16], " + "expected 33, is %d", + last_msg.msg.specan_dep.amplitude_value[16]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[17] == 28, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[17], " + "expected 28, is %d", + last_msg.msg.specan_dep.amplitude_value[17]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[18] == 67, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[18], " + "expected 67, is %d", + last_msg.msg.specan_dep.amplitude_value[18]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[19] == 254, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[19], " + "expected 254, is %d", + last_msg.msg.specan_dep.amplitude_value[19]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[20] == 3, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[20], " + "expected 3, is %d", + last_msg.msg.specan_dep.amplitude_value[20]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[21] == 249, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[21], " + "expected 249, is %d", + last_msg.msg.specan_dep.amplitude_value[21]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[22] == 92, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[22], " + "expected 92, is %d", + last_msg.msg.specan_dep.amplitude_value[22]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[23] == 44, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[23], " + "expected 44, is %d", + last_msg.msg.specan_dep.amplitude_value[23]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[24] == 122, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[24], " + "expected 122, is %d", + last_msg.msg.specan_dep.amplitude_value[24]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[25] == 169, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[25], " + "expected 169, is %d", + last_msg.msg.specan_dep.amplitude_value[25]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[26] == 77, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[26], " + "expected 77, is %d", + last_msg.msg.specan_dep.amplitude_value[26]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[27] == 186, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[27], " + "expected 186, is %d", + last_msg.msg.specan_dep.amplitude_value[27]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[28] == 68, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[28], " + "expected 68, is %d", + last_msg.msg.specan_dep.amplitude_value[28]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[29] == 135, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[29], " + "expected 135, is %d", + last_msg.msg.specan_dep.amplitude_value[29]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[30] == 63, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[30], " + "expected 63, is %d", + last_msg.msg.specan_dep.amplitude_value[30]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[31] == 168, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[31], " + "expected 168, is %d", + last_msg.msg.specan_dep.amplitude_value[31]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[32] == 162, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[32], " + "expected 162, is %d", + last_msg.msg.specan_dep.amplitude_value[32]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[33] == 89, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[33], " + "expected 89, is %d", + last_msg.msg.specan_dep.amplitude_value[33]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[34] == 36, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[34], " + "expected 36, is %d", + last_msg.msg.specan_dep.amplitude_value[34]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[35] == 186, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[35], " + "expected 186, is %d", + last_msg.msg.specan_dep.amplitude_value[35]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[36] == 99, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[36], " + "expected 99, is %d", + last_msg.msg.specan_dep.amplitude_value[36]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[37] == 63, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[37], " + "expected 63, is %d", + last_msg.msg.specan_dep.amplitude_value[37]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[38] == 105, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[38], " + "expected 105, is %d", + last_msg.msg.specan_dep.amplitude_value[38]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[39] == 116, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[39], " + "expected 116, is %d", + last_msg.msg.specan_dep.amplitude_value[39]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[40] == 216, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[40], " + "expected 216, is %d", + last_msg.msg.specan_dep.amplitude_value[40]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[41] == 44, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[41], " + "expected 44, is %d", + last_msg.msg.specan_dep.amplitude_value[41]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[42] == 67, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[42], " + "expected 67, is %d", + last_msg.msg.specan_dep.amplitude_value[42]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[43] == 212, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[43], " + "expected 212, is %d", + last_msg.msg.specan_dep.amplitude_value[43]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[44] == 156, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[44], " + "expected 156, is %d", + last_msg.msg.specan_dep.amplitude_value[44]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[45] == 75, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[45], " + "expected 75, is %d", + last_msg.msg.specan_dep.amplitude_value[45]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[46] == 81, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[46], " + "expected 81, is %d", + last_msg.msg.specan_dep.amplitude_value[46]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[47] == 53, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[47], " + "expected 53, is %d", + last_msg.msg.specan_dep.amplitude_value[47]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[48] == 250, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[48], " + "expected 250, is %d", + last_msg.msg.specan_dep.amplitude_value[48]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[49] == 225, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[49], " + "expected 225, is %d", + last_msg.msg.specan_dep.amplitude_value[49]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[50] == 23, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[50], " + "expected 23, is %d", + last_msg.msg.specan_dep.amplitude_value[50]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[51] == 205, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[51], " + "expected 205, is %d", + last_msg.msg.specan_dep.amplitude_value[51]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[52] == 26, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[52], " + "expected 26, is %d", + last_msg.msg.specan_dep.amplitude_value[52]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[53] == 34, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[53], " + "expected 34, is %d", + last_msg.msg.specan_dep.amplitude_value[53]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[54] == 119, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[54], " + "expected 119, is %d", + last_msg.msg.specan_dep.amplitude_value[54]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[55] == 50, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[55], " + "expected 50, is %d", + last_msg.msg.specan_dep.amplitude_value[55]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[56] == 101, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[56], " + "expected 101, is %d", + last_msg.msg.specan_dep.amplitude_value[56]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[57] == 64, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[57], " + "expected 64, is %d", + last_msg.msg.specan_dep.amplitude_value[57]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[58] == 7, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[58], " + "expected 7, is %d", + last_msg.msg.specan_dep.amplitude_value[58]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[59] == 231, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[59], " + "expected 231, is %d", + last_msg.msg.specan_dep.amplitude_value[59]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[60] == 124, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[60], " + "expected 124, is %d", + last_msg.msg.specan_dep.amplitude_value[60]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[61] == 183, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[61], " + "expected 183, is %d", + last_msg.msg.specan_dep.amplitude_value[61]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[62] == 203, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[62], " + "expected 203, is %d", + last_msg.msg.specan_dep.amplitude_value[62]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[63] == 102, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[63], " + "expected 102, is %d", + last_msg.msg.specan_dep.amplitude_value[63]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[64] == 234, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[64], " + "expected 234, is %d", + last_msg.msg.specan_dep.amplitude_value[64]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[65] == 84, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[65], " + "expected 84, is %d", + last_msg.msg.specan_dep.amplitude_value[65]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[66] == 83, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[66], " + "expected 83, is %d", + last_msg.msg.specan_dep.amplitude_value[66]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[67] == 208, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[67], " + "expected 208, is %d", + last_msg.msg.specan_dep.amplitude_value[67]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[68] == 23, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[68], " + "expected 23, is %d", + last_msg.msg.specan_dep.amplitude_value[68]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[69] == 68, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[69], " + "expected 68, is %d", + last_msg.msg.specan_dep.amplitude_value[69]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[70] == 54, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[70], " + "expected 54, is %d", + last_msg.msg.specan_dep.amplitude_value[70]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[71] == 179, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[71], " + "expected 179, is %d", + last_msg.msg.specan_dep.amplitude_value[71]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[72] == 98, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[72], " + "expected 98, is %d", + last_msg.msg.specan_dep.amplitude_value[72]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[73] == 96, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[73], " + "expected 96, is %d", + last_msg.msg.specan_dep.amplitude_value[73]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[74] == 116, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[74], " + "expected 116, is %d", + last_msg.msg.specan_dep.amplitude_value[74]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[75] == 244, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[75], " + "expected 244, is %d", + last_msg.msg.specan_dep.amplitude_value[75]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[76] == 246, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[76], " + "expected 246, is %d", + last_msg.msg.specan_dep.amplitude_value[76]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[77] == 94, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[77], " + "expected 94, is %d", + last_msg.msg.specan_dep.amplitude_value[77]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[78] == 104, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[78], " + "expected 104, is %d", + last_msg.msg.specan_dep.amplitude_value[78]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[79] == 94, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[79], " + "expected 94, is %d", + last_msg.msg.specan_dep.amplitude_value[79]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[80] == 13, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[80], " + "expected 13, is %d", + last_msg.msg.specan_dep.amplitude_value[80]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[81] == 56, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[81], " + "expected 56, is %d", + last_msg.msg.specan_dep.amplitude_value[81]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[82] == 210, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[82], " + "expected 210, is %d", + last_msg.msg.specan_dep.amplitude_value[82]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[83] == 18, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[83], " + "expected 18, is %d", + last_msg.msg.specan_dep.amplitude_value[83]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[84] == 191, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[84], " + "expected 191, is %d", + last_msg.msg.specan_dep.amplitude_value[84]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[85] == 22, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[85], " + "expected 22, is %d", + last_msg.msg.specan_dep.amplitude_value[85]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[86] == 133, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[86], " + "expected 133, is %d", + last_msg.msg.specan_dep.amplitude_value[86]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[87] == 81, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[87], " + "expected 81, is %d", + last_msg.msg.specan_dep.amplitude_value[87]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[88] == 153, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[88], " + "expected 153, is %d", + last_msg.msg.specan_dep.amplitude_value[88]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[89] == 159, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[89], " + "expected 159, is %d", + last_msg.msg.specan_dep.amplitude_value[89]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[90] == 161, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[90], " + "expected 161, is %d", + last_msg.msg.specan_dep.amplitude_value[90]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[91] == 219, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[91], " + "expected 219, is %d", + last_msg.msg.specan_dep.amplitude_value[91]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[92] == 59, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[92], " + "expected 59, is %d", + last_msg.msg.specan_dep.amplitude_value[92]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[93] == 21, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[93], " + "expected 21, is %d", + last_msg.msg.specan_dep.amplitude_value[93]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[94] == 164, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[94], " + "expected 164, is %d", + last_msg.msg.specan_dep.amplitude_value[94]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[95] == 121, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[95], " + "expected 121, is %d", + last_msg.msg.specan_dep.amplitude_value[95]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[96] == 145, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[96], " + "expected 145, is %d", + last_msg.msg.specan_dep.amplitude_value[96]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[97] == 203, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[97], " + "expected 203, is %d", + last_msg.msg.specan_dep.amplitude_value[97]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[98] == 171, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[98], " + "expected 171, is %d", + last_msg.msg.specan_dep.amplitude_value[98]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[99] == 132, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[99], " + "expected 132, is %d", + last_msg.msg.specan_dep.amplitude_value[99]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[100] == 57, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[100], " + "expected 57, is %d", + last_msg.msg.specan_dep.amplitude_value[100]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[101] == 180, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[101], " + "expected 180, is %d", + last_msg.msg.specan_dep.amplitude_value[101]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[102] == 102, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[102], " + "expected 102, is %d", + last_msg.msg.specan_dep.amplitude_value[102]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[103] == 101, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[103], " + "expected 101, is %d", + last_msg.msg.specan_dep.amplitude_value[103]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[104] == 11, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[104], " + "expected 11, is %d", + last_msg.msg.specan_dep.amplitude_value[104]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[105] == 229, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[105], " + "expected 229, is %d", + last_msg.msg.specan_dep.amplitude_value[105]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[106] == 175, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[106], " + "expected 175, is %d", + last_msg.msg.specan_dep.amplitude_value[106]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[107] == 145, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[107], " + "expected 145, is %d", + last_msg.msg.specan_dep.amplitude_value[107]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[108] == 73, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[108], " + "expected 73, is %d", + last_msg.msg.specan_dep.amplitude_value[108]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[109] == 72, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[109], " + "expected 72, is %d", + last_msg.msg.specan_dep.amplitude_value[109]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[110] == 124, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[110], " + "expected 124, is %d", + last_msg.msg.specan_dep.amplitude_value[110]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[111] == 4, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[111], " + "expected 4, is %d", + last_msg.msg.specan_dep.amplitude_value[111]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[112] == 184, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[112], " + "expected 184, is %d", + last_msg.msg.specan_dep.amplitude_value[112]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[113] == 228, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[113], " + "expected 228, is %d", + last_msg.msg.specan_dep.amplitude_value[113]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[114] == 61, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[114], " + "expected 61, is %d", + last_msg.msg.specan_dep.amplitude_value[114]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[115] == 234, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[115], " + "expected 234, is %d", + last_msg.msg.specan_dep.amplitude_value[115]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[116] == 218, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[116], " + "expected 218, is %d", + last_msg.msg.specan_dep.amplitude_value[116]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[117] == 62, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[117], " + "expected 62, is %d", + last_msg.msg.specan_dep.amplitude_value[117]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[118] == 226, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[118], " + "expected 226, is %d", + last_msg.msg.specan_dep.amplitude_value[118]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[119] == 217, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[119], " + "expected 217, is %d", + last_msg.msg.specan_dep.amplitude_value[119]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[120] == 193, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[120], " + "expected 193, is %d", + last_msg.msg.specan_dep.amplitude_value[120]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[121] == 7, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[121], " + "expected 7, is %d", + last_msg.msg.specan_dep.amplitude_value[121]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[122] == 109, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[122], " + "expected 109, is %d", + last_msg.msg.specan_dep.amplitude_value[122]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[123] == 44, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[123], " + "expected 44, is %d", + last_msg.msg.specan_dep.amplitude_value[123]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[124] == 83, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[124], " + "expected 83, is %d", + last_msg.msg.specan_dep.amplitude_value[124]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[125] == 201, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[125], " + "expected 201, is %d", + last_msg.msg.specan_dep.amplitude_value[125]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[126] == 20, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[126], " + "expected 20, is %d", + last_msg.msg.specan_dep.amplitude_value[126]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[127] == 101, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[127], " + "expected 101, is %d", + last_msg.msg.specan_dep.amplitude_value[127]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[128] == 9, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[128], " + "expected 9, is %d", + last_msg.msg.specan_dep.amplitude_value[128]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[129] == 140, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[129], " + "expected 140, is %d", + last_msg.msg.specan_dep.amplitude_value[129]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[130] == 186, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[130], " + "expected 186, is %d", + last_msg.msg.specan_dep.amplitude_value[130]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[131] == 162, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[131], " + "expected 162, is %d", + last_msg.msg.specan_dep.amplitude_value[131]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[132] == 81, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[132], " + "expected 81, is %d", + last_msg.msg.specan_dep.amplitude_value[132]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[133] == 91, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[133], " + "expected 91, is %d", + last_msg.msg.specan_dep.amplitude_value[133]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[134] == 30, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[134], " + "expected 30, is %d", + last_msg.msg.specan_dep.amplitude_value[134]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[135] == 231, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[135], " + "expected 231, is %d", + last_msg.msg.specan_dep.amplitude_value[135]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[136] == 161, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[136], " + "expected 161, is %d", + last_msg.msg.specan_dep.amplitude_value[136]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[137] == 81, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[137], " + "expected 81, is %d", + last_msg.msg.specan_dep.amplitude_value[137]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[138] == 216, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[138], " + "expected 216, is %d", + last_msg.msg.specan_dep.amplitude_value[138]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[139] == 114, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[139], " + "expected 114, is %d", + last_msg.msg.specan_dep.amplitude_value[139]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[140] == 60, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[140], " + "expected 60, is %d", + last_msg.msg.specan_dep.amplitude_value[140]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[141] == 231, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[141], " + "expected 231, is %d", + last_msg.msg.specan_dep.amplitude_value[141]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[142] == 163, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[142], " + "expected 163, is %d", + last_msg.msg.specan_dep.amplitude_value[142]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[143] == 163, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[143], " + "expected 163, is %d", + last_msg.msg.specan_dep.amplitude_value[143]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[144] == 49, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[144], " + "expected 49, is %d", + last_msg.msg.specan_dep.amplitude_value[144]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[145] == 237, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[145], " + "expected 237, is %d", + last_msg.msg.specan_dep.amplitude_value[145]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[146] == 244, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[146], " + "expected 244, is %d", + last_msg.msg.specan_dep.amplitude_value[146]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[147] == 185, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[147], " + "expected 185, is %d", + last_msg.msg.specan_dep.amplitude_value[147]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[148] == 240, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[148], " + "expected 240, is %d", + last_msg.msg.specan_dep.amplitude_value[148]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[149] == 89, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[149], " + "expected 89, is %d", + last_msg.msg.specan_dep.amplitude_value[149]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[150] == 143, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[150], " + "expected 143, is %d", + last_msg.msg.specan_dep.amplitude_value[150]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[151] == 174, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[151], " + "expected 174, is %d", + last_msg.msg.specan_dep.amplitude_value[151]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[152] == 165, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[152], " + "expected 165, is %d", + last_msg.msg.specan_dep.amplitude_value[152]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[153] == 211, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[153], " + "expected 211, is %d", + last_msg.msg.specan_dep.amplitude_value[153]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[154] == 241, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[154], " + "expected 241, is %d", + last_msg.msg.specan_dep.amplitude_value[154]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[155] == 13, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[155], " + "expected 13, is %d", + last_msg.msg.specan_dep.amplitude_value[155]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[156] == 16, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[156], " + "expected 16, is %d", + last_msg.msg.specan_dep.amplitude_value[156]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[157] == 61, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[157], " + "expected 61, is %d", + last_msg.msg.specan_dep.amplitude_value[157]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[158] == 141, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[158], " + "expected 141, is %d", + last_msg.msg.specan_dep.amplitude_value[158]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[159] == 101, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[159], " + "expected 101, is %d", + last_msg.msg.specan_dep.amplitude_value[159]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[160] == 89, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[160], " + "expected 89, is %d", + last_msg.msg.specan_dep.amplitude_value[160]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[161] == 37, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[161], " + "expected 37, is %d", + last_msg.msg.specan_dep.amplitude_value[161]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[162] == 117, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[162], " + "expected 117, is %d", + last_msg.msg.specan_dep.amplitude_value[162]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[163] == 189, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[163], " + "expected 189, is %d", + last_msg.msg.specan_dep.amplitude_value[163]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[164] == 86, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[164], " + "expected 86, is %d", + last_msg.msg.specan_dep.amplitude_value[164]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[165] == 118, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[165], " + "expected 118, is %d", + last_msg.msg.specan_dep.amplitude_value[165]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[166] == 176, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[166], " + "expected 176, is %d", + last_msg.msg.specan_dep.amplitude_value[166]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[167] == 228, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[167], " + "expected 228, is %d", + last_msg.msg.specan_dep.amplitude_value[167]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[168] == 12, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[168], " + "expected 12, is %d", + last_msg.msg.specan_dep.amplitude_value[168]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[169] == 14, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[169], " + "expected 14, is %d", + last_msg.msg.specan_dep.amplitude_value[169]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[170] == 119, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[170], " + "expected 119, is %d", + last_msg.msg.specan_dep.amplitude_value[170]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[171] == 135, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[171], " + "expected 135, is %d", + last_msg.msg.specan_dep.amplitude_value[171]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[172] == 129, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[172], " + "expected 129, is %d", + last_msg.msg.specan_dep.amplitude_value[172]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[173] == 243, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[173], " + "expected 243, is %d", + last_msg.msg.specan_dep.amplitude_value[173]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[174] == 50, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[174], " + "expected 50, is %d", + last_msg.msg.specan_dep.amplitude_value[174]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[175] == 29, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[175], " + "expected 29, is %d", + last_msg.msg.specan_dep.amplitude_value[175]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[176] == 207, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[176], " + "expected 207, is %d", + last_msg.msg.specan_dep.amplitude_value[176]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[177] == 198, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[177], " + "expected 198, is %d", + last_msg.msg.specan_dep.amplitude_value[177]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[178] == 117, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[178], " + "expected 117, is %d", + last_msg.msg.specan_dep.amplitude_value[178]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[179] == 100, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[179], " + "expected 100, is %d", + last_msg.msg.specan_dep.amplitude_value[179]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[180] == 225, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[180], " + "expected 225, is %d", + last_msg.msg.specan_dep.amplitude_value[180]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[181] == 6, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[181], " + "expected 6, is %d", + last_msg.msg.specan_dep.amplitude_value[181]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[182] == 139, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[182], " + "expected 139, is %d", + last_msg.msg.specan_dep.amplitude_value[182]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[183] == 110, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[183], " + "expected 110, is %d", + last_msg.msg.specan_dep.amplitude_value[183]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[184] == 39, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[184], " + "expected 39, is %d", + last_msg.msg.specan_dep.amplitude_value[184]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[185] == 210, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[185], " + "expected 210, is %d", + last_msg.msg.specan_dep.amplitude_value[185]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[186] == 68, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[186], " + "expected 68, is %d", + last_msg.msg.specan_dep.amplitude_value[186]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[187] == 199, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[187], " + "expected 199, is %d", + last_msg.msg.specan_dep.amplitude_value[187]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[188] == 43, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[188], " + "expected 43, is %d", + last_msg.msg.specan_dep.amplitude_value[188]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[189] == 132, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[189], " + "expected 132, is %d", + last_msg.msg.specan_dep.amplitude_value[189]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[190] == 64, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[190], " + "expected 64, is %d", + last_msg.msg.specan_dep.amplitude_value[190]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[191] == 17, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[191], " + "expected 17, is %d", + last_msg.msg.specan_dep.amplitude_value[191]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[192] == 51, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[192], " + "expected 51, is %d", + last_msg.msg.specan_dep.amplitude_value[192]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[193] == 173, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[193], " + "expected 173, is %d", + last_msg.msg.specan_dep.amplitude_value[193]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[194] == 181, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[194], " + "expected 181, is %d", + last_msg.msg.specan_dep.amplitude_value[194]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[195] == 12, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[195], " + "expected 12, is %d", + last_msg.msg.specan_dep.amplitude_value[195]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[196] == 140, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[196], " + "expected 140, is %d", + last_msg.msg.specan_dep.amplitude_value[196]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[197] == 16, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[197], " + "expected 16, is %d", + last_msg.msg.specan_dep.amplitude_value[197]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[198] == 247, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[198], " + "expected 247, is %d", + last_msg.msg.specan_dep.amplitude_value[198]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[199] == 84, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[199], " + "expected 84, is %d", + last_msg.msg.specan_dep.amplitude_value[199]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[200] == 183, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[200], " + "expected 183, is %d", + last_msg.msg.specan_dep.amplitude_value[200]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[201] == 105, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[201], " + "expected 105, is %d", + last_msg.msg.specan_dep.amplitude_value[201]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[202] == 39, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[202], " + "expected 39, is %d", + last_msg.msg.specan_dep.amplitude_value[202]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[203] == 157, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[203], " + "expected 157, is %d", + last_msg.msg.specan_dep.amplitude_value[203]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[204] == 77, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[204], " + "expected 77, is %d", + last_msg.msg.specan_dep.amplitude_value[204]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[205] == 30, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[205], " + "expected 30, is %d", + last_msg.msg.specan_dep.amplitude_value[205]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[206] == 205, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[206], " + "expected 205, is %d", + last_msg.msg.specan_dep.amplitude_value[206]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[207] == 194, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[207], " + "expected 194, is %d", + last_msg.msg.specan_dep.amplitude_value[207]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[208] == 59, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[208], " + "expected 59, is %d", + last_msg.msg.specan_dep.amplitude_value[208]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[209] == 64, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[209], " + "expected 64, is %d", + last_msg.msg.specan_dep.amplitude_value[209]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[210] == 241, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[210], " + "expected 241, is %d", + last_msg.msg.specan_dep.amplitude_value[210]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[211] == 183, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[211], " + "expected 183, is %d", + last_msg.msg.specan_dep.amplitude_value[211]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[212] == 238, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[212], " + "expected 238, is %d", + last_msg.msg.specan_dep.amplitude_value[212]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[213] == 105, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[213], " + "expected 105, is %d", + last_msg.msg.specan_dep.amplitude_value[213]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[214] == 181, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[214], " + "expected 181, is %d", + last_msg.msg.specan_dep.amplitude_value[214]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[215] == 170, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[215], " + "expected 170, is %d", + last_msg.msg.specan_dep.amplitude_value[215]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[216] == 45, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[216], " + "expected 45, is %d", + last_msg.msg.specan_dep.amplitude_value[216]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[217] == 8, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[217], " + "expected 8, is %d", + last_msg.msg.specan_dep.amplitude_value[217]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[218] == 166, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[218], " + "expected 166, is %d", + last_msg.msg.specan_dep.amplitude_value[218]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[219] == 164, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[219], " + "expected 164, is %d", + last_msg.msg.specan_dep.amplitude_value[219]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[220] == 238, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[220], " + "expected 238, is %d", + last_msg.msg.specan_dep.amplitude_value[220]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[221] == 83, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[221], " + "expected 83, is %d", + last_msg.msg.specan_dep.amplitude_value[221]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[222] == 148, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[222], " + "expected 148, is %d", + last_msg.msg.specan_dep.amplitude_value[222]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[223] == 173, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[223], " + "expected 173, is %d", + last_msg.msg.specan_dep.amplitude_value[223]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[224] == 108, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[224], " + "expected 108, is %d", + last_msg.msg.specan_dep.amplitude_value[224]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[225] == 228, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[225], " + "expected 228, is %d", + last_msg.msg.specan_dep.amplitude_value[225]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[226] == 67, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[226], " + "expected 67, is %d", + last_msg.msg.specan_dep.amplitude_value[226]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[227] == 89, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[227], " + "expected 89, is %d", + last_msg.msg.specan_dep.amplitude_value[227]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[228] == 189, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[228], " + "expected 189, is %d", + last_msg.msg.specan_dep.amplitude_value[228]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[229] == 67, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[229], " + "expected 67, is %d", + last_msg.msg.specan_dep.amplitude_value[229]); + ck_assert_msg( + last_msg.msg.specan_dep.amplitude_value[230] == 26, + "incorrect value for last_msg.msg.specan_dep.amplitude_value[230], " + "expected 26, is %d", + last_msg.msg.specan_dep.amplitude_value[230]); + + ck_assert_msg(last_msg.msg.specan_dep.channel_tag == 5878, + "incorrect value for last_msg.msg.specan_dep.channel_tag, " + "expected 5878, is %d", + last_msg.msg.specan_dep.channel_tag); + + ck_assert_msg( + (last_msg.msg.specan_dep.freq_ref * 100 - 6348.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.specan_dep.freq_ref, expected " + "6348.20019531, is %s", + last_msg.msg.specan_dep.freq_ref); + + ck_assert_msg( + (last_msg.msg.specan_dep.freq_step * 100 - 4608.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.specan_dep.freq_step, expected " + "4608.20019531, is %s", + last_msg.msg.specan_dep.freq_step); + + ck_assert_msg( + last_msg.msg.specan_dep.n_amplitude_value == 231, + "incorrect value for last_msg.msg.specan_dep.n_amplitude_value, " + "expected 231, is %d", + last_msg.msg.specan_dep.n_amplitude_value); + + ck_assert_msg(last_msg.msg.specan_dep.t.tow == 992295133, + "incorrect value for last_msg.msg.specan_dep.t.tow, expected " + "992295133, is %d", + last_msg.msg.specan_dep.t.tow); + + ck_assert_msg(last_msg.msg.specan_dep.t.wn == 6957, + "incorrect value for last_msg.msg.specan_dep.t.wn, expected " + "6957, is %d", + last_msg.msg.specan_dep.t.wn); } } END_TEST -Suite* auto_check_sbp_piksi_MsgSpecanDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgSpecanDep"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgSpecanDep"); +Suite *auto_check_sbp_piksi_MsgSpecanDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgSpecanDep"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgSpecanDep"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgSpecanDep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgThreadState.c b/c/test/auto_check_sbp_piksi_MsgThreadState.c index 311a027d2..b4930a186 100644 --- a/c/test/auto_check_sbp_piksi_MsgThreadState.c +++ b/c/test/auto_check_sbp_piksi_MsgThreadState.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgThreadState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgThreadState.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgThreadState ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgThreadState) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgThreadState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,58 +90,82 @@ START_TEST( test_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,23,0,246,215,26,109,97,105,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,156,9,0,0,73,138, }; + u8 encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 109, 97, 105, 110, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 9, 0, 0, 73, 138, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.thread_state.cpu = 0; - + { - const char assign_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg.thread_state.name, assign_string, sizeof(assign_string)); } - + test_msg.thread_state.stack_free = 2460; - sbp_message_send(&sbp_state, SbpMsgThreadState, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgThreadState, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.thread_state.cpu == 0, "incorrect value for last_msg.msg.thread_state.cpu, expected 0, is %d", last_msg.msg.thread_state.cpu); - - { - const char check_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.thread_state.name, expected string '%s', is '%s'", check_string, last_msg.msg.thread_state.name); - } - - ck_assert_msg(last_msg.msg.thread_state.stack_free == 2460, "incorrect value for last_msg.msg.thread_state.stack_free, expected 2460, is %d", last_msg.msg.thread_state.stack_free); + ck_assert_msg( + last_msg.msg.thread_state.cpu == 0, + "incorrect value for last_msg.msg.thread_state.cpu, expected 0, is %d", + last_msg.msg.thread_state.cpu); + + { + const char check_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.thread_state.name, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.thread_state.name); + } + + ck_assert_msg(last_msg.msg.thread_state.stack_free == 2460, + "incorrect value for last_msg.msg.thread_state.stack_free, " + "expected 2460, is %d", + last_msg.msg.thread_state.stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -153,58 +173,82 @@ START_TEST( test_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,23,0,246,215,26,105,100,108,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,2,36,0,0,0,151,20, }; + u8 encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 105, 100, 108, 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 2, 36, 0, 0, 0, 151, 20, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.thread_state.cpu = 595; - + { - const char assign_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg.thread_state.name, assign_string, sizeof(assign_string)); } - + test_msg.thread_state.stack_free = 36; - sbp_message_send(&sbp_state, SbpMsgThreadState, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgThreadState, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.thread_state.cpu == 595, "incorrect value for last_msg.msg.thread_state.cpu, expected 595, is %d", last_msg.msg.thread_state.cpu); - - { - const char check_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.thread_state.name, expected string '%s', is '%s'", check_string, last_msg.msg.thread_state.name); - } - - ck_assert_msg(last_msg.msg.thread_state.stack_free == 36, "incorrect value for last_msg.msg.thread_state.stack_free, expected 36, is %d", last_msg.msg.thread_state.stack_free); + ck_assert_msg(last_msg.msg.thread_state.cpu == 595, + "incorrect value for last_msg.msg.thread_state.cpu, expected " + "595, is %d", + last_msg.msg.thread_state.cpu); + + { + const char check_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.thread_state.name, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.thread_state.name); + } + + ck_assert_msg(last_msg.msg.thread_state.stack_free == 36, + "incorrect value for last_msg.msg.thread_state.stack_free, " + "expected 36, is %d", + last_msg.msg.thread_state.stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -212,58 +256,82 @@ START_TEST( test_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,23,0,246,215,26,78,65,80,32,73,83,82,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,116,4,0,0,226,60, }; + u8 encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 78, 65, 80, 32, 73, 83, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 116, 4, 0, 0, 226, 60, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.thread_state.cpu = 14; - + { - const char assign_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg.thread_state.name, assign_string, sizeof(assign_string)); } - + test_msg.thread_state.stack_free = 1140; - sbp_message_send(&sbp_state, SbpMsgThreadState, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgThreadState, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.thread_state.cpu == 14, "incorrect value for last_msg.msg.thread_state.cpu, expected 14, is %d", last_msg.msg.thread_state.cpu); - - { - const char check_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.thread_state.name, expected string '%s', is '%s'", check_string, last_msg.msg.thread_state.name); - } - - ck_assert_msg(last_msg.msg.thread_state.stack_free == 1140, "incorrect value for last_msg.msg.thread_state.stack_free, expected 1140, is %d", last_msg.msg.thread_state.stack_free); + ck_assert_msg( + last_msg.msg.thread_state.cpu == 14, + "incorrect value for last_msg.msg.thread_state.cpu, expected 14, is %d", + last_msg.msg.thread_state.cpu); + + { + const char check_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.thread_state.name, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.thread_state.name); + } + + ck_assert_msg(last_msg.msg.thread_state.stack_free == 1140, + "incorrect value for last_msg.msg.thread_state.stack_free, " + "expected 1140, is %d", + last_msg.msg.thread_state.stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -271,58 +339,82 @@ START_TEST( test_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,23,0,246,215,26,83,66,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,196,19,0,0,90,169, }; + u8 encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 83, 66, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 196, 19, 0, 0, 90, 169, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.thread_state.cpu = 1; - + { - const char assign_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg.thread_state.name, assign_string, sizeof(assign_string)); } - + test_msg.thread_state.stack_free = 5060; - sbp_message_send(&sbp_state, SbpMsgThreadState, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgThreadState, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.thread_state.cpu == 1, "incorrect value for last_msg.msg.thread_state.cpu, expected 1, is %d", last_msg.msg.thread_state.cpu); - - { - const char check_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.thread_state.name, expected string '%s', is '%s'", check_string, last_msg.msg.thread_state.name); - } - - ck_assert_msg(last_msg.msg.thread_state.stack_free == 5060, "incorrect value for last_msg.msg.thread_state.stack_free, expected 5060, is %d", last_msg.msg.thread_state.stack_free); + ck_assert_msg( + last_msg.msg.thread_state.cpu == 1, + "incorrect value for last_msg.msg.thread_state.cpu, expected 1, is %d", + last_msg.msg.thread_state.cpu); + + { + const char check_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.thread_state.name, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.thread_state.name); + } + + ck_assert_msg(last_msg.msg.thread_state.stack_free == 5060, + "incorrect value for last_msg.msg.thread_state.stack_free, " + "expected 5060, is %d", + last_msg.msg.thread_state.stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -330,58 +422,85 @@ START_TEST( test_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,23,0,246,215,26,109,97,110,97,103,101,32,97,99,113,0,0,0,0,0,0,0,0,0,0,7,0,20,9,0,0,47,75, }; + u8 encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 109, 97, 110, 97, 103, 101, + 32, 97, 99, 113, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7, 0, 20, 9, 0, 0, 47, 75, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.thread_state.cpu = 7; - + { - const char assign_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg.thread_state.name, assign_string, sizeof(assign_string)); } - + test_msg.thread_state.stack_free = 2324; - sbp_message_send(&sbp_state, SbpMsgThreadState, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgThreadState, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.thread_state.cpu == 7, "incorrect value for last_msg.msg.thread_state.cpu, expected 7, is %d", last_msg.msg.thread_state.cpu); - - { - const char check_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.thread_state.name, expected string '%s', is '%s'", check_string, last_msg.msg.thread_state.name); - } - - ck_assert_msg(last_msg.msg.thread_state.stack_free == 2324, "incorrect value for last_msg.msg.thread_state.stack_free, expected 2324, is %d", last_msg.msg.thread_state.stack_free); + ck_assert_msg( + last_msg.msg.thread_state.cpu == 7, + "incorrect value for last_msg.msg.thread_state.cpu, expected 7, is %d", + last_msg.msg.thread_state.cpu); + + { + const char check_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.thread_state.name, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.thread_state.name); + } + + ck_assert_msg(last_msg.msg.thread_state.stack_free == 2324, + "incorrect value for last_msg.msg.thread_state.stack_free, " + "expected 2324, is %d", + last_msg.msg.thread_state.stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -389,58 +508,82 @@ START_TEST( test_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,23,0,195,4,26,109,97,105,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148,9,0,0,195,212, }; + u8 encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 109, 97, 105, 110, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 9, 0, 0, 195, 212, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.thread_state.cpu = 0; - + { - const char assign_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg.thread_state.name, assign_string, sizeof(assign_string)); } - + test_msg.thread_state.stack_free = 2452; - sbp_message_send(&sbp_state, SbpMsgThreadState, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgThreadState, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.thread_state.cpu == 0, "incorrect value for last_msg.msg.thread_state.cpu, expected 0, is %d", last_msg.msg.thread_state.cpu); - - { - const char check_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.thread_state.name, expected string '%s', is '%s'", check_string, last_msg.msg.thread_state.name); - } - - ck_assert_msg(last_msg.msg.thread_state.stack_free == 2452, "incorrect value for last_msg.msg.thread_state.stack_free, expected 2452, is %d", last_msg.msg.thread_state.stack_free); + ck_assert_msg( + last_msg.msg.thread_state.cpu == 0, + "incorrect value for last_msg.msg.thread_state.cpu, expected 0, is %d", + last_msg.msg.thread_state.cpu); + + { + const char check_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.thread_state.name, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.thread_state.name); + } + + ck_assert_msg(last_msg.msg.thread_state.stack_free == 2452, + "incorrect value for last_msg.msg.thread_state.stack_free, " + "expected 2452, is %d", + last_msg.msg.thread_state.stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -448,58 +591,82 @@ START_TEST( test_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,23,0,195,4,26,105,100,108,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,228,1,36,0,0,0,225,18, }; + u8 encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 105, 100, 108, 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 1, 36, 0, 0, 0, 225, 18, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.thread_state.cpu = 484; - + { - const char assign_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg.thread_state.name, assign_string, sizeof(assign_string)); } - + test_msg.thread_state.stack_free = 36; - sbp_message_send(&sbp_state, SbpMsgThreadState, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgThreadState, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.thread_state.cpu == 484, "incorrect value for last_msg.msg.thread_state.cpu, expected 484, is %d", last_msg.msg.thread_state.cpu); - - { - const char check_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.thread_state.name, expected string '%s', is '%s'", check_string, last_msg.msg.thread_state.name); - } - - ck_assert_msg(last_msg.msg.thread_state.stack_free == 36, "incorrect value for last_msg.msg.thread_state.stack_free, expected 36, is %d", last_msg.msg.thread_state.stack_free); + ck_assert_msg(last_msg.msg.thread_state.cpu == 484, + "incorrect value for last_msg.msg.thread_state.cpu, expected " + "484, is %d", + last_msg.msg.thread_state.cpu); + + { + const char check_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.thread_state.name, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.thread_state.name); + } + + ck_assert_msg(last_msg.msg.thread_state.stack_free == 36, + "incorrect value for last_msg.msg.thread_state.stack_free, " + "expected 36, is %d", + last_msg.msg.thread_state.stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -507,58 +674,82 @@ START_TEST( test_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,23,0,195,4,26,78,65,80,32,73,83,82,0,0,0,0,0,0,0,0,0,0,0,0,0,138,1,92,7,0,0,166,116, }; + u8 encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 78, 65, 80, 32, 73, 83, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 1, 92, 7, 0, 0, 166, 116, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.thread_state.cpu = 394; - + { - const char assign_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg.thread_state.name, assign_string, sizeof(assign_string)); } - + test_msg.thread_state.stack_free = 1884; - sbp_message_send(&sbp_state, SbpMsgThreadState, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgThreadState, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.thread_state.cpu == 394, "incorrect value for last_msg.msg.thread_state.cpu, expected 394, is %d", last_msg.msg.thread_state.cpu); - - { - const char check_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.thread_state.name, expected string '%s', is '%s'", check_string, last_msg.msg.thread_state.name); - } - - ck_assert_msg(last_msg.msg.thread_state.stack_free == 1884, "incorrect value for last_msg.msg.thread_state.stack_free, expected 1884, is %d", last_msg.msg.thread_state.stack_free); + ck_assert_msg(last_msg.msg.thread_state.cpu == 394, + "incorrect value for last_msg.msg.thread_state.cpu, expected " + "394, is %d", + last_msg.msg.thread_state.cpu); + + { + const char check_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.thread_state.name, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.thread_state.name); + } + + ck_assert_msg(last_msg.msg.thread_state.stack_free == 1884, + "incorrect value for last_msg.msg.thread_state.stack_free, " + "expected 1884, is %d", + last_msg.msg.thread_state.stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -566,58 +757,82 @@ START_TEST( test_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,23,0,195,4,26,83,66,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,4,12,0,0,229,174, }; + u8 encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 83, 66, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 12, 0, 0, 229, 174, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.thread_state.cpu = 1; - + { - const char assign_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg.thread_state.name, assign_string, sizeof(assign_string)); } - + test_msg.thread_state.stack_free = 3076; - sbp_message_send(&sbp_state, SbpMsgThreadState, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgThreadState, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.thread_state.cpu == 1, "incorrect value for last_msg.msg.thread_state.cpu, expected 1, is %d", last_msg.msg.thread_state.cpu); - - { - const char check_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.thread_state.name, expected string '%s', is '%s'", check_string, last_msg.msg.thread_state.name); - } - - ck_assert_msg(last_msg.msg.thread_state.stack_free == 3076, "incorrect value for last_msg.msg.thread_state.stack_free, expected 3076, is %d", last_msg.msg.thread_state.stack_free); + ck_assert_msg( + last_msg.msg.thread_state.cpu == 1, + "incorrect value for last_msg.msg.thread_state.cpu, expected 1, is %d", + last_msg.msg.thread_state.cpu); + + { + const char check_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.thread_state.name, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.thread_state.name); + } + + ck_assert_msg(last_msg.msg.thread_state.stack_free == 3076, + "incorrect value for last_msg.msg.thread_state.stack_free, " + "expected 3076, is %d", + last_msg.msg.thread_state.stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -625,58 +840,84 @@ START_TEST( test_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,23,0,195,4,26,109,97,110,97,103,101,32,97,99,113,0,0,0,0,0,0,0,0,0,0,10,0,124,9,0,0,52,2, }; + u8 encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 109, 97, 110, 97, 103, 101, 32, 97, 99, 113, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 124, 9, 0, 0, 52, 2, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.thread_state.cpu = 10; - + { - const char assign_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg.thread_state.name, assign_string, sizeof(assign_string)); } - + test_msg.thread_state.stack_free = 2428; - sbp_message_send(&sbp_state, SbpMsgThreadState, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgThreadState, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.thread_state.cpu == 10, "incorrect value for last_msg.msg.thread_state.cpu, expected 10, is %d", last_msg.msg.thread_state.cpu); - - { - const char check_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.thread_state.name, expected string '%s', is '%s'", check_string, last_msg.msg.thread_state.name); - } - - ck_assert_msg(last_msg.msg.thread_state.stack_free == 2428, "incorrect value for last_msg.msg.thread_state.stack_free, expected 2428, is %d", last_msg.msg.thread_state.stack_free); + ck_assert_msg( + last_msg.msg.thread_state.cpu == 10, + "incorrect value for last_msg.msg.thread_state.cpu, expected 10, is %d", + last_msg.msg.thread_state.cpu); + + { + const char check_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.thread_state.name, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.thread_state.name); + } + + ck_assert_msg(last_msg.msg.thread_state.stack_free == 2428, + "incorrect value for last_msg.msg.thread_state.stack_free, " + "expected 2428, is %d", + last_msg.msg.thread_state.stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -684,61 +925,88 @@ START_TEST( test_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,23,0,195,4,26,109,97,110,97,103,101,32,116,114,97,99,107,0,0,0,0,0,0,0,0,0,0,28,9,0,0,122,54, }; + u8 encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 109, 97, 110, 97, 103, 101, + 32, 116, 114, 97, 99, 107, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 28, 9, 0, 0, 122, 54, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.thread_state.cpu = 0; - + { - const char assign_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)116,(char)114,(char)97,(char)99,(char)107,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)116, + (char)114, (char)97, (char)99, (char)107, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg.thread_state.name, assign_string, sizeof(assign_string)); } - + test_msg.thread_state.stack_free = 2332; - sbp_message_send(&sbp_state, SbpMsgThreadState, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgThreadState, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgThreadState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.thread_state.cpu == 0, "incorrect value for last_msg.msg.thread_state.cpu, expected 0, is %d", last_msg.msg.thread_state.cpu); - - { - const char check_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)116,(char)114,(char)97,(char)99,(char)107,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, sizeof(check_string)) == 0, "incorrect value for last_msg.msg.thread_state.name, expected string '%s', is '%s'", check_string, last_msg.msg.thread_state.name); - } - - ck_assert_msg(last_msg.msg.thread_state.stack_free == 2332, "incorrect value for last_msg.msg.thread_state.stack_free, expected 2332, is %d", last_msg.msg.thread_state.stack_free); + ck_assert_msg( + last_msg.msg.thread_state.cpu == 0, + "incorrect value for last_msg.msg.thread_state.cpu, expected 0, is %d", + last_msg.msg.thread_state.cpu); + + { + const char check_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)116, + (char)114, (char)97, (char)99, (char)107, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg(memcmp(&last_msg.msg.thread_state.name, check_string, + sizeof(check_string)) == 0, + "incorrect value for last_msg.msg.thread_state.name, " + "expected string '%s', is '%s'", + check_string, last_msg.msg.thread_state.name); + } + + ck_assert_msg(last_msg.msg.thread_state.stack_free == 2332, + "incorrect value for last_msg.msg.thread_state.stack_free, " + "expected 2332, is %d", + last_msg.msg.thread_state.stack_free); } } END_TEST -Suite* auto_check_sbp_piksi_MsgThreadState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgThreadState"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgThreadState"); +Suite *auto_check_sbp_piksi_MsgThreadState_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgThreadState"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgThreadState"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgThreadState); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgUartState.c b/c/test/auto_check_sbp_piksi_MsgUartState.c index 7945c5c72..cc0416ae4 100644 --- a/c/test/auto_check_sbp_piksi_MsgUartState.c +++ b/c/test/auto_check_sbp_piksi_MsgUartState.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartState.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgUartState ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgUartState) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgUartState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,157 +90,265 @@ START_TEST( test_auto_check_sbp_piksi_MsgUartState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x1d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x1d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,29,0,200,224,74,154,169,242,69,102,166,231,68,89,98,79,184,138,244,154,73,201,69,154,65,211,69,201,16,103,249,143,161,154,17,186,69,51,211,7,69,215,149,253,25,218,24,29,195,16,19,159,142,71,17,10,113,137,219,135,18,182,21,38,190,59,196,169,155,107,111,253,168,244,158,112,19,251,131,100,225, }; + u8 encoded_frame[] = { + 85, 29, 0, 200, 224, 74, 154, 169, 242, 69, 102, 166, 231, 68, + 89, 98, 79, 184, 138, 244, 154, 73, 201, 69, 154, 65, 211, 69, + 201, 16, 103, 249, 143, 161, 154, 17, 186, 69, 51, 211, 7, 69, + 215, 149, 253, 25, 218, 24, 29, 195, 16, 19, 159, 142, 71, 17, + 10, 113, 137, 219, 135, 18, 182, 21, 38, 190, 59, 196, 169, 155, + 107, 111, 253, 168, 244, 158, 112, 19, 251, 131, 100, 225, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.uart_state.latency.avg = 319865629; - + test_msg.uart_state.latency.current = 364253831; - + test_msg.uart_state.latency.lmax = -611749622; - + test_msg.uart_state.latency.lmin = 289902239; - - + test_msg.uart_state.obs_period.avg = -1002717658; - + test_msg.uart_state.obs_period.current = -2080697488; - + test_msg.uart_state.obs_period.pmax = -1628133123; - + test_msg.uart_state.obs_period.pmin = 1869323177; - - + test_msg.uart_state.uart_a.crc_error_count = 25177; - + test_msg.uart_state.uart_a.io_error_count = 47183; - + test_msg.uart_state.uart_a.rx_buffer_level = 244; - + test_msg.uart_state.uart_a.rx_throughput = 1853.199951171875; - + test_msg.uart_state.uart_a.tx_buffer_level = 138; - + test_msg.uart_state.uart_a.tx_throughput = 7765.2001953125; - - + test_msg.uart_state.uart_b.crc_error_count = 4297; - + test_msg.uart_state.uart_b.io_error_count = 63847; - + test_msg.uart_state.uart_b.rx_buffer_level = 161; - + test_msg.uart_state.uart_b.rx_throughput = 6760.2001953125; - + test_msg.uart_state.uart_b.tx_buffer_level = 143; - + test_msg.uart_state.uart_b.tx_throughput = 6441.2001953125; - - + test_msg.uart_state.uart_ftdi.crc_error_count = 38359; - + test_msg.uart_state.uart_ftdi.io_error_count = 6653; - + test_msg.uart_state.uart_ftdi.rx_buffer_level = 24; - + test_msg.uart_state.uart_ftdi.rx_throughput = 2173.199951171875; - + test_msg.uart_state.uart_ftdi.tx_buffer_level = 218; - + test_msg.uart_state.uart_ftdi.tx_throughput = 5954.2001953125; - sbp_message_send(&sbp_state, SbpMsgUartState, 57544, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgUartState, 57544, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 57544, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgUartState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgUartState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.uart_state.latency.avg == 319865629, "incorrect value for last_msg.msg.uart_state.latency.avg, expected 319865629, is %d", last_msg.msg.uart_state.latency.avg); - - ck_assert_msg(last_msg.msg.uart_state.latency.current == 364253831, "incorrect value for last_msg.msg.uart_state.latency.current, expected 364253831, is %d", last_msg.msg.uart_state.latency.current); - - ck_assert_msg(last_msg.msg.uart_state.latency.lmax == -611749622, "incorrect value for last_msg.msg.uart_state.latency.lmax, expected -611749622, is %d", last_msg.msg.uart_state.latency.lmax); - - ck_assert_msg(last_msg.msg.uart_state.latency.lmin == 289902239, "incorrect value for last_msg.msg.uart_state.latency.lmin, expected 289902239, is %d", last_msg.msg.uart_state.latency.lmin); - - - ck_assert_msg(last_msg.msg.uart_state.obs_period.avg == -1002717658, "incorrect value for last_msg.msg.uart_state.obs_period.avg, expected -1002717658, is %d", last_msg.msg.uart_state.obs_period.avg); - - ck_assert_msg(last_msg.msg.uart_state.obs_period.current == -2080697488, "incorrect value for last_msg.msg.uart_state.obs_period.current, expected -2080697488, is %d", last_msg.msg.uart_state.obs_period.current); - - ck_assert_msg(last_msg.msg.uart_state.obs_period.pmax == -1628133123, "incorrect value for last_msg.msg.uart_state.obs_period.pmax, expected -1628133123, is %d", last_msg.msg.uart_state.obs_period.pmax); - - ck_assert_msg(last_msg.msg.uart_state.obs_period.pmin == 1869323177, "incorrect value for last_msg.msg.uart_state.obs_period.pmin, expected 1869323177, is %d", last_msg.msg.uart_state.obs_period.pmin); - - - ck_assert_msg(last_msg.msg.uart_state.uart_a.crc_error_count == 25177, "incorrect value for last_msg.msg.uart_state.uart_a.crc_error_count, expected 25177, is %d", last_msg.msg.uart_state.uart_a.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state.uart_a.io_error_count == 47183, "incorrect value for last_msg.msg.uart_state.uart_a.io_error_count, expected 47183, is %d", last_msg.msg.uart_state.uart_a.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state.uart_a.rx_buffer_level == 244, "incorrect value for last_msg.msg.uart_state.uart_a.rx_buffer_level, expected 244, is %d", last_msg.msg.uart_state.uart_a.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state.uart_a.rx_throughput * 100 - 1853.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state.uart_a.rx_throughput, expected 1853.19995117, is %s", last_msg.msg.uart_state.uart_a.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state.uart_a.tx_buffer_level == 138, "incorrect value for last_msg.msg.uart_state.uart_a.tx_buffer_level, expected 138, is %d", last_msg.msg.uart_state.uart_a.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state.uart_a.tx_throughput * 100 - 7765.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state.uart_a.tx_throughput, expected 7765.20019531, is %s", last_msg.msg.uart_state.uart_a.tx_throughput); - - - ck_assert_msg(last_msg.msg.uart_state.uart_b.crc_error_count == 4297, "incorrect value for last_msg.msg.uart_state.uart_b.crc_error_count, expected 4297, is %d", last_msg.msg.uart_state.uart_b.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state.uart_b.io_error_count == 63847, "incorrect value for last_msg.msg.uart_state.uart_b.io_error_count, expected 63847, is %d", last_msg.msg.uart_state.uart_b.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state.uart_b.rx_buffer_level == 161, "incorrect value for last_msg.msg.uart_state.uart_b.rx_buffer_level, expected 161, is %d", last_msg.msg.uart_state.uart_b.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state.uart_b.rx_throughput * 100 - 6760.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state.uart_b.rx_throughput, expected 6760.20019531, is %s", last_msg.msg.uart_state.uart_b.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state.uart_b.tx_buffer_level == 143, "incorrect value for last_msg.msg.uart_state.uart_b.tx_buffer_level, expected 143, is %d", last_msg.msg.uart_state.uart_b.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state.uart_b.tx_throughput * 100 - 6441.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state.uart_b.tx_throughput, expected 6441.20019531, is %s", last_msg.msg.uart_state.uart_b.tx_throughput); - - - ck_assert_msg(last_msg.msg.uart_state.uart_ftdi.crc_error_count == 38359, "incorrect value for last_msg.msg.uart_state.uart_ftdi.crc_error_count, expected 38359, is %d", last_msg.msg.uart_state.uart_ftdi.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state.uart_ftdi.io_error_count == 6653, "incorrect value for last_msg.msg.uart_state.uart_ftdi.io_error_count, expected 6653, is %d", last_msg.msg.uart_state.uart_ftdi.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state.uart_ftdi.rx_buffer_level == 24, "incorrect value for last_msg.msg.uart_state.uart_ftdi.rx_buffer_level, expected 24, is %d", last_msg.msg.uart_state.uart_ftdi.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state.uart_ftdi.rx_throughput * 100 - 2173.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state.uart_ftdi.rx_throughput, expected 2173.19995117, is %s", last_msg.msg.uart_state.uart_ftdi.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state.uart_ftdi.tx_buffer_level == 218, "incorrect value for last_msg.msg.uart_state.uart_ftdi.tx_buffer_level, expected 218, is %d", last_msg.msg.uart_state.uart_ftdi.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state.uart_ftdi.tx_throughput * 100 - 5954.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state.uart_ftdi.tx_throughput, expected 5954.20019531, is %s", last_msg.msg.uart_state.uart_ftdi.tx_throughput); + ck_assert_msg(last_msg.msg.uart_state.latency.avg == 319865629, + "incorrect value for last_msg.msg.uart_state.latency.avg, " + "expected 319865629, is %d", + last_msg.msg.uart_state.latency.avg); + + ck_assert_msg( + last_msg.msg.uart_state.latency.current == 364253831, + "incorrect value for last_msg.msg.uart_state.latency.current, expected " + "364253831, is %d", + last_msg.msg.uart_state.latency.current); + + ck_assert_msg(last_msg.msg.uart_state.latency.lmax == -611749622, + "incorrect value for last_msg.msg.uart_state.latency.lmax, " + "expected -611749622, is %d", + last_msg.msg.uart_state.latency.lmax); + + ck_assert_msg(last_msg.msg.uart_state.latency.lmin == 289902239, + "incorrect value for last_msg.msg.uart_state.latency.lmin, " + "expected 289902239, is %d", + last_msg.msg.uart_state.latency.lmin); + + ck_assert_msg(last_msg.msg.uart_state.obs_period.avg == -1002717658, + "incorrect value for last_msg.msg.uart_state.obs_period.avg, " + "expected -1002717658, is %d", + last_msg.msg.uart_state.obs_period.avg); + + ck_assert_msg( + last_msg.msg.uart_state.obs_period.current == -2080697488, + "incorrect value for last_msg.msg.uart_state.obs_period.current, " + "expected -2080697488, is %d", + last_msg.msg.uart_state.obs_period.current); + + ck_assert_msg( + last_msg.msg.uart_state.obs_period.pmax == -1628133123, + "incorrect value for last_msg.msg.uart_state.obs_period.pmax, expected " + "-1628133123, is %d", + last_msg.msg.uart_state.obs_period.pmax); + + ck_assert_msg( + last_msg.msg.uart_state.obs_period.pmin == 1869323177, + "incorrect value for last_msg.msg.uart_state.obs_period.pmin, expected " + "1869323177, is %d", + last_msg.msg.uart_state.obs_period.pmin); + + ck_assert_msg( + last_msg.msg.uart_state.uart_a.crc_error_count == 25177, + "incorrect value for last_msg.msg.uart_state.uart_a.crc_error_count, " + "expected 25177, is %d", + last_msg.msg.uart_state.uart_a.crc_error_count); + + ck_assert_msg( + last_msg.msg.uart_state.uart_a.io_error_count == 47183, + "incorrect value for last_msg.msg.uart_state.uart_a.io_error_count, " + "expected 47183, is %d", + last_msg.msg.uart_state.uart_a.io_error_count); + + ck_assert_msg( + last_msg.msg.uart_state.uart_a.rx_buffer_level == 244, + "incorrect value for last_msg.msg.uart_state.uart_a.rx_buffer_level, " + "expected 244, is %d", + last_msg.msg.uart_state.uart_a.rx_buffer_level); + + ck_assert_msg( + (last_msg.msg.uart_state.uart_a.rx_throughput * 100 - + 1853.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.uart_state.uart_a.rx_throughput, " + "expected 1853.19995117, is %s", + last_msg.msg.uart_state.uart_a.rx_throughput); + + ck_assert_msg( + last_msg.msg.uart_state.uart_a.tx_buffer_level == 138, + "incorrect value for last_msg.msg.uart_state.uart_a.tx_buffer_level, " + "expected 138, is %d", + last_msg.msg.uart_state.uart_a.tx_buffer_level); + + ck_assert_msg( + (last_msg.msg.uart_state.uart_a.tx_throughput * 100 - + 7765.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.uart_state.uart_a.tx_throughput, " + "expected 7765.20019531, is %s", + last_msg.msg.uart_state.uart_a.tx_throughput); + + ck_assert_msg( + last_msg.msg.uart_state.uart_b.crc_error_count == 4297, + "incorrect value for last_msg.msg.uart_state.uart_b.crc_error_count, " + "expected 4297, is %d", + last_msg.msg.uart_state.uart_b.crc_error_count); + + ck_assert_msg( + last_msg.msg.uart_state.uart_b.io_error_count == 63847, + "incorrect value for last_msg.msg.uart_state.uart_b.io_error_count, " + "expected 63847, is %d", + last_msg.msg.uart_state.uart_b.io_error_count); + + ck_assert_msg( + last_msg.msg.uart_state.uart_b.rx_buffer_level == 161, + "incorrect value for last_msg.msg.uart_state.uart_b.rx_buffer_level, " + "expected 161, is %d", + last_msg.msg.uart_state.uart_b.rx_buffer_level); + + ck_assert_msg( + (last_msg.msg.uart_state.uart_b.rx_throughput * 100 - + 6760.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.uart_state.uart_b.rx_throughput, " + "expected 6760.20019531, is %s", + last_msg.msg.uart_state.uart_b.rx_throughput); + + ck_assert_msg( + last_msg.msg.uart_state.uart_b.tx_buffer_level == 143, + "incorrect value for last_msg.msg.uart_state.uart_b.tx_buffer_level, " + "expected 143, is %d", + last_msg.msg.uart_state.uart_b.tx_buffer_level); + + ck_assert_msg( + (last_msg.msg.uart_state.uart_b.tx_throughput * 100 - + 6441.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.uart_state.uart_b.tx_throughput, " + "expected 6441.20019531, is %s", + last_msg.msg.uart_state.uart_b.tx_throughput); + + ck_assert_msg(last_msg.msg.uart_state.uart_ftdi.crc_error_count == 38359, + "incorrect value for " + "last_msg.msg.uart_state.uart_ftdi.crc_error_count, expected " + "38359, is %d", + last_msg.msg.uart_state.uart_ftdi.crc_error_count); + + ck_assert_msg( + last_msg.msg.uart_state.uart_ftdi.io_error_count == 6653, + "incorrect value for last_msg.msg.uart_state.uart_ftdi.io_error_count, " + "expected 6653, is %d", + last_msg.msg.uart_state.uart_ftdi.io_error_count); + + ck_assert_msg( + last_msg.msg.uart_state.uart_ftdi.rx_buffer_level == 24, + "incorrect value for " + "last_msg.msg.uart_state.uart_ftdi.rx_buffer_level, expected 24, is %d", + last_msg.msg.uart_state.uart_ftdi.rx_buffer_level); + + ck_assert_msg( + (last_msg.msg.uart_state.uart_ftdi.rx_throughput * 100 - + 2173.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.uart_state.uart_ftdi.rx_throughput, " + "expected 2173.19995117, is %s", + last_msg.msg.uart_state.uart_ftdi.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state.uart_ftdi.tx_buffer_level == 218, + "incorrect value for " + "last_msg.msg.uart_state.uart_ftdi.tx_buffer_level, expected " + "218, is %d", + last_msg.msg.uart_state.uart_ftdi.tx_buffer_level); + + ck_assert_msg( + (last_msg.msg.uart_state.uart_ftdi.tx_throughput * 100 - + 5954.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.uart_state.uart_ftdi.tx_throughput, " + "expected 5954.20019531, is %s", + last_msg.msg.uart_state.uart_ftdi.tx_throughput); } } END_TEST -Suite* auto_check_sbp_piksi_MsgUartState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgUartState"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgUartState"); +Suite *auto_check_sbp_piksi_MsgUartState_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgUartState"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgUartState"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgUartState); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_piksi_MsgUartStateDepA.c b/c/test/auto_check_sbp_piksi_MsgUartStateDepA.c index 373cbe137..8773529a3 100644 --- a/c/test/auto_check_sbp_piksi_MsgUartStateDepA.c +++ b/c/test/auto_check_sbp_piksi_MsgUartStateDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartStateDepA.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_piksi_MsgUartStateDepA ) -{ +START_TEST(test_auto_check_sbp_piksi_MsgUartStateDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_piksi_MsgUartStateDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,136 +90,233 @@ START_TEST( test_auto_check_sbp_piksi_MsgUartStateDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x18, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x18, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,154,153,57,65,0,0,0,0,0,0,0,0,15,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,247,5, }; + u8 encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 154, 153, 57, 65, 0, 0, 0, 0, + 0, 0, 0, 0, 15, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 247, 5, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.uart_state_depa.latency.avg = -1; - + test_msg.uart_state_depa.latency.current = -1; - + test_msg.uart_state_depa.latency.lmax = 0; - + test_msg.uart_state_depa.latency.lmin = 0; - - + test_msg.uart_state_depa.uart_a.crc_error_count = 0; - + test_msg.uart_state_depa.uart_a.io_error_count = 0; - + test_msg.uart_state_depa.uart_a.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_a.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_a.tx_buffer_level = 0; - + test_msg.uart_state_depa.uart_a.tx_throughput = 0.0; - - + test_msg.uart_state_depa.uart_b.crc_error_count = 0; - + test_msg.uart_state_depa.uart_b.io_error_count = 0; - + test_msg.uart_state_depa.uart_b.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_b.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_b.tx_buffer_level = 0; - + test_msg.uart_state_depa.uart_b.tx_throughput = 0.0; - - + test_msg.uart_state_depa.uart_ftdi.crc_error_count = 0; - + test_msg.uart_state_depa.uart_ftdi.io_error_count = 0; - + test_msg.uart_state_depa.uart_ftdi.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_ftdi.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_ftdi.tx_buffer_level = 15; - + test_msg.uart_state_depa.uart_ftdi.tx_throughput = 11.600000381469727; - sbp_message_send(&sbp_state, SbpMsgUartStateDepa, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgUartStateDepa, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgUartStateDepa, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgUartStateDepa, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.avg == -1, "incorrect value for last_msg.msg.uart_state_depa.latency.avg, expected -1, is %d", last_msg.msg.uart_state_depa.latency.avg); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.current == -1, "incorrect value for last_msg.msg.uart_state_depa.latency.current, expected -1, is %d", last_msg.msg.uart_state_depa.latency.current); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.lmax == 0, "incorrect value for last_msg.msg.uart_state_depa.latency.lmax, expected 0, is %d", last_msg.msg.uart_state_depa.latency.lmax); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.lmin == 0, "incorrect value for last_msg.msg.uart_state_depa.latency.lmin, expected 0, is %d", last_msg.msg.uart_state_depa.latency.lmin); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_a.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_a.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.tx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.tx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.tx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_a.tx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_a.tx_throughput); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_b.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_b.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.tx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.tx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.tx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_b.tx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_b.tx_throughput); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level == 15, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level, expected 15, is %d", last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput * 100 - 11.6000003815 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput, expected 11.6000003815, is %s", last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput); + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.avg == -1, + "incorrect value for last_msg.msg.uart_state_depa.latency.avg, " + "expected -1, is %d", + last_msg.msg.uart_state_depa.latency.avg); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.current == -1, + "incorrect value for last_msg.msg.uart_state_depa.latency.current, " + "expected -1, is %d", + last_msg.msg.uart_state_depa.latency.current); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.lmax == 0, + "incorrect value for last_msg.msg.uart_state_depa.latency.lmax, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.latency.lmax); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.lmin == 0, + "incorrect value for last_msg.msg.uart_state_depa.latency.lmin, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.latency.lmin); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.crc_error_count); + + ck_assert_msg( + last_msg.msg.uart_state_depa.uart_a.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.io_error_count, expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.rx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_a.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.tx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.tx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.tx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.tx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_a.tx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.crc_error_count); + + ck_assert_msg( + last_msg.msg.uart_state_depa.uart_b.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.io_error_count, expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.rx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_b.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.tx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.tx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.tx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.tx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_b.tx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.io_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput, " + "expected 0.0, is %s", + last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level == 15, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level, " + "expected 15, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput * 100 - + 11.6000003815 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput, " + "expected 11.6000003815, is %s", + last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -231,136 +324,233 @@ START_TEST( test_auto_check_sbp_piksi_MsgUartStateDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x18, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x18, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,43,135,61,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,65,110, }; + u8 encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 2, 43, 135, 61, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 65, 110, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.uart_state_depa.latency.avg = -1; - + test_msg.uart_state_depa.latency.current = -1; - + test_msg.uart_state_depa.latency.lmax = 0; - + test_msg.uart_state_depa.latency.lmin = 0; - - + test_msg.uart_state_depa.uart_a.crc_error_count = 0; - + test_msg.uart_state_depa.uart_a.io_error_count = 0; - + test_msg.uart_state_depa.uart_a.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_a.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_a.tx_buffer_level = 0; - + test_msg.uart_state_depa.uart_a.tx_throughput = 0.0; - - + test_msg.uart_state_depa.uart_b.crc_error_count = 0; - + test_msg.uart_state_depa.uart_b.io_error_count = 0; - + test_msg.uart_state_depa.uart_b.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_b.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_b.tx_buffer_level = 0; - + test_msg.uart_state_depa.uart_b.tx_throughput = 0.0; - - + test_msg.uart_state_depa.uart_ftdi.crc_error_count = 0; - + test_msg.uart_state_depa.uart_ftdi.io_error_count = 0; - + test_msg.uart_state_depa.uart_ftdi.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_ftdi.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_ftdi.tx_buffer_level = 0; - + test_msg.uart_state_depa.uart_ftdi.tx_throughput = 0.06599999964237213; - sbp_message_send(&sbp_state, SbpMsgUartStateDepa, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgUartStateDepa, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgUartStateDepa, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgUartStateDepa, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.avg == -1, "incorrect value for last_msg.msg.uart_state_depa.latency.avg, expected -1, is %d", last_msg.msg.uart_state_depa.latency.avg); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.current == -1, "incorrect value for last_msg.msg.uart_state_depa.latency.current, expected -1, is %d", last_msg.msg.uart_state_depa.latency.current); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.lmax == 0, "incorrect value for last_msg.msg.uart_state_depa.latency.lmax, expected 0, is %d", last_msg.msg.uart_state_depa.latency.lmax); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.lmin == 0, "incorrect value for last_msg.msg.uart_state_depa.latency.lmin, expected 0, is %d", last_msg.msg.uart_state_depa.latency.lmin); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_a.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_a.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.tx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.tx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.tx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_a.tx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_a.tx_throughput); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_b.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_b.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.tx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.tx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.tx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_b.tx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_b.tx_throughput); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput * 100 - 0.0659999996424 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput, expected 0.0659999996424, is %s", last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput); + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.avg == -1, + "incorrect value for last_msg.msg.uart_state_depa.latency.avg, " + "expected -1, is %d", + last_msg.msg.uart_state_depa.latency.avg); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.current == -1, + "incorrect value for last_msg.msg.uart_state_depa.latency.current, " + "expected -1, is %d", + last_msg.msg.uart_state_depa.latency.current); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.lmax == 0, + "incorrect value for last_msg.msg.uart_state_depa.latency.lmax, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.latency.lmax); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.lmin == 0, + "incorrect value for last_msg.msg.uart_state_depa.latency.lmin, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.latency.lmin); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.crc_error_count); + + ck_assert_msg( + last_msg.msg.uart_state_depa.uart_a.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.io_error_count, expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.rx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_a.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.tx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.tx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.tx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.tx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_a.tx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.crc_error_count); + + ck_assert_msg( + last_msg.msg.uart_state_depa.uart_b.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.io_error_count, expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.rx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_b.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.tx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.tx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.tx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.tx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_b.tx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.io_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput, " + "expected 0.0, is %s", + last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput * 100 - + 0.0659999996424 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput, " + "expected 0.0659999996424, is %s", + last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -368,136 +558,233 @@ START_TEST( test_auto_check_sbp_piksi_MsgUartStateDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x18, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x18, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,86,14,62,0,0,0,0,0,0,0,0,10,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,198,36, }; + u8 encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 4, 86, 14, 62, 0, 0, 0, 0, + 0, 0, 0, 0, 10, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 198, 36, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.uart_state_depa.latency.avg = -1; - + test_msg.uart_state_depa.latency.current = -1; - + test_msg.uart_state_depa.latency.lmax = 0; - + test_msg.uart_state_depa.latency.lmin = 0; - - + test_msg.uart_state_depa.uart_a.crc_error_count = 0; - + test_msg.uart_state_depa.uart_a.io_error_count = 0; - + test_msg.uart_state_depa.uart_a.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_a.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_a.tx_buffer_level = 0; - + test_msg.uart_state_depa.uart_a.tx_throughput = 0.0; - - + test_msg.uart_state_depa.uart_b.crc_error_count = 0; - + test_msg.uart_state_depa.uart_b.io_error_count = 0; - + test_msg.uart_state_depa.uart_b.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_b.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_b.tx_buffer_level = 0; - + test_msg.uart_state_depa.uart_b.tx_throughput = 0.0; - - + test_msg.uart_state_depa.uart_ftdi.crc_error_count = 0; - + test_msg.uart_state_depa.uart_ftdi.io_error_count = 0; - + test_msg.uart_state_depa.uart_ftdi.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_ftdi.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_ftdi.tx_buffer_level = 10; - + test_msg.uart_state_depa.uart_ftdi.tx_throughput = 0.13899999856948853; - sbp_message_send(&sbp_state, SbpMsgUartStateDepa, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgUartStateDepa, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgUartStateDepa, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgUartStateDepa, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.avg == -1, "incorrect value for last_msg.msg.uart_state_depa.latency.avg, expected -1, is %d", last_msg.msg.uart_state_depa.latency.avg); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.current == -1, "incorrect value for last_msg.msg.uart_state_depa.latency.current, expected -1, is %d", last_msg.msg.uart_state_depa.latency.current); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.lmax == 0, "incorrect value for last_msg.msg.uart_state_depa.latency.lmax, expected 0, is %d", last_msg.msg.uart_state_depa.latency.lmax); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.lmin == 0, "incorrect value for last_msg.msg.uart_state_depa.latency.lmin, expected 0, is %d", last_msg.msg.uart_state_depa.latency.lmin); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_a.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_a.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.tx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.tx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.tx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_a.tx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_a.tx_throughput); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_b.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_b.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.tx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.tx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.tx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_b.tx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_b.tx_throughput); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level == 10, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level, expected 10, is %d", last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput * 100 - 0.138999998569 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput, expected 0.138999998569, is %s", last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput); + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.avg == -1, + "incorrect value for last_msg.msg.uart_state_depa.latency.avg, " + "expected -1, is %d", + last_msg.msg.uart_state_depa.latency.avg); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.current == -1, + "incorrect value for last_msg.msg.uart_state_depa.latency.current, " + "expected -1, is %d", + last_msg.msg.uart_state_depa.latency.current); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.lmax == 0, + "incorrect value for last_msg.msg.uart_state_depa.latency.lmax, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.latency.lmax); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.lmin == 0, + "incorrect value for last_msg.msg.uart_state_depa.latency.lmin, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.latency.lmin); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.crc_error_count); + + ck_assert_msg( + last_msg.msg.uart_state_depa.uart_a.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.io_error_count, expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.rx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_a.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.tx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.tx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.tx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.tx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_a.tx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.crc_error_count); + + ck_assert_msg( + last_msg.msg.uart_state_depa.uart_b.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.io_error_count, expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.rx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_b.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.tx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.tx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.tx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.tx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_b.tx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.io_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput, " + "expected 0.0, is %s", + last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level == 10, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level, " + "expected 10, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput * 100 - + 0.138999998569 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput, " + "expected 0.138999998569, is %s", + last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -505,136 +792,233 @@ START_TEST( test_auto_check_sbp_piksi_MsgUartStateDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x18, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x18, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,43,135,61,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,65,110, }; + u8 encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 2, 43, 135, 61, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 65, 110, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.uart_state_depa.latency.avg = -1; - + test_msg.uart_state_depa.latency.current = -1; - + test_msg.uart_state_depa.latency.lmax = 0; - + test_msg.uart_state_depa.latency.lmin = 0; - - + test_msg.uart_state_depa.uart_a.crc_error_count = 0; - + test_msg.uart_state_depa.uart_a.io_error_count = 0; - + test_msg.uart_state_depa.uart_a.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_a.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_a.tx_buffer_level = 0; - + test_msg.uart_state_depa.uart_a.tx_throughput = 0.0; - - + test_msg.uart_state_depa.uart_b.crc_error_count = 0; - + test_msg.uart_state_depa.uart_b.io_error_count = 0; - + test_msg.uart_state_depa.uart_b.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_b.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_b.tx_buffer_level = 0; - + test_msg.uart_state_depa.uart_b.tx_throughput = 0.0; - - + test_msg.uart_state_depa.uart_ftdi.crc_error_count = 0; - + test_msg.uart_state_depa.uart_ftdi.io_error_count = 0; - + test_msg.uart_state_depa.uart_ftdi.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_ftdi.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_ftdi.tx_buffer_level = 0; - + test_msg.uart_state_depa.uart_ftdi.tx_throughput = 0.06599999964237213; - sbp_message_send(&sbp_state, SbpMsgUartStateDepa, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgUartStateDepa, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgUartStateDepa, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgUartStateDepa, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.avg == -1, "incorrect value for last_msg.msg.uart_state_depa.latency.avg, expected -1, is %d", last_msg.msg.uart_state_depa.latency.avg); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.current == -1, "incorrect value for last_msg.msg.uart_state_depa.latency.current, expected -1, is %d", last_msg.msg.uart_state_depa.latency.current); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.lmax == 0, "incorrect value for last_msg.msg.uart_state_depa.latency.lmax, expected 0, is %d", last_msg.msg.uart_state_depa.latency.lmax); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.lmin == 0, "incorrect value for last_msg.msg.uart_state_depa.latency.lmin, expected 0, is %d", last_msg.msg.uart_state_depa.latency.lmin); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_a.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_a.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.tx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.tx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.tx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_a.tx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_a.tx_throughput); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_b.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_b.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.tx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.tx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.tx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_b.tx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_b.tx_throughput); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput * 100 - 0.0659999996424 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput, expected 0.0659999996424, is %s", last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput); + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.avg == -1, + "incorrect value for last_msg.msg.uart_state_depa.latency.avg, " + "expected -1, is %d", + last_msg.msg.uart_state_depa.latency.avg); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.current == -1, + "incorrect value for last_msg.msg.uart_state_depa.latency.current, " + "expected -1, is %d", + last_msg.msg.uart_state_depa.latency.current); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.lmax == 0, + "incorrect value for last_msg.msg.uart_state_depa.latency.lmax, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.latency.lmax); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.lmin == 0, + "incorrect value for last_msg.msg.uart_state_depa.latency.lmin, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.latency.lmin); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.crc_error_count); + + ck_assert_msg( + last_msg.msg.uart_state_depa.uart_a.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.io_error_count, expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.rx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_a.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.tx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.tx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.tx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.tx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_a.tx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.crc_error_count); + + ck_assert_msg( + last_msg.msg.uart_state_depa.uart_b.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.io_error_count, expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.rx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_b.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.tx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.tx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.tx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.tx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_b.tx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.io_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput, " + "expected 0.0, is %s", + last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput * 100 - + 0.0659999996424 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput, " + "expected 0.0659999996424, is %s", + last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -642,136 +1026,233 @@ START_TEST( test_auto_check_sbp_piksi_MsgUartStateDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x18, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x18, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,138,75,6,60,0,0,0,0,0,0,80,113,201,61,0,0,0,0,0,0,0,0,2,0,145,237,252,62,0,0,0,0,0,0,0,0,38,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,112,111, }; + u8 encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 138, 75, 6, 60, + 0, 0, 0, 0, 0, 0, 80, 113, 201, 61, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 145, 237, 252, 62, 0, 0, 0, 0, + 0, 0, 0, 0, 38, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 112, 111, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.uart_state_depa.latency.avg = -1; - + test_msg.uart_state_depa.latency.current = -1; - + test_msg.uart_state_depa.latency.lmax = 0; - + test_msg.uart_state_depa.latency.lmin = 0; - - + test_msg.uart_state_depa.uart_a.crc_error_count = 0; - + test_msg.uart_state_depa.uart_a.io_error_count = 0; - + test_msg.uart_state_depa.uart_a.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_a.rx_throughput = 0.008196720853447914; - + test_msg.uart_state_depa.uart_a.tx_buffer_level = 0; - + test_msg.uart_state_depa.uart_a.tx_throughput = 0.0; - - + test_msg.uart_state_depa.uart_b.crc_error_count = 0; - + test_msg.uart_state_depa.uart_b.io_error_count = 0; - + test_msg.uart_state_depa.uart_b.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_b.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_b.tx_buffer_level = 2; - + test_msg.uart_state_depa.uart_b.tx_throughput = 0.09836065769195557; - - + test_msg.uart_state_depa.uart_ftdi.crc_error_count = 0; - + test_msg.uart_state_depa.uart_ftdi.io_error_count = 0; - + test_msg.uart_state_depa.uart_ftdi.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_ftdi.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_ftdi.tx_buffer_level = 38; - + test_msg.uart_state_depa.uart_ftdi.tx_throughput = 0.49399998784065247; - sbp_message_send(&sbp_state, SbpMsgUartStateDepa, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgUartStateDepa, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgUartStateDepa, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgUartStateDepa, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.avg == -1, "incorrect value for last_msg.msg.uart_state_depa.latency.avg, expected -1, is %d", last_msg.msg.uart_state_depa.latency.avg); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.current == -1, "incorrect value for last_msg.msg.uart_state_depa.latency.current, expected -1, is %d", last_msg.msg.uart_state_depa.latency.current); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.lmax == 0, "incorrect value for last_msg.msg.uart_state_depa.latency.lmax, expected 0, is %d", last_msg.msg.uart_state_depa.latency.lmax); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.lmin == 0, "incorrect value for last_msg.msg.uart_state_depa.latency.lmin, expected 0, is %d", last_msg.msg.uart_state_depa.latency.lmin); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.rx_throughput * 100 - 0.00819672085345 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_a.rx_throughput, expected 0.00819672085345, is %s", last_msg.msg.uart_state_depa.uart_a.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.tx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.tx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.tx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_a.tx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_a.tx_throughput); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_b.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_b.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.tx_buffer_level == 2, "incorrect value for last_msg.msg.uart_state_depa.uart_b.tx_buffer_level, expected 2, is %d", last_msg.msg.uart_state_depa.uart_b.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.tx_throughput * 100 - 0.098360657692 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_b.tx_throughput, expected 0.098360657692, is %s", last_msg.msg.uart_state_depa.uart_b.tx_throughput); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level == 38, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level, expected 38, is %d", last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput * 100 - 0.493999987841 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput, expected 0.493999987841, is %s", last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput); + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.avg == -1, + "incorrect value for last_msg.msg.uart_state_depa.latency.avg, " + "expected -1, is %d", + last_msg.msg.uart_state_depa.latency.avg); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.current == -1, + "incorrect value for last_msg.msg.uart_state_depa.latency.current, " + "expected -1, is %d", + last_msg.msg.uart_state_depa.latency.current); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.lmax == 0, + "incorrect value for last_msg.msg.uart_state_depa.latency.lmax, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.latency.lmax); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.lmin == 0, + "incorrect value for last_msg.msg.uart_state_depa.latency.lmin, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.latency.lmin); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.crc_error_count); + + ck_assert_msg( + last_msg.msg.uart_state_depa.uart_a.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.io_error_count, expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.rx_throughput * 100 - + 0.00819672085345 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.rx_throughput, expected " + "0.00819672085345, is %s", + last_msg.msg.uart_state_depa.uart_a.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.tx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.tx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.tx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.tx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_a.tx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.crc_error_count); + + ck_assert_msg( + last_msg.msg.uart_state_depa.uart_b.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.io_error_count, expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.rx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_b.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.tx_buffer_level == 2, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.tx_buffer_level, " + "expected 2, is %d", + last_msg.msg.uart_state_depa.uart_b.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.tx_throughput * 100 - + 0.098360657692 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.tx_throughput, expected " + "0.098360657692, is %s", + last_msg.msg.uart_state_depa.uart_b.tx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.io_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput, " + "expected 0.0, is %s", + last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level == 38, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level, " + "expected 38, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput * 100 - + 0.493999987841 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput, " + "expected 0.493999987841, is %s", + last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -779,139 +1260,236 @@ START_TEST( test_auto_check_sbp_piksi_MsgUartStateDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x18, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x18, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,24,0,195,4,58,166,155,68,60,0,0,0,0,0,0,0,0,2,0,166,155,68,60,0,0,0,0,0,0,0,0,2,0,236,81,168,63,0,0,0,0,0,0,0,0,50,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,22,72, }; + u8 encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 166, 155, 68, 60, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 166, 155, 68, 60, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 236, 81, 168, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 22, 72, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.uart_state_depa.latency.avg = -1; - + test_msg.uart_state_depa.latency.current = -1; - + test_msg.uart_state_depa.latency.lmax = 0; - + test_msg.uart_state_depa.latency.lmin = 0; - - + test_msg.uart_state_depa.uart_a.crc_error_count = 0; - + test_msg.uart_state_depa.uart_a.io_error_count = 0; - + test_msg.uart_state_depa.uart_a.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_a.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_a.tx_buffer_level = 2; - + test_msg.uart_state_depa.uart_a.tx_throughput = 0.012000000104308128; - - + test_msg.uart_state_depa.uart_b.crc_error_count = 0; - + test_msg.uart_state_depa.uart_b.io_error_count = 0; - + test_msg.uart_state_depa.uart_b.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_b.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_b.tx_buffer_level = 2; - + test_msg.uart_state_depa.uart_b.tx_throughput = 0.012000000104308128; - - + test_msg.uart_state_depa.uart_ftdi.crc_error_count = 0; - + test_msg.uart_state_depa.uart_ftdi.io_error_count = 0; - + test_msg.uart_state_depa.uart_ftdi.rx_buffer_level = 0; - + test_msg.uart_state_depa.uart_ftdi.rx_throughput = 0.0; - + test_msg.uart_state_depa.uart_ftdi.tx_buffer_level = 50; - + test_msg.uart_state_depa.uart_ftdi.tx_throughput = 1.315000057220459; - sbp_message_send(&sbp_state, SbpMsgUartStateDepa, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgUartStateDepa, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgUartStateDepa, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgUartStateDepa, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.avg == -1, "incorrect value for last_msg.msg.uart_state_depa.latency.avg, expected -1, is %d", last_msg.msg.uart_state_depa.latency.avg); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.current == -1, "incorrect value for last_msg.msg.uart_state_depa.latency.current, expected -1, is %d", last_msg.msg.uart_state_depa.latency.current); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.lmax == 0, "incorrect value for last_msg.msg.uart_state_depa.latency.lmax, expected 0, is %d", last_msg.msg.uart_state_depa.latency.lmax); - - ck_assert_msg(last_msg.msg.uart_state_depa.latency.lmin == 0, "incorrect value for last_msg.msg.uart_state_depa.latency.lmin, expected 0, is %d", last_msg.msg.uart_state_depa.latency.lmin); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_a.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_a.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_a.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_a.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.tx_buffer_level == 2, "incorrect value for last_msg.msg.uart_state_depa.uart_a.tx_buffer_level, expected 2, is %d", last_msg.msg.uart_state_depa.uart_a.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.tx_throughput * 100 - 0.0120000001043 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_a.tx_throughput, expected 0.0120000001043, is %s", last_msg.msg.uart_state_depa.uart_a.tx_throughput); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_b.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_b.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_b.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_b.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.tx_buffer_level == 2, "incorrect value for last_msg.msg.uart_state_depa.uart_b.tx_buffer_level, expected 2, is %d", last_msg.msg.uart_state_depa.uart_b.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.tx_throughput * 100 - 0.0120000001043 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_b.tx_throughput, expected 0.0120000001043, is %s", last_msg.msg.uart_state_depa.uart_b.tx_throughput); - - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.io_error_count == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.io_error_count, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.io_error_count); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level == 0, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level, expected 0, is %d", last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput * 100 - 0.0 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput, expected 0.0, is %s", last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput); - - ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level == 50, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level, expected 50, is %d", last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level); - - ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput * 100 - 1.31500005722 * 100) < 0.05, "incorrect value for last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput, expected 1.31500005722, is %s", last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput); + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.avg == -1, + "incorrect value for last_msg.msg.uart_state_depa.latency.avg, " + "expected -1, is %d", + last_msg.msg.uart_state_depa.latency.avg); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.current == -1, + "incorrect value for last_msg.msg.uart_state_depa.latency.current, " + "expected -1, is %d", + last_msg.msg.uart_state_depa.latency.current); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.lmax == 0, + "incorrect value for last_msg.msg.uart_state_depa.latency.lmax, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.latency.lmax); + + ck_assert_msg( + last_msg.msg.uart_state_depa.latency.lmin == 0, + "incorrect value for last_msg.msg.uart_state_depa.latency.lmin, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.latency.lmin); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.crc_error_count); + + ck_assert_msg( + last_msg.msg.uart_state_depa.uart_a.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.io_error_count, expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_a.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.rx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_a.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_a.tx_buffer_level == 2, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.tx_buffer_level, " + "expected 2, is %d", + last_msg.msg.uart_state_depa.uart_a.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_a.tx_throughput * 100 - + 0.0120000001043 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_a.tx_throughput, expected " + "0.0120000001043, is %s", + last_msg.msg.uart_state_depa.uart_a.tx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.crc_error_count); + + ck_assert_msg( + last_msg.msg.uart_state_depa.uart_b.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.io_error_count, expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_b.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.rx_throughput, expected " + "0.0, is %s", + last_msg.msg.uart_state_depa.uart_b.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_b.tx_buffer_level == 2, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.tx_buffer_level, " + "expected 2, is %d", + last_msg.msg.uart_state_depa.uart_b.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_b.tx_throughput * 100 - + 0.0120000001043 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_b.tx_throughput, expected " + "0.0120000001043, is %s", + last_msg.msg.uart_state_depa.uart_b.tx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.crc_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.io_error_count == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.io_error_count, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.io_error_count); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level == 0, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level, " + "expected 0, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.rx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput * 100 - + 0.0 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput, " + "expected 0.0, is %s", + last_msg.msg.uart_state_depa.uart_ftdi.rx_throughput); + + ck_assert_msg(last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level == 50, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level, " + "expected 50, is %d", + last_msg.msg.uart_state_depa.uart_ftdi.tx_buffer_level); + + ck_assert_msg((last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput * 100 - + 1.31500005722 * 100) < 0.05, + "incorrect value for " + "last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput, " + "expected 1.31500005722, is %s", + last_msg.msg.uart_state_depa.uart_ftdi.tx_throughput); } } END_TEST -Suite* auto_check_sbp_piksi_MsgUartStateDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_piksi_MsgUartStateDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgUartStateDepA"); +Suite *auto_check_sbp_piksi_MsgUartStateDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_piksi_MsgUartStateDepA"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_piksi_MsgUartStateDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_piksi_MsgUartStateDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_sbas_MsgSbasRaw.c b/c/test/auto_check_sbp_sbas_MsgSbasRaw.c index 32ef9498f..594cb139d 100644 --- a/c/test/auto_check_sbp_sbas_MsgSbasRaw.c +++ b/c/test/auto_check_sbp_sbas_MsgSbasRaw.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/sbas/test_MsgSbasRaw.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/sbas/test_MsgSbasRaw.yaml by generate.py. Do not +// modify by hand! #include -#include // for debugging -#include // for malloc -#include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_sbas_MsgSbasRaw ) -{ +START_TEST(test_auto_check_sbp_sbas_MsgSbasRaw) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_sbas_MsgSbasRaw ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,144 +90,241 @@ START_TEST( test_auto_check_sbp_sbas_MsgSbasRaw ) logging_reset(); - sbp_callback_register(&sbp_state, 0x7777, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x7777, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,119,119,28,200,34,131,2,201,228,233,29,4,23,255,0,23,255,0,23,255,127,240,2,255,192,3,127,247,255,127,247,255,229,229,238,170,175,255,240,167,14, }; + u8 encoded_frame[] = { + 85, 119, 119, 28, 200, 34, 131, 2, 201, 228, 233, 29, 4, 23, + 255, 0, 23, 255, 0, 23, 255, 127, 240, 2, 255, 192, 3, 127, + 247, 255, 127, 247, 255, 229, 229, 238, 170, 175, 255, 240, 167, 14, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.sbas_raw.data[0] = 23; - + test_msg.sbas_raw.data[1] = 255; - + test_msg.sbas_raw.data[2] = 0; - + test_msg.sbas_raw.data[3] = 23; - + test_msg.sbas_raw.data[4] = 255; - + test_msg.sbas_raw.data[5] = 0; - + test_msg.sbas_raw.data[6] = 23; - + test_msg.sbas_raw.data[7] = 255; - + test_msg.sbas_raw.data[8] = 127; - + test_msg.sbas_raw.data[9] = 240; - + test_msg.sbas_raw.data[10] = 2; - + test_msg.sbas_raw.data[11] = 255; - + test_msg.sbas_raw.data[12] = 192; - + test_msg.sbas_raw.data[13] = 3; - + test_msg.sbas_raw.data[14] = 127; - + test_msg.sbas_raw.data[15] = 247; - + test_msg.sbas_raw.data[16] = 255; - + test_msg.sbas_raw.data[17] = 127; - + test_msg.sbas_raw.data[18] = 247; - + test_msg.sbas_raw.data[19] = 255; - + test_msg.sbas_raw.data[20] = 229; - + test_msg.sbas_raw.data[21] = 229; - + test_msg.sbas_raw.data[22] = 238; - + test_msg.sbas_raw.data[23] = 170; - + test_msg.sbas_raw.data[24] = 175; - + test_msg.sbas_raw.data[25] = 255; - + test_msg.sbas_raw.data[26] = 240; - + test_msg.sbas_raw.message_type = 4; - - + test_msg.sbas_raw.sid.code = 2; - + test_msg.sbas_raw.sid.sat = 131; - + test_msg.sbas_raw.tow = 501867721; sbp_message_send(&sbp_state, SbpMsgSbasRaw, 51228, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 51228, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgSbasRaw, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.sbas_raw.data[0] == 23, "incorrect value for last_msg.msg.sbas_raw.data[0], expected 23, is %d", last_msg.msg.sbas_raw.data[0]); - ck_assert_msg(last_msg.msg.sbas_raw.data[1] == 255, "incorrect value for last_msg.msg.sbas_raw.data[1], expected 255, is %d", last_msg.msg.sbas_raw.data[1]); - ck_assert_msg(last_msg.msg.sbas_raw.data[2] == 0, "incorrect value for last_msg.msg.sbas_raw.data[2], expected 0, is %d", last_msg.msg.sbas_raw.data[2]); - ck_assert_msg(last_msg.msg.sbas_raw.data[3] == 23, "incorrect value for last_msg.msg.sbas_raw.data[3], expected 23, is %d", last_msg.msg.sbas_raw.data[3]); - ck_assert_msg(last_msg.msg.sbas_raw.data[4] == 255, "incorrect value for last_msg.msg.sbas_raw.data[4], expected 255, is %d", last_msg.msg.sbas_raw.data[4]); - ck_assert_msg(last_msg.msg.sbas_raw.data[5] == 0, "incorrect value for last_msg.msg.sbas_raw.data[5], expected 0, is %d", last_msg.msg.sbas_raw.data[5]); - ck_assert_msg(last_msg.msg.sbas_raw.data[6] == 23, "incorrect value for last_msg.msg.sbas_raw.data[6], expected 23, is %d", last_msg.msg.sbas_raw.data[6]); - ck_assert_msg(last_msg.msg.sbas_raw.data[7] == 255, "incorrect value for last_msg.msg.sbas_raw.data[7], expected 255, is %d", last_msg.msg.sbas_raw.data[7]); - ck_assert_msg(last_msg.msg.sbas_raw.data[8] == 127, "incorrect value for last_msg.msg.sbas_raw.data[8], expected 127, is %d", last_msg.msg.sbas_raw.data[8]); - ck_assert_msg(last_msg.msg.sbas_raw.data[9] == 240, "incorrect value for last_msg.msg.sbas_raw.data[9], expected 240, is %d", last_msg.msg.sbas_raw.data[9]); - ck_assert_msg(last_msg.msg.sbas_raw.data[10] == 2, "incorrect value for last_msg.msg.sbas_raw.data[10], expected 2, is %d", last_msg.msg.sbas_raw.data[10]); - ck_assert_msg(last_msg.msg.sbas_raw.data[11] == 255, "incorrect value for last_msg.msg.sbas_raw.data[11], expected 255, is %d", last_msg.msg.sbas_raw.data[11]); - ck_assert_msg(last_msg.msg.sbas_raw.data[12] == 192, "incorrect value for last_msg.msg.sbas_raw.data[12], expected 192, is %d", last_msg.msg.sbas_raw.data[12]); - ck_assert_msg(last_msg.msg.sbas_raw.data[13] == 3, "incorrect value for last_msg.msg.sbas_raw.data[13], expected 3, is %d", last_msg.msg.sbas_raw.data[13]); - ck_assert_msg(last_msg.msg.sbas_raw.data[14] == 127, "incorrect value for last_msg.msg.sbas_raw.data[14], expected 127, is %d", last_msg.msg.sbas_raw.data[14]); - ck_assert_msg(last_msg.msg.sbas_raw.data[15] == 247, "incorrect value for last_msg.msg.sbas_raw.data[15], expected 247, is %d", last_msg.msg.sbas_raw.data[15]); - ck_assert_msg(last_msg.msg.sbas_raw.data[16] == 255, "incorrect value for last_msg.msg.sbas_raw.data[16], expected 255, is %d", last_msg.msg.sbas_raw.data[16]); - ck_assert_msg(last_msg.msg.sbas_raw.data[17] == 127, "incorrect value for last_msg.msg.sbas_raw.data[17], expected 127, is %d", last_msg.msg.sbas_raw.data[17]); - ck_assert_msg(last_msg.msg.sbas_raw.data[18] == 247, "incorrect value for last_msg.msg.sbas_raw.data[18], expected 247, is %d", last_msg.msg.sbas_raw.data[18]); - ck_assert_msg(last_msg.msg.sbas_raw.data[19] == 255, "incorrect value for last_msg.msg.sbas_raw.data[19], expected 255, is %d", last_msg.msg.sbas_raw.data[19]); - ck_assert_msg(last_msg.msg.sbas_raw.data[20] == 229, "incorrect value for last_msg.msg.sbas_raw.data[20], expected 229, is %d", last_msg.msg.sbas_raw.data[20]); - ck_assert_msg(last_msg.msg.sbas_raw.data[21] == 229, "incorrect value for last_msg.msg.sbas_raw.data[21], expected 229, is %d", last_msg.msg.sbas_raw.data[21]); - ck_assert_msg(last_msg.msg.sbas_raw.data[22] == 238, "incorrect value for last_msg.msg.sbas_raw.data[22], expected 238, is %d", last_msg.msg.sbas_raw.data[22]); - ck_assert_msg(last_msg.msg.sbas_raw.data[23] == 170, "incorrect value for last_msg.msg.sbas_raw.data[23], expected 170, is %d", last_msg.msg.sbas_raw.data[23]); - ck_assert_msg(last_msg.msg.sbas_raw.data[24] == 175, "incorrect value for last_msg.msg.sbas_raw.data[24], expected 175, is %d", last_msg.msg.sbas_raw.data[24]); - ck_assert_msg(last_msg.msg.sbas_raw.data[25] == 255, "incorrect value for last_msg.msg.sbas_raw.data[25], expected 255, is %d", last_msg.msg.sbas_raw.data[25]); - ck_assert_msg(last_msg.msg.sbas_raw.data[26] == 240, "incorrect value for last_msg.msg.sbas_raw.data[26], expected 240, is %d", last_msg.msg.sbas_raw.data[26]); - - ck_assert_msg(last_msg.msg.sbas_raw.message_type == 4, "incorrect value for last_msg.msg.sbas_raw.message_type, expected 4, is %d", last_msg.msg.sbas_raw.message_type); - - - ck_assert_msg(last_msg.msg.sbas_raw.sid.code == 2, "incorrect value for last_msg.msg.sbas_raw.sid.code, expected 2, is %d", last_msg.msg.sbas_raw.sid.code); - - ck_assert_msg(last_msg.msg.sbas_raw.sid.sat == 131, "incorrect value for last_msg.msg.sbas_raw.sid.sat, expected 131, is %d", last_msg.msg.sbas_raw.sid.sat); - - ck_assert_msg(last_msg.msg.sbas_raw.tow == 501867721, "incorrect value for last_msg.msg.sbas_raw.tow, expected 501867721, is %d", last_msg.msg.sbas_raw.tow); + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.sbas_raw.data[0] == 23, + "incorrect value for last_msg.msg.sbas_raw.data[0], expected 23, is %d", + last_msg.msg.sbas_raw.data[0]); + ck_assert_msg(last_msg.msg.sbas_raw.data[1] == 255, + "incorrect value for last_msg.msg.sbas_raw.data[1], expected " + "255, is %d", + last_msg.msg.sbas_raw.data[1]); + ck_assert_msg( + last_msg.msg.sbas_raw.data[2] == 0, + "incorrect value for last_msg.msg.sbas_raw.data[2], expected 0, is %d", + last_msg.msg.sbas_raw.data[2]); + ck_assert_msg( + last_msg.msg.sbas_raw.data[3] == 23, + "incorrect value for last_msg.msg.sbas_raw.data[3], expected 23, is %d", + last_msg.msg.sbas_raw.data[3]); + ck_assert_msg(last_msg.msg.sbas_raw.data[4] == 255, + "incorrect value for last_msg.msg.sbas_raw.data[4], expected " + "255, is %d", + last_msg.msg.sbas_raw.data[4]); + ck_assert_msg( + last_msg.msg.sbas_raw.data[5] == 0, + "incorrect value for last_msg.msg.sbas_raw.data[5], expected 0, is %d", + last_msg.msg.sbas_raw.data[5]); + ck_assert_msg( + last_msg.msg.sbas_raw.data[6] == 23, + "incorrect value for last_msg.msg.sbas_raw.data[6], expected 23, is %d", + last_msg.msg.sbas_raw.data[6]); + ck_assert_msg(last_msg.msg.sbas_raw.data[7] == 255, + "incorrect value for last_msg.msg.sbas_raw.data[7], expected " + "255, is %d", + last_msg.msg.sbas_raw.data[7]); + ck_assert_msg(last_msg.msg.sbas_raw.data[8] == 127, + "incorrect value for last_msg.msg.sbas_raw.data[8], expected " + "127, is %d", + last_msg.msg.sbas_raw.data[8]); + ck_assert_msg(last_msg.msg.sbas_raw.data[9] == 240, + "incorrect value for last_msg.msg.sbas_raw.data[9], expected " + "240, is %d", + last_msg.msg.sbas_raw.data[9]); + ck_assert_msg( + last_msg.msg.sbas_raw.data[10] == 2, + "incorrect value for last_msg.msg.sbas_raw.data[10], expected 2, is %d", + last_msg.msg.sbas_raw.data[10]); + ck_assert_msg(last_msg.msg.sbas_raw.data[11] == 255, + "incorrect value for last_msg.msg.sbas_raw.data[11], " + "expected 255, is %d", + last_msg.msg.sbas_raw.data[11]); + ck_assert_msg(last_msg.msg.sbas_raw.data[12] == 192, + "incorrect value for last_msg.msg.sbas_raw.data[12], " + "expected 192, is %d", + last_msg.msg.sbas_raw.data[12]); + ck_assert_msg( + last_msg.msg.sbas_raw.data[13] == 3, + "incorrect value for last_msg.msg.sbas_raw.data[13], expected 3, is %d", + last_msg.msg.sbas_raw.data[13]); + ck_assert_msg(last_msg.msg.sbas_raw.data[14] == 127, + "incorrect value for last_msg.msg.sbas_raw.data[14], " + "expected 127, is %d", + last_msg.msg.sbas_raw.data[14]); + ck_assert_msg(last_msg.msg.sbas_raw.data[15] == 247, + "incorrect value for last_msg.msg.sbas_raw.data[15], " + "expected 247, is %d", + last_msg.msg.sbas_raw.data[15]); + ck_assert_msg(last_msg.msg.sbas_raw.data[16] == 255, + "incorrect value for last_msg.msg.sbas_raw.data[16], " + "expected 255, is %d", + last_msg.msg.sbas_raw.data[16]); + ck_assert_msg(last_msg.msg.sbas_raw.data[17] == 127, + "incorrect value for last_msg.msg.sbas_raw.data[17], " + "expected 127, is %d", + last_msg.msg.sbas_raw.data[17]); + ck_assert_msg(last_msg.msg.sbas_raw.data[18] == 247, + "incorrect value for last_msg.msg.sbas_raw.data[18], " + "expected 247, is %d", + last_msg.msg.sbas_raw.data[18]); + ck_assert_msg(last_msg.msg.sbas_raw.data[19] == 255, + "incorrect value for last_msg.msg.sbas_raw.data[19], " + "expected 255, is %d", + last_msg.msg.sbas_raw.data[19]); + ck_assert_msg(last_msg.msg.sbas_raw.data[20] == 229, + "incorrect value for last_msg.msg.sbas_raw.data[20], " + "expected 229, is %d", + last_msg.msg.sbas_raw.data[20]); + ck_assert_msg(last_msg.msg.sbas_raw.data[21] == 229, + "incorrect value for last_msg.msg.sbas_raw.data[21], " + "expected 229, is %d", + last_msg.msg.sbas_raw.data[21]); + ck_assert_msg(last_msg.msg.sbas_raw.data[22] == 238, + "incorrect value for last_msg.msg.sbas_raw.data[22], " + "expected 238, is %d", + last_msg.msg.sbas_raw.data[22]); + ck_assert_msg(last_msg.msg.sbas_raw.data[23] == 170, + "incorrect value for last_msg.msg.sbas_raw.data[23], " + "expected 170, is %d", + last_msg.msg.sbas_raw.data[23]); + ck_assert_msg(last_msg.msg.sbas_raw.data[24] == 175, + "incorrect value for last_msg.msg.sbas_raw.data[24], " + "expected 175, is %d", + last_msg.msg.sbas_raw.data[24]); + ck_assert_msg(last_msg.msg.sbas_raw.data[25] == 255, + "incorrect value for last_msg.msg.sbas_raw.data[25], " + "expected 255, is %d", + last_msg.msg.sbas_raw.data[25]); + ck_assert_msg(last_msg.msg.sbas_raw.data[26] == 240, + "incorrect value for last_msg.msg.sbas_raw.data[26], " + "expected 240, is %d", + last_msg.msg.sbas_raw.data[26]); + + ck_assert_msg(last_msg.msg.sbas_raw.message_type == 4, + "incorrect value for last_msg.msg.sbas_raw.message_type, " + "expected 4, is %d", + last_msg.msg.sbas_raw.message_type); + + ck_assert_msg( + last_msg.msg.sbas_raw.sid.code == 2, + "incorrect value for last_msg.msg.sbas_raw.sid.code, expected 2, is %d", + last_msg.msg.sbas_raw.sid.code); + + ck_assert_msg(last_msg.msg.sbas_raw.sid.sat == 131, + "incorrect value for last_msg.msg.sbas_raw.sid.sat, expected " + "131, is %d", + last_msg.msg.sbas_raw.sid.sat); + ck_assert_msg(last_msg.msg.sbas_raw.tow == 501867721, + "incorrect value for last_msg.msg.sbas_raw.tow, expected " + "501867721, is %d", + last_msg.msg.sbas_raw.tow); } } END_TEST -Suite* auto_check_sbp_sbas_MsgSbasRaw_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_sbas_MsgSbasRaw"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_sbas_MsgSbasRaw"); +Suite *auto_check_sbp_sbas_MsgSbasRaw_suite(void) { + Suite *s = + suite_create("SBP generated test suite: auto_check_sbp_sbas_MsgSbasRaw"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_sbas_MsgSbasRaw"); tcase_add_test(tc_acq, test_auto_check_sbp_sbas_MsgSbasRaw); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_settings_MsgSettingsReadByIndexDone.c b/c/test/auto_check_sbp_settings_MsgSettingsReadByIndexDone.c index 401044134..1ea5bc5bb 100644 --- a/c/test/auto_check_sbp_settings_MsgSettingsReadByIndexDone.c +++ b/c/test/auto_check_sbp_settings_MsgSettingsReadByIndexDone.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexDone.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexDone.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_settings_MsgSettingsReadByIndexDone ) -{ +START_TEST(test_auto_check_sbp_settings_MsgSettingsReadByIndexDone) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsReadByIndexDone ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,44 +90,53 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsReadByIndexDone ) logging_reset(); - sbp_callback_register(&sbp_state, 0xa6, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xa6, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,166,0,246,215,0,163,58, }; + u8 encoded_frame[] = { + 85, 166, 0, 246, 215, 0, 163, 58, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - sbp_message_send(&sbp_state, SbpMsgSettingsReadByIndexDone, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSettingsReadByIndexDone, 55286, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadByIndexDone, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); + "msg_callback: sender_id decoded incorrectly"); + ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadByIndexDone, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); } } END_TEST -Suite* auto_check_sbp_settings_MsgSettingsReadByIndexDone_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_settings_MsgSettingsReadByIndexDone"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_settings_MsgSettingsReadByIndexDone"); - tcase_add_test(tc_acq, test_auto_check_sbp_settings_MsgSettingsReadByIndexDone); +Suite *auto_check_sbp_settings_MsgSettingsReadByIndexDone_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_settings_MsgSettingsReadByIndexDone"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_settings_MsgSettingsReadByIndexDone"); + tcase_add_test(tc_acq, + test_auto_check_sbp_settings_MsgSettingsReadByIndexDone); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/auto_check_sbp_settings_MsgSettingsReadByIndexReq.c b/c/test/auto_check_sbp_settings_MsgSettingsReadByIndexReq.c index 99ac93e2c..fd5d55f6c 100644 --- a/c/test/auto_check_sbp_settings_MsgSettingsReadByIndexReq.c +++ b/c/test/auto_check_sbp_settings_MsgSettingsReadByIndexReq.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexReq.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_settings_MsgSettingsReadByIndexReq ) -{ +START_TEST(test_auto_check_sbp_settings_MsgSettingsReadByIndexReq) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsReadByIndexReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,48 +90,61 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsReadByIndexReq ) logging_reset(); - sbp_callback_register(&sbp_state, 0xa2, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xa2, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,162,0,122,123,2,244,34,235,23, }; + u8 encoded_frame[] = { + 85, 162, 0, 122, 123, 2, 244, 34, 235, 23, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.settings_read_by_index_req.index = 8948; - sbp_message_send(&sbp_state, SbpMsgSettingsReadByIndexReq, 31610, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSettingsReadByIndexReq, 31610, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 31610, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadByIndexReq, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.settings_read_by_index_req.index == 8948, "incorrect value for last_msg.msg.settings_read_by_index_req.index, expected 8948, is %d", last_msg.msg.settings_read_by_index_req.index); + ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadByIndexReq, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + ck_assert_msg( + last_msg.msg.settings_read_by_index_req.index == 8948, + "incorrect value for last_msg.msg.settings_read_by_index_req.index, " + "expected 8948, is %d", + last_msg.msg.settings_read_by_index_req.index); } } END_TEST -Suite* auto_check_sbp_settings_MsgSettingsReadByIndexReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_settings_MsgSettingsReadByIndexReq"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_settings_MsgSettingsReadByIndexReq"); - tcase_add_test(tc_acq, test_auto_check_sbp_settings_MsgSettingsReadByIndexReq); +Suite *auto_check_sbp_settings_MsgSettingsReadByIndexReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_settings_MsgSettingsReadByIndexReq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_settings_MsgSettingsReadByIndexReq"); + tcase_add_test(tc_acq, + test_auto_check_sbp_settings_MsgSettingsReadByIndexReq); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/auto_check_sbp_settings_MsgSettingsReadByIndexResp.c b/c/test/auto_check_sbp_settings_MsgSettingsReadByIndexResp.c index e28f53387..f0ceee159 100644 --- a/c/test/auto_check_sbp_settings_MsgSettingsReadByIndexResp.c +++ b/c/test/auto_check_sbp_settings_MsgSettingsReadByIndexResp.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexResp.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_settings_MsgSettingsReadByIndexResp ) -{ +START_TEST(test_auto_check_sbp_settings_MsgSettingsReadByIndexResp) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsReadByIndexResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,56 +90,96 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsReadByIndexResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xa7, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xa7, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,167,0,246,215,78,0,0,116,101,108,101,109,101,116,114,121,95,114,97,100,105,111,0,99,111,110,102,105,103,117,114,97,116,105,111,110,95,115,116,114,105,110,103,0,65,84,38,70,44,65,84,83,49,61,49,49,53,44,65,84,83,50,61,49,50,56,44,65,84,83,53,61,48,44,65,84,38,87,44,65,84,90,0,248,233, }; + u8 encoded_frame[] = { + 85, 167, 0, 246, 215, 78, 0, 0, 116, 101, 108, 101, 109, + 101, 116, 114, 121, 95, 114, 97, 100, 105, 111, 0, 99, 111, + 110, 102, 105, 103, 117, 114, 97, 116, 105, 111, 110, 95, 115, + 116, 114, 105, 110, 103, 0, 65, 84, 38, 70, 44, 65, 84, + 83, 49, 61, 49, 49, 53, 44, 65, 84, 83, 50, 61, 49, + 50, 56, 44, 65, 84, 83, 53, 61, 48, 44, 65, 84, 38, + 87, 44, 65, 84, 90, 0, 248, 233, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.settings_read_by_index_resp.index = 0; - - - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "telemetry_radio") == true, "Can't assign section 0"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "configuration_string") == true, "Can't assign section 1"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "AT&F,ATS1=115,ATS2=128,ATS5=0,AT&W,ATZ") == true, "Can't assign section 2"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&test_msg.settings_read_by_index_resp) == 76, "String not encoded properly"); - sbp_message_send(&sbp_state, SbpMsgSettingsReadByIndexResp, 55286, &test_msg, &dummy_write); + ck_assert_msg( + sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, "telemetry_radio") == true, + "Can't assign section 0"); + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, + "configuration_string") == true, + "Can't assign section 1"); + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, + "AT&F,ATS1=115,ATS2=128,ATS5=0,AT&W,ATZ") == true, + "Can't assign section 2"); + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len( + &test_msg.settings_read_by_index_resp) == 76, + "String not encoded properly"); + + sbp_message_send(&sbp_state, SbpMsgSettingsReadByIndexResp, 55286, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadByIndexResp, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.settings_read_by_index_resp.index == 0, "incorrect value for last_msg.msg.settings_read_by_index_resp.index, expected 0, is %d", last_msg.msg.settings_read_by_index_resp.index); - - - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&last_msg.msg.settings_read_by_index_resp) == 76, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 0), "telemetry_radio") == 0, "Section 0 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 1), "configuration_string") == 0, "Section 1 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 2), "AT&F,ATS1=115,ATS2=128,ATS5=0,AT&W,ATZ") == 0, "Section 2 not decoded properly"); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadByIndexResp, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.settings_read_by_index_resp.index == 0, + "incorrect value for last_msg.msg.settings_read_by_index_resp.index, " + "expected 0, is %d", + last_msg.msg.settings_read_by_index_resp.index); + + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len( + &last_msg.msg.settings_read_by_index_resp) == 76, + "Invalid encoded len"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 0), + "telemetry_radio") == 0, + "Section 0 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 1), + "configuration_string") == 0, + "Section 1 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 2), + "AT&F,ATS1=115,ATS2=128,ATS5=0,AT&W,ATZ") == 0, + "Section 2 not decoded properly"); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -151,58 +187,99 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsReadByIndexResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xa7, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xa7, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,167,0,246,215,35,1,0,117,97,114,116,95,102,116,100,105,0,109,111,100,101,0,83,66,80,0,101,110,117,109,58,83,66,80,44,78,77,69,65,0,167,243, }; + u8 encoded_frame[] = { + 85, 167, 0, 246, 215, 35, 1, 0, 117, 97, 114, 116, 95, 102, 116, + 100, 105, 0, 109, 111, 100, 101, 0, 83, 66, 80, 0, 101, 110, 117, + 109, 58, 83, 66, 80, 44, 78, 77, 69, 65, 0, 167, 243, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.settings_read_by_index_resp.index = 1; - - - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "uart_ftdi") == true, "Can't assign section 0"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "mode") == true, "Can't assign section 1"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "SBP") == true, "Can't assign section 2"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "enum:SBP,NMEA") == true, "Can't assign section 3"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&test_msg.settings_read_by_index_resp) == 33, "String not encoded properly"); - sbp_message_send(&sbp_state, SbpMsgSettingsReadByIndexResp, 55286, &test_msg, &dummy_write); + ck_assert_msg( + sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, "uart_ftdi") == true, + "Can't assign section 0"); + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, "mode") == true, + "Can't assign section 1"); + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, "SBP") == true, + "Can't assign section 2"); + ck_assert_msg( + sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, "enum:SBP,NMEA") == true, + "Can't assign section 3"); + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len( + &test_msg.settings_read_by_index_resp) == 33, + "String not encoded properly"); + + sbp_message_send(&sbp_state, SbpMsgSettingsReadByIndexResp, 55286, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadByIndexResp, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.settings_read_by_index_resp.index == 1, "incorrect value for last_msg.msg.settings_read_by_index_resp.index, expected 1, is %d", last_msg.msg.settings_read_by_index_resp.index); - - - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&last_msg.msg.settings_read_by_index_resp) == 33, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 0), "uart_ftdi") == 0, "Section 0 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 1), "mode") == 0, "Section 1 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 2), "SBP") == 0, "Section 2 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 3), "enum:SBP,NMEA") == 0, "Section 3 not decoded properly"); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadByIndexResp, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.settings_read_by_index_resp.index == 1, + "incorrect value for last_msg.msg.settings_read_by_index_resp.index, " + "expected 1, is %d", + last_msg.msg.settings_read_by_index_resp.index); + + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len( + &last_msg.msg.settings_read_by_index_resp) == 33, + "Invalid encoded len"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 0), + "uart_ftdi") == 0, + "Section 0 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 1), + "mode") == 0, + "Section 1 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 2), + "SBP") == 0, + "Section 2 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 3), + "enum:SBP,NMEA") == 0, + "Section 3 not decoded properly"); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -210,56 +287,92 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsReadByIndexResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xa7, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xa7, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,167,0,246,215,35,2,0,117,97,114,116,95,102,116,100,105,0,115,98,112,95,109,101,115,115,97,103,101,95,109,97,115,107,0,54,53,53,51,53,0,4,56, }; + u8 encoded_frame[] = { + 85, 167, 0, 246, 215, 35, 2, 0, 117, 97, 114, + 116, 95, 102, 116, 100, 105, 0, 115, 98, 112, 95, + 109, 101, 115, 115, 97, 103, 101, 95, 109, 97, 115, + 107, 0, 54, 53, 53, 51, 53, 0, 4, 56, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.settings_read_by_index_resp.index = 2; - - - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "uart_ftdi") == true, "Can't assign section 0"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "sbp_message_mask") == true, "Can't assign section 1"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "65535") == true, "Can't assign section 2"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&test_msg.settings_read_by_index_resp) == 33, "String not encoded properly"); - sbp_message_send(&sbp_state, SbpMsgSettingsReadByIndexResp, 55286, &test_msg, &dummy_write); + ck_assert_msg( + sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, "uart_ftdi") == true, + "Can't assign section 0"); + ck_assert_msg( + sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, "sbp_message_mask") == true, + "Can't assign section 1"); + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, "65535") == true, + "Can't assign section 2"); + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len( + &test_msg.settings_read_by_index_resp) == 33, + "String not encoded properly"); + + sbp_message_send(&sbp_state, SbpMsgSettingsReadByIndexResp, 55286, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadByIndexResp, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.settings_read_by_index_resp.index == 2, "incorrect value for last_msg.msg.settings_read_by_index_resp.index, expected 2, is %d", last_msg.msg.settings_read_by_index_resp.index); - - - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&last_msg.msg.settings_read_by_index_resp) == 33, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 0), "uart_ftdi") == 0, "Section 0 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 1), "sbp_message_mask") == 0, "Section 1 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 2), "65535") == 0, "Section 2 not decoded properly"); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadByIndexResp, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.settings_read_by_index_resp.index == 2, + "incorrect value for last_msg.msg.settings_read_by_index_resp.index, " + "expected 2, is %d", + last_msg.msg.settings_read_by_index_resp.index); + + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len( + &last_msg.msg.settings_read_by_index_resp) == 33, + "Invalid encoded len"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 0), + "uart_ftdi") == 0, + "Section 0 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 1), + "sbp_message_mask") == 0, + "Section 1 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 2), + "65535") == 0, + "Section 2 not decoded properly"); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -267,56 +380,91 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsReadByIndexResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xa7, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xa7, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,167,0,246,215,29,3,0,117,97,114,116,95,102,116,100,105,0,98,97,117,100,114,97,116,101,0,49,48,48,48,48,48,48,0,242,146, }; + u8 encoded_frame[] = { + 85, 167, 0, 246, 215, 29, 3, 0, 117, 97, 114, 116, 95, + 102, 116, 100, 105, 0, 98, 97, 117, 100, 114, 97, 116, 101, + 0, 49, 48, 48, 48, 48, 48, 48, 0, 242, 146, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.settings_read_by_index_resp.index = 3; - - - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "uart_ftdi") == true, "Can't assign section 0"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "baudrate") == true, "Can't assign section 1"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "1000000") == true, "Can't assign section 2"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&test_msg.settings_read_by_index_resp) == 27, "String not encoded properly"); - sbp_message_send(&sbp_state, SbpMsgSettingsReadByIndexResp, 55286, &test_msg, &dummy_write); + ck_assert_msg( + sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, "uart_ftdi") == true, + "Can't assign section 0"); + ck_assert_msg( + sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, "baudrate") == true, + "Can't assign section 1"); + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, "1000000") == true, + "Can't assign section 2"); + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len( + &test_msg.settings_read_by_index_resp) == 27, + "String not encoded properly"); + + sbp_message_send(&sbp_state, SbpMsgSettingsReadByIndexResp, 55286, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadByIndexResp, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.settings_read_by_index_resp.index == 3, "incorrect value for last_msg.msg.settings_read_by_index_resp.index, expected 3, is %d", last_msg.msg.settings_read_by_index_resp.index); - - - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&last_msg.msg.settings_read_by_index_resp) == 27, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 0), "uart_ftdi") == 0, "Section 0 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 1), "baudrate") == 0, "Section 1 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 2), "1000000") == 0, "Section 2 not decoded properly"); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadByIndexResp, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.settings_read_by_index_resp.index == 3, + "incorrect value for last_msg.msg.settings_read_by_index_resp.index, " + "expected 3, is %d", + last_msg.msg.settings_read_by_index_resp.index); + + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len( + &last_msg.msg.settings_read_by_index_resp) == 27, + "Invalid encoded len"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 0), + "uart_ftdi") == 0, + "Section 0 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 1), + "baudrate") == 0, + "Section 1 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 2), + "1000000") == 0, + "Section 2 not decoded properly"); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -324,62 +472,105 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsReadByIndexResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xa7, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xa7, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,167,0,246,215,36,4,0,117,97,114,116,95,117,97,114,116,97,0,109,111,100,101,0,83,66,80,0,101,110,117,109,58,83,66,80,44,78,77,69,65,0,22,4, }; + u8 encoded_frame[] = { + 85, 167, 0, 246, 215, 36, 4, 0, 117, 97, 114, 116, 95, 117, 97, + 114, 116, 97, 0, 109, 111, 100, 101, 0, 83, 66, 80, 0, 101, 110, + 117, 109, 58, 83, 66, 80, 44, 78, 77, 69, 65, 0, 22, 4, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.settings_read_by_index_resp.index = 4; - - - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "uart_uarta") == true, "Can't assign section 0"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "mode") == true, "Can't assign section 1"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "SBP") == true, "Can't assign section 2"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg.settings_read_by_index_resp, "enum:SBP,NMEA") == true, "Can't assign section 3"); - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&test_msg.settings_read_by_index_resp) == 34, "String not encoded properly"); - sbp_message_send(&sbp_state, SbpMsgSettingsReadByIndexResp, 55286, &test_msg, &dummy_write); + ck_assert_msg( + sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, "uart_uarta") == true, + "Can't assign section 0"); + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, "mode") == true, + "Can't assign section 1"); + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, "SBP") == true, + "Can't assign section 2"); + ck_assert_msg( + sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg.settings_read_by_index_resp, "enum:SBP,NMEA") == true, + "Can't assign section 3"); + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len( + &test_msg.settings_read_by_index_resp) == 34, + "String not encoded properly"); + + sbp_message_send(&sbp_state, SbpMsgSettingsReadByIndexResp, 55286, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadByIndexResp, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.settings_read_by_index_resp.index == 4, "incorrect value for last_msg.msg.settings_read_by_index_resp.index, expected 4, is %d", last_msg.msg.settings_read_by_index_resp.index); - - - ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&last_msg.msg.settings_read_by_index_resp) == 34, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 0), "uart_uarta") == 0, "Section 0 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 1), "mode") == 0, "Section 1 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 2), "SBP") == 0, "Section 2 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg.msg.settings_read_by_index_resp, 3), "enum:SBP,NMEA") == 0, "Section 3 not decoded properly"); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadByIndexResp, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.settings_read_by_index_resp.index == 4, + "incorrect value for last_msg.msg.settings_read_by_index_resp.index, " + "expected 4, is %d", + last_msg.msg.settings_read_by_index_resp.index); + + ck_assert_msg(sbp_msg_settings_read_by_index_resp_setting_encoded_len( + &last_msg.msg.settings_read_by_index_resp) == 34, + "Invalid encoded len"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 0), + "uart_uarta") == 0, + "Section 0 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 1), + "mode") == 0, + "Section 1 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 2), + "SBP") == 0, + "Section 2 not decoded properly"); + ck_assert_msg( + strcmp(sbp_msg_settings_read_by_index_resp_setting_get_section( + &last_msg.msg.settings_read_by_index_resp, 3), + "enum:SBP,NMEA") == 0, + "Section 3 not decoded properly"); } } END_TEST -Suite* auto_check_sbp_settings_MsgSettingsReadByIndexResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_settings_MsgSettingsReadByIndexResp"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_settings_MsgSettingsReadByIndexResp"); - tcase_add_test(tc_acq, test_auto_check_sbp_settings_MsgSettingsReadByIndexResp); +Suite *auto_check_sbp_settings_MsgSettingsReadByIndexResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_settings_MsgSettingsReadByIndexResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_settings_MsgSettingsReadByIndexResp"); + tcase_add_test(tc_acq, + test_auto_check_sbp_settings_MsgSettingsReadByIndexResp); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/auto_check_sbp_settings_MsgSettingsReadReq.c b/c/test/auto_check_sbp_settings_MsgSettingsReadReq.c index ddc7f5f74..2cf6d5762 100644 --- a/c/test/auto_check_sbp_settings_MsgSettingsReadReq.c +++ b/c/test/auto_check_sbp_settings_MsgSettingsReadReq.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadReq.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_settings_MsgSettingsReadReq ) -{ +START_TEST(test_auto_check_sbp_settings_MsgSettingsReadReq) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsReadReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,53 +90,74 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsReadReq ) logging_reset(); - sbp_callback_register(&sbp_state, 0xa4, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xa4, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,164,0,152,214,26,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,181,228, }; + u8 encoded_frame[] = { + 85, 164, 0, 152, 214, 26, 115, 101, 99, 116, 105, 111, + 110, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, + 110, 103, 45, 110, 97, 109, 101, 0, 181, 228, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - ck_assert_msg(sbp_msg_settings_read_req_setting_add_section(&test_msg.settings_read_req, "section-name") == true, "Can't assign section 0"); - ck_assert_msg(sbp_msg_settings_read_req_setting_add_section(&test_msg.settings_read_req, "setting-name") == true, "Can't assign section 1"); - ck_assert_msg(sbp_msg_settings_read_req_setting_encoded_len(&test_msg.settings_read_req) == 26, "String not encoded properly"); - sbp_message_send(&sbp_state, SbpMsgSettingsReadReq, 54936, &test_msg, &dummy_write); + ck_assert_msg(sbp_msg_settings_read_req_setting_add_section( + &test_msg.settings_read_req, "section-name") == true, + "Can't assign section 0"); + ck_assert_msg(sbp_msg_settings_read_req_setting_add_section( + &test_msg.settings_read_req, "setting-name") == true, + "Can't assign section 1"); + ck_assert_msg(sbp_msg_settings_read_req_setting_encoded_len( + &test_msg.settings_read_req) == 26, + "String not encoded properly"); + + sbp_message_send(&sbp_state, SbpMsgSettingsReadReq, 54936, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 54936, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadReq, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSettingsReadReq, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_settings_read_req_setting_encoded_len(&last_msg.msg.settings_read_req) == 26, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_settings_read_req_setting_get_section(&last_msg.msg.settings_read_req, 0), "section-name") == 0, "Section 0 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_req_setting_get_section(&last_msg.msg.settings_read_req, 1), "setting-name") == 0, "Section 1 not decoded properly"); + ck_assert_msg(sbp_msg_settings_read_req_setting_encoded_len( + &last_msg.msg.settings_read_req) == 26, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_settings_read_req_setting_get_section( + &last_msg.msg.settings_read_req, 0), + "section-name") == 0, + "Section 0 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_settings_read_req_setting_get_section( + &last_msg.msg.settings_read_req, 1), + "setting-name") == 0, + "Section 1 not decoded properly"); } } END_TEST -Suite* auto_check_sbp_settings_MsgSettingsReadReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_settings_MsgSettingsReadReq"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_settings_MsgSettingsReadReq"); +Suite *auto_check_sbp_settings_MsgSettingsReadReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_settings_MsgSettingsReadReq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_settings_MsgSettingsReadReq"); tcase_add_test(tc_acq, test_auto_check_sbp_settings_MsgSettingsReadReq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_settings_MsgSettingsReadResp.c b/c/test/auto_check_sbp_settings_MsgSettingsReadResp.c index 3fffebb2c..98cf3ee19 100644 --- a/c/test/auto_check_sbp_settings_MsgSettingsReadResp.c +++ b/c/test/auto_check_sbp_settings_MsgSettingsReadResp.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadResp.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_settings_MsgSettingsReadResp ) -{ +START_TEST(test_auto_check_sbp_settings_MsgSettingsReadResp) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsReadResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,57 +90,92 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsReadResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xa5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xa5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,165,0,136,240,66,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,203,199, }; + u8 encoded_frame[] = { + 85, 165, 0, 136, 240, 66, 115, 101, 99, 116, 105, 111, 110, + 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, + 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, + 45, 118, 97, 108, 117, 101, 0, 101, 110, 117, 109, 59, 118, + 97, 108, 117, 101, 49, 44, 118, 97, 108, 117, 101, 50, 44, + 118, 97, 108, 117, 101, 51, 0, 203, 199, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - ck_assert_msg(sbp_msg_settings_read_resp_setting_add_section(&test_msg.settings_read_resp, "section-name") == true, "Can't assign section 0"); - ck_assert_msg(sbp_msg_settings_read_resp_setting_add_section(&test_msg.settings_read_resp, "setting-name") == true, "Can't assign section 1"); - ck_assert_msg(sbp_msg_settings_read_resp_setting_add_section(&test_msg.settings_read_resp, "setting-value") == true, "Can't assign section 2"); - ck_assert_msg(sbp_msg_settings_read_resp_setting_add_section(&test_msg.settings_read_resp, "enum;value1,value2,value3") == true, "Can't assign section 3"); - ck_assert_msg(sbp_msg_settings_read_resp_setting_encoded_len(&test_msg.settings_read_resp) == 66, "String not encoded properly"); - sbp_message_send(&sbp_state, SbpMsgSettingsReadResp, 61576, &test_msg, &dummy_write); + ck_assert_msg(sbp_msg_settings_read_resp_setting_add_section( + &test_msg.settings_read_resp, "section-name") == true, + "Can't assign section 0"); + ck_assert_msg(sbp_msg_settings_read_resp_setting_add_section( + &test_msg.settings_read_resp, "setting-name") == true, + "Can't assign section 1"); + ck_assert_msg(sbp_msg_settings_read_resp_setting_add_section( + &test_msg.settings_read_resp, "setting-value") == true, + "Can't assign section 2"); + ck_assert_msg( + sbp_msg_settings_read_resp_setting_add_section( + &test_msg.settings_read_resp, "enum;value1,value2,value3") == true, + "Can't assign section 3"); + ck_assert_msg(sbp_msg_settings_read_resp_setting_encoded_len( + &test_msg.settings_read_resp) == 66, + "String not encoded properly"); + + sbp_message_send(&sbp_state, SbpMsgSettingsReadResp, 61576, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61576, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSettingsReadResp, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSettingsReadResp, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_settings_read_resp_setting_encoded_len(&last_msg.msg.settings_read_resp) == 66, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_settings_read_resp_setting_get_section(&last_msg.msg.settings_read_resp, 0), "section-name") == 0, "Section 0 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_resp_setting_get_section(&last_msg.msg.settings_read_resp, 1), "setting-name") == 0, "Section 1 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_resp_setting_get_section(&last_msg.msg.settings_read_resp, 2), "setting-value") == 0, "Section 2 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_read_resp_setting_get_section(&last_msg.msg.settings_read_resp, 3), "enum;value1,value2,value3") == 0, "Section 3 not decoded properly"); + ck_assert_msg(sbp_msg_settings_read_resp_setting_encoded_len( + &last_msg.msg.settings_read_resp) == 66, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_settings_read_resp_setting_get_section( + &last_msg.msg.settings_read_resp, 0), + "section-name") == 0, + "Section 0 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_settings_read_resp_setting_get_section( + &last_msg.msg.settings_read_resp, 1), + "setting-name") == 0, + "Section 1 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_settings_read_resp_setting_get_section( + &last_msg.msg.settings_read_resp, 2), + "setting-value") == 0, + "Section 2 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_settings_read_resp_setting_get_section( + &last_msg.msg.settings_read_resp, 3), + "enum;value1,value2,value3") == 0, + "Section 3 not decoded properly"); } } END_TEST -Suite* auto_check_sbp_settings_MsgSettingsReadResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_settings_MsgSettingsReadResp"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_settings_MsgSettingsReadResp"); +Suite *auto_check_sbp_settings_MsgSettingsReadResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_settings_MsgSettingsReadResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_settings_MsgSettingsReadResp"); tcase_add_test(tc_acq, test_auto_check_sbp_settings_MsgSettingsReadResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_settings_MsgSettingsRegister.c b/c/test/auto_check_sbp_settings_MsgSettingsRegister.c index 5e14a66cd..a9a3496e1 100644 --- a/c/test/auto_check_sbp_settings_MsgSettingsRegister.c +++ b/c/test/auto_check_sbp_settings_MsgSettingsRegister.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegister.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegister.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_settings_MsgSettingsRegister ) -{ +START_TEST(test_auto_check_sbp_settings_MsgSettingsRegister) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsRegister ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,57 +90,92 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsRegister ) logging_reset(); - sbp_callback_register(&sbp_state, 0xae, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xae, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,174,0,84,6,66,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,142,235, }; + u8 encoded_frame[] = { + 85, 174, 0, 84, 6, 66, 115, 101, 99, 116, 105, 111, 110, + 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, + 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, + 45, 118, 97, 108, 117, 101, 0, 101, 110, 117, 109, 59, 118, + 97, 108, 117, 101, 49, 44, 118, 97, 108, 117, 101, 50, 44, + 118, 97, 108, 117, 101, 51, 0, 142, 235, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - ck_assert_msg(sbp_msg_settings_register_setting_add_section(&test_msg.settings_register, "section-name") == true, "Can't assign section 0"); - ck_assert_msg(sbp_msg_settings_register_setting_add_section(&test_msg.settings_register, "setting-name") == true, "Can't assign section 1"); - ck_assert_msg(sbp_msg_settings_register_setting_add_section(&test_msg.settings_register, "setting-value") == true, "Can't assign section 2"); - ck_assert_msg(sbp_msg_settings_register_setting_add_section(&test_msg.settings_register, "enum;value1,value2,value3") == true, "Can't assign section 3"); - ck_assert_msg(sbp_msg_settings_register_setting_encoded_len(&test_msg.settings_register) == 66, "String not encoded properly"); - sbp_message_send(&sbp_state, SbpMsgSettingsRegister, 1620, &test_msg, &dummy_write); + ck_assert_msg(sbp_msg_settings_register_setting_add_section( + &test_msg.settings_register, "section-name") == true, + "Can't assign section 0"); + ck_assert_msg(sbp_msg_settings_register_setting_add_section( + &test_msg.settings_register, "setting-name") == true, + "Can't assign section 1"); + ck_assert_msg(sbp_msg_settings_register_setting_add_section( + &test_msg.settings_register, "setting-value") == true, + "Can't assign section 2"); + ck_assert_msg( + sbp_msg_settings_register_setting_add_section( + &test_msg.settings_register, "enum;value1,value2,value3") == true, + "Can't assign section 3"); + ck_assert_msg(sbp_msg_settings_register_setting_encoded_len( + &test_msg.settings_register) == 66, + "String not encoded properly"); + + sbp_message_send(&sbp_state, SbpMsgSettingsRegister, 1620, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1620, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSettingsRegister, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSettingsRegister, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_settings_register_setting_encoded_len(&last_msg.msg.settings_register) == 66, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_settings_register_setting_get_section(&last_msg.msg.settings_register, 0), "section-name") == 0, "Section 0 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_register_setting_get_section(&last_msg.msg.settings_register, 1), "setting-name") == 0, "Section 1 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_register_setting_get_section(&last_msg.msg.settings_register, 2), "setting-value") == 0, "Section 2 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_register_setting_get_section(&last_msg.msg.settings_register, 3), "enum;value1,value2,value3") == 0, "Section 3 not decoded properly"); + ck_assert_msg(sbp_msg_settings_register_setting_encoded_len( + &last_msg.msg.settings_register) == 66, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_settings_register_setting_get_section( + &last_msg.msg.settings_register, 0), + "section-name") == 0, + "Section 0 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_settings_register_setting_get_section( + &last_msg.msg.settings_register, 1), + "setting-name") == 0, + "Section 1 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_settings_register_setting_get_section( + &last_msg.msg.settings_register, 2), + "setting-value") == 0, + "Section 2 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_settings_register_setting_get_section( + &last_msg.msg.settings_register, 3), + "enum;value1,value2,value3") == 0, + "Section 3 not decoded properly"); } } END_TEST -Suite* auto_check_sbp_settings_MsgSettingsRegister_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_settings_MsgSettingsRegister"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_settings_MsgSettingsRegister"); +Suite *auto_check_sbp_settings_MsgSettingsRegister_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_settings_MsgSettingsRegister"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_settings_MsgSettingsRegister"); tcase_add_test(tc_acq, test_auto_check_sbp_settings_MsgSettingsRegister); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_settings_MsgSettingsRegisterResp.c b/c/test/auto_check_sbp_settings_MsgSettingsRegisterResp.c index 7fa396aa9..4f3ed2503 100644 --- a/c/test/auto_check_sbp_settings_MsgSettingsRegisterResp.c +++ b/c/test/auto_check_sbp_settings_MsgSettingsRegisterResp.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegisterResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegisterResp.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_settings_MsgSettingsRegisterResp ) -{ +START_TEST(test_auto_check_sbp_settings_MsgSettingsRegisterResp) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsRegisterResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,61 +90,102 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsRegisterResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0x1af, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x1af, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,175,1,41,213,67,18,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,82,16, }; + u8 encoded_frame[] = { + 85, 175, 1, 41, 213, 67, 18, 115, 101, 99, 116, 105, 111, + 110, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, + 103, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, + 103, 45, 118, 97, 108, 117, 101, 0, 101, 110, 117, 109, 59, + 118, 97, 108, 117, 101, 49, 44, 118, 97, 108, 117, 101, 50, + 44, 118, 97, 108, 117, 101, 51, 0, 82, 16, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - ck_assert_msg(sbp_msg_settings_register_resp_setting_add_section(&test_msg.settings_register_resp, "section-name") == true, "Can't assign section 0"); - ck_assert_msg(sbp_msg_settings_register_resp_setting_add_section(&test_msg.settings_register_resp, "setting-name") == true, "Can't assign section 1"); - ck_assert_msg(sbp_msg_settings_register_resp_setting_add_section(&test_msg.settings_register_resp, "setting-value") == true, "Can't assign section 2"); - ck_assert_msg(sbp_msg_settings_register_resp_setting_add_section(&test_msg.settings_register_resp, "enum;value1,value2,value3") == true, "Can't assign section 3"); - ck_assert_msg(sbp_msg_settings_register_resp_setting_encoded_len(&test_msg.settings_register_resp) == 66, "String not encoded properly"); - + + ck_assert_msg(sbp_msg_settings_register_resp_setting_add_section( + &test_msg.settings_register_resp, "section-name") == true, + "Can't assign section 0"); + ck_assert_msg(sbp_msg_settings_register_resp_setting_add_section( + &test_msg.settings_register_resp, "setting-name") == true, + "Can't assign section 1"); + ck_assert_msg( + sbp_msg_settings_register_resp_setting_add_section( + &test_msg.settings_register_resp, "setting-value") == true, + "Can't assign section 2"); + ck_assert_msg(sbp_msg_settings_register_resp_setting_add_section( + &test_msg.settings_register_resp, + "enum;value1,value2,value3") == true, + "Can't assign section 3"); + ck_assert_msg(sbp_msg_settings_register_resp_setting_encoded_len( + &test_msg.settings_register_resp) == 66, + "String not encoded properly"); + test_msg.settings_register_resp.status = 18; - sbp_message_send(&sbp_state, SbpMsgSettingsRegisterResp, 54569, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSettingsRegisterResp, 54569, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 54569, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSettingsRegisterResp, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_settings_register_resp_setting_encoded_len(&last_msg.msg.settings_register_resp) == 66, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_settings_register_resp_setting_get_section(&last_msg.msg.settings_register_resp, 0), "section-name") == 0, "Section 0 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_register_resp_setting_get_section(&last_msg.msg.settings_register_resp, 1), "setting-name") == 0, "Section 1 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_register_resp_setting_get_section(&last_msg.msg.settings_register_resp, 2), "setting-value") == 0, "Section 2 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_register_resp_setting_get_section(&last_msg.msg.settings_register_resp, 3), "enum;value1,value2,value3") == 0, "Section 3 not decoded properly"); - - ck_assert_msg(last_msg.msg.settings_register_resp.status == 18, "incorrect value for last_msg.msg.settings_register_resp.status, expected 18, is %d", last_msg.msg.settings_register_resp.status); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSettingsRegisterResp, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(sbp_msg_settings_register_resp_setting_encoded_len( + &last_msg.msg.settings_register_resp) == 66, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_settings_register_resp_setting_get_section( + &last_msg.msg.settings_register_resp, 0), + "section-name") == 0, + "Section 0 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_settings_register_resp_setting_get_section( + &last_msg.msg.settings_register_resp, 1), + "setting-name") == 0, + "Section 1 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_settings_register_resp_setting_get_section( + &last_msg.msg.settings_register_resp, 2), + "setting-value") == 0, + "Section 2 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_settings_register_resp_setting_get_section( + &last_msg.msg.settings_register_resp, 3), + "enum;value1,value2,value3") == 0, + "Section 3 not decoded properly"); + + ck_assert_msg( + last_msg.msg.settings_register_resp.status == 18, + "incorrect value for last_msg.msg.settings_register_resp.status, " + "expected 18, is %d", + last_msg.msg.settings_register_resp.status); } } END_TEST -Suite* auto_check_sbp_settings_MsgSettingsRegisterResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_settings_MsgSettingsRegisterResp"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_settings_MsgSettingsRegisterResp"); +Suite *auto_check_sbp_settings_MsgSettingsRegisterResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_settings_MsgSettingsRegisterResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_settings_MsgSettingsRegisterResp"); tcase_add_test(tc_acq, test_auto_check_sbp_settings_MsgSettingsRegisterResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_settings_MsgSettingsSave.c b/c/test/auto_check_sbp_settings_MsgSettingsSave.c index 6405ea278..54a3f2d40 100644 --- a/c/test/auto_check_sbp_settings_MsgSettingsSave.c +++ b/c/test/auto_check_sbp_settings_MsgSettingsSave.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsSave.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsSave.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_settings_MsgSettingsSave ) -{ +START_TEST(test_auto_check_sbp_settings_MsgSettingsSave) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsSave ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,43 +90,50 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsSave ) logging_reset(); - sbp_callback_register(&sbp_state, 0xa1, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xa1, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,161,0,162,224,0,123,67, }; + u8 encoded_frame[] = { + 85, 161, 0, 162, 224, 0, 123, 67, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - sbp_message_send(&sbp_state, SbpMsgSettingsSave, 57506, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSettingsSave, 57506, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 57506, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSettingsSave, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSettingsSave, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - } } END_TEST -Suite* auto_check_sbp_settings_MsgSettingsSave_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_settings_MsgSettingsSave"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_settings_MsgSettingsSave"); +Suite *auto_check_sbp_settings_MsgSettingsSave_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_settings_MsgSettingsSave"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_settings_MsgSettingsSave"); tcase_add_test(tc_acq, test_auto_check_sbp_settings_MsgSettingsSave); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_settings_MsgSettingsWrite.c b/c/test/auto_check_sbp_settings_MsgSettingsWrite.c index c06c78752..f25fc1ca8 100644 --- a/c/test/auto_check_sbp_settings_MsgSettingsWrite.c +++ b/c/test/auto_check_sbp_settings_MsgSettingsWrite.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWrite.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWrite.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_settings_MsgSettingsWrite ) -{ +START_TEST(test_auto_check_sbp_settings_MsgSettingsWrite) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsWrite ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,55 +90,82 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsWrite ) logging_reset(); - sbp_callback_register(&sbp_state, 0xa0, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xa0, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,160,0,123,0,40,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,244,10, }; + u8 encoded_frame[] = { + 85, 160, 0, 123, 0, 40, 115, 101, 99, 116, 105, 111, + 110, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, + 110, 103, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, + 105, 110, 103, 45, 118, 97, 108, 117, 101, 0, 244, 10, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - ck_assert_msg(sbp_msg_settings_write_setting_add_section(&test_msg.settings_write, "section-name") == true, "Can't assign section 0"); - ck_assert_msg(sbp_msg_settings_write_setting_add_section(&test_msg.settings_write, "setting-name") == true, "Can't assign section 1"); - ck_assert_msg(sbp_msg_settings_write_setting_add_section(&test_msg.settings_write, "setting-value") == true, "Can't assign section 2"); - ck_assert_msg(sbp_msg_settings_write_setting_encoded_len(&test_msg.settings_write) == 40, "String not encoded properly"); - sbp_message_send(&sbp_state, SbpMsgSettingsWrite, 123, &test_msg, &dummy_write); + ck_assert_msg(sbp_msg_settings_write_setting_add_section( + &test_msg.settings_write, "section-name") == true, + "Can't assign section 0"); + ck_assert_msg(sbp_msg_settings_write_setting_add_section( + &test_msg.settings_write, "setting-name") == true, + "Can't assign section 1"); + ck_assert_msg(sbp_msg_settings_write_setting_add_section( + &test_msg.settings_write, "setting-value") == true, + "Can't assign section 2"); + ck_assert_msg(sbp_msg_settings_write_setting_encoded_len( + &test_msg.settings_write) == 40, + "String not encoded properly"); + + sbp_message_send(&sbp_state, SbpMsgSettingsWrite, 123, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSettingsWrite, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSettingsWrite, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_settings_write_setting_encoded_len(&last_msg.msg.settings_write) == 40, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_settings_write_setting_get_section(&last_msg.msg.settings_write, 0), "section-name") == 0, "Section 0 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_write_setting_get_section(&last_msg.msg.settings_write, 1), "setting-name") == 0, "Section 1 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_write_setting_get_section(&last_msg.msg.settings_write, 2), "setting-value") == 0, "Section 2 not decoded properly"); + ck_assert_msg(sbp_msg_settings_write_setting_encoded_len( + &last_msg.msg.settings_write) == 40, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_settings_write_setting_get_section( + &last_msg.msg.settings_write, 0), + "section-name") == 0, + "Section 0 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_settings_write_setting_get_section( + &last_msg.msg.settings_write, 1), + "setting-name") == 0, + "Section 1 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_settings_write_setting_get_section( + &last_msg.msg.settings_write, 2), + "setting-value") == 0, + "Section 2 not decoded properly"); } } END_TEST -Suite* auto_check_sbp_settings_MsgSettingsWrite_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_settings_MsgSettingsWrite"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_settings_MsgSettingsWrite"); +Suite *auto_check_sbp_settings_MsgSettingsWrite_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_settings_MsgSettingsWrite"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_settings_MsgSettingsWrite"); tcase_add_test(tc_acq, test_auto_check_sbp_settings_MsgSettingsWrite); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_settings_MsgSettingsWriteResp.c b/c/test/auto_check_sbp_settings_MsgSettingsWriteResp.c index d8d480b56..4c3d34e8b 100644 --- a/c/test/auto_check_sbp_settings_MsgSettingsWriteResp.c +++ b/c/test/auto_check_sbp_settings_MsgSettingsWriteResp.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWriteResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWriteResp.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_settings_MsgSettingsWriteResp ) -{ +START_TEST(test_auto_check_sbp_settings_MsgSettingsWriteResp) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsWriteResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,61 +90,100 @@ START_TEST( test_auto_check_sbp_settings_MsgSettingsWriteResp ) logging_reset(); - sbp_callback_register(&sbp_state, 0xaf, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xaf, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,175,0,91,55,67,152,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,54,0, }; + u8 encoded_frame[] = { + 85, 175, 0, 91, 55, 67, 152, 115, 101, 99, 116, 105, 111, + 110, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, + 103, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, + 103, 45, 118, 97, 108, 117, 101, 0, 101, 110, 117, 109, 59, + 118, 97, 108, 117, 101, 49, 44, 118, 97, 108, 117, 101, 50, + 44, 118, 97, 108, 117, 101, 51, 0, 54, 0, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - ck_assert_msg(sbp_msg_settings_write_resp_setting_add_section(&test_msg.settings_write_resp, "section-name") == true, "Can't assign section 0"); - ck_assert_msg(sbp_msg_settings_write_resp_setting_add_section(&test_msg.settings_write_resp, "setting-name") == true, "Can't assign section 1"); - ck_assert_msg(sbp_msg_settings_write_resp_setting_add_section(&test_msg.settings_write_resp, "setting-value") == true, "Can't assign section 2"); - ck_assert_msg(sbp_msg_settings_write_resp_setting_add_section(&test_msg.settings_write_resp, "enum;value1,value2,value3") == true, "Can't assign section 3"); - ck_assert_msg(sbp_msg_settings_write_resp_setting_encoded_len(&test_msg.settings_write_resp) == 66, "String not encoded properly"); - + + ck_assert_msg(sbp_msg_settings_write_resp_setting_add_section( + &test_msg.settings_write_resp, "section-name") == true, + "Can't assign section 0"); + ck_assert_msg(sbp_msg_settings_write_resp_setting_add_section( + &test_msg.settings_write_resp, "setting-name") == true, + "Can't assign section 1"); + ck_assert_msg(sbp_msg_settings_write_resp_setting_add_section( + &test_msg.settings_write_resp, "setting-value") == true, + "Can't assign section 2"); + ck_assert_msg( + sbp_msg_settings_write_resp_setting_add_section( + &test_msg.settings_write_resp, "enum;value1,value2,value3") == true, + "Can't assign section 3"); + ck_assert_msg(sbp_msg_settings_write_resp_setting_encoded_len( + &test_msg.settings_write_resp) == 66, + "String not encoded properly"); + test_msg.settings_write_resp.status = 152; - sbp_message_send(&sbp_state, SbpMsgSettingsWriteResp, 14171, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSettingsWriteResp, 14171, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 14171, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSettingsWriteResp, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSettingsWriteResp, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(sbp_msg_settings_write_resp_setting_encoded_len(&last_msg.msg.settings_write_resp) == 66, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_settings_write_resp_setting_get_section(&last_msg.msg.settings_write_resp, 0), "section-name") == 0, "Section 0 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_write_resp_setting_get_section(&last_msg.msg.settings_write_resp, 1), "setting-name") == 0, "Section 1 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_write_resp_setting_get_section(&last_msg.msg.settings_write_resp, 2), "setting-value") == 0, "Section 2 not decoded properly"); - ck_assert_msg(strcmp(sbp_msg_settings_write_resp_setting_get_section(&last_msg.msg.settings_write_resp, 3), "enum;value1,value2,value3") == 0, "Section 3 not decoded properly"); - - ck_assert_msg(last_msg.msg.settings_write_resp.status == 152, "incorrect value for last_msg.msg.settings_write_resp.status, expected 152, is %d", last_msg.msg.settings_write_resp.status); + ck_assert_msg(sbp_msg_settings_write_resp_setting_encoded_len( + &last_msg.msg.settings_write_resp) == 66, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_settings_write_resp_setting_get_section( + &last_msg.msg.settings_write_resp, 0), + "section-name") == 0, + "Section 0 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_settings_write_resp_setting_get_section( + &last_msg.msg.settings_write_resp, 1), + "setting-name") == 0, + "Section 1 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_settings_write_resp_setting_get_section( + &last_msg.msg.settings_write_resp, 2), + "setting-value") == 0, + "Section 2 not decoded properly"); + ck_assert_msg(strcmp(sbp_msg_settings_write_resp_setting_get_section( + &last_msg.msg.settings_write_resp, 3), + "enum;value1,value2,value3") == 0, + "Section 3 not decoded properly"); + + ck_assert_msg( + last_msg.msg.settings_write_resp.status == 152, + "incorrect value for last_msg.msg.settings_write_resp.status, expected " + "152, is %d", + last_msg.msg.settings_write_resp.status); } } END_TEST -Suite* auto_check_sbp_settings_MsgSettingsWriteResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_settings_MsgSettingsWriteResp"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_settings_MsgSettingsWriteResp"); +Suite *auto_check_sbp_settings_MsgSettingsWriteResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_settings_MsgSettingsWriteResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_settings_MsgSettingsWriteResp"); tcase_add_test(tc_acq, test_auto_check_sbp_settings_MsgSettingsWriteResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_signing_MsgCertificateChain.c b/c/test/auto_check_sbp_signing_MsgCertificateChain.c index a269338b6..665f80914 100644 --- a/c/test/auto_check_sbp_signing_MsgCertificateChain.c +++ b/c/test/auto_check_sbp_signing_MsgCertificateChain.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChain.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChain.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_signing_MsgCertificateChain ) -{ +START_TEST(test_auto_check_sbp_signing_MsgCertificateChain) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_signing_MsgCertificateChain ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,483 +90,1090 @@ START_TEST( test_auto_check_sbp_signing_MsgCertificateChain ) logging_reset(); - sbp_callback_register(&sbp_state, 0xC09, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xC09, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,9,12,66,0,144,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,20,21,22,23,24,25,26,27,28,29,10,11,12,13,14,15,16,17,18,19,232,7,3,30,12,34,59,21,205,91,7,72,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,227,224, }; + u8 encoded_frame[] = { + 85, 9, 12, 66, 0, 144, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 232, 7, + 3, 30, 12, 34, 59, 21, 205, 91, 7, 72, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 227, 224, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.certificate_chain.corrections_certificate[0] = 20; - + test_msg.certificate_chain.corrections_certificate[1] = 21; - + test_msg.certificate_chain.corrections_certificate[2] = 22; - + test_msg.certificate_chain.corrections_certificate[3] = 23; - + test_msg.certificate_chain.corrections_certificate[4] = 24; - + test_msg.certificate_chain.corrections_certificate[5] = 25; - + test_msg.certificate_chain.corrections_certificate[6] = 26; - + test_msg.certificate_chain.corrections_certificate[7] = 27; - + test_msg.certificate_chain.corrections_certificate[8] = 28; - + test_msg.certificate_chain.corrections_certificate[9] = 29; - + test_msg.certificate_chain.corrections_certificate[10] = 10; - + test_msg.certificate_chain.corrections_certificate[11] = 11; - + test_msg.certificate_chain.corrections_certificate[12] = 12; - + test_msg.certificate_chain.corrections_certificate[13] = 13; - + test_msg.certificate_chain.corrections_certificate[14] = 14; - + test_msg.certificate_chain.corrections_certificate[15] = 15; - + test_msg.certificate_chain.corrections_certificate[16] = 16; - + test_msg.certificate_chain.corrections_certificate[17] = 17; - + test_msg.certificate_chain.corrections_certificate[18] = 18; - + test_msg.certificate_chain.corrections_certificate[19] = 19; - - + test_msg.certificate_chain.expiration.day = 30; - + test_msg.certificate_chain.expiration.hours = 12; - + test_msg.certificate_chain.expiration.minutes = 34; - + test_msg.certificate_chain.expiration.month = 3; - + test_msg.certificate_chain.expiration.ns = 123456789; - + test_msg.certificate_chain.expiration.seconds = 59; - + test_msg.certificate_chain.expiration.year = 2024; - - + test_msg.certificate_chain.intermediate_certificate[0] = 10; - + test_msg.certificate_chain.intermediate_certificate[1] = 11; - + test_msg.certificate_chain.intermediate_certificate[2] = 12; - + test_msg.certificate_chain.intermediate_certificate[3] = 13; - + test_msg.certificate_chain.intermediate_certificate[4] = 14; - + test_msg.certificate_chain.intermediate_certificate[5] = 15; - + test_msg.certificate_chain.intermediate_certificate[6] = 16; - + test_msg.certificate_chain.intermediate_certificate[7] = 17; - + test_msg.certificate_chain.intermediate_certificate[8] = 18; - + test_msg.certificate_chain.intermediate_certificate[9] = 19; - + test_msg.certificate_chain.intermediate_certificate[10] = 0; - + test_msg.certificate_chain.intermediate_certificate[11] = 1; - + test_msg.certificate_chain.intermediate_certificate[12] = 2; - + test_msg.certificate_chain.intermediate_certificate[13] = 3; - + test_msg.certificate_chain.intermediate_certificate[14] = 4; - + test_msg.certificate_chain.intermediate_certificate[15] = 5; - + test_msg.certificate_chain.intermediate_certificate[16] = 6; - + test_msg.certificate_chain.intermediate_certificate[17] = 7; - + test_msg.certificate_chain.intermediate_certificate[18] = 8; - + test_msg.certificate_chain.intermediate_certificate[19] = 9; - - + test_msg.certificate_chain.root_certificate[0] = 0; - + test_msg.certificate_chain.root_certificate[1] = 1; - + test_msg.certificate_chain.root_certificate[2] = 2; - + test_msg.certificate_chain.root_certificate[3] = 3; - + test_msg.certificate_chain.root_certificate[4] = 4; - + test_msg.certificate_chain.root_certificate[5] = 5; - + test_msg.certificate_chain.root_certificate[6] = 6; - + test_msg.certificate_chain.root_certificate[7] = 7; - + test_msg.certificate_chain.root_certificate[8] = 8; - + test_msg.certificate_chain.root_certificate[9] = 9; - + test_msg.certificate_chain.root_certificate[10] = 10; - + test_msg.certificate_chain.root_certificate[11] = 11; - + test_msg.certificate_chain.root_certificate[12] = 12; - + test_msg.certificate_chain.root_certificate[13] = 13; - + test_msg.certificate_chain.root_certificate[14] = 14; - + test_msg.certificate_chain.root_certificate[15] = 15; - + test_msg.certificate_chain.root_certificate[16] = 16; - + test_msg.certificate_chain.root_certificate[17] = 17; - + test_msg.certificate_chain.root_certificate[18] = 18; - + test_msg.certificate_chain.root_certificate[19] = 19; - - - + test_msg.certificate_chain.signature.data[0] = 0; - + test_msg.certificate_chain.signature.data[1] = 1; - + test_msg.certificate_chain.signature.data[2] = 2; - + test_msg.certificate_chain.signature.data[3] = 3; - + test_msg.certificate_chain.signature.data[4] = 4; - + test_msg.certificate_chain.signature.data[5] = 5; - + test_msg.certificate_chain.signature.data[6] = 6; - + test_msg.certificate_chain.signature.data[7] = 7; - + test_msg.certificate_chain.signature.data[8] = 8; - + test_msg.certificate_chain.signature.data[9] = 9; - + test_msg.certificate_chain.signature.data[10] = 10; - + test_msg.certificate_chain.signature.data[11] = 11; - + test_msg.certificate_chain.signature.data[12] = 12; - + test_msg.certificate_chain.signature.data[13] = 13; - + test_msg.certificate_chain.signature.data[14] = 14; - + test_msg.certificate_chain.signature.data[15] = 15; - + test_msg.certificate_chain.signature.data[16] = 16; - + test_msg.certificate_chain.signature.data[17] = 17; - + test_msg.certificate_chain.signature.data[18] = 18; - + test_msg.certificate_chain.signature.data[19] = 19; - + test_msg.certificate_chain.signature.data[20] = 20; - + test_msg.certificate_chain.signature.data[21] = 21; - + test_msg.certificate_chain.signature.data[22] = 22; - + test_msg.certificate_chain.signature.data[23] = 23; - + test_msg.certificate_chain.signature.data[24] = 24; - + test_msg.certificate_chain.signature.data[25] = 25; - + test_msg.certificate_chain.signature.data[26] = 26; - + test_msg.certificate_chain.signature.data[27] = 27; - + test_msg.certificate_chain.signature.data[28] = 28; - + test_msg.certificate_chain.signature.data[29] = 29; - + test_msg.certificate_chain.signature.data[30] = 30; - + test_msg.certificate_chain.signature.data[31] = 31; - + test_msg.certificate_chain.signature.data[32] = 32; - + test_msg.certificate_chain.signature.data[33] = 33; - + test_msg.certificate_chain.signature.data[34] = 34; - + test_msg.certificate_chain.signature.data[35] = 35; - + test_msg.certificate_chain.signature.data[36] = 36; - + test_msg.certificate_chain.signature.data[37] = 37; - + test_msg.certificate_chain.signature.data[38] = 38; - + test_msg.certificate_chain.signature.data[39] = 39; - + test_msg.certificate_chain.signature.data[40] = 40; - + test_msg.certificate_chain.signature.data[41] = 41; - + test_msg.certificate_chain.signature.data[42] = 42; - + test_msg.certificate_chain.signature.data[43] = 43; - + test_msg.certificate_chain.signature.data[44] = 44; - + test_msg.certificate_chain.signature.data[45] = 45; - + test_msg.certificate_chain.signature.data[46] = 46; - + test_msg.certificate_chain.signature.data[47] = 47; - + test_msg.certificate_chain.signature.data[48] = 48; - + test_msg.certificate_chain.signature.data[49] = 49; - + test_msg.certificate_chain.signature.data[50] = 50; - + test_msg.certificate_chain.signature.data[51] = 51; - + test_msg.certificate_chain.signature.data[52] = 52; - + test_msg.certificate_chain.signature.data[53] = 53; - + test_msg.certificate_chain.signature.data[54] = 54; - + test_msg.certificate_chain.signature.data[55] = 55; - + test_msg.certificate_chain.signature.data[56] = 56; - + test_msg.certificate_chain.signature.data[57] = 57; - + test_msg.certificate_chain.signature.data[58] = 58; - + test_msg.certificate_chain.signature.data[59] = 59; - + test_msg.certificate_chain.signature.data[60] = 60; - + test_msg.certificate_chain.signature.data[61] = 61; - + test_msg.certificate_chain.signature.data[62] = 62; - + test_msg.certificate_chain.signature.data[63] = 63; - + test_msg.certificate_chain.signature.data[64] = 64; - + test_msg.certificate_chain.signature.data[65] = 65; - + test_msg.certificate_chain.signature.data[66] = 66; - + test_msg.certificate_chain.signature.data[67] = 67; - + test_msg.certificate_chain.signature.data[68] = 68; - + test_msg.certificate_chain.signature.data[69] = 69; - + test_msg.certificate_chain.signature.data[70] = 70; - + test_msg.certificate_chain.signature.data[71] = 71; - + test_msg.certificate_chain.signature.len = 72; - sbp_message_send(&sbp_state, SbpMsgCertificateChain, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgCertificateChain, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgCertificateChain, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgCertificateChain, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[0] == 20, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[0], expected 20, is %d", last_msg.msg.certificate_chain.corrections_certificate[0]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[1] == 21, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[1], expected 21, is %d", last_msg.msg.certificate_chain.corrections_certificate[1]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[2] == 22, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[2], expected 22, is %d", last_msg.msg.certificate_chain.corrections_certificate[2]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[3] == 23, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[3], expected 23, is %d", last_msg.msg.certificate_chain.corrections_certificate[3]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[4] == 24, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[4], expected 24, is %d", last_msg.msg.certificate_chain.corrections_certificate[4]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[5] == 25, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[5], expected 25, is %d", last_msg.msg.certificate_chain.corrections_certificate[5]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[6] == 26, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[6], expected 26, is %d", last_msg.msg.certificate_chain.corrections_certificate[6]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[7] == 27, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[7], expected 27, is %d", last_msg.msg.certificate_chain.corrections_certificate[7]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[8] == 28, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[8], expected 28, is %d", last_msg.msg.certificate_chain.corrections_certificate[8]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[9] == 29, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[9], expected 29, is %d", last_msg.msg.certificate_chain.corrections_certificate[9]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[10] == 10, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[10], expected 10, is %d", last_msg.msg.certificate_chain.corrections_certificate[10]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[11] == 11, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[11], expected 11, is %d", last_msg.msg.certificate_chain.corrections_certificate[11]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[12] == 12, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[12], expected 12, is %d", last_msg.msg.certificate_chain.corrections_certificate[12]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[13] == 13, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[13], expected 13, is %d", last_msg.msg.certificate_chain.corrections_certificate[13]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[14] == 14, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[14], expected 14, is %d", last_msg.msg.certificate_chain.corrections_certificate[14]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[15] == 15, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[15], expected 15, is %d", last_msg.msg.certificate_chain.corrections_certificate[15]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[16] == 16, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[16], expected 16, is %d", last_msg.msg.certificate_chain.corrections_certificate[16]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[17] == 17, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[17], expected 17, is %d", last_msg.msg.certificate_chain.corrections_certificate[17]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[18] == 18, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[18], expected 18, is %d", last_msg.msg.certificate_chain.corrections_certificate[18]); - ck_assert_msg(last_msg.msg.certificate_chain.corrections_certificate[19] == 19, "incorrect value for last_msg.msg.certificate_chain.corrections_certificate[19], expected 19, is %d", last_msg.msg.certificate_chain.corrections_certificate[19]); - - - ck_assert_msg(last_msg.msg.certificate_chain.expiration.day == 30, "incorrect value for last_msg.msg.certificate_chain.expiration.day, expected 30, is %d", last_msg.msg.certificate_chain.expiration.day); - - ck_assert_msg(last_msg.msg.certificate_chain.expiration.hours == 12, "incorrect value for last_msg.msg.certificate_chain.expiration.hours, expected 12, is %d", last_msg.msg.certificate_chain.expiration.hours); - - ck_assert_msg(last_msg.msg.certificate_chain.expiration.minutes == 34, "incorrect value for last_msg.msg.certificate_chain.expiration.minutes, expected 34, is %d", last_msg.msg.certificate_chain.expiration.minutes); - - ck_assert_msg(last_msg.msg.certificate_chain.expiration.month == 3, "incorrect value for last_msg.msg.certificate_chain.expiration.month, expected 3, is %d", last_msg.msg.certificate_chain.expiration.month); - - ck_assert_msg(last_msg.msg.certificate_chain.expiration.ns == 123456789, "incorrect value for last_msg.msg.certificate_chain.expiration.ns, expected 123456789, is %d", last_msg.msg.certificate_chain.expiration.ns); - - ck_assert_msg(last_msg.msg.certificate_chain.expiration.seconds == 59, "incorrect value for last_msg.msg.certificate_chain.expiration.seconds, expected 59, is %d", last_msg.msg.certificate_chain.expiration.seconds); - - ck_assert_msg(last_msg.msg.certificate_chain.expiration.year == 2024, "incorrect value for last_msg.msg.certificate_chain.expiration.year, expected 2024, is %d", last_msg.msg.certificate_chain.expiration.year); - - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[0] == 10, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[0], expected 10, is %d", last_msg.msg.certificate_chain.intermediate_certificate[0]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[1] == 11, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[1], expected 11, is %d", last_msg.msg.certificate_chain.intermediate_certificate[1]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[2] == 12, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[2], expected 12, is %d", last_msg.msg.certificate_chain.intermediate_certificate[2]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[3] == 13, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[3], expected 13, is %d", last_msg.msg.certificate_chain.intermediate_certificate[3]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[4] == 14, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[4], expected 14, is %d", last_msg.msg.certificate_chain.intermediate_certificate[4]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[5] == 15, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[5], expected 15, is %d", last_msg.msg.certificate_chain.intermediate_certificate[5]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[6] == 16, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[6], expected 16, is %d", last_msg.msg.certificate_chain.intermediate_certificate[6]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[7] == 17, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[7], expected 17, is %d", last_msg.msg.certificate_chain.intermediate_certificate[7]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[8] == 18, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[8], expected 18, is %d", last_msg.msg.certificate_chain.intermediate_certificate[8]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[9] == 19, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[9], expected 19, is %d", last_msg.msg.certificate_chain.intermediate_certificate[9]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[10] == 0, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[10], expected 0, is %d", last_msg.msg.certificate_chain.intermediate_certificate[10]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[11] == 1, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[11], expected 1, is %d", last_msg.msg.certificate_chain.intermediate_certificate[11]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[12] == 2, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[12], expected 2, is %d", last_msg.msg.certificate_chain.intermediate_certificate[12]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[13] == 3, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[13], expected 3, is %d", last_msg.msg.certificate_chain.intermediate_certificate[13]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[14] == 4, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[14], expected 4, is %d", last_msg.msg.certificate_chain.intermediate_certificate[14]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[15] == 5, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[15], expected 5, is %d", last_msg.msg.certificate_chain.intermediate_certificate[15]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[16] == 6, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[16], expected 6, is %d", last_msg.msg.certificate_chain.intermediate_certificate[16]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[17] == 7, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[17], expected 7, is %d", last_msg.msg.certificate_chain.intermediate_certificate[17]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[18] == 8, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[18], expected 8, is %d", last_msg.msg.certificate_chain.intermediate_certificate[18]); - ck_assert_msg(last_msg.msg.certificate_chain.intermediate_certificate[19] == 9, "incorrect value for last_msg.msg.certificate_chain.intermediate_certificate[19], expected 9, is %d", last_msg.msg.certificate_chain.intermediate_certificate[19]); - - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[0] == 0, "incorrect value for last_msg.msg.certificate_chain.root_certificate[0], expected 0, is %d", last_msg.msg.certificate_chain.root_certificate[0]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[1] == 1, "incorrect value for last_msg.msg.certificate_chain.root_certificate[1], expected 1, is %d", last_msg.msg.certificate_chain.root_certificate[1]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[2] == 2, "incorrect value for last_msg.msg.certificate_chain.root_certificate[2], expected 2, is %d", last_msg.msg.certificate_chain.root_certificate[2]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[3] == 3, "incorrect value for last_msg.msg.certificate_chain.root_certificate[3], expected 3, is %d", last_msg.msg.certificate_chain.root_certificate[3]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[4] == 4, "incorrect value for last_msg.msg.certificate_chain.root_certificate[4], expected 4, is %d", last_msg.msg.certificate_chain.root_certificate[4]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[5] == 5, "incorrect value for last_msg.msg.certificate_chain.root_certificate[5], expected 5, is %d", last_msg.msg.certificate_chain.root_certificate[5]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[6] == 6, "incorrect value for last_msg.msg.certificate_chain.root_certificate[6], expected 6, is %d", last_msg.msg.certificate_chain.root_certificate[6]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[7] == 7, "incorrect value for last_msg.msg.certificate_chain.root_certificate[7], expected 7, is %d", last_msg.msg.certificate_chain.root_certificate[7]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[8] == 8, "incorrect value for last_msg.msg.certificate_chain.root_certificate[8], expected 8, is %d", last_msg.msg.certificate_chain.root_certificate[8]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[9] == 9, "incorrect value for last_msg.msg.certificate_chain.root_certificate[9], expected 9, is %d", last_msg.msg.certificate_chain.root_certificate[9]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[10] == 10, "incorrect value for last_msg.msg.certificate_chain.root_certificate[10], expected 10, is %d", last_msg.msg.certificate_chain.root_certificate[10]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[11] == 11, "incorrect value for last_msg.msg.certificate_chain.root_certificate[11], expected 11, is %d", last_msg.msg.certificate_chain.root_certificate[11]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[12] == 12, "incorrect value for last_msg.msg.certificate_chain.root_certificate[12], expected 12, is %d", last_msg.msg.certificate_chain.root_certificate[12]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[13] == 13, "incorrect value for last_msg.msg.certificate_chain.root_certificate[13], expected 13, is %d", last_msg.msg.certificate_chain.root_certificate[13]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[14] == 14, "incorrect value for last_msg.msg.certificate_chain.root_certificate[14], expected 14, is %d", last_msg.msg.certificate_chain.root_certificate[14]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[15] == 15, "incorrect value for last_msg.msg.certificate_chain.root_certificate[15], expected 15, is %d", last_msg.msg.certificate_chain.root_certificate[15]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[16] == 16, "incorrect value for last_msg.msg.certificate_chain.root_certificate[16], expected 16, is %d", last_msg.msg.certificate_chain.root_certificate[16]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[17] == 17, "incorrect value for last_msg.msg.certificate_chain.root_certificate[17], expected 17, is %d", last_msg.msg.certificate_chain.root_certificate[17]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[18] == 18, "incorrect value for last_msg.msg.certificate_chain.root_certificate[18], expected 18, is %d", last_msg.msg.certificate_chain.root_certificate[18]); - ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[19] == 19, "incorrect value for last_msg.msg.certificate_chain.root_certificate[19], expected 19, is %d", last_msg.msg.certificate_chain.root_certificate[19]); - - - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[0] == 0, "incorrect value for last_msg.msg.certificate_chain.signature.data[0], expected 0, is %d", last_msg.msg.certificate_chain.signature.data[0]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[1] == 1, "incorrect value for last_msg.msg.certificate_chain.signature.data[1], expected 1, is %d", last_msg.msg.certificate_chain.signature.data[1]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[2] == 2, "incorrect value for last_msg.msg.certificate_chain.signature.data[2], expected 2, is %d", last_msg.msg.certificate_chain.signature.data[2]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[3] == 3, "incorrect value for last_msg.msg.certificate_chain.signature.data[3], expected 3, is %d", last_msg.msg.certificate_chain.signature.data[3]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[4] == 4, "incorrect value for last_msg.msg.certificate_chain.signature.data[4], expected 4, is %d", last_msg.msg.certificate_chain.signature.data[4]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[5] == 5, "incorrect value for last_msg.msg.certificate_chain.signature.data[5], expected 5, is %d", last_msg.msg.certificate_chain.signature.data[5]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[6] == 6, "incorrect value for last_msg.msg.certificate_chain.signature.data[6], expected 6, is %d", last_msg.msg.certificate_chain.signature.data[6]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[7] == 7, "incorrect value for last_msg.msg.certificate_chain.signature.data[7], expected 7, is %d", last_msg.msg.certificate_chain.signature.data[7]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[8] == 8, "incorrect value for last_msg.msg.certificate_chain.signature.data[8], expected 8, is %d", last_msg.msg.certificate_chain.signature.data[8]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[9] == 9, "incorrect value for last_msg.msg.certificate_chain.signature.data[9], expected 9, is %d", last_msg.msg.certificate_chain.signature.data[9]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[10] == 10, "incorrect value for last_msg.msg.certificate_chain.signature.data[10], expected 10, is %d", last_msg.msg.certificate_chain.signature.data[10]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[11] == 11, "incorrect value for last_msg.msg.certificate_chain.signature.data[11], expected 11, is %d", last_msg.msg.certificate_chain.signature.data[11]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[12] == 12, "incorrect value for last_msg.msg.certificate_chain.signature.data[12], expected 12, is %d", last_msg.msg.certificate_chain.signature.data[12]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[13] == 13, "incorrect value for last_msg.msg.certificate_chain.signature.data[13], expected 13, is %d", last_msg.msg.certificate_chain.signature.data[13]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[14] == 14, "incorrect value for last_msg.msg.certificate_chain.signature.data[14], expected 14, is %d", last_msg.msg.certificate_chain.signature.data[14]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[15] == 15, "incorrect value for last_msg.msg.certificate_chain.signature.data[15], expected 15, is %d", last_msg.msg.certificate_chain.signature.data[15]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[16] == 16, "incorrect value for last_msg.msg.certificate_chain.signature.data[16], expected 16, is %d", last_msg.msg.certificate_chain.signature.data[16]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[17] == 17, "incorrect value for last_msg.msg.certificate_chain.signature.data[17], expected 17, is %d", last_msg.msg.certificate_chain.signature.data[17]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[18] == 18, "incorrect value for last_msg.msg.certificate_chain.signature.data[18], expected 18, is %d", last_msg.msg.certificate_chain.signature.data[18]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[19] == 19, "incorrect value for last_msg.msg.certificate_chain.signature.data[19], expected 19, is %d", last_msg.msg.certificate_chain.signature.data[19]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[20] == 20, "incorrect value for last_msg.msg.certificate_chain.signature.data[20], expected 20, is %d", last_msg.msg.certificate_chain.signature.data[20]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[21] == 21, "incorrect value for last_msg.msg.certificate_chain.signature.data[21], expected 21, is %d", last_msg.msg.certificate_chain.signature.data[21]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[22] == 22, "incorrect value for last_msg.msg.certificate_chain.signature.data[22], expected 22, is %d", last_msg.msg.certificate_chain.signature.data[22]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[23] == 23, "incorrect value for last_msg.msg.certificate_chain.signature.data[23], expected 23, is %d", last_msg.msg.certificate_chain.signature.data[23]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[24] == 24, "incorrect value for last_msg.msg.certificate_chain.signature.data[24], expected 24, is %d", last_msg.msg.certificate_chain.signature.data[24]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[25] == 25, "incorrect value for last_msg.msg.certificate_chain.signature.data[25], expected 25, is %d", last_msg.msg.certificate_chain.signature.data[25]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[26] == 26, "incorrect value for last_msg.msg.certificate_chain.signature.data[26], expected 26, is %d", last_msg.msg.certificate_chain.signature.data[26]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[27] == 27, "incorrect value for last_msg.msg.certificate_chain.signature.data[27], expected 27, is %d", last_msg.msg.certificate_chain.signature.data[27]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[28] == 28, "incorrect value for last_msg.msg.certificate_chain.signature.data[28], expected 28, is %d", last_msg.msg.certificate_chain.signature.data[28]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[29] == 29, "incorrect value for last_msg.msg.certificate_chain.signature.data[29], expected 29, is %d", last_msg.msg.certificate_chain.signature.data[29]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[30] == 30, "incorrect value for last_msg.msg.certificate_chain.signature.data[30], expected 30, is %d", last_msg.msg.certificate_chain.signature.data[30]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[31] == 31, "incorrect value for last_msg.msg.certificate_chain.signature.data[31], expected 31, is %d", last_msg.msg.certificate_chain.signature.data[31]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[32] == 32, "incorrect value for last_msg.msg.certificate_chain.signature.data[32], expected 32, is %d", last_msg.msg.certificate_chain.signature.data[32]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[33] == 33, "incorrect value for last_msg.msg.certificate_chain.signature.data[33], expected 33, is %d", last_msg.msg.certificate_chain.signature.data[33]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[34] == 34, "incorrect value for last_msg.msg.certificate_chain.signature.data[34], expected 34, is %d", last_msg.msg.certificate_chain.signature.data[34]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[35] == 35, "incorrect value for last_msg.msg.certificate_chain.signature.data[35], expected 35, is %d", last_msg.msg.certificate_chain.signature.data[35]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[36] == 36, "incorrect value for last_msg.msg.certificate_chain.signature.data[36], expected 36, is %d", last_msg.msg.certificate_chain.signature.data[36]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[37] == 37, "incorrect value for last_msg.msg.certificate_chain.signature.data[37], expected 37, is %d", last_msg.msg.certificate_chain.signature.data[37]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[38] == 38, "incorrect value for last_msg.msg.certificate_chain.signature.data[38], expected 38, is %d", last_msg.msg.certificate_chain.signature.data[38]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[39] == 39, "incorrect value for last_msg.msg.certificate_chain.signature.data[39], expected 39, is %d", last_msg.msg.certificate_chain.signature.data[39]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[40] == 40, "incorrect value for last_msg.msg.certificate_chain.signature.data[40], expected 40, is %d", last_msg.msg.certificate_chain.signature.data[40]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[41] == 41, "incorrect value for last_msg.msg.certificate_chain.signature.data[41], expected 41, is %d", last_msg.msg.certificate_chain.signature.data[41]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[42] == 42, "incorrect value for last_msg.msg.certificate_chain.signature.data[42], expected 42, is %d", last_msg.msg.certificate_chain.signature.data[42]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[43] == 43, "incorrect value for last_msg.msg.certificate_chain.signature.data[43], expected 43, is %d", last_msg.msg.certificate_chain.signature.data[43]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[44] == 44, "incorrect value for last_msg.msg.certificate_chain.signature.data[44], expected 44, is %d", last_msg.msg.certificate_chain.signature.data[44]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[45] == 45, "incorrect value for last_msg.msg.certificate_chain.signature.data[45], expected 45, is %d", last_msg.msg.certificate_chain.signature.data[45]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[46] == 46, "incorrect value for last_msg.msg.certificate_chain.signature.data[46], expected 46, is %d", last_msg.msg.certificate_chain.signature.data[46]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[47] == 47, "incorrect value for last_msg.msg.certificate_chain.signature.data[47], expected 47, is %d", last_msg.msg.certificate_chain.signature.data[47]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[48] == 48, "incorrect value for last_msg.msg.certificate_chain.signature.data[48], expected 48, is %d", last_msg.msg.certificate_chain.signature.data[48]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[49] == 49, "incorrect value for last_msg.msg.certificate_chain.signature.data[49], expected 49, is %d", last_msg.msg.certificate_chain.signature.data[49]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[50] == 50, "incorrect value for last_msg.msg.certificate_chain.signature.data[50], expected 50, is %d", last_msg.msg.certificate_chain.signature.data[50]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[51] == 51, "incorrect value for last_msg.msg.certificate_chain.signature.data[51], expected 51, is %d", last_msg.msg.certificate_chain.signature.data[51]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[52] == 52, "incorrect value for last_msg.msg.certificate_chain.signature.data[52], expected 52, is %d", last_msg.msg.certificate_chain.signature.data[52]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[53] == 53, "incorrect value for last_msg.msg.certificate_chain.signature.data[53], expected 53, is %d", last_msg.msg.certificate_chain.signature.data[53]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[54] == 54, "incorrect value for last_msg.msg.certificate_chain.signature.data[54], expected 54, is %d", last_msg.msg.certificate_chain.signature.data[54]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[55] == 55, "incorrect value for last_msg.msg.certificate_chain.signature.data[55], expected 55, is %d", last_msg.msg.certificate_chain.signature.data[55]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[56] == 56, "incorrect value for last_msg.msg.certificate_chain.signature.data[56], expected 56, is %d", last_msg.msg.certificate_chain.signature.data[56]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[57] == 57, "incorrect value for last_msg.msg.certificate_chain.signature.data[57], expected 57, is %d", last_msg.msg.certificate_chain.signature.data[57]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[58] == 58, "incorrect value for last_msg.msg.certificate_chain.signature.data[58], expected 58, is %d", last_msg.msg.certificate_chain.signature.data[58]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[59] == 59, "incorrect value for last_msg.msg.certificate_chain.signature.data[59], expected 59, is %d", last_msg.msg.certificate_chain.signature.data[59]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[60] == 60, "incorrect value for last_msg.msg.certificate_chain.signature.data[60], expected 60, is %d", last_msg.msg.certificate_chain.signature.data[60]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[61] == 61, "incorrect value for last_msg.msg.certificate_chain.signature.data[61], expected 61, is %d", last_msg.msg.certificate_chain.signature.data[61]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[62] == 62, "incorrect value for last_msg.msg.certificate_chain.signature.data[62], expected 62, is %d", last_msg.msg.certificate_chain.signature.data[62]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[63] == 63, "incorrect value for last_msg.msg.certificate_chain.signature.data[63], expected 63, is %d", last_msg.msg.certificate_chain.signature.data[63]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[64] == 64, "incorrect value for last_msg.msg.certificate_chain.signature.data[64], expected 64, is %d", last_msg.msg.certificate_chain.signature.data[64]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[65] == 65, "incorrect value for last_msg.msg.certificate_chain.signature.data[65], expected 65, is %d", last_msg.msg.certificate_chain.signature.data[65]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[66] == 66, "incorrect value for last_msg.msg.certificate_chain.signature.data[66], expected 66, is %d", last_msg.msg.certificate_chain.signature.data[66]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[67] == 67, "incorrect value for last_msg.msg.certificate_chain.signature.data[67], expected 67, is %d", last_msg.msg.certificate_chain.signature.data[67]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[68] == 68, "incorrect value for last_msg.msg.certificate_chain.signature.data[68], expected 68, is %d", last_msg.msg.certificate_chain.signature.data[68]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[69] == 69, "incorrect value for last_msg.msg.certificate_chain.signature.data[69], expected 69, is %d", last_msg.msg.certificate_chain.signature.data[69]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[70] == 70, "incorrect value for last_msg.msg.certificate_chain.signature.data[70], expected 70, is %d", last_msg.msg.certificate_chain.signature.data[70]); - ck_assert_msg(last_msg.msg.certificate_chain.signature.data[71] == 71, "incorrect value for last_msg.msg.certificate_chain.signature.data[71], expected 71, is %d", last_msg.msg.certificate_chain.signature.data[71]); - - ck_assert_msg(last_msg.msg.certificate_chain.signature.len == 72, "incorrect value for last_msg.msg.certificate_chain.signature.len, expected 72, is %d", last_msg.msg.certificate_chain.signature.len); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[0] == 20, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[0], expected " + "20, is %d", + last_msg.msg.certificate_chain.corrections_certificate[0]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[1] == 21, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[1], expected " + "21, is %d", + last_msg.msg.certificate_chain.corrections_certificate[1]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[2] == 22, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[2], expected " + "22, is %d", + last_msg.msg.certificate_chain.corrections_certificate[2]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[3] == 23, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[3], expected " + "23, is %d", + last_msg.msg.certificate_chain.corrections_certificate[3]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[4] == 24, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[4], expected " + "24, is %d", + last_msg.msg.certificate_chain.corrections_certificate[4]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[5] == 25, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[5], expected " + "25, is %d", + last_msg.msg.certificate_chain.corrections_certificate[5]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[6] == 26, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[6], expected " + "26, is %d", + last_msg.msg.certificate_chain.corrections_certificate[6]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[7] == 27, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[7], expected " + "27, is %d", + last_msg.msg.certificate_chain.corrections_certificate[7]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[8] == 28, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[8], expected " + "28, is %d", + last_msg.msg.certificate_chain.corrections_certificate[8]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[9] == 29, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[9], expected " + "29, is %d", + last_msg.msg.certificate_chain.corrections_certificate[9]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[10] == 10, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[10], expected " + "10, is %d", + last_msg.msg.certificate_chain.corrections_certificate[10]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[11] == 11, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[11], expected " + "11, is %d", + last_msg.msg.certificate_chain.corrections_certificate[11]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[12] == 12, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[12], expected " + "12, is %d", + last_msg.msg.certificate_chain.corrections_certificate[12]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[13] == 13, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[13], expected " + "13, is %d", + last_msg.msg.certificate_chain.corrections_certificate[13]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[14] == 14, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[14], expected " + "14, is %d", + last_msg.msg.certificate_chain.corrections_certificate[14]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[15] == 15, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[15], expected " + "15, is %d", + last_msg.msg.certificate_chain.corrections_certificate[15]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[16] == 16, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[16], expected " + "16, is %d", + last_msg.msg.certificate_chain.corrections_certificate[16]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[17] == 17, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[17], expected " + "17, is %d", + last_msg.msg.certificate_chain.corrections_certificate[17]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[18] == 18, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[18], expected " + "18, is %d", + last_msg.msg.certificate_chain.corrections_certificate[18]); + ck_assert_msg( + last_msg.msg.certificate_chain.corrections_certificate[19] == 19, + "incorrect value for " + "last_msg.msg.certificate_chain.corrections_certificate[19], expected " + "19, is %d", + last_msg.msg.certificate_chain.corrections_certificate[19]); + + ck_assert_msg( + last_msg.msg.certificate_chain.expiration.day == 30, + "incorrect value for last_msg.msg.certificate_chain.expiration.day, " + "expected 30, is %d", + last_msg.msg.certificate_chain.expiration.day); + + ck_assert_msg( + last_msg.msg.certificate_chain.expiration.hours == 12, + "incorrect value for last_msg.msg.certificate_chain.expiration.hours, " + "expected 12, is %d", + last_msg.msg.certificate_chain.expiration.hours); + + ck_assert_msg( + last_msg.msg.certificate_chain.expiration.minutes == 34, + "incorrect value for " + "last_msg.msg.certificate_chain.expiration.minutes, expected 34, is %d", + last_msg.msg.certificate_chain.expiration.minutes); + + ck_assert_msg( + last_msg.msg.certificate_chain.expiration.month == 3, + "incorrect value for last_msg.msg.certificate_chain.expiration.month, " + "expected 3, is %d", + last_msg.msg.certificate_chain.expiration.month); + + ck_assert_msg( + last_msg.msg.certificate_chain.expiration.ns == 123456789, + "incorrect value for last_msg.msg.certificate_chain.expiration.ns, " + "expected 123456789, is %d", + last_msg.msg.certificate_chain.expiration.ns); + + ck_assert_msg( + last_msg.msg.certificate_chain.expiration.seconds == 59, + "incorrect value for " + "last_msg.msg.certificate_chain.expiration.seconds, expected 59, is %d", + last_msg.msg.certificate_chain.expiration.seconds); + + ck_assert_msg( + last_msg.msg.certificate_chain.expiration.year == 2024, + "incorrect value for last_msg.msg.certificate_chain.expiration.year, " + "expected 2024, is %d", + last_msg.msg.certificate_chain.expiration.year); + + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[0] == 10, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[0], expected " + "10, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[0]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[1] == 11, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[1], expected " + "11, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[1]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[2] == 12, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[2], expected " + "12, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[2]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[3] == 13, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[3], expected " + "13, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[3]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[4] == 14, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[4], expected " + "14, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[4]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[5] == 15, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[5], expected " + "15, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[5]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[6] == 16, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[6], expected " + "16, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[6]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[7] == 17, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[7], expected " + "17, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[7]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[8] == 18, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[8], expected " + "18, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[8]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[9] == 19, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[9], expected " + "19, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[9]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[10] == 0, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[10], expected " + "0, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[10]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[11] == 1, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[11], expected " + "1, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[11]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[12] == 2, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[12], expected " + "2, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[12]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[13] == 3, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[13], expected " + "3, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[13]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[14] == 4, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[14], expected " + "4, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[14]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[15] == 5, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[15], expected " + "5, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[15]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[16] == 6, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[16], expected " + "6, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[16]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[17] == 7, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[17], expected " + "7, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[17]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[18] == 8, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[18], expected " + "8, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[18]); + ck_assert_msg( + last_msg.msg.certificate_chain.intermediate_certificate[19] == 9, + "incorrect value for " + "last_msg.msg.certificate_chain.intermediate_certificate[19], expected " + "9, is %d", + last_msg.msg.certificate_chain.intermediate_certificate[19]); + + ck_assert_msg( + last_msg.msg.certificate_chain.root_certificate[0] == 0, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[0], expected 0, is %d", + last_msg.msg.certificate_chain.root_certificate[0]); + ck_assert_msg( + last_msg.msg.certificate_chain.root_certificate[1] == 1, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[1], expected 1, is %d", + last_msg.msg.certificate_chain.root_certificate[1]); + ck_assert_msg( + last_msg.msg.certificate_chain.root_certificate[2] == 2, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[2], expected 2, is %d", + last_msg.msg.certificate_chain.root_certificate[2]); + ck_assert_msg( + last_msg.msg.certificate_chain.root_certificate[3] == 3, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[3], expected 3, is %d", + last_msg.msg.certificate_chain.root_certificate[3]); + ck_assert_msg( + last_msg.msg.certificate_chain.root_certificate[4] == 4, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[4], expected 4, is %d", + last_msg.msg.certificate_chain.root_certificate[4]); + ck_assert_msg( + last_msg.msg.certificate_chain.root_certificate[5] == 5, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[5], expected 5, is %d", + last_msg.msg.certificate_chain.root_certificate[5]); + ck_assert_msg( + last_msg.msg.certificate_chain.root_certificate[6] == 6, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[6], expected 6, is %d", + last_msg.msg.certificate_chain.root_certificate[6]); + ck_assert_msg( + last_msg.msg.certificate_chain.root_certificate[7] == 7, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[7], expected 7, is %d", + last_msg.msg.certificate_chain.root_certificate[7]); + ck_assert_msg( + last_msg.msg.certificate_chain.root_certificate[8] == 8, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[8], expected 8, is %d", + last_msg.msg.certificate_chain.root_certificate[8]); + ck_assert_msg( + last_msg.msg.certificate_chain.root_certificate[9] == 9, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[9], expected 9, is %d", + last_msg.msg.certificate_chain.root_certificate[9]); + ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[10] == 10, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[10], " + "expected 10, is %d", + last_msg.msg.certificate_chain.root_certificate[10]); + ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[11] == 11, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[11], " + "expected 11, is %d", + last_msg.msg.certificate_chain.root_certificate[11]); + ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[12] == 12, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[12], " + "expected 12, is %d", + last_msg.msg.certificate_chain.root_certificate[12]); + ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[13] == 13, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[13], " + "expected 13, is %d", + last_msg.msg.certificate_chain.root_certificate[13]); + ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[14] == 14, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[14], " + "expected 14, is %d", + last_msg.msg.certificate_chain.root_certificate[14]); + ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[15] == 15, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[15], " + "expected 15, is %d", + last_msg.msg.certificate_chain.root_certificate[15]); + ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[16] == 16, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[16], " + "expected 16, is %d", + last_msg.msg.certificate_chain.root_certificate[16]); + ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[17] == 17, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[17], " + "expected 17, is %d", + last_msg.msg.certificate_chain.root_certificate[17]); + ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[18] == 18, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[18], " + "expected 18, is %d", + last_msg.msg.certificate_chain.root_certificate[18]); + ck_assert_msg(last_msg.msg.certificate_chain.root_certificate[19] == 19, + "incorrect value for " + "last_msg.msg.certificate_chain.root_certificate[19], " + "expected 19, is %d", + last_msg.msg.certificate_chain.root_certificate[19]); + + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[0] == 0, + "incorrect value for last_msg.msg.certificate_chain.signature.data[0], " + "expected 0, is %d", + last_msg.msg.certificate_chain.signature.data[0]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[1] == 1, + "incorrect value for last_msg.msg.certificate_chain.signature.data[1], " + "expected 1, is %d", + last_msg.msg.certificate_chain.signature.data[1]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[2] == 2, + "incorrect value for last_msg.msg.certificate_chain.signature.data[2], " + "expected 2, is %d", + last_msg.msg.certificate_chain.signature.data[2]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[3] == 3, + "incorrect value for last_msg.msg.certificate_chain.signature.data[3], " + "expected 3, is %d", + last_msg.msg.certificate_chain.signature.data[3]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[4] == 4, + "incorrect value for last_msg.msg.certificate_chain.signature.data[4], " + "expected 4, is %d", + last_msg.msg.certificate_chain.signature.data[4]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[5] == 5, + "incorrect value for last_msg.msg.certificate_chain.signature.data[5], " + "expected 5, is %d", + last_msg.msg.certificate_chain.signature.data[5]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[6] == 6, + "incorrect value for last_msg.msg.certificate_chain.signature.data[6], " + "expected 6, is %d", + last_msg.msg.certificate_chain.signature.data[6]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[7] == 7, + "incorrect value for last_msg.msg.certificate_chain.signature.data[7], " + "expected 7, is %d", + last_msg.msg.certificate_chain.signature.data[7]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[8] == 8, + "incorrect value for last_msg.msg.certificate_chain.signature.data[8], " + "expected 8, is %d", + last_msg.msg.certificate_chain.signature.data[8]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[9] == 9, + "incorrect value for last_msg.msg.certificate_chain.signature.data[9], " + "expected 9, is %d", + last_msg.msg.certificate_chain.signature.data[9]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[10] == 10, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[10], expected 10, is %d", + last_msg.msg.certificate_chain.signature.data[10]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[11] == 11, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[11], expected 11, is %d", + last_msg.msg.certificate_chain.signature.data[11]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[12] == 12, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[12], expected 12, is %d", + last_msg.msg.certificate_chain.signature.data[12]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[13] == 13, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[13], expected 13, is %d", + last_msg.msg.certificate_chain.signature.data[13]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[14] == 14, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[14], expected 14, is %d", + last_msg.msg.certificate_chain.signature.data[14]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[15] == 15, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[15], expected 15, is %d", + last_msg.msg.certificate_chain.signature.data[15]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[16] == 16, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[16], expected 16, is %d", + last_msg.msg.certificate_chain.signature.data[16]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[17] == 17, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[17], expected 17, is %d", + last_msg.msg.certificate_chain.signature.data[17]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[18] == 18, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[18], expected 18, is %d", + last_msg.msg.certificate_chain.signature.data[18]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[19] == 19, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[19], expected 19, is %d", + last_msg.msg.certificate_chain.signature.data[19]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[20] == 20, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[20], expected 20, is %d", + last_msg.msg.certificate_chain.signature.data[20]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[21] == 21, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[21], expected 21, is %d", + last_msg.msg.certificate_chain.signature.data[21]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[22] == 22, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[22], expected 22, is %d", + last_msg.msg.certificate_chain.signature.data[22]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[23] == 23, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[23], expected 23, is %d", + last_msg.msg.certificate_chain.signature.data[23]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[24] == 24, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[24], expected 24, is %d", + last_msg.msg.certificate_chain.signature.data[24]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[25] == 25, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[25], expected 25, is %d", + last_msg.msg.certificate_chain.signature.data[25]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[26] == 26, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[26], expected 26, is %d", + last_msg.msg.certificate_chain.signature.data[26]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[27] == 27, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[27], expected 27, is %d", + last_msg.msg.certificate_chain.signature.data[27]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[28] == 28, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[28], expected 28, is %d", + last_msg.msg.certificate_chain.signature.data[28]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[29] == 29, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[29], expected 29, is %d", + last_msg.msg.certificate_chain.signature.data[29]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[30] == 30, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[30], expected 30, is %d", + last_msg.msg.certificate_chain.signature.data[30]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[31] == 31, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[31], expected 31, is %d", + last_msg.msg.certificate_chain.signature.data[31]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[32] == 32, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[32], expected 32, is %d", + last_msg.msg.certificate_chain.signature.data[32]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[33] == 33, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[33], expected 33, is %d", + last_msg.msg.certificate_chain.signature.data[33]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[34] == 34, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[34], expected 34, is %d", + last_msg.msg.certificate_chain.signature.data[34]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[35] == 35, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[35], expected 35, is %d", + last_msg.msg.certificate_chain.signature.data[35]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[36] == 36, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[36], expected 36, is %d", + last_msg.msg.certificate_chain.signature.data[36]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[37] == 37, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[37], expected 37, is %d", + last_msg.msg.certificate_chain.signature.data[37]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[38] == 38, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[38], expected 38, is %d", + last_msg.msg.certificate_chain.signature.data[38]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[39] == 39, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[39], expected 39, is %d", + last_msg.msg.certificate_chain.signature.data[39]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[40] == 40, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[40], expected 40, is %d", + last_msg.msg.certificate_chain.signature.data[40]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[41] == 41, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[41], expected 41, is %d", + last_msg.msg.certificate_chain.signature.data[41]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[42] == 42, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[42], expected 42, is %d", + last_msg.msg.certificate_chain.signature.data[42]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[43] == 43, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[43], expected 43, is %d", + last_msg.msg.certificate_chain.signature.data[43]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[44] == 44, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[44], expected 44, is %d", + last_msg.msg.certificate_chain.signature.data[44]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[45] == 45, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[45], expected 45, is %d", + last_msg.msg.certificate_chain.signature.data[45]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[46] == 46, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[46], expected 46, is %d", + last_msg.msg.certificate_chain.signature.data[46]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[47] == 47, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[47], expected 47, is %d", + last_msg.msg.certificate_chain.signature.data[47]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[48] == 48, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[48], expected 48, is %d", + last_msg.msg.certificate_chain.signature.data[48]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[49] == 49, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[49], expected 49, is %d", + last_msg.msg.certificate_chain.signature.data[49]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[50] == 50, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[50], expected 50, is %d", + last_msg.msg.certificate_chain.signature.data[50]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[51] == 51, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[51], expected 51, is %d", + last_msg.msg.certificate_chain.signature.data[51]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[52] == 52, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[52], expected 52, is %d", + last_msg.msg.certificate_chain.signature.data[52]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[53] == 53, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[53], expected 53, is %d", + last_msg.msg.certificate_chain.signature.data[53]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[54] == 54, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[54], expected 54, is %d", + last_msg.msg.certificate_chain.signature.data[54]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[55] == 55, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[55], expected 55, is %d", + last_msg.msg.certificate_chain.signature.data[55]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[56] == 56, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[56], expected 56, is %d", + last_msg.msg.certificate_chain.signature.data[56]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[57] == 57, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[57], expected 57, is %d", + last_msg.msg.certificate_chain.signature.data[57]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[58] == 58, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[58], expected 58, is %d", + last_msg.msg.certificate_chain.signature.data[58]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[59] == 59, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[59], expected 59, is %d", + last_msg.msg.certificate_chain.signature.data[59]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[60] == 60, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[60], expected 60, is %d", + last_msg.msg.certificate_chain.signature.data[60]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[61] == 61, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[61], expected 61, is %d", + last_msg.msg.certificate_chain.signature.data[61]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[62] == 62, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[62], expected 62, is %d", + last_msg.msg.certificate_chain.signature.data[62]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[63] == 63, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[63], expected 63, is %d", + last_msg.msg.certificate_chain.signature.data[63]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[64] == 64, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[64], expected 64, is %d", + last_msg.msg.certificate_chain.signature.data[64]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[65] == 65, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[65], expected 65, is %d", + last_msg.msg.certificate_chain.signature.data[65]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[66] == 66, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[66], expected 66, is %d", + last_msg.msg.certificate_chain.signature.data[66]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[67] == 67, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[67], expected 67, is %d", + last_msg.msg.certificate_chain.signature.data[67]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[68] == 68, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[68], expected 68, is %d", + last_msg.msg.certificate_chain.signature.data[68]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[69] == 69, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[69], expected 69, is %d", + last_msg.msg.certificate_chain.signature.data[69]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[70] == 70, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[70], expected 70, is %d", + last_msg.msg.certificate_chain.signature.data[70]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[71] == 71, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[71], expected 71, is %d", + last_msg.msg.certificate_chain.signature.data[71]); + + ck_assert_msg( + last_msg.msg.certificate_chain.signature.len == 72, + "incorrect value for last_msg.msg.certificate_chain.signature.len, " + "expected 72, is %d", + last_msg.msg.certificate_chain.signature.len); } } END_TEST -Suite* auto_check_sbp_signing_MsgCertificateChain_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_signing_MsgCertificateChain"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_signing_MsgCertificateChain"); +Suite *auto_check_sbp_signing_MsgCertificateChain_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_signing_MsgCertificateChain"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_signing_MsgCertificateChain"); tcase_add_test(tc_acq, test_auto_check_sbp_signing_MsgCertificateChain); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_signing_MsgCertificateChainDep.c b/c/test/auto_check_sbp_signing_MsgCertificateChainDep.c index b7ef6135b..dd9901101 100644 --- a/c/test/auto_check_sbp_signing_MsgCertificateChainDep.c +++ b/c/test/auto_check_sbp_signing_MsgCertificateChainDep.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_signing_MsgCertificateChainDep ) -{ +START_TEST(test_auto_check_sbp_signing_MsgCertificateChainDep) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_signing_MsgCertificateChainDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,453 +90,1027 @@ START_TEST( test_auto_check_sbp_signing_MsgCertificateChainDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0xC05, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xC05, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,12,66,0,135,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,20,21,22,23,24,25,26,27,28,29,10,11,12,13,14,15,16,17,18,19,232,7,3,30,12,34,59,21,205,91,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,112,100, }; + u8 encoded_frame[] = { + 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 232, 7, 3, 30, 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.certificate_chain_dep.corrections_certificate[0] = 20; - + test_msg.certificate_chain_dep.corrections_certificate[1] = 21; - + test_msg.certificate_chain_dep.corrections_certificate[2] = 22; - + test_msg.certificate_chain_dep.corrections_certificate[3] = 23; - + test_msg.certificate_chain_dep.corrections_certificate[4] = 24; - + test_msg.certificate_chain_dep.corrections_certificate[5] = 25; - + test_msg.certificate_chain_dep.corrections_certificate[6] = 26; - + test_msg.certificate_chain_dep.corrections_certificate[7] = 27; - + test_msg.certificate_chain_dep.corrections_certificate[8] = 28; - + test_msg.certificate_chain_dep.corrections_certificate[9] = 29; - + test_msg.certificate_chain_dep.corrections_certificate[10] = 10; - + test_msg.certificate_chain_dep.corrections_certificate[11] = 11; - + test_msg.certificate_chain_dep.corrections_certificate[12] = 12; - + test_msg.certificate_chain_dep.corrections_certificate[13] = 13; - + test_msg.certificate_chain_dep.corrections_certificate[14] = 14; - + test_msg.certificate_chain_dep.corrections_certificate[15] = 15; - + test_msg.certificate_chain_dep.corrections_certificate[16] = 16; - + test_msg.certificate_chain_dep.corrections_certificate[17] = 17; - + test_msg.certificate_chain_dep.corrections_certificate[18] = 18; - + test_msg.certificate_chain_dep.corrections_certificate[19] = 19; - - + test_msg.certificate_chain_dep.expiration.day = 30; - + test_msg.certificate_chain_dep.expiration.hours = 12; - + test_msg.certificate_chain_dep.expiration.minutes = 34; - + test_msg.certificate_chain_dep.expiration.month = 3; - + test_msg.certificate_chain_dep.expiration.ns = 123456789; - + test_msg.certificate_chain_dep.expiration.seconds = 59; - + test_msg.certificate_chain_dep.expiration.year = 2024; - - + test_msg.certificate_chain_dep.intermediate_certificate[0] = 10; - + test_msg.certificate_chain_dep.intermediate_certificate[1] = 11; - + test_msg.certificate_chain_dep.intermediate_certificate[2] = 12; - + test_msg.certificate_chain_dep.intermediate_certificate[3] = 13; - + test_msg.certificate_chain_dep.intermediate_certificate[4] = 14; - + test_msg.certificate_chain_dep.intermediate_certificate[5] = 15; - + test_msg.certificate_chain_dep.intermediate_certificate[6] = 16; - + test_msg.certificate_chain_dep.intermediate_certificate[7] = 17; - + test_msg.certificate_chain_dep.intermediate_certificate[8] = 18; - + test_msg.certificate_chain_dep.intermediate_certificate[9] = 19; - + test_msg.certificate_chain_dep.intermediate_certificate[10] = 0; - + test_msg.certificate_chain_dep.intermediate_certificate[11] = 1; - + test_msg.certificate_chain_dep.intermediate_certificate[12] = 2; - + test_msg.certificate_chain_dep.intermediate_certificate[13] = 3; - + test_msg.certificate_chain_dep.intermediate_certificate[14] = 4; - + test_msg.certificate_chain_dep.intermediate_certificate[15] = 5; - + test_msg.certificate_chain_dep.intermediate_certificate[16] = 6; - + test_msg.certificate_chain_dep.intermediate_certificate[17] = 7; - + test_msg.certificate_chain_dep.intermediate_certificate[18] = 8; - + test_msg.certificate_chain_dep.intermediate_certificate[19] = 9; - - + test_msg.certificate_chain_dep.root_certificate[0] = 0; - + test_msg.certificate_chain_dep.root_certificate[1] = 1; - + test_msg.certificate_chain_dep.root_certificate[2] = 2; - + test_msg.certificate_chain_dep.root_certificate[3] = 3; - + test_msg.certificate_chain_dep.root_certificate[4] = 4; - + test_msg.certificate_chain_dep.root_certificate[5] = 5; - + test_msg.certificate_chain_dep.root_certificate[6] = 6; - + test_msg.certificate_chain_dep.root_certificate[7] = 7; - + test_msg.certificate_chain_dep.root_certificate[8] = 8; - + test_msg.certificate_chain_dep.root_certificate[9] = 9; - + test_msg.certificate_chain_dep.root_certificate[10] = 10; - + test_msg.certificate_chain_dep.root_certificate[11] = 11; - + test_msg.certificate_chain_dep.root_certificate[12] = 12; - + test_msg.certificate_chain_dep.root_certificate[13] = 13; - + test_msg.certificate_chain_dep.root_certificate[14] = 14; - + test_msg.certificate_chain_dep.root_certificate[15] = 15; - + test_msg.certificate_chain_dep.root_certificate[16] = 16; - + test_msg.certificate_chain_dep.root_certificate[17] = 17; - + test_msg.certificate_chain_dep.root_certificate[18] = 18; - + test_msg.certificate_chain_dep.root_certificate[19] = 19; - - + test_msg.certificate_chain_dep.signature[0] = 0; - + test_msg.certificate_chain_dep.signature[1] = 1; - + test_msg.certificate_chain_dep.signature[2] = 2; - + test_msg.certificate_chain_dep.signature[3] = 3; - + test_msg.certificate_chain_dep.signature[4] = 4; - + test_msg.certificate_chain_dep.signature[5] = 5; - + test_msg.certificate_chain_dep.signature[6] = 6; - + test_msg.certificate_chain_dep.signature[7] = 7; - + test_msg.certificate_chain_dep.signature[8] = 0; - + test_msg.certificate_chain_dep.signature[9] = 1; - + test_msg.certificate_chain_dep.signature[10] = 2; - + test_msg.certificate_chain_dep.signature[11] = 3; - + test_msg.certificate_chain_dep.signature[12] = 4; - + test_msg.certificate_chain_dep.signature[13] = 5; - + test_msg.certificate_chain_dep.signature[14] = 6; - + test_msg.certificate_chain_dep.signature[15] = 7; - + test_msg.certificate_chain_dep.signature[16] = 0; - + test_msg.certificate_chain_dep.signature[17] = 1; - + test_msg.certificate_chain_dep.signature[18] = 2; - + test_msg.certificate_chain_dep.signature[19] = 3; - + test_msg.certificate_chain_dep.signature[20] = 4; - + test_msg.certificate_chain_dep.signature[21] = 5; - + test_msg.certificate_chain_dep.signature[22] = 6; - + test_msg.certificate_chain_dep.signature[23] = 7; - + test_msg.certificate_chain_dep.signature[24] = 0; - + test_msg.certificate_chain_dep.signature[25] = 1; - + test_msg.certificate_chain_dep.signature[26] = 2; - + test_msg.certificate_chain_dep.signature[27] = 3; - + test_msg.certificate_chain_dep.signature[28] = 4; - + test_msg.certificate_chain_dep.signature[29] = 5; - + test_msg.certificate_chain_dep.signature[30] = 6; - + test_msg.certificate_chain_dep.signature[31] = 7; - + test_msg.certificate_chain_dep.signature[32] = 0; - + test_msg.certificate_chain_dep.signature[33] = 1; - + test_msg.certificate_chain_dep.signature[34] = 2; - + test_msg.certificate_chain_dep.signature[35] = 3; - + test_msg.certificate_chain_dep.signature[36] = 4; - + test_msg.certificate_chain_dep.signature[37] = 5; - + test_msg.certificate_chain_dep.signature[38] = 6; - + test_msg.certificate_chain_dep.signature[39] = 7; - + test_msg.certificate_chain_dep.signature[40] = 0; - + test_msg.certificate_chain_dep.signature[41] = 1; - + test_msg.certificate_chain_dep.signature[42] = 2; - + test_msg.certificate_chain_dep.signature[43] = 3; - + test_msg.certificate_chain_dep.signature[44] = 4; - + test_msg.certificate_chain_dep.signature[45] = 5; - + test_msg.certificate_chain_dep.signature[46] = 6; - + test_msg.certificate_chain_dep.signature[47] = 7; - + test_msg.certificate_chain_dep.signature[48] = 0; - + test_msg.certificate_chain_dep.signature[49] = 1; - + test_msg.certificate_chain_dep.signature[50] = 2; - + test_msg.certificate_chain_dep.signature[51] = 3; - + test_msg.certificate_chain_dep.signature[52] = 4; - + test_msg.certificate_chain_dep.signature[53] = 5; - + test_msg.certificate_chain_dep.signature[54] = 6; - + test_msg.certificate_chain_dep.signature[55] = 7; - + test_msg.certificate_chain_dep.signature[56] = 0; - + test_msg.certificate_chain_dep.signature[57] = 1; - + test_msg.certificate_chain_dep.signature[58] = 2; - + test_msg.certificate_chain_dep.signature[59] = 3; - + test_msg.certificate_chain_dep.signature[60] = 4; - + test_msg.certificate_chain_dep.signature[61] = 5; - + test_msg.certificate_chain_dep.signature[62] = 6; - + test_msg.certificate_chain_dep.signature[63] = 7; - sbp_message_send(&sbp_state, SbpMsgCertificateChainDep, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgCertificateChainDep, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgCertificateChainDep, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[0] == 20, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[0], expected 20, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[0]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[1] == 21, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[1], expected 21, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[1]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[2] == 22, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[2], expected 22, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[2]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[3] == 23, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[3], expected 23, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[3]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[4] == 24, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[4], expected 24, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[4]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[5] == 25, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[5], expected 25, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[5]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[6] == 26, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[6], expected 26, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[6]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[7] == 27, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[7], expected 27, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[7]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[8] == 28, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[8], expected 28, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[8]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[9] == 29, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[9], expected 29, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[9]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[10] == 10, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[10], expected 10, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[10]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[11] == 11, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[11], expected 11, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[11]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[12] == 12, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[12], expected 12, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[12]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[13] == 13, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[13], expected 13, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[13]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[14] == 14, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[14], expected 14, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[14]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[15] == 15, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[15], expected 15, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[15]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[16] == 16, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[16], expected 16, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[16]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[17] == 17, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[17], expected 17, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[17]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[18] == 18, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[18], expected 18, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[18]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.corrections_certificate[19] == 19, "incorrect value for last_msg.msg.certificate_chain_dep.corrections_certificate[19], expected 19, is %d", last_msg.msg.certificate_chain_dep.corrections_certificate[19]); - - - ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.day == 30, "incorrect value for last_msg.msg.certificate_chain_dep.expiration.day, expected 30, is %d", last_msg.msg.certificate_chain_dep.expiration.day); - - ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.hours == 12, "incorrect value for last_msg.msg.certificate_chain_dep.expiration.hours, expected 12, is %d", last_msg.msg.certificate_chain_dep.expiration.hours); - - ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.minutes == 34, "incorrect value for last_msg.msg.certificate_chain_dep.expiration.minutes, expected 34, is %d", last_msg.msg.certificate_chain_dep.expiration.minutes); - - ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.month == 3, "incorrect value for last_msg.msg.certificate_chain_dep.expiration.month, expected 3, is %d", last_msg.msg.certificate_chain_dep.expiration.month); - - ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.ns == 123456789, "incorrect value for last_msg.msg.certificate_chain_dep.expiration.ns, expected 123456789, is %d", last_msg.msg.certificate_chain_dep.expiration.ns); - - ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.seconds == 59, "incorrect value for last_msg.msg.certificate_chain_dep.expiration.seconds, expected 59, is %d", last_msg.msg.certificate_chain_dep.expiration.seconds); - - ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.year == 2024, "incorrect value for last_msg.msg.certificate_chain_dep.expiration.year, expected 2024, is %d", last_msg.msg.certificate_chain_dep.expiration.year); - - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[0] == 10, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[0], expected 10, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[0]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[1] == 11, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[1], expected 11, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[1]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[2] == 12, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[2], expected 12, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[2]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[3] == 13, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[3], expected 13, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[3]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[4] == 14, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[4], expected 14, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[4]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[5] == 15, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[5], expected 15, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[5]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[6] == 16, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[6], expected 16, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[6]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[7] == 17, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[7], expected 17, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[7]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[8] == 18, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[8], expected 18, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[8]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[9] == 19, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[9], expected 19, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[9]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[10] == 0, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[10], expected 0, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[10]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[11] == 1, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[11], expected 1, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[11]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[12] == 2, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[12], expected 2, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[12]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[13] == 3, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[13], expected 3, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[13]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[14] == 4, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[14], expected 4, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[14]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[15] == 5, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[15], expected 5, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[15]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[16] == 6, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[16], expected 6, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[16]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[17] == 7, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[17], expected 7, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[17]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[18] == 8, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[18], expected 8, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[18]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.intermediate_certificate[19] == 9, "incorrect value for last_msg.msg.certificate_chain_dep.intermediate_certificate[19], expected 9, is %d", last_msg.msg.certificate_chain_dep.intermediate_certificate[19]); - - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[0] == 0, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[0], expected 0, is %d", last_msg.msg.certificate_chain_dep.root_certificate[0]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[1] == 1, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[1], expected 1, is %d", last_msg.msg.certificate_chain_dep.root_certificate[1]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[2] == 2, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[2], expected 2, is %d", last_msg.msg.certificate_chain_dep.root_certificate[2]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[3] == 3, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[3], expected 3, is %d", last_msg.msg.certificate_chain_dep.root_certificate[3]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[4] == 4, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[4], expected 4, is %d", last_msg.msg.certificate_chain_dep.root_certificate[4]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[5] == 5, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[5], expected 5, is %d", last_msg.msg.certificate_chain_dep.root_certificate[5]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[6] == 6, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[6], expected 6, is %d", last_msg.msg.certificate_chain_dep.root_certificate[6]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[7] == 7, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[7], expected 7, is %d", last_msg.msg.certificate_chain_dep.root_certificate[7]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[8] == 8, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[8], expected 8, is %d", last_msg.msg.certificate_chain_dep.root_certificate[8]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[9] == 9, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[9], expected 9, is %d", last_msg.msg.certificate_chain_dep.root_certificate[9]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[10] == 10, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[10], expected 10, is %d", last_msg.msg.certificate_chain_dep.root_certificate[10]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[11] == 11, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[11], expected 11, is %d", last_msg.msg.certificate_chain_dep.root_certificate[11]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[12] == 12, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[12], expected 12, is %d", last_msg.msg.certificate_chain_dep.root_certificate[12]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[13] == 13, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[13], expected 13, is %d", last_msg.msg.certificate_chain_dep.root_certificate[13]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[14] == 14, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[14], expected 14, is %d", last_msg.msg.certificate_chain_dep.root_certificate[14]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[15] == 15, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[15], expected 15, is %d", last_msg.msg.certificate_chain_dep.root_certificate[15]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[16] == 16, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[16], expected 16, is %d", last_msg.msg.certificate_chain_dep.root_certificate[16]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[17] == 17, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[17], expected 17, is %d", last_msg.msg.certificate_chain_dep.root_certificate[17]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[18] == 18, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[18], expected 18, is %d", last_msg.msg.certificate_chain_dep.root_certificate[18]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[19] == 19, "incorrect value for last_msg.msg.certificate_chain_dep.root_certificate[19], expected 19, is %d", last_msg.msg.certificate_chain_dep.root_certificate[19]); - - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[0] == 0, "incorrect value for last_msg.msg.certificate_chain_dep.signature[0], expected 0, is %d", last_msg.msg.certificate_chain_dep.signature[0]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[1] == 1, "incorrect value for last_msg.msg.certificate_chain_dep.signature[1], expected 1, is %d", last_msg.msg.certificate_chain_dep.signature[1]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[2] == 2, "incorrect value for last_msg.msg.certificate_chain_dep.signature[2], expected 2, is %d", last_msg.msg.certificate_chain_dep.signature[2]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[3] == 3, "incorrect value for last_msg.msg.certificate_chain_dep.signature[3], expected 3, is %d", last_msg.msg.certificate_chain_dep.signature[3]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[4] == 4, "incorrect value for last_msg.msg.certificate_chain_dep.signature[4], expected 4, is %d", last_msg.msg.certificate_chain_dep.signature[4]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[5] == 5, "incorrect value for last_msg.msg.certificate_chain_dep.signature[5], expected 5, is %d", last_msg.msg.certificate_chain_dep.signature[5]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[6] == 6, "incorrect value for last_msg.msg.certificate_chain_dep.signature[6], expected 6, is %d", last_msg.msg.certificate_chain_dep.signature[6]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[7] == 7, "incorrect value for last_msg.msg.certificate_chain_dep.signature[7], expected 7, is %d", last_msg.msg.certificate_chain_dep.signature[7]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[8] == 0, "incorrect value for last_msg.msg.certificate_chain_dep.signature[8], expected 0, is %d", last_msg.msg.certificate_chain_dep.signature[8]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[9] == 1, "incorrect value for last_msg.msg.certificate_chain_dep.signature[9], expected 1, is %d", last_msg.msg.certificate_chain_dep.signature[9]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[10] == 2, "incorrect value for last_msg.msg.certificate_chain_dep.signature[10], expected 2, is %d", last_msg.msg.certificate_chain_dep.signature[10]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[11] == 3, "incorrect value for last_msg.msg.certificate_chain_dep.signature[11], expected 3, is %d", last_msg.msg.certificate_chain_dep.signature[11]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[12] == 4, "incorrect value for last_msg.msg.certificate_chain_dep.signature[12], expected 4, is %d", last_msg.msg.certificate_chain_dep.signature[12]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[13] == 5, "incorrect value for last_msg.msg.certificate_chain_dep.signature[13], expected 5, is %d", last_msg.msg.certificate_chain_dep.signature[13]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[14] == 6, "incorrect value for last_msg.msg.certificate_chain_dep.signature[14], expected 6, is %d", last_msg.msg.certificate_chain_dep.signature[14]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[15] == 7, "incorrect value for last_msg.msg.certificate_chain_dep.signature[15], expected 7, is %d", last_msg.msg.certificate_chain_dep.signature[15]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[16] == 0, "incorrect value for last_msg.msg.certificate_chain_dep.signature[16], expected 0, is %d", last_msg.msg.certificate_chain_dep.signature[16]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[17] == 1, "incorrect value for last_msg.msg.certificate_chain_dep.signature[17], expected 1, is %d", last_msg.msg.certificate_chain_dep.signature[17]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[18] == 2, "incorrect value for last_msg.msg.certificate_chain_dep.signature[18], expected 2, is %d", last_msg.msg.certificate_chain_dep.signature[18]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[19] == 3, "incorrect value for last_msg.msg.certificate_chain_dep.signature[19], expected 3, is %d", last_msg.msg.certificate_chain_dep.signature[19]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[20] == 4, "incorrect value for last_msg.msg.certificate_chain_dep.signature[20], expected 4, is %d", last_msg.msg.certificate_chain_dep.signature[20]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[21] == 5, "incorrect value for last_msg.msg.certificate_chain_dep.signature[21], expected 5, is %d", last_msg.msg.certificate_chain_dep.signature[21]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[22] == 6, "incorrect value for last_msg.msg.certificate_chain_dep.signature[22], expected 6, is %d", last_msg.msg.certificate_chain_dep.signature[22]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[23] == 7, "incorrect value for last_msg.msg.certificate_chain_dep.signature[23], expected 7, is %d", last_msg.msg.certificate_chain_dep.signature[23]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[24] == 0, "incorrect value for last_msg.msg.certificate_chain_dep.signature[24], expected 0, is %d", last_msg.msg.certificate_chain_dep.signature[24]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[25] == 1, "incorrect value for last_msg.msg.certificate_chain_dep.signature[25], expected 1, is %d", last_msg.msg.certificate_chain_dep.signature[25]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[26] == 2, "incorrect value for last_msg.msg.certificate_chain_dep.signature[26], expected 2, is %d", last_msg.msg.certificate_chain_dep.signature[26]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[27] == 3, "incorrect value for last_msg.msg.certificate_chain_dep.signature[27], expected 3, is %d", last_msg.msg.certificate_chain_dep.signature[27]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[28] == 4, "incorrect value for last_msg.msg.certificate_chain_dep.signature[28], expected 4, is %d", last_msg.msg.certificate_chain_dep.signature[28]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[29] == 5, "incorrect value for last_msg.msg.certificate_chain_dep.signature[29], expected 5, is %d", last_msg.msg.certificate_chain_dep.signature[29]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[30] == 6, "incorrect value for last_msg.msg.certificate_chain_dep.signature[30], expected 6, is %d", last_msg.msg.certificate_chain_dep.signature[30]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[31] == 7, "incorrect value for last_msg.msg.certificate_chain_dep.signature[31], expected 7, is %d", last_msg.msg.certificate_chain_dep.signature[31]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[32] == 0, "incorrect value for last_msg.msg.certificate_chain_dep.signature[32], expected 0, is %d", last_msg.msg.certificate_chain_dep.signature[32]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[33] == 1, "incorrect value for last_msg.msg.certificate_chain_dep.signature[33], expected 1, is %d", last_msg.msg.certificate_chain_dep.signature[33]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[34] == 2, "incorrect value for last_msg.msg.certificate_chain_dep.signature[34], expected 2, is %d", last_msg.msg.certificate_chain_dep.signature[34]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[35] == 3, "incorrect value for last_msg.msg.certificate_chain_dep.signature[35], expected 3, is %d", last_msg.msg.certificate_chain_dep.signature[35]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[36] == 4, "incorrect value for last_msg.msg.certificate_chain_dep.signature[36], expected 4, is %d", last_msg.msg.certificate_chain_dep.signature[36]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[37] == 5, "incorrect value for last_msg.msg.certificate_chain_dep.signature[37], expected 5, is %d", last_msg.msg.certificate_chain_dep.signature[37]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[38] == 6, "incorrect value for last_msg.msg.certificate_chain_dep.signature[38], expected 6, is %d", last_msg.msg.certificate_chain_dep.signature[38]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[39] == 7, "incorrect value for last_msg.msg.certificate_chain_dep.signature[39], expected 7, is %d", last_msg.msg.certificate_chain_dep.signature[39]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[40] == 0, "incorrect value for last_msg.msg.certificate_chain_dep.signature[40], expected 0, is %d", last_msg.msg.certificate_chain_dep.signature[40]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[41] == 1, "incorrect value for last_msg.msg.certificate_chain_dep.signature[41], expected 1, is %d", last_msg.msg.certificate_chain_dep.signature[41]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[42] == 2, "incorrect value for last_msg.msg.certificate_chain_dep.signature[42], expected 2, is %d", last_msg.msg.certificate_chain_dep.signature[42]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[43] == 3, "incorrect value for last_msg.msg.certificate_chain_dep.signature[43], expected 3, is %d", last_msg.msg.certificate_chain_dep.signature[43]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[44] == 4, "incorrect value for last_msg.msg.certificate_chain_dep.signature[44], expected 4, is %d", last_msg.msg.certificate_chain_dep.signature[44]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[45] == 5, "incorrect value for last_msg.msg.certificate_chain_dep.signature[45], expected 5, is %d", last_msg.msg.certificate_chain_dep.signature[45]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[46] == 6, "incorrect value for last_msg.msg.certificate_chain_dep.signature[46], expected 6, is %d", last_msg.msg.certificate_chain_dep.signature[46]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[47] == 7, "incorrect value for last_msg.msg.certificate_chain_dep.signature[47], expected 7, is %d", last_msg.msg.certificate_chain_dep.signature[47]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[48] == 0, "incorrect value for last_msg.msg.certificate_chain_dep.signature[48], expected 0, is %d", last_msg.msg.certificate_chain_dep.signature[48]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[49] == 1, "incorrect value for last_msg.msg.certificate_chain_dep.signature[49], expected 1, is %d", last_msg.msg.certificate_chain_dep.signature[49]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[50] == 2, "incorrect value for last_msg.msg.certificate_chain_dep.signature[50], expected 2, is %d", last_msg.msg.certificate_chain_dep.signature[50]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[51] == 3, "incorrect value for last_msg.msg.certificate_chain_dep.signature[51], expected 3, is %d", last_msg.msg.certificate_chain_dep.signature[51]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[52] == 4, "incorrect value for last_msg.msg.certificate_chain_dep.signature[52], expected 4, is %d", last_msg.msg.certificate_chain_dep.signature[52]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[53] == 5, "incorrect value for last_msg.msg.certificate_chain_dep.signature[53], expected 5, is %d", last_msg.msg.certificate_chain_dep.signature[53]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[54] == 6, "incorrect value for last_msg.msg.certificate_chain_dep.signature[54], expected 6, is %d", last_msg.msg.certificate_chain_dep.signature[54]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[55] == 7, "incorrect value for last_msg.msg.certificate_chain_dep.signature[55], expected 7, is %d", last_msg.msg.certificate_chain_dep.signature[55]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[56] == 0, "incorrect value for last_msg.msg.certificate_chain_dep.signature[56], expected 0, is %d", last_msg.msg.certificate_chain_dep.signature[56]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[57] == 1, "incorrect value for last_msg.msg.certificate_chain_dep.signature[57], expected 1, is %d", last_msg.msg.certificate_chain_dep.signature[57]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[58] == 2, "incorrect value for last_msg.msg.certificate_chain_dep.signature[58], expected 2, is %d", last_msg.msg.certificate_chain_dep.signature[58]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[59] == 3, "incorrect value for last_msg.msg.certificate_chain_dep.signature[59], expected 3, is %d", last_msg.msg.certificate_chain_dep.signature[59]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[60] == 4, "incorrect value for last_msg.msg.certificate_chain_dep.signature[60], expected 4, is %d", last_msg.msg.certificate_chain_dep.signature[60]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[61] == 5, "incorrect value for last_msg.msg.certificate_chain_dep.signature[61], expected 5, is %d", last_msg.msg.certificate_chain_dep.signature[61]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[62] == 6, "incorrect value for last_msg.msg.certificate_chain_dep.signature[62], expected 6, is %d", last_msg.msg.certificate_chain_dep.signature[62]); - ck_assert_msg(last_msg.msg.certificate_chain_dep.signature[63] == 7, "incorrect value for last_msg.msg.certificate_chain_dep.signature[63], expected 7, is %d", last_msg.msg.certificate_chain_dep.signature[63]); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgCertificateChainDep, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[0] == 20, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[0], " + "expected 20, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[0]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[1] == 21, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[1], " + "expected 21, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[1]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[2] == 22, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[2], " + "expected 22, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[2]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[3] == 23, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[3], " + "expected 23, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[3]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[4] == 24, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[4], " + "expected 24, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[4]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[5] == 25, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[5], " + "expected 25, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[5]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[6] == 26, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[6], " + "expected 26, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[6]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[7] == 27, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[7], " + "expected 27, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[7]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[8] == 28, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[8], " + "expected 28, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[8]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[9] == 29, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[9], " + "expected 29, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[9]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[10] == 10, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[10], " + "expected 10, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[10]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[11] == 11, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[11], " + "expected 11, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[11]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[12] == 12, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[12], " + "expected 12, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[12]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[13] == 13, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[13], " + "expected 13, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[13]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[14] == 14, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[14], " + "expected 14, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[14]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[15] == 15, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[15], " + "expected 15, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[15]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[16] == 16, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[16], " + "expected 16, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[16]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[17] == 17, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[17], " + "expected 17, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[17]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[18] == 18, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[18], " + "expected 18, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[18]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[19] == 19, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[19], " + "expected 19, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[19]); + + ck_assert_msg( + last_msg.msg.certificate_chain_dep.expiration.day == 30, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.expiration.day, expected 30, is %d", + last_msg.msg.certificate_chain_dep.expiration.day); + + ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.hours == 12, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.expiration.hours, " + "expected 12, is %d", + last_msg.msg.certificate_chain_dep.expiration.hours); + + ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.minutes == 34, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.expiration.minutes, " + "expected 34, is %d", + last_msg.msg.certificate_chain_dep.expiration.minutes); + + ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.month == 3, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.expiration.month, " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.expiration.month); + + ck_assert_msg( + last_msg.msg.certificate_chain_dep.expiration.ns == 123456789, + "incorrect value for last_msg.msg.certificate_chain_dep.expiration.ns, " + "expected 123456789, is %d", + last_msg.msg.certificate_chain_dep.expiration.ns); + + ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.seconds == 59, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.expiration.seconds, " + "expected 59, is %d", + last_msg.msg.certificate_chain_dep.expiration.seconds); + + ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.year == 2024, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.expiration.year, " + "expected 2024, is %d", + last_msg.msg.certificate_chain_dep.expiration.year); + + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[0] == 10, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[0], " + "expected 10, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[0]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[1] == 11, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[1], " + "expected 11, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[1]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[2] == 12, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[2], " + "expected 12, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[2]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[3] == 13, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[3], " + "expected 13, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[3]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[4] == 14, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[4], " + "expected 14, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[4]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[5] == 15, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[5], " + "expected 15, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[5]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[6] == 16, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[6], " + "expected 16, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[6]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[7] == 17, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[7], " + "expected 17, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[7]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[8] == 18, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[8], " + "expected 18, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[8]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[9] == 19, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[9], " + "expected 19, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[9]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[10] == 0, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[10], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[10]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[11] == 1, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[11], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[11]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[12] == 2, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[12], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[12]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[13] == 3, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[13], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[13]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[14] == 4, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[14], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[14]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[15] == 5, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[15], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[15]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[16] == 6, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[16], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[16]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[17] == 7, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[17], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[17]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[18] == 8, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[18], " + "expected 8, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[18]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[19] == 9, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[19], " + "expected 9, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[19]); + + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[0] == 0, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[0], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[0]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[1] == 1, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[1], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[1]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[2] == 2, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[2], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[2]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[3] == 3, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[3], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[3]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[4] == 4, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[4], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[4]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[5] == 5, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[5], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[5]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[6] == 6, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[6], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[6]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[7] == 7, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[7], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[7]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[8] == 8, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[8], " + "expected 8, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[8]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[9] == 9, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[9], " + "expected 9, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[9]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[10] == 10, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[10], " + "expected 10, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[10]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[11] == 11, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[11], " + "expected 11, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[11]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[12] == 12, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[12], " + "expected 12, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[12]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[13] == 13, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[13], " + "expected 13, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[13]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[14] == 14, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[14], " + "expected 14, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[14]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[15] == 15, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[15], " + "expected 15, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[15]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[16] == 16, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[16], " + "expected 16, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[16]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[17] == 17, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[17], " + "expected 17, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[17]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[18] == 18, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[18], " + "expected 18, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[18]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[19] == 19, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[19], " + "expected 19, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[19]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[0] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[0], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[0]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[1] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[1], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[1]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[2] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[2], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[2]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[3] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[3], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[3]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[4] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[4], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[4]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[5] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[5], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[5]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[6] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[6], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[6]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[7] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[7], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[7]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[8] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[8], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[8]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[9] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[9], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[9]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[10] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[10], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[10]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[11] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[11], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[11]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[12] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[12], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[12]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[13] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[13], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[13]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[14] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[14], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[14]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[15] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[15], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[15]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[16] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[16], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[16]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[17] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[17], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[17]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[18] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[18], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[18]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[19] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[19], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[19]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[20] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[20], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[20]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[21] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[21], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[21]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[22] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[22], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[22]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[23] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[23], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[23]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[24] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[24], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[24]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[25] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[25], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[25]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[26] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[26], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[26]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[27] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[27], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[27]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[28] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[28], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[28]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[29] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[29], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[29]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[30] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[30], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[30]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[31] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[31], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[31]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[32] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[32], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[32]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[33] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[33], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[33]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[34] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[34], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[34]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[35] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[35], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[35]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[36] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[36], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[36]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[37] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[37], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[37]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[38] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[38], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[38]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[39] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[39], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[39]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[40] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[40], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[40]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[41] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[41], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[41]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[42] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[42], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[42]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[43] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[43], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[43]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[44] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[44], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[44]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[45] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[45], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[45]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[46] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[46], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[46]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[47] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[47], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[47]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[48] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[48], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[48]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[49] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[49], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[49]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[50] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[50], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[50]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[51] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[51], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[51]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[52] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[52], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[52]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[53] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[53], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[53]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[54] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[54], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[54]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[55] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[55], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[55]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[56] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[56], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[56]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[57] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[57], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[57]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[58] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[58], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[58]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[59] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[59], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[59]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[60] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[60], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[60]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[61] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[61], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[61]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[62] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[62], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[62]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[63] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[63], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[63]); } } END_TEST -Suite* auto_check_sbp_signing_MsgCertificateChainDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_signing_MsgCertificateChainDep"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_signing_MsgCertificateChainDep"); +Suite *auto_check_sbp_signing_MsgCertificateChainDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_signing_MsgCertificateChainDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_signing_MsgCertificateChainDep"); tcase_add_test(tc_acq, test_auto_check_sbp_signing_MsgCertificateChainDep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_signing_MsgEcdsaCertificate.c b/c/test/auto_check_sbp_signing_MsgEcdsaCertificate.c index 43354a61f..1bccd9ee3 100644 --- a/c/test/auto_check_sbp_signing_MsgEcdsaCertificate.c +++ b/c/test/auto_check_sbp_signing_MsgEcdsaCertificate.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaCertificate.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaCertificate.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_signing_MsgEcdsaCertificate ) -{ +START_TEST(test_auto_check_sbp_signing_MsgEcdsaCertificate) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_signing_MsgEcdsaCertificate ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,812 +90,1849 @@ START_TEST( test_auto_check_sbp_signing_MsgEcdsaCertificate ) logging_reset(); - sbp_callback_register(&sbp_state, 0xC04, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xC04, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,12,66,0,253,48,10,11,12,13,2,180,160,116,77,243,28,173,36,86,33,8,31,120,73,64,169,148,224,57,95,17,40,213,92,195,146,235,228,177,101,82,182,25,172,170,250,236,7,119,4,201,10,14,208,47,126,49,210,174,75,221,203,24,66,52,35,26,30,140,111,246,39,226,205,198,178,196,5,81,9,44,164,163,214,138,123,76,74,237,121,13,137,186,97,193,189,200,124,69,115,230,159,185,158,51,12,225,65,192,105,56,41,85,133,19,217,166,48,139,131,96,216,98,147,132,234,167,248,247,32,239,194,188,254,114,117,83,25,251,191,104,240,118,68,42,93,18,16,37,232,99,179,23,90,94,136,6,125,91,255,15,71,43,46,25,252,229,80,143,58,241,11,62,181,155,53,153,149,152,227,150,87,112,165,2,128,231,25,157,244,204,108,253,127,122,145,113,162,197,171,199,54,184,222,206,67,144,78,187,207,60,211,141,135,106,220,79,183,245,21,161,168,34,129,50,176,1,218,20,130,59,249,109,219,0,100,103,55,29,242,110,154,190,233,142,45,61,215,202,238,88,209,70,63,151,27,102,219,30, }; + u8 encoded_frame[] = { + 85, 4, 12, 66, 0, 253, 48, 10, 11, 12, 13, 2, 180, 160, + 116, 77, 243, 28, 173, 36, 86, 33, 8, 31, 120, 73, 64, 169, + 148, 224, 57, 95, 17, 40, 213, 92, 195, 146, 235, 228, 177, 101, + 82, 182, 25, 172, 170, 250, 236, 7, 119, 4, 201, 10, 14, 208, + 47, 126, 49, 210, 174, 75, 221, 203, 24, 66, 52, 35, 26, 30, + 140, 111, 246, 39, 226, 205, 198, 178, 196, 5, 81, 9, 44, 164, + 163, 214, 138, 123, 76, 74, 237, 121, 13, 137, 186, 97, 193, 189, + 200, 124, 69, 115, 230, 159, 185, 158, 51, 12, 225, 65, 192, 105, + 56, 41, 85, 133, 19, 217, 166, 48, 139, 131, 96, 216, 98, 147, + 132, 234, 167, 248, 247, 32, 239, 194, 188, 254, 114, 117, 83, 25, + 251, 191, 104, 240, 118, 68, 42, 93, 18, 16, 37, 232, 99, 179, + 23, 90, 94, 136, 6, 125, 91, 255, 15, 71, 43, 46, 25, 252, + 229, 80, 143, 58, 241, 11, 62, 181, 155, 53, 153, 149, 152, 227, + 150, 87, 112, 165, 2, 128, 231, 25, 157, 244, 204, 108, 253, 127, + 122, 145, 113, 162, 197, 171, 199, 54, 184, 222, 206, 67, 144, 78, + 187, 207, 60, 211, 141, 135, 106, 220, 79, 183, 245, 21, 161, 168, + 34, 129, 50, 176, 1, 218, 20, 130, 59, 249, 109, 219, 0, 100, + 103, 55, 29, 242, 110, 154, 190, 233, 142, 45, 61, 215, 202, 238, + 88, 209, 70, 63, 151, 27, 102, 219, 30, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ecdsa_certificate.certificate_bytes[0] = 180; - + test_msg.ecdsa_certificate.certificate_bytes[1] = 160; - + test_msg.ecdsa_certificate.certificate_bytes[2] = 116; - + test_msg.ecdsa_certificate.certificate_bytes[3] = 77; - + test_msg.ecdsa_certificate.certificate_bytes[4] = 243; - + test_msg.ecdsa_certificate.certificate_bytes[5] = 28; - + test_msg.ecdsa_certificate.certificate_bytes[6] = 173; - + test_msg.ecdsa_certificate.certificate_bytes[7] = 36; - + test_msg.ecdsa_certificate.certificate_bytes[8] = 86; - + test_msg.ecdsa_certificate.certificate_bytes[9] = 33; - + test_msg.ecdsa_certificate.certificate_bytes[10] = 8; - + test_msg.ecdsa_certificate.certificate_bytes[11] = 31; - + test_msg.ecdsa_certificate.certificate_bytes[12] = 120; - + test_msg.ecdsa_certificate.certificate_bytes[13] = 73; - + test_msg.ecdsa_certificate.certificate_bytes[14] = 64; - + test_msg.ecdsa_certificate.certificate_bytes[15] = 169; - + test_msg.ecdsa_certificate.certificate_bytes[16] = 148; - + test_msg.ecdsa_certificate.certificate_bytes[17] = 224; - + test_msg.ecdsa_certificate.certificate_bytes[18] = 57; - + test_msg.ecdsa_certificate.certificate_bytes[19] = 95; - + test_msg.ecdsa_certificate.certificate_bytes[20] = 17; - + test_msg.ecdsa_certificate.certificate_bytes[21] = 40; - + test_msg.ecdsa_certificate.certificate_bytes[22] = 213; - + test_msg.ecdsa_certificate.certificate_bytes[23] = 92; - + test_msg.ecdsa_certificate.certificate_bytes[24] = 195; - + test_msg.ecdsa_certificate.certificate_bytes[25] = 146; - + test_msg.ecdsa_certificate.certificate_bytes[26] = 235; - + test_msg.ecdsa_certificate.certificate_bytes[27] = 228; - + test_msg.ecdsa_certificate.certificate_bytes[28] = 177; - + test_msg.ecdsa_certificate.certificate_bytes[29] = 101; - + test_msg.ecdsa_certificate.certificate_bytes[30] = 82; - + test_msg.ecdsa_certificate.certificate_bytes[31] = 182; - + test_msg.ecdsa_certificate.certificate_bytes[32] = 25; - + test_msg.ecdsa_certificate.certificate_bytes[33] = 172; - + test_msg.ecdsa_certificate.certificate_bytes[34] = 170; - + test_msg.ecdsa_certificate.certificate_bytes[35] = 250; - + test_msg.ecdsa_certificate.certificate_bytes[36] = 236; - + test_msg.ecdsa_certificate.certificate_bytes[37] = 7; - + test_msg.ecdsa_certificate.certificate_bytes[38] = 119; - + test_msg.ecdsa_certificate.certificate_bytes[39] = 4; - + test_msg.ecdsa_certificate.certificate_bytes[40] = 201; - + test_msg.ecdsa_certificate.certificate_bytes[41] = 10; - + test_msg.ecdsa_certificate.certificate_bytes[42] = 14; - + test_msg.ecdsa_certificate.certificate_bytes[43] = 208; - + test_msg.ecdsa_certificate.certificate_bytes[44] = 47; - + test_msg.ecdsa_certificate.certificate_bytes[45] = 126; - + test_msg.ecdsa_certificate.certificate_bytes[46] = 49; - + test_msg.ecdsa_certificate.certificate_bytes[47] = 210; - + test_msg.ecdsa_certificate.certificate_bytes[48] = 174; - + test_msg.ecdsa_certificate.certificate_bytes[49] = 75; - + test_msg.ecdsa_certificate.certificate_bytes[50] = 221; - + test_msg.ecdsa_certificate.certificate_bytes[51] = 203; - + test_msg.ecdsa_certificate.certificate_bytes[52] = 24; - + test_msg.ecdsa_certificate.certificate_bytes[53] = 66; - + test_msg.ecdsa_certificate.certificate_bytes[54] = 52; - + test_msg.ecdsa_certificate.certificate_bytes[55] = 35; - + test_msg.ecdsa_certificate.certificate_bytes[56] = 26; - + test_msg.ecdsa_certificate.certificate_bytes[57] = 30; - + test_msg.ecdsa_certificate.certificate_bytes[58] = 140; - + test_msg.ecdsa_certificate.certificate_bytes[59] = 111; - + test_msg.ecdsa_certificate.certificate_bytes[60] = 246; - + test_msg.ecdsa_certificate.certificate_bytes[61] = 39; - + test_msg.ecdsa_certificate.certificate_bytes[62] = 226; - + test_msg.ecdsa_certificate.certificate_bytes[63] = 205; - + test_msg.ecdsa_certificate.certificate_bytes[64] = 198; - + test_msg.ecdsa_certificate.certificate_bytes[65] = 178; - + test_msg.ecdsa_certificate.certificate_bytes[66] = 196; - + test_msg.ecdsa_certificate.certificate_bytes[67] = 5; - + test_msg.ecdsa_certificate.certificate_bytes[68] = 81; - + test_msg.ecdsa_certificate.certificate_bytes[69] = 9; - + test_msg.ecdsa_certificate.certificate_bytes[70] = 44; - + test_msg.ecdsa_certificate.certificate_bytes[71] = 164; - + test_msg.ecdsa_certificate.certificate_bytes[72] = 163; - + test_msg.ecdsa_certificate.certificate_bytes[73] = 214; - + test_msg.ecdsa_certificate.certificate_bytes[74] = 138; - + test_msg.ecdsa_certificate.certificate_bytes[75] = 123; - + test_msg.ecdsa_certificate.certificate_bytes[76] = 76; - + test_msg.ecdsa_certificate.certificate_bytes[77] = 74; - + test_msg.ecdsa_certificate.certificate_bytes[78] = 237; - + test_msg.ecdsa_certificate.certificate_bytes[79] = 121; - + test_msg.ecdsa_certificate.certificate_bytes[80] = 13; - + test_msg.ecdsa_certificate.certificate_bytes[81] = 137; - + test_msg.ecdsa_certificate.certificate_bytes[82] = 186; - + test_msg.ecdsa_certificate.certificate_bytes[83] = 97; - + test_msg.ecdsa_certificate.certificate_bytes[84] = 193; - + test_msg.ecdsa_certificate.certificate_bytes[85] = 189; - + test_msg.ecdsa_certificate.certificate_bytes[86] = 200; - + test_msg.ecdsa_certificate.certificate_bytes[87] = 124; - + test_msg.ecdsa_certificate.certificate_bytes[88] = 69; - + test_msg.ecdsa_certificate.certificate_bytes[89] = 115; - + test_msg.ecdsa_certificate.certificate_bytes[90] = 230; - + test_msg.ecdsa_certificate.certificate_bytes[91] = 159; - + test_msg.ecdsa_certificate.certificate_bytes[92] = 185; - + test_msg.ecdsa_certificate.certificate_bytes[93] = 158; - + test_msg.ecdsa_certificate.certificate_bytes[94] = 51; - + test_msg.ecdsa_certificate.certificate_bytes[95] = 12; - + test_msg.ecdsa_certificate.certificate_bytes[96] = 225; - + test_msg.ecdsa_certificate.certificate_bytes[97] = 65; - + test_msg.ecdsa_certificate.certificate_bytes[98] = 192; - + test_msg.ecdsa_certificate.certificate_bytes[99] = 105; - + test_msg.ecdsa_certificate.certificate_bytes[100] = 56; - + test_msg.ecdsa_certificate.certificate_bytes[101] = 41; - + test_msg.ecdsa_certificate.certificate_bytes[102] = 85; - + test_msg.ecdsa_certificate.certificate_bytes[103] = 133; - + test_msg.ecdsa_certificate.certificate_bytes[104] = 19; - + test_msg.ecdsa_certificate.certificate_bytes[105] = 217; - + test_msg.ecdsa_certificate.certificate_bytes[106] = 166; - + test_msg.ecdsa_certificate.certificate_bytes[107] = 48; - + test_msg.ecdsa_certificate.certificate_bytes[108] = 139; - + test_msg.ecdsa_certificate.certificate_bytes[109] = 131; - + test_msg.ecdsa_certificate.certificate_bytes[110] = 96; - + test_msg.ecdsa_certificate.certificate_bytes[111] = 216; - + test_msg.ecdsa_certificate.certificate_bytes[112] = 98; - + test_msg.ecdsa_certificate.certificate_bytes[113] = 147; - + test_msg.ecdsa_certificate.certificate_bytes[114] = 132; - + test_msg.ecdsa_certificate.certificate_bytes[115] = 234; - + test_msg.ecdsa_certificate.certificate_bytes[116] = 167; - + test_msg.ecdsa_certificate.certificate_bytes[117] = 248; - + test_msg.ecdsa_certificate.certificate_bytes[118] = 247; - + test_msg.ecdsa_certificate.certificate_bytes[119] = 32; - + test_msg.ecdsa_certificate.certificate_bytes[120] = 239; - + test_msg.ecdsa_certificate.certificate_bytes[121] = 194; - + test_msg.ecdsa_certificate.certificate_bytes[122] = 188; - + test_msg.ecdsa_certificate.certificate_bytes[123] = 254; - + test_msg.ecdsa_certificate.certificate_bytes[124] = 114; - + test_msg.ecdsa_certificate.certificate_bytes[125] = 117; - + test_msg.ecdsa_certificate.certificate_bytes[126] = 83; - + test_msg.ecdsa_certificate.certificate_bytes[127] = 25; - + test_msg.ecdsa_certificate.certificate_bytes[128] = 251; - + test_msg.ecdsa_certificate.certificate_bytes[129] = 191; - + test_msg.ecdsa_certificate.certificate_bytes[130] = 104; - + test_msg.ecdsa_certificate.certificate_bytes[131] = 240; - + test_msg.ecdsa_certificate.certificate_bytes[132] = 118; - + test_msg.ecdsa_certificate.certificate_bytes[133] = 68; - + test_msg.ecdsa_certificate.certificate_bytes[134] = 42; - + test_msg.ecdsa_certificate.certificate_bytes[135] = 93; - + test_msg.ecdsa_certificate.certificate_bytes[136] = 18; - + test_msg.ecdsa_certificate.certificate_bytes[137] = 16; - + test_msg.ecdsa_certificate.certificate_bytes[138] = 37; - + test_msg.ecdsa_certificate.certificate_bytes[139] = 232; - + test_msg.ecdsa_certificate.certificate_bytes[140] = 99; - + test_msg.ecdsa_certificate.certificate_bytes[141] = 179; - + test_msg.ecdsa_certificate.certificate_bytes[142] = 23; - + test_msg.ecdsa_certificate.certificate_bytes[143] = 90; - + test_msg.ecdsa_certificate.certificate_bytes[144] = 94; - + test_msg.ecdsa_certificate.certificate_bytes[145] = 136; - + test_msg.ecdsa_certificate.certificate_bytes[146] = 6; - + test_msg.ecdsa_certificate.certificate_bytes[147] = 125; - + test_msg.ecdsa_certificate.certificate_bytes[148] = 91; - + test_msg.ecdsa_certificate.certificate_bytes[149] = 255; - + test_msg.ecdsa_certificate.certificate_bytes[150] = 15; - + test_msg.ecdsa_certificate.certificate_bytes[151] = 71; - + test_msg.ecdsa_certificate.certificate_bytes[152] = 43; - + test_msg.ecdsa_certificate.certificate_bytes[153] = 46; - + test_msg.ecdsa_certificate.certificate_bytes[154] = 25; - + test_msg.ecdsa_certificate.certificate_bytes[155] = 252; - + test_msg.ecdsa_certificate.certificate_bytes[156] = 229; - + test_msg.ecdsa_certificate.certificate_bytes[157] = 80; - + test_msg.ecdsa_certificate.certificate_bytes[158] = 143; - + test_msg.ecdsa_certificate.certificate_bytes[159] = 58; - + test_msg.ecdsa_certificate.certificate_bytes[160] = 241; - + test_msg.ecdsa_certificate.certificate_bytes[161] = 11; - + test_msg.ecdsa_certificate.certificate_bytes[162] = 62; - + test_msg.ecdsa_certificate.certificate_bytes[163] = 181; - + test_msg.ecdsa_certificate.certificate_bytes[164] = 155; - + test_msg.ecdsa_certificate.certificate_bytes[165] = 53; - + test_msg.ecdsa_certificate.certificate_bytes[166] = 153; - + test_msg.ecdsa_certificate.certificate_bytes[167] = 149; - + test_msg.ecdsa_certificate.certificate_bytes[168] = 152; - + test_msg.ecdsa_certificate.certificate_bytes[169] = 227; - + test_msg.ecdsa_certificate.certificate_bytes[170] = 150; - + test_msg.ecdsa_certificate.certificate_bytes[171] = 87; - + test_msg.ecdsa_certificate.certificate_bytes[172] = 112; - + test_msg.ecdsa_certificate.certificate_bytes[173] = 165; - + test_msg.ecdsa_certificate.certificate_bytes[174] = 2; - + test_msg.ecdsa_certificate.certificate_bytes[175] = 128; - + test_msg.ecdsa_certificate.certificate_bytes[176] = 231; - + test_msg.ecdsa_certificate.certificate_bytes[177] = 25; - + test_msg.ecdsa_certificate.certificate_bytes[178] = 157; - + test_msg.ecdsa_certificate.certificate_bytes[179] = 244; - + test_msg.ecdsa_certificate.certificate_bytes[180] = 204; - + test_msg.ecdsa_certificate.certificate_bytes[181] = 108; - + test_msg.ecdsa_certificate.certificate_bytes[182] = 253; - + test_msg.ecdsa_certificate.certificate_bytes[183] = 127; - + test_msg.ecdsa_certificate.certificate_bytes[184] = 122; - + test_msg.ecdsa_certificate.certificate_bytes[185] = 145; - + test_msg.ecdsa_certificate.certificate_bytes[186] = 113; - + test_msg.ecdsa_certificate.certificate_bytes[187] = 162; - + test_msg.ecdsa_certificate.certificate_bytes[188] = 197; - + test_msg.ecdsa_certificate.certificate_bytes[189] = 171; - + test_msg.ecdsa_certificate.certificate_bytes[190] = 199; - + test_msg.ecdsa_certificate.certificate_bytes[191] = 54; - + test_msg.ecdsa_certificate.certificate_bytes[192] = 184; - + test_msg.ecdsa_certificate.certificate_bytes[193] = 222; - + test_msg.ecdsa_certificate.certificate_bytes[194] = 206; - + test_msg.ecdsa_certificate.certificate_bytes[195] = 67; - + test_msg.ecdsa_certificate.certificate_bytes[196] = 144; - + test_msg.ecdsa_certificate.certificate_bytes[197] = 78; - + test_msg.ecdsa_certificate.certificate_bytes[198] = 187; - + test_msg.ecdsa_certificate.certificate_bytes[199] = 207; - + test_msg.ecdsa_certificate.certificate_bytes[200] = 60; - + test_msg.ecdsa_certificate.certificate_bytes[201] = 211; - + test_msg.ecdsa_certificate.certificate_bytes[202] = 141; - + test_msg.ecdsa_certificate.certificate_bytes[203] = 135; - + test_msg.ecdsa_certificate.certificate_bytes[204] = 106; - + test_msg.ecdsa_certificate.certificate_bytes[205] = 220; - + test_msg.ecdsa_certificate.certificate_bytes[206] = 79; - + test_msg.ecdsa_certificate.certificate_bytes[207] = 183; - + test_msg.ecdsa_certificate.certificate_bytes[208] = 245; - + test_msg.ecdsa_certificate.certificate_bytes[209] = 21; - + test_msg.ecdsa_certificate.certificate_bytes[210] = 161; - + test_msg.ecdsa_certificate.certificate_bytes[211] = 168; - + test_msg.ecdsa_certificate.certificate_bytes[212] = 34; - + test_msg.ecdsa_certificate.certificate_bytes[213] = 129; - + test_msg.ecdsa_certificate.certificate_bytes[214] = 50; - + test_msg.ecdsa_certificate.certificate_bytes[215] = 176; - + test_msg.ecdsa_certificate.certificate_bytes[216] = 1; - + test_msg.ecdsa_certificate.certificate_bytes[217] = 218; - + test_msg.ecdsa_certificate.certificate_bytes[218] = 20; - + test_msg.ecdsa_certificate.certificate_bytes[219] = 130; - + test_msg.ecdsa_certificate.certificate_bytes[220] = 59; - + test_msg.ecdsa_certificate.certificate_bytes[221] = 249; - + test_msg.ecdsa_certificate.certificate_bytes[222] = 109; - + test_msg.ecdsa_certificate.certificate_bytes[223] = 219; - + test_msg.ecdsa_certificate.certificate_bytes[224] = 0; - + test_msg.ecdsa_certificate.certificate_bytes[225] = 100; - + test_msg.ecdsa_certificate.certificate_bytes[226] = 103; - + test_msg.ecdsa_certificate.certificate_bytes[227] = 55; - + test_msg.ecdsa_certificate.certificate_bytes[228] = 29; - + test_msg.ecdsa_certificate.certificate_bytes[229] = 242; - + test_msg.ecdsa_certificate.certificate_bytes[230] = 110; - + test_msg.ecdsa_certificate.certificate_bytes[231] = 154; - + test_msg.ecdsa_certificate.certificate_bytes[232] = 190; - + test_msg.ecdsa_certificate.certificate_bytes[233] = 233; - + test_msg.ecdsa_certificate.certificate_bytes[234] = 142; - + test_msg.ecdsa_certificate.certificate_bytes[235] = 45; - + test_msg.ecdsa_certificate.certificate_bytes[236] = 61; - + test_msg.ecdsa_certificate.certificate_bytes[237] = 215; - + test_msg.ecdsa_certificate.certificate_bytes[238] = 202; - + test_msg.ecdsa_certificate.certificate_bytes[239] = 238; - + test_msg.ecdsa_certificate.certificate_bytes[240] = 88; - + test_msg.ecdsa_certificate.certificate_bytes[241] = 209; - + test_msg.ecdsa_certificate.certificate_bytes[242] = 70; - + test_msg.ecdsa_certificate.certificate_bytes[243] = 63; - + test_msg.ecdsa_certificate.certificate_bytes[244] = 151; - + test_msg.ecdsa_certificate.certificate_bytes[245] = 27; - + test_msg.ecdsa_certificate.certificate_bytes[246] = 102; - - + test_msg.ecdsa_certificate.certificate_id[0] = 10; - + test_msg.ecdsa_certificate.certificate_id[1] = 11; - + test_msg.ecdsa_certificate.certificate_id[2] = 12; - + test_msg.ecdsa_certificate.certificate_id[3] = 13; - + test_msg.ecdsa_certificate.flags = 2; - + test_msg.ecdsa_certificate.n_certificate_bytes = 247; - + test_msg.ecdsa_certificate.n_msg = 48; - sbp_message_send(&sbp_state, SbpMsgEcdsaCertificate, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEcdsaCertificate, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEcdsaCertificate, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEcdsaCertificate, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[0] == 180, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[0], expected 180, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[0]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[1] == 160, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[1], expected 160, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[1]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[2] == 116, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[2], expected 116, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[2]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[3] == 77, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[3], expected 77, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[3]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[4] == 243, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[4], expected 243, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[4]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[5] == 28, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[5], expected 28, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[5]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[6] == 173, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[6], expected 173, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[6]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[7] == 36, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[7], expected 36, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[7]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[8] == 86, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[8], expected 86, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[8]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[9] == 33, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[9], expected 33, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[9]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[10] == 8, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[10], expected 8, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[10]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[11] == 31, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[11], expected 31, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[11]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[12] == 120, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[12], expected 120, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[12]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[13] == 73, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[13], expected 73, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[13]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[14] == 64, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[14], expected 64, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[14]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[15] == 169, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[15], expected 169, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[15]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[16] == 148, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[16], expected 148, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[16]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[17] == 224, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[17], expected 224, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[17]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[18] == 57, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[18], expected 57, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[18]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[19] == 95, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[19], expected 95, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[19]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[20] == 17, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[20], expected 17, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[20]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[21] == 40, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[21], expected 40, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[21]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[22] == 213, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[22], expected 213, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[22]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[23] == 92, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[23], expected 92, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[23]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[24] == 195, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[24], expected 195, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[24]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[25] == 146, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[25], expected 146, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[25]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[26] == 235, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[26], expected 235, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[26]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[27] == 228, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[27], expected 228, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[27]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[28] == 177, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[28], expected 177, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[28]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[29] == 101, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[29], expected 101, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[29]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[30] == 82, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[30], expected 82, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[30]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[31] == 182, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[31], expected 182, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[31]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[32] == 25, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[32], expected 25, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[32]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[33] == 172, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[33], expected 172, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[33]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[34] == 170, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[34], expected 170, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[34]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[35] == 250, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[35], expected 250, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[35]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[36] == 236, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[36], expected 236, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[36]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[37] == 7, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[37], expected 7, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[37]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[38] == 119, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[38], expected 119, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[38]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[39] == 4, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[39], expected 4, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[39]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[40] == 201, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[40], expected 201, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[40]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[41] == 10, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[41], expected 10, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[41]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[42] == 14, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[42], expected 14, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[42]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[43] == 208, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[43], expected 208, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[43]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[44] == 47, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[44], expected 47, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[44]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[45] == 126, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[45], expected 126, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[45]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[46] == 49, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[46], expected 49, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[46]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[47] == 210, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[47], expected 210, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[47]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[48] == 174, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[48], expected 174, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[48]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[49] == 75, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[49], expected 75, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[49]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[50] == 221, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[50], expected 221, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[50]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[51] == 203, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[51], expected 203, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[51]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[52] == 24, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[52], expected 24, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[52]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[53] == 66, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[53], expected 66, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[53]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[54] == 52, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[54], expected 52, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[54]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[55] == 35, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[55], expected 35, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[55]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[56] == 26, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[56], expected 26, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[56]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[57] == 30, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[57], expected 30, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[57]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[58] == 140, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[58], expected 140, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[58]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[59] == 111, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[59], expected 111, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[59]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[60] == 246, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[60], expected 246, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[60]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[61] == 39, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[61], expected 39, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[61]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[62] == 226, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[62], expected 226, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[62]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[63] == 205, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[63], expected 205, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[63]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[64] == 198, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[64], expected 198, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[64]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[65] == 178, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[65], expected 178, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[65]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[66] == 196, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[66], expected 196, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[66]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[67] == 5, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[67], expected 5, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[67]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[68] == 81, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[68], expected 81, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[68]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[69] == 9, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[69], expected 9, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[69]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[70] == 44, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[70], expected 44, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[70]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[71] == 164, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[71], expected 164, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[71]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[72] == 163, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[72], expected 163, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[72]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[73] == 214, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[73], expected 214, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[73]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[74] == 138, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[74], expected 138, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[74]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[75] == 123, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[75], expected 123, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[75]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[76] == 76, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[76], expected 76, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[76]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[77] == 74, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[77], expected 74, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[77]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[78] == 237, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[78], expected 237, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[78]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[79] == 121, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[79], expected 121, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[79]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[80] == 13, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[80], expected 13, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[80]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[81] == 137, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[81], expected 137, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[81]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[82] == 186, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[82], expected 186, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[82]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[83] == 97, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[83], expected 97, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[83]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[84] == 193, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[84], expected 193, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[84]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[85] == 189, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[85], expected 189, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[85]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[86] == 200, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[86], expected 200, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[86]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[87] == 124, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[87], expected 124, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[87]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[88] == 69, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[88], expected 69, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[88]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[89] == 115, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[89], expected 115, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[89]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[90] == 230, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[90], expected 230, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[90]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[91] == 159, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[91], expected 159, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[91]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[92] == 185, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[92], expected 185, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[92]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[93] == 158, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[93], expected 158, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[93]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[94] == 51, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[94], expected 51, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[94]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[95] == 12, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[95], expected 12, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[95]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[96] == 225, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[96], expected 225, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[96]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[97] == 65, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[97], expected 65, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[97]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[98] == 192, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[98], expected 192, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[98]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[99] == 105, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[99], expected 105, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[99]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[100] == 56, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[100], expected 56, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[100]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[101] == 41, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[101], expected 41, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[101]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[102] == 85, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[102], expected 85, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[102]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[103] == 133, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[103], expected 133, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[103]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[104] == 19, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[104], expected 19, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[104]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[105] == 217, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[105], expected 217, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[105]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[106] == 166, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[106], expected 166, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[106]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[107] == 48, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[107], expected 48, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[107]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[108] == 139, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[108], expected 139, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[108]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[109] == 131, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[109], expected 131, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[109]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[110] == 96, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[110], expected 96, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[110]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[111] == 216, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[111], expected 216, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[111]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[112] == 98, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[112], expected 98, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[112]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[113] == 147, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[113], expected 147, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[113]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[114] == 132, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[114], expected 132, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[114]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[115] == 234, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[115], expected 234, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[115]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[116] == 167, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[116], expected 167, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[116]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[117] == 248, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[117], expected 248, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[117]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[118] == 247, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[118], expected 247, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[118]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[119] == 32, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[119], expected 32, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[119]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[120] == 239, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[120], expected 239, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[120]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[121] == 194, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[121], expected 194, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[121]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[122] == 188, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[122], expected 188, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[122]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[123] == 254, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[123], expected 254, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[123]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[124] == 114, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[124], expected 114, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[124]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[125] == 117, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[125], expected 117, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[125]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[126] == 83, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[126], expected 83, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[126]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[127] == 25, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[127], expected 25, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[127]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[128] == 251, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[128], expected 251, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[128]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[129] == 191, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[129], expected 191, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[129]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[130] == 104, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[130], expected 104, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[130]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[131] == 240, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[131], expected 240, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[131]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[132] == 118, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[132], expected 118, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[132]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[133] == 68, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[133], expected 68, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[133]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[134] == 42, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[134], expected 42, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[134]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[135] == 93, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[135], expected 93, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[135]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[136] == 18, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[136], expected 18, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[136]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[137] == 16, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[137], expected 16, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[137]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[138] == 37, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[138], expected 37, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[138]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[139] == 232, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[139], expected 232, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[139]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[140] == 99, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[140], expected 99, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[140]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[141] == 179, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[141], expected 179, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[141]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[142] == 23, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[142], expected 23, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[142]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[143] == 90, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[143], expected 90, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[143]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[144] == 94, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[144], expected 94, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[144]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[145] == 136, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[145], expected 136, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[145]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[146] == 6, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[146], expected 6, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[146]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[147] == 125, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[147], expected 125, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[147]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[148] == 91, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[148], expected 91, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[148]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[149] == 255, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[149], expected 255, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[149]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[150] == 15, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[150], expected 15, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[150]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[151] == 71, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[151], expected 71, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[151]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[152] == 43, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[152], expected 43, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[152]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[153] == 46, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[153], expected 46, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[153]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[154] == 25, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[154], expected 25, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[154]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[155] == 252, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[155], expected 252, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[155]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[156] == 229, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[156], expected 229, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[156]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[157] == 80, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[157], expected 80, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[157]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[158] == 143, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[158], expected 143, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[158]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[159] == 58, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[159], expected 58, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[159]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[160] == 241, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[160], expected 241, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[160]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[161] == 11, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[161], expected 11, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[161]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[162] == 62, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[162], expected 62, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[162]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[163] == 181, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[163], expected 181, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[163]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[164] == 155, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[164], expected 155, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[164]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[165] == 53, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[165], expected 53, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[165]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[166] == 153, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[166], expected 153, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[166]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[167] == 149, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[167], expected 149, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[167]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[168] == 152, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[168], expected 152, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[168]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[169] == 227, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[169], expected 227, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[169]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[170] == 150, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[170], expected 150, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[170]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[171] == 87, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[171], expected 87, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[171]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[172] == 112, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[172], expected 112, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[172]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[173] == 165, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[173], expected 165, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[173]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[174] == 2, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[174], expected 2, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[174]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[175] == 128, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[175], expected 128, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[175]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[176] == 231, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[176], expected 231, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[176]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[177] == 25, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[177], expected 25, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[177]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[178] == 157, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[178], expected 157, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[178]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[179] == 244, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[179], expected 244, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[179]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[180] == 204, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[180], expected 204, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[180]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[181] == 108, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[181], expected 108, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[181]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[182] == 253, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[182], expected 253, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[182]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[183] == 127, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[183], expected 127, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[183]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[184] == 122, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[184], expected 122, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[184]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[185] == 145, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[185], expected 145, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[185]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[186] == 113, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[186], expected 113, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[186]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[187] == 162, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[187], expected 162, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[187]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[188] == 197, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[188], expected 197, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[188]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[189] == 171, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[189], expected 171, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[189]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[190] == 199, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[190], expected 199, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[190]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[191] == 54, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[191], expected 54, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[191]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[192] == 184, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[192], expected 184, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[192]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[193] == 222, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[193], expected 222, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[193]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[194] == 206, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[194], expected 206, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[194]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[195] == 67, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[195], expected 67, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[195]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[196] == 144, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[196], expected 144, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[196]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[197] == 78, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[197], expected 78, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[197]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[198] == 187, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[198], expected 187, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[198]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[199] == 207, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[199], expected 207, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[199]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[200] == 60, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[200], expected 60, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[200]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[201] == 211, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[201], expected 211, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[201]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[202] == 141, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[202], expected 141, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[202]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[203] == 135, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[203], expected 135, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[203]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[204] == 106, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[204], expected 106, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[204]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[205] == 220, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[205], expected 220, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[205]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[206] == 79, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[206], expected 79, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[206]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[207] == 183, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[207], expected 183, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[207]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[208] == 245, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[208], expected 245, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[208]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[209] == 21, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[209], expected 21, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[209]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[210] == 161, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[210], expected 161, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[210]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[211] == 168, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[211], expected 168, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[211]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[212] == 34, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[212], expected 34, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[212]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[213] == 129, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[213], expected 129, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[213]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[214] == 50, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[214], expected 50, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[214]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[215] == 176, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[215], expected 176, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[215]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[216] == 1, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[216], expected 1, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[216]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[217] == 218, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[217], expected 218, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[217]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[218] == 20, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[218], expected 20, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[218]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[219] == 130, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[219], expected 130, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[219]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[220] == 59, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[220], expected 59, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[220]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[221] == 249, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[221], expected 249, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[221]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[222] == 109, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[222], expected 109, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[222]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[223] == 219, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[223], expected 219, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[223]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[224] == 0, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[224], expected 0, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[224]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[225] == 100, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[225], expected 100, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[225]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[226] == 103, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[226], expected 103, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[226]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[227] == 55, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[227], expected 55, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[227]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[228] == 29, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[228], expected 29, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[228]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[229] == 242, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[229], expected 242, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[229]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[230] == 110, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[230], expected 110, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[230]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[231] == 154, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[231], expected 154, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[231]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[232] == 190, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[232], expected 190, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[232]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[233] == 233, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[233], expected 233, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[233]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[234] == 142, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[234], expected 142, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[234]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[235] == 45, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[235], expected 45, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[235]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[236] == 61, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[236], expected 61, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[236]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[237] == 215, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[237], expected 215, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[237]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[238] == 202, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[238], expected 202, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[238]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[239] == 238, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[239], expected 238, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[239]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[240] == 88, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[240], expected 88, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[240]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[241] == 209, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[241], expected 209, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[241]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[242] == 70, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[242], expected 70, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[242]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[243] == 63, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[243], expected 63, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[243]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[244] == 151, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[244], expected 151, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[244]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[245] == 27, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[245], expected 27, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[245]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[246] == 102, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_bytes[246], expected 102, is %d", last_msg.msg.ecdsa_certificate.certificate_bytes[246]); - - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_id[0] == 10, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_id[0], expected 10, is %d", last_msg.msg.ecdsa_certificate.certificate_id[0]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_id[1] == 11, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_id[1], expected 11, is %d", last_msg.msg.ecdsa_certificate.certificate_id[1]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_id[2] == 12, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_id[2], expected 12, is %d", last_msg.msg.ecdsa_certificate.certificate_id[2]); - ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_id[3] == 13, "incorrect value for last_msg.msg.ecdsa_certificate.certificate_id[3], expected 13, is %d", last_msg.msg.ecdsa_certificate.certificate_id[3]); - - ck_assert_msg(last_msg.msg.ecdsa_certificate.flags == 2, "incorrect value for last_msg.msg.ecdsa_certificate.flags, expected 2, is %d", last_msg.msg.ecdsa_certificate.flags); - - ck_assert_msg(last_msg.msg.ecdsa_certificate.n_certificate_bytes == 247, "incorrect value for last_msg.msg.ecdsa_certificate.n_certificate_bytes, expected 247, is %d", last_msg.msg.ecdsa_certificate.n_certificate_bytes); - - ck_assert_msg(last_msg.msg.ecdsa_certificate.n_msg == 48, "incorrect value for last_msg.msg.ecdsa_certificate.n_msg, expected 48, is %d", last_msg.msg.ecdsa_certificate.n_msg); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[0] == 180, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[0], " + "expected 180, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[0]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[1] == 160, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[1], " + "expected 160, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[1]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[2] == 116, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[2], " + "expected 116, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[2]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[3] == 77, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[3], " + "expected 77, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[3]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[4] == 243, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[4], " + "expected 243, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[4]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[5] == 28, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[5], " + "expected 28, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[5]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[6] == 173, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[6], " + "expected 173, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[6]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[7] == 36, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[7], " + "expected 36, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[7]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[8] == 86, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[8], " + "expected 86, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[8]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[9] == 33, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[9], " + "expected 33, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[9]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[10] == 8, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[10], " + "expected 8, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[10]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[11] == 31, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[11], " + "expected 31, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[11]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[12] == 120, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[12], " + "expected 120, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[12]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[13] == 73, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[13], " + "expected 73, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[13]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[14] == 64, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[14], " + "expected 64, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[14]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[15] == 169, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[15], " + "expected 169, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[15]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[16] == 148, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[16], " + "expected 148, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[16]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[17] == 224, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[17], " + "expected 224, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[17]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[18] == 57, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[18], " + "expected 57, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[18]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[19] == 95, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[19], " + "expected 95, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[19]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[20] == 17, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[20], " + "expected 17, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[20]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[21] == 40, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[21], " + "expected 40, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[21]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[22] == 213, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[22], " + "expected 213, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[22]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[23] == 92, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[23], " + "expected 92, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[23]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[24] == 195, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[24], " + "expected 195, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[24]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[25] == 146, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[25], " + "expected 146, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[25]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[26] == 235, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[26], " + "expected 235, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[26]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[27] == 228, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[27], " + "expected 228, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[27]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[28] == 177, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[28], " + "expected 177, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[28]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[29] == 101, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[29], " + "expected 101, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[29]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[30] == 82, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[30], " + "expected 82, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[30]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[31] == 182, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[31], " + "expected 182, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[31]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[32] == 25, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[32], " + "expected 25, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[32]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[33] == 172, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[33], " + "expected 172, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[33]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[34] == 170, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[34], " + "expected 170, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[34]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[35] == 250, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[35], " + "expected 250, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[35]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[36] == 236, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[36], " + "expected 236, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[36]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[37] == 7, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[37], " + "expected 7, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[37]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[38] == 119, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[38], " + "expected 119, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[38]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[39] == 4, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[39], " + "expected 4, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[39]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[40] == 201, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[40], " + "expected 201, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[40]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[41] == 10, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[41], " + "expected 10, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[41]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[42] == 14, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[42], " + "expected 14, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[42]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[43] == 208, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[43], " + "expected 208, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[43]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[44] == 47, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[44], " + "expected 47, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[44]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[45] == 126, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[45], " + "expected 126, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[45]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[46] == 49, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[46], " + "expected 49, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[46]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[47] == 210, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[47], " + "expected 210, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[47]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[48] == 174, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[48], " + "expected 174, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[48]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[49] == 75, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[49], " + "expected 75, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[49]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[50] == 221, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[50], " + "expected 221, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[50]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[51] == 203, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[51], " + "expected 203, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[51]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[52] == 24, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[52], " + "expected 24, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[52]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[53] == 66, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[53], " + "expected 66, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[53]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[54] == 52, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[54], " + "expected 52, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[54]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[55] == 35, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[55], " + "expected 35, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[55]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[56] == 26, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[56], " + "expected 26, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[56]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[57] == 30, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[57], " + "expected 30, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[57]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[58] == 140, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[58], " + "expected 140, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[58]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[59] == 111, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[59], " + "expected 111, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[59]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[60] == 246, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[60], " + "expected 246, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[60]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[61] == 39, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[61], " + "expected 39, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[61]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[62] == 226, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[62], " + "expected 226, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[62]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[63] == 205, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[63], " + "expected 205, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[63]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[64] == 198, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[64], " + "expected 198, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[64]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[65] == 178, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[65], " + "expected 178, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[65]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[66] == 196, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[66], " + "expected 196, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[66]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[67] == 5, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[67], " + "expected 5, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[67]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[68] == 81, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[68], " + "expected 81, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[68]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[69] == 9, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[69], " + "expected 9, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[69]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[70] == 44, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[70], " + "expected 44, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[70]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[71] == 164, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[71], " + "expected 164, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[71]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[72] == 163, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[72], " + "expected 163, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[72]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[73] == 214, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[73], " + "expected 214, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[73]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[74] == 138, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[74], " + "expected 138, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[74]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[75] == 123, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[75], " + "expected 123, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[75]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[76] == 76, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[76], " + "expected 76, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[76]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[77] == 74, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[77], " + "expected 74, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[77]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[78] == 237, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[78], " + "expected 237, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[78]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[79] == 121, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[79], " + "expected 121, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[79]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[80] == 13, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[80], " + "expected 13, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[80]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[81] == 137, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[81], " + "expected 137, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[81]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[82] == 186, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[82], " + "expected 186, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[82]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[83] == 97, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[83], " + "expected 97, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[83]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[84] == 193, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[84], " + "expected 193, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[84]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[85] == 189, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[85], " + "expected 189, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[85]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[86] == 200, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[86], " + "expected 200, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[86]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[87] == 124, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[87], " + "expected 124, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[87]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[88] == 69, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[88], " + "expected 69, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[88]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[89] == 115, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[89], " + "expected 115, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[89]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[90] == 230, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[90], " + "expected 230, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[90]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[91] == 159, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[91], " + "expected 159, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[91]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[92] == 185, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[92], " + "expected 185, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[92]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[93] == 158, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[93], " + "expected 158, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[93]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[94] == 51, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[94], " + "expected 51, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[94]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[95] == 12, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[95], " + "expected 12, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[95]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[96] == 225, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[96], " + "expected 225, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[96]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[97] == 65, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[97], " + "expected 65, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[97]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[98] == 192, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[98], " + "expected 192, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[98]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[99] == 105, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[99], " + "expected 105, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[99]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[100] == 56, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[100], " + "expected 56, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[100]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[101] == 41, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[101], " + "expected 41, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[101]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[102] == 85, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[102], " + "expected 85, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[102]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[103] == 133, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[103], " + "expected 133, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[103]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[104] == 19, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[104], " + "expected 19, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[104]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[105] == 217, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[105], " + "expected 217, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[105]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[106] == 166, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[106], " + "expected 166, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[106]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[107] == 48, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[107], " + "expected 48, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[107]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[108] == 139, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[108], " + "expected 139, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[108]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[109] == 131, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[109], " + "expected 131, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[109]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[110] == 96, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[110], " + "expected 96, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[110]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[111] == 216, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[111], " + "expected 216, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[111]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[112] == 98, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[112], " + "expected 98, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[112]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[113] == 147, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[113], " + "expected 147, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[113]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[114] == 132, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[114], " + "expected 132, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[114]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[115] == 234, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[115], " + "expected 234, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[115]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[116] == 167, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[116], " + "expected 167, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[116]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[117] == 248, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[117], " + "expected 248, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[117]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[118] == 247, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[118], " + "expected 247, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[118]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[119] == 32, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[119], " + "expected 32, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[119]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[120] == 239, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[120], " + "expected 239, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[120]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[121] == 194, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[121], " + "expected 194, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[121]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[122] == 188, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[122], " + "expected 188, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[122]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[123] == 254, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[123], " + "expected 254, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[123]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[124] == 114, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[124], " + "expected 114, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[124]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[125] == 117, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[125], " + "expected 117, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[125]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[126] == 83, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[126], " + "expected 83, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[126]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[127] == 25, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[127], " + "expected 25, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[127]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[128] == 251, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[128], " + "expected 251, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[128]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[129] == 191, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[129], " + "expected 191, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[129]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[130] == 104, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[130], " + "expected 104, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[130]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[131] == 240, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[131], " + "expected 240, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[131]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[132] == 118, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[132], " + "expected 118, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[132]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[133] == 68, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[133], " + "expected 68, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[133]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[134] == 42, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[134], " + "expected 42, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[134]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[135] == 93, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[135], " + "expected 93, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[135]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[136] == 18, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[136], " + "expected 18, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[136]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[137] == 16, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[137], " + "expected 16, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[137]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[138] == 37, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[138], " + "expected 37, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[138]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[139] == 232, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[139], " + "expected 232, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[139]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[140] == 99, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[140], " + "expected 99, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[140]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[141] == 179, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[141], " + "expected 179, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[141]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[142] == 23, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[142], " + "expected 23, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[142]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[143] == 90, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[143], " + "expected 90, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[143]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[144] == 94, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[144], " + "expected 94, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[144]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[145] == 136, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[145], " + "expected 136, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[145]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[146] == 6, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[146], " + "expected 6, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[146]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[147] == 125, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[147], " + "expected 125, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[147]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[148] == 91, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[148], " + "expected 91, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[148]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[149] == 255, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[149], " + "expected 255, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[149]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[150] == 15, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[150], " + "expected 15, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[150]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[151] == 71, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[151], " + "expected 71, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[151]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[152] == 43, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[152], " + "expected 43, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[152]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[153] == 46, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[153], " + "expected 46, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[153]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[154] == 25, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[154], " + "expected 25, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[154]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[155] == 252, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[155], " + "expected 252, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[155]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[156] == 229, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[156], " + "expected 229, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[156]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[157] == 80, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[157], " + "expected 80, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[157]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[158] == 143, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[158], " + "expected 143, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[158]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[159] == 58, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[159], " + "expected 58, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[159]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[160] == 241, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[160], " + "expected 241, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[160]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[161] == 11, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[161], " + "expected 11, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[161]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[162] == 62, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[162], " + "expected 62, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[162]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[163] == 181, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[163], " + "expected 181, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[163]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[164] == 155, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[164], " + "expected 155, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[164]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[165] == 53, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[165], " + "expected 53, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[165]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[166] == 153, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[166], " + "expected 153, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[166]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[167] == 149, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[167], " + "expected 149, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[167]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[168] == 152, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[168], " + "expected 152, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[168]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[169] == 227, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[169], " + "expected 227, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[169]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[170] == 150, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[170], " + "expected 150, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[170]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[171] == 87, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[171], " + "expected 87, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[171]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[172] == 112, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[172], " + "expected 112, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[172]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[173] == 165, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[173], " + "expected 165, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[173]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[174] == 2, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[174], " + "expected 2, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[174]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[175] == 128, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[175], " + "expected 128, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[175]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[176] == 231, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[176], " + "expected 231, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[176]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[177] == 25, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[177], " + "expected 25, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[177]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[178] == 157, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[178], " + "expected 157, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[178]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[179] == 244, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[179], " + "expected 244, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[179]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[180] == 204, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[180], " + "expected 204, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[180]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[181] == 108, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[181], " + "expected 108, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[181]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[182] == 253, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[182], " + "expected 253, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[182]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[183] == 127, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[183], " + "expected 127, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[183]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[184] == 122, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[184], " + "expected 122, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[184]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[185] == 145, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[185], " + "expected 145, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[185]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[186] == 113, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[186], " + "expected 113, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[186]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[187] == 162, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[187], " + "expected 162, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[187]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[188] == 197, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[188], " + "expected 197, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[188]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[189] == 171, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[189], " + "expected 171, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[189]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[190] == 199, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[190], " + "expected 199, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[190]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[191] == 54, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[191], " + "expected 54, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[191]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[192] == 184, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[192], " + "expected 184, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[192]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[193] == 222, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[193], " + "expected 222, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[193]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[194] == 206, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[194], " + "expected 206, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[194]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[195] == 67, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[195], " + "expected 67, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[195]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[196] == 144, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[196], " + "expected 144, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[196]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[197] == 78, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[197], " + "expected 78, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[197]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[198] == 187, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[198], " + "expected 187, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[198]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[199] == 207, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[199], " + "expected 207, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[199]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[200] == 60, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[200], " + "expected 60, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[200]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[201] == 211, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[201], " + "expected 211, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[201]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[202] == 141, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[202], " + "expected 141, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[202]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[203] == 135, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[203], " + "expected 135, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[203]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[204] == 106, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[204], " + "expected 106, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[204]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[205] == 220, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[205], " + "expected 220, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[205]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[206] == 79, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[206], " + "expected 79, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[206]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[207] == 183, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[207], " + "expected 183, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[207]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[208] == 245, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[208], " + "expected 245, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[208]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[209] == 21, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[209], " + "expected 21, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[209]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[210] == 161, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[210], " + "expected 161, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[210]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[211] == 168, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[211], " + "expected 168, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[211]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[212] == 34, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[212], " + "expected 34, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[212]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[213] == 129, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[213], " + "expected 129, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[213]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[214] == 50, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[214], " + "expected 50, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[214]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[215] == 176, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[215], " + "expected 176, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[215]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[216] == 1, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[216], " + "expected 1, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[216]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[217] == 218, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[217], " + "expected 218, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[217]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[218] == 20, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[218], " + "expected 20, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[218]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[219] == 130, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[219], " + "expected 130, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[219]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[220] == 59, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[220], " + "expected 59, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[220]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[221] == 249, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[221], " + "expected 249, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[221]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[222] == 109, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[222], " + "expected 109, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[222]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[223] == 219, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[223], " + "expected 219, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[223]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[224] == 0, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[224], " + "expected 0, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[224]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[225] == 100, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[225], " + "expected 100, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[225]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[226] == 103, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[226], " + "expected 103, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[226]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[227] == 55, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[227], " + "expected 55, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[227]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[228] == 29, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[228], " + "expected 29, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[228]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[229] == 242, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[229], " + "expected 242, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[229]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[230] == 110, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[230], " + "expected 110, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[230]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[231] == 154, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[231], " + "expected 154, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[231]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[232] == 190, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[232], " + "expected 190, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[232]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[233] == 233, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[233], " + "expected 233, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[233]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[234] == 142, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[234], " + "expected 142, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[234]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[235] == 45, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[235], " + "expected 45, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[235]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[236] == 61, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[236], " + "expected 61, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[236]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[237] == 215, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[237], " + "expected 215, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[237]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[238] == 202, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[238], " + "expected 202, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[238]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[239] == 238, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[239], " + "expected 238, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[239]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[240] == 88, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[240], " + "expected 88, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[240]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[241] == 209, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[241], " + "expected 209, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[241]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[242] == 70, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[242], " + "expected 70, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[242]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[243] == 63, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[243], " + "expected 63, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[243]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[244] == 151, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[244], " + "expected 151, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[244]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[245] == 27, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[245], " + "expected 27, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[245]); + ck_assert_msg(last_msg.msg.ecdsa_certificate.certificate_bytes[246] == 102, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.certificate_bytes[246], " + "expected 102, is %d", + last_msg.msg.ecdsa_certificate.certificate_bytes[246]); + + ck_assert_msg( + last_msg.msg.ecdsa_certificate.certificate_id[0] == 10, + "incorrect value for last_msg.msg.ecdsa_certificate.certificate_id[0], " + "expected 10, is %d", + last_msg.msg.ecdsa_certificate.certificate_id[0]); + ck_assert_msg( + last_msg.msg.ecdsa_certificate.certificate_id[1] == 11, + "incorrect value for last_msg.msg.ecdsa_certificate.certificate_id[1], " + "expected 11, is %d", + last_msg.msg.ecdsa_certificate.certificate_id[1]); + ck_assert_msg( + last_msg.msg.ecdsa_certificate.certificate_id[2] == 12, + "incorrect value for last_msg.msg.ecdsa_certificate.certificate_id[2], " + "expected 12, is %d", + last_msg.msg.ecdsa_certificate.certificate_id[2]); + ck_assert_msg( + last_msg.msg.ecdsa_certificate.certificate_id[3] == 13, + "incorrect value for last_msg.msg.ecdsa_certificate.certificate_id[3], " + "expected 13, is %d", + last_msg.msg.ecdsa_certificate.certificate_id[3]); + + ck_assert_msg(last_msg.msg.ecdsa_certificate.flags == 2, + "incorrect value for last_msg.msg.ecdsa_certificate.flags, " + "expected 2, is %d", + last_msg.msg.ecdsa_certificate.flags); + + ck_assert_msg(last_msg.msg.ecdsa_certificate.n_certificate_bytes == 247, + "incorrect value for " + "last_msg.msg.ecdsa_certificate.n_certificate_bytes, " + "expected 247, is %d", + last_msg.msg.ecdsa_certificate.n_certificate_bytes); + + ck_assert_msg(last_msg.msg.ecdsa_certificate.n_msg == 48, + "incorrect value for last_msg.msg.ecdsa_certificate.n_msg, " + "expected 48, is %d", + last_msg.msg.ecdsa_certificate.n_msg); } } END_TEST -Suite* auto_check_sbp_signing_MsgEcdsaCertificate_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_signing_MsgEcdsaCertificate"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_signing_MsgEcdsaCertificate"); +Suite *auto_check_sbp_signing_MsgEcdsaCertificate_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_signing_MsgEcdsaCertificate"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_signing_MsgEcdsaCertificate"); tcase_add_test(tc_acq, test_auto_check_sbp_signing_MsgEcdsaCertificate); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_signing_MsgEcdsaSignature.c b/c/test/auto_check_sbp_signing_MsgEcdsaSignature.c index 3993924ee..26691702e 100644 --- a/c/test/auto_check_sbp_signing_MsgEcdsaSignature.c +++ b/c/test/auto_check_sbp_signing_MsgEcdsaSignature.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_signing_MsgEcdsaSignature ) -{ +START_TEST(test_auto_check_sbp_signing_MsgEcdsaSignature) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_signing_MsgEcdsaSignature ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,308 +90,650 @@ START_TEST( test_auto_check_sbp_signing_MsgEcdsaSignature ) logging_reset(); - sbp_callback_register(&sbp_state, 0xC08, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xC08, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,8,12,66,0,83,0,1,2,1,2,3,4,72,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,10,21,23,232,131, }; + u8 encoded_frame[] = { + 85, 8, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 232, 131, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ecdsa_signature.certificate_id[0] = 1; - + test_msg.ecdsa_signature.certificate_id[1] = 2; - + test_msg.ecdsa_signature.certificate_id[2] = 3; - + test_msg.ecdsa_signature.certificate_id[3] = 4; - + test_msg.ecdsa_signature.flags = 0; - + test_msg.ecdsa_signature.n_signed_messages = 3; - + test_msg.ecdsa_signature.on_demand_counter = 2; - - - + test_msg.ecdsa_signature.signature.data[0] = 0; - + test_msg.ecdsa_signature.signature.data[1] = 1; - + test_msg.ecdsa_signature.signature.data[2] = 2; - + test_msg.ecdsa_signature.signature.data[3] = 3; - + test_msg.ecdsa_signature.signature.data[4] = 4; - + test_msg.ecdsa_signature.signature.data[5] = 5; - + test_msg.ecdsa_signature.signature.data[6] = 6; - + test_msg.ecdsa_signature.signature.data[7] = 7; - + test_msg.ecdsa_signature.signature.data[8] = 8; - + test_msg.ecdsa_signature.signature.data[9] = 9; - + test_msg.ecdsa_signature.signature.data[10] = 10; - + test_msg.ecdsa_signature.signature.data[11] = 11; - + test_msg.ecdsa_signature.signature.data[12] = 12; - + test_msg.ecdsa_signature.signature.data[13] = 13; - + test_msg.ecdsa_signature.signature.data[14] = 14; - + test_msg.ecdsa_signature.signature.data[15] = 15; - + test_msg.ecdsa_signature.signature.data[16] = 16; - + test_msg.ecdsa_signature.signature.data[17] = 17; - + test_msg.ecdsa_signature.signature.data[18] = 18; - + test_msg.ecdsa_signature.signature.data[19] = 19; - + test_msg.ecdsa_signature.signature.data[20] = 20; - + test_msg.ecdsa_signature.signature.data[21] = 21; - + test_msg.ecdsa_signature.signature.data[22] = 22; - + test_msg.ecdsa_signature.signature.data[23] = 23; - + test_msg.ecdsa_signature.signature.data[24] = 24; - + test_msg.ecdsa_signature.signature.data[25] = 25; - + test_msg.ecdsa_signature.signature.data[26] = 26; - + test_msg.ecdsa_signature.signature.data[27] = 27; - + test_msg.ecdsa_signature.signature.data[28] = 28; - + test_msg.ecdsa_signature.signature.data[29] = 29; - + test_msg.ecdsa_signature.signature.data[30] = 30; - + test_msg.ecdsa_signature.signature.data[31] = 31; - + test_msg.ecdsa_signature.signature.data[32] = 32; - + test_msg.ecdsa_signature.signature.data[33] = 33; - + test_msg.ecdsa_signature.signature.data[34] = 34; - + test_msg.ecdsa_signature.signature.data[35] = 35; - + test_msg.ecdsa_signature.signature.data[36] = 36; - + test_msg.ecdsa_signature.signature.data[37] = 37; - + test_msg.ecdsa_signature.signature.data[38] = 38; - + test_msg.ecdsa_signature.signature.data[39] = 39; - + test_msg.ecdsa_signature.signature.data[40] = 40; - + test_msg.ecdsa_signature.signature.data[41] = 41; - + test_msg.ecdsa_signature.signature.data[42] = 42; - + test_msg.ecdsa_signature.signature.data[43] = 43; - + test_msg.ecdsa_signature.signature.data[44] = 44; - + test_msg.ecdsa_signature.signature.data[45] = 45; - + test_msg.ecdsa_signature.signature.data[46] = 46; - + test_msg.ecdsa_signature.signature.data[47] = 47; - + test_msg.ecdsa_signature.signature.data[48] = 48; - + test_msg.ecdsa_signature.signature.data[49] = 49; - + test_msg.ecdsa_signature.signature.data[50] = 50; - + test_msg.ecdsa_signature.signature.data[51] = 51; - + test_msg.ecdsa_signature.signature.data[52] = 52; - + test_msg.ecdsa_signature.signature.data[53] = 53; - + test_msg.ecdsa_signature.signature.data[54] = 54; - + test_msg.ecdsa_signature.signature.data[55] = 55; - + test_msg.ecdsa_signature.signature.data[56] = 56; - + test_msg.ecdsa_signature.signature.data[57] = 57; - + test_msg.ecdsa_signature.signature.data[58] = 58; - + test_msg.ecdsa_signature.signature.data[59] = 59; - + test_msg.ecdsa_signature.signature.data[60] = 60; - + test_msg.ecdsa_signature.signature.data[61] = 61; - + test_msg.ecdsa_signature.signature.data[62] = 62; - + test_msg.ecdsa_signature.signature.data[63] = 63; - + test_msg.ecdsa_signature.signature.data[64] = 64; - + test_msg.ecdsa_signature.signature.data[65] = 65; - + test_msg.ecdsa_signature.signature.data[66] = 66; - + test_msg.ecdsa_signature.signature.data[67] = 67; - + test_msg.ecdsa_signature.signature.data[68] = 68; - + test_msg.ecdsa_signature.signature.data[69] = 69; - + test_msg.ecdsa_signature.signature.data[70] = 70; - + test_msg.ecdsa_signature.signature.data[71] = 71; - + test_msg.ecdsa_signature.signature.len = 72; - - + test_msg.ecdsa_signature.signed_messages[0] = 10; - + test_msg.ecdsa_signature.signed_messages[1] = 21; - + test_msg.ecdsa_signature.signed_messages[2] = 23; - + test_msg.ecdsa_signature.stream_counter = 1; - sbp_message_send(&sbp_state, SbpMsgEcdsaSignature, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEcdsaSignature, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgEcdsaSignature, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgEcdsaSignature, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ecdsa_signature.certificate_id[0] == 1, "incorrect value for last_msg.msg.ecdsa_signature.certificate_id[0], expected 1, is %d", last_msg.msg.ecdsa_signature.certificate_id[0]); - ck_assert_msg(last_msg.msg.ecdsa_signature.certificate_id[1] == 2, "incorrect value for last_msg.msg.ecdsa_signature.certificate_id[1], expected 2, is %d", last_msg.msg.ecdsa_signature.certificate_id[1]); - ck_assert_msg(last_msg.msg.ecdsa_signature.certificate_id[2] == 3, "incorrect value for last_msg.msg.ecdsa_signature.certificate_id[2], expected 3, is %d", last_msg.msg.ecdsa_signature.certificate_id[2]); - ck_assert_msg(last_msg.msg.ecdsa_signature.certificate_id[3] == 4, "incorrect value for last_msg.msg.ecdsa_signature.certificate_id[3], expected 4, is %d", last_msg.msg.ecdsa_signature.certificate_id[3]); - - ck_assert_msg(last_msg.msg.ecdsa_signature.flags == 0, "incorrect value for last_msg.msg.ecdsa_signature.flags, expected 0, is %d", last_msg.msg.ecdsa_signature.flags); - - ck_assert_msg(last_msg.msg.ecdsa_signature.n_signed_messages == 3, "incorrect value for last_msg.msg.ecdsa_signature.n_signed_messages, expected 3, is %d", last_msg.msg.ecdsa_signature.n_signed_messages); - - ck_assert_msg(last_msg.msg.ecdsa_signature.on_demand_counter == 2, "incorrect value for last_msg.msg.ecdsa_signature.on_demand_counter, expected 2, is %d", last_msg.msg.ecdsa_signature.on_demand_counter); - - - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[0] == 0, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[0], expected 0, is %d", last_msg.msg.ecdsa_signature.signature.data[0]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[1] == 1, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[1], expected 1, is %d", last_msg.msg.ecdsa_signature.signature.data[1]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[2] == 2, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[2], expected 2, is %d", last_msg.msg.ecdsa_signature.signature.data[2]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[3] == 3, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[3], expected 3, is %d", last_msg.msg.ecdsa_signature.signature.data[3]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[4] == 4, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[4], expected 4, is %d", last_msg.msg.ecdsa_signature.signature.data[4]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[5] == 5, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[5], expected 5, is %d", last_msg.msg.ecdsa_signature.signature.data[5]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[6] == 6, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[6], expected 6, is %d", last_msg.msg.ecdsa_signature.signature.data[6]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[7] == 7, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[7], expected 7, is %d", last_msg.msg.ecdsa_signature.signature.data[7]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[8] == 8, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[8], expected 8, is %d", last_msg.msg.ecdsa_signature.signature.data[8]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[9] == 9, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[9], expected 9, is %d", last_msg.msg.ecdsa_signature.signature.data[9]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[10] == 10, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[10], expected 10, is %d", last_msg.msg.ecdsa_signature.signature.data[10]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[11] == 11, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[11], expected 11, is %d", last_msg.msg.ecdsa_signature.signature.data[11]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[12] == 12, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[12], expected 12, is %d", last_msg.msg.ecdsa_signature.signature.data[12]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[13] == 13, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[13], expected 13, is %d", last_msg.msg.ecdsa_signature.signature.data[13]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[14] == 14, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[14], expected 14, is %d", last_msg.msg.ecdsa_signature.signature.data[14]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[15] == 15, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[15], expected 15, is %d", last_msg.msg.ecdsa_signature.signature.data[15]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[16] == 16, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[16], expected 16, is %d", last_msg.msg.ecdsa_signature.signature.data[16]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[17] == 17, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[17], expected 17, is %d", last_msg.msg.ecdsa_signature.signature.data[17]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[18] == 18, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[18], expected 18, is %d", last_msg.msg.ecdsa_signature.signature.data[18]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[19] == 19, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[19], expected 19, is %d", last_msg.msg.ecdsa_signature.signature.data[19]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[20] == 20, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[20], expected 20, is %d", last_msg.msg.ecdsa_signature.signature.data[20]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[21] == 21, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[21], expected 21, is %d", last_msg.msg.ecdsa_signature.signature.data[21]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[22] == 22, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[22], expected 22, is %d", last_msg.msg.ecdsa_signature.signature.data[22]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[23] == 23, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[23], expected 23, is %d", last_msg.msg.ecdsa_signature.signature.data[23]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[24] == 24, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[24], expected 24, is %d", last_msg.msg.ecdsa_signature.signature.data[24]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[25] == 25, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[25], expected 25, is %d", last_msg.msg.ecdsa_signature.signature.data[25]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[26] == 26, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[26], expected 26, is %d", last_msg.msg.ecdsa_signature.signature.data[26]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[27] == 27, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[27], expected 27, is %d", last_msg.msg.ecdsa_signature.signature.data[27]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[28] == 28, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[28], expected 28, is %d", last_msg.msg.ecdsa_signature.signature.data[28]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[29] == 29, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[29], expected 29, is %d", last_msg.msg.ecdsa_signature.signature.data[29]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[30] == 30, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[30], expected 30, is %d", last_msg.msg.ecdsa_signature.signature.data[30]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[31] == 31, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[31], expected 31, is %d", last_msg.msg.ecdsa_signature.signature.data[31]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[32] == 32, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[32], expected 32, is %d", last_msg.msg.ecdsa_signature.signature.data[32]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[33] == 33, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[33], expected 33, is %d", last_msg.msg.ecdsa_signature.signature.data[33]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[34] == 34, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[34], expected 34, is %d", last_msg.msg.ecdsa_signature.signature.data[34]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[35] == 35, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[35], expected 35, is %d", last_msg.msg.ecdsa_signature.signature.data[35]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[36] == 36, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[36], expected 36, is %d", last_msg.msg.ecdsa_signature.signature.data[36]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[37] == 37, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[37], expected 37, is %d", last_msg.msg.ecdsa_signature.signature.data[37]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[38] == 38, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[38], expected 38, is %d", last_msg.msg.ecdsa_signature.signature.data[38]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[39] == 39, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[39], expected 39, is %d", last_msg.msg.ecdsa_signature.signature.data[39]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[40] == 40, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[40], expected 40, is %d", last_msg.msg.ecdsa_signature.signature.data[40]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[41] == 41, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[41], expected 41, is %d", last_msg.msg.ecdsa_signature.signature.data[41]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[42] == 42, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[42], expected 42, is %d", last_msg.msg.ecdsa_signature.signature.data[42]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[43] == 43, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[43], expected 43, is %d", last_msg.msg.ecdsa_signature.signature.data[43]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[44] == 44, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[44], expected 44, is %d", last_msg.msg.ecdsa_signature.signature.data[44]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[45] == 45, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[45], expected 45, is %d", last_msg.msg.ecdsa_signature.signature.data[45]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[46] == 46, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[46], expected 46, is %d", last_msg.msg.ecdsa_signature.signature.data[46]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[47] == 47, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[47], expected 47, is %d", last_msg.msg.ecdsa_signature.signature.data[47]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[48] == 48, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[48], expected 48, is %d", last_msg.msg.ecdsa_signature.signature.data[48]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[49] == 49, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[49], expected 49, is %d", last_msg.msg.ecdsa_signature.signature.data[49]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[50] == 50, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[50], expected 50, is %d", last_msg.msg.ecdsa_signature.signature.data[50]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[51] == 51, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[51], expected 51, is %d", last_msg.msg.ecdsa_signature.signature.data[51]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[52] == 52, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[52], expected 52, is %d", last_msg.msg.ecdsa_signature.signature.data[52]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[53] == 53, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[53], expected 53, is %d", last_msg.msg.ecdsa_signature.signature.data[53]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[54] == 54, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[54], expected 54, is %d", last_msg.msg.ecdsa_signature.signature.data[54]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[55] == 55, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[55], expected 55, is %d", last_msg.msg.ecdsa_signature.signature.data[55]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[56] == 56, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[56], expected 56, is %d", last_msg.msg.ecdsa_signature.signature.data[56]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[57] == 57, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[57], expected 57, is %d", last_msg.msg.ecdsa_signature.signature.data[57]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[58] == 58, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[58], expected 58, is %d", last_msg.msg.ecdsa_signature.signature.data[58]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[59] == 59, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[59], expected 59, is %d", last_msg.msg.ecdsa_signature.signature.data[59]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[60] == 60, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[60], expected 60, is %d", last_msg.msg.ecdsa_signature.signature.data[60]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[61] == 61, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[61], expected 61, is %d", last_msg.msg.ecdsa_signature.signature.data[61]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[62] == 62, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[62], expected 62, is %d", last_msg.msg.ecdsa_signature.signature.data[62]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[63] == 63, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[63], expected 63, is %d", last_msg.msg.ecdsa_signature.signature.data[63]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[64] == 64, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[64], expected 64, is %d", last_msg.msg.ecdsa_signature.signature.data[64]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[65] == 65, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[65], expected 65, is %d", last_msg.msg.ecdsa_signature.signature.data[65]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[66] == 66, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[66], expected 66, is %d", last_msg.msg.ecdsa_signature.signature.data[66]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[67] == 67, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[67], expected 67, is %d", last_msg.msg.ecdsa_signature.signature.data[67]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[68] == 68, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[68], expected 68, is %d", last_msg.msg.ecdsa_signature.signature.data[68]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[69] == 69, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[69], expected 69, is %d", last_msg.msg.ecdsa_signature.signature.data[69]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[70] == 70, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[70], expected 70, is %d", last_msg.msg.ecdsa_signature.signature.data[70]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.data[71] == 71, "incorrect value for last_msg.msg.ecdsa_signature.signature.data[71], expected 71, is %d", last_msg.msg.ecdsa_signature.signature.data[71]); - - ck_assert_msg(last_msg.msg.ecdsa_signature.signature.len == 72, "incorrect value for last_msg.msg.ecdsa_signature.signature.len, expected 72, is %d", last_msg.msg.ecdsa_signature.signature.len); - - ck_assert_msg(last_msg.msg.ecdsa_signature.signed_messages[0] == 10, "incorrect value for last_msg.msg.ecdsa_signature.signed_messages[0], expected 10, is %d", last_msg.msg.ecdsa_signature.signed_messages[0]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signed_messages[1] == 21, "incorrect value for last_msg.msg.ecdsa_signature.signed_messages[1], expected 21, is %d", last_msg.msg.ecdsa_signature.signed_messages[1]); - ck_assert_msg(last_msg.msg.ecdsa_signature.signed_messages[2] == 23, "incorrect value for last_msg.msg.ecdsa_signature.signed_messages[2], expected 23, is %d", last_msg.msg.ecdsa_signature.signed_messages[2]); - - ck_assert_msg(last_msg.msg.ecdsa_signature.stream_counter == 1, "incorrect value for last_msg.msg.ecdsa_signature.stream_counter, expected 1, is %d", last_msg.msg.ecdsa_signature.stream_counter); + ck_assert_msg( + last_msg.msg.ecdsa_signature.certificate_id[0] == 1, + "incorrect value for last_msg.msg.ecdsa_signature.certificate_id[0], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature.certificate_id[0]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.certificate_id[1] == 2, + "incorrect value for last_msg.msg.ecdsa_signature.certificate_id[1], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature.certificate_id[1]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.certificate_id[2] == 3, + "incorrect value for last_msg.msg.ecdsa_signature.certificate_id[2], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature.certificate_id[2]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.certificate_id[3] == 4, + "incorrect value for last_msg.msg.ecdsa_signature.certificate_id[3], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature.certificate_id[3]); + + ck_assert_msg(last_msg.msg.ecdsa_signature.flags == 0, + "incorrect value for last_msg.msg.ecdsa_signature.flags, " + "expected 0, is %d", + last_msg.msg.ecdsa_signature.flags); + + ck_assert_msg( + last_msg.msg.ecdsa_signature.n_signed_messages == 3, + "incorrect value for last_msg.msg.ecdsa_signature.n_signed_messages, " + "expected 3, is %d", + last_msg.msg.ecdsa_signature.n_signed_messages); + + ck_assert_msg( + last_msg.msg.ecdsa_signature.on_demand_counter == 2, + "incorrect value for last_msg.msg.ecdsa_signature.on_demand_counter, " + "expected 2, is %d", + last_msg.msg.ecdsa_signature.on_demand_counter); + + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[0] == 0, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[0], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature.signature.data[0]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[1] == 1, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[1], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature.signature.data[1]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[2] == 2, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[2], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature.signature.data[2]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[3] == 3, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[3], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature.signature.data[3]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[4] == 4, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[4], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature.signature.data[4]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[5] == 5, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[5], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature.signature.data[5]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[6] == 6, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[6], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature.signature.data[6]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[7] == 7, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[7], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature.signature.data[7]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[8] == 8, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[8], " + "expected 8, is %d", + last_msg.msg.ecdsa_signature.signature.data[8]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[9] == 9, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[9], " + "expected 9, is %d", + last_msg.msg.ecdsa_signature.signature.data[9]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[10] == 10, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[10], " + "expected 10, is %d", + last_msg.msg.ecdsa_signature.signature.data[10]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[11] == 11, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[11], " + "expected 11, is %d", + last_msg.msg.ecdsa_signature.signature.data[11]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[12] == 12, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[12], " + "expected 12, is %d", + last_msg.msg.ecdsa_signature.signature.data[12]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[13] == 13, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[13], " + "expected 13, is %d", + last_msg.msg.ecdsa_signature.signature.data[13]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[14] == 14, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[14], " + "expected 14, is %d", + last_msg.msg.ecdsa_signature.signature.data[14]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[15] == 15, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[15], " + "expected 15, is %d", + last_msg.msg.ecdsa_signature.signature.data[15]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[16] == 16, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[16], " + "expected 16, is %d", + last_msg.msg.ecdsa_signature.signature.data[16]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[17] == 17, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[17], " + "expected 17, is %d", + last_msg.msg.ecdsa_signature.signature.data[17]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[18] == 18, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[18], " + "expected 18, is %d", + last_msg.msg.ecdsa_signature.signature.data[18]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[19] == 19, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[19], " + "expected 19, is %d", + last_msg.msg.ecdsa_signature.signature.data[19]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[20] == 20, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[20], " + "expected 20, is %d", + last_msg.msg.ecdsa_signature.signature.data[20]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[21] == 21, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[21], " + "expected 21, is %d", + last_msg.msg.ecdsa_signature.signature.data[21]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[22] == 22, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[22], " + "expected 22, is %d", + last_msg.msg.ecdsa_signature.signature.data[22]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[23] == 23, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[23], " + "expected 23, is %d", + last_msg.msg.ecdsa_signature.signature.data[23]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[24] == 24, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[24], " + "expected 24, is %d", + last_msg.msg.ecdsa_signature.signature.data[24]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[25] == 25, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[25], " + "expected 25, is %d", + last_msg.msg.ecdsa_signature.signature.data[25]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[26] == 26, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[26], " + "expected 26, is %d", + last_msg.msg.ecdsa_signature.signature.data[26]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[27] == 27, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[27], " + "expected 27, is %d", + last_msg.msg.ecdsa_signature.signature.data[27]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[28] == 28, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[28], " + "expected 28, is %d", + last_msg.msg.ecdsa_signature.signature.data[28]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[29] == 29, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[29], " + "expected 29, is %d", + last_msg.msg.ecdsa_signature.signature.data[29]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[30] == 30, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[30], " + "expected 30, is %d", + last_msg.msg.ecdsa_signature.signature.data[30]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[31] == 31, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[31], " + "expected 31, is %d", + last_msg.msg.ecdsa_signature.signature.data[31]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[32] == 32, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[32], " + "expected 32, is %d", + last_msg.msg.ecdsa_signature.signature.data[32]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[33] == 33, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[33], " + "expected 33, is %d", + last_msg.msg.ecdsa_signature.signature.data[33]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[34] == 34, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[34], " + "expected 34, is %d", + last_msg.msg.ecdsa_signature.signature.data[34]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[35] == 35, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[35], " + "expected 35, is %d", + last_msg.msg.ecdsa_signature.signature.data[35]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[36] == 36, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[36], " + "expected 36, is %d", + last_msg.msg.ecdsa_signature.signature.data[36]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[37] == 37, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[37], " + "expected 37, is %d", + last_msg.msg.ecdsa_signature.signature.data[37]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[38] == 38, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[38], " + "expected 38, is %d", + last_msg.msg.ecdsa_signature.signature.data[38]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[39] == 39, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[39], " + "expected 39, is %d", + last_msg.msg.ecdsa_signature.signature.data[39]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[40] == 40, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[40], " + "expected 40, is %d", + last_msg.msg.ecdsa_signature.signature.data[40]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[41] == 41, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[41], " + "expected 41, is %d", + last_msg.msg.ecdsa_signature.signature.data[41]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[42] == 42, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[42], " + "expected 42, is %d", + last_msg.msg.ecdsa_signature.signature.data[42]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[43] == 43, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[43], " + "expected 43, is %d", + last_msg.msg.ecdsa_signature.signature.data[43]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[44] == 44, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[44], " + "expected 44, is %d", + last_msg.msg.ecdsa_signature.signature.data[44]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[45] == 45, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[45], " + "expected 45, is %d", + last_msg.msg.ecdsa_signature.signature.data[45]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[46] == 46, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[46], " + "expected 46, is %d", + last_msg.msg.ecdsa_signature.signature.data[46]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[47] == 47, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[47], " + "expected 47, is %d", + last_msg.msg.ecdsa_signature.signature.data[47]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[48] == 48, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[48], " + "expected 48, is %d", + last_msg.msg.ecdsa_signature.signature.data[48]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[49] == 49, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[49], " + "expected 49, is %d", + last_msg.msg.ecdsa_signature.signature.data[49]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[50] == 50, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[50], " + "expected 50, is %d", + last_msg.msg.ecdsa_signature.signature.data[50]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[51] == 51, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[51], " + "expected 51, is %d", + last_msg.msg.ecdsa_signature.signature.data[51]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[52] == 52, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[52], " + "expected 52, is %d", + last_msg.msg.ecdsa_signature.signature.data[52]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[53] == 53, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[53], " + "expected 53, is %d", + last_msg.msg.ecdsa_signature.signature.data[53]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[54] == 54, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[54], " + "expected 54, is %d", + last_msg.msg.ecdsa_signature.signature.data[54]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[55] == 55, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[55], " + "expected 55, is %d", + last_msg.msg.ecdsa_signature.signature.data[55]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[56] == 56, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[56], " + "expected 56, is %d", + last_msg.msg.ecdsa_signature.signature.data[56]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[57] == 57, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[57], " + "expected 57, is %d", + last_msg.msg.ecdsa_signature.signature.data[57]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[58] == 58, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[58], " + "expected 58, is %d", + last_msg.msg.ecdsa_signature.signature.data[58]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[59] == 59, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[59], " + "expected 59, is %d", + last_msg.msg.ecdsa_signature.signature.data[59]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[60] == 60, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[60], " + "expected 60, is %d", + last_msg.msg.ecdsa_signature.signature.data[60]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[61] == 61, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[61], " + "expected 61, is %d", + last_msg.msg.ecdsa_signature.signature.data[61]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[62] == 62, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[62], " + "expected 62, is %d", + last_msg.msg.ecdsa_signature.signature.data[62]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[63] == 63, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[63], " + "expected 63, is %d", + last_msg.msg.ecdsa_signature.signature.data[63]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[64] == 64, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[64], " + "expected 64, is %d", + last_msg.msg.ecdsa_signature.signature.data[64]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[65] == 65, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[65], " + "expected 65, is %d", + last_msg.msg.ecdsa_signature.signature.data[65]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[66] == 66, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[66], " + "expected 66, is %d", + last_msg.msg.ecdsa_signature.signature.data[66]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[67] == 67, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[67], " + "expected 67, is %d", + last_msg.msg.ecdsa_signature.signature.data[67]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[68] == 68, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[68], " + "expected 68, is %d", + last_msg.msg.ecdsa_signature.signature.data[68]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[69] == 69, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[69], " + "expected 69, is %d", + last_msg.msg.ecdsa_signature.signature.data[69]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[70] == 70, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[70], " + "expected 70, is %d", + last_msg.msg.ecdsa_signature.signature.data[70]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.data[71] == 71, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[71], " + "expected 71, is %d", + last_msg.msg.ecdsa_signature.signature.data[71]); + + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.len == 72, + "incorrect value for last_msg.msg.ecdsa_signature.signature.len, " + "expected 72, is %d", + last_msg.msg.ecdsa_signature.signature.len); + + ck_assert_msg( + last_msg.msg.ecdsa_signature.signed_messages[0] == 10, + "incorrect value for last_msg.msg.ecdsa_signature.signed_messages[0], " + "expected 10, is %d", + last_msg.msg.ecdsa_signature.signed_messages[0]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signed_messages[1] == 21, + "incorrect value for last_msg.msg.ecdsa_signature.signed_messages[1], " + "expected 21, is %d", + last_msg.msg.ecdsa_signature.signed_messages[1]); + ck_assert_msg( + last_msg.msg.ecdsa_signature.signed_messages[2] == 23, + "incorrect value for last_msg.msg.ecdsa_signature.signed_messages[2], " + "expected 23, is %d", + last_msg.msg.ecdsa_signature.signed_messages[2]); + + ck_assert_msg( + last_msg.msg.ecdsa_signature.stream_counter == 1, + "incorrect value for last_msg.msg.ecdsa_signature.stream_counter, " + "expected 1, is %d", + last_msg.msg.ecdsa_signature.stream_counter); } } END_TEST -Suite* auto_check_sbp_signing_MsgEcdsaSignature_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_signing_MsgEcdsaSignature"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_signing_MsgEcdsaSignature"); +Suite *auto_check_sbp_signing_MsgEcdsaSignature_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_signing_MsgEcdsaSignature"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_signing_MsgEcdsaSignature"); tcase_add_test(tc_acq, test_auto_check_sbp_signing_MsgEcdsaSignature); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepA.c b/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepA.c index dd5795573..b283cac20 100644 --- a/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepA.c +++ b/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_signing_MsgEcdsaSignatureDepA ) -{ +START_TEST(test_auto_check_sbp_signing_MsgEcdsaSignatureDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_signing_MsgEcdsaSignatureDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,821 +90,1899 @@ START_TEST( test_auto_check_sbp_signing_MsgEcdsaSignatureDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0xC06, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xC06, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,6,12,66,0,255,0,1,2,1,2,3,4,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,10,21,23,63,140,37,130,106,28,40,165,179,73,178,60,126,114,78,113,27,95,3,62,104,145,96,19,92,123,14,90,153,183,9,72,81,118,112,124,16,182,76,146,115,58,144,17,105,66,31,135,54,100,84,181,103,11,88,133,155,167,173,143,86,158,20,168,132,141,102,50,48,71,147,53,87,1,108,138,36,134,139,163,82,43,52,150,12,30,110,156,107,120,91,122,69,164,170,116,25,94,5,22,24,162,175,38,157,98,44,160,47,97,142,8,74,13,177,15,128,26,131,154,65,169,55,136,125,171,161,29,129,151,68,166,51,70,45,56,79,149,99,42,101,152,39,89,180,64,49,6,80,172,32,109,2,119,93,176,0,33,57,34,18,85,121,137,83,111,59,7,77,4,117,159,148,35,61,41,67,46,127,75,174,97,172, }; + u8 encoded_frame[] = { + 85, 6, 12, 66, 0, 255, 0, 1, 2, 1, 2, 3, 4, 0, + 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, + 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, + 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, + 1, 2, 3, 4, 5, 6, 7, 10, 21, 23, 63, 140, 37, 130, + 106, 28, 40, 165, 179, 73, 178, 60, 126, 114, 78, 113, 27, 95, + 3, 62, 104, 145, 96, 19, 92, 123, 14, 90, 153, 183, 9, 72, + 81, 118, 112, 124, 16, 182, 76, 146, 115, 58, 144, 17, 105, 66, + 31, 135, 54, 100, 84, 181, 103, 11, 88, 133, 155, 167, 173, 143, + 86, 158, 20, 168, 132, 141, 102, 50, 48, 71, 147, 53, 87, 1, + 108, 138, 36, 134, 139, 163, 82, 43, 52, 150, 12, 30, 110, 156, + 107, 120, 91, 122, 69, 164, 170, 116, 25, 94, 5, 22, 24, 162, + 175, 38, 157, 98, 44, 160, 47, 97, 142, 8, 74, 13, 177, 15, + 128, 26, 131, 154, 65, 169, 55, 136, 125, 171, 161, 29, 129, 151, + 68, 166, 51, 70, 45, 56, 79, 149, 99, 42, 101, 152, 39, 89, + 180, 64, 49, 6, 80, 172, 32, 109, 2, 119, 93, 176, 0, 33, + 57, 34, 18, 85, 121, 137, 83, 111, 59, 7, 77, 4, 117, 159, + 148, 35, 61, 41, 67, 46, 127, 75, 174, 97, 172, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ecdsa_signature_dep_a.certificate_id[0] = 1; - + test_msg.ecdsa_signature_dep_a.certificate_id[1] = 2; - + test_msg.ecdsa_signature_dep_a.certificate_id[2] = 3; - + test_msg.ecdsa_signature_dep_a.certificate_id[3] = 4; - + test_msg.ecdsa_signature_dep_a.flags = 0; - + test_msg.ecdsa_signature_dep_a.n_signed_messages = 184; - + test_msg.ecdsa_signature_dep_a.on_demand_counter = 2; - - + test_msg.ecdsa_signature_dep_a.signature[0] = 0; - + test_msg.ecdsa_signature_dep_a.signature[1] = 1; - + test_msg.ecdsa_signature_dep_a.signature[2] = 2; - + test_msg.ecdsa_signature_dep_a.signature[3] = 3; - + test_msg.ecdsa_signature_dep_a.signature[4] = 4; - + test_msg.ecdsa_signature_dep_a.signature[5] = 5; - + test_msg.ecdsa_signature_dep_a.signature[6] = 6; - + test_msg.ecdsa_signature_dep_a.signature[7] = 7; - + test_msg.ecdsa_signature_dep_a.signature[8] = 0; - + test_msg.ecdsa_signature_dep_a.signature[9] = 1; - + test_msg.ecdsa_signature_dep_a.signature[10] = 2; - + test_msg.ecdsa_signature_dep_a.signature[11] = 3; - + test_msg.ecdsa_signature_dep_a.signature[12] = 4; - + test_msg.ecdsa_signature_dep_a.signature[13] = 5; - + test_msg.ecdsa_signature_dep_a.signature[14] = 6; - + test_msg.ecdsa_signature_dep_a.signature[15] = 7; - + test_msg.ecdsa_signature_dep_a.signature[16] = 0; - + test_msg.ecdsa_signature_dep_a.signature[17] = 1; - + test_msg.ecdsa_signature_dep_a.signature[18] = 2; - + test_msg.ecdsa_signature_dep_a.signature[19] = 3; - + test_msg.ecdsa_signature_dep_a.signature[20] = 4; - + test_msg.ecdsa_signature_dep_a.signature[21] = 5; - + test_msg.ecdsa_signature_dep_a.signature[22] = 6; - + test_msg.ecdsa_signature_dep_a.signature[23] = 7; - + test_msg.ecdsa_signature_dep_a.signature[24] = 0; - + test_msg.ecdsa_signature_dep_a.signature[25] = 1; - + test_msg.ecdsa_signature_dep_a.signature[26] = 2; - + test_msg.ecdsa_signature_dep_a.signature[27] = 3; - + test_msg.ecdsa_signature_dep_a.signature[28] = 4; - + test_msg.ecdsa_signature_dep_a.signature[29] = 5; - + test_msg.ecdsa_signature_dep_a.signature[30] = 6; - + test_msg.ecdsa_signature_dep_a.signature[31] = 7; - + test_msg.ecdsa_signature_dep_a.signature[32] = 0; - + test_msg.ecdsa_signature_dep_a.signature[33] = 1; - + test_msg.ecdsa_signature_dep_a.signature[34] = 2; - + test_msg.ecdsa_signature_dep_a.signature[35] = 3; - + test_msg.ecdsa_signature_dep_a.signature[36] = 4; - + test_msg.ecdsa_signature_dep_a.signature[37] = 5; - + test_msg.ecdsa_signature_dep_a.signature[38] = 6; - + test_msg.ecdsa_signature_dep_a.signature[39] = 7; - + test_msg.ecdsa_signature_dep_a.signature[40] = 0; - + test_msg.ecdsa_signature_dep_a.signature[41] = 1; - + test_msg.ecdsa_signature_dep_a.signature[42] = 2; - + test_msg.ecdsa_signature_dep_a.signature[43] = 3; - + test_msg.ecdsa_signature_dep_a.signature[44] = 4; - + test_msg.ecdsa_signature_dep_a.signature[45] = 5; - + test_msg.ecdsa_signature_dep_a.signature[46] = 6; - + test_msg.ecdsa_signature_dep_a.signature[47] = 7; - + test_msg.ecdsa_signature_dep_a.signature[48] = 0; - + test_msg.ecdsa_signature_dep_a.signature[49] = 1; - + test_msg.ecdsa_signature_dep_a.signature[50] = 2; - + test_msg.ecdsa_signature_dep_a.signature[51] = 3; - + test_msg.ecdsa_signature_dep_a.signature[52] = 4; - + test_msg.ecdsa_signature_dep_a.signature[53] = 5; - + test_msg.ecdsa_signature_dep_a.signature[54] = 6; - + test_msg.ecdsa_signature_dep_a.signature[55] = 7; - + test_msg.ecdsa_signature_dep_a.signature[56] = 0; - + test_msg.ecdsa_signature_dep_a.signature[57] = 1; - + test_msg.ecdsa_signature_dep_a.signature[58] = 2; - + test_msg.ecdsa_signature_dep_a.signature[59] = 3; - + test_msg.ecdsa_signature_dep_a.signature[60] = 4; - + test_msg.ecdsa_signature_dep_a.signature[61] = 5; - + test_msg.ecdsa_signature_dep_a.signature[62] = 6; - + test_msg.ecdsa_signature_dep_a.signature[63] = 7; - - + test_msg.ecdsa_signature_dep_a.signed_messages[0] = 10; - + test_msg.ecdsa_signature_dep_a.signed_messages[1] = 21; - + test_msg.ecdsa_signature_dep_a.signed_messages[2] = 23; - + test_msg.ecdsa_signature_dep_a.signed_messages[3] = 63; - + test_msg.ecdsa_signature_dep_a.signed_messages[4] = 140; - + test_msg.ecdsa_signature_dep_a.signed_messages[5] = 37; - + test_msg.ecdsa_signature_dep_a.signed_messages[6] = 130; - + test_msg.ecdsa_signature_dep_a.signed_messages[7] = 106; - + test_msg.ecdsa_signature_dep_a.signed_messages[8] = 28; - + test_msg.ecdsa_signature_dep_a.signed_messages[9] = 40; - + test_msg.ecdsa_signature_dep_a.signed_messages[10] = 165; - + test_msg.ecdsa_signature_dep_a.signed_messages[11] = 179; - + test_msg.ecdsa_signature_dep_a.signed_messages[12] = 73; - + test_msg.ecdsa_signature_dep_a.signed_messages[13] = 178; - + test_msg.ecdsa_signature_dep_a.signed_messages[14] = 60; - + test_msg.ecdsa_signature_dep_a.signed_messages[15] = 126; - + test_msg.ecdsa_signature_dep_a.signed_messages[16] = 114; - + test_msg.ecdsa_signature_dep_a.signed_messages[17] = 78; - + test_msg.ecdsa_signature_dep_a.signed_messages[18] = 113; - + test_msg.ecdsa_signature_dep_a.signed_messages[19] = 27; - + test_msg.ecdsa_signature_dep_a.signed_messages[20] = 95; - + test_msg.ecdsa_signature_dep_a.signed_messages[21] = 3; - + test_msg.ecdsa_signature_dep_a.signed_messages[22] = 62; - + test_msg.ecdsa_signature_dep_a.signed_messages[23] = 104; - + test_msg.ecdsa_signature_dep_a.signed_messages[24] = 145; - + test_msg.ecdsa_signature_dep_a.signed_messages[25] = 96; - + test_msg.ecdsa_signature_dep_a.signed_messages[26] = 19; - + test_msg.ecdsa_signature_dep_a.signed_messages[27] = 92; - + test_msg.ecdsa_signature_dep_a.signed_messages[28] = 123; - + test_msg.ecdsa_signature_dep_a.signed_messages[29] = 14; - + test_msg.ecdsa_signature_dep_a.signed_messages[30] = 90; - + test_msg.ecdsa_signature_dep_a.signed_messages[31] = 153; - + test_msg.ecdsa_signature_dep_a.signed_messages[32] = 183; - + test_msg.ecdsa_signature_dep_a.signed_messages[33] = 9; - + test_msg.ecdsa_signature_dep_a.signed_messages[34] = 72; - + test_msg.ecdsa_signature_dep_a.signed_messages[35] = 81; - + test_msg.ecdsa_signature_dep_a.signed_messages[36] = 118; - + test_msg.ecdsa_signature_dep_a.signed_messages[37] = 112; - + test_msg.ecdsa_signature_dep_a.signed_messages[38] = 124; - + test_msg.ecdsa_signature_dep_a.signed_messages[39] = 16; - + test_msg.ecdsa_signature_dep_a.signed_messages[40] = 182; - + test_msg.ecdsa_signature_dep_a.signed_messages[41] = 76; - + test_msg.ecdsa_signature_dep_a.signed_messages[42] = 146; - + test_msg.ecdsa_signature_dep_a.signed_messages[43] = 115; - + test_msg.ecdsa_signature_dep_a.signed_messages[44] = 58; - + test_msg.ecdsa_signature_dep_a.signed_messages[45] = 144; - + test_msg.ecdsa_signature_dep_a.signed_messages[46] = 17; - + test_msg.ecdsa_signature_dep_a.signed_messages[47] = 105; - + test_msg.ecdsa_signature_dep_a.signed_messages[48] = 66; - + test_msg.ecdsa_signature_dep_a.signed_messages[49] = 31; - + test_msg.ecdsa_signature_dep_a.signed_messages[50] = 135; - + test_msg.ecdsa_signature_dep_a.signed_messages[51] = 54; - + test_msg.ecdsa_signature_dep_a.signed_messages[52] = 100; - + test_msg.ecdsa_signature_dep_a.signed_messages[53] = 84; - + test_msg.ecdsa_signature_dep_a.signed_messages[54] = 181; - + test_msg.ecdsa_signature_dep_a.signed_messages[55] = 103; - + test_msg.ecdsa_signature_dep_a.signed_messages[56] = 11; - + test_msg.ecdsa_signature_dep_a.signed_messages[57] = 88; - + test_msg.ecdsa_signature_dep_a.signed_messages[58] = 133; - + test_msg.ecdsa_signature_dep_a.signed_messages[59] = 155; - + test_msg.ecdsa_signature_dep_a.signed_messages[60] = 167; - + test_msg.ecdsa_signature_dep_a.signed_messages[61] = 173; - + test_msg.ecdsa_signature_dep_a.signed_messages[62] = 143; - + test_msg.ecdsa_signature_dep_a.signed_messages[63] = 86; - + test_msg.ecdsa_signature_dep_a.signed_messages[64] = 158; - + test_msg.ecdsa_signature_dep_a.signed_messages[65] = 20; - + test_msg.ecdsa_signature_dep_a.signed_messages[66] = 168; - + test_msg.ecdsa_signature_dep_a.signed_messages[67] = 132; - + test_msg.ecdsa_signature_dep_a.signed_messages[68] = 141; - + test_msg.ecdsa_signature_dep_a.signed_messages[69] = 102; - + test_msg.ecdsa_signature_dep_a.signed_messages[70] = 50; - + test_msg.ecdsa_signature_dep_a.signed_messages[71] = 48; - + test_msg.ecdsa_signature_dep_a.signed_messages[72] = 71; - + test_msg.ecdsa_signature_dep_a.signed_messages[73] = 147; - + test_msg.ecdsa_signature_dep_a.signed_messages[74] = 53; - + test_msg.ecdsa_signature_dep_a.signed_messages[75] = 87; - + test_msg.ecdsa_signature_dep_a.signed_messages[76] = 1; - + test_msg.ecdsa_signature_dep_a.signed_messages[77] = 108; - + test_msg.ecdsa_signature_dep_a.signed_messages[78] = 138; - + test_msg.ecdsa_signature_dep_a.signed_messages[79] = 36; - + test_msg.ecdsa_signature_dep_a.signed_messages[80] = 134; - + test_msg.ecdsa_signature_dep_a.signed_messages[81] = 139; - + test_msg.ecdsa_signature_dep_a.signed_messages[82] = 163; - + test_msg.ecdsa_signature_dep_a.signed_messages[83] = 82; - + test_msg.ecdsa_signature_dep_a.signed_messages[84] = 43; - + test_msg.ecdsa_signature_dep_a.signed_messages[85] = 52; - + test_msg.ecdsa_signature_dep_a.signed_messages[86] = 150; - + test_msg.ecdsa_signature_dep_a.signed_messages[87] = 12; - + test_msg.ecdsa_signature_dep_a.signed_messages[88] = 30; - + test_msg.ecdsa_signature_dep_a.signed_messages[89] = 110; - + test_msg.ecdsa_signature_dep_a.signed_messages[90] = 156; - + test_msg.ecdsa_signature_dep_a.signed_messages[91] = 107; - + test_msg.ecdsa_signature_dep_a.signed_messages[92] = 120; - + test_msg.ecdsa_signature_dep_a.signed_messages[93] = 91; - + test_msg.ecdsa_signature_dep_a.signed_messages[94] = 122; - + test_msg.ecdsa_signature_dep_a.signed_messages[95] = 69; - + test_msg.ecdsa_signature_dep_a.signed_messages[96] = 164; - + test_msg.ecdsa_signature_dep_a.signed_messages[97] = 170; - + test_msg.ecdsa_signature_dep_a.signed_messages[98] = 116; - + test_msg.ecdsa_signature_dep_a.signed_messages[99] = 25; - + test_msg.ecdsa_signature_dep_a.signed_messages[100] = 94; - + test_msg.ecdsa_signature_dep_a.signed_messages[101] = 5; - + test_msg.ecdsa_signature_dep_a.signed_messages[102] = 22; - + test_msg.ecdsa_signature_dep_a.signed_messages[103] = 24; - + test_msg.ecdsa_signature_dep_a.signed_messages[104] = 162; - + test_msg.ecdsa_signature_dep_a.signed_messages[105] = 175; - + test_msg.ecdsa_signature_dep_a.signed_messages[106] = 38; - + test_msg.ecdsa_signature_dep_a.signed_messages[107] = 157; - + test_msg.ecdsa_signature_dep_a.signed_messages[108] = 98; - + test_msg.ecdsa_signature_dep_a.signed_messages[109] = 44; - + test_msg.ecdsa_signature_dep_a.signed_messages[110] = 160; - + test_msg.ecdsa_signature_dep_a.signed_messages[111] = 47; - + test_msg.ecdsa_signature_dep_a.signed_messages[112] = 97; - + test_msg.ecdsa_signature_dep_a.signed_messages[113] = 142; - + test_msg.ecdsa_signature_dep_a.signed_messages[114] = 8; - + test_msg.ecdsa_signature_dep_a.signed_messages[115] = 74; - + test_msg.ecdsa_signature_dep_a.signed_messages[116] = 13; - + test_msg.ecdsa_signature_dep_a.signed_messages[117] = 177; - + test_msg.ecdsa_signature_dep_a.signed_messages[118] = 15; - + test_msg.ecdsa_signature_dep_a.signed_messages[119] = 128; - + test_msg.ecdsa_signature_dep_a.signed_messages[120] = 26; - + test_msg.ecdsa_signature_dep_a.signed_messages[121] = 131; - + test_msg.ecdsa_signature_dep_a.signed_messages[122] = 154; - + test_msg.ecdsa_signature_dep_a.signed_messages[123] = 65; - + test_msg.ecdsa_signature_dep_a.signed_messages[124] = 169; - + test_msg.ecdsa_signature_dep_a.signed_messages[125] = 55; - + test_msg.ecdsa_signature_dep_a.signed_messages[126] = 136; - + test_msg.ecdsa_signature_dep_a.signed_messages[127] = 125; - + test_msg.ecdsa_signature_dep_a.signed_messages[128] = 171; - + test_msg.ecdsa_signature_dep_a.signed_messages[129] = 161; - + test_msg.ecdsa_signature_dep_a.signed_messages[130] = 29; - + test_msg.ecdsa_signature_dep_a.signed_messages[131] = 129; - + test_msg.ecdsa_signature_dep_a.signed_messages[132] = 151; - + test_msg.ecdsa_signature_dep_a.signed_messages[133] = 68; - + test_msg.ecdsa_signature_dep_a.signed_messages[134] = 166; - + test_msg.ecdsa_signature_dep_a.signed_messages[135] = 51; - + test_msg.ecdsa_signature_dep_a.signed_messages[136] = 70; - + test_msg.ecdsa_signature_dep_a.signed_messages[137] = 45; - + test_msg.ecdsa_signature_dep_a.signed_messages[138] = 56; - + test_msg.ecdsa_signature_dep_a.signed_messages[139] = 79; - + test_msg.ecdsa_signature_dep_a.signed_messages[140] = 149; - + test_msg.ecdsa_signature_dep_a.signed_messages[141] = 99; - + test_msg.ecdsa_signature_dep_a.signed_messages[142] = 42; - + test_msg.ecdsa_signature_dep_a.signed_messages[143] = 101; - + test_msg.ecdsa_signature_dep_a.signed_messages[144] = 152; - + test_msg.ecdsa_signature_dep_a.signed_messages[145] = 39; - + test_msg.ecdsa_signature_dep_a.signed_messages[146] = 89; - + test_msg.ecdsa_signature_dep_a.signed_messages[147] = 180; - + test_msg.ecdsa_signature_dep_a.signed_messages[148] = 64; - + test_msg.ecdsa_signature_dep_a.signed_messages[149] = 49; - + test_msg.ecdsa_signature_dep_a.signed_messages[150] = 6; - + test_msg.ecdsa_signature_dep_a.signed_messages[151] = 80; - + test_msg.ecdsa_signature_dep_a.signed_messages[152] = 172; - + test_msg.ecdsa_signature_dep_a.signed_messages[153] = 32; - + test_msg.ecdsa_signature_dep_a.signed_messages[154] = 109; - + test_msg.ecdsa_signature_dep_a.signed_messages[155] = 2; - + test_msg.ecdsa_signature_dep_a.signed_messages[156] = 119; - + test_msg.ecdsa_signature_dep_a.signed_messages[157] = 93; - + test_msg.ecdsa_signature_dep_a.signed_messages[158] = 176; - + test_msg.ecdsa_signature_dep_a.signed_messages[159] = 0; - + test_msg.ecdsa_signature_dep_a.signed_messages[160] = 33; - + test_msg.ecdsa_signature_dep_a.signed_messages[161] = 57; - + test_msg.ecdsa_signature_dep_a.signed_messages[162] = 34; - + test_msg.ecdsa_signature_dep_a.signed_messages[163] = 18; - + test_msg.ecdsa_signature_dep_a.signed_messages[164] = 85; - + test_msg.ecdsa_signature_dep_a.signed_messages[165] = 121; - + test_msg.ecdsa_signature_dep_a.signed_messages[166] = 137; - + test_msg.ecdsa_signature_dep_a.signed_messages[167] = 83; - + test_msg.ecdsa_signature_dep_a.signed_messages[168] = 111; - + test_msg.ecdsa_signature_dep_a.signed_messages[169] = 59; - + test_msg.ecdsa_signature_dep_a.signed_messages[170] = 7; - + test_msg.ecdsa_signature_dep_a.signed_messages[171] = 77; - + test_msg.ecdsa_signature_dep_a.signed_messages[172] = 4; - + test_msg.ecdsa_signature_dep_a.signed_messages[173] = 117; - + test_msg.ecdsa_signature_dep_a.signed_messages[174] = 159; - + test_msg.ecdsa_signature_dep_a.signed_messages[175] = 148; - + test_msg.ecdsa_signature_dep_a.signed_messages[176] = 35; - + test_msg.ecdsa_signature_dep_a.signed_messages[177] = 61; - + test_msg.ecdsa_signature_dep_a.signed_messages[178] = 41; - + test_msg.ecdsa_signature_dep_a.signed_messages[179] = 67; - + test_msg.ecdsa_signature_dep_a.signed_messages[180] = 46; - + test_msg.ecdsa_signature_dep_a.signed_messages[181] = 127; - + test_msg.ecdsa_signature_dep_a.signed_messages[182] = 75; - + test_msg.ecdsa_signature_dep_a.signed_messages[183] = 174; - + test_msg.ecdsa_signature_dep_a.stream_counter = 1; - sbp_message_send(&sbp_state, SbpMsgEcdsaSignatureDepA, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEcdsaSignatureDepA, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgEcdsaSignatureDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.certificate_id[0] == 1, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.certificate_id[0], expected 1, is %d", last_msg.msg.ecdsa_signature_dep_a.certificate_id[0]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.certificate_id[1] == 2, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.certificate_id[1], expected 2, is %d", last_msg.msg.ecdsa_signature_dep_a.certificate_id[1]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.certificate_id[2] == 3, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.certificate_id[2], expected 3, is %d", last_msg.msg.ecdsa_signature_dep_a.certificate_id[2]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.certificate_id[3] == 4, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.certificate_id[3], expected 4, is %d", last_msg.msg.ecdsa_signature_dep_a.certificate_id[3]); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.flags == 0, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.flags, expected 0, is %d", last_msg.msg.ecdsa_signature_dep_a.flags); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.n_signed_messages == 184, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.n_signed_messages, expected 184, is %d", last_msg.msg.ecdsa_signature_dep_a.n_signed_messages); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.on_demand_counter == 2, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.on_demand_counter, expected 2, is %d", last_msg.msg.ecdsa_signature_dep_a.on_demand_counter); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[0] == 0, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[0], expected 0, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[0]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[1] == 1, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[1], expected 1, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[1]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[2] == 2, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[2], expected 2, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[2]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[3] == 3, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[3], expected 3, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[3]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[4] == 4, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[4], expected 4, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[4]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[5] == 5, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[5], expected 5, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[5]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[6] == 6, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[6], expected 6, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[6]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[7] == 7, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[7], expected 7, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[7]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[8] == 0, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[8], expected 0, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[8]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[9] == 1, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[9], expected 1, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[9]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[10] == 2, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[10], expected 2, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[10]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[11] == 3, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[11], expected 3, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[11]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[12] == 4, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[12], expected 4, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[12]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[13] == 5, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[13], expected 5, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[13]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[14] == 6, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[14], expected 6, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[14]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[15] == 7, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[15], expected 7, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[15]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[16] == 0, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[16], expected 0, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[16]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[17] == 1, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[17], expected 1, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[17]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[18] == 2, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[18], expected 2, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[18]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[19] == 3, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[19], expected 3, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[19]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[20] == 4, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[20], expected 4, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[20]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[21] == 5, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[21], expected 5, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[21]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[22] == 6, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[22], expected 6, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[22]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[23] == 7, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[23], expected 7, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[23]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[24] == 0, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[24], expected 0, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[24]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[25] == 1, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[25], expected 1, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[25]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[26] == 2, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[26], expected 2, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[26]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[27] == 3, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[27], expected 3, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[27]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[28] == 4, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[28], expected 4, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[28]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[29] == 5, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[29], expected 5, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[29]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[30] == 6, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[30], expected 6, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[30]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[31] == 7, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[31], expected 7, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[31]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[32] == 0, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[32], expected 0, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[32]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[33] == 1, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[33], expected 1, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[33]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[34] == 2, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[34], expected 2, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[34]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[35] == 3, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[35], expected 3, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[35]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[36] == 4, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[36], expected 4, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[36]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[37] == 5, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[37], expected 5, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[37]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[38] == 6, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[38], expected 6, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[38]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[39] == 7, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[39], expected 7, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[39]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[40] == 0, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[40], expected 0, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[40]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[41] == 1, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[41], expected 1, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[41]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[42] == 2, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[42], expected 2, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[42]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[43] == 3, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[43], expected 3, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[43]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[44] == 4, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[44], expected 4, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[44]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[45] == 5, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[45], expected 5, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[45]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[46] == 6, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[46], expected 6, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[46]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[47] == 7, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[47], expected 7, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[47]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[48] == 0, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[48], expected 0, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[48]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[49] == 1, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[49], expected 1, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[49]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[50] == 2, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[50], expected 2, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[50]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[51] == 3, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[51], expected 3, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[51]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[52] == 4, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[52], expected 4, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[52]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[53] == 5, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[53], expected 5, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[53]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[54] == 6, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[54], expected 6, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[54]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[55] == 7, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[55], expected 7, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[55]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[56] == 0, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[56], expected 0, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[56]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[57] == 1, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[57], expected 1, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[57]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[58] == 2, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[58], expected 2, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[58]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[59] == 3, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[59], expected 3, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[59]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[60] == 4, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[60], expected 4, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[60]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[61] == 5, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[61], expected 5, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[61]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[62] == 6, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[62], expected 6, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[62]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signature[63] == 7, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[63], expected 7, is %d", last_msg.msg.ecdsa_signature_dep_a.signature[63]); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[0] == 10, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[0], expected 10, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[0]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[1] == 21, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[1], expected 21, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[1]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[2] == 23, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[2], expected 23, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[2]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[3] == 63, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[3], expected 63, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[3]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[4] == 140, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[4], expected 140, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[4]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[5] == 37, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[5], expected 37, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[5]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[6] == 130, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[6], expected 130, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[6]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[7] == 106, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[7], expected 106, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[7]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[8] == 28, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[8], expected 28, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[8]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[9] == 40, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[9], expected 40, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[9]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[10] == 165, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[10], expected 165, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[10]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[11] == 179, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[11], expected 179, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[11]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[12] == 73, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[12], expected 73, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[12]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[13] == 178, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[13], expected 178, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[13]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[14] == 60, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[14], expected 60, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[14]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[15] == 126, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[15], expected 126, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[15]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[16] == 114, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[16], expected 114, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[16]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[17] == 78, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[17], expected 78, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[17]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[18] == 113, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[18], expected 113, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[18]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[19] == 27, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[19], expected 27, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[19]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[20] == 95, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[20], expected 95, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[20]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[21] == 3, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[21], expected 3, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[21]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[22] == 62, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[22], expected 62, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[22]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[23] == 104, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[23], expected 104, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[23]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[24] == 145, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[24], expected 145, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[24]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[25] == 96, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[25], expected 96, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[25]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[26] == 19, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[26], expected 19, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[26]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[27] == 92, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[27], expected 92, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[27]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[28] == 123, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[28], expected 123, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[28]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[29] == 14, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[29], expected 14, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[29]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[30] == 90, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[30], expected 90, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[30]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[31] == 153, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[31], expected 153, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[31]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[32] == 183, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[32], expected 183, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[32]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[33] == 9, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[33], expected 9, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[33]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[34] == 72, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[34], expected 72, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[34]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[35] == 81, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[35], expected 81, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[35]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[36] == 118, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[36], expected 118, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[36]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[37] == 112, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[37], expected 112, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[37]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[38] == 124, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[38], expected 124, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[38]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[39] == 16, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[39], expected 16, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[39]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[40] == 182, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[40], expected 182, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[40]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[41] == 76, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[41], expected 76, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[41]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[42] == 146, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[42], expected 146, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[42]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[43] == 115, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[43], expected 115, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[43]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[44] == 58, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[44], expected 58, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[44]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[45] == 144, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[45], expected 144, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[45]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[46] == 17, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[46], expected 17, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[46]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[47] == 105, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[47], expected 105, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[47]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[48] == 66, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[48], expected 66, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[48]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[49] == 31, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[49], expected 31, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[49]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[50] == 135, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[50], expected 135, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[50]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[51] == 54, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[51], expected 54, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[51]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[52] == 100, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[52], expected 100, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[52]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[53] == 84, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[53], expected 84, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[53]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[54] == 181, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[54], expected 181, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[54]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[55] == 103, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[55], expected 103, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[55]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[56] == 11, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[56], expected 11, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[56]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[57] == 88, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[57], expected 88, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[57]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[58] == 133, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[58], expected 133, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[58]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[59] == 155, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[59], expected 155, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[59]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[60] == 167, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[60], expected 167, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[60]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[61] == 173, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[61], expected 173, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[61]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[62] == 143, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[62], expected 143, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[62]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[63] == 86, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[63], expected 86, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[63]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[64] == 158, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[64], expected 158, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[64]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[65] == 20, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[65], expected 20, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[65]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[66] == 168, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[66], expected 168, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[66]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[67] == 132, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[67], expected 132, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[67]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[68] == 141, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[68], expected 141, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[68]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[69] == 102, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[69], expected 102, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[69]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[70] == 50, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[70], expected 50, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[70]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[71] == 48, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[71], expected 48, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[71]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[72] == 71, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[72], expected 71, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[72]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[73] == 147, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[73], expected 147, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[73]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[74] == 53, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[74], expected 53, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[74]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[75] == 87, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[75], expected 87, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[75]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[76] == 1, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[76], expected 1, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[76]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[77] == 108, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[77], expected 108, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[77]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[78] == 138, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[78], expected 138, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[78]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[79] == 36, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[79], expected 36, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[79]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[80] == 134, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[80], expected 134, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[80]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[81] == 139, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[81], expected 139, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[81]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[82] == 163, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[82], expected 163, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[82]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[83] == 82, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[83], expected 82, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[83]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[84] == 43, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[84], expected 43, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[84]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[85] == 52, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[85], expected 52, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[85]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[86] == 150, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[86], expected 150, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[86]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[87] == 12, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[87], expected 12, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[87]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[88] == 30, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[88], expected 30, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[88]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[89] == 110, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[89], expected 110, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[89]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[90] == 156, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[90], expected 156, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[90]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[91] == 107, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[91], expected 107, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[91]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[92] == 120, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[92], expected 120, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[92]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[93] == 91, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[93], expected 91, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[93]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[94] == 122, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[94], expected 122, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[94]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[95] == 69, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[95], expected 69, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[95]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[96] == 164, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[96], expected 164, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[96]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[97] == 170, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[97], expected 170, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[97]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[98] == 116, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[98], expected 116, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[98]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[99] == 25, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[99], expected 25, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[99]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[100] == 94, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[100], expected 94, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[100]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[101] == 5, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[101], expected 5, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[101]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[102] == 22, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[102], expected 22, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[102]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[103] == 24, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[103], expected 24, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[103]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[104] == 162, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[104], expected 162, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[104]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[105] == 175, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[105], expected 175, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[105]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[106] == 38, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[106], expected 38, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[106]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[107] == 157, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[107], expected 157, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[107]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[108] == 98, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[108], expected 98, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[108]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[109] == 44, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[109], expected 44, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[109]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[110] == 160, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[110], expected 160, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[110]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[111] == 47, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[111], expected 47, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[111]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[112] == 97, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[112], expected 97, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[112]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[113] == 142, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[113], expected 142, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[113]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[114] == 8, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[114], expected 8, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[114]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[115] == 74, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[115], expected 74, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[115]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[116] == 13, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[116], expected 13, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[116]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[117] == 177, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[117], expected 177, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[117]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[118] == 15, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[118], expected 15, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[118]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[119] == 128, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[119], expected 128, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[119]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[120] == 26, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[120], expected 26, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[120]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[121] == 131, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[121], expected 131, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[121]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[122] == 154, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[122], expected 154, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[122]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[123] == 65, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[123], expected 65, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[123]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[124] == 169, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[124], expected 169, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[124]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[125] == 55, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[125], expected 55, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[125]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[126] == 136, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[126], expected 136, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[126]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[127] == 125, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[127], expected 125, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[127]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[128] == 171, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[128], expected 171, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[128]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[129] == 161, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[129], expected 161, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[129]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[130] == 29, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[130], expected 29, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[130]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[131] == 129, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[131], expected 129, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[131]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[132] == 151, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[132], expected 151, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[132]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[133] == 68, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[133], expected 68, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[133]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[134] == 166, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[134], expected 166, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[134]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[135] == 51, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[135], expected 51, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[135]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[136] == 70, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[136], expected 70, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[136]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[137] == 45, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[137], expected 45, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[137]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[138] == 56, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[138], expected 56, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[138]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[139] == 79, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[139], expected 79, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[139]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[140] == 149, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[140], expected 149, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[140]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[141] == 99, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[141], expected 99, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[141]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[142] == 42, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[142], expected 42, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[142]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[143] == 101, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[143], expected 101, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[143]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[144] == 152, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[144], expected 152, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[144]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[145] == 39, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[145], expected 39, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[145]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[146] == 89, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[146], expected 89, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[146]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[147] == 180, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[147], expected 180, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[147]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[148] == 64, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[148], expected 64, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[148]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[149] == 49, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[149], expected 49, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[149]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[150] == 6, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[150], expected 6, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[150]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[151] == 80, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[151], expected 80, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[151]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[152] == 172, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[152], expected 172, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[152]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[153] == 32, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[153], expected 32, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[153]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[154] == 109, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[154], expected 109, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[154]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[155] == 2, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[155], expected 2, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[155]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[156] == 119, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[156], expected 119, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[156]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[157] == 93, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[157], expected 93, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[157]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[158] == 176, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[158], expected 176, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[158]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[159] == 0, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[159], expected 0, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[159]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[160] == 33, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[160], expected 33, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[160]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[161] == 57, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[161], expected 57, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[161]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[162] == 34, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[162], expected 34, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[162]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[163] == 18, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[163], expected 18, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[163]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[164] == 85, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[164], expected 85, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[164]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[165] == 121, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[165], expected 121, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[165]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[166] == 137, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[166], expected 137, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[166]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[167] == 83, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[167], expected 83, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[167]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[168] == 111, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[168], expected 111, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[168]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[169] == 59, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[169], expected 59, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[169]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[170] == 7, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[170], expected 7, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[170]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[171] == 77, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[171], expected 77, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[171]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[172] == 4, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[172], expected 4, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[172]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[173] == 117, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[173], expected 117, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[173]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[174] == 159, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[174], expected 159, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[174]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[175] == 148, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[175], expected 148, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[175]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[176] == 35, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[176], expected 35, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[176]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[177] == 61, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[177], expected 61, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[177]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[178] == 41, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[178], expected 41, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[178]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[179] == 67, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[179], expected 67, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[179]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[180] == 46, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[180], expected 46, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[180]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[181] == 127, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[181], expected 127, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[181]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[182] == 75, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[182], expected 75, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[182]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[183] == 174, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signed_messages[183], expected 174, is %d", last_msg.msg.ecdsa_signature_dep_a.signed_messages[183]); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.stream_counter == 1, "incorrect value for last_msg.msg.ecdsa_signature_dep_a.stream_counter, expected 1, is %d", last_msg.msg.ecdsa_signature_dep_a.stream_counter); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgEcdsaSignatureDepA, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.certificate_id[0] == 1, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.certificate_id[0], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.certificate_id[0]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.certificate_id[1] == 2, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.certificate_id[1], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.certificate_id[1]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.certificate_id[2] == 3, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.certificate_id[2], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.certificate_id[2]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.certificate_id[3] == 4, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.certificate_id[3], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.certificate_id[3]); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.flags == 0, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.flags, expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.flags); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.n_signed_messages == 184, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.n_signed_messages, " + "expected 184, is %d", + last_msg.msg.ecdsa_signature_dep_a.n_signed_messages); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.on_demand_counter == 2, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.on_demand_counter, " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.on_demand_counter); + + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[0] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[0], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[0]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[1] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[1], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[1]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[2] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[2], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[2]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[3] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[3], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[3]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[4] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[4], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[4]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[5] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[5], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[5]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[6] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[6], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[6]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[7] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[7], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[7]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[8] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[8], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[8]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[9] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[9], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[9]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[10] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[10], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[10]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[11] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[11], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[11]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[12] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[12], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[12]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[13] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[13], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[13]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[14] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[14], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[14]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[15] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[15], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[15]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[16] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[16], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[16]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[17] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[17], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[17]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[18] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[18], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[18]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[19] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[19], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[19]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[20] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[20], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[20]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[21] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[21], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[21]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[22] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[22], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[22]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[23] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[23], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[23]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[24] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[24], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[24]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[25] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[25], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[25]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[26] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[26], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[26]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[27] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[27], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[27]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[28] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[28], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[28]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[29] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[29], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[29]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[30] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[30], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[30]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[31] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[31], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[31]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[32] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[32], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[32]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[33] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[33], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[33]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[34] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[34], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[34]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[35] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[35], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[35]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[36] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[36], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[36]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[37] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[37], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[37]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[38] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[38], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[38]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[39] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[39], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[39]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[40] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[40], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[40]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[41] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[41], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[41]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[42] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[42], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[42]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[43] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[43], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[43]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[44] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[44], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[44]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[45] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[45], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[45]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[46] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[46], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[46]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[47] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[47], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[47]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[48] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[48], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[48]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[49] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[49], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[49]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[50] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[50], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[50]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[51] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[51], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[51]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[52] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[52], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[52]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[53] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[53], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[53]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[54] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[54], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[54]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[55] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[55], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[55]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[56] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[56], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[56]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[57] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[57], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[57]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[58] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[58], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[58]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[59] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[59], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[59]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[60] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[60], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[60]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[61] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[61], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[61]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[62] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[62], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[62]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[63] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[63], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[63]); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[0] == 10, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[0], " + "expected 10, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[0]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[1] == 21, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[1], " + "expected 21, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[1]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[2] == 23, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[2], " + "expected 23, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[2]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[3] == 63, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[3], " + "expected 63, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[3]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[4] == 140, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[4], " + "expected 140, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[4]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[5] == 37, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[5], " + "expected 37, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[5]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[6] == 130, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[6], " + "expected 130, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[6]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[7] == 106, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[7], " + "expected 106, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[7]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[8] == 28, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[8], " + "expected 28, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[8]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[9] == 40, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[9], " + "expected 40, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[9]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[10] == 165, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[10], " + "expected 165, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[10]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[11] == 179, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[11], " + "expected 179, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[11]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[12] == 73, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[12], " + "expected 73, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[12]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[13] == 178, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[13], " + "expected 178, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[13]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[14] == 60, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[14], " + "expected 60, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[14]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[15] == 126, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[15], " + "expected 126, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[15]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[16] == 114, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[16], " + "expected 114, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[16]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[17] == 78, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[17], " + "expected 78, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[17]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[18] == 113, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[18], " + "expected 113, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[18]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[19] == 27, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[19], " + "expected 27, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[19]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[20] == 95, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[20], " + "expected 95, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[20]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[21] == 3, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[21], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[21]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[22] == 62, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[22], " + "expected 62, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[22]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[23] == 104, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[23], " + "expected 104, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[23]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[24] == 145, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[24], " + "expected 145, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[24]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[25] == 96, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[25], " + "expected 96, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[25]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[26] == 19, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[26], " + "expected 19, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[26]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[27] == 92, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[27], " + "expected 92, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[27]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[28] == 123, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[28], " + "expected 123, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[28]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[29] == 14, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[29], " + "expected 14, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[29]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[30] == 90, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[30], " + "expected 90, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[30]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[31] == 153, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[31], " + "expected 153, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[31]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[32] == 183, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[32], " + "expected 183, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[32]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[33] == 9, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[33], " + "expected 9, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[33]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[34] == 72, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[34], " + "expected 72, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[34]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[35] == 81, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[35], " + "expected 81, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[35]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[36] == 118, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[36], " + "expected 118, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[36]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[37] == 112, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[37], " + "expected 112, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[37]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[38] == 124, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[38], " + "expected 124, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[38]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[39] == 16, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[39], " + "expected 16, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[39]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[40] == 182, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[40], " + "expected 182, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[40]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[41] == 76, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[41], " + "expected 76, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[41]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[42] == 146, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[42], " + "expected 146, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[42]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[43] == 115, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[43], " + "expected 115, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[43]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[44] == 58, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[44], " + "expected 58, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[44]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[45] == 144, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[45], " + "expected 144, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[45]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[46] == 17, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[46], " + "expected 17, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[46]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[47] == 105, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[47], " + "expected 105, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[47]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[48] == 66, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[48], " + "expected 66, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[48]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[49] == 31, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[49], " + "expected 31, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[49]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[50] == 135, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[50], " + "expected 135, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[50]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[51] == 54, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[51], " + "expected 54, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[51]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[52] == 100, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[52], " + "expected 100, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[52]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[53] == 84, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[53], " + "expected 84, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[53]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[54] == 181, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[54], " + "expected 181, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[54]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[55] == 103, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[55], " + "expected 103, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[55]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[56] == 11, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[56], " + "expected 11, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[56]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[57] == 88, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[57], " + "expected 88, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[57]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[58] == 133, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[58], " + "expected 133, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[58]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[59] == 155, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[59], " + "expected 155, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[59]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[60] == 167, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[60], " + "expected 167, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[60]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[61] == 173, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[61], " + "expected 173, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[61]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[62] == 143, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[62], " + "expected 143, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[62]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[63] == 86, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[63], " + "expected 86, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[63]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[64] == 158, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[64], " + "expected 158, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[64]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[65] == 20, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[65], " + "expected 20, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[65]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[66] == 168, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[66], " + "expected 168, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[66]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[67] == 132, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[67], " + "expected 132, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[67]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[68] == 141, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[68], " + "expected 141, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[68]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[69] == 102, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[69], " + "expected 102, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[69]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[70] == 50, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[70], " + "expected 50, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[70]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[71] == 48, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[71], " + "expected 48, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[71]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[72] == 71, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[72], " + "expected 71, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[72]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[73] == 147, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[73], " + "expected 147, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[73]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[74] == 53, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[74], " + "expected 53, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[74]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[75] == 87, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[75], " + "expected 87, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[75]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[76] == 1, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[76], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[76]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[77] == 108, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[77], " + "expected 108, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[77]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[78] == 138, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[78], " + "expected 138, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[78]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[79] == 36, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[79], " + "expected 36, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[79]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[80] == 134, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[80], " + "expected 134, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[80]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[81] == 139, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[81], " + "expected 139, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[81]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[82] == 163, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[82], " + "expected 163, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[82]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[83] == 82, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[83], " + "expected 82, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[83]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[84] == 43, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[84], " + "expected 43, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[84]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[85] == 52, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[85], " + "expected 52, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[85]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[86] == 150, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[86], " + "expected 150, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[86]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[87] == 12, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[87], " + "expected 12, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[87]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[88] == 30, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[88], " + "expected 30, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[88]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[89] == 110, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[89], " + "expected 110, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[89]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[90] == 156, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[90], " + "expected 156, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[90]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[91] == 107, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[91], " + "expected 107, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[91]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[92] == 120, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[92], " + "expected 120, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[92]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[93] == 91, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[93], " + "expected 91, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[93]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[94] == 122, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[94], " + "expected 122, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[94]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[95] == 69, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[95], " + "expected 69, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[95]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[96] == 164, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[96], " + "expected 164, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[96]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[97] == 170, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[97], " + "expected 170, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[97]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[98] == 116, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[98], " + "expected 116, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[98]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[99] == 25, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[99], " + "expected 25, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[99]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[100] == 94, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[100], " + "expected 94, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[100]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[101] == 5, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[101], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[101]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[102] == 22, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[102], " + "expected 22, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[102]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[103] == 24, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[103], " + "expected 24, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[103]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[104] == 162, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[104], expected " + "162, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[104]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[105] == 175, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[105], expected " + "175, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[105]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[106] == 38, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[106], " + "expected 38, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[106]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[107] == 157, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[107], expected " + "157, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[107]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[108] == 98, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[108], " + "expected 98, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[108]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[109] == 44, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[109], " + "expected 44, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[109]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[110] == 160, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[110], expected " + "160, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[110]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[111] == 47, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[111], " + "expected 47, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[111]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[112] == 97, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[112], " + "expected 97, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[112]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[113] == 142, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[113], expected " + "142, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[113]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[114] == 8, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[114], " + "expected 8, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[114]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[115] == 74, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[115], " + "expected 74, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[115]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[116] == 13, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[116], " + "expected 13, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[116]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[117] == 177, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[117], expected " + "177, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[117]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[118] == 15, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[118], " + "expected 15, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[118]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[119] == 128, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[119], expected " + "128, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[119]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[120] == 26, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[120], " + "expected 26, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[120]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[121] == 131, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[121], expected " + "131, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[121]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[122] == 154, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[122], expected " + "154, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[122]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[123] == 65, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[123], " + "expected 65, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[123]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[124] == 169, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[124], expected " + "169, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[124]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[125] == 55, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[125], " + "expected 55, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[125]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[126] == 136, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[126], expected " + "136, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[126]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[127] == 125, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[127], expected " + "125, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[127]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[128] == 171, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[128], expected " + "171, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[128]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[129] == 161, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[129], expected " + "161, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[129]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[130] == 29, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[130], " + "expected 29, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[130]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[131] == 129, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[131], expected " + "129, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[131]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[132] == 151, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[132], expected " + "151, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[132]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[133] == 68, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[133], " + "expected 68, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[133]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[134] == 166, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[134], expected " + "166, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[134]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[135] == 51, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[135], " + "expected 51, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[135]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[136] == 70, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[136], " + "expected 70, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[136]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[137] == 45, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[137], " + "expected 45, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[137]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[138] == 56, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[138], " + "expected 56, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[138]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[139] == 79, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[139], " + "expected 79, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[139]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[140] == 149, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[140], expected " + "149, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[140]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[141] == 99, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[141], " + "expected 99, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[141]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[142] == 42, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[142], " + "expected 42, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[142]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[143] == 101, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[143], expected " + "101, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[143]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[144] == 152, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[144], expected " + "152, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[144]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[145] == 39, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[145], " + "expected 39, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[145]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[146] == 89, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[146], " + "expected 89, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[146]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[147] == 180, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[147], expected " + "180, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[147]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[148] == 64, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[148], " + "expected 64, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[148]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[149] == 49, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[149], " + "expected 49, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[149]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[150] == 6, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[150], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[150]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[151] == 80, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[151], " + "expected 80, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[151]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[152] == 172, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[152], expected " + "172, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[152]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[153] == 32, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[153], " + "expected 32, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[153]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[154] == 109, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[154], expected " + "109, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[154]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[155] == 2, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[155], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[155]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[156] == 119, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[156], expected " + "119, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[156]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[157] == 93, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[157], " + "expected 93, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[157]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[158] == 176, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[158], expected " + "176, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[158]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[159] == 0, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[159], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[159]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[160] == 33, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[160], " + "expected 33, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[160]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[161] == 57, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[161], " + "expected 57, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[161]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[162] == 34, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[162], " + "expected 34, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[162]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[163] == 18, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[163], " + "expected 18, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[163]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[164] == 85, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[164], " + "expected 85, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[164]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[165] == 121, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[165], expected " + "121, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[165]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[166] == 137, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[166], expected " + "137, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[166]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[167] == 83, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[167], " + "expected 83, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[167]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[168] == 111, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[168], expected " + "111, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[168]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[169] == 59, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[169], " + "expected 59, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[169]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[170] == 7, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[170], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[170]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[171] == 77, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[171], " + "expected 77, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[171]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[172] == 4, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[172], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[172]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[173] == 117, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[173], expected " + "117, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[173]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[174] == 159, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[174], expected " + "159, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[174]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[175] == 148, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[175], expected " + "148, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[175]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[176] == 35, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[176], " + "expected 35, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[176]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[177] == 61, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[177], " + "expected 61, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[177]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[178] == 41, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[178], " + "expected 41, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[178]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[179] == 67, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[179], " + "expected 67, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[179]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[180] == 46, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[180], " + "expected 46, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[180]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[181] == 127, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[181], expected " + "127, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[181]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[182] == 75, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[182], " + "expected 75, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[182]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[183] == 174, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[183], expected " + "174, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[183]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.stream_counter == 1, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.stream_counter, expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.stream_counter); } } END_TEST -Suite* auto_check_sbp_signing_MsgEcdsaSignatureDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_signing_MsgEcdsaSignatureDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_signing_MsgEcdsaSignatureDepA"); +Suite *auto_check_sbp_signing_MsgEcdsaSignatureDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_signing_MsgEcdsaSignatureDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_signing_MsgEcdsaSignatureDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_signing_MsgEcdsaSignatureDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c b/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c index 22174e324..703ae3bd3 100644 --- a/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c +++ b/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_signing_MsgEcdsaSignatureDepB ) -{ +START_TEST(test_auto_check_sbp_signing_MsgEcdsaSignatureDepB) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_signing_MsgEcdsaSignatureDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,306 +90,650 @@ START_TEST( test_auto_check_sbp_signing_MsgEcdsaSignatureDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0xC07, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xC07, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,7,12,66,0,83,0,1,2,1,2,3,4,72,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,10,21,23,254,159, }; + u8 encoded_frame[] = { + 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ecdsa_signature_dep_b.certificate_id[0] = 1; - + test_msg.ecdsa_signature_dep_b.certificate_id[1] = 2; - + test_msg.ecdsa_signature_dep_b.certificate_id[2] = 3; - + test_msg.ecdsa_signature_dep_b.certificate_id[3] = 4; - + test_msg.ecdsa_signature_dep_b.flags = 0; - + test_msg.ecdsa_signature_dep_b.n_signature_bytes = 72; - + test_msg.ecdsa_signature_dep_b.n_signed_messages = 3; - + test_msg.ecdsa_signature_dep_b.on_demand_counter = 2; - - + test_msg.ecdsa_signature_dep_b.signature[0] = 0; - + test_msg.ecdsa_signature_dep_b.signature[1] = 1; - + test_msg.ecdsa_signature_dep_b.signature[2] = 2; - + test_msg.ecdsa_signature_dep_b.signature[3] = 3; - + test_msg.ecdsa_signature_dep_b.signature[4] = 4; - + test_msg.ecdsa_signature_dep_b.signature[5] = 5; - + test_msg.ecdsa_signature_dep_b.signature[6] = 6; - + test_msg.ecdsa_signature_dep_b.signature[7] = 7; - + test_msg.ecdsa_signature_dep_b.signature[8] = 8; - + test_msg.ecdsa_signature_dep_b.signature[9] = 9; - + test_msg.ecdsa_signature_dep_b.signature[10] = 10; - + test_msg.ecdsa_signature_dep_b.signature[11] = 11; - + test_msg.ecdsa_signature_dep_b.signature[12] = 12; - + test_msg.ecdsa_signature_dep_b.signature[13] = 13; - + test_msg.ecdsa_signature_dep_b.signature[14] = 14; - + test_msg.ecdsa_signature_dep_b.signature[15] = 15; - + test_msg.ecdsa_signature_dep_b.signature[16] = 16; - + test_msg.ecdsa_signature_dep_b.signature[17] = 17; - + test_msg.ecdsa_signature_dep_b.signature[18] = 18; - + test_msg.ecdsa_signature_dep_b.signature[19] = 19; - + test_msg.ecdsa_signature_dep_b.signature[20] = 20; - + test_msg.ecdsa_signature_dep_b.signature[21] = 21; - + test_msg.ecdsa_signature_dep_b.signature[22] = 22; - + test_msg.ecdsa_signature_dep_b.signature[23] = 23; - + test_msg.ecdsa_signature_dep_b.signature[24] = 24; - + test_msg.ecdsa_signature_dep_b.signature[25] = 25; - + test_msg.ecdsa_signature_dep_b.signature[26] = 26; - + test_msg.ecdsa_signature_dep_b.signature[27] = 27; - + test_msg.ecdsa_signature_dep_b.signature[28] = 28; - + test_msg.ecdsa_signature_dep_b.signature[29] = 29; - + test_msg.ecdsa_signature_dep_b.signature[30] = 30; - + test_msg.ecdsa_signature_dep_b.signature[31] = 31; - + test_msg.ecdsa_signature_dep_b.signature[32] = 32; - + test_msg.ecdsa_signature_dep_b.signature[33] = 33; - + test_msg.ecdsa_signature_dep_b.signature[34] = 34; - + test_msg.ecdsa_signature_dep_b.signature[35] = 35; - + test_msg.ecdsa_signature_dep_b.signature[36] = 36; - + test_msg.ecdsa_signature_dep_b.signature[37] = 37; - + test_msg.ecdsa_signature_dep_b.signature[38] = 38; - + test_msg.ecdsa_signature_dep_b.signature[39] = 39; - + test_msg.ecdsa_signature_dep_b.signature[40] = 40; - + test_msg.ecdsa_signature_dep_b.signature[41] = 41; - + test_msg.ecdsa_signature_dep_b.signature[42] = 42; - + test_msg.ecdsa_signature_dep_b.signature[43] = 43; - + test_msg.ecdsa_signature_dep_b.signature[44] = 44; - + test_msg.ecdsa_signature_dep_b.signature[45] = 45; - + test_msg.ecdsa_signature_dep_b.signature[46] = 46; - + test_msg.ecdsa_signature_dep_b.signature[47] = 47; - + test_msg.ecdsa_signature_dep_b.signature[48] = 48; - + test_msg.ecdsa_signature_dep_b.signature[49] = 49; - + test_msg.ecdsa_signature_dep_b.signature[50] = 50; - + test_msg.ecdsa_signature_dep_b.signature[51] = 51; - + test_msg.ecdsa_signature_dep_b.signature[52] = 52; - + test_msg.ecdsa_signature_dep_b.signature[53] = 53; - + test_msg.ecdsa_signature_dep_b.signature[54] = 54; - + test_msg.ecdsa_signature_dep_b.signature[55] = 55; - + test_msg.ecdsa_signature_dep_b.signature[56] = 56; - + test_msg.ecdsa_signature_dep_b.signature[57] = 57; - + test_msg.ecdsa_signature_dep_b.signature[58] = 58; - + test_msg.ecdsa_signature_dep_b.signature[59] = 59; - + test_msg.ecdsa_signature_dep_b.signature[60] = 60; - + test_msg.ecdsa_signature_dep_b.signature[61] = 61; - + test_msg.ecdsa_signature_dep_b.signature[62] = 62; - + test_msg.ecdsa_signature_dep_b.signature[63] = 63; - + test_msg.ecdsa_signature_dep_b.signature[64] = 64; - + test_msg.ecdsa_signature_dep_b.signature[65] = 65; - + test_msg.ecdsa_signature_dep_b.signature[66] = 66; - + test_msg.ecdsa_signature_dep_b.signature[67] = 67; - + test_msg.ecdsa_signature_dep_b.signature[68] = 68; - + test_msg.ecdsa_signature_dep_b.signature[69] = 69; - + test_msg.ecdsa_signature_dep_b.signature[70] = 70; - + test_msg.ecdsa_signature_dep_b.signature[71] = 71; - - + test_msg.ecdsa_signature_dep_b.signed_messages[0] = 10; - + test_msg.ecdsa_signature_dep_b.signed_messages[1] = 21; - + test_msg.ecdsa_signature_dep_b.signed_messages[2] = 23; - + test_msg.ecdsa_signature_dep_b.stream_counter = 1; - sbp_message_send(&sbp_state, SbpMsgEcdsaSignatureDepB, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEcdsaSignatureDepB, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgEcdsaSignatureDepB, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.certificate_id[0] == 1, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.certificate_id[0], expected 1, is %d", last_msg.msg.ecdsa_signature_dep_b.certificate_id[0]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.certificate_id[1] == 2, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.certificate_id[1], expected 2, is %d", last_msg.msg.ecdsa_signature_dep_b.certificate_id[1]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.certificate_id[2] == 3, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.certificate_id[2], expected 3, is %d", last_msg.msg.ecdsa_signature_dep_b.certificate_id[2]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.certificate_id[3] == 4, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.certificate_id[3], expected 4, is %d", last_msg.msg.ecdsa_signature_dep_b.certificate_id[3]); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.flags == 0, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.flags, expected 0, is %d", last_msg.msg.ecdsa_signature_dep_b.flags); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.n_signature_bytes == 72, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.n_signature_bytes, expected 72, is %d", last_msg.msg.ecdsa_signature_dep_b.n_signature_bytes); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.n_signed_messages == 3, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.n_signed_messages, expected 3, is %d", last_msg.msg.ecdsa_signature_dep_b.n_signed_messages); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.on_demand_counter == 2, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.on_demand_counter, expected 2, is %d", last_msg.msg.ecdsa_signature_dep_b.on_demand_counter); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[0] == 0, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[0], expected 0, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[0]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[1] == 1, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[1], expected 1, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[1]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[2] == 2, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[2], expected 2, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[2]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[3] == 3, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[3], expected 3, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[3]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[4] == 4, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[4], expected 4, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[4]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[5] == 5, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[5], expected 5, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[5]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[6] == 6, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[6], expected 6, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[6]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[7] == 7, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[7], expected 7, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[7]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[8] == 8, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[8], expected 8, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[8]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[9] == 9, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[9], expected 9, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[9]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[10] == 10, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[10], expected 10, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[10]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[11] == 11, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[11], expected 11, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[11]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[12] == 12, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[12], expected 12, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[12]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[13] == 13, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[13], expected 13, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[13]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[14] == 14, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[14], expected 14, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[14]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[15] == 15, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[15], expected 15, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[15]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[16] == 16, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[16], expected 16, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[16]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[17] == 17, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[17], expected 17, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[17]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[18] == 18, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[18], expected 18, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[18]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[19] == 19, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[19], expected 19, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[19]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[20] == 20, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[20], expected 20, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[20]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[21] == 21, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[21], expected 21, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[21]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[22] == 22, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[22], expected 22, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[22]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[23] == 23, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[23], expected 23, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[23]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[24] == 24, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[24], expected 24, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[24]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[25] == 25, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[25], expected 25, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[25]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[26] == 26, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[26], expected 26, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[26]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[27] == 27, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[27], expected 27, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[27]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[28] == 28, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[28], expected 28, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[28]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[29] == 29, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[29], expected 29, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[29]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[30] == 30, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[30], expected 30, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[30]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[31] == 31, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[31], expected 31, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[31]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[32] == 32, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[32], expected 32, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[32]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[33] == 33, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[33], expected 33, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[33]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[34] == 34, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[34], expected 34, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[34]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[35] == 35, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[35], expected 35, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[35]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[36] == 36, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[36], expected 36, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[36]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[37] == 37, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[37], expected 37, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[37]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[38] == 38, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[38], expected 38, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[38]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[39] == 39, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[39], expected 39, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[39]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[40] == 40, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[40], expected 40, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[40]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[41] == 41, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[41], expected 41, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[41]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[42] == 42, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[42], expected 42, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[42]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[43] == 43, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[43], expected 43, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[43]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[44] == 44, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[44], expected 44, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[44]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[45] == 45, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[45], expected 45, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[45]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[46] == 46, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[46], expected 46, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[46]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[47] == 47, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[47], expected 47, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[47]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[48] == 48, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[48], expected 48, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[48]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[49] == 49, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[49], expected 49, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[49]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[50] == 50, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[50], expected 50, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[50]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[51] == 51, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[51], expected 51, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[51]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[52] == 52, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[52], expected 52, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[52]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[53] == 53, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[53], expected 53, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[53]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[54] == 54, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[54], expected 54, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[54]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[55] == 55, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[55], expected 55, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[55]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[56] == 56, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[56], expected 56, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[56]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[57] == 57, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[57], expected 57, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[57]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[58] == 58, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[58], expected 58, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[58]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[59] == 59, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[59], expected 59, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[59]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[60] == 60, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[60], expected 60, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[60]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[61] == 61, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[61], expected 61, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[61]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[62] == 62, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[62], expected 62, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[62]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[63] == 63, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[63], expected 63, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[63]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[64] == 64, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[64], expected 64, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[64]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[65] == 65, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[65], expected 65, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[65]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[66] == 66, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[66], expected 66, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[66]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[67] == 67, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[67], expected 67, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[67]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[68] == 68, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[68], expected 68, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[68]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[69] == 69, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[69], expected 69, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[69]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[70] == 70, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[70], expected 70, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[70]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signature[71] == 71, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[71], expected 71, is %d", last_msg.msg.ecdsa_signature_dep_b.signature[71]); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signed_messages[0] == 10, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signed_messages[0], expected 10, is %d", last_msg.msg.ecdsa_signature_dep_b.signed_messages[0]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signed_messages[1] == 21, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signed_messages[1], expected 21, is %d", last_msg.msg.ecdsa_signature_dep_b.signed_messages[1]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signed_messages[2] == 23, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signed_messages[2], expected 23, is %d", last_msg.msg.ecdsa_signature_dep_b.signed_messages[2]); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.stream_counter == 1, "incorrect value for last_msg.msg.ecdsa_signature_dep_b.stream_counter, expected 1, is %d", last_msg.msg.ecdsa_signature_dep_b.stream_counter); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgEcdsaSignatureDepB, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.certificate_id[0] == 1, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.certificate_id[0], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_b.certificate_id[0]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.certificate_id[1] == 2, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.certificate_id[1], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_b.certificate_id[1]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.certificate_id[2] == 3, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.certificate_id[2], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_b.certificate_id[2]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.certificate_id[3] == 4, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.certificate_id[3], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_b.certificate_id[3]); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.flags == 0, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.flags, expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_b.flags); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.n_signature_bytes == 72, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.n_signature_bytes, " + "expected 72, is %d", + last_msg.msg.ecdsa_signature_dep_b.n_signature_bytes); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.n_signed_messages == 3, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.n_signed_messages, " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_b.n_signed_messages); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.on_demand_counter == 2, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.on_demand_counter, " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_b.on_demand_counter); + + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[0] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[0], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[0]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[1] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[1], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[1]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[2] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[2], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[2]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[3] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[3], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[3]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[4] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[4], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[4]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[5] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[5], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[5]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[6] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[6], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[6]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[7] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[7], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[7]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[8] == 8, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[8], " + "expected 8, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[8]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[9] == 9, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[9], " + "expected 9, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[9]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[10] == 10, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[10], " + "expected 10, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[10]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[11] == 11, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[11], " + "expected 11, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[11]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[12] == 12, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[12], " + "expected 12, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[12]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[13] == 13, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[13], " + "expected 13, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[13]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[14] == 14, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[14], " + "expected 14, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[14]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[15] == 15, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[15], " + "expected 15, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[15]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[16] == 16, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[16], " + "expected 16, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[16]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[17] == 17, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[17], " + "expected 17, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[17]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[18] == 18, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[18], " + "expected 18, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[18]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[19] == 19, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[19], " + "expected 19, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[19]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[20] == 20, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[20], " + "expected 20, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[20]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[21] == 21, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[21], " + "expected 21, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[21]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[22] == 22, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[22], " + "expected 22, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[22]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[23] == 23, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[23], " + "expected 23, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[23]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[24] == 24, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[24], " + "expected 24, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[24]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[25] == 25, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[25], " + "expected 25, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[25]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[26] == 26, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[26], " + "expected 26, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[26]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[27] == 27, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[27], " + "expected 27, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[27]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[28] == 28, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[28], " + "expected 28, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[28]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[29] == 29, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[29], " + "expected 29, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[29]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[30] == 30, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[30], " + "expected 30, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[30]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[31] == 31, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[31], " + "expected 31, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[31]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[32] == 32, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[32], " + "expected 32, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[32]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[33] == 33, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[33], " + "expected 33, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[33]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[34] == 34, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[34], " + "expected 34, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[34]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[35] == 35, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[35], " + "expected 35, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[35]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[36] == 36, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[36], " + "expected 36, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[36]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[37] == 37, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[37], " + "expected 37, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[37]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[38] == 38, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[38], " + "expected 38, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[38]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[39] == 39, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[39], " + "expected 39, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[39]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[40] == 40, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[40], " + "expected 40, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[40]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[41] == 41, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[41], " + "expected 41, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[41]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[42] == 42, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[42], " + "expected 42, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[42]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[43] == 43, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[43], " + "expected 43, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[43]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[44] == 44, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[44], " + "expected 44, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[44]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[45] == 45, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[45], " + "expected 45, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[45]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[46] == 46, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[46], " + "expected 46, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[46]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[47] == 47, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[47], " + "expected 47, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[47]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[48] == 48, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[48], " + "expected 48, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[48]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[49] == 49, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[49], " + "expected 49, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[49]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[50] == 50, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[50], " + "expected 50, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[50]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[51] == 51, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[51], " + "expected 51, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[51]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[52] == 52, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[52], " + "expected 52, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[52]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[53] == 53, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[53], " + "expected 53, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[53]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[54] == 54, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[54], " + "expected 54, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[54]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[55] == 55, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[55], " + "expected 55, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[55]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[56] == 56, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[56], " + "expected 56, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[56]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[57] == 57, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[57], " + "expected 57, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[57]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[58] == 58, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[58], " + "expected 58, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[58]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[59] == 59, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[59], " + "expected 59, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[59]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[60] == 60, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[60], " + "expected 60, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[60]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[61] == 61, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[61], " + "expected 61, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[61]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[62] == 62, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[62], " + "expected 62, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[62]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[63] == 63, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[63], " + "expected 63, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[63]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[64] == 64, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[64], " + "expected 64, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[64]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[65] == 65, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[65], " + "expected 65, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[65]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[66] == 66, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[66], " + "expected 66, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[66]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[67] == 67, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[67], " + "expected 67, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[67]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[68] == 68, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[68], " + "expected 68, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[68]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[69] == 69, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[69], " + "expected 69, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[69]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[70] == 70, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[70], " + "expected 70, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[70]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[71] == 71, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[71], " + "expected 71, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[71]); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signed_messages[0] == 10, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.signed_messages[0], " + "expected 10, is %d", + last_msg.msg.ecdsa_signature_dep_b.signed_messages[0]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signed_messages[1] == 21, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.signed_messages[1], " + "expected 21, is %d", + last_msg.msg.ecdsa_signature_dep_b.signed_messages[1]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signed_messages[2] == 23, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.signed_messages[2], " + "expected 23, is %d", + last_msg.msg.ecdsa_signature_dep_b.signed_messages[2]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.stream_counter == 1, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.stream_counter, expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_b.stream_counter); } } END_TEST -Suite* auto_check_sbp_signing_MsgEcdsaSignatureDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_signing_MsgEcdsaSignatureDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_signing_MsgEcdsaSignatureDepB"); +Suite *auto_check_sbp_signing_MsgEcdsaSignatureDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_signing_MsgEcdsaSignatureDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_signing_MsgEcdsaSignatureDepB"); tcase_add_test(tc_acq, test_auto_check_sbp_signing_MsgEcdsaSignatureDepB); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_signing_MsgEd25519CertificateDep.c b/c/test/auto_check_sbp_signing_MsgEd25519CertificateDep.c index 08da3f142..bf0e83502 100644 --- a/c/test/auto_check_sbp_signing_MsgEd25519CertificateDep.c +++ b/c/test/auto_check_sbp_signing_MsgEd25519CertificateDep.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519CertificateDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519CertificateDep.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_signing_MsgEd25519CertificateDep ) -{ +START_TEST(test_auto_check_sbp_signing_MsgEd25519CertificateDep) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_signing_MsgEd25519CertificateDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,370 +90,898 @@ START_TEST( test_auto_check_sbp_signing_MsgEd25519CertificateDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0xC02, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xC02, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,12,66,0,106,16,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,123,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,177,180,183,186,189,192,195,198,201,204,207,210,213,216,219,222,225,228,231,234,237,240,243,246,249,252,218,148, }; + u8 encoded_frame[] = { + 85, 2, 12, 66, 0, 106, 16, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, + 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, + 75, 78, 81, 84, 87, 90, 93, 96, 99, 102, 105, 108, 111, + 114, 117, 120, 123, 126, 129, 132, 135, 138, 141, 144, 147, 150, + 153, 156, 159, 162, 165, 168, 171, 174, 177, 180, 183, 186, 189, + 192, 195, 198, 201, 204, 207, 210, 213, 216, 219, 222, 225, 228, + 231, 234, 237, 240, 243, 246, 249, 252, 218, 148, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ed25519_certificate_dep.certificate_bytes[0] = 0; - + test_msg.ed25519_certificate_dep.certificate_bytes[1] = 3; - + test_msg.ed25519_certificate_dep.certificate_bytes[2] = 6; - + test_msg.ed25519_certificate_dep.certificate_bytes[3] = 9; - + test_msg.ed25519_certificate_dep.certificate_bytes[4] = 12; - + test_msg.ed25519_certificate_dep.certificate_bytes[5] = 15; - + test_msg.ed25519_certificate_dep.certificate_bytes[6] = 18; - + test_msg.ed25519_certificate_dep.certificate_bytes[7] = 21; - + test_msg.ed25519_certificate_dep.certificate_bytes[8] = 24; - + test_msg.ed25519_certificate_dep.certificate_bytes[9] = 27; - + test_msg.ed25519_certificate_dep.certificate_bytes[10] = 30; - + test_msg.ed25519_certificate_dep.certificate_bytes[11] = 33; - + test_msg.ed25519_certificate_dep.certificate_bytes[12] = 36; - + test_msg.ed25519_certificate_dep.certificate_bytes[13] = 39; - + test_msg.ed25519_certificate_dep.certificate_bytes[14] = 42; - + test_msg.ed25519_certificate_dep.certificate_bytes[15] = 45; - + test_msg.ed25519_certificate_dep.certificate_bytes[16] = 48; - + test_msg.ed25519_certificate_dep.certificate_bytes[17] = 51; - + test_msg.ed25519_certificate_dep.certificate_bytes[18] = 54; - + test_msg.ed25519_certificate_dep.certificate_bytes[19] = 57; - + test_msg.ed25519_certificate_dep.certificate_bytes[20] = 60; - + test_msg.ed25519_certificate_dep.certificate_bytes[21] = 63; - + test_msg.ed25519_certificate_dep.certificate_bytes[22] = 66; - + test_msg.ed25519_certificate_dep.certificate_bytes[23] = 69; - + test_msg.ed25519_certificate_dep.certificate_bytes[24] = 72; - + test_msg.ed25519_certificate_dep.certificate_bytes[25] = 75; - + test_msg.ed25519_certificate_dep.certificate_bytes[26] = 78; - + test_msg.ed25519_certificate_dep.certificate_bytes[27] = 81; - + test_msg.ed25519_certificate_dep.certificate_bytes[28] = 84; - + test_msg.ed25519_certificate_dep.certificate_bytes[29] = 87; - + test_msg.ed25519_certificate_dep.certificate_bytes[30] = 90; - + test_msg.ed25519_certificate_dep.certificate_bytes[31] = 93; - + test_msg.ed25519_certificate_dep.certificate_bytes[32] = 96; - + test_msg.ed25519_certificate_dep.certificate_bytes[33] = 99; - + test_msg.ed25519_certificate_dep.certificate_bytes[34] = 102; - + test_msg.ed25519_certificate_dep.certificate_bytes[35] = 105; - + test_msg.ed25519_certificate_dep.certificate_bytes[36] = 108; - + test_msg.ed25519_certificate_dep.certificate_bytes[37] = 111; - + test_msg.ed25519_certificate_dep.certificate_bytes[38] = 114; - + test_msg.ed25519_certificate_dep.certificate_bytes[39] = 117; - + test_msg.ed25519_certificate_dep.certificate_bytes[40] = 120; - + test_msg.ed25519_certificate_dep.certificate_bytes[41] = 123; - + test_msg.ed25519_certificate_dep.certificate_bytes[42] = 126; - + test_msg.ed25519_certificate_dep.certificate_bytes[43] = 129; - + test_msg.ed25519_certificate_dep.certificate_bytes[44] = 132; - + test_msg.ed25519_certificate_dep.certificate_bytes[45] = 135; - + test_msg.ed25519_certificate_dep.certificate_bytes[46] = 138; - + test_msg.ed25519_certificate_dep.certificate_bytes[47] = 141; - + test_msg.ed25519_certificate_dep.certificate_bytes[48] = 144; - + test_msg.ed25519_certificate_dep.certificate_bytes[49] = 147; - + test_msg.ed25519_certificate_dep.certificate_bytes[50] = 150; - + test_msg.ed25519_certificate_dep.certificate_bytes[51] = 153; - + test_msg.ed25519_certificate_dep.certificate_bytes[52] = 156; - + test_msg.ed25519_certificate_dep.certificate_bytes[53] = 159; - + test_msg.ed25519_certificate_dep.certificate_bytes[54] = 162; - + test_msg.ed25519_certificate_dep.certificate_bytes[55] = 165; - + test_msg.ed25519_certificate_dep.certificate_bytes[56] = 168; - + test_msg.ed25519_certificate_dep.certificate_bytes[57] = 171; - + test_msg.ed25519_certificate_dep.certificate_bytes[58] = 174; - + test_msg.ed25519_certificate_dep.certificate_bytes[59] = 177; - + test_msg.ed25519_certificate_dep.certificate_bytes[60] = 180; - + test_msg.ed25519_certificate_dep.certificate_bytes[61] = 183; - + test_msg.ed25519_certificate_dep.certificate_bytes[62] = 186; - + test_msg.ed25519_certificate_dep.certificate_bytes[63] = 189; - + test_msg.ed25519_certificate_dep.certificate_bytes[64] = 192; - + test_msg.ed25519_certificate_dep.certificate_bytes[65] = 195; - + test_msg.ed25519_certificate_dep.certificate_bytes[66] = 198; - + test_msg.ed25519_certificate_dep.certificate_bytes[67] = 201; - + test_msg.ed25519_certificate_dep.certificate_bytes[68] = 204; - + test_msg.ed25519_certificate_dep.certificate_bytes[69] = 207; - + test_msg.ed25519_certificate_dep.certificate_bytes[70] = 210; - + test_msg.ed25519_certificate_dep.certificate_bytes[71] = 213; - + test_msg.ed25519_certificate_dep.certificate_bytes[72] = 216; - + test_msg.ed25519_certificate_dep.certificate_bytes[73] = 219; - + test_msg.ed25519_certificate_dep.certificate_bytes[74] = 222; - + test_msg.ed25519_certificate_dep.certificate_bytes[75] = 225; - + test_msg.ed25519_certificate_dep.certificate_bytes[76] = 228; - + test_msg.ed25519_certificate_dep.certificate_bytes[77] = 231; - + test_msg.ed25519_certificate_dep.certificate_bytes[78] = 234; - + test_msg.ed25519_certificate_dep.certificate_bytes[79] = 237; - + test_msg.ed25519_certificate_dep.certificate_bytes[80] = 240; - + test_msg.ed25519_certificate_dep.certificate_bytes[81] = 243; - + test_msg.ed25519_certificate_dep.certificate_bytes[82] = 246; - + test_msg.ed25519_certificate_dep.certificate_bytes[83] = 249; - + test_msg.ed25519_certificate_dep.certificate_bytes[84] = 252; - - + test_msg.ed25519_certificate_dep.fingerprint[0] = 100; - + test_msg.ed25519_certificate_dep.fingerprint[1] = 101; - + test_msg.ed25519_certificate_dep.fingerprint[2] = 102; - + test_msg.ed25519_certificate_dep.fingerprint[3] = 103; - + test_msg.ed25519_certificate_dep.fingerprint[4] = 104; - + test_msg.ed25519_certificate_dep.fingerprint[5] = 105; - + test_msg.ed25519_certificate_dep.fingerprint[6] = 106; - + test_msg.ed25519_certificate_dep.fingerprint[7] = 107; - + test_msg.ed25519_certificate_dep.fingerprint[8] = 108; - + test_msg.ed25519_certificate_dep.fingerprint[9] = 109; - + test_msg.ed25519_certificate_dep.fingerprint[10] = 110; - + test_msg.ed25519_certificate_dep.fingerprint[11] = 111; - + test_msg.ed25519_certificate_dep.fingerprint[12] = 112; - + test_msg.ed25519_certificate_dep.fingerprint[13] = 113; - + test_msg.ed25519_certificate_dep.fingerprint[14] = 114; - + test_msg.ed25519_certificate_dep.fingerprint[15] = 115; - + test_msg.ed25519_certificate_dep.fingerprint[16] = 116; - + test_msg.ed25519_certificate_dep.fingerprint[17] = 117; - + test_msg.ed25519_certificate_dep.fingerprint[18] = 118; - + test_msg.ed25519_certificate_dep.fingerprint[19] = 119; - + test_msg.ed25519_certificate_dep.n_certificate_bytes = 85; - + test_msg.ed25519_certificate_dep.n_msg = 16; - sbp_message_send(&sbp_state, SbpMsgEd25519CertificateDep, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEd25519CertificateDep, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgEd25519CertificateDep, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[0] == 0, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[0], expected 0, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[0]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[1] == 3, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[1], expected 3, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[1]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[2] == 6, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[2], expected 6, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[2]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[3] == 9, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[3], expected 9, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[3]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[4] == 12, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[4], expected 12, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[4]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[5] == 15, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[5], expected 15, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[5]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[6] == 18, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[6], expected 18, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[6]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[7] == 21, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[7], expected 21, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[7]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[8] == 24, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[8], expected 24, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[8]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[9] == 27, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[9], expected 27, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[9]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[10] == 30, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[10], expected 30, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[10]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[11] == 33, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[11], expected 33, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[11]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[12] == 36, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[12], expected 36, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[12]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[13] == 39, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[13], expected 39, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[13]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[14] == 42, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[14], expected 42, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[14]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[15] == 45, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[15], expected 45, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[15]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[16] == 48, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[16], expected 48, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[16]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[17] == 51, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[17], expected 51, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[17]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[18] == 54, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[18], expected 54, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[18]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[19] == 57, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[19], expected 57, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[19]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[20] == 60, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[20], expected 60, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[20]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[21] == 63, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[21], expected 63, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[21]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[22] == 66, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[22], expected 66, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[22]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[23] == 69, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[23], expected 69, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[23]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[24] == 72, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[24], expected 72, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[24]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[25] == 75, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[25], expected 75, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[25]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[26] == 78, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[26], expected 78, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[26]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[27] == 81, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[27], expected 81, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[27]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[28] == 84, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[28], expected 84, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[28]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[29] == 87, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[29], expected 87, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[29]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[30] == 90, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[30], expected 90, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[30]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[31] == 93, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[31], expected 93, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[31]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[32] == 96, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[32], expected 96, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[32]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[33] == 99, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[33], expected 99, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[33]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[34] == 102, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[34], expected 102, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[34]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[35] == 105, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[35], expected 105, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[35]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[36] == 108, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[36], expected 108, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[36]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[37] == 111, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[37], expected 111, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[37]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[38] == 114, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[38], expected 114, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[38]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[39] == 117, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[39], expected 117, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[39]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[40] == 120, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[40], expected 120, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[40]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[41] == 123, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[41], expected 123, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[41]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[42] == 126, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[42], expected 126, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[42]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[43] == 129, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[43], expected 129, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[43]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[44] == 132, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[44], expected 132, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[44]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[45] == 135, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[45], expected 135, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[45]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[46] == 138, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[46], expected 138, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[46]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[47] == 141, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[47], expected 141, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[47]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[48] == 144, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[48], expected 144, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[48]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[49] == 147, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[49], expected 147, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[49]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[50] == 150, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[50], expected 150, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[50]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[51] == 153, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[51], expected 153, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[51]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[52] == 156, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[52], expected 156, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[52]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[53] == 159, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[53], expected 159, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[53]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[54] == 162, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[54], expected 162, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[54]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[55] == 165, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[55], expected 165, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[55]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[56] == 168, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[56], expected 168, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[56]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[57] == 171, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[57], expected 171, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[57]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[58] == 174, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[58], expected 174, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[58]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[59] == 177, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[59], expected 177, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[59]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[60] == 180, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[60], expected 180, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[60]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[61] == 183, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[61], expected 183, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[61]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[62] == 186, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[62], expected 186, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[62]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[63] == 189, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[63], expected 189, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[63]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[64] == 192, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[64], expected 192, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[64]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[65] == 195, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[65], expected 195, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[65]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[66] == 198, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[66], expected 198, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[66]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[67] == 201, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[67], expected 201, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[67]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[68] == 204, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[68], expected 204, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[68]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[69] == 207, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[69], expected 207, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[69]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[70] == 210, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[70], expected 210, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[70]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[71] == 213, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[71], expected 213, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[71]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[72] == 216, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[72], expected 216, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[72]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[73] == 219, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[73], expected 219, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[73]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[74] == 222, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[74], expected 222, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[74]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[75] == 225, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[75], expected 225, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[75]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[76] == 228, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[76], expected 228, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[76]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[77] == 231, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[77], expected 231, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[77]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[78] == 234, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[78], expected 234, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[78]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[79] == 237, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[79], expected 237, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[79]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[80] == 240, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[80], expected 240, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[80]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[81] == 243, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[81], expected 243, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[81]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[82] == 246, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[82], expected 246, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[82]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[83] == 249, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[83], expected 249, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[83]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.certificate_bytes[84] == 252, "incorrect value for last_msg.msg.ed25519_certificate_dep.certificate_bytes[84], expected 252, is %d", last_msg.msg.ed25519_certificate_dep.certificate_bytes[84]); - - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[0] == 100, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[0], expected 100, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[0]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[1] == 101, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[1], expected 101, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[1]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[2] == 102, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[2], expected 102, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[2]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[3] == 103, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[3], expected 103, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[3]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[4] == 104, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[4], expected 104, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[4]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[5] == 105, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[5], expected 105, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[5]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[6] == 106, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[6], expected 106, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[6]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[7] == 107, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[7], expected 107, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[7]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[8] == 108, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[8], expected 108, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[8]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[9] == 109, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[9], expected 109, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[9]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[10] == 110, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[10], expected 110, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[10]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[11] == 111, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[11], expected 111, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[11]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[12] == 112, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[12], expected 112, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[12]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[13] == 113, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[13], expected 113, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[13]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[14] == 114, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[14], expected 114, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[14]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[15] == 115, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[15], expected 115, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[15]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[16] == 116, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[16], expected 116, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[16]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[17] == 117, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[17], expected 117, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[17]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[18] == 118, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[18], expected 118, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[18]); - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[19] == 119, "incorrect value for last_msg.msg.ed25519_certificate_dep.fingerprint[19], expected 119, is %d", last_msg.msg.ed25519_certificate_dep.fingerprint[19]); - - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.n_certificate_bytes == 85, "incorrect value for last_msg.msg.ed25519_certificate_dep.n_certificate_bytes, expected 85, is %d", last_msg.msg.ed25519_certificate_dep.n_certificate_bytes); - - ck_assert_msg(last_msg.msg.ed25519_certificate_dep.n_msg == 16, "incorrect value for last_msg.msg.ed25519_certificate_dep.n_msg, expected 16, is %d", last_msg.msg.ed25519_certificate_dep.n_msg); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgEd25519CertificateDep, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[0] == 0, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[0], expected " + "0, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[0]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[1] == 3, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[1], expected " + "3, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[1]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[2] == 6, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[2], expected " + "6, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[2]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[3] == 9, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[3], expected " + "9, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[3]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[4] == 12, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[4], expected " + "12, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[4]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[5] == 15, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[5], expected " + "15, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[5]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[6] == 18, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[6], expected " + "18, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[6]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[7] == 21, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[7], expected " + "21, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[7]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[8] == 24, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[8], expected " + "24, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[8]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[9] == 27, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[9], expected " + "27, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[9]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[10] == 30, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[10], expected " + "30, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[10]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[11] == 33, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[11], expected " + "33, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[11]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[12] == 36, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[12], expected " + "36, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[12]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[13] == 39, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[13], expected " + "39, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[13]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[14] == 42, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[14], expected " + "42, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[14]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[15] == 45, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[15], expected " + "45, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[15]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[16] == 48, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[16], expected " + "48, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[16]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[17] == 51, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[17], expected " + "51, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[17]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[18] == 54, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[18], expected " + "54, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[18]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[19] == 57, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[19], expected " + "57, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[19]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[20] == 60, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[20], expected " + "60, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[20]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[21] == 63, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[21], expected " + "63, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[21]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[22] == 66, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[22], expected " + "66, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[22]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[23] == 69, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[23], expected " + "69, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[23]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[24] == 72, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[24], expected " + "72, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[24]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[25] == 75, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[25], expected " + "75, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[25]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[26] == 78, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[26], expected " + "78, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[26]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[27] == 81, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[27], expected " + "81, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[27]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[28] == 84, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[28], expected " + "84, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[28]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[29] == 87, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[29], expected " + "87, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[29]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[30] == 90, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[30], expected " + "90, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[30]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[31] == 93, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[31], expected " + "93, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[31]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[32] == 96, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[32], expected " + "96, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[32]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[33] == 99, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[33], expected " + "99, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[33]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[34] == 102, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[34], expected " + "102, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[34]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[35] == 105, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[35], expected " + "105, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[35]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[36] == 108, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[36], expected " + "108, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[36]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[37] == 111, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[37], expected " + "111, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[37]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[38] == 114, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[38], expected " + "114, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[38]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[39] == 117, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[39], expected " + "117, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[39]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[40] == 120, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[40], expected " + "120, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[40]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[41] == 123, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[41], expected " + "123, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[41]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[42] == 126, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[42], expected " + "126, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[42]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[43] == 129, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[43], expected " + "129, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[43]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[44] == 132, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[44], expected " + "132, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[44]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[45] == 135, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[45], expected " + "135, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[45]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[46] == 138, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[46], expected " + "138, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[46]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[47] == 141, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[47], expected " + "141, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[47]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[48] == 144, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[48], expected " + "144, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[48]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[49] == 147, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[49], expected " + "147, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[49]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[50] == 150, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[50], expected " + "150, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[50]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[51] == 153, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[51], expected " + "153, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[51]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[52] == 156, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[52], expected " + "156, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[52]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[53] == 159, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[53], expected " + "159, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[53]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[54] == 162, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[54], expected " + "162, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[54]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[55] == 165, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[55], expected " + "165, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[55]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[56] == 168, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[56], expected " + "168, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[56]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[57] == 171, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[57], expected " + "171, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[57]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[58] == 174, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[58], expected " + "174, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[58]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[59] == 177, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[59], expected " + "177, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[59]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[60] == 180, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[60], expected " + "180, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[60]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[61] == 183, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[61], expected " + "183, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[61]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[62] == 186, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[62], expected " + "186, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[62]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[63] == 189, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[63], expected " + "189, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[63]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[64] == 192, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[64], expected " + "192, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[64]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[65] == 195, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[65], expected " + "195, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[65]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[66] == 198, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[66], expected " + "198, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[66]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[67] == 201, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[67], expected " + "201, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[67]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[68] == 204, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[68], expected " + "204, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[68]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[69] == 207, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[69], expected " + "207, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[69]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[70] == 210, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[70], expected " + "210, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[70]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[71] == 213, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[71], expected " + "213, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[71]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[72] == 216, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[72], expected " + "216, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[72]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[73] == 219, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[73], expected " + "219, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[73]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[74] == 222, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[74], expected " + "222, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[74]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[75] == 225, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[75], expected " + "225, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[75]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[76] == 228, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[76], expected " + "228, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[76]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[77] == 231, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[77], expected " + "231, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[77]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[78] == 234, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[78], expected " + "234, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[78]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[79] == 237, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[79], expected " + "237, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[79]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[80] == 240, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[80], expected " + "240, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[80]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[81] == 243, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[81], expected " + "243, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[81]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[82] == 246, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[82], expected " + "246, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[82]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[83] == 249, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[83], expected " + "249, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[83]); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.certificate_bytes[84] == 252, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.certificate_bytes[84], expected " + "252, is %d", + last_msg.msg.ed25519_certificate_dep.certificate_bytes[84]); + + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[0] == 100, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[0], " + "expected 100, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[0]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[1] == 101, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[1], " + "expected 101, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[1]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[2] == 102, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[2], " + "expected 102, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[2]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[3] == 103, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[3], " + "expected 103, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[3]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[4] == 104, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[4], " + "expected 104, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[4]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[5] == 105, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[5], " + "expected 105, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[5]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[6] == 106, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[6], " + "expected 106, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[6]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[7] == 107, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[7], " + "expected 107, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[7]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[8] == 108, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[8], " + "expected 108, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[8]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[9] == 109, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[9], " + "expected 109, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[9]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[10] == 110, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[10], " + "expected 110, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[10]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[11] == 111, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[11], " + "expected 111, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[11]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[12] == 112, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[12], " + "expected 112, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[12]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[13] == 113, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[13], " + "expected 113, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[13]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[14] == 114, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[14], " + "expected 114, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[14]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[15] == 115, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[15], " + "expected 115, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[15]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[16] == 116, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[16], " + "expected 116, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[16]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[17] == 117, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[17], " + "expected 117, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[17]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[18] == 118, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[18], " + "expected 118, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[18]); + ck_assert_msg(last_msg.msg.ed25519_certificate_dep.fingerprint[19] == 119, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.fingerprint[19], " + "expected 119, is %d", + last_msg.msg.ed25519_certificate_dep.fingerprint[19]); + + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.n_certificate_bytes == 85, + "incorrect value for " + "last_msg.msg.ed25519_certificate_dep.n_certificate_bytes, expected " + "85, is %d", + last_msg.msg.ed25519_certificate_dep.n_certificate_bytes); + ck_assert_msg( + last_msg.msg.ed25519_certificate_dep.n_msg == 16, + "incorrect value for last_msg.msg.ed25519_certificate_dep.n_msg, " + "expected 16, is %d", + last_msg.msg.ed25519_certificate_dep.n_msg); } } END_TEST -Suite* auto_check_sbp_signing_MsgEd25519CertificateDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_signing_MsgEd25519CertificateDep"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_signing_MsgEd25519CertificateDep"); +Suite *auto_check_sbp_signing_MsgEd25519CertificateDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_signing_MsgEd25519CertificateDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_signing_MsgEd25519CertificateDep"); tcase_add_test(tc_acq, test_auto_check_sbp_signing_MsgEd25519CertificateDep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_signing_MsgEd25519SignatureDepA.c b/c/test/auto_check_sbp_signing_MsgEd25519SignatureDepA.c index d336eb4db..1d8309932 100644 --- a/c/test/auto_check_sbp_signing_MsgEd25519SignatureDepA.c +++ b/c/test/auto_check_sbp_signing_MsgEd25519SignatureDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_signing_MsgEd25519SignatureDepA ) -{ +START_TEST(test_auto_check_sbp_signing_MsgEd25519SignatureDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_signing_MsgEd25519SignatureDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,380 +90,863 @@ START_TEST( test_auto_check_sbp_signing_MsgEd25519SignatureDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0xC01, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xC01, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,1,12,66,0,184,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,136,19,0,0,114,20,0,0,92,21,0,0,70,22,0,0,48,23,0,0,26,24,0,0,4,25,0,0,238,25,0,0,216,26,0,0,194,27,0,0,172,28,0,0,150,29,0,0,128,30,0,0,106,31,0,0,84,32,0,0,62,33,0,0,40,34,0,0,18,35,0,0,252,35,0,0,230,36,0,0,208,37,0,0,186,38,0,0,164,39,0,0,142,40,0,0,120,41,0,0,169,111, }; + u8 encoded_frame[] = { + 85, 1, 12, 66, 0, 184, 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 136, 19, 0, 0, 114, 20, 0, 0, + 92, 21, 0, 0, 70, 22, 0, 0, 48, 23, 0, 0, 26, 24, + 0, 0, 4, 25, 0, 0, 238, 25, 0, 0, 216, 26, 0, 0, + 194, 27, 0, 0, 172, 28, 0, 0, 150, 29, 0, 0, 128, 30, + 0, 0, 106, 31, 0, 0, 84, 32, 0, 0, 62, 33, 0, 0, + 40, 34, 0, 0, 18, 35, 0, 0, 252, 35, 0, 0, 230, 36, + 0, 0, 208, 37, 0, 0, 186, 38, 0, 0, 164, 39, 0, 0, + 142, 40, 0, 0, 120, 41, 0, 0, 169, 111, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ed25519_signature_dep_a.fingerprint[0] = 100; - + test_msg.ed25519_signature_dep_a.fingerprint[1] = 101; - + test_msg.ed25519_signature_dep_a.fingerprint[2] = 102; - + test_msg.ed25519_signature_dep_a.fingerprint[3] = 103; - + test_msg.ed25519_signature_dep_a.fingerprint[4] = 104; - + test_msg.ed25519_signature_dep_a.fingerprint[5] = 105; - + test_msg.ed25519_signature_dep_a.fingerprint[6] = 106; - + test_msg.ed25519_signature_dep_a.fingerprint[7] = 107; - + test_msg.ed25519_signature_dep_a.fingerprint[8] = 108; - + test_msg.ed25519_signature_dep_a.fingerprint[9] = 109; - + test_msg.ed25519_signature_dep_a.fingerprint[10] = 110; - + test_msg.ed25519_signature_dep_a.fingerprint[11] = 111; - + test_msg.ed25519_signature_dep_a.fingerprint[12] = 112; - + test_msg.ed25519_signature_dep_a.fingerprint[13] = 113; - + test_msg.ed25519_signature_dep_a.fingerprint[14] = 114; - + test_msg.ed25519_signature_dep_a.fingerprint[15] = 115; - + test_msg.ed25519_signature_dep_a.fingerprint[16] = 116; - + test_msg.ed25519_signature_dep_a.fingerprint[17] = 117; - + test_msg.ed25519_signature_dep_a.fingerprint[18] = 118; - + test_msg.ed25519_signature_dep_a.fingerprint[19] = 119; - + test_msg.ed25519_signature_dep_a.n_signed_messages = 25; - - + test_msg.ed25519_signature_dep_a.signature[0] = 0; - + test_msg.ed25519_signature_dep_a.signature[1] = 1; - + test_msg.ed25519_signature_dep_a.signature[2] = 2; - + test_msg.ed25519_signature_dep_a.signature[3] = 3; - + test_msg.ed25519_signature_dep_a.signature[4] = 4; - + test_msg.ed25519_signature_dep_a.signature[5] = 5; - + test_msg.ed25519_signature_dep_a.signature[6] = 6; - + test_msg.ed25519_signature_dep_a.signature[7] = 7; - + test_msg.ed25519_signature_dep_a.signature[8] = 8; - + test_msg.ed25519_signature_dep_a.signature[9] = 9; - + test_msg.ed25519_signature_dep_a.signature[10] = 10; - + test_msg.ed25519_signature_dep_a.signature[11] = 11; - + test_msg.ed25519_signature_dep_a.signature[12] = 12; - + test_msg.ed25519_signature_dep_a.signature[13] = 13; - + test_msg.ed25519_signature_dep_a.signature[14] = 14; - + test_msg.ed25519_signature_dep_a.signature[15] = 15; - + test_msg.ed25519_signature_dep_a.signature[16] = 16; - + test_msg.ed25519_signature_dep_a.signature[17] = 17; - + test_msg.ed25519_signature_dep_a.signature[18] = 18; - + test_msg.ed25519_signature_dep_a.signature[19] = 19; - + test_msg.ed25519_signature_dep_a.signature[20] = 20; - + test_msg.ed25519_signature_dep_a.signature[21] = 21; - + test_msg.ed25519_signature_dep_a.signature[22] = 22; - + test_msg.ed25519_signature_dep_a.signature[23] = 23; - + test_msg.ed25519_signature_dep_a.signature[24] = 24; - + test_msg.ed25519_signature_dep_a.signature[25] = 25; - + test_msg.ed25519_signature_dep_a.signature[26] = 26; - + test_msg.ed25519_signature_dep_a.signature[27] = 27; - + test_msg.ed25519_signature_dep_a.signature[28] = 28; - + test_msg.ed25519_signature_dep_a.signature[29] = 29; - + test_msg.ed25519_signature_dep_a.signature[30] = 30; - + test_msg.ed25519_signature_dep_a.signature[31] = 31; - + test_msg.ed25519_signature_dep_a.signature[32] = 32; - + test_msg.ed25519_signature_dep_a.signature[33] = 33; - + test_msg.ed25519_signature_dep_a.signature[34] = 34; - + test_msg.ed25519_signature_dep_a.signature[35] = 35; - + test_msg.ed25519_signature_dep_a.signature[36] = 36; - + test_msg.ed25519_signature_dep_a.signature[37] = 37; - + test_msg.ed25519_signature_dep_a.signature[38] = 38; - + test_msg.ed25519_signature_dep_a.signature[39] = 39; - + test_msg.ed25519_signature_dep_a.signature[40] = 40; - + test_msg.ed25519_signature_dep_a.signature[41] = 41; - + test_msg.ed25519_signature_dep_a.signature[42] = 42; - + test_msg.ed25519_signature_dep_a.signature[43] = 43; - + test_msg.ed25519_signature_dep_a.signature[44] = 44; - + test_msg.ed25519_signature_dep_a.signature[45] = 45; - + test_msg.ed25519_signature_dep_a.signature[46] = 46; - + test_msg.ed25519_signature_dep_a.signature[47] = 47; - + test_msg.ed25519_signature_dep_a.signature[48] = 48; - + test_msg.ed25519_signature_dep_a.signature[49] = 49; - + test_msg.ed25519_signature_dep_a.signature[50] = 50; - + test_msg.ed25519_signature_dep_a.signature[51] = 51; - + test_msg.ed25519_signature_dep_a.signature[52] = 52; - + test_msg.ed25519_signature_dep_a.signature[53] = 53; - + test_msg.ed25519_signature_dep_a.signature[54] = 54; - + test_msg.ed25519_signature_dep_a.signature[55] = 55; - + test_msg.ed25519_signature_dep_a.signature[56] = 56; - + test_msg.ed25519_signature_dep_a.signature[57] = 57; - + test_msg.ed25519_signature_dep_a.signature[58] = 58; - + test_msg.ed25519_signature_dep_a.signature[59] = 59; - + test_msg.ed25519_signature_dep_a.signature[60] = 60; - + test_msg.ed25519_signature_dep_a.signature[61] = 61; - + test_msg.ed25519_signature_dep_a.signature[62] = 62; - + test_msg.ed25519_signature_dep_a.signature[63] = 63; - - + test_msg.ed25519_signature_dep_a.signed_messages[0] = 5000; - + test_msg.ed25519_signature_dep_a.signed_messages[1] = 5234; - + test_msg.ed25519_signature_dep_a.signed_messages[2] = 5468; - + test_msg.ed25519_signature_dep_a.signed_messages[3] = 5702; - + test_msg.ed25519_signature_dep_a.signed_messages[4] = 5936; - + test_msg.ed25519_signature_dep_a.signed_messages[5] = 6170; - + test_msg.ed25519_signature_dep_a.signed_messages[6] = 6404; - + test_msg.ed25519_signature_dep_a.signed_messages[7] = 6638; - + test_msg.ed25519_signature_dep_a.signed_messages[8] = 6872; - + test_msg.ed25519_signature_dep_a.signed_messages[9] = 7106; - + test_msg.ed25519_signature_dep_a.signed_messages[10] = 7340; - + test_msg.ed25519_signature_dep_a.signed_messages[11] = 7574; - + test_msg.ed25519_signature_dep_a.signed_messages[12] = 7808; - + test_msg.ed25519_signature_dep_a.signed_messages[13] = 8042; - + test_msg.ed25519_signature_dep_a.signed_messages[14] = 8276; - + test_msg.ed25519_signature_dep_a.signed_messages[15] = 8510; - + test_msg.ed25519_signature_dep_a.signed_messages[16] = 8744; - + test_msg.ed25519_signature_dep_a.signed_messages[17] = 8978; - + test_msg.ed25519_signature_dep_a.signed_messages[18] = 9212; - + test_msg.ed25519_signature_dep_a.signed_messages[19] = 9446; - + test_msg.ed25519_signature_dep_a.signed_messages[20] = 9680; - + test_msg.ed25519_signature_dep_a.signed_messages[21] = 9914; - + test_msg.ed25519_signature_dep_a.signed_messages[22] = 10148; - + test_msg.ed25519_signature_dep_a.signed_messages[23] = 10382; - + test_msg.ed25519_signature_dep_a.signed_messages[24] = 10616; - sbp_message_send(&sbp_state, SbpMsgEd25519SignatureDepA, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEd25519SignatureDepA, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgEd25519SignatureDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[0] == 100, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[0], expected 100, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[0]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[1] == 101, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[1], expected 101, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[1]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[2] == 102, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[2], expected 102, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[2]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[3] == 103, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[3], expected 103, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[3]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[4] == 104, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[4], expected 104, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[4]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[5] == 105, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[5], expected 105, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[5]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[6] == 106, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[6], expected 106, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[6]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[7] == 107, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[7], expected 107, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[7]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[8] == 108, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[8], expected 108, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[8]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[9] == 109, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[9], expected 109, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[9]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[10] == 110, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[10], expected 110, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[10]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[11] == 111, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[11], expected 111, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[11]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[12] == 112, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[12], expected 112, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[12]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[13] == 113, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[13], expected 113, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[13]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[14] == 114, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[14], expected 114, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[14]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[15] == 115, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[15], expected 115, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[15]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[16] == 116, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[16], expected 116, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[16]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[17] == 117, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[17], expected 117, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[17]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[18] == 118, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[18], expected 118, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[18]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[19] == 119, "incorrect value for last_msg.msg.ed25519_signature_dep_a.fingerprint[19], expected 119, is %d", last_msg.msg.ed25519_signature_dep_a.fingerprint[19]); - - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.n_signed_messages == 25, "incorrect value for last_msg.msg.ed25519_signature_dep_a.n_signed_messages, expected 25, is %d", last_msg.msg.ed25519_signature_dep_a.n_signed_messages); - - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[0] == 0, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[0], expected 0, is %d", last_msg.msg.ed25519_signature_dep_a.signature[0]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[1] == 1, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[1], expected 1, is %d", last_msg.msg.ed25519_signature_dep_a.signature[1]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[2] == 2, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[2], expected 2, is %d", last_msg.msg.ed25519_signature_dep_a.signature[2]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[3] == 3, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[3], expected 3, is %d", last_msg.msg.ed25519_signature_dep_a.signature[3]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[4] == 4, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[4], expected 4, is %d", last_msg.msg.ed25519_signature_dep_a.signature[4]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[5] == 5, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[5], expected 5, is %d", last_msg.msg.ed25519_signature_dep_a.signature[5]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[6] == 6, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[6], expected 6, is %d", last_msg.msg.ed25519_signature_dep_a.signature[6]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[7] == 7, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[7], expected 7, is %d", last_msg.msg.ed25519_signature_dep_a.signature[7]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[8] == 8, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[8], expected 8, is %d", last_msg.msg.ed25519_signature_dep_a.signature[8]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[9] == 9, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[9], expected 9, is %d", last_msg.msg.ed25519_signature_dep_a.signature[9]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[10] == 10, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[10], expected 10, is %d", last_msg.msg.ed25519_signature_dep_a.signature[10]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[11] == 11, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[11], expected 11, is %d", last_msg.msg.ed25519_signature_dep_a.signature[11]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[12] == 12, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[12], expected 12, is %d", last_msg.msg.ed25519_signature_dep_a.signature[12]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[13] == 13, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[13], expected 13, is %d", last_msg.msg.ed25519_signature_dep_a.signature[13]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[14] == 14, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[14], expected 14, is %d", last_msg.msg.ed25519_signature_dep_a.signature[14]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[15] == 15, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[15], expected 15, is %d", last_msg.msg.ed25519_signature_dep_a.signature[15]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[16] == 16, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[16], expected 16, is %d", last_msg.msg.ed25519_signature_dep_a.signature[16]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[17] == 17, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[17], expected 17, is %d", last_msg.msg.ed25519_signature_dep_a.signature[17]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[18] == 18, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[18], expected 18, is %d", last_msg.msg.ed25519_signature_dep_a.signature[18]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[19] == 19, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[19], expected 19, is %d", last_msg.msg.ed25519_signature_dep_a.signature[19]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[20] == 20, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[20], expected 20, is %d", last_msg.msg.ed25519_signature_dep_a.signature[20]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[21] == 21, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[21], expected 21, is %d", last_msg.msg.ed25519_signature_dep_a.signature[21]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[22] == 22, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[22], expected 22, is %d", last_msg.msg.ed25519_signature_dep_a.signature[22]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[23] == 23, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[23], expected 23, is %d", last_msg.msg.ed25519_signature_dep_a.signature[23]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[24] == 24, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[24], expected 24, is %d", last_msg.msg.ed25519_signature_dep_a.signature[24]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[25] == 25, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[25], expected 25, is %d", last_msg.msg.ed25519_signature_dep_a.signature[25]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[26] == 26, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[26], expected 26, is %d", last_msg.msg.ed25519_signature_dep_a.signature[26]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[27] == 27, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[27], expected 27, is %d", last_msg.msg.ed25519_signature_dep_a.signature[27]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[28] == 28, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[28], expected 28, is %d", last_msg.msg.ed25519_signature_dep_a.signature[28]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[29] == 29, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[29], expected 29, is %d", last_msg.msg.ed25519_signature_dep_a.signature[29]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[30] == 30, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[30], expected 30, is %d", last_msg.msg.ed25519_signature_dep_a.signature[30]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[31] == 31, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[31], expected 31, is %d", last_msg.msg.ed25519_signature_dep_a.signature[31]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[32] == 32, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[32], expected 32, is %d", last_msg.msg.ed25519_signature_dep_a.signature[32]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[33] == 33, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[33], expected 33, is %d", last_msg.msg.ed25519_signature_dep_a.signature[33]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[34] == 34, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[34], expected 34, is %d", last_msg.msg.ed25519_signature_dep_a.signature[34]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[35] == 35, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[35], expected 35, is %d", last_msg.msg.ed25519_signature_dep_a.signature[35]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[36] == 36, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[36], expected 36, is %d", last_msg.msg.ed25519_signature_dep_a.signature[36]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[37] == 37, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[37], expected 37, is %d", last_msg.msg.ed25519_signature_dep_a.signature[37]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[38] == 38, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[38], expected 38, is %d", last_msg.msg.ed25519_signature_dep_a.signature[38]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[39] == 39, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[39], expected 39, is %d", last_msg.msg.ed25519_signature_dep_a.signature[39]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[40] == 40, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[40], expected 40, is %d", last_msg.msg.ed25519_signature_dep_a.signature[40]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[41] == 41, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[41], expected 41, is %d", last_msg.msg.ed25519_signature_dep_a.signature[41]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[42] == 42, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[42], expected 42, is %d", last_msg.msg.ed25519_signature_dep_a.signature[42]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[43] == 43, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[43], expected 43, is %d", last_msg.msg.ed25519_signature_dep_a.signature[43]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[44] == 44, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[44], expected 44, is %d", last_msg.msg.ed25519_signature_dep_a.signature[44]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[45] == 45, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[45], expected 45, is %d", last_msg.msg.ed25519_signature_dep_a.signature[45]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[46] == 46, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[46], expected 46, is %d", last_msg.msg.ed25519_signature_dep_a.signature[46]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[47] == 47, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[47], expected 47, is %d", last_msg.msg.ed25519_signature_dep_a.signature[47]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[48] == 48, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[48], expected 48, is %d", last_msg.msg.ed25519_signature_dep_a.signature[48]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[49] == 49, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[49], expected 49, is %d", last_msg.msg.ed25519_signature_dep_a.signature[49]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[50] == 50, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[50], expected 50, is %d", last_msg.msg.ed25519_signature_dep_a.signature[50]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[51] == 51, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[51], expected 51, is %d", last_msg.msg.ed25519_signature_dep_a.signature[51]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[52] == 52, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[52], expected 52, is %d", last_msg.msg.ed25519_signature_dep_a.signature[52]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[53] == 53, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[53], expected 53, is %d", last_msg.msg.ed25519_signature_dep_a.signature[53]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[54] == 54, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[54], expected 54, is %d", last_msg.msg.ed25519_signature_dep_a.signature[54]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[55] == 55, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[55], expected 55, is %d", last_msg.msg.ed25519_signature_dep_a.signature[55]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[56] == 56, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[56], expected 56, is %d", last_msg.msg.ed25519_signature_dep_a.signature[56]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[57] == 57, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[57], expected 57, is %d", last_msg.msg.ed25519_signature_dep_a.signature[57]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[58] == 58, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[58], expected 58, is %d", last_msg.msg.ed25519_signature_dep_a.signature[58]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[59] == 59, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[59], expected 59, is %d", last_msg.msg.ed25519_signature_dep_a.signature[59]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[60] == 60, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[60], expected 60, is %d", last_msg.msg.ed25519_signature_dep_a.signature[60]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[61] == 61, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[61], expected 61, is %d", last_msg.msg.ed25519_signature_dep_a.signature[61]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[62] == 62, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[62], expected 62, is %d", last_msg.msg.ed25519_signature_dep_a.signature[62]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[63] == 63, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signature[63], expected 63, is %d", last_msg.msg.ed25519_signature_dep_a.signature[63]); - - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[0] == 5000, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[0], expected 5000, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[0]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[1] == 5234, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[1], expected 5234, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[1]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[2] == 5468, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[2], expected 5468, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[2]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[3] == 5702, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[3], expected 5702, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[3]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[4] == 5936, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[4], expected 5936, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[4]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[5] == 6170, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[5], expected 6170, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[5]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[6] == 6404, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[6], expected 6404, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[6]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[7] == 6638, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[7], expected 6638, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[7]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[8] == 6872, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[8], expected 6872, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[8]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[9] == 7106, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[9], expected 7106, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[9]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[10] == 7340, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[10], expected 7340, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[10]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[11] == 7574, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[11], expected 7574, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[11]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[12] == 7808, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[12], expected 7808, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[12]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[13] == 8042, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[13], expected 8042, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[13]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[14] == 8276, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[14], expected 8276, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[14]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[15] == 8510, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[15], expected 8510, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[15]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[16] == 8744, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[16], expected 8744, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[16]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[17] == 8978, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[17], expected 8978, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[17]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[18] == 9212, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[18], expected 9212, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[18]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[19] == 9446, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[19], expected 9446, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[19]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[20] == 9680, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[20], expected 9680, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[20]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[21] == 9914, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[21], expected 9914, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[21]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[22] == 10148, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[22], expected 10148, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[22]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[23] == 10382, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[23], expected 10382, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[23]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signed_messages[24] == 10616, "incorrect value for last_msg.msg.ed25519_signature_dep_a.signed_messages[24], expected 10616, is %d", last_msg.msg.ed25519_signature_dep_a.signed_messages[24]); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgEd25519SignatureDepA, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[0] == 100, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[0], " + "expected 100, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[0]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[1] == 101, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[1], " + "expected 101, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[1]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[2] == 102, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[2], " + "expected 102, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[2]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[3] == 103, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[3], " + "expected 103, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[3]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[4] == 104, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[4], " + "expected 104, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[4]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[5] == 105, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[5], " + "expected 105, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[5]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[6] == 106, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[6], " + "expected 106, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[6]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[7] == 107, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[7], " + "expected 107, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[7]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[8] == 108, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[8], " + "expected 108, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[8]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[9] == 109, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[9], " + "expected 109, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[9]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[10] == 110, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[10], " + "expected 110, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[10]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[11] == 111, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[11], " + "expected 111, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[11]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[12] == 112, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[12], " + "expected 112, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[12]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[13] == 113, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[13], " + "expected 113, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[13]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[14] == 114, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[14], " + "expected 114, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[14]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[15] == 115, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[15], " + "expected 115, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[15]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[16] == 116, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[16], " + "expected 116, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[16]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[17] == 117, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[17], " + "expected 117, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[17]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[18] == 118, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[18], " + "expected 118, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[18]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.fingerprint[19] == 119, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.fingerprint[19], " + "expected 119, is %d", + last_msg.msg.ed25519_signature_dep_a.fingerprint[19]); + + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.n_signed_messages == 25, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.n_signed_messages, " + "expected 25, is %d", + last_msg.msg.ed25519_signature_dep_a.n_signed_messages); + + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signature[0] == 0, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[0], expected 0, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[0]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signature[1] == 1, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[1], expected 1, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[1]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signature[2] == 2, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[2], expected 2, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[2]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signature[3] == 3, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[3], expected 3, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[3]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signature[4] == 4, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[4], expected 4, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[4]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signature[5] == 5, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[5], expected 5, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[5]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signature[6] == 6, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[6], expected 6, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[6]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signature[7] == 7, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[7], expected 7, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[7]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signature[8] == 8, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[8], expected 8, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[8]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signature[9] == 9, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[9], expected 9, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[9]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[10] == 10, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[10], " + "expected 10, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[10]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[11] == 11, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[11], " + "expected 11, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[11]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[12] == 12, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[12], " + "expected 12, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[12]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[13] == 13, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[13], " + "expected 13, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[13]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[14] == 14, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[14], " + "expected 14, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[14]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[15] == 15, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[15], " + "expected 15, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[15]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[16] == 16, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[16], " + "expected 16, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[16]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[17] == 17, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[17], " + "expected 17, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[17]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[18] == 18, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[18], " + "expected 18, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[18]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[19] == 19, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[19], " + "expected 19, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[19]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[20] == 20, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[20], " + "expected 20, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[20]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[21] == 21, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[21], " + "expected 21, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[21]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[22] == 22, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[22], " + "expected 22, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[22]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[23] == 23, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[23], " + "expected 23, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[23]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[24] == 24, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[24], " + "expected 24, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[24]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[25] == 25, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[25], " + "expected 25, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[25]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[26] == 26, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[26], " + "expected 26, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[26]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[27] == 27, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[27], " + "expected 27, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[27]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[28] == 28, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[28], " + "expected 28, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[28]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[29] == 29, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[29], " + "expected 29, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[29]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[30] == 30, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[30], " + "expected 30, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[30]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[31] == 31, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[31], " + "expected 31, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[31]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[32] == 32, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[32], " + "expected 32, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[32]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[33] == 33, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[33], " + "expected 33, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[33]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[34] == 34, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[34], " + "expected 34, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[34]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[35] == 35, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[35], " + "expected 35, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[35]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[36] == 36, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[36], " + "expected 36, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[36]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[37] == 37, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[37], " + "expected 37, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[37]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[38] == 38, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[38], " + "expected 38, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[38]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[39] == 39, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[39], " + "expected 39, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[39]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[40] == 40, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[40], " + "expected 40, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[40]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[41] == 41, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[41], " + "expected 41, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[41]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[42] == 42, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[42], " + "expected 42, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[42]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[43] == 43, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[43], " + "expected 43, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[43]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[44] == 44, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[44], " + "expected 44, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[44]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[45] == 45, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[45], " + "expected 45, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[45]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[46] == 46, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[46], " + "expected 46, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[46]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[47] == 47, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[47], " + "expected 47, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[47]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[48] == 48, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[48], " + "expected 48, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[48]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[49] == 49, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[49], " + "expected 49, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[49]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[50] == 50, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[50], " + "expected 50, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[50]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[51] == 51, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[51], " + "expected 51, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[51]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[52] == 52, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[52], " + "expected 52, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[52]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[53] == 53, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[53], " + "expected 53, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[53]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[54] == 54, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[54], " + "expected 54, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[54]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[55] == 55, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[55], " + "expected 55, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[55]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[56] == 56, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[56], " + "expected 56, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[56]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[57] == 57, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[57], " + "expected 57, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[57]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[58] == 58, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[58], " + "expected 58, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[58]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[59] == 59, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[59], " + "expected 59, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[59]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[60] == 60, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[60], " + "expected 60, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[60]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[61] == 61, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[61], " + "expected 61, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[61]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[62] == 62, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[62], " + "expected 62, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[62]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_a.signature[63] == 63, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signature[63], " + "expected 63, is %d", + last_msg.msg.ed25519_signature_dep_a.signature[63]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[0] == 5000, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[0], expected " + "5000, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[0]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[1] == 5234, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[1], expected " + "5234, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[1]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[2] == 5468, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[2], expected " + "5468, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[2]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[3] == 5702, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[3], expected " + "5702, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[3]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[4] == 5936, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[4], expected " + "5936, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[4]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[5] == 6170, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[5], expected " + "6170, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[5]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[6] == 6404, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[6], expected " + "6404, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[6]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[7] == 6638, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[7], expected " + "6638, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[7]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[8] == 6872, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[8], expected " + "6872, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[8]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[9] == 7106, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[9], expected " + "7106, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[9]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[10] == 7340, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[10], expected " + "7340, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[10]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[11] == 7574, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[11], expected " + "7574, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[11]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[12] == 7808, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[12], expected " + "7808, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[12]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[13] == 8042, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[13], expected " + "8042, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[13]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[14] == 8276, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[14], expected " + "8276, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[14]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[15] == 8510, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[15], expected " + "8510, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[15]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[16] == 8744, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[16], expected " + "8744, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[16]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[17] == 8978, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[17], expected " + "8978, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[17]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[18] == 9212, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[18], expected " + "9212, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[18]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[19] == 9446, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[19], expected " + "9446, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[19]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[20] == 9680, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[20], expected " + "9680, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[20]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[21] == 9914, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[21], expected " + "9914, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[21]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[22] == 10148, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[22], expected " + "10148, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[22]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[23] == 10382, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[23], expected " + "10382, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[23]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_a.signed_messages[24] == 10616, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_a.signed_messages[24], expected " + "10616, is %d", + last_msg.msg.ed25519_signature_dep_a.signed_messages[24]); } } END_TEST -Suite* auto_check_sbp_signing_MsgEd25519SignatureDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_signing_MsgEd25519SignatureDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_signing_MsgEd25519SignatureDepA"); +Suite *auto_check_sbp_signing_MsgEd25519SignatureDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_signing_MsgEd25519SignatureDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_signing_MsgEd25519SignatureDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_signing_MsgEd25519SignatureDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_signing_MsgEd25519SignatureDepB.c b/c/test/auto_check_sbp_signing_MsgEd25519SignatureDepB.c index 64d188bf6..664c2bb4c 100644 --- a/c/test/auto_check_sbp_signing_MsgEd25519SignatureDepB.c +++ b/c/test/auto_check_sbp_signing_MsgEd25519SignatureDepB.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepB.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_signing_MsgEd25519SignatureDepB ) -{ +START_TEST(test_auto_check_sbp_signing_MsgEd25519SignatureDepB) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_signing_MsgEd25519SignatureDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,388 +90,879 @@ START_TEST( test_auto_check_sbp_signing_MsgEd25519SignatureDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0xC03, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xC03, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,12,66,0,186,1,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,136,19,0,0,114,20,0,0,92,21,0,0,70,22,0,0,48,23,0,0,26,24,0,0,4,25,0,0,238,25,0,0,216,26,0,0,194,27,0,0,172,28,0,0,150,29,0,0,128,30,0,0,106,31,0,0,84,32,0,0,62,33,0,0,40,34,0,0,18,35,0,0,252,35,0,0,230,36,0,0,208,37,0,0,186,38,0,0,164,39,0,0,142,40,0,0,120,41,0,0,238,145, }; + u8 encoded_frame[] = { + 85, 3, 12, 66, 0, 186, 1, 0, 0, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 136, 19, 0, 0, 114, 20, + 0, 0, 92, 21, 0, 0, 70, 22, 0, 0, 48, 23, 0, 0, + 26, 24, 0, 0, 4, 25, 0, 0, 238, 25, 0, 0, 216, 26, + 0, 0, 194, 27, 0, 0, 172, 28, 0, 0, 150, 29, 0, 0, + 128, 30, 0, 0, 106, 31, 0, 0, 84, 32, 0, 0, 62, 33, + 0, 0, 40, 34, 0, 0, 18, 35, 0, 0, 252, 35, 0, 0, + 230, 36, 0, 0, 208, 37, 0, 0, 186, 38, 0, 0, 164, 39, + 0, 0, 142, 40, 0, 0, 120, 41, 0, 0, 238, 145, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ed25519_signature_dep_b.fingerprint[0] = 100; - + test_msg.ed25519_signature_dep_b.fingerprint[1] = 101; - + test_msg.ed25519_signature_dep_b.fingerprint[2] = 102; - + test_msg.ed25519_signature_dep_b.fingerprint[3] = 103; - + test_msg.ed25519_signature_dep_b.fingerprint[4] = 104; - + test_msg.ed25519_signature_dep_b.fingerprint[5] = 105; - + test_msg.ed25519_signature_dep_b.fingerprint[6] = 106; - + test_msg.ed25519_signature_dep_b.fingerprint[7] = 107; - + test_msg.ed25519_signature_dep_b.fingerprint[8] = 108; - + test_msg.ed25519_signature_dep_b.fingerprint[9] = 109; - + test_msg.ed25519_signature_dep_b.fingerprint[10] = 110; - + test_msg.ed25519_signature_dep_b.fingerprint[11] = 111; - + test_msg.ed25519_signature_dep_b.fingerprint[12] = 112; - + test_msg.ed25519_signature_dep_b.fingerprint[13] = 113; - + test_msg.ed25519_signature_dep_b.fingerprint[14] = 114; - + test_msg.ed25519_signature_dep_b.fingerprint[15] = 115; - + test_msg.ed25519_signature_dep_b.fingerprint[16] = 116; - + test_msg.ed25519_signature_dep_b.fingerprint[17] = 117; - + test_msg.ed25519_signature_dep_b.fingerprint[18] = 118; - + test_msg.ed25519_signature_dep_b.fingerprint[19] = 119; - + test_msg.ed25519_signature_dep_b.n_signed_messages = 25; - + test_msg.ed25519_signature_dep_b.on_demand_counter = 0; - - + test_msg.ed25519_signature_dep_b.signature[0] = 0; - + test_msg.ed25519_signature_dep_b.signature[1] = 1; - + test_msg.ed25519_signature_dep_b.signature[2] = 2; - + test_msg.ed25519_signature_dep_b.signature[3] = 3; - + test_msg.ed25519_signature_dep_b.signature[4] = 4; - + test_msg.ed25519_signature_dep_b.signature[5] = 5; - + test_msg.ed25519_signature_dep_b.signature[6] = 6; - + test_msg.ed25519_signature_dep_b.signature[7] = 7; - + test_msg.ed25519_signature_dep_b.signature[8] = 8; - + test_msg.ed25519_signature_dep_b.signature[9] = 9; - + test_msg.ed25519_signature_dep_b.signature[10] = 10; - + test_msg.ed25519_signature_dep_b.signature[11] = 11; - + test_msg.ed25519_signature_dep_b.signature[12] = 12; - + test_msg.ed25519_signature_dep_b.signature[13] = 13; - + test_msg.ed25519_signature_dep_b.signature[14] = 14; - + test_msg.ed25519_signature_dep_b.signature[15] = 15; - + test_msg.ed25519_signature_dep_b.signature[16] = 16; - + test_msg.ed25519_signature_dep_b.signature[17] = 17; - + test_msg.ed25519_signature_dep_b.signature[18] = 18; - + test_msg.ed25519_signature_dep_b.signature[19] = 19; - + test_msg.ed25519_signature_dep_b.signature[20] = 20; - + test_msg.ed25519_signature_dep_b.signature[21] = 21; - + test_msg.ed25519_signature_dep_b.signature[22] = 22; - + test_msg.ed25519_signature_dep_b.signature[23] = 23; - + test_msg.ed25519_signature_dep_b.signature[24] = 24; - + test_msg.ed25519_signature_dep_b.signature[25] = 25; - + test_msg.ed25519_signature_dep_b.signature[26] = 26; - + test_msg.ed25519_signature_dep_b.signature[27] = 27; - + test_msg.ed25519_signature_dep_b.signature[28] = 28; - + test_msg.ed25519_signature_dep_b.signature[29] = 29; - + test_msg.ed25519_signature_dep_b.signature[30] = 30; - + test_msg.ed25519_signature_dep_b.signature[31] = 31; - + test_msg.ed25519_signature_dep_b.signature[32] = 32; - + test_msg.ed25519_signature_dep_b.signature[33] = 33; - + test_msg.ed25519_signature_dep_b.signature[34] = 34; - + test_msg.ed25519_signature_dep_b.signature[35] = 35; - + test_msg.ed25519_signature_dep_b.signature[36] = 36; - + test_msg.ed25519_signature_dep_b.signature[37] = 37; - + test_msg.ed25519_signature_dep_b.signature[38] = 38; - + test_msg.ed25519_signature_dep_b.signature[39] = 39; - + test_msg.ed25519_signature_dep_b.signature[40] = 40; - + test_msg.ed25519_signature_dep_b.signature[41] = 41; - + test_msg.ed25519_signature_dep_b.signature[42] = 42; - + test_msg.ed25519_signature_dep_b.signature[43] = 43; - + test_msg.ed25519_signature_dep_b.signature[44] = 44; - + test_msg.ed25519_signature_dep_b.signature[45] = 45; - + test_msg.ed25519_signature_dep_b.signature[46] = 46; - + test_msg.ed25519_signature_dep_b.signature[47] = 47; - + test_msg.ed25519_signature_dep_b.signature[48] = 48; - + test_msg.ed25519_signature_dep_b.signature[49] = 49; - + test_msg.ed25519_signature_dep_b.signature[50] = 50; - + test_msg.ed25519_signature_dep_b.signature[51] = 51; - + test_msg.ed25519_signature_dep_b.signature[52] = 52; - + test_msg.ed25519_signature_dep_b.signature[53] = 53; - + test_msg.ed25519_signature_dep_b.signature[54] = 54; - + test_msg.ed25519_signature_dep_b.signature[55] = 55; - + test_msg.ed25519_signature_dep_b.signature[56] = 56; - + test_msg.ed25519_signature_dep_b.signature[57] = 57; - + test_msg.ed25519_signature_dep_b.signature[58] = 58; - + test_msg.ed25519_signature_dep_b.signature[59] = 59; - + test_msg.ed25519_signature_dep_b.signature[60] = 60; - + test_msg.ed25519_signature_dep_b.signature[61] = 61; - + test_msg.ed25519_signature_dep_b.signature[62] = 62; - + test_msg.ed25519_signature_dep_b.signature[63] = 63; - - + test_msg.ed25519_signature_dep_b.signed_messages[0] = 5000; - + test_msg.ed25519_signature_dep_b.signed_messages[1] = 5234; - + test_msg.ed25519_signature_dep_b.signed_messages[2] = 5468; - + test_msg.ed25519_signature_dep_b.signed_messages[3] = 5702; - + test_msg.ed25519_signature_dep_b.signed_messages[4] = 5936; - + test_msg.ed25519_signature_dep_b.signed_messages[5] = 6170; - + test_msg.ed25519_signature_dep_b.signed_messages[6] = 6404; - + test_msg.ed25519_signature_dep_b.signed_messages[7] = 6638; - + test_msg.ed25519_signature_dep_b.signed_messages[8] = 6872; - + test_msg.ed25519_signature_dep_b.signed_messages[9] = 7106; - + test_msg.ed25519_signature_dep_b.signed_messages[10] = 7340; - + test_msg.ed25519_signature_dep_b.signed_messages[11] = 7574; - + test_msg.ed25519_signature_dep_b.signed_messages[12] = 7808; - + test_msg.ed25519_signature_dep_b.signed_messages[13] = 8042; - + test_msg.ed25519_signature_dep_b.signed_messages[14] = 8276; - + test_msg.ed25519_signature_dep_b.signed_messages[15] = 8510; - + test_msg.ed25519_signature_dep_b.signed_messages[16] = 8744; - + test_msg.ed25519_signature_dep_b.signed_messages[17] = 8978; - + test_msg.ed25519_signature_dep_b.signed_messages[18] = 9212; - + test_msg.ed25519_signature_dep_b.signed_messages[19] = 9446; - + test_msg.ed25519_signature_dep_b.signed_messages[20] = 9680; - + test_msg.ed25519_signature_dep_b.signed_messages[21] = 9914; - + test_msg.ed25519_signature_dep_b.signed_messages[22] = 10148; - + test_msg.ed25519_signature_dep_b.signed_messages[23] = 10382; - + test_msg.ed25519_signature_dep_b.signed_messages[24] = 10616; - + test_msg.ed25519_signature_dep_b.stream_counter = 1; - sbp_message_send(&sbp_state, SbpMsgEd25519SignatureDepB, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgEd25519SignatureDepB, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgEd25519SignatureDepB, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[0] == 100, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[0], expected 100, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[0]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[1] == 101, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[1], expected 101, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[1]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[2] == 102, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[2], expected 102, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[2]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[3] == 103, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[3], expected 103, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[3]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[4] == 104, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[4], expected 104, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[4]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[5] == 105, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[5], expected 105, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[5]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[6] == 106, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[6], expected 106, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[6]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[7] == 107, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[7], expected 107, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[7]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[8] == 108, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[8], expected 108, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[8]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[9] == 109, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[9], expected 109, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[9]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[10] == 110, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[10], expected 110, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[10]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[11] == 111, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[11], expected 111, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[11]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[12] == 112, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[12], expected 112, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[12]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[13] == 113, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[13], expected 113, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[13]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[14] == 114, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[14], expected 114, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[14]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[15] == 115, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[15], expected 115, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[15]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[16] == 116, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[16], expected 116, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[16]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[17] == 117, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[17], expected 117, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[17]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[18] == 118, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[18], expected 118, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[18]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[19] == 119, "incorrect value for last_msg.msg.ed25519_signature_dep_b.fingerprint[19], expected 119, is %d", last_msg.msg.ed25519_signature_dep_b.fingerprint[19]); - - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.n_signed_messages == 25, "incorrect value for last_msg.msg.ed25519_signature_dep_b.n_signed_messages, expected 25, is %d", last_msg.msg.ed25519_signature_dep_b.n_signed_messages); - - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.on_demand_counter == 0, "incorrect value for last_msg.msg.ed25519_signature_dep_b.on_demand_counter, expected 0, is %d", last_msg.msg.ed25519_signature_dep_b.on_demand_counter); - - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[0] == 0, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[0], expected 0, is %d", last_msg.msg.ed25519_signature_dep_b.signature[0]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[1] == 1, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[1], expected 1, is %d", last_msg.msg.ed25519_signature_dep_b.signature[1]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[2] == 2, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[2], expected 2, is %d", last_msg.msg.ed25519_signature_dep_b.signature[2]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[3] == 3, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[3], expected 3, is %d", last_msg.msg.ed25519_signature_dep_b.signature[3]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[4] == 4, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[4], expected 4, is %d", last_msg.msg.ed25519_signature_dep_b.signature[4]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[5] == 5, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[5], expected 5, is %d", last_msg.msg.ed25519_signature_dep_b.signature[5]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[6] == 6, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[6], expected 6, is %d", last_msg.msg.ed25519_signature_dep_b.signature[6]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[7] == 7, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[7], expected 7, is %d", last_msg.msg.ed25519_signature_dep_b.signature[7]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[8] == 8, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[8], expected 8, is %d", last_msg.msg.ed25519_signature_dep_b.signature[8]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[9] == 9, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[9], expected 9, is %d", last_msg.msg.ed25519_signature_dep_b.signature[9]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[10] == 10, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[10], expected 10, is %d", last_msg.msg.ed25519_signature_dep_b.signature[10]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[11] == 11, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[11], expected 11, is %d", last_msg.msg.ed25519_signature_dep_b.signature[11]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[12] == 12, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[12], expected 12, is %d", last_msg.msg.ed25519_signature_dep_b.signature[12]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[13] == 13, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[13], expected 13, is %d", last_msg.msg.ed25519_signature_dep_b.signature[13]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[14] == 14, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[14], expected 14, is %d", last_msg.msg.ed25519_signature_dep_b.signature[14]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[15] == 15, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[15], expected 15, is %d", last_msg.msg.ed25519_signature_dep_b.signature[15]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[16] == 16, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[16], expected 16, is %d", last_msg.msg.ed25519_signature_dep_b.signature[16]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[17] == 17, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[17], expected 17, is %d", last_msg.msg.ed25519_signature_dep_b.signature[17]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[18] == 18, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[18], expected 18, is %d", last_msg.msg.ed25519_signature_dep_b.signature[18]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[19] == 19, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[19], expected 19, is %d", last_msg.msg.ed25519_signature_dep_b.signature[19]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[20] == 20, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[20], expected 20, is %d", last_msg.msg.ed25519_signature_dep_b.signature[20]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[21] == 21, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[21], expected 21, is %d", last_msg.msg.ed25519_signature_dep_b.signature[21]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[22] == 22, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[22], expected 22, is %d", last_msg.msg.ed25519_signature_dep_b.signature[22]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[23] == 23, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[23], expected 23, is %d", last_msg.msg.ed25519_signature_dep_b.signature[23]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[24] == 24, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[24], expected 24, is %d", last_msg.msg.ed25519_signature_dep_b.signature[24]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[25] == 25, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[25], expected 25, is %d", last_msg.msg.ed25519_signature_dep_b.signature[25]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[26] == 26, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[26], expected 26, is %d", last_msg.msg.ed25519_signature_dep_b.signature[26]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[27] == 27, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[27], expected 27, is %d", last_msg.msg.ed25519_signature_dep_b.signature[27]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[28] == 28, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[28], expected 28, is %d", last_msg.msg.ed25519_signature_dep_b.signature[28]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[29] == 29, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[29], expected 29, is %d", last_msg.msg.ed25519_signature_dep_b.signature[29]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[30] == 30, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[30], expected 30, is %d", last_msg.msg.ed25519_signature_dep_b.signature[30]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[31] == 31, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[31], expected 31, is %d", last_msg.msg.ed25519_signature_dep_b.signature[31]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[32] == 32, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[32], expected 32, is %d", last_msg.msg.ed25519_signature_dep_b.signature[32]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[33] == 33, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[33], expected 33, is %d", last_msg.msg.ed25519_signature_dep_b.signature[33]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[34] == 34, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[34], expected 34, is %d", last_msg.msg.ed25519_signature_dep_b.signature[34]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[35] == 35, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[35], expected 35, is %d", last_msg.msg.ed25519_signature_dep_b.signature[35]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[36] == 36, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[36], expected 36, is %d", last_msg.msg.ed25519_signature_dep_b.signature[36]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[37] == 37, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[37], expected 37, is %d", last_msg.msg.ed25519_signature_dep_b.signature[37]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[38] == 38, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[38], expected 38, is %d", last_msg.msg.ed25519_signature_dep_b.signature[38]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[39] == 39, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[39], expected 39, is %d", last_msg.msg.ed25519_signature_dep_b.signature[39]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[40] == 40, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[40], expected 40, is %d", last_msg.msg.ed25519_signature_dep_b.signature[40]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[41] == 41, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[41], expected 41, is %d", last_msg.msg.ed25519_signature_dep_b.signature[41]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[42] == 42, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[42], expected 42, is %d", last_msg.msg.ed25519_signature_dep_b.signature[42]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[43] == 43, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[43], expected 43, is %d", last_msg.msg.ed25519_signature_dep_b.signature[43]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[44] == 44, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[44], expected 44, is %d", last_msg.msg.ed25519_signature_dep_b.signature[44]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[45] == 45, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[45], expected 45, is %d", last_msg.msg.ed25519_signature_dep_b.signature[45]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[46] == 46, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[46], expected 46, is %d", last_msg.msg.ed25519_signature_dep_b.signature[46]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[47] == 47, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[47], expected 47, is %d", last_msg.msg.ed25519_signature_dep_b.signature[47]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[48] == 48, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[48], expected 48, is %d", last_msg.msg.ed25519_signature_dep_b.signature[48]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[49] == 49, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[49], expected 49, is %d", last_msg.msg.ed25519_signature_dep_b.signature[49]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[50] == 50, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[50], expected 50, is %d", last_msg.msg.ed25519_signature_dep_b.signature[50]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[51] == 51, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[51], expected 51, is %d", last_msg.msg.ed25519_signature_dep_b.signature[51]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[52] == 52, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[52], expected 52, is %d", last_msg.msg.ed25519_signature_dep_b.signature[52]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[53] == 53, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[53], expected 53, is %d", last_msg.msg.ed25519_signature_dep_b.signature[53]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[54] == 54, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[54], expected 54, is %d", last_msg.msg.ed25519_signature_dep_b.signature[54]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[55] == 55, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[55], expected 55, is %d", last_msg.msg.ed25519_signature_dep_b.signature[55]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[56] == 56, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[56], expected 56, is %d", last_msg.msg.ed25519_signature_dep_b.signature[56]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[57] == 57, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[57], expected 57, is %d", last_msg.msg.ed25519_signature_dep_b.signature[57]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[58] == 58, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[58], expected 58, is %d", last_msg.msg.ed25519_signature_dep_b.signature[58]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[59] == 59, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[59], expected 59, is %d", last_msg.msg.ed25519_signature_dep_b.signature[59]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[60] == 60, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[60], expected 60, is %d", last_msg.msg.ed25519_signature_dep_b.signature[60]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[61] == 61, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[61], expected 61, is %d", last_msg.msg.ed25519_signature_dep_b.signature[61]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[62] == 62, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[62], expected 62, is %d", last_msg.msg.ed25519_signature_dep_b.signature[62]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[63] == 63, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signature[63], expected 63, is %d", last_msg.msg.ed25519_signature_dep_b.signature[63]); - - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[0] == 5000, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[0], expected 5000, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[0]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[1] == 5234, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[1], expected 5234, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[1]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[2] == 5468, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[2], expected 5468, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[2]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[3] == 5702, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[3], expected 5702, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[3]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[4] == 5936, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[4], expected 5936, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[4]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[5] == 6170, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[5], expected 6170, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[5]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[6] == 6404, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[6], expected 6404, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[6]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[7] == 6638, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[7], expected 6638, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[7]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[8] == 6872, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[8], expected 6872, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[8]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[9] == 7106, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[9], expected 7106, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[9]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[10] == 7340, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[10], expected 7340, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[10]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[11] == 7574, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[11], expected 7574, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[11]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[12] == 7808, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[12], expected 7808, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[12]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[13] == 8042, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[13], expected 8042, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[13]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[14] == 8276, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[14], expected 8276, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[14]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[15] == 8510, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[15], expected 8510, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[15]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[16] == 8744, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[16], expected 8744, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[16]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[17] == 8978, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[17], expected 8978, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[17]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[18] == 9212, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[18], expected 9212, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[18]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[19] == 9446, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[19], expected 9446, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[19]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[20] == 9680, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[20], expected 9680, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[20]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[21] == 9914, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[21], expected 9914, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[21]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[22] == 10148, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[22], expected 10148, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[22]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[23] == 10382, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[23], expected 10382, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[23]); - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signed_messages[24] == 10616, "incorrect value for last_msg.msg.ed25519_signature_dep_b.signed_messages[24], expected 10616, is %d", last_msg.msg.ed25519_signature_dep_b.signed_messages[24]); - - ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.stream_counter == 1, "incorrect value for last_msg.msg.ed25519_signature_dep_b.stream_counter, expected 1, is %d", last_msg.msg.ed25519_signature_dep_b.stream_counter); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgEd25519SignatureDepB, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[0] == 100, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[0], " + "expected 100, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[0]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[1] == 101, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[1], " + "expected 101, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[1]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[2] == 102, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[2], " + "expected 102, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[2]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[3] == 103, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[3], " + "expected 103, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[3]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[4] == 104, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[4], " + "expected 104, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[4]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[5] == 105, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[5], " + "expected 105, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[5]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[6] == 106, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[6], " + "expected 106, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[6]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[7] == 107, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[7], " + "expected 107, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[7]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[8] == 108, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[8], " + "expected 108, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[8]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[9] == 109, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[9], " + "expected 109, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[9]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[10] == 110, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[10], " + "expected 110, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[10]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[11] == 111, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[11], " + "expected 111, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[11]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[12] == 112, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[12], " + "expected 112, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[12]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[13] == 113, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[13], " + "expected 113, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[13]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[14] == 114, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[14], " + "expected 114, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[14]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[15] == 115, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[15], " + "expected 115, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[15]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[16] == 116, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[16], " + "expected 116, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[16]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[17] == 117, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[17], " + "expected 117, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[17]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[18] == 118, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[18], " + "expected 118, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[18]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.fingerprint[19] == 119, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.fingerprint[19], " + "expected 119, is %d", + last_msg.msg.ed25519_signature_dep_b.fingerprint[19]); + + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.n_signed_messages == 25, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.n_signed_messages, " + "expected 25, is %d", + last_msg.msg.ed25519_signature_dep_b.n_signed_messages); + + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.on_demand_counter == 0, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.on_demand_counter, " + "expected 0, is %d", + last_msg.msg.ed25519_signature_dep_b.on_demand_counter); + + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signature[0] == 0, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[0], expected 0, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[0]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signature[1] == 1, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[1], expected 1, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[1]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signature[2] == 2, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[2], expected 2, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[2]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signature[3] == 3, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[3], expected 3, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[3]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signature[4] == 4, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[4], expected 4, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[4]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signature[5] == 5, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[5], expected 5, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[5]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signature[6] == 6, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[6], expected 6, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[6]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signature[7] == 7, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[7], expected 7, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[7]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signature[8] == 8, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[8], expected 8, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[8]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signature[9] == 9, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[9], expected 9, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[9]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[10] == 10, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[10], " + "expected 10, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[10]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[11] == 11, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[11], " + "expected 11, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[11]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[12] == 12, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[12], " + "expected 12, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[12]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[13] == 13, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[13], " + "expected 13, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[13]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[14] == 14, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[14], " + "expected 14, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[14]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[15] == 15, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[15], " + "expected 15, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[15]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[16] == 16, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[16], " + "expected 16, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[16]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[17] == 17, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[17], " + "expected 17, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[17]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[18] == 18, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[18], " + "expected 18, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[18]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[19] == 19, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[19], " + "expected 19, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[19]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[20] == 20, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[20], " + "expected 20, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[20]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[21] == 21, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[21], " + "expected 21, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[21]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[22] == 22, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[22], " + "expected 22, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[22]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[23] == 23, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[23], " + "expected 23, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[23]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[24] == 24, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[24], " + "expected 24, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[24]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[25] == 25, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[25], " + "expected 25, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[25]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[26] == 26, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[26], " + "expected 26, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[26]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[27] == 27, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[27], " + "expected 27, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[27]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[28] == 28, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[28], " + "expected 28, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[28]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[29] == 29, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[29], " + "expected 29, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[29]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[30] == 30, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[30], " + "expected 30, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[30]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[31] == 31, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[31], " + "expected 31, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[31]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[32] == 32, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[32], " + "expected 32, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[32]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[33] == 33, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[33], " + "expected 33, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[33]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[34] == 34, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[34], " + "expected 34, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[34]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[35] == 35, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[35], " + "expected 35, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[35]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[36] == 36, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[36], " + "expected 36, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[36]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[37] == 37, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[37], " + "expected 37, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[37]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[38] == 38, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[38], " + "expected 38, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[38]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[39] == 39, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[39], " + "expected 39, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[39]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[40] == 40, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[40], " + "expected 40, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[40]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[41] == 41, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[41], " + "expected 41, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[41]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[42] == 42, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[42], " + "expected 42, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[42]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[43] == 43, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[43], " + "expected 43, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[43]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[44] == 44, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[44], " + "expected 44, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[44]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[45] == 45, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[45], " + "expected 45, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[45]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[46] == 46, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[46], " + "expected 46, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[46]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[47] == 47, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[47], " + "expected 47, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[47]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[48] == 48, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[48], " + "expected 48, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[48]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[49] == 49, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[49], " + "expected 49, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[49]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[50] == 50, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[50], " + "expected 50, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[50]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[51] == 51, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[51], " + "expected 51, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[51]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[52] == 52, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[52], " + "expected 52, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[52]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[53] == 53, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[53], " + "expected 53, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[53]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[54] == 54, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[54], " + "expected 54, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[54]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[55] == 55, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[55], " + "expected 55, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[55]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[56] == 56, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[56], " + "expected 56, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[56]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[57] == 57, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[57], " + "expected 57, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[57]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[58] == 58, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[58], " + "expected 58, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[58]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[59] == 59, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[59], " + "expected 59, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[59]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[60] == 60, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[60], " + "expected 60, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[60]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[61] == 61, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[61], " + "expected 61, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[61]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[62] == 62, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[62], " + "expected 62, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[62]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.signature[63] == 63, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signature[63], " + "expected 63, is %d", + last_msg.msg.ed25519_signature_dep_b.signature[63]); + + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[0] == 5000, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[0], expected " + "5000, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[0]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[1] == 5234, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[1], expected " + "5234, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[1]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[2] == 5468, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[2], expected " + "5468, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[2]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[3] == 5702, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[3], expected " + "5702, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[3]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[4] == 5936, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[4], expected " + "5936, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[4]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[5] == 6170, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[5], expected " + "6170, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[5]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[6] == 6404, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[6], expected " + "6404, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[6]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[7] == 6638, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[7], expected " + "6638, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[7]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[8] == 6872, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[8], expected " + "6872, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[8]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[9] == 7106, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[9], expected " + "7106, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[9]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[10] == 7340, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[10], expected " + "7340, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[10]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[11] == 7574, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[11], expected " + "7574, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[11]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[12] == 7808, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[12], expected " + "7808, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[12]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[13] == 8042, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[13], expected " + "8042, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[13]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[14] == 8276, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[14], expected " + "8276, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[14]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[15] == 8510, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[15], expected " + "8510, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[15]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[16] == 8744, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[16], expected " + "8744, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[16]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[17] == 8978, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[17], expected " + "8978, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[17]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[18] == 9212, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[18], expected " + "9212, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[18]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[19] == 9446, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[19], expected " + "9446, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[19]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[20] == 9680, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[20], expected " + "9680, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[20]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[21] == 9914, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[21], expected " + "9914, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[21]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[22] == 10148, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[22], expected " + "10148, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[22]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[23] == 10382, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[23], expected " + "10382, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[23]); + ck_assert_msg( + last_msg.msg.ed25519_signature_dep_b.signed_messages[24] == 10616, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.signed_messages[24], expected " + "10616, is %d", + last_msg.msg.ed25519_signature_dep_b.signed_messages[24]); + ck_assert_msg(last_msg.msg.ed25519_signature_dep_b.stream_counter == 1, + "incorrect value for " + "last_msg.msg.ed25519_signature_dep_b.stream_counter, " + "expected 1, is %d", + last_msg.msg.ed25519_signature_dep_b.stream_counter); } } END_TEST -Suite* auto_check_sbp_signing_MsgEd25519SignatureDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_signing_MsgEd25519SignatureDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_signing_MsgEd25519SignatureDepB"); +Suite *auto_check_sbp_signing_MsgEd25519SignatureDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_signing_MsgEd25519SignatureDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_signing_MsgEd25519SignatureDepB"); tcase_add_test(tc_acq, test_auto_check_sbp_signing_MsgEd25519SignatureDepB); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_solution_meta_MsgSolnMeta.c b/c/test/auto_check_sbp_solution_meta_MsgSolnMeta.c index ffe89a589..268512edb 100644 --- a/c/test/auto_check_sbp_solution_meta_MsgSolnMeta.c +++ b/c/test/auto_check_sbp_solution_meta_MsgSolnMeta.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMeta.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMeta.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_solution_meta_MsgSolnMeta ) -{ +START_TEST(test_auto_check_sbp_solution_meta_MsgSolnMeta) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_solution_meta_MsgSolnMeta ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,1144 +90,1978 @@ START_TEST( test_auto_check_sbp_solution_meta_MsgSolnMeta ) logging_reset(); - sbp_callback_register(&sbp_state, 0xff0e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xff0e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,14,255,0,60,254,48,208,65,216,122,45,196,160,144,228,8,83,89,87,3,213,95,109,86,131,71,70,84,73,131,26,82,247,140,97,115,110,118,253,2,122,186,148,122,148,180,231,68,46,190,102,243,48,192,15,208,89,56,10,245,2,254,201,120,32,126,2,83,161,238,123,102,230,76,190,225,182,207,228,7,218,117,89,29,191,56,248,185,255,46,18,72,142,82,113,26,4,172,254,178,136,113,115,58,193,89,227,182,246,76,77,108,245,41,31,70,124,249,145,15,78,228,38,241,129,8,176,251,72,248,80,115,244,231,145,191,190,178,168,89,233,69,176,174,140,182,141,81,82,92,79,101,223,100,64,184,215,124,37,21,227,135,102,72,36,219,56,146,90,219,104,227,102,83,12,41,122,173,94,1,174,134,130,104,237,116,249,107,230,130,123,25,162,57,223,193,174,146,193,239,44,246,197,214,80,83,100,66,72,133,137,140,82,2,2,96,9,96,158,134,97,43,129,141,25,183,200,214,57,248,103,222,65,195,15,244,21,180,46,140,130,36,17,194,209,65,254,115,103,152,129,234,235,194,234,170,201,210,154,150,247, }; + u8 encoded_frame[] = { + 85, 14, 255, 0, 60, 254, 48, 208, 65, 216, 122, 45, 196, 160, + 144, 228, 8, 83, 89, 87, 3, 213, 95, 109, 86, 131, 71, 70, + 84, 73, 131, 26, 82, 247, 140, 97, 115, 110, 118, 253, 2, 122, + 186, 148, 122, 148, 180, 231, 68, 46, 190, 102, 243, 48, 192, 15, + 208, 89, 56, 10, 245, 2, 254, 201, 120, 32, 126, 2, 83, 161, + 238, 123, 102, 230, 76, 190, 225, 182, 207, 228, 7, 218, 117, 89, + 29, 191, 56, 248, 185, 255, 46, 18, 72, 142, 82, 113, 26, 4, + 172, 254, 178, 136, 113, 115, 58, 193, 89, 227, 182, 246, 76, 77, + 108, 245, 41, 31, 70, 124, 249, 145, 15, 78, 228, 38, 241, 129, + 8, 176, 251, 72, 248, 80, 115, 244, 231, 145, 191, 190, 178, 168, + 89, 233, 69, 176, 174, 140, 182, 141, 81, 82, 92, 79, 101, 223, + 100, 64, 184, 215, 124, 37, 21, 227, 135, 102, 72, 36, 219, 56, + 146, 90, 219, 104, 227, 102, 83, 12, 41, 122, 173, 94, 1, 174, + 134, 130, 104, 237, 116, 249, 107, 230, 130, 123, 25, 162, 57, 223, + 193, 174, 146, 193, 239, 44, 246, 197, 214, 80, 83, 100, 66, 72, + 133, 137, 140, 82, 2, 2, 96, 9, 96, 158, 134, 97, 43, 129, + 141, 25, 183, 200, 214, 57, 248, 103, 222, 65, 195, 15, 244, 21, + 180, 46, 140, 130, 36, 17, 194, 209, 65, 254, 115, 103, 152, 129, + 234, 235, 194, 234, 170, 201, 210, 154, 150, 247, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.soln_meta.age_corrections = 21256; - + test_msg.soln_meta.age_gnss = 3573765977; - + test_msg.soln_meta.hdop = 41156; - + test_msg.soln_meta.n_sol_in = 119; - + test_msg.soln_meta.pdop = 11642; - - - + test_msg.soln_meta.sol_in[0].flags = 109; - + test_msg.soln_meta.sol_in[0].sensor_type = 95; - - + test_msg.soln_meta.sol_in[1].flags = 131; - + test_msg.soln_meta.sol_in[1].sensor_type = 86; - - + test_msg.soln_meta.sol_in[2].flags = 70; - + test_msg.soln_meta.sol_in[2].sensor_type = 71; - - + test_msg.soln_meta.sol_in[3].flags = 73; - + test_msg.soln_meta.sol_in[3].sensor_type = 84; - - + test_msg.soln_meta.sol_in[4].flags = 26; - + test_msg.soln_meta.sol_in[4].sensor_type = 131; - - + test_msg.soln_meta.sol_in[5].flags = 247; - + test_msg.soln_meta.sol_in[5].sensor_type = 82; - - + test_msg.soln_meta.sol_in[6].flags = 97; - + test_msg.soln_meta.sol_in[6].sensor_type = 140; - - + test_msg.soln_meta.sol_in[7].flags = 110; - + test_msg.soln_meta.sol_in[7].sensor_type = 115; - - + test_msg.soln_meta.sol_in[8].flags = 253; - + test_msg.soln_meta.sol_in[8].sensor_type = 118; - - + test_msg.soln_meta.sol_in[9].flags = 122; - + test_msg.soln_meta.sol_in[9].sensor_type = 2; - - + test_msg.soln_meta.sol_in[10].flags = 148; - + test_msg.soln_meta.sol_in[10].sensor_type = 186; - - + test_msg.soln_meta.sol_in[11].flags = 148; - + test_msg.soln_meta.sol_in[11].sensor_type = 122; - - + test_msg.soln_meta.sol_in[12].flags = 231; - + test_msg.soln_meta.sol_in[12].sensor_type = 180; - - + test_msg.soln_meta.sol_in[13].flags = 46; - + test_msg.soln_meta.sol_in[13].sensor_type = 68; - - + test_msg.soln_meta.sol_in[14].flags = 102; - + test_msg.soln_meta.sol_in[14].sensor_type = 190; - - + test_msg.soln_meta.sol_in[15].flags = 48; - + test_msg.soln_meta.sol_in[15].sensor_type = 243; - - + test_msg.soln_meta.sol_in[16].flags = 15; - + test_msg.soln_meta.sol_in[16].sensor_type = 192; - - + test_msg.soln_meta.sol_in[17].flags = 89; - + test_msg.soln_meta.sol_in[17].sensor_type = 208; - - + test_msg.soln_meta.sol_in[18].flags = 10; - + test_msg.soln_meta.sol_in[18].sensor_type = 56; - - + test_msg.soln_meta.sol_in[19].flags = 2; - + test_msg.soln_meta.sol_in[19].sensor_type = 245; - - + test_msg.soln_meta.sol_in[20].flags = 201; - + test_msg.soln_meta.sol_in[20].sensor_type = 254; - - + test_msg.soln_meta.sol_in[21].flags = 32; - + test_msg.soln_meta.sol_in[21].sensor_type = 120; - - + test_msg.soln_meta.sol_in[22].flags = 2; - + test_msg.soln_meta.sol_in[22].sensor_type = 126; - - + test_msg.soln_meta.sol_in[23].flags = 161; - + test_msg.soln_meta.sol_in[23].sensor_type = 83; - - + test_msg.soln_meta.sol_in[24].flags = 123; - + test_msg.soln_meta.sol_in[24].sensor_type = 238; - - + test_msg.soln_meta.sol_in[25].flags = 230; - + test_msg.soln_meta.sol_in[25].sensor_type = 102; - - + test_msg.soln_meta.sol_in[26].flags = 190; - + test_msg.soln_meta.sol_in[26].sensor_type = 76; - - + test_msg.soln_meta.sol_in[27].flags = 182; - + test_msg.soln_meta.sol_in[27].sensor_type = 225; - - + test_msg.soln_meta.sol_in[28].flags = 228; - + test_msg.soln_meta.sol_in[28].sensor_type = 207; - - + test_msg.soln_meta.sol_in[29].flags = 218; - + test_msg.soln_meta.sol_in[29].sensor_type = 7; - - + test_msg.soln_meta.sol_in[30].flags = 89; - + test_msg.soln_meta.sol_in[30].sensor_type = 117; - - + test_msg.soln_meta.sol_in[31].flags = 191; - + test_msg.soln_meta.sol_in[31].sensor_type = 29; - - + test_msg.soln_meta.sol_in[32].flags = 248; - + test_msg.soln_meta.sol_in[32].sensor_type = 56; - - + test_msg.soln_meta.sol_in[33].flags = 255; - + test_msg.soln_meta.sol_in[33].sensor_type = 185; - - + test_msg.soln_meta.sol_in[34].flags = 18; - + test_msg.soln_meta.sol_in[34].sensor_type = 46; - - + test_msg.soln_meta.sol_in[35].flags = 142; - + test_msg.soln_meta.sol_in[35].sensor_type = 72; - - + test_msg.soln_meta.sol_in[36].flags = 113; - + test_msg.soln_meta.sol_in[36].sensor_type = 82; - - + test_msg.soln_meta.sol_in[37].flags = 4; - + test_msg.soln_meta.sol_in[37].sensor_type = 26; - - + test_msg.soln_meta.sol_in[38].flags = 254; - + test_msg.soln_meta.sol_in[38].sensor_type = 172; - - + test_msg.soln_meta.sol_in[39].flags = 136; - + test_msg.soln_meta.sol_in[39].sensor_type = 178; - - + test_msg.soln_meta.sol_in[40].flags = 115; - + test_msg.soln_meta.sol_in[40].sensor_type = 113; - - + test_msg.soln_meta.sol_in[41].flags = 193; - + test_msg.soln_meta.sol_in[41].sensor_type = 58; - - + test_msg.soln_meta.sol_in[42].flags = 227; - + test_msg.soln_meta.sol_in[42].sensor_type = 89; - - + test_msg.soln_meta.sol_in[43].flags = 246; - + test_msg.soln_meta.sol_in[43].sensor_type = 182; - - + test_msg.soln_meta.sol_in[44].flags = 77; - + test_msg.soln_meta.sol_in[44].sensor_type = 76; - - + test_msg.soln_meta.sol_in[45].flags = 245; - + test_msg.soln_meta.sol_in[45].sensor_type = 108; - - + test_msg.soln_meta.sol_in[46].flags = 31; - + test_msg.soln_meta.sol_in[46].sensor_type = 41; - - + test_msg.soln_meta.sol_in[47].flags = 124; - + test_msg.soln_meta.sol_in[47].sensor_type = 70; - - + test_msg.soln_meta.sol_in[48].flags = 145; - + test_msg.soln_meta.sol_in[48].sensor_type = 249; - - + test_msg.soln_meta.sol_in[49].flags = 78; - + test_msg.soln_meta.sol_in[49].sensor_type = 15; - - + test_msg.soln_meta.sol_in[50].flags = 38; - + test_msg.soln_meta.sol_in[50].sensor_type = 228; - - + test_msg.soln_meta.sol_in[51].flags = 129; - + test_msg.soln_meta.sol_in[51].sensor_type = 241; - - + test_msg.soln_meta.sol_in[52].flags = 176; - + test_msg.soln_meta.sol_in[52].sensor_type = 8; - - + test_msg.soln_meta.sol_in[53].flags = 72; - + test_msg.soln_meta.sol_in[53].sensor_type = 251; - - + test_msg.soln_meta.sol_in[54].flags = 80; - + test_msg.soln_meta.sol_in[54].sensor_type = 248; - - + test_msg.soln_meta.sol_in[55].flags = 244; - + test_msg.soln_meta.sol_in[55].sensor_type = 115; - - + test_msg.soln_meta.sol_in[56].flags = 145; - + test_msg.soln_meta.sol_in[56].sensor_type = 231; - - + test_msg.soln_meta.sol_in[57].flags = 190; - + test_msg.soln_meta.sol_in[57].sensor_type = 191; - - + test_msg.soln_meta.sol_in[58].flags = 168; - + test_msg.soln_meta.sol_in[58].sensor_type = 178; - - + test_msg.soln_meta.sol_in[59].flags = 233; - + test_msg.soln_meta.sol_in[59].sensor_type = 89; - - + test_msg.soln_meta.sol_in[60].flags = 176; - + test_msg.soln_meta.sol_in[60].sensor_type = 69; - - + test_msg.soln_meta.sol_in[61].flags = 140; - + test_msg.soln_meta.sol_in[61].sensor_type = 174; - - + test_msg.soln_meta.sol_in[62].flags = 141; - + test_msg.soln_meta.sol_in[62].sensor_type = 182; - - + test_msg.soln_meta.sol_in[63].flags = 82; - + test_msg.soln_meta.sol_in[63].sensor_type = 81; - - + test_msg.soln_meta.sol_in[64].flags = 79; - + test_msg.soln_meta.sol_in[64].sensor_type = 92; - - + test_msg.soln_meta.sol_in[65].flags = 223; - + test_msg.soln_meta.sol_in[65].sensor_type = 101; - - + test_msg.soln_meta.sol_in[66].flags = 64; - + test_msg.soln_meta.sol_in[66].sensor_type = 100; - - + test_msg.soln_meta.sol_in[67].flags = 215; - + test_msg.soln_meta.sol_in[67].sensor_type = 184; - - + test_msg.soln_meta.sol_in[68].flags = 37; - + test_msg.soln_meta.sol_in[68].sensor_type = 124; - - + test_msg.soln_meta.sol_in[69].flags = 227; - + test_msg.soln_meta.sol_in[69].sensor_type = 21; - - + test_msg.soln_meta.sol_in[70].flags = 102; - + test_msg.soln_meta.sol_in[70].sensor_type = 135; - - + test_msg.soln_meta.sol_in[71].flags = 36; - + test_msg.soln_meta.sol_in[71].sensor_type = 72; - - + test_msg.soln_meta.sol_in[72].flags = 56; - + test_msg.soln_meta.sol_in[72].sensor_type = 219; - - + test_msg.soln_meta.sol_in[73].flags = 90; - + test_msg.soln_meta.sol_in[73].sensor_type = 146; - - + test_msg.soln_meta.sol_in[74].flags = 104; - + test_msg.soln_meta.sol_in[74].sensor_type = 219; - - + test_msg.soln_meta.sol_in[75].flags = 102; - + test_msg.soln_meta.sol_in[75].sensor_type = 227; - - + test_msg.soln_meta.sol_in[76].flags = 12; - + test_msg.soln_meta.sol_in[76].sensor_type = 83; - - + test_msg.soln_meta.sol_in[77].flags = 122; - + test_msg.soln_meta.sol_in[77].sensor_type = 41; - - + test_msg.soln_meta.sol_in[78].flags = 94; - + test_msg.soln_meta.sol_in[78].sensor_type = 173; - - + test_msg.soln_meta.sol_in[79].flags = 174; - + test_msg.soln_meta.sol_in[79].sensor_type = 1; - - + test_msg.soln_meta.sol_in[80].flags = 130; - + test_msg.soln_meta.sol_in[80].sensor_type = 134; - - + test_msg.soln_meta.sol_in[81].flags = 237; - + test_msg.soln_meta.sol_in[81].sensor_type = 104; - - + test_msg.soln_meta.sol_in[82].flags = 249; - + test_msg.soln_meta.sol_in[82].sensor_type = 116; - - + test_msg.soln_meta.sol_in[83].flags = 230; - + test_msg.soln_meta.sol_in[83].sensor_type = 107; - - + test_msg.soln_meta.sol_in[84].flags = 123; - + test_msg.soln_meta.sol_in[84].sensor_type = 130; - - + test_msg.soln_meta.sol_in[85].flags = 162; - + test_msg.soln_meta.sol_in[85].sensor_type = 25; - - + test_msg.soln_meta.sol_in[86].flags = 223; - + test_msg.soln_meta.sol_in[86].sensor_type = 57; - - + test_msg.soln_meta.sol_in[87].flags = 174; - + test_msg.soln_meta.sol_in[87].sensor_type = 193; - - + test_msg.soln_meta.sol_in[88].flags = 193; - + test_msg.soln_meta.sol_in[88].sensor_type = 146; - - + test_msg.soln_meta.sol_in[89].flags = 44; - + test_msg.soln_meta.sol_in[89].sensor_type = 239; - - + test_msg.soln_meta.sol_in[90].flags = 197; - + test_msg.soln_meta.sol_in[90].sensor_type = 246; - - + test_msg.soln_meta.sol_in[91].flags = 80; - + test_msg.soln_meta.sol_in[91].sensor_type = 214; - - + test_msg.soln_meta.sol_in[92].flags = 100; - + test_msg.soln_meta.sol_in[92].sensor_type = 83; - - + test_msg.soln_meta.sol_in[93].flags = 72; - + test_msg.soln_meta.sol_in[93].sensor_type = 66; - - + test_msg.soln_meta.sol_in[94].flags = 137; - + test_msg.soln_meta.sol_in[94].sensor_type = 133; - - + test_msg.soln_meta.sol_in[95].flags = 82; - + test_msg.soln_meta.sol_in[95].sensor_type = 140; - - + test_msg.soln_meta.sol_in[96].flags = 2; - + test_msg.soln_meta.sol_in[96].sensor_type = 2; - - + test_msg.soln_meta.sol_in[97].flags = 9; - + test_msg.soln_meta.sol_in[97].sensor_type = 96; - - + test_msg.soln_meta.sol_in[98].flags = 158; - + test_msg.soln_meta.sol_in[98].sensor_type = 96; - - + test_msg.soln_meta.sol_in[99].flags = 97; - + test_msg.soln_meta.sol_in[99].sensor_type = 134; - - + test_msg.soln_meta.sol_in[100].flags = 129; - + test_msg.soln_meta.sol_in[100].sensor_type = 43; - - + test_msg.soln_meta.sol_in[101].flags = 25; - + test_msg.soln_meta.sol_in[101].sensor_type = 141; - - + test_msg.soln_meta.sol_in[102].flags = 200; - + test_msg.soln_meta.sol_in[102].sensor_type = 183; - - + test_msg.soln_meta.sol_in[103].flags = 57; - + test_msg.soln_meta.sol_in[103].sensor_type = 214; - - + test_msg.soln_meta.sol_in[104].flags = 103; - + test_msg.soln_meta.sol_in[104].sensor_type = 248; - - + test_msg.soln_meta.sol_in[105].flags = 65; - + test_msg.soln_meta.sol_in[105].sensor_type = 222; - - + test_msg.soln_meta.sol_in[106].flags = 15; - + test_msg.soln_meta.sol_in[106].sensor_type = 195; - - + test_msg.soln_meta.sol_in[107].flags = 21; - + test_msg.soln_meta.sol_in[107].sensor_type = 244; - - + test_msg.soln_meta.sol_in[108].flags = 46; - + test_msg.soln_meta.sol_in[108].sensor_type = 180; - - + test_msg.soln_meta.sol_in[109].flags = 130; - + test_msg.soln_meta.sol_in[109].sensor_type = 140; - - + test_msg.soln_meta.sol_in[110].flags = 17; - + test_msg.soln_meta.sol_in[110].sensor_type = 36; - - + test_msg.soln_meta.sol_in[111].flags = 209; - + test_msg.soln_meta.sol_in[111].sensor_type = 194; - - + test_msg.soln_meta.sol_in[112].flags = 254; - + test_msg.soln_meta.sol_in[112].sensor_type = 65; - - + test_msg.soln_meta.sol_in[113].flags = 103; - + test_msg.soln_meta.sol_in[113].sensor_type = 115; - - + test_msg.soln_meta.sol_in[114].flags = 129; - + test_msg.soln_meta.sol_in[114].sensor_type = 152; - - + test_msg.soln_meta.sol_in[115].flags = 235; - + test_msg.soln_meta.sol_in[115].sensor_type = 234; - - + test_msg.soln_meta.sol_in[116].flags = 234; - + test_msg.soln_meta.sol_in[116].sensor_type = 194; - - + test_msg.soln_meta.sol_in[117].flags = 201; - + test_msg.soln_meta.sol_in[117].sensor_type = 170; - - + test_msg.soln_meta.sol_in[118].flags = 154; - + test_msg.soln_meta.sol_in[118].sensor_type = 210; - + test_msg.soln_meta.tow = 3628191792; - + test_msg.soln_meta.vdop = 58512; - sbp_message_send(&sbp_state, SbpMsgSolnMeta, 15360, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSolnMeta, 15360, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 15360, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSolnMeta, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSolnMeta, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.soln_meta.age_corrections == 21256, "incorrect value for last_msg.msg.soln_meta.age_corrections, expected 21256, is %d", last_msg.msg.soln_meta.age_corrections); - - ck_assert_msg(last_msg.msg.soln_meta.age_gnss == 3573765977, "incorrect value for last_msg.msg.soln_meta.age_gnss, expected 3573765977, is %d", last_msg.msg.soln_meta.age_gnss); - - ck_assert_msg(last_msg.msg.soln_meta.hdop == 41156, "incorrect value for last_msg.msg.soln_meta.hdop, expected 41156, is %d", last_msg.msg.soln_meta.hdop); - - ck_assert_msg(last_msg.msg.soln_meta.n_sol_in == 119, "incorrect value for last_msg.msg.soln_meta.n_sol_in, expected 119, is %d", last_msg.msg.soln_meta.n_sol_in); - - ck_assert_msg(last_msg.msg.soln_meta.pdop == 11642, "incorrect value for last_msg.msg.soln_meta.pdop, expected 11642, is %d", last_msg.msg.soln_meta.pdop); - - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[0].flags == 109, "incorrect value for last_msg.msg.soln_meta.sol_in[0].flags, expected 109, is %d", last_msg.msg.soln_meta.sol_in[0].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[0].sensor_type == 95, "incorrect value for last_msg.msg.soln_meta.sol_in[0].sensor_type, expected 95, is %d", last_msg.msg.soln_meta.sol_in[0].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[1].flags == 131, "incorrect value for last_msg.msg.soln_meta.sol_in[1].flags, expected 131, is %d", last_msg.msg.soln_meta.sol_in[1].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[1].sensor_type == 86, "incorrect value for last_msg.msg.soln_meta.sol_in[1].sensor_type, expected 86, is %d", last_msg.msg.soln_meta.sol_in[1].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[2].flags == 70, "incorrect value for last_msg.msg.soln_meta.sol_in[2].flags, expected 70, is %d", last_msg.msg.soln_meta.sol_in[2].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[2].sensor_type == 71, "incorrect value for last_msg.msg.soln_meta.sol_in[2].sensor_type, expected 71, is %d", last_msg.msg.soln_meta.sol_in[2].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[3].flags == 73, "incorrect value for last_msg.msg.soln_meta.sol_in[3].flags, expected 73, is %d", last_msg.msg.soln_meta.sol_in[3].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[3].sensor_type == 84, "incorrect value for last_msg.msg.soln_meta.sol_in[3].sensor_type, expected 84, is %d", last_msg.msg.soln_meta.sol_in[3].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[4].flags == 26, "incorrect value for last_msg.msg.soln_meta.sol_in[4].flags, expected 26, is %d", last_msg.msg.soln_meta.sol_in[4].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[4].sensor_type == 131, "incorrect value for last_msg.msg.soln_meta.sol_in[4].sensor_type, expected 131, is %d", last_msg.msg.soln_meta.sol_in[4].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[5].flags == 247, "incorrect value for last_msg.msg.soln_meta.sol_in[5].flags, expected 247, is %d", last_msg.msg.soln_meta.sol_in[5].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[5].sensor_type == 82, "incorrect value for last_msg.msg.soln_meta.sol_in[5].sensor_type, expected 82, is %d", last_msg.msg.soln_meta.sol_in[5].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[6].flags == 97, "incorrect value for last_msg.msg.soln_meta.sol_in[6].flags, expected 97, is %d", last_msg.msg.soln_meta.sol_in[6].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[6].sensor_type == 140, "incorrect value for last_msg.msg.soln_meta.sol_in[6].sensor_type, expected 140, is %d", last_msg.msg.soln_meta.sol_in[6].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[7].flags == 110, "incorrect value for last_msg.msg.soln_meta.sol_in[7].flags, expected 110, is %d", last_msg.msg.soln_meta.sol_in[7].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[7].sensor_type == 115, "incorrect value for last_msg.msg.soln_meta.sol_in[7].sensor_type, expected 115, is %d", last_msg.msg.soln_meta.sol_in[7].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[8].flags == 253, "incorrect value for last_msg.msg.soln_meta.sol_in[8].flags, expected 253, is %d", last_msg.msg.soln_meta.sol_in[8].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[8].sensor_type == 118, "incorrect value for last_msg.msg.soln_meta.sol_in[8].sensor_type, expected 118, is %d", last_msg.msg.soln_meta.sol_in[8].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[9].flags == 122, "incorrect value for last_msg.msg.soln_meta.sol_in[9].flags, expected 122, is %d", last_msg.msg.soln_meta.sol_in[9].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[9].sensor_type == 2, "incorrect value for last_msg.msg.soln_meta.sol_in[9].sensor_type, expected 2, is %d", last_msg.msg.soln_meta.sol_in[9].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[10].flags == 148, "incorrect value for last_msg.msg.soln_meta.sol_in[10].flags, expected 148, is %d", last_msg.msg.soln_meta.sol_in[10].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[10].sensor_type == 186, "incorrect value for last_msg.msg.soln_meta.sol_in[10].sensor_type, expected 186, is %d", last_msg.msg.soln_meta.sol_in[10].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[11].flags == 148, "incorrect value for last_msg.msg.soln_meta.sol_in[11].flags, expected 148, is %d", last_msg.msg.soln_meta.sol_in[11].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[11].sensor_type == 122, "incorrect value for last_msg.msg.soln_meta.sol_in[11].sensor_type, expected 122, is %d", last_msg.msg.soln_meta.sol_in[11].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[12].flags == 231, "incorrect value for last_msg.msg.soln_meta.sol_in[12].flags, expected 231, is %d", last_msg.msg.soln_meta.sol_in[12].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[12].sensor_type == 180, "incorrect value for last_msg.msg.soln_meta.sol_in[12].sensor_type, expected 180, is %d", last_msg.msg.soln_meta.sol_in[12].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[13].flags == 46, "incorrect value for last_msg.msg.soln_meta.sol_in[13].flags, expected 46, is %d", last_msg.msg.soln_meta.sol_in[13].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[13].sensor_type == 68, "incorrect value for last_msg.msg.soln_meta.sol_in[13].sensor_type, expected 68, is %d", last_msg.msg.soln_meta.sol_in[13].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[14].flags == 102, "incorrect value for last_msg.msg.soln_meta.sol_in[14].flags, expected 102, is %d", last_msg.msg.soln_meta.sol_in[14].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[14].sensor_type == 190, "incorrect value for last_msg.msg.soln_meta.sol_in[14].sensor_type, expected 190, is %d", last_msg.msg.soln_meta.sol_in[14].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[15].flags == 48, "incorrect value for last_msg.msg.soln_meta.sol_in[15].flags, expected 48, is %d", last_msg.msg.soln_meta.sol_in[15].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[15].sensor_type == 243, "incorrect value for last_msg.msg.soln_meta.sol_in[15].sensor_type, expected 243, is %d", last_msg.msg.soln_meta.sol_in[15].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[16].flags == 15, "incorrect value for last_msg.msg.soln_meta.sol_in[16].flags, expected 15, is %d", last_msg.msg.soln_meta.sol_in[16].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[16].sensor_type == 192, "incorrect value for last_msg.msg.soln_meta.sol_in[16].sensor_type, expected 192, is %d", last_msg.msg.soln_meta.sol_in[16].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[17].flags == 89, "incorrect value for last_msg.msg.soln_meta.sol_in[17].flags, expected 89, is %d", last_msg.msg.soln_meta.sol_in[17].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[17].sensor_type == 208, "incorrect value for last_msg.msg.soln_meta.sol_in[17].sensor_type, expected 208, is %d", last_msg.msg.soln_meta.sol_in[17].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[18].flags == 10, "incorrect value for last_msg.msg.soln_meta.sol_in[18].flags, expected 10, is %d", last_msg.msg.soln_meta.sol_in[18].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[18].sensor_type == 56, "incorrect value for last_msg.msg.soln_meta.sol_in[18].sensor_type, expected 56, is %d", last_msg.msg.soln_meta.sol_in[18].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[19].flags == 2, "incorrect value for last_msg.msg.soln_meta.sol_in[19].flags, expected 2, is %d", last_msg.msg.soln_meta.sol_in[19].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[19].sensor_type == 245, "incorrect value for last_msg.msg.soln_meta.sol_in[19].sensor_type, expected 245, is %d", last_msg.msg.soln_meta.sol_in[19].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[20].flags == 201, "incorrect value for last_msg.msg.soln_meta.sol_in[20].flags, expected 201, is %d", last_msg.msg.soln_meta.sol_in[20].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[20].sensor_type == 254, "incorrect value for last_msg.msg.soln_meta.sol_in[20].sensor_type, expected 254, is %d", last_msg.msg.soln_meta.sol_in[20].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[21].flags == 32, "incorrect value for last_msg.msg.soln_meta.sol_in[21].flags, expected 32, is %d", last_msg.msg.soln_meta.sol_in[21].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[21].sensor_type == 120, "incorrect value for last_msg.msg.soln_meta.sol_in[21].sensor_type, expected 120, is %d", last_msg.msg.soln_meta.sol_in[21].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[22].flags == 2, "incorrect value for last_msg.msg.soln_meta.sol_in[22].flags, expected 2, is %d", last_msg.msg.soln_meta.sol_in[22].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[22].sensor_type == 126, "incorrect value for last_msg.msg.soln_meta.sol_in[22].sensor_type, expected 126, is %d", last_msg.msg.soln_meta.sol_in[22].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[23].flags == 161, "incorrect value for last_msg.msg.soln_meta.sol_in[23].flags, expected 161, is %d", last_msg.msg.soln_meta.sol_in[23].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[23].sensor_type == 83, "incorrect value for last_msg.msg.soln_meta.sol_in[23].sensor_type, expected 83, is %d", last_msg.msg.soln_meta.sol_in[23].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[24].flags == 123, "incorrect value for last_msg.msg.soln_meta.sol_in[24].flags, expected 123, is %d", last_msg.msg.soln_meta.sol_in[24].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[24].sensor_type == 238, "incorrect value for last_msg.msg.soln_meta.sol_in[24].sensor_type, expected 238, is %d", last_msg.msg.soln_meta.sol_in[24].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[25].flags == 230, "incorrect value for last_msg.msg.soln_meta.sol_in[25].flags, expected 230, is %d", last_msg.msg.soln_meta.sol_in[25].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[25].sensor_type == 102, "incorrect value for last_msg.msg.soln_meta.sol_in[25].sensor_type, expected 102, is %d", last_msg.msg.soln_meta.sol_in[25].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[26].flags == 190, "incorrect value for last_msg.msg.soln_meta.sol_in[26].flags, expected 190, is %d", last_msg.msg.soln_meta.sol_in[26].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[26].sensor_type == 76, "incorrect value for last_msg.msg.soln_meta.sol_in[26].sensor_type, expected 76, is %d", last_msg.msg.soln_meta.sol_in[26].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[27].flags == 182, "incorrect value for last_msg.msg.soln_meta.sol_in[27].flags, expected 182, is %d", last_msg.msg.soln_meta.sol_in[27].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[27].sensor_type == 225, "incorrect value for last_msg.msg.soln_meta.sol_in[27].sensor_type, expected 225, is %d", last_msg.msg.soln_meta.sol_in[27].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[28].flags == 228, "incorrect value for last_msg.msg.soln_meta.sol_in[28].flags, expected 228, is %d", last_msg.msg.soln_meta.sol_in[28].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[28].sensor_type == 207, "incorrect value for last_msg.msg.soln_meta.sol_in[28].sensor_type, expected 207, is %d", last_msg.msg.soln_meta.sol_in[28].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[29].flags == 218, "incorrect value for last_msg.msg.soln_meta.sol_in[29].flags, expected 218, is %d", last_msg.msg.soln_meta.sol_in[29].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[29].sensor_type == 7, "incorrect value for last_msg.msg.soln_meta.sol_in[29].sensor_type, expected 7, is %d", last_msg.msg.soln_meta.sol_in[29].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[30].flags == 89, "incorrect value for last_msg.msg.soln_meta.sol_in[30].flags, expected 89, is %d", last_msg.msg.soln_meta.sol_in[30].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[30].sensor_type == 117, "incorrect value for last_msg.msg.soln_meta.sol_in[30].sensor_type, expected 117, is %d", last_msg.msg.soln_meta.sol_in[30].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[31].flags == 191, "incorrect value for last_msg.msg.soln_meta.sol_in[31].flags, expected 191, is %d", last_msg.msg.soln_meta.sol_in[31].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[31].sensor_type == 29, "incorrect value for last_msg.msg.soln_meta.sol_in[31].sensor_type, expected 29, is %d", last_msg.msg.soln_meta.sol_in[31].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[32].flags == 248, "incorrect value for last_msg.msg.soln_meta.sol_in[32].flags, expected 248, is %d", last_msg.msg.soln_meta.sol_in[32].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[32].sensor_type == 56, "incorrect value for last_msg.msg.soln_meta.sol_in[32].sensor_type, expected 56, is %d", last_msg.msg.soln_meta.sol_in[32].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[33].flags == 255, "incorrect value for last_msg.msg.soln_meta.sol_in[33].flags, expected 255, is %d", last_msg.msg.soln_meta.sol_in[33].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[33].sensor_type == 185, "incorrect value for last_msg.msg.soln_meta.sol_in[33].sensor_type, expected 185, is %d", last_msg.msg.soln_meta.sol_in[33].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[34].flags == 18, "incorrect value for last_msg.msg.soln_meta.sol_in[34].flags, expected 18, is %d", last_msg.msg.soln_meta.sol_in[34].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[34].sensor_type == 46, "incorrect value for last_msg.msg.soln_meta.sol_in[34].sensor_type, expected 46, is %d", last_msg.msg.soln_meta.sol_in[34].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[35].flags == 142, "incorrect value for last_msg.msg.soln_meta.sol_in[35].flags, expected 142, is %d", last_msg.msg.soln_meta.sol_in[35].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[35].sensor_type == 72, "incorrect value for last_msg.msg.soln_meta.sol_in[35].sensor_type, expected 72, is %d", last_msg.msg.soln_meta.sol_in[35].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[36].flags == 113, "incorrect value for last_msg.msg.soln_meta.sol_in[36].flags, expected 113, is %d", last_msg.msg.soln_meta.sol_in[36].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[36].sensor_type == 82, "incorrect value for last_msg.msg.soln_meta.sol_in[36].sensor_type, expected 82, is %d", last_msg.msg.soln_meta.sol_in[36].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[37].flags == 4, "incorrect value for last_msg.msg.soln_meta.sol_in[37].flags, expected 4, is %d", last_msg.msg.soln_meta.sol_in[37].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[37].sensor_type == 26, "incorrect value for last_msg.msg.soln_meta.sol_in[37].sensor_type, expected 26, is %d", last_msg.msg.soln_meta.sol_in[37].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[38].flags == 254, "incorrect value for last_msg.msg.soln_meta.sol_in[38].flags, expected 254, is %d", last_msg.msg.soln_meta.sol_in[38].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[38].sensor_type == 172, "incorrect value for last_msg.msg.soln_meta.sol_in[38].sensor_type, expected 172, is %d", last_msg.msg.soln_meta.sol_in[38].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[39].flags == 136, "incorrect value for last_msg.msg.soln_meta.sol_in[39].flags, expected 136, is %d", last_msg.msg.soln_meta.sol_in[39].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[39].sensor_type == 178, "incorrect value for last_msg.msg.soln_meta.sol_in[39].sensor_type, expected 178, is %d", last_msg.msg.soln_meta.sol_in[39].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[40].flags == 115, "incorrect value for last_msg.msg.soln_meta.sol_in[40].flags, expected 115, is %d", last_msg.msg.soln_meta.sol_in[40].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[40].sensor_type == 113, "incorrect value for last_msg.msg.soln_meta.sol_in[40].sensor_type, expected 113, is %d", last_msg.msg.soln_meta.sol_in[40].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[41].flags == 193, "incorrect value for last_msg.msg.soln_meta.sol_in[41].flags, expected 193, is %d", last_msg.msg.soln_meta.sol_in[41].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[41].sensor_type == 58, "incorrect value for last_msg.msg.soln_meta.sol_in[41].sensor_type, expected 58, is %d", last_msg.msg.soln_meta.sol_in[41].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[42].flags == 227, "incorrect value for last_msg.msg.soln_meta.sol_in[42].flags, expected 227, is %d", last_msg.msg.soln_meta.sol_in[42].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[42].sensor_type == 89, "incorrect value for last_msg.msg.soln_meta.sol_in[42].sensor_type, expected 89, is %d", last_msg.msg.soln_meta.sol_in[42].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[43].flags == 246, "incorrect value for last_msg.msg.soln_meta.sol_in[43].flags, expected 246, is %d", last_msg.msg.soln_meta.sol_in[43].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[43].sensor_type == 182, "incorrect value for last_msg.msg.soln_meta.sol_in[43].sensor_type, expected 182, is %d", last_msg.msg.soln_meta.sol_in[43].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[44].flags == 77, "incorrect value for last_msg.msg.soln_meta.sol_in[44].flags, expected 77, is %d", last_msg.msg.soln_meta.sol_in[44].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[44].sensor_type == 76, "incorrect value for last_msg.msg.soln_meta.sol_in[44].sensor_type, expected 76, is %d", last_msg.msg.soln_meta.sol_in[44].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[45].flags == 245, "incorrect value for last_msg.msg.soln_meta.sol_in[45].flags, expected 245, is %d", last_msg.msg.soln_meta.sol_in[45].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[45].sensor_type == 108, "incorrect value for last_msg.msg.soln_meta.sol_in[45].sensor_type, expected 108, is %d", last_msg.msg.soln_meta.sol_in[45].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[46].flags == 31, "incorrect value for last_msg.msg.soln_meta.sol_in[46].flags, expected 31, is %d", last_msg.msg.soln_meta.sol_in[46].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[46].sensor_type == 41, "incorrect value for last_msg.msg.soln_meta.sol_in[46].sensor_type, expected 41, is %d", last_msg.msg.soln_meta.sol_in[46].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[47].flags == 124, "incorrect value for last_msg.msg.soln_meta.sol_in[47].flags, expected 124, is %d", last_msg.msg.soln_meta.sol_in[47].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[47].sensor_type == 70, "incorrect value for last_msg.msg.soln_meta.sol_in[47].sensor_type, expected 70, is %d", last_msg.msg.soln_meta.sol_in[47].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[48].flags == 145, "incorrect value for last_msg.msg.soln_meta.sol_in[48].flags, expected 145, is %d", last_msg.msg.soln_meta.sol_in[48].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[48].sensor_type == 249, "incorrect value for last_msg.msg.soln_meta.sol_in[48].sensor_type, expected 249, is %d", last_msg.msg.soln_meta.sol_in[48].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[49].flags == 78, "incorrect value for last_msg.msg.soln_meta.sol_in[49].flags, expected 78, is %d", last_msg.msg.soln_meta.sol_in[49].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[49].sensor_type == 15, "incorrect value for last_msg.msg.soln_meta.sol_in[49].sensor_type, expected 15, is %d", last_msg.msg.soln_meta.sol_in[49].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[50].flags == 38, "incorrect value for last_msg.msg.soln_meta.sol_in[50].flags, expected 38, is %d", last_msg.msg.soln_meta.sol_in[50].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[50].sensor_type == 228, "incorrect value for last_msg.msg.soln_meta.sol_in[50].sensor_type, expected 228, is %d", last_msg.msg.soln_meta.sol_in[50].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[51].flags == 129, "incorrect value for last_msg.msg.soln_meta.sol_in[51].flags, expected 129, is %d", last_msg.msg.soln_meta.sol_in[51].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[51].sensor_type == 241, "incorrect value for last_msg.msg.soln_meta.sol_in[51].sensor_type, expected 241, is %d", last_msg.msg.soln_meta.sol_in[51].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[52].flags == 176, "incorrect value for last_msg.msg.soln_meta.sol_in[52].flags, expected 176, is %d", last_msg.msg.soln_meta.sol_in[52].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[52].sensor_type == 8, "incorrect value for last_msg.msg.soln_meta.sol_in[52].sensor_type, expected 8, is %d", last_msg.msg.soln_meta.sol_in[52].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[53].flags == 72, "incorrect value for last_msg.msg.soln_meta.sol_in[53].flags, expected 72, is %d", last_msg.msg.soln_meta.sol_in[53].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[53].sensor_type == 251, "incorrect value for last_msg.msg.soln_meta.sol_in[53].sensor_type, expected 251, is %d", last_msg.msg.soln_meta.sol_in[53].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[54].flags == 80, "incorrect value for last_msg.msg.soln_meta.sol_in[54].flags, expected 80, is %d", last_msg.msg.soln_meta.sol_in[54].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[54].sensor_type == 248, "incorrect value for last_msg.msg.soln_meta.sol_in[54].sensor_type, expected 248, is %d", last_msg.msg.soln_meta.sol_in[54].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[55].flags == 244, "incorrect value for last_msg.msg.soln_meta.sol_in[55].flags, expected 244, is %d", last_msg.msg.soln_meta.sol_in[55].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[55].sensor_type == 115, "incorrect value for last_msg.msg.soln_meta.sol_in[55].sensor_type, expected 115, is %d", last_msg.msg.soln_meta.sol_in[55].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[56].flags == 145, "incorrect value for last_msg.msg.soln_meta.sol_in[56].flags, expected 145, is %d", last_msg.msg.soln_meta.sol_in[56].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[56].sensor_type == 231, "incorrect value for last_msg.msg.soln_meta.sol_in[56].sensor_type, expected 231, is %d", last_msg.msg.soln_meta.sol_in[56].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[57].flags == 190, "incorrect value for last_msg.msg.soln_meta.sol_in[57].flags, expected 190, is %d", last_msg.msg.soln_meta.sol_in[57].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[57].sensor_type == 191, "incorrect value for last_msg.msg.soln_meta.sol_in[57].sensor_type, expected 191, is %d", last_msg.msg.soln_meta.sol_in[57].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[58].flags == 168, "incorrect value for last_msg.msg.soln_meta.sol_in[58].flags, expected 168, is %d", last_msg.msg.soln_meta.sol_in[58].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[58].sensor_type == 178, "incorrect value for last_msg.msg.soln_meta.sol_in[58].sensor_type, expected 178, is %d", last_msg.msg.soln_meta.sol_in[58].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[59].flags == 233, "incorrect value for last_msg.msg.soln_meta.sol_in[59].flags, expected 233, is %d", last_msg.msg.soln_meta.sol_in[59].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[59].sensor_type == 89, "incorrect value for last_msg.msg.soln_meta.sol_in[59].sensor_type, expected 89, is %d", last_msg.msg.soln_meta.sol_in[59].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[60].flags == 176, "incorrect value for last_msg.msg.soln_meta.sol_in[60].flags, expected 176, is %d", last_msg.msg.soln_meta.sol_in[60].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[60].sensor_type == 69, "incorrect value for last_msg.msg.soln_meta.sol_in[60].sensor_type, expected 69, is %d", last_msg.msg.soln_meta.sol_in[60].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[61].flags == 140, "incorrect value for last_msg.msg.soln_meta.sol_in[61].flags, expected 140, is %d", last_msg.msg.soln_meta.sol_in[61].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[61].sensor_type == 174, "incorrect value for last_msg.msg.soln_meta.sol_in[61].sensor_type, expected 174, is %d", last_msg.msg.soln_meta.sol_in[61].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[62].flags == 141, "incorrect value for last_msg.msg.soln_meta.sol_in[62].flags, expected 141, is %d", last_msg.msg.soln_meta.sol_in[62].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[62].sensor_type == 182, "incorrect value for last_msg.msg.soln_meta.sol_in[62].sensor_type, expected 182, is %d", last_msg.msg.soln_meta.sol_in[62].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[63].flags == 82, "incorrect value for last_msg.msg.soln_meta.sol_in[63].flags, expected 82, is %d", last_msg.msg.soln_meta.sol_in[63].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[63].sensor_type == 81, "incorrect value for last_msg.msg.soln_meta.sol_in[63].sensor_type, expected 81, is %d", last_msg.msg.soln_meta.sol_in[63].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[64].flags == 79, "incorrect value for last_msg.msg.soln_meta.sol_in[64].flags, expected 79, is %d", last_msg.msg.soln_meta.sol_in[64].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[64].sensor_type == 92, "incorrect value for last_msg.msg.soln_meta.sol_in[64].sensor_type, expected 92, is %d", last_msg.msg.soln_meta.sol_in[64].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[65].flags == 223, "incorrect value for last_msg.msg.soln_meta.sol_in[65].flags, expected 223, is %d", last_msg.msg.soln_meta.sol_in[65].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[65].sensor_type == 101, "incorrect value for last_msg.msg.soln_meta.sol_in[65].sensor_type, expected 101, is %d", last_msg.msg.soln_meta.sol_in[65].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[66].flags == 64, "incorrect value for last_msg.msg.soln_meta.sol_in[66].flags, expected 64, is %d", last_msg.msg.soln_meta.sol_in[66].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[66].sensor_type == 100, "incorrect value for last_msg.msg.soln_meta.sol_in[66].sensor_type, expected 100, is %d", last_msg.msg.soln_meta.sol_in[66].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[67].flags == 215, "incorrect value for last_msg.msg.soln_meta.sol_in[67].flags, expected 215, is %d", last_msg.msg.soln_meta.sol_in[67].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[67].sensor_type == 184, "incorrect value for last_msg.msg.soln_meta.sol_in[67].sensor_type, expected 184, is %d", last_msg.msg.soln_meta.sol_in[67].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[68].flags == 37, "incorrect value for last_msg.msg.soln_meta.sol_in[68].flags, expected 37, is %d", last_msg.msg.soln_meta.sol_in[68].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[68].sensor_type == 124, "incorrect value for last_msg.msg.soln_meta.sol_in[68].sensor_type, expected 124, is %d", last_msg.msg.soln_meta.sol_in[68].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[69].flags == 227, "incorrect value for last_msg.msg.soln_meta.sol_in[69].flags, expected 227, is %d", last_msg.msg.soln_meta.sol_in[69].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[69].sensor_type == 21, "incorrect value for last_msg.msg.soln_meta.sol_in[69].sensor_type, expected 21, is %d", last_msg.msg.soln_meta.sol_in[69].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[70].flags == 102, "incorrect value for last_msg.msg.soln_meta.sol_in[70].flags, expected 102, is %d", last_msg.msg.soln_meta.sol_in[70].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[70].sensor_type == 135, "incorrect value for last_msg.msg.soln_meta.sol_in[70].sensor_type, expected 135, is %d", last_msg.msg.soln_meta.sol_in[70].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[71].flags == 36, "incorrect value for last_msg.msg.soln_meta.sol_in[71].flags, expected 36, is %d", last_msg.msg.soln_meta.sol_in[71].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[71].sensor_type == 72, "incorrect value for last_msg.msg.soln_meta.sol_in[71].sensor_type, expected 72, is %d", last_msg.msg.soln_meta.sol_in[71].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[72].flags == 56, "incorrect value for last_msg.msg.soln_meta.sol_in[72].flags, expected 56, is %d", last_msg.msg.soln_meta.sol_in[72].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[72].sensor_type == 219, "incorrect value for last_msg.msg.soln_meta.sol_in[72].sensor_type, expected 219, is %d", last_msg.msg.soln_meta.sol_in[72].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[73].flags == 90, "incorrect value for last_msg.msg.soln_meta.sol_in[73].flags, expected 90, is %d", last_msg.msg.soln_meta.sol_in[73].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[73].sensor_type == 146, "incorrect value for last_msg.msg.soln_meta.sol_in[73].sensor_type, expected 146, is %d", last_msg.msg.soln_meta.sol_in[73].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[74].flags == 104, "incorrect value for last_msg.msg.soln_meta.sol_in[74].flags, expected 104, is %d", last_msg.msg.soln_meta.sol_in[74].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[74].sensor_type == 219, "incorrect value for last_msg.msg.soln_meta.sol_in[74].sensor_type, expected 219, is %d", last_msg.msg.soln_meta.sol_in[74].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[75].flags == 102, "incorrect value for last_msg.msg.soln_meta.sol_in[75].flags, expected 102, is %d", last_msg.msg.soln_meta.sol_in[75].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[75].sensor_type == 227, "incorrect value for last_msg.msg.soln_meta.sol_in[75].sensor_type, expected 227, is %d", last_msg.msg.soln_meta.sol_in[75].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[76].flags == 12, "incorrect value for last_msg.msg.soln_meta.sol_in[76].flags, expected 12, is %d", last_msg.msg.soln_meta.sol_in[76].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[76].sensor_type == 83, "incorrect value for last_msg.msg.soln_meta.sol_in[76].sensor_type, expected 83, is %d", last_msg.msg.soln_meta.sol_in[76].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[77].flags == 122, "incorrect value for last_msg.msg.soln_meta.sol_in[77].flags, expected 122, is %d", last_msg.msg.soln_meta.sol_in[77].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[77].sensor_type == 41, "incorrect value for last_msg.msg.soln_meta.sol_in[77].sensor_type, expected 41, is %d", last_msg.msg.soln_meta.sol_in[77].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[78].flags == 94, "incorrect value for last_msg.msg.soln_meta.sol_in[78].flags, expected 94, is %d", last_msg.msg.soln_meta.sol_in[78].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[78].sensor_type == 173, "incorrect value for last_msg.msg.soln_meta.sol_in[78].sensor_type, expected 173, is %d", last_msg.msg.soln_meta.sol_in[78].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[79].flags == 174, "incorrect value for last_msg.msg.soln_meta.sol_in[79].flags, expected 174, is %d", last_msg.msg.soln_meta.sol_in[79].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[79].sensor_type == 1, "incorrect value for last_msg.msg.soln_meta.sol_in[79].sensor_type, expected 1, is %d", last_msg.msg.soln_meta.sol_in[79].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[80].flags == 130, "incorrect value for last_msg.msg.soln_meta.sol_in[80].flags, expected 130, is %d", last_msg.msg.soln_meta.sol_in[80].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[80].sensor_type == 134, "incorrect value for last_msg.msg.soln_meta.sol_in[80].sensor_type, expected 134, is %d", last_msg.msg.soln_meta.sol_in[80].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[81].flags == 237, "incorrect value for last_msg.msg.soln_meta.sol_in[81].flags, expected 237, is %d", last_msg.msg.soln_meta.sol_in[81].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[81].sensor_type == 104, "incorrect value for last_msg.msg.soln_meta.sol_in[81].sensor_type, expected 104, is %d", last_msg.msg.soln_meta.sol_in[81].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[82].flags == 249, "incorrect value for last_msg.msg.soln_meta.sol_in[82].flags, expected 249, is %d", last_msg.msg.soln_meta.sol_in[82].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[82].sensor_type == 116, "incorrect value for last_msg.msg.soln_meta.sol_in[82].sensor_type, expected 116, is %d", last_msg.msg.soln_meta.sol_in[82].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[83].flags == 230, "incorrect value for last_msg.msg.soln_meta.sol_in[83].flags, expected 230, is %d", last_msg.msg.soln_meta.sol_in[83].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[83].sensor_type == 107, "incorrect value for last_msg.msg.soln_meta.sol_in[83].sensor_type, expected 107, is %d", last_msg.msg.soln_meta.sol_in[83].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[84].flags == 123, "incorrect value for last_msg.msg.soln_meta.sol_in[84].flags, expected 123, is %d", last_msg.msg.soln_meta.sol_in[84].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[84].sensor_type == 130, "incorrect value for last_msg.msg.soln_meta.sol_in[84].sensor_type, expected 130, is %d", last_msg.msg.soln_meta.sol_in[84].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[85].flags == 162, "incorrect value for last_msg.msg.soln_meta.sol_in[85].flags, expected 162, is %d", last_msg.msg.soln_meta.sol_in[85].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[85].sensor_type == 25, "incorrect value for last_msg.msg.soln_meta.sol_in[85].sensor_type, expected 25, is %d", last_msg.msg.soln_meta.sol_in[85].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[86].flags == 223, "incorrect value for last_msg.msg.soln_meta.sol_in[86].flags, expected 223, is %d", last_msg.msg.soln_meta.sol_in[86].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[86].sensor_type == 57, "incorrect value for last_msg.msg.soln_meta.sol_in[86].sensor_type, expected 57, is %d", last_msg.msg.soln_meta.sol_in[86].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[87].flags == 174, "incorrect value for last_msg.msg.soln_meta.sol_in[87].flags, expected 174, is %d", last_msg.msg.soln_meta.sol_in[87].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[87].sensor_type == 193, "incorrect value for last_msg.msg.soln_meta.sol_in[87].sensor_type, expected 193, is %d", last_msg.msg.soln_meta.sol_in[87].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[88].flags == 193, "incorrect value for last_msg.msg.soln_meta.sol_in[88].flags, expected 193, is %d", last_msg.msg.soln_meta.sol_in[88].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[88].sensor_type == 146, "incorrect value for last_msg.msg.soln_meta.sol_in[88].sensor_type, expected 146, is %d", last_msg.msg.soln_meta.sol_in[88].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[89].flags == 44, "incorrect value for last_msg.msg.soln_meta.sol_in[89].flags, expected 44, is %d", last_msg.msg.soln_meta.sol_in[89].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[89].sensor_type == 239, "incorrect value for last_msg.msg.soln_meta.sol_in[89].sensor_type, expected 239, is %d", last_msg.msg.soln_meta.sol_in[89].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[90].flags == 197, "incorrect value for last_msg.msg.soln_meta.sol_in[90].flags, expected 197, is %d", last_msg.msg.soln_meta.sol_in[90].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[90].sensor_type == 246, "incorrect value for last_msg.msg.soln_meta.sol_in[90].sensor_type, expected 246, is %d", last_msg.msg.soln_meta.sol_in[90].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[91].flags == 80, "incorrect value for last_msg.msg.soln_meta.sol_in[91].flags, expected 80, is %d", last_msg.msg.soln_meta.sol_in[91].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[91].sensor_type == 214, "incorrect value for last_msg.msg.soln_meta.sol_in[91].sensor_type, expected 214, is %d", last_msg.msg.soln_meta.sol_in[91].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[92].flags == 100, "incorrect value for last_msg.msg.soln_meta.sol_in[92].flags, expected 100, is %d", last_msg.msg.soln_meta.sol_in[92].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[92].sensor_type == 83, "incorrect value for last_msg.msg.soln_meta.sol_in[92].sensor_type, expected 83, is %d", last_msg.msg.soln_meta.sol_in[92].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[93].flags == 72, "incorrect value for last_msg.msg.soln_meta.sol_in[93].flags, expected 72, is %d", last_msg.msg.soln_meta.sol_in[93].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[93].sensor_type == 66, "incorrect value for last_msg.msg.soln_meta.sol_in[93].sensor_type, expected 66, is %d", last_msg.msg.soln_meta.sol_in[93].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[94].flags == 137, "incorrect value for last_msg.msg.soln_meta.sol_in[94].flags, expected 137, is %d", last_msg.msg.soln_meta.sol_in[94].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[94].sensor_type == 133, "incorrect value for last_msg.msg.soln_meta.sol_in[94].sensor_type, expected 133, is %d", last_msg.msg.soln_meta.sol_in[94].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[95].flags == 82, "incorrect value for last_msg.msg.soln_meta.sol_in[95].flags, expected 82, is %d", last_msg.msg.soln_meta.sol_in[95].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[95].sensor_type == 140, "incorrect value for last_msg.msg.soln_meta.sol_in[95].sensor_type, expected 140, is %d", last_msg.msg.soln_meta.sol_in[95].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[96].flags == 2, "incorrect value for last_msg.msg.soln_meta.sol_in[96].flags, expected 2, is %d", last_msg.msg.soln_meta.sol_in[96].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[96].sensor_type == 2, "incorrect value for last_msg.msg.soln_meta.sol_in[96].sensor_type, expected 2, is %d", last_msg.msg.soln_meta.sol_in[96].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[97].flags == 9, "incorrect value for last_msg.msg.soln_meta.sol_in[97].flags, expected 9, is %d", last_msg.msg.soln_meta.sol_in[97].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[97].sensor_type == 96, "incorrect value for last_msg.msg.soln_meta.sol_in[97].sensor_type, expected 96, is %d", last_msg.msg.soln_meta.sol_in[97].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[98].flags == 158, "incorrect value for last_msg.msg.soln_meta.sol_in[98].flags, expected 158, is %d", last_msg.msg.soln_meta.sol_in[98].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[98].sensor_type == 96, "incorrect value for last_msg.msg.soln_meta.sol_in[98].sensor_type, expected 96, is %d", last_msg.msg.soln_meta.sol_in[98].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[99].flags == 97, "incorrect value for last_msg.msg.soln_meta.sol_in[99].flags, expected 97, is %d", last_msg.msg.soln_meta.sol_in[99].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[99].sensor_type == 134, "incorrect value for last_msg.msg.soln_meta.sol_in[99].sensor_type, expected 134, is %d", last_msg.msg.soln_meta.sol_in[99].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[100].flags == 129, "incorrect value for last_msg.msg.soln_meta.sol_in[100].flags, expected 129, is %d", last_msg.msg.soln_meta.sol_in[100].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[100].sensor_type == 43, "incorrect value for last_msg.msg.soln_meta.sol_in[100].sensor_type, expected 43, is %d", last_msg.msg.soln_meta.sol_in[100].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[101].flags == 25, "incorrect value for last_msg.msg.soln_meta.sol_in[101].flags, expected 25, is %d", last_msg.msg.soln_meta.sol_in[101].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[101].sensor_type == 141, "incorrect value for last_msg.msg.soln_meta.sol_in[101].sensor_type, expected 141, is %d", last_msg.msg.soln_meta.sol_in[101].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[102].flags == 200, "incorrect value for last_msg.msg.soln_meta.sol_in[102].flags, expected 200, is %d", last_msg.msg.soln_meta.sol_in[102].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[102].sensor_type == 183, "incorrect value for last_msg.msg.soln_meta.sol_in[102].sensor_type, expected 183, is %d", last_msg.msg.soln_meta.sol_in[102].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[103].flags == 57, "incorrect value for last_msg.msg.soln_meta.sol_in[103].flags, expected 57, is %d", last_msg.msg.soln_meta.sol_in[103].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[103].sensor_type == 214, "incorrect value for last_msg.msg.soln_meta.sol_in[103].sensor_type, expected 214, is %d", last_msg.msg.soln_meta.sol_in[103].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[104].flags == 103, "incorrect value for last_msg.msg.soln_meta.sol_in[104].flags, expected 103, is %d", last_msg.msg.soln_meta.sol_in[104].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[104].sensor_type == 248, "incorrect value for last_msg.msg.soln_meta.sol_in[104].sensor_type, expected 248, is %d", last_msg.msg.soln_meta.sol_in[104].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[105].flags == 65, "incorrect value for last_msg.msg.soln_meta.sol_in[105].flags, expected 65, is %d", last_msg.msg.soln_meta.sol_in[105].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[105].sensor_type == 222, "incorrect value for last_msg.msg.soln_meta.sol_in[105].sensor_type, expected 222, is %d", last_msg.msg.soln_meta.sol_in[105].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[106].flags == 15, "incorrect value for last_msg.msg.soln_meta.sol_in[106].flags, expected 15, is %d", last_msg.msg.soln_meta.sol_in[106].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[106].sensor_type == 195, "incorrect value for last_msg.msg.soln_meta.sol_in[106].sensor_type, expected 195, is %d", last_msg.msg.soln_meta.sol_in[106].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[107].flags == 21, "incorrect value for last_msg.msg.soln_meta.sol_in[107].flags, expected 21, is %d", last_msg.msg.soln_meta.sol_in[107].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[107].sensor_type == 244, "incorrect value for last_msg.msg.soln_meta.sol_in[107].sensor_type, expected 244, is %d", last_msg.msg.soln_meta.sol_in[107].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[108].flags == 46, "incorrect value for last_msg.msg.soln_meta.sol_in[108].flags, expected 46, is %d", last_msg.msg.soln_meta.sol_in[108].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[108].sensor_type == 180, "incorrect value for last_msg.msg.soln_meta.sol_in[108].sensor_type, expected 180, is %d", last_msg.msg.soln_meta.sol_in[108].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[109].flags == 130, "incorrect value for last_msg.msg.soln_meta.sol_in[109].flags, expected 130, is %d", last_msg.msg.soln_meta.sol_in[109].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[109].sensor_type == 140, "incorrect value for last_msg.msg.soln_meta.sol_in[109].sensor_type, expected 140, is %d", last_msg.msg.soln_meta.sol_in[109].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[110].flags == 17, "incorrect value for last_msg.msg.soln_meta.sol_in[110].flags, expected 17, is %d", last_msg.msg.soln_meta.sol_in[110].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[110].sensor_type == 36, "incorrect value for last_msg.msg.soln_meta.sol_in[110].sensor_type, expected 36, is %d", last_msg.msg.soln_meta.sol_in[110].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[111].flags == 209, "incorrect value for last_msg.msg.soln_meta.sol_in[111].flags, expected 209, is %d", last_msg.msg.soln_meta.sol_in[111].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[111].sensor_type == 194, "incorrect value for last_msg.msg.soln_meta.sol_in[111].sensor_type, expected 194, is %d", last_msg.msg.soln_meta.sol_in[111].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[112].flags == 254, "incorrect value for last_msg.msg.soln_meta.sol_in[112].flags, expected 254, is %d", last_msg.msg.soln_meta.sol_in[112].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[112].sensor_type == 65, "incorrect value for last_msg.msg.soln_meta.sol_in[112].sensor_type, expected 65, is %d", last_msg.msg.soln_meta.sol_in[112].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[113].flags == 103, "incorrect value for last_msg.msg.soln_meta.sol_in[113].flags, expected 103, is %d", last_msg.msg.soln_meta.sol_in[113].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[113].sensor_type == 115, "incorrect value for last_msg.msg.soln_meta.sol_in[113].sensor_type, expected 115, is %d", last_msg.msg.soln_meta.sol_in[113].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[114].flags == 129, "incorrect value for last_msg.msg.soln_meta.sol_in[114].flags, expected 129, is %d", last_msg.msg.soln_meta.sol_in[114].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[114].sensor_type == 152, "incorrect value for last_msg.msg.soln_meta.sol_in[114].sensor_type, expected 152, is %d", last_msg.msg.soln_meta.sol_in[114].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[115].flags == 235, "incorrect value for last_msg.msg.soln_meta.sol_in[115].flags, expected 235, is %d", last_msg.msg.soln_meta.sol_in[115].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[115].sensor_type == 234, "incorrect value for last_msg.msg.soln_meta.sol_in[115].sensor_type, expected 234, is %d", last_msg.msg.soln_meta.sol_in[115].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[116].flags == 234, "incorrect value for last_msg.msg.soln_meta.sol_in[116].flags, expected 234, is %d", last_msg.msg.soln_meta.sol_in[116].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[116].sensor_type == 194, "incorrect value for last_msg.msg.soln_meta.sol_in[116].sensor_type, expected 194, is %d", last_msg.msg.soln_meta.sol_in[116].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[117].flags == 201, "incorrect value for last_msg.msg.soln_meta.sol_in[117].flags, expected 201, is %d", last_msg.msg.soln_meta.sol_in[117].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[117].sensor_type == 170, "incorrect value for last_msg.msg.soln_meta.sol_in[117].sensor_type, expected 170, is %d", last_msg.msg.soln_meta.sol_in[117].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[118].flags == 154, "incorrect value for last_msg.msg.soln_meta.sol_in[118].flags, expected 154, is %d", last_msg.msg.soln_meta.sol_in[118].flags); - - ck_assert_msg(last_msg.msg.soln_meta.sol_in[118].sensor_type == 210, "incorrect value for last_msg.msg.soln_meta.sol_in[118].sensor_type, expected 210, is %d", last_msg.msg.soln_meta.sol_in[118].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta.tow == 3628191792, "incorrect value for last_msg.msg.soln_meta.tow, expected 3628191792, is %d", last_msg.msg.soln_meta.tow); - - ck_assert_msg(last_msg.msg.soln_meta.vdop == 58512, "incorrect value for last_msg.msg.soln_meta.vdop, expected 58512, is %d", last_msg.msg.soln_meta.vdop); + ck_assert_msg(last_msg.msg.soln_meta.age_corrections == 21256, + "incorrect value for last_msg.msg.soln_meta.age_corrections, " + "expected 21256, is %d", + last_msg.msg.soln_meta.age_corrections); + + ck_assert_msg(last_msg.msg.soln_meta.age_gnss == 3573765977, + "incorrect value for last_msg.msg.soln_meta.age_gnss, " + "expected 3573765977, is %d", + last_msg.msg.soln_meta.age_gnss); + + ck_assert_msg(last_msg.msg.soln_meta.hdop == 41156, + "incorrect value for last_msg.msg.soln_meta.hdop, expected " + "41156, is %d", + last_msg.msg.soln_meta.hdop); + + ck_assert_msg(last_msg.msg.soln_meta.n_sol_in == 119, + "incorrect value for last_msg.msg.soln_meta.n_sol_in, " + "expected 119, is %d", + last_msg.msg.soln_meta.n_sol_in); + + ck_assert_msg(last_msg.msg.soln_meta.pdop == 11642, + "incorrect value for last_msg.msg.soln_meta.pdop, expected " + "11642, is %d", + last_msg.msg.soln_meta.pdop); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[0].flags == 109, + "incorrect value for last_msg.msg.soln_meta.sol_in[0].flags, " + "expected 109, is %d", + last_msg.msg.soln_meta.sol_in[0].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[0].sensor_type == 95, + "incorrect value for last_msg.msg.soln_meta.sol_in[0].sensor_type, " + "expected 95, is %d", + last_msg.msg.soln_meta.sol_in[0].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[1].flags == 131, + "incorrect value for last_msg.msg.soln_meta.sol_in[1].flags, " + "expected 131, is %d", + last_msg.msg.soln_meta.sol_in[1].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[1].sensor_type == 86, + "incorrect value for last_msg.msg.soln_meta.sol_in[1].sensor_type, " + "expected 86, is %d", + last_msg.msg.soln_meta.sol_in[1].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[2].flags == 70, + "incorrect value for last_msg.msg.soln_meta.sol_in[2].flags, " + "expected 70, is %d", + last_msg.msg.soln_meta.sol_in[2].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[2].sensor_type == 71, + "incorrect value for last_msg.msg.soln_meta.sol_in[2].sensor_type, " + "expected 71, is %d", + last_msg.msg.soln_meta.sol_in[2].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[3].flags == 73, + "incorrect value for last_msg.msg.soln_meta.sol_in[3].flags, " + "expected 73, is %d", + last_msg.msg.soln_meta.sol_in[3].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[3].sensor_type == 84, + "incorrect value for last_msg.msg.soln_meta.sol_in[3].sensor_type, " + "expected 84, is %d", + last_msg.msg.soln_meta.sol_in[3].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[4].flags == 26, + "incorrect value for last_msg.msg.soln_meta.sol_in[4].flags, " + "expected 26, is %d", + last_msg.msg.soln_meta.sol_in[4].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[4].sensor_type == 131, + "incorrect value for last_msg.msg.soln_meta.sol_in[4].sensor_type, " + "expected 131, is %d", + last_msg.msg.soln_meta.sol_in[4].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[5].flags == 247, + "incorrect value for last_msg.msg.soln_meta.sol_in[5].flags, " + "expected 247, is %d", + last_msg.msg.soln_meta.sol_in[5].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[5].sensor_type == 82, + "incorrect value for last_msg.msg.soln_meta.sol_in[5].sensor_type, " + "expected 82, is %d", + last_msg.msg.soln_meta.sol_in[5].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[6].flags == 97, + "incorrect value for last_msg.msg.soln_meta.sol_in[6].flags, " + "expected 97, is %d", + last_msg.msg.soln_meta.sol_in[6].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[6].sensor_type == 140, + "incorrect value for last_msg.msg.soln_meta.sol_in[6].sensor_type, " + "expected 140, is %d", + last_msg.msg.soln_meta.sol_in[6].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[7].flags == 110, + "incorrect value for last_msg.msg.soln_meta.sol_in[7].flags, " + "expected 110, is %d", + last_msg.msg.soln_meta.sol_in[7].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[7].sensor_type == 115, + "incorrect value for last_msg.msg.soln_meta.sol_in[7].sensor_type, " + "expected 115, is %d", + last_msg.msg.soln_meta.sol_in[7].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[8].flags == 253, + "incorrect value for last_msg.msg.soln_meta.sol_in[8].flags, " + "expected 253, is %d", + last_msg.msg.soln_meta.sol_in[8].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[8].sensor_type == 118, + "incorrect value for last_msg.msg.soln_meta.sol_in[8].sensor_type, " + "expected 118, is %d", + last_msg.msg.soln_meta.sol_in[8].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[9].flags == 122, + "incorrect value for last_msg.msg.soln_meta.sol_in[9].flags, " + "expected 122, is %d", + last_msg.msg.soln_meta.sol_in[9].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[9].sensor_type == 2, + "incorrect value for last_msg.msg.soln_meta.sol_in[9].sensor_type, " + "expected 2, is %d", + last_msg.msg.soln_meta.sol_in[9].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[10].flags == 148, + "incorrect value for last_msg.msg.soln_meta.sol_in[10].flags, expected " + "148, is %d", + last_msg.msg.soln_meta.sol_in[10].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[10].sensor_type == 186, + "incorrect value for last_msg.msg.soln_meta.sol_in[10].sensor_type, " + "expected 186, is %d", + last_msg.msg.soln_meta.sol_in[10].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[11].flags == 148, + "incorrect value for last_msg.msg.soln_meta.sol_in[11].flags, expected " + "148, is %d", + last_msg.msg.soln_meta.sol_in[11].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[11].sensor_type == 122, + "incorrect value for last_msg.msg.soln_meta.sol_in[11].sensor_type, " + "expected 122, is %d", + last_msg.msg.soln_meta.sol_in[11].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[12].flags == 231, + "incorrect value for last_msg.msg.soln_meta.sol_in[12].flags, expected " + "231, is %d", + last_msg.msg.soln_meta.sol_in[12].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[12].sensor_type == 180, + "incorrect value for last_msg.msg.soln_meta.sol_in[12].sensor_type, " + "expected 180, is %d", + last_msg.msg.soln_meta.sol_in[12].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[13].flags == 46, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[13].flags, expected 46, is %d", + last_msg.msg.soln_meta.sol_in[13].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[13].sensor_type == 68, + "incorrect value for last_msg.msg.soln_meta.sol_in[13].sensor_type, " + "expected 68, is %d", + last_msg.msg.soln_meta.sol_in[13].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[14].flags == 102, + "incorrect value for last_msg.msg.soln_meta.sol_in[14].flags, expected " + "102, is %d", + last_msg.msg.soln_meta.sol_in[14].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[14].sensor_type == 190, + "incorrect value for last_msg.msg.soln_meta.sol_in[14].sensor_type, " + "expected 190, is %d", + last_msg.msg.soln_meta.sol_in[14].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[15].flags == 48, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[15].flags, expected 48, is %d", + last_msg.msg.soln_meta.sol_in[15].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[15].sensor_type == 243, + "incorrect value for last_msg.msg.soln_meta.sol_in[15].sensor_type, " + "expected 243, is %d", + last_msg.msg.soln_meta.sol_in[15].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[16].flags == 15, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[16].flags, expected 15, is %d", + last_msg.msg.soln_meta.sol_in[16].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[16].sensor_type == 192, + "incorrect value for last_msg.msg.soln_meta.sol_in[16].sensor_type, " + "expected 192, is %d", + last_msg.msg.soln_meta.sol_in[16].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[17].flags == 89, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[17].flags, expected 89, is %d", + last_msg.msg.soln_meta.sol_in[17].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[17].sensor_type == 208, + "incorrect value for last_msg.msg.soln_meta.sol_in[17].sensor_type, " + "expected 208, is %d", + last_msg.msg.soln_meta.sol_in[17].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[18].flags == 10, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[18].flags, expected 10, is %d", + last_msg.msg.soln_meta.sol_in[18].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[18].sensor_type == 56, + "incorrect value for last_msg.msg.soln_meta.sol_in[18].sensor_type, " + "expected 56, is %d", + last_msg.msg.soln_meta.sol_in[18].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[19].flags == 2, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[19].flags, expected 2, is %d", + last_msg.msg.soln_meta.sol_in[19].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[19].sensor_type == 245, + "incorrect value for last_msg.msg.soln_meta.sol_in[19].sensor_type, " + "expected 245, is %d", + last_msg.msg.soln_meta.sol_in[19].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[20].flags == 201, + "incorrect value for last_msg.msg.soln_meta.sol_in[20].flags, expected " + "201, is %d", + last_msg.msg.soln_meta.sol_in[20].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[20].sensor_type == 254, + "incorrect value for last_msg.msg.soln_meta.sol_in[20].sensor_type, " + "expected 254, is %d", + last_msg.msg.soln_meta.sol_in[20].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[21].flags == 32, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[21].flags, expected 32, is %d", + last_msg.msg.soln_meta.sol_in[21].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[21].sensor_type == 120, + "incorrect value for last_msg.msg.soln_meta.sol_in[21].sensor_type, " + "expected 120, is %d", + last_msg.msg.soln_meta.sol_in[21].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[22].flags == 2, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[22].flags, expected 2, is %d", + last_msg.msg.soln_meta.sol_in[22].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[22].sensor_type == 126, + "incorrect value for last_msg.msg.soln_meta.sol_in[22].sensor_type, " + "expected 126, is %d", + last_msg.msg.soln_meta.sol_in[22].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[23].flags == 161, + "incorrect value for last_msg.msg.soln_meta.sol_in[23].flags, expected " + "161, is %d", + last_msg.msg.soln_meta.sol_in[23].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[23].sensor_type == 83, + "incorrect value for last_msg.msg.soln_meta.sol_in[23].sensor_type, " + "expected 83, is %d", + last_msg.msg.soln_meta.sol_in[23].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[24].flags == 123, + "incorrect value for last_msg.msg.soln_meta.sol_in[24].flags, expected " + "123, is %d", + last_msg.msg.soln_meta.sol_in[24].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[24].sensor_type == 238, + "incorrect value for last_msg.msg.soln_meta.sol_in[24].sensor_type, " + "expected 238, is %d", + last_msg.msg.soln_meta.sol_in[24].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[25].flags == 230, + "incorrect value for last_msg.msg.soln_meta.sol_in[25].flags, expected " + "230, is %d", + last_msg.msg.soln_meta.sol_in[25].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[25].sensor_type == 102, + "incorrect value for last_msg.msg.soln_meta.sol_in[25].sensor_type, " + "expected 102, is %d", + last_msg.msg.soln_meta.sol_in[25].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[26].flags == 190, + "incorrect value for last_msg.msg.soln_meta.sol_in[26].flags, expected " + "190, is %d", + last_msg.msg.soln_meta.sol_in[26].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[26].sensor_type == 76, + "incorrect value for last_msg.msg.soln_meta.sol_in[26].sensor_type, " + "expected 76, is %d", + last_msg.msg.soln_meta.sol_in[26].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[27].flags == 182, + "incorrect value for last_msg.msg.soln_meta.sol_in[27].flags, expected " + "182, is %d", + last_msg.msg.soln_meta.sol_in[27].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[27].sensor_type == 225, + "incorrect value for last_msg.msg.soln_meta.sol_in[27].sensor_type, " + "expected 225, is %d", + last_msg.msg.soln_meta.sol_in[27].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[28].flags == 228, + "incorrect value for last_msg.msg.soln_meta.sol_in[28].flags, expected " + "228, is %d", + last_msg.msg.soln_meta.sol_in[28].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[28].sensor_type == 207, + "incorrect value for last_msg.msg.soln_meta.sol_in[28].sensor_type, " + "expected 207, is %d", + last_msg.msg.soln_meta.sol_in[28].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[29].flags == 218, + "incorrect value for last_msg.msg.soln_meta.sol_in[29].flags, expected " + "218, is %d", + last_msg.msg.soln_meta.sol_in[29].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[29].sensor_type == 7, + "incorrect value for last_msg.msg.soln_meta.sol_in[29].sensor_type, " + "expected 7, is %d", + last_msg.msg.soln_meta.sol_in[29].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[30].flags == 89, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[30].flags, expected 89, is %d", + last_msg.msg.soln_meta.sol_in[30].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[30].sensor_type == 117, + "incorrect value for last_msg.msg.soln_meta.sol_in[30].sensor_type, " + "expected 117, is %d", + last_msg.msg.soln_meta.sol_in[30].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[31].flags == 191, + "incorrect value for last_msg.msg.soln_meta.sol_in[31].flags, expected " + "191, is %d", + last_msg.msg.soln_meta.sol_in[31].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[31].sensor_type == 29, + "incorrect value for last_msg.msg.soln_meta.sol_in[31].sensor_type, " + "expected 29, is %d", + last_msg.msg.soln_meta.sol_in[31].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[32].flags == 248, + "incorrect value for last_msg.msg.soln_meta.sol_in[32].flags, expected " + "248, is %d", + last_msg.msg.soln_meta.sol_in[32].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[32].sensor_type == 56, + "incorrect value for last_msg.msg.soln_meta.sol_in[32].sensor_type, " + "expected 56, is %d", + last_msg.msg.soln_meta.sol_in[32].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[33].flags == 255, + "incorrect value for last_msg.msg.soln_meta.sol_in[33].flags, expected " + "255, is %d", + last_msg.msg.soln_meta.sol_in[33].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[33].sensor_type == 185, + "incorrect value for last_msg.msg.soln_meta.sol_in[33].sensor_type, " + "expected 185, is %d", + last_msg.msg.soln_meta.sol_in[33].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[34].flags == 18, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[34].flags, expected 18, is %d", + last_msg.msg.soln_meta.sol_in[34].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[34].sensor_type == 46, + "incorrect value for last_msg.msg.soln_meta.sol_in[34].sensor_type, " + "expected 46, is %d", + last_msg.msg.soln_meta.sol_in[34].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[35].flags == 142, + "incorrect value for last_msg.msg.soln_meta.sol_in[35].flags, expected " + "142, is %d", + last_msg.msg.soln_meta.sol_in[35].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[35].sensor_type == 72, + "incorrect value for last_msg.msg.soln_meta.sol_in[35].sensor_type, " + "expected 72, is %d", + last_msg.msg.soln_meta.sol_in[35].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[36].flags == 113, + "incorrect value for last_msg.msg.soln_meta.sol_in[36].flags, expected " + "113, is %d", + last_msg.msg.soln_meta.sol_in[36].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[36].sensor_type == 82, + "incorrect value for last_msg.msg.soln_meta.sol_in[36].sensor_type, " + "expected 82, is %d", + last_msg.msg.soln_meta.sol_in[36].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[37].flags == 4, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[37].flags, expected 4, is %d", + last_msg.msg.soln_meta.sol_in[37].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[37].sensor_type == 26, + "incorrect value for last_msg.msg.soln_meta.sol_in[37].sensor_type, " + "expected 26, is %d", + last_msg.msg.soln_meta.sol_in[37].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[38].flags == 254, + "incorrect value for last_msg.msg.soln_meta.sol_in[38].flags, expected " + "254, is %d", + last_msg.msg.soln_meta.sol_in[38].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[38].sensor_type == 172, + "incorrect value for last_msg.msg.soln_meta.sol_in[38].sensor_type, " + "expected 172, is %d", + last_msg.msg.soln_meta.sol_in[38].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[39].flags == 136, + "incorrect value for last_msg.msg.soln_meta.sol_in[39].flags, expected " + "136, is %d", + last_msg.msg.soln_meta.sol_in[39].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[39].sensor_type == 178, + "incorrect value for last_msg.msg.soln_meta.sol_in[39].sensor_type, " + "expected 178, is %d", + last_msg.msg.soln_meta.sol_in[39].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[40].flags == 115, + "incorrect value for last_msg.msg.soln_meta.sol_in[40].flags, expected " + "115, is %d", + last_msg.msg.soln_meta.sol_in[40].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[40].sensor_type == 113, + "incorrect value for last_msg.msg.soln_meta.sol_in[40].sensor_type, " + "expected 113, is %d", + last_msg.msg.soln_meta.sol_in[40].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[41].flags == 193, + "incorrect value for last_msg.msg.soln_meta.sol_in[41].flags, expected " + "193, is %d", + last_msg.msg.soln_meta.sol_in[41].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[41].sensor_type == 58, + "incorrect value for last_msg.msg.soln_meta.sol_in[41].sensor_type, " + "expected 58, is %d", + last_msg.msg.soln_meta.sol_in[41].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[42].flags == 227, + "incorrect value for last_msg.msg.soln_meta.sol_in[42].flags, expected " + "227, is %d", + last_msg.msg.soln_meta.sol_in[42].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[42].sensor_type == 89, + "incorrect value for last_msg.msg.soln_meta.sol_in[42].sensor_type, " + "expected 89, is %d", + last_msg.msg.soln_meta.sol_in[42].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[43].flags == 246, + "incorrect value for last_msg.msg.soln_meta.sol_in[43].flags, expected " + "246, is %d", + last_msg.msg.soln_meta.sol_in[43].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[43].sensor_type == 182, + "incorrect value for last_msg.msg.soln_meta.sol_in[43].sensor_type, " + "expected 182, is %d", + last_msg.msg.soln_meta.sol_in[43].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[44].flags == 77, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[44].flags, expected 77, is %d", + last_msg.msg.soln_meta.sol_in[44].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[44].sensor_type == 76, + "incorrect value for last_msg.msg.soln_meta.sol_in[44].sensor_type, " + "expected 76, is %d", + last_msg.msg.soln_meta.sol_in[44].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[45].flags == 245, + "incorrect value for last_msg.msg.soln_meta.sol_in[45].flags, expected " + "245, is %d", + last_msg.msg.soln_meta.sol_in[45].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[45].sensor_type == 108, + "incorrect value for last_msg.msg.soln_meta.sol_in[45].sensor_type, " + "expected 108, is %d", + last_msg.msg.soln_meta.sol_in[45].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[46].flags == 31, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[46].flags, expected 31, is %d", + last_msg.msg.soln_meta.sol_in[46].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[46].sensor_type == 41, + "incorrect value for last_msg.msg.soln_meta.sol_in[46].sensor_type, " + "expected 41, is %d", + last_msg.msg.soln_meta.sol_in[46].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[47].flags == 124, + "incorrect value for last_msg.msg.soln_meta.sol_in[47].flags, expected " + "124, is %d", + last_msg.msg.soln_meta.sol_in[47].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[47].sensor_type == 70, + "incorrect value for last_msg.msg.soln_meta.sol_in[47].sensor_type, " + "expected 70, is %d", + last_msg.msg.soln_meta.sol_in[47].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[48].flags == 145, + "incorrect value for last_msg.msg.soln_meta.sol_in[48].flags, expected " + "145, is %d", + last_msg.msg.soln_meta.sol_in[48].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[48].sensor_type == 249, + "incorrect value for last_msg.msg.soln_meta.sol_in[48].sensor_type, " + "expected 249, is %d", + last_msg.msg.soln_meta.sol_in[48].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[49].flags == 78, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[49].flags, expected 78, is %d", + last_msg.msg.soln_meta.sol_in[49].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[49].sensor_type == 15, + "incorrect value for last_msg.msg.soln_meta.sol_in[49].sensor_type, " + "expected 15, is %d", + last_msg.msg.soln_meta.sol_in[49].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[50].flags == 38, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[50].flags, expected 38, is %d", + last_msg.msg.soln_meta.sol_in[50].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[50].sensor_type == 228, + "incorrect value for last_msg.msg.soln_meta.sol_in[50].sensor_type, " + "expected 228, is %d", + last_msg.msg.soln_meta.sol_in[50].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[51].flags == 129, + "incorrect value for last_msg.msg.soln_meta.sol_in[51].flags, expected " + "129, is %d", + last_msg.msg.soln_meta.sol_in[51].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[51].sensor_type == 241, + "incorrect value for last_msg.msg.soln_meta.sol_in[51].sensor_type, " + "expected 241, is %d", + last_msg.msg.soln_meta.sol_in[51].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[52].flags == 176, + "incorrect value for last_msg.msg.soln_meta.sol_in[52].flags, expected " + "176, is %d", + last_msg.msg.soln_meta.sol_in[52].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[52].sensor_type == 8, + "incorrect value for last_msg.msg.soln_meta.sol_in[52].sensor_type, " + "expected 8, is %d", + last_msg.msg.soln_meta.sol_in[52].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[53].flags == 72, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[53].flags, expected 72, is %d", + last_msg.msg.soln_meta.sol_in[53].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[53].sensor_type == 251, + "incorrect value for last_msg.msg.soln_meta.sol_in[53].sensor_type, " + "expected 251, is %d", + last_msg.msg.soln_meta.sol_in[53].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[54].flags == 80, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[54].flags, expected 80, is %d", + last_msg.msg.soln_meta.sol_in[54].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[54].sensor_type == 248, + "incorrect value for last_msg.msg.soln_meta.sol_in[54].sensor_type, " + "expected 248, is %d", + last_msg.msg.soln_meta.sol_in[54].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[55].flags == 244, + "incorrect value for last_msg.msg.soln_meta.sol_in[55].flags, expected " + "244, is %d", + last_msg.msg.soln_meta.sol_in[55].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[55].sensor_type == 115, + "incorrect value for last_msg.msg.soln_meta.sol_in[55].sensor_type, " + "expected 115, is %d", + last_msg.msg.soln_meta.sol_in[55].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[56].flags == 145, + "incorrect value for last_msg.msg.soln_meta.sol_in[56].flags, expected " + "145, is %d", + last_msg.msg.soln_meta.sol_in[56].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[56].sensor_type == 231, + "incorrect value for last_msg.msg.soln_meta.sol_in[56].sensor_type, " + "expected 231, is %d", + last_msg.msg.soln_meta.sol_in[56].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[57].flags == 190, + "incorrect value for last_msg.msg.soln_meta.sol_in[57].flags, expected " + "190, is %d", + last_msg.msg.soln_meta.sol_in[57].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[57].sensor_type == 191, + "incorrect value for last_msg.msg.soln_meta.sol_in[57].sensor_type, " + "expected 191, is %d", + last_msg.msg.soln_meta.sol_in[57].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[58].flags == 168, + "incorrect value for last_msg.msg.soln_meta.sol_in[58].flags, expected " + "168, is %d", + last_msg.msg.soln_meta.sol_in[58].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[58].sensor_type == 178, + "incorrect value for last_msg.msg.soln_meta.sol_in[58].sensor_type, " + "expected 178, is %d", + last_msg.msg.soln_meta.sol_in[58].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[59].flags == 233, + "incorrect value for last_msg.msg.soln_meta.sol_in[59].flags, expected " + "233, is %d", + last_msg.msg.soln_meta.sol_in[59].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[59].sensor_type == 89, + "incorrect value for last_msg.msg.soln_meta.sol_in[59].sensor_type, " + "expected 89, is %d", + last_msg.msg.soln_meta.sol_in[59].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[60].flags == 176, + "incorrect value for last_msg.msg.soln_meta.sol_in[60].flags, expected " + "176, is %d", + last_msg.msg.soln_meta.sol_in[60].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[60].sensor_type == 69, + "incorrect value for last_msg.msg.soln_meta.sol_in[60].sensor_type, " + "expected 69, is %d", + last_msg.msg.soln_meta.sol_in[60].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[61].flags == 140, + "incorrect value for last_msg.msg.soln_meta.sol_in[61].flags, expected " + "140, is %d", + last_msg.msg.soln_meta.sol_in[61].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[61].sensor_type == 174, + "incorrect value for last_msg.msg.soln_meta.sol_in[61].sensor_type, " + "expected 174, is %d", + last_msg.msg.soln_meta.sol_in[61].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[62].flags == 141, + "incorrect value for last_msg.msg.soln_meta.sol_in[62].flags, expected " + "141, is %d", + last_msg.msg.soln_meta.sol_in[62].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[62].sensor_type == 182, + "incorrect value for last_msg.msg.soln_meta.sol_in[62].sensor_type, " + "expected 182, is %d", + last_msg.msg.soln_meta.sol_in[62].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[63].flags == 82, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[63].flags, expected 82, is %d", + last_msg.msg.soln_meta.sol_in[63].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[63].sensor_type == 81, + "incorrect value for last_msg.msg.soln_meta.sol_in[63].sensor_type, " + "expected 81, is %d", + last_msg.msg.soln_meta.sol_in[63].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[64].flags == 79, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[64].flags, expected 79, is %d", + last_msg.msg.soln_meta.sol_in[64].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[64].sensor_type == 92, + "incorrect value for last_msg.msg.soln_meta.sol_in[64].sensor_type, " + "expected 92, is %d", + last_msg.msg.soln_meta.sol_in[64].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[65].flags == 223, + "incorrect value for last_msg.msg.soln_meta.sol_in[65].flags, expected " + "223, is %d", + last_msg.msg.soln_meta.sol_in[65].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[65].sensor_type == 101, + "incorrect value for last_msg.msg.soln_meta.sol_in[65].sensor_type, " + "expected 101, is %d", + last_msg.msg.soln_meta.sol_in[65].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[66].flags == 64, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[66].flags, expected 64, is %d", + last_msg.msg.soln_meta.sol_in[66].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[66].sensor_type == 100, + "incorrect value for last_msg.msg.soln_meta.sol_in[66].sensor_type, " + "expected 100, is %d", + last_msg.msg.soln_meta.sol_in[66].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[67].flags == 215, + "incorrect value for last_msg.msg.soln_meta.sol_in[67].flags, expected " + "215, is %d", + last_msg.msg.soln_meta.sol_in[67].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[67].sensor_type == 184, + "incorrect value for last_msg.msg.soln_meta.sol_in[67].sensor_type, " + "expected 184, is %d", + last_msg.msg.soln_meta.sol_in[67].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[68].flags == 37, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[68].flags, expected 37, is %d", + last_msg.msg.soln_meta.sol_in[68].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[68].sensor_type == 124, + "incorrect value for last_msg.msg.soln_meta.sol_in[68].sensor_type, " + "expected 124, is %d", + last_msg.msg.soln_meta.sol_in[68].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[69].flags == 227, + "incorrect value for last_msg.msg.soln_meta.sol_in[69].flags, expected " + "227, is %d", + last_msg.msg.soln_meta.sol_in[69].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[69].sensor_type == 21, + "incorrect value for last_msg.msg.soln_meta.sol_in[69].sensor_type, " + "expected 21, is %d", + last_msg.msg.soln_meta.sol_in[69].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[70].flags == 102, + "incorrect value for last_msg.msg.soln_meta.sol_in[70].flags, expected " + "102, is %d", + last_msg.msg.soln_meta.sol_in[70].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[70].sensor_type == 135, + "incorrect value for last_msg.msg.soln_meta.sol_in[70].sensor_type, " + "expected 135, is %d", + last_msg.msg.soln_meta.sol_in[70].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[71].flags == 36, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[71].flags, expected 36, is %d", + last_msg.msg.soln_meta.sol_in[71].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[71].sensor_type == 72, + "incorrect value for last_msg.msg.soln_meta.sol_in[71].sensor_type, " + "expected 72, is %d", + last_msg.msg.soln_meta.sol_in[71].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[72].flags == 56, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[72].flags, expected 56, is %d", + last_msg.msg.soln_meta.sol_in[72].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[72].sensor_type == 219, + "incorrect value for last_msg.msg.soln_meta.sol_in[72].sensor_type, " + "expected 219, is %d", + last_msg.msg.soln_meta.sol_in[72].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[73].flags == 90, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[73].flags, expected 90, is %d", + last_msg.msg.soln_meta.sol_in[73].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[73].sensor_type == 146, + "incorrect value for last_msg.msg.soln_meta.sol_in[73].sensor_type, " + "expected 146, is %d", + last_msg.msg.soln_meta.sol_in[73].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[74].flags == 104, + "incorrect value for last_msg.msg.soln_meta.sol_in[74].flags, expected " + "104, is %d", + last_msg.msg.soln_meta.sol_in[74].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[74].sensor_type == 219, + "incorrect value for last_msg.msg.soln_meta.sol_in[74].sensor_type, " + "expected 219, is %d", + last_msg.msg.soln_meta.sol_in[74].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[75].flags == 102, + "incorrect value for last_msg.msg.soln_meta.sol_in[75].flags, expected " + "102, is %d", + last_msg.msg.soln_meta.sol_in[75].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[75].sensor_type == 227, + "incorrect value for last_msg.msg.soln_meta.sol_in[75].sensor_type, " + "expected 227, is %d", + last_msg.msg.soln_meta.sol_in[75].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[76].flags == 12, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[76].flags, expected 12, is %d", + last_msg.msg.soln_meta.sol_in[76].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[76].sensor_type == 83, + "incorrect value for last_msg.msg.soln_meta.sol_in[76].sensor_type, " + "expected 83, is %d", + last_msg.msg.soln_meta.sol_in[76].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[77].flags == 122, + "incorrect value for last_msg.msg.soln_meta.sol_in[77].flags, expected " + "122, is %d", + last_msg.msg.soln_meta.sol_in[77].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[77].sensor_type == 41, + "incorrect value for last_msg.msg.soln_meta.sol_in[77].sensor_type, " + "expected 41, is %d", + last_msg.msg.soln_meta.sol_in[77].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[78].flags == 94, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[78].flags, expected 94, is %d", + last_msg.msg.soln_meta.sol_in[78].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[78].sensor_type == 173, + "incorrect value for last_msg.msg.soln_meta.sol_in[78].sensor_type, " + "expected 173, is %d", + last_msg.msg.soln_meta.sol_in[78].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[79].flags == 174, + "incorrect value for last_msg.msg.soln_meta.sol_in[79].flags, expected " + "174, is %d", + last_msg.msg.soln_meta.sol_in[79].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[79].sensor_type == 1, + "incorrect value for last_msg.msg.soln_meta.sol_in[79].sensor_type, " + "expected 1, is %d", + last_msg.msg.soln_meta.sol_in[79].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[80].flags == 130, + "incorrect value for last_msg.msg.soln_meta.sol_in[80].flags, expected " + "130, is %d", + last_msg.msg.soln_meta.sol_in[80].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[80].sensor_type == 134, + "incorrect value for last_msg.msg.soln_meta.sol_in[80].sensor_type, " + "expected 134, is %d", + last_msg.msg.soln_meta.sol_in[80].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[81].flags == 237, + "incorrect value for last_msg.msg.soln_meta.sol_in[81].flags, expected " + "237, is %d", + last_msg.msg.soln_meta.sol_in[81].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[81].sensor_type == 104, + "incorrect value for last_msg.msg.soln_meta.sol_in[81].sensor_type, " + "expected 104, is %d", + last_msg.msg.soln_meta.sol_in[81].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[82].flags == 249, + "incorrect value for last_msg.msg.soln_meta.sol_in[82].flags, expected " + "249, is %d", + last_msg.msg.soln_meta.sol_in[82].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[82].sensor_type == 116, + "incorrect value for last_msg.msg.soln_meta.sol_in[82].sensor_type, " + "expected 116, is %d", + last_msg.msg.soln_meta.sol_in[82].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[83].flags == 230, + "incorrect value for last_msg.msg.soln_meta.sol_in[83].flags, expected " + "230, is %d", + last_msg.msg.soln_meta.sol_in[83].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[83].sensor_type == 107, + "incorrect value for last_msg.msg.soln_meta.sol_in[83].sensor_type, " + "expected 107, is %d", + last_msg.msg.soln_meta.sol_in[83].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[84].flags == 123, + "incorrect value for last_msg.msg.soln_meta.sol_in[84].flags, expected " + "123, is %d", + last_msg.msg.soln_meta.sol_in[84].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[84].sensor_type == 130, + "incorrect value for last_msg.msg.soln_meta.sol_in[84].sensor_type, " + "expected 130, is %d", + last_msg.msg.soln_meta.sol_in[84].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[85].flags == 162, + "incorrect value for last_msg.msg.soln_meta.sol_in[85].flags, expected " + "162, is %d", + last_msg.msg.soln_meta.sol_in[85].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[85].sensor_type == 25, + "incorrect value for last_msg.msg.soln_meta.sol_in[85].sensor_type, " + "expected 25, is %d", + last_msg.msg.soln_meta.sol_in[85].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[86].flags == 223, + "incorrect value for last_msg.msg.soln_meta.sol_in[86].flags, expected " + "223, is %d", + last_msg.msg.soln_meta.sol_in[86].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[86].sensor_type == 57, + "incorrect value for last_msg.msg.soln_meta.sol_in[86].sensor_type, " + "expected 57, is %d", + last_msg.msg.soln_meta.sol_in[86].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[87].flags == 174, + "incorrect value for last_msg.msg.soln_meta.sol_in[87].flags, expected " + "174, is %d", + last_msg.msg.soln_meta.sol_in[87].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[87].sensor_type == 193, + "incorrect value for last_msg.msg.soln_meta.sol_in[87].sensor_type, " + "expected 193, is %d", + last_msg.msg.soln_meta.sol_in[87].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[88].flags == 193, + "incorrect value for last_msg.msg.soln_meta.sol_in[88].flags, expected " + "193, is %d", + last_msg.msg.soln_meta.sol_in[88].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[88].sensor_type == 146, + "incorrect value for last_msg.msg.soln_meta.sol_in[88].sensor_type, " + "expected 146, is %d", + last_msg.msg.soln_meta.sol_in[88].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[89].flags == 44, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[89].flags, expected 44, is %d", + last_msg.msg.soln_meta.sol_in[89].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[89].sensor_type == 239, + "incorrect value for last_msg.msg.soln_meta.sol_in[89].sensor_type, " + "expected 239, is %d", + last_msg.msg.soln_meta.sol_in[89].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[90].flags == 197, + "incorrect value for last_msg.msg.soln_meta.sol_in[90].flags, expected " + "197, is %d", + last_msg.msg.soln_meta.sol_in[90].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[90].sensor_type == 246, + "incorrect value for last_msg.msg.soln_meta.sol_in[90].sensor_type, " + "expected 246, is %d", + last_msg.msg.soln_meta.sol_in[90].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[91].flags == 80, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[91].flags, expected 80, is %d", + last_msg.msg.soln_meta.sol_in[91].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[91].sensor_type == 214, + "incorrect value for last_msg.msg.soln_meta.sol_in[91].sensor_type, " + "expected 214, is %d", + last_msg.msg.soln_meta.sol_in[91].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[92].flags == 100, + "incorrect value for last_msg.msg.soln_meta.sol_in[92].flags, expected " + "100, is %d", + last_msg.msg.soln_meta.sol_in[92].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[92].sensor_type == 83, + "incorrect value for last_msg.msg.soln_meta.sol_in[92].sensor_type, " + "expected 83, is %d", + last_msg.msg.soln_meta.sol_in[92].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[93].flags == 72, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[93].flags, expected 72, is %d", + last_msg.msg.soln_meta.sol_in[93].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[93].sensor_type == 66, + "incorrect value for last_msg.msg.soln_meta.sol_in[93].sensor_type, " + "expected 66, is %d", + last_msg.msg.soln_meta.sol_in[93].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[94].flags == 137, + "incorrect value for last_msg.msg.soln_meta.sol_in[94].flags, expected " + "137, is %d", + last_msg.msg.soln_meta.sol_in[94].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[94].sensor_type == 133, + "incorrect value for last_msg.msg.soln_meta.sol_in[94].sensor_type, " + "expected 133, is %d", + last_msg.msg.soln_meta.sol_in[94].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[95].flags == 82, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[95].flags, expected 82, is %d", + last_msg.msg.soln_meta.sol_in[95].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[95].sensor_type == 140, + "incorrect value for last_msg.msg.soln_meta.sol_in[95].sensor_type, " + "expected 140, is %d", + last_msg.msg.soln_meta.sol_in[95].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[96].flags == 2, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[96].flags, expected 2, is %d", + last_msg.msg.soln_meta.sol_in[96].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[96].sensor_type == 2, + "incorrect value for last_msg.msg.soln_meta.sol_in[96].sensor_type, " + "expected 2, is %d", + last_msg.msg.soln_meta.sol_in[96].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[97].flags == 9, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[97].flags, expected 9, is %d", + last_msg.msg.soln_meta.sol_in[97].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[97].sensor_type == 96, + "incorrect value for last_msg.msg.soln_meta.sol_in[97].sensor_type, " + "expected 96, is %d", + last_msg.msg.soln_meta.sol_in[97].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[98].flags == 158, + "incorrect value for last_msg.msg.soln_meta.sol_in[98].flags, expected " + "158, is %d", + last_msg.msg.soln_meta.sol_in[98].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[98].sensor_type == 96, + "incorrect value for last_msg.msg.soln_meta.sol_in[98].sensor_type, " + "expected 96, is %d", + last_msg.msg.soln_meta.sol_in[98].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.sol_in[99].flags == 97, + "incorrect value for " + "last_msg.msg.soln_meta.sol_in[99].flags, expected 97, is %d", + last_msg.msg.soln_meta.sol_in[99].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[99].sensor_type == 134, + "incorrect value for last_msg.msg.soln_meta.sol_in[99].sensor_type, " + "expected 134, is %d", + last_msg.msg.soln_meta.sol_in[99].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[100].flags == 129, + "incorrect value for last_msg.msg.soln_meta.sol_in[100].flags, " + "expected 129, is %d", + last_msg.msg.soln_meta.sol_in[100].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[100].sensor_type == 43, + "incorrect value for last_msg.msg.soln_meta.sol_in[100].sensor_type, " + "expected 43, is %d", + last_msg.msg.soln_meta.sol_in[100].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[101].flags == 25, + "incorrect value for last_msg.msg.soln_meta.sol_in[101].flags, " + "expected 25, is %d", + last_msg.msg.soln_meta.sol_in[101].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[101].sensor_type == 141, + "incorrect value for last_msg.msg.soln_meta.sol_in[101].sensor_type, " + "expected 141, is %d", + last_msg.msg.soln_meta.sol_in[101].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[102].flags == 200, + "incorrect value for last_msg.msg.soln_meta.sol_in[102].flags, " + "expected 200, is %d", + last_msg.msg.soln_meta.sol_in[102].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[102].sensor_type == 183, + "incorrect value for last_msg.msg.soln_meta.sol_in[102].sensor_type, " + "expected 183, is %d", + last_msg.msg.soln_meta.sol_in[102].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[103].flags == 57, + "incorrect value for last_msg.msg.soln_meta.sol_in[103].flags, " + "expected 57, is %d", + last_msg.msg.soln_meta.sol_in[103].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[103].sensor_type == 214, + "incorrect value for last_msg.msg.soln_meta.sol_in[103].sensor_type, " + "expected 214, is %d", + last_msg.msg.soln_meta.sol_in[103].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[104].flags == 103, + "incorrect value for last_msg.msg.soln_meta.sol_in[104].flags, " + "expected 103, is %d", + last_msg.msg.soln_meta.sol_in[104].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[104].sensor_type == 248, + "incorrect value for last_msg.msg.soln_meta.sol_in[104].sensor_type, " + "expected 248, is %d", + last_msg.msg.soln_meta.sol_in[104].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[105].flags == 65, + "incorrect value for last_msg.msg.soln_meta.sol_in[105].flags, " + "expected 65, is %d", + last_msg.msg.soln_meta.sol_in[105].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[105].sensor_type == 222, + "incorrect value for last_msg.msg.soln_meta.sol_in[105].sensor_type, " + "expected 222, is %d", + last_msg.msg.soln_meta.sol_in[105].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[106].flags == 15, + "incorrect value for last_msg.msg.soln_meta.sol_in[106].flags, " + "expected 15, is %d", + last_msg.msg.soln_meta.sol_in[106].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[106].sensor_type == 195, + "incorrect value for last_msg.msg.soln_meta.sol_in[106].sensor_type, " + "expected 195, is %d", + last_msg.msg.soln_meta.sol_in[106].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[107].flags == 21, + "incorrect value for last_msg.msg.soln_meta.sol_in[107].flags, " + "expected 21, is %d", + last_msg.msg.soln_meta.sol_in[107].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[107].sensor_type == 244, + "incorrect value for last_msg.msg.soln_meta.sol_in[107].sensor_type, " + "expected 244, is %d", + last_msg.msg.soln_meta.sol_in[107].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[108].flags == 46, + "incorrect value for last_msg.msg.soln_meta.sol_in[108].flags, " + "expected 46, is %d", + last_msg.msg.soln_meta.sol_in[108].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[108].sensor_type == 180, + "incorrect value for last_msg.msg.soln_meta.sol_in[108].sensor_type, " + "expected 180, is %d", + last_msg.msg.soln_meta.sol_in[108].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[109].flags == 130, + "incorrect value for last_msg.msg.soln_meta.sol_in[109].flags, " + "expected 130, is %d", + last_msg.msg.soln_meta.sol_in[109].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[109].sensor_type == 140, + "incorrect value for last_msg.msg.soln_meta.sol_in[109].sensor_type, " + "expected 140, is %d", + last_msg.msg.soln_meta.sol_in[109].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[110].flags == 17, + "incorrect value for last_msg.msg.soln_meta.sol_in[110].flags, " + "expected 17, is %d", + last_msg.msg.soln_meta.sol_in[110].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[110].sensor_type == 36, + "incorrect value for last_msg.msg.soln_meta.sol_in[110].sensor_type, " + "expected 36, is %d", + last_msg.msg.soln_meta.sol_in[110].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[111].flags == 209, + "incorrect value for last_msg.msg.soln_meta.sol_in[111].flags, " + "expected 209, is %d", + last_msg.msg.soln_meta.sol_in[111].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[111].sensor_type == 194, + "incorrect value for last_msg.msg.soln_meta.sol_in[111].sensor_type, " + "expected 194, is %d", + last_msg.msg.soln_meta.sol_in[111].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[112].flags == 254, + "incorrect value for last_msg.msg.soln_meta.sol_in[112].flags, " + "expected 254, is %d", + last_msg.msg.soln_meta.sol_in[112].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[112].sensor_type == 65, + "incorrect value for last_msg.msg.soln_meta.sol_in[112].sensor_type, " + "expected 65, is %d", + last_msg.msg.soln_meta.sol_in[112].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[113].flags == 103, + "incorrect value for last_msg.msg.soln_meta.sol_in[113].flags, " + "expected 103, is %d", + last_msg.msg.soln_meta.sol_in[113].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[113].sensor_type == 115, + "incorrect value for last_msg.msg.soln_meta.sol_in[113].sensor_type, " + "expected 115, is %d", + last_msg.msg.soln_meta.sol_in[113].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[114].flags == 129, + "incorrect value for last_msg.msg.soln_meta.sol_in[114].flags, " + "expected 129, is %d", + last_msg.msg.soln_meta.sol_in[114].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[114].sensor_type == 152, + "incorrect value for last_msg.msg.soln_meta.sol_in[114].sensor_type, " + "expected 152, is %d", + last_msg.msg.soln_meta.sol_in[114].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[115].flags == 235, + "incorrect value for last_msg.msg.soln_meta.sol_in[115].flags, " + "expected 235, is %d", + last_msg.msg.soln_meta.sol_in[115].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[115].sensor_type == 234, + "incorrect value for last_msg.msg.soln_meta.sol_in[115].sensor_type, " + "expected 234, is %d", + last_msg.msg.soln_meta.sol_in[115].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[116].flags == 234, + "incorrect value for last_msg.msg.soln_meta.sol_in[116].flags, " + "expected 234, is %d", + last_msg.msg.soln_meta.sol_in[116].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[116].sensor_type == 194, + "incorrect value for last_msg.msg.soln_meta.sol_in[116].sensor_type, " + "expected 194, is %d", + last_msg.msg.soln_meta.sol_in[116].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[117].flags == 201, + "incorrect value for last_msg.msg.soln_meta.sol_in[117].flags, " + "expected 201, is %d", + last_msg.msg.soln_meta.sol_in[117].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[117].sensor_type == 170, + "incorrect value for last_msg.msg.soln_meta.sol_in[117].sensor_type, " + "expected 170, is %d", + last_msg.msg.soln_meta.sol_in[117].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[118].flags == 154, + "incorrect value for last_msg.msg.soln_meta.sol_in[118].flags, " + "expected 154, is %d", + last_msg.msg.soln_meta.sol_in[118].flags); + + ck_assert_msg( + last_msg.msg.soln_meta.sol_in[118].sensor_type == 210, + "incorrect value for last_msg.msg.soln_meta.sol_in[118].sensor_type, " + "expected 210, is %d", + last_msg.msg.soln_meta.sol_in[118].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta.tow == 3628191792, + "incorrect value for last_msg.msg.soln_meta.tow, expected " + "3628191792, is %d", + last_msg.msg.soln_meta.tow); + + ck_assert_msg(last_msg.msg.soln_meta.vdop == 58512, + "incorrect value for last_msg.msg.soln_meta.vdop, expected " + "58512, is %d", + last_msg.msg.soln_meta.vdop); } } END_TEST -Suite* auto_check_sbp_solution_meta_MsgSolnMeta_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_solution_meta_MsgSolnMeta"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_solution_meta_MsgSolnMeta"); +Suite *auto_check_sbp_solution_meta_MsgSolnMeta_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_solution_meta_MsgSolnMeta"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_solution_meta_MsgSolnMeta"); tcase_add_test(tc_acq, test_auto_check_sbp_solution_meta_MsgSolnMeta); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_solution_meta_MsgSolnMetaDepA.c b/c/test/auto_check_sbp_solution_meta_MsgSolnMetaDepA.c index 4b2eb5341..6261f43ec 100644 --- a/c/test/auto_check_sbp_solution_meta_MsgSolnMetaDepA.c +++ b/c/test/auto_check_sbp_solution_meta_MsgSolnMetaDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMetaDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMetaDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_solution_meta_MsgSolnMetaDepA ) -{ +START_TEST(test_auto_check_sbp_solution_meta_MsgSolnMetaDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_solution_meta_MsgSolnMetaDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,1143 +90,2025 @@ START_TEST( test_auto_check_sbp_solution_meta_MsgSolnMetaDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0xff0f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xff0f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,15,255,84,241,254,183,222,157,121,5,164,238,31,190,115,93,59,103,36,83,161,156,46,253,67,87,200,39,250,245,242,228,72,18,222,11,88,207,218,231,13,226,224,22,196,21,242,12,89,71,219,182,85,145,204,146,40,204,51,21,153,227,44,15,28,255,39,205,216,240,190,93,219,103,42,41,182,76,222,17,23,125,31,18,229,28,47,214,25,100,84,106,72,48,10,222,232,235,73,109,163,51,152,133,235,87,70,2,108,91,101,200,55,24,156,233,73,39,66,97,140,252,227,230,237,135,241,245,205,70,0,219,188,107,136,178,58,1,29,44,213,225,147,190,96,192,108,228,15,203,18,3,222,180,68,101,229,223,203,243,164,92,165,220,159,174,121,112,167,240,40,59,3,230,52,149,148,218,142,212,109,176,71,179,172,77,1,193,70,147,149,23,144,148,239,195,186,86,30,34,143,156,207,63,55,117,255,222,222,219,145,224,191,210,109,86,153,21,32,226,10,60,63,106,236,93,96,30,163,106,238,147,133,132,107,152,214,221,185,202,21,252,51,130,59,166,202,127,170,58,193,215,125,22,58,135,47,88,142,77,211, }; + u8 encoded_frame[] = { + 85, 15, 255, 84, 241, 254, 183, 222, 157, 121, 5, 164, 238, 31, + 190, 115, 93, 59, 103, 36, 83, 161, 156, 46, 253, 67, 87, 200, + 39, 250, 245, 242, 228, 72, 18, 222, 11, 88, 207, 218, 231, 13, + 226, 224, 22, 196, 21, 242, 12, 89, 71, 219, 182, 85, 145, 204, + 146, 40, 204, 51, 21, 153, 227, 44, 15, 28, 255, 39, 205, 216, + 240, 190, 93, 219, 103, 42, 41, 182, 76, 222, 17, 23, 125, 31, + 18, 229, 28, 47, 214, 25, 100, 84, 106, 72, 48, 10, 222, 232, + 235, 73, 109, 163, 51, 152, 133, 235, 87, 70, 2, 108, 91, 101, + 200, 55, 24, 156, 233, 73, 39, 66, 97, 140, 252, 227, 230, 237, + 135, 241, 245, 205, 70, 0, 219, 188, 107, 136, 178, 58, 1, 29, + 44, 213, 225, 147, 190, 96, 192, 108, 228, 15, 203, 18, 3, 222, + 180, 68, 101, 229, 223, 203, 243, 164, 92, 165, 220, 159, 174, 121, + 112, 167, 240, 40, 59, 3, 230, 52, 149, 148, 218, 142, 212, 109, + 176, 71, 179, 172, 77, 1, 193, 70, 147, 149, 23, 144, 148, 239, + 195, 186, 86, 30, 34, 143, 156, 207, 63, 55, 117, 255, 222, 222, + 219, 145, 224, 191, 210, 109, 86, 153, 21, 32, 226, 10, 60, 63, + 106, 236, 93, 96, 30, 163, 106, 238, 147, 133, 132, 107, 152, 214, + 221, 185, 202, 21, 252, 51, 130, 59, 166, 202, 127, 170, 58, 193, + 215, 125, 22, 58, 135, 47, 88, 142, 77, 211, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.soln_meta_dep_a.age_corrections = 48671; - + test_msg.soln_meta_dep_a.alignment_status = 115; - + test_msg.soln_meta_dep_a.hdop = 31133; - + test_msg.soln_meta_dep_a.last_used_gnss_pos_tow = 610745181; - + test_msg.soln_meta_dep_a.last_used_gnss_vel_tow = 782016851; - + test_msg.soln_meta_dep_a.n_sats = 238; - + test_msg.soln_meta_dep_a.n_sol_in = 118; - + test_msg.soln_meta_dep_a.pdop = 57015; - - - + test_msg.soln_meta_dep_a.sol_in[0].flags = 67; - + test_msg.soln_meta_dep_a.sol_in[0].sensor_type = 253; - - + test_msg.soln_meta_dep_a.sol_in[1].flags = 200; - + test_msg.soln_meta_dep_a.sol_in[1].sensor_type = 87; - - + test_msg.soln_meta_dep_a.sol_in[2].flags = 250; - + test_msg.soln_meta_dep_a.sol_in[2].sensor_type = 39; - - + test_msg.soln_meta_dep_a.sol_in[3].flags = 242; - + test_msg.soln_meta_dep_a.sol_in[3].sensor_type = 245; - - + test_msg.soln_meta_dep_a.sol_in[4].flags = 72; - + test_msg.soln_meta_dep_a.sol_in[4].sensor_type = 228; - - + test_msg.soln_meta_dep_a.sol_in[5].flags = 222; - + test_msg.soln_meta_dep_a.sol_in[5].sensor_type = 18; - - + test_msg.soln_meta_dep_a.sol_in[6].flags = 88; - + test_msg.soln_meta_dep_a.sol_in[6].sensor_type = 11; - - + test_msg.soln_meta_dep_a.sol_in[7].flags = 218; - + test_msg.soln_meta_dep_a.sol_in[7].sensor_type = 207; - - + test_msg.soln_meta_dep_a.sol_in[8].flags = 13; - + test_msg.soln_meta_dep_a.sol_in[8].sensor_type = 231; - - + test_msg.soln_meta_dep_a.sol_in[9].flags = 224; - + test_msg.soln_meta_dep_a.sol_in[9].sensor_type = 226; - - + test_msg.soln_meta_dep_a.sol_in[10].flags = 196; - + test_msg.soln_meta_dep_a.sol_in[10].sensor_type = 22; - - + test_msg.soln_meta_dep_a.sol_in[11].flags = 242; - + test_msg.soln_meta_dep_a.sol_in[11].sensor_type = 21; - - + test_msg.soln_meta_dep_a.sol_in[12].flags = 89; - + test_msg.soln_meta_dep_a.sol_in[12].sensor_type = 12; - - + test_msg.soln_meta_dep_a.sol_in[13].flags = 219; - + test_msg.soln_meta_dep_a.sol_in[13].sensor_type = 71; - - + test_msg.soln_meta_dep_a.sol_in[14].flags = 85; - + test_msg.soln_meta_dep_a.sol_in[14].sensor_type = 182; - - + test_msg.soln_meta_dep_a.sol_in[15].flags = 204; - + test_msg.soln_meta_dep_a.sol_in[15].sensor_type = 145; - - + test_msg.soln_meta_dep_a.sol_in[16].flags = 40; - + test_msg.soln_meta_dep_a.sol_in[16].sensor_type = 146; - - + test_msg.soln_meta_dep_a.sol_in[17].flags = 51; - + test_msg.soln_meta_dep_a.sol_in[17].sensor_type = 204; - - + test_msg.soln_meta_dep_a.sol_in[18].flags = 153; - + test_msg.soln_meta_dep_a.sol_in[18].sensor_type = 21; - - + test_msg.soln_meta_dep_a.sol_in[19].flags = 44; - + test_msg.soln_meta_dep_a.sol_in[19].sensor_type = 227; - - + test_msg.soln_meta_dep_a.sol_in[20].flags = 28; - + test_msg.soln_meta_dep_a.sol_in[20].sensor_type = 15; - - + test_msg.soln_meta_dep_a.sol_in[21].flags = 39; - + test_msg.soln_meta_dep_a.sol_in[21].sensor_type = 255; - - + test_msg.soln_meta_dep_a.sol_in[22].flags = 216; - + test_msg.soln_meta_dep_a.sol_in[22].sensor_type = 205; - - + test_msg.soln_meta_dep_a.sol_in[23].flags = 190; - + test_msg.soln_meta_dep_a.sol_in[23].sensor_type = 240; - - + test_msg.soln_meta_dep_a.sol_in[24].flags = 219; - + test_msg.soln_meta_dep_a.sol_in[24].sensor_type = 93; - - + test_msg.soln_meta_dep_a.sol_in[25].flags = 42; - + test_msg.soln_meta_dep_a.sol_in[25].sensor_type = 103; - - + test_msg.soln_meta_dep_a.sol_in[26].flags = 182; - + test_msg.soln_meta_dep_a.sol_in[26].sensor_type = 41; - - + test_msg.soln_meta_dep_a.sol_in[27].flags = 222; - + test_msg.soln_meta_dep_a.sol_in[27].sensor_type = 76; - - + test_msg.soln_meta_dep_a.sol_in[28].flags = 23; - + test_msg.soln_meta_dep_a.sol_in[28].sensor_type = 17; - - + test_msg.soln_meta_dep_a.sol_in[29].flags = 31; - + test_msg.soln_meta_dep_a.sol_in[29].sensor_type = 125; - - + test_msg.soln_meta_dep_a.sol_in[30].flags = 229; - + test_msg.soln_meta_dep_a.sol_in[30].sensor_type = 18; - - + test_msg.soln_meta_dep_a.sol_in[31].flags = 47; - + test_msg.soln_meta_dep_a.sol_in[31].sensor_type = 28; - - + test_msg.soln_meta_dep_a.sol_in[32].flags = 25; - + test_msg.soln_meta_dep_a.sol_in[32].sensor_type = 214; - - + test_msg.soln_meta_dep_a.sol_in[33].flags = 84; - + test_msg.soln_meta_dep_a.sol_in[33].sensor_type = 100; - - + test_msg.soln_meta_dep_a.sol_in[34].flags = 72; - + test_msg.soln_meta_dep_a.sol_in[34].sensor_type = 106; - - + test_msg.soln_meta_dep_a.sol_in[35].flags = 10; - + test_msg.soln_meta_dep_a.sol_in[35].sensor_type = 48; - - + test_msg.soln_meta_dep_a.sol_in[36].flags = 232; - + test_msg.soln_meta_dep_a.sol_in[36].sensor_type = 222; - - + test_msg.soln_meta_dep_a.sol_in[37].flags = 73; - + test_msg.soln_meta_dep_a.sol_in[37].sensor_type = 235; - - + test_msg.soln_meta_dep_a.sol_in[38].flags = 163; - + test_msg.soln_meta_dep_a.sol_in[38].sensor_type = 109; - - + test_msg.soln_meta_dep_a.sol_in[39].flags = 152; - + test_msg.soln_meta_dep_a.sol_in[39].sensor_type = 51; - - + test_msg.soln_meta_dep_a.sol_in[40].flags = 235; - + test_msg.soln_meta_dep_a.sol_in[40].sensor_type = 133; - - + test_msg.soln_meta_dep_a.sol_in[41].flags = 70; - + test_msg.soln_meta_dep_a.sol_in[41].sensor_type = 87; - - + test_msg.soln_meta_dep_a.sol_in[42].flags = 108; - + test_msg.soln_meta_dep_a.sol_in[42].sensor_type = 2; - - + test_msg.soln_meta_dep_a.sol_in[43].flags = 101; - + test_msg.soln_meta_dep_a.sol_in[43].sensor_type = 91; - - + test_msg.soln_meta_dep_a.sol_in[44].flags = 55; - + test_msg.soln_meta_dep_a.sol_in[44].sensor_type = 200; - - + test_msg.soln_meta_dep_a.sol_in[45].flags = 156; - + test_msg.soln_meta_dep_a.sol_in[45].sensor_type = 24; - - + test_msg.soln_meta_dep_a.sol_in[46].flags = 73; - + test_msg.soln_meta_dep_a.sol_in[46].sensor_type = 233; - - + test_msg.soln_meta_dep_a.sol_in[47].flags = 66; - + test_msg.soln_meta_dep_a.sol_in[47].sensor_type = 39; - - + test_msg.soln_meta_dep_a.sol_in[48].flags = 140; - + test_msg.soln_meta_dep_a.sol_in[48].sensor_type = 97; - - + test_msg.soln_meta_dep_a.sol_in[49].flags = 227; - + test_msg.soln_meta_dep_a.sol_in[49].sensor_type = 252; - - + test_msg.soln_meta_dep_a.sol_in[50].flags = 237; - + test_msg.soln_meta_dep_a.sol_in[50].sensor_type = 230; - - + test_msg.soln_meta_dep_a.sol_in[51].flags = 241; - + test_msg.soln_meta_dep_a.sol_in[51].sensor_type = 135; - - + test_msg.soln_meta_dep_a.sol_in[52].flags = 205; - + test_msg.soln_meta_dep_a.sol_in[52].sensor_type = 245; - - + test_msg.soln_meta_dep_a.sol_in[53].flags = 0; - + test_msg.soln_meta_dep_a.sol_in[53].sensor_type = 70; - - + test_msg.soln_meta_dep_a.sol_in[54].flags = 188; - + test_msg.soln_meta_dep_a.sol_in[54].sensor_type = 219; - - + test_msg.soln_meta_dep_a.sol_in[55].flags = 136; - + test_msg.soln_meta_dep_a.sol_in[55].sensor_type = 107; - - + test_msg.soln_meta_dep_a.sol_in[56].flags = 58; - + test_msg.soln_meta_dep_a.sol_in[56].sensor_type = 178; - - + test_msg.soln_meta_dep_a.sol_in[57].flags = 29; - + test_msg.soln_meta_dep_a.sol_in[57].sensor_type = 1; - - + test_msg.soln_meta_dep_a.sol_in[58].flags = 213; - + test_msg.soln_meta_dep_a.sol_in[58].sensor_type = 44; - - + test_msg.soln_meta_dep_a.sol_in[59].flags = 147; - + test_msg.soln_meta_dep_a.sol_in[59].sensor_type = 225; - - + test_msg.soln_meta_dep_a.sol_in[60].flags = 96; - + test_msg.soln_meta_dep_a.sol_in[60].sensor_type = 190; - - + test_msg.soln_meta_dep_a.sol_in[61].flags = 108; - + test_msg.soln_meta_dep_a.sol_in[61].sensor_type = 192; - - + test_msg.soln_meta_dep_a.sol_in[62].flags = 15; - + test_msg.soln_meta_dep_a.sol_in[62].sensor_type = 228; - - + test_msg.soln_meta_dep_a.sol_in[63].flags = 18; - + test_msg.soln_meta_dep_a.sol_in[63].sensor_type = 203; - - + test_msg.soln_meta_dep_a.sol_in[64].flags = 222; - + test_msg.soln_meta_dep_a.sol_in[64].sensor_type = 3; - - + test_msg.soln_meta_dep_a.sol_in[65].flags = 68; - + test_msg.soln_meta_dep_a.sol_in[65].sensor_type = 180; - - + test_msg.soln_meta_dep_a.sol_in[66].flags = 229; - + test_msg.soln_meta_dep_a.sol_in[66].sensor_type = 101; - - + test_msg.soln_meta_dep_a.sol_in[67].flags = 203; - + test_msg.soln_meta_dep_a.sol_in[67].sensor_type = 223; - - + test_msg.soln_meta_dep_a.sol_in[68].flags = 164; - + test_msg.soln_meta_dep_a.sol_in[68].sensor_type = 243; - - + test_msg.soln_meta_dep_a.sol_in[69].flags = 165; - + test_msg.soln_meta_dep_a.sol_in[69].sensor_type = 92; - - + test_msg.soln_meta_dep_a.sol_in[70].flags = 159; - + test_msg.soln_meta_dep_a.sol_in[70].sensor_type = 220; - - + test_msg.soln_meta_dep_a.sol_in[71].flags = 121; - + test_msg.soln_meta_dep_a.sol_in[71].sensor_type = 174; - - + test_msg.soln_meta_dep_a.sol_in[72].flags = 167; - + test_msg.soln_meta_dep_a.sol_in[72].sensor_type = 112; - - + test_msg.soln_meta_dep_a.sol_in[73].flags = 40; - + test_msg.soln_meta_dep_a.sol_in[73].sensor_type = 240; - - + test_msg.soln_meta_dep_a.sol_in[74].flags = 3; - + test_msg.soln_meta_dep_a.sol_in[74].sensor_type = 59; - - + test_msg.soln_meta_dep_a.sol_in[75].flags = 52; - + test_msg.soln_meta_dep_a.sol_in[75].sensor_type = 230; - - + test_msg.soln_meta_dep_a.sol_in[76].flags = 148; - + test_msg.soln_meta_dep_a.sol_in[76].sensor_type = 149; - - + test_msg.soln_meta_dep_a.sol_in[77].flags = 142; - + test_msg.soln_meta_dep_a.sol_in[77].sensor_type = 218; - - + test_msg.soln_meta_dep_a.sol_in[78].flags = 109; - + test_msg.soln_meta_dep_a.sol_in[78].sensor_type = 212; - - + test_msg.soln_meta_dep_a.sol_in[79].flags = 71; - + test_msg.soln_meta_dep_a.sol_in[79].sensor_type = 176; - - + test_msg.soln_meta_dep_a.sol_in[80].flags = 172; - + test_msg.soln_meta_dep_a.sol_in[80].sensor_type = 179; - - + test_msg.soln_meta_dep_a.sol_in[81].flags = 1; - + test_msg.soln_meta_dep_a.sol_in[81].sensor_type = 77; - - + test_msg.soln_meta_dep_a.sol_in[82].flags = 70; - + test_msg.soln_meta_dep_a.sol_in[82].sensor_type = 193; - - + test_msg.soln_meta_dep_a.sol_in[83].flags = 149; - + test_msg.soln_meta_dep_a.sol_in[83].sensor_type = 147; - - + test_msg.soln_meta_dep_a.sol_in[84].flags = 144; - + test_msg.soln_meta_dep_a.sol_in[84].sensor_type = 23; - - + test_msg.soln_meta_dep_a.sol_in[85].flags = 239; - + test_msg.soln_meta_dep_a.sol_in[85].sensor_type = 148; - - + test_msg.soln_meta_dep_a.sol_in[86].flags = 186; - + test_msg.soln_meta_dep_a.sol_in[86].sensor_type = 195; - - + test_msg.soln_meta_dep_a.sol_in[87].flags = 30; - + test_msg.soln_meta_dep_a.sol_in[87].sensor_type = 86; - - + test_msg.soln_meta_dep_a.sol_in[88].flags = 143; - + test_msg.soln_meta_dep_a.sol_in[88].sensor_type = 34; - - + test_msg.soln_meta_dep_a.sol_in[89].flags = 207; - + test_msg.soln_meta_dep_a.sol_in[89].sensor_type = 156; - - + test_msg.soln_meta_dep_a.sol_in[90].flags = 55; - + test_msg.soln_meta_dep_a.sol_in[90].sensor_type = 63; - - + test_msg.soln_meta_dep_a.sol_in[91].flags = 255; - + test_msg.soln_meta_dep_a.sol_in[91].sensor_type = 117; - - + test_msg.soln_meta_dep_a.sol_in[92].flags = 222; - + test_msg.soln_meta_dep_a.sol_in[92].sensor_type = 222; - - + test_msg.soln_meta_dep_a.sol_in[93].flags = 145; - + test_msg.soln_meta_dep_a.sol_in[93].sensor_type = 219; - - + test_msg.soln_meta_dep_a.sol_in[94].flags = 191; - + test_msg.soln_meta_dep_a.sol_in[94].sensor_type = 224; - - + test_msg.soln_meta_dep_a.sol_in[95].flags = 109; - + test_msg.soln_meta_dep_a.sol_in[95].sensor_type = 210; - - + test_msg.soln_meta_dep_a.sol_in[96].flags = 153; - + test_msg.soln_meta_dep_a.sol_in[96].sensor_type = 86; - - + test_msg.soln_meta_dep_a.sol_in[97].flags = 32; - + test_msg.soln_meta_dep_a.sol_in[97].sensor_type = 21; - - + test_msg.soln_meta_dep_a.sol_in[98].flags = 10; - + test_msg.soln_meta_dep_a.sol_in[98].sensor_type = 226; - - + test_msg.soln_meta_dep_a.sol_in[99].flags = 63; - + test_msg.soln_meta_dep_a.sol_in[99].sensor_type = 60; - - + test_msg.soln_meta_dep_a.sol_in[100].flags = 236; - + test_msg.soln_meta_dep_a.sol_in[100].sensor_type = 106; - - + test_msg.soln_meta_dep_a.sol_in[101].flags = 96; - + test_msg.soln_meta_dep_a.sol_in[101].sensor_type = 93; - - + test_msg.soln_meta_dep_a.sol_in[102].flags = 163; - + test_msg.soln_meta_dep_a.sol_in[102].sensor_type = 30; - - + test_msg.soln_meta_dep_a.sol_in[103].flags = 238; - + test_msg.soln_meta_dep_a.sol_in[103].sensor_type = 106; - - + test_msg.soln_meta_dep_a.sol_in[104].flags = 133; - + test_msg.soln_meta_dep_a.sol_in[104].sensor_type = 147; - - + test_msg.soln_meta_dep_a.sol_in[105].flags = 107; - + test_msg.soln_meta_dep_a.sol_in[105].sensor_type = 132; - - + test_msg.soln_meta_dep_a.sol_in[106].flags = 214; - + test_msg.soln_meta_dep_a.sol_in[106].sensor_type = 152; - - + test_msg.soln_meta_dep_a.sol_in[107].flags = 185; - + test_msg.soln_meta_dep_a.sol_in[107].sensor_type = 221; - - + test_msg.soln_meta_dep_a.sol_in[108].flags = 21; - + test_msg.soln_meta_dep_a.sol_in[108].sensor_type = 202; - - + test_msg.soln_meta_dep_a.sol_in[109].flags = 51; - + test_msg.soln_meta_dep_a.sol_in[109].sensor_type = 252; - - + test_msg.soln_meta_dep_a.sol_in[110].flags = 59; - + test_msg.soln_meta_dep_a.sol_in[110].sensor_type = 130; - - + test_msg.soln_meta_dep_a.sol_in[111].flags = 202; - + test_msg.soln_meta_dep_a.sol_in[111].sensor_type = 166; - - + test_msg.soln_meta_dep_a.sol_in[112].flags = 170; - + test_msg.soln_meta_dep_a.sol_in[112].sensor_type = 127; - - + test_msg.soln_meta_dep_a.sol_in[113].flags = 193; - + test_msg.soln_meta_dep_a.sol_in[113].sensor_type = 58; - - + test_msg.soln_meta_dep_a.sol_in[114].flags = 125; - + test_msg.soln_meta_dep_a.sol_in[114].sensor_type = 215; - - + test_msg.soln_meta_dep_a.sol_in[115].flags = 58; - + test_msg.soln_meta_dep_a.sol_in[115].sensor_type = 22; - - + test_msg.soln_meta_dep_a.sol_in[116].flags = 47; - + test_msg.soln_meta_dep_a.sol_in[116].sensor_type = 135; - - + test_msg.soln_meta_dep_a.sol_in[117].flags = 142; - + test_msg.soln_meta_dep_a.sol_in[117].sensor_type = 88; - + test_msg.soln_meta_dep_a.vdop = 41989; - sbp_message_send(&sbp_state, SbpMsgSolnMetaDepA, 61780, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSolnMetaDepA, 61780, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61780, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSolnMetaDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSolnMetaDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.age_corrections == 48671, "incorrect value for last_msg.msg.soln_meta_dep_a.age_corrections, expected 48671, is %d", last_msg.msg.soln_meta_dep_a.age_corrections); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.alignment_status == 115, "incorrect value for last_msg.msg.soln_meta_dep_a.alignment_status, expected 115, is %d", last_msg.msg.soln_meta_dep_a.alignment_status); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.hdop == 31133, "incorrect value for last_msg.msg.soln_meta_dep_a.hdop, expected 31133, is %d", last_msg.msg.soln_meta_dep_a.hdop); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.last_used_gnss_pos_tow == 610745181, "incorrect value for last_msg.msg.soln_meta_dep_a.last_used_gnss_pos_tow, expected 610745181, is %d", last_msg.msg.soln_meta_dep_a.last_used_gnss_pos_tow); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.last_used_gnss_vel_tow == 782016851, "incorrect value for last_msg.msg.soln_meta_dep_a.last_used_gnss_vel_tow, expected 782016851, is %d", last_msg.msg.soln_meta_dep_a.last_used_gnss_vel_tow); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.n_sats == 238, "incorrect value for last_msg.msg.soln_meta_dep_a.n_sats, expected 238, is %d", last_msg.msg.soln_meta_dep_a.n_sats); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.n_sol_in == 118, "incorrect value for last_msg.msg.soln_meta_dep_a.n_sol_in, expected 118, is %d", last_msg.msg.soln_meta_dep_a.n_sol_in); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.pdop == 57015, "incorrect value for last_msg.msg.soln_meta_dep_a.pdop, expected 57015, is %d", last_msg.msg.soln_meta_dep_a.pdop); - - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[0].flags == 67, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[0].flags, expected 67, is %d", last_msg.msg.soln_meta_dep_a.sol_in[0].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[0].sensor_type == 253, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[0].sensor_type, expected 253, is %d", last_msg.msg.soln_meta_dep_a.sol_in[0].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[1].flags == 200, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[1].flags, expected 200, is %d", last_msg.msg.soln_meta_dep_a.sol_in[1].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[1].sensor_type == 87, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[1].sensor_type, expected 87, is %d", last_msg.msg.soln_meta_dep_a.sol_in[1].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[2].flags == 250, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[2].flags, expected 250, is %d", last_msg.msg.soln_meta_dep_a.sol_in[2].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[2].sensor_type == 39, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[2].sensor_type, expected 39, is %d", last_msg.msg.soln_meta_dep_a.sol_in[2].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[3].flags == 242, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[3].flags, expected 242, is %d", last_msg.msg.soln_meta_dep_a.sol_in[3].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[3].sensor_type == 245, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[3].sensor_type, expected 245, is %d", last_msg.msg.soln_meta_dep_a.sol_in[3].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[4].flags == 72, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[4].flags, expected 72, is %d", last_msg.msg.soln_meta_dep_a.sol_in[4].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[4].sensor_type == 228, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[4].sensor_type, expected 228, is %d", last_msg.msg.soln_meta_dep_a.sol_in[4].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[5].flags == 222, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[5].flags, expected 222, is %d", last_msg.msg.soln_meta_dep_a.sol_in[5].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[5].sensor_type == 18, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[5].sensor_type, expected 18, is %d", last_msg.msg.soln_meta_dep_a.sol_in[5].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[6].flags == 88, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[6].flags, expected 88, is %d", last_msg.msg.soln_meta_dep_a.sol_in[6].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[6].sensor_type == 11, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[6].sensor_type, expected 11, is %d", last_msg.msg.soln_meta_dep_a.sol_in[6].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[7].flags == 218, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[7].flags, expected 218, is %d", last_msg.msg.soln_meta_dep_a.sol_in[7].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[7].sensor_type == 207, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[7].sensor_type, expected 207, is %d", last_msg.msg.soln_meta_dep_a.sol_in[7].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[8].flags == 13, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[8].flags, expected 13, is %d", last_msg.msg.soln_meta_dep_a.sol_in[8].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[8].sensor_type == 231, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[8].sensor_type, expected 231, is %d", last_msg.msg.soln_meta_dep_a.sol_in[8].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[9].flags == 224, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[9].flags, expected 224, is %d", last_msg.msg.soln_meta_dep_a.sol_in[9].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[9].sensor_type == 226, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[9].sensor_type, expected 226, is %d", last_msg.msg.soln_meta_dep_a.sol_in[9].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[10].flags == 196, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[10].flags, expected 196, is %d", last_msg.msg.soln_meta_dep_a.sol_in[10].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[10].sensor_type == 22, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[10].sensor_type, expected 22, is %d", last_msg.msg.soln_meta_dep_a.sol_in[10].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[11].flags == 242, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[11].flags, expected 242, is %d", last_msg.msg.soln_meta_dep_a.sol_in[11].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[11].sensor_type == 21, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[11].sensor_type, expected 21, is %d", last_msg.msg.soln_meta_dep_a.sol_in[11].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[12].flags == 89, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[12].flags, expected 89, is %d", last_msg.msg.soln_meta_dep_a.sol_in[12].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[12].sensor_type == 12, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[12].sensor_type, expected 12, is %d", last_msg.msg.soln_meta_dep_a.sol_in[12].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[13].flags == 219, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[13].flags, expected 219, is %d", last_msg.msg.soln_meta_dep_a.sol_in[13].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[13].sensor_type == 71, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[13].sensor_type, expected 71, is %d", last_msg.msg.soln_meta_dep_a.sol_in[13].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[14].flags == 85, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[14].flags, expected 85, is %d", last_msg.msg.soln_meta_dep_a.sol_in[14].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[14].sensor_type == 182, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[14].sensor_type, expected 182, is %d", last_msg.msg.soln_meta_dep_a.sol_in[14].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[15].flags == 204, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[15].flags, expected 204, is %d", last_msg.msg.soln_meta_dep_a.sol_in[15].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[15].sensor_type == 145, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[15].sensor_type, expected 145, is %d", last_msg.msg.soln_meta_dep_a.sol_in[15].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[16].flags == 40, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[16].flags, expected 40, is %d", last_msg.msg.soln_meta_dep_a.sol_in[16].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[16].sensor_type == 146, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[16].sensor_type, expected 146, is %d", last_msg.msg.soln_meta_dep_a.sol_in[16].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[17].flags == 51, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[17].flags, expected 51, is %d", last_msg.msg.soln_meta_dep_a.sol_in[17].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[17].sensor_type == 204, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[17].sensor_type, expected 204, is %d", last_msg.msg.soln_meta_dep_a.sol_in[17].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[18].flags == 153, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[18].flags, expected 153, is %d", last_msg.msg.soln_meta_dep_a.sol_in[18].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[18].sensor_type == 21, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[18].sensor_type, expected 21, is %d", last_msg.msg.soln_meta_dep_a.sol_in[18].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[19].flags == 44, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[19].flags, expected 44, is %d", last_msg.msg.soln_meta_dep_a.sol_in[19].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[19].sensor_type == 227, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[19].sensor_type, expected 227, is %d", last_msg.msg.soln_meta_dep_a.sol_in[19].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[20].flags == 28, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[20].flags, expected 28, is %d", last_msg.msg.soln_meta_dep_a.sol_in[20].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[20].sensor_type == 15, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[20].sensor_type, expected 15, is %d", last_msg.msg.soln_meta_dep_a.sol_in[20].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[21].flags == 39, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[21].flags, expected 39, is %d", last_msg.msg.soln_meta_dep_a.sol_in[21].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[21].sensor_type == 255, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[21].sensor_type, expected 255, is %d", last_msg.msg.soln_meta_dep_a.sol_in[21].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[22].flags == 216, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[22].flags, expected 216, is %d", last_msg.msg.soln_meta_dep_a.sol_in[22].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[22].sensor_type == 205, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[22].sensor_type, expected 205, is %d", last_msg.msg.soln_meta_dep_a.sol_in[22].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[23].flags == 190, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[23].flags, expected 190, is %d", last_msg.msg.soln_meta_dep_a.sol_in[23].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[23].sensor_type == 240, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[23].sensor_type, expected 240, is %d", last_msg.msg.soln_meta_dep_a.sol_in[23].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[24].flags == 219, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[24].flags, expected 219, is %d", last_msg.msg.soln_meta_dep_a.sol_in[24].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[24].sensor_type == 93, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[24].sensor_type, expected 93, is %d", last_msg.msg.soln_meta_dep_a.sol_in[24].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[25].flags == 42, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[25].flags, expected 42, is %d", last_msg.msg.soln_meta_dep_a.sol_in[25].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[25].sensor_type == 103, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[25].sensor_type, expected 103, is %d", last_msg.msg.soln_meta_dep_a.sol_in[25].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[26].flags == 182, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[26].flags, expected 182, is %d", last_msg.msg.soln_meta_dep_a.sol_in[26].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[26].sensor_type == 41, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[26].sensor_type, expected 41, is %d", last_msg.msg.soln_meta_dep_a.sol_in[26].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[27].flags == 222, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[27].flags, expected 222, is %d", last_msg.msg.soln_meta_dep_a.sol_in[27].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[27].sensor_type == 76, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[27].sensor_type, expected 76, is %d", last_msg.msg.soln_meta_dep_a.sol_in[27].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[28].flags == 23, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[28].flags, expected 23, is %d", last_msg.msg.soln_meta_dep_a.sol_in[28].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[28].sensor_type == 17, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[28].sensor_type, expected 17, is %d", last_msg.msg.soln_meta_dep_a.sol_in[28].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[29].flags == 31, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[29].flags, expected 31, is %d", last_msg.msg.soln_meta_dep_a.sol_in[29].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[29].sensor_type == 125, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[29].sensor_type, expected 125, is %d", last_msg.msg.soln_meta_dep_a.sol_in[29].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[30].flags == 229, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[30].flags, expected 229, is %d", last_msg.msg.soln_meta_dep_a.sol_in[30].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[30].sensor_type == 18, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[30].sensor_type, expected 18, is %d", last_msg.msg.soln_meta_dep_a.sol_in[30].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[31].flags == 47, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[31].flags, expected 47, is %d", last_msg.msg.soln_meta_dep_a.sol_in[31].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[31].sensor_type == 28, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[31].sensor_type, expected 28, is %d", last_msg.msg.soln_meta_dep_a.sol_in[31].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[32].flags == 25, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[32].flags, expected 25, is %d", last_msg.msg.soln_meta_dep_a.sol_in[32].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[32].sensor_type == 214, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[32].sensor_type, expected 214, is %d", last_msg.msg.soln_meta_dep_a.sol_in[32].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[33].flags == 84, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[33].flags, expected 84, is %d", last_msg.msg.soln_meta_dep_a.sol_in[33].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[33].sensor_type == 100, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[33].sensor_type, expected 100, is %d", last_msg.msg.soln_meta_dep_a.sol_in[33].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[34].flags == 72, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[34].flags, expected 72, is %d", last_msg.msg.soln_meta_dep_a.sol_in[34].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[34].sensor_type == 106, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[34].sensor_type, expected 106, is %d", last_msg.msg.soln_meta_dep_a.sol_in[34].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[35].flags == 10, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[35].flags, expected 10, is %d", last_msg.msg.soln_meta_dep_a.sol_in[35].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[35].sensor_type == 48, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[35].sensor_type, expected 48, is %d", last_msg.msg.soln_meta_dep_a.sol_in[35].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[36].flags == 232, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[36].flags, expected 232, is %d", last_msg.msg.soln_meta_dep_a.sol_in[36].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[36].sensor_type == 222, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[36].sensor_type, expected 222, is %d", last_msg.msg.soln_meta_dep_a.sol_in[36].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[37].flags == 73, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[37].flags, expected 73, is %d", last_msg.msg.soln_meta_dep_a.sol_in[37].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[37].sensor_type == 235, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[37].sensor_type, expected 235, is %d", last_msg.msg.soln_meta_dep_a.sol_in[37].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[38].flags == 163, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[38].flags, expected 163, is %d", last_msg.msg.soln_meta_dep_a.sol_in[38].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[38].sensor_type == 109, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[38].sensor_type, expected 109, is %d", last_msg.msg.soln_meta_dep_a.sol_in[38].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[39].flags == 152, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[39].flags, expected 152, is %d", last_msg.msg.soln_meta_dep_a.sol_in[39].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[39].sensor_type == 51, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[39].sensor_type, expected 51, is %d", last_msg.msg.soln_meta_dep_a.sol_in[39].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[40].flags == 235, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[40].flags, expected 235, is %d", last_msg.msg.soln_meta_dep_a.sol_in[40].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[40].sensor_type == 133, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[40].sensor_type, expected 133, is %d", last_msg.msg.soln_meta_dep_a.sol_in[40].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[41].flags == 70, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[41].flags, expected 70, is %d", last_msg.msg.soln_meta_dep_a.sol_in[41].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[41].sensor_type == 87, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[41].sensor_type, expected 87, is %d", last_msg.msg.soln_meta_dep_a.sol_in[41].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[42].flags == 108, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[42].flags, expected 108, is %d", last_msg.msg.soln_meta_dep_a.sol_in[42].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[42].sensor_type == 2, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[42].sensor_type, expected 2, is %d", last_msg.msg.soln_meta_dep_a.sol_in[42].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[43].flags == 101, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[43].flags, expected 101, is %d", last_msg.msg.soln_meta_dep_a.sol_in[43].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[43].sensor_type == 91, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[43].sensor_type, expected 91, is %d", last_msg.msg.soln_meta_dep_a.sol_in[43].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[44].flags == 55, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[44].flags, expected 55, is %d", last_msg.msg.soln_meta_dep_a.sol_in[44].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[44].sensor_type == 200, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[44].sensor_type, expected 200, is %d", last_msg.msg.soln_meta_dep_a.sol_in[44].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[45].flags == 156, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[45].flags, expected 156, is %d", last_msg.msg.soln_meta_dep_a.sol_in[45].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[45].sensor_type == 24, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[45].sensor_type, expected 24, is %d", last_msg.msg.soln_meta_dep_a.sol_in[45].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[46].flags == 73, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[46].flags, expected 73, is %d", last_msg.msg.soln_meta_dep_a.sol_in[46].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[46].sensor_type == 233, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[46].sensor_type, expected 233, is %d", last_msg.msg.soln_meta_dep_a.sol_in[46].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[47].flags == 66, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[47].flags, expected 66, is %d", last_msg.msg.soln_meta_dep_a.sol_in[47].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[47].sensor_type == 39, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[47].sensor_type, expected 39, is %d", last_msg.msg.soln_meta_dep_a.sol_in[47].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[48].flags == 140, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[48].flags, expected 140, is %d", last_msg.msg.soln_meta_dep_a.sol_in[48].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[48].sensor_type == 97, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[48].sensor_type, expected 97, is %d", last_msg.msg.soln_meta_dep_a.sol_in[48].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[49].flags == 227, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[49].flags, expected 227, is %d", last_msg.msg.soln_meta_dep_a.sol_in[49].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[49].sensor_type == 252, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[49].sensor_type, expected 252, is %d", last_msg.msg.soln_meta_dep_a.sol_in[49].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[50].flags == 237, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[50].flags, expected 237, is %d", last_msg.msg.soln_meta_dep_a.sol_in[50].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[50].sensor_type == 230, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[50].sensor_type, expected 230, is %d", last_msg.msg.soln_meta_dep_a.sol_in[50].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[51].flags == 241, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[51].flags, expected 241, is %d", last_msg.msg.soln_meta_dep_a.sol_in[51].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[51].sensor_type == 135, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[51].sensor_type, expected 135, is %d", last_msg.msg.soln_meta_dep_a.sol_in[51].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[52].flags == 205, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[52].flags, expected 205, is %d", last_msg.msg.soln_meta_dep_a.sol_in[52].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[52].sensor_type == 245, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[52].sensor_type, expected 245, is %d", last_msg.msg.soln_meta_dep_a.sol_in[52].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[53].flags == 0, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[53].flags, expected 0, is %d", last_msg.msg.soln_meta_dep_a.sol_in[53].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[53].sensor_type == 70, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[53].sensor_type, expected 70, is %d", last_msg.msg.soln_meta_dep_a.sol_in[53].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[54].flags == 188, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[54].flags, expected 188, is %d", last_msg.msg.soln_meta_dep_a.sol_in[54].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[54].sensor_type == 219, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[54].sensor_type, expected 219, is %d", last_msg.msg.soln_meta_dep_a.sol_in[54].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[55].flags == 136, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[55].flags, expected 136, is %d", last_msg.msg.soln_meta_dep_a.sol_in[55].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[55].sensor_type == 107, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[55].sensor_type, expected 107, is %d", last_msg.msg.soln_meta_dep_a.sol_in[55].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[56].flags == 58, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[56].flags, expected 58, is %d", last_msg.msg.soln_meta_dep_a.sol_in[56].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[56].sensor_type == 178, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[56].sensor_type, expected 178, is %d", last_msg.msg.soln_meta_dep_a.sol_in[56].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[57].flags == 29, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[57].flags, expected 29, is %d", last_msg.msg.soln_meta_dep_a.sol_in[57].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[57].sensor_type == 1, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[57].sensor_type, expected 1, is %d", last_msg.msg.soln_meta_dep_a.sol_in[57].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[58].flags == 213, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[58].flags, expected 213, is %d", last_msg.msg.soln_meta_dep_a.sol_in[58].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[58].sensor_type == 44, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[58].sensor_type, expected 44, is %d", last_msg.msg.soln_meta_dep_a.sol_in[58].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[59].flags == 147, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[59].flags, expected 147, is %d", last_msg.msg.soln_meta_dep_a.sol_in[59].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[59].sensor_type == 225, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[59].sensor_type, expected 225, is %d", last_msg.msg.soln_meta_dep_a.sol_in[59].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[60].flags == 96, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[60].flags, expected 96, is %d", last_msg.msg.soln_meta_dep_a.sol_in[60].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[60].sensor_type == 190, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[60].sensor_type, expected 190, is %d", last_msg.msg.soln_meta_dep_a.sol_in[60].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[61].flags == 108, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[61].flags, expected 108, is %d", last_msg.msg.soln_meta_dep_a.sol_in[61].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[61].sensor_type == 192, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[61].sensor_type, expected 192, is %d", last_msg.msg.soln_meta_dep_a.sol_in[61].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[62].flags == 15, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[62].flags, expected 15, is %d", last_msg.msg.soln_meta_dep_a.sol_in[62].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[62].sensor_type == 228, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[62].sensor_type, expected 228, is %d", last_msg.msg.soln_meta_dep_a.sol_in[62].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[63].flags == 18, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[63].flags, expected 18, is %d", last_msg.msg.soln_meta_dep_a.sol_in[63].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[63].sensor_type == 203, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[63].sensor_type, expected 203, is %d", last_msg.msg.soln_meta_dep_a.sol_in[63].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[64].flags == 222, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[64].flags, expected 222, is %d", last_msg.msg.soln_meta_dep_a.sol_in[64].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[64].sensor_type == 3, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[64].sensor_type, expected 3, is %d", last_msg.msg.soln_meta_dep_a.sol_in[64].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[65].flags == 68, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[65].flags, expected 68, is %d", last_msg.msg.soln_meta_dep_a.sol_in[65].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[65].sensor_type == 180, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[65].sensor_type, expected 180, is %d", last_msg.msg.soln_meta_dep_a.sol_in[65].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[66].flags == 229, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[66].flags, expected 229, is %d", last_msg.msg.soln_meta_dep_a.sol_in[66].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[66].sensor_type == 101, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[66].sensor_type, expected 101, is %d", last_msg.msg.soln_meta_dep_a.sol_in[66].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[67].flags == 203, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[67].flags, expected 203, is %d", last_msg.msg.soln_meta_dep_a.sol_in[67].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[67].sensor_type == 223, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[67].sensor_type, expected 223, is %d", last_msg.msg.soln_meta_dep_a.sol_in[67].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[68].flags == 164, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[68].flags, expected 164, is %d", last_msg.msg.soln_meta_dep_a.sol_in[68].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[68].sensor_type == 243, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[68].sensor_type, expected 243, is %d", last_msg.msg.soln_meta_dep_a.sol_in[68].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[69].flags == 165, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[69].flags, expected 165, is %d", last_msg.msg.soln_meta_dep_a.sol_in[69].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[69].sensor_type == 92, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[69].sensor_type, expected 92, is %d", last_msg.msg.soln_meta_dep_a.sol_in[69].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[70].flags == 159, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[70].flags, expected 159, is %d", last_msg.msg.soln_meta_dep_a.sol_in[70].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[70].sensor_type == 220, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[70].sensor_type, expected 220, is %d", last_msg.msg.soln_meta_dep_a.sol_in[70].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[71].flags == 121, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[71].flags, expected 121, is %d", last_msg.msg.soln_meta_dep_a.sol_in[71].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[71].sensor_type == 174, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[71].sensor_type, expected 174, is %d", last_msg.msg.soln_meta_dep_a.sol_in[71].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[72].flags == 167, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[72].flags, expected 167, is %d", last_msg.msg.soln_meta_dep_a.sol_in[72].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[72].sensor_type == 112, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[72].sensor_type, expected 112, is %d", last_msg.msg.soln_meta_dep_a.sol_in[72].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[73].flags == 40, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[73].flags, expected 40, is %d", last_msg.msg.soln_meta_dep_a.sol_in[73].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[73].sensor_type == 240, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[73].sensor_type, expected 240, is %d", last_msg.msg.soln_meta_dep_a.sol_in[73].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[74].flags == 3, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[74].flags, expected 3, is %d", last_msg.msg.soln_meta_dep_a.sol_in[74].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[74].sensor_type == 59, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[74].sensor_type, expected 59, is %d", last_msg.msg.soln_meta_dep_a.sol_in[74].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[75].flags == 52, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[75].flags, expected 52, is %d", last_msg.msg.soln_meta_dep_a.sol_in[75].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[75].sensor_type == 230, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[75].sensor_type, expected 230, is %d", last_msg.msg.soln_meta_dep_a.sol_in[75].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[76].flags == 148, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[76].flags, expected 148, is %d", last_msg.msg.soln_meta_dep_a.sol_in[76].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[76].sensor_type == 149, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[76].sensor_type, expected 149, is %d", last_msg.msg.soln_meta_dep_a.sol_in[76].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[77].flags == 142, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[77].flags, expected 142, is %d", last_msg.msg.soln_meta_dep_a.sol_in[77].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[77].sensor_type == 218, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[77].sensor_type, expected 218, is %d", last_msg.msg.soln_meta_dep_a.sol_in[77].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[78].flags == 109, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[78].flags, expected 109, is %d", last_msg.msg.soln_meta_dep_a.sol_in[78].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[78].sensor_type == 212, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[78].sensor_type, expected 212, is %d", last_msg.msg.soln_meta_dep_a.sol_in[78].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[79].flags == 71, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[79].flags, expected 71, is %d", last_msg.msg.soln_meta_dep_a.sol_in[79].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[79].sensor_type == 176, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[79].sensor_type, expected 176, is %d", last_msg.msg.soln_meta_dep_a.sol_in[79].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[80].flags == 172, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[80].flags, expected 172, is %d", last_msg.msg.soln_meta_dep_a.sol_in[80].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[80].sensor_type == 179, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[80].sensor_type, expected 179, is %d", last_msg.msg.soln_meta_dep_a.sol_in[80].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[81].flags == 1, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[81].flags, expected 1, is %d", last_msg.msg.soln_meta_dep_a.sol_in[81].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[81].sensor_type == 77, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[81].sensor_type, expected 77, is %d", last_msg.msg.soln_meta_dep_a.sol_in[81].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[82].flags == 70, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[82].flags, expected 70, is %d", last_msg.msg.soln_meta_dep_a.sol_in[82].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[82].sensor_type == 193, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[82].sensor_type, expected 193, is %d", last_msg.msg.soln_meta_dep_a.sol_in[82].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[83].flags == 149, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[83].flags, expected 149, is %d", last_msg.msg.soln_meta_dep_a.sol_in[83].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[83].sensor_type == 147, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[83].sensor_type, expected 147, is %d", last_msg.msg.soln_meta_dep_a.sol_in[83].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[84].flags == 144, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[84].flags, expected 144, is %d", last_msg.msg.soln_meta_dep_a.sol_in[84].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[84].sensor_type == 23, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[84].sensor_type, expected 23, is %d", last_msg.msg.soln_meta_dep_a.sol_in[84].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[85].flags == 239, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[85].flags, expected 239, is %d", last_msg.msg.soln_meta_dep_a.sol_in[85].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[85].sensor_type == 148, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[85].sensor_type, expected 148, is %d", last_msg.msg.soln_meta_dep_a.sol_in[85].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[86].flags == 186, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[86].flags, expected 186, is %d", last_msg.msg.soln_meta_dep_a.sol_in[86].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[86].sensor_type == 195, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[86].sensor_type, expected 195, is %d", last_msg.msg.soln_meta_dep_a.sol_in[86].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[87].flags == 30, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[87].flags, expected 30, is %d", last_msg.msg.soln_meta_dep_a.sol_in[87].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[87].sensor_type == 86, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[87].sensor_type, expected 86, is %d", last_msg.msg.soln_meta_dep_a.sol_in[87].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[88].flags == 143, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[88].flags, expected 143, is %d", last_msg.msg.soln_meta_dep_a.sol_in[88].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[88].sensor_type == 34, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[88].sensor_type, expected 34, is %d", last_msg.msg.soln_meta_dep_a.sol_in[88].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[89].flags == 207, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[89].flags, expected 207, is %d", last_msg.msg.soln_meta_dep_a.sol_in[89].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[89].sensor_type == 156, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[89].sensor_type, expected 156, is %d", last_msg.msg.soln_meta_dep_a.sol_in[89].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[90].flags == 55, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[90].flags, expected 55, is %d", last_msg.msg.soln_meta_dep_a.sol_in[90].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[90].sensor_type == 63, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[90].sensor_type, expected 63, is %d", last_msg.msg.soln_meta_dep_a.sol_in[90].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[91].flags == 255, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[91].flags, expected 255, is %d", last_msg.msg.soln_meta_dep_a.sol_in[91].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[91].sensor_type == 117, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[91].sensor_type, expected 117, is %d", last_msg.msg.soln_meta_dep_a.sol_in[91].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[92].flags == 222, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[92].flags, expected 222, is %d", last_msg.msg.soln_meta_dep_a.sol_in[92].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[92].sensor_type == 222, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[92].sensor_type, expected 222, is %d", last_msg.msg.soln_meta_dep_a.sol_in[92].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[93].flags == 145, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[93].flags, expected 145, is %d", last_msg.msg.soln_meta_dep_a.sol_in[93].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[93].sensor_type == 219, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[93].sensor_type, expected 219, is %d", last_msg.msg.soln_meta_dep_a.sol_in[93].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[94].flags == 191, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[94].flags, expected 191, is %d", last_msg.msg.soln_meta_dep_a.sol_in[94].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[94].sensor_type == 224, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[94].sensor_type, expected 224, is %d", last_msg.msg.soln_meta_dep_a.sol_in[94].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[95].flags == 109, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[95].flags, expected 109, is %d", last_msg.msg.soln_meta_dep_a.sol_in[95].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[95].sensor_type == 210, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[95].sensor_type, expected 210, is %d", last_msg.msg.soln_meta_dep_a.sol_in[95].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[96].flags == 153, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[96].flags, expected 153, is %d", last_msg.msg.soln_meta_dep_a.sol_in[96].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[96].sensor_type == 86, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[96].sensor_type, expected 86, is %d", last_msg.msg.soln_meta_dep_a.sol_in[96].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[97].flags == 32, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[97].flags, expected 32, is %d", last_msg.msg.soln_meta_dep_a.sol_in[97].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[97].sensor_type == 21, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[97].sensor_type, expected 21, is %d", last_msg.msg.soln_meta_dep_a.sol_in[97].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[98].flags == 10, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[98].flags, expected 10, is %d", last_msg.msg.soln_meta_dep_a.sol_in[98].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[98].sensor_type == 226, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[98].sensor_type, expected 226, is %d", last_msg.msg.soln_meta_dep_a.sol_in[98].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[99].flags == 63, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[99].flags, expected 63, is %d", last_msg.msg.soln_meta_dep_a.sol_in[99].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[99].sensor_type == 60, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[99].sensor_type, expected 60, is %d", last_msg.msg.soln_meta_dep_a.sol_in[99].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[100].flags == 236, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[100].flags, expected 236, is %d", last_msg.msg.soln_meta_dep_a.sol_in[100].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[100].sensor_type == 106, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[100].sensor_type, expected 106, is %d", last_msg.msg.soln_meta_dep_a.sol_in[100].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[101].flags == 96, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[101].flags, expected 96, is %d", last_msg.msg.soln_meta_dep_a.sol_in[101].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[101].sensor_type == 93, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[101].sensor_type, expected 93, is %d", last_msg.msg.soln_meta_dep_a.sol_in[101].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[102].flags == 163, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[102].flags, expected 163, is %d", last_msg.msg.soln_meta_dep_a.sol_in[102].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[102].sensor_type == 30, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[102].sensor_type, expected 30, is %d", last_msg.msg.soln_meta_dep_a.sol_in[102].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[103].flags == 238, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[103].flags, expected 238, is %d", last_msg.msg.soln_meta_dep_a.sol_in[103].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[103].sensor_type == 106, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[103].sensor_type, expected 106, is %d", last_msg.msg.soln_meta_dep_a.sol_in[103].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[104].flags == 133, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[104].flags, expected 133, is %d", last_msg.msg.soln_meta_dep_a.sol_in[104].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[104].sensor_type == 147, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[104].sensor_type, expected 147, is %d", last_msg.msg.soln_meta_dep_a.sol_in[104].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[105].flags == 107, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[105].flags, expected 107, is %d", last_msg.msg.soln_meta_dep_a.sol_in[105].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[105].sensor_type == 132, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[105].sensor_type, expected 132, is %d", last_msg.msg.soln_meta_dep_a.sol_in[105].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[106].flags == 214, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[106].flags, expected 214, is %d", last_msg.msg.soln_meta_dep_a.sol_in[106].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[106].sensor_type == 152, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[106].sensor_type, expected 152, is %d", last_msg.msg.soln_meta_dep_a.sol_in[106].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[107].flags == 185, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[107].flags, expected 185, is %d", last_msg.msg.soln_meta_dep_a.sol_in[107].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[107].sensor_type == 221, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[107].sensor_type, expected 221, is %d", last_msg.msg.soln_meta_dep_a.sol_in[107].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[108].flags == 21, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[108].flags, expected 21, is %d", last_msg.msg.soln_meta_dep_a.sol_in[108].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[108].sensor_type == 202, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[108].sensor_type, expected 202, is %d", last_msg.msg.soln_meta_dep_a.sol_in[108].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[109].flags == 51, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[109].flags, expected 51, is %d", last_msg.msg.soln_meta_dep_a.sol_in[109].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[109].sensor_type == 252, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[109].sensor_type, expected 252, is %d", last_msg.msg.soln_meta_dep_a.sol_in[109].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[110].flags == 59, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[110].flags, expected 59, is %d", last_msg.msg.soln_meta_dep_a.sol_in[110].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[110].sensor_type == 130, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[110].sensor_type, expected 130, is %d", last_msg.msg.soln_meta_dep_a.sol_in[110].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[111].flags == 202, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[111].flags, expected 202, is %d", last_msg.msg.soln_meta_dep_a.sol_in[111].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[111].sensor_type == 166, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[111].sensor_type, expected 166, is %d", last_msg.msg.soln_meta_dep_a.sol_in[111].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[112].flags == 170, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[112].flags, expected 170, is %d", last_msg.msg.soln_meta_dep_a.sol_in[112].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[112].sensor_type == 127, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[112].sensor_type, expected 127, is %d", last_msg.msg.soln_meta_dep_a.sol_in[112].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[113].flags == 193, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[113].flags, expected 193, is %d", last_msg.msg.soln_meta_dep_a.sol_in[113].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[113].sensor_type == 58, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[113].sensor_type, expected 58, is %d", last_msg.msg.soln_meta_dep_a.sol_in[113].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[114].flags == 125, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[114].flags, expected 125, is %d", last_msg.msg.soln_meta_dep_a.sol_in[114].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[114].sensor_type == 215, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[114].sensor_type, expected 215, is %d", last_msg.msg.soln_meta_dep_a.sol_in[114].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[115].flags == 58, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[115].flags, expected 58, is %d", last_msg.msg.soln_meta_dep_a.sol_in[115].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[115].sensor_type == 22, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[115].sensor_type, expected 22, is %d", last_msg.msg.soln_meta_dep_a.sol_in[115].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[116].flags == 47, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[116].flags, expected 47, is %d", last_msg.msg.soln_meta_dep_a.sol_in[116].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[116].sensor_type == 135, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[116].sensor_type, expected 135, is %d", last_msg.msg.soln_meta_dep_a.sol_in[116].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[117].flags == 142, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[117].flags, expected 142, is %d", last_msg.msg.soln_meta_dep_a.sol_in[117].flags); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[117].sensor_type == 88, "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[117].sensor_type, expected 88, is %d", last_msg.msg.soln_meta_dep_a.sol_in[117].sensor_type); - - ck_assert_msg(last_msg.msg.soln_meta_dep_a.vdop == 41989, "incorrect value for last_msg.msg.soln_meta_dep_a.vdop, expected 41989, is %d", last_msg.msg.soln_meta_dep_a.vdop); + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.age_corrections == 48671, + "incorrect value for last_msg.msg.soln_meta_dep_a.age_corrections, " + "expected 48671, is %d", + last_msg.msg.soln_meta_dep_a.age_corrections); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.alignment_status == 115, + "incorrect value for last_msg.msg.soln_meta_dep_a.alignment_status, " + "expected 115, is %d", + last_msg.msg.soln_meta_dep_a.alignment_status); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.hdop == 31133, + "incorrect value for last_msg.msg.soln_meta_dep_a.hdop, " + "expected 31133, is %d", + last_msg.msg.soln_meta_dep_a.hdop); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.last_used_gnss_pos_tow == 610745181, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.last_used_gnss_pos_tow, expected " + "610745181, is %d", + last_msg.msg.soln_meta_dep_a.last_used_gnss_pos_tow); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.last_used_gnss_vel_tow == 782016851, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.last_used_gnss_vel_tow, expected " + "782016851, is %d", + last_msg.msg.soln_meta_dep_a.last_used_gnss_vel_tow); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.n_sats == 238, + "incorrect value for last_msg.msg.soln_meta_dep_a.n_sats, " + "expected 238, is %d", + last_msg.msg.soln_meta_dep_a.n_sats); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.n_sol_in == 118, + "incorrect value for last_msg.msg.soln_meta_dep_a.n_sol_in, " + "expected 118, is %d", + last_msg.msg.soln_meta_dep_a.n_sol_in); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.pdop == 57015, + "incorrect value for last_msg.msg.soln_meta_dep_a.pdop, " + "expected 57015, is %d", + last_msg.msg.soln_meta_dep_a.pdop); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[0].flags == 67, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[0].flags, " + "expected 67, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[0].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[0].sensor_type == 253, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[0].sensor_type, " + "expected 253, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[0].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[1].flags == 200, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[1].flags, " + "expected 200, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[1].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[1].sensor_type == 87, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[1].sensor_type, " + "expected 87, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[1].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[2].flags == 250, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[2].flags, " + "expected 250, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[2].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[2].sensor_type == 39, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[2].sensor_type, " + "expected 39, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[2].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[3].flags == 242, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[3].flags, " + "expected 242, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[3].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[3].sensor_type == 245, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[3].sensor_type, " + "expected 245, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[3].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[4].flags == 72, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[4].flags, " + "expected 72, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[4].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[4].sensor_type == 228, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[4].sensor_type, " + "expected 228, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[4].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[5].flags == 222, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[5].flags, " + "expected 222, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[5].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[5].sensor_type == 18, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[5].sensor_type, " + "expected 18, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[5].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[6].flags == 88, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[6].flags, " + "expected 88, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[6].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[6].sensor_type == 11, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[6].sensor_type, " + "expected 11, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[6].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[7].flags == 218, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[7].flags, " + "expected 218, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[7].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[7].sensor_type == 207, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[7].sensor_type, " + "expected 207, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[7].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[8].flags == 13, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[8].flags, " + "expected 13, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[8].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[8].sensor_type == 231, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[8].sensor_type, " + "expected 231, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[8].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[9].flags == 224, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[9].flags, " + "expected 224, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[9].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[9].sensor_type == 226, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[9].sensor_type, " + "expected 226, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[9].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[10].flags == 196, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[10].flags, " + "expected 196, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[10].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[10].sensor_type == 22, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[10].sensor_type, " + "expected 22, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[10].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[11].flags == 242, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[11].flags, " + "expected 242, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[11].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[11].sensor_type == 21, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[11].sensor_type, " + "expected 21, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[11].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[12].flags == 89, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[12].flags, " + "expected 89, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[12].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[12].sensor_type == 12, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[12].sensor_type, " + "expected 12, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[12].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[13].flags == 219, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[13].flags, " + "expected 219, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[13].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[13].sensor_type == 71, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[13].sensor_type, " + "expected 71, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[13].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[14].flags == 85, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[14].flags, " + "expected 85, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[14].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[14].sensor_type == 182, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[14].sensor_type, " + "expected 182, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[14].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[15].flags == 204, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[15].flags, " + "expected 204, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[15].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[15].sensor_type == 145, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[15].sensor_type, " + "expected 145, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[15].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[16].flags == 40, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[16].flags, " + "expected 40, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[16].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[16].sensor_type == 146, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[16].sensor_type, " + "expected 146, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[16].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[17].flags == 51, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[17].flags, " + "expected 51, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[17].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[17].sensor_type == 204, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[17].sensor_type, " + "expected 204, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[17].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[18].flags == 153, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[18].flags, " + "expected 153, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[18].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[18].sensor_type == 21, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[18].sensor_type, " + "expected 21, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[18].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[19].flags == 44, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[19].flags, " + "expected 44, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[19].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[19].sensor_type == 227, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[19].sensor_type, " + "expected 227, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[19].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[20].flags == 28, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[20].flags, " + "expected 28, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[20].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[20].sensor_type == 15, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[20].sensor_type, " + "expected 15, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[20].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[21].flags == 39, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[21].flags, " + "expected 39, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[21].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[21].sensor_type == 255, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[21].sensor_type, " + "expected 255, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[21].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[22].flags == 216, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[22].flags, " + "expected 216, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[22].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[22].sensor_type == 205, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[22].sensor_type, " + "expected 205, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[22].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[23].flags == 190, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[23].flags, " + "expected 190, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[23].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[23].sensor_type == 240, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[23].sensor_type, " + "expected 240, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[23].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[24].flags == 219, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[24].flags, " + "expected 219, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[24].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[24].sensor_type == 93, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[24].sensor_type, " + "expected 93, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[24].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[25].flags == 42, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[25].flags, " + "expected 42, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[25].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[25].sensor_type == 103, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[25].sensor_type, " + "expected 103, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[25].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[26].flags == 182, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[26].flags, " + "expected 182, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[26].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[26].sensor_type == 41, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[26].sensor_type, " + "expected 41, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[26].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[27].flags == 222, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[27].flags, " + "expected 222, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[27].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[27].sensor_type == 76, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[27].sensor_type, " + "expected 76, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[27].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[28].flags == 23, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[28].flags, " + "expected 23, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[28].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[28].sensor_type == 17, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[28].sensor_type, " + "expected 17, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[28].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[29].flags == 31, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[29].flags, " + "expected 31, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[29].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[29].sensor_type == 125, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[29].sensor_type, " + "expected 125, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[29].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[30].flags == 229, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[30].flags, " + "expected 229, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[30].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[30].sensor_type == 18, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[30].sensor_type, " + "expected 18, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[30].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[31].flags == 47, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[31].flags, " + "expected 47, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[31].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[31].sensor_type == 28, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[31].sensor_type, " + "expected 28, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[31].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[32].flags == 25, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[32].flags, " + "expected 25, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[32].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[32].sensor_type == 214, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[32].sensor_type, " + "expected 214, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[32].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[33].flags == 84, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[33].flags, " + "expected 84, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[33].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[33].sensor_type == 100, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[33].sensor_type, " + "expected 100, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[33].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[34].flags == 72, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[34].flags, " + "expected 72, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[34].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[34].sensor_type == 106, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[34].sensor_type, " + "expected 106, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[34].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[35].flags == 10, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[35].flags, " + "expected 10, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[35].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[35].sensor_type == 48, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[35].sensor_type, " + "expected 48, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[35].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[36].flags == 232, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[36].flags, " + "expected 232, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[36].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[36].sensor_type == 222, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[36].sensor_type, " + "expected 222, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[36].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[37].flags == 73, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[37].flags, " + "expected 73, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[37].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[37].sensor_type == 235, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[37].sensor_type, " + "expected 235, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[37].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[38].flags == 163, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[38].flags, " + "expected 163, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[38].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[38].sensor_type == 109, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[38].sensor_type, " + "expected 109, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[38].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[39].flags == 152, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[39].flags, " + "expected 152, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[39].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[39].sensor_type == 51, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[39].sensor_type, " + "expected 51, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[39].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[40].flags == 235, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[40].flags, " + "expected 235, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[40].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[40].sensor_type == 133, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[40].sensor_type, " + "expected 133, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[40].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[41].flags == 70, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[41].flags, " + "expected 70, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[41].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[41].sensor_type == 87, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[41].sensor_type, " + "expected 87, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[41].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[42].flags == 108, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[42].flags, " + "expected 108, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[42].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[42].sensor_type == 2, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[42].sensor_type, " + "expected 2, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[42].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[43].flags == 101, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[43].flags, " + "expected 101, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[43].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[43].sensor_type == 91, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[43].sensor_type, " + "expected 91, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[43].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[44].flags == 55, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[44].flags, " + "expected 55, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[44].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[44].sensor_type == 200, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[44].sensor_type, " + "expected 200, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[44].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[45].flags == 156, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[45].flags, " + "expected 156, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[45].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[45].sensor_type == 24, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[45].sensor_type, " + "expected 24, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[45].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[46].flags == 73, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[46].flags, " + "expected 73, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[46].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[46].sensor_type == 233, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[46].sensor_type, " + "expected 233, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[46].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[47].flags == 66, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[47].flags, " + "expected 66, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[47].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[47].sensor_type == 39, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[47].sensor_type, " + "expected 39, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[47].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[48].flags == 140, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[48].flags, " + "expected 140, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[48].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[48].sensor_type == 97, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[48].sensor_type, " + "expected 97, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[48].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[49].flags == 227, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[49].flags, " + "expected 227, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[49].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[49].sensor_type == 252, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[49].sensor_type, " + "expected 252, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[49].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[50].flags == 237, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[50].flags, " + "expected 237, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[50].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[50].sensor_type == 230, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[50].sensor_type, " + "expected 230, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[50].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[51].flags == 241, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[51].flags, " + "expected 241, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[51].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[51].sensor_type == 135, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[51].sensor_type, " + "expected 135, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[51].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[52].flags == 205, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[52].flags, " + "expected 205, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[52].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[52].sensor_type == 245, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[52].sensor_type, " + "expected 245, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[52].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[53].flags == 0, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[53].flags, " + "expected 0, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[53].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[53].sensor_type == 70, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[53].sensor_type, " + "expected 70, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[53].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[54].flags == 188, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[54].flags, " + "expected 188, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[54].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[54].sensor_type == 219, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[54].sensor_type, " + "expected 219, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[54].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[55].flags == 136, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[55].flags, " + "expected 136, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[55].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[55].sensor_type == 107, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[55].sensor_type, " + "expected 107, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[55].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[56].flags == 58, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[56].flags, " + "expected 58, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[56].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[56].sensor_type == 178, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[56].sensor_type, " + "expected 178, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[56].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[57].flags == 29, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[57].flags, " + "expected 29, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[57].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[57].sensor_type == 1, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[57].sensor_type, " + "expected 1, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[57].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[58].flags == 213, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[58].flags, " + "expected 213, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[58].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[58].sensor_type == 44, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[58].sensor_type, " + "expected 44, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[58].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[59].flags == 147, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[59].flags, " + "expected 147, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[59].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[59].sensor_type == 225, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[59].sensor_type, " + "expected 225, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[59].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[60].flags == 96, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[60].flags, " + "expected 96, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[60].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[60].sensor_type == 190, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[60].sensor_type, " + "expected 190, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[60].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[61].flags == 108, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[61].flags, " + "expected 108, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[61].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[61].sensor_type == 192, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[61].sensor_type, " + "expected 192, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[61].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[62].flags == 15, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[62].flags, " + "expected 15, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[62].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[62].sensor_type == 228, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[62].sensor_type, " + "expected 228, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[62].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[63].flags == 18, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[63].flags, " + "expected 18, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[63].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[63].sensor_type == 203, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[63].sensor_type, " + "expected 203, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[63].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[64].flags == 222, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[64].flags, " + "expected 222, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[64].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[64].sensor_type == 3, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[64].sensor_type, " + "expected 3, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[64].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[65].flags == 68, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[65].flags, " + "expected 68, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[65].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[65].sensor_type == 180, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[65].sensor_type, " + "expected 180, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[65].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[66].flags == 229, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[66].flags, " + "expected 229, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[66].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[66].sensor_type == 101, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[66].sensor_type, " + "expected 101, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[66].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[67].flags == 203, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[67].flags, " + "expected 203, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[67].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[67].sensor_type == 223, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[67].sensor_type, " + "expected 223, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[67].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[68].flags == 164, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[68].flags, " + "expected 164, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[68].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[68].sensor_type == 243, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[68].sensor_type, " + "expected 243, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[68].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[69].flags == 165, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[69].flags, " + "expected 165, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[69].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[69].sensor_type == 92, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[69].sensor_type, " + "expected 92, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[69].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[70].flags == 159, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[70].flags, " + "expected 159, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[70].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[70].sensor_type == 220, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[70].sensor_type, " + "expected 220, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[70].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[71].flags == 121, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[71].flags, " + "expected 121, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[71].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[71].sensor_type == 174, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[71].sensor_type, " + "expected 174, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[71].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[72].flags == 167, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[72].flags, " + "expected 167, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[72].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[72].sensor_type == 112, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[72].sensor_type, " + "expected 112, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[72].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[73].flags == 40, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[73].flags, " + "expected 40, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[73].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[73].sensor_type == 240, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[73].sensor_type, " + "expected 240, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[73].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[74].flags == 3, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[74].flags, " + "expected 3, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[74].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[74].sensor_type == 59, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[74].sensor_type, " + "expected 59, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[74].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[75].flags == 52, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[75].flags, " + "expected 52, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[75].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[75].sensor_type == 230, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[75].sensor_type, " + "expected 230, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[75].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[76].flags == 148, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[76].flags, " + "expected 148, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[76].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[76].sensor_type == 149, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[76].sensor_type, " + "expected 149, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[76].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[77].flags == 142, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[77].flags, " + "expected 142, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[77].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[77].sensor_type == 218, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[77].sensor_type, " + "expected 218, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[77].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[78].flags == 109, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[78].flags, " + "expected 109, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[78].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[78].sensor_type == 212, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[78].sensor_type, " + "expected 212, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[78].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[79].flags == 71, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[79].flags, " + "expected 71, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[79].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[79].sensor_type == 176, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[79].sensor_type, " + "expected 176, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[79].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[80].flags == 172, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[80].flags, " + "expected 172, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[80].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[80].sensor_type == 179, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[80].sensor_type, " + "expected 179, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[80].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[81].flags == 1, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[81].flags, " + "expected 1, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[81].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[81].sensor_type == 77, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[81].sensor_type, " + "expected 77, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[81].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[82].flags == 70, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[82].flags, " + "expected 70, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[82].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[82].sensor_type == 193, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[82].sensor_type, " + "expected 193, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[82].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[83].flags == 149, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[83].flags, " + "expected 149, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[83].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[83].sensor_type == 147, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[83].sensor_type, " + "expected 147, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[83].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[84].flags == 144, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[84].flags, " + "expected 144, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[84].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[84].sensor_type == 23, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[84].sensor_type, " + "expected 23, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[84].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[85].flags == 239, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[85].flags, " + "expected 239, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[85].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[85].sensor_type == 148, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[85].sensor_type, " + "expected 148, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[85].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[86].flags == 186, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[86].flags, " + "expected 186, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[86].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[86].sensor_type == 195, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[86].sensor_type, " + "expected 195, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[86].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[87].flags == 30, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[87].flags, " + "expected 30, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[87].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[87].sensor_type == 86, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[87].sensor_type, " + "expected 86, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[87].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[88].flags == 143, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[88].flags, " + "expected 143, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[88].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[88].sensor_type == 34, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[88].sensor_type, " + "expected 34, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[88].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[89].flags == 207, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[89].flags, " + "expected 207, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[89].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[89].sensor_type == 156, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[89].sensor_type, " + "expected 156, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[89].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[90].flags == 55, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[90].flags, " + "expected 55, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[90].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[90].sensor_type == 63, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[90].sensor_type, " + "expected 63, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[90].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[91].flags == 255, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[91].flags, " + "expected 255, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[91].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[91].sensor_type == 117, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[91].sensor_type, " + "expected 117, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[91].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[92].flags == 222, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[92].flags, " + "expected 222, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[92].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[92].sensor_type == 222, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[92].sensor_type, " + "expected 222, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[92].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[93].flags == 145, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[93].flags, " + "expected 145, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[93].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[93].sensor_type == 219, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[93].sensor_type, " + "expected 219, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[93].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[94].flags == 191, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[94].flags, " + "expected 191, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[94].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[94].sensor_type == 224, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[94].sensor_type, " + "expected 224, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[94].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[95].flags == 109, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[95].flags, " + "expected 109, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[95].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[95].sensor_type == 210, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[95].sensor_type, " + "expected 210, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[95].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[96].flags == 153, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[96].flags, " + "expected 153, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[96].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[96].sensor_type == 86, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[96].sensor_type, " + "expected 86, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[96].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[97].flags == 32, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[97].flags, " + "expected 32, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[97].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[97].sensor_type == 21, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[97].sensor_type, " + "expected 21, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[97].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[98].flags == 10, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[98].flags, " + "expected 10, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[98].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[98].sensor_type == 226, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[98].sensor_type, " + "expected 226, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[98].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[99].flags == 63, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[99].flags, " + "expected 63, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[99].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[99].sensor_type == 60, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[99].sensor_type, " + "expected 60, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[99].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[100].flags == 236, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[100].flags, " + "expected 236, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[100].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[100].sensor_type == 106, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[100].sensor_type, " + "expected 106, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[100].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[101].flags == 96, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[101].flags, " + "expected 96, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[101].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[101].sensor_type == 93, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[101].sensor_type, " + "expected 93, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[101].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[102].flags == 163, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[102].flags, " + "expected 163, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[102].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[102].sensor_type == 30, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[102].sensor_type, " + "expected 30, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[102].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[103].flags == 238, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[103].flags, " + "expected 238, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[103].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[103].sensor_type == 106, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[103].sensor_type, " + "expected 106, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[103].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[104].flags == 133, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[104].flags, " + "expected 133, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[104].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[104].sensor_type == 147, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[104].sensor_type, " + "expected 147, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[104].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[105].flags == 107, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[105].flags, " + "expected 107, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[105].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[105].sensor_type == 132, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[105].sensor_type, " + "expected 132, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[105].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[106].flags == 214, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[106].flags, " + "expected 214, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[106].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[106].sensor_type == 152, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[106].sensor_type, " + "expected 152, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[106].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[107].flags == 185, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[107].flags, " + "expected 185, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[107].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[107].sensor_type == 221, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[107].sensor_type, " + "expected 221, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[107].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[108].flags == 21, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[108].flags, " + "expected 21, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[108].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[108].sensor_type == 202, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[108].sensor_type, " + "expected 202, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[108].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[109].flags == 51, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[109].flags, " + "expected 51, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[109].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[109].sensor_type == 252, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[109].sensor_type, " + "expected 252, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[109].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[110].flags == 59, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[110].flags, " + "expected 59, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[110].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[110].sensor_type == 130, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[110].sensor_type, " + "expected 130, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[110].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[111].flags == 202, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[111].flags, " + "expected 202, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[111].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[111].sensor_type == 166, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[111].sensor_type, " + "expected 166, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[111].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[112].flags == 170, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[112].flags, " + "expected 170, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[112].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[112].sensor_type == 127, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[112].sensor_type, " + "expected 127, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[112].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[113].flags == 193, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[113].flags, " + "expected 193, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[113].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[113].sensor_type == 58, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[113].sensor_type, " + "expected 58, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[113].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[114].flags == 125, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[114].flags, " + "expected 125, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[114].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[114].sensor_type == 215, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[114].sensor_type, " + "expected 215, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[114].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[115].flags == 58, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[115].flags, " + "expected 58, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[115].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[115].sensor_type == 22, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[115].sensor_type, " + "expected 22, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[115].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[116].flags == 47, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[116].flags, " + "expected 47, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[116].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[116].sensor_type == 135, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[116].sensor_type, " + "expected 135, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[116].sensor_type); + + ck_assert_msg( + last_msg.msg.soln_meta_dep_a.sol_in[117].flags == 142, + "incorrect value for last_msg.msg.soln_meta_dep_a.sol_in[117].flags, " + "expected 142, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[117].flags); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.sol_in[117].sensor_type == 88, + "incorrect value for " + "last_msg.msg.soln_meta_dep_a.sol_in[117].sensor_type, " + "expected 88, is %d", + last_msg.msg.soln_meta_dep_a.sol_in[117].sensor_type); + + ck_assert_msg(last_msg.msg.soln_meta_dep_a.vdop == 41989, + "incorrect value for last_msg.msg.soln_meta_dep_a.vdop, " + "expected 41989, is %d", + last_msg.msg.soln_meta_dep_a.vdop); } } END_TEST -Suite* auto_check_sbp_solution_meta_MsgSolnMetaDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_solution_meta_MsgSolnMetaDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_solution_meta_MsgSolnMetaDepA"); +Suite *auto_check_sbp_solution_meta_MsgSolnMetaDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_solution_meta_MsgSolnMetaDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_solution_meta_MsgSolnMetaDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_solution_meta_MsgSolnMetaDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrCodeBiases.c b/c/test/auto_check_sbp_ssr_MsgSsrCodeBiases.c index c3cebab16..c13a5b66e 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrCodeBiases.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrCodeBiases.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodeBiases.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodeBiases.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrCodeBiases ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrCodeBiases) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrCodeBiases ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,806 +90,1414 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrCodeBiases ) logging_reset(); - sbp_callback_register(&sbp_state, 0x5e1, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x5e1, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,225,5,39,87,253,208,90,19,23,9,66,133,241,254,132,51,4,131,240,120,83,148,209,213,62,228,232,71,66,188,210,128,54,131,152,129,111,139,242,177,145,44,9,245,207,241,202,150,141,50,159,220,139,37,187,98,191,23,128,136,167,200,6,211,90,23,244,138,215,209,139,13,101,32,7,18,29,70,250,109,73,202,79,144,9,146,69,241,52,22,99,98,204,3,171,230,180,75,62,145,86,130,31,30,155,37,18,55,210,39,127,242,66,13,237,152,170,212,15,246,59,94,180,195,157,69,100,119,16,68,179,175,144,113,81,82,30,151,21,109,41,225,8,77,164,157,0,73,30,6,78,81,143,116,240,151,55,185,169,254,51,39,74,175,247,34,97,74,97,176,48,236,173,12,174,101,130,30,169,193,190,204,196,123,107,25,225,74,9,10,55,3,131,246,99,133,34,227,203,68,18,97,223,89,192,246,50,69,91,10,151,74,118,110,36,168,247,160,77,179,141,178,99,191,120,77,192,91,224,1,226,50,87,146,148,238,100,179,125,227,215,104,184,31,57,90,79,21,156,245,81,60,93,170,60,200,167,13,125,132, }; + u8 encoded_frame[] = { + 85, 225, 5, 39, 87, 253, 208, 90, 19, 23, 9, 66, 133, 241, + 254, 132, 51, 4, 131, 240, 120, 83, 148, 209, 213, 62, 228, 232, + 71, 66, 188, 210, 128, 54, 131, 152, 129, 111, 139, 242, 177, 145, + 44, 9, 245, 207, 241, 202, 150, 141, 50, 159, 220, 139, 37, 187, + 98, 191, 23, 128, 136, 167, 200, 6, 211, 90, 23, 244, 138, 215, + 209, 139, 13, 101, 32, 7, 18, 29, 70, 250, 109, 73, 202, 79, + 144, 9, 146, 69, 241, 52, 22, 99, 98, 204, 3, 171, 230, 180, + 75, 62, 145, 86, 130, 31, 30, 155, 37, 18, 55, 210, 39, 127, + 242, 66, 13, 237, 152, 170, 212, 15, 246, 59, 94, 180, 195, 157, + 69, 100, 119, 16, 68, 179, 175, 144, 113, 81, 82, 30, 151, 21, + 109, 41, 225, 8, 77, 164, 157, 0, 73, 30, 6, 78, 81, 143, + 116, 240, 151, 55, 185, 169, 254, 51, 39, 74, 175, 247, 34, 97, + 74, 97, 176, 48, 236, 173, 12, 174, 101, 130, 30, 169, 193, 190, + 204, 196, 123, 107, 25, 225, 74, 9, 10, 55, 3, 131, 246, 99, + 133, 34, 227, 203, 68, 18, 97, 223, 89, 192, 246, 50, 69, 91, + 10, 151, 74, 118, 110, 36, 168, 247, 160, 77, 179, 141, 178, 99, + 191, 120, 77, 192, 91, 224, 1, 226, 50, 87, 146, 148, 238, 100, + 179, 125, 227, 215, 104, 184, 31, 57, 90, 79, 21, 156, 245, 81, + 60, 93, 170, 60, 200, 167, 13, 125, 132, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - + test_msg.ssr_code_biases.biases[0].code = 51; - + test_msg.ssr_code_biases.biases[0].value = -31996; - - + test_msg.ssr_code_biases.biases[1].code = 240; - + test_msg.ssr_code_biases.biases[1].value = 21368; - - + test_msg.ssr_code_biases.biases[2].code = 148; - + test_msg.ssr_code_biases.biases[2].value = -10799; - - + test_msg.ssr_code_biases.biases[3].code = 62; - + test_msg.ssr_code_biases.biases[3].value = -5916; - - + test_msg.ssr_code_biases.biases[4].code = 71; - + test_msg.ssr_code_biases.biases[4].value = -17342; - - + test_msg.ssr_code_biases.biases[5].code = 210; - + test_msg.ssr_code_biases.biases[5].value = 13952; - - + test_msg.ssr_code_biases.biases[6].code = 131; - + test_msg.ssr_code_biases.biases[6].value = -32360; - - + test_msg.ssr_code_biases.biases[7].code = 111; - + test_msg.ssr_code_biases.biases[7].value = -3445; - - + test_msg.ssr_code_biases.biases[8].code = 177; - + test_msg.ssr_code_biases.biases[8].value = 11409; - - + test_msg.ssr_code_biases.biases[9].code = 9; - + test_msg.ssr_code_biases.biases[9].value = -12299; - - + test_msg.ssr_code_biases.biases[10].code = 241; - + test_msg.ssr_code_biases.biases[10].value = -26934; - - + test_msg.ssr_code_biases.biases[11].code = 141; - + test_msg.ssr_code_biases.biases[11].value = -24782; - - + test_msg.ssr_code_biases.biases[12].code = 220; - + test_msg.ssr_code_biases.biases[12].value = 9611; - - + test_msg.ssr_code_biases.biases[13].code = 187; - + test_msg.ssr_code_biases.biases[13].value = -16542; - - + test_msg.ssr_code_biases.biases[14].code = 23; - + test_msg.ssr_code_biases.biases[14].value = -30592; - - + test_msg.ssr_code_biases.biases[15].code = 167; - + test_msg.ssr_code_biases.biases[15].value = 1736; - - + test_msg.ssr_code_biases.biases[16].code = 211; - + test_msg.ssr_code_biases.biases[16].value = 5978; - - + test_msg.ssr_code_biases.biases[17].code = 244; - + test_msg.ssr_code_biases.biases[17].value = -10358; - - + test_msg.ssr_code_biases.biases[18].code = 209; - + test_msg.ssr_code_biases.biases[18].value = 3467; - - + test_msg.ssr_code_biases.biases[19].code = 101; - + test_msg.ssr_code_biases.biases[19].value = 1824; - - + test_msg.ssr_code_biases.biases[20].code = 18; - + test_msg.ssr_code_biases.biases[20].value = 17949; - - + test_msg.ssr_code_biases.biases[21].code = 250; - + test_msg.ssr_code_biases.biases[21].value = 18797; - - + test_msg.ssr_code_biases.biases[22].code = 202; - + test_msg.ssr_code_biases.biases[22].value = -28593; - - + test_msg.ssr_code_biases.biases[23].code = 9; - + test_msg.ssr_code_biases.biases[23].value = 17810; - - + test_msg.ssr_code_biases.biases[24].code = 241; - + test_msg.ssr_code_biases.biases[24].value = 5684; - - + test_msg.ssr_code_biases.biases[25].code = 99; - + test_msg.ssr_code_biases.biases[25].value = -13214; - - + test_msg.ssr_code_biases.biases[26].code = 3; - + test_msg.ssr_code_biases.biases[26].value = -6485; - - + test_msg.ssr_code_biases.biases[27].code = 180; - + test_msg.ssr_code_biases.biases[27].value = 15947; - - + test_msg.ssr_code_biases.biases[28].code = 145; - + test_msg.ssr_code_biases.biases[28].value = -32170; - - + test_msg.ssr_code_biases.biases[29].code = 31; - + test_msg.ssr_code_biases.biases[29].value = -25826; - - + test_msg.ssr_code_biases.biases[30].code = 37; - + test_msg.ssr_code_biases.biases[30].value = 14098; - - + test_msg.ssr_code_biases.biases[31].code = 210; - + test_msg.ssr_code_biases.biases[31].value = 32551; - - + test_msg.ssr_code_biases.biases[32].code = 242; - + test_msg.ssr_code_biases.biases[32].value = 3394; - - + test_msg.ssr_code_biases.biases[33].code = 237; - + test_msg.ssr_code_biases.biases[33].value = -21864; - - + test_msg.ssr_code_biases.biases[34].code = 212; - + test_msg.ssr_code_biases.biases[34].value = -2545; - - + test_msg.ssr_code_biases.biases[35].code = 59; - + test_msg.ssr_code_biases.biases[35].value = -19362; - - + test_msg.ssr_code_biases.biases[36].code = 195; - + test_msg.ssr_code_biases.biases[36].value = 17821; - - + test_msg.ssr_code_biases.biases[37].code = 100; - + test_msg.ssr_code_biases.biases[37].value = 4215; - - + test_msg.ssr_code_biases.biases[38].code = 68; - + test_msg.ssr_code_biases.biases[38].value = -20557; - - + test_msg.ssr_code_biases.biases[39].code = 144; - + test_msg.ssr_code_biases.biases[39].value = 20849; - - + test_msg.ssr_code_biases.biases[40].code = 82; - + test_msg.ssr_code_biases.biases[40].value = -26850; - - + test_msg.ssr_code_biases.biases[41].code = 21; - + test_msg.ssr_code_biases.biases[41].value = 10605; - - + test_msg.ssr_code_biases.biases[42].code = 225; - + test_msg.ssr_code_biases.biases[42].value = 19720; - - + test_msg.ssr_code_biases.biases[43].code = 164; - + test_msg.ssr_code_biases.biases[43].value = 157; - - + test_msg.ssr_code_biases.biases[44].code = 73; - + test_msg.ssr_code_biases.biases[44].value = 1566; - - + test_msg.ssr_code_biases.biases[45].code = 78; - + test_msg.ssr_code_biases.biases[45].value = -28847; - - + test_msg.ssr_code_biases.biases[46].code = 116; - + test_msg.ssr_code_biases.biases[46].value = -26640; - - + test_msg.ssr_code_biases.biases[47].code = 55; - + test_msg.ssr_code_biases.biases[47].value = -22087; - - + test_msg.ssr_code_biases.biases[48].code = 254; - + test_msg.ssr_code_biases.biases[48].value = 10035; - - + test_msg.ssr_code_biases.biases[49].code = 74; - + test_msg.ssr_code_biases.biases[49].value = -2129; - - + test_msg.ssr_code_biases.biases[50].code = 34; - + test_msg.ssr_code_biases.biases[50].value = 19041; - - + test_msg.ssr_code_biases.biases[51].code = 97; - + test_msg.ssr_code_biases.biases[51].value = 12464; - - + test_msg.ssr_code_biases.biases[52].code = 236; - + test_msg.ssr_code_biases.biases[52].value = 3245; - - + test_msg.ssr_code_biases.biases[53].code = 174; - + test_msg.ssr_code_biases.biases[53].value = -32155; - - + test_msg.ssr_code_biases.biases[54].code = 30; - + test_msg.ssr_code_biases.biases[54].value = -15959; - - + test_msg.ssr_code_biases.biases[55].code = 190; - + test_msg.ssr_code_biases.biases[55].value = -15156; - - + test_msg.ssr_code_biases.biases[56].code = 123; - + test_msg.ssr_code_biases.biases[56].value = 6507; - - + test_msg.ssr_code_biases.biases[57].code = 225; - + test_msg.ssr_code_biases.biases[57].value = 2378; - - + test_msg.ssr_code_biases.biases[58].code = 10; - + test_msg.ssr_code_biases.biases[58].value = 823; - - + test_msg.ssr_code_biases.biases[59].code = 131; - + test_msg.ssr_code_biases.biases[59].value = 25590; - - + test_msg.ssr_code_biases.biases[60].code = 133; - + test_msg.ssr_code_biases.biases[60].value = -7390; - - + test_msg.ssr_code_biases.biases[61].code = 203; - + test_msg.ssr_code_biases.biases[61].value = 4676; - - + test_msg.ssr_code_biases.biases[62].code = 97; - + test_msg.ssr_code_biases.biases[62].value = 23007; - - + test_msg.ssr_code_biases.biases[63].code = 192; - + test_msg.ssr_code_biases.biases[63].value = 13046; - - + test_msg.ssr_code_biases.biases[64].code = 69; - + test_msg.ssr_code_biases.biases[64].value = 2651; - - + test_msg.ssr_code_biases.biases[65].code = 151; - + test_msg.ssr_code_biases.biases[65].value = 30282; - - + test_msg.ssr_code_biases.biases[66].code = 110; - + test_msg.ssr_code_biases.biases[66].value = -22492; - - + test_msg.ssr_code_biases.biases[67].code = 247; - + test_msg.ssr_code_biases.biases[67].value = 19872; - - + test_msg.ssr_code_biases.biases[68].code = 179; - + test_msg.ssr_code_biases.biases[68].value = -19827; - - + test_msg.ssr_code_biases.biases[69].code = 99; - + test_msg.ssr_code_biases.biases[69].value = 30911; - - + test_msg.ssr_code_biases.biases[70].code = 77; - + test_msg.ssr_code_biases.biases[70].value = 23488; - - + test_msg.ssr_code_biases.biases[71].code = 224; - + test_msg.ssr_code_biases.biases[71].value = -7679; - - + test_msg.ssr_code_biases.biases[72].code = 50; - + test_msg.ssr_code_biases.biases[72].value = -28073; - - + test_msg.ssr_code_biases.biases[73].code = 148; - + test_msg.ssr_code_biases.biases[73].value = 25838; - - + test_msg.ssr_code_biases.biases[74].code = 179; - + test_msg.ssr_code_biases.biases[74].value = -7299; - - + test_msg.ssr_code_biases.biases[75].code = 215; - + test_msg.ssr_code_biases.biases[75].value = -18328; - - + test_msg.ssr_code_biases.biases[76].code = 31; - + test_msg.ssr_code_biases.biases[76].value = 23097; - - + test_msg.ssr_code_biases.biases[77].code = 79; - + test_msg.ssr_code_biases.biases[77].value = -25579; - - + test_msg.ssr_code_biases.biases[78].code = 245; - + test_msg.ssr_code_biases.biases[78].value = 15441; - - + test_msg.ssr_code_biases.biases[79].code = 93; - + test_msg.ssr_code_biases.biases[79].value = 15530; - - + test_msg.ssr_code_biases.biases[80].code = 200; - + test_msg.ssr_code_biases.biases[80].value = 3495; - + test_msg.ssr_code_biases.iod_ssr = 132; - + test_msg.ssr_code_biases.n_biases = 81; - - + test_msg.ssr_code_biases.sid.code = 241; - + test_msg.ssr_code_biases.sid.sat = 133; - - + test_msg.ssr_code_biases.time.tow = 387144400; - + test_msg.ssr_code_biases.time.wn = 16905; - + test_msg.ssr_code_biases.update_interval = 254; - sbp_message_send(&sbp_state, SbpMsgSsrCodeBiases, 22311, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrCodeBiases, 22311, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 22311, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSsrCodeBiases, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSsrCodeBiases, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[0].code == 51, "incorrect value for last_msg.msg.ssr_code_biases.biases[0].code, expected 51, is %d", last_msg.msg.ssr_code_biases.biases[0].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[0].value == -31996, "incorrect value for last_msg.msg.ssr_code_biases.biases[0].value, expected -31996, is %d", last_msg.msg.ssr_code_biases.biases[0].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[1].code == 240, "incorrect value for last_msg.msg.ssr_code_biases.biases[1].code, expected 240, is %d", last_msg.msg.ssr_code_biases.biases[1].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[1].value == 21368, "incorrect value for last_msg.msg.ssr_code_biases.biases[1].value, expected 21368, is %d", last_msg.msg.ssr_code_biases.biases[1].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[2].code == 148, "incorrect value for last_msg.msg.ssr_code_biases.biases[2].code, expected 148, is %d", last_msg.msg.ssr_code_biases.biases[2].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[2].value == -10799, "incorrect value for last_msg.msg.ssr_code_biases.biases[2].value, expected -10799, is %d", last_msg.msg.ssr_code_biases.biases[2].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[3].code == 62, "incorrect value for last_msg.msg.ssr_code_biases.biases[3].code, expected 62, is %d", last_msg.msg.ssr_code_biases.biases[3].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[3].value == -5916, "incorrect value for last_msg.msg.ssr_code_biases.biases[3].value, expected -5916, is %d", last_msg.msg.ssr_code_biases.biases[3].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[4].code == 71, "incorrect value for last_msg.msg.ssr_code_biases.biases[4].code, expected 71, is %d", last_msg.msg.ssr_code_biases.biases[4].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[4].value == -17342, "incorrect value for last_msg.msg.ssr_code_biases.biases[4].value, expected -17342, is %d", last_msg.msg.ssr_code_biases.biases[4].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[5].code == 210, "incorrect value for last_msg.msg.ssr_code_biases.biases[5].code, expected 210, is %d", last_msg.msg.ssr_code_biases.biases[5].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[5].value == 13952, "incorrect value for last_msg.msg.ssr_code_biases.biases[5].value, expected 13952, is %d", last_msg.msg.ssr_code_biases.biases[5].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[6].code == 131, "incorrect value for last_msg.msg.ssr_code_biases.biases[6].code, expected 131, is %d", last_msg.msg.ssr_code_biases.biases[6].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[6].value == -32360, "incorrect value for last_msg.msg.ssr_code_biases.biases[6].value, expected -32360, is %d", last_msg.msg.ssr_code_biases.biases[6].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[7].code == 111, "incorrect value for last_msg.msg.ssr_code_biases.biases[7].code, expected 111, is %d", last_msg.msg.ssr_code_biases.biases[7].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[7].value == -3445, "incorrect value for last_msg.msg.ssr_code_biases.biases[7].value, expected -3445, is %d", last_msg.msg.ssr_code_biases.biases[7].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[8].code == 177, "incorrect value for last_msg.msg.ssr_code_biases.biases[8].code, expected 177, is %d", last_msg.msg.ssr_code_biases.biases[8].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[8].value == 11409, "incorrect value for last_msg.msg.ssr_code_biases.biases[8].value, expected 11409, is %d", last_msg.msg.ssr_code_biases.biases[8].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[9].code == 9, "incorrect value for last_msg.msg.ssr_code_biases.biases[9].code, expected 9, is %d", last_msg.msg.ssr_code_biases.biases[9].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[9].value == -12299, "incorrect value for last_msg.msg.ssr_code_biases.biases[9].value, expected -12299, is %d", last_msg.msg.ssr_code_biases.biases[9].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[10].code == 241, "incorrect value for last_msg.msg.ssr_code_biases.biases[10].code, expected 241, is %d", last_msg.msg.ssr_code_biases.biases[10].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[10].value == -26934, "incorrect value for last_msg.msg.ssr_code_biases.biases[10].value, expected -26934, is %d", last_msg.msg.ssr_code_biases.biases[10].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[11].code == 141, "incorrect value for last_msg.msg.ssr_code_biases.biases[11].code, expected 141, is %d", last_msg.msg.ssr_code_biases.biases[11].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[11].value == -24782, "incorrect value for last_msg.msg.ssr_code_biases.biases[11].value, expected -24782, is %d", last_msg.msg.ssr_code_biases.biases[11].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[12].code == 220, "incorrect value for last_msg.msg.ssr_code_biases.biases[12].code, expected 220, is %d", last_msg.msg.ssr_code_biases.biases[12].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[12].value == 9611, "incorrect value for last_msg.msg.ssr_code_biases.biases[12].value, expected 9611, is %d", last_msg.msg.ssr_code_biases.biases[12].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[13].code == 187, "incorrect value for last_msg.msg.ssr_code_biases.biases[13].code, expected 187, is %d", last_msg.msg.ssr_code_biases.biases[13].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[13].value == -16542, "incorrect value for last_msg.msg.ssr_code_biases.biases[13].value, expected -16542, is %d", last_msg.msg.ssr_code_biases.biases[13].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[14].code == 23, "incorrect value for last_msg.msg.ssr_code_biases.biases[14].code, expected 23, is %d", last_msg.msg.ssr_code_biases.biases[14].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[14].value == -30592, "incorrect value for last_msg.msg.ssr_code_biases.biases[14].value, expected -30592, is %d", last_msg.msg.ssr_code_biases.biases[14].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[15].code == 167, "incorrect value for last_msg.msg.ssr_code_biases.biases[15].code, expected 167, is %d", last_msg.msg.ssr_code_biases.biases[15].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[15].value == 1736, "incorrect value for last_msg.msg.ssr_code_biases.biases[15].value, expected 1736, is %d", last_msg.msg.ssr_code_biases.biases[15].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[16].code == 211, "incorrect value for last_msg.msg.ssr_code_biases.biases[16].code, expected 211, is %d", last_msg.msg.ssr_code_biases.biases[16].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[16].value == 5978, "incorrect value for last_msg.msg.ssr_code_biases.biases[16].value, expected 5978, is %d", last_msg.msg.ssr_code_biases.biases[16].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[17].code == 244, "incorrect value for last_msg.msg.ssr_code_biases.biases[17].code, expected 244, is %d", last_msg.msg.ssr_code_biases.biases[17].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[17].value == -10358, "incorrect value for last_msg.msg.ssr_code_biases.biases[17].value, expected -10358, is %d", last_msg.msg.ssr_code_biases.biases[17].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[18].code == 209, "incorrect value for last_msg.msg.ssr_code_biases.biases[18].code, expected 209, is %d", last_msg.msg.ssr_code_biases.biases[18].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[18].value == 3467, "incorrect value for last_msg.msg.ssr_code_biases.biases[18].value, expected 3467, is %d", last_msg.msg.ssr_code_biases.biases[18].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[19].code == 101, "incorrect value for last_msg.msg.ssr_code_biases.biases[19].code, expected 101, is %d", last_msg.msg.ssr_code_biases.biases[19].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[19].value == 1824, "incorrect value for last_msg.msg.ssr_code_biases.biases[19].value, expected 1824, is %d", last_msg.msg.ssr_code_biases.biases[19].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[20].code == 18, "incorrect value for last_msg.msg.ssr_code_biases.biases[20].code, expected 18, is %d", last_msg.msg.ssr_code_biases.biases[20].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[20].value == 17949, "incorrect value for last_msg.msg.ssr_code_biases.biases[20].value, expected 17949, is %d", last_msg.msg.ssr_code_biases.biases[20].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[21].code == 250, "incorrect value for last_msg.msg.ssr_code_biases.biases[21].code, expected 250, is %d", last_msg.msg.ssr_code_biases.biases[21].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[21].value == 18797, "incorrect value for last_msg.msg.ssr_code_biases.biases[21].value, expected 18797, is %d", last_msg.msg.ssr_code_biases.biases[21].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[22].code == 202, "incorrect value for last_msg.msg.ssr_code_biases.biases[22].code, expected 202, is %d", last_msg.msg.ssr_code_biases.biases[22].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[22].value == -28593, "incorrect value for last_msg.msg.ssr_code_biases.biases[22].value, expected -28593, is %d", last_msg.msg.ssr_code_biases.biases[22].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[23].code == 9, "incorrect value for last_msg.msg.ssr_code_biases.biases[23].code, expected 9, is %d", last_msg.msg.ssr_code_biases.biases[23].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[23].value == 17810, "incorrect value for last_msg.msg.ssr_code_biases.biases[23].value, expected 17810, is %d", last_msg.msg.ssr_code_biases.biases[23].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[24].code == 241, "incorrect value for last_msg.msg.ssr_code_biases.biases[24].code, expected 241, is %d", last_msg.msg.ssr_code_biases.biases[24].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[24].value == 5684, "incorrect value for last_msg.msg.ssr_code_biases.biases[24].value, expected 5684, is %d", last_msg.msg.ssr_code_biases.biases[24].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[25].code == 99, "incorrect value for last_msg.msg.ssr_code_biases.biases[25].code, expected 99, is %d", last_msg.msg.ssr_code_biases.biases[25].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[25].value == -13214, "incorrect value for last_msg.msg.ssr_code_biases.biases[25].value, expected -13214, is %d", last_msg.msg.ssr_code_biases.biases[25].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[26].code == 3, "incorrect value for last_msg.msg.ssr_code_biases.biases[26].code, expected 3, is %d", last_msg.msg.ssr_code_biases.biases[26].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[26].value == -6485, "incorrect value for last_msg.msg.ssr_code_biases.biases[26].value, expected -6485, is %d", last_msg.msg.ssr_code_biases.biases[26].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[27].code == 180, "incorrect value for last_msg.msg.ssr_code_biases.biases[27].code, expected 180, is %d", last_msg.msg.ssr_code_biases.biases[27].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[27].value == 15947, "incorrect value for last_msg.msg.ssr_code_biases.biases[27].value, expected 15947, is %d", last_msg.msg.ssr_code_biases.biases[27].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[28].code == 145, "incorrect value for last_msg.msg.ssr_code_biases.biases[28].code, expected 145, is %d", last_msg.msg.ssr_code_biases.biases[28].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[28].value == -32170, "incorrect value for last_msg.msg.ssr_code_biases.biases[28].value, expected -32170, is %d", last_msg.msg.ssr_code_biases.biases[28].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[29].code == 31, "incorrect value for last_msg.msg.ssr_code_biases.biases[29].code, expected 31, is %d", last_msg.msg.ssr_code_biases.biases[29].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[29].value == -25826, "incorrect value for last_msg.msg.ssr_code_biases.biases[29].value, expected -25826, is %d", last_msg.msg.ssr_code_biases.biases[29].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[30].code == 37, "incorrect value for last_msg.msg.ssr_code_biases.biases[30].code, expected 37, is %d", last_msg.msg.ssr_code_biases.biases[30].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[30].value == 14098, "incorrect value for last_msg.msg.ssr_code_biases.biases[30].value, expected 14098, is %d", last_msg.msg.ssr_code_biases.biases[30].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[31].code == 210, "incorrect value for last_msg.msg.ssr_code_biases.biases[31].code, expected 210, is %d", last_msg.msg.ssr_code_biases.biases[31].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[31].value == 32551, "incorrect value for last_msg.msg.ssr_code_biases.biases[31].value, expected 32551, is %d", last_msg.msg.ssr_code_biases.biases[31].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[32].code == 242, "incorrect value for last_msg.msg.ssr_code_biases.biases[32].code, expected 242, is %d", last_msg.msg.ssr_code_biases.biases[32].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[32].value == 3394, "incorrect value for last_msg.msg.ssr_code_biases.biases[32].value, expected 3394, is %d", last_msg.msg.ssr_code_biases.biases[32].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[33].code == 237, "incorrect value for last_msg.msg.ssr_code_biases.biases[33].code, expected 237, is %d", last_msg.msg.ssr_code_biases.biases[33].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[33].value == -21864, "incorrect value for last_msg.msg.ssr_code_biases.biases[33].value, expected -21864, is %d", last_msg.msg.ssr_code_biases.biases[33].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[34].code == 212, "incorrect value for last_msg.msg.ssr_code_biases.biases[34].code, expected 212, is %d", last_msg.msg.ssr_code_biases.biases[34].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[34].value == -2545, "incorrect value for last_msg.msg.ssr_code_biases.biases[34].value, expected -2545, is %d", last_msg.msg.ssr_code_biases.biases[34].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[35].code == 59, "incorrect value for last_msg.msg.ssr_code_biases.biases[35].code, expected 59, is %d", last_msg.msg.ssr_code_biases.biases[35].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[35].value == -19362, "incorrect value for last_msg.msg.ssr_code_biases.biases[35].value, expected -19362, is %d", last_msg.msg.ssr_code_biases.biases[35].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[36].code == 195, "incorrect value for last_msg.msg.ssr_code_biases.biases[36].code, expected 195, is %d", last_msg.msg.ssr_code_biases.biases[36].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[36].value == 17821, "incorrect value for last_msg.msg.ssr_code_biases.biases[36].value, expected 17821, is %d", last_msg.msg.ssr_code_biases.biases[36].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[37].code == 100, "incorrect value for last_msg.msg.ssr_code_biases.biases[37].code, expected 100, is %d", last_msg.msg.ssr_code_biases.biases[37].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[37].value == 4215, "incorrect value for last_msg.msg.ssr_code_biases.biases[37].value, expected 4215, is %d", last_msg.msg.ssr_code_biases.biases[37].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[38].code == 68, "incorrect value for last_msg.msg.ssr_code_biases.biases[38].code, expected 68, is %d", last_msg.msg.ssr_code_biases.biases[38].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[38].value == -20557, "incorrect value for last_msg.msg.ssr_code_biases.biases[38].value, expected -20557, is %d", last_msg.msg.ssr_code_biases.biases[38].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[39].code == 144, "incorrect value for last_msg.msg.ssr_code_biases.biases[39].code, expected 144, is %d", last_msg.msg.ssr_code_biases.biases[39].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[39].value == 20849, "incorrect value for last_msg.msg.ssr_code_biases.biases[39].value, expected 20849, is %d", last_msg.msg.ssr_code_biases.biases[39].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[40].code == 82, "incorrect value for last_msg.msg.ssr_code_biases.biases[40].code, expected 82, is %d", last_msg.msg.ssr_code_biases.biases[40].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[40].value == -26850, "incorrect value for last_msg.msg.ssr_code_biases.biases[40].value, expected -26850, is %d", last_msg.msg.ssr_code_biases.biases[40].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[41].code == 21, "incorrect value for last_msg.msg.ssr_code_biases.biases[41].code, expected 21, is %d", last_msg.msg.ssr_code_biases.biases[41].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[41].value == 10605, "incorrect value for last_msg.msg.ssr_code_biases.biases[41].value, expected 10605, is %d", last_msg.msg.ssr_code_biases.biases[41].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[42].code == 225, "incorrect value for last_msg.msg.ssr_code_biases.biases[42].code, expected 225, is %d", last_msg.msg.ssr_code_biases.biases[42].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[42].value == 19720, "incorrect value for last_msg.msg.ssr_code_biases.biases[42].value, expected 19720, is %d", last_msg.msg.ssr_code_biases.biases[42].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[43].code == 164, "incorrect value for last_msg.msg.ssr_code_biases.biases[43].code, expected 164, is %d", last_msg.msg.ssr_code_biases.biases[43].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[43].value == 157, "incorrect value for last_msg.msg.ssr_code_biases.biases[43].value, expected 157, is %d", last_msg.msg.ssr_code_biases.biases[43].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[44].code == 73, "incorrect value for last_msg.msg.ssr_code_biases.biases[44].code, expected 73, is %d", last_msg.msg.ssr_code_biases.biases[44].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[44].value == 1566, "incorrect value for last_msg.msg.ssr_code_biases.biases[44].value, expected 1566, is %d", last_msg.msg.ssr_code_biases.biases[44].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[45].code == 78, "incorrect value for last_msg.msg.ssr_code_biases.biases[45].code, expected 78, is %d", last_msg.msg.ssr_code_biases.biases[45].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[45].value == -28847, "incorrect value for last_msg.msg.ssr_code_biases.biases[45].value, expected -28847, is %d", last_msg.msg.ssr_code_biases.biases[45].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[46].code == 116, "incorrect value for last_msg.msg.ssr_code_biases.biases[46].code, expected 116, is %d", last_msg.msg.ssr_code_biases.biases[46].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[46].value == -26640, "incorrect value for last_msg.msg.ssr_code_biases.biases[46].value, expected -26640, is %d", last_msg.msg.ssr_code_biases.biases[46].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[47].code == 55, "incorrect value for last_msg.msg.ssr_code_biases.biases[47].code, expected 55, is %d", last_msg.msg.ssr_code_biases.biases[47].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[47].value == -22087, "incorrect value for last_msg.msg.ssr_code_biases.biases[47].value, expected -22087, is %d", last_msg.msg.ssr_code_biases.biases[47].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[48].code == 254, "incorrect value for last_msg.msg.ssr_code_biases.biases[48].code, expected 254, is %d", last_msg.msg.ssr_code_biases.biases[48].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[48].value == 10035, "incorrect value for last_msg.msg.ssr_code_biases.biases[48].value, expected 10035, is %d", last_msg.msg.ssr_code_biases.biases[48].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[49].code == 74, "incorrect value for last_msg.msg.ssr_code_biases.biases[49].code, expected 74, is %d", last_msg.msg.ssr_code_biases.biases[49].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[49].value == -2129, "incorrect value for last_msg.msg.ssr_code_biases.biases[49].value, expected -2129, is %d", last_msg.msg.ssr_code_biases.biases[49].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[50].code == 34, "incorrect value for last_msg.msg.ssr_code_biases.biases[50].code, expected 34, is %d", last_msg.msg.ssr_code_biases.biases[50].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[50].value == 19041, "incorrect value for last_msg.msg.ssr_code_biases.biases[50].value, expected 19041, is %d", last_msg.msg.ssr_code_biases.biases[50].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[51].code == 97, "incorrect value for last_msg.msg.ssr_code_biases.biases[51].code, expected 97, is %d", last_msg.msg.ssr_code_biases.biases[51].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[51].value == 12464, "incorrect value for last_msg.msg.ssr_code_biases.biases[51].value, expected 12464, is %d", last_msg.msg.ssr_code_biases.biases[51].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[52].code == 236, "incorrect value for last_msg.msg.ssr_code_biases.biases[52].code, expected 236, is %d", last_msg.msg.ssr_code_biases.biases[52].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[52].value == 3245, "incorrect value for last_msg.msg.ssr_code_biases.biases[52].value, expected 3245, is %d", last_msg.msg.ssr_code_biases.biases[52].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[53].code == 174, "incorrect value for last_msg.msg.ssr_code_biases.biases[53].code, expected 174, is %d", last_msg.msg.ssr_code_biases.biases[53].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[53].value == -32155, "incorrect value for last_msg.msg.ssr_code_biases.biases[53].value, expected -32155, is %d", last_msg.msg.ssr_code_biases.biases[53].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[54].code == 30, "incorrect value for last_msg.msg.ssr_code_biases.biases[54].code, expected 30, is %d", last_msg.msg.ssr_code_biases.biases[54].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[54].value == -15959, "incorrect value for last_msg.msg.ssr_code_biases.biases[54].value, expected -15959, is %d", last_msg.msg.ssr_code_biases.biases[54].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[55].code == 190, "incorrect value for last_msg.msg.ssr_code_biases.biases[55].code, expected 190, is %d", last_msg.msg.ssr_code_biases.biases[55].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[55].value == -15156, "incorrect value for last_msg.msg.ssr_code_biases.biases[55].value, expected -15156, is %d", last_msg.msg.ssr_code_biases.biases[55].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[56].code == 123, "incorrect value for last_msg.msg.ssr_code_biases.biases[56].code, expected 123, is %d", last_msg.msg.ssr_code_biases.biases[56].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[56].value == 6507, "incorrect value for last_msg.msg.ssr_code_biases.biases[56].value, expected 6507, is %d", last_msg.msg.ssr_code_biases.biases[56].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[57].code == 225, "incorrect value for last_msg.msg.ssr_code_biases.biases[57].code, expected 225, is %d", last_msg.msg.ssr_code_biases.biases[57].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[57].value == 2378, "incorrect value for last_msg.msg.ssr_code_biases.biases[57].value, expected 2378, is %d", last_msg.msg.ssr_code_biases.biases[57].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[58].code == 10, "incorrect value for last_msg.msg.ssr_code_biases.biases[58].code, expected 10, is %d", last_msg.msg.ssr_code_biases.biases[58].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[58].value == 823, "incorrect value for last_msg.msg.ssr_code_biases.biases[58].value, expected 823, is %d", last_msg.msg.ssr_code_biases.biases[58].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[59].code == 131, "incorrect value for last_msg.msg.ssr_code_biases.biases[59].code, expected 131, is %d", last_msg.msg.ssr_code_biases.biases[59].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[59].value == 25590, "incorrect value for last_msg.msg.ssr_code_biases.biases[59].value, expected 25590, is %d", last_msg.msg.ssr_code_biases.biases[59].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[60].code == 133, "incorrect value for last_msg.msg.ssr_code_biases.biases[60].code, expected 133, is %d", last_msg.msg.ssr_code_biases.biases[60].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[60].value == -7390, "incorrect value for last_msg.msg.ssr_code_biases.biases[60].value, expected -7390, is %d", last_msg.msg.ssr_code_biases.biases[60].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[61].code == 203, "incorrect value for last_msg.msg.ssr_code_biases.biases[61].code, expected 203, is %d", last_msg.msg.ssr_code_biases.biases[61].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[61].value == 4676, "incorrect value for last_msg.msg.ssr_code_biases.biases[61].value, expected 4676, is %d", last_msg.msg.ssr_code_biases.biases[61].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[62].code == 97, "incorrect value for last_msg.msg.ssr_code_biases.biases[62].code, expected 97, is %d", last_msg.msg.ssr_code_biases.biases[62].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[62].value == 23007, "incorrect value for last_msg.msg.ssr_code_biases.biases[62].value, expected 23007, is %d", last_msg.msg.ssr_code_biases.biases[62].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[63].code == 192, "incorrect value for last_msg.msg.ssr_code_biases.biases[63].code, expected 192, is %d", last_msg.msg.ssr_code_biases.biases[63].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[63].value == 13046, "incorrect value for last_msg.msg.ssr_code_biases.biases[63].value, expected 13046, is %d", last_msg.msg.ssr_code_biases.biases[63].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[64].code == 69, "incorrect value for last_msg.msg.ssr_code_biases.biases[64].code, expected 69, is %d", last_msg.msg.ssr_code_biases.biases[64].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[64].value == 2651, "incorrect value for last_msg.msg.ssr_code_biases.biases[64].value, expected 2651, is %d", last_msg.msg.ssr_code_biases.biases[64].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[65].code == 151, "incorrect value for last_msg.msg.ssr_code_biases.biases[65].code, expected 151, is %d", last_msg.msg.ssr_code_biases.biases[65].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[65].value == 30282, "incorrect value for last_msg.msg.ssr_code_biases.biases[65].value, expected 30282, is %d", last_msg.msg.ssr_code_biases.biases[65].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[66].code == 110, "incorrect value for last_msg.msg.ssr_code_biases.biases[66].code, expected 110, is %d", last_msg.msg.ssr_code_biases.biases[66].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[66].value == -22492, "incorrect value for last_msg.msg.ssr_code_biases.biases[66].value, expected -22492, is %d", last_msg.msg.ssr_code_biases.biases[66].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[67].code == 247, "incorrect value for last_msg.msg.ssr_code_biases.biases[67].code, expected 247, is %d", last_msg.msg.ssr_code_biases.biases[67].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[67].value == 19872, "incorrect value for last_msg.msg.ssr_code_biases.biases[67].value, expected 19872, is %d", last_msg.msg.ssr_code_biases.biases[67].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[68].code == 179, "incorrect value for last_msg.msg.ssr_code_biases.biases[68].code, expected 179, is %d", last_msg.msg.ssr_code_biases.biases[68].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[68].value == -19827, "incorrect value for last_msg.msg.ssr_code_biases.biases[68].value, expected -19827, is %d", last_msg.msg.ssr_code_biases.biases[68].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[69].code == 99, "incorrect value for last_msg.msg.ssr_code_biases.biases[69].code, expected 99, is %d", last_msg.msg.ssr_code_biases.biases[69].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[69].value == 30911, "incorrect value for last_msg.msg.ssr_code_biases.biases[69].value, expected 30911, is %d", last_msg.msg.ssr_code_biases.biases[69].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[70].code == 77, "incorrect value for last_msg.msg.ssr_code_biases.biases[70].code, expected 77, is %d", last_msg.msg.ssr_code_biases.biases[70].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[70].value == 23488, "incorrect value for last_msg.msg.ssr_code_biases.biases[70].value, expected 23488, is %d", last_msg.msg.ssr_code_biases.biases[70].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[71].code == 224, "incorrect value for last_msg.msg.ssr_code_biases.biases[71].code, expected 224, is %d", last_msg.msg.ssr_code_biases.biases[71].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[71].value == -7679, "incorrect value for last_msg.msg.ssr_code_biases.biases[71].value, expected -7679, is %d", last_msg.msg.ssr_code_biases.biases[71].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[72].code == 50, "incorrect value for last_msg.msg.ssr_code_biases.biases[72].code, expected 50, is %d", last_msg.msg.ssr_code_biases.biases[72].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[72].value == -28073, "incorrect value for last_msg.msg.ssr_code_biases.biases[72].value, expected -28073, is %d", last_msg.msg.ssr_code_biases.biases[72].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[73].code == 148, "incorrect value for last_msg.msg.ssr_code_biases.biases[73].code, expected 148, is %d", last_msg.msg.ssr_code_biases.biases[73].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[73].value == 25838, "incorrect value for last_msg.msg.ssr_code_biases.biases[73].value, expected 25838, is %d", last_msg.msg.ssr_code_biases.biases[73].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[74].code == 179, "incorrect value for last_msg.msg.ssr_code_biases.biases[74].code, expected 179, is %d", last_msg.msg.ssr_code_biases.biases[74].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[74].value == -7299, "incorrect value for last_msg.msg.ssr_code_biases.biases[74].value, expected -7299, is %d", last_msg.msg.ssr_code_biases.biases[74].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[75].code == 215, "incorrect value for last_msg.msg.ssr_code_biases.biases[75].code, expected 215, is %d", last_msg.msg.ssr_code_biases.biases[75].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[75].value == -18328, "incorrect value for last_msg.msg.ssr_code_biases.biases[75].value, expected -18328, is %d", last_msg.msg.ssr_code_biases.biases[75].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[76].code == 31, "incorrect value for last_msg.msg.ssr_code_biases.biases[76].code, expected 31, is %d", last_msg.msg.ssr_code_biases.biases[76].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[76].value == 23097, "incorrect value for last_msg.msg.ssr_code_biases.biases[76].value, expected 23097, is %d", last_msg.msg.ssr_code_biases.biases[76].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[77].code == 79, "incorrect value for last_msg.msg.ssr_code_biases.biases[77].code, expected 79, is %d", last_msg.msg.ssr_code_biases.biases[77].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[77].value == -25579, "incorrect value for last_msg.msg.ssr_code_biases.biases[77].value, expected -25579, is %d", last_msg.msg.ssr_code_biases.biases[77].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[78].code == 245, "incorrect value for last_msg.msg.ssr_code_biases.biases[78].code, expected 245, is %d", last_msg.msg.ssr_code_biases.biases[78].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[78].value == 15441, "incorrect value for last_msg.msg.ssr_code_biases.biases[78].value, expected 15441, is %d", last_msg.msg.ssr_code_biases.biases[78].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[79].code == 93, "incorrect value for last_msg.msg.ssr_code_biases.biases[79].code, expected 93, is %d", last_msg.msg.ssr_code_biases.biases[79].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[79].value == 15530, "incorrect value for last_msg.msg.ssr_code_biases.biases[79].value, expected 15530, is %d", last_msg.msg.ssr_code_biases.biases[79].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[80].code == 200, "incorrect value for last_msg.msg.ssr_code_biases.biases[80].code, expected 200, is %d", last_msg.msg.ssr_code_biases.biases[80].code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.biases[80].value == 3495, "incorrect value for last_msg.msg.ssr_code_biases.biases[80].value, expected 3495, is %d", last_msg.msg.ssr_code_biases.biases[80].value); - - ck_assert_msg(last_msg.msg.ssr_code_biases.iod_ssr == 132, "incorrect value for last_msg.msg.ssr_code_biases.iod_ssr, expected 132, is %d", last_msg.msg.ssr_code_biases.iod_ssr); - - ck_assert_msg(last_msg.msg.ssr_code_biases.n_biases == 81, "incorrect value for last_msg.msg.ssr_code_biases.n_biases, expected 81, is %d", last_msg.msg.ssr_code_biases.n_biases); - - - ck_assert_msg(last_msg.msg.ssr_code_biases.sid.code == 241, "incorrect value for last_msg.msg.ssr_code_biases.sid.code, expected 241, is %d", last_msg.msg.ssr_code_biases.sid.code); - - ck_assert_msg(last_msg.msg.ssr_code_biases.sid.sat == 133, "incorrect value for last_msg.msg.ssr_code_biases.sid.sat, expected 133, is %d", last_msg.msg.ssr_code_biases.sid.sat); - - - ck_assert_msg(last_msg.msg.ssr_code_biases.time.tow == 387144400, "incorrect value for last_msg.msg.ssr_code_biases.time.tow, expected 387144400, is %d", last_msg.msg.ssr_code_biases.time.tow); - - ck_assert_msg(last_msg.msg.ssr_code_biases.time.wn == 16905, "incorrect value for last_msg.msg.ssr_code_biases.time.wn, expected 16905, is %d", last_msg.msg.ssr_code_biases.time.wn); - - ck_assert_msg(last_msg.msg.ssr_code_biases.update_interval == 254, "incorrect value for last_msg.msg.ssr_code_biases.update_interval, expected 254, is %d", last_msg.msg.ssr_code_biases.update_interval); + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[0].code == 51, + "incorrect value for last_msg.msg.ssr_code_biases.biases[0].code, " + "expected 51, is %d", + last_msg.msg.ssr_code_biases.biases[0].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[0].value == -31996, + "incorrect value for last_msg.msg.ssr_code_biases.biases[0].value, " + "expected -31996, is %d", + last_msg.msg.ssr_code_biases.biases[0].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[1].code == 240, + "incorrect value for last_msg.msg.ssr_code_biases.biases[1].code, " + "expected 240, is %d", + last_msg.msg.ssr_code_biases.biases[1].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[1].value == 21368, + "incorrect value for last_msg.msg.ssr_code_biases.biases[1].value, " + "expected 21368, is %d", + last_msg.msg.ssr_code_biases.biases[1].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[2].code == 148, + "incorrect value for last_msg.msg.ssr_code_biases.biases[2].code, " + "expected 148, is %d", + last_msg.msg.ssr_code_biases.biases[2].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[2].value == -10799, + "incorrect value for last_msg.msg.ssr_code_biases.biases[2].value, " + "expected -10799, is %d", + last_msg.msg.ssr_code_biases.biases[2].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[3].code == 62, + "incorrect value for last_msg.msg.ssr_code_biases.biases[3].code, " + "expected 62, is %d", + last_msg.msg.ssr_code_biases.biases[3].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[3].value == -5916, + "incorrect value for last_msg.msg.ssr_code_biases.biases[3].value, " + "expected -5916, is %d", + last_msg.msg.ssr_code_biases.biases[3].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[4].code == 71, + "incorrect value for last_msg.msg.ssr_code_biases.biases[4].code, " + "expected 71, is %d", + last_msg.msg.ssr_code_biases.biases[4].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[4].value == -17342, + "incorrect value for last_msg.msg.ssr_code_biases.biases[4].value, " + "expected -17342, is %d", + last_msg.msg.ssr_code_biases.biases[4].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[5].code == 210, + "incorrect value for last_msg.msg.ssr_code_biases.biases[5].code, " + "expected 210, is %d", + last_msg.msg.ssr_code_biases.biases[5].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[5].value == 13952, + "incorrect value for last_msg.msg.ssr_code_biases.biases[5].value, " + "expected 13952, is %d", + last_msg.msg.ssr_code_biases.biases[5].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[6].code == 131, + "incorrect value for last_msg.msg.ssr_code_biases.biases[6].code, " + "expected 131, is %d", + last_msg.msg.ssr_code_biases.biases[6].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[6].value == -32360, + "incorrect value for last_msg.msg.ssr_code_biases.biases[6].value, " + "expected -32360, is %d", + last_msg.msg.ssr_code_biases.biases[6].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[7].code == 111, + "incorrect value for last_msg.msg.ssr_code_biases.biases[7].code, " + "expected 111, is %d", + last_msg.msg.ssr_code_biases.biases[7].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[7].value == -3445, + "incorrect value for last_msg.msg.ssr_code_biases.biases[7].value, " + "expected -3445, is %d", + last_msg.msg.ssr_code_biases.biases[7].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[8].code == 177, + "incorrect value for last_msg.msg.ssr_code_biases.biases[8].code, " + "expected 177, is %d", + last_msg.msg.ssr_code_biases.biases[8].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[8].value == 11409, + "incorrect value for last_msg.msg.ssr_code_biases.biases[8].value, " + "expected 11409, is %d", + last_msg.msg.ssr_code_biases.biases[8].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[9].code == 9, + "incorrect value for last_msg.msg.ssr_code_biases.biases[9].code, " + "expected 9, is %d", + last_msg.msg.ssr_code_biases.biases[9].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[9].value == -12299, + "incorrect value for last_msg.msg.ssr_code_biases.biases[9].value, " + "expected -12299, is %d", + last_msg.msg.ssr_code_biases.biases[9].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[10].code == 241, + "incorrect value for last_msg.msg.ssr_code_biases.biases[10].code, " + "expected 241, is %d", + last_msg.msg.ssr_code_biases.biases[10].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[10].value == -26934, + "incorrect value for last_msg.msg.ssr_code_biases.biases[10].value, " + "expected -26934, is %d", + last_msg.msg.ssr_code_biases.biases[10].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[11].code == 141, + "incorrect value for last_msg.msg.ssr_code_biases.biases[11].code, " + "expected 141, is %d", + last_msg.msg.ssr_code_biases.biases[11].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[11].value == -24782, + "incorrect value for last_msg.msg.ssr_code_biases.biases[11].value, " + "expected -24782, is %d", + last_msg.msg.ssr_code_biases.biases[11].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[12].code == 220, + "incorrect value for last_msg.msg.ssr_code_biases.biases[12].code, " + "expected 220, is %d", + last_msg.msg.ssr_code_biases.biases[12].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[12].value == 9611, + "incorrect value for last_msg.msg.ssr_code_biases.biases[12].value, " + "expected 9611, is %d", + last_msg.msg.ssr_code_biases.biases[12].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[13].code == 187, + "incorrect value for last_msg.msg.ssr_code_biases.biases[13].code, " + "expected 187, is %d", + last_msg.msg.ssr_code_biases.biases[13].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[13].value == -16542, + "incorrect value for last_msg.msg.ssr_code_biases.biases[13].value, " + "expected -16542, is %d", + last_msg.msg.ssr_code_biases.biases[13].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[14].code == 23, + "incorrect value for last_msg.msg.ssr_code_biases.biases[14].code, " + "expected 23, is %d", + last_msg.msg.ssr_code_biases.biases[14].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[14].value == -30592, + "incorrect value for last_msg.msg.ssr_code_biases.biases[14].value, " + "expected -30592, is %d", + last_msg.msg.ssr_code_biases.biases[14].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[15].code == 167, + "incorrect value for last_msg.msg.ssr_code_biases.biases[15].code, " + "expected 167, is %d", + last_msg.msg.ssr_code_biases.biases[15].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[15].value == 1736, + "incorrect value for last_msg.msg.ssr_code_biases.biases[15].value, " + "expected 1736, is %d", + last_msg.msg.ssr_code_biases.biases[15].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[16].code == 211, + "incorrect value for last_msg.msg.ssr_code_biases.biases[16].code, " + "expected 211, is %d", + last_msg.msg.ssr_code_biases.biases[16].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[16].value == 5978, + "incorrect value for last_msg.msg.ssr_code_biases.biases[16].value, " + "expected 5978, is %d", + last_msg.msg.ssr_code_biases.biases[16].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[17].code == 244, + "incorrect value for last_msg.msg.ssr_code_biases.biases[17].code, " + "expected 244, is %d", + last_msg.msg.ssr_code_biases.biases[17].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[17].value == -10358, + "incorrect value for last_msg.msg.ssr_code_biases.biases[17].value, " + "expected -10358, is %d", + last_msg.msg.ssr_code_biases.biases[17].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[18].code == 209, + "incorrect value for last_msg.msg.ssr_code_biases.biases[18].code, " + "expected 209, is %d", + last_msg.msg.ssr_code_biases.biases[18].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[18].value == 3467, + "incorrect value for last_msg.msg.ssr_code_biases.biases[18].value, " + "expected 3467, is %d", + last_msg.msg.ssr_code_biases.biases[18].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[19].code == 101, + "incorrect value for last_msg.msg.ssr_code_biases.biases[19].code, " + "expected 101, is %d", + last_msg.msg.ssr_code_biases.biases[19].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[19].value == 1824, + "incorrect value for last_msg.msg.ssr_code_biases.biases[19].value, " + "expected 1824, is %d", + last_msg.msg.ssr_code_biases.biases[19].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[20].code == 18, + "incorrect value for last_msg.msg.ssr_code_biases.biases[20].code, " + "expected 18, is %d", + last_msg.msg.ssr_code_biases.biases[20].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[20].value == 17949, + "incorrect value for last_msg.msg.ssr_code_biases.biases[20].value, " + "expected 17949, is %d", + last_msg.msg.ssr_code_biases.biases[20].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[21].code == 250, + "incorrect value for last_msg.msg.ssr_code_biases.biases[21].code, " + "expected 250, is %d", + last_msg.msg.ssr_code_biases.biases[21].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[21].value == 18797, + "incorrect value for last_msg.msg.ssr_code_biases.biases[21].value, " + "expected 18797, is %d", + last_msg.msg.ssr_code_biases.biases[21].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[22].code == 202, + "incorrect value for last_msg.msg.ssr_code_biases.biases[22].code, " + "expected 202, is %d", + last_msg.msg.ssr_code_biases.biases[22].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[22].value == -28593, + "incorrect value for last_msg.msg.ssr_code_biases.biases[22].value, " + "expected -28593, is %d", + last_msg.msg.ssr_code_biases.biases[22].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[23].code == 9, + "incorrect value for last_msg.msg.ssr_code_biases.biases[23].code, " + "expected 9, is %d", + last_msg.msg.ssr_code_biases.biases[23].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[23].value == 17810, + "incorrect value for last_msg.msg.ssr_code_biases.biases[23].value, " + "expected 17810, is %d", + last_msg.msg.ssr_code_biases.biases[23].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[24].code == 241, + "incorrect value for last_msg.msg.ssr_code_biases.biases[24].code, " + "expected 241, is %d", + last_msg.msg.ssr_code_biases.biases[24].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[24].value == 5684, + "incorrect value for last_msg.msg.ssr_code_biases.biases[24].value, " + "expected 5684, is %d", + last_msg.msg.ssr_code_biases.biases[24].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[25].code == 99, + "incorrect value for last_msg.msg.ssr_code_biases.biases[25].code, " + "expected 99, is %d", + last_msg.msg.ssr_code_biases.biases[25].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[25].value == -13214, + "incorrect value for last_msg.msg.ssr_code_biases.biases[25].value, " + "expected -13214, is %d", + last_msg.msg.ssr_code_biases.biases[25].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[26].code == 3, + "incorrect value for last_msg.msg.ssr_code_biases.biases[26].code, " + "expected 3, is %d", + last_msg.msg.ssr_code_biases.biases[26].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[26].value == -6485, + "incorrect value for last_msg.msg.ssr_code_biases.biases[26].value, " + "expected -6485, is %d", + last_msg.msg.ssr_code_biases.biases[26].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[27].code == 180, + "incorrect value for last_msg.msg.ssr_code_biases.biases[27].code, " + "expected 180, is %d", + last_msg.msg.ssr_code_biases.biases[27].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[27].value == 15947, + "incorrect value for last_msg.msg.ssr_code_biases.biases[27].value, " + "expected 15947, is %d", + last_msg.msg.ssr_code_biases.biases[27].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[28].code == 145, + "incorrect value for last_msg.msg.ssr_code_biases.biases[28].code, " + "expected 145, is %d", + last_msg.msg.ssr_code_biases.biases[28].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[28].value == -32170, + "incorrect value for last_msg.msg.ssr_code_biases.biases[28].value, " + "expected -32170, is %d", + last_msg.msg.ssr_code_biases.biases[28].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[29].code == 31, + "incorrect value for last_msg.msg.ssr_code_biases.biases[29].code, " + "expected 31, is %d", + last_msg.msg.ssr_code_biases.biases[29].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[29].value == -25826, + "incorrect value for last_msg.msg.ssr_code_biases.biases[29].value, " + "expected -25826, is %d", + last_msg.msg.ssr_code_biases.biases[29].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[30].code == 37, + "incorrect value for last_msg.msg.ssr_code_biases.biases[30].code, " + "expected 37, is %d", + last_msg.msg.ssr_code_biases.biases[30].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[30].value == 14098, + "incorrect value for last_msg.msg.ssr_code_biases.biases[30].value, " + "expected 14098, is %d", + last_msg.msg.ssr_code_biases.biases[30].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[31].code == 210, + "incorrect value for last_msg.msg.ssr_code_biases.biases[31].code, " + "expected 210, is %d", + last_msg.msg.ssr_code_biases.biases[31].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[31].value == 32551, + "incorrect value for last_msg.msg.ssr_code_biases.biases[31].value, " + "expected 32551, is %d", + last_msg.msg.ssr_code_biases.biases[31].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[32].code == 242, + "incorrect value for last_msg.msg.ssr_code_biases.biases[32].code, " + "expected 242, is %d", + last_msg.msg.ssr_code_biases.biases[32].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[32].value == 3394, + "incorrect value for last_msg.msg.ssr_code_biases.biases[32].value, " + "expected 3394, is %d", + last_msg.msg.ssr_code_biases.biases[32].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[33].code == 237, + "incorrect value for last_msg.msg.ssr_code_biases.biases[33].code, " + "expected 237, is %d", + last_msg.msg.ssr_code_biases.biases[33].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[33].value == -21864, + "incorrect value for last_msg.msg.ssr_code_biases.biases[33].value, " + "expected -21864, is %d", + last_msg.msg.ssr_code_biases.biases[33].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[34].code == 212, + "incorrect value for last_msg.msg.ssr_code_biases.biases[34].code, " + "expected 212, is %d", + last_msg.msg.ssr_code_biases.biases[34].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[34].value == -2545, + "incorrect value for last_msg.msg.ssr_code_biases.biases[34].value, " + "expected -2545, is %d", + last_msg.msg.ssr_code_biases.biases[34].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[35].code == 59, + "incorrect value for last_msg.msg.ssr_code_biases.biases[35].code, " + "expected 59, is %d", + last_msg.msg.ssr_code_biases.biases[35].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[35].value == -19362, + "incorrect value for last_msg.msg.ssr_code_biases.biases[35].value, " + "expected -19362, is %d", + last_msg.msg.ssr_code_biases.biases[35].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[36].code == 195, + "incorrect value for last_msg.msg.ssr_code_biases.biases[36].code, " + "expected 195, is %d", + last_msg.msg.ssr_code_biases.biases[36].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[36].value == 17821, + "incorrect value for last_msg.msg.ssr_code_biases.biases[36].value, " + "expected 17821, is %d", + last_msg.msg.ssr_code_biases.biases[36].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[37].code == 100, + "incorrect value for last_msg.msg.ssr_code_biases.biases[37].code, " + "expected 100, is %d", + last_msg.msg.ssr_code_biases.biases[37].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[37].value == 4215, + "incorrect value for last_msg.msg.ssr_code_biases.biases[37].value, " + "expected 4215, is %d", + last_msg.msg.ssr_code_biases.biases[37].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[38].code == 68, + "incorrect value for last_msg.msg.ssr_code_biases.biases[38].code, " + "expected 68, is %d", + last_msg.msg.ssr_code_biases.biases[38].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[38].value == -20557, + "incorrect value for last_msg.msg.ssr_code_biases.biases[38].value, " + "expected -20557, is %d", + last_msg.msg.ssr_code_biases.biases[38].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[39].code == 144, + "incorrect value for last_msg.msg.ssr_code_biases.biases[39].code, " + "expected 144, is %d", + last_msg.msg.ssr_code_biases.biases[39].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[39].value == 20849, + "incorrect value for last_msg.msg.ssr_code_biases.biases[39].value, " + "expected 20849, is %d", + last_msg.msg.ssr_code_biases.biases[39].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[40].code == 82, + "incorrect value for last_msg.msg.ssr_code_biases.biases[40].code, " + "expected 82, is %d", + last_msg.msg.ssr_code_biases.biases[40].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[40].value == -26850, + "incorrect value for last_msg.msg.ssr_code_biases.biases[40].value, " + "expected -26850, is %d", + last_msg.msg.ssr_code_biases.biases[40].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[41].code == 21, + "incorrect value for last_msg.msg.ssr_code_biases.biases[41].code, " + "expected 21, is %d", + last_msg.msg.ssr_code_biases.biases[41].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[41].value == 10605, + "incorrect value for last_msg.msg.ssr_code_biases.biases[41].value, " + "expected 10605, is %d", + last_msg.msg.ssr_code_biases.biases[41].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[42].code == 225, + "incorrect value for last_msg.msg.ssr_code_biases.biases[42].code, " + "expected 225, is %d", + last_msg.msg.ssr_code_biases.biases[42].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[42].value == 19720, + "incorrect value for last_msg.msg.ssr_code_biases.biases[42].value, " + "expected 19720, is %d", + last_msg.msg.ssr_code_biases.biases[42].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[43].code == 164, + "incorrect value for last_msg.msg.ssr_code_biases.biases[43].code, " + "expected 164, is %d", + last_msg.msg.ssr_code_biases.biases[43].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[43].value == 157, + "incorrect value for last_msg.msg.ssr_code_biases.biases[43].value, " + "expected 157, is %d", + last_msg.msg.ssr_code_biases.biases[43].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[44].code == 73, + "incorrect value for last_msg.msg.ssr_code_biases.biases[44].code, " + "expected 73, is %d", + last_msg.msg.ssr_code_biases.biases[44].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[44].value == 1566, + "incorrect value for last_msg.msg.ssr_code_biases.biases[44].value, " + "expected 1566, is %d", + last_msg.msg.ssr_code_biases.biases[44].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[45].code == 78, + "incorrect value for last_msg.msg.ssr_code_biases.biases[45].code, " + "expected 78, is %d", + last_msg.msg.ssr_code_biases.biases[45].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[45].value == -28847, + "incorrect value for last_msg.msg.ssr_code_biases.biases[45].value, " + "expected -28847, is %d", + last_msg.msg.ssr_code_biases.biases[45].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[46].code == 116, + "incorrect value for last_msg.msg.ssr_code_biases.biases[46].code, " + "expected 116, is %d", + last_msg.msg.ssr_code_biases.biases[46].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[46].value == -26640, + "incorrect value for last_msg.msg.ssr_code_biases.biases[46].value, " + "expected -26640, is %d", + last_msg.msg.ssr_code_biases.biases[46].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[47].code == 55, + "incorrect value for last_msg.msg.ssr_code_biases.biases[47].code, " + "expected 55, is %d", + last_msg.msg.ssr_code_biases.biases[47].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[47].value == -22087, + "incorrect value for last_msg.msg.ssr_code_biases.biases[47].value, " + "expected -22087, is %d", + last_msg.msg.ssr_code_biases.biases[47].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[48].code == 254, + "incorrect value for last_msg.msg.ssr_code_biases.biases[48].code, " + "expected 254, is %d", + last_msg.msg.ssr_code_biases.biases[48].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[48].value == 10035, + "incorrect value for last_msg.msg.ssr_code_biases.biases[48].value, " + "expected 10035, is %d", + last_msg.msg.ssr_code_biases.biases[48].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[49].code == 74, + "incorrect value for last_msg.msg.ssr_code_biases.biases[49].code, " + "expected 74, is %d", + last_msg.msg.ssr_code_biases.biases[49].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[49].value == -2129, + "incorrect value for last_msg.msg.ssr_code_biases.biases[49].value, " + "expected -2129, is %d", + last_msg.msg.ssr_code_biases.biases[49].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[50].code == 34, + "incorrect value for last_msg.msg.ssr_code_biases.biases[50].code, " + "expected 34, is %d", + last_msg.msg.ssr_code_biases.biases[50].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[50].value == 19041, + "incorrect value for last_msg.msg.ssr_code_biases.biases[50].value, " + "expected 19041, is %d", + last_msg.msg.ssr_code_biases.biases[50].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[51].code == 97, + "incorrect value for last_msg.msg.ssr_code_biases.biases[51].code, " + "expected 97, is %d", + last_msg.msg.ssr_code_biases.biases[51].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[51].value == 12464, + "incorrect value for last_msg.msg.ssr_code_biases.biases[51].value, " + "expected 12464, is %d", + last_msg.msg.ssr_code_biases.biases[51].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[52].code == 236, + "incorrect value for last_msg.msg.ssr_code_biases.biases[52].code, " + "expected 236, is %d", + last_msg.msg.ssr_code_biases.biases[52].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[52].value == 3245, + "incorrect value for last_msg.msg.ssr_code_biases.biases[52].value, " + "expected 3245, is %d", + last_msg.msg.ssr_code_biases.biases[52].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[53].code == 174, + "incorrect value for last_msg.msg.ssr_code_biases.biases[53].code, " + "expected 174, is %d", + last_msg.msg.ssr_code_biases.biases[53].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[53].value == -32155, + "incorrect value for last_msg.msg.ssr_code_biases.biases[53].value, " + "expected -32155, is %d", + last_msg.msg.ssr_code_biases.biases[53].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[54].code == 30, + "incorrect value for last_msg.msg.ssr_code_biases.biases[54].code, " + "expected 30, is %d", + last_msg.msg.ssr_code_biases.biases[54].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[54].value == -15959, + "incorrect value for last_msg.msg.ssr_code_biases.biases[54].value, " + "expected -15959, is %d", + last_msg.msg.ssr_code_biases.biases[54].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[55].code == 190, + "incorrect value for last_msg.msg.ssr_code_biases.biases[55].code, " + "expected 190, is %d", + last_msg.msg.ssr_code_biases.biases[55].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[55].value == -15156, + "incorrect value for last_msg.msg.ssr_code_biases.biases[55].value, " + "expected -15156, is %d", + last_msg.msg.ssr_code_biases.biases[55].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[56].code == 123, + "incorrect value for last_msg.msg.ssr_code_biases.biases[56].code, " + "expected 123, is %d", + last_msg.msg.ssr_code_biases.biases[56].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[56].value == 6507, + "incorrect value for last_msg.msg.ssr_code_biases.biases[56].value, " + "expected 6507, is %d", + last_msg.msg.ssr_code_biases.biases[56].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[57].code == 225, + "incorrect value for last_msg.msg.ssr_code_biases.biases[57].code, " + "expected 225, is %d", + last_msg.msg.ssr_code_biases.biases[57].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[57].value == 2378, + "incorrect value for last_msg.msg.ssr_code_biases.biases[57].value, " + "expected 2378, is %d", + last_msg.msg.ssr_code_biases.biases[57].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[58].code == 10, + "incorrect value for last_msg.msg.ssr_code_biases.biases[58].code, " + "expected 10, is %d", + last_msg.msg.ssr_code_biases.biases[58].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[58].value == 823, + "incorrect value for last_msg.msg.ssr_code_biases.biases[58].value, " + "expected 823, is %d", + last_msg.msg.ssr_code_biases.biases[58].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[59].code == 131, + "incorrect value for last_msg.msg.ssr_code_biases.biases[59].code, " + "expected 131, is %d", + last_msg.msg.ssr_code_biases.biases[59].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[59].value == 25590, + "incorrect value for last_msg.msg.ssr_code_biases.biases[59].value, " + "expected 25590, is %d", + last_msg.msg.ssr_code_biases.biases[59].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[60].code == 133, + "incorrect value for last_msg.msg.ssr_code_biases.biases[60].code, " + "expected 133, is %d", + last_msg.msg.ssr_code_biases.biases[60].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[60].value == -7390, + "incorrect value for last_msg.msg.ssr_code_biases.biases[60].value, " + "expected -7390, is %d", + last_msg.msg.ssr_code_biases.biases[60].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[61].code == 203, + "incorrect value for last_msg.msg.ssr_code_biases.biases[61].code, " + "expected 203, is %d", + last_msg.msg.ssr_code_biases.biases[61].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[61].value == 4676, + "incorrect value for last_msg.msg.ssr_code_biases.biases[61].value, " + "expected 4676, is %d", + last_msg.msg.ssr_code_biases.biases[61].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[62].code == 97, + "incorrect value for last_msg.msg.ssr_code_biases.biases[62].code, " + "expected 97, is %d", + last_msg.msg.ssr_code_biases.biases[62].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[62].value == 23007, + "incorrect value for last_msg.msg.ssr_code_biases.biases[62].value, " + "expected 23007, is %d", + last_msg.msg.ssr_code_biases.biases[62].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[63].code == 192, + "incorrect value for last_msg.msg.ssr_code_biases.biases[63].code, " + "expected 192, is %d", + last_msg.msg.ssr_code_biases.biases[63].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[63].value == 13046, + "incorrect value for last_msg.msg.ssr_code_biases.biases[63].value, " + "expected 13046, is %d", + last_msg.msg.ssr_code_biases.biases[63].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[64].code == 69, + "incorrect value for last_msg.msg.ssr_code_biases.biases[64].code, " + "expected 69, is %d", + last_msg.msg.ssr_code_biases.biases[64].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[64].value == 2651, + "incorrect value for last_msg.msg.ssr_code_biases.biases[64].value, " + "expected 2651, is %d", + last_msg.msg.ssr_code_biases.biases[64].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[65].code == 151, + "incorrect value for last_msg.msg.ssr_code_biases.biases[65].code, " + "expected 151, is %d", + last_msg.msg.ssr_code_biases.biases[65].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[65].value == 30282, + "incorrect value for last_msg.msg.ssr_code_biases.biases[65].value, " + "expected 30282, is %d", + last_msg.msg.ssr_code_biases.biases[65].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[66].code == 110, + "incorrect value for last_msg.msg.ssr_code_biases.biases[66].code, " + "expected 110, is %d", + last_msg.msg.ssr_code_biases.biases[66].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[66].value == -22492, + "incorrect value for last_msg.msg.ssr_code_biases.biases[66].value, " + "expected -22492, is %d", + last_msg.msg.ssr_code_biases.biases[66].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[67].code == 247, + "incorrect value for last_msg.msg.ssr_code_biases.biases[67].code, " + "expected 247, is %d", + last_msg.msg.ssr_code_biases.biases[67].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[67].value == 19872, + "incorrect value for last_msg.msg.ssr_code_biases.biases[67].value, " + "expected 19872, is %d", + last_msg.msg.ssr_code_biases.biases[67].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[68].code == 179, + "incorrect value for last_msg.msg.ssr_code_biases.biases[68].code, " + "expected 179, is %d", + last_msg.msg.ssr_code_biases.biases[68].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[68].value == -19827, + "incorrect value for last_msg.msg.ssr_code_biases.biases[68].value, " + "expected -19827, is %d", + last_msg.msg.ssr_code_biases.biases[68].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[69].code == 99, + "incorrect value for last_msg.msg.ssr_code_biases.biases[69].code, " + "expected 99, is %d", + last_msg.msg.ssr_code_biases.biases[69].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[69].value == 30911, + "incorrect value for last_msg.msg.ssr_code_biases.biases[69].value, " + "expected 30911, is %d", + last_msg.msg.ssr_code_biases.biases[69].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[70].code == 77, + "incorrect value for last_msg.msg.ssr_code_biases.biases[70].code, " + "expected 77, is %d", + last_msg.msg.ssr_code_biases.biases[70].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[70].value == 23488, + "incorrect value for last_msg.msg.ssr_code_biases.biases[70].value, " + "expected 23488, is %d", + last_msg.msg.ssr_code_biases.biases[70].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[71].code == 224, + "incorrect value for last_msg.msg.ssr_code_biases.biases[71].code, " + "expected 224, is %d", + last_msg.msg.ssr_code_biases.biases[71].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[71].value == -7679, + "incorrect value for last_msg.msg.ssr_code_biases.biases[71].value, " + "expected -7679, is %d", + last_msg.msg.ssr_code_biases.biases[71].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[72].code == 50, + "incorrect value for last_msg.msg.ssr_code_biases.biases[72].code, " + "expected 50, is %d", + last_msg.msg.ssr_code_biases.biases[72].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[72].value == -28073, + "incorrect value for last_msg.msg.ssr_code_biases.biases[72].value, " + "expected -28073, is %d", + last_msg.msg.ssr_code_biases.biases[72].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[73].code == 148, + "incorrect value for last_msg.msg.ssr_code_biases.biases[73].code, " + "expected 148, is %d", + last_msg.msg.ssr_code_biases.biases[73].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[73].value == 25838, + "incorrect value for last_msg.msg.ssr_code_biases.biases[73].value, " + "expected 25838, is %d", + last_msg.msg.ssr_code_biases.biases[73].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[74].code == 179, + "incorrect value for last_msg.msg.ssr_code_biases.biases[74].code, " + "expected 179, is %d", + last_msg.msg.ssr_code_biases.biases[74].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[74].value == -7299, + "incorrect value for last_msg.msg.ssr_code_biases.biases[74].value, " + "expected -7299, is %d", + last_msg.msg.ssr_code_biases.biases[74].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[75].code == 215, + "incorrect value for last_msg.msg.ssr_code_biases.biases[75].code, " + "expected 215, is %d", + last_msg.msg.ssr_code_biases.biases[75].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[75].value == -18328, + "incorrect value for last_msg.msg.ssr_code_biases.biases[75].value, " + "expected -18328, is %d", + last_msg.msg.ssr_code_biases.biases[75].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[76].code == 31, + "incorrect value for last_msg.msg.ssr_code_biases.biases[76].code, " + "expected 31, is %d", + last_msg.msg.ssr_code_biases.biases[76].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[76].value == 23097, + "incorrect value for last_msg.msg.ssr_code_biases.biases[76].value, " + "expected 23097, is %d", + last_msg.msg.ssr_code_biases.biases[76].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[77].code == 79, + "incorrect value for last_msg.msg.ssr_code_biases.biases[77].code, " + "expected 79, is %d", + last_msg.msg.ssr_code_biases.biases[77].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[77].value == -25579, + "incorrect value for last_msg.msg.ssr_code_biases.biases[77].value, " + "expected -25579, is %d", + last_msg.msg.ssr_code_biases.biases[77].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[78].code == 245, + "incorrect value for last_msg.msg.ssr_code_biases.biases[78].code, " + "expected 245, is %d", + last_msg.msg.ssr_code_biases.biases[78].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[78].value == 15441, + "incorrect value for last_msg.msg.ssr_code_biases.biases[78].value, " + "expected 15441, is %d", + last_msg.msg.ssr_code_biases.biases[78].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[79].code == 93, + "incorrect value for last_msg.msg.ssr_code_biases.biases[79].code, " + "expected 93, is %d", + last_msg.msg.ssr_code_biases.biases[79].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[79].value == 15530, + "incorrect value for last_msg.msg.ssr_code_biases.biases[79].value, " + "expected 15530, is %d", + last_msg.msg.ssr_code_biases.biases[79].value); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[80].code == 200, + "incorrect value for last_msg.msg.ssr_code_biases.biases[80].code, " + "expected 200, is %d", + last_msg.msg.ssr_code_biases.biases[80].code); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.biases[80].value == 3495, + "incorrect value for last_msg.msg.ssr_code_biases.biases[80].value, " + "expected 3495, is %d", + last_msg.msg.ssr_code_biases.biases[80].value); + + ck_assert_msg(last_msg.msg.ssr_code_biases.iod_ssr == 132, + "incorrect value for last_msg.msg.ssr_code_biases.iod_ssr, " + "expected 132, is %d", + last_msg.msg.ssr_code_biases.iod_ssr); + + ck_assert_msg(last_msg.msg.ssr_code_biases.n_biases == 81, + "incorrect value for last_msg.msg.ssr_code_biases.n_biases, " + "expected 81, is %d", + last_msg.msg.ssr_code_biases.n_biases); + + ck_assert_msg(last_msg.msg.ssr_code_biases.sid.code == 241, + "incorrect value for last_msg.msg.ssr_code_biases.sid.code, " + "expected 241, is %d", + last_msg.msg.ssr_code_biases.sid.code); + + ck_assert_msg(last_msg.msg.ssr_code_biases.sid.sat == 133, + "incorrect value for last_msg.msg.ssr_code_biases.sid.sat, " + "expected 133, is %d", + last_msg.msg.ssr_code_biases.sid.sat); + + ck_assert_msg(last_msg.msg.ssr_code_biases.time.tow == 387144400, + "incorrect value for last_msg.msg.ssr_code_biases.time.tow, " + "expected 387144400, is %d", + last_msg.msg.ssr_code_biases.time.tow); + + ck_assert_msg(last_msg.msg.ssr_code_biases.time.wn == 16905, + "incorrect value for last_msg.msg.ssr_code_biases.time.wn, " + "expected 16905, is %d", + last_msg.msg.ssr_code_biases.time.wn); + + ck_assert_msg( + last_msg.msg.ssr_code_biases.update_interval == 254, + "incorrect value for last_msg.msg.ssr_code_biases.update_interval, " + "expected 254, is %d", + last_msg.msg.ssr_code_biases.update_interval); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrCodeBiases_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrCodeBiases"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrCodeBiases"); +Suite *auto_check_sbp_ssr_MsgSsrCodeBiases_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ssr_MsgSsrCodeBiases"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrCodeBiases"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrCodeBiases); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.c b/c/test/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.c index 88d130e87..5ac9bb829 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodePhaseBiasesBounds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodePhaseBiasesBounds.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,160 +90,335 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds ) logging_reset(); - sbp_callback_register(&sbp_state, 1516, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 1516, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,236,5,66,0,31,180,0,0,0,3,0,1,2,1,14,15,1,3,0,3,39,1,39,1,1,3,39,1,39,1,1,1,39,1,39,1,23,113, }; + u8 encoded_frame[] = { + 85, 236, 5, 66, 0, 31, 180, 0, 0, 0, 3, 0, 1, + 2, 1, 14, 15, 1, 3, 0, 3, 39, 1, 39, 1, 1, + 3, 39, 1, 39, 1, 1, 1, 39, 1, 39, 1, 23, 113, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ssr_code_phase_biases_bounds.const_id = 1; - - + test_msg.ssr_code_phase_biases_bounds.header.num_msgs = 1; - + test_msg.ssr_code_phase_biases_bounds.header.seq_num = 2; - + test_msg.ssr_code_phase_biases_bounds.header.sol_id = 14; - - + test_msg.ssr_code_phase_biases_bounds.header.time.tow = 180; - + test_msg.ssr_code_phase_biases_bounds.header.time.wn = 3; - + test_msg.ssr_code_phase_biases_bounds.header.update_interval = 1; - + test_msg.ssr_code_phase_biases_bounds.n_sats_signals = 3; - - - - test_msg.ssr_code_phase_biases_bounds.satellites_signals[0].code_bias_bound_mu = 39; - - test_msg.ssr_code_phase_biases_bounds.satellites_signals[0].code_bias_bound_sig = 1; - - test_msg.ssr_code_phase_biases_bounds.satellites_signals[0].phase_bias_bound_mu = 39; - - test_msg.ssr_code_phase_biases_bounds.satellites_signals[0].phase_bias_bound_sig = 1; - + + test_msg.ssr_code_phase_biases_bounds.satellites_signals[0] + .code_bias_bound_mu = 39; + + test_msg.ssr_code_phase_biases_bounds.satellites_signals[0] + .code_bias_bound_sig = 1; + + test_msg.ssr_code_phase_biases_bounds.satellites_signals[0] + .phase_bias_bound_mu = 39; + + test_msg.ssr_code_phase_biases_bounds.satellites_signals[0] + .phase_bias_bound_sig = 1; + test_msg.ssr_code_phase_biases_bounds.satellites_signals[0].sat_id = 0; - + test_msg.ssr_code_phase_biases_bounds.satellites_signals[0].signal_id = 3; - - - test_msg.ssr_code_phase_biases_bounds.satellites_signals[1].code_bias_bound_mu = 39; - - test_msg.ssr_code_phase_biases_bounds.satellites_signals[1].code_bias_bound_sig = 1; - - test_msg.ssr_code_phase_biases_bounds.satellites_signals[1].phase_bias_bound_mu = 39; - - test_msg.ssr_code_phase_biases_bounds.satellites_signals[1].phase_bias_bound_sig = 1; - + + test_msg.ssr_code_phase_biases_bounds.satellites_signals[1] + .code_bias_bound_mu = 39; + + test_msg.ssr_code_phase_biases_bounds.satellites_signals[1] + .code_bias_bound_sig = 1; + + test_msg.ssr_code_phase_biases_bounds.satellites_signals[1] + .phase_bias_bound_mu = 39; + + test_msg.ssr_code_phase_biases_bounds.satellites_signals[1] + .phase_bias_bound_sig = 1; + test_msg.ssr_code_phase_biases_bounds.satellites_signals[1].sat_id = 1; - + test_msg.ssr_code_phase_biases_bounds.satellites_signals[1].signal_id = 3; - - - test_msg.ssr_code_phase_biases_bounds.satellites_signals[2].code_bias_bound_mu = 39; - - test_msg.ssr_code_phase_biases_bounds.satellites_signals[2].code_bias_bound_sig = 1; - - test_msg.ssr_code_phase_biases_bounds.satellites_signals[2].phase_bias_bound_mu = 39; - - test_msg.ssr_code_phase_biases_bounds.satellites_signals[2].phase_bias_bound_sig = 1; - + + test_msg.ssr_code_phase_biases_bounds.satellites_signals[2] + .code_bias_bound_mu = 39; + + test_msg.ssr_code_phase_biases_bounds.satellites_signals[2] + .code_bias_bound_sig = 1; + + test_msg.ssr_code_phase_biases_bounds.satellites_signals[2] + .phase_bias_bound_mu = 39; + + test_msg.ssr_code_phase_biases_bounds.satellites_signals[2] + .phase_bias_bound_sig = 1; + test_msg.ssr_code_phase_biases_bounds.satellites_signals[2].sat_id = 1; - + test_msg.ssr_code_phase_biases_bounds.satellites_signals[2].signal_id = 1; - + test_msg.ssr_code_phase_biases_bounds.ssr_iod = 15; - sbp_message_send(&sbp_state, SbpMsgSsrCodePhaseBiasesBounds, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrCodePhaseBiasesBounds, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrCodePhaseBiasesBounds, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.const_id == 1, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.const_id, expected 1, is %d", last_msg.msg.ssr_code_phase_biases_bounds.const_id); - - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.header.num_msgs == 1, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.header.num_msgs, expected 1, is %d", last_msg.msg.ssr_code_phase_biases_bounds.header.num_msgs); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.header.seq_num == 2, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.header.seq_num, expected 2, is %d", last_msg.msg.ssr_code_phase_biases_bounds.header.seq_num); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.header.sol_id == 14, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.header.sol_id, expected 14, is %d", last_msg.msg.ssr_code_phase_biases_bounds.header.sol_id); - - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.header.time.tow == 180, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.header.time.tow, expected 180, is %d", last_msg.msg.ssr_code_phase_biases_bounds.header.time.tow); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.header.time.wn == 3, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.header.time.wn, expected 3, is %d", last_msg.msg.ssr_code_phase_biases_bounds.header.time.wn); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.header.update_interval == 1, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.header.update_interval, expected 1, is %d", last_msg.msg.ssr_code_phase_biases_bounds.header.update_interval); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.n_sats_signals == 3, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.n_sats_signals, expected 3, is %d", last_msg.msg.ssr_code_phase_biases_bounds.n_sats_signals); - - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].code_bias_bound_mu == 39, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].code_bias_bound_mu, expected 39, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].code_bias_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].code_bias_bound_sig == 1, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].code_bias_bound_sig, expected 1, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].code_bias_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].phase_bias_bound_mu == 39, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].phase_bias_bound_mu, expected 39, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].phase_bias_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].phase_bias_bound_sig == 1, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].phase_bias_bound_sig, expected 1, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].phase_bias_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].sat_id == 0, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].sat_id, expected 0, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].sat_id); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].signal_id == 3, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].signal_id, expected 3, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].signal_id); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].code_bias_bound_mu == 39, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].code_bias_bound_mu, expected 39, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].code_bias_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].code_bias_bound_sig == 1, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].code_bias_bound_sig, expected 1, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].code_bias_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].phase_bias_bound_mu == 39, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].phase_bias_bound_mu, expected 39, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].phase_bias_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].phase_bias_bound_sig == 1, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].phase_bias_bound_sig, expected 1, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].phase_bias_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].sat_id == 1, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].sat_id, expected 1, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].sat_id); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].signal_id == 3, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].signal_id, expected 3, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].signal_id); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].code_bias_bound_mu == 39, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].code_bias_bound_mu, expected 39, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].code_bias_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].code_bias_bound_sig == 1, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].code_bias_bound_sig, expected 1, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].code_bias_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].phase_bias_bound_mu == 39, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].phase_bias_bound_mu, expected 39, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].phase_bias_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].phase_bias_bound_sig == 1, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].phase_bias_bound_sig, expected 1, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].phase_bias_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].sat_id == 1, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].sat_id, expected 1, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].sat_id); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].signal_id == 1, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].signal_id, expected 1, is %d", last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].signal_id); - - ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.ssr_iod == 15, "incorrect value for last_msg.msg.ssr_code_phase_biases_bounds.ssr_iod, expected 15, is %d", last_msg.msg.ssr_code_phase_biases_bounds.ssr_iod); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrCodePhaseBiasesBounds, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.const_id == 1, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.const_id, expected 1, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.const_id); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.header.num_msgs == 1, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.header.num_msgs, expected " + "1, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.header.num_msgs); + + ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.header.seq_num == 2, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.header.seq_num, " + "expected 2, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.header.seq_num); + + ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.header.sol_id == 14, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.header.sol_id, " + "expected 14, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.header.sol_id); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.header.time.tow == 180, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.header.time.tow, expected " + "180, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.header.time.tow); + + ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.header.time.wn == 3, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.header.time.wn, " + "expected 3, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.header.time.wn); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.header.update_interval == 1, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.header.update_interval, " + "expected 1, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.header.update_interval); + + ck_assert_msg(last_msg.msg.ssr_code_phase_biases_bounds.n_sats_signals == 3, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.n_sats_signals, " + "expected 3, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.n_sats_signals); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0] + .code_bias_bound_mu == 39, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].code_" + "bias_bound_mu, expected 39, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0] + .code_bias_bound_mu); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0] + .code_bias_bound_sig == 1, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].code_" + "bias_bound_sig, expected 1, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0] + .code_bias_bound_sig); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0] + .phase_bias_bound_mu == 39, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].phase_" + "bias_bound_mu, expected 39, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0] + .phase_bias_bound_mu); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0] + .phase_bias_bound_sig == 1, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].phase_" + "bias_bound_sig, expected 1, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0] + .phase_bias_bound_sig); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0] + .sat_id == 0, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].sat_" + "id, expected 0, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0].sat_id); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0] + .signal_id == 3, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0]." + "signal_id, expected 3, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[0] + .signal_id); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1] + .code_bias_bound_mu == 39, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].code_" + "bias_bound_mu, expected 39, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1] + .code_bias_bound_mu); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1] + .code_bias_bound_sig == 1, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].code_" + "bias_bound_sig, expected 1, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1] + .code_bias_bound_sig); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1] + .phase_bias_bound_mu == 39, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].phase_" + "bias_bound_mu, expected 39, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1] + .phase_bias_bound_mu); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1] + .phase_bias_bound_sig == 1, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].phase_" + "bias_bound_sig, expected 1, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1] + .phase_bias_bound_sig); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1] + .sat_id == 1, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].sat_" + "id, expected 1, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1].sat_id); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1] + .signal_id == 3, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1]." + "signal_id, expected 3, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[1] + .signal_id); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2] + .code_bias_bound_mu == 39, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].code_" + "bias_bound_mu, expected 39, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2] + .code_bias_bound_mu); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2] + .code_bias_bound_sig == 1, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].code_" + "bias_bound_sig, expected 1, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2] + .code_bias_bound_sig); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2] + .phase_bias_bound_mu == 39, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].phase_" + "bias_bound_mu, expected 39, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2] + .phase_bias_bound_mu); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2] + .phase_bias_bound_sig == 1, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].phase_" + "bias_bound_sig, expected 1, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2] + .phase_bias_bound_sig); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2] + .sat_id == 1, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].sat_" + "id, expected 1, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2].sat_id); + + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2] + .signal_id == 1, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2]." + "signal_id, expected 1, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.satellites_signals[2] + .signal_id); + ck_assert_msg( + last_msg.msg.ssr_code_phase_biases_bounds.ssr_iod == 15, + "incorrect value for " + "last_msg.msg.ssr_code_phase_biases_bounds.ssr_iod, expected 15, is %d", + last_msg.msg.ssr_code_phase_biases_bounds.ssr_iod); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds"); +Suite *auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.c b/c/test/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.c index 80d43d21b..d34c6175f 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGridDefinitionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGridDefinitionDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,813 +90,1853 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x5f5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x5f5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,245,5,181,247,255,11,84,171,229,132,143,46,204,52,92,104,25,204,182,22,98,203,123,211,38,13,253,129,173,171,235,253,26,203,3,120,126,42,44,39,87,69,154,13,28,179,32,47,36,195,39,198,134,235,134,57,120,243,151,35,17,201,211,125,117,164,142,101,239,144,158,239,90,56,71,120,67,221,114,10,190,4,230,164,171,78,185,90,46,177,82,228,123,222,227,145,195,219,27,56,227,246,215,144,158,31,214,241,254,200,86,142,89,12,121,29,124,9,19,153,44,35,126,14,217,65,116,26,139,122,114,90,124,81,0,186,246,46,98,179,243,198,217,36,30,202,12,135,61,42,150,221,102,83,179,43,252,81,62,126,204,195,238,18,128,193,53,94,99,63,182,2,186,220,77,186,224,220,13,212,182,88,15,151,5,93,251,164,18,228,168,226,195,44,170,145,36,58,96,107,144,11,228,12,163,238,247,159,189,1,115,65,202,121,47,193,11,96,93,72,81,207,121,19,151,136,233,51,133,195,77,44,147,206,120,252,77,212,68,60,206,106,207,243,158,94,6,3,205,92,84,2,220,50,61,38,141,117,108,101,76,139, }; + u8 encoded_frame[] = { + 85, 245, 5, 181, 247, 255, 11, 84, 171, 229, 132, 143, 46, 204, + 52, 92, 104, 25, 204, 182, 22, 98, 203, 123, 211, 38, 13, 253, + 129, 173, 171, 235, 253, 26, 203, 3, 120, 126, 42, 44, 39, 87, + 69, 154, 13, 28, 179, 32, 47, 36, 195, 39, 198, 134, 235, 134, + 57, 120, 243, 151, 35, 17, 201, 211, 125, 117, 164, 142, 101, 239, + 144, 158, 239, 90, 56, 71, 120, 67, 221, 114, 10, 190, 4, 230, + 164, 171, 78, 185, 90, 46, 177, 82, 228, 123, 222, 227, 145, 195, + 219, 27, 56, 227, 246, 215, 144, 158, 31, 214, 241, 254, 200, 86, + 142, 89, 12, 121, 29, 124, 9, 19, 153, 44, 35, 126, 14, 217, + 65, 116, 26, 139, 122, 114, 90, 124, 81, 0, 186, 246, 46, 98, + 179, 243, 198, 217, 36, 30, 202, 12, 135, 61, 42, 150, 221, 102, + 83, 179, 43, 252, 81, 62, 126, 204, 195, 238, 18, 128, 193, 53, + 94, 99, 63, 182, 2, 186, 220, 77, 186, 224, 220, 13, 212, 182, + 88, 15, 151, 5, 93, 251, 164, 18, 228, 168, 226, 195, 44, 170, + 145, 36, 58, 96, 107, 144, 11, 228, 12, 163, 238, 247, 159, 189, + 1, 115, 65, 202, 121, 47, 193, 11, 96, 93, 72, 81, 207, 121, + 19, 151, 136, 233, 51, 133, 195, 77, 44, 147, 206, 120, 252, 77, + 212, 68, 60, 206, 106, 207, 243, 158, 94, 6, 3, 205, 92, 84, + 2, 220, 50, 61, 38, 141, 117, 108, 101, 76, 139, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ssr_grid_definition_dep_a.header.area_width = 43860; - + test_msg.ssr_grid_definition_dep_a.header.lat_nw_corner_enc = 34021; - + test_msg.ssr_grid_definition_dep_a.header.lon_nw_corner_enc = 11919; - + test_msg.ssr_grid_definition_dep_a.header.num_msgs = 204; - + test_msg.ssr_grid_definition_dep_a.header.region_size_inverse = 11; - + test_msg.ssr_grid_definition_dep_a.header.seq_num = 52; - + test_msg.ssr_grid_definition_dep_a.n_rle_list = 246; - - + test_msg.ssr_grid_definition_dep_a.rle_list[0] = 92; - + test_msg.ssr_grid_definition_dep_a.rle_list[1] = 104; - + test_msg.ssr_grid_definition_dep_a.rle_list[2] = 25; - + test_msg.ssr_grid_definition_dep_a.rle_list[3] = 204; - + test_msg.ssr_grid_definition_dep_a.rle_list[4] = 182; - + test_msg.ssr_grid_definition_dep_a.rle_list[5] = 22; - + test_msg.ssr_grid_definition_dep_a.rle_list[6] = 98; - + test_msg.ssr_grid_definition_dep_a.rle_list[7] = 203; - + test_msg.ssr_grid_definition_dep_a.rle_list[8] = 123; - + test_msg.ssr_grid_definition_dep_a.rle_list[9] = 211; - + test_msg.ssr_grid_definition_dep_a.rle_list[10] = 38; - + test_msg.ssr_grid_definition_dep_a.rle_list[11] = 13; - + test_msg.ssr_grid_definition_dep_a.rle_list[12] = 253; - + test_msg.ssr_grid_definition_dep_a.rle_list[13] = 129; - + test_msg.ssr_grid_definition_dep_a.rle_list[14] = 173; - + test_msg.ssr_grid_definition_dep_a.rle_list[15] = 171; - + test_msg.ssr_grid_definition_dep_a.rle_list[16] = 235; - + test_msg.ssr_grid_definition_dep_a.rle_list[17] = 253; - + test_msg.ssr_grid_definition_dep_a.rle_list[18] = 26; - + test_msg.ssr_grid_definition_dep_a.rle_list[19] = 203; - + test_msg.ssr_grid_definition_dep_a.rle_list[20] = 3; - + test_msg.ssr_grid_definition_dep_a.rle_list[21] = 120; - + test_msg.ssr_grid_definition_dep_a.rle_list[22] = 126; - + test_msg.ssr_grid_definition_dep_a.rle_list[23] = 42; - + test_msg.ssr_grid_definition_dep_a.rle_list[24] = 44; - + test_msg.ssr_grid_definition_dep_a.rle_list[25] = 39; - + test_msg.ssr_grid_definition_dep_a.rle_list[26] = 87; - + test_msg.ssr_grid_definition_dep_a.rle_list[27] = 69; - + test_msg.ssr_grid_definition_dep_a.rle_list[28] = 154; - + test_msg.ssr_grid_definition_dep_a.rle_list[29] = 13; - + test_msg.ssr_grid_definition_dep_a.rle_list[30] = 28; - + test_msg.ssr_grid_definition_dep_a.rle_list[31] = 179; - + test_msg.ssr_grid_definition_dep_a.rle_list[32] = 32; - + test_msg.ssr_grid_definition_dep_a.rle_list[33] = 47; - + test_msg.ssr_grid_definition_dep_a.rle_list[34] = 36; - + test_msg.ssr_grid_definition_dep_a.rle_list[35] = 195; - + test_msg.ssr_grid_definition_dep_a.rle_list[36] = 39; - + test_msg.ssr_grid_definition_dep_a.rle_list[37] = 198; - + test_msg.ssr_grid_definition_dep_a.rle_list[38] = 134; - + test_msg.ssr_grid_definition_dep_a.rle_list[39] = 235; - + test_msg.ssr_grid_definition_dep_a.rle_list[40] = 134; - + test_msg.ssr_grid_definition_dep_a.rle_list[41] = 57; - + test_msg.ssr_grid_definition_dep_a.rle_list[42] = 120; - + test_msg.ssr_grid_definition_dep_a.rle_list[43] = 243; - + test_msg.ssr_grid_definition_dep_a.rle_list[44] = 151; - + test_msg.ssr_grid_definition_dep_a.rle_list[45] = 35; - + test_msg.ssr_grid_definition_dep_a.rle_list[46] = 17; - + test_msg.ssr_grid_definition_dep_a.rle_list[47] = 201; - + test_msg.ssr_grid_definition_dep_a.rle_list[48] = 211; - + test_msg.ssr_grid_definition_dep_a.rle_list[49] = 125; - + test_msg.ssr_grid_definition_dep_a.rle_list[50] = 117; - + test_msg.ssr_grid_definition_dep_a.rle_list[51] = 164; - + test_msg.ssr_grid_definition_dep_a.rle_list[52] = 142; - + test_msg.ssr_grid_definition_dep_a.rle_list[53] = 101; - + test_msg.ssr_grid_definition_dep_a.rle_list[54] = 239; - + test_msg.ssr_grid_definition_dep_a.rle_list[55] = 144; - + test_msg.ssr_grid_definition_dep_a.rle_list[56] = 158; - + test_msg.ssr_grid_definition_dep_a.rle_list[57] = 239; - + test_msg.ssr_grid_definition_dep_a.rle_list[58] = 90; - + test_msg.ssr_grid_definition_dep_a.rle_list[59] = 56; - + test_msg.ssr_grid_definition_dep_a.rle_list[60] = 71; - + test_msg.ssr_grid_definition_dep_a.rle_list[61] = 120; - + test_msg.ssr_grid_definition_dep_a.rle_list[62] = 67; - + test_msg.ssr_grid_definition_dep_a.rle_list[63] = 221; - + test_msg.ssr_grid_definition_dep_a.rle_list[64] = 114; - + test_msg.ssr_grid_definition_dep_a.rle_list[65] = 10; - + test_msg.ssr_grid_definition_dep_a.rle_list[66] = 190; - + test_msg.ssr_grid_definition_dep_a.rle_list[67] = 4; - + test_msg.ssr_grid_definition_dep_a.rle_list[68] = 230; - + test_msg.ssr_grid_definition_dep_a.rle_list[69] = 164; - + test_msg.ssr_grid_definition_dep_a.rle_list[70] = 171; - + test_msg.ssr_grid_definition_dep_a.rle_list[71] = 78; - + test_msg.ssr_grid_definition_dep_a.rle_list[72] = 185; - + test_msg.ssr_grid_definition_dep_a.rle_list[73] = 90; - + test_msg.ssr_grid_definition_dep_a.rle_list[74] = 46; - + test_msg.ssr_grid_definition_dep_a.rle_list[75] = 177; - + test_msg.ssr_grid_definition_dep_a.rle_list[76] = 82; - + test_msg.ssr_grid_definition_dep_a.rle_list[77] = 228; - + test_msg.ssr_grid_definition_dep_a.rle_list[78] = 123; - + test_msg.ssr_grid_definition_dep_a.rle_list[79] = 222; - + test_msg.ssr_grid_definition_dep_a.rle_list[80] = 227; - + test_msg.ssr_grid_definition_dep_a.rle_list[81] = 145; - + test_msg.ssr_grid_definition_dep_a.rle_list[82] = 195; - + test_msg.ssr_grid_definition_dep_a.rle_list[83] = 219; - + test_msg.ssr_grid_definition_dep_a.rle_list[84] = 27; - + test_msg.ssr_grid_definition_dep_a.rle_list[85] = 56; - + test_msg.ssr_grid_definition_dep_a.rle_list[86] = 227; - + test_msg.ssr_grid_definition_dep_a.rle_list[87] = 246; - + test_msg.ssr_grid_definition_dep_a.rle_list[88] = 215; - + test_msg.ssr_grid_definition_dep_a.rle_list[89] = 144; - + test_msg.ssr_grid_definition_dep_a.rle_list[90] = 158; - + test_msg.ssr_grid_definition_dep_a.rle_list[91] = 31; - + test_msg.ssr_grid_definition_dep_a.rle_list[92] = 214; - + test_msg.ssr_grid_definition_dep_a.rle_list[93] = 241; - + test_msg.ssr_grid_definition_dep_a.rle_list[94] = 254; - + test_msg.ssr_grid_definition_dep_a.rle_list[95] = 200; - + test_msg.ssr_grid_definition_dep_a.rle_list[96] = 86; - + test_msg.ssr_grid_definition_dep_a.rle_list[97] = 142; - + test_msg.ssr_grid_definition_dep_a.rle_list[98] = 89; - + test_msg.ssr_grid_definition_dep_a.rle_list[99] = 12; - + test_msg.ssr_grid_definition_dep_a.rle_list[100] = 121; - + test_msg.ssr_grid_definition_dep_a.rle_list[101] = 29; - + test_msg.ssr_grid_definition_dep_a.rle_list[102] = 124; - + test_msg.ssr_grid_definition_dep_a.rle_list[103] = 9; - + test_msg.ssr_grid_definition_dep_a.rle_list[104] = 19; - + test_msg.ssr_grid_definition_dep_a.rle_list[105] = 153; - + test_msg.ssr_grid_definition_dep_a.rle_list[106] = 44; - + test_msg.ssr_grid_definition_dep_a.rle_list[107] = 35; - + test_msg.ssr_grid_definition_dep_a.rle_list[108] = 126; - + test_msg.ssr_grid_definition_dep_a.rle_list[109] = 14; - + test_msg.ssr_grid_definition_dep_a.rle_list[110] = 217; - + test_msg.ssr_grid_definition_dep_a.rle_list[111] = 65; - + test_msg.ssr_grid_definition_dep_a.rle_list[112] = 116; - + test_msg.ssr_grid_definition_dep_a.rle_list[113] = 26; - + test_msg.ssr_grid_definition_dep_a.rle_list[114] = 139; - + test_msg.ssr_grid_definition_dep_a.rle_list[115] = 122; - + test_msg.ssr_grid_definition_dep_a.rle_list[116] = 114; - + test_msg.ssr_grid_definition_dep_a.rle_list[117] = 90; - + test_msg.ssr_grid_definition_dep_a.rle_list[118] = 124; - + test_msg.ssr_grid_definition_dep_a.rle_list[119] = 81; - + test_msg.ssr_grid_definition_dep_a.rle_list[120] = 0; - + test_msg.ssr_grid_definition_dep_a.rle_list[121] = 186; - + test_msg.ssr_grid_definition_dep_a.rle_list[122] = 246; - + test_msg.ssr_grid_definition_dep_a.rle_list[123] = 46; - + test_msg.ssr_grid_definition_dep_a.rle_list[124] = 98; - + test_msg.ssr_grid_definition_dep_a.rle_list[125] = 179; - + test_msg.ssr_grid_definition_dep_a.rle_list[126] = 243; - + test_msg.ssr_grid_definition_dep_a.rle_list[127] = 198; - + test_msg.ssr_grid_definition_dep_a.rle_list[128] = 217; - + test_msg.ssr_grid_definition_dep_a.rle_list[129] = 36; - + test_msg.ssr_grid_definition_dep_a.rle_list[130] = 30; - + test_msg.ssr_grid_definition_dep_a.rle_list[131] = 202; - + test_msg.ssr_grid_definition_dep_a.rle_list[132] = 12; - + test_msg.ssr_grid_definition_dep_a.rle_list[133] = 135; - + test_msg.ssr_grid_definition_dep_a.rle_list[134] = 61; - + test_msg.ssr_grid_definition_dep_a.rle_list[135] = 42; - + test_msg.ssr_grid_definition_dep_a.rle_list[136] = 150; - + test_msg.ssr_grid_definition_dep_a.rle_list[137] = 221; - + test_msg.ssr_grid_definition_dep_a.rle_list[138] = 102; - + test_msg.ssr_grid_definition_dep_a.rle_list[139] = 83; - + test_msg.ssr_grid_definition_dep_a.rle_list[140] = 179; - + test_msg.ssr_grid_definition_dep_a.rle_list[141] = 43; - + test_msg.ssr_grid_definition_dep_a.rle_list[142] = 252; - + test_msg.ssr_grid_definition_dep_a.rle_list[143] = 81; - + test_msg.ssr_grid_definition_dep_a.rle_list[144] = 62; - + test_msg.ssr_grid_definition_dep_a.rle_list[145] = 126; - + test_msg.ssr_grid_definition_dep_a.rle_list[146] = 204; - + test_msg.ssr_grid_definition_dep_a.rle_list[147] = 195; - + test_msg.ssr_grid_definition_dep_a.rle_list[148] = 238; - + test_msg.ssr_grid_definition_dep_a.rle_list[149] = 18; - + test_msg.ssr_grid_definition_dep_a.rle_list[150] = 128; - + test_msg.ssr_grid_definition_dep_a.rle_list[151] = 193; - + test_msg.ssr_grid_definition_dep_a.rle_list[152] = 53; - + test_msg.ssr_grid_definition_dep_a.rle_list[153] = 94; - + test_msg.ssr_grid_definition_dep_a.rle_list[154] = 99; - + test_msg.ssr_grid_definition_dep_a.rle_list[155] = 63; - + test_msg.ssr_grid_definition_dep_a.rle_list[156] = 182; - + test_msg.ssr_grid_definition_dep_a.rle_list[157] = 2; - + test_msg.ssr_grid_definition_dep_a.rle_list[158] = 186; - + test_msg.ssr_grid_definition_dep_a.rle_list[159] = 220; - + test_msg.ssr_grid_definition_dep_a.rle_list[160] = 77; - + test_msg.ssr_grid_definition_dep_a.rle_list[161] = 186; - + test_msg.ssr_grid_definition_dep_a.rle_list[162] = 224; - + test_msg.ssr_grid_definition_dep_a.rle_list[163] = 220; - + test_msg.ssr_grid_definition_dep_a.rle_list[164] = 13; - + test_msg.ssr_grid_definition_dep_a.rle_list[165] = 212; - + test_msg.ssr_grid_definition_dep_a.rle_list[166] = 182; - + test_msg.ssr_grid_definition_dep_a.rle_list[167] = 88; - + test_msg.ssr_grid_definition_dep_a.rle_list[168] = 15; - + test_msg.ssr_grid_definition_dep_a.rle_list[169] = 151; - + test_msg.ssr_grid_definition_dep_a.rle_list[170] = 5; - + test_msg.ssr_grid_definition_dep_a.rle_list[171] = 93; - + test_msg.ssr_grid_definition_dep_a.rle_list[172] = 251; - + test_msg.ssr_grid_definition_dep_a.rle_list[173] = 164; - + test_msg.ssr_grid_definition_dep_a.rle_list[174] = 18; - + test_msg.ssr_grid_definition_dep_a.rle_list[175] = 228; - + test_msg.ssr_grid_definition_dep_a.rle_list[176] = 168; - + test_msg.ssr_grid_definition_dep_a.rle_list[177] = 226; - + test_msg.ssr_grid_definition_dep_a.rle_list[178] = 195; - + test_msg.ssr_grid_definition_dep_a.rle_list[179] = 44; - + test_msg.ssr_grid_definition_dep_a.rle_list[180] = 170; - + test_msg.ssr_grid_definition_dep_a.rle_list[181] = 145; - + test_msg.ssr_grid_definition_dep_a.rle_list[182] = 36; - + test_msg.ssr_grid_definition_dep_a.rle_list[183] = 58; - + test_msg.ssr_grid_definition_dep_a.rle_list[184] = 96; - + test_msg.ssr_grid_definition_dep_a.rle_list[185] = 107; - + test_msg.ssr_grid_definition_dep_a.rle_list[186] = 144; - + test_msg.ssr_grid_definition_dep_a.rle_list[187] = 11; - + test_msg.ssr_grid_definition_dep_a.rle_list[188] = 228; - + test_msg.ssr_grid_definition_dep_a.rle_list[189] = 12; - + test_msg.ssr_grid_definition_dep_a.rle_list[190] = 163; - + test_msg.ssr_grid_definition_dep_a.rle_list[191] = 238; - + test_msg.ssr_grid_definition_dep_a.rle_list[192] = 247; - + test_msg.ssr_grid_definition_dep_a.rle_list[193] = 159; - + test_msg.ssr_grid_definition_dep_a.rle_list[194] = 189; - + test_msg.ssr_grid_definition_dep_a.rle_list[195] = 1; - + test_msg.ssr_grid_definition_dep_a.rle_list[196] = 115; - + test_msg.ssr_grid_definition_dep_a.rle_list[197] = 65; - + test_msg.ssr_grid_definition_dep_a.rle_list[198] = 202; - + test_msg.ssr_grid_definition_dep_a.rle_list[199] = 121; - + test_msg.ssr_grid_definition_dep_a.rle_list[200] = 47; - + test_msg.ssr_grid_definition_dep_a.rle_list[201] = 193; - + test_msg.ssr_grid_definition_dep_a.rle_list[202] = 11; - + test_msg.ssr_grid_definition_dep_a.rle_list[203] = 96; - + test_msg.ssr_grid_definition_dep_a.rle_list[204] = 93; - + test_msg.ssr_grid_definition_dep_a.rle_list[205] = 72; - + test_msg.ssr_grid_definition_dep_a.rle_list[206] = 81; - + test_msg.ssr_grid_definition_dep_a.rle_list[207] = 207; - + test_msg.ssr_grid_definition_dep_a.rle_list[208] = 121; - + test_msg.ssr_grid_definition_dep_a.rle_list[209] = 19; - + test_msg.ssr_grid_definition_dep_a.rle_list[210] = 151; - + test_msg.ssr_grid_definition_dep_a.rle_list[211] = 136; - + test_msg.ssr_grid_definition_dep_a.rle_list[212] = 233; - + test_msg.ssr_grid_definition_dep_a.rle_list[213] = 51; - + test_msg.ssr_grid_definition_dep_a.rle_list[214] = 133; - + test_msg.ssr_grid_definition_dep_a.rle_list[215] = 195; - + test_msg.ssr_grid_definition_dep_a.rle_list[216] = 77; - + test_msg.ssr_grid_definition_dep_a.rle_list[217] = 44; - + test_msg.ssr_grid_definition_dep_a.rle_list[218] = 147; - + test_msg.ssr_grid_definition_dep_a.rle_list[219] = 206; - + test_msg.ssr_grid_definition_dep_a.rle_list[220] = 120; - + test_msg.ssr_grid_definition_dep_a.rle_list[221] = 252; - + test_msg.ssr_grid_definition_dep_a.rle_list[222] = 77; - + test_msg.ssr_grid_definition_dep_a.rle_list[223] = 212; - + test_msg.ssr_grid_definition_dep_a.rle_list[224] = 68; - + test_msg.ssr_grid_definition_dep_a.rle_list[225] = 60; - + test_msg.ssr_grid_definition_dep_a.rle_list[226] = 206; - + test_msg.ssr_grid_definition_dep_a.rle_list[227] = 106; - + test_msg.ssr_grid_definition_dep_a.rle_list[228] = 207; - + test_msg.ssr_grid_definition_dep_a.rle_list[229] = 243; - + test_msg.ssr_grid_definition_dep_a.rle_list[230] = 158; - + test_msg.ssr_grid_definition_dep_a.rle_list[231] = 94; - + test_msg.ssr_grid_definition_dep_a.rle_list[232] = 6; - + test_msg.ssr_grid_definition_dep_a.rle_list[233] = 3; - + test_msg.ssr_grid_definition_dep_a.rle_list[234] = 205; - + test_msg.ssr_grid_definition_dep_a.rle_list[235] = 92; - + test_msg.ssr_grid_definition_dep_a.rle_list[236] = 84; - + test_msg.ssr_grid_definition_dep_a.rle_list[237] = 2; - + test_msg.ssr_grid_definition_dep_a.rle_list[238] = 220; - + test_msg.ssr_grid_definition_dep_a.rle_list[239] = 50; - + test_msg.ssr_grid_definition_dep_a.rle_list[240] = 61; - + test_msg.ssr_grid_definition_dep_a.rle_list[241] = 38; - + test_msg.ssr_grid_definition_dep_a.rle_list[242] = 141; - + test_msg.ssr_grid_definition_dep_a.rle_list[243] = 117; - + test_msg.ssr_grid_definition_dep_a.rle_list[244] = 108; - + test_msg.ssr_grid_definition_dep_a.rle_list[245] = 101; - sbp_message_send(&sbp_state, SbpMsgSsrGridDefinitionDepA, 63413, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrGridDefinitionDepA, 63413, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 63413, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrGridDefinitionDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.header.area_width == 43860, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.header.area_width, expected 43860, is %d", last_msg.msg.ssr_grid_definition_dep_a.header.area_width); - - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.header.lat_nw_corner_enc == 34021, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.header.lat_nw_corner_enc, expected 34021, is %d", last_msg.msg.ssr_grid_definition_dep_a.header.lat_nw_corner_enc); - - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.header.lon_nw_corner_enc == 11919, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.header.lon_nw_corner_enc, expected 11919, is %d", last_msg.msg.ssr_grid_definition_dep_a.header.lon_nw_corner_enc); - - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.header.num_msgs == 204, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.header.num_msgs, expected 204, is %d", last_msg.msg.ssr_grid_definition_dep_a.header.num_msgs); - - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.header.region_size_inverse == 11, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.header.region_size_inverse, expected 11, is %d", last_msg.msg.ssr_grid_definition_dep_a.header.region_size_inverse); - - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.header.seq_num == 52, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.header.seq_num, expected 52, is %d", last_msg.msg.ssr_grid_definition_dep_a.header.seq_num); - - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.n_rle_list == 246, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.n_rle_list, expected 246, is %d", last_msg.msg.ssr_grid_definition_dep_a.n_rle_list); - - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[0] == 92, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[0], expected 92, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[0]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[1] == 104, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[1], expected 104, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[1]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[2] == 25, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[2], expected 25, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[2]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[3] == 204, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[3], expected 204, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[3]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[4] == 182, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[4], expected 182, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[4]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[5] == 22, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[5], expected 22, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[5]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[6] == 98, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[6], expected 98, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[6]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[7] == 203, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[7], expected 203, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[7]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[8] == 123, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[8], expected 123, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[8]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[9] == 211, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[9], expected 211, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[9]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[10] == 38, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[10], expected 38, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[10]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[11] == 13, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[11], expected 13, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[11]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[12] == 253, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[12], expected 253, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[12]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[13] == 129, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[13], expected 129, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[13]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[14] == 173, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[14], expected 173, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[14]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[15] == 171, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[15], expected 171, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[15]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[16] == 235, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[16], expected 235, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[16]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[17] == 253, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[17], expected 253, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[17]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[18] == 26, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[18], expected 26, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[18]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[19] == 203, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[19], expected 203, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[19]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[20] == 3, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[20], expected 3, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[20]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[21] == 120, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[21], expected 120, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[21]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[22] == 126, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[22], expected 126, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[22]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[23] == 42, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[23], expected 42, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[23]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[24] == 44, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[24], expected 44, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[24]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[25] == 39, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[25], expected 39, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[25]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[26] == 87, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[26], expected 87, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[26]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[27] == 69, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[27], expected 69, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[27]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[28] == 154, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[28], expected 154, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[28]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[29] == 13, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[29], expected 13, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[29]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[30] == 28, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[30], expected 28, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[30]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[31] == 179, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[31], expected 179, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[31]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[32] == 32, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[32], expected 32, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[32]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[33] == 47, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[33], expected 47, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[33]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[34] == 36, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[34], expected 36, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[34]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[35] == 195, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[35], expected 195, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[35]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[36] == 39, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[36], expected 39, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[36]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[37] == 198, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[37], expected 198, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[37]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[38] == 134, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[38], expected 134, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[38]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[39] == 235, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[39], expected 235, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[39]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[40] == 134, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[40], expected 134, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[40]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[41] == 57, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[41], expected 57, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[41]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[42] == 120, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[42], expected 120, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[42]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[43] == 243, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[43], expected 243, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[43]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[44] == 151, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[44], expected 151, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[44]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[45] == 35, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[45], expected 35, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[45]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[46] == 17, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[46], expected 17, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[46]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[47] == 201, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[47], expected 201, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[47]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[48] == 211, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[48], expected 211, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[48]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[49] == 125, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[49], expected 125, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[49]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[50] == 117, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[50], expected 117, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[50]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[51] == 164, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[51], expected 164, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[51]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[52] == 142, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[52], expected 142, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[52]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[53] == 101, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[53], expected 101, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[53]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[54] == 239, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[54], expected 239, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[54]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[55] == 144, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[55], expected 144, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[55]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[56] == 158, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[56], expected 158, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[56]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[57] == 239, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[57], expected 239, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[57]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[58] == 90, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[58], expected 90, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[58]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[59] == 56, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[59], expected 56, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[59]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[60] == 71, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[60], expected 71, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[60]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[61] == 120, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[61], expected 120, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[61]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[62] == 67, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[62], expected 67, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[62]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[63] == 221, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[63], expected 221, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[63]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[64] == 114, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[64], expected 114, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[64]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[65] == 10, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[65], expected 10, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[65]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[66] == 190, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[66], expected 190, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[66]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[67] == 4, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[67], expected 4, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[67]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[68] == 230, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[68], expected 230, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[68]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[69] == 164, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[69], expected 164, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[69]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[70] == 171, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[70], expected 171, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[70]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[71] == 78, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[71], expected 78, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[71]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[72] == 185, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[72], expected 185, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[72]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[73] == 90, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[73], expected 90, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[73]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[74] == 46, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[74], expected 46, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[74]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[75] == 177, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[75], expected 177, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[75]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[76] == 82, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[76], expected 82, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[76]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[77] == 228, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[77], expected 228, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[77]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[78] == 123, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[78], expected 123, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[78]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[79] == 222, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[79], expected 222, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[79]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[80] == 227, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[80], expected 227, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[80]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[81] == 145, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[81], expected 145, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[81]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[82] == 195, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[82], expected 195, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[82]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[83] == 219, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[83], expected 219, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[83]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[84] == 27, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[84], expected 27, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[84]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[85] == 56, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[85], expected 56, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[85]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[86] == 227, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[86], expected 227, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[86]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[87] == 246, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[87], expected 246, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[87]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[88] == 215, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[88], expected 215, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[88]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[89] == 144, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[89], expected 144, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[89]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[90] == 158, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[90], expected 158, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[90]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[91] == 31, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[91], expected 31, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[91]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[92] == 214, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[92], expected 214, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[92]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[93] == 241, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[93], expected 241, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[93]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[94] == 254, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[94], expected 254, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[94]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[95] == 200, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[95], expected 200, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[95]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[96] == 86, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[96], expected 86, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[96]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[97] == 142, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[97], expected 142, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[97]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[98] == 89, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[98], expected 89, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[98]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[99] == 12, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[99], expected 12, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[99]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[100] == 121, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[100], expected 121, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[100]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[101] == 29, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[101], expected 29, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[101]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[102] == 124, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[102], expected 124, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[102]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[103] == 9, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[103], expected 9, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[103]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[104] == 19, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[104], expected 19, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[104]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[105] == 153, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[105], expected 153, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[105]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[106] == 44, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[106], expected 44, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[106]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[107] == 35, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[107], expected 35, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[107]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[108] == 126, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[108], expected 126, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[108]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[109] == 14, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[109], expected 14, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[109]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[110] == 217, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[110], expected 217, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[110]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[111] == 65, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[111], expected 65, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[111]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[112] == 116, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[112], expected 116, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[112]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[113] == 26, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[113], expected 26, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[113]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[114] == 139, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[114], expected 139, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[114]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[115] == 122, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[115], expected 122, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[115]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[116] == 114, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[116], expected 114, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[116]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[117] == 90, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[117], expected 90, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[117]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[118] == 124, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[118], expected 124, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[118]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[119] == 81, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[119], expected 81, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[119]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[120] == 0, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[120], expected 0, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[120]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[121] == 186, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[121], expected 186, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[121]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[122] == 246, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[122], expected 246, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[122]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[123] == 46, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[123], expected 46, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[123]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[124] == 98, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[124], expected 98, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[124]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[125] == 179, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[125], expected 179, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[125]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[126] == 243, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[126], expected 243, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[126]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[127] == 198, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[127], expected 198, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[127]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[128] == 217, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[128], expected 217, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[128]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[129] == 36, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[129], expected 36, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[129]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[130] == 30, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[130], expected 30, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[130]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[131] == 202, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[131], expected 202, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[131]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[132] == 12, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[132], expected 12, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[132]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[133] == 135, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[133], expected 135, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[133]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[134] == 61, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[134], expected 61, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[134]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[135] == 42, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[135], expected 42, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[135]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[136] == 150, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[136], expected 150, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[136]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[137] == 221, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[137], expected 221, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[137]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[138] == 102, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[138], expected 102, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[138]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[139] == 83, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[139], expected 83, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[139]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[140] == 179, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[140], expected 179, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[140]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[141] == 43, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[141], expected 43, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[141]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[142] == 252, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[142], expected 252, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[142]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[143] == 81, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[143], expected 81, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[143]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[144] == 62, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[144], expected 62, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[144]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[145] == 126, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[145], expected 126, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[145]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[146] == 204, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[146], expected 204, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[146]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[147] == 195, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[147], expected 195, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[147]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[148] == 238, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[148], expected 238, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[148]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[149] == 18, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[149], expected 18, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[149]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[150] == 128, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[150], expected 128, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[150]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[151] == 193, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[151], expected 193, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[151]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[152] == 53, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[152], expected 53, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[152]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[153] == 94, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[153], expected 94, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[153]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[154] == 99, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[154], expected 99, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[154]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[155] == 63, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[155], expected 63, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[155]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[156] == 182, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[156], expected 182, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[156]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[157] == 2, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[157], expected 2, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[157]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[158] == 186, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[158], expected 186, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[158]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[159] == 220, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[159], expected 220, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[159]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[160] == 77, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[160], expected 77, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[160]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[161] == 186, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[161], expected 186, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[161]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[162] == 224, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[162], expected 224, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[162]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[163] == 220, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[163], expected 220, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[163]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[164] == 13, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[164], expected 13, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[164]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[165] == 212, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[165], expected 212, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[165]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[166] == 182, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[166], expected 182, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[166]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[167] == 88, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[167], expected 88, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[167]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[168] == 15, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[168], expected 15, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[168]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[169] == 151, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[169], expected 151, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[169]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[170] == 5, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[170], expected 5, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[170]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[171] == 93, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[171], expected 93, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[171]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[172] == 251, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[172], expected 251, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[172]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[173] == 164, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[173], expected 164, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[173]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[174] == 18, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[174], expected 18, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[174]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[175] == 228, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[175], expected 228, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[175]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[176] == 168, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[176], expected 168, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[176]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[177] == 226, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[177], expected 226, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[177]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[178] == 195, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[178], expected 195, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[178]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[179] == 44, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[179], expected 44, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[179]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[180] == 170, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[180], expected 170, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[180]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[181] == 145, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[181], expected 145, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[181]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[182] == 36, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[182], expected 36, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[182]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[183] == 58, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[183], expected 58, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[183]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[184] == 96, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[184], expected 96, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[184]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[185] == 107, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[185], expected 107, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[185]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[186] == 144, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[186], expected 144, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[186]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[187] == 11, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[187], expected 11, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[187]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[188] == 228, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[188], expected 228, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[188]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[189] == 12, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[189], expected 12, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[189]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[190] == 163, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[190], expected 163, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[190]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[191] == 238, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[191], expected 238, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[191]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[192] == 247, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[192], expected 247, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[192]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[193] == 159, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[193], expected 159, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[193]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[194] == 189, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[194], expected 189, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[194]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[195] == 1, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[195], expected 1, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[195]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[196] == 115, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[196], expected 115, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[196]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[197] == 65, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[197], expected 65, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[197]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[198] == 202, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[198], expected 202, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[198]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[199] == 121, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[199], expected 121, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[199]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[200] == 47, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[200], expected 47, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[200]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[201] == 193, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[201], expected 193, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[201]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[202] == 11, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[202], expected 11, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[202]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[203] == 96, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[203], expected 96, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[203]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[204] == 93, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[204], expected 93, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[204]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[205] == 72, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[205], expected 72, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[205]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[206] == 81, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[206], expected 81, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[206]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[207] == 207, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[207], expected 207, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[207]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[208] == 121, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[208], expected 121, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[208]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[209] == 19, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[209], expected 19, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[209]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[210] == 151, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[210], expected 151, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[210]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[211] == 136, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[211], expected 136, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[211]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[212] == 233, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[212], expected 233, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[212]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[213] == 51, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[213], expected 51, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[213]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[214] == 133, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[214], expected 133, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[214]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[215] == 195, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[215], expected 195, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[215]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[216] == 77, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[216], expected 77, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[216]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[217] == 44, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[217], expected 44, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[217]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[218] == 147, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[218], expected 147, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[218]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[219] == 206, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[219], expected 206, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[219]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[220] == 120, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[220], expected 120, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[220]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[221] == 252, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[221], expected 252, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[221]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[222] == 77, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[222], expected 77, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[222]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[223] == 212, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[223], expected 212, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[223]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[224] == 68, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[224], expected 68, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[224]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[225] == 60, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[225], expected 60, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[225]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[226] == 206, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[226], expected 206, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[226]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[227] == 106, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[227], expected 106, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[227]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[228] == 207, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[228], expected 207, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[228]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[229] == 243, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[229], expected 243, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[229]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[230] == 158, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[230], expected 158, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[230]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[231] == 94, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[231], expected 94, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[231]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[232] == 6, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[232], expected 6, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[232]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[233] == 3, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[233], expected 3, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[233]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[234] == 205, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[234], expected 205, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[234]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[235] == 92, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[235], expected 92, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[235]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[236] == 84, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[236], expected 84, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[236]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[237] == 2, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[237], expected 2, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[237]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[238] == 220, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[238], expected 220, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[238]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[239] == 50, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[239], expected 50, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[239]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[240] == 61, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[240], expected 61, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[240]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[241] == 38, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[241], expected 38, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[241]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[242] == 141, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[242], expected 141, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[242]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[243] == 117, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[243], expected 117, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[243]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[244] == 108, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[244], expected 108, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[244]); - ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[245] == 101, "incorrect value for last_msg.msg.ssr_grid_definition_dep_a.rle_list[245], expected 101, is %d", last_msg.msg.ssr_grid_definition_dep_a.rle_list[245]); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrGridDefinitionDepA, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.ssr_grid_definition_dep_a.header.area_width == 43860, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.header.area_width, expected " + "43860, is %d", + last_msg.msg.ssr_grid_definition_dep_a.header.area_width); + + ck_assert_msg( + last_msg.msg.ssr_grid_definition_dep_a.header.lat_nw_corner_enc == + 34021, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.header.lat_nw_corner_enc, " + "expected 34021, is %d", + last_msg.msg.ssr_grid_definition_dep_a.header.lat_nw_corner_enc); + + ck_assert_msg( + last_msg.msg.ssr_grid_definition_dep_a.header.lon_nw_corner_enc == + 11919, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.header.lon_nw_corner_enc, " + "expected 11919, is %d", + last_msg.msg.ssr_grid_definition_dep_a.header.lon_nw_corner_enc); + + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.header.num_msgs == 204, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.header.num_msgs, " + "expected 204, is %d", + last_msg.msg.ssr_grid_definition_dep_a.header.num_msgs); + + ck_assert_msg( + last_msg.msg.ssr_grid_definition_dep_a.header.region_size_inverse == 11, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.header.region_size_inverse, " + "expected 11, is %d", + last_msg.msg.ssr_grid_definition_dep_a.header.region_size_inverse); + + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.header.seq_num == 52, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.header.seq_num, " + "expected 52, is %d", + last_msg.msg.ssr_grid_definition_dep_a.header.seq_num); + + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.n_rle_list == 246, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.n_rle_list, expected " + "246, is %d", + last_msg.msg.ssr_grid_definition_dep_a.n_rle_list); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[0] == 92, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[0], " + "expected 92, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[0]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[1] == 104, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[1], " + "expected 104, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[1]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[2] == 25, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[2], " + "expected 25, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[2]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[3] == 204, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[3], " + "expected 204, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[3]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[4] == 182, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[4], " + "expected 182, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[4]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[5] == 22, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[5], " + "expected 22, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[5]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[6] == 98, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[6], " + "expected 98, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[6]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[7] == 203, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[7], " + "expected 203, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[7]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[8] == 123, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[8], " + "expected 123, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[8]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[9] == 211, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[9], " + "expected 211, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[9]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[10] == 38, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[10], " + "expected 38, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[10]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[11] == 13, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[11], " + "expected 13, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[11]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[12] == 253, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[12], " + "expected 253, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[12]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[13] == 129, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[13], " + "expected 129, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[13]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[14] == 173, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[14], " + "expected 173, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[14]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[15] == 171, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[15], " + "expected 171, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[15]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[16] == 235, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[16], " + "expected 235, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[16]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[17] == 253, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[17], " + "expected 253, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[17]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[18] == 26, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[18], " + "expected 26, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[18]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[19] == 203, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[19], " + "expected 203, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[19]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[20] == 3, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[20], " + "expected 3, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[20]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[21] == 120, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[21], " + "expected 120, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[21]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[22] == 126, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[22], " + "expected 126, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[22]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[23] == 42, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[23], " + "expected 42, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[23]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[24] == 44, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[24], " + "expected 44, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[24]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[25] == 39, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[25], " + "expected 39, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[25]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[26] == 87, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[26], " + "expected 87, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[26]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[27] == 69, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[27], " + "expected 69, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[27]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[28] == 154, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[28], " + "expected 154, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[28]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[29] == 13, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[29], " + "expected 13, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[29]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[30] == 28, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[30], " + "expected 28, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[30]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[31] == 179, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[31], " + "expected 179, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[31]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[32] == 32, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[32], " + "expected 32, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[32]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[33] == 47, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[33], " + "expected 47, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[33]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[34] == 36, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[34], " + "expected 36, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[34]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[35] == 195, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[35], " + "expected 195, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[35]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[36] == 39, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[36], " + "expected 39, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[36]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[37] == 198, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[37], " + "expected 198, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[37]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[38] == 134, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[38], " + "expected 134, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[38]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[39] == 235, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[39], " + "expected 235, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[39]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[40] == 134, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[40], " + "expected 134, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[40]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[41] == 57, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[41], " + "expected 57, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[41]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[42] == 120, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[42], " + "expected 120, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[42]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[43] == 243, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[43], " + "expected 243, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[43]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[44] == 151, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[44], " + "expected 151, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[44]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[45] == 35, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[45], " + "expected 35, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[45]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[46] == 17, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[46], " + "expected 17, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[46]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[47] == 201, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[47], " + "expected 201, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[47]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[48] == 211, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[48], " + "expected 211, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[48]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[49] == 125, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[49], " + "expected 125, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[49]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[50] == 117, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[50], " + "expected 117, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[50]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[51] == 164, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[51], " + "expected 164, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[51]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[52] == 142, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[52], " + "expected 142, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[52]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[53] == 101, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[53], " + "expected 101, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[53]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[54] == 239, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[54], " + "expected 239, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[54]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[55] == 144, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[55], " + "expected 144, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[55]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[56] == 158, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[56], " + "expected 158, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[56]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[57] == 239, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[57], " + "expected 239, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[57]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[58] == 90, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[58], " + "expected 90, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[58]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[59] == 56, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[59], " + "expected 56, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[59]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[60] == 71, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[60], " + "expected 71, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[60]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[61] == 120, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[61], " + "expected 120, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[61]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[62] == 67, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[62], " + "expected 67, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[62]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[63] == 221, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[63], " + "expected 221, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[63]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[64] == 114, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[64], " + "expected 114, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[64]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[65] == 10, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[65], " + "expected 10, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[65]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[66] == 190, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[66], " + "expected 190, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[66]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[67] == 4, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[67], " + "expected 4, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[67]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[68] == 230, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[68], " + "expected 230, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[68]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[69] == 164, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[69], " + "expected 164, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[69]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[70] == 171, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[70], " + "expected 171, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[70]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[71] == 78, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[71], " + "expected 78, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[71]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[72] == 185, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[72], " + "expected 185, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[72]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[73] == 90, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[73], " + "expected 90, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[73]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[74] == 46, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[74], " + "expected 46, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[74]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[75] == 177, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[75], " + "expected 177, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[75]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[76] == 82, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[76], " + "expected 82, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[76]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[77] == 228, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[77], " + "expected 228, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[77]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[78] == 123, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[78], " + "expected 123, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[78]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[79] == 222, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[79], " + "expected 222, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[79]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[80] == 227, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[80], " + "expected 227, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[80]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[81] == 145, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[81], " + "expected 145, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[81]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[82] == 195, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[82], " + "expected 195, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[82]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[83] == 219, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[83], " + "expected 219, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[83]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[84] == 27, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[84], " + "expected 27, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[84]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[85] == 56, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[85], " + "expected 56, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[85]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[86] == 227, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[86], " + "expected 227, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[86]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[87] == 246, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[87], " + "expected 246, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[87]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[88] == 215, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[88], " + "expected 215, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[88]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[89] == 144, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[89], " + "expected 144, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[89]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[90] == 158, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[90], " + "expected 158, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[90]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[91] == 31, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[91], " + "expected 31, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[91]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[92] == 214, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[92], " + "expected 214, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[92]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[93] == 241, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[93], " + "expected 241, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[93]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[94] == 254, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[94], " + "expected 254, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[94]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[95] == 200, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[95], " + "expected 200, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[95]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[96] == 86, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[96], " + "expected 86, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[96]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[97] == 142, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[97], " + "expected 142, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[97]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[98] == 89, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[98], " + "expected 89, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[98]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[99] == 12, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[99], " + "expected 12, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[99]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[100] == 121, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[100], " + "expected 121, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[100]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[101] == 29, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[101], " + "expected 29, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[101]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[102] == 124, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[102], " + "expected 124, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[102]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[103] == 9, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[103], " + "expected 9, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[103]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[104] == 19, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[104], " + "expected 19, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[104]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[105] == 153, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[105], " + "expected 153, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[105]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[106] == 44, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[106], " + "expected 44, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[106]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[107] == 35, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[107], " + "expected 35, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[107]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[108] == 126, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[108], " + "expected 126, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[108]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[109] == 14, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[109], " + "expected 14, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[109]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[110] == 217, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[110], " + "expected 217, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[110]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[111] == 65, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[111], " + "expected 65, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[111]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[112] == 116, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[112], " + "expected 116, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[112]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[113] == 26, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[113], " + "expected 26, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[113]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[114] == 139, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[114], " + "expected 139, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[114]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[115] == 122, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[115], " + "expected 122, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[115]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[116] == 114, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[116], " + "expected 114, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[116]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[117] == 90, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[117], " + "expected 90, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[117]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[118] == 124, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[118], " + "expected 124, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[118]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[119] == 81, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[119], " + "expected 81, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[119]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[120] == 0, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[120], " + "expected 0, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[120]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[121] == 186, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[121], " + "expected 186, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[121]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[122] == 246, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[122], " + "expected 246, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[122]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[123] == 46, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[123], " + "expected 46, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[123]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[124] == 98, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[124], " + "expected 98, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[124]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[125] == 179, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[125], " + "expected 179, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[125]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[126] == 243, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[126], " + "expected 243, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[126]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[127] == 198, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[127], " + "expected 198, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[127]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[128] == 217, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[128], " + "expected 217, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[128]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[129] == 36, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[129], " + "expected 36, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[129]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[130] == 30, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[130], " + "expected 30, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[130]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[131] == 202, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[131], " + "expected 202, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[131]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[132] == 12, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[132], " + "expected 12, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[132]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[133] == 135, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[133], " + "expected 135, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[133]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[134] == 61, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[134], " + "expected 61, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[134]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[135] == 42, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[135], " + "expected 42, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[135]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[136] == 150, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[136], " + "expected 150, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[136]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[137] == 221, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[137], " + "expected 221, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[137]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[138] == 102, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[138], " + "expected 102, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[138]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[139] == 83, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[139], " + "expected 83, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[139]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[140] == 179, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[140], " + "expected 179, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[140]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[141] == 43, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[141], " + "expected 43, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[141]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[142] == 252, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[142], " + "expected 252, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[142]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[143] == 81, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[143], " + "expected 81, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[143]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[144] == 62, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[144], " + "expected 62, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[144]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[145] == 126, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[145], " + "expected 126, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[145]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[146] == 204, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[146], " + "expected 204, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[146]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[147] == 195, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[147], " + "expected 195, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[147]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[148] == 238, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[148], " + "expected 238, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[148]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[149] == 18, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[149], " + "expected 18, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[149]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[150] == 128, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[150], " + "expected 128, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[150]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[151] == 193, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[151], " + "expected 193, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[151]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[152] == 53, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[152], " + "expected 53, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[152]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[153] == 94, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[153], " + "expected 94, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[153]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[154] == 99, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[154], " + "expected 99, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[154]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[155] == 63, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[155], " + "expected 63, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[155]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[156] == 182, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[156], " + "expected 182, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[156]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[157] == 2, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[157], " + "expected 2, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[157]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[158] == 186, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[158], " + "expected 186, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[158]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[159] == 220, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[159], " + "expected 220, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[159]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[160] == 77, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[160], " + "expected 77, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[160]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[161] == 186, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[161], " + "expected 186, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[161]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[162] == 224, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[162], " + "expected 224, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[162]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[163] == 220, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[163], " + "expected 220, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[163]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[164] == 13, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[164], " + "expected 13, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[164]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[165] == 212, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[165], " + "expected 212, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[165]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[166] == 182, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[166], " + "expected 182, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[166]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[167] == 88, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[167], " + "expected 88, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[167]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[168] == 15, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[168], " + "expected 15, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[168]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[169] == 151, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[169], " + "expected 151, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[169]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[170] == 5, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[170], " + "expected 5, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[170]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[171] == 93, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[171], " + "expected 93, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[171]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[172] == 251, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[172], " + "expected 251, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[172]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[173] == 164, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[173], " + "expected 164, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[173]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[174] == 18, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[174], " + "expected 18, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[174]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[175] == 228, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[175], " + "expected 228, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[175]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[176] == 168, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[176], " + "expected 168, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[176]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[177] == 226, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[177], " + "expected 226, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[177]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[178] == 195, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[178], " + "expected 195, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[178]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[179] == 44, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[179], " + "expected 44, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[179]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[180] == 170, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[180], " + "expected 170, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[180]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[181] == 145, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[181], " + "expected 145, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[181]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[182] == 36, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[182], " + "expected 36, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[182]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[183] == 58, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[183], " + "expected 58, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[183]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[184] == 96, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[184], " + "expected 96, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[184]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[185] == 107, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[185], " + "expected 107, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[185]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[186] == 144, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[186], " + "expected 144, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[186]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[187] == 11, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[187], " + "expected 11, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[187]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[188] == 228, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[188], " + "expected 228, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[188]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[189] == 12, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[189], " + "expected 12, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[189]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[190] == 163, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[190], " + "expected 163, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[190]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[191] == 238, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[191], " + "expected 238, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[191]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[192] == 247, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[192], " + "expected 247, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[192]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[193] == 159, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[193], " + "expected 159, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[193]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[194] == 189, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[194], " + "expected 189, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[194]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[195] == 1, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[195], " + "expected 1, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[195]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[196] == 115, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[196], " + "expected 115, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[196]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[197] == 65, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[197], " + "expected 65, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[197]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[198] == 202, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[198], " + "expected 202, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[198]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[199] == 121, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[199], " + "expected 121, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[199]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[200] == 47, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[200], " + "expected 47, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[200]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[201] == 193, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[201], " + "expected 193, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[201]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[202] == 11, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[202], " + "expected 11, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[202]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[203] == 96, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[203], " + "expected 96, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[203]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[204] == 93, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[204], " + "expected 93, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[204]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[205] == 72, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[205], " + "expected 72, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[205]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[206] == 81, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[206], " + "expected 81, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[206]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[207] == 207, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[207], " + "expected 207, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[207]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[208] == 121, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[208], " + "expected 121, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[208]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[209] == 19, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[209], " + "expected 19, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[209]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[210] == 151, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[210], " + "expected 151, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[210]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[211] == 136, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[211], " + "expected 136, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[211]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[212] == 233, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[212], " + "expected 233, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[212]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[213] == 51, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[213], " + "expected 51, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[213]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[214] == 133, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[214], " + "expected 133, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[214]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[215] == 195, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[215], " + "expected 195, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[215]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[216] == 77, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[216], " + "expected 77, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[216]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[217] == 44, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[217], " + "expected 44, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[217]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[218] == 147, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[218], " + "expected 147, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[218]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[219] == 206, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[219], " + "expected 206, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[219]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[220] == 120, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[220], " + "expected 120, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[220]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[221] == 252, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[221], " + "expected 252, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[221]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[222] == 77, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[222], " + "expected 77, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[222]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[223] == 212, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[223], " + "expected 212, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[223]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[224] == 68, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[224], " + "expected 68, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[224]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[225] == 60, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[225], " + "expected 60, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[225]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[226] == 206, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[226], " + "expected 206, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[226]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[227] == 106, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[227], " + "expected 106, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[227]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[228] == 207, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[228], " + "expected 207, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[228]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[229] == 243, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[229], " + "expected 243, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[229]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[230] == 158, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[230], " + "expected 158, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[230]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[231] == 94, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[231], " + "expected 94, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[231]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[232] == 6, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[232], " + "expected 6, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[232]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[233] == 3, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[233], " + "expected 3, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[233]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[234] == 205, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[234], " + "expected 205, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[234]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[235] == 92, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[235], " + "expected 92, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[235]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[236] == 84, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[236], " + "expected 84, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[236]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[237] == 2, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[237], " + "expected 2, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[237]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[238] == 220, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[238], " + "expected 220, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[238]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[239] == 50, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[239], " + "expected 50, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[239]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[240] == 61, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[240], " + "expected 61, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[240]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[241] == 38, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[241], " + "expected 38, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[241]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[242] == 141, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[242], " + "expected 141, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[242]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[243] == 117, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[243], " + "expected 117, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[243]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[244] == 108, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[244], " + "expected 108, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[244]); + ck_assert_msg(last_msg.msg.ssr_grid_definition_dep_a.rle_list[245] == 101, + "incorrect value for " + "last_msg.msg.ssr_grid_definition_dep_a.rle_list[245], " + "expected 101, is %d", + last_msg.msg.ssr_grid_definition_dep_a.rle_list[245]); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrGridDefinitionDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrGridDefinitionDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA"); +Suite *auto_check_sbp_ssr_MsgSsrGridDefinitionDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ssr_MsgSsrGridDefinitionDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrection.c b/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrection.c index 69ecb93cc..a9e389bde 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrection.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrection.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrection.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrection.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrGriddedCorrection ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrGriddedCorrection) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrGriddedCorrection ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,981 +90,1987 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrGriddedCorrection ) logging_reset(); - sbp_callback_register(&sbp_state, 0x5fc, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x5fc, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,252,5,196,249,253,21,14,151,50,120,133,29,151,174,229,151,189,204,196,105,170,120,149,169,37,244,78,72,140,101,2,173,88,70,180,54,152,115,78,201,161,23,135,152,98,61,75,178,120,229,146,55,58,169,234,230,69,172,191,127,146,89,150,91,111,225,41,17,119,52,166,166,120,57,221,12,3,156,70,156,35,127,8,127,58,128,55,115,80,157,122,153,124,27,128,98,103,204,75,238,128,226,148,248,61,216,208,149,167,224,40,144,186,157,227,72,240,100,35,12,212,7,59,176,81,86,27,24,155,67,43,132,45,203,44,6,112,183,231,176,79,194,253,247,103,91,226,116,148,23,62,227,240,29,219,205,18,242,207,72,71,79,37,42,176,201,202,91,105,115,146,59,110,44,109,128,183,185,67,31,165,92,79,189,180,94,7,162,121,156,210,47,7,7,205,174,41,241,129,210,43,101,186,208,195,226,247,187,219,160,120,192,102,166,42,246,173,94,102,156,222,30,35,247,64,189,137,204,220,32,71,222,222,201,246,3,25,45,251,239,115,88,218,10,209,120,65,175,131,194,41,174,137,17,68,28,253,42,178,35, }; + u8 encoded_frame[] = { + 85, 252, 5, 196, 249, 253, 21, 14, 151, 50, 120, 133, 29, 151, + 174, 229, 151, 189, 204, 196, 105, 170, 120, 149, 169, 37, 244, 78, + 72, 140, 101, 2, 173, 88, 70, 180, 54, 152, 115, 78, 201, 161, + 23, 135, 152, 98, 61, 75, 178, 120, 229, 146, 55, 58, 169, 234, + 230, 69, 172, 191, 127, 146, 89, 150, 91, 111, 225, 41, 17, 119, + 52, 166, 166, 120, 57, 221, 12, 3, 156, 70, 156, 35, 127, 8, + 127, 58, 128, 55, 115, 80, 157, 122, 153, 124, 27, 128, 98, 103, + 204, 75, 238, 128, 226, 148, 248, 61, 216, 208, 149, 167, 224, 40, + 144, 186, 157, 227, 72, 240, 100, 35, 12, 212, 7, 59, 176, 81, + 86, 27, 24, 155, 67, 43, 132, 45, 203, 44, 6, 112, 183, 231, + 176, 79, 194, 253, 247, 103, 91, 226, 116, 148, 23, 62, 227, 240, + 29, 219, 205, 18, 242, 207, 72, 71, 79, 37, 42, 176, 201, 202, + 91, 105, 115, 146, 59, 110, 44, 109, 128, 183, 185, 67, 31, 165, + 92, 79, 189, 180, 94, 7, 162, 121, 156, 210, 47, 7, 7, 205, + 174, 41, 241, 129, 210, 43, 101, 186, 208, 195, 226, 247, 187, 219, + 160, 120, 192, 102, 166, 42, 246, 173, 94, 102, 156, 222, 30, 35, + 247, 64, 189, 137, 204, 220, 32, 71, 222, 222, 201, 246, 3, 25, + 45, 251, 239, 115, 88, 218, 10, 209, 120, 65, 175, 131, 194, 41, + 174, 137, 17, 68, 28, 253, 42, 178, 35, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ssr_gridded_correction.header.iod_atmo = 170; - + test_msg.ssr_gridded_correction.header.num_msgs = 48535; - + test_msg.ssr_gridded_correction.header.seq_num = 50380; - + test_msg.ssr_gridded_correction.header.tile_id = 12951; - + test_msg.ssr_gridded_correction.header.tile_set_id = 3605; - - + test_msg.ssr_gridded_correction.header.time.tow = 2535294328; - + test_msg.ssr_gridded_correction.header.time.wn = 58798; - + test_msg.ssr_gridded_correction.header.tropo_quality_indicator = 120; - + test_msg.ssr_gridded_correction.header.update_interval = 105; - + test_msg.ssr_gridded_correction.index = 43413; - + test_msg.ssr_gridded_correction.n_stec_residuals = 46; - - - + test_msg.ssr_gridded_correction.stec_residuals[0].residual = -21246; - + test_msg.ssr_gridded_correction.stec_residuals[0].stddev = 88; - - + test_msg.ssr_gridded_correction.stec_residuals[0].sv_id.constellation = 101; - + test_msg.ssr_gridded_correction.stec_residuals[0].sv_id.satId = 140; - - + test_msg.ssr_gridded_correction.stec_residuals[1].residual = -26570; - + test_msg.ssr_gridded_correction.stec_residuals[1].stddev = 115; - - + test_msg.ssr_gridded_correction.stec_residuals[1].sv_id.constellation = 180; - + test_msg.ssr_gridded_correction.stec_residuals[1].sv_id.satId = 70; - - + test_msg.ssr_gridded_correction.stec_residuals[2].residual = 6049; - + test_msg.ssr_gridded_correction.stec_residuals[2].stddev = 135; - - + test_msg.ssr_gridded_correction.stec_residuals[2].sv_id.constellation = 201; - + test_msg.ssr_gridded_correction.stec_residuals[2].sv_id.satId = 78; - - + test_msg.ssr_gridded_correction.stec_residuals[3].residual = 19261; - + test_msg.ssr_gridded_correction.stec_residuals[3].stddev = 178; - - + test_msg.ssr_gridded_correction.stec_residuals[3].sv_id.constellation = 98; - + test_msg.ssr_gridded_correction.stec_residuals[3].sv_id.satId = 152; - - + test_msg.ssr_gridded_correction.stec_residuals[4].residual = 14226; - + test_msg.ssr_gridded_correction.stec_residuals[4].stddev = 58; - - + test_msg.ssr_gridded_correction.stec_residuals[4].sv_id.constellation = 229; - + test_msg.ssr_gridded_correction.stec_residuals[4].sv_id.satId = 120; - - + test_msg.ssr_gridded_correction.stec_residuals[5].residual = 17894; - + test_msg.ssr_gridded_correction.stec_residuals[5].stddev = 172; - - + test_msg.ssr_gridded_correction.stec_residuals[5].sv_id.constellation = 234; - + test_msg.ssr_gridded_correction.stec_residuals[5].sv_id.satId = 169; - - + test_msg.ssr_gridded_correction.stec_residuals[6].residual = 22930; - + test_msg.ssr_gridded_correction.stec_residuals[6].stddev = 150; - - + test_msg.ssr_gridded_correction.stec_residuals[6].sv_id.constellation = 127; - + test_msg.ssr_gridded_correction.stec_residuals[6].sv_id.satId = 191; - - + test_msg.ssr_gridded_correction.stec_residuals[7].residual = 10721; - + test_msg.ssr_gridded_correction.stec_residuals[7].stddev = 17; - - + test_msg.ssr_gridded_correction.stec_residuals[7].sv_id.constellation = 111; - + test_msg.ssr_gridded_correction.stec_residuals[7].sv_id.satId = 91; - - + test_msg.ssr_gridded_correction.stec_residuals[8].residual = -22874; - + test_msg.ssr_gridded_correction.stec_residuals[8].stddev = 120; - - + test_msg.ssr_gridded_correction.stec_residuals[8].sv_id.constellation = 52; - + test_msg.ssr_gridded_correction.stec_residuals[8].sv_id.satId = 119; - - + test_msg.ssr_gridded_correction.stec_residuals[9].residual = 780; - + test_msg.ssr_gridded_correction.stec_residuals[9].stddev = 156; - - + test_msg.ssr_gridded_correction.stec_residuals[9].sv_id.constellation = 221; - + test_msg.ssr_gridded_correction.stec_residuals[9].sv_id.satId = 57; - - + test_msg.ssr_gridded_correction.stec_residuals[10].residual = 32547; - + test_msg.ssr_gridded_correction.stec_residuals[10].stddev = 8; - - - test_msg.ssr_gridded_correction.stec_residuals[10].sv_id.constellation = 156; - + + test_msg.ssr_gridded_correction.stec_residuals[10].sv_id.constellation = + 156; + test_msg.ssr_gridded_correction.stec_residuals[10].sv_id.satId = 70; - - + test_msg.ssr_gridded_correction.stec_residuals[11].residual = 14208; - + test_msg.ssr_gridded_correction.stec_residuals[11].stddev = 115; - - + test_msg.ssr_gridded_correction.stec_residuals[11].sv_id.constellation = 58; - + test_msg.ssr_gridded_correction.stec_residuals[11].sv_id.satId = 127; - - + test_msg.ssr_gridded_correction.stec_residuals[12].residual = -26246; - + test_msg.ssr_gridded_correction.stec_residuals[12].stddev = 124; - - - test_msg.ssr_gridded_correction.stec_residuals[12].sv_id.constellation = 157; - + + test_msg.ssr_gridded_correction.stec_residuals[12].sv_id.constellation = + 157; + test_msg.ssr_gridded_correction.stec_residuals[12].sv_id.satId = 80; - - + test_msg.ssr_gridded_correction.stec_residuals[13].residual = 26466; - + test_msg.ssr_gridded_correction.stec_residuals[13].stddev = 204; - - - test_msg.ssr_gridded_correction.stec_residuals[13].sv_id.constellation = 128; - + + test_msg.ssr_gridded_correction.stec_residuals[13].sv_id.constellation = + 128; + test_msg.ssr_gridded_correction.stec_residuals[13].sv_id.satId = 27; - - + test_msg.ssr_gridded_correction.stec_residuals[14].residual = -7552; - + test_msg.ssr_gridded_correction.stec_residuals[14].stddev = 148; - - - test_msg.ssr_gridded_correction.stec_residuals[14].sv_id.constellation = 238; - + + test_msg.ssr_gridded_correction.stec_residuals[14].sv_id.constellation = + 238; + test_msg.ssr_gridded_correction.stec_residuals[14].sv_id.satId = 75; - - + test_msg.ssr_gridded_correction.stec_residuals[15].residual = -12072; - + test_msg.ssr_gridded_correction.stec_residuals[15].stddev = 149; - - + test_msg.ssr_gridded_correction.stec_residuals[15].sv_id.constellation = 61; - + test_msg.ssr_gridded_correction.stec_residuals[15].sv_id.satId = 248; - - + test_msg.ssr_gridded_correction.stec_residuals[16].residual = -28632; - + test_msg.ssr_gridded_correction.stec_residuals[16].stddev = 186; - - - test_msg.ssr_gridded_correction.stec_residuals[16].sv_id.constellation = 224; - + + test_msg.ssr_gridded_correction.stec_residuals[16].sv_id.constellation = + 224; + test_msg.ssr_gridded_correction.stec_residuals[16].sv_id.satId = 167; - - + test_msg.ssr_gridded_correction.stec_residuals[17].residual = -4024; - + test_msg.ssr_gridded_correction.stec_residuals[17].stddev = 100; - - - test_msg.ssr_gridded_correction.stec_residuals[17].sv_id.constellation = 227; - + + test_msg.ssr_gridded_correction.stec_residuals[17].sv_id.constellation = + 227; + test_msg.ssr_gridded_correction.stec_residuals[17].sv_id.satId = 157; - - + test_msg.ssr_gridded_correction.stec_residuals[18].residual = 2004; - + test_msg.ssr_gridded_correction.stec_residuals[18].stddev = 59; - - + test_msg.ssr_gridded_correction.stec_residuals[18].sv_id.constellation = 12; - + test_msg.ssr_gridded_correction.stec_residuals[18].sv_id.satId = 35; - - + test_msg.ssr_gridded_correction.stec_residuals[19].residual = 6998; - + test_msg.ssr_gridded_correction.stec_residuals[19].stddev = 24; - - + test_msg.ssr_gridded_correction.stec_residuals[19].sv_id.constellation = 81; - + test_msg.ssr_gridded_correction.stec_residuals[19].sv_id.satId = 176; - - + test_msg.ssr_gridded_correction.stec_residuals[20].residual = -31701; - + test_msg.ssr_gridded_correction.stec_residuals[20].stddev = 45; - - + test_msg.ssr_gridded_correction.stec_residuals[20].sv_id.constellation = 67; - + test_msg.ssr_gridded_correction.stec_residuals[20].sv_id.satId = 155; - - + test_msg.ssr_gridded_correction.stec_residuals[21].residual = 28678; - + test_msg.ssr_gridded_correction.stec_residuals[21].stddev = 183; - - + test_msg.ssr_gridded_correction.stec_residuals[21].sv_id.constellation = 44; - + test_msg.ssr_gridded_correction.stec_residuals[21].sv_id.satId = 203; - - + test_msg.ssr_gridded_correction.stec_residuals[22].residual = -15793; - + test_msg.ssr_gridded_correction.stec_residuals[22].stddev = 253; - - - test_msg.ssr_gridded_correction.stec_residuals[22].sv_id.constellation = 176; - + + test_msg.ssr_gridded_correction.stec_residuals[22].sv_id.constellation = + 176; + test_msg.ssr_gridded_correction.stec_residuals[22].sv_id.satId = 231; - - + test_msg.ssr_gridded_correction.stec_residuals[23].residual = -7589; - + test_msg.ssr_gridded_correction.stec_residuals[23].stddev = 116; - - - test_msg.ssr_gridded_correction.stec_residuals[23].sv_id.constellation = 103; - + + test_msg.ssr_gridded_correction.stec_residuals[23].sv_id.constellation = + 103; + test_msg.ssr_gridded_correction.stec_residuals[23].sv_id.satId = 247; - - + test_msg.ssr_gridded_correction.stec_residuals[24].residual = -7362; - + test_msg.ssr_gridded_correction.stec_residuals[24].stddev = 240; - - + test_msg.ssr_gridded_correction.stec_residuals[24].sv_id.constellation = 23; - + test_msg.ssr_gridded_correction.stec_residuals[24].sv_id.satId = 148; - - + test_msg.ssr_gridded_correction.stec_residuals[25].residual = 4813; - + test_msg.ssr_gridded_correction.stec_residuals[25].stddev = 242; - - - test_msg.ssr_gridded_correction.stec_residuals[25].sv_id.constellation = 219; - + + test_msg.ssr_gridded_correction.stec_residuals[25].sv_id.constellation = + 219; + test_msg.ssr_gridded_correction.stec_residuals[25].sv_id.satId = 29; - - + test_msg.ssr_gridded_correction.stec_residuals[26].residual = 20295; - + test_msg.ssr_gridded_correction.stec_residuals[26].stddev = 37; - - + test_msg.ssr_gridded_correction.stec_residuals[26].sv_id.constellation = 72; - + test_msg.ssr_gridded_correction.stec_residuals[26].sv_id.satId = 207; - - + test_msg.ssr_gridded_correction.stec_residuals[27].residual = -13623; - + test_msg.ssr_gridded_correction.stec_residuals[27].stddev = 91; - - - test_msg.ssr_gridded_correction.stec_residuals[27].sv_id.constellation = 176; - + + test_msg.ssr_gridded_correction.stec_residuals[27].sv_id.constellation = + 176; + test_msg.ssr_gridded_correction.stec_residuals[27].sv_id.satId = 42; - - + test_msg.ssr_gridded_correction.stec_residuals[28].residual = 15250; - + test_msg.ssr_gridded_correction.stec_residuals[28].stddev = 110; - - - test_msg.ssr_gridded_correction.stec_residuals[28].sv_id.constellation = 115; - + + test_msg.ssr_gridded_correction.stec_residuals[28].sv_id.constellation = + 115; + test_msg.ssr_gridded_correction.stec_residuals[28].sv_id.satId = 105; - - + test_msg.ssr_gridded_correction.stec_residuals[29].residual = -18560; - + test_msg.ssr_gridded_correction.stec_residuals[29].stddev = 185; - - - test_msg.ssr_gridded_correction.stec_residuals[29].sv_id.constellation = 109; - + + test_msg.ssr_gridded_correction.stec_residuals[29].sv_id.constellation = + 109; + test_msg.ssr_gridded_correction.stec_residuals[29].sv_id.satId = 44; - - + test_msg.ssr_gridded_correction.stec_residuals[30].residual = 23717; - + test_msg.ssr_gridded_correction.stec_residuals[30].stddev = 79; - - + test_msg.ssr_gridded_correction.stec_residuals[30].sv_id.constellation = 31; - + test_msg.ssr_gridded_correction.stec_residuals[30].sv_id.satId = 67; - - + test_msg.ssr_gridded_correction.stec_residuals[31].residual = 1886; - + test_msg.ssr_gridded_correction.stec_residuals[31].stddev = 162; - - - test_msg.ssr_gridded_correction.stec_residuals[31].sv_id.constellation = 180; - + + test_msg.ssr_gridded_correction.stec_residuals[31].sv_id.constellation = + 180; + test_msg.ssr_gridded_correction.stec_residuals[31].sv_id.satId = 189; - - + test_msg.ssr_gridded_correction.stec_residuals[32].residual = 12242; - + test_msg.ssr_gridded_correction.stec_residuals[32].stddev = 7; - - - test_msg.ssr_gridded_correction.stec_residuals[32].sv_id.constellation = 156; - + + test_msg.ssr_gridded_correction.stec_residuals[32].sv_id.constellation = + 156; + test_msg.ssr_gridded_correction.stec_residuals[32].sv_id.satId = 121; - - + test_msg.ssr_gridded_correction.stec_residuals[33].residual = 10670; - + test_msg.ssr_gridded_correction.stec_residuals[33].stddev = 241; - - - test_msg.ssr_gridded_correction.stec_residuals[33].sv_id.constellation = 205; - + + test_msg.ssr_gridded_correction.stec_residuals[33].sv_id.constellation = + 205; + test_msg.ssr_gridded_correction.stec_residuals[33].sv_id.satId = 7; - - + test_msg.ssr_gridded_correction.stec_residuals[34].residual = 25899; - + test_msg.ssr_gridded_correction.stec_residuals[34].stddev = 186; - - - test_msg.ssr_gridded_correction.stec_residuals[34].sv_id.constellation = 210; - + + test_msg.ssr_gridded_correction.stec_residuals[34].sv_id.constellation = + 210; + test_msg.ssr_gridded_correction.stec_residuals[34].sv_id.satId = 129; - - + test_msg.ssr_gridded_correction.stec_residuals[35].residual = -2078; - + test_msg.ssr_gridded_correction.stec_residuals[35].stddev = 187; - - - test_msg.ssr_gridded_correction.stec_residuals[35].sv_id.constellation = 195; - + + test_msg.ssr_gridded_correction.stec_residuals[35].sv_id.constellation = + 195; + test_msg.ssr_gridded_correction.stec_residuals[35].sv_id.satId = 208; - - + test_msg.ssr_gridded_correction.stec_residuals[36].residual = -16264; - + test_msg.ssr_gridded_correction.stec_residuals[36].stddev = 102; - - - test_msg.ssr_gridded_correction.stec_residuals[36].sv_id.constellation = 160; - + + test_msg.ssr_gridded_correction.stec_residuals[36].sv_id.constellation = + 160; + test_msg.ssr_gridded_correction.stec_residuals[36].sv_id.satId = 219; - - + test_msg.ssr_gridded_correction.stec_residuals[37].residual = -21002; - + test_msg.ssr_gridded_correction.stec_residuals[37].stddev = 94; - - + test_msg.ssr_gridded_correction.stec_residuals[37].sv_id.constellation = 42; - + test_msg.ssr_gridded_correction.stec_residuals[37].sv_id.satId = 166; - - + test_msg.ssr_gridded_correction.stec_residuals[38].residual = 7902; - + test_msg.ssr_gridded_correction.stec_residuals[38].stddev = 35; - - - test_msg.ssr_gridded_correction.stec_residuals[38].sv_id.constellation = 156; - + + test_msg.ssr_gridded_correction.stec_residuals[38].sv_id.constellation = + 156; + test_msg.ssr_gridded_correction.stec_residuals[38].sv_id.satId = 102; - - + test_msg.ssr_gridded_correction.stec_residuals[39].residual = -30275; - + test_msg.ssr_gridded_correction.stec_residuals[39].stddev = 204; - - + test_msg.ssr_gridded_correction.stec_residuals[39].sv_id.constellation = 64; - + test_msg.ssr_gridded_correction.stec_residuals[39].sv_id.satId = 247; - - + test_msg.ssr_gridded_correction.stec_residuals[40].residual = -8633; - + test_msg.ssr_gridded_correction.stec_residuals[40].stddev = 222; - - + test_msg.ssr_gridded_correction.stec_residuals[40].sv_id.constellation = 32; - + test_msg.ssr_gridded_correction.stec_residuals[40].sv_id.satId = 220; - - + test_msg.ssr_gridded_correction.stec_residuals[41].residual = 6403; - + test_msg.ssr_gridded_correction.stec_residuals[41].stddev = 45; - - - test_msg.ssr_gridded_correction.stec_residuals[41].sv_id.constellation = 246; - + + test_msg.ssr_gridded_correction.stec_residuals[41].sv_id.constellation = + 246; + test_msg.ssr_gridded_correction.stec_residuals[41].sv_id.satId = 201; - - + test_msg.ssr_gridded_correction.stec_residuals[42].residual = 22643; - + test_msg.ssr_gridded_correction.stec_residuals[42].stddev = 218; - - - test_msg.ssr_gridded_correction.stec_residuals[42].sv_id.constellation = 239; - + + test_msg.ssr_gridded_correction.stec_residuals[42].sv_id.constellation = + 239; + test_msg.ssr_gridded_correction.stec_residuals[42].sv_id.satId = 251; - - + test_msg.ssr_gridded_correction.stec_residuals[43].residual = 16760; - + test_msg.ssr_gridded_correction.stec_residuals[43].stddev = 175; - - - test_msg.ssr_gridded_correction.stec_residuals[43].sv_id.constellation = 209; - + + test_msg.ssr_gridded_correction.stec_residuals[43].sv_id.constellation = + 209; + test_msg.ssr_gridded_correction.stec_residuals[43].sv_id.satId = 10; - - + test_msg.ssr_gridded_correction.stec_residuals[44].residual = -20951; - + test_msg.ssr_gridded_correction.stec_residuals[44].stddev = 137; - - - test_msg.ssr_gridded_correction.stec_residuals[44].sv_id.constellation = 194; - + + test_msg.ssr_gridded_correction.stec_residuals[44].sv_id.constellation = + 194; + test_msg.ssr_gridded_correction.stec_residuals[44].sv_id.satId = 131; - - + test_msg.ssr_gridded_correction.stec_residuals[45].residual = -740; - + test_msg.ssr_gridded_correction.stec_residuals[45].stddev = 42; - - + test_msg.ssr_gridded_correction.stec_residuals[45].sv_id.constellation = 68; - + test_msg.ssr_gridded_correction.stec_residuals[45].sv_id.satId = 17; - - + test_msg.ssr_gridded_correction.tropo_delay_correction.hydro = -3035; - + test_msg.ssr_gridded_correction.tropo_delay_correction.stddev = 72; - + test_msg.ssr_gridded_correction.tropo_delay_correction.wet = 78; - sbp_message_send(&sbp_state, SbpMsgSsrGriddedCorrection, 63940, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrGriddedCorrection, 63940, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 63940, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrGriddedCorrection, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.header.iod_atmo == 170, "incorrect value for last_msg.msg.ssr_gridded_correction.header.iod_atmo, expected 170, is %d", last_msg.msg.ssr_gridded_correction.header.iod_atmo); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.header.num_msgs == 48535, "incorrect value for last_msg.msg.ssr_gridded_correction.header.num_msgs, expected 48535, is %d", last_msg.msg.ssr_gridded_correction.header.num_msgs); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.header.seq_num == 50380, "incorrect value for last_msg.msg.ssr_gridded_correction.header.seq_num, expected 50380, is %d", last_msg.msg.ssr_gridded_correction.header.seq_num); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.header.tile_id == 12951, "incorrect value for last_msg.msg.ssr_gridded_correction.header.tile_id, expected 12951, is %d", last_msg.msg.ssr_gridded_correction.header.tile_id); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.header.tile_set_id == 3605, "incorrect value for last_msg.msg.ssr_gridded_correction.header.tile_set_id, expected 3605, is %d", last_msg.msg.ssr_gridded_correction.header.tile_set_id); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.header.time.tow == 2535294328, "incorrect value for last_msg.msg.ssr_gridded_correction.header.time.tow, expected 2535294328, is %d", last_msg.msg.ssr_gridded_correction.header.time.tow); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.header.time.wn == 58798, "incorrect value for last_msg.msg.ssr_gridded_correction.header.time.wn, expected 58798, is %d", last_msg.msg.ssr_gridded_correction.header.time.wn); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.header.tropo_quality_indicator == 120, "incorrect value for last_msg.msg.ssr_gridded_correction.header.tropo_quality_indicator, expected 120, is %d", last_msg.msg.ssr_gridded_correction.header.tropo_quality_indicator); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.header.update_interval == 105, "incorrect value for last_msg.msg.ssr_gridded_correction.header.update_interval, expected 105, is %d", last_msg.msg.ssr_gridded_correction.header.update_interval); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.index == 43413, "incorrect value for last_msg.msg.ssr_gridded_correction.index, expected 43413, is %d", last_msg.msg.ssr_gridded_correction.index); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.n_stec_residuals == 46, "incorrect value for last_msg.msg.ssr_gridded_correction.n_stec_residuals, expected 46, is %d", last_msg.msg.ssr_gridded_correction.n_stec_residuals); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[0].residual == -21246, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[0].residual, expected -21246, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[0].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[0].stddev == 88, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[0].stddev, expected 88, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[0].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[0].sv_id.constellation == 101, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[0].sv_id.constellation, expected 101, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[0].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[0].sv_id.satId == 140, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[0].sv_id.satId, expected 140, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[0].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[1].residual == -26570, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[1].residual, expected -26570, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[1].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[1].stddev == 115, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[1].stddev, expected 115, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[1].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[1].sv_id.constellation == 180, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[1].sv_id.constellation, expected 180, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[1].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[1].sv_id.satId == 70, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[1].sv_id.satId, expected 70, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[1].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[2].residual == 6049, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[2].residual, expected 6049, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[2].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[2].stddev == 135, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[2].stddev, expected 135, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[2].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[2].sv_id.constellation == 201, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[2].sv_id.constellation, expected 201, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[2].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[2].sv_id.satId == 78, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[2].sv_id.satId, expected 78, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[2].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[3].residual == 19261, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[3].residual, expected 19261, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[3].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[3].stddev == 178, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[3].stddev, expected 178, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[3].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[3].sv_id.constellation == 98, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[3].sv_id.constellation, expected 98, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[3].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[3].sv_id.satId == 152, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[3].sv_id.satId, expected 152, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[3].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[4].residual == 14226, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[4].residual, expected 14226, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[4].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[4].stddev == 58, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[4].stddev, expected 58, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[4].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[4].sv_id.constellation == 229, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[4].sv_id.constellation, expected 229, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[4].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[4].sv_id.satId == 120, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[4].sv_id.satId, expected 120, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[4].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[5].residual == 17894, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[5].residual, expected 17894, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[5].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[5].stddev == 172, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[5].stddev, expected 172, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[5].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[5].sv_id.constellation == 234, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[5].sv_id.constellation, expected 234, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[5].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[5].sv_id.satId == 169, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[5].sv_id.satId, expected 169, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[5].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[6].residual == 22930, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[6].residual, expected 22930, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[6].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[6].stddev == 150, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[6].stddev, expected 150, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[6].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[6].sv_id.constellation == 127, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[6].sv_id.constellation, expected 127, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[6].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[6].sv_id.satId == 191, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[6].sv_id.satId, expected 191, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[6].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[7].residual == 10721, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[7].residual, expected 10721, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[7].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[7].stddev == 17, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[7].stddev, expected 17, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[7].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[7].sv_id.constellation == 111, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[7].sv_id.constellation, expected 111, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[7].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[7].sv_id.satId == 91, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[7].sv_id.satId, expected 91, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[7].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[8].residual == -22874, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[8].residual, expected -22874, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[8].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[8].stddev == 120, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[8].stddev, expected 120, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[8].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[8].sv_id.constellation == 52, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[8].sv_id.constellation, expected 52, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[8].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[8].sv_id.satId == 119, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[8].sv_id.satId, expected 119, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[8].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[9].residual == 780, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[9].residual, expected 780, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[9].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[9].stddev == 156, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[9].stddev, expected 156, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[9].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[9].sv_id.constellation == 221, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[9].sv_id.constellation, expected 221, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[9].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[9].sv_id.satId == 57, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[9].sv_id.satId, expected 57, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[9].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[10].residual == 32547, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[10].residual, expected 32547, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[10].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[10].stddev == 8, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[10].stddev, expected 8, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[10].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[10].sv_id.constellation == 156, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[10].sv_id.constellation, expected 156, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[10].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[10].sv_id.satId == 70, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[10].sv_id.satId, expected 70, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[10].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[11].residual == 14208, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[11].residual, expected 14208, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[11].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[11].stddev == 115, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[11].stddev, expected 115, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[11].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[11].sv_id.constellation == 58, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[11].sv_id.constellation, expected 58, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[11].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[11].sv_id.satId == 127, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[11].sv_id.satId, expected 127, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[11].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[12].residual == -26246, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[12].residual, expected -26246, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[12].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[12].stddev == 124, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[12].stddev, expected 124, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[12].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[12].sv_id.constellation == 157, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[12].sv_id.constellation, expected 157, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[12].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[12].sv_id.satId == 80, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[12].sv_id.satId, expected 80, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[12].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[13].residual == 26466, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[13].residual, expected 26466, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[13].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[13].stddev == 204, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[13].stddev, expected 204, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[13].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[13].sv_id.constellation == 128, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[13].sv_id.constellation, expected 128, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[13].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[13].sv_id.satId == 27, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[13].sv_id.satId, expected 27, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[13].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[14].residual == -7552, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[14].residual, expected -7552, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[14].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[14].stddev == 148, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[14].stddev, expected 148, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[14].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[14].sv_id.constellation == 238, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[14].sv_id.constellation, expected 238, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[14].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[14].sv_id.satId == 75, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[14].sv_id.satId, expected 75, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[14].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[15].residual == -12072, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[15].residual, expected -12072, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[15].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[15].stddev == 149, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[15].stddev, expected 149, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[15].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[15].sv_id.constellation == 61, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[15].sv_id.constellation, expected 61, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[15].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[15].sv_id.satId == 248, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[15].sv_id.satId, expected 248, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[15].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[16].residual == -28632, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[16].residual, expected -28632, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[16].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[16].stddev == 186, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[16].stddev, expected 186, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[16].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[16].sv_id.constellation == 224, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[16].sv_id.constellation, expected 224, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[16].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[16].sv_id.satId == 167, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[16].sv_id.satId, expected 167, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[16].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[17].residual == -4024, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[17].residual, expected -4024, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[17].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[17].stddev == 100, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[17].stddev, expected 100, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[17].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[17].sv_id.constellation == 227, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[17].sv_id.constellation, expected 227, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[17].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[17].sv_id.satId == 157, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[17].sv_id.satId, expected 157, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[17].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[18].residual == 2004, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[18].residual, expected 2004, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[18].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[18].stddev == 59, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[18].stddev, expected 59, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[18].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[18].sv_id.constellation == 12, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[18].sv_id.constellation, expected 12, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[18].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[18].sv_id.satId == 35, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[18].sv_id.satId, expected 35, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[18].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[19].residual == 6998, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[19].residual, expected 6998, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[19].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[19].stddev == 24, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[19].stddev, expected 24, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[19].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[19].sv_id.constellation == 81, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[19].sv_id.constellation, expected 81, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[19].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[19].sv_id.satId == 176, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[19].sv_id.satId, expected 176, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[19].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[20].residual == -31701, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[20].residual, expected -31701, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[20].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[20].stddev == 45, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[20].stddev, expected 45, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[20].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[20].sv_id.constellation == 67, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[20].sv_id.constellation, expected 67, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[20].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[20].sv_id.satId == 155, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[20].sv_id.satId, expected 155, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[20].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[21].residual == 28678, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[21].residual, expected 28678, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[21].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[21].stddev == 183, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[21].stddev, expected 183, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[21].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[21].sv_id.constellation == 44, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[21].sv_id.constellation, expected 44, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[21].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[21].sv_id.satId == 203, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[21].sv_id.satId, expected 203, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[21].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[22].residual == -15793, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[22].residual, expected -15793, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[22].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[22].stddev == 253, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[22].stddev, expected 253, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[22].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[22].sv_id.constellation == 176, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[22].sv_id.constellation, expected 176, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[22].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[22].sv_id.satId == 231, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[22].sv_id.satId, expected 231, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[22].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[23].residual == -7589, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[23].residual, expected -7589, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[23].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[23].stddev == 116, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[23].stddev, expected 116, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[23].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[23].sv_id.constellation == 103, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[23].sv_id.constellation, expected 103, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[23].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[23].sv_id.satId == 247, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[23].sv_id.satId, expected 247, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[23].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[24].residual == -7362, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[24].residual, expected -7362, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[24].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[24].stddev == 240, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[24].stddev, expected 240, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[24].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[24].sv_id.constellation == 23, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[24].sv_id.constellation, expected 23, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[24].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[24].sv_id.satId == 148, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[24].sv_id.satId, expected 148, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[24].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[25].residual == 4813, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[25].residual, expected 4813, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[25].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[25].stddev == 242, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[25].stddev, expected 242, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[25].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[25].sv_id.constellation == 219, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[25].sv_id.constellation, expected 219, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[25].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[25].sv_id.satId == 29, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[25].sv_id.satId, expected 29, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[25].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[26].residual == 20295, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[26].residual, expected 20295, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[26].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[26].stddev == 37, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[26].stddev, expected 37, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[26].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[26].sv_id.constellation == 72, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[26].sv_id.constellation, expected 72, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[26].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[26].sv_id.satId == 207, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[26].sv_id.satId, expected 207, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[26].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[27].residual == -13623, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[27].residual, expected -13623, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[27].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[27].stddev == 91, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[27].stddev, expected 91, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[27].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[27].sv_id.constellation == 176, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[27].sv_id.constellation, expected 176, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[27].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[27].sv_id.satId == 42, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[27].sv_id.satId, expected 42, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[27].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[28].residual == 15250, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[28].residual, expected 15250, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[28].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[28].stddev == 110, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[28].stddev, expected 110, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[28].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[28].sv_id.constellation == 115, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[28].sv_id.constellation, expected 115, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[28].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[28].sv_id.satId == 105, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[28].sv_id.satId, expected 105, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[28].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[29].residual == -18560, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[29].residual, expected -18560, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[29].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[29].stddev == 185, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[29].stddev, expected 185, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[29].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[29].sv_id.constellation == 109, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[29].sv_id.constellation, expected 109, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[29].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[29].sv_id.satId == 44, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[29].sv_id.satId, expected 44, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[29].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[30].residual == 23717, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[30].residual, expected 23717, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[30].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[30].stddev == 79, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[30].stddev, expected 79, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[30].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[30].sv_id.constellation == 31, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[30].sv_id.constellation, expected 31, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[30].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[30].sv_id.satId == 67, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[30].sv_id.satId, expected 67, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[30].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[31].residual == 1886, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[31].residual, expected 1886, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[31].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[31].stddev == 162, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[31].stddev, expected 162, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[31].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[31].sv_id.constellation == 180, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[31].sv_id.constellation, expected 180, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[31].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[31].sv_id.satId == 189, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[31].sv_id.satId, expected 189, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[31].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[32].residual == 12242, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[32].residual, expected 12242, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[32].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[32].stddev == 7, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[32].stddev, expected 7, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[32].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[32].sv_id.constellation == 156, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[32].sv_id.constellation, expected 156, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[32].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[32].sv_id.satId == 121, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[32].sv_id.satId, expected 121, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[32].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[33].residual == 10670, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[33].residual, expected 10670, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[33].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[33].stddev == 241, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[33].stddev, expected 241, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[33].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[33].sv_id.constellation == 205, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[33].sv_id.constellation, expected 205, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[33].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[33].sv_id.satId == 7, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[33].sv_id.satId, expected 7, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[33].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[34].residual == 25899, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[34].residual, expected 25899, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[34].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[34].stddev == 186, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[34].stddev, expected 186, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[34].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[34].sv_id.constellation == 210, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[34].sv_id.constellation, expected 210, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[34].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[34].sv_id.satId == 129, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[34].sv_id.satId, expected 129, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[34].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[35].residual == -2078, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[35].residual, expected -2078, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[35].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[35].stddev == 187, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[35].stddev, expected 187, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[35].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[35].sv_id.constellation == 195, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[35].sv_id.constellation, expected 195, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[35].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[35].sv_id.satId == 208, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[35].sv_id.satId, expected 208, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[35].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[36].residual == -16264, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[36].residual, expected -16264, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[36].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[36].stddev == 102, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[36].stddev, expected 102, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[36].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[36].sv_id.constellation == 160, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[36].sv_id.constellation, expected 160, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[36].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[36].sv_id.satId == 219, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[36].sv_id.satId, expected 219, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[36].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[37].residual == -21002, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[37].residual, expected -21002, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[37].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[37].stddev == 94, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[37].stddev, expected 94, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[37].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[37].sv_id.constellation == 42, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[37].sv_id.constellation, expected 42, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[37].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[37].sv_id.satId == 166, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[37].sv_id.satId, expected 166, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[37].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[38].residual == 7902, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[38].residual, expected 7902, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[38].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[38].stddev == 35, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[38].stddev, expected 35, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[38].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[38].sv_id.constellation == 156, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[38].sv_id.constellation, expected 156, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[38].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[38].sv_id.satId == 102, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[38].sv_id.satId, expected 102, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[38].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[39].residual == -30275, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[39].residual, expected -30275, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[39].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[39].stddev == 204, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[39].stddev, expected 204, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[39].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[39].sv_id.constellation == 64, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[39].sv_id.constellation, expected 64, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[39].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[39].sv_id.satId == 247, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[39].sv_id.satId, expected 247, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[39].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[40].residual == -8633, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[40].residual, expected -8633, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[40].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[40].stddev == 222, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[40].stddev, expected 222, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[40].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[40].sv_id.constellation == 32, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[40].sv_id.constellation, expected 32, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[40].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[40].sv_id.satId == 220, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[40].sv_id.satId, expected 220, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[40].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[41].residual == 6403, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[41].residual, expected 6403, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[41].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[41].stddev == 45, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[41].stddev, expected 45, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[41].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[41].sv_id.constellation == 246, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[41].sv_id.constellation, expected 246, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[41].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[41].sv_id.satId == 201, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[41].sv_id.satId, expected 201, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[41].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[42].residual == 22643, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[42].residual, expected 22643, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[42].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[42].stddev == 218, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[42].stddev, expected 218, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[42].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[42].sv_id.constellation == 239, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[42].sv_id.constellation, expected 239, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[42].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[42].sv_id.satId == 251, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[42].sv_id.satId, expected 251, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[42].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[43].residual == 16760, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[43].residual, expected 16760, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[43].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[43].stddev == 175, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[43].stddev, expected 175, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[43].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[43].sv_id.constellation == 209, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[43].sv_id.constellation, expected 209, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[43].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[43].sv_id.satId == 10, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[43].sv_id.satId, expected 10, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[43].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[44].residual == -20951, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[44].residual, expected -20951, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[44].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[44].stddev == 137, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[44].stddev, expected 137, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[44].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[44].sv_id.constellation == 194, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[44].sv_id.constellation, expected 194, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[44].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[44].sv_id.satId == 131, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[44].sv_id.satId, expected 131, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[44].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[45].residual == -740, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[45].residual, expected -740, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[45].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[45].stddev == 42, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[45].stddev, expected 42, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[45].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[45].sv_id.constellation == 68, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[45].sv_id.constellation, expected 68, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[45].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[45].sv_id.satId == 17, "incorrect value for last_msg.msg.ssr_gridded_correction.stec_residuals[45].sv_id.satId, expected 17, is %d", last_msg.msg.ssr_gridded_correction.stec_residuals[45].sv_id.satId); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.tropo_delay_correction.hydro == -3035, "incorrect value for last_msg.msg.ssr_gridded_correction.tropo_delay_correction.hydro, expected -3035, is %d", last_msg.msg.ssr_gridded_correction.tropo_delay_correction.hydro); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.tropo_delay_correction.stddev == 72, "incorrect value for last_msg.msg.ssr_gridded_correction.tropo_delay_correction.stddev, expected 72, is %d", last_msg.msg.ssr_gridded_correction.tropo_delay_correction.stddev); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction.tropo_delay_correction.wet == 78, "incorrect value for last_msg.msg.ssr_gridded_correction.tropo_delay_correction.wet, expected 78, is %d", last_msg.msg.ssr_gridded_correction.tropo_delay_correction.wet); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrGriddedCorrection, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.header.iod_atmo == 170, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.header.iod_atmo, " + "expected 170, is %d", + last_msg.msg.ssr_gridded_correction.header.iod_atmo); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.header.num_msgs == 48535, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.header.num_msgs, " + "expected 48535, is %d", + last_msg.msg.ssr_gridded_correction.header.num_msgs); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.header.seq_num == 50380, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.header.seq_num, " + "expected 50380, is %d", + last_msg.msg.ssr_gridded_correction.header.seq_num); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.header.tile_id == 12951, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.header.tile_id, " + "expected 12951, is %d", + last_msg.msg.ssr_gridded_correction.header.tile_id); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.header.tile_set_id == 3605, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.header.tile_set_id, expected " + "3605, is %d", + last_msg.msg.ssr_gridded_correction.header.tile_set_id); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.header.time.tow == 2535294328, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.header.time.tow, expected " + "2535294328, is %d", + last_msg.msg.ssr_gridded_correction.header.time.tow); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.header.time.wn == 58798, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.header.time.wn, " + "expected 58798, is %d", + last_msg.msg.ssr_gridded_correction.header.time.wn); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.header.tropo_quality_indicator == + 120, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.header.tropo_quality_indicator, " + "expected 120, is %d", + last_msg.msg.ssr_gridded_correction.header.tropo_quality_indicator); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.header.update_interval == 105, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.header.update_interval, expected " + "105, is %d", + last_msg.msg.ssr_gridded_correction.header.update_interval); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.index == 43413, + "incorrect value for last_msg.msg.ssr_gridded_correction.index, " + "expected 43413, is %d", + last_msg.msg.ssr_gridded_correction.index); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.n_stec_residuals == 46, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.n_stec_residuals, " + "expected 46, is %d", + last_msg.msg.ssr_gridded_correction.n_stec_residuals); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[0].residual == + -21246, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[0].residual, " + "expected -21246, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[0].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[0].stddev == 88, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[0].stddev, " + "expected 88, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[0].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[0] + .sv_id.constellation == 101, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[0].sv_id." + "constellation, expected 101, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[0] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[0].sv_id.satId == + 140, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[0].sv_id.satId, " + "expected 140, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[0].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[1].residual == + -26570, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[1].residual, " + "expected -26570, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[1].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[1].stddev == 115, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[1].stddev, " + "expected 115, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[1].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[1] + .sv_id.constellation == 180, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[1].sv_id." + "constellation, expected 180, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[1] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[1].sv_id.satId == 70, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[1].sv_id.satId, " + "expected 70, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[1].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[2].residual == 6049, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[2].residual, " + "expected 6049, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[2].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[2].stddev == 135, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[2].stddev, " + "expected 135, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[2].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[2] + .sv_id.constellation == 201, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[2].sv_id." + "constellation, expected 201, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[2] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[2].sv_id.satId == 78, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[2].sv_id.satId, " + "expected 78, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[2].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[3].residual == 19261, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[3].residual, " + "expected 19261, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[3].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[3].stddev == 178, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[3].stddev, " + "expected 178, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[3].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[3] + .sv_id.constellation == 98, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[3].sv_id." + "constellation, expected 98, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[3] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[3].sv_id.satId == + 152, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[3].sv_id.satId, " + "expected 152, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[3].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[4].residual == 14226, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[4].residual, " + "expected 14226, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[4].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[4].stddev == 58, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[4].stddev, " + "expected 58, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[4].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[4] + .sv_id.constellation == 229, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[4].sv_id." + "constellation, expected 229, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[4] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[4].sv_id.satId == + 120, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[4].sv_id.satId, " + "expected 120, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[4].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[5].residual == 17894, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[5].residual, " + "expected 17894, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[5].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[5].stddev == 172, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[5].stddev, " + "expected 172, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[5].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[5] + .sv_id.constellation == 234, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[5].sv_id." + "constellation, expected 234, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[5] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[5].sv_id.satId == + 169, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[5].sv_id.satId, " + "expected 169, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[5].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[6].residual == 22930, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[6].residual, " + "expected 22930, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[6].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[6].stddev == 150, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[6].stddev, " + "expected 150, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[6].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[6] + .sv_id.constellation == 127, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[6].sv_id." + "constellation, expected 127, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[6] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[6].sv_id.satId == + 191, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[6].sv_id.satId, " + "expected 191, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[6].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[7].residual == 10721, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[7].residual, " + "expected 10721, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[7].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[7].stddev == 17, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[7].stddev, " + "expected 17, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[7].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[7] + .sv_id.constellation == 111, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[7].sv_id." + "constellation, expected 111, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[7] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[7].sv_id.satId == 91, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[7].sv_id.satId, " + "expected 91, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[7].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[8].residual == + -22874, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[8].residual, " + "expected -22874, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[8].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[8].stddev == 120, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[8].stddev, " + "expected 120, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[8].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[8] + .sv_id.constellation == 52, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[8].sv_id." + "constellation, expected 52, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[8] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[8].sv_id.satId == + 119, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[8].sv_id.satId, " + "expected 119, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[8].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[9].residual == 780, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[9].residual, " + "expected 780, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[9].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[9].stddev == 156, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[9].stddev, " + "expected 156, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[9].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[9] + .sv_id.constellation == 221, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[9].sv_id." + "constellation, expected 221, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[9] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[9].sv_id.satId == 57, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[9].sv_id.satId, " + "expected 57, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[9].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[10].residual == + 32547, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[10].residual, " + "expected 32547, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[10].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[10].stddev == 8, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[10].stddev, " + "expected 8, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[10].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[10] + .sv_id.constellation == 156, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[10].sv_" + "id.constellation, expected 156, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[10] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[10].sv_id.satId == + 70, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[10].sv_id.satId, " + "expected 70, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[10].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[11].residual == + 14208, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[11].residual, " + "expected 14208, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[11].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[11].stddev == 115, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[11].stddev, " + "expected 115, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[11].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[11] + .sv_id.constellation == 58, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[11].sv_" + "id.constellation, expected 58, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[11] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[11].sv_id.satId == + 127, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[11].sv_id.satId, " + "expected 127, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[11].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[12].residual == + -26246, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[12].residual, " + "expected -26246, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[12].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[12].stddev == 124, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[12].stddev, " + "expected 124, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[12].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[12] + .sv_id.constellation == 157, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[12].sv_" + "id.constellation, expected 157, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[12] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[12].sv_id.satId == + 80, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[12].sv_id.satId, " + "expected 80, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[12].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[13].residual == + 26466, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[13].residual, " + "expected 26466, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[13].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[13].stddev == 204, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[13].stddev, " + "expected 204, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[13].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[13] + .sv_id.constellation == 128, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[13].sv_" + "id.constellation, expected 128, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[13] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[13].sv_id.satId == + 27, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[13].sv_id.satId, " + "expected 27, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[13].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[14].residual == + -7552, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[14].residual, " + "expected -7552, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[14].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[14].stddev == 148, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[14].stddev, " + "expected 148, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[14].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[14] + .sv_id.constellation == 238, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[14].sv_" + "id.constellation, expected 238, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[14] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[14].sv_id.satId == + 75, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[14].sv_id.satId, " + "expected 75, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[14].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[15].residual == + -12072, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[15].residual, " + "expected -12072, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[15].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[15].stddev == 149, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[15].stddev, " + "expected 149, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[15].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[15] + .sv_id.constellation == 61, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[15].sv_" + "id.constellation, expected 61, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[15] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[15].sv_id.satId == + 248, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[15].sv_id.satId, " + "expected 248, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[15].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[16].residual == + -28632, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[16].residual, " + "expected -28632, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[16].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[16].stddev == 186, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[16].stddev, " + "expected 186, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[16].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[16] + .sv_id.constellation == 224, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[16].sv_" + "id.constellation, expected 224, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[16] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[16].sv_id.satId == + 167, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[16].sv_id.satId, " + "expected 167, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[16].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[17].residual == + -4024, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[17].residual, " + "expected -4024, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[17].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[17].stddev == 100, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[17].stddev, " + "expected 100, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[17].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[17] + .sv_id.constellation == 227, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[17].sv_" + "id.constellation, expected 227, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[17] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[17].sv_id.satId == + 157, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[17].sv_id.satId, " + "expected 157, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[17].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[18].residual == 2004, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[18].residual, " + "expected 2004, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[18].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[18].stddev == 59, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[18].stddev, " + "expected 59, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[18].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[18] + .sv_id.constellation == 12, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[18].sv_" + "id.constellation, expected 12, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[18] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[18].sv_id.satId == + 35, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[18].sv_id.satId, " + "expected 35, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[18].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[19].residual == 6998, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[19].residual, " + "expected 6998, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[19].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[19].stddev == 24, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[19].stddev, " + "expected 24, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[19].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[19] + .sv_id.constellation == 81, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[19].sv_" + "id.constellation, expected 81, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[19] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[19].sv_id.satId == + 176, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[19].sv_id.satId, " + "expected 176, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[19].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[20].residual == + -31701, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[20].residual, " + "expected -31701, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[20].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[20].stddev == 45, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[20].stddev, " + "expected 45, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[20].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[20] + .sv_id.constellation == 67, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[20].sv_" + "id.constellation, expected 67, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[20] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[20].sv_id.satId == + 155, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[20].sv_id.satId, " + "expected 155, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[20].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[21].residual == + 28678, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[21].residual, " + "expected 28678, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[21].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[21].stddev == 183, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[21].stddev, " + "expected 183, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[21].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[21] + .sv_id.constellation == 44, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[21].sv_" + "id.constellation, expected 44, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[21] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[21].sv_id.satId == + 203, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[21].sv_id.satId, " + "expected 203, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[21].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[22].residual == + -15793, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[22].residual, " + "expected -15793, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[22].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[22].stddev == 253, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[22].stddev, " + "expected 253, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[22].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[22] + .sv_id.constellation == 176, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[22].sv_" + "id.constellation, expected 176, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[22] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[22].sv_id.satId == + 231, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[22].sv_id.satId, " + "expected 231, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[22].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[23].residual == + -7589, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[23].residual, " + "expected -7589, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[23].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[23].stddev == 116, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[23].stddev, " + "expected 116, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[23].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[23] + .sv_id.constellation == 103, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[23].sv_" + "id.constellation, expected 103, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[23] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[23].sv_id.satId == + 247, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[23].sv_id.satId, " + "expected 247, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[23].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[24].residual == + -7362, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[24].residual, " + "expected -7362, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[24].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[24].stddev == 240, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[24].stddev, " + "expected 240, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[24].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[24] + .sv_id.constellation == 23, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[24].sv_" + "id.constellation, expected 23, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[24] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[24].sv_id.satId == + 148, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[24].sv_id.satId, " + "expected 148, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[24].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[25].residual == 4813, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[25].residual, " + "expected 4813, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[25].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[25].stddev == 242, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[25].stddev, " + "expected 242, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[25].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[25] + .sv_id.constellation == 219, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[25].sv_" + "id.constellation, expected 219, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[25] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[25].sv_id.satId == + 29, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[25].sv_id.satId, " + "expected 29, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[25].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[26].residual == + 20295, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[26].residual, " + "expected 20295, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[26].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[26].stddev == 37, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[26].stddev, " + "expected 37, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[26].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[26] + .sv_id.constellation == 72, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[26].sv_" + "id.constellation, expected 72, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[26] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[26].sv_id.satId == + 207, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[26].sv_id.satId, " + "expected 207, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[26].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[27].residual == + -13623, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[27].residual, " + "expected -13623, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[27].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[27].stddev == 91, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[27].stddev, " + "expected 91, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[27].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[27] + .sv_id.constellation == 176, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[27].sv_" + "id.constellation, expected 176, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[27] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[27].sv_id.satId == + 42, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[27].sv_id.satId, " + "expected 42, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[27].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[28].residual == + 15250, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[28].residual, " + "expected 15250, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[28].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[28].stddev == 110, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[28].stddev, " + "expected 110, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[28].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[28] + .sv_id.constellation == 115, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[28].sv_" + "id.constellation, expected 115, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[28] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[28].sv_id.satId == + 105, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[28].sv_id.satId, " + "expected 105, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[28].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[29].residual == + -18560, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[29].residual, " + "expected -18560, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[29].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[29].stddev == 185, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[29].stddev, " + "expected 185, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[29].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[29] + .sv_id.constellation == 109, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[29].sv_" + "id.constellation, expected 109, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[29] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[29].sv_id.satId == + 44, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[29].sv_id.satId, " + "expected 44, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[29].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[30].residual == + 23717, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[30].residual, " + "expected 23717, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[30].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[30].stddev == 79, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[30].stddev, " + "expected 79, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[30].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[30] + .sv_id.constellation == 31, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[30].sv_" + "id.constellation, expected 31, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[30] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[30].sv_id.satId == + 67, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[30].sv_id.satId, " + "expected 67, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[30].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[31].residual == 1886, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[31].residual, " + "expected 1886, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[31].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[31].stddev == 162, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[31].stddev, " + "expected 162, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[31].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[31] + .sv_id.constellation == 180, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[31].sv_" + "id.constellation, expected 180, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[31] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[31].sv_id.satId == + 189, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[31].sv_id.satId, " + "expected 189, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[31].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[32].residual == + 12242, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[32].residual, " + "expected 12242, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[32].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[32].stddev == 7, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[32].stddev, " + "expected 7, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[32].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[32] + .sv_id.constellation == 156, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[32].sv_" + "id.constellation, expected 156, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[32] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[32].sv_id.satId == + 121, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[32].sv_id.satId, " + "expected 121, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[32].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[33].residual == + 10670, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[33].residual, " + "expected 10670, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[33].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[33].stddev == 241, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[33].stddev, " + "expected 241, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[33].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[33] + .sv_id.constellation == 205, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[33].sv_" + "id.constellation, expected 205, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[33] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[33].sv_id.satId == 7, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[33].sv_id.satId, " + "expected 7, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[33].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[34].residual == + 25899, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[34].residual, " + "expected 25899, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[34].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[34].stddev == 186, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[34].stddev, " + "expected 186, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[34].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[34] + .sv_id.constellation == 210, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[34].sv_" + "id.constellation, expected 210, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[34] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[34].sv_id.satId == + 129, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[34].sv_id.satId, " + "expected 129, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[34].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[35].residual == + -2078, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[35].residual, " + "expected -2078, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[35].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[35].stddev == 187, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[35].stddev, " + "expected 187, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[35].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[35] + .sv_id.constellation == 195, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[35].sv_" + "id.constellation, expected 195, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[35] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[35].sv_id.satId == + 208, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[35].sv_id.satId, " + "expected 208, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[35].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[36].residual == + -16264, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[36].residual, " + "expected -16264, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[36].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[36].stddev == 102, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[36].stddev, " + "expected 102, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[36].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[36] + .sv_id.constellation == 160, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[36].sv_" + "id.constellation, expected 160, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[36] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[36].sv_id.satId == + 219, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[36].sv_id.satId, " + "expected 219, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[36].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[37].residual == + -21002, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[37].residual, " + "expected -21002, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[37].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[37].stddev == 94, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[37].stddev, " + "expected 94, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[37].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[37] + .sv_id.constellation == 42, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[37].sv_" + "id.constellation, expected 42, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[37] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[37].sv_id.satId == + 166, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[37].sv_id.satId, " + "expected 166, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[37].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[38].residual == 7902, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[38].residual, " + "expected 7902, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[38].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[38].stddev == 35, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[38].stddev, " + "expected 35, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[38].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[38] + .sv_id.constellation == 156, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[38].sv_" + "id.constellation, expected 156, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[38] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[38].sv_id.satId == + 102, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[38].sv_id.satId, " + "expected 102, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[38].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[39].residual == + -30275, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[39].residual, " + "expected -30275, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[39].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[39].stddev == 204, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[39].stddev, " + "expected 204, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[39].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[39] + .sv_id.constellation == 64, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[39].sv_" + "id.constellation, expected 64, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[39] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[39].sv_id.satId == + 247, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[39].sv_id.satId, " + "expected 247, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[39].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[40].residual == + -8633, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[40].residual, " + "expected -8633, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[40].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[40].stddev == 222, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[40].stddev, " + "expected 222, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[40].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[40] + .sv_id.constellation == 32, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[40].sv_" + "id.constellation, expected 32, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[40] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[40].sv_id.satId == + 220, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[40].sv_id.satId, " + "expected 220, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[40].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[41].residual == 6403, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[41].residual, " + "expected 6403, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[41].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[41].stddev == 45, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[41].stddev, " + "expected 45, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[41].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[41] + .sv_id.constellation == 246, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[41].sv_" + "id.constellation, expected 246, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[41] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[41].sv_id.satId == + 201, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[41].sv_id.satId, " + "expected 201, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[41].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[42].residual == + 22643, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[42].residual, " + "expected 22643, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[42].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[42].stddev == 218, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[42].stddev, " + "expected 218, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[42].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[42] + .sv_id.constellation == 239, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[42].sv_" + "id.constellation, expected 239, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[42] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[42].sv_id.satId == + 251, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[42].sv_id.satId, " + "expected 251, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[42].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[43].residual == + 16760, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[43].residual, " + "expected 16760, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[43].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[43].stddev == 175, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[43].stddev, " + "expected 175, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[43].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[43] + .sv_id.constellation == 209, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[43].sv_" + "id.constellation, expected 209, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[43] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[43].sv_id.satId == + 10, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[43].sv_id.satId, " + "expected 10, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[43].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[44].residual == + -20951, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[44].residual, " + "expected -20951, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[44].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[44].stddev == 137, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[44].stddev, " + "expected 137, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[44].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[44] + .sv_id.constellation == 194, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[44].sv_" + "id.constellation, expected 194, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[44] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[44].sv_id.satId == + 131, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[44].sv_id.satId, " + "expected 131, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[44].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[45].residual == -740, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[45].residual, " + "expected -740, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[45].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[45].stddev == 42, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[45].stddev, " + "expected 42, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[45].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction.stec_residuals[45] + .sv_id.constellation == 68, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[45].sv_" + "id.constellation, expected 68, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[45] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.stec_residuals[45].sv_id.satId == + 17, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.stec_residuals[45].sv_id.satId, " + "expected 17, is %d", + last_msg.msg.ssr_gridded_correction.stec_residuals[45].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.tropo_delay_correction.hydro == + -3035, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.tropo_delay_correction.hydro, " + "expected -3035, is %d", + last_msg.msg.ssr_gridded_correction.tropo_delay_correction.hydro); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.tropo_delay_correction.stddev == 72, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.tropo_delay_correction.stddev, " + "expected 72, is %d", + last_msg.msg.ssr_gridded_correction.tropo_delay_correction.stddev); + ck_assert_msg( + last_msg.msg.ssr_gridded_correction.tropo_delay_correction.wet == 78, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction.tropo_delay_correction.wet, " + "expected 78, is %d", + last_msg.msg.ssr_gridded_correction.tropo_delay_correction.wet); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrGriddedCorrection_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrGriddedCorrection"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrGriddedCorrection"); +Suite *auto_check_sbp_ssr_MsgSsrGriddedCorrection_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ssr_MsgSsrGriddedCorrection"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_ssr_MsgSsrGriddedCorrection"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrGriddedCorrection); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.c b/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.c index a8dff833a..b16e85183 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionBounds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionBounds.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,198 +90,392 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds ) logging_reset(); - sbp_callback_register(&sbp_state, 1534, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 1534, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,254,5,66,0,45,180,0,0,0,3,0,1,0,10,0,15,1,0,10,0,39,232,3,244,1,100,200,150,100,150,100,2,5,10,16,0,17,18,19,20,21,6,10,22,0,23,24,25,26,27,236,182, }; + u8 encoded_frame[] = { + 85, 254, 5, 66, 0, 45, 180, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 15, 1, 0, 10, 0, 39, 232, 3, 244, 1, 100, 200, + 150, 100, 150, 100, 2, 5, 10, 16, 0, 17, 18, 19, 20, 21, + 6, 10, 22, 0, 23, 24, 25, 26, 27, 236, 182, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ssr_gridded_correction_bounds.grid_point_id = 1000; - - + test_msg.ssr_gridded_correction_bounds.header.num_msgs = 1; - + test_msg.ssr_gridded_correction_bounds.header.seq_num = 0; - + test_msg.ssr_gridded_correction_bounds.header.sol_id = 0; - - + test_msg.ssr_gridded_correction_bounds.header.time.tow = 180; - + test_msg.ssr_gridded_correction_bounds.header.time.wn = 3; - + test_msg.ssr_gridded_correction_bounds.header.update_interval = 10; - + test_msg.ssr_gridded_correction_bounds.n_sats = 2; - + test_msg.ssr_gridded_correction_bounds.ssr_iod_atmo = 15; - - - + test_msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_mu = 18; - - test_msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_mu_dot = 20; - + + test_msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_mu_dot = + 20; + test_msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_sig = 19; - - test_msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_sig_dot = 21; - - - test_msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.residual = 16; - - test_msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.stddev = 17; - - - test_msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.sv_id.constellation = 10; - - test_msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.sv_id.satId = 5; - - + + test_msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_sig_dot = + 21; + + test_msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_residual.residual = 16; + + test_msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_residual.stddev = 17; + + test_msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_residual.sv_id.constellation = 10; + + test_msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_residual.sv_id.satId = 5; + test_msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_mu = 24; - - test_msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_mu_dot = 26; - + + test_msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_mu_dot = + 26; + test_msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_sig = 25; - - test_msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_sig_dot = 27; - - - test_msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.residual = 22; - - test_msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.stddev = 23; - - - test_msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.sv_id.constellation = 10; - - test_msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.sv_id.satId = 6; - + + test_msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_sig_dot = + 27; + + test_msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_residual.residual = 22; + + test_msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_residual.stddev = 23; + + test_msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_residual.sv_id.constellation = 10; + + test_msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_residual.sv_id.satId = 6; + test_msg.ssr_gridded_correction_bounds.tile_id = 10; - + test_msg.ssr_gridded_correction_bounds.tile_set_id = 1; - - + test_msg.ssr_gridded_correction_bounds.tropo_delay_correction.hydro = 500; - + test_msg.ssr_gridded_correction_bounds.tropo_delay_correction.stddev = 200; - + test_msg.ssr_gridded_correction_bounds.tropo_delay_correction.wet = 100; - + test_msg.ssr_gridded_correction_bounds.tropo_qi = 39; - + test_msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_mu = 150; - + test_msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_sig = 100; - + test_msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_mu = 150; - + test_msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_sig = 100; - sbp_message_send(&sbp_state, SbpMsgSsrGriddedCorrectionBounds, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrGriddedCorrectionBounds, 66, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrGriddedCorrectionBounds, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.grid_point_id == 1000, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.grid_point_id, expected 1000, is %d", last_msg.msg.ssr_gridded_correction_bounds.grid_point_id); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.header.num_msgs == 1, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.header.num_msgs, expected 1, is %d", last_msg.msg.ssr_gridded_correction_bounds.header.num_msgs); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.header.seq_num == 0, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.header.seq_num, expected 0, is %d", last_msg.msg.ssr_gridded_correction_bounds.header.seq_num); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.header.sol_id == 0, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.header.sol_id, expected 0, is %d", last_msg.msg.ssr_gridded_correction_bounds.header.sol_id); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.header.time.tow == 180, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.header.time.tow, expected 180, is %d", last_msg.msg.ssr_gridded_correction_bounds.header.time.tow); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.header.time.wn == 3, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.header.time.wn, expected 3, is %d", last_msg.msg.ssr_gridded_correction_bounds.header.time.wn); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.header.update_interval == 10, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.header.update_interval, expected 10, is %d", last_msg.msg.ssr_gridded_correction_bounds.header.update_interval); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.n_sats == 2, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.n_sats, expected 2, is %d", last_msg.msg.ssr_gridded_correction_bounds.n_sats); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.ssr_iod_atmo == 15, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.ssr_iod_atmo, expected 15, is %d", last_msg.msg.ssr_gridded_correction_bounds.ssr_iod_atmo); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_mu == 18, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_mu, expected 18, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_mu_dot == 20, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_mu_dot, expected 20, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_mu_dot); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_sig == 19, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_sig, expected 19, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_sig_dot == 21, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_sig_dot, expected 21, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_bound_sig_dot); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.residual == 16, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.residual, expected 16, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.stddev == 17, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.stddev, expected 17, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.sv_id.constellation == 10, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.sv_id.constellation, expected 10, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.sv_id.satId == 5, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.sv_id.satId, expected 5, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0].stec_residual.sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_mu == 24, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_mu, expected 24, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_mu_dot == 26, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_mu_dot, expected 26, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_mu_dot); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_sig == 25, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_sig, expected 25, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_sig_dot == 27, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_sig_dot, expected 27, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_bound_sig_dot); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.residual == 22, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.residual, expected 22, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.stddev == 23, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.stddev, expected 23, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.sv_id.constellation == 10, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.sv_id.constellation, expected 10, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.sv_id.satId == 6, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.sv_id.satId, expected 6, is %d", last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1].stec_residual.sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tile_id == 10, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tile_id, expected 10, is %d", last_msg.msg.ssr_gridded_correction_bounds.tile_id); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tile_set_id == 1, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tile_set_id, expected 1, is %d", last_msg.msg.ssr_gridded_correction_bounds.tile_set_id); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.hydro == 500, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.hydro, expected 500, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.hydro); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.stddev == 200, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.stddev, expected 200, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.stddev); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.wet == 100, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.wet, expected 100, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.wet); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_qi == 39, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_qi, expected 39, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_qi); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_mu == 150, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_mu, expected 150, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_sig == 100, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_sig, expected 100, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_mu == 150, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_mu, expected 150, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_sig == 100, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_sig, expected 100, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_sig); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrGriddedCorrectionBounds, + &last_msg.msg, &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.grid_point_id == 1000, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.grid_point_id, expected " + "1000, is %d", + last_msg.msg.ssr_gridded_correction_bounds.grid_point_id); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.header.num_msgs == 1, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.header.num_msgs, expected " + "1, is %d", + last_msg.msg.ssr_gridded_correction_bounds.header.num_msgs); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.header.seq_num == 0, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.header.seq_num, expected " + "0, is %d", + last_msg.msg.ssr_gridded_correction_bounds.header.seq_num); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.header.sol_id == 0, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.header.sol_id, " + "expected 0, is %d", + last_msg.msg.ssr_gridded_correction_bounds.header.sol_id); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.header.time.tow == 180, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.header.time.tow, expected " + "180, is %d", + last_msg.msg.ssr_gridded_correction_bounds.header.time.tow); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.header.time.wn == 3, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.header.time.wn, expected " + "3, is %d", + last_msg.msg.ssr_gridded_correction_bounds.header.time.wn); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.header.update_interval == 10, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.header.update_interval, " + "expected 10, is %d", + last_msg.msg.ssr_gridded_correction_bounds.header.update_interval); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.n_sats == 2, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.n_sats, expected 2, is %d", + last_msg.msg.ssr_gridded_correction_bounds.n_sats); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.ssr_iod_atmo == 15, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.ssr_iod_atmo, " + "expected 15, is %d", + last_msg.msg.ssr_gridded_correction_bounds.ssr_iod_atmo); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_bound_mu == 18, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0]." + "stec_bound_mu, expected 18, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_bound_mu); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_bound_mu_dot == 20, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0]." + "stec_bound_mu_dot, expected 20, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_bound_mu_dot); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_bound_sig == 19, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0]." + "stec_bound_sig, expected 19, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_bound_sig); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_bound_sig_dot == 21, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0]." + "stec_bound_sig_dot, expected 21, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_bound_sig_dot); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_residual.residual == 16, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0]." + "stec_residual.residual, expected 16, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_residual.residual); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_residual.stddev == 17, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0]." + "stec_residual.stddev, expected 17, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_residual.stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_residual.sv_id.constellation == 10, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0]." + "stec_residual.sv_id.constellation, expected 10, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_residual.sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_residual.sv_id.satId == 5, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0]." + "stec_residual.sv_id.satId, expected 5, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[0] + .stec_residual.sv_id.satId); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_bound_mu == 24, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1]." + "stec_bound_mu, expected 24, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_bound_mu); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_bound_mu_dot == 26, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1]." + "stec_bound_mu_dot, expected 26, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_bound_mu_dot); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_bound_sig == 25, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1]." + "stec_bound_sig, expected 25, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_bound_sig); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_bound_sig_dot == 27, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1]." + "stec_bound_sig_dot, expected 27, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_bound_sig_dot); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_residual.residual == 22, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1]." + "stec_residual.residual, expected 22, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_residual.residual); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_residual.stddev == 23, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1]." + "stec_residual.stddev, expected 23, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_residual.stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_residual.sv_id.constellation == 10, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1]." + "stec_residual.sv_id.constellation, expected 10, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_residual.sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_residual.sv_id.satId == 6, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1]." + "stec_residual.sv_id.satId, expected 6, is %d", + last_msg.msg.ssr_gridded_correction_bounds.stec_sat_list[1] + .stec_residual.sv_id.satId); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tile_id == 10, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tile_id, " + "expected 10, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tile_id); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tile_set_id == 1, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tile_set_id, " + "expected 1, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tile_set_id); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds + .tropo_delay_correction.hydro == 500, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_" + "correction.hydro, expected 500, is %d", + last_msg.msg.ssr_gridded_correction_bounds + .tropo_delay_correction.hydro); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds + .tropo_delay_correction.stddev == 200, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_" + "correction.stddev, expected 200, is %d", + last_msg.msg.ssr_gridded_correction_bounds + .tropo_delay_correction.stddev); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.wet == + 100, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.wet," + " expected 100, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.wet); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_qi == 39, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_qi, " + "expected 39, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tropo_qi); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_mu == + 150, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_mu, " + "expected 150, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_mu); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_sig == + 100, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_sig, " + "expected 100, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_sig); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_mu == 150, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_mu, " + "expected 150, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_mu); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_sig == 100, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_sig, " + "expected 100, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_sig); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -293,127 +483,223 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds ) logging_reset(); - sbp_callback_register(&sbp_state, 1534, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 1534, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,254,5,66,0,27,180,0,0,0,3,0,1,0,10,0,15,1,0,10,0,39,232,3,244,1,100,200,150,100,150,100,0,155,36, }; + u8 encoded_frame[] = { + 85, 254, 5, 66, 0, 27, 180, 0, 0, 0, 3, 0, + 1, 0, 10, 0, 15, 1, 0, 10, 0, 39, 232, 3, + 244, 1, 100, 200, 150, 100, 150, 100, 0, 155, 36, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ssr_gridded_correction_bounds.grid_point_id = 1000; - - + test_msg.ssr_gridded_correction_bounds.header.num_msgs = 1; - + test_msg.ssr_gridded_correction_bounds.header.seq_num = 0; - + test_msg.ssr_gridded_correction_bounds.header.sol_id = 0; - - + test_msg.ssr_gridded_correction_bounds.header.time.tow = 180; - + test_msg.ssr_gridded_correction_bounds.header.time.wn = 3; - + test_msg.ssr_gridded_correction_bounds.header.update_interval = 10; - + test_msg.ssr_gridded_correction_bounds.n_sats = 0; - + test_msg.ssr_gridded_correction_bounds.ssr_iod_atmo = 15; - - + test_msg.ssr_gridded_correction_bounds.tile_id = 10; - + test_msg.ssr_gridded_correction_bounds.tile_set_id = 1; - - + test_msg.ssr_gridded_correction_bounds.tropo_delay_correction.hydro = 500; - + test_msg.ssr_gridded_correction_bounds.tropo_delay_correction.stddev = 200; - + test_msg.ssr_gridded_correction_bounds.tropo_delay_correction.wet = 100; - + test_msg.ssr_gridded_correction_bounds.tropo_qi = 39; - + test_msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_mu = 150; - + test_msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_sig = 100; - + test_msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_mu = 150; - + test_msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_sig = 100; - sbp_message_send(&sbp_state, SbpMsgSsrGriddedCorrectionBounds, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrGriddedCorrectionBounds, 66, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrGriddedCorrectionBounds, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.grid_point_id == 1000, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.grid_point_id, expected 1000, is %d", last_msg.msg.ssr_gridded_correction_bounds.grid_point_id); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.header.num_msgs == 1, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.header.num_msgs, expected 1, is %d", last_msg.msg.ssr_gridded_correction_bounds.header.num_msgs); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.header.seq_num == 0, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.header.seq_num, expected 0, is %d", last_msg.msg.ssr_gridded_correction_bounds.header.seq_num); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.header.sol_id == 0, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.header.sol_id, expected 0, is %d", last_msg.msg.ssr_gridded_correction_bounds.header.sol_id); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.header.time.tow == 180, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.header.time.tow, expected 180, is %d", last_msg.msg.ssr_gridded_correction_bounds.header.time.tow); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.header.time.wn == 3, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.header.time.wn, expected 3, is %d", last_msg.msg.ssr_gridded_correction_bounds.header.time.wn); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.header.update_interval == 10, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.header.update_interval, expected 10, is %d", last_msg.msg.ssr_gridded_correction_bounds.header.update_interval); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.n_sats == 0, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.n_sats, expected 0, is %d", last_msg.msg.ssr_gridded_correction_bounds.n_sats); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.ssr_iod_atmo == 15, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.ssr_iod_atmo, expected 15, is %d", last_msg.msg.ssr_gridded_correction_bounds.ssr_iod_atmo); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tile_id == 10, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tile_id, expected 10, is %d", last_msg.msg.ssr_gridded_correction_bounds.tile_id); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tile_set_id == 1, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tile_set_id, expected 1, is %d", last_msg.msg.ssr_gridded_correction_bounds.tile_set_id); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.hydro == 500, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.hydro, expected 500, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.hydro); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.stddev == 200, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.stddev, expected 200, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.stddev); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.wet == 100, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.wet, expected 100, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.wet); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_qi == 39, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_qi, expected 39, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_qi); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_mu == 150, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_mu, expected 150, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_sig == 100, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_sig, expected 100, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_mu == 150, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_mu, expected 150, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_sig == 100, "incorrect value for last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_sig, expected 100, is %d", last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_sig); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrGriddedCorrectionBounds, + &last_msg.msg, &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.grid_point_id == 1000, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.grid_point_id, expected " + "1000, is %d", + last_msg.msg.ssr_gridded_correction_bounds.grid_point_id); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.header.num_msgs == 1, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.header.num_msgs, expected " + "1, is %d", + last_msg.msg.ssr_gridded_correction_bounds.header.num_msgs); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.header.seq_num == 0, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.header.seq_num, expected " + "0, is %d", + last_msg.msg.ssr_gridded_correction_bounds.header.seq_num); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.header.sol_id == 0, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.header.sol_id, " + "expected 0, is %d", + last_msg.msg.ssr_gridded_correction_bounds.header.sol_id); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.header.time.tow == 180, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.header.time.tow, expected " + "180, is %d", + last_msg.msg.ssr_gridded_correction_bounds.header.time.tow); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.header.time.wn == 3, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.header.time.wn, expected " + "3, is %d", + last_msg.msg.ssr_gridded_correction_bounds.header.time.wn); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.header.update_interval == 10, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.header.update_interval, " + "expected 10, is %d", + last_msg.msg.ssr_gridded_correction_bounds.header.update_interval); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.n_sats == 0, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.n_sats, expected 0, is %d", + last_msg.msg.ssr_gridded_correction_bounds.n_sats); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.ssr_iod_atmo == 15, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.ssr_iod_atmo, " + "expected 15, is %d", + last_msg.msg.ssr_gridded_correction_bounds.ssr_iod_atmo); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tile_id == 10, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tile_id, " + "expected 10, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tile_id); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tile_set_id == 1, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tile_set_id, " + "expected 1, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tile_set_id); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds + .tropo_delay_correction.hydro == 500, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_" + "correction.hydro, expected 500, is %d", + last_msg.msg.ssr_gridded_correction_bounds + .tropo_delay_correction.hydro); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds + .tropo_delay_correction.stddev == 200, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_" + "correction.stddev, expected 200, is %d", + last_msg.msg.ssr_gridded_correction_bounds + .tropo_delay_correction.stddev); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.wet == + 100, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.wet," + " expected 100, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tropo_delay_correction.wet); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_bounds.tropo_qi == 39, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_qi, " + "expected 39, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tropo_qi); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_mu == + 150, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_mu, " + "expected 150, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_mu); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_sig == + 100, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_sig, " + "expected 100, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_hydro_bound_sig); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_mu == 150, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_mu, " + "expected 150, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_mu); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_sig == 100, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_sig, " + "expected 100, is %d", + last_msg.msg.ssr_gridded_correction_bounds.tropo_v_wet_bound_sig); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds"); +Suite *auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.c b/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.c index 15c691234..1c2e51db6 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,992 +90,2107 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x5fa, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x5fa, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,250,5,108,106,254,164,217,44,53,98,93,63,147,104,252,133,245,28,95,100,147,41,33,92,87,25,142,151,74,151,95,94,7,146,237,45,167,86,42,116,224,169,234,220,23,176,18,13,178,79,160,160,110,15,53,206,151,158,22,117,184,48,170,82,40,53,122,69,180,110,38,65,104,244,19,238,227,88,169,164,146,63,37,183,85,71,235,168,114,211,105,221,156,60,18,230,2,142,172,16,39,33,126,106,99,188,234,41,162,197,138,227,80,12,54,67,238,5,93,1,207,129,13,46,115,49,58,185,127,156,200,96,217,202,15,245,55,198,81,218,132,70,73,82,147,26,255,14,134,96,138,55,214,83,156,170,163,79,173,228,115,51,241,107,245,112,168,210,10,5,117,1,57,108,248,212,145,119,226,165,5,141,202,106,0,60,36,61,243,203,216,215,12,137,16,28,247,115,152,181,119,208,228,203,236,34,167,196,32,109,1,17,101,200,25,94,125,168,137,157,4,164,29,31,48,132,72,229,126,186,68,76,133,21,0,180,139,164,148,119,149,214,120,177,201,80,80,105,10,136,118,77,46,233,233,227,11,158,103,167,216, }; + u8 encoded_frame[] = { + 85, 250, 5, 108, 106, 254, 164, 217, 44, 53, 98, 93, 63, 147, + 104, 252, 133, 245, 28, 95, 100, 147, 41, 33, 92, 87, 25, 142, + 151, 74, 151, 95, 94, 7, 146, 237, 45, 167, 86, 42, 116, 224, + 169, 234, 220, 23, 176, 18, 13, 178, 79, 160, 160, 110, 15, 53, + 206, 151, 158, 22, 117, 184, 48, 170, 82, 40, 53, 122, 69, 180, + 110, 38, 65, 104, 244, 19, 238, 227, 88, 169, 164, 146, 63, 37, + 183, 85, 71, 235, 168, 114, 211, 105, 221, 156, 60, 18, 230, 2, + 142, 172, 16, 39, 33, 126, 106, 99, 188, 234, 41, 162, 197, 138, + 227, 80, 12, 54, 67, 238, 5, 93, 1, 207, 129, 13, 46, 115, + 49, 58, 185, 127, 156, 200, 96, 217, 202, 15, 245, 55, 198, 81, + 218, 132, 70, 73, 82, 147, 26, 255, 14, 134, 96, 138, 55, 214, + 83, 156, 170, 163, 79, 173, 228, 115, 51, 241, 107, 245, 112, 168, + 210, 10, 5, 117, 1, 57, 108, 248, 212, 145, 119, 226, 165, 5, + 141, 202, 106, 0, 60, 36, 61, 243, 203, 216, 215, 12, 137, 16, + 28, 247, 115, 152, 181, 119, 208, 228, 203, 236, 34, 167, 196, 32, + 109, 1, 17, 101, 200, 25, 94, 125, 168, 137, 157, 4, 164, 29, + 31, 48, 132, 72, 229, 126, 186, 68, 76, 133, 21, 0, 180, 139, + 164, 148, 119, 149, 214, 120, 177, 201, 80, 80, 105, 10, 136, 118, + 77, 46, 233, 233, 227, 11, 158, 103, 167, 216, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ssr_gridded_correction_dep_a.header.iod_atmo = 245; - + test_msg.ssr_gridded_correction_dep_a.header.num_msgs = 37695; - + test_msg.ssr_gridded_correction_dep_a.header.seq_num = 64616; - - + test_msg.ssr_gridded_correction_dep_a.header.time.tow = 892131748; - + test_msg.ssr_gridded_correction_dep_a.header.time.wn = 23906; - + test_msg.ssr_gridded_correction_dep_a.header.tropo_quality_indicator = 28; - + test_msg.ssr_gridded_correction_dep_a.header.update_interval = 133; - + test_msg.ssr_gridded_correction_dep_a.index = 25695; - + test_msg.ssr_gridded_correction_dep_a.n_stec_residuals = 47; - - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[0].residual = -26738; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[0].stddev = 74; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[0].sv_id.constellation = 25; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[0] + .sv_id.constellation = 25; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[0].sv_id.satId = 87; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[1].residual = 1886; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[1].stddev = 146; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[1].sv_id.constellation = 95; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[1] + .sv_id.constellation = 95; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[1].sv_id.satId = 151; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[2].residual = 22183; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[2].stddev = 42; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[2].sv_id.constellation = 45; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[2] + .sv_id.constellation = 45; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[2].sv_id.satId = 237; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[3].residual = -5463; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[3].stddev = 220; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[3].sv_id.constellation = 224; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[3] + .sv_id.constellation = 224; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[3].sv_id.satId = 116; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[4].residual = 3346; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[4].stddev = 178; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[4].sv_id.constellation = 176; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[4] + .sv_id.constellation = 176; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[4].sv_id.satId = 23; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[5].residual = 28320; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[5].stddev = 15; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[5].sv_id.constellation = 160; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[5] + .sv_id.constellation = 160; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[5].sv_id.satId = 79; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[6].residual = -24937; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[6].stddev = 22; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[6].sv_id.constellation = 206; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[6] + .sv_id.constellation = 206; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[6].sv_id.satId = 53; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[7].residual = -21968; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[7].stddev = 82; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[7].sv_id.constellation = 184; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[7] + .sv_id.constellation = 184; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[7].sv_id.satId = 117; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[8].residual = 17786; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[8].stddev = 180; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[8].sv_id.constellation = 53; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[8] + .sv_id.constellation = 53; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[8].sv_id.satId = 40; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[9].residual = 26689; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[9].stddev = 244; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[9].sv_id.constellation = 38; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[9] + .sv_id.constellation = 38; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[9].sv_id.satId = 110; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[10].residual = 22755; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[10].stddev = 169; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[10].sv_id.constellation = 238; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[10] + .sv_id.constellation = 238; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[10].sv_id.satId = 19; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[11].residual = 9535; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[11].stddev = 183; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[11].sv_id.constellation = 146; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[11] + .sv_id.constellation = 146; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[11].sv_id.satId = 164; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[12].residual = -22293; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[12].stddev = 114; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[12].sv_id.constellation = 71; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[12] + .sv_id.constellation = 71; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[12].sv_id.satId = 85; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[13].residual = -25379; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[13].stddev = 60; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[13].sv_id.constellation = 105; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[13] + .sv_id.constellation = 105; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[13].sv_id.satId = 211; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[14].residual = -29182; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[14].stddev = 172; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[14].sv_id.constellation = 230; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[14] + .sv_id.constellation = 230; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[14].sv_id.satId = 18; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[15].residual = 32289; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[15].stddev = 106; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[15].sv_id.constellation = 39; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[15] + .sv_id.constellation = 39; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[15].sv_id.satId = 16; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[16].residual = 10730; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[16].stddev = 162; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[16].sv_id.constellation = 188; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[16] + .sv_id.constellation = 188; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[16].sv_id.satId = 99; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[17].residual = 20707; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[17].stddev = 12; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[17].sv_id.constellation = 138; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[17] + .sv_id.constellation = 138; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[17].sv_id.satId = 197; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[18].residual = 1518; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[18].stddev = 93; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[18].sv_id.constellation = 67; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[18] + .sv_id.constellation = 67; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[18].sv_id.satId = 54; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[19].residual = 3457; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[19].stddev = 46; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[19].sv_id.constellation = 207; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[19] + .sv_id.constellation = 207; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[19].sv_id.satId = 1; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[20].residual = -18118; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[20].stddev = 127; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[20].sv_id.constellation = 49; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[20] + .sv_id.constellation = 49; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[20].sv_id.satId = 115; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[21].residual = -9888; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[21].stddev = 202; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[21].sv_id.constellation = 200; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[21] + .sv_id.constellation = 200; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[21].sv_id.satId = 156; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[22].residual = -14793; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[22].stddev = 81; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[22].sv_id.constellation = 245; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[22] + .sv_id.constellation = 245; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[22].sv_id.satId = 15; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[23].residual = 18758; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[23].stddev = 82; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[23].sv_id.constellation = 132; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[23] + .sv_id.constellation = 132; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[23].sv_id.satId = 218; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[24].residual = 3839; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[24].stddev = 134; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[24].sv_id.constellation = 26; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[24] + .sv_id.constellation = 26; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[24].sv_id.satId = 147; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[25].residual = -10697; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[25].stddev = 83; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[25].sv_id.constellation = 138; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[25] + .sv_id.constellation = 138; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[25].sv_id.satId = 96; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[26].residual = 20387; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[26].stddev = 173; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[26].sv_id.constellation = 170; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[26] + .sv_id.constellation = 170; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[26].sv_id.satId = 156; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[27].residual = -3789; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[27].stddev = 107; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[27].sv_id.constellation = 115; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[27] + .sv_id.constellation = 115; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[27].sv_id.satId = 228; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[28].residual = -11608; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[28].stddev = 10; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[28].sv_id.constellation = 112; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[28] + .sv_id.constellation = 112; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[28].sv_id.satId = 245; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[29].residual = 14593; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[29].stddev = 108; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[29].sv_id.constellation = 117; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[29] + .sv_id.constellation = 117; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[29].sv_id.satId = 5; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[30].residual = 30609; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[30].stddev = 226; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[30].sv_id.constellation = 212; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[30] + .sv_id.constellation = 212; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[30].sv_id.satId = 248; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[31].residual = -13683; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[31].stddev = 106; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[31].sv_id.constellation = 5; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[31] + .sv_id.constellation = 5; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[31].sv_id.satId = 165; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[32].residual = 15652; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[32].stddev = 243; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[32].sv_id.constellation = 60; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[32] + .sv_id.constellation = 60; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[32].sv_id.satId = 0; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[33].residual = 3287; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[33].stddev = 137; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[33].sv_id.constellation = 216; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[33] + .sv_id.constellation = 216; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[33].sv_id.satId = 203; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[34].residual = 29687; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[34].stddev = 152; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[34].sv_id.constellation = 28; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[34] + .sv_id.constellation = 28; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[34].sv_id.satId = 16; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[35].residual = -6960; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[35].stddev = 203; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[35].sv_id.constellation = 119; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[35] + .sv_id.constellation = 119; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[35].sv_id.satId = 181; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[36].residual = -15193; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[36].stddev = 32; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[36].sv_id.constellation = 34; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[36] + .sv_id.constellation = 34; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[36].sv_id.satId = 236; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[37].residual = 25873; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[37].stddev = 200; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[37].sv_id.constellation = 1; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[37] + .sv_id.constellation = 1; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[37].sv_id.satId = 109; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[38].residual = -22403; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[38].stddev = 137; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[38].sv_id.constellation = 94; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[38] + .sv_id.constellation = 94; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[38].sv_id.satId = 25; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[39].residual = 7588; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[39].stddev = 31; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[39].sv_id.constellation = 4; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[39] + .sv_id.constellation = 4; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[39].sv_id.satId = 157; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[40].residual = -6840; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[40].stddev = 126; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[40].sv_id.constellation = 132; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[40] + .sv_id.constellation = 132; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[40].sv_id.satId = 48; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[41].residual = -31412; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[41].stddev = 21; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[41].sv_id.constellation = 68; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[41] + .sv_id.constellation = 68; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[41].sv_id.satId = 186; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[42].residual = -23413; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[42].stddev = 148; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[42].sv_id.constellation = 180; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[42] + .sv_id.constellation = 180; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[42].sv_id.satId = 0; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[43].residual = 30934; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[43].stddev = 177; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[43].sv_id.constellation = 149; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[43] + .sv_id.constellation = 149; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[43].sv_id.satId = 119; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[44].residual = 26960; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[44].stddev = 10; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[44].sv_id.constellation = 80; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[44] + .sv_id.constellation = 80; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[44].sv_id.satId = 201; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[45].residual = 11853; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[45].stddev = 233; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[45].sv_id.constellation = 118; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[45] + .sv_id.constellation = 118; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[45].sv_id.satId = 136; - - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[46].residual = -25077; - + test_msg.ssr_gridded_correction_dep_a.stec_residuals[46].stddev = 103; - - - test_msg.ssr_gridded_correction_dep_a.stec_residuals[46].sv_id.constellation = 227; - + + test_msg.ssr_gridded_correction_dep_a.stec_residuals[46] + .sv_id.constellation = 227; + test_msg.ssr_gridded_correction_dep_a.stec_residuals[46].sv_id.satId = 233; - - + test_msg.ssr_gridded_correction_dep_a.tropo_delay_correction.hydro = 10643; - + test_msg.ssr_gridded_correction_dep_a.tropo_delay_correction.stddev = 92; - + test_msg.ssr_gridded_correction_dep_a.tropo_delay_correction.wet = 33; - sbp_message_send(&sbp_state, SbpMsgSsrGriddedCorrectionDepA, 27244, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrGriddedCorrectionDepA, 27244, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 27244, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrGriddedCorrectionDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.header.iod_atmo == 245, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.header.iod_atmo, expected 245, is %d", last_msg.msg.ssr_gridded_correction_dep_a.header.iod_atmo); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.header.num_msgs == 37695, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.header.num_msgs, expected 37695, is %d", last_msg.msg.ssr_gridded_correction_dep_a.header.num_msgs); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.header.seq_num == 64616, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.header.seq_num, expected 64616, is %d", last_msg.msg.ssr_gridded_correction_dep_a.header.seq_num); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.header.time.tow == 892131748, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.header.time.tow, expected 892131748, is %d", last_msg.msg.ssr_gridded_correction_dep_a.header.time.tow); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.header.time.wn == 23906, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.header.time.wn, expected 23906, is %d", last_msg.msg.ssr_gridded_correction_dep_a.header.time.wn); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.header.tropo_quality_indicator == 28, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.header.tropo_quality_indicator, expected 28, is %d", last_msg.msg.ssr_gridded_correction_dep_a.header.tropo_quality_indicator); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.header.update_interval == 133, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.header.update_interval, expected 133, is %d", last_msg.msg.ssr_gridded_correction_dep_a.header.update_interval); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.index == 25695, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.index, expected 25695, is %d", last_msg.msg.ssr_gridded_correction_dep_a.index); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.n_stec_residuals == 47, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.n_stec_residuals, expected 47, is %d", last_msg.msg.ssr_gridded_correction_dep_a.n_stec_residuals); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].residual == -26738, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].residual, expected -26738, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].stddev == 74, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].stddev, expected 74, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].sv_id.constellation == 25, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].sv_id.constellation, expected 25, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].sv_id.satId == 87, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].sv_id.satId, expected 87, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].residual == 1886, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].residual, expected 1886, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].stddev == 146, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].stddev, expected 146, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].sv_id.constellation == 95, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].sv_id.constellation, expected 95, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].sv_id.satId == 151, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].sv_id.satId, expected 151, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].residual == 22183, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].residual, expected 22183, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].stddev == 42, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].stddev, expected 42, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].sv_id.constellation == 45, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].sv_id.constellation, expected 45, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].sv_id.satId == 237, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].sv_id.satId, expected 237, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].residual == -5463, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].residual, expected -5463, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].stddev == 220, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].stddev, expected 220, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].sv_id.constellation == 224, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].sv_id.constellation, expected 224, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].sv_id.satId == 116, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].sv_id.satId, expected 116, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].residual == 3346, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].residual, expected 3346, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].stddev == 178, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].stddev, expected 178, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].sv_id.constellation == 176, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].sv_id.constellation, expected 176, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].sv_id.satId == 23, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].sv_id.satId, expected 23, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].residual == 28320, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].residual, expected 28320, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].stddev == 15, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].stddev, expected 15, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].sv_id.constellation == 160, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].sv_id.constellation, expected 160, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].sv_id.satId == 79, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].sv_id.satId, expected 79, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].residual == -24937, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].residual, expected -24937, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].stddev == 22, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].stddev, expected 22, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].sv_id.constellation == 206, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].sv_id.constellation, expected 206, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].sv_id.satId == 53, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].sv_id.satId, expected 53, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].residual == -21968, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].residual, expected -21968, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].stddev == 82, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].stddev, expected 82, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].sv_id.constellation == 184, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].sv_id.constellation, expected 184, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].sv_id.satId == 117, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].sv_id.satId, expected 117, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].residual == 17786, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].residual, expected 17786, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].stddev == 180, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].stddev, expected 180, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].sv_id.constellation == 53, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].sv_id.constellation, expected 53, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].sv_id.satId == 40, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].sv_id.satId, expected 40, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].residual == 26689, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].residual, expected 26689, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].stddev == 244, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].stddev, expected 244, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].sv_id.constellation == 38, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].sv_id.constellation, expected 38, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].sv_id.satId == 110, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].sv_id.satId, expected 110, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].residual == 22755, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].residual, expected 22755, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].stddev == 169, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].stddev, expected 169, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].sv_id.constellation == 238, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].sv_id.constellation, expected 238, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].sv_id.satId == 19, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].sv_id.satId, expected 19, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].residual == 9535, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].residual, expected 9535, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].stddev == 183, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].stddev, expected 183, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].sv_id.constellation == 146, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].sv_id.constellation, expected 146, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].sv_id.satId == 164, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].sv_id.satId, expected 164, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].residual == -22293, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].residual, expected -22293, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].stddev == 114, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].stddev, expected 114, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].sv_id.constellation == 71, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].sv_id.constellation, expected 71, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].sv_id.satId == 85, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].sv_id.satId, expected 85, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].residual == -25379, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].residual, expected -25379, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].stddev == 60, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].stddev, expected 60, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].sv_id.constellation == 105, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].sv_id.constellation, expected 105, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].sv_id.satId == 211, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].sv_id.satId, expected 211, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].residual == -29182, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].residual, expected -29182, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].stddev == 172, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].stddev, expected 172, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].sv_id.constellation == 230, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].sv_id.constellation, expected 230, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].sv_id.satId == 18, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].sv_id.satId, expected 18, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].residual == 32289, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].residual, expected 32289, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].stddev == 106, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].stddev, expected 106, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].sv_id.constellation == 39, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].sv_id.constellation, expected 39, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].sv_id.satId == 16, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].sv_id.satId, expected 16, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].residual == 10730, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].residual, expected 10730, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].stddev == 162, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].stddev, expected 162, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].sv_id.constellation == 188, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].sv_id.constellation, expected 188, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].sv_id.satId == 99, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].sv_id.satId, expected 99, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].residual == 20707, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].residual, expected 20707, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].stddev == 12, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].stddev, expected 12, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].sv_id.constellation == 138, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].sv_id.constellation, expected 138, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].sv_id.satId == 197, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].sv_id.satId, expected 197, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].residual == 1518, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].residual, expected 1518, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].stddev == 93, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].stddev, expected 93, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].sv_id.constellation == 67, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].sv_id.constellation, expected 67, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].sv_id.satId == 54, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].sv_id.satId, expected 54, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].residual == 3457, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].residual, expected 3457, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].stddev == 46, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].stddev, expected 46, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].sv_id.constellation == 207, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].sv_id.constellation, expected 207, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].sv_id.satId == 1, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].sv_id.satId, expected 1, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].residual == -18118, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].residual, expected -18118, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].stddev == 127, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].stddev, expected 127, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].sv_id.constellation == 49, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].sv_id.constellation, expected 49, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].sv_id.satId == 115, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].sv_id.satId, expected 115, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].residual == -9888, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].residual, expected -9888, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].stddev == 202, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].stddev, expected 202, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].sv_id.constellation == 200, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].sv_id.constellation, expected 200, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].sv_id.satId == 156, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].sv_id.satId, expected 156, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].residual == -14793, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].residual, expected -14793, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].stddev == 81, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].stddev, expected 81, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].sv_id.constellation == 245, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].sv_id.constellation, expected 245, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].sv_id.satId == 15, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].sv_id.satId, expected 15, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].residual == 18758, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].residual, expected 18758, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].stddev == 82, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].stddev, expected 82, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].sv_id.constellation == 132, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].sv_id.constellation, expected 132, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].sv_id.satId == 218, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].sv_id.satId, expected 218, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].residual == 3839, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].residual, expected 3839, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].stddev == 134, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].stddev, expected 134, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].sv_id.constellation == 26, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].sv_id.constellation, expected 26, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].sv_id.satId == 147, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].sv_id.satId, expected 147, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].residual == -10697, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].residual, expected -10697, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].stddev == 83, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].stddev, expected 83, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].sv_id.constellation == 138, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].sv_id.constellation, expected 138, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].sv_id.satId == 96, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].sv_id.satId, expected 96, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].residual == 20387, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].residual, expected 20387, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].stddev == 173, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].stddev, expected 173, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].sv_id.constellation == 170, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].sv_id.constellation, expected 170, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].sv_id.satId == 156, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].sv_id.satId, expected 156, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].residual == -3789, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].residual, expected -3789, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].stddev == 107, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].stddev, expected 107, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].sv_id.constellation == 115, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].sv_id.constellation, expected 115, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].sv_id.satId == 228, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].sv_id.satId, expected 228, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].residual == -11608, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].residual, expected -11608, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].stddev == 10, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].stddev, expected 10, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].sv_id.constellation == 112, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].sv_id.constellation, expected 112, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].sv_id.satId == 245, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].sv_id.satId, expected 245, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].residual == 14593, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].residual, expected 14593, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].stddev == 108, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].stddev, expected 108, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].sv_id.constellation == 117, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].sv_id.constellation, expected 117, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].sv_id.satId == 5, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].sv_id.satId, expected 5, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].residual == 30609, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].residual, expected 30609, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].stddev == 226, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].stddev, expected 226, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].sv_id.constellation == 212, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].sv_id.constellation, expected 212, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].sv_id.satId == 248, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].sv_id.satId, expected 248, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].residual == -13683, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].residual, expected -13683, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].stddev == 106, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].stddev, expected 106, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].sv_id.constellation == 5, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].sv_id.constellation, expected 5, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].sv_id.satId == 165, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].sv_id.satId, expected 165, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].residual == 15652, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].residual, expected 15652, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].stddev == 243, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].stddev, expected 243, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].sv_id.constellation == 60, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].sv_id.constellation, expected 60, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].sv_id.satId == 0, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].sv_id.satId, expected 0, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].residual == 3287, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].residual, expected 3287, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].stddev == 137, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].stddev, expected 137, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].sv_id.constellation == 216, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].sv_id.constellation, expected 216, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].sv_id.satId == 203, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].sv_id.satId, expected 203, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].residual == 29687, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].residual, expected 29687, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].stddev == 152, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].stddev, expected 152, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].sv_id.constellation == 28, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].sv_id.constellation, expected 28, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].sv_id.satId == 16, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].sv_id.satId, expected 16, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].residual == -6960, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].residual, expected -6960, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].stddev == 203, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].stddev, expected 203, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].sv_id.constellation == 119, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].sv_id.constellation, expected 119, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].sv_id.satId == 181, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].sv_id.satId, expected 181, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].residual == -15193, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].residual, expected -15193, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].stddev == 32, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].stddev, expected 32, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].sv_id.constellation == 34, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].sv_id.constellation, expected 34, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].sv_id.satId == 236, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].sv_id.satId, expected 236, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].residual == 25873, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].residual, expected 25873, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].stddev == 200, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].stddev, expected 200, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].sv_id.constellation == 1, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].sv_id.constellation, expected 1, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].sv_id.satId == 109, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].sv_id.satId, expected 109, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].residual == -22403, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].residual, expected -22403, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].stddev == 137, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].stddev, expected 137, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].sv_id.constellation == 94, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].sv_id.constellation, expected 94, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].sv_id.satId == 25, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].sv_id.satId, expected 25, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].residual == 7588, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].residual, expected 7588, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].stddev == 31, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].stddev, expected 31, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].sv_id.constellation == 4, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].sv_id.constellation, expected 4, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].sv_id.satId == 157, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].sv_id.satId, expected 157, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].residual == -6840, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].residual, expected -6840, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].stddev == 126, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].stddev, expected 126, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].sv_id.constellation == 132, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].sv_id.constellation, expected 132, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].sv_id.satId == 48, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].sv_id.satId, expected 48, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].residual == -31412, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].residual, expected -31412, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].stddev == 21, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].stddev, expected 21, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].sv_id.constellation == 68, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].sv_id.constellation, expected 68, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].sv_id.satId == 186, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].sv_id.satId, expected 186, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].residual == -23413, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].residual, expected -23413, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].stddev == 148, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].stddev, expected 148, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].sv_id.constellation == 180, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].sv_id.constellation, expected 180, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].sv_id.satId == 0, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].sv_id.satId, expected 0, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].residual == 30934, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].residual, expected 30934, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].stddev == 177, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].stddev, expected 177, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].sv_id.constellation == 149, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].sv_id.constellation, expected 149, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].sv_id.satId == 119, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].sv_id.satId, expected 119, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].residual == 26960, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].residual, expected 26960, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].stddev == 10, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].stddev, expected 10, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].sv_id.constellation == 80, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].sv_id.constellation, expected 80, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].sv_id.satId == 201, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].sv_id.satId, expected 201, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].residual == 11853, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].residual, expected 11853, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].stddev == 233, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].stddev, expected 233, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].sv_id.constellation == 118, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].sv_id.constellation, expected 118, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].sv_id.satId == 136, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].sv_id.satId, expected 136, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].residual == -25077, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].residual, expected -25077, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].residual); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].stddev == 103, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].stddev, expected 103, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].stddev); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].sv_id.constellation == 227, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].sv_id.constellation, expected 227, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].sv_id.satId == 233, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].sv_id.satId, expected 233, is %d", last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].sv_id.satId); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_correction.hydro == 10643, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_correction.hydro, expected 10643, is %d", last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_correction.hydro); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_correction.stddev == 92, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_correction.stddev, expected 92, is %d", last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_correction.stddev); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_correction.wet == 33, "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_correction.wet, expected 33, is %d", last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_correction.wet); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrGriddedCorrectionDepA, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.header.iod_atmo == 245, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.header.iod_atmo, expected " + "245, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.header.iod_atmo); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.header.num_msgs == 37695, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.header.num_msgs, expected " + "37695, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.header.num_msgs); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.header.seq_num == 64616, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.header.seq_num, expected " + "64616, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.header.seq_num); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.header.time.tow == 892131748, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.header.time.tow, expected " + "892131748, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.header.time.tow); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.header.time.wn == 23906, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.header.time.wn, expected " + "23906, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.header.time.wn); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.header + .tropo_quality_indicator == 28, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.header.tropo_" + "quality_indicator, expected 28, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.header + .tropo_quality_indicator); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.header.update_interval == 133, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.header.update_interval, " + "expected 133, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.header.update_interval); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.index == 25695, + "incorrect value for last_msg.msg.ssr_gridded_correction_dep_a.index, " + "expected 25695, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.index); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.n_stec_residuals == 47, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.n_stec_residuals, expected " + "47, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.n_stec_residuals); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].residual == + -26738, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].residual, " + "expected -26738, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].stddev == + 74, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].stddev, " + "expected 74, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0] + .sv_id.constellation == 25, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0]." + "sv_id.constellation, expected 25, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0] + .sv_id.satId == 87, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0]." + "sv_id.satId, expected 87, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[0] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].residual == + 1886, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].residual, " + "expected 1886, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].stddev == + 146, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].stddev, " + "expected 146, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1] + .sv_id.constellation == 95, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1]." + "sv_id.constellation, expected 95, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1] + .sv_id.satId == 151, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1]." + "sv_id.satId, expected 151, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[1] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].residual == + 22183, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].residual, " + "expected 22183, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].stddev == + 42, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].stddev, " + "expected 42, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2] + .sv_id.constellation == 45, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2]." + "sv_id.constellation, expected 45, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2] + .sv_id.satId == 237, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2]." + "sv_id.satId, expected 237, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[2] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].residual == + -5463, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].residual, " + "expected -5463, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].stddev == + 220, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].stddev, " + "expected 220, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3] + .sv_id.constellation == 224, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3]." + "sv_id.constellation, expected 224, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3] + .sv_id.satId == 116, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3]." + "sv_id.satId, expected 116, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[3] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].residual == + 3346, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].residual, " + "expected 3346, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].stddev == + 178, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].stddev, " + "expected 178, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4] + .sv_id.constellation == 176, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4]." + "sv_id.constellation, expected 176, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4] + .sv_id.satId == 23, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4]." + "sv_id.satId, expected 23, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[4] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].residual == + 28320, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].residual, " + "expected 28320, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].stddev == + 15, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].stddev, " + "expected 15, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5] + .sv_id.constellation == 160, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5]." + "sv_id.constellation, expected 160, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5] + .sv_id.satId == 79, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5]." + "sv_id.satId, expected 79, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[5] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].residual == + -24937, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].residual, " + "expected -24937, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].stddev == + 22, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].stddev, " + "expected 22, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6] + .sv_id.constellation == 206, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6]." + "sv_id.constellation, expected 206, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6] + .sv_id.satId == 53, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6]." + "sv_id.satId, expected 53, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[6] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].residual == + -21968, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].residual, " + "expected -21968, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].stddev == + 82, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].stddev, " + "expected 82, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7] + .sv_id.constellation == 184, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7]." + "sv_id.constellation, expected 184, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7] + .sv_id.satId == 117, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7]." + "sv_id.satId, expected 117, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[7] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].residual == + 17786, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].residual, " + "expected 17786, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].stddev == + 180, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].stddev, " + "expected 180, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8] + .sv_id.constellation == 53, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8]." + "sv_id.constellation, expected 53, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8] + .sv_id.satId == 40, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8]." + "sv_id.satId, expected 40, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[8] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].residual == + 26689, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].residual, " + "expected 26689, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].stddev == + 244, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].stddev, " + "expected 244, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9] + .sv_id.constellation == 38, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9]." + "sv_id.constellation, expected 38, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9] + .sv_id.satId == 110, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9]." + "sv_id.satId, expected 110, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[9] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].residual == + 22755, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].residual," + " expected 22755, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].stddev == + 169, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].stddev, " + "expected 169, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10] + .sv_id.constellation == 238, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10]" + ".sv_id.constellation, expected 238, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10] + .sv_id.satId == 19, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10]" + ".sv_id.satId, expected 19, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[10] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].residual == + 9535, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].residual," + " expected 9535, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].stddev == + 183, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].stddev, " + "expected 183, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11] + .sv_id.constellation == 146, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11]" + ".sv_id.constellation, expected 146, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11] + .sv_id.satId == 164, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11]" + ".sv_id.satId, expected 164, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[11] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].residual == + -22293, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].residual," + " expected -22293, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].stddev == + 114, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].stddev, " + "expected 114, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12] + .sv_id.constellation == 71, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12]" + ".sv_id.constellation, expected 71, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12] + .sv_id.satId == 85, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12]" + ".sv_id.satId, expected 85, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[12] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].residual == + -25379, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].residual," + " expected -25379, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].stddev == + 60, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].stddev, " + "expected 60, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13] + .sv_id.constellation == 105, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13]" + ".sv_id.constellation, expected 105, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13] + .sv_id.satId == 211, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13]" + ".sv_id.satId, expected 211, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[13] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].residual == + -29182, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].residual," + " expected -29182, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].stddev == + 172, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].stddev, " + "expected 172, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14] + .sv_id.constellation == 230, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14]" + ".sv_id.constellation, expected 230, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14] + .sv_id.satId == 18, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14]" + ".sv_id.satId, expected 18, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[14] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].residual == + 32289, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].residual," + " expected 32289, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].stddev == + 106, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].stddev, " + "expected 106, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15] + .sv_id.constellation == 39, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15]" + ".sv_id.constellation, expected 39, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15] + .sv_id.satId == 16, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15]" + ".sv_id.satId, expected 16, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[15] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].residual == + 10730, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].residual," + " expected 10730, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].stddev == + 162, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].stddev, " + "expected 162, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16] + .sv_id.constellation == 188, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16]" + ".sv_id.constellation, expected 188, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16] + .sv_id.satId == 99, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16]" + ".sv_id.satId, expected 99, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[16] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].residual == + 20707, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].residual," + " expected 20707, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].stddev == + 12, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].stddev, " + "expected 12, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17] + .sv_id.constellation == 138, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17]" + ".sv_id.constellation, expected 138, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17] + .sv_id.satId == 197, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17]" + ".sv_id.satId, expected 197, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[17] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].residual == + 1518, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].residual," + " expected 1518, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].stddev == + 93, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].stddev, " + "expected 93, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18] + .sv_id.constellation == 67, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18]" + ".sv_id.constellation, expected 67, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18] + .sv_id.satId == 54, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18]" + ".sv_id.satId, expected 54, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[18] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].residual == + 3457, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].residual," + " expected 3457, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].stddev == + 46, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].stddev, " + "expected 46, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19] + .sv_id.constellation == 207, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19]" + ".sv_id.constellation, expected 207, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19] + .sv_id.satId == 1, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19]" + ".sv_id.satId, expected 1, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[19] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].residual == + -18118, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].residual," + " expected -18118, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].stddev == + 127, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].stddev, " + "expected 127, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20] + .sv_id.constellation == 49, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20]" + ".sv_id.constellation, expected 49, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20] + .sv_id.satId == 115, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20]" + ".sv_id.satId, expected 115, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[20] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].residual == + -9888, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].residual," + " expected -9888, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].stddev == + 202, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].stddev, " + "expected 202, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21] + .sv_id.constellation == 200, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21]" + ".sv_id.constellation, expected 200, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21] + .sv_id.satId == 156, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21]" + ".sv_id.satId, expected 156, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[21] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].residual == + -14793, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].residual," + " expected -14793, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].stddev == + 81, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].stddev, " + "expected 81, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22] + .sv_id.constellation == 245, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22]" + ".sv_id.constellation, expected 245, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22] + .sv_id.satId == 15, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22]" + ".sv_id.satId, expected 15, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[22] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].residual == + 18758, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].residual," + " expected 18758, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].stddev == + 82, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].stddev, " + "expected 82, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23] + .sv_id.constellation == 132, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23]" + ".sv_id.constellation, expected 132, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23] + .sv_id.satId == 218, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23]" + ".sv_id.satId, expected 218, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[23] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].residual == + 3839, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].residual," + " expected 3839, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].stddev == + 134, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].stddev, " + "expected 134, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24] + .sv_id.constellation == 26, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24]" + ".sv_id.constellation, expected 26, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24] + .sv_id.satId == 147, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24]" + ".sv_id.satId, expected 147, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[24] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].residual == + -10697, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].residual," + " expected -10697, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].stddev == + 83, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].stddev, " + "expected 83, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25] + .sv_id.constellation == 138, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25]" + ".sv_id.constellation, expected 138, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25] + .sv_id.satId == 96, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25]" + ".sv_id.satId, expected 96, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[25] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].residual == + 20387, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].residual," + " expected 20387, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].stddev == + 173, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].stddev, " + "expected 173, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26] + .sv_id.constellation == 170, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26]" + ".sv_id.constellation, expected 170, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26] + .sv_id.satId == 156, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26]" + ".sv_id.satId, expected 156, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[26] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].residual == + -3789, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].residual," + " expected -3789, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].stddev == + 107, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].stddev, " + "expected 107, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27] + .sv_id.constellation == 115, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27]" + ".sv_id.constellation, expected 115, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27] + .sv_id.satId == 228, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27]" + ".sv_id.satId, expected 228, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[27] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].residual == + -11608, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].residual," + " expected -11608, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].stddev == + 10, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].stddev, " + "expected 10, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28] + .sv_id.constellation == 112, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28]" + ".sv_id.constellation, expected 112, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28] + .sv_id.satId == 245, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28]" + ".sv_id.satId, expected 245, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[28] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].residual == + 14593, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].residual," + " expected 14593, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].stddev == + 108, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].stddev, " + "expected 108, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29] + .sv_id.constellation == 117, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29]" + ".sv_id.constellation, expected 117, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29] + .sv_id.satId == 5, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29]" + ".sv_id.satId, expected 5, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[29] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].residual == + 30609, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].residual," + " expected 30609, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].stddev == + 226, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].stddev, " + "expected 226, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30] + .sv_id.constellation == 212, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30]" + ".sv_id.constellation, expected 212, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30] + .sv_id.satId == 248, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30]" + ".sv_id.satId, expected 248, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[30] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].residual == + -13683, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].residual," + " expected -13683, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].stddev == + 106, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].stddev, " + "expected 106, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31] + .sv_id.constellation == 5, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31]" + ".sv_id.constellation, expected 5, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31] + .sv_id.satId == 165, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31]" + ".sv_id.satId, expected 165, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[31] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].residual == + 15652, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].residual," + " expected 15652, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].stddev == + 243, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].stddev, " + "expected 243, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32] + .sv_id.constellation == 60, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32]" + ".sv_id.constellation, expected 60, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32] + .sv_id.satId == 0, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32]" + ".sv_id.satId, expected 0, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[32] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].residual == + 3287, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].residual," + " expected 3287, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].stddev == + 137, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].stddev, " + "expected 137, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33] + .sv_id.constellation == 216, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33]" + ".sv_id.constellation, expected 216, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33] + .sv_id.satId == 203, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33]" + ".sv_id.satId, expected 203, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[33] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].residual == + 29687, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].residual," + " expected 29687, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].stddev == + 152, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].stddev, " + "expected 152, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34] + .sv_id.constellation == 28, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34]" + ".sv_id.constellation, expected 28, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34] + .sv_id.satId == 16, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34]" + ".sv_id.satId, expected 16, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[34] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].residual == + -6960, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].residual," + " expected -6960, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].stddev == + 203, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].stddev, " + "expected 203, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35] + .sv_id.constellation == 119, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35]" + ".sv_id.constellation, expected 119, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35] + .sv_id.satId == 181, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35]" + ".sv_id.satId, expected 181, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[35] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].residual == + -15193, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].residual," + " expected -15193, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].stddev == + 32, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].stddev, " + "expected 32, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36] + .sv_id.constellation == 34, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36]" + ".sv_id.constellation, expected 34, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36] + .sv_id.satId == 236, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36]" + ".sv_id.satId, expected 236, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[36] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].residual == + 25873, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].residual," + " expected 25873, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].stddev == + 200, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].stddev, " + "expected 200, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37] + .sv_id.constellation == 1, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37]" + ".sv_id.constellation, expected 1, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37] + .sv_id.satId == 109, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37]" + ".sv_id.satId, expected 109, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[37] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].residual == + -22403, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].residual," + " expected -22403, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].stddev == + 137, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].stddev, " + "expected 137, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38] + .sv_id.constellation == 94, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38]" + ".sv_id.constellation, expected 94, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38] + .sv_id.satId == 25, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38]" + ".sv_id.satId, expected 25, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[38] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].residual == + 7588, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].residual," + " expected 7588, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].stddev == + 31, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].stddev, " + "expected 31, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39] + .sv_id.constellation == 4, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39]" + ".sv_id.constellation, expected 4, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39] + .sv_id.satId == 157, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39]" + ".sv_id.satId, expected 157, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[39] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].residual == + -6840, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].residual," + " expected -6840, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].stddev == + 126, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].stddev, " + "expected 126, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40] + .sv_id.constellation == 132, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40]" + ".sv_id.constellation, expected 132, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40] + .sv_id.satId == 48, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40]" + ".sv_id.satId, expected 48, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[40] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].residual == + -31412, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].residual," + " expected -31412, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].stddev == + 21, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].stddev, " + "expected 21, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41] + .sv_id.constellation == 68, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41]" + ".sv_id.constellation, expected 68, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41] + .sv_id.satId == 186, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41]" + ".sv_id.satId, expected 186, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[41] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].residual == + -23413, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].residual," + " expected -23413, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].stddev == + 148, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].stddev, " + "expected 148, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42] + .sv_id.constellation == 180, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42]" + ".sv_id.constellation, expected 180, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42] + .sv_id.satId == 0, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42]" + ".sv_id.satId, expected 0, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[42] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].residual == + 30934, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].residual," + " expected 30934, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].stddev == + 177, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].stddev, " + "expected 177, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43] + .sv_id.constellation == 149, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43]" + ".sv_id.constellation, expected 149, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43] + .sv_id.satId == 119, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43]" + ".sv_id.satId, expected 119, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[43] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].residual == + 26960, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].residual," + " expected 26960, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].stddev == + 10, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].stddev, " + "expected 10, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44] + .sv_id.constellation == 80, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44]" + ".sv_id.constellation, expected 80, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44] + .sv_id.satId == 201, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44]" + ".sv_id.satId, expected 201, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[44] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].residual == + 11853, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].residual," + " expected 11853, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].stddev == + 233, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].stddev, " + "expected 233, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45] + .sv_id.constellation == 118, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45]" + ".sv_id.constellation, expected 118, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45] + .sv_id.satId == 136, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45]" + ".sv_id.satId, expected 136, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[45] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].residual == + -25077, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].residual," + " expected -25077, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].stddev == + 103, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].stddev, " + "expected 103, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46].stddev); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46] + .sv_id.constellation == 227, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46]" + ".sv_id.constellation, expected 227, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46] + .sv_id.constellation); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46] + .sv_id.satId == 233, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46]" + ".sv_id.satId, expected 233, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.stec_residuals[46] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_correction + .hydro == 10643, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_correction." + "hydro, expected 10643, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_correction.hydro); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_dep_a + .tropo_delay_correction.stddev == 92, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_" + "correction.stddev, expected 92, is %d", + last_msg.msg.ssr_gridded_correction_dep_a + .tropo_delay_correction.stddev); + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_correction.wet == + 33, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_correction.wet, " + "expected 33, is %d", + last_msg.msg.ssr_gridded_correction_dep_a.tropo_delay_correction.wet); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA"); +Suite *auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.c b/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.c index ba6655127..2270b8e9e 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionNoStdDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionNoStdDepA.yaml +// by generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,981 +90,2304 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x5f0, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x5f0, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,240,5,102,28,254,179,240,33,169,236,34,117,245,67,248,233,236,230,230,103,122,63,101,231,157,115,162,197,146,35,107,222,109,52,41,86,12,237,184,65,204,137,148,171,183,11,0,180,203,172,53,196,85,186,115,203,92,166,30,42,13,200,71,98,137,219,160,95,216,95,250,99,196,92,214,159,253,195,222,233,146,233,63,76,24,106,40,253,65,9,183,40,215,188,59,117,69,97,115,60,56,0,141,207,171,54,161,23,61,0,87,230,123,87,36,184,255,14,163,187,224,43,151,151,104,39,57,5,54,48,224,181,129,60,92,171,114,109,109,12,23,118,8,64,159,54,216,33,20,24,68,160,36,38,222,145,190,92,99,108,159,232,240,227,221,253,15,62,23,121,185,168,116,4,147,123,72,223,119,226,242,161,204,180,202,137,166,58,24,124,19,181,188,16,107,66,231,63,1,64,252,115,62,233,97,250,86,156,221,49,178,32,73,198,67,249,253,74,56,38,165,119,92,99,44,95,131,89,192,225,55,95,171,88,205,21,116,231,83,71,71,100,110,217,254,152,212,18,8,40,157,244,54,72,240,231,189,111,195,205,81, }; + u8 encoded_frame[] = { + 85, 240, 5, 102, 28, 254, 179, 240, 33, 169, 236, 34, 117, 245, + 67, 248, 233, 236, 230, 230, 103, 122, 63, 101, 231, 157, 115, 162, + 197, 146, 35, 107, 222, 109, 52, 41, 86, 12, 237, 184, 65, 204, + 137, 148, 171, 183, 11, 0, 180, 203, 172, 53, 196, 85, 186, 115, + 203, 92, 166, 30, 42, 13, 200, 71, 98, 137, 219, 160, 95, 216, + 95, 250, 99, 196, 92, 214, 159, 253, 195, 222, 233, 146, 233, 63, + 76, 24, 106, 40, 253, 65, 9, 183, 40, 215, 188, 59, 117, 69, + 97, 115, 60, 56, 0, 141, 207, 171, 54, 161, 23, 61, 0, 87, + 230, 123, 87, 36, 184, 255, 14, 163, 187, 224, 43, 151, 151, 104, + 39, 57, 5, 54, 48, 224, 181, 129, 60, 92, 171, 114, 109, 109, + 12, 23, 118, 8, 64, 159, 54, 216, 33, 20, 24, 68, 160, 36, + 38, 222, 145, 190, 92, 99, 108, 159, 232, 240, 227, 221, 253, 15, + 62, 23, 121, 185, 168, 116, 4, 147, 123, 72, 223, 119, 226, 242, + 161, 204, 180, 202, 137, 166, 58, 24, 124, 19, 181, 188, 16, 107, + 66, 231, 63, 1, 64, 252, 115, 62, 233, 97, 250, 86, 156, 221, + 49, 178, 32, 73, 198, 67, 249, 253, 74, 56, 38, 165, 119, 92, + 99, 44, 95, 131, 89, 192, 225, 55, 95, 171, 88, 205, 21, 116, + 231, 83, 71, 71, 100, 110, 217, 254, 152, 212, 18, 8, 40, 157, + 244, 54, 72, 240, 231, 189, 111, 195, 205, 81, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ssr_gridded_correction_no_std_dep_a.header.iod_atmo = 236; - + test_msg.ssr_gridded_correction_no_std_dep_a.header.num_msgs = 62837; - + test_msg.ssr_gridded_correction_no_std_dep_a.header.seq_num = 63555; - - + test_msg.ssr_gridded_correction_no_std_dep_a.header.time.tow = 2837573811; - + test_msg.ssr_gridded_correction_no_std_dep_a.header.time.wn = 8940; - - test_msg.ssr_gridded_correction_no_std_dep_a.header.tropo_quality_indicator = 230; - + + test_msg.ssr_gridded_correction_no_std_dep_a.header + .tropo_quality_indicator = 230; + test_msg.ssr_gridded_correction_no_std_dep_a.header.update_interval = 233; - + test_msg.ssr_gridded_correction_no_std_dep_a.index = 26598; - + test_msg.ssr_gridded_correction_no_std_dep_a.n_stec_residuals = 59; - - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].residual = -23949; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].sv_id.constellation = 157; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].sv_id.satId = 231; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].residual = 27427; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].sv_id.constellation = 146; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].sv_id.satId = 197; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].residual = 10548; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].sv_id.constellation = 109; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].sv_id.satId = 222; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].residual = -18195; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].sv_id.constellation = 12; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].sv_id.satId = 86; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].residual = -27511; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].sv_id.constellation = 204; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].sv_id.satId = 65; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].residual = 11; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].sv_id.constellation = 183; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].sv_id.satId = 171; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].residual = 13740; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].sv_id.constellation = 203; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].sv_id.satId = 180; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].residual = 29626; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].sv_id.constellation = 85; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].sv_id.satId = 196; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].residual = 7846; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].sv_id.constellation = 92; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].sv_id.satId = 203; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].residual = 18376; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].sv_id.constellation = 13; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].sv_id.satId = 42; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10].residual = -24357; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10].sv_id.constellation = 137; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10].sv_id.satId = 98; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11].residual = -1441; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11].sv_id.constellation = 216; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11].sv_id.satId = 95; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12].residual = -10660; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12].sv_id.constellation = 196; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12].sv_id.satId = 99; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13].residual = -8509; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13].sv_id.constellation = 253; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13].sv_id.satId = 159; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14].residual = 16361; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14].sv_id.constellation = 146; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14].sv_id.satId = 233; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15].residual = 10346; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15].sv_id.constellation = 24; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15].sv_id.satId = 76; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16].residual = -18679; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16].sv_id.constellation = 65; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16].sv_id.satId = 253; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17].residual = 15292; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17].sv_id.constellation = 215; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17].sv_id.satId = 40; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18].residual = 29537; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18].sv_id.constellation = 69; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18].sv_id.satId = 117; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19].residual = -29440; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19].sv_id.constellation = 56; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19].sv_id.satId = 60; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20].residual = -24266; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20].sv_id.constellation = 171; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20].sv_id.satId = 207; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21].residual = 22272; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21].sv_id.constellation = 61; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21].sv_id.satId = 23; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22].residual = 9303; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22].sv_id.constellation = 123; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22].sv_id.satId = 230; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23].residual = -23794; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23].sv_id.constellation = 255; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23].sv_id.satId = 184; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24].residual = -26837; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24].sv_id.constellation = 224; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24].sv_id.satId = 187; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25].residual = 14631; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25].sv_id.constellation = 104; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25].sv_id.satId = 151; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26].residual = -8144; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26].sv_id.constellation = 54; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26].sv_id.satId = 5; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27].residual = 23612; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27].sv_id.constellation = 129; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27].sv_id.satId = 181; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28].residual = 28013; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28].sv_id.constellation = 114; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28].sv_id.satId = 171; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29].residual = 2166; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29].sv_id.constellation = 23; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29].sv_id.satId = 12; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30].residual = -10186; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30].sv_id.constellation = 159; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30].sv_id.satId = 64; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31].residual = 17432; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31].sv_id.constellation = 20; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31].sv_id.satId = 33; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32].residual = -8666; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32].sv_id.constellation = 36; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32].sv_id.satId = 160; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33].residual = 25436; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33].sv_id.constellation = 190; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33].sv_id.satId = 145; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34].residual = -3864; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34].sv_id.constellation = 159; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34].sv_id.satId = 108; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35].residual = 4093; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35].sv_id.constellation = 221; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35].sv_id.satId = 227; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36].residual = -18055; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36].sv_id.constellation = 23; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36].sv_id.satId = 62; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37].residual = -27900; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37].sv_id.constellation = 116; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37].sv_id.satId = 168; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38].residual = 30687; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38].sv_id.constellation = 72; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38].sv_id.satId = 123; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39].residual = -13151; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39].sv_id.constellation = 242; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39].sv_id.satId = 226; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40].residual = -22903; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40].sv_id.constellation = 202; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40].sv_id.satId = 180; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41].residual = 4988; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41].sv_id.constellation = 24; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41].sv_id.satId = 58; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42].residual = 27408; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42].sv_id.constellation = 188; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42].sv_id.satId = 181; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43].residual = 319; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43].sv_id.constellation = 231; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43].sv_id.satId = 66; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44].residual = 15987; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44].sv_id.constellation = 252; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44].sv_id.satId = 64; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45].residual = 22266; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45].sv_id.constellation = 97; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45].sv_id.satId = 233; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46].residual = -19919; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46].sv_id.constellation = 221; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46].sv_id.satId = 156; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47].residual = 17350; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47].sv_id.constellation = 73; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47].sv_id.satId = 32; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48].residual = 14410; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48].sv_id.constellation = 253; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48].sv_id.satId = 249; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49].residual = 23671; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49].sv_id.constellation = 165; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49].sv_id.satId = 38; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50].residual = -31905; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50].sv_id.constellation = 44; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50].sv_id.satId = 99; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51].residual = 14305; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51].sv_id.constellation = 192; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51].sv_id.satId = 89; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52].residual = -12968; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52].sv_id.constellation = 171; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52].sv_id.satId = 95; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53].residual = 21479; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53].sv_id.constellation = 116; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53].sv_id.satId = 21; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54].residual = 28260; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54].sv_id.constellation = 71; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54].sv_id.satId = 71; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55].residual = -11112; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55].sv_id.constellation = 254; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55].sv_id.satId = 217; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56].residual = -25304; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56].sv_id.constellation = 8; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56].sv_id.satId = 18; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57].residual = -4024; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57].sv_id.constellation = 54; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57].sv_id.satId = 244; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58].residual = -15505; - - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58].sv_id.constellation = 189; - - test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58].sv_id.satId = 231; - - - test_msg.ssr_gridded_correction_no_std_dep_a.tropo_delay_correction.hydro = 16250; - - test_msg.ssr_gridded_correction_no_std_dep_a.tropo_delay_correction.wet = 101; - - sbp_message_send(&sbp_state, SbpMsgSsrGriddedCorrectionNoStdDepA, 7270, &test_msg, &dummy_write); + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].residual = + -23949; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0] + .sv_id.constellation = 157; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].sv_id.satId = + 231; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].residual = + 27427; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1] + .sv_id.constellation = 146; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].sv_id.satId = + 197; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].residual = + 10548; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2] + .sv_id.constellation = 109; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].sv_id.satId = + 222; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].residual = + -18195; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3] + .sv_id.constellation = 12; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].sv_id.satId = + 86; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].residual = + -27511; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4] + .sv_id.constellation = 204; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].sv_id.satId = + 65; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].residual = + 11; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5] + .sv_id.constellation = 183; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].sv_id.satId = + 171; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].residual = + 13740; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6] + .sv_id.constellation = 203; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].sv_id.satId = + 180; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].residual = + 29626; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7] + .sv_id.constellation = 85; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].sv_id.satId = + 196; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].residual = + 7846; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8] + .sv_id.constellation = 92; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].sv_id.satId = + 203; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].residual = + 18376; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9] + .sv_id.constellation = 13; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].sv_id.satId = + 42; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10].residual = + -24357; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10] + .sv_id.constellation = 137; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10] + .sv_id.satId = 98; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11].residual = + -1441; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11] + .sv_id.constellation = 216; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11] + .sv_id.satId = 95; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12].residual = + -10660; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12] + .sv_id.constellation = 196; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12] + .sv_id.satId = 99; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13].residual = + -8509; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13] + .sv_id.constellation = 253; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13] + .sv_id.satId = 159; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14].residual = + 16361; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14] + .sv_id.constellation = 146; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14] + .sv_id.satId = 233; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15].residual = + 10346; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15] + .sv_id.constellation = 24; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15] + .sv_id.satId = 76; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16].residual = + -18679; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16] + .sv_id.constellation = 65; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16] + .sv_id.satId = 253; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17].residual = + 15292; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17] + .sv_id.constellation = 215; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17] + .sv_id.satId = 40; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18].residual = + 29537; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18] + .sv_id.constellation = 69; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18] + .sv_id.satId = 117; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19].residual = + -29440; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19] + .sv_id.constellation = 56; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19] + .sv_id.satId = 60; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20].residual = + -24266; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20] + .sv_id.constellation = 171; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20] + .sv_id.satId = 207; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21].residual = + 22272; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21] + .sv_id.constellation = 61; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21] + .sv_id.satId = 23; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22].residual = + 9303; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22] + .sv_id.constellation = 123; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22] + .sv_id.satId = 230; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23].residual = + -23794; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23] + .sv_id.constellation = 255; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23] + .sv_id.satId = 184; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24].residual = + -26837; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24] + .sv_id.constellation = 224; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24] + .sv_id.satId = 187; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25].residual = + 14631; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25] + .sv_id.constellation = 104; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25] + .sv_id.satId = 151; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26].residual = + -8144; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26] + .sv_id.constellation = 54; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26] + .sv_id.satId = 5; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27].residual = + 23612; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27] + .sv_id.constellation = 129; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27] + .sv_id.satId = 181; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28].residual = + 28013; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28] + .sv_id.constellation = 114; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28] + .sv_id.satId = 171; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29].residual = + 2166; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29] + .sv_id.constellation = 23; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29] + .sv_id.satId = 12; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30].residual = + -10186; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30] + .sv_id.constellation = 159; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30] + .sv_id.satId = 64; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31].residual = + 17432; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31] + .sv_id.constellation = 20; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31] + .sv_id.satId = 33; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32].residual = + -8666; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32] + .sv_id.constellation = 36; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32] + .sv_id.satId = 160; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33].residual = + 25436; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33] + .sv_id.constellation = 190; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33] + .sv_id.satId = 145; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34].residual = + -3864; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34] + .sv_id.constellation = 159; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34] + .sv_id.satId = 108; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35].residual = + 4093; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35] + .sv_id.constellation = 221; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35] + .sv_id.satId = 227; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36].residual = + -18055; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36] + .sv_id.constellation = 23; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36] + .sv_id.satId = 62; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37].residual = + -27900; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37] + .sv_id.constellation = 116; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37] + .sv_id.satId = 168; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38].residual = + 30687; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38] + .sv_id.constellation = 72; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38] + .sv_id.satId = 123; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39].residual = + -13151; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39] + .sv_id.constellation = 242; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39] + .sv_id.satId = 226; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40].residual = + -22903; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40] + .sv_id.constellation = 202; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40] + .sv_id.satId = 180; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41].residual = + 4988; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41] + .sv_id.constellation = 24; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41] + .sv_id.satId = 58; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42].residual = + 27408; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42] + .sv_id.constellation = 188; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42] + .sv_id.satId = 181; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43].residual = + 319; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43] + .sv_id.constellation = 231; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43] + .sv_id.satId = 66; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44].residual = + 15987; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44] + .sv_id.constellation = 252; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44] + .sv_id.satId = 64; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45].residual = + 22266; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45] + .sv_id.constellation = 97; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45] + .sv_id.satId = 233; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46].residual = + -19919; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46] + .sv_id.constellation = 221; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46] + .sv_id.satId = 156; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47].residual = + 17350; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47] + .sv_id.constellation = 73; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47] + .sv_id.satId = 32; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48].residual = + 14410; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48] + .sv_id.constellation = 253; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48] + .sv_id.satId = 249; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49].residual = + 23671; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49] + .sv_id.constellation = 165; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49] + .sv_id.satId = 38; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50].residual = + -31905; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50] + .sv_id.constellation = 44; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50] + .sv_id.satId = 99; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51].residual = + 14305; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51] + .sv_id.constellation = 192; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51] + .sv_id.satId = 89; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52].residual = + -12968; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52] + .sv_id.constellation = 171; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52] + .sv_id.satId = 95; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53].residual = + 21479; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53] + .sv_id.constellation = 116; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53] + .sv_id.satId = 21; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54].residual = + 28260; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54] + .sv_id.constellation = 71; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54] + .sv_id.satId = 71; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55].residual = + -11112; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55] + .sv_id.constellation = 254; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55] + .sv_id.satId = 217; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56].residual = + -25304; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56] + .sv_id.constellation = 8; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56] + .sv_id.satId = 18; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57].residual = + -4024; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57] + .sv_id.constellation = 54; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57] + .sv_id.satId = 244; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58].residual = + -15505; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58] + .sv_id.constellation = 189; + + test_msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58] + .sv_id.satId = 231; + + test_msg.ssr_gridded_correction_no_std_dep_a.tropo_delay_correction.hydro = + 16250; + + test_msg.ssr_gridded_correction_no_std_dep_a.tropo_delay_correction.wet = + 101; + + sbp_message_send(&sbp_state, SbpMsgSsrGriddedCorrectionNoStdDepA, 7270, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 7270, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrGriddedCorrectionNoStdDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.iod_atmo == 236, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.iod_atmo, expected 236, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.iod_atmo); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.num_msgs == 62837, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.num_msgs, expected 62837, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.num_msgs); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.seq_num == 63555, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.seq_num, expected 63555, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.seq_num); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.time.tow == 2837573811, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.time.tow, expected 2837573811, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.time.tow); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.time.wn == 8940, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.time.wn, expected 8940, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.time.wn); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.tropo_quality_indicator == 230, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.tropo_quality_indicator, expected 230, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.tropo_quality_indicator); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.update_interval == 233, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.update_interval, expected 233, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.update_interval); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.index == 26598, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.index, expected 26598, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.index); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.n_stec_residuals == 59, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.n_stec_residuals, expected 59, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.n_stec_residuals); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].residual == -23949, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].residual, expected -23949, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].sv_id.constellation == 157, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].sv_id.constellation, expected 157, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].sv_id.satId == 231, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].sv_id.satId, expected 231, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].residual == 27427, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].residual, expected 27427, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].sv_id.constellation == 146, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].sv_id.constellation, expected 146, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].sv_id.satId == 197, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].sv_id.satId, expected 197, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].residual == 10548, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].residual, expected 10548, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].sv_id.constellation == 109, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].sv_id.constellation, expected 109, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].sv_id.satId == 222, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].sv_id.satId, expected 222, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].residual == -18195, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].residual, expected -18195, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].sv_id.constellation == 12, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].sv_id.constellation, expected 12, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].sv_id.satId == 86, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].sv_id.satId, expected 86, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].residual == -27511, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].residual, expected -27511, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].sv_id.constellation == 204, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].sv_id.constellation, expected 204, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].sv_id.satId == 65, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].sv_id.satId, expected 65, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].residual == 11, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].residual, expected 11, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].sv_id.constellation == 183, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].sv_id.constellation, expected 183, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].sv_id.satId == 171, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].sv_id.satId, expected 171, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].residual == 13740, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].residual, expected 13740, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].sv_id.constellation == 203, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].sv_id.constellation, expected 203, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].sv_id.satId == 180, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].sv_id.satId, expected 180, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].residual == 29626, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].residual, expected 29626, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].sv_id.constellation == 85, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].sv_id.constellation, expected 85, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].sv_id.satId == 196, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].sv_id.satId, expected 196, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].residual == 7846, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].residual, expected 7846, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].sv_id.constellation == 92, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].sv_id.constellation, expected 92, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].sv_id.satId == 203, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].sv_id.satId, expected 203, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].residual == 18376, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].residual, expected 18376, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].sv_id.constellation == 13, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].sv_id.constellation, expected 13, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].sv_id.satId == 42, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].sv_id.satId, expected 42, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10].residual == -24357, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10].residual, expected -24357, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10].sv_id.constellation == 137, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10].sv_id.constellation, expected 137, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10].sv_id.satId == 98, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10].sv_id.satId, expected 98, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11].residual == -1441, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11].residual, expected -1441, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11].sv_id.constellation == 216, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11].sv_id.constellation, expected 216, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11].sv_id.satId == 95, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11].sv_id.satId, expected 95, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12].residual == -10660, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12].residual, expected -10660, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12].sv_id.constellation == 196, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12].sv_id.constellation, expected 196, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12].sv_id.satId == 99, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12].sv_id.satId, expected 99, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13].residual == -8509, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13].residual, expected -8509, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13].sv_id.constellation == 253, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13].sv_id.constellation, expected 253, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13].sv_id.satId == 159, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13].sv_id.satId, expected 159, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14].residual == 16361, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14].residual, expected 16361, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14].sv_id.constellation == 146, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14].sv_id.constellation, expected 146, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14].sv_id.satId == 233, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14].sv_id.satId, expected 233, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15].residual == 10346, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15].residual, expected 10346, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15].sv_id.constellation == 24, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15].sv_id.constellation, expected 24, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15].sv_id.satId == 76, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15].sv_id.satId, expected 76, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16].residual == -18679, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16].residual, expected -18679, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16].sv_id.constellation == 65, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16].sv_id.constellation, expected 65, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16].sv_id.satId == 253, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16].sv_id.satId, expected 253, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17].residual == 15292, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17].residual, expected 15292, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17].sv_id.constellation == 215, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17].sv_id.constellation, expected 215, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17].sv_id.satId == 40, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17].sv_id.satId, expected 40, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18].residual == 29537, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18].residual, expected 29537, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18].sv_id.constellation == 69, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18].sv_id.constellation, expected 69, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18].sv_id.satId == 117, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18].sv_id.satId, expected 117, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19].residual == -29440, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19].residual, expected -29440, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19].sv_id.constellation == 56, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19].sv_id.constellation, expected 56, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19].sv_id.satId == 60, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19].sv_id.satId, expected 60, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20].residual == -24266, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20].residual, expected -24266, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20].sv_id.constellation == 171, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20].sv_id.constellation, expected 171, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20].sv_id.satId == 207, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20].sv_id.satId, expected 207, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21].residual == 22272, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21].residual, expected 22272, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21].sv_id.constellation == 61, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21].sv_id.constellation, expected 61, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21].sv_id.satId == 23, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21].sv_id.satId, expected 23, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22].residual == 9303, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22].residual, expected 9303, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22].sv_id.constellation == 123, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22].sv_id.constellation, expected 123, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22].sv_id.satId == 230, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22].sv_id.satId, expected 230, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23].residual == -23794, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23].residual, expected -23794, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23].sv_id.constellation == 255, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23].sv_id.constellation, expected 255, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23].sv_id.satId == 184, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23].sv_id.satId, expected 184, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24].residual == -26837, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24].residual, expected -26837, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24].sv_id.constellation == 224, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24].sv_id.constellation, expected 224, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24].sv_id.satId == 187, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24].sv_id.satId, expected 187, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25].residual == 14631, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25].residual, expected 14631, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25].sv_id.constellation == 104, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25].sv_id.constellation, expected 104, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25].sv_id.satId == 151, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25].sv_id.satId, expected 151, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26].residual == -8144, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26].residual, expected -8144, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26].sv_id.constellation == 54, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26].sv_id.constellation, expected 54, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26].sv_id.satId == 5, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26].sv_id.satId, expected 5, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27].residual == 23612, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27].residual, expected 23612, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27].sv_id.constellation == 129, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27].sv_id.constellation, expected 129, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27].sv_id.satId == 181, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27].sv_id.satId, expected 181, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28].residual == 28013, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28].residual, expected 28013, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28].sv_id.constellation == 114, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28].sv_id.constellation, expected 114, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28].sv_id.satId == 171, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28].sv_id.satId, expected 171, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29].residual == 2166, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29].residual, expected 2166, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29].sv_id.constellation == 23, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29].sv_id.constellation, expected 23, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29].sv_id.satId == 12, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29].sv_id.satId, expected 12, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30].residual == -10186, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30].residual, expected -10186, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30].sv_id.constellation == 159, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30].sv_id.constellation, expected 159, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30].sv_id.satId == 64, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30].sv_id.satId, expected 64, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31].residual == 17432, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31].residual, expected 17432, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31].sv_id.constellation == 20, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31].sv_id.constellation, expected 20, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31].sv_id.satId == 33, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31].sv_id.satId, expected 33, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32].residual == -8666, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32].residual, expected -8666, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32].sv_id.constellation == 36, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32].sv_id.constellation, expected 36, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32].sv_id.satId == 160, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32].sv_id.satId, expected 160, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33].residual == 25436, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33].residual, expected 25436, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33].sv_id.constellation == 190, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33].sv_id.constellation, expected 190, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33].sv_id.satId == 145, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33].sv_id.satId, expected 145, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34].residual == -3864, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34].residual, expected -3864, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34].sv_id.constellation == 159, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34].sv_id.constellation, expected 159, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34].sv_id.satId == 108, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34].sv_id.satId, expected 108, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35].residual == 4093, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35].residual, expected 4093, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35].sv_id.constellation == 221, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35].sv_id.constellation, expected 221, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35].sv_id.satId == 227, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35].sv_id.satId, expected 227, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36].residual == -18055, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36].residual, expected -18055, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36].sv_id.constellation == 23, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36].sv_id.constellation, expected 23, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36].sv_id.satId == 62, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36].sv_id.satId, expected 62, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37].residual == -27900, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37].residual, expected -27900, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37].sv_id.constellation == 116, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37].sv_id.constellation, expected 116, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37].sv_id.satId == 168, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37].sv_id.satId, expected 168, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38].residual == 30687, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38].residual, expected 30687, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38].sv_id.constellation == 72, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38].sv_id.constellation, expected 72, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38].sv_id.satId == 123, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38].sv_id.satId, expected 123, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39].residual == -13151, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39].residual, expected -13151, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39].sv_id.constellation == 242, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39].sv_id.constellation, expected 242, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39].sv_id.satId == 226, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39].sv_id.satId, expected 226, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40].residual == -22903, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40].residual, expected -22903, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40].sv_id.constellation == 202, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40].sv_id.constellation, expected 202, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40].sv_id.satId == 180, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40].sv_id.satId, expected 180, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41].residual == 4988, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41].residual, expected 4988, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41].sv_id.constellation == 24, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41].sv_id.constellation, expected 24, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41].sv_id.satId == 58, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41].sv_id.satId, expected 58, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42].residual == 27408, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42].residual, expected 27408, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42].sv_id.constellation == 188, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42].sv_id.constellation, expected 188, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42].sv_id.satId == 181, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42].sv_id.satId, expected 181, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43].residual == 319, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43].residual, expected 319, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43].sv_id.constellation == 231, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43].sv_id.constellation, expected 231, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43].sv_id.satId == 66, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43].sv_id.satId, expected 66, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44].residual == 15987, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44].residual, expected 15987, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44].sv_id.constellation == 252, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44].sv_id.constellation, expected 252, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44].sv_id.satId == 64, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44].sv_id.satId, expected 64, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45].residual == 22266, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45].residual, expected 22266, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45].sv_id.constellation == 97, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45].sv_id.constellation, expected 97, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45].sv_id.satId == 233, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45].sv_id.satId, expected 233, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46].residual == -19919, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46].residual, expected -19919, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46].sv_id.constellation == 221, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46].sv_id.constellation, expected 221, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46].sv_id.satId == 156, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46].sv_id.satId, expected 156, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47].residual == 17350, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47].residual, expected 17350, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47].sv_id.constellation == 73, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47].sv_id.constellation, expected 73, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47].sv_id.satId == 32, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47].sv_id.satId, expected 32, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48].residual == 14410, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48].residual, expected 14410, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48].sv_id.constellation == 253, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48].sv_id.constellation, expected 253, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48].sv_id.satId == 249, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48].sv_id.satId, expected 249, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49].residual == 23671, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49].residual, expected 23671, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49].sv_id.constellation == 165, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49].sv_id.constellation, expected 165, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49].sv_id.satId == 38, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49].sv_id.satId, expected 38, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50].residual == -31905, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50].residual, expected -31905, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50].sv_id.constellation == 44, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50].sv_id.constellation, expected 44, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50].sv_id.satId == 99, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50].sv_id.satId, expected 99, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51].residual == 14305, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51].residual, expected 14305, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51].sv_id.constellation == 192, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51].sv_id.constellation, expected 192, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51].sv_id.satId == 89, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51].sv_id.satId, expected 89, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52].residual == -12968, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52].residual, expected -12968, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52].sv_id.constellation == 171, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52].sv_id.constellation, expected 171, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52].sv_id.satId == 95, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52].sv_id.satId, expected 95, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53].residual == 21479, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53].residual, expected 21479, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53].sv_id.constellation == 116, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53].sv_id.constellation, expected 116, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53].sv_id.satId == 21, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53].sv_id.satId, expected 21, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54].residual == 28260, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54].residual, expected 28260, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54].sv_id.constellation == 71, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54].sv_id.constellation, expected 71, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54].sv_id.satId == 71, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54].sv_id.satId, expected 71, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55].residual == -11112, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55].residual, expected -11112, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55].sv_id.constellation == 254, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55].sv_id.constellation, expected 254, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55].sv_id.satId == 217, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55].sv_id.satId, expected 217, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56].residual == -25304, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56].residual, expected -25304, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56].sv_id.constellation == 8, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56].sv_id.constellation, expected 8, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56].sv_id.satId == 18, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56].sv_id.satId, expected 18, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57].residual == -4024, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57].residual, expected -4024, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57].sv_id.constellation == 54, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57].sv_id.constellation, expected 54, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57].sv_id.satId == 244, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57].sv_id.satId, expected 244, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58].residual == -15505, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58].residual, expected -15505, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58].residual); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58].sv_id.constellation == 189, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58].sv_id.constellation, expected 189, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58].sv_id.satId == 231, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58].sv_id.satId, expected 231, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58].sv_id.satId); - - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.tropo_delay_correction.hydro == 16250, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.tropo_delay_correction.hydro, expected 16250, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.tropo_delay_correction.hydro); - - ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.tropo_delay_correction.wet == 101, "incorrect value for last_msg.msg.ssr_gridded_correction_no_std_dep_a.tropo_delay_correction.wet, expected 101, is %d", last_msg.msg.ssr_gridded_correction_no_std_dep_a.tropo_delay_correction.wet); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrGriddedCorrectionNoStdDepA, + &last_msg.msg, &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.iod_atmo == 236, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.iod_atmo, " + "expected 236, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.iod_atmo); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.num_msgs == + 62837, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.num_msgs, " + "expected 62837, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.num_msgs); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.seq_num == + 63555, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.seq_num, " + "expected 63555, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.seq_num); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.time.tow == + 2837573811, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.time.tow, " + "expected 2837573811, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.time.tow); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.time.wn == 8940, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.time.wn, " + "expected 8940, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.header.time.wn); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.header + .tropo_quality_indicator == 230, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.header." + "tropo_quality_indicator, expected 230, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.header + .tropo_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a.header + .update_interval == 233, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.header." + "update_interval, expected 233, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.header + .update_interval); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.index == 26598, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.index, expected " + "26598, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.index); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.n_stec_residuals == 59, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.n_stec_residuals, " + "expected 59, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.n_stec_residuals); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0] + .residual == -23949, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0]." + "residual, expected -23949, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0] + .sv_id.constellation == 157, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].sv_" + "id.constellation, expected 157, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0] + .sv_id.satId == 231, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0].sv_" + "id.satId, expected 231, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[0] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1] + .residual == 27427, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1]." + "residual, expected 27427, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1] + .sv_id.constellation == 146, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].sv_" + "id.constellation, expected 146, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1] + .sv_id.satId == 197, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1].sv_" + "id.satId, expected 197, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[1] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2] + .residual == 10548, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2]." + "residual, expected 10548, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2] + .sv_id.constellation == 109, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].sv_" + "id.constellation, expected 109, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2] + .sv_id.satId == 222, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2].sv_" + "id.satId, expected 222, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[2] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3] + .residual == -18195, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3]." + "residual, expected -18195, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3] + .sv_id.constellation == 12, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].sv_" + "id.constellation, expected 12, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3] + .sv_id.satId == 86, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3].sv_" + "id.satId, expected 86, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[3] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4] + .residual == -27511, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4]." + "residual, expected -27511, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4] + .sv_id.constellation == 204, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].sv_" + "id.constellation, expected 204, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4] + .sv_id.satId == 65, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4].sv_" + "id.satId, expected 65, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[4] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5] + .residual == 11, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5]." + "residual, expected 11, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5] + .sv_id.constellation == 183, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].sv_" + "id.constellation, expected 183, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5] + .sv_id.satId == 171, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5].sv_" + "id.satId, expected 171, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[5] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6] + .residual == 13740, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6]." + "residual, expected 13740, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6] + .sv_id.constellation == 203, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].sv_" + "id.constellation, expected 203, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6] + .sv_id.satId == 180, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6].sv_" + "id.satId, expected 180, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[6] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7] + .residual == 29626, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7]." + "residual, expected 29626, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7] + .sv_id.constellation == 85, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].sv_" + "id.constellation, expected 85, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7] + .sv_id.satId == 196, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7].sv_" + "id.satId, expected 196, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[7] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8] + .residual == 7846, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8]." + "residual, expected 7846, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8] + .sv_id.constellation == 92, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].sv_" + "id.constellation, expected 92, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8] + .sv_id.satId == 203, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8].sv_" + "id.satId, expected 203, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[8] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9] + .residual == 18376, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9]." + "residual, expected 18376, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9] + .sv_id.constellation == 13, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].sv_" + "id.constellation, expected 13, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9] + .sv_id.satId == 42, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9].sv_" + "id.satId, expected 42, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[9] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10] + .residual == -24357, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10]." + "residual, expected -24357, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10] + .sv_id.constellation == 137, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10]." + "sv_id.constellation, expected 137, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10] + .sv_id.satId == 98, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10]." + "sv_id.satId, expected 98, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[10] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11] + .residual == -1441, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11]." + "residual, expected -1441, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11] + .sv_id.constellation == 216, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11]." + "sv_id.constellation, expected 216, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11] + .sv_id.satId == 95, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11]." + "sv_id.satId, expected 95, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[11] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12] + .residual == -10660, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12]." + "residual, expected -10660, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12] + .sv_id.constellation == 196, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12]." + "sv_id.constellation, expected 196, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12] + .sv_id.satId == 99, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12]." + "sv_id.satId, expected 99, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[12] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13] + .residual == -8509, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13]." + "residual, expected -8509, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13] + .sv_id.constellation == 253, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13]." + "sv_id.constellation, expected 253, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13] + .sv_id.satId == 159, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13]." + "sv_id.satId, expected 159, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[13] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14] + .residual == 16361, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14]." + "residual, expected 16361, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14] + .sv_id.constellation == 146, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14]." + "sv_id.constellation, expected 146, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14] + .sv_id.satId == 233, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14]." + "sv_id.satId, expected 233, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[14] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15] + .residual == 10346, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15]." + "residual, expected 10346, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15] + .sv_id.constellation == 24, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15]." + "sv_id.constellation, expected 24, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15] + .sv_id.satId == 76, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15]." + "sv_id.satId, expected 76, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[15] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16] + .residual == -18679, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16]." + "residual, expected -18679, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16] + .sv_id.constellation == 65, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16]." + "sv_id.constellation, expected 65, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16] + .sv_id.satId == 253, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16]." + "sv_id.satId, expected 253, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[16] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17] + .residual == 15292, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17]." + "residual, expected 15292, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17] + .sv_id.constellation == 215, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17]." + "sv_id.constellation, expected 215, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17] + .sv_id.satId == 40, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17]." + "sv_id.satId, expected 40, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[17] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18] + .residual == 29537, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18]." + "residual, expected 29537, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18] + .sv_id.constellation == 69, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18]." + "sv_id.constellation, expected 69, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18] + .sv_id.satId == 117, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18]." + "sv_id.satId, expected 117, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[18] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19] + .residual == -29440, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19]." + "residual, expected -29440, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19] + .sv_id.constellation == 56, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19]." + "sv_id.constellation, expected 56, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19] + .sv_id.satId == 60, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19]." + "sv_id.satId, expected 60, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[19] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20] + .residual == -24266, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20]." + "residual, expected -24266, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20] + .sv_id.constellation == 171, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20]." + "sv_id.constellation, expected 171, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20] + .sv_id.satId == 207, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20]." + "sv_id.satId, expected 207, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[20] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21] + .residual == 22272, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21]." + "residual, expected 22272, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21] + .sv_id.constellation == 61, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21]." + "sv_id.constellation, expected 61, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21] + .sv_id.satId == 23, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21]." + "sv_id.satId, expected 23, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[21] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22] + .residual == 9303, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22]." + "residual, expected 9303, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22] + .sv_id.constellation == 123, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22]." + "sv_id.constellation, expected 123, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22] + .sv_id.satId == 230, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22]." + "sv_id.satId, expected 230, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[22] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23] + .residual == -23794, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23]." + "residual, expected -23794, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23] + .sv_id.constellation == 255, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23]." + "sv_id.constellation, expected 255, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23] + .sv_id.satId == 184, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23]." + "sv_id.satId, expected 184, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[23] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24] + .residual == -26837, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24]." + "residual, expected -26837, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24] + .sv_id.constellation == 224, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24]." + "sv_id.constellation, expected 224, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24] + .sv_id.satId == 187, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24]." + "sv_id.satId, expected 187, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[24] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25] + .residual == 14631, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25]." + "residual, expected 14631, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25] + .sv_id.constellation == 104, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25]." + "sv_id.constellation, expected 104, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25] + .sv_id.satId == 151, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25]." + "sv_id.satId, expected 151, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[25] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26] + .residual == -8144, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26]." + "residual, expected -8144, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26] + .sv_id.constellation == 54, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26]." + "sv_id.constellation, expected 54, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26] + .sv_id.satId == 5, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26]." + "sv_id.satId, expected 5, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[26] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27] + .residual == 23612, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27]." + "residual, expected 23612, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27] + .sv_id.constellation == 129, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27]." + "sv_id.constellation, expected 129, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27] + .sv_id.satId == 181, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27]." + "sv_id.satId, expected 181, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[27] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28] + .residual == 28013, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28]." + "residual, expected 28013, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28] + .sv_id.constellation == 114, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28]." + "sv_id.constellation, expected 114, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28] + .sv_id.satId == 171, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28]." + "sv_id.satId, expected 171, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[28] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29] + .residual == 2166, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29]." + "residual, expected 2166, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29] + .sv_id.constellation == 23, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29]." + "sv_id.constellation, expected 23, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29] + .sv_id.satId == 12, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29]." + "sv_id.satId, expected 12, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[29] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30] + .residual == -10186, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30]." + "residual, expected -10186, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30] + .sv_id.constellation == 159, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30]." + "sv_id.constellation, expected 159, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30] + .sv_id.satId == 64, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30]." + "sv_id.satId, expected 64, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[30] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31] + .residual == 17432, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31]." + "residual, expected 17432, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31] + .sv_id.constellation == 20, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31]." + "sv_id.constellation, expected 20, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31] + .sv_id.satId == 33, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31]." + "sv_id.satId, expected 33, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[31] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32] + .residual == -8666, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32]." + "residual, expected -8666, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32] + .sv_id.constellation == 36, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32]." + "sv_id.constellation, expected 36, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32] + .sv_id.satId == 160, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32]." + "sv_id.satId, expected 160, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[32] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33] + .residual == 25436, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33]." + "residual, expected 25436, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33] + .sv_id.constellation == 190, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33]." + "sv_id.constellation, expected 190, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33] + .sv_id.satId == 145, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33]." + "sv_id.satId, expected 145, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[33] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34] + .residual == -3864, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34]." + "residual, expected -3864, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34] + .sv_id.constellation == 159, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34]." + "sv_id.constellation, expected 159, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34] + .sv_id.satId == 108, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34]." + "sv_id.satId, expected 108, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[34] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35] + .residual == 4093, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35]." + "residual, expected 4093, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35] + .sv_id.constellation == 221, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35]." + "sv_id.constellation, expected 221, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35] + .sv_id.satId == 227, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35]." + "sv_id.satId, expected 227, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[35] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36] + .residual == -18055, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36]." + "residual, expected -18055, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36] + .sv_id.constellation == 23, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36]." + "sv_id.constellation, expected 23, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36] + .sv_id.satId == 62, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36]." + "sv_id.satId, expected 62, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[36] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37] + .residual == -27900, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37]." + "residual, expected -27900, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37] + .sv_id.constellation == 116, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37]." + "sv_id.constellation, expected 116, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37] + .sv_id.satId == 168, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37]." + "sv_id.satId, expected 168, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[37] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38] + .residual == 30687, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38]." + "residual, expected 30687, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38] + .sv_id.constellation == 72, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38]." + "sv_id.constellation, expected 72, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38] + .sv_id.satId == 123, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38]." + "sv_id.satId, expected 123, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[38] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39] + .residual == -13151, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39]." + "residual, expected -13151, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39] + .sv_id.constellation == 242, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39]." + "sv_id.constellation, expected 242, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39] + .sv_id.satId == 226, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39]." + "sv_id.satId, expected 226, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[39] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40] + .residual == -22903, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40]." + "residual, expected -22903, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40] + .sv_id.constellation == 202, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40]." + "sv_id.constellation, expected 202, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40] + .sv_id.satId == 180, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40]." + "sv_id.satId, expected 180, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[40] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41] + .residual == 4988, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41]." + "residual, expected 4988, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41] + .sv_id.constellation == 24, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41]." + "sv_id.constellation, expected 24, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41] + .sv_id.satId == 58, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41]." + "sv_id.satId, expected 58, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[41] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42] + .residual == 27408, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42]." + "residual, expected 27408, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42] + .sv_id.constellation == 188, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42]." + "sv_id.constellation, expected 188, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42] + .sv_id.satId == 181, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42]." + "sv_id.satId, expected 181, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[42] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43] + .residual == 319, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43]." + "residual, expected 319, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43] + .sv_id.constellation == 231, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43]." + "sv_id.constellation, expected 231, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43] + .sv_id.satId == 66, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43]." + "sv_id.satId, expected 66, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[43] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44] + .residual == 15987, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44]." + "residual, expected 15987, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44] + .sv_id.constellation == 252, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44]." + "sv_id.constellation, expected 252, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44] + .sv_id.satId == 64, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44]." + "sv_id.satId, expected 64, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[44] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45] + .residual == 22266, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45]." + "residual, expected 22266, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45] + .sv_id.constellation == 97, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45]." + "sv_id.constellation, expected 97, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45] + .sv_id.satId == 233, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45]." + "sv_id.satId, expected 233, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[45] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46] + .residual == -19919, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46]." + "residual, expected -19919, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46] + .sv_id.constellation == 221, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46]." + "sv_id.constellation, expected 221, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46] + .sv_id.satId == 156, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46]." + "sv_id.satId, expected 156, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[46] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47] + .residual == 17350, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47]." + "residual, expected 17350, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47] + .sv_id.constellation == 73, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47]." + "sv_id.constellation, expected 73, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47] + .sv_id.satId == 32, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47]." + "sv_id.satId, expected 32, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[47] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48] + .residual == 14410, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48]." + "residual, expected 14410, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48] + .sv_id.constellation == 253, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48]." + "sv_id.constellation, expected 253, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48] + .sv_id.satId == 249, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48]." + "sv_id.satId, expected 249, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[48] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49] + .residual == 23671, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49]." + "residual, expected 23671, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49] + .sv_id.constellation == 165, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49]." + "sv_id.constellation, expected 165, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49] + .sv_id.satId == 38, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49]." + "sv_id.satId, expected 38, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[49] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50] + .residual == -31905, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50]." + "residual, expected -31905, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50] + .sv_id.constellation == 44, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50]." + "sv_id.constellation, expected 44, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50] + .sv_id.satId == 99, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50]." + "sv_id.satId, expected 99, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[50] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51] + .residual == 14305, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51]." + "residual, expected 14305, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51] + .sv_id.constellation == 192, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51]." + "sv_id.constellation, expected 192, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51] + .sv_id.satId == 89, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51]." + "sv_id.satId, expected 89, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[51] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52] + .residual == -12968, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52]." + "residual, expected -12968, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52] + .sv_id.constellation == 171, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52]." + "sv_id.constellation, expected 171, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52] + .sv_id.satId == 95, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52]." + "sv_id.satId, expected 95, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[52] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53] + .residual == 21479, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53]." + "residual, expected 21479, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53] + .sv_id.constellation == 116, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53]." + "sv_id.constellation, expected 116, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53] + .sv_id.satId == 21, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53]." + "sv_id.satId, expected 21, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[53] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54] + .residual == 28260, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54]." + "residual, expected 28260, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54] + .sv_id.constellation == 71, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54]." + "sv_id.constellation, expected 71, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54] + .sv_id.satId == 71, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54]." + "sv_id.satId, expected 71, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[54] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55] + .residual == -11112, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55]." + "residual, expected -11112, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55] + .sv_id.constellation == 254, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55]." + "sv_id.constellation, expected 254, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55] + .sv_id.satId == 217, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55]." + "sv_id.satId, expected 217, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[55] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56] + .residual == -25304, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56]." + "residual, expected -25304, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56] + .sv_id.constellation == 8, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56]." + "sv_id.constellation, expected 8, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56] + .sv_id.satId == 18, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56]." + "sv_id.satId, expected 18, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[56] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57] + .residual == -4024, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57]." + "residual, expected -4024, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57] + .sv_id.constellation == 54, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57]." + "sv_id.constellation, expected 54, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57] + .sv_id.satId == 244, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57]." + "sv_id.satId, expected 244, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[57] + .sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58] + .residual == -15505, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58]." + "residual, expected -15505, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58] + .residual); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58] + .sv_id.constellation == 189, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58]." + "sv_id.constellation, expected 189, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58] + .sv_id.satId == 231, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58]." + "sv_id.satId, expected 231, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a.stec_residuals[58] + .sv_id.satId); + + ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a + .tropo_delay_correction.hydro == 16250, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.tropo_" + "delay_correction.hydro, expected 16250, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a + .tropo_delay_correction.hydro); + ck_assert_msg(last_msg.msg.ssr_gridded_correction_no_std_dep_a + .tropo_delay_correction.wet == 101, + "incorrect value for " + "last_msg.msg.ssr_gridded_correction_no_std_dep_a.tropo_" + "delay_correction.wet, expected 101, is %d", + last_msg.msg.ssr_gridded_correction_no_std_dep_a + .tropo_delay_correction.wet); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA"); - tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA); +Suite *auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA"); + tcase_add_test(tc_acq, + test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/auto_check_sbp_ssr_MsgSsrOrbitClock.c b/c/test/auto_check_sbp_ssr_MsgSsrOrbitClock.c index 20b16e035..04548447a 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrOrbitClock.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrOrbitClock.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClock.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClock.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrOrbitClock ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrOrbitClock) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrOrbitClock ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,111 +90,168 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrOrbitClock ) logging_reset(); - sbp_callback_register(&sbp_state, 0x5dd, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x5dd, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,221,5,53,229,50,83,208,102,207,164,29,203,212,236,255,152,233,207,55,94,54,58,128,68,27,117,176,110,251,61,244,122,50,95,52,144,232,24,10,37,127,163,66,177,105,156,245,10,249,107,218,17,186,56,72,14,22, }; + u8 encoded_frame[] = { + 85, 221, 5, 53, 229, 50, 83, 208, 102, 207, 164, 29, + 203, 212, 236, 255, 152, 233, 207, 55, 94, 54, 58, 128, + 68, 27, 117, 176, 110, 251, 61, 244, 122, 50, 95, 52, + 144, 232, 24, 10, 37, 127, 163, 66, 177, 105, 156, 245, + 10, 249, 107, 218, 17, 186, 56, 72, 14, 22, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ssr_orbit_clock.along = -1334502588; - + test_msg.ssr_orbit_clock.c0 = -174298703; - + test_msg.ssr_orbit_clock.c1 = -630458102; - + test_msg.ssr_orbit_clock.c2 = 1211677201; - + test_msg.ssr_orbit_clock.cross = -197264530; - + test_msg.ssr_orbit_clock.dot_along = 169404560; - + test_msg.ssr_orbit_clock.dot_cross = 1118011173; - + test_msg.ssr_orbit_clock.dot_radial = 878654074; - + test_msg.ssr_orbit_clock.iod = 936372632; - + test_msg.ssr_orbit_clock.iod_ssr = 255; - + test_msg.ssr_orbit_clock.radial = -2143668642; - - + test_msg.ssr_orbit_clock.sid.code = 212; - + test_msg.ssr_orbit_clock.sid.sat = 203; - - + test_msg.ssr_orbit_clock.time.tow = 3479621715; - + test_msg.ssr_orbit_clock.time.wn = 7588; - + test_msg.ssr_orbit_clock.update_interval = 236; - sbp_message_send(&sbp_state, SbpMsgSsrOrbitClock, 58677, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrOrbitClock, 58677, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 58677, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSsrOrbitClock, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSsrOrbitClock, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.along == -1334502588, "incorrect value for last_msg.msg.ssr_orbit_clock.along, expected -1334502588, is %d", last_msg.msg.ssr_orbit_clock.along); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.c0 == -174298703, "incorrect value for last_msg.msg.ssr_orbit_clock.c0, expected -174298703, is %d", last_msg.msg.ssr_orbit_clock.c0); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.c1 == -630458102, "incorrect value for last_msg.msg.ssr_orbit_clock.c1, expected -630458102, is %d", last_msg.msg.ssr_orbit_clock.c1); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.c2 == 1211677201, "incorrect value for last_msg.msg.ssr_orbit_clock.c2, expected 1211677201, is %d", last_msg.msg.ssr_orbit_clock.c2); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.cross == -197264530, "incorrect value for last_msg.msg.ssr_orbit_clock.cross, expected -197264530, is %d", last_msg.msg.ssr_orbit_clock.cross); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.dot_along == 169404560, "incorrect value for last_msg.msg.ssr_orbit_clock.dot_along, expected 169404560, is %d", last_msg.msg.ssr_orbit_clock.dot_along); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.dot_cross == 1118011173, "incorrect value for last_msg.msg.ssr_orbit_clock.dot_cross, expected 1118011173, is %d", last_msg.msg.ssr_orbit_clock.dot_cross); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.dot_radial == 878654074, "incorrect value for last_msg.msg.ssr_orbit_clock.dot_radial, expected 878654074, is %d", last_msg.msg.ssr_orbit_clock.dot_radial); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.iod == 936372632, "incorrect value for last_msg.msg.ssr_orbit_clock.iod, expected 936372632, is %d", last_msg.msg.ssr_orbit_clock.iod); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.iod_ssr == 255, "incorrect value for last_msg.msg.ssr_orbit_clock.iod_ssr, expected 255, is %d", last_msg.msg.ssr_orbit_clock.iod_ssr); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.radial == -2143668642, "incorrect value for last_msg.msg.ssr_orbit_clock.radial, expected -2143668642, is %d", last_msg.msg.ssr_orbit_clock.radial); - - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.sid.code == 212, "incorrect value for last_msg.msg.ssr_orbit_clock.sid.code, expected 212, is %d", last_msg.msg.ssr_orbit_clock.sid.code); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.sid.sat == 203, "incorrect value for last_msg.msg.ssr_orbit_clock.sid.sat, expected 203, is %d", last_msg.msg.ssr_orbit_clock.sid.sat); - - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.time.tow == 3479621715, "incorrect value for last_msg.msg.ssr_orbit_clock.time.tow, expected 3479621715, is %d", last_msg.msg.ssr_orbit_clock.time.tow); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.time.wn == 7588, "incorrect value for last_msg.msg.ssr_orbit_clock.time.wn, expected 7588, is %d", last_msg.msg.ssr_orbit_clock.time.wn); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock.update_interval == 236, "incorrect value for last_msg.msg.ssr_orbit_clock.update_interval, expected 236, is %d", last_msg.msg.ssr_orbit_clock.update_interval); + ck_assert_msg(last_msg.msg.ssr_orbit_clock.along == -1334502588, + "incorrect value for last_msg.msg.ssr_orbit_clock.along, " + "expected -1334502588, is %d", + last_msg.msg.ssr_orbit_clock.along); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock.c0 == -174298703, + "incorrect value for last_msg.msg.ssr_orbit_clock.c0, " + "expected -174298703, is %d", + last_msg.msg.ssr_orbit_clock.c0); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock.c1 == -630458102, + "incorrect value for last_msg.msg.ssr_orbit_clock.c1, " + "expected -630458102, is %d", + last_msg.msg.ssr_orbit_clock.c1); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock.c2 == 1211677201, + "incorrect value for last_msg.msg.ssr_orbit_clock.c2, " + "expected 1211677201, is %d", + last_msg.msg.ssr_orbit_clock.c2); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock.cross == -197264530, + "incorrect value for last_msg.msg.ssr_orbit_clock.cross, " + "expected -197264530, is %d", + last_msg.msg.ssr_orbit_clock.cross); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock.dot_along == 169404560, + "incorrect value for last_msg.msg.ssr_orbit_clock.dot_along, " + "expected 169404560, is %d", + last_msg.msg.ssr_orbit_clock.dot_along); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock.dot_cross == 1118011173, + "incorrect value for last_msg.msg.ssr_orbit_clock.dot_cross, " + "expected 1118011173, is %d", + last_msg.msg.ssr_orbit_clock.dot_cross); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock.dot_radial == 878654074, + "incorrect value for last_msg.msg.ssr_orbit_clock.dot_radial, expected " + "878654074, is %d", + last_msg.msg.ssr_orbit_clock.dot_radial); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock.iod == 936372632, + "incorrect value for last_msg.msg.ssr_orbit_clock.iod, " + "expected 936372632, is %d", + last_msg.msg.ssr_orbit_clock.iod); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock.iod_ssr == 255, + "incorrect value for last_msg.msg.ssr_orbit_clock.iod_ssr, " + "expected 255, is %d", + last_msg.msg.ssr_orbit_clock.iod_ssr); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock.radial == -2143668642, + "incorrect value for last_msg.msg.ssr_orbit_clock.radial, " + "expected -2143668642, is %d", + last_msg.msg.ssr_orbit_clock.radial); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock.sid.code == 212, + "incorrect value for last_msg.msg.ssr_orbit_clock.sid.code, " + "expected 212, is %d", + last_msg.msg.ssr_orbit_clock.sid.code); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock.sid.sat == 203, + "incorrect value for last_msg.msg.ssr_orbit_clock.sid.sat, " + "expected 203, is %d", + last_msg.msg.ssr_orbit_clock.sid.sat); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock.time.tow == 3479621715, + "incorrect value for last_msg.msg.ssr_orbit_clock.time.tow, " + "expected 3479621715, is %d", + last_msg.msg.ssr_orbit_clock.time.tow); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock.time.wn == 7588, + "incorrect value for last_msg.msg.ssr_orbit_clock.time.wn, " + "expected 7588, is %d", + last_msg.msg.ssr_orbit_clock.time.wn); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock.update_interval == 236, + "incorrect value for last_msg.msg.ssr_orbit_clock.update_interval, " + "expected 236, is %d", + last_msg.msg.ssr_orbit_clock.update_interval); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrOrbitClock_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrOrbitClock"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrOrbitClock"); +Suite *auto_check_sbp_ssr_MsgSsrOrbitClock_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ssr_MsgSsrOrbitClock"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrOrbitClock"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrOrbitClock); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.c b/c/test/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.c index 40cb37a1d..31c2cc357 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBounds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBounds.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrOrbitClockBounds ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrOrbitClockBounds) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrOrbitClockBounds ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,159 +90,315 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrOrbitClockBounds ) logging_reset(); - sbp_callback_register(&sbp_state, 1502, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 1502, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,222,5,66,0,31,180,0,0,0,3,0,1,2,3,48,15,1,2,24,39,38,37,1,2,3,39,1,3,39,38,37,1,2,3,39,1,21,85, }; + u8 encoded_frame[] = { + 85, 222, 5, 66, 0, 31, 180, 0, 0, 0, 3, 0, 1, + 2, 3, 48, 15, 1, 2, 24, 39, 38, 37, 1, 2, 3, + 39, 1, 3, 39, 38, 37, 1, 2, 3, 39, 1, 21, 85, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ssr_orbit_clock_bounds.const_id = 1; - - + test_msg.ssr_orbit_clock_bounds.header.num_msgs = 1; - + test_msg.ssr_orbit_clock_bounds.header.seq_num = 2; - + test_msg.ssr_orbit_clock_bounds.header.sol_id = 48; - - + test_msg.ssr_orbit_clock_bounds.header.time.tow = 180; - + test_msg.ssr_orbit_clock_bounds.header.time.wn = 3; - + test_msg.ssr_orbit_clock_bounds.header.update_interval = 3; - + test_msg.ssr_orbit_clock_bounds.n_sats = 2; - - - + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].clock_bound_mu = 39; - + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].clock_bound_sig = 1; - - test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_along_bound_mu = 38; - - test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_along_bound_sig = 2; - - test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_cross_bound_mu = 37; - - test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_cross_bound_sig = 3; - - test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_radial_bound_mu = 39; - - test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_radial_bound_sig = 1; - + + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_along_bound_mu = + 38; + + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_along_bound_sig = + 2; + + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_cross_bound_mu = + 37; + + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_cross_bound_sig = + 3; + + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_radial_bound_mu = + 39; + + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_radial_bound_sig = + 1; + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].sat_id = 24; - - + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].clock_bound_mu = 39; - + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].clock_bound_sig = 1; - - test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_along_bound_mu = 38; - - test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_along_bound_sig = 2; - - test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_cross_bound_mu = 37; - - test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_cross_bound_sig = 3; - - test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_radial_bound_mu = 39; - - test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_radial_bound_sig = 1; - + + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_along_bound_mu = + 38; + + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_along_bound_sig = + 2; + + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_cross_bound_mu = + 37; + + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_cross_bound_sig = + 3; + + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_radial_bound_mu = + 39; + + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_radial_bound_sig = + 1; + test_msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].sat_id = 3; - + test_msg.ssr_orbit_clock_bounds.ssr_iod = 15; - sbp_message_send(&sbp_state, SbpMsgSsrOrbitClockBounds, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrOrbitClockBounds, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrOrbitClockBounds, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.const_id == 1, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.const_id, expected 1, is %d", last_msg.msg.ssr_orbit_clock_bounds.const_id); - - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.header.num_msgs == 1, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.header.num_msgs, expected 1, is %d", last_msg.msg.ssr_orbit_clock_bounds.header.num_msgs); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.header.seq_num == 2, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.header.seq_num, expected 2, is %d", last_msg.msg.ssr_orbit_clock_bounds.header.seq_num); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.header.sol_id == 48, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.header.sol_id, expected 48, is %d", last_msg.msg.ssr_orbit_clock_bounds.header.sol_id); - - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.header.time.tow == 180, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.header.time.tow, expected 180, is %d", last_msg.msg.ssr_orbit_clock_bounds.header.time.tow); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.header.time.wn == 3, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.header.time.wn, expected 3, is %d", last_msg.msg.ssr_orbit_clock_bounds.header.time.wn); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.header.update_interval == 3, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.header.update_interval, expected 3, is %d", last_msg.msg.ssr_orbit_clock_bounds.header.update_interval); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.n_sats == 2, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.n_sats, expected 2, is %d", last_msg.msg.ssr_orbit_clock_bounds.n_sats); - - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].clock_bound_mu == 39, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].clock_bound_mu, expected 39, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].clock_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].clock_bound_sig == 1, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].clock_bound_sig, expected 1, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].clock_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_along_bound_mu == 38, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_along_bound_mu, expected 38, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_along_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_along_bound_sig == 2, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_along_bound_sig, expected 2, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_along_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_cross_bound_mu == 37, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_cross_bound_mu, expected 37, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_cross_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_cross_bound_sig == 3, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_cross_bound_sig, expected 3, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_cross_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_radial_bound_mu == 39, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_radial_bound_mu, expected 39, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_radial_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_radial_bound_sig == 1, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_radial_bound_sig, expected 1, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].orb_radial_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].sat_id == 24, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].sat_id, expected 24, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].sat_id); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].clock_bound_mu == 39, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].clock_bound_mu, expected 39, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].clock_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].clock_bound_sig == 1, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].clock_bound_sig, expected 1, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].clock_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_along_bound_mu == 38, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_along_bound_mu, expected 38, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_along_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_along_bound_sig == 2, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_along_bound_sig, expected 2, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_along_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_cross_bound_mu == 37, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_cross_bound_mu, expected 37, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_cross_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_cross_bound_sig == 3, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_cross_bound_sig, expected 3, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_cross_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_radial_bound_mu == 39, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_radial_bound_mu, expected 39, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_radial_bound_mu); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_radial_bound_sig == 1, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_radial_bound_sig, expected 1, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].orb_radial_bound_sig); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].sat_id == 3, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].sat_id, expected 3, is %d", last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].sat_id); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.ssr_iod == 15, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.ssr_iod, expected 15, is %d", last_msg.msg.ssr_orbit_clock_bounds.ssr_iod); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrOrbitClockBounds, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds.const_id == 1, + "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.const_id, " + "expected 1, is %d", + last_msg.msg.ssr_orbit_clock_bounds.const_id); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.header.num_msgs == 1, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.header.num_msgs, " + "expected 1, is %d", + last_msg.msg.ssr_orbit_clock_bounds.header.num_msgs); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds.header.seq_num == 2, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.header.seq_num, expected 2, is %d", + last_msg.msg.ssr_orbit_clock_bounds.header.seq_num); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds.header.sol_id == 48, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.header.sol_id, expected 48, is %d", + last_msg.msg.ssr_orbit_clock_bounds.header.sol_id); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.header.time.tow == 180, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.header.time.tow, " + "expected 180, is %d", + last_msg.msg.ssr_orbit_clock_bounds.header.time.tow); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds.header.time.wn == 3, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.header.time.wn, expected 3, is %d", + last_msg.msg.ssr_orbit_clock_bounds.header.time.wn); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds.header.update_interval == 3, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.header.update_interval, expected " + "3, is %d", + last_msg.msg.ssr_orbit_clock_bounds.header.update_interval); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds.n_sats == 2, + "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.n_sats, " + "expected 2, is %d", + last_msg.msg.ssr_orbit_clock_bounds.n_sats); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .clock_bound_mu == 39, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0]." + "clock_bound_mu, expected 39, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .clock_bound_mu); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .clock_bound_sig == 1, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0]." + "clock_bound_sig, expected 1, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .clock_bound_sig); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .orb_along_bound_mu == 38, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0]." + "orb_along_bound_mu, expected 38, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .orb_along_bound_mu); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .orb_along_bound_sig == 2, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0]." + "orb_along_bound_sig, expected 2, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .orb_along_bound_sig); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .orb_cross_bound_mu == 37, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0]." + "orb_cross_bound_mu, expected 37, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .orb_cross_bound_mu); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .orb_cross_bound_sig == 3, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0]." + "orb_cross_bound_sig, expected 3, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .orb_cross_bound_sig); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .orb_radial_bound_mu == 39, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0]." + "orb_radial_bound_mu, expected 39, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .orb_radial_bound_mu); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .orb_radial_bound_sig == 1, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0]." + "orb_radial_bound_sig, expected 1, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0] + .orb_radial_bound_sig); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].sat_id == 24, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].sat_id, " + "expected 24, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[0].sat_id); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .clock_bound_mu == 39, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1]." + "clock_bound_mu, expected 39, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .clock_bound_mu); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .clock_bound_sig == 1, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1]." + "clock_bound_sig, expected 1, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .clock_bound_sig); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .orb_along_bound_mu == 38, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1]." + "orb_along_bound_mu, expected 38, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .orb_along_bound_mu); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .orb_along_bound_sig == 2, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1]." + "orb_along_bound_sig, expected 2, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .orb_along_bound_sig); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .orb_cross_bound_mu == 37, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1]." + "orb_cross_bound_mu, expected 37, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .orb_cross_bound_mu); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .orb_cross_bound_sig == 3, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1]." + "orb_cross_bound_sig, expected 3, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .orb_cross_bound_sig); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .orb_radial_bound_mu == 39, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1]." + "orb_radial_bound_mu, expected 39, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .orb_radial_bound_mu); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .orb_radial_bound_sig == 1, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1]." + "orb_radial_bound_sig, expected 1, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1] + .orb_radial_bound_sig); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].sat_id == 3, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].sat_id, " + "expected 3, is %d", + last_msg.msg.ssr_orbit_clock_bounds.orbit_clock_bounds[1].sat_id); + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds.ssr_iod == 15, + "incorrect value for last_msg.msg.ssr_orbit_clock_bounds.ssr_iod, " + "expected 15, is %d", + last_msg.msg.ssr_orbit_clock_bounds.ssr_iod); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrOrbitClockBounds_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrOrbitClockBounds"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrOrbitClockBounds"); +Suite *auto_check_sbp_ssr_MsgSsrOrbitClockBounds_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ssr_MsgSsrOrbitClockBounds"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrOrbitClockBounds"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrOrbitClockBounds); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.c b/c/test/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.c index 0eb237d80..3b9b0111d 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBoundsDegradation.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBoundsDegradation.yaml +// by generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,118 +90,231 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation ) logging_reset(); - sbp_callback_register(&sbp_state, 1503, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 1503, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,223,5,66,0,28,180,0,0,0,3,0,1,2,3,48,15,1,10,0,0,0,0,0,0,0,200,199,198,197,196,195,194,193,200,117, }; + u8 encoded_frame[] = { + 85, 223, 5, 66, 0, 28, 180, 0, 0, 0, 3, 0, + 1, 2, 3, 48, 15, 1, 10, 0, 0, 0, 0, 0, + 0, 0, 200, 199, 198, 197, 196, 195, 194, 193, 200, 117, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ssr_orbit_clock_bounds_degradation.const_id = 1; - - + test_msg.ssr_orbit_clock_bounds_degradation.header.num_msgs = 1; - + test_msg.ssr_orbit_clock_bounds_degradation.header.seq_num = 2; - + test_msg.ssr_orbit_clock_bounds_degradation.header.sol_id = 48; - - + test_msg.ssr_orbit_clock_bounds_degradation.header.time.tow = 180; - + test_msg.ssr_orbit_clock_bounds_degradation.header.time.wn = 3; - + test_msg.ssr_orbit_clock_bounds_degradation.header.update_interval = 3; - - - test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.clock_bound_mu_dot = 194; - - test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.clock_bound_sig_dot = 193; - - test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_along_bound_mu_dot = 199; - - test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_along_bound_sig_dot = 196; - - test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_cross_bound_mu_dot = 198; - - test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_cross_bound_sig_dot = 195; - - test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_radial_bound_mu_dot = 200; - - test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_radial_bound_sig_dot = 197; - + + test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation + .clock_bound_mu_dot = 194; + + test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation + .clock_bound_sig_dot = 193; + + test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation + .orb_along_bound_mu_dot = 199; + + test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation + .orb_along_bound_sig_dot = 196; + + test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation + .orb_cross_bound_mu_dot = 198; + + test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation + .orb_cross_bound_sig_dot = 195; + + test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation + .orb_radial_bound_mu_dot = 200; + + test_msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation + .orb_radial_bound_sig_dot = 197; + test_msg.ssr_orbit_clock_bounds_degradation.sat_bitmask = 10; - + test_msg.ssr_orbit_clock_bounds_degradation.ssr_iod = 15; - sbp_message_send(&sbp_state, SbpMsgSsrOrbitClockBoundsDegradation, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrOrbitClockBoundsDegradation, 66, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrOrbitClockBoundsDegradation, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.const_id == 1, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.const_id, expected 1, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.const_id); - - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.header.num_msgs == 1, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.header.num_msgs, expected 1, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.header.num_msgs); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.header.seq_num == 2, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.header.seq_num, expected 2, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.header.seq_num); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.header.sol_id == 48, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.header.sol_id, expected 48, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.header.sol_id); - - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.header.time.tow == 180, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.header.time.tow, expected 180, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.header.time.tow); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.header.time.wn == 3, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.header.time.wn, expected 3, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.header.time.wn); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.header.update_interval == 3, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.header.update_interval, expected 3, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.header.update_interval); - - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.clock_bound_mu_dot == 194, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.clock_bound_mu_dot, expected 194, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.clock_bound_mu_dot); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.clock_bound_sig_dot == 193, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.clock_bound_sig_dot, expected 193, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.clock_bound_sig_dot); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_along_bound_mu_dot == 199, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_along_bound_mu_dot, expected 199, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_along_bound_mu_dot); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_along_bound_sig_dot == 196, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_along_bound_sig_dot, expected 196, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_along_bound_sig_dot); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_cross_bound_mu_dot == 198, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_cross_bound_mu_dot, expected 198, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_cross_bound_mu_dot); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_cross_bound_sig_dot == 195, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_cross_bound_sig_dot, expected 195, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_cross_bound_sig_dot); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_radial_bound_mu_dot == 200, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_radial_bound_mu_dot, expected 200, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_radial_bound_mu_dot); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_radial_bound_sig_dot == 197, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_radial_bound_sig_dot, expected 197, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_degradation.orb_radial_bound_sig_dot); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.sat_bitmask == 10, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.sat_bitmask, expected 10, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.sat_bitmask); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.ssr_iod == 15, "incorrect value for last_msg.msg.ssr_orbit_clock_bounds_degradation.ssr_iod, expected 15, is %d", last_msg.msg.ssr_orbit_clock_bounds_degradation.ssr_iod); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrOrbitClockBoundsDegradation, + &last_msg.msg, &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.const_id == 1, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.const_id, " + "expected 1, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation.const_id); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds_degradation.header.num_msgs == 1, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.header.num_msgs, " + "expected 1, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation.header.num_msgs); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds_degradation.header.seq_num == 2, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.header.seq_num, " + "expected 2, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation.header.seq_num); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds_degradation.header.sol_id == 48, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.header.sol_id, " + "expected 48, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation.header.sol_id); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds_degradation.header.time.tow == 180, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.header.time.tow, " + "expected 180, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation.header.time.tow); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds_degradation.header.time.wn == 3, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.header.time.wn, " + "expected 3, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation.header.time.wn); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds_degradation.header + .update_interval == 3, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.header.update_" + "interval, expected 3, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation.header.update_interval); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.clock_bound_mu_dot == 194, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_" + "degradation.clock_bound_mu_dot, expected 194, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.clock_bound_mu_dot); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.clock_bound_sig_dot == 193, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_" + "degradation.clock_bound_sig_dot, expected 193, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.clock_bound_sig_dot); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.orb_along_bound_mu_dot == 199, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_" + "degradation.orb_along_bound_mu_dot, expected 199, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.orb_along_bound_mu_dot); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.orb_along_bound_sig_dot == 196, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_" + "degradation.orb_along_bound_sig_dot, expected 196, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.orb_along_bound_sig_dot); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.orb_cross_bound_mu_dot == 198, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_" + "degradation.orb_cross_bound_mu_dot, expected 198, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.orb_cross_bound_mu_dot); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.orb_cross_bound_sig_dot == 195, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_" + "degradation.orb_cross_bound_sig_dot, expected 195, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.orb_cross_bound_sig_dot); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.orb_radial_bound_mu_dot == 200, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_" + "degradation.orb_radial_bound_mu_dot, expected 200, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.orb_radial_bound_mu_dot); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.orb_radial_bound_sig_dot == 197, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.orbit_clock_bounds_" + "degradation.orb_radial_bound_sig_dot, expected 197, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation + .orbit_clock_bounds_degradation.orb_radial_bound_sig_dot); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_bounds_degradation.sat_bitmask == 10, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.sat_bitmask, expected " + "10, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation.sat_bitmask); + ck_assert_msg(last_msg.msg.ssr_orbit_clock_bounds_degradation.ssr_iod == 15, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_bounds_degradation.ssr_iod, " + "expected 15, is %d", + last_msg.msg.ssr_orbit_clock_bounds_degradation.ssr_iod); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation"); - tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation); +Suite *auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation"); + tcase_add_test(tc_acq, + test_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.c b/c/test/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.c index 7d6894940..38b53e19d 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrOrbitClockDepA ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrOrbitClockDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrOrbitClockDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,111 +90,177 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrOrbitClockDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x5dc, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x5dc, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,220,5,33,166,47,225,114,31,189,43,30,1,30,194,211,193,175,161,143,254,56,63,232,7,216,69,1,110,165,124,196,189,27,116,88,4,61,3,151,18,171,147,46,198,85,243,245,225,235,123,181,210,157,252, }; + u8 encoded_frame[] = { + 85, 220, 5, 33, 166, 47, 225, 114, 31, 189, 43, 30, 1, 30, + 194, 211, 193, 175, 161, 143, 254, 56, 63, 232, 7, 216, 69, 1, + 110, 165, 124, 196, 189, 27, 116, 88, 4, 61, 3, 151, 18, 171, + 147, 46, 198, 85, 243, 245, 225, 235, 123, 181, 210, 157, 252, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ssr_orbit_clock_dep_a.along = 132661048; - + test_msg.ssr_orbit_clock_dep_a.c0 = -970026069; - + test_msg.ssr_orbit_clock_dep_a.c1 = -503975083; - + test_msg.ssr_orbit_clock_dep_a.c2 = -759858197; - + test_msg.ssr_orbit_clock_dep_a.cross = 1845577176; - + test_msg.ssr_orbit_clock_dep_a.dot_along = 72905755; - + test_msg.ssr_orbit_clock_dep_a.dot_cross = 311886653; - + test_msg.ssr_orbit_clock_dep_a.dot_radial = -1111196507; - + test_msg.ssr_orbit_clock_dep_a.iod = 193; - + test_msg.ssr_orbit_clock_dep_a.iod_ssr = 211; - + test_msg.ssr_orbit_clock_dep_a.radial = -24141393; - - + test_msg.ssr_orbit_clock_dep_a.sid.code = 30; - + test_msg.ssr_orbit_clock_dep_a.sid.sat = 1; - - + test_msg.ssr_orbit_clock_dep_a.time.tow = 3172954849; - + test_msg.ssr_orbit_clock_dep_a.time.wn = 7723; - + test_msg.ssr_orbit_clock_dep_a.update_interval = 194; - sbp_message_send(&sbp_state, SbpMsgSsrOrbitClockDepA, 42529, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrOrbitClockDepA, 42529, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 42529, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSsrOrbitClockDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSsrOrbitClockDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.along == 132661048, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.along, expected 132661048, is %d", last_msg.msg.ssr_orbit_clock_dep_a.along); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.c0 == -970026069, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.c0, expected -970026069, is %d", last_msg.msg.ssr_orbit_clock_dep_a.c0); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.c1 == -503975083, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.c1, expected -503975083, is %d", last_msg.msg.ssr_orbit_clock_dep_a.c1); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.c2 == -759858197, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.c2, expected -759858197, is %d", last_msg.msg.ssr_orbit_clock_dep_a.c2); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.cross == 1845577176, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.cross, expected 1845577176, is %d", last_msg.msg.ssr_orbit_clock_dep_a.cross); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.dot_along == 72905755, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.dot_along, expected 72905755, is %d", last_msg.msg.ssr_orbit_clock_dep_a.dot_along); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.dot_cross == 311886653, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.dot_cross, expected 311886653, is %d", last_msg.msg.ssr_orbit_clock_dep_a.dot_cross); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.dot_radial == -1111196507, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.dot_radial, expected -1111196507, is %d", last_msg.msg.ssr_orbit_clock_dep_a.dot_radial); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.iod == 193, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.iod, expected 193, is %d", last_msg.msg.ssr_orbit_clock_dep_a.iod); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.iod_ssr == 211, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.iod_ssr, expected 211, is %d", last_msg.msg.ssr_orbit_clock_dep_a.iod_ssr); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.radial == -24141393, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.radial, expected -24141393, is %d", last_msg.msg.ssr_orbit_clock_dep_a.radial); - - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.sid.code == 30, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.sid.code, expected 30, is %d", last_msg.msg.ssr_orbit_clock_dep_a.sid.code); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.sid.sat == 1, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.sid.sat, expected 1, is %d", last_msg.msg.ssr_orbit_clock_dep_a.sid.sat); - - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.time.tow == 3172954849, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.time.tow, expected 3172954849, is %d", last_msg.msg.ssr_orbit_clock_dep_a.time.tow); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.time.wn == 7723, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.time.wn, expected 7723, is %d", last_msg.msg.ssr_orbit_clock_dep_a.time.wn); - - ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.update_interval == 194, "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.update_interval, expected 194, is %d", last_msg.msg.ssr_orbit_clock_dep_a.update_interval); + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_dep_a.along == 132661048, + "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.along, " + "expected 132661048, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.along); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.c0 == -970026069, + "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.c0, " + "expected -970026069, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.c0); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.c1 == -503975083, + "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.c1, " + "expected -503975083, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.c1); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.c2 == -759858197, + "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.c2, " + "expected -759858197, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.c2); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_dep_a.cross == 1845577176, + "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.cross, " + "expected 1845577176, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.cross); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_dep_a.dot_along == 72905755, + "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.dot_along, " + "expected 72905755, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.dot_along); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_dep_a.dot_cross == 311886653, + "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.dot_cross, " + "expected 311886653, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.dot_cross); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_dep_a.dot_radial == -1111196507, + "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.dot_radial, " + "expected -1111196507, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.dot_radial); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.iod == 193, + "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.iod, " + "expected 193, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.iod); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_dep_a.iod_ssr == 211, + "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.iod_ssr, " + "expected 211, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.iod_ssr); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_dep_a.radial == -24141393, + "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.radial, " + "expected -24141393, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.radial); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_dep_a.sid.code == 30, + "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.sid.code, " + "expected 30, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.sid.code); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_dep_a.sid.sat == 1, + "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.sid.sat, " + "expected 1, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.sid.sat); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_dep_a.time.tow == 3172954849, + "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.time.tow, " + "expected 3172954849, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.time.tow); + + ck_assert_msg( + last_msg.msg.ssr_orbit_clock_dep_a.time.wn == 7723, + "incorrect value for last_msg.msg.ssr_orbit_clock_dep_a.time.wn, " + "expected 7723, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.time.wn); + + ck_assert_msg(last_msg.msg.ssr_orbit_clock_dep_a.update_interval == 194, + "incorrect value for " + "last_msg.msg.ssr_orbit_clock_dep_a.update_interval, " + "expected 194, is %d", + last_msg.msg.ssr_orbit_clock_dep_a.update_interval); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrOrbitClockDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrOrbitClockDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrOrbitClockDepA"); +Suite *auto_check_sbp_ssr_MsgSsrOrbitClockDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ssr_MsgSsrOrbitClockDepA"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrOrbitClockDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrOrbitClockDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrPhaseBiases.c b/c/test/auto_check_sbp_ssr_MsgSsrPhaseBiases.c index 7263dc35e..2839abc8f 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrPhaseBiases.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrPhaseBiases.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrPhaseBiases.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrPhaseBiases.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrPhaseBiases ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrPhaseBiases) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrPhaseBiases ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,723 +90,1468 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrPhaseBiases ) logging_reset(); - sbp_callback_register(&sbp_state, 0x5e6, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x5e6, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,230,5,219,206,255,209,154,144,12,213,164,169,82,177,230,98,209,249,22,17,29,250,245,193,219,30,212,177,207,187,33,146,58,204,164,65,114,49,248,52,8,161,44,252,166,168,232,124,134,86,173,241,174,44,142,155,129,143,184,161,211,15,36,189,208,194,221,152,16,203,87,34,188,141,104,189,102,156,252,22,251,136,49,188,157,222,245,49,132,16,34,142,228,85,139,221,197,235,98,74,107,70,36,38,239,251,112,188,124,246,141,164,150,104,7,213,44,21,244,192,4,143,24,42,21,84,136,7,42,118,45,23,174,175,129,54,169,14,213,2,197,98,60,13,207,105,100,129,72,136,240,140,129,9,114,172,151,150,17,210,127,115,151,3,242,254,215,14,5,34,126,2,215,65,38,176,23,210,201,97,36,207,92,224,26,116,155,211,165,47,102,38,67,199,55,117,36,169,33,1,230,201,183,21,42,62,147,173,173,155,98,146,231,167,138,82,167,127,229,1,2,127,237,207,116,90,115,159,3,42,66,145,250,201,7,251,2,75,230,26,213,181,56,64,97,88,255,6,147,16,89,203,27,68,243,230,55,242,167,169,219,240, }; + u8 encoded_frame[] = { + 85, 230, 5, 219, 206, 255, 209, 154, 144, 12, 213, 164, 169, 82, + 177, 230, 98, 209, 249, 22, 17, 29, 250, 245, 193, 219, 30, 212, + 177, 207, 187, 33, 146, 58, 204, 164, 65, 114, 49, 248, 52, 8, + 161, 44, 252, 166, 168, 232, 124, 134, 86, 173, 241, 174, 44, 142, + 155, 129, 143, 184, 161, 211, 15, 36, 189, 208, 194, 221, 152, 16, + 203, 87, 34, 188, 141, 104, 189, 102, 156, 252, 22, 251, 136, 49, + 188, 157, 222, 245, 49, 132, 16, 34, 142, 228, 85, 139, 221, 197, + 235, 98, 74, 107, 70, 36, 38, 239, 251, 112, 188, 124, 246, 141, + 164, 150, 104, 7, 213, 44, 21, 244, 192, 4, 143, 24, 42, 21, + 84, 136, 7, 42, 118, 45, 23, 174, 175, 129, 54, 169, 14, 213, + 2, 197, 98, 60, 13, 207, 105, 100, 129, 72, 136, 240, 140, 129, + 9, 114, 172, 151, 150, 17, 210, 127, 115, 151, 3, 242, 254, 215, + 14, 5, 34, 126, 2, 215, 65, 38, 176, 23, 210, 201, 97, 36, + 207, 92, 224, 26, 116, 155, 211, 165, 47, 102, 38, 67, 199, 55, + 117, 36, 169, 33, 1, 230, 201, 183, 21, 42, 62, 147, 173, 173, + 155, 98, 146, 231, 167, 138, 82, 167, 127, 229, 1, 2, 127, 237, + 207, 116, 90, 115, 159, 3, 42, 66, 145, 250, 201, 7, 251, 2, + 75, 230, 26, 213, 181, 56, 64, 97, 88, 255, 6, 147, 16, 89, + 203, 27, 68, 243, 230, 55, 242, 167, 169, 219, 240, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - + test_msg.ssr_phase_biases.biases[0].bias = -1311498533; - + test_msg.ssr_phase_biases.biases[0].code = 29; - + test_msg.ssr_phase_biases.biases[0].discontinuity_counter = 193; - + test_msg.ssr_phase_biases.biases[0].integer_indicator = 250; - + test_msg.ssr_phase_biases.biases[0].widelane_integer_indicator = 245; - - + test_msg.ssr_phase_biases.biases[1].bias = 1101319226; - + test_msg.ssr_phase_biases.biases[1].code = 207; - + test_msg.ssr_phase_biases.biases[1].discontinuity_counter = 146; - + test_msg.ssr_phase_biases.biases[1].integer_indicator = 187; - + test_msg.ssr_phase_biases.biases[1].widelane_integer_indicator = 33; - - + test_msg.ssr_phase_biases.biases[2].bias = -64184056; - + test_msg.ssr_phase_biases.biases[2].code = 114; - + test_msg.ssr_phase_biases.biases[2].discontinuity_counter = 52; - + test_msg.ssr_phase_biases.biases[2].integer_indicator = 49; - + test_msg.ssr_phase_biases.biases[2].widelane_integer_indicator = 248; - - + test_msg.ssr_phase_biases.biases[3].bias = -240298362; - + test_msg.ssr_phase_biases.biases[3].code = 166; - + test_msg.ssr_phase_biases.biases[3].discontinuity_counter = 124; - + test_msg.ssr_phase_biases.biases[3].integer_indicator = 168; - + test_msg.ssr_phase_biases.biases[3].widelane_integer_indicator = 232; - - + test_msg.ssr_phase_biases.biases[4].bias = -1581740159; - + test_msg.ssr_phase_biases.biases[4].code = 174; - + test_msg.ssr_phase_biases.biases[4].discontinuity_counter = 155; - + test_msg.ssr_phase_biases.biases[4].integer_indicator = 44; - + test_msg.ssr_phase_biases.biases[4].widelane_integer_indicator = 142; - - + test_msg.ssr_phase_biases.biases[5].bias = -1730297136; - + test_msg.ssr_phase_biases.biases[5].code = 211; - + test_msg.ssr_phase_biases.biases[5].discontinuity_counter = 189; - + test_msg.ssr_phase_biases.biases[5].integer_indicator = 15; - + test_msg.ssr_phase_biases.biases[5].widelane_integer_indicator = 36; - - + test_msg.ssr_phase_biases.biases[6].bias = -1117221444; - + test_msg.ssr_phase_biases.biases[6].code = 16; - + test_msg.ssr_phase_biases.biases[6].discontinuity_counter = 34; - + test_msg.ssr_phase_biases.biases[6].integer_indicator = 203; - + test_msg.ssr_phase_biases.biases[6].widelane_integer_indicator = 87; - - + test_msg.ssr_phase_biases.biases[7].bias = -1137604357; - + test_msg.ssr_phase_biases.biases[7].code = 102; - + test_msg.ssr_phase_biases.biases[7].discontinuity_counter = 22; - + test_msg.ssr_phase_biases.biases[7].integer_indicator = 156; - + test_msg.ssr_phase_biases.biases[7].widelane_integer_indicator = 252; - - + test_msg.ssr_phase_biases.biases[8].bias = -1910370172; - + test_msg.ssr_phase_biases.biases[8].code = 157; - + test_msg.ssr_phase_biases.biases[8].discontinuity_counter = 49; - + test_msg.ssr_phase_biases.biases[8].integer_indicator = 222; - + test_msg.ssr_phase_biases.biases[8].widelane_integer_indicator = 245; - - + test_msg.ssr_phase_biases.biases[9].bias = 1247996869; - + test_msg.ssr_phase_biases.biases[9].code = 228; - + test_msg.ssr_phase_biases.biases[9].discontinuity_counter = 221; - + test_msg.ssr_phase_biases.biases[9].integer_indicator = 85; - + test_msg.ssr_phase_biases.biases[9].widelane_integer_indicator = 139; - - + test_msg.ssr_phase_biases.biases[10].bias = -1133446161; - + test_msg.ssr_phase_biases.biases[10].code = 107; - + test_msg.ssr_phase_biases.biases[10].discontinuity_counter = 38; - + test_msg.ssr_phase_biases.biases[10].integer_indicator = 70; - + test_msg.ssr_phase_biases.biases[10].widelane_integer_indicator = 36; - - + test_msg.ssr_phase_biases.biases[11].bias = -720934762; - + test_msg.ssr_phase_biases.biases[11].code = 124; - + test_msg.ssr_phase_biases.biases[11].discontinuity_counter = 164; - + test_msg.ssr_phase_biases.biases[11].integer_indicator = 246; - + test_msg.ssr_phase_biases.biases[11].widelane_integer_indicator = 141; - - + test_msg.ssr_phase_biases.biases[12].bias = 706252548; - + test_msg.ssr_phase_biases.biases[12].code = 44; - + test_msg.ssr_phase_biases.biases[12].discontinuity_counter = 192; - + test_msg.ssr_phase_biases.biases[12].integer_indicator = 21; - + test_msg.ssr_phase_biases.biases[12].widelane_integer_indicator = 244; - - + test_msg.ssr_phase_biases.biases[13].bias = 388855338; - + test_msg.ssr_phase_biases.biases[13].code = 21; - + test_msg.ssr_phase_biases.biases[13].discontinuity_counter = 7; - + test_msg.ssr_phase_biases.biases[13].integer_indicator = 84; - + test_msg.ssr_phase_biases.biases[13].widelane_integer_indicator = 136; - - + test_msg.ssr_phase_biases.biases[14].bias = 47517353; - + test_msg.ssr_phase_biases.biases[14].code = 174; - + test_msg.ssr_phase_biases.biases[14].discontinuity_counter = 54; - + test_msg.ssr_phase_biases.biases[14].integer_indicator = 175; - + test_msg.ssr_phase_biases.biases[14].widelane_integer_indicator = 129; - - + test_msg.ssr_phase_biases.biases[15].bias = -2124125745; - + test_msg.ssr_phase_biases.biases[15].code = 197; - + test_msg.ssr_phase_biases.biases[15].discontinuity_counter = 13; - + test_msg.ssr_phase_biases.biases[15].integer_indicator = 98; - + test_msg.ssr_phase_biases.biases[15].widelane_integer_indicator = 60; - - + test_msg.ssr_phase_biases.biases[16].bias = -1401812607; - + test_msg.ssr_phase_biases.biases[16].code = 72; - + test_msg.ssr_phase_biases.biases[16].discontinuity_counter = 140; - + test_msg.ssr_phase_biases.biases[16].integer_indicator = 136; - + test_msg.ssr_phase_biases.biases[16].widelane_integer_indicator = 240; - - + test_msg.ssr_phase_biases.biases[17].bias = 60257151; - + test_msg.ssr_phase_biases.biases[17].code = 151; - + test_msg.ssr_phase_biases.biases[17].discontinuity_counter = 210; - + test_msg.ssr_phase_biases.biases[17].integer_indicator = 150; - + test_msg.ssr_phase_biases.biases[17].widelane_integer_indicator = 17; - - + test_msg.ssr_phase_biases.biases[18].bias = 41820677; - + test_msg.ssr_phase_biases.biases[18].code = 242; - + test_msg.ssr_phase_biases.biases[18].discontinuity_counter = 14; - + test_msg.ssr_phase_biases.biases[18].integer_indicator = 254; - + test_msg.ssr_phase_biases.biases[18].widelane_integer_indicator = 215; - - + test_msg.ssr_phase_biases.biases[19].bias = 1640616471; - + test_msg.ssr_phase_biases.biases[19].code = 215; - + test_msg.ssr_phase_biases.biases[19].discontinuity_counter = 176; - + test_msg.ssr_phase_biases.biases[19].integer_indicator = 65; - + test_msg.ssr_phase_biases.biases[19].widelane_integer_indicator = 38; - - + test_msg.ssr_phase_biases.biases[20].bias = -744786918; - + test_msg.ssr_phase_biases.biases[20].code = 36; - + test_msg.ssr_phase_biases.biases[20].discontinuity_counter = 224; - + test_msg.ssr_phase_biases.biases[20].integer_indicator = 207; - + test_msg.ssr_phase_biases.biases[20].widelane_integer_indicator = 92; - - + test_msg.ssr_phase_biases.biases[21].bias = 1966589763; - + test_msg.ssr_phase_biases.biases[21].code = 165; - + test_msg.ssr_phase_biases.biases[21].discontinuity_counter = 38; - + test_msg.ssr_phase_biases.biases[21].integer_indicator = 47; - + test_msg.ssr_phase_biases.biases[21].widelane_integer_indicator = 102; - - + test_msg.ssr_phase_biases.biases[22].bias = 364366310; - + test_msg.ssr_phase_biases.biases[22].code = 36; - + test_msg.ssr_phase_biases.biases[22].discontinuity_counter = 1; - + test_msg.ssr_phase_biases.biases[22].integer_indicator = 169; - + test_msg.ssr_phase_biases.biases[22].widelane_integer_indicator = 33; - - + test_msg.ssr_phase_biases.biases[23].bias = -1839031379; - + test_msg.ssr_phase_biases.biases[23].code = 42; - + test_msg.ssr_phase_biases.biases[23].discontinuity_counter = 173; - + test_msg.ssr_phase_biases.biases[23].integer_indicator = 62; - + test_msg.ssr_phase_biases.biases[23].widelane_integer_indicator = 147; - - + test_msg.ssr_phase_biases.biases[24].bias = 31817639; - + test_msg.ssr_phase_biases.biases[24].code = 231; - + test_msg.ssr_phase_biases.biases[24].discontinuity_counter = 82; - + test_msg.ssr_phase_biases.biases[24].integer_indicator = 167; - + test_msg.ssr_phase_biases.biases[24].widelane_integer_indicator = 138; - - + test_msg.ssr_phase_biases.biases[25].bias = -1619830156; - + test_msg.ssr_phase_biases.biases[25].code = 2; - + test_msg.ssr_phase_biases.biases[25].discontinuity_counter = 207; - + test_msg.ssr_phase_biases.biases[25].integer_indicator = 127; - + test_msg.ssr_phase_biases.biases[25].widelane_integer_indicator = 237; - - + test_msg.ssr_phase_biases.biases[26].bias = -83375622; - + test_msg.ssr_phase_biases.biases[26].code = 3; - + test_msg.ssr_phase_biases.biases[26].discontinuity_counter = 145; - + test_msg.ssr_phase_biases.biases[26].integer_indicator = 42; - + test_msg.ssr_phase_biases.biases[26].widelane_integer_indicator = 66; - - + test_msg.ssr_phase_biases.biases[27].bias = 1077458389; - + test_msg.ssr_phase_biases.biases[27].code = 2; - + test_msg.ssr_phase_biases.biases[27].discontinuity_counter = 26; - + test_msg.ssr_phase_biases.biases[27].integer_indicator = 75; - + test_msg.ssr_phase_biases.biases[27].widelane_integer_indicator = 230; - - + test_msg.ssr_phase_biases.biases[28].bias = -883355501; - + test_msg.ssr_phase_biases.biases[28].code = 97; - + test_msg.ssr_phase_biases.biases[28].discontinuity_counter = 6; - + test_msg.ssr_phase_biases.biases[28].integer_indicator = 88; - + test_msg.ssr_phase_biases.biases[28].widelane_integer_indicator = 255; - - + test_msg.ssr_phase_biases.biases[29].bias = -1448611273; - + test_msg.ssr_phase_biases.biases[29].code = 27; - + test_msg.ssr_phase_biases.biases[29].discontinuity_counter = 230; - + test_msg.ssr_phase_biases.biases[29].integer_indicator = 68; - + test_msg.ssr_phase_biases.biases[29].widelane_integer_indicator = 243; - + test_msg.ssr_phase_biases.dispersive_bias = 98; - + test_msg.ssr_phase_biases.iod_ssr = 230; - + test_msg.ssr_phase_biases.mw_consistency = 209; - + test_msg.ssr_phase_biases.n_biases = 30; - - + test_msg.ssr_phase_biases.sid.code = 82; - + test_msg.ssr_phase_biases.sid.sat = 169; - - + test_msg.ssr_phase_biases.time.tow = 210803409; - + test_msg.ssr_phase_biases.time.wn = 42197; - + test_msg.ssr_phase_biases.update_interval = 177; - + test_msg.ssr_phase_biases.yaw = 5881; - + test_msg.ssr_phase_biases.yaw_rate = 17; - sbp_message_send(&sbp_state, SbpMsgSsrPhaseBiases, 52955, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrPhaseBiases, 52955, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 52955, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSsrPhaseBiases, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSsrPhaseBiases, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[0].bias == -1311498533, "incorrect value for last_msg.msg.ssr_phase_biases.biases[0].bias, expected -1311498533, is %d", last_msg.msg.ssr_phase_biases.biases[0].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[0].code == 29, "incorrect value for last_msg.msg.ssr_phase_biases.biases[0].code, expected 29, is %d", last_msg.msg.ssr_phase_biases.biases[0].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[0].discontinuity_counter == 193, "incorrect value for last_msg.msg.ssr_phase_biases.biases[0].discontinuity_counter, expected 193, is %d", last_msg.msg.ssr_phase_biases.biases[0].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[0].integer_indicator == 250, "incorrect value for last_msg.msg.ssr_phase_biases.biases[0].integer_indicator, expected 250, is %d", last_msg.msg.ssr_phase_biases.biases[0].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[0].widelane_integer_indicator == 245, "incorrect value for last_msg.msg.ssr_phase_biases.biases[0].widelane_integer_indicator, expected 245, is %d", last_msg.msg.ssr_phase_biases.biases[0].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[1].bias == 1101319226, "incorrect value for last_msg.msg.ssr_phase_biases.biases[1].bias, expected 1101319226, is %d", last_msg.msg.ssr_phase_biases.biases[1].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[1].code == 207, "incorrect value for last_msg.msg.ssr_phase_biases.biases[1].code, expected 207, is %d", last_msg.msg.ssr_phase_biases.biases[1].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[1].discontinuity_counter == 146, "incorrect value for last_msg.msg.ssr_phase_biases.biases[1].discontinuity_counter, expected 146, is %d", last_msg.msg.ssr_phase_biases.biases[1].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[1].integer_indicator == 187, "incorrect value for last_msg.msg.ssr_phase_biases.biases[1].integer_indicator, expected 187, is %d", last_msg.msg.ssr_phase_biases.biases[1].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[1].widelane_integer_indicator == 33, "incorrect value for last_msg.msg.ssr_phase_biases.biases[1].widelane_integer_indicator, expected 33, is %d", last_msg.msg.ssr_phase_biases.biases[1].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[2].bias == -64184056, "incorrect value for last_msg.msg.ssr_phase_biases.biases[2].bias, expected -64184056, is %d", last_msg.msg.ssr_phase_biases.biases[2].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[2].code == 114, "incorrect value for last_msg.msg.ssr_phase_biases.biases[2].code, expected 114, is %d", last_msg.msg.ssr_phase_biases.biases[2].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[2].discontinuity_counter == 52, "incorrect value for last_msg.msg.ssr_phase_biases.biases[2].discontinuity_counter, expected 52, is %d", last_msg.msg.ssr_phase_biases.biases[2].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[2].integer_indicator == 49, "incorrect value for last_msg.msg.ssr_phase_biases.biases[2].integer_indicator, expected 49, is %d", last_msg.msg.ssr_phase_biases.biases[2].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[2].widelane_integer_indicator == 248, "incorrect value for last_msg.msg.ssr_phase_biases.biases[2].widelane_integer_indicator, expected 248, is %d", last_msg.msg.ssr_phase_biases.biases[2].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[3].bias == -240298362, "incorrect value for last_msg.msg.ssr_phase_biases.biases[3].bias, expected -240298362, is %d", last_msg.msg.ssr_phase_biases.biases[3].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[3].code == 166, "incorrect value for last_msg.msg.ssr_phase_biases.biases[3].code, expected 166, is %d", last_msg.msg.ssr_phase_biases.biases[3].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[3].discontinuity_counter == 124, "incorrect value for last_msg.msg.ssr_phase_biases.biases[3].discontinuity_counter, expected 124, is %d", last_msg.msg.ssr_phase_biases.biases[3].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[3].integer_indicator == 168, "incorrect value for last_msg.msg.ssr_phase_biases.biases[3].integer_indicator, expected 168, is %d", last_msg.msg.ssr_phase_biases.biases[3].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[3].widelane_integer_indicator == 232, "incorrect value for last_msg.msg.ssr_phase_biases.biases[3].widelane_integer_indicator, expected 232, is %d", last_msg.msg.ssr_phase_biases.biases[3].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[4].bias == -1581740159, "incorrect value for last_msg.msg.ssr_phase_biases.biases[4].bias, expected -1581740159, is %d", last_msg.msg.ssr_phase_biases.biases[4].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[4].code == 174, "incorrect value for last_msg.msg.ssr_phase_biases.biases[4].code, expected 174, is %d", last_msg.msg.ssr_phase_biases.biases[4].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[4].discontinuity_counter == 155, "incorrect value for last_msg.msg.ssr_phase_biases.biases[4].discontinuity_counter, expected 155, is %d", last_msg.msg.ssr_phase_biases.biases[4].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[4].integer_indicator == 44, "incorrect value for last_msg.msg.ssr_phase_biases.biases[4].integer_indicator, expected 44, is %d", last_msg.msg.ssr_phase_biases.biases[4].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[4].widelane_integer_indicator == 142, "incorrect value for last_msg.msg.ssr_phase_biases.biases[4].widelane_integer_indicator, expected 142, is %d", last_msg.msg.ssr_phase_biases.biases[4].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[5].bias == -1730297136, "incorrect value for last_msg.msg.ssr_phase_biases.biases[5].bias, expected -1730297136, is %d", last_msg.msg.ssr_phase_biases.biases[5].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[5].code == 211, "incorrect value for last_msg.msg.ssr_phase_biases.biases[5].code, expected 211, is %d", last_msg.msg.ssr_phase_biases.biases[5].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[5].discontinuity_counter == 189, "incorrect value for last_msg.msg.ssr_phase_biases.biases[5].discontinuity_counter, expected 189, is %d", last_msg.msg.ssr_phase_biases.biases[5].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[5].integer_indicator == 15, "incorrect value for last_msg.msg.ssr_phase_biases.biases[5].integer_indicator, expected 15, is %d", last_msg.msg.ssr_phase_biases.biases[5].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[5].widelane_integer_indicator == 36, "incorrect value for last_msg.msg.ssr_phase_biases.biases[5].widelane_integer_indicator, expected 36, is %d", last_msg.msg.ssr_phase_biases.biases[5].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[6].bias == -1117221444, "incorrect value for last_msg.msg.ssr_phase_biases.biases[6].bias, expected -1117221444, is %d", last_msg.msg.ssr_phase_biases.biases[6].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[6].code == 16, "incorrect value for last_msg.msg.ssr_phase_biases.biases[6].code, expected 16, is %d", last_msg.msg.ssr_phase_biases.biases[6].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[6].discontinuity_counter == 34, "incorrect value for last_msg.msg.ssr_phase_biases.biases[6].discontinuity_counter, expected 34, is %d", last_msg.msg.ssr_phase_biases.biases[6].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[6].integer_indicator == 203, "incorrect value for last_msg.msg.ssr_phase_biases.biases[6].integer_indicator, expected 203, is %d", last_msg.msg.ssr_phase_biases.biases[6].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[6].widelane_integer_indicator == 87, "incorrect value for last_msg.msg.ssr_phase_biases.biases[6].widelane_integer_indicator, expected 87, is %d", last_msg.msg.ssr_phase_biases.biases[6].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[7].bias == -1137604357, "incorrect value for last_msg.msg.ssr_phase_biases.biases[7].bias, expected -1137604357, is %d", last_msg.msg.ssr_phase_biases.biases[7].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[7].code == 102, "incorrect value for last_msg.msg.ssr_phase_biases.biases[7].code, expected 102, is %d", last_msg.msg.ssr_phase_biases.biases[7].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[7].discontinuity_counter == 22, "incorrect value for last_msg.msg.ssr_phase_biases.biases[7].discontinuity_counter, expected 22, is %d", last_msg.msg.ssr_phase_biases.biases[7].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[7].integer_indicator == 156, "incorrect value for last_msg.msg.ssr_phase_biases.biases[7].integer_indicator, expected 156, is %d", last_msg.msg.ssr_phase_biases.biases[7].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[7].widelane_integer_indicator == 252, "incorrect value for last_msg.msg.ssr_phase_biases.biases[7].widelane_integer_indicator, expected 252, is %d", last_msg.msg.ssr_phase_biases.biases[7].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[8].bias == -1910370172, "incorrect value for last_msg.msg.ssr_phase_biases.biases[8].bias, expected -1910370172, is %d", last_msg.msg.ssr_phase_biases.biases[8].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[8].code == 157, "incorrect value for last_msg.msg.ssr_phase_biases.biases[8].code, expected 157, is %d", last_msg.msg.ssr_phase_biases.biases[8].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[8].discontinuity_counter == 49, "incorrect value for last_msg.msg.ssr_phase_biases.biases[8].discontinuity_counter, expected 49, is %d", last_msg.msg.ssr_phase_biases.biases[8].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[8].integer_indicator == 222, "incorrect value for last_msg.msg.ssr_phase_biases.biases[8].integer_indicator, expected 222, is %d", last_msg.msg.ssr_phase_biases.biases[8].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[8].widelane_integer_indicator == 245, "incorrect value for last_msg.msg.ssr_phase_biases.biases[8].widelane_integer_indicator, expected 245, is %d", last_msg.msg.ssr_phase_biases.biases[8].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[9].bias == 1247996869, "incorrect value for last_msg.msg.ssr_phase_biases.biases[9].bias, expected 1247996869, is %d", last_msg.msg.ssr_phase_biases.biases[9].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[9].code == 228, "incorrect value for last_msg.msg.ssr_phase_biases.biases[9].code, expected 228, is %d", last_msg.msg.ssr_phase_biases.biases[9].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[9].discontinuity_counter == 221, "incorrect value for last_msg.msg.ssr_phase_biases.biases[9].discontinuity_counter, expected 221, is %d", last_msg.msg.ssr_phase_biases.biases[9].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[9].integer_indicator == 85, "incorrect value for last_msg.msg.ssr_phase_biases.biases[9].integer_indicator, expected 85, is %d", last_msg.msg.ssr_phase_biases.biases[9].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[9].widelane_integer_indicator == 139, "incorrect value for last_msg.msg.ssr_phase_biases.biases[9].widelane_integer_indicator, expected 139, is %d", last_msg.msg.ssr_phase_biases.biases[9].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[10].bias == -1133446161, "incorrect value for last_msg.msg.ssr_phase_biases.biases[10].bias, expected -1133446161, is %d", last_msg.msg.ssr_phase_biases.biases[10].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[10].code == 107, "incorrect value for last_msg.msg.ssr_phase_biases.biases[10].code, expected 107, is %d", last_msg.msg.ssr_phase_biases.biases[10].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[10].discontinuity_counter == 38, "incorrect value for last_msg.msg.ssr_phase_biases.biases[10].discontinuity_counter, expected 38, is %d", last_msg.msg.ssr_phase_biases.biases[10].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[10].integer_indicator == 70, "incorrect value for last_msg.msg.ssr_phase_biases.biases[10].integer_indicator, expected 70, is %d", last_msg.msg.ssr_phase_biases.biases[10].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[10].widelane_integer_indicator == 36, "incorrect value for last_msg.msg.ssr_phase_biases.biases[10].widelane_integer_indicator, expected 36, is %d", last_msg.msg.ssr_phase_biases.biases[10].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[11].bias == -720934762, "incorrect value for last_msg.msg.ssr_phase_biases.biases[11].bias, expected -720934762, is %d", last_msg.msg.ssr_phase_biases.biases[11].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[11].code == 124, "incorrect value for last_msg.msg.ssr_phase_biases.biases[11].code, expected 124, is %d", last_msg.msg.ssr_phase_biases.biases[11].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[11].discontinuity_counter == 164, "incorrect value for last_msg.msg.ssr_phase_biases.biases[11].discontinuity_counter, expected 164, is %d", last_msg.msg.ssr_phase_biases.biases[11].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[11].integer_indicator == 246, "incorrect value for last_msg.msg.ssr_phase_biases.biases[11].integer_indicator, expected 246, is %d", last_msg.msg.ssr_phase_biases.biases[11].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[11].widelane_integer_indicator == 141, "incorrect value for last_msg.msg.ssr_phase_biases.biases[11].widelane_integer_indicator, expected 141, is %d", last_msg.msg.ssr_phase_biases.biases[11].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[12].bias == 706252548, "incorrect value for last_msg.msg.ssr_phase_biases.biases[12].bias, expected 706252548, is %d", last_msg.msg.ssr_phase_biases.biases[12].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[12].code == 44, "incorrect value for last_msg.msg.ssr_phase_biases.biases[12].code, expected 44, is %d", last_msg.msg.ssr_phase_biases.biases[12].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[12].discontinuity_counter == 192, "incorrect value for last_msg.msg.ssr_phase_biases.biases[12].discontinuity_counter, expected 192, is %d", last_msg.msg.ssr_phase_biases.biases[12].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[12].integer_indicator == 21, "incorrect value for last_msg.msg.ssr_phase_biases.biases[12].integer_indicator, expected 21, is %d", last_msg.msg.ssr_phase_biases.biases[12].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[12].widelane_integer_indicator == 244, "incorrect value for last_msg.msg.ssr_phase_biases.biases[12].widelane_integer_indicator, expected 244, is %d", last_msg.msg.ssr_phase_biases.biases[12].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[13].bias == 388855338, "incorrect value for last_msg.msg.ssr_phase_biases.biases[13].bias, expected 388855338, is %d", last_msg.msg.ssr_phase_biases.biases[13].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[13].code == 21, "incorrect value for last_msg.msg.ssr_phase_biases.biases[13].code, expected 21, is %d", last_msg.msg.ssr_phase_biases.biases[13].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[13].discontinuity_counter == 7, "incorrect value for last_msg.msg.ssr_phase_biases.biases[13].discontinuity_counter, expected 7, is %d", last_msg.msg.ssr_phase_biases.biases[13].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[13].integer_indicator == 84, "incorrect value for last_msg.msg.ssr_phase_biases.biases[13].integer_indicator, expected 84, is %d", last_msg.msg.ssr_phase_biases.biases[13].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[13].widelane_integer_indicator == 136, "incorrect value for last_msg.msg.ssr_phase_biases.biases[13].widelane_integer_indicator, expected 136, is %d", last_msg.msg.ssr_phase_biases.biases[13].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[14].bias == 47517353, "incorrect value for last_msg.msg.ssr_phase_biases.biases[14].bias, expected 47517353, is %d", last_msg.msg.ssr_phase_biases.biases[14].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[14].code == 174, "incorrect value for last_msg.msg.ssr_phase_biases.biases[14].code, expected 174, is %d", last_msg.msg.ssr_phase_biases.biases[14].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[14].discontinuity_counter == 54, "incorrect value for last_msg.msg.ssr_phase_biases.biases[14].discontinuity_counter, expected 54, is %d", last_msg.msg.ssr_phase_biases.biases[14].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[14].integer_indicator == 175, "incorrect value for last_msg.msg.ssr_phase_biases.biases[14].integer_indicator, expected 175, is %d", last_msg.msg.ssr_phase_biases.biases[14].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[14].widelane_integer_indicator == 129, "incorrect value for last_msg.msg.ssr_phase_biases.biases[14].widelane_integer_indicator, expected 129, is %d", last_msg.msg.ssr_phase_biases.biases[14].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[15].bias == -2124125745, "incorrect value for last_msg.msg.ssr_phase_biases.biases[15].bias, expected -2124125745, is %d", last_msg.msg.ssr_phase_biases.biases[15].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[15].code == 197, "incorrect value for last_msg.msg.ssr_phase_biases.biases[15].code, expected 197, is %d", last_msg.msg.ssr_phase_biases.biases[15].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[15].discontinuity_counter == 13, "incorrect value for last_msg.msg.ssr_phase_biases.biases[15].discontinuity_counter, expected 13, is %d", last_msg.msg.ssr_phase_biases.biases[15].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[15].integer_indicator == 98, "incorrect value for last_msg.msg.ssr_phase_biases.biases[15].integer_indicator, expected 98, is %d", last_msg.msg.ssr_phase_biases.biases[15].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[15].widelane_integer_indicator == 60, "incorrect value for last_msg.msg.ssr_phase_biases.biases[15].widelane_integer_indicator, expected 60, is %d", last_msg.msg.ssr_phase_biases.biases[15].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[16].bias == -1401812607, "incorrect value for last_msg.msg.ssr_phase_biases.biases[16].bias, expected -1401812607, is %d", last_msg.msg.ssr_phase_biases.biases[16].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[16].code == 72, "incorrect value for last_msg.msg.ssr_phase_biases.biases[16].code, expected 72, is %d", last_msg.msg.ssr_phase_biases.biases[16].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[16].discontinuity_counter == 140, "incorrect value for last_msg.msg.ssr_phase_biases.biases[16].discontinuity_counter, expected 140, is %d", last_msg.msg.ssr_phase_biases.biases[16].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[16].integer_indicator == 136, "incorrect value for last_msg.msg.ssr_phase_biases.biases[16].integer_indicator, expected 136, is %d", last_msg.msg.ssr_phase_biases.biases[16].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[16].widelane_integer_indicator == 240, "incorrect value for last_msg.msg.ssr_phase_biases.biases[16].widelane_integer_indicator, expected 240, is %d", last_msg.msg.ssr_phase_biases.biases[16].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[17].bias == 60257151, "incorrect value for last_msg.msg.ssr_phase_biases.biases[17].bias, expected 60257151, is %d", last_msg.msg.ssr_phase_biases.biases[17].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[17].code == 151, "incorrect value for last_msg.msg.ssr_phase_biases.biases[17].code, expected 151, is %d", last_msg.msg.ssr_phase_biases.biases[17].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[17].discontinuity_counter == 210, "incorrect value for last_msg.msg.ssr_phase_biases.biases[17].discontinuity_counter, expected 210, is %d", last_msg.msg.ssr_phase_biases.biases[17].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[17].integer_indicator == 150, "incorrect value for last_msg.msg.ssr_phase_biases.biases[17].integer_indicator, expected 150, is %d", last_msg.msg.ssr_phase_biases.biases[17].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[17].widelane_integer_indicator == 17, "incorrect value for last_msg.msg.ssr_phase_biases.biases[17].widelane_integer_indicator, expected 17, is %d", last_msg.msg.ssr_phase_biases.biases[17].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[18].bias == 41820677, "incorrect value for last_msg.msg.ssr_phase_biases.biases[18].bias, expected 41820677, is %d", last_msg.msg.ssr_phase_biases.biases[18].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[18].code == 242, "incorrect value for last_msg.msg.ssr_phase_biases.biases[18].code, expected 242, is %d", last_msg.msg.ssr_phase_biases.biases[18].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[18].discontinuity_counter == 14, "incorrect value for last_msg.msg.ssr_phase_biases.biases[18].discontinuity_counter, expected 14, is %d", last_msg.msg.ssr_phase_biases.biases[18].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[18].integer_indicator == 254, "incorrect value for last_msg.msg.ssr_phase_biases.biases[18].integer_indicator, expected 254, is %d", last_msg.msg.ssr_phase_biases.biases[18].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[18].widelane_integer_indicator == 215, "incorrect value for last_msg.msg.ssr_phase_biases.biases[18].widelane_integer_indicator, expected 215, is %d", last_msg.msg.ssr_phase_biases.biases[18].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[19].bias == 1640616471, "incorrect value for last_msg.msg.ssr_phase_biases.biases[19].bias, expected 1640616471, is %d", last_msg.msg.ssr_phase_biases.biases[19].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[19].code == 215, "incorrect value for last_msg.msg.ssr_phase_biases.biases[19].code, expected 215, is %d", last_msg.msg.ssr_phase_biases.biases[19].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[19].discontinuity_counter == 176, "incorrect value for last_msg.msg.ssr_phase_biases.biases[19].discontinuity_counter, expected 176, is %d", last_msg.msg.ssr_phase_biases.biases[19].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[19].integer_indicator == 65, "incorrect value for last_msg.msg.ssr_phase_biases.biases[19].integer_indicator, expected 65, is %d", last_msg.msg.ssr_phase_biases.biases[19].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[19].widelane_integer_indicator == 38, "incorrect value for last_msg.msg.ssr_phase_biases.biases[19].widelane_integer_indicator, expected 38, is %d", last_msg.msg.ssr_phase_biases.biases[19].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[20].bias == -744786918, "incorrect value for last_msg.msg.ssr_phase_biases.biases[20].bias, expected -744786918, is %d", last_msg.msg.ssr_phase_biases.biases[20].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[20].code == 36, "incorrect value for last_msg.msg.ssr_phase_biases.biases[20].code, expected 36, is %d", last_msg.msg.ssr_phase_biases.biases[20].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[20].discontinuity_counter == 224, "incorrect value for last_msg.msg.ssr_phase_biases.biases[20].discontinuity_counter, expected 224, is %d", last_msg.msg.ssr_phase_biases.biases[20].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[20].integer_indicator == 207, "incorrect value for last_msg.msg.ssr_phase_biases.biases[20].integer_indicator, expected 207, is %d", last_msg.msg.ssr_phase_biases.biases[20].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[20].widelane_integer_indicator == 92, "incorrect value for last_msg.msg.ssr_phase_biases.biases[20].widelane_integer_indicator, expected 92, is %d", last_msg.msg.ssr_phase_biases.biases[20].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[21].bias == 1966589763, "incorrect value for last_msg.msg.ssr_phase_biases.biases[21].bias, expected 1966589763, is %d", last_msg.msg.ssr_phase_biases.biases[21].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[21].code == 165, "incorrect value for last_msg.msg.ssr_phase_biases.biases[21].code, expected 165, is %d", last_msg.msg.ssr_phase_biases.biases[21].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[21].discontinuity_counter == 38, "incorrect value for last_msg.msg.ssr_phase_biases.biases[21].discontinuity_counter, expected 38, is %d", last_msg.msg.ssr_phase_biases.biases[21].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[21].integer_indicator == 47, "incorrect value for last_msg.msg.ssr_phase_biases.biases[21].integer_indicator, expected 47, is %d", last_msg.msg.ssr_phase_biases.biases[21].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[21].widelane_integer_indicator == 102, "incorrect value for last_msg.msg.ssr_phase_biases.biases[21].widelane_integer_indicator, expected 102, is %d", last_msg.msg.ssr_phase_biases.biases[21].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[22].bias == 364366310, "incorrect value for last_msg.msg.ssr_phase_biases.biases[22].bias, expected 364366310, is %d", last_msg.msg.ssr_phase_biases.biases[22].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[22].code == 36, "incorrect value for last_msg.msg.ssr_phase_biases.biases[22].code, expected 36, is %d", last_msg.msg.ssr_phase_biases.biases[22].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[22].discontinuity_counter == 1, "incorrect value for last_msg.msg.ssr_phase_biases.biases[22].discontinuity_counter, expected 1, is %d", last_msg.msg.ssr_phase_biases.biases[22].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[22].integer_indicator == 169, "incorrect value for last_msg.msg.ssr_phase_biases.biases[22].integer_indicator, expected 169, is %d", last_msg.msg.ssr_phase_biases.biases[22].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[22].widelane_integer_indicator == 33, "incorrect value for last_msg.msg.ssr_phase_biases.biases[22].widelane_integer_indicator, expected 33, is %d", last_msg.msg.ssr_phase_biases.biases[22].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[23].bias == -1839031379, "incorrect value for last_msg.msg.ssr_phase_biases.biases[23].bias, expected -1839031379, is %d", last_msg.msg.ssr_phase_biases.biases[23].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[23].code == 42, "incorrect value for last_msg.msg.ssr_phase_biases.biases[23].code, expected 42, is %d", last_msg.msg.ssr_phase_biases.biases[23].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[23].discontinuity_counter == 173, "incorrect value for last_msg.msg.ssr_phase_biases.biases[23].discontinuity_counter, expected 173, is %d", last_msg.msg.ssr_phase_biases.biases[23].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[23].integer_indicator == 62, "incorrect value for last_msg.msg.ssr_phase_biases.biases[23].integer_indicator, expected 62, is %d", last_msg.msg.ssr_phase_biases.biases[23].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[23].widelane_integer_indicator == 147, "incorrect value for last_msg.msg.ssr_phase_biases.biases[23].widelane_integer_indicator, expected 147, is %d", last_msg.msg.ssr_phase_biases.biases[23].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[24].bias == 31817639, "incorrect value for last_msg.msg.ssr_phase_biases.biases[24].bias, expected 31817639, is %d", last_msg.msg.ssr_phase_biases.biases[24].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[24].code == 231, "incorrect value for last_msg.msg.ssr_phase_biases.biases[24].code, expected 231, is %d", last_msg.msg.ssr_phase_biases.biases[24].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[24].discontinuity_counter == 82, "incorrect value for last_msg.msg.ssr_phase_biases.biases[24].discontinuity_counter, expected 82, is %d", last_msg.msg.ssr_phase_biases.biases[24].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[24].integer_indicator == 167, "incorrect value for last_msg.msg.ssr_phase_biases.biases[24].integer_indicator, expected 167, is %d", last_msg.msg.ssr_phase_biases.biases[24].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[24].widelane_integer_indicator == 138, "incorrect value for last_msg.msg.ssr_phase_biases.biases[24].widelane_integer_indicator, expected 138, is %d", last_msg.msg.ssr_phase_biases.biases[24].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[25].bias == -1619830156, "incorrect value for last_msg.msg.ssr_phase_biases.biases[25].bias, expected -1619830156, is %d", last_msg.msg.ssr_phase_biases.biases[25].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[25].code == 2, "incorrect value for last_msg.msg.ssr_phase_biases.biases[25].code, expected 2, is %d", last_msg.msg.ssr_phase_biases.biases[25].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[25].discontinuity_counter == 207, "incorrect value for last_msg.msg.ssr_phase_biases.biases[25].discontinuity_counter, expected 207, is %d", last_msg.msg.ssr_phase_biases.biases[25].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[25].integer_indicator == 127, "incorrect value for last_msg.msg.ssr_phase_biases.biases[25].integer_indicator, expected 127, is %d", last_msg.msg.ssr_phase_biases.biases[25].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[25].widelane_integer_indicator == 237, "incorrect value for last_msg.msg.ssr_phase_biases.biases[25].widelane_integer_indicator, expected 237, is %d", last_msg.msg.ssr_phase_biases.biases[25].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[26].bias == -83375622, "incorrect value for last_msg.msg.ssr_phase_biases.biases[26].bias, expected -83375622, is %d", last_msg.msg.ssr_phase_biases.biases[26].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[26].code == 3, "incorrect value for last_msg.msg.ssr_phase_biases.biases[26].code, expected 3, is %d", last_msg.msg.ssr_phase_biases.biases[26].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[26].discontinuity_counter == 145, "incorrect value for last_msg.msg.ssr_phase_biases.biases[26].discontinuity_counter, expected 145, is %d", last_msg.msg.ssr_phase_biases.biases[26].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[26].integer_indicator == 42, "incorrect value for last_msg.msg.ssr_phase_biases.biases[26].integer_indicator, expected 42, is %d", last_msg.msg.ssr_phase_biases.biases[26].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[26].widelane_integer_indicator == 66, "incorrect value for last_msg.msg.ssr_phase_biases.biases[26].widelane_integer_indicator, expected 66, is %d", last_msg.msg.ssr_phase_biases.biases[26].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[27].bias == 1077458389, "incorrect value for last_msg.msg.ssr_phase_biases.biases[27].bias, expected 1077458389, is %d", last_msg.msg.ssr_phase_biases.biases[27].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[27].code == 2, "incorrect value for last_msg.msg.ssr_phase_biases.biases[27].code, expected 2, is %d", last_msg.msg.ssr_phase_biases.biases[27].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[27].discontinuity_counter == 26, "incorrect value for last_msg.msg.ssr_phase_biases.biases[27].discontinuity_counter, expected 26, is %d", last_msg.msg.ssr_phase_biases.biases[27].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[27].integer_indicator == 75, "incorrect value for last_msg.msg.ssr_phase_biases.biases[27].integer_indicator, expected 75, is %d", last_msg.msg.ssr_phase_biases.biases[27].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[27].widelane_integer_indicator == 230, "incorrect value for last_msg.msg.ssr_phase_biases.biases[27].widelane_integer_indicator, expected 230, is %d", last_msg.msg.ssr_phase_biases.biases[27].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[28].bias == -883355501, "incorrect value for last_msg.msg.ssr_phase_biases.biases[28].bias, expected -883355501, is %d", last_msg.msg.ssr_phase_biases.biases[28].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[28].code == 97, "incorrect value for last_msg.msg.ssr_phase_biases.biases[28].code, expected 97, is %d", last_msg.msg.ssr_phase_biases.biases[28].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[28].discontinuity_counter == 6, "incorrect value for last_msg.msg.ssr_phase_biases.biases[28].discontinuity_counter, expected 6, is %d", last_msg.msg.ssr_phase_biases.biases[28].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[28].integer_indicator == 88, "incorrect value for last_msg.msg.ssr_phase_biases.biases[28].integer_indicator, expected 88, is %d", last_msg.msg.ssr_phase_biases.biases[28].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[28].widelane_integer_indicator == 255, "incorrect value for last_msg.msg.ssr_phase_biases.biases[28].widelane_integer_indicator, expected 255, is %d", last_msg.msg.ssr_phase_biases.biases[28].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[29].bias == -1448611273, "incorrect value for last_msg.msg.ssr_phase_biases.biases[29].bias, expected -1448611273, is %d", last_msg.msg.ssr_phase_biases.biases[29].bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[29].code == 27, "incorrect value for last_msg.msg.ssr_phase_biases.biases[29].code, expected 27, is %d", last_msg.msg.ssr_phase_biases.biases[29].code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[29].discontinuity_counter == 230, "incorrect value for last_msg.msg.ssr_phase_biases.biases[29].discontinuity_counter, expected 230, is %d", last_msg.msg.ssr_phase_biases.biases[29].discontinuity_counter); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[29].integer_indicator == 68, "incorrect value for last_msg.msg.ssr_phase_biases.biases[29].integer_indicator, expected 68, is %d", last_msg.msg.ssr_phase_biases.biases[29].integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.biases[29].widelane_integer_indicator == 243, "incorrect value for last_msg.msg.ssr_phase_biases.biases[29].widelane_integer_indicator, expected 243, is %d", last_msg.msg.ssr_phase_biases.biases[29].widelane_integer_indicator); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.dispersive_bias == 98, "incorrect value for last_msg.msg.ssr_phase_biases.dispersive_bias, expected 98, is %d", last_msg.msg.ssr_phase_biases.dispersive_bias); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.iod_ssr == 230, "incorrect value for last_msg.msg.ssr_phase_biases.iod_ssr, expected 230, is %d", last_msg.msg.ssr_phase_biases.iod_ssr); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.mw_consistency == 209, "incorrect value for last_msg.msg.ssr_phase_biases.mw_consistency, expected 209, is %d", last_msg.msg.ssr_phase_biases.mw_consistency); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.n_biases == 30, "incorrect value for last_msg.msg.ssr_phase_biases.n_biases, expected 30, is %d", last_msg.msg.ssr_phase_biases.n_biases); - - - ck_assert_msg(last_msg.msg.ssr_phase_biases.sid.code == 82, "incorrect value for last_msg.msg.ssr_phase_biases.sid.code, expected 82, is %d", last_msg.msg.ssr_phase_biases.sid.code); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.sid.sat == 169, "incorrect value for last_msg.msg.ssr_phase_biases.sid.sat, expected 169, is %d", last_msg.msg.ssr_phase_biases.sid.sat); - - - ck_assert_msg(last_msg.msg.ssr_phase_biases.time.tow == 210803409, "incorrect value for last_msg.msg.ssr_phase_biases.time.tow, expected 210803409, is %d", last_msg.msg.ssr_phase_biases.time.tow); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.time.wn == 42197, "incorrect value for last_msg.msg.ssr_phase_biases.time.wn, expected 42197, is %d", last_msg.msg.ssr_phase_biases.time.wn); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.update_interval == 177, "incorrect value for last_msg.msg.ssr_phase_biases.update_interval, expected 177, is %d", last_msg.msg.ssr_phase_biases.update_interval); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.yaw == 5881, "incorrect value for last_msg.msg.ssr_phase_biases.yaw, expected 5881, is %d", last_msg.msg.ssr_phase_biases.yaw); - - ck_assert_msg(last_msg.msg.ssr_phase_biases.yaw_rate == 17, "incorrect value for last_msg.msg.ssr_phase_biases.yaw_rate, expected 17, is %d", last_msg.msg.ssr_phase_biases.yaw_rate); + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[0].bias == -1311498533, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[0].bias, " + "expected -1311498533, is %d", + last_msg.msg.ssr_phase_biases.biases[0].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[0].code == 29, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[0].code, " + "expected 29, is %d", + last_msg.msg.ssr_phase_biases.biases[0].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[0].discontinuity_counter == 193, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[0].discontinuity_counter, " + "expected 193, is %d", + last_msg.msg.ssr_phase_biases.biases[0].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[0].integer_indicator == 250, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[0].integer_indicator, expected " + "250, is %d", + last_msg.msg.ssr_phase_biases.biases[0].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[0].widelane_integer_indicator == + 245, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[0].widelane_integer_indicator, " + "expected 245, is %d", + last_msg.msg.ssr_phase_biases.biases[0].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[1].bias == 1101319226, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[1].bias, " + "expected 1101319226, is %d", + last_msg.msg.ssr_phase_biases.biases[1].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[1].code == 207, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[1].code, " + "expected 207, is %d", + last_msg.msg.ssr_phase_biases.biases[1].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[1].discontinuity_counter == 146, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[1].discontinuity_counter, " + "expected 146, is %d", + last_msg.msg.ssr_phase_biases.biases[1].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[1].integer_indicator == 187, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[1].integer_indicator, expected " + "187, is %d", + last_msg.msg.ssr_phase_biases.biases[1].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[1].widelane_integer_indicator == + 33, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[1].widelane_integer_indicator, " + "expected 33, is %d", + last_msg.msg.ssr_phase_biases.biases[1].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[2].bias == -64184056, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[2].bias, " + "expected -64184056, is %d", + last_msg.msg.ssr_phase_biases.biases[2].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[2].code == 114, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[2].code, " + "expected 114, is %d", + last_msg.msg.ssr_phase_biases.biases[2].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[2].discontinuity_counter == 52, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[2].discontinuity_counter, " + "expected 52, is %d", + last_msg.msg.ssr_phase_biases.biases[2].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[2].integer_indicator == 49, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[2].integer_indicator, expected " + "49, is %d", + last_msg.msg.ssr_phase_biases.biases[2].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[2].widelane_integer_indicator == + 248, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[2].widelane_integer_indicator, " + "expected 248, is %d", + last_msg.msg.ssr_phase_biases.biases[2].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[3].bias == -240298362, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[3].bias, " + "expected -240298362, is %d", + last_msg.msg.ssr_phase_biases.biases[3].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[3].code == 166, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[3].code, " + "expected 166, is %d", + last_msg.msg.ssr_phase_biases.biases[3].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[3].discontinuity_counter == 124, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[3].discontinuity_counter, " + "expected 124, is %d", + last_msg.msg.ssr_phase_biases.biases[3].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[3].integer_indicator == 168, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[3].integer_indicator, expected " + "168, is %d", + last_msg.msg.ssr_phase_biases.biases[3].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[3].widelane_integer_indicator == + 232, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[3].widelane_integer_indicator, " + "expected 232, is %d", + last_msg.msg.ssr_phase_biases.biases[3].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[4].bias == -1581740159, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[4].bias, " + "expected -1581740159, is %d", + last_msg.msg.ssr_phase_biases.biases[4].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[4].code == 174, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[4].code, " + "expected 174, is %d", + last_msg.msg.ssr_phase_biases.biases[4].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[4].discontinuity_counter == 155, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[4].discontinuity_counter, " + "expected 155, is %d", + last_msg.msg.ssr_phase_biases.biases[4].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[4].integer_indicator == 44, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[4].integer_indicator, expected " + "44, is %d", + last_msg.msg.ssr_phase_biases.biases[4].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[4].widelane_integer_indicator == + 142, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[4].widelane_integer_indicator, " + "expected 142, is %d", + last_msg.msg.ssr_phase_biases.biases[4].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[5].bias == -1730297136, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[5].bias, " + "expected -1730297136, is %d", + last_msg.msg.ssr_phase_biases.biases[5].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[5].code == 211, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[5].code, " + "expected 211, is %d", + last_msg.msg.ssr_phase_biases.biases[5].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[5].discontinuity_counter == 189, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[5].discontinuity_counter, " + "expected 189, is %d", + last_msg.msg.ssr_phase_biases.biases[5].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[5].integer_indicator == 15, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[5].integer_indicator, expected " + "15, is %d", + last_msg.msg.ssr_phase_biases.biases[5].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[5].widelane_integer_indicator == + 36, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[5].widelane_integer_indicator, " + "expected 36, is %d", + last_msg.msg.ssr_phase_biases.biases[5].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[6].bias == -1117221444, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[6].bias, " + "expected -1117221444, is %d", + last_msg.msg.ssr_phase_biases.biases[6].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[6].code == 16, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[6].code, " + "expected 16, is %d", + last_msg.msg.ssr_phase_biases.biases[6].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[6].discontinuity_counter == 34, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[6].discontinuity_counter, " + "expected 34, is %d", + last_msg.msg.ssr_phase_biases.biases[6].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[6].integer_indicator == 203, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[6].integer_indicator, expected " + "203, is %d", + last_msg.msg.ssr_phase_biases.biases[6].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[6].widelane_integer_indicator == + 87, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[6].widelane_integer_indicator, " + "expected 87, is %d", + last_msg.msg.ssr_phase_biases.biases[6].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[7].bias == -1137604357, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[7].bias, " + "expected -1137604357, is %d", + last_msg.msg.ssr_phase_biases.biases[7].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[7].code == 102, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[7].code, " + "expected 102, is %d", + last_msg.msg.ssr_phase_biases.biases[7].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[7].discontinuity_counter == 22, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[7].discontinuity_counter, " + "expected 22, is %d", + last_msg.msg.ssr_phase_biases.biases[7].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[7].integer_indicator == 156, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[7].integer_indicator, expected " + "156, is %d", + last_msg.msg.ssr_phase_biases.biases[7].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[7].widelane_integer_indicator == + 252, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[7].widelane_integer_indicator, " + "expected 252, is %d", + last_msg.msg.ssr_phase_biases.biases[7].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[8].bias == -1910370172, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[8].bias, " + "expected -1910370172, is %d", + last_msg.msg.ssr_phase_biases.biases[8].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[8].code == 157, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[8].code, " + "expected 157, is %d", + last_msg.msg.ssr_phase_biases.biases[8].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[8].discontinuity_counter == 49, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[8].discontinuity_counter, " + "expected 49, is %d", + last_msg.msg.ssr_phase_biases.biases[8].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[8].integer_indicator == 222, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[8].integer_indicator, expected " + "222, is %d", + last_msg.msg.ssr_phase_biases.biases[8].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[8].widelane_integer_indicator == + 245, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[8].widelane_integer_indicator, " + "expected 245, is %d", + last_msg.msg.ssr_phase_biases.biases[8].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[9].bias == 1247996869, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[9].bias, " + "expected 1247996869, is %d", + last_msg.msg.ssr_phase_biases.biases[9].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[9].code == 228, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[9].code, " + "expected 228, is %d", + last_msg.msg.ssr_phase_biases.biases[9].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[9].discontinuity_counter == 221, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[9].discontinuity_counter, " + "expected 221, is %d", + last_msg.msg.ssr_phase_biases.biases[9].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[9].integer_indicator == 85, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[9].integer_indicator, expected " + "85, is %d", + last_msg.msg.ssr_phase_biases.biases[9].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[9].widelane_integer_indicator == + 139, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[9].widelane_integer_indicator, " + "expected 139, is %d", + last_msg.msg.ssr_phase_biases.biases[9].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[10].bias == -1133446161, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[10].bias, " + "expected -1133446161, is %d", + last_msg.msg.ssr_phase_biases.biases[10].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[10].code == 107, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[10].code, " + "expected 107, is %d", + last_msg.msg.ssr_phase_biases.biases[10].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[10].discontinuity_counter == 38, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[10].discontinuity_counter, " + "expected 38, is %d", + last_msg.msg.ssr_phase_biases.biases[10].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[10].integer_indicator == 70, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[10].integer_indicator, expected " + "70, is %d", + last_msg.msg.ssr_phase_biases.biases[10].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[10].widelane_integer_indicator == + 36, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[10].widelane_integer_indicator, " + "expected 36, is %d", + last_msg.msg.ssr_phase_biases.biases[10].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[11].bias == -720934762, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[11].bias, " + "expected -720934762, is %d", + last_msg.msg.ssr_phase_biases.biases[11].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[11].code == 124, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[11].code, " + "expected 124, is %d", + last_msg.msg.ssr_phase_biases.biases[11].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[11].discontinuity_counter == 164, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[11].discontinuity_counter, " + "expected 164, is %d", + last_msg.msg.ssr_phase_biases.biases[11].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[11].integer_indicator == 246, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[11].integer_indicator, expected " + "246, is %d", + last_msg.msg.ssr_phase_biases.biases[11].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[11].widelane_integer_indicator == + 141, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[11].widelane_integer_indicator, " + "expected 141, is %d", + last_msg.msg.ssr_phase_biases.biases[11].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[12].bias == 706252548, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[12].bias, " + "expected 706252548, is %d", + last_msg.msg.ssr_phase_biases.biases[12].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[12].code == 44, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[12].code, " + "expected 44, is %d", + last_msg.msg.ssr_phase_biases.biases[12].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[12].discontinuity_counter == 192, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[12].discontinuity_counter, " + "expected 192, is %d", + last_msg.msg.ssr_phase_biases.biases[12].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[12].integer_indicator == 21, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[12].integer_indicator, expected " + "21, is %d", + last_msg.msg.ssr_phase_biases.biases[12].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[12].widelane_integer_indicator == + 244, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[12].widelane_integer_indicator, " + "expected 244, is %d", + last_msg.msg.ssr_phase_biases.biases[12].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[13].bias == 388855338, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[13].bias, " + "expected 388855338, is %d", + last_msg.msg.ssr_phase_biases.biases[13].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[13].code == 21, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[13].code, " + "expected 21, is %d", + last_msg.msg.ssr_phase_biases.biases[13].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[13].discontinuity_counter == 7, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[13].discontinuity_counter, " + "expected 7, is %d", + last_msg.msg.ssr_phase_biases.biases[13].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[13].integer_indicator == 84, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[13].integer_indicator, expected " + "84, is %d", + last_msg.msg.ssr_phase_biases.biases[13].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[13].widelane_integer_indicator == + 136, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[13].widelane_integer_indicator, " + "expected 136, is %d", + last_msg.msg.ssr_phase_biases.biases[13].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[14].bias == 47517353, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[14].bias, " + "expected 47517353, is %d", + last_msg.msg.ssr_phase_biases.biases[14].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[14].code == 174, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[14].code, " + "expected 174, is %d", + last_msg.msg.ssr_phase_biases.biases[14].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[14].discontinuity_counter == 54, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[14].discontinuity_counter, " + "expected 54, is %d", + last_msg.msg.ssr_phase_biases.biases[14].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[14].integer_indicator == 175, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[14].integer_indicator, expected " + "175, is %d", + last_msg.msg.ssr_phase_biases.biases[14].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[14].widelane_integer_indicator == + 129, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[14].widelane_integer_indicator, " + "expected 129, is %d", + last_msg.msg.ssr_phase_biases.biases[14].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[15].bias == -2124125745, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[15].bias, " + "expected -2124125745, is %d", + last_msg.msg.ssr_phase_biases.biases[15].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[15].code == 197, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[15].code, " + "expected 197, is %d", + last_msg.msg.ssr_phase_biases.biases[15].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[15].discontinuity_counter == 13, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[15].discontinuity_counter, " + "expected 13, is %d", + last_msg.msg.ssr_phase_biases.biases[15].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[15].integer_indicator == 98, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[15].integer_indicator, expected " + "98, is %d", + last_msg.msg.ssr_phase_biases.biases[15].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[15].widelane_integer_indicator == + 60, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[15].widelane_integer_indicator, " + "expected 60, is %d", + last_msg.msg.ssr_phase_biases.biases[15].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[16].bias == -1401812607, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[16].bias, " + "expected -1401812607, is %d", + last_msg.msg.ssr_phase_biases.biases[16].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[16].code == 72, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[16].code, " + "expected 72, is %d", + last_msg.msg.ssr_phase_biases.biases[16].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[16].discontinuity_counter == 140, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[16].discontinuity_counter, " + "expected 140, is %d", + last_msg.msg.ssr_phase_biases.biases[16].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[16].integer_indicator == 136, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[16].integer_indicator, expected " + "136, is %d", + last_msg.msg.ssr_phase_biases.biases[16].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[16].widelane_integer_indicator == + 240, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[16].widelane_integer_indicator, " + "expected 240, is %d", + last_msg.msg.ssr_phase_biases.biases[16].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[17].bias == 60257151, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[17].bias, " + "expected 60257151, is %d", + last_msg.msg.ssr_phase_biases.biases[17].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[17].code == 151, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[17].code, " + "expected 151, is %d", + last_msg.msg.ssr_phase_biases.biases[17].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[17].discontinuity_counter == 210, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[17].discontinuity_counter, " + "expected 210, is %d", + last_msg.msg.ssr_phase_biases.biases[17].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[17].integer_indicator == 150, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[17].integer_indicator, expected " + "150, is %d", + last_msg.msg.ssr_phase_biases.biases[17].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[17].widelane_integer_indicator == + 17, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[17].widelane_integer_indicator, " + "expected 17, is %d", + last_msg.msg.ssr_phase_biases.biases[17].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[18].bias == 41820677, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[18].bias, " + "expected 41820677, is %d", + last_msg.msg.ssr_phase_biases.biases[18].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[18].code == 242, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[18].code, " + "expected 242, is %d", + last_msg.msg.ssr_phase_biases.biases[18].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[18].discontinuity_counter == 14, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[18].discontinuity_counter, " + "expected 14, is %d", + last_msg.msg.ssr_phase_biases.biases[18].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[18].integer_indicator == 254, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[18].integer_indicator, expected " + "254, is %d", + last_msg.msg.ssr_phase_biases.biases[18].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[18].widelane_integer_indicator == + 215, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[18].widelane_integer_indicator, " + "expected 215, is %d", + last_msg.msg.ssr_phase_biases.biases[18].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[19].bias == 1640616471, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[19].bias, " + "expected 1640616471, is %d", + last_msg.msg.ssr_phase_biases.biases[19].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[19].code == 215, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[19].code, " + "expected 215, is %d", + last_msg.msg.ssr_phase_biases.biases[19].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[19].discontinuity_counter == 176, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[19].discontinuity_counter, " + "expected 176, is %d", + last_msg.msg.ssr_phase_biases.biases[19].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[19].integer_indicator == 65, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[19].integer_indicator, expected " + "65, is %d", + last_msg.msg.ssr_phase_biases.biases[19].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[19].widelane_integer_indicator == + 38, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[19].widelane_integer_indicator, " + "expected 38, is %d", + last_msg.msg.ssr_phase_biases.biases[19].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[20].bias == -744786918, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[20].bias, " + "expected -744786918, is %d", + last_msg.msg.ssr_phase_biases.biases[20].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[20].code == 36, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[20].code, " + "expected 36, is %d", + last_msg.msg.ssr_phase_biases.biases[20].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[20].discontinuity_counter == 224, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[20].discontinuity_counter, " + "expected 224, is %d", + last_msg.msg.ssr_phase_biases.biases[20].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[20].integer_indicator == 207, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[20].integer_indicator, expected " + "207, is %d", + last_msg.msg.ssr_phase_biases.biases[20].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[20].widelane_integer_indicator == + 92, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[20].widelane_integer_indicator, " + "expected 92, is %d", + last_msg.msg.ssr_phase_biases.biases[20].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[21].bias == 1966589763, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[21].bias, " + "expected 1966589763, is %d", + last_msg.msg.ssr_phase_biases.biases[21].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[21].code == 165, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[21].code, " + "expected 165, is %d", + last_msg.msg.ssr_phase_biases.biases[21].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[21].discontinuity_counter == 38, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[21].discontinuity_counter, " + "expected 38, is %d", + last_msg.msg.ssr_phase_biases.biases[21].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[21].integer_indicator == 47, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[21].integer_indicator, expected " + "47, is %d", + last_msg.msg.ssr_phase_biases.biases[21].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[21].widelane_integer_indicator == + 102, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[21].widelane_integer_indicator, " + "expected 102, is %d", + last_msg.msg.ssr_phase_biases.biases[21].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[22].bias == 364366310, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[22].bias, " + "expected 364366310, is %d", + last_msg.msg.ssr_phase_biases.biases[22].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[22].code == 36, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[22].code, " + "expected 36, is %d", + last_msg.msg.ssr_phase_biases.biases[22].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[22].discontinuity_counter == 1, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[22].discontinuity_counter, " + "expected 1, is %d", + last_msg.msg.ssr_phase_biases.biases[22].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[22].integer_indicator == 169, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[22].integer_indicator, expected " + "169, is %d", + last_msg.msg.ssr_phase_biases.biases[22].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[22].widelane_integer_indicator == + 33, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[22].widelane_integer_indicator, " + "expected 33, is %d", + last_msg.msg.ssr_phase_biases.biases[22].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[23].bias == -1839031379, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[23].bias, " + "expected -1839031379, is %d", + last_msg.msg.ssr_phase_biases.biases[23].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[23].code == 42, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[23].code, " + "expected 42, is %d", + last_msg.msg.ssr_phase_biases.biases[23].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[23].discontinuity_counter == 173, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[23].discontinuity_counter, " + "expected 173, is %d", + last_msg.msg.ssr_phase_biases.biases[23].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[23].integer_indicator == 62, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[23].integer_indicator, expected " + "62, is %d", + last_msg.msg.ssr_phase_biases.biases[23].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[23].widelane_integer_indicator == + 147, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[23].widelane_integer_indicator, " + "expected 147, is %d", + last_msg.msg.ssr_phase_biases.biases[23].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[24].bias == 31817639, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[24].bias, " + "expected 31817639, is %d", + last_msg.msg.ssr_phase_biases.biases[24].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[24].code == 231, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[24].code, " + "expected 231, is %d", + last_msg.msg.ssr_phase_biases.biases[24].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[24].discontinuity_counter == 82, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[24].discontinuity_counter, " + "expected 82, is %d", + last_msg.msg.ssr_phase_biases.biases[24].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[24].integer_indicator == 167, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[24].integer_indicator, expected " + "167, is %d", + last_msg.msg.ssr_phase_biases.biases[24].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[24].widelane_integer_indicator == + 138, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[24].widelane_integer_indicator, " + "expected 138, is %d", + last_msg.msg.ssr_phase_biases.biases[24].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[25].bias == -1619830156, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[25].bias, " + "expected -1619830156, is %d", + last_msg.msg.ssr_phase_biases.biases[25].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[25].code == 2, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[25].code, " + "expected 2, is %d", + last_msg.msg.ssr_phase_biases.biases[25].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[25].discontinuity_counter == 207, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[25].discontinuity_counter, " + "expected 207, is %d", + last_msg.msg.ssr_phase_biases.biases[25].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[25].integer_indicator == 127, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[25].integer_indicator, expected " + "127, is %d", + last_msg.msg.ssr_phase_biases.biases[25].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[25].widelane_integer_indicator == + 237, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[25].widelane_integer_indicator, " + "expected 237, is %d", + last_msg.msg.ssr_phase_biases.biases[25].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[26].bias == -83375622, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[26].bias, " + "expected -83375622, is %d", + last_msg.msg.ssr_phase_biases.biases[26].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[26].code == 3, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[26].code, " + "expected 3, is %d", + last_msg.msg.ssr_phase_biases.biases[26].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[26].discontinuity_counter == 145, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[26].discontinuity_counter, " + "expected 145, is %d", + last_msg.msg.ssr_phase_biases.biases[26].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[26].integer_indicator == 42, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[26].integer_indicator, expected " + "42, is %d", + last_msg.msg.ssr_phase_biases.biases[26].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[26].widelane_integer_indicator == + 66, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[26].widelane_integer_indicator, " + "expected 66, is %d", + last_msg.msg.ssr_phase_biases.biases[26].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[27].bias == 1077458389, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[27].bias, " + "expected 1077458389, is %d", + last_msg.msg.ssr_phase_biases.biases[27].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[27].code == 2, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[27].code, " + "expected 2, is %d", + last_msg.msg.ssr_phase_biases.biases[27].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[27].discontinuity_counter == 26, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[27].discontinuity_counter, " + "expected 26, is %d", + last_msg.msg.ssr_phase_biases.biases[27].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[27].integer_indicator == 75, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[27].integer_indicator, expected " + "75, is %d", + last_msg.msg.ssr_phase_biases.biases[27].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[27].widelane_integer_indicator == + 230, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[27].widelane_integer_indicator, " + "expected 230, is %d", + last_msg.msg.ssr_phase_biases.biases[27].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[28].bias == -883355501, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[28].bias, " + "expected -883355501, is %d", + last_msg.msg.ssr_phase_biases.biases[28].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[28].code == 97, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[28].code, " + "expected 97, is %d", + last_msg.msg.ssr_phase_biases.biases[28].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[28].discontinuity_counter == 6, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[28].discontinuity_counter, " + "expected 6, is %d", + last_msg.msg.ssr_phase_biases.biases[28].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[28].integer_indicator == 88, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[28].integer_indicator, expected " + "88, is %d", + last_msg.msg.ssr_phase_biases.biases[28].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[28].widelane_integer_indicator == + 255, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[28].widelane_integer_indicator, " + "expected 255, is %d", + last_msg.msg.ssr_phase_biases.biases[28].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[29].bias == -1448611273, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[29].bias, " + "expected -1448611273, is %d", + last_msg.msg.ssr_phase_biases.biases[29].bias); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[29].code == 27, + "incorrect value for last_msg.msg.ssr_phase_biases.biases[29].code, " + "expected 27, is %d", + last_msg.msg.ssr_phase_biases.biases[29].code); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[29].discontinuity_counter == 230, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[29].discontinuity_counter, " + "expected 230, is %d", + last_msg.msg.ssr_phase_biases.biases[29].discontinuity_counter); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[29].integer_indicator == 68, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[29].integer_indicator, expected " + "68, is %d", + last_msg.msg.ssr_phase_biases.biases[29].integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.biases[29].widelane_integer_indicator == + 243, + "incorrect value for " + "last_msg.msg.ssr_phase_biases.biases[29].widelane_integer_indicator, " + "expected 243, is %d", + last_msg.msg.ssr_phase_biases.biases[29].widelane_integer_indicator); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.dispersive_bias == 98, + "incorrect value for last_msg.msg.ssr_phase_biases.dispersive_bias, " + "expected 98, is %d", + last_msg.msg.ssr_phase_biases.dispersive_bias); + + ck_assert_msg(last_msg.msg.ssr_phase_biases.iod_ssr == 230, + "incorrect value for last_msg.msg.ssr_phase_biases.iod_ssr, " + "expected 230, is %d", + last_msg.msg.ssr_phase_biases.iod_ssr); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.mw_consistency == 209, + "incorrect value for last_msg.msg.ssr_phase_biases.mw_consistency, " + "expected 209, is %d", + last_msg.msg.ssr_phase_biases.mw_consistency); + + ck_assert_msg(last_msg.msg.ssr_phase_biases.n_biases == 30, + "incorrect value for last_msg.msg.ssr_phase_biases.n_biases, " + "expected 30, is %d", + last_msg.msg.ssr_phase_biases.n_biases); + + ck_assert_msg(last_msg.msg.ssr_phase_biases.sid.code == 82, + "incorrect value for last_msg.msg.ssr_phase_biases.sid.code, " + "expected 82, is %d", + last_msg.msg.ssr_phase_biases.sid.code); + + ck_assert_msg(last_msg.msg.ssr_phase_biases.sid.sat == 169, + "incorrect value for last_msg.msg.ssr_phase_biases.sid.sat, " + "expected 169, is %d", + last_msg.msg.ssr_phase_biases.sid.sat); + + ck_assert_msg(last_msg.msg.ssr_phase_biases.time.tow == 210803409, + "incorrect value for last_msg.msg.ssr_phase_biases.time.tow, " + "expected 210803409, is %d", + last_msg.msg.ssr_phase_biases.time.tow); + + ck_assert_msg(last_msg.msg.ssr_phase_biases.time.wn == 42197, + "incorrect value for last_msg.msg.ssr_phase_biases.time.wn, " + "expected 42197, is %d", + last_msg.msg.ssr_phase_biases.time.wn); + + ck_assert_msg( + last_msg.msg.ssr_phase_biases.update_interval == 177, + "incorrect value for last_msg.msg.ssr_phase_biases.update_interval, " + "expected 177, is %d", + last_msg.msg.ssr_phase_biases.update_interval); + + ck_assert_msg(last_msg.msg.ssr_phase_biases.yaw == 5881, + "incorrect value for last_msg.msg.ssr_phase_biases.yaw, " + "expected 5881, is %d", + last_msg.msg.ssr_phase_biases.yaw); + + ck_assert_msg(last_msg.msg.ssr_phase_biases.yaw_rate == 17, + "incorrect value for last_msg.msg.ssr_phase_biases.yaw_rate, " + "expected 17, is %d", + last_msg.msg.ssr_phase_biases.yaw_rate); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrPhaseBiases_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrPhaseBiases"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrPhaseBiases"); +Suite *auto_check_sbp_ssr_MsgSsrPhaseBiases_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ssr_MsgSsrPhaseBiases"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrPhaseBiases"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrPhaseBiases); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrSatelliteApc.c b/c/test/auto_check_sbp_ssr_MsgSsrSatelliteApc.c index 65423ef23..c574d67f5 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrSatelliteApc.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrSatelliteApc.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApc.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApc.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrSatelliteApc ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrSatelliteApc) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrSatelliteApc ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,166 +90,299 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrSatelliteApc ) logging_reset(); - sbp_callback_register(&sbp_state, 0x605, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x605, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,6,0,0,41,127,58,9,0,174,8,1,2,3,2,0,4,61,0,1,0,255,255,217,2,11,10,8,5,1,252,248,246,246,246,249,252,0,6,12,22,30,41,41,41,41,144,161, }; + u8 encoded_frame[] = { + 85, 5, 6, 0, 0, 41, 127, 58, 9, 0, 174, 8, 1, + 2, 3, 2, 0, 4, 61, 0, 1, 0, 255, 255, 217, 2, + 11, 10, 8, 5, 1, 252, 248, 246, 246, 246, 249, 252, 0, + 6, 12, 22, 30, 41, 41, 41, 41, 144, 161, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - - + test_msg.ssr_satellite_apc.apc[0].pco[0] = 1; - + test_msg.ssr_satellite_apc.apc[0].pco[1] = -1; - + test_msg.ssr_satellite_apc.apc[0].pco[2] = 729; - - + test_msg.ssr_satellite_apc.apc[0].pcv[0] = 11; - + test_msg.ssr_satellite_apc.apc[0].pcv[1] = 10; - + test_msg.ssr_satellite_apc.apc[0].pcv[2] = 8; - + test_msg.ssr_satellite_apc.apc[0].pcv[3] = 5; - + test_msg.ssr_satellite_apc.apc[0].pcv[4] = 1; - + test_msg.ssr_satellite_apc.apc[0].pcv[5] = -4; - + test_msg.ssr_satellite_apc.apc[0].pcv[6] = -8; - + test_msg.ssr_satellite_apc.apc[0].pcv[7] = -10; - + test_msg.ssr_satellite_apc.apc[0].pcv[8] = -10; - + test_msg.ssr_satellite_apc.apc[0].pcv[9] = -10; - + test_msg.ssr_satellite_apc.apc[0].pcv[10] = -7; - + test_msg.ssr_satellite_apc.apc[0].pcv[11] = -4; - + test_msg.ssr_satellite_apc.apc[0].pcv[12] = 0; - + test_msg.ssr_satellite_apc.apc[0].pcv[13] = 6; - + test_msg.ssr_satellite_apc.apc[0].pcv[14] = 12; - + test_msg.ssr_satellite_apc.apc[0].pcv[15] = 22; - + test_msg.ssr_satellite_apc.apc[0].pcv[16] = 30; - + test_msg.ssr_satellite_apc.apc[0].pcv[17] = 41; - + test_msg.ssr_satellite_apc.apc[0].pcv[18] = 41; - + test_msg.ssr_satellite_apc.apc[0].pcv[19] = 41; - + test_msg.ssr_satellite_apc.apc[0].pcv[20] = 41; - + test_msg.ssr_satellite_apc.apc[0].sat_info = 4; - - + test_msg.ssr_satellite_apc.apc[0].sid.code = 0; - + test_msg.ssr_satellite_apc.apc[0].sid.sat = 2; - + test_msg.ssr_satellite_apc.apc[0].svn = 61; - + test_msg.ssr_satellite_apc.iod_ssr = 3; - + test_msg.ssr_satellite_apc.n_apc = 1; - + test_msg.ssr_satellite_apc.sol_id = 2; - - + test_msg.ssr_satellite_apc.time.tow = 604799; - + test_msg.ssr_satellite_apc.time.wn = 2222; - + test_msg.ssr_satellite_apc.update_interval = 1; - sbp_message_send(&sbp_state, SbpMsgSsrSatelliteApc, 0, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrSatelliteApc, 0, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSsrSatelliteApc, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSsrSatelliteApc, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pco[0] == 1, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pco[0], expected 1, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pco[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pco[1] == -1, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pco[1], expected -1, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pco[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pco[2] == 729, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pco[2], expected 729, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pco[2]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[0] == 11, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[0], expected 11, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[1] == 10, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[1], expected 10, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[2] == 8, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[2], expected 8, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[2]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[3] == 5, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[3], expected 5, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[3]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[4] == 1, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[4], expected 1, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[4]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[5] == -4, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[5], expected -4, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[5]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[6] == -8, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[6], expected -8, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[6]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[7] == -10, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[7], expected -10, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[7]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[8] == -10, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[8], expected -10, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[8]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[9] == -10, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[9], expected -10, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[9]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[10] == -7, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[10], expected -7, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[10]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[11] == -4, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[11], expected -4, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[11]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[12] == 0, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[12], expected 0, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[12]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[13] == 6, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[13], expected 6, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[13]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[14] == 12, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[14], expected 12, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[14]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[15] == 22, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[15], expected 22, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[15]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[16] == 30, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[16], expected 30, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[16]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[17] == 41, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[17], expected 41, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[17]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[18] == 41, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[18], expected 41, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[18]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[19] == 41, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[19], expected 41, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[19]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].pcv[20] == 41, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[20], expected 41, is %d", last_msg.msg.ssr_satellite_apc.apc[0].pcv[20]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].sat_info == 4, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].sat_info, expected 4, is %d", last_msg.msg.ssr_satellite_apc.apc[0].sat_info); - - - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].sid.code == 0, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].sid.code, expected 0, is %d", last_msg.msg.ssr_satellite_apc.apc[0].sid.code); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].sid.sat == 2, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].sid.sat, expected 2, is %d", last_msg.msg.ssr_satellite_apc.apc[0].sid.sat); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc.apc[0].svn == 61, "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].svn, expected 61, is %d", last_msg.msg.ssr_satellite_apc.apc[0].svn); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc.iod_ssr == 3, "incorrect value for last_msg.msg.ssr_satellite_apc.iod_ssr, expected 3, is %d", last_msg.msg.ssr_satellite_apc.iod_ssr); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc.n_apc == 1, "incorrect value for last_msg.msg.ssr_satellite_apc.n_apc, expected 1, is %d", last_msg.msg.ssr_satellite_apc.n_apc); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc.sol_id == 2, "incorrect value for last_msg.msg.ssr_satellite_apc.sol_id, expected 2, is %d", last_msg.msg.ssr_satellite_apc.sol_id); - - - ck_assert_msg(last_msg.msg.ssr_satellite_apc.time.tow == 604799, "incorrect value for last_msg.msg.ssr_satellite_apc.time.tow, expected 604799, is %d", last_msg.msg.ssr_satellite_apc.time.tow); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc.time.wn == 2222, "incorrect value for last_msg.msg.ssr_satellite_apc.time.wn, expected 2222, is %d", last_msg.msg.ssr_satellite_apc.time.wn); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc.update_interval == 1, "incorrect value for last_msg.msg.ssr_satellite_apc.update_interval, expected 1, is %d", last_msg.msg.ssr_satellite_apc.update_interval); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pco[0] == 1, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pco[0], " + "expected 1, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pco[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pco[1] == -1, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pco[1], " + "expected -1, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pco[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pco[2] == 729, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pco[2], " + "expected 729, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pco[2]); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[0] == 11, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[0], " + "expected 11, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[1] == 10, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[1], " + "expected 10, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[2] == 8, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[2], " + "expected 8, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[2]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[3] == 5, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[3], " + "expected 5, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[3]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[4] == 1, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[4], " + "expected 1, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[4]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[5] == -4, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[5], " + "expected -4, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[5]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[6] == -8, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[6], " + "expected -8, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[6]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[7] == -10, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[7], " + "expected -10, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[7]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[8] == -10, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[8], " + "expected -10, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[8]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[9] == -10, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[9], " + "expected -10, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[9]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[10] == -7, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[10], " + "expected -7, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[10]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[11] == -4, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[11], " + "expected -4, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[11]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[12] == 0, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[12], " + "expected 0, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[12]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[13] == 6, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[13], " + "expected 6, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[13]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[14] == 12, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[14], " + "expected 12, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[14]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[15] == 22, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[15], " + "expected 22, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[15]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[16] == 30, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[16], " + "expected 30, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[16]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[17] == 41, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[17], " + "expected 41, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[17]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[18] == 41, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[18], " + "expected 41, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[18]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[19] == 41, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[19], " + "expected 41, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[19]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].pcv[20] == 41, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].pcv[20], " + "expected 41, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].pcv[20]); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].sat_info == 4, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].sat_info, " + "expected 4, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].sat_info); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].sid.code == 0, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].sid.code, " + "expected 0, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].sid.code); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].sid.sat == 2, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].sid.sat, " + "expected 2, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].sid.sat); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.apc[0].svn == 61, + "incorrect value for last_msg.msg.ssr_satellite_apc.apc[0].svn, " + "expected 61, is %d", + last_msg.msg.ssr_satellite_apc.apc[0].svn); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc.iod_ssr == 3, + "incorrect value for last_msg.msg.ssr_satellite_apc.iod_ssr, " + "expected 3, is %d", + last_msg.msg.ssr_satellite_apc.iod_ssr); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc.n_apc == 1, + "incorrect value for last_msg.msg.ssr_satellite_apc.n_apc, " + "expected 1, is %d", + last_msg.msg.ssr_satellite_apc.n_apc); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc.sol_id == 2, + "incorrect value for last_msg.msg.ssr_satellite_apc.sol_id, " + "expected 2, is %d", + last_msg.msg.ssr_satellite_apc.sol_id); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.time.tow == 604799, + "incorrect value for last_msg.msg.ssr_satellite_apc.time.tow, expected " + "604799, is %d", + last_msg.msg.ssr_satellite_apc.time.tow); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc.time.wn == 2222, + "incorrect value for last_msg.msg.ssr_satellite_apc.time.wn, " + "expected 2222, is %d", + last_msg.msg.ssr_satellite_apc.time.wn); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc.update_interval == 1, + "incorrect value for last_msg.msg.ssr_satellite_apc.update_interval, " + "expected 1, is %d", + last_msg.msg.ssr_satellite_apc.update_interval); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrSatelliteApc_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrSatelliteApc"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrSatelliteApc"); +Suite *auto_check_sbp_ssr_MsgSsrSatelliteApc_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ssr_MsgSsrSatelliteApc"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrSatelliteApc"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrSatelliteApc); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.c b/c/test/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.c index 3d569188a..9e06b8d00 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApcDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApcDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,714 +90,1487 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x604, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x604, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,6,56,19,224,203,169,240,78,4,213,171,254,214,212,4,8,33,31,80,21,4,105,225,39,139,124,149,48,15,214,197,141,32,33,135,150,148,123,49,135,97,39,90,20,169,239,47,153,175,35,145,145,123,194,2,102,74,149,95,171,238,249,7,237,170,125,106,158,83,188,181,194,27,84,226,142,123,77,217,248,67,215,129,114,138,25,240,10,56,76,61,161,216,22,181,174,33,13,252,236,230,196,128,215,239,234,179,220,44,212,57,44,173,49,36,137,248,235,97,112,157,139,26,115,192,31,85,127,228,81,252,219,249,110,147,8,161,215,212,180,25,83,144,247,12,27,199,173,74,23,4,239,103,223,220,139,91,127,214,86,48,203,228,99,45,83,159,11,250,135,170,42,217,199,233,42,170,78,206,41,43,81,247,99,198,144,2,132,2,224,220,148,58,85,138,210,200,158,7,158,67,46,200,132,118,241,13,37,62,107,253,190,136,66,9,84,155,86,180,41,196,40,119,101,252,223,144,153,50,13, }; + u8 encoded_frame[] = { + 85, 4, 6, 56, 19, 224, 203, 169, 240, 78, 4, 213, 171, 254, + 214, 212, 4, 8, 33, 31, 80, 21, 4, 105, 225, 39, 139, 124, + 149, 48, 15, 214, 197, 141, 32, 33, 135, 150, 148, 123, 49, 135, + 97, 39, 90, 20, 169, 239, 47, 153, 175, 35, 145, 145, 123, 194, + 2, 102, 74, 149, 95, 171, 238, 249, 7, 237, 170, 125, 106, 158, + 83, 188, 181, 194, 27, 84, 226, 142, 123, 77, 217, 248, 67, 215, + 129, 114, 138, 25, 240, 10, 56, 76, 61, 161, 216, 22, 181, 174, + 33, 13, 252, 236, 230, 196, 128, 215, 239, 234, 179, 220, 44, 212, + 57, 44, 173, 49, 36, 137, 248, 235, 97, 112, 157, 139, 26, 115, + 192, 31, 85, 127, 228, 81, 252, 219, 249, 110, 147, 8, 161, 215, + 212, 180, 25, 83, 144, 247, 12, 27, 199, 173, 74, 23, 4, 239, + 103, 223, 220, 139, 91, 127, 214, 86, 48, 203, 228, 99, 45, 83, + 159, 11, 250, 135, 170, 42, 217, 199, 233, 42, 170, 78, 206, 41, + 43, 81, 247, 99, 198, 144, 2, 132, 2, 224, 220, 148, 58, 85, + 138, 210, 200, 158, 7, 158, 67, 46, 200, 132, 118, 241, 13, 37, + 62, 107, 253, 190, 136, 66, 9, 84, 155, 86, 180, 41, 196, 40, + 119, 101, 252, 223, 144, 153, 50, 13, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - - + test_msg.ssr_satellite_apc_dep.apc[0].pco[0] = -21547; - + test_msg.ssr_satellite_apc_dep.apc[0].pco[1] = -10498; - + test_msg.ssr_satellite_apc_dep.apc[0].pco[2] = 1236; - - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[0] = 8; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[1] = 33; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[2] = 31; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[3] = 80; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[4] = 21; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[5] = 4; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[6] = 105; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[7] = -31; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[8] = 39; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[9] = -117; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[10] = 124; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[11] = -107; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[12] = 48; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[13] = 15; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[14] = -42; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[15] = -59; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[16] = -115; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[17] = 32; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[18] = 33; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[19] = -121; - + test_msg.ssr_satellite_apc_dep.apc[0].pcv[20] = -106; - + test_msg.ssr_satellite_apc_dep.apc[0].sat_info = 240; - - + test_msg.ssr_satellite_apc_dep.apc[0].sid.code = 169; - + test_msg.ssr_satellite_apc_dep.apc[0].sid.sat = 203; - + test_msg.ssr_satellite_apc_dep.apc[0].svn = 1102; - - - + test_msg.ssr_satellite_apc_dep.apc[1].pco[0] = 23079; - + test_msg.ssr_satellite_apc_dep.apc[1].pco[1] = -22252; - + test_msg.ssr_satellite_apc_dep.apc[1].pco[2] = 12271; - - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[0] = -103; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[1] = -81; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[2] = 35; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[3] = -111; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[4] = -111; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[5] = 123; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[6] = -62; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[7] = 2; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[8] = 102; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[9] = 74; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[10] = -107; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[11] = 95; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[12] = -85; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[13] = -18; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[14] = -7; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[15] = 7; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[16] = -19; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[17] = -86; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[18] = 125; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[19] = 106; - + test_msg.ssr_satellite_apc_dep.apc[1].pcv[20] = -98; - + test_msg.ssr_satellite_apc_dep.apc[1].sat_info = 49; - - + test_msg.ssr_satellite_apc_dep.apc[1].sid.code = 123; - + test_msg.ssr_satellite_apc_dep.apc[1].sid.sat = 148; - + test_msg.ssr_satellite_apc_dep.apc[1].svn = 24967; - - - + test_msg.ssr_satellite_apc_dep.apc[2].pco[0] = -7596; - + test_msg.ssr_satellite_apc_dep.apc[2].pco[1] = 31630; - + test_msg.ssr_satellite_apc_dep.apc[2].pco[2] = -9907; - - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[0] = -8; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[1] = 67; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[2] = -41; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[3] = -127; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[4] = 114; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[5] = -118; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[6] = 25; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[7] = -16; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[8] = 10; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[9] = 56; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[10] = 76; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[11] = 61; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[12] = -95; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[13] = -40; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[14] = 22; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[15] = -75; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[16] = -82; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[17] = 33; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[18] = 13; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[19] = -4; - + test_msg.ssr_satellite_apc_dep.apc[2].pcv[20] = -20; - + test_msg.ssr_satellite_apc_dep.apc[2].sat_info = 181; - - + test_msg.ssr_satellite_apc_dep.apc[2].sid.code = 188; - + test_msg.ssr_satellite_apc_dep.apc[2].sid.sat = 83; - + test_msg.ssr_satellite_apc_dep.apc[2].svn = 7106; - - - + test_msg.ssr_satellite_apc_dep.apc[3].pco[0] = -19478; - + test_msg.ssr_satellite_apc_dep.apc[3].pco[1] = 11484; - + test_msg.ssr_satellite_apc_dep.apc[3].pco[2] = 14804; - - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[0] = 44; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[1] = -83; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[2] = 49; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[3] = 36; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[4] = -119; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[5] = -8; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[6] = -21; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[7] = 97; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[8] = 112; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[9] = -99; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[10] = -117; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[11] = 26; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[12] = 115; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[13] = -64; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[14] = 31; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[15] = 85; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[16] = 127; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[17] = -28; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[18] = 81; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[19] = -4; - + test_msg.ssr_satellite_apc_dep.apc[3].pcv[20] = -37; - + test_msg.ssr_satellite_apc_dep.apc[3].sat_info = 128; - - + test_msg.ssr_satellite_apc_dep.apc[3].sid.code = 196; - + test_msg.ssr_satellite_apc_dep.apc[3].sid.sat = 230; - + test_msg.ssr_satellite_apc_dep.apc[3].svn = 61399; - - - + test_msg.ssr_satellite_apc_dep.apc[4].pco[0] = -11049; - + test_msg.ssr_satellite_apc_dep.apc[4].pco[1] = 6580; - + test_msg.ssr_satellite_apc_dep.apc[4].pco[2] = -28589; - - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[0] = -9; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[1] = 12; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[2] = 27; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[3] = -57; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[4] = -83; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[5] = 74; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[6] = 23; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[7] = 4; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[8] = -17; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[9] = 103; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[10] = -33; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[11] = -36; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[12] = -117; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[13] = 91; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[14] = 127; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[15] = -42; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[16] = 86; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[17] = 48; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[18] = -53; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[19] = -28; - + test_msg.ssr_satellite_apc_dep.apc[4].pcv[20] = 99; - + test_msg.ssr_satellite_apc_dep.apc[4].sat_info = 147; - - + test_msg.ssr_satellite_apc_dep.apc[4].sid.code = 110; - + test_msg.ssr_satellite_apc_dep.apc[4].sid.sat = 249; - + test_msg.ssr_satellite_apc_dep.apc[4].svn = 41224; - - - + test_msg.ssr_satellite_apc_dep.apc[5].pco[0] = -21881; - + test_msg.ssr_satellite_apc_dep.apc[5].pco[1] = -9942; - + test_msg.ssr_satellite_apc_dep.apc[5].pco[2] = -5689; - - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[0] = 42; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[1] = -86; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[2] = 78; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[3] = -50; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[4] = 41; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[5] = 43; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[6] = 81; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[7] = -9; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[8] = 99; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[9] = -58; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[10] = -112; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[11] = 2; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[12] = -124; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[13] = 2; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[14] = -32; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[15] = -36; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[16] = -108; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[17] = 58; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[18] = 85; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[19] = -118; - + test_msg.ssr_satellite_apc_dep.apc[5].pcv[20] = -46; - + test_msg.ssr_satellite_apc_dep.apc[5].sat_info = 159; - - + test_msg.ssr_satellite_apc_dep.apc[5].sid.code = 83; - + test_msg.ssr_satellite_apc_dep.apc[5].sid.sat = 45; - + test_msg.ssr_satellite_apc_dep.apc[5].svn = 64011; - - - + test_msg.ssr_satellite_apc_dep.apc[6].pco[0] = -14290; - + test_msg.ssr_satellite_apc_dep.apc[6].pco[1] = 30340; - + test_msg.ssr_satellite_apc_dep.apc[6].pco[2] = 3569; - - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[0] = 37; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[1] = 62; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[2] = 107; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[3] = -3; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[4] = -66; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[5] = -120; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[6] = 66; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[7] = 9; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[8] = 84; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[9] = -101; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[10] = 86; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[11] = -76; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[12] = 41; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[13] = -60; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[14] = 40; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[15] = 119; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[16] = 101; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[17] = -4; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[18] = -33; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[19] = -112; - + test_msg.ssr_satellite_apc_dep.apc[6].pcv[20] = -103; - + test_msg.ssr_satellite_apc_dep.apc[6].sat_info = 7; - - + test_msg.ssr_satellite_apc_dep.apc[6].sid.code = 158; - + test_msg.ssr_satellite_apc_dep.apc[6].sid.sat = 200; - + test_msg.ssr_satellite_apc_dep.apc[6].svn = 17310; - + test_msg.ssr_satellite_apc_dep.n_apc = 7; - sbp_message_send(&sbp_state, SbpMsgSsrSatelliteApcDep, 4920, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrSatelliteApcDep, 4920, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4920, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrSatelliteApcDep, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[0] == -21547, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[0], expected -21547, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[1] == -10498, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[1], expected -10498, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[2] == 1236, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[2], expected 1236, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[2]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[0] == 8, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[0], expected 8, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[1] == 33, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[1], expected 33, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[2] == 31, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[2], expected 31, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[2]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[3] == 80, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[3], expected 80, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[3]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[4] == 21, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[4], expected 21, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[4]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[5] == 4, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[5], expected 4, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[5]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[6] == 105, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[6], expected 105, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[6]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[7] == -31, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[7], expected -31, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[7]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[8] == 39, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[8], expected 39, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[8]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[9] == -117, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[9], expected -117, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[9]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[10] == 124, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[10], expected 124, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[10]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[11] == -107, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[11], expected -107, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[11]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[12] == 48, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[12], expected 48, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[12]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[13] == 15, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[13], expected 15, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[13]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[14] == -42, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[14], expected -42, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[14]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[15] == -59, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[15], expected -59, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[15]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[16] == -115, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[16], expected -115, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[16]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[17] == 32, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[17], expected 32, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[17]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[18] == 33, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[18], expected 33, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[18]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[19] == -121, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[19], expected -121, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[19]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[20] == -106, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[20], expected -106, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[20]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].sat_info == 240, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].sat_info, expected 240, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].sat_info); - - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].sid.code == 169, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].sid.code, expected 169, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].sid.code); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].sid.sat == 203, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].sid.sat, expected 203, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].sid.sat); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].svn == 1102, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].svn, expected 1102, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[0].svn); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[0] == 23079, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[0], expected 23079, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[1] == -22252, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[1], expected -22252, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[2] == 12271, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[2], expected 12271, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[2]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[0] == -103, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[0], expected -103, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[1] == -81, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[1], expected -81, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[2] == 35, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[2], expected 35, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[2]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[3] == -111, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[3], expected -111, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[3]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[4] == -111, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[4], expected -111, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[4]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[5] == 123, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[5], expected 123, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[5]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[6] == -62, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[6], expected -62, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[6]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[7] == 2, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[7], expected 2, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[7]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[8] == 102, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[8], expected 102, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[8]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[9] == 74, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[9], expected 74, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[9]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[10] == -107, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[10], expected -107, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[10]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[11] == 95, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[11], expected 95, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[11]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[12] == -85, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[12], expected -85, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[12]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[13] == -18, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[13], expected -18, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[13]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[14] == -7, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[14], expected -7, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[14]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[15] == 7, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[15], expected 7, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[15]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[16] == -19, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[16], expected -19, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[16]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[17] == -86, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[17], expected -86, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[17]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[18] == 125, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[18], expected 125, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[18]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[19] == 106, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[19], expected 106, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[19]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[20] == -98, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[20], expected -98, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[20]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].sat_info == 49, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].sat_info, expected 49, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].sat_info); - - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].sid.code == 123, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].sid.code, expected 123, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].sid.code); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].sid.sat == 148, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].sid.sat, expected 148, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].sid.sat); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].svn == 24967, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].svn, expected 24967, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[1].svn); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[0] == -7596, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[0], expected -7596, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[1] == 31630, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[1], expected 31630, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[2] == -9907, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[2], expected -9907, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[2]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[0] == -8, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[0], expected -8, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[1] == 67, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[1], expected 67, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[2] == -41, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[2], expected -41, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[2]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[3] == -127, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[3], expected -127, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[3]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[4] == 114, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[4], expected 114, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[4]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[5] == -118, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[5], expected -118, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[5]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[6] == 25, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[6], expected 25, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[6]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[7] == -16, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[7], expected -16, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[7]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[8] == 10, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[8], expected 10, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[8]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[9] == 56, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[9], expected 56, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[9]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[10] == 76, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[10], expected 76, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[10]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[11] == 61, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[11], expected 61, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[11]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[12] == -95, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[12], expected -95, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[12]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[13] == -40, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[13], expected -40, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[13]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[14] == 22, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[14], expected 22, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[14]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[15] == -75, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[15], expected -75, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[15]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[16] == -82, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[16], expected -82, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[16]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[17] == 33, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[17], expected 33, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[17]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[18] == 13, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[18], expected 13, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[18]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[19] == -4, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[19], expected -4, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[19]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[20] == -20, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[20], expected -20, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[20]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].sat_info == 181, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].sat_info, expected 181, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].sat_info); - - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].sid.code == 188, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].sid.code, expected 188, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].sid.code); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].sid.sat == 83, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].sid.sat, expected 83, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].sid.sat); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].svn == 7106, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].svn, expected 7106, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[2].svn); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[0] == -19478, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[0], expected -19478, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[1] == 11484, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[1], expected 11484, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[2] == 14804, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[2], expected 14804, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[2]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[0] == 44, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[0], expected 44, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[1] == -83, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[1], expected -83, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[2] == 49, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[2], expected 49, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[2]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[3] == 36, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[3], expected 36, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[3]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[4] == -119, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[4], expected -119, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[4]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[5] == -8, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[5], expected -8, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[5]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[6] == -21, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[6], expected -21, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[6]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[7] == 97, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[7], expected 97, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[7]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[8] == 112, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[8], expected 112, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[8]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[9] == -99, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[9], expected -99, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[9]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[10] == -117, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[10], expected -117, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[10]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[11] == 26, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[11], expected 26, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[11]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[12] == 115, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[12], expected 115, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[12]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[13] == -64, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[13], expected -64, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[13]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[14] == 31, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[14], expected 31, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[14]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[15] == 85, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[15], expected 85, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[15]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[16] == 127, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[16], expected 127, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[16]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[17] == -28, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[17], expected -28, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[17]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[18] == 81, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[18], expected 81, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[18]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[19] == -4, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[19], expected -4, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[19]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[20] == -37, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[20], expected -37, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[20]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].sat_info == 128, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].sat_info, expected 128, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].sat_info); - - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].sid.code == 196, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].sid.code, expected 196, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].sid.code); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].sid.sat == 230, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].sid.sat, expected 230, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].sid.sat); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].svn == 61399, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].svn, expected 61399, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[3].svn); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[0] == -11049, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[0], expected -11049, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[1] == 6580, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[1], expected 6580, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[2] == -28589, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[2], expected -28589, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[2]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[0] == -9, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[0], expected -9, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[1] == 12, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[1], expected 12, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[2] == 27, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[2], expected 27, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[2]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[3] == -57, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[3], expected -57, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[3]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[4] == -83, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[4], expected -83, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[4]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[5] == 74, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[5], expected 74, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[5]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[6] == 23, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[6], expected 23, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[6]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[7] == 4, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[7], expected 4, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[7]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[8] == -17, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[8], expected -17, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[8]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[9] == 103, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[9], expected 103, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[9]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[10] == -33, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[10], expected -33, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[10]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[11] == -36, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[11], expected -36, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[11]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[12] == -117, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[12], expected -117, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[12]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[13] == 91, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[13], expected 91, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[13]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[14] == 127, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[14], expected 127, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[14]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[15] == -42, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[15], expected -42, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[15]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[16] == 86, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[16], expected 86, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[16]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[17] == 48, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[17], expected 48, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[17]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[18] == -53, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[18], expected -53, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[18]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[19] == -28, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[19], expected -28, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[19]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[20] == 99, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[20], expected 99, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[20]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].sat_info == 147, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].sat_info, expected 147, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].sat_info); - - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].sid.code == 110, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].sid.code, expected 110, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].sid.code); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].sid.sat == 249, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].sid.sat, expected 249, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].sid.sat); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].svn == 41224, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].svn, expected 41224, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[4].svn); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[0] == -21881, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[0], expected -21881, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[1] == -9942, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[1], expected -9942, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[2] == -5689, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[2], expected -5689, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[2]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[0] == 42, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[0], expected 42, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[1] == -86, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[1], expected -86, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[2] == 78, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[2], expected 78, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[2]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[3] == -50, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[3], expected -50, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[3]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[4] == 41, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[4], expected 41, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[4]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[5] == 43, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[5], expected 43, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[5]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[6] == 81, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[6], expected 81, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[6]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[7] == -9, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[7], expected -9, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[7]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[8] == 99, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[8], expected 99, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[8]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[9] == -58, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[9], expected -58, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[9]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[10] == -112, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[10], expected -112, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[10]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[11] == 2, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[11], expected 2, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[11]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[12] == -124, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[12], expected -124, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[12]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[13] == 2, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[13], expected 2, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[13]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[14] == -32, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[14], expected -32, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[14]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[15] == -36, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[15], expected -36, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[15]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[16] == -108, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[16], expected -108, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[16]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[17] == 58, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[17], expected 58, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[17]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[18] == 85, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[18], expected 85, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[18]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[19] == -118, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[19], expected -118, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[19]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[20] == -46, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[20], expected -46, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[20]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].sat_info == 159, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].sat_info, expected 159, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].sat_info); - - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].sid.code == 83, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].sid.code, expected 83, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].sid.code); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].sid.sat == 45, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].sid.sat, expected 45, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].sid.sat); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].svn == 64011, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].svn, expected 64011, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[5].svn); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[0] == -14290, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[0], expected -14290, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[1] == 30340, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[1], expected 30340, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[2] == 3569, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[2], expected 3569, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[2]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[0] == 37, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[0], expected 37, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[0]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[1] == 62, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[1], expected 62, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[1]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[2] == 107, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[2], expected 107, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[2]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[3] == -3, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[3], expected -3, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[3]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[4] == -66, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[4], expected -66, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[4]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[5] == -120, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[5], expected -120, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[5]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[6] == 66, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[6], expected 66, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[6]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[7] == 9, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[7], expected 9, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[7]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[8] == 84, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[8], expected 84, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[8]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[9] == -101, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[9], expected -101, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[9]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[10] == 86, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[10], expected 86, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[10]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[11] == -76, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[11], expected -76, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[11]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[12] == 41, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[12], expected 41, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[12]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[13] == -60, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[13], expected -60, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[13]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[14] == 40, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[14], expected 40, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[14]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[15] == 119, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[15], expected 119, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[15]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[16] == 101, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[16], expected 101, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[16]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[17] == -4, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[17], expected -4, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[17]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[18] == -33, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[18], expected -33, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[18]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[19] == -112, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[19], expected -112, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[19]); - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[20] == -103, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[20], expected -103, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[20]); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].sat_info == 7, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].sat_info, expected 7, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].sat_info); - - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].sid.code == 158, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].sid.code, expected 158, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].sid.code); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].sid.sat == 200, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].sid.sat, expected 200, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].sid.sat); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].svn == 17310, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].svn, expected 17310, is %d", last_msg.msg.ssr_satellite_apc_dep.apc[6].svn); - - ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.n_apc == 7, "incorrect value for last_msg.msg.ssr_satellite_apc_dep.n_apc, expected 7, is %d", last_msg.msg.ssr_satellite_apc_dep.n_apc); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrSatelliteApcDep, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[0] == -21547, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[0], " + "expected -21547, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[1] == -10498, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[1], " + "expected -10498, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[2] == 1236, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[2], " + "expected 1236, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pco[2]); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[0] == 8, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[0], " + "expected 8, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[1] == 33, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[1], " + "expected 33, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[2] == 31, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[2], " + "expected 31, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[2]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[3] == 80, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[3], " + "expected 80, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[3]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[4] == 21, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[4], " + "expected 21, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[4]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[5] == 4, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[5], " + "expected 4, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[5]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[6] == 105, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[6], " + "expected 105, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[6]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[7] == -31, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[7], " + "expected -31, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[7]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[8] == 39, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[8], " + "expected 39, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[8]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[9] == -117, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[9], " + "expected -117, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[9]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[10] == 124, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[10], expected " + "124, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[10]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[11] == -107, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[11], expected " + "-107, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[11]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[12] == 48, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[12], expected 48, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[12]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[13] == 15, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[13], expected 15, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[13]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[14] == -42, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[14], expected " + "-42, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[14]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[15] == -59, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[15], expected " + "-59, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[15]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[16] == -115, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[16], expected " + "-115, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[16]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[17] == 32, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[17], expected 32, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[17]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[18] == 33, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[18], expected 33, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[18]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[19] == -121, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[19], expected " + "-121, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[19]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[20] == -106, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[20], expected " + "-106, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].pcv[20]); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].sat_info == 240, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[0].sat_info, " + "expected 240, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].sat_info); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].sid.code == 169, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[0].sid.code, " + "expected 169, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].sid.code); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[0].sid.sat == 203, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[0].sid.sat, expected " + "203, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].sid.sat); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[0].svn == 1102, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[0].svn, " + "expected 1102, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[0].svn); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[0] == 23079, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[0], " + "expected 23079, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[1] == -22252, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[1], " + "expected -22252, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[2] == 12271, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[2], " + "expected 12271, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pco[2]); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[0] == -103, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[0], " + "expected -103, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[1] == -81, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[1], " + "expected -81, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[2] == 35, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[2], " + "expected 35, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[2]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[3] == -111, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[3], " + "expected -111, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[3]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[4] == -111, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[4], " + "expected -111, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[4]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[5] == 123, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[5], " + "expected 123, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[5]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[6] == -62, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[6], " + "expected -62, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[6]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[7] == 2, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[7], " + "expected 2, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[7]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[8] == 102, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[8], " + "expected 102, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[8]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[9] == 74, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[9], " + "expected 74, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[9]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[10] == -107, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[10], expected " + "-107, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[10]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[11] == 95, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[11], expected 95, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[11]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[12] == -85, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[12], expected " + "-85, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[12]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[13] == -18, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[13], expected " + "-18, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[13]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[14] == -7, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[14], expected -7, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[14]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[15] == 7, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[15], expected 7, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[15]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[16] == -19, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[16], expected " + "-19, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[16]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[17] == -86, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[17], expected " + "-86, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[17]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[18] == 125, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[18], expected " + "125, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[18]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[19] == 106, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[19], expected " + "106, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[19]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[20] == -98, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[20], expected " + "-98, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].pcv[20]); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].sat_info == 49, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[1].sat_info, " + "expected 49, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].sat_info); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].sid.code == 123, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[1].sid.code, " + "expected 123, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].sid.code); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[1].sid.sat == 148, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[1].sid.sat, expected " + "148, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].sid.sat); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[1].svn == 24967, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[1].svn, " + "expected 24967, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[1].svn); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[0] == -7596, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[0], " + "expected -7596, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[1] == 31630, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[1], " + "expected 31630, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[2] == -9907, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[2], " + "expected -9907, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pco[2]); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[0] == -8, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[0], " + "expected -8, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[1] == 67, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[1], " + "expected 67, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[2] == -41, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[2], " + "expected -41, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[2]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[3] == -127, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[3], " + "expected -127, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[3]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[4] == 114, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[4], " + "expected 114, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[4]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[5] == -118, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[5], " + "expected -118, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[5]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[6] == 25, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[6], " + "expected 25, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[6]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[7] == -16, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[7], " + "expected -16, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[7]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[8] == 10, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[8], " + "expected 10, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[8]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[9] == 56, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[9], " + "expected 56, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[9]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[10] == 76, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[10], expected 76, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[10]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[11] == 61, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[11], expected 61, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[11]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[12] == -95, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[12], expected " + "-95, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[12]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[13] == -40, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[13], expected " + "-40, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[13]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[14] == 22, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[14], expected 22, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[14]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[15] == -75, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[15], expected " + "-75, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[15]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[16] == -82, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[16], expected " + "-82, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[16]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[17] == 33, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[17], expected 33, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[17]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[18] == 13, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[18], expected 13, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[18]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[19] == -4, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[19], expected -4, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[19]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[20] == -20, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[20], expected " + "-20, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].pcv[20]); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].sat_info == 181, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[2].sat_info, " + "expected 181, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].sat_info); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[2].sid.code == 188, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[2].sid.code, " + "expected 188, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].sid.code); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].sid.sat == 83, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[2].sid.sat, expected 83, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].sid.sat); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[2].svn == 7106, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[2].svn, " + "expected 7106, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[2].svn); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[0] == -19478, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[0], " + "expected -19478, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[1] == 11484, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[1], " + "expected 11484, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[2] == 14804, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[2], " + "expected 14804, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pco[2]); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[0] == 44, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[0], " + "expected 44, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[1] == -83, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[1], " + "expected -83, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[2] == 49, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[2], " + "expected 49, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[2]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[3] == 36, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[3], " + "expected 36, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[3]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[4] == -119, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[4], " + "expected -119, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[4]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[5] == -8, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[5], " + "expected -8, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[5]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[6] == -21, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[6], " + "expected -21, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[6]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[7] == 97, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[7], " + "expected 97, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[7]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[8] == 112, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[8], " + "expected 112, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[8]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[9] == -99, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[9], " + "expected -99, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[9]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[10] == -117, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[10], expected " + "-117, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[10]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[11] == 26, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[11], expected 26, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[11]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[12] == 115, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[12], expected " + "115, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[12]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[13] == -64, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[13], expected " + "-64, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[13]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[14] == 31, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[14], expected 31, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[14]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[15] == 85, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[15], expected 85, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[15]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[16] == 127, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[16], expected " + "127, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[16]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[17] == -28, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[17], expected " + "-28, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[17]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[18] == 81, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[18], expected 81, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[18]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[19] == -4, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[19], expected -4, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[19]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[20] == -37, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[20], expected " + "-37, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].pcv[20]); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].sat_info == 128, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[3].sat_info, " + "expected 128, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].sat_info); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].sid.code == 196, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[3].sid.code, " + "expected 196, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].sid.code); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[3].sid.sat == 230, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[3].sid.sat, expected " + "230, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].sid.sat); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[3].svn == 61399, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[3].svn, " + "expected 61399, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[3].svn); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[0] == -11049, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[0], " + "expected -11049, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[1] == 6580, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[1], " + "expected 6580, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[2] == -28589, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[2], " + "expected -28589, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pco[2]); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[0] == -9, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[0], " + "expected -9, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[1] == 12, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[1], " + "expected 12, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[2] == 27, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[2], " + "expected 27, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[2]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[3] == -57, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[3], " + "expected -57, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[3]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[4] == -83, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[4], " + "expected -83, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[4]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[5] == 74, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[5], " + "expected 74, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[5]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[6] == 23, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[6], " + "expected 23, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[6]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[7] == 4, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[7], " + "expected 4, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[7]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[8] == -17, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[8], " + "expected -17, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[8]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[9] == 103, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[9], " + "expected 103, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[9]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[10] == -33, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[10], expected " + "-33, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[10]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[11] == -36, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[11], expected " + "-36, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[11]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[12] == -117, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[12], expected " + "-117, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[12]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[13] == 91, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[13], expected 91, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[13]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[14] == 127, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[14], expected " + "127, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[14]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[15] == -42, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[15], expected " + "-42, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[15]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[16] == 86, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[16], expected 86, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[16]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[17] == 48, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[17], expected 48, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[17]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[18] == -53, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[18], expected " + "-53, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[18]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[19] == -28, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[19], expected " + "-28, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[19]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[20] == 99, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[20], expected 99, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].pcv[20]); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].sat_info == 147, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[4].sat_info, " + "expected 147, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].sat_info); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].sid.code == 110, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[4].sid.code, " + "expected 110, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].sid.code); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[4].sid.sat == 249, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[4].sid.sat, expected " + "249, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].sid.sat); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[4].svn == 41224, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[4].svn, " + "expected 41224, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[4].svn); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[0] == -21881, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[0], " + "expected -21881, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[1] == -9942, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[1], " + "expected -9942, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[2] == -5689, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[2], " + "expected -5689, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pco[2]); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[0] == 42, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[0], " + "expected 42, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[1] == -86, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[1], " + "expected -86, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[2] == 78, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[2], " + "expected 78, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[2]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[3] == -50, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[3], " + "expected -50, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[3]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[4] == 41, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[4], " + "expected 41, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[4]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[5] == 43, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[5], " + "expected 43, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[5]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[6] == 81, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[6], " + "expected 81, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[6]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[7] == -9, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[7], " + "expected -9, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[7]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[8] == 99, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[8], " + "expected 99, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[8]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[9] == -58, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[9], " + "expected -58, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[9]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[10] == -112, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[10], expected " + "-112, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[10]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[11] == 2, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[11], expected 2, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[11]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[12] == -124, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[12], expected " + "-124, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[12]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[13] == 2, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[13], expected 2, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[13]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[14] == -32, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[14], expected " + "-32, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[14]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[15] == -36, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[15], expected " + "-36, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[15]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[16] == -108, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[16], expected " + "-108, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[16]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[17] == 58, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[17], expected 58, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[17]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[18] == 85, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[18], expected 85, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[18]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[19] == -118, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[19], expected " + "-118, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[19]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[20] == -46, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[20], expected " + "-46, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].pcv[20]); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].sat_info == 159, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[5].sat_info, " + "expected 159, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].sat_info); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[5].sid.code == 83, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[5].sid.code, " + "expected 83, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].sid.code); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].sid.sat == 45, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[5].sid.sat, expected 45, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].sid.sat); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[5].svn == 64011, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[5].svn, " + "expected 64011, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[5].svn); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[0] == -14290, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[0], " + "expected -14290, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[1] == 30340, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[1], " + "expected 30340, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[2] == 3569, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[2], " + "expected 3569, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pco[2]); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[0] == 37, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[0], " + "expected 37, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[0]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[1] == 62, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[1], " + "expected 62, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[1]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[2] == 107, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[2], " + "expected 107, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[2]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[3] == -3, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[3], " + "expected -3, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[3]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[4] == -66, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[4], " + "expected -66, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[4]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[5] == -120, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[5], " + "expected -120, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[5]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[6] == 66, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[6], " + "expected 66, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[6]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[7] == 9, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[7], " + "expected 9, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[7]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[8] == 84, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[8], " + "expected 84, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[8]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[9] == -101, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[9], " + "expected -101, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[9]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[10] == 86, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[10], expected 86, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[10]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[11] == -76, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[11], expected " + "-76, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[11]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[12] == 41, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[12], expected 41, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[12]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[13] == -60, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[13], expected " + "-60, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[13]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[14] == 40, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[14], expected 40, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[14]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[15] == 119, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[15], expected " + "119, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[15]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[16] == 101, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[16], expected " + "101, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[16]); + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[17] == -4, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[17], expected -4, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[17]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[18] == -33, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[18], expected " + "-33, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[18]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[19] == -112, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[19], expected " + "-112, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[19]); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[20] == -103, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[20], expected " + "-103, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].pcv[20]); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].sat_info == 7, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[6].sat_info, expected 7, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].sat_info); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].sid.code == 158, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[6].sid.code, " + "expected 158, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].sid.code); + + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.apc[6].sid.sat == 200, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.apc[6].sid.sat, expected " + "200, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].sid.sat); + + ck_assert_msg( + last_msg.msg.ssr_satellite_apc_dep.apc[6].svn == 17310, + "incorrect value for last_msg.msg.ssr_satellite_apc_dep.apc[6].svn, " + "expected 17310, is %d", + last_msg.msg.ssr_satellite_apc_dep.apc[6].svn); + ck_assert_msg(last_msg.msg.ssr_satellite_apc_dep.n_apc == 7, + "incorrect value for " + "last_msg.msg.ssr_satellite_apc_dep.n_apc, expected 7, is %d", + last_msg.msg.ssr_satellite_apc_dep.n_apc); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrSatelliteApcDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrSatelliteApcDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA"); +Suite *auto_check_sbp_ssr_MsgSsrSatelliteApcDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ssr_MsgSsrSatelliteApcDepA"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrStecCorrection.c b/c/test/auto_check_sbp_ssr_MsgSsrStecCorrection.c index d408e2167..a46da5072 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrStecCorrection.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrStecCorrection.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrection.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrection.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrStecCorrection ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrStecCorrection) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrStecCorrection ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,147 +90,255 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrStecCorrection ) logging_reset(); - sbp_callback_register(&sbp_state, 1533, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 1533, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,253,5,66,0,38,180,0,0,0,3,0,1,1,10,0,15,1,0,10,0,2,1,1,1,63,0,62,0,61,0,60,0,31,15,5,63,0,64,0,65,0,66,0,119,50, }; + u8 encoded_frame[] = { + 85, 253, 5, 66, 0, 38, 180, 0, 0, 0, 3, 0, 1, 1, 10, 0, + 15, 1, 0, 10, 0, 2, 1, 1, 1, 63, 0, 62, 0, 61, 0, 60, + 0, 31, 15, 5, 63, 0, 64, 0, 65, 0, 66, 0, 119, 50, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ssr_stec_correction.header.num_msgs = 1; - + test_msg.ssr_stec_correction.header.seq_num = 1; - + test_msg.ssr_stec_correction.header.sol_id = 0; - - + test_msg.ssr_stec_correction.header.time.tow = 180; - + test_msg.ssr_stec_correction.header.time.wn = 3; - + test_msg.ssr_stec_correction.header.update_interval = 10; - + test_msg.ssr_stec_correction.n_sats = 2; - + test_msg.ssr_stec_correction.ssr_iod_atmo = 15; - - - - + test_msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[0] = 63; - + test_msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[1] = 62; - + test_msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[2] = 61; - + test_msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[3] = 60; - + test_msg.ssr_stec_correction.stec_sat_list[0].stec_quality_indicator = 1; - - + test_msg.ssr_stec_correction.stec_sat_list[0].sv_id.constellation = 1; - + test_msg.ssr_stec_correction.stec_sat_list[0].sv_id.satId = 1; - - - + test_msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[0] = 63; - + test_msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[1] = 64; - + test_msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[2] = 65; - + test_msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[3] = 66; - + test_msg.ssr_stec_correction.stec_sat_list[1].stec_quality_indicator = 5; - - + test_msg.ssr_stec_correction.stec_sat_list[1].sv_id.constellation = 15; - + test_msg.ssr_stec_correction.stec_sat_list[1].sv_id.satId = 31; - + test_msg.ssr_stec_correction.tile_id = 10; - + test_msg.ssr_stec_correction.tile_set_id = 1; - sbp_message_send(&sbp_state, SbpMsgSsrStecCorrection, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrStecCorrection, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSsrStecCorrection, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSsrStecCorrection, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction.header.num_msgs == 1, "incorrect value for last_msg.msg.ssr_stec_correction.header.num_msgs, expected 1, is %d", last_msg.msg.ssr_stec_correction.header.num_msgs); - - ck_assert_msg(last_msg.msg.ssr_stec_correction.header.seq_num == 1, "incorrect value for last_msg.msg.ssr_stec_correction.header.seq_num, expected 1, is %d", last_msg.msg.ssr_stec_correction.header.seq_num); - - ck_assert_msg(last_msg.msg.ssr_stec_correction.header.sol_id == 0, "incorrect value for last_msg.msg.ssr_stec_correction.header.sol_id, expected 0, is %d", last_msg.msg.ssr_stec_correction.header.sol_id); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction.header.time.tow == 180, "incorrect value for last_msg.msg.ssr_stec_correction.header.time.tow, expected 180, is %d", last_msg.msg.ssr_stec_correction.header.time.tow); - - ck_assert_msg(last_msg.msg.ssr_stec_correction.header.time.wn == 3, "incorrect value for last_msg.msg.ssr_stec_correction.header.time.wn, expected 3, is %d", last_msg.msg.ssr_stec_correction.header.time.wn); - - ck_assert_msg(last_msg.msg.ssr_stec_correction.header.update_interval == 10, "incorrect value for last_msg.msg.ssr_stec_correction.header.update_interval, expected 10, is %d", last_msg.msg.ssr_stec_correction.header.update_interval); - - ck_assert_msg(last_msg.msg.ssr_stec_correction.n_sats == 2, "incorrect value for last_msg.msg.ssr_stec_correction.n_sats, expected 2, is %d", last_msg.msg.ssr_stec_correction.n_sats); - - ck_assert_msg(last_msg.msg.ssr_stec_correction.ssr_iod_atmo == 15, "incorrect value for last_msg.msg.ssr_stec_correction.ssr_iod_atmo, expected 15, is %d", last_msg.msg.ssr_stec_correction.ssr_iod_atmo); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[0] == 63, "incorrect value for last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[0], expected 63, is %d", last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[1] == 62, "incorrect value for last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[1], expected 62, is %d", last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[2] == 61, "incorrect value for last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[2], expected 61, is %d", last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[3] == 60, "incorrect value for last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[3], expected 60, is %d", last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_quality_indicator == 1, "incorrect value for last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_quality_indicator, expected 1, is %d", last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[0].sv_id.constellation == 1, "incorrect value for last_msg.msg.ssr_stec_correction.stec_sat_list[0].sv_id.constellation, expected 1, is %d", last_msg.msg.ssr_stec_correction.stec_sat_list[0].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[0].sv_id.satId == 1, "incorrect value for last_msg.msg.ssr_stec_correction.stec_sat_list[0].sv_id.satId, expected 1, is %d", last_msg.msg.ssr_stec_correction.stec_sat_list[0].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[0] == 63, "incorrect value for last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[0], expected 63, is %d", last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[1] == 64, "incorrect value for last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[1], expected 64, is %d", last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[2] == 65, "incorrect value for last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[2], expected 65, is %d", last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[3] == 66, "incorrect value for last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[3], expected 66, is %d", last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_quality_indicator == 5, "incorrect value for last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_quality_indicator, expected 5, is %d", last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[1].sv_id.constellation == 15, "incorrect value for last_msg.msg.ssr_stec_correction.stec_sat_list[1].sv_id.constellation, expected 15, is %d", last_msg.msg.ssr_stec_correction.stec_sat_list[1].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[1].sv_id.satId == 31, "incorrect value for last_msg.msg.ssr_stec_correction.stec_sat_list[1].sv_id.satId, expected 31, is %d", last_msg.msg.ssr_stec_correction.stec_sat_list[1].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction.tile_id == 10, "incorrect value for last_msg.msg.ssr_stec_correction.tile_id, expected 10, is %d", last_msg.msg.ssr_stec_correction.tile_id); - - ck_assert_msg(last_msg.msg.ssr_stec_correction.tile_set_id == 1, "incorrect value for last_msg.msg.ssr_stec_correction.tile_set_id, expected 1, is %d", last_msg.msg.ssr_stec_correction.tile_set_id); + ck_assert_msg( + last_msg.msg.ssr_stec_correction.header.num_msgs == 1, + "incorrect value for last_msg.msg.ssr_stec_correction.header.num_msgs, " + "expected 1, is %d", + last_msg.msg.ssr_stec_correction.header.num_msgs); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction.header.seq_num == 1, + "incorrect value for last_msg.msg.ssr_stec_correction.header.seq_num, " + "expected 1, is %d", + last_msg.msg.ssr_stec_correction.header.seq_num); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction.header.sol_id == 0, + "incorrect value for last_msg.msg.ssr_stec_correction.header.sol_id, " + "expected 0, is %d", + last_msg.msg.ssr_stec_correction.header.sol_id); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction.header.time.tow == 180, + "incorrect value for last_msg.msg.ssr_stec_correction.header.time.tow, " + "expected 180, is %d", + last_msg.msg.ssr_stec_correction.header.time.tow); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction.header.time.wn == 3, + "incorrect value for last_msg.msg.ssr_stec_correction.header.time.wn, " + "expected 3, is %d", + last_msg.msg.ssr_stec_correction.header.time.wn); + + ck_assert_msg(last_msg.msg.ssr_stec_correction.header.update_interval == 10, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.header.update_interval, " + "expected 10, is %d", + last_msg.msg.ssr_stec_correction.header.update_interval); + + ck_assert_msg(last_msg.msg.ssr_stec_correction.n_sats == 2, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.n_sats, expected 2, is %d", + last_msg.msg.ssr_stec_correction.n_sats); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction.ssr_iod_atmo == 15, + "incorrect value for last_msg.msg.ssr_stec_correction.ssr_iod_atmo, " + "expected 15, is %d", + last_msg.msg.ssr_stec_correction.ssr_iod_atmo); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[0] == 63, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[0], " + "expected 63, is %d", + last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[1] == 62, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[1], " + "expected 62, is %d", + last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[2] == 61, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[2], " + "expected 61, is %d", + last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[3] == 60, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[3], " + "expected 60, is %d", + last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[0] + .stec_quality_indicator == 1, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.stec_sat_list[0].stec_" + "quality_indicator, expected 1, is %d", + last_msg.msg.ssr_stec_correction.stec_sat_list[0] + .stec_quality_indicator); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction.stec_sat_list[0].sv_id.constellation == + 1, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.stec_sat_list[0].sv_id.constellation," + " expected 1, is %d", + last_msg.msg.ssr_stec_correction.stec_sat_list[0].sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction.stec_sat_list[0].sv_id.satId == 1, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.stec_sat_list[0].sv_id.satId, " + "expected 1, is %d", + last_msg.msg.ssr_stec_correction.stec_sat_list[0].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[0] == 63, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[0], " + "expected 63, is %d", + last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[1] == 64, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[1], " + "expected 64, is %d", + last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[2] == 65, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[2], " + "expected 65, is %d", + last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[3] == 66, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[3], " + "expected 66, is %d", + last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction.stec_sat_list[1] + .stec_quality_indicator == 5, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.stec_sat_list[1].stec_" + "quality_indicator, expected 5, is %d", + last_msg.msg.ssr_stec_correction.stec_sat_list[1] + .stec_quality_indicator); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction.stec_sat_list[1].sv_id.constellation == + 15, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.stec_sat_list[1].sv_id.constellation," + " expected 15, is %d", + last_msg.msg.ssr_stec_correction.stec_sat_list[1].sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction.stec_sat_list[1].sv_id.satId == 31, + "incorrect value for " + "last_msg.msg.ssr_stec_correction.stec_sat_list[1].sv_id.satId, " + "expected 31, is %d", + last_msg.msg.ssr_stec_correction.stec_sat_list[1].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction.tile_id == 10, + "incorrect value for last_msg.msg.ssr_stec_correction.tile_id, " + "expected 10, is %d", + last_msg.msg.ssr_stec_correction.tile_id); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction.tile_set_id == 1, + "incorrect value for last_msg.msg.ssr_stec_correction.tile_set_id, " + "expected 1, is %d", + last_msg.msg.ssr_stec_correction.tile_set_id); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrStecCorrection_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrStecCorrection"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrStecCorrection"); +Suite *auto_check_sbp_ssr_MsgSsrStecCorrection_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ssr_MsgSsrStecCorrection"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrStecCorrection"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrStecCorrection); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.c b/c/test/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.c index a9600142d..e8092110d 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDep.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrStecCorrectionDep ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrStecCorrectionDep) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrStecCorrectionDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,694 +90,1569 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrStecCorrectionDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x5fb, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x5fb, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,251,5,204,151,245,158,228,114,117,50,158,156,42,119,156,157,112,47,60,132,40,70,87,235,83,177,198,3,14,8,70,12,44,53,181,90,174,247,150,58,172,247,179,119,176,125,4,177,229,113,14,77,153,185,23,53,222,187,146,250,91,212,215,14,107,250,94,107,33,91,234,0,213,139,95,179,50,21,74,174,169,61,86,91,142,51,108,9,38,225,146,101,73,139,56,117,82,37,213,108,205,93,18,19,195,33,202,87,206,178,125,188,119,56,69,150,150,76,3,131,18,73,208,72,232,8,250,203,178,170,163,252,86,49,247,178,166,56,31,10,119,213,241,212,164,1,162,42,18,124,169,121,158,26,56,23,142,125,40,120,67,45,126,235,110,23,12,241,88,69,239,252,57,93,44,201,216,173,242,178,17,5,223,169,192,3,77,107,2,144,233,14,88,32,209,1,17,123,155,41,183,244,158,82,53,103,14,202,185,35,181,21,118,254,250,50,184,50,31,45,56,163,177,126,217,79,171,239,237,188,238,112,201,118,141,18,163,103,35,63,21,82,129,18,117,85,190,79,210,215,227,177, }; + u8 encoded_frame[] = { + 85, 251, 5, 204, 151, 245, 158, 228, 114, 117, 50, 158, 156, 42, + 119, 156, 157, 112, 47, 60, 132, 40, 70, 87, 235, 83, 177, 198, + 3, 14, 8, 70, 12, 44, 53, 181, 90, 174, 247, 150, 58, 172, + 247, 179, 119, 176, 125, 4, 177, 229, 113, 14, 77, 153, 185, 23, + 53, 222, 187, 146, 250, 91, 212, 215, 14, 107, 250, 94, 107, 33, + 91, 234, 0, 213, 139, 95, 179, 50, 21, 74, 174, 169, 61, 86, + 91, 142, 51, 108, 9, 38, 225, 146, 101, 73, 139, 56, 117, 82, + 37, 213, 108, 205, 93, 18, 19, 195, 33, 202, 87, 206, 178, 125, + 188, 119, 56, 69, 150, 150, 76, 3, 131, 18, 73, 208, 72, 232, + 8, 250, 203, 178, 170, 163, 252, 86, 49, 247, 178, 166, 56, 31, + 10, 119, 213, 241, 212, 164, 1, 162, 42, 18, 124, 169, 121, 158, + 26, 56, 23, 142, 125, 40, 120, 67, 45, 126, 235, 110, 23, 12, + 241, 88, 69, 239, 252, 57, 93, 44, 201, 216, 173, 242, 178, 17, + 5, 223, 169, 192, 3, 77, 107, 2, 144, 233, 14, 88, 32, 209, + 1, 17, 123, 155, 41, 183, 244, 158, 82, 53, 103, 14, 202, 185, + 35, 181, 21, 118, 254, 250, 50, 184, 50, 31, 45, 56, 163, 177, + 126, 217, 79, 171, 239, 237, 188, 238, 112, 201, 118, 141, 18, 163, + 103, 35, 63, 21, 82, 129, 18, 117, 85, 190, 79, 210, 215, 227, + 177, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ssr_stec_correction_dep.header.iod_atmo = 60; - + test_msg.ssr_stec_correction_dep.header.num_msgs = 157; - + test_msg.ssr_stec_correction_dep.header.seq_num = 112; - + test_msg.ssr_stec_correction_dep.header.tile_id = 30066; - + test_msg.ssr_stec_correction_dep.header.tile_set_id = 58526; - - + test_msg.ssr_stec_correction_dep.header.time.tow = 714907186; - + test_msg.ssr_stec_correction_dep.header.time.wn = 40055; - + test_msg.ssr_stec_correction_dep.header.update_interval = 47; - + test_msg.ssr_stec_correction_dep.n_stec_sat_list = 21; - - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[0] = -5289; - + test_msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[1] = -20141; - + test_msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[2] = 966; - + test_msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[3] = 2062; - - test_msg.ssr_stec_correction_dep.stec_sat_list[0].stec_quality_indicator = 70; - - + + test_msg.ssr_stec_correction_dep.stec_sat_list[0].stec_quality_indicator = + 70; + test_msg.ssr_stec_correction_dep.stec_sat_list[0].sv_id.constellation = 40; - + test_msg.ssr_stec_correction_dep.stec_sat_list[0].sv_id.satId = 132; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[0] = -19147; - + test_msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[1] = -20902; - + test_msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[2] = -26889; - + test_msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[3] = -21446; - - test_msg.ssr_stec_correction_dep.stec_sat_list[1].stec_quality_indicator = 44; - - + + test_msg.ssr_stec_correction_dep.stec_sat_list[1].stec_quality_indicator = + 44; + test_msg.ssr_stec_correction_dep.stec_sat_list[1].sv_id.constellation = 12; - + test_msg.ssr_stec_correction_dep.stec_sat_list[1].sv_id.satId = 70; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[0] = 32176; - + test_msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[1] = -20220; - + test_msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[2] = 29157; - + test_msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[3] = 19726; - - test_msg.ssr_stec_correction_dep.stec_sat_list[2].stec_quality_indicator = 119; - - + + test_msg.ssr_stec_correction_dep.stec_sat_list[2].stec_quality_indicator = + 119; + test_msg.ssr_stec_correction_dep.stec_sat_list[2].sv_id.constellation = 179; - + test_msg.ssr_stec_correction_dep.stec_sat_list[2].sv_id.satId = 247; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[0] = -8651; - + test_msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[1] = -27973; - + test_msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[2] = 23546; - + test_msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[3] = -10284; - - test_msg.ssr_stec_correction_dep.stec_sat_list[3].stec_quality_indicator = 23; - - + + test_msg.ssr_stec_correction_dep.stec_sat_list[3].stec_quality_indicator = + 23; + test_msg.ssr_stec_correction_dep.stec_sat_list[3].sv_id.constellation = 185; - + test_msg.ssr_stec_correction_dep.stec_sat_list[3].sv_id.satId = 153; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[0] = 27486; - + test_msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[1] = 23329; - + test_msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[2] = 234; - + test_msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[3] = -29739; - - test_msg.ssr_stec_correction_dep.stec_sat_list[4].stec_quality_indicator = 250; - - + + test_msg.ssr_stec_correction_dep.stec_sat_list[4].stec_quality_indicator = + 250; + test_msg.ssr_stec_correction_dep.stec_sat_list[4].sv_id.constellation = 107; - + test_msg.ssr_stec_correction_dep.stec_sat_list[4].sv_id.satId = 14; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[0] = 18965; - + test_msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[1] = -22098; - + test_msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[2] = 22077; - + test_msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[3] = -29093; - - test_msg.ssr_stec_correction_dep.stec_sat_list[5].stec_quality_indicator = 50; - - + + test_msg.ssr_stec_correction_dep.stec_sat_list[5].stec_quality_indicator = + 50; + test_msg.ssr_stec_correction_dep.stec_sat_list[5].sv_id.constellation = 179; - + test_msg.ssr_stec_correction_dep.stec_sat_list[5].sv_id.satId = 95; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[0] = -7898; - + test_msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[1] = 26002; - + test_msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[2] = -29879; - + test_msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[3] = 30008; - - test_msg.ssr_stec_correction_dep.stec_sat_list[6].stec_quality_indicator = 9; - - + + test_msg.ssr_stec_correction_dep.stec_sat_list[6].stec_quality_indicator = + 9; + test_msg.ssr_stec_correction_dep.stec_sat_list[6].sv_id.constellation = 108; - + test_msg.ssr_stec_correction_dep.stec_sat_list[6].sv_id.satId = 51; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[0] = -12948; - + test_msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[1] = 4701; - + test_msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[2] = -15597; - + test_msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[3] = -13791; - - test_msg.ssr_stec_correction_dep.stec_sat_list[7].stec_quality_indicator = 213; - - + + test_msg.ssr_stec_correction_dep.stec_sat_list[7].stec_quality_indicator = + 213; + test_msg.ssr_stec_correction_dep.stec_sat_list[7].sv_id.constellation = 37; - + test_msg.ssr_stec_correction_dep.stec_sat_list[7].sv_id.satId = 82; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[0] = -17283; - + test_msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[1] = 14455; - + test_msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[2] = -27067; - + test_msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[3] = 19606; - - test_msg.ssr_stec_correction_dep.stec_sat_list[8].stec_quality_indicator = 178; - - + + test_msg.ssr_stec_correction_dep.stec_sat_list[8].stec_quality_indicator = + 178; + test_msg.ssr_stec_correction_dep.stec_sat_list[8].sv_id.constellation = 206; - + test_msg.ssr_stec_correction_dep.stec_sat_list[8].sv_id.satId = 87; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[0] = -12215; - + test_msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[1] = -6072; - + test_msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[2] = -1528; - + test_msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[3] = -19765; - - test_msg.ssr_stec_correction_dep.stec_sat_list[9].stec_quality_indicator = 18; - - + + test_msg.ssr_stec_correction_dep.stec_sat_list[9].stec_quality_indicator = + 18; + test_msg.ssr_stec_correction_dep.stec_sat_list[9].sv_id.constellation = 131; - + test_msg.ssr_stec_correction_dep.stec_sat_list[9].sv_id.satId = 3; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[0] = 12630; - + test_msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[1] = -19721; - + test_msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[2] = 14502; - + test_msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[3] = 2591; - - test_msg.ssr_stec_correction_dep.stec_sat_list[10].stec_quality_indicator = 252; - - - test_msg.ssr_stec_correction_dep.stec_sat_list[10].sv_id.constellation = 163; - + + test_msg.ssr_stec_correction_dep.stec_sat_list[10].stec_quality_indicator = + 252; + + test_msg.ssr_stec_correction_dep.stec_sat_list[10].sv_id.constellation = + 163; + test_msg.ssr_stec_correction_dep.stec_sat_list[10].sv_id.satId = 170; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[0] = -23340; - + test_msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[1] = -24063; - + test_msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[2] = 4650; - + test_msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[3] = -22148; - - test_msg.ssr_stec_correction_dep.stec_sat_list[11].stec_quality_indicator = 241; - - - test_msg.ssr_stec_correction_dep.stec_sat_list[11].sv_id.constellation = 213; - + + test_msg.ssr_stec_correction_dep.stec_sat_list[11].stec_quality_indicator = + 241; + + test_msg.ssr_stec_correction_dep.stec_sat_list[11].sv_id.constellation = + 213; + test_msg.ssr_stec_correction_dep.stec_sat_list[11].sv_id.satId = 119; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[0] = 5944; - + test_msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[1] = 32142; - + test_msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[2] = 30760; - + test_msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[3] = 11587; - - test_msg.ssr_stec_correction_dep.stec_sat_list[12].stec_quality_indicator = 26; - - - test_msg.ssr_stec_correction_dep.stec_sat_list[12].sv_id.constellation = 158; - + + test_msg.ssr_stec_correction_dep.stec_sat_list[12].stec_quality_indicator = + 26; + + test_msg.ssr_stec_correction_dep.stec_sat_list[12].sv_id.constellation = + 158; + test_msg.ssr_stec_correction_dep.stec_sat_list[12].sv_id.satId = 121; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[0] = 3095; - + test_msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[1] = 22769; - + test_msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[2] = -4283; - + test_msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[3] = 14844; - - test_msg.ssr_stec_correction_dep.stec_sat_list[13].stec_quality_indicator = 110; - - - test_msg.ssr_stec_correction_dep.stec_sat_list[13].sv_id.constellation = 235; - + + test_msg.ssr_stec_correction_dep.stec_sat_list[13].stec_quality_indicator = + 110; + + test_msg.ssr_stec_correction_dep.stec_sat_list[13].sv_id.constellation = + 235; + test_msg.ssr_stec_correction_dep.stec_sat_list[13].sv_id.satId = 126; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[0] = -21032; - + test_msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[1] = -19726; - + test_msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[2] = 1297; - + test_msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[3] = -22049; - - test_msg.ssr_stec_correction_dep.stec_sat_list[14].stec_quality_indicator = 201; - - + + test_msg.ssr_stec_correction_dep.stec_sat_list[14].stec_quality_indicator = + 201; + test_msg.ssr_stec_correction_dep.stec_sat_list[14].sv_id.constellation = 44; - + test_msg.ssr_stec_correction_dep.stec_sat_list[14].sv_id.satId = 93; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[0] = 619; - + test_msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[1] = -5744; - + test_msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[2] = 22542; - + test_msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[3] = -12000; - - test_msg.ssr_stec_correction_dep.stec_sat_list[15].stec_quality_indicator = 77; - - + + test_msg.ssr_stec_correction_dep.stec_sat_list[15].stec_quality_indicator = + 77; + test_msg.ssr_stec_correction_dep.stec_sat_list[15].sv_id.constellation = 3; - + test_msg.ssr_stec_correction_dep.stec_sat_list[15].sv_id.satId = 192; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[0] = 10651; - + test_msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[1] = -2889; - + test_msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[2] = 21150; - + test_msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[3] = 26421; - - test_msg.ssr_stec_correction_dep.stec_sat_list[16].stec_quality_indicator = 123; - - + + test_msg.ssr_stec_correction_dep.stec_sat_list[16].stec_quality_indicator = + 123; + test_msg.ssr_stec_correction_dep.stec_sat_list[16].sv_id.constellation = 17; - + test_msg.ssr_stec_correction_dep.stec_sat_list[16].sv_id.satId = 1; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[0] = -19165; - + test_msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[1] = 30229; - + test_msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[2] = -1282; - + test_msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[3] = -18382; - - test_msg.ssr_stec_correction_dep.stec_sat_list[17].stec_quality_indicator = 185; - - - test_msg.ssr_stec_correction_dep.stec_sat_list[17].sv_id.constellation = 202; - + + test_msg.ssr_stec_correction_dep.stec_sat_list[17].stec_quality_indicator = + 185; + + test_msg.ssr_stec_correction_dep.stec_sat_list[17].sv_id.constellation = + 202; + test_msg.ssr_stec_correction_dep.stec_sat_list[17].sv_id.satId = 14; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[0] = -23752; - + test_msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[1] = 32433; - + test_msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[2] = 20441; - + test_msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[3] = -4181; - - test_msg.ssr_stec_correction_dep.stec_sat_list[18].stec_quality_indicator = 45; - - + + test_msg.ssr_stec_correction_dep.stec_sat_list[18].stec_quality_indicator = + 45; + test_msg.ssr_stec_correction_dep.stec_sat_list[18].sv_id.constellation = 31; - + test_msg.ssr_stec_correction_dep.stec_sat_list[18].sv_id.satId = 50; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[0] = -13968; - + test_msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[1] = -29322; - + test_msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[2] = -23790; - + test_msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[3] = 9063; - - test_msg.ssr_stec_correction_dep.stec_sat_list[19].stec_quality_indicator = 238; - - - test_msg.ssr_stec_correction_dep.stec_sat_list[19].sv_id.constellation = 188; - + + test_msg.ssr_stec_correction_dep.stec_sat_list[19].stec_quality_indicator = + 238; + + test_msg.ssr_stec_correction_dep.stec_sat_list[19].sv_id.constellation = + 188; + test_msg.ssr_stec_correction_dep.stec_sat_list[19].sv_id.satId = 237; - - - + test_msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[0] = 4737; - + test_msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[1] = 21877; - + test_msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[2] = 20414; - + test_msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[3] = -10286; - - test_msg.ssr_stec_correction_dep.stec_sat_list[20].stec_quality_indicator = 82; - - + + test_msg.ssr_stec_correction_dep.stec_sat_list[20].stec_quality_indicator = + 82; + test_msg.ssr_stec_correction_dep.stec_sat_list[20].sv_id.constellation = 21; - + test_msg.ssr_stec_correction_dep.stec_sat_list[20].sv_id.satId = 63; - sbp_message_send(&sbp_state, SbpMsgSsrStecCorrectionDep, 38860, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrStecCorrectionDep, 38860, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 38860, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrStecCorrectionDep, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.header.iod_atmo == 60, "incorrect value for last_msg.msg.ssr_stec_correction_dep.header.iod_atmo, expected 60, is %d", last_msg.msg.ssr_stec_correction_dep.header.iod_atmo); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.header.num_msgs == 157, "incorrect value for last_msg.msg.ssr_stec_correction_dep.header.num_msgs, expected 157, is %d", last_msg.msg.ssr_stec_correction_dep.header.num_msgs); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.header.seq_num == 112, "incorrect value for last_msg.msg.ssr_stec_correction_dep.header.seq_num, expected 112, is %d", last_msg.msg.ssr_stec_correction_dep.header.seq_num); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.header.tile_id == 30066, "incorrect value for last_msg.msg.ssr_stec_correction_dep.header.tile_id, expected 30066, is %d", last_msg.msg.ssr_stec_correction_dep.header.tile_id); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.header.tile_set_id == 58526, "incorrect value for last_msg.msg.ssr_stec_correction_dep.header.tile_set_id, expected 58526, is %d", last_msg.msg.ssr_stec_correction_dep.header.tile_set_id); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.header.time.tow == 714907186, "incorrect value for last_msg.msg.ssr_stec_correction_dep.header.time.tow, expected 714907186, is %d", last_msg.msg.ssr_stec_correction_dep.header.time.tow); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.header.time.wn == 40055, "incorrect value for last_msg.msg.ssr_stec_correction_dep.header.time.wn, expected 40055, is %d", last_msg.msg.ssr_stec_correction_dep.header.time.wn); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.header.update_interval == 47, "incorrect value for last_msg.msg.ssr_stec_correction_dep.header.update_interval, expected 47, is %d", last_msg.msg.ssr_stec_correction_dep.header.update_interval); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.n_stec_sat_list == 21, "incorrect value for last_msg.msg.ssr_stec_correction_dep.n_stec_sat_list, expected 21, is %d", last_msg.msg.ssr_stec_correction_dep.n_stec_sat_list); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[0] == -5289, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[0], expected -5289, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[1] == -20141, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[1], expected -20141, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[2] == 966, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[2], expected 966, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[3] == 2062, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[3], expected 2062, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_quality_indicator == 70, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_quality_indicator, expected 70, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].sv_id.constellation == 40, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].sv_id.constellation, expected 40, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].sv_id.satId == 132, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].sv_id.satId, expected 132, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[0] == -19147, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[0], expected -19147, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[1] == -20902, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[1], expected -20902, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[2] == -26889, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[2], expected -26889, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[3] == -21446, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[3], expected -21446, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_quality_indicator == 44, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_quality_indicator, expected 44, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].sv_id.constellation == 12, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].sv_id.constellation, expected 12, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].sv_id.satId == 70, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].sv_id.satId, expected 70, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[0] == 32176, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[0], expected 32176, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[1] == -20220, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[1], expected -20220, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[2] == 29157, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[2], expected 29157, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[3] == 19726, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[3], expected 19726, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_quality_indicator == 119, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_quality_indicator, expected 119, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].sv_id.constellation == 179, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].sv_id.constellation, expected 179, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].sv_id.satId == 247, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].sv_id.satId, expected 247, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[0] == -8651, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[0], expected -8651, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[1] == -27973, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[1], expected -27973, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[2] == 23546, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[2], expected 23546, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[3] == -10284, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[3], expected -10284, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_quality_indicator == 23, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_quality_indicator, expected 23, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].sv_id.constellation == 185, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].sv_id.constellation, expected 185, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].sv_id.satId == 153, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].sv_id.satId, expected 153, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[0] == 27486, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[0], expected 27486, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[1] == 23329, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[1], expected 23329, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[2] == 234, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[2], expected 234, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[3] == -29739, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[3], expected -29739, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_quality_indicator == 250, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_quality_indicator, expected 250, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].sv_id.constellation == 107, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].sv_id.constellation, expected 107, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].sv_id.satId == 14, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].sv_id.satId, expected 14, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[0] == 18965, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[0], expected 18965, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[1] == -22098, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[1], expected -22098, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[2] == 22077, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[2], expected 22077, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[3] == -29093, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[3], expected -29093, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_quality_indicator == 50, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_quality_indicator, expected 50, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].sv_id.constellation == 179, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].sv_id.constellation, expected 179, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].sv_id.satId == 95, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].sv_id.satId, expected 95, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[0] == -7898, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[0], expected -7898, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[1] == 26002, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[1], expected 26002, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[2] == -29879, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[2], expected -29879, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[3] == 30008, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[3], expected 30008, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_quality_indicator == 9, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_quality_indicator, expected 9, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].sv_id.constellation == 108, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].sv_id.constellation, expected 108, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].sv_id.satId == 51, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].sv_id.satId, expected 51, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[0] == -12948, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[0], expected -12948, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[1] == 4701, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[1], expected 4701, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[2] == -15597, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[2], expected -15597, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[3] == -13791, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[3], expected -13791, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_quality_indicator == 213, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_quality_indicator, expected 213, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].sv_id.constellation == 37, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].sv_id.constellation, expected 37, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].sv_id.satId == 82, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].sv_id.satId, expected 82, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[0] == -17283, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[0], expected -17283, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[1] == 14455, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[1], expected 14455, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[2] == -27067, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[2], expected -27067, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[3] == 19606, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[3], expected 19606, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_quality_indicator == 178, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_quality_indicator, expected 178, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].sv_id.constellation == 206, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].sv_id.constellation, expected 206, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].sv_id.satId == 87, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].sv_id.satId, expected 87, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[0] == -12215, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[0], expected -12215, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[1] == -6072, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[1], expected -6072, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[2] == -1528, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[2], expected -1528, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[3] == -19765, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[3], expected -19765, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_quality_indicator == 18, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_quality_indicator, expected 18, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].sv_id.constellation == 131, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].sv_id.constellation, expected 131, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].sv_id.satId == 3, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].sv_id.satId, expected 3, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[0] == 12630, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[0], expected 12630, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[1] == -19721, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[1], expected -19721, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[2] == 14502, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[2], expected 14502, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[3] == 2591, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[3], expected 2591, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_quality_indicator == 252, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_quality_indicator, expected 252, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].sv_id.constellation == 163, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].sv_id.constellation, expected 163, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].sv_id.satId == 170, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].sv_id.satId, expected 170, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[0] == -23340, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[0], expected -23340, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[1] == -24063, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[1], expected -24063, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[2] == 4650, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[2], expected 4650, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[3] == -22148, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[3], expected -22148, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_quality_indicator == 241, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_quality_indicator, expected 241, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].sv_id.constellation == 213, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].sv_id.constellation, expected 213, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].sv_id.satId == 119, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].sv_id.satId, expected 119, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[0] == 5944, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[0], expected 5944, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[1] == 32142, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[1], expected 32142, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[2] == 30760, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[2], expected 30760, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[3] == 11587, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[3], expected 11587, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_quality_indicator == 26, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_quality_indicator, expected 26, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].sv_id.constellation == 158, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].sv_id.constellation, expected 158, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].sv_id.satId == 121, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].sv_id.satId, expected 121, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[0] == 3095, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[0], expected 3095, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[1] == 22769, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[1], expected 22769, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[2] == -4283, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[2], expected -4283, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[3] == 14844, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[3], expected 14844, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_quality_indicator == 110, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_quality_indicator, expected 110, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].sv_id.constellation == 235, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].sv_id.constellation, expected 235, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].sv_id.satId == 126, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].sv_id.satId, expected 126, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[0] == -21032, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[0], expected -21032, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[1] == -19726, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[1], expected -19726, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[2] == 1297, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[2], expected 1297, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[3] == -22049, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[3], expected -22049, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_quality_indicator == 201, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_quality_indicator, expected 201, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].sv_id.constellation == 44, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].sv_id.constellation, expected 44, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].sv_id.satId == 93, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].sv_id.satId, expected 93, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[0] == 619, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[0], expected 619, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[1] == -5744, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[1], expected -5744, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[2] == 22542, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[2], expected 22542, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[3] == -12000, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[3], expected -12000, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_quality_indicator == 77, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_quality_indicator, expected 77, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].sv_id.constellation == 3, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].sv_id.constellation, expected 3, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].sv_id.satId == 192, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].sv_id.satId, expected 192, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[0] == 10651, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[0], expected 10651, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[1] == -2889, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[1], expected -2889, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[2] == 21150, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[2], expected 21150, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[3] == 26421, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[3], expected 26421, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_quality_indicator == 123, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_quality_indicator, expected 123, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].sv_id.constellation == 17, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].sv_id.constellation, expected 17, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].sv_id.satId == 1, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].sv_id.satId, expected 1, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[0] == -19165, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[0], expected -19165, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[1] == 30229, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[1], expected 30229, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[2] == -1282, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[2], expected -1282, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[3] == -18382, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[3], expected -18382, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_quality_indicator == 185, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_quality_indicator, expected 185, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].sv_id.constellation == 202, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].sv_id.constellation, expected 202, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].sv_id.satId == 14, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].sv_id.satId, expected 14, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[0] == -23752, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[0], expected -23752, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[1] == 32433, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[1], expected 32433, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[2] == 20441, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[2], expected 20441, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[3] == -4181, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[3], expected -4181, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_quality_indicator == 45, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_quality_indicator, expected 45, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].sv_id.constellation == 31, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].sv_id.constellation, expected 31, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].sv_id.satId == 50, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].sv_id.satId, expected 50, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[0] == -13968, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[0], expected -13968, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[1] == -29322, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[1], expected -29322, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[2] == -23790, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[2], expected -23790, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[3] == 9063, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[3], expected 9063, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_quality_indicator == 238, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_quality_indicator, expected 238, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].sv_id.constellation == 188, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].sv_id.constellation, expected 188, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].sv_id.satId == 237, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].sv_id.satId, expected 237, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[0] == 4737, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[0], expected 4737, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[1] == 21877, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[1], expected 21877, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[2] == 20414, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[2], expected 20414, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[3] == -10286, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[3], expected -10286, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_quality_indicator == 82, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_quality_indicator, expected 82, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].sv_id.constellation == 21, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].sv_id.constellation, expected 21, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].sv_id.satId == 63, "incorrect value for last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].sv_id.satId, expected 63, is %d", last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].sv_id.satId); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrStecCorrectionDep, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.header.iod_atmo == 60, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.header.iod_atmo, " + "expected 60, is %d", + last_msg.msg.ssr_stec_correction_dep.header.iod_atmo); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.header.num_msgs == 157, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.header.num_msgs, " + "expected 157, is %d", + last_msg.msg.ssr_stec_correction_dep.header.num_msgs); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.header.seq_num == 112, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.header.seq_num, " + "expected 112, is %d", + last_msg.msg.ssr_stec_correction_dep.header.seq_num); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.header.tile_id == 30066, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.header.tile_id, " + "expected 30066, is %d", + last_msg.msg.ssr_stec_correction_dep.header.tile_id); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.header.tile_set_id == 58526, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.header.tile_set_id, expected " + "58526, is %d", + last_msg.msg.ssr_stec_correction_dep.header.tile_set_id); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.header.time.tow == 714907186, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.header.time.tow, expected " + "714907186, is %d", + last_msg.msg.ssr_stec_correction_dep.header.time.tow); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.header.time.wn == 40055, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.header.time.wn, " + "expected 40055, is %d", + last_msg.msg.ssr_stec_correction_dep.header.time.wn); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.header.update_interval == 47, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.header.update_interval, expected " + "47, is %d", + last_msg.msg.ssr_stec_correction_dep.header.update_interval); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.n_stec_sat_list == 21, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.n_stec_sat_list, " + "expected 21, is %d", + last_msg.msg.ssr_stec_correction_dep.n_stec_sat_list); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[0] == + -5289, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[0], " + "expected -5289, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[1] == + -20141, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[1], " + "expected -20141, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[2] == + 966, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[2], " + "expected 966, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[3] == + 2062, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[3], " + "expected 2062, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0] + .stec_quality_indicator == 70, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].stec_" + "quality_indicator, expected 70, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0] + .sv_id.constellation == 40, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].sv_id." + "constellation, expected 40, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].sv_id.satId == + 132, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].sv_id.satId, " + "expected 132, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[0].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[0] == + -19147, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[0], " + "expected -19147, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[1] == + -20902, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[1], " + "expected -20902, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[2] == + -26889, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[2], " + "expected -26889, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[3] == + -21446, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[3], " + "expected -21446, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1] + .stec_quality_indicator == 44, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].stec_" + "quality_indicator, expected 44, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1] + .sv_id.constellation == 12, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].sv_id." + "constellation, expected 12, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].sv_id.satId == 70, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].sv_id.satId, " + "expected 70, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[1].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[0] == + 32176, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[0], " + "expected 32176, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[1] == + -20220, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[1], " + "expected -20220, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[2] == + 29157, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[2], " + "expected 29157, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[3] == + 19726, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[3], " + "expected 19726, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2] + .stec_quality_indicator == 119, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].stec_" + "quality_indicator, expected 119, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2] + .sv_id.constellation == 179, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].sv_id." + "constellation, expected 179, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].sv_id.satId == + 247, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].sv_id.satId, " + "expected 247, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[2].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[0] == + -8651, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[0], " + "expected -8651, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[1] == + -27973, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[1], " + "expected -27973, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[2] == + 23546, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[2], " + "expected 23546, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[3] == + -10284, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[3], " + "expected -10284, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3] + .stec_quality_indicator == 23, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].stec_" + "quality_indicator, expected 23, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3] + .sv_id.constellation == 185, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].sv_id." + "constellation, expected 185, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].sv_id.satId == + 153, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].sv_id.satId, " + "expected 153, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[3].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[0] == + 27486, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[0], " + "expected 27486, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[1] == + 23329, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[1], " + "expected 23329, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[2] == + 234, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[2], " + "expected 234, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[3] == + -29739, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[3], " + "expected -29739, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4] + .stec_quality_indicator == 250, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].stec_" + "quality_indicator, expected 250, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4] + .sv_id.constellation == 107, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].sv_id." + "constellation, expected 107, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].sv_id.satId == 14, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].sv_id.satId, " + "expected 14, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[4].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[0] == + 18965, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[0], " + "expected 18965, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[1] == + -22098, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[1], " + "expected -22098, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[2] == + 22077, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[2], " + "expected 22077, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[3] == + -29093, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[3], " + "expected -29093, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5] + .stec_quality_indicator == 50, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].stec_" + "quality_indicator, expected 50, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5] + .sv_id.constellation == 179, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].sv_id." + "constellation, expected 179, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].sv_id.satId == 95, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].sv_id.satId, " + "expected 95, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[5].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[0] == + -7898, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[0], " + "expected -7898, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[1] == + 26002, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[1], " + "expected 26002, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[2] == + -29879, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[2], " + "expected -29879, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[3] == + 30008, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[3], " + "expected 30008, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6] + .stec_quality_indicator == 9, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].stec_" + "quality_indicator, expected 9, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6] + .sv_id.constellation == 108, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].sv_id." + "constellation, expected 108, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].sv_id.satId == 51, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].sv_id.satId, " + "expected 51, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[6].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[0] == + -12948, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[0], " + "expected -12948, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[1] == + 4701, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[1], " + "expected 4701, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[2] == + -15597, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[2], " + "expected -15597, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[3] == + -13791, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[3], " + "expected -13791, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7] + .stec_quality_indicator == 213, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].stec_" + "quality_indicator, expected 213, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7] + .sv_id.constellation == 37, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].sv_id." + "constellation, expected 37, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].sv_id.satId == 82, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].sv_id.satId, " + "expected 82, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[7].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[0] == + -17283, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[0], " + "expected -17283, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[1] == + 14455, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[1], " + "expected 14455, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[2] == + -27067, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[2], " + "expected -27067, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[3] == + 19606, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[3], " + "expected 19606, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8] + .stec_quality_indicator == 178, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].stec_" + "quality_indicator, expected 178, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8] + .sv_id.constellation == 206, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].sv_id." + "constellation, expected 206, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].sv_id.satId == 87, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].sv_id.satId, " + "expected 87, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[8].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[0] == + -12215, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[0], " + "expected -12215, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[1] == + -6072, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[1], " + "expected -6072, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[2] == + -1528, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[2], " + "expected -1528, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[3] == + -19765, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[3], " + "expected -19765, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9] + .stec_quality_indicator == 18, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].stec_" + "quality_indicator, expected 18, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9] + .sv_id.constellation == 131, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].sv_id." + "constellation, expected 131, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].sv_id.satId == 3, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].sv_id.satId, " + "expected 3, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[9].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[0] == + 12630, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[0], " + "expected 12630, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[1] == + -19721, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[1], " + "expected -19721, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[2] == + 14502, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[2], " + "expected 14502, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[3] == + 2591, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[3], " + "expected 2591, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10] + .stec_quality_indicator == 252, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].stec_" + "quality_indicator, expected 252, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10] + .sv_id.constellation == 163, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].sv_" + "id.constellation, expected 163, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].sv_id.satId == + 170, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].sv_id.satId, " + "expected 170, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[10].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[0] == + -23340, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[0], " + "expected -23340, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[1] == + -24063, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[1], " + "expected -24063, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[2] == + 4650, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[2], " + "expected 4650, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[3] == + -22148, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[3], " + "expected -22148, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11] + .stec_quality_indicator == 241, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].stec_" + "quality_indicator, expected 241, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11] + .sv_id.constellation == 213, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].sv_" + "id.constellation, expected 213, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].sv_id.satId == + 119, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].sv_id.satId, " + "expected 119, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[11].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[0] == + 5944, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[0], " + "expected 5944, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[1] == + 32142, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[1], " + "expected 32142, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[2] == + 30760, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[2], " + "expected 30760, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[3] == + 11587, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[3], " + "expected 11587, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12] + .stec_quality_indicator == 26, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].stec_" + "quality_indicator, expected 26, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12] + .sv_id.constellation == 158, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].sv_" + "id.constellation, expected 158, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].sv_id.satId == + 121, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].sv_id.satId, " + "expected 121, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[12].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[0] == + 3095, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[0], " + "expected 3095, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[1] == + 22769, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[1], " + "expected 22769, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[2] == + -4283, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[2], " + "expected -4283, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[3] == + 14844, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[3], " + "expected 14844, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13] + .stec_quality_indicator == 110, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].stec_" + "quality_indicator, expected 110, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13] + .sv_id.constellation == 235, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].sv_" + "id.constellation, expected 235, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].sv_id.satId == + 126, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].sv_id.satId, " + "expected 126, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[13].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[0] == + -21032, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[0], " + "expected -21032, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[1] == + -19726, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[1], " + "expected -19726, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[2] == + 1297, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[2], " + "expected 1297, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[3] == + -22049, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[3], " + "expected -22049, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14] + .stec_quality_indicator == 201, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].stec_" + "quality_indicator, expected 201, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14] + .sv_id.constellation == 44, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].sv_" + "id.constellation, expected 44, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].sv_id.satId == + 93, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].sv_id.satId, " + "expected 93, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[14].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[0] == + 619, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[0], " + "expected 619, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[1] == + -5744, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[1], " + "expected -5744, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[2] == + 22542, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[2], " + "expected 22542, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[3] == + -12000, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[3], " + "expected -12000, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15] + .stec_quality_indicator == 77, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].stec_" + "quality_indicator, expected 77, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15] + .sv_id.constellation == 3, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].sv_" + "id.constellation, expected 3, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].sv_id.satId == + 192, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].sv_id.satId, " + "expected 192, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[15].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[0] == + 10651, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[0], " + "expected 10651, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[1] == + -2889, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[1], " + "expected -2889, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[2] == + 21150, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[2], " + "expected 21150, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[3] == + 26421, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[3], " + "expected 26421, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16] + .stec_quality_indicator == 123, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].stec_" + "quality_indicator, expected 123, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16] + .sv_id.constellation == 17, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].sv_" + "id.constellation, expected 17, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].sv_id.satId == 1, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].sv_id.satId, " + "expected 1, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[16].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[0] == + -19165, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[0], " + "expected -19165, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[1] == + 30229, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[1], " + "expected 30229, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[2] == + -1282, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[2], " + "expected -1282, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[3] == + -18382, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[3], " + "expected -18382, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17] + .stec_quality_indicator == 185, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].stec_" + "quality_indicator, expected 185, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17] + .sv_id.constellation == 202, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].sv_" + "id.constellation, expected 202, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].sv_id.satId == + 14, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].sv_id.satId, " + "expected 14, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[17].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[0] == + -23752, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[0], " + "expected -23752, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[1] == + 32433, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[1], " + "expected 32433, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[2] == + 20441, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[2], " + "expected 20441, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[3] == + -4181, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[3], " + "expected -4181, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18] + .stec_quality_indicator == 45, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].stec_" + "quality_indicator, expected 45, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18] + .sv_id.constellation == 31, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].sv_" + "id.constellation, expected 31, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].sv_id.satId == + 50, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].sv_id.satId, " + "expected 50, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[18].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[0] == + -13968, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[0], " + "expected -13968, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[1] == + -29322, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[1], " + "expected -29322, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[2] == + -23790, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[2], " + "expected -23790, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[3] == + 9063, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[3], " + "expected 9063, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19] + .stec_quality_indicator == 238, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].stec_" + "quality_indicator, expected 238, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19] + .sv_id.constellation == 188, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].sv_" + "id.constellation, expected 188, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].sv_id.satId == + 237, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].sv_id.satId, " + "expected 237, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[19].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[0] == + 4737, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[0], " + "expected 4737, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[1] == + 21877, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[1], " + "expected 21877, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[2] == + 20414, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[2], " + "expected 20414, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[3] == + -10286, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[3], " + "expected -10286, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20] + .stec_quality_indicator == 82, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].stec_" + "quality_indicator, expected 82, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20] + .sv_id.constellation == 21, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].sv_" + "id.constellation, expected 21, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20] + .sv_id.constellation); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].sv_id.satId == + 63, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].sv_id.satId, " + "expected 63, is %d", + last_msg.msg.ssr_stec_correction_dep.stec_sat_list[20].sv_id.satId); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrStecCorrectionDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrStecCorrectionDep"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrStecCorrectionDep"); +Suite *auto_check_sbp_ssr_MsgSsrStecCorrectionDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ssr_MsgSsrStecCorrectionDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_ssr_MsgSsrStecCorrectionDep"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrStecCorrectionDep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.c b/c/test/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.c index c1f2cb8f5..fe7f1bc35 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,715 +90,1644 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x5eb, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x5eb, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,235,5,39,7,252,70,81,196,232,185,43,147,123,39,4,126,19,111,97,248,130,217,217,106,58,12,65,230,171,81,95,86,16,39,84,228,208,201,81,219,99,203,61,182,66,125,203,3,193,44,100,220,125,60,21,93,218,247,158,207,93,129,134,14,209,48,14,215,153,148,147,72,225,180,236,205,201,33,3,246,204,19,3,98,4,194,191,246,76,219,31,191,113,79,177,15,251,33,19,96,54,58,146,210,100,249,72,21,161,211,198,21,238,111,107,36,227,225,213,3,71,243,63,65,236,92,77,0,169,15,182,5,240,180,9,122,86,232,6,103,104,254,189,81,110,2,49,202,84,216,55,50,181,5,123,80,49,244,224,188,125,164,230,56,66,124,168,59,139,106,118,51,187,216,191,158,77,92,58,253,132,150,165,9,154,189,218,61,209,1,82,181,196,23,53,182,112,192,206,167,157,244,35,1,189,217,61,88,97,201,201,74,251,217,14,104,184,54,52,74,238,10,129,22,178,226,109,88,157,30,196,175,26,76,34,116,220,154,232,12,179,244,15,155,196,202,72,70,115,10,214,114,39,245,28,237,68,136,155, }; + u8 encoded_frame[] = { + 85, 235, 5, 39, 7, 252, 70, 81, 196, 232, 185, 43, 147, 123, + 39, 4, 126, 19, 111, 97, 248, 130, 217, 217, 106, 58, 12, 65, + 230, 171, 81, 95, 86, 16, 39, 84, 228, 208, 201, 81, 219, 99, + 203, 61, 182, 66, 125, 203, 3, 193, 44, 100, 220, 125, 60, 21, + 93, 218, 247, 158, 207, 93, 129, 134, 14, 209, 48, 14, 215, 153, + 148, 147, 72, 225, 180, 236, 205, 201, 33, 3, 246, 204, 19, 3, + 98, 4, 194, 191, 246, 76, 219, 31, 191, 113, 79, 177, 15, 251, + 33, 19, 96, 54, 58, 146, 210, 100, 249, 72, 21, 161, 211, 198, + 21, 238, 111, 107, 36, 227, 225, 213, 3, 71, 243, 63, 65, 236, + 92, 77, 0, 169, 15, 182, 5, 240, 180, 9, 122, 86, 232, 6, + 103, 104, 254, 189, 81, 110, 2, 49, 202, 84, 216, 55, 50, 181, + 5, 123, 80, 49, 244, 224, 188, 125, 164, 230, 56, 66, 124, 168, + 59, 139, 106, 118, 51, 187, 216, 191, 158, 77, 92, 58, 253, 132, + 150, 165, 9, 154, 189, 218, 61, 209, 1, 82, 181, 196, 23, 53, + 182, 112, 192, 206, 167, 157, 244, 35, 1, 189, 217, 61, 88, 97, + 201, 201, 74, 251, 217, 14, 104, 184, 54, 52, 74, 238, 10, 129, + 22, 178, 226, 109, 88, 157, 30, 196, 175, 26, 76, 34, 116, 220, + 154, 232, 12, 179, 244, 15, 155, 196, 202, 72, 70, 115, 10, 214, + 114, 39, 245, 28, 237, 68, 136, 155, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.ssr_stec_correction_dep_a.header.iod_atmo = 4; - + test_msg.ssr_stec_correction_dep_a.header.num_msgs = 147; - + test_msg.ssr_stec_correction_dep_a.header.seq_num = 123; - - + test_msg.ssr_stec_correction_dep_a.header.time.tow = 3905179974; - + test_msg.ssr_stec_correction_dep_a.header.time.wn = 11193; - + test_msg.ssr_stec_correction_dep_a.header.update_interval = 39; - + test_msg.ssr_stec_correction_dep_a.n_stec_sat_list = 22; - - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[0] = -1951; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[1] = -9854; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[2] = 27353; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[3] = 3130; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_quality_indicator = 111; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[0].sv_id.constellation = 19; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_quality_indicator = + 111; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[0].sv_id.constellation = + 19; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[0].sv_id.satId = 126; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[0] = 24401; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[1] = 4182; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[2] = 21543; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[3] = -12060; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_quality_indicator = 171; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[1].sv_id.constellation = 230; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_quality_indicator = + 171; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[1].sv_id.constellation = + 230; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[1].sv_id.satId = 65; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[0] = -13469; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[1] = -18883; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[2] = 32066; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[3] = 971; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_quality_indicator = 219; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[2].sv_id.constellation = 81; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_quality_indicator = + 219; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[2].sv_id.constellation = + 81; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[2].sv_id.satId = 201; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[0] = 32220; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[1] = 5436; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[2] = -9635; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[3] = -24841; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_quality_indicator = 100; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[3].sv_id.constellation = 44; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_quality_indicator = + 100; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[3].sv_id.constellation = + 44; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[3].sv_id.satId = 193; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[0] = 3718; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[1] = 12497; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[2] = -10482; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[3] = -27495; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_quality_indicator = 129; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[4].sv_id.constellation = 93; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_quality_indicator = + 129; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[4].sv_id.constellation = + 93; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[4].sv_id.satId = 207; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[0] = -4940; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[1] = -13875; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[2] = 801; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[3] = -13066; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_quality_indicator = 225; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[5].sv_id.constellation = 72; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_quality_indicator = + 225; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[5].sv_id.constellation = + 72; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[5].sv_id.satId = 147; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[0] = -15868; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[1] = -2369; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[2] = -9396; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[3] = -16609; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_quality_indicator = 98; - - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_quality_indicator = + 98; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[6].sv_id.constellation = 3; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[6].sv_id.satId = 19; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[0] = -1265; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[1] = 4897; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[2] = 13920; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[3] = -28102; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_quality_indicator = 177; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[7].sv_id.constellation = 79; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_quality_indicator = + 177; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[7].sv_id.constellation = + 79; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[7].sv_id.satId = 113; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[0] = 5448; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[1] = -11359; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[2] = 5574; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[3] = 28654; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_quality_indicator = 249; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[8].sv_id.constellation = 100; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_quality_indicator = + 249; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[8].sv_id.constellation = + 100; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[8].sv_id.satId = 210; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[0] = -10783; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[1] = 18179; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[2] = 16371; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[3] = -5055; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_quality_indicator = 227; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[9].sv_id.constellation = 36; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_quality_indicator = + 227; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[9].sv_id.constellation = + 36; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[9].sv_id.satId = 107; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[0] = 4009; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[1] = 1462; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[2] = -19216; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[3] = 31241; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_quality_indicator = 0; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[10].sv_id.constellation = 77; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[10] + .stec_quality_indicator = 0; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[10].sv_id.constellation = + 77; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[10].sv_id.satId = 92; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[0] = 26727; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[1] = -16898; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[2] = 28241; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[3] = 12546; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_quality_indicator = 6; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[11].sv_id.constellation = 232; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[11] + .stec_quality_indicator = 6; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[11].sv_id.constellation = + 232; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[11].sv_id.satId = 86; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[0] = 12855; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[1] = 1461; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[2] = 20603; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[3] = -3023; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_quality_indicator = 216; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[12].sv_id.constellation = 84; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[12] + .stec_quality_indicator = 216; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[12].sv_id.constellation = + 84; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[12].sv_id.satId = 202; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[0] = -6492; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[1] = 16952; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[2] = -22404; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[3] = -29893; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_quality_indicator = 125; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[13].sv_id.constellation = 188; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[13] + .stec_quality_indicator = 125; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[13].sv_id.constellation = + 188; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[13].sv_id.satId = 224; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[0] = -10053; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[1] = -24897; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[2] = 23629; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[3] = -710; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_quality_indicator = 51; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[14].sv_id.constellation = 118; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[14] + .stec_quality_indicator = 51; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[14].sv_id.constellation = + 118; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[14].sv_id.satId = 106; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[0] = -26103; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[1] = -9539; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[2] = -11971; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[3] = 20993; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_quality_indicator = 165; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[15].sv_id.constellation = 150; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[15] + .stec_quality_indicator = 165; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[15].sv_id.constellation = + 150; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[15].sv_id.satId = 132; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[0] = -18891; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[1] = -16272; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[2] = -22578; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[3] = -2915; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_quality_indicator = 23; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[16].sv_id.constellation = 196; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[16] + .stec_quality_indicator = 23; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[16].sv_id.constellation = + 196; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[16].sv_id.satId = 181; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[0] = 15833; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[1] = 24920; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[2] = -13879; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[3] = -1206; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_quality_indicator = 189; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[17].sv_id.constellation = 1; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[17] + .stec_quality_indicator = 189; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[17].sv_id.constellation = + 1; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[17].sv_id.satId = 35; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[0] = 14008; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[1] = 18996; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[2] = 2798; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[3] = 5761; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_quality_indicator = 104; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[18].sv_id.constellation = 14; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[18] + .stec_quality_indicator = 104; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[18].sv_id.constellation = + 14; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[18].sv_id.satId = 217; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[0] = -25256; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[1] = -15330; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[2] = 6831; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[3] = 8780; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_quality_indicator = 109; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[19].sv_id.constellation = 226; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[19] + .stec_quality_indicator = 109; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[19].sv_id.constellation = + 226; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[19].sv_id.satId = 178; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[0] = 3304; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[1] = -2893; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[2] = -25841; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[3] = -13628; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_quality_indicator = 154; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[20].sv_id.constellation = 220; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[20] + .stec_quality_indicator = 154; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[20].sv_id.constellation = + 220; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[20].sv_id.satId = 116; - - - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[0] = -10742; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[1] = 10098; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[2] = 7413; - + test_msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[3] = 17645; - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_quality_indicator = 115; - - - test_msg.ssr_stec_correction_dep_a.stec_sat_list[21].sv_id.constellation = 70; - + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[21] + .stec_quality_indicator = 115; + + test_msg.ssr_stec_correction_dep_a.stec_sat_list[21].sv_id.constellation = + 70; + test_msg.ssr_stec_correction_dep_a.stec_sat_list[21].sv_id.satId = 72; - sbp_message_send(&sbp_state, SbpMsgSsrStecCorrectionDepA, 1831, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrStecCorrectionDepA, 1831, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1831, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrStecCorrectionDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.header.iod_atmo == 4, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.header.iod_atmo, expected 4, is %d", last_msg.msg.ssr_stec_correction_dep_a.header.iod_atmo); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.header.num_msgs == 147, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.header.num_msgs, expected 147, is %d", last_msg.msg.ssr_stec_correction_dep_a.header.num_msgs); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.header.seq_num == 123, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.header.seq_num, expected 123, is %d", last_msg.msg.ssr_stec_correction_dep_a.header.seq_num); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.header.time.tow == 3905179974, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.header.time.tow, expected 3905179974, is %d", last_msg.msg.ssr_stec_correction_dep_a.header.time.tow); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.header.time.wn == 11193, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.header.time.wn, expected 11193, is %d", last_msg.msg.ssr_stec_correction_dep_a.header.time.wn); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.header.update_interval == 39, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.header.update_interval, expected 39, is %d", last_msg.msg.ssr_stec_correction_dep_a.header.update_interval); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.n_stec_sat_list == 22, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.n_stec_sat_list, expected 22, is %d", last_msg.msg.ssr_stec_correction_dep_a.n_stec_sat_list); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[0] == -1951, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[0], expected -1951, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[1] == -9854, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[1], expected -9854, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[2] == 27353, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[2], expected 27353, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[3] == 3130, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[3], expected 3130, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_quality_indicator == 111, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_quality_indicator, expected 111, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].sv_id.constellation == 19, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].sv_id.constellation, expected 19, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].sv_id.satId == 126, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].sv_id.satId, expected 126, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[0] == 24401, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[0], expected 24401, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[1] == 4182, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[1], expected 4182, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[2] == 21543, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[2], expected 21543, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[3] == -12060, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[3], expected -12060, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_quality_indicator == 171, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_quality_indicator, expected 171, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].sv_id.constellation == 230, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].sv_id.constellation, expected 230, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].sv_id.satId == 65, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].sv_id.satId, expected 65, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[0] == -13469, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[0], expected -13469, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[1] == -18883, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[1], expected -18883, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[2] == 32066, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[2], expected 32066, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[3] == 971, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[3], expected 971, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_quality_indicator == 219, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_quality_indicator, expected 219, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].sv_id.constellation == 81, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].sv_id.constellation, expected 81, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].sv_id.satId == 201, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].sv_id.satId, expected 201, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[0] == 32220, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[0], expected 32220, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[1] == 5436, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[1], expected 5436, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[2] == -9635, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[2], expected -9635, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[3] == -24841, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[3], expected -24841, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_quality_indicator == 100, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_quality_indicator, expected 100, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].sv_id.constellation == 44, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].sv_id.constellation, expected 44, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].sv_id.satId == 193, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].sv_id.satId, expected 193, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[0] == 3718, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[0], expected 3718, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[1] == 12497, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[1], expected 12497, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[2] == -10482, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[2], expected -10482, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[3] == -27495, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[3], expected -27495, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_quality_indicator == 129, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_quality_indicator, expected 129, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].sv_id.constellation == 93, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].sv_id.constellation, expected 93, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].sv_id.satId == 207, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].sv_id.satId, expected 207, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[0] == -4940, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[0], expected -4940, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[1] == -13875, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[1], expected -13875, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[2] == 801, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[2], expected 801, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[3] == -13066, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[3], expected -13066, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_quality_indicator == 225, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_quality_indicator, expected 225, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].sv_id.constellation == 72, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].sv_id.constellation, expected 72, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].sv_id.satId == 147, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].sv_id.satId, expected 147, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[0] == -15868, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[0], expected -15868, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[1] == -2369, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[1], expected -2369, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[2] == -9396, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[2], expected -9396, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[3] == -16609, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[3], expected -16609, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_quality_indicator == 98, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_quality_indicator, expected 98, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].sv_id.constellation == 3, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].sv_id.constellation, expected 3, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].sv_id.satId == 19, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].sv_id.satId, expected 19, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[0] == -1265, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[0], expected -1265, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[1] == 4897, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[1], expected 4897, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[2] == 13920, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[2], expected 13920, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[3] == -28102, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[3], expected -28102, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_quality_indicator == 177, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_quality_indicator, expected 177, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].sv_id.constellation == 79, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].sv_id.constellation, expected 79, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].sv_id.satId == 113, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].sv_id.satId, expected 113, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[0] == 5448, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[0], expected 5448, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[1] == -11359, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[1], expected -11359, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[2] == 5574, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[2], expected 5574, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[3] == 28654, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[3], expected 28654, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_quality_indicator == 249, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_quality_indicator, expected 249, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].sv_id.constellation == 100, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].sv_id.constellation, expected 100, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].sv_id.satId == 210, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].sv_id.satId, expected 210, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[0] == -10783, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[0], expected -10783, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[1] == 18179, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[1], expected 18179, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[2] == 16371, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[2], expected 16371, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[3] == -5055, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[3], expected -5055, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_quality_indicator == 227, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_quality_indicator, expected 227, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].sv_id.constellation == 36, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].sv_id.constellation, expected 36, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].sv_id.satId == 107, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].sv_id.satId, expected 107, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[0] == 4009, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[0], expected 4009, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[1] == 1462, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[1], expected 1462, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[2] == -19216, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[2], expected -19216, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[3] == 31241, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[3], expected 31241, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_quality_indicator == 0, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_quality_indicator, expected 0, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].sv_id.constellation == 77, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].sv_id.constellation, expected 77, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].sv_id.satId == 92, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].sv_id.satId, expected 92, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[0] == 26727, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[0], expected 26727, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[1] == -16898, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[1], expected -16898, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[2] == 28241, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[2], expected 28241, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[3] == 12546, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[3], expected 12546, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_quality_indicator == 6, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_quality_indicator, expected 6, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].sv_id.constellation == 232, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].sv_id.constellation, expected 232, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].sv_id.satId == 86, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].sv_id.satId, expected 86, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[0] == 12855, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[0], expected 12855, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[1] == 1461, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[1], expected 1461, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[2] == 20603, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[2], expected 20603, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[3] == -3023, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[3], expected -3023, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_quality_indicator == 216, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_quality_indicator, expected 216, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].sv_id.constellation == 84, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].sv_id.constellation, expected 84, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].sv_id.satId == 202, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].sv_id.satId, expected 202, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[0] == -6492, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[0], expected -6492, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[1] == 16952, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[1], expected 16952, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[2] == -22404, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[2], expected -22404, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[3] == -29893, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[3], expected -29893, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_quality_indicator == 125, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_quality_indicator, expected 125, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].sv_id.constellation == 188, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].sv_id.constellation, expected 188, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].sv_id.satId == 224, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].sv_id.satId, expected 224, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[0] == -10053, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[0], expected -10053, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[1] == -24897, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[1], expected -24897, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[2] == 23629, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[2], expected 23629, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[3] == -710, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[3], expected -710, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_quality_indicator == 51, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_quality_indicator, expected 51, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].sv_id.constellation == 118, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].sv_id.constellation, expected 118, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].sv_id.satId == 106, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].sv_id.satId, expected 106, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[0] == -26103, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[0], expected -26103, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[1] == -9539, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[1], expected -9539, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[2] == -11971, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[2], expected -11971, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[3] == 20993, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[3], expected 20993, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_quality_indicator == 165, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_quality_indicator, expected 165, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].sv_id.constellation == 150, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].sv_id.constellation, expected 150, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].sv_id.satId == 132, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].sv_id.satId, expected 132, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[0] == -18891, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[0], expected -18891, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[1] == -16272, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[1], expected -16272, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[2] == -22578, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[2], expected -22578, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[3] == -2915, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[3], expected -2915, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_quality_indicator == 23, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_quality_indicator, expected 23, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].sv_id.constellation == 196, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].sv_id.constellation, expected 196, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].sv_id.satId == 181, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].sv_id.satId, expected 181, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[0] == 15833, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[0], expected 15833, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[1] == 24920, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[1], expected 24920, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[2] == -13879, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[2], expected -13879, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[3] == -1206, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[3], expected -1206, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_quality_indicator == 189, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_quality_indicator, expected 189, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].sv_id.constellation == 1, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].sv_id.constellation, expected 1, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].sv_id.satId == 35, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].sv_id.satId, expected 35, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[0] == 14008, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[0], expected 14008, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[1] == 18996, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[1], expected 18996, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[2] == 2798, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[2], expected 2798, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[3] == 5761, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[3], expected 5761, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_quality_indicator == 104, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_quality_indicator, expected 104, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].sv_id.constellation == 14, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].sv_id.constellation, expected 14, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].sv_id.satId == 217, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].sv_id.satId, expected 217, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[0] == -25256, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[0], expected -25256, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[1] == -15330, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[1], expected -15330, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[2] == 6831, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[2], expected 6831, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[3] == 8780, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[3], expected 8780, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_quality_indicator == 109, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_quality_indicator, expected 109, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].sv_id.constellation == 226, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].sv_id.constellation, expected 226, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].sv_id.satId == 178, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].sv_id.satId, expected 178, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[0] == 3304, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[0], expected 3304, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[1] == -2893, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[1], expected -2893, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[2] == -25841, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[2], expected -25841, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[3] == -13628, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[3], expected -13628, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_quality_indicator == 154, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_quality_indicator, expected 154, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].sv_id.constellation == 220, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].sv_id.constellation, expected 220, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].sv_id.satId == 116, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].sv_id.satId, expected 116, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].sv_id.satId); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[0] == -10742, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[0], expected -10742, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[0]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[1] == 10098, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[1], expected 10098, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[1]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[2] == 7413, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[2], expected 7413, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[2]); - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[3] == 17645, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[3], expected 17645, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[3]); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_quality_indicator == 115, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_quality_indicator, expected 115, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_quality_indicator); - - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].sv_id.constellation == 70, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].sv_id.constellation, expected 70, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].sv_id.constellation); - - ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].sv_id.satId == 72, "incorrect value for last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].sv_id.satId, expected 72, is %d", last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].sv_id.satId); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrStecCorrectionDepA, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.header.iod_atmo == 4, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.header.iod_atmo, " + "expected 4, is %d", + last_msg.msg.ssr_stec_correction_dep_a.header.iod_atmo); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.header.num_msgs == 147, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.header.num_msgs, " + "expected 147, is %d", + last_msg.msg.ssr_stec_correction_dep_a.header.num_msgs); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.header.seq_num == 123, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.header.seq_num, " + "expected 123, is %d", + last_msg.msg.ssr_stec_correction_dep_a.header.seq_num); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.header.time.tow == 3905179974, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.header.time.tow, expected " + "3905179974, is %d", + last_msg.msg.ssr_stec_correction_dep_a.header.time.tow); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.header.time.wn == 11193, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.header.time.wn, expected " + "11193, is %d", + last_msg.msg.ssr_stec_correction_dep_a.header.time.wn); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.header.update_interval == 39, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.header.update_interval, " + "expected 39, is %d", + last_msg.msg.ssr_stec_correction_dep_a.header.update_interval); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.n_stec_sat_list == 22, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.n_stec_sat_list, " + "expected 22, is %d", + last_msg.msg.ssr_stec_correction_dep_a.n_stec_sat_list); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[0] == + -1951, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[0]," + " expected -1951, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[1] == + -9854, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[1]," + " expected -9854, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[2] == + 27353, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[2]," + " expected 27353, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[3] == + 3130, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[3]," + " expected 3130, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0] + .stec_quality_indicator == 111, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0]." + "stec_quality_indicator, expected 111, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0] + .sv_id.constellation == 19, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].sv_" + "id.constellation, expected 19, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].sv_id.satId == + 126, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].sv_id.satId, " + "expected 126, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[0].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[0] == + 24401, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[0]," + " expected 24401, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[1] == + 4182, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[1]," + " expected 4182, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[2] == + 21543, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[2]," + " expected 21543, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[3] == + -12060, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[3]," + " expected -12060, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1] + .stec_quality_indicator == 171, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1]." + "stec_quality_indicator, expected 171, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1] + .sv_id.constellation == 230, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].sv_" + "id.constellation, expected 230, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].sv_id.satId == + 65, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].sv_id.satId, " + "expected 65, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[1].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[0] == + -13469, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[0]," + " expected -13469, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[1] == + -18883, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[1]," + " expected -18883, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[2] == + 32066, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[2]," + " expected 32066, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[3] == + 971, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[3]," + " expected 971, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2] + .stec_quality_indicator == 219, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2]." + "stec_quality_indicator, expected 219, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2] + .sv_id.constellation == 81, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].sv_" + "id.constellation, expected 81, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].sv_id.satId == + 201, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].sv_id.satId, " + "expected 201, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[2].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[0] == + 32220, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[0]," + " expected 32220, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[1] == + 5436, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[1]," + " expected 5436, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[2] == + -9635, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[2]," + " expected -9635, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[3] == + -24841, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[3]," + " expected -24841, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3] + .stec_quality_indicator == 100, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3]." + "stec_quality_indicator, expected 100, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3] + .sv_id.constellation == 44, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].sv_" + "id.constellation, expected 44, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].sv_id.satId == + 193, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].sv_id.satId, " + "expected 193, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[3].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[0] == + 3718, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[0]," + " expected 3718, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[1] == + 12497, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[1]," + " expected 12497, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[2] == + -10482, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[2]," + " expected -10482, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[3] == + -27495, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[3]," + " expected -27495, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4] + .stec_quality_indicator == 129, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4]." + "stec_quality_indicator, expected 129, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4] + .sv_id.constellation == 93, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].sv_" + "id.constellation, expected 93, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].sv_id.satId == + 207, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].sv_id.satId, " + "expected 207, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[4].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[0] == + -4940, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[0]," + " expected -4940, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[1] == + -13875, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[1]," + " expected -13875, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[2] == + 801, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[2]," + " expected 801, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[3] == + -13066, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[3]," + " expected -13066, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5] + .stec_quality_indicator == 225, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5]." + "stec_quality_indicator, expected 225, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5] + .sv_id.constellation == 72, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].sv_" + "id.constellation, expected 72, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].sv_id.satId == + 147, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].sv_id.satId, " + "expected 147, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[5].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[0] == + -15868, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[0]," + " expected -15868, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[1] == + -2369, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[1]," + " expected -2369, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[2] == + -9396, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[2]," + " expected -9396, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[3] == + -16609, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[3]," + " expected -16609, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6] + .stec_quality_indicator == 98, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6]." + "stec_quality_indicator, expected 98, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6] + .sv_id.constellation == 3, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].sv_" + "id.constellation, expected 3, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].sv_id.satId == + 19, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].sv_id.satId, " + "expected 19, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[6].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[0] == + -1265, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[0]," + " expected -1265, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[1] == + 4897, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[1]," + " expected 4897, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[2] == + 13920, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[2]," + " expected 13920, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[3] == + -28102, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[3]," + " expected -28102, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7] + .stec_quality_indicator == 177, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7]." + "stec_quality_indicator, expected 177, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7] + .sv_id.constellation == 79, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].sv_" + "id.constellation, expected 79, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].sv_id.satId == + 113, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].sv_id.satId, " + "expected 113, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[7].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[0] == + 5448, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[0]," + " expected 5448, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[1] == + -11359, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[1]," + " expected -11359, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[2] == + 5574, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[2]," + " expected 5574, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[3] == + 28654, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[3]," + " expected 28654, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8] + .stec_quality_indicator == 249, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8]." + "stec_quality_indicator, expected 249, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8] + .sv_id.constellation == 100, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].sv_" + "id.constellation, expected 100, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].sv_id.satId == + 210, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].sv_id.satId, " + "expected 210, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[8].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[0] == + -10783, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[0]," + " expected -10783, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[1] == + 18179, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[1]," + " expected 18179, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[2] == + 16371, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[2]," + " expected 16371, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[3] == + -5055, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[3]," + " expected -5055, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9] + .stec_quality_indicator == 227, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9]." + "stec_quality_indicator, expected 227, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9] + .sv_id.constellation == 36, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].sv_" + "id.constellation, expected 36, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].sv_id.satId == + 107, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].sv_id.satId, " + "expected 107, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[9].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10] + .stec_coeff[0] == 4009, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[0]" + ", expected 4009, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10] + .stec_coeff[1] == 1462, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[1]" + ", expected 1462, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10] + .stec_coeff[2] == -19216, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[2]" + ", expected -19216, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10] + .stec_coeff[3] == 31241, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[3]" + ", expected 31241, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10] + .stec_quality_indicator == 0, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10]." + "stec_quality_indicator, expected 0, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10] + .sv_id.constellation == 77, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].sv_" + "id.constellation, expected 77, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].sv_id.satId == + 92, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].sv_id.satId, " + "expected 92, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[10].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11] + .stec_coeff[0] == 26727, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[0]" + ", expected 26727, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11] + .stec_coeff[1] == -16898, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[1]" + ", expected -16898, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11] + .stec_coeff[2] == 28241, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[2]" + ", expected 28241, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11] + .stec_coeff[3] == 12546, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[3]" + ", expected 12546, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11] + .stec_quality_indicator == 6, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11]." + "stec_quality_indicator, expected 6, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11] + .sv_id.constellation == 232, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].sv_" + "id.constellation, expected 232, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].sv_id.satId == + 86, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].sv_id.satId, " + "expected 86, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[11].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12] + .stec_coeff[0] == 12855, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[0]" + ", expected 12855, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12] + .stec_coeff[1] == 1461, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[1]" + ", expected 1461, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12] + .stec_coeff[2] == 20603, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[2]" + ", expected 20603, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12] + .stec_coeff[3] == -3023, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[3]" + ", expected -3023, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12] + .stec_quality_indicator == 216, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12]." + "stec_quality_indicator, expected 216, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12] + .sv_id.constellation == 84, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].sv_" + "id.constellation, expected 84, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].sv_id.satId == + 202, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].sv_id.satId, " + "expected 202, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[12].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13] + .stec_coeff[0] == -6492, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[0]" + ", expected -6492, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13] + .stec_coeff[1] == 16952, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[1]" + ", expected 16952, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13] + .stec_coeff[2] == -22404, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[2]" + ", expected -22404, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13] + .stec_coeff[3] == -29893, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[3]" + ", expected -29893, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13] + .stec_quality_indicator == 125, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13]." + "stec_quality_indicator, expected 125, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13] + .sv_id.constellation == 188, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].sv_" + "id.constellation, expected 188, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].sv_id.satId == + 224, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].sv_id.satId, " + "expected 224, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[13].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14] + .stec_coeff[0] == -10053, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[0]" + ", expected -10053, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14] + .stec_coeff[1] == -24897, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[1]" + ", expected -24897, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14] + .stec_coeff[2] == 23629, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[2]" + ", expected 23629, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14] + .stec_coeff[3] == -710, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[3]" + ", expected -710, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14] + .stec_quality_indicator == 51, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14]." + "stec_quality_indicator, expected 51, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14] + .sv_id.constellation == 118, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].sv_" + "id.constellation, expected 118, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].sv_id.satId == + 106, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].sv_id.satId, " + "expected 106, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[14].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15] + .stec_coeff[0] == -26103, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[0]" + ", expected -26103, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15] + .stec_coeff[1] == -9539, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[1]" + ", expected -9539, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15] + .stec_coeff[2] == -11971, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[2]" + ", expected -11971, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15] + .stec_coeff[3] == 20993, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[3]" + ", expected 20993, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15] + .stec_quality_indicator == 165, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15]." + "stec_quality_indicator, expected 165, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15] + .sv_id.constellation == 150, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].sv_" + "id.constellation, expected 150, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].sv_id.satId == + 132, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].sv_id.satId, " + "expected 132, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[15].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16] + .stec_coeff[0] == -18891, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[0]" + ", expected -18891, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16] + .stec_coeff[1] == -16272, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[1]" + ", expected -16272, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16] + .stec_coeff[2] == -22578, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[2]" + ", expected -22578, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16] + .stec_coeff[3] == -2915, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[3]" + ", expected -2915, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16] + .stec_quality_indicator == 23, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16]." + "stec_quality_indicator, expected 23, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16] + .sv_id.constellation == 196, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].sv_" + "id.constellation, expected 196, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].sv_id.satId == + 181, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].sv_id.satId, " + "expected 181, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[16].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17] + .stec_coeff[0] == 15833, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[0]" + ", expected 15833, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17] + .stec_coeff[1] == 24920, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[1]" + ", expected 24920, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17] + .stec_coeff[2] == -13879, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[2]" + ", expected -13879, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17] + .stec_coeff[3] == -1206, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[3]" + ", expected -1206, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17] + .stec_quality_indicator == 189, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17]." + "stec_quality_indicator, expected 189, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17] + .sv_id.constellation == 1, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].sv_" + "id.constellation, expected 1, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].sv_id.satId == + 35, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].sv_id.satId, " + "expected 35, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[17].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18] + .stec_coeff[0] == 14008, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[0]" + ", expected 14008, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18] + .stec_coeff[1] == 18996, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[1]" + ", expected 18996, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18] + .stec_coeff[2] == 2798, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[2]" + ", expected 2798, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18] + .stec_coeff[3] == 5761, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[3]" + ", expected 5761, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18] + .stec_quality_indicator == 104, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18]." + "stec_quality_indicator, expected 104, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18] + .sv_id.constellation == 14, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].sv_" + "id.constellation, expected 14, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].sv_id.satId == + 217, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].sv_id.satId, " + "expected 217, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[18].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19] + .stec_coeff[0] == -25256, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[0]" + ", expected -25256, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19] + .stec_coeff[1] == -15330, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[1]" + ", expected -15330, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19] + .stec_coeff[2] == 6831, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[2]" + ", expected 6831, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19] + .stec_coeff[3] == 8780, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[3]" + ", expected 8780, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19] + .stec_quality_indicator == 109, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19]." + "stec_quality_indicator, expected 109, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19] + .sv_id.constellation == 226, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].sv_" + "id.constellation, expected 226, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].sv_id.satId == + 178, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].sv_id.satId, " + "expected 178, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[19].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20] + .stec_coeff[0] == 3304, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[0]" + ", expected 3304, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20] + .stec_coeff[1] == -2893, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[1]" + ", expected -2893, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20] + .stec_coeff[2] == -25841, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[2]" + ", expected -25841, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20] + .stec_coeff[3] == -13628, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[3]" + ", expected -13628, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20] + .stec_quality_indicator == 154, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20]." + "stec_quality_indicator, expected 154, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20] + .sv_id.constellation == 220, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].sv_" + "id.constellation, expected 220, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20] + .sv_id.constellation); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].sv_id.satId == + 116, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].sv_id.satId, " + "expected 116, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[20].sv_id.satId); + + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21] + .stec_coeff[0] == -10742, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[0]" + ", expected -10742, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[0]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21] + .stec_coeff[1] == 10098, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[1]" + ", expected 10098, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[1]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21] + .stec_coeff[2] == 7413, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[2]" + ", expected 7413, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[2]); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21] + .stec_coeff[3] == 17645, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[3]" + ", expected 17645, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].stec_coeff[3]); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21] + .stec_quality_indicator == 115, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21]." + "stec_quality_indicator, expected 115, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21] + .stec_quality_indicator); + + ck_assert_msg(last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21] + .sv_id.constellation == 70, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].sv_" + "id.constellation, expected 70, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21] + .sv_id.constellation); + ck_assert_msg( + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].sv_id.satId == + 72, + "incorrect value for " + "last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].sv_id.satId, " + "expected 72, is %d", + last_msg.msg.ssr_stec_correction_dep_a.stec_sat_list[21].sv_id.satId); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrStecCorrectionDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrStecCorrectionDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA"); +Suite *auto_check_sbp_ssr_MsgSsrStecCorrectionDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ssr_MsgSsrStecCorrectionDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrTileDefinition.c b/c/test/auto_check_sbp_ssr_MsgSsrTileDefinition.c index 0299fb699..9da46c463 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrTileDefinition.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrTileDefinition.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinition.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinition.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrTileDefinition ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrTileDefinition) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrTileDefinition ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,101 +90,160 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrTileDefinition ) logging_reset(); - sbp_callback_register(&sbp_state, 0x5F8, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x5F8, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,248,5,0,0,33,127,58,9,0,174,8,1,2,3,4,0,5,0,186,28,59,167,100,0,100,0,6,0,6,0,210,2,150,73,0,0,0,0,204,94, }; + u8 encoded_frame[] = { + 85, 248, 5, 0, 0, 33, 127, 58, 9, 0, 174, 8, 1, 2, + 3, 4, 0, 5, 0, 186, 28, 59, 167, 100, 0, 100, 0, 6, + 0, 6, 0, 210, 2, 150, 73, 0, 0, 0, 0, 204, 94, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ssr_tile_definition.bitmask = 1234567890; - + test_msg.ssr_tile_definition.cols = 6; - + test_msg.ssr_tile_definition.corner_nw_lat = 7354; - + test_msg.ssr_tile_definition.corner_nw_lon = -22725; - + test_msg.ssr_tile_definition.iod_atmo = 3; - + test_msg.ssr_tile_definition.rows = 6; - + test_msg.ssr_tile_definition.sol_id = 2; - + test_msg.ssr_tile_definition.spacing_lat = 100; - + test_msg.ssr_tile_definition.spacing_lon = 100; - + test_msg.ssr_tile_definition.tile_id = 5; - + test_msg.ssr_tile_definition.tile_set_id = 4; - - + test_msg.ssr_tile_definition.time.tow = 604799; - + test_msg.ssr_tile_definition.time.wn = 2222; - + test_msg.ssr_tile_definition.update_interval = 1; - sbp_message_send(&sbp_state, SbpMsgSsrTileDefinition, 0, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrTileDefinition, 0, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSsrTileDefinition, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSsrTileDefinition, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ssr_tile_definition.bitmask == 1234567890, "incorrect value for last_msg.msg.ssr_tile_definition.bitmask, expected 1234567890, is %d", last_msg.msg.ssr_tile_definition.bitmask); - - ck_assert_msg(last_msg.msg.ssr_tile_definition.cols == 6, "incorrect value for last_msg.msg.ssr_tile_definition.cols, expected 6, is %d", last_msg.msg.ssr_tile_definition.cols); - - ck_assert_msg(last_msg.msg.ssr_tile_definition.corner_nw_lat == 7354, "incorrect value for last_msg.msg.ssr_tile_definition.corner_nw_lat, expected 7354, is %d", last_msg.msg.ssr_tile_definition.corner_nw_lat); - - ck_assert_msg(last_msg.msg.ssr_tile_definition.corner_nw_lon == -22725, "incorrect value for last_msg.msg.ssr_tile_definition.corner_nw_lon, expected -22725, is %d", last_msg.msg.ssr_tile_definition.corner_nw_lon); - - ck_assert_msg(last_msg.msg.ssr_tile_definition.iod_atmo == 3, "incorrect value for last_msg.msg.ssr_tile_definition.iod_atmo, expected 3, is %d", last_msg.msg.ssr_tile_definition.iod_atmo); - - ck_assert_msg(last_msg.msg.ssr_tile_definition.rows == 6, "incorrect value for last_msg.msg.ssr_tile_definition.rows, expected 6, is %d", last_msg.msg.ssr_tile_definition.rows); - - ck_assert_msg(last_msg.msg.ssr_tile_definition.sol_id == 2, "incorrect value for last_msg.msg.ssr_tile_definition.sol_id, expected 2, is %d", last_msg.msg.ssr_tile_definition.sol_id); - - ck_assert_msg(last_msg.msg.ssr_tile_definition.spacing_lat == 100, "incorrect value for last_msg.msg.ssr_tile_definition.spacing_lat, expected 100, is %d", last_msg.msg.ssr_tile_definition.spacing_lat); - - ck_assert_msg(last_msg.msg.ssr_tile_definition.spacing_lon == 100, "incorrect value for last_msg.msg.ssr_tile_definition.spacing_lon, expected 100, is %d", last_msg.msg.ssr_tile_definition.spacing_lon); - - ck_assert_msg(last_msg.msg.ssr_tile_definition.tile_id == 5, "incorrect value for last_msg.msg.ssr_tile_definition.tile_id, expected 5, is %d", last_msg.msg.ssr_tile_definition.tile_id); - - ck_assert_msg(last_msg.msg.ssr_tile_definition.tile_set_id == 4, "incorrect value for last_msg.msg.ssr_tile_definition.tile_set_id, expected 4, is %d", last_msg.msg.ssr_tile_definition.tile_set_id); - - - ck_assert_msg(last_msg.msg.ssr_tile_definition.time.tow == 604799, "incorrect value for last_msg.msg.ssr_tile_definition.time.tow, expected 604799, is %d", last_msg.msg.ssr_tile_definition.time.tow); - - ck_assert_msg(last_msg.msg.ssr_tile_definition.time.wn == 2222, "incorrect value for last_msg.msg.ssr_tile_definition.time.wn, expected 2222, is %d", last_msg.msg.ssr_tile_definition.time.wn); - - ck_assert_msg(last_msg.msg.ssr_tile_definition.update_interval == 1, "incorrect value for last_msg.msg.ssr_tile_definition.update_interval, expected 1, is %d", last_msg.msg.ssr_tile_definition.update_interval); + ck_assert_msg( + last_msg.msg.ssr_tile_definition.bitmask == 1234567890, + "incorrect value for last_msg.msg.ssr_tile_definition.bitmask, " + "expected 1234567890, is %d", + last_msg.msg.ssr_tile_definition.bitmask); + + ck_assert_msg(last_msg.msg.ssr_tile_definition.cols == 6, + "incorrect value for last_msg.msg.ssr_tile_definition.cols, " + "expected 6, is %d", + last_msg.msg.ssr_tile_definition.cols); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition.corner_nw_lat == 7354, + "incorrect value for last_msg.msg.ssr_tile_definition.corner_nw_lat, " + "expected 7354, is %d", + last_msg.msg.ssr_tile_definition.corner_nw_lat); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition.corner_nw_lon == -22725, + "incorrect value for last_msg.msg.ssr_tile_definition.corner_nw_lon, " + "expected -22725, is %d", + last_msg.msg.ssr_tile_definition.corner_nw_lon); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition.iod_atmo == 3, + "incorrect value for last_msg.msg.ssr_tile_definition.iod_atmo, " + "expected 3, is %d", + last_msg.msg.ssr_tile_definition.iod_atmo); + + ck_assert_msg(last_msg.msg.ssr_tile_definition.rows == 6, + "incorrect value for last_msg.msg.ssr_tile_definition.rows, " + "expected 6, is %d", + last_msg.msg.ssr_tile_definition.rows); + + ck_assert_msg(last_msg.msg.ssr_tile_definition.sol_id == 2, + "incorrect value for " + "last_msg.msg.ssr_tile_definition.sol_id, expected 2, is %d", + last_msg.msg.ssr_tile_definition.sol_id); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition.spacing_lat == 100, + "incorrect value for last_msg.msg.ssr_tile_definition.spacing_lat, " + "expected 100, is %d", + last_msg.msg.ssr_tile_definition.spacing_lat); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition.spacing_lon == 100, + "incorrect value for last_msg.msg.ssr_tile_definition.spacing_lon, " + "expected 100, is %d", + last_msg.msg.ssr_tile_definition.spacing_lon); + + ck_assert_msg(last_msg.msg.ssr_tile_definition.tile_id == 5, + "incorrect value for " + "last_msg.msg.ssr_tile_definition.tile_id, expected 5, is %d", + last_msg.msg.ssr_tile_definition.tile_id); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition.tile_set_id == 4, + "incorrect value for last_msg.msg.ssr_tile_definition.tile_set_id, " + "expected 4, is %d", + last_msg.msg.ssr_tile_definition.tile_set_id); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition.time.tow == 604799, + "incorrect value for last_msg.msg.ssr_tile_definition.time.tow, " + "expected 604799, is %d", + last_msg.msg.ssr_tile_definition.time.tow); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition.time.wn == 2222, + "incorrect value for last_msg.msg.ssr_tile_definition.time.wn, " + "expected 2222, is %d", + last_msg.msg.ssr_tile_definition.time.wn); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition.update_interval == 1, + "incorrect value for last_msg.msg.ssr_tile_definition.update_interval, " + "expected 1, is %d", + last_msg.msg.ssr_tile_definition.update_interval); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrTileDefinition_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrTileDefinition"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrTileDefinition"); +Suite *auto_check_sbp_ssr_MsgSsrTileDefinition_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ssr_MsgSsrTileDefinition"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrTileDefinition"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrTileDefinition); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.c b/c/test/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.c index f59076198..0a196da80 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,79 +90,126 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x5f6, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x5f6, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,246,5,200,133,24,57,190,178,247,8,185,9,181,162,240,65,19,255,143,21,191,239,205,171,0,0,0,0,0,65,154, }; + u8 encoded_frame[] = { + 85, 246, 5, 200, 133, 24, 57, 190, 178, 247, 8, + 185, 9, 181, 162, 240, 65, 19, 255, 143, 21, 191, + 239, 205, 171, 0, 0, 0, 0, 0, 65, 154, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ssr_tile_definition_dep_a.bitmask = 11259375; - + test_msg.ssr_tile_definition_dep_a.cols = 48917; - + test_msg.ssr_tile_definition_dep_a.corner_nw_lat = -18168; - + test_msg.ssr_tile_definition_dep_a.corner_nw_lon = -19191; - + test_msg.ssr_tile_definition_dep_a.rows = 36863; - + test_msg.ssr_tile_definition_dep_a.spacing_lat = 61602; - + test_msg.ssr_tile_definition_dep_a.spacing_lon = 4929; - + test_msg.ssr_tile_definition_dep_a.tile_id = 63410; - + test_msg.ssr_tile_definition_dep_a.tile_set_id = 48697; - sbp_message_send(&sbp_state, SbpMsgSsrTileDefinitionDepA, 34248, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrTileDefinitionDepA, 34248, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 34248, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrTileDefinitionDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_a.bitmask == 11259375, "incorrect value for last_msg.msg.ssr_tile_definition_dep_a.bitmask, expected 11259375, is %d", last_msg.msg.ssr_tile_definition_dep_a.bitmask); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_a.cols == 48917, "incorrect value for last_msg.msg.ssr_tile_definition_dep_a.cols, expected 48917, is %d", last_msg.msg.ssr_tile_definition_dep_a.cols); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_a.corner_nw_lat == -18168, "incorrect value for last_msg.msg.ssr_tile_definition_dep_a.corner_nw_lat, expected -18168, is %d", last_msg.msg.ssr_tile_definition_dep_a.corner_nw_lat); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_a.corner_nw_lon == -19191, "incorrect value for last_msg.msg.ssr_tile_definition_dep_a.corner_nw_lon, expected -19191, is %d", last_msg.msg.ssr_tile_definition_dep_a.corner_nw_lon); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_a.rows == 36863, "incorrect value for last_msg.msg.ssr_tile_definition_dep_a.rows, expected 36863, is %d", last_msg.msg.ssr_tile_definition_dep_a.rows); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_a.spacing_lat == 61602, "incorrect value for last_msg.msg.ssr_tile_definition_dep_a.spacing_lat, expected 61602, is %d", last_msg.msg.ssr_tile_definition_dep_a.spacing_lat); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_a.spacing_lon == 4929, "incorrect value for last_msg.msg.ssr_tile_definition_dep_a.spacing_lon, expected 4929, is %d", last_msg.msg.ssr_tile_definition_dep_a.spacing_lon); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_a.tile_id == 63410, "incorrect value for last_msg.msg.ssr_tile_definition_dep_a.tile_id, expected 63410, is %d", last_msg.msg.ssr_tile_definition_dep_a.tile_id); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_a.tile_set_id == 48697, "incorrect value for last_msg.msg.ssr_tile_definition_dep_a.tile_set_id, expected 48697, is %d", last_msg.msg.ssr_tile_definition_dep_a.tile_set_id); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrTileDefinitionDepA, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition_dep_a.bitmask == 11259375, + "incorrect value for last_msg.msg.ssr_tile_definition_dep_a.bitmask, " + "expected 11259375, is %d", + last_msg.msg.ssr_tile_definition_dep_a.bitmask); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition_dep_a.cols == 48917, + "incorrect value for last_msg.msg.ssr_tile_definition_dep_a.cols, " + "expected 48917, is %d", + last_msg.msg.ssr_tile_definition_dep_a.cols); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition_dep_a.corner_nw_lat == -18168, + "incorrect value for " + "last_msg.msg.ssr_tile_definition_dep_a.corner_nw_lat, expected " + "-18168, is %d", + last_msg.msg.ssr_tile_definition_dep_a.corner_nw_lat); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition_dep_a.corner_nw_lon == -19191, + "incorrect value for " + "last_msg.msg.ssr_tile_definition_dep_a.corner_nw_lon, expected " + "-19191, is %d", + last_msg.msg.ssr_tile_definition_dep_a.corner_nw_lon); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition_dep_a.rows == 36863, + "incorrect value for last_msg.msg.ssr_tile_definition_dep_a.rows, " + "expected 36863, is %d", + last_msg.msg.ssr_tile_definition_dep_a.rows); + + ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_a.spacing_lat == 61602, + "incorrect value for " + "last_msg.msg.ssr_tile_definition_dep_a.spacing_lat, " + "expected 61602, is %d", + last_msg.msg.ssr_tile_definition_dep_a.spacing_lat); + + ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_a.spacing_lon == 4929, + "incorrect value for " + "last_msg.msg.ssr_tile_definition_dep_a.spacing_lon, " + "expected 4929, is %d", + last_msg.msg.ssr_tile_definition_dep_a.spacing_lon); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition_dep_a.tile_id == 63410, + "incorrect value for last_msg.msg.ssr_tile_definition_dep_a.tile_id, " + "expected 63410, is %d", + last_msg.msg.ssr_tile_definition_dep_a.tile_id); + + ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_a.tile_set_id == 48697, + "incorrect value for " + "last_msg.msg.ssr_tile_definition_dep_a.tile_set_id, " + "expected 48697, is %d", + last_msg.msg.ssr_tile_definition_dep_a.tile_set_id); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrTileDefinitionDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrTileDefinitionDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA"); +Suite *auto_check_sbp_ssr_MsgSsrTileDefinitionDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ssr_MsgSsrTileDefinitionDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.c b/c/test/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.c index 1fad873cf..4641f2bd6 100644 --- a/c/test/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.c +++ b/c/test/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepB.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB ) -{ +START_TEST(test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,83 +90,131 @@ START_TEST( test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 1527, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 1527, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,247,5,66,0,25,31,0,1,0,2,0,4,0,8,0,16,0,32,0,64,0,128,210,2,150,73,0,0,0,0,214,71, }; + u8 encoded_frame[] = { + 85, 247, 5, 66, 0, 25, 31, 0, 1, 0, 2, 0, 4, 0, 8, 0, 16, + 0, 32, 0, 64, 0, 128, 210, 2, 150, 73, 0, 0, 0, 0, 214, 71, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ssr_tile_definition_dep_b.bitmask = 1234567890; - + test_msg.ssr_tile_definition_dep_b.cols = 32768; - + test_msg.ssr_tile_definition_dep_b.corner_nw_lat = 1024; - + test_msg.ssr_tile_definition_dep_b.corner_nw_lon = 2048; - + test_msg.ssr_tile_definition_dep_b.rows = 16384; - + test_msg.ssr_tile_definition_dep_b.spacing_lat = 4096; - + test_msg.ssr_tile_definition_dep_b.spacing_lon = 8192; - + test_msg.ssr_tile_definition_dep_b.ssr_sol_id = 31; - + test_msg.ssr_tile_definition_dep_b.tile_id = 512; - + test_msg.ssr_tile_definition_dep_b.tile_set_id = 256; - sbp_message_send(&sbp_state, SbpMsgSsrTileDefinitionDepB, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSsrTileDefinitionDepB, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgSsrTileDefinitionDepB, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_b.bitmask == 1234567890, "incorrect value for last_msg.msg.ssr_tile_definition_dep_b.bitmask, expected 1234567890, is %d", last_msg.msg.ssr_tile_definition_dep_b.bitmask); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_b.cols == 32768, "incorrect value for last_msg.msg.ssr_tile_definition_dep_b.cols, expected 32768, is %d", last_msg.msg.ssr_tile_definition_dep_b.cols); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_b.corner_nw_lat == 1024, "incorrect value for last_msg.msg.ssr_tile_definition_dep_b.corner_nw_lat, expected 1024, is %d", last_msg.msg.ssr_tile_definition_dep_b.corner_nw_lat); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_b.corner_nw_lon == 2048, "incorrect value for last_msg.msg.ssr_tile_definition_dep_b.corner_nw_lon, expected 2048, is %d", last_msg.msg.ssr_tile_definition_dep_b.corner_nw_lon); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_b.rows == 16384, "incorrect value for last_msg.msg.ssr_tile_definition_dep_b.rows, expected 16384, is %d", last_msg.msg.ssr_tile_definition_dep_b.rows); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_b.spacing_lat == 4096, "incorrect value for last_msg.msg.ssr_tile_definition_dep_b.spacing_lat, expected 4096, is %d", last_msg.msg.ssr_tile_definition_dep_b.spacing_lat); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_b.spacing_lon == 8192, "incorrect value for last_msg.msg.ssr_tile_definition_dep_b.spacing_lon, expected 8192, is %d", last_msg.msg.ssr_tile_definition_dep_b.spacing_lon); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_b.ssr_sol_id == 31, "incorrect value for last_msg.msg.ssr_tile_definition_dep_b.ssr_sol_id, expected 31, is %d", last_msg.msg.ssr_tile_definition_dep_b.ssr_sol_id); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_b.tile_id == 512, "incorrect value for last_msg.msg.ssr_tile_definition_dep_b.tile_id, expected 512, is %d", last_msg.msg.ssr_tile_definition_dep_b.tile_id); - - ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_b.tile_set_id == 256, "incorrect value for last_msg.msg.ssr_tile_definition_dep_b.tile_set_id, expected 256, is %d", last_msg.msg.ssr_tile_definition_dep_b.tile_set_id); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgSsrTileDefinitionDepB, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition_dep_b.bitmask == 1234567890, + "incorrect value for last_msg.msg.ssr_tile_definition_dep_b.bitmask, " + "expected 1234567890, is %d", + last_msg.msg.ssr_tile_definition_dep_b.bitmask); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition_dep_b.cols == 32768, + "incorrect value for last_msg.msg.ssr_tile_definition_dep_b.cols, " + "expected 32768, is %d", + last_msg.msg.ssr_tile_definition_dep_b.cols); + + ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_b.corner_nw_lat == 1024, + "incorrect value for " + "last_msg.msg.ssr_tile_definition_dep_b.corner_nw_lat, " + "expected 1024, is %d", + last_msg.msg.ssr_tile_definition_dep_b.corner_nw_lat); + + ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_b.corner_nw_lon == 2048, + "incorrect value for " + "last_msg.msg.ssr_tile_definition_dep_b.corner_nw_lon, " + "expected 2048, is %d", + last_msg.msg.ssr_tile_definition_dep_b.corner_nw_lon); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition_dep_b.rows == 16384, + "incorrect value for last_msg.msg.ssr_tile_definition_dep_b.rows, " + "expected 16384, is %d", + last_msg.msg.ssr_tile_definition_dep_b.rows); + + ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_b.spacing_lat == 4096, + "incorrect value for " + "last_msg.msg.ssr_tile_definition_dep_b.spacing_lat, " + "expected 4096, is %d", + last_msg.msg.ssr_tile_definition_dep_b.spacing_lat); + + ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_b.spacing_lon == 8192, + "incorrect value for " + "last_msg.msg.ssr_tile_definition_dep_b.spacing_lon, " + "expected 8192, is %d", + last_msg.msg.ssr_tile_definition_dep_b.spacing_lon); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition_dep_b.ssr_sol_id == 31, + "incorrect value for " + "last_msg.msg.ssr_tile_definition_dep_b.ssr_sol_id, expected 31, is %d", + last_msg.msg.ssr_tile_definition_dep_b.ssr_sol_id); + + ck_assert_msg( + last_msg.msg.ssr_tile_definition_dep_b.tile_id == 512, + "incorrect value for last_msg.msg.ssr_tile_definition_dep_b.tile_id, " + "expected 512, is %d", + last_msg.msg.ssr_tile_definition_dep_b.tile_id); + + ck_assert_msg(last_msg.msg.ssr_tile_definition_dep_b.tile_set_id == 256, + "incorrect value for " + "last_msg.msg.ssr_tile_definition_dep_b.tile_set_id, " + "expected 256, is %d", + last_msg.msg.ssr_tile_definition_dep_b.tile_set_id); } } END_TEST -Suite* auto_check_sbp_ssr_MsgSsrTileDefinitionDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_ssr_MsgSsrTileDefinitionDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB"); +Suite *auto_check_sbp_ssr_MsgSsrTileDefinitionDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_ssr_MsgSsrTileDefinitionDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB"); tcase_add_test(tc_acq, test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_system_MsgCsacTelemetry.c b/c/test/auto_check_sbp_system_MsgCsacTelemetry.c index 5df9510a9..a92097c74 100644 --- a/c/test/auto_check_sbp_system_MsgCsacTelemetry.c +++ b/c/test/auto_check_sbp_system_MsgCsacTelemetry.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetry.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetry.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_system_MsgCsacTelemetry ) -{ +START_TEST(test_auto_check_sbp_system_MsgCsacTelemetry) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_system_MsgCsacTelemetry ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,57 +90,76 @@ START_TEST( test_auto_check_sbp_system_MsgCsacTelemetry ) logging_reset(); - sbp_callback_register(&sbp_state, 0xff04, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xff04, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,255,244,169,10,105,115,111,109,101,32,100,97,116,97,229,94, }; + u8 encoded_frame[] = { + 85, 4, 255, 244, 169, 10, 105, 115, 111, + 109, 101, 32, 100, 97, 116, 97, 229, 94, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.csac_telemetry.id = 105; - - - size_t written; - ck_assert_msg(sbp_msg_csac_telemetry_telemetry_set(&test_msg.csac_telemetry, "some data", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("some data"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_csac_telemetry_telemetry_encoded_len(&test_msg.csac_telemetry) == 9, "String not encoded properly"); - sbp_message_send(&sbp_state, SbpMsgCsacTelemetry, 43508, &test_msg, &dummy_write); + size_t written; + ck_assert_msg(sbp_msg_csac_telemetry_telemetry_set( + &test_msg.csac_telemetry, "some data", false, &written), + "Can't assign text"); + ck_assert_msg(written == strlen("some data"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_csac_telemetry_telemetry_encoded_len( + &test_msg.csac_telemetry) == 9, + "String not encoded properly"); + + sbp_message_send(&sbp_state, SbpMsgCsacTelemetry, 43508, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 43508, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgCsacTelemetry, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgCsacTelemetry, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.csac_telemetry.id == 105, "incorrect value for last_msg.msg.csac_telemetry.id, expected 105, is %d", last_msg.msg.csac_telemetry.id); - - - ck_assert_msg(sbp_msg_csac_telemetry_telemetry_encoded_len(&last_msg.msg.csac_telemetry) == 9, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_csac_telemetry_telemetry_get(&last_msg.msg.csac_telemetry), "some data") == 0, "String not decoded properly"); + ck_assert_msg(last_msg.msg.csac_telemetry.id == 105, + "incorrect value for last_msg.msg.csac_telemetry.id, " + "expected 105, is %d", + last_msg.msg.csac_telemetry.id); + + ck_assert_msg(sbp_msg_csac_telemetry_telemetry_encoded_len( + &last_msg.msg.csac_telemetry) == 9, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_csac_telemetry_telemetry_get( + &last_msg.msg.csac_telemetry), + "some data") == 0, + "String not decoded properly"); } } END_TEST -Suite* auto_check_sbp_system_MsgCsacTelemetry_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_system_MsgCsacTelemetry"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_system_MsgCsacTelemetry"); +Suite *auto_check_sbp_system_MsgCsacTelemetry_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_system_MsgCsacTelemetry"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_system_MsgCsacTelemetry"); tcase_add_test(tc_acq, test_auto_check_sbp_system_MsgCsacTelemetry); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_system_MsgCsacTelemetryLabels.c b/c/test/auto_check_sbp_system_MsgCsacTelemetryLabels.c index 3613590f8..e902b72e3 100644 --- a/c/test/auto_check_sbp_system_MsgCsacTelemetryLabels.c +++ b/c/test/auto_check_sbp_system_MsgCsacTelemetryLabels.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetryLabels.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetryLabels.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_system_MsgCsacTelemetryLabels ) -{ +START_TEST(test_auto_check_sbp_system_MsgCsacTelemetryLabels) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_system_MsgCsacTelemetryLabels ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,57 +90,77 @@ START_TEST( test_auto_check_sbp_system_MsgCsacTelemetryLabels ) logging_reset(); - sbp_callback_register(&sbp_state, 0xff05, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xff05, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,5,255,91,200,12,186,115,111,109,101,32,108,97,98,101,108,115,86,236, }; + u8 encoded_frame[] = { + 85, 5, 255, 91, 200, 12, 186, 115, 111, 109, + 101, 32, 108, 97, 98, 101, 108, 115, 86, 236, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.csac_telemetry_labels.id = 186; - - - size_t written; - ck_assert_msg(sbp_msg_csac_telemetry_labels_telemetry_labels_set(&test_msg.csac_telemetry_labels, "some labels", false, &written), "Can't assign text"); - ck_assert_msg(written == strlen("some labels"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_csac_telemetry_labels_telemetry_labels_encoded_len(&test_msg.csac_telemetry_labels) == 11, "String not encoded properly"); - sbp_message_send(&sbp_state, SbpMsgCsacTelemetryLabels, 51291, &test_msg, &dummy_write); + size_t written; + ck_assert_msg( + sbp_msg_csac_telemetry_labels_telemetry_labels_set( + &test_msg.csac_telemetry_labels, "some labels", false, &written), + "Can't assign text"); + ck_assert_msg(written == strlen("some labels"), + "Wrote different to expected"); + ck_assert_msg(sbp_msg_csac_telemetry_labels_telemetry_labels_encoded_len( + &test_msg.csac_telemetry_labels) == 11, + "String not encoded properly"); + + sbp_message_send(&sbp_state, SbpMsgCsacTelemetryLabels, 51291, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 51291, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgCsacTelemetryLabels, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.csac_telemetry_labels.id == 186, "incorrect value for last_msg.msg.csac_telemetry_labels.id, expected 186, is %d", last_msg.msg.csac_telemetry_labels.id); - - - ck_assert_msg(sbp_msg_csac_telemetry_labels_telemetry_labels_encoded_len(&last_msg.msg.csac_telemetry_labels) == 11, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_csac_telemetry_labels_telemetry_labels_get(&last_msg.msg.csac_telemetry_labels), "some labels") == 0, "String not decoded properly"); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgCsacTelemetryLabels, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.csac_telemetry_labels.id == 186, + "incorrect value for last_msg.msg.csac_telemetry_labels.id, " + "expected 186, is %d", + last_msg.msg.csac_telemetry_labels.id); + + ck_assert_msg(sbp_msg_csac_telemetry_labels_telemetry_labels_encoded_len( + &last_msg.msg.csac_telemetry_labels) == 11, + "Invalid encoded len"); + ck_assert_msg(strcmp(sbp_msg_csac_telemetry_labels_telemetry_labels_get( + &last_msg.msg.csac_telemetry_labels), + "some labels") == 0, + "String not decoded properly"); } } END_TEST -Suite* auto_check_sbp_system_MsgCsacTelemetryLabels_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_system_MsgCsacTelemetryLabels"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_system_MsgCsacTelemetryLabels"); +Suite *auto_check_sbp_system_MsgCsacTelemetryLabels_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_system_MsgCsacTelemetryLabels"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_system_MsgCsacTelemetryLabels"); tcase_add_test(tc_acq, test_auto_check_sbp_system_MsgCsacTelemetryLabels); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_system_MsgDgnssStatus.c b/c/test/auto_check_sbp_system_MsgDgnssStatus.c index ebabaed0d..2f28f6155 100644 --- a/c/test/auto_check_sbp_system_MsgDgnssStatus.c +++ b/c/test/auto_check_sbp_system_MsgDgnssStatus.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgDgnssStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgDgnssStatus.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_system_MsgDgnssStatus ) -{ +START_TEST(test_auto_check_sbp_system_MsgDgnssStatus) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_system_MsgDgnssStatus ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,65 +90,89 @@ START_TEST( test_auto_check_sbp_system_MsgDgnssStatus ) logging_reset(); - sbp_callback_register(&sbp_state, 0xff02, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xff02, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,2,255,66,0,11,0,50,0,12,83,107,121,108,97,114,107,202,1, }; + u8 encoded_frame[] = { + 85, 2, 255, 66, 0, 11, 0, 50, 0, 12, + 83, 107, 121, 108, 97, 114, 107, 202, 1, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.dgnss_status.flags = 0; - + test_msg.dgnss_status.latency = 50; - + test_msg.dgnss_status.num_signals = 12; - - + size_t written; - ck_assert_msg(sbp_msg_dgnss_status_source_set(&test_msg.dgnss_status, "Skylark", false, &written), "Can't assign text"); + ck_assert_msg(sbp_msg_dgnss_status_source_set(&test_msg.dgnss_status, + "Skylark", false, &written), + "Can't assign text"); ck_assert_msg(written == strlen("Skylark"), "Wrote different to expected"); - ck_assert_msg(sbp_msg_dgnss_status_source_encoded_len(&test_msg.dgnss_status) == 7, "String not encoded properly"); + ck_assert_msg( + sbp_msg_dgnss_status_source_encoded_len(&test_msg.dgnss_status) == 7, + "String not encoded properly"); - sbp_message_send(&sbp_state, SbpMsgDgnssStatus, 66, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgDgnssStatus, 66, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgDgnssStatus, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgDgnssStatus, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.dgnss_status.flags == 0, "incorrect value for last_msg.msg.dgnss_status.flags, expected 0, is %d", last_msg.msg.dgnss_status.flags); - - ck_assert_msg(last_msg.msg.dgnss_status.latency == 50, "incorrect value for last_msg.msg.dgnss_status.latency, expected 50, is %d", last_msg.msg.dgnss_status.latency); - - ck_assert_msg(last_msg.msg.dgnss_status.num_signals == 12, "incorrect value for last_msg.msg.dgnss_status.num_signals, expected 12, is %d", last_msg.msg.dgnss_status.num_signals); - - - ck_assert_msg(sbp_msg_dgnss_status_source_encoded_len(&last_msg.msg.dgnss_status) == 7, "Invalid encoded len"); - ck_assert_msg(strcmp(sbp_msg_dgnss_status_source_get(&last_msg.msg.dgnss_status), "Skylark") == 0, "String not decoded properly"); + ck_assert_msg(last_msg.msg.dgnss_status.flags == 0, + "incorrect value for last_msg.msg.dgnss_status.flags, " + "expected 0, is %d", + last_msg.msg.dgnss_status.flags); + + ck_assert_msg(last_msg.msg.dgnss_status.latency == 50, + "incorrect value for last_msg.msg.dgnss_status.latency, " + "expected 50, is %d", + last_msg.msg.dgnss_status.latency); + + ck_assert_msg(last_msg.msg.dgnss_status.num_signals == 12, + "incorrect value for last_msg.msg.dgnss_status.num_signals, " + "expected 12, is %d", + last_msg.msg.dgnss_status.num_signals); + + ck_assert_msg(sbp_msg_dgnss_status_source_encoded_len( + &last_msg.msg.dgnss_status) == 7, + "Invalid encoded len"); + ck_assert_msg( + strcmp(sbp_msg_dgnss_status_source_get(&last_msg.msg.dgnss_status), + "Skylark") == 0, + "String not decoded properly"); } } END_TEST -Suite* auto_check_sbp_system_MsgDgnssStatus_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_system_MsgDgnssStatus"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_system_MsgDgnssStatus"); +Suite *auto_check_sbp_system_MsgDgnssStatus_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_system_MsgDgnssStatus"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_system_MsgDgnssStatus"); tcase_add_test(tc_acq, test_auto_check_sbp_system_MsgDgnssStatus); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_system_MsgGnssTimeOffset.c b/c/test/auto_check_sbp_system_MsgGnssTimeOffset.c index 182557ffc..47796d5a1 100644 --- a/c/test/auto_check_sbp_system_MsgGnssTimeOffset.c +++ b/c/test/auto_check_sbp_system_MsgGnssTimeOffset.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgGnssTimeOffset.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgGnssTimeOffset.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_system_MsgGnssTimeOffset ) -{ +START_TEST(test_auto_check_sbp_system_MsgGnssTimeOffset) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_system_MsgGnssTimeOffset ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,59 +90,80 @@ START_TEST( test_auto_check_sbp_system_MsgGnssTimeOffset ) logging_reset(); - sbp_callback_register(&sbp_state, 0xff07, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xff07, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,7,255,22,15,9,9,58,82,83,9,103,22,37,221,84,100, }; + u8 encoded_frame[] = { + 85, 7, 255, 22, 15, 9, 9, 58, 82, 83, 9, 103, 22, 37, 221, 84, 100, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.gnss_time_offset.flags = 221; - + test_msg.gnss_time_offset.microseconds = 9494; - + test_msg.gnss_time_offset.milliseconds = 1728664402; - + test_msg.gnss_time_offset.weeks = 14857; - sbp_message_send(&sbp_state, SbpMsgGnssTimeOffset, 3862, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGnssTimeOffset, 3862, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 3862, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGnssTimeOffset, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGnssTimeOffset, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.gnss_time_offset.flags == 221, "incorrect value for last_msg.msg.gnss_time_offset.flags, expected 221, is %d", last_msg.msg.gnss_time_offset.flags); - - ck_assert_msg(last_msg.msg.gnss_time_offset.microseconds == 9494, "incorrect value for last_msg.msg.gnss_time_offset.microseconds, expected 9494, is %d", last_msg.msg.gnss_time_offset.microseconds); - - ck_assert_msg(last_msg.msg.gnss_time_offset.milliseconds == 1728664402, "incorrect value for last_msg.msg.gnss_time_offset.milliseconds, expected 1728664402, is %d", last_msg.msg.gnss_time_offset.milliseconds); - - ck_assert_msg(last_msg.msg.gnss_time_offset.weeks == 14857, "incorrect value for last_msg.msg.gnss_time_offset.weeks, expected 14857, is %d", last_msg.msg.gnss_time_offset.weeks); + ck_assert_msg(last_msg.msg.gnss_time_offset.flags == 221, + "incorrect value for last_msg.msg.gnss_time_offset.flags, " + "expected 221, is %d", + last_msg.msg.gnss_time_offset.flags); + + ck_assert_msg( + last_msg.msg.gnss_time_offset.microseconds == 9494, + "incorrect value for last_msg.msg.gnss_time_offset.microseconds, " + "expected 9494, is %d", + last_msg.msg.gnss_time_offset.microseconds); + + ck_assert_msg( + last_msg.msg.gnss_time_offset.milliseconds == 1728664402, + "incorrect value for last_msg.msg.gnss_time_offset.milliseconds, " + "expected 1728664402, is %d", + last_msg.msg.gnss_time_offset.milliseconds); + + ck_assert_msg(last_msg.msg.gnss_time_offset.weeks == 14857, + "incorrect value for last_msg.msg.gnss_time_offset.weeks, " + "expected 14857, is %d", + last_msg.msg.gnss_time_offset.weeks); } } END_TEST -Suite* auto_check_sbp_system_MsgGnssTimeOffset_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_system_MsgGnssTimeOffset"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_system_MsgGnssTimeOffset"); +Suite *auto_check_sbp_system_MsgGnssTimeOffset_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_system_MsgGnssTimeOffset"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_system_MsgGnssTimeOffset"); tcase_add_test(tc_acq, test_auto_check_sbp_system_MsgGnssTimeOffset); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_system_MsgGroupMeta.c b/c/test/auto_check_sbp_system_MsgGroupMeta.c index 5a96d1503..d8938db0d 100644 --- a/c/test/auto_check_sbp_system_MsgGroupMeta.c +++ b/c/test/auto_check_sbp_system_MsgGroupMeta.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgGroupMeta.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgGroupMeta.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_system_MsgGroupMeta ) -{ +START_TEST(test_auto_check_sbp_system_MsgGroupMeta) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_system_MsgGroupMeta ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,63 +90,87 @@ START_TEST( test_auto_check_sbp_system_MsgGroupMeta ) logging_reset(); - sbp_callback_register(&sbp_state, 0xFF0A, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xFF0A, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,10,255,238,238,9,1,2,3,10,255,10,2,2,255,2,14, }; + u8 encoded_frame[] = { + 85, 10, 255, 238, 238, 9, 1, 2, 3, 10, 255, 10, 2, 2, 255, 2, 14, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.group_meta.flags = 2; - + test_msg.group_meta.group_id = 1; - - + test_msg.group_meta.group_msgs[0] = 65290; - + test_msg.group_meta.group_msgs[1] = 522; - + test_msg.group_meta.group_msgs[2] = 65282; - + test_msg.group_meta.n_group_msgs = 3; - sbp_message_send(&sbp_state, SbpMsgGroupMeta, 61166, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgGroupMeta, 61166, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61166, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGroupMeta, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGroupMeta, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.group_meta.flags == 2, "incorrect value for last_msg.msg.group_meta.flags, expected 2, is %d", last_msg.msg.group_meta.flags); - - ck_assert_msg(last_msg.msg.group_meta.group_id == 1, "incorrect value for last_msg.msg.group_meta.group_id, expected 1, is %d", last_msg.msg.group_meta.group_id); - - ck_assert_msg(last_msg.msg.group_meta.group_msgs[0] == 65290, "incorrect value for last_msg.msg.group_meta.group_msgs[0], expected 65290, is %d", last_msg.msg.group_meta.group_msgs[0]); - ck_assert_msg(last_msg.msg.group_meta.group_msgs[1] == 522, "incorrect value for last_msg.msg.group_meta.group_msgs[1], expected 522, is %d", last_msg.msg.group_meta.group_msgs[1]); - ck_assert_msg(last_msg.msg.group_meta.group_msgs[2] == 65282, "incorrect value for last_msg.msg.group_meta.group_msgs[2], expected 65282, is %d", last_msg.msg.group_meta.group_msgs[2]); - - ck_assert_msg(last_msg.msg.group_meta.n_group_msgs == 3, "incorrect value for last_msg.msg.group_meta.n_group_msgs, expected 3, is %d", last_msg.msg.group_meta.n_group_msgs); + ck_assert_msg( + last_msg.msg.group_meta.flags == 2, + "incorrect value for last_msg.msg.group_meta.flags, expected 2, is %d", + last_msg.msg.group_meta.flags); + + ck_assert_msg(last_msg.msg.group_meta.group_id == 1, + "incorrect value for last_msg.msg.group_meta.group_id, " + "expected 1, is %d", + last_msg.msg.group_meta.group_id); + + ck_assert_msg(last_msg.msg.group_meta.group_msgs[0] == 65290, + "incorrect value for last_msg.msg.group_meta.group_msgs[0], " + "expected 65290, is %d", + last_msg.msg.group_meta.group_msgs[0]); + ck_assert_msg(last_msg.msg.group_meta.group_msgs[1] == 522, + "incorrect value for last_msg.msg.group_meta.group_msgs[1], " + "expected 522, is %d", + last_msg.msg.group_meta.group_msgs[1]); + ck_assert_msg(last_msg.msg.group_meta.group_msgs[2] == 65282, + "incorrect value for last_msg.msg.group_meta.group_msgs[2], " + "expected 65282, is %d", + last_msg.msg.group_meta.group_msgs[2]); + + ck_assert_msg(last_msg.msg.group_meta.n_group_msgs == 3, + "incorrect value for last_msg.msg.group_meta.n_group_msgs, " + "expected 3, is %d", + last_msg.msg.group_meta.n_group_msgs); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -158,99 +178,157 @@ START_TEST( test_auto_check_sbp_system_MsgGroupMeta ) logging_reset(); - sbp_callback_register(&sbp_state, 0xFF0A, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xFF0A, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,10,255,21,3,31,1,1,14,2,1,3,1,10,2,17,2,9,2,20,2,14,2,18,2,13,2,21,2,33,2,3,255,6,255,14,255,82,154, }; + u8 encoded_frame[] = { + 85, 10, 255, 21, 3, 31, 1, 1, 14, 2, 1, 3, 1, + 10, 2, 17, 2, 9, 2, 20, 2, 14, 2, 18, 2, 13, + 2, 21, 2, 33, 2, 3, 255, 6, 255, 14, 255, 82, 154, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.group_meta.flags = 1; - + test_msg.group_meta.group_id = 1; - - + test_msg.group_meta.group_msgs[0] = 258; - + test_msg.group_meta.group_msgs[1] = 259; - + test_msg.group_meta.group_msgs[2] = 522; - + test_msg.group_meta.group_msgs[3] = 529; - + test_msg.group_meta.group_msgs[4] = 521; - + test_msg.group_meta.group_msgs[5] = 532; - + test_msg.group_meta.group_msgs[6] = 526; - + test_msg.group_meta.group_msgs[7] = 530; - + test_msg.group_meta.group_msgs[8] = 525; - + test_msg.group_meta.group_msgs[9] = 533; - + test_msg.group_meta.group_msgs[10] = 545; - + test_msg.group_meta.group_msgs[11] = 65283; - + test_msg.group_meta.group_msgs[12] = 65286; - + test_msg.group_meta.group_msgs[13] = 65294; - + test_msg.group_meta.n_group_msgs = 14; sbp_message_send(&sbp_state, SbpMsgGroupMeta, 789, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 789, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgGroupMeta, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgGroupMeta, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.group_meta.flags == 1, "incorrect value for last_msg.msg.group_meta.flags, expected 1, is %d", last_msg.msg.group_meta.flags); - - ck_assert_msg(last_msg.msg.group_meta.group_id == 1, "incorrect value for last_msg.msg.group_meta.group_id, expected 1, is %d", last_msg.msg.group_meta.group_id); - - ck_assert_msg(last_msg.msg.group_meta.group_msgs[0] == 258, "incorrect value for last_msg.msg.group_meta.group_msgs[0], expected 258, is %d", last_msg.msg.group_meta.group_msgs[0]); - ck_assert_msg(last_msg.msg.group_meta.group_msgs[1] == 259, "incorrect value for last_msg.msg.group_meta.group_msgs[1], expected 259, is %d", last_msg.msg.group_meta.group_msgs[1]); - ck_assert_msg(last_msg.msg.group_meta.group_msgs[2] == 522, "incorrect value for last_msg.msg.group_meta.group_msgs[2], expected 522, is %d", last_msg.msg.group_meta.group_msgs[2]); - ck_assert_msg(last_msg.msg.group_meta.group_msgs[3] == 529, "incorrect value for last_msg.msg.group_meta.group_msgs[3], expected 529, is %d", last_msg.msg.group_meta.group_msgs[3]); - ck_assert_msg(last_msg.msg.group_meta.group_msgs[4] == 521, "incorrect value for last_msg.msg.group_meta.group_msgs[4], expected 521, is %d", last_msg.msg.group_meta.group_msgs[4]); - ck_assert_msg(last_msg.msg.group_meta.group_msgs[5] == 532, "incorrect value for last_msg.msg.group_meta.group_msgs[5], expected 532, is %d", last_msg.msg.group_meta.group_msgs[5]); - ck_assert_msg(last_msg.msg.group_meta.group_msgs[6] == 526, "incorrect value for last_msg.msg.group_meta.group_msgs[6], expected 526, is %d", last_msg.msg.group_meta.group_msgs[6]); - ck_assert_msg(last_msg.msg.group_meta.group_msgs[7] == 530, "incorrect value for last_msg.msg.group_meta.group_msgs[7], expected 530, is %d", last_msg.msg.group_meta.group_msgs[7]); - ck_assert_msg(last_msg.msg.group_meta.group_msgs[8] == 525, "incorrect value for last_msg.msg.group_meta.group_msgs[8], expected 525, is %d", last_msg.msg.group_meta.group_msgs[8]); - ck_assert_msg(last_msg.msg.group_meta.group_msgs[9] == 533, "incorrect value for last_msg.msg.group_meta.group_msgs[9], expected 533, is %d", last_msg.msg.group_meta.group_msgs[9]); - ck_assert_msg(last_msg.msg.group_meta.group_msgs[10] == 545, "incorrect value for last_msg.msg.group_meta.group_msgs[10], expected 545, is %d", last_msg.msg.group_meta.group_msgs[10]); - ck_assert_msg(last_msg.msg.group_meta.group_msgs[11] == 65283, "incorrect value for last_msg.msg.group_meta.group_msgs[11], expected 65283, is %d", last_msg.msg.group_meta.group_msgs[11]); - ck_assert_msg(last_msg.msg.group_meta.group_msgs[12] == 65286, "incorrect value for last_msg.msg.group_meta.group_msgs[12], expected 65286, is %d", last_msg.msg.group_meta.group_msgs[12]); - ck_assert_msg(last_msg.msg.group_meta.group_msgs[13] == 65294, "incorrect value for last_msg.msg.group_meta.group_msgs[13], expected 65294, is %d", last_msg.msg.group_meta.group_msgs[13]); - - ck_assert_msg(last_msg.msg.group_meta.n_group_msgs == 14, "incorrect value for last_msg.msg.group_meta.n_group_msgs, expected 14, is %d", last_msg.msg.group_meta.n_group_msgs); + ck_assert_msg( + last_msg.msg.group_meta.flags == 1, + "incorrect value for last_msg.msg.group_meta.flags, expected 1, is %d", + last_msg.msg.group_meta.flags); + + ck_assert_msg(last_msg.msg.group_meta.group_id == 1, + "incorrect value for last_msg.msg.group_meta.group_id, " + "expected 1, is %d", + last_msg.msg.group_meta.group_id); + + ck_assert_msg(last_msg.msg.group_meta.group_msgs[0] == 258, + "incorrect value for last_msg.msg.group_meta.group_msgs[0], " + "expected 258, is %d", + last_msg.msg.group_meta.group_msgs[0]); + ck_assert_msg(last_msg.msg.group_meta.group_msgs[1] == 259, + "incorrect value for last_msg.msg.group_meta.group_msgs[1], " + "expected 259, is %d", + last_msg.msg.group_meta.group_msgs[1]); + ck_assert_msg(last_msg.msg.group_meta.group_msgs[2] == 522, + "incorrect value for last_msg.msg.group_meta.group_msgs[2], " + "expected 522, is %d", + last_msg.msg.group_meta.group_msgs[2]); + ck_assert_msg(last_msg.msg.group_meta.group_msgs[3] == 529, + "incorrect value for last_msg.msg.group_meta.group_msgs[3], " + "expected 529, is %d", + last_msg.msg.group_meta.group_msgs[3]); + ck_assert_msg(last_msg.msg.group_meta.group_msgs[4] == 521, + "incorrect value for last_msg.msg.group_meta.group_msgs[4], " + "expected 521, is %d", + last_msg.msg.group_meta.group_msgs[4]); + ck_assert_msg(last_msg.msg.group_meta.group_msgs[5] == 532, + "incorrect value for last_msg.msg.group_meta.group_msgs[5], " + "expected 532, is %d", + last_msg.msg.group_meta.group_msgs[5]); + ck_assert_msg(last_msg.msg.group_meta.group_msgs[6] == 526, + "incorrect value for last_msg.msg.group_meta.group_msgs[6], " + "expected 526, is %d", + last_msg.msg.group_meta.group_msgs[6]); + ck_assert_msg(last_msg.msg.group_meta.group_msgs[7] == 530, + "incorrect value for last_msg.msg.group_meta.group_msgs[7], " + "expected 530, is %d", + last_msg.msg.group_meta.group_msgs[7]); + ck_assert_msg(last_msg.msg.group_meta.group_msgs[8] == 525, + "incorrect value for last_msg.msg.group_meta.group_msgs[8], " + "expected 525, is %d", + last_msg.msg.group_meta.group_msgs[8]); + ck_assert_msg(last_msg.msg.group_meta.group_msgs[9] == 533, + "incorrect value for last_msg.msg.group_meta.group_msgs[9], " + "expected 533, is %d", + last_msg.msg.group_meta.group_msgs[9]); + ck_assert_msg(last_msg.msg.group_meta.group_msgs[10] == 545, + "incorrect value for last_msg.msg.group_meta.group_msgs[10], " + "expected 545, is %d", + last_msg.msg.group_meta.group_msgs[10]); + ck_assert_msg(last_msg.msg.group_meta.group_msgs[11] == 65283, + "incorrect value for last_msg.msg.group_meta.group_msgs[11], " + "expected 65283, is %d", + last_msg.msg.group_meta.group_msgs[11]); + ck_assert_msg(last_msg.msg.group_meta.group_msgs[12] == 65286, + "incorrect value for last_msg.msg.group_meta.group_msgs[12], " + "expected 65286, is %d", + last_msg.msg.group_meta.group_msgs[12]); + ck_assert_msg(last_msg.msg.group_meta.group_msgs[13] == 65294, + "incorrect value for last_msg.msg.group_meta.group_msgs[13], " + "expected 65294, is %d", + last_msg.msg.group_meta.group_msgs[13]); + + ck_assert_msg(last_msg.msg.group_meta.n_group_msgs == 14, + "incorrect value for last_msg.msg.group_meta.n_group_msgs, " + "expected 14, is %d", + last_msg.msg.group_meta.n_group_msgs); } } END_TEST -Suite* auto_check_sbp_system_MsgGroupMeta_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_system_MsgGroupMeta"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_system_MsgGroupMeta"); +Suite *auto_check_sbp_system_MsgGroupMeta_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_system_MsgGroupMeta"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_system_MsgGroupMeta"); tcase_add_test(tc_acq, test_auto_check_sbp_system_MsgGroupMeta); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_system_MsgHeartbeat.c b/c/test/auto_check_sbp_system_MsgHeartbeat.c index 3a27c547e..73cfe0bf5 100644 --- a/c/test/auto_check_sbp_system_MsgHeartbeat.c +++ b/c/test/auto_check_sbp_system_MsgHeartbeat.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgHeartbeat.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgHeartbeat.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_system_MsgHeartbeat ) -{ +START_TEST(test_auto_check_sbp_system_MsgHeartbeat) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_system_MsgHeartbeat ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,44 +90,54 @@ START_TEST( test_auto_check_sbp_system_MsgHeartbeat ) logging_reset(); - sbp_callback_register(&sbp_state, 0xffff, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xffff, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,255,255,246,215,4,0,50,0,0,249,216, }; + u8 encoded_frame[] = { + 85, 255, 255, 246, 215, 4, 0, 50, 0, 0, 249, 216, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.heartbeat.flags = 12800; - sbp_message_send(&sbp_state, SbpMsgHeartbeat, 55286, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgHeartbeat, 55286, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgHeartbeat, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgHeartbeat, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.heartbeat.flags == 12800, "incorrect value for last_msg.msg.heartbeat.flags, expected 12800, is %d", last_msg.msg.heartbeat.flags); + ck_assert_msg(last_msg.msg.heartbeat.flags == 12800, + "incorrect value for last_msg.msg.heartbeat.flags, expected " + "12800, is %d", + last_msg.msg.heartbeat.flags); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -139,47 +145,57 @@ START_TEST( test_auto_check_sbp_system_MsgHeartbeat ) logging_reset(); - sbp_callback_register(&sbp_state, 0xffff, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xffff, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,255,255,195,4,4,0,0,0,0,66,57, }; + u8 encoded_frame[] = { + 85, 255, 255, 195, 4, 4, 0, 0, 0, 0, 66, 57, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.heartbeat.flags = 0; - sbp_message_send(&sbp_state, SbpMsgHeartbeat, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgHeartbeat, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgHeartbeat, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgHeartbeat, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.heartbeat.flags == 0, "incorrect value for last_msg.msg.heartbeat.flags, expected 0, is %d", last_msg.msg.heartbeat.flags); + ck_assert_msg( + last_msg.msg.heartbeat.flags == 0, + "incorrect value for last_msg.msg.heartbeat.flags, expected 0, is %d", + last_msg.msg.heartbeat.flags); } } END_TEST -Suite* auto_check_sbp_system_MsgHeartbeat_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_system_MsgHeartbeat"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_system_MsgHeartbeat"); +Suite *auto_check_sbp_system_MsgHeartbeat_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_system_MsgHeartbeat"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_system_MsgHeartbeat"); tcase_add_test(tc_acq, test_auto_check_sbp_system_MsgHeartbeat); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_system_MsgInsStatus.c b/c/test/auto_check_sbp_system_MsgInsStatus.c index 880b9d0f7..503d84e18 100644 --- a/c/test/auto_check_sbp_system_MsgInsStatus.c +++ b/c/test/auto_check_sbp_system_MsgInsStatus.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgInsStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgInsStatus.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_system_MsgInsStatus ) -{ +START_TEST(test_auto_check_sbp_system_MsgInsStatus) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_system_MsgInsStatus ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,47 +90,56 @@ START_TEST( test_auto_check_sbp_system_MsgInsStatus ) logging_reset(); - sbp_callback_register(&sbp_state, 0xff03, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xff03, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,255,21,3,4,9,0,0,32,36,103, }; + u8 encoded_frame[] = { + 85, 3, 255, 21, 3, 4, 9, 0, 0, 32, 36, 103, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ins_status.flags = 536870921; sbp_message_send(&sbp_state, SbpMsgInsStatus, 789, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 789, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgInsStatus, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgInsStatus, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ins_status.flags == 536870921, "incorrect value for last_msg.msg.ins_status.flags, expected 536870921, is %d", last_msg.msg.ins_status.flags); + ck_assert_msg(last_msg.msg.ins_status.flags == 536870921, + "incorrect value for last_msg.msg.ins_status.flags, expected " + "536870921, is %d", + last_msg.msg.ins_status.flags); } } END_TEST -Suite* auto_check_sbp_system_MsgInsStatus_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_system_MsgInsStatus"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_system_MsgInsStatus"); +Suite *auto_check_sbp_system_MsgInsStatus_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_system_MsgInsStatus"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_system_MsgInsStatus"); tcase_add_test(tc_acq, test_auto_check_sbp_system_MsgInsStatus); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_system_MsgInsUpdates.c b/c/test/auto_check_sbp_system_MsgInsUpdates.c index 73aa707ea..7eb69d011 100644 --- a/c/test/auto_check_sbp_system_MsgInsUpdates.c +++ b/c/test/auto_check_sbp_system_MsgInsUpdates.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgInsUpdates.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgInsUpdates.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_system_MsgInsUpdates ) -{ +START_TEST(test_auto_check_sbp_system_MsgInsUpdates) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_system_MsgInsUpdates ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,71 +90,99 @@ START_TEST( test_auto_check_sbp_system_MsgInsUpdates ) logging_reset(); - sbp_callback_register(&sbp_state, 0xff06, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xff06, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,6,255,21,3,10,84,229,17,30,0,0,0,0,0,0,81,63, }; + u8 encoded_frame[] = { + 85, 6, 255, 21, 3, 10, 84, 229, 17, 30, 0, 0, 0, 0, 0, 0, 81, 63, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.ins_updates.gnsspos = 0; - + test_msg.ins_updates.gnssvel = 0; - + test_msg.ins_updates.nhc = 0; - + test_msg.ins_updates.speed = 0; - + test_msg.ins_updates.tow = 504489300; - + test_msg.ins_updates.wheelticks = 0; - + test_msg.ins_updates.zerovel = 0; - sbp_message_send(&sbp_state, SbpMsgInsUpdates, 789, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgInsUpdates, 789, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 789, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgInsUpdates, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgInsUpdates, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.ins_updates.gnsspos == 0, "incorrect value for last_msg.msg.ins_updates.gnsspos, expected 0, is %d", last_msg.msg.ins_updates.gnsspos); - - ck_assert_msg(last_msg.msg.ins_updates.gnssvel == 0, "incorrect value for last_msg.msg.ins_updates.gnssvel, expected 0, is %d", last_msg.msg.ins_updates.gnssvel); - - ck_assert_msg(last_msg.msg.ins_updates.nhc == 0, "incorrect value for last_msg.msg.ins_updates.nhc, expected 0, is %d", last_msg.msg.ins_updates.nhc); - - ck_assert_msg(last_msg.msg.ins_updates.speed == 0, "incorrect value for last_msg.msg.ins_updates.speed, expected 0, is %d", last_msg.msg.ins_updates.speed); - - ck_assert_msg(last_msg.msg.ins_updates.tow == 504489300, "incorrect value for last_msg.msg.ins_updates.tow, expected 504489300, is %d", last_msg.msg.ins_updates.tow); - - ck_assert_msg(last_msg.msg.ins_updates.wheelticks == 0, "incorrect value for last_msg.msg.ins_updates.wheelticks, expected 0, is %d", last_msg.msg.ins_updates.wheelticks); - - ck_assert_msg(last_msg.msg.ins_updates.zerovel == 0, "incorrect value for last_msg.msg.ins_updates.zerovel, expected 0, is %d", last_msg.msg.ins_updates.zerovel); + ck_assert_msg(last_msg.msg.ins_updates.gnsspos == 0, + "incorrect value for last_msg.msg.ins_updates.gnsspos, " + "expected 0, is %d", + last_msg.msg.ins_updates.gnsspos); + + ck_assert_msg(last_msg.msg.ins_updates.gnssvel == 0, + "incorrect value for last_msg.msg.ins_updates.gnssvel, " + "expected 0, is %d", + last_msg.msg.ins_updates.gnssvel); + + ck_assert_msg( + last_msg.msg.ins_updates.nhc == 0, + "incorrect value for last_msg.msg.ins_updates.nhc, expected 0, is %d", + last_msg.msg.ins_updates.nhc); + + ck_assert_msg( + last_msg.msg.ins_updates.speed == 0, + "incorrect value for last_msg.msg.ins_updates.speed, expected 0, is %d", + last_msg.msg.ins_updates.speed); + + ck_assert_msg(last_msg.msg.ins_updates.tow == 504489300, + "incorrect value for last_msg.msg.ins_updates.tow, expected " + "504489300, is %d", + last_msg.msg.ins_updates.tow); + + ck_assert_msg(last_msg.msg.ins_updates.wheelticks == 0, + "incorrect value for last_msg.msg.ins_updates.wheelticks, " + "expected 0, is %d", + last_msg.msg.ins_updates.wheelticks); + + ck_assert_msg(last_msg.msg.ins_updates.zerovel == 0, + "incorrect value for last_msg.msg.ins_updates.zerovel, " + "expected 0, is %d", + last_msg.msg.ins_updates.zerovel); } } END_TEST -Suite* auto_check_sbp_system_MsgInsUpdates_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_system_MsgInsUpdates"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_system_MsgInsUpdates"); +Suite *auto_check_sbp_system_MsgInsUpdates_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_system_MsgInsUpdates"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_system_MsgInsUpdates"); tcase_add_test(tc_acq, test_auto_check_sbp_system_MsgInsUpdates); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_system_MsgPpsTime.c b/c/test/auto_check_sbp_system_MsgPpsTime.c index 36be6cdfe..cd08a46a2 100644 --- a/c/test/auto_check_sbp_system_MsgPpsTime.c +++ b/c/test/auto_check_sbp_system_MsgPpsTime.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgPpsTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgPpsTime.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_system_MsgPpsTime ) -{ +START_TEST(test_auto_check_sbp_system_MsgPpsTime) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_system_MsgPpsTime ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,51 +90,63 @@ START_TEST( test_auto_check_sbp_system_MsgPpsTime ) logging_reset(); - sbp_callback_register(&sbp_state, 0xff08, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xff08, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,8,255,222,209,9,140,146,133,197,160,0,0,0,255,125,149, }; + u8 encoded_frame[] = { + 85, 8, 255, 222, 209, 9, 140, 146, 133, + 197, 160, 0, 0, 0, 255, 125, 149, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.pps_time.flags = 255; - + test_msg.pps_time.time = 690508632716; sbp_message_send(&sbp_state, SbpMsgPpsTime, 53726, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 53726, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgPpsTime, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.pps_time.flags == 255, "incorrect value for last_msg.msg.pps_time.flags, expected 255, is %d", last_msg.msg.pps_time.flags); - - ck_assert_msg(last_msg.msg.pps_time.time == 690508632716, "incorrect value for last_msg.msg.pps_time.time, expected 690508632716, is %d", last_msg.msg.pps_time.time); + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.pps_time.flags == 255, + "incorrect value for last_msg.msg.pps_time.flags, expected 255, is %d", + last_msg.msg.pps_time.flags); + ck_assert_msg(last_msg.msg.pps_time.time == 690508632716, + "incorrect value for last_msg.msg.pps_time.time, expected " + "690508632716, is %d", + last_msg.msg.pps_time.time); } } END_TEST -Suite* auto_check_sbp_system_MsgPpsTime_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_system_MsgPpsTime"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_system_MsgPpsTime"); +Suite *auto_check_sbp_system_MsgPpsTime_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_system_MsgPpsTime"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_system_MsgPpsTime"); tcase_add_test(tc_acq, test_auto_check_sbp_system_MsgPpsTime); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_system_MsgSensorAidEvent.c b/c/test/auto_check_sbp_system_MsgSensorAidEvent.c index fcbc9c4cb..ecc0e7bad 100644 --- a/c/test/auto_check_sbp_system_MsgSensorAidEvent.c +++ b/c/test/auto_check_sbp_system_MsgSensorAidEvent.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgSensorAidEvent.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgSensorAidEvent.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_system_MsgSensorAidEvent ) -{ +START_TEST(test_auto_check_sbp_system_MsgSensorAidEvent) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_system_MsgSensorAidEvent ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,75 +90,112 @@ START_TEST( test_auto_check_sbp_system_MsgSensorAidEvent ) logging_reset(); - sbp_callback_register(&sbp_state, 0xFF09, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xFF09, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,9,255,211,136,15,48,246,122,19,0,0,0,0,0,0,0,0,0,0,0,33,236, }; + u8 encoded_frame[] = { + 85, 9, 255, 211, 136, 15, 48, 246, 122, 19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 236, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.sensor_aid_event.flags = 0; - + test_msg.sensor_aid_event.n_accepted_meas = 0; - + test_msg.sensor_aid_event.n_attempted_meas = 0; - + test_msg.sensor_aid_event.n_available_meas = 0; - + test_msg.sensor_aid_event.sensor_id = 0; - + test_msg.sensor_aid_event.sensor_state = 0; - + test_msg.sensor_aid_event.sensor_type = 0; - + test_msg.sensor_aid_event.time = 326825520; - sbp_message_send(&sbp_state, SbpMsgSensorAidEvent, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgSensorAidEvent, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgSensorAidEvent, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgSensorAidEvent, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.sensor_aid_event.flags == 0, "incorrect value for last_msg.msg.sensor_aid_event.flags, expected 0, is %d", last_msg.msg.sensor_aid_event.flags); - - ck_assert_msg(last_msg.msg.sensor_aid_event.n_accepted_meas == 0, "incorrect value for last_msg.msg.sensor_aid_event.n_accepted_meas, expected 0, is %d", last_msg.msg.sensor_aid_event.n_accepted_meas); - - ck_assert_msg(last_msg.msg.sensor_aid_event.n_attempted_meas == 0, "incorrect value for last_msg.msg.sensor_aid_event.n_attempted_meas, expected 0, is %d", last_msg.msg.sensor_aid_event.n_attempted_meas); - - ck_assert_msg(last_msg.msg.sensor_aid_event.n_available_meas == 0, "incorrect value for last_msg.msg.sensor_aid_event.n_available_meas, expected 0, is %d", last_msg.msg.sensor_aid_event.n_available_meas); - - ck_assert_msg(last_msg.msg.sensor_aid_event.sensor_id == 0, "incorrect value for last_msg.msg.sensor_aid_event.sensor_id, expected 0, is %d", last_msg.msg.sensor_aid_event.sensor_id); - - ck_assert_msg(last_msg.msg.sensor_aid_event.sensor_state == 0, "incorrect value for last_msg.msg.sensor_aid_event.sensor_state, expected 0, is %d", last_msg.msg.sensor_aid_event.sensor_state); - - ck_assert_msg(last_msg.msg.sensor_aid_event.sensor_type == 0, "incorrect value for last_msg.msg.sensor_aid_event.sensor_type, expected 0, is %d", last_msg.msg.sensor_aid_event.sensor_type); - - ck_assert_msg(last_msg.msg.sensor_aid_event.time == 326825520, "incorrect value for last_msg.msg.sensor_aid_event.time, expected 326825520, is %d", last_msg.msg.sensor_aid_event.time); + ck_assert_msg(last_msg.msg.sensor_aid_event.flags == 0, + "incorrect value for last_msg.msg.sensor_aid_event.flags, " + "expected 0, is %d", + last_msg.msg.sensor_aid_event.flags); + + ck_assert_msg( + last_msg.msg.sensor_aid_event.n_accepted_meas == 0, + "incorrect value for last_msg.msg.sensor_aid_event.n_accepted_meas, " + "expected 0, is %d", + last_msg.msg.sensor_aid_event.n_accepted_meas); + + ck_assert_msg( + last_msg.msg.sensor_aid_event.n_attempted_meas == 0, + "incorrect value for last_msg.msg.sensor_aid_event.n_attempted_meas, " + "expected 0, is %d", + last_msg.msg.sensor_aid_event.n_attempted_meas); + + ck_assert_msg( + last_msg.msg.sensor_aid_event.n_available_meas == 0, + "incorrect value for last_msg.msg.sensor_aid_event.n_available_meas, " + "expected 0, is %d", + last_msg.msg.sensor_aid_event.n_available_meas); + + ck_assert_msg(last_msg.msg.sensor_aid_event.sensor_id == 0, + "incorrect value for " + "last_msg.msg.sensor_aid_event.sensor_id, expected 0, is %d", + last_msg.msg.sensor_aid_event.sensor_id); + + ck_assert_msg( + last_msg.msg.sensor_aid_event.sensor_state == 0, + "incorrect value for last_msg.msg.sensor_aid_event.sensor_state, " + "expected 0, is %d", + last_msg.msg.sensor_aid_event.sensor_state); + + ck_assert_msg( + last_msg.msg.sensor_aid_event.sensor_type == 0, + "incorrect value for last_msg.msg.sensor_aid_event.sensor_type, " + "expected 0, is %d", + last_msg.msg.sensor_aid_event.sensor_type); + + ck_assert_msg(last_msg.msg.sensor_aid_event.time == 326825520, + "incorrect value for last_msg.msg.sensor_aid_event.time, " + "expected 326825520, is %d", + last_msg.msg.sensor_aid_event.time); } } END_TEST -Suite* auto_check_sbp_system_MsgSensorAidEvent_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_system_MsgSensorAidEvent"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_system_MsgSensorAidEvent"); +Suite *auto_check_sbp_system_MsgSensorAidEvent_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_system_MsgSensorAidEvent"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_system_MsgSensorAidEvent"); tcase_add_test(tc_acq, test_auto_check_sbp_system_MsgSensorAidEvent); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_system_MsgStartup.c b/c/test/auto_check_sbp_system_MsgStartup.c index 85ab733ce..173c595bb 100644 --- a/c/test/auto_check_sbp_system_MsgStartup.c +++ b/c/test/auto_check_sbp_system_MsgStartup.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgStartup.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgStartup.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_system_MsgStartup ) -{ +START_TEST(test_auto_check_sbp_system_MsgStartup) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_system_MsgStartup ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,52 +90,66 @@ START_TEST( test_auto_check_sbp_system_MsgStartup ) logging_reset(); - sbp_callback_register(&sbp_state, 0xff00, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xff00, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,255,66,0,4,0,0,0,0,70,160, }; + u8 encoded_frame[] = { + 85, 0, 255, 66, 0, 4, 0, 0, 0, 0, 70, 160, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.startup.cause = 0; - + test_msg.startup.reserved = 0; - + test_msg.startup.startup_type = 0; sbp_message_send(&sbp_state, SbpMsgStartup, 66, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgStartup, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.startup.cause == 0, "incorrect value for last_msg.msg.startup.cause, expected 0, is %d", last_msg.msg.startup.cause); - - ck_assert_msg(last_msg.msg.startup.reserved == 0, "incorrect value for last_msg.msg.startup.reserved, expected 0, is %d", last_msg.msg.startup.reserved); - - ck_assert_msg(last_msg.msg.startup.startup_type == 0, "incorrect value for last_msg.msg.startup.startup_type, expected 0, is %d", last_msg.msg.startup.startup_type); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.startup.cause == 0, + "incorrect value for last_msg.msg.startup.cause, expected 0, is %d", + last_msg.msg.startup.cause); + + ck_assert_msg( + last_msg.msg.startup.reserved == 0, + "incorrect value for last_msg.msg.startup.reserved, expected 0, is %d", + last_msg.msg.startup.reserved); + + ck_assert_msg(last_msg.msg.startup.startup_type == 0, + "incorrect value for last_msg.msg.startup.startup_type, " + "expected 0, is %d", + last_msg.msg.startup.startup_type); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -147,55 +157,69 @@ START_TEST( test_auto_check_sbp_system_MsgStartup ) logging_reset(); - sbp_callback_register(&sbp_state, 0xff00, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xff00, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,255,195,4,4,0,0,0,0,127,181, }; + u8 encoded_frame[] = { + 85, 0, 255, 195, 4, 4, 0, 0, 0, 0, 127, 181, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.startup.cause = 0; - + test_msg.startup.reserved = 0; - + test_msg.startup.startup_type = 0; sbp_message_send(&sbp_state, SbpMsgStartup, 1219, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgStartup, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.startup.cause == 0, "incorrect value for last_msg.msg.startup.cause, expected 0, is %d", last_msg.msg.startup.cause); - - ck_assert_msg(last_msg.msg.startup.reserved == 0, "incorrect value for last_msg.msg.startup.reserved, expected 0, is %d", last_msg.msg.startup.reserved); - - ck_assert_msg(last_msg.msg.startup.startup_type == 0, "incorrect value for last_msg.msg.startup.startup_type, expected 0, is %d", last_msg.msg.startup.startup_type); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.startup.cause == 0, + "incorrect value for last_msg.msg.startup.cause, expected 0, is %d", + last_msg.msg.startup.cause); + + ck_assert_msg( + last_msg.msg.startup.reserved == 0, + "incorrect value for last_msg.msg.startup.reserved, expected 0, is %d", + last_msg.msg.startup.reserved); + + ck_assert_msg(last_msg.msg.startup.startup_type == 0, + "incorrect value for last_msg.msg.startup.startup_type, " + "expected 0, is %d", + last_msg.msg.startup.startup_type); } } END_TEST -Suite* auto_check_sbp_system_MsgStartup_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_system_MsgStartup"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_system_MsgStartup"); +Suite *auto_check_sbp_system_MsgStartup_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_system_MsgStartup"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_system_MsgStartup"); tcase_add_test(tc_acq, test_auto_check_sbp_system_MsgStartup); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_system_MsgStatusJournal.c b/c/test/auto_check_sbp_system_MsgStatusJournal.c index cb7422925..92cc6a305 100644 --- a/c/test/auto_check_sbp_system_MsgStatusJournal.c +++ b/c/test/auto_check_sbp_system_MsgStatusJournal.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusJournal.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusJournal.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_system_MsgStatusJournal ) -{ +START_TEST(test_auto_check_sbp_system_MsgStatusJournal) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_system_MsgStatusJournal ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,119 +90,184 @@ START_TEST( test_auto_check_sbp_system_MsgStatusJournal ) logging_reset(); - sbp_callback_register(&sbp_state, 0xFFFD, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xFFFD, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,253,255,211,136,33,1,0,1,4,100,0,0,0,16,146,16,0,0,6,0,1,13,186,19,0,0,6,0,1,14,184,34,0,0,6,0,1,15,113,119, }; + u8 encoded_frame[] = { + 85, 253, 255, 211, 136, 33, 1, 0, 1, 4, 100, 0, 0, 0, + 16, 146, 16, 0, 0, 6, 0, 1, 13, 186, 19, 0, 0, 6, + 0, 1, 14, 184, 34, 0, 0, 6, 0, 1, 15, 113, 119, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - - + test_msg.status_journal.journal[0].report.component = 6; - + test_msg.status_journal.journal[0].report.generic = 1; - + test_msg.status_journal.journal[0].report.specific = 13; - + test_msg.status_journal.journal[0].uptime = 4242; - - - + test_msg.status_journal.journal[1].report.component = 6; - + test_msg.status_journal.journal[1].report.generic = 1; - + test_msg.status_journal.journal[1].report.specific = 14; - + test_msg.status_journal.journal[1].uptime = 5050; - - - + test_msg.status_journal.journal[2].report.component = 6; - + test_msg.status_journal.journal[2].report.generic = 1; - + test_msg.status_journal.journal[2].report.specific = 15; - + test_msg.status_journal.journal[2].uptime = 8888; - + test_msg.status_journal.n_journal = 3; - + test_msg.status_journal.reporting_system = 1; - + test_msg.status_journal.sbp_version = 1025; - + test_msg.status_journal.sequence_descriptor = 16; - + test_msg.status_journal.total_status_reports = 100; - sbp_message_send(&sbp_state, SbpMsgStatusJournal, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgStatusJournal, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgStatusJournal, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgStatusJournal, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - - ck_assert_msg(last_msg.msg.status_journal.journal[0].report.component == 6, "incorrect value for last_msg.msg.status_journal.journal[0].report.component, expected 6, is %d", last_msg.msg.status_journal.journal[0].report.component); - - ck_assert_msg(last_msg.msg.status_journal.journal[0].report.generic == 1, "incorrect value for last_msg.msg.status_journal.journal[0].report.generic, expected 1, is %d", last_msg.msg.status_journal.journal[0].report.generic); - - ck_assert_msg(last_msg.msg.status_journal.journal[0].report.specific == 13, "incorrect value for last_msg.msg.status_journal.journal[0].report.specific, expected 13, is %d", last_msg.msg.status_journal.journal[0].report.specific); - - ck_assert_msg(last_msg.msg.status_journal.journal[0].uptime == 4242, "incorrect value for last_msg.msg.status_journal.journal[0].uptime, expected 4242, is %d", last_msg.msg.status_journal.journal[0].uptime); - - - ck_assert_msg(last_msg.msg.status_journal.journal[1].report.component == 6, "incorrect value for last_msg.msg.status_journal.journal[1].report.component, expected 6, is %d", last_msg.msg.status_journal.journal[1].report.component); - - ck_assert_msg(last_msg.msg.status_journal.journal[1].report.generic == 1, "incorrect value for last_msg.msg.status_journal.journal[1].report.generic, expected 1, is %d", last_msg.msg.status_journal.journal[1].report.generic); - - ck_assert_msg(last_msg.msg.status_journal.journal[1].report.specific == 14, "incorrect value for last_msg.msg.status_journal.journal[1].report.specific, expected 14, is %d", last_msg.msg.status_journal.journal[1].report.specific); - - ck_assert_msg(last_msg.msg.status_journal.journal[1].uptime == 5050, "incorrect value for last_msg.msg.status_journal.journal[1].uptime, expected 5050, is %d", last_msg.msg.status_journal.journal[1].uptime); - - - ck_assert_msg(last_msg.msg.status_journal.journal[2].report.component == 6, "incorrect value for last_msg.msg.status_journal.journal[2].report.component, expected 6, is %d", last_msg.msg.status_journal.journal[2].report.component); - - ck_assert_msg(last_msg.msg.status_journal.journal[2].report.generic == 1, "incorrect value for last_msg.msg.status_journal.journal[2].report.generic, expected 1, is %d", last_msg.msg.status_journal.journal[2].report.generic); - - ck_assert_msg(last_msg.msg.status_journal.journal[2].report.specific == 15, "incorrect value for last_msg.msg.status_journal.journal[2].report.specific, expected 15, is %d", last_msg.msg.status_journal.journal[2].report.specific); - - ck_assert_msg(last_msg.msg.status_journal.journal[2].uptime == 8888, "incorrect value for last_msg.msg.status_journal.journal[2].uptime, expected 8888, is %d", last_msg.msg.status_journal.journal[2].uptime); - - ck_assert_msg(last_msg.msg.status_journal.n_journal == 3, "incorrect value for last_msg.msg.status_journal.n_journal, expected 3, is %d", last_msg.msg.status_journal.n_journal); - - ck_assert_msg(last_msg.msg.status_journal.reporting_system == 1, "incorrect value for last_msg.msg.status_journal.reporting_system, expected 1, is %d", last_msg.msg.status_journal.reporting_system); - - ck_assert_msg(last_msg.msg.status_journal.sbp_version == 1025, "incorrect value for last_msg.msg.status_journal.sbp_version, expected 1025, is %d", last_msg.msg.status_journal.sbp_version); - - ck_assert_msg(last_msg.msg.status_journal.sequence_descriptor == 16, "incorrect value for last_msg.msg.status_journal.sequence_descriptor, expected 16, is %d", last_msg.msg.status_journal.sequence_descriptor); - - ck_assert_msg(last_msg.msg.status_journal.total_status_reports == 100, "incorrect value for last_msg.msg.status_journal.total_status_reports, expected 100, is %d", last_msg.msg.status_journal.total_status_reports); + ck_assert_msg(last_msg.msg.status_journal.journal[0].report.component == 6, + "incorrect value for " + "last_msg.msg.status_journal.journal[0].report.component, " + "expected 6, is %d", + last_msg.msg.status_journal.journal[0].report.component); + + ck_assert_msg(last_msg.msg.status_journal.journal[0].report.generic == 1, + "incorrect value for " + "last_msg.msg.status_journal.journal[0].report.generic, " + "expected 1, is %d", + last_msg.msg.status_journal.journal[0].report.generic); + + ck_assert_msg(last_msg.msg.status_journal.journal[0].report.specific == 13, + "incorrect value for " + "last_msg.msg.status_journal.journal[0].report.specific, " + "expected 13, is %d", + last_msg.msg.status_journal.journal[0].report.specific); + + ck_assert_msg( + last_msg.msg.status_journal.journal[0].uptime == 4242, + "incorrect value for last_msg.msg.status_journal.journal[0].uptime, " + "expected 4242, is %d", + last_msg.msg.status_journal.journal[0].uptime); + + ck_assert_msg(last_msg.msg.status_journal.journal[1].report.component == 6, + "incorrect value for " + "last_msg.msg.status_journal.journal[1].report.component, " + "expected 6, is %d", + last_msg.msg.status_journal.journal[1].report.component); + + ck_assert_msg(last_msg.msg.status_journal.journal[1].report.generic == 1, + "incorrect value for " + "last_msg.msg.status_journal.journal[1].report.generic, " + "expected 1, is %d", + last_msg.msg.status_journal.journal[1].report.generic); + + ck_assert_msg(last_msg.msg.status_journal.journal[1].report.specific == 14, + "incorrect value for " + "last_msg.msg.status_journal.journal[1].report.specific, " + "expected 14, is %d", + last_msg.msg.status_journal.journal[1].report.specific); + + ck_assert_msg( + last_msg.msg.status_journal.journal[1].uptime == 5050, + "incorrect value for last_msg.msg.status_journal.journal[1].uptime, " + "expected 5050, is %d", + last_msg.msg.status_journal.journal[1].uptime); + + ck_assert_msg(last_msg.msg.status_journal.journal[2].report.component == 6, + "incorrect value for " + "last_msg.msg.status_journal.journal[2].report.component, " + "expected 6, is %d", + last_msg.msg.status_journal.journal[2].report.component); + + ck_assert_msg(last_msg.msg.status_journal.journal[2].report.generic == 1, + "incorrect value for " + "last_msg.msg.status_journal.journal[2].report.generic, " + "expected 1, is %d", + last_msg.msg.status_journal.journal[2].report.generic); + + ck_assert_msg(last_msg.msg.status_journal.journal[2].report.specific == 15, + "incorrect value for " + "last_msg.msg.status_journal.journal[2].report.specific, " + "expected 15, is %d", + last_msg.msg.status_journal.journal[2].report.specific); + + ck_assert_msg( + last_msg.msg.status_journal.journal[2].uptime == 8888, + "incorrect value for last_msg.msg.status_journal.journal[2].uptime, " + "expected 8888, is %d", + last_msg.msg.status_journal.journal[2].uptime); + + ck_assert_msg(last_msg.msg.status_journal.n_journal == 3, + "incorrect value for last_msg.msg.status_journal.n_journal, " + "expected 3, is %d", + last_msg.msg.status_journal.n_journal); + + ck_assert_msg( + last_msg.msg.status_journal.reporting_system == 1, + "incorrect value for last_msg.msg.status_journal.reporting_system, " + "expected 1, is %d", + last_msg.msg.status_journal.reporting_system); + + ck_assert_msg( + last_msg.msg.status_journal.sbp_version == 1025, + "incorrect value for last_msg.msg.status_journal.sbp_version, expected " + "1025, is %d", + last_msg.msg.status_journal.sbp_version); + + ck_assert_msg( + last_msg.msg.status_journal.sequence_descriptor == 16, + "incorrect value for last_msg.msg.status_journal.sequence_descriptor, " + "expected 16, is %d", + last_msg.msg.status_journal.sequence_descriptor); + + ck_assert_msg( + last_msg.msg.status_journal.total_status_reports == 100, + "incorrect value for last_msg.msg.status_journal.total_status_reports, " + "expected 100, is %d", + last_msg.msg.status_journal.total_status_reports); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -214,84 +275,122 @@ START_TEST( test_auto_check_sbp_system_MsgStatusJournal ) logging_reset(); - sbp_callback_register(&sbp_state, 0xFFFD, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xFFFD, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,253,255,211,136,17,1,0,1,4,100,0,0,0,16,146,16,0,0,6,0,1,13,144,121, }; + u8 encoded_frame[] = { + 85, 253, 255, 211, 136, 17, 1, 0, 1, 4, 100, 0, 0, + 0, 16, 146, 16, 0, 0, 6, 0, 1, 13, 144, 121, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - - - + test_msg.status_journal.journal[0].report.component = 6; - + test_msg.status_journal.journal[0].report.generic = 1; - + test_msg.status_journal.journal[0].report.specific = 13; - + test_msg.status_journal.journal[0].uptime = 4242; - + test_msg.status_journal.n_journal = 1; - + test_msg.status_journal.reporting_system = 1; - + test_msg.status_journal.sbp_version = 1025; - + test_msg.status_journal.sequence_descriptor = 16; - + test_msg.status_journal.total_status_reports = 100; - sbp_message_send(&sbp_state, SbpMsgStatusJournal, 35027, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgStatusJournal, 35027, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgStatusJournal, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgStatusJournal, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - - - ck_assert_msg(last_msg.msg.status_journal.journal[0].report.component == 6, "incorrect value for last_msg.msg.status_journal.journal[0].report.component, expected 6, is %d", last_msg.msg.status_journal.journal[0].report.component); - - ck_assert_msg(last_msg.msg.status_journal.journal[0].report.generic == 1, "incorrect value for last_msg.msg.status_journal.journal[0].report.generic, expected 1, is %d", last_msg.msg.status_journal.journal[0].report.generic); - - ck_assert_msg(last_msg.msg.status_journal.journal[0].report.specific == 13, "incorrect value for last_msg.msg.status_journal.journal[0].report.specific, expected 13, is %d", last_msg.msg.status_journal.journal[0].report.specific); - - ck_assert_msg(last_msg.msg.status_journal.journal[0].uptime == 4242, "incorrect value for last_msg.msg.status_journal.journal[0].uptime, expected 4242, is %d", last_msg.msg.status_journal.journal[0].uptime); - - ck_assert_msg(last_msg.msg.status_journal.n_journal == 1, "incorrect value for last_msg.msg.status_journal.n_journal, expected 1, is %d", last_msg.msg.status_journal.n_journal); - - ck_assert_msg(last_msg.msg.status_journal.reporting_system == 1, "incorrect value for last_msg.msg.status_journal.reporting_system, expected 1, is %d", last_msg.msg.status_journal.reporting_system); - - ck_assert_msg(last_msg.msg.status_journal.sbp_version == 1025, "incorrect value for last_msg.msg.status_journal.sbp_version, expected 1025, is %d", last_msg.msg.status_journal.sbp_version); - - ck_assert_msg(last_msg.msg.status_journal.sequence_descriptor == 16, "incorrect value for last_msg.msg.status_journal.sequence_descriptor, expected 16, is %d", last_msg.msg.status_journal.sequence_descriptor); - - ck_assert_msg(last_msg.msg.status_journal.total_status_reports == 100, "incorrect value for last_msg.msg.status_journal.total_status_reports, expected 100, is %d", last_msg.msg.status_journal.total_status_reports); + ck_assert_msg(last_msg.msg.status_journal.journal[0].report.component == 6, + "incorrect value for " + "last_msg.msg.status_journal.journal[0].report.component, " + "expected 6, is %d", + last_msg.msg.status_journal.journal[0].report.component); + + ck_assert_msg(last_msg.msg.status_journal.journal[0].report.generic == 1, + "incorrect value for " + "last_msg.msg.status_journal.journal[0].report.generic, " + "expected 1, is %d", + last_msg.msg.status_journal.journal[0].report.generic); + + ck_assert_msg(last_msg.msg.status_journal.journal[0].report.specific == 13, + "incorrect value for " + "last_msg.msg.status_journal.journal[0].report.specific, " + "expected 13, is %d", + last_msg.msg.status_journal.journal[0].report.specific); + + ck_assert_msg( + last_msg.msg.status_journal.journal[0].uptime == 4242, + "incorrect value for last_msg.msg.status_journal.journal[0].uptime, " + "expected 4242, is %d", + last_msg.msg.status_journal.journal[0].uptime); + + ck_assert_msg(last_msg.msg.status_journal.n_journal == 1, + "incorrect value for last_msg.msg.status_journal.n_journal, " + "expected 1, is %d", + last_msg.msg.status_journal.n_journal); + + ck_assert_msg( + last_msg.msg.status_journal.reporting_system == 1, + "incorrect value for last_msg.msg.status_journal.reporting_system, " + "expected 1, is %d", + last_msg.msg.status_journal.reporting_system); + + ck_assert_msg( + last_msg.msg.status_journal.sbp_version == 1025, + "incorrect value for last_msg.msg.status_journal.sbp_version, expected " + "1025, is %d", + last_msg.msg.status_journal.sbp_version); + + ck_assert_msg( + last_msg.msg.status_journal.sequence_descriptor == 16, + "incorrect value for last_msg.msg.status_journal.sequence_descriptor, " + "expected 16, is %d", + last_msg.msg.status_journal.sequence_descriptor); + + ck_assert_msg( + last_msg.msg.status_journal.total_status_reports == 100, + "incorrect value for last_msg.msg.status_journal.total_status_reports, " + "expected 100, is %d", + last_msg.msg.status_journal.total_status_reports); } } END_TEST -Suite* auto_check_sbp_system_MsgStatusJournal_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_system_MsgStatusJournal"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_system_MsgStatusJournal"); +Suite *auto_check_sbp_system_MsgStatusJournal_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_system_MsgStatusJournal"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_system_MsgStatusJournal"); tcase_add_test(tc_acq, test_auto_check_sbp_system_MsgStatusJournal); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_system_MsgStatusReport.c b/c/test/auto_check_sbp_system_MsgStatusReport.c index 7068ce9b7..e0dfae861 100644 --- a/c/test/auto_check_sbp_system_MsgStatusReport.c +++ b/c/test/auto_check_sbp_system_MsgStatusReport.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusReport.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusReport.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_system_MsgStatusReport ) -{ +START_TEST(test_auto_check_sbp_system_MsgStatusReport) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_system_MsgStatusReport ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,845 +90,1544 @@ START_TEST( test_auto_check_sbp_system_MsgStatusReport ) logging_reset(); - sbp_callback_register(&sbp_state, 0xfffe, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0xfffe, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,254,255,6,84,252,82,253,177,95,3,60,143,90,233,21,208,98,247,203,221,198,156,207,217,238,162,136,154,11,114,236,134,235,12,133,9,30,175,145,26,114,215,20,146,249,54,54,133,193,106,186,210,183,0,129,5,248,225,149,135,127,2,26,88,92,10,103,73,3,103,68,76,184,33,206,194,163,123,30,151,176,149,172,184,231,118,230,200,168,100,109,10,233,4,60,247,82,215,166,28,138,110,45,98,218,244,179,126,107,92,124,94,157,42,187,124,6,97,247,160,188,110,120,254,214,110,51,240,164,147,18,74,178,67,4,27,73,190,64,179,146,125,153,192,46,202,66,248,46,40,161,173,242,214,3,11,1,118,70,162,61,178,27,156,40,191,113,230,200,72,8,215,245,78,59,222,250,115,32,33,30,211,170,145,92,157,75,24,169,6,55,62,8,107,82,140,49,179,122,90,71,28,88,103,51,177,72,93,39,148,11,202,42,34,92,204,102,29,98,249,91,134,95,23,248,192,20,83,195,95,180,54,36,186,75,64,20,157,133,12,149,28,14,185,129,101,239,74,248,245,30,228,88,142,212,53,224,158,166, }; + u8 encoded_frame[] = { + 85, 254, 255, 6, 84, 252, 82, 253, 177, 95, 3, 60, 143, 90, + 233, 21, 208, 98, 247, 203, 221, 198, 156, 207, 217, 238, 162, 136, + 154, 11, 114, 236, 134, 235, 12, 133, 9, 30, 175, 145, 26, 114, + 215, 20, 146, 249, 54, 54, 133, 193, 106, 186, 210, 183, 0, 129, + 5, 248, 225, 149, 135, 127, 2, 26, 88, 92, 10, 103, 73, 3, + 103, 68, 76, 184, 33, 206, 194, 163, 123, 30, 151, 176, 149, 172, + 184, 231, 118, 230, 200, 168, 100, 109, 10, 233, 4, 60, 247, 82, + 215, 166, 28, 138, 110, 45, 98, 218, 244, 179, 126, 107, 92, 124, + 94, 157, 42, 187, 124, 6, 97, 247, 160, 188, 110, 120, 254, 214, + 110, 51, 240, 164, 147, 18, 74, 178, 67, 4, 27, 73, 190, 64, + 179, 146, 125, 153, 192, 46, 202, 66, 248, 46, 40, 161, 173, 242, + 214, 3, 11, 1, 118, 70, 162, 61, 178, 27, 156, 40, 191, 113, + 230, 200, 72, 8, 215, 245, 78, 59, 222, 250, 115, 32, 33, 30, + 211, 170, 145, 92, 157, 75, 24, 169, 6, 55, 62, 8, 107, 82, + 140, 49, 179, 122, 90, 71, 28, 88, 103, 51, 177, 72, 93, 39, + 148, 11, 202, 42, 34, 92, 204, 102, 29, 98, 249, 91, 134, 95, + 23, 248, 192, 20, 83, 195, 95, 180, 54, 36, 186, 75, 64, 20, + 157, 133, 12, 149, 28, 14, 185, 129, 101, 239, 74, 248, 245, 30, + 228, 88, 142, 212, 53, 224, 158, 166, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.status_report.n_status = 60; - + test_msg.status_report.reporting_system = 64850; - + test_msg.status_report.sbp_version = 24497; - + test_msg.status_report.sequence = 1519336451; - - - + test_msg.status_report.status[0].component = 52215; - + test_msg.status_report.status[0].generic = 221; - + test_msg.status_report.status[0].specific = 198; - - + test_msg.status_report.status[1].component = 53148; - + test_msg.status_report.status[1].generic = 217; - + test_msg.status_report.status[1].specific = 238; - - + test_msg.status_report.status[2].component = 34978; - + test_msg.status_report.status[2].generic = 154; - + test_msg.status_report.status[2].specific = 11; - - + test_msg.status_report.status[3].component = 60530; - + test_msg.status_report.status[3].generic = 134; - + test_msg.status_report.status[3].specific = 235; - - + test_msg.status_report.status[4].component = 34060; - + test_msg.status_report.status[4].generic = 9; - + test_msg.status_report.status[4].specific = 30; - - + test_msg.status_report.status[5].component = 37295; - + test_msg.status_report.status[5].generic = 26; - + test_msg.status_report.status[5].specific = 114; - - + test_msg.status_report.status[6].component = 5335; - + test_msg.status_report.status[6].generic = 146; - + test_msg.status_report.status[6].specific = 249; - - + test_msg.status_report.status[7].component = 13878; - + test_msg.status_report.status[7].generic = 133; - + test_msg.status_report.status[7].specific = 193; - - + test_msg.status_report.status[8].component = 47722; - + test_msg.status_report.status[8].generic = 210; - + test_msg.status_report.status[8].specific = 183; - - + test_msg.status_report.status[9].component = 33024; - + test_msg.status_report.status[9].generic = 5; - + test_msg.status_report.status[9].specific = 248; - - + test_msg.status_report.status[10].component = 38369; - + test_msg.status_report.status[10].generic = 135; - + test_msg.status_report.status[10].specific = 127; - - + test_msg.status_report.status[11].component = 6658; - + test_msg.status_report.status[11].generic = 88; - + test_msg.status_report.status[11].specific = 92; - - + test_msg.status_report.status[12].component = 26378; - + test_msg.status_report.status[12].generic = 73; - + test_msg.status_report.status[12].specific = 3; - - + test_msg.status_report.status[13].component = 17511; - + test_msg.status_report.status[13].generic = 76; - + test_msg.status_report.status[13].specific = 184; - - + test_msg.status_report.status[14].component = 52769; - + test_msg.status_report.status[14].generic = 194; - + test_msg.status_report.status[14].specific = 163; - - + test_msg.status_report.status[15].component = 7803; - + test_msg.status_report.status[15].generic = 151; - + test_msg.status_report.status[15].specific = 176; - - + test_msg.status_report.status[16].component = 44181; - + test_msg.status_report.status[16].generic = 184; - + test_msg.status_report.status[16].specific = 231; - - + test_msg.status_report.status[17].component = 58998; - + test_msg.status_report.status[17].generic = 200; - + test_msg.status_report.status[17].specific = 168; - - + test_msg.status_report.status[18].component = 28004; - + test_msg.status_report.status[18].generic = 10; - + test_msg.status_report.status[18].specific = 233; - - + test_msg.status_report.status[19].component = 15364; - + test_msg.status_report.status[19].generic = 247; - + test_msg.status_report.status[19].specific = 82; - - + test_msg.status_report.status[20].component = 42711; - + test_msg.status_report.status[20].generic = 28; - + test_msg.status_report.status[20].specific = 138; - - + test_msg.status_report.status[21].component = 11630; - + test_msg.status_report.status[21].generic = 98; - + test_msg.status_report.status[21].specific = 218; - - + test_msg.status_report.status[22].component = 46068; - + test_msg.status_report.status[22].generic = 126; - + test_msg.status_report.status[22].specific = 107; - - + test_msg.status_report.status[23].component = 31836; - + test_msg.status_report.status[23].generic = 94; - + test_msg.status_report.status[23].specific = 157; - - + test_msg.status_report.status[24].component = 47914; - + test_msg.status_report.status[24].generic = 124; - + test_msg.status_report.status[24].specific = 6; - - + test_msg.status_report.status[25].component = 63329; - + test_msg.status_report.status[25].generic = 160; - + test_msg.status_report.status[25].specific = 188; - - + test_msg.status_report.status[26].component = 30830; - + test_msg.status_report.status[26].generic = 254; - + test_msg.status_report.status[26].specific = 214; - - + test_msg.status_report.status[27].component = 13166; - + test_msg.status_report.status[27].generic = 240; - + test_msg.status_report.status[27].specific = 164; - - + test_msg.status_report.status[28].component = 4755; - + test_msg.status_report.status[28].generic = 74; - + test_msg.status_report.status[28].specific = 178; - - + test_msg.status_report.status[29].component = 1091; - + test_msg.status_report.status[29].generic = 27; - + test_msg.status_report.status[29].specific = 73; - - + test_msg.status_report.status[30].component = 16574; - + test_msg.status_report.status[30].generic = 179; - + test_msg.status_report.status[30].specific = 146; - - + test_msg.status_report.status[31].component = 39293; - + test_msg.status_report.status[31].generic = 192; - + test_msg.status_report.status[31].specific = 46; - - + test_msg.status_report.status[32].component = 17098; - + test_msg.status_report.status[32].generic = 248; - + test_msg.status_report.status[32].specific = 46; - - + test_msg.status_report.status[33].component = 41256; - + test_msg.status_report.status[33].generic = 173; - + test_msg.status_report.status[33].specific = 242; - - + test_msg.status_report.status[34].component = 982; - + test_msg.status_report.status[34].generic = 11; - + test_msg.status_report.status[34].specific = 1; - - + test_msg.status_report.status[35].component = 18038; - + test_msg.status_report.status[35].generic = 162; - + test_msg.status_report.status[35].specific = 61; - - + test_msg.status_report.status[36].component = 7090; - + test_msg.status_report.status[36].generic = 156; - + test_msg.status_report.status[36].specific = 40; - - + test_msg.status_report.status[37].component = 29119; - + test_msg.status_report.status[37].generic = 230; - + test_msg.status_report.status[37].specific = 200; - - + test_msg.status_report.status[38].component = 2120; - + test_msg.status_report.status[38].generic = 215; - + test_msg.status_report.status[38].specific = 245; - - + test_msg.status_report.status[39].component = 15182; - + test_msg.status_report.status[39].generic = 222; - + test_msg.status_report.status[39].specific = 250; - - + test_msg.status_report.status[40].component = 8307; - + test_msg.status_report.status[40].generic = 33; - + test_msg.status_report.status[40].specific = 30; - - + test_msg.status_report.status[41].component = 43731; - + test_msg.status_report.status[41].generic = 145; - + test_msg.status_report.status[41].specific = 92; - - + test_msg.status_report.status[42].component = 19357; - + test_msg.status_report.status[42].generic = 24; - + test_msg.status_report.status[42].specific = 169; - - + test_msg.status_report.status[43].component = 14086; - + test_msg.status_report.status[43].generic = 62; - + test_msg.status_report.status[43].specific = 8; - - + test_msg.status_report.status[44].component = 21099; - + test_msg.status_report.status[44].generic = 140; - + test_msg.status_report.status[44].specific = 49; - - + test_msg.status_report.status[45].component = 31411; - + test_msg.status_report.status[45].generic = 90; - + test_msg.status_report.status[45].specific = 71; - - + test_msg.status_report.status[46].component = 22556; - + test_msg.status_report.status[46].generic = 103; - + test_msg.status_report.status[46].specific = 51; - - + test_msg.status_report.status[47].component = 18609; - + test_msg.status_report.status[47].generic = 93; - + test_msg.status_report.status[47].specific = 39; - - + test_msg.status_report.status[48].component = 2964; - + test_msg.status_report.status[48].generic = 202; - + test_msg.status_report.status[48].specific = 42; - - + test_msg.status_report.status[49].component = 23586; - + test_msg.status_report.status[49].generic = 204; - + test_msg.status_report.status[49].specific = 102; - - + test_msg.status_report.status[50].component = 25117; - + test_msg.status_report.status[50].generic = 249; - + test_msg.status_report.status[50].specific = 91; - - + test_msg.status_report.status[51].component = 24454; - + test_msg.status_report.status[51].generic = 23; - + test_msg.status_report.status[51].specific = 248; - - + test_msg.status_report.status[52].component = 5312; - + test_msg.status_report.status[52].generic = 83; - + test_msg.status_report.status[52].specific = 195; - - + test_msg.status_report.status[53].component = 46175; - + test_msg.status_report.status[53].generic = 54; - + test_msg.status_report.status[53].specific = 36; - - + test_msg.status_report.status[54].component = 19386; - + test_msg.status_report.status[54].generic = 64; - + test_msg.status_report.status[54].specific = 20; - - + test_msg.status_report.status[55].component = 34205; - + test_msg.status_report.status[55].generic = 12; - + test_msg.status_report.status[55].specific = 149; - - + test_msg.status_report.status[56].component = 3612; - + test_msg.status_report.status[56].generic = 185; - + test_msg.status_report.status[56].specific = 129; - - + test_msg.status_report.status[57].component = 61285; - + test_msg.status_report.status[57].generic = 74; - + test_msg.status_report.status[57].specific = 248; - - + test_msg.status_report.status[58].component = 7925; - + test_msg.status_report.status[58].generic = 228; - + test_msg.status_report.status[58].specific = 88; - - + test_msg.status_report.status[59].component = 54414; - + test_msg.status_report.status[59].generic = 53; - + test_msg.status_report.status[59].specific = 224; - + test_msg.status_report.uptime = 1657804265; - sbp_message_send(&sbp_state, SbpMsgStatusReport, 21510, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgStatusReport, 21510, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 21510, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgStatusReport, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgStatusReport, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.status_report.n_status == 60, "incorrect value for last_msg.msg.status_report.n_status, expected 60, is %d", last_msg.msg.status_report.n_status); - - ck_assert_msg(last_msg.msg.status_report.reporting_system == 64850, "incorrect value for last_msg.msg.status_report.reporting_system, expected 64850, is %d", last_msg.msg.status_report.reporting_system); - - ck_assert_msg(last_msg.msg.status_report.sbp_version == 24497, "incorrect value for last_msg.msg.status_report.sbp_version, expected 24497, is %d", last_msg.msg.status_report.sbp_version); - - ck_assert_msg(last_msg.msg.status_report.sequence == 1519336451, "incorrect value for last_msg.msg.status_report.sequence, expected 1519336451, is %d", last_msg.msg.status_report.sequence); - - - ck_assert_msg(last_msg.msg.status_report.status[0].component == 52215, "incorrect value for last_msg.msg.status_report.status[0].component, expected 52215, is %d", last_msg.msg.status_report.status[0].component); - - ck_assert_msg(last_msg.msg.status_report.status[0].generic == 221, "incorrect value for last_msg.msg.status_report.status[0].generic, expected 221, is %d", last_msg.msg.status_report.status[0].generic); - - ck_assert_msg(last_msg.msg.status_report.status[0].specific == 198, "incorrect value for last_msg.msg.status_report.status[0].specific, expected 198, is %d", last_msg.msg.status_report.status[0].specific); - - ck_assert_msg(last_msg.msg.status_report.status[1].component == 53148, "incorrect value for last_msg.msg.status_report.status[1].component, expected 53148, is %d", last_msg.msg.status_report.status[1].component); - - ck_assert_msg(last_msg.msg.status_report.status[1].generic == 217, "incorrect value for last_msg.msg.status_report.status[1].generic, expected 217, is %d", last_msg.msg.status_report.status[1].generic); - - ck_assert_msg(last_msg.msg.status_report.status[1].specific == 238, "incorrect value for last_msg.msg.status_report.status[1].specific, expected 238, is %d", last_msg.msg.status_report.status[1].specific); - - ck_assert_msg(last_msg.msg.status_report.status[2].component == 34978, "incorrect value for last_msg.msg.status_report.status[2].component, expected 34978, is %d", last_msg.msg.status_report.status[2].component); - - ck_assert_msg(last_msg.msg.status_report.status[2].generic == 154, "incorrect value for last_msg.msg.status_report.status[2].generic, expected 154, is %d", last_msg.msg.status_report.status[2].generic); - - ck_assert_msg(last_msg.msg.status_report.status[2].specific == 11, "incorrect value for last_msg.msg.status_report.status[2].specific, expected 11, is %d", last_msg.msg.status_report.status[2].specific); - - ck_assert_msg(last_msg.msg.status_report.status[3].component == 60530, "incorrect value for last_msg.msg.status_report.status[3].component, expected 60530, is %d", last_msg.msg.status_report.status[3].component); - - ck_assert_msg(last_msg.msg.status_report.status[3].generic == 134, "incorrect value for last_msg.msg.status_report.status[3].generic, expected 134, is %d", last_msg.msg.status_report.status[3].generic); - - ck_assert_msg(last_msg.msg.status_report.status[3].specific == 235, "incorrect value for last_msg.msg.status_report.status[3].specific, expected 235, is %d", last_msg.msg.status_report.status[3].specific); - - ck_assert_msg(last_msg.msg.status_report.status[4].component == 34060, "incorrect value for last_msg.msg.status_report.status[4].component, expected 34060, is %d", last_msg.msg.status_report.status[4].component); - - ck_assert_msg(last_msg.msg.status_report.status[4].generic == 9, "incorrect value for last_msg.msg.status_report.status[4].generic, expected 9, is %d", last_msg.msg.status_report.status[4].generic); - - ck_assert_msg(last_msg.msg.status_report.status[4].specific == 30, "incorrect value for last_msg.msg.status_report.status[4].specific, expected 30, is %d", last_msg.msg.status_report.status[4].specific); - - ck_assert_msg(last_msg.msg.status_report.status[5].component == 37295, "incorrect value for last_msg.msg.status_report.status[5].component, expected 37295, is %d", last_msg.msg.status_report.status[5].component); - - ck_assert_msg(last_msg.msg.status_report.status[5].generic == 26, "incorrect value for last_msg.msg.status_report.status[5].generic, expected 26, is %d", last_msg.msg.status_report.status[5].generic); - - ck_assert_msg(last_msg.msg.status_report.status[5].specific == 114, "incorrect value for last_msg.msg.status_report.status[5].specific, expected 114, is %d", last_msg.msg.status_report.status[5].specific); - - ck_assert_msg(last_msg.msg.status_report.status[6].component == 5335, "incorrect value for last_msg.msg.status_report.status[6].component, expected 5335, is %d", last_msg.msg.status_report.status[6].component); - - ck_assert_msg(last_msg.msg.status_report.status[6].generic == 146, "incorrect value for last_msg.msg.status_report.status[6].generic, expected 146, is %d", last_msg.msg.status_report.status[6].generic); - - ck_assert_msg(last_msg.msg.status_report.status[6].specific == 249, "incorrect value for last_msg.msg.status_report.status[6].specific, expected 249, is %d", last_msg.msg.status_report.status[6].specific); - - ck_assert_msg(last_msg.msg.status_report.status[7].component == 13878, "incorrect value for last_msg.msg.status_report.status[7].component, expected 13878, is %d", last_msg.msg.status_report.status[7].component); - - ck_assert_msg(last_msg.msg.status_report.status[7].generic == 133, "incorrect value for last_msg.msg.status_report.status[7].generic, expected 133, is %d", last_msg.msg.status_report.status[7].generic); - - ck_assert_msg(last_msg.msg.status_report.status[7].specific == 193, "incorrect value for last_msg.msg.status_report.status[7].specific, expected 193, is %d", last_msg.msg.status_report.status[7].specific); - - ck_assert_msg(last_msg.msg.status_report.status[8].component == 47722, "incorrect value for last_msg.msg.status_report.status[8].component, expected 47722, is %d", last_msg.msg.status_report.status[8].component); - - ck_assert_msg(last_msg.msg.status_report.status[8].generic == 210, "incorrect value for last_msg.msg.status_report.status[8].generic, expected 210, is %d", last_msg.msg.status_report.status[8].generic); - - ck_assert_msg(last_msg.msg.status_report.status[8].specific == 183, "incorrect value for last_msg.msg.status_report.status[8].specific, expected 183, is %d", last_msg.msg.status_report.status[8].specific); - - ck_assert_msg(last_msg.msg.status_report.status[9].component == 33024, "incorrect value for last_msg.msg.status_report.status[9].component, expected 33024, is %d", last_msg.msg.status_report.status[9].component); - - ck_assert_msg(last_msg.msg.status_report.status[9].generic == 5, "incorrect value for last_msg.msg.status_report.status[9].generic, expected 5, is %d", last_msg.msg.status_report.status[9].generic); - - ck_assert_msg(last_msg.msg.status_report.status[9].specific == 248, "incorrect value for last_msg.msg.status_report.status[9].specific, expected 248, is %d", last_msg.msg.status_report.status[9].specific); - - ck_assert_msg(last_msg.msg.status_report.status[10].component == 38369, "incorrect value for last_msg.msg.status_report.status[10].component, expected 38369, is %d", last_msg.msg.status_report.status[10].component); - - ck_assert_msg(last_msg.msg.status_report.status[10].generic == 135, "incorrect value for last_msg.msg.status_report.status[10].generic, expected 135, is %d", last_msg.msg.status_report.status[10].generic); - - ck_assert_msg(last_msg.msg.status_report.status[10].specific == 127, "incorrect value for last_msg.msg.status_report.status[10].specific, expected 127, is %d", last_msg.msg.status_report.status[10].specific); - - ck_assert_msg(last_msg.msg.status_report.status[11].component == 6658, "incorrect value for last_msg.msg.status_report.status[11].component, expected 6658, is %d", last_msg.msg.status_report.status[11].component); - - ck_assert_msg(last_msg.msg.status_report.status[11].generic == 88, "incorrect value for last_msg.msg.status_report.status[11].generic, expected 88, is %d", last_msg.msg.status_report.status[11].generic); - - ck_assert_msg(last_msg.msg.status_report.status[11].specific == 92, "incorrect value for last_msg.msg.status_report.status[11].specific, expected 92, is %d", last_msg.msg.status_report.status[11].specific); - - ck_assert_msg(last_msg.msg.status_report.status[12].component == 26378, "incorrect value for last_msg.msg.status_report.status[12].component, expected 26378, is %d", last_msg.msg.status_report.status[12].component); - - ck_assert_msg(last_msg.msg.status_report.status[12].generic == 73, "incorrect value for last_msg.msg.status_report.status[12].generic, expected 73, is %d", last_msg.msg.status_report.status[12].generic); - - ck_assert_msg(last_msg.msg.status_report.status[12].specific == 3, "incorrect value for last_msg.msg.status_report.status[12].specific, expected 3, is %d", last_msg.msg.status_report.status[12].specific); - - ck_assert_msg(last_msg.msg.status_report.status[13].component == 17511, "incorrect value for last_msg.msg.status_report.status[13].component, expected 17511, is %d", last_msg.msg.status_report.status[13].component); - - ck_assert_msg(last_msg.msg.status_report.status[13].generic == 76, "incorrect value for last_msg.msg.status_report.status[13].generic, expected 76, is %d", last_msg.msg.status_report.status[13].generic); - - ck_assert_msg(last_msg.msg.status_report.status[13].specific == 184, "incorrect value for last_msg.msg.status_report.status[13].specific, expected 184, is %d", last_msg.msg.status_report.status[13].specific); - - ck_assert_msg(last_msg.msg.status_report.status[14].component == 52769, "incorrect value for last_msg.msg.status_report.status[14].component, expected 52769, is %d", last_msg.msg.status_report.status[14].component); - - ck_assert_msg(last_msg.msg.status_report.status[14].generic == 194, "incorrect value for last_msg.msg.status_report.status[14].generic, expected 194, is %d", last_msg.msg.status_report.status[14].generic); - - ck_assert_msg(last_msg.msg.status_report.status[14].specific == 163, "incorrect value for last_msg.msg.status_report.status[14].specific, expected 163, is %d", last_msg.msg.status_report.status[14].specific); - - ck_assert_msg(last_msg.msg.status_report.status[15].component == 7803, "incorrect value for last_msg.msg.status_report.status[15].component, expected 7803, is %d", last_msg.msg.status_report.status[15].component); - - ck_assert_msg(last_msg.msg.status_report.status[15].generic == 151, "incorrect value for last_msg.msg.status_report.status[15].generic, expected 151, is %d", last_msg.msg.status_report.status[15].generic); - - ck_assert_msg(last_msg.msg.status_report.status[15].specific == 176, "incorrect value for last_msg.msg.status_report.status[15].specific, expected 176, is %d", last_msg.msg.status_report.status[15].specific); - - ck_assert_msg(last_msg.msg.status_report.status[16].component == 44181, "incorrect value for last_msg.msg.status_report.status[16].component, expected 44181, is %d", last_msg.msg.status_report.status[16].component); - - ck_assert_msg(last_msg.msg.status_report.status[16].generic == 184, "incorrect value for last_msg.msg.status_report.status[16].generic, expected 184, is %d", last_msg.msg.status_report.status[16].generic); - - ck_assert_msg(last_msg.msg.status_report.status[16].specific == 231, "incorrect value for last_msg.msg.status_report.status[16].specific, expected 231, is %d", last_msg.msg.status_report.status[16].specific); - - ck_assert_msg(last_msg.msg.status_report.status[17].component == 58998, "incorrect value for last_msg.msg.status_report.status[17].component, expected 58998, is %d", last_msg.msg.status_report.status[17].component); - - ck_assert_msg(last_msg.msg.status_report.status[17].generic == 200, "incorrect value for last_msg.msg.status_report.status[17].generic, expected 200, is %d", last_msg.msg.status_report.status[17].generic); - - ck_assert_msg(last_msg.msg.status_report.status[17].specific == 168, "incorrect value for last_msg.msg.status_report.status[17].specific, expected 168, is %d", last_msg.msg.status_report.status[17].specific); - - ck_assert_msg(last_msg.msg.status_report.status[18].component == 28004, "incorrect value for last_msg.msg.status_report.status[18].component, expected 28004, is %d", last_msg.msg.status_report.status[18].component); - - ck_assert_msg(last_msg.msg.status_report.status[18].generic == 10, "incorrect value for last_msg.msg.status_report.status[18].generic, expected 10, is %d", last_msg.msg.status_report.status[18].generic); - - ck_assert_msg(last_msg.msg.status_report.status[18].specific == 233, "incorrect value for last_msg.msg.status_report.status[18].specific, expected 233, is %d", last_msg.msg.status_report.status[18].specific); - - ck_assert_msg(last_msg.msg.status_report.status[19].component == 15364, "incorrect value for last_msg.msg.status_report.status[19].component, expected 15364, is %d", last_msg.msg.status_report.status[19].component); - - ck_assert_msg(last_msg.msg.status_report.status[19].generic == 247, "incorrect value for last_msg.msg.status_report.status[19].generic, expected 247, is %d", last_msg.msg.status_report.status[19].generic); - - ck_assert_msg(last_msg.msg.status_report.status[19].specific == 82, "incorrect value for last_msg.msg.status_report.status[19].specific, expected 82, is %d", last_msg.msg.status_report.status[19].specific); - - ck_assert_msg(last_msg.msg.status_report.status[20].component == 42711, "incorrect value for last_msg.msg.status_report.status[20].component, expected 42711, is %d", last_msg.msg.status_report.status[20].component); - - ck_assert_msg(last_msg.msg.status_report.status[20].generic == 28, "incorrect value for last_msg.msg.status_report.status[20].generic, expected 28, is %d", last_msg.msg.status_report.status[20].generic); - - ck_assert_msg(last_msg.msg.status_report.status[20].specific == 138, "incorrect value for last_msg.msg.status_report.status[20].specific, expected 138, is %d", last_msg.msg.status_report.status[20].specific); - - ck_assert_msg(last_msg.msg.status_report.status[21].component == 11630, "incorrect value for last_msg.msg.status_report.status[21].component, expected 11630, is %d", last_msg.msg.status_report.status[21].component); - - ck_assert_msg(last_msg.msg.status_report.status[21].generic == 98, "incorrect value for last_msg.msg.status_report.status[21].generic, expected 98, is %d", last_msg.msg.status_report.status[21].generic); - - ck_assert_msg(last_msg.msg.status_report.status[21].specific == 218, "incorrect value for last_msg.msg.status_report.status[21].specific, expected 218, is %d", last_msg.msg.status_report.status[21].specific); - - ck_assert_msg(last_msg.msg.status_report.status[22].component == 46068, "incorrect value for last_msg.msg.status_report.status[22].component, expected 46068, is %d", last_msg.msg.status_report.status[22].component); - - ck_assert_msg(last_msg.msg.status_report.status[22].generic == 126, "incorrect value for last_msg.msg.status_report.status[22].generic, expected 126, is %d", last_msg.msg.status_report.status[22].generic); - - ck_assert_msg(last_msg.msg.status_report.status[22].specific == 107, "incorrect value for last_msg.msg.status_report.status[22].specific, expected 107, is %d", last_msg.msg.status_report.status[22].specific); - - ck_assert_msg(last_msg.msg.status_report.status[23].component == 31836, "incorrect value for last_msg.msg.status_report.status[23].component, expected 31836, is %d", last_msg.msg.status_report.status[23].component); - - ck_assert_msg(last_msg.msg.status_report.status[23].generic == 94, "incorrect value for last_msg.msg.status_report.status[23].generic, expected 94, is %d", last_msg.msg.status_report.status[23].generic); - - ck_assert_msg(last_msg.msg.status_report.status[23].specific == 157, "incorrect value for last_msg.msg.status_report.status[23].specific, expected 157, is %d", last_msg.msg.status_report.status[23].specific); - - ck_assert_msg(last_msg.msg.status_report.status[24].component == 47914, "incorrect value for last_msg.msg.status_report.status[24].component, expected 47914, is %d", last_msg.msg.status_report.status[24].component); - - ck_assert_msg(last_msg.msg.status_report.status[24].generic == 124, "incorrect value for last_msg.msg.status_report.status[24].generic, expected 124, is %d", last_msg.msg.status_report.status[24].generic); - - ck_assert_msg(last_msg.msg.status_report.status[24].specific == 6, "incorrect value for last_msg.msg.status_report.status[24].specific, expected 6, is %d", last_msg.msg.status_report.status[24].specific); - - ck_assert_msg(last_msg.msg.status_report.status[25].component == 63329, "incorrect value for last_msg.msg.status_report.status[25].component, expected 63329, is %d", last_msg.msg.status_report.status[25].component); - - ck_assert_msg(last_msg.msg.status_report.status[25].generic == 160, "incorrect value for last_msg.msg.status_report.status[25].generic, expected 160, is %d", last_msg.msg.status_report.status[25].generic); - - ck_assert_msg(last_msg.msg.status_report.status[25].specific == 188, "incorrect value for last_msg.msg.status_report.status[25].specific, expected 188, is %d", last_msg.msg.status_report.status[25].specific); - - ck_assert_msg(last_msg.msg.status_report.status[26].component == 30830, "incorrect value for last_msg.msg.status_report.status[26].component, expected 30830, is %d", last_msg.msg.status_report.status[26].component); - - ck_assert_msg(last_msg.msg.status_report.status[26].generic == 254, "incorrect value for last_msg.msg.status_report.status[26].generic, expected 254, is %d", last_msg.msg.status_report.status[26].generic); - - ck_assert_msg(last_msg.msg.status_report.status[26].specific == 214, "incorrect value for last_msg.msg.status_report.status[26].specific, expected 214, is %d", last_msg.msg.status_report.status[26].specific); - - ck_assert_msg(last_msg.msg.status_report.status[27].component == 13166, "incorrect value for last_msg.msg.status_report.status[27].component, expected 13166, is %d", last_msg.msg.status_report.status[27].component); - - ck_assert_msg(last_msg.msg.status_report.status[27].generic == 240, "incorrect value for last_msg.msg.status_report.status[27].generic, expected 240, is %d", last_msg.msg.status_report.status[27].generic); - - ck_assert_msg(last_msg.msg.status_report.status[27].specific == 164, "incorrect value for last_msg.msg.status_report.status[27].specific, expected 164, is %d", last_msg.msg.status_report.status[27].specific); - - ck_assert_msg(last_msg.msg.status_report.status[28].component == 4755, "incorrect value for last_msg.msg.status_report.status[28].component, expected 4755, is %d", last_msg.msg.status_report.status[28].component); - - ck_assert_msg(last_msg.msg.status_report.status[28].generic == 74, "incorrect value for last_msg.msg.status_report.status[28].generic, expected 74, is %d", last_msg.msg.status_report.status[28].generic); - - ck_assert_msg(last_msg.msg.status_report.status[28].specific == 178, "incorrect value for last_msg.msg.status_report.status[28].specific, expected 178, is %d", last_msg.msg.status_report.status[28].specific); - - ck_assert_msg(last_msg.msg.status_report.status[29].component == 1091, "incorrect value for last_msg.msg.status_report.status[29].component, expected 1091, is %d", last_msg.msg.status_report.status[29].component); - - ck_assert_msg(last_msg.msg.status_report.status[29].generic == 27, "incorrect value for last_msg.msg.status_report.status[29].generic, expected 27, is %d", last_msg.msg.status_report.status[29].generic); - - ck_assert_msg(last_msg.msg.status_report.status[29].specific == 73, "incorrect value for last_msg.msg.status_report.status[29].specific, expected 73, is %d", last_msg.msg.status_report.status[29].specific); - - ck_assert_msg(last_msg.msg.status_report.status[30].component == 16574, "incorrect value for last_msg.msg.status_report.status[30].component, expected 16574, is %d", last_msg.msg.status_report.status[30].component); - - ck_assert_msg(last_msg.msg.status_report.status[30].generic == 179, "incorrect value for last_msg.msg.status_report.status[30].generic, expected 179, is %d", last_msg.msg.status_report.status[30].generic); - - ck_assert_msg(last_msg.msg.status_report.status[30].specific == 146, "incorrect value for last_msg.msg.status_report.status[30].specific, expected 146, is %d", last_msg.msg.status_report.status[30].specific); - - ck_assert_msg(last_msg.msg.status_report.status[31].component == 39293, "incorrect value for last_msg.msg.status_report.status[31].component, expected 39293, is %d", last_msg.msg.status_report.status[31].component); - - ck_assert_msg(last_msg.msg.status_report.status[31].generic == 192, "incorrect value for last_msg.msg.status_report.status[31].generic, expected 192, is %d", last_msg.msg.status_report.status[31].generic); - - ck_assert_msg(last_msg.msg.status_report.status[31].specific == 46, "incorrect value for last_msg.msg.status_report.status[31].specific, expected 46, is %d", last_msg.msg.status_report.status[31].specific); - - ck_assert_msg(last_msg.msg.status_report.status[32].component == 17098, "incorrect value for last_msg.msg.status_report.status[32].component, expected 17098, is %d", last_msg.msg.status_report.status[32].component); - - ck_assert_msg(last_msg.msg.status_report.status[32].generic == 248, "incorrect value for last_msg.msg.status_report.status[32].generic, expected 248, is %d", last_msg.msg.status_report.status[32].generic); - - ck_assert_msg(last_msg.msg.status_report.status[32].specific == 46, "incorrect value for last_msg.msg.status_report.status[32].specific, expected 46, is %d", last_msg.msg.status_report.status[32].specific); - - ck_assert_msg(last_msg.msg.status_report.status[33].component == 41256, "incorrect value for last_msg.msg.status_report.status[33].component, expected 41256, is %d", last_msg.msg.status_report.status[33].component); - - ck_assert_msg(last_msg.msg.status_report.status[33].generic == 173, "incorrect value for last_msg.msg.status_report.status[33].generic, expected 173, is %d", last_msg.msg.status_report.status[33].generic); - - ck_assert_msg(last_msg.msg.status_report.status[33].specific == 242, "incorrect value for last_msg.msg.status_report.status[33].specific, expected 242, is %d", last_msg.msg.status_report.status[33].specific); - - ck_assert_msg(last_msg.msg.status_report.status[34].component == 982, "incorrect value for last_msg.msg.status_report.status[34].component, expected 982, is %d", last_msg.msg.status_report.status[34].component); - - ck_assert_msg(last_msg.msg.status_report.status[34].generic == 11, "incorrect value for last_msg.msg.status_report.status[34].generic, expected 11, is %d", last_msg.msg.status_report.status[34].generic); - - ck_assert_msg(last_msg.msg.status_report.status[34].specific == 1, "incorrect value for last_msg.msg.status_report.status[34].specific, expected 1, is %d", last_msg.msg.status_report.status[34].specific); - - ck_assert_msg(last_msg.msg.status_report.status[35].component == 18038, "incorrect value for last_msg.msg.status_report.status[35].component, expected 18038, is %d", last_msg.msg.status_report.status[35].component); - - ck_assert_msg(last_msg.msg.status_report.status[35].generic == 162, "incorrect value for last_msg.msg.status_report.status[35].generic, expected 162, is %d", last_msg.msg.status_report.status[35].generic); - - ck_assert_msg(last_msg.msg.status_report.status[35].specific == 61, "incorrect value for last_msg.msg.status_report.status[35].specific, expected 61, is %d", last_msg.msg.status_report.status[35].specific); - - ck_assert_msg(last_msg.msg.status_report.status[36].component == 7090, "incorrect value for last_msg.msg.status_report.status[36].component, expected 7090, is %d", last_msg.msg.status_report.status[36].component); - - ck_assert_msg(last_msg.msg.status_report.status[36].generic == 156, "incorrect value for last_msg.msg.status_report.status[36].generic, expected 156, is %d", last_msg.msg.status_report.status[36].generic); - - ck_assert_msg(last_msg.msg.status_report.status[36].specific == 40, "incorrect value for last_msg.msg.status_report.status[36].specific, expected 40, is %d", last_msg.msg.status_report.status[36].specific); - - ck_assert_msg(last_msg.msg.status_report.status[37].component == 29119, "incorrect value for last_msg.msg.status_report.status[37].component, expected 29119, is %d", last_msg.msg.status_report.status[37].component); - - ck_assert_msg(last_msg.msg.status_report.status[37].generic == 230, "incorrect value for last_msg.msg.status_report.status[37].generic, expected 230, is %d", last_msg.msg.status_report.status[37].generic); - - ck_assert_msg(last_msg.msg.status_report.status[37].specific == 200, "incorrect value for last_msg.msg.status_report.status[37].specific, expected 200, is %d", last_msg.msg.status_report.status[37].specific); - - ck_assert_msg(last_msg.msg.status_report.status[38].component == 2120, "incorrect value for last_msg.msg.status_report.status[38].component, expected 2120, is %d", last_msg.msg.status_report.status[38].component); - - ck_assert_msg(last_msg.msg.status_report.status[38].generic == 215, "incorrect value for last_msg.msg.status_report.status[38].generic, expected 215, is %d", last_msg.msg.status_report.status[38].generic); - - ck_assert_msg(last_msg.msg.status_report.status[38].specific == 245, "incorrect value for last_msg.msg.status_report.status[38].specific, expected 245, is %d", last_msg.msg.status_report.status[38].specific); - - ck_assert_msg(last_msg.msg.status_report.status[39].component == 15182, "incorrect value for last_msg.msg.status_report.status[39].component, expected 15182, is %d", last_msg.msg.status_report.status[39].component); - - ck_assert_msg(last_msg.msg.status_report.status[39].generic == 222, "incorrect value for last_msg.msg.status_report.status[39].generic, expected 222, is %d", last_msg.msg.status_report.status[39].generic); - - ck_assert_msg(last_msg.msg.status_report.status[39].specific == 250, "incorrect value for last_msg.msg.status_report.status[39].specific, expected 250, is %d", last_msg.msg.status_report.status[39].specific); - - ck_assert_msg(last_msg.msg.status_report.status[40].component == 8307, "incorrect value for last_msg.msg.status_report.status[40].component, expected 8307, is %d", last_msg.msg.status_report.status[40].component); - - ck_assert_msg(last_msg.msg.status_report.status[40].generic == 33, "incorrect value for last_msg.msg.status_report.status[40].generic, expected 33, is %d", last_msg.msg.status_report.status[40].generic); - - ck_assert_msg(last_msg.msg.status_report.status[40].specific == 30, "incorrect value for last_msg.msg.status_report.status[40].specific, expected 30, is %d", last_msg.msg.status_report.status[40].specific); - - ck_assert_msg(last_msg.msg.status_report.status[41].component == 43731, "incorrect value for last_msg.msg.status_report.status[41].component, expected 43731, is %d", last_msg.msg.status_report.status[41].component); - - ck_assert_msg(last_msg.msg.status_report.status[41].generic == 145, "incorrect value for last_msg.msg.status_report.status[41].generic, expected 145, is %d", last_msg.msg.status_report.status[41].generic); - - ck_assert_msg(last_msg.msg.status_report.status[41].specific == 92, "incorrect value for last_msg.msg.status_report.status[41].specific, expected 92, is %d", last_msg.msg.status_report.status[41].specific); - - ck_assert_msg(last_msg.msg.status_report.status[42].component == 19357, "incorrect value for last_msg.msg.status_report.status[42].component, expected 19357, is %d", last_msg.msg.status_report.status[42].component); - - ck_assert_msg(last_msg.msg.status_report.status[42].generic == 24, "incorrect value for last_msg.msg.status_report.status[42].generic, expected 24, is %d", last_msg.msg.status_report.status[42].generic); - - ck_assert_msg(last_msg.msg.status_report.status[42].specific == 169, "incorrect value for last_msg.msg.status_report.status[42].specific, expected 169, is %d", last_msg.msg.status_report.status[42].specific); - - ck_assert_msg(last_msg.msg.status_report.status[43].component == 14086, "incorrect value for last_msg.msg.status_report.status[43].component, expected 14086, is %d", last_msg.msg.status_report.status[43].component); - - ck_assert_msg(last_msg.msg.status_report.status[43].generic == 62, "incorrect value for last_msg.msg.status_report.status[43].generic, expected 62, is %d", last_msg.msg.status_report.status[43].generic); - - ck_assert_msg(last_msg.msg.status_report.status[43].specific == 8, "incorrect value for last_msg.msg.status_report.status[43].specific, expected 8, is %d", last_msg.msg.status_report.status[43].specific); - - ck_assert_msg(last_msg.msg.status_report.status[44].component == 21099, "incorrect value for last_msg.msg.status_report.status[44].component, expected 21099, is %d", last_msg.msg.status_report.status[44].component); - - ck_assert_msg(last_msg.msg.status_report.status[44].generic == 140, "incorrect value for last_msg.msg.status_report.status[44].generic, expected 140, is %d", last_msg.msg.status_report.status[44].generic); - - ck_assert_msg(last_msg.msg.status_report.status[44].specific == 49, "incorrect value for last_msg.msg.status_report.status[44].specific, expected 49, is %d", last_msg.msg.status_report.status[44].specific); - - ck_assert_msg(last_msg.msg.status_report.status[45].component == 31411, "incorrect value for last_msg.msg.status_report.status[45].component, expected 31411, is %d", last_msg.msg.status_report.status[45].component); - - ck_assert_msg(last_msg.msg.status_report.status[45].generic == 90, "incorrect value for last_msg.msg.status_report.status[45].generic, expected 90, is %d", last_msg.msg.status_report.status[45].generic); - - ck_assert_msg(last_msg.msg.status_report.status[45].specific == 71, "incorrect value for last_msg.msg.status_report.status[45].specific, expected 71, is %d", last_msg.msg.status_report.status[45].specific); - - ck_assert_msg(last_msg.msg.status_report.status[46].component == 22556, "incorrect value for last_msg.msg.status_report.status[46].component, expected 22556, is %d", last_msg.msg.status_report.status[46].component); - - ck_assert_msg(last_msg.msg.status_report.status[46].generic == 103, "incorrect value for last_msg.msg.status_report.status[46].generic, expected 103, is %d", last_msg.msg.status_report.status[46].generic); - - ck_assert_msg(last_msg.msg.status_report.status[46].specific == 51, "incorrect value for last_msg.msg.status_report.status[46].specific, expected 51, is %d", last_msg.msg.status_report.status[46].specific); - - ck_assert_msg(last_msg.msg.status_report.status[47].component == 18609, "incorrect value for last_msg.msg.status_report.status[47].component, expected 18609, is %d", last_msg.msg.status_report.status[47].component); - - ck_assert_msg(last_msg.msg.status_report.status[47].generic == 93, "incorrect value for last_msg.msg.status_report.status[47].generic, expected 93, is %d", last_msg.msg.status_report.status[47].generic); - - ck_assert_msg(last_msg.msg.status_report.status[47].specific == 39, "incorrect value for last_msg.msg.status_report.status[47].specific, expected 39, is %d", last_msg.msg.status_report.status[47].specific); - - ck_assert_msg(last_msg.msg.status_report.status[48].component == 2964, "incorrect value for last_msg.msg.status_report.status[48].component, expected 2964, is %d", last_msg.msg.status_report.status[48].component); - - ck_assert_msg(last_msg.msg.status_report.status[48].generic == 202, "incorrect value for last_msg.msg.status_report.status[48].generic, expected 202, is %d", last_msg.msg.status_report.status[48].generic); - - ck_assert_msg(last_msg.msg.status_report.status[48].specific == 42, "incorrect value for last_msg.msg.status_report.status[48].specific, expected 42, is %d", last_msg.msg.status_report.status[48].specific); - - ck_assert_msg(last_msg.msg.status_report.status[49].component == 23586, "incorrect value for last_msg.msg.status_report.status[49].component, expected 23586, is %d", last_msg.msg.status_report.status[49].component); - - ck_assert_msg(last_msg.msg.status_report.status[49].generic == 204, "incorrect value for last_msg.msg.status_report.status[49].generic, expected 204, is %d", last_msg.msg.status_report.status[49].generic); - - ck_assert_msg(last_msg.msg.status_report.status[49].specific == 102, "incorrect value for last_msg.msg.status_report.status[49].specific, expected 102, is %d", last_msg.msg.status_report.status[49].specific); - - ck_assert_msg(last_msg.msg.status_report.status[50].component == 25117, "incorrect value for last_msg.msg.status_report.status[50].component, expected 25117, is %d", last_msg.msg.status_report.status[50].component); - - ck_assert_msg(last_msg.msg.status_report.status[50].generic == 249, "incorrect value for last_msg.msg.status_report.status[50].generic, expected 249, is %d", last_msg.msg.status_report.status[50].generic); - - ck_assert_msg(last_msg.msg.status_report.status[50].specific == 91, "incorrect value for last_msg.msg.status_report.status[50].specific, expected 91, is %d", last_msg.msg.status_report.status[50].specific); - - ck_assert_msg(last_msg.msg.status_report.status[51].component == 24454, "incorrect value for last_msg.msg.status_report.status[51].component, expected 24454, is %d", last_msg.msg.status_report.status[51].component); - - ck_assert_msg(last_msg.msg.status_report.status[51].generic == 23, "incorrect value for last_msg.msg.status_report.status[51].generic, expected 23, is %d", last_msg.msg.status_report.status[51].generic); - - ck_assert_msg(last_msg.msg.status_report.status[51].specific == 248, "incorrect value for last_msg.msg.status_report.status[51].specific, expected 248, is %d", last_msg.msg.status_report.status[51].specific); - - ck_assert_msg(last_msg.msg.status_report.status[52].component == 5312, "incorrect value for last_msg.msg.status_report.status[52].component, expected 5312, is %d", last_msg.msg.status_report.status[52].component); - - ck_assert_msg(last_msg.msg.status_report.status[52].generic == 83, "incorrect value for last_msg.msg.status_report.status[52].generic, expected 83, is %d", last_msg.msg.status_report.status[52].generic); - - ck_assert_msg(last_msg.msg.status_report.status[52].specific == 195, "incorrect value for last_msg.msg.status_report.status[52].specific, expected 195, is %d", last_msg.msg.status_report.status[52].specific); - - ck_assert_msg(last_msg.msg.status_report.status[53].component == 46175, "incorrect value for last_msg.msg.status_report.status[53].component, expected 46175, is %d", last_msg.msg.status_report.status[53].component); - - ck_assert_msg(last_msg.msg.status_report.status[53].generic == 54, "incorrect value for last_msg.msg.status_report.status[53].generic, expected 54, is %d", last_msg.msg.status_report.status[53].generic); - - ck_assert_msg(last_msg.msg.status_report.status[53].specific == 36, "incorrect value for last_msg.msg.status_report.status[53].specific, expected 36, is %d", last_msg.msg.status_report.status[53].specific); - - ck_assert_msg(last_msg.msg.status_report.status[54].component == 19386, "incorrect value for last_msg.msg.status_report.status[54].component, expected 19386, is %d", last_msg.msg.status_report.status[54].component); - - ck_assert_msg(last_msg.msg.status_report.status[54].generic == 64, "incorrect value for last_msg.msg.status_report.status[54].generic, expected 64, is %d", last_msg.msg.status_report.status[54].generic); - - ck_assert_msg(last_msg.msg.status_report.status[54].specific == 20, "incorrect value for last_msg.msg.status_report.status[54].specific, expected 20, is %d", last_msg.msg.status_report.status[54].specific); - - ck_assert_msg(last_msg.msg.status_report.status[55].component == 34205, "incorrect value for last_msg.msg.status_report.status[55].component, expected 34205, is %d", last_msg.msg.status_report.status[55].component); - - ck_assert_msg(last_msg.msg.status_report.status[55].generic == 12, "incorrect value for last_msg.msg.status_report.status[55].generic, expected 12, is %d", last_msg.msg.status_report.status[55].generic); - - ck_assert_msg(last_msg.msg.status_report.status[55].specific == 149, "incorrect value for last_msg.msg.status_report.status[55].specific, expected 149, is %d", last_msg.msg.status_report.status[55].specific); - - ck_assert_msg(last_msg.msg.status_report.status[56].component == 3612, "incorrect value for last_msg.msg.status_report.status[56].component, expected 3612, is %d", last_msg.msg.status_report.status[56].component); - - ck_assert_msg(last_msg.msg.status_report.status[56].generic == 185, "incorrect value for last_msg.msg.status_report.status[56].generic, expected 185, is %d", last_msg.msg.status_report.status[56].generic); - - ck_assert_msg(last_msg.msg.status_report.status[56].specific == 129, "incorrect value for last_msg.msg.status_report.status[56].specific, expected 129, is %d", last_msg.msg.status_report.status[56].specific); - - ck_assert_msg(last_msg.msg.status_report.status[57].component == 61285, "incorrect value for last_msg.msg.status_report.status[57].component, expected 61285, is %d", last_msg.msg.status_report.status[57].component); - - ck_assert_msg(last_msg.msg.status_report.status[57].generic == 74, "incorrect value for last_msg.msg.status_report.status[57].generic, expected 74, is %d", last_msg.msg.status_report.status[57].generic); - - ck_assert_msg(last_msg.msg.status_report.status[57].specific == 248, "incorrect value for last_msg.msg.status_report.status[57].specific, expected 248, is %d", last_msg.msg.status_report.status[57].specific); - - ck_assert_msg(last_msg.msg.status_report.status[58].component == 7925, "incorrect value for last_msg.msg.status_report.status[58].component, expected 7925, is %d", last_msg.msg.status_report.status[58].component); - - ck_assert_msg(last_msg.msg.status_report.status[58].generic == 228, "incorrect value for last_msg.msg.status_report.status[58].generic, expected 228, is %d", last_msg.msg.status_report.status[58].generic); - - ck_assert_msg(last_msg.msg.status_report.status[58].specific == 88, "incorrect value for last_msg.msg.status_report.status[58].specific, expected 88, is %d", last_msg.msg.status_report.status[58].specific); - - ck_assert_msg(last_msg.msg.status_report.status[59].component == 54414, "incorrect value for last_msg.msg.status_report.status[59].component, expected 54414, is %d", last_msg.msg.status_report.status[59].component); - - ck_assert_msg(last_msg.msg.status_report.status[59].generic == 53, "incorrect value for last_msg.msg.status_report.status[59].generic, expected 53, is %d", last_msg.msg.status_report.status[59].generic); - - ck_assert_msg(last_msg.msg.status_report.status[59].specific == 224, "incorrect value for last_msg.msg.status_report.status[59].specific, expected 224, is %d", last_msg.msg.status_report.status[59].specific); - - ck_assert_msg(last_msg.msg.status_report.uptime == 1657804265, "incorrect value for last_msg.msg.status_report.uptime, expected 1657804265, is %d", last_msg.msg.status_report.uptime); + ck_assert_msg(last_msg.msg.status_report.n_status == 60, + "incorrect value for last_msg.msg.status_report.n_status, " + "expected 60, is %d", + last_msg.msg.status_report.n_status); + + ck_assert_msg( + last_msg.msg.status_report.reporting_system == 64850, + "incorrect value for last_msg.msg.status_report.reporting_system, " + "expected 64850, is %d", + last_msg.msg.status_report.reporting_system); + + ck_assert_msg(last_msg.msg.status_report.sbp_version == 24497, + "incorrect value for last_msg.msg.status_report.sbp_version, " + "expected 24497, is %d", + last_msg.msg.status_report.sbp_version); + + ck_assert_msg(last_msg.msg.status_report.sequence == 1519336451, + "incorrect value for last_msg.msg.status_report.sequence, " + "expected 1519336451, is %d", + last_msg.msg.status_report.sequence); + + ck_assert_msg( + last_msg.msg.status_report.status[0].component == 52215, + "incorrect value for last_msg.msg.status_report.status[0].component, " + "expected 52215, is %d", + last_msg.msg.status_report.status[0].component); + + ck_assert_msg( + last_msg.msg.status_report.status[0].generic == 221, + "incorrect value for last_msg.msg.status_report.status[0].generic, " + "expected 221, is %d", + last_msg.msg.status_report.status[0].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[0].specific == 198, + "incorrect value for last_msg.msg.status_report.status[0].specific, " + "expected 198, is %d", + last_msg.msg.status_report.status[0].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[1].component == 53148, + "incorrect value for last_msg.msg.status_report.status[1].component, " + "expected 53148, is %d", + last_msg.msg.status_report.status[1].component); + + ck_assert_msg( + last_msg.msg.status_report.status[1].generic == 217, + "incorrect value for last_msg.msg.status_report.status[1].generic, " + "expected 217, is %d", + last_msg.msg.status_report.status[1].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[1].specific == 238, + "incorrect value for last_msg.msg.status_report.status[1].specific, " + "expected 238, is %d", + last_msg.msg.status_report.status[1].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[2].component == 34978, + "incorrect value for last_msg.msg.status_report.status[2].component, " + "expected 34978, is %d", + last_msg.msg.status_report.status[2].component); + + ck_assert_msg( + last_msg.msg.status_report.status[2].generic == 154, + "incorrect value for last_msg.msg.status_report.status[2].generic, " + "expected 154, is %d", + last_msg.msg.status_report.status[2].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[2].specific == 11, + "incorrect value for last_msg.msg.status_report.status[2].specific, " + "expected 11, is %d", + last_msg.msg.status_report.status[2].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[3].component == 60530, + "incorrect value for last_msg.msg.status_report.status[3].component, " + "expected 60530, is %d", + last_msg.msg.status_report.status[3].component); + + ck_assert_msg( + last_msg.msg.status_report.status[3].generic == 134, + "incorrect value for last_msg.msg.status_report.status[3].generic, " + "expected 134, is %d", + last_msg.msg.status_report.status[3].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[3].specific == 235, + "incorrect value for last_msg.msg.status_report.status[3].specific, " + "expected 235, is %d", + last_msg.msg.status_report.status[3].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[4].component == 34060, + "incorrect value for last_msg.msg.status_report.status[4].component, " + "expected 34060, is %d", + last_msg.msg.status_report.status[4].component); + + ck_assert_msg( + last_msg.msg.status_report.status[4].generic == 9, + "incorrect value for last_msg.msg.status_report.status[4].generic, " + "expected 9, is %d", + last_msg.msg.status_report.status[4].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[4].specific == 30, + "incorrect value for last_msg.msg.status_report.status[4].specific, " + "expected 30, is %d", + last_msg.msg.status_report.status[4].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[5].component == 37295, + "incorrect value for last_msg.msg.status_report.status[5].component, " + "expected 37295, is %d", + last_msg.msg.status_report.status[5].component); + + ck_assert_msg( + last_msg.msg.status_report.status[5].generic == 26, + "incorrect value for last_msg.msg.status_report.status[5].generic, " + "expected 26, is %d", + last_msg.msg.status_report.status[5].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[5].specific == 114, + "incorrect value for last_msg.msg.status_report.status[5].specific, " + "expected 114, is %d", + last_msg.msg.status_report.status[5].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[6].component == 5335, + "incorrect value for last_msg.msg.status_report.status[6].component, " + "expected 5335, is %d", + last_msg.msg.status_report.status[6].component); + + ck_assert_msg( + last_msg.msg.status_report.status[6].generic == 146, + "incorrect value for last_msg.msg.status_report.status[6].generic, " + "expected 146, is %d", + last_msg.msg.status_report.status[6].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[6].specific == 249, + "incorrect value for last_msg.msg.status_report.status[6].specific, " + "expected 249, is %d", + last_msg.msg.status_report.status[6].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[7].component == 13878, + "incorrect value for last_msg.msg.status_report.status[7].component, " + "expected 13878, is %d", + last_msg.msg.status_report.status[7].component); + + ck_assert_msg( + last_msg.msg.status_report.status[7].generic == 133, + "incorrect value for last_msg.msg.status_report.status[7].generic, " + "expected 133, is %d", + last_msg.msg.status_report.status[7].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[7].specific == 193, + "incorrect value for last_msg.msg.status_report.status[7].specific, " + "expected 193, is %d", + last_msg.msg.status_report.status[7].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[8].component == 47722, + "incorrect value for last_msg.msg.status_report.status[8].component, " + "expected 47722, is %d", + last_msg.msg.status_report.status[8].component); + + ck_assert_msg( + last_msg.msg.status_report.status[8].generic == 210, + "incorrect value for last_msg.msg.status_report.status[8].generic, " + "expected 210, is %d", + last_msg.msg.status_report.status[8].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[8].specific == 183, + "incorrect value for last_msg.msg.status_report.status[8].specific, " + "expected 183, is %d", + last_msg.msg.status_report.status[8].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[9].component == 33024, + "incorrect value for last_msg.msg.status_report.status[9].component, " + "expected 33024, is %d", + last_msg.msg.status_report.status[9].component); + + ck_assert_msg( + last_msg.msg.status_report.status[9].generic == 5, + "incorrect value for last_msg.msg.status_report.status[9].generic, " + "expected 5, is %d", + last_msg.msg.status_report.status[9].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[9].specific == 248, + "incorrect value for last_msg.msg.status_report.status[9].specific, " + "expected 248, is %d", + last_msg.msg.status_report.status[9].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[10].component == 38369, + "incorrect value for last_msg.msg.status_report.status[10].component, " + "expected 38369, is %d", + last_msg.msg.status_report.status[10].component); + + ck_assert_msg( + last_msg.msg.status_report.status[10].generic == 135, + "incorrect value for last_msg.msg.status_report.status[10].generic, " + "expected 135, is %d", + last_msg.msg.status_report.status[10].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[10].specific == 127, + "incorrect value for last_msg.msg.status_report.status[10].specific, " + "expected 127, is %d", + last_msg.msg.status_report.status[10].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[11].component == 6658, + "incorrect value for last_msg.msg.status_report.status[11].component, " + "expected 6658, is %d", + last_msg.msg.status_report.status[11].component); + + ck_assert_msg( + last_msg.msg.status_report.status[11].generic == 88, + "incorrect value for last_msg.msg.status_report.status[11].generic, " + "expected 88, is %d", + last_msg.msg.status_report.status[11].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[11].specific == 92, + "incorrect value for last_msg.msg.status_report.status[11].specific, " + "expected 92, is %d", + last_msg.msg.status_report.status[11].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[12].component == 26378, + "incorrect value for last_msg.msg.status_report.status[12].component, " + "expected 26378, is %d", + last_msg.msg.status_report.status[12].component); + + ck_assert_msg( + last_msg.msg.status_report.status[12].generic == 73, + "incorrect value for last_msg.msg.status_report.status[12].generic, " + "expected 73, is %d", + last_msg.msg.status_report.status[12].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[12].specific == 3, + "incorrect value for last_msg.msg.status_report.status[12].specific, " + "expected 3, is %d", + last_msg.msg.status_report.status[12].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[13].component == 17511, + "incorrect value for last_msg.msg.status_report.status[13].component, " + "expected 17511, is %d", + last_msg.msg.status_report.status[13].component); + + ck_assert_msg( + last_msg.msg.status_report.status[13].generic == 76, + "incorrect value for last_msg.msg.status_report.status[13].generic, " + "expected 76, is %d", + last_msg.msg.status_report.status[13].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[13].specific == 184, + "incorrect value for last_msg.msg.status_report.status[13].specific, " + "expected 184, is %d", + last_msg.msg.status_report.status[13].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[14].component == 52769, + "incorrect value for last_msg.msg.status_report.status[14].component, " + "expected 52769, is %d", + last_msg.msg.status_report.status[14].component); + + ck_assert_msg( + last_msg.msg.status_report.status[14].generic == 194, + "incorrect value for last_msg.msg.status_report.status[14].generic, " + "expected 194, is %d", + last_msg.msg.status_report.status[14].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[14].specific == 163, + "incorrect value for last_msg.msg.status_report.status[14].specific, " + "expected 163, is %d", + last_msg.msg.status_report.status[14].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[15].component == 7803, + "incorrect value for last_msg.msg.status_report.status[15].component, " + "expected 7803, is %d", + last_msg.msg.status_report.status[15].component); + + ck_assert_msg( + last_msg.msg.status_report.status[15].generic == 151, + "incorrect value for last_msg.msg.status_report.status[15].generic, " + "expected 151, is %d", + last_msg.msg.status_report.status[15].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[15].specific == 176, + "incorrect value for last_msg.msg.status_report.status[15].specific, " + "expected 176, is %d", + last_msg.msg.status_report.status[15].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[16].component == 44181, + "incorrect value for last_msg.msg.status_report.status[16].component, " + "expected 44181, is %d", + last_msg.msg.status_report.status[16].component); + + ck_assert_msg( + last_msg.msg.status_report.status[16].generic == 184, + "incorrect value for last_msg.msg.status_report.status[16].generic, " + "expected 184, is %d", + last_msg.msg.status_report.status[16].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[16].specific == 231, + "incorrect value for last_msg.msg.status_report.status[16].specific, " + "expected 231, is %d", + last_msg.msg.status_report.status[16].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[17].component == 58998, + "incorrect value for last_msg.msg.status_report.status[17].component, " + "expected 58998, is %d", + last_msg.msg.status_report.status[17].component); + + ck_assert_msg( + last_msg.msg.status_report.status[17].generic == 200, + "incorrect value for last_msg.msg.status_report.status[17].generic, " + "expected 200, is %d", + last_msg.msg.status_report.status[17].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[17].specific == 168, + "incorrect value for last_msg.msg.status_report.status[17].specific, " + "expected 168, is %d", + last_msg.msg.status_report.status[17].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[18].component == 28004, + "incorrect value for last_msg.msg.status_report.status[18].component, " + "expected 28004, is %d", + last_msg.msg.status_report.status[18].component); + + ck_assert_msg( + last_msg.msg.status_report.status[18].generic == 10, + "incorrect value for last_msg.msg.status_report.status[18].generic, " + "expected 10, is %d", + last_msg.msg.status_report.status[18].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[18].specific == 233, + "incorrect value for last_msg.msg.status_report.status[18].specific, " + "expected 233, is %d", + last_msg.msg.status_report.status[18].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[19].component == 15364, + "incorrect value for last_msg.msg.status_report.status[19].component, " + "expected 15364, is %d", + last_msg.msg.status_report.status[19].component); + + ck_assert_msg( + last_msg.msg.status_report.status[19].generic == 247, + "incorrect value for last_msg.msg.status_report.status[19].generic, " + "expected 247, is %d", + last_msg.msg.status_report.status[19].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[19].specific == 82, + "incorrect value for last_msg.msg.status_report.status[19].specific, " + "expected 82, is %d", + last_msg.msg.status_report.status[19].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[20].component == 42711, + "incorrect value for last_msg.msg.status_report.status[20].component, " + "expected 42711, is %d", + last_msg.msg.status_report.status[20].component); + + ck_assert_msg( + last_msg.msg.status_report.status[20].generic == 28, + "incorrect value for last_msg.msg.status_report.status[20].generic, " + "expected 28, is %d", + last_msg.msg.status_report.status[20].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[20].specific == 138, + "incorrect value for last_msg.msg.status_report.status[20].specific, " + "expected 138, is %d", + last_msg.msg.status_report.status[20].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[21].component == 11630, + "incorrect value for last_msg.msg.status_report.status[21].component, " + "expected 11630, is %d", + last_msg.msg.status_report.status[21].component); + + ck_assert_msg( + last_msg.msg.status_report.status[21].generic == 98, + "incorrect value for last_msg.msg.status_report.status[21].generic, " + "expected 98, is %d", + last_msg.msg.status_report.status[21].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[21].specific == 218, + "incorrect value for last_msg.msg.status_report.status[21].specific, " + "expected 218, is %d", + last_msg.msg.status_report.status[21].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[22].component == 46068, + "incorrect value for last_msg.msg.status_report.status[22].component, " + "expected 46068, is %d", + last_msg.msg.status_report.status[22].component); + + ck_assert_msg( + last_msg.msg.status_report.status[22].generic == 126, + "incorrect value for last_msg.msg.status_report.status[22].generic, " + "expected 126, is %d", + last_msg.msg.status_report.status[22].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[22].specific == 107, + "incorrect value for last_msg.msg.status_report.status[22].specific, " + "expected 107, is %d", + last_msg.msg.status_report.status[22].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[23].component == 31836, + "incorrect value for last_msg.msg.status_report.status[23].component, " + "expected 31836, is %d", + last_msg.msg.status_report.status[23].component); + + ck_assert_msg( + last_msg.msg.status_report.status[23].generic == 94, + "incorrect value for last_msg.msg.status_report.status[23].generic, " + "expected 94, is %d", + last_msg.msg.status_report.status[23].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[23].specific == 157, + "incorrect value for last_msg.msg.status_report.status[23].specific, " + "expected 157, is %d", + last_msg.msg.status_report.status[23].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[24].component == 47914, + "incorrect value for last_msg.msg.status_report.status[24].component, " + "expected 47914, is %d", + last_msg.msg.status_report.status[24].component); + + ck_assert_msg( + last_msg.msg.status_report.status[24].generic == 124, + "incorrect value for last_msg.msg.status_report.status[24].generic, " + "expected 124, is %d", + last_msg.msg.status_report.status[24].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[24].specific == 6, + "incorrect value for last_msg.msg.status_report.status[24].specific, " + "expected 6, is %d", + last_msg.msg.status_report.status[24].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[25].component == 63329, + "incorrect value for last_msg.msg.status_report.status[25].component, " + "expected 63329, is %d", + last_msg.msg.status_report.status[25].component); + + ck_assert_msg( + last_msg.msg.status_report.status[25].generic == 160, + "incorrect value for last_msg.msg.status_report.status[25].generic, " + "expected 160, is %d", + last_msg.msg.status_report.status[25].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[25].specific == 188, + "incorrect value for last_msg.msg.status_report.status[25].specific, " + "expected 188, is %d", + last_msg.msg.status_report.status[25].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[26].component == 30830, + "incorrect value for last_msg.msg.status_report.status[26].component, " + "expected 30830, is %d", + last_msg.msg.status_report.status[26].component); + + ck_assert_msg( + last_msg.msg.status_report.status[26].generic == 254, + "incorrect value for last_msg.msg.status_report.status[26].generic, " + "expected 254, is %d", + last_msg.msg.status_report.status[26].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[26].specific == 214, + "incorrect value for last_msg.msg.status_report.status[26].specific, " + "expected 214, is %d", + last_msg.msg.status_report.status[26].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[27].component == 13166, + "incorrect value for last_msg.msg.status_report.status[27].component, " + "expected 13166, is %d", + last_msg.msg.status_report.status[27].component); + + ck_assert_msg( + last_msg.msg.status_report.status[27].generic == 240, + "incorrect value for last_msg.msg.status_report.status[27].generic, " + "expected 240, is %d", + last_msg.msg.status_report.status[27].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[27].specific == 164, + "incorrect value for last_msg.msg.status_report.status[27].specific, " + "expected 164, is %d", + last_msg.msg.status_report.status[27].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[28].component == 4755, + "incorrect value for last_msg.msg.status_report.status[28].component, " + "expected 4755, is %d", + last_msg.msg.status_report.status[28].component); + + ck_assert_msg( + last_msg.msg.status_report.status[28].generic == 74, + "incorrect value for last_msg.msg.status_report.status[28].generic, " + "expected 74, is %d", + last_msg.msg.status_report.status[28].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[28].specific == 178, + "incorrect value for last_msg.msg.status_report.status[28].specific, " + "expected 178, is %d", + last_msg.msg.status_report.status[28].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[29].component == 1091, + "incorrect value for last_msg.msg.status_report.status[29].component, " + "expected 1091, is %d", + last_msg.msg.status_report.status[29].component); + + ck_assert_msg( + last_msg.msg.status_report.status[29].generic == 27, + "incorrect value for last_msg.msg.status_report.status[29].generic, " + "expected 27, is %d", + last_msg.msg.status_report.status[29].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[29].specific == 73, + "incorrect value for last_msg.msg.status_report.status[29].specific, " + "expected 73, is %d", + last_msg.msg.status_report.status[29].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[30].component == 16574, + "incorrect value for last_msg.msg.status_report.status[30].component, " + "expected 16574, is %d", + last_msg.msg.status_report.status[30].component); + + ck_assert_msg( + last_msg.msg.status_report.status[30].generic == 179, + "incorrect value for last_msg.msg.status_report.status[30].generic, " + "expected 179, is %d", + last_msg.msg.status_report.status[30].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[30].specific == 146, + "incorrect value for last_msg.msg.status_report.status[30].specific, " + "expected 146, is %d", + last_msg.msg.status_report.status[30].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[31].component == 39293, + "incorrect value for last_msg.msg.status_report.status[31].component, " + "expected 39293, is %d", + last_msg.msg.status_report.status[31].component); + + ck_assert_msg( + last_msg.msg.status_report.status[31].generic == 192, + "incorrect value for last_msg.msg.status_report.status[31].generic, " + "expected 192, is %d", + last_msg.msg.status_report.status[31].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[31].specific == 46, + "incorrect value for last_msg.msg.status_report.status[31].specific, " + "expected 46, is %d", + last_msg.msg.status_report.status[31].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[32].component == 17098, + "incorrect value for last_msg.msg.status_report.status[32].component, " + "expected 17098, is %d", + last_msg.msg.status_report.status[32].component); + + ck_assert_msg( + last_msg.msg.status_report.status[32].generic == 248, + "incorrect value for last_msg.msg.status_report.status[32].generic, " + "expected 248, is %d", + last_msg.msg.status_report.status[32].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[32].specific == 46, + "incorrect value for last_msg.msg.status_report.status[32].specific, " + "expected 46, is %d", + last_msg.msg.status_report.status[32].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[33].component == 41256, + "incorrect value for last_msg.msg.status_report.status[33].component, " + "expected 41256, is %d", + last_msg.msg.status_report.status[33].component); + + ck_assert_msg( + last_msg.msg.status_report.status[33].generic == 173, + "incorrect value for last_msg.msg.status_report.status[33].generic, " + "expected 173, is %d", + last_msg.msg.status_report.status[33].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[33].specific == 242, + "incorrect value for last_msg.msg.status_report.status[33].specific, " + "expected 242, is %d", + last_msg.msg.status_report.status[33].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[34].component == 982, + "incorrect value for last_msg.msg.status_report.status[34].component, " + "expected 982, is %d", + last_msg.msg.status_report.status[34].component); + + ck_assert_msg( + last_msg.msg.status_report.status[34].generic == 11, + "incorrect value for last_msg.msg.status_report.status[34].generic, " + "expected 11, is %d", + last_msg.msg.status_report.status[34].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[34].specific == 1, + "incorrect value for last_msg.msg.status_report.status[34].specific, " + "expected 1, is %d", + last_msg.msg.status_report.status[34].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[35].component == 18038, + "incorrect value for last_msg.msg.status_report.status[35].component, " + "expected 18038, is %d", + last_msg.msg.status_report.status[35].component); + + ck_assert_msg( + last_msg.msg.status_report.status[35].generic == 162, + "incorrect value for last_msg.msg.status_report.status[35].generic, " + "expected 162, is %d", + last_msg.msg.status_report.status[35].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[35].specific == 61, + "incorrect value for last_msg.msg.status_report.status[35].specific, " + "expected 61, is %d", + last_msg.msg.status_report.status[35].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[36].component == 7090, + "incorrect value for last_msg.msg.status_report.status[36].component, " + "expected 7090, is %d", + last_msg.msg.status_report.status[36].component); + + ck_assert_msg( + last_msg.msg.status_report.status[36].generic == 156, + "incorrect value for last_msg.msg.status_report.status[36].generic, " + "expected 156, is %d", + last_msg.msg.status_report.status[36].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[36].specific == 40, + "incorrect value for last_msg.msg.status_report.status[36].specific, " + "expected 40, is %d", + last_msg.msg.status_report.status[36].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[37].component == 29119, + "incorrect value for last_msg.msg.status_report.status[37].component, " + "expected 29119, is %d", + last_msg.msg.status_report.status[37].component); + + ck_assert_msg( + last_msg.msg.status_report.status[37].generic == 230, + "incorrect value for last_msg.msg.status_report.status[37].generic, " + "expected 230, is %d", + last_msg.msg.status_report.status[37].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[37].specific == 200, + "incorrect value for last_msg.msg.status_report.status[37].specific, " + "expected 200, is %d", + last_msg.msg.status_report.status[37].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[38].component == 2120, + "incorrect value for last_msg.msg.status_report.status[38].component, " + "expected 2120, is %d", + last_msg.msg.status_report.status[38].component); + + ck_assert_msg( + last_msg.msg.status_report.status[38].generic == 215, + "incorrect value for last_msg.msg.status_report.status[38].generic, " + "expected 215, is %d", + last_msg.msg.status_report.status[38].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[38].specific == 245, + "incorrect value for last_msg.msg.status_report.status[38].specific, " + "expected 245, is %d", + last_msg.msg.status_report.status[38].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[39].component == 15182, + "incorrect value for last_msg.msg.status_report.status[39].component, " + "expected 15182, is %d", + last_msg.msg.status_report.status[39].component); + + ck_assert_msg( + last_msg.msg.status_report.status[39].generic == 222, + "incorrect value for last_msg.msg.status_report.status[39].generic, " + "expected 222, is %d", + last_msg.msg.status_report.status[39].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[39].specific == 250, + "incorrect value for last_msg.msg.status_report.status[39].specific, " + "expected 250, is %d", + last_msg.msg.status_report.status[39].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[40].component == 8307, + "incorrect value for last_msg.msg.status_report.status[40].component, " + "expected 8307, is %d", + last_msg.msg.status_report.status[40].component); + + ck_assert_msg( + last_msg.msg.status_report.status[40].generic == 33, + "incorrect value for last_msg.msg.status_report.status[40].generic, " + "expected 33, is %d", + last_msg.msg.status_report.status[40].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[40].specific == 30, + "incorrect value for last_msg.msg.status_report.status[40].specific, " + "expected 30, is %d", + last_msg.msg.status_report.status[40].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[41].component == 43731, + "incorrect value for last_msg.msg.status_report.status[41].component, " + "expected 43731, is %d", + last_msg.msg.status_report.status[41].component); + + ck_assert_msg( + last_msg.msg.status_report.status[41].generic == 145, + "incorrect value for last_msg.msg.status_report.status[41].generic, " + "expected 145, is %d", + last_msg.msg.status_report.status[41].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[41].specific == 92, + "incorrect value for last_msg.msg.status_report.status[41].specific, " + "expected 92, is %d", + last_msg.msg.status_report.status[41].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[42].component == 19357, + "incorrect value for last_msg.msg.status_report.status[42].component, " + "expected 19357, is %d", + last_msg.msg.status_report.status[42].component); + + ck_assert_msg( + last_msg.msg.status_report.status[42].generic == 24, + "incorrect value for last_msg.msg.status_report.status[42].generic, " + "expected 24, is %d", + last_msg.msg.status_report.status[42].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[42].specific == 169, + "incorrect value for last_msg.msg.status_report.status[42].specific, " + "expected 169, is %d", + last_msg.msg.status_report.status[42].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[43].component == 14086, + "incorrect value for last_msg.msg.status_report.status[43].component, " + "expected 14086, is %d", + last_msg.msg.status_report.status[43].component); + + ck_assert_msg( + last_msg.msg.status_report.status[43].generic == 62, + "incorrect value for last_msg.msg.status_report.status[43].generic, " + "expected 62, is %d", + last_msg.msg.status_report.status[43].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[43].specific == 8, + "incorrect value for last_msg.msg.status_report.status[43].specific, " + "expected 8, is %d", + last_msg.msg.status_report.status[43].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[44].component == 21099, + "incorrect value for last_msg.msg.status_report.status[44].component, " + "expected 21099, is %d", + last_msg.msg.status_report.status[44].component); + + ck_assert_msg( + last_msg.msg.status_report.status[44].generic == 140, + "incorrect value for last_msg.msg.status_report.status[44].generic, " + "expected 140, is %d", + last_msg.msg.status_report.status[44].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[44].specific == 49, + "incorrect value for last_msg.msg.status_report.status[44].specific, " + "expected 49, is %d", + last_msg.msg.status_report.status[44].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[45].component == 31411, + "incorrect value for last_msg.msg.status_report.status[45].component, " + "expected 31411, is %d", + last_msg.msg.status_report.status[45].component); + + ck_assert_msg( + last_msg.msg.status_report.status[45].generic == 90, + "incorrect value for last_msg.msg.status_report.status[45].generic, " + "expected 90, is %d", + last_msg.msg.status_report.status[45].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[45].specific == 71, + "incorrect value for last_msg.msg.status_report.status[45].specific, " + "expected 71, is %d", + last_msg.msg.status_report.status[45].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[46].component == 22556, + "incorrect value for last_msg.msg.status_report.status[46].component, " + "expected 22556, is %d", + last_msg.msg.status_report.status[46].component); + + ck_assert_msg( + last_msg.msg.status_report.status[46].generic == 103, + "incorrect value for last_msg.msg.status_report.status[46].generic, " + "expected 103, is %d", + last_msg.msg.status_report.status[46].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[46].specific == 51, + "incorrect value for last_msg.msg.status_report.status[46].specific, " + "expected 51, is %d", + last_msg.msg.status_report.status[46].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[47].component == 18609, + "incorrect value for last_msg.msg.status_report.status[47].component, " + "expected 18609, is %d", + last_msg.msg.status_report.status[47].component); + + ck_assert_msg( + last_msg.msg.status_report.status[47].generic == 93, + "incorrect value for last_msg.msg.status_report.status[47].generic, " + "expected 93, is %d", + last_msg.msg.status_report.status[47].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[47].specific == 39, + "incorrect value for last_msg.msg.status_report.status[47].specific, " + "expected 39, is %d", + last_msg.msg.status_report.status[47].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[48].component == 2964, + "incorrect value for last_msg.msg.status_report.status[48].component, " + "expected 2964, is %d", + last_msg.msg.status_report.status[48].component); + + ck_assert_msg( + last_msg.msg.status_report.status[48].generic == 202, + "incorrect value for last_msg.msg.status_report.status[48].generic, " + "expected 202, is %d", + last_msg.msg.status_report.status[48].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[48].specific == 42, + "incorrect value for last_msg.msg.status_report.status[48].specific, " + "expected 42, is %d", + last_msg.msg.status_report.status[48].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[49].component == 23586, + "incorrect value for last_msg.msg.status_report.status[49].component, " + "expected 23586, is %d", + last_msg.msg.status_report.status[49].component); + + ck_assert_msg( + last_msg.msg.status_report.status[49].generic == 204, + "incorrect value for last_msg.msg.status_report.status[49].generic, " + "expected 204, is %d", + last_msg.msg.status_report.status[49].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[49].specific == 102, + "incorrect value for last_msg.msg.status_report.status[49].specific, " + "expected 102, is %d", + last_msg.msg.status_report.status[49].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[50].component == 25117, + "incorrect value for last_msg.msg.status_report.status[50].component, " + "expected 25117, is %d", + last_msg.msg.status_report.status[50].component); + + ck_assert_msg( + last_msg.msg.status_report.status[50].generic == 249, + "incorrect value for last_msg.msg.status_report.status[50].generic, " + "expected 249, is %d", + last_msg.msg.status_report.status[50].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[50].specific == 91, + "incorrect value for last_msg.msg.status_report.status[50].specific, " + "expected 91, is %d", + last_msg.msg.status_report.status[50].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[51].component == 24454, + "incorrect value for last_msg.msg.status_report.status[51].component, " + "expected 24454, is %d", + last_msg.msg.status_report.status[51].component); + + ck_assert_msg( + last_msg.msg.status_report.status[51].generic == 23, + "incorrect value for last_msg.msg.status_report.status[51].generic, " + "expected 23, is %d", + last_msg.msg.status_report.status[51].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[51].specific == 248, + "incorrect value for last_msg.msg.status_report.status[51].specific, " + "expected 248, is %d", + last_msg.msg.status_report.status[51].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[52].component == 5312, + "incorrect value for last_msg.msg.status_report.status[52].component, " + "expected 5312, is %d", + last_msg.msg.status_report.status[52].component); + + ck_assert_msg( + last_msg.msg.status_report.status[52].generic == 83, + "incorrect value for last_msg.msg.status_report.status[52].generic, " + "expected 83, is %d", + last_msg.msg.status_report.status[52].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[52].specific == 195, + "incorrect value for last_msg.msg.status_report.status[52].specific, " + "expected 195, is %d", + last_msg.msg.status_report.status[52].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[53].component == 46175, + "incorrect value for last_msg.msg.status_report.status[53].component, " + "expected 46175, is %d", + last_msg.msg.status_report.status[53].component); + + ck_assert_msg( + last_msg.msg.status_report.status[53].generic == 54, + "incorrect value for last_msg.msg.status_report.status[53].generic, " + "expected 54, is %d", + last_msg.msg.status_report.status[53].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[53].specific == 36, + "incorrect value for last_msg.msg.status_report.status[53].specific, " + "expected 36, is %d", + last_msg.msg.status_report.status[53].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[54].component == 19386, + "incorrect value for last_msg.msg.status_report.status[54].component, " + "expected 19386, is %d", + last_msg.msg.status_report.status[54].component); + + ck_assert_msg( + last_msg.msg.status_report.status[54].generic == 64, + "incorrect value for last_msg.msg.status_report.status[54].generic, " + "expected 64, is %d", + last_msg.msg.status_report.status[54].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[54].specific == 20, + "incorrect value for last_msg.msg.status_report.status[54].specific, " + "expected 20, is %d", + last_msg.msg.status_report.status[54].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[55].component == 34205, + "incorrect value for last_msg.msg.status_report.status[55].component, " + "expected 34205, is %d", + last_msg.msg.status_report.status[55].component); + + ck_assert_msg( + last_msg.msg.status_report.status[55].generic == 12, + "incorrect value for last_msg.msg.status_report.status[55].generic, " + "expected 12, is %d", + last_msg.msg.status_report.status[55].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[55].specific == 149, + "incorrect value for last_msg.msg.status_report.status[55].specific, " + "expected 149, is %d", + last_msg.msg.status_report.status[55].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[56].component == 3612, + "incorrect value for last_msg.msg.status_report.status[56].component, " + "expected 3612, is %d", + last_msg.msg.status_report.status[56].component); + + ck_assert_msg( + last_msg.msg.status_report.status[56].generic == 185, + "incorrect value for last_msg.msg.status_report.status[56].generic, " + "expected 185, is %d", + last_msg.msg.status_report.status[56].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[56].specific == 129, + "incorrect value for last_msg.msg.status_report.status[56].specific, " + "expected 129, is %d", + last_msg.msg.status_report.status[56].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[57].component == 61285, + "incorrect value for last_msg.msg.status_report.status[57].component, " + "expected 61285, is %d", + last_msg.msg.status_report.status[57].component); + + ck_assert_msg( + last_msg.msg.status_report.status[57].generic == 74, + "incorrect value for last_msg.msg.status_report.status[57].generic, " + "expected 74, is %d", + last_msg.msg.status_report.status[57].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[57].specific == 248, + "incorrect value for last_msg.msg.status_report.status[57].specific, " + "expected 248, is %d", + last_msg.msg.status_report.status[57].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[58].component == 7925, + "incorrect value for last_msg.msg.status_report.status[58].component, " + "expected 7925, is %d", + last_msg.msg.status_report.status[58].component); + + ck_assert_msg( + last_msg.msg.status_report.status[58].generic == 228, + "incorrect value for last_msg.msg.status_report.status[58].generic, " + "expected 228, is %d", + last_msg.msg.status_report.status[58].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[58].specific == 88, + "incorrect value for last_msg.msg.status_report.status[58].specific, " + "expected 88, is %d", + last_msg.msg.status_report.status[58].specific); + + ck_assert_msg( + last_msg.msg.status_report.status[59].component == 54414, + "incorrect value for last_msg.msg.status_report.status[59].component, " + "expected 54414, is %d", + last_msg.msg.status_report.status[59].component); + + ck_assert_msg( + last_msg.msg.status_report.status[59].generic == 53, + "incorrect value for last_msg.msg.status_report.status[59].generic, " + "expected 53, is %d", + last_msg.msg.status_report.status[59].generic); + + ck_assert_msg( + last_msg.msg.status_report.status[59].specific == 224, + "incorrect value for last_msg.msg.status_report.status[59].specific, " + "expected 224, is %d", + last_msg.msg.status_report.status[59].specific); + + ck_assert_msg(last_msg.msg.status_report.uptime == 1657804265, + "incorrect value for last_msg.msg.status_report.uptime, " + "expected 1657804265, is %d", + last_msg.msg.status_report.uptime); } } END_TEST -Suite* auto_check_sbp_system_MsgStatusReport_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_system_MsgStatusReport"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_system_MsgStatusReport"); +Suite *auto_check_sbp_system_MsgStatusReport_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_system_MsgStatusReport"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_system_MsgStatusReport"); tcase_add_test(tc_acq, test_auto_check_sbp_system_MsgStatusReport); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_telemetry_MsgTelSv.c b/c/test/auto_check_sbp_telemetry_MsgTelSv.c index c7384bfda..6e98bf621 100644 --- a/c/test/auto_check_sbp_telemetry_MsgTelSv.c +++ b/c/test/auto_check_sbp_telemetry_MsgTelSv.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/telemetry/test_MsgTelSv.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/telemetry/test_MsgTelSv.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_telemetry_MsgTelSv ) -{ +START_TEST(test_auto_check_sbp_telemetry_MsgTelSv) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_telemetry_MsgTelSv ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,108 +90,160 @@ START_TEST( test_auto_check_sbp_telemetry_MsgTelSv ) logging_reset(); - sbp_callback_register(&sbp_state, 0x120, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x120, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,32,1,148,38,20,175,8,208,221,62,24,16,1,40,50,5,226,255,1,0,1,1,1,33,12,39,105, }; + u8 encoded_frame[] = { + 85, 32, 1, 148, 38, 20, 175, 8, 208, 221, 62, 24, 16, 1, + 40, 50, 5, 226, 255, 1, 0, 1, 1, 1, 33, 12, 39, 105, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.tel_sv.n_obs = 16; - + test_msg.tel_sv.n_sv_tel = 1; - + test_msg.tel_sv.origin_flags = 1; - - - + test_msg.tel_sv.sv_tel[0].availability_flags = 5; - + test_msg.tel_sv.sv_tel[0].az = 40; - + test_msg.tel_sv.sv_tel[0].correction_flags = 1; - + test_msg.tel_sv.sv_tel[0].el = 50; - + test_msg.tel_sv.sv_tel[0].ephemeris_flags = 1; - + test_msg.tel_sv.sv_tel[0].outlier_flags = 1; - + test_msg.tel_sv.sv_tel[0].phase_residual = 1; - + test_msg.tel_sv.sv_tel[0].pseudorange_residual = -30; - - + test_msg.tel_sv.sv_tel[0].sid.code = 12; - + test_msg.tel_sv.sv_tel[0].sid.sat = 33; - + test_msg.tel_sv.tow = 406773200; - + test_msg.tel_sv.wn = 2223; sbp_message_send(&sbp_state, SbpMsgTelSv, 9876, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 9876, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(sbp_message_cmp(SbpMsgTelSv, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.tel_sv.n_obs == 16, "incorrect value for last_msg.msg.tel_sv.n_obs, expected 16, is %d", last_msg.msg.tel_sv.n_obs); - - ck_assert_msg(last_msg.msg.tel_sv.n_sv_tel == 1, "incorrect value for last_msg.msg.tel_sv.n_sv_tel, expected 1, is %d", last_msg.msg.tel_sv.n_sv_tel); - - ck_assert_msg(last_msg.msg.tel_sv.origin_flags == 1, "incorrect value for last_msg.msg.tel_sv.origin_flags, expected 1, is %d", last_msg.msg.tel_sv.origin_flags); - - - ck_assert_msg(last_msg.msg.tel_sv.sv_tel[0].availability_flags == 5, "incorrect value for last_msg.msg.tel_sv.sv_tel[0].availability_flags, expected 5, is %d", last_msg.msg.tel_sv.sv_tel[0].availability_flags); - - ck_assert_msg(last_msg.msg.tel_sv.sv_tel[0].az == 40, "incorrect value for last_msg.msg.tel_sv.sv_tel[0].az, expected 40, is %d", last_msg.msg.tel_sv.sv_tel[0].az); - - ck_assert_msg(last_msg.msg.tel_sv.sv_tel[0].correction_flags == 1, "incorrect value for last_msg.msg.tel_sv.sv_tel[0].correction_flags, expected 1, is %d", last_msg.msg.tel_sv.sv_tel[0].correction_flags); - - ck_assert_msg(last_msg.msg.tel_sv.sv_tel[0].el == 50, "incorrect value for last_msg.msg.tel_sv.sv_tel[0].el, expected 50, is %d", last_msg.msg.tel_sv.sv_tel[0].el); - - ck_assert_msg(last_msg.msg.tel_sv.sv_tel[0].ephemeris_flags == 1, "incorrect value for last_msg.msg.tel_sv.sv_tel[0].ephemeris_flags, expected 1, is %d", last_msg.msg.tel_sv.sv_tel[0].ephemeris_flags); - - ck_assert_msg(last_msg.msg.tel_sv.sv_tel[0].outlier_flags == 1, "incorrect value for last_msg.msg.tel_sv.sv_tel[0].outlier_flags, expected 1, is %d", last_msg.msg.tel_sv.sv_tel[0].outlier_flags); - - ck_assert_msg(last_msg.msg.tel_sv.sv_tel[0].phase_residual == 1, "incorrect value for last_msg.msg.tel_sv.sv_tel[0].phase_residual, expected 1, is %d", last_msg.msg.tel_sv.sv_tel[0].phase_residual); - - ck_assert_msg(last_msg.msg.tel_sv.sv_tel[0].pseudorange_residual == -30, "incorrect value for last_msg.msg.tel_sv.sv_tel[0].pseudorange_residual, expected -30, is %d", last_msg.msg.tel_sv.sv_tel[0].pseudorange_residual); - - - ck_assert_msg(last_msg.msg.tel_sv.sv_tel[0].sid.code == 12, "incorrect value for last_msg.msg.tel_sv.sv_tel[0].sid.code, expected 12, is %d", last_msg.msg.tel_sv.sv_tel[0].sid.code); - - ck_assert_msg(last_msg.msg.tel_sv.sv_tel[0].sid.sat == 33, "incorrect value for last_msg.msg.tel_sv.sv_tel[0].sid.sat, expected 33, is %d", last_msg.msg.tel_sv.sv_tel[0].sid.sat); - - ck_assert_msg(last_msg.msg.tel_sv.tow == 406773200, "incorrect value for last_msg.msg.tel_sv.tow, expected 406773200, is %d", last_msg.msg.tel_sv.tow); - - ck_assert_msg(last_msg.msg.tel_sv.wn == 2223, "incorrect value for last_msg.msg.tel_sv.wn, expected 2223, is %d", last_msg.msg.tel_sv.wn); - + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.tel_sv.n_obs == 16, + "incorrect value for last_msg.msg.tel_sv.n_obs, expected 16, is %d", + last_msg.msg.tel_sv.n_obs); + + ck_assert_msg( + last_msg.msg.tel_sv.n_sv_tel == 1, + "incorrect value for last_msg.msg.tel_sv.n_sv_tel, expected 1, is %d", + last_msg.msg.tel_sv.n_sv_tel); + + ck_assert_msg(last_msg.msg.tel_sv.origin_flags == 1, + "incorrect value for last_msg.msg.tel_sv.origin_flags, " + "expected 1, is %d", + last_msg.msg.tel_sv.origin_flags); + + ck_assert_msg( + last_msg.msg.tel_sv.sv_tel[0].availability_flags == 5, + "incorrect value for last_msg.msg.tel_sv.sv_tel[0].availability_flags, " + "expected 5, is %d", + last_msg.msg.tel_sv.sv_tel[0].availability_flags); + + ck_assert_msg(last_msg.msg.tel_sv.sv_tel[0].az == 40, + "incorrect value for last_msg.msg.tel_sv.sv_tel[0].az, " + "expected 40, is %d", + last_msg.msg.tel_sv.sv_tel[0].az); + + ck_assert_msg( + last_msg.msg.tel_sv.sv_tel[0].correction_flags == 1, + "incorrect value for last_msg.msg.tel_sv.sv_tel[0].correction_flags, " + "expected 1, is %d", + last_msg.msg.tel_sv.sv_tel[0].correction_flags); + + ck_assert_msg(last_msg.msg.tel_sv.sv_tel[0].el == 50, + "incorrect value for last_msg.msg.tel_sv.sv_tel[0].el, " + "expected 50, is %d", + last_msg.msg.tel_sv.sv_tel[0].el); + + ck_assert_msg( + last_msg.msg.tel_sv.sv_tel[0].ephemeris_flags == 1, + "incorrect value for last_msg.msg.tel_sv.sv_tel[0].ephemeris_flags, " + "expected 1, is %d", + last_msg.msg.tel_sv.sv_tel[0].ephemeris_flags); + + ck_assert_msg( + last_msg.msg.tel_sv.sv_tel[0].outlier_flags == 1, + "incorrect value for last_msg.msg.tel_sv.sv_tel[0].outlier_flags, " + "expected 1, is %d", + last_msg.msg.tel_sv.sv_tel[0].outlier_flags); + + ck_assert_msg( + last_msg.msg.tel_sv.sv_tel[0].phase_residual == 1, + "incorrect value for last_msg.msg.tel_sv.sv_tel[0].phase_residual, " + "expected 1, is %d", + last_msg.msg.tel_sv.sv_tel[0].phase_residual); + + ck_assert_msg(last_msg.msg.tel_sv.sv_tel[0].pseudorange_residual == -30, + "incorrect value for " + "last_msg.msg.tel_sv.sv_tel[0].pseudorange_residual, " + "expected -30, is %d", + last_msg.msg.tel_sv.sv_tel[0].pseudorange_residual); + + ck_assert_msg(last_msg.msg.tel_sv.sv_tel[0].sid.code == 12, + "incorrect value for last_msg.msg.tel_sv.sv_tel[0].sid.code, " + "expected 12, is %d", + last_msg.msg.tel_sv.sv_tel[0].sid.code); + + ck_assert_msg(last_msg.msg.tel_sv.sv_tel[0].sid.sat == 33, + "incorrect value for last_msg.msg.tel_sv.sv_tel[0].sid.sat, " + "expected 33, is %d", + last_msg.msg.tel_sv.sv_tel[0].sid.sat); + + ck_assert_msg(last_msg.msg.tel_sv.tow == 406773200, + "incorrect value for last_msg.msg.tel_sv.tow, expected " + "406773200, is %d", + last_msg.msg.tel_sv.tow); + + ck_assert_msg( + last_msg.msg.tel_sv.wn == 2223, + "incorrect value for last_msg.msg.tel_sv.wn, expected 2223, is %d", + last_msg.msg.tel_sv.wn); } } END_TEST -Suite* auto_check_sbp_telemetry_MsgTelSv_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_telemetry_MsgTelSv"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_telemetry_MsgTelSv"); +Suite *auto_check_sbp_telemetry_MsgTelSv_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_telemetry_MsgTelSv"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_telemetry_MsgTelSv"); tcase_add_test(tc_acq, test_auto_check_sbp_telemetry_MsgTelSv); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_tracking_MsgMeasurementState.c b/c/test/auto_check_sbp_tracking_MsgMeasurementState.c index a2f76a5b7..6d1c172ab 100644 --- a/c/test/auto_check_sbp_tracking_MsgMeasurementState.c +++ b/c/test/auto_check_sbp_tracking_MsgMeasurementState.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgMeasurementState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgMeasurementState.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_tracking_MsgMeasurementState ) -{ +START_TEST(test_auto_check_sbp_tracking_MsgMeasurementState) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_tracking_MsgMeasurementState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,1234 +90,1969 @@ START_TEST( test_auto_check_sbp_tracking_MsgMeasurementState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x61, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x61, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,97,0,207,121,237,29,0,162,0,0,0,0,0,0,27,0,201,20,0,168,32,0,184,15,0,187,0,0,0,18,0,210,16,0,167,0,0,0,23,0,213,10,0,223,0,0,0,0,0,0,0,0,0,0,0,0,131,2,202,27,1,192,15,1,165,29,1,146,32,1,170,18,1,201,0,0,0,0,0,0,0,0,0,23,1,212,10,1,205,0,0,0,96,3,230,0,0,0,101,3,214,103,3,212,104,3,209,106,3,157,102,3,230,0,0,0,0,0,0,101,4,189,96,4,207,106,4,164,104,4,193,0,0,0,102,4,208,0,0,0,27,12,212,29,12,161,32,12,216,30,12,216,20,12,178,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,14,203,0,0,0,5,14,158,4,14,194,11,14,192,9,14,207,0,0,0,0,0,0,0,0,0,9,20,218,5,20,176,36,20,217,11,20,200,4,20,205,0,0,0,0,0,0,35,54, }; + u8 encoded_frame[] = { + 85, 97, 0, 207, 121, 237, 29, 0, 162, 0, 0, 0, 0, 0, 0, + 27, 0, 201, 20, 0, 168, 32, 0, 184, 15, 0, 187, 0, 0, 0, + 18, 0, 210, 16, 0, 167, 0, 0, 0, 23, 0, 213, 10, 0, 223, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 2, 202, + 27, 1, 192, 15, 1, 165, 29, 1, 146, 32, 1, 170, 18, 1, 201, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 1, 212, 10, 1, 205, + 0, 0, 0, 96, 3, 230, 0, 0, 0, 101, 3, 214, 103, 3, 212, + 104, 3, 209, 106, 3, 157, 102, 3, 230, 0, 0, 0, 0, 0, 0, + 101, 4, 189, 96, 4, 207, 106, 4, 164, 104, 4, 193, 0, 0, 0, + 102, 4, 208, 0, 0, 0, 27, 12, 212, 29, 12, 161, 32, 12, 216, + 30, 12, 216, 20, 12, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 36, 14, 203, 0, 0, 0, 5, 14, 158, 4, 14, 194, 11, 14, 192, + 9, 14, 207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 20, 218, + 5, 20, 176, 36, 20, 217, 11, 20, 200, 4, 20, 205, 0, 0, 0, + 0, 0, 0, 35, 54, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.measurement_state.n_states = 79; - - - + test_msg.measurement_state.states[0].cn0 = 162; - - + test_msg.measurement_state.states[0].mesid.code = 0; - + test_msg.measurement_state.states[0].mesid.sat = 29; - - + test_msg.measurement_state.states[1].cn0 = 0; - - + test_msg.measurement_state.states[1].mesid.code = 0; - + test_msg.measurement_state.states[1].mesid.sat = 0; - - + test_msg.measurement_state.states[2].cn0 = 0; - - + test_msg.measurement_state.states[2].mesid.code = 0; - + test_msg.measurement_state.states[2].mesid.sat = 0; - - + test_msg.measurement_state.states[3].cn0 = 201; - - + test_msg.measurement_state.states[3].mesid.code = 0; - + test_msg.measurement_state.states[3].mesid.sat = 27; - - + test_msg.measurement_state.states[4].cn0 = 168; - - + test_msg.measurement_state.states[4].mesid.code = 0; - + test_msg.measurement_state.states[4].mesid.sat = 20; - - + test_msg.measurement_state.states[5].cn0 = 184; - - + test_msg.measurement_state.states[5].mesid.code = 0; - + test_msg.measurement_state.states[5].mesid.sat = 32; - - + test_msg.measurement_state.states[6].cn0 = 187; - - + test_msg.measurement_state.states[6].mesid.code = 0; - + test_msg.measurement_state.states[6].mesid.sat = 15; - - + test_msg.measurement_state.states[7].cn0 = 0; - - + test_msg.measurement_state.states[7].mesid.code = 0; - + test_msg.measurement_state.states[7].mesid.sat = 0; - - + test_msg.measurement_state.states[8].cn0 = 210; - - + test_msg.measurement_state.states[8].mesid.code = 0; - + test_msg.measurement_state.states[8].mesid.sat = 18; - - + test_msg.measurement_state.states[9].cn0 = 167; - - + test_msg.measurement_state.states[9].mesid.code = 0; - + test_msg.measurement_state.states[9].mesid.sat = 16; - - + test_msg.measurement_state.states[10].cn0 = 0; - - + test_msg.measurement_state.states[10].mesid.code = 0; - + test_msg.measurement_state.states[10].mesid.sat = 0; - - + test_msg.measurement_state.states[11].cn0 = 213; - - + test_msg.measurement_state.states[11].mesid.code = 0; - + test_msg.measurement_state.states[11].mesid.sat = 23; - - + test_msg.measurement_state.states[12].cn0 = 223; - - + test_msg.measurement_state.states[12].mesid.code = 0; - + test_msg.measurement_state.states[12].mesid.sat = 10; - - + test_msg.measurement_state.states[13].cn0 = 0; - - + test_msg.measurement_state.states[13].mesid.code = 0; - + test_msg.measurement_state.states[13].mesid.sat = 0; - - + test_msg.measurement_state.states[14].cn0 = 0; - - + test_msg.measurement_state.states[14].mesid.code = 0; - + test_msg.measurement_state.states[14].mesid.sat = 0; - - + test_msg.measurement_state.states[15].cn0 = 0; - - + test_msg.measurement_state.states[15].mesid.code = 0; - + test_msg.measurement_state.states[15].mesid.sat = 0; - - + test_msg.measurement_state.states[16].cn0 = 0; - - + test_msg.measurement_state.states[16].mesid.code = 0; - + test_msg.measurement_state.states[16].mesid.sat = 0; - - + test_msg.measurement_state.states[17].cn0 = 202; - - + test_msg.measurement_state.states[17].mesid.code = 2; - + test_msg.measurement_state.states[17].mesid.sat = 131; - - + test_msg.measurement_state.states[18].cn0 = 192; - - + test_msg.measurement_state.states[18].mesid.code = 1; - + test_msg.measurement_state.states[18].mesid.sat = 27; - - + test_msg.measurement_state.states[19].cn0 = 165; - - + test_msg.measurement_state.states[19].mesid.code = 1; - + test_msg.measurement_state.states[19].mesid.sat = 15; - - + test_msg.measurement_state.states[20].cn0 = 146; - - + test_msg.measurement_state.states[20].mesid.code = 1; - + test_msg.measurement_state.states[20].mesid.sat = 29; - - + test_msg.measurement_state.states[21].cn0 = 170; - - + test_msg.measurement_state.states[21].mesid.code = 1; - + test_msg.measurement_state.states[21].mesid.sat = 32; - - + test_msg.measurement_state.states[22].cn0 = 201; - - + test_msg.measurement_state.states[22].mesid.code = 1; - + test_msg.measurement_state.states[22].mesid.sat = 18; - - + test_msg.measurement_state.states[23].cn0 = 0; - - + test_msg.measurement_state.states[23].mesid.code = 0; - + test_msg.measurement_state.states[23].mesid.sat = 0; - - + test_msg.measurement_state.states[24].cn0 = 0; - - + test_msg.measurement_state.states[24].mesid.code = 0; - + test_msg.measurement_state.states[24].mesid.sat = 0; - - + test_msg.measurement_state.states[25].cn0 = 0; - - + test_msg.measurement_state.states[25].mesid.code = 0; - + test_msg.measurement_state.states[25].mesid.sat = 0; - - + test_msg.measurement_state.states[26].cn0 = 212; - - + test_msg.measurement_state.states[26].mesid.code = 1; - + test_msg.measurement_state.states[26].mesid.sat = 23; - - + test_msg.measurement_state.states[27].cn0 = 205; - - + test_msg.measurement_state.states[27].mesid.code = 1; - + test_msg.measurement_state.states[27].mesid.sat = 10; - - + test_msg.measurement_state.states[28].cn0 = 0; - - + test_msg.measurement_state.states[28].mesid.code = 0; - + test_msg.measurement_state.states[28].mesid.sat = 0; - - + test_msg.measurement_state.states[29].cn0 = 230; - - + test_msg.measurement_state.states[29].mesid.code = 3; - + test_msg.measurement_state.states[29].mesid.sat = 96; - - + test_msg.measurement_state.states[30].cn0 = 0; - - + test_msg.measurement_state.states[30].mesid.code = 0; - + test_msg.measurement_state.states[30].mesid.sat = 0; - - + test_msg.measurement_state.states[31].cn0 = 214; - - + test_msg.measurement_state.states[31].mesid.code = 3; - + test_msg.measurement_state.states[31].mesid.sat = 101; - - + test_msg.measurement_state.states[32].cn0 = 212; - - + test_msg.measurement_state.states[32].mesid.code = 3; - + test_msg.measurement_state.states[32].mesid.sat = 103; - - + test_msg.measurement_state.states[33].cn0 = 209; - - + test_msg.measurement_state.states[33].mesid.code = 3; - + test_msg.measurement_state.states[33].mesid.sat = 104; - - + test_msg.measurement_state.states[34].cn0 = 157; - - + test_msg.measurement_state.states[34].mesid.code = 3; - + test_msg.measurement_state.states[34].mesid.sat = 106; - - + test_msg.measurement_state.states[35].cn0 = 230; - - + test_msg.measurement_state.states[35].mesid.code = 3; - + test_msg.measurement_state.states[35].mesid.sat = 102; - - + test_msg.measurement_state.states[36].cn0 = 0; - - + test_msg.measurement_state.states[36].mesid.code = 0; - + test_msg.measurement_state.states[36].mesid.sat = 0; - - + test_msg.measurement_state.states[37].cn0 = 0; - - + test_msg.measurement_state.states[37].mesid.code = 0; - + test_msg.measurement_state.states[37].mesid.sat = 0; - - + test_msg.measurement_state.states[38].cn0 = 189; - - + test_msg.measurement_state.states[38].mesid.code = 4; - + test_msg.measurement_state.states[38].mesid.sat = 101; - - + test_msg.measurement_state.states[39].cn0 = 207; - - + test_msg.measurement_state.states[39].mesid.code = 4; - + test_msg.measurement_state.states[39].mesid.sat = 96; - - + test_msg.measurement_state.states[40].cn0 = 164; - - + test_msg.measurement_state.states[40].mesid.code = 4; - + test_msg.measurement_state.states[40].mesid.sat = 106; - - + test_msg.measurement_state.states[41].cn0 = 193; - - + test_msg.measurement_state.states[41].mesid.code = 4; - + test_msg.measurement_state.states[41].mesid.sat = 104; - - + test_msg.measurement_state.states[42].cn0 = 0; - - + test_msg.measurement_state.states[42].mesid.code = 0; - + test_msg.measurement_state.states[42].mesid.sat = 0; - - + test_msg.measurement_state.states[43].cn0 = 208; - - + test_msg.measurement_state.states[43].mesid.code = 4; - + test_msg.measurement_state.states[43].mesid.sat = 102; - - + test_msg.measurement_state.states[44].cn0 = 0; - - + test_msg.measurement_state.states[44].mesid.code = 0; - + test_msg.measurement_state.states[44].mesid.sat = 0; - - + test_msg.measurement_state.states[45].cn0 = 212; - - + test_msg.measurement_state.states[45].mesid.code = 12; - + test_msg.measurement_state.states[45].mesid.sat = 27; - - + test_msg.measurement_state.states[46].cn0 = 161; - - + test_msg.measurement_state.states[46].mesid.code = 12; - + test_msg.measurement_state.states[46].mesid.sat = 29; - - + test_msg.measurement_state.states[47].cn0 = 216; - - + test_msg.measurement_state.states[47].mesid.code = 12; - + test_msg.measurement_state.states[47].mesid.sat = 32; - - + test_msg.measurement_state.states[48].cn0 = 216; - - + test_msg.measurement_state.states[48].mesid.code = 12; - + test_msg.measurement_state.states[48].mesid.sat = 30; - - + test_msg.measurement_state.states[49].cn0 = 178; - - + test_msg.measurement_state.states[49].mesid.code = 12; - + test_msg.measurement_state.states[49].mesid.sat = 20; - - + test_msg.measurement_state.states[50].cn0 = 0; - - + test_msg.measurement_state.states[50].mesid.code = 0; - + test_msg.measurement_state.states[50].mesid.sat = 0; - - + test_msg.measurement_state.states[51].cn0 = 0; - - + test_msg.measurement_state.states[51].mesid.code = 0; - + test_msg.measurement_state.states[51].mesid.sat = 0; - - + test_msg.measurement_state.states[52].cn0 = 0; - - + test_msg.measurement_state.states[52].mesid.code = 0; - + test_msg.measurement_state.states[52].mesid.sat = 0; - - + test_msg.measurement_state.states[53].cn0 = 0; - - + test_msg.measurement_state.states[53].mesid.code = 0; - + test_msg.measurement_state.states[53].mesid.sat = 0; - - + test_msg.measurement_state.states[54].cn0 = 0; - - + test_msg.measurement_state.states[54].mesid.code = 0; - + test_msg.measurement_state.states[54].mesid.sat = 0; - - + test_msg.measurement_state.states[55].cn0 = 0; - - + test_msg.measurement_state.states[55].mesid.code = 0; - + test_msg.measurement_state.states[55].mesid.sat = 0; - - + test_msg.measurement_state.states[56].cn0 = 0; - - + test_msg.measurement_state.states[56].mesid.code = 0; - + test_msg.measurement_state.states[56].mesid.sat = 0; - - + test_msg.measurement_state.states[57].cn0 = 0; - - + test_msg.measurement_state.states[57].mesid.code = 0; - + test_msg.measurement_state.states[57].mesid.sat = 0; - - + test_msg.measurement_state.states[58].cn0 = 0; - - + test_msg.measurement_state.states[58].mesid.code = 0; - + test_msg.measurement_state.states[58].mesid.sat = 0; - - + test_msg.measurement_state.states[59].cn0 = 0; - - + test_msg.measurement_state.states[59].mesid.code = 0; - + test_msg.measurement_state.states[59].mesid.sat = 0; - - + test_msg.measurement_state.states[60].cn0 = 0; - - + test_msg.measurement_state.states[60].mesid.code = 0; - + test_msg.measurement_state.states[60].mesid.sat = 0; - - + test_msg.measurement_state.states[61].cn0 = 0; - - + test_msg.measurement_state.states[61].mesid.code = 0; - + test_msg.measurement_state.states[61].mesid.sat = 0; - - + test_msg.measurement_state.states[62].cn0 = 0; - - + test_msg.measurement_state.states[62].mesid.code = 0; - + test_msg.measurement_state.states[62].mesid.sat = 0; - - + test_msg.measurement_state.states[63].cn0 = 203; - - + test_msg.measurement_state.states[63].mesid.code = 14; - + test_msg.measurement_state.states[63].mesid.sat = 36; - - + test_msg.measurement_state.states[64].cn0 = 0; - - + test_msg.measurement_state.states[64].mesid.code = 0; - + test_msg.measurement_state.states[64].mesid.sat = 0; - - + test_msg.measurement_state.states[65].cn0 = 158; - - + test_msg.measurement_state.states[65].mesid.code = 14; - + test_msg.measurement_state.states[65].mesid.sat = 5; - - + test_msg.measurement_state.states[66].cn0 = 194; - - + test_msg.measurement_state.states[66].mesid.code = 14; - + test_msg.measurement_state.states[66].mesid.sat = 4; - - + test_msg.measurement_state.states[67].cn0 = 192; - - + test_msg.measurement_state.states[67].mesid.code = 14; - + test_msg.measurement_state.states[67].mesid.sat = 11; - - + test_msg.measurement_state.states[68].cn0 = 207; - - + test_msg.measurement_state.states[68].mesid.code = 14; - + test_msg.measurement_state.states[68].mesid.sat = 9; - - + test_msg.measurement_state.states[69].cn0 = 0; - - + test_msg.measurement_state.states[69].mesid.code = 0; - + test_msg.measurement_state.states[69].mesid.sat = 0; - - + test_msg.measurement_state.states[70].cn0 = 0; - - + test_msg.measurement_state.states[70].mesid.code = 0; - + test_msg.measurement_state.states[70].mesid.sat = 0; - - + test_msg.measurement_state.states[71].cn0 = 0; - - + test_msg.measurement_state.states[71].mesid.code = 0; - + test_msg.measurement_state.states[71].mesid.sat = 0; - - + test_msg.measurement_state.states[72].cn0 = 218; - - + test_msg.measurement_state.states[72].mesid.code = 20; - + test_msg.measurement_state.states[72].mesid.sat = 9; - - + test_msg.measurement_state.states[73].cn0 = 176; - - + test_msg.measurement_state.states[73].mesid.code = 20; - + test_msg.measurement_state.states[73].mesid.sat = 5; - - + test_msg.measurement_state.states[74].cn0 = 217; - - + test_msg.measurement_state.states[74].mesid.code = 20; - + test_msg.measurement_state.states[74].mesid.sat = 36; - - + test_msg.measurement_state.states[75].cn0 = 200; - - + test_msg.measurement_state.states[75].mesid.code = 20; - + test_msg.measurement_state.states[75].mesid.sat = 11; - - + test_msg.measurement_state.states[76].cn0 = 205; - - + test_msg.measurement_state.states[76].mesid.code = 20; - + test_msg.measurement_state.states[76].mesid.sat = 4; - - + test_msg.measurement_state.states[77].cn0 = 0; - - + test_msg.measurement_state.states[77].mesid.code = 0; - + test_msg.measurement_state.states[77].mesid.sat = 0; - - + test_msg.measurement_state.states[78].cn0 = 0; - - + test_msg.measurement_state.states[78].mesid.code = 0; - + test_msg.measurement_state.states[78].mesid.sat = 0; - sbp_message_send(&sbp_state, SbpMsgMeasurementState, 31183, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgMeasurementState, 31183, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 31183, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgMeasurementState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgMeasurementState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.measurement_state.n_states == 79, "incorrect value for last_msg.msg.measurement_state.n_states, expected 79, is %d", last_msg.msg.measurement_state.n_states); - - - ck_assert_msg(last_msg.msg.measurement_state.states[0].cn0 == 162, "incorrect value for last_msg.msg.measurement_state.states[0].cn0, expected 162, is %d", last_msg.msg.measurement_state.states[0].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[0].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[0].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[0].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[0].mesid.sat == 29, "incorrect value for last_msg.msg.measurement_state.states[0].mesid.sat, expected 29, is %d", last_msg.msg.measurement_state.states[0].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[1].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[1].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[1].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[1].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[1].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[1].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[1].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[1].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[1].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[2].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[2].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[2].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[2].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[2].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[2].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[2].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[2].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[2].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[3].cn0 == 201, "incorrect value for last_msg.msg.measurement_state.states[3].cn0, expected 201, is %d", last_msg.msg.measurement_state.states[3].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[3].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[3].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[3].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[3].mesid.sat == 27, "incorrect value for last_msg.msg.measurement_state.states[3].mesid.sat, expected 27, is %d", last_msg.msg.measurement_state.states[3].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[4].cn0 == 168, "incorrect value for last_msg.msg.measurement_state.states[4].cn0, expected 168, is %d", last_msg.msg.measurement_state.states[4].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[4].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[4].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[4].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[4].mesid.sat == 20, "incorrect value for last_msg.msg.measurement_state.states[4].mesid.sat, expected 20, is %d", last_msg.msg.measurement_state.states[4].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[5].cn0 == 184, "incorrect value for last_msg.msg.measurement_state.states[5].cn0, expected 184, is %d", last_msg.msg.measurement_state.states[5].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[5].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[5].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[5].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[5].mesid.sat == 32, "incorrect value for last_msg.msg.measurement_state.states[5].mesid.sat, expected 32, is %d", last_msg.msg.measurement_state.states[5].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[6].cn0 == 187, "incorrect value for last_msg.msg.measurement_state.states[6].cn0, expected 187, is %d", last_msg.msg.measurement_state.states[6].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[6].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[6].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[6].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[6].mesid.sat == 15, "incorrect value for last_msg.msg.measurement_state.states[6].mesid.sat, expected 15, is %d", last_msg.msg.measurement_state.states[6].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[7].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[7].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[7].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[7].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[7].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[7].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[7].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[7].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[7].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[8].cn0 == 210, "incorrect value for last_msg.msg.measurement_state.states[8].cn0, expected 210, is %d", last_msg.msg.measurement_state.states[8].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[8].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[8].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[8].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[8].mesid.sat == 18, "incorrect value for last_msg.msg.measurement_state.states[8].mesid.sat, expected 18, is %d", last_msg.msg.measurement_state.states[8].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[9].cn0 == 167, "incorrect value for last_msg.msg.measurement_state.states[9].cn0, expected 167, is %d", last_msg.msg.measurement_state.states[9].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[9].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[9].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[9].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[9].mesid.sat == 16, "incorrect value for last_msg.msg.measurement_state.states[9].mesid.sat, expected 16, is %d", last_msg.msg.measurement_state.states[9].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[10].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[10].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[10].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[10].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[10].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[10].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[10].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[10].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[10].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[11].cn0 == 213, "incorrect value for last_msg.msg.measurement_state.states[11].cn0, expected 213, is %d", last_msg.msg.measurement_state.states[11].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[11].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[11].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[11].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[11].mesid.sat == 23, "incorrect value for last_msg.msg.measurement_state.states[11].mesid.sat, expected 23, is %d", last_msg.msg.measurement_state.states[11].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[12].cn0 == 223, "incorrect value for last_msg.msg.measurement_state.states[12].cn0, expected 223, is %d", last_msg.msg.measurement_state.states[12].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[12].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[12].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[12].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[12].mesid.sat == 10, "incorrect value for last_msg.msg.measurement_state.states[12].mesid.sat, expected 10, is %d", last_msg.msg.measurement_state.states[12].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[13].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[13].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[13].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[13].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[13].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[13].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[13].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[13].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[13].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[14].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[14].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[14].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[14].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[14].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[14].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[14].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[14].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[14].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[15].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[15].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[15].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[15].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[15].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[15].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[15].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[15].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[15].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[16].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[16].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[16].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[16].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[16].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[16].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[16].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[16].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[16].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[17].cn0 == 202, "incorrect value for last_msg.msg.measurement_state.states[17].cn0, expected 202, is %d", last_msg.msg.measurement_state.states[17].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[17].mesid.code == 2, "incorrect value for last_msg.msg.measurement_state.states[17].mesid.code, expected 2, is %d", last_msg.msg.measurement_state.states[17].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[17].mesid.sat == 131, "incorrect value for last_msg.msg.measurement_state.states[17].mesid.sat, expected 131, is %d", last_msg.msg.measurement_state.states[17].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[18].cn0 == 192, "incorrect value for last_msg.msg.measurement_state.states[18].cn0, expected 192, is %d", last_msg.msg.measurement_state.states[18].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[18].mesid.code == 1, "incorrect value for last_msg.msg.measurement_state.states[18].mesid.code, expected 1, is %d", last_msg.msg.measurement_state.states[18].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[18].mesid.sat == 27, "incorrect value for last_msg.msg.measurement_state.states[18].mesid.sat, expected 27, is %d", last_msg.msg.measurement_state.states[18].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[19].cn0 == 165, "incorrect value for last_msg.msg.measurement_state.states[19].cn0, expected 165, is %d", last_msg.msg.measurement_state.states[19].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[19].mesid.code == 1, "incorrect value for last_msg.msg.measurement_state.states[19].mesid.code, expected 1, is %d", last_msg.msg.measurement_state.states[19].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[19].mesid.sat == 15, "incorrect value for last_msg.msg.measurement_state.states[19].mesid.sat, expected 15, is %d", last_msg.msg.measurement_state.states[19].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[20].cn0 == 146, "incorrect value for last_msg.msg.measurement_state.states[20].cn0, expected 146, is %d", last_msg.msg.measurement_state.states[20].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[20].mesid.code == 1, "incorrect value for last_msg.msg.measurement_state.states[20].mesid.code, expected 1, is %d", last_msg.msg.measurement_state.states[20].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[20].mesid.sat == 29, "incorrect value for last_msg.msg.measurement_state.states[20].mesid.sat, expected 29, is %d", last_msg.msg.measurement_state.states[20].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[21].cn0 == 170, "incorrect value for last_msg.msg.measurement_state.states[21].cn0, expected 170, is %d", last_msg.msg.measurement_state.states[21].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[21].mesid.code == 1, "incorrect value for last_msg.msg.measurement_state.states[21].mesid.code, expected 1, is %d", last_msg.msg.measurement_state.states[21].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[21].mesid.sat == 32, "incorrect value for last_msg.msg.measurement_state.states[21].mesid.sat, expected 32, is %d", last_msg.msg.measurement_state.states[21].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[22].cn0 == 201, "incorrect value for last_msg.msg.measurement_state.states[22].cn0, expected 201, is %d", last_msg.msg.measurement_state.states[22].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[22].mesid.code == 1, "incorrect value for last_msg.msg.measurement_state.states[22].mesid.code, expected 1, is %d", last_msg.msg.measurement_state.states[22].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[22].mesid.sat == 18, "incorrect value for last_msg.msg.measurement_state.states[22].mesid.sat, expected 18, is %d", last_msg.msg.measurement_state.states[22].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[23].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[23].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[23].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[23].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[23].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[23].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[23].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[23].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[23].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[24].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[24].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[24].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[24].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[24].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[24].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[24].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[24].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[24].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[25].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[25].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[25].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[25].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[25].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[25].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[25].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[25].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[25].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[26].cn0 == 212, "incorrect value for last_msg.msg.measurement_state.states[26].cn0, expected 212, is %d", last_msg.msg.measurement_state.states[26].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[26].mesid.code == 1, "incorrect value for last_msg.msg.measurement_state.states[26].mesid.code, expected 1, is %d", last_msg.msg.measurement_state.states[26].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[26].mesid.sat == 23, "incorrect value for last_msg.msg.measurement_state.states[26].mesid.sat, expected 23, is %d", last_msg.msg.measurement_state.states[26].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[27].cn0 == 205, "incorrect value for last_msg.msg.measurement_state.states[27].cn0, expected 205, is %d", last_msg.msg.measurement_state.states[27].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[27].mesid.code == 1, "incorrect value for last_msg.msg.measurement_state.states[27].mesid.code, expected 1, is %d", last_msg.msg.measurement_state.states[27].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[27].mesid.sat == 10, "incorrect value for last_msg.msg.measurement_state.states[27].mesid.sat, expected 10, is %d", last_msg.msg.measurement_state.states[27].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[28].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[28].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[28].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[28].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[28].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[28].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[28].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[28].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[28].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[29].cn0 == 230, "incorrect value for last_msg.msg.measurement_state.states[29].cn0, expected 230, is %d", last_msg.msg.measurement_state.states[29].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[29].mesid.code == 3, "incorrect value for last_msg.msg.measurement_state.states[29].mesid.code, expected 3, is %d", last_msg.msg.measurement_state.states[29].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[29].mesid.sat == 96, "incorrect value for last_msg.msg.measurement_state.states[29].mesid.sat, expected 96, is %d", last_msg.msg.measurement_state.states[29].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[30].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[30].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[30].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[30].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[30].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[30].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[30].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[30].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[30].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[31].cn0 == 214, "incorrect value for last_msg.msg.measurement_state.states[31].cn0, expected 214, is %d", last_msg.msg.measurement_state.states[31].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[31].mesid.code == 3, "incorrect value for last_msg.msg.measurement_state.states[31].mesid.code, expected 3, is %d", last_msg.msg.measurement_state.states[31].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[31].mesid.sat == 101, "incorrect value for last_msg.msg.measurement_state.states[31].mesid.sat, expected 101, is %d", last_msg.msg.measurement_state.states[31].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[32].cn0 == 212, "incorrect value for last_msg.msg.measurement_state.states[32].cn0, expected 212, is %d", last_msg.msg.measurement_state.states[32].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[32].mesid.code == 3, "incorrect value for last_msg.msg.measurement_state.states[32].mesid.code, expected 3, is %d", last_msg.msg.measurement_state.states[32].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[32].mesid.sat == 103, "incorrect value for last_msg.msg.measurement_state.states[32].mesid.sat, expected 103, is %d", last_msg.msg.measurement_state.states[32].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[33].cn0 == 209, "incorrect value for last_msg.msg.measurement_state.states[33].cn0, expected 209, is %d", last_msg.msg.measurement_state.states[33].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[33].mesid.code == 3, "incorrect value for last_msg.msg.measurement_state.states[33].mesid.code, expected 3, is %d", last_msg.msg.measurement_state.states[33].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[33].mesid.sat == 104, "incorrect value for last_msg.msg.measurement_state.states[33].mesid.sat, expected 104, is %d", last_msg.msg.measurement_state.states[33].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[34].cn0 == 157, "incorrect value for last_msg.msg.measurement_state.states[34].cn0, expected 157, is %d", last_msg.msg.measurement_state.states[34].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[34].mesid.code == 3, "incorrect value for last_msg.msg.measurement_state.states[34].mesid.code, expected 3, is %d", last_msg.msg.measurement_state.states[34].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[34].mesid.sat == 106, "incorrect value for last_msg.msg.measurement_state.states[34].mesid.sat, expected 106, is %d", last_msg.msg.measurement_state.states[34].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[35].cn0 == 230, "incorrect value for last_msg.msg.measurement_state.states[35].cn0, expected 230, is %d", last_msg.msg.measurement_state.states[35].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[35].mesid.code == 3, "incorrect value for last_msg.msg.measurement_state.states[35].mesid.code, expected 3, is %d", last_msg.msg.measurement_state.states[35].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[35].mesid.sat == 102, "incorrect value for last_msg.msg.measurement_state.states[35].mesid.sat, expected 102, is %d", last_msg.msg.measurement_state.states[35].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[36].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[36].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[36].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[36].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[36].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[36].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[36].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[36].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[36].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[37].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[37].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[37].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[37].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[37].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[37].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[37].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[37].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[37].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[38].cn0 == 189, "incorrect value for last_msg.msg.measurement_state.states[38].cn0, expected 189, is %d", last_msg.msg.measurement_state.states[38].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[38].mesid.code == 4, "incorrect value for last_msg.msg.measurement_state.states[38].mesid.code, expected 4, is %d", last_msg.msg.measurement_state.states[38].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[38].mesid.sat == 101, "incorrect value for last_msg.msg.measurement_state.states[38].mesid.sat, expected 101, is %d", last_msg.msg.measurement_state.states[38].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[39].cn0 == 207, "incorrect value for last_msg.msg.measurement_state.states[39].cn0, expected 207, is %d", last_msg.msg.measurement_state.states[39].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[39].mesid.code == 4, "incorrect value for last_msg.msg.measurement_state.states[39].mesid.code, expected 4, is %d", last_msg.msg.measurement_state.states[39].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[39].mesid.sat == 96, "incorrect value for last_msg.msg.measurement_state.states[39].mesid.sat, expected 96, is %d", last_msg.msg.measurement_state.states[39].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[40].cn0 == 164, "incorrect value for last_msg.msg.measurement_state.states[40].cn0, expected 164, is %d", last_msg.msg.measurement_state.states[40].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[40].mesid.code == 4, "incorrect value for last_msg.msg.measurement_state.states[40].mesid.code, expected 4, is %d", last_msg.msg.measurement_state.states[40].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[40].mesid.sat == 106, "incorrect value for last_msg.msg.measurement_state.states[40].mesid.sat, expected 106, is %d", last_msg.msg.measurement_state.states[40].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[41].cn0 == 193, "incorrect value for last_msg.msg.measurement_state.states[41].cn0, expected 193, is %d", last_msg.msg.measurement_state.states[41].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[41].mesid.code == 4, "incorrect value for last_msg.msg.measurement_state.states[41].mesid.code, expected 4, is %d", last_msg.msg.measurement_state.states[41].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[41].mesid.sat == 104, "incorrect value for last_msg.msg.measurement_state.states[41].mesid.sat, expected 104, is %d", last_msg.msg.measurement_state.states[41].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[42].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[42].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[42].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[42].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[42].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[42].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[42].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[42].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[42].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[43].cn0 == 208, "incorrect value for last_msg.msg.measurement_state.states[43].cn0, expected 208, is %d", last_msg.msg.measurement_state.states[43].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[43].mesid.code == 4, "incorrect value for last_msg.msg.measurement_state.states[43].mesid.code, expected 4, is %d", last_msg.msg.measurement_state.states[43].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[43].mesid.sat == 102, "incorrect value for last_msg.msg.measurement_state.states[43].mesid.sat, expected 102, is %d", last_msg.msg.measurement_state.states[43].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[44].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[44].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[44].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[44].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[44].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[44].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[44].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[44].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[44].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[45].cn0 == 212, "incorrect value for last_msg.msg.measurement_state.states[45].cn0, expected 212, is %d", last_msg.msg.measurement_state.states[45].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[45].mesid.code == 12, "incorrect value for last_msg.msg.measurement_state.states[45].mesid.code, expected 12, is %d", last_msg.msg.measurement_state.states[45].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[45].mesid.sat == 27, "incorrect value for last_msg.msg.measurement_state.states[45].mesid.sat, expected 27, is %d", last_msg.msg.measurement_state.states[45].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[46].cn0 == 161, "incorrect value for last_msg.msg.measurement_state.states[46].cn0, expected 161, is %d", last_msg.msg.measurement_state.states[46].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[46].mesid.code == 12, "incorrect value for last_msg.msg.measurement_state.states[46].mesid.code, expected 12, is %d", last_msg.msg.measurement_state.states[46].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[46].mesid.sat == 29, "incorrect value for last_msg.msg.measurement_state.states[46].mesid.sat, expected 29, is %d", last_msg.msg.measurement_state.states[46].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[47].cn0 == 216, "incorrect value for last_msg.msg.measurement_state.states[47].cn0, expected 216, is %d", last_msg.msg.measurement_state.states[47].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[47].mesid.code == 12, "incorrect value for last_msg.msg.measurement_state.states[47].mesid.code, expected 12, is %d", last_msg.msg.measurement_state.states[47].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[47].mesid.sat == 32, "incorrect value for last_msg.msg.measurement_state.states[47].mesid.sat, expected 32, is %d", last_msg.msg.measurement_state.states[47].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[48].cn0 == 216, "incorrect value for last_msg.msg.measurement_state.states[48].cn0, expected 216, is %d", last_msg.msg.measurement_state.states[48].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[48].mesid.code == 12, "incorrect value for last_msg.msg.measurement_state.states[48].mesid.code, expected 12, is %d", last_msg.msg.measurement_state.states[48].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[48].mesid.sat == 30, "incorrect value for last_msg.msg.measurement_state.states[48].mesid.sat, expected 30, is %d", last_msg.msg.measurement_state.states[48].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[49].cn0 == 178, "incorrect value for last_msg.msg.measurement_state.states[49].cn0, expected 178, is %d", last_msg.msg.measurement_state.states[49].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[49].mesid.code == 12, "incorrect value for last_msg.msg.measurement_state.states[49].mesid.code, expected 12, is %d", last_msg.msg.measurement_state.states[49].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[49].mesid.sat == 20, "incorrect value for last_msg.msg.measurement_state.states[49].mesid.sat, expected 20, is %d", last_msg.msg.measurement_state.states[49].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[50].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[50].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[50].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[50].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[50].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[50].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[50].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[50].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[50].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[51].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[51].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[51].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[51].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[51].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[51].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[51].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[51].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[51].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[52].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[52].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[52].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[52].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[52].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[52].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[52].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[52].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[52].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[53].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[53].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[53].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[53].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[53].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[53].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[53].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[53].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[53].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[54].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[54].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[54].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[54].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[54].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[54].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[54].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[54].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[54].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[55].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[55].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[55].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[55].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[55].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[55].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[55].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[55].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[55].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[56].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[56].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[56].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[56].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[56].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[56].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[56].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[56].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[56].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[57].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[57].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[57].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[57].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[57].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[57].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[57].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[57].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[57].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[58].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[58].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[58].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[58].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[58].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[58].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[58].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[58].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[58].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[59].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[59].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[59].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[59].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[59].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[59].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[59].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[59].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[59].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[60].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[60].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[60].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[60].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[60].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[60].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[60].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[60].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[60].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[61].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[61].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[61].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[61].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[61].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[61].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[61].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[61].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[61].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[62].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[62].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[62].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[62].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[62].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[62].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[62].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[62].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[62].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[63].cn0 == 203, "incorrect value for last_msg.msg.measurement_state.states[63].cn0, expected 203, is %d", last_msg.msg.measurement_state.states[63].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[63].mesid.code == 14, "incorrect value for last_msg.msg.measurement_state.states[63].mesid.code, expected 14, is %d", last_msg.msg.measurement_state.states[63].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[63].mesid.sat == 36, "incorrect value for last_msg.msg.measurement_state.states[63].mesid.sat, expected 36, is %d", last_msg.msg.measurement_state.states[63].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[64].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[64].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[64].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[64].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[64].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[64].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[64].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[64].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[64].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[65].cn0 == 158, "incorrect value for last_msg.msg.measurement_state.states[65].cn0, expected 158, is %d", last_msg.msg.measurement_state.states[65].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[65].mesid.code == 14, "incorrect value for last_msg.msg.measurement_state.states[65].mesid.code, expected 14, is %d", last_msg.msg.measurement_state.states[65].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[65].mesid.sat == 5, "incorrect value for last_msg.msg.measurement_state.states[65].mesid.sat, expected 5, is %d", last_msg.msg.measurement_state.states[65].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[66].cn0 == 194, "incorrect value for last_msg.msg.measurement_state.states[66].cn0, expected 194, is %d", last_msg.msg.measurement_state.states[66].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[66].mesid.code == 14, "incorrect value for last_msg.msg.measurement_state.states[66].mesid.code, expected 14, is %d", last_msg.msg.measurement_state.states[66].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[66].mesid.sat == 4, "incorrect value for last_msg.msg.measurement_state.states[66].mesid.sat, expected 4, is %d", last_msg.msg.measurement_state.states[66].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[67].cn0 == 192, "incorrect value for last_msg.msg.measurement_state.states[67].cn0, expected 192, is %d", last_msg.msg.measurement_state.states[67].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[67].mesid.code == 14, "incorrect value for last_msg.msg.measurement_state.states[67].mesid.code, expected 14, is %d", last_msg.msg.measurement_state.states[67].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[67].mesid.sat == 11, "incorrect value for last_msg.msg.measurement_state.states[67].mesid.sat, expected 11, is %d", last_msg.msg.measurement_state.states[67].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[68].cn0 == 207, "incorrect value for last_msg.msg.measurement_state.states[68].cn0, expected 207, is %d", last_msg.msg.measurement_state.states[68].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[68].mesid.code == 14, "incorrect value for last_msg.msg.measurement_state.states[68].mesid.code, expected 14, is %d", last_msg.msg.measurement_state.states[68].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[68].mesid.sat == 9, "incorrect value for last_msg.msg.measurement_state.states[68].mesid.sat, expected 9, is %d", last_msg.msg.measurement_state.states[68].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[69].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[69].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[69].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[69].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[69].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[69].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[69].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[69].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[69].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[70].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[70].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[70].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[70].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[70].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[70].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[70].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[70].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[70].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[71].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[71].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[71].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[71].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[71].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[71].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[71].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[71].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[71].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[72].cn0 == 218, "incorrect value for last_msg.msg.measurement_state.states[72].cn0, expected 218, is %d", last_msg.msg.measurement_state.states[72].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[72].mesid.code == 20, "incorrect value for last_msg.msg.measurement_state.states[72].mesid.code, expected 20, is %d", last_msg.msg.measurement_state.states[72].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[72].mesid.sat == 9, "incorrect value for last_msg.msg.measurement_state.states[72].mesid.sat, expected 9, is %d", last_msg.msg.measurement_state.states[72].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[73].cn0 == 176, "incorrect value for last_msg.msg.measurement_state.states[73].cn0, expected 176, is %d", last_msg.msg.measurement_state.states[73].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[73].mesid.code == 20, "incorrect value for last_msg.msg.measurement_state.states[73].mesid.code, expected 20, is %d", last_msg.msg.measurement_state.states[73].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[73].mesid.sat == 5, "incorrect value for last_msg.msg.measurement_state.states[73].mesid.sat, expected 5, is %d", last_msg.msg.measurement_state.states[73].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[74].cn0 == 217, "incorrect value for last_msg.msg.measurement_state.states[74].cn0, expected 217, is %d", last_msg.msg.measurement_state.states[74].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[74].mesid.code == 20, "incorrect value for last_msg.msg.measurement_state.states[74].mesid.code, expected 20, is %d", last_msg.msg.measurement_state.states[74].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[74].mesid.sat == 36, "incorrect value for last_msg.msg.measurement_state.states[74].mesid.sat, expected 36, is %d", last_msg.msg.measurement_state.states[74].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[75].cn0 == 200, "incorrect value for last_msg.msg.measurement_state.states[75].cn0, expected 200, is %d", last_msg.msg.measurement_state.states[75].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[75].mesid.code == 20, "incorrect value for last_msg.msg.measurement_state.states[75].mesid.code, expected 20, is %d", last_msg.msg.measurement_state.states[75].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[75].mesid.sat == 11, "incorrect value for last_msg.msg.measurement_state.states[75].mesid.sat, expected 11, is %d", last_msg.msg.measurement_state.states[75].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[76].cn0 == 205, "incorrect value for last_msg.msg.measurement_state.states[76].cn0, expected 205, is %d", last_msg.msg.measurement_state.states[76].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[76].mesid.code == 20, "incorrect value for last_msg.msg.measurement_state.states[76].mesid.code, expected 20, is %d", last_msg.msg.measurement_state.states[76].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[76].mesid.sat == 4, "incorrect value for last_msg.msg.measurement_state.states[76].mesid.sat, expected 4, is %d", last_msg.msg.measurement_state.states[76].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[77].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[77].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[77].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[77].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[77].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[77].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[77].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[77].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[77].mesid.sat); - - ck_assert_msg(last_msg.msg.measurement_state.states[78].cn0 == 0, "incorrect value for last_msg.msg.measurement_state.states[78].cn0, expected 0, is %d", last_msg.msg.measurement_state.states[78].cn0); - - - ck_assert_msg(last_msg.msg.measurement_state.states[78].mesid.code == 0, "incorrect value for last_msg.msg.measurement_state.states[78].mesid.code, expected 0, is %d", last_msg.msg.measurement_state.states[78].mesid.code); - - ck_assert_msg(last_msg.msg.measurement_state.states[78].mesid.sat == 0, "incorrect value for last_msg.msg.measurement_state.states[78].mesid.sat, expected 0, is %d", last_msg.msg.measurement_state.states[78].mesid.sat); + ck_assert_msg(last_msg.msg.measurement_state.n_states == 79, + "incorrect value for " + "last_msg.msg.measurement_state.n_states, expected 79, is %d", + last_msg.msg.measurement_state.n_states); + + ck_assert_msg( + last_msg.msg.measurement_state.states[0].cn0 == 162, + "incorrect value for last_msg.msg.measurement_state.states[0].cn0, " + "expected 162, is %d", + last_msg.msg.measurement_state.states[0].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[0].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[0].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[0].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[0].mesid.sat == 29, + "incorrect value for " + "last_msg.msg.measurement_state.states[0].mesid.sat, " + "expected 29, is %d", + last_msg.msg.measurement_state.states[0].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[1].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[1].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[1].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[1].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[1].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[1].mesid.code); + + ck_assert_msg( + last_msg.msg.measurement_state.states[1].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[1].mesid.sat, expected 0, is %d", + last_msg.msg.measurement_state.states[1].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[2].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[2].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[2].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[2].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[2].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[2].mesid.code); + + ck_assert_msg( + last_msg.msg.measurement_state.states[2].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[2].mesid.sat, expected 0, is %d", + last_msg.msg.measurement_state.states[2].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[3].cn0 == 201, + "incorrect value for last_msg.msg.measurement_state.states[3].cn0, " + "expected 201, is %d", + last_msg.msg.measurement_state.states[3].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[3].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[3].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[3].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[3].mesid.sat == 27, + "incorrect value for " + "last_msg.msg.measurement_state.states[3].mesid.sat, " + "expected 27, is %d", + last_msg.msg.measurement_state.states[3].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[4].cn0 == 168, + "incorrect value for last_msg.msg.measurement_state.states[4].cn0, " + "expected 168, is %d", + last_msg.msg.measurement_state.states[4].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[4].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[4].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[4].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[4].mesid.sat == 20, + "incorrect value for " + "last_msg.msg.measurement_state.states[4].mesid.sat, " + "expected 20, is %d", + last_msg.msg.measurement_state.states[4].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[5].cn0 == 184, + "incorrect value for last_msg.msg.measurement_state.states[5].cn0, " + "expected 184, is %d", + last_msg.msg.measurement_state.states[5].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[5].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[5].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[5].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[5].mesid.sat == 32, + "incorrect value for " + "last_msg.msg.measurement_state.states[5].mesid.sat, " + "expected 32, is %d", + last_msg.msg.measurement_state.states[5].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[6].cn0 == 187, + "incorrect value for last_msg.msg.measurement_state.states[6].cn0, " + "expected 187, is %d", + last_msg.msg.measurement_state.states[6].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[6].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[6].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[6].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[6].mesid.sat == 15, + "incorrect value for " + "last_msg.msg.measurement_state.states[6].mesid.sat, " + "expected 15, is %d", + last_msg.msg.measurement_state.states[6].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[7].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[7].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[7].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[7].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[7].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[7].mesid.code); + + ck_assert_msg( + last_msg.msg.measurement_state.states[7].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[7].mesid.sat, expected 0, is %d", + last_msg.msg.measurement_state.states[7].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[8].cn0 == 210, + "incorrect value for last_msg.msg.measurement_state.states[8].cn0, " + "expected 210, is %d", + last_msg.msg.measurement_state.states[8].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[8].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[8].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[8].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[8].mesid.sat == 18, + "incorrect value for " + "last_msg.msg.measurement_state.states[8].mesid.sat, " + "expected 18, is %d", + last_msg.msg.measurement_state.states[8].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[9].cn0 == 167, + "incorrect value for last_msg.msg.measurement_state.states[9].cn0, " + "expected 167, is %d", + last_msg.msg.measurement_state.states[9].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[9].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[9].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[9].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[9].mesid.sat == 16, + "incorrect value for " + "last_msg.msg.measurement_state.states[9].mesid.sat, " + "expected 16, is %d", + last_msg.msg.measurement_state.states[9].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[10].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[10].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[10].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[10].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[10].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[10].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[10].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[10].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[10].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[11].cn0 == 213, + "incorrect value for last_msg.msg.measurement_state.states[11].cn0, " + "expected 213, is %d", + last_msg.msg.measurement_state.states[11].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[11].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[11].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[11].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[11].mesid.sat == 23, + "incorrect value for " + "last_msg.msg.measurement_state.states[11].mesid.sat, " + "expected 23, is %d", + last_msg.msg.measurement_state.states[11].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[12].cn0 == 223, + "incorrect value for last_msg.msg.measurement_state.states[12].cn0, " + "expected 223, is %d", + last_msg.msg.measurement_state.states[12].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[12].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[12].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[12].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[12].mesid.sat == 10, + "incorrect value for " + "last_msg.msg.measurement_state.states[12].mesid.sat, " + "expected 10, is %d", + last_msg.msg.measurement_state.states[12].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[13].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[13].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[13].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[13].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[13].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[13].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[13].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[13].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[13].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[14].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[14].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[14].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[14].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[14].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[14].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[14].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[14].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[14].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[15].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[15].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[15].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[15].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[15].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[15].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[15].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[15].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[15].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[16].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[16].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[16].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[16].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[16].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[16].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[16].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[16].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[16].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[17].cn0 == 202, + "incorrect value for last_msg.msg.measurement_state.states[17].cn0, " + "expected 202, is %d", + last_msg.msg.measurement_state.states[17].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[17].mesid.code == 2, + "incorrect value for " + "last_msg.msg.measurement_state.states[17].mesid.code, " + "expected 2, is %d", + last_msg.msg.measurement_state.states[17].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[17].mesid.sat == 131, + "incorrect value for " + "last_msg.msg.measurement_state.states[17].mesid.sat, " + "expected 131, is %d", + last_msg.msg.measurement_state.states[17].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[18].cn0 == 192, + "incorrect value for last_msg.msg.measurement_state.states[18].cn0, " + "expected 192, is %d", + last_msg.msg.measurement_state.states[18].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[18].mesid.code == 1, + "incorrect value for " + "last_msg.msg.measurement_state.states[18].mesid.code, " + "expected 1, is %d", + last_msg.msg.measurement_state.states[18].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[18].mesid.sat == 27, + "incorrect value for " + "last_msg.msg.measurement_state.states[18].mesid.sat, " + "expected 27, is %d", + last_msg.msg.measurement_state.states[18].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[19].cn0 == 165, + "incorrect value for last_msg.msg.measurement_state.states[19].cn0, " + "expected 165, is %d", + last_msg.msg.measurement_state.states[19].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[19].mesid.code == 1, + "incorrect value for " + "last_msg.msg.measurement_state.states[19].mesid.code, " + "expected 1, is %d", + last_msg.msg.measurement_state.states[19].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[19].mesid.sat == 15, + "incorrect value for " + "last_msg.msg.measurement_state.states[19].mesid.sat, " + "expected 15, is %d", + last_msg.msg.measurement_state.states[19].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[20].cn0 == 146, + "incorrect value for last_msg.msg.measurement_state.states[20].cn0, " + "expected 146, is %d", + last_msg.msg.measurement_state.states[20].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[20].mesid.code == 1, + "incorrect value for " + "last_msg.msg.measurement_state.states[20].mesid.code, " + "expected 1, is %d", + last_msg.msg.measurement_state.states[20].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[20].mesid.sat == 29, + "incorrect value for " + "last_msg.msg.measurement_state.states[20].mesid.sat, " + "expected 29, is %d", + last_msg.msg.measurement_state.states[20].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[21].cn0 == 170, + "incorrect value for last_msg.msg.measurement_state.states[21].cn0, " + "expected 170, is %d", + last_msg.msg.measurement_state.states[21].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[21].mesid.code == 1, + "incorrect value for " + "last_msg.msg.measurement_state.states[21].mesid.code, " + "expected 1, is %d", + last_msg.msg.measurement_state.states[21].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[21].mesid.sat == 32, + "incorrect value for " + "last_msg.msg.measurement_state.states[21].mesid.sat, " + "expected 32, is %d", + last_msg.msg.measurement_state.states[21].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[22].cn0 == 201, + "incorrect value for last_msg.msg.measurement_state.states[22].cn0, " + "expected 201, is %d", + last_msg.msg.measurement_state.states[22].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[22].mesid.code == 1, + "incorrect value for " + "last_msg.msg.measurement_state.states[22].mesid.code, " + "expected 1, is %d", + last_msg.msg.measurement_state.states[22].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[22].mesid.sat == 18, + "incorrect value for " + "last_msg.msg.measurement_state.states[22].mesid.sat, " + "expected 18, is %d", + last_msg.msg.measurement_state.states[22].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[23].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[23].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[23].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[23].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[23].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[23].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[23].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[23].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[23].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[24].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[24].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[24].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[24].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[24].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[24].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[24].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[24].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[24].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[25].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[25].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[25].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[25].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[25].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[25].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[25].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[25].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[25].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[26].cn0 == 212, + "incorrect value for last_msg.msg.measurement_state.states[26].cn0, " + "expected 212, is %d", + last_msg.msg.measurement_state.states[26].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[26].mesid.code == 1, + "incorrect value for " + "last_msg.msg.measurement_state.states[26].mesid.code, " + "expected 1, is %d", + last_msg.msg.measurement_state.states[26].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[26].mesid.sat == 23, + "incorrect value for " + "last_msg.msg.measurement_state.states[26].mesid.sat, " + "expected 23, is %d", + last_msg.msg.measurement_state.states[26].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[27].cn0 == 205, + "incorrect value for last_msg.msg.measurement_state.states[27].cn0, " + "expected 205, is %d", + last_msg.msg.measurement_state.states[27].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[27].mesid.code == 1, + "incorrect value for " + "last_msg.msg.measurement_state.states[27].mesid.code, " + "expected 1, is %d", + last_msg.msg.measurement_state.states[27].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[27].mesid.sat == 10, + "incorrect value for " + "last_msg.msg.measurement_state.states[27].mesid.sat, " + "expected 10, is %d", + last_msg.msg.measurement_state.states[27].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[28].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[28].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[28].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[28].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[28].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[28].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[28].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[28].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[28].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[29].cn0 == 230, + "incorrect value for last_msg.msg.measurement_state.states[29].cn0, " + "expected 230, is %d", + last_msg.msg.measurement_state.states[29].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[29].mesid.code == 3, + "incorrect value for " + "last_msg.msg.measurement_state.states[29].mesid.code, " + "expected 3, is %d", + last_msg.msg.measurement_state.states[29].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[29].mesid.sat == 96, + "incorrect value for " + "last_msg.msg.measurement_state.states[29].mesid.sat, " + "expected 96, is %d", + last_msg.msg.measurement_state.states[29].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[30].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[30].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[30].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[30].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[30].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[30].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[30].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[30].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[30].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[31].cn0 == 214, + "incorrect value for last_msg.msg.measurement_state.states[31].cn0, " + "expected 214, is %d", + last_msg.msg.measurement_state.states[31].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[31].mesid.code == 3, + "incorrect value for " + "last_msg.msg.measurement_state.states[31].mesid.code, " + "expected 3, is %d", + last_msg.msg.measurement_state.states[31].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[31].mesid.sat == 101, + "incorrect value for " + "last_msg.msg.measurement_state.states[31].mesid.sat, " + "expected 101, is %d", + last_msg.msg.measurement_state.states[31].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[32].cn0 == 212, + "incorrect value for last_msg.msg.measurement_state.states[32].cn0, " + "expected 212, is %d", + last_msg.msg.measurement_state.states[32].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[32].mesid.code == 3, + "incorrect value for " + "last_msg.msg.measurement_state.states[32].mesid.code, " + "expected 3, is %d", + last_msg.msg.measurement_state.states[32].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[32].mesid.sat == 103, + "incorrect value for " + "last_msg.msg.measurement_state.states[32].mesid.sat, " + "expected 103, is %d", + last_msg.msg.measurement_state.states[32].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[33].cn0 == 209, + "incorrect value for last_msg.msg.measurement_state.states[33].cn0, " + "expected 209, is %d", + last_msg.msg.measurement_state.states[33].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[33].mesid.code == 3, + "incorrect value for " + "last_msg.msg.measurement_state.states[33].mesid.code, " + "expected 3, is %d", + last_msg.msg.measurement_state.states[33].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[33].mesid.sat == 104, + "incorrect value for " + "last_msg.msg.measurement_state.states[33].mesid.sat, " + "expected 104, is %d", + last_msg.msg.measurement_state.states[33].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[34].cn0 == 157, + "incorrect value for last_msg.msg.measurement_state.states[34].cn0, " + "expected 157, is %d", + last_msg.msg.measurement_state.states[34].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[34].mesid.code == 3, + "incorrect value for " + "last_msg.msg.measurement_state.states[34].mesid.code, " + "expected 3, is %d", + last_msg.msg.measurement_state.states[34].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[34].mesid.sat == 106, + "incorrect value for " + "last_msg.msg.measurement_state.states[34].mesid.sat, " + "expected 106, is %d", + last_msg.msg.measurement_state.states[34].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[35].cn0 == 230, + "incorrect value for last_msg.msg.measurement_state.states[35].cn0, " + "expected 230, is %d", + last_msg.msg.measurement_state.states[35].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[35].mesid.code == 3, + "incorrect value for " + "last_msg.msg.measurement_state.states[35].mesid.code, " + "expected 3, is %d", + last_msg.msg.measurement_state.states[35].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[35].mesid.sat == 102, + "incorrect value for " + "last_msg.msg.measurement_state.states[35].mesid.sat, " + "expected 102, is %d", + last_msg.msg.measurement_state.states[35].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[36].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[36].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[36].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[36].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[36].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[36].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[36].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[36].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[36].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[37].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[37].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[37].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[37].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[37].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[37].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[37].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[37].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[37].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[38].cn0 == 189, + "incorrect value for last_msg.msg.measurement_state.states[38].cn0, " + "expected 189, is %d", + last_msg.msg.measurement_state.states[38].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[38].mesid.code == 4, + "incorrect value for " + "last_msg.msg.measurement_state.states[38].mesid.code, " + "expected 4, is %d", + last_msg.msg.measurement_state.states[38].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[38].mesid.sat == 101, + "incorrect value for " + "last_msg.msg.measurement_state.states[38].mesid.sat, " + "expected 101, is %d", + last_msg.msg.measurement_state.states[38].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[39].cn0 == 207, + "incorrect value for last_msg.msg.measurement_state.states[39].cn0, " + "expected 207, is %d", + last_msg.msg.measurement_state.states[39].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[39].mesid.code == 4, + "incorrect value for " + "last_msg.msg.measurement_state.states[39].mesid.code, " + "expected 4, is %d", + last_msg.msg.measurement_state.states[39].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[39].mesid.sat == 96, + "incorrect value for " + "last_msg.msg.measurement_state.states[39].mesid.sat, " + "expected 96, is %d", + last_msg.msg.measurement_state.states[39].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[40].cn0 == 164, + "incorrect value for last_msg.msg.measurement_state.states[40].cn0, " + "expected 164, is %d", + last_msg.msg.measurement_state.states[40].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[40].mesid.code == 4, + "incorrect value for " + "last_msg.msg.measurement_state.states[40].mesid.code, " + "expected 4, is %d", + last_msg.msg.measurement_state.states[40].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[40].mesid.sat == 106, + "incorrect value for " + "last_msg.msg.measurement_state.states[40].mesid.sat, " + "expected 106, is %d", + last_msg.msg.measurement_state.states[40].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[41].cn0 == 193, + "incorrect value for last_msg.msg.measurement_state.states[41].cn0, " + "expected 193, is %d", + last_msg.msg.measurement_state.states[41].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[41].mesid.code == 4, + "incorrect value for " + "last_msg.msg.measurement_state.states[41].mesid.code, " + "expected 4, is %d", + last_msg.msg.measurement_state.states[41].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[41].mesid.sat == 104, + "incorrect value for " + "last_msg.msg.measurement_state.states[41].mesid.sat, " + "expected 104, is %d", + last_msg.msg.measurement_state.states[41].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[42].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[42].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[42].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[42].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[42].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[42].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[42].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[42].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[42].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[43].cn0 == 208, + "incorrect value for last_msg.msg.measurement_state.states[43].cn0, " + "expected 208, is %d", + last_msg.msg.measurement_state.states[43].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[43].mesid.code == 4, + "incorrect value for " + "last_msg.msg.measurement_state.states[43].mesid.code, " + "expected 4, is %d", + last_msg.msg.measurement_state.states[43].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[43].mesid.sat == 102, + "incorrect value for " + "last_msg.msg.measurement_state.states[43].mesid.sat, " + "expected 102, is %d", + last_msg.msg.measurement_state.states[43].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[44].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[44].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[44].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[44].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[44].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[44].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[44].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[44].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[44].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[45].cn0 == 212, + "incorrect value for last_msg.msg.measurement_state.states[45].cn0, " + "expected 212, is %d", + last_msg.msg.measurement_state.states[45].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[45].mesid.code == 12, + "incorrect value for " + "last_msg.msg.measurement_state.states[45].mesid.code, " + "expected 12, is %d", + last_msg.msg.measurement_state.states[45].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[45].mesid.sat == 27, + "incorrect value for " + "last_msg.msg.measurement_state.states[45].mesid.sat, " + "expected 27, is %d", + last_msg.msg.measurement_state.states[45].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[46].cn0 == 161, + "incorrect value for last_msg.msg.measurement_state.states[46].cn0, " + "expected 161, is %d", + last_msg.msg.measurement_state.states[46].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[46].mesid.code == 12, + "incorrect value for " + "last_msg.msg.measurement_state.states[46].mesid.code, " + "expected 12, is %d", + last_msg.msg.measurement_state.states[46].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[46].mesid.sat == 29, + "incorrect value for " + "last_msg.msg.measurement_state.states[46].mesid.sat, " + "expected 29, is %d", + last_msg.msg.measurement_state.states[46].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[47].cn0 == 216, + "incorrect value for last_msg.msg.measurement_state.states[47].cn0, " + "expected 216, is %d", + last_msg.msg.measurement_state.states[47].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[47].mesid.code == 12, + "incorrect value for " + "last_msg.msg.measurement_state.states[47].mesid.code, " + "expected 12, is %d", + last_msg.msg.measurement_state.states[47].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[47].mesid.sat == 32, + "incorrect value for " + "last_msg.msg.measurement_state.states[47].mesid.sat, " + "expected 32, is %d", + last_msg.msg.measurement_state.states[47].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[48].cn0 == 216, + "incorrect value for last_msg.msg.measurement_state.states[48].cn0, " + "expected 216, is %d", + last_msg.msg.measurement_state.states[48].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[48].mesid.code == 12, + "incorrect value for " + "last_msg.msg.measurement_state.states[48].mesid.code, " + "expected 12, is %d", + last_msg.msg.measurement_state.states[48].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[48].mesid.sat == 30, + "incorrect value for " + "last_msg.msg.measurement_state.states[48].mesid.sat, " + "expected 30, is %d", + last_msg.msg.measurement_state.states[48].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[49].cn0 == 178, + "incorrect value for last_msg.msg.measurement_state.states[49].cn0, " + "expected 178, is %d", + last_msg.msg.measurement_state.states[49].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[49].mesid.code == 12, + "incorrect value for " + "last_msg.msg.measurement_state.states[49].mesid.code, " + "expected 12, is %d", + last_msg.msg.measurement_state.states[49].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[49].mesid.sat == 20, + "incorrect value for " + "last_msg.msg.measurement_state.states[49].mesid.sat, " + "expected 20, is %d", + last_msg.msg.measurement_state.states[49].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[50].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[50].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[50].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[50].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[50].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[50].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[50].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[50].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[50].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[51].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[51].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[51].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[51].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[51].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[51].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[51].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[51].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[51].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[52].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[52].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[52].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[52].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[52].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[52].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[52].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[52].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[52].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[53].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[53].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[53].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[53].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[53].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[53].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[53].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[53].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[53].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[54].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[54].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[54].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[54].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[54].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[54].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[54].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[54].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[54].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[55].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[55].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[55].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[55].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[55].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[55].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[55].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[55].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[55].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[56].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[56].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[56].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[56].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[56].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[56].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[56].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[56].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[56].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[57].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[57].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[57].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[57].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[57].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[57].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[57].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[57].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[57].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[58].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[58].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[58].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[58].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[58].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[58].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[58].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[58].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[58].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[59].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[59].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[59].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[59].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[59].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[59].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[59].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[59].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[59].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[60].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[60].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[60].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[60].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[60].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[60].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[60].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[60].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[60].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[61].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[61].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[61].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[61].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[61].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[61].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[61].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[61].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[61].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[62].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[62].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[62].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[62].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[62].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[62].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[62].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[62].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[62].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[63].cn0 == 203, + "incorrect value for last_msg.msg.measurement_state.states[63].cn0, " + "expected 203, is %d", + last_msg.msg.measurement_state.states[63].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[63].mesid.code == 14, + "incorrect value for " + "last_msg.msg.measurement_state.states[63].mesid.code, " + "expected 14, is %d", + last_msg.msg.measurement_state.states[63].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[63].mesid.sat == 36, + "incorrect value for " + "last_msg.msg.measurement_state.states[63].mesid.sat, " + "expected 36, is %d", + last_msg.msg.measurement_state.states[63].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[64].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[64].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[64].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[64].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[64].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[64].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[64].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[64].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[64].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[65].cn0 == 158, + "incorrect value for last_msg.msg.measurement_state.states[65].cn0, " + "expected 158, is %d", + last_msg.msg.measurement_state.states[65].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[65].mesid.code == 14, + "incorrect value for " + "last_msg.msg.measurement_state.states[65].mesid.code, " + "expected 14, is %d", + last_msg.msg.measurement_state.states[65].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[65].mesid.sat == 5, + "incorrect value for " + "last_msg.msg.measurement_state.states[65].mesid.sat, " + "expected 5, is %d", + last_msg.msg.measurement_state.states[65].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[66].cn0 == 194, + "incorrect value for last_msg.msg.measurement_state.states[66].cn0, " + "expected 194, is %d", + last_msg.msg.measurement_state.states[66].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[66].mesid.code == 14, + "incorrect value for " + "last_msg.msg.measurement_state.states[66].mesid.code, " + "expected 14, is %d", + last_msg.msg.measurement_state.states[66].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[66].mesid.sat == 4, + "incorrect value for " + "last_msg.msg.measurement_state.states[66].mesid.sat, " + "expected 4, is %d", + last_msg.msg.measurement_state.states[66].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[67].cn0 == 192, + "incorrect value for last_msg.msg.measurement_state.states[67].cn0, " + "expected 192, is %d", + last_msg.msg.measurement_state.states[67].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[67].mesid.code == 14, + "incorrect value for " + "last_msg.msg.measurement_state.states[67].mesid.code, " + "expected 14, is %d", + last_msg.msg.measurement_state.states[67].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[67].mesid.sat == 11, + "incorrect value for " + "last_msg.msg.measurement_state.states[67].mesid.sat, " + "expected 11, is %d", + last_msg.msg.measurement_state.states[67].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[68].cn0 == 207, + "incorrect value for last_msg.msg.measurement_state.states[68].cn0, " + "expected 207, is %d", + last_msg.msg.measurement_state.states[68].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[68].mesid.code == 14, + "incorrect value for " + "last_msg.msg.measurement_state.states[68].mesid.code, " + "expected 14, is %d", + last_msg.msg.measurement_state.states[68].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[68].mesid.sat == 9, + "incorrect value for " + "last_msg.msg.measurement_state.states[68].mesid.sat, " + "expected 9, is %d", + last_msg.msg.measurement_state.states[68].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[69].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[69].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[69].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[69].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[69].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[69].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[69].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[69].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[69].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[70].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[70].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[70].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[70].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[70].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[70].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[70].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[70].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[70].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[71].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[71].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[71].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[71].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[71].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[71].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[71].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[71].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[71].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[72].cn0 == 218, + "incorrect value for last_msg.msg.measurement_state.states[72].cn0, " + "expected 218, is %d", + last_msg.msg.measurement_state.states[72].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[72].mesid.code == 20, + "incorrect value for " + "last_msg.msg.measurement_state.states[72].mesid.code, " + "expected 20, is %d", + last_msg.msg.measurement_state.states[72].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[72].mesid.sat == 9, + "incorrect value for " + "last_msg.msg.measurement_state.states[72].mesid.sat, " + "expected 9, is %d", + last_msg.msg.measurement_state.states[72].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[73].cn0 == 176, + "incorrect value for last_msg.msg.measurement_state.states[73].cn0, " + "expected 176, is %d", + last_msg.msg.measurement_state.states[73].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[73].mesid.code == 20, + "incorrect value for " + "last_msg.msg.measurement_state.states[73].mesid.code, " + "expected 20, is %d", + last_msg.msg.measurement_state.states[73].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[73].mesid.sat == 5, + "incorrect value for " + "last_msg.msg.measurement_state.states[73].mesid.sat, " + "expected 5, is %d", + last_msg.msg.measurement_state.states[73].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[74].cn0 == 217, + "incorrect value for last_msg.msg.measurement_state.states[74].cn0, " + "expected 217, is %d", + last_msg.msg.measurement_state.states[74].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[74].mesid.code == 20, + "incorrect value for " + "last_msg.msg.measurement_state.states[74].mesid.code, " + "expected 20, is %d", + last_msg.msg.measurement_state.states[74].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[74].mesid.sat == 36, + "incorrect value for " + "last_msg.msg.measurement_state.states[74].mesid.sat, " + "expected 36, is %d", + last_msg.msg.measurement_state.states[74].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[75].cn0 == 200, + "incorrect value for last_msg.msg.measurement_state.states[75].cn0, " + "expected 200, is %d", + last_msg.msg.measurement_state.states[75].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[75].mesid.code == 20, + "incorrect value for " + "last_msg.msg.measurement_state.states[75].mesid.code, " + "expected 20, is %d", + last_msg.msg.measurement_state.states[75].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[75].mesid.sat == 11, + "incorrect value for " + "last_msg.msg.measurement_state.states[75].mesid.sat, " + "expected 11, is %d", + last_msg.msg.measurement_state.states[75].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[76].cn0 == 205, + "incorrect value for last_msg.msg.measurement_state.states[76].cn0, " + "expected 205, is %d", + last_msg.msg.measurement_state.states[76].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[76].mesid.code == 20, + "incorrect value for " + "last_msg.msg.measurement_state.states[76].mesid.code, " + "expected 20, is %d", + last_msg.msg.measurement_state.states[76].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[76].mesid.sat == 4, + "incorrect value for " + "last_msg.msg.measurement_state.states[76].mesid.sat, " + "expected 4, is %d", + last_msg.msg.measurement_state.states[76].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[77].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[77].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[77].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[77].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[77].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[77].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[77].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[77].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[77].mesid.sat); + + ck_assert_msg( + last_msg.msg.measurement_state.states[78].cn0 == 0, + "incorrect value for last_msg.msg.measurement_state.states[78].cn0, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[78].cn0); + + ck_assert_msg(last_msg.msg.measurement_state.states[78].mesid.code == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[78].mesid.code, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[78].mesid.code); + + ck_assert_msg(last_msg.msg.measurement_state.states[78].mesid.sat == 0, + "incorrect value for " + "last_msg.msg.measurement_state.states[78].mesid.sat, " + "expected 0, is %d", + last_msg.msg.measurement_state.states[78].mesid.sat); } } END_TEST -Suite* auto_check_sbp_tracking_MsgMeasurementState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_tracking_MsgMeasurementState"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_tracking_MsgMeasurementState"); +Suite *auto_check_sbp_tracking_MsgMeasurementState_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_tracking_MsgMeasurementState"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_tracking_MsgMeasurementState"); tcase_add_test(tc_acq, test_auto_check_sbp_tracking_MsgMeasurementState); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_tracking_MsgTrackingIq.c b/c/test/auto_check_sbp_tracking_MsgTrackingIq.c index c8a7d6cb3..a9e47d894 100644 --- a/c/test/auto_check_sbp_tracking_MsgTrackingIq.c +++ b/c/test/auto_check_sbp_tracking_MsgTrackingIq.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIq.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_tracking_MsgTrackingIq ) -{ +START_TEST(test_auto_check_sbp_tracking_MsgTrackingIq) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingIq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,86 +90,114 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingIq ) logging_reset(); - sbp_callback_register(&sbp_state, 0x2d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x2d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,45,0,2,80,15,145,121,203,47,217,239,55,45,38,189,88,159,19,208,12,97,167, }; + u8 encoded_frame[] = { + 85, 45, 0, 2, 80, 15, 145, 121, 203, 47, 217, 239, + 55, 45, 38, 189, 88, 159, 19, 208, 12, 97, 167, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.tracking_iq.channel = 145; - - - + test_msg.tracking_iq.corrs[0].I = -9937; - + test_msg.tracking_iq.corrs[0].Q = 14319; - - + test_msg.tracking_iq.corrs[1].I = 9773; - + test_msg.tracking_iq.corrs[1].Q = 22717; - - + test_msg.tracking_iq.corrs[2].I = 5023; - + test_msg.tracking_iq.corrs[2].Q = 3280; - - + test_msg.tracking_iq.sid.code = 203; - + test_msg.tracking_iq.sid.sat = 121; - sbp_message_send(&sbp_state, SbpMsgTrackingIq, 20482, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingIq, 20482, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 20482, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingIq, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgTrackingIq, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.tracking_iq.channel == 145, "incorrect value for last_msg.msg.tracking_iq.channel, expected 145, is %d", last_msg.msg.tracking_iq.channel); - - - ck_assert_msg(last_msg.msg.tracking_iq.corrs[0].I == -9937, "incorrect value for last_msg.msg.tracking_iq.corrs[0].I, expected -9937, is %d", last_msg.msg.tracking_iq.corrs[0].I); - - ck_assert_msg(last_msg.msg.tracking_iq.corrs[0].Q == 14319, "incorrect value for last_msg.msg.tracking_iq.corrs[0].Q, expected 14319, is %d", last_msg.msg.tracking_iq.corrs[0].Q); - - ck_assert_msg(last_msg.msg.tracking_iq.corrs[1].I == 9773, "incorrect value for last_msg.msg.tracking_iq.corrs[1].I, expected 9773, is %d", last_msg.msg.tracking_iq.corrs[1].I); - - ck_assert_msg(last_msg.msg.tracking_iq.corrs[1].Q == 22717, "incorrect value for last_msg.msg.tracking_iq.corrs[1].Q, expected 22717, is %d", last_msg.msg.tracking_iq.corrs[1].Q); - - ck_assert_msg(last_msg.msg.tracking_iq.corrs[2].I == 5023, "incorrect value for last_msg.msg.tracking_iq.corrs[2].I, expected 5023, is %d", last_msg.msg.tracking_iq.corrs[2].I); - - ck_assert_msg(last_msg.msg.tracking_iq.corrs[2].Q == 3280, "incorrect value for last_msg.msg.tracking_iq.corrs[2].Q, expected 3280, is %d", last_msg.msg.tracking_iq.corrs[2].Q); - - - ck_assert_msg(last_msg.msg.tracking_iq.sid.code == 203, "incorrect value for last_msg.msg.tracking_iq.sid.code, expected 203, is %d", last_msg.msg.tracking_iq.sid.code); - - ck_assert_msg(last_msg.msg.tracking_iq.sid.sat == 121, "incorrect value for last_msg.msg.tracking_iq.sid.sat, expected 121, is %d", last_msg.msg.tracking_iq.sid.sat); + ck_assert_msg(last_msg.msg.tracking_iq.channel == 145, + "incorrect value for last_msg.msg.tracking_iq.channel, " + "expected 145, is %d", + last_msg.msg.tracking_iq.channel); + + ck_assert_msg(last_msg.msg.tracking_iq.corrs[0].I == -9937, + "incorrect value for last_msg.msg.tracking_iq.corrs[0].I, " + "expected -9937, is %d", + last_msg.msg.tracking_iq.corrs[0].I); + + ck_assert_msg(last_msg.msg.tracking_iq.corrs[0].Q == 14319, + "incorrect value for last_msg.msg.tracking_iq.corrs[0].Q, " + "expected 14319, is %d", + last_msg.msg.tracking_iq.corrs[0].Q); + + ck_assert_msg(last_msg.msg.tracking_iq.corrs[1].I == 9773, + "incorrect value for last_msg.msg.tracking_iq.corrs[1].I, " + "expected 9773, is %d", + last_msg.msg.tracking_iq.corrs[1].I); + + ck_assert_msg(last_msg.msg.tracking_iq.corrs[1].Q == 22717, + "incorrect value for last_msg.msg.tracking_iq.corrs[1].Q, " + "expected 22717, is %d", + last_msg.msg.tracking_iq.corrs[1].Q); + + ck_assert_msg(last_msg.msg.tracking_iq.corrs[2].I == 5023, + "incorrect value for last_msg.msg.tracking_iq.corrs[2].I, " + "expected 5023, is %d", + last_msg.msg.tracking_iq.corrs[2].I); + + ck_assert_msg(last_msg.msg.tracking_iq.corrs[2].Q == 3280, + "incorrect value for last_msg.msg.tracking_iq.corrs[2].Q, " + "expected 3280, is %d", + last_msg.msg.tracking_iq.corrs[2].Q); + + ck_assert_msg(last_msg.msg.tracking_iq.sid.code == 203, + "incorrect value for last_msg.msg.tracking_iq.sid.code, " + "expected 203, is %d", + last_msg.msg.tracking_iq.sid.code); + + ck_assert_msg(last_msg.msg.tracking_iq.sid.sat == 121, + "incorrect value for last_msg.msg.tracking_iq.sid.sat, " + "expected 121, is %d", + last_msg.msg.tracking_iq.sid.sat); } } END_TEST -Suite* auto_check_sbp_tracking_MsgTrackingIq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_tracking_MsgTrackingIq"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_tracking_MsgTrackingIq"); +Suite *auto_check_sbp_tracking_MsgTrackingIq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_tracking_MsgTrackingIq"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_tracking_MsgTrackingIq"); tcase_add_test(tc_acq, test_auto_check_sbp_tracking_MsgTrackingIq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_tracking_MsgTrackingIqDepA.c b/c/test/auto_check_sbp_tracking_MsgTrackingIqDepA.c index 649d0751d..8a326be62 100644 --- a/c/test/auto_check_sbp_tracking_MsgTrackingIqDepA.c +++ b/c/test/auto_check_sbp_tracking_MsgTrackingIqDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_tracking_MsgTrackingIqDepA ) -{ +START_TEST(test_auto_check_sbp_tracking_MsgTrackingIqDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingIqDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,90 +90,129 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingIqDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x1c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x1c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,28,0,184,67,29,139,28,250,15,0,99,90,170,96,71,121,33,161,52,211,162,101,41,36,226,99,71,75,14,240,134,82,175,83,17,34, }; + u8 encoded_frame[] = { + 85, 28, 0, 184, 67, 29, 139, 28, 250, 15, 0, 99, 90, + 170, 96, 71, 121, 33, 161, 52, 211, 162, 101, 41, 36, 226, + 99, 71, 75, 14, 240, 134, 82, 175, 83, 17, 34, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.tracking_iq_dep_a.channel = 139; - - - + test_msg.tracking_iq_dep_a.corrs[0].I = 1621776995; - + test_msg.tracking_iq_dep_a.corrs[0].Q = -1591641785; - - + test_msg.tracking_iq_dep_a.corrs[1].I = 1705169716; - + test_msg.tracking_iq_dep_a.corrs[1].Q = 1675764777; - - + test_msg.tracking_iq_dep_a.corrs[2].I = -267498681; - + test_msg.tracking_iq_dep_a.corrs[2].Q = 1403998854; - - + test_msg.tracking_iq_dep_a.sid.code = 15; - + test_msg.tracking_iq_dep_a.sid.reserved = 0; - + test_msg.tracking_iq_dep_a.sid.sat = 64028; - sbp_message_send(&sbp_state, SbpMsgTrackingIqDepA, 17336, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingIqDepA, 17336, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 17336, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingIqDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgTrackingIqDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.tracking_iq_dep_a.channel == 139, "incorrect value for last_msg.msg.tracking_iq_dep_a.channel, expected 139, is %d", last_msg.msg.tracking_iq_dep_a.channel); - - - ck_assert_msg(last_msg.msg.tracking_iq_dep_a.corrs[0].I == 1621776995, "incorrect value for last_msg.msg.tracking_iq_dep_a.corrs[0].I, expected 1621776995, is %d", last_msg.msg.tracking_iq_dep_a.corrs[0].I); - - ck_assert_msg(last_msg.msg.tracking_iq_dep_a.corrs[0].Q == -1591641785, "incorrect value for last_msg.msg.tracking_iq_dep_a.corrs[0].Q, expected -1591641785, is %d", last_msg.msg.tracking_iq_dep_a.corrs[0].Q); - - ck_assert_msg(last_msg.msg.tracking_iq_dep_a.corrs[1].I == 1705169716, "incorrect value for last_msg.msg.tracking_iq_dep_a.corrs[1].I, expected 1705169716, is %d", last_msg.msg.tracking_iq_dep_a.corrs[1].I); - - ck_assert_msg(last_msg.msg.tracking_iq_dep_a.corrs[1].Q == 1675764777, "incorrect value for last_msg.msg.tracking_iq_dep_a.corrs[1].Q, expected 1675764777, is %d", last_msg.msg.tracking_iq_dep_a.corrs[1].Q); - - ck_assert_msg(last_msg.msg.tracking_iq_dep_a.corrs[2].I == -267498681, "incorrect value for last_msg.msg.tracking_iq_dep_a.corrs[2].I, expected -267498681, is %d", last_msg.msg.tracking_iq_dep_a.corrs[2].I); - - ck_assert_msg(last_msg.msg.tracking_iq_dep_a.corrs[2].Q == 1403998854, "incorrect value for last_msg.msg.tracking_iq_dep_a.corrs[2].Q, expected 1403998854, is %d", last_msg.msg.tracking_iq_dep_a.corrs[2].Q); - - - ck_assert_msg(last_msg.msg.tracking_iq_dep_a.sid.code == 15, "incorrect value for last_msg.msg.tracking_iq_dep_a.sid.code, expected 15, is %d", last_msg.msg.tracking_iq_dep_a.sid.code); - - ck_assert_msg(last_msg.msg.tracking_iq_dep_a.sid.reserved == 0, "incorrect value for last_msg.msg.tracking_iq_dep_a.sid.reserved, expected 0, is %d", last_msg.msg.tracking_iq_dep_a.sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_iq_dep_a.sid.sat == 64028, "incorrect value for last_msg.msg.tracking_iq_dep_a.sid.sat, expected 64028, is %d", last_msg.msg.tracking_iq_dep_a.sid.sat); + ck_assert_msg(last_msg.msg.tracking_iq_dep_a.channel == 139, + "incorrect value for last_msg.msg.tracking_iq_dep_a.channel, " + "expected 139, is %d", + last_msg.msg.tracking_iq_dep_a.channel); + + ck_assert_msg( + last_msg.msg.tracking_iq_dep_a.corrs[0].I == 1621776995, + "incorrect value for last_msg.msg.tracking_iq_dep_a.corrs[0].I, " + "expected 1621776995, is %d", + last_msg.msg.tracking_iq_dep_a.corrs[0].I); + + ck_assert_msg( + last_msg.msg.tracking_iq_dep_a.corrs[0].Q == -1591641785, + "incorrect value for last_msg.msg.tracking_iq_dep_a.corrs[0].Q, " + "expected -1591641785, is %d", + last_msg.msg.tracking_iq_dep_a.corrs[0].Q); + + ck_assert_msg( + last_msg.msg.tracking_iq_dep_a.corrs[1].I == 1705169716, + "incorrect value for last_msg.msg.tracking_iq_dep_a.corrs[1].I, " + "expected 1705169716, is %d", + last_msg.msg.tracking_iq_dep_a.corrs[1].I); + + ck_assert_msg( + last_msg.msg.tracking_iq_dep_a.corrs[1].Q == 1675764777, + "incorrect value for last_msg.msg.tracking_iq_dep_a.corrs[1].Q, " + "expected 1675764777, is %d", + last_msg.msg.tracking_iq_dep_a.corrs[1].Q); + + ck_assert_msg( + last_msg.msg.tracking_iq_dep_a.corrs[2].I == -267498681, + "incorrect value for last_msg.msg.tracking_iq_dep_a.corrs[2].I, " + "expected -267498681, is %d", + last_msg.msg.tracking_iq_dep_a.corrs[2].I); + + ck_assert_msg( + last_msg.msg.tracking_iq_dep_a.corrs[2].Q == 1403998854, + "incorrect value for last_msg.msg.tracking_iq_dep_a.corrs[2].Q, " + "expected 1403998854, is %d", + last_msg.msg.tracking_iq_dep_a.corrs[2].Q); + + ck_assert_msg(last_msg.msg.tracking_iq_dep_a.sid.code == 15, + "incorrect value for " + "last_msg.msg.tracking_iq_dep_a.sid.code, expected 15, is %d", + last_msg.msg.tracking_iq_dep_a.sid.code); + + ck_assert_msg( + last_msg.msg.tracking_iq_dep_a.sid.reserved == 0, + "incorrect value for last_msg.msg.tracking_iq_dep_a.sid.reserved, " + "expected 0, is %d", + last_msg.msg.tracking_iq_dep_a.sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_iq_dep_a.sid.sat == 64028, + "incorrect value for last_msg.msg.tracking_iq_dep_a.sid.sat, " + "expected 64028, is %d", + last_msg.msg.tracking_iq_dep_a.sid.sat); } } END_TEST -Suite* auto_check_sbp_tracking_MsgTrackingIqDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_tracking_MsgTrackingIqDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_tracking_MsgTrackingIqDepA"); +Suite *auto_check_sbp_tracking_MsgTrackingIqDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_tracking_MsgTrackingIqDepA"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_tracking_MsgTrackingIqDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_tracking_MsgTrackingIqDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_tracking_MsgTrackingIqDepB.c b/c/test/auto_check_sbp_tracking_MsgTrackingIqDepB.c index e4ec46648..874bcb744 100644 --- a/c/test/auto_check_sbp_tracking_MsgTrackingIqDepB.c +++ b/c/test/auto_check_sbp_tracking_MsgTrackingIqDepB.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepB.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_tracking_MsgTrackingIqDepB ) -{ +START_TEST(test_auto_check_sbp_tracking_MsgTrackingIqDepB) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingIqDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,86 +90,122 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingIqDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x2c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x2c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,44,0,39,101,27,45,188,183,72,185,157,15,187,249,101,24,135,146,180,224,123,235,142,208,102,112,25,21,177,96,116,68,246,153, }; + u8 encoded_frame[] = { + 85, 44, 0, 39, 101, 27, 45, 188, 183, 72, 185, 157, + 15, 187, 249, 101, 24, 135, 146, 180, 224, 123, 235, 142, + 208, 102, 112, 25, 21, 177, 96, 116, 68, 246, 153, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.tracking_iq_dep_b.channel = 45; - - - + test_msg.tracking_iq_dep_b.corrs[0].I = 261994824; - + test_msg.tracking_iq_dep_b.corrs[0].Q = 409336251; - - + test_msg.tracking_iq_dep_b.corrs[1].I = -525036921; - + test_msg.tracking_iq_dep_b.corrs[1].Q = -795939973; - - + test_msg.tracking_iq_dep_b.corrs[2].I = 353988710; - + test_msg.tracking_iq_dep_b.corrs[2].Q = 1148477617; - - + test_msg.tracking_iq_dep_b.sid.code = 183; - + test_msg.tracking_iq_dep_b.sid.sat = 188; - sbp_message_send(&sbp_state, SbpMsgTrackingIqDepB, 25895, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingIqDepB, 25895, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 25895, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingIqDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgTrackingIqDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.tracking_iq_dep_b.channel == 45, "incorrect value for last_msg.msg.tracking_iq_dep_b.channel, expected 45, is %d", last_msg.msg.tracking_iq_dep_b.channel); - - - ck_assert_msg(last_msg.msg.tracking_iq_dep_b.corrs[0].I == 261994824, "incorrect value for last_msg.msg.tracking_iq_dep_b.corrs[0].I, expected 261994824, is %d", last_msg.msg.tracking_iq_dep_b.corrs[0].I); - - ck_assert_msg(last_msg.msg.tracking_iq_dep_b.corrs[0].Q == 409336251, "incorrect value for last_msg.msg.tracking_iq_dep_b.corrs[0].Q, expected 409336251, is %d", last_msg.msg.tracking_iq_dep_b.corrs[0].Q); - - ck_assert_msg(last_msg.msg.tracking_iq_dep_b.corrs[1].I == -525036921, "incorrect value for last_msg.msg.tracking_iq_dep_b.corrs[1].I, expected -525036921, is %d", last_msg.msg.tracking_iq_dep_b.corrs[1].I); - - ck_assert_msg(last_msg.msg.tracking_iq_dep_b.corrs[1].Q == -795939973, "incorrect value for last_msg.msg.tracking_iq_dep_b.corrs[1].Q, expected -795939973, is %d", last_msg.msg.tracking_iq_dep_b.corrs[1].Q); - - ck_assert_msg(last_msg.msg.tracking_iq_dep_b.corrs[2].I == 353988710, "incorrect value for last_msg.msg.tracking_iq_dep_b.corrs[2].I, expected 353988710, is %d", last_msg.msg.tracking_iq_dep_b.corrs[2].I); - - ck_assert_msg(last_msg.msg.tracking_iq_dep_b.corrs[2].Q == 1148477617, "incorrect value for last_msg.msg.tracking_iq_dep_b.corrs[2].Q, expected 1148477617, is %d", last_msg.msg.tracking_iq_dep_b.corrs[2].Q); - - - ck_assert_msg(last_msg.msg.tracking_iq_dep_b.sid.code == 183, "incorrect value for last_msg.msg.tracking_iq_dep_b.sid.code, expected 183, is %d", last_msg.msg.tracking_iq_dep_b.sid.code); - - ck_assert_msg(last_msg.msg.tracking_iq_dep_b.sid.sat == 188, "incorrect value for last_msg.msg.tracking_iq_dep_b.sid.sat, expected 188, is %d", last_msg.msg.tracking_iq_dep_b.sid.sat); + ck_assert_msg(last_msg.msg.tracking_iq_dep_b.channel == 45, + "incorrect value for last_msg.msg.tracking_iq_dep_b.channel, " + "expected 45, is %d", + last_msg.msg.tracking_iq_dep_b.channel); + + ck_assert_msg( + last_msg.msg.tracking_iq_dep_b.corrs[0].I == 261994824, + "incorrect value for last_msg.msg.tracking_iq_dep_b.corrs[0].I, " + "expected 261994824, is %d", + last_msg.msg.tracking_iq_dep_b.corrs[0].I); + + ck_assert_msg( + last_msg.msg.tracking_iq_dep_b.corrs[0].Q == 409336251, + "incorrect value for last_msg.msg.tracking_iq_dep_b.corrs[0].Q, " + "expected 409336251, is %d", + last_msg.msg.tracking_iq_dep_b.corrs[0].Q); + + ck_assert_msg( + last_msg.msg.tracking_iq_dep_b.corrs[1].I == -525036921, + "incorrect value for last_msg.msg.tracking_iq_dep_b.corrs[1].I, " + "expected -525036921, is %d", + last_msg.msg.tracking_iq_dep_b.corrs[1].I); + + ck_assert_msg( + last_msg.msg.tracking_iq_dep_b.corrs[1].Q == -795939973, + "incorrect value for last_msg.msg.tracking_iq_dep_b.corrs[1].Q, " + "expected -795939973, is %d", + last_msg.msg.tracking_iq_dep_b.corrs[1].Q); + + ck_assert_msg( + last_msg.msg.tracking_iq_dep_b.corrs[2].I == 353988710, + "incorrect value for last_msg.msg.tracking_iq_dep_b.corrs[2].I, " + "expected 353988710, is %d", + last_msg.msg.tracking_iq_dep_b.corrs[2].I); + + ck_assert_msg( + last_msg.msg.tracking_iq_dep_b.corrs[2].Q == 1148477617, + "incorrect value for last_msg.msg.tracking_iq_dep_b.corrs[2].Q, " + "expected 1148477617, is %d", + last_msg.msg.tracking_iq_dep_b.corrs[2].Q); + + ck_assert_msg( + last_msg.msg.tracking_iq_dep_b.sid.code == 183, + "incorrect value for last_msg.msg.tracking_iq_dep_b.sid.code, expected " + "183, is %d", + last_msg.msg.tracking_iq_dep_b.sid.code); + + ck_assert_msg(last_msg.msg.tracking_iq_dep_b.sid.sat == 188, + "incorrect value for last_msg.msg.tracking_iq_dep_b.sid.sat, " + "expected 188, is %d", + last_msg.msg.tracking_iq_dep_b.sid.sat); } } END_TEST -Suite* auto_check_sbp_tracking_MsgTrackingIqDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_tracking_MsgTrackingIqDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_tracking_MsgTrackingIqDepB"); +Suite *auto_check_sbp_tracking_MsgTrackingIqDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_tracking_MsgTrackingIqDepB"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_tracking_MsgTrackingIqDepB"); tcase_add_test(tc_acq, test_auto_check_sbp_tracking_MsgTrackingIqDepB); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_tracking_MsgTrackingState.c b/c/test/auto_check_sbp_tracking_MsgTrackingState.c index 0824af142..b3d673df4 100644 --- a/c/test/auto_check_sbp_tracking_MsgTrackingState.c +++ b/c/test/auto_check_sbp_tracking_MsgTrackingState.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingState.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_tracking_MsgTrackingState ) -{ +START_TEST(test_auto_check_sbp_tracking_MsgTrackingState) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,1246 +90,2091 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingState ) logging_reset(); - sbp_callback_register(&sbp_state, 0x41, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x41, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,65,0,55,129,252,117,184,3,102,38,106,140,141,25,4,90,195,246,108,75,82,137,127,45,163,32,46,187,93,153,60,201,147,23,29,5,208,181,30,219,69,254,136,3,121,33,98,144,215,133,182,14,56,169,77,218,62,242,84,171,249,152,137,131,130,193,21,42,68,253,227,216,227,24,26,210,179,19,15,227,255,122,75,187,200,217,48,218,122,187,238,142,149,238,55,251,212,128,160,194,104,113,255,141,62,43,69,245,39,100,230,108,56,247,68,149,143,137,101,233,70,49,165,38,110,218,230,80,213,196,179,139,128,15,178,196,171,8,212,97,194,83,233,79,99,55,90,31,180,5,25,105,186,22,224,80,111,8,48,106,166,4,48,156,49,86,19,142,146,91,124,115,64,28,230,115,178,190,131,16,242,105,59,182,113,192,180,48,179,166,31,172,211,77,228,140,49,128,77,240,194,134,194,41,58,18,53,129,55,91,72,134,92,33,224,157,56,186,54,224,174,82,84,148,190,236,54,62,67,52,215,57,254,16,133,36,174,219,172,145,17,192,179,111,97,207,56,208,134,180,17,43,226,255,182,140,113,141,111, }; + u8 encoded_frame[] = { + 85, 65, 0, 55, 129, 252, 117, 184, 3, 102, 38, 106, 140, 141, + 25, 4, 90, 195, 246, 108, 75, 82, 137, 127, 45, 163, 32, 46, + 187, 93, 153, 60, 201, 147, 23, 29, 5, 208, 181, 30, 219, 69, + 254, 136, 3, 121, 33, 98, 144, 215, 133, 182, 14, 56, 169, 77, + 218, 62, 242, 84, 171, 249, 152, 137, 131, 130, 193, 21, 42, 68, + 253, 227, 216, 227, 24, 26, 210, 179, 19, 15, 227, 255, 122, 75, + 187, 200, 217, 48, 218, 122, 187, 238, 142, 149, 238, 55, 251, 212, + 128, 160, 194, 104, 113, 255, 141, 62, 43, 69, 245, 39, 100, 230, + 108, 56, 247, 68, 149, 143, 137, 101, 233, 70, 49, 165, 38, 110, + 218, 230, 80, 213, 196, 179, 139, 128, 15, 178, 196, 171, 8, 212, + 97, 194, 83, 233, 79, 99, 55, 90, 31, 180, 5, 25, 105, 186, + 22, 224, 80, 111, 8, 48, 106, 166, 4, 48, 156, 49, 86, 19, + 142, 146, 91, 124, 115, 64, 28, 230, 115, 178, 190, 131, 16, 242, + 105, 59, 182, 113, 192, 180, 48, 179, 166, 31, 172, 211, 77, 228, + 140, 49, 128, 77, 240, 194, 134, 194, 41, 58, 18, 53, 129, 55, + 91, 72, 134, 92, 33, 224, 157, 56, 186, 54, 224, 174, 82, 84, + 148, 190, 236, 54, 62, 67, 52, 215, 57, 254, 16, 133, 36, 174, + 219, 172, 145, 17, 192, 179, 111, 97, 207, 56, 208, 134, 180, 17, + 43, 226, 255, 182, 140, 113, 141, 111, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.tracking_state.n_states = 63; - - - + test_msg.tracking_state.states[0].cn0 = 102; - + test_msg.tracking_state.states[0].fcn = 3; - - + test_msg.tracking_state.states[0].sid.code = 184; - + test_msg.tracking_state.states[0].sid.sat = 117; - - + test_msg.tracking_state.states[1].cn0 = 141; - + test_msg.tracking_state.states[1].fcn = 140; - - + test_msg.tracking_state.states[1].sid.code = 106; - + test_msg.tracking_state.states[1].sid.sat = 38; - - + test_msg.tracking_state.states[2].cn0 = 195; - + test_msg.tracking_state.states[2].fcn = 90; - - + test_msg.tracking_state.states[2].sid.code = 4; - + test_msg.tracking_state.states[2].sid.sat = 25; - - + test_msg.tracking_state.states[3].cn0 = 82; - + test_msg.tracking_state.states[3].fcn = 75; - - + test_msg.tracking_state.states[3].sid.code = 108; - + test_msg.tracking_state.states[3].sid.sat = 246; - - + test_msg.tracking_state.states[4].cn0 = 163; - + test_msg.tracking_state.states[4].fcn = 45; - - + test_msg.tracking_state.states[4].sid.code = 127; - + test_msg.tracking_state.states[4].sid.sat = 137; - - + test_msg.tracking_state.states[5].cn0 = 93; - + test_msg.tracking_state.states[5].fcn = 187; - - + test_msg.tracking_state.states[5].sid.code = 46; - + test_msg.tracking_state.states[5].sid.sat = 32; - - + test_msg.tracking_state.states[6].cn0 = 147; - + test_msg.tracking_state.states[6].fcn = 201; - - + test_msg.tracking_state.states[6].sid.code = 60; - + test_msg.tracking_state.states[6].sid.sat = 153; - - + test_msg.tracking_state.states[7].cn0 = 208; - + test_msg.tracking_state.states[7].fcn = 5; - - + test_msg.tracking_state.states[7].sid.code = 29; - + test_msg.tracking_state.states[7].sid.sat = 23; - - + test_msg.tracking_state.states[8].cn0 = 69; - + test_msg.tracking_state.states[8].fcn = 219; - - + test_msg.tracking_state.states[8].sid.code = 30; - + test_msg.tracking_state.states[8].sid.sat = 181; - - + test_msg.tracking_state.states[9].cn0 = 121; - + test_msg.tracking_state.states[9].fcn = 3; - - + test_msg.tracking_state.states[9].sid.code = 136; - + test_msg.tracking_state.states[9].sid.sat = 254; - - + test_msg.tracking_state.states[10].cn0 = 215; - + test_msg.tracking_state.states[10].fcn = 144; - - + test_msg.tracking_state.states[10].sid.code = 98; - + test_msg.tracking_state.states[10].sid.sat = 33; - - + test_msg.tracking_state.states[11].cn0 = 56; - + test_msg.tracking_state.states[11].fcn = 14; - - + test_msg.tracking_state.states[11].sid.code = 182; - + test_msg.tracking_state.states[11].sid.sat = 133; - - + test_msg.tracking_state.states[12].cn0 = 62; - + test_msg.tracking_state.states[12].fcn = 218; - - + test_msg.tracking_state.states[12].sid.code = 77; - + test_msg.tracking_state.states[12].sid.sat = 169; - - + test_msg.tracking_state.states[13].cn0 = 249; - + test_msg.tracking_state.states[13].fcn = 171; - - + test_msg.tracking_state.states[13].sid.code = 84; - + test_msg.tracking_state.states[13].sid.sat = 242; - - + test_msg.tracking_state.states[14].cn0 = 130; - + test_msg.tracking_state.states[14].fcn = 131; - - + test_msg.tracking_state.states[14].sid.code = 137; - + test_msg.tracking_state.states[14].sid.sat = 152; - - + test_msg.tracking_state.states[15].cn0 = 68; - + test_msg.tracking_state.states[15].fcn = 42; - - + test_msg.tracking_state.states[15].sid.code = 21; - + test_msg.tracking_state.states[15].sid.sat = 193; - - + test_msg.tracking_state.states[16].cn0 = 227; - + test_msg.tracking_state.states[16].fcn = 216; - - + test_msg.tracking_state.states[16].sid.code = 227; - + test_msg.tracking_state.states[16].sid.sat = 253; - - + test_msg.tracking_state.states[17].cn0 = 179; - + test_msg.tracking_state.states[17].fcn = 210; - - + test_msg.tracking_state.states[17].sid.code = 26; - + test_msg.tracking_state.states[17].sid.sat = 24; - - + test_msg.tracking_state.states[18].cn0 = 255; - + test_msg.tracking_state.states[18].fcn = 227; - - + test_msg.tracking_state.states[18].sid.code = 15; - + test_msg.tracking_state.states[18].sid.sat = 19; - - + test_msg.tracking_state.states[19].cn0 = 200; - + test_msg.tracking_state.states[19].fcn = 187; - - + test_msg.tracking_state.states[19].sid.code = 75; - + test_msg.tracking_state.states[19].sid.sat = 122; - - + test_msg.tracking_state.states[20].cn0 = 122; - + test_msg.tracking_state.states[20].fcn = 218; - - + test_msg.tracking_state.states[20].sid.code = 48; - + test_msg.tracking_state.states[20].sid.sat = 217; - - + test_msg.tracking_state.states[21].cn0 = 149; - + test_msg.tracking_state.states[21].fcn = 142; - - + test_msg.tracking_state.states[21].sid.code = 238; - + test_msg.tracking_state.states[21].sid.sat = 187; - - + test_msg.tracking_state.states[22].cn0 = 212; - + test_msg.tracking_state.states[22].fcn = 251; - - + test_msg.tracking_state.states[22].sid.code = 55; - + test_msg.tracking_state.states[22].sid.sat = 238; - - + test_msg.tracking_state.states[23].cn0 = 104; - + test_msg.tracking_state.states[23].fcn = 194; - - + test_msg.tracking_state.states[23].sid.code = 160; - + test_msg.tracking_state.states[23].sid.sat = 128; - - + test_msg.tracking_state.states[24].cn0 = 62; - + test_msg.tracking_state.states[24].fcn = 141; - - + test_msg.tracking_state.states[24].sid.code = 255; - + test_msg.tracking_state.states[24].sid.sat = 113; - - + test_msg.tracking_state.states[25].cn0 = 39; - + test_msg.tracking_state.states[25].fcn = 245; - - + test_msg.tracking_state.states[25].sid.code = 69; - + test_msg.tracking_state.states[25].sid.sat = 43; - - + test_msg.tracking_state.states[26].cn0 = 56; - + test_msg.tracking_state.states[26].fcn = 108; - - + test_msg.tracking_state.states[26].sid.code = 230; - + test_msg.tracking_state.states[26].sid.sat = 100; - - + test_msg.tracking_state.states[27].cn0 = 143; - + test_msg.tracking_state.states[27].fcn = 149; - - + test_msg.tracking_state.states[27].sid.code = 68; - + test_msg.tracking_state.states[27].sid.sat = 247; - - + test_msg.tracking_state.states[28].cn0 = 70; - + test_msg.tracking_state.states[28].fcn = 233; - - + test_msg.tracking_state.states[28].sid.code = 101; - + test_msg.tracking_state.states[28].sid.sat = 137; - - + test_msg.tracking_state.states[29].cn0 = 110; - + test_msg.tracking_state.states[29].fcn = 38; - - + test_msg.tracking_state.states[29].sid.code = 165; - + test_msg.tracking_state.states[29].sid.sat = 49; - - + test_msg.tracking_state.states[30].cn0 = 213; - + test_msg.tracking_state.states[30].fcn = 80; - - + test_msg.tracking_state.states[30].sid.code = 230; - + test_msg.tracking_state.states[30].sid.sat = 218; - - + test_msg.tracking_state.states[31].cn0 = 128; - + test_msg.tracking_state.states[31].fcn = 139; - - + test_msg.tracking_state.states[31].sid.code = 179; - + test_msg.tracking_state.states[31].sid.sat = 196; - - + test_msg.tracking_state.states[32].cn0 = 171; - + test_msg.tracking_state.states[32].fcn = 196; - - + test_msg.tracking_state.states[32].sid.code = 178; - + test_msg.tracking_state.states[32].sid.sat = 15; - - + test_msg.tracking_state.states[33].cn0 = 194; - + test_msg.tracking_state.states[33].fcn = 97; - - + test_msg.tracking_state.states[33].sid.code = 212; - + test_msg.tracking_state.states[33].sid.sat = 8; - - + test_msg.tracking_state.states[34].cn0 = 99; - + test_msg.tracking_state.states[34].fcn = 79; - - + test_msg.tracking_state.states[34].sid.code = 233; - + test_msg.tracking_state.states[34].sid.sat = 83; - - + test_msg.tracking_state.states[35].cn0 = 180; - + test_msg.tracking_state.states[35].fcn = 31; - - + test_msg.tracking_state.states[35].sid.code = 90; - + test_msg.tracking_state.states[35].sid.sat = 55; - - + test_msg.tracking_state.states[36].cn0 = 186; - + test_msg.tracking_state.states[36].fcn = 105; - - + test_msg.tracking_state.states[36].sid.code = 25; - + test_msg.tracking_state.states[36].sid.sat = 5; - - + test_msg.tracking_state.states[37].cn0 = 111; - + test_msg.tracking_state.states[37].fcn = 80; - - + test_msg.tracking_state.states[37].sid.code = 224; - + test_msg.tracking_state.states[37].sid.sat = 22; - - + test_msg.tracking_state.states[38].cn0 = 166; - + test_msg.tracking_state.states[38].fcn = 106; - - + test_msg.tracking_state.states[38].sid.code = 48; - + test_msg.tracking_state.states[38].sid.sat = 8; - - + test_msg.tracking_state.states[39].cn0 = 49; - + test_msg.tracking_state.states[39].fcn = 156; - - + test_msg.tracking_state.states[39].sid.code = 48; - + test_msg.tracking_state.states[39].sid.sat = 4; - - + test_msg.tracking_state.states[40].cn0 = 146; - + test_msg.tracking_state.states[40].fcn = 142; - - + test_msg.tracking_state.states[40].sid.code = 19; - + test_msg.tracking_state.states[40].sid.sat = 86; - - + test_msg.tracking_state.states[41].cn0 = 64; - + test_msg.tracking_state.states[41].fcn = 115; - - + test_msg.tracking_state.states[41].sid.code = 124; - + test_msg.tracking_state.states[41].sid.sat = 91; - - + test_msg.tracking_state.states[42].cn0 = 178; - + test_msg.tracking_state.states[42].fcn = 115; - - + test_msg.tracking_state.states[42].sid.code = 230; - + test_msg.tracking_state.states[42].sid.sat = 28; - - + test_msg.tracking_state.states[43].cn0 = 242; - + test_msg.tracking_state.states[43].fcn = 16; - - + test_msg.tracking_state.states[43].sid.code = 131; - + test_msg.tracking_state.states[43].sid.sat = 190; - - + test_msg.tracking_state.states[44].cn0 = 113; - + test_msg.tracking_state.states[44].fcn = 182; - - + test_msg.tracking_state.states[44].sid.code = 59; - + test_msg.tracking_state.states[44].sid.sat = 105; - - + test_msg.tracking_state.states[45].cn0 = 179; - + test_msg.tracking_state.states[45].fcn = 48; - - + test_msg.tracking_state.states[45].sid.code = 180; - + test_msg.tracking_state.states[45].sid.sat = 192; - - + test_msg.tracking_state.states[46].cn0 = 211; - + test_msg.tracking_state.states[46].fcn = 172; - - + test_msg.tracking_state.states[46].sid.code = 31; - + test_msg.tracking_state.states[46].sid.sat = 166; - - + test_msg.tracking_state.states[47].cn0 = 49; - + test_msg.tracking_state.states[47].fcn = 140; - - + test_msg.tracking_state.states[47].sid.code = 228; - + test_msg.tracking_state.states[47].sid.sat = 77; - - + test_msg.tracking_state.states[48].cn0 = 194; - + test_msg.tracking_state.states[48].fcn = 240; - - + test_msg.tracking_state.states[48].sid.code = 77; - + test_msg.tracking_state.states[48].sid.sat = 128; - - + test_msg.tracking_state.states[49].cn0 = 58; - + test_msg.tracking_state.states[49].fcn = 41; - - + test_msg.tracking_state.states[49].sid.code = 194; - + test_msg.tracking_state.states[49].sid.sat = 134; - - + test_msg.tracking_state.states[50].cn0 = 55; - + test_msg.tracking_state.states[50].fcn = 129; - - + test_msg.tracking_state.states[50].sid.code = 53; - + test_msg.tracking_state.states[50].sid.sat = 18; - - + test_msg.tracking_state.states[51].cn0 = 92; - + test_msg.tracking_state.states[51].fcn = 134; - - + test_msg.tracking_state.states[51].sid.code = 72; - + test_msg.tracking_state.states[51].sid.sat = 91; - - + test_msg.tracking_state.states[52].cn0 = 56; - + test_msg.tracking_state.states[52].fcn = 157; - - + test_msg.tracking_state.states[52].sid.code = 224; - + test_msg.tracking_state.states[52].sid.sat = 33; - - + test_msg.tracking_state.states[53].cn0 = 174; - + test_msg.tracking_state.states[53].fcn = 224; - - + test_msg.tracking_state.states[53].sid.code = 54; - + test_msg.tracking_state.states[53].sid.sat = 186; - - + test_msg.tracking_state.states[54].cn0 = 190; - + test_msg.tracking_state.states[54].fcn = 148; - - + test_msg.tracking_state.states[54].sid.code = 84; - + test_msg.tracking_state.states[54].sid.sat = 82; - - + test_msg.tracking_state.states[55].cn0 = 67; - + test_msg.tracking_state.states[55].fcn = 62; - - + test_msg.tracking_state.states[55].sid.code = 54; - + test_msg.tracking_state.states[55].sid.sat = 236; - - + test_msg.tracking_state.states[56].cn0 = 254; - + test_msg.tracking_state.states[56].fcn = 57; - - + test_msg.tracking_state.states[56].sid.code = 215; - + test_msg.tracking_state.states[56].sid.sat = 52; - - + test_msg.tracking_state.states[57].cn0 = 174; - + test_msg.tracking_state.states[57].fcn = 36; - - + test_msg.tracking_state.states[57].sid.code = 133; - + test_msg.tracking_state.states[57].sid.sat = 16; - - + test_msg.tracking_state.states[58].cn0 = 17; - + test_msg.tracking_state.states[58].fcn = 145; - - + test_msg.tracking_state.states[58].sid.code = 172; - + test_msg.tracking_state.states[58].sid.sat = 219; - - + test_msg.tracking_state.states[59].cn0 = 97; - + test_msg.tracking_state.states[59].fcn = 111; - - + test_msg.tracking_state.states[59].sid.code = 179; - + test_msg.tracking_state.states[59].sid.sat = 192; - - + test_msg.tracking_state.states[60].cn0 = 134; - + test_msg.tracking_state.states[60].fcn = 208; - - + test_msg.tracking_state.states[60].sid.code = 56; - + test_msg.tracking_state.states[60].sid.sat = 207; - - + test_msg.tracking_state.states[61].cn0 = 226; - + test_msg.tracking_state.states[61].fcn = 43; - - + test_msg.tracking_state.states[61].sid.code = 17; - + test_msg.tracking_state.states[61].sid.sat = 180; - - + test_msg.tracking_state.states[62].cn0 = 113; - + test_msg.tracking_state.states[62].fcn = 140; - - + test_msg.tracking_state.states[62].sid.code = 182; - + test_msg.tracking_state.states[62].sid.sat = 255; - sbp_message_send(&sbp_state, SbpMsgTrackingState, 33079, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingState, 33079, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 33079, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingState, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgTrackingState, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.tracking_state.n_states == 63, "incorrect value for last_msg.msg.tracking_state.n_states, expected 63, is %d", last_msg.msg.tracking_state.n_states); - - - ck_assert_msg(last_msg.msg.tracking_state.states[0].cn0 == 102, "incorrect value for last_msg.msg.tracking_state.states[0].cn0, expected 102, is %d", last_msg.msg.tracking_state.states[0].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[0].fcn == 3, "incorrect value for last_msg.msg.tracking_state.states[0].fcn, expected 3, is %d", last_msg.msg.tracking_state.states[0].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[0].sid.code == 184, "incorrect value for last_msg.msg.tracking_state.states[0].sid.code, expected 184, is %d", last_msg.msg.tracking_state.states[0].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[0].sid.sat == 117, "incorrect value for last_msg.msg.tracking_state.states[0].sid.sat, expected 117, is %d", last_msg.msg.tracking_state.states[0].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[1].cn0 == 141, "incorrect value for last_msg.msg.tracking_state.states[1].cn0, expected 141, is %d", last_msg.msg.tracking_state.states[1].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[1].fcn == 140, "incorrect value for last_msg.msg.tracking_state.states[1].fcn, expected 140, is %d", last_msg.msg.tracking_state.states[1].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[1].sid.code == 106, "incorrect value for last_msg.msg.tracking_state.states[1].sid.code, expected 106, is %d", last_msg.msg.tracking_state.states[1].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[1].sid.sat == 38, "incorrect value for last_msg.msg.tracking_state.states[1].sid.sat, expected 38, is %d", last_msg.msg.tracking_state.states[1].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[2].cn0 == 195, "incorrect value for last_msg.msg.tracking_state.states[2].cn0, expected 195, is %d", last_msg.msg.tracking_state.states[2].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[2].fcn == 90, "incorrect value for last_msg.msg.tracking_state.states[2].fcn, expected 90, is %d", last_msg.msg.tracking_state.states[2].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[2].sid.code == 4, "incorrect value for last_msg.msg.tracking_state.states[2].sid.code, expected 4, is %d", last_msg.msg.tracking_state.states[2].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[2].sid.sat == 25, "incorrect value for last_msg.msg.tracking_state.states[2].sid.sat, expected 25, is %d", last_msg.msg.tracking_state.states[2].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[3].cn0 == 82, "incorrect value for last_msg.msg.tracking_state.states[3].cn0, expected 82, is %d", last_msg.msg.tracking_state.states[3].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[3].fcn == 75, "incorrect value for last_msg.msg.tracking_state.states[3].fcn, expected 75, is %d", last_msg.msg.tracking_state.states[3].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[3].sid.code == 108, "incorrect value for last_msg.msg.tracking_state.states[3].sid.code, expected 108, is %d", last_msg.msg.tracking_state.states[3].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[3].sid.sat == 246, "incorrect value for last_msg.msg.tracking_state.states[3].sid.sat, expected 246, is %d", last_msg.msg.tracking_state.states[3].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[4].cn0 == 163, "incorrect value for last_msg.msg.tracking_state.states[4].cn0, expected 163, is %d", last_msg.msg.tracking_state.states[4].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[4].fcn == 45, "incorrect value for last_msg.msg.tracking_state.states[4].fcn, expected 45, is %d", last_msg.msg.tracking_state.states[4].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[4].sid.code == 127, "incorrect value for last_msg.msg.tracking_state.states[4].sid.code, expected 127, is %d", last_msg.msg.tracking_state.states[4].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[4].sid.sat == 137, "incorrect value for last_msg.msg.tracking_state.states[4].sid.sat, expected 137, is %d", last_msg.msg.tracking_state.states[4].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[5].cn0 == 93, "incorrect value for last_msg.msg.tracking_state.states[5].cn0, expected 93, is %d", last_msg.msg.tracking_state.states[5].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[5].fcn == 187, "incorrect value for last_msg.msg.tracking_state.states[5].fcn, expected 187, is %d", last_msg.msg.tracking_state.states[5].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[5].sid.code == 46, "incorrect value for last_msg.msg.tracking_state.states[5].sid.code, expected 46, is %d", last_msg.msg.tracking_state.states[5].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[5].sid.sat == 32, "incorrect value for last_msg.msg.tracking_state.states[5].sid.sat, expected 32, is %d", last_msg.msg.tracking_state.states[5].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[6].cn0 == 147, "incorrect value for last_msg.msg.tracking_state.states[6].cn0, expected 147, is %d", last_msg.msg.tracking_state.states[6].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[6].fcn == 201, "incorrect value for last_msg.msg.tracking_state.states[6].fcn, expected 201, is %d", last_msg.msg.tracking_state.states[6].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[6].sid.code == 60, "incorrect value for last_msg.msg.tracking_state.states[6].sid.code, expected 60, is %d", last_msg.msg.tracking_state.states[6].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[6].sid.sat == 153, "incorrect value for last_msg.msg.tracking_state.states[6].sid.sat, expected 153, is %d", last_msg.msg.tracking_state.states[6].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[7].cn0 == 208, "incorrect value for last_msg.msg.tracking_state.states[7].cn0, expected 208, is %d", last_msg.msg.tracking_state.states[7].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[7].fcn == 5, "incorrect value for last_msg.msg.tracking_state.states[7].fcn, expected 5, is %d", last_msg.msg.tracking_state.states[7].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[7].sid.code == 29, "incorrect value for last_msg.msg.tracking_state.states[7].sid.code, expected 29, is %d", last_msg.msg.tracking_state.states[7].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[7].sid.sat == 23, "incorrect value for last_msg.msg.tracking_state.states[7].sid.sat, expected 23, is %d", last_msg.msg.tracking_state.states[7].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[8].cn0 == 69, "incorrect value for last_msg.msg.tracking_state.states[8].cn0, expected 69, is %d", last_msg.msg.tracking_state.states[8].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[8].fcn == 219, "incorrect value for last_msg.msg.tracking_state.states[8].fcn, expected 219, is %d", last_msg.msg.tracking_state.states[8].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[8].sid.code == 30, "incorrect value for last_msg.msg.tracking_state.states[8].sid.code, expected 30, is %d", last_msg.msg.tracking_state.states[8].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[8].sid.sat == 181, "incorrect value for last_msg.msg.tracking_state.states[8].sid.sat, expected 181, is %d", last_msg.msg.tracking_state.states[8].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[9].cn0 == 121, "incorrect value for last_msg.msg.tracking_state.states[9].cn0, expected 121, is %d", last_msg.msg.tracking_state.states[9].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[9].fcn == 3, "incorrect value for last_msg.msg.tracking_state.states[9].fcn, expected 3, is %d", last_msg.msg.tracking_state.states[9].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[9].sid.code == 136, "incorrect value for last_msg.msg.tracking_state.states[9].sid.code, expected 136, is %d", last_msg.msg.tracking_state.states[9].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[9].sid.sat == 254, "incorrect value for last_msg.msg.tracking_state.states[9].sid.sat, expected 254, is %d", last_msg.msg.tracking_state.states[9].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[10].cn0 == 215, "incorrect value for last_msg.msg.tracking_state.states[10].cn0, expected 215, is %d", last_msg.msg.tracking_state.states[10].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[10].fcn == 144, "incorrect value for last_msg.msg.tracking_state.states[10].fcn, expected 144, is %d", last_msg.msg.tracking_state.states[10].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[10].sid.code == 98, "incorrect value for last_msg.msg.tracking_state.states[10].sid.code, expected 98, is %d", last_msg.msg.tracking_state.states[10].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[10].sid.sat == 33, "incorrect value for last_msg.msg.tracking_state.states[10].sid.sat, expected 33, is %d", last_msg.msg.tracking_state.states[10].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[11].cn0 == 56, "incorrect value for last_msg.msg.tracking_state.states[11].cn0, expected 56, is %d", last_msg.msg.tracking_state.states[11].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[11].fcn == 14, "incorrect value for last_msg.msg.tracking_state.states[11].fcn, expected 14, is %d", last_msg.msg.tracking_state.states[11].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[11].sid.code == 182, "incorrect value for last_msg.msg.tracking_state.states[11].sid.code, expected 182, is %d", last_msg.msg.tracking_state.states[11].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[11].sid.sat == 133, "incorrect value for last_msg.msg.tracking_state.states[11].sid.sat, expected 133, is %d", last_msg.msg.tracking_state.states[11].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[12].cn0 == 62, "incorrect value for last_msg.msg.tracking_state.states[12].cn0, expected 62, is %d", last_msg.msg.tracking_state.states[12].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[12].fcn == 218, "incorrect value for last_msg.msg.tracking_state.states[12].fcn, expected 218, is %d", last_msg.msg.tracking_state.states[12].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[12].sid.code == 77, "incorrect value for last_msg.msg.tracking_state.states[12].sid.code, expected 77, is %d", last_msg.msg.tracking_state.states[12].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[12].sid.sat == 169, "incorrect value for last_msg.msg.tracking_state.states[12].sid.sat, expected 169, is %d", last_msg.msg.tracking_state.states[12].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[13].cn0 == 249, "incorrect value for last_msg.msg.tracking_state.states[13].cn0, expected 249, is %d", last_msg.msg.tracking_state.states[13].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[13].fcn == 171, "incorrect value for last_msg.msg.tracking_state.states[13].fcn, expected 171, is %d", last_msg.msg.tracking_state.states[13].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[13].sid.code == 84, "incorrect value for last_msg.msg.tracking_state.states[13].sid.code, expected 84, is %d", last_msg.msg.tracking_state.states[13].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[13].sid.sat == 242, "incorrect value for last_msg.msg.tracking_state.states[13].sid.sat, expected 242, is %d", last_msg.msg.tracking_state.states[13].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[14].cn0 == 130, "incorrect value for last_msg.msg.tracking_state.states[14].cn0, expected 130, is %d", last_msg.msg.tracking_state.states[14].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[14].fcn == 131, "incorrect value for last_msg.msg.tracking_state.states[14].fcn, expected 131, is %d", last_msg.msg.tracking_state.states[14].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[14].sid.code == 137, "incorrect value for last_msg.msg.tracking_state.states[14].sid.code, expected 137, is %d", last_msg.msg.tracking_state.states[14].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[14].sid.sat == 152, "incorrect value for last_msg.msg.tracking_state.states[14].sid.sat, expected 152, is %d", last_msg.msg.tracking_state.states[14].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[15].cn0 == 68, "incorrect value for last_msg.msg.tracking_state.states[15].cn0, expected 68, is %d", last_msg.msg.tracking_state.states[15].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[15].fcn == 42, "incorrect value for last_msg.msg.tracking_state.states[15].fcn, expected 42, is %d", last_msg.msg.tracking_state.states[15].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[15].sid.code == 21, "incorrect value for last_msg.msg.tracking_state.states[15].sid.code, expected 21, is %d", last_msg.msg.tracking_state.states[15].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[15].sid.sat == 193, "incorrect value for last_msg.msg.tracking_state.states[15].sid.sat, expected 193, is %d", last_msg.msg.tracking_state.states[15].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[16].cn0 == 227, "incorrect value for last_msg.msg.tracking_state.states[16].cn0, expected 227, is %d", last_msg.msg.tracking_state.states[16].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[16].fcn == 216, "incorrect value for last_msg.msg.tracking_state.states[16].fcn, expected 216, is %d", last_msg.msg.tracking_state.states[16].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[16].sid.code == 227, "incorrect value for last_msg.msg.tracking_state.states[16].sid.code, expected 227, is %d", last_msg.msg.tracking_state.states[16].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[16].sid.sat == 253, "incorrect value for last_msg.msg.tracking_state.states[16].sid.sat, expected 253, is %d", last_msg.msg.tracking_state.states[16].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[17].cn0 == 179, "incorrect value for last_msg.msg.tracking_state.states[17].cn0, expected 179, is %d", last_msg.msg.tracking_state.states[17].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[17].fcn == 210, "incorrect value for last_msg.msg.tracking_state.states[17].fcn, expected 210, is %d", last_msg.msg.tracking_state.states[17].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[17].sid.code == 26, "incorrect value for last_msg.msg.tracking_state.states[17].sid.code, expected 26, is %d", last_msg.msg.tracking_state.states[17].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[17].sid.sat == 24, "incorrect value for last_msg.msg.tracking_state.states[17].sid.sat, expected 24, is %d", last_msg.msg.tracking_state.states[17].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[18].cn0 == 255, "incorrect value for last_msg.msg.tracking_state.states[18].cn0, expected 255, is %d", last_msg.msg.tracking_state.states[18].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[18].fcn == 227, "incorrect value for last_msg.msg.tracking_state.states[18].fcn, expected 227, is %d", last_msg.msg.tracking_state.states[18].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[18].sid.code == 15, "incorrect value for last_msg.msg.tracking_state.states[18].sid.code, expected 15, is %d", last_msg.msg.tracking_state.states[18].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[18].sid.sat == 19, "incorrect value for last_msg.msg.tracking_state.states[18].sid.sat, expected 19, is %d", last_msg.msg.tracking_state.states[18].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[19].cn0 == 200, "incorrect value for last_msg.msg.tracking_state.states[19].cn0, expected 200, is %d", last_msg.msg.tracking_state.states[19].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[19].fcn == 187, "incorrect value for last_msg.msg.tracking_state.states[19].fcn, expected 187, is %d", last_msg.msg.tracking_state.states[19].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[19].sid.code == 75, "incorrect value for last_msg.msg.tracking_state.states[19].sid.code, expected 75, is %d", last_msg.msg.tracking_state.states[19].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[19].sid.sat == 122, "incorrect value for last_msg.msg.tracking_state.states[19].sid.sat, expected 122, is %d", last_msg.msg.tracking_state.states[19].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[20].cn0 == 122, "incorrect value for last_msg.msg.tracking_state.states[20].cn0, expected 122, is %d", last_msg.msg.tracking_state.states[20].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[20].fcn == 218, "incorrect value for last_msg.msg.tracking_state.states[20].fcn, expected 218, is %d", last_msg.msg.tracking_state.states[20].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[20].sid.code == 48, "incorrect value for last_msg.msg.tracking_state.states[20].sid.code, expected 48, is %d", last_msg.msg.tracking_state.states[20].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[20].sid.sat == 217, "incorrect value for last_msg.msg.tracking_state.states[20].sid.sat, expected 217, is %d", last_msg.msg.tracking_state.states[20].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[21].cn0 == 149, "incorrect value for last_msg.msg.tracking_state.states[21].cn0, expected 149, is %d", last_msg.msg.tracking_state.states[21].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[21].fcn == 142, "incorrect value for last_msg.msg.tracking_state.states[21].fcn, expected 142, is %d", last_msg.msg.tracking_state.states[21].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[21].sid.code == 238, "incorrect value for last_msg.msg.tracking_state.states[21].sid.code, expected 238, is %d", last_msg.msg.tracking_state.states[21].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[21].sid.sat == 187, "incorrect value for last_msg.msg.tracking_state.states[21].sid.sat, expected 187, is %d", last_msg.msg.tracking_state.states[21].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[22].cn0 == 212, "incorrect value for last_msg.msg.tracking_state.states[22].cn0, expected 212, is %d", last_msg.msg.tracking_state.states[22].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[22].fcn == 251, "incorrect value for last_msg.msg.tracking_state.states[22].fcn, expected 251, is %d", last_msg.msg.tracking_state.states[22].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[22].sid.code == 55, "incorrect value for last_msg.msg.tracking_state.states[22].sid.code, expected 55, is %d", last_msg.msg.tracking_state.states[22].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[22].sid.sat == 238, "incorrect value for last_msg.msg.tracking_state.states[22].sid.sat, expected 238, is %d", last_msg.msg.tracking_state.states[22].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[23].cn0 == 104, "incorrect value for last_msg.msg.tracking_state.states[23].cn0, expected 104, is %d", last_msg.msg.tracking_state.states[23].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[23].fcn == 194, "incorrect value for last_msg.msg.tracking_state.states[23].fcn, expected 194, is %d", last_msg.msg.tracking_state.states[23].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[23].sid.code == 160, "incorrect value for last_msg.msg.tracking_state.states[23].sid.code, expected 160, is %d", last_msg.msg.tracking_state.states[23].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[23].sid.sat == 128, "incorrect value for last_msg.msg.tracking_state.states[23].sid.sat, expected 128, is %d", last_msg.msg.tracking_state.states[23].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[24].cn0 == 62, "incorrect value for last_msg.msg.tracking_state.states[24].cn0, expected 62, is %d", last_msg.msg.tracking_state.states[24].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[24].fcn == 141, "incorrect value for last_msg.msg.tracking_state.states[24].fcn, expected 141, is %d", last_msg.msg.tracking_state.states[24].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[24].sid.code == 255, "incorrect value for last_msg.msg.tracking_state.states[24].sid.code, expected 255, is %d", last_msg.msg.tracking_state.states[24].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[24].sid.sat == 113, "incorrect value for last_msg.msg.tracking_state.states[24].sid.sat, expected 113, is %d", last_msg.msg.tracking_state.states[24].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[25].cn0 == 39, "incorrect value for last_msg.msg.tracking_state.states[25].cn0, expected 39, is %d", last_msg.msg.tracking_state.states[25].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[25].fcn == 245, "incorrect value for last_msg.msg.tracking_state.states[25].fcn, expected 245, is %d", last_msg.msg.tracking_state.states[25].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[25].sid.code == 69, "incorrect value for last_msg.msg.tracking_state.states[25].sid.code, expected 69, is %d", last_msg.msg.tracking_state.states[25].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[25].sid.sat == 43, "incorrect value for last_msg.msg.tracking_state.states[25].sid.sat, expected 43, is %d", last_msg.msg.tracking_state.states[25].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[26].cn0 == 56, "incorrect value for last_msg.msg.tracking_state.states[26].cn0, expected 56, is %d", last_msg.msg.tracking_state.states[26].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[26].fcn == 108, "incorrect value for last_msg.msg.tracking_state.states[26].fcn, expected 108, is %d", last_msg.msg.tracking_state.states[26].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[26].sid.code == 230, "incorrect value for last_msg.msg.tracking_state.states[26].sid.code, expected 230, is %d", last_msg.msg.tracking_state.states[26].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[26].sid.sat == 100, "incorrect value for last_msg.msg.tracking_state.states[26].sid.sat, expected 100, is %d", last_msg.msg.tracking_state.states[26].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[27].cn0 == 143, "incorrect value for last_msg.msg.tracking_state.states[27].cn0, expected 143, is %d", last_msg.msg.tracking_state.states[27].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[27].fcn == 149, "incorrect value for last_msg.msg.tracking_state.states[27].fcn, expected 149, is %d", last_msg.msg.tracking_state.states[27].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[27].sid.code == 68, "incorrect value for last_msg.msg.tracking_state.states[27].sid.code, expected 68, is %d", last_msg.msg.tracking_state.states[27].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[27].sid.sat == 247, "incorrect value for last_msg.msg.tracking_state.states[27].sid.sat, expected 247, is %d", last_msg.msg.tracking_state.states[27].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[28].cn0 == 70, "incorrect value for last_msg.msg.tracking_state.states[28].cn0, expected 70, is %d", last_msg.msg.tracking_state.states[28].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[28].fcn == 233, "incorrect value for last_msg.msg.tracking_state.states[28].fcn, expected 233, is %d", last_msg.msg.tracking_state.states[28].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[28].sid.code == 101, "incorrect value for last_msg.msg.tracking_state.states[28].sid.code, expected 101, is %d", last_msg.msg.tracking_state.states[28].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[28].sid.sat == 137, "incorrect value for last_msg.msg.tracking_state.states[28].sid.sat, expected 137, is %d", last_msg.msg.tracking_state.states[28].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[29].cn0 == 110, "incorrect value for last_msg.msg.tracking_state.states[29].cn0, expected 110, is %d", last_msg.msg.tracking_state.states[29].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[29].fcn == 38, "incorrect value for last_msg.msg.tracking_state.states[29].fcn, expected 38, is %d", last_msg.msg.tracking_state.states[29].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[29].sid.code == 165, "incorrect value for last_msg.msg.tracking_state.states[29].sid.code, expected 165, is %d", last_msg.msg.tracking_state.states[29].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[29].sid.sat == 49, "incorrect value for last_msg.msg.tracking_state.states[29].sid.sat, expected 49, is %d", last_msg.msg.tracking_state.states[29].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[30].cn0 == 213, "incorrect value for last_msg.msg.tracking_state.states[30].cn0, expected 213, is %d", last_msg.msg.tracking_state.states[30].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[30].fcn == 80, "incorrect value for last_msg.msg.tracking_state.states[30].fcn, expected 80, is %d", last_msg.msg.tracking_state.states[30].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[30].sid.code == 230, "incorrect value for last_msg.msg.tracking_state.states[30].sid.code, expected 230, is %d", last_msg.msg.tracking_state.states[30].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[30].sid.sat == 218, "incorrect value for last_msg.msg.tracking_state.states[30].sid.sat, expected 218, is %d", last_msg.msg.tracking_state.states[30].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[31].cn0 == 128, "incorrect value for last_msg.msg.tracking_state.states[31].cn0, expected 128, is %d", last_msg.msg.tracking_state.states[31].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[31].fcn == 139, "incorrect value for last_msg.msg.tracking_state.states[31].fcn, expected 139, is %d", last_msg.msg.tracking_state.states[31].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[31].sid.code == 179, "incorrect value for last_msg.msg.tracking_state.states[31].sid.code, expected 179, is %d", last_msg.msg.tracking_state.states[31].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[31].sid.sat == 196, "incorrect value for last_msg.msg.tracking_state.states[31].sid.sat, expected 196, is %d", last_msg.msg.tracking_state.states[31].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[32].cn0 == 171, "incorrect value for last_msg.msg.tracking_state.states[32].cn0, expected 171, is %d", last_msg.msg.tracking_state.states[32].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[32].fcn == 196, "incorrect value for last_msg.msg.tracking_state.states[32].fcn, expected 196, is %d", last_msg.msg.tracking_state.states[32].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[32].sid.code == 178, "incorrect value for last_msg.msg.tracking_state.states[32].sid.code, expected 178, is %d", last_msg.msg.tracking_state.states[32].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[32].sid.sat == 15, "incorrect value for last_msg.msg.tracking_state.states[32].sid.sat, expected 15, is %d", last_msg.msg.tracking_state.states[32].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[33].cn0 == 194, "incorrect value for last_msg.msg.tracking_state.states[33].cn0, expected 194, is %d", last_msg.msg.tracking_state.states[33].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[33].fcn == 97, "incorrect value for last_msg.msg.tracking_state.states[33].fcn, expected 97, is %d", last_msg.msg.tracking_state.states[33].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[33].sid.code == 212, "incorrect value for last_msg.msg.tracking_state.states[33].sid.code, expected 212, is %d", last_msg.msg.tracking_state.states[33].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[33].sid.sat == 8, "incorrect value for last_msg.msg.tracking_state.states[33].sid.sat, expected 8, is %d", last_msg.msg.tracking_state.states[33].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[34].cn0 == 99, "incorrect value for last_msg.msg.tracking_state.states[34].cn0, expected 99, is %d", last_msg.msg.tracking_state.states[34].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[34].fcn == 79, "incorrect value for last_msg.msg.tracking_state.states[34].fcn, expected 79, is %d", last_msg.msg.tracking_state.states[34].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[34].sid.code == 233, "incorrect value for last_msg.msg.tracking_state.states[34].sid.code, expected 233, is %d", last_msg.msg.tracking_state.states[34].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[34].sid.sat == 83, "incorrect value for last_msg.msg.tracking_state.states[34].sid.sat, expected 83, is %d", last_msg.msg.tracking_state.states[34].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[35].cn0 == 180, "incorrect value for last_msg.msg.tracking_state.states[35].cn0, expected 180, is %d", last_msg.msg.tracking_state.states[35].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[35].fcn == 31, "incorrect value for last_msg.msg.tracking_state.states[35].fcn, expected 31, is %d", last_msg.msg.tracking_state.states[35].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[35].sid.code == 90, "incorrect value for last_msg.msg.tracking_state.states[35].sid.code, expected 90, is %d", last_msg.msg.tracking_state.states[35].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[35].sid.sat == 55, "incorrect value for last_msg.msg.tracking_state.states[35].sid.sat, expected 55, is %d", last_msg.msg.tracking_state.states[35].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[36].cn0 == 186, "incorrect value for last_msg.msg.tracking_state.states[36].cn0, expected 186, is %d", last_msg.msg.tracking_state.states[36].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[36].fcn == 105, "incorrect value for last_msg.msg.tracking_state.states[36].fcn, expected 105, is %d", last_msg.msg.tracking_state.states[36].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[36].sid.code == 25, "incorrect value for last_msg.msg.tracking_state.states[36].sid.code, expected 25, is %d", last_msg.msg.tracking_state.states[36].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[36].sid.sat == 5, "incorrect value for last_msg.msg.tracking_state.states[36].sid.sat, expected 5, is %d", last_msg.msg.tracking_state.states[36].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[37].cn0 == 111, "incorrect value for last_msg.msg.tracking_state.states[37].cn0, expected 111, is %d", last_msg.msg.tracking_state.states[37].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[37].fcn == 80, "incorrect value for last_msg.msg.tracking_state.states[37].fcn, expected 80, is %d", last_msg.msg.tracking_state.states[37].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[37].sid.code == 224, "incorrect value for last_msg.msg.tracking_state.states[37].sid.code, expected 224, is %d", last_msg.msg.tracking_state.states[37].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[37].sid.sat == 22, "incorrect value for last_msg.msg.tracking_state.states[37].sid.sat, expected 22, is %d", last_msg.msg.tracking_state.states[37].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[38].cn0 == 166, "incorrect value for last_msg.msg.tracking_state.states[38].cn0, expected 166, is %d", last_msg.msg.tracking_state.states[38].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[38].fcn == 106, "incorrect value for last_msg.msg.tracking_state.states[38].fcn, expected 106, is %d", last_msg.msg.tracking_state.states[38].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[38].sid.code == 48, "incorrect value for last_msg.msg.tracking_state.states[38].sid.code, expected 48, is %d", last_msg.msg.tracking_state.states[38].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[38].sid.sat == 8, "incorrect value for last_msg.msg.tracking_state.states[38].sid.sat, expected 8, is %d", last_msg.msg.tracking_state.states[38].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[39].cn0 == 49, "incorrect value for last_msg.msg.tracking_state.states[39].cn0, expected 49, is %d", last_msg.msg.tracking_state.states[39].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[39].fcn == 156, "incorrect value for last_msg.msg.tracking_state.states[39].fcn, expected 156, is %d", last_msg.msg.tracking_state.states[39].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[39].sid.code == 48, "incorrect value for last_msg.msg.tracking_state.states[39].sid.code, expected 48, is %d", last_msg.msg.tracking_state.states[39].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[39].sid.sat == 4, "incorrect value for last_msg.msg.tracking_state.states[39].sid.sat, expected 4, is %d", last_msg.msg.tracking_state.states[39].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[40].cn0 == 146, "incorrect value for last_msg.msg.tracking_state.states[40].cn0, expected 146, is %d", last_msg.msg.tracking_state.states[40].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[40].fcn == 142, "incorrect value for last_msg.msg.tracking_state.states[40].fcn, expected 142, is %d", last_msg.msg.tracking_state.states[40].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[40].sid.code == 19, "incorrect value for last_msg.msg.tracking_state.states[40].sid.code, expected 19, is %d", last_msg.msg.tracking_state.states[40].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[40].sid.sat == 86, "incorrect value for last_msg.msg.tracking_state.states[40].sid.sat, expected 86, is %d", last_msg.msg.tracking_state.states[40].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[41].cn0 == 64, "incorrect value for last_msg.msg.tracking_state.states[41].cn0, expected 64, is %d", last_msg.msg.tracking_state.states[41].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[41].fcn == 115, "incorrect value for last_msg.msg.tracking_state.states[41].fcn, expected 115, is %d", last_msg.msg.tracking_state.states[41].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[41].sid.code == 124, "incorrect value for last_msg.msg.tracking_state.states[41].sid.code, expected 124, is %d", last_msg.msg.tracking_state.states[41].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[41].sid.sat == 91, "incorrect value for last_msg.msg.tracking_state.states[41].sid.sat, expected 91, is %d", last_msg.msg.tracking_state.states[41].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[42].cn0 == 178, "incorrect value for last_msg.msg.tracking_state.states[42].cn0, expected 178, is %d", last_msg.msg.tracking_state.states[42].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[42].fcn == 115, "incorrect value for last_msg.msg.tracking_state.states[42].fcn, expected 115, is %d", last_msg.msg.tracking_state.states[42].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[42].sid.code == 230, "incorrect value for last_msg.msg.tracking_state.states[42].sid.code, expected 230, is %d", last_msg.msg.tracking_state.states[42].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[42].sid.sat == 28, "incorrect value for last_msg.msg.tracking_state.states[42].sid.sat, expected 28, is %d", last_msg.msg.tracking_state.states[42].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[43].cn0 == 242, "incorrect value for last_msg.msg.tracking_state.states[43].cn0, expected 242, is %d", last_msg.msg.tracking_state.states[43].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[43].fcn == 16, "incorrect value for last_msg.msg.tracking_state.states[43].fcn, expected 16, is %d", last_msg.msg.tracking_state.states[43].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[43].sid.code == 131, "incorrect value for last_msg.msg.tracking_state.states[43].sid.code, expected 131, is %d", last_msg.msg.tracking_state.states[43].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[43].sid.sat == 190, "incorrect value for last_msg.msg.tracking_state.states[43].sid.sat, expected 190, is %d", last_msg.msg.tracking_state.states[43].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[44].cn0 == 113, "incorrect value for last_msg.msg.tracking_state.states[44].cn0, expected 113, is %d", last_msg.msg.tracking_state.states[44].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[44].fcn == 182, "incorrect value for last_msg.msg.tracking_state.states[44].fcn, expected 182, is %d", last_msg.msg.tracking_state.states[44].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[44].sid.code == 59, "incorrect value for last_msg.msg.tracking_state.states[44].sid.code, expected 59, is %d", last_msg.msg.tracking_state.states[44].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[44].sid.sat == 105, "incorrect value for last_msg.msg.tracking_state.states[44].sid.sat, expected 105, is %d", last_msg.msg.tracking_state.states[44].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[45].cn0 == 179, "incorrect value for last_msg.msg.tracking_state.states[45].cn0, expected 179, is %d", last_msg.msg.tracking_state.states[45].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[45].fcn == 48, "incorrect value for last_msg.msg.tracking_state.states[45].fcn, expected 48, is %d", last_msg.msg.tracking_state.states[45].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[45].sid.code == 180, "incorrect value for last_msg.msg.tracking_state.states[45].sid.code, expected 180, is %d", last_msg.msg.tracking_state.states[45].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[45].sid.sat == 192, "incorrect value for last_msg.msg.tracking_state.states[45].sid.sat, expected 192, is %d", last_msg.msg.tracking_state.states[45].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[46].cn0 == 211, "incorrect value for last_msg.msg.tracking_state.states[46].cn0, expected 211, is %d", last_msg.msg.tracking_state.states[46].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[46].fcn == 172, "incorrect value for last_msg.msg.tracking_state.states[46].fcn, expected 172, is %d", last_msg.msg.tracking_state.states[46].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[46].sid.code == 31, "incorrect value for last_msg.msg.tracking_state.states[46].sid.code, expected 31, is %d", last_msg.msg.tracking_state.states[46].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[46].sid.sat == 166, "incorrect value for last_msg.msg.tracking_state.states[46].sid.sat, expected 166, is %d", last_msg.msg.tracking_state.states[46].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[47].cn0 == 49, "incorrect value for last_msg.msg.tracking_state.states[47].cn0, expected 49, is %d", last_msg.msg.tracking_state.states[47].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[47].fcn == 140, "incorrect value for last_msg.msg.tracking_state.states[47].fcn, expected 140, is %d", last_msg.msg.tracking_state.states[47].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[47].sid.code == 228, "incorrect value for last_msg.msg.tracking_state.states[47].sid.code, expected 228, is %d", last_msg.msg.tracking_state.states[47].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[47].sid.sat == 77, "incorrect value for last_msg.msg.tracking_state.states[47].sid.sat, expected 77, is %d", last_msg.msg.tracking_state.states[47].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[48].cn0 == 194, "incorrect value for last_msg.msg.tracking_state.states[48].cn0, expected 194, is %d", last_msg.msg.tracking_state.states[48].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[48].fcn == 240, "incorrect value for last_msg.msg.tracking_state.states[48].fcn, expected 240, is %d", last_msg.msg.tracking_state.states[48].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[48].sid.code == 77, "incorrect value for last_msg.msg.tracking_state.states[48].sid.code, expected 77, is %d", last_msg.msg.tracking_state.states[48].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[48].sid.sat == 128, "incorrect value for last_msg.msg.tracking_state.states[48].sid.sat, expected 128, is %d", last_msg.msg.tracking_state.states[48].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[49].cn0 == 58, "incorrect value for last_msg.msg.tracking_state.states[49].cn0, expected 58, is %d", last_msg.msg.tracking_state.states[49].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[49].fcn == 41, "incorrect value for last_msg.msg.tracking_state.states[49].fcn, expected 41, is %d", last_msg.msg.tracking_state.states[49].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[49].sid.code == 194, "incorrect value for last_msg.msg.tracking_state.states[49].sid.code, expected 194, is %d", last_msg.msg.tracking_state.states[49].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[49].sid.sat == 134, "incorrect value for last_msg.msg.tracking_state.states[49].sid.sat, expected 134, is %d", last_msg.msg.tracking_state.states[49].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[50].cn0 == 55, "incorrect value for last_msg.msg.tracking_state.states[50].cn0, expected 55, is %d", last_msg.msg.tracking_state.states[50].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[50].fcn == 129, "incorrect value for last_msg.msg.tracking_state.states[50].fcn, expected 129, is %d", last_msg.msg.tracking_state.states[50].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[50].sid.code == 53, "incorrect value for last_msg.msg.tracking_state.states[50].sid.code, expected 53, is %d", last_msg.msg.tracking_state.states[50].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[50].sid.sat == 18, "incorrect value for last_msg.msg.tracking_state.states[50].sid.sat, expected 18, is %d", last_msg.msg.tracking_state.states[50].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[51].cn0 == 92, "incorrect value for last_msg.msg.tracking_state.states[51].cn0, expected 92, is %d", last_msg.msg.tracking_state.states[51].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[51].fcn == 134, "incorrect value for last_msg.msg.tracking_state.states[51].fcn, expected 134, is %d", last_msg.msg.tracking_state.states[51].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[51].sid.code == 72, "incorrect value for last_msg.msg.tracking_state.states[51].sid.code, expected 72, is %d", last_msg.msg.tracking_state.states[51].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[51].sid.sat == 91, "incorrect value for last_msg.msg.tracking_state.states[51].sid.sat, expected 91, is %d", last_msg.msg.tracking_state.states[51].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[52].cn0 == 56, "incorrect value for last_msg.msg.tracking_state.states[52].cn0, expected 56, is %d", last_msg.msg.tracking_state.states[52].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[52].fcn == 157, "incorrect value for last_msg.msg.tracking_state.states[52].fcn, expected 157, is %d", last_msg.msg.tracking_state.states[52].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[52].sid.code == 224, "incorrect value for last_msg.msg.tracking_state.states[52].sid.code, expected 224, is %d", last_msg.msg.tracking_state.states[52].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[52].sid.sat == 33, "incorrect value for last_msg.msg.tracking_state.states[52].sid.sat, expected 33, is %d", last_msg.msg.tracking_state.states[52].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[53].cn0 == 174, "incorrect value for last_msg.msg.tracking_state.states[53].cn0, expected 174, is %d", last_msg.msg.tracking_state.states[53].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[53].fcn == 224, "incorrect value for last_msg.msg.tracking_state.states[53].fcn, expected 224, is %d", last_msg.msg.tracking_state.states[53].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[53].sid.code == 54, "incorrect value for last_msg.msg.tracking_state.states[53].sid.code, expected 54, is %d", last_msg.msg.tracking_state.states[53].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[53].sid.sat == 186, "incorrect value for last_msg.msg.tracking_state.states[53].sid.sat, expected 186, is %d", last_msg.msg.tracking_state.states[53].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[54].cn0 == 190, "incorrect value for last_msg.msg.tracking_state.states[54].cn0, expected 190, is %d", last_msg.msg.tracking_state.states[54].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[54].fcn == 148, "incorrect value for last_msg.msg.tracking_state.states[54].fcn, expected 148, is %d", last_msg.msg.tracking_state.states[54].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[54].sid.code == 84, "incorrect value for last_msg.msg.tracking_state.states[54].sid.code, expected 84, is %d", last_msg.msg.tracking_state.states[54].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[54].sid.sat == 82, "incorrect value for last_msg.msg.tracking_state.states[54].sid.sat, expected 82, is %d", last_msg.msg.tracking_state.states[54].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[55].cn0 == 67, "incorrect value for last_msg.msg.tracking_state.states[55].cn0, expected 67, is %d", last_msg.msg.tracking_state.states[55].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[55].fcn == 62, "incorrect value for last_msg.msg.tracking_state.states[55].fcn, expected 62, is %d", last_msg.msg.tracking_state.states[55].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[55].sid.code == 54, "incorrect value for last_msg.msg.tracking_state.states[55].sid.code, expected 54, is %d", last_msg.msg.tracking_state.states[55].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[55].sid.sat == 236, "incorrect value for last_msg.msg.tracking_state.states[55].sid.sat, expected 236, is %d", last_msg.msg.tracking_state.states[55].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[56].cn0 == 254, "incorrect value for last_msg.msg.tracking_state.states[56].cn0, expected 254, is %d", last_msg.msg.tracking_state.states[56].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[56].fcn == 57, "incorrect value for last_msg.msg.tracking_state.states[56].fcn, expected 57, is %d", last_msg.msg.tracking_state.states[56].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[56].sid.code == 215, "incorrect value for last_msg.msg.tracking_state.states[56].sid.code, expected 215, is %d", last_msg.msg.tracking_state.states[56].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[56].sid.sat == 52, "incorrect value for last_msg.msg.tracking_state.states[56].sid.sat, expected 52, is %d", last_msg.msg.tracking_state.states[56].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[57].cn0 == 174, "incorrect value for last_msg.msg.tracking_state.states[57].cn0, expected 174, is %d", last_msg.msg.tracking_state.states[57].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[57].fcn == 36, "incorrect value for last_msg.msg.tracking_state.states[57].fcn, expected 36, is %d", last_msg.msg.tracking_state.states[57].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[57].sid.code == 133, "incorrect value for last_msg.msg.tracking_state.states[57].sid.code, expected 133, is %d", last_msg.msg.tracking_state.states[57].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[57].sid.sat == 16, "incorrect value for last_msg.msg.tracking_state.states[57].sid.sat, expected 16, is %d", last_msg.msg.tracking_state.states[57].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[58].cn0 == 17, "incorrect value for last_msg.msg.tracking_state.states[58].cn0, expected 17, is %d", last_msg.msg.tracking_state.states[58].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[58].fcn == 145, "incorrect value for last_msg.msg.tracking_state.states[58].fcn, expected 145, is %d", last_msg.msg.tracking_state.states[58].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[58].sid.code == 172, "incorrect value for last_msg.msg.tracking_state.states[58].sid.code, expected 172, is %d", last_msg.msg.tracking_state.states[58].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[58].sid.sat == 219, "incorrect value for last_msg.msg.tracking_state.states[58].sid.sat, expected 219, is %d", last_msg.msg.tracking_state.states[58].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[59].cn0 == 97, "incorrect value for last_msg.msg.tracking_state.states[59].cn0, expected 97, is %d", last_msg.msg.tracking_state.states[59].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[59].fcn == 111, "incorrect value for last_msg.msg.tracking_state.states[59].fcn, expected 111, is %d", last_msg.msg.tracking_state.states[59].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[59].sid.code == 179, "incorrect value for last_msg.msg.tracking_state.states[59].sid.code, expected 179, is %d", last_msg.msg.tracking_state.states[59].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[59].sid.sat == 192, "incorrect value for last_msg.msg.tracking_state.states[59].sid.sat, expected 192, is %d", last_msg.msg.tracking_state.states[59].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[60].cn0 == 134, "incorrect value for last_msg.msg.tracking_state.states[60].cn0, expected 134, is %d", last_msg.msg.tracking_state.states[60].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[60].fcn == 208, "incorrect value for last_msg.msg.tracking_state.states[60].fcn, expected 208, is %d", last_msg.msg.tracking_state.states[60].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[60].sid.code == 56, "incorrect value for last_msg.msg.tracking_state.states[60].sid.code, expected 56, is %d", last_msg.msg.tracking_state.states[60].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[60].sid.sat == 207, "incorrect value for last_msg.msg.tracking_state.states[60].sid.sat, expected 207, is %d", last_msg.msg.tracking_state.states[60].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[61].cn0 == 226, "incorrect value for last_msg.msg.tracking_state.states[61].cn0, expected 226, is %d", last_msg.msg.tracking_state.states[61].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[61].fcn == 43, "incorrect value for last_msg.msg.tracking_state.states[61].fcn, expected 43, is %d", last_msg.msg.tracking_state.states[61].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[61].sid.code == 17, "incorrect value for last_msg.msg.tracking_state.states[61].sid.code, expected 17, is %d", last_msg.msg.tracking_state.states[61].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[61].sid.sat == 180, "incorrect value for last_msg.msg.tracking_state.states[61].sid.sat, expected 180, is %d", last_msg.msg.tracking_state.states[61].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state.states[62].cn0 == 113, "incorrect value for last_msg.msg.tracking_state.states[62].cn0, expected 113, is %d", last_msg.msg.tracking_state.states[62].cn0); - - ck_assert_msg(last_msg.msg.tracking_state.states[62].fcn == 140, "incorrect value for last_msg.msg.tracking_state.states[62].fcn, expected 140, is %d", last_msg.msg.tracking_state.states[62].fcn); - - - ck_assert_msg(last_msg.msg.tracking_state.states[62].sid.code == 182, "incorrect value for last_msg.msg.tracking_state.states[62].sid.code, expected 182, is %d", last_msg.msg.tracking_state.states[62].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state.states[62].sid.sat == 255, "incorrect value for last_msg.msg.tracking_state.states[62].sid.sat, expected 255, is %d", last_msg.msg.tracking_state.states[62].sid.sat); + ck_assert_msg(last_msg.msg.tracking_state.n_states == 63, + "incorrect value for last_msg.msg.tracking_state.n_states, " + "expected 63, is %d", + last_msg.msg.tracking_state.n_states); + + ck_assert_msg( + last_msg.msg.tracking_state.states[0].cn0 == 102, + "incorrect value for last_msg.msg.tracking_state.states[0].cn0, " + "expected 102, is %d", + last_msg.msg.tracking_state.states[0].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[0].fcn == 3, + "incorrect value for last_msg.msg.tracking_state.states[0].fcn, " + "expected 3, is %d", + last_msg.msg.tracking_state.states[0].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[0].sid.code == 184, + "incorrect value for last_msg.msg.tracking_state.states[0].sid.code, " + "expected 184, is %d", + last_msg.msg.tracking_state.states[0].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[0].sid.sat == 117, + "incorrect value for last_msg.msg.tracking_state.states[0].sid.sat, " + "expected 117, is %d", + last_msg.msg.tracking_state.states[0].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[1].cn0 == 141, + "incorrect value for last_msg.msg.tracking_state.states[1].cn0, " + "expected 141, is %d", + last_msg.msg.tracking_state.states[1].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[1].fcn == 140, + "incorrect value for last_msg.msg.tracking_state.states[1].fcn, " + "expected 140, is %d", + last_msg.msg.tracking_state.states[1].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[1].sid.code == 106, + "incorrect value for last_msg.msg.tracking_state.states[1].sid.code, " + "expected 106, is %d", + last_msg.msg.tracking_state.states[1].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[1].sid.sat == 38, + "incorrect value for last_msg.msg.tracking_state.states[1].sid.sat, " + "expected 38, is %d", + last_msg.msg.tracking_state.states[1].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[2].cn0 == 195, + "incorrect value for last_msg.msg.tracking_state.states[2].cn0, " + "expected 195, is %d", + last_msg.msg.tracking_state.states[2].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[2].fcn == 90, + "incorrect value for last_msg.msg.tracking_state.states[2].fcn, " + "expected 90, is %d", + last_msg.msg.tracking_state.states[2].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[2].sid.code == 4, + "incorrect value for last_msg.msg.tracking_state.states[2].sid.code, " + "expected 4, is %d", + last_msg.msg.tracking_state.states[2].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[2].sid.sat == 25, + "incorrect value for last_msg.msg.tracking_state.states[2].sid.sat, " + "expected 25, is %d", + last_msg.msg.tracking_state.states[2].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[3].cn0 == 82, + "incorrect value for last_msg.msg.tracking_state.states[3].cn0, " + "expected 82, is %d", + last_msg.msg.tracking_state.states[3].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[3].fcn == 75, + "incorrect value for last_msg.msg.tracking_state.states[3].fcn, " + "expected 75, is %d", + last_msg.msg.tracking_state.states[3].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[3].sid.code == 108, + "incorrect value for last_msg.msg.tracking_state.states[3].sid.code, " + "expected 108, is %d", + last_msg.msg.tracking_state.states[3].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[3].sid.sat == 246, + "incorrect value for last_msg.msg.tracking_state.states[3].sid.sat, " + "expected 246, is %d", + last_msg.msg.tracking_state.states[3].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[4].cn0 == 163, + "incorrect value for last_msg.msg.tracking_state.states[4].cn0, " + "expected 163, is %d", + last_msg.msg.tracking_state.states[4].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[4].fcn == 45, + "incorrect value for last_msg.msg.tracking_state.states[4].fcn, " + "expected 45, is %d", + last_msg.msg.tracking_state.states[4].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[4].sid.code == 127, + "incorrect value for last_msg.msg.tracking_state.states[4].sid.code, " + "expected 127, is %d", + last_msg.msg.tracking_state.states[4].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[4].sid.sat == 137, + "incorrect value for last_msg.msg.tracking_state.states[4].sid.sat, " + "expected 137, is %d", + last_msg.msg.tracking_state.states[4].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[5].cn0 == 93, + "incorrect value for last_msg.msg.tracking_state.states[5].cn0, " + "expected 93, is %d", + last_msg.msg.tracking_state.states[5].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[5].fcn == 187, + "incorrect value for last_msg.msg.tracking_state.states[5].fcn, " + "expected 187, is %d", + last_msg.msg.tracking_state.states[5].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[5].sid.code == 46, + "incorrect value for last_msg.msg.tracking_state.states[5].sid.code, " + "expected 46, is %d", + last_msg.msg.tracking_state.states[5].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[5].sid.sat == 32, + "incorrect value for last_msg.msg.tracking_state.states[5].sid.sat, " + "expected 32, is %d", + last_msg.msg.tracking_state.states[5].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[6].cn0 == 147, + "incorrect value for last_msg.msg.tracking_state.states[6].cn0, " + "expected 147, is %d", + last_msg.msg.tracking_state.states[6].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[6].fcn == 201, + "incorrect value for last_msg.msg.tracking_state.states[6].fcn, " + "expected 201, is %d", + last_msg.msg.tracking_state.states[6].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[6].sid.code == 60, + "incorrect value for last_msg.msg.tracking_state.states[6].sid.code, " + "expected 60, is %d", + last_msg.msg.tracking_state.states[6].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[6].sid.sat == 153, + "incorrect value for last_msg.msg.tracking_state.states[6].sid.sat, " + "expected 153, is %d", + last_msg.msg.tracking_state.states[6].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[7].cn0 == 208, + "incorrect value for last_msg.msg.tracking_state.states[7].cn0, " + "expected 208, is %d", + last_msg.msg.tracking_state.states[7].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[7].fcn == 5, + "incorrect value for last_msg.msg.tracking_state.states[7].fcn, " + "expected 5, is %d", + last_msg.msg.tracking_state.states[7].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[7].sid.code == 29, + "incorrect value for last_msg.msg.tracking_state.states[7].sid.code, " + "expected 29, is %d", + last_msg.msg.tracking_state.states[7].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[7].sid.sat == 23, + "incorrect value for last_msg.msg.tracking_state.states[7].sid.sat, " + "expected 23, is %d", + last_msg.msg.tracking_state.states[7].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[8].cn0 == 69, + "incorrect value for last_msg.msg.tracking_state.states[8].cn0, " + "expected 69, is %d", + last_msg.msg.tracking_state.states[8].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[8].fcn == 219, + "incorrect value for last_msg.msg.tracking_state.states[8].fcn, " + "expected 219, is %d", + last_msg.msg.tracking_state.states[8].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[8].sid.code == 30, + "incorrect value for last_msg.msg.tracking_state.states[8].sid.code, " + "expected 30, is %d", + last_msg.msg.tracking_state.states[8].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[8].sid.sat == 181, + "incorrect value for last_msg.msg.tracking_state.states[8].sid.sat, " + "expected 181, is %d", + last_msg.msg.tracking_state.states[8].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[9].cn0 == 121, + "incorrect value for last_msg.msg.tracking_state.states[9].cn0, " + "expected 121, is %d", + last_msg.msg.tracking_state.states[9].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[9].fcn == 3, + "incorrect value for last_msg.msg.tracking_state.states[9].fcn, " + "expected 3, is %d", + last_msg.msg.tracking_state.states[9].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[9].sid.code == 136, + "incorrect value for last_msg.msg.tracking_state.states[9].sid.code, " + "expected 136, is %d", + last_msg.msg.tracking_state.states[9].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[9].sid.sat == 254, + "incorrect value for last_msg.msg.tracking_state.states[9].sid.sat, " + "expected 254, is %d", + last_msg.msg.tracking_state.states[9].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[10].cn0 == 215, + "incorrect value for last_msg.msg.tracking_state.states[10].cn0, " + "expected 215, is %d", + last_msg.msg.tracking_state.states[10].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[10].fcn == 144, + "incorrect value for last_msg.msg.tracking_state.states[10].fcn, " + "expected 144, is %d", + last_msg.msg.tracking_state.states[10].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[10].sid.code == 98, + "incorrect value for last_msg.msg.tracking_state.states[10].sid.code, " + "expected 98, is %d", + last_msg.msg.tracking_state.states[10].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[10].sid.sat == 33, + "incorrect value for last_msg.msg.tracking_state.states[10].sid.sat, " + "expected 33, is %d", + last_msg.msg.tracking_state.states[10].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[11].cn0 == 56, + "incorrect value for last_msg.msg.tracking_state.states[11].cn0, " + "expected 56, is %d", + last_msg.msg.tracking_state.states[11].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[11].fcn == 14, + "incorrect value for last_msg.msg.tracking_state.states[11].fcn, " + "expected 14, is %d", + last_msg.msg.tracking_state.states[11].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[11].sid.code == 182, + "incorrect value for last_msg.msg.tracking_state.states[11].sid.code, " + "expected 182, is %d", + last_msg.msg.tracking_state.states[11].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[11].sid.sat == 133, + "incorrect value for last_msg.msg.tracking_state.states[11].sid.sat, " + "expected 133, is %d", + last_msg.msg.tracking_state.states[11].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[12].cn0 == 62, + "incorrect value for last_msg.msg.tracking_state.states[12].cn0, " + "expected 62, is %d", + last_msg.msg.tracking_state.states[12].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[12].fcn == 218, + "incorrect value for last_msg.msg.tracking_state.states[12].fcn, " + "expected 218, is %d", + last_msg.msg.tracking_state.states[12].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[12].sid.code == 77, + "incorrect value for last_msg.msg.tracking_state.states[12].sid.code, " + "expected 77, is %d", + last_msg.msg.tracking_state.states[12].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[12].sid.sat == 169, + "incorrect value for last_msg.msg.tracking_state.states[12].sid.sat, " + "expected 169, is %d", + last_msg.msg.tracking_state.states[12].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[13].cn0 == 249, + "incorrect value for last_msg.msg.tracking_state.states[13].cn0, " + "expected 249, is %d", + last_msg.msg.tracking_state.states[13].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[13].fcn == 171, + "incorrect value for last_msg.msg.tracking_state.states[13].fcn, " + "expected 171, is %d", + last_msg.msg.tracking_state.states[13].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[13].sid.code == 84, + "incorrect value for last_msg.msg.tracking_state.states[13].sid.code, " + "expected 84, is %d", + last_msg.msg.tracking_state.states[13].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[13].sid.sat == 242, + "incorrect value for last_msg.msg.tracking_state.states[13].sid.sat, " + "expected 242, is %d", + last_msg.msg.tracking_state.states[13].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[14].cn0 == 130, + "incorrect value for last_msg.msg.tracking_state.states[14].cn0, " + "expected 130, is %d", + last_msg.msg.tracking_state.states[14].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[14].fcn == 131, + "incorrect value for last_msg.msg.tracking_state.states[14].fcn, " + "expected 131, is %d", + last_msg.msg.tracking_state.states[14].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[14].sid.code == 137, + "incorrect value for last_msg.msg.tracking_state.states[14].sid.code, " + "expected 137, is %d", + last_msg.msg.tracking_state.states[14].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[14].sid.sat == 152, + "incorrect value for last_msg.msg.tracking_state.states[14].sid.sat, " + "expected 152, is %d", + last_msg.msg.tracking_state.states[14].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[15].cn0 == 68, + "incorrect value for last_msg.msg.tracking_state.states[15].cn0, " + "expected 68, is %d", + last_msg.msg.tracking_state.states[15].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[15].fcn == 42, + "incorrect value for last_msg.msg.tracking_state.states[15].fcn, " + "expected 42, is %d", + last_msg.msg.tracking_state.states[15].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[15].sid.code == 21, + "incorrect value for last_msg.msg.tracking_state.states[15].sid.code, " + "expected 21, is %d", + last_msg.msg.tracking_state.states[15].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[15].sid.sat == 193, + "incorrect value for last_msg.msg.tracking_state.states[15].sid.sat, " + "expected 193, is %d", + last_msg.msg.tracking_state.states[15].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[16].cn0 == 227, + "incorrect value for last_msg.msg.tracking_state.states[16].cn0, " + "expected 227, is %d", + last_msg.msg.tracking_state.states[16].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[16].fcn == 216, + "incorrect value for last_msg.msg.tracking_state.states[16].fcn, " + "expected 216, is %d", + last_msg.msg.tracking_state.states[16].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[16].sid.code == 227, + "incorrect value for last_msg.msg.tracking_state.states[16].sid.code, " + "expected 227, is %d", + last_msg.msg.tracking_state.states[16].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[16].sid.sat == 253, + "incorrect value for last_msg.msg.tracking_state.states[16].sid.sat, " + "expected 253, is %d", + last_msg.msg.tracking_state.states[16].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[17].cn0 == 179, + "incorrect value for last_msg.msg.tracking_state.states[17].cn0, " + "expected 179, is %d", + last_msg.msg.tracking_state.states[17].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[17].fcn == 210, + "incorrect value for last_msg.msg.tracking_state.states[17].fcn, " + "expected 210, is %d", + last_msg.msg.tracking_state.states[17].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[17].sid.code == 26, + "incorrect value for last_msg.msg.tracking_state.states[17].sid.code, " + "expected 26, is %d", + last_msg.msg.tracking_state.states[17].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[17].sid.sat == 24, + "incorrect value for last_msg.msg.tracking_state.states[17].sid.sat, " + "expected 24, is %d", + last_msg.msg.tracking_state.states[17].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[18].cn0 == 255, + "incorrect value for last_msg.msg.tracking_state.states[18].cn0, " + "expected 255, is %d", + last_msg.msg.tracking_state.states[18].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[18].fcn == 227, + "incorrect value for last_msg.msg.tracking_state.states[18].fcn, " + "expected 227, is %d", + last_msg.msg.tracking_state.states[18].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[18].sid.code == 15, + "incorrect value for last_msg.msg.tracking_state.states[18].sid.code, " + "expected 15, is %d", + last_msg.msg.tracking_state.states[18].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[18].sid.sat == 19, + "incorrect value for last_msg.msg.tracking_state.states[18].sid.sat, " + "expected 19, is %d", + last_msg.msg.tracking_state.states[18].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[19].cn0 == 200, + "incorrect value for last_msg.msg.tracking_state.states[19].cn0, " + "expected 200, is %d", + last_msg.msg.tracking_state.states[19].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[19].fcn == 187, + "incorrect value for last_msg.msg.tracking_state.states[19].fcn, " + "expected 187, is %d", + last_msg.msg.tracking_state.states[19].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[19].sid.code == 75, + "incorrect value for last_msg.msg.tracking_state.states[19].sid.code, " + "expected 75, is %d", + last_msg.msg.tracking_state.states[19].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[19].sid.sat == 122, + "incorrect value for last_msg.msg.tracking_state.states[19].sid.sat, " + "expected 122, is %d", + last_msg.msg.tracking_state.states[19].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[20].cn0 == 122, + "incorrect value for last_msg.msg.tracking_state.states[20].cn0, " + "expected 122, is %d", + last_msg.msg.tracking_state.states[20].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[20].fcn == 218, + "incorrect value for last_msg.msg.tracking_state.states[20].fcn, " + "expected 218, is %d", + last_msg.msg.tracking_state.states[20].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[20].sid.code == 48, + "incorrect value for last_msg.msg.tracking_state.states[20].sid.code, " + "expected 48, is %d", + last_msg.msg.tracking_state.states[20].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[20].sid.sat == 217, + "incorrect value for last_msg.msg.tracking_state.states[20].sid.sat, " + "expected 217, is %d", + last_msg.msg.tracking_state.states[20].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[21].cn0 == 149, + "incorrect value for last_msg.msg.tracking_state.states[21].cn0, " + "expected 149, is %d", + last_msg.msg.tracking_state.states[21].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[21].fcn == 142, + "incorrect value for last_msg.msg.tracking_state.states[21].fcn, " + "expected 142, is %d", + last_msg.msg.tracking_state.states[21].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[21].sid.code == 238, + "incorrect value for last_msg.msg.tracking_state.states[21].sid.code, " + "expected 238, is %d", + last_msg.msg.tracking_state.states[21].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[21].sid.sat == 187, + "incorrect value for last_msg.msg.tracking_state.states[21].sid.sat, " + "expected 187, is %d", + last_msg.msg.tracking_state.states[21].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[22].cn0 == 212, + "incorrect value for last_msg.msg.tracking_state.states[22].cn0, " + "expected 212, is %d", + last_msg.msg.tracking_state.states[22].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[22].fcn == 251, + "incorrect value for last_msg.msg.tracking_state.states[22].fcn, " + "expected 251, is %d", + last_msg.msg.tracking_state.states[22].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[22].sid.code == 55, + "incorrect value for last_msg.msg.tracking_state.states[22].sid.code, " + "expected 55, is %d", + last_msg.msg.tracking_state.states[22].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[22].sid.sat == 238, + "incorrect value for last_msg.msg.tracking_state.states[22].sid.sat, " + "expected 238, is %d", + last_msg.msg.tracking_state.states[22].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[23].cn0 == 104, + "incorrect value for last_msg.msg.tracking_state.states[23].cn0, " + "expected 104, is %d", + last_msg.msg.tracking_state.states[23].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[23].fcn == 194, + "incorrect value for last_msg.msg.tracking_state.states[23].fcn, " + "expected 194, is %d", + last_msg.msg.tracking_state.states[23].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[23].sid.code == 160, + "incorrect value for last_msg.msg.tracking_state.states[23].sid.code, " + "expected 160, is %d", + last_msg.msg.tracking_state.states[23].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[23].sid.sat == 128, + "incorrect value for last_msg.msg.tracking_state.states[23].sid.sat, " + "expected 128, is %d", + last_msg.msg.tracking_state.states[23].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[24].cn0 == 62, + "incorrect value for last_msg.msg.tracking_state.states[24].cn0, " + "expected 62, is %d", + last_msg.msg.tracking_state.states[24].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[24].fcn == 141, + "incorrect value for last_msg.msg.tracking_state.states[24].fcn, " + "expected 141, is %d", + last_msg.msg.tracking_state.states[24].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[24].sid.code == 255, + "incorrect value for last_msg.msg.tracking_state.states[24].sid.code, " + "expected 255, is %d", + last_msg.msg.tracking_state.states[24].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[24].sid.sat == 113, + "incorrect value for last_msg.msg.tracking_state.states[24].sid.sat, " + "expected 113, is %d", + last_msg.msg.tracking_state.states[24].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[25].cn0 == 39, + "incorrect value for last_msg.msg.tracking_state.states[25].cn0, " + "expected 39, is %d", + last_msg.msg.tracking_state.states[25].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[25].fcn == 245, + "incorrect value for last_msg.msg.tracking_state.states[25].fcn, " + "expected 245, is %d", + last_msg.msg.tracking_state.states[25].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[25].sid.code == 69, + "incorrect value for last_msg.msg.tracking_state.states[25].sid.code, " + "expected 69, is %d", + last_msg.msg.tracking_state.states[25].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[25].sid.sat == 43, + "incorrect value for last_msg.msg.tracking_state.states[25].sid.sat, " + "expected 43, is %d", + last_msg.msg.tracking_state.states[25].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[26].cn0 == 56, + "incorrect value for last_msg.msg.tracking_state.states[26].cn0, " + "expected 56, is %d", + last_msg.msg.tracking_state.states[26].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[26].fcn == 108, + "incorrect value for last_msg.msg.tracking_state.states[26].fcn, " + "expected 108, is %d", + last_msg.msg.tracking_state.states[26].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[26].sid.code == 230, + "incorrect value for last_msg.msg.tracking_state.states[26].sid.code, " + "expected 230, is %d", + last_msg.msg.tracking_state.states[26].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[26].sid.sat == 100, + "incorrect value for last_msg.msg.tracking_state.states[26].sid.sat, " + "expected 100, is %d", + last_msg.msg.tracking_state.states[26].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[27].cn0 == 143, + "incorrect value for last_msg.msg.tracking_state.states[27].cn0, " + "expected 143, is %d", + last_msg.msg.tracking_state.states[27].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[27].fcn == 149, + "incorrect value for last_msg.msg.tracking_state.states[27].fcn, " + "expected 149, is %d", + last_msg.msg.tracking_state.states[27].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[27].sid.code == 68, + "incorrect value for last_msg.msg.tracking_state.states[27].sid.code, " + "expected 68, is %d", + last_msg.msg.tracking_state.states[27].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[27].sid.sat == 247, + "incorrect value for last_msg.msg.tracking_state.states[27].sid.sat, " + "expected 247, is %d", + last_msg.msg.tracking_state.states[27].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[28].cn0 == 70, + "incorrect value for last_msg.msg.tracking_state.states[28].cn0, " + "expected 70, is %d", + last_msg.msg.tracking_state.states[28].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[28].fcn == 233, + "incorrect value for last_msg.msg.tracking_state.states[28].fcn, " + "expected 233, is %d", + last_msg.msg.tracking_state.states[28].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[28].sid.code == 101, + "incorrect value for last_msg.msg.tracking_state.states[28].sid.code, " + "expected 101, is %d", + last_msg.msg.tracking_state.states[28].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[28].sid.sat == 137, + "incorrect value for last_msg.msg.tracking_state.states[28].sid.sat, " + "expected 137, is %d", + last_msg.msg.tracking_state.states[28].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[29].cn0 == 110, + "incorrect value for last_msg.msg.tracking_state.states[29].cn0, " + "expected 110, is %d", + last_msg.msg.tracking_state.states[29].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[29].fcn == 38, + "incorrect value for last_msg.msg.tracking_state.states[29].fcn, " + "expected 38, is %d", + last_msg.msg.tracking_state.states[29].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[29].sid.code == 165, + "incorrect value for last_msg.msg.tracking_state.states[29].sid.code, " + "expected 165, is %d", + last_msg.msg.tracking_state.states[29].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[29].sid.sat == 49, + "incorrect value for last_msg.msg.tracking_state.states[29].sid.sat, " + "expected 49, is %d", + last_msg.msg.tracking_state.states[29].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[30].cn0 == 213, + "incorrect value for last_msg.msg.tracking_state.states[30].cn0, " + "expected 213, is %d", + last_msg.msg.tracking_state.states[30].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[30].fcn == 80, + "incorrect value for last_msg.msg.tracking_state.states[30].fcn, " + "expected 80, is %d", + last_msg.msg.tracking_state.states[30].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[30].sid.code == 230, + "incorrect value for last_msg.msg.tracking_state.states[30].sid.code, " + "expected 230, is %d", + last_msg.msg.tracking_state.states[30].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[30].sid.sat == 218, + "incorrect value for last_msg.msg.tracking_state.states[30].sid.sat, " + "expected 218, is %d", + last_msg.msg.tracking_state.states[30].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[31].cn0 == 128, + "incorrect value for last_msg.msg.tracking_state.states[31].cn0, " + "expected 128, is %d", + last_msg.msg.tracking_state.states[31].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[31].fcn == 139, + "incorrect value for last_msg.msg.tracking_state.states[31].fcn, " + "expected 139, is %d", + last_msg.msg.tracking_state.states[31].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[31].sid.code == 179, + "incorrect value for last_msg.msg.tracking_state.states[31].sid.code, " + "expected 179, is %d", + last_msg.msg.tracking_state.states[31].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[31].sid.sat == 196, + "incorrect value for last_msg.msg.tracking_state.states[31].sid.sat, " + "expected 196, is %d", + last_msg.msg.tracking_state.states[31].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[32].cn0 == 171, + "incorrect value for last_msg.msg.tracking_state.states[32].cn0, " + "expected 171, is %d", + last_msg.msg.tracking_state.states[32].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[32].fcn == 196, + "incorrect value for last_msg.msg.tracking_state.states[32].fcn, " + "expected 196, is %d", + last_msg.msg.tracking_state.states[32].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[32].sid.code == 178, + "incorrect value for last_msg.msg.tracking_state.states[32].sid.code, " + "expected 178, is %d", + last_msg.msg.tracking_state.states[32].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[32].sid.sat == 15, + "incorrect value for last_msg.msg.tracking_state.states[32].sid.sat, " + "expected 15, is %d", + last_msg.msg.tracking_state.states[32].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[33].cn0 == 194, + "incorrect value for last_msg.msg.tracking_state.states[33].cn0, " + "expected 194, is %d", + last_msg.msg.tracking_state.states[33].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[33].fcn == 97, + "incorrect value for last_msg.msg.tracking_state.states[33].fcn, " + "expected 97, is %d", + last_msg.msg.tracking_state.states[33].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[33].sid.code == 212, + "incorrect value for last_msg.msg.tracking_state.states[33].sid.code, " + "expected 212, is %d", + last_msg.msg.tracking_state.states[33].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[33].sid.sat == 8, + "incorrect value for last_msg.msg.tracking_state.states[33].sid.sat, " + "expected 8, is %d", + last_msg.msg.tracking_state.states[33].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[34].cn0 == 99, + "incorrect value for last_msg.msg.tracking_state.states[34].cn0, " + "expected 99, is %d", + last_msg.msg.tracking_state.states[34].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[34].fcn == 79, + "incorrect value for last_msg.msg.tracking_state.states[34].fcn, " + "expected 79, is %d", + last_msg.msg.tracking_state.states[34].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[34].sid.code == 233, + "incorrect value for last_msg.msg.tracking_state.states[34].sid.code, " + "expected 233, is %d", + last_msg.msg.tracking_state.states[34].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[34].sid.sat == 83, + "incorrect value for last_msg.msg.tracking_state.states[34].sid.sat, " + "expected 83, is %d", + last_msg.msg.tracking_state.states[34].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[35].cn0 == 180, + "incorrect value for last_msg.msg.tracking_state.states[35].cn0, " + "expected 180, is %d", + last_msg.msg.tracking_state.states[35].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[35].fcn == 31, + "incorrect value for last_msg.msg.tracking_state.states[35].fcn, " + "expected 31, is %d", + last_msg.msg.tracking_state.states[35].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[35].sid.code == 90, + "incorrect value for last_msg.msg.tracking_state.states[35].sid.code, " + "expected 90, is %d", + last_msg.msg.tracking_state.states[35].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[35].sid.sat == 55, + "incorrect value for last_msg.msg.tracking_state.states[35].sid.sat, " + "expected 55, is %d", + last_msg.msg.tracking_state.states[35].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[36].cn0 == 186, + "incorrect value for last_msg.msg.tracking_state.states[36].cn0, " + "expected 186, is %d", + last_msg.msg.tracking_state.states[36].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[36].fcn == 105, + "incorrect value for last_msg.msg.tracking_state.states[36].fcn, " + "expected 105, is %d", + last_msg.msg.tracking_state.states[36].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[36].sid.code == 25, + "incorrect value for last_msg.msg.tracking_state.states[36].sid.code, " + "expected 25, is %d", + last_msg.msg.tracking_state.states[36].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[36].sid.sat == 5, + "incorrect value for last_msg.msg.tracking_state.states[36].sid.sat, " + "expected 5, is %d", + last_msg.msg.tracking_state.states[36].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[37].cn0 == 111, + "incorrect value for last_msg.msg.tracking_state.states[37].cn0, " + "expected 111, is %d", + last_msg.msg.tracking_state.states[37].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[37].fcn == 80, + "incorrect value for last_msg.msg.tracking_state.states[37].fcn, " + "expected 80, is %d", + last_msg.msg.tracking_state.states[37].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[37].sid.code == 224, + "incorrect value for last_msg.msg.tracking_state.states[37].sid.code, " + "expected 224, is %d", + last_msg.msg.tracking_state.states[37].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[37].sid.sat == 22, + "incorrect value for last_msg.msg.tracking_state.states[37].sid.sat, " + "expected 22, is %d", + last_msg.msg.tracking_state.states[37].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[38].cn0 == 166, + "incorrect value for last_msg.msg.tracking_state.states[38].cn0, " + "expected 166, is %d", + last_msg.msg.tracking_state.states[38].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[38].fcn == 106, + "incorrect value for last_msg.msg.tracking_state.states[38].fcn, " + "expected 106, is %d", + last_msg.msg.tracking_state.states[38].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[38].sid.code == 48, + "incorrect value for last_msg.msg.tracking_state.states[38].sid.code, " + "expected 48, is %d", + last_msg.msg.tracking_state.states[38].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[38].sid.sat == 8, + "incorrect value for last_msg.msg.tracking_state.states[38].sid.sat, " + "expected 8, is %d", + last_msg.msg.tracking_state.states[38].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[39].cn0 == 49, + "incorrect value for last_msg.msg.tracking_state.states[39].cn0, " + "expected 49, is %d", + last_msg.msg.tracking_state.states[39].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[39].fcn == 156, + "incorrect value for last_msg.msg.tracking_state.states[39].fcn, " + "expected 156, is %d", + last_msg.msg.tracking_state.states[39].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[39].sid.code == 48, + "incorrect value for last_msg.msg.tracking_state.states[39].sid.code, " + "expected 48, is %d", + last_msg.msg.tracking_state.states[39].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[39].sid.sat == 4, + "incorrect value for last_msg.msg.tracking_state.states[39].sid.sat, " + "expected 4, is %d", + last_msg.msg.tracking_state.states[39].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[40].cn0 == 146, + "incorrect value for last_msg.msg.tracking_state.states[40].cn0, " + "expected 146, is %d", + last_msg.msg.tracking_state.states[40].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[40].fcn == 142, + "incorrect value for last_msg.msg.tracking_state.states[40].fcn, " + "expected 142, is %d", + last_msg.msg.tracking_state.states[40].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[40].sid.code == 19, + "incorrect value for last_msg.msg.tracking_state.states[40].sid.code, " + "expected 19, is %d", + last_msg.msg.tracking_state.states[40].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[40].sid.sat == 86, + "incorrect value for last_msg.msg.tracking_state.states[40].sid.sat, " + "expected 86, is %d", + last_msg.msg.tracking_state.states[40].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[41].cn0 == 64, + "incorrect value for last_msg.msg.tracking_state.states[41].cn0, " + "expected 64, is %d", + last_msg.msg.tracking_state.states[41].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[41].fcn == 115, + "incorrect value for last_msg.msg.tracking_state.states[41].fcn, " + "expected 115, is %d", + last_msg.msg.tracking_state.states[41].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[41].sid.code == 124, + "incorrect value for last_msg.msg.tracking_state.states[41].sid.code, " + "expected 124, is %d", + last_msg.msg.tracking_state.states[41].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[41].sid.sat == 91, + "incorrect value for last_msg.msg.tracking_state.states[41].sid.sat, " + "expected 91, is %d", + last_msg.msg.tracking_state.states[41].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[42].cn0 == 178, + "incorrect value for last_msg.msg.tracking_state.states[42].cn0, " + "expected 178, is %d", + last_msg.msg.tracking_state.states[42].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[42].fcn == 115, + "incorrect value for last_msg.msg.tracking_state.states[42].fcn, " + "expected 115, is %d", + last_msg.msg.tracking_state.states[42].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[42].sid.code == 230, + "incorrect value for last_msg.msg.tracking_state.states[42].sid.code, " + "expected 230, is %d", + last_msg.msg.tracking_state.states[42].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[42].sid.sat == 28, + "incorrect value for last_msg.msg.tracking_state.states[42].sid.sat, " + "expected 28, is %d", + last_msg.msg.tracking_state.states[42].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[43].cn0 == 242, + "incorrect value for last_msg.msg.tracking_state.states[43].cn0, " + "expected 242, is %d", + last_msg.msg.tracking_state.states[43].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[43].fcn == 16, + "incorrect value for last_msg.msg.tracking_state.states[43].fcn, " + "expected 16, is %d", + last_msg.msg.tracking_state.states[43].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[43].sid.code == 131, + "incorrect value for last_msg.msg.tracking_state.states[43].sid.code, " + "expected 131, is %d", + last_msg.msg.tracking_state.states[43].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[43].sid.sat == 190, + "incorrect value for last_msg.msg.tracking_state.states[43].sid.sat, " + "expected 190, is %d", + last_msg.msg.tracking_state.states[43].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[44].cn0 == 113, + "incorrect value for last_msg.msg.tracking_state.states[44].cn0, " + "expected 113, is %d", + last_msg.msg.tracking_state.states[44].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[44].fcn == 182, + "incorrect value for last_msg.msg.tracking_state.states[44].fcn, " + "expected 182, is %d", + last_msg.msg.tracking_state.states[44].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[44].sid.code == 59, + "incorrect value for last_msg.msg.tracking_state.states[44].sid.code, " + "expected 59, is %d", + last_msg.msg.tracking_state.states[44].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[44].sid.sat == 105, + "incorrect value for last_msg.msg.tracking_state.states[44].sid.sat, " + "expected 105, is %d", + last_msg.msg.tracking_state.states[44].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[45].cn0 == 179, + "incorrect value for last_msg.msg.tracking_state.states[45].cn0, " + "expected 179, is %d", + last_msg.msg.tracking_state.states[45].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[45].fcn == 48, + "incorrect value for last_msg.msg.tracking_state.states[45].fcn, " + "expected 48, is %d", + last_msg.msg.tracking_state.states[45].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[45].sid.code == 180, + "incorrect value for last_msg.msg.tracking_state.states[45].sid.code, " + "expected 180, is %d", + last_msg.msg.tracking_state.states[45].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[45].sid.sat == 192, + "incorrect value for last_msg.msg.tracking_state.states[45].sid.sat, " + "expected 192, is %d", + last_msg.msg.tracking_state.states[45].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[46].cn0 == 211, + "incorrect value for last_msg.msg.tracking_state.states[46].cn0, " + "expected 211, is %d", + last_msg.msg.tracking_state.states[46].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[46].fcn == 172, + "incorrect value for last_msg.msg.tracking_state.states[46].fcn, " + "expected 172, is %d", + last_msg.msg.tracking_state.states[46].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[46].sid.code == 31, + "incorrect value for last_msg.msg.tracking_state.states[46].sid.code, " + "expected 31, is %d", + last_msg.msg.tracking_state.states[46].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[46].sid.sat == 166, + "incorrect value for last_msg.msg.tracking_state.states[46].sid.sat, " + "expected 166, is %d", + last_msg.msg.tracking_state.states[46].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[47].cn0 == 49, + "incorrect value for last_msg.msg.tracking_state.states[47].cn0, " + "expected 49, is %d", + last_msg.msg.tracking_state.states[47].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[47].fcn == 140, + "incorrect value for last_msg.msg.tracking_state.states[47].fcn, " + "expected 140, is %d", + last_msg.msg.tracking_state.states[47].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[47].sid.code == 228, + "incorrect value for last_msg.msg.tracking_state.states[47].sid.code, " + "expected 228, is %d", + last_msg.msg.tracking_state.states[47].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[47].sid.sat == 77, + "incorrect value for last_msg.msg.tracking_state.states[47].sid.sat, " + "expected 77, is %d", + last_msg.msg.tracking_state.states[47].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[48].cn0 == 194, + "incorrect value for last_msg.msg.tracking_state.states[48].cn0, " + "expected 194, is %d", + last_msg.msg.tracking_state.states[48].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[48].fcn == 240, + "incorrect value for last_msg.msg.tracking_state.states[48].fcn, " + "expected 240, is %d", + last_msg.msg.tracking_state.states[48].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[48].sid.code == 77, + "incorrect value for last_msg.msg.tracking_state.states[48].sid.code, " + "expected 77, is %d", + last_msg.msg.tracking_state.states[48].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[48].sid.sat == 128, + "incorrect value for last_msg.msg.tracking_state.states[48].sid.sat, " + "expected 128, is %d", + last_msg.msg.tracking_state.states[48].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[49].cn0 == 58, + "incorrect value for last_msg.msg.tracking_state.states[49].cn0, " + "expected 58, is %d", + last_msg.msg.tracking_state.states[49].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[49].fcn == 41, + "incorrect value for last_msg.msg.tracking_state.states[49].fcn, " + "expected 41, is %d", + last_msg.msg.tracking_state.states[49].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[49].sid.code == 194, + "incorrect value for last_msg.msg.tracking_state.states[49].sid.code, " + "expected 194, is %d", + last_msg.msg.tracking_state.states[49].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[49].sid.sat == 134, + "incorrect value for last_msg.msg.tracking_state.states[49].sid.sat, " + "expected 134, is %d", + last_msg.msg.tracking_state.states[49].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[50].cn0 == 55, + "incorrect value for last_msg.msg.tracking_state.states[50].cn0, " + "expected 55, is %d", + last_msg.msg.tracking_state.states[50].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[50].fcn == 129, + "incorrect value for last_msg.msg.tracking_state.states[50].fcn, " + "expected 129, is %d", + last_msg.msg.tracking_state.states[50].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[50].sid.code == 53, + "incorrect value for last_msg.msg.tracking_state.states[50].sid.code, " + "expected 53, is %d", + last_msg.msg.tracking_state.states[50].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[50].sid.sat == 18, + "incorrect value for last_msg.msg.tracking_state.states[50].sid.sat, " + "expected 18, is %d", + last_msg.msg.tracking_state.states[50].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[51].cn0 == 92, + "incorrect value for last_msg.msg.tracking_state.states[51].cn0, " + "expected 92, is %d", + last_msg.msg.tracking_state.states[51].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[51].fcn == 134, + "incorrect value for last_msg.msg.tracking_state.states[51].fcn, " + "expected 134, is %d", + last_msg.msg.tracking_state.states[51].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[51].sid.code == 72, + "incorrect value for last_msg.msg.tracking_state.states[51].sid.code, " + "expected 72, is %d", + last_msg.msg.tracking_state.states[51].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[51].sid.sat == 91, + "incorrect value for last_msg.msg.tracking_state.states[51].sid.sat, " + "expected 91, is %d", + last_msg.msg.tracking_state.states[51].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[52].cn0 == 56, + "incorrect value for last_msg.msg.tracking_state.states[52].cn0, " + "expected 56, is %d", + last_msg.msg.tracking_state.states[52].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[52].fcn == 157, + "incorrect value for last_msg.msg.tracking_state.states[52].fcn, " + "expected 157, is %d", + last_msg.msg.tracking_state.states[52].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[52].sid.code == 224, + "incorrect value for last_msg.msg.tracking_state.states[52].sid.code, " + "expected 224, is %d", + last_msg.msg.tracking_state.states[52].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[52].sid.sat == 33, + "incorrect value for last_msg.msg.tracking_state.states[52].sid.sat, " + "expected 33, is %d", + last_msg.msg.tracking_state.states[52].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[53].cn0 == 174, + "incorrect value for last_msg.msg.tracking_state.states[53].cn0, " + "expected 174, is %d", + last_msg.msg.tracking_state.states[53].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[53].fcn == 224, + "incorrect value for last_msg.msg.tracking_state.states[53].fcn, " + "expected 224, is %d", + last_msg.msg.tracking_state.states[53].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[53].sid.code == 54, + "incorrect value for last_msg.msg.tracking_state.states[53].sid.code, " + "expected 54, is %d", + last_msg.msg.tracking_state.states[53].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[53].sid.sat == 186, + "incorrect value for last_msg.msg.tracking_state.states[53].sid.sat, " + "expected 186, is %d", + last_msg.msg.tracking_state.states[53].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[54].cn0 == 190, + "incorrect value for last_msg.msg.tracking_state.states[54].cn0, " + "expected 190, is %d", + last_msg.msg.tracking_state.states[54].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[54].fcn == 148, + "incorrect value for last_msg.msg.tracking_state.states[54].fcn, " + "expected 148, is %d", + last_msg.msg.tracking_state.states[54].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[54].sid.code == 84, + "incorrect value for last_msg.msg.tracking_state.states[54].sid.code, " + "expected 84, is %d", + last_msg.msg.tracking_state.states[54].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[54].sid.sat == 82, + "incorrect value for last_msg.msg.tracking_state.states[54].sid.sat, " + "expected 82, is %d", + last_msg.msg.tracking_state.states[54].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[55].cn0 == 67, + "incorrect value for last_msg.msg.tracking_state.states[55].cn0, " + "expected 67, is %d", + last_msg.msg.tracking_state.states[55].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[55].fcn == 62, + "incorrect value for last_msg.msg.tracking_state.states[55].fcn, " + "expected 62, is %d", + last_msg.msg.tracking_state.states[55].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[55].sid.code == 54, + "incorrect value for last_msg.msg.tracking_state.states[55].sid.code, " + "expected 54, is %d", + last_msg.msg.tracking_state.states[55].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[55].sid.sat == 236, + "incorrect value for last_msg.msg.tracking_state.states[55].sid.sat, " + "expected 236, is %d", + last_msg.msg.tracking_state.states[55].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[56].cn0 == 254, + "incorrect value for last_msg.msg.tracking_state.states[56].cn0, " + "expected 254, is %d", + last_msg.msg.tracking_state.states[56].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[56].fcn == 57, + "incorrect value for last_msg.msg.tracking_state.states[56].fcn, " + "expected 57, is %d", + last_msg.msg.tracking_state.states[56].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[56].sid.code == 215, + "incorrect value for last_msg.msg.tracking_state.states[56].sid.code, " + "expected 215, is %d", + last_msg.msg.tracking_state.states[56].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[56].sid.sat == 52, + "incorrect value for last_msg.msg.tracking_state.states[56].sid.sat, " + "expected 52, is %d", + last_msg.msg.tracking_state.states[56].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[57].cn0 == 174, + "incorrect value for last_msg.msg.tracking_state.states[57].cn0, " + "expected 174, is %d", + last_msg.msg.tracking_state.states[57].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[57].fcn == 36, + "incorrect value for last_msg.msg.tracking_state.states[57].fcn, " + "expected 36, is %d", + last_msg.msg.tracking_state.states[57].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[57].sid.code == 133, + "incorrect value for last_msg.msg.tracking_state.states[57].sid.code, " + "expected 133, is %d", + last_msg.msg.tracking_state.states[57].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[57].sid.sat == 16, + "incorrect value for last_msg.msg.tracking_state.states[57].sid.sat, " + "expected 16, is %d", + last_msg.msg.tracking_state.states[57].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[58].cn0 == 17, + "incorrect value for last_msg.msg.tracking_state.states[58].cn0, " + "expected 17, is %d", + last_msg.msg.tracking_state.states[58].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[58].fcn == 145, + "incorrect value for last_msg.msg.tracking_state.states[58].fcn, " + "expected 145, is %d", + last_msg.msg.tracking_state.states[58].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[58].sid.code == 172, + "incorrect value for last_msg.msg.tracking_state.states[58].sid.code, " + "expected 172, is %d", + last_msg.msg.tracking_state.states[58].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[58].sid.sat == 219, + "incorrect value for last_msg.msg.tracking_state.states[58].sid.sat, " + "expected 219, is %d", + last_msg.msg.tracking_state.states[58].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[59].cn0 == 97, + "incorrect value for last_msg.msg.tracking_state.states[59].cn0, " + "expected 97, is %d", + last_msg.msg.tracking_state.states[59].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[59].fcn == 111, + "incorrect value for last_msg.msg.tracking_state.states[59].fcn, " + "expected 111, is %d", + last_msg.msg.tracking_state.states[59].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[59].sid.code == 179, + "incorrect value for last_msg.msg.tracking_state.states[59].sid.code, " + "expected 179, is %d", + last_msg.msg.tracking_state.states[59].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[59].sid.sat == 192, + "incorrect value for last_msg.msg.tracking_state.states[59].sid.sat, " + "expected 192, is %d", + last_msg.msg.tracking_state.states[59].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[60].cn0 == 134, + "incorrect value for last_msg.msg.tracking_state.states[60].cn0, " + "expected 134, is %d", + last_msg.msg.tracking_state.states[60].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[60].fcn == 208, + "incorrect value for last_msg.msg.tracking_state.states[60].fcn, " + "expected 208, is %d", + last_msg.msg.tracking_state.states[60].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[60].sid.code == 56, + "incorrect value for last_msg.msg.tracking_state.states[60].sid.code, " + "expected 56, is %d", + last_msg.msg.tracking_state.states[60].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[60].sid.sat == 207, + "incorrect value for last_msg.msg.tracking_state.states[60].sid.sat, " + "expected 207, is %d", + last_msg.msg.tracking_state.states[60].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[61].cn0 == 226, + "incorrect value for last_msg.msg.tracking_state.states[61].cn0, " + "expected 226, is %d", + last_msg.msg.tracking_state.states[61].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[61].fcn == 43, + "incorrect value for last_msg.msg.tracking_state.states[61].fcn, " + "expected 43, is %d", + last_msg.msg.tracking_state.states[61].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[61].sid.code == 17, + "incorrect value for last_msg.msg.tracking_state.states[61].sid.code, " + "expected 17, is %d", + last_msg.msg.tracking_state.states[61].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[61].sid.sat == 180, + "incorrect value for last_msg.msg.tracking_state.states[61].sid.sat, " + "expected 180, is %d", + last_msg.msg.tracking_state.states[61].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state.states[62].cn0 == 113, + "incorrect value for last_msg.msg.tracking_state.states[62].cn0, " + "expected 113, is %d", + last_msg.msg.tracking_state.states[62].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state.states[62].fcn == 140, + "incorrect value for last_msg.msg.tracking_state.states[62].fcn, " + "expected 140, is %d", + last_msg.msg.tracking_state.states[62].fcn); + + ck_assert_msg( + last_msg.msg.tracking_state.states[62].sid.code == 182, + "incorrect value for last_msg.msg.tracking_state.states[62].sid.code, " + "expected 182, is %d", + last_msg.msg.tracking_state.states[62].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state.states[62].sid.sat == 255, + "incorrect value for last_msg.msg.tracking_state.states[62].sid.sat, " + "expected 255, is %d", + last_msg.msg.tracking_state.states[62].sid.sat); } } END_TEST -Suite* auto_check_sbp_tracking_MsgTrackingState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_tracking_MsgTrackingState"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_tracking_MsgTrackingState"); +Suite *auto_check_sbp_tracking_MsgTrackingState_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_tracking_MsgTrackingState"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_tracking_MsgTrackingState"); tcase_add_test(tc_acq, test_auto_check_sbp_tracking_MsgTrackingState); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_tracking_MsgTrackingStateDepB.c b/c/test/auto_check_sbp_tracking_MsgTrackingStateDepB.c index 77c176e9b..31f55cf56 100644 --- a/c/test/auto_check_sbp_tracking_MsgTrackingStateDepB.c +++ b/c/test/auto_check_sbp_tracking_MsgTrackingStateDepB.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDepB.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_tracking_MsgTrackingStateDepB ) -{ +START_TEST(test_auto_check_sbp_tracking_MsgTrackingStateDepB) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingStateDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,693 +90,1252 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingStateDepB ) logging_reset(); - sbp_callback_register(&sbp_state, 0x13, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x13, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,19,0,242,241,252,115,183,227,63,68,154,1,183,69,255,175,121,43,222,51,67,35,69,78,240,5,53,20,51,211,54,69,153,130,237,66,155,51,227,71,69,53,242,136,161,190,205,188,6,70,153,125,255,142,149,154,217,184,69,248,102,95,31,76,154,33,169,69,131,115,141,27,12,154,225,200,69,208,44,147,39,23,51,3,66,69,237,159,251,49,203,51,99,102,69,70,214,87,128,206,154,121,186,69,14,206,111,218,19,154,121,169,69,216,98,209,54,2,154,25,219,67,200,133,99,7,34,102,198,232,68,155,43,85,135,46,154,177,170,69,155,3,83,171,201,154,241,232,69,121,43,197,16,19,154,241,222,69,128,245,53,63,176,51,115,66,69,36,20,61,153,51,154,73,134,69,46,82,116,140,22,51,147,37,69,177,67,146,96,143,205,76,107,68,220,51,160,201,251,102,102,192,68,168,194,2,161,220,102,102,180,68,69,8,9,125,178,102,70,134,68,185,20,135,186,171,51,163,4,69,18,124,155,85,170,205,208,13,70,57,244,206,255,186,154,105,149,69,165,199,93,181,175,51,67,64,69,6,28, }; + u8 encoded_frame[] = { + 85, 19, 0, 242, 241, 252, 115, 183, 227, 63, 68, 154, 1, 183, + 69, 255, 175, 121, 43, 222, 51, 67, 35, 69, 78, 240, 5, 53, + 20, 51, 211, 54, 69, 153, 130, 237, 66, 155, 51, 227, 71, 69, + 53, 242, 136, 161, 190, 205, 188, 6, 70, 153, 125, 255, 142, 149, + 154, 217, 184, 69, 248, 102, 95, 31, 76, 154, 33, 169, 69, 131, + 115, 141, 27, 12, 154, 225, 200, 69, 208, 44, 147, 39, 23, 51, + 3, 66, 69, 237, 159, 251, 49, 203, 51, 99, 102, 69, 70, 214, + 87, 128, 206, 154, 121, 186, 69, 14, 206, 111, 218, 19, 154, 121, + 169, 69, 216, 98, 209, 54, 2, 154, 25, 219, 67, 200, 133, 99, + 7, 34, 102, 198, 232, 68, 155, 43, 85, 135, 46, 154, 177, 170, + 69, 155, 3, 83, 171, 201, 154, 241, 232, 69, 121, 43, 197, 16, + 19, 154, 241, 222, 69, 128, 245, 53, 63, 176, 51, 115, 66, 69, + 36, 20, 61, 153, 51, 154, 73, 134, 69, 46, 82, 116, 140, 22, + 51, 147, 37, 69, 177, 67, 146, 96, 143, 205, 76, 107, 68, 220, + 51, 160, 201, 251, 102, 102, 192, 68, 168, 194, 2, 161, 220, 102, + 102, 180, 68, 69, 8, 9, 125, 178, 102, 70, 134, 68, 185, 20, + 135, 186, 171, 51, 163, 4, 69, 18, 124, 155, 85, 170, 205, 208, + 13, 70, 57, 244, 206, 255, 186, 154, 105, 149, 69, 165, 199, 93, + 181, 175, 51, 67, 64, 69, 6, 28, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.tracking_state_dep_b.n_states = 28; - - - + test_msg.tracking_state_dep_b.states[0].cn0 = 5856.2001953125; - - + test_msg.tracking_state_dep_b.states[0].sid.code = 63; - + test_msg.tracking_state_dep_b.states[0].sid.reserved = 68; - + test_msg.tracking_state_dep_b.states[0].sid.sat = 58295; - + test_msg.tracking_state_dep_b.states[0].state = 115; - - + test_msg.tracking_state_dep_b.states[1].cn0 = 2612.199951171875; - - + test_msg.tracking_state_dep_b.states[1].sid.code = 43; - + test_msg.tracking_state_dep_b.states[1].sid.reserved = 222; - + test_msg.tracking_state_dep_b.states[1].sid.sat = 31151; - + test_msg.tracking_state_dep_b.states[1].state = 255; - - + test_msg.tracking_state_dep_b.states[2].cn0 = 2925.199951171875; - - + test_msg.tracking_state_dep_b.states[2].sid.code = 53; - + test_msg.tracking_state_dep_b.states[2].sid.reserved = 20; - + test_msg.tracking_state_dep_b.states[2].sid.sat = 1520; - + test_msg.tracking_state_dep_b.states[2].state = 78; - - + test_msg.tracking_state_dep_b.states[3].cn0 = 3198.199951171875; - - + test_msg.tracking_state_dep_b.states[3].sid.code = 66; - + test_msg.tracking_state_dep_b.states[3].sid.reserved = 155; - + test_msg.tracking_state_dep_b.states[3].sid.sat = 60802; - + test_msg.tracking_state_dep_b.states[3].state = 153; - - + test_msg.tracking_state_dep_b.states[4].cn0 = 8623.2001953125; - - + test_msg.tracking_state_dep_b.states[4].sid.code = 161; - + test_msg.tracking_state_dep_b.states[4].sid.reserved = 190; - + test_msg.tracking_state_dep_b.states[4].sid.sat = 35058; - + test_msg.tracking_state_dep_b.states[4].state = 53; - - + test_msg.tracking_state_dep_b.states[5].cn0 = 5915.2001953125; - - + test_msg.tracking_state_dep_b.states[5].sid.code = 142; - + test_msg.tracking_state_dep_b.states[5].sid.reserved = 149; - + test_msg.tracking_state_dep_b.states[5].sid.sat = 65405; - + test_msg.tracking_state_dep_b.states[5].state = 153; - - + test_msg.tracking_state_dep_b.states[6].cn0 = 5412.2001953125; - - + test_msg.tracking_state_dep_b.states[6].sid.code = 31; - + test_msg.tracking_state_dep_b.states[6].sid.reserved = 76; - + test_msg.tracking_state_dep_b.states[6].sid.sat = 24422; - + test_msg.tracking_state_dep_b.states[6].state = 248; - - + test_msg.tracking_state_dep_b.states[7].cn0 = 6428.2001953125; - - + test_msg.tracking_state_dep_b.states[7].sid.code = 27; - + test_msg.tracking_state_dep_b.states[7].sid.reserved = 12; - + test_msg.tracking_state_dep_b.states[7].sid.sat = 36211; - + test_msg.tracking_state_dep_b.states[7].state = 131; - - + test_msg.tracking_state_dep_b.states[8].cn0 = 3104.199951171875; - - + test_msg.tracking_state_dep_b.states[8].sid.code = 39; - + test_msg.tracking_state_dep_b.states[8].sid.reserved = 23; - + test_msg.tracking_state_dep_b.states[8].sid.sat = 37676; - + test_msg.tracking_state_dep_b.states[8].state = 208; - - + test_msg.tracking_state_dep_b.states[9].cn0 = 3686.199951171875; - - + test_msg.tracking_state_dep_b.states[9].sid.code = 49; - + test_msg.tracking_state_dep_b.states[9].sid.reserved = 203; - + test_msg.tracking_state_dep_b.states[9].sid.sat = 64415; - + test_msg.tracking_state_dep_b.states[9].state = 237; - - + test_msg.tracking_state_dep_b.states[10].cn0 = 5967.2001953125; - - + test_msg.tracking_state_dep_b.states[10].sid.code = 128; - + test_msg.tracking_state_dep_b.states[10].sid.reserved = 206; - + test_msg.tracking_state_dep_b.states[10].sid.sat = 22486; - + test_msg.tracking_state_dep_b.states[10].state = 70; - - + test_msg.tracking_state_dep_b.states[11].cn0 = 5423.2001953125; - - + test_msg.tracking_state_dep_b.states[11].sid.code = 218; - + test_msg.tracking_state_dep_b.states[11].sid.reserved = 19; - + test_msg.tracking_state_dep_b.states[11].sid.sat = 28622; - + test_msg.tracking_state_dep_b.states[11].state = 14; - - + test_msg.tracking_state_dep_b.states[12].cn0 = 438.20001220703125; - - + test_msg.tracking_state_dep_b.states[12].sid.code = 54; - + test_msg.tracking_state_dep_b.states[12].sid.reserved = 2; - + test_msg.tracking_state_dep_b.states[12].sid.sat = 53602; - + test_msg.tracking_state_dep_b.states[12].state = 216; - - + test_msg.tracking_state_dep_b.states[13].cn0 = 1862.199951171875; - - + test_msg.tracking_state_dep_b.states[13].sid.code = 7; - + test_msg.tracking_state_dep_b.states[13].sid.reserved = 34; - + test_msg.tracking_state_dep_b.states[13].sid.sat = 25477; - + test_msg.tracking_state_dep_b.states[13].state = 200; - - + test_msg.tracking_state_dep_b.states[14].cn0 = 5462.2001953125; - - + test_msg.tracking_state_dep_b.states[14].sid.code = 135; - + test_msg.tracking_state_dep_b.states[14].sid.reserved = 46; - + test_msg.tracking_state_dep_b.states[14].sid.sat = 21803; - + test_msg.tracking_state_dep_b.states[14].state = 155; - - + test_msg.tracking_state_dep_b.states[15].cn0 = 7454.2001953125; - - + test_msg.tracking_state_dep_b.states[15].sid.code = 171; - + test_msg.tracking_state_dep_b.states[15].sid.reserved = 201; - + test_msg.tracking_state_dep_b.states[15].sid.sat = 21251; - + test_msg.tracking_state_dep_b.states[15].state = 155; - - + test_msg.tracking_state_dep_b.states[16].cn0 = 7134.2001953125; - - + test_msg.tracking_state_dep_b.states[16].sid.code = 16; - + test_msg.tracking_state_dep_b.states[16].sid.reserved = 19; - + test_msg.tracking_state_dep_b.states[16].sid.sat = 50475; - + test_msg.tracking_state_dep_b.states[16].state = 121; - - + test_msg.tracking_state_dep_b.states[17].cn0 = 3111.199951171875; - - + test_msg.tracking_state_dep_b.states[17].sid.code = 63; - + test_msg.tracking_state_dep_b.states[17].sid.reserved = 176; - + test_msg.tracking_state_dep_b.states[17].sid.sat = 13813; - + test_msg.tracking_state_dep_b.states[17].state = 128; - - + test_msg.tracking_state_dep_b.states[18].cn0 = 4297.2001953125; - - + test_msg.tracking_state_dep_b.states[18].sid.code = 153; - + test_msg.tracking_state_dep_b.states[18].sid.reserved = 51; - + test_msg.tracking_state_dep_b.states[18].sid.sat = 15636; - + test_msg.tracking_state_dep_b.states[18].state = 36; - - + test_msg.tracking_state_dep_b.states[19].cn0 = 2649.199951171875; - - + test_msg.tracking_state_dep_b.states[19].sid.code = 140; - + test_msg.tracking_state_dep_b.states[19].sid.reserved = 22; - + test_msg.tracking_state_dep_b.states[19].sid.sat = 29778; - + test_msg.tracking_state_dep_b.states[19].state = 46; - - + test_msg.tracking_state_dep_b.states[20].cn0 = 941.2000122070312; - - + test_msg.tracking_state_dep_b.states[20].sid.code = 96; - + test_msg.tracking_state_dep_b.states[20].sid.reserved = 143; - + test_msg.tracking_state_dep_b.states[20].sid.sat = 37443; - + test_msg.tracking_state_dep_b.states[20].state = 177; - - + test_msg.tracking_state_dep_b.states[21].cn0 = 1539.199951171875; - - + test_msg.tracking_state_dep_b.states[21].sid.code = 201; - + test_msg.tracking_state_dep_b.states[21].sid.reserved = 251; - + test_msg.tracking_state_dep_b.states[21].sid.sat = 41011; - + test_msg.tracking_state_dep_b.states[21].state = 220; - - + test_msg.tracking_state_dep_b.states[22].cn0 = 1443.199951171875; - - + test_msg.tracking_state_dep_b.states[22].sid.code = 161; - + test_msg.tracking_state_dep_b.states[22].sid.reserved = 220; - + test_msg.tracking_state_dep_b.states[22].sid.sat = 706; - + test_msg.tracking_state_dep_b.states[22].state = 168; - - + test_msg.tracking_state_dep_b.states[23].cn0 = 1074.199951171875; - - + test_msg.tracking_state_dep_b.states[23].sid.code = 125; - + test_msg.tracking_state_dep_b.states[23].sid.reserved = 178; - + test_msg.tracking_state_dep_b.states[23].sid.sat = 2312; - + test_msg.tracking_state_dep_b.states[23].state = 69; - - + test_msg.tracking_state_dep_b.states[24].cn0 = 2122.199951171875; - - + test_msg.tracking_state_dep_b.states[24].sid.code = 186; - + test_msg.tracking_state_dep_b.states[24].sid.reserved = 171; - + test_msg.tracking_state_dep_b.states[24].sid.sat = 34580; - + test_msg.tracking_state_dep_b.states[24].state = 185; - - + test_msg.tracking_state_dep_b.states[25].cn0 = 9076.2001953125; - - + test_msg.tracking_state_dep_b.states[25].sid.code = 85; - + test_msg.tracking_state_dep_b.states[25].sid.reserved = 170; - + test_msg.tracking_state_dep_b.states[25].sid.sat = 39804; - + test_msg.tracking_state_dep_b.states[25].state = 18; - - + test_msg.tracking_state_dep_b.states[26].cn0 = 4781.2001953125; - - + test_msg.tracking_state_dep_b.states[26].sid.code = 255; - + test_msg.tracking_state_dep_b.states[26].sid.reserved = 186; - + test_msg.tracking_state_dep_b.states[26].sid.sat = 52980; - + test_msg.tracking_state_dep_b.states[26].state = 57; - - + test_msg.tracking_state_dep_b.states[27].cn0 = 3076.199951171875; - - + test_msg.tracking_state_dep_b.states[27].sid.code = 181; - + test_msg.tracking_state_dep_b.states[27].sid.reserved = 175; - + test_msg.tracking_state_dep_b.states[27].sid.sat = 24007; - + test_msg.tracking_state_dep_b.states[27].state = 165; - sbp_message_send(&sbp_state, SbpMsgTrackingStateDepB, 61938, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingStateDepB, 61938, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61938, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDepB, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgTrackingStateDepB, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.n_states == 28, "incorrect value for last_msg.msg.tracking_state_dep_b.n_states, expected 28, is %d", last_msg.msg.tracking_state_dep_b.n_states); - - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[0].cn0 * 100 - 5856.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[0].cn0, expected 5856.20019531, is %s", last_msg.msg.tracking_state_dep_b.states[0].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[0].sid.code == 63, "incorrect value for last_msg.msg.tracking_state_dep_b.states[0].sid.code, expected 63, is %d", last_msg.msg.tracking_state_dep_b.states[0].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[0].sid.reserved == 68, "incorrect value for last_msg.msg.tracking_state_dep_b.states[0].sid.reserved, expected 68, is %d", last_msg.msg.tracking_state_dep_b.states[0].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[0].sid.sat == 58295, "incorrect value for last_msg.msg.tracking_state_dep_b.states[0].sid.sat, expected 58295, is %d", last_msg.msg.tracking_state_dep_b.states[0].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[0].state == 115, "incorrect value for last_msg.msg.tracking_state_dep_b.states[0].state, expected 115, is %d", last_msg.msg.tracking_state_dep_b.states[0].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[1].cn0 * 100 - 2612.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[1].cn0, expected 2612.19995117, is %s", last_msg.msg.tracking_state_dep_b.states[1].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[1].sid.code == 43, "incorrect value for last_msg.msg.tracking_state_dep_b.states[1].sid.code, expected 43, is %d", last_msg.msg.tracking_state_dep_b.states[1].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[1].sid.reserved == 222, "incorrect value for last_msg.msg.tracking_state_dep_b.states[1].sid.reserved, expected 222, is %d", last_msg.msg.tracking_state_dep_b.states[1].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[1].sid.sat == 31151, "incorrect value for last_msg.msg.tracking_state_dep_b.states[1].sid.sat, expected 31151, is %d", last_msg.msg.tracking_state_dep_b.states[1].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[1].state == 255, "incorrect value for last_msg.msg.tracking_state_dep_b.states[1].state, expected 255, is %d", last_msg.msg.tracking_state_dep_b.states[1].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[2].cn0 * 100 - 2925.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[2].cn0, expected 2925.19995117, is %s", last_msg.msg.tracking_state_dep_b.states[2].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[2].sid.code == 53, "incorrect value for last_msg.msg.tracking_state_dep_b.states[2].sid.code, expected 53, is %d", last_msg.msg.tracking_state_dep_b.states[2].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[2].sid.reserved == 20, "incorrect value for last_msg.msg.tracking_state_dep_b.states[2].sid.reserved, expected 20, is %d", last_msg.msg.tracking_state_dep_b.states[2].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[2].sid.sat == 1520, "incorrect value for last_msg.msg.tracking_state_dep_b.states[2].sid.sat, expected 1520, is %d", last_msg.msg.tracking_state_dep_b.states[2].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[2].state == 78, "incorrect value for last_msg.msg.tracking_state_dep_b.states[2].state, expected 78, is %d", last_msg.msg.tracking_state_dep_b.states[2].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[3].cn0 * 100 - 3198.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[3].cn0, expected 3198.19995117, is %s", last_msg.msg.tracking_state_dep_b.states[3].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[3].sid.code == 66, "incorrect value for last_msg.msg.tracking_state_dep_b.states[3].sid.code, expected 66, is %d", last_msg.msg.tracking_state_dep_b.states[3].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[3].sid.reserved == 155, "incorrect value for last_msg.msg.tracking_state_dep_b.states[3].sid.reserved, expected 155, is %d", last_msg.msg.tracking_state_dep_b.states[3].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[3].sid.sat == 60802, "incorrect value for last_msg.msg.tracking_state_dep_b.states[3].sid.sat, expected 60802, is %d", last_msg.msg.tracking_state_dep_b.states[3].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[3].state == 153, "incorrect value for last_msg.msg.tracking_state_dep_b.states[3].state, expected 153, is %d", last_msg.msg.tracking_state_dep_b.states[3].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[4].cn0 * 100 - 8623.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[4].cn0, expected 8623.20019531, is %s", last_msg.msg.tracking_state_dep_b.states[4].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[4].sid.code == 161, "incorrect value for last_msg.msg.tracking_state_dep_b.states[4].sid.code, expected 161, is %d", last_msg.msg.tracking_state_dep_b.states[4].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[4].sid.reserved == 190, "incorrect value for last_msg.msg.tracking_state_dep_b.states[4].sid.reserved, expected 190, is %d", last_msg.msg.tracking_state_dep_b.states[4].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[4].sid.sat == 35058, "incorrect value for last_msg.msg.tracking_state_dep_b.states[4].sid.sat, expected 35058, is %d", last_msg.msg.tracking_state_dep_b.states[4].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[4].state == 53, "incorrect value for last_msg.msg.tracking_state_dep_b.states[4].state, expected 53, is %d", last_msg.msg.tracking_state_dep_b.states[4].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[5].cn0 * 100 - 5915.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[5].cn0, expected 5915.20019531, is %s", last_msg.msg.tracking_state_dep_b.states[5].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[5].sid.code == 142, "incorrect value for last_msg.msg.tracking_state_dep_b.states[5].sid.code, expected 142, is %d", last_msg.msg.tracking_state_dep_b.states[5].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[5].sid.reserved == 149, "incorrect value for last_msg.msg.tracking_state_dep_b.states[5].sid.reserved, expected 149, is %d", last_msg.msg.tracking_state_dep_b.states[5].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[5].sid.sat == 65405, "incorrect value for last_msg.msg.tracking_state_dep_b.states[5].sid.sat, expected 65405, is %d", last_msg.msg.tracking_state_dep_b.states[5].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[5].state == 153, "incorrect value for last_msg.msg.tracking_state_dep_b.states[5].state, expected 153, is %d", last_msg.msg.tracking_state_dep_b.states[5].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[6].cn0 * 100 - 5412.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[6].cn0, expected 5412.20019531, is %s", last_msg.msg.tracking_state_dep_b.states[6].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[6].sid.code == 31, "incorrect value for last_msg.msg.tracking_state_dep_b.states[6].sid.code, expected 31, is %d", last_msg.msg.tracking_state_dep_b.states[6].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[6].sid.reserved == 76, "incorrect value for last_msg.msg.tracking_state_dep_b.states[6].sid.reserved, expected 76, is %d", last_msg.msg.tracking_state_dep_b.states[6].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[6].sid.sat == 24422, "incorrect value for last_msg.msg.tracking_state_dep_b.states[6].sid.sat, expected 24422, is %d", last_msg.msg.tracking_state_dep_b.states[6].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[6].state == 248, "incorrect value for last_msg.msg.tracking_state_dep_b.states[6].state, expected 248, is %d", last_msg.msg.tracking_state_dep_b.states[6].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[7].cn0 * 100 - 6428.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[7].cn0, expected 6428.20019531, is %s", last_msg.msg.tracking_state_dep_b.states[7].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[7].sid.code == 27, "incorrect value for last_msg.msg.tracking_state_dep_b.states[7].sid.code, expected 27, is %d", last_msg.msg.tracking_state_dep_b.states[7].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[7].sid.reserved == 12, "incorrect value for last_msg.msg.tracking_state_dep_b.states[7].sid.reserved, expected 12, is %d", last_msg.msg.tracking_state_dep_b.states[7].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[7].sid.sat == 36211, "incorrect value for last_msg.msg.tracking_state_dep_b.states[7].sid.sat, expected 36211, is %d", last_msg.msg.tracking_state_dep_b.states[7].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[7].state == 131, "incorrect value for last_msg.msg.tracking_state_dep_b.states[7].state, expected 131, is %d", last_msg.msg.tracking_state_dep_b.states[7].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[8].cn0 * 100 - 3104.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[8].cn0, expected 3104.19995117, is %s", last_msg.msg.tracking_state_dep_b.states[8].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[8].sid.code == 39, "incorrect value for last_msg.msg.tracking_state_dep_b.states[8].sid.code, expected 39, is %d", last_msg.msg.tracking_state_dep_b.states[8].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[8].sid.reserved == 23, "incorrect value for last_msg.msg.tracking_state_dep_b.states[8].sid.reserved, expected 23, is %d", last_msg.msg.tracking_state_dep_b.states[8].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[8].sid.sat == 37676, "incorrect value for last_msg.msg.tracking_state_dep_b.states[8].sid.sat, expected 37676, is %d", last_msg.msg.tracking_state_dep_b.states[8].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[8].state == 208, "incorrect value for last_msg.msg.tracking_state_dep_b.states[8].state, expected 208, is %d", last_msg.msg.tracking_state_dep_b.states[8].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[9].cn0 * 100 - 3686.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[9].cn0, expected 3686.19995117, is %s", last_msg.msg.tracking_state_dep_b.states[9].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[9].sid.code == 49, "incorrect value for last_msg.msg.tracking_state_dep_b.states[9].sid.code, expected 49, is %d", last_msg.msg.tracking_state_dep_b.states[9].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[9].sid.reserved == 203, "incorrect value for last_msg.msg.tracking_state_dep_b.states[9].sid.reserved, expected 203, is %d", last_msg.msg.tracking_state_dep_b.states[9].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[9].sid.sat == 64415, "incorrect value for last_msg.msg.tracking_state_dep_b.states[9].sid.sat, expected 64415, is %d", last_msg.msg.tracking_state_dep_b.states[9].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[9].state == 237, "incorrect value for last_msg.msg.tracking_state_dep_b.states[9].state, expected 237, is %d", last_msg.msg.tracking_state_dep_b.states[9].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[10].cn0 * 100 - 5967.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[10].cn0, expected 5967.20019531, is %s", last_msg.msg.tracking_state_dep_b.states[10].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[10].sid.code == 128, "incorrect value for last_msg.msg.tracking_state_dep_b.states[10].sid.code, expected 128, is %d", last_msg.msg.tracking_state_dep_b.states[10].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[10].sid.reserved == 206, "incorrect value for last_msg.msg.tracking_state_dep_b.states[10].sid.reserved, expected 206, is %d", last_msg.msg.tracking_state_dep_b.states[10].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[10].sid.sat == 22486, "incorrect value for last_msg.msg.tracking_state_dep_b.states[10].sid.sat, expected 22486, is %d", last_msg.msg.tracking_state_dep_b.states[10].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[10].state == 70, "incorrect value for last_msg.msg.tracking_state_dep_b.states[10].state, expected 70, is %d", last_msg.msg.tracking_state_dep_b.states[10].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[11].cn0 * 100 - 5423.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[11].cn0, expected 5423.20019531, is %s", last_msg.msg.tracking_state_dep_b.states[11].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[11].sid.code == 218, "incorrect value for last_msg.msg.tracking_state_dep_b.states[11].sid.code, expected 218, is %d", last_msg.msg.tracking_state_dep_b.states[11].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[11].sid.reserved == 19, "incorrect value for last_msg.msg.tracking_state_dep_b.states[11].sid.reserved, expected 19, is %d", last_msg.msg.tracking_state_dep_b.states[11].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[11].sid.sat == 28622, "incorrect value for last_msg.msg.tracking_state_dep_b.states[11].sid.sat, expected 28622, is %d", last_msg.msg.tracking_state_dep_b.states[11].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[11].state == 14, "incorrect value for last_msg.msg.tracking_state_dep_b.states[11].state, expected 14, is %d", last_msg.msg.tracking_state_dep_b.states[11].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[12].cn0 * 100 - 438.200012207 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[12].cn0, expected 438.200012207, is %s", last_msg.msg.tracking_state_dep_b.states[12].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[12].sid.code == 54, "incorrect value for last_msg.msg.tracking_state_dep_b.states[12].sid.code, expected 54, is %d", last_msg.msg.tracking_state_dep_b.states[12].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[12].sid.reserved == 2, "incorrect value for last_msg.msg.tracking_state_dep_b.states[12].sid.reserved, expected 2, is %d", last_msg.msg.tracking_state_dep_b.states[12].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[12].sid.sat == 53602, "incorrect value for last_msg.msg.tracking_state_dep_b.states[12].sid.sat, expected 53602, is %d", last_msg.msg.tracking_state_dep_b.states[12].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[12].state == 216, "incorrect value for last_msg.msg.tracking_state_dep_b.states[12].state, expected 216, is %d", last_msg.msg.tracking_state_dep_b.states[12].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[13].cn0 * 100 - 1862.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[13].cn0, expected 1862.19995117, is %s", last_msg.msg.tracking_state_dep_b.states[13].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[13].sid.code == 7, "incorrect value for last_msg.msg.tracking_state_dep_b.states[13].sid.code, expected 7, is %d", last_msg.msg.tracking_state_dep_b.states[13].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[13].sid.reserved == 34, "incorrect value for last_msg.msg.tracking_state_dep_b.states[13].sid.reserved, expected 34, is %d", last_msg.msg.tracking_state_dep_b.states[13].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[13].sid.sat == 25477, "incorrect value for last_msg.msg.tracking_state_dep_b.states[13].sid.sat, expected 25477, is %d", last_msg.msg.tracking_state_dep_b.states[13].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[13].state == 200, "incorrect value for last_msg.msg.tracking_state_dep_b.states[13].state, expected 200, is %d", last_msg.msg.tracking_state_dep_b.states[13].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[14].cn0 * 100 - 5462.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[14].cn0, expected 5462.20019531, is %s", last_msg.msg.tracking_state_dep_b.states[14].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[14].sid.code == 135, "incorrect value for last_msg.msg.tracking_state_dep_b.states[14].sid.code, expected 135, is %d", last_msg.msg.tracking_state_dep_b.states[14].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[14].sid.reserved == 46, "incorrect value for last_msg.msg.tracking_state_dep_b.states[14].sid.reserved, expected 46, is %d", last_msg.msg.tracking_state_dep_b.states[14].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[14].sid.sat == 21803, "incorrect value for last_msg.msg.tracking_state_dep_b.states[14].sid.sat, expected 21803, is %d", last_msg.msg.tracking_state_dep_b.states[14].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[14].state == 155, "incorrect value for last_msg.msg.tracking_state_dep_b.states[14].state, expected 155, is %d", last_msg.msg.tracking_state_dep_b.states[14].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[15].cn0 * 100 - 7454.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[15].cn0, expected 7454.20019531, is %s", last_msg.msg.tracking_state_dep_b.states[15].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[15].sid.code == 171, "incorrect value for last_msg.msg.tracking_state_dep_b.states[15].sid.code, expected 171, is %d", last_msg.msg.tracking_state_dep_b.states[15].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[15].sid.reserved == 201, "incorrect value for last_msg.msg.tracking_state_dep_b.states[15].sid.reserved, expected 201, is %d", last_msg.msg.tracking_state_dep_b.states[15].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[15].sid.sat == 21251, "incorrect value for last_msg.msg.tracking_state_dep_b.states[15].sid.sat, expected 21251, is %d", last_msg.msg.tracking_state_dep_b.states[15].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[15].state == 155, "incorrect value for last_msg.msg.tracking_state_dep_b.states[15].state, expected 155, is %d", last_msg.msg.tracking_state_dep_b.states[15].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[16].cn0 * 100 - 7134.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[16].cn0, expected 7134.20019531, is %s", last_msg.msg.tracking_state_dep_b.states[16].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[16].sid.code == 16, "incorrect value for last_msg.msg.tracking_state_dep_b.states[16].sid.code, expected 16, is %d", last_msg.msg.tracking_state_dep_b.states[16].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[16].sid.reserved == 19, "incorrect value for last_msg.msg.tracking_state_dep_b.states[16].sid.reserved, expected 19, is %d", last_msg.msg.tracking_state_dep_b.states[16].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[16].sid.sat == 50475, "incorrect value for last_msg.msg.tracking_state_dep_b.states[16].sid.sat, expected 50475, is %d", last_msg.msg.tracking_state_dep_b.states[16].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[16].state == 121, "incorrect value for last_msg.msg.tracking_state_dep_b.states[16].state, expected 121, is %d", last_msg.msg.tracking_state_dep_b.states[16].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[17].cn0 * 100 - 3111.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[17].cn0, expected 3111.19995117, is %s", last_msg.msg.tracking_state_dep_b.states[17].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[17].sid.code == 63, "incorrect value for last_msg.msg.tracking_state_dep_b.states[17].sid.code, expected 63, is %d", last_msg.msg.tracking_state_dep_b.states[17].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[17].sid.reserved == 176, "incorrect value for last_msg.msg.tracking_state_dep_b.states[17].sid.reserved, expected 176, is %d", last_msg.msg.tracking_state_dep_b.states[17].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[17].sid.sat == 13813, "incorrect value for last_msg.msg.tracking_state_dep_b.states[17].sid.sat, expected 13813, is %d", last_msg.msg.tracking_state_dep_b.states[17].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[17].state == 128, "incorrect value for last_msg.msg.tracking_state_dep_b.states[17].state, expected 128, is %d", last_msg.msg.tracking_state_dep_b.states[17].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[18].cn0 * 100 - 4297.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[18].cn0, expected 4297.20019531, is %s", last_msg.msg.tracking_state_dep_b.states[18].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[18].sid.code == 153, "incorrect value for last_msg.msg.tracking_state_dep_b.states[18].sid.code, expected 153, is %d", last_msg.msg.tracking_state_dep_b.states[18].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[18].sid.reserved == 51, "incorrect value for last_msg.msg.tracking_state_dep_b.states[18].sid.reserved, expected 51, is %d", last_msg.msg.tracking_state_dep_b.states[18].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[18].sid.sat == 15636, "incorrect value for last_msg.msg.tracking_state_dep_b.states[18].sid.sat, expected 15636, is %d", last_msg.msg.tracking_state_dep_b.states[18].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[18].state == 36, "incorrect value for last_msg.msg.tracking_state_dep_b.states[18].state, expected 36, is %d", last_msg.msg.tracking_state_dep_b.states[18].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[19].cn0 * 100 - 2649.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[19].cn0, expected 2649.19995117, is %s", last_msg.msg.tracking_state_dep_b.states[19].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[19].sid.code == 140, "incorrect value for last_msg.msg.tracking_state_dep_b.states[19].sid.code, expected 140, is %d", last_msg.msg.tracking_state_dep_b.states[19].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[19].sid.reserved == 22, "incorrect value for last_msg.msg.tracking_state_dep_b.states[19].sid.reserved, expected 22, is %d", last_msg.msg.tracking_state_dep_b.states[19].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[19].sid.sat == 29778, "incorrect value for last_msg.msg.tracking_state_dep_b.states[19].sid.sat, expected 29778, is %d", last_msg.msg.tracking_state_dep_b.states[19].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[19].state == 46, "incorrect value for last_msg.msg.tracking_state_dep_b.states[19].state, expected 46, is %d", last_msg.msg.tracking_state_dep_b.states[19].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[20].cn0 * 100 - 941.200012207 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[20].cn0, expected 941.200012207, is %s", last_msg.msg.tracking_state_dep_b.states[20].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[20].sid.code == 96, "incorrect value for last_msg.msg.tracking_state_dep_b.states[20].sid.code, expected 96, is %d", last_msg.msg.tracking_state_dep_b.states[20].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[20].sid.reserved == 143, "incorrect value for last_msg.msg.tracking_state_dep_b.states[20].sid.reserved, expected 143, is %d", last_msg.msg.tracking_state_dep_b.states[20].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[20].sid.sat == 37443, "incorrect value for last_msg.msg.tracking_state_dep_b.states[20].sid.sat, expected 37443, is %d", last_msg.msg.tracking_state_dep_b.states[20].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[20].state == 177, "incorrect value for last_msg.msg.tracking_state_dep_b.states[20].state, expected 177, is %d", last_msg.msg.tracking_state_dep_b.states[20].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[21].cn0 * 100 - 1539.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[21].cn0, expected 1539.19995117, is %s", last_msg.msg.tracking_state_dep_b.states[21].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[21].sid.code == 201, "incorrect value for last_msg.msg.tracking_state_dep_b.states[21].sid.code, expected 201, is %d", last_msg.msg.tracking_state_dep_b.states[21].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[21].sid.reserved == 251, "incorrect value for last_msg.msg.tracking_state_dep_b.states[21].sid.reserved, expected 251, is %d", last_msg.msg.tracking_state_dep_b.states[21].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[21].sid.sat == 41011, "incorrect value for last_msg.msg.tracking_state_dep_b.states[21].sid.sat, expected 41011, is %d", last_msg.msg.tracking_state_dep_b.states[21].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[21].state == 220, "incorrect value for last_msg.msg.tracking_state_dep_b.states[21].state, expected 220, is %d", last_msg.msg.tracking_state_dep_b.states[21].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[22].cn0 * 100 - 1443.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[22].cn0, expected 1443.19995117, is %s", last_msg.msg.tracking_state_dep_b.states[22].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[22].sid.code == 161, "incorrect value for last_msg.msg.tracking_state_dep_b.states[22].sid.code, expected 161, is %d", last_msg.msg.tracking_state_dep_b.states[22].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[22].sid.reserved == 220, "incorrect value for last_msg.msg.tracking_state_dep_b.states[22].sid.reserved, expected 220, is %d", last_msg.msg.tracking_state_dep_b.states[22].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[22].sid.sat == 706, "incorrect value for last_msg.msg.tracking_state_dep_b.states[22].sid.sat, expected 706, is %d", last_msg.msg.tracking_state_dep_b.states[22].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[22].state == 168, "incorrect value for last_msg.msg.tracking_state_dep_b.states[22].state, expected 168, is %d", last_msg.msg.tracking_state_dep_b.states[22].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[23].cn0 * 100 - 1074.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[23].cn0, expected 1074.19995117, is %s", last_msg.msg.tracking_state_dep_b.states[23].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[23].sid.code == 125, "incorrect value for last_msg.msg.tracking_state_dep_b.states[23].sid.code, expected 125, is %d", last_msg.msg.tracking_state_dep_b.states[23].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[23].sid.reserved == 178, "incorrect value for last_msg.msg.tracking_state_dep_b.states[23].sid.reserved, expected 178, is %d", last_msg.msg.tracking_state_dep_b.states[23].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[23].sid.sat == 2312, "incorrect value for last_msg.msg.tracking_state_dep_b.states[23].sid.sat, expected 2312, is %d", last_msg.msg.tracking_state_dep_b.states[23].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[23].state == 69, "incorrect value for last_msg.msg.tracking_state_dep_b.states[23].state, expected 69, is %d", last_msg.msg.tracking_state_dep_b.states[23].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[24].cn0 * 100 - 2122.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[24].cn0, expected 2122.19995117, is %s", last_msg.msg.tracking_state_dep_b.states[24].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[24].sid.code == 186, "incorrect value for last_msg.msg.tracking_state_dep_b.states[24].sid.code, expected 186, is %d", last_msg.msg.tracking_state_dep_b.states[24].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[24].sid.reserved == 171, "incorrect value for last_msg.msg.tracking_state_dep_b.states[24].sid.reserved, expected 171, is %d", last_msg.msg.tracking_state_dep_b.states[24].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[24].sid.sat == 34580, "incorrect value for last_msg.msg.tracking_state_dep_b.states[24].sid.sat, expected 34580, is %d", last_msg.msg.tracking_state_dep_b.states[24].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[24].state == 185, "incorrect value for last_msg.msg.tracking_state_dep_b.states[24].state, expected 185, is %d", last_msg.msg.tracking_state_dep_b.states[24].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[25].cn0 * 100 - 9076.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[25].cn0, expected 9076.20019531, is %s", last_msg.msg.tracking_state_dep_b.states[25].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[25].sid.code == 85, "incorrect value for last_msg.msg.tracking_state_dep_b.states[25].sid.code, expected 85, is %d", last_msg.msg.tracking_state_dep_b.states[25].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[25].sid.reserved == 170, "incorrect value for last_msg.msg.tracking_state_dep_b.states[25].sid.reserved, expected 170, is %d", last_msg.msg.tracking_state_dep_b.states[25].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[25].sid.sat == 39804, "incorrect value for last_msg.msg.tracking_state_dep_b.states[25].sid.sat, expected 39804, is %d", last_msg.msg.tracking_state_dep_b.states[25].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[25].state == 18, "incorrect value for last_msg.msg.tracking_state_dep_b.states[25].state, expected 18, is %d", last_msg.msg.tracking_state_dep_b.states[25].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[26].cn0 * 100 - 4781.20019531 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[26].cn0, expected 4781.20019531, is %s", last_msg.msg.tracking_state_dep_b.states[26].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[26].sid.code == 255, "incorrect value for last_msg.msg.tracking_state_dep_b.states[26].sid.code, expected 255, is %d", last_msg.msg.tracking_state_dep_b.states[26].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[26].sid.reserved == 186, "incorrect value for last_msg.msg.tracking_state_dep_b.states[26].sid.reserved, expected 186, is %d", last_msg.msg.tracking_state_dep_b.states[26].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[26].sid.sat == 52980, "incorrect value for last_msg.msg.tracking_state_dep_b.states[26].sid.sat, expected 52980, is %d", last_msg.msg.tracking_state_dep_b.states[26].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[26].state == 57, "incorrect value for last_msg.msg.tracking_state_dep_b.states[26].state, expected 57, is %d", last_msg.msg.tracking_state_dep_b.states[26].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_b.states[27].cn0 * 100 - 3076.19995117 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_b.states[27].cn0, expected 3076.19995117, is %s", last_msg.msg.tracking_state_dep_b.states[27].cn0); - - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[27].sid.code == 181, "incorrect value for last_msg.msg.tracking_state_dep_b.states[27].sid.code, expected 181, is %d", last_msg.msg.tracking_state_dep_b.states[27].sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[27].sid.reserved == 175, "incorrect value for last_msg.msg.tracking_state_dep_b.states[27].sid.reserved, expected 175, is %d", last_msg.msg.tracking_state_dep_b.states[27].sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[27].sid.sat == 24007, "incorrect value for last_msg.msg.tracking_state_dep_b.states[27].sid.sat, expected 24007, is %d", last_msg.msg.tracking_state_dep_b.states[27].sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[27].state == 165, "incorrect value for last_msg.msg.tracking_state_dep_b.states[27].state, expected 165, is %d", last_msg.msg.tracking_state_dep_b.states[27].state); + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.n_states == 28, + "incorrect value for last_msg.msg.tracking_state_dep_b.n_states, " + "expected 28, is %d", + last_msg.msg.tracking_state_dep_b.n_states); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[0].cn0 * 100 - + 5856.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[0].cn0, " + "expected 5856.20019531, is %s", + last_msg.msg.tracking_state_dep_b.states[0].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[0].sid.code == 63, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[0].sid.code, " + "expected 63, is %d", + last_msg.msg.tracking_state_dep_b.states[0].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[0].sid.reserved == 68, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[0].sid.reserved, expected " + "68, is %d", + last_msg.msg.tracking_state_dep_b.states[0].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[0].sid.sat == 58295, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[0].sid.sat, " + "expected 58295, is %d", + last_msg.msg.tracking_state_dep_b.states[0].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[0].state == 115, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[0].state, expected " + "115, is %d", + last_msg.msg.tracking_state_dep_b.states[0].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[1].cn0 * 100 - + 2612.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[1].cn0, " + "expected 2612.19995117, is %s", + last_msg.msg.tracking_state_dep_b.states[1].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[1].sid.code == 43, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[1].sid.code, " + "expected 43, is %d", + last_msg.msg.tracking_state_dep_b.states[1].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[1].sid.reserved == 222, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[1].sid.reserved, expected " + "222, is %d", + last_msg.msg.tracking_state_dep_b.states[1].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[1].sid.sat == 31151, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[1].sid.sat, " + "expected 31151, is %d", + last_msg.msg.tracking_state_dep_b.states[1].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[1].state == 255, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[1].state, expected " + "255, is %d", + last_msg.msg.tracking_state_dep_b.states[1].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[2].cn0 * 100 - + 2925.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[2].cn0, " + "expected 2925.19995117, is %s", + last_msg.msg.tracking_state_dep_b.states[2].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[2].sid.code == 53, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[2].sid.code, " + "expected 53, is %d", + last_msg.msg.tracking_state_dep_b.states[2].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[2].sid.reserved == 20, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[2].sid.reserved, expected " + "20, is %d", + last_msg.msg.tracking_state_dep_b.states[2].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[2].sid.sat == 1520, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[2].sid.sat, " + "expected 1520, is %d", + last_msg.msg.tracking_state_dep_b.states[2].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[2].state == 78, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[2].state, expected 78, is %d", + last_msg.msg.tracking_state_dep_b.states[2].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[3].cn0 * 100 - + 3198.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[3].cn0, " + "expected 3198.19995117, is %s", + last_msg.msg.tracking_state_dep_b.states[3].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[3].sid.code == 66, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[3].sid.code, " + "expected 66, is %d", + last_msg.msg.tracking_state_dep_b.states[3].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[3].sid.reserved == 155, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[3].sid.reserved, expected " + "155, is %d", + last_msg.msg.tracking_state_dep_b.states[3].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[3].sid.sat == 60802, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[3].sid.sat, " + "expected 60802, is %d", + last_msg.msg.tracking_state_dep_b.states[3].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[3].state == 153, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[3].state, expected " + "153, is %d", + last_msg.msg.tracking_state_dep_b.states[3].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[4].cn0 * 100 - + 8623.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[4].cn0, " + "expected 8623.20019531, is %s", + last_msg.msg.tracking_state_dep_b.states[4].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[4].sid.code == 161, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[4].sid.code, " + "expected 161, is %d", + last_msg.msg.tracking_state_dep_b.states[4].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[4].sid.reserved == 190, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[4].sid.reserved, expected " + "190, is %d", + last_msg.msg.tracking_state_dep_b.states[4].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[4].sid.sat == 35058, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[4].sid.sat, " + "expected 35058, is %d", + last_msg.msg.tracking_state_dep_b.states[4].sid.sat); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[4].state == 53, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[4].state, expected 53, is %d", + last_msg.msg.tracking_state_dep_b.states[4].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[5].cn0 * 100 - + 5915.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[5].cn0, " + "expected 5915.20019531, is %s", + last_msg.msg.tracking_state_dep_b.states[5].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[5].sid.code == 142, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[5].sid.code, " + "expected 142, is %d", + last_msg.msg.tracking_state_dep_b.states[5].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[5].sid.reserved == 149, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[5].sid.reserved, expected " + "149, is %d", + last_msg.msg.tracking_state_dep_b.states[5].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[5].sid.sat == 65405, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[5].sid.sat, " + "expected 65405, is %d", + last_msg.msg.tracking_state_dep_b.states[5].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[5].state == 153, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[5].state, expected " + "153, is %d", + last_msg.msg.tracking_state_dep_b.states[5].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[6].cn0 * 100 - + 5412.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[6].cn0, " + "expected 5412.20019531, is %s", + last_msg.msg.tracking_state_dep_b.states[6].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[6].sid.code == 31, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[6].sid.code, " + "expected 31, is %d", + last_msg.msg.tracking_state_dep_b.states[6].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[6].sid.reserved == 76, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[6].sid.reserved, expected " + "76, is %d", + last_msg.msg.tracking_state_dep_b.states[6].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[6].sid.sat == 24422, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[6].sid.sat, " + "expected 24422, is %d", + last_msg.msg.tracking_state_dep_b.states[6].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[6].state == 248, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[6].state, expected " + "248, is %d", + last_msg.msg.tracking_state_dep_b.states[6].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[7].cn0 * 100 - + 6428.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[7].cn0, " + "expected 6428.20019531, is %s", + last_msg.msg.tracking_state_dep_b.states[7].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[7].sid.code == 27, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[7].sid.code, " + "expected 27, is %d", + last_msg.msg.tracking_state_dep_b.states[7].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[7].sid.reserved == 12, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[7].sid.reserved, expected " + "12, is %d", + last_msg.msg.tracking_state_dep_b.states[7].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[7].sid.sat == 36211, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[7].sid.sat, " + "expected 36211, is %d", + last_msg.msg.tracking_state_dep_b.states[7].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[7].state == 131, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[7].state, expected " + "131, is %d", + last_msg.msg.tracking_state_dep_b.states[7].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[8].cn0 * 100 - + 3104.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[8].cn0, " + "expected 3104.19995117, is %s", + last_msg.msg.tracking_state_dep_b.states[8].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[8].sid.code == 39, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[8].sid.code, " + "expected 39, is %d", + last_msg.msg.tracking_state_dep_b.states[8].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[8].sid.reserved == 23, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[8].sid.reserved, expected " + "23, is %d", + last_msg.msg.tracking_state_dep_b.states[8].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[8].sid.sat == 37676, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[8].sid.sat, " + "expected 37676, is %d", + last_msg.msg.tracking_state_dep_b.states[8].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[8].state == 208, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[8].state, expected " + "208, is %d", + last_msg.msg.tracking_state_dep_b.states[8].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[9].cn0 * 100 - + 3686.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[9].cn0, " + "expected 3686.19995117, is %s", + last_msg.msg.tracking_state_dep_b.states[9].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[9].sid.code == 49, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[9].sid.code, " + "expected 49, is %d", + last_msg.msg.tracking_state_dep_b.states[9].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[9].sid.reserved == 203, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[9].sid.reserved, expected " + "203, is %d", + last_msg.msg.tracking_state_dep_b.states[9].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[9].sid.sat == 64415, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[9].sid.sat, " + "expected 64415, is %d", + last_msg.msg.tracking_state_dep_b.states[9].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[9].state == 237, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[9].state, expected " + "237, is %d", + last_msg.msg.tracking_state_dep_b.states[9].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[10].cn0 * 100 - + 5967.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[10].cn0, " + "expected 5967.20019531, is %s", + last_msg.msg.tracking_state_dep_b.states[10].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[10].sid.code == 128, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[10].sid.code, " + "expected 128, is %d", + last_msg.msg.tracking_state_dep_b.states[10].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[10].sid.reserved == 206, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[10].sid.reserved, expected " + "206, is %d", + last_msg.msg.tracking_state_dep_b.states[10].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[10].sid.sat == 22486, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[10].sid.sat, " + "expected 22486, is %d", + last_msg.msg.tracking_state_dep_b.states[10].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[10].state == 70, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[10].state, " + "expected 70, is %d", + last_msg.msg.tracking_state_dep_b.states[10].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[11].cn0 * 100 - + 5423.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[11].cn0, " + "expected 5423.20019531, is %s", + last_msg.msg.tracking_state_dep_b.states[11].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[11].sid.code == 218, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[11].sid.code, " + "expected 218, is %d", + last_msg.msg.tracking_state_dep_b.states[11].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[11].sid.reserved == 19, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[11].sid.reserved, expected " + "19, is %d", + last_msg.msg.tracking_state_dep_b.states[11].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[11].sid.sat == 28622, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[11].sid.sat, " + "expected 28622, is %d", + last_msg.msg.tracking_state_dep_b.states[11].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[11].state == 14, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[11].state, " + "expected 14, is %d", + last_msg.msg.tracking_state_dep_b.states[11].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[12].cn0 * 100 - + 438.200012207 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[12].cn0, " + "expected 438.200012207, is %s", + last_msg.msg.tracking_state_dep_b.states[12].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[12].sid.code == 54, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[12].sid.code, " + "expected 54, is %d", + last_msg.msg.tracking_state_dep_b.states[12].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[12].sid.reserved == 2, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[12].sid.reserved, expected " + "2, is %d", + last_msg.msg.tracking_state_dep_b.states[12].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[12].sid.sat == 53602, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[12].sid.sat, " + "expected 53602, is %d", + last_msg.msg.tracking_state_dep_b.states[12].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[12].state == 216, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[12].state, " + "expected 216, is %d", + last_msg.msg.tracking_state_dep_b.states[12].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[13].cn0 * 100 - + 1862.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[13].cn0, " + "expected 1862.19995117, is %s", + last_msg.msg.tracking_state_dep_b.states[13].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[13].sid.code == 7, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[13].sid.code, " + "expected 7, is %d", + last_msg.msg.tracking_state_dep_b.states[13].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[13].sid.reserved == 34, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[13].sid.reserved, expected " + "34, is %d", + last_msg.msg.tracking_state_dep_b.states[13].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[13].sid.sat == 25477, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[13].sid.sat, " + "expected 25477, is %d", + last_msg.msg.tracking_state_dep_b.states[13].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[13].state == 200, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[13].state, " + "expected 200, is %d", + last_msg.msg.tracking_state_dep_b.states[13].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[14].cn0 * 100 - + 5462.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[14].cn0, " + "expected 5462.20019531, is %s", + last_msg.msg.tracking_state_dep_b.states[14].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[14].sid.code == 135, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[14].sid.code, " + "expected 135, is %d", + last_msg.msg.tracking_state_dep_b.states[14].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[14].sid.reserved == 46, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[14].sid.reserved, expected " + "46, is %d", + last_msg.msg.tracking_state_dep_b.states[14].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[14].sid.sat == 21803, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[14].sid.sat, " + "expected 21803, is %d", + last_msg.msg.tracking_state_dep_b.states[14].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[14].state == 155, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[14].state, " + "expected 155, is %d", + last_msg.msg.tracking_state_dep_b.states[14].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[15].cn0 * 100 - + 7454.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[15].cn0, " + "expected 7454.20019531, is %s", + last_msg.msg.tracking_state_dep_b.states[15].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[15].sid.code == 171, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[15].sid.code, " + "expected 171, is %d", + last_msg.msg.tracking_state_dep_b.states[15].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[15].sid.reserved == 201, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[15].sid.reserved, expected " + "201, is %d", + last_msg.msg.tracking_state_dep_b.states[15].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[15].sid.sat == 21251, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[15].sid.sat, " + "expected 21251, is %d", + last_msg.msg.tracking_state_dep_b.states[15].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[15].state == 155, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[15].state, " + "expected 155, is %d", + last_msg.msg.tracking_state_dep_b.states[15].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[16].cn0 * 100 - + 7134.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[16].cn0, " + "expected 7134.20019531, is %s", + last_msg.msg.tracking_state_dep_b.states[16].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[16].sid.code == 16, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[16].sid.code, " + "expected 16, is %d", + last_msg.msg.tracking_state_dep_b.states[16].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[16].sid.reserved == 19, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[16].sid.reserved, expected " + "19, is %d", + last_msg.msg.tracking_state_dep_b.states[16].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[16].sid.sat == 50475, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[16].sid.sat, " + "expected 50475, is %d", + last_msg.msg.tracking_state_dep_b.states[16].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[16].state == 121, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[16].state, " + "expected 121, is %d", + last_msg.msg.tracking_state_dep_b.states[16].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[17].cn0 * 100 - + 3111.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[17].cn0, " + "expected 3111.19995117, is %s", + last_msg.msg.tracking_state_dep_b.states[17].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[17].sid.code == 63, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[17].sid.code, " + "expected 63, is %d", + last_msg.msg.tracking_state_dep_b.states[17].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[17].sid.reserved == 176, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[17].sid.reserved, expected " + "176, is %d", + last_msg.msg.tracking_state_dep_b.states[17].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[17].sid.sat == 13813, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[17].sid.sat, " + "expected 13813, is %d", + last_msg.msg.tracking_state_dep_b.states[17].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[17].state == 128, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[17].state, " + "expected 128, is %d", + last_msg.msg.tracking_state_dep_b.states[17].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[18].cn0 * 100 - + 4297.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[18].cn0, " + "expected 4297.20019531, is %s", + last_msg.msg.tracking_state_dep_b.states[18].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[18].sid.code == 153, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[18].sid.code, " + "expected 153, is %d", + last_msg.msg.tracking_state_dep_b.states[18].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[18].sid.reserved == 51, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[18].sid.reserved, expected " + "51, is %d", + last_msg.msg.tracking_state_dep_b.states[18].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[18].sid.sat == 15636, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[18].sid.sat, " + "expected 15636, is %d", + last_msg.msg.tracking_state_dep_b.states[18].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[18].state == 36, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[18].state, " + "expected 36, is %d", + last_msg.msg.tracking_state_dep_b.states[18].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[19].cn0 * 100 - + 2649.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[19].cn0, " + "expected 2649.19995117, is %s", + last_msg.msg.tracking_state_dep_b.states[19].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[19].sid.code == 140, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[19].sid.code, " + "expected 140, is %d", + last_msg.msg.tracking_state_dep_b.states[19].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[19].sid.reserved == 22, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[19].sid.reserved, expected " + "22, is %d", + last_msg.msg.tracking_state_dep_b.states[19].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[19].sid.sat == 29778, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[19].sid.sat, " + "expected 29778, is %d", + last_msg.msg.tracking_state_dep_b.states[19].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[19].state == 46, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[19].state, " + "expected 46, is %d", + last_msg.msg.tracking_state_dep_b.states[19].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[20].cn0 * 100 - + 941.200012207 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[20].cn0, " + "expected 941.200012207, is %s", + last_msg.msg.tracking_state_dep_b.states[20].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[20].sid.code == 96, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[20].sid.code, " + "expected 96, is %d", + last_msg.msg.tracking_state_dep_b.states[20].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[20].sid.reserved == 143, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[20].sid.reserved, expected " + "143, is %d", + last_msg.msg.tracking_state_dep_b.states[20].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[20].sid.sat == 37443, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[20].sid.sat, " + "expected 37443, is %d", + last_msg.msg.tracking_state_dep_b.states[20].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[20].state == 177, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[20].state, " + "expected 177, is %d", + last_msg.msg.tracking_state_dep_b.states[20].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[21].cn0 * 100 - + 1539.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[21].cn0, " + "expected 1539.19995117, is %s", + last_msg.msg.tracking_state_dep_b.states[21].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[21].sid.code == 201, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[21].sid.code, " + "expected 201, is %d", + last_msg.msg.tracking_state_dep_b.states[21].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[21].sid.reserved == 251, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[21].sid.reserved, expected " + "251, is %d", + last_msg.msg.tracking_state_dep_b.states[21].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[21].sid.sat == 41011, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[21].sid.sat, " + "expected 41011, is %d", + last_msg.msg.tracking_state_dep_b.states[21].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[21].state == 220, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[21].state, " + "expected 220, is %d", + last_msg.msg.tracking_state_dep_b.states[21].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[22].cn0 * 100 - + 1443.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[22].cn0, " + "expected 1443.19995117, is %s", + last_msg.msg.tracking_state_dep_b.states[22].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[22].sid.code == 161, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[22].sid.code, " + "expected 161, is %d", + last_msg.msg.tracking_state_dep_b.states[22].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[22].sid.reserved == 220, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[22].sid.reserved, expected " + "220, is %d", + last_msg.msg.tracking_state_dep_b.states[22].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[22].sid.sat == 706, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[22].sid.sat, " + "expected 706, is %d", + last_msg.msg.tracking_state_dep_b.states[22].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[22].state == 168, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[22].state, " + "expected 168, is %d", + last_msg.msg.tracking_state_dep_b.states[22].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[23].cn0 * 100 - + 1074.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[23].cn0, " + "expected 1074.19995117, is %s", + last_msg.msg.tracking_state_dep_b.states[23].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[23].sid.code == 125, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[23].sid.code, " + "expected 125, is %d", + last_msg.msg.tracking_state_dep_b.states[23].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[23].sid.reserved == 178, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[23].sid.reserved, expected " + "178, is %d", + last_msg.msg.tracking_state_dep_b.states[23].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[23].sid.sat == 2312, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[23].sid.sat, " + "expected 2312, is %d", + last_msg.msg.tracking_state_dep_b.states[23].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[23].state == 69, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[23].state, " + "expected 69, is %d", + last_msg.msg.tracking_state_dep_b.states[23].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[24].cn0 * 100 - + 2122.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[24].cn0, " + "expected 2122.19995117, is %s", + last_msg.msg.tracking_state_dep_b.states[24].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[24].sid.code == 186, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[24].sid.code, " + "expected 186, is %d", + last_msg.msg.tracking_state_dep_b.states[24].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[24].sid.reserved == 171, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[24].sid.reserved, expected " + "171, is %d", + last_msg.msg.tracking_state_dep_b.states[24].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[24].sid.sat == 34580, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[24].sid.sat, " + "expected 34580, is %d", + last_msg.msg.tracking_state_dep_b.states[24].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[24].state == 185, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[24].state, " + "expected 185, is %d", + last_msg.msg.tracking_state_dep_b.states[24].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[25].cn0 * 100 - + 9076.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[25].cn0, " + "expected 9076.20019531, is %s", + last_msg.msg.tracking_state_dep_b.states[25].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[25].sid.code == 85, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[25].sid.code, " + "expected 85, is %d", + last_msg.msg.tracking_state_dep_b.states[25].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[25].sid.reserved == 170, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[25].sid.reserved, expected " + "170, is %d", + last_msg.msg.tracking_state_dep_b.states[25].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[25].sid.sat == 39804, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[25].sid.sat, " + "expected 39804, is %d", + last_msg.msg.tracking_state_dep_b.states[25].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[25].state == 18, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[25].state, " + "expected 18, is %d", + last_msg.msg.tracking_state_dep_b.states[25].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[26].cn0 * 100 - + 4781.20019531 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[26].cn0, " + "expected 4781.20019531, is %s", + last_msg.msg.tracking_state_dep_b.states[26].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[26].sid.code == 255, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[26].sid.code, " + "expected 255, is %d", + last_msg.msg.tracking_state_dep_b.states[26].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[26].sid.reserved == 186, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[26].sid.reserved, expected " + "186, is %d", + last_msg.msg.tracking_state_dep_b.states[26].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[26].sid.sat == 52980, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[26].sid.sat, " + "expected 52980, is %d", + last_msg.msg.tracking_state_dep_b.states[26].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[26].state == 57, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[26].state, " + "expected 57, is %d", + last_msg.msg.tracking_state_dep_b.states[26].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_b.states[27].cn0 * 100 - + 3076.19995117 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_b.states[27].cn0, " + "expected 3076.19995117, is %s", + last_msg.msg.tracking_state_dep_b.states[27].cn0); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[27].sid.code == 181, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[27].sid.code, " + "expected 181, is %d", + last_msg.msg.tracking_state_dep_b.states[27].sid.code); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_b.states[27].sid.reserved == 175, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[27].sid.reserved, expected " + "175, is %d", + last_msg.msg.tracking_state_dep_b.states[27].sid.reserved); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[27].sid.sat == 24007, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[27].sid.sat, " + "expected 24007, is %d", + last_msg.msg.tracking_state_dep_b.states[27].sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_dep_b.states[27].state == 165, + "incorrect value for " + "last_msg.msg.tracking_state_dep_b.states[27].state, " + "expected 165, is %d", + last_msg.msg.tracking_state_dep_b.states[27].state); } } END_TEST -Suite* auto_check_sbp_tracking_MsgTrackingStateDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_tracking_MsgTrackingStateDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_tracking_MsgTrackingStateDepB"); +Suite *auto_check_sbp_tracking_MsgTrackingStateDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_tracking_MsgTrackingStateDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_tracking_MsgTrackingStateDepB"); tcase_add_test(tc_acq, test_auto_check_sbp_tracking_MsgTrackingStateDepB); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.c b/c/test/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.c index e5046f019..896d449e2 100644 --- a/c/test/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.c +++ b/c/test/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDep.yaml +// by generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) -{ +START_TEST(test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,146 +90,251 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x11, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x11, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,17,0,59,103,55,163,151,112,215,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,5,0,0,169,177,208,54,15,0,0,0,85,61,0,0,39,0,1,0,0,0,0,0,0,0,40,0,108,1,0,11,0,0,9,166,214, }; + u8 encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 163, 151, 112, 215, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 5, 0, 0, 169, 177, + 208, 54, 15, 0, 0, 0, 85, 61, 0, 0, 39, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 108, 1, 0, 11, 0, 0, 9, 166, 214, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.tracking_state_detailed_dep.L.f = 169; - + test_msg.tracking_state_detailed_dep.L.i = 1319; - + test_msg.tracking_state_detailed_dep.P = 0; - + test_msg.tracking_state_detailed_dep.P_std = 0; - + test_msg.tracking_state_detailed_dep.acceleration = 108; - + test_msg.tracking_state_detailed_dep.clock_drift = 0; - + test_msg.tracking_state_detailed_dep.clock_offset = 0; - + test_msg.tracking_state_detailed_dep.cn0 = 177; - + test_msg.tracking_state_detailed_dep.corr_spacing = 40; - + test_msg.tracking_state_detailed_dep.doppler = 15701; - + test_msg.tracking_state_detailed_dep.doppler_std = 39; - + test_msg.tracking_state_detailed_dep.lock = 14032; - + test_msg.tracking_state_detailed_dep.misc_flags = 9; - + test_msg.tracking_state_detailed_dep.nav_flags = 0; - + test_msg.tracking_state_detailed_dep.pset_flags = 0; - + test_msg.tracking_state_detailed_dep.recv_time = 7909447587; - - + test_msg.tracking_state_detailed_dep.sid.code = 0; - + test_msg.tracking_state_detailed_dep.sid.reserved = 0; - + test_msg.tracking_state_detailed_dep.sid.sat = 15; - + test_msg.tracking_state_detailed_dep.sync_flags = 1; - - + test_msg.tracking_state_detailed_dep.tot.tow = 0; - + test_msg.tracking_state_detailed_dep.tot.wn = 0; - + test_msg.tracking_state_detailed_dep.tow_flags = 0; - + test_msg.tracking_state_detailed_dep.track_flags = 11; - + test_msg.tracking_state_detailed_dep.uptime = 1; - sbp_message_send(&sbp_state, SbpMsgTrackingStateDetailedDep, 26427, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingStateDetailedDep, 26427, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 26427, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDetailedDep, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.L.f == 169, "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.f, expected 169, is %d", last_msg.msg.tracking_state_detailed_dep.L.f); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.L.i == 1319, "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.i, expected 1319, is %d", last_msg.msg.tracking_state_detailed_dep.L.i); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.P == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.P, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.P); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.P_std == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.P_std, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.P_std); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.acceleration == 108, "incorrect value for last_msg.msg.tracking_state_detailed_dep.acceleration, expected 108, is %d", last_msg.msg.tracking_state_detailed_dep.acceleration); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_drift == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.clock_drift, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.clock_drift); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_offset == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.clock_offset, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.clock_offset); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.cn0 == 177, "incorrect value for last_msg.msg.tracking_state_detailed_dep.cn0, expected 177, is %d", last_msg.msg.tracking_state_detailed_dep.cn0); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.corr_spacing == 40, "incorrect value for last_msg.msg.tracking_state_detailed_dep.corr_spacing, expected 40, is %d", last_msg.msg.tracking_state_detailed_dep.corr_spacing); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.doppler == 15701, "incorrect value for last_msg.msg.tracking_state_detailed_dep.doppler, expected 15701, is %d", last_msg.msg.tracking_state_detailed_dep.doppler); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.doppler_std == 39, "incorrect value for last_msg.msg.tracking_state_detailed_dep.doppler_std, expected 39, is %d", last_msg.msg.tracking_state_detailed_dep.doppler_std); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.lock == 14032, "incorrect value for last_msg.msg.tracking_state_detailed_dep.lock, expected 14032, is %d", last_msg.msg.tracking_state_detailed_dep.lock); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.misc_flags == 9, "incorrect value for last_msg.msg.tracking_state_detailed_dep.misc_flags, expected 9, is %d", last_msg.msg.tracking_state_detailed_dep.misc_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.nav_flags == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.nav_flags, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.nav_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.pset_flags == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.pset_flags, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.pset_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.recv_time == 7909447587, "incorrect value for last_msg.msg.tracking_state_detailed_dep.recv_time, expected 7909447587, is %d", last_msg.msg.tracking_state_detailed_dep.recv_time); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.code == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.code, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.reserved == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.reserved, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.sat == 15, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.sat, expected 15, is %d", last_msg.msg.tracking_state_detailed_dep.sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sync_flags == 1, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sync_flags, expected 1, is %d", last_msg.msg.tracking_state_detailed_dep.sync_flags); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.tot.tow == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.tow, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.tot.tow); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.tot.wn == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.wn, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.tot.wn); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.tow_flags == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.tow_flags, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.tow_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.track_flags == 11, "incorrect value for last_msg.msg.tracking_state_detailed_dep.track_flags, expected 11, is %d", last_msg.msg.tracking_state_detailed_dep.track_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.uptime == 1, "incorrect value for last_msg.msg.tracking_state_detailed_dep.uptime, expected 1, is %d", last_msg.msg.tracking_state_detailed_dep.uptime); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDetailedDep, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.L.f == 169, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.f, " + "expected 169, is %d", + last_msg.msg.tracking_state_detailed_dep.L.f); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.L.i == 1319, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.i, " + "expected 1319, is %d", + last_msg.msg.tracking_state_detailed_dep.L.i); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.P == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.P, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.P); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.P_std == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.P_std, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.P_std); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.acceleration == 108, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.acceleration, " + "expected 108, is %d", + last_msg.msg.tracking_state_detailed_dep.acceleration); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_drift == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.clock_drift, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.clock_drift); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_offset == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.clock_offset, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.clock_offset); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.cn0 == 177, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.cn0, " + "expected 177, is %d", + last_msg.msg.tracking_state_detailed_dep.cn0); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.corr_spacing == 40, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.corr_spacing, " + "expected 40, is %d", + last_msg.msg.tracking_state_detailed_dep.corr_spacing); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.doppler == 15701, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.doppler, " + "expected 15701, is %d", + last_msg.msg.tracking_state_detailed_dep.doppler); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.doppler_std == 39, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.doppler_std, " + "expected 39, is %d", + last_msg.msg.tracking_state_detailed_dep.doppler_std); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.lock == 14032, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.lock, " + "expected 14032, is %d", + last_msg.msg.tracking_state_detailed_dep.lock); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.misc_flags == 9, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.misc_flags, " + "expected 9, is %d", + last_msg.msg.tracking_state_detailed_dep.misc_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.nav_flags == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.nav_flags, expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.nav_flags); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.pset_flags == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.pset_flags, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.pset_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.recv_time == 7909447587, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.recv_time, expected " + "7909447587, is %d", + last_msg.msg.tracking_state_detailed_dep.recv_time); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.sid.code == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.sid.code, expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.sid.code); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.reserved == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.sid.reserved, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.sid.reserved); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.sid.sat == 15, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.sat, " + "expected 15, is %d", + last_msg.msg.tracking_state_detailed_dep.sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sync_flags == 1, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.sync_flags, " + "expected 1, is %d", + last_msg.msg.tracking_state_detailed_dep.sync_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.tot.tow == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.tow, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.tot.tow); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.tot.wn == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.wn, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.tot.wn); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.tow_flags == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.tow_flags, expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.tow_flags); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.track_flags == 11, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.track_flags, " + "expected 11, is %d", + last_msg.msg.tracking_state_detailed_dep.track_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.uptime == 1, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.uptime, " + "expected 1, is %d", + last_msg.msg.tracking_state_detailed_dep.uptime); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -241,146 +342,251 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x11, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x11, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,17,0,59,103,55,97,251,61,245,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,7,0,0,14,175,208,54,15,0,0,0,51,61,0,0,30,0,1,0,0,0,0,0,0,0,40,0,224,1,0,11,0,0,9,136,179, }; + u8 encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 97, 251, 61, 245, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 7, 0, 0, 14, 175, + 208, 54, 15, 0, 0, 0, 51, 61, 0, 0, 30, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 224, 1, 0, 11, 0, 0, 9, 136, 179, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.tracking_state_detailed_dep.L.f = 14; - + test_msg.tracking_state_detailed_dep.L.i = 1810; - + test_msg.tracking_state_detailed_dep.P = 0; - + test_msg.tracking_state_detailed_dep.P_std = 0; - + test_msg.tracking_state_detailed_dep.acceleration = -32; - + test_msg.tracking_state_detailed_dep.clock_drift = 0; - + test_msg.tracking_state_detailed_dep.clock_offset = 0; - + test_msg.tracking_state_detailed_dep.cn0 = 175; - + test_msg.tracking_state_detailed_dep.corr_spacing = 40; - + test_msg.tracking_state_detailed_dep.doppler = 15667; - + test_msg.tracking_state_detailed_dep.doppler_std = 30; - + test_msg.tracking_state_detailed_dep.lock = 14032; - + test_msg.tracking_state_detailed_dep.misc_flags = 9; - + test_msg.tracking_state_detailed_dep.nav_flags = 0; - + test_msg.tracking_state_detailed_dep.pset_flags = 0; - + test_msg.tracking_state_detailed_dep.recv_time = 8409447265; - - + test_msg.tracking_state_detailed_dep.sid.code = 0; - + test_msg.tracking_state_detailed_dep.sid.reserved = 0; - + test_msg.tracking_state_detailed_dep.sid.sat = 15; - + test_msg.tracking_state_detailed_dep.sync_flags = 1; - - + test_msg.tracking_state_detailed_dep.tot.tow = 0; - + test_msg.tracking_state_detailed_dep.tot.wn = 0; - + test_msg.tracking_state_detailed_dep.tow_flags = 0; - + test_msg.tracking_state_detailed_dep.track_flags = 11; - + test_msg.tracking_state_detailed_dep.uptime = 1; - sbp_message_send(&sbp_state, SbpMsgTrackingStateDetailedDep, 26427, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingStateDetailedDep, 26427, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 26427, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDetailedDep, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.L.f == 14, "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.f, expected 14, is %d", last_msg.msg.tracking_state_detailed_dep.L.f); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.L.i == 1810, "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.i, expected 1810, is %d", last_msg.msg.tracking_state_detailed_dep.L.i); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.P == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.P, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.P); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.P_std == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.P_std, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.P_std); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.acceleration == -32, "incorrect value for last_msg.msg.tracking_state_detailed_dep.acceleration, expected -32, is %d", last_msg.msg.tracking_state_detailed_dep.acceleration); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_drift == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.clock_drift, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.clock_drift); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_offset == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.clock_offset, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.clock_offset); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.cn0 == 175, "incorrect value for last_msg.msg.tracking_state_detailed_dep.cn0, expected 175, is %d", last_msg.msg.tracking_state_detailed_dep.cn0); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.corr_spacing == 40, "incorrect value for last_msg.msg.tracking_state_detailed_dep.corr_spacing, expected 40, is %d", last_msg.msg.tracking_state_detailed_dep.corr_spacing); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.doppler == 15667, "incorrect value for last_msg.msg.tracking_state_detailed_dep.doppler, expected 15667, is %d", last_msg.msg.tracking_state_detailed_dep.doppler); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.doppler_std == 30, "incorrect value for last_msg.msg.tracking_state_detailed_dep.doppler_std, expected 30, is %d", last_msg.msg.tracking_state_detailed_dep.doppler_std); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.lock == 14032, "incorrect value for last_msg.msg.tracking_state_detailed_dep.lock, expected 14032, is %d", last_msg.msg.tracking_state_detailed_dep.lock); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.misc_flags == 9, "incorrect value for last_msg.msg.tracking_state_detailed_dep.misc_flags, expected 9, is %d", last_msg.msg.tracking_state_detailed_dep.misc_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.nav_flags == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.nav_flags, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.nav_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.pset_flags == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.pset_flags, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.pset_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.recv_time == 8409447265, "incorrect value for last_msg.msg.tracking_state_detailed_dep.recv_time, expected 8409447265, is %d", last_msg.msg.tracking_state_detailed_dep.recv_time); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.code == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.code, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.reserved == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.reserved, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.sat == 15, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.sat, expected 15, is %d", last_msg.msg.tracking_state_detailed_dep.sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sync_flags == 1, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sync_flags, expected 1, is %d", last_msg.msg.tracking_state_detailed_dep.sync_flags); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.tot.tow == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.tow, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.tot.tow); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.tot.wn == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.wn, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.tot.wn); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.tow_flags == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.tow_flags, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.tow_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.track_flags == 11, "incorrect value for last_msg.msg.tracking_state_detailed_dep.track_flags, expected 11, is %d", last_msg.msg.tracking_state_detailed_dep.track_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.uptime == 1, "incorrect value for last_msg.msg.tracking_state_detailed_dep.uptime, expected 1, is %d", last_msg.msg.tracking_state_detailed_dep.uptime); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDetailedDep, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.L.f == 14, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.f, " + "expected 14, is %d", + last_msg.msg.tracking_state_detailed_dep.L.f); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.L.i == 1810, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.i, " + "expected 1810, is %d", + last_msg.msg.tracking_state_detailed_dep.L.i); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.P == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.P, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.P); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.P_std == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.P_std, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.P_std); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.acceleration == -32, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.acceleration, " + "expected -32, is %d", + last_msg.msg.tracking_state_detailed_dep.acceleration); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_drift == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.clock_drift, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.clock_drift); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_offset == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.clock_offset, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.clock_offset); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.cn0 == 175, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.cn0, " + "expected 175, is %d", + last_msg.msg.tracking_state_detailed_dep.cn0); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.corr_spacing == 40, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.corr_spacing, " + "expected 40, is %d", + last_msg.msg.tracking_state_detailed_dep.corr_spacing); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.doppler == 15667, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.doppler, " + "expected 15667, is %d", + last_msg.msg.tracking_state_detailed_dep.doppler); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.doppler_std == 30, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.doppler_std, " + "expected 30, is %d", + last_msg.msg.tracking_state_detailed_dep.doppler_std); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.lock == 14032, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.lock, " + "expected 14032, is %d", + last_msg.msg.tracking_state_detailed_dep.lock); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.misc_flags == 9, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.misc_flags, " + "expected 9, is %d", + last_msg.msg.tracking_state_detailed_dep.misc_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.nav_flags == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.nav_flags, expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.nav_flags); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.pset_flags == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.pset_flags, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.pset_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.recv_time == 8409447265, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.recv_time, expected " + "8409447265, is %d", + last_msg.msg.tracking_state_detailed_dep.recv_time); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.sid.code == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.sid.code, expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.sid.code); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.reserved == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.sid.reserved, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.sid.reserved); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.sid.sat == 15, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.sat, " + "expected 15, is %d", + last_msg.msg.tracking_state_detailed_dep.sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sync_flags == 1, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.sync_flags, " + "expected 1, is %d", + last_msg.msg.tracking_state_detailed_dep.sync_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.tot.tow == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.tow, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.tot.tow); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.tot.wn == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.wn, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.tot.wn); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.tow_flags == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.tow_flags, expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.tow_flags); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.track_flags == 11, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.track_flags, " + "expected 11, is %d", + last_msg.msg.tracking_state_detailed_dep.track_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.uptime == 1, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.uptime, " + "expected 1, is %d", + last_msg.msg.tracking_state_detailed_dep.uptime); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -388,146 +594,251 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x11, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x11, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,17,0,59,103,55,139,218,236,18,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,8,0,0,8,179,208,54,15,0,0,0,67,61,0,0,22,0,2,0,0,0,0,0,0,0,40,0,27,1,0,11,0,2,9,217,159, }; + u8 encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 139, 218, 236, 18, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 8, 0, 0, 8, 179, + 208, 54, 15, 0, 0, 0, 67, 61, 0, 0, 22, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 27, 1, 0, 11, 0, 2, 9, 217, 159, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.tracking_state_detailed_dep.L.f = 8; - + test_msg.tracking_state_detailed_dep.L.i = 2298; - + test_msg.tracking_state_detailed_dep.P = 0; - + test_msg.tracking_state_detailed_dep.P_std = 0; - + test_msg.tracking_state_detailed_dep.acceleration = 27; - + test_msg.tracking_state_detailed_dep.clock_drift = 0; - + test_msg.tracking_state_detailed_dep.clock_offset = 0; - + test_msg.tracking_state_detailed_dep.cn0 = 179; - + test_msg.tracking_state_detailed_dep.corr_spacing = 40; - + test_msg.tracking_state_detailed_dep.doppler = 15683; - + test_msg.tracking_state_detailed_dep.doppler_std = 22; - + test_msg.tracking_state_detailed_dep.lock = 14032; - + test_msg.tracking_state_detailed_dep.misc_flags = 9; - + test_msg.tracking_state_detailed_dep.nav_flags = 0; - + test_msg.tracking_state_detailed_dep.pset_flags = 2; - + test_msg.tracking_state_detailed_dep.recv_time = 8907446923; - - + test_msg.tracking_state_detailed_dep.sid.code = 0; - + test_msg.tracking_state_detailed_dep.sid.reserved = 0; - + test_msg.tracking_state_detailed_dep.sid.sat = 15; - + test_msg.tracking_state_detailed_dep.sync_flags = 1; - - + test_msg.tracking_state_detailed_dep.tot.tow = 0; - + test_msg.tracking_state_detailed_dep.tot.wn = 0; - + test_msg.tracking_state_detailed_dep.tow_flags = 0; - + test_msg.tracking_state_detailed_dep.track_flags = 11; - + test_msg.tracking_state_detailed_dep.uptime = 2; - sbp_message_send(&sbp_state, SbpMsgTrackingStateDetailedDep, 26427, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingStateDetailedDep, 26427, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 26427, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDetailedDep, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.L.f == 8, "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.f, expected 8, is %d", last_msg.msg.tracking_state_detailed_dep.L.f); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.L.i == 2298, "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.i, expected 2298, is %d", last_msg.msg.tracking_state_detailed_dep.L.i); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.P == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.P, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.P); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.P_std == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.P_std, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.P_std); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.acceleration == 27, "incorrect value for last_msg.msg.tracking_state_detailed_dep.acceleration, expected 27, is %d", last_msg.msg.tracking_state_detailed_dep.acceleration); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_drift == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.clock_drift, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.clock_drift); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_offset == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.clock_offset, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.clock_offset); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.cn0 == 179, "incorrect value for last_msg.msg.tracking_state_detailed_dep.cn0, expected 179, is %d", last_msg.msg.tracking_state_detailed_dep.cn0); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.corr_spacing == 40, "incorrect value for last_msg.msg.tracking_state_detailed_dep.corr_spacing, expected 40, is %d", last_msg.msg.tracking_state_detailed_dep.corr_spacing); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.doppler == 15683, "incorrect value for last_msg.msg.tracking_state_detailed_dep.doppler, expected 15683, is %d", last_msg.msg.tracking_state_detailed_dep.doppler); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.doppler_std == 22, "incorrect value for last_msg.msg.tracking_state_detailed_dep.doppler_std, expected 22, is %d", last_msg.msg.tracking_state_detailed_dep.doppler_std); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.lock == 14032, "incorrect value for last_msg.msg.tracking_state_detailed_dep.lock, expected 14032, is %d", last_msg.msg.tracking_state_detailed_dep.lock); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.misc_flags == 9, "incorrect value for last_msg.msg.tracking_state_detailed_dep.misc_flags, expected 9, is %d", last_msg.msg.tracking_state_detailed_dep.misc_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.nav_flags == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.nav_flags, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.nav_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.pset_flags == 2, "incorrect value for last_msg.msg.tracking_state_detailed_dep.pset_flags, expected 2, is %d", last_msg.msg.tracking_state_detailed_dep.pset_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.recv_time == 8907446923, "incorrect value for last_msg.msg.tracking_state_detailed_dep.recv_time, expected 8907446923, is %d", last_msg.msg.tracking_state_detailed_dep.recv_time); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.code == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.code, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.reserved == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.reserved, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.sat == 15, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.sat, expected 15, is %d", last_msg.msg.tracking_state_detailed_dep.sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sync_flags == 1, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sync_flags, expected 1, is %d", last_msg.msg.tracking_state_detailed_dep.sync_flags); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.tot.tow == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.tow, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.tot.tow); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.tot.wn == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.wn, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.tot.wn); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.tow_flags == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.tow_flags, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.tow_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.track_flags == 11, "incorrect value for last_msg.msg.tracking_state_detailed_dep.track_flags, expected 11, is %d", last_msg.msg.tracking_state_detailed_dep.track_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.uptime == 2, "incorrect value for last_msg.msg.tracking_state_detailed_dep.uptime, expected 2, is %d", last_msg.msg.tracking_state_detailed_dep.uptime); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDetailedDep, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.L.f == 8, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.f, " + "expected 8, is %d", + last_msg.msg.tracking_state_detailed_dep.L.f); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.L.i == 2298, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.i, " + "expected 2298, is %d", + last_msg.msg.tracking_state_detailed_dep.L.i); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.P == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.P, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.P); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.P_std == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.P_std, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.P_std); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.acceleration == 27, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.acceleration, " + "expected 27, is %d", + last_msg.msg.tracking_state_detailed_dep.acceleration); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_drift == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.clock_drift, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.clock_drift); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_offset == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.clock_offset, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.clock_offset); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.cn0 == 179, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.cn0, " + "expected 179, is %d", + last_msg.msg.tracking_state_detailed_dep.cn0); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.corr_spacing == 40, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.corr_spacing, " + "expected 40, is %d", + last_msg.msg.tracking_state_detailed_dep.corr_spacing); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.doppler == 15683, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.doppler, " + "expected 15683, is %d", + last_msg.msg.tracking_state_detailed_dep.doppler); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.doppler_std == 22, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.doppler_std, " + "expected 22, is %d", + last_msg.msg.tracking_state_detailed_dep.doppler_std); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.lock == 14032, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.lock, " + "expected 14032, is %d", + last_msg.msg.tracking_state_detailed_dep.lock); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.misc_flags == 9, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.misc_flags, " + "expected 9, is %d", + last_msg.msg.tracking_state_detailed_dep.misc_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.nav_flags == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.nav_flags, expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.nav_flags); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.pset_flags == 2, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.pset_flags, " + "expected 2, is %d", + last_msg.msg.tracking_state_detailed_dep.pset_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.recv_time == 8907446923, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.recv_time, expected " + "8907446923, is %d", + last_msg.msg.tracking_state_detailed_dep.recv_time); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.sid.code == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.sid.code, expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.sid.code); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.reserved == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.sid.reserved, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.sid.reserved); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.sid.sat == 15, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.sat, " + "expected 15, is %d", + last_msg.msg.tracking_state_detailed_dep.sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sync_flags == 1, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.sync_flags, " + "expected 1, is %d", + last_msg.msg.tracking_state_detailed_dep.sync_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.tot.tow == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.tow, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.tot.tow); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.tot.wn == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.wn, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.tot.wn); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.tow_flags == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.tow_flags, expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.tow_flags); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.track_flags == 11, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.track_flags, " + "expected 11, is %d", + last_msg.msg.tracking_state_detailed_dep.track_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.uptime == 2, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.uptime, " + "expected 2, is %d", + last_msg.msg.tracking_state_detailed_dep.uptime); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -535,146 +846,251 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x11, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x11, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,17,0,59,103,55,255,251,170,48,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,226,10,0,0,125,181,208,54,15,0,0,0,29,61,0,0,10,0,2,0,0,0,0,0,0,0,40,0,220,1,0,11,0,3,9,66,95, }; + u8 encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 255, 251, 170, 48, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 226, 10, 0, 0, 125, 181, + 208, 54, 15, 0, 0, 0, 29, 61, 0, 0, 10, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 220, 1, 0, 11, 0, 3, 9, 66, 95, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.tracking_state_detailed_dep.L.f = 125; - + test_msg.tracking_state_detailed_dep.L.i = 2786; - + test_msg.tracking_state_detailed_dep.P = 0; - + test_msg.tracking_state_detailed_dep.P_std = 0; - + test_msg.tracking_state_detailed_dep.acceleration = -36; - + test_msg.tracking_state_detailed_dep.clock_drift = 0; - + test_msg.tracking_state_detailed_dep.clock_offset = 0; - + test_msg.tracking_state_detailed_dep.cn0 = 181; - + test_msg.tracking_state_detailed_dep.corr_spacing = 40; - + test_msg.tracking_state_detailed_dep.doppler = 15645; - + test_msg.tracking_state_detailed_dep.doppler_std = 10; - + test_msg.tracking_state_detailed_dep.lock = 14032; - + test_msg.tracking_state_detailed_dep.misc_flags = 9; - + test_msg.tracking_state_detailed_dep.nav_flags = 0; - + test_msg.tracking_state_detailed_dep.pset_flags = 3; - + test_msg.tracking_state_detailed_dep.recv_time = 9406446591; - - + test_msg.tracking_state_detailed_dep.sid.code = 0; - + test_msg.tracking_state_detailed_dep.sid.reserved = 0; - + test_msg.tracking_state_detailed_dep.sid.sat = 15; - + test_msg.tracking_state_detailed_dep.sync_flags = 1; - - + test_msg.tracking_state_detailed_dep.tot.tow = 0; - + test_msg.tracking_state_detailed_dep.tot.wn = 0; - + test_msg.tracking_state_detailed_dep.tow_flags = 0; - + test_msg.tracking_state_detailed_dep.track_flags = 11; - + test_msg.tracking_state_detailed_dep.uptime = 2; - sbp_message_send(&sbp_state, SbpMsgTrackingStateDetailedDep, 26427, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingStateDetailedDep, 26427, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 26427, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDetailedDep, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.L.f == 125, "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.f, expected 125, is %d", last_msg.msg.tracking_state_detailed_dep.L.f); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.L.i == 2786, "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.i, expected 2786, is %d", last_msg.msg.tracking_state_detailed_dep.L.i); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.P == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.P, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.P); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.P_std == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.P_std, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.P_std); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.acceleration == -36, "incorrect value for last_msg.msg.tracking_state_detailed_dep.acceleration, expected -36, is %d", last_msg.msg.tracking_state_detailed_dep.acceleration); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_drift == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.clock_drift, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.clock_drift); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_offset == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.clock_offset, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.clock_offset); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.cn0 == 181, "incorrect value for last_msg.msg.tracking_state_detailed_dep.cn0, expected 181, is %d", last_msg.msg.tracking_state_detailed_dep.cn0); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.corr_spacing == 40, "incorrect value for last_msg.msg.tracking_state_detailed_dep.corr_spacing, expected 40, is %d", last_msg.msg.tracking_state_detailed_dep.corr_spacing); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.doppler == 15645, "incorrect value for last_msg.msg.tracking_state_detailed_dep.doppler, expected 15645, is %d", last_msg.msg.tracking_state_detailed_dep.doppler); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.doppler_std == 10, "incorrect value for last_msg.msg.tracking_state_detailed_dep.doppler_std, expected 10, is %d", last_msg.msg.tracking_state_detailed_dep.doppler_std); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.lock == 14032, "incorrect value for last_msg.msg.tracking_state_detailed_dep.lock, expected 14032, is %d", last_msg.msg.tracking_state_detailed_dep.lock); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.misc_flags == 9, "incorrect value for last_msg.msg.tracking_state_detailed_dep.misc_flags, expected 9, is %d", last_msg.msg.tracking_state_detailed_dep.misc_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.nav_flags == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.nav_flags, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.nav_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.pset_flags == 3, "incorrect value for last_msg.msg.tracking_state_detailed_dep.pset_flags, expected 3, is %d", last_msg.msg.tracking_state_detailed_dep.pset_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.recv_time == 9406446591, "incorrect value for last_msg.msg.tracking_state_detailed_dep.recv_time, expected 9406446591, is %d", last_msg.msg.tracking_state_detailed_dep.recv_time); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.code == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.code, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.reserved == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.reserved, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.sat == 15, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.sat, expected 15, is %d", last_msg.msg.tracking_state_detailed_dep.sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sync_flags == 1, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sync_flags, expected 1, is %d", last_msg.msg.tracking_state_detailed_dep.sync_flags); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.tot.tow == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.tow, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.tot.tow); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.tot.wn == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.wn, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.tot.wn); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.tow_flags == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.tow_flags, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.tow_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.track_flags == 11, "incorrect value for last_msg.msg.tracking_state_detailed_dep.track_flags, expected 11, is %d", last_msg.msg.tracking_state_detailed_dep.track_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.uptime == 2, "incorrect value for last_msg.msg.tracking_state_detailed_dep.uptime, expected 2, is %d", last_msg.msg.tracking_state_detailed_dep.uptime); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDetailedDep, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.L.f == 125, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.f, " + "expected 125, is %d", + last_msg.msg.tracking_state_detailed_dep.L.f); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.L.i == 2786, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.i, " + "expected 2786, is %d", + last_msg.msg.tracking_state_detailed_dep.L.i); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.P == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.P, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.P); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.P_std == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.P_std, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.P_std); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.acceleration == -36, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.acceleration, " + "expected -36, is %d", + last_msg.msg.tracking_state_detailed_dep.acceleration); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_drift == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.clock_drift, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.clock_drift); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_offset == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.clock_offset, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.clock_offset); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.cn0 == 181, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.cn0, " + "expected 181, is %d", + last_msg.msg.tracking_state_detailed_dep.cn0); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.corr_spacing == 40, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.corr_spacing, " + "expected 40, is %d", + last_msg.msg.tracking_state_detailed_dep.corr_spacing); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.doppler == 15645, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.doppler, " + "expected 15645, is %d", + last_msg.msg.tracking_state_detailed_dep.doppler); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.doppler_std == 10, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.doppler_std, " + "expected 10, is %d", + last_msg.msg.tracking_state_detailed_dep.doppler_std); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.lock == 14032, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.lock, " + "expected 14032, is %d", + last_msg.msg.tracking_state_detailed_dep.lock); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.misc_flags == 9, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.misc_flags, " + "expected 9, is %d", + last_msg.msg.tracking_state_detailed_dep.misc_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.nav_flags == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.nav_flags, expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.nav_flags); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.pset_flags == 3, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.pset_flags, " + "expected 3, is %d", + last_msg.msg.tracking_state_detailed_dep.pset_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.recv_time == 9406446591, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.recv_time, expected " + "9406446591, is %d", + last_msg.msg.tracking_state_detailed_dep.recv_time); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.sid.code == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.sid.code, expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.sid.code); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.reserved == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.sid.reserved, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.sid.reserved); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.sid.sat == 15, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.sat, " + "expected 15, is %d", + last_msg.msg.tracking_state_detailed_dep.sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sync_flags == 1, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.sync_flags, " + "expected 1, is %d", + last_msg.msg.tracking_state_detailed_dep.sync_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.tot.tow == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.tow, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.tot.tow); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.tot.wn == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.wn, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.tot.wn); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.tow_flags == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.tow_flags, expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.tow_flags); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.track_flags == 11, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.track_flags, " + "expected 11, is %d", + last_msg.msg.tracking_state_detailed_dep.track_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.uptime == 2, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.uptime, " + "expected 2, is %d", + last_msg.msg.tracking_state_detailed_dep.uptime); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -682,150 +1098,257 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) logging_reset(); - sbp_callback_register(&sbp_state, 0x11, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x11, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,17,0,59,103,55,189,95,120,78,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,12,0,0,64,184,208,54,15,0,0,0,24,61,0,0,4,0,3,0,0,0,0,0,0,0,40,0,2,1,0,11,0,3,9,194,206, }; + u8 encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 189, 95, 120, 78, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 203, 12, 0, 0, 64, 184, + 208, 54, 15, 0, 0, 0, 24, 61, 0, 0, 4, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 2, 1, 0, 11, 0, 3, 9, 194, 206, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.tracking_state_detailed_dep.L.f = 64; - + test_msg.tracking_state_detailed_dep.L.i = 3275; - + test_msg.tracking_state_detailed_dep.P = 0; - + test_msg.tracking_state_detailed_dep.P_std = 0; - + test_msg.tracking_state_detailed_dep.acceleration = 2; - + test_msg.tracking_state_detailed_dep.clock_drift = 0; - + test_msg.tracking_state_detailed_dep.clock_offset = 0; - + test_msg.tracking_state_detailed_dep.cn0 = 184; - + test_msg.tracking_state_detailed_dep.corr_spacing = 40; - + test_msg.tracking_state_detailed_dep.doppler = 15640; - + test_msg.tracking_state_detailed_dep.doppler_std = 4; - + test_msg.tracking_state_detailed_dep.lock = 14032; - + test_msg.tracking_state_detailed_dep.misc_flags = 9; - + test_msg.tracking_state_detailed_dep.nav_flags = 0; - + test_msg.tracking_state_detailed_dep.pset_flags = 3; - + test_msg.tracking_state_detailed_dep.recv_time = 9906446269; - - + test_msg.tracking_state_detailed_dep.sid.code = 0; - + test_msg.tracking_state_detailed_dep.sid.reserved = 0; - + test_msg.tracking_state_detailed_dep.sid.sat = 15; - + test_msg.tracking_state_detailed_dep.sync_flags = 1; - - + test_msg.tracking_state_detailed_dep.tot.tow = 0; - + test_msg.tracking_state_detailed_dep.tot.wn = 0; - + test_msg.tracking_state_detailed_dep.tow_flags = 0; - + test_msg.tracking_state_detailed_dep.track_flags = 11; - + test_msg.tracking_state_detailed_dep.uptime = 3; - sbp_message_send(&sbp_state, SbpMsgTrackingStateDetailedDep, 26427, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingStateDetailedDep, 26427, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 26427, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDetailedDep, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.L.f == 64, "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.f, expected 64, is %d", last_msg.msg.tracking_state_detailed_dep.L.f); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.L.i == 3275, "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.i, expected 3275, is %d", last_msg.msg.tracking_state_detailed_dep.L.i); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.P == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.P, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.P); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.P_std == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.P_std, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.P_std); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.acceleration == 2, "incorrect value for last_msg.msg.tracking_state_detailed_dep.acceleration, expected 2, is %d", last_msg.msg.tracking_state_detailed_dep.acceleration); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_drift == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.clock_drift, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.clock_drift); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_offset == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.clock_offset, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.clock_offset); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.cn0 == 184, "incorrect value for last_msg.msg.tracking_state_detailed_dep.cn0, expected 184, is %d", last_msg.msg.tracking_state_detailed_dep.cn0); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.corr_spacing == 40, "incorrect value for last_msg.msg.tracking_state_detailed_dep.corr_spacing, expected 40, is %d", last_msg.msg.tracking_state_detailed_dep.corr_spacing); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.doppler == 15640, "incorrect value for last_msg.msg.tracking_state_detailed_dep.doppler, expected 15640, is %d", last_msg.msg.tracking_state_detailed_dep.doppler); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.doppler_std == 4, "incorrect value for last_msg.msg.tracking_state_detailed_dep.doppler_std, expected 4, is %d", last_msg.msg.tracking_state_detailed_dep.doppler_std); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.lock == 14032, "incorrect value for last_msg.msg.tracking_state_detailed_dep.lock, expected 14032, is %d", last_msg.msg.tracking_state_detailed_dep.lock); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.misc_flags == 9, "incorrect value for last_msg.msg.tracking_state_detailed_dep.misc_flags, expected 9, is %d", last_msg.msg.tracking_state_detailed_dep.misc_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.nav_flags == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.nav_flags, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.nav_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.pset_flags == 3, "incorrect value for last_msg.msg.tracking_state_detailed_dep.pset_flags, expected 3, is %d", last_msg.msg.tracking_state_detailed_dep.pset_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.recv_time == 9906446269, "incorrect value for last_msg.msg.tracking_state_detailed_dep.recv_time, expected 9906446269, is %d", last_msg.msg.tracking_state_detailed_dep.recv_time); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.code == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.code, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.reserved == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.reserved, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.sid.reserved); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.sat == 15, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.sat, expected 15, is %d", last_msg.msg.tracking_state_detailed_dep.sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sync_flags == 1, "incorrect value for last_msg.msg.tracking_state_detailed_dep.sync_flags, expected 1, is %d", last_msg.msg.tracking_state_detailed_dep.sync_flags); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.tot.tow == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.tow, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.tot.tow); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.tot.wn == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.wn, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.tot.wn); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.tow_flags == 0, "incorrect value for last_msg.msg.tracking_state_detailed_dep.tow_flags, expected 0, is %d", last_msg.msg.tracking_state_detailed_dep.tow_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.track_flags == 11, "incorrect value for last_msg.msg.tracking_state_detailed_dep.track_flags, expected 11, is %d", last_msg.msg.tracking_state_detailed_dep.track_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.uptime == 3, "incorrect value for last_msg.msg.tracking_state_detailed_dep.uptime, expected 3, is %d", last_msg.msg.tracking_state_detailed_dep.uptime); - + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDetailedDep, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.L.f == 64, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.f, " + "expected 64, is %d", + last_msg.msg.tracking_state_detailed_dep.L.f); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.L.i == 3275, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.L.i, " + "expected 3275, is %d", + last_msg.msg.tracking_state_detailed_dep.L.i); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.P == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.P, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.P); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.P_std == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.P_std, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.P_std); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.acceleration == 2, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.acceleration, " + "expected 2, is %d", + last_msg.msg.tracking_state_detailed_dep.acceleration); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_drift == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.clock_drift, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.clock_drift); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.clock_offset == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.clock_offset, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.clock_offset); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.cn0 == 184, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.cn0, " + "expected 184, is %d", + last_msg.msg.tracking_state_detailed_dep.cn0); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.corr_spacing == 40, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.corr_spacing, " + "expected 40, is %d", + last_msg.msg.tracking_state_detailed_dep.corr_spacing); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.doppler == 15640, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.doppler, " + "expected 15640, is %d", + last_msg.msg.tracking_state_detailed_dep.doppler); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.doppler_std == 4, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.doppler_std, " + "expected 4, is %d", + last_msg.msg.tracking_state_detailed_dep.doppler_std); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.lock == 14032, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.lock, " + "expected 14032, is %d", + last_msg.msg.tracking_state_detailed_dep.lock); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.misc_flags == 9, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.misc_flags, " + "expected 9, is %d", + last_msg.msg.tracking_state_detailed_dep.misc_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.nav_flags == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.nav_flags, expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.nav_flags); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.pset_flags == 3, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.pset_flags, " + "expected 3, is %d", + last_msg.msg.tracking_state_detailed_dep.pset_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.recv_time == 9906446269, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.recv_time, expected " + "9906446269, is %d", + last_msg.msg.tracking_state_detailed_dep.recv_time); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.sid.code == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.sid.code, expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.sid.code); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sid.reserved == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.sid.reserved, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.sid.reserved); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.sid.sat == 15, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.sid.sat, " + "expected 15, is %d", + last_msg.msg.tracking_state_detailed_dep.sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.sync_flags == 1, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.sync_flags, " + "expected 1, is %d", + last_msg.msg.tracking_state_detailed_dep.sync_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.tot.tow == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.tow, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.tot.tow); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.tot.wn == 0, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.tot.wn, " + "expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.tot.wn); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.tow_flags == 0, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.tow_flags, expected 0, is %d", + last_msg.msg.tracking_state_detailed_dep.tow_flags); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep.track_flags == 11, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep.track_flags, " + "expected 11, is %d", + last_msg.msg.tracking_state_detailed_dep.track_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep.uptime == 3, + "incorrect value for last_msg.msg.tracking_state_detailed_dep.uptime, " + "expected 3, is %d", + last_msg.msg.tracking_state_detailed_dep.uptime); } } END_TEST -Suite* auto_check_sbp_tracking_MsgTrackingStateDetailedDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_tracking_MsgTrackingStateDetailedDep"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_tracking_MsgTrackingStateDetailedDep"); - tcase_add_test(tc_acq, test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep); +Suite *auto_check_sbp_tracking_MsgTrackingStateDetailedDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_tracking_MsgTrackingStateDetailedDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_tracking_MsgTrackingStateDetailedDep"); + tcase_add_test(tc_acq, + test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.c b/c/test/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.c index d3fd75f14..4b86bace7 100644 --- a/c/test/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.c +++ b/c/test/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDepA.yaml +// by generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA ) -{ +START_TEST(test_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,150 +90,267 @@ START_TEST( test_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x21, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x21, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,33,0,155,110,57,46,31,180,38,219,0,0,0,133,100,71,94,192,2,160,207,212,255,135,139,62,62,179,83,227,245,134,160,204,78,95,255,38,59,161,15,255,86,189,248,31,191,136,194,124,23,15,91,249,117,142,90,219,67,25,83,62,122,100, }; + u8 encoded_frame[] = { + 85, 33, 0, 155, 110, 57, 46, 31, 180, 38, 219, 0, 0, + 0, 133, 100, 71, 94, 192, 2, 160, 207, 212, 255, 135, 139, + 62, 62, 179, 83, 227, 245, 134, 160, 204, 78, 95, 255, 38, + 59, 161, 15, 255, 86, 189, 248, 31, 191, 136, 194, 124, 23, + 15, 91, 249, 117, 142, 90, 219, 67, 25, 83, 62, 122, 100, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.tracking_state_detailed_dep_a.L.f = 204; - + test_msg.tracking_state_detailed_dep_a.L.i = -1601767965; - + test_msg.tracking_state_detailed_dep_a.P = 1044286343; - + test_msg.tracking_state_detailed_dep_a.P_std = 21427; - + test_msg.tracking_state_detailed_dep_a.acceleration = -114; - + test_msg.tracking_state_detailed_dep_a.clock_drift = 23311; - + test_msg.tracking_state_detailed_dep_a.clock_offset = 6012; - + test_msg.tracking_state_detailed_dep_a.cn0 = 78; - + test_msg.tracking_state_detailed_dep_a.corr_spacing = 30201; - + test_msg.tracking_state_detailed_dep_a.doppler = 1459556257; - + test_msg.tracking_state_detailed_dep_a.doppler_std = 63677; - + test_msg.tracking_state_detailed_dep_a.lock = 65375; - + test_msg.tracking_state_detailed_dep_a.misc_flags = 62; - + test_msg.tracking_state_detailed_dep_a.nav_flags = 25; - + test_msg.tracking_state_detailed_dep_a.pset_flags = 83; - + test_msg.tracking_state_detailed_dep_a.recv_time = 941247176494; - - + test_msg.tracking_state_detailed_dep_a.sid.code = 59; - + test_msg.tracking_state_detailed_dep_a.sid.sat = 38; - + test_msg.tracking_state_detailed_dep_a.sync_flags = 90; - - + test_msg.tracking_state_detailed_dep_a.tot.ns_residual = -811597120; - + test_msg.tracking_state_detailed_dep_a.tot.tow = 1581737093; - + test_msg.tracking_state_detailed_dep_a.tot.wn = 65492; - + test_msg.tracking_state_detailed_dep_a.tow_flags = 219; - + test_msg.tracking_state_detailed_dep_a.track_flags = 67; - + test_msg.tracking_state_detailed_dep_a.uptime = 3263741727; - sbp_message_send(&sbp_state, SbpMsgTrackingStateDetailedDepA, 28315, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingStateDetailedDepA, 28315, + &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 28315, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDetailedDepA, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.L.f == 204, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.L.f, expected 204, is %d", last_msg.msg.tracking_state_detailed_dep_a.L.f); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.L.i == -1601767965, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.L.i, expected -1601767965, is %d", last_msg.msg.tracking_state_detailed_dep_a.L.i); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.P == 1044286343, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.P, expected 1044286343, is %d", last_msg.msg.tracking_state_detailed_dep_a.P); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.P_std == 21427, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.P_std, expected 21427, is %d", last_msg.msg.tracking_state_detailed_dep_a.P_std); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.acceleration == -114, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.acceleration, expected -114, is %d", last_msg.msg.tracking_state_detailed_dep_a.acceleration); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.clock_drift == 23311, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.clock_drift, expected 23311, is %d", last_msg.msg.tracking_state_detailed_dep_a.clock_drift); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.clock_offset == 6012, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.clock_offset, expected 6012, is %d", last_msg.msg.tracking_state_detailed_dep_a.clock_offset); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.cn0 == 78, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.cn0, expected 78, is %d", last_msg.msg.tracking_state_detailed_dep_a.cn0); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.corr_spacing == 30201, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.corr_spacing, expected 30201, is %d", last_msg.msg.tracking_state_detailed_dep_a.corr_spacing); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.doppler == 1459556257, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.doppler, expected 1459556257, is %d", last_msg.msg.tracking_state_detailed_dep_a.doppler); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.doppler_std == 63677, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.doppler_std, expected 63677, is %d", last_msg.msg.tracking_state_detailed_dep_a.doppler_std); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.lock == 65375, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.lock, expected 65375, is %d", last_msg.msg.tracking_state_detailed_dep_a.lock); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.misc_flags == 62, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.misc_flags, expected 62, is %d", last_msg.msg.tracking_state_detailed_dep_a.misc_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.nav_flags == 25, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.nav_flags, expected 25, is %d", last_msg.msg.tracking_state_detailed_dep_a.nav_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.pset_flags == 83, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.pset_flags, expected 83, is %d", last_msg.msg.tracking_state_detailed_dep_a.pset_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.recv_time == 941247176494, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.recv_time, expected 941247176494, is %d", last_msg.msg.tracking_state_detailed_dep_a.recv_time); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.sid.code == 59, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.sid.code, expected 59, is %d", last_msg.msg.tracking_state_detailed_dep_a.sid.code); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.sid.sat == 38, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.sid.sat, expected 38, is %d", last_msg.msg.tracking_state_detailed_dep_a.sid.sat); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.sync_flags == 90, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.sync_flags, expected 90, is %d", last_msg.msg.tracking_state_detailed_dep_a.sync_flags); - - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.tot.ns_residual == -811597120, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.tot.ns_residual, expected -811597120, is %d", last_msg.msg.tracking_state_detailed_dep_a.tot.ns_residual); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.tot.tow == 1581737093, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.tot.tow, expected 1581737093, is %d", last_msg.msg.tracking_state_detailed_dep_a.tot.tow); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.tot.wn == 65492, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.tot.wn, expected 65492, is %d", last_msg.msg.tracking_state_detailed_dep_a.tot.wn); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.tow_flags == 219, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.tow_flags, expected 219, is %d", last_msg.msg.tracking_state_detailed_dep_a.tow_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.track_flags == 67, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.track_flags, expected 67, is %d", last_msg.msg.tracking_state_detailed_dep_a.track_flags); - - ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.uptime == 3263741727, "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.uptime, expected 3263741727, is %d", last_msg.msg.tracking_state_detailed_dep_a.uptime); + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDetailedDepA, + &last_msg.msg, &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep_a.L.f == 204, + "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.L.f, " + "expected 204, is %d", + last_msg.msg.tracking_state_detailed_dep_a.L.f); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep_a.L.i == -1601767965, + "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.L.i, " + "expected -1601767965, is %d", + last_msg.msg.tracking_state_detailed_dep_a.L.i); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep_a.P == 1044286343, + "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.P, " + "expected 1044286343, is %d", + last_msg.msg.tracking_state_detailed_dep_a.P); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep_a.P_std == 21427, + "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.P_std, " + "expected 21427, is %d", + last_msg.msg.tracking_state_detailed_dep_a.P_std); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep_a.acceleration == -114, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.acceleration, expected " + "-114, is %d", + last_msg.msg.tracking_state_detailed_dep_a.acceleration); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep_a.clock_drift == 23311, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.clock_drift, expected " + "23311, is %d", + last_msg.msg.tracking_state_detailed_dep_a.clock_drift); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep_a.clock_offset == 6012, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.clock_offset, expected " + "6012, is %d", + last_msg.msg.tracking_state_detailed_dep_a.clock_offset); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep_a.cn0 == 78, + "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.cn0, " + "expected 78, is %d", + last_msg.msg.tracking_state_detailed_dep_a.cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep_a.corr_spacing == 30201, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.corr_spacing, expected " + "30201, is %d", + last_msg.msg.tracking_state_detailed_dep_a.corr_spacing); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep_a.doppler == 1459556257, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.doppler, expected " + "1459556257, is %d", + last_msg.msg.tracking_state_detailed_dep_a.doppler); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep_a.doppler_std == 63677, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.doppler_std, expected " + "63677, is %d", + last_msg.msg.tracking_state_detailed_dep_a.doppler_std); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep_a.lock == 65375, + "incorrect value for last_msg.msg.tracking_state_detailed_dep_a.lock, " + "expected 65375, is %d", + last_msg.msg.tracking_state_detailed_dep_a.lock); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.misc_flags == 62, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.misc_flags, " + "expected 62, is %d", + last_msg.msg.tracking_state_detailed_dep_a.misc_flags); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.nav_flags == 25, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.nav_flags, " + "expected 25, is %d", + last_msg.msg.tracking_state_detailed_dep_a.nav_flags); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.pset_flags == 83, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.pset_flags, " + "expected 83, is %d", + last_msg.msg.tracking_state_detailed_dep_a.pset_flags); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep_a.recv_time == 941247176494, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.recv_time, expected " + "941247176494, is %d", + last_msg.msg.tracking_state_detailed_dep_a.recv_time); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.sid.code == 59, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.sid.code, " + "expected 59, is %d", + last_msg.msg.tracking_state_detailed_dep_a.sid.code); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.sid.sat == 38, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.sid.sat, " + "expected 38, is %d", + last_msg.msg.tracking_state_detailed_dep_a.sid.sat); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.sync_flags == 90, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.sync_flags, " + "expected 90, is %d", + last_msg.msg.tracking_state_detailed_dep_a.sync_flags); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.tot.ns_residual == + -811597120, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.tot.ns_residual, " + "expected -811597120, is %d", + last_msg.msg.tracking_state_detailed_dep_a.tot.ns_residual); + + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep_a.tot.tow == 1581737093, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.tot.tow, expected " + "1581737093, is %d", + last_msg.msg.tracking_state_detailed_dep_a.tot.tow); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.tot.wn == 65492, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.tot.wn, expected " + "65492, is %d", + last_msg.msg.tracking_state_detailed_dep_a.tot.wn); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.tow_flags == 219, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.tow_flags, " + "expected 219, is %d", + last_msg.msg.tracking_state_detailed_dep_a.tow_flags); + + ck_assert_msg(last_msg.msg.tracking_state_detailed_dep_a.track_flags == 67, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.track_flags, " + "expected 67, is %d", + last_msg.msg.tracking_state_detailed_dep_a.track_flags); + ck_assert_msg( + last_msg.msg.tracking_state_detailed_dep_a.uptime == 3263741727, + "incorrect value for " + "last_msg.msg.tracking_state_detailed_dep_a.uptime, expected " + "3263741727, is %d", + last_msg.msg.tracking_state_detailed_dep_a.uptime); } } END_TEST -Suite* auto_check_sbp_tracking_MsgTrackingStateDetailedDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_tracking_MsgTrackingStateDetailedDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA"); - tcase_add_test(tc_acq, test_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA); +Suite *auto_check_sbp_tracking_MsgTrackingStateDetailedDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_tracking_MsgTrackingStateDetailedDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA"); + tcase_add_test(tc_acq, + test_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/auto_check_sbp_tracking_MsgtrackingStateDepA.c b/c/test/auto_check_sbp_tracking_MsgtrackingStateDepA.c index cd61b0c58..f33b0dae3 100644 --- a/c/test/auto_check_sbp_tracking_MsgtrackingStateDepA.c +++ b/c/test/auto_check_sbp_tracking_MsgtrackingStateDepA.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgtrackingStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgtrackingStateDepA.yaml by +// generate.py. Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_tracking_MsgtrackingStateDepA ) -{ +START_TEST(test_auto_check_sbp_tracking_MsgtrackingStateDepA) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_tracking_MsgtrackingStateDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,189 +90,335 @@ START_TEST( test_auto_check_sbp_tracking_MsgtrackingStateDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x16, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x16, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,22,0,195,4,66,1,0,204,177,51,65,1,2,198,4,39,65,1,3,219,182,27,65,1,7,132,120,101,65,1,10,91,91,251,64,1,13,42,37,163,64,1,22,130,184,215,64,1,30,115,53,75,65,1,31,16,74,126,65,1,25,132,196,135,64,1,6,100,59,223,64,17,225, }; + u8 encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 204, 177, 51, 65, 1, + 2, 198, 4, 39, 65, 1, 3, 219, 182, 27, 65, 1, 7, + 132, 120, 101, 65, 1, 10, 91, 91, 251, 64, 1, 13, 42, + 37, 163, 64, 1, 22, 130, 184, 215, 64, 1, 30, 115, 53, + 75, 65, 1, 31, 16, 74, 126, 65, 1, 25, 132, 196, 135, + 64, 1, 6, 100, 59, 223, 64, 17, 225, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.tracking_state_dep_a.n_states = 11; - - - + test_msg.tracking_state_dep_a.states[0].cn0 = 11.230907440185547; - + test_msg.tracking_state_dep_a.states[0].prn = 0; - + test_msg.tracking_state_dep_a.states[0].state = 1; - - + test_msg.tracking_state_dep_a.states[1].cn0 = 10.438665390014648; - + test_msg.tracking_state_dep_a.states[1].prn = 2; - + test_msg.tracking_state_dep_a.states[1].state = 1; - - + test_msg.tracking_state_dep_a.states[2].cn0 = 9.732142448425293; - + test_msg.tracking_state_dep_a.states[2].prn = 3; - + test_msg.tracking_state_dep_a.states[2].state = 1; - - + test_msg.tracking_state_dep_a.states[3].cn0 = 14.341922760009766; - + test_msg.tracking_state_dep_a.states[3].prn = 7; - + test_msg.tracking_state_dep_a.states[3].state = 1; - - + test_msg.tracking_state_dep_a.states[4].cn0 = 7.8549017906188965; - + test_msg.tracking_state_dep_a.states[4].prn = 10; - + test_msg.tracking_state_dep_a.states[4].state = 1; - - + test_msg.tracking_state_dep_a.states[5].cn0 = 5.0982866287231445; - + test_msg.tracking_state_dep_a.states[5].prn = 13; - + test_msg.tracking_state_dep_a.states[5].state = 1; - - + test_msg.tracking_state_dep_a.states[6].cn0 = 6.741272926330566; - + test_msg.tracking_state_dep_a.states[6].prn = 22; - + test_msg.tracking_state_dep_a.states[6].state = 1; - - + test_msg.tracking_state_dep_a.states[7].cn0 = 12.700549125671387; - + test_msg.tracking_state_dep_a.states[7].prn = 30; - + test_msg.tracking_state_dep_a.states[7].state = 1; - - + test_msg.tracking_state_dep_a.states[8].cn0 = 15.893081665039062; - + test_msg.tracking_state_dep_a.states[8].prn = 31; - + test_msg.tracking_state_dep_a.states[8].state = 1; - - + test_msg.tracking_state_dep_a.states[9].cn0 = 4.242738723754883; - + test_msg.tracking_state_dep_a.states[9].prn = 25; - + test_msg.tracking_state_dep_a.states[9].state = 1; - - + test_msg.tracking_state_dep_a.states[10].cn0 = 6.97599983215332; - + test_msg.tracking_state_dep_a.states[10].prn = 6; - + test_msg.tracking_state_dep_a.states[10].state = 1; - sbp_message_send(&sbp_state, SbpMsgTrackingStateDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingStateDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgTrackingStateDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.n_states == 11, "incorrect value for last_msg.msg.tracking_state_dep_a.n_states, expected 11, is %d", last_msg.msg.tracking_state_dep_a.n_states); - - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[0].cn0 * 100 - 11.2309074402 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].cn0, expected 11.2309074402, is %s", last_msg.msg.tracking_state_dep_a.states[0].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[0].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[0].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[0].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[0].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[1].cn0 * 100 - 10.43866539 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].cn0, expected 10.43866539, is %s", last_msg.msg.tracking_state_dep_a.states[1].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[1].prn == 2, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].prn, expected 2, is %d", last_msg.msg.tracking_state_dep_a.states[1].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[1].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[1].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[2].cn0 * 100 - 9.73214244843 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].cn0, expected 9.73214244843, is %s", last_msg.msg.tracking_state_dep_a.states[2].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[2].prn == 3, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].prn, expected 3, is %d", last_msg.msg.tracking_state_dep_a.states[2].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[2].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[2].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[3].cn0 * 100 - 14.34192276 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].cn0, expected 14.34192276, is %s", last_msg.msg.tracking_state_dep_a.states[3].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[3].prn == 7, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].prn, expected 7, is %d", last_msg.msg.tracking_state_dep_a.states[3].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[3].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[3].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[4].cn0 * 100 - 7.85490179062 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].cn0, expected 7.85490179062, is %s", last_msg.msg.tracking_state_dep_a.states[4].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[4].prn == 10, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].prn, expected 10, is %d", last_msg.msg.tracking_state_dep_a.states[4].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[4].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[4].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[5].cn0 * 100 - 5.09828662872 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].cn0, expected 5.09828662872, is %s", last_msg.msg.tracking_state_dep_a.states[5].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[5].prn == 13, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].prn, expected 13, is %d", last_msg.msg.tracking_state_dep_a.states[5].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[5].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[5].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[6].cn0 * 100 - 6.74127292633 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].cn0, expected 6.74127292633, is %s", last_msg.msg.tracking_state_dep_a.states[6].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[6].prn == 22, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].prn, expected 22, is %d", last_msg.msg.tracking_state_dep_a.states[6].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[6].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[6].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[7].cn0 * 100 - 12.7005491257 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].cn0, expected 12.7005491257, is %s", last_msg.msg.tracking_state_dep_a.states[7].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[7].prn == 30, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].prn, expected 30, is %d", last_msg.msg.tracking_state_dep_a.states[7].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[7].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[7].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[8].cn0 * 100 - 15.893081665 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].cn0, expected 15.893081665, is %s", last_msg.msg.tracking_state_dep_a.states[8].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[8].prn == 31, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].prn, expected 31, is %d", last_msg.msg.tracking_state_dep_a.states[8].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[8].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[8].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[9].cn0 * 100 - 4.24273872375 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].cn0, expected 4.24273872375, is %s", last_msg.msg.tracking_state_dep_a.states[9].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[9].prn == 25, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].prn, expected 25, is %d", last_msg.msg.tracking_state_dep_a.states[9].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[9].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[9].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[10].cn0 * 100 - 6.97599983215 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].cn0, expected 6.97599983215, is %s", last_msg.msg.tracking_state_dep_a.states[10].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[10].prn == 6, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].prn, expected 6, is %d", last_msg.msg.tracking_state_dep_a.states[10].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[10].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[10].state); + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.n_states == 11, + "incorrect value for last_msg.msg.tracking_state_dep_a.n_states, " + "expected 11, is %d", + last_msg.msg.tracking_state_dep_a.n_states); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[0].cn0 * 100 - + 11.2309074402 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].cn0, " + "expected 11.2309074402, is %s", + last_msg.msg.tracking_state_dep_a.states[0].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[0].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[0].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[0].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[0].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[0].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[1].cn0 * 100 - + 10.43866539 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].cn0, " + "expected 10.43866539, is %s", + last_msg.msg.tracking_state_dep_a.states[1].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[1].prn == 2, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].prn, " + "expected 2, is %d", + last_msg.msg.tracking_state_dep_a.states[1].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[1].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[1].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[1].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[2].cn0 * 100 - + 9.73214244843 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].cn0, " + "expected 9.73214244843, is %s", + last_msg.msg.tracking_state_dep_a.states[2].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[2].prn == 3, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].prn, " + "expected 3, is %d", + last_msg.msg.tracking_state_dep_a.states[2].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[2].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[2].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[2].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[3].cn0 * 100 - + 14.34192276 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].cn0, " + "expected 14.34192276, is %s", + last_msg.msg.tracking_state_dep_a.states[3].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[3].prn == 7, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].prn, " + "expected 7, is %d", + last_msg.msg.tracking_state_dep_a.states[3].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[3].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[3].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[3].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[4].cn0 * 100 - + 7.85490179062 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].cn0, " + "expected 7.85490179062, is %s", + last_msg.msg.tracking_state_dep_a.states[4].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[4].prn == 10, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].prn, " + "expected 10, is %d", + last_msg.msg.tracking_state_dep_a.states[4].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[4].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[4].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[4].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[5].cn0 * 100 - + 5.09828662872 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].cn0, " + "expected 5.09828662872, is %s", + last_msg.msg.tracking_state_dep_a.states[5].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[5].prn == 13, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].prn, " + "expected 13, is %d", + last_msg.msg.tracking_state_dep_a.states[5].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[5].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[5].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[5].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[6].cn0 * 100 - + 6.74127292633 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].cn0, " + "expected 6.74127292633, is %s", + last_msg.msg.tracking_state_dep_a.states[6].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[6].prn == 22, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].prn, " + "expected 22, is %d", + last_msg.msg.tracking_state_dep_a.states[6].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[6].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[6].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[6].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[7].cn0 * 100 - + 12.7005491257 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].cn0, " + "expected 12.7005491257, is %s", + last_msg.msg.tracking_state_dep_a.states[7].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[7].prn == 30, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].prn, " + "expected 30, is %d", + last_msg.msg.tracking_state_dep_a.states[7].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[7].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[7].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[7].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[8].cn0 * 100 - + 15.893081665 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].cn0, " + "expected 15.893081665, is %s", + last_msg.msg.tracking_state_dep_a.states[8].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[8].prn == 31, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].prn, " + "expected 31, is %d", + last_msg.msg.tracking_state_dep_a.states[8].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[8].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[8].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[8].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[9].cn0 * 100 - + 4.24273872375 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].cn0, " + "expected 4.24273872375, is %s", + last_msg.msg.tracking_state_dep_a.states[9].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[9].prn == 25, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].prn, " + "expected 25, is %d", + last_msg.msg.tracking_state_dep_a.states[9].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[9].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[9].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[9].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[10].cn0 * 100 - + 6.97599983215 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].cn0, " + "expected 6.97599983215, is %s", + last_msg.msg.tracking_state_dep_a.states[10].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[10].prn == 6, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].prn, " + "expected 6, is %d", + last_msg.msg.tracking_state_dep_a.states[10].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[10].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[10].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[10].state); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -284,189 +426,334 @@ START_TEST( test_auto_check_sbp_tracking_MsgtrackingStateDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x16, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x16, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,22,0,195,4,66,1,0,216,57,48,65,1,2,145,41,46,65,1,3,4,26,34,65,1,7,177,67,109,65,1,10,61,80,249,64,1,13,250,199,155,64,1,22,55,19,215,64,1,30,138,138,79,65,1,31,214,179,119,65,1,25,53,138,120,64,1,6,183,247,129,64,168,173, }; + u8 encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 216, 57, 48, 65, 1, 2, 145, + 41, 46, 65, 1, 3, 4, 26, 34, 65, 1, 7, 177, 67, 109, 65, + 1, 10, 61, 80, 249, 64, 1, 13, 250, 199, 155, 64, 1, 22, 55, + 19, 215, 64, 1, 30, 138, 138, 79, 65, 1, 31, 214, 179, 119, 65, + 1, 25, 53, 138, 120, 64, 1, 6, 183, 247, 129, 64, 168, 173, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.tracking_state_dep_a.n_states = 11; - - - + test_msg.tracking_state_dep_a.states[0].cn0 = 11.014122009277344; - + test_msg.tracking_state_dep_a.states[0].prn = 0; - + test_msg.tracking_state_dep_a.states[0].state = 1; - - + test_msg.tracking_state_dep_a.states[1].cn0 = 10.885148048400879; - + test_msg.tracking_state_dep_a.states[1].prn = 2; - + test_msg.tracking_state_dep_a.states[1].state = 1; - - + test_msg.tracking_state_dep_a.states[2].cn0 = 10.131351470947266; - + test_msg.tracking_state_dep_a.states[2].prn = 3; - + test_msg.tracking_state_dep_a.states[2].state = 1; - - + test_msg.tracking_state_dep_a.states[3].cn0 = 14.829026222229004; - + test_msg.tracking_state_dep_a.states[3].prn = 7; - + test_msg.tracking_state_dep_a.states[3].state = 1; - - + test_msg.tracking_state_dep_a.states[4].cn0 = 7.79104471206665; - + test_msg.tracking_state_dep_a.states[4].prn = 10; - + test_msg.tracking_state_dep_a.states[4].state = 1; - - + test_msg.tracking_state_dep_a.states[5].cn0 = 4.868161201477051; - + test_msg.tracking_state_dep_a.states[5].prn = 13; - + test_msg.tracking_state_dep_a.states[5].state = 1; - - + test_msg.tracking_state_dep_a.states[6].cn0 = 6.721095561981201; - + test_msg.tracking_state_dep_a.states[6].prn = 22; - + test_msg.tracking_state_dep_a.states[6].state = 1; - - + test_msg.tracking_state_dep_a.states[7].cn0 = 12.971323013305664; - + test_msg.tracking_state_dep_a.states[7].prn = 30; - + test_msg.tracking_state_dep_a.states[7].state = 1; - - + test_msg.tracking_state_dep_a.states[8].cn0 = 15.481405258178711; - + test_msg.tracking_state_dep_a.states[8].prn = 31; - + test_msg.tracking_state_dep_a.states[8].state = 1; - - + test_msg.tracking_state_dep_a.states[9].cn0 = 3.8834354877471924; - + test_msg.tracking_state_dep_a.states[9].prn = 25; - + test_msg.tracking_state_dep_a.states[9].state = 1; - - + test_msg.tracking_state_dep_a.states[10].cn0 = 4.061488628387451; - + test_msg.tracking_state_dep_a.states[10].prn = 6; - + test_msg.tracking_state_dep_a.states[10].state = 1; - sbp_message_send(&sbp_state, SbpMsgTrackingStateDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingStateDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgTrackingStateDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.n_states == 11, "incorrect value for last_msg.msg.tracking_state_dep_a.n_states, expected 11, is %d", last_msg.msg.tracking_state_dep_a.n_states); - - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[0].cn0 * 100 - 11.0141220093 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].cn0, expected 11.0141220093, is %s", last_msg.msg.tracking_state_dep_a.states[0].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[0].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[0].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[0].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[0].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[1].cn0 * 100 - 10.8851480484 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].cn0, expected 10.8851480484, is %s", last_msg.msg.tracking_state_dep_a.states[1].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[1].prn == 2, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].prn, expected 2, is %d", last_msg.msg.tracking_state_dep_a.states[1].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[1].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[1].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[2].cn0 * 100 - 10.1313514709 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].cn0, expected 10.1313514709, is %s", last_msg.msg.tracking_state_dep_a.states[2].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[2].prn == 3, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].prn, expected 3, is %d", last_msg.msg.tracking_state_dep_a.states[2].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[2].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[2].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[3].cn0 * 100 - 14.8290262222 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].cn0, expected 14.8290262222, is %s", last_msg.msg.tracking_state_dep_a.states[3].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[3].prn == 7, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].prn, expected 7, is %d", last_msg.msg.tracking_state_dep_a.states[3].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[3].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[3].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[4].cn0 * 100 - 7.79104471207 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].cn0, expected 7.79104471207, is %s", last_msg.msg.tracking_state_dep_a.states[4].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[4].prn == 10, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].prn, expected 10, is %d", last_msg.msg.tracking_state_dep_a.states[4].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[4].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[4].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[5].cn0 * 100 - 4.86816120148 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].cn0, expected 4.86816120148, is %s", last_msg.msg.tracking_state_dep_a.states[5].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[5].prn == 13, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].prn, expected 13, is %d", last_msg.msg.tracking_state_dep_a.states[5].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[5].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[5].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[6].cn0 * 100 - 6.72109556198 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].cn0, expected 6.72109556198, is %s", last_msg.msg.tracking_state_dep_a.states[6].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[6].prn == 22, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].prn, expected 22, is %d", last_msg.msg.tracking_state_dep_a.states[6].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[6].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[6].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[7].cn0 * 100 - 12.9713230133 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].cn0, expected 12.9713230133, is %s", last_msg.msg.tracking_state_dep_a.states[7].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[7].prn == 30, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].prn, expected 30, is %d", last_msg.msg.tracking_state_dep_a.states[7].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[7].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[7].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[8].cn0 * 100 - 15.4814052582 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].cn0, expected 15.4814052582, is %s", last_msg.msg.tracking_state_dep_a.states[8].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[8].prn == 31, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].prn, expected 31, is %d", last_msg.msg.tracking_state_dep_a.states[8].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[8].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[8].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[9].cn0 * 100 - 3.88343548775 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].cn0, expected 3.88343548775, is %s", last_msg.msg.tracking_state_dep_a.states[9].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[9].prn == 25, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].prn, expected 25, is %d", last_msg.msg.tracking_state_dep_a.states[9].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[9].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[9].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[10].cn0 * 100 - 4.06148862839 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].cn0, expected 4.06148862839, is %s", last_msg.msg.tracking_state_dep_a.states[10].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[10].prn == 6, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].prn, expected 6, is %d", last_msg.msg.tracking_state_dep_a.states[10].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[10].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[10].state); + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.n_states == 11, + "incorrect value for last_msg.msg.tracking_state_dep_a.n_states, " + "expected 11, is %d", + last_msg.msg.tracking_state_dep_a.n_states); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[0].cn0 * 100 - + 11.0141220093 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].cn0, " + "expected 11.0141220093, is %s", + last_msg.msg.tracking_state_dep_a.states[0].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[0].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[0].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[0].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[0].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[0].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[1].cn0 * 100 - + 10.8851480484 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].cn0, " + "expected 10.8851480484, is %s", + last_msg.msg.tracking_state_dep_a.states[1].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[1].prn == 2, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].prn, " + "expected 2, is %d", + last_msg.msg.tracking_state_dep_a.states[1].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[1].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[1].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[1].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[2].cn0 * 100 - + 10.1313514709 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].cn0, " + "expected 10.1313514709, is %s", + last_msg.msg.tracking_state_dep_a.states[2].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[2].prn == 3, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].prn, " + "expected 3, is %d", + last_msg.msg.tracking_state_dep_a.states[2].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[2].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[2].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[2].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[3].cn0 * 100 - + 14.8290262222 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].cn0, " + "expected 14.8290262222, is %s", + last_msg.msg.tracking_state_dep_a.states[3].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[3].prn == 7, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].prn, " + "expected 7, is %d", + last_msg.msg.tracking_state_dep_a.states[3].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[3].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[3].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[3].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[4].cn0 * 100 - + 7.79104471207 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].cn0, " + "expected 7.79104471207, is %s", + last_msg.msg.tracking_state_dep_a.states[4].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[4].prn == 10, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].prn, " + "expected 10, is %d", + last_msg.msg.tracking_state_dep_a.states[4].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[4].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[4].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[4].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[5].cn0 * 100 - + 4.86816120148 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].cn0, " + "expected 4.86816120148, is %s", + last_msg.msg.tracking_state_dep_a.states[5].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[5].prn == 13, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].prn, " + "expected 13, is %d", + last_msg.msg.tracking_state_dep_a.states[5].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[5].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[5].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[5].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[6].cn0 * 100 - + 6.72109556198 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].cn0, " + "expected 6.72109556198, is %s", + last_msg.msg.tracking_state_dep_a.states[6].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[6].prn == 22, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].prn, " + "expected 22, is %d", + last_msg.msg.tracking_state_dep_a.states[6].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[6].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[6].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[6].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[7].cn0 * 100 - + 12.9713230133 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].cn0, " + "expected 12.9713230133, is %s", + last_msg.msg.tracking_state_dep_a.states[7].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[7].prn == 30, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].prn, " + "expected 30, is %d", + last_msg.msg.tracking_state_dep_a.states[7].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[7].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[7].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[7].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[8].cn0 * 100 - + 15.4814052582 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].cn0, " + "expected 15.4814052582, is %s", + last_msg.msg.tracking_state_dep_a.states[8].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[8].prn == 31, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].prn, " + "expected 31, is %d", + last_msg.msg.tracking_state_dep_a.states[8].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[8].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[8].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[8].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[9].cn0 * 100 - + 3.88343548775 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].cn0, " + "expected 3.88343548775, is %s", + last_msg.msg.tracking_state_dep_a.states[9].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[9].prn == 25, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].prn, " + "expected 25, is %d", + last_msg.msg.tracking_state_dep_a.states[9].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[9].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[9].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[9].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[10].cn0 * 100 - + 4.06148862839 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].cn0, " + "expected 4.06148862839, is %s", + last_msg.msg.tracking_state_dep_a.states[10].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[10].prn == 6, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].prn, " + "expected 6, is %d", + last_msg.msg.tracking_state_dep_a.states[10].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[10].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[10].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[10].state); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -474,189 +761,334 @@ START_TEST( test_auto_check_sbp_tracking_MsgtrackingStateDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x16, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x16, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,22,0,195,4,66,1,0,141,76,60,65,1,2,69,139,46,65,1,3,146,27,30,65,1,7,235,56,97,65,1,10,141,213,243,64,1,13,250,170,166,64,1,22,17,101,201,64,1,30,172,183,83,65,1,31,238,193,120,65,1,25,220,48,132,64,1,6,49,214,54,64,110,179, }; + u8 encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 141, 76, 60, 65, 1, 2, 69, + 139, 46, 65, 1, 3, 146, 27, 30, 65, 1, 7, 235, 56, 97, 65, + 1, 10, 141, 213, 243, 64, 1, 13, 250, 170, 166, 64, 1, 22, 17, + 101, 201, 64, 1, 30, 172, 183, 83, 65, 1, 31, 238, 193, 120, 65, + 1, 25, 220, 48, 132, 64, 1, 6, 49, 214, 54, 64, 110, 179, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.tracking_state_dep_a.n_states = 11; - - - + test_msg.tracking_state_dep_a.states[0].cn0 = 11.768689155578613; - + test_msg.tracking_state_dep_a.states[0].prn = 0; - + test_msg.tracking_state_dep_a.states[0].state = 1; - - + test_msg.tracking_state_dep_a.states[1].cn0 = 10.909001350402832; - + test_msg.tracking_state_dep_a.states[1].prn = 2; - + test_msg.tracking_state_dep_a.states[1].state = 1; - - + test_msg.tracking_state_dep_a.states[2].cn0 = 9.881731033325195; - + test_msg.tracking_state_dep_a.states[2].prn = 3; - + test_msg.tracking_state_dep_a.states[2].state = 1; - - + test_msg.tracking_state_dep_a.states[3].cn0 = 14.076395988464355; - + test_msg.tracking_state_dep_a.states[3].prn = 7; - + test_msg.tracking_state_dep_a.states[3].state = 1; - - + test_msg.tracking_state_dep_a.states[4].cn0 = 7.619818210601807; - + test_msg.tracking_state_dep_a.states[4].prn = 10; - + test_msg.tracking_state_dep_a.states[4].state = 1; - - + test_msg.tracking_state_dep_a.states[5].cn0 = 5.208371162414551; - + test_msg.tracking_state_dep_a.states[5].prn = 13; - + test_msg.tracking_state_dep_a.states[5].state = 1; - - + test_msg.tracking_state_dep_a.states[6].cn0 = 6.2935872077941895; - + test_msg.tracking_state_dep_a.states[6].prn = 22; - + test_msg.tracking_state_dep_a.states[6].state = 1; - - + test_msg.tracking_state_dep_a.states[7].cn0 = 13.232341766357422; - + test_msg.tracking_state_dep_a.states[7].prn = 30; - + test_msg.tracking_state_dep_a.states[7].state = 1; - - + test_msg.tracking_state_dep_a.states[8].cn0 = 15.547346115112305; - + test_msg.tracking_state_dep_a.states[8].prn = 31; - + test_msg.tracking_state_dep_a.states[8].state = 1; - - + test_msg.tracking_state_dep_a.states[9].cn0 = 4.130964279174805; - + test_msg.tracking_state_dep_a.states[9].prn = 25; - + test_msg.tracking_state_dep_a.states[9].state = 1; - - + test_msg.tracking_state_dep_a.states[10].cn0 = 2.856823205947876; - + test_msg.tracking_state_dep_a.states[10].prn = 6; - + test_msg.tracking_state_dep_a.states[10].state = 1; - sbp_message_send(&sbp_state, SbpMsgTrackingStateDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingStateDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgTrackingStateDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.n_states == 11, "incorrect value for last_msg.msg.tracking_state_dep_a.n_states, expected 11, is %d", last_msg.msg.tracking_state_dep_a.n_states); - - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[0].cn0 * 100 - 11.7686891556 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].cn0, expected 11.7686891556, is %s", last_msg.msg.tracking_state_dep_a.states[0].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[0].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[0].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[0].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[0].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[1].cn0 * 100 - 10.9090013504 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].cn0, expected 10.9090013504, is %s", last_msg.msg.tracking_state_dep_a.states[1].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[1].prn == 2, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].prn, expected 2, is %d", last_msg.msg.tracking_state_dep_a.states[1].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[1].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[1].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[2].cn0 * 100 - 9.88173103333 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].cn0, expected 9.88173103333, is %s", last_msg.msg.tracking_state_dep_a.states[2].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[2].prn == 3, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].prn, expected 3, is %d", last_msg.msg.tracking_state_dep_a.states[2].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[2].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[2].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[3].cn0 * 100 - 14.0763959885 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].cn0, expected 14.0763959885, is %s", last_msg.msg.tracking_state_dep_a.states[3].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[3].prn == 7, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].prn, expected 7, is %d", last_msg.msg.tracking_state_dep_a.states[3].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[3].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[3].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[4].cn0 * 100 - 7.6198182106 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].cn0, expected 7.6198182106, is %s", last_msg.msg.tracking_state_dep_a.states[4].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[4].prn == 10, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].prn, expected 10, is %d", last_msg.msg.tracking_state_dep_a.states[4].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[4].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[4].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[5].cn0 * 100 - 5.20837116241 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].cn0, expected 5.20837116241, is %s", last_msg.msg.tracking_state_dep_a.states[5].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[5].prn == 13, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].prn, expected 13, is %d", last_msg.msg.tracking_state_dep_a.states[5].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[5].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[5].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[6].cn0 * 100 - 6.29358720779 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].cn0, expected 6.29358720779, is %s", last_msg.msg.tracking_state_dep_a.states[6].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[6].prn == 22, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].prn, expected 22, is %d", last_msg.msg.tracking_state_dep_a.states[6].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[6].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[6].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[7].cn0 * 100 - 13.2323417664 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].cn0, expected 13.2323417664, is %s", last_msg.msg.tracking_state_dep_a.states[7].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[7].prn == 30, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].prn, expected 30, is %d", last_msg.msg.tracking_state_dep_a.states[7].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[7].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[7].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[8].cn0 * 100 - 15.5473461151 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].cn0, expected 15.5473461151, is %s", last_msg.msg.tracking_state_dep_a.states[8].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[8].prn == 31, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].prn, expected 31, is %d", last_msg.msg.tracking_state_dep_a.states[8].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[8].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[8].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[9].cn0 * 100 - 4.13096427917 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].cn0, expected 4.13096427917, is %s", last_msg.msg.tracking_state_dep_a.states[9].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[9].prn == 25, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].prn, expected 25, is %d", last_msg.msg.tracking_state_dep_a.states[9].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[9].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[9].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[10].cn0 * 100 - 2.85682320595 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].cn0, expected 2.85682320595, is %s", last_msg.msg.tracking_state_dep_a.states[10].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[10].prn == 6, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].prn, expected 6, is %d", last_msg.msg.tracking_state_dep_a.states[10].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[10].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[10].state); + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.n_states == 11, + "incorrect value for last_msg.msg.tracking_state_dep_a.n_states, " + "expected 11, is %d", + last_msg.msg.tracking_state_dep_a.n_states); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[0].cn0 * 100 - + 11.7686891556 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].cn0, " + "expected 11.7686891556, is %s", + last_msg.msg.tracking_state_dep_a.states[0].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[0].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[0].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[0].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[0].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[0].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[1].cn0 * 100 - + 10.9090013504 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].cn0, " + "expected 10.9090013504, is %s", + last_msg.msg.tracking_state_dep_a.states[1].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[1].prn == 2, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].prn, " + "expected 2, is %d", + last_msg.msg.tracking_state_dep_a.states[1].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[1].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[1].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[1].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[2].cn0 * 100 - + 9.88173103333 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].cn0, " + "expected 9.88173103333, is %s", + last_msg.msg.tracking_state_dep_a.states[2].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[2].prn == 3, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].prn, " + "expected 3, is %d", + last_msg.msg.tracking_state_dep_a.states[2].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[2].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[2].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[2].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[3].cn0 * 100 - + 14.0763959885 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].cn0, " + "expected 14.0763959885, is %s", + last_msg.msg.tracking_state_dep_a.states[3].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[3].prn == 7, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].prn, " + "expected 7, is %d", + last_msg.msg.tracking_state_dep_a.states[3].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[3].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[3].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[3].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[4].cn0 * 100 - + 7.6198182106 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].cn0, " + "expected 7.6198182106, is %s", + last_msg.msg.tracking_state_dep_a.states[4].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[4].prn == 10, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].prn, " + "expected 10, is %d", + last_msg.msg.tracking_state_dep_a.states[4].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[4].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[4].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[4].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[5].cn0 * 100 - + 5.20837116241 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].cn0, " + "expected 5.20837116241, is %s", + last_msg.msg.tracking_state_dep_a.states[5].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[5].prn == 13, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].prn, " + "expected 13, is %d", + last_msg.msg.tracking_state_dep_a.states[5].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[5].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[5].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[5].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[6].cn0 * 100 - + 6.29358720779 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].cn0, " + "expected 6.29358720779, is %s", + last_msg.msg.tracking_state_dep_a.states[6].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[6].prn == 22, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].prn, " + "expected 22, is %d", + last_msg.msg.tracking_state_dep_a.states[6].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[6].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[6].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[6].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[7].cn0 * 100 - + 13.2323417664 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].cn0, " + "expected 13.2323417664, is %s", + last_msg.msg.tracking_state_dep_a.states[7].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[7].prn == 30, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].prn, " + "expected 30, is %d", + last_msg.msg.tracking_state_dep_a.states[7].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[7].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[7].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[7].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[8].cn0 * 100 - + 15.5473461151 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].cn0, " + "expected 15.5473461151, is %s", + last_msg.msg.tracking_state_dep_a.states[8].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[8].prn == 31, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].prn, " + "expected 31, is %d", + last_msg.msg.tracking_state_dep_a.states[8].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[8].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[8].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[8].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[9].cn0 * 100 - + 4.13096427917 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].cn0, " + "expected 4.13096427917, is %s", + last_msg.msg.tracking_state_dep_a.states[9].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[9].prn == 25, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].prn, " + "expected 25, is %d", + last_msg.msg.tracking_state_dep_a.states[9].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[9].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[9].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[9].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[10].cn0 * 100 - + 2.85682320595 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].cn0, " + "expected 2.85682320595, is %s", + last_msg.msg.tracking_state_dep_a.states[10].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[10].prn == 6, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].prn, " + "expected 6, is %d", + last_msg.msg.tracking_state_dep_a.states[10].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[10].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[10].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[10].state); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -664,189 +1096,334 @@ START_TEST( test_auto_check_sbp_tracking_MsgtrackingStateDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x16, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x16, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,22,0,195,4,66,1,0,55,143,120,66,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,248,89, }; + u8 encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 55, 143, 120, 66, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 248, 89, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.tracking_state_dep_a.n_states = 11; - - - + test_msg.tracking_state_dep_a.states[0].cn0 = 62.13985824584961; - + test_msg.tracking_state_dep_a.states[0].prn = 0; - + test_msg.tracking_state_dep_a.states[0].state = 1; - - + test_msg.tracking_state_dep_a.states[1].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[1].prn = 0; - + test_msg.tracking_state_dep_a.states[1].state = 0; - - + test_msg.tracking_state_dep_a.states[2].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[2].prn = 0; - + test_msg.tracking_state_dep_a.states[2].state = 0; - - + test_msg.tracking_state_dep_a.states[3].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[3].prn = 0; - + test_msg.tracking_state_dep_a.states[3].state = 0; - - + test_msg.tracking_state_dep_a.states[4].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[4].prn = 0; - + test_msg.tracking_state_dep_a.states[4].state = 0; - - + test_msg.tracking_state_dep_a.states[5].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[5].prn = 0; - + test_msg.tracking_state_dep_a.states[5].state = 0; - - + test_msg.tracking_state_dep_a.states[6].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[6].prn = 0; - + test_msg.tracking_state_dep_a.states[6].state = 0; - - + test_msg.tracking_state_dep_a.states[7].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[7].prn = 0; - + test_msg.tracking_state_dep_a.states[7].state = 0; - - + test_msg.tracking_state_dep_a.states[8].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[8].prn = 0; - + test_msg.tracking_state_dep_a.states[8].state = 0; - - + test_msg.tracking_state_dep_a.states[9].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[9].prn = 0; - + test_msg.tracking_state_dep_a.states[9].state = 0; - - + test_msg.tracking_state_dep_a.states[10].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[10].prn = 0; - + test_msg.tracking_state_dep_a.states[10].state = 0; - sbp_message_send(&sbp_state, SbpMsgTrackingStateDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingStateDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgTrackingStateDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.n_states == 11, "incorrect value for last_msg.msg.tracking_state_dep_a.n_states, expected 11, is %d", last_msg.msg.tracking_state_dep_a.n_states); - - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[0].cn0 * 100 - 62.1398582458 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].cn0, expected 62.1398582458, is %s", last_msg.msg.tracking_state_dep_a.states[0].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[0].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[0].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[0].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[0].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[1].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[1].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[1].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[1].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[1].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[1].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[2].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[2].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[2].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[2].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[2].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[2].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[3].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[3].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[3].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[3].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[3].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[3].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[4].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[4].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[4].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[4].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[4].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[4].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[5].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[5].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[5].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[5].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[5].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[5].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[6].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[6].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[6].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[6].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[6].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[6].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[7].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[7].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[7].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[7].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[7].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[7].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[8].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[8].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[8].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[8].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[8].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[8].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[9].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[9].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[9].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[9].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[9].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[9].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[10].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[10].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[10].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[10].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[10].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[10].state); + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.n_states == 11, + "incorrect value for last_msg.msg.tracking_state_dep_a.n_states, " + "expected 11, is %d", + last_msg.msg.tracking_state_dep_a.n_states); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[0].cn0 * 100 - + 62.1398582458 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].cn0, " + "expected 62.1398582458, is %s", + last_msg.msg.tracking_state_dep_a.states[0].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[0].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[0].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[0].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[0].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[0].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[1].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[1].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[1].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[1].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[1].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[1].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[1].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[2].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[2].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[2].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[2].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[2].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[2].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[2].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[3].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[3].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[3].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[3].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[3].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[3].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[3].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[4].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[4].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[4].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[4].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[4].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[4].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[4].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[5].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[5].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[5].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[5].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[5].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[5].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[5].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[6].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[6].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[6].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[6].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[6].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[6].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[6].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[7].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[7].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[7].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[7].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[7].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[7].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[7].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[8].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[8].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[8].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[8].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[8].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[8].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[8].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[9].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[9].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[9].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[9].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[9].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[9].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[9].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[10].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[10].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[10].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[10].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[10].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[10].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[10].state); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -854,189 +1431,334 @@ START_TEST( test_auto_check_sbp_tracking_MsgtrackingStateDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x16, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x16, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,22,0,195,4,66,1,0,218,14,19,66,1,2,210,3,21,65,1,3,234,214,134,65,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,84,101, }; + u8 encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 218, 14, 19, 66, 1, 2, 210, + 3, 21, 65, 1, 3, 234, 214, 134, 65, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 84, 101, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.tracking_state_dep_a.n_states = 11; - - - + test_msg.tracking_state_dep_a.states[0].cn0 = 36.764503479003906; - + test_msg.tracking_state_dep_a.states[0].prn = 0; - + test_msg.tracking_state_dep_a.states[0].state = 1; - - + test_msg.tracking_state_dep_a.states[1].cn0 = 9.313432693481445; - + test_msg.tracking_state_dep_a.states[1].prn = 2; - + test_msg.tracking_state_dep_a.states[1].state = 1; - - + test_msg.tracking_state_dep_a.states[2].cn0 = 16.854938507080078; - + test_msg.tracking_state_dep_a.states[2].prn = 3; - + test_msg.tracking_state_dep_a.states[2].state = 1; - - + test_msg.tracking_state_dep_a.states[3].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[3].prn = 0; - + test_msg.tracking_state_dep_a.states[3].state = 0; - - + test_msg.tracking_state_dep_a.states[4].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[4].prn = 0; - + test_msg.tracking_state_dep_a.states[4].state = 0; - - + test_msg.tracking_state_dep_a.states[5].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[5].prn = 0; - + test_msg.tracking_state_dep_a.states[5].state = 0; - - + test_msg.tracking_state_dep_a.states[6].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[6].prn = 0; - + test_msg.tracking_state_dep_a.states[6].state = 0; - - + test_msg.tracking_state_dep_a.states[7].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[7].prn = 0; - + test_msg.tracking_state_dep_a.states[7].state = 0; - - + test_msg.tracking_state_dep_a.states[8].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[8].prn = 0; - + test_msg.tracking_state_dep_a.states[8].state = 0; - - + test_msg.tracking_state_dep_a.states[9].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[9].prn = 0; - + test_msg.tracking_state_dep_a.states[9].state = 0; - - + test_msg.tracking_state_dep_a.states[10].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[10].prn = 0; - + test_msg.tracking_state_dep_a.states[10].state = 0; - sbp_message_send(&sbp_state, SbpMsgTrackingStateDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingStateDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgTrackingStateDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.n_states == 11, "incorrect value for last_msg.msg.tracking_state_dep_a.n_states, expected 11, is %d", last_msg.msg.tracking_state_dep_a.n_states); - - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[0].cn0 * 100 - 36.764503479 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].cn0, expected 36.764503479, is %s", last_msg.msg.tracking_state_dep_a.states[0].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[0].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[0].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[0].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[0].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[1].cn0 * 100 - 9.31343269348 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].cn0, expected 9.31343269348, is %s", last_msg.msg.tracking_state_dep_a.states[1].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[1].prn == 2, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].prn, expected 2, is %d", last_msg.msg.tracking_state_dep_a.states[1].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[1].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[1].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[2].cn0 * 100 - 16.8549385071 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].cn0, expected 16.8549385071, is %s", last_msg.msg.tracking_state_dep_a.states[2].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[2].prn == 3, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].prn, expected 3, is %d", last_msg.msg.tracking_state_dep_a.states[2].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[2].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[2].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[3].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[3].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[3].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[3].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[3].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[3].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[4].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[4].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[4].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[4].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[4].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[4].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[5].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[5].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[5].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[5].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[5].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[5].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[6].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[6].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[6].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[6].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[6].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[6].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[7].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[7].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[7].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[7].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[7].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[7].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[8].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[8].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[8].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[8].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[8].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[8].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[9].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[9].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[9].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[9].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[9].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[9].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[10].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[10].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[10].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[10].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[10].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[10].state); + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.n_states == 11, + "incorrect value for last_msg.msg.tracking_state_dep_a.n_states, " + "expected 11, is %d", + last_msg.msg.tracking_state_dep_a.n_states); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[0].cn0 * 100 - + 36.764503479 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].cn0, " + "expected 36.764503479, is %s", + last_msg.msg.tracking_state_dep_a.states[0].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[0].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[0].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[0].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[0].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[0].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[1].cn0 * 100 - + 9.31343269348 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].cn0, " + "expected 9.31343269348, is %s", + last_msg.msg.tracking_state_dep_a.states[1].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[1].prn == 2, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].prn, " + "expected 2, is %d", + last_msg.msg.tracking_state_dep_a.states[1].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[1].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[1].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[1].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[2].cn0 * 100 - + 16.8549385071 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].cn0, " + "expected 16.8549385071, is %s", + last_msg.msg.tracking_state_dep_a.states[2].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[2].prn == 3, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].prn, " + "expected 3, is %d", + last_msg.msg.tracking_state_dep_a.states[2].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[2].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[2].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[2].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[3].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[3].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[3].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[3].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[3].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[3].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[3].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[4].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[4].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[4].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[4].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[4].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[4].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[4].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[5].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[5].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[5].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[5].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[5].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[5].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[5].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[6].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[6].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[6].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[6].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[6].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[6].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[6].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[7].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[7].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[7].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[7].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[7].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[7].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[7].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[8].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[8].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[8].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[8].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[8].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[8].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[8].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[9].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[9].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[9].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[9].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[9].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[9].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[9].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[10].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[10].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[10].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[10].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[10].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[10].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[10].state); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -1044,192 +1766,337 @@ START_TEST( test_auto_check_sbp_tracking_MsgtrackingStateDepA ) logging_reset(); - sbp_callback_register(&sbp_state, 0x16, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x16, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,22,0,195,4,66,1,0,98,39,219,65,1,2,0,0,56,64,1,3,121,123,7,65,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,37,123, }; + u8 encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 98, 39, 219, 65, 1, 2, 0, + 0, 56, 64, 1, 3, 121, 123, 7, 65, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 37, 123, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.tracking_state_dep_a.n_states = 11; - - - + test_msg.tracking_state_dep_a.states[0].cn0 = 27.394229888916016; - + test_msg.tracking_state_dep_a.states[0].prn = 0; - + test_msg.tracking_state_dep_a.states[0].state = 1; - - + test_msg.tracking_state_dep_a.states[1].cn0 = 2.875; - + test_msg.tracking_state_dep_a.states[1].prn = 2; - + test_msg.tracking_state_dep_a.states[1].state = 1; - - + test_msg.tracking_state_dep_a.states[2].cn0 = 8.467644691467285; - + test_msg.tracking_state_dep_a.states[2].prn = 3; - + test_msg.tracking_state_dep_a.states[2].state = 1; - - + test_msg.tracking_state_dep_a.states[3].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[3].prn = 0; - + test_msg.tracking_state_dep_a.states[3].state = 0; - - + test_msg.tracking_state_dep_a.states[4].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[4].prn = 0; - + test_msg.tracking_state_dep_a.states[4].state = 0; - - + test_msg.tracking_state_dep_a.states[5].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[5].prn = 0; - + test_msg.tracking_state_dep_a.states[5].state = 0; - - + test_msg.tracking_state_dep_a.states[6].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[6].prn = 0; - + test_msg.tracking_state_dep_a.states[6].state = 0; - - + test_msg.tracking_state_dep_a.states[7].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[7].prn = 0; - + test_msg.tracking_state_dep_a.states[7].state = 0; - - + test_msg.tracking_state_dep_a.states[8].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[8].prn = 0; - + test_msg.tracking_state_dep_a.states[8].state = 0; - - + test_msg.tracking_state_dep_a.states[9].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[9].prn = 0; - + test_msg.tracking_state_dep_a.states[9].state = 0; - - + test_msg.tracking_state_dep_a.states[10].cn0 = -1.0; - + test_msg.tracking_state_dep_a.states[10].prn = 0; - + test_msg.tracking_state_dep_a.states[10].state = 0; - sbp_message_send(&sbp_state, SbpMsgTrackingStateDepA, 1219, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgTrackingStateDepA, 1219, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgTrackingStateDepA, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgTrackingStateDepA, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.n_states == 11, "incorrect value for last_msg.msg.tracking_state_dep_a.n_states, expected 11, is %d", last_msg.msg.tracking_state_dep_a.n_states); - - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[0].cn0 * 100 - 27.3942298889 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].cn0, expected 27.3942298889, is %s", last_msg.msg.tracking_state_dep_a.states[0].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[0].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[0].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[0].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[0].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[1].cn0 * 100 - 2.875 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].cn0, expected 2.875, is %s", last_msg.msg.tracking_state_dep_a.states[1].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[1].prn == 2, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].prn, expected 2, is %d", last_msg.msg.tracking_state_dep_a.states[1].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[1].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[1].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[2].cn0 * 100 - 8.46764469147 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].cn0, expected 8.46764469147, is %s", last_msg.msg.tracking_state_dep_a.states[2].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[2].prn == 3, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].prn, expected 3, is %d", last_msg.msg.tracking_state_dep_a.states[2].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[2].state == 1, "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].state, expected 1, is %d", last_msg.msg.tracking_state_dep_a.states[2].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[3].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[3].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[3].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[3].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[3].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[3].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[4].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[4].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[4].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[4].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[4].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[4].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[5].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[5].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[5].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[5].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[5].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[5].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[6].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[6].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[6].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[6].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[6].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[6].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[7].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[7].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[7].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[7].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[7].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[7].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[8].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[8].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[8].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[8].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[8].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[8].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[9].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[9].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[9].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[9].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[9].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[9].state); - - ck_assert_msg((last_msg.msg.tracking_state_dep_a.states[10].cn0 * 100 - -1.0 * 100) < 0.05, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].cn0, expected -1.0, is %s", last_msg.msg.tracking_state_dep_a.states[10].cn0); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[10].prn == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].prn, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[10].prn); - - ck_assert_msg(last_msg.msg.tracking_state_dep_a.states[10].state == 0, "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].state, expected 0, is %d", last_msg.msg.tracking_state_dep_a.states[10].state); + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.n_states == 11, + "incorrect value for last_msg.msg.tracking_state_dep_a.n_states, " + "expected 11, is %d", + last_msg.msg.tracking_state_dep_a.n_states); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[0].cn0 * 100 - + 27.3942298889 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].cn0, " + "expected 27.3942298889, is %s", + last_msg.msg.tracking_state_dep_a.states[0].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[0].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[0].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[0].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[0].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[0].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[0].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[1].cn0 * 100 - 2.875 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].cn0, " + "expected 2.875, is %s", + last_msg.msg.tracking_state_dep_a.states[1].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[1].prn == 2, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[1].prn, " + "expected 2, is %d", + last_msg.msg.tracking_state_dep_a.states[1].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[1].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[1].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[1].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[2].cn0 * 100 - + 8.46764469147 * 100) < 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].cn0, " + "expected 8.46764469147, is %s", + last_msg.msg.tracking_state_dep_a.states[2].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[2].prn == 3, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[2].prn, " + "expected 3, is %d", + last_msg.msg.tracking_state_dep_a.states[2].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[2].state == 1, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[2].state, expected 1, is %d", + last_msg.msg.tracking_state_dep_a.states[2].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[3].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[3].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[3].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[3].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[3].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[3].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[3].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[3].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[4].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[4].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[4].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[4].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[4].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[4].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[4].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[4].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[5].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[5].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[5].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[5].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[5].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[5].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[5].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[5].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[6].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[6].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[6].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[6].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[6].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[6].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[6].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[6].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[7].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[7].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[7].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[7].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[7].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[7].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[7].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[7].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[8].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[8].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[8].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[8].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[8].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[8].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[8].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[8].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[9].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[9].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[9].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[9].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[9].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[9].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[9].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[9].state); + + ck_assert_msg( + (last_msg.msg.tracking_state_dep_a.states[10].cn0 * 100 - -1.0 * 100) < + 0.05, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].cn0, " + "expected -1.0, is %s", + last_msg.msg.tracking_state_dep_a.states[10].cn0); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[10].prn == 0, + "incorrect value for last_msg.msg.tracking_state_dep_a.states[10].prn, " + "expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[10].prn); + + ck_assert_msg( + last_msg.msg.tracking_state_dep_a.states[10].state == 0, + "incorrect value for " + "last_msg.msg.tracking_state_dep_a.states[10].state, expected 0, is %d", + last_msg.msg.tracking_state_dep_a.states[10].state); } } END_TEST -Suite* auto_check_sbp_tracking_MsgtrackingStateDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_tracking_MsgtrackingStateDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_tracking_MsgtrackingStateDepA"); +Suite *auto_check_sbp_tracking_MsgtrackingStateDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_tracking_MsgtrackingStateDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_tracking_MsgtrackingStateDepA"); tcase_add_test(tc_acq, test_auto_check_sbp_tracking_MsgtrackingStateDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_user_MsgUserData.c b/c/test/auto_check_sbp_user_MsgUserData.c index 052dcb38b..4f3bbcb6b 100644 --- a/c/test/auto_check_sbp_user_MsgUserData.c +++ b/c/test/auto_check_sbp_user_MsgUserData.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/user/test_MsgUserData.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/user/test_MsgUserData.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_user_MsgUserData ) -{ +START_TEST(test_auto_check_sbp_user_MsgUserData) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_user_MsgUserData ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,814 +90,1605 @@ START_TEST( test_auto_check_sbp_user_MsgUserData ) logging_reset(); - sbp_callback_register(&sbp_state, 0x800, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x800, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,0,8,126,33,255,53,5,172,138,50,49,206,234,149,204,113,31,108,188,179,154,156,167,145,139,42,207,126,242,193,9,58,75,8,135,11,92,131,245,24,90,255,30,58,31,109,148,56,178,140,30,159,70,17,170,50,148,1,99,112,88,217,36,84,34,234,82,144,144,97,96,75,174,58,219,180,148,247,59,2,116,214,114,55,134,54,119,108,128,73,181,20,233,23,23,73,119,136,231,189,26,174,128,93,30,76,45,109,134,81,0,116,158,127,40,133,208,134,127,140,232,183,184,108,6,228,54,238,59,220,30,228,212,50,182,97,20,41,76,227,88,12,95,112,209,183,127,4,165,189,44,239,232,132,9,114,184,249,208,246,194,250,2,97,173,157,202,172,180,150,213,193,177,209,156,20,174,18,73,132,215,115,128,175,169,116,132,100,72,45,25,14,205,213,145,68,137,249,54,40,174,215,148,166,190,63,118,6,165,212,74,68,200,38,139,212,112,45,167,236,255,106,92,132,59,61,233,3,246,158,83,134,246,154,17,0,6,56,216,19,216,70,71,161,184,5,177,45,37,98,56,149,0,73,221,105,239,168,205,85,81,245, }; + u8 encoded_frame[] = { + 85, 0, 8, 126, 33, 255, 53, 5, 172, 138, 50, 49, 206, 234, + 149, 204, 113, 31, 108, 188, 179, 154, 156, 167, 145, 139, 42, 207, + 126, 242, 193, 9, 58, 75, 8, 135, 11, 92, 131, 245, 24, 90, + 255, 30, 58, 31, 109, 148, 56, 178, 140, 30, 159, 70, 17, 170, + 50, 148, 1, 99, 112, 88, 217, 36, 84, 34, 234, 82, 144, 144, + 97, 96, 75, 174, 58, 219, 180, 148, 247, 59, 2, 116, 214, 114, + 55, 134, 54, 119, 108, 128, 73, 181, 20, 233, 23, 23, 73, 119, + 136, 231, 189, 26, 174, 128, 93, 30, 76, 45, 109, 134, 81, 0, + 116, 158, 127, 40, 133, 208, 134, 127, 140, 232, 183, 184, 108, 6, + 228, 54, 238, 59, 220, 30, 228, 212, 50, 182, 97, 20, 41, 76, + 227, 88, 12, 95, 112, 209, 183, 127, 4, 165, 189, 44, 239, 232, + 132, 9, 114, 184, 249, 208, 246, 194, 250, 2, 97, 173, 157, 202, + 172, 180, 150, 213, 193, 177, 209, 156, 20, 174, 18, 73, 132, 215, + 115, 128, 175, 169, 116, 132, 100, 72, 45, 25, 14, 205, 213, 145, + 68, 137, 249, 54, 40, 174, 215, 148, 166, 190, 63, 118, 6, 165, + 212, 74, 68, 200, 38, 139, 212, 112, 45, 167, 236, 255, 106, 92, + 132, 59, 61, 233, 3, 246, 158, 83, 134, 246, 154, 17, 0, 6, + 56, 216, 19, 216, 70, 71, 161, 184, 5, 177, 45, 37, 98, 56, + 149, 0, 73, 221, 105, 239, 168, 205, 85, 81, 245, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - - + test_msg.user_data.contents[0] = 53; - + test_msg.user_data.contents[1] = 5; - + test_msg.user_data.contents[2] = 172; - + test_msg.user_data.contents[3] = 138; - + test_msg.user_data.contents[4] = 50; - + test_msg.user_data.contents[5] = 49; - + test_msg.user_data.contents[6] = 206; - + test_msg.user_data.contents[7] = 234; - + test_msg.user_data.contents[8] = 149; - + test_msg.user_data.contents[9] = 204; - + test_msg.user_data.contents[10] = 113; - + test_msg.user_data.contents[11] = 31; - + test_msg.user_data.contents[12] = 108; - + test_msg.user_data.contents[13] = 188; - + test_msg.user_data.contents[14] = 179; - + test_msg.user_data.contents[15] = 154; - + test_msg.user_data.contents[16] = 156; - + test_msg.user_data.contents[17] = 167; - + test_msg.user_data.contents[18] = 145; - + test_msg.user_data.contents[19] = 139; - + test_msg.user_data.contents[20] = 42; - + test_msg.user_data.contents[21] = 207; - + test_msg.user_data.contents[22] = 126; - + test_msg.user_data.contents[23] = 242; - + test_msg.user_data.contents[24] = 193; - + test_msg.user_data.contents[25] = 9; - + test_msg.user_data.contents[26] = 58; - + test_msg.user_data.contents[27] = 75; - + test_msg.user_data.contents[28] = 8; - + test_msg.user_data.contents[29] = 135; - + test_msg.user_data.contents[30] = 11; - + test_msg.user_data.contents[31] = 92; - + test_msg.user_data.contents[32] = 131; - + test_msg.user_data.contents[33] = 245; - + test_msg.user_data.contents[34] = 24; - + test_msg.user_data.contents[35] = 90; - + test_msg.user_data.contents[36] = 255; - + test_msg.user_data.contents[37] = 30; - + test_msg.user_data.contents[38] = 58; - + test_msg.user_data.contents[39] = 31; - + test_msg.user_data.contents[40] = 109; - + test_msg.user_data.contents[41] = 148; - + test_msg.user_data.contents[42] = 56; - + test_msg.user_data.contents[43] = 178; - + test_msg.user_data.contents[44] = 140; - + test_msg.user_data.contents[45] = 30; - + test_msg.user_data.contents[46] = 159; - + test_msg.user_data.contents[47] = 70; - + test_msg.user_data.contents[48] = 17; - + test_msg.user_data.contents[49] = 170; - + test_msg.user_data.contents[50] = 50; - + test_msg.user_data.contents[51] = 148; - + test_msg.user_data.contents[52] = 1; - + test_msg.user_data.contents[53] = 99; - + test_msg.user_data.contents[54] = 112; - + test_msg.user_data.contents[55] = 88; - + test_msg.user_data.contents[56] = 217; - + test_msg.user_data.contents[57] = 36; - + test_msg.user_data.contents[58] = 84; - + test_msg.user_data.contents[59] = 34; - + test_msg.user_data.contents[60] = 234; - + test_msg.user_data.contents[61] = 82; - + test_msg.user_data.contents[62] = 144; - + test_msg.user_data.contents[63] = 144; - + test_msg.user_data.contents[64] = 97; - + test_msg.user_data.contents[65] = 96; - + test_msg.user_data.contents[66] = 75; - + test_msg.user_data.contents[67] = 174; - + test_msg.user_data.contents[68] = 58; - + test_msg.user_data.contents[69] = 219; - + test_msg.user_data.contents[70] = 180; - + test_msg.user_data.contents[71] = 148; - + test_msg.user_data.contents[72] = 247; - + test_msg.user_data.contents[73] = 59; - + test_msg.user_data.contents[74] = 2; - + test_msg.user_data.contents[75] = 116; - + test_msg.user_data.contents[76] = 214; - + test_msg.user_data.contents[77] = 114; - + test_msg.user_data.contents[78] = 55; - + test_msg.user_data.contents[79] = 134; - + test_msg.user_data.contents[80] = 54; - + test_msg.user_data.contents[81] = 119; - + test_msg.user_data.contents[82] = 108; - + test_msg.user_data.contents[83] = 128; - + test_msg.user_data.contents[84] = 73; - + test_msg.user_data.contents[85] = 181; - + test_msg.user_data.contents[86] = 20; - + test_msg.user_data.contents[87] = 233; - + test_msg.user_data.contents[88] = 23; - + test_msg.user_data.contents[89] = 23; - + test_msg.user_data.contents[90] = 73; - + test_msg.user_data.contents[91] = 119; - + test_msg.user_data.contents[92] = 136; - + test_msg.user_data.contents[93] = 231; - + test_msg.user_data.contents[94] = 189; - + test_msg.user_data.contents[95] = 26; - + test_msg.user_data.contents[96] = 174; - + test_msg.user_data.contents[97] = 128; - + test_msg.user_data.contents[98] = 93; - + test_msg.user_data.contents[99] = 30; - + test_msg.user_data.contents[100] = 76; - + test_msg.user_data.contents[101] = 45; - + test_msg.user_data.contents[102] = 109; - + test_msg.user_data.contents[103] = 134; - + test_msg.user_data.contents[104] = 81; - + test_msg.user_data.contents[105] = 0; - + test_msg.user_data.contents[106] = 116; - + test_msg.user_data.contents[107] = 158; - + test_msg.user_data.contents[108] = 127; - + test_msg.user_data.contents[109] = 40; - + test_msg.user_data.contents[110] = 133; - + test_msg.user_data.contents[111] = 208; - + test_msg.user_data.contents[112] = 134; - + test_msg.user_data.contents[113] = 127; - + test_msg.user_data.contents[114] = 140; - + test_msg.user_data.contents[115] = 232; - + test_msg.user_data.contents[116] = 183; - + test_msg.user_data.contents[117] = 184; - + test_msg.user_data.contents[118] = 108; - + test_msg.user_data.contents[119] = 6; - + test_msg.user_data.contents[120] = 228; - + test_msg.user_data.contents[121] = 54; - + test_msg.user_data.contents[122] = 238; - + test_msg.user_data.contents[123] = 59; - + test_msg.user_data.contents[124] = 220; - + test_msg.user_data.contents[125] = 30; - + test_msg.user_data.contents[126] = 228; - + test_msg.user_data.contents[127] = 212; - + test_msg.user_data.contents[128] = 50; - + test_msg.user_data.contents[129] = 182; - + test_msg.user_data.contents[130] = 97; - + test_msg.user_data.contents[131] = 20; - + test_msg.user_data.contents[132] = 41; - + test_msg.user_data.contents[133] = 76; - + test_msg.user_data.contents[134] = 227; - + test_msg.user_data.contents[135] = 88; - + test_msg.user_data.contents[136] = 12; - + test_msg.user_data.contents[137] = 95; - + test_msg.user_data.contents[138] = 112; - + test_msg.user_data.contents[139] = 209; - + test_msg.user_data.contents[140] = 183; - + test_msg.user_data.contents[141] = 127; - + test_msg.user_data.contents[142] = 4; - + test_msg.user_data.contents[143] = 165; - + test_msg.user_data.contents[144] = 189; - + test_msg.user_data.contents[145] = 44; - + test_msg.user_data.contents[146] = 239; - + test_msg.user_data.contents[147] = 232; - + test_msg.user_data.contents[148] = 132; - + test_msg.user_data.contents[149] = 9; - + test_msg.user_data.contents[150] = 114; - + test_msg.user_data.contents[151] = 184; - + test_msg.user_data.contents[152] = 249; - + test_msg.user_data.contents[153] = 208; - + test_msg.user_data.contents[154] = 246; - + test_msg.user_data.contents[155] = 194; - + test_msg.user_data.contents[156] = 250; - + test_msg.user_data.contents[157] = 2; - + test_msg.user_data.contents[158] = 97; - + test_msg.user_data.contents[159] = 173; - + test_msg.user_data.contents[160] = 157; - + test_msg.user_data.contents[161] = 202; - + test_msg.user_data.contents[162] = 172; - + test_msg.user_data.contents[163] = 180; - + test_msg.user_data.contents[164] = 150; - + test_msg.user_data.contents[165] = 213; - + test_msg.user_data.contents[166] = 193; - + test_msg.user_data.contents[167] = 177; - + test_msg.user_data.contents[168] = 209; - + test_msg.user_data.contents[169] = 156; - + test_msg.user_data.contents[170] = 20; - + test_msg.user_data.contents[171] = 174; - + test_msg.user_data.contents[172] = 18; - + test_msg.user_data.contents[173] = 73; - + test_msg.user_data.contents[174] = 132; - + test_msg.user_data.contents[175] = 215; - + test_msg.user_data.contents[176] = 115; - + test_msg.user_data.contents[177] = 128; - + test_msg.user_data.contents[178] = 175; - + test_msg.user_data.contents[179] = 169; - + test_msg.user_data.contents[180] = 116; - + test_msg.user_data.contents[181] = 132; - + test_msg.user_data.contents[182] = 100; - + test_msg.user_data.contents[183] = 72; - + test_msg.user_data.contents[184] = 45; - + test_msg.user_data.contents[185] = 25; - + test_msg.user_data.contents[186] = 14; - + test_msg.user_data.contents[187] = 205; - + test_msg.user_data.contents[188] = 213; - + test_msg.user_data.contents[189] = 145; - + test_msg.user_data.contents[190] = 68; - + test_msg.user_data.contents[191] = 137; - + test_msg.user_data.contents[192] = 249; - + test_msg.user_data.contents[193] = 54; - + test_msg.user_data.contents[194] = 40; - + test_msg.user_data.contents[195] = 174; - + test_msg.user_data.contents[196] = 215; - + test_msg.user_data.contents[197] = 148; - + test_msg.user_data.contents[198] = 166; - + test_msg.user_data.contents[199] = 190; - + test_msg.user_data.contents[200] = 63; - + test_msg.user_data.contents[201] = 118; - + test_msg.user_data.contents[202] = 6; - + test_msg.user_data.contents[203] = 165; - + test_msg.user_data.contents[204] = 212; - + test_msg.user_data.contents[205] = 74; - + test_msg.user_data.contents[206] = 68; - + test_msg.user_data.contents[207] = 200; - + test_msg.user_data.contents[208] = 38; - + test_msg.user_data.contents[209] = 139; - + test_msg.user_data.contents[210] = 212; - + test_msg.user_data.contents[211] = 112; - + test_msg.user_data.contents[212] = 45; - + test_msg.user_data.contents[213] = 167; - + test_msg.user_data.contents[214] = 236; - + test_msg.user_data.contents[215] = 255; - + test_msg.user_data.contents[216] = 106; - + test_msg.user_data.contents[217] = 92; - + test_msg.user_data.contents[218] = 132; - + test_msg.user_data.contents[219] = 59; - + test_msg.user_data.contents[220] = 61; - + test_msg.user_data.contents[221] = 233; - + test_msg.user_data.contents[222] = 3; - + test_msg.user_data.contents[223] = 246; - + test_msg.user_data.contents[224] = 158; - + test_msg.user_data.contents[225] = 83; - + test_msg.user_data.contents[226] = 134; - + test_msg.user_data.contents[227] = 246; - + test_msg.user_data.contents[228] = 154; - + test_msg.user_data.contents[229] = 17; - + test_msg.user_data.contents[230] = 0; - + test_msg.user_data.contents[231] = 6; - + test_msg.user_data.contents[232] = 56; - + test_msg.user_data.contents[233] = 216; - + test_msg.user_data.contents[234] = 19; - + test_msg.user_data.contents[235] = 216; - + test_msg.user_data.contents[236] = 70; - + test_msg.user_data.contents[237] = 71; - + test_msg.user_data.contents[238] = 161; - + test_msg.user_data.contents[239] = 184; - + test_msg.user_data.contents[240] = 5; - + test_msg.user_data.contents[241] = 177; - + test_msg.user_data.contents[242] = 45; - + test_msg.user_data.contents[243] = 37; - + test_msg.user_data.contents[244] = 98; - + test_msg.user_data.contents[245] = 56; - + test_msg.user_data.contents[246] = 149; - + test_msg.user_data.contents[247] = 0; - + test_msg.user_data.contents[248] = 73; - + test_msg.user_data.contents[249] = 221; - + test_msg.user_data.contents[250] = 105; - + test_msg.user_data.contents[251] = 239; - + test_msg.user_data.contents[252] = 168; - + test_msg.user_data.contents[253] = 205; - + test_msg.user_data.contents[254] = 85; - + test_msg.user_data.n_contents = 255; sbp_message_send(&sbp_state, SbpMsgUserData, 8574, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 8574, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgUserData, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgUserData, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.user_data.contents[0] == 53, "incorrect value for last_msg.msg.user_data.contents[0], expected 53, is %d", last_msg.msg.user_data.contents[0]); - ck_assert_msg(last_msg.msg.user_data.contents[1] == 5, "incorrect value for last_msg.msg.user_data.contents[1], expected 5, is %d", last_msg.msg.user_data.contents[1]); - ck_assert_msg(last_msg.msg.user_data.contents[2] == 172, "incorrect value for last_msg.msg.user_data.contents[2], expected 172, is %d", last_msg.msg.user_data.contents[2]); - ck_assert_msg(last_msg.msg.user_data.contents[3] == 138, "incorrect value for last_msg.msg.user_data.contents[3], expected 138, is %d", last_msg.msg.user_data.contents[3]); - ck_assert_msg(last_msg.msg.user_data.contents[4] == 50, "incorrect value for last_msg.msg.user_data.contents[4], expected 50, is %d", last_msg.msg.user_data.contents[4]); - ck_assert_msg(last_msg.msg.user_data.contents[5] == 49, "incorrect value for last_msg.msg.user_data.contents[5], expected 49, is %d", last_msg.msg.user_data.contents[5]); - ck_assert_msg(last_msg.msg.user_data.contents[6] == 206, "incorrect value for last_msg.msg.user_data.contents[6], expected 206, is %d", last_msg.msg.user_data.contents[6]); - ck_assert_msg(last_msg.msg.user_data.contents[7] == 234, "incorrect value for last_msg.msg.user_data.contents[7], expected 234, is %d", last_msg.msg.user_data.contents[7]); - ck_assert_msg(last_msg.msg.user_data.contents[8] == 149, "incorrect value for last_msg.msg.user_data.contents[8], expected 149, is %d", last_msg.msg.user_data.contents[8]); - ck_assert_msg(last_msg.msg.user_data.contents[9] == 204, "incorrect value for last_msg.msg.user_data.contents[9], expected 204, is %d", last_msg.msg.user_data.contents[9]); - ck_assert_msg(last_msg.msg.user_data.contents[10] == 113, "incorrect value for last_msg.msg.user_data.contents[10], expected 113, is %d", last_msg.msg.user_data.contents[10]); - ck_assert_msg(last_msg.msg.user_data.contents[11] == 31, "incorrect value for last_msg.msg.user_data.contents[11], expected 31, is %d", last_msg.msg.user_data.contents[11]); - ck_assert_msg(last_msg.msg.user_data.contents[12] == 108, "incorrect value for last_msg.msg.user_data.contents[12], expected 108, is %d", last_msg.msg.user_data.contents[12]); - ck_assert_msg(last_msg.msg.user_data.contents[13] == 188, "incorrect value for last_msg.msg.user_data.contents[13], expected 188, is %d", last_msg.msg.user_data.contents[13]); - ck_assert_msg(last_msg.msg.user_data.contents[14] == 179, "incorrect value for last_msg.msg.user_data.contents[14], expected 179, is %d", last_msg.msg.user_data.contents[14]); - ck_assert_msg(last_msg.msg.user_data.contents[15] == 154, "incorrect value for last_msg.msg.user_data.contents[15], expected 154, is %d", last_msg.msg.user_data.contents[15]); - ck_assert_msg(last_msg.msg.user_data.contents[16] == 156, "incorrect value for last_msg.msg.user_data.contents[16], expected 156, is %d", last_msg.msg.user_data.contents[16]); - ck_assert_msg(last_msg.msg.user_data.contents[17] == 167, "incorrect value for last_msg.msg.user_data.contents[17], expected 167, is %d", last_msg.msg.user_data.contents[17]); - ck_assert_msg(last_msg.msg.user_data.contents[18] == 145, "incorrect value for last_msg.msg.user_data.contents[18], expected 145, is %d", last_msg.msg.user_data.contents[18]); - ck_assert_msg(last_msg.msg.user_data.contents[19] == 139, "incorrect value for last_msg.msg.user_data.contents[19], expected 139, is %d", last_msg.msg.user_data.contents[19]); - ck_assert_msg(last_msg.msg.user_data.contents[20] == 42, "incorrect value for last_msg.msg.user_data.contents[20], expected 42, is %d", last_msg.msg.user_data.contents[20]); - ck_assert_msg(last_msg.msg.user_data.contents[21] == 207, "incorrect value for last_msg.msg.user_data.contents[21], expected 207, is %d", last_msg.msg.user_data.contents[21]); - ck_assert_msg(last_msg.msg.user_data.contents[22] == 126, "incorrect value for last_msg.msg.user_data.contents[22], expected 126, is %d", last_msg.msg.user_data.contents[22]); - ck_assert_msg(last_msg.msg.user_data.contents[23] == 242, "incorrect value for last_msg.msg.user_data.contents[23], expected 242, is %d", last_msg.msg.user_data.contents[23]); - ck_assert_msg(last_msg.msg.user_data.contents[24] == 193, "incorrect value for last_msg.msg.user_data.contents[24], expected 193, is %d", last_msg.msg.user_data.contents[24]); - ck_assert_msg(last_msg.msg.user_data.contents[25] == 9, "incorrect value for last_msg.msg.user_data.contents[25], expected 9, is %d", last_msg.msg.user_data.contents[25]); - ck_assert_msg(last_msg.msg.user_data.contents[26] == 58, "incorrect value for last_msg.msg.user_data.contents[26], expected 58, is %d", last_msg.msg.user_data.contents[26]); - ck_assert_msg(last_msg.msg.user_data.contents[27] == 75, "incorrect value for last_msg.msg.user_data.contents[27], expected 75, is %d", last_msg.msg.user_data.contents[27]); - ck_assert_msg(last_msg.msg.user_data.contents[28] == 8, "incorrect value for last_msg.msg.user_data.contents[28], expected 8, is %d", last_msg.msg.user_data.contents[28]); - ck_assert_msg(last_msg.msg.user_data.contents[29] == 135, "incorrect value for last_msg.msg.user_data.contents[29], expected 135, is %d", last_msg.msg.user_data.contents[29]); - ck_assert_msg(last_msg.msg.user_data.contents[30] == 11, "incorrect value for last_msg.msg.user_data.contents[30], expected 11, is %d", last_msg.msg.user_data.contents[30]); - ck_assert_msg(last_msg.msg.user_data.contents[31] == 92, "incorrect value for last_msg.msg.user_data.contents[31], expected 92, is %d", last_msg.msg.user_data.contents[31]); - ck_assert_msg(last_msg.msg.user_data.contents[32] == 131, "incorrect value for last_msg.msg.user_data.contents[32], expected 131, is %d", last_msg.msg.user_data.contents[32]); - ck_assert_msg(last_msg.msg.user_data.contents[33] == 245, "incorrect value for last_msg.msg.user_data.contents[33], expected 245, is %d", last_msg.msg.user_data.contents[33]); - ck_assert_msg(last_msg.msg.user_data.contents[34] == 24, "incorrect value for last_msg.msg.user_data.contents[34], expected 24, is %d", last_msg.msg.user_data.contents[34]); - ck_assert_msg(last_msg.msg.user_data.contents[35] == 90, "incorrect value for last_msg.msg.user_data.contents[35], expected 90, is %d", last_msg.msg.user_data.contents[35]); - ck_assert_msg(last_msg.msg.user_data.contents[36] == 255, "incorrect value for last_msg.msg.user_data.contents[36], expected 255, is %d", last_msg.msg.user_data.contents[36]); - ck_assert_msg(last_msg.msg.user_data.contents[37] == 30, "incorrect value for last_msg.msg.user_data.contents[37], expected 30, is %d", last_msg.msg.user_data.contents[37]); - ck_assert_msg(last_msg.msg.user_data.contents[38] == 58, "incorrect value for last_msg.msg.user_data.contents[38], expected 58, is %d", last_msg.msg.user_data.contents[38]); - ck_assert_msg(last_msg.msg.user_data.contents[39] == 31, "incorrect value for last_msg.msg.user_data.contents[39], expected 31, is %d", last_msg.msg.user_data.contents[39]); - ck_assert_msg(last_msg.msg.user_data.contents[40] == 109, "incorrect value for last_msg.msg.user_data.contents[40], expected 109, is %d", last_msg.msg.user_data.contents[40]); - ck_assert_msg(last_msg.msg.user_data.contents[41] == 148, "incorrect value for last_msg.msg.user_data.contents[41], expected 148, is %d", last_msg.msg.user_data.contents[41]); - ck_assert_msg(last_msg.msg.user_data.contents[42] == 56, "incorrect value for last_msg.msg.user_data.contents[42], expected 56, is %d", last_msg.msg.user_data.contents[42]); - ck_assert_msg(last_msg.msg.user_data.contents[43] == 178, "incorrect value for last_msg.msg.user_data.contents[43], expected 178, is %d", last_msg.msg.user_data.contents[43]); - ck_assert_msg(last_msg.msg.user_data.contents[44] == 140, "incorrect value for last_msg.msg.user_data.contents[44], expected 140, is %d", last_msg.msg.user_data.contents[44]); - ck_assert_msg(last_msg.msg.user_data.contents[45] == 30, "incorrect value for last_msg.msg.user_data.contents[45], expected 30, is %d", last_msg.msg.user_data.contents[45]); - ck_assert_msg(last_msg.msg.user_data.contents[46] == 159, "incorrect value for last_msg.msg.user_data.contents[46], expected 159, is %d", last_msg.msg.user_data.contents[46]); - ck_assert_msg(last_msg.msg.user_data.contents[47] == 70, "incorrect value for last_msg.msg.user_data.contents[47], expected 70, is %d", last_msg.msg.user_data.contents[47]); - ck_assert_msg(last_msg.msg.user_data.contents[48] == 17, "incorrect value for last_msg.msg.user_data.contents[48], expected 17, is %d", last_msg.msg.user_data.contents[48]); - ck_assert_msg(last_msg.msg.user_data.contents[49] == 170, "incorrect value for last_msg.msg.user_data.contents[49], expected 170, is %d", last_msg.msg.user_data.contents[49]); - ck_assert_msg(last_msg.msg.user_data.contents[50] == 50, "incorrect value for last_msg.msg.user_data.contents[50], expected 50, is %d", last_msg.msg.user_data.contents[50]); - ck_assert_msg(last_msg.msg.user_data.contents[51] == 148, "incorrect value for last_msg.msg.user_data.contents[51], expected 148, is %d", last_msg.msg.user_data.contents[51]); - ck_assert_msg(last_msg.msg.user_data.contents[52] == 1, "incorrect value for last_msg.msg.user_data.contents[52], expected 1, is %d", last_msg.msg.user_data.contents[52]); - ck_assert_msg(last_msg.msg.user_data.contents[53] == 99, "incorrect value for last_msg.msg.user_data.contents[53], expected 99, is %d", last_msg.msg.user_data.contents[53]); - ck_assert_msg(last_msg.msg.user_data.contents[54] == 112, "incorrect value for last_msg.msg.user_data.contents[54], expected 112, is %d", last_msg.msg.user_data.contents[54]); - ck_assert_msg(last_msg.msg.user_data.contents[55] == 88, "incorrect value for last_msg.msg.user_data.contents[55], expected 88, is %d", last_msg.msg.user_data.contents[55]); - ck_assert_msg(last_msg.msg.user_data.contents[56] == 217, "incorrect value for last_msg.msg.user_data.contents[56], expected 217, is %d", last_msg.msg.user_data.contents[56]); - ck_assert_msg(last_msg.msg.user_data.contents[57] == 36, "incorrect value for last_msg.msg.user_data.contents[57], expected 36, is %d", last_msg.msg.user_data.contents[57]); - ck_assert_msg(last_msg.msg.user_data.contents[58] == 84, "incorrect value for last_msg.msg.user_data.contents[58], expected 84, is %d", last_msg.msg.user_data.contents[58]); - ck_assert_msg(last_msg.msg.user_data.contents[59] == 34, "incorrect value for last_msg.msg.user_data.contents[59], expected 34, is %d", last_msg.msg.user_data.contents[59]); - ck_assert_msg(last_msg.msg.user_data.contents[60] == 234, "incorrect value for last_msg.msg.user_data.contents[60], expected 234, is %d", last_msg.msg.user_data.contents[60]); - ck_assert_msg(last_msg.msg.user_data.contents[61] == 82, "incorrect value for last_msg.msg.user_data.contents[61], expected 82, is %d", last_msg.msg.user_data.contents[61]); - ck_assert_msg(last_msg.msg.user_data.contents[62] == 144, "incorrect value for last_msg.msg.user_data.contents[62], expected 144, is %d", last_msg.msg.user_data.contents[62]); - ck_assert_msg(last_msg.msg.user_data.contents[63] == 144, "incorrect value for last_msg.msg.user_data.contents[63], expected 144, is %d", last_msg.msg.user_data.contents[63]); - ck_assert_msg(last_msg.msg.user_data.contents[64] == 97, "incorrect value for last_msg.msg.user_data.contents[64], expected 97, is %d", last_msg.msg.user_data.contents[64]); - ck_assert_msg(last_msg.msg.user_data.contents[65] == 96, "incorrect value for last_msg.msg.user_data.contents[65], expected 96, is %d", last_msg.msg.user_data.contents[65]); - ck_assert_msg(last_msg.msg.user_data.contents[66] == 75, "incorrect value for last_msg.msg.user_data.contents[66], expected 75, is %d", last_msg.msg.user_data.contents[66]); - ck_assert_msg(last_msg.msg.user_data.contents[67] == 174, "incorrect value for last_msg.msg.user_data.contents[67], expected 174, is %d", last_msg.msg.user_data.contents[67]); - ck_assert_msg(last_msg.msg.user_data.contents[68] == 58, "incorrect value for last_msg.msg.user_data.contents[68], expected 58, is %d", last_msg.msg.user_data.contents[68]); - ck_assert_msg(last_msg.msg.user_data.contents[69] == 219, "incorrect value for last_msg.msg.user_data.contents[69], expected 219, is %d", last_msg.msg.user_data.contents[69]); - ck_assert_msg(last_msg.msg.user_data.contents[70] == 180, "incorrect value for last_msg.msg.user_data.contents[70], expected 180, is %d", last_msg.msg.user_data.contents[70]); - ck_assert_msg(last_msg.msg.user_data.contents[71] == 148, "incorrect value for last_msg.msg.user_data.contents[71], expected 148, is %d", last_msg.msg.user_data.contents[71]); - ck_assert_msg(last_msg.msg.user_data.contents[72] == 247, "incorrect value for last_msg.msg.user_data.contents[72], expected 247, is %d", last_msg.msg.user_data.contents[72]); - ck_assert_msg(last_msg.msg.user_data.contents[73] == 59, "incorrect value for last_msg.msg.user_data.contents[73], expected 59, is %d", last_msg.msg.user_data.contents[73]); - ck_assert_msg(last_msg.msg.user_data.contents[74] == 2, "incorrect value for last_msg.msg.user_data.contents[74], expected 2, is %d", last_msg.msg.user_data.contents[74]); - ck_assert_msg(last_msg.msg.user_data.contents[75] == 116, "incorrect value for last_msg.msg.user_data.contents[75], expected 116, is %d", last_msg.msg.user_data.contents[75]); - ck_assert_msg(last_msg.msg.user_data.contents[76] == 214, "incorrect value for last_msg.msg.user_data.contents[76], expected 214, is %d", last_msg.msg.user_data.contents[76]); - ck_assert_msg(last_msg.msg.user_data.contents[77] == 114, "incorrect value for last_msg.msg.user_data.contents[77], expected 114, is %d", last_msg.msg.user_data.contents[77]); - ck_assert_msg(last_msg.msg.user_data.contents[78] == 55, "incorrect value for last_msg.msg.user_data.contents[78], expected 55, is %d", last_msg.msg.user_data.contents[78]); - ck_assert_msg(last_msg.msg.user_data.contents[79] == 134, "incorrect value for last_msg.msg.user_data.contents[79], expected 134, is %d", last_msg.msg.user_data.contents[79]); - ck_assert_msg(last_msg.msg.user_data.contents[80] == 54, "incorrect value for last_msg.msg.user_data.contents[80], expected 54, is %d", last_msg.msg.user_data.contents[80]); - ck_assert_msg(last_msg.msg.user_data.contents[81] == 119, "incorrect value for last_msg.msg.user_data.contents[81], expected 119, is %d", last_msg.msg.user_data.contents[81]); - ck_assert_msg(last_msg.msg.user_data.contents[82] == 108, "incorrect value for last_msg.msg.user_data.contents[82], expected 108, is %d", last_msg.msg.user_data.contents[82]); - ck_assert_msg(last_msg.msg.user_data.contents[83] == 128, "incorrect value for last_msg.msg.user_data.contents[83], expected 128, is %d", last_msg.msg.user_data.contents[83]); - ck_assert_msg(last_msg.msg.user_data.contents[84] == 73, "incorrect value for last_msg.msg.user_data.contents[84], expected 73, is %d", last_msg.msg.user_data.contents[84]); - ck_assert_msg(last_msg.msg.user_data.contents[85] == 181, "incorrect value for last_msg.msg.user_data.contents[85], expected 181, is %d", last_msg.msg.user_data.contents[85]); - ck_assert_msg(last_msg.msg.user_data.contents[86] == 20, "incorrect value for last_msg.msg.user_data.contents[86], expected 20, is %d", last_msg.msg.user_data.contents[86]); - ck_assert_msg(last_msg.msg.user_data.contents[87] == 233, "incorrect value for last_msg.msg.user_data.contents[87], expected 233, is %d", last_msg.msg.user_data.contents[87]); - ck_assert_msg(last_msg.msg.user_data.contents[88] == 23, "incorrect value for last_msg.msg.user_data.contents[88], expected 23, is %d", last_msg.msg.user_data.contents[88]); - ck_assert_msg(last_msg.msg.user_data.contents[89] == 23, "incorrect value for last_msg.msg.user_data.contents[89], expected 23, is %d", last_msg.msg.user_data.contents[89]); - ck_assert_msg(last_msg.msg.user_data.contents[90] == 73, "incorrect value for last_msg.msg.user_data.contents[90], expected 73, is %d", last_msg.msg.user_data.contents[90]); - ck_assert_msg(last_msg.msg.user_data.contents[91] == 119, "incorrect value for last_msg.msg.user_data.contents[91], expected 119, is %d", last_msg.msg.user_data.contents[91]); - ck_assert_msg(last_msg.msg.user_data.contents[92] == 136, "incorrect value for last_msg.msg.user_data.contents[92], expected 136, is %d", last_msg.msg.user_data.contents[92]); - ck_assert_msg(last_msg.msg.user_data.contents[93] == 231, "incorrect value for last_msg.msg.user_data.contents[93], expected 231, is %d", last_msg.msg.user_data.contents[93]); - ck_assert_msg(last_msg.msg.user_data.contents[94] == 189, "incorrect value for last_msg.msg.user_data.contents[94], expected 189, is %d", last_msg.msg.user_data.contents[94]); - ck_assert_msg(last_msg.msg.user_data.contents[95] == 26, "incorrect value for last_msg.msg.user_data.contents[95], expected 26, is %d", last_msg.msg.user_data.contents[95]); - ck_assert_msg(last_msg.msg.user_data.contents[96] == 174, "incorrect value for last_msg.msg.user_data.contents[96], expected 174, is %d", last_msg.msg.user_data.contents[96]); - ck_assert_msg(last_msg.msg.user_data.contents[97] == 128, "incorrect value for last_msg.msg.user_data.contents[97], expected 128, is %d", last_msg.msg.user_data.contents[97]); - ck_assert_msg(last_msg.msg.user_data.contents[98] == 93, "incorrect value for last_msg.msg.user_data.contents[98], expected 93, is %d", last_msg.msg.user_data.contents[98]); - ck_assert_msg(last_msg.msg.user_data.contents[99] == 30, "incorrect value for last_msg.msg.user_data.contents[99], expected 30, is %d", last_msg.msg.user_data.contents[99]); - ck_assert_msg(last_msg.msg.user_data.contents[100] == 76, "incorrect value for last_msg.msg.user_data.contents[100], expected 76, is %d", last_msg.msg.user_data.contents[100]); - ck_assert_msg(last_msg.msg.user_data.contents[101] == 45, "incorrect value for last_msg.msg.user_data.contents[101], expected 45, is %d", last_msg.msg.user_data.contents[101]); - ck_assert_msg(last_msg.msg.user_data.contents[102] == 109, "incorrect value for last_msg.msg.user_data.contents[102], expected 109, is %d", last_msg.msg.user_data.contents[102]); - ck_assert_msg(last_msg.msg.user_data.contents[103] == 134, "incorrect value for last_msg.msg.user_data.contents[103], expected 134, is %d", last_msg.msg.user_data.contents[103]); - ck_assert_msg(last_msg.msg.user_data.contents[104] == 81, "incorrect value for last_msg.msg.user_data.contents[104], expected 81, is %d", last_msg.msg.user_data.contents[104]); - ck_assert_msg(last_msg.msg.user_data.contents[105] == 0, "incorrect value for last_msg.msg.user_data.contents[105], expected 0, is %d", last_msg.msg.user_data.contents[105]); - ck_assert_msg(last_msg.msg.user_data.contents[106] == 116, "incorrect value for last_msg.msg.user_data.contents[106], expected 116, is %d", last_msg.msg.user_data.contents[106]); - ck_assert_msg(last_msg.msg.user_data.contents[107] == 158, "incorrect value for last_msg.msg.user_data.contents[107], expected 158, is %d", last_msg.msg.user_data.contents[107]); - ck_assert_msg(last_msg.msg.user_data.contents[108] == 127, "incorrect value for last_msg.msg.user_data.contents[108], expected 127, is %d", last_msg.msg.user_data.contents[108]); - ck_assert_msg(last_msg.msg.user_data.contents[109] == 40, "incorrect value for last_msg.msg.user_data.contents[109], expected 40, is %d", last_msg.msg.user_data.contents[109]); - ck_assert_msg(last_msg.msg.user_data.contents[110] == 133, "incorrect value for last_msg.msg.user_data.contents[110], expected 133, is %d", last_msg.msg.user_data.contents[110]); - ck_assert_msg(last_msg.msg.user_data.contents[111] == 208, "incorrect value for last_msg.msg.user_data.contents[111], expected 208, is %d", last_msg.msg.user_data.contents[111]); - ck_assert_msg(last_msg.msg.user_data.contents[112] == 134, "incorrect value for last_msg.msg.user_data.contents[112], expected 134, is %d", last_msg.msg.user_data.contents[112]); - ck_assert_msg(last_msg.msg.user_data.contents[113] == 127, "incorrect value for last_msg.msg.user_data.contents[113], expected 127, is %d", last_msg.msg.user_data.contents[113]); - ck_assert_msg(last_msg.msg.user_data.contents[114] == 140, "incorrect value for last_msg.msg.user_data.contents[114], expected 140, is %d", last_msg.msg.user_data.contents[114]); - ck_assert_msg(last_msg.msg.user_data.contents[115] == 232, "incorrect value for last_msg.msg.user_data.contents[115], expected 232, is %d", last_msg.msg.user_data.contents[115]); - ck_assert_msg(last_msg.msg.user_data.contents[116] == 183, "incorrect value for last_msg.msg.user_data.contents[116], expected 183, is %d", last_msg.msg.user_data.contents[116]); - ck_assert_msg(last_msg.msg.user_data.contents[117] == 184, "incorrect value for last_msg.msg.user_data.contents[117], expected 184, is %d", last_msg.msg.user_data.contents[117]); - ck_assert_msg(last_msg.msg.user_data.contents[118] == 108, "incorrect value for last_msg.msg.user_data.contents[118], expected 108, is %d", last_msg.msg.user_data.contents[118]); - ck_assert_msg(last_msg.msg.user_data.contents[119] == 6, "incorrect value for last_msg.msg.user_data.contents[119], expected 6, is %d", last_msg.msg.user_data.contents[119]); - ck_assert_msg(last_msg.msg.user_data.contents[120] == 228, "incorrect value for last_msg.msg.user_data.contents[120], expected 228, is %d", last_msg.msg.user_data.contents[120]); - ck_assert_msg(last_msg.msg.user_data.contents[121] == 54, "incorrect value for last_msg.msg.user_data.contents[121], expected 54, is %d", last_msg.msg.user_data.contents[121]); - ck_assert_msg(last_msg.msg.user_data.contents[122] == 238, "incorrect value for last_msg.msg.user_data.contents[122], expected 238, is %d", last_msg.msg.user_data.contents[122]); - ck_assert_msg(last_msg.msg.user_data.contents[123] == 59, "incorrect value for last_msg.msg.user_data.contents[123], expected 59, is %d", last_msg.msg.user_data.contents[123]); - ck_assert_msg(last_msg.msg.user_data.contents[124] == 220, "incorrect value for last_msg.msg.user_data.contents[124], expected 220, is %d", last_msg.msg.user_data.contents[124]); - ck_assert_msg(last_msg.msg.user_data.contents[125] == 30, "incorrect value for last_msg.msg.user_data.contents[125], expected 30, is %d", last_msg.msg.user_data.contents[125]); - ck_assert_msg(last_msg.msg.user_data.contents[126] == 228, "incorrect value for last_msg.msg.user_data.contents[126], expected 228, is %d", last_msg.msg.user_data.contents[126]); - ck_assert_msg(last_msg.msg.user_data.contents[127] == 212, "incorrect value for last_msg.msg.user_data.contents[127], expected 212, is %d", last_msg.msg.user_data.contents[127]); - ck_assert_msg(last_msg.msg.user_data.contents[128] == 50, "incorrect value for last_msg.msg.user_data.contents[128], expected 50, is %d", last_msg.msg.user_data.contents[128]); - ck_assert_msg(last_msg.msg.user_data.contents[129] == 182, "incorrect value for last_msg.msg.user_data.contents[129], expected 182, is %d", last_msg.msg.user_data.contents[129]); - ck_assert_msg(last_msg.msg.user_data.contents[130] == 97, "incorrect value for last_msg.msg.user_data.contents[130], expected 97, is %d", last_msg.msg.user_data.contents[130]); - ck_assert_msg(last_msg.msg.user_data.contents[131] == 20, "incorrect value for last_msg.msg.user_data.contents[131], expected 20, is %d", last_msg.msg.user_data.contents[131]); - ck_assert_msg(last_msg.msg.user_data.contents[132] == 41, "incorrect value for last_msg.msg.user_data.contents[132], expected 41, is %d", last_msg.msg.user_data.contents[132]); - ck_assert_msg(last_msg.msg.user_data.contents[133] == 76, "incorrect value for last_msg.msg.user_data.contents[133], expected 76, is %d", last_msg.msg.user_data.contents[133]); - ck_assert_msg(last_msg.msg.user_data.contents[134] == 227, "incorrect value for last_msg.msg.user_data.contents[134], expected 227, is %d", last_msg.msg.user_data.contents[134]); - ck_assert_msg(last_msg.msg.user_data.contents[135] == 88, "incorrect value for last_msg.msg.user_data.contents[135], expected 88, is %d", last_msg.msg.user_data.contents[135]); - ck_assert_msg(last_msg.msg.user_data.contents[136] == 12, "incorrect value for last_msg.msg.user_data.contents[136], expected 12, is %d", last_msg.msg.user_data.contents[136]); - ck_assert_msg(last_msg.msg.user_data.contents[137] == 95, "incorrect value for last_msg.msg.user_data.contents[137], expected 95, is %d", last_msg.msg.user_data.contents[137]); - ck_assert_msg(last_msg.msg.user_data.contents[138] == 112, "incorrect value for last_msg.msg.user_data.contents[138], expected 112, is %d", last_msg.msg.user_data.contents[138]); - ck_assert_msg(last_msg.msg.user_data.contents[139] == 209, "incorrect value for last_msg.msg.user_data.contents[139], expected 209, is %d", last_msg.msg.user_data.contents[139]); - ck_assert_msg(last_msg.msg.user_data.contents[140] == 183, "incorrect value for last_msg.msg.user_data.contents[140], expected 183, is %d", last_msg.msg.user_data.contents[140]); - ck_assert_msg(last_msg.msg.user_data.contents[141] == 127, "incorrect value for last_msg.msg.user_data.contents[141], expected 127, is %d", last_msg.msg.user_data.contents[141]); - ck_assert_msg(last_msg.msg.user_data.contents[142] == 4, "incorrect value for last_msg.msg.user_data.contents[142], expected 4, is %d", last_msg.msg.user_data.contents[142]); - ck_assert_msg(last_msg.msg.user_data.contents[143] == 165, "incorrect value for last_msg.msg.user_data.contents[143], expected 165, is %d", last_msg.msg.user_data.contents[143]); - ck_assert_msg(last_msg.msg.user_data.contents[144] == 189, "incorrect value for last_msg.msg.user_data.contents[144], expected 189, is %d", last_msg.msg.user_data.contents[144]); - ck_assert_msg(last_msg.msg.user_data.contents[145] == 44, "incorrect value for last_msg.msg.user_data.contents[145], expected 44, is %d", last_msg.msg.user_data.contents[145]); - ck_assert_msg(last_msg.msg.user_data.contents[146] == 239, "incorrect value for last_msg.msg.user_data.contents[146], expected 239, is %d", last_msg.msg.user_data.contents[146]); - ck_assert_msg(last_msg.msg.user_data.contents[147] == 232, "incorrect value for last_msg.msg.user_data.contents[147], expected 232, is %d", last_msg.msg.user_data.contents[147]); - ck_assert_msg(last_msg.msg.user_data.contents[148] == 132, "incorrect value for last_msg.msg.user_data.contents[148], expected 132, is %d", last_msg.msg.user_data.contents[148]); - ck_assert_msg(last_msg.msg.user_data.contents[149] == 9, "incorrect value for last_msg.msg.user_data.contents[149], expected 9, is %d", last_msg.msg.user_data.contents[149]); - ck_assert_msg(last_msg.msg.user_data.contents[150] == 114, "incorrect value for last_msg.msg.user_data.contents[150], expected 114, is %d", last_msg.msg.user_data.contents[150]); - ck_assert_msg(last_msg.msg.user_data.contents[151] == 184, "incorrect value for last_msg.msg.user_data.contents[151], expected 184, is %d", last_msg.msg.user_data.contents[151]); - ck_assert_msg(last_msg.msg.user_data.contents[152] == 249, "incorrect value for last_msg.msg.user_data.contents[152], expected 249, is %d", last_msg.msg.user_data.contents[152]); - ck_assert_msg(last_msg.msg.user_data.contents[153] == 208, "incorrect value for last_msg.msg.user_data.contents[153], expected 208, is %d", last_msg.msg.user_data.contents[153]); - ck_assert_msg(last_msg.msg.user_data.contents[154] == 246, "incorrect value for last_msg.msg.user_data.contents[154], expected 246, is %d", last_msg.msg.user_data.contents[154]); - ck_assert_msg(last_msg.msg.user_data.contents[155] == 194, "incorrect value for last_msg.msg.user_data.contents[155], expected 194, is %d", last_msg.msg.user_data.contents[155]); - ck_assert_msg(last_msg.msg.user_data.contents[156] == 250, "incorrect value for last_msg.msg.user_data.contents[156], expected 250, is %d", last_msg.msg.user_data.contents[156]); - ck_assert_msg(last_msg.msg.user_data.contents[157] == 2, "incorrect value for last_msg.msg.user_data.contents[157], expected 2, is %d", last_msg.msg.user_data.contents[157]); - ck_assert_msg(last_msg.msg.user_data.contents[158] == 97, "incorrect value for last_msg.msg.user_data.contents[158], expected 97, is %d", last_msg.msg.user_data.contents[158]); - ck_assert_msg(last_msg.msg.user_data.contents[159] == 173, "incorrect value for last_msg.msg.user_data.contents[159], expected 173, is %d", last_msg.msg.user_data.contents[159]); - ck_assert_msg(last_msg.msg.user_data.contents[160] == 157, "incorrect value for last_msg.msg.user_data.contents[160], expected 157, is %d", last_msg.msg.user_data.contents[160]); - ck_assert_msg(last_msg.msg.user_data.contents[161] == 202, "incorrect value for last_msg.msg.user_data.contents[161], expected 202, is %d", last_msg.msg.user_data.contents[161]); - ck_assert_msg(last_msg.msg.user_data.contents[162] == 172, "incorrect value for last_msg.msg.user_data.contents[162], expected 172, is %d", last_msg.msg.user_data.contents[162]); - ck_assert_msg(last_msg.msg.user_data.contents[163] == 180, "incorrect value for last_msg.msg.user_data.contents[163], expected 180, is %d", last_msg.msg.user_data.contents[163]); - ck_assert_msg(last_msg.msg.user_data.contents[164] == 150, "incorrect value for last_msg.msg.user_data.contents[164], expected 150, is %d", last_msg.msg.user_data.contents[164]); - ck_assert_msg(last_msg.msg.user_data.contents[165] == 213, "incorrect value for last_msg.msg.user_data.contents[165], expected 213, is %d", last_msg.msg.user_data.contents[165]); - ck_assert_msg(last_msg.msg.user_data.contents[166] == 193, "incorrect value for last_msg.msg.user_data.contents[166], expected 193, is %d", last_msg.msg.user_data.contents[166]); - ck_assert_msg(last_msg.msg.user_data.contents[167] == 177, "incorrect value for last_msg.msg.user_data.contents[167], expected 177, is %d", last_msg.msg.user_data.contents[167]); - ck_assert_msg(last_msg.msg.user_data.contents[168] == 209, "incorrect value for last_msg.msg.user_data.contents[168], expected 209, is %d", last_msg.msg.user_data.contents[168]); - ck_assert_msg(last_msg.msg.user_data.contents[169] == 156, "incorrect value for last_msg.msg.user_data.contents[169], expected 156, is %d", last_msg.msg.user_data.contents[169]); - ck_assert_msg(last_msg.msg.user_data.contents[170] == 20, "incorrect value for last_msg.msg.user_data.contents[170], expected 20, is %d", last_msg.msg.user_data.contents[170]); - ck_assert_msg(last_msg.msg.user_data.contents[171] == 174, "incorrect value for last_msg.msg.user_data.contents[171], expected 174, is %d", last_msg.msg.user_data.contents[171]); - ck_assert_msg(last_msg.msg.user_data.contents[172] == 18, "incorrect value for last_msg.msg.user_data.contents[172], expected 18, is %d", last_msg.msg.user_data.contents[172]); - ck_assert_msg(last_msg.msg.user_data.contents[173] == 73, "incorrect value for last_msg.msg.user_data.contents[173], expected 73, is %d", last_msg.msg.user_data.contents[173]); - ck_assert_msg(last_msg.msg.user_data.contents[174] == 132, "incorrect value for last_msg.msg.user_data.contents[174], expected 132, is %d", last_msg.msg.user_data.contents[174]); - ck_assert_msg(last_msg.msg.user_data.contents[175] == 215, "incorrect value for last_msg.msg.user_data.contents[175], expected 215, is %d", last_msg.msg.user_data.contents[175]); - ck_assert_msg(last_msg.msg.user_data.contents[176] == 115, "incorrect value for last_msg.msg.user_data.contents[176], expected 115, is %d", last_msg.msg.user_data.contents[176]); - ck_assert_msg(last_msg.msg.user_data.contents[177] == 128, "incorrect value for last_msg.msg.user_data.contents[177], expected 128, is %d", last_msg.msg.user_data.contents[177]); - ck_assert_msg(last_msg.msg.user_data.contents[178] == 175, "incorrect value for last_msg.msg.user_data.contents[178], expected 175, is %d", last_msg.msg.user_data.contents[178]); - ck_assert_msg(last_msg.msg.user_data.contents[179] == 169, "incorrect value for last_msg.msg.user_data.contents[179], expected 169, is %d", last_msg.msg.user_data.contents[179]); - ck_assert_msg(last_msg.msg.user_data.contents[180] == 116, "incorrect value for last_msg.msg.user_data.contents[180], expected 116, is %d", last_msg.msg.user_data.contents[180]); - ck_assert_msg(last_msg.msg.user_data.contents[181] == 132, "incorrect value for last_msg.msg.user_data.contents[181], expected 132, is %d", last_msg.msg.user_data.contents[181]); - ck_assert_msg(last_msg.msg.user_data.contents[182] == 100, "incorrect value for last_msg.msg.user_data.contents[182], expected 100, is %d", last_msg.msg.user_data.contents[182]); - ck_assert_msg(last_msg.msg.user_data.contents[183] == 72, "incorrect value for last_msg.msg.user_data.contents[183], expected 72, is %d", last_msg.msg.user_data.contents[183]); - ck_assert_msg(last_msg.msg.user_data.contents[184] == 45, "incorrect value for last_msg.msg.user_data.contents[184], expected 45, is %d", last_msg.msg.user_data.contents[184]); - ck_assert_msg(last_msg.msg.user_data.contents[185] == 25, "incorrect value for last_msg.msg.user_data.contents[185], expected 25, is %d", last_msg.msg.user_data.contents[185]); - ck_assert_msg(last_msg.msg.user_data.contents[186] == 14, "incorrect value for last_msg.msg.user_data.contents[186], expected 14, is %d", last_msg.msg.user_data.contents[186]); - ck_assert_msg(last_msg.msg.user_data.contents[187] == 205, "incorrect value for last_msg.msg.user_data.contents[187], expected 205, is %d", last_msg.msg.user_data.contents[187]); - ck_assert_msg(last_msg.msg.user_data.contents[188] == 213, "incorrect value for last_msg.msg.user_data.contents[188], expected 213, is %d", last_msg.msg.user_data.contents[188]); - ck_assert_msg(last_msg.msg.user_data.contents[189] == 145, "incorrect value for last_msg.msg.user_data.contents[189], expected 145, is %d", last_msg.msg.user_data.contents[189]); - ck_assert_msg(last_msg.msg.user_data.contents[190] == 68, "incorrect value for last_msg.msg.user_data.contents[190], expected 68, is %d", last_msg.msg.user_data.contents[190]); - ck_assert_msg(last_msg.msg.user_data.contents[191] == 137, "incorrect value for last_msg.msg.user_data.contents[191], expected 137, is %d", last_msg.msg.user_data.contents[191]); - ck_assert_msg(last_msg.msg.user_data.contents[192] == 249, "incorrect value for last_msg.msg.user_data.contents[192], expected 249, is %d", last_msg.msg.user_data.contents[192]); - ck_assert_msg(last_msg.msg.user_data.contents[193] == 54, "incorrect value for last_msg.msg.user_data.contents[193], expected 54, is %d", last_msg.msg.user_data.contents[193]); - ck_assert_msg(last_msg.msg.user_data.contents[194] == 40, "incorrect value for last_msg.msg.user_data.contents[194], expected 40, is %d", last_msg.msg.user_data.contents[194]); - ck_assert_msg(last_msg.msg.user_data.contents[195] == 174, "incorrect value for last_msg.msg.user_data.contents[195], expected 174, is %d", last_msg.msg.user_data.contents[195]); - ck_assert_msg(last_msg.msg.user_data.contents[196] == 215, "incorrect value for last_msg.msg.user_data.contents[196], expected 215, is %d", last_msg.msg.user_data.contents[196]); - ck_assert_msg(last_msg.msg.user_data.contents[197] == 148, "incorrect value for last_msg.msg.user_data.contents[197], expected 148, is %d", last_msg.msg.user_data.contents[197]); - ck_assert_msg(last_msg.msg.user_data.contents[198] == 166, "incorrect value for last_msg.msg.user_data.contents[198], expected 166, is %d", last_msg.msg.user_data.contents[198]); - ck_assert_msg(last_msg.msg.user_data.contents[199] == 190, "incorrect value for last_msg.msg.user_data.contents[199], expected 190, is %d", last_msg.msg.user_data.contents[199]); - ck_assert_msg(last_msg.msg.user_data.contents[200] == 63, "incorrect value for last_msg.msg.user_data.contents[200], expected 63, is %d", last_msg.msg.user_data.contents[200]); - ck_assert_msg(last_msg.msg.user_data.contents[201] == 118, "incorrect value for last_msg.msg.user_data.contents[201], expected 118, is %d", last_msg.msg.user_data.contents[201]); - ck_assert_msg(last_msg.msg.user_data.contents[202] == 6, "incorrect value for last_msg.msg.user_data.contents[202], expected 6, is %d", last_msg.msg.user_data.contents[202]); - ck_assert_msg(last_msg.msg.user_data.contents[203] == 165, "incorrect value for last_msg.msg.user_data.contents[203], expected 165, is %d", last_msg.msg.user_data.contents[203]); - ck_assert_msg(last_msg.msg.user_data.contents[204] == 212, "incorrect value for last_msg.msg.user_data.contents[204], expected 212, is %d", last_msg.msg.user_data.contents[204]); - ck_assert_msg(last_msg.msg.user_data.contents[205] == 74, "incorrect value for last_msg.msg.user_data.contents[205], expected 74, is %d", last_msg.msg.user_data.contents[205]); - ck_assert_msg(last_msg.msg.user_data.contents[206] == 68, "incorrect value for last_msg.msg.user_data.contents[206], expected 68, is %d", last_msg.msg.user_data.contents[206]); - ck_assert_msg(last_msg.msg.user_data.contents[207] == 200, "incorrect value for last_msg.msg.user_data.contents[207], expected 200, is %d", last_msg.msg.user_data.contents[207]); - ck_assert_msg(last_msg.msg.user_data.contents[208] == 38, "incorrect value for last_msg.msg.user_data.contents[208], expected 38, is %d", last_msg.msg.user_data.contents[208]); - ck_assert_msg(last_msg.msg.user_data.contents[209] == 139, "incorrect value for last_msg.msg.user_data.contents[209], expected 139, is %d", last_msg.msg.user_data.contents[209]); - ck_assert_msg(last_msg.msg.user_data.contents[210] == 212, "incorrect value for last_msg.msg.user_data.contents[210], expected 212, is %d", last_msg.msg.user_data.contents[210]); - ck_assert_msg(last_msg.msg.user_data.contents[211] == 112, "incorrect value for last_msg.msg.user_data.contents[211], expected 112, is %d", last_msg.msg.user_data.contents[211]); - ck_assert_msg(last_msg.msg.user_data.contents[212] == 45, "incorrect value for last_msg.msg.user_data.contents[212], expected 45, is %d", last_msg.msg.user_data.contents[212]); - ck_assert_msg(last_msg.msg.user_data.contents[213] == 167, "incorrect value for last_msg.msg.user_data.contents[213], expected 167, is %d", last_msg.msg.user_data.contents[213]); - ck_assert_msg(last_msg.msg.user_data.contents[214] == 236, "incorrect value for last_msg.msg.user_data.contents[214], expected 236, is %d", last_msg.msg.user_data.contents[214]); - ck_assert_msg(last_msg.msg.user_data.contents[215] == 255, "incorrect value for last_msg.msg.user_data.contents[215], expected 255, is %d", last_msg.msg.user_data.contents[215]); - ck_assert_msg(last_msg.msg.user_data.contents[216] == 106, "incorrect value for last_msg.msg.user_data.contents[216], expected 106, is %d", last_msg.msg.user_data.contents[216]); - ck_assert_msg(last_msg.msg.user_data.contents[217] == 92, "incorrect value for last_msg.msg.user_data.contents[217], expected 92, is %d", last_msg.msg.user_data.contents[217]); - ck_assert_msg(last_msg.msg.user_data.contents[218] == 132, "incorrect value for last_msg.msg.user_data.contents[218], expected 132, is %d", last_msg.msg.user_data.contents[218]); - ck_assert_msg(last_msg.msg.user_data.contents[219] == 59, "incorrect value for last_msg.msg.user_data.contents[219], expected 59, is %d", last_msg.msg.user_data.contents[219]); - ck_assert_msg(last_msg.msg.user_data.contents[220] == 61, "incorrect value for last_msg.msg.user_data.contents[220], expected 61, is %d", last_msg.msg.user_data.contents[220]); - ck_assert_msg(last_msg.msg.user_data.contents[221] == 233, "incorrect value for last_msg.msg.user_data.contents[221], expected 233, is %d", last_msg.msg.user_data.contents[221]); - ck_assert_msg(last_msg.msg.user_data.contents[222] == 3, "incorrect value for last_msg.msg.user_data.contents[222], expected 3, is %d", last_msg.msg.user_data.contents[222]); - ck_assert_msg(last_msg.msg.user_data.contents[223] == 246, "incorrect value for last_msg.msg.user_data.contents[223], expected 246, is %d", last_msg.msg.user_data.contents[223]); - ck_assert_msg(last_msg.msg.user_data.contents[224] == 158, "incorrect value for last_msg.msg.user_data.contents[224], expected 158, is %d", last_msg.msg.user_data.contents[224]); - ck_assert_msg(last_msg.msg.user_data.contents[225] == 83, "incorrect value for last_msg.msg.user_data.contents[225], expected 83, is %d", last_msg.msg.user_data.contents[225]); - ck_assert_msg(last_msg.msg.user_data.contents[226] == 134, "incorrect value for last_msg.msg.user_data.contents[226], expected 134, is %d", last_msg.msg.user_data.contents[226]); - ck_assert_msg(last_msg.msg.user_data.contents[227] == 246, "incorrect value for last_msg.msg.user_data.contents[227], expected 246, is %d", last_msg.msg.user_data.contents[227]); - ck_assert_msg(last_msg.msg.user_data.contents[228] == 154, "incorrect value for last_msg.msg.user_data.contents[228], expected 154, is %d", last_msg.msg.user_data.contents[228]); - ck_assert_msg(last_msg.msg.user_data.contents[229] == 17, "incorrect value for last_msg.msg.user_data.contents[229], expected 17, is %d", last_msg.msg.user_data.contents[229]); - ck_assert_msg(last_msg.msg.user_data.contents[230] == 0, "incorrect value for last_msg.msg.user_data.contents[230], expected 0, is %d", last_msg.msg.user_data.contents[230]); - ck_assert_msg(last_msg.msg.user_data.contents[231] == 6, "incorrect value for last_msg.msg.user_data.contents[231], expected 6, is %d", last_msg.msg.user_data.contents[231]); - ck_assert_msg(last_msg.msg.user_data.contents[232] == 56, "incorrect value for last_msg.msg.user_data.contents[232], expected 56, is %d", last_msg.msg.user_data.contents[232]); - ck_assert_msg(last_msg.msg.user_data.contents[233] == 216, "incorrect value for last_msg.msg.user_data.contents[233], expected 216, is %d", last_msg.msg.user_data.contents[233]); - ck_assert_msg(last_msg.msg.user_data.contents[234] == 19, "incorrect value for last_msg.msg.user_data.contents[234], expected 19, is %d", last_msg.msg.user_data.contents[234]); - ck_assert_msg(last_msg.msg.user_data.contents[235] == 216, "incorrect value for last_msg.msg.user_data.contents[235], expected 216, is %d", last_msg.msg.user_data.contents[235]); - ck_assert_msg(last_msg.msg.user_data.contents[236] == 70, "incorrect value for last_msg.msg.user_data.contents[236], expected 70, is %d", last_msg.msg.user_data.contents[236]); - ck_assert_msg(last_msg.msg.user_data.contents[237] == 71, "incorrect value for last_msg.msg.user_data.contents[237], expected 71, is %d", last_msg.msg.user_data.contents[237]); - ck_assert_msg(last_msg.msg.user_data.contents[238] == 161, "incorrect value for last_msg.msg.user_data.contents[238], expected 161, is %d", last_msg.msg.user_data.contents[238]); - ck_assert_msg(last_msg.msg.user_data.contents[239] == 184, "incorrect value for last_msg.msg.user_data.contents[239], expected 184, is %d", last_msg.msg.user_data.contents[239]); - ck_assert_msg(last_msg.msg.user_data.contents[240] == 5, "incorrect value for last_msg.msg.user_data.contents[240], expected 5, is %d", last_msg.msg.user_data.contents[240]); - ck_assert_msg(last_msg.msg.user_data.contents[241] == 177, "incorrect value for last_msg.msg.user_data.contents[241], expected 177, is %d", last_msg.msg.user_data.contents[241]); - ck_assert_msg(last_msg.msg.user_data.contents[242] == 45, "incorrect value for last_msg.msg.user_data.contents[242], expected 45, is %d", last_msg.msg.user_data.contents[242]); - ck_assert_msg(last_msg.msg.user_data.contents[243] == 37, "incorrect value for last_msg.msg.user_data.contents[243], expected 37, is %d", last_msg.msg.user_data.contents[243]); - ck_assert_msg(last_msg.msg.user_data.contents[244] == 98, "incorrect value for last_msg.msg.user_data.contents[244], expected 98, is %d", last_msg.msg.user_data.contents[244]); - ck_assert_msg(last_msg.msg.user_data.contents[245] == 56, "incorrect value for last_msg.msg.user_data.contents[245], expected 56, is %d", last_msg.msg.user_data.contents[245]); - ck_assert_msg(last_msg.msg.user_data.contents[246] == 149, "incorrect value for last_msg.msg.user_data.contents[246], expected 149, is %d", last_msg.msg.user_data.contents[246]); - ck_assert_msg(last_msg.msg.user_data.contents[247] == 0, "incorrect value for last_msg.msg.user_data.contents[247], expected 0, is %d", last_msg.msg.user_data.contents[247]); - ck_assert_msg(last_msg.msg.user_data.contents[248] == 73, "incorrect value for last_msg.msg.user_data.contents[248], expected 73, is %d", last_msg.msg.user_data.contents[248]); - ck_assert_msg(last_msg.msg.user_data.contents[249] == 221, "incorrect value for last_msg.msg.user_data.contents[249], expected 221, is %d", last_msg.msg.user_data.contents[249]); - ck_assert_msg(last_msg.msg.user_data.contents[250] == 105, "incorrect value for last_msg.msg.user_data.contents[250], expected 105, is %d", last_msg.msg.user_data.contents[250]); - ck_assert_msg(last_msg.msg.user_data.contents[251] == 239, "incorrect value for last_msg.msg.user_data.contents[251], expected 239, is %d", last_msg.msg.user_data.contents[251]); - ck_assert_msg(last_msg.msg.user_data.contents[252] == 168, "incorrect value for last_msg.msg.user_data.contents[252], expected 168, is %d", last_msg.msg.user_data.contents[252]); - ck_assert_msg(last_msg.msg.user_data.contents[253] == 205, "incorrect value for last_msg.msg.user_data.contents[253], expected 205, is %d", last_msg.msg.user_data.contents[253]); - ck_assert_msg(last_msg.msg.user_data.contents[254] == 85, "incorrect value for last_msg.msg.user_data.contents[254], expected 85, is %d", last_msg.msg.user_data.contents[254]); - - ck_assert_msg(last_msg.msg.user_data.n_contents == 255, "incorrect value for last_msg.msg.user_data.n_contents, expected 255, is %d", last_msg.msg.user_data.n_contents); + ck_assert_msg(last_msg.msg.user_data.contents[0] == 53, + "incorrect value for last_msg.msg.user_data.contents[0], " + "expected 53, is %d", + last_msg.msg.user_data.contents[0]); + ck_assert_msg(last_msg.msg.user_data.contents[1] == 5, + "incorrect value for last_msg.msg.user_data.contents[1], " + "expected 5, is %d", + last_msg.msg.user_data.contents[1]); + ck_assert_msg(last_msg.msg.user_data.contents[2] == 172, + "incorrect value for last_msg.msg.user_data.contents[2], " + "expected 172, is %d", + last_msg.msg.user_data.contents[2]); + ck_assert_msg(last_msg.msg.user_data.contents[3] == 138, + "incorrect value for last_msg.msg.user_data.contents[3], " + "expected 138, is %d", + last_msg.msg.user_data.contents[3]); + ck_assert_msg(last_msg.msg.user_data.contents[4] == 50, + "incorrect value for last_msg.msg.user_data.contents[4], " + "expected 50, is %d", + last_msg.msg.user_data.contents[4]); + ck_assert_msg(last_msg.msg.user_data.contents[5] == 49, + "incorrect value for last_msg.msg.user_data.contents[5], " + "expected 49, is %d", + last_msg.msg.user_data.contents[5]); + ck_assert_msg(last_msg.msg.user_data.contents[6] == 206, + "incorrect value for last_msg.msg.user_data.contents[6], " + "expected 206, is %d", + last_msg.msg.user_data.contents[6]); + ck_assert_msg(last_msg.msg.user_data.contents[7] == 234, + "incorrect value for last_msg.msg.user_data.contents[7], " + "expected 234, is %d", + last_msg.msg.user_data.contents[7]); + ck_assert_msg(last_msg.msg.user_data.contents[8] == 149, + "incorrect value for last_msg.msg.user_data.contents[8], " + "expected 149, is %d", + last_msg.msg.user_data.contents[8]); + ck_assert_msg(last_msg.msg.user_data.contents[9] == 204, + "incorrect value for last_msg.msg.user_data.contents[9], " + "expected 204, is %d", + last_msg.msg.user_data.contents[9]); + ck_assert_msg(last_msg.msg.user_data.contents[10] == 113, + "incorrect value for last_msg.msg.user_data.contents[10], " + "expected 113, is %d", + last_msg.msg.user_data.contents[10]); + ck_assert_msg(last_msg.msg.user_data.contents[11] == 31, + "incorrect value for last_msg.msg.user_data.contents[11], " + "expected 31, is %d", + last_msg.msg.user_data.contents[11]); + ck_assert_msg(last_msg.msg.user_data.contents[12] == 108, + "incorrect value for last_msg.msg.user_data.contents[12], " + "expected 108, is %d", + last_msg.msg.user_data.contents[12]); + ck_assert_msg(last_msg.msg.user_data.contents[13] == 188, + "incorrect value for last_msg.msg.user_data.contents[13], " + "expected 188, is %d", + last_msg.msg.user_data.contents[13]); + ck_assert_msg(last_msg.msg.user_data.contents[14] == 179, + "incorrect value for last_msg.msg.user_data.contents[14], " + "expected 179, is %d", + last_msg.msg.user_data.contents[14]); + ck_assert_msg(last_msg.msg.user_data.contents[15] == 154, + "incorrect value for last_msg.msg.user_data.contents[15], " + "expected 154, is %d", + last_msg.msg.user_data.contents[15]); + ck_assert_msg(last_msg.msg.user_data.contents[16] == 156, + "incorrect value for last_msg.msg.user_data.contents[16], " + "expected 156, is %d", + last_msg.msg.user_data.contents[16]); + ck_assert_msg(last_msg.msg.user_data.contents[17] == 167, + "incorrect value for last_msg.msg.user_data.contents[17], " + "expected 167, is %d", + last_msg.msg.user_data.contents[17]); + ck_assert_msg(last_msg.msg.user_data.contents[18] == 145, + "incorrect value for last_msg.msg.user_data.contents[18], " + "expected 145, is %d", + last_msg.msg.user_data.contents[18]); + ck_assert_msg(last_msg.msg.user_data.contents[19] == 139, + "incorrect value for last_msg.msg.user_data.contents[19], " + "expected 139, is %d", + last_msg.msg.user_data.contents[19]); + ck_assert_msg(last_msg.msg.user_data.contents[20] == 42, + "incorrect value for last_msg.msg.user_data.contents[20], " + "expected 42, is %d", + last_msg.msg.user_data.contents[20]); + ck_assert_msg(last_msg.msg.user_data.contents[21] == 207, + "incorrect value for last_msg.msg.user_data.contents[21], " + "expected 207, is %d", + last_msg.msg.user_data.contents[21]); + ck_assert_msg(last_msg.msg.user_data.contents[22] == 126, + "incorrect value for last_msg.msg.user_data.contents[22], " + "expected 126, is %d", + last_msg.msg.user_data.contents[22]); + ck_assert_msg(last_msg.msg.user_data.contents[23] == 242, + "incorrect value for last_msg.msg.user_data.contents[23], " + "expected 242, is %d", + last_msg.msg.user_data.contents[23]); + ck_assert_msg(last_msg.msg.user_data.contents[24] == 193, + "incorrect value for last_msg.msg.user_data.contents[24], " + "expected 193, is %d", + last_msg.msg.user_data.contents[24]); + ck_assert_msg(last_msg.msg.user_data.contents[25] == 9, + "incorrect value for last_msg.msg.user_data.contents[25], " + "expected 9, is %d", + last_msg.msg.user_data.contents[25]); + ck_assert_msg(last_msg.msg.user_data.contents[26] == 58, + "incorrect value for last_msg.msg.user_data.contents[26], " + "expected 58, is %d", + last_msg.msg.user_data.contents[26]); + ck_assert_msg(last_msg.msg.user_data.contents[27] == 75, + "incorrect value for last_msg.msg.user_data.contents[27], " + "expected 75, is %d", + last_msg.msg.user_data.contents[27]); + ck_assert_msg(last_msg.msg.user_data.contents[28] == 8, + "incorrect value for last_msg.msg.user_data.contents[28], " + "expected 8, is %d", + last_msg.msg.user_data.contents[28]); + ck_assert_msg(last_msg.msg.user_data.contents[29] == 135, + "incorrect value for last_msg.msg.user_data.contents[29], " + "expected 135, is %d", + last_msg.msg.user_data.contents[29]); + ck_assert_msg(last_msg.msg.user_data.contents[30] == 11, + "incorrect value for last_msg.msg.user_data.contents[30], " + "expected 11, is %d", + last_msg.msg.user_data.contents[30]); + ck_assert_msg(last_msg.msg.user_data.contents[31] == 92, + "incorrect value for last_msg.msg.user_data.contents[31], " + "expected 92, is %d", + last_msg.msg.user_data.contents[31]); + ck_assert_msg(last_msg.msg.user_data.contents[32] == 131, + "incorrect value for last_msg.msg.user_data.contents[32], " + "expected 131, is %d", + last_msg.msg.user_data.contents[32]); + ck_assert_msg(last_msg.msg.user_data.contents[33] == 245, + "incorrect value for last_msg.msg.user_data.contents[33], " + "expected 245, is %d", + last_msg.msg.user_data.contents[33]); + ck_assert_msg(last_msg.msg.user_data.contents[34] == 24, + "incorrect value for last_msg.msg.user_data.contents[34], " + "expected 24, is %d", + last_msg.msg.user_data.contents[34]); + ck_assert_msg(last_msg.msg.user_data.contents[35] == 90, + "incorrect value for last_msg.msg.user_data.contents[35], " + "expected 90, is %d", + last_msg.msg.user_data.contents[35]); + ck_assert_msg(last_msg.msg.user_data.contents[36] == 255, + "incorrect value for last_msg.msg.user_data.contents[36], " + "expected 255, is %d", + last_msg.msg.user_data.contents[36]); + ck_assert_msg(last_msg.msg.user_data.contents[37] == 30, + "incorrect value for last_msg.msg.user_data.contents[37], " + "expected 30, is %d", + last_msg.msg.user_data.contents[37]); + ck_assert_msg(last_msg.msg.user_data.contents[38] == 58, + "incorrect value for last_msg.msg.user_data.contents[38], " + "expected 58, is %d", + last_msg.msg.user_data.contents[38]); + ck_assert_msg(last_msg.msg.user_data.contents[39] == 31, + "incorrect value for last_msg.msg.user_data.contents[39], " + "expected 31, is %d", + last_msg.msg.user_data.contents[39]); + ck_assert_msg(last_msg.msg.user_data.contents[40] == 109, + "incorrect value for last_msg.msg.user_data.contents[40], " + "expected 109, is %d", + last_msg.msg.user_data.contents[40]); + ck_assert_msg(last_msg.msg.user_data.contents[41] == 148, + "incorrect value for last_msg.msg.user_data.contents[41], " + "expected 148, is %d", + last_msg.msg.user_data.contents[41]); + ck_assert_msg(last_msg.msg.user_data.contents[42] == 56, + "incorrect value for last_msg.msg.user_data.contents[42], " + "expected 56, is %d", + last_msg.msg.user_data.contents[42]); + ck_assert_msg(last_msg.msg.user_data.contents[43] == 178, + "incorrect value for last_msg.msg.user_data.contents[43], " + "expected 178, is %d", + last_msg.msg.user_data.contents[43]); + ck_assert_msg(last_msg.msg.user_data.contents[44] == 140, + "incorrect value for last_msg.msg.user_data.contents[44], " + "expected 140, is %d", + last_msg.msg.user_data.contents[44]); + ck_assert_msg(last_msg.msg.user_data.contents[45] == 30, + "incorrect value for last_msg.msg.user_data.contents[45], " + "expected 30, is %d", + last_msg.msg.user_data.contents[45]); + ck_assert_msg(last_msg.msg.user_data.contents[46] == 159, + "incorrect value for last_msg.msg.user_data.contents[46], " + "expected 159, is %d", + last_msg.msg.user_data.contents[46]); + ck_assert_msg(last_msg.msg.user_data.contents[47] == 70, + "incorrect value for last_msg.msg.user_data.contents[47], " + "expected 70, is %d", + last_msg.msg.user_data.contents[47]); + ck_assert_msg(last_msg.msg.user_data.contents[48] == 17, + "incorrect value for last_msg.msg.user_data.contents[48], " + "expected 17, is %d", + last_msg.msg.user_data.contents[48]); + ck_assert_msg(last_msg.msg.user_data.contents[49] == 170, + "incorrect value for last_msg.msg.user_data.contents[49], " + "expected 170, is %d", + last_msg.msg.user_data.contents[49]); + ck_assert_msg(last_msg.msg.user_data.contents[50] == 50, + "incorrect value for last_msg.msg.user_data.contents[50], " + "expected 50, is %d", + last_msg.msg.user_data.contents[50]); + ck_assert_msg(last_msg.msg.user_data.contents[51] == 148, + "incorrect value for last_msg.msg.user_data.contents[51], " + "expected 148, is %d", + last_msg.msg.user_data.contents[51]); + ck_assert_msg(last_msg.msg.user_data.contents[52] == 1, + "incorrect value for last_msg.msg.user_data.contents[52], " + "expected 1, is %d", + last_msg.msg.user_data.contents[52]); + ck_assert_msg(last_msg.msg.user_data.contents[53] == 99, + "incorrect value for last_msg.msg.user_data.contents[53], " + "expected 99, is %d", + last_msg.msg.user_data.contents[53]); + ck_assert_msg(last_msg.msg.user_data.contents[54] == 112, + "incorrect value for last_msg.msg.user_data.contents[54], " + "expected 112, is %d", + last_msg.msg.user_data.contents[54]); + ck_assert_msg(last_msg.msg.user_data.contents[55] == 88, + "incorrect value for last_msg.msg.user_data.contents[55], " + "expected 88, is %d", + last_msg.msg.user_data.contents[55]); + ck_assert_msg(last_msg.msg.user_data.contents[56] == 217, + "incorrect value for last_msg.msg.user_data.contents[56], " + "expected 217, is %d", + last_msg.msg.user_data.contents[56]); + ck_assert_msg(last_msg.msg.user_data.contents[57] == 36, + "incorrect value for last_msg.msg.user_data.contents[57], " + "expected 36, is %d", + last_msg.msg.user_data.contents[57]); + ck_assert_msg(last_msg.msg.user_data.contents[58] == 84, + "incorrect value for last_msg.msg.user_data.contents[58], " + "expected 84, is %d", + last_msg.msg.user_data.contents[58]); + ck_assert_msg(last_msg.msg.user_data.contents[59] == 34, + "incorrect value for last_msg.msg.user_data.contents[59], " + "expected 34, is %d", + last_msg.msg.user_data.contents[59]); + ck_assert_msg(last_msg.msg.user_data.contents[60] == 234, + "incorrect value for last_msg.msg.user_data.contents[60], " + "expected 234, is %d", + last_msg.msg.user_data.contents[60]); + ck_assert_msg(last_msg.msg.user_data.contents[61] == 82, + "incorrect value for last_msg.msg.user_data.contents[61], " + "expected 82, is %d", + last_msg.msg.user_data.contents[61]); + ck_assert_msg(last_msg.msg.user_data.contents[62] == 144, + "incorrect value for last_msg.msg.user_data.contents[62], " + "expected 144, is %d", + last_msg.msg.user_data.contents[62]); + ck_assert_msg(last_msg.msg.user_data.contents[63] == 144, + "incorrect value for last_msg.msg.user_data.contents[63], " + "expected 144, is %d", + last_msg.msg.user_data.contents[63]); + ck_assert_msg(last_msg.msg.user_data.contents[64] == 97, + "incorrect value for last_msg.msg.user_data.contents[64], " + "expected 97, is %d", + last_msg.msg.user_data.contents[64]); + ck_assert_msg(last_msg.msg.user_data.contents[65] == 96, + "incorrect value for last_msg.msg.user_data.contents[65], " + "expected 96, is %d", + last_msg.msg.user_data.contents[65]); + ck_assert_msg(last_msg.msg.user_data.contents[66] == 75, + "incorrect value for last_msg.msg.user_data.contents[66], " + "expected 75, is %d", + last_msg.msg.user_data.contents[66]); + ck_assert_msg(last_msg.msg.user_data.contents[67] == 174, + "incorrect value for last_msg.msg.user_data.contents[67], " + "expected 174, is %d", + last_msg.msg.user_data.contents[67]); + ck_assert_msg(last_msg.msg.user_data.contents[68] == 58, + "incorrect value for last_msg.msg.user_data.contents[68], " + "expected 58, is %d", + last_msg.msg.user_data.contents[68]); + ck_assert_msg(last_msg.msg.user_data.contents[69] == 219, + "incorrect value for last_msg.msg.user_data.contents[69], " + "expected 219, is %d", + last_msg.msg.user_data.contents[69]); + ck_assert_msg(last_msg.msg.user_data.contents[70] == 180, + "incorrect value for last_msg.msg.user_data.contents[70], " + "expected 180, is %d", + last_msg.msg.user_data.contents[70]); + ck_assert_msg(last_msg.msg.user_data.contents[71] == 148, + "incorrect value for last_msg.msg.user_data.contents[71], " + "expected 148, is %d", + last_msg.msg.user_data.contents[71]); + ck_assert_msg(last_msg.msg.user_data.contents[72] == 247, + "incorrect value for last_msg.msg.user_data.contents[72], " + "expected 247, is %d", + last_msg.msg.user_data.contents[72]); + ck_assert_msg(last_msg.msg.user_data.contents[73] == 59, + "incorrect value for last_msg.msg.user_data.contents[73], " + "expected 59, is %d", + last_msg.msg.user_data.contents[73]); + ck_assert_msg(last_msg.msg.user_data.contents[74] == 2, + "incorrect value for last_msg.msg.user_data.contents[74], " + "expected 2, is %d", + last_msg.msg.user_data.contents[74]); + ck_assert_msg(last_msg.msg.user_data.contents[75] == 116, + "incorrect value for last_msg.msg.user_data.contents[75], " + "expected 116, is %d", + last_msg.msg.user_data.contents[75]); + ck_assert_msg(last_msg.msg.user_data.contents[76] == 214, + "incorrect value for last_msg.msg.user_data.contents[76], " + "expected 214, is %d", + last_msg.msg.user_data.contents[76]); + ck_assert_msg(last_msg.msg.user_data.contents[77] == 114, + "incorrect value for last_msg.msg.user_data.contents[77], " + "expected 114, is %d", + last_msg.msg.user_data.contents[77]); + ck_assert_msg(last_msg.msg.user_data.contents[78] == 55, + "incorrect value for last_msg.msg.user_data.contents[78], " + "expected 55, is %d", + last_msg.msg.user_data.contents[78]); + ck_assert_msg(last_msg.msg.user_data.contents[79] == 134, + "incorrect value for last_msg.msg.user_data.contents[79], " + "expected 134, is %d", + last_msg.msg.user_data.contents[79]); + ck_assert_msg(last_msg.msg.user_data.contents[80] == 54, + "incorrect value for last_msg.msg.user_data.contents[80], " + "expected 54, is %d", + last_msg.msg.user_data.contents[80]); + ck_assert_msg(last_msg.msg.user_data.contents[81] == 119, + "incorrect value for last_msg.msg.user_data.contents[81], " + "expected 119, is %d", + last_msg.msg.user_data.contents[81]); + ck_assert_msg(last_msg.msg.user_data.contents[82] == 108, + "incorrect value for last_msg.msg.user_data.contents[82], " + "expected 108, is %d", + last_msg.msg.user_data.contents[82]); + ck_assert_msg(last_msg.msg.user_data.contents[83] == 128, + "incorrect value for last_msg.msg.user_data.contents[83], " + "expected 128, is %d", + last_msg.msg.user_data.contents[83]); + ck_assert_msg(last_msg.msg.user_data.contents[84] == 73, + "incorrect value for last_msg.msg.user_data.contents[84], " + "expected 73, is %d", + last_msg.msg.user_data.contents[84]); + ck_assert_msg(last_msg.msg.user_data.contents[85] == 181, + "incorrect value for last_msg.msg.user_data.contents[85], " + "expected 181, is %d", + last_msg.msg.user_data.contents[85]); + ck_assert_msg(last_msg.msg.user_data.contents[86] == 20, + "incorrect value for last_msg.msg.user_data.contents[86], " + "expected 20, is %d", + last_msg.msg.user_data.contents[86]); + ck_assert_msg(last_msg.msg.user_data.contents[87] == 233, + "incorrect value for last_msg.msg.user_data.contents[87], " + "expected 233, is %d", + last_msg.msg.user_data.contents[87]); + ck_assert_msg(last_msg.msg.user_data.contents[88] == 23, + "incorrect value for last_msg.msg.user_data.contents[88], " + "expected 23, is %d", + last_msg.msg.user_data.contents[88]); + ck_assert_msg(last_msg.msg.user_data.contents[89] == 23, + "incorrect value for last_msg.msg.user_data.contents[89], " + "expected 23, is %d", + last_msg.msg.user_data.contents[89]); + ck_assert_msg(last_msg.msg.user_data.contents[90] == 73, + "incorrect value for last_msg.msg.user_data.contents[90], " + "expected 73, is %d", + last_msg.msg.user_data.contents[90]); + ck_assert_msg(last_msg.msg.user_data.contents[91] == 119, + "incorrect value for last_msg.msg.user_data.contents[91], " + "expected 119, is %d", + last_msg.msg.user_data.contents[91]); + ck_assert_msg(last_msg.msg.user_data.contents[92] == 136, + "incorrect value for last_msg.msg.user_data.contents[92], " + "expected 136, is %d", + last_msg.msg.user_data.contents[92]); + ck_assert_msg(last_msg.msg.user_data.contents[93] == 231, + "incorrect value for last_msg.msg.user_data.contents[93], " + "expected 231, is %d", + last_msg.msg.user_data.contents[93]); + ck_assert_msg(last_msg.msg.user_data.contents[94] == 189, + "incorrect value for last_msg.msg.user_data.contents[94], " + "expected 189, is %d", + last_msg.msg.user_data.contents[94]); + ck_assert_msg(last_msg.msg.user_data.contents[95] == 26, + "incorrect value for last_msg.msg.user_data.contents[95], " + "expected 26, is %d", + last_msg.msg.user_data.contents[95]); + ck_assert_msg(last_msg.msg.user_data.contents[96] == 174, + "incorrect value for last_msg.msg.user_data.contents[96], " + "expected 174, is %d", + last_msg.msg.user_data.contents[96]); + ck_assert_msg(last_msg.msg.user_data.contents[97] == 128, + "incorrect value for last_msg.msg.user_data.contents[97], " + "expected 128, is %d", + last_msg.msg.user_data.contents[97]); + ck_assert_msg(last_msg.msg.user_data.contents[98] == 93, + "incorrect value for last_msg.msg.user_data.contents[98], " + "expected 93, is %d", + last_msg.msg.user_data.contents[98]); + ck_assert_msg(last_msg.msg.user_data.contents[99] == 30, + "incorrect value for last_msg.msg.user_data.contents[99], " + "expected 30, is %d", + last_msg.msg.user_data.contents[99]); + ck_assert_msg(last_msg.msg.user_data.contents[100] == 76, + "incorrect value for last_msg.msg.user_data.contents[100], " + "expected 76, is %d", + last_msg.msg.user_data.contents[100]); + ck_assert_msg(last_msg.msg.user_data.contents[101] == 45, + "incorrect value for last_msg.msg.user_data.contents[101], " + "expected 45, is %d", + last_msg.msg.user_data.contents[101]); + ck_assert_msg(last_msg.msg.user_data.contents[102] == 109, + "incorrect value for last_msg.msg.user_data.contents[102], " + "expected 109, is %d", + last_msg.msg.user_data.contents[102]); + ck_assert_msg(last_msg.msg.user_data.contents[103] == 134, + "incorrect value for last_msg.msg.user_data.contents[103], " + "expected 134, is %d", + last_msg.msg.user_data.contents[103]); + ck_assert_msg(last_msg.msg.user_data.contents[104] == 81, + "incorrect value for last_msg.msg.user_data.contents[104], " + "expected 81, is %d", + last_msg.msg.user_data.contents[104]); + ck_assert_msg(last_msg.msg.user_data.contents[105] == 0, + "incorrect value for last_msg.msg.user_data.contents[105], " + "expected 0, is %d", + last_msg.msg.user_data.contents[105]); + ck_assert_msg(last_msg.msg.user_data.contents[106] == 116, + "incorrect value for last_msg.msg.user_data.contents[106], " + "expected 116, is %d", + last_msg.msg.user_data.contents[106]); + ck_assert_msg(last_msg.msg.user_data.contents[107] == 158, + "incorrect value for last_msg.msg.user_data.contents[107], " + "expected 158, is %d", + last_msg.msg.user_data.contents[107]); + ck_assert_msg(last_msg.msg.user_data.contents[108] == 127, + "incorrect value for last_msg.msg.user_data.contents[108], " + "expected 127, is %d", + last_msg.msg.user_data.contents[108]); + ck_assert_msg(last_msg.msg.user_data.contents[109] == 40, + "incorrect value for last_msg.msg.user_data.contents[109], " + "expected 40, is %d", + last_msg.msg.user_data.contents[109]); + ck_assert_msg(last_msg.msg.user_data.contents[110] == 133, + "incorrect value for last_msg.msg.user_data.contents[110], " + "expected 133, is %d", + last_msg.msg.user_data.contents[110]); + ck_assert_msg(last_msg.msg.user_data.contents[111] == 208, + "incorrect value for last_msg.msg.user_data.contents[111], " + "expected 208, is %d", + last_msg.msg.user_data.contents[111]); + ck_assert_msg(last_msg.msg.user_data.contents[112] == 134, + "incorrect value for last_msg.msg.user_data.contents[112], " + "expected 134, is %d", + last_msg.msg.user_data.contents[112]); + ck_assert_msg(last_msg.msg.user_data.contents[113] == 127, + "incorrect value for last_msg.msg.user_data.contents[113], " + "expected 127, is %d", + last_msg.msg.user_data.contents[113]); + ck_assert_msg(last_msg.msg.user_data.contents[114] == 140, + "incorrect value for last_msg.msg.user_data.contents[114], " + "expected 140, is %d", + last_msg.msg.user_data.contents[114]); + ck_assert_msg(last_msg.msg.user_data.contents[115] == 232, + "incorrect value for last_msg.msg.user_data.contents[115], " + "expected 232, is %d", + last_msg.msg.user_data.contents[115]); + ck_assert_msg(last_msg.msg.user_data.contents[116] == 183, + "incorrect value for last_msg.msg.user_data.contents[116], " + "expected 183, is %d", + last_msg.msg.user_data.contents[116]); + ck_assert_msg(last_msg.msg.user_data.contents[117] == 184, + "incorrect value for last_msg.msg.user_data.contents[117], " + "expected 184, is %d", + last_msg.msg.user_data.contents[117]); + ck_assert_msg(last_msg.msg.user_data.contents[118] == 108, + "incorrect value for last_msg.msg.user_data.contents[118], " + "expected 108, is %d", + last_msg.msg.user_data.contents[118]); + ck_assert_msg(last_msg.msg.user_data.contents[119] == 6, + "incorrect value for last_msg.msg.user_data.contents[119], " + "expected 6, is %d", + last_msg.msg.user_data.contents[119]); + ck_assert_msg(last_msg.msg.user_data.contents[120] == 228, + "incorrect value for last_msg.msg.user_data.contents[120], " + "expected 228, is %d", + last_msg.msg.user_data.contents[120]); + ck_assert_msg(last_msg.msg.user_data.contents[121] == 54, + "incorrect value for last_msg.msg.user_data.contents[121], " + "expected 54, is %d", + last_msg.msg.user_data.contents[121]); + ck_assert_msg(last_msg.msg.user_data.contents[122] == 238, + "incorrect value for last_msg.msg.user_data.contents[122], " + "expected 238, is %d", + last_msg.msg.user_data.contents[122]); + ck_assert_msg(last_msg.msg.user_data.contents[123] == 59, + "incorrect value for last_msg.msg.user_data.contents[123], " + "expected 59, is %d", + last_msg.msg.user_data.contents[123]); + ck_assert_msg(last_msg.msg.user_data.contents[124] == 220, + "incorrect value for last_msg.msg.user_data.contents[124], " + "expected 220, is %d", + last_msg.msg.user_data.contents[124]); + ck_assert_msg(last_msg.msg.user_data.contents[125] == 30, + "incorrect value for last_msg.msg.user_data.contents[125], " + "expected 30, is %d", + last_msg.msg.user_data.contents[125]); + ck_assert_msg(last_msg.msg.user_data.contents[126] == 228, + "incorrect value for last_msg.msg.user_data.contents[126], " + "expected 228, is %d", + last_msg.msg.user_data.contents[126]); + ck_assert_msg(last_msg.msg.user_data.contents[127] == 212, + "incorrect value for last_msg.msg.user_data.contents[127], " + "expected 212, is %d", + last_msg.msg.user_data.contents[127]); + ck_assert_msg(last_msg.msg.user_data.contents[128] == 50, + "incorrect value for last_msg.msg.user_data.contents[128], " + "expected 50, is %d", + last_msg.msg.user_data.contents[128]); + ck_assert_msg(last_msg.msg.user_data.contents[129] == 182, + "incorrect value for last_msg.msg.user_data.contents[129], " + "expected 182, is %d", + last_msg.msg.user_data.contents[129]); + ck_assert_msg(last_msg.msg.user_data.contents[130] == 97, + "incorrect value for last_msg.msg.user_data.contents[130], " + "expected 97, is %d", + last_msg.msg.user_data.contents[130]); + ck_assert_msg(last_msg.msg.user_data.contents[131] == 20, + "incorrect value for last_msg.msg.user_data.contents[131], " + "expected 20, is %d", + last_msg.msg.user_data.contents[131]); + ck_assert_msg(last_msg.msg.user_data.contents[132] == 41, + "incorrect value for last_msg.msg.user_data.contents[132], " + "expected 41, is %d", + last_msg.msg.user_data.contents[132]); + ck_assert_msg(last_msg.msg.user_data.contents[133] == 76, + "incorrect value for last_msg.msg.user_data.contents[133], " + "expected 76, is %d", + last_msg.msg.user_data.contents[133]); + ck_assert_msg(last_msg.msg.user_data.contents[134] == 227, + "incorrect value for last_msg.msg.user_data.contents[134], " + "expected 227, is %d", + last_msg.msg.user_data.contents[134]); + ck_assert_msg(last_msg.msg.user_data.contents[135] == 88, + "incorrect value for last_msg.msg.user_data.contents[135], " + "expected 88, is %d", + last_msg.msg.user_data.contents[135]); + ck_assert_msg(last_msg.msg.user_data.contents[136] == 12, + "incorrect value for last_msg.msg.user_data.contents[136], " + "expected 12, is %d", + last_msg.msg.user_data.contents[136]); + ck_assert_msg(last_msg.msg.user_data.contents[137] == 95, + "incorrect value for last_msg.msg.user_data.contents[137], " + "expected 95, is %d", + last_msg.msg.user_data.contents[137]); + ck_assert_msg(last_msg.msg.user_data.contents[138] == 112, + "incorrect value for last_msg.msg.user_data.contents[138], " + "expected 112, is %d", + last_msg.msg.user_data.contents[138]); + ck_assert_msg(last_msg.msg.user_data.contents[139] == 209, + "incorrect value for last_msg.msg.user_data.contents[139], " + "expected 209, is %d", + last_msg.msg.user_data.contents[139]); + ck_assert_msg(last_msg.msg.user_data.contents[140] == 183, + "incorrect value for last_msg.msg.user_data.contents[140], " + "expected 183, is %d", + last_msg.msg.user_data.contents[140]); + ck_assert_msg(last_msg.msg.user_data.contents[141] == 127, + "incorrect value for last_msg.msg.user_data.contents[141], " + "expected 127, is %d", + last_msg.msg.user_data.contents[141]); + ck_assert_msg(last_msg.msg.user_data.contents[142] == 4, + "incorrect value for last_msg.msg.user_data.contents[142], " + "expected 4, is %d", + last_msg.msg.user_data.contents[142]); + ck_assert_msg(last_msg.msg.user_data.contents[143] == 165, + "incorrect value for last_msg.msg.user_data.contents[143], " + "expected 165, is %d", + last_msg.msg.user_data.contents[143]); + ck_assert_msg(last_msg.msg.user_data.contents[144] == 189, + "incorrect value for last_msg.msg.user_data.contents[144], " + "expected 189, is %d", + last_msg.msg.user_data.contents[144]); + ck_assert_msg(last_msg.msg.user_data.contents[145] == 44, + "incorrect value for last_msg.msg.user_data.contents[145], " + "expected 44, is %d", + last_msg.msg.user_data.contents[145]); + ck_assert_msg(last_msg.msg.user_data.contents[146] == 239, + "incorrect value for last_msg.msg.user_data.contents[146], " + "expected 239, is %d", + last_msg.msg.user_data.contents[146]); + ck_assert_msg(last_msg.msg.user_data.contents[147] == 232, + "incorrect value for last_msg.msg.user_data.contents[147], " + "expected 232, is %d", + last_msg.msg.user_data.contents[147]); + ck_assert_msg(last_msg.msg.user_data.contents[148] == 132, + "incorrect value for last_msg.msg.user_data.contents[148], " + "expected 132, is %d", + last_msg.msg.user_data.contents[148]); + ck_assert_msg(last_msg.msg.user_data.contents[149] == 9, + "incorrect value for last_msg.msg.user_data.contents[149], " + "expected 9, is %d", + last_msg.msg.user_data.contents[149]); + ck_assert_msg(last_msg.msg.user_data.contents[150] == 114, + "incorrect value for last_msg.msg.user_data.contents[150], " + "expected 114, is %d", + last_msg.msg.user_data.contents[150]); + ck_assert_msg(last_msg.msg.user_data.contents[151] == 184, + "incorrect value for last_msg.msg.user_data.contents[151], " + "expected 184, is %d", + last_msg.msg.user_data.contents[151]); + ck_assert_msg(last_msg.msg.user_data.contents[152] == 249, + "incorrect value for last_msg.msg.user_data.contents[152], " + "expected 249, is %d", + last_msg.msg.user_data.contents[152]); + ck_assert_msg(last_msg.msg.user_data.contents[153] == 208, + "incorrect value for last_msg.msg.user_data.contents[153], " + "expected 208, is %d", + last_msg.msg.user_data.contents[153]); + ck_assert_msg(last_msg.msg.user_data.contents[154] == 246, + "incorrect value for last_msg.msg.user_data.contents[154], " + "expected 246, is %d", + last_msg.msg.user_data.contents[154]); + ck_assert_msg(last_msg.msg.user_data.contents[155] == 194, + "incorrect value for last_msg.msg.user_data.contents[155], " + "expected 194, is %d", + last_msg.msg.user_data.contents[155]); + ck_assert_msg(last_msg.msg.user_data.contents[156] == 250, + "incorrect value for last_msg.msg.user_data.contents[156], " + "expected 250, is %d", + last_msg.msg.user_data.contents[156]); + ck_assert_msg(last_msg.msg.user_data.contents[157] == 2, + "incorrect value for last_msg.msg.user_data.contents[157], " + "expected 2, is %d", + last_msg.msg.user_data.contents[157]); + ck_assert_msg(last_msg.msg.user_data.contents[158] == 97, + "incorrect value for last_msg.msg.user_data.contents[158], " + "expected 97, is %d", + last_msg.msg.user_data.contents[158]); + ck_assert_msg(last_msg.msg.user_data.contents[159] == 173, + "incorrect value for last_msg.msg.user_data.contents[159], " + "expected 173, is %d", + last_msg.msg.user_data.contents[159]); + ck_assert_msg(last_msg.msg.user_data.contents[160] == 157, + "incorrect value for last_msg.msg.user_data.contents[160], " + "expected 157, is %d", + last_msg.msg.user_data.contents[160]); + ck_assert_msg(last_msg.msg.user_data.contents[161] == 202, + "incorrect value for last_msg.msg.user_data.contents[161], " + "expected 202, is %d", + last_msg.msg.user_data.contents[161]); + ck_assert_msg(last_msg.msg.user_data.contents[162] == 172, + "incorrect value for last_msg.msg.user_data.contents[162], " + "expected 172, is %d", + last_msg.msg.user_data.contents[162]); + ck_assert_msg(last_msg.msg.user_data.contents[163] == 180, + "incorrect value for last_msg.msg.user_data.contents[163], " + "expected 180, is %d", + last_msg.msg.user_data.contents[163]); + ck_assert_msg(last_msg.msg.user_data.contents[164] == 150, + "incorrect value for last_msg.msg.user_data.contents[164], " + "expected 150, is %d", + last_msg.msg.user_data.contents[164]); + ck_assert_msg(last_msg.msg.user_data.contents[165] == 213, + "incorrect value for last_msg.msg.user_data.contents[165], " + "expected 213, is %d", + last_msg.msg.user_data.contents[165]); + ck_assert_msg(last_msg.msg.user_data.contents[166] == 193, + "incorrect value for last_msg.msg.user_data.contents[166], " + "expected 193, is %d", + last_msg.msg.user_data.contents[166]); + ck_assert_msg(last_msg.msg.user_data.contents[167] == 177, + "incorrect value for last_msg.msg.user_data.contents[167], " + "expected 177, is %d", + last_msg.msg.user_data.contents[167]); + ck_assert_msg(last_msg.msg.user_data.contents[168] == 209, + "incorrect value for last_msg.msg.user_data.contents[168], " + "expected 209, is %d", + last_msg.msg.user_data.contents[168]); + ck_assert_msg(last_msg.msg.user_data.contents[169] == 156, + "incorrect value for last_msg.msg.user_data.contents[169], " + "expected 156, is %d", + last_msg.msg.user_data.contents[169]); + ck_assert_msg(last_msg.msg.user_data.contents[170] == 20, + "incorrect value for last_msg.msg.user_data.contents[170], " + "expected 20, is %d", + last_msg.msg.user_data.contents[170]); + ck_assert_msg(last_msg.msg.user_data.contents[171] == 174, + "incorrect value for last_msg.msg.user_data.contents[171], " + "expected 174, is %d", + last_msg.msg.user_data.contents[171]); + ck_assert_msg(last_msg.msg.user_data.contents[172] == 18, + "incorrect value for last_msg.msg.user_data.contents[172], " + "expected 18, is %d", + last_msg.msg.user_data.contents[172]); + ck_assert_msg(last_msg.msg.user_data.contents[173] == 73, + "incorrect value for last_msg.msg.user_data.contents[173], " + "expected 73, is %d", + last_msg.msg.user_data.contents[173]); + ck_assert_msg(last_msg.msg.user_data.contents[174] == 132, + "incorrect value for last_msg.msg.user_data.contents[174], " + "expected 132, is %d", + last_msg.msg.user_data.contents[174]); + ck_assert_msg(last_msg.msg.user_data.contents[175] == 215, + "incorrect value for last_msg.msg.user_data.contents[175], " + "expected 215, is %d", + last_msg.msg.user_data.contents[175]); + ck_assert_msg(last_msg.msg.user_data.contents[176] == 115, + "incorrect value for last_msg.msg.user_data.contents[176], " + "expected 115, is %d", + last_msg.msg.user_data.contents[176]); + ck_assert_msg(last_msg.msg.user_data.contents[177] == 128, + "incorrect value for last_msg.msg.user_data.contents[177], " + "expected 128, is %d", + last_msg.msg.user_data.contents[177]); + ck_assert_msg(last_msg.msg.user_data.contents[178] == 175, + "incorrect value for last_msg.msg.user_data.contents[178], " + "expected 175, is %d", + last_msg.msg.user_data.contents[178]); + ck_assert_msg(last_msg.msg.user_data.contents[179] == 169, + "incorrect value for last_msg.msg.user_data.contents[179], " + "expected 169, is %d", + last_msg.msg.user_data.contents[179]); + ck_assert_msg(last_msg.msg.user_data.contents[180] == 116, + "incorrect value for last_msg.msg.user_data.contents[180], " + "expected 116, is %d", + last_msg.msg.user_data.contents[180]); + ck_assert_msg(last_msg.msg.user_data.contents[181] == 132, + "incorrect value for last_msg.msg.user_data.contents[181], " + "expected 132, is %d", + last_msg.msg.user_data.contents[181]); + ck_assert_msg(last_msg.msg.user_data.contents[182] == 100, + "incorrect value for last_msg.msg.user_data.contents[182], " + "expected 100, is %d", + last_msg.msg.user_data.contents[182]); + ck_assert_msg(last_msg.msg.user_data.contents[183] == 72, + "incorrect value for last_msg.msg.user_data.contents[183], " + "expected 72, is %d", + last_msg.msg.user_data.contents[183]); + ck_assert_msg(last_msg.msg.user_data.contents[184] == 45, + "incorrect value for last_msg.msg.user_data.contents[184], " + "expected 45, is %d", + last_msg.msg.user_data.contents[184]); + ck_assert_msg(last_msg.msg.user_data.contents[185] == 25, + "incorrect value for last_msg.msg.user_data.contents[185], " + "expected 25, is %d", + last_msg.msg.user_data.contents[185]); + ck_assert_msg(last_msg.msg.user_data.contents[186] == 14, + "incorrect value for last_msg.msg.user_data.contents[186], " + "expected 14, is %d", + last_msg.msg.user_data.contents[186]); + ck_assert_msg(last_msg.msg.user_data.contents[187] == 205, + "incorrect value for last_msg.msg.user_data.contents[187], " + "expected 205, is %d", + last_msg.msg.user_data.contents[187]); + ck_assert_msg(last_msg.msg.user_data.contents[188] == 213, + "incorrect value for last_msg.msg.user_data.contents[188], " + "expected 213, is %d", + last_msg.msg.user_data.contents[188]); + ck_assert_msg(last_msg.msg.user_data.contents[189] == 145, + "incorrect value for last_msg.msg.user_data.contents[189], " + "expected 145, is %d", + last_msg.msg.user_data.contents[189]); + ck_assert_msg(last_msg.msg.user_data.contents[190] == 68, + "incorrect value for last_msg.msg.user_data.contents[190], " + "expected 68, is %d", + last_msg.msg.user_data.contents[190]); + ck_assert_msg(last_msg.msg.user_data.contents[191] == 137, + "incorrect value for last_msg.msg.user_data.contents[191], " + "expected 137, is %d", + last_msg.msg.user_data.contents[191]); + ck_assert_msg(last_msg.msg.user_data.contents[192] == 249, + "incorrect value for last_msg.msg.user_data.contents[192], " + "expected 249, is %d", + last_msg.msg.user_data.contents[192]); + ck_assert_msg(last_msg.msg.user_data.contents[193] == 54, + "incorrect value for last_msg.msg.user_data.contents[193], " + "expected 54, is %d", + last_msg.msg.user_data.contents[193]); + ck_assert_msg(last_msg.msg.user_data.contents[194] == 40, + "incorrect value for last_msg.msg.user_data.contents[194], " + "expected 40, is %d", + last_msg.msg.user_data.contents[194]); + ck_assert_msg(last_msg.msg.user_data.contents[195] == 174, + "incorrect value for last_msg.msg.user_data.contents[195], " + "expected 174, is %d", + last_msg.msg.user_data.contents[195]); + ck_assert_msg(last_msg.msg.user_data.contents[196] == 215, + "incorrect value for last_msg.msg.user_data.contents[196], " + "expected 215, is %d", + last_msg.msg.user_data.contents[196]); + ck_assert_msg(last_msg.msg.user_data.contents[197] == 148, + "incorrect value for last_msg.msg.user_data.contents[197], " + "expected 148, is %d", + last_msg.msg.user_data.contents[197]); + ck_assert_msg(last_msg.msg.user_data.contents[198] == 166, + "incorrect value for last_msg.msg.user_data.contents[198], " + "expected 166, is %d", + last_msg.msg.user_data.contents[198]); + ck_assert_msg(last_msg.msg.user_data.contents[199] == 190, + "incorrect value for last_msg.msg.user_data.contents[199], " + "expected 190, is %d", + last_msg.msg.user_data.contents[199]); + ck_assert_msg(last_msg.msg.user_data.contents[200] == 63, + "incorrect value for last_msg.msg.user_data.contents[200], " + "expected 63, is %d", + last_msg.msg.user_data.contents[200]); + ck_assert_msg(last_msg.msg.user_data.contents[201] == 118, + "incorrect value for last_msg.msg.user_data.contents[201], " + "expected 118, is %d", + last_msg.msg.user_data.contents[201]); + ck_assert_msg(last_msg.msg.user_data.contents[202] == 6, + "incorrect value for last_msg.msg.user_data.contents[202], " + "expected 6, is %d", + last_msg.msg.user_data.contents[202]); + ck_assert_msg(last_msg.msg.user_data.contents[203] == 165, + "incorrect value for last_msg.msg.user_data.contents[203], " + "expected 165, is %d", + last_msg.msg.user_data.contents[203]); + ck_assert_msg(last_msg.msg.user_data.contents[204] == 212, + "incorrect value for last_msg.msg.user_data.contents[204], " + "expected 212, is %d", + last_msg.msg.user_data.contents[204]); + ck_assert_msg(last_msg.msg.user_data.contents[205] == 74, + "incorrect value for last_msg.msg.user_data.contents[205], " + "expected 74, is %d", + last_msg.msg.user_data.contents[205]); + ck_assert_msg(last_msg.msg.user_data.contents[206] == 68, + "incorrect value for last_msg.msg.user_data.contents[206], " + "expected 68, is %d", + last_msg.msg.user_data.contents[206]); + ck_assert_msg(last_msg.msg.user_data.contents[207] == 200, + "incorrect value for last_msg.msg.user_data.contents[207], " + "expected 200, is %d", + last_msg.msg.user_data.contents[207]); + ck_assert_msg(last_msg.msg.user_data.contents[208] == 38, + "incorrect value for last_msg.msg.user_data.contents[208], " + "expected 38, is %d", + last_msg.msg.user_data.contents[208]); + ck_assert_msg(last_msg.msg.user_data.contents[209] == 139, + "incorrect value for last_msg.msg.user_data.contents[209], " + "expected 139, is %d", + last_msg.msg.user_data.contents[209]); + ck_assert_msg(last_msg.msg.user_data.contents[210] == 212, + "incorrect value for last_msg.msg.user_data.contents[210], " + "expected 212, is %d", + last_msg.msg.user_data.contents[210]); + ck_assert_msg(last_msg.msg.user_data.contents[211] == 112, + "incorrect value for last_msg.msg.user_data.contents[211], " + "expected 112, is %d", + last_msg.msg.user_data.contents[211]); + ck_assert_msg(last_msg.msg.user_data.contents[212] == 45, + "incorrect value for last_msg.msg.user_data.contents[212], " + "expected 45, is %d", + last_msg.msg.user_data.contents[212]); + ck_assert_msg(last_msg.msg.user_data.contents[213] == 167, + "incorrect value for last_msg.msg.user_data.contents[213], " + "expected 167, is %d", + last_msg.msg.user_data.contents[213]); + ck_assert_msg(last_msg.msg.user_data.contents[214] == 236, + "incorrect value for last_msg.msg.user_data.contents[214], " + "expected 236, is %d", + last_msg.msg.user_data.contents[214]); + ck_assert_msg(last_msg.msg.user_data.contents[215] == 255, + "incorrect value for last_msg.msg.user_data.contents[215], " + "expected 255, is %d", + last_msg.msg.user_data.contents[215]); + ck_assert_msg(last_msg.msg.user_data.contents[216] == 106, + "incorrect value for last_msg.msg.user_data.contents[216], " + "expected 106, is %d", + last_msg.msg.user_data.contents[216]); + ck_assert_msg(last_msg.msg.user_data.contents[217] == 92, + "incorrect value for last_msg.msg.user_data.contents[217], " + "expected 92, is %d", + last_msg.msg.user_data.contents[217]); + ck_assert_msg(last_msg.msg.user_data.contents[218] == 132, + "incorrect value for last_msg.msg.user_data.contents[218], " + "expected 132, is %d", + last_msg.msg.user_data.contents[218]); + ck_assert_msg(last_msg.msg.user_data.contents[219] == 59, + "incorrect value for last_msg.msg.user_data.contents[219], " + "expected 59, is %d", + last_msg.msg.user_data.contents[219]); + ck_assert_msg(last_msg.msg.user_data.contents[220] == 61, + "incorrect value for last_msg.msg.user_data.contents[220], " + "expected 61, is %d", + last_msg.msg.user_data.contents[220]); + ck_assert_msg(last_msg.msg.user_data.contents[221] == 233, + "incorrect value for last_msg.msg.user_data.contents[221], " + "expected 233, is %d", + last_msg.msg.user_data.contents[221]); + ck_assert_msg(last_msg.msg.user_data.contents[222] == 3, + "incorrect value for last_msg.msg.user_data.contents[222], " + "expected 3, is %d", + last_msg.msg.user_data.contents[222]); + ck_assert_msg(last_msg.msg.user_data.contents[223] == 246, + "incorrect value for last_msg.msg.user_data.contents[223], " + "expected 246, is %d", + last_msg.msg.user_data.contents[223]); + ck_assert_msg(last_msg.msg.user_data.contents[224] == 158, + "incorrect value for last_msg.msg.user_data.contents[224], " + "expected 158, is %d", + last_msg.msg.user_data.contents[224]); + ck_assert_msg(last_msg.msg.user_data.contents[225] == 83, + "incorrect value for last_msg.msg.user_data.contents[225], " + "expected 83, is %d", + last_msg.msg.user_data.contents[225]); + ck_assert_msg(last_msg.msg.user_data.contents[226] == 134, + "incorrect value for last_msg.msg.user_data.contents[226], " + "expected 134, is %d", + last_msg.msg.user_data.contents[226]); + ck_assert_msg(last_msg.msg.user_data.contents[227] == 246, + "incorrect value for last_msg.msg.user_data.contents[227], " + "expected 246, is %d", + last_msg.msg.user_data.contents[227]); + ck_assert_msg(last_msg.msg.user_data.contents[228] == 154, + "incorrect value for last_msg.msg.user_data.contents[228], " + "expected 154, is %d", + last_msg.msg.user_data.contents[228]); + ck_assert_msg(last_msg.msg.user_data.contents[229] == 17, + "incorrect value for last_msg.msg.user_data.contents[229], " + "expected 17, is %d", + last_msg.msg.user_data.contents[229]); + ck_assert_msg(last_msg.msg.user_data.contents[230] == 0, + "incorrect value for last_msg.msg.user_data.contents[230], " + "expected 0, is %d", + last_msg.msg.user_data.contents[230]); + ck_assert_msg(last_msg.msg.user_data.contents[231] == 6, + "incorrect value for last_msg.msg.user_data.contents[231], " + "expected 6, is %d", + last_msg.msg.user_data.contents[231]); + ck_assert_msg(last_msg.msg.user_data.contents[232] == 56, + "incorrect value for last_msg.msg.user_data.contents[232], " + "expected 56, is %d", + last_msg.msg.user_data.contents[232]); + ck_assert_msg(last_msg.msg.user_data.contents[233] == 216, + "incorrect value for last_msg.msg.user_data.contents[233], " + "expected 216, is %d", + last_msg.msg.user_data.contents[233]); + ck_assert_msg(last_msg.msg.user_data.contents[234] == 19, + "incorrect value for last_msg.msg.user_data.contents[234], " + "expected 19, is %d", + last_msg.msg.user_data.contents[234]); + ck_assert_msg(last_msg.msg.user_data.contents[235] == 216, + "incorrect value for last_msg.msg.user_data.contents[235], " + "expected 216, is %d", + last_msg.msg.user_data.contents[235]); + ck_assert_msg(last_msg.msg.user_data.contents[236] == 70, + "incorrect value for last_msg.msg.user_data.contents[236], " + "expected 70, is %d", + last_msg.msg.user_data.contents[236]); + ck_assert_msg(last_msg.msg.user_data.contents[237] == 71, + "incorrect value for last_msg.msg.user_data.contents[237], " + "expected 71, is %d", + last_msg.msg.user_data.contents[237]); + ck_assert_msg(last_msg.msg.user_data.contents[238] == 161, + "incorrect value for last_msg.msg.user_data.contents[238], " + "expected 161, is %d", + last_msg.msg.user_data.contents[238]); + ck_assert_msg(last_msg.msg.user_data.contents[239] == 184, + "incorrect value for last_msg.msg.user_data.contents[239], " + "expected 184, is %d", + last_msg.msg.user_data.contents[239]); + ck_assert_msg(last_msg.msg.user_data.contents[240] == 5, + "incorrect value for last_msg.msg.user_data.contents[240], " + "expected 5, is %d", + last_msg.msg.user_data.contents[240]); + ck_assert_msg(last_msg.msg.user_data.contents[241] == 177, + "incorrect value for last_msg.msg.user_data.contents[241], " + "expected 177, is %d", + last_msg.msg.user_data.contents[241]); + ck_assert_msg(last_msg.msg.user_data.contents[242] == 45, + "incorrect value for last_msg.msg.user_data.contents[242], " + "expected 45, is %d", + last_msg.msg.user_data.contents[242]); + ck_assert_msg(last_msg.msg.user_data.contents[243] == 37, + "incorrect value for last_msg.msg.user_data.contents[243], " + "expected 37, is %d", + last_msg.msg.user_data.contents[243]); + ck_assert_msg(last_msg.msg.user_data.contents[244] == 98, + "incorrect value for last_msg.msg.user_data.contents[244], " + "expected 98, is %d", + last_msg.msg.user_data.contents[244]); + ck_assert_msg(last_msg.msg.user_data.contents[245] == 56, + "incorrect value for last_msg.msg.user_data.contents[245], " + "expected 56, is %d", + last_msg.msg.user_data.contents[245]); + ck_assert_msg(last_msg.msg.user_data.contents[246] == 149, + "incorrect value for last_msg.msg.user_data.contents[246], " + "expected 149, is %d", + last_msg.msg.user_data.contents[246]); + ck_assert_msg(last_msg.msg.user_data.contents[247] == 0, + "incorrect value for last_msg.msg.user_data.contents[247], " + "expected 0, is %d", + last_msg.msg.user_data.contents[247]); + ck_assert_msg(last_msg.msg.user_data.contents[248] == 73, + "incorrect value for last_msg.msg.user_data.contents[248], " + "expected 73, is %d", + last_msg.msg.user_data.contents[248]); + ck_assert_msg(last_msg.msg.user_data.contents[249] == 221, + "incorrect value for last_msg.msg.user_data.contents[249], " + "expected 221, is %d", + last_msg.msg.user_data.contents[249]); + ck_assert_msg(last_msg.msg.user_data.contents[250] == 105, + "incorrect value for last_msg.msg.user_data.contents[250], " + "expected 105, is %d", + last_msg.msg.user_data.contents[250]); + ck_assert_msg(last_msg.msg.user_data.contents[251] == 239, + "incorrect value for last_msg.msg.user_data.contents[251], " + "expected 239, is %d", + last_msg.msg.user_data.contents[251]); + ck_assert_msg(last_msg.msg.user_data.contents[252] == 168, + "incorrect value for last_msg.msg.user_data.contents[252], " + "expected 168, is %d", + last_msg.msg.user_data.contents[252]); + ck_assert_msg(last_msg.msg.user_data.contents[253] == 205, + "incorrect value for last_msg.msg.user_data.contents[253], " + "expected 205, is %d", + last_msg.msg.user_data.contents[253]); + ck_assert_msg(last_msg.msg.user_data.contents[254] == 85, + "incorrect value for last_msg.msg.user_data.contents[254], " + "expected 85, is %d", + last_msg.msg.user_data.contents[254]); + + ck_assert_msg(last_msg.msg.user_data.n_contents == 255, + "incorrect value for last_msg.msg.user_data.n_contents, " + "expected 255, is %d", + last_msg.msg.user_data.n_contents); } } END_TEST -Suite* auto_check_sbp_user_MsgUserData_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_user_MsgUserData"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_user_MsgUserData"); +Suite *auto_check_sbp_user_MsgUserData_suite(void) { + Suite *s = + suite_create("SBP generated test suite: auto_check_sbp_user_MsgUserData"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_user_MsgUserData"); tcase_add_test(tc_acq, test_auto_check_sbp_user_MsgUserData); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_vehicle_MsgOdometry.c b/c/test/auto_check_sbp_vehicle_MsgOdometry.c index 90a996f4c..d3509b068 100644 --- a/c/test/auto_check_sbp_vehicle_MsgOdometry.c +++ b/c/test/auto_check_sbp_vehicle_MsgOdometry.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgOdometry.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgOdometry.yaml by generate.py. Do +// not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_vehicle_MsgOdometry ) -{ +START_TEST(test_auto_check_sbp_vehicle_MsgOdometry) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_vehicle_MsgOdometry ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,55 +90,70 @@ START_TEST( test_auto_check_sbp_vehicle_MsgOdometry ) logging_reset(); - sbp_callback_register(&sbp_state, 0x903, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x903, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,3,9,66,0,9,8,0,0,0,7,0,0,0,1,52,99, }; + u8 encoded_frame[] = { + 85, 3, 9, 66, 0, 9, 8, 0, 0, 0, 7, 0, 0, 0, 1, 52, 99, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.odometry.flags = 1; - + test_msg.odometry.tow = 8; - + test_msg.odometry.velocity = 7; sbp_message_send(&sbp_state, SbpMsgOdometry, 66, &test_msg, &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgOdometry, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgOdometry, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.odometry.flags == 1, "incorrect value for last_msg.msg.odometry.flags, expected 1, is %d", last_msg.msg.odometry.flags); - - ck_assert_msg(last_msg.msg.odometry.tow == 8, "incorrect value for last_msg.msg.odometry.tow, expected 8, is %d", last_msg.msg.odometry.tow); - - ck_assert_msg(last_msg.msg.odometry.velocity == 7, "incorrect value for last_msg.msg.odometry.velocity, expected 7, is %d", last_msg.msg.odometry.velocity); + ck_assert_msg( + last_msg.msg.odometry.flags == 1, + "incorrect value for last_msg.msg.odometry.flags, expected 1, is %d", + last_msg.msg.odometry.flags); + + ck_assert_msg( + last_msg.msg.odometry.tow == 8, + "incorrect value for last_msg.msg.odometry.tow, expected 8, is %d", + last_msg.msg.odometry.tow); + + ck_assert_msg( + last_msg.msg.odometry.velocity == 7, + "incorrect value for last_msg.msg.odometry.velocity, expected 7, is %d", + last_msg.msg.odometry.velocity); } } END_TEST -Suite* auto_check_sbp_vehicle_MsgOdometry_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_vehicle_MsgOdometry"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_vehicle_MsgOdometry"); +Suite *auto_check_sbp_vehicle_MsgOdometry_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_vehicle_MsgOdometry"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_vehicle_MsgOdometry"); tcase_add_test(tc_acq, test_auto_check_sbp_vehicle_MsgOdometry); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/auto_check_sbp_vehicle_MsgWheeltick.c b/c/test/auto_check_sbp_vehicle_MsgWheeltick.c index 058a41dde..555fa3a81 100644 --- a/c/test/auto_check_sbp_vehicle_MsgWheeltick.c +++ b/c/test/auto_check_sbp_vehicle_MsgWheeltick.c @@ -10,13 +10,15 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgWheeltick.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgWheeltick.yaml by generate.py. +// Do not modify by hand! #include -#include // for debugging -#include // for malloc #include #include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -29,42 +31,36 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; -static void* DUMMY_MEMORY_FOR_CALLBACKS = (void*)0xdeadbeef; -static void* DUMMY_MEMORY_FOR_IO = (void*)0xdead0000; +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; } -static void logging_reset() -{ - memset(&last_msg, 0, sizeof(last_msg)); -} +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t *msg, void *context) -{ +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.msg_type = msg_type; @@ -72,8 +68,7 @@ static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, const sbp_msg_t last_msg.context = context; } -START_TEST( test_auto_check_sbp_vehicle_MsgWheeltick ) -{ +START_TEST(test_auto_check_sbp_vehicle_MsgWheeltick) { static sbp_msg_callbacks_node_t n; // State of the SBP message parser. @@ -86,7 +81,8 @@ START_TEST( test_auto_check_sbp_vehicle_MsgWheeltick ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -94,59 +90,79 @@ START_TEST( test_auto_check_sbp_vehicle_MsgWheeltick ) logging_reset(); - sbp_callback_register(&sbp_state, 0x904, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_callback_register(&sbp_state, 0x904, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); - u8 encoded_frame[] = {85,4,9,107,69,14,254,27,114,44,26,0,0,0,1,146,225,51,9,210,36,56, }; + u8 encoded_frame[] = { + 85, 4, 9, 107, 69, 14, 254, 27, 114, 44, 26, + 0, 0, 0, 1, 146, 225, 51, 9, 210, 36, 56, + }; dummy_reset(); sbp_msg_t test_msg; memset(&test_msg, 0, sizeof(test_msg)); - + test_msg.wheeltick.flags = 1; - + test_msg.wheeltick.source = 146; - + test_msg.wheeltick.ticks = -771148831; - + test_msg.wheeltick.time = 112414825470; - sbp_message_send(&sbp_state, SbpMsgWheeltick, 17771, &test_msg, &dummy_write); + sbp_message_send(&sbp_state, SbpMsgWheeltick, 17771, &test_msg, + &dummy_write); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, actual: %zu)", sizeof(encoded_frame), dummy_wr); + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 17771, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); - ck_assert_msg(sbp_message_cmp(SbpMsgWheeltick, &last_msg.msg, &test_msg) == 0, + ck_assert_msg( + sbp_message_cmp(SbpMsgWheeltick, &last_msg.msg, &test_msg) == 0, "Sent and received messages did not compare equal"); - - ck_assert_msg(last_msg.msg.wheeltick.flags == 1, "incorrect value for last_msg.msg.wheeltick.flags, expected 1, is %d", last_msg.msg.wheeltick.flags); - - ck_assert_msg(last_msg.msg.wheeltick.source == 146, "incorrect value for last_msg.msg.wheeltick.source, expected 146, is %d", last_msg.msg.wheeltick.source); - - ck_assert_msg(last_msg.msg.wheeltick.ticks == -771148831, "incorrect value for last_msg.msg.wheeltick.ticks, expected -771148831, is %d", last_msg.msg.wheeltick.ticks); - - ck_assert_msg(last_msg.msg.wheeltick.time == 112414825470, "incorrect value for last_msg.msg.wheeltick.time, expected 112414825470, is %d", last_msg.msg.wheeltick.time); + ck_assert_msg( + last_msg.msg.wheeltick.flags == 1, + "incorrect value for last_msg.msg.wheeltick.flags, expected 1, is %d", + last_msg.msg.wheeltick.flags); + + ck_assert_msg(last_msg.msg.wheeltick.source == 146, + "incorrect value for last_msg.msg.wheeltick.source, expected " + "146, is %d", + last_msg.msg.wheeltick.source); + + ck_assert_msg(last_msg.msg.wheeltick.ticks == -771148831, + "incorrect value for last_msg.msg.wheeltick.ticks, expected " + "-771148831, is %d", + last_msg.msg.wheeltick.ticks); + + ck_assert_msg(last_msg.msg.wheeltick.time == 112414825470, + "incorrect value for last_msg.msg.wheeltick.time, expected " + "112414825470, is %d", + last_msg.msg.wheeltick.time); } } END_TEST -Suite* auto_check_sbp_vehicle_MsgWheeltick_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: auto_check_sbp_vehicle_MsgWheeltick"); - TCase *tc_acq = tcase_create("Automated_Suite_auto_check_sbp_vehicle_MsgWheeltick"); +Suite *auto_check_sbp_vehicle_MsgWheeltick_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_vehicle_MsgWheeltick"); + TCase *tc_acq = + tcase_create("Automated_Suite_auto_check_sbp_vehicle_MsgWheeltick"); tcase_add_test(tc_acq, test_auto_check_sbp_vehicle_MsgWheeltick); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/check_main.c b/c/test/check_main.c index ff09ce2cc..b06351296 100644 --- a/c/test/check_main.c +++ b/c/test/check_main.c @@ -12,12 +12,11 @@ // This file was auto-generated by generate.py. Do not modify by hand! -#include #include +#include #include "check_suites.h" -int main(void) -{ +int main(void) { int number_failed; Suite *s = edc_suite(); SRunner *sr = srunner_create(s); @@ -32,8 +31,10 @@ int main(void) srunner_add_suite(sr, auto_check_sbp_acquisition_MsgAcqResultDepC_suite()); srunner_add_suite(sr, auto_check_sbp_acquisition_MsgAcqSvProfile_suite()); srunner_add_suite(sr, auto_check_sbp_acquisition_MsgAcqSvProfileDep_suite()); - srunner_add_suite(sr, auto_check_sbp_bootload_MsgBootloaderHandshakeReq_suite()); - srunner_add_suite(sr, auto_check_sbp_bootload_MsgBootloaderHandshakeResp_suite()); + srunner_add_suite(sr, + auto_check_sbp_bootload_MsgBootloaderHandshakeReq_suite()); + srunner_add_suite(sr, + auto_check_sbp_bootload_MsgBootloaderHandshakeResp_suite()); srunner_add_suite(sr, auto_check_sbp_bootload_MsgBootloaderJumptoApp_suite()); srunner_add_suite(sr, auto_check_sbp_bootload_MsgNapDeviceDnaReq_suite()); srunner_add_suite(sr, auto_check_sbp_bootload_MsgNapDeviceDnaResp_suite()); @@ -60,19 +61,25 @@ int main(void) srunner_add_suite(sr, auto_check_sbp_imu_MsgImuRaw_suite()); srunner_add_suite(sr, auto_check_sbp_integrity_MsgAcknowledge_suite()); srunner_add_suite(sr, auto_check_sbp_integrity_MsgSsrFlagHighLevel_suite()); - srunner_add_suite(sr, auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos_suite()); - srunner_add_suite(sr, auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints_suite()); - srunner_add_suite(sr, auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos_suite()); + srunner_add_suite( + sr, auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos_suite()); + srunner_add_suite(sr, + auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints_suite()); + srunner_add_suite(sr, + auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos_suite()); srunner_add_suite(sr, auto_check_sbp_integrity_MsgSsrFlagSatellites_suite()); - srunner_add_suite(sr, auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints_suite()); + srunner_add_suite(sr, + auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints_suite()); srunner_add_suite(sr, auto_check_sbp_linux_MsgLinuxCpuState_suite()); srunner_add_suite(sr, auto_check_sbp_linux_MsgLinuxCpuStateDepA_suite()); srunner_add_suite(sr, auto_check_sbp_linux_MsgLinuxMemState_suite()); srunner_add_suite(sr, auto_check_sbp_linux_MsgLinuxMemStateDepA_suite()); srunner_add_suite(sr, auto_check_sbp_linux_MsgLinuxProcessFdCount_suite()); srunner_add_suite(sr, auto_check_sbp_linux_MsgLinuxProcessFdSummary_suite()); - srunner_add_suite(sr, auto_check_sbp_linux_MsgLinuxProcessSocketCounts_suite()); - srunner_add_suite(sr, auto_check_sbp_linux_MsgLinuxProcessSocketQueues_suite()); + srunner_add_suite(sr, + auto_check_sbp_linux_MsgLinuxProcessSocketCounts_suite()); + srunner_add_suite(sr, + auto_check_sbp_linux_MsgLinuxProcessSocketQueues_suite()); srunner_add_suite(sr, auto_check_sbp_linux_MsgLinuxSocketUsage_suite()); srunner_add_suite(sr, auto_check_sbp_linux_MsgLinuxSysState_suite()); srunner_add_suite(sr, auto_check_sbp_linux_MsgLinuxSysStateDepA_suite()); @@ -83,7 +90,8 @@ int main(void) srunner_add_suite(sr, auto_check_sbp_navigation_MsgAgeCorrections_suite()); srunner_add_suite(sr, auto_check_sbp_navigation_MsgBaselineECEF_suite()); srunner_add_suite(sr, auto_check_sbp_navigation_MsgBaselineECEFDepA_suite()); - srunner_add_suite(sr, auto_check_sbp_navigation_MsgBaselineHeadingDepA_suite()); + srunner_add_suite(sr, + auto_check_sbp_navigation_MsgBaselineHeadingDepA_suite()); srunner_add_suite(sr, auto_check_sbp_navigation_MsgBaselineNED_suite()); srunner_add_suite(sr, auto_check_sbp_navigation_MsgBaselineNEDDepA_suite()); srunner_add_suite(sr, auto_check_sbp_navigation_MsgDops_suite()); @@ -104,8 +112,10 @@ int main(void) srunner_add_suite(sr, auto_check_sbp_navigation_MsgPosLlhGnss_suite()); srunner_add_suite(sr, auto_check_sbp_navigation_MsgPoseRelative_suite()); srunner_add_suite(sr, auto_check_sbp_navigation_MsgProtectionLevel_suite()); - srunner_add_suite(sr, auto_check_sbp_navigation_MsgProtectionLevelDepA_suite()); - srunner_add_suite(sr, auto_check_sbp_navigation_MsgReferenceFrameParam_suite()); + srunner_add_suite(sr, + auto_check_sbp_navigation_MsgProtectionLevelDepA_suite()); + srunner_add_suite(sr, + auto_check_sbp_navigation_MsgReferenceFrameParam_suite()); srunner_add_suite(sr, auto_check_sbp_navigation_MsgUTCLeapSecond_suite()); srunner_add_suite(sr, auto_check_sbp_navigation_MsgUTCTime_suite()); srunner_add_suite(sr, auto_check_sbp_navigation_MsgUTCTimeGNSS_suite()); @@ -143,8 +153,10 @@ int main(void) srunner_add_suite(sr, auto_check_sbp_observation_MsgEphemerisGal_suite()); srunner_add_suite(sr, auto_check_sbp_observation_MsgEphemerisGalDepA_suite()); srunner_add_suite(sr, auto_check_sbp_observation_MsgEphemerisSbas_suite()); - srunner_add_suite(sr, auto_check_sbp_observation_MsgEphemerisSbasDepA_suite()); - srunner_add_suite(sr, auto_check_sbp_observation_MsgEphemerisSbasDepB_suite()); + srunner_add_suite(sr, + auto_check_sbp_observation_MsgEphemerisSbasDepA_suite()); + srunner_add_suite(sr, + auto_check_sbp_observation_MsgEphemerisSbasDepB_suite()); srunner_add_suite(sr, auto_check_sbp_observation_MsgGloBiases_suite()); srunner_add_suite(sr, auto_check_sbp_observation_MsgGnssCapb_suite()); srunner_add_suite(sr, auto_check_sbp_observation_MsgGroupDelay_suite()); @@ -156,7 +168,8 @@ int main(void) srunner_add_suite(sr, auto_check_sbp_observation_MsgObsDepC_suite()); srunner_add_suite(sr, auto_check_sbp_observation_MsgOsr_suite()); srunner_add_suite(sr, auto_check_sbp_observation_MsgSvAzEl_suite()); - srunner_add_suite(sr, auto_check_sbp_observation_MsgSvConfigurationGpsDep_suite()); + srunner_add_suite( + sr, auto_check_sbp_observation_MsgSvConfigurationGpsDep_suite()); srunner_add_suite(sr, auto_check_sbp_observation_msgEphemerisDepB_suite()); srunner_add_suite(sr, auto_check_sbp_observation_msgEphemerisQzss_suite()); srunner_add_suite(sr, auto_check_sbp_observation_msgObsDepA_suite()); @@ -190,13 +203,17 @@ int main(void) srunner_add_suite(sr, auto_check_sbp_piksi_MsgUartState_suite()); srunner_add_suite(sr, auto_check_sbp_piksi_MsgUartStateDepA_suite()); srunner_add_suite(sr, auto_check_sbp_sbas_MsgSbasRaw_suite()); - srunner_add_suite(sr, auto_check_sbp_settings_MsgSettingsReadByIndexDone_suite()); - srunner_add_suite(sr, auto_check_sbp_settings_MsgSettingsReadByIndexReq_suite()); - srunner_add_suite(sr, auto_check_sbp_settings_MsgSettingsReadByIndexResp_suite()); + srunner_add_suite(sr, + auto_check_sbp_settings_MsgSettingsReadByIndexDone_suite()); + srunner_add_suite(sr, + auto_check_sbp_settings_MsgSettingsReadByIndexReq_suite()); + srunner_add_suite(sr, + auto_check_sbp_settings_MsgSettingsReadByIndexResp_suite()); srunner_add_suite(sr, auto_check_sbp_settings_MsgSettingsReadReq_suite()); srunner_add_suite(sr, auto_check_sbp_settings_MsgSettingsReadResp_suite()); srunner_add_suite(sr, auto_check_sbp_settings_MsgSettingsRegister_suite()); - srunner_add_suite(sr, auto_check_sbp_settings_MsgSettingsRegisterResp_suite()); + srunner_add_suite(sr, + auto_check_sbp_settings_MsgSettingsRegisterResp_suite()); srunner_add_suite(sr, auto_check_sbp_settings_MsgSettingsSave_suite()); srunner_add_suite(sr, auto_check_sbp_settings_MsgSettingsWrite_suite()); srunner_add_suite(sr, auto_check_sbp_settings_MsgSettingsWriteResp_suite()); @@ -206,7 +223,8 @@ int main(void) srunner_add_suite(sr, auto_check_sbp_signing_MsgEcdsaSignature_suite()); srunner_add_suite(sr, auto_check_sbp_signing_MsgEcdsaSignatureDepA_suite()); srunner_add_suite(sr, auto_check_sbp_signing_MsgEcdsaSignatureDepB_suite()); - srunner_add_suite(sr, auto_check_sbp_signing_MsgEd25519CertificateDep_suite()); + srunner_add_suite(sr, + auto_check_sbp_signing_MsgEd25519CertificateDep_suite()); srunner_add_suite(sr, auto_check_sbp_signing_MsgEd25519SignatureDepA_suite()); srunner_add_suite(sr, auto_check_sbp_signing_MsgEd25519SignatureDepB_suite()); srunner_add_suite(sr, auto_check_sbp_solution_meta_MsgSolnMeta_suite()); @@ -215,12 +233,15 @@ int main(void) srunner_add_suite(sr, auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds_suite()); srunner_add_suite(sr, auto_check_sbp_ssr_MsgSsrGridDefinitionDepA_suite()); srunner_add_suite(sr, auto_check_sbp_ssr_MsgSsrGriddedCorrection_suite()); - srunner_add_suite(sr, auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds_suite()); + srunner_add_suite(sr, + auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds_suite()); srunner_add_suite(sr, auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA_suite()); - srunner_add_suite(sr, auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA_suite()); + srunner_add_suite( + sr, auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA_suite()); srunner_add_suite(sr, auto_check_sbp_ssr_MsgSsrOrbitClock_suite()); srunner_add_suite(sr, auto_check_sbp_ssr_MsgSsrOrbitClockBounds_suite()); - srunner_add_suite(sr, auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation_suite()); + srunner_add_suite( + sr, auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation_suite()); srunner_add_suite(sr, auto_check_sbp_ssr_MsgSsrOrbitClockDepA_suite()); srunner_add_suite(sr, auto_check_sbp_ssr_MsgSsrPhaseBiases_suite()); srunner_add_suite(sr, auto_check_sbp_ssr_MsgSsrSatelliteApc_suite()); @@ -251,8 +272,10 @@ int main(void) srunner_add_suite(sr, auto_check_sbp_tracking_MsgTrackingIqDepB_suite()); srunner_add_suite(sr, auto_check_sbp_tracking_MsgTrackingState_suite()); srunner_add_suite(sr, auto_check_sbp_tracking_MsgTrackingStateDepB_suite()); - srunner_add_suite(sr, auto_check_sbp_tracking_MsgTrackingStateDetailedDep_suite()); - srunner_add_suite(sr, auto_check_sbp_tracking_MsgTrackingStateDetailedDepA_suite()); + srunner_add_suite( + sr, auto_check_sbp_tracking_MsgTrackingStateDetailedDep_suite()); + srunner_add_suite( + sr, auto_check_sbp_tracking_MsgTrackingStateDetailedDepA_suite()); srunner_add_suite(sr, auto_check_sbp_tracking_MsgtrackingStateDepA_suite()); srunner_add_suite(sr, auto_check_sbp_user_MsgUserData_suite()); srunner_add_suite(sr, auto_check_sbp_vehicle_MsgOdometry_suite()); diff --git a/c/test/check_main_legacy.c b/c/test/check_main_legacy.c index 9b12cb2bc..f4fb8360d 100644 --- a/c/test/check_main_legacy.c +++ b/c/test/check_main_legacy.c @@ -12,12 +12,11 @@ // This file was auto-generated by generate.py. Do not modify by hand! -#include #include +#include #include "check_suites_legacy.h" -int main(void) -{ +int main(void) { int number_failed; Suite *s = edc_suite(); SRunner *sr = srunner_create(s); @@ -27,143 +26,232 @@ int main(void) // auto-generated tests: srunner_add_suite(sr, legacy_auto_check_sbp_acquisition_MsgAcqResult_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_acquisition_MsgAcqResultDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_acquisition_MsgAcqResultDepB_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_acquisition_MsgAcqResultDepC_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_acquisition_MsgAcqSvProfile_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeReq_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_bootload_MsgNapDeviceDnaReq_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_acquisition_MsgAcqResultDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_acquisition_MsgAcqResultDepB_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_acquisition_MsgAcqResultDepC_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_acquisition_MsgAcqSvProfile_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeReq_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_bootload_MsgNapDeviceDnaReq_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_ext_events_MsgExtEvent_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_file_io_MsgFileioConfigReq_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_file_io_MsgFileioConfigResp_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_file_io_MsgFileioReadDirReq_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_file_io_MsgFileioReadDirResp_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_file_io_MsgFileioConfigReq_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_file_io_MsgFileioConfigResp_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_file_io_MsgFileioReadDirReq_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_file_io_MsgFileioReadDirResp_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_file_io_MsgFileioReadReq_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_file_io_MsgFileioReadResp_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_file_io_MsgFileioReadResp_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_file_io_MsgFileioRemove_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_file_io_MsgFileioWriteResp_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_file_io_MsgFileioWriteResp_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_flash_MsgFlashDone_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_flash_MsgFlashErase_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_flash_MsgFlashProgram_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_flash_MsgFlashReadReq_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_flash_MsgFlashReadResp_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_flash_MsgStmFlashLockSector_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_flash_MsgStmFlashLockSector_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_flash_MsgStmUniqueIdReq_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_flash_MsgStmUniqueIdResp_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_imu_MsgImuAux_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_imu_MsgImuRaw_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_integrity_MsgAcknowledge_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel_suite()); + srunner_add_suite( + sr, + legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_linux_MsgLinuxCpuState_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_linux_MsgLinuxMemState_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_linux_MsgLinuxSocketUsage_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_linux_MsgLinuxSocketUsage_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_linux_MsgLinuxSysState_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_logging_MsgFwd_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_logging_MsgLog_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_logging_MsgPrintDep_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_mag_MsgMagRaw_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgAgeCorrections_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgBaselineECEF_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgBaselineNED_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgAgeCorrections_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgBaselineECEF_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgBaselineNED_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgDops_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgDopsDepA_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgGPSTime_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgGPSTimeDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgGPSTimeDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgPosECEF_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgPosECEFCov_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgPosECEFDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgPosECEFGNSS_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgPosECEFDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgPosECEFGNSS_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgPosLLH_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgPosLLHCov_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgPosLLHDepA_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgPosLlhAcc_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgPosLlhGnss_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgPoseRelative_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgProtectionLevel_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgReferenceFrameParam_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgUTCLeapSecond_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgPoseRelative_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_navigation_MsgProtectionLevel_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_navigation_MsgReferenceFrameParam_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgUTCLeapSecond_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgUTCTime_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgVelBody_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgVelCog_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgVelECEF_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgVelECEFCov_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgVelECEFDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgVelEcefGnss_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgVelECEFDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgVelEcefGnss_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgVelNED_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgVelNEDCOV_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgVelNEDDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgVelNedCovGnss_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_navigation_MsgVelNedCovGnss_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_navigation_MsgVelNedGnss_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_ndb_MsgNdbEvent_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgAlmanacGLO_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgAlmanacGLODep_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgAlmanacGPS_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgAlmanacGPSDep_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgBasePosEcef_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgBasePosLLH_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisBds_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisDepC_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisDepD_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisGLO_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisGLODepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisGLODepB_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisGLODepC_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisGLODepD_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisGPS_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisGal_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisGalDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisSbas_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_MsgAlmanacGLO_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_MsgAlmanacGLODep_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_MsgAlmanacGPS_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_MsgAlmanacGPSDep_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_MsgBasePosEcef_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_MsgBasePosLLH_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_MsgEphemerisBds_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_MsgEphemerisDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_MsgEphemerisDepC_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_MsgEphemerisDepD_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_MsgEphemerisGLO_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_observation_MsgEphemerisGLODepA_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_observation_MsgEphemerisGLODepB_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_observation_MsgEphemerisGLODepC_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_observation_MsgEphemerisGLODepD_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_MsgEphemerisGPS_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_MsgEphemerisGal_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_observation_MsgEphemerisGalDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_MsgEphemerisSbas_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgGloBiases_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgGnssCapb_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgGroupDelay_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgGroupDelayDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgGroupDelayDepB_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_MsgGroupDelay_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_observation_MsgGroupDelayDepA_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_observation_MsgGroupDelayDepB_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgIono_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgObs_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgObsDepB_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgObsDepC_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgOsr_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgSvAzEl_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_msgEphemerisDepB_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_observation_msgEphemerisQzss_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_msgEphemerisDepB_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_observation_msgEphemerisQzss_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_observation_msgObsDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_orientation_MsgAngularRate_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_orientation_MsgBaselineHeading_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_orientation_MsgOrientEuler_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_orientation_MsgOrientQuat_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_orientation_MsgAngularRate_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_orientation_MsgBaselineHeading_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_orientation_MsgOrientEuler_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_orientation_MsgOrientQuat_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_piksi_MsgAlmanac_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_piksi_MsgCellModemStatus_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_piksi_MsgCommandOutput_suite()); @@ -176,10 +264,13 @@ int main(void) srunner_add_suite(sr, legacy_auto_check_sbp_piksi_MsgIarState_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_piksi_MsgInitBaseDep_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_piksi_MsgMaskSatellite_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_piksi_MsgNetworkStateReq_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_piksi_MsgNetworkStateResp_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_piksi_MsgNetworkStateResp_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_piksi_MsgReset_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_piksi_MsgResetDep_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_piksi_MsgResetFilters_suite()); @@ -190,49 +281,83 @@ int main(void) srunner_add_suite(sr, legacy_auto_check_sbp_piksi_MsgUartState_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_piksi_MsgUartStateDepA_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_sbas_MsgSbasRaw_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_settings_MsgSettingsReadByIndexDone_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_settings_MsgSettingsReadReq_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_settings_MsgSettingsReadResp_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_settings_MsgSettingsRegister_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_settings_MsgSettingsRegisterResp_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_settings_MsgSettingsReadByIndexDone_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_settings_MsgSettingsReadReq_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_settings_MsgSettingsReadResp_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_settings_MsgSettingsRegister_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_settings_MsgSettingsRegisterResp_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_settings_MsgSettingsSave_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_settings_MsgSettingsWrite_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_settings_MsgSettingsWriteResp_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_signing_MsgCertificateChain_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_signing_MsgCertificateChainDep_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_signing_MsgEcdsaCertificate_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_signing_MsgEcdsaSignature_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_signing_MsgEd25519CertificateDep_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_solution_meta_MsgSolnMeta_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_settings_MsgSettingsWrite_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_settings_MsgSettingsWriteResp_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_signing_MsgCertificateChain_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_signing_MsgCertificateChainDep_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_signing_MsgEcdsaCertificate_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_signing_MsgEcdsaSignature_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_signing_MsgEd25519CertificateDep_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_solution_meta_MsgSolnMeta_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrCodeBiases_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrOrbitClock_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrStecCorrection_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrTileDefinition_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_system_MsgCsacTelemetry_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_system_MsgCsacTelemetryLabels_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_system_MsgCsacTelemetryLabels_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_system_MsgDgnssStatus_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_system_MsgGnssTimeOffset_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_system_MsgGroupMeta_suite()); @@ -245,15 +370,23 @@ int main(void) srunner_add_suite(sr, legacy_auto_check_sbp_system_MsgStatusJournal_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_system_MsgStatusReport_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_telemetry_MsgTelSv_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_tracking_MsgMeasurementState_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_tracking_MsgMeasurementState_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_tracking_MsgTrackingIq_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_tracking_MsgTrackingIqDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_tracking_MsgTrackingIqDepB_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_tracking_MsgTrackingState_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_tracking_MsgTrackingStateDepB_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA_suite()); - srunner_add_suite(sr, legacy_auto_check_sbp_tracking_MsgtrackingStateDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_tracking_MsgTrackingIqDepA_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_tracking_MsgTrackingIqDepB_suite()); + srunner_add_suite(sr, + legacy_auto_check_sbp_tracking_MsgTrackingState_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_tracking_MsgTrackingStateDepB_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_tracking_MsgtrackingStateDepA_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_user_MsgUserData_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_vehicle_MsgOdometry_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_vehicle_MsgWheeltick_suite()); diff --git a/c/test/check_suites_legacy.h b/c/test/check_suites_legacy.h index a43e3b752..97c3e3d51 100644 --- a/c/test/check_suites_legacy.h +++ b/c/test/check_suites_legacy.h @@ -53,7 +53,8 @@ Suite* legacy_auto_check_sbp_imu_MsgImuAux_suite(void); Suite* legacy_auto_check_sbp_imu_MsgImuRaw_suite(void); Suite* legacy_auto_check_sbp_integrity_MsgAcknowledge_suite(void); Suite* legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel_suite(void); -Suite* legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos_suite(void); +Suite* legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos_suite( + void); Suite* legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints_suite(void); Suite* legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos_suite(void); Suite* legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites_suite(void); diff --git a/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResult.cc b/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResult.cc index b4f87a075..22da9ada7 100644 --- a/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResult.cc +++ b/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResult.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResult.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResult.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_acquisition_MsgAcqResult0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResult0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_acquisition_MsgAcqResult0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResult0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,40 +67,51 @@ class Test_auto_check_sbp_acquisition_MsgAcqResult0 : sbp_msg_acq_result_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResult0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResult0, Test) { + uint8_t encoded_frame[] = { + 85, 47, 0, 195, 4, 14, 0, 0, 104, 65, 102, + 102, 144, 66, 205, 196, 0, 70, 8, 0, 207, 189, + }; - uint8_t encoded_frame[] = {85,47,0,195,4,14,0,0,104,65,102,102,144,66,205,196,0,70,8,0,207,189, }; + sbp_msg_acq_result_t test_msg{}; + test_msg.cf = 8241.2001953125; + test_msg.cn0 = 14.5; + test_msg.cp = 72.19999694824219; + test_msg.sid.code = 0; + test_msg.sid.sat = 8; - sbp_msg_acq_result_t test_msg{}; - test_msg.cf = 8241.2001953125; - test_msg.cn0 = 14.5; - test_msg.cp = 72.19999694824219; - test_msg.sid.code = 0; - test_msg.sid.sat = 8; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - 8241.20019531 * 100), 0.05) << "incorrect value for last_msg_.cf, expected 8241.20019531, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cn0 * 100 - 14.5 * 100), 0.05) << "incorrect value for last_msg_.cn0, expected 14.5, is " << last_msg_.cn0; - EXPECT_LT((last_msg_.cp * 100 - 72.1999969482 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 72.1999969482, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.sat, 8) << "incorrect value for last_msg_.sid.sat, expected 8, is " << last_msg_.sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - 8241.20019531 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected 8241.20019531, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cn0 * 100 - 14.5 * 100), 0.05) + << "incorrect value for last_msg_.cn0, expected 14.5, is " + << last_msg_.cn0; + EXPECT_LT((last_msg_.cp * 100 - 72.1999969482 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 72.1999969482, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.sat, 8) + << "incorrect value for last_msg_.sid.sat, expected 8, is " + << last_msg_.sid.sat; } diff --git a/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResultDepA.cc b/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResultDepA.cc index c919c45e9..8e4297648 100644 --- a/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResultDepA.cc +++ b/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResultDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_acquisition_MsgAcqResultDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_acquisition_MsgAcqResultDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,88 +67,90 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepA0 : sbp_msg_acq_result_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,21,0,195,4,13,0,0,104,65,0,192,53,68,198,199,0,70,8,2,68, }; - - sbp_msg_acq_result_dep_a_t test_msg{}; - test_msg.cf = 8241.943359375; - test_msg.cp = 727.0; - test_msg.prn = 8; - test_msg.snr = 14.5; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - 8241.94335938 * 100), 0.05) << "incorrect value for last_msg_.cf, expected 8241.94335938, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cp * 100 - 727.0 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 727.0, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.prn, 8) << "incorrect value for last_msg_.prn, expected 8, is " << last_msg_.prn; - EXPECT_LT((last_msg_.snr * 100 - 14.5 * 100), 0.05) << "incorrect value for last_msg_.snr, expected 14.5, is " << last_msg_.snr; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 0, 0, 104, 65, 0, + 192, 53, 68, 198, 199, 0, 70, 8, 2, 68, + }; + + sbp_msg_acq_result_dep_a_t test_msg{}; + test_msg.cf = 8241.943359375; + test_msg.cp = 727.0; + test_msg.prn = 8; + test_msg.snr = 14.5; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - 8241.94335938 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected 8241.94335938, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cp * 100 - 727.0 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 727.0, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.prn, 8) + << "incorrect value for last_msg_.prn, expected 8, is " << last_msg_.prn; + EXPECT_LT((last_msg_.snr * 100 - 14.5 * 100), 0.05) + << "incorrect value for last_msg_.snr, expected 14.5, is " + << last_msg_.snr; } -class Test_auto_check_sbp_acquisition_MsgAcqResultDepA1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepA1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_acquisition_MsgAcqResultDepA1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepA1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -160,88 +158,90 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepA1 : sbp_msg_acq_result_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,21,0,195,4,13,205,204,116,65,0,192,179,67,33,81,59,68,9,219,27, }; - - sbp_msg_acq_result_dep_a_t test_msg{}; - test_msg.cf = 749.2676391601562; - test_msg.cp = 359.5; - test_msg.prn = 9; - test_msg.snr = 15.300000190734863; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - 749.26763916 * 100), 0.05) << "incorrect value for last_msg_.cf, expected 749.26763916, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cp * 100 - 359.5 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 359.5, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.prn, 9) << "incorrect value for last_msg_.prn, expected 9, is " << last_msg_.prn; - EXPECT_LT((last_msg_.snr * 100 - 15.3000001907 * 100), 0.05) << "incorrect value for last_msg_.snr, expected 15.3000001907, is " << last_msg_.snr; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 116, 65, 0, + 192, 179, 67, 33, 81, 59, 68, 9, 219, 27, + }; + + sbp_msg_acq_result_dep_a_t test_msg{}; + test_msg.cf = 749.2676391601562; + test_msg.cp = 359.5; + test_msg.prn = 9; + test_msg.snr = 15.300000190734863; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - 749.26763916 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected 749.26763916, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cp * 100 - 359.5 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 359.5, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.prn, 9) + << "incorrect value for last_msg_.prn, expected 9, is " << last_msg_.prn; + EXPECT_LT((last_msg_.snr * 100 - 15.3000001907 * 100), 0.05) + << "incorrect value for last_msg_.snr, expected 15.3000001907, is " + << last_msg_.snr; } -class Test_auto_check_sbp_acquisition_MsgAcqResultDepA2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepA2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_acquisition_MsgAcqResultDepA2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepA2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -249,88 +249,89 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepA2 : sbp_msg_acq_result_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,21,0,195,4,13,205,204,144,65,0,0,34,66,57,237,202,197,11,150,35, }; - - sbp_msg_acq_result_dep_a_t test_msg{}; - test_msg.cf = -6493.65283203125; - test_msg.cp = 40.5; - test_msg.prn = 11; - test_msg.snr = 18.100000381469727; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - -6493.65283203 * 100), 0.05) << "incorrect value for last_msg_.cf, expected -6493.65283203, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cp * 100 - 40.5 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 40.5, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.prn, 11) << "incorrect value for last_msg_.prn, expected 11, is " << last_msg_.prn; - EXPECT_LT((last_msg_.snr * 100 - 18.1000003815 * 100), 0.05) << "incorrect value for last_msg_.snr, expected 18.1000003815, is " << last_msg_.snr; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 144, 65, 0, + 0, 34, 66, 57, 237, 202, 197, 11, 150, 35, + }; + + sbp_msg_acq_result_dep_a_t test_msg{}; + test_msg.cf = -6493.65283203125; + test_msg.cp = 40.5; + test_msg.prn = 11; + test_msg.snr = 18.100000381469727; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - -6493.65283203 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected -6493.65283203, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cp * 100 - 40.5 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 40.5, is " << last_msg_.cp; + EXPECT_EQ(last_msg_.prn, 11) + << "incorrect value for last_msg_.prn, expected 11, is " << last_msg_.prn; + EXPECT_LT((last_msg_.snr * 100 - 18.1000003815 * 100), 0.05) + << "incorrect value for last_msg_.snr, expected 18.1000003815, is " + << last_msg_.snr; } -class Test_auto_check_sbp_acquisition_MsgAcqResultDepA3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepA3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_acquisition_MsgAcqResultDepA3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepA3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -338,88 +339,90 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepA3 : sbp_msg_acq_result_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,21,0,195,4,13,205,204,116,65,0,32,9,68,129,193,121,196,12,146,118, }; - - sbp_msg_acq_result_dep_a_t test_msg{}; - test_msg.cf = -999.0234985351562; - test_msg.cp = 548.5; - test_msg.prn = 12; - test_msg.snr = 15.300000190734863; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - -999.023498535 * 100), 0.05) << "incorrect value for last_msg_.cf, expected -999.023498535, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cp * 100 - 548.5 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 548.5, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.prn, 12) << "incorrect value for last_msg_.prn, expected 12, is " << last_msg_.prn; - EXPECT_LT((last_msg_.snr * 100 - 15.3000001907 * 100), 0.05) << "incorrect value for last_msg_.snr, expected 15.3000001907, is " << last_msg_.snr; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 116, 65, 0, + 32, 9, 68, 129, 193, 121, 196, 12, 146, 118, + }; + + sbp_msg_acq_result_dep_a_t test_msg{}; + test_msg.cf = -999.0234985351562; + test_msg.cp = 548.5; + test_msg.prn = 12; + test_msg.snr = 15.300000190734863; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - -999.023498535 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected -999.023498535, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cp * 100 - 548.5 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 548.5, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.prn, 12) + << "incorrect value for last_msg_.prn, expected 12, is " << last_msg_.prn; + EXPECT_LT((last_msg_.snr * 100 - 15.3000001907 * 100), 0.05) + << "incorrect value for last_msg_.snr, expected 15.3000001907, is " + << last_msg_.snr; } -class Test_auto_check_sbp_acquisition_MsgAcqResultDepA4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepA4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_acquisition_MsgAcqResultDepA4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepA4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -427,88 +430,90 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepA4 : sbp_msg_acq_result_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,21,0,195,4,13,205,204,116,65,0,32,67,68,228,74,148,69,14,23,75, }; - - sbp_msg_acq_result_dep_a_t test_msg{}; - test_msg.cf = 4745.361328125; - test_msg.cp = 780.5; - test_msg.prn = 14; - test_msg.snr = 15.300000190734863; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - 4745.36132812 * 100), 0.05) << "incorrect value for last_msg_.cf, expected 4745.36132812, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cp * 100 - 780.5 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 780.5, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.prn, 14) << "incorrect value for last_msg_.prn, expected 14, is " << last_msg_.prn; - EXPECT_LT((last_msg_.snr * 100 - 15.3000001907 * 100), 0.05) << "incorrect value for last_msg_.snr, expected 15.3000001907, is " << last_msg_.snr; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 116, 65, 0, + 32, 67, 68, 228, 74, 148, 69, 14, 23, 75, + }; + + sbp_msg_acq_result_dep_a_t test_msg{}; + test_msg.cf = 4745.361328125; + test_msg.cp = 780.5; + test_msg.prn = 14; + test_msg.snr = 15.300000190734863; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - 4745.36132812 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected 4745.36132812, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cp * 100 - 780.5 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 780.5, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.prn, 14) + << "incorrect value for last_msg_.prn, expected 14, is " << last_msg_.prn; + EXPECT_LT((last_msg_.snr * 100 - 15.3000001907 * 100), 0.05) + << "incorrect value for last_msg_.snr, expected 15.3000001907, is " + << last_msg_.snr; } -class Test_auto_check_sbp_acquisition_MsgAcqResultDepA5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepA5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_acquisition_MsgAcqResultDepA5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepA5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -516,38 +521,46 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepA5 : sbp_msg_acq_result_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,21,0,195,4,13,228,56,35,67,0,32,18,68,129,193,249,195,0,204,207, }; - - sbp_msg_acq_result_dep_a_t test_msg{}; - test_msg.cf = -499.5117492675781; - test_msg.cp = 584.5; - test_msg.prn = 0; - test_msg.snr = 163.22222900390625; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - -499.511749268 * 100), 0.05) << "incorrect value for last_msg_.cf, expected -499.511749268, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cp * 100 - 584.5 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 584.5, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.prn, 0) << "incorrect value for last_msg_.prn, expected 0, is " << last_msg_.prn; - EXPECT_LT((last_msg_.snr * 100 - 163.222229004 * 100), 0.05) << "incorrect value for last_msg_.snr, expected 163.222229004, is " << last_msg_.snr; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 228, 56, 35, 67, 0, + 32, 18, 68, 129, 193, 249, 195, 0, 204, 207, + }; + + sbp_msg_acq_result_dep_a_t test_msg{}; + test_msg.cf = -499.5117492675781; + test_msg.cp = 584.5; + test_msg.prn = 0; + test_msg.snr = 163.22222900390625; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - -499.511749268 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected -499.511749268, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cp * 100 - 584.5 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 584.5, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.prn, 0) + << "incorrect value for last_msg_.prn, expected 0, is " << last_msg_.prn; + EXPECT_LT((last_msg_.snr * 100 - 163.222229004 * 100), 0.05) + << "incorrect value for last_msg_.snr, expected 163.222229004, is " + << last_msg_.snr; } diff --git a/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResultDepB.cc b/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResultDepB.cc index 5f288c799..975902b06 100644 --- a/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResultDepB.cc +++ b/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResultDepB.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepB.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_acquisition_MsgAcqResultDepB0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepB0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_acquisition_MsgAcqResultDepB0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepB0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,92 +67,99 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepB0 : sbp_msg_acq_result_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepB0, Test) -{ - - uint8_t encoded_frame[] = {85,20,0,246,215,16,137,167,18,66,0,0,161,67,240,24,156,69,9,0,0,0,80,195, }; - - sbp_msg_acq_result_dep_b_t test_msg{}; - test_msg.cf = 4995.1171875; - test_msg.cp = 322.0; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 9; - test_msg.snr = 36.66360855102539; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - 4995.1171875 * 100), 0.05) << "incorrect value for last_msg_.cf, expected 4995.1171875, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cp * 100 - 322.0 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 322.0, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 9) << "incorrect value for last_msg_.sid.sat, expected 9, is " << last_msg_.sid.sat; - EXPECT_LT((last_msg_.snr * 100 - 36.663608551 * 100), 0.05) << "incorrect value for last_msg_.snr, expected 36.663608551, is " << last_msg_.snr; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 137, 167, 18, 66, 0, 0, + 161, 67, 240, 24, 156, 69, 9, 0, 0, 0, 80, 195, + }; + + sbp_msg_acq_result_dep_b_t test_msg{}; + test_msg.cf = 4995.1171875; + test_msg.cp = 322.0; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 9; + test_msg.snr = 36.66360855102539; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - 4995.1171875 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected 4995.1171875, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cp * 100 - 322.0 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 322.0, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 9) + << "incorrect value for last_msg_.sid.sat, expected 9, is " + << last_msg_.sid.sat; + EXPECT_LT((last_msg_.snr * 100 - 36.663608551 * 100), 0.05) + << "incorrect value for last_msg_.snr, expected 36.663608551, is " + << last_msg_.snr; } -class Test_auto_check_sbp_acquisition_MsgAcqResultDepB1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepB1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_acquisition_MsgAcqResultDepB1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepB1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -164,92 +167,99 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepB1 : sbp_msg_acq_result_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepB1, Test) -{ - - uint8_t encoded_frame[] = {85,20,0,246,215,16,206,172,16,66,0,192,82,68,198,199,0,198,3,0,0,0,149,143, }; - - sbp_msg_acq_result_dep_b_t test_msg{}; - test_msg.cf = -8241.943359375; - test_msg.cp = 843.0; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 3; - test_msg.snr = 36.16875457763672; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - -8241.94335938 * 100), 0.05) << "incorrect value for last_msg_.cf, expected -8241.94335938, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cp * 100 - 843.0 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 843.0, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 3) << "incorrect value for last_msg_.sid.sat, expected 3, is " << last_msg_.sid.sat; - EXPECT_LT((last_msg_.snr * 100 - 36.1687545776 * 100), 0.05) << "incorrect value for last_msg_.snr, expected 36.1687545776, is " << last_msg_.snr; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepB1, Test) { + uint8_t encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 206, 172, 16, 66, 0, 192, + 82, 68, 198, 199, 0, 198, 3, 0, 0, 0, 149, 143, + }; + + sbp_msg_acq_result_dep_b_t test_msg{}; + test_msg.cf = -8241.943359375; + test_msg.cp = 843.0; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 3; + test_msg.snr = 36.16875457763672; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - -8241.94335938 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected -8241.94335938, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cp * 100 - 843.0 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 843.0, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 3) + << "incorrect value for last_msg_.sid.sat, expected 3, is " + << last_msg_.sid.sat; + EXPECT_LT((last_msg_.snr * 100 - 36.1687545776 * 100), 0.05) + << "incorrect value for last_msg_.snr, expected 36.1687545776, is " + << last_msg_.snr; } -class Test_auto_check_sbp_acquisition_MsgAcqResultDepB2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepB2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_acquisition_MsgAcqResultDepB2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepB2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -257,92 +267,99 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepB2 : sbp_msg_acq_result_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepB2, Test) -{ - - uint8_t encoded_frame[] = {85,20,0,246,215,16,228,27,15,66,0,128,70,68,228,74,148,69,18,0,0,0,179,155, }; - - sbp_msg_acq_result_dep_b_t test_msg{}; - test_msg.cf = 4745.361328125; - test_msg.cp = 794.0; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 18; - test_msg.snr = 35.77723693847656; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - 4745.36132812 * 100), 0.05) << "incorrect value for last_msg_.cf, expected 4745.36132812, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cp * 100 - 794.0 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 794.0, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 18) << "incorrect value for last_msg_.sid.sat, expected 18, is " << last_msg_.sid.sat; - EXPECT_LT((last_msg_.snr * 100 - 35.7772369385 * 100), 0.05) << "incorrect value for last_msg_.snr, expected 35.7772369385, is " << last_msg_.snr; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepB2, Test) { + uint8_t encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 228, 27, 15, 66, 0, 128, + 70, 68, 228, 74, 148, 69, 18, 0, 0, 0, 179, 155, + }; + + sbp_msg_acq_result_dep_b_t test_msg{}; + test_msg.cf = 4745.361328125; + test_msg.cp = 794.0; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 18; + test_msg.snr = 35.77723693847656; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - 4745.36132812 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected 4745.36132812, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cp * 100 - 794.0 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 794.0, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 18) + << "incorrect value for last_msg_.sid.sat, expected 18, is " + << last_msg_.sid.sat; + EXPECT_LT((last_msg_.snr * 100 - 35.7772369385 * 100), 0.05) + << "incorrect value for last_msg_.snr, expected 35.7772369385, is " + << last_msg_.snr; } -class Test_auto_check_sbp_acquisition_MsgAcqResultDepB3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepB3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_acquisition_MsgAcqResultDepB3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepB3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -350,92 +367,99 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepB3 : sbp_msg_acq_result_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepB3, Test) -{ - - uint8_t encoded_frame[] = {85,20,0,246,215,16,46,199,14,66,0,64,129,67,240,24,28,69,17,0,0,0,18,181, }; - - sbp_msg_acq_result_dep_b_t test_msg{}; - test_msg.cf = 2497.55859375; - test_msg.cp = 258.5; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 17; - test_msg.snr = 35.69451141357422; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - 2497.55859375 * 100), 0.05) << "incorrect value for last_msg_.cf, expected 2497.55859375, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cp * 100 - 258.5 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 258.5, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 17) << "incorrect value for last_msg_.sid.sat, expected 17, is " << last_msg_.sid.sat; - EXPECT_LT((last_msg_.snr * 100 - 35.6945114136 * 100), 0.05) << "incorrect value for last_msg_.snr, expected 35.6945114136, is " << last_msg_.snr; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepB3, Test) { + uint8_t encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 46, 199, 14, 66, 0, 64, + 129, 67, 240, 24, 28, 69, 17, 0, 0, 0, 18, 181, + }; + + sbp_msg_acq_result_dep_b_t test_msg{}; + test_msg.cf = 2497.55859375; + test_msg.cp = 258.5; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 17; + test_msg.snr = 35.69451141357422; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - 2497.55859375 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected 2497.55859375, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cp * 100 - 258.5 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 258.5, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 17) + << "incorrect value for last_msg_.sid.sat, expected 17, is " + << last_msg_.sid.sat; + EXPECT_LT((last_msg_.snr * 100 - 35.6945114136 * 100), 0.05) + << "incorrect value for last_msg_.snr, expected 35.6945114136, is " + << last_msg_.snr; } -class Test_auto_check_sbp_acquisition_MsgAcqResultDepB4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepB4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_acquisition_MsgAcqResultDepB4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepB4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -443,42 +467,55 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepB4 : sbp_msg_acq_result_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepB4, Test) -{ - - uint8_t encoded_frame[] = {85,20,0,246,215,16,194,24,14,66,0,128,2,68,129,193,249,195,5,0,0,0,35,203, }; - - sbp_msg_acq_result_dep_b_t test_msg{}; - test_msg.cf = -499.5117492675781; - test_msg.cp = 522.0; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 5; - test_msg.snr = 35.52417755126953; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - -499.511749268 * 100), 0.05) << "incorrect value for last_msg_.cf, expected -499.511749268, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cp * 100 - 522.0 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 522.0, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 5) << "incorrect value for last_msg_.sid.sat, expected 5, is " << last_msg_.sid.sat; - EXPECT_LT((last_msg_.snr * 100 - 35.5241775513 * 100), 0.05) << "incorrect value for last_msg_.snr, expected 35.5241775513, is " << last_msg_.snr; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepB4, Test) { + uint8_t encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 194, 24, 14, 66, 0, 128, + 2, 68, 129, 193, 249, 195, 5, 0, 0, 0, 35, 203, + }; + + sbp_msg_acq_result_dep_b_t test_msg{}; + test_msg.cf = -499.5117492675781; + test_msg.cp = 522.0; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 5; + test_msg.snr = 35.52417755126953; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - -499.511749268 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected -499.511749268, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cp * 100 - 522.0 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 522.0, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 5) + << "incorrect value for last_msg_.sid.sat, expected 5, is " + << last_msg_.sid.sat; + EXPECT_LT((last_msg_.snr * 100 - 35.5241775513 * 100), 0.05) + << "incorrect value for last_msg_.snr, expected 35.5241775513, is " + << last_msg_.snr; } diff --git a/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResultDepC.cc b/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResultDepC.cc index a557f0782..b78988b1d 100644 --- a/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResultDepC.cc +++ b/c/test/cpp/auto_check_sbp_acquisition_MsgAcqResultDepC.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepC.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_acquisition_MsgAcqResultDepC0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepC0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_acquisition_MsgAcqResultDepC0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepC0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_c_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,92 +67,99 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepC0 : sbp_msg_acq_result_dep_c_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepC0, Test) -{ - - uint8_t encoded_frame[] = {85,31,0,40,12,16,72,9,34,66,155,152,228,67,28,34,221,68,10,0,0,0,9,189, }; - - sbp_msg_acq_result_dep_c_t test_msg{}; - test_msg.cf = 1769.06591796875; - test_msg.cn0 = 40.509063720703125; - test_msg.cp = 457.1922302246094; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 10; - - EXPECT_EQ(send_message( 3112, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 3112); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - 1769.06591797 * 100), 0.05) << "incorrect value for last_msg_.cf, expected 1769.06591797, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cn0 * 100 - 40.5090637207 * 100), 0.05) << "incorrect value for last_msg_.cn0, expected 40.5090637207, is " << last_msg_.cn0; - EXPECT_LT((last_msg_.cp * 100 - 457.192230225 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 457.192230225, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 10) << "incorrect value for last_msg_.sid.sat, expected 10, is " << last_msg_.sid.sat; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepC0, Test) { + uint8_t encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 72, 9, 34, 66, 155, 152, + 228, 67, 28, 34, 221, 68, 10, 0, 0, 0, 9, 189, + }; + + sbp_msg_acq_result_dep_c_t test_msg{}; + test_msg.cf = 1769.06591796875; + test_msg.cn0 = 40.509063720703125; + test_msg.cp = 457.1922302246094; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 10; + + EXPECT_EQ(send_message(3112, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 3112); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - 1769.06591797 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected 1769.06591797, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cn0 * 100 - 40.5090637207 * 100), 0.05) + << "incorrect value for last_msg_.cn0, expected 40.5090637207, is " + << last_msg_.cn0; + EXPECT_LT((last_msg_.cp * 100 - 457.192230225 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 457.192230225, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 10) + << "incorrect value for last_msg_.sid.sat, expected 10, is " + << last_msg_.sid.sat; } -class Test_auto_check_sbp_acquisition_MsgAcqResultDepC1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepC1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_acquisition_MsgAcqResultDepC1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepC1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_c_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -164,92 +167,99 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepC1 : sbp_msg_acq_result_dep_c_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepC1, Test) -{ - - uint8_t encoded_frame[] = {85,31,0,40,12,16,132,250,45,66,207,93,88,68,68,185,252,195,6,0,0,0,136,185, }; - - sbp_msg_acq_result_dep_c_t test_msg{}; - test_msg.cf = -505.4473876953125; - test_msg.cn0 = 43.49464416503906; - test_msg.cp = 865.4657592773438; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 6; - - EXPECT_EQ(send_message( 3112, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 3112); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - -505.447387695 * 100), 0.05) << "incorrect value for last_msg_.cf, expected -505.447387695, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cn0 * 100 - 43.494644165 * 100), 0.05) << "incorrect value for last_msg_.cn0, expected 43.494644165, is " << last_msg_.cn0; - EXPECT_LT((last_msg_.cp * 100 - 865.465759277 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 865.465759277, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 6) << "incorrect value for last_msg_.sid.sat, expected 6, is " << last_msg_.sid.sat; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepC1, Test) { + uint8_t encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 132, 250, 45, 66, 207, 93, + 88, 68, 68, 185, 252, 195, 6, 0, 0, 0, 136, 185, + }; + + sbp_msg_acq_result_dep_c_t test_msg{}; + test_msg.cf = -505.4473876953125; + test_msg.cn0 = 43.49464416503906; + test_msg.cp = 865.4657592773438; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 6; + + EXPECT_EQ(send_message(3112, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 3112); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - -505.447387695 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected -505.447387695, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cn0 * 100 - 43.494644165 * 100), 0.05) + << "incorrect value for last_msg_.cn0, expected 43.494644165, is " + << last_msg_.cn0; + EXPECT_LT((last_msg_.cp * 100 - 865.465759277 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 865.465759277, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 6) + << "incorrect value for last_msg_.sid.sat, expected 6, is " + << last_msg_.sid.sat; } -class Test_auto_check_sbp_acquisition_MsgAcqResultDepC2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepC2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_acquisition_MsgAcqResultDepC2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepC2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_c_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -257,92 +267,99 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepC2 : sbp_msg_acq_result_dep_c_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepC2, Test) -{ - - uint8_t encoded_frame[] = {85,31,0,40,12,16,163,223,24,66,64,91,102,67,202,243,157,196,13,0,0,0,150,161, }; - - sbp_msg_acq_result_dep_c_t test_msg{}; - test_msg.cf = -1263.618408203125; - test_msg.cn0 = 38.2183952331543; - test_msg.cp = 230.3564453125; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 13; - - EXPECT_EQ(send_message( 3112, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 3112); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - -1263.6184082 * 100), 0.05) << "incorrect value for last_msg_.cf, expected -1263.6184082, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cn0 * 100 - 38.2183952332 * 100), 0.05) << "incorrect value for last_msg_.cn0, expected 38.2183952332, is " << last_msg_.cn0; - EXPECT_LT((last_msg_.cp * 100 - 230.356445312 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 230.356445312, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 13) << "incorrect value for last_msg_.sid.sat, expected 13, is " << last_msg_.sid.sat; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepC2, Test) { + uint8_t encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 163, 223, 24, 66, 64, 91, + 102, 67, 202, 243, 157, 196, 13, 0, 0, 0, 150, 161, + }; + + sbp_msg_acq_result_dep_c_t test_msg{}; + test_msg.cf = -1263.618408203125; + test_msg.cn0 = 38.2183952331543; + test_msg.cp = 230.3564453125; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 13; + + EXPECT_EQ(send_message(3112, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 3112); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - -1263.6184082 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected -1263.6184082, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cn0 * 100 - 38.2183952332 * 100), 0.05) + << "incorrect value for last_msg_.cn0, expected 38.2183952332, is " + << last_msg_.cn0; + EXPECT_LT((last_msg_.cp * 100 - 230.356445312 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 230.356445312, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 13) + << "incorrect value for last_msg_.sid.sat, expected 13, is " + << last_msg_.sid.sat; } -class Test_auto_check_sbp_acquisition_MsgAcqResultDepC3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepC3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_acquisition_MsgAcqResultDepC3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepC3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_c_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -350,92 +367,99 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepC3 : sbp_msg_acq_result_dep_c_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepC3, Test) -{ - - uint8_t encoded_frame[] = {85,31,0,40,12,16,129,65,21,66,224,214,124,67,243,138,61,69,1,0,0,0,109,209, }; - - sbp_msg_acq_result_dep_c_t test_msg{}; - test_msg.cf = 3032.684326171875; - test_msg.cn0 = 37.313968658447266; - test_msg.cp = 252.83935546875; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 1; - - EXPECT_EQ(send_message( 3112, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 3112); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - 3032.68432617 * 100), 0.05) << "incorrect value for last_msg_.cf, expected 3032.68432617, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cn0 * 100 - 37.3139686584 * 100), 0.05) << "incorrect value for last_msg_.cn0, expected 37.3139686584, is " << last_msg_.cn0; - EXPECT_LT((last_msg_.cp * 100 - 252.839355469 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 252.839355469, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 1) << "incorrect value for last_msg_.sid.sat, expected 1, is " << last_msg_.sid.sat; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepC3, Test) { + uint8_t encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 129, 65, 21, 66, 224, 214, + 124, 67, 243, 138, 61, 69, 1, 0, 0, 0, 109, 209, + }; + + sbp_msg_acq_result_dep_c_t test_msg{}; + test_msg.cf = 3032.684326171875; + test_msg.cn0 = 37.313968658447266; + test_msg.cp = 252.83935546875; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 1; + + EXPECT_EQ(send_message(3112, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 3112); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - 3032.68432617 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected 3032.68432617, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cn0 * 100 - 37.3139686584 * 100), 0.05) + << "incorrect value for last_msg_.cn0, expected 37.3139686584, is " + << last_msg_.cn0; + EXPECT_LT((last_msg_.cp * 100 - 252.839355469 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 252.839355469, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 1) + << "incorrect value for last_msg_.sid.sat, expected 1, is " + << last_msg_.sid.sat; } -class Test_auto_check_sbp_acquisition_MsgAcqResultDepC4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqResultDepC4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_acquisition_MsgAcqResultDepC4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqResultDepC4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_result_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_result_dep_c_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -443,42 +467,55 @@ class Test_auto_check_sbp_acquisition_MsgAcqResultDepC4 : sbp_msg_acq_result_dep_c_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepC4, Test) -{ - - uint8_t encoded_frame[] = {85,31,0,40,12,16,126,35,62,66,226,37,102,68,202,243,29,69,27,0,0,0,91,67, }; - - sbp_msg_acq_result_dep_c_t test_msg{}; - test_msg.cf = 2527.23681640625; - test_msg.cn0 = 47.53466033935547; - test_msg.cp = 920.5919189453125; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 27; - - EXPECT_EQ(send_message( 3112, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 3112); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cf * 100 - 2527.23681641 * 100), 0.05) << "incorrect value for last_msg_.cf, expected 2527.23681641, is " << last_msg_.cf; - EXPECT_LT((last_msg_.cn0 * 100 - 47.5346603394 * 100), 0.05) << "incorrect value for last_msg_.cn0, expected 47.5346603394, is " << last_msg_.cn0; - EXPECT_LT((last_msg_.cp * 100 - 920.591918945 * 100), 0.05) << "incorrect value for last_msg_.cp, expected 920.591918945, is " << last_msg_.cp; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 27) << "incorrect value for last_msg_.sid.sat, expected 27, is " << last_msg_.sid.sat; +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqResultDepC4, Test) { + uint8_t encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 126, 35, 62, 66, 226, 37, + 102, 68, 202, 243, 29, 69, 27, 0, 0, 0, 91, 67, + }; + + sbp_msg_acq_result_dep_c_t test_msg{}; + test_msg.cf = 2527.23681640625; + test_msg.cn0 = 47.53466033935547; + test_msg.cp = 920.5919189453125; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 27; + + EXPECT_EQ(send_message(3112, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 3112); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cf * 100 - 2527.23681641 * 100), 0.05) + << "incorrect value for last_msg_.cf, expected 2527.23681641, is " + << last_msg_.cf; + EXPECT_LT((last_msg_.cn0 * 100 - 47.5346603394 * 100), 0.05) + << "incorrect value for last_msg_.cn0, expected 47.5346603394, is " + << last_msg_.cn0; + EXPECT_LT((last_msg_.cp * 100 - 920.591918945 * 100), 0.05) + << "incorrect value for last_msg_.cp, expected 920.591918945, is " + << last_msg_.cp; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 27) + << "incorrect value for last_msg_.sid.sat, expected 27, is " + << last_msg_.sid.sat; } diff --git a/c/test/cpp/auto_check_sbp_acquisition_MsgAcqSvProfile.cc b/c/test/cpp/auto_check_sbp_acquisition_MsgAcqSvProfile.cc index 6eeabcc06..dc0a6acba 100644 --- a/c/test/cpp/auto_check_sbp_acquisition_MsgAcqSvProfile.cc +++ b/c/test/cpp/auto_check_sbp_acquisition_MsgAcqSvProfile.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfile.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfile.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_acquisition_MsgAcqSvProfile0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqSvProfile0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_acquisition_MsgAcqSvProfile0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqSvProfile0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_sv_profile_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_sv_profile_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,129 +67,269 @@ class Test_auto_check_sbp_acquisition_MsgAcqSvProfile0 : sbp_msg_acq_sv_profile_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqSvProfile0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqSvProfile0, Test) { + uint8_t encoded_frame[] = { + 85, 46, 0, 195, 4, 99, 7, 13, 38, 0, 97, 22, 0, 174, 0, 52, + 0, 0, 0, 49, 0, 0, 0, 61, 0, 0, 0, 147, 0, 0, 0, 47, + 0, 0, 0, 140, 0, 0, 0, 166, 210, 59, 0, 253, 23, 1, 121, 0, + 190, 0, 0, 0, 175, 0, 0, 0, 175, 0, 0, 0, 142, 0, 0, 0, + 237, 0, 0, 0, 12, 0, 0, 0, 126, 88, 21, 0, 153, 24, 0, 8, + 0, 130, 0, 0, 0, 172, 0, 0, 0, 91, 0, 0, 0, 191, 0, 0, + 0, 84, 0, 0, 0, 82, 0, 0, 0, 168, 177, + }; + + sbp_msg_acq_sv_profile_t test_msg{}; - uint8_t encoded_frame[] = {85,46,0,195,4,99,7,13,38,0,97,22,0,174,0,52,0,0,0,49,0,0,0,61,0,0,0,147,0,0,0,47,0,0,0,140,0,0,0,166,210,59,0,253,23,1,121,0,190,0,0,0,175,0,0,0,175,0,0,0,142,0,0,0,237,0,0,0,12,0,0,0,126,88,21,0,153,24,0,8,0,130,0,0,0,172,0,0,0,91,0,0,0,191,0,0,0,84,0,0,0,82,0,0,0,168,177, }; + test_msg.acq_sv_profile[0].bin_width = 174; + test_msg.acq_sv_profile[0].cf = 47; + test_msg.acq_sv_profile[0].cf_max = 147; + test_msg.acq_sv_profile[0].cf_min = 61; + test_msg.acq_sv_profile[0].cn0 = 38; + test_msg.acq_sv_profile[0].cp = 140; + test_msg.acq_sv_profile[0].int_time = 97; + test_msg.acq_sv_profile[0].job_type = 7; + test_msg.acq_sv_profile[0].sid.code = 0; + test_msg.acq_sv_profile[0].sid.sat = 22; + test_msg.acq_sv_profile[0].status = 13; + test_msg.acq_sv_profile[0].time_spent = 49; + test_msg.acq_sv_profile[0].timestamp = 52; - sbp_msg_acq_sv_profile_t test_msg{}; - - test_msg.acq_sv_profile[0].bin_width = 174; - test_msg.acq_sv_profile[0].cf = 47; - test_msg.acq_sv_profile[0].cf_max = 147; - test_msg.acq_sv_profile[0].cf_min = 61; - test_msg.acq_sv_profile[0].cn0 = 38; - test_msg.acq_sv_profile[0].cp = 140; - test_msg.acq_sv_profile[0].int_time = 97; - test_msg.acq_sv_profile[0].job_type = 7; - test_msg.acq_sv_profile[0].sid.code = 0; - test_msg.acq_sv_profile[0].sid.sat = 22; - test_msg.acq_sv_profile[0].status = 13; - test_msg.acq_sv_profile[0].time_spent = 49; - test_msg.acq_sv_profile[0].timestamp = 52; - - test_msg.acq_sv_profile[1].bin_width = 121; - test_msg.acq_sv_profile[1].cf = 237; - test_msg.acq_sv_profile[1].cf_max = 142; - test_msg.acq_sv_profile[1].cf_min = 175; - test_msg.acq_sv_profile[1].cn0 = 59; - test_msg.acq_sv_profile[1].cp = 12; - test_msg.acq_sv_profile[1].int_time = 253; - test_msg.acq_sv_profile[1].job_type = 166; - test_msg.acq_sv_profile[1].sid.code = 1; - test_msg.acq_sv_profile[1].sid.sat = 23; - test_msg.acq_sv_profile[1].status = 210; - test_msg.acq_sv_profile[1].time_spent = 175; - test_msg.acq_sv_profile[1].timestamp = 190; - - test_msg.acq_sv_profile[2].bin_width = 8; - test_msg.acq_sv_profile[2].cf = 84; - test_msg.acq_sv_profile[2].cf_max = 191; - test_msg.acq_sv_profile[2].cf_min = 91; - test_msg.acq_sv_profile[2].cn0 = 21; - test_msg.acq_sv_profile[2].cp = 82; - test_msg.acq_sv_profile[2].int_time = 153; - test_msg.acq_sv_profile[2].job_type = 126; - test_msg.acq_sv_profile[2].sid.code = 0; - test_msg.acq_sv_profile[2].sid.sat = 24; - test_msg.acq_sv_profile[2].status = 88; - test_msg.acq_sv_profile[2].time_spent = 172; - test_msg.acq_sv_profile[2].timestamp = 130; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_acq_sv_profile.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)97,(char)99,(char)113,(char)95,(char)115,(char)118,(char)95,(char)112,(char)114,(char)111,(char)102,(char)105,(char)108,(char)101 }; - memcpy(test_msg.n_acq_sv_profile.related_to, assign_string, sizeof(assign_string)); - } - test_msg.n_acq_sv_profile.value = 3; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + test_msg.acq_sv_profile[1].bin_width = 121; + test_msg.acq_sv_profile[1].cf = 237; + test_msg.acq_sv_profile[1].cf_max = 142; + test_msg.acq_sv_profile[1].cf_min = 175; + test_msg.acq_sv_profile[1].cn0 = 59; + test_msg.acq_sv_profile[1].cp = 12; + test_msg.acq_sv_profile[1].int_time = 253; + test_msg.acq_sv_profile[1].job_type = 166; + test_msg.acq_sv_profile[1].sid.code = 1; + test_msg.acq_sv_profile[1].sid.sat = 23; + test_msg.acq_sv_profile[1].status = 210; + test_msg.acq_sv_profile[1].time_spent = 175; + test_msg.acq_sv_profile[1].timestamp = 190; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.acq_sv_profile[0].bin_width, 174) << "incorrect value for last_msg_.acq_sv_profile[0].bin_width, expected 174, is " << last_msg_.acq_sv_profile[0].bin_width; - EXPECT_EQ(last_msg_.acq_sv_profile[0].cf, 47) << "incorrect value for last_msg_.acq_sv_profile[0].cf, expected 47, is " << last_msg_.acq_sv_profile[0].cf; - EXPECT_EQ(last_msg_.acq_sv_profile[0].cf_max, 147) << "incorrect value for last_msg_.acq_sv_profile[0].cf_max, expected 147, is " << last_msg_.acq_sv_profile[0].cf_max; - EXPECT_EQ(last_msg_.acq_sv_profile[0].cf_min, 61) << "incorrect value for last_msg_.acq_sv_profile[0].cf_min, expected 61, is " << last_msg_.acq_sv_profile[0].cf_min; - EXPECT_EQ(last_msg_.acq_sv_profile[0].cn0, 38) << "incorrect value for last_msg_.acq_sv_profile[0].cn0, expected 38, is " << last_msg_.acq_sv_profile[0].cn0; - EXPECT_EQ(last_msg_.acq_sv_profile[0].cp, 140) << "incorrect value for last_msg_.acq_sv_profile[0].cp, expected 140, is " << last_msg_.acq_sv_profile[0].cp; - EXPECT_EQ(last_msg_.acq_sv_profile[0].int_time, 97) << "incorrect value for last_msg_.acq_sv_profile[0].int_time, expected 97, is " << last_msg_.acq_sv_profile[0].int_time; - EXPECT_EQ(last_msg_.acq_sv_profile[0].job_type, 7) << "incorrect value for last_msg_.acq_sv_profile[0].job_type, expected 7, is " << last_msg_.acq_sv_profile[0].job_type; - EXPECT_EQ(last_msg_.acq_sv_profile[0].sid.code, 0) << "incorrect value for last_msg_.acq_sv_profile[0].sid.code, expected 0, is " << last_msg_.acq_sv_profile[0].sid.code; - EXPECT_EQ(last_msg_.acq_sv_profile[0].sid.sat, 22) << "incorrect value for last_msg_.acq_sv_profile[0].sid.sat, expected 22, is " << last_msg_.acq_sv_profile[0].sid.sat; - EXPECT_EQ(last_msg_.acq_sv_profile[0].status, 13) << "incorrect value for last_msg_.acq_sv_profile[0].status, expected 13, is " << last_msg_.acq_sv_profile[0].status; - EXPECT_EQ(last_msg_.acq_sv_profile[0].time_spent, 49) << "incorrect value for last_msg_.acq_sv_profile[0].time_spent, expected 49, is " << last_msg_.acq_sv_profile[0].time_spent; - EXPECT_EQ(last_msg_.acq_sv_profile[0].timestamp, 52) << "incorrect value for last_msg_.acq_sv_profile[0].timestamp, expected 52, is " << last_msg_.acq_sv_profile[0].timestamp; - EXPECT_EQ(last_msg_.acq_sv_profile[1].bin_width, 121) << "incorrect value for last_msg_.acq_sv_profile[1].bin_width, expected 121, is " << last_msg_.acq_sv_profile[1].bin_width; - EXPECT_EQ(last_msg_.acq_sv_profile[1].cf, 237) << "incorrect value for last_msg_.acq_sv_profile[1].cf, expected 237, is " << last_msg_.acq_sv_profile[1].cf; - EXPECT_EQ(last_msg_.acq_sv_profile[1].cf_max, 142) << "incorrect value for last_msg_.acq_sv_profile[1].cf_max, expected 142, is " << last_msg_.acq_sv_profile[1].cf_max; - EXPECT_EQ(last_msg_.acq_sv_profile[1].cf_min, 175) << "incorrect value for last_msg_.acq_sv_profile[1].cf_min, expected 175, is " << last_msg_.acq_sv_profile[1].cf_min; - EXPECT_EQ(last_msg_.acq_sv_profile[1].cn0, 59) << "incorrect value for last_msg_.acq_sv_profile[1].cn0, expected 59, is " << last_msg_.acq_sv_profile[1].cn0; - EXPECT_EQ(last_msg_.acq_sv_profile[1].cp, 12) << "incorrect value for last_msg_.acq_sv_profile[1].cp, expected 12, is " << last_msg_.acq_sv_profile[1].cp; - EXPECT_EQ(last_msg_.acq_sv_profile[1].int_time, 253) << "incorrect value for last_msg_.acq_sv_profile[1].int_time, expected 253, is " << last_msg_.acq_sv_profile[1].int_time; - EXPECT_EQ(last_msg_.acq_sv_profile[1].job_type, 166) << "incorrect value for last_msg_.acq_sv_profile[1].job_type, expected 166, is " << last_msg_.acq_sv_profile[1].job_type; - EXPECT_EQ(last_msg_.acq_sv_profile[1].sid.code, 1) << "incorrect value for last_msg_.acq_sv_profile[1].sid.code, expected 1, is " << last_msg_.acq_sv_profile[1].sid.code; - EXPECT_EQ(last_msg_.acq_sv_profile[1].sid.sat, 23) << "incorrect value for last_msg_.acq_sv_profile[1].sid.sat, expected 23, is " << last_msg_.acq_sv_profile[1].sid.sat; - EXPECT_EQ(last_msg_.acq_sv_profile[1].status, 210) << "incorrect value for last_msg_.acq_sv_profile[1].status, expected 210, is " << last_msg_.acq_sv_profile[1].status; - EXPECT_EQ(last_msg_.acq_sv_profile[1].time_spent, 175) << "incorrect value for last_msg_.acq_sv_profile[1].time_spent, expected 175, is " << last_msg_.acq_sv_profile[1].time_spent; - EXPECT_EQ(last_msg_.acq_sv_profile[1].timestamp, 190) << "incorrect value for last_msg_.acq_sv_profile[1].timestamp, expected 190, is " << last_msg_.acq_sv_profile[1].timestamp; - EXPECT_EQ(last_msg_.acq_sv_profile[2].bin_width, 8) << "incorrect value for last_msg_.acq_sv_profile[2].bin_width, expected 8, is " << last_msg_.acq_sv_profile[2].bin_width; - EXPECT_EQ(last_msg_.acq_sv_profile[2].cf, 84) << "incorrect value for last_msg_.acq_sv_profile[2].cf, expected 84, is " << last_msg_.acq_sv_profile[2].cf; - EXPECT_EQ(last_msg_.acq_sv_profile[2].cf_max, 191) << "incorrect value for last_msg_.acq_sv_profile[2].cf_max, expected 191, is " << last_msg_.acq_sv_profile[2].cf_max; - EXPECT_EQ(last_msg_.acq_sv_profile[2].cf_min, 91) << "incorrect value for last_msg_.acq_sv_profile[2].cf_min, expected 91, is " << last_msg_.acq_sv_profile[2].cf_min; - EXPECT_EQ(last_msg_.acq_sv_profile[2].cn0, 21) << "incorrect value for last_msg_.acq_sv_profile[2].cn0, expected 21, is " << last_msg_.acq_sv_profile[2].cn0; - EXPECT_EQ(last_msg_.acq_sv_profile[2].cp, 82) << "incorrect value for last_msg_.acq_sv_profile[2].cp, expected 82, is " << last_msg_.acq_sv_profile[2].cp; - EXPECT_EQ(last_msg_.acq_sv_profile[2].int_time, 153) << "incorrect value for last_msg_.acq_sv_profile[2].int_time, expected 153, is " << last_msg_.acq_sv_profile[2].int_time; - EXPECT_EQ(last_msg_.acq_sv_profile[2].job_type, 126) << "incorrect value for last_msg_.acq_sv_profile[2].job_type, expected 126, is " << last_msg_.acq_sv_profile[2].job_type; - EXPECT_EQ(last_msg_.acq_sv_profile[2].sid.code, 0) << "incorrect value for last_msg_.acq_sv_profile[2].sid.code, expected 0, is " << last_msg_.acq_sv_profile[2].sid.code; - EXPECT_EQ(last_msg_.acq_sv_profile[2].sid.sat, 24) << "incorrect value for last_msg_.acq_sv_profile[2].sid.sat, expected 24, is " << last_msg_.acq_sv_profile[2].sid.sat; - EXPECT_EQ(last_msg_.acq_sv_profile[2].status, 88) << "incorrect value for last_msg_.acq_sv_profile[2].status, expected 88, is " << last_msg_.acq_sv_profile[2].status; - EXPECT_EQ(last_msg_.acq_sv_profile[2].time_spent, 172) << "incorrect value for last_msg_.acq_sv_profile[2].time_spent, expected 172, is " << last_msg_.acq_sv_profile[2].time_spent; - EXPECT_EQ(last_msg_.acq_sv_profile[2].timestamp, 130) << "incorrect value for last_msg_.acq_sv_profile[2].timestamp, expected 130, is " << last_msg_.acq_sv_profile[2].timestamp; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_acq_sv_profile.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_acq_sv_profile.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_acq_sv_profile.handle_as << "'"; - } - { - const char check_string[] = { (char)97,(char)99,(char)113,(char)95,(char)115,(char)118,(char)95,(char)112,(char)114,(char)111,(char)102,(char)105,(char)108,(char)101 }; - EXPECT_EQ(memcmp(last_msg_.n_acq_sv_profile.related_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_acq_sv_profile.related_to, expected string '" << check_string << "', is '" << last_msg_.n_acq_sv_profile.related_to << "'"; - } - EXPECT_EQ(last_msg_.n_acq_sv_profile.value, 3) << "incorrect value for last_msg_.n_acq_sv_profile.value, expected 3, is " << last_msg_.n_acq_sv_profile.value; + test_msg.acq_sv_profile[2].bin_width = 8; + test_msg.acq_sv_profile[2].cf = 84; + test_msg.acq_sv_profile[2].cf_max = 191; + test_msg.acq_sv_profile[2].cf_min = 91; + test_msg.acq_sv_profile[2].cn0 = 21; + test_msg.acq_sv_profile[2].cp = 82; + test_msg.acq_sv_profile[2].int_time = 153; + test_msg.acq_sv_profile[2].job_type = 126; + test_msg.acq_sv_profile[2].sid.code = 0; + test_msg.acq_sv_profile[2].sid.sat = 24; + test_msg.acq_sv_profile[2].status = 88; + test_msg.acq_sv_profile[2].time_spent = 172; + test_msg.acq_sv_profile[2].timestamp = 130; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_acq_sv_profile.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)97, (char)99, (char)113, (char)95, + (char)115, (char)118, (char)95, (char)112, + (char)114, (char)111, (char)102, (char)105, + (char)108, (char)101}; + memcpy(test_msg.n_acq_sv_profile.related_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_acq_sv_profile.value = 3; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.acq_sv_profile[0].bin_width, 174) + << "incorrect value for last_msg_.acq_sv_profile[0].bin_width, expected " + "174, is " + << last_msg_.acq_sv_profile[0].bin_width; + EXPECT_EQ(last_msg_.acq_sv_profile[0].cf, 47) + << "incorrect value for last_msg_.acq_sv_profile[0].cf, expected 47, is " + << last_msg_.acq_sv_profile[0].cf; + EXPECT_EQ(last_msg_.acq_sv_profile[0].cf_max, 147) + << "incorrect value for last_msg_.acq_sv_profile[0].cf_max, expected " + "147, is " + << last_msg_.acq_sv_profile[0].cf_max; + EXPECT_EQ(last_msg_.acq_sv_profile[0].cf_min, 61) + << "incorrect value for last_msg_.acq_sv_profile[0].cf_min, expected 61, " + "is " + << last_msg_.acq_sv_profile[0].cf_min; + EXPECT_EQ(last_msg_.acq_sv_profile[0].cn0, 38) + << "incorrect value for last_msg_.acq_sv_profile[0].cn0, expected 38, is " + << last_msg_.acq_sv_profile[0].cn0; + EXPECT_EQ(last_msg_.acq_sv_profile[0].cp, 140) + << "incorrect value for last_msg_.acq_sv_profile[0].cp, expected 140, is " + << last_msg_.acq_sv_profile[0].cp; + EXPECT_EQ(last_msg_.acq_sv_profile[0].int_time, 97) + << "incorrect value for last_msg_.acq_sv_profile[0].int_time, expected " + "97, is " + << last_msg_.acq_sv_profile[0].int_time; + EXPECT_EQ(last_msg_.acq_sv_profile[0].job_type, 7) + << "incorrect value for last_msg_.acq_sv_profile[0].job_type, expected " + "7, is " + << last_msg_.acq_sv_profile[0].job_type; + EXPECT_EQ(last_msg_.acq_sv_profile[0].sid.code, 0) + << "incorrect value for last_msg_.acq_sv_profile[0].sid.code, expected " + "0, is " + << last_msg_.acq_sv_profile[0].sid.code; + EXPECT_EQ(last_msg_.acq_sv_profile[0].sid.sat, 22) + << "incorrect value for last_msg_.acq_sv_profile[0].sid.sat, expected " + "22, is " + << last_msg_.acq_sv_profile[0].sid.sat; + EXPECT_EQ(last_msg_.acq_sv_profile[0].status, 13) + << "incorrect value for last_msg_.acq_sv_profile[0].status, expected 13, " + "is " + << last_msg_.acq_sv_profile[0].status; + EXPECT_EQ(last_msg_.acq_sv_profile[0].time_spent, 49) + << "incorrect value for last_msg_.acq_sv_profile[0].time_spent, expected " + "49, is " + << last_msg_.acq_sv_profile[0].time_spent; + EXPECT_EQ(last_msg_.acq_sv_profile[0].timestamp, 52) + << "incorrect value for last_msg_.acq_sv_profile[0].timestamp, expected " + "52, is " + << last_msg_.acq_sv_profile[0].timestamp; + EXPECT_EQ(last_msg_.acq_sv_profile[1].bin_width, 121) + << "incorrect value for last_msg_.acq_sv_profile[1].bin_width, expected " + "121, is " + << last_msg_.acq_sv_profile[1].bin_width; + EXPECT_EQ(last_msg_.acq_sv_profile[1].cf, 237) + << "incorrect value for last_msg_.acq_sv_profile[1].cf, expected 237, is " + << last_msg_.acq_sv_profile[1].cf; + EXPECT_EQ(last_msg_.acq_sv_profile[1].cf_max, 142) + << "incorrect value for last_msg_.acq_sv_profile[1].cf_max, expected " + "142, is " + << last_msg_.acq_sv_profile[1].cf_max; + EXPECT_EQ(last_msg_.acq_sv_profile[1].cf_min, 175) + << "incorrect value for last_msg_.acq_sv_profile[1].cf_min, expected " + "175, is " + << last_msg_.acq_sv_profile[1].cf_min; + EXPECT_EQ(last_msg_.acq_sv_profile[1].cn0, 59) + << "incorrect value for last_msg_.acq_sv_profile[1].cn0, expected 59, is " + << last_msg_.acq_sv_profile[1].cn0; + EXPECT_EQ(last_msg_.acq_sv_profile[1].cp, 12) + << "incorrect value for last_msg_.acq_sv_profile[1].cp, expected 12, is " + << last_msg_.acq_sv_profile[1].cp; + EXPECT_EQ(last_msg_.acq_sv_profile[1].int_time, 253) + << "incorrect value for last_msg_.acq_sv_profile[1].int_time, expected " + "253, is " + << last_msg_.acq_sv_profile[1].int_time; + EXPECT_EQ(last_msg_.acq_sv_profile[1].job_type, 166) + << "incorrect value for last_msg_.acq_sv_profile[1].job_type, expected " + "166, is " + << last_msg_.acq_sv_profile[1].job_type; + EXPECT_EQ(last_msg_.acq_sv_profile[1].sid.code, 1) + << "incorrect value for last_msg_.acq_sv_profile[1].sid.code, expected " + "1, is " + << last_msg_.acq_sv_profile[1].sid.code; + EXPECT_EQ(last_msg_.acq_sv_profile[1].sid.sat, 23) + << "incorrect value for last_msg_.acq_sv_profile[1].sid.sat, expected " + "23, is " + << last_msg_.acq_sv_profile[1].sid.sat; + EXPECT_EQ(last_msg_.acq_sv_profile[1].status, 210) + << "incorrect value for last_msg_.acq_sv_profile[1].status, expected " + "210, is " + << last_msg_.acq_sv_profile[1].status; + EXPECT_EQ(last_msg_.acq_sv_profile[1].time_spent, 175) + << "incorrect value for last_msg_.acq_sv_profile[1].time_spent, expected " + "175, is " + << last_msg_.acq_sv_profile[1].time_spent; + EXPECT_EQ(last_msg_.acq_sv_profile[1].timestamp, 190) + << "incorrect value for last_msg_.acq_sv_profile[1].timestamp, expected " + "190, is " + << last_msg_.acq_sv_profile[1].timestamp; + EXPECT_EQ(last_msg_.acq_sv_profile[2].bin_width, 8) + << "incorrect value for last_msg_.acq_sv_profile[2].bin_width, expected " + "8, is " + << last_msg_.acq_sv_profile[2].bin_width; + EXPECT_EQ(last_msg_.acq_sv_profile[2].cf, 84) + << "incorrect value for last_msg_.acq_sv_profile[2].cf, expected 84, is " + << last_msg_.acq_sv_profile[2].cf; + EXPECT_EQ(last_msg_.acq_sv_profile[2].cf_max, 191) + << "incorrect value for last_msg_.acq_sv_profile[2].cf_max, expected " + "191, is " + << last_msg_.acq_sv_profile[2].cf_max; + EXPECT_EQ(last_msg_.acq_sv_profile[2].cf_min, 91) + << "incorrect value for last_msg_.acq_sv_profile[2].cf_min, expected 91, " + "is " + << last_msg_.acq_sv_profile[2].cf_min; + EXPECT_EQ(last_msg_.acq_sv_profile[2].cn0, 21) + << "incorrect value for last_msg_.acq_sv_profile[2].cn0, expected 21, is " + << last_msg_.acq_sv_profile[2].cn0; + EXPECT_EQ(last_msg_.acq_sv_profile[2].cp, 82) + << "incorrect value for last_msg_.acq_sv_profile[2].cp, expected 82, is " + << last_msg_.acq_sv_profile[2].cp; + EXPECT_EQ(last_msg_.acq_sv_profile[2].int_time, 153) + << "incorrect value for last_msg_.acq_sv_profile[2].int_time, expected " + "153, is " + << last_msg_.acq_sv_profile[2].int_time; + EXPECT_EQ(last_msg_.acq_sv_profile[2].job_type, 126) + << "incorrect value for last_msg_.acq_sv_profile[2].job_type, expected " + "126, is " + << last_msg_.acq_sv_profile[2].job_type; + EXPECT_EQ(last_msg_.acq_sv_profile[2].sid.code, 0) + << "incorrect value for last_msg_.acq_sv_profile[2].sid.code, expected " + "0, is " + << last_msg_.acq_sv_profile[2].sid.code; + EXPECT_EQ(last_msg_.acq_sv_profile[2].sid.sat, 24) + << "incorrect value for last_msg_.acq_sv_profile[2].sid.sat, expected " + "24, is " + << last_msg_.acq_sv_profile[2].sid.sat; + EXPECT_EQ(last_msg_.acq_sv_profile[2].status, 88) + << "incorrect value for last_msg_.acq_sv_profile[2].status, expected 88, " + "is " + << last_msg_.acq_sv_profile[2].status; + EXPECT_EQ(last_msg_.acq_sv_profile[2].time_spent, 172) + << "incorrect value for last_msg_.acq_sv_profile[2].time_spent, expected " + "172, is " + << last_msg_.acq_sv_profile[2].time_spent; + EXPECT_EQ(last_msg_.acq_sv_profile[2].timestamp, 130) + << "incorrect value for last_msg_.acq_sv_profile[2].timestamp, expected " + "130, is " + << last_msg_.acq_sv_profile[2].timestamp; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_acq_sv_profile.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_acq_sv_profile.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_acq_sv_profile.handle_as + << "'"; + } + { + const char check_string[] = {(char)97, (char)99, (char)113, (char)95, + (char)115, (char)118, (char)95, (char)112, + (char)114, (char)111, (char)102, (char)105, + (char)108, (char)101}; + EXPECT_EQ(memcmp(last_msg_.n_acq_sv_profile.related_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_acq_sv_profile.related_to, " + "expected string '" + << check_string << "', is '" << last_msg_.n_acq_sv_profile.related_to + << "'"; + } + EXPECT_EQ(last_msg_.n_acq_sv_profile.value, 3) + << "incorrect value for last_msg_.n_acq_sv_profile.value, expected 3, is " + << last_msg_.n_acq_sv_profile.value; } diff --git a/c/test/cpp/auto_check_sbp_acquisition_MsgAcqSvProfileDep.cc b/c/test/cpp/auto_check_sbp_acquisition_MsgAcqSvProfileDep.cc index 6d45dcb39..b583ac34f 100644 --- a/c/test/cpp/auto_check_sbp_acquisition_MsgAcqSvProfileDep.cc +++ b/c/test/cpp/auto_check_sbp_acquisition_MsgAcqSvProfileDep.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfileDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfileDep.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_acquisition_MsgAcqSvProfileDep0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_acquisition_MsgAcqSvProfileDep0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_acquisition_MsgAcqSvProfileDep0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_acquisition_MsgAcqSvProfileDep0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acq_sv_profile_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acq_sv_profile_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,135 +67,287 @@ class Test_auto_check_sbp_acquisition_MsgAcqSvProfileDep0 : sbp_msg_acq_sv_profile_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_acquisition_MsgAcqSvProfileDep0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_acquisition_MsgAcqSvProfileDep0, Test) { + uint8_t encoded_frame[] = { + 85, 30, 0, 195, 4, 105, 67, 103, 151, 0, 12, 22, 0, 0, 0, + 187, 0, 91, 0, 0, 0, 75, 0, 0, 0, 132, 0, 0, 0, 36, + 0, 0, 0, 60, 0, 0, 0, 241, 0, 0, 0, 238, 38, 111, 0, + 179, 23, 0, 1, 0, 176, 0, 166, 0, 0, 0, 234, 0, 0, 0, + 155, 0, 0, 0, 24, 0, 0, 0, 212, 0, 0, 0, 247, 0, 0, + 0, 142, 213, 68, 0, 53, 24, 0, 0, 0, 52, 0, 49, 0, 0, + 0, 245, 0, 0, 0, 76, 0, 0, 0, 248, 0, 0, 0, 212, 0, + 0, 0, 101, 0, 0, 0, 67, 132, + }; + + sbp_msg_acq_sv_profile_dep_t test_msg{}; - uint8_t encoded_frame[] = {85,30,0,195,4,105,67,103,151,0,12,22,0,0,0,187,0,91,0,0,0,75,0,0,0,132,0,0,0,36,0,0,0,60,0,0,0,241,0,0,0,238,38,111,0,179,23,0,1,0,176,0,166,0,0,0,234,0,0,0,155,0,0,0,24,0,0,0,212,0,0,0,247,0,0,0,142,213,68,0,53,24,0,0,0,52,0,49,0,0,0,245,0,0,0,76,0,0,0,248,0,0,0,212,0,0,0,101,0,0,0,67,132, }; + test_msg.acq_sv_profile[0].bin_width = 187; + test_msg.acq_sv_profile[0].cf = 60; + test_msg.acq_sv_profile[0].cf_max = 36; + test_msg.acq_sv_profile[0].cf_min = 132; + test_msg.acq_sv_profile[0].cn0 = 151; + test_msg.acq_sv_profile[0].cp = 241; + test_msg.acq_sv_profile[0].int_time = 12; + test_msg.acq_sv_profile[0].job_type = 67; + test_msg.acq_sv_profile[0].sid.code = 0; + test_msg.acq_sv_profile[0].sid.reserved = 0; + test_msg.acq_sv_profile[0].sid.sat = 22; + test_msg.acq_sv_profile[0].status = 103; + test_msg.acq_sv_profile[0].time_spent = 75; + test_msg.acq_sv_profile[0].timestamp = 91; - sbp_msg_acq_sv_profile_dep_t test_msg{}; - - test_msg.acq_sv_profile[0].bin_width = 187; - test_msg.acq_sv_profile[0].cf = 60; - test_msg.acq_sv_profile[0].cf_max = 36; - test_msg.acq_sv_profile[0].cf_min = 132; - test_msg.acq_sv_profile[0].cn0 = 151; - test_msg.acq_sv_profile[0].cp = 241; - test_msg.acq_sv_profile[0].int_time = 12; - test_msg.acq_sv_profile[0].job_type = 67; - test_msg.acq_sv_profile[0].sid.code = 0; - test_msg.acq_sv_profile[0].sid.reserved = 0; - test_msg.acq_sv_profile[0].sid.sat = 22; - test_msg.acq_sv_profile[0].status = 103; - test_msg.acq_sv_profile[0].time_spent = 75; - test_msg.acq_sv_profile[0].timestamp = 91; - - test_msg.acq_sv_profile[1].bin_width = 176; - test_msg.acq_sv_profile[1].cf = 212; - test_msg.acq_sv_profile[1].cf_max = 24; - test_msg.acq_sv_profile[1].cf_min = 155; - test_msg.acq_sv_profile[1].cn0 = 111; - test_msg.acq_sv_profile[1].cp = 247; - test_msg.acq_sv_profile[1].int_time = 179; - test_msg.acq_sv_profile[1].job_type = 238; - test_msg.acq_sv_profile[1].sid.code = 1; - test_msg.acq_sv_profile[1].sid.reserved = 0; - test_msg.acq_sv_profile[1].sid.sat = 23; - test_msg.acq_sv_profile[1].status = 38; - test_msg.acq_sv_profile[1].time_spent = 234; - test_msg.acq_sv_profile[1].timestamp = 166; - - test_msg.acq_sv_profile[2].bin_width = 52; - test_msg.acq_sv_profile[2].cf = 212; - test_msg.acq_sv_profile[2].cf_max = 248; - test_msg.acq_sv_profile[2].cf_min = 76; - test_msg.acq_sv_profile[2].cn0 = 68; - test_msg.acq_sv_profile[2].cp = 101; - test_msg.acq_sv_profile[2].int_time = 53; - test_msg.acq_sv_profile[2].job_type = 142; - test_msg.acq_sv_profile[2].sid.code = 0; - test_msg.acq_sv_profile[2].sid.reserved = 0; - test_msg.acq_sv_profile[2].sid.sat = 24; - test_msg.acq_sv_profile[2].status = 213; - test_msg.acq_sv_profile[2].time_spent = 245; - test_msg.acq_sv_profile[2].timestamp = 49; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_acq_sv_profile.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)97,(char)99,(char)113,(char)95,(char)115,(char)118,(char)95,(char)112,(char)114,(char)111,(char)102,(char)105,(char)108,(char)101 }; - memcpy(test_msg.n_acq_sv_profile.related_to, assign_string, sizeof(assign_string)); - } - test_msg.n_acq_sv_profile.value = 3; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + test_msg.acq_sv_profile[1].bin_width = 176; + test_msg.acq_sv_profile[1].cf = 212; + test_msg.acq_sv_profile[1].cf_max = 24; + test_msg.acq_sv_profile[1].cf_min = 155; + test_msg.acq_sv_profile[1].cn0 = 111; + test_msg.acq_sv_profile[1].cp = 247; + test_msg.acq_sv_profile[1].int_time = 179; + test_msg.acq_sv_profile[1].job_type = 238; + test_msg.acq_sv_profile[1].sid.code = 1; + test_msg.acq_sv_profile[1].sid.reserved = 0; + test_msg.acq_sv_profile[1].sid.sat = 23; + test_msg.acq_sv_profile[1].status = 38; + test_msg.acq_sv_profile[1].time_spent = 234; + test_msg.acq_sv_profile[1].timestamp = 166; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.acq_sv_profile[0].bin_width, 187) << "incorrect value for last_msg_.acq_sv_profile[0].bin_width, expected 187, is " << last_msg_.acq_sv_profile[0].bin_width; - EXPECT_EQ(last_msg_.acq_sv_profile[0].cf, 60) << "incorrect value for last_msg_.acq_sv_profile[0].cf, expected 60, is " << last_msg_.acq_sv_profile[0].cf; - EXPECT_EQ(last_msg_.acq_sv_profile[0].cf_max, 36) << "incorrect value for last_msg_.acq_sv_profile[0].cf_max, expected 36, is " << last_msg_.acq_sv_profile[0].cf_max; - EXPECT_EQ(last_msg_.acq_sv_profile[0].cf_min, 132) << "incorrect value for last_msg_.acq_sv_profile[0].cf_min, expected 132, is " << last_msg_.acq_sv_profile[0].cf_min; - EXPECT_EQ(last_msg_.acq_sv_profile[0].cn0, 151) << "incorrect value for last_msg_.acq_sv_profile[0].cn0, expected 151, is " << last_msg_.acq_sv_profile[0].cn0; - EXPECT_EQ(last_msg_.acq_sv_profile[0].cp, 241) << "incorrect value for last_msg_.acq_sv_profile[0].cp, expected 241, is " << last_msg_.acq_sv_profile[0].cp; - EXPECT_EQ(last_msg_.acq_sv_profile[0].int_time, 12) << "incorrect value for last_msg_.acq_sv_profile[0].int_time, expected 12, is " << last_msg_.acq_sv_profile[0].int_time; - EXPECT_EQ(last_msg_.acq_sv_profile[0].job_type, 67) << "incorrect value for last_msg_.acq_sv_profile[0].job_type, expected 67, is " << last_msg_.acq_sv_profile[0].job_type; - EXPECT_EQ(last_msg_.acq_sv_profile[0].sid.code, 0) << "incorrect value for last_msg_.acq_sv_profile[0].sid.code, expected 0, is " << last_msg_.acq_sv_profile[0].sid.code; - EXPECT_EQ(last_msg_.acq_sv_profile[0].sid.reserved, 0) << "incorrect value for last_msg_.acq_sv_profile[0].sid.reserved, expected 0, is " << last_msg_.acq_sv_profile[0].sid.reserved; - EXPECT_EQ(last_msg_.acq_sv_profile[0].sid.sat, 22) << "incorrect value for last_msg_.acq_sv_profile[0].sid.sat, expected 22, is " << last_msg_.acq_sv_profile[0].sid.sat; - EXPECT_EQ(last_msg_.acq_sv_profile[0].status, 103) << "incorrect value for last_msg_.acq_sv_profile[0].status, expected 103, is " << last_msg_.acq_sv_profile[0].status; - EXPECT_EQ(last_msg_.acq_sv_profile[0].time_spent, 75) << "incorrect value for last_msg_.acq_sv_profile[0].time_spent, expected 75, is " << last_msg_.acq_sv_profile[0].time_spent; - EXPECT_EQ(last_msg_.acq_sv_profile[0].timestamp, 91) << "incorrect value for last_msg_.acq_sv_profile[0].timestamp, expected 91, is " << last_msg_.acq_sv_profile[0].timestamp; - EXPECT_EQ(last_msg_.acq_sv_profile[1].bin_width, 176) << "incorrect value for last_msg_.acq_sv_profile[1].bin_width, expected 176, is " << last_msg_.acq_sv_profile[1].bin_width; - EXPECT_EQ(last_msg_.acq_sv_profile[1].cf, 212) << "incorrect value for last_msg_.acq_sv_profile[1].cf, expected 212, is " << last_msg_.acq_sv_profile[1].cf; - EXPECT_EQ(last_msg_.acq_sv_profile[1].cf_max, 24) << "incorrect value for last_msg_.acq_sv_profile[1].cf_max, expected 24, is " << last_msg_.acq_sv_profile[1].cf_max; - EXPECT_EQ(last_msg_.acq_sv_profile[1].cf_min, 155) << "incorrect value for last_msg_.acq_sv_profile[1].cf_min, expected 155, is " << last_msg_.acq_sv_profile[1].cf_min; - EXPECT_EQ(last_msg_.acq_sv_profile[1].cn0, 111) << "incorrect value for last_msg_.acq_sv_profile[1].cn0, expected 111, is " << last_msg_.acq_sv_profile[1].cn0; - EXPECT_EQ(last_msg_.acq_sv_profile[1].cp, 247) << "incorrect value for last_msg_.acq_sv_profile[1].cp, expected 247, is " << last_msg_.acq_sv_profile[1].cp; - EXPECT_EQ(last_msg_.acq_sv_profile[1].int_time, 179) << "incorrect value for last_msg_.acq_sv_profile[1].int_time, expected 179, is " << last_msg_.acq_sv_profile[1].int_time; - EXPECT_EQ(last_msg_.acq_sv_profile[1].job_type, 238) << "incorrect value for last_msg_.acq_sv_profile[1].job_type, expected 238, is " << last_msg_.acq_sv_profile[1].job_type; - EXPECT_EQ(last_msg_.acq_sv_profile[1].sid.code, 1) << "incorrect value for last_msg_.acq_sv_profile[1].sid.code, expected 1, is " << last_msg_.acq_sv_profile[1].sid.code; - EXPECT_EQ(last_msg_.acq_sv_profile[1].sid.reserved, 0) << "incorrect value for last_msg_.acq_sv_profile[1].sid.reserved, expected 0, is " << last_msg_.acq_sv_profile[1].sid.reserved; - EXPECT_EQ(last_msg_.acq_sv_profile[1].sid.sat, 23) << "incorrect value for last_msg_.acq_sv_profile[1].sid.sat, expected 23, is " << last_msg_.acq_sv_profile[1].sid.sat; - EXPECT_EQ(last_msg_.acq_sv_profile[1].status, 38) << "incorrect value for last_msg_.acq_sv_profile[1].status, expected 38, is " << last_msg_.acq_sv_profile[1].status; - EXPECT_EQ(last_msg_.acq_sv_profile[1].time_spent, 234) << "incorrect value for last_msg_.acq_sv_profile[1].time_spent, expected 234, is " << last_msg_.acq_sv_profile[1].time_spent; - EXPECT_EQ(last_msg_.acq_sv_profile[1].timestamp, 166) << "incorrect value for last_msg_.acq_sv_profile[1].timestamp, expected 166, is " << last_msg_.acq_sv_profile[1].timestamp; - EXPECT_EQ(last_msg_.acq_sv_profile[2].bin_width, 52) << "incorrect value for last_msg_.acq_sv_profile[2].bin_width, expected 52, is " << last_msg_.acq_sv_profile[2].bin_width; - EXPECT_EQ(last_msg_.acq_sv_profile[2].cf, 212) << "incorrect value for last_msg_.acq_sv_profile[2].cf, expected 212, is " << last_msg_.acq_sv_profile[2].cf; - EXPECT_EQ(last_msg_.acq_sv_profile[2].cf_max, 248) << "incorrect value for last_msg_.acq_sv_profile[2].cf_max, expected 248, is " << last_msg_.acq_sv_profile[2].cf_max; - EXPECT_EQ(last_msg_.acq_sv_profile[2].cf_min, 76) << "incorrect value for last_msg_.acq_sv_profile[2].cf_min, expected 76, is " << last_msg_.acq_sv_profile[2].cf_min; - EXPECT_EQ(last_msg_.acq_sv_profile[2].cn0, 68) << "incorrect value for last_msg_.acq_sv_profile[2].cn0, expected 68, is " << last_msg_.acq_sv_profile[2].cn0; - EXPECT_EQ(last_msg_.acq_sv_profile[2].cp, 101) << "incorrect value for last_msg_.acq_sv_profile[2].cp, expected 101, is " << last_msg_.acq_sv_profile[2].cp; - EXPECT_EQ(last_msg_.acq_sv_profile[2].int_time, 53) << "incorrect value for last_msg_.acq_sv_profile[2].int_time, expected 53, is " << last_msg_.acq_sv_profile[2].int_time; - EXPECT_EQ(last_msg_.acq_sv_profile[2].job_type, 142) << "incorrect value for last_msg_.acq_sv_profile[2].job_type, expected 142, is " << last_msg_.acq_sv_profile[2].job_type; - EXPECT_EQ(last_msg_.acq_sv_profile[2].sid.code, 0) << "incorrect value for last_msg_.acq_sv_profile[2].sid.code, expected 0, is " << last_msg_.acq_sv_profile[2].sid.code; - EXPECT_EQ(last_msg_.acq_sv_profile[2].sid.reserved, 0) << "incorrect value for last_msg_.acq_sv_profile[2].sid.reserved, expected 0, is " << last_msg_.acq_sv_profile[2].sid.reserved; - EXPECT_EQ(last_msg_.acq_sv_profile[2].sid.sat, 24) << "incorrect value for last_msg_.acq_sv_profile[2].sid.sat, expected 24, is " << last_msg_.acq_sv_profile[2].sid.sat; - EXPECT_EQ(last_msg_.acq_sv_profile[2].status, 213) << "incorrect value for last_msg_.acq_sv_profile[2].status, expected 213, is " << last_msg_.acq_sv_profile[2].status; - EXPECT_EQ(last_msg_.acq_sv_profile[2].time_spent, 245) << "incorrect value for last_msg_.acq_sv_profile[2].time_spent, expected 245, is " << last_msg_.acq_sv_profile[2].time_spent; - EXPECT_EQ(last_msg_.acq_sv_profile[2].timestamp, 49) << "incorrect value for last_msg_.acq_sv_profile[2].timestamp, expected 49, is " << last_msg_.acq_sv_profile[2].timestamp; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_acq_sv_profile.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_acq_sv_profile.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_acq_sv_profile.handle_as << "'"; - } - { - const char check_string[] = { (char)97,(char)99,(char)113,(char)95,(char)115,(char)118,(char)95,(char)112,(char)114,(char)111,(char)102,(char)105,(char)108,(char)101 }; - EXPECT_EQ(memcmp(last_msg_.n_acq_sv_profile.related_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_acq_sv_profile.related_to, expected string '" << check_string << "', is '" << last_msg_.n_acq_sv_profile.related_to << "'"; - } - EXPECT_EQ(last_msg_.n_acq_sv_profile.value, 3) << "incorrect value for last_msg_.n_acq_sv_profile.value, expected 3, is " << last_msg_.n_acq_sv_profile.value; + test_msg.acq_sv_profile[2].bin_width = 52; + test_msg.acq_sv_profile[2].cf = 212; + test_msg.acq_sv_profile[2].cf_max = 248; + test_msg.acq_sv_profile[2].cf_min = 76; + test_msg.acq_sv_profile[2].cn0 = 68; + test_msg.acq_sv_profile[2].cp = 101; + test_msg.acq_sv_profile[2].int_time = 53; + test_msg.acq_sv_profile[2].job_type = 142; + test_msg.acq_sv_profile[2].sid.code = 0; + test_msg.acq_sv_profile[2].sid.reserved = 0; + test_msg.acq_sv_profile[2].sid.sat = 24; + test_msg.acq_sv_profile[2].status = 213; + test_msg.acq_sv_profile[2].time_spent = 245; + test_msg.acq_sv_profile[2].timestamp = 49; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_acq_sv_profile.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)97, (char)99, (char)113, (char)95, + (char)115, (char)118, (char)95, (char)112, + (char)114, (char)111, (char)102, (char)105, + (char)108, (char)101}; + memcpy(test_msg.n_acq_sv_profile.related_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_acq_sv_profile.value = 3; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.acq_sv_profile[0].bin_width, 187) + << "incorrect value for last_msg_.acq_sv_profile[0].bin_width, expected " + "187, is " + << last_msg_.acq_sv_profile[0].bin_width; + EXPECT_EQ(last_msg_.acq_sv_profile[0].cf, 60) + << "incorrect value for last_msg_.acq_sv_profile[0].cf, expected 60, is " + << last_msg_.acq_sv_profile[0].cf; + EXPECT_EQ(last_msg_.acq_sv_profile[0].cf_max, 36) + << "incorrect value for last_msg_.acq_sv_profile[0].cf_max, expected 36, " + "is " + << last_msg_.acq_sv_profile[0].cf_max; + EXPECT_EQ(last_msg_.acq_sv_profile[0].cf_min, 132) + << "incorrect value for last_msg_.acq_sv_profile[0].cf_min, expected " + "132, is " + << last_msg_.acq_sv_profile[0].cf_min; + EXPECT_EQ(last_msg_.acq_sv_profile[0].cn0, 151) + << "incorrect value for last_msg_.acq_sv_profile[0].cn0, expected 151, " + "is " + << last_msg_.acq_sv_profile[0].cn0; + EXPECT_EQ(last_msg_.acq_sv_profile[0].cp, 241) + << "incorrect value for last_msg_.acq_sv_profile[0].cp, expected 241, is " + << last_msg_.acq_sv_profile[0].cp; + EXPECT_EQ(last_msg_.acq_sv_profile[0].int_time, 12) + << "incorrect value for last_msg_.acq_sv_profile[0].int_time, expected " + "12, is " + << last_msg_.acq_sv_profile[0].int_time; + EXPECT_EQ(last_msg_.acq_sv_profile[0].job_type, 67) + << "incorrect value for last_msg_.acq_sv_profile[0].job_type, expected " + "67, is " + << last_msg_.acq_sv_profile[0].job_type; + EXPECT_EQ(last_msg_.acq_sv_profile[0].sid.code, 0) + << "incorrect value for last_msg_.acq_sv_profile[0].sid.code, expected " + "0, is " + << last_msg_.acq_sv_profile[0].sid.code; + EXPECT_EQ(last_msg_.acq_sv_profile[0].sid.reserved, 0) + << "incorrect value for last_msg_.acq_sv_profile[0].sid.reserved, " + "expected 0, is " + << last_msg_.acq_sv_profile[0].sid.reserved; + EXPECT_EQ(last_msg_.acq_sv_profile[0].sid.sat, 22) + << "incorrect value for last_msg_.acq_sv_profile[0].sid.sat, expected " + "22, is " + << last_msg_.acq_sv_profile[0].sid.sat; + EXPECT_EQ(last_msg_.acq_sv_profile[0].status, 103) + << "incorrect value for last_msg_.acq_sv_profile[0].status, expected " + "103, is " + << last_msg_.acq_sv_profile[0].status; + EXPECT_EQ(last_msg_.acq_sv_profile[0].time_spent, 75) + << "incorrect value for last_msg_.acq_sv_profile[0].time_spent, expected " + "75, is " + << last_msg_.acq_sv_profile[0].time_spent; + EXPECT_EQ(last_msg_.acq_sv_profile[0].timestamp, 91) + << "incorrect value for last_msg_.acq_sv_profile[0].timestamp, expected " + "91, is " + << last_msg_.acq_sv_profile[0].timestamp; + EXPECT_EQ(last_msg_.acq_sv_profile[1].bin_width, 176) + << "incorrect value for last_msg_.acq_sv_profile[1].bin_width, expected " + "176, is " + << last_msg_.acq_sv_profile[1].bin_width; + EXPECT_EQ(last_msg_.acq_sv_profile[1].cf, 212) + << "incorrect value for last_msg_.acq_sv_profile[1].cf, expected 212, is " + << last_msg_.acq_sv_profile[1].cf; + EXPECT_EQ(last_msg_.acq_sv_profile[1].cf_max, 24) + << "incorrect value for last_msg_.acq_sv_profile[1].cf_max, expected 24, " + "is " + << last_msg_.acq_sv_profile[1].cf_max; + EXPECT_EQ(last_msg_.acq_sv_profile[1].cf_min, 155) + << "incorrect value for last_msg_.acq_sv_profile[1].cf_min, expected " + "155, is " + << last_msg_.acq_sv_profile[1].cf_min; + EXPECT_EQ(last_msg_.acq_sv_profile[1].cn0, 111) + << "incorrect value for last_msg_.acq_sv_profile[1].cn0, expected 111, " + "is " + << last_msg_.acq_sv_profile[1].cn0; + EXPECT_EQ(last_msg_.acq_sv_profile[1].cp, 247) + << "incorrect value for last_msg_.acq_sv_profile[1].cp, expected 247, is " + << last_msg_.acq_sv_profile[1].cp; + EXPECT_EQ(last_msg_.acq_sv_profile[1].int_time, 179) + << "incorrect value for last_msg_.acq_sv_profile[1].int_time, expected " + "179, is " + << last_msg_.acq_sv_profile[1].int_time; + EXPECT_EQ(last_msg_.acq_sv_profile[1].job_type, 238) + << "incorrect value for last_msg_.acq_sv_profile[1].job_type, expected " + "238, is " + << last_msg_.acq_sv_profile[1].job_type; + EXPECT_EQ(last_msg_.acq_sv_profile[1].sid.code, 1) + << "incorrect value for last_msg_.acq_sv_profile[1].sid.code, expected " + "1, is " + << last_msg_.acq_sv_profile[1].sid.code; + EXPECT_EQ(last_msg_.acq_sv_profile[1].sid.reserved, 0) + << "incorrect value for last_msg_.acq_sv_profile[1].sid.reserved, " + "expected 0, is " + << last_msg_.acq_sv_profile[1].sid.reserved; + EXPECT_EQ(last_msg_.acq_sv_profile[1].sid.sat, 23) + << "incorrect value for last_msg_.acq_sv_profile[1].sid.sat, expected " + "23, is " + << last_msg_.acq_sv_profile[1].sid.sat; + EXPECT_EQ(last_msg_.acq_sv_profile[1].status, 38) + << "incorrect value for last_msg_.acq_sv_profile[1].status, expected 38, " + "is " + << last_msg_.acq_sv_profile[1].status; + EXPECT_EQ(last_msg_.acq_sv_profile[1].time_spent, 234) + << "incorrect value for last_msg_.acq_sv_profile[1].time_spent, expected " + "234, is " + << last_msg_.acq_sv_profile[1].time_spent; + EXPECT_EQ(last_msg_.acq_sv_profile[1].timestamp, 166) + << "incorrect value for last_msg_.acq_sv_profile[1].timestamp, expected " + "166, is " + << last_msg_.acq_sv_profile[1].timestamp; + EXPECT_EQ(last_msg_.acq_sv_profile[2].bin_width, 52) + << "incorrect value for last_msg_.acq_sv_profile[2].bin_width, expected " + "52, is " + << last_msg_.acq_sv_profile[2].bin_width; + EXPECT_EQ(last_msg_.acq_sv_profile[2].cf, 212) + << "incorrect value for last_msg_.acq_sv_profile[2].cf, expected 212, is " + << last_msg_.acq_sv_profile[2].cf; + EXPECT_EQ(last_msg_.acq_sv_profile[2].cf_max, 248) + << "incorrect value for last_msg_.acq_sv_profile[2].cf_max, expected " + "248, is " + << last_msg_.acq_sv_profile[2].cf_max; + EXPECT_EQ(last_msg_.acq_sv_profile[2].cf_min, 76) + << "incorrect value for last_msg_.acq_sv_profile[2].cf_min, expected 76, " + "is " + << last_msg_.acq_sv_profile[2].cf_min; + EXPECT_EQ(last_msg_.acq_sv_profile[2].cn0, 68) + << "incorrect value for last_msg_.acq_sv_profile[2].cn0, expected 68, is " + << last_msg_.acq_sv_profile[2].cn0; + EXPECT_EQ(last_msg_.acq_sv_profile[2].cp, 101) + << "incorrect value for last_msg_.acq_sv_profile[2].cp, expected 101, is " + << last_msg_.acq_sv_profile[2].cp; + EXPECT_EQ(last_msg_.acq_sv_profile[2].int_time, 53) + << "incorrect value for last_msg_.acq_sv_profile[2].int_time, expected " + "53, is " + << last_msg_.acq_sv_profile[2].int_time; + EXPECT_EQ(last_msg_.acq_sv_profile[2].job_type, 142) + << "incorrect value for last_msg_.acq_sv_profile[2].job_type, expected " + "142, is " + << last_msg_.acq_sv_profile[2].job_type; + EXPECT_EQ(last_msg_.acq_sv_profile[2].sid.code, 0) + << "incorrect value for last_msg_.acq_sv_profile[2].sid.code, expected " + "0, is " + << last_msg_.acq_sv_profile[2].sid.code; + EXPECT_EQ(last_msg_.acq_sv_profile[2].sid.reserved, 0) + << "incorrect value for last_msg_.acq_sv_profile[2].sid.reserved, " + "expected 0, is " + << last_msg_.acq_sv_profile[2].sid.reserved; + EXPECT_EQ(last_msg_.acq_sv_profile[2].sid.sat, 24) + << "incorrect value for last_msg_.acq_sv_profile[2].sid.sat, expected " + "24, is " + << last_msg_.acq_sv_profile[2].sid.sat; + EXPECT_EQ(last_msg_.acq_sv_profile[2].status, 213) + << "incorrect value for last_msg_.acq_sv_profile[2].status, expected " + "213, is " + << last_msg_.acq_sv_profile[2].status; + EXPECT_EQ(last_msg_.acq_sv_profile[2].time_spent, 245) + << "incorrect value for last_msg_.acq_sv_profile[2].time_spent, expected " + "245, is " + << last_msg_.acq_sv_profile[2].time_spent; + EXPECT_EQ(last_msg_.acq_sv_profile[2].timestamp, 49) + << "incorrect value for last_msg_.acq_sv_profile[2].timestamp, expected " + "49, is " + << last_msg_.acq_sv_profile[2].timestamp; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_acq_sv_profile.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_acq_sv_profile.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_acq_sv_profile.handle_as + << "'"; + } + { + const char check_string[] = {(char)97, (char)99, (char)113, (char)95, + (char)115, (char)118, (char)95, (char)112, + (char)114, (char)111, (char)102, (char)105, + (char)108, (char)101}; + EXPECT_EQ(memcmp(last_msg_.n_acq_sv_profile.related_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_acq_sv_profile.related_to, " + "expected string '" + << check_string << "', is '" << last_msg_.n_acq_sv_profile.related_to + << "'"; + } + EXPECT_EQ(last_msg_.n_acq_sv_profile.value, 3) + << "incorrect value for last_msg_.n_acq_sv_profile.value, expected 3, is " + << last_msg_.n_acq_sv_profile.value; } diff --git a/c/test/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.cc b/c/test/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.cc index 563b500e3..94fd35dae 100644 --- a/c/test/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.cc +++ b/c/test/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeReq.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_bootload_MsgBootloaderHandshakeReq0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_bootload_MsgBootloaderHandshakeReq0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_bootload_MsgBootloaderHandshakeReq0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_bootload_MsgBootloaderHandshakeReq0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_bootloader_handshake_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_bootloader_handshake_req_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,30 +67,30 @@ class Test_auto_check_sbp_bootload_MsgBootloaderHandshakeReq0 : sbp_msg_bootloader_handshake_req_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_bootload_MsgBootloaderHandshakeReq0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_bootload_MsgBootloaderHandshakeReq0, Test) { + uint8_t encoded_frame[] = { + 85, 179, 0, 136, 247, 0, 65, 216, + }; - uint8_t encoded_frame[] = {85,179,0,136,247,0,65,216, }; + sbp_msg_bootloader_handshake_req_t test_msg{}; - sbp_msg_bootloader_handshake_req_t test_msg{}; - - EXPECT_EQ(send_message( 63368, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(63368, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 63368); - EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 63368); + EXPECT_EQ(last_msg_, test_msg); } diff --git a/c/test/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.cc b/c/test/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.cc index 8986f5f2f..011184a04 100644 --- a/c/test/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.cc +++ b/c/test/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeResp.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_bootloader_handshake_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_bootloader_handshake_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,90 +67,91 @@ class Test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp0 : sbp_msg_bootloader_handshake_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp0, Test) -{ - - uint8_t encoded_frame[] = {85,180,0,0,0,9,0,0,0,0,118,49,46,50,10,201,1, }; - - sbp_msg_bootloader_handshake_resp_t test_msg{}; - test_msg.flags = 0; - - size_t written; - EXPECT_TRUE(sbp_msg_bootloader_handshake_resp_version_set(&test_msg, "v1.2\n", false, &written)); - EXPECT_EQ( written, strlen("v1.2\n")); - EXPECT_EQ(sbp_msg_bootloader_handshake_resp_version_encoded_len(&test_msg), 5); - - EXPECT_EQ(send_message( 0, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - - EXPECT_EQ(sbp_msg_bootloader_handshake_resp_version_encoded_len(&last_msg_), 5); - EXPECT_STREQ(sbp_msg_bootloader_handshake_resp_version_get(&last_msg_), "v1.2\n"); +}; + +TEST_F(Test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp0, Test) { + uint8_t encoded_frame[] = { + 85, 180, 0, 0, 0, 9, 0, 0, 0, 0, 118, 49, 46, 50, 10, 201, 1, + }; + + sbp_msg_bootloader_handshake_resp_t test_msg{}; + test_msg.flags = 0; + + size_t written; + EXPECT_TRUE(sbp_msg_bootloader_handshake_resp_version_set(&test_msg, "v1.2\n", + false, &written)); + EXPECT_EQ(written, strlen("v1.2\n")); + EXPECT_EQ(sbp_msg_bootloader_handshake_resp_version_encoded_len(&test_msg), + 5); + + EXPECT_EQ(send_message(0, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + + EXPECT_EQ(sbp_msg_bootloader_handshake_resp_version_encoded_len(&last_msg_), + 5); + EXPECT_STREQ(sbp_msg_bootloader_handshake_resp_version_get(&last_msg_), + "v1.2\n"); } -class Test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_bootloader_handshake_dep_a_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_bootloader_handshake_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -162,38 +159,42 @@ class Test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp1 : sbp_msg_bootloader_handshake_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp1, Test) -{ - - uint8_t encoded_frame[] = {85,176,0,195,4,4,118,49,46,50,1,206, }; - - sbp_msg_bootloader_handshake_dep_a_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_bootloader_handshake_dep_a_handshake_set(&test_msg, "v1.2", false, &written)); - EXPECT_EQ( written, strlen("v1.2")); - EXPECT_EQ(sbp_msg_bootloader_handshake_dep_a_handshake_encoded_len(&test_msg), 4); - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_bootloader_handshake_dep_a_handshake_encoded_len(&last_msg_), 4); - EXPECT_STREQ(sbp_msg_bootloader_handshake_dep_a_handshake_get(&last_msg_), "v1.2"); +}; + +TEST_F(Test_auto_check_sbp_bootload_MsgBootloaderHandshakeResp1, Test) { + uint8_t encoded_frame[] = { + 85, 176, 0, 195, 4, 4, 118, 49, 46, 50, 1, 206, + }; + + sbp_msg_bootloader_handshake_dep_a_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_bootloader_handshake_dep_a_handshake_set( + &test_msg, "v1.2", false, &written)); + EXPECT_EQ(written, strlen("v1.2")); + EXPECT_EQ(sbp_msg_bootloader_handshake_dep_a_handshake_encoded_len(&test_msg), + 4); + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + + EXPECT_EQ( + sbp_msg_bootloader_handshake_dep_a_handshake_encoded_len(&last_msg_), 4); + EXPECT_STREQ(sbp_msg_bootloader_handshake_dep_a_handshake_get(&last_msg_), + "v1.2"); } diff --git a/c/test/cpp/auto_check_sbp_bootload_MsgBootloaderJumptoApp.cc b/c/test/cpp/auto_check_sbp_bootload_MsgBootloaderJumptoApp.cc index 936bf8791..5adaa207d 100644 --- a/c/test/cpp/auto_check_sbp_bootload_MsgBootloaderJumptoApp.cc +++ b/c/test/cpp/auto_check_sbp_bootload_MsgBootloaderJumptoApp.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderJumptoApp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderJumptoApp.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_bootload_MsgBootloaderJumptoApp0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_bootload_MsgBootloaderJumptoApp0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_bootload_MsgBootloaderJumptoApp0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_bootload_MsgBootloaderJumptoApp0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_bootloader_jump_to_app_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_bootloader_jump_to_app_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,32 +67,34 @@ class Test_auto_check_sbp_bootload_MsgBootloaderJumptoApp0 : sbp_msg_bootloader_jump_to_app_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_bootload_MsgBootloaderJumptoApp0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_bootload_MsgBootloaderJumptoApp0, Test) { + uint8_t encoded_frame[] = { + 85, 177, 0, 205, 18, 1, 216, 105, 96, + }; - uint8_t encoded_frame[] = {85,177,0,205,18,1,216,105,96, }; + sbp_msg_bootloader_jump_to_app_t test_msg{}; + test_msg.jump = 216; - sbp_msg_bootloader_jump_to_app_t test_msg{}; - test_msg.jump = 216; - - EXPECT_EQ(send_message( 4813, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(4813, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4813); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.jump, 216) << "incorrect value for last_msg_.jump, expected 216, is " << last_msg_.jump; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4813); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.jump, 216) + << "incorrect value for last_msg_.jump, expected 216, is " + << last_msg_.jump; } diff --git a/c/test/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaReq.cc b/c/test/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaReq.cc index 6104dbf6c..0b316c53b 100644 --- a/c/test/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaReq.cc +++ b/c/test/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaReq.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaReq.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_bootload_MsgNapDeviceDnaReq0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_bootload_MsgNapDeviceDnaReq0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_bootload_MsgNapDeviceDnaReq0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_bootload_MsgNapDeviceDnaReq0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_nap_device_dna_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_nap_device_dna_req_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,30 +67,30 @@ class Test_auto_check_sbp_bootload_MsgNapDeviceDnaReq0 : sbp_msg_nap_device_dna_req_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_bootload_MsgNapDeviceDnaReq0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_bootload_MsgNapDeviceDnaReq0, Test) { + uint8_t encoded_frame[] = { + 85, 222, 0, 128, 50, 0, 231, 160, + }; - uint8_t encoded_frame[] = {85,222,0,128,50,0,231,160, }; + sbp_msg_nap_device_dna_req_t test_msg{}; - sbp_msg_nap_device_dna_req_t test_msg{}; - - EXPECT_EQ(send_message( 12928, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(12928, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 12928); - EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 12928); + EXPECT_EQ(last_msg_, test_msg); } diff --git a/c/test/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaResp.cc b/c/test/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaResp.cc index e07ec93c9..4a717da95 100644 --- a/c/test/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaResp.cc +++ b/c/test/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaResp.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaResp.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_bootload_MsgNapDeviceDnaResp0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_bootload_MsgNapDeviceDnaResp0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_bootload_MsgNapDeviceDnaResp0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_bootload_MsgNapDeviceDnaResp0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_nap_device_dna_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_nap_device_dna_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,54 +67,70 @@ class Test_auto_check_sbp_bootload_MsgNapDeviceDnaResp0 : sbp_msg_nap_device_dna_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_bootload_MsgNapDeviceDnaResp0, Test) -{ - - uint8_t encoded_frame[] = {85,221,0,169,56,8,2,187,1,130,173,244,67,122,70,91, }; - - sbp_msg_nap_device_dna_resp_t test_msg{}; - - test_msg.dna[0] = 2; - - test_msg.dna[1] = 187; - - test_msg.dna[2] = 1; - - test_msg.dna[3] = 130; - - test_msg.dna[4] = 173; - - test_msg.dna[5] = 244; - - test_msg.dna[6] = 67; - - test_msg.dna[7] = 122; - - EXPECT_EQ(send_message( 14505, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 14505); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.dna[0], 2) << "incorrect value for last_msg_.dna[0], expected 2, is " << last_msg_.dna[0]; - EXPECT_EQ(last_msg_.dna[1], 187) << "incorrect value for last_msg_.dna[1], expected 187, is " << last_msg_.dna[1]; - EXPECT_EQ(last_msg_.dna[2], 1) << "incorrect value for last_msg_.dna[2], expected 1, is " << last_msg_.dna[2]; - EXPECT_EQ(last_msg_.dna[3], 130) << "incorrect value for last_msg_.dna[3], expected 130, is " << last_msg_.dna[3]; - EXPECT_EQ(last_msg_.dna[4], 173) << "incorrect value for last_msg_.dna[4], expected 173, is " << last_msg_.dna[4]; - EXPECT_EQ(last_msg_.dna[5], 244) << "incorrect value for last_msg_.dna[5], expected 244, is " << last_msg_.dna[5]; - EXPECT_EQ(last_msg_.dna[6], 67) << "incorrect value for last_msg_.dna[6], expected 67, is " << last_msg_.dna[6]; - EXPECT_EQ(last_msg_.dna[7], 122) << "incorrect value for last_msg_.dna[7], expected 122, is " << last_msg_.dna[7]; +}; + +TEST_F(Test_auto_check_sbp_bootload_MsgNapDeviceDnaResp0, Test) { + uint8_t encoded_frame[] = { + 85, 221, 0, 169, 56, 8, 2, 187, 1, 130, 173, 244, 67, 122, 70, 91, + }; + + sbp_msg_nap_device_dna_resp_t test_msg{}; + + test_msg.dna[0] = 2; + + test_msg.dna[1] = 187; + + test_msg.dna[2] = 1; + + test_msg.dna[3] = 130; + + test_msg.dna[4] = 173; + + test_msg.dna[5] = 244; + + test_msg.dna[6] = 67; + + test_msg.dna[7] = 122; + + EXPECT_EQ(send_message(14505, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 14505); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.dna[0], 2) + << "incorrect value for last_msg_.dna[0], expected 2, is " + << last_msg_.dna[0]; + EXPECT_EQ(last_msg_.dna[1], 187) + << "incorrect value for last_msg_.dna[1], expected 187, is " + << last_msg_.dna[1]; + EXPECT_EQ(last_msg_.dna[2], 1) + << "incorrect value for last_msg_.dna[2], expected 1, is " + << last_msg_.dna[2]; + EXPECT_EQ(last_msg_.dna[3], 130) + << "incorrect value for last_msg_.dna[3], expected 130, is " + << last_msg_.dna[3]; + EXPECT_EQ(last_msg_.dna[4], 173) + << "incorrect value for last_msg_.dna[4], expected 173, is " + << last_msg_.dna[4]; + EXPECT_EQ(last_msg_.dna[5], 244) + << "incorrect value for last_msg_.dna[5], expected 244, is " + << last_msg_.dna[5]; + EXPECT_EQ(last_msg_.dna[6], 67) + << "incorrect value for last_msg_.dna[6], expected 67, is " + << last_msg_.dna[6]; + EXPECT_EQ(last_msg_.dna[7], 122) + << "incorrect value for last_msg_.dna[7], expected 122, is " + << last_msg_.dna[7]; } diff --git a/c/test/cpp/auto_check_sbp_ext_events_MsgExtEvent.cc b/c/test/cpp/auto_check_sbp_ext_events_MsgExtEvent.cc index cd5c920fb..4aa13a854 100644 --- a/c/test/cpp/auto_check_sbp_ext_events_MsgExtEvent.cc +++ b/c/test/cpp/auto_check_sbp_ext_events_MsgExtEvent.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ext_events/test_MsgExtEvent.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ext_events/test_MsgExtEvent.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ext_events_MsgExtEvent0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ext_events_MsgExtEvent0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ext_events_MsgExtEvent0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ext_events_MsgExtEvent0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ext_event_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ext_event_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,40 +67,49 @@ class Test_auto_check_sbp_ext_events_MsgExtEvent0 : sbp_msg_ext_event_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ext_events_MsgExtEvent0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_ext_events_MsgExtEvent0, Test) { + uint8_t encoded_frame[] = { + 85, 1, 1, 245, 6, 12, 48, 7, 199, 216, + 49, 15, 202, 65, 15, 0, 3, 0, 62, 204, + }; - uint8_t encoded_frame[] = {85,1,1,245,6,12,48,7,199,216,49,15,202,65,15,0,3,0,62,204, }; + sbp_msg_ext_event_t test_msg{}; + test_msg.flags = 3; + test_msg.ns_residual = 999882; + test_msg.pin = 0; + test_msg.tow = 254924999; + test_msg.wn = 1840; - sbp_msg_ext_event_t test_msg{}; - test_msg.flags = 3; - test_msg.ns_residual = 999882; - test_msg.pin = 0; - test_msg.tow = 254924999; - test_msg.wn = 1840; - - EXPECT_EQ(send_message( 1781, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1781, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1781); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 3) << "incorrect value for last_msg_.flags, expected 3, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 999882) << "incorrect value for last_msg_.ns_residual, expected 999882, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.pin, 0) << "incorrect value for last_msg_.pin, expected 0, is " << last_msg_.pin; - EXPECT_EQ(last_msg_.tow, 254924999) << "incorrect value for last_msg_.tow, expected 254924999, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1840) << "incorrect value for last_msg_.wn, expected 1840, is " << last_msg_.wn; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1781); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 3) + << "incorrect value for last_msg_.flags, expected 3, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 999882) + << "incorrect value for last_msg_.ns_residual, expected 999882, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.pin, 0) + << "incorrect value for last_msg_.pin, expected 0, is " << last_msg_.pin; + EXPECT_EQ(last_msg_.tow, 254924999) + << "incorrect value for last_msg_.tow, expected 254924999, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1840) + << "incorrect value for last_msg_.wn, expected 1840, is " << last_msg_.wn; } diff --git a/c/test/cpp/auto_check_sbp_file_io_MsgFileioConfigReq.cc b/c/test/cpp/auto_check_sbp_file_io_MsgFileioConfigReq.cc index 2a16b49d3..839c20fde 100644 --- a/c/test/cpp/auto_check_sbp_file_io_MsgFileioConfigReq.cc +++ b/c/test/cpp/auto_check_sbp_file_io_MsgFileioConfigReq.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigReq.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_file_io_MsgFileioConfigReq0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_file_io_MsgFileioConfigReq0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_file_io_MsgFileioConfigReq0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_file_io_MsgFileioConfigReq0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_fileio_config_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_fileio_config_req_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,32 +67,34 @@ class Test_auto_check_sbp_file_io_MsgFileioConfigReq0 : sbp_msg_fileio_config_req_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_file_io_MsgFileioConfigReq0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_file_io_MsgFileioConfigReq0, Test) { + uint8_t encoded_frame[] = { + 85, 1, 16, 195, 4, 4, 107, 218, 69, 90, 185, 27, + }; - uint8_t encoded_frame[] = {85,1,16,195,4,4,107,218,69,90,185,27, }; + sbp_msg_fileio_config_req_t test_msg{}; + test_msg.sequence = 1514527339; - sbp_msg_fileio_config_req_t test_msg{}; - test_msg.sequence = 1514527339; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.sequence, 1514527339) << "incorrect value for last_msg_.sequence, expected 1514527339, is " << last_msg_.sequence; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.sequence, 1514527339) + << "incorrect value for last_msg_.sequence, expected 1514527339, is " + << last_msg_.sequence; } diff --git a/c/test/cpp/auto_check_sbp_file_io_MsgFileioConfigResp.cc b/c/test/cpp/auto_check_sbp_file_io_MsgFileioConfigResp.cc index cdaa7f18f..7c6e56523 100644 --- a/c/test/cpp/auto_check_sbp_file_io_MsgFileioConfigResp.cc +++ b/c/test/cpp/auto_check_sbp_file_io_MsgFileioConfigResp.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigResp.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_file_io_MsgFileioConfigResp0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_file_io_MsgFileioConfigResp0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_file_io_MsgFileioConfigResp0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_file_io_MsgFileioConfigResp0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_fileio_config_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_fileio_config_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,38 +67,48 @@ class Test_auto_check_sbp_file_io_MsgFileioConfigResp0 : sbp_msg_fileio_config_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_file_io_MsgFileioConfigResp0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_file_io_MsgFileioConfigResp0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 16, 195, 4, 16, 170, 76, 52, 91, 149, 186, + 44, 3, 216, 151, 255, 61, 12, 97, 66, 144, 239, 115, + }; - uint8_t encoded_frame[] = {85,2,16,195,4,16,170,76,52,91,149,186,44,3,216,151,255,61,12,97,66,144,239,115, }; + sbp_msg_fileio_config_resp_t test_msg{}; + test_msg.batch_size = 1040160728; + test_msg.fileio_version = 2420269324; + test_msg.sequence = 1530154154; + test_msg.window_size = 53262997; - sbp_msg_fileio_config_resp_t test_msg{}; - test_msg.batch_size = 1040160728; - test_msg.fileio_version = 2420269324; - test_msg.sequence = 1530154154; - test_msg.window_size = 53262997; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.batch_size, 1040160728) << "incorrect value for last_msg_.batch_size, expected 1040160728, is " << last_msg_.batch_size; - EXPECT_EQ(last_msg_.fileio_version, 2420269324) << "incorrect value for last_msg_.fileio_version, expected 2420269324, is " << last_msg_.fileio_version; - EXPECT_EQ(last_msg_.sequence, 1530154154) << "incorrect value for last_msg_.sequence, expected 1530154154, is " << last_msg_.sequence; - EXPECT_EQ(last_msg_.window_size, 53262997) << "incorrect value for last_msg_.window_size, expected 53262997, is " << last_msg_.window_size; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.batch_size, 1040160728) + << "incorrect value for last_msg_.batch_size, expected 1040160728, is " + << last_msg_.batch_size; + EXPECT_EQ(last_msg_.fileio_version, 2420269324) + << "incorrect value for last_msg_.fileio_version, expected 2420269324, " + "is " + << last_msg_.fileio_version; + EXPECT_EQ(last_msg_.sequence, 1530154154) + << "incorrect value for last_msg_.sequence, expected 1530154154, is " + << last_msg_.sequence; + EXPECT_EQ(last_msg_.window_size, 53262997) + << "incorrect value for last_msg_.window_size, expected 53262997, is " + << last_msg_.window_size; } diff --git a/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadDirReq.cc b/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadDirReq.cc index 68160049b..ee3542782 100644 --- a/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadDirReq.cc +++ b/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadDirReq.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirReq.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_file_io_MsgFileioReadDirReq0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_file_io_MsgFileioReadDirReq0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_file_io_MsgFileioReadDirReq0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_file_io_MsgFileioReadDirReq0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_fileio_read_dir_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_fileio_read_dir_req_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,42 +67,50 @@ class Test_auto_check_sbp_file_io_MsgFileioReadDirReq0 : sbp_msg_fileio_read_dir_req_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_file_io_MsgFileioReadDirReq0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_file_io_MsgFileioReadDirReq0, Test) { + uint8_t encoded_frame[] = { + 85, 169, 0, 195, 4, 26, 130, 231, 255, 90, 196, 134, + 47, 134, 47, 115, 111, 109, 101, 47, 114, 97, 110, 100, + 111, 109, 47, 112, 97, 116, 104, 0, 26, 186, + }; + + sbp_msg_fileio_read_dir_req_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_fileio_read_dir_req_dirname_set( + &test_msg, "/some/random/path", false, &written)); + EXPECT_EQ(written, strlen("/some/random/path")); + EXPECT_EQ(sbp_msg_fileio_read_dir_req_dirname_encoded_len(&test_msg), 18); + test_msg.offset = 2251261636; + test_msg.sequence = 1526720386; - uint8_t encoded_frame[] = {85,169,0,195,4,26,130,231,255,90,196,134,47,134,47,115,111,109,101,47,114,97,110,100,111,109,47,112,97,116,104,0,26,186, }; + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_fileio_read_dir_req_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_fileio_read_dir_req_dirname_set(&test_msg, "/some/random/path", false, &written)); - EXPECT_EQ( written, strlen("/some/random/path")); - EXPECT_EQ(sbp_msg_fileio_read_dir_req_dirname_encoded_len(&test_msg), 18); - test_msg.offset = 2251261636; - test_msg.sequence = 1526720386; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_fileio_read_dir_req_dirname_encoded_len(&last_msg_), 18); - EXPECT_STREQ(sbp_msg_fileio_read_dir_req_dirname_get(&last_msg_), "/some/random/path"); - EXPECT_EQ(last_msg_.offset, 2251261636) << "incorrect value for last_msg_.offset, expected 2251261636, is " << last_msg_.offset; - EXPECT_EQ(last_msg_.sequence, 1526720386) << "incorrect value for last_msg_.sequence, expected 1526720386, is " << last_msg_.sequence; + EXPECT_EQ(sbp_msg_fileio_read_dir_req_dirname_encoded_len(&last_msg_), 18); + EXPECT_STREQ(sbp_msg_fileio_read_dir_req_dirname_get(&last_msg_), + "/some/random/path"); + EXPECT_EQ(last_msg_.offset, 2251261636) + << "incorrect value for last_msg_.offset, expected 2251261636, is " + << last_msg_.offset; + EXPECT_EQ(last_msg_.sequence, 1526720386) + << "incorrect value for last_msg_.sequence, expected 1526720386, is " + << last_msg_.sequence; } diff --git a/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadDirResp.cc b/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadDirResp.cc index a87f6e16e..00a3a0c99 100644 --- a/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadDirResp.cc +++ b/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadDirResp.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirResp.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_file_io_MsgFileioReadDirResp0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_file_io_MsgFileioReadDirResp0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_file_io_MsgFileioReadDirResp0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_file_io_MsgFileioReadDirResp0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_fileio_read_dir_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_fileio_read_dir_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,42 +67,53 @@ class Test_auto_check_sbp_file_io_MsgFileioReadDirResp0 : sbp_msg_fileio_read_dir_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_file_io_MsgFileioReadDirResp0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_file_io_MsgFileioReadDirResp0, Test) { + uint8_t encoded_frame[] = { + 85, 170, 0, 195, 4, 45, 78, 253, 224, 235, 102, 105, 108, 101, + 49, 0, 97, 110, 111, 116, 104, 101, 114, 32, 102, 105, 108, 101, + 0, 100, 101, 102, 105, 110, 105, 116, 101, 108, 121, 32, 110, 111, + 116, 32, 97, 32, 102, 105, 108, 101, 0, 186, 137, + }; + + sbp_msg_fileio_read_dir_resp_t test_msg{}; + + EXPECT_TRUE( + sbp_msg_fileio_read_dir_resp_contents_add_section(&test_msg, "file1")); + EXPECT_TRUE(sbp_msg_fileio_read_dir_resp_contents_add_section( + &test_msg, "another file")); + EXPECT_TRUE(sbp_msg_fileio_read_dir_resp_contents_add_section( + &test_msg, "definitely not a file")); + EXPECT_EQ(sbp_msg_fileio_read_dir_resp_contents_encoded_len(&test_msg), 41); + test_msg.sequence = 3957390670; - uint8_t encoded_frame[] = {85,170,0,195,4,45,78,253,224,235,102,105,108,101,49,0,97,110,111,116,104,101,114,32,102,105,108,101,0,100,101,102,105,110,105,116,101,108,121,32,110,111,116,32,97,32,102,105,108,101,0,186,137, }; + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_fileio_read_dir_resp_t test_msg{}; - - EXPECT_TRUE(sbp_msg_fileio_read_dir_resp_contents_add_section(&test_msg, "file1")); - EXPECT_TRUE(sbp_msg_fileio_read_dir_resp_contents_add_section(&test_msg, "another file")); - EXPECT_TRUE(sbp_msg_fileio_read_dir_resp_contents_add_section(&test_msg, "definitely not a file")); - EXPECT_EQ(sbp_msg_fileio_read_dir_resp_contents_encoded_len(&test_msg), 41); - test_msg.sequence = 3957390670; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_fileio_read_dir_resp_contents_encoded_len(&last_msg_), 41); - EXPECT_STREQ(sbp_msg_fileio_read_dir_resp_contents_get_section(&last_msg_, 0), "file1"); - EXPECT_STREQ(sbp_msg_fileio_read_dir_resp_contents_get_section(&last_msg_, 1), "another file"); - EXPECT_STREQ(sbp_msg_fileio_read_dir_resp_contents_get_section(&last_msg_, 2), "definitely not a file"); - EXPECT_EQ(last_msg_.sequence, 3957390670) << "incorrect value for last_msg_.sequence, expected 3957390670, is " << last_msg_.sequence; + EXPECT_EQ(sbp_msg_fileio_read_dir_resp_contents_encoded_len(&last_msg_), 41); + EXPECT_STREQ(sbp_msg_fileio_read_dir_resp_contents_get_section(&last_msg_, 0), + "file1"); + EXPECT_STREQ(sbp_msg_fileio_read_dir_resp_contents_get_section(&last_msg_, 1), + "another file"); + EXPECT_STREQ(sbp_msg_fileio_read_dir_resp_contents_get_section(&last_msg_, 2), + "definitely not a file"); + EXPECT_EQ(last_msg_.sequence, 3957390670) + << "incorrect value for last_msg_.sequence, expected 3957390670, is " + << last_msg_.sequence; } diff --git a/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadReq.cc b/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadReq.cc index 03b868689..74718523b 100644 --- a/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadReq.cc +++ b/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadReq.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadReq.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_file_io_MsgFileioReadReq0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_file_io_MsgFileioReadReq0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_file_io_MsgFileioReadReq0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_file_io_MsgFileioReadReq0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_fileio_read_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_fileio_read_req_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,44 +67,54 @@ class Test_auto_check_sbp_file_io_MsgFileioReadReq0 : sbp_msg_fileio_read_req_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_file_io_MsgFileioReadReq0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_file_io_MsgFileioReadReq0, Test) { + uint8_t encoded_frame[] = { + 85, 168, 0, 195, 4, 28, 34, 156, 130, 40, 98, 178, + 190, 23, 53, 47, 112, 97, 116, 104, 47, 116, 111, 47, + 115, 111, 109, 101, 47, 102, 105, 108, 101, 0, 86, 100, + }; + + sbp_msg_fileio_read_req_t test_msg{}; + test_msg.chunk_size = 53; + + size_t written; + EXPECT_TRUE(sbp_msg_fileio_read_req_filename_set( + &test_msg, "/path/to/some/file", false, &written)); + EXPECT_EQ(written, strlen("/path/to/some/file")); + EXPECT_EQ(sbp_msg_fileio_read_req_filename_encoded_len(&test_msg), 19); + test_msg.offset = 398373474; + test_msg.sequence = 679648290; - uint8_t encoded_frame[] = {85,168,0,195,4,28,34,156,130,40,98,178,190,23,53,47,112,97,116,104,47,116,111,47,115,111,109,101,47,102,105,108,101,0,86,100, }; + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_fileio_read_req_t test_msg{}; - test_msg.chunk_size = 53; - - size_t written; - EXPECT_TRUE(sbp_msg_fileio_read_req_filename_set(&test_msg, "/path/to/some/file", false, &written)); - EXPECT_EQ( written, strlen("/path/to/some/file")); - EXPECT_EQ(sbp_msg_fileio_read_req_filename_encoded_len(&test_msg), 19); - test_msg.offset = 398373474; - test_msg.sequence = 679648290; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.chunk_size, 53) + << "incorrect value for last_msg_.chunk_size, expected 53, is " + << last_msg_.chunk_size; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.chunk_size, 53) << "incorrect value for last_msg_.chunk_size, expected 53, is " << last_msg_.chunk_size; - - EXPECT_EQ(sbp_msg_fileio_read_req_filename_encoded_len(&last_msg_), 19); - EXPECT_STREQ(sbp_msg_fileio_read_req_filename_get(&last_msg_), "/path/to/some/file"); - EXPECT_EQ(last_msg_.offset, 398373474) << "incorrect value for last_msg_.offset, expected 398373474, is " << last_msg_.offset; - EXPECT_EQ(last_msg_.sequence, 679648290) << "incorrect value for last_msg_.sequence, expected 679648290, is " << last_msg_.sequence; + EXPECT_EQ(sbp_msg_fileio_read_req_filename_encoded_len(&last_msg_), 19); + EXPECT_STREQ(sbp_msg_fileio_read_req_filename_get(&last_msg_), + "/path/to/some/file"); + EXPECT_EQ(last_msg_.offset, 398373474) + << "incorrect value for last_msg_.offset, expected 398373474, is " + << last_msg_.offset; + EXPECT_EQ(last_msg_.sequence, 679648290) + << "incorrect value for last_msg_.sequence, expected 679648290, is " + << last_msg_.sequence; } diff --git a/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadResp.cc b/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadResp.cc index 9a1320556..3f7ddbf1f 100644 --- a/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadResp.cc +++ b/c/test/cpp/auto_check_sbp_file_io_MsgFileioReadResp.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadResp.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_file_io_MsgFileioReadResp0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_file_io_MsgFileioReadResp0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_file_io_MsgFileioReadResp0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_file_io_MsgFileioReadResp0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_fileio_read_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_fileio_read_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,803 +67,1343 @@ class Test_auto_check_sbp_file_io_MsgFileioReadResp0 : sbp_msg_fileio_read_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_file_io_MsgFileioReadResp0, Test) -{ - - uint8_t encoded_frame[] = {85,163,0,195,4,255,67,183,115,15,73,231,227,179,18,76,68,229,216,21,98,183,69,190,5,252,176,55,32,78,8,52,127,50,71,106,61,79,191,106,46,79,118,248,118,207,206,210,91,73,251,81,131,205,193,146,206,185,140,249,163,231,65,67,94,250,109,152,95,123,77,224,124,238,205,65,103,35,104,209,5,191,47,249,176,166,213,46,192,86,32,103,146,252,4,16,54,161,60,6,13,191,116,182,42,191,213,20,217,8,142,187,238,120,184,250,31,151,37,51,177,130,190,155,71,68,56,238,92,130,37,137,146,246,114,116,138,165,217,79,10,189,128,189,2,240,92,28,126,105,236,228,194,0,51,61,74,41,10,239,133,106,190,30,27,3,240,205,253,113,25,28,187,81,101,216,121,41,179,120,152,18,116,53,212,100,2,114,198,200,10,147,25,33,115,208,113,60,179,183,0,41,217,206,255,211,225,142,191,133,81,15,248,193,66,191,244,221,248,199,241,112,51,1,180,180,125,97,145,25,72,210,215,208,15,126,56,38,65,4,64,19,74,223,111,109,52,43,167,186,202,111,11,91,21,236,234,196,36,171,147,10,240, }; - - sbp_msg_fileio_read_resp_t test_msg{}; - - test_msg.contents[0] = 73; - - test_msg.contents[1] = 231; - - test_msg.contents[2] = 227; - - test_msg.contents[3] = 179; - - test_msg.contents[4] = 18; - - test_msg.contents[5] = 76; - - test_msg.contents[6] = 68; - - test_msg.contents[7] = 229; - - test_msg.contents[8] = 216; - - test_msg.contents[9] = 21; - - test_msg.contents[10] = 98; - - test_msg.contents[11] = 183; - - test_msg.contents[12] = 69; - - test_msg.contents[13] = 190; - - test_msg.contents[14] = 5; - - test_msg.contents[15] = 252; - - test_msg.contents[16] = 176; - - test_msg.contents[17] = 55; - - test_msg.contents[18] = 32; - - test_msg.contents[19] = 78; - - test_msg.contents[20] = 8; - - test_msg.contents[21] = 52; - - test_msg.contents[22] = 127; - - test_msg.contents[23] = 50; - - test_msg.contents[24] = 71; - - test_msg.contents[25] = 106; - - test_msg.contents[26] = 61; - - test_msg.contents[27] = 79; - - test_msg.contents[28] = 191; - - test_msg.contents[29] = 106; - - test_msg.contents[30] = 46; - - test_msg.contents[31] = 79; - - test_msg.contents[32] = 118; - - test_msg.contents[33] = 248; - - test_msg.contents[34] = 118; - - test_msg.contents[35] = 207; - - test_msg.contents[36] = 206; - - test_msg.contents[37] = 210; - - test_msg.contents[38] = 91; - - test_msg.contents[39] = 73; - - test_msg.contents[40] = 251; - - test_msg.contents[41] = 81; - - test_msg.contents[42] = 131; - - test_msg.contents[43] = 205; - - test_msg.contents[44] = 193; - - test_msg.contents[45] = 146; - - test_msg.contents[46] = 206; - - test_msg.contents[47] = 185; - - test_msg.contents[48] = 140; - - test_msg.contents[49] = 249; - - test_msg.contents[50] = 163; - - test_msg.contents[51] = 231; - - test_msg.contents[52] = 65; - - test_msg.contents[53] = 67; - - test_msg.contents[54] = 94; - - test_msg.contents[55] = 250; - - test_msg.contents[56] = 109; - - test_msg.contents[57] = 152; - - test_msg.contents[58] = 95; - - test_msg.contents[59] = 123; - - test_msg.contents[60] = 77; - - test_msg.contents[61] = 224; - - test_msg.contents[62] = 124; - - test_msg.contents[63] = 238; - - test_msg.contents[64] = 205; - - test_msg.contents[65] = 65; - - test_msg.contents[66] = 103; - - test_msg.contents[67] = 35; - - test_msg.contents[68] = 104; - - test_msg.contents[69] = 209; - - test_msg.contents[70] = 5; - - test_msg.contents[71] = 191; - - test_msg.contents[72] = 47; - - test_msg.contents[73] = 249; - - test_msg.contents[74] = 176; - - test_msg.contents[75] = 166; - - test_msg.contents[76] = 213; - - test_msg.contents[77] = 46; - - test_msg.contents[78] = 192; - - test_msg.contents[79] = 86; - - test_msg.contents[80] = 32; - - test_msg.contents[81] = 103; - - test_msg.contents[82] = 146; - - test_msg.contents[83] = 252; - - test_msg.contents[84] = 4; - - test_msg.contents[85] = 16; - - test_msg.contents[86] = 54; - - test_msg.contents[87] = 161; - - test_msg.contents[88] = 60; - - test_msg.contents[89] = 6; - - test_msg.contents[90] = 13; - - test_msg.contents[91] = 191; - - test_msg.contents[92] = 116; - - test_msg.contents[93] = 182; - - test_msg.contents[94] = 42; - - test_msg.contents[95] = 191; - - test_msg.contents[96] = 213; - - test_msg.contents[97] = 20; - - test_msg.contents[98] = 217; - - test_msg.contents[99] = 8; - - test_msg.contents[100] = 142; - - test_msg.contents[101] = 187; - - test_msg.contents[102] = 238; - - test_msg.contents[103] = 120; - - test_msg.contents[104] = 184; - - test_msg.contents[105] = 250; - - test_msg.contents[106] = 31; - - test_msg.contents[107] = 151; - - test_msg.contents[108] = 37; - - test_msg.contents[109] = 51; - - test_msg.contents[110] = 177; - - test_msg.contents[111] = 130; - - test_msg.contents[112] = 190; - - test_msg.contents[113] = 155; - - test_msg.contents[114] = 71; - - test_msg.contents[115] = 68; - - test_msg.contents[116] = 56; - - test_msg.contents[117] = 238; - - test_msg.contents[118] = 92; - - test_msg.contents[119] = 130; - - test_msg.contents[120] = 37; - - test_msg.contents[121] = 137; - - test_msg.contents[122] = 146; - - test_msg.contents[123] = 246; - - test_msg.contents[124] = 114; - - test_msg.contents[125] = 116; - - test_msg.contents[126] = 138; - - test_msg.contents[127] = 165; - - test_msg.contents[128] = 217; - - test_msg.contents[129] = 79; - - test_msg.contents[130] = 10; - - test_msg.contents[131] = 189; - - test_msg.contents[132] = 128; - - test_msg.contents[133] = 189; - - test_msg.contents[134] = 2; - - test_msg.contents[135] = 240; - - test_msg.contents[136] = 92; - - test_msg.contents[137] = 28; - - test_msg.contents[138] = 126; - - test_msg.contents[139] = 105; - - test_msg.contents[140] = 236; - - test_msg.contents[141] = 228; - - test_msg.contents[142] = 194; - - test_msg.contents[143] = 0; - - test_msg.contents[144] = 51; - - test_msg.contents[145] = 61; - - test_msg.contents[146] = 74; - - test_msg.contents[147] = 41; - - test_msg.contents[148] = 10; - - test_msg.contents[149] = 239; - - test_msg.contents[150] = 133; - - test_msg.contents[151] = 106; - - test_msg.contents[152] = 190; - - test_msg.contents[153] = 30; - - test_msg.contents[154] = 27; - - test_msg.contents[155] = 3; - - test_msg.contents[156] = 240; - - test_msg.contents[157] = 205; - - test_msg.contents[158] = 253; - - test_msg.contents[159] = 113; - - test_msg.contents[160] = 25; - - test_msg.contents[161] = 28; - - test_msg.contents[162] = 187; - - test_msg.contents[163] = 81; - - test_msg.contents[164] = 101; - - test_msg.contents[165] = 216; - - test_msg.contents[166] = 121; - - test_msg.contents[167] = 41; - - test_msg.contents[168] = 179; - - test_msg.contents[169] = 120; - - test_msg.contents[170] = 152; - - test_msg.contents[171] = 18; - - test_msg.contents[172] = 116; - - test_msg.contents[173] = 53; - - test_msg.contents[174] = 212; - - test_msg.contents[175] = 100; - - test_msg.contents[176] = 2; - - test_msg.contents[177] = 114; - - test_msg.contents[178] = 198; - - test_msg.contents[179] = 200; - - test_msg.contents[180] = 10; - - test_msg.contents[181] = 147; - - test_msg.contents[182] = 25; - - test_msg.contents[183] = 33; - - test_msg.contents[184] = 115; - - test_msg.contents[185] = 208; - - test_msg.contents[186] = 113; - - test_msg.contents[187] = 60; - - test_msg.contents[188] = 179; - - test_msg.contents[189] = 183; - - test_msg.contents[190] = 0; - - test_msg.contents[191] = 41; - - test_msg.contents[192] = 217; - - test_msg.contents[193] = 206; - - test_msg.contents[194] = 255; - - test_msg.contents[195] = 211; - - test_msg.contents[196] = 225; - - test_msg.contents[197] = 142; - - test_msg.contents[198] = 191; - - test_msg.contents[199] = 133; - - test_msg.contents[200] = 81; - - test_msg.contents[201] = 15; - - test_msg.contents[202] = 248; - - test_msg.contents[203] = 193; - - test_msg.contents[204] = 66; - - test_msg.contents[205] = 191; - - test_msg.contents[206] = 244; - - test_msg.contents[207] = 221; - - test_msg.contents[208] = 248; - - test_msg.contents[209] = 199; - - test_msg.contents[210] = 241; - - test_msg.contents[211] = 112; - - test_msg.contents[212] = 51; - - test_msg.contents[213] = 1; - - test_msg.contents[214] = 180; - - test_msg.contents[215] = 180; - - test_msg.contents[216] = 125; - - test_msg.contents[217] = 97; - - test_msg.contents[218] = 145; - - test_msg.contents[219] = 25; - - test_msg.contents[220] = 72; - - test_msg.contents[221] = 210; - - test_msg.contents[222] = 215; - - test_msg.contents[223] = 208; - - test_msg.contents[224] = 15; - - test_msg.contents[225] = 126; - - test_msg.contents[226] = 56; - - test_msg.contents[227] = 38; - - test_msg.contents[228] = 65; - - test_msg.contents[229] = 4; - - test_msg.contents[230] = 64; - - test_msg.contents[231] = 19; - - test_msg.contents[232] = 74; - - test_msg.contents[233] = 223; - - test_msg.contents[234] = 111; - - test_msg.contents[235] = 109; - - test_msg.contents[236] = 52; - - test_msg.contents[237] = 43; - - test_msg.contents[238] = 167; - - test_msg.contents[239] = 186; - - test_msg.contents[240] = 202; - - test_msg.contents[241] = 111; - - test_msg.contents[242] = 11; - - test_msg.contents[243] = 91; - - test_msg.contents[244] = 21; - - test_msg.contents[245] = 236; - - test_msg.contents[246] = 234; - - test_msg.contents[247] = 196; - - test_msg.contents[248] = 36; - - test_msg.contents[249] = 171; - - test_msg.contents[250] = 147; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_contents.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)99,(char)111,(char)110,(char)116,(char)101,(char)110,(char)116,(char)115 }; - memcpy(test_msg.n_contents.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_contents.value = 251; - test_msg.sequence = 259241795; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.contents[0], 73) << "incorrect value for last_msg_.contents[0], expected 73, is " << last_msg_.contents[0]; - EXPECT_EQ(last_msg_.contents[1], 231) << "incorrect value for last_msg_.contents[1], expected 231, is " << last_msg_.contents[1]; - EXPECT_EQ(last_msg_.contents[2], 227) << "incorrect value for last_msg_.contents[2], expected 227, is " << last_msg_.contents[2]; - EXPECT_EQ(last_msg_.contents[3], 179) << "incorrect value for last_msg_.contents[3], expected 179, is " << last_msg_.contents[3]; - EXPECT_EQ(last_msg_.contents[4], 18) << "incorrect value for last_msg_.contents[4], expected 18, is " << last_msg_.contents[4]; - EXPECT_EQ(last_msg_.contents[5], 76) << "incorrect value for last_msg_.contents[5], expected 76, is " << last_msg_.contents[5]; - EXPECT_EQ(last_msg_.contents[6], 68) << "incorrect value for last_msg_.contents[6], expected 68, is " << last_msg_.contents[6]; - EXPECT_EQ(last_msg_.contents[7], 229) << "incorrect value for last_msg_.contents[7], expected 229, is " << last_msg_.contents[7]; - EXPECT_EQ(last_msg_.contents[8], 216) << "incorrect value for last_msg_.contents[8], expected 216, is " << last_msg_.contents[8]; - EXPECT_EQ(last_msg_.contents[9], 21) << "incorrect value for last_msg_.contents[9], expected 21, is " << last_msg_.contents[9]; - EXPECT_EQ(last_msg_.contents[10], 98) << "incorrect value for last_msg_.contents[10], expected 98, is " << last_msg_.contents[10]; - EXPECT_EQ(last_msg_.contents[11], 183) << "incorrect value for last_msg_.contents[11], expected 183, is " << last_msg_.contents[11]; - EXPECT_EQ(last_msg_.contents[12], 69) << "incorrect value for last_msg_.contents[12], expected 69, is " << last_msg_.contents[12]; - EXPECT_EQ(last_msg_.contents[13], 190) << "incorrect value for last_msg_.contents[13], expected 190, is " << last_msg_.contents[13]; - EXPECT_EQ(last_msg_.contents[14], 5) << "incorrect value for last_msg_.contents[14], expected 5, is " << last_msg_.contents[14]; - EXPECT_EQ(last_msg_.contents[15], 252) << "incorrect value for last_msg_.contents[15], expected 252, is " << last_msg_.contents[15]; - EXPECT_EQ(last_msg_.contents[16], 176) << "incorrect value for last_msg_.contents[16], expected 176, is " << last_msg_.contents[16]; - EXPECT_EQ(last_msg_.contents[17], 55) << "incorrect value for last_msg_.contents[17], expected 55, is " << last_msg_.contents[17]; - EXPECT_EQ(last_msg_.contents[18], 32) << "incorrect value for last_msg_.contents[18], expected 32, is " << last_msg_.contents[18]; - EXPECT_EQ(last_msg_.contents[19], 78) << "incorrect value for last_msg_.contents[19], expected 78, is " << last_msg_.contents[19]; - EXPECT_EQ(last_msg_.contents[20], 8) << "incorrect value for last_msg_.contents[20], expected 8, is " << last_msg_.contents[20]; - EXPECT_EQ(last_msg_.contents[21], 52) << "incorrect value for last_msg_.contents[21], expected 52, is " << last_msg_.contents[21]; - EXPECT_EQ(last_msg_.contents[22], 127) << "incorrect value for last_msg_.contents[22], expected 127, is " << last_msg_.contents[22]; - EXPECT_EQ(last_msg_.contents[23], 50) << "incorrect value for last_msg_.contents[23], expected 50, is " << last_msg_.contents[23]; - EXPECT_EQ(last_msg_.contents[24], 71) << "incorrect value for last_msg_.contents[24], expected 71, is " << last_msg_.contents[24]; - EXPECT_EQ(last_msg_.contents[25], 106) << "incorrect value for last_msg_.contents[25], expected 106, is " << last_msg_.contents[25]; - EXPECT_EQ(last_msg_.contents[26], 61) << "incorrect value for last_msg_.contents[26], expected 61, is " << last_msg_.contents[26]; - EXPECT_EQ(last_msg_.contents[27], 79) << "incorrect value for last_msg_.contents[27], expected 79, is " << last_msg_.contents[27]; - EXPECT_EQ(last_msg_.contents[28], 191) << "incorrect value for last_msg_.contents[28], expected 191, is " << last_msg_.contents[28]; - EXPECT_EQ(last_msg_.contents[29], 106) << "incorrect value for last_msg_.contents[29], expected 106, is " << last_msg_.contents[29]; - EXPECT_EQ(last_msg_.contents[30], 46) << "incorrect value for last_msg_.contents[30], expected 46, is " << last_msg_.contents[30]; - EXPECT_EQ(last_msg_.contents[31], 79) << "incorrect value for last_msg_.contents[31], expected 79, is " << last_msg_.contents[31]; - EXPECT_EQ(last_msg_.contents[32], 118) << "incorrect value for last_msg_.contents[32], expected 118, is " << last_msg_.contents[32]; - EXPECT_EQ(last_msg_.contents[33], 248) << "incorrect value for last_msg_.contents[33], expected 248, is " << last_msg_.contents[33]; - EXPECT_EQ(last_msg_.contents[34], 118) << "incorrect value for last_msg_.contents[34], expected 118, is " << last_msg_.contents[34]; - EXPECT_EQ(last_msg_.contents[35], 207) << "incorrect value for last_msg_.contents[35], expected 207, is " << last_msg_.contents[35]; - EXPECT_EQ(last_msg_.contents[36], 206) << "incorrect value for last_msg_.contents[36], expected 206, is " << last_msg_.contents[36]; - EXPECT_EQ(last_msg_.contents[37], 210) << "incorrect value for last_msg_.contents[37], expected 210, is " << last_msg_.contents[37]; - EXPECT_EQ(last_msg_.contents[38], 91) << "incorrect value for last_msg_.contents[38], expected 91, is " << last_msg_.contents[38]; - EXPECT_EQ(last_msg_.contents[39], 73) << "incorrect value for last_msg_.contents[39], expected 73, is " << last_msg_.contents[39]; - EXPECT_EQ(last_msg_.contents[40], 251) << "incorrect value for last_msg_.contents[40], expected 251, is " << last_msg_.contents[40]; - EXPECT_EQ(last_msg_.contents[41], 81) << "incorrect value for last_msg_.contents[41], expected 81, is " << last_msg_.contents[41]; - EXPECT_EQ(last_msg_.contents[42], 131) << "incorrect value for last_msg_.contents[42], expected 131, is " << last_msg_.contents[42]; - EXPECT_EQ(last_msg_.contents[43], 205) << "incorrect value for last_msg_.contents[43], expected 205, is " << last_msg_.contents[43]; - EXPECT_EQ(last_msg_.contents[44], 193) << "incorrect value for last_msg_.contents[44], expected 193, is " << last_msg_.contents[44]; - EXPECT_EQ(last_msg_.contents[45], 146) << "incorrect value for last_msg_.contents[45], expected 146, is " << last_msg_.contents[45]; - EXPECT_EQ(last_msg_.contents[46], 206) << "incorrect value for last_msg_.contents[46], expected 206, is " << last_msg_.contents[46]; - EXPECT_EQ(last_msg_.contents[47], 185) << "incorrect value for last_msg_.contents[47], expected 185, is " << last_msg_.contents[47]; - EXPECT_EQ(last_msg_.contents[48], 140) << "incorrect value for last_msg_.contents[48], expected 140, is " << last_msg_.contents[48]; - EXPECT_EQ(last_msg_.contents[49], 249) << "incorrect value for last_msg_.contents[49], expected 249, is " << last_msg_.contents[49]; - EXPECT_EQ(last_msg_.contents[50], 163) << "incorrect value for last_msg_.contents[50], expected 163, is " << last_msg_.contents[50]; - EXPECT_EQ(last_msg_.contents[51], 231) << "incorrect value for last_msg_.contents[51], expected 231, is " << last_msg_.contents[51]; - EXPECT_EQ(last_msg_.contents[52], 65) << "incorrect value for last_msg_.contents[52], expected 65, is " << last_msg_.contents[52]; - EXPECT_EQ(last_msg_.contents[53], 67) << "incorrect value for last_msg_.contents[53], expected 67, is " << last_msg_.contents[53]; - EXPECT_EQ(last_msg_.contents[54], 94) << "incorrect value for last_msg_.contents[54], expected 94, is " << last_msg_.contents[54]; - EXPECT_EQ(last_msg_.contents[55], 250) << "incorrect value for last_msg_.contents[55], expected 250, is " << last_msg_.contents[55]; - EXPECT_EQ(last_msg_.contents[56], 109) << "incorrect value for last_msg_.contents[56], expected 109, is " << last_msg_.contents[56]; - EXPECT_EQ(last_msg_.contents[57], 152) << "incorrect value for last_msg_.contents[57], expected 152, is " << last_msg_.contents[57]; - EXPECT_EQ(last_msg_.contents[58], 95) << "incorrect value for last_msg_.contents[58], expected 95, is " << last_msg_.contents[58]; - EXPECT_EQ(last_msg_.contents[59], 123) << "incorrect value for last_msg_.contents[59], expected 123, is " << last_msg_.contents[59]; - EXPECT_EQ(last_msg_.contents[60], 77) << "incorrect value for last_msg_.contents[60], expected 77, is " << last_msg_.contents[60]; - EXPECT_EQ(last_msg_.contents[61], 224) << "incorrect value for last_msg_.contents[61], expected 224, is " << last_msg_.contents[61]; - EXPECT_EQ(last_msg_.contents[62], 124) << "incorrect value for last_msg_.contents[62], expected 124, is " << last_msg_.contents[62]; - EXPECT_EQ(last_msg_.contents[63], 238) << "incorrect value for last_msg_.contents[63], expected 238, is " << last_msg_.contents[63]; - EXPECT_EQ(last_msg_.contents[64], 205) << "incorrect value for last_msg_.contents[64], expected 205, is " << last_msg_.contents[64]; - EXPECT_EQ(last_msg_.contents[65], 65) << "incorrect value for last_msg_.contents[65], expected 65, is " << last_msg_.contents[65]; - EXPECT_EQ(last_msg_.contents[66], 103) << "incorrect value for last_msg_.contents[66], expected 103, is " << last_msg_.contents[66]; - EXPECT_EQ(last_msg_.contents[67], 35) << "incorrect value for last_msg_.contents[67], expected 35, is " << last_msg_.contents[67]; - EXPECT_EQ(last_msg_.contents[68], 104) << "incorrect value for last_msg_.contents[68], expected 104, is " << last_msg_.contents[68]; - EXPECT_EQ(last_msg_.contents[69], 209) << "incorrect value for last_msg_.contents[69], expected 209, is " << last_msg_.contents[69]; - EXPECT_EQ(last_msg_.contents[70], 5) << "incorrect value for last_msg_.contents[70], expected 5, is " << last_msg_.contents[70]; - EXPECT_EQ(last_msg_.contents[71], 191) << "incorrect value for last_msg_.contents[71], expected 191, is " << last_msg_.contents[71]; - EXPECT_EQ(last_msg_.contents[72], 47) << "incorrect value for last_msg_.contents[72], expected 47, is " << last_msg_.contents[72]; - EXPECT_EQ(last_msg_.contents[73], 249) << "incorrect value for last_msg_.contents[73], expected 249, is " << last_msg_.contents[73]; - EXPECT_EQ(last_msg_.contents[74], 176) << "incorrect value for last_msg_.contents[74], expected 176, is " << last_msg_.contents[74]; - EXPECT_EQ(last_msg_.contents[75], 166) << "incorrect value for last_msg_.contents[75], expected 166, is " << last_msg_.contents[75]; - EXPECT_EQ(last_msg_.contents[76], 213) << "incorrect value for last_msg_.contents[76], expected 213, is " << last_msg_.contents[76]; - EXPECT_EQ(last_msg_.contents[77], 46) << "incorrect value for last_msg_.contents[77], expected 46, is " << last_msg_.contents[77]; - EXPECT_EQ(last_msg_.contents[78], 192) << "incorrect value for last_msg_.contents[78], expected 192, is " << last_msg_.contents[78]; - EXPECT_EQ(last_msg_.contents[79], 86) << "incorrect value for last_msg_.contents[79], expected 86, is " << last_msg_.contents[79]; - EXPECT_EQ(last_msg_.contents[80], 32) << "incorrect value for last_msg_.contents[80], expected 32, is " << last_msg_.contents[80]; - EXPECT_EQ(last_msg_.contents[81], 103) << "incorrect value for last_msg_.contents[81], expected 103, is " << last_msg_.contents[81]; - EXPECT_EQ(last_msg_.contents[82], 146) << "incorrect value for last_msg_.contents[82], expected 146, is " << last_msg_.contents[82]; - EXPECT_EQ(last_msg_.contents[83], 252) << "incorrect value for last_msg_.contents[83], expected 252, is " << last_msg_.contents[83]; - EXPECT_EQ(last_msg_.contents[84], 4) << "incorrect value for last_msg_.contents[84], expected 4, is " << last_msg_.contents[84]; - EXPECT_EQ(last_msg_.contents[85], 16) << "incorrect value for last_msg_.contents[85], expected 16, is " << last_msg_.contents[85]; - EXPECT_EQ(last_msg_.contents[86], 54) << "incorrect value for last_msg_.contents[86], expected 54, is " << last_msg_.contents[86]; - EXPECT_EQ(last_msg_.contents[87], 161) << "incorrect value for last_msg_.contents[87], expected 161, is " << last_msg_.contents[87]; - EXPECT_EQ(last_msg_.contents[88], 60) << "incorrect value for last_msg_.contents[88], expected 60, is " << last_msg_.contents[88]; - EXPECT_EQ(last_msg_.contents[89], 6) << "incorrect value for last_msg_.contents[89], expected 6, is " << last_msg_.contents[89]; - EXPECT_EQ(last_msg_.contents[90], 13) << "incorrect value for last_msg_.contents[90], expected 13, is " << last_msg_.contents[90]; - EXPECT_EQ(last_msg_.contents[91], 191) << "incorrect value for last_msg_.contents[91], expected 191, is " << last_msg_.contents[91]; - EXPECT_EQ(last_msg_.contents[92], 116) << "incorrect value for last_msg_.contents[92], expected 116, is " << last_msg_.contents[92]; - EXPECT_EQ(last_msg_.contents[93], 182) << "incorrect value for last_msg_.contents[93], expected 182, is " << last_msg_.contents[93]; - EXPECT_EQ(last_msg_.contents[94], 42) << "incorrect value for last_msg_.contents[94], expected 42, is " << last_msg_.contents[94]; - EXPECT_EQ(last_msg_.contents[95], 191) << "incorrect value for last_msg_.contents[95], expected 191, is " << last_msg_.contents[95]; - EXPECT_EQ(last_msg_.contents[96], 213) << "incorrect value for last_msg_.contents[96], expected 213, is " << last_msg_.contents[96]; - EXPECT_EQ(last_msg_.contents[97], 20) << "incorrect value for last_msg_.contents[97], expected 20, is " << last_msg_.contents[97]; - EXPECT_EQ(last_msg_.contents[98], 217) << "incorrect value for last_msg_.contents[98], expected 217, is " << last_msg_.contents[98]; - EXPECT_EQ(last_msg_.contents[99], 8) << "incorrect value for last_msg_.contents[99], expected 8, is " << last_msg_.contents[99]; - EXPECT_EQ(last_msg_.contents[100], 142) << "incorrect value for last_msg_.contents[100], expected 142, is " << last_msg_.contents[100]; - EXPECT_EQ(last_msg_.contents[101], 187) << "incorrect value for last_msg_.contents[101], expected 187, is " << last_msg_.contents[101]; - EXPECT_EQ(last_msg_.contents[102], 238) << "incorrect value for last_msg_.contents[102], expected 238, is " << last_msg_.contents[102]; - EXPECT_EQ(last_msg_.contents[103], 120) << "incorrect value for last_msg_.contents[103], expected 120, is " << last_msg_.contents[103]; - EXPECT_EQ(last_msg_.contents[104], 184) << "incorrect value for last_msg_.contents[104], expected 184, is " << last_msg_.contents[104]; - EXPECT_EQ(last_msg_.contents[105], 250) << "incorrect value for last_msg_.contents[105], expected 250, is " << last_msg_.contents[105]; - EXPECT_EQ(last_msg_.contents[106], 31) << "incorrect value for last_msg_.contents[106], expected 31, is " << last_msg_.contents[106]; - EXPECT_EQ(last_msg_.contents[107], 151) << "incorrect value for last_msg_.contents[107], expected 151, is " << last_msg_.contents[107]; - EXPECT_EQ(last_msg_.contents[108], 37) << "incorrect value for last_msg_.contents[108], expected 37, is " << last_msg_.contents[108]; - EXPECT_EQ(last_msg_.contents[109], 51) << "incorrect value for last_msg_.contents[109], expected 51, is " << last_msg_.contents[109]; - EXPECT_EQ(last_msg_.contents[110], 177) << "incorrect value for last_msg_.contents[110], expected 177, is " << last_msg_.contents[110]; - EXPECT_EQ(last_msg_.contents[111], 130) << "incorrect value for last_msg_.contents[111], expected 130, is " << last_msg_.contents[111]; - EXPECT_EQ(last_msg_.contents[112], 190) << "incorrect value for last_msg_.contents[112], expected 190, is " << last_msg_.contents[112]; - EXPECT_EQ(last_msg_.contents[113], 155) << "incorrect value for last_msg_.contents[113], expected 155, is " << last_msg_.contents[113]; - EXPECT_EQ(last_msg_.contents[114], 71) << "incorrect value for last_msg_.contents[114], expected 71, is " << last_msg_.contents[114]; - EXPECT_EQ(last_msg_.contents[115], 68) << "incorrect value for last_msg_.contents[115], expected 68, is " << last_msg_.contents[115]; - EXPECT_EQ(last_msg_.contents[116], 56) << "incorrect value for last_msg_.contents[116], expected 56, is " << last_msg_.contents[116]; - EXPECT_EQ(last_msg_.contents[117], 238) << "incorrect value for last_msg_.contents[117], expected 238, is " << last_msg_.contents[117]; - EXPECT_EQ(last_msg_.contents[118], 92) << "incorrect value for last_msg_.contents[118], expected 92, is " << last_msg_.contents[118]; - EXPECT_EQ(last_msg_.contents[119], 130) << "incorrect value for last_msg_.contents[119], expected 130, is " << last_msg_.contents[119]; - EXPECT_EQ(last_msg_.contents[120], 37) << "incorrect value for last_msg_.contents[120], expected 37, is " << last_msg_.contents[120]; - EXPECT_EQ(last_msg_.contents[121], 137) << "incorrect value for last_msg_.contents[121], expected 137, is " << last_msg_.contents[121]; - EXPECT_EQ(last_msg_.contents[122], 146) << "incorrect value for last_msg_.contents[122], expected 146, is " << last_msg_.contents[122]; - EXPECT_EQ(last_msg_.contents[123], 246) << "incorrect value for last_msg_.contents[123], expected 246, is " << last_msg_.contents[123]; - EXPECT_EQ(last_msg_.contents[124], 114) << "incorrect value for last_msg_.contents[124], expected 114, is " << last_msg_.contents[124]; - EXPECT_EQ(last_msg_.contents[125], 116) << "incorrect value for last_msg_.contents[125], expected 116, is " << last_msg_.contents[125]; - EXPECT_EQ(last_msg_.contents[126], 138) << "incorrect value for last_msg_.contents[126], expected 138, is " << last_msg_.contents[126]; - EXPECT_EQ(last_msg_.contents[127], 165) << "incorrect value for last_msg_.contents[127], expected 165, is " << last_msg_.contents[127]; - EXPECT_EQ(last_msg_.contents[128], 217) << "incorrect value for last_msg_.contents[128], expected 217, is " << last_msg_.contents[128]; - EXPECT_EQ(last_msg_.contents[129], 79) << "incorrect value for last_msg_.contents[129], expected 79, is " << last_msg_.contents[129]; - EXPECT_EQ(last_msg_.contents[130], 10) << "incorrect value for last_msg_.contents[130], expected 10, is " << last_msg_.contents[130]; - EXPECT_EQ(last_msg_.contents[131], 189) << "incorrect value for last_msg_.contents[131], expected 189, is " << last_msg_.contents[131]; - EXPECT_EQ(last_msg_.contents[132], 128) << "incorrect value for last_msg_.contents[132], expected 128, is " << last_msg_.contents[132]; - EXPECT_EQ(last_msg_.contents[133], 189) << "incorrect value for last_msg_.contents[133], expected 189, is " << last_msg_.contents[133]; - EXPECT_EQ(last_msg_.contents[134], 2) << "incorrect value for last_msg_.contents[134], expected 2, is " << last_msg_.contents[134]; - EXPECT_EQ(last_msg_.contents[135], 240) << "incorrect value for last_msg_.contents[135], expected 240, is " << last_msg_.contents[135]; - EXPECT_EQ(last_msg_.contents[136], 92) << "incorrect value for last_msg_.contents[136], expected 92, is " << last_msg_.contents[136]; - EXPECT_EQ(last_msg_.contents[137], 28) << "incorrect value for last_msg_.contents[137], expected 28, is " << last_msg_.contents[137]; - EXPECT_EQ(last_msg_.contents[138], 126) << "incorrect value for last_msg_.contents[138], expected 126, is " << last_msg_.contents[138]; - EXPECT_EQ(last_msg_.contents[139], 105) << "incorrect value for last_msg_.contents[139], expected 105, is " << last_msg_.contents[139]; - EXPECT_EQ(last_msg_.contents[140], 236) << "incorrect value for last_msg_.contents[140], expected 236, is " << last_msg_.contents[140]; - EXPECT_EQ(last_msg_.contents[141], 228) << "incorrect value for last_msg_.contents[141], expected 228, is " << last_msg_.contents[141]; - EXPECT_EQ(last_msg_.contents[142], 194) << "incorrect value for last_msg_.contents[142], expected 194, is " << last_msg_.contents[142]; - EXPECT_EQ(last_msg_.contents[143], 0) << "incorrect value for last_msg_.contents[143], expected 0, is " << last_msg_.contents[143]; - EXPECT_EQ(last_msg_.contents[144], 51) << "incorrect value for last_msg_.contents[144], expected 51, is " << last_msg_.contents[144]; - EXPECT_EQ(last_msg_.contents[145], 61) << "incorrect value for last_msg_.contents[145], expected 61, is " << last_msg_.contents[145]; - EXPECT_EQ(last_msg_.contents[146], 74) << "incorrect value for last_msg_.contents[146], expected 74, is " << last_msg_.contents[146]; - EXPECT_EQ(last_msg_.contents[147], 41) << "incorrect value for last_msg_.contents[147], expected 41, is " << last_msg_.contents[147]; - EXPECT_EQ(last_msg_.contents[148], 10) << "incorrect value for last_msg_.contents[148], expected 10, is " << last_msg_.contents[148]; - EXPECT_EQ(last_msg_.contents[149], 239) << "incorrect value for last_msg_.contents[149], expected 239, is " << last_msg_.contents[149]; - EXPECT_EQ(last_msg_.contents[150], 133) << "incorrect value for last_msg_.contents[150], expected 133, is " << last_msg_.contents[150]; - EXPECT_EQ(last_msg_.contents[151], 106) << "incorrect value for last_msg_.contents[151], expected 106, is " << last_msg_.contents[151]; - EXPECT_EQ(last_msg_.contents[152], 190) << "incorrect value for last_msg_.contents[152], expected 190, is " << last_msg_.contents[152]; - EXPECT_EQ(last_msg_.contents[153], 30) << "incorrect value for last_msg_.contents[153], expected 30, is " << last_msg_.contents[153]; - EXPECT_EQ(last_msg_.contents[154], 27) << "incorrect value for last_msg_.contents[154], expected 27, is " << last_msg_.contents[154]; - EXPECT_EQ(last_msg_.contents[155], 3) << "incorrect value for last_msg_.contents[155], expected 3, is " << last_msg_.contents[155]; - EXPECT_EQ(last_msg_.contents[156], 240) << "incorrect value for last_msg_.contents[156], expected 240, is " << last_msg_.contents[156]; - EXPECT_EQ(last_msg_.contents[157], 205) << "incorrect value for last_msg_.contents[157], expected 205, is " << last_msg_.contents[157]; - EXPECT_EQ(last_msg_.contents[158], 253) << "incorrect value for last_msg_.contents[158], expected 253, is " << last_msg_.contents[158]; - EXPECT_EQ(last_msg_.contents[159], 113) << "incorrect value for last_msg_.contents[159], expected 113, is " << last_msg_.contents[159]; - EXPECT_EQ(last_msg_.contents[160], 25) << "incorrect value for last_msg_.contents[160], expected 25, is " << last_msg_.contents[160]; - EXPECT_EQ(last_msg_.contents[161], 28) << "incorrect value for last_msg_.contents[161], expected 28, is " << last_msg_.contents[161]; - EXPECT_EQ(last_msg_.contents[162], 187) << "incorrect value for last_msg_.contents[162], expected 187, is " << last_msg_.contents[162]; - EXPECT_EQ(last_msg_.contents[163], 81) << "incorrect value for last_msg_.contents[163], expected 81, is " << last_msg_.contents[163]; - EXPECT_EQ(last_msg_.contents[164], 101) << "incorrect value for last_msg_.contents[164], expected 101, is " << last_msg_.contents[164]; - EXPECT_EQ(last_msg_.contents[165], 216) << "incorrect value for last_msg_.contents[165], expected 216, is " << last_msg_.contents[165]; - EXPECT_EQ(last_msg_.contents[166], 121) << "incorrect value for last_msg_.contents[166], expected 121, is " << last_msg_.contents[166]; - EXPECT_EQ(last_msg_.contents[167], 41) << "incorrect value for last_msg_.contents[167], expected 41, is " << last_msg_.contents[167]; - EXPECT_EQ(last_msg_.contents[168], 179) << "incorrect value for last_msg_.contents[168], expected 179, is " << last_msg_.contents[168]; - EXPECT_EQ(last_msg_.contents[169], 120) << "incorrect value for last_msg_.contents[169], expected 120, is " << last_msg_.contents[169]; - EXPECT_EQ(last_msg_.contents[170], 152) << "incorrect value for last_msg_.contents[170], expected 152, is " << last_msg_.contents[170]; - EXPECT_EQ(last_msg_.contents[171], 18) << "incorrect value for last_msg_.contents[171], expected 18, is " << last_msg_.contents[171]; - EXPECT_EQ(last_msg_.contents[172], 116) << "incorrect value for last_msg_.contents[172], expected 116, is " << last_msg_.contents[172]; - EXPECT_EQ(last_msg_.contents[173], 53) << "incorrect value for last_msg_.contents[173], expected 53, is " << last_msg_.contents[173]; - EXPECT_EQ(last_msg_.contents[174], 212) << "incorrect value for last_msg_.contents[174], expected 212, is " << last_msg_.contents[174]; - EXPECT_EQ(last_msg_.contents[175], 100) << "incorrect value for last_msg_.contents[175], expected 100, is " << last_msg_.contents[175]; - EXPECT_EQ(last_msg_.contents[176], 2) << "incorrect value for last_msg_.contents[176], expected 2, is " << last_msg_.contents[176]; - EXPECT_EQ(last_msg_.contents[177], 114) << "incorrect value for last_msg_.contents[177], expected 114, is " << last_msg_.contents[177]; - EXPECT_EQ(last_msg_.contents[178], 198) << "incorrect value for last_msg_.contents[178], expected 198, is " << last_msg_.contents[178]; - EXPECT_EQ(last_msg_.contents[179], 200) << "incorrect value for last_msg_.contents[179], expected 200, is " << last_msg_.contents[179]; - EXPECT_EQ(last_msg_.contents[180], 10) << "incorrect value for last_msg_.contents[180], expected 10, is " << last_msg_.contents[180]; - EXPECT_EQ(last_msg_.contents[181], 147) << "incorrect value for last_msg_.contents[181], expected 147, is " << last_msg_.contents[181]; - EXPECT_EQ(last_msg_.contents[182], 25) << "incorrect value for last_msg_.contents[182], expected 25, is " << last_msg_.contents[182]; - EXPECT_EQ(last_msg_.contents[183], 33) << "incorrect value for last_msg_.contents[183], expected 33, is " << last_msg_.contents[183]; - EXPECT_EQ(last_msg_.contents[184], 115) << "incorrect value for last_msg_.contents[184], expected 115, is " << last_msg_.contents[184]; - EXPECT_EQ(last_msg_.contents[185], 208) << "incorrect value for last_msg_.contents[185], expected 208, is " << last_msg_.contents[185]; - EXPECT_EQ(last_msg_.contents[186], 113) << "incorrect value for last_msg_.contents[186], expected 113, is " << last_msg_.contents[186]; - EXPECT_EQ(last_msg_.contents[187], 60) << "incorrect value for last_msg_.contents[187], expected 60, is " << last_msg_.contents[187]; - EXPECT_EQ(last_msg_.contents[188], 179) << "incorrect value for last_msg_.contents[188], expected 179, is " << last_msg_.contents[188]; - EXPECT_EQ(last_msg_.contents[189], 183) << "incorrect value for last_msg_.contents[189], expected 183, is " << last_msg_.contents[189]; - EXPECT_EQ(last_msg_.contents[190], 0) << "incorrect value for last_msg_.contents[190], expected 0, is " << last_msg_.contents[190]; - EXPECT_EQ(last_msg_.contents[191], 41) << "incorrect value for last_msg_.contents[191], expected 41, is " << last_msg_.contents[191]; - EXPECT_EQ(last_msg_.contents[192], 217) << "incorrect value for last_msg_.contents[192], expected 217, is " << last_msg_.contents[192]; - EXPECT_EQ(last_msg_.contents[193], 206) << "incorrect value for last_msg_.contents[193], expected 206, is " << last_msg_.contents[193]; - EXPECT_EQ(last_msg_.contents[194], 255) << "incorrect value for last_msg_.contents[194], expected 255, is " << last_msg_.contents[194]; - EXPECT_EQ(last_msg_.contents[195], 211) << "incorrect value for last_msg_.contents[195], expected 211, is " << last_msg_.contents[195]; - EXPECT_EQ(last_msg_.contents[196], 225) << "incorrect value for last_msg_.contents[196], expected 225, is " << last_msg_.contents[196]; - EXPECT_EQ(last_msg_.contents[197], 142) << "incorrect value for last_msg_.contents[197], expected 142, is " << last_msg_.contents[197]; - EXPECT_EQ(last_msg_.contents[198], 191) << "incorrect value for last_msg_.contents[198], expected 191, is " << last_msg_.contents[198]; - EXPECT_EQ(last_msg_.contents[199], 133) << "incorrect value for last_msg_.contents[199], expected 133, is " << last_msg_.contents[199]; - EXPECT_EQ(last_msg_.contents[200], 81) << "incorrect value for last_msg_.contents[200], expected 81, is " << last_msg_.contents[200]; - EXPECT_EQ(last_msg_.contents[201], 15) << "incorrect value for last_msg_.contents[201], expected 15, is " << last_msg_.contents[201]; - EXPECT_EQ(last_msg_.contents[202], 248) << "incorrect value for last_msg_.contents[202], expected 248, is " << last_msg_.contents[202]; - EXPECT_EQ(last_msg_.contents[203], 193) << "incorrect value for last_msg_.contents[203], expected 193, is " << last_msg_.contents[203]; - EXPECT_EQ(last_msg_.contents[204], 66) << "incorrect value for last_msg_.contents[204], expected 66, is " << last_msg_.contents[204]; - EXPECT_EQ(last_msg_.contents[205], 191) << "incorrect value for last_msg_.contents[205], expected 191, is " << last_msg_.contents[205]; - EXPECT_EQ(last_msg_.contents[206], 244) << "incorrect value for last_msg_.contents[206], expected 244, is " << last_msg_.contents[206]; - EXPECT_EQ(last_msg_.contents[207], 221) << "incorrect value for last_msg_.contents[207], expected 221, is " << last_msg_.contents[207]; - EXPECT_EQ(last_msg_.contents[208], 248) << "incorrect value for last_msg_.contents[208], expected 248, is " << last_msg_.contents[208]; - EXPECT_EQ(last_msg_.contents[209], 199) << "incorrect value for last_msg_.contents[209], expected 199, is " << last_msg_.contents[209]; - EXPECT_EQ(last_msg_.contents[210], 241) << "incorrect value for last_msg_.contents[210], expected 241, is " << last_msg_.contents[210]; - EXPECT_EQ(last_msg_.contents[211], 112) << "incorrect value for last_msg_.contents[211], expected 112, is " << last_msg_.contents[211]; - EXPECT_EQ(last_msg_.contents[212], 51) << "incorrect value for last_msg_.contents[212], expected 51, is " << last_msg_.contents[212]; - EXPECT_EQ(last_msg_.contents[213], 1) << "incorrect value for last_msg_.contents[213], expected 1, is " << last_msg_.contents[213]; - EXPECT_EQ(last_msg_.contents[214], 180) << "incorrect value for last_msg_.contents[214], expected 180, is " << last_msg_.contents[214]; - EXPECT_EQ(last_msg_.contents[215], 180) << "incorrect value for last_msg_.contents[215], expected 180, is " << last_msg_.contents[215]; - EXPECT_EQ(last_msg_.contents[216], 125) << "incorrect value for last_msg_.contents[216], expected 125, is " << last_msg_.contents[216]; - EXPECT_EQ(last_msg_.contents[217], 97) << "incorrect value for last_msg_.contents[217], expected 97, is " << last_msg_.contents[217]; - EXPECT_EQ(last_msg_.contents[218], 145) << "incorrect value for last_msg_.contents[218], expected 145, is " << last_msg_.contents[218]; - EXPECT_EQ(last_msg_.contents[219], 25) << "incorrect value for last_msg_.contents[219], expected 25, is " << last_msg_.contents[219]; - EXPECT_EQ(last_msg_.contents[220], 72) << "incorrect value for last_msg_.contents[220], expected 72, is " << last_msg_.contents[220]; - EXPECT_EQ(last_msg_.contents[221], 210) << "incorrect value for last_msg_.contents[221], expected 210, is " << last_msg_.contents[221]; - EXPECT_EQ(last_msg_.contents[222], 215) << "incorrect value for last_msg_.contents[222], expected 215, is " << last_msg_.contents[222]; - EXPECT_EQ(last_msg_.contents[223], 208) << "incorrect value for last_msg_.contents[223], expected 208, is " << last_msg_.contents[223]; - EXPECT_EQ(last_msg_.contents[224], 15) << "incorrect value for last_msg_.contents[224], expected 15, is " << last_msg_.contents[224]; - EXPECT_EQ(last_msg_.contents[225], 126) << "incorrect value for last_msg_.contents[225], expected 126, is " << last_msg_.contents[225]; - EXPECT_EQ(last_msg_.contents[226], 56) << "incorrect value for last_msg_.contents[226], expected 56, is " << last_msg_.contents[226]; - EXPECT_EQ(last_msg_.contents[227], 38) << "incorrect value for last_msg_.contents[227], expected 38, is " << last_msg_.contents[227]; - EXPECT_EQ(last_msg_.contents[228], 65) << "incorrect value for last_msg_.contents[228], expected 65, is " << last_msg_.contents[228]; - EXPECT_EQ(last_msg_.contents[229], 4) << "incorrect value for last_msg_.contents[229], expected 4, is " << last_msg_.contents[229]; - EXPECT_EQ(last_msg_.contents[230], 64) << "incorrect value for last_msg_.contents[230], expected 64, is " << last_msg_.contents[230]; - EXPECT_EQ(last_msg_.contents[231], 19) << "incorrect value for last_msg_.contents[231], expected 19, is " << last_msg_.contents[231]; - EXPECT_EQ(last_msg_.contents[232], 74) << "incorrect value for last_msg_.contents[232], expected 74, is " << last_msg_.contents[232]; - EXPECT_EQ(last_msg_.contents[233], 223) << "incorrect value for last_msg_.contents[233], expected 223, is " << last_msg_.contents[233]; - EXPECT_EQ(last_msg_.contents[234], 111) << "incorrect value for last_msg_.contents[234], expected 111, is " << last_msg_.contents[234]; - EXPECT_EQ(last_msg_.contents[235], 109) << "incorrect value for last_msg_.contents[235], expected 109, is " << last_msg_.contents[235]; - EXPECT_EQ(last_msg_.contents[236], 52) << "incorrect value for last_msg_.contents[236], expected 52, is " << last_msg_.contents[236]; - EXPECT_EQ(last_msg_.contents[237], 43) << "incorrect value for last_msg_.contents[237], expected 43, is " << last_msg_.contents[237]; - EXPECT_EQ(last_msg_.contents[238], 167) << "incorrect value for last_msg_.contents[238], expected 167, is " << last_msg_.contents[238]; - EXPECT_EQ(last_msg_.contents[239], 186) << "incorrect value for last_msg_.contents[239], expected 186, is " << last_msg_.contents[239]; - EXPECT_EQ(last_msg_.contents[240], 202) << "incorrect value for last_msg_.contents[240], expected 202, is " << last_msg_.contents[240]; - EXPECT_EQ(last_msg_.contents[241], 111) << "incorrect value for last_msg_.contents[241], expected 111, is " << last_msg_.contents[241]; - EXPECT_EQ(last_msg_.contents[242], 11) << "incorrect value for last_msg_.contents[242], expected 11, is " << last_msg_.contents[242]; - EXPECT_EQ(last_msg_.contents[243], 91) << "incorrect value for last_msg_.contents[243], expected 91, is " << last_msg_.contents[243]; - EXPECT_EQ(last_msg_.contents[244], 21) << "incorrect value for last_msg_.contents[244], expected 21, is " << last_msg_.contents[244]; - EXPECT_EQ(last_msg_.contents[245], 236) << "incorrect value for last_msg_.contents[245], expected 236, is " << last_msg_.contents[245]; - EXPECT_EQ(last_msg_.contents[246], 234) << "incorrect value for last_msg_.contents[246], expected 234, is " << last_msg_.contents[246]; - EXPECT_EQ(last_msg_.contents[247], 196) << "incorrect value for last_msg_.contents[247], expected 196, is " << last_msg_.contents[247]; - EXPECT_EQ(last_msg_.contents[248], 36) << "incorrect value for last_msg_.contents[248], expected 36, is " << last_msg_.contents[248]; - EXPECT_EQ(last_msg_.contents[249], 171) << "incorrect value for last_msg_.contents[249], expected 171, is " << last_msg_.contents[249]; - EXPECT_EQ(last_msg_.contents[250], 147) << "incorrect value for last_msg_.contents[250], expected 147, is " << last_msg_.contents[250]; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_contents.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_contents.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_contents.handle_as << "'"; - } - { - const char check_string[] = { (char)99,(char)111,(char)110,(char)116,(char)101,(char)110,(char)116,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_contents.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_contents.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_contents.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_contents.value, 251) << "incorrect value for last_msg_.n_contents.value, expected 251, is " << last_msg_.n_contents.value; - EXPECT_EQ(last_msg_.sequence, 259241795) << "incorrect value for last_msg_.sequence, expected 259241795, is " << last_msg_.sequence; +}; + +TEST_F(Test_auto_check_sbp_file_io_MsgFileioReadResp0, Test) { + uint8_t encoded_frame[] = { + 85, 163, 0, 195, 4, 255, 67, 183, 115, 15, 73, 231, 227, 179, 18, + 76, 68, 229, 216, 21, 98, 183, 69, 190, 5, 252, 176, 55, 32, 78, + 8, 52, 127, 50, 71, 106, 61, 79, 191, 106, 46, 79, 118, 248, 118, + 207, 206, 210, 91, 73, 251, 81, 131, 205, 193, 146, 206, 185, 140, 249, + 163, 231, 65, 67, 94, 250, 109, 152, 95, 123, 77, 224, 124, 238, 205, + 65, 103, 35, 104, 209, 5, 191, 47, 249, 176, 166, 213, 46, 192, 86, + 32, 103, 146, 252, 4, 16, 54, 161, 60, 6, 13, 191, 116, 182, 42, + 191, 213, 20, 217, 8, 142, 187, 238, 120, 184, 250, 31, 151, 37, 51, + 177, 130, 190, 155, 71, 68, 56, 238, 92, 130, 37, 137, 146, 246, 114, + 116, 138, 165, 217, 79, 10, 189, 128, 189, 2, 240, 92, 28, 126, 105, + 236, 228, 194, 0, 51, 61, 74, 41, 10, 239, 133, 106, 190, 30, 27, + 3, 240, 205, 253, 113, 25, 28, 187, 81, 101, 216, 121, 41, 179, 120, + 152, 18, 116, 53, 212, 100, 2, 114, 198, 200, 10, 147, 25, 33, 115, + 208, 113, 60, 179, 183, 0, 41, 217, 206, 255, 211, 225, 142, 191, 133, + 81, 15, 248, 193, 66, 191, 244, 221, 248, 199, 241, 112, 51, 1, 180, + 180, 125, 97, 145, 25, 72, 210, 215, 208, 15, 126, 56, 38, 65, 4, + 64, 19, 74, 223, 111, 109, 52, 43, 167, 186, 202, 111, 11, 91, 21, + 236, 234, 196, 36, 171, 147, 10, 240, + }; + + sbp_msg_fileio_read_resp_t test_msg{}; + + test_msg.contents[0] = 73; + + test_msg.contents[1] = 231; + + test_msg.contents[2] = 227; + + test_msg.contents[3] = 179; + + test_msg.contents[4] = 18; + + test_msg.contents[5] = 76; + + test_msg.contents[6] = 68; + + test_msg.contents[7] = 229; + + test_msg.contents[8] = 216; + + test_msg.contents[9] = 21; + + test_msg.contents[10] = 98; + + test_msg.contents[11] = 183; + + test_msg.contents[12] = 69; + + test_msg.contents[13] = 190; + + test_msg.contents[14] = 5; + + test_msg.contents[15] = 252; + + test_msg.contents[16] = 176; + + test_msg.contents[17] = 55; + + test_msg.contents[18] = 32; + + test_msg.contents[19] = 78; + + test_msg.contents[20] = 8; + + test_msg.contents[21] = 52; + + test_msg.contents[22] = 127; + + test_msg.contents[23] = 50; + + test_msg.contents[24] = 71; + + test_msg.contents[25] = 106; + + test_msg.contents[26] = 61; + + test_msg.contents[27] = 79; + + test_msg.contents[28] = 191; + + test_msg.contents[29] = 106; + + test_msg.contents[30] = 46; + + test_msg.contents[31] = 79; + + test_msg.contents[32] = 118; + + test_msg.contents[33] = 248; + + test_msg.contents[34] = 118; + + test_msg.contents[35] = 207; + + test_msg.contents[36] = 206; + + test_msg.contents[37] = 210; + + test_msg.contents[38] = 91; + + test_msg.contents[39] = 73; + + test_msg.contents[40] = 251; + + test_msg.contents[41] = 81; + + test_msg.contents[42] = 131; + + test_msg.contents[43] = 205; + + test_msg.contents[44] = 193; + + test_msg.contents[45] = 146; + + test_msg.contents[46] = 206; + + test_msg.contents[47] = 185; + + test_msg.contents[48] = 140; + + test_msg.contents[49] = 249; + + test_msg.contents[50] = 163; + + test_msg.contents[51] = 231; + + test_msg.contents[52] = 65; + + test_msg.contents[53] = 67; + + test_msg.contents[54] = 94; + + test_msg.contents[55] = 250; + + test_msg.contents[56] = 109; + + test_msg.contents[57] = 152; + + test_msg.contents[58] = 95; + + test_msg.contents[59] = 123; + + test_msg.contents[60] = 77; + + test_msg.contents[61] = 224; + + test_msg.contents[62] = 124; + + test_msg.contents[63] = 238; + + test_msg.contents[64] = 205; + + test_msg.contents[65] = 65; + + test_msg.contents[66] = 103; + + test_msg.contents[67] = 35; + + test_msg.contents[68] = 104; + + test_msg.contents[69] = 209; + + test_msg.contents[70] = 5; + + test_msg.contents[71] = 191; + + test_msg.contents[72] = 47; + + test_msg.contents[73] = 249; + + test_msg.contents[74] = 176; + + test_msg.contents[75] = 166; + + test_msg.contents[76] = 213; + + test_msg.contents[77] = 46; + + test_msg.contents[78] = 192; + + test_msg.contents[79] = 86; + + test_msg.contents[80] = 32; + + test_msg.contents[81] = 103; + + test_msg.contents[82] = 146; + + test_msg.contents[83] = 252; + + test_msg.contents[84] = 4; + + test_msg.contents[85] = 16; + + test_msg.contents[86] = 54; + + test_msg.contents[87] = 161; + + test_msg.contents[88] = 60; + + test_msg.contents[89] = 6; + + test_msg.contents[90] = 13; + + test_msg.contents[91] = 191; + + test_msg.contents[92] = 116; + + test_msg.contents[93] = 182; + + test_msg.contents[94] = 42; + + test_msg.contents[95] = 191; + + test_msg.contents[96] = 213; + + test_msg.contents[97] = 20; + + test_msg.contents[98] = 217; + + test_msg.contents[99] = 8; + + test_msg.contents[100] = 142; + + test_msg.contents[101] = 187; + + test_msg.contents[102] = 238; + + test_msg.contents[103] = 120; + + test_msg.contents[104] = 184; + + test_msg.contents[105] = 250; + + test_msg.contents[106] = 31; + + test_msg.contents[107] = 151; + + test_msg.contents[108] = 37; + + test_msg.contents[109] = 51; + + test_msg.contents[110] = 177; + + test_msg.contents[111] = 130; + + test_msg.contents[112] = 190; + + test_msg.contents[113] = 155; + + test_msg.contents[114] = 71; + + test_msg.contents[115] = 68; + + test_msg.contents[116] = 56; + + test_msg.contents[117] = 238; + + test_msg.contents[118] = 92; + + test_msg.contents[119] = 130; + + test_msg.contents[120] = 37; + + test_msg.contents[121] = 137; + + test_msg.contents[122] = 146; + + test_msg.contents[123] = 246; + + test_msg.contents[124] = 114; + + test_msg.contents[125] = 116; + + test_msg.contents[126] = 138; + + test_msg.contents[127] = 165; + + test_msg.contents[128] = 217; + + test_msg.contents[129] = 79; + + test_msg.contents[130] = 10; + + test_msg.contents[131] = 189; + + test_msg.contents[132] = 128; + + test_msg.contents[133] = 189; + + test_msg.contents[134] = 2; + + test_msg.contents[135] = 240; + + test_msg.contents[136] = 92; + + test_msg.contents[137] = 28; + + test_msg.contents[138] = 126; + + test_msg.contents[139] = 105; + + test_msg.contents[140] = 236; + + test_msg.contents[141] = 228; + + test_msg.contents[142] = 194; + + test_msg.contents[143] = 0; + + test_msg.contents[144] = 51; + + test_msg.contents[145] = 61; + + test_msg.contents[146] = 74; + + test_msg.contents[147] = 41; + + test_msg.contents[148] = 10; + + test_msg.contents[149] = 239; + + test_msg.contents[150] = 133; + + test_msg.contents[151] = 106; + + test_msg.contents[152] = 190; + + test_msg.contents[153] = 30; + + test_msg.contents[154] = 27; + + test_msg.contents[155] = 3; + + test_msg.contents[156] = 240; + + test_msg.contents[157] = 205; + + test_msg.contents[158] = 253; + + test_msg.contents[159] = 113; + + test_msg.contents[160] = 25; + + test_msg.contents[161] = 28; + + test_msg.contents[162] = 187; + + test_msg.contents[163] = 81; + + test_msg.contents[164] = 101; + + test_msg.contents[165] = 216; + + test_msg.contents[166] = 121; + + test_msg.contents[167] = 41; + + test_msg.contents[168] = 179; + + test_msg.contents[169] = 120; + + test_msg.contents[170] = 152; + + test_msg.contents[171] = 18; + + test_msg.contents[172] = 116; + + test_msg.contents[173] = 53; + + test_msg.contents[174] = 212; + + test_msg.contents[175] = 100; + + test_msg.contents[176] = 2; + + test_msg.contents[177] = 114; + + test_msg.contents[178] = 198; + + test_msg.contents[179] = 200; + + test_msg.contents[180] = 10; + + test_msg.contents[181] = 147; + + test_msg.contents[182] = 25; + + test_msg.contents[183] = 33; + + test_msg.contents[184] = 115; + + test_msg.contents[185] = 208; + + test_msg.contents[186] = 113; + + test_msg.contents[187] = 60; + + test_msg.contents[188] = 179; + + test_msg.contents[189] = 183; + + test_msg.contents[190] = 0; + + test_msg.contents[191] = 41; + + test_msg.contents[192] = 217; + + test_msg.contents[193] = 206; + + test_msg.contents[194] = 255; + + test_msg.contents[195] = 211; + + test_msg.contents[196] = 225; + + test_msg.contents[197] = 142; + + test_msg.contents[198] = 191; + + test_msg.contents[199] = 133; + + test_msg.contents[200] = 81; + + test_msg.contents[201] = 15; + + test_msg.contents[202] = 248; + + test_msg.contents[203] = 193; + + test_msg.contents[204] = 66; + + test_msg.contents[205] = 191; + + test_msg.contents[206] = 244; + + test_msg.contents[207] = 221; + + test_msg.contents[208] = 248; + + test_msg.contents[209] = 199; + + test_msg.contents[210] = 241; + + test_msg.contents[211] = 112; + + test_msg.contents[212] = 51; + + test_msg.contents[213] = 1; + + test_msg.contents[214] = 180; + + test_msg.contents[215] = 180; + + test_msg.contents[216] = 125; + + test_msg.contents[217] = 97; + + test_msg.contents[218] = 145; + + test_msg.contents[219] = 25; + + test_msg.contents[220] = 72; + + test_msg.contents[221] = 210; + + test_msg.contents[222] = 215; + + test_msg.contents[223] = 208; + + test_msg.contents[224] = 15; + + test_msg.contents[225] = 126; + + test_msg.contents[226] = 56; + + test_msg.contents[227] = 38; + + test_msg.contents[228] = 65; + + test_msg.contents[229] = 4; + + test_msg.contents[230] = 64; + + test_msg.contents[231] = 19; + + test_msg.contents[232] = 74; + + test_msg.contents[233] = 223; + + test_msg.contents[234] = 111; + + test_msg.contents[235] = 109; + + test_msg.contents[236] = 52; + + test_msg.contents[237] = 43; + + test_msg.contents[238] = 167; + + test_msg.contents[239] = 186; + + test_msg.contents[240] = 202; + + test_msg.contents[241] = 111; + + test_msg.contents[242] = 11; + + test_msg.contents[243] = 91; + + test_msg.contents[244] = 21; + + test_msg.contents[245] = 236; + + test_msg.contents[246] = 234; + + test_msg.contents[247] = 196; + + test_msg.contents[248] = 36; + + test_msg.contents[249] = 171; + + test_msg.contents[250] = 147; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_contents.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)99, (char)111, (char)110, (char)116, + (char)101, (char)110, (char)116, (char)115}; + memcpy(test_msg.n_contents.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_contents.value = 251; + test_msg.sequence = 259241795; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.contents[0], 73) + << "incorrect value for last_msg_.contents[0], expected 73, is " + << last_msg_.contents[0]; + EXPECT_EQ(last_msg_.contents[1], 231) + << "incorrect value for last_msg_.contents[1], expected 231, is " + << last_msg_.contents[1]; + EXPECT_EQ(last_msg_.contents[2], 227) + << "incorrect value for last_msg_.contents[2], expected 227, is " + << last_msg_.contents[2]; + EXPECT_EQ(last_msg_.contents[3], 179) + << "incorrect value for last_msg_.contents[3], expected 179, is " + << last_msg_.contents[3]; + EXPECT_EQ(last_msg_.contents[4], 18) + << "incorrect value for last_msg_.contents[4], expected 18, is " + << last_msg_.contents[4]; + EXPECT_EQ(last_msg_.contents[5], 76) + << "incorrect value for last_msg_.contents[5], expected 76, is " + << last_msg_.contents[5]; + EXPECT_EQ(last_msg_.contents[6], 68) + << "incorrect value for last_msg_.contents[6], expected 68, is " + << last_msg_.contents[6]; + EXPECT_EQ(last_msg_.contents[7], 229) + << "incorrect value for last_msg_.contents[7], expected 229, is " + << last_msg_.contents[7]; + EXPECT_EQ(last_msg_.contents[8], 216) + << "incorrect value for last_msg_.contents[8], expected 216, is " + << last_msg_.contents[8]; + EXPECT_EQ(last_msg_.contents[9], 21) + << "incorrect value for last_msg_.contents[9], expected 21, is " + << last_msg_.contents[9]; + EXPECT_EQ(last_msg_.contents[10], 98) + << "incorrect value for last_msg_.contents[10], expected 98, is " + << last_msg_.contents[10]; + EXPECT_EQ(last_msg_.contents[11], 183) + << "incorrect value for last_msg_.contents[11], expected 183, is " + << last_msg_.contents[11]; + EXPECT_EQ(last_msg_.contents[12], 69) + << "incorrect value for last_msg_.contents[12], expected 69, is " + << last_msg_.contents[12]; + EXPECT_EQ(last_msg_.contents[13], 190) + << "incorrect value for last_msg_.contents[13], expected 190, is " + << last_msg_.contents[13]; + EXPECT_EQ(last_msg_.contents[14], 5) + << "incorrect value for last_msg_.contents[14], expected 5, is " + << last_msg_.contents[14]; + EXPECT_EQ(last_msg_.contents[15], 252) + << "incorrect value for last_msg_.contents[15], expected 252, is " + << last_msg_.contents[15]; + EXPECT_EQ(last_msg_.contents[16], 176) + << "incorrect value for last_msg_.contents[16], expected 176, is " + << last_msg_.contents[16]; + EXPECT_EQ(last_msg_.contents[17], 55) + << "incorrect value for last_msg_.contents[17], expected 55, is " + << last_msg_.contents[17]; + EXPECT_EQ(last_msg_.contents[18], 32) + << "incorrect value for last_msg_.contents[18], expected 32, is " + << last_msg_.contents[18]; + EXPECT_EQ(last_msg_.contents[19], 78) + << "incorrect value for last_msg_.contents[19], expected 78, is " + << last_msg_.contents[19]; + EXPECT_EQ(last_msg_.contents[20], 8) + << "incorrect value for last_msg_.contents[20], expected 8, is " + << last_msg_.contents[20]; + EXPECT_EQ(last_msg_.contents[21], 52) + << "incorrect value for last_msg_.contents[21], expected 52, is " + << last_msg_.contents[21]; + EXPECT_EQ(last_msg_.contents[22], 127) + << "incorrect value for last_msg_.contents[22], expected 127, is " + << last_msg_.contents[22]; + EXPECT_EQ(last_msg_.contents[23], 50) + << "incorrect value for last_msg_.contents[23], expected 50, is " + << last_msg_.contents[23]; + EXPECT_EQ(last_msg_.contents[24], 71) + << "incorrect value for last_msg_.contents[24], expected 71, is " + << last_msg_.contents[24]; + EXPECT_EQ(last_msg_.contents[25], 106) + << "incorrect value for last_msg_.contents[25], expected 106, is " + << last_msg_.contents[25]; + EXPECT_EQ(last_msg_.contents[26], 61) + << "incorrect value for last_msg_.contents[26], expected 61, is " + << last_msg_.contents[26]; + EXPECT_EQ(last_msg_.contents[27], 79) + << "incorrect value for last_msg_.contents[27], expected 79, is " + << last_msg_.contents[27]; + EXPECT_EQ(last_msg_.contents[28], 191) + << "incorrect value for last_msg_.contents[28], expected 191, is " + << last_msg_.contents[28]; + EXPECT_EQ(last_msg_.contents[29], 106) + << "incorrect value for last_msg_.contents[29], expected 106, is " + << last_msg_.contents[29]; + EXPECT_EQ(last_msg_.contents[30], 46) + << "incorrect value for last_msg_.contents[30], expected 46, is " + << last_msg_.contents[30]; + EXPECT_EQ(last_msg_.contents[31], 79) + << "incorrect value for last_msg_.contents[31], expected 79, is " + << last_msg_.contents[31]; + EXPECT_EQ(last_msg_.contents[32], 118) + << "incorrect value for last_msg_.contents[32], expected 118, is " + << last_msg_.contents[32]; + EXPECT_EQ(last_msg_.contents[33], 248) + << "incorrect value for last_msg_.contents[33], expected 248, is " + << last_msg_.contents[33]; + EXPECT_EQ(last_msg_.contents[34], 118) + << "incorrect value for last_msg_.contents[34], expected 118, is " + << last_msg_.contents[34]; + EXPECT_EQ(last_msg_.contents[35], 207) + << "incorrect value for last_msg_.contents[35], expected 207, is " + << last_msg_.contents[35]; + EXPECT_EQ(last_msg_.contents[36], 206) + << "incorrect value for last_msg_.contents[36], expected 206, is " + << last_msg_.contents[36]; + EXPECT_EQ(last_msg_.contents[37], 210) + << "incorrect value for last_msg_.contents[37], expected 210, is " + << last_msg_.contents[37]; + EXPECT_EQ(last_msg_.contents[38], 91) + << "incorrect value for last_msg_.contents[38], expected 91, is " + << last_msg_.contents[38]; + EXPECT_EQ(last_msg_.contents[39], 73) + << "incorrect value for last_msg_.contents[39], expected 73, is " + << last_msg_.contents[39]; + EXPECT_EQ(last_msg_.contents[40], 251) + << "incorrect value for last_msg_.contents[40], expected 251, is " + << last_msg_.contents[40]; + EXPECT_EQ(last_msg_.contents[41], 81) + << "incorrect value for last_msg_.contents[41], expected 81, is " + << last_msg_.contents[41]; + EXPECT_EQ(last_msg_.contents[42], 131) + << "incorrect value for last_msg_.contents[42], expected 131, is " + << last_msg_.contents[42]; + EXPECT_EQ(last_msg_.contents[43], 205) + << "incorrect value for last_msg_.contents[43], expected 205, is " + << last_msg_.contents[43]; + EXPECT_EQ(last_msg_.contents[44], 193) + << "incorrect value for last_msg_.contents[44], expected 193, is " + << last_msg_.contents[44]; + EXPECT_EQ(last_msg_.contents[45], 146) + << "incorrect value for last_msg_.contents[45], expected 146, is " + << last_msg_.contents[45]; + EXPECT_EQ(last_msg_.contents[46], 206) + << "incorrect value for last_msg_.contents[46], expected 206, is " + << last_msg_.contents[46]; + EXPECT_EQ(last_msg_.contents[47], 185) + << "incorrect value for last_msg_.contents[47], expected 185, is " + << last_msg_.contents[47]; + EXPECT_EQ(last_msg_.contents[48], 140) + << "incorrect value for last_msg_.contents[48], expected 140, is " + << last_msg_.contents[48]; + EXPECT_EQ(last_msg_.contents[49], 249) + << "incorrect value for last_msg_.contents[49], expected 249, is " + << last_msg_.contents[49]; + EXPECT_EQ(last_msg_.contents[50], 163) + << "incorrect value for last_msg_.contents[50], expected 163, is " + << last_msg_.contents[50]; + EXPECT_EQ(last_msg_.contents[51], 231) + << "incorrect value for last_msg_.contents[51], expected 231, is " + << last_msg_.contents[51]; + EXPECT_EQ(last_msg_.contents[52], 65) + << "incorrect value for last_msg_.contents[52], expected 65, is " + << last_msg_.contents[52]; + EXPECT_EQ(last_msg_.contents[53], 67) + << "incorrect value for last_msg_.contents[53], expected 67, is " + << last_msg_.contents[53]; + EXPECT_EQ(last_msg_.contents[54], 94) + << "incorrect value for last_msg_.contents[54], expected 94, is " + << last_msg_.contents[54]; + EXPECT_EQ(last_msg_.contents[55], 250) + << "incorrect value for last_msg_.contents[55], expected 250, is " + << last_msg_.contents[55]; + EXPECT_EQ(last_msg_.contents[56], 109) + << "incorrect value for last_msg_.contents[56], expected 109, is " + << last_msg_.contents[56]; + EXPECT_EQ(last_msg_.contents[57], 152) + << "incorrect value for last_msg_.contents[57], expected 152, is " + << last_msg_.contents[57]; + EXPECT_EQ(last_msg_.contents[58], 95) + << "incorrect value for last_msg_.contents[58], expected 95, is " + << last_msg_.contents[58]; + EXPECT_EQ(last_msg_.contents[59], 123) + << "incorrect value for last_msg_.contents[59], expected 123, is " + << last_msg_.contents[59]; + EXPECT_EQ(last_msg_.contents[60], 77) + << "incorrect value for last_msg_.contents[60], expected 77, is " + << last_msg_.contents[60]; + EXPECT_EQ(last_msg_.contents[61], 224) + << "incorrect value for last_msg_.contents[61], expected 224, is " + << last_msg_.contents[61]; + EXPECT_EQ(last_msg_.contents[62], 124) + << "incorrect value for last_msg_.contents[62], expected 124, is " + << last_msg_.contents[62]; + EXPECT_EQ(last_msg_.contents[63], 238) + << "incorrect value for last_msg_.contents[63], expected 238, is " + << last_msg_.contents[63]; + EXPECT_EQ(last_msg_.contents[64], 205) + << "incorrect value for last_msg_.contents[64], expected 205, is " + << last_msg_.contents[64]; + EXPECT_EQ(last_msg_.contents[65], 65) + << "incorrect value for last_msg_.contents[65], expected 65, is " + << last_msg_.contents[65]; + EXPECT_EQ(last_msg_.contents[66], 103) + << "incorrect value for last_msg_.contents[66], expected 103, is " + << last_msg_.contents[66]; + EXPECT_EQ(last_msg_.contents[67], 35) + << "incorrect value for last_msg_.contents[67], expected 35, is " + << last_msg_.contents[67]; + EXPECT_EQ(last_msg_.contents[68], 104) + << "incorrect value for last_msg_.contents[68], expected 104, is " + << last_msg_.contents[68]; + EXPECT_EQ(last_msg_.contents[69], 209) + << "incorrect value for last_msg_.contents[69], expected 209, is " + << last_msg_.contents[69]; + EXPECT_EQ(last_msg_.contents[70], 5) + << "incorrect value for last_msg_.contents[70], expected 5, is " + << last_msg_.contents[70]; + EXPECT_EQ(last_msg_.contents[71], 191) + << "incorrect value for last_msg_.contents[71], expected 191, is " + << last_msg_.contents[71]; + EXPECT_EQ(last_msg_.contents[72], 47) + << "incorrect value for last_msg_.contents[72], expected 47, is " + << last_msg_.contents[72]; + EXPECT_EQ(last_msg_.contents[73], 249) + << "incorrect value for last_msg_.contents[73], expected 249, is " + << last_msg_.contents[73]; + EXPECT_EQ(last_msg_.contents[74], 176) + << "incorrect value for last_msg_.contents[74], expected 176, is " + << last_msg_.contents[74]; + EXPECT_EQ(last_msg_.contents[75], 166) + << "incorrect value for last_msg_.contents[75], expected 166, is " + << last_msg_.contents[75]; + EXPECT_EQ(last_msg_.contents[76], 213) + << "incorrect value for last_msg_.contents[76], expected 213, is " + << last_msg_.contents[76]; + EXPECT_EQ(last_msg_.contents[77], 46) + << "incorrect value for last_msg_.contents[77], expected 46, is " + << last_msg_.contents[77]; + EXPECT_EQ(last_msg_.contents[78], 192) + << "incorrect value for last_msg_.contents[78], expected 192, is " + << last_msg_.contents[78]; + EXPECT_EQ(last_msg_.contents[79], 86) + << "incorrect value for last_msg_.contents[79], expected 86, is " + << last_msg_.contents[79]; + EXPECT_EQ(last_msg_.contents[80], 32) + << "incorrect value for last_msg_.contents[80], expected 32, is " + << last_msg_.contents[80]; + EXPECT_EQ(last_msg_.contents[81], 103) + << "incorrect value for last_msg_.contents[81], expected 103, is " + << last_msg_.contents[81]; + EXPECT_EQ(last_msg_.contents[82], 146) + << "incorrect value for last_msg_.contents[82], expected 146, is " + << last_msg_.contents[82]; + EXPECT_EQ(last_msg_.contents[83], 252) + << "incorrect value for last_msg_.contents[83], expected 252, is " + << last_msg_.contents[83]; + EXPECT_EQ(last_msg_.contents[84], 4) + << "incorrect value for last_msg_.contents[84], expected 4, is " + << last_msg_.contents[84]; + EXPECT_EQ(last_msg_.contents[85], 16) + << "incorrect value for last_msg_.contents[85], expected 16, is " + << last_msg_.contents[85]; + EXPECT_EQ(last_msg_.contents[86], 54) + << "incorrect value for last_msg_.contents[86], expected 54, is " + << last_msg_.contents[86]; + EXPECT_EQ(last_msg_.contents[87], 161) + << "incorrect value for last_msg_.contents[87], expected 161, is " + << last_msg_.contents[87]; + EXPECT_EQ(last_msg_.contents[88], 60) + << "incorrect value for last_msg_.contents[88], expected 60, is " + << last_msg_.contents[88]; + EXPECT_EQ(last_msg_.contents[89], 6) + << "incorrect value for last_msg_.contents[89], expected 6, is " + << last_msg_.contents[89]; + EXPECT_EQ(last_msg_.contents[90], 13) + << "incorrect value for last_msg_.contents[90], expected 13, is " + << last_msg_.contents[90]; + EXPECT_EQ(last_msg_.contents[91], 191) + << "incorrect value for last_msg_.contents[91], expected 191, is " + << last_msg_.contents[91]; + EXPECT_EQ(last_msg_.contents[92], 116) + << "incorrect value for last_msg_.contents[92], expected 116, is " + << last_msg_.contents[92]; + EXPECT_EQ(last_msg_.contents[93], 182) + << "incorrect value for last_msg_.contents[93], expected 182, is " + << last_msg_.contents[93]; + EXPECT_EQ(last_msg_.contents[94], 42) + << "incorrect value for last_msg_.contents[94], expected 42, is " + << last_msg_.contents[94]; + EXPECT_EQ(last_msg_.contents[95], 191) + << "incorrect value for last_msg_.contents[95], expected 191, is " + << last_msg_.contents[95]; + EXPECT_EQ(last_msg_.contents[96], 213) + << "incorrect value for last_msg_.contents[96], expected 213, is " + << last_msg_.contents[96]; + EXPECT_EQ(last_msg_.contents[97], 20) + << "incorrect value for last_msg_.contents[97], expected 20, is " + << last_msg_.contents[97]; + EXPECT_EQ(last_msg_.contents[98], 217) + << "incorrect value for last_msg_.contents[98], expected 217, is " + << last_msg_.contents[98]; + EXPECT_EQ(last_msg_.contents[99], 8) + << "incorrect value for last_msg_.contents[99], expected 8, is " + << last_msg_.contents[99]; + EXPECT_EQ(last_msg_.contents[100], 142) + << "incorrect value for last_msg_.contents[100], expected 142, is " + << last_msg_.contents[100]; + EXPECT_EQ(last_msg_.contents[101], 187) + << "incorrect value for last_msg_.contents[101], expected 187, is " + << last_msg_.contents[101]; + EXPECT_EQ(last_msg_.contents[102], 238) + << "incorrect value for last_msg_.contents[102], expected 238, is " + << last_msg_.contents[102]; + EXPECT_EQ(last_msg_.contents[103], 120) + << "incorrect value for last_msg_.contents[103], expected 120, is " + << last_msg_.contents[103]; + EXPECT_EQ(last_msg_.contents[104], 184) + << "incorrect value for last_msg_.contents[104], expected 184, is " + << last_msg_.contents[104]; + EXPECT_EQ(last_msg_.contents[105], 250) + << "incorrect value for last_msg_.contents[105], expected 250, is " + << last_msg_.contents[105]; + EXPECT_EQ(last_msg_.contents[106], 31) + << "incorrect value for last_msg_.contents[106], expected 31, is " + << last_msg_.contents[106]; + EXPECT_EQ(last_msg_.contents[107], 151) + << "incorrect value for last_msg_.contents[107], expected 151, is " + << last_msg_.contents[107]; + EXPECT_EQ(last_msg_.contents[108], 37) + << "incorrect value for last_msg_.contents[108], expected 37, is " + << last_msg_.contents[108]; + EXPECT_EQ(last_msg_.contents[109], 51) + << "incorrect value for last_msg_.contents[109], expected 51, is " + << last_msg_.contents[109]; + EXPECT_EQ(last_msg_.contents[110], 177) + << "incorrect value for last_msg_.contents[110], expected 177, is " + << last_msg_.contents[110]; + EXPECT_EQ(last_msg_.contents[111], 130) + << "incorrect value for last_msg_.contents[111], expected 130, is " + << last_msg_.contents[111]; + EXPECT_EQ(last_msg_.contents[112], 190) + << "incorrect value for last_msg_.contents[112], expected 190, is " + << last_msg_.contents[112]; + EXPECT_EQ(last_msg_.contents[113], 155) + << "incorrect value for last_msg_.contents[113], expected 155, is " + << last_msg_.contents[113]; + EXPECT_EQ(last_msg_.contents[114], 71) + << "incorrect value for last_msg_.contents[114], expected 71, is " + << last_msg_.contents[114]; + EXPECT_EQ(last_msg_.contents[115], 68) + << "incorrect value for last_msg_.contents[115], expected 68, is " + << last_msg_.contents[115]; + EXPECT_EQ(last_msg_.contents[116], 56) + << "incorrect value for last_msg_.contents[116], expected 56, is " + << last_msg_.contents[116]; + EXPECT_EQ(last_msg_.contents[117], 238) + << "incorrect value for last_msg_.contents[117], expected 238, is " + << last_msg_.contents[117]; + EXPECT_EQ(last_msg_.contents[118], 92) + << "incorrect value for last_msg_.contents[118], expected 92, is " + << last_msg_.contents[118]; + EXPECT_EQ(last_msg_.contents[119], 130) + << "incorrect value for last_msg_.contents[119], expected 130, is " + << last_msg_.contents[119]; + EXPECT_EQ(last_msg_.contents[120], 37) + << "incorrect value for last_msg_.contents[120], expected 37, is " + << last_msg_.contents[120]; + EXPECT_EQ(last_msg_.contents[121], 137) + << "incorrect value for last_msg_.contents[121], expected 137, is " + << last_msg_.contents[121]; + EXPECT_EQ(last_msg_.contents[122], 146) + << "incorrect value for last_msg_.contents[122], expected 146, is " + << last_msg_.contents[122]; + EXPECT_EQ(last_msg_.contents[123], 246) + << "incorrect value for last_msg_.contents[123], expected 246, is " + << last_msg_.contents[123]; + EXPECT_EQ(last_msg_.contents[124], 114) + << "incorrect value for last_msg_.contents[124], expected 114, is " + << last_msg_.contents[124]; + EXPECT_EQ(last_msg_.contents[125], 116) + << "incorrect value for last_msg_.contents[125], expected 116, is " + << last_msg_.contents[125]; + EXPECT_EQ(last_msg_.contents[126], 138) + << "incorrect value for last_msg_.contents[126], expected 138, is " + << last_msg_.contents[126]; + EXPECT_EQ(last_msg_.contents[127], 165) + << "incorrect value for last_msg_.contents[127], expected 165, is " + << last_msg_.contents[127]; + EXPECT_EQ(last_msg_.contents[128], 217) + << "incorrect value for last_msg_.contents[128], expected 217, is " + << last_msg_.contents[128]; + EXPECT_EQ(last_msg_.contents[129], 79) + << "incorrect value for last_msg_.contents[129], expected 79, is " + << last_msg_.contents[129]; + EXPECT_EQ(last_msg_.contents[130], 10) + << "incorrect value for last_msg_.contents[130], expected 10, is " + << last_msg_.contents[130]; + EXPECT_EQ(last_msg_.contents[131], 189) + << "incorrect value for last_msg_.contents[131], expected 189, is " + << last_msg_.contents[131]; + EXPECT_EQ(last_msg_.contents[132], 128) + << "incorrect value for last_msg_.contents[132], expected 128, is " + << last_msg_.contents[132]; + EXPECT_EQ(last_msg_.contents[133], 189) + << "incorrect value for last_msg_.contents[133], expected 189, is " + << last_msg_.contents[133]; + EXPECT_EQ(last_msg_.contents[134], 2) + << "incorrect value for last_msg_.contents[134], expected 2, is " + << last_msg_.contents[134]; + EXPECT_EQ(last_msg_.contents[135], 240) + << "incorrect value for last_msg_.contents[135], expected 240, is " + << last_msg_.contents[135]; + EXPECT_EQ(last_msg_.contents[136], 92) + << "incorrect value for last_msg_.contents[136], expected 92, is " + << last_msg_.contents[136]; + EXPECT_EQ(last_msg_.contents[137], 28) + << "incorrect value for last_msg_.contents[137], expected 28, is " + << last_msg_.contents[137]; + EXPECT_EQ(last_msg_.contents[138], 126) + << "incorrect value for last_msg_.contents[138], expected 126, is " + << last_msg_.contents[138]; + EXPECT_EQ(last_msg_.contents[139], 105) + << "incorrect value for last_msg_.contents[139], expected 105, is " + << last_msg_.contents[139]; + EXPECT_EQ(last_msg_.contents[140], 236) + << "incorrect value for last_msg_.contents[140], expected 236, is " + << last_msg_.contents[140]; + EXPECT_EQ(last_msg_.contents[141], 228) + << "incorrect value for last_msg_.contents[141], expected 228, is " + << last_msg_.contents[141]; + EXPECT_EQ(last_msg_.contents[142], 194) + << "incorrect value for last_msg_.contents[142], expected 194, is " + << last_msg_.contents[142]; + EXPECT_EQ(last_msg_.contents[143], 0) + << "incorrect value for last_msg_.contents[143], expected 0, is " + << last_msg_.contents[143]; + EXPECT_EQ(last_msg_.contents[144], 51) + << "incorrect value for last_msg_.contents[144], expected 51, is " + << last_msg_.contents[144]; + EXPECT_EQ(last_msg_.contents[145], 61) + << "incorrect value for last_msg_.contents[145], expected 61, is " + << last_msg_.contents[145]; + EXPECT_EQ(last_msg_.contents[146], 74) + << "incorrect value for last_msg_.contents[146], expected 74, is " + << last_msg_.contents[146]; + EXPECT_EQ(last_msg_.contents[147], 41) + << "incorrect value for last_msg_.contents[147], expected 41, is " + << last_msg_.contents[147]; + EXPECT_EQ(last_msg_.contents[148], 10) + << "incorrect value for last_msg_.contents[148], expected 10, is " + << last_msg_.contents[148]; + EXPECT_EQ(last_msg_.contents[149], 239) + << "incorrect value for last_msg_.contents[149], expected 239, is " + << last_msg_.contents[149]; + EXPECT_EQ(last_msg_.contents[150], 133) + << "incorrect value for last_msg_.contents[150], expected 133, is " + << last_msg_.contents[150]; + EXPECT_EQ(last_msg_.contents[151], 106) + << "incorrect value for last_msg_.contents[151], expected 106, is " + << last_msg_.contents[151]; + EXPECT_EQ(last_msg_.contents[152], 190) + << "incorrect value for last_msg_.contents[152], expected 190, is " + << last_msg_.contents[152]; + EXPECT_EQ(last_msg_.contents[153], 30) + << "incorrect value for last_msg_.contents[153], expected 30, is " + << last_msg_.contents[153]; + EXPECT_EQ(last_msg_.contents[154], 27) + << "incorrect value for last_msg_.contents[154], expected 27, is " + << last_msg_.contents[154]; + EXPECT_EQ(last_msg_.contents[155], 3) + << "incorrect value for last_msg_.contents[155], expected 3, is " + << last_msg_.contents[155]; + EXPECT_EQ(last_msg_.contents[156], 240) + << "incorrect value for last_msg_.contents[156], expected 240, is " + << last_msg_.contents[156]; + EXPECT_EQ(last_msg_.contents[157], 205) + << "incorrect value for last_msg_.contents[157], expected 205, is " + << last_msg_.contents[157]; + EXPECT_EQ(last_msg_.contents[158], 253) + << "incorrect value for last_msg_.contents[158], expected 253, is " + << last_msg_.contents[158]; + EXPECT_EQ(last_msg_.contents[159], 113) + << "incorrect value for last_msg_.contents[159], expected 113, is " + << last_msg_.contents[159]; + EXPECT_EQ(last_msg_.contents[160], 25) + << "incorrect value for last_msg_.contents[160], expected 25, is " + << last_msg_.contents[160]; + EXPECT_EQ(last_msg_.contents[161], 28) + << "incorrect value for last_msg_.contents[161], expected 28, is " + << last_msg_.contents[161]; + EXPECT_EQ(last_msg_.contents[162], 187) + << "incorrect value for last_msg_.contents[162], expected 187, is " + << last_msg_.contents[162]; + EXPECT_EQ(last_msg_.contents[163], 81) + << "incorrect value for last_msg_.contents[163], expected 81, is " + << last_msg_.contents[163]; + EXPECT_EQ(last_msg_.contents[164], 101) + << "incorrect value for last_msg_.contents[164], expected 101, is " + << last_msg_.contents[164]; + EXPECT_EQ(last_msg_.contents[165], 216) + << "incorrect value for last_msg_.contents[165], expected 216, is " + << last_msg_.contents[165]; + EXPECT_EQ(last_msg_.contents[166], 121) + << "incorrect value for last_msg_.contents[166], expected 121, is " + << last_msg_.contents[166]; + EXPECT_EQ(last_msg_.contents[167], 41) + << "incorrect value for last_msg_.contents[167], expected 41, is " + << last_msg_.contents[167]; + EXPECT_EQ(last_msg_.contents[168], 179) + << "incorrect value for last_msg_.contents[168], expected 179, is " + << last_msg_.contents[168]; + EXPECT_EQ(last_msg_.contents[169], 120) + << "incorrect value for last_msg_.contents[169], expected 120, is " + << last_msg_.contents[169]; + EXPECT_EQ(last_msg_.contents[170], 152) + << "incorrect value for last_msg_.contents[170], expected 152, is " + << last_msg_.contents[170]; + EXPECT_EQ(last_msg_.contents[171], 18) + << "incorrect value for last_msg_.contents[171], expected 18, is " + << last_msg_.contents[171]; + EXPECT_EQ(last_msg_.contents[172], 116) + << "incorrect value for last_msg_.contents[172], expected 116, is " + << last_msg_.contents[172]; + EXPECT_EQ(last_msg_.contents[173], 53) + << "incorrect value for last_msg_.contents[173], expected 53, is " + << last_msg_.contents[173]; + EXPECT_EQ(last_msg_.contents[174], 212) + << "incorrect value for last_msg_.contents[174], expected 212, is " + << last_msg_.contents[174]; + EXPECT_EQ(last_msg_.contents[175], 100) + << "incorrect value for last_msg_.contents[175], expected 100, is " + << last_msg_.contents[175]; + EXPECT_EQ(last_msg_.contents[176], 2) + << "incorrect value for last_msg_.contents[176], expected 2, is " + << last_msg_.contents[176]; + EXPECT_EQ(last_msg_.contents[177], 114) + << "incorrect value for last_msg_.contents[177], expected 114, is " + << last_msg_.contents[177]; + EXPECT_EQ(last_msg_.contents[178], 198) + << "incorrect value for last_msg_.contents[178], expected 198, is " + << last_msg_.contents[178]; + EXPECT_EQ(last_msg_.contents[179], 200) + << "incorrect value for last_msg_.contents[179], expected 200, is " + << last_msg_.contents[179]; + EXPECT_EQ(last_msg_.contents[180], 10) + << "incorrect value for last_msg_.contents[180], expected 10, is " + << last_msg_.contents[180]; + EXPECT_EQ(last_msg_.contents[181], 147) + << "incorrect value for last_msg_.contents[181], expected 147, is " + << last_msg_.contents[181]; + EXPECT_EQ(last_msg_.contents[182], 25) + << "incorrect value for last_msg_.contents[182], expected 25, is " + << last_msg_.contents[182]; + EXPECT_EQ(last_msg_.contents[183], 33) + << "incorrect value for last_msg_.contents[183], expected 33, is " + << last_msg_.contents[183]; + EXPECT_EQ(last_msg_.contents[184], 115) + << "incorrect value for last_msg_.contents[184], expected 115, is " + << last_msg_.contents[184]; + EXPECT_EQ(last_msg_.contents[185], 208) + << "incorrect value for last_msg_.contents[185], expected 208, is " + << last_msg_.contents[185]; + EXPECT_EQ(last_msg_.contents[186], 113) + << "incorrect value for last_msg_.contents[186], expected 113, is " + << last_msg_.contents[186]; + EXPECT_EQ(last_msg_.contents[187], 60) + << "incorrect value for last_msg_.contents[187], expected 60, is " + << last_msg_.contents[187]; + EXPECT_EQ(last_msg_.contents[188], 179) + << "incorrect value for last_msg_.contents[188], expected 179, is " + << last_msg_.contents[188]; + EXPECT_EQ(last_msg_.contents[189], 183) + << "incorrect value for last_msg_.contents[189], expected 183, is " + << last_msg_.contents[189]; + EXPECT_EQ(last_msg_.contents[190], 0) + << "incorrect value for last_msg_.contents[190], expected 0, is " + << last_msg_.contents[190]; + EXPECT_EQ(last_msg_.contents[191], 41) + << "incorrect value for last_msg_.contents[191], expected 41, is " + << last_msg_.contents[191]; + EXPECT_EQ(last_msg_.contents[192], 217) + << "incorrect value for last_msg_.contents[192], expected 217, is " + << last_msg_.contents[192]; + EXPECT_EQ(last_msg_.contents[193], 206) + << "incorrect value for last_msg_.contents[193], expected 206, is " + << last_msg_.contents[193]; + EXPECT_EQ(last_msg_.contents[194], 255) + << "incorrect value for last_msg_.contents[194], expected 255, is " + << last_msg_.contents[194]; + EXPECT_EQ(last_msg_.contents[195], 211) + << "incorrect value for last_msg_.contents[195], expected 211, is " + << last_msg_.contents[195]; + EXPECT_EQ(last_msg_.contents[196], 225) + << "incorrect value for last_msg_.contents[196], expected 225, is " + << last_msg_.contents[196]; + EXPECT_EQ(last_msg_.contents[197], 142) + << "incorrect value for last_msg_.contents[197], expected 142, is " + << last_msg_.contents[197]; + EXPECT_EQ(last_msg_.contents[198], 191) + << "incorrect value for last_msg_.contents[198], expected 191, is " + << last_msg_.contents[198]; + EXPECT_EQ(last_msg_.contents[199], 133) + << "incorrect value for last_msg_.contents[199], expected 133, is " + << last_msg_.contents[199]; + EXPECT_EQ(last_msg_.contents[200], 81) + << "incorrect value for last_msg_.contents[200], expected 81, is " + << last_msg_.contents[200]; + EXPECT_EQ(last_msg_.contents[201], 15) + << "incorrect value for last_msg_.contents[201], expected 15, is " + << last_msg_.contents[201]; + EXPECT_EQ(last_msg_.contents[202], 248) + << "incorrect value for last_msg_.contents[202], expected 248, is " + << last_msg_.contents[202]; + EXPECT_EQ(last_msg_.contents[203], 193) + << "incorrect value for last_msg_.contents[203], expected 193, is " + << last_msg_.contents[203]; + EXPECT_EQ(last_msg_.contents[204], 66) + << "incorrect value for last_msg_.contents[204], expected 66, is " + << last_msg_.contents[204]; + EXPECT_EQ(last_msg_.contents[205], 191) + << "incorrect value for last_msg_.contents[205], expected 191, is " + << last_msg_.contents[205]; + EXPECT_EQ(last_msg_.contents[206], 244) + << "incorrect value for last_msg_.contents[206], expected 244, is " + << last_msg_.contents[206]; + EXPECT_EQ(last_msg_.contents[207], 221) + << "incorrect value for last_msg_.contents[207], expected 221, is " + << last_msg_.contents[207]; + EXPECT_EQ(last_msg_.contents[208], 248) + << "incorrect value for last_msg_.contents[208], expected 248, is " + << last_msg_.contents[208]; + EXPECT_EQ(last_msg_.contents[209], 199) + << "incorrect value for last_msg_.contents[209], expected 199, is " + << last_msg_.contents[209]; + EXPECT_EQ(last_msg_.contents[210], 241) + << "incorrect value for last_msg_.contents[210], expected 241, is " + << last_msg_.contents[210]; + EXPECT_EQ(last_msg_.contents[211], 112) + << "incorrect value for last_msg_.contents[211], expected 112, is " + << last_msg_.contents[211]; + EXPECT_EQ(last_msg_.contents[212], 51) + << "incorrect value for last_msg_.contents[212], expected 51, is " + << last_msg_.contents[212]; + EXPECT_EQ(last_msg_.contents[213], 1) + << "incorrect value for last_msg_.contents[213], expected 1, is " + << last_msg_.contents[213]; + EXPECT_EQ(last_msg_.contents[214], 180) + << "incorrect value for last_msg_.contents[214], expected 180, is " + << last_msg_.contents[214]; + EXPECT_EQ(last_msg_.contents[215], 180) + << "incorrect value for last_msg_.contents[215], expected 180, is " + << last_msg_.contents[215]; + EXPECT_EQ(last_msg_.contents[216], 125) + << "incorrect value for last_msg_.contents[216], expected 125, is " + << last_msg_.contents[216]; + EXPECT_EQ(last_msg_.contents[217], 97) + << "incorrect value for last_msg_.contents[217], expected 97, is " + << last_msg_.contents[217]; + EXPECT_EQ(last_msg_.contents[218], 145) + << "incorrect value for last_msg_.contents[218], expected 145, is " + << last_msg_.contents[218]; + EXPECT_EQ(last_msg_.contents[219], 25) + << "incorrect value for last_msg_.contents[219], expected 25, is " + << last_msg_.contents[219]; + EXPECT_EQ(last_msg_.contents[220], 72) + << "incorrect value for last_msg_.contents[220], expected 72, is " + << last_msg_.contents[220]; + EXPECT_EQ(last_msg_.contents[221], 210) + << "incorrect value for last_msg_.contents[221], expected 210, is " + << last_msg_.contents[221]; + EXPECT_EQ(last_msg_.contents[222], 215) + << "incorrect value for last_msg_.contents[222], expected 215, is " + << last_msg_.contents[222]; + EXPECT_EQ(last_msg_.contents[223], 208) + << "incorrect value for last_msg_.contents[223], expected 208, is " + << last_msg_.contents[223]; + EXPECT_EQ(last_msg_.contents[224], 15) + << "incorrect value for last_msg_.contents[224], expected 15, is " + << last_msg_.contents[224]; + EXPECT_EQ(last_msg_.contents[225], 126) + << "incorrect value for last_msg_.contents[225], expected 126, is " + << last_msg_.contents[225]; + EXPECT_EQ(last_msg_.contents[226], 56) + << "incorrect value for last_msg_.contents[226], expected 56, is " + << last_msg_.contents[226]; + EXPECT_EQ(last_msg_.contents[227], 38) + << "incorrect value for last_msg_.contents[227], expected 38, is " + << last_msg_.contents[227]; + EXPECT_EQ(last_msg_.contents[228], 65) + << "incorrect value for last_msg_.contents[228], expected 65, is " + << last_msg_.contents[228]; + EXPECT_EQ(last_msg_.contents[229], 4) + << "incorrect value for last_msg_.contents[229], expected 4, is " + << last_msg_.contents[229]; + EXPECT_EQ(last_msg_.contents[230], 64) + << "incorrect value for last_msg_.contents[230], expected 64, is " + << last_msg_.contents[230]; + EXPECT_EQ(last_msg_.contents[231], 19) + << "incorrect value for last_msg_.contents[231], expected 19, is " + << last_msg_.contents[231]; + EXPECT_EQ(last_msg_.contents[232], 74) + << "incorrect value for last_msg_.contents[232], expected 74, is " + << last_msg_.contents[232]; + EXPECT_EQ(last_msg_.contents[233], 223) + << "incorrect value for last_msg_.contents[233], expected 223, is " + << last_msg_.contents[233]; + EXPECT_EQ(last_msg_.contents[234], 111) + << "incorrect value for last_msg_.contents[234], expected 111, is " + << last_msg_.contents[234]; + EXPECT_EQ(last_msg_.contents[235], 109) + << "incorrect value for last_msg_.contents[235], expected 109, is " + << last_msg_.contents[235]; + EXPECT_EQ(last_msg_.contents[236], 52) + << "incorrect value for last_msg_.contents[236], expected 52, is " + << last_msg_.contents[236]; + EXPECT_EQ(last_msg_.contents[237], 43) + << "incorrect value for last_msg_.contents[237], expected 43, is " + << last_msg_.contents[237]; + EXPECT_EQ(last_msg_.contents[238], 167) + << "incorrect value for last_msg_.contents[238], expected 167, is " + << last_msg_.contents[238]; + EXPECT_EQ(last_msg_.contents[239], 186) + << "incorrect value for last_msg_.contents[239], expected 186, is " + << last_msg_.contents[239]; + EXPECT_EQ(last_msg_.contents[240], 202) + << "incorrect value for last_msg_.contents[240], expected 202, is " + << last_msg_.contents[240]; + EXPECT_EQ(last_msg_.contents[241], 111) + << "incorrect value for last_msg_.contents[241], expected 111, is " + << last_msg_.contents[241]; + EXPECT_EQ(last_msg_.contents[242], 11) + << "incorrect value for last_msg_.contents[242], expected 11, is " + << last_msg_.contents[242]; + EXPECT_EQ(last_msg_.contents[243], 91) + << "incorrect value for last_msg_.contents[243], expected 91, is " + << last_msg_.contents[243]; + EXPECT_EQ(last_msg_.contents[244], 21) + << "incorrect value for last_msg_.contents[244], expected 21, is " + << last_msg_.contents[244]; + EXPECT_EQ(last_msg_.contents[245], 236) + << "incorrect value for last_msg_.contents[245], expected 236, is " + << last_msg_.contents[245]; + EXPECT_EQ(last_msg_.contents[246], 234) + << "incorrect value for last_msg_.contents[246], expected 234, is " + << last_msg_.contents[246]; + EXPECT_EQ(last_msg_.contents[247], 196) + << "incorrect value for last_msg_.contents[247], expected 196, is " + << last_msg_.contents[247]; + EXPECT_EQ(last_msg_.contents[248], 36) + << "incorrect value for last_msg_.contents[248], expected 36, is " + << last_msg_.contents[248]; + EXPECT_EQ(last_msg_.contents[249], 171) + << "incorrect value for last_msg_.contents[249], expected 171, is " + << last_msg_.contents[249]; + EXPECT_EQ(last_msg_.contents[250], 147) + << "incorrect value for last_msg_.contents[250], expected 147, is " + << last_msg_.contents[250]; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_contents.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_contents.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_contents.handle_as << "'"; + } + { + const char check_string[] = {(char)99, (char)111, (char)110, (char)116, + (char)101, (char)110, (char)116, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_contents.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_contents.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_contents.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_contents.value, 251) + << "incorrect value for last_msg_.n_contents.value, expected 251, is " + << last_msg_.n_contents.value; + EXPECT_EQ(last_msg_.sequence, 259241795) + << "incorrect value for last_msg_.sequence, expected 259241795, is " + << last_msg_.sequence; } diff --git a/c/test/cpp/auto_check_sbp_file_io_MsgFileioRemove.cc b/c/test/cpp/auto_check_sbp_file_io_MsgFileioRemove.cc index 480c473a3..9cb41b184 100644 --- a/c/test/cpp/auto_check_sbp_file_io_MsgFileioRemove.cc +++ b/c/test/cpp/auto_check_sbp_file_io_MsgFileioRemove.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioRemove.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioRemove.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_file_io_MsgFileioRemove0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_file_io_MsgFileioRemove0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_file_io_MsgFileioRemove0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_file_io_MsgFileioRemove0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_fileio_remove_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_fileio_remove_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,38 +67,40 @@ class Test_auto_check_sbp_file_io_MsgFileioRemove0 : sbp_msg_fileio_remove_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_file_io_MsgFileioRemove0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_file_io_MsgFileioRemove0, Test) { + uint8_t encoded_frame[] = { + 85, 172, 0, 195, 4, 14, 47, 112, 97, 116, 104, + 47, 116, 111, 47, 102, 105, 108, 101, 0, 46, 243, + }; + + sbp_msg_fileio_remove_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_fileio_remove_filename_set(&test_msg, "/path/to/file", + false, &written)); + EXPECT_EQ(written, strlen("/path/to/file")); + EXPECT_EQ(sbp_msg_fileio_remove_filename_encoded_len(&test_msg), 14); - uint8_t encoded_frame[] = {85,172,0,195,4,14,47,112,97,116,104,47,116,111,47,102,105,108,101,0,46,243, }; + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_fileio_remove_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_fileio_remove_filename_set(&test_msg, "/path/to/file", false, &written)); - EXPECT_EQ( written, strlen("/path/to/file")); - EXPECT_EQ(sbp_msg_fileio_remove_filename_encoded_len(&test_msg), 14); - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_fileio_remove_filename_encoded_len(&last_msg_), 14); - EXPECT_STREQ(sbp_msg_fileio_remove_filename_get(&last_msg_), "/path/to/file"); + EXPECT_EQ(sbp_msg_fileio_remove_filename_encoded_len(&last_msg_), 14); + EXPECT_STREQ(sbp_msg_fileio_remove_filename_get(&last_msg_), "/path/to/file"); } diff --git a/c/test/cpp/auto_check_sbp_file_io_MsgFileioWriteResp.cc b/c/test/cpp/auto_check_sbp_file_io_MsgFileioWriteResp.cc index 2888ac7f7..5c28ff790 100644 --- a/c/test/cpp/auto_check_sbp_file_io_MsgFileioWriteResp.cc +++ b/c/test/cpp/auto_check_sbp_file_io_MsgFileioWriteResp.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioWriteResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioWriteResp.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_file_io_MsgFileioWriteResp0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_file_io_MsgFileioWriteResp0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_file_io_MsgFileioWriteResp0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_file_io_MsgFileioWriteResp0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_fileio_write_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_fileio_write_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,32 +67,34 @@ class Test_auto_check_sbp_file_io_MsgFileioWriteResp0 : sbp_msg_fileio_write_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_file_io_MsgFileioWriteResp0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_file_io_MsgFileioWriteResp0, Test) { + uint8_t encoded_frame[] = { + 85, 171, 0, 66, 0, 4, 202, 0, 0, 0, 243, 243, + }; - uint8_t encoded_frame[] = {85,171,0,66,0,4,202,0,0,0,243,243, }; + sbp_msg_fileio_write_resp_t test_msg{}; + test_msg.sequence = 202; - sbp_msg_fileio_write_resp_t test_msg{}; - test_msg.sequence = 202; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.sequence, 202) << "incorrect value for last_msg_.sequence, expected 202, is " << last_msg_.sequence; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.sequence, 202) + << "incorrect value for last_msg_.sequence, expected 202, is " + << last_msg_.sequence; } diff --git a/c/test/cpp/auto_check_sbp_flash_MsgFlashDone.cc b/c/test/cpp/auto_check_sbp_flash_MsgFlashDone.cc index 919ef5950..97db7cf2d 100644 --- a/c/test/cpp/auto_check_sbp_flash_MsgFlashDone.cc +++ b/c/test/cpp/auto_check_sbp_flash_MsgFlashDone.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashDone.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashDone.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_flash_MsgFlashDone0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_flash_MsgFlashDone0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_flash_MsgFlashDone0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_flash_MsgFlashDone0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_flash_done_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_flash_done_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,32 +67,34 @@ class Test_auto_check_sbp_flash_MsgFlashDone0 : sbp_msg_flash_done_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_flash_MsgFlashDone0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_flash_MsgFlashDone0, Test) { + uint8_t encoded_frame[] = { + 85, 224, 0, 195, 4, 1, 82, 6, 54, + }; - uint8_t encoded_frame[] = {85,224,0,195,4,1,82,6,54, }; + sbp_msg_flash_done_t test_msg{}; + test_msg.response = 82; - sbp_msg_flash_done_t test_msg{}; - test_msg.response = 82; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.response, 82) << "incorrect value for last_msg_.response, expected 82, is " << last_msg_.response; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.response, 82) + << "incorrect value for last_msg_.response, expected 82, is " + << last_msg_.response; } diff --git a/c/test/cpp/auto_check_sbp_flash_MsgFlashErase.cc b/c/test/cpp/auto_check_sbp_flash_MsgFlashErase.cc index 44c25ba62..7245f7498 100644 --- a/c/test/cpp/auto_check_sbp_flash_MsgFlashErase.cc +++ b/c/test/cpp/auto_check_sbp_flash_MsgFlashErase.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashErase.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashErase.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_flash_MsgFlashErase0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_flash_MsgFlashErase0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_flash_MsgFlashErase0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_flash_MsgFlashErase0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_flash_erase_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_flash_erase_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,34 +67,38 @@ class Test_auto_check_sbp_flash_MsgFlashErase0 : sbp_msg_flash_erase_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_flash_MsgFlashErase0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_flash_MsgFlashErase0, Test) { + uint8_t encoded_frame[] = { + 85, 226, 0, 195, 4, 5, 74, 238, 177, 118, 132, 0, 251, + }; - uint8_t encoded_frame[] = {85,226,0,195,4,5,74,238,177,118,132,0,251, }; + sbp_msg_flash_erase_t test_msg{}; + test_msg.sector_num = 2222371310; + test_msg.target = 74; - sbp_msg_flash_erase_t test_msg{}; - test_msg.sector_num = 2222371310; - test_msg.target = 74; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.sector_num, 2222371310) << "incorrect value for last_msg_.sector_num, expected 2222371310, is " << last_msg_.sector_num; - EXPECT_EQ(last_msg_.target, 74) << "incorrect value for last_msg_.target, expected 74, is " << last_msg_.target; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.sector_num, 2222371310) + << "incorrect value for last_msg_.sector_num, expected 2222371310, is " + << last_msg_.sector_num; + EXPECT_EQ(last_msg_.target, 74) + << "incorrect value for last_msg_.target, expected 74, is " + << last_msg_.target; } diff --git a/c/test/cpp/auto_check_sbp_flash_MsgFlashProgram.cc b/c/test/cpp/auto_check_sbp_flash_MsgFlashProgram.cc index fd4ed7bf1..39e1e7fb7 100644 --- a/c/test/cpp/auto_check_sbp_flash_MsgFlashProgram.cc +++ b/c/test/cpp/auto_check_sbp_flash_MsgFlashProgram.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashProgram.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashProgram.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_flash_MsgFlashProgram0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_flash_MsgFlashProgram0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_flash_MsgFlashProgram0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_flash_MsgFlashProgram0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_flash_program_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_flash_program_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,809 +67,1349 @@ class Test_auto_check_sbp_flash_MsgFlashProgram0 : sbp_msg_flash_program_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_flash_MsgFlashProgram0, Test) -{ - - uint8_t encoded_frame[] = {85,230,0,195,4,255,212,87,52,244,250,176,222,235,106,144,29,141,255,3,16,192,237,172,254,213,4,220,98,34,222,230,214,6,217,172,122,46,13,38,240,236,60,121,47,252,163,141,222,29,168,214,118,55,201,233,21,214,57,245,246,19,3,121,49,231,37,186,58,238,98,39,70,232,133,25,10,134,129,69,228,134,9,88,183,133,171,255,166,100,152,231,92,9,196,106,246,29,145,156,151,32,67,188,63,233,142,174,139,154,127,35,60,56,187,121,103,135,152,182,88,160,255,227,240,54,100,91,31,141,102,130,254,54,227,229,62,53,225,143,88,139,126,235,235,35,54,134,163,92,57,87,130,178,22,158,18,237,209,187,226,1,46,64,226,235,213,186,159,221,186,25,115,84,131,167,201,104,1,200,13,50,71,73,193,201,250,172,193,13,20,238,130,243,68,4,72,46,194,113,255,238,15,230,64,178,127,217,92,160,201,118,163,144,58,28,174,65,73,45,123,118,83,107,239,168,32,212,191,81,93,186,223,32,19,58,137,72,217,151,251,83,20,113,37,151,34,37,71,95,105,235,144,164,83,197,254,183,223,91,19,45,227, }; - - sbp_msg_flash_program_t test_msg{}; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.addr_len.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)100,(char)97,(char)116,(char)97 }; - memcpy(test_msg.addr_len.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.addr_len.value = 250; - - test_msg.addr_start[0] = 87; - - test_msg.addr_start[1] = 52; - - test_msg.addr_start[2] = 244; - - test_msg.data[0] = 176; - - test_msg.data[1] = 222; - - test_msg.data[2] = 235; - - test_msg.data[3] = 106; - - test_msg.data[4] = 144; - - test_msg.data[5] = 29; - - test_msg.data[6] = 141; - - test_msg.data[7] = 255; - - test_msg.data[8] = 3; - - test_msg.data[9] = 16; - - test_msg.data[10] = 192; - - test_msg.data[11] = 237; - - test_msg.data[12] = 172; - - test_msg.data[13] = 254; - - test_msg.data[14] = 213; - - test_msg.data[15] = 4; - - test_msg.data[16] = 220; - - test_msg.data[17] = 98; - - test_msg.data[18] = 34; - - test_msg.data[19] = 222; - - test_msg.data[20] = 230; - - test_msg.data[21] = 214; - - test_msg.data[22] = 6; - - test_msg.data[23] = 217; - - test_msg.data[24] = 172; - - test_msg.data[25] = 122; - - test_msg.data[26] = 46; - - test_msg.data[27] = 13; - - test_msg.data[28] = 38; - - test_msg.data[29] = 240; - - test_msg.data[30] = 236; - - test_msg.data[31] = 60; - - test_msg.data[32] = 121; - - test_msg.data[33] = 47; - - test_msg.data[34] = 252; - - test_msg.data[35] = 163; - - test_msg.data[36] = 141; - - test_msg.data[37] = 222; - - test_msg.data[38] = 29; - - test_msg.data[39] = 168; - - test_msg.data[40] = 214; - - test_msg.data[41] = 118; - - test_msg.data[42] = 55; - - test_msg.data[43] = 201; - - test_msg.data[44] = 233; - - test_msg.data[45] = 21; - - test_msg.data[46] = 214; - - test_msg.data[47] = 57; - - test_msg.data[48] = 245; - - test_msg.data[49] = 246; - - test_msg.data[50] = 19; - - test_msg.data[51] = 3; - - test_msg.data[52] = 121; - - test_msg.data[53] = 49; - - test_msg.data[54] = 231; - - test_msg.data[55] = 37; - - test_msg.data[56] = 186; - - test_msg.data[57] = 58; - - test_msg.data[58] = 238; - - test_msg.data[59] = 98; - - test_msg.data[60] = 39; - - test_msg.data[61] = 70; - - test_msg.data[62] = 232; - - test_msg.data[63] = 133; - - test_msg.data[64] = 25; - - test_msg.data[65] = 10; - - test_msg.data[66] = 134; - - test_msg.data[67] = 129; - - test_msg.data[68] = 69; - - test_msg.data[69] = 228; - - test_msg.data[70] = 134; - - test_msg.data[71] = 9; - - test_msg.data[72] = 88; - - test_msg.data[73] = 183; - - test_msg.data[74] = 133; - - test_msg.data[75] = 171; - - test_msg.data[76] = 255; - - test_msg.data[77] = 166; - - test_msg.data[78] = 100; - - test_msg.data[79] = 152; - - test_msg.data[80] = 231; - - test_msg.data[81] = 92; - - test_msg.data[82] = 9; - - test_msg.data[83] = 196; - - test_msg.data[84] = 106; - - test_msg.data[85] = 246; - - test_msg.data[86] = 29; - - test_msg.data[87] = 145; - - test_msg.data[88] = 156; - - test_msg.data[89] = 151; - - test_msg.data[90] = 32; - - test_msg.data[91] = 67; - - test_msg.data[92] = 188; - - test_msg.data[93] = 63; - - test_msg.data[94] = 233; - - test_msg.data[95] = 142; - - test_msg.data[96] = 174; - - test_msg.data[97] = 139; - - test_msg.data[98] = 154; - - test_msg.data[99] = 127; - - test_msg.data[100] = 35; - - test_msg.data[101] = 60; - - test_msg.data[102] = 56; - - test_msg.data[103] = 187; - - test_msg.data[104] = 121; - - test_msg.data[105] = 103; - - test_msg.data[106] = 135; - - test_msg.data[107] = 152; - - test_msg.data[108] = 182; - - test_msg.data[109] = 88; - - test_msg.data[110] = 160; - - test_msg.data[111] = 255; - - test_msg.data[112] = 227; - - test_msg.data[113] = 240; - - test_msg.data[114] = 54; - - test_msg.data[115] = 100; - - test_msg.data[116] = 91; - - test_msg.data[117] = 31; - - test_msg.data[118] = 141; - - test_msg.data[119] = 102; - - test_msg.data[120] = 130; - - test_msg.data[121] = 254; - - test_msg.data[122] = 54; - - test_msg.data[123] = 227; - - test_msg.data[124] = 229; - - test_msg.data[125] = 62; - - test_msg.data[126] = 53; - - test_msg.data[127] = 225; - - test_msg.data[128] = 143; - - test_msg.data[129] = 88; - - test_msg.data[130] = 139; - - test_msg.data[131] = 126; - - test_msg.data[132] = 235; - - test_msg.data[133] = 235; - - test_msg.data[134] = 35; - - test_msg.data[135] = 54; - - test_msg.data[136] = 134; - - test_msg.data[137] = 163; - - test_msg.data[138] = 92; - - test_msg.data[139] = 57; - - test_msg.data[140] = 87; - - test_msg.data[141] = 130; - - test_msg.data[142] = 178; - - test_msg.data[143] = 22; - - test_msg.data[144] = 158; - - test_msg.data[145] = 18; - - test_msg.data[146] = 237; - - test_msg.data[147] = 209; - - test_msg.data[148] = 187; - - test_msg.data[149] = 226; - - test_msg.data[150] = 1; - - test_msg.data[151] = 46; - - test_msg.data[152] = 64; - - test_msg.data[153] = 226; - - test_msg.data[154] = 235; - - test_msg.data[155] = 213; - - test_msg.data[156] = 186; - - test_msg.data[157] = 159; - - test_msg.data[158] = 221; - - test_msg.data[159] = 186; - - test_msg.data[160] = 25; - - test_msg.data[161] = 115; - - test_msg.data[162] = 84; - - test_msg.data[163] = 131; - - test_msg.data[164] = 167; - - test_msg.data[165] = 201; - - test_msg.data[166] = 104; - - test_msg.data[167] = 1; - - test_msg.data[168] = 200; - - test_msg.data[169] = 13; - - test_msg.data[170] = 50; - - test_msg.data[171] = 71; - - test_msg.data[172] = 73; - - test_msg.data[173] = 193; - - test_msg.data[174] = 201; - - test_msg.data[175] = 250; - - test_msg.data[176] = 172; - - test_msg.data[177] = 193; - - test_msg.data[178] = 13; - - test_msg.data[179] = 20; - - test_msg.data[180] = 238; - - test_msg.data[181] = 130; - - test_msg.data[182] = 243; - - test_msg.data[183] = 68; - - test_msg.data[184] = 4; - - test_msg.data[185] = 72; - - test_msg.data[186] = 46; - - test_msg.data[187] = 194; - - test_msg.data[188] = 113; - - test_msg.data[189] = 255; - - test_msg.data[190] = 238; - - test_msg.data[191] = 15; - - test_msg.data[192] = 230; - - test_msg.data[193] = 64; - - test_msg.data[194] = 178; - - test_msg.data[195] = 127; - - test_msg.data[196] = 217; - - test_msg.data[197] = 92; - - test_msg.data[198] = 160; - - test_msg.data[199] = 201; - - test_msg.data[200] = 118; - - test_msg.data[201] = 163; - - test_msg.data[202] = 144; - - test_msg.data[203] = 58; - - test_msg.data[204] = 28; - - test_msg.data[205] = 174; - - test_msg.data[206] = 65; - - test_msg.data[207] = 73; - - test_msg.data[208] = 45; - - test_msg.data[209] = 123; - - test_msg.data[210] = 118; - - test_msg.data[211] = 83; - - test_msg.data[212] = 107; - - test_msg.data[213] = 239; - - test_msg.data[214] = 168; - - test_msg.data[215] = 32; - - test_msg.data[216] = 212; - - test_msg.data[217] = 191; - - test_msg.data[218] = 81; - - test_msg.data[219] = 93; - - test_msg.data[220] = 186; - - test_msg.data[221] = 223; - - test_msg.data[222] = 32; - - test_msg.data[223] = 19; - - test_msg.data[224] = 58; - - test_msg.data[225] = 137; - - test_msg.data[226] = 72; - - test_msg.data[227] = 217; - - test_msg.data[228] = 151; - - test_msg.data[229] = 251; - - test_msg.data[230] = 83; - - test_msg.data[231] = 20; - - test_msg.data[232] = 113; - - test_msg.data[233] = 37; - - test_msg.data[234] = 151; - - test_msg.data[235] = 34; - - test_msg.data[236] = 37; - - test_msg.data[237] = 71; - - test_msg.data[238] = 95; - - test_msg.data[239] = 105; - - test_msg.data[240] = 235; - - test_msg.data[241] = 144; - - test_msg.data[242] = 164; - - test_msg.data[243] = 83; - - test_msg.data[244] = 197; - - test_msg.data[245] = 254; - - test_msg.data[246] = 183; - - test_msg.data[247] = 223; - - test_msg.data[248] = 91; - - test_msg.data[249] = 19; - test_msg.target = 212; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.addr_len.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.addr_len.handle_as, expected string '" << check_string << "', is '" << last_msg_.addr_len.handle_as << "'"; - } - { - const char check_string[] = { (char)100,(char)97,(char)116,(char)97 }; - EXPECT_EQ(memcmp(last_msg_.addr_len.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.addr_len.relates_to, expected string '" << check_string << "', is '" << last_msg_.addr_len.relates_to << "'"; - } - EXPECT_EQ(last_msg_.addr_len.value, 250) << "incorrect value for last_msg_.addr_len.value, expected 250, is " << last_msg_.addr_len.value; - EXPECT_EQ(last_msg_.addr_start[0], 87) << "incorrect value for last_msg_.addr_start[0], expected 87, is " << last_msg_.addr_start[0]; - EXPECT_EQ(last_msg_.addr_start[1], 52) << "incorrect value for last_msg_.addr_start[1], expected 52, is " << last_msg_.addr_start[1]; - EXPECT_EQ(last_msg_.addr_start[2], 244) << "incorrect value for last_msg_.addr_start[2], expected 244, is " << last_msg_.addr_start[2]; - EXPECT_EQ(last_msg_.data[0], 176) << "incorrect value for last_msg_.data[0], expected 176, is " << last_msg_.data[0]; - EXPECT_EQ(last_msg_.data[1], 222) << "incorrect value for last_msg_.data[1], expected 222, is " << last_msg_.data[1]; - EXPECT_EQ(last_msg_.data[2], 235) << "incorrect value for last_msg_.data[2], expected 235, is " << last_msg_.data[2]; - EXPECT_EQ(last_msg_.data[3], 106) << "incorrect value for last_msg_.data[3], expected 106, is " << last_msg_.data[3]; - EXPECT_EQ(last_msg_.data[4], 144) << "incorrect value for last_msg_.data[4], expected 144, is " << last_msg_.data[4]; - EXPECT_EQ(last_msg_.data[5], 29) << "incorrect value for last_msg_.data[5], expected 29, is " << last_msg_.data[5]; - EXPECT_EQ(last_msg_.data[6], 141) << "incorrect value for last_msg_.data[6], expected 141, is " << last_msg_.data[6]; - EXPECT_EQ(last_msg_.data[7], 255) << "incorrect value for last_msg_.data[7], expected 255, is " << last_msg_.data[7]; - EXPECT_EQ(last_msg_.data[8], 3) << "incorrect value for last_msg_.data[8], expected 3, is " << last_msg_.data[8]; - EXPECT_EQ(last_msg_.data[9], 16) << "incorrect value for last_msg_.data[9], expected 16, is " << last_msg_.data[9]; - EXPECT_EQ(last_msg_.data[10], 192) << "incorrect value for last_msg_.data[10], expected 192, is " << last_msg_.data[10]; - EXPECT_EQ(last_msg_.data[11], 237) << "incorrect value for last_msg_.data[11], expected 237, is " << last_msg_.data[11]; - EXPECT_EQ(last_msg_.data[12], 172) << "incorrect value for last_msg_.data[12], expected 172, is " << last_msg_.data[12]; - EXPECT_EQ(last_msg_.data[13], 254) << "incorrect value for last_msg_.data[13], expected 254, is " << last_msg_.data[13]; - EXPECT_EQ(last_msg_.data[14], 213) << "incorrect value for last_msg_.data[14], expected 213, is " << last_msg_.data[14]; - EXPECT_EQ(last_msg_.data[15], 4) << "incorrect value for last_msg_.data[15], expected 4, is " << last_msg_.data[15]; - EXPECT_EQ(last_msg_.data[16], 220) << "incorrect value for last_msg_.data[16], expected 220, is " << last_msg_.data[16]; - EXPECT_EQ(last_msg_.data[17], 98) << "incorrect value for last_msg_.data[17], expected 98, is " << last_msg_.data[17]; - EXPECT_EQ(last_msg_.data[18], 34) << "incorrect value for last_msg_.data[18], expected 34, is " << last_msg_.data[18]; - EXPECT_EQ(last_msg_.data[19], 222) << "incorrect value for last_msg_.data[19], expected 222, is " << last_msg_.data[19]; - EXPECT_EQ(last_msg_.data[20], 230) << "incorrect value for last_msg_.data[20], expected 230, is " << last_msg_.data[20]; - EXPECT_EQ(last_msg_.data[21], 214) << "incorrect value for last_msg_.data[21], expected 214, is " << last_msg_.data[21]; - EXPECT_EQ(last_msg_.data[22], 6) << "incorrect value for last_msg_.data[22], expected 6, is " << last_msg_.data[22]; - EXPECT_EQ(last_msg_.data[23], 217) << "incorrect value for last_msg_.data[23], expected 217, is " << last_msg_.data[23]; - EXPECT_EQ(last_msg_.data[24], 172) << "incorrect value for last_msg_.data[24], expected 172, is " << last_msg_.data[24]; - EXPECT_EQ(last_msg_.data[25], 122) << "incorrect value for last_msg_.data[25], expected 122, is " << last_msg_.data[25]; - EXPECT_EQ(last_msg_.data[26], 46) << "incorrect value for last_msg_.data[26], expected 46, is " << last_msg_.data[26]; - EXPECT_EQ(last_msg_.data[27], 13) << "incorrect value for last_msg_.data[27], expected 13, is " << last_msg_.data[27]; - EXPECT_EQ(last_msg_.data[28], 38) << "incorrect value for last_msg_.data[28], expected 38, is " << last_msg_.data[28]; - EXPECT_EQ(last_msg_.data[29], 240) << "incorrect value for last_msg_.data[29], expected 240, is " << last_msg_.data[29]; - EXPECT_EQ(last_msg_.data[30], 236) << "incorrect value for last_msg_.data[30], expected 236, is " << last_msg_.data[30]; - EXPECT_EQ(last_msg_.data[31], 60) << "incorrect value for last_msg_.data[31], expected 60, is " << last_msg_.data[31]; - EXPECT_EQ(last_msg_.data[32], 121) << "incorrect value for last_msg_.data[32], expected 121, is " << last_msg_.data[32]; - EXPECT_EQ(last_msg_.data[33], 47) << "incorrect value for last_msg_.data[33], expected 47, is " << last_msg_.data[33]; - EXPECT_EQ(last_msg_.data[34], 252) << "incorrect value for last_msg_.data[34], expected 252, is " << last_msg_.data[34]; - EXPECT_EQ(last_msg_.data[35], 163) << "incorrect value for last_msg_.data[35], expected 163, is " << last_msg_.data[35]; - EXPECT_EQ(last_msg_.data[36], 141) << "incorrect value for last_msg_.data[36], expected 141, is " << last_msg_.data[36]; - EXPECT_EQ(last_msg_.data[37], 222) << "incorrect value for last_msg_.data[37], expected 222, is " << last_msg_.data[37]; - EXPECT_EQ(last_msg_.data[38], 29) << "incorrect value for last_msg_.data[38], expected 29, is " << last_msg_.data[38]; - EXPECT_EQ(last_msg_.data[39], 168) << "incorrect value for last_msg_.data[39], expected 168, is " << last_msg_.data[39]; - EXPECT_EQ(last_msg_.data[40], 214) << "incorrect value for last_msg_.data[40], expected 214, is " << last_msg_.data[40]; - EXPECT_EQ(last_msg_.data[41], 118) << "incorrect value for last_msg_.data[41], expected 118, is " << last_msg_.data[41]; - EXPECT_EQ(last_msg_.data[42], 55) << "incorrect value for last_msg_.data[42], expected 55, is " << last_msg_.data[42]; - EXPECT_EQ(last_msg_.data[43], 201) << "incorrect value for last_msg_.data[43], expected 201, is " << last_msg_.data[43]; - EXPECT_EQ(last_msg_.data[44], 233) << "incorrect value for last_msg_.data[44], expected 233, is " << last_msg_.data[44]; - EXPECT_EQ(last_msg_.data[45], 21) << "incorrect value for last_msg_.data[45], expected 21, is " << last_msg_.data[45]; - EXPECT_EQ(last_msg_.data[46], 214) << "incorrect value for last_msg_.data[46], expected 214, is " << last_msg_.data[46]; - EXPECT_EQ(last_msg_.data[47], 57) << "incorrect value for last_msg_.data[47], expected 57, is " << last_msg_.data[47]; - EXPECT_EQ(last_msg_.data[48], 245) << "incorrect value for last_msg_.data[48], expected 245, is " << last_msg_.data[48]; - EXPECT_EQ(last_msg_.data[49], 246) << "incorrect value for last_msg_.data[49], expected 246, is " << last_msg_.data[49]; - EXPECT_EQ(last_msg_.data[50], 19) << "incorrect value for last_msg_.data[50], expected 19, is " << last_msg_.data[50]; - EXPECT_EQ(last_msg_.data[51], 3) << "incorrect value for last_msg_.data[51], expected 3, is " << last_msg_.data[51]; - EXPECT_EQ(last_msg_.data[52], 121) << "incorrect value for last_msg_.data[52], expected 121, is " << last_msg_.data[52]; - EXPECT_EQ(last_msg_.data[53], 49) << "incorrect value for last_msg_.data[53], expected 49, is " << last_msg_.data[53]; - EXPECT_EQ(last_msg_.data[54], 231) << "incorrect value for last_msg_.data[54], expected 231, is " << last_msg_.data[54]; - EXPECT_EQ(last_msg_.data[55], 37) << "incorrect value for last_msg_.data[55], expected 37, is " << last_msg_.data[55]; - EXPECT_EQ(last_msg_.data[56], 186) << "incorrect value for last_msg_.data[56], expected 186, is " << last_msg_.data[56]; - EXPECT_EQ(last_msg_.data[57], 58) << "incorrect value for last_msg_.data[57], expected 58, is " << last_msg_.data[57]; - EXPECT_EQ(last_msg_.data[58], 238) << "incorrect value for last_msg_.data[58], expected 238, is " << last_msg_.data[58]; - EXPECT_EQ(last_msg_.data[59], 98) << "incorrect value for last_msg_.data[59], expected 98, is " << last_msg_.data[59]; - EXPECT_EQ(last_msg_.data[60], 39) << "incorrect value for last_msg_.data[60], expected 39, is " << last_msg_.data[60]; - EXPECT_EQ(last_msg_.data[61], 70) << "incorrect value for last_msg_.data[61], expected 70, is " << last_msg_.data[61]; - EXPECT_EQ(last_msg_.data[62], 232) << "incorrect value for last_msg_.data[62], expected 232, is " << last_msg_.data[62]; - EXPECT_EQ(last_msg_.data[63], 133) << "incorrect value for last_msg_.data[63], expected 133, is " << last_msg_.data[63]; - EXPECT_EQ(last_msg_.data[64], 25) << "incorrect value for last_msg_.data[64], expected 25, is " << last_msg_.data[64]; - EXPECT_EQ(last_msg_.data[65], 10) << "incorrect value for last_msg_.data[65], expected 10, is " << last_msg_.data[65]; - EXPECT_EQ(last_msg_.data[66], 134) << "incorrect value for last_msg_.data[66], expected 134, is " << last_msg_.data[66]; - EXPECT_EQ(last_msg_.data[67], 129) << "incorrect value for last_msg_.data[67], expected 129, is " << last_msg_.data[67]; - EXPECT_EQ(last_msg_.data[68], 69) << "incorrect value for last_msg_.data[68], expected 69, is " << last_msg_.data[68]; - EXPECT_EQ(last_msg_.data[69], 228) << "incorrect value for last_msg_.data[69], expected 228, is " << last_msg_.data[69]; - EXPECT_EQ(last_msg_.data[70], 134) << "incorrect value for last_msg_.data[70], expected 134, is " << last_msg_.data[70]; - EXPECT_EQ(last_msg_.data[71], 9) << "incorrect value for last_msg_.data[71], expected 9, is " << last_msg_.data[71]; - EXPECT_EQ(last_msg_.data[72], 88) << "incorrect value for last_msg_.data[72], expected 88, is " << last_msg_.data[72]; - EXPECT_EQ(last_msg_.data[73], 183) << "incorrect value for last_msg_.data[73], expected 183, is " << last_msg_.data[73]; - EXPECT_EQ(last_msg_.data[74], 133) << "incorrect value for last_msg_.data[74], expected 133, is " << last_msg_.data[74]; - EXPECT_EQ(last_msg_.data[75], 171) << "incorrect value for last_msg_.data[75], expected 171, is " << last_msg_.data[75]; - EXPECT_EQ(last_msg_.data[76], 255) << "incorrect value for last_msg_.data[76], expected 255, is " << last_msg_.data[76]; - EXPECT_EQ(last_msg_.data[77], 166) << "incorrect value for last_msg_.data[77], expected 166, is " << last_msg_.data[77]; - EXPECT_EQ(last_msg_.data[78], 100) << "incorrect value for last_msg_.data[78], expected 100, is " << last_msg_.data[78]; - EXPECT_EQ(last_msg_.data[79], 152) << "incorrect value for last_msg_.data[79], expected 152, is " << last_msg_.data[79]; - EXPECT_EQ(last_msg_.data[80], 231) << "incorrect value for last_msg_.data[80], expected 231, is " << last_msg_.data[80]; - EXPECT_EQ(last_msg_.data[81], 92) << "incorrect value for last_msg_.data[81], expected 92, is " << last_msg_.data[81]; - EXPECT_EQ(last_msg_.data[82], 9) << "incorrect value for last_msg_.data[82], expected 9, is " << last_msg_.data[82]; - EXPECT_EQ(last_msg_.data[83], 196) << "incorrect value for last_msg_.data[83], expected 196, is " << last_msg_.data[83]; - EXPECT_EQ(last_msg_.data[84], 106) << "incorrect value for last_msg_.data[84], expected 106, is " << last_msg_.data[84]; - EXPECT_EQ(last_msg_.data[85], 246) << "incorrect value for last_msg_.data[85], expected 246, is " << last_msg_.data[85]; - EXPECT_EQ(last_msg_.data[86], 29) << "incorrect value for last_msg_.data[86], expected 29, is " << last_msg_.data[86]; - EXPECT_EQ(last_msg_.data[87], 145) << "incorrect value for last_msg_.data[87], expected 145, is " << last_msg_.data[87]; - EXPECT_EQ(last_msg_.data[88], 156) << "incorrect value for last_msg_.data[88], expected 156, is " << last_msg_.data[88]; - EXPECT_EQ(last_msg_.data[89], 151) << "incorrect value for last_msg_.data[89], expected 151, is " << last_msg_.data[89]; - EXPECT_EQ(last_msg_.data[90], 32) << "incorrect value for last_msg_.data[90], expected 32, is " << last_msg_.data[90]; - EXPECT_EQ(last_msg_.data[91], 67) << "incorrect value for last_msg_.data[91], expected 67, is " << last_msg_.data[91]; - EXPECT_EQ(last_msg_.data[92], 188) << "incorrect value for last_msg_.data[92], expected 188, is " << last_msg_.data[92]; - EXPECT_EQ(last_msg_.data[93], 63) << "incorrect value for last_msg_.data[93], expected 63, is " << last_msg_.data[93]; - EXPECT_EQ(last_msg_.data[94], 233) << "incorrect value for last_msg_.data[94], expected 233, is " << last_msg_.data[94]; - EXPECT_EQ(last_msg_.data[95], 142) << "incorrect value for last_msg_.data[95], expected 142, is " << last_msg_.data[95]; - EXPECT_EQ(last_msg_.data[96], 174) << "incorrect value for last_msg_.data[96], expected 174, is " << last_msg_.data[96]; - EXPECT_EQ(last_msg_.data[97], 139) << "incorrect value for last_msg_.data[97], expected 139, is " << last_msg_.data[97]; - EXPECT_EQ(last_msg_.data[98], 154) << "incorrect value for last_msg_.data[98], expected 154, is " << last_msg_.data[98]; - EXPECT_EQ(last_msg_.data[99], 127) << "incorrect value for last_msg_.data[99], expected 127, is " << last_msg_.data[99]; - EXPECT_EQ(last_msg_.data[100], 35) << "incorrect value for last_msg_.data[100], expected 35, is " << last_msg_.data[100]; - EXPECT_EQ(last_msg_.data[101], 60) << "incorrect value for last_msg_.data[101], expected 60, is " << last_msg_.data[101]; - EXPECT_EQ(last_msg_.data[102], 56) << "incorrect value for last_msg_.data[102], expected 56, is " << last_msg_.data[102]; - EXPECT_EQ(last_msg_.data[103], 187) << "incorrect value for last_msg_.data[103], expected 187, is " << last_msg_.data[103]; - EXPECT_EQ(last_msg_.data[104], 121) << "incorrect value for last_msg_.data[104], expected 121, is " << last_msg_.data[104]; - EXPECT_EQ(last_msg_.data[105], 103) << "incorrect value for last_msg_.data[105], expected 103, is " << last_msg_.data[105]; - EXPECT_EQ(last_msg_.data[106], 135) << "incorrect value for last_msg_.data[106], expected 135, is " << last_msg_.data[106]; - EXPECT_EQ(last_msg_.data[107], 152) << "incorrect value for last_msg_.data[107], expected 152, is " << last_msg_.data[107]; - EXPECT_EQ(last_msg_.data[108], 182) << "incorrect value for last_msg_.data[108], expected 182, is " << last_msg_.data[108]; - EXPECT_EQ(last_msg_.data[109], 88) << "incorrect value for last_msg_.data[109], expected 88, is " << last_msg_.data[109]; - EXPECT_EQ(last_msg_.data[110], 160) << "incorrect value for last_msg_.data[110], expected 160, is " << last_msg_.data[110]; - EXPECT_EQ(last_msg_.data[111], 255) << "incorrect value for last_msg_.data[111], expected 255, is " << last_msg_.data[111]; - EXPECT_EQ(last_msg_.data[112], 227) << "incorrect value for last_msg_.data[112], expected 227, is " << last_msg_.data[112]; - EXPECT_EQ(last_msg_.data[113], 240) << "incorrect value for last_msg_.data[113], expected 240, is " << last_msg_.data[113]; - EXPECT_EQ(last_msg_.data[114], 54) << "incorrect value for last_msg_.data[114], expected 54, is " << last_msg_.data[114]; - EXPECT_EQ(last_msg_.data[115], 100) << "incorrect value for last_msg_.data[115], expected 100, is " << last_msg_.data[115]; - EXPECT_EQ(last_msg_.data[116], 91) << "incorrect value for last_msg_.data[116], expected 91, is " << last_msg_.data[116]; - EXPECT_EQ(last_msg_.data[117], 31) << "incorrect value for last_msg_.data[117], expected 31, is " << last_msg_.data[117]; - EXPECT_EQ(last_msg_.data[118], 141) << "incorrect value for last_msg_.data[118], expected 141, is " << last_msg_.data[118]; - EXPECT_EQ(last_msg_.data[119], 102) << "incorrect value for last_msg_.data[119], expected 102, is " << last_msg_.data[119]; - EXPECT_EQ(last_msg_.data[120], 130) << "incorrect value for last_msg_.data[120], expected 130, is " << last_msg_.data[120]; - EXPECT_EQ(last_msg_.data[121], 254) << "incorrect value for last_msg_.data[121], expected 254, is " << last_msg_.data[121]; - EXPECT_EQ(last_msg_.data[122], 54) << "incorrect value for last_msg_.data[122], expected 54, is " << last_msg_.data[122]; - EXPECT_EQ(last_msg_.data[123], 227) << "incorrect value for last_msg_.data[123], expected 227, is " << last_msg_.data[123]; - EXPECT_EQ(last_msg_.data[124], 229) << "incorrect value for last_msg_.data[124], expected 229, is " << last_msg_.data[124]; - EXPECT_EQ(last_msg_.data[125], 62) << "incorrect value for last_msg_.data[125], expected 62, is " << last_msg_.data[125]; - EXPECT_EQ(last_msg_.data[126], 53) << "incorrect value for last_msg_.data[126], expected 53, is " << last_msg_.data[126]; - EXPECT_EQ(last_msg_.data[127], 225) << "incorrect value for last_msg_.data[127], expected 225, is " << last_msg_.data[127]; - EXPECT_EQ(last_msg_.data[128], 143) << "incorrect value for last_msg_.data[128], expected 143, is " << last_msg_.data[128]; - EXPECT_EQ(last_msg_.data[129], 88) << "incorrect value for last_msg_.data[129], expected 88, is " << last_msg_.data[129]; - EXPECT_EQ(last_msg_.data[130], 139) << "incorrect value for last_msg_.data[130], expected 139, is " << last_msg_.data[130]; - EXPECT_EQ(last_msg_.data[131], 126) << "incorrect value for last_msg_.data[131], expected 126, is " << last_msg_.data[131]; - EXPECT_EQ(last_msg_.data[132], 235) << "incorrect value for last_msg_.data[132], expected 235, is " << last_msg_.data[132]; - EXPECT_EQ(last_msg_.data[133], 235) << "incorrect value for last_msg_.data[133], expected 235, is " << last_msg_.data[133]; - EXPECT_EQ(last_msg_.data[134], 35) << "incorrect value for last_msg_.data[134], expected 35, is " << last_msg_.data[134]; - EXPECT_EQ(last_msg_.data[135], 54) << "incorrect value for last_msg_.data[135], expected 54, is " << last_msg_.data[135]; - EXPECT_EQ(last_msg_.data[136], 134) << "incorrect value for last_msg_.data[136], expected 134, is " << last_msg_.data[136]; - EXPECT_EQ(last_msg_.data[137], 163) << "incorrect value for last_msg_.data[137], expected 163, is " << last_msg_.data[137]; - EXPECT_EQ(last_msg_.data[138], 92) << "incorrect value for last_msg_.data[138], expected 92, is " << last_msg_.data[138]; - EXPECT_EQ(last_msg_.data[139], 57) << "incorrect value for last_msg_.data[139], expected 57, is " << last_msg_.data[139]; - EXPECT_EQ(last_msg_.data[140], 87) << "incorrect value for last_msg_.data[140], expected 87, is " << last_msg_.data[140]; - EXPECT_EQ(last_msg_.data[141], 130) << "incorrect value for last_msg_.data[141], expected 130, is " << last_msg_.data[141]; - EXPECT_EQ(last_msg_.data[142], 178) << "incorrect value for last_msg_.data[142], expected 178, is " << last_msg_.data[142]; - EXPECT_EQ(last_msg_.data[143], 22) << "incorrect value for last_msg_.data[143], expected 22, is " << last_msg_.data[143]; - EXPECT_EQ(last_msg_.data[144], 158) << "incorrect value for last_msg_.data[144], expected 158, is " << last_msg_.data[144]; - EXPECT_EQ(last_msg_.data[145], 18) << "incorrect value for last_msg_.data[145], expected 18, is " << last_msg_.data[145]; - EXPECT_EQ(last_msg_.data[146], 237) << "incorrect value for last_msg_.data[146], expected 237, is " << last_msg_.data[146]; - EXPECT_EQ(last_msg_.data[147], 209) << "incorrect value for last_msg_.data[147], expected 209, is " << last_msg_.data[147]; - EXPECT_EQ(last_msg_.data[148], 187) << "incorrect value for last_msg_.data[148], expected 187, is " << last_msg_.data[148]; - EXPECT_EQ(last_msg_.data[149], 226) << "incorrect value for last_msg_.data[149], expected 226, is " << last_msg_.data[149]; - EXPECT_EQ(last_msg_.data[150], 1) << "incorrect value for last_msg_.data[150], expected 1, is " << last_msg_.data[150]; - EXPECT_EQ(last_msg_.data[151], 46) << "incorrect value for last_msg_.data[151], expected 46, is " << last_msg_.data[151]; - EXPECT_EQ(last_msg_.data[152], 64) << "incorrect value for last_msg_.data[152], expected 64, is " << last_msg_.data[152]; - EXPECT_EQ(last_msg_.data[153], 226) << "incorrect value for last_msg_.data[153], expected 226, is " << last_msg_.data[153]; - EXPECT_EQ(last_msg_.data[154], 235) << "incorrect value for last_msg_.data[154], expected 235, is " << last_msg_.data[154]; - EXPECT_EQ(last_msg_.data[155], 213) << "incorrect value for last_msg_.data[155], expected 213, is " << last_msg_.data[155]; - EXPECT_EQ(last_msg_.data[156], 186) << "incorrect value for last_msg_.data[156], expected 186, is " << last_msg_.data[156]; - EXPECT_EQ(last_msg_.data[157], 159) << "incorrect value for last_msg_.data[157], expected 159, is " << last_msg_.data[157]; - EXPECT_EQ(last_msg_.data[158], 221) << "incorrect value for last_msg_.data[158], expected 221, is " << last_msg_.data[158]; - EXPECT_EQ(last_msg_.data[159], 186) << "incorrect value for last_msg_.data[159], expected 186, is " << last_msg_.data[159]; - EXPECT_EQ(last_msg_.data[160], 25) << "incorrect value for last_msg_.data[160], expected 25, is " << last_msg_.data[160]; - EXPECT_EQ(last_msg_.data[161], 115) << "incorrect value for last_msg_.data[161], expected 115, is " << last_msg_.data[161]; - EXPECT_EQ(last_msg_.data[162], 84) << "incorrect value for last_msg_.data[162], expected 84, is " << last_msg_.data[162]; - EXPECT_EQ(last_msg_.data[163], 131) << "incorrect value for last_msg_.data[163], expected 131, is " << last_msg_.data[163]; - EXPECT_EQ(last_msg_.data[164], 167) << "incorrect value for last_msg_.data[164], expected 167, is " << last_msg_.data[164]; - EXPECT_EQ(last_msg_.data[165], 201) << "incorrect value for last_msg_.data[165], expected 201, is " << last_msg_.data[165]; - EXPECT_EQ(last_msg_.data[166], 104) << "incorrect value for last_msg_.data[166], expected 104, is " << last_msg_.data[166]; - EXPECT_EQ(last_msg_.data[167], 1) << "incorrect value for last_msg_.data[167], expected 1, is " << last_msg_.data[167]; - EXPECT_EQ(last_msg_.data[168], 200) << "incorrect value for last_msg_.data[168], expected 200, is " << last_msg_.data[168]; - EXPECT_EQ(last_msg_.data[169], 13) << "incorrect value for last_msg_.data[169], expected 13, is " << last_msg_.data[169]; - EXPECT_EQ(last_msg_.data[170], 50) << "incorrect value for last_msg_.data[170], expected 50, is " << last_msg_.data[170]; - EXPECT_EQ(last_msg_.data[171], 71) << "incorrect value for last_msg_.data[171], expected 71, is " << last_msg_.data[171]; - EXPECT_EQ(last_msg_.data[172], 73) << "incorrect value for last_msg_.data[172], expected 73, is " << last_msg_.data[172]; - EXPECT_EQ(last_msg_.data[173], 193) << "incorrect value for last_msg_.data[173], expected 193, is " << last_msg_.data[173]; - EXPECT_EQ(last_msg_.data[174], 201) << "incorrect value for last_msg_.data[174], expected 201, is " << last_msg_.data[174]; - EXPECT_EQ(last_msg_.data[175], 250) << "incorrect value for last_msg_.data[175], expected 250, is " << last_msg_.data[175]; - EXPECT_EQ(last_msg_.data[176], 172) << "incorrect value for last_msg_.data[176], expected 172, is " << last_msg_.data[176]; - EXPECT_EQ(last_msg_.data[177], 193) << "incorrect value for last_msg_.data[177], expected 193, is " << last_msg_.data[177]; - EXPECT_EQ(last_msg_.data[178], 13) << "incorrect value for last_msg_.data[178], expected 13, is " << last_msg_.data[178]; - EXPECT_EQ(last_msg_.data[179], 20) << "incorrect value for last_msg_.data[179], expected 20, is " << last_msg_.data[179]; - EXPECT_EQ(last_msg_.data[180], 238) << "incorrect value for last_msg_.data[180], expected 238, is " << last_msg_.data[180]; - EXPECT_EQ(last_msg_.data[181], 130) << "incorrect value for last_msg_.data[181], expected 130, is " << last_msg_.data[181]; - EXPECT_EQ(last_msg_.data[182], 243) << "incorrect value for last_msg_.data[182], expected 243, is " << last_msg_.data[182]; - EXPECT_EQ(last_msg_.data[183], 68) << "incorrect value for last_msg_.data[183], expected 68, is " << last_msg_.data[183]; - EXPECT_EQ(last_msg_.data[184], 4) << "incorrect value for last_msg_.data[184], expected 4, is " << last_msg_.data[184]; - EXPECT_EQ(last_msg_.data[185], 72) << "incorrect value for last_msg_.data[185], expected 72, is " << last_msg_.data[185]; - EXPECT_EQ(last_msg_.data[186], 46) << "incorrect value for last_msg_.data[186], expected 46, is " << last_msg_.data[186]; - EXPECT_EQ(last_msg_.data[187], 194) << "incorrect value for last_msg_.data[187], expected 194, is " << last_msg_.data[187]; - EXPECT_EQ(last_msg_.data[188], 113) << "incorrect value for last_msg_.data[188], expected 113, is " << last_msg_.data[188]; - EXPECT_EQ(last_msg_.data[189], 255) << "incorrect value for last_msg_.data[189], expected 255, is " << last_msg_.data[189]; - EXPECT_EQ(last_msg_.data[190], 238) << "incorrect value for last_msg_.data[190], expected 238, is " << last_msg_.data[190]; - EXPECT_EQ(last_msg_.data[191], 15) << "incorrect value for last_msg_.data[191], expected 15, is " << last_msg_.data[191]; - EXPECT_EQ(last_msg_.data[192], 230) << "incorrect value for last_msg_.data[192], expected 230, is " << last_msg_.data[192]; - EXPECT_EQ(last_msg_.data[193], 64) << "incorrect value for last_msg_.data[193], expected 64, is " << last_msg_.data[193]; - EXPECT_EQ(last_msg_.data[194], 178) << "incorrect value for last_msg_.data[194], expected 178, is " << last_msg_.data[194]; - EXPECT_EQ(last_msg_.data[195], 127) << "incorrect value for last_msg_.data[195], expected 127, is " << last_msg_.data[195]; - EXPECT_EQ(last_msg_.data[196], 217) << "incorrect value for last_msg_.data[196], expected 217, is " << last_msg_.data[196]; - EXPECT_EQ(last_msg_.data[197], 92) << "incorrect value for last_msg_.data[197], expected 92, is " << last_msg_.data[197]; - EXPECT_EQ(last_msg_.data[198], 160) << "incorrect value for last_msg_.data[198], expected 160, is " << last_msg_.data[198]; - EXPECT_EQ(last_msg_.data[199], 201) << "incorrect value for last_msg_.data[199], expected 201, is " << last_msg_.data[199]; - EXPECT_EQ(last_msg_.data[200], 118) << "incorrect value for last_msg_.data[200], expected 118, is " << last_msg_.data[200]; - EXPECT_EQ(last_msg_.data[201], 163) << "incorrect value for last_msg_.data[201], expected 163, is " << last_msg_.data[201]; - EXPECT_EQ(last_msg_.data[202], 144) << "incorrect value for last_msg_.data[202], expected 144, is " << last_msg_.data[202]; - EXPECT_EQ(last_msg_.data[203], 58) << "incorrect value for last_msg_.data[203], expected 58, is " << last_msg_.data[203]; - EXPECT_EQ(last_msg_.data[204], 28) << "incorrect value for last_msg_.data[204], expected 28, is " << last_msg_.data[204]; - EXPECT_EQ(last_msg_.data[205], 174) << "incorrect value for last_msg_.data[205], expected 174, is " << last_msg_.data[205]; - EXPECT_EQ(last_msg_.data[206], 65) << "incorrect value for last_msg_.data[206], expected 65, is " << last_msg_.data[206]; - EXPECT_EQ(last_msg_.data[207], 73) << "incorrect value for last_msg_.data[207], expected 73, is " << last_msg_.data[207]; - EXPECT_EQ(last_msg_.data[208], 45) << "incorrect value for last_msg_.data[208], expected 45, is " << last_msg_.data[208]; - EXPECT_EQ(last_msg_.data[209], 123) << "incorrect value for last_msg_.data[209], expected 123, is " << last_msg_.data[209]; - EXPECT_EQ(last_msg_.data[210], 118) << "incorrect value for last_msg_.data[210], expected 118, is " << last_msg_.data[210]; - EXPECT_EQ(last_msg_.data[211], 83) << "incorrect value for last_msg_.data[211], expected 83, is " << last_msg_.data[211]; - EXPECT_EQ(last_msg_.data[212], 107) << "incorrect value for last_msg_.data[212], expected 107, is " << last_msg_.data[212]; - EXPECT_EQ(last_msg_.data[213], 239) << "incorrect value for last_msg_.data[213], expected 239, is " << last_msg_.data[213]; - EXPECT_EQ(last_msg_.data[214], 168) << "incorrect value for last_msg_.data[214], expected 168, is " << last_msg_.data[214]; - EXPECT_EQ(last_msg_.data[215], 32) << "incorrect value for last_msg_.data[215], expected 32, is " << last_msg_.data[215]; - EXPECT_EQ(last_msg_.data[216], 212) << "incorrect value for last_msg_.data[216], expected 212, is " << last_msg_.data[216]; - EXPECT_EQ(last_msg_.data[217], 191) << "incorrect value for last_msg_.data[217], expected 191, is " << last_msg_.data[217]; - EXPECT_EQ(last_msg_.data[218], 81) << "incorrect value for last_msg_.data[218], expected 81, is " << last_msg_.data[218]; - EXPECT_EQ(last_msg_.data[219], 93) << "incorrect value for last_msg_.data[219], expected 93, is " << last_msg_.data[219]; - EXPECT_EQ(last_msg_.data[220], 186) << "incorrect value for last_msg_.data[220], expected 186, is " << last_msg_.data[220]; - EXPECT_EQ(last_msg_.data[221], 223) << "incorrect value for last_msg_.data[221], expected 223, is " << last_msg_.data[221]; - EXPECT_EQ(last_msg_.data[222], 32) << "incorrect value for last_msg_.data[222], expected 32, is " << last_msg_.data[222]; - EXPECT_EQ(last_msg_.data[223], 19) << "incorrect value for last_msg_.data[223], expected 19, is " << last_msg_.data[223]; - EXPECT_EQ(last_msg_.data[224], 58) << "incorrect value for last_msg_.data[224], expected 58, is " << last_msg_.data[224]; - EXPECT_EQ(last_msg_.data[225], 137) << "incorrect value for last_msg_.data[225], expected 137, is " << last_msg_.data[225]; - EXPECT_EQ(last_msg_.data[226], 72) << "incorrect value for last_msg_.data[226], expected 72, is " << last_msg_.data[226]; - EXPECT_EQ(last_msg_.data[227], 217) << "incorrect value for last_msg_.data[227], expected 217, is " << last_msg_.data[227]; - EXPECT_EQ(last_msg_.data[228], 151) << "incorrect value for last_msg_.data[228], expected 151, is " << last_msg_.data[228]; - EXPECT_EQ(last_msg_.data[229], 251) << "incorrect value for last_msg_.data[229], expected 251, is " << last_msg_.data[229]; - EXPECT_EQ(last_msg_.data[230], 83) << "incorrect value for last_msg_.data[230], expected 83, is " << last_msg_.data[230]; - EXPECT_EQ(last_msg_.data[231], 20) << "incorrect value for last_msg_.data[231], expected 20, is " << last_msg_.data[231]; - EXPECT_EQ(last_msg_.data[232], 113) << "incorrect value for last_msg_.data[232], expected 113, is " << last_msg_.data[232]; - EXPECT_EQ(last_msg_.data[233], 37) << "incorrect value for last_msg_.data[233], expected 37, is " << last_msg_.data[233]; - EXPECT_EQ(last_msg_.data[234], 151) << "incorrect value for last_msg_.data[234], expected 151, is " << last_msg_.data[234]; - EXPECT_EQ(last_msg_.data[235], 34) << "incorrect value for last_msg_.data[235], expected 34, is " << last_msg_.data[235]; - EXPECT_EQ(last_msg_.data[236], 37) << "incorrect value for last_msg_.data[236], expected 37, is " << last_msg_.data[236]; - EXPECT_EQ(last_msg_.data[237], 71) << "incorrect value for last_msg_.data[237], expected 71, is " << last_msg_.data[237]; - EXPECT_EQ(last_msg_.data[238], 95) << "incorrect value for last_msg_.data[238], expected 95, is " << last_msg_.data[238]; - EXPECT_EQ(last_msg_.data[239], 105) << "incorrect value for last_msg_.data[239], expected 105, is " << last_msg_.data[239]; - EXPECT_EQ(last_msg_.data[240], 235) << "incorrect value for last_msg_.data[240], expected 235, is " << last_msg_.data[240]; - EXPECT_EQ(last_msg_.data[241], 144) << "incorrect value for last_msg_.data[241], expected 144, is " << last_msg_.data[241]; - EXPECT_EQ(last_msg_.data[242], 164) << "incorrect value for last_msg_.data[242], expected 164, is " << last_msg_.data[242]; - EXPECT_EQ(last_msg_.data[243], 83) << "incorrect value for last_msg_.data[243], expected 83, is " << last_msg_.data[243]; - EXPECT_EQ(last_msg_.data[244], 197) << "incorrect value for last_msg_.data[244], expected 197, is " << last_msg_.data[244]; - EXPECT_EQ(last_msg_.data[245], 254) << "incorrect value for last_msg_.data[245], expected 254, is " << last_msg_.data[245]; - EXPECT_EQ(last_msg_.data[246], 183) << "incorrect value for last_msg_.data[246], expected 183, is " << last_msg_.data[246]; - EXPECT_EQ(last_msg_.data[247], 223) << "incorrect value for last_msg_.data[247], expected 223, is " << last_msg_.data[247]; - EXPECT_EQ(last_msg_.data[248], 91) << "incorrect value for last_msg_.data[248], expected 91, is " << last_msg_.data[248]; - EXPECT_EQ(last_msg_.data[249], 19) << "incorrect value for last_msg_.data[249], expected 19, is " << last_msg_.data[249]; - EXPECT_EQ(last_msg_.target, 212) << "incorrect value for last_msg_.target, expected 212, is " << last_msg_.target; +}; + +TEST_F(Test_auto_check_sbp_flash_MsgFlashProgram0, Test) { + uint8_t encoded_frame[] = { + 85, 230, 0, 195, 4, 255, 212, 87, 52, 244, 250, 176, 222, 235, 106, + 144, 29, 141, 255, 3, 16, 192, 237, 172, 254, 213, 4, 220, 98, 34, + 222, 230, 214, 6, 217, 172, 122, 46, 13, 38, 240, 236, 60, 121, 47, + 252, 163, 141, 222, 29, 168, 214, 118, 55, 201, 233, 21, 214, 57, 245, + 246, 19, 3, 121, 49, 231, 37, 186, 58, 238, 98, 39, 70, 232, 133, + 25, 10, 134, 129, 69, 228, 134, 9, 88, 183, 133, 171, 255, 166, 100, + 152, 231, 92, 9, 196, 106, 246, 29, 145, 156, 151, 32, 67, 188, 63, + 233, 142, 174, 139, 154, 127, 35, 60, 56, 187, 121, 103, 135, 152, 182, + 88, 160, 255, 227, 240, 54, 100, 91, 31, 141, 102, 130, 254, 54, 227, + 229, 62, 53, 225, 143, 88, 139, 126, 235, 235, 35, 54, 134, 163, 92, + 57, 87, 130, 178, 22, 158, 18, 237, 209, 187, 226, 1, 46, 64, 226, + 235, 213, 186, 159, 221, 186, 25, 115, 84, 131, 167, 201, 104, 1, 200, + 13, 50, 71, 73, 193, 201, 250, 172, 193, 13, 20, 238, 130, 243, 68, + 4, 72, 46, 194, 113, 255, 238, 15, 230, 64, 178, 127, 217, 92, 160, + 201, 118, 163, 144, 58, 28, 174, 65, 73, 45, 123, 118, 83, 107, 239, + 168, 32, 212, 191, 81, 93, 186, 223, 32, 19, 58, 137, 72, 217, 151, + 251, 83, 20, 113, 37, 151, 34, 37, 71, 95, 105, 235, 144, 164, 83, + 197, 254, 183, 223, 91, 19, 45, 227, + }; + + sbp_msg_flash_program_t test_msg{}; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.addr_len.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)100, (char)97, (char)116, (char)97}; + memcpy(test_msg.addr_len.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.addr_len.value = 250; + + test_msg.addr_start[0] = 87; + + test_msg.addr_start[1] = 52; + + test_msg.addr_start[2] = 244; + + test_msg.data[0] = 176; + + test_msg.data[1] = 222; + + test_msg.data[2] = 235; + + test_msg.data[3] = 106; + + test_msg.data[4] = 144; + + test_msg.data[5] = 29; + + test_msg.data[6] = 141; + + test_msg.data[7] = 255; + + test_msg.data[8] = 3; + + test_msg.data[9] = 16; + + test_msg.data[10] = 192; + + test_msg.data[11] = 237; + + test_msg.data[12] = 172; + + test_msg.data[13] = 254; + + test_msg.data[14] = 213; + + test_msg.data[15] = 4; + + test_msg.data[16] = 220; + + test_msg.data[17] = 98; + + test_msg.data[18] = 34; + + test_msg.data[19] = 222; + + test_msg.data[20] = 230; + + test_msg.data[21] = 214; + + test_msg.data[22] = 6; + + test_msg.data[23] = 217; + + test_msg.data[24] = 172; + + test_msg.data[25] = 122; + + test_msg.data[26] = 46; + + test_msg.data[27] = 13; + + test_msg.data[28] = 38; + + test_msg.data[29] = 240; + + test_msg.data[30] = 236; + + test_msg.data[31] = 60; + + test_msg.data[32] = 121; + + test_msg.data[33] = 47; + + test_msg.data[34] = 252; + + test_msg.data[35] = 163; + + test_msg.data[36] = 141; + + test_msg.data[37] = 222; + + test_msg.data[38] = 29; + + test_msg.data[39] = 168; + + test_msg.data[40] = 214; + + test_msg.data[41] = 118; + + test_msg.data[42] = 55; + + test_msg.data[43] = 201; + + test_msg.data[44] = 233; + + test_msg.data[45] = 21; + + test_msg.data[46] = 214; + + test_msg.data[47] = 57; + + test_msg.data[48] = 245; + + test_msg.data[49] = 246; + + test_msg.data[50] = 19; + + test_msg.data[51] = 3; + + test_msg.data[52] = 121; + + test_msg.data[53] = 49; + + test_msg.data[54] = 231; + + test_msg.data[55] = 37; + + test_msg.data[56] = 186; + + test_msg.data[57] = 58; + + test_msg.data[58] = 238; + + test_msg.data[59] = 98; + + test_msg.data[60] = 39; + + test_msg.data[61] = 70; + + test_msg.data[62] = 232; + + test_msg.data[63] = 133; + + test_msg.data[64] = 25; + + test_msg.data[65] = 10; + + test_msg.data[66] = 134; + + test_msg.data[67] = 129; + + test_msg.data[68] = 69; + + test_msg.data[69] = 228; + + test_msg.data[70] = 134; + + test_msg.data[71] = 9; + + test_msg.data[72] = 88; + + test_msg.data[73] = 183; + + test_msg.data[74] = 133; + + test_msg.data[75] = 171; + + test_msg.data[76] = 255; + + test_msg.data[77] = 166; + + test_msg.data[78] = 100; + + test_msg.data[79] = 152; + + test_msg.data[80] = 231; + + test_msg.data[81] = 92; + + test_msg.data[82] = 9; + + test_msg.data[83] = 196; + + test_msg.data[84] = 106; + + test_msg.data[85] = 246; + + test_msg.data[86] = 29; + + test_msg.data[87] = 145; + + test_msg.data[88] = 156; + + test_msg.data[89] = 151; + + test_msg.data[90] = 32; + + test_msg.data[91] = 67; + + test_msg.data[92] = 188; + + test_msg.data[93] = 63; + + test_msg.data[94] = 233; + + test_msg.data[95] = 142; + + test_msg.data[96] = 174; + + test_msg.data[97] = 139; + + test_msg.data[98] = 154; + + test_msg.data[99] = 127; + + test_msg.data[100] = 35; + + test_msg.data[101] = 60; + + test_msg.data[102] = 56; + + test_msg.data[103] = 187; + + test_msg.data[104] = 121; + + test_msg.data[105] = 103; + + test_msg.data[106] = 135; + + test_msg.data[107] = 152; + + test_msg.data[108] = 182; + + test_msg.data[109] = 88; + + test_msg.data[110] = 160; + + test_msg.data[111] = 255; + + test_msg.data[112] = 227; + + test_msg.data[113] = 240; + + test_msg.data[114] = 54; + + test_msg.data[115] = 100; + + test_msg.data[116] = 91; + + test_msg.data[117] = 31; + + test_msg.data[118] = 141; + + test_msg.data[119] = 102; + + test_msg.data[120] = 130; + + test_msg.data[121] = 254; + + test_msg.data[122] = 54; + + test_msg.data[123] = 227; + + test_msg.data[124] = 229; + + test_msg.data[125] = 62; + + test_msg.data[126] = 53; + + test_msg.data[127] = 225; + + test_msg.data[128] = 143; + + test_msg.data[129] = 88; + + test_msg.data[130] = 139; + + test_msg.data[131] = 126; + + test_msg.data[132] = 235; + + test_msg.data[133] = 235; + + test_msg.data[134] = 35; + + test_msg.data[135] = 54; + + test_msg.data[136] = 134; + + test_msg.data[137] = 163; + + test_msg.data[138] = 92; + + test_msg.data[139] = 57; + + test_msg.data[140] = 87; + + test_msg.data[141] = 130; + + test_msg.data[142] = 178; + + test_msg.data[143] = 22; + + test_msg.data[144] = 158; + + test_msg.data[145] = 18; + + test_msg.data[146] = 237; + + test_msg.data[147] = 209; + + test_msg.data[148] = 187; + + test_msg.data[149] = 226; + + test_msg.data[150] = 1; + + test_msg.data[151] = 46; + + test_msg.data[152] = 64; + + test_msg.data[153] = 226; + + test_msg.data[154] = 235; + + test_msg.data[155] = 213; + + test_msg.data[156] = 186; + + test_msg.data[157] = 159; + + test_msg.data[158] = 221; + + test_msg.data[159] = 186; + + test_msg.data[160] = 25; + + test_msg.data[161] = 115; + + test_msg.data[162] = 84; + + test_msg.data[163] = 131; + + test_msg.data[164] = 167; + + test_msg.data[165] = 201; + + test_msg.data[166] = 104; + + test_msg.data[167] = 1; + + test_msg.data[168] = 200; + + test_msg.data[169] = 13; + + test_msg.data[170] = 50; + + test_msg.data[171] = 71; + + test_msg.data[172] = 73; + + test_msg.data[173] = 193; + + test_msg.data[174] = 201; + + test_msg.data[175] = 250; + + test_msg.data[176] = 172; + + test_msg.data[177] = 193; + + test_msg.data[178] = 13; + + test_msg.data[179] = 20; + + test_msg.data[180] = 238; + + test_msg.data[181] = 130; + + test_msg.data[182] = 243; + + test_msg.data[183] = 68; + + test_msg.data[184] = 4; + + test_msg.data[185] = 72; + + test_msg.data[186] = 46; + + test_msg.data[187] = 194; + + test_msg.data[188] = 113; + + test_msg.data[189] = 255; + + test_msg.data[190] = 238; + + test_msg.data[191] = 15; + + test_msg.data[192] = 230; + + test_msg.data[193] = 64; + + test_msg.data[194] = 178; + + test_msg.data[195] = 127; + + test_msg.data[196] = 217; + + test_msg.data[197] = 92; + + test_msg.data[198] = 160; + + test_msg.data[199] = 201; + + test_msg.data[200] = 118; + + test_msg.data[201] = 163; + + test_msg.data[202] = 144; + + test_msg.data[203] = 58; + + test_msg.data[204] = 28; + + test_msg.data[205] = 174; + + test_msg.data[206] = 65; + + test_msg.data[207] = 73; + + test_msg.data[208] = 45; + + test_msg.data[209] = 123; + + test_msg.data[210] = 118; + + test_msg.data[211] = 83; + + test_msg.data[212] = 107; + + test_msg.data[213] = 239; + + test_msg.data[214] = 168; + + test_msg.data[215] = 32; + + test_msg.data[216] = 212; + + test_msg.data[217] = 191; + + test_msg.data[218] = 81; + + test_msg.data[219] = 93; + + test_msg.data[220] = 186; + + test_msg.data[221] = 223; + + test_msg.data[222] = 32; + + test_msg.data[223] = 19; + + test_msg.data[224] = 58; + + test_msg.data[225] = 137; + + test_msg.data[226] = 72; + + test_msg.data[227] = 217; + + test_msg.data[228] = 151; + + test_msg.data[229] = 251; + + test_msg.data[230] = 83; + + test_msg.data[231] = 20; + + test_msg.data[232] = 113; + + test_msg.data[233] = 37; + + test_msg.data[234] = 151; + + test_msg.data[235] = 34; + + test_msg.data[236] = 37; + + test_msg.data[237] = 71; + + test_msg.data[238] = 95; + + test_msg.data[239] = 105; + + test_msg.data[240] = 235; + + test_msg.data[241] = 144; + + test_msg.data[242] = 164; + + test_msg.data[243] = 83; + + test_msg.data[244] = 197; + + test_msg.data[245] = 254; + + test_msg.data[246] = 183; + + test_msg.data[247] = 223; + + test_msg.data[248] = 91; + + test_msg.data[249] = 19; + test_msg.target = 212; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.addr_len.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.addr_len.handle_as, expected string '" + << check_string << "', is '" << last_msg_.addr_len.handle_as << "'"; + } + { + const char check_string[] = {(char)100, (char)97, (char)116, (char)97}; + EXPECT_EQ(memcmp(last_msg_.addr_len.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.addr_len.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.addr_len.relates_to << "'"; + } + EXPECT_EQ(last_msg_.addr_len.value, 250) + << "incorrect value for last_msg_.addr_len.value, expected 250, is " + << last_msg_.addr_len.value; + EXPECT_EQ(last_msg_.addr_start[0], 87) + << "incorrect value for last_msg_.addr_start[0], expected 87, is " + << last_msg_.addr_start[0]; + EXPECT_EQ(last_msg_.addr_start[1], 52) + << "incorrect value for last_msg_.addr_start[1], expected 52, is " + << last_msg_.addr_start[1]; + EXPECT_EQ(last_msg_.addr_start[2], 244) + << "incorrect value for last_msg_.addr_start[2], expected 244, is " + << last_msg_.addr_start[2]; + EXPECT_EQ(last_msg_.data[0], 176) + << "incorrect value for last_msg_.data[0], expected 176, is " + << last_msg_.data[0]; + EXPECT_EQ(last_msg_.data[1], 222) + << "incorrect value for last_msg_.data[1], expected 222, is " + << last_msg_.data[1]; + EXPECT_EQ(last_msg_.data[2], 235) + << "incorrect value for last_msg_.data[2], expected 235, is " + << last_msg_.data[2]; + EXPECT_EQ(last_msg_.data[3], 106) + << "incorrect value for last_msg_.data[3], expected 106, is " + << last_msg_.data[3]; + EXPECT_EQ(last_msg_.data[4], 144) + << "incorrect value for last_msg_.data[4], expected 144, is " + << last_msg_.data[4]; + EXPECT_EQ(last_msg_.data[5], 29) + << "incorrect value for last_msg_.data[5], expected 29, is " + << last_msg_.data[5]; + EXPECT_EQ(last_msg_.data[6], 141) + << "incorrect value for last_msg_.data[6], expected 141, is " + << last_msg_.data[6]; + EXPECT_EQ(last_msg_.data[7], 255) + << "incorrect value for last_msg_.data[7], expected 255, is " + << last_msg_.data[7]; + EXPECT_EQ(last_msg_.data[8], 3) + << "incorrect value for last_msg_.data[8], expected 3, is " + << last_msg_.data[8]; + EXPECT_EQ(last_msg_.data[9], 16) + << "incorrect value for last_msg_.data[9], expected 16, is " + << last_msg_.data[9]; + EXPECT_EQ(last_msg_.data[10], 192) + << "incorrect value for last_msg_.data[10], expected 192, is " + << last_msg_.data[10]; + EXPECT_EQ(last_msg_.data[11], 237) + << "incorrect value for last_msg_.data[11], expected 237, is " + << last_msg_.data[11]; + EXPECT_EQ(last_msg_.data[12], 172) + << "incorrect value for last_msg_.data[12], expected 172, is " + << last_msg_.data[12]; + EXPECT_EQ(last_msg_.data[13], 254) + << "incorrect value for last_msg_.data[13], expected 254, is " + << last_msg_.data[13]; + EXPECT_EQ(last_msg_.data[14], 213) + << "incorrect value for last_msg_.data[14], expected 213, is " + << last_msg_.data[14]; + EXPECT_EQ(last_msg_.data[15], 4) + << "incorrect value for last_msg_.data[15], expected 4, is " + << last_msg_.data[15]; + EXPECT_EQ(last_msg_.data[16], 220) + << "incorrect value for last_msg_.data[16], expected 220, is " + << last_msg_.data[16]; + EXPECT_EQ(last_msg_.data[17], 98) + << "incorrect value for last_msg_.data[17], expected 98, is " + << last_msg_.data[17]; + EXPECT_EQ(last_msg_.data[18], 34) + << "incorrect value for last_msg_.data[18], expected 34, is " + << last_msg_.data[18]; + EXPECT_EQ(last_msg_.data[19], 222) + << "incorrect value for last_msg_.data[19], expected 222, is " + << last_msg_.data[19]; + EXPECT_EQ(last_msg_.data[20], 230) + << "incorrect value for last_msg_.data[20], expected 230, is " + << last_msg_.data[20]; + EXPECT_EQ(last_msg_.data[21], 214) + << "incorrect value for last_msg_.data[21], expected 214, is " + << last_msg_.data[21]; + EXPECT_EQ(last_msg_.data[22], 6) + << "incorrect value for last_msg_.data[22], expected 6, is " + << last_msg_.data[22]; + EXPECT_EQ(last_msg_.data[23], 217) + << "incorrect value for last_msg_.data[23], expected 217, is " + << last_msg_.data[23]; + EXPECT_EQ(last_msg_.data[24], 172) + << "incorrect value for last_msg_.data[24], expected 172, is " + << last_msg_.data[24]; + EXPECT_EQ(last_msg_.data[25], 122) + << "incorrect value for last_msg_.data[25], expected 122, is " + << last_msg_.data[25]; + EXPECT_EQ(last_msg_.data[26], 46) + << "incorrect value for last_msg_.data[26], expected 46, is " + << last_msg_.data[26]; + EXPECT_EQ(last_msg_.data[27], 13) + << "incorrect value for last_msg_.data[27], expected 13, is " + << last_msg_.data[27]; + EXPECT_EQ(last_msg_.data[28], 38) + << "incorrect value for last_msg_.data[28], expected 38, is " + << last_msg_.data[28]; + EXPECT_EQ(last_msg_.data[29], 240) + << "incorrect value for last_msg_.data[29], expected 240, is " + << last_msg_.data[29]; + EXPECT_EQ(last_msg_.data[30], 236) + << "incorrect value for last_msg_.data[30], expected 236, is " + << last_msg_.data[30]; + EXPECT_EQ(last_msg_.data[31], 60) + << "incorrect value for last_msg_.data[31], expected 60, is " + << last_msg_.data[31]; + EXPECT_EQ(last_msg_.data[32], 121) + << "incorrect value for last_msg_.data[32], expected 121, is " + << last_msg_.data[32]; + EXPECT_EQ(last_msg_.data[33], 47) + << "incorrect value for last_msg_.data[33], expected 47, is " + << last_msg_.data[33]; + EXPECT_EQ(last_msg_.data[34], 252) + << "incorrect value for last_msg_.data[34], expected 252, is " + << last_msg_.data[34]; + EXPECT_EQ(last_msg_.data[35], 163) + << "incorrect value for last_msg_.data[35], expected 163, is " + << last_msg_.data[35]; + EXPECT_EQ(last_msg_.data[36], 141) + << "incorrect value for last_msg_.data[36], expected 141, is " + << last_msg_.data[36]; + EXPECT_EQ(last_msg_.data[37], 222) + << "incorrect value for last_msg_.data[37], expected 222, is " + << last_msg_.data[37]; + EXPECT_EQ(last_msg_.data[38], 29) + << "incorrect value for last_msg_.data[38], expected 29, is " + << last_msg_.data[38]; + EXPECT_EQ(last_msg_.data[39], 168) + << "incorrect value for last_msg_.data[39], expected 168, is " + << last_msg_.data[39]; + EXPECT_EQ(last_msg_.data[40], 214) + << "incorrect value for last_msg_.data[40], expected 214, is " + << last_msg_.data[40]; + EXPECT_EQ(last_msg_.data[41], 118) + << "incorrect value for last_msg_.data[41], expected 118, is " + << last_msg_.data[41]; + EXPECT_EQ(last_msg_.data[42], 55) + << "incorrect value for last_msg_.data[42], expected 55, is " + << last_msg_.data[42]; + EXPECT_EQ(last_msg_.data[43], 201) + << "incorrect value for last_msg_.data[43], expected 201, is " + << last_msg_.data[43]; + EXPECT_EQ(last_msg_.data[44], 233) + << "incorrect value for last_msg_.data[44], expected 233, is " + << last_msg_.data[44]; + EXPECT_EQ(last_msg_.data[45], 21) + << "incorrect value for last_msg_.data[45], expected 21, is " + << last_msg_.data[45]; + EXPECT_EQ(last_msg_.data[46], 214) + << "incorrect value for last_msg_.data[46], expected 214, is " + << last_msg_.data[46]; + EXPECT_EQ(last_msg_.data[47], 57) + << "incorrect value for last_msg_.data[47], expected 57, is " + << last_msg_.data[47]; + EXPECT_EQ(last_msg_.data[48], 245) + << "incorrect value for last_msg_.data[48], expected 245, is " + << last_msg_.data[48]; + EXPECT_EQ(last_msg_.data[49], 246) + << "incorrect value for last_msg_.data[49], expected 246, is " + << last_msg_.data[49]; + EXPECT_EQ(last_msg_.data[50], 19) + << "incorrect value for last_msg_.data[50], expected 19, is " + << last_msg_.data[50]; + EXPECT_EQ(last_msg_.data[51], 3) + << "incorrect value for last_msg_.data[51], expected 3, is " + << last_msg_.data[51]; + EXPECT_EQ(last_msg_.data[52], 121) + << "incorrect value for last_msg_.data[52], expected 121, is " + << last_msg_.data[52]; + EXPECT_EQ(last_msg_.data[53], 49) + << "incorrect value for last_msg_.data[53], expected 49, is " + << last_msg_.data[53]; + EXPECT_EQ(last_msg_.data[54], 231) + << "incorrect value for last_msg_.data[54], expected 231, is " + << last_msg_.data[54]; + EXPECT_EQ(last_msg_.data[55], 37) + << "incorrect value for last_msg_.data[55], expected 37, is " + << last_msg_.data[55]; + EXPECT_EQ(last_msg_.data[56], 186) + << "incorrect value for last_msg_.data[56], expected 186, is " + << last_msg_.data[56]; + EXPECT_EQ(last_msg_.data[57], 58) + << "incorrect value for last_msg_.data[57], expected 58, is " + << last_msg_.data[57]; + EXPECT_EQ(last_msg_.data[58], 238) + << "incorrect value for last_msg_.data[58], expected 238, is " + << last_msg_.data[58]; + EXPECT_EQ(last_msg_.data[59], 98) + << "incorrect value for last_msg_.data[59], expected 98, is " + << last_msg_.data[59]; + EXPECT_EQ(last_msg_.data[60], 39) + << "incorrect value for last_msg_.data[60], expected 39, is " + << last_msg_.data[60]; + EXPECT_EQ(last_msg_.data[61], 70) + << "incorrect value for last_msg_.data[61], expected 70, is " + << last_msg_.data[61]; + EXPECT_EQ(last_msg_.data[62], 232) + << "incorrect value for last_msg_.data[62], expected 232, is " + << last_msg_.data[62]; + EXPECT_EQ(last_msg_.data[63], 133) + << "incorrect value for last_msg_.data[63], expected 133, is " + << last_msg_.data[63]; + EXPECT_EQ(last_msg_.data[64], 25) + << "incorrect value for last_msg_.data[64], expected 25, is " + << last_msg_.data[64]; + EXPECT_EQ(last_msg_.data[65], 10) + << "incorrect value for last_msg_.data[65], expected 10, is " + << last_msg_.data[65]; + EXPECT_EQ(last_msg_.data[66], 134) + << "incorrect value for last_msg_.data[66], expected 134, is " + << last_msg_.data[66]; + EXPECT_EQ(last_msg_.data[67], 129) + << "incorrect value for last_msg_.data[67], expected 129, is " + << last_msg_.data[67]; + EXPECT_EQ(last_msg_.data[68], 69) + << "incorrect value for last_msg_.data[68], expected 69, is " + << last_msg_.data[68]; + EXPECT_EQ(last_msg_.data[69], 228) + << "incorrect value for last_msg_.data[69], expected 228, is " + << last_msg_.data[69]; + EXPECT_EQ(last_msg_.data[70], 134) + << "incorrect value for last_msg_.data[70], expected 134, is " + << last_msg_.data[70]; + EXPECT_EQ(last_msg_.data[71], 9) + << "incorrect value for last_msg_.data[71], expected 9, is " + << last_msg_.data[71]; + EXPECT_EQ(last_msg_.data[72], 88) + << "incorrect value for last_msg_.data[72], expected 88, is " + << last_msg_.data[72]; + EXPECT_EQ(last_msg_.data[73], 183) + << "incorrect value for last_msg_.data[73], expected 183, is " + << last_msg_.data[73]; + EXPECT_EQ(last_msg_.data[74], 133) + << "incorrect value for last_msg_.data[74], expected 133, is " + << last_msg_.data[74]; + EXPECT_EQ(last_msg_.data[75], 171) + << "incorrect value for last_msg_.data[75], expected 171, is " + << last_msg_.data[75]; + EXPECT_EQ(last_msg_.data[76], 255) + << "incorrect value for last_msg_.data[76], expected 255, is " + << last_msg_.data[76]; + EXPECT_EQ(last_msg_.data[77], 166) + << "incorrect value for last_msg_.data[77], expected 166, is " + << last_msg_.data[77]; + EXPECT_EQ(last_msg_.data[78], 100) + << "incorrect value for last_msg_.data[78], expected 100, is " + << last_msg_.data[78]; + EXPECT_EQ(last_msg_.data[79], 152) + << "incorrect value for last_msg_.data[79], expected 152, is " + << last_msg_.data[79]; + EXPECT_EQ(last_msg_.data[80], 231) + << "incorrect value for last_msg_.data[80], expected 231, is " + << last_msg_.data[80]; + EXPECT_EQ(last_msg_.data[81], 92) + << "incorrect value for last_msg_.data[81], expected 92, is " + << last_msg_.data[81]; + EXPECT_EQ(last_msg_.data[82], 9) + << "incorrect value for last_msg_.data[82], expected 9, is " + << last_msg_.data[82]; + EXPECT_EQ(last_msg_.data[83], 196) + << "incorrect value for last_msg_.data[83], expected 196, is " + << last_msg_.data[83]; + EXPECT_EQ(last_msg_.data[84], 106) + << "incorrect value for last_msg_.data[84], expected 106, is " + << last_msg_.data[84]; + EXPECT_EQ(last_msg_.data[85], 246) + << "incorrect value for last_msg_.data[85], expected 246, is " + << last_msg_.data[85]; + EXPECT_EQ(last_msg_.data[86], 29) + << "incorrect value for last_msg_.data[86], expected 29, is " + << last_msg_.data[86]; + EXPECT_EQ(last_msg_.data[87], 145) + << "incorrect value for last_msg_.data[87], expected 145, is " + << last_msg_.data[87]; + EXPECT_EQ(last_msg_.data[88], 156) + << "incorrect value for last_msg_.data[88], expected 156, is " + << last_msg_.data[88]; + EXPECT_EQ(last_msg_.data[89], 151) + << "incorrect value for last_msg_.data[89], expected 151, is " + << last_msg_.data[89]; + EXPECT_EQ(last_msg_.data[90], 32) + << "incorrect value for last_msg_.data[90], expected 32, is " + << last_msg_.data[90]; + EXPECT_EQ(last_msg_.data[91], 67) + << "incorrect value for last_msg_.data[91], expected 67, is " + << last_msg_.data[91]; + EXPECT_EQ(last_msg_.data[92], 188) + << "incorrect value for last_msg_.data[92], expected 188, is " + << last_msg_.data[92]; + EXPECT_EQ(last_msg_.data[93], 63) + << "incorrect value for last_msg_.data[93], expected 63, is " + << last_msg_.data[93]; + EXPECT_EQ(last_msg_.data[94], 233) + << "incorrect value for last_msg_.data[94], expected 233, is " + << last_msg_.data[94]; + EXPECT_EQ(last_msg_.data[95], 142) + << "incorrect value for last_msg_.data[95], expected 142, is " + << last_msg_.data[95]; + EXPECT_EQ(last_msg_.data[96], 174) + << "incorrect value for last_msg_.data[96], expected 174, is " + << last_msg_.data[96]; + EXPECT_EQ(last_msg_.data[97], 139) + << "incorrect value for last_msg_.data[97], expected 139, is " + << last_msg_.data[97]; + EXPECT_EQ(last_msg_.data[98], 154) + << "incorrect value for last_msg_.data[98], expected 154, is " + << last_msg_.data[98]; + EXPECT_EQ(last_msg_.data[99], 127) + << "incorrect value for last_msg_.data[99], expected 127, is " + << last_msg_.data[99]; + EXPECT_EQ(last_msg_.data[100], 35) + << "incorrect value for last_msg_.data[100], expected 35, is " + << last_msg_.data[100]; + EXPECT_EQ(last_msg_.data[101], 60) + << "incorrect value for last_msg_.data[101], expected 60, is " + << last_msg_.data[101]; + EXPECT_EQ(last_msg_.data[102], 56) + << "incorrect value for last_msg_.data[102], expected 56, is " + << last_msg_.data[102]; + EXPECT_EQ(last_msg_.data[103], 187) + << "incorrect value for last_msg_.data[103], expected 187, is " + << last_msg_.data[103]; + EXPECT_EQ(last_msg_.data[104], 121) + << "incorrect value for last_msg_.data[104], expected 121, is " + << last_msg_.data[104]; + EXPECT_EQ(last_msg_.data[105], 103) + << "incorrect value for last_msg_.data[105], expected 103, is " + << last_msg_.data[105]; + EXPECT_EQ(last_msg_.data[106], 135) + << "incorrect value for last_msg_.data[106], expected 135, is " + << last_msg_.data[106]; + EXPECT_EQ(last_msg_.data[107], 152) + << "incorrect value for last_msg_.data[107], expected 152, is " + << last_msg_.data[107]; + EXPECT_EQ(last_msg_.data[108], 182) + << "incorrect value for last_msg_.data[108], expected 182, is " + << last_msg_.data[108]; + EXPECT_EQ(last_msg_.data[109], 88) + << "incorrect value for last_msg_.data[109], expected 88, is " + << last_msg_.data[109]; + EXPECT_EQ(last_msg_.data[110], 160) + << "incorrect value for last_msg_.data[110], expected 160, is " + << last_msg_.data[110]; + EXPECT_EQ(last_msg_.data[111], 255) + << "incorrect value for last_msg_.data[111], expected 255, is " + << last_msg_.data[111]; + EXPECT_EQ(last_msg_.data[112], 227) + << "incorrect value for last_msg_.data[112], expected 227, is " + << last_msg_.data[112]; + EXPECT_EQ(last_msg_.data[113], 240) + << "incorrect value for last_msg_.data[113], expected 240, is " + << last_msg_.data[113]; + EXPECT_EQ(last_msg_.data[114], 54) + << "incorrect value for last_msg_.data[114], expected 54, is " + << last_msg_.data[114]; + EXPECT_EQ(last_msg_.data[115], 100) + << "incorrect value for last_msg_.data[115], expected 100, is " + << last_msg_.data[115]; + EXPECT_EQ(last_msg_.data[116], 91) + << "incorrect value for last_msg_.data[116], expected 91, is " + << last_msg_.data[116]; + EXPECT_EQ(last_msg_.data[117], 31) + << "incorrect value for last_msg_.data[117], expected 31, is " + << last_msg_.data[117]; + EXPECT_EQ(last_msg_.data[118], 141) + << "incorrect value for last_msg_.data[118], expected 141, is " + << last_msg_.data[118]; + EXPECT_EQ(last_msg_.data[119], 102) + << "incorrect value for last_msg_.data[119], expected 102, is " + << last_msg_.data[119]; + EXPECT_EQ(last_msg_.data[120], 130) + << "incorrect value for last_msg_.data[120], expected 130, is " + << last_msg_.data[120]; + EXPECT_EQ(last_msg_.data[121], 254) + << "incorrect value for last_msg_.data[121], expected 254, is " + << last_msg_.data[121]; + EXPECT_EQ(last_msg_.data[122], 54) + << "incorrect value for last_msg_.data[122], expected 54, is " + << last_msg_.data[122]; + EXPECT_EQ(last_msg_.data[123], 227) + << "incorrect value for last_msg_.data[123], expected 227, is " + << last_msg_.data[123]; + EXPECT_EQ(last_msg_.data[124], 229) + << "incorrect value for last_msg_.data[124], expected 229, is " + << last_msg_.data[124]; + EXPECT_EQ(last_msg_.data[125], 62) + << "incorrect value for last_msg_.data[125], expected 62, is " + << last_msg_.data[125]; + EXPECT_EQ(last_msg_.data[126], 53) + << "incorrect value for last_msg_.data[126], expected 53, is " + << last_msg_.data[126]; + EXPECT_EQ(last_msg_.data[127], 225) + << "incorrect value for last_msg_.data[127], expected 225, is " + << last_msg_.data[127]; + EXPECT_EQ(last_msg_.data[128], 143) + << "incorrect value for last_msg_.data[128], expected 143, is " + << last_msg_.data[128]; + EXPECT_EQ(last_msg_.data[129], 88) + << "incorrect value for last_msg_.data[129], expected 88, is " + << last_msg_.data[129]; + EXPECT_EQ(last_msg_.data[130], 139) + << "incorrect value for last_msg_.data[130], expected 139, is " + << last_msg_.data[130]; + EXPECT_EQ(last_msg_.data[131], 126) + << "incorrect value for last_msg_.data[131], expected 126, is " + << last_msg_.data[131]; + EXPECT_EQ(last_msg_.data[132], 235) + << "incorrect value for last_msg_.data[132], expected 235, is " + << last_msg_.data[132]; + EXPECT_EQ(last_msg_.data[133], 235) + << "incorrect value for last_msg_.data[133], expected 235, is " + << last_msg_.data[133]; + EXPECT_EQ(last_msg_.data[134], 35) + << "incorrect value for last_msg_.data[134], expected 35, is " + << last_msg_.data[134]; + EXPECT_EQ(last_msg_.data[135], 54) + << "incorrect value for last_msg_.data[135], expected 54, is " + << last_msg_.data[135]; + EXPECT_EQ(last_msg_.data[136], 134) + << "incorrect value for last_msg_.data[136], expected 134, is " + << last_msg_.data[136]; + EXPECT_EQ(last_msg_.data[137], 163) + << "incorrect value for last_msg_.data[137], expected 163, is " + << last_msg_.data[137]; + EXPECT_EQ(last_msg_.data[138], 92) + << "incorrect value for last_msg_.data[138], expected 92, is " + << last_msg_.data[138]; + EXPECT_EQ(last_msg_.data[139], 57) + << "incorrect value for last_msg_.data[139], expected 57, is " + << last_msg_.data[139]; + EXPECT_EQ(last_msg_.data[140], 87) + << "incorrect value for last_msg_.data[140], expected 87, is " + << last_msg_.data[140]; + EXPECT_EQ(last_msg_.data[141], 130) + << "incorrect value for last_msg_.data[141], expected 130, is " + << last_msg_.data[141]; + EXPECT_EQ(last_msg_.data[142], 178) + << "incorrect value for last_msg_.data[142], expected 178, is " + << last_msg_.data[142]; + EXPECT_EQ(last_msg_.data[143], 22) + << "incorrect value for last_msg_.data[143], expected 22, is " + << last_msg_.data[143]; + EXPECT_EQ(last_msg_.data[144], 158) + << "incorrect value for last_msg_.data[144], expected 158, is " + << last_msg_.data[144]; + EXPECT_EQ(last_msg_.data[145], 18) + << "incorrect value for last_msg_.data[145], expected 18, is " + << last_msg_.data[145]; + EXPECT_EQ(last_msg_.data[146], 237) + << "incorrect value for last_msg_.data[146], expected 237, is " + << last_msg_.data[146]; + EXPECT_EQ(last_msg_.data[147], 209) + << "incorrect value for last_msg_.data[147], expected 209, is " + << last_msg_.data[147]; + EXPECT_EQ(last_msg_.data[148], 187) + << "incorrect value for last_msg_.data[148], expected 187, is " + << last_msg_.data[148]; + EXPECT_EQ(last_msg_.data[149], 226) + << "incorrect value for last_msg_.data[149], expected 226, is " + << last_msg_.data[149]; + EXPECT_EQ(last_msg_.data[150], 1) + << "incorrect value for last_msg_.data[150], expected 1, is " + << last_msg_.data[150]; + EXPECT_EQ(last_msg_.data[151], 46) + << "incorrect value for last_msg_.data[151], expected 46, is " + << last_msg_.data[151]; + EXPECT_EQ(last_msg_.data[152], 64) + << "incorrect value for last_msg_.data[152], expected 64, is " + << last_msg_.data[152]; + EXPECT_EQ(last_msg_.data[153], 226) + << "incorrect value for last_msg_.data[153], expected 226, is " + << last_msg_.data[153]; + EXPECT_EQ(last_msg_.data[154], 235) + << "incorrect value for last_msg_.data[154], expected 235, is " + << last_msg_.data[154]; + EXPECT_EQ(last_msg_.data[155], 213) + << "incorrect value for last_msg_.data[155], expected 213, is " + << last_msg_.data[155]; + EXPECT_EQ(last_msg_.data[156], 186) + << "incorrect value for last_msg_.data[156], expected 186, is " + << last_msg_.data[156]; + EXPECT_EQ(last_msg_.data[157], 159) + << "incorrect value for last_msg_.data[157], expected 159, is " + << last_msg_.data[157]; + EXPECT_EQ(last_msg_.data[158], 221) + << "incorrect value for last_msg_.data[158], expected 221, is " + << last_msg_.data[158]; + EXPECT_EQ(last_msg_.data[159], 186) + << "incorrect value for last_msg_.data[159], expected 186, is " + << last_msg_.data[159]; + EXPECT_EQ(last_msg_.data[160], 25) + << "incorrect value for last_msg_.data[160], expected 25, is " + << last_msg_.data[160]; + EXPECT_EQ(last_msg_.data[161], 115) + << "incorrect value for last_msg_.data[161], expected 115, is " + << last_msg_.data[161]; + EXPECT_EQ(last_msg_.data[162], 84) + << "incorrect value for last_msg_.data[162], expected 84, is " + << last_msg_.data[162]; + EXPECT_EQ(last_msg_.data[163], 131) + << "incorrect value for last_msg_.data[163], expected 131, is " + << last_msg_.data[163]; + EXPECT_EQ(last_msg_.data[164], 167) + << "incorrect value for last_msg_.data[164], expected 167, is " + << last_msg_.data[164]; + EXPECT_EQ(last_msg_.data[165], 201) + << "incorrect value for last_msg_.data[165], expected 201, is " + << last_msg_.data[165]; + EXPECT_EQ(last_msg_.data[166], 104) + << "incorrect value for last_msg_.data[166], expected 104, is " + << last_msg_.data[166]; + EXPECT_EQ(last_msg_.data[167], 1) + << "incorrect value for last_msg_.data[167], expected 1, is " + << last_msg_.data[167]; + EXPECT_EQ(last_msg_.data[168], 200) + << "incorrect value for last_msg_.data[168], expected 200, is " + << last_msg_.data[168]; + EXPECT_EQ(last_msg_.data[169], 13) + << "incorrect value for last_msg_.data[169], expected 13, is " + << last_msg_.data[169]; + EXPECT_EQ(last_msg_.data[170], 50) + << "incorrect value for last_msg_.data[170], expected 50, is " + << last_msg_.data[170]; + EXPECT_EQ(last_msg_.data[171], 71) + << "incorrect value for last_msg_.data[171], expected 71, is " + << last_msg_.data[171]; + EXPECT_EQ(last_msg_.data[172], 73) + << "incorrect value for last_msg_.data[172], expected 73, is " + << last_msg_.data[172]; + EXPECT_EQ(last_msg_.data[173], 193) + << "incorrect value for last_msg_.data[173], expected 193, is " + << last_msg_.data[173]; + EXPECT_EQ(last_msg_.data[174], 201) + << "incorrect value for last_msg_.data[174], expected 201, is " + << last_msg_.data[174]; + EXPECT_EQ(last_msg_.data[175], 250) + << "incorrect value for last_msg_.data[175], expected 250, is " + << last_msg_.data[175]; + EXPECT_EQ(last_msg_.data[176], 172) + << "incorrect value for last_msg_.data[176], expected 172, is " + << last_msg_.data[176]; + EXPECT_EQ(last_msg_.data[177], 193) + << "incorrect value for last_msg_.data[177], expected 193, is " + << last_msg_.data[177]; + EXPECT_EQ(last_msg_.data[178], 13) + << "incorrect value for last_msg_.data[178], expected 13, is " + << last_msg_.data[178]; + EXPECT_EQ(last_msg_.data[179], 20) + << "incorrect value for last_msg_.data[179], expected 20, is " + << last_msg_.data[179]; + EXPECT_EQ(last_msg_.data[180], 238) + << "incorrect value for last_msg_.data[180], expected 238, is " + << last_msg_.data[180]; + EXPECT_EQ(last_msg_.data[181], 130) + << "incorrect value for last_msg_.data[181], expected 130, is " + << last_msg_.data[181]; + EXPECT_EQ(last_msg_.data[182], 243) + << "incorrect value for last_msg_.data[182], expected 243, is " + << last_msg_.data[182]; + EXPECT_EQ(last_msg_.data[183], 68) + << "incorrect value for last_msg_.data[183], expected 68, is " + << last_msg_.data[183]; + EXPECT_EQ(last_msg_.data[184], 4) + << "incorrect value for last_msg_.data[184], expected 4, is " + << last_msg_.data[184]; + EXPECT_EQ(last_msg_.data[185], 72) + << "incorrect value for last_msg_.data[185], expected 72, is " + << last_msg_.data[185]; + EXPECT_EQ(last_msg_.data[186], 46) + << "incorrect value for last_msg_.data[186], expected 46, is " + << last_msg_.data[186]; + EXPECT_EQ(last_msg_.data[187], 194) + << "incorrect value for last_msg_.data[187], expected 194, is " + << last_msg_.data[187]; + EXPECT_EQ(last_msg_.data[188], 113) + << "incorrect value for last_msg_.data[188], expected 113, is " + << last_msg_.data[188]; + EXPECT_EQ(last_msg_.data[189], 255) + << "incorrect value for last_msg_.data[189], expected 255, is " + << last_msg_.data[189]; + EXPECT_EQ(last_msg_.data[190], 238) + << "incorrect value for last_msg_.data[190], expected 238, is " + << last_msg_.data[190]; + EXPECT_EQ(last_msg_.data[191], 15) + << "incorrect value for last_msg_.data[191], expected 15, is " + << last_msg_.data[191]; + EXPECT_EQ(last_msg_.data[192], 230) + << "incorrect value for last_msg_.data[192], expected 230, is " + << last_msg_.data[192]; + EXPECT_EQ(last_msg_.data[193], 64) + << "incorrect value for last_msg_.data[193], expected 64, is " + << last_msg_.data[193]; + EXPECT_EQ(last_msg_.data[194], 178) + << "incorrect value for last_msg_.data[194], expected 178, is " + << last_msg_.data[194]; + EXPECT_EQ(last_msg_.data[195], 127) + << "incorrect value for last_msg_.data[195], expected 127, is " + << last_msg_.data[195]; + EXPECT_EQ(last_msg_.data[196], 217) + << "incorrect value for last_msg_.data[196], expected 217, is " + << last_msg_.data[196]; + EXPECT_EQ(last_msg_.data[197], 92) + << "incorrect value for last_msg_.data[197], expected 92, is " + << last_msg_.data[197]; + EXPECT_EQ(last_msg_.data[198], 160) + << "incorrect value for last_msg_.data[198], expected 160, is " + << last_msg_.data[198]; + EXPECT_EQ(last_msg_.data[199], 201) + << "incorrect value for last_msg_.data[199], expected 201, is " + << last_msg_.data[199]; + EXPECT_EQ(last_msg_.data[200], 118) + << "incorrect value for last_msg_.data[200], expected 118, is " + << last_msg_.data[200]; + EXPECT_EQ(last_msg_.data[201], 163) + << "incorrect value for last_msg_.data[201], expected 163, is " + << last_msg_.data[201]; + EXPECT_EQ(last_msg_.data[202], 144) + << "incorrect value for last_msg_.data[202], expected 144, is " + << last_msg_.data[202]; + EXPECT_EQ(last_msg_.data[203], 58) + << "incorrect value for last_msg_.data[203], expected 58, is " + << last_msg_.data[203]; + EXPECT_EQ(last_msg_.data[204], 28) + << "incorrect value for last_msg_.data[204], expected 28, is " + << last_msg_.data[204]; + EXPECT_EQ(last_msg_.data[205], 174) + << "incorrect value for last_msg_.data[205], expected 174, is " + << last_msg_.data[205]; + EXPECT_EQ(last_msg_.data[206], 65) + << "incorrect value for last_msg_.data[206], expected 65, is " + << last_msg_.data[206]; + EXPECT_EQ(last_msg_.data[207], 73) + << "incorrect value for last_msg_.data[207], expected 73, is " + << last_msg_.data[207]; + EXPECT_EQ(last_msg_.data[208], 45) + << "incorrect value for last_msg_.data[208], expected 45, is " + << last_msg_.data[208]; + EXPECT_EQ(last_msg_.data[209], 123) + << "incorrect value for last_msg_.data[209], expected 123, is " + << last_msg_.data[209]; + EXPECT_EQ(last_msg_.data[210], 118) + << "incorrect value for last_msg_.data[210], expected 118, is " + << last_msg_.data[210]; + EXPECT_EQ(last_msg_.data[211], 83) + << "incorrect value for last_msg_.data[211], expected 83, is " + << last_msg_.data[211]; + EXPECT_EQ(last_msg_.data[212], 107) + << "incorrect value for last_msg_.data[212], expected 107, is " + << last_msg_.data[212]; + EXPECT_EQ(last_msg_.data[213], 239) + << "incorrect value for last_msg_.data[213], expected 239, is " + << last_msg_.data[213]; + EXPECT_EQ(last_msg_.data[214], 168) + << "incorrect value for last_msg_.data[214], expected 168, is " + << last_msg_.data[214]; + EXPECT_EQ(last_msg_.data[215], 32) + << "incorrect value for last_msg_.data[215], expected 32, is " + << last_msg_.data[215]; + EXPECT_EQ(last_msg_.data[216], 212) + << "incorrect value for last_msg_.data[216], expected 212, is " + << last_msg_.data[216]; + EXPECT_EQ(last_msg_.data[217], 191) + << "incorrect value for last_msg_.data[217], expected 191, is " + << last_msg_.data[217]; + EXPECT_EQ(last_msg_.data[218], 81) + << "incorrect value for last_msg_.data[218], expected 81, is " + << last_msg_.data[218]; + EXPECT_EQ(last_msg_.data[219], 93) + << "incorrect value for last_msg_.data[219], expected 93, is " + << last_msg_.data[219]; + EXPECT_EQ(last_msg_.data[220], 186) + << "incorrect value for last_msg_.data[220], expected 186, is " + << last_msg_.data[220]; + EXPECT_EQ(last_msg_.data[221], 223) + << "incorrect value for last_msg_.data[221], expected 223, is " + << last_msg_.data[221]; + EXPECT_EQ(last_msg_.data[222], 32) + << "incorrect value for last_msg_.data[222], expected 32, is " + << last_msg_.data[222]; + EXPECT_EQ(last_msg_.data[223], 19) + << "incorrect value for last_msg_.data[223], expected 19, is " + << last_msg_.data[223]; + EXPECT_EQ(last_msg_.data[224], 58) + << "incorrect value for last_msg_.data[224], expected 58, is " + << last_msg_.data[224]; + EXPECT_EQ(last_msg_.data[225], 137) + << "incorrect value for last_msg_.data[225], expected 137, is " + << last_msg_.data[225]; + EXPECT_EQ(last_msg_.data[226], 72) + << "incorrect value for last_msg_.data[226], expected 72, is " + << last_msg_.data[226]; + EXPECT_EQ(last_msg_.data[227], 217) + << "incorrect value for last_msg_.data[227], expected 217, is " + << last_msg_.data[227]; + EXPECT_EQ(last_msg_.data[228], 151) + << "incorrect value for last_msg_.data[228], expected 151, is " + << last_msg_.data[228]; + EXPECT_EQ(last_msg_.data[229], 251) + << "incorrect value for last_msg_.data[229], expected 251, is " + << last_msg_.data[229]; + EXPECT_EQ(last_msg_.data[230], 83) + << "incorrect value for last_msg_.data[230], expected 83, is " + << last_msg_.data[230]; + EXPECT_EQ(last_msg_.data[231], 20) + << "incorrect value for last_msg_.data[231], expected 20, is " + << last_msg_.data[231]; + EXPECT_EQ(last_msg_.data[232], 113) + << "incorrect value for last_msg_.data[232], expected 113, is " + << last_msg_.data[232]; + EXPECT_EQ(last_msg_.data[233], 37) + << "incorrect value for last_msg_.data[233], expected 37, is " + << last_msg_.data[233]; + EXPECT_EQ(last_msg_.data[234], 151) + << "incorrect value for last_msg_.data[234], expected 151, is " + << last_msg_.data[234]; + EXPECT_EQ(last_msg_.data[235], 34) + << "incorrect value for last_msg_.data[235], expected 34, is " + << last_msg_.data[235]; + EXPECT_EQ(last_msg_.data[236], 37) + << "incorrect value for last_msg_.data[236], expected 37, is " + << last_msg_.data[236]; + EXPECT_EQ(last_msg_.data[237], 71) + << "incorrect value for last_msg_.data[237], expected 71, is " + << last_msg_.data[237]; + EXPECT_EQ(last_msg_.data[238], 95) + << "incorrect value for last_msg_.data[238], expected 95, is " + << last_msg_.data[238]; + EXPECT_EQ(last_msg_.data[239], 105) + << "incorrect value for last_msg_.data[239], expected 105, is " + << last_msg_.data[239]; + EXPECT_EQ(last_msg_.data[240], 235) + << "incorrect value for last_msg_.data[240], expected 235, is " + << last_msg_.data[240]; + EXPECT_EQ(last_msg_.data[241], 144) + << "incorrect value for last_msg_.data[241], expected 144, is " + << last_msg_.data[241]; + EXPECT_EQ(last_msg_.data[242], 164) + << "incorrect value for last_msg_.data[242], expected 164, is " + << last_msg_.data[242]; + EXPECT_EQ(last_msg_.data[243], 83) + << "incorrect value for last_msg_.data[243], expected 83, is " + << last_msg_.data[243]; + EXPECT_EQ(last_msg_.data[244], 197) + << "incorrect value for last_msg_.data[244], expected 197, is " + << last_msg_.data[244]; + EXPECT_EQ(last_msg_.data[245], 254) + << "incorrect value for last_msg_.data[245], expected 254, is " + << last_msg_.data[245]; + EXPECT_EQ(last_msg_.data[246], 183) + << "incorrect value for last_msg_.data[246], expected 183, is " + << last_msg_.data[246]; + EXPECT_EQ(last_msg_.data[247], 223) + << "incorrect value for last_msg_.data[247], expected 223, is " + << last_msg_.data[247]; + EXPECT_EQ(last_msg_.data[248], 91) + << "incorrect value for last_msg_.data[248], expected 91, is " + << last_msg_.data[248]; + EXPECT_EQ(last_msg_.data[249], 19) + << "incorrect value for last_msg_.data[249], expected 19, is " + << last_msg_.data[249]; + EXPECT_EQ(last_msg_.target, 212) + << "incorrect value for last_msg_.target, expected 212, is " + << last_msg_.target; } diff --git a/c/test/cpp/auto_check_sbp_flash_MsgFlashReadReq.cc b/c/test/cpp/auto_check_sbp_flash_MsgFlashReadReq.cc index 3ca7b0897..051981ba9 100644 --- a/c/test/cpp/auto_check_sbp_flash_MsgFlashReadReq.cc +++ b/c/test/cpp/auto_check_sbp_flash_MsgFlashReadReq.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadReq.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_flash_MsgFlashReadReq0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_flash_MsgFlashReadReq0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_flash_MsgFlashReadReq0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_flash_MsgFlashReadReq0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_flash_read_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_flash_read_req_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,43 +67,53 @@ class Test_auto_check_sbp_flash_MsgFlashReadReq0 : sbp_msg_flash_read_req_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_flash_MsgFlashReadReq0, Test) -{ +}; - uint8_t encoded_frame[] = {85,231,0,195,4,5,241,28,75,244,71,210,57, }; +TEST_F(Test_auto_check_sbp_flash_MsgFlashReadReq0, Test) { + uint8_t encoded_frame[] = { + 85, 231, 0, 195, 4, 5, 241, 28, 75, 244, 71, 210, 57, + }; - sbp_msg_flash_read_req_t test_msg{}; - test_msg.addr_len = 71; - - test_msg.addr_start[0] = 28; - - test_msg.addr_start[1] = 75; - - test_msg.addr_start[2] = 244; - test_msg.target = 241; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + sbp_msg_flash_read_req_t test_msg{}; + test_msg.addr_len = 71; + + test_msg.addr_start[0] = 28; + + test_msg.addr_start[1] = 75; + + test_msg.addr_start[2] = 244; + test_msg.target = 241; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.addr_len, 71) << "incorrect value for last_msg_.addr_len, expected 71, is " << last_msg_.addr_len; - EXPECT_EQ(last_msg_.addr_start[0], 28) << "incorrect value for last_msg_.addr_start[0], expected 28, is " << last_msg_.addr_start[0]; - EXPECT_EQ(last_msg_.addr_start[1], 75) << "incorrect value for last_msg_.addr_start[1], expected 75, is " << last_msg_.addr_start[1]; - EXPECT_EQ(last_msg_.addr_start[2], 244) << "incorrect value for last_msg_.addr_start[2], expected 244, is " << last_msg_.addr_start[2]; - EXPECT_EQ(last_msg_.target, 241) << "incorrect value for last_msg_.target, expected 241, is " << last_msg_.target; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.addr_len, 71) + << "incorrect value for last_msg_.addr_len, expected 71, is " + << last_msg_.addr_len; + EXPECT_EQ(last_msg_.addr_start[0], 28) + << "incorrect value for last_msg_.addr_start[0], expected 28, is " + << last_msg_.addr_start[0]; + EXPECT_EQ(last_msg_.addr_start[1], 75) + << "incorrect value for last_msg_.addr_start[1], expected 75, is " + << last_msg_.addr_start[1]; + EXPECT_EQ(last_msg_.addr_start[2], 244) + << "incorrect value for last_msg_.addr_start[2], expected 244, is " + << last_msg_.addr_start[2]; + EXPECT_EQ(last_msg_.target, 241) + << "incorrect value for last_msg_.target, expected 241, is " + << last_msg_.target; } diff --git a/c/test/cpp/auto_check_sbp_flash_MsgFlashReadResp.cc b/c/test/cpp/auto_check_sbp_flash_MsgFlashReadResp.cc index f5c913d83..4c084844d 100644 --- a/c/test/cpp/auto_check_sbp_flash_MsgFlashReadResp.cc +++ b/c/test/cpp/auto_check_sbp_flash_MsgFlashReadResp.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadResp.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_flash_MsgFlashReadResp0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_flash_MsgFlashReadResp0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_flash_MsgFlashReadResp0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_flash_MsgFlashReadResp0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_flash_read_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_flash_read_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,43 +67,53 @@ class Test_auto_check_sbp_flash_MsgFlashReadResp0 : sbp_msg_flash_read_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_flash_MsgFlashReadResp0, Test) -{ +}; - uint8_t encoded_frame[] = {85,225,0,195,4,5,136,155,52,172,124,149,135, }; +TEST_F(Test_auto_check_sbp_flash_MsgFlashReadResp0, Test) { + uint8_t encoded_frame[] = { + 85, 225, 0, 195, 4, 5, 136, 155, 52, 172, 124, 149, 135, + }; - sbp_msg_flash_read_resp_t test_msg{}; - test_msg.addr_len = 124; - - test_msg.addr_start[0] = 155; - - test_msg.addr_start[1] = 52; - - test_msg.addr_start[2] = 172; - test_msg.target = 136; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + sbp_msg_flash_read_resp_t test_msg{}; + test_msg.addr_len = 124; + + test_msg.addr_start[0] = 155; + + test_msg.addr_start[1] = 52; + + test_msg.addr_start[2] = 172; + test_msg.target = 136; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.addr_len, 124) << "incorrect value for last_msg_.addr_len, expected 124, is " << last_msg_.addr_len; - EXPECT_EQ(last_msg_.addr_start[0], 155) << "incorrect value for last_msg_.addr_start[0], expected 155, is " << last_msg_.addr_start[0]; - EXPECT_EQ(last_msg_.addr_start[1], 52) << "incorrect value for last_msg_.addr_start[1], expected 52, is " << last_msg_.addr_start[1]; - EXPECT_EQ(last_msg_.addr_start[2], 172) << "incorrect value for last_msg_.addr_start[2], expected 172, is " << last_msg_.addr_start[2]; - EXPECT_EQ(last_msg_.target, 136) << "incorrect value for last_msg_.target, expected 136, is " << last_msg_.target; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.addr_len, 124) + << "incorrect value for last_msg_.addr_len, expected 124, is " + << last_msg_.addr_len; + EXPECT_EQ(last_msg_.addr_start[0], 155) + << "incorrect value for last_msg_.addr_start[0], expected 155, is " + << last_msg_.addr_start[0]; + EXPECT_EQ(last_msg_.addr_start[1], 52) + << "incorrect value for last_msg_.addr_start[1], expected 52, is " + << last_msg_.addr_start[1]; + EXPECT_EQ(last_msg_.addr_start[2], 172) + << "incorrect value for last_msg_.addr_start[2], expected 172, is " + << last_msg_.addr_start[2]; + EXPECT_EQ(last_msg_.target, 136) + << "incorrect value for last_msg_.target, expected 136, is " + << last_msg_.target; } diff --git a/c/test/cpp/auto_check_sbp_flash_MsgM25FlashWriteStatus.cc b/c/test/cpp/auto_check_sbp_flash_MsgM25FlashWriteStatus.cc index 59e779ee5..a984367f7 100644 --- a/c/test/cpp/auto_check_sbp_flash_MsgM25FlashWriteStatus.cc +++ b/c/test/cpp/auto_check_sbp_flash_MsgM25FlashWriteStatus.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgM25FlashWriteStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgM25FlashWriteStatus.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_flash_MsgM25FlashWriteStatus0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_flash_MsgM25FlashWriteStatus0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_flash_MsgM25FlashWriteStatus0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_flash_MsgM25FlashWriteStatus0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_m25_flash_write_status_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_m25_flash_write_status_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,33 +67,35 @@ class Test_auto_check_sbp_flash_MsgM25FlashWriteStatus0 : sbp_msg_m25_flash_write_status_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_flash_MsgM25FlashWriteStatus0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_flash_MsgM25FlashWriteStatus0, Test) { + uint8_t encoded_frame[] = { + 85, 243, 0, 195, 4, 1, 5, 112, 200, + }; + + sbp_msg_m25_flash_write_status_t test_msg{}; - uint8_t encoded_frame[] = {85,243,0,195,4,1,5,112,200, }; + test_msg.status[0] = 5; - sbp_msg_m25_flash_write_status_t test_msg{}; - - test_msg.status[0] = 5; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.status[0], 5) << "incorrect value for last_msg_.status[0], expected 5, is " << last_msg_.status[0]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.status[0], 5) + << "incorrect value for last_msg_.status[0], expected 5, is " + << last_msg_.status[0]; } diff --git a/c/test/cpp/auto_check_sbp_flash_MsgStmFlashLockSector.cc b/c/test/cpp/auto_check_sbp_flash_MsgStmFlashLockSector.cc index b57890a67..3a3d6cb6c 100644 --- a/c/test/cpp/auto_check_sbp_flash_MsgStmFlashLockSector.cc +++ b/c/test/cpp/auto_check_sbp_flash_MsgStmFlashLockSector.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashLockSector.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashLockSector.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_flash_MsgStmFlashLockSector0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_flash_MsgStmFlashLockSector0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_flash_MsgStmFlashLockSector0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_flash_MsgStmFlashLockSector0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_stm_flash_lock_sector_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_stm_flash_lock_sector_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,32 +67,34 @@ class Test_auto_check_sbp_flash_MsgStmFlashLockSector0 : sbp_msg_stm_flash_lock_sector_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_flash_MsgStmFlashLockSector0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_flash_MsgStmFlashLockSector0, Test) { + uint8_t encoded_frame[] = { + 85, 227, 0, 195, 4, 4, 161, 247, 197, 67, 229, 32, + }; - uint8_t encoded_frame[] = {85,227,0,195,4,4,161,247,197,67,229,32, }; + sbp_msg_stm_flash_lock_sector_t test_msg{}; + test_msg.sector = 1137047457; - sbp_msg_stm_flash_lock_sector_t test_msg{}; - test_msg.sector = 1137047457; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.sector, 1137047457) << "incorrect value for last_msg_.sector, expected 1137047457, is " << last_msg_.sector; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.sector, 1137047457) + << "incorrect value for last_msg_.sector, expected 1137047457, is " + << last_msg_.sector; } diff --git a/c/test/cpp/auto_check_sbp_flash_MsgStmFlashUnlockSector.cc b/c/test/cpp/auto_check_sbp_flash_MsgStmFlashUnlockSector.cc index 0f8ca91a9..04753b523 100644 --- a/c/test/cpp/auto_check_sbp_flash_MsgStmFlashUnlockSector.cc +++ b/c/test/cpp/auto_check_sbp_flash_MsgStmFlashUnlockSector.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashUnlockSector.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashUnlockSector.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_flash_MsgStmFlashUnlockSector0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_flash_MsgStmFlashUnlockSector0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_flash_MsgStmFlashUnlockSector0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_flash_MsgStmFlashUnlockSector0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_stm_flash_unlock_sector_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_stm_flash_unlock_sector_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,32 +67,34 @@ class Test_auto_check_sbp_flash_MsgStmFlashUnlockSector0 : sbp_msg_stm_flash_unlock_sector_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_flash_MsgStmFlashUnlockSector0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_flash_MsgStmFlashUnlockSector0, Test) { + uint8_t encoded_frame[] = { + 85, 228, 0, 195, 4, 4, 31, 16, 231, 49, 53, 217, + }; - uint8_t encoded_frame[] = {85,228,0,195,4,4,31,16,231,49,53,217, }; + sbp_msg_stm_flash_unlock_sector_t test_msg{}; + test_msg.sector = 837226527; - sbp_msg_stm_flash_unlock_sector_t test_msg{}; - test_msg.sector = 837226527; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.sector, 837226527) << "incorrect value for last_msg_.sector, expected 837226527, is " << last_msg_.sector; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.sector, 837226527) + << "incorrect value for last_msg_.sector, expected 837226527, is " + << last_msg_.sector; } diff --git a/c/test/cpp/auto_check_sbp_flash_MsgStmUniqueIdReq.cc b/c/test/cpp/auto_check_sbp_flash_MsgStmUniqueIdReq.cc index 30ba07169..eeb415bd8 100644 --- a/c/test/cpp/auto_check_sbp_flash_MsgStmUniqueIdReq.cc +++ b/c/test/cpp/auto_check_sbp_flash_MsgStmUniqueIdReq.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdReq.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_flash_MsgStmUniqueIdReq0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_flash_MsgStmUniqueIdReq0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_flash_MsgStmUniqueIdReq0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_flash_MsgStmUniqueIdReq0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_stm_unique_id_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_stm_unique_id_req_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,30 +67,30 @@ class Test_auto_check_sbp_flash_MsgStmUniqueIdReq0 : sbp_msg_stm_unique_id_req_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_flash_MsgStmUniqueIdReq0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_flash_MsgStmUniqueIdReq0, Test) { + uint8_t encoded_frame[] = { + 85, 232, 0, 195, 4, 0, 66, 138, + }; - uint8_t encoded_frame[] = {85,232,0,195,4,0,66,138, }; + sbp_msg_stm_unique_id_req_t test_msg{}; - sbp_msg_stm_unique_id_req_t test_msg{}; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); } diff --git a/c/test/cpp/auto_check_sbp_flash_MsgStmUniqueIdResp.cc b/c/test/cpp/auto_check_sbp_flash_MsgStmUniqueIdResp.cc index 07b14e8f2..96f181316 100644 --- a/c/test/cpp/auto_check_sbp_flash_MsgStmUniqueIdResp.cc +++ b/c/test/cpp/auto_check_sbp_flash_MsgStmUniqueIdResp.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdResp.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_flash_MsgStmUniqueIdResp0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_flash_MsgStmUniqueIdResp0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_flash_MsgStmUniqueIdResp0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_flash_MsgStmUniqueIdResp0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_stm_unique_id_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_stm_unique_id_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,66 +67,91 @@ class Test_auto_check_sbp_flash_MsgStmUniqueIdResp0 : sbp_msg_stm_unique_id_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_flash_MsgStmUniqueIdResp0, Test) -{ - - uint8_t encoded_frame[] = {85,229,0,195,4,12,196,16,15,163,85,221,119,102,32,194,56,144,221,196, }; - - sbp_msg_stm_unique_id_resp_t test_msg{}; - - test_msg.stm_id[0] = 196; - - test_msg.stm_id[1] = 16; - - test_msg.stm_id[2] = 15; - - test_msg.stm_id[3] = 163; - - test_msg.stm_id[4] = 85; - - test_msg.stm_id[5] = 221; - - test_msg.stm_id[6] = 119; - - test_msg.stm_id[7] = 102; - - test_msg.stm_id[8] = 32; - - test_msg.stm_id[9] = 194; - - test_msg.stm_id[10] = 56; - - test_msg.stm_id[11] = 144; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.stm_id[0], 196) << "incorrect value for last_msg_.stm_id[0], expected 196, is " << last_msg_.stm_id[0]; - EXPECT_EQ(last_msg_.stm_id[1], 16) << "incorrect value for last_msg_.stm_id[1], expected 16, is " << last_msg_.stm_id[1]; - EXPECT_EQ(last_msg_.stm_id[2], 15) << "incorrect value for last_msg_.stm_id[2], expected 15, is " << last_msg_.stm_id[2]; - EXPECT_EQ(last_msg_.stm_id[3], 163) << "incorrect value for last_msg_.stm_id[3], expected 163, is " << last_msg_.stm_id[3]; - EXPECT_EQ(last_msg_.stm_id[4], 85) << "incorrect value for last_msg_.stm_id[4], expected 85, is " << last_msg_.stm_id[4]; - EXPECT_EQ(last_msg_.stm_id[5], 221) << "incorrect value for last_msg_.stm_id[5], expected 221, is " << last_msg_.stm_id[5]; - EXPECT_EQ(last_msg_.stm_id[6], 119) << "incorrect value for last_msg_.stm_id[6], expected 119, is " << last_msg_.stm_id[6]; - EXPECT_EQ(last_msg_.stm_id[7], 102) << "incorrect value for last_msg_.stm_id[7], expected 102, is " << last_msg_.stm_id[7]; - EXPECT_EQ(last_msg_.stm_id[8], 32) << "incorrect value for last_msg_.stm_id[8], expected 32, is " << last_msg_.stm_id[8]; - EXPECT_EQ(last_msg_.stm_id[9], 194) << "incorrect value for last_msg_.stm_id[9], expected 194, is " << last_msg_.stm_id[9]; - EXPECT_EQ(last_msg_.stm_id[10], 56) << "incorrect value for last_msg_.stm_id[10], expected 56, is " << last_msg_.stm_id[10]; - EXPECT_EQ(last_msg_.stm_id[11], 144) << "incorrect value for last_msg_.stm_id[11], expected 144, is " << last_msg_.stm_id[11]; +}; + +TEST_F(Test_auto_check_sbp_flash_MsgStmUniqueIdResp0, Test) { + uint8_t encoded_frame[] = { + 85, 229, 0, 195, 4, 12, 196, 16, 15, 163, + 85, 221, 119, 102, 32, 194, 56, 144, 221, 196, + }; + + sbp_msg_stm_unique_id_resp_t test_msg{}; + + test_msg.stm_id[0] = 196; + + test_msg.stm_id[1] = 16; + + test_msg.stm_id[2] = 15; + + test_msg.stm_id[3] = 163; + + test_msg.stm_id[4] = 85; + + test_msg.stm_id[5] = 221; + + test_msg.stm_id[6] = 119; + + test_msg.stm_id[7] = 102; + + test_msg.stm_id[8] = 32; + + test_msg.stm_id[9] = 194; + + test_msg.stm_id[10] = 56; + + test_msg.stm_id[11] = 144; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.stm_id[0], 196) + << "incorrect value for last_msg_.stm_id[0], expected 196, is " + << last_msg_.stm_id[0]; + EXPECT_EQ(last_msg_.stm_id[1], 16) + << "incorrect value for last_msg_.stm_id[1], expected 16, is " + << last_msg_.stm_id[1]; + EXPECT_EQ(last_msg_.stm_id[2], 15) + << "incorrect value for last_msg_.stm_id[2], expected 15, is " + << last_msg_.stm_id[2]; + EXPECT_EQ(last_msg_.stm_id[3], 163) + << "incorrect value for last_msg_.stm_id[3], expected 163, is " + << last_msg_.stm_id[3]; + EXPECT_EQ(last_msg_.stm_id[4], 85) + << "incorrect value for last_msg_.stm_id[4], expected 85, is " + << last_msg_.stm_id[4]; + EXPECT_EQ(last_msg_.stm_id[5], 221) + << "incorrect value for last_msg_.stm_id[5], expected 221, is " + << last_msg_.stm_id[5]; + EXPECT_EQ(last_msg_.stm_id[6], 119) + << "incorrect value for last_msg_.stm_id[6], expected 119, is " + << last_msg_.stm_id[6]; + EXPECT_EQ(last_msg_.stm_id[7], 102) + << "incorrect value for last_msg_.stm_id[7], expected 102, is " + << last_msg_.stm_id[7]; + EXPECT_EQ(last_msg_.stm_id[8], 32) + << "incorrect value for last_msg_.stm_id[8], expected 32, is " + << last_msg_.stm_id[8]; + EXPECT_EQ(last_msg_.stm_id[9], 194) + << "incorrect value for last_msg_.stm_id[9], expected 194, is " + << last_msg_.stm_id[9]; + EXPECT_EQ(last_msg_.stm_id[10], 56) + << "incorrect value for last_msg_.stm_id[10], expected 56, is " + << last_msg_.stm_id[10]; + EXPECT_EQ(last_msg_.stm_id[11], 144) + << "incorrect value for last_msg_.stm_id[11], expected 144, is " + << last_msg_.stm_id[11]; } diff --git a/c/test/cpp/auto_check_sbp_imu_MsgImuAux.cc b/c/test/cpp/auto_check_sbp_imu_MsgImuAux.cc index 9f3c4580a..1a364b74f 100644 --- a/c/test/cpp/auto_check_sbp_imu_MsgImuAux.cc +++ b/c/test/cpp/auto_check_sbp_imu_MsgImuAux.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuAux.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuAux.yaml by generate.py. Do not +// modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_imu_MsgImuAux0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_imu_MsgImuAux0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_imu_MsgImuAux0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_imu_MsgImuAux0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_imu_aux_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_imu_aux_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,36 +67,42 @@ class Test_auto_check_sbp_imu_MsgImuAux0 : sbp_msg_imu_aux_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_imu_MsgImuAux0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_imu_MsgImuAux0, Test) { + uint8_t encoded_frame[] = { + 85, 1, 9, 52, 18, 4, 1, 244, 10, 66, 200, 252, + }; - uint8_t encoded_frame[] = {85,1,9,52,18,4,1,244,10,66,200,252, }; + sbp_msg_imu_aux_t test_msg{}; + test_msg.imu_conf = 66; + test_msg.imu_type = 1; + test_msg.temp = 2804; - sbp_msg_imu_aux_t test_msg{}; - test_msg.imu_conf = 66; - test_msg.imu_type = 1; - test_msg.temp = 2804; - - EXPECT_EQ(send_message( 4660, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(4660, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4660); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.imu_conf, 66) << "incorrect value for last_msg_.imu_conf, expected 66, is " << last_msg_.imu_conf; - EXPECT_EQ(last_msg_.imu_type, 1) << "incorrect value for last_msg_.imu_type, expected 1, is " << last_msg_.imu_type; - EXPECT_EQ(last_msg_.temp, 2804) << "incorrect value for last_msg_.temp, expected 2804, is " << last_msg_.temp; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4660); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.imu_conf, 66) + << "incorrect value for last_msg_.imu_conf, expected 66, is " + << last_msg_.imu_conf; + EXPECT_EQ(last_msg_.imu_type, 1) + << "incorrect value for last_msg_.imu_type, expected 1, is " + << last_msg_.imu_type; + EXPECT_EQ(last_msg_.temp, 2804) + << "incorrect value for last_msg_.temp, expected 2804, is " + << last_msg_.temp; } diff --git a/c/test/cpp/auto_check_sbp_imu_MsgImuRaw.cc b/c/test/cpp/auto_check_sbp_imu_MsgImuRaw.cc index c1559581b..aba8b748c 100644 --- a/c/test/cpp/auto_check_sbp_imu_MsgImuRaw.cc +++ b/c/test/cpp/auto_check_sbp_imu_MsgImuRaw.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuRaw.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuRaw.yaml by generate.py. Do not +// modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_imu_MsgImuRaw0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_imu_MsgImuRaw0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_imu_MsgImuRaw0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_imu_MsgImuRaw0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_imu_raw_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_imu_raw_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,46 +67,63 @@ class Test_auto_check_sbp_imu_MsgImuRaw0 : sbp_msg_imu_raw_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_imu_MsgImuRaw0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_imu_MsgImuRaw0, Test) { + uint8_t encoded_frame[] = { + 85, 0, 9, 52, 18, 17, 26, 1, 0, 192, 206, 96, 0, + 223, 255, 44, 16, 60, 0, 208, 254, 238, 255, 70, 135, + }; - uint8_t encoded_frame[] = {85,0,9,52,18,17,26,1,0,192,206,96,0,223,255,44,16,60,0,208,254,238,255,70,135, }; + sbp_msg_imu_raw_t test_msg{}; + test_msg.acc_x = 96; + test_msg.acc_y = -33; + test_msg.acc_z = 4140; + test_msg.gyr_x = 60; + test_msg.gyr_y = -304; + test_msg.gyr_z = -18; + test_msg.tow = 3221225754; + test_msg.tow_f = 206; - sbp_msg_imu_raw_t test_msg{}; - test_msg.acc_x = 96; - test_msg.acc_y = -33; - test_msg.acc_z = 4140; - test_msg.gyr_x = 60; - test_msg.gyr_y = -304; - test_msg.gyr_z = -18; - test_msg.tow = 3221225754; - test_msg.tow_f = 206; - - EXPECT_EQ(send_message( 4660, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(4660, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4660); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.acc_x, 96) << "incorrect value for last_msg_.acc_x, expected 96, is " << last_msg_.acc_x; - EXPECT_EQ(last_msg_.acc_y, -33) << "incorrect value for last_msg_.acc_y, expected -33, is " << last_msg_.acc_y; - EXPECT_EQ(last_msg_.acc_z, 4140) << "incorrect value for last_msg_.acc_z, expected 4140, is " << last_msg_.acc_z; - EXPECT_EQ(last_msg_.gyr_x, 60) << "incorrect value for last_msg_.gyr_x, expected 60, is " << last_msg_.gyr_x; - EXPECT_EQ(last_msg_.gyr_y, -304) << "incorrect value for last_msg_.gyr_y, expected -304, is " << last_msg_.gyr_y; - EXPECT_EQ(last_msg_.gyr_z, -18) << "incorrect value for last_msg_.gyr_z, expected -18, is " << last_msg_.gyr_z; - EXPECT_EQ(last_msg_.tow, 3221225754) << "incorrect value for last_msg_.tow, expected 3221225754, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.tow_f, 206) << "incorrect value for last_msg_.tow_f, expected 206, is " << last_msg_.tow_f; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4660); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.acc_x, 96) + << "incorrect value for last_msg_.acc_x, expected 96, is " + << last_msg_.acc_x; + EXPECT_EQ(last_msg_.acc_y, -33) + << "incorrect value for last_msg_.acc_y, expected -33, is " + << last_msg_.acc_y; + EXPECT_EQ(last_msg_.acc_z, 4140) + << "incorrect value for last_msg_.acc_z, expected 4140, is " + << last_msg_.acc_z; + EXPECT_EQ(last_msg_.gyr_x, 60) + << "incorrect value for last_msg_.gyr_x, expected 60, is " + << last_msg_.gyr_x; + EXPECT_EQ(last_msg_.gyr_y, -304) + << "incorrect value for last_msg_.gyr_y, expected -304, is " + << last_msg_.gyr_y; + EXPECT_EQ(last_msg_.gyr_z, -18) + << "incorrect value for last_msg_.gyr_z, expected -18, is " + << last_msg_.gyr_z; + EXPECT_EQ(last_msg_.tow, 3221225754) + << "incorrect value for last_msg_.tow, expected 3221225754, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.tow_f, 206) + << "incorrect value for last_msg_.tow_f, expected 206, is " + << last_msg_.tow_f; } diff --git a/c/test/cpp/auto_check_sbp_integrity_MsgAcknowledge.cc b/c/test/cpp/auto_check_sbp_integrity_MsgAcknowledge.cc index fc411ac67..3274f588e 100644 --- a/c/test/cpp/auto_check_sbp_integrity_MsgAcknowledge.cc +++ b/c/test/cpp/auto_check_sbp_integrity_MsgAcknowledge.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgAcknowledge.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgAcknowledge.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_integrity_MsgAcknowledge0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_integrity_MsgAcknowledge0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_integrity_MsgAcknowledge0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_integrity_MsgAcknowledge0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_acknowledge_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_acknowledge_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,42 +67,55 @@ class Test_auto_check_sbp_integrity_MsgAcknowledge0 : sbp_msg_acknowledge_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_integrity_MsgAcknowledge0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_integrity_MsgAcknowledge0, Test) { + uint8_t encoded_frame[] = { + 85, 210, 11, 42, 0, 11, 30, 64, 226, 1, 0, 0, 1, 0, 1, 0, 2, 86, 178, + }; - uint8_t encoded_frame[] = {85,210,11,42,0,11,30,64,226,1,0,0,1,0,1,0,2,86,178, }; + sbp_msg_acknowledge_t test_msg{}; + test_msg.area_id = 123456; + test_msg.correction_mask_on_demand = 1; + test_msg.correction_mask_stream = 1; + test_msg.request_id = 30; + test_msg.response_code = 0; + test_msg.solution_id = 2; - sbp_msg_acknowledge_t test_msg{}; - test_msg.area_id = 123456; - test_msg.correction_mask_on_demand = 1; - test_msg.correction_mask_stream = 1; - test_msg.request_id = 30; - test_msg.response_code = 0; - test_msg.solution_id = 2; - - EXPECT_EQ(send_message( 42, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(42, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 42); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.area_id, 123456) << "incorrect value for last_msg_.area_id, expected 123456, is " << last_msg_.area_id; - EXPECT_EQ(last_msg_.correction_mask_on_demand, 1) << "incorrect value for last_msg_.correction_mask_on_demand, expected 1, is " << last_msg_.correction_mask_on_demand; - EXPECT_EQ(last_msg_.correction_mask_stream, 1) << "incorrect value for last_msg_.correction_mask_stream, expected 1, is " << last_msg_.correction_mask_stream; - EXPECT_EQ(last_msg_.request_id, 30) << "incorrect value for last_msg_.request_id, expected 30, is " << last_msg_.request_id; - EXPECT_EQ(last_msg_.response_code, 0) << "incorrect value for last_msg_.response_code, expected 0, is " << last_msg_.response_code; - EXPECT_EQ(last_msg_.solution_id, 2) << "incorrect value for last_msg_.solution_id, expected 2, is " << last_msg_.solution_id; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 42); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.area_id, 123456) + << "incorrect value for last_msg_.area_id, expected 123456, is " + << last_msg_.area_id; + EXPECT_EQ(last_msg_.correction_mask_on_demand, 1) + << "incorrect value for last_msg_.correction_mask_on_demand, expected 1, " + "is " + << last_msg_.correction_mask_on_demand; + EXPECT_EQ(last_msg_.correction_mask_stream, 1) + << "incorrect value for last_msg_.correction_mask_stream, expected 1, is " + << last_msg_.correction_mask_stream; + EXPECT_EQ(last_msg_.request_id, 30) + << "incorrect value for last_msg_.request_id, expected 30, is " + << last_msg_.request_id; + EXPECT_EQ(last_msg_.response_code, 0) + << "incorrect value for last_msg_.response_code, expected 0, is " + << last_msg_.response_code; + EXPECT_EQ(last_msg_.solution_id, 2) + << "incorrect value for last_msg_.solution_id, expected 2, is " + << last_msg_.solution_id; } diff --git a/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagHighLevel.cc b/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagHighLevel.cc index 78e362bbf..21dfbfe29 100644 --- a/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagHighLevel.cc +++ b/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagHighLevel.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagHighLevel.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagHighLevel.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_integrity_MsgSsrFlagHighLevel0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_integrity_MsgSsrFlagHighLevel0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_integrity_MsgSsrFlagHighLevel0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_integrity_MsgSsrFlagHighLevel0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_flag_high_level_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_flag_high_level_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,78 +67,122 @@ class Test_auto_check_sbp_integrity_MsgSsrFlagHighLevel0 : sbp_msg_ssr_flag_high_level_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_integrity_MsgSsrFlagHighLevel0, Test) -{ - - uint8_t encoded_frame[] = {85,185,11,66,0,31,180,0,0,0,3,0,104,1,0,0,6,0,10,20,0,30,0,40,1,2,3,0,0,0,0,0,0,4,5,6,7,102,67, }; - - sbp_msg_ssr_flag_high_level_t test_msg{}; - test_msg.chain_id = 40; - test_msg.corr_time.tow = 360; - test_msg.corr_time.wn = 6; - test_msg.obs_time.tow = 180; - test_msg.obs_time.wn = 3; - - test_msg.reserved[0] = 0; - - test_msg.reserved[1] = 0; - - test_msg.reserved[2] = 0; - - test_msg.reserved[3] = 0; - - test_msg.reserved[4] = 0; - - test_msg.reserved[5] = 0; - test_msg.ssr_sol_id = 10; - test_msg.tile_id = 30; - test_msg.tile_set_id = 20; - test_msg.use_bds_sat = 3; - test_msg.use_gal_sat = 2; - test_msg.use_gps_sat = 1; - test_msg.use_iono_grid_point_sat_los = 7; - test_msg.use_iono_grid_points = 5; - test_msg.use_iono_tile_sat_los = 6; - test_msg.use_tropo_grid_points = 4; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.chain_id, 40) << "incorrect value for last_msg_.chain_id, expected 40, is " << last_msg_.chain_id; - EXPECT_EQ(last_msg_.corr_time.tow, 360) << "incorrect value for last_msg_.corr_time.tow, expected 360, is " << last_msg_.corr_time.tow; - EXPECT_EQ(last_msg_.corr_time.wn, 6) << "incorrect value for last_msg_.corr_time.wn, expected 6, is " << last_msg_.corr_time.wn; - EXPECT_EQ(last_msg_.obs_time.tow, 180) << "incorrect value for last_msg_.obs_time.tow, expected 180, is " << last_msg_.obs_time.tow; - EXPECT_EQ(last_msg_.obs_time.wn, 3) << "incorrect value for last_msg_.obs_time.wn, expected 3, is " << last_msg_.obs_time.wn; - EXPECT_EQ(last_msg_.reserved[0], 0) << "incorrect value for last_msg_.reserved[0], expected 0, is " << last_msg_.reserved[0]; - EXPECT_EQ(last_msg_.reserved[1], 0) << "incorrect value for last_msg_.reserved[1], expected 0, is " << last_msg_.reserved[1]; - EXPECT_EQ(last_msg_.reserved[2], 0) << "incorrect value for last_msg_.reserved[2], expected 0, is " << last_msg_.reserved[2]; - EXPECT_EQ(last_msg_.reserved[3], 0) << "incorrect value for last_msg_.reserved[3], expected 0, is " << last_msg_.reserved[3]; - EXPECT_EQ(last_msg_.reserved[4], 0) << "incorrect value for last_msg_.reserved[4], expected 0, is " << last_msg_.reserved[4]; - EXPECT_EQ(last_msg_.reserved[5], 0) << "incorrect value for last_msg_.reserved[5], expected 0, is " << last_msg_.reserved[5]; - EXPECT_EQ(last_msg_.ssr_sol_id, 10) << "incorrect value for last_msg_.ssr_sol_id, expected 10, is " << last_msg_.ssr_sol_id; - EXPECT_EQ(last_msg_.tile_id, 30) << "incorrect value for last_msg_.tile_id, expected 30, is " << last_msg_.tile_id; - EXPECT_EQ(last_msg_.tile_set_id, 20) << "incorrect value for last_msg_.tile_set_id, expected 20, is " << last_msg_.tile_set_id; - EXPECT_EQ(last_msg_.use_bds_sat, 3) << "incorrect value for last_msg_.use_bds_sat, expected 3, is " << last_msg_.use_bds_sat; - EXPECT_EQ(last_msg_.use_gal_sat, 2) << "incorrect value for last_msg_.use_gal_sat, expected 2, is " << last_msg_.use_gal_sat; - EXPECT_EQ(last_msg_.use_gps_sat, 1) << "incorrect value for last_msg_.use_gps_sat, expected 1, is " << last_msg_.use_gps_sat; - EXPECT_EQ(last_msg_.use_iono_grid_point_sat_los, 7) << "incorrect value for last_msg_.use_iono_grid_point_sat_los, expected 7, is " << last_msg_.use_iono_grid_point_sat_los; - EXPECT_EQ(last_msg_.use_iono_grid_points, 5) << "incorrect value for last_msg_.use_iono_grid_points, expected 5, is " << last_msg_.use_iono_grid_points; - EXPECT_EQ(last_msg_.use_iono_tile_sat_los, 6) << "incorrect value for last_msg_.use_iono_tile_sat_los, expected 6, is " << last_msg_.use_iono_tile_sat_los; - EXPECT_EQ(last_msg_.use_tropo_grid_points, 4) << "incorrect value for last_msg_.use_tropo_grid_points, expected 4, is " << last_msg_.use_tropo_grid_points; +}; + +TEST_F(Test_auto_check_sbp_integrity_MsgSsrFlagHighLevel0, Test) { + uint8_t encoded_frame[] = { + 85, 185, 11, 66, 0, 31, 180, 0, 0, 0, 3, 0, 104, 1, 0, 0, 6, 0, 10, 20, + 0, 30, 0, 40, 1, 2, 3, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7, 102, 67, + }; + + sbp_msg_ssr_flag_high_level_t test_msg{}; + test_msg.chain_id = 40; + test_msg.corr_time.tow = 360; + test_msg.corr_time.wn = 6; + test_msg.obs_time.tow = 180; + test_msg.obs_time.wn = 3; + + test_msg.reserved[0] = 0; + + test_msg.reserved[1] = 0; + + test_msg.reserved[2] = 0; + + test_msg.reserved[3] = 0; + + test_msg.reserved[4] = 0; + + test_msg.reserved[5] = 0; + test_msg.ssr_sol_id = 10; + test_msg.tile_id = 30; + test_msg.tile_set_id = 20; + test_msg.use_bds_sat = 3; + test_msg.use_gal_sat = 2; + test_msg.use_gps_sat = 1; + test_msg.use_iono_grid_point_sat_los = 7; + test_msg.use_iono_grid_points = 5; + test_msg.use_iono_tile_sat_los = 6; + test_msg.use_tropo_grid_points = 4; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.chain_id, 40) + << "incorrect value for last_msg_.chain_id, expected 40, is " + << last_msg_.chain_id; + EXPECT_EQ(last_msg_.corr_time.tow, 360) + << "incorrect value for last_msg_.corr_time.tow, expected 360, is " + << last_msg_.corr_time.tow; + EXPECT_EQ(last_msg_.corr_time.wn, 6) + << "incorrect value for last_msg_.corr_time.wn, expected 6, is " + << last_msg_.corr_time.wn; + EXPECT_EQ(last_msg_.obs_time.tow, 180) + << "incorrect value for last_msg_.obs_time.tow, expected 180, is " + << last_msg_.obs_time.tow; + EXPECT_EQ(last_msg_.obs_time.wn, 3) + << "incorrect value for last_msg_.obs_time.wn, expected 3, is " + << last_msg_.obs_time.wn; + EXPECT_EQ(last_msg_.reserved[0], 0) + << "incorrect value for last_msg_.reserved[0], expected 0, is " + << last_msg_.reserved[0]; + EXPECT_EQ(last_msg_.reserved[1], 0) + << "incorrect value for last_msg_.reserved[1], expected 0, is " + << last_msg_.reserved[1]; + EXPECT_EQ(last_msg_.reserved[2], 0) + << "incorrect value for last_msg_.reserved[2], expected 0, is " + << last_msg_.reserved[2]; + EXPECT_EQ(last_msg_.reserved[3], 0) + << "incorrect value for last_msg_.reserved[3], expected 0, is " + << last_msg_.reserved[3]; + EXPECT_EQ(last_msg_.reserved[4], 0) + << "incorrect value for last_msg_.reserved[4], expected 0, is " + << last_msg_.reserved[4]; + EXPECT_EQ(last_msg_.reserved[5], 0) + << "incorrect value for last_msg_.reserved[5], expected 0, is " + << last_msg_.reserved[5]; + EXPECT_EQ(last_msg_.ssr_sol_id, 10) + << "incorrect value for last_msg_.ssr_sol_id, expected 10, is " + << last_msg_.ssr_sol_id; + EXPECT_EQ(last_msg_.tile_id, 30) + << "incorrect value for last_msg_.tile_id, expected 30, is " + << last_msg_.tile_id; + EXPECT_EQ(last_msg_.tile_set_id, 20) + << "incorrect value for last_msg_.tile_set_id, expected 20, is " + << last_msg_.tile_set_id; + EXPECT_EQ(last_msg_.use_bds_sat, 3) + << "incorrect value for last_msg_.use_bds_sat, expected 3, is " + << last_msg_.use_bds_sat; + EXPECT_EQ(last_msg_.use_gal_sat, 2) + << "incorrect value for last_msg_.use_gal_sat, expected 2, is " + << last_msg_.use_gal_sat; + EXPECT_EQ(last_msg_.use_gps_sat, 1) + << "incorrect value for last_msg_.use_gps_sat, expected 1, is " + << last_msg_.use_gps_sat; + EXPECT_EQ(last_msg_.use_iono_grid_point_sat_los, 7) + << "incorrect value for last_msg_.use_iono_grid_point_sat_los, expected " + "7, is " + << last_msg_.use_iono_grid_point_sat_los; + EXPECT_EQ(last_msg_.use_iono_grid_points, 5) + << "incorrect value for last_msg_.use_iono_grid_points, expected 5, is " + << last_msg_.use_iono_grid_points; + EXPECT_EQ(last_msg_.use_iono_tile_sat_los, 6) + << "incorrect value for last_msg_.use_iono_tile_sat_los, expected 6, is " + << last_msg_.use_iono_tile_sat_los; + EXPECT_EQ(last_msg_.use_tropo_grid_points, 4) + << "incorrect value for last_msg_.use_tropo_grid_points, expected 4, is " + << last_msg_.use_tropo_grid_points; } diff --git a/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.cc b/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.cc index 24edf5b55..93ac24835 100644 --- a/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.cc +++ b/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.cc @@ -10,60 +10,57 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPointSatLos.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPointSatLos.yaml +// by generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_ssr_flag_iono_grid_point_sat_los_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,76 +68,128 @@ class Test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos0 : sbp_msg_ssr_flag_iono_grid_point_sat_los_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos0, Test) { + uint8_t encoded_frame[] = { + 85, 209, 11, 66, 0, 21, 180, 0, 0, 0, 3, 0, 1, 2, 3, + 4, 0, 5, 0, 6, 30, 0, 2, 10, 11, 15, 14, 98, 148, + }; - uint8_t encoded_frame[] = {85,209,11,66,0,21,180,0,0,0,3,0,1,2,3,4,0,5,0,6,30,0,2,10,11,15,14,98,148, }; + sbp_msg_ssr_flag_iono_grid_point_sat_los_t test_msg{}; - sbp_msg_ssr_flag_iono_grid_point_sat_los_t test_msg{}; - - test_msg.faulty_los[0].constellation = 11; - test_msg.faulty_los[0].satId = 10; - - test_msg.faulty_los[1].constellation = 14; - test_msg.faulty_los[1].satId = 15; - test_msg.grid_point_id = 30; - test_msg.header.chain_id = 6; - test_msg.header.num_msgs = 1; - test_msg.header.obs_time.tow = 180; - test_msg.header.obs_time.wn = 3; - test_msg.header.seq_num = 2; - test_msg.header.ssr_sol_id = 3; - test_msg.header.tile_id = 5; - test_msg.header.tile_set_id = 4; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_faulty_los.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)102,(char)97,(char)117,(char)108,(char)116,(char)121,(char)95,(char)108,(char)111,(char)115 }; - memcpy(test_msg.n_faulty_los.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_faulty_los.value = 2; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + test_msg.faulty_los[0].constellation = 11; + test_msg.faulty_los[0].satId = 10; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.faulty_los[0].constellation, 11) << "incorrect value for last_msg_.faulty_los[0].constellation, expected 11, is " << last_msg_.faulty_los[0].constellation; - EXPECT_EQ(last_msg_.faulty_los[0].satId, 10) << "incorrect value for last_msg_.faulty_los[0].satId, expected 10, is " << last_msg_.faulty_los[0].satId; - EXPECT_EQ(last_msg_.faulty_los[1].constellation, 14) << "incorrect value for last_msg_.faulty_los[1].constellation, expected 14, is " << last_msg_.faulty_los[1].constellation; - EXPECT_EQ(last_msg_.faulty_los[1].satId, 15) << "incorrect value for last_msg_.faulty_los[1].satId, expected 15, is " << last_msg_.faulty_los[1].satId; - EXPECT_EQ(last_msg_.grid_point_id, 30) << "incorrect value for last_msg_.grid_point_id, expected 30, is " << last_msg_.grid_point_id; - EXPECT_EQ(last_msg_.header.chain_id, 6) << "incorrect value for last_msg_.header.chain_id, expected 6, is " << last_msg_.header.chain_id; - EXPECT_EQ(last_msg_.header.num_msgs, 1) << "incorrect value for last_msg_.header.num_msgs, expected 1, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.obs_time.tow, 180) << "incorrect value for last_msg_.header.obs_time.tow, expected 180, is " << last_msg_.header.obs_time.tow; - EXPECT_EQ(last_msg_.header.obs_time.wn, 3) << "incorrect value for last_msg_.header.obs_time.wn, expected 3, is " << last_msg_.header.obs_time.wn; - EXPECT_EQ(last_msg_.header.seq_num, 2) << "incorrect value for last_msg_.header.seq_num, expected 2, is " << last_msg_.header.seq_num; - EXPECT_EQ(last_msg_.header.ssr_sol_id, 3) << "incorrect value for last_msg_.header.ssr_sol_id, expected 3, is " << last_msg_.header.ssr_sol_id; - EXPECT_EQ(last_msg_.header.tile_id, 5) << "incorrect value for last_msg_.header.tile_id, expected 5, is " << last_msg_.header.tile_id; - EXPECT_EQ(last_msg_.header.tile_set_id, 4) << "incorrect value for last_msg_.header.tile_set_id, expected 4, is " << last_msg_.header.tile_set_id; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_faulty_los.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_faulty_los.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_faulty_los.handle_as << "'"; - } - { - const char check_string[] = { (char)102,(char)97,(char)117,(char)108,(char)116,(char)121,(char)95,(char)108,(char)111,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_faulty_los.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_faulty_los.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_faulty_los.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_faulty_los.value, 2) << "incorrect value for last_msg_.n_faulty_los.value, expected 2, is " << last_msg_.n_faulty_los.value; + test_msg.faulty_los[1].constellation = 14; + test_msg.faulty_los[1].satId = 15; + test_msg.grid_point_id = 30; + test_msg.header.chain_id = 6; + test_msg.header.num_msgs = 1; + test_msg.header.obs_time.tow = 180; + test_msg.header.obs_time.wn = 3; + test_msg.header.seq_num = 2; + test_msg.header.ssr_sol_id = 3; + test_msg.header.tile_id = 5; + test_msg.header.tile_set_id = 4; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_faulty_los.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)102, (char)97, (char)117, (char)108, + (char)116, (char)121, (char)95, (char)108, + (char)111, (char)115}; + memcpy(test_msg.n_faulty_los.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_faulty_los.value = 2; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.faulty_los[0].constellation, 11) + << "incorrect value for last_msg_.faulty_los[0].constellation, expected " + "11, is " + << last_msg_.faulty_los[0].constellation; + EXPECT_EQ(last_msg_.faulty_los[0].satId, 10) + << "incorrect value for last_msg_.faulty_los[0].satId, expected 10, is " + << last_msg_.faulty_los[0].satId; + EXPECT_EQ(last_msg_.faulty_los[1].constellation, 14) + << "incorrect value for last_msg_.faulty_los[1].constellation, expected " + "14, is " + << last_msg_.faulty_los[1].constellation; + EXPECT_EQ(last_msg_.faulty_los[1].satId, 15) + << "incorrect value for last_msg_.faulty_los[1].satId, expected 15, is " + << last_msg_.faulty_los[1].satId; + EXPECT_EQ(last_msg_.grid_point_id, 30) + << "incorrect value for last_msg_.grid_point_id, expected 30, is " + << last_msg_.grid_point_id; + EXPECT_EQ(last_msg_.header.chain_id, 6) + << "incorrect value for last_msg_.header.chain_id, expected 6, is " + << last_msg_.header.chain_id; + EXPECT_EQ(last_msg_.header.num_msgs, 1) + << "incorrect value for last_msg_.header.num_msgs, expected 1, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.obs_time.tow, 180) + << "incorrect value for last_msg_.header.obs_time.tow, expected 180, is " + << last_msg_.header.obs_time.tow; + EXPECT_EQ(last_msg_.header.obs_time.wn, 3) + << "incorrect value for last_msg_.header.obs_time.wn, expected 3, is " + << last_msg_.header.obs_time.wn; + EXPECT_EQ(last_msg_.header.seq_num, 2) + << "incorrect value for last_msg_.header.seq_num, expected 2, is " + << last_msg_.header.seq_num; + EXPECT_EQ(last_msg_.header.ssr_sol_id, 3) + << "incorrect value for last_msg_.header.ssr_sol_id, expected 3, is " + << last_msg_.header.ssr_sol_id; + EXPECT_EQ(last_msg_.header.tile_id, 5) + << "incorrect value for last_msg_.header.tile_id, expected 5, is " + << last_msg_.header.tile_id; + EXPECT_EQ(last_msg_.header.tile_set_id, 4) + << "incorrect value for last_msg_.header.tile_set_id, expected 4, is " + << last_msg_.header.tile_set_id; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_faulty_los.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_faulty_los.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_faulty_los.handle_as << "'"; + } + { + const char check_string[] = {(char)102, (char)97, (char)117, (char)108, + (char)116, (char)121, (char)95, (char)108, + (char)111, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_faulty_los.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_faulty_los.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_faulty_los.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_faulty_los.value, 2) + << "incorrect value for last_msg_.n_faulty_los.value, expected 2, is " + << last_msg_.n_faulty_los.value; } diff --git a/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.cc b/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.cc index 1a9b5a3be..2a83d6328 100644 --- a/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.cc +++ b/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPoints.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPoints.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_flag_iono_grid_points_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_flag_iono_grid_points_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,73 +67,122 @@ class Test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints0 : sbp_msg_ssr_flag_iono_grid_points_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints0, Test) { + uint8_t encoded_frame[] = { + 85, 199, 11, 66, 0, 21, 180, 0, 0, 0, 3, 0, 1, 2, 3, + 4, 0, 5, 0, 6, 3, 10, 0, 11, 0, 12, 0, 53, 7, + }; + + sbp_msg_ssr_flag_iono_grid_points_t test_msg{}; - uint8_t encoded_frame[] = {85,199,11,66,0,21,180,0,0,0,3,0,1,2,3,4,0,5,0,6,3,10,0,11,0,12,0,53,7, }; + test_msg.faulty_points[0] = 10; - sbp_msg_ssr_flag_iono_grid_points_t test_msg{}; - - test_msg.faulty_points[0] = 10; - - test_msg.faulty_points[1] = 11; - - test_msg.faulty_points[2] = 12; - test_msg.header.chain_id = 6; - test_msg.header.num_msgs = 1; - test_msg.header.obs_time.tow = 180; - test_msg.header.obs_time.wn = 3; - test_msg.header.seq_num = 2; - test_msg.header.ssr_sol_id = 3; - test_msg.header.tile_id = 5; - test_msg.header.tile_set_id = 4; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_faulty_points.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)102,(char)97,(char)117,(char)108,(char)116,(char)121,(char)95,(char)112,(char)111,(char)105,(char)110,(char)116,(char)115 }; - memcpy(test_msg.n_faulty_points.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_faulty_points.value = 3; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + test_msg.faulty_points[1] = 11; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.faulty_points[0], 10) << "incorrect value for last_msg_.faulty_points[0], expected 10, is " << last_msg_.faulty_points[0]; - EXPECT_EQ(last_msg_.faulty_points[1], 11) << "incorrect value for last_msg_.faulty_points[1], expected 11, is " << last_msg_.faulty_points[1]; - EXPECT_EQ(last_msg_.faulty_points[2], 12) << "incorrect value for last_msg_.faulty_points[2], expected 12, is " << last_msg_.faulty_points[2]; - EXPECT_EQ(last_msg_.header.chain_id, 6) << "incorrect value for last_msg_.header.chain_id, expected 6, is " << last_msg_.header.chain_id; - EXPECT_EQ(last_msg_.header.num_msgs, 1) << "incorrect value for last_msg_.header.num_msgs, expected 1, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.obs_time.tow, 180) << "incorrect value for last_msg_.header.obs_time.tow, expected 180, is " << last_msg_.header.obs_time.tow; - EXPECT_EQ(last_msg_.header.obs_time.wn, 3) << "incorrect value for last_msg_.header.obs_time.wn, expected 3, is " << last_msg_.header.obs_time.wn; - EXPECT_EQ(last_msg_.header.seq_num, 2) << "incorrect value for last_msg_.header.seq_num, expected 2, is " << last_msg_.header.seq_num; - EXPECT_EQ(last_msg_.header.ssr_sol_id, 3) << "incorrect value for last_msg_.header.ssr_sol_id, expected 3, is " << last_msg_.header.ssr_sol_id; - EXPECT_EQ(last_msg_.header.tile_id, 5) << "incorrect value for last_msg_.header.tile_id, expected 5, is " << last_msg_.header.tile_id; - EXPECT_EQ(last_msg_.header.tile_set_id, 4) << "incorrect value for last_msg_.header.tile_set_id, expected 4, is " << last_msg_.header.tile_set_id; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_faulty_points.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_faulty_points.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_faulty_points.handle_as << "'"; - } - { - const char check_string[] = { (char)102,(char)97,(char)117,(char)108,(char)116,(char)121,(char)95,(char)112,(char)111,(char)105,(char)110,(char)116,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_faulty_points.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_faulty_points.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_faulty_points.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_faulty_points.value, 3) << "incorrect value for last_msg_.n_faulty_points.value, expected 3, is " << last_msg_.n_faulty_points.value; + test_msg.faulty_points[2] = 12; + test_msg.header.chain_id = 6; + test_msg.header.num_msgs = 1; + test_msg.header.obs_time.tow = 180; + test_msg.header.obs_time.wn = 3; + test_msg.header.seq_num = 2; + test_msg.header.ssr_sol_id = 3; + test_msg.header.tile_id = 5; + test_msg.header.tile_set_id = 4; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_faulty_points.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)102, (char)97, (char)117, (char)108, + (char)116, (char)121, (char)95, (char)112, + (char)111, (char)105, (char)110, (char)116, + (char)115}; + memcpy(test_msg.n_faulty_points.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_faulty_points.value = 3; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.faulty_points[0], 10) + << "incorrect value for last_msg_.faulty_points[0], expected 10, is " + << last_msg_.faulty_points[0]; + EXPECT_EQ(last_msg_.faulty_points[1], 11) + << "incorrect value for last_msg_.faulty_points[1], expected 11, is " + << last_msg_.faulty_points[1]; + EXPECT_EQ(last_msg_.faulty_points[2], 12) + << "incorrect value for last_msg_.faulty_points[2], expected 12, is " + << last_msg_.faulty_points[2]; + EXPECT_EQ(last_msg_.header.chain_id, 6) + << "incorrect value for last_msg_.header.chain_id, expected 6, is " + << last_msg_.header.chain_id; + EXPECT_EQ(last_msg_.header.num_msgs, 1) + << "incorrect value for last_msg_.header.num_msgs, expected 1, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.obs_time.tow, 180) + << "incorrect value for last_msg_.header.obs_time.tow, expected 180, is " + << last_msg_.header.obs_time.tow; + EXPECT_EQ(last_msg_.header.obs_time.wn, 3) + << "incorrect value for last_msg_.header.obs_time.wn, expected 3, is " + << last_msg_.header.obs_time.wn; + EXPECT_EQ(last_msg_.header.seq_num, 2) + << "incorrect value for last_msg_.header.seq_num, expected 2, is " + << last_msg_.header.seq_num; + EXPECT_EQ(last_msg_.header.ssr_sol_id, 3) + << "incorrect value for last_msg_.header.ssr_sol_id, expected 3, is " + << last_msg_.header.ssr_sol_id; + EXPECT_EQ(last_msg_.header.tile_id, 5) + << "incorrect value for last_msg_.header.tile_id, expected 5, is " + << last_msg_.header.tile_id; + EXPECT_EQ(last_msg_.header.tile_set_id, 4) + << "incorrect value for last_msg_.header.tile_set_id, expected 4, is " + << last_msg_.header.tile_set_id; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_faulty_points.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_faulty_points.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_faulty_points.handle_as + << "'"; + } + { + const char check_string[] = {(char)102, (char)97, (char)117, (char)108, + (char)116, (char)121, (char)95, (char)112, + (char)111, (char)105, (char)110, (char)116, + (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_faulty_points.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_faulty_points.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_faulty_points.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_faulty_points.value, 3) + << "incorrect value for last_msg_.n_faulty_points.value, expected 3, is " + << last_msg_.n_faulty_points.value; } diff --git a/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.cc b/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.cc index 138300701..d64266a58 100644 --- a/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.cc +++ b/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.cc @@ -10,60 +10,57 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoTileSatLos.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoTileSatLos.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_flag_iono_tile_sat_los_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_ssr_flag_iono_tile_sat_los_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,74 +68,124 @@ class Test_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos0 : sbp_msg_ssr_flag_iono_tile_sat_los_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos0, Test) { + uint8_t encoded_frame[] = { + 85, 205, 11, 66, 0, 19, 180, 0, 0, 0, 3, 0, 1, 2, + 3, 4, 0, 5, 0, 6, 2, 10, 11, 15, 14, 239, 235, + }; - uint8_t encoded_frame[] = {85,205,11,66,0,19,180,0,0,0,3,0,1,2,3,4,0,5,0,6,2,10,11,15,14,239,235, }; + sbp_msg_ssr_flag_iono_tile_sat_los_t test_msg{}; - sbp_msg_ssr_flag_iono_tile_sat_los_t test_msg{}; - - test_msg.faulty_los[0].constellation = 11; - test_msg.faulty_los[0].satId = 10; - - test_msg.faulty_los[1].constellation = 14; - test_msg.faulty_los[1].satId = 15; - test_msg.header.chain_id = 6; - test_msg.header.num_msgs = 1; - test_msg.header.obs_time.tow = 180; - test_msg.header.obs_time.wn = 3; - test_msg.header.seq_num = 2; - test_msg.header.ssr_sol_id = 3; - test_msg.header.tile_id = 5; - test_msg.header.tile_set_id = 4; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_faulty_los.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)102,(char)97,(char)117,(char)108,(char)116,(char)121,(char)95,(char)108,(char)111,(char)115 }; - memcpy(test_msg.n_faulty_los.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_faulty_los.value = 2; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + test_msg.faulty_los[0].constellation = 11; + test_msg.faulty_los[0].satId = 10; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.faulty_los[0].constellation, 11) << "incorrect value for last_msg_.faulty_los[0].constellation, expected 11, is " << last_msg_.faulty_los[0].constellation; - EXPECT_EQ(last_msg_.faulty_los[0].satId, 10) << "incorrect value for last_msg_.faulty_los[0].satId, expected 10, is " << last_msg_.faulty_los[0].satId; - EXPECT_EQ(last_msg_.faulty_los[1].constellation, 14) << "incorrect value for last_msg_.faulty_los[1].constellation, expected 14, is " << last_msg_.faulty_los[1].constellation; - EXPECT_EQ(last_msg_.faulty_los[1].satId, 15) << "incorrect value for last_msg_.faulty_los[1].satId, expected 15, is " << last_msg_.faulty_los[1].satId; - EXPECT_EQ(last_msg_.header.chain_id, 6) << "incorrect value for last_msg_.header.chain_id, expected 6, is " << last_msg_.header.chain_id; - EXPECT_EQ(last_msg_.header.num_msgs, 1) << "incorrect value for last_msg_.header.num_msgs, expected 1, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.obs_time.tow, 180) << "incorrect value for last_msg_.header.obs_time.tow, expected 180, is " << last_msg_.header.obs_time.tow; - EXPECT_EQ(last_msg_.header.obs_time.wn, 3) << "incorrect value for last_msg_.header.obs_time.wn, expected 3, is " << last_msg_.header.obs_time.wn; - EXPECT_EQ(last_msg_.header.seq_num, 2) << "incorrect value for last_msg_.header.seq_num, expected 2, is " << last_msg_.header.seq_num; - EXPECT_EQ(last_msg_.header.ssr_sol_id, 3) << "incorrect value for last_msg_.header.ssr_sol_id, expected 3, is " << last_msg_.header.ssr_sol_id; - EXPECT_EQ(last_msg_.header.tile_id, 5) << "incorrect value for last_msg_.header.tile_id, expected 5, is " << last_msg_.header.tile_id; - EXPECT_EQ(last_msg_.header.tile_set_id, 4) << "incorrect value for last_msg_.header.tile_set_id, expected 4, is " << last_msg_.header.tile_set_id; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_faulty_los.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_faulty_los.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_faulty_los.handle_as << "'"; - } - { - const char check_string[] = { (char)102,(char)97,(char)117,(char)108,(char)116,(char)121,(char)95,(char)108,(char)111,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_faulty_los.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_faulty_los.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_faulty_los.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_faulty_los.value, 2) << "incorrect value for last_msg_.n_faulty_los.value, expected 2, is " << last_msg_.n_faulty_los.value; + test_msg.faulty_los[1].constellation = 14; + test_msg.faulty_los[1].satId = 15; + test_msg.header.chain_id = 6; + test_msg.header.num_msgs = 1; + test_msg.header.obs_time.tow = 180; + test_msg.header.obs_time.wn = 3; + test_msg.header.seq_num = 2; + test_msg.header.ssr_sol_id = 3; + test_msg.header.tile_id = 5; + test_msg.header.tile_set_id = 4; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_faulty_los.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)102, (char)97, (char)117, (char)108, + (char)116, (char)121, (char)95, (char)108, + (char)111, (char)115}; + memcpy(test_msg.n_faulty_los.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_faulty_los.value = 2; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.faulty_los[0].constellation, 11) + << "incorrect value for last_msg_.faulty_los[0].constellation, expected " + "11, is " + << last_msg_.faulty_los[0].constellation; + EXPECT_EQ(last_msg_.faulty_los[0].satId, 10) + << "incorrect value for last_msg_.faulty_los[0].satId, expected 10, is " + << last_msg_.faulty_los[0].satId; + EXPECT_EQ(last_msg_.faulty_los[1].constellation, 14) + << "incorrect value for last_msg_.faulty_los[1].constellation, expected " + "14, is " + << last_msg_.faulty_los[1].constellation; + EXPECT_EQ(last_msg_.faulty_los[1].satId, 15) + << "incorrect value for last_msg_.faulty_los[1].satId, expected 15, is " + << last_msg_.faulty_los[1].satId; + EXPECT_EQ(last_msg_.header.chain_id, 6) + << "incorrect value for last_msg_.header.chain_id, expected 6, is " + << last_msg_.header.chain_id; + EXPECT_EQ(last_msg_.header.num_msgs, 1) + << "incorrect value for last_msg_.header.num_msgs, expected 1, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.obs_time.tow, 180) + << "incorrect value for last_msg_.header.obs_time.tow, expected 180, is " + << last_msg_.header.obs_time.tow; + EXPECT_EQ(last_msg_.header.obs_time.wn, 3) + << "incorrect value for last_msg_.header.obs_time.wn, expected 3, is " + << last_msg_.header.obs_time.wn; + EXPECT_EQ(last_msg_.header.seq_num, 2) + << "incorrect value for last_msg_.header.seq_num, expected 2, is " + << last_msg_.header.seq_num; + EXPECT_EQ(last_msg_.header.ssr_sol_id, 3) + << "incorrect value for last_msg_.header.ssr_sol_id, expected 3, is " + << last_msg_.header.ssr_sol_id; + EXPECT_EQ(last_msg_.header.tile_id, 5) + << "incorrect value for last_msg_.header.tile_id, expected 5, is " + << last_msg_.header.tile_id; + EXPECT_EQ(last_msg_.header.tile_set_id, 4) + << "incorrect value for last_msg_.header.tile_set_id, expected 4, is " + << last_msg_.header.tile_set_id; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_faulty_los.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_faulty_los.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_faulty_los.handle_as << "'"; + } + { + const char check_string[] = {(char)102, (char)97, (char)117, (char)108, + (char)116, (char)121, (char)95, (char)108, + (char)111, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_faulty_los.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_faulty_los.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_faulty_los.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_faulty_los.value, 2) + << "incorrect value for last_msg_.n_faulty_los.value, expected 2, is " + << last_msg_.n_faulty_los.value; } diff --git a/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagSatellites.cc b/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagSatellites.cc index 35968cda3..c13260cd1 100644 --- a/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagSatellites.cc +++ b/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagSatellites.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagSatellites.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagSatellites.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_integrity_MsgSsrFlagSatellites0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_integrity_MsgSsrFlagSatellites0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_integrity_MsgSsrFlagSatellites0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_integrity_MsgSsrFlagSatellites0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_flag_satellites_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_flag_satellites_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,71 +67,116 @@ class Test_auto_check_sbp_integrity_MsgSsrFlagSatellites0 : sbp_msg_ssr_flag_satellites_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_integrity_MsgSsrFlagSatellites0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_integrity_MsgSsrFlagSatellites0, Test) { + uint8_t encoded_frame[] = { + 85, 189, 11, 66, 0, 15, 180, 0, 0, 0, 3, 0, + 1, 2, 3, 4, 5, 3, 10, 11, 12, 110, 165, + }; + + sbp_msg_ssr_flag_satellites_t test_msg{}; + test_msg.chain_id = 4; + test_msg.const_id = 5; - uint8_t encoded_frame[] = {85,189,11,66,0,15,180,0,0,0,3,0,1,2,3,4,5,3,10,11,12,110,165, }; + test_msg.faulty_sats[0] = 10; - sbp_msg_ssr_flag_satellites_t test_msg{}; - test_msg.chain_id = 4; - test_msg.const_id = 5; - - test_msg.faulty_sats[0] = 10; - - test_msg.faulty_sats[1] = 11; - - test_msg.faulty_sats[2] = 12; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_faulty_sats.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)102,(char)97,(char)117,(char)108,(char)116,(char)121,(char)95,(char)115,(char)97,(char)116,(char)115 }; - memcpy(test_msg.n_faulty_sats.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_faulty_sats.value = 3; - test_msg.num_msgs = 1; - test_msg.obs_time.tow = 180; - test_msg.obs_time.wn = 3; - test_msg.seq_num = 2; - test_msg.ssr_sol_id = 3; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + test_msg.faulty_sats[1] = 11; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.chain_id, 4) << "incorrect value for last_msg_.chain_id, expected 4, is " << last_msg_.chain_id; - EXPECT_EQ(last_msg_.const_id, 5) << "incorrect value for last_msg_.const_id, expected 5, is " << last_msg_.const_id; - EXPECT_EQ(last_msg_.faulty_sats[0], 10) << "incorrect value for last_msg_.faulty_sats[0], expected 10, is " << last_msg_.faulty_sats[0]; - EXPECT_EQ(last_msg_.faulty_sats[1], 11) << "incorrect value for last_msg_.faulty_sats[1], expected 11, is " << last_msg_.faulty_sats[1]; - EXPECT_EQ(last_msg_.faulty_sats[2], 12) << "incorrect value for last_msg_.faulty_sats[2], expected 12, is " << last_msg_.faulty_sats[2]; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_faulty_sats.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_faulty_sats.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_faulty_sats.handle_as << "'"; - } - { - const char check_string[] = { (char)102,(char)97,(char)117,(char)108,(char)116,(char)121,(char)95,(char)115,(char)97,(char)116,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_faulty_sats.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_faulty_sats.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_faulty_sats.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_faulty_sats.value, 3) << "incorrect value for last_msg_.n_faulty_sats.value, expected 3, is " << last_msg_.n_faulty_sats.value; - EXPECT_EQ(last_msg_.num_msgs, 1) << "incorrect value for last_msg_.num_msgs, expected 1, is " << last_msg_.num_msgs; - EXPECT_EQ(last_msg_.obs_time.tow, 180) << "incorrect value for last_msg_.obs_time.tow, expected 180, is " << last_msg_.obs_time.tow; - EXPECT_EQ(last_msg_.obs_time.wn, 3) << "incorrect value for last_msg_.obs_time.wn, expected 3, is " << last_msg_.obs_time.wn; - EXPECT_EQ(last_msg_.seq_num, 2) << "incorrect value for last_msg_.seq_num, expected 2, is " << last_msg_.seq_num; - EXPECT_EQ(last_msg_.ssr_sol_id, 3) << "incorrect value for last_msg_.ssr_sol_id, expected 3, is " << last_msg_.ssr_sol_id; + test_msg.faulty_sats[2] = 12; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_faulty_sats.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)102, (char)97, (char)117, (char)108, + (char)116, (char)121, (char)95, (char)115, + (char)97, (char)116, (char)115}; + memcpy(test_msg.n_faulty_sats.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_faulty_sats.value = 3; + test_msg.num_msgs = 1; + test_msg.obs_time.tow = 180; + test_msg.obs_time.wn = 3; + test_msg.seq_num = 2; + test_msg.ssr_sol_id = 3; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.chain_id, 4) + << "incorrect value for last_msg_.chain_id, expected 4, is " + << last_msg_.chain_id; + EXPECT_EQ(last_msg_.const_id, 5) + << "incorrect value for last_msg_.const_id, expected 5, is " + << last_msg_.const_id; + EXPECT_EQ(last_msg_.faulty_sats[0], 10) + << "incorrect value for last_msg_.faulty_sats[0], expected 10, is " + << last_msg_.faulty_sats[0]; + EXPECT_EQ(last_msg_.faulty_sats[1], 11) + << "incorrect value for last_msg_.faulty_sats[1], expected 11, is " + << last_msg_.faulty_sats[1]; + EXPECT_EQ(last_msg_.faulty_sats[2], 12) + << "incorrect value for last_msg_.faulty_sats[2], expected 12, is " + << last_msg_.faulty_sats[2]; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_faulty_sats.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_faulty_sats.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_faulty_sats.handle_as + << "'"; + } + { + const char check_string[] = {(char)102, (char)97, (char)117, (char)108, + (char)116, (char)121, (char)95, (char)115, + (char)97, (char)116, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_faulty_sats.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_faulty_sats.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_faulty_sats.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_faulty_sats.value, 3) + << "incorrect value for last_msg_.n_faulty_sats.value, expected 3, is " + << last_msg_.n_faulty_sats.value; + EXPECT_EQ(last_msg_.num_msgs, 1) + << "incorrect value for last_msg_.num_msgs, expected 1, is " + << last_msg_.num_msgs; + EXPECT_EQ(last_msg_.obs_time.tow, 180) + << "incorrect value for last_msg_.obs_time.tow, expected 180, is " + << last_msg_.obs_time.tow; + EXPECT_EQ(last_msg_.obs_time.wn, 3) + << "incorrect value for last_msg_.obs_time.wn, expected 3, is " + << last_msg_.obs_time.wn; + EXPECT_EQ(last_msg_.seq_num, 2) + << "incorrect value for last_msg_.seq_num, expected 2, is " + << last_msg_.seq_num; + EXPECT_EQ(last_msg_.ssr_sol_id, 3) + << "incorrect value for last_msg_.ssr_sol_id, expected 3, is " + << last_msg_.ssr_sol_id; } diff --git a/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.cc b/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.cc index 7638e9df0..5ca60e9f2 100644 --- a/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.cc +++ b/c/test/cpp/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.cc @@ -10,60 +10,57 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagTropoGridPoints.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagTropoGridPoints.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_flag_tropo_grid_points_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_ssr_flag_tropo_grid_points_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,73 +68,122 @@ class Test_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints0 : sbp_msg_ssr_flag_tropo_grid_points_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints0, Test) { + uint8_t encoded_frame[] = { + 85, 195, 11, 66, 0, 21, 180, 0, 0, 0, 3, 0, 1, 2, 3, + 4, 0, 5, 0, 6, 3, 10, 0, 11, 0, 12, 0, 243, 150, + }; + + sbp_msg_ssr_flag_tropo_grid_points_t test_msg{}; - uint8_t encoded_frame[] = {85,195,11,66,0,21,180,0,0,0,3,0,1,2,3,4,0,5,0,6,3,10,0,11,0,12,0,243,150, }; + test_msg.faulty_points[0] = 10; - sbp_msg_ssr_flag_tropo_grid_points_t test_msg{}; - - test_msg.faulty_points[0] = 10; - - test_msg.faulty_points[1] = 11; - - test_msg.faulty_points[2] = 12; - test_msg.header.chain_id = 6; - test_msg.header.num_msgs = 1; - test_msg.header.obs_time.tow = 180; - test_msg.header.obs_time.wn = 3; - test_msg.header.seq_num = 2; - test_msg.header.ssr_sol_id = 3; - test_msg.header.tile_id = 5; - test_msg.header.tile_set_id = 4; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_faulty_points.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)102,(char)97,(char)117,(char)108,(char)116,(char)121,(char)95,(char)112,(char)111,(char)105,(char)110,(char)116,(char)115 }; - memcpy(test_msg.n_faulty_points.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_faulty_points.value = 3; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + test_msg.faulty_points[1] = 11; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.faulty_points[0], 10) << "incorrect value for last_msg_.faulty_points[0], expected 10, is " << last_msg_.faulty_points[0]; - EXPECT_EQ(last_msg_.faulty_points[1], 11) << "incorrect value for last_msg_.faulty_points[1], expected 11, is " << last_msg_.faulty_points[1]; - EXPECT_EQ(last_msg_.faulty_points[2], 12) << "incorrect value for last_msg_.faulty_points[2], expected 12, is " << last_msg_.faulty_points[2]; - EXPECT_EQ(last_msg_.header.chain_id, 6) << "incorrect value for last_msg_.header.chain_id, expected 6, is " << last_msg_.header.chain_id; - EXPECT_EQ(last_msg_.header.num_msgs, 1) << "incorrect value for last_msg_.header.num_msgs, expected 1, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.obs_time.tow, 180) << "incorrect value for last_msg_.header.obs_time.tow, expected 180, is " << last_msg_.header.obs_time.tow; - EXPECT_EQ(last_msg_.header.obs_time.wn, 3) << "incorrect value for last_msg_.header.obs_time.wn, expected 3, is " << last_msg_.header.obs_time.wn; - EXPECT_EQ(last_msg_.header.seq_num, 2) << "incorrect value for last_msg_.header.seq_num, expected 2, is " << last_msg_.header.seq_num; - EXPECT_EQ(last_msg_.header.ssr_sol_id, 3) << "incorrect value for last_msg_.header.ssr_sol_id, expected 3, is " << last_msg_.header.ssr_sol_id; - EXPECT_EQ(last_msg_.header.tile_id, 5) << "incorrect value for last_msg_.header.tile_id, expected 5, is " << last_msg_.header.tile_id; - EXPECT_EQ(last_msg_.header.tile_set_id, 4) << "incorrect value for last_msg_.header.tile_set_id, expected 4, is " << last_msg_.header.tile_set_id; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_faulty_points.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_faulty_points.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_faulty_points.handle_as << "'"; - } - { - const char check_string[] = { (char)102,(char)97,(char)117,(char)108,(char)116,(char)121,(char)95,(char)112,(char)111,(char)105,(char)110,(char)116,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_faulty_points.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_faulty_points.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_faulty_points.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_faulty_points.value, 3) << "incorrect value for last_msg_.n_faulty_points.value, expected 3, is " << last_msg_.n_faulty_points.value; + test_msg.faulty_points[2] = 12; + test_msg.header.chain_id = 6; + test_msg.header.num_msgs = 1; + test_msg.header.obs_time.tow = 180; + test_msg.header.obs_time.wn = 3; + test_msg.header.seq_num = 2; + test_msg.header.ssr_sol_id = 3; + test_msg.header.tile_id = 5; + test_msg.header.tile_set_id = 4; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_faulty_points.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)102, (char)97, (char)117, (char)108, + (char)116, (char)121, (char)95, (char)112, + (char)111, (char)105, (char)110, (char)116, + (char)115}; + memcpy(test_msg.n_faulty_points.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_faulty_points.value = 3; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.faulty_points[0], 10) + << "incorrect value for last_msg_.faulty_points[0], expected 10, is " + << last_msg_.faulty_points[0]; + EXPECT_EQ(last_msg_.faulty_points[1], 11) + << "incorrect value for last_msg_.faulty_points[1], expected 11, is " + << last_msg_.faulty_points[1]; + EXPECT_EQ(last_msg_.faulty_points[2], 12) + << "incorrect value for last_msg_.faulty_points[2], expected 12, is " + << last_msg_.faulty_points[2]; + EXPECT_EQ(last_msg_.header.chain_id, 6) + << "incorrect value for last_msg_.header.chain_id, expected 6, is " + << last_msg_.header.chain_id; + EXPECT_EQ(last_msg_.header.num_msgs, 1) + << "incorrect value for last_msg_.header.num_msgs, expected 1, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.obs_time.tow, 180) + << "incorrect value for last_msg_.header.obs_time.tow, expected 180, is " + << last_msg_.header.obs_time.tow; + EXPECT_EQ(last_msg_.header.obs_time.wn, 3) + << "incorrect value for last_msg_.header.obs_time.wn, expected 3, is " + << last_msg_.header.obs_time.wn; + EXPECT_EQ(last_msg_.header.seq_num, 2) + << "incorrect value for last_msg_.header.seq_num, expected 2, is " + << last_msg_.header.seq_num; + EXPECT_EQ(last_msg_.header.ssr_sol_id, 3) + << "incorrect value for last_msg_.header.ssr_sol_id, expected 3, is " + << last_msg_.header.ssr_sol_id; + EXPECT_EQ(last_msg_.header.tile_id, 5) + << "incorrect value for last_msg_.header.tile_id, expected 5, is " + << last_msg_.header.tile_id; + EXPECT_EQ(last_msg_.header.tile_set_id, 4) + << "incorrect value for last_msg_.header.tile_set_id, expected 4, is " + << last_msg_.header.tile_set_id; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_faulty_points.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_faulty_points.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_faulty_points.handle_as + << "'"; + } + { + const char check_string[] = {(char)102, (char)97, (char)117, (char)108, + (char)116, (char)121, (char)95, (char)112, + (char)111, (char)105, (char)110, (char)116, + (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_faulty_points.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_faulty_points.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_faulty_points.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_faulty_points.value, 3) + << "incorrect value for last_msg_.n_faulty_points.value, expected 3, is " + << last_msg_.n_faulty_points.value; } diff --git a/c/test/cpp/auto_check_sbp_linux_MsgLinuxCpuState.cc b/c/test/cpp/auto_check_sbp_linux_MsgLinuxCpuState.cc index a2fe2a33a..f5f3c2a72 100644 --- a/c/test/cpp/auto_check_sbp_linux_MsgLinuxCpuState.cc +++ b/c/test/cpp/auto_check_sbp_linux_MsgLinuxCpuState.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuState.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_linux_MsgLinuxCpuState0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_linux_MsgLinuxCpuState0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_linux_MsgLinuxCpuState0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_linux_MsgLinuxCpuState0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_linux_cpu_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_linux_cpu_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,56 +67,82 @@ class Test_auto_check_sbp_linux_MsgLinuxCpuState0 : sbp_msg_linux_cpu_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_linux_MsgLinuxCpuState0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_linux_MsgLinuxCpuState0, Test) { + uint8_t encoded_frame[] = { + 85, 8, 127, 148, 133, 70, 101, 122, 195, 98, 215, 35, 94, + 235, 20, 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, + 101, 0, 0, 0, 47, 112, 97, 116, 104, 47, 116, 111, 47, + 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, + 97, 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, + 50, 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 68, 229, + }; + + sbp_msg_linux_cpu_state_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_linux_cpu_state_cmdline_set( + &test_msg, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, + &written)); + EXPECT_EQ(written, strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4")); + EXPECT_EQ(sbp_msg_linux_cpu_state_cmdline_encoded_len(&test_msg), 46); + test_msg.flags = 20; + test_msg.index = 101; + test_msg.pcpu = 98; + test_msg.pid = 50042; + test_msg.time = 3948815319; + { + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + memcpy(test_msg.tname, assign_string, sizeof(assign_string)); + } - uint8_t encoded_frame[] = {85,8,127,148,133,70,101,122,195,98,215,35,94,235,20,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,68,229, }; + EXPECT_EQ(send_message(34196, test_msg), SBP_OK); - sbp_msg_linux_cpu_state_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_linux_cpu_state_cmdline_set(&test_msg, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written)); - EXPECT_EQ( written, strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4")); - EXPECT_EQ(sbp_msg_linux_cpu_state_cmdline_encoded_len(&test_msg), 46); - test_msg.flags = 20; - test_msg.index = 101; - test_msg.pcpu = 98; - test_msg.pid = 50042; - test_msg.time = 3948815319; - { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - memcpy(test_msg.tname, assign_string, sizeof(assign_string)); - } - - EXPECT_EQ(send_message( 34196, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 34196); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_linux_cpu_state_cmdline_encoded_len(&last_msg_), 46); - EXPECT_STREQ(sbp_msg_linux_cpu_state_cmdline_get(&last_msg_), "/path/to/process-name arg0 arg1 arg2 arg3 arg4"); - EXPECT_EQ(last_msg_.flags, 20) << "incorrect value for last_msg_.flags, expected 20, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.index, 101) << "incorrect value for last_msg_.index, expected 101, is " << last_msg_.index; - EXPECT_EQ(last_msg_.pcpu, 98) << "incorrect value for last_msg_.pcpu, expected 98, is " << last_msg_.pcpu; - EXPECT_EQ(last_msg_.pid, 50042) << "incorrect value for last_msg_.pid, expected 50042, is " << last_msg_.pid; - EXPECT_EQ(last_msg_.time, 3948815319) << "incorrect value for last_msg_.time, expected 3948815319, is " << last_msg_.time; - { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.tname, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.tname, expected string '" << check_string << "', is '" << last_msg_.tname << "'"; - } + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 34196); + EXPECT_EQ(last_msg_, test_msg); + + EXPECT_EQ(sbp_msg_linux_cpu_state_cmdline_encoded_len(&last_msg_), 46); + EXPECT_STREQ(sbp_msg_linux_cpu_state_cmdline_get(&last_msg_), + "/path/to/process-name arg0 arg1 arg2 arg3 arg4"); + EXPECT_EQ(last_msg_.flags, 20) + << "incorrect value for last_msg_.flags, expected 20, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.index, 101) + << "incorrect value for last_msg_.index, expected 101, is " + << last_msg_.index; + EXPECT_EQ(last_msg_.pcpu, 98) + << "incorrect value for last_msg_.pcpu, expected 98, is " + << last_msg_.pcpu; + EXPECT_EQ(last_msg_.pid, 50042) + << "incorrect value for last_msg_.pid, expected 50042, is " + << last_msg_.pid; + EXPECT_EQ(last_msg_.time, 3948815319) + << "incorrect value for last_msg_.time, expected 3948815319, is " + << last_msg_.time; + { + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.tname, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.tname, expected string '" + << check_string << "', is '" << last_msg_.tname << "'"; + } } diff --git a/c/test/cpp/auto_check_sbp_linux_MsgLinuxCpuStateDepA.cc b/c/test/cpp/auto_check_sbp_linux_MsgLinuxCpuStateDepA.cc index 44e1732c5..8ddfeed2c 100644 --- a/c/test/cpp/auto_check_sbp_linux_MsgLinuxCpuStateDepA.cc +++ b/c/test/cpp/auto_check_sbp_linux_MsgLinuxCpuStateDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuStateDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_linux_MsgLinuxCpuStateDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_linux_MsgLinuxCpuStateDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_linux_MsgLinuxCpuStateDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_linux_MsgLinuxCpuStateDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_linux_cpu_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_linux_cpu_state_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,52 +67,73 @@ class Test_auto_check_sbp_linux_MsgLinuxCpuStateDepA0 : sbp_msg_linux_cpu_state_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_linux_MsgLinuxCpuStateDepA0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_linux_MsgLinuxCpuStateDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 0, 127, 12, 91, 65, 51, 240, 250, 178, 112, 114, 111, 99, 101, + 115, 115, 45, 110, 97, 109, 101, 0, 0, 0, 47, 112, 97, 116, 104, + 47, 116, 111, 47, 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, + 101, 32, 97, 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, + 50, 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 80, 48, + }; + + sbp_msg_linux_cpu_state_dep_a_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_linux_cpu_state_dep_a_cmdline_set( + &test_msg, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, + &written)); + EXPECT_EQ(written, strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4")); + EXPECT_EQ(sbp_msg_linux_cpu_state_dep_a_cmdline_encoded_len(&test_msg), 46); + test_msg.index = 51; + test_msg.pcpu = 178; + test_msg.pid = 64240; + { + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + memcpy(test_msg.tname, assign_string, sizeof(assign_string)); + } - uint8_t encoded_frame[] = {85,0,127,12,91,65,51,240,250,178,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,80,48, }; + EXPECT_EQ(send_message(23308, test_msg), SBP_OK); - sbp_msg_linux_cpu_state_dep_a_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_linux_cpu_state_dep_a_cmdline_set(&test_msg, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written)); - EXPECT_EQ( written, strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4")); - EXPECT_EQ(sbp_msg_linux_cpu_state_dep_a_cmdline_encoded_len(&test_msg), 46); - test_msg.index = 51; - test_msg.pcpu = 178; - test_msg.pid = 64240; - { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - memcpy(test_msg.tname, assign_string, sizeof(assign_string)); - } - - EXPECT_EQ(send_message( 23308, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 23308); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_linux_cpu_state_dep_a_cmdline_encoded_len(&last_msg_), 46); - EXPECT_STREQ(sbp_msg_linux_cpu_state_dep_a_cmdline_get(&last_msg_), "/path/to/process-name arg0 arg1 arg2 arg3 arg4"); - EXPECT_EQ(last_msg_.index, 51) << "incorrect value for last_msg_.index, expected 51, is " << last_msg_.index; - EXPECT_EQ(last_msg_.pcpu, 178) << "incorrect value for last_msg_.pcpu, expected 178, is " << last_msg_.pcpu; - EXPECT_EQ(last_msg_.pid, 64240) << "incorrect value for last_msg_.pid, expected 64240, is " << last_msg_.pid; - { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.tname, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.tname, expected string '" << check_string << "', is '" << last_msg_.tname << "'"; - } + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 23308); + EXPECT_EQ(last_msg_, test_msg); + + EXPECT_EQ(sbp_msg_linux_cpu_state_dep_a_cmdline_encoded_len(&last_msg_), 46); + EXPECT_STREQ(sbp_msg_linux_cpu_state_dep_a_cmdline_get(&last_msg_), + "/path/to/process-name arg0 arg1 arg2 arg3 arg4"); + EXPECT_EQ(last_msg_.index, 51) + << "incorrect value for last_msg_.index, expected 51, is " + << last_msg_.index; + EXPECT_EQ(last_msg_.pcpu, 178) + << "incorrect value for last_msg_.pcpu, expected 178, is " + << last_msg_.pcpu; + EXPECT_EQ(last_msg_.pid, 64240) + << "incorrect value for last_msg_.pid, expected 64240, is " + << last_msg_.pid; + { + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.tname, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.tname, expected string '" + << check_string << "', is '" << last_msg_.tname << "'"; + } } diff --git a/c/test/cpp/auto_check_sbp_linux_MsgLinuxMemState.cc b/c/test/cpp/auto_check_sbp_linux_MsgLinuxMemState.cc index 73f814c3f..3c22484db 100644 --- a/c/test/cpp/auto_check_sbp_linux_MsgLinuxMemState.cc +++ b/c/test/cpp/auto_check_sbp_linux_MsgLinuxMemState.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemState.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_linux_MsgLinuxMemState0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_linux_MsgLinuxMemState0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_linux_MsgLinuxMemState0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_linux_MsgLinuxMemState0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_linux_mem_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_linux_mem_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,56 +67,82 @@ class Test_auto_check_sbp_linux_MsgLinuxMemState0 : sbp_msg_linux_mem_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_linux_MsgLinuxMemState0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_linux_MsgLinuxMemState0, Test) { + uint8_t encoded_frame[] = { + 85, 9, 127, 95, 253, 70, 154, 191, 223, 19, 247, 53, 26, + 187, 76, 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, + 101, 0, 0, 0, 47, 112, 97, 116, 104, 47, 116, 111, 47, + 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, + 97, 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, + 50, 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 3, 181, + }; + + sbp_msg_linux_mem_state_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_linux_mem_state_cmdline_set( + &test_msg, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, + &written)); + EXPECT_EQ(written, strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4")); + EXPECT_EQ(sbp_msg_linux_mem_state_cmdline_encoded_len(&test_msg), 46); + test_msg.flags = 76; + test_msg.index = 154; + test_msg.pid = 57279; + test_msg.pmem = 19; + test_msg.time = 3139057143; + { + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + memcpy(test_msg.tname, assign_string, sizeof(assign_string)); + } - uint8_t encoded_frame[] = {85,9,127,95,253,70,154,191,223,19,247,53,26,187,76,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,3,181, }; + EXPECT_EQ(send_message(64863, test_msg), SBP_OK); - sbp_msg_linux_mem_state_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_linux_mem_state_cmdline_set(&test_msg, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written)); - EXPECT_EQ( written, strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4")); - EXPECT_EQ(sbp_msg_linux_mem_state_cmdline_encoded_len(&test_msg), 46); - test_msg.flags = 76; - test_msg.index = 154; - test_msg.pid = 57279; - test_msg.pmem = 19; - test_msg.time = 3139057143; - { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - memcpy(test_msg.tname, assign_string, sizeof(assign_string)); - } - - EXPECT_EQ(send_message( 64863, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 64863); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_linux_mem_state_cmdline_encoded_len(&last_msg_), 46); - EXPECT_STREQ(sbp_msg_linux_mem_state_cmdline_get(&last_msg_), "/path/to/process-name arg0 arg1 arg2 arg3 arg4"); - EXPECT_EQ(last_msg_.flags, 76) << "incorrect value for last_msg_.flags, expected 76, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.index, 154) << "incorrect value for last_msg_.index, expected 154, is " << last_msg_.index; - EXPECT_EQ(last_msg_.pid, 57279) << "incorrect value for last_msg_.pid, expected 57279, is " << last_msg_.pid; - EXPECT_EQ(last_msg_.pmem, 19) << "incorrect value for last_msg_.pmem, expected 19, is " << last_msg_.pmem; - EXPECT_EQ(last_msg_.time, 3139057143) << "incorrect value for last_msg_.time, expected 3139057143, is " << last_msg_.time; - { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.tname, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.tname, expected string '" << check_string << "', is '" << last_msg_.tname << "'"; - } + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 64863); + EXPECT_EQ(last_msg_, test_msg); + + EXPECT_EQ(sbp_msg_linux_mem_state_cmdline_encoded_len(&last_msg_), 46); + EXPECT_STREQ(sbp_msg_linux_mem_state_cmdline_get(&last_msg_), + "/path/to/process-name arg0 arg1 arg2 arg3 arg4"); + EXPECT_EQ(last_msg_.flags, 76) + << "incorrect value for last_msg_.flags, expected 76, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.index, 154) + << "incorrect value for last_msg_.index, expected 154, is " + << last_msg_.index; + EXPECT_EQ(last_msg_.pid, 57279) + << "incorrect value for last_msg_.pid, expected 57279, is " + << last_msg_.pid; + EXPECT_EQ(last_msg_.pmem, 19) + << "incorrect value for last_msg_.pmem, expected 19, is " + << last_msg_.pmem; + EXPECT_EQ(last_msg_.time, 3139057143) + << "incorrect value for last_msg_.time, expected 3139057143, is " + << last_msg_.time; + { + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.tname, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.tname, expected string '" + << check_string << "', is '" << last_msg_.tname << "'"; + } } diff --git a/c/test/cpp/auto_check_sbp_linux_MsgLinuxMemStateDepA.cc b/c/test/cpp/auto_check_sbp_linux_MsgLinuxMemStateDepA.cc index 888cf9e21..2c96b2e04 100644 --- a/c/test/cpp/auto_check_sbp_linux_MsgLinuxMemStateDepA.cc +++ b/c/test/cpp/auto_check_sbp_linux_MsgLinuxMemStateDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemStateDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_linux_MsgLinuxMemStateDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_linux_MsgLinuxMemStateDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_linux_MsgLinuxMemStateDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_linux_MsgLinuxMemStateDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_linux_mem_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_linux_mem_state_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,52 +67,73 @@ class Test_auto_check_sbp_linux_MsgLinuxMemStateDepA0 : sbp_msg_linux_mem_state_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_linux_MsgLinuxMemStateDepA0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_linux_MsgLinuxMemStateDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 1, 127, 185, 109, 65, 247, 93, 48, 193, 112, 114, 111, 99, 101, + 115, 115, 45, 110, 97, 109, 101, 0, 0, 0, 47, 112, 97, 116, 104, + 47, 116, 111, 47, 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, + 101, 32, 97, 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, + 50, 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 17, 137, + }; + + sbp_msg_linux_mem_state_dep_a_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_linux_mem_state_dep_a_cmdline_set( + &test_msg, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, + &written)); + EXPECT_EQ(written, strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4")); + EXPECT_EQ(sbp_msg_linux_mem_state_dep_a_cmdline_encoded_len(&test_msg), 46); + test_msg.index = 247; + test_msg.pid = 12381; + test_msg.pmem = 193; + { + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + memcpy(test_msg.tname, assign_string, sizeof(assign_string)); + } - uint8_t encoded_frame[] = {85,1,127,185,109,65,247,93,48,193,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,17,137, }; + EXPECT_EQ(send_message(28089, test_msg), SBP_OK); - sbp_msg_linux_mem_state_dep_a_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_linux_mem_state_dep_a_cmdline_set(&test_msg, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written)); - EXPECT_EQ( written, strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4")); - EXPECT_EQ(sbp_msg_linux_mem_state_dep_a_cmdline_encoded_len(&test_msg), 46); - test_msg.index = 247; - test_msg.pid = 12381; - test_msg.pmem = 193; - { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - memcpy(test_msg.tname, assign_string, sizeof(assign_string)); - } - - EXPECT_EQ(send_message( 28089, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 28089); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_linux_mem_state_dep_a_cmdline_encoded_len(&last_msg_), 46); - EXPECT_STREQ(sbp_msg_linux_mem_state_dep_a_cmdline_get(&last_msg_), "/path/to/process-name arg0 arg1 arg2 arg3 arg4"); - EXPECT_EQ(last_msg_.index, 247) << "incorrect value for last_msg_.index, expected 247, is " << last_msg_.index; - EXPECT_EQ(last_msg_.pid, 12381) << "incorrect value for last_msg_.pid, expected 12381, is " << last_msg_.pid; - EXPECT_EQ(last_msg_.pmem, 193) << "incorrect value for last_msg_.pmem, expected 193, is " << last_msg_.pmem; - { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.tname, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.tname, expected string '" << check_string << "', is '" << last_msg_.tname << "'"; - } + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 28089); + EXPECT_EQ(last_msg_, test_msg); + + EXPECT_EQ(sbp_msg_linux_mem_state_dep_a_cmdline_encoded_len(&last_msg_), 46); + EXPECT_STREQ(sbp_msg_linux_mem_state_dep_a_cmdline_get(&last_msg_), + "/path/to/process-name arg0 arg1 arg2 arg3 arg4"); + EXPECT_EQ(last_msg_.index, 247) + << "incorrect value for last_msg_.index, expected 247, is " + << last_msg_.index; + EXPECT_EQ(last_msg_.pid, 12381) + << "incorrect value for last_msg_.pid, expected 12381, is " + << last_msg_.pid; + EXPECT_EQ(last_msg_.pmem, 193) + << "incorrect value for last_msg_.pmem, expected 193, is " + << last_msg_.pmem; + { + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.tname, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.tname, expected string '" + << check_string << "', is '" << last_msg_.tname << "'"; + } } diff --git a/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessFdCount.cc b/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessFdCount.cc index 95b49b60b..54d7e43b2 100644 --- a/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessFdCount.cc +++ b/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessFdCount.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdCount.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdCount.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_linux_MsgLinuxProcessFdCount0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_linux_MsgLinuxProcessFdCount0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_linux_MsgLinuxProcessFdCount0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_linux_MsgLinuxProcessFdCount0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_linux_process_fd_count_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_linux_process_fd_count_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,44 +67,56 @@ class Test_auto_check_sbp_linux_MsgLinuxProcessFdCount0 : sbp_msg_linux_process_fd_count_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_linux_MsgLinuxProcessFdCount0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_linux_MsgLinuxProcessFdCount0, Test) { + uint8_t encoded_frame[] = { + 85, 6, 127, 30, 195, 51, 164, 189, 165, 5, 139, 47, 112, 97, 116, + 104, 47, 116, 111, 47, 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, + 109, 101, 32, 97, 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, + 103, 50, 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 2, 94, + }; + + sbp_msg_linux_process_fd_count_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_linux_process_fd_count_cmdline_set( + &test_msg, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, + &written)); + EXPECT_EQ(written, strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4")); + EXPECT_EQ(sbp_msg_linux_process_fd_count_cmdline_encoded_len(&test_msg), 46); + test_msg.fd_count = 35589; + test_msg.index = 164; + test_msg.pid = 42429; - uint8_t encoded_frame[] = {85,6,127,30,195,51,164,189,165,5,139,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,2,94, }; + EXPECT_EQ(send_message(49950, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_linux_process_fd_count_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_linux_process_fd_count_cmdline_set(&test_msg, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written)); - EXPECT_EQ( written, strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4")); - EXPECT_EQ(sbp_msg_linux_process_fd_count_cmdline_encoded_len(&test_msg), 46); - test_msg.fd_count = 35589; - test_msg.index = 164; - test_msg.pid = 42429; - - EXPECT_EQ(send_message( 49950, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 49950); + EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 49950); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_linux_process_fd_count_cmdline_encoded_len(&last_msg_), 46); - EXPECT_STREQ(sbp_msg_linux_process_fd_count_cmdline_get(&last_msg_), "/path/to/process-name arg0 arg1 arg2 arg3 arg4"); - EXPECT_EQ(last_msg_.fd_count, 35589) << "incorrect value for last_msg_.fd_count, expected 35589, is " << last_msg_.fd_count; - EXPECT_EQ(last_msg_.index, 164) << "incorrect value for last_msg_.index, expected 164, is " << last_msg_.index; - EXPECT_EQ(last_msg_.pid, 42429) << "incorrect value for last_msg_.pid, expected 42429, is " << last_msg_.pid; + EXPECT_EQ(sbp_msg_linux_process_fd_count_cmdline_encoded_len(&last_msg_), 46); + EXPECT_STREQ(sbp_msg_linux_process_fd_count_cmdline_get(&last_msg_), + "/path/to/process-name arg0 arg1 arg2 arg3 arg4"); + EXPECT_EQ(last_msg_.fd_count, 35589) + << "incorrect value for last_msg_.fd_count, expected 35589, is " + << last_msg_.fd_count; + EXPECT_EQ(last_msg_.index, 164) + << "incorrect value for last_msg_.index, expected 164, is " + << last_msg_.index; + EXPECT_EQ(last_msg_.pid, 42429) + << "incorrect value for last_msg_.pid, expected 42429, is " + << last_msg_.pid; } diff --git a/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessFdSummary.cc b/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessFdSummary.cc index a2e8d92ef..1abb99fb3 100644 --- a/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessFdSummary.cc +++ b/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessFdSummary.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdSummary.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdSummary.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_linux_MsgLinuxProcessFdSummary0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_linux_MsgLinuxProcessFdSummary0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_linux_MsgLinuxProcessFdSummary0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_linux_MsgLinuxProcessFdSummary0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_linux_process_fd_summary_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_linux_process_fd_summary_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,48 +67,72 @@ class Test_auto_check_sbp_linux_MsgLinuxProcessFdSummary0 : sbp_msg_linux_process_fd_summary_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_linux_MsgLinuxProcessFdSummary0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_linux_MsgLinuxProcessFdSummary0, Test) { + uint8_t encoded_frame[] = { + 85, 7, 127, 103, 248, 29, 19, 131, 200, 77, 102, 100, 49, + 0, 102, 100, 50, 0, 102, 100, 51, 0, 102, 100, 52, 0, + 102, 100, 53, 0, 102, 100, 54, 0, 0, 129, 80, + }; + + sbp_msg_linux_process_fd_summary_t test_msg{}; + + EXPECT_TRUE(sbp_msg_linux_process_fd_summary_most_opened_add_section( + &test_msg, "fd1")); + EXPECT_TRUE(sbp_msg_linux_process_fd_summary_most_opened_add_section( + &test_msg, "fd2")); + EXPECT_TRUE(sbp_msg_linux_process_fd_summary_most_opened_add_section( + &test_msg, "fd3")); + EXPECT_TRUE(sbp_msg_linux_process_fd_summary_most_opened_add_section( + &test_msg, "fd4")); + EXPECT_TRUE(sbp_msg_linux_process_fd_summary_most_opened_add_section( + &test_msg, "fd5")); + EXPECT_TRUE(sbp_msg_linux_process_fd_summary_most_opened_add_section( + &test_msg, "fd6")); + EXPECT_EQ(sbp_msg_linux_process_fd_summary_most_opened_encoded_len(&test_msg), + 25); + test_msg.sys_fd_count = 1304986387; - uint8_t encoded_frame[] = {85,7,127,103,248,29,19,131,200,77,102,100,49,0,102,100,50,0,102,100,51,0,102,100,52,0,102,100,53,0,102,100,54,0,0,129,80, }; + EXPECT_EQ(send_message(63591, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_linux_process_fd_summary_t test_msg{}; - - EXPECT_TRUE(sbp_msg_linux_process_fd_summary_most_opened_add_section(&test_msg, "fd1")); - EXPECT_TRUE(sbp_msg_linux_process_fd_summary_most_opened_add_section(&test_msg, "fd2")); - EXPECT_TRUE(sbp_msg_linux_process_fd_summary_most_opened_add_section(&test_msg, "fd3")); - EXPECT_TRUE(sbp_msg_linux_process_fd_summary_most_opened_add_section(&test_msg, "fd4")); - EXPECT_TRUE(sbp_msg_linux_process_fd_summary_most_opened_add_section(&test_msg, "fd5")); - EXPECT_TRUE(sbp_msg_linux_process_fd_summary_most_opened_add_section(&test_msg, "fd6")); - EXPECT_EQ(sbp_msg_linux_process_fd_summary_most_opened_encoded_len(&test_msg), 25); - test_msg.sys_fd_count = 1304986387; - - EXPECT_EQ(send_message( 63591, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 63591); + EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 63591); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_linux_process_fd_summary_most_opened_encoded_len(&last_msg_), 25); - EXPECT_STREQ(sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg_, 0), "fd1"); - EXPECT_STREQ(sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg_, 1), "fd2"); - EXPECT_STREQ(sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg_, 2), "fd3"); - EXPECT_STREQ(sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg_, 3), "fd4"); - EXPECT_STREQ(sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg_, 4), "fd5"); - EXPECT_STREQ(sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg_, 5), "fd6"); - EXPECT_EQ(last_msg_.sys_fd_count, 1304986387) << "incorrect value for last_msg_.sys_fd_count, expected 1304986387, is " << last_msg_.sys_fd_count; + EXPECT_EQ( + sbp_msg_linux_process_fd_summary_most_opened_encoded_len(&last_msg_), 25); + EXPECT_STREQ( + sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg_, 0), + "fd1"); + EXPECT_STREQ( + sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg_, 1), + "fd2"); + EXPECT_STREQ( + sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg_, 2), + "fd3"); + EXPECT_STREQ( + sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg_, 3), + "fd4"); + EXPECT_STREQ( + sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg_, 4), + "fd5"); + EXPECT_STREQ( + sbp_msg_linux_process_fd_summary_most_opened_get_section(&last_msg_, 5), + "fd6"); + EXPECT_EQ(last_msg_.sys_fd_count, 1304986387) + << "incorrect value for last_msg_.sys_fd_count, expected 1304986387, is " + << last_msg_.sys_fd_count; } diff --git a/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.cc b/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.cc index 7fe59bbb5..c44c1390e 100644 --- a/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.cc +++ b/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.cc @@ -10,60 +10,57 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketCounts.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketCounts.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_linux_MsgLinuxProcessSocketCounts0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_linux_MsgLinuxProcessSocketCounts0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_linux_MsgLinuxProcessSocketCounts0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_linux_MsgLinuxProcessSocketCounts0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_linux_process_socket_counts_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_linux_process_socket_counts_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,48 +68,67 @@ class Test_auto_check_sbp_linux_MsgLinuxProcessSocketCounts0 : sbp_msg_linux_process_socket_counts_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_linux_MsgLinuxProcessSocketCounts0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_linux_MsgLinuxProcessSocketCounts0, Test) { + uint8_t encoded_frame[] = { + 85, 3, 127, 108, 9, 55, 51, 137, 111, 79, 118, 3, 140, + 114, 115, 47, 112, 97, 116, 104, 47, 116, 111, 47, 112, 114, + 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, 97, 114, + 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, 50, 32, + 97, 114, 103, 51, 32, 97, 114, 103, 52, 180, 131, + }; + + sbp_msg_linux_process_socket_counts_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_linux_process_socket_counts_cmdline_set( + &test_msg, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, + &written)); + EXPECT_EQ(written, strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4")); + EXPECT_EQ(sbp_msg_linux_process_socket_counts_cmdline_encoded_len(&test_msg), + 46); + test_msg.index = 51; + test_msg.pid = 28553; + test_msg.socket_count = 30287; + test_msg.socket_states = 29554; + test_msg.socket_types = 35843; - uint8_t encoded_frame[] = {85,3,127,108,9,55,51,137,111,79,118,3,140,114,115,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,180,131, }; + EXPECT_EQ(send_message(2412, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_linux_process_socket_counts_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_linux_process_socket_counts_cmdline_set(&test_msg, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written)); - EXPECT_EQ( written, strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4")); - EXPECT_EQ(sbp_msg_linux_process_socket_counts_cmdline_encoded_len(&test_msg), 46); - test_msg.index = 51; - test_msg.pid = 28553; - test_msg.socket_count = 30287; - test_msg.socket_states = 29554; - test_msg.socket_types = 35843; - - EXPECT_EQ(send_message( 2412, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 2412); + EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 2412); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_linux_process_socket_counts_cmdline_encoded_len(&last_msg_), 46); - EXPECT_STREQ(sbp_msg_linux_process_socket_counts_cmdline_get(&last_msg_), "/path/to/process-name arg0 arg1 arg2 arg3 arg4"); - EXPECT_EQ(last_msg_.index, 51) << "incorrect value for last_msg_.index, expected 51, is " << last_msg_.index; - EXPECT_EQ(last_msg_.pid, 28553) << "incorrect value for last_msg_.pid, expected 28553, is " << last_msg_.pid; - EXPECT_EQ(last_msg_.socket_count, 30287) << "incorrect value for last_msg_.socket_count, expected 30287, is " << last_msg_.socket_count; - EXPECT_EQ(last_msg_.socket_states, 29554) << "incorrect value for last_msg_.socket_states, expected 29554, is " << last_msg_.socket_states; - EXPECT_EQ(last_msg_.socket_types, 35843) << "incorrect value for last_msg_.socket_types, expected 35843, is " << last_msg_.socket_types; + EXPECT_EQ(sbp_msg_linux_process_socket_counts_cmdline_encoded_len(&last_msg_), + 46); + EXPECT_STREQ(sbp_msg_linux_process_socket_counts_cmdline_get(&last_msg_), + "/path/to/process-name arg0 arg1 arg2 arg3 arg4"); + EXPECT_EQ(last_msg_.index, 51) + << "incorrect value for last_msg_.index, expected 51, is " + << last_msg_.index; + EXPECT_EQ(last_msg_.pid, 28553) + << "incorrect value for last_msg_.pid, expected 28553, is " + << last_msg_.pid; + EXPECT_EQ(last_msg_.socket_count, 30287) + << "incorrect value for last_msg_.socket_count, expected 30287, is " + << last_msg_.socket_count; + EXPECT_EQ(last_msg_.socket_states, 29554) + << "incorrect value for last_msg_.socket_states, expected 29554, is " + << last_msg_.socket_states; + EXPECT_EQ(last_msg_.socket_types, 35843) + << "incorrect value for last_msg_.socket_types, expected 35843, is " + << last_msg_.socket_types; } diff --git a/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.cc b/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.cc index ae4705880..86bdf7e21 100644 --- a/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.cc +++ b/c/test/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.cc @@ -10,60 +10,57 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketQueues.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketQueues.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_linux_MsgLinuxProcessSocketQueues0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_linux_MsgLinuxProcessSocketQueues0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_linux_MsgLinuxProcessSocketQueues0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_linux_MsgLinuxProcessSocketQueues0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_linux_process_socket_queues_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_linux_process_socket_queues_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,58 +68,109 @@ class Test_auto_check_sbp_linux_MsgLinuxProcessSocketQueues0 : sbp_msg_linux_process_socket_queues_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_linux_MsgLinuxProcessSocketQueues0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_linux_MsgLinuxProcessSocketQueues0, Test) { + uint8_t encoded_frame[] = { + 85, 4, 127, 187, 232, 121, 181, 135, 75, 249, 211, 35, 252, 80, 109, + 15, 223, 97, 100, 100, 114, 101, 115, 115, 32, 111, 102, 32, 108, 97, + 114, 103, 101, 115, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 47, 112, 97, 116, 104, 47, 116, 111, 47, + 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, 97, 114, + 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, 50, 32, 97, 114, + 103, 51, 32, 97, 114, 103, 52, 2, 247, + }; + + sbp_msg_linux_process_socket_queues_t test_msg{}; + { + const char assign_string[] = { + (char)97, (char)100, (char)100, (char)114, (char)101, (char)115, + (char)115, (char)32, (char)111, (char)102, (char)32, (char)108, + (char)97, (char)114, (char)103, (char)101, (char)115, (char)116, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.address_of_largest, assign_string, sizeof(assign_string)); + } + + size_t written; + EXPECT_TRUE(sbp_msg_linux_process_socket_queues_cmdline_set( + &test_msg, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, + &written)); + EXPECT_EQ(written, strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4")); + EXPECT_EQ(sbp_msg_linux_process_socket_queues_cmdline_encoded_len(&test_msg), + 46); + test_msg.index = 181; + test_msg.pid = 19335; + test_msg.recv_queued = 54265; + test_msg.send_queued = 64547; + test_msg.socket_states = 57103; + test_msg.socket_types = 27984; - uint8_t encoded_frame[] = {85,4,127,187,232,121,181,135,75,249,211,35,252,80,109,15,223,97,100,100,114,101,115,115,32,111,102,32,108,97,114,103,101,115,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,2,247, }; + EXPECT_EQ(send_message(59579, test_msg), SBP_OK); - sbp_msg_linux_process_socket_queues_t test_msg{}; - { - const char assign_string[] = { (char)97,(char)100,(char)100,(char)114,(char)101,(char)115,(char)115,(char)32,(char)111,(char)102,(char)32,(char)108,(char)97,(char)114,(char)103,(char)101,(char)115,(char)116,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.address_of_largest, assign_string, sizeof(assign_string)); - } - - size_t written; - EXPECT_TRUE(sbp_msg_linux_process_socket_queues_cmdline_set(&test_msg, "/path/to/process-name arg0 arg1 arg2 arg3 arg4", false, &written)); - EXPECT_EQ( written, strlen("/path/to/process-name arg0 arg1 arg2 arg3 arg4")); - EXPECT_EQ(sbp_msg_linux_process_socket_queues_cmdline_encoded_len(&test_msg), 46); - test_msg.index = 181; - test_msg.pid = 19335; - test_msg.recv_queued = 54265; - test_msg.send_queued = 64547; - test_msg.socket_states = 57103; - test_msg.socket_types = 27984; - - EXPECT_EQ(send_message( 59579, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 59579); + EXPECT_EQ(last_msg_, test_msg); + { + const char check_string[] = { + (char)97, (char)100, (char)100, (char)114, (char)101, (char)115, + (char)115, (char)32, (char)111, (char)102, (char)32, (char)108, + (char)97, (char)114, (char)103, (char)101, (char)115, (char)116, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.address_of_largest, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.address_of_largest, expected string '" + << check_string << "', is '" << last_msg_.address_of_largest << "'"; + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 59579); - EXPECT_EQ(last_msg_, test_msg); - { - const char check_string[] = { (char)97,(char)100,(char)100,(char)114,(char)101,(char)115,(char)115,(char)32,(char)111,(char)102,(char)32,(char)108,(char)97,(char)114,(char)103,(char)101,(char)115,(char)116,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.address_of_largest, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.address_of_largest, expected string '" << check_string << "', is '" << last_msg_.address_of_largest << "'"; - } - - EXPECT_EQ(sbp_msg_linux_process_socket_queues_cmdline_encoded_len(&last_msg_), 46); - EXPECT_STREQ(sbp_msg_linux_process_socket_queues_cmdline_get(&last_msg_), "/path/to/process-name arg0 arg1 arg2 arg3 arg4"); - EXPECT_EQ(last_msg_.index, 181) << "incorrect value for last_msg_.index, expected 181, is " << last_msg_.index; - EXPECT_EQ(last_msg_.pid, 19335) << "incorrect value for last_msg_.pid, expected 19335, is " << last_msg_.pid; - EXPECT_EQ(last_msg_.recv_queued, 54265) << "incorrect value for last_msg_.recv_queued, expected 54265, is " << last_msg_.recv_queued; - EXPECT_EQ(last_msg_.send_queued, 64547) << "incorrect value for last_msg_.send_queued, expected 64547, is " << last_msg_.send_queued; - EXPECT_EQ(last_msg_.socket_states, 57103) << "incorrect value for last_msg_.socket_states, expected 57103, is " << last_msg_.socket_states; - EXPECT_EQ(last_msg_.socket_types, 27984) << "incorrect value for last_msg_.socket_types, expected 27984, is " << last_msg_.socket_types; + EXPECT_EQ(sbp_msg_linux_process_socket_queues_cmdline_encoded_len(&last_msg_), + 46); + EXPECT_STREQ(sbp_msg_linux_process_socket_queues_cmdline_get(&last_msg_), + "/path/to/process-name arg0 arg1 arg2 arg3 arg4"); + EXPECT_EQ(last_msg_.index, 181) + << "incorrect value for last_msg_.index, expected 181, is " + << last_msg_.index; + EXPECT_EQ(last_msg_.pid, 19335) + << "incorrect value for last_msg_.pid, expected 19335, is " + << last_msg_.pid; + EXPECT_EQ(last_msg_.recv_queued, 54265) + << "incorrect value for last_msg_.recv_queued, expected 54265, is " + << last_msg_.recv_queued; + EXPECT_EQ(last_msg_.send_queued, 64547) + << "incorrect value for last_msg_.send_queued, expected 64547, is " + << last_msg_.send_queued; + EXPECT_EQ(last_msg_.socket_states, 57103) + << "incorrect value for last_msg_.socket_states, expected 57103, is " + << last_msg_.socket_states; + EXPECT_EQ(last_msg_.socket_types, 27984) + << "incorrect value for last_msg_.socket_types, expected 27984, is " + << last_msg_.socket_types; } diff --git a/c/test/cpp/auto_check_sbp_linux_MsgLinuxSocketUsage.cc b/c/test/cpp/auto_check_sbp_linux_MsgLinuxSocketUsage.cc index 0bc17edf9..096d1d268 100644 --- a/c/test/cpp/auto_check_sbp_linux_MsgLinuxSocketUsage.cc +++ b/c/test/cpp/auto_check_sbp_linux_MsgLinuxSocketUsage.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSocketUsage.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSocketUsage.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_linux_MsgLinuxSocketUsage0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_linux_MsgLinuxSocketUsage0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_linux_MsgLinuxSocketUsage0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_linux_MsgLinuxSocketUsage0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_linux_socket_usage_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_linux_socket_usage_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,130 +67,237 @@ class Test_auto_check_sbp_linux_MsgLinuxSocketUsage0 : sbp_msg_linux_socket_usage_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_linux_MsgLinuxSocketUsage0, Test) -{ - - uint8_t encoded_frame[] = {85,5,127,114,138,72,13,196,69,173,67,222,186,181,246,154,251,17,224,179,26,169,177,90,149,213,214,6,126,64,120,185,84,131,200,111,32,141,217,209,52,14,190,147,159,246,141,122,212,119,131,30,120,47,25,109,154,65,132,164,39,30,30,175,8,44,28,111,236,240,176,74,159,129,154,153,162,229,130,154, }; - - sbp_msg_linux_socket_usage_t test_msg{}; - test_msg.avg_queue_depth = 2907030541; - test_msg.max_queue_depth = 3048922691; - - test_msg.socket_state_counts[0] = 39670; - - test_msg.socket_state_counts[1] = 4603; - - test_msg.socket_state_counts[2] = 46048; - - test_msg.socket_state_counts[3] = 43290; - - test_msg.socket_state_counts[4] = 23217; - - test_msg.socket_state_counts[5] = 54677; - - test_msg.socket_state_counts[6] = 1750; - - test_msg.socket_state_counts[7] = 16510; - - test_msg.socket_state_counts[8] = 47480; - - test_msg.socket_state_counts[9] = 33620; - - test_msg.socket_state_counts[10] = 28616; - - test_msg.socket_state_counts[11] = 36128; - - test_msg.socket_state_counts[12] = 53721; - - test_msg.socket_state_counts[13] = 3636; - - test_msg.socket_state_counts[14] = 37822; - - test_msg.socket_state_counts[15] = 63135; - - test_msg.socket_type_counts[0] = 31373; - - test_msg.socket_type_counts[1] = 30676; - - test_msg.socket_type_counts[2] = 7811; - - test_msg.socket_type_counts[3] = 12152; - - test_msg.socket_type_counts[4] = 27929; - - test_msg.socket_type_counts[5] = 16794; - - test_msg.socket_type_counts[6] = 42116; - - test_msg.socket_type_counts[7] = 7719; - - test_msg.socket_type_counts[8] = 44830; - - test_msg.socket_type_counts[9] = 11272; - - test_msg.socket_type_counts[10] = 28444; - - test_msg.socket_type_counts[11] = 61676; - - test_msg.socket_type_counts[12] = 19120; - - test_msg.socket_type_counts[13] = 33183; - - test_msg.socket_type_counts[14] = 39322; - - test_msg.socket_type_counts[15] = 58786; - - EXPECT_EQ(send_message( 35442, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35442); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.avg_queue_depth, 2907030541) << "incorrect value for last_msg_.avg_queue_depth, expected 2907030541, is " << last_msg_.avg_queue_depth; - EXPECT_EQ(last_msg_.max_queue_depth, 3048922691) << "incorrect value for last_msg_.max_queue_depth, expected 3048922691, is " << last_msg_.max_queue_depth; - EXPECT_EQ(last_msg_.socket_state_counts[0], 39670) << "incorrect value for last_msg_.socket_state_counts[0], expected 39670, is " << last_msg_.socket_state_counts[0]; - EXPECT_EQ(last_msg_.socket_state_counts[1], 4603) << "incorrect value for last_msg_.socket_state_counts[1], expected 4603, is " << last_msg_.socket_state_counts[1]; - EXPECT_EQ(last_msg_.socket_state_counts[2], 46048) << "incorrect value for last_msg_.socket_state_counts[2], expected 46048, is " << last_msg_.socket_state_counts[2]; - EXPECT_EQ(last_msg_.socket_state_counts[3], 43290) << "incorrect value for last_msg_.socket_state_counts[3], expected 43290, is " << last_msg_.socket_state_counts[3]; - EXPECT_EQ(last_msg_.socket_state_counts[4], 23217) << "incorrect value for last_msg_.socket_state_counts[4], expected 23217, is " << last_msg_.socket_state_counts[4]; - EXPECT_EQ(last_msg_.socket_state_counts[5], 54677) << "incorrect value for last_msg_.socket_state_counts[5], expected 54677, is " << last_msg_.socket_state_counts[5]; - EXPECT_EQ(last_msg_.socket_state_counts[6], 1750) << "incorrect value for last_msg_.socket_state_counts[6], expected 1750, is " << last_msg_.socket_state_counts[6]; - EXPECT_EQ(last_msg_.socket_state_counts[7], 16510) << "incorrect value for last_msg_.socket_state_counts[7], expected 16510, is " << last_msg_.socket_state_counts[7]; - EXPECT_EQ(last_msg_.socket_state_counts[8], 47480) << "incorrect value for last_msg_.socket_state_counts[8], expected 47480, is " << last_msg_.socket_state_counts[8]; - EXPECT_EQ(last_msg_.socket_state_counts[9], 33620) << "incorrect value for last_msg_.socket_state_counts[9], expected 33620, is " << last_msg_.socket_state_counts[9]; - EXPECT_EQ(last_msg_.socket_state_counts[10], 28616) << "incorrect value for last_msg_.socket_state_counts[10], expected 28616, is " << last_msg_.socket_state_counts[10]; - EXPECT_EQ(last_msg_.socket_state_counts[11], 36128) << "incorrect value for last_msg_.socket_state_counts[11], expected 36128, is " << last_msg_.socket_state_counts[11]; - EXPECT_EQ(last_msg_.socket_state_counts[12], 53721) << "incorrect value for last_msg_.socket_state_counts[12], expected 53721, is " << last_msg_.socket_state_counts[12]; - EXPECT_EQ(last_msg_.socket_state_counts[13], 3636) << "incorrect value for last_msg_.socket_state_counts[13], expected 3636, is " << last_msg_.socket_state_counts[13]; - EXPECT_EQ(last_msg_.socket_state_counts[14], 37822) << "incorrect value for last_msg_.socket_state_counts[14], expected 37822, is " << last_msg_.socket_state_counts[14]; - EXPECT_EQ(last_msg_.socket_state_counts[15], 63135) << "incorrect value for last_msg_.socket_state_counts[15], expected 63135, is " << last_msg_.socket_state_counts[15]; - EXPECT_EQ(last_msg_.socket_type_counts[0], 31373) << "incorrect value for last_msg_.socket_type_counts[0], expected 31373, is " << last_msg_.socket_type_counts[0]; - EXPECT_EQ(last_msg_.socket_type_counts[1], 30676) << "incorrect value for last_msg_.socket_type_counts[1], expected 30676, is " << last_msg_.socket_type_counts[1]; - EXPECT_EQ(last_msg_.socket_type_counts[2], 7811) << "incorrect value for last_msg_.socket_type_counts[2], expected 7811, is " << last_msg_.socket_type_counts[2]; - EXPECT_EQ(last_msg_.socket_type_counts[3], 12152) << "incorrect value for last_msg_.socket_type_counts[3], expected 12152, is " << last_msg_.socket_type_counts[3]; - EXPECT_EQ(last_msg_.socket_type_counts[4], 27929) << "incorrect value for last_msg_.socket_type_counts[4], expected 27929, is " << last_msg_.socket_type_counts[4]; - EXPECT_EQ(last_msg_.socket_type_counts[5], 16794) << "incorrect value for last_msg_.socket_type_counts[5], expected 16794, is " << last_msg_.socket_type_counts[5]; - EXPECT_EQ(last_msg_.socket_type_counts[6], 42116) << "incorrect value for last_msg_.socket_type_counts[6], expected 42116, is " << last_msg_.socket_type_counts[6]; - EXPECT_EQ(last_msg_.socket_type_counts[7], 7719) << "incorrect value for last_msg_.socket_type_counts[7], expected 7719, is " << last_msg_.socket_type_counts[7]; - EXPECT_EQ(last_msg_.socket_type_counts[8], 44830) << "incorrect value for last_msg_.socket_type_counts[8], expected 44830, is " << last_msg_.socket_type_counts[8]; - EXPECT_EQ(last_msg_.socket_type_counts[9], 11272) << "incorrect value for last_msg_.socket_type_counts[9], expected 11272, is " << last_msg_.socket_type_counts[9]; - EXPECT_EQ(last_msg_.socket_type_counts[10], 28444) << "incorrect value for last_msg_.socket_type_counts[10], expected 28444, is " << last_msg_.socket_type_counts[10]; - EXPECT_EQ(last_msg_.socket_type_counts[11], 61676) << "incorrect value for last_msg_.socket_type_counts[11], expected 61676, is " << last_msg_.socket_type_counts[11]; - EXPECT_EQ(last_msg_.socket_type_counts[12], 19120) << "incorrect value for last_msg_.socket_type_counts[12], expected 19120, is " << last_msg_.socket_type_counts[12]; - EXPECT_EQ(last_msg_.socket_type_counts[13], 33183) << "incorrect value for last_msg_.socket_type_counts[13], expected 33183, is " << last_msg_.socket_type_counts[13]; - EXPECT_EQ(last_msg_.socket_type_counts[14], 39322) << "incorrect value for last_msg_.socket_type_counts[14], expected 39322, is " << last_msg_.socket_type_counts[14]; - EXPECT_EQ(last_msg_.socket_type_counts[15], 58786) << "incorrect value for last_msg_.socket_type_counts[15], expected 58786, is " << last_msg_.socket_type_counts[15]; +}; + +TEST_F(Test_auto_check_sbp_linux_MsgLinuxSocketUsage0, Test) { + uint8_t encoded_frame[] = { + 85, 5, 127, 114, 138, 72, 13, 196, 69, 173, 67, 222, 186, 181, + 246, 154, 251, 17, 224, 179, 26, 169, 177, 90, 149, 213, 214, 6, + 126, 64, 120, 185, 84, 131, 200, 111, 32, 141, 217, 209, 52, 14, + 190, 147, 159, 246, 141, 122, 212, 119, 131, 30, 120, 47, 25, 109, + 154, 65, 132, 164, 39, 30, 30, 175, 8, 44, 28, 111, 236, 240, + 176, 74, 159, 129, 154, 153, 162, 229, 130, 154, + }; + + sbp_msg_linux_socket_usage_t test_msg{}; + test_msg.avg_queue_depth = 2907030541; + test_msg.max_queue_depth = 3048922691; + + test_msg.socket_state_counts[0] = 39670; + + test_msg.socket_state_counts[1] = 4603; + + test_msg.socket_state_counts[2] = 46048; + + test_msg.socket_state_counts[3] = 43290; + + test_msg.socket_state_counts[4] = 23217; + + test_msg.socket_state_counts[5] = 54677; + + test_msg.socket_state_counts[6] = 1750; + + test_msg.socket_state_counts[7] = 16510; + + test_msg.socket_state_counts[8] = 47480; + + test_msg.socket_state_counts[9] = 33620; + + test_msg.socket_state_counts[10] = 28616; + + test_msg.socket_state_counts[11] = 36128; + + test_msg.socket_state_counts[12] = 53721; + + test_msg.socket_state_counts[13] = 3636; + + test_msg.socket_state_counts[14] = 37822; + + test_msg.socket_state_counts[15] = 63135; + + test_msg.socket_type_counts[0] = 31373; + + test_msg.socket_type_counts[1] = 30676; + + test_msg.socket_type_counts[2] = 7811; + + test_msg.socket_type_counts[3] = 12152; + + test_msg.socket_type_counts[4] = 27929; + + test_msg.socket_type_counts[5] = 16794; + + test_msg.socket_type_counts[6] = 42116; + + test_msg.socket_type_counts[7] = 7719; + + test_msg.socket_type_counts[8] = 44830; + + test_msg.socket_type_counts[9] = 11272; + + test_msg.socket_type_counts[10] = 28444; + + test_msg.socket_type_counts[11] = 61676; + + test_msg.socket_type_counts[12] = 19120; + + test_msg.socket_type_counts[13] = 33183; + + test_msg.socket_type_counts[14] = 39322; + + test_msg.socket_type_counts[15] = 58786; + + EXPECT_EQ(send_message(35442, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35442); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.avg_queue_depth, 2907030541) + << "incorrect value for last_msg_.avg_queue_depth, expected 2907030541, " + "is " + << last_msg_.avg_queue_depth; + EXPECT_EQ(last_msg_.max_queue_depth, 3048922691) + << "incorrect value for last_msg_.max_queue_depth, expected 3048922691, " + "is " + << last_msg_.max_queue_depth; + EXPECT_EQ(last_msg_.socket_state_counts[0], 39670) + << "incorrect value for last_msg_.socket_state_counts[0], expected " + "39670, is " + << last_msg_.socket_state_counts[0]; + EXPECT_EQ(last_msg_.socket_state_counts[1], 4603) + << "incorrect value for last_msg_.socket_state_counts[1], expected 4603, " + "is " + << last_msg_.socket_state_counts[1]; + EXPECT_EQ(last_msg_.socket_state_counts[2], 46048) + << "incorrect value for last_msg_.socket_state_counts[2], expected " + "46048, is " + << last_msg_.socket_state_counts[2]; + EXPECT_EQ(last_msg_.socket_state_counts[3], 43290) + << "incorrect value for last_msg_.socket_state_counts[3], expected " + "43290, is " + << last_msg_.socket_state_counts[3]; + EXPECT_EQ(last_msg_.socket_state_counts[4], 23217) + << "incorrect value for last_msg_.socket_state_counts[4], expected " + "23217, is " + << last_msg_.socket_state_counts[4]; + EXPECT_EQ(last_msg_.socket_state_counts[5], 54677) + << "incorrect value for last_msg_.socket_state_counts[5], expected " + "54677, is " + << last_msg_.socket_state_counts[5]; + EXPECT_EQ(last_msg_.socket_state_counts[6], 1750) + << "incorrect value for last_msg_.socket_state_counts[6], expected 1750, " + "is " + << last_msg_.socket_state_counts[6]; + EXPECT_EQ(last_msg_.socket_state_counts[7], 16510) + << "incorrect value for last_msg_.socket_state_counts[7], expected " + "16510, is " + << last_msg_.socket_state_counts[7]; + EXPECT_EQ(last_msg_.socket_state_counts[8], 47480) + << "incorrect value for last_msg_.socket_state_counts[8], expected " + "47480, is " + << last_msg_.socket_state_counts[8]; + EXPECT_EQ(last_msg_.socket_state_counts[9], 33620) + << "incorrect value for last_msg_.socket_state_counts[9], expected " + "33620, is " + << last_msg_.socket_state_counts[9]; + EXPECT_EQ(last_msg_.socket_state_counts[10], 28616) + << "incorrect value for last_msg_.socket_state_counts[10], expected " + "28616, is " + << last_msg_.socket_state_counts[10]; + EXPECT_EQ(last_msg_.socket_state_counts[11], 36128) + << "incorrect value for last_msg_.socket_state_counts[11], expected " + "36128, is " + << last_msg_.socket_state_counts[11]; + EXPECT_EQ(last_msg_.socket_state_counts[12], 53721) + << "incorrect value for last_msg_.socket_state_counts[12], expected " + "53721, is " + << last_msg_.socket_state_counts[12]; + EXPECT_EQ(last_msg_.socket_state_counts[13], 3636) + << "incorrect value for last_msg_.socket_state_counts[13], expected " + "3636, is " + << last_msg_.socket_state_counts[13]; + EXPECT_EQ(last_msg_.socket_state_counts[14], 37822) + << "incorrect value for last_msg_.socket_state_counts[14], expected " + "37822, is " + << last_msg_.socket_state_counts[14]; + EXPECT_EQ(last_msg_.socket_state_counts[15], 63135) + << "incorrect value for last_msg_.socket_state_counts[15], expected " + "63135, is " + << last_msg_.socket_state_counts[15]; + EXPECT_EQ(last_msg_.socket_type_counts[0], 31373) + << "incorrect value for last_msg_.socket_type_counts[0], expected 31373, " + "is " + << last_msg_.socket_type_counts[0]; + EXPECT_EQ(last_msg_.socket_type_counts[1], 30676) + << "incorrect value for last_msg_.socket_type_counts[1], expected 30676, " + "is " + << last_msg_.socket_type_counts[1]; + EXPECT_EQ(last_msg_.socket_type_counts[2], 7811) + << "incorrect value for last_msg_.socket_type_counts[2], expected 7811, " + "is " + << last_msg_.socket_type_counts[2]; + EXPECT_EQ(last_msg_.socket_type_counts[3], 12152) + << "incorrect value for last_msg_.socket_type_counts[3], expected 12152, " + "is " + << last_msg_.socket_type_counts[3]; + EXPECT_EQ(last_msg_.socket_type_counts[4], 27929) + << "incorrect value for last_msg_.socket_type_counts[4], expected 27929, " + "is " + << last_msg_.socket_type_counts[4]; + EXPECT_EQ(last_msg_.socket_type_counts[5], 16794) + << "incorrect value for last_msg_.socket_type_counts[5], expected 16794, " + "is " + << last_msg_.socket_type_counts[5]; + EXPECT_EQ(last_msg_.socket_type_counts[6], 42116) + << "incorrect value for last_msg_.socket_type_counts[6], expected 42116, " + "is " + << last_msg_.socket_type_counts[6]; + EXPECT_EQ(last_msg_.socket_type_counts[7], 7719) + << "incorrect value for last_msg_.socket_type_counts[7], expected 7719, " + "is " + << last_msg_.socket_type_counts[7]; + EXPECT_EQ(last_msg_.socket_type_counts[8], 44830) + << "incorrect value for last_msg_.socket_type_counts[8], expected 44830, " + "is " + << last_msg_.socket_type_counts[8]; + EXPECT_EQ(last_msg_.socket_type_counts[9], 11272) + << "incorrect value for last_msg_.socket_type_counts[9], expected 11272, " + "is " + << last_msg_.socket_type_counts[9]; + EXPECT_EQ(last_msg_.socket_type_counts[10], 28444) + << "incorrect value for last_msg_.socket_type_counts[10], expected " + "28444, is " + << last_msg_.socket_type_counts[10]; + EXPECT_EQ(last_msg_.socket_type_counts[11], 61676) + << "incorrect value for last_msg_.socket_type_counts[11], expected " + "61676, is " + << last_msg_.socket_type_counts[11]; + EXPECT_EQ(last_msg_.socket_type_counts[12], 19120) + << "incorrect value for last_msg_.socket_type_counts[12], expected " + "19120, is " + << last_msg_.socket_type_counts[12]; + EXPECT_EQ(last_msg_.socket_type_counts[13], 33183) + << "incorrect value for last_msg_.socket_type_counts[13], expected " + "33183, is " + << last_msg_.socket_type_counts[13]; + EXPECT_EQ(last_msg_.socket_type_counts[14], 39322) + << "incorrect value for last_msg_.socket_type_counts[14], expected " + "39322, is " + << last_msg_.socket_type_counts[14]; + EXPECT_EQ(last_msg_.socket_type_counts[15], 58786) + << "incorrect value for last_msg_.socket_type_counts[15], expected " + "58786, is " + << last_msg_.socket_type_counts[15]; } diff --git a/c/test/cpp/auto_check_sbp_linux_MsgLinuxSysState.cc b/c/test/cpp/auto_check_sbp_linux_MsgLinuxSysState.cc index 401bc192a..9fe182b7e 100644 --- a/c/test/cpp/auto_check_sbp_linux_MsgLinuxSysState.cc +++ b/c/test/cpp/auto_check_sbp_linux_MsgLinuxSysState.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysState.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_linux_MsgLinuxSysState0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_linux_MsgLinuxSysState0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_linux_MsgLinuxSysState0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_linux_MsgLinuxSysState0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_linux_sys_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_linux_sys_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,46 +67,63 @@ class Test_auto_check_sbp_linux_MsgLinuxSysState0 : sbp_msg_linux_sys_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_linux_MsgLinuxSysState0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_linux_MsgLinuxSysState0, Test) { + uint8_t encoded_frame[] = { + 85, 10, 127, 85, 167, 15, 20, 207, 125, 215, 196, 71, + 161, 229, 250, 186, 108, 30, 106, 5, 9, 229, 242, + }; - uint8_t encoded_frame[] = {85,10,127,85,167,15,20,207,125,215,196,71,161,229,250,186,108,30,106,5,9,229,242, }; + sbp_msg_linux_sys_state_t test_msg{}; + test_msg.flags = 9; + test_msg.mem_total = 53012; + test_msg.pcpu = 125; + test_msg.pid_count = 47866; + test_msg.pmem = 215; + test_msg.procs_starting = 18372; + test_msg.procs_stopping = 58785; + test_msg.time = 90840684; - sbp_msg_linux_sys_state_t test_msg{}; - test_msg.flags = 9; - test_msg.mem_total = 53012; - test_msg.pcpu = 125; - test_msg.pid_count = 47866; - test_msg.pmem = 215; - test_msg.procs_starting = 18372; - test_msg.procs_stopping = 58785; - test_msg.time = 90840684; - - EXPECT_EQ(send_message( 42837, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(42837, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 42837); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 9) << "incorrect value for last_msg_.flags, expected 9, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.mem_total, 53012) << "incorrect value for last_msg_.mem_total, expected 53012, is " << last_msg_.mem_total; - EXPECT_EQ(last_msg_.pcpu, 125) << "incorrect value for last_msg_.pcpu, expected 125, is " << last_msg_.pcpu; - EXPECT_EQ(last_msg_.pid_count, 47866) << "incorrect value for last_msg_.pid_count, expected 47866, is " << last_msg_.pid_count; - EXPECT_EQ(last_msg_.pmem, 215) << "incorrect value for last_msg_.pmem, expected 215, is " << last_msg_.pmem; - EXPECT_EQ(last_msg_.procs_starting, 18372) << "incorrect value for last_msg_.procs_starting, expected 18372, is " << last_msg_.procs_starting; - EXPECT_EQ(last_msg_.procs_stopping, 58785) << "incorrect value for last_msg_.procs_stopping, expected 58785, is " << last_msg_.procs_stopping; - EXPECT_EQ(last_msg_.time, 90840684) << "incorrect value for last_msg_.time, expected 90840684, is " << last_msg_.time; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 42837); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 9) + << "incorrect value for last_msg_.flags, expected 9, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.mem_total, 53012) + << "incorrect value for last_msg_.mem_total, expected 53012, is " + << last_msg_.mem_total; + EXPECT_EQ(last_msg_.pcpu, 125) + << "incorrect value for last_msg_.pcpu, expected 125, is " + << last_msg_.pcpu; + EXPECT_EQ(last_msg_.pid_count, 47866) + << "incorrect value for last_msg_.pid_count, expected 47866, is " + << last_msg_.pid_count; + EXPECT_EQ(last_msg_.pmem, 215) + << "incorrect value for last_msg_.pmem, expected 215, is " + << last_msg_.pmem; + EXPECT_EQ(last_msg_.procs_starting, 18372) + << "incorrect value for last_msg_.procs_starting, expected 18372, is " + << last_msg_.procs_starting; + EXPECT_EQ(last_msg_.procs_stopping, 58785) + << "incorrect value for last_msg_.procs_stopping, expected 58785, is " + << last_msg_.procs_stopping; + EXPECT_EQ(last_msg_.time, 90840684) + << "incorrect value for last_msg_.time, expected 90840684, is " + << last_msg_.time; } diff --git a/c/test/cpp/auto_check_sbp_linux_MsgLinuxSysStateDepA.cc b/c/test/cpp/auto_check_sbp_linux_MsgLinuxSysStateDepA.cc index e3c076208..26be590a3 100644 --- a/c/test/cpp/auto_check_sbp_linux_MsgLinuxSysStateDepA.cc +++ b/c/test/cpp/auto_check_sbp_linux_MsgLinuxSysStateDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysStateDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_linux_MsgLinuxSysStateDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_linux_MsgLinuxSysStateDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_linux_MsgLinuxSysStateDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_linux_MsgLinuxSysStateDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_linux_sys_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_linux_sys_state_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,42 +67,55 @@ class Test_auto_check_sbp_linux_MsgLinuxSysStateDepA0 : sbp_msg_linux_sys_state_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_linux_MsgLinuxSysStateDepA0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_linux_MsgLinuxSysStateDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 127, 84, 56, 10, 188, 163, 211, + 194, 115, 71, 101, 103, 124, 201, 223, 223, + }; - uint8_t encoded_frame[] = {85,2,127,84,56,10,188,163,211,194,115,71,101,103,124,201,223,223, }; + sbp_msg_linux_sys_state_dep_a_t test_msg{}; + test_msg.mem_total = 41916; + test_msg.pcpu = 211; + test_msg.pid_count = 51580; + test_msg.pmem = 194; + test_msg.procs_starting = 18291; + test_msg.procs_stopping = 26469; - sbp_msg_linux_sys_state_dep_a_t test_msg{}; - test_msg.mem_total = 41916; - test_msg.pcpu = 211; - test_msg.pid_count = 51580; - test_msg.pmem = 194; - test_msg.procs_starting = 18291; - test_msg.procs_stopping = 26469; - - EXPECT_EQ(send_message( 14420, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(14420, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 14420); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.mem_total, 41916) << "incorrect value for last_msg_.mem_total, expected 41916, is " << last_msg_.mem_total; - EXPECT_EQ(last_msg_.pcpu, 211) << "incorrect value for last_msg_.pcpu, expected 211, is " << last_msg_.pcpu; - EXPECT_EQ(last_msg_.pid_count, 51580) << "incorrect value for last_msg_.pid_count, expected 51580, is " << last_msg_.pid_count; - EXPECT_EQ(last_msg_.pmem, 194) << "incorrect value for last_msg_.pmem, expected 194, is " << last_msg_.pmem; - EXPECT_EQ(last_msg_.procs_starting, 18291) << "incorrect value for last_msg_.procs_starting, expected 18291, is " << last_msg_.procs_starting; - EXPECT_EQ(last_msg_.procs_stopping, 26469) << "incorrect value for last_msg_.procs_stopping, expected 26469, is " << last_msg_.procs_stopping; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 14420); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.mem_total, 41916) + << "incorrect value for last_msg_.mem_total, expected 41916, is " + << last_msg_.mem_total; + EXPECT_EQ(last_msg_.pcpu, 211) + << "incorrect value for last_msg_.pcpu, expected 211, is " + << last_msg_.pcpu; + EXPECT_EQ(last_msg_.pid_count, 51580) + << "incorrect value for last_msg_.pid_count, expected 51580, is " + << last_msg_.pid_count; + EXPECT_EQ(last_msg_.pmem, 194) + << "incorrect value for last_msg_.pmem, expected 194, is " + << last_msg_.pmem; + EXPECT_EQ(last_msg_.procs_starting, 18291) + << "incorrect value for last_msg_.procs_starting, expected 18291, is " + << last_msg_.procs_starting; + EXPECT_EQ(last_msg_.procs_stopping, 26469) + << "incorrect value for last_msg_.procs_stopping, expected 26469, is " + << last_msg_.procs_stopping; } diff --git a/c/test/cpp/auto_check_sbp_logging_MsgFwd.cc b/c/test/cpp/auto_check_sbp_logging_MsgFwd.cc index 4872afa8d..e5e268b92 100644 --- a/c/test/cpp/auto_check_sbp_logging_MsgFwd.cc +++ b/c/test/cpp/auto_check_sbp_logging_MsgFwd.cc @@ -10,60 +10,54 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/logging/test_MsgFwd.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/logging/test_MsgFwd.yaml by generate.py. Do not +// modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_logging_MsgFwd0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_logging_MsgFwd0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_logging_MsgFwd0 : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_logging_MsgFwd0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_fwd_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, const sbp_msg_fwd_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,100 +65,161 @@ class Test_auto_check_sbp_logging_MsgFwd0 : sbp_msg_fwd_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_logging_MsgFwd0, Test) -{ - - uint8_t encoded_frame[] = {85,2,4,66,0,18,0,0,86,81,68,47,81,103,65,69,65,65,65,65,65,69,97,103,125,95, }; - - sbp_msg_fwd_t test_msg{}; - - test_msg.fwd_payload[0] = 86; - - test_msg.fwd_payload[1] = 81; - - test_msg.fwd_payload[2] = 68; - - test_msg.fwd_payload[3] = 47; - - test_msg.fwd_payload[4] = 81; - - test_msg.fwd_payload[5] = 103; - - test_msg.fwd_payload[6] = 65; - - test_msg.fwd_payload[7] = 69; - - test_msg.fwd_payload[8] = 65; - - test_msg.fwd_payload[9] = 65; - - test_msg.fwd_payload[10] = 65; - - test_msg.fwd_payload[11] = 65; - - test_msg.fwd_payload[12] = 65; - - test_msg.fwd_payload[13] = 69; - - test_msg.fwd_payload[14] = 97; - - test_msg.fwd_payload[15] = 103; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_fwd_payload.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)102,(char)119,(char)100,(char)95,(char)112,(char)97,(char)121,(char)108,(char)111,(char)97,(char)100 }; - memcpy(test_msg.n_fwd_payload.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_fwd_payload.value = 16; - test_msg.protocol = 0; - test_msg.source = 0; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.fwd_payload[0], 86) << "incorrect value for last_msg_.fwd_payload[0], expected 86, is " << last_msg_.fwd_payload[0]; - EXPECT_EQ(last_msg_.fwd_payload[1], 81) << "incorrect value for last_msg_.fwd_payload[1], expected 81, is " << last_msg_.fwd_payload[1]; - EXPECT_EQ(last_msg_.fwd_payload[2], 68) << "incorrect value for last_msg_.fwd_payload[2], expected 68, is " << last_msg_.fwd_payload[2]; - EXPECT_EQ(last_msg_.fwd_payload[3], 47) << "incorrect value for last_msg_.fwd_payload[3], expected 47, is " << last_msg_.fwd_payload[3]; - EXPECT_EQ(last_msg_.fwd_payload[4], 81) << "incorrect value for last_msg_.fwd_payload[4], expected 81, is " << last_msg_.fwd_payload[4]; - EXPECT_EQ(last_msg_.fwd_payload[5], 103) << "incorrect value for last_msg_.fwd_payload[5], expected 103, is " << last_msg_.fwd_payload[5]; - EXPECT_EQ(last_msg_.fwd_payload[6], 65) << "incorrect value for last_msg_.fwd_payload[6], expected 65, is " << last_msg_.fwd_payload[6]; - EXPECT_EQ(last_msg_.fwd_payload[7], 69) << "incorrect value for last_msg_.fwd_payload[7], expected 69, is " << last_msg_.fwd_payload[7]; - EXPECT_EQ(last_msg_.fwd_payload[8], 65) << "incorrect value for last_msg_.fwd_payload[8], expected 65, is " << last_msg_.fwd_payload[8]; - EXPECT_EQ(last_msg_.fwd_payload[9], 65) << "incorrect value for last_msg_.fwd_payload[9], expected 65, is " << last_msg_.fwd_payload[9]; - EXPECT_EQ(last_msg_.fwd_payload[10], 65) << "incorrect value for last_msg_.fwd_payload[10], expected 65, is " << last_msg_.fwd_payload[10]; - EXPECT_EQ(last_msg_.fwd_payload[11], 65) << "incorrect value for last_msg_.fwd_payload[11], expected 65, is " << last_msg_.fwd_payload[11]; - EXPECT_EQ(last_msg_.fwd_payload[12], 65) << "incorrect value for last_msg_.fwd_payload[12], expected 65, is " << last_msg_.fwd_payload[12]; - EXPECT_EQ(last_msg_.fwd_payload[13], 69) << "incorrect value for last_msg_.fwd_payload[13], expected 69, is " << last_msg_.fwd_payload[13]; - EXPECT_EQ(last_msg_.fwd_payload[14], 97) << "incorrect value for last_msg_.fwd_payload[14], expected 97, is " << last_msg_.fwd_payload[14]; - EXPECT_EQ(last_msg_.fwd_payload[15], 103) << "incorrect value for last_msg_.fwd_payload[15], expected 103, is " << last_msg_.fwd_payload[15]; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_fwd_payload.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_fwd_payload.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_fwd_payload.handle_as << "'"; - } - { - const char check_string[] = { (char)102,(char)119,(char)100,(char)95,(char)112,(char)97,(char)121,(char)108,(char)111,(char)97,(char)100 }; - EXPECT_EQ(memcmp(last_msg_.n_fwd_payload.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_fwd_payload.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_fwd_payload.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_fwd_payload.value, 16) << "incorrect value for last_msg_.n_fwd_payload.value, expected 16, is " << last_msg_.n_fwd_payload.value; - EXPECT_EQ(last_msg_.protocol, 0) << "incorrect value for last_msg_.protocol, expected 0, is " << last_msg_.protocol; - EXPECT_EQ(last_msg_.source, 0) << "incorrect value for last_msg_.source, expected 0, is " << last_msg_.source; +}; + +TEST_F(Test_auto_check_sbp_logging_MsgFwd0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 4, 66, 0, 18, 0, 0, 86, 81, 68, 47, 81, + 103, 65, 69, 65, 65, 65, 65, 65, 69, 97, 103, 125, 95, + }; + + sbp_msg_fwd_t test_msg{}; + + test_msg.fwd_payload[0] = 86; + + test_msg.fwd_payload[1] = 81; + + test_msg.fwd_payload[2] = 68; + + test_msg.fwd_payload[3] = 47; + + test_msg.fwd_payload[4] = 81; + + test_msg.fwd_payload[5] = 103; + + test_msg.fwd_payload[6] = 65; + + test_msg.fwd_payload[7] = 69; + + test_msg.fwd_payload[8] = 65; + + test_msg.fwd_payload[9] = 65; + + test_msg.fwd_payload[10] = 65; + + test_msg.fwd_payload[11] = 65; + + test_msg.fwd_payload[12] = 65; + + test_msg.fwd_payload[13] = 69; + + test_msg.fwd_payload[14] = 97; + + test_msg.fwd_payload[15] = 103; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_fwd_payload.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)102, (char)119, (char)100, (char)95, + (char)112, (char)97, (char)121, (char)108, + (char)111, (char)97, (char)100}; + memcpy(test_msg.n_fwd_payload.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_fwd_payload.value = 16; + test_msg.protocol = 0; + test_msg.source = 0; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.fwd_payload[0], 86) + << "incorrect value for last_msg_.fwd_payload[0], expected 86, is " + << last_msg_.fwd_payload[0]; + EXPECT_EQ(last_msg_.fwd_payload[1], 81) + << "incorrect value for last_msg_.fwd_payload[1], expected 81, is " + << last_msg_.fwd_payload[1]; + EXPECT_EQ(last_msg_.fwd_payload[2], 68) + << "incorrect value for last_msg_.fwd_payload[2], expected 68, is " + << last_msg_.fwd_payload[2]; + EXPECT_EQ(last_msg_.fwd_payload[3], 47) + << "incorrect value for last_msg_.fwd_payload[3], expected 47, is " + << last_msg_.fwd_payload[3]; + EXPECT_EQ(last_msg_.fwd_payload[4], 81) + << "incorrect value for last_msg_.fwd_payload[4], expected 81, is " + << last_msg_.fwd_payload[4]; + EXPECT_EQ(last_msg_.fwd_payload[5], 103) + << "incorrect value for last_msg_.fwd_payload[5], expected 103, is " + << last_msg_.fwd_payload[5]; + EXPECT_EQ(last_msg_.fwd_payload[6], 65) + << "incorrect value for last_msg_.fwd_payload[6], expected 65, is " + << last_msg_.fwd_payload[6]; + EXPECT_EQ(last_msg_.fwd_payload[7], 69) + << "incorrect value for last_msg_.fwd_payload[7], expected 69, is " + << last_msg_.fwd_payload[7]; + EXPECT_EQ(last_msg_.fwd_payload[8], 65) + << "incorrect value for last_msg_.fwd_payload[8], expected 65, is " + << last_msg_.fwd_payload[8]; + EXPECT_EQ(last_msg_.fwd_payload[9], 65) + << "incorrect value for last_msg_.fwd_payload[9], expected 65, is " + << last_msg_.fwd_payload[9]; + EXPECT_EQ(last_msg_.fwd_payload[10], 65) + << "incorrect value for last_msg_.fwd_payload[10], expected 65, is " + << last_msg_.fwd_payload[10]; + EXPECT_EQ(last_msg_.fwd_payload[11], 65) + << "incorrect value for last_msg_.fwd_payload[11], expected 65, is " + << last_msg_.fwd_payload[11]; + EXPECT_EQ(last_msg_.fwd_payload[12], 65) + << "incorrect value for last_msg_.fwd_payload[12], expected 65, is " + << last_msg_.fwd_payload[12]; + EXPECT_EQ(last_msg_.fwd_payload[13], 69) + << "incorrect value for last_msg_.fwd_payload[13], expected 69, is " + << last_msg_.fwd_payload[13]; + EXPECT_EQ(last_msg_.fwd_payload[14], 97) + << "incorrect value for last_msg_.fwd_payload[14], expected 97, is " + << last_msg_.fwd_payload[14]; + EXPECT_EQ(last_msg_.fwd_payload[15], 103) + << "incorrect value for last_msg_.fwd_payload[15], expected 103, is " + << last_msg_.fwd_payload[15]; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_fwd_payload.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_fwd_payload.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_fwd_payload.handle_as + << "'"; + } + { + const char check_string[] = {(char)102, (char)119, (char)100, (char)95, + (char)112, (char)97, (char)121, (char)108, + (char)111, (char)97, (char)100}; + EXPECT_EQ(memcmp(last_msg_.n_fwd_payload.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_fwd_payload.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_fwd_payload.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_fwd_payload.value, 16) + << "incorrect value for last_msg_.n_fwd_payload.value, expected 16, is " + << last_msg_.n_fwd_payload.value; + EXPECT_EQ(last_msg_.protocol, 0) + << "incorrect value for last_msg_.protocol, expected 0, is " + << last_msg_.protocol; + EXPECT_EQ(last_msg_.source, 0) + << "incorrect value for last_msg_.source, expected 0, is " + << last_msg_.source; } diff --git a/c/test/cpp/auto_check_sbp_logging_MsgLog.cc b/c/test/cpp/auto_check_sbp_logging_MsgLog.cc index 30cff943a..d9cfb1cc4 100644 --- a/c/test/cpp/auto_check_sbp_logging_MsgLog.cc +++ b/c/test/cpp/auto_check_sbp_logging_MsgLog.cc @@ -10,60 +10,54 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/logging/test_MsgLog.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/logging/test_MsgLog.yaml by generate.py. Do not +// modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_logging_MsgLog0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_logging_MsgLog0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_logging_MsgLog0 : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_logging_MsgLog0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_log_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, const sbp_msg_log_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,40 +65,48 @@ class Test_auto_check_sbp_logging_MsgLog0 : sbp_msg_log_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_logging_MsgLog0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_logging_MsgLog0, Test) { + uint8_t encoded_frame[] = { + 85, 1, 4, 10, 9, 44, 6, 70, 105, 108, 116, 101, 114, + 101, 100, 32, 97, 108, 108, 32, 111, 98, 115, 32, 102, 114, + 111, 109, 32, 50, 51, 49, 52, 32, 97, 116, 32, 116, 111, + 119, 32, 56, 51, 46, 53, 51, 57, 48, 49, 57, 177, 163, + }; + + sbp_msg_log_t test_msg{}; + test_msg.level = 6; + + size_t written; + EXPECT_TRUE(sbp_msg_log_text_set( + &test_msg, "Filtered all obs from 2314 at tow 83.539019", false, + &written)); + EXPECT_EQ(written, strlen("Filtered all obs from 2314 at tow 83.539019")); + EXPECT_EQ(sbp_msg_log_text_encoded_len(&test_msg), 43); - uint8_t encoded_frame[] = {85,1,4,10,9,44,6,70,105,108,116,101,114,101,100,32,97,108,108,32,111,98,115,32,102,114,111,109,32,50,51,49,52,32,97,116,32,116,111,119,32,56,51,46,53,51,57,48,49,57,177,163, }; + EXPECT_EQ(send_message(2314, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_log_t test_msg{}; - test_msg.level = 6; - - size_t written; - EXPECT_TRUE(sbp_msg_log_text_set(&test_msg, "Filtered all obs from 2314 at tow 83.539019", false, &written)); - EXPECT_EQ( written, strlen("Filtered all obs from 2314 at tow 83.539019")); - EXPECT_EQ(sbp_msg_log_text_encoded_len(&test_msg), 43); - - EXPECT_EQ(send_message( 2314, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 2314); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.level, 6) + << "incorrect value for last_msg_.level, expected 6, is " + << last_msg_.level; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 2314); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.level, 6) << "incorrect value for last_msg_.level, expected 6, is " << last_msg_.level; - - EXPECT_EQ(sbp_msg_log_text_encoded_len(&last_msg_), 43); - EXPECT_STREQ(sbp_msg_log_text_get(&last_msg_), "Filtered all obs from 2314 at tow 83.539019"); + EXPECT_EQ(sbp_msg_log_text_encoded_len(&last_msg_), 43); + EXPECT_STREQ(sbp_msg_log_text_get(&last_msg_), + "Filtered all obs from 2314 at tow 83.539019"); } diff --git a/c/test/cpp/auto_check_sbp_logging_MsgPrintDep.cc b/c/test/cpp/auto_check_sbp_logging_MsgPrintDep.cc index 145b79354..2aa8b950d 100644 --- a/c/test/cpp/auto_check_sbp_logging_MsgPrintDep.cc +++ b/c/test/cpp/auto_check_sbp_logging_MsgPrintDep.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/logging/test_MsgPrintDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/logging/test_MsgPrintDep.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_logging_MsgPrintDep0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_logging_MsgPrintDep0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_logging_MsgPrintDep0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_logging_MsgPrintDep0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_print_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_print_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,88 +67,88 @@ class Test_auto_check_sbp_logging_MsgPrintDep0 : sbp_msg_print_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_logging_MsgPrintDep0, Test) -{ - - uint8_t encoded_frame[] = {85,16,0,34,34,43,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,49,53,32,102,111,117,110,100,32,64,32,45,50,52,57,55,32,72,122,44,32,50,48,32,83,78,82,10,116,103, }; - - sbp_msg_print_dep_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_print_dep_text_set(&test_msg, "INFO: acq: PRN 15 found @ -2497 Hz, 20 SNR\n", false, &written)); - EXPECT_EQ( written, strlen("INFO: acq: PRN 15 found @ -2497 Hz, 20 SNR\n")); - EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&test_msg), 43); - - EXPECT_EQ(send_message( 8738, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 8738); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&last_msg_), 43); - EXPECT_STREQ(sbp_msg_print_dep_text_get(&last_msg_), "INFO: acq: PRN 15 found @ -2497 Hz, 20 SNR\n"); +}; + +TEST_F(Test_auto_check_sbp_logging_MsgPrintDep0, Test) { + uint8_t encoded_frame[] = { + 85, 16, 0, 34, 34, 43, 73, 78, 70, 79, 58, 32, 97, + 99, 113, 58, 32, 80, 82, 78, 32, 49, 53, 32, 102, 111, + 117, 110, 100, 32, 64, 32, 45, 50, 52, 57, 55, 32, 72, + 122, 44, 32, 50, 48, 32, 83, 78, 82, 10, 116, 103, + }; + + sbp_msg_print_dep_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_print_dep_text_set( + &test_msg, "INFO: acq: PRN 15 found @ -2497 Hz, 20 SNR\n", false, + &written)); + EXPECT_EQ(written, strlen("INFO: acq: PRN 15 found @ -2497 Hz, 20 SNR\n")); + EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&test_msg), 43); + + EXPECT_EQ(send_message(8738, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 8738); + EXPECT_EQ(last_msg_, test_msg); + + EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&last_msg_), 43); + EXPECT_STREQ(sbp_msg_print_dep_text_get(&last_msg_), + "INFO: acq: PRN 15 found @ -2497 Hz, 20 SNR\n"); } -class Test_auto_check_sbp_logging_MsgPrintDep1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_logging_MsgPrintDep1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_logging_MsgPrintDep1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_logging_MsgPrintDep1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_print_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_print_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -160,88 +156,87 @@ class Test_auto_check_sbp_logging_MsgPrintDep1 : sbp_msg_print_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_logging_MsgPrintDep1, Test) -{ - - uint8_t encoded_frame[] = {85,16,0,34,34,42,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,51,49,32,102,111,117,110,100,32,64,32,52,50,52,53,32,72,122,44,32,50,49,32,83,78,82,10,140,43, }; - - sbp_msg_print_dep_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_print_dep_text_set(&test_msg, "INFO: acq: PRN 31 found @ 4245 Hz, 21 SNR\n", false, &written)); - EXPECT_EQ( written, strlen("INFO: acq: PRN 31 found @ 4245 Hz, 21 SNR\n")); - EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&test_msg), 42); - - EXPECT_EQ(send_message( 8738, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 8738); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&last_msg_), 42); - EXPECT_STREQ(sbp_msg_print_dep_text_get(&last_msg_), "INFO: acq: PRN 31 found @ 4245 Hz, 21 SNR\n"); +}; + +TEST_F(Test_auto_check_sbp_logging_MsgPrintDep1, Test) { + uint8_t encoded_frame[] = { + 85, 16, 0, 34, 34, 42, 73, 78, 70, 79, 58, 32, 97, 99, 113, 58, 32, + 80, 82, 78, 32, 51, 49, 32, 102, 111, 117, 110, 100, 32, 64, 32, 52, 50, + 52, 53, 32, 72, 122, 44, 32, 50, 49, 32, 83, 78, 82, 10, 140, 43, + }; + + sbp_msg_print_dep_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_print_dep_text_set( + &test_msg, "INFO: acq: PRN 31 found @ 4245 Hz, 21 SNR\n", false, + &written)); + EXPECT_EQ(written, strlen("INFO: acq: PRN 31 found @ 4245 Hz, 21 SNR\n")); + EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&test_msg), 42); + + EXPECT_EQ(send_message(8738, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 8738); + EXPECT_EQ(last_msg_, test_msg); + + EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&last_msg_), 42); + EXPECT_STREQ(sbp_msg_print_dep_text_get(&last_msg_), + "INFO: acq: PRN 31 found @ 4245 Hz, 21 SNR\n"); } -class Test_auto_check_sbp_logging_MsgPrintDep2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_logging_MsgPrintDep2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_logging_MsgPrintDep2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_logging_MsgPrintDep2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_print_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_print_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -249,88 +244,86 @@ class Test_auto_check_sbp_logging_MsgPrintDep2 : sbp_msg_print_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_logging_MsgPrintDep2, Test) -{ - - uint8_t encoded_frame[] = {85,16,0,34,34,35,73,78,70,79,58,32,68,105,115,97,98,108,105,110,103,32,99,104,97,110,110,101,108,32,48,32,40,80,82,78,32,49,49,41,10,23,143, }; - - sbp_msg_print_dep_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_print_dep_text_set(&test_msg, "INFO: Disabling channel 0 (PRN 11)\n", false, &written)); - EXPECT_EQ( written, strlen("INFO: Disabling channel 0 (PRN 11)\n")); - EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&test_msg), 35); - - EXPECT_EQ(send_message( 8738, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 8738); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&last_msg_), 35); - EXPECT_STREQ(sbp_msg_print_dep_text_get(&last_msg_), "INFO: Disabling channel 0 (PRN 11)\n"); +}; + +TEST_F(Test_auto_check_sbp_logging_MsgPrintDep2, Test) { + uint8_t encoded_frame[] = { + 85, 16, 0, 34, 34, 35, 73, 78, 70, 79, 58, 32, 68, 105, 115, + 97, 98, 108, 105, 110, 103, 32, 99, 104, 97, 110, 110, 101, 108, 32, + 48, 32, 40, 80, 82, 78, 32, 49, 49, 41, 10, 23, 143, + }; + + sbp_msg_print_dep_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_print_dep_text_set( + &test_msg, "INFO: Disabling channel 0 (PRN 11)\n", false, &written)); + EXPECT_EQ(written, strlen("INFO: Disabling channel 0 (PRN 11)\n")); + EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&test_msg), 35); + + EXPECT_EQ(send_message(8738, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 8738); + EXPECT_EQ(last_msg_, test_msg); + + EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&last_msg_), 35); + EXPECT_STREQ(sbp_msg_print_dep_text_get(&last_msg_), + "INFO: Disabling channel 0 (PRN 11)\n"); } -class Test_auto_check_sbp_logging_MsgPrintDep3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_logging_MsgPrintDep3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_logging_MsgPrintDep3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_logging_MsgPrintDep3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_print_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_print_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -338,88 +331,88 @@ class Test_auto_check_sbp_logging_MsgPrintDep3 : sbp_msg_print_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_logging_MsgPrintDep3, Test) -{ - - uint8_t encoded_frame[] = {85,16,0,34,34,41,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,50,32,102,111,117,110,100,32,64,32,51,57,57,54,32,72,122,44,32,50,48,32,83,78,82,10,239,48, }; - - sbp_msg_print_dep_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_print_dep_text_set(&test_msg, "INFO: acq: PRN 2 found @ 3996 Hz, 20 SNR\n", false, &written)); - EXPECT_EQ( written, strlen("INFO: acq: PRN 2 found @ 3996 Hz, 20 SNR\n")); - EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&test_msg), 41); - - EXPECT_EQ(send_message( 8738, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 8738); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&last_msg_), 41); - EXPECT_STREQ(sbp_msg_print_dep_text_get(&last_msg_), "INFO: acq: PRN 2 found @ 3996 Hz, 20 SNR\n"); +}; + +TEST_F(Test_auto_check_sbp_logging_MsgPrintDep3, Test) { + uint8_t encoded_frame[] = { + 85, 16, 0, 34, 34, 41, 73, 78, 70, 79, 58, 32, 97, + 99, 113, 58, 32, 80, 82, 78, 32, 50, 32, 102, 111, 117, + 110, 100, 32, 64, 32, 51, 57, 57, 54, 32, 72, 122, 44, + 32, 50, 48, 32, 83, 78, 82, 10, 239, 48, + }; + + sbp_msg_print_dep_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_print_dep_text_set( + &test_msg, "INFO: acq: PRN 2 found @ 3996 Hz, 20 SNR\n", false, + &written)); + EXPECT_EQ(written, strlen("INFO: acq: PRN 2 found @ 3996 Hz, 20 SNR\n")); + EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&test_msg), 41); + + EXPECT_EQ(send_message(8738, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 8738); + EXPECT_EQ(last_msg_, test_msg); + + EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&last_msg_), 41); + EXPECT_STREQ(sbp_msg_print_dep_text_get(&last_msg_), + "INFO: acq: PRN 2 found @ 3996 Hz, 20 SNR\n"); } -class Test_auto_check_sbp_logging_MsgPrintDep4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_logging_MsgPrintDep4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_logging_MsgPrintDep4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_logging_MsgPrintDep4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_print_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_print_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -427,88 +420,88 @@ class Test_auto_check_sbp_logging_MsgPrintDep4 : sbp_msg_print_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_logging_MsgPrintDep4, Test) -{ - - uint8_t encoded_frame[] = {85,16,0,34,34,42,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,52,32,102,111,117,110,100,32,64,32,45,55,52,57,50,32,72,122,44,32,50,48,32,83,78,82,10,47,248, }; - - sbp_msg_print_dep_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_print_dep_text_set(&test_msg, "INFO: acq: PRN 4 found @ -7492 Hz, 20 SNR\n", false, &written)); - EXPECT_EQ( written, strlen("INFO: acq: PRN 4 found @ -7492 Hz, 20 SNR\n")); - EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&test_msg), 42); - - EXPECT_EQ(send_message( 8738, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 8738); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&last_msg_), 42); - EXPECT_STREQ(sbp_msg_print_dep_text_get(&last_msg_), "INFO: acq: PRN 4 found @ -7492 Hz, 20 SNR\n"); +}; + +TEST_F(Test_auto_check_sbp_logging_MsgPrintDep4, Test) { + uint8_t encoded_frame[] = { + 85, 16, 0, 34, 34, 42, 73, 78, 70, 79, 58, 32, 97, + 99, 113, 58, 32, 80, 82, 78, 32, 52, 32, 102, 111, 117, + 110, 100, 32, 64, 32, 45, 55, 52, 57, 50, 32, 72, 122, + 44, 32, 50, 48, 32, 83, 78, 82, 10, 47, 248, + }; + + sbp_msg_print_dep_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_print_dep_text_set( + &test_msg, "INFO: acq: PRN 4 found @ -7492 Hz, 20 SNR\n", false, + &written)); + EXPECT_EQ(written, strlen("INFO: acq: PRN 4 found @ -7492 Hz, 20 SNR\n")); + EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&test_msg), 42); + + EXPECT_EQ(send_message(8738, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 8738); + EXPECT_EQ(last_msg_, test_msg); + + EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&last_msg_), 42); + EXPECT_STREQ(sbp_msg_print_dep_text_get(&last_msg_), + "INFO: acq: PRN 4 found @ -7492 Hz, 20 SNR\n"); } -class Test_auto_check_sbp_logging_MsgPrintDep5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_logging_MsgPrintDep5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_logging_MsgPrintDep5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_logging_MsgPrintDep5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_print_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_print_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -516,38 +509,42 @@ class Test_auto_check_sbp_logging_MsgPrintDep5 : sbp_msg_print_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_logging_MsgPrintDep5, Test) -{ - - uint8_t encoded_frame[] = {85,16,0,34,34,35,73,78,70,79,58,32,68,105,115,97,98,108,105,110,103,32,99,104,97,110,110,101,108,32,49,32,40,80,82,78,32,49,53,41,10,158,139, }; - - sbp_msg_print_dep_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_print_dep_text_set(&test_msg, "INFO: Disabling channel 1 (PRN 15)\n", false, &written)); - EXPECT_EQ( written, strlen("INFO: Disabling channel 1 (PRN 15)\n")); - EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&test_msg), 35); - - EXPECT_EQ(send_message( 8738, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 8738); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&last_msg_), 35); - EXPECT_STREQ(sbp_msg_print_dep_text_get(&last_msg_), "INFO: Disabling channel 1 (PRN 15)\n"); +}; + +TEST_F(Test_auto_check_sbp_logging_MsgPrintDep5, Test) { + uint8_t encoded_frame[] = { + 85, 16, 0, 34, 34, 35, 73, 78, 70, 79, 58, 32, 68, 105, 115, + 97, 98, 108, 105, 110, 103, 32, 99, 104, 97, 110, 110, 101, 108, 32, + 49, 32, 40, 80, 82, 78, 32, 49, 53, 41, 10, 158, 139, + }; + + sbp_msg_print_dep_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_print_dep_text_set( + &test_msg, "INFO: Disabling channel 1 (PRN 15)\n", false, &written)); + EXPECT_EQ(written, strlen("INFO: Disabling channel 1 (PRN 15)\n")); + EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&test_msg), 35); + + EXPECT_EQ(send_message(8738, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 8738); + EXPECT_EQ(last_msg_, test_msg); + + EXPECT_EQ(sbp_msg_print_dep_text_encoded_len(&last_msg_), 35); + EXPECT_STREQ(sbp_msg_print_dep_text_get(&last_msg_), + "INFO: Disabling channel 1 (PRN 15)\n"); } diff --git a/c/test/cpp/auto_check_sbp_mag_MsgMagRaw.cc b/c/test/cpp/auto_check_sbp_mag_MsgMagRaw.cc index c629734cd..69b4e9ae5 100644 --- a/c/test/cpp/auto_check_sbp_mag_MsgMagRaw.cc +++ b/c/test/cpp/auto_check_sbp_mag_MsgMagRaw.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/mag/test_MsgMagRaw.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/mag/test_MsgMagRaw.yaml by generate.py. Do not +// modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_mag_MsgMagRaw0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_mag_MsgMagRaw0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_mag_MsgMagRaw0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_mag_MsgMagRaw0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_mag_raw_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_mag_raw_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,40 +67,51 @@ class Test_auto_check_sbp_mag_MsgMagRaw0 : sbp_msg_mag_raw_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_mag_MsgMagRaw0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_mag_MsgMagRaw0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 9, 195, 4, 11, 173, 227, 158, 198, + 206, 98, 3, 230, 2, 110, 229, 159, 23, + }; - uint8_t encoded_frame[] = {85,2,9,195,4,11,173,227,158,198,206,98,3,230,2,110,229,159,23, }; + sbp_msg_mag_raw_t test_msg{}; + test_msg.mag_x = 866; + test_msg.mag_y = 742; + test_msg.mag_z = -6802; + test_msg.tow = 3332301741; + test_msg.tow_f = 206; - sbp_msg_mag_raw_t test_msg{}; - test_msg.mag_x = 866; - test_msg.mag_y = 742; - test_msg.mag_z = -6802; - test_msg.tow = 3332301741; - test_msg.tow_f = 206; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.mag_x, 866) << "incorrect value for last_msg_.mag_x, expected 866, is " << last_msg_.mag_x; - EXPECT_EQ(last_msg_.mag_y, 742) << "incorrect value for last_msg_.mag_y, expected 742, is " << last_msg_.mag_y; - EXPECT_EQ(last_msg_.mag_z, -6802) << "incorrect value for last_msg_.mag_z, expected -6802, is " << last_msg_.mag_z; - EXPECT_EQ(last_msg_.tow, 3332301741) << "incorrect value for last_msg_.tow, expected 3332301741, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.tow_f, 206) << "incorrect value for last_msg_.tow_f, expected 206, is " << last_msg_.tow_f; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.mag_x, 866) + << "incorrect value for last_msg_.mag_x, expected 866, is " + << last_msg_.mag_x; + EXPECT_EQ(last_msg_.mag_y, 742) + << "incorrect value for last_msg_.mag_y, expected 742, is " + << last_msg_.mag_y; + EXPECT_EQ(last_msg_.mag_z, -6802) + << "incorrect value for last_msg_.mag_z, expected -6802, is " + << last_msg_.mag_z; + EXPECT_EQ(last_msg_.tow, 3332301741) + << "incorrect value for last_msg_.tow, expected 3332301741, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.tow_f, 206) + << "incorrect value for last_msg_.tow_f, expected 206, is " + << last_msg_.tow_f; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgAgeCorrections.cc b/c/test/cpp/auto_check_sbp_navigation_MsgAgeCorrections.cc index 3c387b1ca..490024fc1 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgAgeCorrections.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgAgeCorrections.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgAgeCorrections.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgAgeCorrections.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgAgeCorrections0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgAgeCorrections0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgAgeCorrections0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgAgeCorrections0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_age_corrections_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_age_corrections_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,34 +67,37 @@ class Test_auto_check_sbp_navigation_MsgAgeCorrections0 : sbp_msg_age_corrections_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgAgeCorrections0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgAgeCorrections0, Test) { + uint8_t encoded_frame[] = { + 85, 16, 2, 66, 0, 6, 100, 0, 0, 0, 30, 0, 233, 202, + }; - uint8_t encoded_frame[] = {85,16,2,66,0,6,100,0,0,0,30,0,233,202, }; + sbp_msg_age_corrections_t test_msg{}; + test_msg.age = 30; + test_msg.tow = 100; - sbp_msg_age_corrections_t test_msg{}; - test_msg.age = 30; - test_msg.tow = 100; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.age, 30) << "incorrect value for last_msg_.age, expected 30, is " << last_msg_.age; - EXPECT_EQ(last_msg_.tow, 100) << "incorrect value for last_msg_.tow, expected 100, is " << last_msg_.tow; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.age, 30) + << "incorrect value for last_msg_.age, expected 30, is " << last_msg_.age; + EXPECT_EQ(last_msg_.tow, 100) + << "incorrect value for last_msg_.tow, expected 100, is " + << last_msg_.tow; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgBaselineECEF.cc b/c/test/cpp/auto_check_sbp_navigation_MsgBaselineECEF.cc index 8f4a6736e..f267713d4 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgBaselineECEF.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgBaselineECEF.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEF.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgBaselineECEF0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEF0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgBaselineECEF0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEF0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,94 +67,102 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEF0 : sbp_msg_baseline_ecef_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEF0, Test) -{ - - uint8_t encoded_frame[] = {85,11,2,211,136,20,40,244,122,19,150,98,238,255,190,64,20,0,246,163,9,0,0,0,14,0,219,191, }; - - sbp_msg_baseline_ecef_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 14; - test_msg.tow = 326825000; - test_msg.x = -1154410; - test_msg.y = 1327294; - test_msg.z = 631798; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 14) << "incorrect value for last_msg_.n_sats, expected 14, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326825000) << "incorrect value for last_msg_.tow, expected 326825000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -1154410) << "incorrect value for last_msg_.x, expected -1154410, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, 1327294) << "incorrect value for last_msg_.y, expected 1327294, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 631798) << "incorrect value for last_msg_.z, expected 631798, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEF0, Test) { + uint8_t encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 40, 244, 122, 19, 150, 98, 238, 255, + 190, 64, 20, 0, 246, 163, 9, 0, 0, 0, 14, 0, 219, 191, + }; + + sbp_msg_baseline_ecef_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 14; + test_msg.tow = 326825000; + test_msg.x = -1154410; + test_msg.y = 1327294; + test_msg.z = 631798; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 14) + << "incorrect value for last_msg_.n_sats, expected 14, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326825000) + << "incorrect value for last_msg_.tow, expected 326825000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -1154410) + << "incorrect value for last_msg_.x, expected -1154410, is " + << last_msg_.x; + EXPECT_EQ(last_msg_.y, 1327294) + << "incorrect value for last_msg_.y, expected 1327294, is " + << last_msg_.y; + EXPECT_EQ(last_msg_.z, 631798) + << "incorrect value for last_msg_.z, expected 631798, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgBaselineECEF1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEF1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineECEF1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEF1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -166,94 +170,102 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEF1 : sbp_msg_baseline_ecef_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEF1, Test) -{ - - uint8_t encoded_frame[] = {85,11,2,211,136,20,16,248,122,19,72,99,238,255,191,65,20,0,138,162,9,0,0,0,15,0,240,78, }; - - sbp_msg_baseline_ecef_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 15; - test_msg.tow = 326826000; - test_msg.x = -1154232; - test_msg.y = 1327551; - test_msg.z = 631434; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326826000) << "incorrect value for last_msg_.tow, expected 326826000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -1154232) << "incorrect value for last_msg_.x, expected -1154232, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, 1327551) << "incorrect value for last_msg_.y, expected 1327551, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 631434) << "incorrect value for last_msg_.z, expected 631434, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEF1, Test) { + uint8_t encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 16, 248, 122, 19, 72, 99, 238, 255, + 191, 65, 20, 0, 138, 162, 9, 0, 0, 0, 15, 0, 240, 78, + }; + + sbp_msg_baseline_ecef_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 15; + test_msg.tow = 326826000; + test_msg.x = -1154232; + test_msg.y = 1327551; + test_msg.z = 631434; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326826000) + << "incorrect value for last_msg_.tow, expected 326826000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -1154232) + << "incorrect value for last_msg_.x, expected -1154232, is " + << last_msg_.x; + EXPECT_EQ(last_msg_.y, 1327551) + << "incorrect value for last_msg_.y, expected 1327551, is " + << last_msg_.y; + EXPECT_EQ(last_msg_.z, 631434) + << "incorrect value for last_msg_.z, expected 631434, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgBaselineECEF2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEF2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineECEF2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEF2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -261,94 +273,102 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEF2 : sbp_msg_baseline_ecef_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEF2, Test) -{ - - uint8_t encoded_frame[] = {85,11,2,211,136,20,248,251,122,19,41,99,238,255,181,65,20,0,148,161,9,0,0,0,15,0,4,132, }; - - sbp_msg_baseline_ecef_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 15; - test_msg.tow = 326827000; - test_msg.x = -1154263; - test_msg.y = 1327541; - test_msg.z = 631188; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326827000) << "incorrect value for last_msg_.tow, expected 326827000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -1154263) << "incorrect value for last_msg_.x, expected -1154263, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, 1327541) << "incorrect value for last_msg_.y, expected 1327541, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 631188) << "incorrect value for last_msg_.z, expected 631188, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEF2, Test) { + uint8_t encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 248, 251, 122, 19, 41, 99, 238, 255, + 181, 65, 20, 0, 148, 161, 9, 0, 0, 0, 15, 0, 4, 132, + }; + + sbp_msg_baseline_ecef_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 15; + test_msg.tow = 326827000; + test_msg.x = -1154263; + test_msg.y = 1327541; + test_msg.z = 631188; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326827000) + << "incorrect value for last_msg_.tow, expected 326827000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -1154263) + << "incorrect value for last_msg_.x, expected -1154263, is " + << last_msg_.x; + EXPECT_EQ(last_msg_.y, 1327541) + << "incorrect value for last_msg_.y, expected 1327541, is " + << last_msg_.y; + EXPECT_EQ(last_msg_.z, 631188) + << "incorrect value for last_msg_.z, expected 631188, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgBaselineECEF3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEF3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineECEF3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEF3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -356,94 +376,102 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEF3 : sbp_msg_baseline_ecef_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEF3, Test) -{ - - uint8_t encoded_frame[] = {85,11,2,211,136,20,224,255,122,19,188,97,238,255,81,64,20,0,65,160,9,0,0,0,15,0,67,94, }; - - sbp_msg_baseline_ecef_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 15; - test_msg.tow = 326828000; - test_msg.x = -1154628; - test_msg.y = 1327185; - test_msg.z = 630849; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326828000) << "incorrect value for last_msg_.tow, expected 326828000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -1154628) << "incorrect value for last_msg_.x, expected -1154628, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, 1327185) << "incorrect value for last_msg_.y, expected 1327185, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 630849) << "incorrect value for last_msg_.z, expected 630849, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEF3, Test) { + uint8_t encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 224, 255, 122, 19, 188, 97, 238, 255, + 81, 64, 20, 0, 65, 160, 9, 0, 0, 0, 15, 0, 67, 94, + }; + + sbp_msg_baseline_ecef_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 15; + test_msg.tow = 326828000; + test_msg.x = -1154628; + test_msg.y = 1327185; + test_msg.z = 630849; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326828000) + << "incorrect value for last_msg_.tow, expected 326828000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -1154628) + << "incorrect value for last_msg_.x, expected -1154628, is " + << last_msg_.x; + EXPECT_EQ(last_msg_.y, 1327185) + << "incorrect value for last_msg_.y, expected 1327185, is " + << last_msg_.y; + EXPECT_EQ(last_msg_.z, 630849) + << "incorrect value for last_msg_.z, expected 630849, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgBaselineECEF4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEF4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineECEF4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEF4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -451,44 +479,58 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEF4 : sbp_msg_baseline_ecef_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEF4, Test) -{ - - uint8_t encoded_frame[] = {85,11,2,211,136,20,200,3,123,19,189,96,238,255,93,63,20,0,98,159,9,0,0,0,15,0,106,94, }; - - sbp_msg_baseline_ecef_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 15; - test_msg.tow = 326829000; - test_msg.x = -1154883; - test_msg.y = 1326941; - test_msg.z = 630626; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326829000) << "incorrect value for last_msg_.tow, expected 326829000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -1154883) << "incorrect value for last_msg_.x, expected -1154883, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, 1326941) << "incorrect value for last_msg_.y, expected 1326941, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 630626) << "incorrect value for last_msg_.z, expected 630626, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEF4, Test) { + uint8_t encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 200, 3, 123, 19, 189, 96, 238, 255, + 93, 63, 20, 0, 98, 159, 9, 0, 0, 0, 15, 0, 106, 94, + }; + + sbp_msg_baseline_ecef_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 15; + test_msg.tow = 326829000; + test_msg.x = -1154883; + test_msg.y = 1326941; + test_msg.z = 630626; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326829000) + << "incorrect value for last_msg_.tow, expected 326829000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -1154883) + << "incorrect value for last_msg_.x, expected -1154883, is " + << last_msg_.x; + EXPECT_EQ(last_msg_.y, 1326941) + << "incorrect value for last_msg_.y, expected 1326941, is " + << last_msg_.y; + EXPECT_EQ(last_msg_.z, 630626) + << "incorrect value for last_msg_.z, expected 630626, is " << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgBaselineECEFDepA.cc b/c/test/cpp/auto_check_sbp_navigation_MsgBaselineECEFDepA.cc index 3299e3cb6..c08eac33f 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgBaselineECEFDepA.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgBaselineECEFDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEFDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEFDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEFDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEFDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,94 +67,100 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA0 : sbp_msg_baseline_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,246,215,20,20,46,39,0,21,48,255,255,52,117,255,255,216,211,254,255,0,0,9,1,50,137, }; - - sbp_msg_baseline_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 1; - test_msg.n_sats = 9; - test_msg.tow = 2567700; - test_msg.x = -53227; - test_msg.y = -35532; - test_msg.z = -76840; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567700) << "incorrect value for last_msg_.tow, expected 2567700, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -53227) << "incorrect value for last_msg_.x, expected -53227, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -35532) << "incorrect value for last_msg_.y, expected -35532, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, -76840) << "incorrect value for last_msg_.z, expected -76840, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 20, 46, 39, 0, 21, 48, 255, 255, + 52, 117, 255, 255, 216, 211, 254, 255, 0, 0, 9, 1, 50, 137, + }; + + sbp_msg_baseline_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 1; + test_msg.n_sats = 9; + test_msg.tow = 2567700; + test_msg.x = -53227; + test_msg.y = -35532; + test_msg.z = -76840; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567700) + << "incorrect value for last_msg_.tow, expected 2567700, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -53227) + << "incorrect value for last_msg_.x, expected -53227, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -35532) + << "incorrect value for last_msg_.y, expected -35532, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, -76840) + << "incorrect value for last_msg_.z, expected -76840, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEFDepA1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEFDepA1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -166,94 +168,100 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA1 : sbp_msg_baseline_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,246,215,20,120,46,39,0,58,49,255,255,49,116,255,255,134,211,254,255,0,0,9,1,227,155, }; - - sbp_msg_baseline_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 1; - test_msg.n_sats = 9; - test_msg.tow = 2567800; - test_msg.x = -52934; - test_msg.y = -35791; - test_msg.z = -76922; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567800) << "incorrect value for last_msg_.tow, expected 2567800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -52934) << "incorrect value for last_msg_.x, expected -52934, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -35791) << "incorrect value for last_msg_.y, expected -35791, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, -76922) << "incorrect value for last_msg_.z, expected -76922, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 120, 46, 39, 0, 58, 49, 255, 255, + 49, 116, 255, 255, 134, 211, 254, 255, 0, 0, 9, 1, 227, 155, + }; + + sbp_msg_baseline_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 1; + test_msg.n_sats = 9; + test_msg.tow = 2567800; + test_msg.x = -52934; + test_msg.y = -35791; + test_msg.z = -76922; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567800) + << "incorrect value for last_msg_.tow, expected 2567800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -52934) + << "incorrect value for last_msg_.x, expected -52934, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -35791) + << "incorrect value for last_msg_.y, expected -35791, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, -76922) + << "incorrect value for last_msg_.z, expected -76922, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEFDepA2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEFDepA2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -261,94 +269,100 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA2 : sbp_msg_baseline_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,246,215,20,220,46,39,0,97,50,255,255,47,115,255,255,52,211,254,255,0,0,9,1,61,126, }; - - sbp_msg_baseline_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 1; - test_msg.n_sats = 9; - test_msg.tow = 2567900; - test_msg.x = -52639; - test_msg.y = -36049; - test_msg.z = -77004; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567900) << "incorrect value for last_msg_.tow, expected 2567900, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -52639) << "incorrect value for last_msg_.x, expected -52639, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -36049) << "incorrect value for last_msg_.y, expected -36049, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, -77004) << "incorrect value for last_msg_.z, expected -77004, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 220, 46, 39, 0, 97, 50, 255, 255, + 47, 115, 255, 255, 52, 211, 254, 255, 0, 0, 9, 1, 61, 126, + }; + + sbp_msg_baseline_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 1; + test_msg.n_sats = 9; + test_msg.tow = 2567900; + test_msg.x = -52639; + test_msg.y = -36049; + test_msg.z = -77004; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567900) + << "incorrect value for last_msg_.tow, expected 2567900, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -52639) + << "incorrect value for last_msg_.x, expected -52639, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -36049) + << "incorrect value for last_msg_.y, expected -36049, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, -77004) + << "incorrect value for last_msg_.z, expected -77004, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEFDepA3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEFDepA3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -356,94 +370,100 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA3 : sbp_msg_baseline_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,246,215,20,64,47,39,0,136,51,255,255,45,114,255,255,228,210,254,255,0,0,9,1,200,79, }; - - sbp_msg_baseline_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 1; - test_msg.n_sats = 9; - test_msg.tow = 2568000; - test_msg.x = -52344; - test_msg.y = -36307; - test_msg.z = -77084; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2568000) << "incorrect value for last_msg_.tow, expected 2568000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -52344) << "incorrect value for last_msg_.x, expected -52344, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -36307) << "incorrect value for last_msg_.y, expected -36307, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, -77084) << "incorrect value for last_msg_.z, expected -77084, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 64, 47, 39, 0, 136, 51, 255, 255, + 45, 114, 255, 255, 228, 210, 254, 255, 0, 0, 9, 1, 200, 79, + }; + + sbp_msg_baseline_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 1; + test_msg.n_sats = 9; + test_msg.tow = 2568000; + test_msg.x = -52344; + test_msg.y = -36307; + test_msg.z = -77084; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2568000) + << "incorrect value for last_msg_.tow, expected 2568000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -52344) + << "incorrect value for last_msg_.x, expected -52344, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -36307) + << "incorrect value for last_msg_.y, expected -36307, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, -77084) + << "incorrect value for last_msg_.z, expected -77084, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEFDepA4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEFDepA4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -451,94 +471,100 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA4 : sbp_msg_baseline_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,246,215,20,164,47,39,0,176,52,255,255,44,113,255,255,149,210,254,255,0,0,9,1,104,24, }; - - sbp_msg_baseline_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 1; - test_msg.n_sats = 9; - test_msg.tow = 2568100; - test_msg.x = -52048; - test_msg.y = -36564; - test_msg.z = -77163; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2568100) << "incorrect value for last_msg_.tow, expected 2568100, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -52048) << "incorrect value for last_msg_.x, expected -52048, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -36564) << "incorrect value for last_msg_.y, expected -36564, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, -77163) << "incorrect value for last_msg_.z, expected -77163, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 164, 47, 39, 0, 176, 52, 255, 255, + 44, 113, 255, 255, 149, 210, 254, 255, 0, 0, 9, 1, 104, 24, + }; + + sbp_msg_baseline_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 1; + test_msg.n_sats = 9; + test_msg.tow = 2568100; + test_msg.x = -52048; + test_msg.y = -36564; + test_msg.z = -77163; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2568100) + << "incorrect value for last_msg_.tow, expected 2568100, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -52048) + << "incorrect value for last_msg_.x, expected -52048, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -36564) + << "incorrect value for last_msg_.y, expected -36564, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, -77163) + << "incorrect value for last_msg_.z, expected -77163, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEFDepA5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEFDepA5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -546,94 +572,100 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA5 : sbp_msg_baseline_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,195,4,20,156,21,69,24,169,231,255,255,102,208,255,255,251,28,0,0,0,0,6,0,146,168, }; - - sbp_msg_baseline_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 6; - test_msg.tow = 407180700; - test_msg.x = -6231; - test_msg.y = -12186; - test_msg.z = 7419; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 6) << "incorrect value for last_msg_.n_sats, expected 6, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407180700) << "incorrect value for last_msg_.tow, expected 407180700, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -6231) << "incorrect value for last_msg_.x, expected -6231, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -12186) << "incorrect value for last_msg_.y, expected -12186, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 7419) << "incorrect value for last_msg_.z, expected 7419, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 156, 21, 69, 24, 169, 231, 255, 255, + 102, 208, 255, 255, 251, 28, 0, 0, 0, 0, 6, 0, 146, 168, + }; + + sbp_msg_baseline_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 6; + test_msg.tow = 407180700; + test_msg.x = -6231; + test_msg.y = -12186; + test_msg.z = 7419; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 6) + << "incorrect value for last_msg_.n_sats, expected 6, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407180700) + << "incorrect value for last_msg_.tow, expected 407180700, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -6231) + << "incorrect value for last_msg_.x, expected -6231, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -12186) + << "incorrect value for last_msg_.y, expected -12186, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 7419) + << "incorrect value for last_msg_.z, expected 7419, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA6 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEFDepA6() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA6 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEFDepA6() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -641,94 +673,100 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA6 : sbp_msg_baseline_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,195,4,20,0,22,69,24,169,231,255,255,103,208,255,255,252,28,0,0,0,0,6,0,34,116, }; - - sbp_msg_baseline_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 6; - test_msg.tow = 407180800; - test_msg.x = -6231; - test_msg.y = -12185; - test_msg.z = 7420; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 6) << "incorrect value for last_msg_.n_sats, expected 6, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407180800) << "incorrect value for last_msg_.tow, expected 407180800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -6231) << "incorrect value for last_msg_.x, expected -6231, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -12185) << "incorrect value for last_msg_.y, expected -12185, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 7420) << "incorrect value for last_msg_.z, expected 7420, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 0, 22, 69, 24, 169, 231, 255, 255, + 103, 208, 255, 255, 252, 28, 0, 0, 0, 0, 6, 0, 34, 116, + }; + + sbp_msg_baseline_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 6; + test_msg.tow = 407180800; + test_msg.x = -6231; + test_msg.y = -12185; + test_msg.z = 7420; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 6) + << "incorrect value for last_msg_.n_sats, expected 6, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407180800) + << "incorrect value for last_msg_.tow, expected 407180800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -6231) + << "incorrect value for last_msg_.x, expected -6231, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -12185) + << "incorrect value for last_msg_.y, expected -12185, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 7420) + << "incorrect value for last_msg_.z, expected 7420, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA7 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEFDepA7() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA7 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEFDepA7() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -736,94 +774,100 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA7 : sbp_msg_baseline_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,195,4,20,100,22,69,24,30,224,255,255,192,183,255,255,239,53,0,0,0,0,6,0,225,15, }; - - sbp_msg_baseline_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 6; - test_msg.tow = 407180900; - test_msg.x = -8162; - test_msg.y = -18496; - test_msg.z = 13807; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 6) << "incorrect value for last_msg_.n_sats, expected 6, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407180900) << "incorrect value for last_msg_.tow, expected 407180900, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -8162) << "incorrect value for last_msg_.x, expected -8162, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -18496) << "incorrect value for last_msg_.y, expected -18496, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 13807) << "incorrect value for last_msg_.z, expected 13807, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 100, 22, 69, 24, 30, 224, 255, 255, + 192, 183, 255, 255, 239, 53, 0, 0, 0, 0, 6, 0, 225, 15, + }; + + sbp_msg_baseline_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 6; + test_msg.tow = 407180900; + test_msg.x = -8162; + test_msg.y = -18496; + test_msg.z = 13807; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 6) + << "incorrect value for last_msg_.n_sats, expected 6, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407180900) + << "incorrect value for last_msg_.tow, expected 407180900, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -8162) + << "incorrect value for last_msg_.x, expected -8162, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -18496) + << "incorrect value for last_msg_.y, expected -18496, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 13807) + << "incorrect value for last_msg_.z, expected 13807, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA8 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEFDepA8() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA8 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEFDepA8() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -831,94 +875,100 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA8 : sbp_msg_baseline_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,195,4,20,200,22,69,24,28,224,255,255,191,183,255,255,242,53,0,0,0,0,6,0,35,100, }; - - sbp_msg_baseline_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 6; - test_msg.tow = 407181000; - test_msg.x = -8164; - test_msg.y = -18497; - test_msg.z = 13810; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 6) << "incorrect value for last_msg_.n_sats, expected 6, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407181000) << "incorrect value for last_msg_.tow, expected 407181000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -8164) << "incorrect value for last_msg_.x, expected -8164, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -18497) << "incorrect value for last_msg_.y, expected -18497, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 13810) << "incorrect value for last_msg_.z, expected 13810, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 200, 22, 69, 24, 28, 224, 255, 255, + 191, 183, 255, 255, 242, 53, 0, 0, 0, 0, 6, 0, 35, 100, + }; + + sbp_msg_baseline_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 6; + test_msg.tow = 407181000; + test_msg.x = -8164; + test_msg.y = -18497; + test_msg.z = 13810; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 6) + << "incorrect value for last_msg_.n_sats, expected 6, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407181000) + << "incorrect value for last_msg_.tow, expected 407181000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -8164) + << "incorrect value for last_msg_.x, expected -8164, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -18497) + << "incorrect value for last_msg_.y, expected -18497, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 13810) + << "incorrect value for last_msg_.z, expected 13810, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA9 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEFDepA9() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA9 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEFDepA9() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -926,94 +976,100 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA9 : sbp_msg_baseline_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA9, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,195,4,20,44,23,69,24,24,227,255,255,25,195,255,255,153,59,0,0,0,0,6,0,66,66, }; - - sbp_msg_baseline_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 6; - test_msg.tow = 407181100; - test_msg.x = -7400; - test_msg.y = -15591; - test_msg.z = 15257; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 6) << "incorrect value for last_msg_.n_sats, expected 6, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407181100) << "incorrect value for last_msg_.tow, expected 407181100, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -7400) << "incorrect value for last_msg_.x, expected -7400, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -15591) << "incorrect value for last_msg_.y, expected -15591, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 15257) << "incorrect value for last_msg_.z, expected 15257, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA9, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 44, 23, 69, 24, 24, 227, 255, 255, + 25, 195, 255, 255, 153, 59, 0, 0, 0, 0, 6, 0, 66, 66, + }; + + sbp_msg_baseline_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 6; + test_msg.tow = 407181100; + test_msg.x = -7400; + test_msg.y = -15591; + test_msg.z = 15257; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 6) + << "incorrect value for last_msg_.n_sats, expected 6, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407181100) + << "incorrect value for last_msg_.tow, expected 407181100, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -7400) + << "incorrect value for last_msg_.x, expected -7400, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -15591) + << "incorrect value for last_msg_.y, expected -15591, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 15257) + << "incorrect value for last_msg_.z, expected 15257, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA10 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineECEFDepA10() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA10 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineECEFDepA10() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -1021,44 +1077,56 @@ class Test_auto_check_sbp_navigation_MsgBaselineECEFDepA10 : sbp_msg_baseline_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA10, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,195,4,20,144,23,69,24,23,227,255,255,25,195,255,255,153,59,0,0,0,0,6,0,35,135, }; - - sbp_msg_baseline_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 6; - test_msg.tow = 407181200; - test_msg.x = -7401; - test_msg.y = -15591; - test_msg.z = 15257; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 6) << "incorrect value for last_msg_.n_sats, expected 6, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407181200) << "incorrect value for last_msg_.tow, expected 407181200, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -7401) << "incorrect value for last_msg_.x, expected -7401, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -15591) << "incorrect value for last_msg_.y, expected -15591, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 15257) << "incorrect value for last_msg_.z, expected 15257, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineECEFDepA10, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 144, 23, 69, 24, 23, 227, 255, 255, + 25, 195, 255, 255, 153, 59, 0, 0, 0, 0, 6, 0, 35, 135, + }; + + sbp_msg_baseline_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 6; + test_msg.tow = 407181200; + test_msg.x = -7401; + test_msg.y = -15591; + test_msg.z = 15257; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 6) + << "incorrect value for last_msg_.n_sats, expected 6, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407181200) + << "incorrect value for last_msg_.tow, expected 407181200, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -7401) + << "incorrect value for last_msg_.x, expected -7401, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -15591) + << "incorrect value for last_msg_.y, expected -15591, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 15257) + << "incorrect value for last_msg_.z, expected 15257, is " << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgBaselineHeadingDepA.cc b/c/test/cpp/auto_check_sbp_navigation_MsgBaselineHeadingDepA.cc index d7443e8e6..9feb4f5eb 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgBaselineHeadingDepA.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgBaselineHeadingDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineHeadingDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineHeadingDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgBaselineHeadingDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineHeadingDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgBaselineHeadingDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineHeadingDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_heading_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_heading_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,38 +67,47 @@ class Test_auto_check_sbp_navigation_MsgBaselineHeadingDepA0 : sbp_msg_baseline_heading_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineHeadingDepA0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineHeadingDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 7, 2, 124, 206, 10, 82, 109, 88, + 176, 68, 14, 82, 203, 186, 58, 173, 182, + }; - uint8_t encoded_frame[] = {85,7,2,124,206,10,82,109,88,176,68,14,82,203,186,58,173,182, }; + sbp_msg_baseline_heading_dep_a_t test_msg{}; + test_msg.flags = 58; + test_msg.heading = 3411152452; + test_msg.n_sats = 186; + test_msg.tow = 2958585170; - sbp_msg_baseline_heading_dep_a_t test_msg{}; - test_msg.flags = 58; - test_msg.heading = 3411152452; - test_msg.n_sats = 186; - test_msg.tow = 2958585170; - - EXPECT_EQ(send_message( 52860, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(52860, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 52860); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 58) << "incorrect value for last_msg_.flags, expected 58, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.heading, 3411152452) << "incorrect value for last_msg_.heading, expected 3411152452, is " << last_msg_.heading; - EXPECT_EQ(last_msg_.n_sats, 186) << "incorrect value for last_msg_.n_sats, expected 186, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2958585170) << "incorrect value for last_msg_.tow, expected 2958585170, is " << last_msg_.tow; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 52860); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 58) + << "incorrect value for last_msg_.flags, expected 58, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.heading, 3411152452) + << "incorrect value for last_msg_.heading, expected 3411152452, is " + << last_msg_.heading; + EXPECT_EQ(last_msg_.n_sats, 186) + << "incorrect value for last_msg_.n_sats, expected 186, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2958585170) + << "incorrect value for last_msg_.tow, expected 2958585170, is " + << last_msg_.tow; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgBaselineNED.cc b/c/test/cpp/auto_check_sbp_navigation_MsgBaselineNED.cc index 5ab46767d..023c4b323 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgBaselineNED.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgBaselineNED.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNED.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNED.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgBaselineNED0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNED0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgBaselineNED0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNED0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,96 +67,105 @@ class Test_auto_check_sbp_navigation_MsgBaselineNED0 : sbp_msg_baseline_ned_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNED0, Test) -{ - - uint8_t encoded_frame[] = {85,12,2,211,136,22,40,244,122,19,201,115,12,0,179,88,230,255,153,125,0,0,0,0,0,0,14,0,226,70, }; - - sbp_msg_baseline_ned_t test_msg{}; - test_msg.d = 32153; - test_msg.e = -1681229; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = 816073; - test_msg.n_sats = 14; - test_msg.tow = 326825000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 32153) << "incorrect value for last_msg_.d, expected 32153, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -1681229) << "incorrect value for last_msg_.e, expected -1681229, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, 816073) << "incorrect value for last_msg_.n, expected 816073, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 14) << "incorrect value for last_msg_.n_sats, expected 14, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326825000) << "incorrect value for last_msg_.tow, expected 326825000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNED0, Test) { + uint8_t encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 40, 244, 122, 19, 201, 115, 12, 0, 179, + 88, 230, 255, 153, 125, 0, 0, 0, 0, 0, 0, 14, 0, 226, 70, + }; + + sbp_msg_baseline_ned_t test_msg{}; + test_msg.d = 32153; + test_msg.e = -1681229; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = 816073; + test_msg.n_sats = 14; + test_msg.tow = 326825000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 32153) + << "incorrect value for last_msg_.d, expected 32153, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -1681229) + << "incorrect value for last_msg_.e, expected -1681229, is " + << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, 816073) + << "incorrect value for last_msg_.n, expected 816073, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 14) + << "incorrect value for last_msg_.n_sats, expected 14, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326825000) + << "incorrect value for last_msg_.tow, expected 326825000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgBaselineNED1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNED1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineNED1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNED1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -168,96 +173,105 @@ class Test_auto_check_sbp_navigation_MsgBaselineNED1 : sbp_msg_baseline_ned_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNED1, Test) -{ - - uint8_t encoded_frame[] = {85,12,2,211,136,22,16,248,122,19,98,115,12,0,194,88,230,255,110,127,0,0,0,0,0,0,15,0,69,93, }; - - sbp_msg_baseline_ned_t test_msg{}; - test_msg.d = 32622; - test_msg.e = -1681214; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = 815970; - test_msg.n_sats = 15; - test_msg.tow = 326826000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 32622) << "incorrect value for last_msg_.d, expected 32622, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -1681214) << "incorrect value for last_msg_.e, expected -1681214, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, 815970) << "incorrect value for last_msg_.n, expected 815970, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326826000) << "incorrect value for last_msg_.tow, expected 326826000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNED1, Test) { + uint8_t encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 16, 248, 122, 19, 98, 115, 12, 0, 194, + 88, 230, 255, 110, 127, 0, 0, 0, 0, 0, 0, 15, 0, 69, 93, + }; + + sbp_msg_baseline_ned_t test_msg{}; + test_msg.d = 32622; + test_msg.e = -1681214; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = 815970; + test_msg.n_sats = 15; + test_msg.tow = 326826000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 32622) + << "incorrect value for last_msg_.d, expected 32622, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -1681214) + << "incorrect value for last_msg_.e, expected -1681214, is " + << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, 815970) + << "incorrect value for last_msg_.n, expected 815970, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326826000) + << "incorrect value for last_msg_.tow, expected 326826000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgBaselineNED2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNED2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineNED2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNED2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -265,96 +279,105 @@ class Test_auto_check_sbp_navigation_MsgBaselineNED2 : sbp_msg_baseline_ned_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNED2, Test) -{ - - uint8_t encoded_frame[] = {85,12,2,211,136,22,248,251,122,19,143,114,12,0,173,88,230,255,238,127,0,0,0,0,0,0,15,0,210,169, }; - - sbp_msg_baseline_ned_t test_msg{}; - test_msg.d = 32750; - test_msg.e = -1681235; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = 815759; - test_msg.n_sats = 15; - test_msg.tow = 326827000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 32750) << "incorrect value for last_msg_.d, expected 32750, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -1681235) << "incorrect value for last_msg_.e, expected -1681235, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, 815759) << "incorrect value for last_msg_.n, expected 815759, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326827000) << "incorrect value for last_msg_.tow, expected 326827000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNED2, Test) { + uint8_t encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 248, 251, 122, 19, 143, 114, 12, 0, 173, + 88, 230, 255, 238, 127, 0, 0, 0, 0, 0, 0, 15, 0, 210, 169, + }; + + sbp_msg_baseline_ned_t test_msg{}; + test_msg.d = 32750; + test_msg.e = -1681235; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = 815759; + test_msg.n_sats = 15; + test_msg.tow = 326827000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 32750) + << "incorrect value for last_msg_.d, expected 32750, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -1681235) + << "incorrect value for last_msg_.e, expected -1681235, is " + << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, 815759) + << "incorrect value for last_msg_.n, expected 815759, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326827000) + << "incorrect value for last_msg_.tow, expected 326827000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgBaselineNED3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNED3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineNED3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNED3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -362,96 +385,105 @@ class Test_auto_check_sbp_navigation_MsgBaselineNED3 : sbp_msg_baseline_ned_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNED3, Test) -{ - - uint8_t encoded_frame[] = {85,12,2,211,136,22,224,255,122,19,86,112,12,0,51,88,230,255,47,127,0,0,0,0,0,0,15,0,135,107, }; - - sbp_msg_baseline_ned_t test_msg{}; - test_msg.d = 32559; - test_msg.e = -1681357; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = 815190; - test_msg.n_sats = 15; - test_msg.tow = 326828000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 32559) << "incorrect value for last_msg_.d, expected 32559, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -1681357) << "incorrect value for last_msg_.e, expected -1681357, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, 815190) << "incorrect value for last_msg_.n, expected 815190, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326828000) << "incorrect value for last_msg_.tow, expected 326828000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNED3, Test) { + uint8_t encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 224, 255, 122, 19, 86, 112, 12, 0, 51, + 88, 230, 255, 47, 127, 0, 0, 0, 0, 0, 0, 15, 0, 135, 107, + }; + + sbp_msg_baseline_ned_t test_msg{}; + test_msg.d = 32559; + test_msg.e = -1681357; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = 815190; + test_msg.n_sats = 15; + test_msg.tow = 326828000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 32559) + << "incorrect value for last_msg_.d, expected 32559, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -1681357) + << "incorrect value for last_msg_.e, expected -1681357, is " + << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, 815190) + << "incorrect value for last_msg_.n, expected 815190, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326828000) + << "incorrect value for last_msg_.tow, expected 326828000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgBaselineNED4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNED4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineNED4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNED4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -459,46 +491,61 @@ class Test_auto_check_sbp_navigation_MsgBaselineNED4 : sbp_msg_baseline_ned_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNED4, Test) -{ - - uint8_t encoded_frame[] = {85,12,2,211,136,22,200,3,123,19,214,110,12,0,220,87,230,255,165,126,0,0,0,0,0,0,15,0,190,80, }; - - sbp_msg_baseline_ned_t test_msg{}; - test_msg.d = 32421; - test_msg.e = -1681444; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = 814806; - test_msg.n_sats = 15; - test_msg.tow = 326829000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 32421) << "incorrect value for last_msg_.d, expected 32421, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -1681444) << "incorrect value for last_msg_.e, expected -1681444, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, 814806) << "incorrect value for last_msg_.n, expected 814806, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326829000) << "incorrect value for last_msg_.tow, expected 326829000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNED4, Test) { + uint8_t encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 200, 3, 123, 19, 214, 110, 12, 0, 220, + 87, 230, 255, 165, 126, 0, 0, 0, 0, 0, 0, 15, 0, 190, 80, + }; + + sbp_msg_baseline_ned_t test_msg{}; + test_msg.d = 32421; + test_msg.e = -1681444; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = 814806; + test_msg.n_sats = 15; + test_msg.tow = 326829000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 32421) + << "incorrect value for last_msg_.d, expected 32421, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -1681444) + << "incorrect value for last_msg_.e, expected -1681444, is " + << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, 814806) + << "incorrect value for last_msg_.n, expected 814806, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326829000) + << "incorrect value for last_msg_.tow, expected 326829000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgBaselineNEDDepA.cc b/c/test/cpp/auto_check_sbp_navigation_MsgBaselineNEDDepA.cc index 5d5ad351f..09a39a63d 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgBaselineNEDDepA.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgBaselineNEDDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNEDDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNEDDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNEDDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNEDDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,96 +67,104 @@ class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA0 : sbp_msg_baseline_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,246,215,22,20,46,39,0,243,134,254,255,234,153,255,255,0,0,0,0,0,0,0,0,9,1,93,193, }; - - sbp_msg_baseline_ned_dep_a_t test_msg{}; - test_msg.d = 0; - test_msg.e = -26134; - test_msg.flags = 1; - test_msg.h_accuracy = 0; - test_msg.n = -96525; - test_msg.n_sats = 9; - test_msg.tow = 2567700; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 0) << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -26134) << "incorrect value for last_msg_.e, expected -26134, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -96525) << "incorrect value for last_msg_.n, expected -96525, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567700) << "incorrect value for last_msg_.tow, expected 2567700, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 20, 46, 39, 0, 243, 134, 254, 255, 234, + 153, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 93, 193, + }; + + sbp_msg_baseline_ned_dep_a_t test_msg{}; + test_msg.d = 0; + test_msg.e = -26134; + test_msg.flags = 1; + test_msg.h_accuracy = 0; + test_msg.n = -96525; + test_msg.n_sats = 9; + test_msg.tow = 2567700; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 0) + << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -26134) + << "incorrect value for last_msg_.e, expected -26134, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -96525) + << "incorrect value for last_msg_.n, expected -96525, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567700) + << "incorrect value for last_msg_.tow, expected 2567700, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNEDDepA1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNEDDepA1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -168,96 +172,104 @@ class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA1 : sbp_msg_baseline_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,246,215,22,120,46,39,0,139,134,254,255,109,155,255,255,0,0,0,0,0,0,0,0,9,1,38,39, }; - - sbp_msg_baseline_ned_dep_a_t test_msg{}; - test_msg.d = 0; - test_msg.e = -25747; - test_msg.flags = 1; - test_msg.h_accuracy = 0; - test_msg.n = -96629; - test_msg.n_sats = 9; - test_msg.tow = 2567800; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 0) << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -25747) << "incorrect value for last_msg_.e, expected -25747, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -96629) << "incorrect value for last_msg_.n, expected -96629, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567800) << "incorrect value for last_msg_.tow, expected 2567800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 120, 46, 39, 0, 139, 134, 254, 255, 109, + 155, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 38, 39, + }; + + sbp_msg_baseline_ned_dep_a_t test_msg{}; + test_msg.d = 0; + test_msg.e = -25747; + test_msg.flags = 1; + test_msg.h_accuracy = 0; + test_msg.n = -96629; + test_msg.n_sats = 9; + test_msg.tow = 2567800; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 0) + << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -25747) + << "incorrect value for last_msg_.e, expected -25747, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -96629) + << "incorrect value for last_msg_.n, expected -96629, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567800) + << "incorrect value for last_msg_.tow, expected 2567800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNEDDepA2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNEDDepA2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -265,96 +277,104 @@ class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA2 : sbp_msg_baseline_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,246,215,22,220,46,39,0,37,134,254,255,240,156,255,255,0,0,0,0,0,0,0,0,9,1,58,133, }; - - sbp_msg_baseline_ned_dep_a_t test_msg{}; - test_msg.d = 0; - test_msg.e = -25360; - test_msg.flags = 1; - test_msg.h_accuracy = 0; - test_msg.n = -96731; - test_msg.n_sats = 9; - test_msg.tow = 2567900; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 0) << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -25360) << "incorrect value for last_msg_.e, expected -25360, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -96731) << "incorrect value for last_msg_.n, expected -96731, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567900) << "incorrect value for last_msg_.tow, expected 2567900, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 220, 46, 39, 0, 37, 134, 254, 255, 240, + 156, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 58, 133, + }; + + sbp_msg_baseline_ned_dep_a_t test_msg{}; + test_msg.d = 0; + test_msg.e = -25360; + test_msg.flags = 1; + test_msg.h_accuracy = 0; + test_msg.n = -96731; + test_msg.n_sats = 9; + test_msg.tow = 2567900; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 0) + << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -25360) + << "incorrect value for last_msg_.e, expected -25360, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -96731) + << "incorrect value for last_msg_.n, expected -96731, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567900) + << "incorrect value for last_msg_.tow, expected 2567900, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNEDDepA3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNEDDepA3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -362,96 +382,104 @@ class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA3 : sbp_msg_baseline_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,246,215,22,64,47,39,0,193,133,254,255,115,158,255,255,0,0,0,0,0,0,0,0,9,1,56,214, }; - - sbp_msg_baseline_ned_dep_a_t test_msg{}; - test_msg.d = 0; - test_msg.e = -24973; - test_msg.flags = 1; - test_msg.h_accuracy = 0; - test_msg.n = -96831; - test_msg.n_sats = 9; - test_msg.tow = 2568000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 0) << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -24973) << "incorrect value for last_msg_.e, expected -24973, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -96831) << "incorrect value for last_msg_.n, expected -96831, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2568000) << "incorrect value for last_msg_.tow, expected 2568000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 64, 47, 39, 0, 193, 133, 254, 255, 115, + 158, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 56, 214, + }; + + sbp_msg_baseline_ned_dep_a_t test_msg{}; + test_msg.d = 0; + test_msg.e = -24973; + test_msg.flags = 1; + test_msg.h_accuracy = 0; + test_msg.n = -96831; + test_msg.n_sats = 9; + test_msg.tow = 2568000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 0) + << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -24973) + << "incorrect value for last_msg_.e, expected -24973, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -96831) + << "incorrect value for last_msg_.n, expected -96831, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2568000) + << "incorrect value for last_msg_.tow, expected 2568000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNEDDepA4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNEDDepA4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -459,96 +487,104 @@ class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA4 : sbp_msg_baseline_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,246,215,22,164,47,39,0,93,133,254,255,246,159,255,255,0,0,0,0,0,0,0,0,9,1,234,244, }; - - sbp_msg_baseline_ned_dep_a_t test_msg{}; - test_msg.d = 0; - test_msg.e = -24586; - test_msg.flags = 1; - test_msg.h_accuracy = 0; - test_msg.n = -96931; - test_msg.n_sats = 9; - test_msg.tow = 2568100; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 0) << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -24586) << "incorrect value for last_msg_.e, expected -24586, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -96931) << "incorrect value for last_msg_.n, expected -96931, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2568100) << "incorrect value for last_msg_.tow, expected 2568100, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 164, 47, 39, 0, 93, 133, 254, 255, 246, + 159, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 234, 244, + }; + + sbp_msg_baseline_ned_dep_a_t test_msg{}; + test_msg.d = 0; + test_msg.e = -24586; + test_msg.flags = 1; + test_msg.h_accuracy = 0; + test_msg.n = -96931; + test_msg.n_sats = 9; + test_msg.tow = 2568100; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 0) + << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -24586) + << "incorrect value for last_msg_.e, expected -24586, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -96931) + << "incorrect value for last_msg_.n, expected -96931, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2568100) + << "incorrect value for last_msg_.tow, expected 2568100, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNEDDepA5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNEDDepA5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -556,96 +592,104 @@ class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA5 : sbp_msg_baseline_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,195,4,22,156,21,69,24,130,246,255,255,241,4,0,0,35,196,255,255,0,0,0,0,6,0,250,21, }; - - sbp_msg_baseline_ned_dep_a_t test_msg{}; - test_msg.d = -15325; - test_msg.e = 1265; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = -2430; - test_msg.n_sats = 6; - test_msg.tow = 407180700; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -15325) << "incorrect value for last_msg_.d, expected -15325, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 1265) << "incorrect value for last_msg_.e, expected 1265, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -2430) << "incorrect value for last_msg_.n, expected -2430, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 6) << "incorrect value for last_msg_.n_sats, expected 6, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407180700) << "incorrect value for last_msg_.tow, expected 407180700, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 156, 21, 69, 24, 130, 246, 255, 255, 241, + 4, 0, 0, 35, 196, 255, 255, 0, 0, 0, 0, 6, 0, 250, 21, + }; + + sbp_msg_baseline_ned_dep_a_t test_msg{}; + test_msg.d = -15325; + test_msg.e = 1265; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = -2430; + test_msg.n_sats = 6; + test_msg.tow = 407180700; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -15325) + << "incorrect value for last_msg_.d, expected -15325, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 1265) + << "incorrect value for last_msg_.e, expected 1265, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -2430) + << "incorrect value for last_msg_.n, expected -2430, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 6) + << "incorrect value for last_msg_.n_sats, expected 6, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407180700) + << "incorrect value for last_msg_.tow, expected 407180700, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA6 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNEDDepA6() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA6 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNEDDepA6() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -653,96 +697,104 @@ class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA6 : sbp_msg_baseline_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,195,4,22,0,22,69,24,130,246,255,255,241,4,0,0,35,196,255,255,0,0,0,0,6,0,240,133, }; - - sbp_msg_baseline_ned_dep_a_t test_msg{}; - test_msg.d = -15325; - test_msg.e = 1265; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = -2430; - test_msg.n_sats = 6; - test_msg.tow = 407180800; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -15325) << "incorrect value for last_msg_.d, expected -15325, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 1265) << "incorrect value for last_msg_.e, expected 1265, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -2430) << "incorrect value for last_msg_.n, expected -2430, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 6) << "incorrect value for last_msg_.n_sats, expected 6, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407180800) << "incorrect value for last_msg_.tow, expected 407180800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 0, 22, 69, 24, 130, 246, 255, 255, 241, + 4, 0, 0, 35, 196, 255, 255, 0, 0, 0, 0, 6, 0, 240, 133, + }; + + sbp_msg_baseline_ned_dep_a_t test_msg{}; + test_msg.d = -15325; + test_msg.e = 1265; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = -2430; + test_msg.n_sats = 6; + test_msg.tow = 407180800; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -15325) + << "incorrect value for last_msg_.d, expected -15325, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 1265) + << "incorrect value for last_msg_.e, expected 1265, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -2430) + << "incorrect value for last_msg_.n, expected -2430, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 6) + << "incorrect value for last_msg_.n_sats, expected 6, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407180800) + << "incorrect value for last_msg_.tow, expected 407180800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA7 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNEDDepA7() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA7 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNEDDepA7() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -750,96 +802,104 @@ class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA7 : sbp_msg_baseline_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,195,4,22,100,22,69,24,32,251,255,255,199,11,0,0,57,161,255,255,0,0,0,0,6,0,12,181, }; - - sbp_msg_baseline_ned_dep_a_t test_msg{}; - test_msg.d = -24263; - test_msg.e = 3015; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = -1248; - test_msg.n_sats = 6; - test_msg.tow = 407180900; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -24263) << "incorrect value for last_msg_.d, expected -24263, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 3015) << "incorrect value for last_msg_.e, expected 3015, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -1248) << "incorrect value for last_msg_.n, expected -1248, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 6) << "incorrect value for last_msg_.n_sats, expected 6, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407180900) << "incorrect value for last_msg_.tow, expected 407180900, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 100, 22, 69, 24, 32, 251, 255, 255, 199, + 11, 0, 0, 57, 161, 255, 255, 0, 0, 0, 0, 6, 0, 12, 181, + }; + + sbp_msg_baseline_ned_dep_a_t test_msg{}; + test_msg.d = -24263; + test_msg.e = 3015; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = -1248; + test_msg.n_sats = 6; + test_msg.tow = 407180900; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -24263) + << "incorrect value for last_msg_.d, expected -24263, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 3015) + << "incorrect value for last_msg_.e, expected 3015, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -1248) + << "incorrect value for last_msg_.n, expected -1248, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 6) + << "incorrect value for last_msg_.n_sats, expected 6, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407180900) + << "incorrect value for last_msg_.tow, expected 407180900, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA8 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNEDDepA8() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA8 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNEDDepA8() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -847,96 +907,104 @@ class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA8 : sbp_msg_baseline_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,195,4,22,200,22,69,24,33,251,255,255,199,11,0,0,54,161,255,255,0,0,0,0,6,0,86,58, }; - - sbp_msg_baseline_ned_dep_a_t test_msg{}; - test_msg.d = -24266; - test_msg.e = 3015; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = -1247; - test_msg.n_sats = 6; - test_msg.tow = 407181000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -24266) << "incorrect value for last_msg_.d, expected -24266, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 3015) << "incorrect value for last_msg_.e, expected 3015, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -1247) << "incorrect value for last_msg_.n, expected -1247, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 6) << "incorrect value for last_msg_.n_sats, expected 6, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407181000) << "incorrect value for last_msg_.tow, expected 407181000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 200, 22, 69, 24, 33, 251, 255, 255, 199, + 11, 0, 0, 54, 161, 255, 255, 0, 0, 0, 0, 6, 0, 86, 58, + }; + + sbp_msg_baseline_ned_dep_a_t test_msg{}; + test_msg.d = -24266; + test_msg.e = 3015; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = -1247; + test_msg.n_sats = 6; + test_msg.tow = 407181000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -24266) + << "incorrect value for last_msg_.d, expected -24266, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 3015) + << "incorrect value for last_msg_.e, expected 3015, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -1247) + << "incorrect value for last_msg_.n, expected -1247, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 6) + << "incorrect value for last_msg_.n_sats, expected 6, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407181000) + << "incorrect value for last_msg_.tow, expected 407181000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA9 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNEDDepA9() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA9 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNEDDepA9() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -944,96 +1012,104 @@ class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA9 : sbp_msg_baseline_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA9, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,195,4,22,44,23,69,24,110,6,0,0,55,8,0,0,160,166,255,255,0,0,0,0,6,0,51,249, }; - - sbp_msg_baseline_ned_dep_a_t test_msg{}; - test_msg.d = -22880; - test_msg.e = 2103; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = 1646; - test_msg.n_sats = 6; - test_msg.tow = 407181100; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -22880) << "incorrect value for last_msg_.d, expected -22880, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 2103) << "incorrect value for last_msg_.e, expected 2103, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, 1646) << "incorrect value for last_msg_.n, expected 1646, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 6) << "incorrect value for last_msg_.n_sats, expected 6, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407181100) << "incorrect value for last_msg_.tow, expected 407181100, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA9, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 44, 23, 69, 24, 110, 6, 0, 0, 55, + 8, 0, 0, 160, 166, 255, 255, 0, 0, 0, 0, 6, 0, 51, 249, + }; + + sbp_msg_baseline_ned_dep_a_t test_msg{}; + test_msg.d = -22880; + test_msg.e = 2103; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = 1646; + test_msg.n_sats = 6; + test_msg.tow = 407181100; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -22880) + << "incorrect value for last_msg_.d, expected -22880, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 2103) + << "incorrect value for last_msg_.e, expected 2103, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, 1646) + << "incorrect value for last_msg_.n, expected 1646, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 6) + << "incorrect value for last_msg_.n_sats, expected 6, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407181100) + << "incorrect value for last_msg_.tow, expected 407181100, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA10 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgBaselineNEDDepA10() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA10 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgBaselineNEDDepA10() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -1041,46 +1117,60 @@ class Test_auto_check_sbp_navigation_MsgBaselineNEDDepA10 : sbp_msg_baseline_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA10, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,195,4,22,144,23,69,24,110,6,0,0,54,8,0,0,160,166,255,255,0,0,0,0,6,0,206,22, }; - - sbp_msg_baseline_ned_dep_a_t test_msg{}; - test_msg.d = -22880; - test_msg.e = 2102; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = 1646; - test_msg.n_sats = 6; - test_msg.tow = 407181200; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -22880) << "incorrect value for last_msg_.d, expected -22880, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 2102) << "incorrect value for last_msg_.e, expected 2102, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, 1646) << "incorrect value for last_msg_.n, expected 1646, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 6) << "incorrect value for last_msg_.n_sats, expected 6, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407181200) << "incorrect value for last_msg_.tow, expected 407181200, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgBaselineNEDDepA10, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 144, 23, 69, 24, 110, 6, 0, 0, 54, + 8, 0, 0, 160, 166, 255, 255, 0, 0, 0, 0, 6, 0, 206, 22, + }; + + sbp_msg_baseline_ned_dep_a_t test_msg{}; + test_msg.d = -22880; + test_msg.e = 2102; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = 1646; + test_msg.n_sats = 6; + test_msg.tow = 407181200; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -22880) + << "incorrect value for last_msg_.d, expected -22880, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 2102) + << "incorrect value for last_msg_.e, expected 2102, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, 1646) + << "incorrect value for last_msg_.n, expected 1646, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 6) + << "incorrect value for last_msg_.n_sats, expected 6, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407181200) + << "incorrect value for last_msg_.tow, expected 407181200, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgDops.cc b/c/test/cpp/auto_check_sbp_navigation_MsgDops.cc index 8e98687b0..461053d52 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgDops.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgDops.cc @@ -10,60 +10,55 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDops.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDops.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgDops0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgDops0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgDops0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgDops0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_dops_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, const sbp_msg_dops_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,44 +66,59 @@ class Test_auto_check_sbp_navigation_MsgDops0 : sbp_msg_dops_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgDops0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgDops0, Test) { + uint8_t encoded_frame[] = { + 85, 8, 2, 66, 0, 15, 100, 0, 0, 0, 2, 0, + 6, 0, 5, 0, 5, 0, 5, 0, 0, 244, 4, + }; - uint8_t encoded_frame[] = {85,8,2,66,0,15,100,0,0,0,2,0,6,0,5,0,5,0,5,0,0,244,4, }; + sbp_msg_dops_t test_msg{}; + test_msg.flags = 0; + test_msg.gdop = 2; + test_msg.hdop = 5; + test_msg.pdop = 6; + test_msg.tdop = 5; + test_msg.tow = 100; + test_msg.vdop = 5; - sbp_msg_dops_t test_msg{}; - test_msg.flags = 0; - test_msg.gdop = 2; - test_msg.hdop = 5; - test_msg.pdop = 6; - test_msg.tdop = 5; - test_msg.tow = 100; - test_msg.vdop = 5; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.gdop, 2) << "incorrect value for last_msg_.gdop, expected 2, is " << last_msg_.gdop; - EXPECT_EQ(last_msg_.hdop, 5) << "incorrect value for last_msg_.hdop, expected 5, is " << last_msg_.hdop; - EXPECT_EQ(last_msg_.pdop, 6) << "incorrect value for last_msg_.pdop, expected 6, is " << last_msg_.pdop; - EXPECT_EQ(last_msg_.tdop, 5) << "incorrect value for last_msg_.tdop, expected 5, is " << last_msg_.tdop; - EXPECT_EQ(last_msg_.tow, 100) << "incorrect value for last_msg_.tow, expected 100, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.vdop, 5) << "incorrect value for last_msg_.vdop, expected 5, is " << last_msg_.vdop; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.gdop, 2) + << "incorrect value for last_msg_.gdop, expected 2, is " + << last_msg_.gdop; + EXPECT_EQ(last_msg_.hdop, 5) + << "incorrect value for last_msg_.hdop, expected 5, is " + << last_msg_.hdop; + EXPECT_EQ(last_msg_.pdop, 6) + << "incorrect value for last_msg_.pdop, expected 6, is " + << last_msg_.pdop; + EXPECT_EQ(last_msg_.tdop, 5) + << "incorrect value for last_msg_.tdop, expected 5, is " + << last_msg_.tdop; + EXPECT_EQ(last_msg_.tow, 100) + << "incorrect value for last_msg_.tow, expected 100, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.vdop, 5) + << "incorrect value for last_msg_.vdop, expected 5, is " + << last_msg_.vdop; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgDopsDepA.cc b/c/test/cpp/auto_check_sbp_navigation_MsgDopsDepA.cc index b20067d59..ee747da7a 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgDopsDepA.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgDopsDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDopsDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDopsDepA.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgDopsDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgDopsDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgDopsDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgDopsDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_dops_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,92 +67,99 @@ class Test_auto_check_sbp_navigation_MsgDopsDepA0 : sbp_msg_dops_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,246,215,14,8,48,39,0,180,0,190,0,170,0,160,0,150,0,121,170, }; - - sbp_msg_dops_dep_a_t test_msg{}; - test_msg.gdop = 180; - test_msg.hdop = 160; - test_msg.pdop = 190; - test_msg.tdop = 170; - test_msg.tow = 2568200; - test_msg.vdop = 150; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.gdop, 180) << "incorrect value for last_msg_.gdop, expected 180, is " << last_msg_.gdop; - EXPECT_EQ(last_msg_.hdop, 160) << "incorrect value for last_msg_.hdop, expected 160, is " << last_msg_.hdop; - EXPECT_EQ(last_msg_.pdop, 190) << "incorrect value for last_msg_.pdop, expected 190, is " << last_msg_.pdop; - EXPECT_EQ(last_msg_.tdop, 170) << "incorrect value for last_msg_.tdop, expected 170, is " << last_msg_.tdop; - EXPECT_EQ(last_msg_.tow, 2568200) << "incorrect value for last_msg_.tow, expected 2568200, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.vdop, 150) << "incorrect value for last_msg_.vdop, expected 150, is " << last_msg_.vdop; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 246, 215, 14, 8, 48, 39, 0, 180, + 0, 190, 0, 170, 0, 160, 0, 150, 0, 121, 170, + }; + + sbp_msg_dops_dep_a_t test_msg{}; + test_msg.gdop = 180; + test_msg.hdop = 160; + test_msg.pdop = 190; + test_msg.tdop = 170; + test_msg.tow = 2568200; + test_msg.vdop = 150; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.gdop, 180) + << "incorrect value for last_msg_.gdop, expected 180, is " + << last_msg_.gdop; + EXPECT_EQ(last_msg_.hdop, 160) + << "incorrect value for last_msg_.hdop, expected 160, is " + << last_msg_.hdop; + EXPECT_EQ(last_msg_.pdop, 190) + << "incorrect value for last_msg_.pdop, expected 190, is " + << last_msg_.pdop; + EXPECT_EQ(last_msg_.tdop, 170) + << "incorrect value for last_msg_.tdop, expected 170, is " + << last_msg_.tdop; + EXPECT_EQ(last_msg_.tow, 2568200) + << "incorrect value for last_msg_.tow, expected 2568200, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.vdop, 150) + << "incorrect value for last_msg_.vdop, expected 150, is " + << last_msg_.vdop; } -class Test_auto_check_sbp_navigation_MsgDopsDepA1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgDopsDepA1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgDopsDepA1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgDopsDepA1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_dops_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -164,92 +167,99 @@ class Test_auto_check_sbp_navigation_MsgDopsDepA1 : sbp_msg_dops_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,246,215,14,240,51,39,0,180,0,190,0,170,0,160,0,150,0,78,169, }; - - sbp_msg_dops_dep_a_t test_msg{}; - test_msg.gdop = 180; - test_msg.hdop = 160; - test_msg.pdop = 190; - test_msg.tdop = 170; - test_msg.tow = 2569200; - test_msg.vdop = 150; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.gdop, 180) << "incorrect value for last_msg_.gdop, expected 180, is " << last_msg_.gdop; - EXPECT_EQ(last_msg_.hdop, 160) << "incorrect value for last_msg_.hdop, expected 160, is " << last_msg_.hdop; - EXPECT_EQ(last_msg_.pdop, 190) << "incorrect value for last_msg_.pdop, expected 190, is " << last_msg_.pdop; - EXPECT_EQ(last_msg_.tdop, 170) << "incorrect value for last_msg_.tdop, expected 170, is " << last_msg_.tdop; - EXPECT_EQ(last_msg_.tow, 2569200) << "incorrect value for last_msg_.tow, expected 2569200, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.vdop, 150) << "incorrect value for last_msg_.vdop, expected 150, is " << last_msg_.vdop; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 246, 215, 14, 240, 51, 39, 0, 180, + 0, 190, 0, 170, 0, 160, 0, 150, 0, 78, 169, + }; + + sbp_msg_dops_dep_a_t test_msg{}; + test_msg.gdop = 180; + test_msg.hdop = 160; + test_msg.pdop = 190; + test_msg.tdop = 170; + test_msg.tow = 2569200; + test_msg.vdop = 150; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.gdop, 180) + << "incorrect value for last_msg_.gdop, expected 180, is " + << last_msg_.gdop; + EXPECT_EQ(last_msg_.hdop, 160) + << "incorrect value for last_msg_.hdop, expected 160, is " + << last_msg_.hdop; + EXPECT_EQ(last_msg_.pdop, 190) + << "incorrect value for last_msg_.pdop, expected 190, is " + << last_msg_.pdop; + EXPECT_EQ(last_msg_.tdop, 170) + << "incorrect value for last_msg_.tdop, expected 170, is " + << last_msg_.tdop; + EXPECT_EQ(last_msg_.tow, 2569200) + << "incorrect value for last_msg_.tow, expected 2569200, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.vdop, 150) + << "incorrect value for last_msg_.vdop, expected 150, is " + << last_msg_.vdop; } -class Test_auto_check_sbp_navigation_MsgDopsDepA2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgDopsDepA2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgDopsDepA2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgDopsDepA2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_dops_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -257,92 +267,99 @@ class Test_auto_check_sbp_navigation_MsgDopsDepA2 : sbp_msg_dops_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,246,215,14,216,55,39,0,180,0,190,0,170,0,160,0,150,0,71,218, }; - - sbp_msg_dops_dep_a_t test_msg{}; - test_msg.gdop = 180; - test_msg.hdop = 160; - test_msg.pdop = 190; - test_msg.tdop = 170; - test_msg.tow = 2570200; - test_msg.vdop = 150; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.gdop, 180) << "incorrect value for last_msg_.gdop, expected 180, is " << last_msg_.gdop; - EXPECT_EQ(last_msg_.hdop, 160) << "incorrect value for last_msg_.hdop, expected 160, is " << last_msg_.hdop; - EXPECT_EQ(last_msg_.pdop, 190) << "incorrect value for last_msg_.pdop, expected 190, is " << last_msg_.pdop; - EXPECT_EQ(last_msg_.tdop, 170) << "incorrect value for last_msg_.tdop, expected 170, is " << last_msg_.tdop; - EXPECT_EQ(last_msg_.tow, 2570200) << "incorrect value for last_msg_.tow, expected 2570200, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.vdop, 150) << "incorrect value for last_msg_.vdop, expected 150, is " << last_msg_.vdop; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 246, 215, 14, 216, 55, 39, 0, 180, + 0, 190, 0, 170, 0, 160, 0, 150, 0, 71, 218, + }; + + sbp_msg_dops_dep_a_t test_msg{}; + test_msg.gdop = 180; + test_msg.hdop = 160; + test_msg.pdop = 190; + test_msg.tdop = 170; + test_msg.tow = 2570200; + test_msg.vdop = 150; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.gdop, 180) + << "incorrect value for last_msg_.gdop, expected 180, is " + << last_msg_.gdop; + EXPECT_EQ(last_msg_.hdop, 160) + << "incorrect value for last_msg_.hdop, expected 160, is " + << last_msg_.hdop; + EXPECT_EQ(last_msg_.pdop, 190) + << "incorrect value for last_msg_.pdop, expected 190, is " + << last_msg_.pdop; + EXPECT_EQ(last_msg_.tdop, 170) + << "incorrect value for last_msg_.tdop, expected 170, is " + << last_msg_.tdop; + EXPECT_EQ(last_msg_.tow, 2570200) + << "incorrect value for last_msg_.tow, expected 2570200, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.vdop, 150) + << "incorrect value for last_msg_.vdop, expected 150, is " + << last_msg_.vdop; } -class Test_auto_check_sbp_navigation_MsgDopsDepA3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgDopsDepA3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgDopsDepA3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgDopsDepA3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_dops_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -350,92 +367,99 @@ class Test_auto_check_sbp_navigation_MsgDopsDepA3 : sbp_msg_dops_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,195,4,14,212,157,67,24,247,0,215,0,123,0,17,1,44,0,206,21, }; - - sbp_msg_dops_dep_a_t test_msg{}; - test_msg.gdop = 247; - test_msg.hdop = 273; - test_msg.pdop = 215; - test_msg.tdop = 123; - test_msg.tow = 407084500; - test_msg.vdop = 44; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.gdop, 247) << "incorrect value for last_msg_.gdop, expected 247, is " << last_msg_.gdop; - EXPECT_EQ(last_msg_.hdop, 273) << "incorrect value for last_msg_.hdop, expected 273, is " << last_msg_.hdop; - EXPECT_EQ(last_msg_.pdop, 215) << "incorrect value for last_msg_.pdop, expected 215, is " << last_msg_.pdop; - EXPECT_EQ(last_msg_.tdop, 123) << "incorrect value for last_msg_.tdop, expected 123, is " << last_msg_.tdop; - EXPECT_EQ(last_msg_.tow, 407084500) << "incorrect value for last_msg_.tow, expected 407084500, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.vdop, 44) << "incorrect value for last_msg_.vdop, expected 44, is " << last_msg_.vdop; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 212, 157, 67, 24, 247, + 0, 215, 0, 123, 0, 17, 1, 44, 0, 206, 21, + }; + + sbp_msg_dops_dep_a_t test_msg{}; + test_msg.gdop = 247; + test_msg.hdop = 273; + test_msg.pdop = 215; + test_msg.tdop = 123; + test_msg.tow = 407084500; + test_msg.vdop = 44; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.gdop, 247) + << "incorrect value for last_msg_.gdop, expected 247, is " + << last_msg_.gdop; + EXPECT_EQ(last_msg_.hdop, 273) + << "incorrect value for last_msg_.hdop, expected 273, is " + << last_msg_.hdop; + EXPECT_EQ(last_msg_.pdop, 215) + << "incorrect value for last_msg_.pdop, expected 215, is " + << last_msg_.pdop; + EXPECT_EQ(last_msg_.tdop, 123) + << "incorrect value for last_msg_.tdop, expected 123, is " + << last_msg_.tdop; + EXPECT_EQ(last_msg_.tow, 407084500) + << "incorrect value for last_msg_.tow, expected 407084500, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.vdop, 44) + << "incorrect value for last_msg_.vdop, expected 44, is " + << last_msg_.vdop; } -class Test_auto_check_sbp_navigation_MsgDopsDepA4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgDopsDepA4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgDopsDepA4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgDopsDepA4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_dops_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -443,92 +467,98 @@ class Test_auto_check_sbp_navigation_MsgDopsDepA4 : sbp_msg_dops_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,195,4,14,0,0,0,0,255,255,255,255,0,0,0,0,0,0,146,12, }; - - sbp_msg_dops_dep_a_t test_msg{}; - test_msg.gdop = 65535; - test_msg.hdop = 0; - test_msg.pdop = 65535; - test_msg.tdop = 0; - test_msg.tow = 0; - test_msg.vdop = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.gdop, 65535) << "incorrect value for last_msg_.gdop, expected 65535, is " << last_msg_.gdop; - EXPECT_EQ(last_msg_.hdop, 0) << "incorrect value for last_msg_.hdop, expected 0, is " << last_msg_.hdop; - EXPECT_EQ(last_msg_.pdop, 65535) << "incorrect value for last_msg_.pdop, expected 65535, is " << last_msg_.pdop; - EXPECT_EQ(last_msg_.tdop, 0) << "incorrect value for last_msg_.tdop, expected 0, is " << last_msg_.tdop; - EXPECT_EQ(last_msg_.tow, 0) << "incorrect value for last_msg_.tow, expected 0, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.vdop, 0) << "incorrect value for last_msg_.vdop, expected 0, is " << last_msg_.vdop; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 0, 0, 0, 0, 255, + 255, 255, 255, 0, 0, 0, 0, 0, 0, 146, 12, + }; + + sbp_msg_dops_dep_a_t test_msg{}; + test_msg.gdop = 65535; + test_msg.hdop = 0; + test_msg.pdop = 65535; + test_msg.tdop = 0; + test_msg.tow = 0; + test_msg.vdop = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.gdop, 65535) + << "incorrect value for last_msg_.gdop, expected 65535, is " + << last_msg_.gdop; + EXPECT_EQ(last_msg_.hdop, 0) + << "incorrect value for last_msg_.hdop, expected 0, is " + << last_msg_.hdop; + EXPECT_EQ(last_msg_.pdop, 65535) + << "incorrect value for last_msg_.pdop, expected 65535, is " + << last_msg_.pdop; + EXPECT_EQ(last_msg_.tdop, 0) + << "incorrect value for last_msg_.tdop, expected 0, is " + << last_msg_.tdop; + EXPECT_EQ(last_msg_.tow, 0) + << "incorrect value for last_msg_.tow, expected 0, is " << last_msg_.tow; + EXPECT_EQ(last_msg_.vdop, 0) + << "incorrect value for last_msg_.vdop, expected 0, is " + << last_msg_.vdop; } -class Test_auto_check_sbp_navigation_MsgDopsDepA5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgDopsDepA5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgDopsDepA5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgDopsDepA5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_dops_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -536,92 +566,99 @@ class Test_auto_check_sbp_navigation_MsgDopsDepA5 : sbp_msg_dops_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,195,4,14,128,165,68,24,92,1,56,1,155,0,125,2,113,0,129,93, }; - - sbp_msg_dops_dep_a_t test_msg{}; - test_msg.gdop = 348; - test_msg.hdop = 637; - test_msg.pdop = 312; - test_msg.tdop = 155; - test_msg.tow = 407152000; - test_msg.vdop = 113; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.gdop, 348) << "incorrect value for last_msg_.gdop, expected 348, is " << last_msg_.gdop; - EXPECT_EQ(last_msg_.hdop, 637) << "incorrect value for last_msg_.hdop, expected 637, is " << last_msg_.hdop; - EXPECT_EQ(last_msg_.pdop, 312) << "incorrect value for last_msg_.pdop, expected 312, is " << last_msg_.pdop; - EXPECT_EQ(last_msg_.tdop, 155) << "incorrect value for last_msg_.tdop, expected 155, is " << last_msg_.tdop; - EXPECT_EQ(last_msg_.tow, 407152000) << "incorrect value for last_msg_.tow, expected 407152000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.vdop, 113) << "incorrect value for last_msg_.vdop, expected 113, is " << last_msg_.vdop; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 128, 165, 68, 24, 92, + 1, 56, 1, 155, 0, 125, 2, 113, 0, 129, 93, + }; + + sbp_msg_dops_dep_a_t test_msg{}; + test_msg.gdop = 348; + test_msg.hdop = 637; + test_msg.pdop = 312; + test_msg.tdop = 155; + test_msg.tow = 407152000; + test_msg.vdop = 113; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.gdop, 348) + << "incorrect value for last_msg_.gdop, expected 348, is " + << last_msg_.gdop; + EXPECT_EQ(last_msg_.hdop, 637) + << "incorrect value for last_msg_.hdop, expected 637, is " + << last_msg_.hdop; + EXPECT_EQ(last_msg_.pdop, 312) + << "incorrect value for last_msg_.pdop, expected 312, is " + << last_msg_.pdop; + EXPECT_EQ(last_msg_.tdop, 155) + << "incorrect value for last_msg_.tdop, expected 155, is " + << last_msg_.tdop; + EXPECT_EQ(last_msg_.tow, 407152000) + << "incorrect value for last_msg_.tow, expected 407152000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.vdop, 113) + << "incorrect value for last_msg_.vdop, expected 113, is " + << last_msg_.vdop; } -class Test_auto_check_sbp_navigation_MsgDopsDepA6 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgDopsDepA6() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgDopsDepA6 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgDopsDepA6() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_dops_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -629,92 +666,99 @@ class Test_auto_check_sbp_navigation_MsgDopsDepA6 : sbp_msg_dops_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,195,4,14,104,169,68,24,92,1,55,1,155,0,125,2,113,0,209,128, }; - - sbp_msg_dops_dep_a_t test_msg{}; - test_msg.gdop = 348; - test_msg.hdop = 637; - test_msg.pdop = 311; - test_msg.tdop = 155; - test_msg.tow = 407153000; - test_msg.vdop = 113; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.gdop, 348) << "incorrect value for last_msg_.gdop, expected 348, is " << last_msg_.gdop; - EXPECT_EQ(last_msg_.hdop, 637) << "incorrect value for last_msg_.hdop, expected 637, is " << last_msg_.hdop; - EXPECT_EQ(last_msg_.pdop, 311) << "incorrect value for last_msg_.pdop, expected 311, is " << last_msg_.pdop; - EXPECT_EQ(last_msg_.tdop, 155) << "incorrect value for last_msg_.tdop, expected 155, is " << last_msg_.tdop; - EXPECT_EQ(last_msg_.tow, 407153000) << "incorrect value for last_msg_.tow, expected 407153000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.vdop, 113) << "incorrect value for last_msg_.vdop, expected 113, is " << last_msg_.vdop; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 104, 169, 68, 24, 92, + 1, 55, 1, 155, 0, 125, 2, 113, 0, 209, 128, + }; + + sbp_msg_dops_dep_a_t test_msg{}; + test_msg.gdop = 348; + test_msg.hdop = 637; + test_msg.pdop = 311; + test_msg.tdop = 155; + test_msg.tow = 407153000; + test_msg.vdop = 113; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.gdop, 348) + << "incorrect value for last_msg_.gdop, expected 348, is " + << last_msg_.gdop; + EXPECT_EQ(last_msg_.hdop, 637) + << "incorrect value for last_msg_.hdop, expected 637, is " + << last_msg_.hdop; + EXPECT_EQ(last_msg_.pdop, 311) + << "incorrect value for last_msg_.pdop, expected 311, is " + << last_msg_.pdop; + EXPECT_EQ(last_msg_.tdop, 155) + << "incorrect value for last_msg_.tdop, expected 155, is " + << last_msg_.tdop; + EXPECT_EQ(last_msg_.tow, 407153000) + << "incorrect value for last_msg_.tow, expected 407153000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.vdop, 113) + << "incorrect value for last_msg_.vdop, expected 113, is " + << last_msg_.vdop; } -class Test_auto_check_sbp_navigation_MsgDopsDepA7 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgDopsDepA7() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgDopsDepA7 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgDopsDepA7() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_dops_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -722,92 +766,99 @@ class Test_auto_check_sbp_navigation_MsgDopsDepA7 : sbp_msg_dops_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,195,4,14,80,173,68,24,92,1,55,1,155,0,125,2,112,0,30,6, }; - - sbp_msg_dops_dep_a_t test_msg{}; - test_msg.gdop = 348; - test_msg.hdop = 637; - test_msg.pdop = 311; - test_msg.tdop = 155; - test_msg.tow = 407154000; - test_msg.vdop = 112; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.gdop, 348) << "incorrect value for last_msg_.gdop, expected 348, is " << last_msg_.gdop; - EXPECT_EQ(last_msg_.hdop, 637) << "incorrect value for last_msg_.hdop, expected 637, is " << last_msg_.hdop; - EXPECT_EQ(last_msg_.pdop, 311) << "incorrect value for last_msg_.pdop, expected 311, is " << last_msg_.pdop; - EXPECT_EQ(last_msg_.tdop, 155) << "incorrect value for last_msg_.tdop, expected 155, is " << last_msg_.tdop; - EXPECT_EQ(last_msg_.tow, 407154000) << "incorrect value for last_msg_.tow, expected 407154000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.vdop, 112) << "incorrect value for last_msg_.vdop, expected 112, is " << last_msg_.vdop; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 80, 173, 68, 24, 92, + 1, 55, 1, 155, 0, 125, 2, 112, 0, 30, 6, + }; + + sbp_msg_dops_dep_a_t test_msg{}; + test_msg.gdop = 348; + test_msg.hdop = 637; + test_msg.pdop = 311; + test_msg.tdop = 155; + test_msg.tow = 407154000; + test_msg.vdop = 112; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.gdop, 348) + << "incorrect value for last_msg_.gdop, expected 348, is " + << last_msg_.gdop; + EXPECT_EQ(last_msg_.hdop, 637) + << "incorrect value for last_msg_.hdop, expected 637, is " + << last_msg_.hdop; + EXPECT_EQ(last_msg_.pdop, 311) + << "incorrect value for last_msg_.pdop, expected 311, is " + << last_msg_.pdop; + EXPECT_EQ(last_msg_.tdop, 155) + << "incorrect value for last_msg_.tdop, expected 155, is " + << last_msg_.tdop; + EXPECT_EQ(last_msg_.tow, 407154000) + << "incorrect value for last_msg_.tow, expected 407154000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.vdop, 112) + << "incorrect value for last_msg_.vdop, expected 112, is " + << last_msg_.vdop; } -class Test_auto_check_sbp_navigation_MsgDopsDepA8 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgDopsDepA8() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgDopsDepA8 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgDopsDepA8() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_dops_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -815,42 +866,55 @@ class Test_auto_check_sbp_navigation_MsgDopsDepA8 : sbp_msg_dops_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,195,4,14,56,177,68,24,92,1,55,1,155,0,125,2,112,0,70,67, }; - - sbp_msg_dops_dep_a_t test_msg{}; - test_msg.gdop = 348; - test_msg.hdop = 637; - test_msg.pdop = 311; - test_msg.tdop = 155; - test_msg.tow = 407155000; - test_msg.vdop = 112; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.gdop, 348) << "incorrect value for last_msg_.gdop, expected 348, is " << last_msg_.gdop; - EXPECT_EQ(last_msg_.hdop, 637) << "incorrect value for last_msg_.hdop, expected 637, is " << last_msg_.hdop; - EXPECT_EQ(last_msg_.pdop, 311) << "incorrect value for last_msg_.pdop, expected 311, is " << last_msg_.pdop; - EXPECT_EQ(last_msg_.tdop, 155) << "incorrect value for last_msg_.tdop, expected 155, is " << last_msg_.tdop; - EXPECT_EQ(last_msg_.tow, 407155000) << "incorrect value for last_msg_.tow, expected 407155000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.vdop, 112) << "incorrect value for last_msg_.vdop, expected 112, is " << last_msg_.vdop; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgDopsDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 56, 177, 68, 24, 92, + 1, 55, 1, 155, 0, 125, 2, 112, 0, 70, 67, + }; + + sbp_msg_dops_dep_a_t test_msg{}; + test_msg.gdop = 348; + test_msg.hdop = 637; + test_msg.pdop = 311; + test_msg.tdop = 155; + test_msg.tow = 407155000; + test_msg.vdop = 112; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.gdop, 348) + << "incorrect value for last_msg_.gdop, expected 348, is " + << last_msg_.gdop; + EXPECT_EQ(last_msg_.hdop, 637) + << "incorrect value for last_msg_.hdop, expected 637, is " + << last_msg_.hdop; + EXPECT_EQ(last_msg_.pdop, 311) + << "incorrect value for last_msg_.pdop, expected 311, is " + << last_msg_.pdop; + EXPECT_EQ(last_msg_.tdop, 155) + << "incorrect value for last_msg_.tdop, expected 155, is " + << last_msg_.tdop; + EXPECT_EQ(last_msg_.tow, 407155000) + << "incorrect value for last_msg_.tow, expected 407155000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.vdop, 112) + << "incorrect value for last_msg_.vdop, expected 112, is " + << last_msg_.vdop; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgGPSTime.cc b/c/test/cpp/auto_check_sbp_navigation_MsgGPSTime.cc index ea9b70511..40f929f23 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgGPSTime.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgGPSTime.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTime.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgGPSTime0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTime0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgGPSTime0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTime0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,88 +67,90 @@ class Test_auto_check_sbp_navigation_MsgGPSTime0 : sbp_msg_gps_time_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTime0, Test) -{ - - uint8_t encoded_frame[] = {85,2,1,211,136,11,128,7,40,244,122,19,244,139,2,0,0,34,152, }; - - sbp_msg_gps_time_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 166900; - test_msg.tow = 326825000; - test_msg.wn = 1920; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 166900) << "incorrect value for last_msg_.ns_residual, expected 166900, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 326825000) << "incorrect value for last_msg_.tow, expected 326825000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1920) << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTime0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 40, 244, + 122, 19, 244, 139, 2, 0, 0, 34, 152, + }; + + sbp_msg_gps_time_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 166900; + test_msg.tow = 326825000; + test_msg.wn = 1920; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 166900) + << "incorrect value for last_msg_.ns_residual, expected 166900, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 326825000) + << "incorrect value for last_msg_.tow, expected 326825000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1920) + << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTime1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTime1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTime1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTime1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -160,88 +158,90 @@ class Test_auto_check_sbp_navigation_MsgGPSTime1 : sbp_msg_gps_time_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTime1, Test) -{ - - uint8_t encoded_frame[] = {85,2,1,211,136,11,128,7,28,246,122,19,126,234,3,0,0,65,3, }; - - sbp_msg_gps_time_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 256638; - test_msg.tow = 326825500; - test_msg.wn = 1920; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 256638) << "incorrect value for last_msg_.ns_residual, expected 256638, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 326825500) << "incorrect value for last_msg_.tow, expected 326825500, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1920) << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTime1, Test) { + uint8_t encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 28, 246, + 122, 19, 126, 234, 3, 0, 0, 65, 3, + }; + + sbp_msg_gps_time_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 256638; + test_msg.tow = 326825500; + test_msg.wn = 1920; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 256638) + << "incorrect value for last_msg_.ns_residual, expected 256638, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 326825500) + << "incorrect value for last_msg_.tow, expected 326825500, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1920) + << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTime2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTime2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTime2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTime2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -249,88 +249,90 @@ class Test_auto_check_sbp_navigation_MsgGPSTime2 : sbp_msg_gps_time_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTime2, Test) -{ - - uint8_t encoded_frame[] = {85,2,1,211,136,11,128,7,16,248,122,19,129,12,4,0,0,12,84, }; - - sbp_msg_gps_time_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 265345; - test_msg.tow = 326826000; - test_msg.wn = 1920; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 265345) << "incorrect value for last_msg_.ns_residual, expected 265345, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 326826000) << "incorrect value for last_msg_.tow, expected 326826000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1920) << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTime2, Test) { + uint8_t encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 16, 248, + 122, 19, 129, 12, 4, 0, 0, 12, 84, + }; + + sbp_msg_gps_time_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 265345; + test_msg.tow = 326826000; + test_msg.wn = 1920; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 265345) + << "incorrect value for last_msg_.ns_residual, expected 265345, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 326826000) + << "incorrect value for last_msg_.tow, expected 326826000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1920) + << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTime3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTime3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTime3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTime3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -338,88 +340,90 @@ class Test_auto_check_sbp_navigation_MsgGPSTime3 : sbp_msg_gps_time_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTime3, Test) -{ - - uint8_t encoded_frame[] = {85,2,1,211,136,11,128,7,4,250,122,19,137,204,4,0,0,50,165, }; - - sbp_msg_gps_time_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 314505; - test_msg.tow = 326826500; - test_msg.wn = 1920; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 314505) << "incorrect value for last_msg_.ns_residual, expected 314505, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 326826500) << "incorrect value for last_msg_.tow, expected 326826500, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1920) << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTime3, Test) { + uint8_t encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 4, 250, + 122, 19, 137, 204, 4, 0, 0, 50, 165, + }; + + sbp_msg_gps_time_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 314505; + test_msg.tow = 326826500; + test_msg.wn = 1920; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 314505) + << "incorrect value for last_msg_.ns_residual, expected 314505, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 326826500) + << "incorrect value for last_msg_.tow, expected 326826500, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1920) + << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTime4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTime4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTime4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTime4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -427,38 +431,46 @@ class Test_auto_check_sbp_navigation_MsgGPSTime4 : sbp_msg_gps_time_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTime4, Test) -{ - - uint8_t encoded_frame[] = {85,2,1,211,136,11,128,7,248,251,122,19,181,137,5,0,0,180,33, }; - - sbp_msg_gps_time_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 362933; - test_msg.tow = 326827000; - test_msg.wn = 1920; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 362933) << "incorrect value for last_msg_.ns_residual, expected 362933, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 326827000) << "incorrect value for last_msg_.tow, expected 326827000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1920) << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTime4, Test) { + uint8_t encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 248, 251, + 122, 19, 181, 137, 5, 0, 0, 180, 33, + }; + + sbp_msg_gps_time_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 362933; + test_msg.tow = 326827000; + test_msg.wn = 1920; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 362933) + << "incorrect value for last_msg_.ns_residual, expected 362933, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 326827000) + << "incorrect value for last_msg_.tow, expected 326827000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1920) + << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgGPSTimeDepA.cc b/c/test/cpp/auto_check_sbp_navigation_MsgGPSTimeDepA.cc index a233e7e83..4b5e38f73 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgGPSTimeDepA.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgGPSTimeDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgGPSTimeDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgGPSTimeDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,88 +67,89 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeDepA0 : sbp_msg_gps_time_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,246,215,11,251,6,120,46,39,0,0,0,0,0,0,133,36, }; - - sbp_msg_gps_time_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 0; - test_msg.tow = 2567800; - test_msg.wn = 1787; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 0) << "incorrect value for last_msg_.ns_residual, expected 0, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 2567800) << "incorrect value for last_msg_.tow, expected 2567800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1787) << "incorrect value for last_msg_.wn, expected 1787, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 120, 46, 39, 0, 0, 0, 0, 0, 0, 133, 36, + }; + + sbp_msg_gps_time_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 0; + test_msg.tow = 2567800; + test_msg.wn = 1787; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 0) + << "incorrect value for last_msg_.ns_residual, expected 0, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 2567800) + << "incorrect value for last_msg_.tow, expected 2567800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1787) + << "incorrect value for last_msg_.wn, expected 1787, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTimeDepA1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeDepA1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTimeDepA1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeDepA1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -160,88 +157,89 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeDepA1 : sbp_msg_gps_time_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,246,215,11,251,6,220,46,39,0,0,0,0,0,0,36,160, }; - - sbp_msg_gps_time_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 0; - test_msg.tow = 2567900; - test_msg.wn = 1787; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 0) << "incorrect value for last_msg_.ns_residual, expected 0, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 2567900) << "incorrect value for last_msg_.tow, expected 2567900, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1787) << "incorrect value for last_msg_.wn, expected 1787, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 220, 46, 39, 0, 0, 0, 0, 0, 0, 36, 160, + }; + + sbp_msg_gps_time_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 0; + test_msg.tow = 2567900; + test_msg.wn = 1787; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 0) + << "incorrect value for last_msg_.ns_residual, expected 0, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 2567900) + << "incorrect value for last_msg_.tow, expected 2567900, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1787) + << "incorrect value for last_msg_.wn, expected 1787, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTimeDepA2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeDepA2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTimeDepA2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeDepA2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -249,88 +247,89 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeDepA2 : sbp_msg_gps_time_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,246,215,11,251,6,64,47,39,0,0,0,0,0,0,171,190, }; - - sbp_msg_gps_time_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 0; - test_msg.tow = 2568000; - test_msg.wn = 1787; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 0) << "incorrect value for last_msg_.ns_residual, expected 0, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 2568000) << "incorrect value for last_msg_.tow, expected 2568000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1787) << "incorrect value for last_msg_.wn, expected 1787, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 64, 47, 39, 0, 0, 0, 0, 0, 0, 171, 190, + }; + + sbp_msg_gps_time_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 0; + test_msg.tow = 2568000; + test_msg.wn = 1787; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 0) + << "incorrect value for last_msg_.ns_residual, expected 0, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 2568000) + << "incorrect value for last_msg_.tow, expected 2568000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1787) + << "incorrect value for last_msg_.wn, expected 1787, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTimeDepA3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeDepA3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTimeDepA3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeDepA3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -338,88 +337,89 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeDepA3 : sbp_msg_gps_time_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,246,215,11,251,6,164,47,39,0,0,0,0,0,0,211,101, }; - - sbp_msg_gps_time_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 0; - test_msg.tow = 2568100; - test_msg.wn = 1787; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 0) << "incorrect value for last_msg_.ns_residual, expected 0, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 2568100) << "incorrect value for last_msg_.tow, expected 2568100, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1787) << "incorrect value for last_msg_.wn, expected 1787, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 164, 47, 39, 0, 0, 0, 0, 0, 0, 211, 101, + }; + + sbp_msg_gps_time_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 0; + test_msg.tow = 2568100; + test_msg.wn = 1787; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 0) + << "incorrect value for last_msg_.ns_residual, expected 0, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 2568100) + << "incorrect value for last_msg_.tow, expected 2568100, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1787) + << "incorrect value for last_msg_.wn, expected 1787, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTimeDepA4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeDepA4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTimeDepA4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeDepA4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -427,88 +427,89 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeDepA4 : sbp_msg_gps_time_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,246,215,11,251,6,8,48,39,0,0,0,0,0,0,251,44, }; - - sbp_msg_gps_time_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 0; - test_msg.tow = 2568200; - test_msg.wn = 1787; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 0) << "incorrect value for last_msg_.ns_residual, expected 0, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 2568200) << "incorrect value for last_msg_.tow, expected 2568200, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1787) << "incorrect value for last_msg_.wn, expected 1787, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 8, 48, 39, 0, 0, 0, 0, 0, 0, 251, 44, + }; + + sbp_msg_gps_time_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 0; + test_msg.tow = 2568200; + test_msg.wn = 1787; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 0) + << "incorrect value for last_msg_.ns_residual, expected 0, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 2568200) + << "incorrect value for last_msg_.tow, expected 2568200, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1787) + << "incorrect value for last_msg_.wn, expected 1787, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTimeDepA5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeDepA5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTimeDepA5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeDepA5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -516,88 +517,90 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeDepA5 : sbp_msg_gps_time_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,195,4,11,46,7,212,157,67,24,111,147,252,255,0,215,190, }; - - sbp_msg_gps_time_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = -224401; - test_msg.tow = 407084500; - test_msg.wn = 1838; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, -224401) << "incorrect value for last_msg_.ns_residual, expected -224401, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 407084500) << "incorrect value for last_msg_.tow, expected 407084500, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1838) << "incorrect value for last_msg_.wn, expected 1838, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 212, 157, + 67, 24, 111, 147, 252, 255, 0, 215, 190, + }; + + sbp_msg_gps_time_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = -224401; + test_msg.tow = 407084500; + test_msg.wn = 1838; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, -224401) + << "incorrect value for last_msg_.ns_residual, expected -224401, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 407084500) + << "incorrect value for last_msg_.tow, expected 407084500, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1838) + << "incorrect value for last_msg_.wn, expected 1838, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTimeDepA6 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeDepA6() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTimeDepA6 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeDepA6() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -605,88 +608,89 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeDepA6 : sbp_msg_gps_time_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,195,4,11,46,7,56,158,67,24,109,103,3,0,0,134,89, }; - - sbp_msg_gps_time_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 223085; - test_msg.tow = 407084600; - test_msg.wn = 1838; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 223085) << "incorrect value for last_msg_.ns_residual, expected 223085, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 407084600) << "incorrect value for last_msg_.tow, expected 407084600, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1838) << "incorrect value for last_msg_.wn, expected 1838, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 56, 158, 67, 24, 109, 103, 3, 0, 0, 134, 89, + }; + + sbp_msg_gps_time_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 223085; + test_msg.tow = 407084600; + test_msg.wn = 1838; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 223085) + << "incorrect value for last_msg_.ns_residual, expected 223085, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 407084600) + << "incorrect value for last_msg_.tow, expected 407084600, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1838) + << "incorrect value for last_msg_.wn, expected 1838, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTimeDepA7 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeDepA7() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTimeDepA7 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeDepA7() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -694,88 +698,90 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeDepA7 : sbp_msg_gps_time_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,195,4,11,46,7,156,158,67,24,233,152,252,255,0,206,241, }; - - sbp_msg_gps_time_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = -222999; - test_msg.tow = 407084700; - test_msg.wn = 1838; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, -222999) << "incorrect value for last_msg_.ns_residual, expected -222999, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 407084700) << "incorrect value for last_msg_.tow, expected 407084700, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1838) << "incorrect value for last_msg_.wn, expected 1838, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 156, 158, + 67, 24, 233, 152, 252, 255, 0, 206, 241, + }; + + sbp_msg_gps_time_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = -222999; + test_msg.tow = 407084700; + test_msg.wn = 1838; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, -222999) + << "incorrect value for last_msg_.ns_residual, expected -222999, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 407084700) + << "incorrect value for last_msg_.tow, expected 407084700, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1838) + << "incorrect value for last_msg_.wn, expected 1838, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTimeDepA8 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeDepA8() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTimeDepA8 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeDepA8() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -783,88 +789,89 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeDepA8 : sbp_msg_gps_time_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,195,4,11,46,7,0,159,67,24,240,154,3,0,0,147,98, }; - - sbp_msg_gps_time_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 236272; - test_msg.tow = 407084800; - test_msg.wn = 1838; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 236272) << "incorrect value for last_msg_.ns_residual, expected 236272, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 407084800) << "incorrect value for last_msg_.tow, expected 407084800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1838) << "incorrect value for last_msg_.wn, expected 1838, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 0, 159, 67, 24, 240, 154, 3, 0, 0, 147, 98, + }; + + sbp_msg_gps_time_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 236272; + test_msg.tow = 407084800; + test_msg.wn = 1838; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 236272) + << "incorrect value for last_msg_.ns_residual, expected 236272, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 407084800) + << "incorrect value for last_msg_.tow, expected 407084800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1838) + << "incorrect value for last_msg_.wn, expected 1838, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTimeDepA9 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeDepA9() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTimeDepA9 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeDepA9() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -872,88 +879,90 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeDepA9 : sbp_msg_gps_time_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA9, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,195,4,11,46,7,100,159,67,24,144,101,252,255,0,186,152, }; - - sbp_msg_gps_time_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = -236144; - test_msg.tow = 407084900; - test_msg.wn = 1838; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, -236144) << "incorrect value for last_msg_.ns_residual, expected -236144, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 407084900) << "incorrect value for last_msg_.tow, expected 407084900, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1838) << "incorrect value for last_msg_.wn, expected 1838, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA9, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 100, 159, + 67, 24, 144, 101, 252, 255, 0, 186, 152, + }; + + sbp_msg_gps_time_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = -236144; + test_msg.tow = 407084900; + test_msg.wn = 1838; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, -236144) + << "incorrect value for last_msg_.ns_residual, expected -236144, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 407084900) + << "incorrect value for last_msg_.tow, expected 407084900, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1838) + << "incorrect value for last_msg_.wn, expected 1838, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTimeDepA10 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeDepA10() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTimeDepA10 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeDepA10() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -961,38 +970,46 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeDepA10 : sbp_msg_gps_time_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA10, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,195,4,11,46,7,46,162,68,24,205,230,250,255,0,11,225, }; - - sbp_msg_gps_time_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = -334131; - test_msg.tow = 407151150; - test_msg.wn = 1838; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, -334131) << "incorrect value for last_msg_.ns_residual, expected -334131, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 407151150) << "incorrect value for last_msg_.tow, expected 407151150, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1838) << "incorrect value for last_msg_.wn, expected 1838, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeDepA10, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 46, 162, + 68, 24, 205, 230, 250, 255, 0, 11, 225, + }; + + sbp_msg_gps_time_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = -334131; + test_msg.tow = 407151150; + test_msg.wn = 1838; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, -334131) + << "incorrect value for last_msg_.ns_residual, expected -334131, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 407151150) + << "incorrect value for last_msg_.tow, expected 407151150, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1838) + << "incorrect value for last_msg_.wn, expected 1838, is " << last_msg_.wn; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgGPSTimeGNSS.cc b/c/test/cpp/auto_check_sbp_navigation_MsgGPSTimeGNSS.cc index c7acf866d..317316452 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgGPSTimeGNSS.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgGPSTimeGNSS.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeGNSS.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgGPSTimeGNSS0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeGNSS0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgGPSTimeGNSS0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeGNSS0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_gnss_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,88 +67,90 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeGNSS0 : sbp_msg_gps_time_gnss_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeGNSS0, Test) -{ - - uint8_t encoded_frame[] = {85,4,1,211,136,11,128,7,40,244,122,19,244,139,2,0,0,153,88, }; - - sbp_msg_gps_time_gnss_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 166900; - test_msg.tow = 326825000; - test_msg.wn = 1920; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 166900) << "incorrect value for last_msg_.ns_residual, expected 166900, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 326825000) << "incorrect value for last_msg_.tow, expected 326825000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1920) << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeGNSS0, Test) { + uint8_t encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 40, 244, + 122, 19, 244, 139, 2, 0, 0, 153, 88, + }; + + sbp_msg_gps_time_gnss_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 166900; + test_msg.tow = 326825000; + test_msg.wn = 1920; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 166900) + << "incorrect value for last_msg_.ns_residual, expected 166900, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 326825000) + << "incorrect value for last_msg_.tow, expected 326825000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1920) + << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTimeGNSS1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeGNSS1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTimeGNSS1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeGNSS1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_gnss_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -160,88 +158,90 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeGNSS1 : sbp_msg_gps_time_gnss_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeGNSS1, Test) -{ - - uint8_t encoded_frame[] = {85,4,1,211,136,11,128,7,28,246,122,19,126,234,3,0,0,250,195, }; - - sbp_msg_gps_time_gnss_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 256638; - test_msg.tow = 326825500; - test_msg.wn = 1920; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 256638) << "incorrect value for last_msg_.ns_residual, expected 256638, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 326825500) << "incorrect value for last_msg_.tow, expected 326825500, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1920) << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeGNSS1, Test) { + uint8_t encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 28, 246, + 122, 19, 126, 234, 3, 0, 0, 250, 195, + }; + + sbp_msg_gps_time_gnss_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 256638; + test_msg.tow = 326825500; + test_msg.wn = 1920; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 256638) + << "incorrect value for last_msg_.ns_residual, expected 256638, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 326825500) + << "incorrect value for last_msg_.tow, expected 326825500, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1920) + << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTimeGNSS2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeGNSS2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTimeGNSS2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeGNSS2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_gnss_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -249,88 +249,90 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeGNSS2 : sbp_msg_gps_time_gnss_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeGNSS2, Test) -{ - - uint8_t encoded_frame[] = {85,4,1,211,136,11,128,7,16,248,122,19,129,12,4,0,0,183,148, }; - - sbp_msg_gps_time_gnss_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 265345; - test_msg.tow = 326826000; - test_msg.wn = 1920; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 265345) << "incorrect value for last_msg_.ns_residual, expected 265345, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 326826000) << "incorrect value for last_msg_.tow, expected 326826000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1920) << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeGNSS2, Test) { + uint8_t encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 16, 248, + 122, 19, 129, 12, 4, 0, 0, 183, 148, + }; + + sbp_msg_gps_time_gnss_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 265345; + test_msg.tow = 326826000; + test_msg.wn = 1920; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 265345) + << "incorrect value for last_msg_.ns_residual, expected 265345, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 326826000) + << "incorrect value for last_msg_.tow, expected 326826000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1920) + << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTimeGNSS3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeGNSS3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTimeGNSS3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeGNSS3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_gnss_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -338,88 +340,90 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeGNSS3 : sbp_msg_gps_time_gnss_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeGNSS3, Test) -{ - - uint8_t encoded_frame[] = {85,4,1,211,136,11,128,7,4,250,122,19,137,204,4,0,0,137,101, }; - - sbp_msg_gps_time_gnss_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 314505; - test_msg.tow = 326826500; - test_msg.wn = 1920; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 314505) << "incorrect value for last_msg_.ns_residual, expected 314505, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 326826500) << "incorrect value for last_msg_.tow, expected 326826500, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1920) << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeGNSS3, Test) { + uint8_t encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 4, 250, + 122, 19, 137, 204, 4, 0, 0, 137, 101, + }; + + sbp_msg_gps_time_gnss_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 314505; + test_msg.tow = 326826500; + test_msg.wn = 1920; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 314505) + << "incorrect value for last_msg_.ns_residual, expected 314505, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 326826500) + << "incorrect value for last_msg_.tow, expected 326826500, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1920) + << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; } -class Test_auto_check_sbp_navigation_MsgGPSTimeGNSS4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgGPSTimeGNSS4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgGPSTimeGNSS4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgGPSTimeGNSS4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gps_time_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gps_time_gnss_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -427,38 +431,46 @@ class Test_auto_check_sbp_navigation_MsgGPSTimeGNSS4 : sbp_msg_gps_time_gnss_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeGNSS4, Test) -{ - - uint8_t encoded_frame[] = {85,4,1,211,136,11,128,7,248,251,122,19,181,137,5,0,0,15,225, }; - - sbp_msg_gps_time_gnss_t test_msg{}; - test_msg.flags = 0; - test_msg.ns_residual = 362933; - test_msg.tow = 326827000; - test_msg.wn = 1920; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.ns_residual, 362933) << "incorrect value for last_msg_.ns_residual, expected 362933, is " << last_msg_.ns_residual; - EXPECT_EQ(last_msg_.tow, 326827000) << "incorrect value for last_msg_.tow, expected 326827000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 1920) << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgGPSTimeGNSS4, Test) { + uint8_t encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 248, 251, + 122, 19, 181, 137, 5, 0, 0, 15, 225, + }; + + sbp_msg_gps_time_gnss_t test_msg{}; + test_msg.flags = 0; + test_msg.ns_residual = 362933; + test_msg.tow = 326827000; + test_msg.wn = 1920; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.ns_residual, 362933) + << "incorrect value for last_msg_.ns_residual, expected 362933, is " + << last_msg_.ns_residual; + EXPECT_EQ(last_msg_.tow, 326827000) + << "incorrect value for last_msg_.tow, expected 326827000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 1920) + << "incorrect value for last_msg_.wn, expected 1920, is " << last_msg_.wn; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgPosECEF.cc b/c/test/cpp/auto_check_sbp_navigation_MsgPosECEF.cc index aa592c71b..6fa02cf9d 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgPosECEF.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgPosECEF.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEF.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgPosECEF0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEF0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgPosECEF0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEF0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,94 +67,104 @@ class Test_auto_check_sbp_navigation_MsgPosECEF0 : sbp_msg_pos_ecef_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEF0, Test) -{ - - uint8_t encoded_frame[] = {85,9,2,211,136,32,16,248,122,19,73,29,46,132,182,122,68,193,219,192,29,176,121,119,80,193,83,11,210,90,79,75,77,65,0,0,15,2,84,6, }; - - sbp_msg_pos_ecef_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 2; - test_msg.n_sats = 15; - test_msg.tow = 326826000; - test_msg.x = -2684269.0326572997; - test_msg.y = -4316646.751816; - test_msg.z = 3839646.7095350414; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 2) << "incorrect value for last_msg_.flags, expected 2, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326826000) << "incorrect value for last_msg_.tow, expected 326826000, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2684269.03266 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2684269.03266, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4316646.75182 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4316646.75182, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3839646.70954 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3839646.70954, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEF0, Test) { + uint8_t encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 16, 248, 122, 19, 73, 29, 46, 132, + 182, 122, 68, 193, 219, 192, 29, 176, 121, 119, 80, 193, 83, 11, + 210, 90, 79, 75, 77, 65, 0, 0, 15, 2, 84, 6, + }; + + sbp_msg_pos_ecef_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 2; + test_msg.n_sats = 15; + test_msg.tow = 326826000; + test_msg.x = -2684269.0326572997; + test_msg.y = -4316646.751816; + test_msg.z = 3839646.7095350414; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 2) + << "incorrect value for last_msg_.flags, expected 2, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326826000) + << "incorrect value for last_msg_.tow, expected 326826000, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2684269.03266 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2684269.03266, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4316646.75182 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4316646.75182, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3839646.70954 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3839646.70954, is " + << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgPosECEF1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEF1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosECEF1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEF1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -166,94 +172,104 @@ class Test_auto_check_sbp_navigation_MsgPosECEF1 : sbp_msg_pos_ecef_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEF1, Test) -{ - - uint8_t encoded_frame[] = {85,9,2,211,136,32,248,251,122,19,103,106,57,136,182,122,68,193,176,242,200,176,121,119,80,193,244,135,97,59,79,75,77,65,0,0,15,2,147,216, }; - - sbp_msg_pos_ecef_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 2; - test_msg.n_sats = 15; - test_msg.tow = 326827000; - test_msg.x = -2684269.064252186; - test_msg.y = -4316646.762264892; - test_msg.z = 3839646.463913912; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 2) << "incorrect value for last_msg_.flags, expected 2, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326827000) << "incorrect value for last_msg_.tow, expected 326827000, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2684269.06425 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2684269.06425, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4316646.76226 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4316646.76226, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3839646.46391 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3839646.46391, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEF1, Test) { + uint8_t encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 248, 251, 122, 19, 103, 106, 57, 136, + 182, 122, 68, 193, 176, 242, 200, 176, 121, 119, 80, 193, 244, 135, + 97, 59, 79, 75, 77, 65, 0, 0, 15, 2, 147, 216, + }; + + sbp_msg_pos_ecef_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 2; + test_msg.n_sats = 15; + test_msg.tow = 326827000; + test_msg.x = -2684269.064252186; + test_msg.y = -4316646.762264892; + test_msg.z = 3839646.463913912; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 2) + << "incorrect value for last_msg_.flags, expected 2, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326827000) + << "incorrect value for last_msg_.tow, expected 326827000, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2684269.06425 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2684269.06425, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4316646.76226 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4316646.76226, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3839646.46391 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3839646.46391, is " + << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgPosECEF2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEF2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosECEF2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEF2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -261,94 +277,104 @@ class Test_auto_check_sbp_navigation_MsgPosECEF2 : sbp_msg_pos_ecef_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEF2, Test) -{ - - uint8_t encoded_frame[] = {85,9,2,211,136,32,224,255,122,19,101,179,242,182,182,122,68,193,130,196,145,199,121,119,80,193,212,10,253,15,79,75,77,65,0,0,15,2,40,201, }; - - sbp_msg_pos_ecef_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 2; - test_msg.n_sats = 15; - test_msg.tow = 326828000; - test_msg.x = -2684269.4292816394; - test_msg.y = -4316647.118271949; - test_msg.z = 3839646.124909738; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 2) << "incorrect value for last_msg_.flags, expected 2, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326828000) << "incorrect value for last_msg_.tow, expected 326828000, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2684269.42928 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2684269.42928, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4316647.11827 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4316647.11827, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3839646.12491 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3839646.12491, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEF2, Test) { + uint8_t encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 224, 255, 122, 19, 101, 179, 242, 182, + 182, 122, 68, 193, 130, 196, 145, 199, 121, 119, 80, 193, 212, 10, + 253, 15, 79, 75, 77, 65, 0, 0, 15, 2, 40, 201, + }; + + sbp_msg_pos_ecef_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 2; + test_msg.n_sats = 15; + test_msg.tow = 326828000; + test_msg.x = -2684269.4292816394; + test_msg.y = -4316647.118271949; + test_msg.z = 3839646.124909738; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 2) + << "incorrect value for last_msg_.flags, expected 2, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326828000) + << "incorrect value for last_msg_.tow, expected 326828000, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2684269.42928 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2684269.42928, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4316647.11827 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4316647.11827, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3839646.12491 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3839646.12491, is " + << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgPosECEF3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEF3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosECEF3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEF3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -356,44 +382,60 @@ class Test_auto_check_sbp_navigation_MsgPosECEF3 : sbp_msg_pos_ecef_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEF3, Test) -{ - - uint8_t encoded_frame[] = {85,9,2,211,136,32,200,3,123,19,146,214,132,215,182,122,68,193,213,68,49,215,121,119,80,193,71,34,110,243,78,75,77,65,0,0,15,2,187,86, }; - - sbp_msg_pos_ecef_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 2; - test_msg.n_sats = 15; - test_msg.tow = 326829000; - test_msg.x = -2684269.683741399; - test_msg.y = -4316647.3623821335; - test_msg.z = 3839645.90179852; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 2) << "incorrect value for last_msg_.flags, expected 2, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326829000) << "incorrect value for last_msg_.tow, expected 326829000, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2684269.68374 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2684269.68374, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4316647.36238 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4316647.36238, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3839645.9018 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3839645.9018, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEF3, Test) { + uint8_t encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 200, 3, 123, 19, 146, 214, 132, 215, + 182, 122, 68, 193, 213, 68, 49, 215, 121, 119, 80, 193, 71, 34, + 110, 243, 78, 75, 77, 65, 0, 0, 15, 2, 187, 86, + }; + + sbp_msg_pos_ecef_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 2; + test_msg.n_sats = 15; + test_msg.tow = 326829000; + test_msg.x = -2684269.683741399; + test_msg.y = -4316647.3623821335; + test_msg.z = 3839645.90179852; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 2) + << "incorrect value for last_msg_.flags, expected 2, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326829000) + << "incorrect value for last_msg_.tow, expected 326829000, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2684269.68374 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2684269.68374, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4316647.36238 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4316647.36238, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3839645.9018 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3839645.9018, is " + << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFCov.cc b/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFCov.cc index 604419461..684dd2817 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFCov.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFCov.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCov.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCov.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgPosECEFCov0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEFCov0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgPosECEFCov0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEFCov0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_cov_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_cov_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,54 +67,77 @@ class Test_auto_check_sbp_navigation_MsgPosECEFCov0 : sbp_msg_pos_ecef_cov_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFCov0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFCov0, Test) { + uint8_t encoded_frame[] = { + 85, 20, 2, 66, 0, 54, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 24, 64, 0, 0, 0, 0, 0, 0, 240, 63, 0, 0, 0, 0, 0, 0, + 16, 64, 0, 0, 0, 65, 0, 0, 224, 64, 0, 0, 0, 64, 0, 0, + 192, 64, 0, 0, 0, 65, 0, 0, 160, 64, 4, 5, 249, 167, + }; - uint8_t encoded_frame[] = {85,20,2,66,0,54,7,0,0,0,0,0,0,0,0,0,24,64,0,0,0,0,0,0,240,63,0,0,0,0,0,0,16,64,0,0,0,65,0,0,224,64,0,0,0,64,0,0,192,64,0,0,0,65,0,0,160,64,4,5,249,167, }; + sbp_msg_pos_ecef_cov_t test_msg{}; + test_msg.cov_x_x = 8.0; + test_msg.cov_x_y = 7.0; + test_msg.cov_x_z = 2.0; + test_msg.cov_y_y = 6.0; + test_msg.cov_y_z = 8.0; + test_msg.cov_z_z = 5.0; + test_msg.flags = 5; + test_msg.n_sats = 4; + test_msg.tow = 7; + test_msg.x = 6.0; + test_msg.y = 1.0; + test_msg.z = 4.0; - sbp_msg_pos_ecef_cov_t test_msg{}; - test_msg.cov_x_x = 8.0; - test_msg.cov_x_y = 7.0; - test_msg.cov_x_z = 2.0; - test_msg.cov_y_y = 6.0; - test_msg.cov_y_z = 8.0; - test_msg.cov_z_z = 5.0; - test_msg.flags = 5; - test_msg.n_sats = 4; - test_msg.tow = 7; - test_msg.x = 6.0; - test_msg.y = 1.0; - test_msg.z = 4.0; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cov_x_x * 100 - 8.0 * 100), 0.05) << "incorrect value for last_msg_.cov_x_x, expected 8.0, is " << last_msg_.cov_x_x; - EXPECT_LT((last_msg_.cov_x_y * 100 - 7.0 * 100), 0.05) << "incorrect value for last_msg_.cov_x_y, expected 7.0, is " << last_msg_.cov_x_y; - EXPECT_LT((last_msg_.cov_x_z * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.cov_x_z, expected 2.0, is " << last_msg_.cov_x_z; - EXPECT_LT((last_msg_.cov_y_y * 100 - 6.0 * 100), 0.05) << "incorrect value for last_msg_.cov_y_y, expected 6.0, is " << last_msg_.cov_y_y; - EXPECT_LT((last_msg_.cov_y_z * 100 - 8.0 * 100), 0.05) << "incorrect value for last_msg_.cov_y_z, expected 8.0, is " << last_msg_.cov_y_z; - EXPECT_LT((last_msg_.cov_z_z * 100 - 5.0 * 100), 0.05) << "incorrect value for last_msg_.cov_z_z, expected 5.0, is " << last_msg_.cov_z_z; - EXPECT_EQ(last_msg_.flags, 5) << "incorrect value for last_msg_.flags, expected 5, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 4) << "incorrect value for last_msg_.n_sats, expected 4, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 7) << "incorrect value for last_msg_.tow, expected 7, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - 6.0 * 100), 0.05) << "incorrect value for last_msg_.x, expected 6.0, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - 1.0 * 100), 0.05) << "incorrect value for last_msg_.y, expected 1.0, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 4.0 * 100), 0.05) << "incorrect value for last_msg_.z, expected 4.0, is " << last_msg_.z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cov_x_x * 100 - 8.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_x_x, expected 8.0, is " + << last_msg_.cov_x_x; + EXPECT_LT((last_msg_.cov_x_y * 100 - 7.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_x_y, expected 7.0, is " + << last_msg_.cov_x_y; + EXPECT_LT((last_msg_.cov_x_z * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_x_z, expected 2.0, is " + << last_msg_.cov_x_z; + EXPECT_LT((last_msg_.cov_y_y * 100 - 6.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_y_y, expected 6.0, is " + << last_msg_.cov_y_y; + EXPECT_LT((last_msg_.cov_y_z * 100 - 8.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_y_z, expected 8.0, is " + << last_msg_.cov_y_z; + EXPECT_LT((last_msg_.cov_z_z * 100 - 5.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_z_z, expected 5.0, is " + << last_msg_.cov_z_z; + EXPECT_EQ(last_msg_.flags, 5) + << "incorrect value for last_msg_.flags, expected 5, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 4) + << "incorrect value for last_msg_.n_sats, expected 4, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 7) + << "incorrect value for last_msg_.tow, expected 7, is " << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - 6.0 * 100), 0.05) + << "incorrect value for last_msg_.x, expected 6.0, is " << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - 1.0 * 100), 0.05) + << "incorrect value for last_msg_.y, expected 1.0, is " << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 4.0 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 4.0, is " << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFCovGNSS.cc b/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFCovGNSS.cc index 8499fec41..84626db9c 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFCovGNSS.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFCovGNSS.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCovGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCovGNSS.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgPosECEFCovGNSS0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEFCovGNSS0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgPosECEFCovGNSS0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEFCovGNSS0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_cov_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_cov_gnss_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,54 +67,84 @@ class Test_auto_check_sbp_navigation_MsgPosECEFCovGNSS0 : sbp_msg_pos_ecef_cov_gnss_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFCovGNSS0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFCovGNSS0, Test) { + uint8_t encoded_frame[] = { + 85, 52, 2, 0, 16, 54, 24, 229, 233, 29, 52, 254, 158, + 218, 42, 142, 68, 193, 69, 162, 89, 91, 34, 68, 80, 193, + 131, 21, 176, 129, 239, 174, 77, 65, 158, 232, 30, 60, 218, + 221, 20, 60, 129, 136, 198, 187, 205, 120, 166, 60, 5, 166, + 35, 188, 122, 177, 115, 60, 18, 4, 159, 102, + }; - uint8_t encoded_frame[] = {85,52,2,0,16,54,24,229,233,29,52,254,158,218,42,142,68,193,69,162,89,91,34,68,80,193,131,21,176,129,239,174,77,65,158,232,30,60,218,221,20,60,129,136,198,187,205,120,166,60,5,166,35,188,122,177,115,60,18,4,159,102, }; + sbp_msg_pos_ecef_cov_gnss_t test_msg{}; + test_msg.cov_x_x = 0.009699014946818352; + test_msg.cov_x_y = 0.009086096659302711; + test_msg.cov_x_z = -0.006058753002434969; + test_msg.cov_y_y = 0.020321274176239967; + test_msg.cov_y_z = -0.009988312609493732; + test_msg.cov_z_z = 0.01487385667860508; + test_msg.flags = 4; + test_msg.n_sats = 18; + test_msg.tow = 501867800; + test_msg.x = -2694229.7079770807; + test_msg.y = -4264073.427345817; + test_msg.z = 3890655.013186158; - sbp_msg_pos_ecef_cov_gnss_t test_msg{}; - test_msg.cov_x_x = 0.009699014946818352; - test_msg.cov_x_y = 0.009086096659302711; - test_msg.cov_x_z = -0.006058753002434969; - test_msg.cov_y_y = 0.020321274176239967; - test_msg.cov_y_z = -0.009988312609493732; - test_msg.cov_z_z = 0.01487385667860508; - test_msg.flags = 4; - test_msg.n_sats = 18; - test_msg.tow = 501867800; - test_msg.x = -2694229.7079770807; - test_msg.y = -4264073.427345817; - test_msg.z = 3890655.013186158; - - EXPECT_EQ(send_message( 4096, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(4096, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cov_x_x * 100 - 0.00969901494682 * 100), 0.05) << "incorrect value for last_msg_.cov_x_x, expected 0.00969901494682, is " << last_msg_.cov_x_x; - EXPECT_LT((last_msg_.cov_x_y * 100 - 0.0090860966593 * 100), 0.05) << "incorrect value for last_msg_.cov_x_y, expected 0.0090860966593, is " << last_msg_.cov_x_y; - EXPECT_LT((last_msg_.cov_x_z * 100 - -0.00605875300243 * 100), 0.05) << "incorrect value for last_msg_.cov_x_z, expected -0.00605875300243, is " << last_msg_.cov_x_z; - EXPECT_LT((last_msg_.cov_y_y * 100 - 0.0203212741762 * 100), 0.05) << "incorrect value for last_msg_.cov_y_y, expected 0.0203212741762, is " << last_msg_.cov_y_y; - EXPECT_LT((last_msg_.cov_y_z * 100 - -0.00998831260949 * 100), 0.05) << "incorrect value for last_msg_.cov_y_z, expected -0.00998831260949, is " << last_msg_.cov_y_z; - EXPECT_LT((last_msg_.cov_z_z * 100 - 0.0148738566786 * 100), 0.05) << "incorrect value for last_msg_.cov_z_z, expected 0.0148738566786, is " << last_msg_.cov_z_z; - EXPECT_EQ(last_msg_.flags, 4) << "incorrect value for last_msg_.flags, expected 4, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 18) << "incorrect value for last_msg_.n_sats, expected 18, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 501867800) << "incorrect value for last_msg_.tow, expected 501867800, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2694229.70798 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2694229.70798, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4264073.42735 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4264073.42735, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3890655.01319 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3890655.01319, is " << last_msg_.z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cov_x_x * 100 - 0.00969901494682 * 100), 0.05) + << "incorrect value for last_msg_.cov_x_x, expected 0.00969901494682, is " + << last_msg_.cov_x_x; + EXPECT_LT((last_msg_.cov_x_y * 100 - 0.0090860966593 * 100), 0.05) + << "incorrect value for last_msg_.cov_x_y, expected 0.0090860966593, is " + << last_msg_.cov_x_y; + EXPECT_LT((last_msg_.cov_x_z * 100 - -0.00605875300243 * 100), 0.05) + << "incorrect value for last_msg_.cov_x_z, expected -0.00605875300243, " + "is " + << last_msg_.cov_x_z; + EXPECT_LT((last_msg_.cov_y_y * 100 - 0.0203212741762 * 100), 0.05) + << "incorrect value for last_msg_.cov_y_y, expected 0.0203212741762, is " + << last_msg_.cov_y_y; + EXPECT_LT((last_msg_.cov_y_z * 100 - -0.00998831260949 * 100), 0.05) + << "incorrect value for last_msg_.cov_y_z, expected -0.00998831260949, " + "is " + << last_msg_.cov_y_z; + EXPECT_LT((last_msg_.cov_z_z * 100 - 0.0148738566786 * 100), 0.05) + << "incorrect value for last_msg_.cov_z_z, expected 0.0148738566786, is " + << last_msg_.cov_z_z; + EXPECT_EQ(last_msg_.flags, 4) + << "incorrect value for last_msg_.flags, expected 4, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 18) + << "incorrect value for last_msg_.n_sats, expected 18, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 501867800) + << "incorrect value for last_msg_.tow, expected 501867800, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2694229.70798 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2694229.70798, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4264073.42735 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4264073.42735, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3890655.01319 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3890655.01319, is " + << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFDepA.cc b/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFDepA.cc index 4003a303a..3ef6652a7 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFDepA.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgPosECEFDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEFDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgPosECEFDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEFDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,94 +67,104 @@ class Test_auto_check_sbp_navigation_MsgPosECEFDepA0 : sbp_msg_pos_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,246,215,32,20,46,39,0,195,122,175,75,33,154,68,193,164,14,230,176,231,95,80,193,78,220,22,253,254,105,77,65,0,0,9,0,13,86, }; - - sbp_msg_pos_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 9; - test_msg.tow = 2567700; - test_msg.x = -2700354.5912927105; - test_msg.y = -4292510.764041577; - test_msg.z = 3855357.977260149; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567700) << "incorrect value for last_msg_.tow, expected 2567700, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2700354.59129 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2700354.59129, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4292510.76404 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4292510.76404, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3855357.97726 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3855357.97726, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 20, 46, 39, 0, 195, 122, 175, 75, + 33, 154, 68, 193, 164, 14, 230, 176, 231, 95, 80, 193, 78, 220, + 22, 253, 254, 105, 77, 65, 0, 0, 9, 0, 13, 86, + }; + + sbp_msg_pos_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 9; + test_msg.tow = 2567700; + test_msg.x = -2700354.5912927105; + test_msg.y = -4292510.764041577; + test_msg.z = 3855357.977260149; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567700) + << "incorrect value for last_msg_.tow, expected 2567700, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2700354.59129 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2700354.59129, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4292510.76404 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4292510.76404, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3855357.97726 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3855357.97726, is " + << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgPosECEFDepA1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEFDepA1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosECEFDepA1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEFDepA1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -166,94 +172,104 @@ class Test_auto_check_sbp_navigation_MsgPosECEFDepA1 : sbp_msg_pos_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,246,215,32,20,46,39,0,212,196,12,42,34,154,68,193,9,113,112,123,231,95,80,193,54,97,38,192,254,105,77,65,0,0,9,1,75,143, }; - - sbp_msg_pos_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 1; - test_msg.n_sats = 9; - test_msg.tow = 2567700; - test_msg.x = -2700356.3285146747; - test_msg.y = -4292509.928737887; - test_msg.z = 3855357.5011712564; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567700) << "incorrect value for last_msg_.tow, expected 2567700, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2700356.32851 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2700356.32851, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4292509.92874 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4292509.92874, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3855357.50117 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3855357.50117, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 20, 46, 39, 0, 212, 196, 12, 42, + 34, 154, 68, 193, 9, 113, 112, 123, 231, 95, 80, 193, 54, 97, + 38, 192, 254, 105, 77, 65, 0, 0, 9, 1, 75, 143, + }; + + sbp_msg_pos_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 1; + test_msg.n_sats = 9; + test_msg.tow = 2567700; + test_msg.x = -2700356.3285146747; + test_msg.y = -4292509.928737887; + test_msg.z = 3855357.5011712564; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567700) + << "incorrect value for last_msg_.tow, expected 2567700, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2700356.32851 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2700356.32851, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4292509.92874 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4292509.92874, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3855357.50117 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3855357.50117, is " + << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgPosECEFDepA2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEFDepA2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosECEFDepA2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEFDepA2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -261,94 +277,104 @@ class Test_auto_check_sbp_navigation_MsgPosECEFDepA2 : sbp_msg_pos_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,246,215,32,120,46,39,0,112,97,39,190,34,154,68,193,230,43,119,115,231,95,80,193,50,199,76,66,254,105,77,65,0,0,9,0,204,113, }; - - sbp_msg_pos_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 9; - test_msg.tow = 2567800; - test_msg.x = -2700357.485576801; - test_msg.y = -4292509.80414865; - test_msg.z = 3855356.517968082; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567800) << "incorrect value for last_msg_.tow, expected 2567800, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2700357.48558 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2700357.48558, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4292509.80415 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4292509.80415, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3855356.51797 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3855356.51797, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 120, 46, 39, 0, 112, 97, 39, 190, + 34, 154, 68, 193, 230, 43, 119, 115, 231, 95, 80, 193, 50, 199, + 76, 66, 254, 105, 77, 65, 0, 0, 9, 0, 204, 113, + }; + + sbp_msg_pos_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 9; + test_msg.tow = 2567800; + test_msg.x = -2700357.485576801; + test_msg.y = -4292509.80414865; + test_msg.z = 3855356.517968082; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567800) + << "incorrect value for last_msg_.tow, expected 2567800, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2700357.48558 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2700357.48558, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4292509.80415 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4292509.80415, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3855356.51797 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3855356.51797, is " + << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgPosECEFDepA3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEFDepA3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosECEFDepA3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEFDepA3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -356,94 +382,104 @@ class Test_auto_check_sbp_navigation_MsgPosECEFDepA3 : sbp_msg_pos_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,246,215,32,120,46,39,0,194,82,121,4,34,154,68,193,223,186,1,140,231,95,80,193,176,152,147,181,254,105,77,65,0,0,9,1,97,71, }; - - sbp_msg_pos_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 1; - test_msg.n_sats = 9; - test_msg.tow = 2567800; - test_msg.x = -2700356.0349524925; - test_msg.y = -4292510.187605589; - test_msg.z = 3855357.4185667858; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567800) << "incorrect value for last_msg_.tow, expected 2567800, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2700356.03495 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2700356.03495, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4292510.18761 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4292510.18761, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3855357.41857 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3855357.41857, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 120, 46, 39, 0, 194, 82, 121, 4, + 34, 154, 68, 193, 223, 186, 1, 140, 231, 95, 80, 193, 176, 152, + 147, 181, 254, 105, 77, 65, 0, 0, 9, 1, 97, 71, + }; + + sbp_msg_pos_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 1; + test_msg.n_sats = 9; + test_msg.tow = 2567800; + test_msg.x = -2700356.0349524925; + test_msg.y = -4292510.187605589; + test_msg.z = 3855357.4185667858; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567800) + << "incorrect value for last_msg_.tow, expected 2567800, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2700356.03495 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2700356.03495, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4292510.18761 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4292510.18761, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3855357.41857 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3855357.41857, is " + << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgPosECEFDepA4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEFDepA4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosECEFDepA4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEFDepA4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -451,94 +487,104 @@ class Test_auto_check_sbp_navigation_MsgPosECEFDepA4 : sbp_msg_pos_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,246,215,32,220,46,39,0,216,41,227,254,33,154,68,193,9,151,154,124,231,95,80,193,1,183,214,139,255,105,77,65,0,0,9,0,7,98, }; - - sbp_msg_pos_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 9; - test_msg.tow = 2567900; - test_msg.x = -2700355.9913074784; - test_msg.y = -4292509.946935424; - test_msg.z = 3855359.0924900775; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567900) << "incorrect value for last_msg_.tow, expected 2567900, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2700355.99131 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2700355.99131, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4292509.94694 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4292509.94694, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3855359.09249 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3855359.09249, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 220, 46, 39, 0, 216, 41, 227, 254, + 33, 154, 68, 193, 9, 151, 154, 124, 231, 95, 80, 193, 1, 183, + 214, 139, 255, 105, 77, 65, 0, 0, 9, 0, 7, 98, + }; + + sbp_msg_pos_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 9; + test_msg.tow = 2567900; + test_msg.x = -2700355.9913074784; + test_msg.y = -4292509.946935424; + test_msg.z = 3855359.0924900775; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567900) + << "incorrect value for last_msg_.tow, expected 2567900, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2700355.99131 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2700355.99131, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4292509.94694 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4292509.94694, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3855359.09249 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3855359.09249, is " + << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgPosECEFDepA5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEFDepA5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosECEFDepA5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEFDepA5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -546,94 +592,104 @@ class Test_auto_check_sbp_navigation_MsgPosECEFDepA5 : sbp_msg_pos_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,195,4,32,212,157,67,24,153,222,105,1,252,161,68,193,254,247,52,112,74,67,80,193,164,207,47,146,44,163,77,65,0,0,8,0,145,4, }; - - sbp_msg_pos_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 8; - test_msg.tow = 407084500; - test_msg.x = -2704376.0110433814; - test_msg.y = -4263209.753232954; - test_msg.z = 3884633.142084079; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084500) << "incorrect value for last_msg_.tow, expected 407084500, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2704376.01104 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2704376.01104, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4263209.75323 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4263209.75323, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3884633.14208 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3884633.14208, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 212, 157, 67, 24, 153, 222, 105, 1, + 252, 161, 68, 193, 254, 247, 52, 112, 74, 67, 80, 193, 164, 207, + 47, 146, 44, 163, 77, 65, 0, 0, 8, 0, 145, 4, + }; + + sbp_msg_pos_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 8; + test_msg.tow = 407084500; + test_msg.x = -2704376.0110433814; + test_msg.y = -4263209.753232954; + test_msg.z = 3884633.142084079; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084500) + << "incorrect value for last_msg_.tow, expected 407084500, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2704376.01104 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2704376.01104, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4263209.75323 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4263209.75323, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3884633.14208 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3884633.14208, is " + << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgPosECEFDepA6 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEFDepA6() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosECEFDepA6 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEFDepA6() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -641,94 +697,104 @@ class Test_auto_check_sbp_navigation_MsgPosECEFDepA6 : sbp_msg_pos_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,195,4,32,56,158,67,24,215,184,223,246,251,161,68,193,36,126,17,39,74,67,80,193,19,179,70,80,44,163,77,65,0,0,8,0,245,66, }; - - sbp_msg_pos_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 8; - test_msg.tow = 407084600; - test_msg.x = -2704375.9287024545; - test_msg.y = -4263208.610442672; - test_msg.z = 3884632.627157578; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084600) << "incorrect value for last_msg_.tow, expected 407084600, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2704375.9287 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2704375.9287, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4263208.61044 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4263208.61044, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3884632.62716 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3884632.62716, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 56, 158, 67, 24, 215, 184, 223, 246, + 251, 161, 68, 193, 36, 126, 17, 39, 74, 67, 80, 193, 19, 179, + 70, 80, 44, 163, 77, 65, 0, 0, 8, 0, 245, 66, + }; + + sbp_msg_pos_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 8; + test_msg.tow = 407084600; + test_msg.x = -2704375.9287024545; + test_msg.y = -4263208.610442672; + test_msg.z = 3884632.627157578; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084600) + << "incorrect value for last_msg_.tow, expected 407084600, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2704375.9287 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2704375.9287, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4263208.61044 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4263208.61044, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3884632.62716 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3884632.62716, is " + << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgPosECEFDepA7 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEFDepA7() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosECEFDepA7 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEFDepA7() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -736,94 +802,104 @@ class Test_auto_check_sbp_navigation_MsgPosECEFDepA7 : sbp_msg_pos_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,195,4,32,156,158,67,24,73,74,214,148,251,161,68,193,213,151,184,215,73,67,80,193,110,99,38,164,43,163,77,65,0,0,8,0,5,223, }; - - sbp_msg_pos_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 8; - test_msg.tow = 407084700; - test_msg.x = -2704375.162789617; - test_msg.y = -4263207.370641668; - test_msg.z = 3884631.282421521; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084700) << "incorrect value for last_msg_.tow, expected 407084700, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2704375.16279 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2704375.16279, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4263207.37064 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4263207.37064, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3884631.28242 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3884631.28242, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 156, 158, 67, 24, 73, 74, 214, 148, + 251, 161, 68, 193, 213, 151, 184, 215, 73, 67, 80, 193, 110, 99, + 38, 164, 43, 163, 77, 65, 0, 0, 8, 0, 5, 223, + }; + + sbp_msg_pos_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 8; + test_msg.tow = 407084700; + test_msg.x = -2704375.162789617; + test_msg.y = -4263207.370641668; + test_msg.z = 3884631.282421521; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084700) + << "incorrect value for last_msg_.tow, expected 407084700, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2704375.16279 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2704375.16279, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4263207.37064 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4263207.37064, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3884631.28242 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3884631.28242, is " + << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgPosECEFDepA8 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEFDepA8() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosECEFDepA8 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEFDepA8() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -831,94 +907,104 @@ class Test_auto_check_sbp_navigation_MsgPosECEFDepA8 : sbp_msg_pos_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,195,4,32,0,159,67,24,177,111,112,45,252,161,68,193,213,168,198,253,73,67,80,193,245,12,228,12,44,163,77,65,0,0,8,0,143,212, }; - - sbp_msg_pos_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 8; - test_msg.tow = 407084800; - test_msg.x = -2704376.3549937834; - test_msg.y = -4263207.965250214; - test_msg.z = 3884632.1007095524; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084800) << "incorrect value for last_msg_.tow, expected 407084800, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2704376.35499 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2704376.35499, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4263207.96525 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4263207.96525, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3884632.10071 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3884632.10071, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 0, 159, 67, 24, 177, 111, 112, 45, + 252, 161, 68, 193, 213, 168, 198, 253, 73, 67, 80, 193, 245, 12, + 228, 12, 44, 163, 77, 65, 0, 0, 8, 0, 143, 212, + }; + + sbp_msg_pos_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 8; + test_msg.tow = 407084800; + test_msg.x = -2704376.3549937834; + test_msg.y = -4263207.965250214; + test_msg.z = 3884632.1007095524; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084800) + << "incorrect value for last_msg_.tow, expected 407084800, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2704376.35499 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2704376.35499, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4263207.96525 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4263207.96525, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3884632.10071 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3884632.10071, is " + << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgPosECEFDepA9 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEFDepA9() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosECEFDepA9 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEFDepA9() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -926,94 +1012,104 @@ class Test_auto_check_sbp_navigation_MsgPosECEFDepA9 : sbp_msg_pos_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA9, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,195,4,32,100,159,67,24,67,231,72,165,251,161,68,193,150,210,36,212,73,67,80,193,234,33,25,189,43,163,77,65,0,0,8,0,70,221, }; - - sbp_msg_pos_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 8; - test_msg.tow = 407084900; - test_msg.x = -2704375.291287334; - test_msg.y = -4263207.314747473; - test_msg.z = 3884631.4773294823; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084900) << "incorrect value for last_msg_.tow, expected 407084900, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2704375.29129 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2704375.29129, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4263207.31475 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4263207.31475, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3884631.47733 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3884631.47733, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA9, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 100, 159, 67, 24, 67, 231, 72, 165, + 251, 161, 68, 193, 150, 210, 36, 212, 73, 67, 80, 193, 234, 33, + 25, 189, 43, 163, 77, 65, 0, 0, 8, 0, 70, 221, + }; + + sbp_msg_pos_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 8; + test_msg.tow = 407084900; + test_msg.x = -2704375.291287334; + test_msg.y = -4263207.314747473; + test_msg.z = 3884631.4773294823; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084900) + << "incorrect value for last_msg_.tow, expected 407084900, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2704375.29129 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2704375.29129, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4263207.31475 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4263207.31475, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3884631.47733 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3884631.47733, is " + << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgPosECEFDepA10 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEFDepA10() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosECEFDepA10 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEFDepA10() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -1021,44 +1117,60 @@ class Test_auto_check_sbp_navigation_MsgPosECEFDepA10 : sbp_msg_pos_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA10, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,195,4,32,46,162,68,24,224,72,131,215,251,161,68,193,180,123,222,94,74,67,80,193,191,3,131,193,45,163,77,65,0,0,5,0,17,221, }; - - sbp_msg_pos_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 5; - test_msg.tow = 407151150; - test_msg.x = -2704375.68369399; - test_msg.y = -4263209.482329298; - test_msg.z = 3884635.5118107493; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 5) << "incorrect value for last_msg_.n_sats, expected 5, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407151150) << "incorrect value for last_msg_.tow, expected 407151150, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2704375.68369 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2704375.68369, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4263209.48233 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4263209.48233, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3884635.51181 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3884635.51181, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFDepA10, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 46, 162, 68, 24, 224, 72, 131, 215, + 251, 161, 68, 193, 180, 123, 222, 94, 74, 67, 80, 193, 191, 3, + 131, 193, 45, 163, 77, 65, 0, 0, 5, 0, 17, 221, + }; + + sbp_msg_pos_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 5; + test_msg.tow = 407151150; + test_msg.x = -2704375.68369399; + test_msg.y = -4263209.482329298; + test_msg.z = 3884635.5118107493; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 5) + << "incorrect value for last_msg_.n_sats, expected 5, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407151150) + << "incorrect value for last_msg_.tow, expected 407151150, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2704375.68369 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2704375.68369, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4263209.48233 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4263209.48233, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3884635.51181 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3884635.51181, is " + << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFGNSS.cc b/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFGNSS.cc index 57138182f..fa042d887 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFGNSS.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgPosECEFGNSS.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFGNSS.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgPosECEFGNSS0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosECEFGNSS0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgPosECEFGNSS0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosECEFGNSS0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_ecef_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_ecef_gnss_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,44 +67,60 @@ class Test_auto_check_sbp_navigation_MsgPosECEFGNSS0 : sbp_msg_pos_ecef_gnss_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFGNSS0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosECEFGNSS0, Test) { + uint8_t encoded_frame[] = { + 85, 41, 2, 0, 16, 32, 24, 229, 233, 29, 52, 254, 158, 218, + 42, 142, 68, 193, 69, 162, 89, 91, 34, 68, 80, 193, 131, 21, + 176, 129, 239, 174, 77, 65, 182, 0, 18, 4, 135, 2, + }; - uint8_t encoded_frame[] = {85,41,2,0,16,32,24,229,233,29,52,254,158,218,42,142,68,193,69,162,89,91,34,68,80,193,131,21,176,129,239,174,77,65,182,0,18,4,135,2, }; + sbp_msg_pos_ecef_gnss_t test_msg{}; + test_msg.accuracy = 182; + test_msg.flags = 4; + test_msg.n_sats = 18; + test_msg.tow = 501867800; + test_msg.x = -2694229.7079770807; + test_msg.y = -4264073.427345817; + test_msg.z = 3890655.013186158; - sbp_msg_pos_ecef_gnss_t test_msg{}; - test_msg.accuracy = 182; - test_msg.flags = 4; - test_msg.n_sats = 18; - test_msg.tow = 501867800; - test_msg.x = -2694229.7079770807; - test_msg.y = -4264073.427345817; - test_msg.z = 3890655.013186158; - - EXPECT_EQ(send_message( 4096, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(4096, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 182) << "incorrect value for last_msg_.accuracy, expected 182, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 4) << "incorrect value for last_msg_.flags, expected 4, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 18) << "incorrect value for last_msg_.n_sats, expected 18, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 501867800) << "incorrect value for last_msg_.tow, expected 501867800, is " << last_msg_.tow; - EXPECT_LT((last_msg_.x * 100 - -2694229.70798 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2694229.70798, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4264073.42735 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4264073.42735, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3890655.01319 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3890655.01319, is " << last_msg_.z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 182) + << "incorrect value for last_msg_.accuracy, expected 182, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 4) + << "incorrect value for last_msg_.flags, expected 4, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 18) + << "incorrect value for last_msg_.n_sats, expected 18, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 501867800) + << "incorrect value for last_msg_.tow, expected 501867800, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.x * 100 - -2694229.70798 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2694229.70798, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4264073.42735 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4264073.42735, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3890655.01319 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3890655.01319, is " + << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgPosLLH.cc b/c/test/cpp/auto_check_sbp_navigation_MsgPosLLH.cc index 80c6b89e7..0f9c66741 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgPosLLH.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgPosLLH.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLH.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLH.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgPosLLH0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLH0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgPosLLH0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLH0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,96 +67,108 @@ class Test_auto_check_sbp_navigation_MsgPosLLH0 : sbp_msg_pos_llh_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLH0, Test) -{ - - uint8_t encoded_frame[] = {85,10,2,211,136,34,40,244,122,19,201,106,155,186,42,160,66,64,168,109,26,225,0,120,94,192,130,102,237,230,43,54,60,64,0,0,0,0,14,2,175,162, }; - - sbp_msg_pos_llh_t test_msg{}; - test_msg.flags = 2; - test_msg.h_accuracy = 0; - test_msg.height = 28.21160739227208; - test_msg.lat = 37.25130398358085; - test_msg.lon = -121.87505366879361; - test_msg.n_sats = 14; - test_msg.tow = 326825000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 2) << "incorrect value for last_msg_.flags, expected 2, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 28.2116073923 * 100), 0.05) << "incorrect value for last_msg_.height, expected 28.2116073923, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.2513039836 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.2513039836, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -121.875053669 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -121.875053669, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 14) << "incorrect value for last_msg_.n_sats, expected 14, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326825000) << "incorrect value for last_msg_.tow, expected 326825000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLH0, Test) { + uint8_t encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 40, 244, 122, 19, 201, 106, 155, 186, + 42, 160, 66, 64, 168, 109, 26, 225, 0, 120, 94, 192, 130, 102, + 237, 230, 43, 54, 60, 64, 0, 0, 0, 0, 14, 2, 175, 162, + }; + + sbp_msg_pos_llh_t test_msg{}; + test_msg.flags = 2; + test_msg.h_accuracy = 0; + test_msg.height = 28.21160739227208; + test_msg.lat = 37.25130398358085; + test_msg.lon = -121.87505366879361; + test_msg.n_sats = 14; + test_msg.tow = 326825000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 2) + << "incorrect value for last_msg_.flags, expected 2, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 28.2116073923 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 28.2116073923, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.2513039836 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.2513039836, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -121.875053669 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -121.875053669, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 14) + << "incorrect value for last_msg_.n_sats, expected 14, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326825000) + << "incorrect value for last_msg_.tow, expected 326825000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgPosLLH1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLH1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosLLH1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLH1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -168,96 +176,108 @@ class Test_auto_check_sbp_navigation_MsgPosLLH1 : sbp_msg_pos_llh_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLH1, Test) -{ - - uint8_t encoded_frame[] = {85,10,2,211,136,34,16,248,122,19,52,177,251,178,42,160,66,64,237,22,97,224,0,120,94,192,107,188,109,90,247,189,59,64,0,0,0,0,15,2,38,177, }; - - sbp_msg_pos_llh_t test_msg{}; - test_msg.flags = 2; - test_msg.h_accuracy = 0; - test_msg.height = 27.742055560866373; - test_msg.lat = 37.251303074738104; - test_msg.lon = -121.87505349618341; - test_msg.n_sats = 15; - test_msg.tow = 326826000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 2) << "incorrect value for last_msg_.flags, expected 2, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 27.7420555609 * 100), 0.05) << "incorrect value for last_msg_.height, expected 27.7420555609, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.2513030747 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.2513030747, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -121.875053496 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -121.875053496, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326826000) << "incorrect value for last_msg_.tow, expected 326826000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLH1, Test) { + uint8_t encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 16, 248, 122, 19, 52, 177, 251, 178, + 42, 160, 66, 64, 237, 22, 97, 224, 0, 120, 94, 192, 107, 188, + 109, 90, 247, 189, 59, 64, 0, 0, 0, 0, 15, 2, 38, 177, + }; + + sbp_msg_pos_llh_t test_msg{}; + test_msg.flags = 2; + test_msg.h_accuracy = 0; + test_msg.height = 27.742055560866373; + test_msg.lat = 37.251303074738104; + test_msg.lon = -121.87505349618341; + test_msg.n_sats = 15; + test_msg.tow = 326826000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 2) + << "incorrect value for last_msg_.flags, expected 2, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 27.7420555609 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 27.7420555609, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.2513030747 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.2513030747, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -121.875053496 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -121.875053496, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326826000) + << "incorrect value for last_msg_.tow, expected 326826000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgPosLLH2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLH2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosLLH2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLH2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -265,96 +285,108 @@ class Test_auto_check_sbp_navigation_MsgPosLLH2 : sbp_msg_pos_llh_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLH2, Test) -{ - - uint8_t encoded_frame[] = {85,10,2,211,136,34,248,251,122,19,135,66,9,163,42,160,66,64,146,8,99,225,0,120,94,192,45,181,143,219,28,157,59,64,0,0,0,0,15,2,51,40, }; - - sbp_msg_pos_llh_t test_msg{}; - test_msg.flags = 2; - test_msg.h_accuracy = 0; - test_msg.height = 27.613721582970516; - test_msg.lat = 37.25130117370741; - test_msg.lon = -121.87505373641241; - test_msg.n_sats = 15; - test_msg.tow = 326827000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 2) << "incorrect value for last_msg_.flags, expected 2, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 27.613721583 * 100), 0.05) << "incorrect value for last_msg_.height, expected 27.613721583, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.2513011737 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.2513011737, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -121.875053736 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -121.875053736, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326827000) << "incorrect value for last_msg_.tow, expected 326827000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLH2, Test) { + uint8_t encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 248, 251, 122, 19, 135, 66, 9, 163, + 42, 160, 66, 64, 146, 8, 99, 225, 0, 120, 94, 192, 45, 181, + 143, 219, 28, 157, 59, 64, 0, 0, 0, 0, 15, 2, 51, 40, + }; + + sbp_msg_pos_llh_t test_msg{}; + test_msg.flags = 2; + test_msg.h_accuracy = 0; + test_msg.height = 27.613721582970516; + test_msg.lat = 37.25130117370741; + test_msg.lon = -121.87505373641241; + test_msg.n_sats = 15; + test_msg.tow = 326827000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 2) + << "incorrect value for last_msg_.flags, expected 2, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 27.613721583 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 27.613721583, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.2513011737 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.2513011737, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -121.875053736 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -121.875053736, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326827000) + << "incorrect value for last_msg_.tow, expected 326827000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgPosLLH3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLH3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosLLH3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLH3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -362,96 +394,108 @@ class Test_auto_check_sbp_navigation_MsgPosLLH3 : sbp_msg_pos_llh_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLH3, Test) -{ - - uint8_t encoded_frame[] = {85,10,2,211,136,34,224,255,122,19,18,44,253,119,42,160,66,64,48,109,39,231,0,120,94,192,185,76,48,17,119,205,59,64,0,0,0,0,15,2,12,194, }; - - sbp_msg_pos_llh_t test_msg{}; - test_msg.flags = 2; - test_msg.h_accuracy = 0; - test_msg.height = 27.80259807042305; - test_msg.lat = 37.251296042079176; - test_msg.lon = -121.87505511141057; - test_msg.n_sats = 15; - test_msg.tow = 326828000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 2) << "incorrect value for last_msg_.flags, expected 2, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 27.8025980704 * 100), 0.05) << "incorrect value for last_msg_.height, expected 27.8025980704, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.2512960421 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.2512960421, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -121.875055111 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -121.875055111, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326828000) << "incorrect value for last_msg_.tow, expected 326828000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLH3, Test) { + uint8_t encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 224, 255, 122, 19, 18, 44, 253, 119, + 42, 160, 66, 64, 48, 109, 39, 231, 0, 120, 94, 192, 185, 76, + 48, 17, 119, 205, 59, 64, 0, 0, 0, 0, 15, 2, 12, 194, + }; + + sbp_msg_pos_llh_t test_msg{}; + test_msg.flags = 2; + test_msg.h_accuracy = 0; + test_msg.height = 27.80259807042305; + test_msg.lat = 37.251296042079176; + test_msg.lon = -121.87505511141057; + test_msg.n_sats = 15; + test_msg.tow = 326828000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 2) + << "incorrect value for last_msg_.flags, expected 2, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 27.8025980704 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 27.8025980704, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.2512960421 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.2512960421, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -121.875055111 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -121.875055111, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326828000) + << "incorrect value for last_msg_.tow, expected 326828000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgPosLLH4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLH4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosLLH4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLH4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -459,46 +503,64 @@ class Test_auto_check_sbp_navigation_MsgPosLLH4 : sbp_msg_pos_llh_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLH4, Test) -{ - - uint8_t encoded_frame[] = {85,10,2,211,136,34,200,3,123,19,225,237,238,90,42,160,66,64,59,143,70,235,0,120,94,192,101,106,249,224,131,240,59,64,0,0,0,0,15,2,34,103, }; - - sbp_msg_pos_llh_t test_msg{}; - test_msg.flags = 2; - test_msg.h_accuracy = 0; - test_msg.height = 27.939512310879213; - test_msg.lat = 37.251292578377395; - test_msg.lon = -121.87505609407974; - test_msg.n_sats = 15; - test_msg.tow = 326829000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 2) << "incorrect value for last_msg_.flags, expected 2, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 27.9395123109 * 100), 0.05) << "incorrect value for last_msg_.height, expected 27.9395123109, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.2512925784 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.2512925784, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -121.875056094 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -121.875056094, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326829000) << "incorrect value for last_msg_.tow, expected 326829000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLH4, Test) { + uint8_t encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 200, 3, 123, 19, 225, 237, 238, 90, + 42, 160, 66, 64, 59, 143, 70, 235, 0, 120, 94, 192, 101, 106, + 249, 224, 131, 240, 59, 64, 0, 0, 0, 0, 15, 2, 34, 103, + }; + + sbp_msg_pos_llh_t test_msg{}; + test_msg.flags = 2; + test_msg.h_accuracy = 0; + test_msg.height = 27.939512310879213; + test_msg.lat = 37.251292578377395; + test_msg.lon = -121.87505609407974; + test_msg.n_sats = 15; + test_msg.tow = 326829000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 2) + << "incorrect value for last_msg_.flags, expected 2, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 27.9395123109 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 27.9395123109, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.2512925784 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.2512925784, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -121.875056094 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -121.875056094, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326829000) + << "incorrect value for last_msg_.tow, expected 326829000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgPosLLHCov.cc b/c/test/cpp/auto_check_sbp_navigation_MsgPosLLHCov.cc index 8eaa2af33..e5339490e 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgPosLLHCov.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgPosLLHCov.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHCov.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHCov.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgPosLLHCov0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLHCov0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgPosLLHCov0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLHCov0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_cov_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_cov_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,54 +67,80 @@ class Test_auto_check_sbp_navigation_MsgPosLLHCov0 : sbp_msg_pos_llh_cov_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHCov0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHCov0, Test) { + uint8_t encoded_frame[] = { + 85, 17, 2, 66, 0, 54, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 28, 64, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 224, 64, 0, 0, 160, 64, 0, 0, 0, 65, 0, 0, + 192, 64, 0, 0, 128, 63, 0, 0, 0, 64, 5, 5, 151, 98, + }; - uint8_t encoded_frame[] = {85,17,2,66,0,54,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,64,0,0,0,0,0,0,0,0,0,0,224,64,0,0,160,64,0,0,0,65,0,0,192,64,0,0,128,63,0,0,0,64,5,5,151,98, }; + sbp_msg_pos_llh_cov_t test_msg{}; + test_msg.cov_d_d = 2.0; + test_msg.cov_e_d = 1.0; + test_msg.cov_e_e = 6.0; + test_msg.cov_n_d = 8.0; + test_msg.cov_n_e = 5.0; + test_msg.cov_n_n = 7.0; + test_msg.flags = 5; + test_msg.height = 0.0; + test_msg.lat = 0.0; + test_msg.lon = 7.0; + test_msg.n_sats = 5; + test_msg.tow = 7; - sbp_msg_pos_llh_cov_t test_msg{}; - test_msg.cov_d_d = 2.0; - test_msg.cov_e_d = 1.0; - test_msg.cov_e_e = 6.0; - test_msg.cov_n_d = 8.0; - test_msg.cov_n_e = 5.0; - test_msg.cov_n_n = 7.0; - test_msg.flags = 5; - test_msg.height = 0.0; - test_msg.lat = 0.0; - test_msg.lon = 7.0; - test_msg.n_sats = 5; - test_msg.tow = 7; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cov_d_d * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.cov_d_d, expected 2.0, is " << last_msg_.cov_d_d; - EXPECT_LT((last_msg_.cov_e_d * 100 - 1.0 * 100), 0.05) << "incorrect value for last_msg_.cov_e_d, expected 1.0, is " << last_msg_.cov_e_d; - EXPECT_LT((last_msg_.cov_e_e * 100 - 6.0 * 100), 0.05) << "incorrect value for last_msg_.cov_e_e, expected 6.0, is " << last_msg_.cov_e_e; - EXPECT_LT((last_msg_.cov_n_d * 100 - 8.0 * 100), 0.05) << "incorrect value for last_msg_.cov_n_d, expected 8.0, is " << last_msg_.cov_n_d; - EXPECT_LT((last_msg_.cov_n_e * 100 - 5.0 * 100), 0.05) << "incorrect value for last_msg_.cov_n_e, expected 5.0, is " << last_msg_.cov_n_e; - EXPECT_LT((last_msg_.cov_n_n * 100 - 7.0 * 100), 0.05) << "incorrect value for last_msg_.cov_n_n, expected 7.0, is " << last_msg_.cov_n_n; - EXPECT_EQ(last_msg_.flags, 5) << "incorrect value for last_msg_.flags, expected 5, is " << last_msg_.flags; - EXPECT_LT((last_msg_.height * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.height, expected 0.0, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 0.0, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - 7.0 * 100), 0.05) << "incorrect value for last_msg_.lon, expected 7.0, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 5) << "incorrect value for last_msg_.n_sats, expected 5, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 7) << "incorrect value for last_msg_.tow, expected 7, is " << last_msg_.tow; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cov_d_d * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_d_d, expected 2.0, is " + << last_msg_.cov_d_d; + EXPECT_LT((last_msg_.cov_e_d * 100 - 1.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_e_d, expected 1.0, is " + << last_msg_.cov_e_d; + EXPECT_LT((last_msg_.cov_e_e * 100 - 6.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_e_e, expected 6.0, is " + << last_msg_.cov_e_e; + EXPECT_LT((last_msg_.cov_n_d * 100 - 8.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_n_d, expected 8.0, is " + << last_msg_.cov_n_d; + EXPECT_LT((last_msg_.cov_n_e * 100 - 5.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_n_e, expected 5.0, is " + << last_msg_.cov_n_e; + EXPECT_LT((last_msg_.cov_n_n * 100 - 7.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_n_n, expected 7.0, is " + << last_msg_.cov_n_n; + EXPECT_EQ(last_msg_.flags, 5) + << "incorrect value for last_msg_.flags, expected 5, is " + << last_msg_.flags; + EXPECT_LT((last_msg_.height * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 0.0, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 0.0, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - 7.0 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected 7.0, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 5) + << "incorrect value for last_msg_.n_sats, expected 5, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 7) + << "incorrect value for last_msg_.tow, expected 7, is " << last_msg_.tow; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgPosLLHDepA.cc b/c/test/cpp/auto_check_sbp_navigation_MsgPosLLHDepA.cc index 216bb98b5..17826e7e1 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgPosLLHDepA.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgPosLLHDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgPosLLHDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLHDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgPosLLHDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLHDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,96 +67,108 @@ class Test_auto_check_sbp_navigation_MsgPosLLHDepA0 : sbp_msg_pos_llh_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,246,215,34,20,46,39,0,250,29,226,186,235,182,66,64,19,203,51,196,24,139,94,192,31,157,160,232,122,115,81,64,0,0,0,0,9,0,236,139, }; - - sbp_msg_pos_llh_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.height = 69.80437675175607; - test_msg.lat = 37.42906890908121; - test_msg.lon = -122.17338662202773; - test_msg.n_sats = 9; - test_msg.tow = 2567700; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 69.8043767518 * 100), 0.05) << "incorrect value for last_msg_.height, expected 69.8043767518, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.4290689091 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.4290689091, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -122.173386622 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -122.173386622, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567700) << "incorrect value for last_msg_.tow, expected 2567700, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 20, 46, 39, 0, 250, 29, 226, 186, + 235, 182, 66, 64, 19, 203, 51, 196, 24, 139, 94, 192, 31, 157, + 160, 232, 122, 115, 81, 64, 0, 0, 0, 0, 9, 0, 236, 139, + }; + + sbp_msg_pos_llh_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.height = 69.80437675175607; + test_msg.lat = 37.42906890908121; + test_msg.lon = -122.17338662202773; + test_msg.n_sats = 9; + test_msg.tow = 2567700; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 69.8043767518 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 69.8043767518, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.4290689091 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.4290689091, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -122.173386622 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -122.173386622, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567700) + << "incorrect value for last_msg_.tow, expected 2567700, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgPosLLHDepA1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLHDepA1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosLLHDepA1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLHDepA1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -168,96 +176,108 @@ class Test_auto_check_sbp_navigation_MsgPosLLHDepA1 : sbp_msg_pos_llh_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,246,215,34,20,46,39,0,161,51,75,148,235,182,66,64,36,41,246,30,25,139,94,192,254,218,49,127,10,108,81,64,0,0,0,0,9,1,25,117, }; - - sbp_msg_pos_llh_dep_a_t test_msg{}; - test_msg.flags = 1; - test_msg.h_accuracy = 0; - test_msg.height = 69.68814067715354; - test_msg.lat = 37.42906430885274; - test_msg.lon = -122.17340826071865; - test_msg.n_sats = 9; - test_msg.tow = 2567700; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 69.6881406772 * 100), 0.05) << "incorrect value for last_msg_.height, expected 69.6881406772, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.4290643089 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.4290643089, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -122.173408261 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -122.173408261, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567700) << "incorrect value for last_msg_.tow, expected 2567700, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 20, 46, 39, 0, 161, 51, 75, 148, + 235, 182, 66, 64, 36, 41, 246, 30, 25, 139, 94, 192, 254, 218, + 49, 127, 10, 108, 81, 64, 0, 0, 0, 0, 9, 1, 25, 117, + }; + + sbp_msg_pos_llh_dep_a_t test_msg{}; + test_msg.flags = 1; + test_msg.h_accuracy = 0; + test_msg.height = 69.68814067715354; + test_msg.lat = 37.42906430885274; + test_msg.lon = -122.17340826071865; + test_msg.n_sats = 9; + test_msg.tow = 2567700; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 69.6881406772 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 69.6881406772, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.4290643089 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.4290643089, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -122.173408261 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -122.173408261, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567700) + << "incorrect value for last_msg_.tow, expected 2567700, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgPosLLHDepA2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLHDepA2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosLLHDepA2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLHDepA2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -265,96 +285,108 @@ class Test_auto_check_sbp_navigation_MsgPosLLHDepA2 : sbp_msg_pos_llh_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,246,215,34,120,46,39,0,56,214,210,65,235,182,66,64,13,46,132,80,25,139,94,192,22,143,46,234,191,95,81,64,0,0,0,0,9,0,174,105, }; - - sbp_msg_pos_llh_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.height = 69.49608854815264; - test_msg.lat = 37.42905447764173; - test_msg.lon = -122.17342007549469; - test_msg.n_sats = 9; - test_msg.tow = 2567800; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 69.4960885482 * 100), 0.05) << "incorrect value for last_msg_.height, expected 69.4960885482, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.4290544776 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.4290544776, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -122.173420075 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -122.173420075, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567800) << "incorrect value for last_msg_.tow, expected 2567800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 120, 46, 39, 0, 56, 214, 210, 65, + 235, 182, 66, 64, 13, 46, 132, 80, 25, 139, 94, 192, 22, 143, + 46, 234, 191, 95, 81, 64, 0, 0, 0, 0, 9, 0, 174, 105, + }; + + sbp_msg_pos_llh_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.height = 69.49608854815264; + test_msg.lat = 37.42905447764173; + test_msg.lon = -122.17342007549469; + test_msg.n_sats = 9; + test_msg.tow = 2567800; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 69.4960885482 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 69.4960885482, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.4290544776 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.4290544776, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -122.173420075 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -122.173420075, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567800) + << "incorrect value for last_msg_.tow, expected 2567800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgPosLLHDepA3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLHDepA3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosLLHDepA3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLHDepA3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -362,96 +394,108 @@ class Test_auto_check_sbp_navigation_MsgPosLLHDepA3 : sbp_msg_pos_llh_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,246,215,34,120,46,39,0,251,117,115,140,235,182,66,64,152,134,167,12,25,139,94,192,160,22,137,253,4,108,81,64,0,0,0,0,9,1,122,127, }; - - sbp_msg_pos_llh_dep_a_t test_msg{}; - test_msg.flags = 1; - test_msg.h_accuracy = 0; - test_msg.height = 69.68780458819901; - test_msg.lat = 37.429063373925565; - test_msg.lon = -122.17340389594972; - test_msg.n_sats = 9; - test_msg.tow = 2567800; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 69.6878045882 * 100), 0.05) << "incorrect value for last_msg_.height, expected 69.6878045882, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.4290633739 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.4290633739, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -122.173403896 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -122.173403896, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567800) << "incorrect value for last_msg_.tow, expected 2567800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 120, 46, 39, 0, 251, 117, 115, 140, + 235, 182, 66, 64, 152, 134, 167, 12, 25, 139, 94, 192, 160, 22, + 137, 253, 4, 108, 81, 64, 0, 0, 0, 0, 9, 1, 122, 127, + }; + + sbp_msg_pos_llh_dep_a_t test_msg{}; + test_msg.flags = 1; + test_msg.h_accuracy = 0; + test_msg.height = 69.68780458819901; + test_msg.lat = 37.429063373925565; + test_msg.lon = -122.17340389594972; + test_msg.n_sats = 9; + test_msg.tow = 2567800; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 69.6878045882 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 69.6878045882, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.4290633739 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.4290633739, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -122.173403896 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -122.173403896, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567800) + << "incorrect value for last_msg_.tow, expected 2567800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgPosLLHDepA4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLHDepA4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosLLHDepA4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLHDepA4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -459,96 +503,108 @@ class Test_auto_check_sbp_navigation_MsgPosLLHDepA4 : sbp_msg_pos_llh_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,246,215,34,220,46,39,0,51,124,88,251,235,182,66,64,153,5,250,16,25,139,94,192,146,60,187,219,152,161,81,64,0,0,0,0,9,0,194,158, }; - - sbp_msg_pos_llh_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.height = 70.5249547317965; - test_msg.lat = 37.42907659359516; - test_msg.lon = -122.17340492645452; - test_msg.n_sats = 9; - test_msg.tow = 2567900; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 70.5249547318 * 100), 0.05) << "incorrect value for last_msg_.height, expected 70.5249547318, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.4290765936 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.4290765936, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -122.173404926 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -122.173404926, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567900) << "incorrect value for last_msg_.tow, expected 2567900, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 220, 46, 39, 0, 51, 124, 88, 251, + 235, 182, 66, 64, 153, 5, 250, 16, 25, 139, 94, 192, 146, 60, + 187, 219, 152, 161, 81, 64, 0, 0, 0, 0, 9, 0, 194, 158, + }; + + sbp_msg_pos_llh_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.height = 70.5249547317965; + test_msg.lat = 37.42907659359516; + test_msg.lon = -122.17340492645452; + test_msg.n_sats = 9; + test_msg.tow = 2567900; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 70.5249547318 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 70.5249547318, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.4290765936 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.4290765936, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -122.173404926 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -122.173404926, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567900) + << "incorrect value for last_msg_.tow, expected 2567900, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgPosLLHDepA5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLHDepA5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosLLHDepA5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLHDepA5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -556,96 +612,108 @@ class Test_auto_check_sbp_navigation_MsgPosLLHDepA5 : sbp_msg_pos_llh_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,195,4,34,212,157,67,24,8,23,228,8,151,225,66,64,156,174,42,194,230,152,94,192,153,23,72,47,196,40,16,64,0,0,0,0,8,0,237,169, }; - - sbp_msg_pos_llh_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.height = 4.039810885214956; - test_msg.lat = 37.76242171418386; - test_msg.lon = -122.38908437889262; - test_msg.n_sats = 8; - test_msg.tow = 407084500; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 4.03981088521 * 100), 0.05) << "incorrect value for last_msg_.height, expected 4.03981088521, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.7624217142 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.7624217142, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -122.389084379 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -122.389084379, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084500) << "incorrect value for last_msg_.tow, expected 407084500, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 212, 157, 67, 24, 8, 23, 228, 8, + 151, 225, 66, 64, 156, 174, 42, 194, 230, 152, 94, 192, 153, 23, + 72, 47, 196, 40, 16, 64, 0, 0, 0, 0, 8, 0, 237, 169, + }; + + sbp_msg_pos_llh_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.height = 4.039810885214956; + test_msg.lat = 37.76242171418386; + test_msg.lon = -122.38908437889262; + test_msg.n_sats = 8; + test_msg.tow = 407084500; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 4.03981088521 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 4.03981088521, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.7624217142 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.7624217142, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -122.389084379 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -122.389084379, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084500) + << "incorrect value for last_msg_.tow, expected 407084500, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgPosLLHDepA6 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLHDepA6() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosLLHDepA6 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLHDepA6() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -653,96 +721,108 @@ class Test_auto_check_sbp_navigation_MsgPosLLHDepA6 : sbp_msg_pos_llh_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,195,4,34,56,158,67,24,220,109,212,24,151,225,66,64,159,231,254,219,230,152,94,192,128,151,67,19,233,105,7,64,0,0,0,0,8,0,152,11, }; - - sbp_msg_pos_llh_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.height = 2.926714087009657; - test_msg.lat = 37.76242361423985; - test_msg.lon = -122.38909053700489; - test_msg.n_sats = 8; - test_msg.tow = 407084600; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 2.92671408701 * 100), 0.05) << "incorrect value for last_msg_.height, expected 2.92671408701, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.7624236142 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.7624236142, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -122.389090537 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -122.389090537, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084600) << "incorrect value for last_msg_.tow, expected 407084600, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 56, 158, 67, 24, 220, 109, 212, 24, + 151, 225, 66, 64, 159, 231, 254, 219, 230, 152, 94, 192, 128, 151, + 67, 19, 233, 105, 7, 64, 0, 0, 0, 0, 8, 0, 152, 11, + }; + + sbp_msg_pos_llh_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.height = 2.926714087009657; + test_msg.lat = 37.76242361423985; + test_msg.lon = -122.38909053700489; + test_msg.n_sats = 8; + test_msg.tow = 407084600; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 2.92671408701 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 2.92671408701, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.7624236142 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.7624236142, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -122.389090537 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -122.389090537, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084600) + << "incorrect value for last_msg_.tow, expected 407084600, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgPosLLHDepA7 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLHDepA7() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosLLHDepA7 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLHDepA7() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -750,96 +830,108 @@ class Test_auto_check_sbp_navigation_MsgPosLLHDepA7 : sbp_msg_pos_llh_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,195,4,34,156,158,67,24,13,91,237,11,151,225,66,64,75,113,210,220,230,152,94,192,37,6,145,188,89,112,238,63,0,0,0,0,8,0,221,155, }; - - sbp_msg_pos_llh_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.height = 0.9512146647395566; - test_msg.lat = 37.762422076126406; - test_msg.lon = -122.3890907340148; - test_msg.n_sats = 8; - test_msg.tow = 407084700; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 0.95121466474 * 100), 0.05) << "incorrect value for last_msg_.height, expected 0.95121466474, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.7624220761 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.7624220761, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -122.389090734 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -122.389090734, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084700) << "incorrect value for last_msg_.tow, expected 407084700, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 156, 158, 67, 24, 13, 91, 237, 11, + 151, 225, 66, 64, 75, 113, 210, 220, 230, 152, 94, 192, 37, 6, + 145, 188, 89, 112, 238, 63, 0, 0, 0, 0, 8, 0, 221, 155, + }; + + sbp_msg_pos_llh_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.height = 0.9512146647395566; + test_msg.lat = 37.762422076126406; + test_msg.lon = -122.3890907340148; + test_msg.n_sats = 8; + test_msg.tow = 407084700; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 0.95121466474 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 0.95121466474, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.7624220761 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.7624220761, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -122.389090734 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -122.389090734, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084700) + << "incorrect value for last_msg_.tow, expected 407084700, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgPosLLHDepA8 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLHDepA8() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosLLHDepA8 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLHDepA8() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -847,96 +939,108 @@ class Test_auto_check_sbp_navigation_MsgPosLLHDepA8 : sbp_msg_pos_llh_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,195,4,34,0,159,67,24,51,183,5,8,151,225,66,64,13,226,148,253,230,152,94,192,187,27,11,32,69,213,2,64,0,0,0,0,8,0,82,94, }; - - sbp_msg_pos_llh_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.height = 2.354135752047538; - test_msg.lat = 37.762421610632735; - test_msg.lon = -122.38909854449612; - test_msg.n_sats = 8; - test_msg.tow = 407084800; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 2.35413575205 * 100), 0.05) << "incorrect value for last_msg_.height, expected 2.35413575205, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.7624216106 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.7624216106, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -122.389098544 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -122.389098544, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084800) << "incorrect value for last_msg_.tow, expected 407084800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 0, 159, 67, 24, 51, 183, 5, 8, + 151, 225, 66, 64, 13, 226, 148, 253, 230, 152, 94, 192, 187, 27, + 11, 32, 69, 213, 2, 64, 0, 0, 0, 0, 8, 0, 82, 94, + }; + + sbp_msg_pos_llh_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.height = 2.354135752047538; + test_msg.lat = 37.762421610632735; + test_msg.lon = -122.38909854449612; + test_msg.n_sats = 8; + test_msg.tow = 407084800; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 2.35413575205 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 2.35413575205, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.7624216106 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.7624216106, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -122.389098544 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -122.389098544, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084800) + << "incorrect value for last_msg_.tow, expected 407084800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgPosLLHDepA9 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLHDepA9() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosLLHDepA9 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLHDepA9() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -944,96 +1048,108 @@ class Test_auto_check_sbp_navigation_MsgPosLLHDepA9 : sbp_msg_pos_llh_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA9, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,195,4,34,100,159,67,24,22,77,146,22,151,225,66,64,64,134,105,227,230,152,94,192,37,99,114,72,31,103,241,63,0,0,0,0,8,0,70,60, }; - - sbp_msg_pos_llh_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.height = 1.0876763181642641; - test_msg.lat = 37.76242334502801; - test_msg.lon = -122.38909230523223; - test_msg.n_sats = 8; - test_msg.tow = 407084900; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 1.08767631816 * 100), 0.05) << "incorrect value for last_msg_.height, expected 1.08767631816, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.762423345 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.762423345, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -122.389092305 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -122.389092305, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084900) << "incorrect value for last_msg_.tow, expected 407084900, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA9, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 100, 159, 67, 24, 22, 77, 146, 22, + 151, 225, 66, 64, 64, 134, 105, 227, 230, 152, 94, 192, 37, 99, + 114, 72, 31, 103, 241, 63, 0, 0, 0, 0, 8, 0, 70, 60, + }; + + sbp_msg_pos_llh_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.height = 1.0876763181642641; + test_msg.lat = 37.76242334502801; + test_msg.lon = -122.38909230523223; + test_msg.n_sats = 8; + test_msg.tow = 407084900; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 1.08767631816 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 1.08767631816, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.762423345 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.762423345, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -122.389092305 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -122.389092305, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084900) + << "incorrect value for last_msg_.tow, expected 407084900, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgPosLLHDepA10 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLLHDepA10() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgPosLLHDepA10 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLLHDepA10() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -1041,46 +1157,64 @@ class Test_auto_check_sbp_navigation_MsgPosLLHDepA10 : sbp_msg_pos_llh_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA10, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,195,4,34,46,162,68,24,124,245,46,169,151,225,66,64,135,149,234,187,230,152,94,192,194,201,115,145,166,175,20,64,0,0,0,0,5,0,212,121, }; - - sbp_msg_pos_llh_dep_a_t test_msg{}; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.height = 5.171533844654222; - test_msg.lat = 37.76244082253376; - test_msg.lon = -122.38908288868525; - test_msg.n_sats = 5; - test_msg.tow = 407151150; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - 5.17153384465 * 100), 0.05) << "incorrect value for last_msg_.height, expected 5.17153384465, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.7624408225 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.7624408225, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -122.389082889 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -122.389082889, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 5) << "incorrect value for last_msg_.n_sats, expected 5, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407151150) << "incorrect value for last_msg_.tow, expected 407151150, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLLHDepA10, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 46, 162, 68, 24, 124, 245, 46, 169, + 151, 225, 66, 64, 135, 149, 234, 187, 230, 152, 94, 192, 194, 201, + 115, 145, 166, 175, 20, 64, 0, 0, 0, 0, 5, 0, 212, 121, + }; + + sbp_msg_pos_llh_dep_a_t test_msg{}; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.height = 5.171533844654222; + test_msg.lat = 37.76244082253376; + test_msg.lon = -122.38908288868525; + test_msg.n_sats = 5; + test_msg.tow = 407151150; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - 5.17153384465 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 5.17153384465, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.7624408225 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.7624408225, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -122.389082889 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -122.389082889, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 5) + << "incorrect value for last_msg_.n_sats, expected 5, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407151150) + << "incorrect value for last_msg_.tow, expected 407151150, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgPosLlhAcc.cc b/c/test/cpp/auto_check_sbp_navigation_MsgPosLlhAcc.cc index e34d98252..39ec27752 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgPosLlhAcc.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgPosLlhAcc.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhAcc.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhAcc.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgPosLlhAcc0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLlhAcc0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgPosLlhAcc0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLlhAcc0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_acc_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_acc_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,60 +67,100 @@ class Test_auto_check_sbp_navigation_MsgPosLlhAcc0 : sbp_msg_pos_llh_acc_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLlhAcc0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLlhAcc0, Test) { + uint8_t encoded_frame[] = { + 85, 24, 2, 2, 28, 67, 39, 120, 110, 18, 51, 51, 51, 51, 51, + 139, 189, 64, 154, 153, 153, 153, 25, 151, 192, 64, 51, 51, 51, 51, + 51, 161, 176, 64, 51, 51, 51, 51, 51, 101, 179, 64, 51, 163, 22, + 69, 154, 25, 173, 69, 102, 134, 243, 68, 154, 201, 196, 69, 205, 224, + 0, 70, 51, 35, 72, 69, 51, 99, 31, 69, 95, 27, 72, 220, 177, + }; - uint8_t encoded_frame[] = {85,24,2,2,28,67,39,120,110,18,51,51,51,51,51,139,189,64,154,153,153,153,25,151,192,64,51,51,51,51,51,161,176,64,51,51,51,51,51,101,179,64,51,163,22,69,154,25,173,69,102,134,243,68,154,201,196,69,205,224,0,70,51,35,72,69,51,99,31,69,95,27,72,220,177, }; + sbp_msg_pos_llh_acc_t test_msg{}; + test_msg.at_accuracy = 6297.2001953125; + test_msg.confidence_and_geoid = 95; + test_msg.ct_accuracy = 1948.199951171875; + test_msg.flags = 72; + test_msg.h_accuracy = 2410.199951171875; + test_msg.h_ellipse.orientation = 2550.199951171875; + test_msg.h_ellipse.semi_major = 8248.2001953125; + test_msg.h_ellipse.semi_minor = 3202.199951171875; + test_msg.height = 4257.2; + test_msg.lat = 7563.2; + test_msg.lon = 8494.2; + test_msg.n_sats = 27; + test_msg.orthometric_height = 4965.2; + test_msg.tow = 309229607; + test_msg.v_accuracy = 5539.2001953125; - sbp_msg_pos_llh_acc_t test_msg{}; - test_msg.at_accuracy = 6297.2001953125; - test_msg.confidence_and_geoid = 95; - test_msg.ct_accuracy = 1948.199951171875; - test_msg.flags = 72; - test_msg.h_accuracy = 2410.199951171875; - test_msg.h_ellipse.orientation = 2550.199951171875; - test_msg.h_ellipse.semi_major = 8248.2001953125; - test_msg.h_ellipse.semi_minor = 3202.199951171875; - test_msg.height = 4257.2; - test_msg.lat = 7563.2; - test_msg.lon = 8494.2; - test_msg.n_sats = 27; - test_msg.orthometric_height = 4965.2; - test_msg.tow = 309229607; - test_msg.v_accuracy = 5539.2001953125; - - EXPECT_EQ(send_message( 7170, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(7170, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 7170); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.at_accuracy * 100 - 6297.20019531 * 100), 0.05) << "incorrect value for last_msg_.at_accuracy, expected 6297.20019531, is " << last_msg_.at_accuracy; - EXPECT_EQ(last_msg_.confidence_and_geoid, 95) << "incorrect value for last_msg_.confidence_and_geoid, expected 95, is " << last_msg_.confidence_and_geoid; - EXPECT_LT((last_msg_.ct_accuracy * 100 - 1948.19995117 * 100), 0.05) << "incorrect value for last_msg_.ct_accuracy, expected 1948.19995117, is " << last_msg_.ct_accuracy; - EXPECT_EQ(last_msg_.flags, 72) << "incorrect value for last_msg_.flags, expected 72, is " << last_msg_.flags; - EXPECT_LT((last_msg_.h_accuracy * 100 - 2410.19995117 * 100), 0.05) << "incorrect value for last_msg_.h_accuracy, expected 2410.19995117, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.h_ellipse.orientation * 100 - 2550.19995117 * 100), 0.05) << "incorrect value for last_msg_.h_ellipse.orientation, expected 2550.19995117, is " << last_msg_.h_ellipse.orientation; - EXPECT_LT((last_msg_.h_ellipse.semi_major * 100 - 8248.20019531 * 100), 0.05) << "incorrect value for last_msg_.h_ellipse.semi_major, expected 8248.20019531, is " << last_msg_.h_ellipse.semi_major; - EXPECT_LT((last_msg_.h_ellipse.semi_minor * 100 - 3202.19995117 * 100), 0.05) << "incorrect value for last_msg_.h_ellipse.semi_minor, expected 3202.19995117, is " << last_msg_.h_ellipse.semi_minor; - EXPECT_LT((last_msg_.height * 100 - 4257.2 * 100), 0.05) << "incorrect value for last_msg_.height, expected 4257.2, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 7563.2 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 7563.2, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - 8494.2 * 100), 0.05) << "incorrect value for last_msg_.lon, expected 8494.2, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 27) << "incorrect value for last_msg_.n_sats, expected 27, is " << last_msg_.n_sats; - EXPECT_LT((last_msg_.orthometric_height * 100 - 4965.2 * 100), 0.05) << "incorrect value for last_msg_.orthometric_height, expected 4965.2, is " << last_msg_.orthometric_height; - EXPECT_EQ(last_msg_.tow, 309229607) << "incorrect value for last_msg_.tow, expected 309229607, is " << last_msg_.tow; - EXPECT_LT((last_msg_.v_accuracy * 100 - 5539.20019531 * 100), 0.05) << "incorrect value for last_msg_.v_accuracy, expected 5539.20019531, is " << last_msg_.v_accuracy; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 7170); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.at_accuracy * 100 - 6297.20019531 * 100), 0.05) + << "incorrect value for last_msg_.at_accuracy, expected 6297.20019531, " + "is " + << last_msg_.at_accuracy; + EXPECT_EQ(last_msg_.confidence_and_geoid, 95) + << "incorrect value for last_msg_.confidence_and_geoid, expected 95, is " + << last_msg_.confidence_and_geoid; + EXPECT_LT((last_msg_.ct_accuracy * 100 - 1948.19995117 * 100), 0.05) + << "incorrect value for last_msg_.ct_accuracy, expected 1948.19995117, " + "is " + << last_msg_.ct_accuracy; + EXPECT_EQ(last_msg_.flags, 72) + << "incorrect value for last_msg_.flags, expected 72, is " + << last_msg_.flags; + EXPECT_LT((last_msg_.h_accuracy * 100 - 2410.19995117 * 100), 0.05) + << "incorrect value for last_msg_.h_accuracy, expected 2410.19995117, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.h_ellipse.orientation * 100 - 2550.19995117 * 100), 0.05) + << "incorrect value for last_msg_.h_ellipse.orientation, expected " + "2550.19995117, is " + << last_msg_.h_ellipse.orientation; + EXPECT_LT((last_msg_.h_ellipse.semi_major * 100 - 8248.20019531 * 100), 0.05) + << "incorrect value for last_msg_.h_ellipse.semi_major, expected " + "8248.20019531, is " + << last_msg_.h_ellipse.semi_major; + EXPECT_LT((last_msg_.h_ellipse.semi_minor * 100 - 3202.19995117 * 100), 0.05) + << "incorrect value for last_msg_.h_ellipse.semi_minor, expected " + "3202.19995117, is " + << last_msg_.h_ellipse.semi_minor; + EXPECT_LT((last_msg_.height * 100 - 4257.2 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 4257.2, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 7563.2 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 7563.2, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - 8494.2 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected 8494.2, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 27) + << "incorrect value for last_msg_.n_sats, expected 27, is " + << last_msg_.n_sats; + EXPECT_LT((last_msg_.orthometric_height * 100 - 4965.2 * 100), 0.05) + << "incorrect value for last_msg_.orthometric_height, expected 4965.2, " + "is " + << last_msg_.orthometric_height; + EXPECT_EQ(last_msg_.tow, 309229607) + << "incorrect value for last_msg_.tow, expected 309229607, is " + << last_msg_.tow; + EXPECT_LT((last_msg_.v_accuracy * 100 - 5539.20019531 * 100), 0.05) + << "incorrect value for last_msg_.v_accuracy, expected 5539.20019531, is " + << last_msg_.v_accuracy; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgPosLlhCovGnss.cc b/c/test/cpp/auto_check_sbp_navigation_MsgPosLlhCovGnss.cc index 686690c4e..e013d8865 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgPosLlhCovGnss.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgPosLlhCovGnss.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhCovGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhCovGnss.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgPosLlhCovGnss0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLlhCovGnss0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgPosLlhCovGnss0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLlhCovGnss0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_cov_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_cov_gnss_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,54 +67,84 @@ class Test_auto_check_sbp_navigation_MsgPosLlhCovGnss0 : sbp_msg_pos_llh_cov_gnss_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLlhCovGnss0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLlhCovGnss0, Test) { + uint8_t encoded_frame[] = { + 85, 49, 2, 0, 16, 54, 24, 229, 233, 29, 73, 123, 28, + 207, 101, 234, 66, 64, 100, 168, 19, 20, 86, 146, 94, 192, + 214, 198, 35, 120, 209, 100, 49, 192, 12, 102, 245, 59, 6, + 181, 192, 185, 168, 79, 243, 58, 96, 60, 148, 59, 253, 58, + 93, 186, 159, 174, 6, 61, 18, 4, 10, 196, + }; - uint8_t encoded_frame[] = {85,49,2,0,16,54,24,229,233,29,73,123,28,207,101,234,66,64,100,168,19,20,86,146,94,192,214,198,35,120,209,100,49,192,12,102,245,59,6,181,192,185,168,79,243,58,96,60,148,59,253,58,93,186,159,174,6,61,18,4,10,196, }; + sbp_msg_pos_llh_cov_gnss_t test_msg{}; + test_msg.cov_d_d = 0.03288137540221214; + test_msg.cov_e_d = -0.0008439270895905793; + test_msg.cov_e_e = 0.004523798823356628; + test_msg.cov_n_d = 0.0018563168123364449; + test_msg.cov_n_e = -0.00036755966721102595; + test_msg.cov_n_n = 0.007488971576094627; + test_msg.flags = 4; + test_msg.height = -17.39382124780135; + test_msg.lat = 37.83123196497633; + test_msg.lon = -122.28650381011681; + test_msg.n_sats = 18; + test_msg.tow = 501867800; - sbp_msg_pos_llh_cov_gnss_t test_msg{}; - test_msg.cov_d_d = 0.03288137540221214; - test_msg.cov_e_d = -0.0008439270895905793; - test_msg.cov_e_e = 0.004523798823356628; - test_msg.cov_n_d = 0.0018563168123364449; - test_msg.cov_n_e = -0.00036755966721102595; - test_msg.cov_n_n = 0.007488971576094627; - test_msg.flags = 4; - test_msg.height = -17.39382124780135; - test_msg.lat = 37.83123196497633; - test_msg.lon = -122.28650381011681; - test_msg.n_sats = 18; - test_msg.tow = 501867800; - - EXPECT_EQ(send_message( 4096, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(4096, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cov_d_d * 100 - 0.0328813754022 * 100), 0.05) << "incorrect value for last_msg_.cov_d_d, expected 0.0328813754022, is " << last_msg_.cov_d_d; - EXPECT_LT((last_msg_.cov_e_d * 100 - -0.000843927089591 * 100), 0.05) << "incorrect value for last_msg_.cov_e_d, expected -0.000843927089591, is " << last_msg_.cov_e_d; - EXPECT_LT((last_msg_.cov_e_e * 100 - 0.00452379882336 * 100), 0.05) << "incorrect value for last_msg_.cov_e_e, expected 0.00452379882336, is " << last_msg_.cov_e_e; - EXPECT_LT((last_msg_.cov_n_d * 100 - 0.00185631681234 * 100), 0.05) << "incorrect value for last_msg_.cov_n_d, expected 0.00185631681234, is " << last_msg_.cov_n_d; - EXPECT_LT((last_msg_.cov_n_e * 100 - -0.000367559667211 * 100), 0.05) << "incorrect value for last_msg_.cov_n_e, expected -0.000367559667211, is " << last_msg_.cov_n_e; - EXPECT_LT((last_msg_.cov_n_n * 100 - 0.00748897157609 * 100), 0.05) << "incorrect value for last_msg_.cov_n_n, expected 0.00748897157609, is " << last_msg_.cov_n_n; - EXPECT_EQ(last_msg_.flags, 4) << "incorrect value for last_msg_.flags, expected 4, is " << last_msg_.flags; - EXPECT_LT((last_msg_.height * 100 - -17.3938212478 * 100), 0.05) << "incorrect value for last_msg_.height, expected -17.3938212478, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.831231965 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.831231965, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -122.28650381 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -122.28650381, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 18) << "incorrect value for last_msg_.n_sats, expected 18, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 501867800) << "incorrect value for last_msg_.tow, expected 501867800, is " << last_msg_.tow; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cov_d_d * 100 - 0.0328813754022 * 100), 0.05) + << "incorrect value for last_msg_.cov_d_d, expected 0.0328813754022, is " + << last_msg_.cov_d_d; + EXPECT_LT((last_msg_.cov_e_d * 100 - -0.000843927089591 * 100), 0.05) + << "incorrect value for last_msg_.cov_e_d, expected -0.000843927089591, " + "is " + << last_msg_.cov_e_d; + EXPECT_LT((last_msg_.cov_e_e * 100 - 0.00452379882336 * 100), 0.05) + << "incorrect value for last_msg_.cov_e_e, expected 0.00452379882336, is " + << last_msg_.cov_e_e; + EXPECT_LT((last_msg_.cov_n_d * 100 - 0.00185631681234 * 100), 0.05) + << "incorrect value for last_msg_.cov_n_d, expected 0.00185631681234, is " + << last_msg_.cov_n_d; + EXPECT_LT((last_msg_.cov_n_e * 100 - -0.000367559667211 * 100), 0.05) + << "incorrect value for last_msg_.cov_n_e, expected -0.000367559667211, " + "is " + << last_msg_.cov_n_e; + EXPECT_LT((last_msg_.cov_n_n * 100 - 0.00748897157609 * 100), 0.05) + << "incorrect value for last_msg_.cov_n_n, expected 0.00748897157609, is " + << last_msg_.cov_n_n; + EXPECT_EQ(last_msg_.flags, 4) + << "incorrect value for last_msg_.flags, expected 4, is " + << last_msg_.flags; + EXPECT_LT((last_msg_.height * 100 - -17.3938212478 * 100), 0.05) + << "incorrect value for last_msg_.height, expected -17.3938212478, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.831231965 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.831231965, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -122.28650381 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -122.28650381, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 18) + << "incorrect value for last_msg_.n_sats, expected 18, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 501867800) + << "incorrect value for last_msg_.tow, expected 501867800, is " + << last_msg_.tow; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgPosLlhGnss.cc b/c/test/cpp/auto_check_sbp_navigation_MsgPosLlhGnss.cc index 1adc9cf02..371cfbec5 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgPosLlhGnss.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgPosLlhGnss.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhGnss.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgPosLlhGnss0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPosLlhGnss0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgPosLlhGnss0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPosLlhGnss0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pos_llh_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pos_llh_gnss_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,46 +67,64 @@ class Test_auto_check_sbp_navigation_MsgPosLlhGnss0 : sbp_msg_pos_llh_gnss_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPosLlhGnss0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgPosLlhGnss0, Test) { + uint8_t encoded_frame[] = { + 85, 42, 2, 0, 16, 34, 24, 229, 233, 29, 73, 123, 28, 207, + 101, 234, 66, 64, 100, 168, 19, 20, 86, 146, 94, 192, 214, 198, + 35, 120, 209, 100, 49, 192, 87, 0, 181, 0, 18, 4, 105, 55, + }; - uint8_t encoded_frame[] = {85,42,2,0,16,34,24,229,233,29,73,123,28,207,101,234,66,64,100,168,19,20,86,146,94,192,214,198,35,120,209,100,49,192,87,0,181,0,18,4,105,55, }; + sbp_msg_pos_llh_gnss_t test_msg{}; + test_msg.flags = 4; + test_msg.h_accuracy = 87; + test_msg.height = -17.39382124780135; + test_msg.lat = 37.83123196497633; + test_msg.lon = -122.28650381011681; + test_msg.n_sats = 18; + test_msg.tow = 501867800; + test_msg.v_accuracy = 181; - sbp_msg_pos_llh_gnss_t test_msg{}; - test_msg.flags = 4; - test_msg.h_accuracy = 87; - test_msg.height = -17.39382124780135; - test_msg.lat = 37.83123196497633; - test_msg.lon = -122.28650381011681; - test_msg.n_sats = 18; - test_msg.tow = 501867800; - test_msg.v_accuracy = 181; - - EXPECT_EQ(send_message( 4096, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(4096, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 4) << "incorrect value for last_msg_.flags, expected 4, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 87) << "incorrect value for last_msg_.h_accuracy, expected 87, is " << last_msg_.h_accuracy; - EXPECT_LT((last_msg_.height * 100 - -17.3938212478 * 100), 0.05) << "incorrect value for last_msg_.height, expected -17.3938212478, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.831231965 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.831231965, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -122.28650381 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -122.28650381, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.n_sats, 18) << "incorrect value for last_msg_.n_sats, expected 18, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 501867800) << "incorrect value for last_msg_.tow, expected 501867800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 181) << "incorrect value for last_msg_.v_accuracy, expected 181, is " << last_msg_.v_accuracy; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 4) + << "incorrect value for last_msg_.flags, expected 4, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 87) + << "incorrect value for last_msg_.h_accuracy, expected 87, is " + << last_msg_.h_accuracy; + EXPECT_LT((last_msg_.height * 100 - -17.3938212478 * 100), 0.05) + << "incorrect value for last_msg_.height, expected -17.3938212478, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.831231965 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.831231965, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -122.28650381 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -122.28650381, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.n_sats, 18) + << "incorrect value for last_msg_.n_sats, expected 18, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 501867800) + << "incorrect value for last_msg_.tow, expected 501867800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 181) + << "incorrect value for last_msg_.v_accuracy, expected 181, is " + << last_msg_.v_accuracy; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgPoseRelative.cc b/c/test/cpp/auto_check_sbp_navigation_MsgPoseRelative.cc index bedb3c129..b2933e587 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgPoseRelative.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgPoseRelative.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPoseRelative.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPoseRelative.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgPoseRelative0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgPoseRelative0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgPoseRelative0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgPoseRelative0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pose_relative_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pose_relative_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,81 +67,135 @@ class Test_auto_check_sbp_navigation_MsgPoseRelative0 : sbp_msg_pose_relative_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgPoseRelative0, Test) -{ +}; - uint8_t encoded_frame[] = {85,69,2,66,0,90,86,4,0,0,0,86,4,0,0,172,8,0,0,76,4,0,0,38,2,0,0,100,0,0,0,100,3,200,204,252,168,157,255,115,53,186,144,190,48,34,37,0,0,128,63,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,128,63,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,5,171,187, }; +TEST_F(Test_auto_check_sbp_navigation_MsgPoseRelative0, Test) { + uint8_t encoded_frame[] = { + 85, 69, 2, 66, 0, 90, 86, 4, 0, 0, 0, 86, 4, 0, + 0, 172, 8, 0, 0, 76, 4, 0, 0, 38, 2, 0, 0, 100, + 0, 0, 0, 100, 3, 200, 204, 252, 168, 157, 255, 115, 53, 186, + 144, 190, 48, 34, 37, 0, 0, 128, 63, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 128, + 63, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 64, 5, 171, 187, + }; - sbp_msg_pose_relative_t test_msg{}; - test_msg.cov_c_x_x = 2.0; - test_msg.cov_c_x_y = 0.0; - test_msg.cov_c_x_z = 0.0; - test_msg.cov_c_y_y = 2.0; - test_msg.cov_c_y_z = 0.0; - test_msg.cov_c_z_z = 2.0; - test_msg.cov_r_x_x = 1.0; - test_msg.cov_r_x_y = 0.0; - test_msg.cov_r_x_z = 0.0; - test_msg.cov_r_y_y = 1.0; - test_msg.cov_r_y_z = 0.0; - test_msg.cov_r_z_z = 1.0; - test_msg.flags = 5; - test_msg.sensor_id = 0; - test_msg.timestamp_1 = 1110; - test_msg.timestamp_2 = 2220; - test_msg.tow = 1110; - - test_msg.trans[0] = 1100; - - test_msg.trans[1] = 550; - - test_msg.trans[2] = 100; - test_msg.w = -859307164; - test_msg.x = -6444804; - test_msg.y = -1866844813; - test_msg.z = 622997694; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + sbp_msg_pose_relative_t test_msg{}; + test_msg.cov_c_x_x = 2.0; + test_msg.cov_c_x_y = 0.0; + test_msg.cov_c_x_z = 0.0; + test_msg.cov_c_y_y = 2.0; + test_msg.cov_c_y_z = 0.0; + test_msg.cov_c_z_z = 2.0; + test_msg.cov_r_x_x = 1.0; + test_msg.cov_r_x_y = 0.0; + test_msg.cov_r_x_z = 0.0; + test_msg.cov_r_y_y = 1.0; + test_msg.cov_r_y_z = 0.0; + test_msg.cov_r_z_z = 1.0; + test_msg.flags = 5; + test_msg.sensor_id = 0; + test_msg.timestamp_1 = 1110; + test_msg.timestamp_2 = 2220; + test_msg.tow = 1110; + + test_msg.trans[0] = 1100; + + test_msg.trans[1] = 550; + + test_msg.trans[2] = 100; + test_msg.w = -859307164; + test_msg.x = -6444804; + test_msg.y = -1866844813; + test_msg.z = 622997694; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cov_c_x_x * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.cov_c_x_x, expected 2.0, is " << last_msg_.cov_c_x_x; - EXPECT_LT((last_msg_.cov_c_x_y * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.cov_c_x_y, expected 0.0, is " << last_msg_.cov_c_x_y; - EXPECT_LT((last_msg_.cov_c_x_z * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.cov_c_x_z, expected 0.0, is " << last_msg_.cov_c_x_z; - EXPECT_LT((last_msg_.cov_c_y_y * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.cov_c_y_y, expected 2.0, is " << last_msg_.cov_c_y_y; - EXPECT_LT((last_msg_.cov_c_y_z * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.cov_c_y_z, expected 0.0, is " << last_msg_.cov_c_y_z; - EXPECT_LT((last_msg_.cov_c_z_z * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.cov_c_z_z, expected 2.0, is " << last_msg_.cov_c_z_z; - EXPECT_LT((last_msg_.cov_r_x_x * 100 - 1.0 * 100), 0.05) << "incorrect value for last_msg_.cov_r_x_x, expected 1.0, is " << last_msg_.cov_r_x_x; - EXPECT_LT((last_msg_.cov_r_x_y * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.cov_r_x_y, expected 0.0, is " << last_msg_.cov_r_x_y; - EXPECT_LT((last_msg_.cov_r_x_z * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.cov_r_x_z, expected 0.0, is " << last_msg_.cov_r_x_z; - EXPECT_LT((last_msg_.cov_r_y_y * 100 - 1.0 * 100), 0.05) << "incorrect value for last_msg_.cov_r_y_y, expected 1.0, is " << last_msg_.cov_r_y_y; - EXPECT_LT((last_msg_.cov_r_y_z * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.cov_r_y_z, expected 0.0, is " << last_msg_.cov_r_y_z; - EXPECT_LT((last_msg_.cov_r_z_z * 100 - 1.0 * 100), 0.05) << "incorrect value for last_msg_.cov_r_z_z, expected 1.0, is " << last_msg_.cov_r_z_z; - EXPECT_EQ(last_msg_.flags, 5) << "incorrect value for last_msg_.flags, expected 5, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.sensor_id, 0) << "incorrect value for last_msg_.sensor_id, expected 0, is " << last_msg_.sensor_id; - EXPECT_EQ(last_msg_.timestamp_1, 1110) << "incorrect value for last_msg_.timestamp_1, expected 1110, is " << last_msg_.timestamp_1; - EXPECT_EQ(last_msg_.timestamp_2, 2220) << "incorrect value for last_msg_.timestamp_2, expected 2220, is " << last_msg_.timestamp_2; - EXPECT_EQ(last_msg_.tow, 1110) << "incorrect value for last_msg_.tow, expected 1110, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.trans[0], 1100) << "incorrect value for last_msg_.trans[0], expected 1100, is " << last_msg_.trans[0]; - EXPECT_EQ(last_msg_.trans[1], 550) << "incorrect value for last_msg_.trans[1], expected 550, is " << last_msg_.trans[1]; - EXPECT_EQ(last_msg_.trans[2], 100) << "incorrect value for last_msg_.trans[2], expected 100, is " << last_msg_.trans[2]; - EXPECT_EQ(last_msg_.w, -859307164) << "incorrect value for last_msg_.w, expected -859307164, is " << last_msg_.w; - EXPECT_EQ(last_msg_.x, -6444804) << "incorrect value for last_msg_.x, expected -6444804, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -1866844813) << "incorrect value for last_msg_.y, expected -1866844813, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 622997694) << "incorrect value for last_msg_.z, expected 622997694, is " << last_msg_.z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cov_c_x_x * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_c_x_x, expected 2.0, is " + << last_msg_.cov_c_x_x; + EXPECT_LT((last_msg_.cov_c_x_y * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_c_x_y, expected 0.0, is " + << last_msg_.cov_c_x_y; + EXPECT_LT((last_msg_.cov_c_x_z * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_c_x_z, expected 0.0, is " + << last_msg_.cov_c_x_z; + EXPECT_LT((last_msg_.cov_c_y_y * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_c_y_y, expected 2.0, is " + << last_msg_.cov_c_y_y; + EXPECT_LT((last_msg_.cov_c_y_z * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_c_y_z, expected 0.0, is " + << last_msg_.cov_c_y_z; + EXPECT_LT((last_msg_.cov_c_z_z * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_c_z_z, expected 2.0, is " + << last_msg_.cov_c_z_z; + EXPECT_LT((last_msg_.cov_r_x_x * 100 - 1.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_r_x_x, expected 1.0, is " + << last_msg_.cov_r_x_x; + EXPECT_LT((last_msg_.cov_r_x_y * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_r_x_y, expected 0.0, is " + << last_msg_.cov_r_x_y; + EXPECT_LT((last_msg_.cov_r_x_z * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_r_x_z, expected 0.0, is " + << last_msg_.cov_r_x_z; + EXPECT_LT((last_msg_.cov_r_y_y * 100 - 1.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_r_y_y, expected 1.0, is " + << last_msg_.cov_r_y_y; + EXPECT_LT((last_msg_.cov_r_y_z * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_r_y_z, expected 0.0, is " + << last_msg_.cov_r_y_z; + EXPECT_LT((last_msg_.cov_r_z_z * 100 - 1.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_r_z_z, expected 1.0, is " + << last_msg_.cov_r_z_z; + EXPECT_EQ(last_msg_.flags, 5) + << "incorrect value for last_msg_.flags, expected 5, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.sensor_id, 0) + << "incorrect value for last_msg_.sensor_id, expected 0, is " + << last_msg_.sensor_id; + EXPECT_EQ(last_msg_.timestamp_1, 1110) + << "incorrect value for last_msg_.timestamp_1, expected 1110, is " + << last_msg_.timestamp_1; + EXPECT_EQ(last_msg_.timestamp_2, 2220) + << "incorrect value for last_msg_.timestamp_2, expected 2220, is " + << last_msg_.timestamp_2; + EXPECT_EQ(last_msg_.tow, 1110) + << "incorrect value for last_msg_.tow, expected 1110, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.trans[0], 1100) + << "incorrect value for last_msg_.trans[0], expected 1100, is " + << last_msg_.trans[0]; + EXPECT_EQ(last_msg_.trans[1], 550) + << "incorrect value for last_msg_.trans[1], expected 550, is " + << last_msg_.trans[1]; + EXPECT_EQ(last_msg_.trans[2], 100) + << "incorrect value for last_msg_.trans[2], expected 100, is " + << last_msg_.trans[2]; + EXPECT_EQ(last_msg_.w, -859307164) + << "incorrect value for last_msg_.w, expected -859307164, is " + << last_msg_.w; + EXPECT_EQ(last_msg_.x, -6444804) + << "incorrect value for last_msg_.x, expected -6444804, is " + << last_msg_.x; + EXPECT_EQ(last_msg_.y, -1866844813) + << "incorrect value for last_msg_.y, expected -1866844813, is " + << last_msg_.y; + EXPECT_EQ(last_msg_.z, 622997694) + << "incorrect value for last_msg_.z, expected 622997694, is " + << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgProtectionLevel.cc b/c/test/cpp/auto_check_sbp_navigation_MsgProtectionLevel.cc index 9723391d7..8d15cf8e7 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgProtectionLevel.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgProtectionLevel.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevel.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevel.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgProtectionLevel0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgProtectionLevel0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgProtectionLevel0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgProtectionLevel0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_protection_level_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_protection_level_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,72 +67,119 @@ class Test_auto_check_sbp_navigation_MsgProtectionLevel0 : sbp_msg_protection_level_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgProtectionLevel0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgProtectionLevel0, Test) { + uint8_t encoded_frame[] = { + 85, 23, 2, 45, 3, 76, 110, 84, 4, 242, 46, 51, 53, 160, + 89, 84, 167, 41, 57, 21, 217, 244, 61, 161, 83, 104, 140, 137, + 90, 246, 51, 51, 51, 51, 51, 170, 180, 64, 154, 153, 153, 153, + 25, 88, 195, 64, 51, 51, 51, 51, 51, 195, 121, 64, 231, 251, + 38, 221, 208, 183, 167, 80, 223, 26, 97, 164, 45, 46, 186, 60, + 235, 227, 183, 160, 187, 93, 116, 224, 105, 40, 32, 33, 133, 188, + }; - uint8_t encoded_frame[] = {85,23,2,45,3,76,110,84,4,242,46,51,53,160,89,84,167,41,57,21,217,244,61,161,83,104,140,137,90,246,51,51,51,51,51,170,180,64,154,153,153,153,25,88,195,64,51,51,51,51,51,195,121,64,231,251,38,221,208,183,167,80,223,26,97,164,45,46,186,60,235,227,183,160,187,93,116,224,105,40,32,33,133,188, }; + sbp_msg_protection_level_t test_msg{}; + test_msg.atpl = 10663; + test_msg.ctpl = 5433; + test_msg.flags = 555755625; + test_msg.heading = -529244741; + test_msg.height = 412.2; + test_msg.hopl = 26707; + test_msg.hpl = 41013; + test_msg.hvpl = 62681; + test_msg.lat = 5290.2; + test_msg.lon = 9904.2; + test_msg.pitch = -1598561301; + test_msg.popl = 35212; + test_msg.roll = 1018834477; + test_msg.ropl = 63066; + test_msg.tow = 4060370030; + test_msg.v_x = -584647705; + test_msg.v_y = 1353168848; + test_msg.v_z = -1537140001; + test_msg.vpl = 21593; + test_msg.vvpl = 41277; + test_msg.wn = 13102; - sbp_msg_protection_level_t test_msg{}; - test_msg.atpl = 10663; - test_msg.ctpl = 5433; - test_msg.flags = 555755625; - test_msg.heading = -529244741; - test_msg.height = 412.2; - test_msg.hopl = 26707; - test_msg.hpl = 41013; - test_msg.hvpl = 62681; - test_msg.lat = 5290.2; - test_msg.lon = 9904.2; - test_msg.pitch = -1598561301; - test_msg.popl = 35212; - test_msg.roll = 1018834477; - test_msg.ropl = 63066; - test_msg.tow = 4060370030; - test_msg.v_x = -584647705; - test_msg.v_y = 1353168848; - test_msg.v_z = -1537140001; - test_msg.vpl = 21593; - test_msg.vvpl = 41277; - test_msg.wn = 13102; - - EXPECT_EQ(send_message( 813, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(813, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 813); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.atpl, 10663) << "incorrect value for last_msg_.atpl, expected 10663, is " << last_msg_.atpl; - EXPECT_EQ(last_msg_.ctpl, 5433) << "incorrect value for last_msg_.ctpl, expected 5433, is " << last_msg_.ctpl; - EXPECT_EQ(last_msg_.flags, 555755625) << "incorrect value for last_msg_.flags, expected 555755625, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.heading, -529244741) << "incorrect value for last_msg_.heading, expected -529244741, is " << last_msg_.heading; - EXPECT_LT((last_msg_.height * 100 - 412.2 * 100), 0.05) << "incorrect value for last_msg_.height, expected 412.2, is " << last_msg_.height; - EXPECT_EQ(last_msg_.hopl, 26707) << "incorrect value for last_msg_.hopl, expected 26707, is " << last_msg_.hopl; - EXPECT_EQ(last_msg_.hpl, 41013) << "incorrect value for last_msg_.hpl, expected 41013, is " << last_msg_.hpl; - EXPECT_EQ(last_msg_.hvpl, 62681) << "incorrect value for last_msg_.hvpl, expected 62681, is " << last_msg_.hvpl; - EXPECT_LT((last_msg_.lat * 100 - 5290.2 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 5290.2, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - 9904.2 * 100), 0.05) << "incorrect value for last_msg_.lon, expected 9904.2, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.pitch, -1598561301) << "incorrect value for last_msg_.pitch, expected -1598561301, is " << last_msg_.pitch; - EXPECT_EQ(last_msg_.popl, 35212) << "incorrect value for last_msg_.popl, expected 35212, is " << last_msg_.popl; - EXPECT_EQ(last_msg_.roll, 1018834477) << "incorrect value for last_msg_.roll, expected 1018834477, is " << last_msg_.roll; - EXPECT_EQ(last_msg_.ropl, 63066) << "incorrect value for last_msg_.ropl, expected 63066, is " << last_msg_.ropl; - EXPECT_EQ(last_msg_.tow, 4060370030) << "incorrect value for last_msg_.tow, expected 4060370030, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_x, -584647705) << "incorrect value for last_msg_.v_x, expected -584647705, is " << last_msg_.v_x; - EXPECT_EQ(last_msg_.v_y, 1353168848) << "incorrect value for last_msg_.v_y, expected 1353168848, is " << last_msg_.v_y; - EXPECT_EQ(last_msg_.v_z, -1537140001) << "incorrect value for last_msg_.v_z, expected -1537140001, is " << last_msg_.v_z; - EXPECT_EQ(last_msg_.vpl, 21593) << "incorrect value for last_msg_.vpl, expected 21593, is " << last_msg_.vpl; - EXPECT_EQ(last_msg_.vvpl, 41277) << "incorrect value for last_msg_.vvpl, expected 41277, is " << last_msg_.vvpl; - EXPECT_EQ(last_msg_.wn, 13102) << "incorrect value for last_msg_.wn, expected 13102, is " << last_msg_.wn; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 813); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.atpl, 10663) + << "incorrect value for last_msg_.atpl, expected 10663, is " + << last_msg_.atpl; + EXPECT_EQ(last_msg_.ctpl, 5433) + << "incorrect value for last_msg_.ctpl, expected 5433, is " + << last_msg_.ctpl; + EXPECT_EQ(last_msg_.flags, 555755625) + << "incorrect value for last_msg_.flags, expected 555755625, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.heading, -529244741) + << "incorrect value for last_msg_.heading, expected -529244741, is " + << last_msg_.heading; + EXPECT_LT((last_msg_.height * 100 - 412.2 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 412.2, is " + << last_msg_.height; + EXPECT_EQ(last_msg_.hopl, 26707) + << "incorrect value for last_msg_.hopl, expected 26707, is " + << last_msg_.hopl; + EXPECT_EQ(last_msg_.hpl, 41013) + << "incorrect value for last_msg_.hpl, expected 41013, is " + << last_msg_.hpl; + EXPECT_EQ(last_msg_.hvpl, 62681) + << "incorrect value for last_msg_.hvpl, expected 62681, is " + << last_msg_.hvpl; + EXPECT_LT((last_msg_.lat * 100 - 5290.2 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 5290.2, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - 9904.2 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected 9904.2, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.pitch, -1598561301) + << "incorrect value for last_msg_.pitch, expected -1598561301, is " + << last_msg_.pitch; + EXPECT_EQ(last_msg_.popl, 35212) + << "incorrect value for last_msg_.popl, expected 35212, is " + << last_msg_.popl; + EXPECT_EQ(last_msg_.roll, 1018834477) + << "incorrect value for last_msg_.roll, expected 1018834477, is " + << last_msg_.roll; + EXPECT_EQ(last_msg_.ropl, 63066) + << "incorrect value for last_msg_.ropl, expected 63066, is " + << last_msg_.ropl; + EXPECT_EQ(last_msg_.tow, 4060370030) + << "incorrect value for last_msg_.tow, expected 4060370030, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_x, -584647705) + << "incorrect value for last_msg_.v_x, expected -584647705, is " + << last_msg_.v_x; + EXPECT_EQ(last_msg_.v_y, 1353168848) + << "incorrect value for last_msg_.v_y, expected 1353168848, is " + << last_msg_.v_y; + EXPECT_EQ(last_msg_.v_z, -1537140001) + << "incorrect value for last_msg_.v_z, expected -1537140001, is " + << last_msg_.v_z; + EXPECT_EQ(last_msg_.vpl, 21593) + << "incorrect value for last_msg_.vpl, expected 21593, is " + << last_msg_.vpl; + EXPECT_EQ(last_msg_.vvpl, 41277) + << "incorrect value for last_msg_.vvpl, expected 41277, is " + << last_msg_.vvpl; + EXPECT_EQ(last_msg_.wn, 13102) + << "incorrect value for last_msg_.wn, expected 13102, is " + << last_msg_.wn; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgProtectionLevelDepA.cc b/c/test/cpp/auto_check_sbp_navigation_MsgProtectionLevelDepA.cc index 440cc30e4..8a7e41259 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgProtectionLevelDepA.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgProtectionLevelDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevelDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevelDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgProtectionLevelDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgProtectionLevelDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgProtectionLevelDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgProtectionLevelDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_protection_level_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_protection_level_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,44 +67,60 @@ class Test_auto_check_sbp_navigation_MsgProtectionLevelDepA0 : sbp_msg_protection_level_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgProtectionLevelDepA0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgProtectionLevelDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 22, 2, 148, 22, 33, 52, 126, 69, 185, 47, 85, 4, 139, + 51, 51, 51, 51, 51, 244, 190, 64, 102, 102, 102, 102, 102, 204, + 168, 64, 154, 153, 153, 153, 25, 39, 192, 64, 248, 81, 104, + }; - uint8_t encoded_frame[] = {85,22,2,148,22,33,52,126,69,185,47,85,4,139,51,51,51,51,51,244,190,64,102,102,102,102,102,204,168,64,154,153,153,153,25,39,192,64,248,81,104, }; + sbp_msg_protection_level_dep_a_t test_msg{}; + test_msg.flags = 248; + test_msg.height = 8270.2; + test_msg.hpl = 35588; + test_msg.lat = 7924.2; + test_msg.lon = 3174.2; + test_msg.tow = 3108339252; + test_msg.vpl = 21807; - sbp_msg_protection_level_dep_a_t test_msg{}; - test_msg.flags = 248; - test_msg.height = 8270.2; - test_msg.hpl = 35588; - test_msg.lat = 7924.2; - test_msg.lon = 3174.2; - test_msg.tow = 3108339252; - test_msg.vpl = 21807; - - EXPECT_EQ(send_message( 5780, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(5780, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 5780); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 248) << "incorrect value for last_msg_.flags, expected 248, is " << last_msg_.flags; - EXPECT_LT((last_msg_.height * 100 - 8270.2 * 100), 0.05) << "incorrect value for last_msg_.height, expected 8270.2, is " << last_msg_.height; - EXPECT_EQ(last_msg_.hpl, 35588) << "incorrect value for last_msg_.hpl, expected 35588, is " << last_msg_.hpl; - EXPECT_LT((last_msg_.lat * 100 - 7924.2 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 7924.2, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - 3174.2 * 100), 0.05) << "incorrect value for last_msg_.lon, expected 3174.2, is " << last_msg_.lon; - EXPECT_EQ(last_msg_.tow, 3108339252) << "incorrect value for last_msg_.tow, expected 3108339252, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.vpl, 21807) << "incorrect value for last_msg_.vpl, expected 21807, is " << last_msg_.vpl; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 5780); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 248) + << "incorrect value for last_msg_.flags, expected 248, is " + << last_msg_.flags; + EXPECT_LT((last_msg_.height * 100 - 8270.2 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 8270.2, is " + << last_msg_.height; + EXPECT_EQ(last_msg_.hpl, 35588) + << "incorrect value for last_msg_.hpl, expected 35588, is " + << last_msg_.hpl; + EXPECT_LT((last_msg_.lat * 100 - 7924.2 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 7924.2, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - 3174.2 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected 3174.2, is " + << last_msg_.lon; + EXPECT_EQ(last_msg_.tow, 3108339252) + << "incorrect value for last_msg_.tow, expected 3108339252, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.vpl, 21807) + << "incorrect value for last_msg_.vpl, expected 21807, is " + << last_msg_.vpl; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgReferenceFrameParam.cc b/c/test/cpp/auto_check_sbp_navigation_MsgReferenceFrameParam.cc index 2925e4516..5b11ca773 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgReferenceFrameParam.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgReferenceFrameParam.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgReferenceFrameParam.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgReferenceFrameParam.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgReferenceFrameParam0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgReferenceFrameParam0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgReferenceFrameParam0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgReferenceFrameParam0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_reference_frame_param_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_reference_frame_param_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,82 +67,147 @@ class Test_auto_check_sbp_navigation_MsgReferenceFrameParam0 : sbp_msg_reference_frame_param_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgReferenceFrameParam0, Test) -{ +}; - uint8_t encoded_frame[] = {85,68,2,66,0,124,1,102,111,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,98,97,114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,0,6,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,6,161, }; +TEST_F(Test_auto_check_sbp_navigation_MsgReferenceFrameParam0, Test) { + uint8_t encoded_frame[] = { + 85, 68, 2, 66, 0, 124, 1, 102, 111, 111, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 98, 97, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 4, 5, 0, 6, 0, 7, 0, 0, 0, 8, 0, 0, 0, 9, + 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 12, 0, 0, 0, 13, 0, + 0, 0, 14, 0, 0, 0, 15, 0, 0, 0, 16, 0, 0, 0, 17, 0, 0, + 0, 18, 0, 0, 0, 19, 0, 0, 0, 20, 0, 6, 161, + }; - sbp_msg_reference_frame_param_t test_msg{}; - test_msg.delta_X0 = 7; - test_msg.delta_Y0 = 8; - test_msg.delta_Z0 = 9; - test_msg.dot_delta_X0 = 14; - test_msg.dot_delta_Y0 = 15; - test_msg.dot_delta_Z0 = 16; - test_msg.dot_scale = 20; - test_msg.dot_theta_01 = 17; - test_msg.dot_theta_02 = 18; - test_msg.dot_theta_03 = 19; - test_msg.re_t0 = 6; - test_msg.scale = 13; - test_msg.sin = 4; - { - const char assign_string[] = { (char)102,(char)111,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.sn, assign_string, sizeof(assign_string)); - } - test_msg.ssr_iod = 1; - test_msg.theta_01 = 10; - test_msg.theta_02 = 11; - test_msg.theta_03 = 12; - { - const char assign_string[] = { (char)98,(char)97,(char)114,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.tn, assign_string, sizeof(assign_string)); - } - test_msg.utn = 5; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + sbp_msg_reference_frame_param_t test_msg{}; + test_msg.delta_X0 = 7; + test_msg.delta_Y0 = 8; + test_msg.delta_Z0 = 9; + test_msg.dot_delta_X0 = 14; + test_msg.dot_delta_Y0 = 15; + test_msg.dot_delta_Z0 = 16; + test_msg.dot_scale = 20; + test_msg.dot_theta_01 = 17; + test_msg.dot_theta_02 = 18; + test_msg.dot_theta_03 = 19; + test_msg.re_t0 = 6; + test_msg.scale = 13; + test_msg.sin = 4; + { + const char assign_string[] = { + (char)102, (char)111, (char)111, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.sn, assign_string, sizeof(assign_string)); + } + test_msg.ssr_iod = 1; + test_msg.theta_01 = 10; + test_msg.theta_02 = 11; + test_msg.theta_03 = 12; + { + const char assign_string[] = { + (char)98, (char)97, (char)114, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.tn, assign_string, sizeof(assign_string)); + } + test_msg.utn = 5; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.delta_X0, 7) << "incorrect value for last_msg_.delta_X0, expected 7, is " << last_msg_.delta_X0; - EXPECT_EQ(last_msg_.delta_Y0, 8) << "incorrect value for last_msg_.delta_Y0, expected 8, is " << last_msg_.delta_Y0; - EXPECT_EQ(last_msg_.delta_Z0, 9) << "incorrect value for last_msg_.delta_Z0, expected 9, is " << last_msg_.delta_Z0; - EXPECT_EQ(last_msg_.dot_delta_X0, 14) << "incorrect value for last_msg_.dot_delta_X0, expected 14, is " << last_msg_.dot_delta_X0; - EXPECT_EQ(last_msg_.dot_delta_Y0, 15) << "incorrect value for last_msg_.dot_delta_Y0, expected 15, is " << last_msg_.dot_delta_Y0; - EXPECT_EQ(last_msg_.dot_delta_Z0, 16) << "incorrect value for last_msg_.dot_delta_Z0, expected 16, is " << last_msg_.dot_delta_Z0; - EXPECT_EQ(last_msg_.dot_scale, 20) << "incorrect value for last_msg_.dot_scale, expected 20, is " << last_msg_.dot_scale; - EXPECT_EQ(last_msg_.dot_theta_01, 17) << "incorrect value for last_msg_.dot_theta_01, expected 17, is " << last_msg_.dot_theta_01; - EXPECT_EQ(last_msg_.dot_theta_02, 18) << "incorrect value for last_msg_.dot_theta_02, expected 18, is " << last_msg_.dot_theta_02; - EXPECT_EQ(last_msg_.dot_theta_03, 19) << "incorrect value for last_msg_.dot_theta_03, expected 19, is " << last_msg_.dot_theta_03; - EXPECT_EQ(last_msg_.re_t0, 6) << "incorrect value for last_msg_.re_t0, expected 6, is " << last_msg_.re_t0; - EXPECT_EQ(last_msg_.scale, 13) << "incorrect value for last_msg_.scale, expected 13, is " << last_msg_.scale; - EXPECT_EQ(last_msg_.sin, 4) << "incorrect value for last_msg_.sin, expected 4, is " << last_msg_.sin; - { - const char check_string[] = { (char)102,(char)111,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.sn, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.sn, expected string '" << check_string << "', is '" << last_msg_.sn << "'"; - } - EXPECT_EQ(last_msg_.ssr_iod, 1) << "incorrect value for last_msg_.ssr_iod, expected 1, is " << last_msg_.ssr_iod; - EXPECT_EQ(last_msg_.theta_01, 10) << "incorrect value for last_msg_.theta_01, expected 10, is " << last_msg_.theta_01; - EXPECT_EQ(last_msg_.theta_02, 11) << "incorrect value for last_msg_.theta_02, expected 11, is " << last_msg_.theta_02; - EXPECT_EQ(last_msg_.theta_03, 12) << "incorrect value for last_msg_.theta_03, expected 12, is " << last_msg_.theta_03; - { - const char check_string[] = { (char)98,(char)97,(char)114,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.tn, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.tn, expected string '" << check_string << "', is '" << last_msg_.tn << "'"; - } - EXPECT_EQ(last_msg_.utn, 5) << "incorrect value for last_msg_.utn, expected 5, is " << last_msg_.utn; + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.delta_X0, 7) + << "incorrect value for last_msg_.delta_X0, expected 7, is " + << last_msg_.delta_X0; + EXPECT_EQ(last_msg_.delta_Y0, 8) + << "incorrect value for last_msg_.delta_Y0, expected 8, is " + << last_msg_.delta_Y0; + EXPECT_EQ(last_msg_.delta_Z0, 9) + << "incorrect value for last_msg_.delta_Z0, expected 9, is " + << last_msg_.delta_Z0; + EXPECT_EQ(last_msg_.dot_delta_X0, 14) + << "incorrect value for last_msg_.dot_delta_X0, expected 14, is " + << last_msg_.dot_delta_X0; + EXPECT_EQ(last_msg_.dot_delta_Y0, 15) + << "incorrect value for last_msg_.dot_delta_Y0, expected 15, is " + << last_msg_.dot_delta_Y0; + EXPECT_EQ(last_msg_.dot_delta_Z0, 16) + << "incorrect value for last_msg_.dot_delta_Z0, expected 16, is " + << last_msg_.dot_delta_Z0; + EXPECT_EQ(last_msg_.dot_scale, 20) + << "incorrect value for last_msg_.dot_scale, expected 20, is " + << last_msg_.dot_scale; + EXPECT_EQ(last_msg_.dot_theta_01, 17) + << "incorrect value for last_msg_.dot_theta_01, expected 17, is " + << last_msg_.dot_theta_01; + EXPECT_EQ(last_msg_.dot_theta_02, 18) + << "incorrect value for last_msg_.dot_theta_02, expected 18, is " + << last_msg_.dot_theta_02; + EXPECT_EQ(last_msg_.dot_theta_03, 19) + << "incorrect value for last_msg_.dot_theta_03, expected 19, is " + << last_msg_.dot_theta_03; + EXPECT_EQ(last_msg_.re_t0, 6) + << "incorrect value for last_msg_.re_t0, expected 6, is " + << last_msg_.re_t0; + EXPECT_EQ(last_msg_.scale, 13) + << "incorrect value for last_msg_.scale, expected 13, is " + << last_msg_.scale; + EXPECT_EQ(last_msg_.sin, 4) + << "incorrect value for last_msg_.sin, expected 4, is " << last_msg_.sin; + { + const char check_string[] = { + (char)102, (char)111, (char)111, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.sn, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.sn, expected string '" << check_string + << "', is '" << last_msg_.sn << "'"; + } + EXPECT_EQ(last_msg_.ssr_iod, 1) + << "incorrect value for last_msg_.ssr_iod, expected 1, is " + << last_msg_.ssr_iod; + EXPECT_EQ(last_msg_.theta_01, 10) + << "incorrect value for last_msg_.theta_01, expected 10, is " + << last_msg_.theta_01; + EXPECT_EQ(last_msg_.theta_02, 11) + << "incorrect value for last_msg_.theta_02, expected 11, is " + << last_msg_.theta_02; + EXPECT_EQ(last_msg_.theta_03, 12) + << "incorrect value for last_msg_.theta_03, expected 12, is " + << last_msg_.theta_03; + { + const char check_string[] = { + (char)98, (char)97, (char)114, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.tn, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.tn, expected string '" << check_string + << "', is '" << last_msg_.tn << "'"; + } + EXPECT_EQ(last_msg_.utn, 5) + << "incorrect value for last_msg_.utn, expected 5, is " << last_msg_.utn; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgUTCLeapSecond.cc b/c/test/cpp/auto_check_sbp_navigation_MsgUTCLeapSecond.cc index a15cb8473..16181641f 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgUTCLeapSecond.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgUTCLeapSecond.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCLeapSecond.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCLeapSecond.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgUTCLeapSecond0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgUTCLeapSecond0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgUTCLeapSecond0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgUTCLeapSecond0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_utc_leap_second_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_utc_leap_second_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,48 +67,66 @@ class Test_auto_check_sbp_navigation_MsgUTCLeapSecond0 : sbp_msg_utc_leap_second_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgUTCLeapSecond0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgUTCLeapSecond0, Test) { + uint8_t encoded_frame[] = { + 85, 58, 2, 66, 0, 14, 1, 0, 2, 0, 3, 4, 5, 0, 6, 0, 7, 0, 8, 9, 50, 232, + }; - uint8_t encoded_frame[] = {85,58,2,66,0,14,1,0,2,0,3,4,5,0,6,0,7,0,8,9,50,232, }; + sbp_msg_utc_leap_second_t test_msg{}; + test_msg.count_after = 9; + test_msg.count_before = 4; + test_msg.ref_dn = 8; + test_msg.ref_wn = 7; + test_msg.reserved_0 = 1; + test_msg.reserved_1 = 2; + test_msg.reserved_2 = 3; + test_msg.reserved_3 = 5; + test_msg.reserved_4 = 6; - sbp_msg_utc_leap_second_t test_msg{}; - test_msg.count_after = 9; - test_msg.count_before = 4; - test_msg.ref_dn = 8; - test_msg.ref_wn = 7; - test_msg.reserved_0 = 1; - test_msg.reserved_1 = 2; - test_msg.reserved_2 = 3; - test_msg.reserved_3 = 5; - test_msg.reserved_4 = 6; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.count_after, 9) << "incorrect value for last_msg_.count_after, expected 9, is " << last_msg_.count_after; - EXPECT_EQ(last_msg_.count_before, 4) << "incorrect value for last_msg_.count_before, expected 4, is " << last_msg_.count_before; - EXPECT_EQ(last_msg_.ref_dn, 8) << "incorrect value for last_msg_.ref_dn, expected 8, is " << last_msg_.ref_dn; - EXPECT_EQ(last_msg_.ref_wn, 7) << "incorrect value for last_msg_.ref_wn, expected 7, is " << last_msg_.ref_wn; - EXPECT_EQ(last_msg_.reserved_0, 1) << "incorrect value for last_msg_.reserved_0, expected 1, is " << last_msg_.reserved_0; - EXPECT_EQ(last_msg_.reserved_1, 2) << "incorrect value for last_msg_.reserved_1, expected 2, is " << last_msg_.reserved_1; - EXPECT_EQ(last_msg_.reserved_2, 3) << "incorrect value for last_msg_.reserved_2, expected 3, is " << last_msg_.reserved_2; - EXPECT_EQ(last_msg_.reserved_3, 5) << "incorrect value for last_msg_.reserved_3, expected 5, is " << last_msg_.reserved_3; - EXPECT_EQ(last_msg_.reserved_4, 6) << "incorrect value for last_msg_.reserved_4, expected 6, is " << last_msg_.reserved_4; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.count_after, 9) + << "incorrect value for last_msg_.count_after, expected 9, is " + << last_msg_.count_after; + EXPECT_EQ(last_msg_.count_before, 4) + << "incorrect value for last_msg_.count_before, expected 4, is " + << last_msg_.count_before; + EXPECT_EQ(last_msg_.ref_dn, 8) + << "incorrect value for last_msg_.ref_dn, expected 8, is " + << last_msg_.ref_dn; + EXPECT_EQ(last_msg_.ref_wn, 7) + << "incorrect value for last_msg_.ref_wn, expected 7, is " + << last_msg_.ref_wn; + EXPECT_EQ(last_msg_.reserved_0, 1) + << "incorrect value for last_msg_.reserved_0, expected 1, is " + << last_msg_.reserved_0; + EXPECT_EQ(last_msg_.reserved_1, 2) + << "incorrect value for last_msg_.reserved_1, expected 2, is " + << last_msg_.reserved_1; + EXPECT_EQ(last_msg_.reserved_2, 3) + << "incorrect value for last_msg_.reserved_2, expected 3, is " + << last_msg_.reserved_2; + EXPECT_EQ(last_msg_.reserved_3, 5) + << "incorrect value for last_msg_.reserved_3, expected 5, is " + << last_msg_.reserved_3; + EXPECT_EQ(last_msg_.reserved_4, 6) + << "incorrect value for last_msg_.reserved_4, expected 6, is " + << last_msg_.reserved_4; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgUTCTime.cc b/c/test/cpp/auto_check_sbp_navigation_MsgUTCTime.cc index 0d1960117..ba9dac766 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgUTCTime.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgUTCTime.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTime.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgUTCTime0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgUTCTime0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgUTCTime0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgUTCTime0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_utc_time_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_utc_time_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,48 +67,66 @@ class Test_auto_check_sbp_navigation_MsgUTCTime0 : sbp_msg_utc_time_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgUTCTime0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgUTCTime0, Test) { + uint8_t encoded_frame[] = { + 85, 3, 1, 21, 3, 16, 1, 24, 229, 233, 29, 229, + 7, 4, 9, 19, 24, 9, 0, 8, 175, 47, 199, 253, + }; - uint8_t encoded_frame[] = {85,3,1,21,3,16,1,24,229,233,29,229,7,4,9,19,24,9,0,8,175,47,199,253, }; + sbp_msg_utc_time_t test_msg{}; + test_msg.day = 9; + test_msg.flags = 1; + test_msg.hours = 19; + test_msg.minutes = 24; + test_msg.month = 4; + test_msg.ns = 800000000; + test_msg.seconds = 9; + test_msg.tow = 501867800; + test_msg.year = 2021; - sbp_msg_utc_time_t test_msg{}; - test_msg.day = 9; - test_msg.flags = 1; - test_msg.hours = 19; - test_msg.minutes = 24; - test_msg.month = 4; - test_msg.ns = 800000000; - test_msg.seconds = 9; - test_msg.tow = 501867800; - test_msg.year = 2021; - - EXPECT_EQ(send_message( 789, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(789, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 789); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.day, 9) << "incorrect value for last_msg_.day, expected 9, is " << last_msg_.day; - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.hours, 19) << "incorrect value for last_msg_.hours, expected 19, is " << last_msg_.hours; - EXPECT_EQ(last_msg_.minutes, 24) << "incorrect value for last_msg_.minutes, expected 24, is " << last_msg_.minutes; - EXPECT_EQ(last_msg_.month, 4) << "incorrect value for last_msg_.month, expected 4, is " << last_msg_.month; - EXPECT_EQ(last_msg_.ns, 800000000) << "incorrect value for last_msg_.ns, expected 800000000, is " << last_msg_.ns; - EXPECT_EQ(last_msg_.seconds, 9) << "incorrect value for last_msg_.seconds, expected 9, is " << last_msg_.seconds; - EXPECT_EQ(last_msg_.tow, 501867800) << "incorrect value for last_msg_.tow, expected 501867800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.year, 2021) << "incorrect value for last_msg_.year, expected 2021, is " << last_msg_.year; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 789); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.day, 9) + << "incorrect value for last_msg_.day, expected 9, is " << last_msg_.day; + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.hours, 19) + << "incorrect value for last_msg_.hours, expected 19, is " + << last_msg_.hours; + EXPECT_EQ(last_msg_.minutes, 24) + << "incorrect value for last_msg_.minutes, expected 24, is " + << last_msg_.minutes; + EXPECT_EQ(last_msg_.month, 4) + << "incorrect value for last_msg_.month, expected 4, is " + << last_msg_.month; + EXPECT_EQ(last_msg_.ns, 800000000) + << "incorrect value for last_msg_.ns, expected 800000000, is " + << last_msg_.ns; + EXPECT_EQ(last_msg_.seconds, 9) + << "incorrect value for last_msg_.seconds, expected 9, is " + << last_msg_.seconds; + EXPECT_EQ(last_msg_.tow, 501867800) + << "incorrect value for last_msg_.tow, expected 501867800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.year, 2021) + << "incorrect value for last_msg_.year, expected 2021, is " + << last_msg_.year; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgUTCTimeGNSS.cc b/c/test/cpp/auto_check_sbp_navigation_MsgUTCTimeGNSS.cc index efa41ee31..5f9bb6fbd 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgUTCTimeGNSS.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgUTCTimeGNSS.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTimeGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTimeGNSS.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgUTCTimeGNSS0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgUTCTimeGNSS0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgUTCTimeGNSS0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgUTCTimeGNSS0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_utc_time_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_utc_time_gnss_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,48 +67,66 @@ class Test_auto_check_sbp_navigation_MsgUTCTimeGNSS0 : sbp_msg_utc_time_gnss_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgUTCTimeGNSS0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgUTCTimeGNSS0, Test) { + uint8_t encoded_frame[] = { + 85, 5, 1, 21, 3, 16, 1, 24, 229, 233, 29, 229, + 7, 4, 9, 19, 24, 9, 0, 8, 175, 47, 177, 33, + }; - uint8_t encoded_frame[] = {85,5,1,21,3,16,1,24,229,233,29,229,7,4,9,19,24,9,0,8,175,47,177,33, }; + sbp_msg_utc_time_gnss_t test_msg{}; + test_msg.day = 9; + test_msg.flags = 1; + test_msg.hours = 19; + test_msg.minutes = 24; + test_msg.month = 4; + test_msg.ns = 800000000; + test_msg.seconds = 9; + test_msg.tow = 501867800; + test_msg.year = 2021; - sbp_msg_utc_time_gnss_t test_msg{}; - test_msg.day = 9; - test_msg.flags = 1; - test_msg.hours = 19; - test_msg.minutes = 24; - test_msg.month = 4; - test_msg.ns = 800000000; - test_msg.seconds = 9; - test_msg.tow = 501867800; - test_msg.year = 2021; - - EXPECT_EQ(send_message( 789, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(789, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 789); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.day, 9) << "incorrect value for last_msg_.day, expected 9, is " << last_msg_.day; - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.hours, 19) << "incorrect value for last_msg_.hours, expected 19, is " << last_msg_.hours; - EXPECT_EQ(last_msg_.minutes, 24) << "incorrect value for last_msg_.minutes, expected 24, is " << last_msg_.minutes; - EXPECT_EQ(last_msg_.month, 4) << "incorrect value for last_msg_.month, expected 4, is " << last_msg_.month; - EXPECT_EQ(last_msg_.ns, 800000000) << "incorrect value for last_msg_.ns, expected 800000000, is " << last_msg_.ns; - EXPECT_EQ(last_msg_.seconds, 9) << "incorrect value for last_msg_.seconds, expected 9, is " << last_msg_.seconds; - EXPECT_EQ(last_msg_.tow, 501867800) << "incorrect value for last_msg_.tow, expected 501867800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.year, 2021) << "incorrect value for last_msg_.year, expected 2021, is " << last_msg_.year; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 789); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.day, 9) + << "incorrect value for last_msg_.day, expected 9, is " << last_msg_.day; + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.hours, 19) + << "incorrect value for last_msg_.hours, expected 19, is " + << last_msg_.hours; + EXPECT_EQ(last_msg_.minutes, 24) + << "incorrect value for last_msg_.minutes, expected 24, is " + << last_msg_.minutes; + EXPECT_EQ(last_msg_.month, 4) + << "incorrect value for last_msg_.month, expected 4, is " + << last_msg_.month; + EXPECT_EQ(last_msg_.ns, 800000000) + << "incorrect value for last_msg_.ns, expected 800000000, is " + << last_msg_.ns; + EXPECT_EQ(last_msg_.seconds, 9) + << "incorrect value for last_msg_.seconds, expected 9, is " + << last_msg_.seconds; + EXPECT_EQ(last_msg_.tow, 501867800) + << "incorrect value for last_msg_.tow, expected 501867800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.year, 2021) + << "incorrect value for last_msg_.year, expected 2021, is " + << last_msg_.year; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgVelBody.cc b/c/test/cpp/auto_check_sbp_navigation_MsgVelBody.cc index 79906bf2e..eb7ad89ac 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgVelBody.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgVelBody.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelBody.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelBody.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgVelBody0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelBody0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgVelBody0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelBody0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_body_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_body_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,54 +67,76 @@ class Test_auto_check_sbp_navigation_MsgVelBody0 : sbp_msg_vel_body_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelBody0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelBody0, Test) { + uint8_t encoded_frame[] = { + 85, 19, 2, 66, 0, 42, 1, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 224, 64, + 0, 0, 224, 64, 0, 0, 64, 64, 0, 0, 0, 64, 3, 8, 120, 144, + }; - uint8_t encoded_frame[] = {85,19,2,66,0,42,1,0,0,0,4,0,0,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,160,64,0,0,224,64,0,0,224,64,0,0,64,64,0,0,0,64,3,8,120,144, }; + sbp_msg_vel_body_t test_msg{}; + test_msg.cov_x_x = 0.0; + test_msg.cov_x_y = 5.0; + test_msg.cov_x_z = 7.0; + test_msg.cov_y_y = 7.0; + test_msg.cov_y_z = 3.0; + test_msg.cov_z_z = 2.0; + test_msg.flags = 8; + test_msg.n_sats = 3; + test_msg.tow = 1; + test_msg.x = 4; + test_msg.y = 2; + test_msg.z = 1; - sbp_msg_vel_body_t test_msg{}; - test_msg.cov_x_x = 0.0; - test_msg.cov_x_y = 5.0; - test_msg.cov_x_z = 7.0; - test_msg.cov_y_y = 7.0; - test_msg.cov_y_z = 3.0; - test_msg.cov_z_z = 2.0; - test_msg.flags = 8; - test_msg.n_sats = 3; - test_msg.tow = 1; - test_msg.x = 4; - test_msg.y = 2; - test_msg.z = 1; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cov_x_x * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.cov_x_x, expected 0.0, is " << last_msg_.cov_x_x; - EXPECT_LT((last_msg_.cov_x_y * 100 - 5.0 * 100), 0.05) << "incorrect value for last_msg_.cov_x_y, expected 5.0, is " << last_msg_.cov_x_y; - EXPECT_LT((last_msg_.cov_x_z * 100 - 7.0 * 100), 0.05) << "incorrect value for last_msg_.cov_x_z, expected 7.0, is " << last_msg_.cov_x_z; - EXPECT_LT((last_msg_.cov_y_y * 100 - 7.0 * 100), 0.05) << "incorrect value for last_msg_.cov_y_y, expected 7.0, is " << last_msg_.cov_y_y; - EXPECT_LT((last_msg_.cov_y_z * 100 - 3.0 * 100), 0.05) << "incorrect value for last_msg_.cov_y_z, expected 3.0, is " << last_msg_.cov_y_z; - EXPECT_LT((last_msg_.cov_z_z * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.cov_z_z, expected 2.0, is " << last_msg_.cov_z_z; - EXPECT_EQ(last_msg_.flags, 8) << "incorrect value for last_msg_.flags, expected 8, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 3) << "incorrect value for last_msg_.n_sats, expected 3, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 1) << "incorrect value for last_msg_.tow, expected 1, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, 4) << "incorrect value for last_msg_.x, expected 4, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, 2) << "incorrect value for last_msg_.y, expected 2, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 1) << "incorrect value for last_msg_.z, expected 1, is " << last_msg_.z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cov_x_x * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_x_x, expected 0.0, is " + << last_msg_.cov_x_x; + EXPECT_LT((last_msg_.cov_x_y * 100 - 5.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_x_y, expected 5.0, is " + << last_msg_.cov_x_y; + EXPECT_LT((last_msg_.cov_x_z * 100 - 7.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_x_z, expected 7.0, is " + << last_msg_.cov_x_z; + EXPECT_LT((last_msg_.cov_y_y * 100 - 7.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_y_y, expected 7.0, is " + << last_msg_.cov_y_y; + EXPECT_LT((last_msg_.cov_y_z * 100 - 3.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_y_z, expected 3.0, is " + << last_msg_.cov_y_z; + EXPECT_LT((last_msg_.cov_z_z * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_z_z, expected 2.0, is " + << last_msg_.cov_z_z; + EXPECT_EQ(last_msg_.flags, 8) + << "incorrect value for last_msg_.flags, expected 8, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 3) + << "incorrect value for last_msg_.n_sats, expected 3, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 1) + << "incorrect value for last_msg_.tow, expected 1, is " << last_msg_.tow; + EXPECT_EQ(last_msg_.x, 4) + << "incorrect value for last_msg_.x, expected 4, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, 2) + << "incorrect value for last_msg_.y, expected 2, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 1) + << "incorrect value for last_msg_.z, expected 1, is " << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgVelCog.cc b/c/test/cpp/auto_check_sbp_navigation_MsgVelCog.cc index cf6be1da7..597c8defd 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgVelCog.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgVelCog.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelCog.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelCog.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgVelCog0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelCog0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgVelCog0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelCog0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_cog_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_cog_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,96 +67,108 @@ class Test_auto_check_sbp_navigation_MsgVelCog0 : sbp_msg_vel_cog_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelCog0, Test) -{ - - uint8_t encoded_frame[] = {85,28,2,211,136,30,48,246,122,19,232,3,0,0,208,7,0,0,184,11,0,0,160,15,0,0,136,19,0,0,112,23,0,0,62,0,212,193, }; - - sbp_msg_vel_cog_t test_msg{}; - test_msg.cog = 1000; - test_msg.cog_accuracy = 4000; - test_msg.flags = 62; - test_msg.sog = 2000; - test_msg.sog_accuracy = 5000; - test_msg.tow = 326825520; - test_msg.v_up = 3000; - test_msg.v_up_accuracy = 6000; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cog, 1000) << "incorrect value for last_msg_.cog, expected 1000, is " << last_msg_.cog; - EXPECT_EQ(last_msg_.cog_accuracy, 4000) << "incorrect value for last_msg_.cog_accuracy, expected 4000, is " << last_msg_.cog_accuracy; - EXPECT_EQ(last_msg_.flags, 62) << "incorrect value for last_msg_.flags, expected 62, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.sog, 2000) << "incorrect value for last_msg_.sog, expected 2000, is " << last_msg_.sog; - EXPECT_EQ(last_msg_.sog_accuracy, 5000) << "incorrect value for last_msg_.sog_accuracy, expected 5000, is " << last_msg_.sog_accuracy; - EXPECT_EQ(last_msg_.tow, 326825520) << "incorrect value for last_msg_.tow, expected 326825520, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_up, 3000) << "incorrect value for last_msg_.v_up, expected 3000, is " << last_msg_.v_up; - EXPECT_EQ(last_msg_.v_up_accuracy, 6000) << "incorrect value for last_msg_.v_up_accuracy, expected 6000, is " << last_msg_.v_up_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelCog0, Test) { + uint8_t encoded_frame[] = { + 85, 28, 2, 211, 136, 30, 48, 246, 122, 19, 232, 3, 0, + 0, 208, 7, 0, 0, 184, 11, 0, 0, 160, 15, 0, 0, + 136, 19, 0, 0, 112, 23, 0, 0, 62, 0, 212, 193, + }; + + sbp_msg_vel_cog_t test_msg{}; + test_msg.cog = 1000; + test_msg.cog_accuracy = 4000; + test_msg.flags = 62; + test_msg.sog = 2000; + test_msg.sog_accuracy = 5000; + test_msg.tow = 326825520; + test_msg.v_up = 3000; + test_msg.v_up_accuracy = 6000; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cog, 1000) + << "incorrect value for last_msg_.cog, expected 1000, is " + << last_msg_.cog; + EXPECT_EQ(last_msg_.cog_accuracy, 4000) + << "incorrect value for last_msg_.cog_accuracy, expected 4000, is " + << last_msg_.cog_accuracy; + EXPECT_EQ(last_msg_.flags, 62) + << "incorrect value for last_msg_.flags, expected 62, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.sog, 2000) + << "incorrect value for last_msg_.sog, expected 2000, is " + << last_msg_.sog; + EXPECT_EQ(last_msg_.sog_accuracy, 5000) + << "incorrect value for last_msg_.sog_accuracy, expected 5000, is " + << last_msg_.sog_accuracy; + EXPECT_EQ(last_msg_.tow, 326825520) + << "incorrect value for last_msg_.tow, expected 326825520, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_up, 3000) + << "incorrect value for last_msg_.v_up, expected 3000, is " + << last_msg_.v_up; + EXPECT_EQ(last_msg_.v_up_accuracy, 6000) + << "incorrect value for last_msg_.v_up_accuracy, expected 6000, is " + << last_msg_.v_up_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelCog1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelCog1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelCog1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelCog1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_cog_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_cog_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -168,96 +176,108 @@ class Test_auto_check_sbp_navigation_MsgVelCog1 : sbp_msg_vel_cog_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelCog1, Test) -{ - - uint8_t encoded_frame[] = {85,28,2,211,136,30,48,246,122,19,123,0,0,0,200,1,0,0,24,252,255,255,0,149,186,10,100,0,0,0,100,0,0,0,0,0,90,114, }; - - sbp_msg_vel_cog_t test_msg{}; - test_msg.cog = 123; - test_msg.cog_accuracy = 180000000; - test_msg.flags = 0; - test_msg.sog = 456; - test_msg.sog_accuracy = 100; - test_msg.tow = 326825520; - test_msg.v_up = -1000; - test_msg.v_up_accuracy = 100; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cog, 123) << "incorrect value for last_msg_.cog, expected 123, is " << last_msg_.cog; - EXPECT_EQ(last_msg_.cog_accuracy, 180000000) << "incorrect value for last_msg_.cog_accuracy, expected 180000000, is " << last_msg_.cog_accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.sog, 456) << "incorrect value for last_msg_.sog, expected 456, is " << last_msg_.sog; - EXPECT_EQ(last_msg_.sog_accuracy, 100) << "incorrect value for last_msg_.sog_accuracy, expected 100, is " << last_msg_.sog_accuracy; - EXPECT_EQ(last_msg_.tow, 326825520) << "incorrect value for last_msg_.tow, expected 326825520, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_up, -1000) << "incorrect value for last_msg_.v_up, expected -1000, is " << last_msg_.v_up; - EXPECT_EQ(last_msg_.v_up_accuracy, 100) << "incorrect value for last_msg_.v_up_accuracy, expected 100, is " << last_msg_.v_up_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelCog1, Test) { + uint8_t encoded_frame[] = { + 85, 28, 2, 211, 136, 30, 48, 246, 122, 19, 123, 0, 0, + 0, 200, 1, 0, 0, 24, 252, 255, 255, 0, 149, 186, 10, + 100, 0, 0, 0, 100, 0, 0, 0, 0, 0, 90, 114, + }; + + sbp_msg_vel_cog_t test_msg{}; + test_msg.cog = 123; + test_msg.cog_accuracy = 180000000; + test_msg.flags = 0; + test_msg.sog = 456; + test_msg.sog_accuracy = 100; + test_msg.tow = 326825520; + test_msg.v_up = -1000; + test_msg.v_up_accuracy = 100; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cog, 123) + << "incorrect value for last_msg_.cog, expected 123, is " + << last_msg_.cog; + EXPECT_EQ(last_msg_.cog_accuracy, 180000000) + << "incorrect value for last_msg_.cog_accuracy, expected 180000000, is " + << last_msg_.cog_accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.sog, 456) + << "incorrect value for last_msg_.sog, expected 456, is " + << last_msg_.sog; + EXPECT_EQ(last_msg_.sog_accuracy, 100) + << "incorrect value for last_msg_.sog_accuracy, expected 100, is " + << last_msg_.sog_accuracy; + EXPECT_EQ(last_msg_.tow, 326825520) + << "incorrect value for last_msg_.tow, expected 326825520, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_up, -1000) + << "incorrect value for last_msg_.v_up, expected -1000, is " + << last_msg_.v_up; + EXPECT_EQ(last_msg_.v_up_accuracy, 100) + << "incorrect value for last_msg_.v_up_accuracy, expected 100, is " + << last_msg_.v_up_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelCog2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelCog2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelCog2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelCog2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_cog_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_cog_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -265,46 +285,61 @@ class Test_auto_check_sbp_navigation_MsgVelCog2 : sbp_msg_vel_cog_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelCog2, Test) -{ - - uint8_t encoded_frame[] = {85,28,2,211,136,30,48,246,122,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,210, }; - - sbp_msg_vel_cog_t test_msg{}; - test_msg.cog = 0; - test_msg.cog_accuracy = 0; - test_msg.flags = 0; - test_msg.sog = 0; - test_msg.sog_accuracy = 0; - test_msg.tow = 326825520; - test_msg.v_up = 0; - test_msg.v_up_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cog, 0) << "incorrect value for last_msg_.cog, expected 0, is " << last_msg_.cog; - EXPECT_EQ(last_msg_.cog_accuracy, 0) << "incorrect value for last_msg_.cog_accuracy, expected 0, is " << last_msg_.cog_accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.sog, 0) << "incorrect value for last_msg_.sog, expected 0, is " << last_msg_.sog; - EXPECT_EQ(last_msg_.sog_accuracy, 0) << "incorrect value for last_msg_.sog_accuracy, expected 0, is " << last_msg_.sog_accuracy; - EXPECT_EQ(last_msg_.tow, 326825520) << "incorrect value for last_msg_.tow, expected 326825520, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_up, 0) << "incorrect value for last_msg_.v_up, expected 0, is " << last_msg_.v_up; - EXPECT_EQ(last_msg_.v_up_accuracy, 0) << "incorrect value for last_msg_.v_up_accuracy, expected 0, is " << last_msg_.v_up_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelCog2, Test) { + uint8_t encoded_frame[] = { + 85, 28, 2, 211, 136, 30, 48, 246, 122, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 210, + }; + + sbp_msg_vel_cog_t test_msg{}; + test_msg.cog = 0; + test_msg.cog_accuracy = 0; + test_msg.flags = 0; + test_msg.sog = 0; + test_msg.sog_accuracy = 0; + test_msg.tow = 326825520; + test_msg.v_up = 0; + test_msg.v_up_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cog, 0) + << "incorrect value for last_msg_.cog, expected 0, is " << last_msg_.cog; + EXPECT_EQ(last_msg_.cog_accuracy, 0) + << "incorrect value for last_msg_.cog_accuracy, expected 0, is " + << last_msg_.cog_accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.sog, 0) + << "incorrect value for last_msg_.sog, expected 0, is " << last_msg_.sog; + EXPECT_EQ(last_msg_.sog_accuracy, 0) + << "incorrect value for last_msg_.sog_accuracy, expected 0, is " + << last_msg_.sog_accuracy; + EXPECT_EQ(last_msg_.tow, 326825520) + << "incorrect value for last_msg_.tow, expected 326825520, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_up, 0) + << "incorrect value for last_msg_.v_up, expected 0, is " + << last_msg_.v_up; + EXPECT_EQ(last_msg_.v_up_accuracy, 0) + << "incorrect value for last_msg_.v_up_accuracy, expected 0, is " + << last_msg_.v_up_accuracy; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgVelECEF.cc b/c/test/cpp/auto_check_sbp_navigation_MsgVelECEF.cc index 1cb7dcabe..f174fe5a0 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgVelECEF.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgVelECEF.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEF.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgVelECEF0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEF0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgVelECEF0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEF0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,94 +67,100 @@ class Test_auto_check_sbp_navigation_MsgVelECEF0 : sbp_msg_vel_ecef_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEF0, Test) -{ - - uint8_t encoded_frame[] = {85,13,2,211,136,20,40,244,122,19,248,255,255,255,251,255,255,255,10,0,0,0,0,0,14,0,181,99, }; - - sbp_msg_vel_ecef_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 14; - test_msg.tow = 326825000; - test_msg.x = -8; - test_msg.y = -5; - test_msg.z = 10; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 14) << "incorrect value for last_msg_.n_sats, expected 14, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326825000) << "incorrect value for last_msg_.tow, expected 326825000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -8) << "incorrect value for last_msg_.x, expected -8, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -5) << "incorrect value for last_msg_.y, expected -5, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 10) << "incorrect value for last_msg_.z, expected 10, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEF0, Test) { + uint8_t encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 40, 244, 122, 19, 248, 255, 255, 255, + 251, 255, 255, 255, 10, 0, 0, 0, 0, 0, 14, 0, 181, 99, + }; + + sbp_msg_vel_ecef_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 14; + test_msg.tow = 326825000; + test_msg.x = -8; + test_msg.y = -5; + test_msg.z = 10; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 14) + << "incorrect value for last_msg_.n_sats, expected 14, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326825000) + << "incorrect value for last_msg_.tow, expected 326825000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -8) + << "incorrect value for last_msg_.x, expected -8, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -5) + << "incorrect value for last_msg_.y, expected -5, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 10) + << "incorrect value for last_msg_.z, expected 10, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgVelECEF1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEF1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelECEF1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEF1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -166,94 +168,100 @@ class Test_auto_check_sbp_navigation_MsgVelECEF1 : sbp_msg_vel_ecef_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEF1, Test) -{ - - uint8_t encoded_frame[] = {85,13,2,211,136,20,28,246,122,19,244,255,255,255,238,255,255,255,11,0,0,0,0,0,15,0,215,120, }; - - sbp_msg_vel_ecef_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 15; - test_msg.tow = 326825500; - test_msg.x = -12; - test_msg.y = -18; - test_msg.z = 11; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326825500) << "incorrect value for last_msg_.tow, expected 326825500, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -12) << "incorrect value for last_msg_.x, expected -12, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -18) << "incorrect value for last_msg_.y, expected -18, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 11) << "incorrect value for last_msg_.z, expected 11, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEF1, Test) { + uint8_t encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 28, 246, 122, 19, 244, 255, 255, 255, + 238, 255, 255, 255, 11, 0, 0, 0, 0, 0, 15, 0, 215, 120, + }; + + sbp_msg_vel_ecef_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 15; + test_msg.tow = 326825500; + test_msg.x = -12; + test_msg.y = -18; + test_msg.z = 11; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326825500) + << "incorrect value for last_msg_.tow, expected 326825500, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -12) + << "incorrect value for last_msg_.x, expected -12, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -18) + << "incorrect value for last_msg_.y, expected -18, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 11) + << "incorrect value for last_msg_.z, expected 11, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgVelECEF2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEF2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelECEF2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEF2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -261,94 +269,100 @@ class Test_auto_check_sbp_navigation_MsgVelECEF2 : sbp_msg_vel_ecef_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEF2, Test) -{ - - uint8_t encoded_frame[] = {85,13,2,211,136,20,16,248,122,19,248,255,255,255,250,255,255,255,7,0,0,0,0,0,15,0,248,221, }; - - sbp_msg_vel_ecef_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 15; - test_msg.tow = 326826000; - test_msg.x = -8; - test_msg.y = -6; - test_msg.z = 7; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326826000) << "incorrect value for last_msg_.tow, expected 326826000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -8) << "incorrect value for last_msg_.x, expected -8, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -6) << "incorrect value for last_msg_.y, expected -6, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 7) << "incorrect value for last_msg_.z, expected 7, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEF2, Test) { + uint8_t encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 16, 248, 122, 19, 248, 255, 255, 255, + 250, 255, 255, 255, 7, 0, 0, 0, 0, 0, 15, 0, 248, 221, + }; + + sbp_msg_vel_ecef_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 15; + test_msg.tow = 326826000; + test_msg.x = -8; + test_msg.y = -6; + test_msg.z = 7; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326826000) + << "incorrect value for last_msg_.tow, expected 326826000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -8) + << "incorrect value for last_msg_.x, expected -8, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -6) + << "incorrect value for last_msg_.y, expected -6, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 7) + << "incorrect value for last_msg_.z, expected 7, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgVelECEF3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEF3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelECEF3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEF3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -356,94 +370,100 @@ class Test_auto_check_sbp_navigation_MsgVelECEF3 : sbp_msg_vel_ecef_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEF3, Test) -{ - - uint8_t encoded_frame[] = {85,13,2,211,136,20,4,250,122,19,249,255,255,255,239,255,255,255,16,0,0,0,0,0,15,0,1,167, }; - - sbp_msg_vel_ecef_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 15; - test_msg.tow = 326826500; - test_msg.x = -7; - test_msg.y = -17; - test_msg.z = 16; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326826500) << "incorrect value for last_msg_.tow, expected 326826500, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -7) << "incorrect value for last_msg_.x, expected -7, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -17) << "incorrect value for last_msg_.y, expected -17, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 16) << "incorrect value for last_msg_.z, expected 16, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEF3, Test) { + uint8_t encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 4, 250, 122, 19, 249, 255, 255, 255, + 239, 255, 255, 255, 16, 0, 0, 0, 0, 0, 15, 0, 1, 167, + }; + + sbp_msg_vel_ecef_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 15; + test_msg.tow = 326826500; + test_msg.x = -7; + test_msg.y = -17; + test_msg.z = 16; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326826500) + << "incorrect value for last_msg_.tow, expected 326826500, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -7) + << "incorrect value for last_msg_.x, expected -7, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -17) + << "incorrect value for last_msg_.y, expected -17, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 16) + << "incorrect value for last_msg_.z, expected 16, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgVelECEF4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEF4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelECEF4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEF4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -451,44 +471,56 @@ class Test_auto_check_sbp_navigation_MsgVelECEF4 : sbp_msg_vel_ecef_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEF4, Test) -{ - - uint8_t encoded_frame[] = {85,13,2,211,136,20,248,251,122,19,247,255,255,255,243,255,255,255,14,0,0,0,0,0,15,0,191,43, }; - - sbp_msg_vel_ecef_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 15; - test_msg.tow = 326827000; - test_msg.x = -9; - test_msg.y = -13; - test_msg.z = 14; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326827000) << "incorrect value for last_msg_.tow, expected 326827000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -9) << "incorrect value for last_msg_.x, expected -9, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -13) << "incorrect value for last_msg_.y, expected -13, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 14) << "incorrect value for last_msg_.z, expected 14, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEF4, Test) { + uint8_t encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 248, 251, 122, 19, 247, 255, 255, 255, + 243, 255, 255, 255, 14, 0, 0, 0, 0, 0, 15, 0, 191, 43, + }; + + sbp_msg_vel_ecef_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 15; + test_msg.tow = 326827000; + test_msg.x = -9; + test_msg.y = -13; + test_msg.z = 14; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326827000) + << "incorrect value for last_msg_.tow, expected 326827000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -9) + << "incorrect value for last_msg_.x, expected -9, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -13) + << "incorrect value for last_msg_.y, expected -13, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 14) + << "incorrect value for last_msg_.z, expected 14, is " << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgVelECEFCov.cc b/c/test/cpp/auto_check_sbp_navigation_MsgVelECEFCov.cc index 242fd8c69..166bff017 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgVelECEFCov.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgVelECEFCov.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFCov.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFCov.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgVelECEFCov0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEFCov0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgVelECEFCov0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEFCov0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_cov_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_cov_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,54 +67,76 @@ class Test_auto_check_sbp_navigation_MsgVelECEFCov0 : sbp_msg_vel_ecef_cov_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFCov0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFCov0, Test) { + uint8_t encoded_frame[] = { + 85, 21, 2, 66, 0, 42, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0, 64, + 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 64, 64, 3, 4, 91, 254, + }; - uint8_t encoded_frame[] = {85,21,2,66,0,42,2,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,64,0,0,0,64,0,0,0,64,0,0,0,64,0,0,128,63,0,0,64,64,3,4,91,254, }; + sbp_msg_vel_ecef_cov_t test_msg{}; + test_msg.cov_x_x = 2.0; + test_msg.cov_x_y = 2.0; + test_msg.cov_x_z = 2.0; + test_msg.cov_y_y = 2.0; + test_msg.cov_y_z = 1.0; + test_msg.cov_z_z = 3.0; + test_msg.flags = 4; + test_msg.n_sats = 3; + test_msg.tow = 2; + test_msg.x = 0; + test_msg.y = 0; + test_msg.z = 6; - sbp_msg_vel_ecef_cov_t test_msg{}; - test_msg.cov_x_x = 2.0; - test_msg.cov_x_y = 2.0; - test_msg.cov_x_z = 2.0; - test_msg.cov_y_y = 2.0; - test_msg.cov_y_z = 1.0; - test_msg.cov_z_z = 3.0; - test_msg.flags = 4; - test_msg.n_sats = 3; - test_msg.tow = 2; - test_msg.x = 0; - test_msg.y = 0; - test_msg.z = 6; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cov_x_x * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.cov_x_x, expected 2.0, is " << last_msg_.cov_x_x; - EXPECT_LT((last_msg_.cov_x_y * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.cov_x_y, expected 2.0, is " << last_msg_.cov_x_y; - EXPECT_LT((last_msg_.cov_x_z * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.cov_x_z, expected 2.0, is " << last_msg_.cov_x_z; - EXPECT_LT((last_msg_.cov_y_y * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.cov_y_y, expected 2.0, is " << last_msg_.cov_y_y; - EXPECT_LT((last_msg_.cov_y_z * 100 - 1.0 * 100), 0.05) << "incorrect value for last_msg_.cov_y_z, expected 1.0, is " << last_msg_.cov_y_z; - EXPECT_LT((last_msg_.cov_z_z * 100 - 3.0 * 100), 0.05) << "incorrect value for last_msg_.cov_z_z, expected 3.0, is " << last_msg_.cov_z_z; - EXPECT_EQ(last_msg_.flags, 4) << "incorrect value for last_msg_.flags, expected 4, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 3) << "incorrect value for last_msg_.n_sats, expected 3, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2) << "incorrect value for last_msg_.tow, expected 2, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, 0) << "incorrect value for last_msg_.x, expected 0, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, 0) << "incorrect value for last_msg_.y, expected 0, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 6) << "incorrect value for last_msg_.z, expected 6, is " << last_msg_.z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cov_x_x * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_x_x, expected 2.0, is " + << last_msg_.cov_x_x; + EXPECT_LT((last_msg_.cov_x_y * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_x_y, expected 2.0, is " + << last_msg_.cov_x_y; + EXPECT_LT((last_msg_.cov_x_z * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_x_z, expected 2.0, is " + << last_msg_.cov_x_z; + EXPECT_LT((last_msg_.cov_y_y * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_y_y, expected 2.0, is " + << last_msg_.cov_y_y; + EXPECT_LT((last_msg_.cov_y_z * 100 - 1.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_y_z, expected 1.0, is " + << last_msg_.cov_y_z; + EXPECT_LT((last_msg_.cov_z_z * 100 - 3.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_z_z, expected 3.0, is " + << last_msg_.cov_z_z; + EXPECT_EQ(last_msg_.flags, 4) + << "incorrect value for last_msg_.flags, expected 4, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 3) + << "incorrect value for last_msg_.n_sats, expected 3, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2) + << "incorrect value for last_msg_.tow, expected 2, is " << last_msg_.tow; + EXPECT_EQ(last_msg_.x, 0) + << "incorrect value for last_msg_.x, expected 0, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, 0) + << "incorrect value for last_msg_.y, expected 0, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 6) + << "incorrect value for last_msg_.z, expected 6, is " << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgVelECEFDepA.cc b/c/test/cpp/auto_check_sbp_navigation_MsgVelECEFDepA.cc index eab10c5c3..c12ce5ab9 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgVelECEFDepA.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgVelECEFDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgVelECEFDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEFDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgVelECEFDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEFDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,94 +67,100 @@ class Test_auto_check_sbp_navigation_MsgVelECEFDepA0 : sbp_msg_vel_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,246,215,20,20,46,39,0,218,11,0,0,134,245,255,255,163,252,255,255,0,0,9,0,80,236, }; - - sbp_msg_vel_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 9; - test_msg.tow = 2567700; - test_msg.x = 3034; - test_msg.y = -2682; - test_msg.z = -861; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567700) << "incorrect value for last_msg_.tow, expected 2567700, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, 3034) << "incorrect value for last_msg_.x, expected 3034, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -2682) << "incorrect value for last_msg_.y, expected -2682, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, -861) << "incorrect value for last_msg_.z, expected -861, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 20, 46, 39, 0, 218, 11, 0, 0, + 134, 245, 255, 255, 163, 252, 255, 255, 0, 0, 9, 0, 80, 236, + }; + + sbp_msg_vel_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 9; + test_msg.tow = 2567700; + test_msg.x = 3034; + test_msg.y = -2682; + test_msg.z = -861; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567700) + << "incorrect value for last_msg_.tow, expected 2567700, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, 3034) + << "incorrect value for last_msg_.x, expected 3034, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -2682) + << "incorrect value for last_msg_.y, expected -2682, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, -861) + << "incorrect value for last_msg_.z, expected -861, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgVelECEFDepA1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEFDepA1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelECEFDepA1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEFDepA1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -166,94 +168,100 @@ class Test_auto_check_sbp_navigation_MsgVelECEFDepA1 : sbp_msg_vel_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,246,215,20,120,46,39,0,68,11,0,0,24,246,255,255,220,252,255,255,0,0,9,0,248,138, }; - - sbp_msg_vel_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 9; - test_msg.tow = 2567800; - test_msg.x = 2884; - test_msg.y = -2536; - test_msg.z = -804; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567800) << "incorrect value for last_msg_.tow, expected 2567800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, 2884) << "incorrect value for last_msg_.x, expected 2884, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -2536) << "incorrect value for last_msg_.y, expected -2536, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, -804) << "incorrect value for last_msg_.z, expected -804, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 120, 46, 39, 0, 68, 11, 0, 0, + 24, 246, 255, 255, 220, 252, 255, 255, 0, 0, 9, 0, 248, 138, + }; + + sbp_msg_vel_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 9; + test_msg.tow = 2567800; + test_msg.x = 2884; + test_msg.y = -2536; + test_msg.z = -804; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567800) + << "incorrect value for last_msg_.tow, expected 2567800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, 2884) + << "incorrect value for last_msg_.x, expected 2884, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -2536) + << "incorrect value for last_msg_.y, expected -2536, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, -804) + << "incorrect value for last_msg_.z, expected -804, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgVelECEFDepA2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEFDepA2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelECEFDepA2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEFDepA2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -261,94 +269,100 @@ class Test_auto_check_sbp_navigation_MsgVelECEFDepA2 : sbp_msg_vel_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,246,215,20,220,46,39,0,21,11,0,0,77,246,255,255,247,252,255,255,0,0,9,0,25,174, }; - - sbp_msg_vel_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 9; - test_msg.tow = 2567900; - test_msg.x = 2837; - test_msg.y = -2483; - test_msg.z = -777; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567900) << "incorrect value for last_msg_.tow, expected 2567900, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, 2837) << "incorrect value for last_msg_.x, expected 2837, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -2483) << "incorrect value for last_msg_.y, expected -2483, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, -777) << "incorrect value for last_msg_.z, expected -777, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 220, 46, 39, 0, 21, 11, 0, 0, + 77, 246, 255, 255, 247, 252, 255, 255, 0, 0, 9, 0, 25, 174, + }; + + sbp_msg_vel_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 9; + test_msg.tow = 2567900; + test_msg.x = 2837; + test_msg.y = -2483; + test_msg.z = -777; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567900) + << "incorrect value for last_msg_.tow, expected 2567900, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, 2837) + << "incorrect value for last_msg_.x, expected 2837, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -2483) + << "incorrect value for last_msg_.y, expected -2483, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, -777) + << "incorrect value for last_msg_.z, expected -777, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgVelECEFDepA3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEFDepA3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelECEFDepA3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEFDepA3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -356,94 +370,100 @@ class Test_auto_check_sbp_navigation_MsgVelECEFDepA3 : sbp_msg_vel_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,246,215,20,64,47,39,0,121,11,0,0,2,246,255,255,234,252,255,255,0,0,9,0,195,228, }; - - sbp_msg_vel_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 9; - test_msg.tow = 2568000; - test_msg.x = 2937; - test_msg.y = -2558; - test_msg.z = -790; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2568000) << "incorrect value for last_msg_.tow, expected 2568000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, 2937) << "incorrect value for last_msg_.x, expected 2937, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -2558) << "incorrect value for last_msg_.y, expected -2558, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, -790) << "incorrect value for last_msg_.z, expected -790, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 64, 47, 39, 0, 121, 11, 0, 0, + 2, 246, 255, 255, 234, 252, 255, 255, 0, 0, 9, 0, 195, 228, + }; + + sbp_msg_vel_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 9; + test_msg.tow = 2568000; + test_msg.x = 2937; + test_msg.y = -2558; + test_msg.z = -790; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2568000) + << "incorrect value for last_msg_.tow, expected 2568000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, 2937) + << "incorrect value for last_msg_.x, expected 2937, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -2558) + << "incorrect value for last_msg_.y, expected -2558, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, -790) + << "incorrect value for last_msg_.z, expected -790, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgVelECEFDepA4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEFDepA4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelECEFDepA4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEFDepA4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -451,94 +471,100 @@ class Test_auto_check_sbp_navigation_MsgVelECEFDepA4 : sbp_msg_vel_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,246,215,20,164,47,39,0,31,11,0,0,93,246,255,255,16,253,255,255,0,0,9,0,219,164, }; - - sbp_msg_vel_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 9; - test_msg.tow = 2568100; - test_msg.x = 2847; - test_msg.y = -2467; - test_msg.z = -752; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2568100) << "incorrect value for last_msg_.tow, expected 2568100, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, 2847) << "incorrect value for last_msg_.x, expected 2847, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -2467) << "incorrect value for last_msg_.y, expected -2467, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, -752) << "incorrect value for last_msg_.z, expected -752, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 164, 47, 39, 0, 31, 11, 0, 0, + 93, 246, 255, 255, 16, 253, 255, 255, 0, 0, 9, 0, 219, 164, + }; + + sbp_msg_vel_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 9; + test_msg.tow = 2568100; + test_msg.x = 2847; + test_msg.y = -2467; + test_msg.z = -752; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2568100) + << "incorrect value for last_msg_.tow, expected 2568100, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, 2847) + << "incorrect value for last_msg_.x, expected 2847, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -2467) + << "incorrect value for last_msg_.y, expected -2467, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, -752) + << "incorrect value for last_msg_.z, expected -752, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgVelECEFDepA5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEFDepA5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelECEFDepA5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEFDepA5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -546,94 +572,100 @@ class Test_auto_check_sbp_navigation_MsgVelECEFDepA5 : sbp_msg_vel_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,195,4,20,212,157,67,24,24,0,0,0,245,255,255,255,219,255,255,255,0,0,8,0,68,255, }; - - sbp_msg_vel_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 8; - test_msg.tow = 407084500; - test_msg.x = 24; - test_msg.y = -11; - test_msg.z = -37; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084500) << "incorrect value for last_msg_.tow, expected 407084500, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, 24) << "incorrect value for last_msg_.x, expected 24, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -11) << "incorrect value for last_msg_.y, expected -11, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, -37) << "incorrect value for last_msg_.z, expected -37, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 212, 157, 67, 24, 24, 0, 0, 0, + 245, 255, 255, 255, 219, 255, 255, 255, 0, 0, 8, 0, 68, 255, + }; + + sbp_msg_vel_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 8; + test_msg.tow = 407084500; + test_msg.x = 24; + test_msg.y = -11; + test_msg.z = -37; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084500) + << "incorrect value for last_msg_.tow, expected 407084500, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, 24) + << "incorrect value for last_msg_.x, expected 24, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -11) + << "incorrect value for last_msg_.y, expected -11, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, -37) + << "incorrect value for last_msg_.z, expected -37, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgVelECEFDepA6 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEFDepA6() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelECEFDepA6 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEFDepA6() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -641,94 +673,100 @@ class Test_auto_check_sbp_navigation_MsgVelECEFDepA6 : sbp_msg_vel_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,195,4,20,56,158,67,24,4,0,0,0,234,255,255,255,18,0,0,0,0,0,8,0,214,136, }; - - sbp_msg_vel_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 8; - test_msg.tow = 407084600; - test_msg.x = 4; - test_msg.y = -22; - test_msg.z = 18; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084600) << "incorrect value for last_msg_.tow, expected 407084600, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, 4) << "incorrect value for last_msg_.x, expected 4, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -22) << "incorrect value for last_msg_.y, expected -22, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 18) << "incorrect value for last_msg_.z, expected 18, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 56, 158, 67, 24, 4, 0, 0, 0, + 234, 255, 255, 255, 18, 0, 0, 0, 0, 0, 8, 0, 214, 136, + }; + + sbp_msg_vel_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 8; + test_msg.tow = 407084600; + test_msg.x = 4; + test_msg.y = -22; + test_msg.z = 18; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084600) + << "incorrect value for last_msg_.tow, expected 407084600, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, 4) + << "incorrect value for last_msg_.x, expected 4, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -22) + << "incorrect value for last_msg_.y, expected -22, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 18) + << "incorrect value for last_msg_.z, expected 18, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgVelECEFDepA7 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEFDepA7() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelECEFDepA7 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEFDepA7() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -736,94 +774,100 @@ class Test_auto_check_sbp_navigation_MsgVelECEFDepA7 : sbp_msg_vel_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,195,4,20,156,158,67,24,230,255,255,255,4,0,0,0,1,0,0,0,0,0,8,0,122,159, }; - - sbp_msg_vel_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 8; - test_msg.tow = 407084700; - test_msg.x = -26; - test_msg.y = 4; - test_msg.z = 1; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084700) << "incorrect value for last_msg_.tow, expected 407084700, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -26) << "incorrect value for last_msg_.x, expected -26, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, 4) << "incorrect value for last_msg_.y, expected 4, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 1) << "incorrect value for last_msg_.z, expected 1, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 156, 158, 67, 24, 230, 255, 255, 255, + 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8, 0, 122, 159, + }; + + sbp_msg_vel_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 8; + test_msg.tow = 407084700; + test_msg.x = -26; + test_msg.y = 4; + test_msg.z = 1; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084700) + << "incorrect value for last_msg_.tow, expected 407084700, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -26) + << "incorrect value for last_msg_.x, expected -26, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, 4) + << "incorrect value for last_msg_.y, expected 4, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 1) + << "incorrect value for last_msg_.z, expected 1, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgVelECEFDepA8 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEFDepA8() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelECEFDepA8 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEFDepA8() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -831,94 +875,100 @@ class Test_auto_check_sbp_navigation_MsgVelECEFDepA8 : sbp_msg_vel_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,195,4,20,0,159,67,24,247,255,255,255,237,255,255,255,28,0,0,0,0,0,8,0,232,146, }; - - sbp_msg_vel_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 8; - test_msg.tow = 407084800; - test_msg.x = -9; - test_msg.y = -19; - test_msg.z = 28; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084800) << "incorrect value for last_msg_.tow, expected 407084800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -9) << "incorrect value for last_msg_.x, expected -9, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -19) << "incorrect value for last_msg_.y, expected -19, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 28) << "incorrect value for last_msg_.z, expected 28, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 0, 159, 67, 24, 247, 255, 255, 255, + 237, 255, 255, 255, 28, 0, 0, 0, 0, 0, 8, 0, 232, 146, + }; + + sbp_msg_vel_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 8; + test_msg.tow = 407084800; + test_msg.x = -9; + test_msg.y = -19; + test_msg.z = 28; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084800) + << "incorrect value for last_msg_.tow, expected 407084800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -9) + << "incorrect value for last_msg_.x, expected -9, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -19) + << "incorrect value for last_msg_.y, expected -19, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 28) + << "incorrect value for last_msg_.z, expected 28, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgVelECEFDepA9 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEFDepA9() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelECEFDepA9 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEFDepA9() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -926,94 +976,100 @@ class Test_auto_check_sbp_navigation_MsgVelECEFDepA9 : sbp_msg_vel_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA9, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,195,4,20,100,159,67,24,255,255,255,255,2,0,0,0,245,255,255,255,0,0,8,0,171,238, }; - - sbp_msg_vel_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 8; - test_msg.tow = 407084900; - test_msg.x = -1; - test_msg.y = 2; - test_msg.z = -11; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084900) << "incorrect value for last_msg_.tow, expected 407084900, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -1) << "incorrect value for last_msg_.x, expected -1, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, 2) << "incorrect value for last_msg_.y, expected 2, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, -11) << "incorrect value for last_msg_.z, expected -11, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA9, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 100, 159, 67, 24, 255, 255, 255, 255, + 2, 0, 0, 0, 245, 255, 255, 255, 0, 0, 8, 0, 171, 238, + }; + + sbp_msg_vel_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 8; + test_msg.tow = 407084900; + test_msg.x = -1; + test_msg.y = 2; + test_msg.z = -11; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084900) + << "incorrect value for last_msg_.tow, expected 407084900, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -1) + << "incorrect value for last_msg_.x, expected -1, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, 2) + << "incorrect value for last_msg_.y, expected 2, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, -11) + << "incorrect value for last_msg_.z, expected -11, is " << last_msg_.z; } -class Test_auto_check_sbp_navigation_MsgVelECEFDepA10 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelECEFDepA10() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelECEFDepA10 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelECEFDepA10() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -1021,44 +1077,56 @@ class Test_auto_check_sbp_navigation_MsgVelECEFDepA10 : sbp_msg_vel_ecef_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA10, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,195,4,20,46,162,68,24,207,255,255,255,185,255,255,255,65,0,0,0,0,0,5,0,82,154, }; - - sbp_msg_vel_ecef_dep_a_t test_msg{}; - test_msg.accuracy = 0; - test_msg.flags = 0; - test_msg.n_sats = 5; - test_msg.tow = 407151150; - test_msg.x = -49; - test_msg.y = -71; - test_msg.z = 65; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 0) << "incorrect value for last_msg_.accuracy, expected 0, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 5) << "incorrect value for last_msg_.n_sats, expected 5, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407151150) << "incorrect value for last_msg_.tow, expected 407151150, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -49) << "incorrect value for last_msg_.x, expected -49, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, -71) << "incorrect value for last_msg_.y, expected -71, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 65) << "incorrect value for last_msg_.z, expected 65, is " << last_msg_.z; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelECEFDepA10, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 46, 162, 68, 24, 207, 255, 255, 255, + 185, 255, 255, 255, 65, 0, 0, 0, 0, 0, 5, 0, 82, 154, + }; + + sbp_msg_vel_ecef_dep_a_t test_msg{}; + test_msg.accuracy = 0; + test_msg.flags = 0; + test_msg.n_sats = 5; + test_msg.tow = 407151150; + test_msg.x = -49; + test_msg.y = -71; + test_msg.z = 65; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 0) + << "incorrect value for last_msg_.accuracy, expected 0, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 5) + << "incorrect value for last_msg_.n_sats, expected 5, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407151150) + << "incorrect value for last_msg_.tow, expected 407151150, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -49) + << "incorrect value for last_msg_.x, expected -49, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, -71) + << "incorrect value for last_msg_.y, expected -71, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 65) + << "incorrect value for last_msg_.z, expected 65, is " << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgVelEcefCovGnss.cc b/c/test/cpp/auto_check_sbp_navigation_MsgVelEcefCovGnss.cc index c7077e739..2ae9141b0 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgVelEcefCovGnss.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgVelEcefCovGnss.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefCovGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefCovGnss.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgVelEcefCovGnss0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelEcefCovGnss0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgVelEcefCovGnss0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelEcefCovGnss0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_cov_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_cov_gnss_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,54 +67,79 @@ class Test_auto_check_sbp_navigation_MsgVelEcefCovGnss0 : sbp_msg_vel_ecef_cov_gnss_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelEcefCovGnss0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelEcefCovGnss0, Test) { + uint8_t encoded_frame[] = { + 85, 53, 2, 0, 16, 42, 224, 229, 233, 29, 253, 255, 255, + 255, 1, 0, 0, 0, 4, 0, 0, 0, 46, 224, 32, 59, + 32, 214, 14, 59, 150, 147, 220, 186, 19, 63, 138, 59, 26, + 150, 35, 187, 11, 193, 119, 59, 21, 2, 22, 230, + }; - uint8_t encoded_frame[] = {85,53,2,0,16,42,224,229,233,29,253,255,255,255,1,0,0,0,4,0,0,0,46,224,32,59,32,214,14,59,150,147,220,186,19,63,138,59,26,150,35,187,11,193,119,59,21,2,22,230, }; + sbp_msg_vel_ecef_cov_gnss_t test_msg{}; + test_msg.cov_x_x = 0.0024547684006392956; + test_msg.cov_x_y = 0.0021795108914375305; + test_msg.cov_x_z = -0.0016828652005642653; + test_msg.cov_y_y = 0.004218944814056158; + test_msg.cov_y_z = -0.0024961293675005436; + test_msg.cov_z_z = 0.0037804271560162306; + test_msg.flags = 2; + test_msg.n_sats = 21; + test_msg.tow = 501868000; + test_msg.x = -3; + test_msg.y = 1; + test_msg.z = 4; - sbp_msg_vel_ecef_cov_gnss_t test_msg{}; - test_msg.cov_x_x = 0.0024547684006392956; - test_msg.cov_x_y = 0.0021795108914375305; - test_msg.cov_x_z = -0.0016828652005642653; - test_msg.cov_y_y = 0.004218944814056158; - test_msg.cov_y_z = -0.0024961293675005436; - test_msg.cov_z_z = 0.0037804271560162306; - test_msg.flags = 2; - test_msg.n_sats = 21; - test_msg.tow = 501868000; - test_msg.x = -3; - test_msg.y = 1; - test_msg.z = 4; - - EXPECT_EQ(send_message( 4096, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(4096, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cov_x_x * 100 - 0.00245476840064 * 100), 0.05) << "incorrect value for last_msg_.cov_x_x, expected 0.00245476840064, is " << last_msg_.cov_x_x; - EXPECT_LT((last_msg_.cov_x_y * 100 - 0.00217951089144 * 100), 0.05) << "incorrect value for last_msg_.cov_x_y, expected 0.00217951089144, is " << last_msg_.cov_x_y; - EXPECT_LT((last_msg_.cov_x_z * 100 - -0.00168286520056 * 100), 0.05) << "incorrect value for last_msg_.cov_x_z, expected -0.00168286520056, is " << last_msg_.cov_x_z; - EXPECT_LT((last_msg_.cov_y_y * 100 - 0.00421894481406 * 100), 0.05) << "incorrect value for last_msg_.cov_y_y, expected 0.00421894481406, is " << last_msg_.cov_y_y; - EXPECT_LT((last_msg_.cov_y_z * 100 - -0.0024961293675 * 100), 0.05) << "incorrect value for last_msg_.cov_y_z, expected -0.0024961293675, is " << last_msg_.cov_y_z; - EXPECT_LT((last_msg_.cov_z_z * 100 - 0.00378042715602 * 100), 0.05) << "incorrect value for last_msg_.cov_z_z, expected 0.00378042715602, is " << last_msg_.cov_z_z; - EXPECT_EQ(last_msg_.flags, 2) << "incorrect value for last_msg_.flags, expected 2, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 21) << "incorrect value for last_msg_.n_sats, expected 21, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 501868000) << "incorrect value for last_msg_.tow, expected 501868000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -3) << "incorrect value for last_msg_.x, expected -3, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, 1) << "incorrect value for last_msg_.y, expected 1, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 4) << "incorrect value for last_msg_.z, expected 4, is " << last_msg_.z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cov_x_x * 100 - 0.00245476840064 * 100), 0.05) + << "incorrect value for last_msg_.cov_x_x, expected 0.00245476840064, is " + << last_msg_.cov_x_x; + EXPECT_LT((last_msg_.cov_x_y * 100 - 0.00217951089144 * 100), 0.05) + << "incorrect value for last_msg_.cov_x_y, expected 0.00217951089144, is " + << last_msg_.cov_x_y; + EXPECT_LT((last_msg_.cov_x_z * 100 - -0.00168286520056 * 100), 0.05) + << "incorrect value for last_msg_.cov_x_z, expected -0.00168286520056, " + "is " + << last_msg_.cov_x_z; + EXPECT_LT((last_msg_.cov_y_y * 100 - 0.00421894481406 * 100), 0.05) + << "incorrect value for last_msg_.cov_y_y, expected 0.00421894481406, is " + << last_msg_.cov_y_y; + EXPECT_LT((last_msg_.cov_y_z * 100 - -0.0024961293675 * 100), 0.05) + << "incorrect value for last_msg_.cov_y_z, expected -0.0024961293675, is " + << last_msg_.cov_y_z; + EXPECT_LT((last_msg_.cov_z_z * 100 - 0.00378042715602 * 100), 0.05) + << "incorrect value for last_msg_.cov_z_z, expected 0.00378042715602, is " + << last_msg_.cov_z_z; + EXPECT_EQ(last_msg_.flags, 2) + << "incorrect value for last_msg_.flags, expected 2, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 21) + << "incorrect value for last_msg_.n_sats, expected 21, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 501868000) + << "incorrect value for last_msg_.tow, expected 501868000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -3) + << "incorrect value for last_msg_.x, expected -3, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, 1) + << "incorrect value for last_msg_.y, expected 1, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 4) + << "incorrect value for last_msg_.z, expected 4, is " << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgVelEcefGnss.cc b/c/test/cpp/auto_check_sbp_navigation_MsgVelEcefGnss.cc index 6b3c17087..5d38db285 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgVelEcefGnss.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgVelEcefGnss.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefGnss.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgVelEcefGnss0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelEcefGnss0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgVelEcefGnss0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelEcefGnss0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ecef_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ecef_gnss_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,44 +67,56 @@ class Test_auto_check_sbp_navigation_MsgVelEcefGnss0 : sbp_msg_vel_ecef_gnss_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelEcefGnss0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelEcefGnss0, Test) { + uint8_t encoded_frame[] = { + 85, 45, 2, 0, 16, 20, 224, 229, 233, 29, 253, 255, 255, 255, + 1, 0, 0, 0, 4, 0, 0, 0, 89, 0, 21, 2, 205, 16, + }; - uint8_t encoded_frame[] = {85,45,2,0,16,20,224,229,233,29,253,255,255,255,1,0,0,0,4,0,0,0,89,0,21,2,205,16, }; + sbp_msg_vel_ecef_gnss_t test_msg{}; + test_msg.accuracy = 89; + test_msg.flags = 2; + test_msg.n_sats = 21; + test_msg.tow = 501868000; + test_msg.x = -3; + test_msg.y = 1; + test_msg.z = 4; - sbp_msg_vel_ecef_gnss_t test_msg{}; - test_msg.accuracy = 89; - test_msg.flags = 2; - test_msg.n_sats = 21; - test_msg.tow = 501868000; - test_msg.x = -3; - test_msg.y = 1; - test_msg.z = 4; - - EXPECT_EQ(send_message( 4096, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(4096, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.accuracy, 89) << "incorrect value for last_msg_.accuracy, expected 89, is " << last_msg_.accuracy; - EXPECT_EQ(last_msg_.flags, 2) << "incorrect value for last_msg_.flags, expected 2, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_sats, 21) << "incorrect value for last_msg_.n_sats, expected 21, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 501868000) << "incorrect value for last_msg_.tow, expected 501868000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, -3) << "incorrect value for last_msg_.x, expected -3, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, 1) << "incorrect value for last_msg_.y, expected 1, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 4) << "incorrect value for last_msg_.z, expected 4, is " << last_msg_.z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.accuracy, 89) + << "incorrect value for last_msg_.accuracy, expected 89, is " + << last_msg_.accuracy; + EXPECT_EQ(last_msg_.flags, 2) + << "incorrect value for last_msg_.flags, expected 2, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_sats, 21) + << "incorrect value for last_msg_.n_sats, expected 21, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 501868000) + << "incorrect value for last_msg_.tow, expected 501868000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.x, -3) + << "incorrect value for last_msg_.x, expected -3, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, 1) + << "incorrect value for last_msg_.y, expected 1, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 4) + << "incorrect value for last_msg_.z, expected 4, is " << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgVelNED.cc b/c/test/cpp/auto_check_sbp_navigation_MsgVelNED.cc index b6f361ce0..9d6706314 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgVelNED.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgVelNED.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNED.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNED.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgVelNED0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNED0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgVelNED0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNED0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,96 +67,104 @@ class Test_auto_check_sbp_navigation_MsgVelNED0 : sbp_msg_vel_ned_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNED0, Test) -{ - - uint8_t encoded_frame[] = {85,14,2,211,136,22,40,244,122,19,3,0,0,0,252,255,255,255,243,255,255,255,0,0,0,0,14,0,86,209, }; - - sbp_msg_vel_ned_t test_msg{}; - test_msg.d = -13; - test_msg.e = -4; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = 3; - test_msg.n_sats = 14; - test_msg.tow = 326825000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -13) << "incorrect value for last_msg_.d, expected -13, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -4) << "incorrect value for last_msg_.e, expected -4, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, 3) << "incorrect value for last_msg_.n, expected 3, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 14) << "incorrect value for last_msg_.n_sats, expected 14, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326825000) << "incorrect value for last_msg_.tow, expected 326825000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNED0, Test) { + uint8_t encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 40, 244, 122, 19, 3, 0, 0, 0, 252, + 255, 255, 255, 243, 255, 255, 255, 0, 0, 0, 0, 14, 0, 86, 209, + }; + + sbp_msg_vel_ned_t test_msg{}; + test_msg.d = -13; + test_msg.e = -4; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = 3; + test_msg.n_sats = 14; + test_msg.tow = 326825000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -13) + << "incorrect value for last_msg_.d, expected -13, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -4) + << "incorrect value for last_msg_.e, expected -4, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, 3) + << "incorrect value for last_msg_.n, expected 3, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 14) + << "incorrect value for last_msg_.n_sats, expected 14, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326825000) + << "incorrect value for last_msg_.tow, expected 326825000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelNED1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNED1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelNED1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNED1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -168,96 +172,104 @@ class Test_auto_check_sbp_navigation_MsgVelNED1 : sbp_msg_vel_ned_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNED1, Test) -{ - - uint8_t encoded_frame[] = {85,14,2,211,136,22,28,246,122,19,252,255,255,255,255,255,255,255,232,255,255,255,0,0,0,0,15,0,16,228, }; - - sbp_msg_vel_ned_t test_msg{}; - test_msg.d = -24; - test_msg.e = -1; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = -4; - test_msg.n_sats = 15; - test_msg.tow = 326825500; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -24) << "incorrect value for last_msg_.d, expected -24, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -1) << "incorrect value for last_msg_.e, expected -1, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -4) << "incorrect value for last_msg_.n, expected -4, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326825500) << "incorrect value for last_msg_.tow, expected 326825500, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNED1, Test) { + uint8_t encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 28, 246, 122, 19, 252, 255, 255, 255, 255, + 255, 255, 255, 232, 255, 255, 255, 0, 0, 0, 0, 15, 0, 16, 228, + }; + + sbp_msg_vel_ned_t test_msg{}; + test_msg.d = -24; + test_msg.e = -1; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = -4; + test_msg.n_sats = 15; + test_msg.tow = 326825500; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -24) + << "incorrect value for last_msg_.d, expected -24, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -1) + << "incorrect value for last_msg_.e, expected -1, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -4) + << "incorrect value for last_msg_.n, expected -4, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326825500) + << "incorrect value for last_msg_.tow, expected 326825500, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelNED2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNED2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelNED2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNED2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -265,96 +277,104 @@ class Test_auto_check_sbp_navigation_MsgVelNED2 : sbp_msg_vel_ned_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNED2, Test) -{ - - uint8_t encoded_frame[] = {85,14,2,211,136,22,16,248,122,19,0,0,0,0,253,255,255,255,244,255,255,255,0,0,0,0,15,0,11,164, }; - - sbp_msg_vel_ned_t test_msg{}; - test_msg.d = -12; - test_msg.e = -3; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = 0; - test_msg.n_sats = 15; - test_msg.tow = 326826000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -12) << "incorrect value for last_msg_.d, expected -12, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -3) << "incorrect value for last_msg_.e, expected -3, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, 0) << "incorrect value for last_msg_.n, expected 0, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326826000) << "incorrect value for last_msg_.tow, expected 326826000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNED2, Test) { + uint8_t encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 16, 248, 122, 19, 0, 0, 0, 0, 253, + 255, 255, 255, 244, 255, 255, 255, 0, 0, 0, 0, 15, 0, 11, 164, + }; + + sbp_msg_vel_ned_t test_msg{}; + test_msg.d = -12; + test_msg.e = -3; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = 0; + test_msg.n_sats = 15; + test_msg.tow = 326826000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -12) + << "incorrect value for last_msg_.d, expected -12, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -3) + << "incorrect value for last_msg_.e, expected -3, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, 0) + << "incorrect value for last_msg_.n, expected 0, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326826000) + << "incorrect value for last_msg_.tow, expected 326826000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelNED3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNED3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelNED3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNED3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -362,96 +382,104 @@ class Test_auto_check_sbp_navigation_MsgVelNED3 : sbp_msg_vel_ned_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNED3, Test) -{ - - uint8_t encoded_frame[] = {85,14,2,211,136,22,4,250,122,19,2,0,0,0,3,0,0,0,232,255,255,255,0,0,0,0,15,0,152,208, }; - - sbp_msg_vel_ned_t test_msg{}; - test_msg.d = -24; - test_msg.e = 3; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = 2; - test_msg.n_sats = 15; - test_msg.tow = 326826500; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -24) << "incorrect value for last_msg_.d, expected -24, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 3) << "incorrect value for last_msg_.e, expected 3, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, 2) << "incorrect value for last_msg_.n, expected 2, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326826500) << "incorrect value for last_msg_.tow, expected 326826500, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNED3, Test) { + uint8_t encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 4, 250, 122, 19, 2, 0, 0, 0, 3, + 0, 0, 0, 232, 255, 255, 255, 0, 0, 0, 0, 15, 0, 152, 208, + }; + + sbp_msg_vel_ned_t test_msg{}; + test_msg.d = -24; + test_msg.e = 3; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = 2; + test_msg.n_sats = 15; + test_msg.tow = 326826500; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -24) + << "incorrect value for last_msg_.d, expected -24, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 3) + << "incorrect value for last_msg_.e, expected 3, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, 2) + << "incorrect value for last_msg_.n, expected 2, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326826500) + << "incorrect value for last_msg_.tow, expected 326826500, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelNED4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNED4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelNED4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNED4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -459,46 +487,60 @@ class Test_auto_check_sbp_navigation_MsgVelNED4 : sbp_msg_vel_ned_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNED4, Test) -{ - - uint8_t encoded_frame[] = {85,14,2,211,136,22,248,251,122,19,1,0,0,0,0,0,0,0,235,255,255,255,0,0,0,0,15,0,182,120, }; - - sbp_msg_vel_ned_t test_msg{}; - test_msg.d = -21; - test_msg.e = 0; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = 1; - test_msg.n_sats = 15; - test_msg.tow = 326827000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -21) << "incorrect value for last_msg_.d, expected -21, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 0) << "incorrect value for last_msg_.e, expected 0, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, 1) << "incorrect value for last_msg_.n, expected 1, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 15) << "incorrect value for last_msg_.n_sats, expected 15, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 326827000) << "incorrect value for last_msg_.tow, expected 326827000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNED4, Test) { + uint8_t encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 248, 251, 122, 19, 1, 0, 0, 0, 0, + 0, 0, 0, 235, 255, 255, 255, 0, 0, 0, 0, 15, 0, 182, 120, + }; + + sbp_msg_vel_ned_t test_msg{}; + test_msg.d = -21; + test_msg.e = 0; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = 1; + test_msg.n_sats = 15; + test_msg.tow = 326827000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -21) + << "incorrect value for last_msg_.d, expected -21, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 0) + << "incorrect value for last_msg_.e, expected 0, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, 1) + << "incorrect value for last_msg_.n, expected 1, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 15) + << "incorrect value for last_msg_.n_sats, expected 15, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 326827000) + << "incorrect value for last_msg_.tow, expected 326827000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgVelNEDCOV.cc b/c/test/cpp/auto_check_sbp_navigation_MsgVelNEDCOV.cc index 4c57c1096..56d6ca0d0 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgVelNEDCOV.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgVelNEDCOV.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDCOV.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDCOV.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgVelNEDCOV0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNEDCOV0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgVelNEDCOV0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNEDCOV0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_cov_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_cov_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,54 +67,77 @@ class Test_auto_check_sbp_navigation_MsgVelNEDCOV0 : sbp_msg_vel_ned_cov_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDCOV0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDCOV0, Test) { + uint8_t encoded_frame[] = { + 85, 18, 2, 66, 0, 42, 100, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, 10, 0, 88, 205, + }; - uint8_t encoded_frame[] = {85,18,2,66,0,42,100,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,10,0,88,205, }; + sbp_msg_vel_ned_cov_t test_msg{}; + test_msg.cov_d_d = 1.0; + test_msg.cov_e_d = 1.0; + test_msg.cov_e_e = 1.0; + test_msg.cov_n_d = 1.0; + test_msg.cov_n_e = 1.0; + test_msg.cov_n_n = 1.0; + test_msg.d = 1; + test_msg.e = 1; + test_msg.flags = 0; + test_msg.n = 1; + test_msg.n_sats = 10; + test_msg.tow = 100; - sbp_msg_vel_ned_cov_t test_msg{}; - test_msg.cov_d_d = 1.0; - test_msg.cov_e_d = 1.0; - test_msg.cov_e_e = 1.0; - test_msg.cov_n_d = 1.0; - test_msg.cov_n_e = 1.0; - test_msg.cov_n_n = 1.0; - test_msg.d = 1; - test_msg.e = 1; - test_msg.flags = 0; - test_msg.n = 1; - test_msg.n_sats = 10; - test_msg.tow = 100; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cov_d_d * 100 - 1.0 * 100), 0.05) << "incorrect value for last_msg_.cov_d_d, expected 1.0, is " << last_msg_.cov_d_d; - EXPECT_LT((last_msg_.cov_e_d * 100 - 1.0 * 100), 0.05) << "incorrect value for last_msg_.cov_e_d, expected 1.0, is " << last_msg_.cov_e_d; - EXPECT_LT((last_msg_.cov_e_e * 100 - 1.0 * 100), 0.05) << "incorrect value for last_msg_.cov_e_e, expected 1.0, is " << last_msg_.cov_e_e; - EXPECT_LT((last_msg_.cov_n_d * 100 - 1.0 * 100), 0.05) << "incorrect value for last_msg_.cov_n_d, expected 1.0, is " << last_msg_.cov_n_d; - EXPECT_LT((last_msg_.cov_n_e * 100 - 1.0 * 100), 0.05) << "incorrect value for last_msg_.cov_n_e, expected 1.0, is " << last_msg_.cov_n_e; - EXPECT_LT((last_msg_.cov_n_n * 100 - 1.0 * 100), 0.05) << "incorrect value for last_msg_.cov_n_n, expected 1.0, is " << last_msg_.cov_n_n; - EXPECT_EQ(last_msg_.d, 1) << "incorrect value for last_msg_.d, expected 1, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 1) << "incorrect value for last_msg_.e, expected 1, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n, 1) << "incorrect value for last_msg_.n, expected 1, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 10) << "incorrect value for last_msg_.n_sats, expected 10, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 100) << "incorrect value for last_msg_.tow, expected 100, is " << last_msg_.tow; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cov_d_d * 100 - 1.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_d_d, expected 1.0, is " + << last_msg_.cov_d_d; + EXPECT_LT((last_msg_.cov_e_d * 100 - 1.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_e_d, expected 1.0, is " + << last_msg_.cov_e_d; + EXPECT_LT((last_msg_.cov_e_e * 100 - 1.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_e_e, expected 1.0, is " + << last_msg_.cov_e_e; + EXPECT_LT((last_msg_.cov_n_d * 100 - 1.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_n_d, expected 1.0, is " + << last_msg_.cov_n_d; + EXPECT_LT((last_msg_.cov_n_e * 100 - 1.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_n_e, expected 1.0, is " + << last_msg_.cov_n_e; + EXPECT_LT((last_msg_.cov_n_n * 100 - 1.0 * 100), 0.05) + << "incorrect value for last_msg_.cov_n_n, expected 1.0, is " + << last_msg_.cov_n_n; + EXPECT_EQ(last_msg_.d, 1) + << "incorrect value for last_msg_.d, expected 1, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 1) + << "incorrect value for last_msg_.e, expected 1, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n, 1) + << "incorrect value for last_msg_.n, expected 1, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 10) + << "incorrect value for last_msg_.n_sats, expected 10, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 100) + << "incorrect value for last_msg_.tow, expected 100, is " + << last_msg_.tow; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgVelNEDDepA.cc b/c/test/cpp/auto_check_sbp_navigation_MsgVelNEDDepA.cc index d02c7fd2c..50b05b8aa 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgVelNEDDepA.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgVelNEDDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgVelNEDDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNEDDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgVelNEDDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNEDDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,96 +67,104 @@ class Test_auto_check_sbp_navigation_MsgVelNEDDepA0 : sbp_msg_vel_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,246,215,22,20,46,39,0,198,251,255,255,156,15,0,0,0,0,0,0,0,0,0,0,9,0,161,92, }; - - sbp_msg_vel_ned_dep_a_t test_msg{}; - test_msg.d = 0; - test_msg.e = 3996; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = -1082; - test_msg.n_sats = 9; - test_msg.tow = 2567700; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 0) << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 3996) << "incorrect value for last_msg_.e, expected 3996, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -1082) << "incorrect value for last_msg_.n, expected -1082, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567700) << "incorrect value for last_msg_.tow, expected 2567700, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 20, 46, 39, 0, 198, 251, 255, 255, 156, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 161, 92, + }; + + sbp_msg_vel_ned_dep_a_t test_msg{}; + test_msg.d = 0; + test_msg.e = 3996; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = -1082; + test_msg.n_sats = 9; + test_msg.tow = 2567700; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 0) + << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 3996) + << "incorrect value for last_msg_.e, expected 3996, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -1082) + << "incorrect value for last_msg_.n, expected -1082, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567700) + << "incorrect value for last_msg_.tow, expected 2567700, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelNEDDepA1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNEDDepA1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelNEDDepA1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNEDDepA1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -168,96 +172,104 @@ class Test_auto_check_sbp_navigation_MsgVelNEDDepA1 : sbp_msg_vel_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,246,215,22,120,46,39,0,14,252,255,255,207,14,0,0,0,0,0,0,0,0,0,0,9,0,125,160, }; - - sbp_msg_vel_ned_dep_a_t test_msg{}; - test_msg.d = 0; - test_msg.e = 3791; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = -1010; - test_msg.n_sats = 9; - test_msg.tow = 2567800; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 0) << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 3791) << "incorrect value for last_msg_.e, expected 3791, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -1010) << "incorrect value for last_msg_.n, expected -1010, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567800) << "incorrect value for last_msg_.tow, expected 2567800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 120, 46, 39, 0, 14, 252, 255, 255, 207, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 125, 160, + }; + + sbp_msg_vel_ned_dep_a_t test_msg{}; + test_msg.d = 0; + test_msg.e = 3791; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = -1010; + test_msg.n_sats = 9; + test_msg.tow = 2567800; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 0) + << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 3791) + << "incorrect value for last_msg_.e, expected 3791, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -1010) + << "incorrect value for last_msg_.n, expected -1010, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567800) + << "incorrect value for last_msg_.tow, expected 2567800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelNEDDepA2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNEDDepA2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelNEDDepA2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNEDDepA2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -265,96 +277,104 @@ class Test_auto_check_sbp_navigation_MsgVelNEDDepA2 : sbp_msg_vel_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,246,215,22,220,46,39,0,48,252,255,255,140,14,0,0,0,0,0,0,0,0,0,0,9,0,179,135, }; - - sbp_msg_vel_ned_dep_a_t test_msg{}; - test_msg.d = 0; - test_msg.e = 3724; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = -976; - test_msg.n_sats = 9; - test_msg.tow = 2567900; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 0) << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 3724) << "incorrect value for last_msg_.e, expected 3724, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -976) << "incorrect value for last_msg_.n, expected -976, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2567900) << "incorrect value for last_msg_.tow, expected 2567900, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 220, 46, 39, 0, 48, 252, 255, 255, 140, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 179, 135, + }; + + sbp_msg_vel_ned_dep_a_t test_msg{}; + test_msg.d = 0; + test_msg.e = 3724; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = -976; + test_msg.n_sats = 9; + test_msg.tow = 2567900; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 0) + << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 3724) + << "incorrect value for last_msg_.e, expected 3724, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -976) + << "incorrect value for last_msg_.n, expected -976, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2567900) + << "incorrect value for last_msg_.tow, expected 2567900, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelNEDDepA3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNEDDepA3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelNEDDepA3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNEDDepA3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -362,96 +382,104 @@ class Test_auto_check_sbp_navigation_MsgVelNEDDepA3 : sbp_msg_vel_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,246,215,22,64,47,39,0,32,252,255,255,8,15,0,0,0,0,0,0,0,0,0,0,9,0,51,177, }; - - sbp_msg_vel_ned_dep_a_t test_msg{}; - test_msg.d = 0; - test_msg.e = 3848; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = -992; - test_msg.n_sats = 9; - test_msg.tow = 2568000; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 0) << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 3848) << "incorrect value for last_msg_.e, expected 3848, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -992) << "incorrect value for last_msg_.n, expected -992, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2568000) << "incorrect value for last_msg_.tow, expected 2568000, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 64, 47, 39, 0, 32, 252, 255, 255, 8, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 51, 177, + }; + + sbp_msg_vel_ned_dep_a_t test_msg{}; + test_msg.d = 0; + test_msg.e = 3848; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = -992; + test_msg.n_sats = 9; + test_msg.tow = 2568000; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 0) + << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 3848) + << "incorrect value for last_msg_.e, expected 3848, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -992) + << "incorrect value for last_msg_.n, expected -992, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2568000) + << "incorrect value for last_msg_.tow, expected 2568000, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelNEDDepA4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNEDDepA4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelNEDDepA4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNEDDepA4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -459,96 +487,104 @@ class Test_auto_check_sbp_navigation_MsgVelNEDDepA4 : sbp_msg_vel_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,246,215,22,164,47,39,0,80,252,255,255,140,14,0,0,0,0,0,0,0,0,0,0,9,0,23,0, }; - - sbp_msg_vel_ned_dep_a_t test_msg{}; - test_msg.d = 0; - test_msg.e = 3724; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = -944; - test_msg.n_sats = 9; - test_msg.tow = 2568100; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 0) << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 3724) << "incorrect value for last_msg_.e, expected 3724, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -944) << "incorrect value for last_msg_.n, expected -944, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 9) << "incorrect value for last_msg_.n_sats, expected 9, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 2568100) << "incorrect value for last_msg_.tow, expected 2568100, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 164, 47, 39, 0, 80, 252, 255, 255, 140, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 23, 0, + }; + + sbp_msg_vel_ned_dep_a_t test_msg{}; + test_msg.d = 0; + test_msg.e = 3724; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = -944; + test_msg.n_sats = 9; + test_msg.tow = 2568100; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 0) + << "incorrect value for last_msg_.d, expected 0, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 3724) + << "incorrect value for last_msg_.e, expected 3724, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -944) + << "incorrect value for last_msg_.n, expected -944, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 9) + << "incorrect value for last_msg_.n_sats, expected 9, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 2568100) + << "incorrect value for last_msg_.tow, expected 2568100, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelNEDDepA5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNEDDepA5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelNEDDepA5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNEDDepA5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -556,96 +592,104 @@ class Test_auto_check_sbp_navigation_MsgVelNEDDepA5 : sbp_msg_vel_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,195,4,22,212,157,67,24,229,255,255,255,26,0,0,0,25,0,0,0,0,0,0,0,8,0,132,25, }; - - sbp_msg_vel_ned_dep_a_t test_msg{}; - test_msg.d = 25; - test_msg.e = 26; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = -27; - test_msg.n_sats = 8; - test_msg.tow = 407084500; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 25) << "incorrect value for last_msg_.d, expected 25, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 26) << "incorrect value for last_msg_.e, expected 26, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -27) << "incorrect value for last_msg_.n, expected -27, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084500) << "incorrect value for last_msg_.tow, expected 407084500, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 212, 157, 67, 24, 229, 255, 255, 255, 26, + 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 8, 0, 132, 25, + }; + + sbp_msg_vel_ned_dep_a_t test_msg{}; + test_msg.d = 25; + test_msg.e = 26; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = -27; + test_msg.n_sats = 8; + test_msg.tow = 407084500; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 25) + << "incorrect value for last_msg_.d, expected 25, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 26) + << "incorrect value for last_msg_.e, expected 26, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -27) + << "incorrect value for last_msg_.n, expected -27, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084500) + << "incorrect value for last_msg_.tow, expected 407084500, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelNEDDepA6 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNEDDepA6() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelNEDDepA6 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNEDDepA6() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -653,96 +697,104 @@ class Test_auto_check_sbp_navigation_MsgVelNEDDepA6 : sbp_msg_vel_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,195,4,22,56,158,67,24,4,0,0,0,15,0,0,0,232,255,255,255,0,0,0,0,8,0,42,14, }; - - sbp_msg_vel_ned_dep_a_t test_msg{}; - test_msg.d = -24; - test_msg.e = 15; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = 4; - test_msg.n_sats = 8; - test_msg.tow = 407084600; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -24) << "incorrect value for last_msg_.d, expected -24, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 15) << "incorrect value for last_msg_.e, expected 15, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, 4) << "incorrect value for last_msg_.n, expected 4, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084600) << "incorrect value for last_msg_.tow, expected 407084600, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 56, 158, 67, 24, 4, 0, 0, 0, 15, + 0, 0, 0, 232, 255, 255, 255, 0, 0, 0, 0, 8, 0, 42, 14, + }; + + sbp_msg_vel_ned_dep_a_t test_msg{}; + test_msg.d = -24; + test_msg.e = 15; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = 4; + test_msg.n_sats = 8; + test_msg.tow = 407084600; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -24) + << "incorrect value for last_msg_.d, expected -24, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 15) + << "incorrect value for last_msg_.e, expected 15, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, 4) + << "incorrect value for last_msg_.n, expected 4, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084600) + << "incorrect value for last_msg_.tow, expected 407084600, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelNEDDepA7 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNEDDepA7() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelNEDDepA7 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNEDDepA7() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -750,96 +802,104 @@ class Test_auto_check_sbp_navigation_MsgVelNEDDepA7 : sbp_msg_vel_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,195,4,22,156,158,67,24,251,255,255,255,232,255,255,255,247,255,255,255,0,0,0,0,8,0,218,148, }; - - sbp_msg_vel_ned_dep_a_t test_msg{}; - test_msg.d = -9; - test_msg.e = -24; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = -5; - test_msg.n_sats = 8; - test_msg.tow = 407084700; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -9) << "incorrect value for last_msg_.d, expected -9, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -24) << "incorrect value for last_msg_.e, expected -24, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -5) << "incorrect value for last_msg_.n, expected -5, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084700) << "incorrect value for last_msg_.tow, expected 407084700, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 156, 158, 67, 24, 251, 255, 255, 255, 232, + 255, 255, 255, 247, 255, 255, 255, 0, 0, 0, 0, 8, 0, 218, 148, + }; + + sbp_msg_vel_ned_dep_a_t test_msg{}; + test_msg.d = -9; + test_msg.e = -24; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = -5; + test_msg.n_sats = 8; + test_msg.tow = 407084700; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -9) + << "incorrect value for last_msg_.d, expected -9, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -24) + << "incorrect value for last_msg_.e, expected -24, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -5) + << "incorrect value for last_msg_.n, expected -5, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084700) + << "incorrect value for last_msg_.tow, expected 407084700, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelNEDDepA8 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNEDDepA8() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelNEDDepA8 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNEDDepA8() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -847,96 +907,104 @@ class Test_auto_check_sbp_navigation_MsgVelNEDDepA8 : sbp_msg_vel_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,195,4,22,0,159,67,24,10,0,0,0,2,0,0,0,222,255,255,255,0,0,0,0,8,0,148,16, }; - - sbp_msg_vel_ned_dep_a_t test_msg{}; - test_msg.d = -34; - test_msg.e = 2; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = 10; - test_msg.n_sats = 8; - test_msg.tow = 407084800; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -34) << "incorrect value for last_msg_.d, expected -34, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 2) << "incorrect value for last_msg_.e, expected 2, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, 10) << "incorrect value for last_msg_.n, expected 10, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084800) << "incorrect value for last_msg_.tow, expected 407084800, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 0, 159, 67, 24, 10, 0, 0, 0, 2, + 0, 0, 0, 222, 255, 255, 255, 0, 0, 0, 0, 8, 0, 148, 16, + }; + + sbp_msg_vel_ned_dep_a_t test_msg{}; + test_msg.d = -34; + test_msg.e = 2; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = 10; + test_msg.n_sats = 8; + test_msg.tow = 407084800; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -34) + << "incorrect value for last_msg_.d, expected -34, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 2) + << "incorrect value for last_msg_.e, expected 2, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, 10) + << "incorrect value for last_msg_.n, expected 10, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084800) + << "incorrect value for last_msg_.tow, expected 407084800, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelNEDDepA9 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNEDDepA9() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelNEDDepA9 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNEDDepA9() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -944,96 +1012,104 @@ class Test_auto_check_sbp_navigation_MsgVelNEDDepA9 : sbp_msg_vel_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA9, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,195,4,22,100,159,67,24,248,255,255,255,254,255,255,255,7,0,0,0,0,0,0,0,8,0,255,236, }; - - sbp_msg_vel_ned_dep_a_t test_msg{}; - test_msg.d = 7; - test_msg.e = -2; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = -8; - test_msg.n_sats = 8; - test_msg.tow = 407084900; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, 7) << "incorrect value for last_msg_.d, expected 7, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -2) << "incorrect value for last_msg_.e, expected -2, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -8) << "incorrect value for last_msg_.n, expected -8, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 8) << "incorrect value for last_msg_.n_sats, expected 8, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407084900) << "incorrect value for last_msg_.tow, expected 407084900, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA9, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 100, 159, 67, 24, 248, 255, 255, 255, 254, + 255, 255, 255, 7, 0, 0, 0, 0, 0, 0, 0, 8, 0, 255, 236, + }; + + sbp_msg_vel_ned_dep_a_t test_msg{}; + test_msg.d = 7; + test_msg.e = -2; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = -8; + test_msg.n_sats = 8; + test_msg.tow = 407084900; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, 7) + << "incorrect value for last_msg_.d, expected 7, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -2) + << "incorrect value for last_msg_.e, expected -2, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -8) + << "incorrect value for last_msg_.n, expected -8, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 8) + << "incorrect value for last_msg_.n_sats, expected 8, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407084900) + << "incorrect value for last_msg_.tow, expected 407084900, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } -class Test_auto_check_sbp_navigation_MsgVelNEDDepA10 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNEDDepA10() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_navigation_MsgVelNEDDepA10 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNEDDepA10() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -1041,46 +1117,60 @@ class Test_auto_check_sbp_navigation_MsgVelNEDDepA10 : sbp_msg_vel_ned_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA10, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,195,4,22,46,162,68,24,255,255,255,255,253,255,255,255,148,255,255,255,0,0,0,0,5,0,166,189, }; - - sbp_msg_vel_ned_dep_a_t test_msg{}; - test_msg.d = -108; - test_msg.e = -3; - test_msg.flags = 0; - test_msg.h_accuracy = 0; - test_msg.n = -1; - test_msg.n_sats = 5; - test_msg.tow = 407151150; - test_msg.v_accuracy = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -108) << "incorrect value for last_msg_.d, expected -108, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, -3) << "incorrect value for last_msg_.e, expected -3, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 0) << "incorrect value for last_msg_.h_accuracy, expected 0, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -1) << "incorrect value for last_msg_.n, expected -1, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 5) << "incorrect value for last_msg_.n_sats, expected 5, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 407151150) << "incorrect value for last_msg_.tow, expected 407151150, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 0) << "incorrect value for last_msg_.v_accuracy, expected 0, is " << last_msg_.v_accuracy; +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNEDDepA10, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 46, 162, 68, 24, 255, 255, 255, 255, 253, + 255, 255, 255, 148, 255, 255, 255, 0, 0, 0, 0, 5, 0, 166, 189, + }; + + sbp_msg_vel_ned_dep_a_t test_msg{}; + test_msg.d = -108; + test_msg.e = -3; + test_msg.flags = 0; + test_msg.h_accuracy = 0; + test_msg.n = -1; + test_msg.n_sats = 5; + test_msg.tow = 407151150; + test_msg.v_accuracy = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -108) + << "incorrect value for last_msg_.d, expected -108, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, -3) + << "incorrect value for last_msg_.e, expected -3, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 0) + << "incorrect value for last_msg_.h_accuracy, expected 0, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -1) + << "incorrect value for last_msg_.n, expected -1, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 5) + << "incorrect value for last_msg_.n_sats, expected 5, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 407151150) + << "incorrect value for last_msg_.tow, expected 407151150, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 0) + << "incorrect value for last_msg_.v_accuracy, expected 0, is " + << last_msg_.v_accuracy; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgVelNedCovGnss.cc b/c/test/cpp/auto_check_sbp_navigation_MsgVelNedCovGnss.cc index 2a3a46f81..4f72fffbe 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgVelNedCovGnss.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgVelNedCovGnss.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedCovGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedCovGnss.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgVelNedCovGnss0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNedCovGnss0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgVelNedCovGnss0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNedCovGnss0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_cov_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_cov_gnss_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,54 +67,82 @@ class Test_auto_check_sbp_navigation_MsgVelNedCovGnss0 : sbp_msg_vel_ned_cov_gnss_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNedCovGnss0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNedCovGnss0, Test) { + uint8_t encoded_frame[] = { + 85, 50, 2, 0, 16, 42, 168, 230, 233, 29, 251, 255, 255, + 255, 0, 0, 0, 0, 246, 255, 255, 255, 15, 58, 207, 58, + 248, 139, 116, 55, 103, 197, 57, 57, 203, 186, 129, 58, 109, + 171, 44, 57, 135, 39, 1, 60, 21, 2, 155, 3, + }; - uint8_t encoded_frame[] = {85,50,2,0,16,42,168,230,233,29,251,255,255,255,0,0,0,0,246,255,255,255,15,58,207,58,248,139,116,55,103,197,57,57,203,186,129,58,109,171,44,57,135,39,1,60,21,2,155,3, }; + sbp_msg_vel_ned_cov_gnss_t test_msg{}; + test_msg.cov_d_d = 0.007882959209382534; + test_msg.cov_e_d = 0.00016467059322167188; + test_msg.cov_e_e = 0.0009897587588056922; + test_msg.cov_n_d = 0.00017716512957122177; + test_msg.cov_n_e = 1.457612233934924e-05; + test_msg.cov_n_n = 0.0015810149488970637; + test_msg.d = -10; + test_msg.e = 0; + test_msg.flags = 2; + test_msg.n = -5; + test_msg.n_sats = 21; + test_msg.tow = 501868200; - sbp_msg_vel_ned_cov_gnss_t test_msg{}; - test_msg.cov_d_d = 0.007882959209382534; - test_msg.cov_e_d = 0.00016467059322167188; - test_msg.cov_e_e = 0.0009897587588056922; - test_msg.cov_n_d = 0.00017716512957122177; - test_msg.cov_n_e = 1.457612233934924e-05; - test_msg.cov_n_n = 0.0015810149488970637; - test_msg.d = -10; - test_msg.e = 0; - test_msg.flags = 2; - test_msg.n = -5; - test_msg.n_sats = 21; - test_msg.tow = 501868200; - - EXPECT_EQ(send_message( 4096, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(4096, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.cov_d_d * 100 - 0.00788295920938 * 100), 0.05) << "incorrect value for last_msg_.cov_d_d, expected 0.00788295920938, is " << last_msg_.cov_d_d; - EXPECT_LT((last_msg_.cov_e_d * 100 - 0.000164670593222 * 100), 0.05) << "incorrect value for last_msg_.cov_e_d, expected 0.000164670593222, is " << last_msg_.cov_e_d; - EXPECT_LT((last_msg_.cov_e_e * 100 - 0.000989758758806 * 100), 0.05) << "incorrect value for last_msg_.cov_e_e, expected 0.000989758758806, is " << last_msg_.cov_e_e; - EXPECT_LT((last_msg_.cov_n_d * 100 - 0.000177165129571 * 100), 0.05) << "incorrect value for last_msg_.cov_n_d, expected 0.000177165129571, is " << last_msg_.cov_n_d; - EXPECT_LT((last_msg_.cov_n_e * 100 - 1.45761223393e-05 * 100), 0.05) << "incorrect value for last_msg_.cov_n_e, expected 1.45761223393e-05, is " << last_msg_.cov_n_e; - EXPECT_LT((last_msg_.cov_n_n * 100 - 0.0015810149489 * 100), 0.05) << "incorrect value for last_msg_.cov_n_n, expected 0.0015810149489, is " << last_msg_.cov_n_n; - EXPECT_EQ(last_msg_.d, -10) << "incorrect value for last_msg_.d, expected -10, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 0) << "incorrect value for last_msg_.e, expected 0, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 2) << "incorrect value for last_msg_.flags, expected 2, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n, -5) << "incorrect value for last_msg_.n, expected -5, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 21) << "incorrect value for last_msg_.n_sats, expected 21, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 501868200) << "incorrect value for last_msg_.tow, expected 501868200, is " << last_msg_.tow; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.cov_d_d * 100 - 0.00788295920938 * 100), 0.05) + << "incorrect value for last_msg_.cov_d_d, expected 0.00788295920938, is " + << last_msg_.cov_d_d; + EXPECT_LT((last_msg_.cov_e_d * 100 - 0.000164670593222 * 100), 0.05) + << "incorrect value for last_msg_.cov_e_d, expected 0.000164670593222, " + "is " + << last_msg_.cov_e_d; + EXPECT_LT((last_msg_.cov_e_e * 100 - 0.000989758758806 * 100), 0.05) + << "incorrect value for last_msg_.cov_e_e, expected 0.000989758758806, " + "is " + << last_msg_.cov_e_e; + EXPECT_LT((last_msg_.cov_n_d * 100 - 0.000177165129571 * 100), 0.05) + << "incorrect value for last_msg_.cov_n_d, expected 0.000177165129571, " + "is " + << last_msg_.cov_n_d; + EXPECT_LT((last_msg_.cov_n_e * 100 - 1.45761223393e-05 * 100), 0.05) + << "incorrect value for last_msg_.cov_n_e, expected 1.45761223393e-05, " + "is " + << last_msg_.cov_n_e; + EXPECT_LT((last_msg_.cov_n_n * 100 - 0.0015810149489 * 100), 0.05) + << "incorrect value for last_msg_.cov_n_n, expected 0.0015810149489, is " + << last_msg_.cov_n_n; + EXPECT_EQ(last_msg_.d, -10) + << "incorrect value for last_msg_.d, expected -10, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 0) + << "incorrect value for last_msg_.e, expected 0, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 2) + << "incorrect value for last_msg_.flags, expected 2, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n, -5) + << "incorrect value for last_msg_.n, expected -5, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 21) + << "incorrect value for last_msg_.n_sats, expected 21, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 501868200) + << "incorrect value for last_msg_.tow, expected 501868200, is " + << last_msg_.tow; } diff --git a/c/test/cpp/auto_check_sbp_navigation_MsgVelNedGnss.cc b/c/test/cpp/auto_check_sbp_navigation_MsgVelNedGnss.cc index 048093b8e..84cf898a3 100644 --- a/c/test/cpp/auto_check_sbp_navigation_MsgVelNedGnss.cc +++ b/c/test/cpp/auto_check_sbp_navigation_MsgVelNedGnss.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedGnss.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_navigation_MsgVelNedGnss0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_navigation_MsgVelNedGnss0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_navigation_MsgVelNedGnss0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_navigation_MsgVelNedGnss0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_vel_ned_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_vel_ned_gnss_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,46 +67,60 @@ class Test_auto_check_sbp_navigation_MsgVelNedGnss0 : sbp_msg_vel_ned_gnss_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_navigation_MsgVelNedGnss0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_navigation_MsgVelNedGnss0, Test) { + uint8_t encoded_frame[] = { + 85, 46, 2, 0, 16, 22, 168, 230, 233, 29, 251, 255, 255, 255, 0, + 0, 0, 0, 246, 255, 255, 255, 40, 0, 89, 0, 21, 2, 99, 171, + }; - uint8_t encoded_frame[] = {85,46,2,0,16,22,168,230,233,29,251,255,255,255,0,0,0,0,246,255,255,255,40,0,89,0,21,2,99,171, }; + sbp_msg_vel_ned_gnss_t test_msg{}; + test_msg.d = -10; + test_msg.e = 0; + test_msg.flags = 2; + test_msg.h_accuracy = 40; + test_msg.n = -5; + test_msg.n_sats = 21; + test_msg.tow = 501868200; + test_msg.v_accuracy = 89; - sbp_msg_vel_ned_gnss_t test_msg{}; - test_msg.d = -10; - test_msg.e = 0; - test_msg.flags = 2; - test_msg.h_accuracy = 40; - test_msg.n = -5; - test_msg.n_sats = 21; - test_msg.tow = 501868200; - test_msg.v_accuracy = 89; - - EXPECT_EQ(send_message( 4096, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(4096, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.d, -10) << "incorrect value for last_msg_.d, expected -10, is " << last_msg_.d; - EXPECT_EQ(last_msg_.e, 0) << "incorrect value for last_msg_.e, expected 0, is " << last_msg_.e; - EXPECT_EQ(last_msg_.flags, 2) << "incorrect value for last_msg_.flags, expected 2, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.h_accuracy, 40) << "incorrect value for last_msg_.h_accuracy, expected 40, is " << last_msg_.h_accuracy; - EXPECT_EQ(last_msg_.n, -5) << "incorrect value for last_msg_.n, expected -5, is " << last_msg_.n; - EXPECT_EQ(last_msg_.n_sats, 21) << "incorrect value for last_msg_.n_sats, expected 21, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 501868200) << "incorrect value for last_msg_.tow, expected 501868200, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.v_accuracy, 89) << "incorrect value for last_msg_.v_accuracy, expected 89, is " << last_msg_.v_accuracy; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.d, -10) + << "incorrect value for last_msg_.d, expected -10, is " << last_msg_.d; + EXPECT_EQ(last_msg_.e, 0) + << "incorrect value for last_msg_.e, expected 0, is " << last_msg_.e; + EXPECT_EQ(last_msg_.flags, 2) + << "incorrect value for last_msg_.flags, expected 2, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.h_accuracy, 40) + << "incorrect value for last_msg_.h_accuracy, expected 40, is " + << last_msg_.h_accuracy; + EXPECT_EQ(last_msg_.n, -5) + << "incorrect value for last_msg_.n, expected -5, is " << last_msg_.n; + EXPECT_EQ(last_msg_.n_sats, 21) + << "incorrect value for last_msg_.n_sats, expected 21, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 501868200) + << "incorrect value for last_msg_.tow, expected 501868200, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.v_accuracy, 89) + << "incorrect value for last_msg_.v_accuracy, expected 89, is " + << last_msg_.v_accuracy; } diff --git a/c/test/cpp/auto_check_sbp_ndb_MsgNdbEvent.cc b/c/test/cpp/auto_check_sbp_ndb_MsgNdbEvent.cc index 76b650c7d..80b3f8de4 100644 --- a/c/test/cpp/auto_check_sbp_ndb_MsgNdbEvent.cc +++ b/c/test/cpp/auto_check_sbp_ndb_MsgNdbEvent.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ndb/test_MsgNdbEvent.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ndb/test_MsgNdbEvent.yaml by generate.py. Do not +// modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ndb_MsgNdbEvent0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ndb_MsgNdbEvent0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ndb_MsgNdbEvent0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ndb_MsgNdbEvent0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ndb_event_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ndb_event_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,50 +67,71 @@ class Test_auto_check_sbp_ndb_MsgNdbEvent0 : sbp_msg_ndb_event_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ndb_MsgNdbEvent0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_ndb_MsgNdbEvent0, Test) { + uint8_t encoded_frame[] = { + 85, 0, 4, 164, 174, 18, 254, 188, 70, 185, 69, 0, 0, + 0, 249, 73, 205, 115, 238, 74, 98, 66, 182, 148, 16, 166, + }; - uint8_t encoded_frame[] = {85,0,4,164,174,18,254,188,70,185,69,0,0,0,249,73,205,115,238,74,98,66,182,148,16,166, }; + sbp_msg_ndb_event_t test_msg{}; + test_msg.data_source = 115; + test_msg.event = 249; + test_msg.object_sid.code = 74; + test_msg.object_sid.sat = 238; + test_msg.object_type = 73; + test_msg.original_sender = 38070; + test_msg.recv_time = 299461164286; + test_msg.result = 205; + test_msg.src_sid.code = 66; + test_msg.src_sid.sat = 98; - sbp_msg_ndb_event_t test_msg{}; - test_msg.data_source = 115; - test_msg.event = 249; - test_msg.object_sid.code = 74; - test_msg.object_sid.sat = 238; - test_msg.object_type = 73; - test_msg.original_sender = 38070; - test_msg.recv_time = 299461164286; - test_msg.result = 205; - test_msg.src_sid.code = 66; - test_msg.src_sid.sat = 98; - - EXPECT_EQ(send_message( 44708, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(44708, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 44708); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.data_source, 115) << "incorrect value for last_msg_.data_source, expected 115, is " << last_msg_.data_source; - EXPECT_EQ(last_msg_.event, 249) << "incorrect value for last_msg_.event, expected 249, is " << last_msg_.event; - EXPECT_EQ(last_msg_.object_sid.code, 74) << "incorrect value for last_msg_.object_sid.code, expected 74, is " << last_msg_.object_sid.code; - EXPECT_EQ(last_msg_.object_sid.sat, 238) << "incorrect value for last_msg_.object_sid.sat, expected 238, is " << last_msg_.object_sid.sat; - EXPECT_EQ(last_msg_.object_type, 73) << "incorrect value for last_msg_.object_type, expected 73, is " << last_msg_.object_type; - EXPECT_EQ(last_msg_.original_sender, 38070) << "incorrect value for last_msg_.original_sender, expected 38070, is " << last_msg_.original_sender; - EXPECT_EQ(last_msg_.recv_time, 299461164286) << "incorrect value for last_msg_.recv_time, expected 299461164286, is " << last_msg_.recv_time; - EXPECT_EQ(last_msg_.result, 205) << "incorrect value for last_msg_.result, expected 205, is " << last_msg_.result; - EXPECT_EQ(last_msg_.src_sid.code, 66) << "incorrect value for last_msg_.src_sid.code, expected 66, is " << last_msg_.src_sid.code; - EXPECT_EQ(last_msg_.src_sid.sat, 98) << "incorrect value for last_msg_.src_sid.sat, expected 98, is " << last_msg_.src_sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 44708); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.data_source, 115) + << "incorrect value for last_msg_.data_source, expected 115, is " + << last_msg_.data_source; + EXPECT_EQ(last_msg_.event, 249) + << "incorrect value for last_msg_.event, expected 249, is " + << last_msg_.event; + EXPECT_EQ(last_msg_.object_sid.code, 74) + << "incorrect value for last_msg_.object_sid.code, expected 74, is " + << last_msg_.object_sid.code; + EXPECT_EQ(last_msg_.object_sid.sat, 238) + << "incorrect value for last_msg_.object_sid.sat, expected 238, is " + << last_msg_.object_sid.sat; + EXPECT_EQ(last_msg_.object_type, 73) + << "incorrect value for last_msg_.object_type, expected 73, is " + << last_msg_.object_type; + EXPECT_EQ(last_msg_.original_sender, 38070) + << "incorrect value for last_msg_.original_sender, expected 38070, is " + << last_msg_.original_sender; + EXPECT_EQ(last_msg_.recv_time, 299461164286) + << "incorrect value for last_msg_.recv_time, expected 299461164286, is " + << last_msg_.recv_time; + EXPECT_EQ(last_msg_.result, 205) + << "incorrect value for last_msg_.result, expected 205, is " + << last_msg_.result; + EXPECT_EQ(last_msg_.src_sid.code, 66) + << "incorrect value for last_msg_.src_sid.code, expected 66, is " + << last_msg_.src_sid.code; + EXPECT_EQ(last_msg_.src_sid.sat, 98) + << "incorrect value for last_msg_.src_sid.sat, expected 98, is " + << last_msg_.src_sid.sat; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGLO.cc b/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGLO.cc index 473c5564e..da4443f9a 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGLO.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGLO.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLO.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLO.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgAlmanacGLO0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgAlmanacGLO0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgAlmanacGLO0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgAlmanacGLO0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_almanac_glo_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_almanac_glo_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,60 +67,98 @@ class Test_auto_check_sbp_observation_MsgAlmanacGLO0 : sbp_msg_almanac_glo_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgAlmanacGLO0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgAlmanacGLO0, Test) { + uint8_t encoded_frame[] = { + 85, 115, 0, 195, 4, 78, 22, 0, 176, 207, 6, 0, 106, 8, 154, + 153, 153, 153, 153, 153, 1, 64, 64, 56, 0, 0, 1, 0, 142, 41, + 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, 63, 0, + 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, + 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, + 191, 71, 11, 217, 147, 145, 228, 237, 63, 155, 87, + }; - uint8_t encoded_frame[] = {85,115,0,195,4,78,22,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,155,87, }; + sbp_msg_almanac_glo_t test_msg{}; + test_msg.common.fit_interval = 14400; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 0; + test_msg.common.sid.sat = 22; + test_msg.common.toa.tow = 446384; + test_msg.common.toa.wn = 2154; + test_msg.common.ura = 2.2; + test_msg.common.valid = 1; + test_msg.epsilon = -0.9893036629599647; + test_msg.i = 5153.550029754639; + test_msg.lambda_na = -0.02200078842114688; + test_msg.omega = 0.9341514480259797; + test_msg.t = -1.8731818448797617; + test_msg.t_dot = -8.903585155774196e-09; + test_msg.t_lambda_na = 0.007072207052260637; - sbp_msg_almanac_glo_t test_msg{}; - test_msg.common.fit_interval = 14400; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 0; - test_msg.common.sid.sat = 22; - test_msg.common.toa.tow = 446384; - test_msg.common.toa.wn = 2154; - test_msg.common.ura = 2.2; - test_msg.common.valid = 1; - test_msg.epsilon = -0.9893036629599647; - test_msg.i = 5153.550029754639; - test_msg.lambda_na = -0.02200078842114688; - test_msg.omega = 0.9341514480259797; - test_msg.t = -1.8731818448797617; - test_msg.t_dot = -8.903585155774196e-09; - test_msg.t_lambda_na = 0.007072207052260637; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.common.fit_interval, 14400) << "incorrect value for last_msg_.common.fit_interval, expected 14400, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 0) << "incorrect value for last_msg_.common.sid.code, expected 0, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.sat, 22) << "incorrect value for last_msg_.common.sid.sat, expected 22, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toa.tow, 446384) << "incorrect value for last_msg_.common.toa.tow, expected 446384, is " << last_msg_.common.toa.tow; - EXPECT_EQ(last_msg_.common.toa.wn, 2154) << "incorrect value for last_msg_.common.toa.wn, expected 2154, is " << last_msg_.common.toa.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 2.2 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 2.2, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.epsilon * 100 - -0.98930366296 * 100), 0.05) << "incorrect value for last_msg_.epsilon, expected -0.98930366296, is " << last_msg_.epsilon; - EXPECT_LT((last_msg_.i * 100 - 5153.55002975 * 100), 0.05) << "incorrect value for last_msg_.i, expected 5153.55002975, is " << last_msg_.i; - EXPECT_LT((last_msg_.lambda_na * 100 - -0.0220007884211 * 100), 0.05) << "incorrect value for last_msg_.lambda_na, expected -0.0220007884211, is " << last_msg_.lambda_na; - EXPECT_LT((last_msg_.omega * 100 - 0.934151448026 * 100), 0.05) << "incorrect value for last_msg_.omega, expected 0.934151448026, is " << last_msg_.omega; - EXPECT_LT((last_msg_.t * 100 - -1.87318184488 * 100), 0.05) << "incorrect value for last_msg_.t, expected -1.87318184488, is " << last_msg_.t; - EXPECT_LT((last_msg_.t_dot * 100 - -8.90358515577e-09 * 100), 0.05) << "incorrect value for last_msg_.t_dot, expected -8.90358515577e-09, is " << last_msg_.t_dot; - EXPECT_LT((last_msg_.t_lambda_na * 100 - 0.00707220705226 * 100), 0.05) << "incorrect value for last_msg_.t_lambda_na, expected 0.00707220705226, is " << last_msg_.t_lambda_na; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.common.fit_interval, 14400) + << "incorrect value for last_msg_.common.fit_interval, expected 14400, " + "is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 0) + << "incorrect value for last_msg_.common.sid.code, expected 0, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.sat, 22) + << "incorrect value for last_msg_.common.sid.sat, expected 22, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toa.tow, 446384) + << "incorrect value for last_msg_.common.toa.tow, expected 446384, is " + << last_msg_.common.toa.tow; + EXPECT_EQ(last_msg_.common.toa.wn, 2154) + << "incorrect value for last_msg_.common.toa.wn, expected 2154, is " + << last_msg_.common.toa.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 2.2 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 2.2, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.epsilon * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for last_msg_.epsilon, expected -0.98930366296, is " + << last_msg_.epsilon; + EXPECT_LT((last_msg_.i * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for last_msg_.i, expected 5153.55002975, is " + << last_msg_.i; + EXPECT_LT((last_msg_.lambda_na * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for last_msg_.lambda_na, expected -0.0220007884211, " + "is " + << last_msg_.lambda_na; + EXPECT_LT((last_msg_.omega * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for last_msg_.omega, expected 0.934151448026, is " + << last_msg_.omega; + EXPECT_LT((last_msg_.t * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for last_msg_.t, expected -1.87318184488, is " + << last_msg_.t; + EXPECT_LT((last_msg_.t_dot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for last_msg_.t_dot, expected -8.90358515577e-09, is " + << last_msg_.t_dot; + EXPECT_LT((last_msg_.t_lambda_na * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for last_msg_.t_lambda_na, expected " + "0.00707220705226, is " + << last_msg_.t_lambda_na; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGLODep.cc b/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGLODep.cc index ca8b6dcc8..6e3cf6863 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGLODep.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGLODep.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLODep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLODep.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgAlmanacGLODep0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgAlmanacGLODep0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgAlmanacGLODep0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgAlmanacGLODep0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_almanac_glo_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_almanac_glo_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,62 +67,102 @@ class Test_auto_check_sbp_observation_MsgAlmanacGLODep0 : sbp_msg_almanac_glo_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgAlmanacGLODep0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgAlmanacGLODep0, Test) { + uint8_t encoded_frame[] = { + 85, 113, 0, 195, 4, 80, 22, 0, 0, 0, 176, 207, 6, 0, 106, + 8, 154, 153, 153, 153, 153, 153, 1, 64, 64, 56, 0, 0, 1, 0, + 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, + 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, + 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, + 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, 203, 178, + }; - uint8_t encoded_frame[] = {85,113,0,195,4,80,22,0,0,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,203,178, }; + sbp_msg_almanac_glo_dep_t test_msg{}; + test_msg.common.fit_interval = 14400; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 0; + test_msg.common.sid.reserved = 0; + test_msg.common.sid.sat = 22; + test_msg.common.toa.tow = 446384; + test_msg.common.toa.wn = 2154; + test_msg.common.ura = 2.2; + test_msg.common.valid = 1; + test_msg.epsilon = -0.9893036629599647; + test_msg.i = 5153.550029754639; + test_msg.lambda_na = -0.02200078842114688; + test_msg.omega = 0.9341514480259797; + test_msg.t = -1.8731818448797617; + test_msg.t_dot = -8.903585155774196e-09; + test_msg.t_lambda_na = 0.007072207052260637; - sbp_msg_almanac_glo_dep_t test_msg{}; - test_msg.common.fit_interval = 14400; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 0; - test_msg.common.sid.reserved = 0; - test_msg.common.sid.sat = 22; - test_msg.common.toa.tow = 446384; - test_msg.common.toa.wn = 2154; - test_msg.common.ura = 2.2; - test_msg.common.valid = 1; - test_msg.epsilon = -0.9893036629599647; - test_msg.i = 5153.550029754639; - test_msg.lambda_na = -0.02200078842114688; - test_msg.omega = 0.9341514480259797; - test_msg.t = -1.8731818448797617; - test_msg.t_dot = -8.903585155774196e-09; - test_msg.t_lambda_na = 0.007072207052260637; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.common.fit_interval, 14400) << "incorrect value for last_msg_.common.fit_interval, expected 14400, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 0) << "incorrect value for last_msg_.common.sid.code, expected 0, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.reserved, 0) << "incorrect value for last_msg_.common.sid.reserved, expected 0, is " << last_msg_.common.sid.reserved; - EXPECT_EQ(last_msg_.common.sid.sat, 22) << "incorrect value for last_msg_.common.sid.sat, expected 22, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toa.tow, 446384) << "incorrect value for last_msg_.common.toa.tow, expected 446384, is " << last_msg_.common.toa.tow; - EXPECT_EQ(last_msg_.common.toa.wn, 2154) << "incorrect value for last_msg_.common.toa.wn, expected 2154, is " << last_msg_.common.toa.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 2.2 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 2.2, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.epsilon * 100 - -0.98930366296 * 100), 0.05) << "incorrect value for last_msg_.epsilon, expected -0.98930366296, is " << last_msg_.epsilon; - EXPECT_LT((last_msg_.i * 100 - 5153.55002975 * 100), 0.05) << "incorrect value for last_msg_.i, expected 5153.55002975, is " << last_msg_.i; - EXPECT_LT((last_msg_.lambda_na * 100 - -0.0220007884211 * 100), 0.05) << "incorrect value for last_msg_.lambda_na, expected -0.0220007884211, is " << last_msg_.lambda_na; - EXPECT_LT((last_msg_.omega * 100 - 0.934151448026 * 100), 0.05) << "incorrect value for last_msg_.omega, expected 0.934151448026, is " << last_msg_.omega; - EXPECT_LT((last_msg_.t * 100 - -1.87318184488 * 100), 0.05) << "incorrect value for last_msg_.t, expected -1.87318184488, is " << last_msg_.t; - EXPECT_LT((last_msg_.t_dot * 100 - -8.90358515577e-09 * 100), 0.05) << "incorrect value for last_msg_.t_dot, expected -8.90358515577e-09, is " << last_msg_.t_dot; - EXPECT_LT((last_msg_.t_lambda_na * 100 - 0.00707220705226 * 100), 0.05) << "incorrect value for last_msg_.t_lambda_na, expected 0.00707220705226, is " << last_msg_.t_lambda_na; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.common.fit_interval, 14400) + << "incorrect value for last_msg_.common.fit_interval, expected 14400, " + "is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 0) + << "incorrect value for last_msg_.common.sid.code, expected 0, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.reserved, 0) + << "incorrect value for last_msg_.common.sid.reserved, expected 0, is " + << last_msg_.common.sid.reserved; + EXPECT_EQ(last_msg_.common.sid.sat, 22) + << "incorrect value for last_msg_.common.sid.sat, expected 22, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toa.tow, 446384) + << "incorrect value for last_msg_.common.toa.tow, expected 446384, is " + << last_msg_.common.toa.tow; + EXPECT_EQ(last_msg_.common.toa.wn, 2154) + << "incorrect value for last_msg_.common.toa.wn, expected 2154, is " + << last_msg_.common.toa.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 2.2 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 2.2, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.epsilon * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for last_msg_.epsilon, expected -0.98930366296, is " + << last_msg_.epsilon; + EXPECT_LT((last_msg_.i * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for last_msg_.i, expected 5153.55002975, is " + << last_msg_.i; + EXPECT_LT((last_msg_.lambda_na * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for last_msg_.lambda_na, expected -0.0220007884211, " + "is " + << last_msg_.lambda_na; + EXPECT_LT((last_msg_.omega * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for last_msg_.omega, expected 0.934151448026, is " + << last_msg_.omega; + EXPECT_LT((last_msg_.t * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for last_msg_.t, expected -1.87318184488, is " + << last_msg_.t; + EXPECT_LT((last_msg_.t_dot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for last_msg_.t_dot, expected -8.90358515577e-09, is " + << last_msg_.t_dot; + EXPECT_LT((last_msg_.t_lambda_na * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for last_msg_.t_lambda_na, expected " + "0.00707220705226, is " + << last_msg_.t_lambda_na; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGPS.cc b/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGPS.cc index 9ebaaa958..2ff765426 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGPS.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGPS.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPS.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgAlmanacGPS0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgAlmanacGPS0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgAlmanacGPS0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgAlmanacGPS0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_almanac_gps_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_almanac_gps_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,64 +67,106 @@ class Test_auto_check_sbp_observation_MsgAlmanacGPS0 : sbp_msg_almanac_gps_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgAlmanacGPS0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgAlmanacGPS0, Test) { + uint8_t encoded_frame[] = { + 85, 114, 0, 195, 4, 94, 22, 0, 176, 207, 6, 0, 106, 8, 154, + 153, 153, 153, 153, 153, 1, 64, 64, 56, 0, 0, 1, 0, 142, 41, + 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, 63, 0, + 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, + 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, + 191, 71, 11, 217, 147, 145, 228, 237, 63, 0, 0, 0, 0, 108, 177, + 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 190, 45, + }; - uint8_t encoded_frame[] = {85,114,0,195,4,94,22,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,190,45, }; + sbp_msg_almanac_gps_t test_msg{}; + test_msg.af0 = -0.0006315018981695175; + test_msg.af1 = 8.981260180007666e-12; + test_msg.common.fit_interval = 14400; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 0; + test_msg.common.sid.sat = 22; + test_msg.common.toa.tow = 446384; + test_msg.common.toa.wn = 2154; + test_msg.common.ura = 2.2; + test_msg.common.valid = 1; + test_msg.ecc = 0.007072207052260637; + test_msg.inc = 0.9341514480259797; + test_msg.m0 = -0.02200078842114688; + test_msg.omega0 = -1.8731818448797617; + test_msg.omegadot = -8.903585155774196e-09; + test_msg.sqrta = 5153.550029754639; + test_msg.w = -0.9893036629599647; - sbp_msg_almanac_gps_t test_msg{}; - test_msg.af0 = -0.0006315018981695175; - test_msg.af1 = 8.981260180007666e-12; - test_msg.common.fit_interval = 14400; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 0; - test_msg.common.sid.sat = 22; - test_msg.common.toa.tow = 446384; - test_msg.common.toa.wn = 2154; - test_msg.common.ura = 2.2; - test_msg.common.valid = 1; - test_msg.ecc = 0.007072207052260637; - test_msg.inc = 0.9341514480259797; - test_msg.m0 = -0.02200078842114688; - test_msg.omega0 = -1.8731818448797617; - test_msg.omegadot = -8.903585155774196e-09; - test_msg.sqrta = 5153.550029754639; - test_msg.w = -0.9893036629599647; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " << last_msg_.af1; - EXPECT_EQ(last_msg_.common.fit_interval, 14400) << "incorrect value for last_msg_.common.fit_interval, expected 14400, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 0) << "incorrect value for last_msg_.common.sid.code, expected 0, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.sat, 22) << "incorrect value for last_msg_.common.sid.sat, expected 22, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toa.tow, 446384) << "incorrect value for last_msg_.common.toa.tow, expected 446384, is " << last_msg_.common.toa.tow; - EXPECT_EQ(last_msg_.common.toa.wn, 2154) << "incorrect value for last_msg_.common.toa.wn, expected 2154, is " << last_msg_.common.toa.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 2.2 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 2.2, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " << last_msg_.ecc; - EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.934151448026, is " << last_msg_.inc; - EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, is " << last_msg_.omegadot; - EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) << "incorrect value for last_msg_.w, expected -0.98930366296, is " << last_msg_.w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " + << last_msg_.af1; + EXPECT_EQ(last_msg_.common.fit_interval, 14400) + << "incorrect value for last_msg_.common.fit_interval, expected 14400, " + "is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 0) + << "incorrect value for last_msg_.common.sid.code, expected 0, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.sat, 22) + << "incorrect value for last_msg_.common.sid.sat, expected 22, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toa.tow, 446384) + << "incorrect value for last_msg_.common.toa.tow, expected 446384, is " + << last_msg_.common.toa.tow; + EXPECT_EQ(last_msg_.common.toa.wn, 2154) + << "incorrect value for last_msg_.common.toa.wn, expected 2154, is " + << last_msg_.common.toa.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 2.2 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 2.2, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " + << last_msg_.ecc; + EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.934151448026, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, " + "is " + << last_msg_.omegadot; + EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for last_msg_.w, expected -0.98930366296, is " + << last_msg_.w; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGPSDep.cc b/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGPSDep.cc index 3f59fd766..f7fec8849 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGPSDep.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgAlmanacGPSDep.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPSDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPSDep.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgAlmanacGPSDep0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgAlmanacGPSDep0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgAlmanacGPSDep0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgAlmanacGPSDep0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_almanac_gps_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_almanac_gps_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,66 +67,110 @@ class Test_auto_check_sbp_observation_MsgAlmanacGPSDep0 : sbp_msg_almanac_gps_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgAlmanacGPSDep0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgAlmanacGPSDep0, Test) { + uint8_t encoded_frame[] = { + 85, 112, 0, 195, 4, 96, 22, 0, 0, 0, 176, 207, 6, 0, 106, + 8, 154, 153, 153, 153, 153, 153, 1, 64, 64, 56, 0, 0, 1, 0, + 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, + 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, + 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, + 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, 0, 0, 0, 0, + 108, 177, 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 144, 232, + }; - uint8_t encoded_frame[] = {85,112,0,195,4,96,22,0,0,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,144,232, }; + sbp_msg_almanac_gps_dep_t test_msg{}; + test_msg.af0 = -0.0006315018981695175; + test_msg.af1 = 8.981260180007666e-12; + test_msg.common.fit_interval = 14400; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 0; + test_msg.common.sid.reserved = 0; + test_msg.common.sid.sat = 22; + test_msg.common.toa.tow = 446384; + test_msg.common.toa.wn = 2154; + test_msg.common.ura = 2.2; + test_msg.common.valid = 1; + test_msg.ecc = 0.007072207052260637; + test_msg.inc = 0.9341514480259797; + test_msg.m0 = -0.02200078842114688; + test_msg.omega0 = -1.8731818448797617; + test_msg.omegadot = -8.903585155774196e-09; + test_msg.sqrta = 5153.550029754639; + test_msg.w = -0.9893036629599647; - sbp_msg_almanac_gps_dep_t test_msg{}; - test_msg.af0 = -0.0006315018981695175; - test_msg.af1 = 8.981260180007666e-12; - test_msg.common.fit_interval = 14400; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 0; - test_msg.common.sid.reserved = 0; - test_msg.common.sid.sat = 22; - test_msg.common.toa.tow = 446384; - test_msg.common.toa.wn = 2154; - test_msg.common.ura = 2.2; - test_msg.common.valid = 1; - test_msg.ecc = 0.007072207052260637; - test_msg.inc = 0.9341514480259797; - test_msg.m0 = -0.02200078842114688; - test_msg.omega0 = -1.8731818448797617; - test_msg.omegadot = -8.903585155774196e-09; - test_msg.sqrta = 5153.550029754639; - test_msg.w = -0.9893036629599647; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " << last_msg_.af1; - EXPECT_EQ(last_msg_.common.fit_interval, 14400) << "incorrect value for last_msg_.common.fit_interval, expected 14400, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 0) << "incorrect value for last_msg_.common.sid.code, expected 0, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.reserved, 0) << "incorrect value for last_msg_.common.sid.reserved, expected 0, is " << last_msg_.common.sid.reserved; - EXPECT_EQ(last_msg_.common.sid.sat, 22) << "incorrect value for last_msg_.common.sid.sat, expected 22, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toa.tow, 446384) << "incorrect value for last_msg_.common.toa.tow, expected 446384, is " << last_msg_.common.toa.tow; - EXPECT_EQ(last_msg_.common.toa.wn, 2154) << "incorrect value for last_msg_.common.toa.wn, expected 2154, is " << last_msg_.common.toa.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 2.2 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 2.2, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " << last_msg_.ecc; - EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.934151448026, is " << last_msg_.inc; - EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, is " << last_msg_.omegadot; - EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) << "incorrect value for last_msg_.w, expected -0.98930366296, is " << last_msg_.w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " + << last_msg_.af1; + EXPECT_EQ(last_msg_.common.fit_interval, 14400) + << "incorrect value for last_msg_.common.fit_interval, expected 14400, " + "is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 0) + << "incorrect value for last_msg_.common.sid.code, expected 0, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.reserved, 0) + << "incorrect value for last_msg_.common.sid.reserved, expected 0, is " + << last_msg_.common.sid.reserved; + EXPECT_EQ(last_msg_.common.sid.sat, 22) + << "incorrect value for last_msg_.common.sid.sat, expected 22, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toa.tow, 446384) + << "incorrect value for last_msg_.common.toa.tow, expected 446384, is " + << last_msg_.common.toa.tow; + EXPECT_EQ(last_msg_.common.toa.wn, 2154) + << "incorrect value for last_msg_.common.toa.wn, expected 2154, is " + << last_msg_.common.toa.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 2.2 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 2.2, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " + << last_msg_.ecc; + EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.934151448026, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, " + "is " + << last_msg_.omegadot; + EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for last_msg_.w, expected -0.98930366296, is " + << last_msg_.w; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgBasePosEcef.cc b/c/test/cpp/auto_check_sbp_observation_MsgBasePosEcef.cc index 5f6992a6f..9b1dd0cc6 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgBasePosEcef.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgBasePosEcef.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosEcef.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosEcef.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgBasePosEcef0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgBasePosEcef0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgBasePosEcef0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgBasePosEcef0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_base_pos_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_base_pos_ecef_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,36 +67,44 @@ class Test_auto_check_sbp_observation_MsgBasePosEcef0 : sbp_msg_base_pos_ecef_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgBasePosEcef0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgBasePosEcef0, Test) { + uint8_t encoded_frame[] = { + 85, 72, 0, 0, 0, 24, 228, 131, 158, 245, 87, + 205, 68, 193, 66, 62, 232, 209, 32, 118, 80, 193, + 213, 231, 106, 251, 63, 20, 77, 65, 194, 125, + }; - uint8_t encoded_frame[] = {85,72,0,0,0,24,228,131,158,245,87,205,68,193,66,62,232,209,32,118,80,193,213,231,106,251,63,20,77,65,194,125, }; + sbp_msg_base_pos_ecef_t test_msg{}; + test_msg.x = -2726575.9189; + test_msg.y = -4315267.2798; + test_msg.z = 3811455.9642; - sbp_msg_base_pos_ecef_t test_msg{}; - test_msg.x = -2726575.9189; - test_msg.y = -4315267.2798; - test_msg.z = 3811455.9642; - - EXPECT_EQ(send_message( 0, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(0, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.x * 100 - -2726575.9189 * 100), 0.05) << "incorrect value for last_msg_.x, expected -2726575.9189, is " << last_msg_.x; - EXPECT_LT((last_msg_.y * 100 - -4315267.2798 * 100), 0.05) << "incorrect value for last_msg_.y, expected -4315267.2798, is " << last_msg_.y; - EXPECT_LT((last_msg_.z * 100 - 3811455.9642 * 100), 0.05) << "incorrect value for last_msg_.z, expected 3811455.9642, is " << last_msg_.z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.x * 100 - -2726575.9189 * 100), 0.05) + << "incorrect value for last_msg_.x, expected -2726575.9189, is " + << last_msg_.x; + EXPECT_LT((last_msg_.y * 100 - -4315267.2798 * 100), 0.05) + << "incorrect value for last_msg_.y, expected -4315267.2798, is " + << last_msg_.y; + EXPECT_LT((last_msg_.z * 100 - 3811455.9642 * 100), 0.05) + << "incorrect value for last_msg_.z, expected 3811455.9642, is " + << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgBasePosLLH.cc b/c/test/cpp/auto_check_sbp_observation_MsgBasePosLLH.cc index b5ac26625..636973adf 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgBasePosLLH.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgBasePosLLH.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosLLH.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosLLH.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgBasePosLLH0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgBasePosLLH0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgBasePosLLH0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgBasePosLLH0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_base_pos_llh_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_base_pos_llh_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,36 +67,43 @@ class Test_auto_check_sbp_observation_MsgBasePosLLH0 : sbp_msg_base_pos_llh_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgBasePosLLH0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgBasePosLLH0, Test) { + uint8_t encoded_frame[] = { + 85, 68, 0, 123, 0, 24, 225, 237, 238, 90, 42, 160, 66, 64, 59, 143, + 70, 235, 0, 120, 94, 192, 51, 181, 124, 240, 65, 248, 66, 64, 82, 230, + }; - uint8_t encoded_frame[] = {85,68,0,123,0,24,225,237,238,90,42,160,66,64,59,143,70,235,0,120,94,192,51,181,124,240,65,248,66,64,82,230, }; + sbp_msg_base_pos_llh_t test_msg{}; + test_msg.height = 37.939512310879216; + test_msg.lat = 37.251292578377395; + test_msg.lon = -121.87505609407974; - sbp_msg_base_pos_llh_t test_msg{}; - test_msg.height = 37.939512310879216; - test_msg.lat = 37.251292578377395; - test_msg.lon = -121.87505609407974; - - EXPECT_EQ(send_message( 123, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(123, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.height * 100 - 37.9395123109 * 100), 0.05) << "incorrect value for last_msg_.height, expected 37.9395123109, is " << last_msg_.height; - EXPECT_LT((last_msg_.lat * 100 - 37.2512925784 * 100), 0.05) << "incorrect value for last_msg_.lat, expected 37.2512925784, is " << last_msg_.lat; - EXPECT_LT((last_msg_.lon * 100 - -121.875056094 * 100), 0.05) << "incorrect value for last_msg_.lon, expected -121.875056094, is " << last_msg_.lon; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.height * 100 - 37.9395123109 * 100), 0.05) + << "incorrect value for last_msg_.height, expected 37.9395123109, is " + << last_msg_.height; + EXPECT_LT((last_msg_.lat * 100 - 37.2512925784 * 100), 0.05) + << "incorrect value for last_msg_.lat, expected 37.2512925784, is " + << last_msg_.lat; + EXPECT_LT((last_msg_.lon * 100 - -121.875056094 * 100), 0.05) + << "incorrect value for last_msg_.lon, expected -121.875056094, is " + << last_msg_.lon; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisBds.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisBds.cc index 5a113ea2a..fd30f33a7 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisBds.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisBds.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisBds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisBds.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisBds0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisBds0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisBds0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisBds0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_bds_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_bds_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,94 +67,170 @@ class Test_auto_check_sbp_observation_MsgEphemerisBds0 : sbp_msg_ephemeris_bds_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisBds0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisBds0, Test) { + uint8_t encoded_frame[] = { + 85, 137, 0, 128, 240, 147, 8, 12, 174, 179, 6, 0, 106, 8, 0, + 0, 0, 64, 48, 42, 0, 0, 1, 0, 125, 99, 52, 50, 207, 46, + 151, 176, 0, 112, 96, 67, 0, 164, 106, 67, 0, 60, 255, 54, 0, + 224, 47, 53, 0, 0, 143, 179, 0, 192, 190, 52, 146, 101, 162, 196, + 109, 104, 19, 62, 253, 87, 86, 202, 62, 28, 251, 63, 0, 0, 0, + 96, 151, 60, 117, 63, 0, 0, 128, 154, 127, 93, 185, 64, 151, 193, + 64, 0, 10, 166, 4, 192, 160, 75, 174, 98, 8, 201, 35, 190, 205, + 29, 12, 71, 189, 150, 5, 192, 176, 72, 249, 189, 193, 172, 240, 63, + 72, 249, 188, 180, 160, 203, 9, 62, 0, 0, 0, 0, 92, 51, 77, + 191, 0, 128, 174, 43, 0, 0, 88, 161, 174, 179, 6, 0, 106, 8, + 6, 5, 0, 157, 249, + }; - uint8_t encoded_frame[] = {85,137,0,128,240,147,8,12,174,179,6,0,106,8,0,0,0,64,48,42,0,0,1,0,125,99,52,50,207,46,151,176,0,112,96,67,0,164,106,67,0,60,255,54,0,224,47,53,0,0,143,179,0,192,190,52,146,101,162,196,109,104,19,62,253,87,86,202,62,28,251,63,0,0,0,96,151,60,117,63,0,0,128,154,127,93,185,64,151,193,64,0,10,166,4,192,160,75,174,98,8,201,35,190,205,29,12,71,189,150,5,192,176,72,249,189,193,172,240,63,72,249,188,180,160,203,9,62,0,0,0,0,92,51,77,191,0,128,174,43,0,0,88,161,174,179,6,0,106,8,6,5,0,157,249, }; + sbp_msg_ephemeris_bds_t test_msg{}; + test_msg.af0 = -0.0008911322802305222; + test_msg.af1 = 1.2398970739013748e-12; + test_msg.af2 = -7.318364664277155e-19; + test_msg.c_ic = -6.658956408500671e-08; + test_msg.c_is = 3.5529956221580505e-07; + test_msg.c_rc = 234.640625; + test_msg.c_rs = 224.4375; + test_msg.c_uc = 7.606577128171921e-06; + test_msg.c_us = 6.551854312419891e-07; + test_msg.common.fit_interval = 10800; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 12; + test_msg.common.sid.sat = 8; + test_msg.common.toe.tow = 439214; + test_msg.common.toe.wn = 2154; + test_msg.common.ura = 2.0; + test_msg.common.valid = 1; + test_msg.dn = 1.1296899132622133e-09; + test_msg.ecc = 0.005184737499803305; + test_msg.inc = 1.0421769543504915; + test_msg.inc_dot = 7.507455572801683e-10; + test_msg.iodc = 5; + test_msg.iode = 6; + test_msg.m0 = 1.6943958190727237; + test_msg.omega0 = -2.581073762870982; + test_msg.omegadot = -2.303310227830545e-09; + test_msg.sqrta = 6493.49845123291; + test_msg.tgd1 = 1.0499999980595476e-08; + test_msg.tgd2 = -1.0999999799921056e-09; + test_msg.toc.tow = 439214; + test_msg.toc.wn = 2154; + test_msg.w = -2.698603205735458; - sbp_msg_ephemeris_bds_t test_msg{}; - test_msg.af0 = -0.0008911322802305222; - test_msg.af1 = 1.2398970739013748e-12; - test_msg.af2 = -7.318364664277155e-19; - test_msg.c_ic = -6.658956408500671e-08; - test_msg.c_is = 3.5529956221580505e-07; - test_msg.c_rc = 234.640625; - test_msg.c_rs = 224.4375; - test_msg.c_uc = 7.606577128171921e-06; - test_msg.c_us = 6.551854312419891e-07; - test_msg.common.fit_interval = 10800; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 12; - test_msg.common.sid.sat = 8; - test_msg.common.toe.tow = 439214; - test_msg.common.toe.wn = 2154; - test_msg.common.ura = 2.0; - test_msg.common.valid = 1; - test_msg.dn = 1.1296899132622133e-09; - test_msg.ecc = 0.005184737499803305; - test_msg.inc = 1.0421769543504915; - test_msg.inc_dot = 7.507455572801683e-10; - test_msg.iodc = 5; - test_msg.iode = 6; - test_msg.m0 = 1.6943958190727237; - test_msg.omega0 = -2.581073762870982; - test_msg.omegadot = -2.303310227830545e-09; - test_msg.sqrta = 6493.49845123291; - test_msg.tgd1 = 1.0499999980595476e-08; - test_msg.tgd2 = -1.0999999799921056e-09; - test_msg.toc.tow = 439214; - test_msg.toc.wn = 2154; - test_msg.w = -2.698603205735458; - - EXPECT_EQ(send_message( 61568, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(61568, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61568); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - -0.000891132280231 * 100), 0.05) << "incorrect value for last_msg_.af0, expected -0.000891132280231, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - 1.2398970739e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected 1.2398970739e-12, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - -7.31836466428e-19 * 100), 0.05) << "incorrect value for last_msg_.af2, expected -7.31836466428e-19, is " << last_msg_.af2; - EXPECT_LT((last_msg_.c_ic * 100 - -6.6589564085e-08 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected -6.6589564085e-08, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - 3.55299562216e-07 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected 3.55299562216e-07, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - 234.640625 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected 234.640625, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - 224.4375 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected 224.4375, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - 7.60657712817e-06 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected 7.60657712817e-06, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 6.55185431242e-07 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 6.55185431242e-07, is " << last_msg_.c_us; - EXPECT_EQ(last_msg_.common.fit_interval, 10800) << "incorrect value for last_msg_.common.fit_interval, expected 10800, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 12) << "incorrect value for last_msg_.common.sid.code, expected 12, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.sat, 8) << "incorrect value for last_msg_.common.sid.sat, expected 8, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toe.tow, 439214) << "incorrect value for last_msg_.common.toe.tow, expected 439214, is " << last_msg_.common.toe.tow; - EXPECT_EQ(last_msg_.common.toe.wn, 2154) << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " << last_msg_.common.toe.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 2.0, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.dn * 100 - 1.12968991326e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 1.12968991326e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.0051847374998 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.0051847374998, is " << last_msg_.ecc; - EXPECT_LT((last_msg_.inc * 100 - 1.04217695435 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 1.04217695435, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - 7.5074555728e-10 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected 7.5074555728e-10, is " << last_msg_.inc_dot; - EXPECT_EQ(last_msg_.iodc, 5) << "incorrect value for last_msg_.iodc, expected 5, is " << last_msg_.iodc; - EXPECT_EQ(last_msg_.iode, 6) << "incorrect value for last_msg_.iode, expected 6, is " << last_msg_.iode; - EXPECT_LT((last_msg_.m0 * 100 - 1.69439581907 * 100), 0.05) << "incorrect value for last_msg_.m0, expected 1.69439581907, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - -2.58107376287 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected -2.58107376287, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -2.30331022783e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -2.30331022783e-09, is " << last_msg_.omegadot; - EXPECT_LT((last_msg_.sqrta * 100 - 6493.49845123 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 6493.49845123, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.tgd1 * 100 - 1.04999999806e-08 * 100), 0.05) << "incorrect value for last_msg_.tgd1, expected 1.04999999806e-08, is " << last_msg_.tgd1; - EXPECT_LT((last_msg_.tgd2 * 100 - -1.09999997999e-09 * 100), 0.05) << "incorrect value for last_msg_.tgd2, expected -1.09999997999e-09, is " << last_msg_.tgd2; - EXPECT_EQ(last_msg_.toc.tow, 439214) << "incorrect value for last_msg_.toc.tow, expected 439214, is " << last_msg_.toc.tow; - EXPECT_EQ(last_msg_.toc.wn, 2154) << "incorrect value for last_msg_.toc.wn, expected 2154, is " << last_msg_.toc.wn; - EXPECT_LT((last_msg_.w * 100 - -2.69860320574 * 100), 0.05) << "incorrect value for last_msg_.w, expected -2.69860320574, is " << last_msg_.w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61568); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - -0.000891132280231 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected -0.000891132280231, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - 1.2398970739e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected 1.2398970739e-12, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - -7.31836466428e-19 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected -7.31836466428e-19, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.c_ic * 100 - -6.6589564085e-08 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected -6.6589564085e-08, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - 3.55299562216e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected 3.55299562216e-07, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - 234.640625 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected 234.640625, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - 224.4375 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected 224.4375, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - 7.60657712817e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected 7.60657712817e-06, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 6.55185431242e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 6.55185431242e-07, is " + << last_msg_.c_us; + EXPECT_EQ(last_msg_.common.fit_interval, 10800) + << "incorrect value for last_msg_.common.fit_interval, expected 10800, " + "is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 12) + << "incorrect value for last_msg_.common.sid.code, expected 12, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.sat, 8) + << "incorrect value for last_msg_.common.sid.sat, expected 8, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toe.tow, 439214) + << "incorrect value for last_msg_.common.toe.tow, expected 439214, is " + << last_msg_.common.toe.tow; + EXPECT_EQ(last_msg_.common.toe.wn, 2154) + << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " + << last_msg_.common.toe.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 2.0, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.dn * 100 - 1.12968991326e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 1.12968991326e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.0051847374998 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.0051847374998, is " + << last_msg_.ecc; + EXPECT_LT((last_msg_.inc * 100 - 1.04217695435 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 1.04217695435, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - 7.5074555728e-10 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected 7.5074555728e-10, is " + << last_msg_.inc_dot; + EXPECT_EQ(last_msg_.iodc, 5) + << "incorrect value for last_msg_.iodc, expected 5, is " + << last_msg_.iodc; + EXPECT_EQ(last_msg_.iode, 6) + << "incorrect value for last_msg_.iode, expected 6, is " + << last_msg_.iode; + EXPECT_LT((last_msg_.m0 * 100 - 1.69439581907 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected 1.69439581907, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - -2.58107376287 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected -2.58107376287, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -2.30331022783e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -2.30331022783e-09, " + "is " + << last_msg_.omegadot; + EXPECT_LT((last_msg_.sqrta * 100 - 6493.49845123 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 6493.49845123, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.tgd1 * 100 - 1.04999999806e-08 * 100), 0.05) + << "incorrect value for last_msg_.tgd1, expected 1.04999999806e-08, is " + << last_msg_.tgd1; + EXPECT_LT((last_msg_.tgd2 * 100 - -1.09999997999e-09 * 100), 0.05) + << "incorrect value for last_msg_.tgd2, expected -1.09999997999e-09, is " + << last_msg_.tgd2; + EXPECT_EQ(last_msg_.toc.tow, 439214) + << "incorrect value for last_msg_.toc.tow, expected 439214, is " + << last_msg_.toc.tow; + EXPECT_EQ(last_msg_.toc.wn, 2154) + << "incorrect value for last_msg_.toc.wn, expected 2154, is " + << last_msg_.toc.wn; + EXPECT_LT((last_msg_.w * 100 - -2.69860320574 * 100), 0.05) + << "incorrect value for last_msg_.w, expected -2.69860320574, is " + << last_msg_.w; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisDepA.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisDepA.cc index 3a6894683..16f5801ed 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisDepA.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,82 +67,147 @@ class Test_auto_check_sbp_observation_MsgEphemerisDepA0 : sbp_msg_ephemeris_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisDepA0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 26, 0, 195, 4, 175, 0, 0, 0, 0, 0, 0, 83, 190, 0, + 0, 0, 0, 0, 40, 74, 192, 0, 0, 0, 0, 0, 74, 115, 64, + 0, 0, 0, 0, 0, 4, 199, 190, 0, 0, 0, 0, 0, 80, 202, + 62, 0, 0, 0, 0, 0, 0, 64, 62, 0, 0, 0, 0, 0, 0, + 127, 190, 114, 216, 96, 180, 49, 117, 56, 62, 142, 41, 5, 235, 95, + 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, 63, 0, 0, 192, 206, + 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, + 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, 71, 11, + 217, 147, 145, 228, 237, 63, 221, 47, 100, 224, 255, 47, 198, 189, 0, + 0, 0, 0, 108, 177, 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, + 154, 153, 153, 153, 153, 153, 201, 63, 205, 204, 204, 204, 192, 62, 27, + 65, 106, 8, 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, 1, 0, + 22, 242, 84, + }; - uint8_t encoded_frame[] = {85,26,0,195,4,175,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,154,153,153,153,153,153,201,63,205,204,204,204,192,62,27,65,106,8,205,204,204,204,192,62,27,65,106,8,1,0,22,242,84, }; + sbp_msg_ephemeris_dep_a_t test_msg{}; + test_msg.af0 = -0.0006315018981695175; + test_msg.af1 = 8.981260180007666e-12; + test_msg.af2 = 0.2; + test_msg.c_ic = 7.450580596923828e-09; + test_msg.c_is = -1.1548399925231934e-07; + test_msg.c_rc = 308.625; + test_msg.c_rs = -52.3125; + test_msg.c_uc = -2.7436763048171997e-06; + test_msg.c_us = 3.1366944313049316e-06; + test_msg.dn = 5.694522914022375e-09; + test_msg.ecc = 0.007072207052260637; + test_msg.healthy = 0; + test_msg.inc = 0.9341514480259797; + test_msg.inc_dot = -4.035882396415757e-11; + test_msg.m0 = -0.02200078842114688; + test_msg.omega0 = -1.8731818448797617; + test_msg.omegadot = -8.903585155774196e-09; + test_msg.prn = 22; + test_msg.sqrta = 5153.550029754639; + test_msg.tgd = -1.7695128917694092e-08; + test_msg.toc_tow = 446384.2; + test_msg.toc_wn = 2154; + test_msg.toe_tow = 446384.2; + test_msg.toe_wn = 2154; + test_msg.valid = 1; + test_msg.w = -0.9893036629599647; - sbp_msg_ephemeris_dep_a_t test_msg{}; - test_msg.af0 = -0.0006315018981695175; - test_msg.af1 = 8.981260180007666e-12; - test_msg.af2 = 0.2; - test_msg.c_ic = 7.450580596923828e-09; - test_msg.c_is = -1.1548399925231934e-07; - test_msg.c_rc = 308.625; - test_msg.c_rs = -52.3125; - test_msg.c_uc = -2.7436763048171997e-06; - test_msg.c_us = 3.1366944313049316e-06; - test_msg.dn = 5.694522914022375e-09; - test_msg.ecc = 0.007072207052260637; - test_msg.healthy = 0; - test_msg.inc = 0.9341514480259797; - test_msg.inc_dot = -4.035882396415757e-11; - test_msg.m0 = -0.02200078842114688; - test_msg.omega0 = -1.8731818448797617; - test_msg.omegadot = -8.903585155774196e-09; - test_msg.prn = 22; - test_msg.sqrta = 5153.550029754639; - test_msg.tgd = -1.7695128917694092e-08; - test_msg.toc_tow = 446384.2; - test_msg.toc_wn = 2154; - test_msg.toe_tow = 446384.2; - test_msg.toe_wn = 2154; - test_msg.valid = 1; - test_msg.w = -0.9893036629599647; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - 0.2 * 100), 0.05) << "incorrect value for last_msg_.af2, expected 0.2, is " << last_msg_.af2; - EXPECT_LT((last_msg_.c_ic * 100 - 7.45058059692e-09 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected 7.45058059692e-09, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - -1.15483999252e-07 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected -1.15483999252e-07, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - 308.625 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected 308.625, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - -52.3125 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected -52.3125, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - -2.74367630482e-06 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected -2.74367630482e-06, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 3.1366944313e-06 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 3.1366944313e-06, is " << last_msg_.c_us; - EXPECT_LT((last_msg_.dn * 100 - 5.69452291402e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 5.69452291402e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " << last_msg_.ecc; - EXPECT_EQ(last_msg_.healthy, 0) << "incorrect value for last_msg_.healthy, expected 0, is " << last_msg_.healthy; - EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.934151448026, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected -4.03588239642e-11, is " << last_msg_.inc_dot; - EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, is " << last_msg_.omegadot; - EXPECT_EQ(last_msg_.prn, 22) << "incorrect value for last_msg_.prn, expected 22, is " << last_msg_.prn; - EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.tgd * 100 - -1.76951289177e-08 * 100), 0.05) << "incorrect value for last_msg_.tgd, expected -1.76951289177e-08, is " << last_msg_.tgd; - EXPECT_LT((last_msg_.toc_tow * 100 - 446384.2 * 100), 0.05) << "incorrect value for last_msg_.toc_tow, expected 446384.2, is " << last_msg_.toc_tow; - EXPECT_EQ(last_msg_.toc_wn, 2154) << "incorrect value for last_msg_.toc_wn, expected 2154, is " << last_msg_.toc_wn; - EXPECT_LT((last_msg_.toe_tow * 100 - 446384.2 * 100), 0.05) << "incorrect value for last_msg_.toe_tow, expected 446384.2, is " << last_msg_.toe_tow; - EXPECT_EQ(last_msg_.toe_wn, 2154) << "incorrect value for last_msg_.toe_wn, expected 2154, is " << last_msg_.toe_wn; - EXPECT_EQ(last_msg_.valid, 1) << "incorrect value for last_msg_.valid, expected 1, is " << last_msg_.valid; - EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) << "incorrect value for last_msg_.w, expected -0.98930366296, is " << last_msg_.w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - 0.2 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected 0.2, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.c_ic * 100 - 7.45058059692e-09 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected 7.45058059692e-09, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - -1.15483999252e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected -1.15483999252e-07, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - 308.625 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected 308.625, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - -52.3125 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected -52.3125, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - -2.74367630482e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected -2.74367630482e-06, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 3.1366944313e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 3.1366944313e-06, is " + << last_msg_.c_us; + EXPECT_LT((last_msg_.dn * 100 - 5.69452291402e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 5.69452291402e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " + << last_msg_.ecc; + EXPECT_EQ(last_msg_.healthy, 0) + << "incorrect value for last_msg_.healthy, expected 0, is " + << last_msg_.healthy; + EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.934151448026, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected -4.03588239642e-11, " + "is " + << last_msg_.inc_dot; + EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, " + "is " + << last_msg_.omegadot; + EXPECT_EQ(last_msg_.prn, 22) + << "incorrect value for last_msg_.prn, expected 22, is " << last_msg_.prn; + EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.tgd * 100 - -1.76951289177e-08 * 100), 0.05) + << "incorrect value for last_msg_.tgd, expected -1.76951289177e-08, is " + << last_msg_.tgd; + EXPECT_LT((last_msg_.toc_tow * 100 - 446384.2 * 100), 0.05) + << "incorrect value for last_msg_.toc_tow, expected 446384.2, is " + << last_msg_.toc_tow; + EXPECT_EQ(last_msg_.toc_wn, 2154) + << "incorrect value for last_msg_.toc_wn, expected 2154, is " + << last_msg_.toc_wn; + EXPECT_LT((last_msg_.toe_tow * 100 - 446384.2 * 100), 0.05) + << "incorrect value for last_msg_.toe_tow, expected 446384.2, is " + << last_msg_.toe_tow; + EXPECT_EQ(last_msg_.toe_wn, 2154) + << "incorrect value for last_msg_.toe_wn, expected 2154, is " + << last_msg_.toe_wn; + EXPECT_EQ(last_msg_.valid, 1) + << "incorrect value for last_msg_.valid, expected 1, is " + << last_msg_.valid; + EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for last_msg_.w, expected -0.98930366296, is " + << last_msg_.w; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisDepC.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisDepC.cc index 490cf5f2c..ade41715e 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisDepC.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisDepC.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepC.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisDepC0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisDepC0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisDepC0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisDepC0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_dep_c_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,92 +67,168 @@ class Test_auto_check_sbp_observation_MsgEphemerisDepC0 : sbp_msg_ephemeris_dep_c_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisDepC0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisDepC0, Test) { + uint8_t encoded_frame[] = { + 85, 71, 0, 195, 4, 185, 0, 0, 0, 0, 0, 0, 83, 190, 0, + 0, 0, 0, 0, 40, 74, 192, 0, 0, 0, 0, 0, 74, 115, 64, + 0, 0, 0, 0, 0, 4, 199, 190, 0, 0, 0, 0, 0, 80, 202, + 62, 0, 0, 0, 0, 0, 0, 64, 62, 0, 0, 0, 0, 0, 0, + 127, 190, 114, 216, 96, 180, 49, 117, 56, 62, 142, 41, 5, 235, 95, + 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, 63, 0, 0, 192, 206, + 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, + 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, 71, 11, + 217, 147, 145, 228, 237, 63, 221, 47, 100, 224, 255, 47, 198, 189, 0, + 0, 0, 0, 108, 177, 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, + 154, 153, 153, 153, 153, 153, 201, 63, 205, 204, 204, 204, 192, 62, 27, + 65, 106, 8, 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, 1, 0, + 22, 0, 0, 0, 45, 45, 0, 0, 0, 0, 0, 23, 170, + }; - uint8_t encoded_frame[] = {85,71,0,195,4,185,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,154,153,153,153,153,153,201,63,205,204,204,204,192,62,27,65,106,8,205,204,204,204,192,62,27,65,106,8,1,0,22,0,0,0,45,45,0,0,0,0,0,23,170, }; + sbp_msg_ephemeris_dep_c_t test_msg{}; + test_msg.af0 = -0.0006315018981695175; + test_msg.af1 = 8.981260180007666e-12; + test_msg.af2 = 0.2; + test_msg.c_ic = 7.450580596923828e-09; + test_msg.c_is = -1.1548399925231934e-07; + test_msg.c_rc = 308.625; + test_msg.c_rs = -52.3125; + test_msg.c_uc = -2.7436763048171997e-06; + test_msg.c_us = 3.1366944313049316e-06; + test_msg.dn = 5.694522914022375e-09; + test_msg.ecc = 0.007072207052260637; + test_msg.healthy = 0; + test_msg.inc = 0.9341514480259797; + test_msg.inc_dot = -4.035882396415757e-11; + test_msg.iodc = 45; + test_msg.iode = 45; + test_msg.m0 = -0.02200078842114688; + test_msg.omega0 = -1.8731818448797617; + test_msg.omegadot = -8.903585155774196e-09; + test_msg.reserved = 0; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 22; + test_msg.sqrta = 5153.550029754639; + test_msg.tgd = -1.7695128917694092e-08; + test_msg.toc_tow = 446384.2; + test_msg.toc_wn = 2154; + test_msg.toe_tow = 446384.2; + test_msg.toe_wn = 2154; + test_msg.valid = 1; + test_msg.w = -0.9893036629599647; - sbp_msg_ephemeris_dep_c_t test_msg{}; - test_msg.af0 = -0.0006315018981695175; - test_msg.af1 = 8.981260180007666e-12; - test_msg.af2 = 0.2; - test_msg.c_ic = 7.450580596923828e-09; - test_msg.c_is = -1.1548399925231934e-07; - test_msg.c_rc = 308.625; - test_msg.c_rs = -52.3125; - test_msg.c_uc = -2.7436763048171997e-06; - test_msg.c_us = 3.1366944313049316e-06; - test_msg.dn = 5.694522914022375e-09; - test_msg.ecc = 0.007072207052260637; - test_msg.healthy = 0; - test_msg.inc = 0.9341514480259797; - test_msg.inc_dot = -4.035882396415757e-11; - test_msg.iodc = 45; - test_msg.iode = 45; - test_msg.m0 = -0.02200078842114688; - test_msg.omega0 = -1.8731818448797617; - test_msg.omegadot = -8.903585155774196e-09; - test_msg.reserved = 0; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 22; - test_msg.sqrta = 5153.550029754639; - test_msg.tgd = -1.7695128917694092e-08; - test_msg.toc_tow = 446384.2; - test_msg.toc_wn = 2154; - test_msg.toe_tow = 446384.2; - test_msg.toe_wn = 2154; - test_msg.valid = 1; - test_msg.w = -0.9893036629599647; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - 0.2 * 100), 0.05) << "incorrect value for last_msg_.af2, expected 0.2, is " << last_msg_.af2; - EXPECT_LT((last_msg_.c_ic * 100 - 7.45058059692e-09 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected 7.45058059692e-09, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - -1.15483999252e-07 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected -1.15483999252e-07, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - 308.625 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected 308.625, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - -52.3125 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected -52.3125, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - -2.74367630482e-06 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected -2.74367630482e-06, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 3.1366944313e-06 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 3.1366944313e-06, is " << last_msg_.c_us; - EXPECT_LT((last_msg_.dn * 100 - 5.69452291402e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 5.69452291402e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " << last_msg_.ecc; - EXPECT_EQ(last_msg_.healthy, 0) << "incorrect value for last_msg_.healthy, expected 0, is " << last_msg_.healthy; - EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.934151448026, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected -4.03588239642e-11, is " << last_msg_.inc_dot; - EXPECT_EQ(last_msg_.iodc, 45) << "incorrect value for last_msg_.iodc, expected 45, is " << last_msg_.iodc; - EXPECT_EQ(last_msg_.iode, 45) << "incorrect value for last_msg_.iode, expected 45, is " << last_msg_.iode; - EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, is " << last_msg_.omegadot; - EXPECT_EQ(last_msg_.reserved, 0) << "incorrect value for last_msg_.reserved, expected 0, is " << last_msg_.reserved; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 22) << "incorrect value for last_msg_.sid.sat, expected 22, is " << last_msg_.sid.sat; - EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.tgd * 100 - -1.76951289177e-08 * 100), 0.05) << "incorrect value for last_msg_.tgd, expected -1.76951289177e-08, is " << last_msg_.tgd; - EXPECT_LT((last_msg_.toc_tow * 100 - 446384.2 * 100), 0.05) << "incorrect value for last_msg_.toc_tow, expected 446384.2, is " << last_msg_.toc_tow; - EXPECT_EQ(last_msg_.toc_wn, 2154) << "incorrect value for last_msg_.toc_wn, expected 2154, is " << last_msg_.toc_wn; - EXPECT_LT((last_msg_.toe_tow * 100 - 446384.2 * 100), 0.05) << "incorrect value for last_msg_.toe_tow, expected 446384.2, is " << last_msg_.toe_tow; - EXPECT_EQ(last_msg_.toe_wn, 2154) << "incorrect value for last_msg_.toe_wn, expected 2154, is " << last_msg_.toe_wn; - EXPECT_EQ(last_msg_.valid, 1) << "incorrect value for last_msg_.valid, expected 1, is " << last_msg_.valid; - EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) << "incorrect value for last_msg_.w, expected -0.98930366296, is " << last_msg_.w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - 0.2 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected 0.2, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.c_ic * 100 - 7.45058059692e-09 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected 7.45058059692e-09, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - -1.15483999252e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected -1.15483999252e-07, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - 308.625 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected 308.625, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - -52.3125 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected -52.3125, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - -2.74367630482e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected -2.74367630482e-06, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 3.1366944313e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 3.1366944313e-06, is " + << last_msg_.c_us; + EXPECT_LT((last_msg_.dn * 100 - 5.69452291402e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 5.69452291402e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " + << last_msg_.ecc; + EXPECT_EQ(last_msg_.healthy, 0) + << "incorrect value for last_msg_.healthy, expected 0, is " + << last_msg_.healthy; + EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.934151448026, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected -4.03588239642e-11, " + "is " + << last_msg_.inc_dot; + EXPECT_EQ(last_msg_.iodc, 45) + << "incorrect value for last_msg_.iodc, expected 45, is " + << last_msg_.iodc; + EXPECT_EQ(last_msg_.iode, 45) + << "incorrect value for last_msg_.iode, expected 45, is " + << last_msg_.iode; + EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, " + "is " + << last_msg_.omegadot; + EXPECT_EQ(last_msg_.reserved, 0) + << "incorrect value for last_msg_.reserved, expected 0, is " + << last_msg_.reserved; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 22) + << "incorrect value for last_msg_.sid.sat, expected 22, is " + << last_msg_.sid.sat; + EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.tgd * 100 - -1.76951289177e-08 * 100), 0.05) + << "incorrect value for last_msg_.tgd, expected -1.76951289177e-08, is " + << last_msg_.tgd; + EXPECT_LT((last_msg_.toc_tow * 100 - 446384.2 * 100), 0.05) + << "incorrect value for last_msg_.toc_tow, expected 446384.2, is " + << last_msg_.toc_tow; + EXPECT_EQ(last_msg_.toc_wn, 2154) + << "incorrect value for last_msg_.toc_wn, expected 2154, is " + << last_msg_.toc_wn; + EXPECT_LT((last_msg_.toe_tow * 100 - 446384.2 * 100), 0.05) + << "incorrect value for last_msg_.toe_tow, expected 446384.2, is " + << last_msg_.toe_tow; + EXPECT_EQ(last_msg_.toe_wn, 2154) + << "incorrect value for last_msg_.toe_wn, expected 2154, is " + << last_msg_.toe_wn; + EXPECT_EQ(last_msg_.valid, 1) + << "incorrect value for last_msg_.valid, expected 1, is " + << last_msg_.valid; + EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for last_msg_.w, expected -0.98930366296, is " + << last_msg_.w; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisDepD.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisDepD.cc index 46db1cdf7..22a1b96d2 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisDepD.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisDepD.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepD.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepD.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisDepD0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisDepD0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisDepD0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisDepD0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_dep_d_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_dep_d_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,92 +67,168 @@ class Test_auto_check_sbp_observation_MsgEphemerisDepD0 : sbp_msg_ephemeris_dep_d_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisDepD0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisDepD0, Test) { + uint8_t encoded_frame[] = { + 85, 128, 0, 195, 4, 185, 0, 0, 0, 0, 0, 0, 83, 190, 0, + 0, 0, 0, 0, 40, 74, 192, 0, 0, 0, 0, 0, 74, 115, 64, + 0, 0, 0, 0, 0, 4, 199, 190, 0, 0, 0, 0, 0, 80, 202, + 62, 0, 0, 0, 0, 0, 0, 64, 62, 0, 0, 0, 0, 0, 0, + 127, 190, 114, 216, 96, 180, 49, 117, 56, 62, 142, 41, 5, 235, 95, + 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, 63, 0, 0, 192, 206, + 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, + 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, 71, 11, + 217, 147, 145, 228, 237, 63, 221, 47, 100, 224, 255, 47, 198, 189, 0, + 0, 0, 0, 108, 177, 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, + 154, 153, 153, 153, 153, 153, 201, 63, 205, 204, 204, 204, 192, 62, 27, + 65, 106, 8, 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, 1, 0, + 22, 0, 0, 0, 45, 45, 0, 0, 0, 0, 0, 95, 7, + }; - uint8_t encoded_frame[] = {85,128,0,195,4,185,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,154,153,153,153,153,153,201,63,205,204,204,204,192,62,27,65,106,8,205,204,204,204,192,62,27,65,106,8,1,0,22,0,0,0,45,45,0,0,0,0,0,95,7, }; + sbp_msg_ephemeris_dep_d_t test_msg{}; + test_msg.af0 = -0.0006315018981695175; + test_msg.af1 = 8.981260180007666e-12; + test_msg.af2 = 0.2; + test_msg.c_ic = 7.450580596923828e-09; + test_msg.c_is = -1.1548399925231934e-07; + test_msg.c_rc = 308.625; + test_msg.c_rs = -52.3125; + test_msg.c_uc = -2.7436763048171997e-06; + test_msg.c_us = 3.1366944313049316e-06; + test_msg.dn = 5.694522914022375e-09; + test_msg.ecc = 0.007072207052260637; + test_msg.healthy = 0; + test_msg.inc = 0.9341514480259797; + test_msg.inc_dot = -4.035882396415757e-11; + test_msg.iodc = 45; + test_msg.iode = 45; + test_msg.m0 = -0.02200078842114688; + test_msg.omega0 = -1.8731818448797617; + test_msg.omegadot = -8.903585155774196e-09; + test_msg.reserved = 0; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 22; + test_msg.sqrta = 5153.550029754639; + test_msg.tgd = -1.7695128917694092e-08; + test_msg.toc_tow = 446384.2; + test_msg.toc_wn = 2154; + test_msg.toe_tow = 446384.2; + test_msg.toe_wn = 2154; + test_msg.valid = 1; + test_msg.w = -0.9893036629599647; - sbp_msg_ephemeris_dep_d_t test_msg{}; - test_msg.af0 = -0.0006315018981695175; - test_msg.af1 = 8.981260180007666e-12; - test_msg.af2 = 0.2; - test_msg.c_ic = 7.450580596923828e-09; - test_msg.c_is = -1.1548399925231934e-07; - test_msg.c_rc = 308.625; - test_msg.c_rs = -52.3125; - test_msg.c_uc = -2.7436763048171997e-06; - test_msg.c_us = 3.1366944313049316e-06; - test_msg.dn = 5.694522914022375e-09; - test_msg.ecc = 0.007072207052260637; - test_msg.healthy = 0; - test_msg.inc = 0.9341514480259797; - test_msg.inc_dot = -4.035882396415757e-11; - test_msg.iodc = 45; - test_msg.iode = 45; - test_msg.m0 = -0.02200078842114688; - test_msg.omega0 = -1.8731818448797617; - test_msg.omegadot = -8.903585155774196e-09; - test_msg.reserved = 0; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 22; - test_msg.sqrta = 5153.550029754639; - test_msg.tgd = -1.7695128917694092e-08; - test_msg.toc_tow = 446384.2; - test_msg.toc_wn = 2154; - test_msg.toe_tow = 446384.2; - test_msg.toe_wn = 2154; - test_msg.valid = 1; - test_msg.w = -0.9893036629599647; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - 0.2 * 100), 0.05) << "incorrect value for last_msg_.af2, expected 0.2, is " << last_msg_.af2; - EXPECT_LT((last_msg_.c_ic * 100 - 7.45058059692e-09 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected 7.45058059692e-09, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - -1.15483999252e-07 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected -1.15483999252e-07, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - 308.625 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected 308.625, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - -52.3125 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected -52.3125, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - -2.74367630482e-06 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected -2.74367630482e-06, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 3.1366944313e-06 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 3.1366944313e-06, is " << last_msg_.c_us; - EXPECT_LT((last_msg_.dn * 100 - 5.69452291402e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 5.69452291402e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " << last_msg_.ecc; - EXPECT_EQ(last_msg_.healthy, 0) << "incorrect value for last_msg_.healthy, expected 0, is " << last_msg_.healthy; - EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.934151448026, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected -4.03588239642e-11, is " << last_msg_.inc_dot; - EXPECT_EQ(last_msg_.iodc, 45) << "incorrect value for last_msg_.iodc, expected 45, is " << last_msg_.iodc; - EXPECT_EQ(last_msg_.iode, 45) << "incorrect value for last_msg_.iode, expected 45, is " << last_msg_.iode; - EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, is " << last_msg_.omegadot; - EXPECT_EQ(last_msg_.reserved, 0) << "incorrect value for last_msg_.reserved, expected 0, is " << last_msg_.reserved; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 22) << "incorrect value for last_msg_.sid.sat, expected 22, is " << last_msg_.sid.sat; - EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.tgd * 100 - -1.76951289177e-08 * 100), 0.05) << "incorrect value for last_msg_.tgd, expected -1.76951289177e-08, is " << last_msg_.tgd; - EXPECT_LT((last_msg_.toc_tow * 100 - 446384.2 * 100), 0.05) << "incorrect value for last_msg_.toc_tow, expected 446384.2, is " << last_msg_.toc_tow; - EXPECT_EQ(last_msg_.toc_wn, 2154) << "incorrect value for last_msg_.toc_wn, expected 2154, is " << last_msg_.toc_wn; - EXPECT_LT((last_msg_.toe_tow * 100 - 446384.2 * 100), 0.05) << "incorrect value for last_msg_.toe_tow, expected 446384.2, is " << last_msg_.toe_tow; - EXPECT_EQ(last_msg_.toe_wn, 2154) << "incorrect value for last_msg_.toe_wn, expected 2154, is " << last_msg_.toe_wn; - EXPECT_EQ(last_msg_.valid, 1) << "incorrect value for last_msg_.valid, expected 1, is " << last_msg_.valid; - EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) << "incorrect value for last_msg_.w, expected -0.98930366296, is " << last_msg_.w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - 0.2 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected 0.2, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.c_ic * 100 - 7.45058059692e-09 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected 7.45058059692e-09, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - -1.15483999252e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected -1.15483999252e-07, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - 308.625 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected 308.625, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - -52.3125 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected -52.3125, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - -2.74367630482e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected -2.74367630482e-06, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 3.1366944313e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 3.1366944313e-06, is " + << last_msg_.c_us; + EXPECT_LT((last_msg_.dn * 100 - 5.69452291402e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 5.69452291402e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " + << last_msg_.ecc; + EXPECT_EQ(last_msg_.healthy, 0) + << "incorrect value for last_msg_.healthy, expected 0, is " + << last_msg_.healthy; + EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.934151448026, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected -4.03588239642e-11, " + "is " + << last_msg_.inc_dot; + EXPECT_EQ(last_msg_.iodc, 45) + << "incorrect value for last_msg_.iodc, expected 45, is " + << last_msg_.iodc; + EXPECT_EQ(last_msg_.iode, 45) + << "incorrect value for last_msg_.iode, expected 45, is " + << last_msg_.iode; + EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, " + "is " + << last_msg_.omegadot; + EXPECT_EQ(last_msg_.reserved, 0) + << "incorrect value for last_msg_.reserved, expected 0, is " + << last_msg_.reserved; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 22) + << "incorrect value for last_msg_.sid.sat, expected 22, is " + << last_msg_.sid.sat; + EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.tgd * 100 - -1.76951289177e-08 * 100), 0.05) + << "incorrect value for last_msg_.tgd, expected -1.76951289177e-08, is " + << last_msg_.tgd; + EXPECT_LT((last_msg_.toc_tow * 100 - 446384.2 * 100), 0.05) + << "incorrect value for last_msg_.toc_tow, expected 446384.2, is " + << last_msg_.toc_tow; + EXPECT_EQ(last_msg_.toc_wn, 2154) + << "incorrect value for last_msg_.toc_wn, expected 2154, is " + << last_msg_.toc_wn; + EXPECT_LT((last_msg_.toe_tow * 100 - 446384.2 * 100), 0.05) + << "incorrect value for last_msg_.toe_tow, expected 446384.2, is " + << last_msg_.toe_tow; + EXPECT_EQ(last_msg_.toe_wn, 2154) + << "incorrect value for last_msg_.toe_wn, expected 2154, is " + << last_msg_.toe_wn; + EXPECT_EQ(last_msg_.valid, 1) + << "incorrect value for last_msg_.valid, expected 1, is " + << last_msg_.valid; + EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for last_msg_.w, expected -0.98930366296, is " + << last_msg_.w; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLO.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLO.cc index 96f6186b5..04530b2cf 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLO.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLO.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLO.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLO.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisGLO0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisGLO0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisGLO0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisGLO0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_glo_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_glo_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,83 +67,132 @@ class Test_auto_check_sbp_observation_MsgEphemerisGLO0 : sbp_msg_ephemeris_glo_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGLO0, Test) -{ - - uint8_t encoded_frame[] = {85,139,0,10,9,92,4,3,70,197,6,0,106,8,0,0,160,64,96,9,0,0,1,0,0,0,128,43,128,97,175,184,0,0,64,177,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,122,53,0,0,122,53,0,128,59,54,14,100,89,149, }; - - sbp_msg_ephemeris_glo_t test_msg{}; - - test_msg.acc[0] = 9.313225746154785e-07; - - test_msg.acc[1] = 9.313225746154785e-07; - - test_msg.acc[2] = 2.7939677238464355e-06; - test_msg.common.fit_interval = 2400; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 3; - test_msg.common.sid.sat = 4; - test_msg.common.toe.tow = 443718; - test_msg.common.toe.wn = 2154; - test_msg.common.ura = 5.0; - test_msg.common.valid = 1; - test_msg.d_tau = -2.7939677238464355e-09; - test_msg.fcn = 14; - test_msg.gamma = 9.094947017729282e-13; - test_msg.iod = 100; - - test_msg.pos[0] = -12177330.078125; - - test_msg.pos[1] = 599893.06640625; - - test_msg.pos[2] = -22373708.49609375; - test_msg.tau = -8.36281105875969e-05; - - test_msg.vel[0] = -1726.506233215332; - - test_msg.vel[1] = -2542.6149368286133; - - test_msg.vel[2] = 869.8177337646484; - - EXPECT_EQ(send_message( 2314, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 2314); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " << last_msg_.acc[0]; - EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " << last_msg_.acc[1]; - EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " << last_msg_.acc[2]; - EXPECT_EQ(last_msg_.common.fit_interval, 2400) << "incorrect value for last_msg_.common.fit_interval, expected 2400, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 3) << "incorrect value for last_msg_.common.sid.code, expected 3, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.sat, 4) << "incorrect value for last_msg_.common.sid.sat, expected 4, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toe.tow, 443718) << "incorrect value for last_msg_.common.toe.tow, expected 443718, is " << last_msg_.common.toe.tow; - EXPECT_EQ(last_msg_.common.toe.wn, 2154) << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " << last_msg_.common.toe.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 5.0 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 5.0, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.d_tau * 100 - -2.79396772385e-09 * 100), 0.05) << "incorrect value for last_msg_.d_tau, expected -2.79396772385e-09, is " << last_msg_.d_tau; - EXPECT_EQ(last_msg_.fcn, 14) << "incorrect value for last_msg_.fcn, expected 14, is " << last_msg_.fcn; - EXPECT_LT((last_msg_.gamma * 100 - 9.09494701773e-13 * 100), 0.05) << "incorrect value for last_msg_.gamma, expected 9.09494701773e-13, is " << last_msg_.gamma; - EXPECT_EQ(last_msg_.iod, 100) << "incorrect value for last_msg_.iod, expected 100, is " << last_msg_.iod; - EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " << last_msg_.pos[0]; - EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " << last_msg_.pos[1]; - EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " << last_msg_.pos[2]; - EXPECT_LT((last_msg_.tau * 100 - -8.36281105876e-05 * 100), 0.05) << "incorrect value for last_msg_.tau, expected -8.36281105876e-05, is " << last_msg_.tau; - EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50623322 * 100), 0.05) << "incorrect value for last_msg_.vel[0], expected -1726.50623322, is " << last_msg_.vel[0]; - EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61493683 * 100), 0.05) << "incorrect value for last_msg_.vel[1], expected -2542.61493683, is " << last_msg_.vel[1]; - EXPECT_LT((last_msg_.vel[2] * 100 - 869.817733765 * 100), 0.05) << "incorrect value for last_msg_.vel[2], expected 869.817733765, is " << last_msg_.vel[2]; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGLO0, Test) { + uint8_t encoded_frame[] = { + 85, 139, 0, 10, 9, 92, 4, 3, 70, 197, 6, 0, 106, 8, 0, + 0, 160, 64, 96, 9, 0, 0, 1, 0, 0, 0, 128, 43, 128, 97, + 175, 184, 0, 0, 64, 177, 0, 0, 128, 66, 246, 57, 103, 193, 0, + 0, 0, 34, 170, 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, + 0, 0, 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, + 192, 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 122, 53, 0, 0, + 122, 53, 0, 128, 59, 54, 14, 100, 89, 149, + }; + + sbp_msg_ephemeris_glo_t test_msg{}; + + test_msg.acc[0] = 9.313225746154785e-07; + + test_msg.acc[1] = 9.313225746154785e-07; + + test_msg.acc[2] = 2.7939677238464355e-06; + test_msg.common.fit_interval = 2400; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 3; + test_msg.common.sid.sat = 4; + test_msg.common.toe.tow = 443718; + test_msg.common.toe.wn = 2154; + test_msg.common.ura = 5.0; + test_msg.common.valid = 1; + test_msg.d_tau = -2.7939677238464355e-09; + test_msg.fcn = 14; + test_msg.gamma = 9.094947017729282e-13; + test_msg.iod = 100; + + test_msg.pos[0] = -12177330.078125; + + test_msg.pos[1] = 599893.06640625; + + test_msg.pos[2] = -22373708.49609375; + test_msg.tau = -8.36281105875969e-05; + + test_msg.vel[0] = -1726.506233215332; + + test_msg.vel[1] = -2542.6149368286133; + + test_msg.vel[2] = 869.8177337646484; + + EXPECT_EQ(send_message(2314, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 2314); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " + << last_msg_.acc[0]; + EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " + << last_msg_.acc[1]; + EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " + << last_msg_.acc[2]; + EXPECT_EQ(last_msg_.common.fit_interval, 2400) + << "incorrect value for last_msg_.common.fit_interval, expected 2400, is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 3) + << "incorrect value for last_msg_.common.sid.code, expected 3, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.sat, 4) + << "incorrect value for last_msg_.common.sid.sat, expected 4, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toe.tow, 443718) + << "incorrect value for last_msg_.common.toe.tow, expected 443718, is " + << last_msg_.common.toe.tow; + EXPECT_EQ(last_msg_.common.toe.wn, 2154) + << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " + << last_msg_.common.toe.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 5.0 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 5.0, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.d_tau * 100 - -2.79396772385e-09 * 100), 0.05) + << "incorrect value for last_msg_.d_tau, expected -2.79396772385e-09, is " + << last_msg_.d_tau; + EXPECT_EQ(last_msg_.fcn, 14) + << "incorrect value for last_msg_.fcn, expected 14, is " << last_msg_.fcn; + EXPECT_LT((last_msg_.gamma * 100 - 9.09494701773e-13 * 100), 0.05) + << "incorrect value for last_msg_.gamma, expected 9.09494701773e-13, is " + << last_msg_.gamma; + EXPECT_EQ(last_msg_.iod, 100) + << "incorrect value for last_msg_.iod, expected 100, is " + << last_msg_.iod; + EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " + << last_msg_.pos[0]; + EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " + << last_msg_.pos[1]; + EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " + << last_msg_.pos[2]; + EXPECT_LT((last_msg_.tau * 100 - -8.36281105876e-05 * 100), 0.05) + << "incorrect value for last_msg_.tau, expected -8.36281105876e-05, is " + << last_msg_.tau; + EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50623322 * 100), 0.05) + << "incorrect value for last_msg_.vel[0], expected -1726.50623322, is " + << last_msg_.vel[0]; + EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61493683 * 100), 0.05) + << "incorrect value for last_msg_.vel[1], expected -2542.61493683, is " + << last_msg_.vel[1]; + EXPECT_LT((last_msg_.vel[2] * 100 - 869.817733765 * 100), 0.05) + << "incorrect value for last_msg_.vel[2], expected 869.817733765, is " + << last_msg_.vel[2]; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepA.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepA.cc index 66ad747a3..144aeb262 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepA.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisGLODepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisGLODepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisGLODepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisGLODepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_glo_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_glo_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,79 +67,126 @@ class Test_auto_check_sbp_observation_MsgEphemerisGLODepA0 : sbp_msg_ephemeris_glo_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGLODepA0, Test) -{ - - uint8_t encoded_frame[] = {85,131,0,195,4,112,4,0,3,0,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,202,238, }; - - sbp_msg_ephemeris_glo_dep_a_t test_msg{}; - - test_msg.acc[0] = 9.313225746154785e-07; - - test_msg.acc[1] = 9.313225746154785e-07; - - test_msg.acc[2] = 2.7939677238464355e-06; - test_msg.common.fit_interval = 2400; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 3; - test_msg.common.sid.reserved = 0; - test_msg.common.sid.sat = 4; - test_msg.common.toe.tow = 443718; - test_msg.common.toe.wn = 2154; - test_msg.common.ura = 5.2; - test_msg.common.valid = 1; - test_msg.gamma = 9.094947017729282e-13; - - test_msg.pos[0] = -12177330.078125; - - test_msg.pos[1] = 599893.06640625; - - test_msg.pos[2] = -22373708.49609375; - test_msg.tau = -8.36281105875969e-05; - - test_msg.vel[0] = -1726.506233215332; - - test_msg.vel[1] = -2542.6149368286133; - - test_msg.vel[2] = 869.8177337646484; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " << last_msg_.acc[0]; - EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " << last_msg_.acc[1]; - EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " << last_msg_.acc[2]; - EXPECT_EQ(last_msg_.common.fit_interval, 2400) << "incorrect value for last_msg_.common.fit_interval, expected 2400, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 3) << "incorrect value for last_msg_.common.sid.code, expected 3, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.reserved, 0) << "incorrect value for last_msg_.common.sid.reserved, expected 0, is " << last_msg_.common.sid.reserved; - EXPECT_EQ(last_msg_.common.sid.sat, 4) << "incorrect value for last_msg_.common.sid.sat, expected 4, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toe.tow, 443718) << "incorrect value for last_msg_.common.toe.tow, expected 443718, is " << last_msg_.common.toe.tow; - EXPECT_EQ(last_msg_.common.toe.wn, 2154) << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " << last_msg_.common.toe.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 5.2 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 5.2, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.gamma * 100 - 9.09494701773e-13 * 100), 0.05) << "incorrect value for last_msg_.gamma, expected 9.09494701773e-13, is " << last_msg_.gamma; - EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " << last_msg_.pos[0]; - EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " << last_msg_.pos[1]; - EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " << last_msg_.pos[2]; - EXPECT_LT((last_msg_.tau * 100 - -8.36281105876e-05 * 100), 0.05) << "incorrect value for last_msg_.tau, expected -8.36281105876e-05, is " << last_msg_.tau; - EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50623322 * 100), 0.05) << "incorrect value for last_msg_.vel[0], expected -1726.50623322, is " << last_msg_.vel[0]; - EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61493683 * 100), 0.05) << "incorrect value for last_msg_.vel[1], expected -2542.61493683, is " << last_msg_.vel[1]; - EXPECT_LT((last_msg_.vel[2] * 100 - 869.817733765 * 100), 0.05) << "incorrect value for last_msg_.vel[2], expected 869.817733765, is " << last_msg_.vel[2]; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGLODepA0, Test) { + uint8_t encoded_frame[] = { + 85, 131, 0, 195, 4, 112, 4, 0, 3, 0, 70, 197, 6, 0, 106, + 8, 205, 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 112, 61, 0, 0, 0, 0, 48, 236, 21, + 191, 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, + 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, 0, 98, 6, + 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, 192, 0, 0, 0, 184, + 138, 46, 139, 64, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, + 0, 0, 64, 175, 62, 0, 0, 0, 0, 0, 112, 199, 62, 202, 238, + }; + + sbp_msg_ephemeris_glo_dep_a_t test_msg{}; + + test_msg.acc[0] = 9.313225746154785e-07; + + test_msg.acc[1] = 9.313225746154785e-07; + + test_msg.acc[2] = 2.7939677238464355e-06; + test_msg.common.fit_interval = 2400; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 3; + test_msg.common.sid.reserved = 0; + test_msg.common.sid.sat = 4; + test_msg.common.toe.tow = 443718; + test_msg.common.toe.wn = 2154; + test_msg.common.ura = 5.2; + test_msg.common.valid = 1; + test_msg.gamma = 9.094947017729282e-13; + + test_msg.pos[0] = -12177330.078125; + + test_msg.pos[1] = 599893.06640625; + + test_msg.pos[2] = -22373708.49609375; + test_msg.tau = -8.36281105875969e-05; + + test_msg.vel[0] = -1726.506233215332; + + test_msg.vel[1] = -2542.6149368286133; + + test_msg.vel[2] = 869.8177337646484; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " + << last_msg_.acc[0]; + EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " + << last_msg_.acc[1]; + EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " + << last_msg_.acc[2]; + EXPECT_EQ(last_msg_.common.fit_interval, 2400) + << "incorrect value for last_msg_.common.fit_interval, expected 2400, is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 3) + << "incorrect value for last_msg_.common.sid.code, expected 3, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.reserved, 0) + << "incorrect value for last_msg_.common.sid.reserved, expected 0, is " + << last_msg_.common.sid.reserved; + EXPECT_EQ(last_msg_.common.sid.sat, 4) + << "incorrect value for last_msg_.common.sid.sat, expected 4, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toe.tow, 443718) + << "incorrect value for last_msg_.common.toe.tow, expected 443718, is " + << last_msg_.common.toe.tow; + EXPECT_EQ(last_msg_.common.toe.wn, 2154) + << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " + << last_msg_.common.toe.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 5.2 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 5.2, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.gamma * 100 - 9.09494701773e-13 * 100), 0.05) + << "incorrect value for last_msg_.gamma, expected 9.09494701773e-13, is " + << last_msg_.gamma; + EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " + << last_msg_.pos[0]; + EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " + << last_msg_.pos[1]; + EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " + << last_msg_.pos[2]; + EXPECT_LT((last_msg_.tau * 100 - -8.36281105876e-05 * 100), 0.05) + << "incorrect value for last_msg_.tau, expected -8.36281105876e-05, is " + << last_msg_.tau; + EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50623322 * 100), 0.05) + << "incorrect value for last_msg_.vel[0], expected -1726.50623322, is " + << last_msg_.vel[0]; + EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61493683 * 100), 0.05) + << "incorrect value for last_msg_.vel[1], expected -2542.61493683, is " + << last_msg_.vel[1]; + EXPECT_LT((last_msg_.vel[2] * 100 - 869.817733765 * 100), 0.05) + << "incorrect value for last_msg_.vel[2], expected 869.817733765, is " + << last_msg_.vel[2]; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepB.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepB.cc index 8a4de69df..5f57035fe 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepB.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepB.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepB.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisGLODepB0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisGLODepB0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisGLODepB0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisGLODepB0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_glo_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_glo_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,77 +67,122 @@ class Test_auto_check_sbp_observation_MsgEphemerisGLODepB0 : sbp_msg_ephemeris_glo_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGLODepB0, Test) -{ - - uint8_t encoded_frame[] = {85,133,0,195,4,110,4,3,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,122,127, }; - - sbp_msg_ephemeris_glo_dep_b_t test_msg{}; - - test_msg.acc[0] = 9.313225746154785e-07; - - test_msg.acc[1] = 9.313225746154785e-07; - - test_msg.acc[2] = 2.7939677238464355e-06; - test_msg.common.fit_interval = 2400; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 3; - test_msg.common.sid.sat = 4; - test_msg.common.toe.tow = 443718; - test_msg.common.toe.wn = 2154; - test_msg.common.ura = 5.2; - test_msg.common.valid = 1; - test_msg.gamma = 9.094947017729282e-13; - - test_msg.pos[0] = -12177330.078125; - - test_msg.pos[1] = 599893.06640625; - - test_msg.pos[2] = -22373708.49609375; - test_msg.tau = -8.36281105875969e-05; - - test_msg.vel[0] = -1726.506233215332; - - test_msg.vel[1] = -2542.6149368286133; - - test_msg.vel[2] = 869.8177337646484; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " << last_msg_.acc[0]; - EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " << last_msg_.acc[1]; - EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " << last_msg_.acc[2]; - EXPECT_EQ(last_msg_.common.fit_interval, 2400) << "incorrect value for last_msg_.common.fit_interval, expected 2400, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 3) << "incorrect value for last_msg_.common.sid.code, expected 3, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.sat, 4) << "incorrect value for last_msg_.common.sid.sat, expected 4, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toe.tow, 443718) << "incorrect value for last_msg_.common.toe.tow, expected 443718, is " << last_msg_.common.toe.tow; - EXPECT_EQ(last_msg_.common.toe.wn, 2154) << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " << last_msg_.common.toe.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 5.2 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 5.2, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.gamma * 100 - 9.09494701773e-13 * 100), 0.05) << "incorrect value for last_msg_.gamma, expected 9.09494701773e-13, is " << last_msg_.gamma; - EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " << last_msg_.pos[0]; - EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " << last_msg_.pos[1]; - EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " << last_msg_.pos[2]; - EXPECT_LT((last_msg_.tau * 100 - -8.36281105876e-05 * 100), 0.05) << "incorrect value for last_msg_.tau, expected -8.36281105876e-05, is " << last_msg_.tau; - EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50623322 * 100), 0.05) << "incorrect value for last_msg_.vel[0], expected -1726.50623322, is " << last_msg_.vel[0]; - EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61493683 * 100), 0.05) << "incorrect value for last_msg_.vel[1], expected -2542.61493683, is " << last_msg_.vel[1]; - EXPECT_LT((last_msg_.vel[2] * 100 - 869.817733765 * 100), 0.05) << "incorrect value for last_msg_.vel[2], expected 869.817733765, is " << last_msg_.vel[2]; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGLODepB0, Test) { + uint8_t encoded_frame[] = { + 85, 133, 0, 195, 4, 110, 4, 3, 70, 197, 6, 0, 106, 8, 205, + 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 112, 61, 0, 0, 0, 0, 48, 236, 21, 191, 0, + 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, 34, 65, + 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, 0, 98, 6, 250, 154, + 192, 0, 0, 0, 217, 58, 221, 163, 192, 0, 0, 0, 184, 138, 46, + 139, 64, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, 0, + 64, 175, 62, 0, 0, 0, 0, 0, 112, 199, 62, 122, 127, + }; + + sbp_msg_ephemeris_glo_dep_b_t test_msg{}; + + test_msg.acc[0] = 9.313225746154785e-07; + + test_msg.acc[1] = 9.313225746154785e-07; + + test_msg.acc[2] = 2.7939677238464355e-06; + test_msg.common.fit_interval = 2400; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 3; + test_msg.common.sid.sat = 4; + test_msg.common.toe.tow = 443718; + test_msg.common.toe.wn = 2154; + test_msg.common.ura = 5.2; + test_msg.common.valid = 1; + test_msg.gamma = 9.094947017729282e-13; + + test_msg.pos[0] = -12177330.078125; + + test_msg.pos[1] = 599893.06640625; + + test_msg.pos[2] = -22373708.49609375; + test_msg.tau = -8.36281105875969e-05; + + test_msg.vel[0] = -1726.506233215332; + + test_msg.vel[1] = -2542.6149368286133; + + test_msg.vel[2] = 869.8177337646484; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " + << last_msg_.acc[0]; + EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " + << last_msg_.acc[1]; + EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " + << last_msg_.acc[2]; + EXPECT_EQ(last_msg_.common.fit_interval, 2400) + << "incorrect value for last_msg_.common.fit_interval, expected 2400, is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 3) + << "incorrect value for last_msg_.common.sid.code, expected 3, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.sat, 4) + << "incorrect value for last_msg_.common.sid.sat, expected 4, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toe.tow, 443718) + << "incorrect value for last_msg_.common.toe.tow, expected 443718, is " + << last_msg_.common.toe.tow; + EXPECT_EQ(last_msg_.common.toe.wn, 2154) + << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " + << last_msg_.common.toe.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 5.2 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 5.2, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.gamma * 100 - 9.09494701773e-13 * 100), 0.05) + << "incorrect value for last_msg_.gamma, expected 9.09494701773e-13, is " + << last_msg_.gamma; + EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " + << last_msg_.pos[0]; + EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " + << last_msg_.pos[1]; + EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " + << last_msg_.pos[2]; + EXPECT_LT((last_msg_.tau * 100 - -8.36281105876e-05 * 100), 0.05) + << "incorrect value for last_msg_.tau, expected -8.36281105876e-05, is " + << last_msg_.tau; + EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50623322 * 100), 0.05) + << "incorrect value for last_msg_.vel[0], expected -1726.50623322, is " + << last_msg_.vel[0]; + EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61493683 * 100), 0.05) + << "incorrect value for last_msg_.vel[1], expected -2542.61493683, is " + << last_msg_.vel[1]; + EXPECT_LT((last_msg_.vel[2] * 100 - 869.817733765 * 100), 0.05) + << "incorrect value for last_msg_.vel[2], expected 869.817733765, is " + << last_msg_.vel[2]; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepC.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepC.cc index 015101b40..3558ddf2d 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepC.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepC.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepC.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisGLODepC0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisGLODepC0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisGLODepC0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisGLODepC0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_glo_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_glo_dep_c_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,81 +67,130 @@ class Test_auto_check_sbp_observation_MsgEphemerisGLODepC0 : sbp_msg_ephemeris_glo_dep_c_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGLODepC0, Test) -{ - - uint8_t encoded_frame[] = {85,135,0,195,4,119,4,3,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,0,0,0,0,40,190,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,14,151,65, }; - - sbp_msg_ephemeris_glo_dep_c_t test_msg{}; - - test_msg.acc[0] = 9.313225746154785e-07; - - test_msg.acc[1] = 9.313225746154785e-07; - - test_msg.acc[2] = 2.7939677238464355e-06; - test_msg.common.fit_interval = 2400; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 3; - test_msg.common.sid.sat = 4; - test_msg.common.toe.tow = 443718; - test_msg.common.toe.wn = 2154; - test_msg.common.ura = 5.2; - test_msg.common.valid = 1; - test_msg.d_tau = -2.7939677238464355e-09; - test_msg.fcn = 14; - test_msg.gamma = 9.094947017729282e-13; - - test_msg.pos[0] = -12177330.078125; - - test_msg.pos[1] = 599893.06640625; - - test_msg.pos[2] = -22373708.49609375; - test_msg.tau = -8.36281105875969e-05; - - test_msg.vel[0] = -1726.506233215332; - - test_msg.vel[1] = -2542.6149368286133; - - test_msg.vel[2] = 869.8177337646484; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " << last_msg_.acc[0]; - EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " << last_msg_.acc[1]; - EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " << last_msg_.acc[2]; - EXPECT_EQ(last_msg_.common.fit_interval, 2400) << "incorrect value for last_msg_.common.fit_interval, expected 2400, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 3) << "incorrect value for last_msg_.common.sid.code, expected 3, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.sat, 4) << "incorrect value for last_msg_.common.sid.sat, expected 4, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toe.tow, 443718) << "incorrect value for last_msg_.common.toe.tow, expected 443718, is " << last_msg_.common.toe.tow; - EXPECT_EQ(last_msg_.common.toe.wn, 2154) << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " << last_msg_.common.toe.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 5.2 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 5.2, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.d_tau * 100 - -2.79396772385e-09 * 100), 0.05) << "incorrect value for last_msg_.d_tau, expected -2.79396772385e-09, is " << last_msg_.d_tau; - EXPECT_EQ(last_msg_.fcn, 14) << "incorrect value for last_msg_.fcn, expected 14, is " << last_msg_.fcn; - EXPECT_LT((last_msg_.gamma * 100 - 9.09494701773e-13 * 100), 0.05) << "incorrect value for last_msg_.gamma, expected 9.09494701773e-13, is " << last_msg_.gamma; - EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " << last_msg_.pos[0]; - EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " << last_msg_.pos[1]; - EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " << last_msg_.pos[2]; - EXPECT_LT((last_msg_.tau * 100 - -8.36281105876e-05 * 100), 0.05) << "incorrect value for last_msg_.tau, expected -8.36281105876e-05, is " << last_msg_.tau; - EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50623322 * 100), 0.05) << "incorrect value for last_msg_.vel[0], expected -1726.50623322, is " << last_msg_.vel[0]; - EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61493683 * 100), 0.05) << "incorrect value for last_msg_.vel[1], expected -2542.61493683, is " << last_msg_.vel[1]; - EXPECT_LT((last_msg_.vel[2] * 100 - 869.817733765 * 100), 0.05) << "incorrect value for last_msg_.vel[2], expected 869.817733765, is " << last_msg_.vel[2]; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGLODepC0, Test) { + uint8_t encoded_frame[] = { + 85, 135, 0, 195, 4, 119, 4, 3, 70, 197, 6, 0, 106, 8, 205, + 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 112, 61, 0, 0, 0, 0, 48, 236, 21, 191, 0, + 0, 0, 0, 0, 0, 40, 190, 0, 0, 128, 66, 246, 57, 103, 193, + 0, 0, 0, 34, 170, 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, + 193, 0, 0, 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, + 163, 192, 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, 0, + 64, 175, 62, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, + 0, 112, 199, 62, 14, 151, 65, + }; + + sbp_msg_ephemeris_glo_dep_c_t test_msg{}; + + test_msg.acc[0] = 9.313225746154785e-07; + + test_msg.acc[1] = 9.313225746154785e-07; + + test_msg.acc[2] = 2.7939677238464355e-06; + test_msg.common.fit_interval = 2400; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 3; + test_msg.common.sid.sat = 4; + test_msg.common.toe.tow = 443718; + test_msg.common.toe.wn = 2154; + test_msg.common.ura = 5.2; + test_msg.common.valid = 1; + test_msg.d_tau = -2.7939677238464355e-09; + test_msg.fcn = 14; + test_msg.gamma = 9.094947017729282e-13; + + test_msg.pos[0] = -12177330.078125; + + test_msg.pos[1] = 599893.06640625; + + test_msg.pos[2] = -22373708.49609375; + test_msg.tau = -8.36281105875969e-05; + + test_msg.vel[0] = -1726.506233215332; + + test_msg.vel[1] = -2542.6149368286133; + + test_msg.vel[2] = 869.8177337646484; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " + << last_msg_.acc[0]; + EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " + << last_msg_.acc[1]; + EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " + << last_msg_.acc[2]; + EXPECT_EQ(last_msg_.common.fit_interval, 2400) + << "incorrect value for last_msg_.common.fit_interval, expected 2400, is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 3) + << "incorrect value for last_msg_.common.sid.code, expected 3, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.sat, 4) + << "incorrect value for last_msg_.common.sid.sat, expected 4, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toe.tow, 443718) + << "incorrect value for last_msg_.common.toe.tow, expected 443718, is " + << last_msg_.common.toe.tow; + EXPECT_EQ(last_msg_.common.toe.wn, 2154) + << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " + << last_msg_.common.toe.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 5.2 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 5.2, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.d_tau * 100 - -2.79396772385e-09 * 100), 0.05) + << "incorrect value for last_msg_.d_tau, expected -2.79396772385e-09, is " + << last_msg_.d_tau; + EXPECT_EQ(last_msg_.fcn, 14) + << "incorrect value for last_msg_.fcn, expected 14, is " << last_msg_.fcn; + EXPECT_LT((last_msg_.gamma * 100 - 9.09494701773e-13 * 100), 0.05) + << "incorrect value for last_msg_.gamma, expected 9.09494701773e-13, is " + << last_msg_.gamma; + EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " + << last_msg_.pos[0]; + EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " + << last_msg_.pos[1]; + EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " + << last_msg_.pos[2]; + EXPECT_LT((last_msg_.tau * 100 - -8.36281105876e-05 * 100), 0.05) + << "incorrect value for last_msg_.tau, expected -8.36281105876e-05, is " + << last_msg_.tau; + EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50623322 * 100), 0.05) + << "incorrect value for last_msg_.vel[0], expected -1726.50623322, is " + << last_msg_.vel[0]; + EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61493683 * 100), 0.05) + << "incorrect value for last_msg_.vel[1], expected -2542.61493683, is " + << last_msg_.vel[1]; + EXPECT_LT((last_msg_.vel[2] * 100 - 869.817733765 * 100), 0.05) + << "incorrect value for last_msg_.vel[2], expected 869.817733765, is " + << last_msg_.vel[2]; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepD.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepD.cc index 00a1eae44..3d6ef65e0 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepD.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGLODepD.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepD.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepD.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisGLODepD0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisGLODepD0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisGLODepD0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisGLODepD0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_glo_dep_d_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_glo_dep_d_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,83 +67,134 @@ class Test_auto_check_sbp_observation_MsgEphemerisGLODepD0 : sbp_msg_ephemeris_glo_dep_d_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGLODepD0, Test) -{ - - uint8_t encoded_frame[] = {85,136,0,195,4,120,4,3,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,0,0,0,0,40,190,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,14,100,82,64, }; - - sbp_msg_ephemeris_glo_dep_d_t test_msg{}; - - test_msg.acc[0] = 9.313225746154785e-07; - - test_msg.acc[1] = 9.313225746154785e-07; - - test_msg.acc[2] = 2.7939677238464355e-06; - test_msg.common.fit_interval = 2400; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 3; - test_msg.common.sid.sat = 4; - test_msg.common.toe.tow = 443718; - test_msg.common.toe.wn = 2154; - test_msg.common.ura = 5.2; - test_msg.common.valid = 1; - test_msg.d_tau = -2.7939677238464355e-09; - test_msg.fcn = 14; - test_msg.gamma = 9.094947017729282e-13; - test_msg.iod = 100; - - test_msg.pos[0] = -12177330.078125; - - test_msg.pos[1] = 599893.06640625; - - test_msg.pos[2] = -22373708.49609375; - test_msg.tau = -8.36281105875969e-05; - - test_msg.vel[0] = -1726.506233215332; - - test_msg.vel[1] = -2542.6149368286133; - - test_msg.vel[2] = 869.8177337646484; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " << last_msg_.acc[0]; - EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " << last_msg_.acc[1]; - EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " << last_msg_.acc[2]; - EXPECT_EQ(last_msg_.common.fit_interval, 2400) << "incorrect value for last_msg_.common.fit_interval, expected 2400, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 3) << "incorrect value for last_msg_.common.sid.code, expected 3, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.sat, 4) << "incorrect value for last_msg_.common.sid.sat, expected 4, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toe.tow, 443718) << "incorrect value for last_msg_.common.toe.tow, expected 443718, is " << last_msg_.common.toe.tow; - EXPECT_EQ(last_msg_.common.toe.wn, 2154) << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " << last_msg_.common.toe.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 5.2 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 5.2, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.d_tau * 100 - -2.79396772385e-09 * 100), 0.05) << "incorrect value for last_msg_.d_tau, expected -2.79396772385e-09, is " << last_msg_.d_tau; - EXPECT_EQ(last_msg_.fcn, 14) << "incorrect value for last_msg_.fcn, expected 14, is " << last_msg_.fcn; - EXPECT_LT((last_msg_.gamma * 100 - 9.09494701773e-13 * 100), 0.05) << "incorrect value for last_msg_.gamma, expected 9.09494701773e-13, is " << last_msg_.gamma; - EXPECT_EQ(last_msg_.iod, 100) << "incorrect value for last_msg_.iod, expected 100, is " << last_msg_.iod; - EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " << last_msg_.pos[0]; - EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " << last_msg_.pos[1]; - EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " << last_msg_.pos[2]; - EXPECT_LT((last_msg_.tau * 100 - -8.36281105876e-05 * 100), 0.05) << "incorrect value for last_msg_.tau, expected -8.36281105876e-05, is " << last_msg_.tau; - EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50623322 * 100), 0.05) << "incorrect value for last_msg_.vel[0], expected -1726.50623322, is " << last_msg_.vel[0]; - EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61493683 * 100), 0.05) << "incorrect value for last_msg_.vel[1], expected -2542.61493683, is " << last_msg_.vel[1]; - EXPECT_LT((last_msg_.vel[2] * 100 - 869.817733765 * 100), 0.05) << "incorrect value for last_msg_.vel[2], expected 869.817733765, is " << last_msg_.vel[2]; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGLODepD0, Test) { + uint8_t encoded_frame[] = { + 85, 136, 0, 195, 4, 120, 4, 3, 70, 197, 6, 0, 106, 8, 205, + 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 112, 61, 0, 0, 0, 0, 48, 236, 21, 191, 0, + 0, 0, 0, 0, 0, 40, 190, 0, 0, 128, 66, 246, 57, 103, 193, + 0, 0, 0, 34, 170, 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, + 193, 0, 0, 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, + 163, 192, 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, 0, + 64, 175, 62, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, + 0, 112, 199, 62, 14, 100, 82, 64, + }; + + sbp_msg_ephemeris_glo_dep_d_t test_msg{}; + + test_msg.acc[0] = 9.313225746154785e-07; + + test_msg.acc[1] = 9.313225746154785e-07; + + test_msg.acc[2] = 2.7939677238464355e-06; + test_msg.common.fit_interval = 2400; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 3; + test_msg.common.sid.sat = 4; + test_msg.common.toe.tow = 443718; + test_msg.common.toe.wn = 2154; + test_msg.common.ura = 5.2; + test_msg.common.valid = 1; + test_msg.d_tau = -2.7939677238464355e-09; + test_msg.fcn = 14; + test_msg.gamma = 9.094947017729282e-13; + test_msg.iod = 100; + + test_msg.pos[0] = -12177330.078125; + + test_msg.pos[1] = 599893.06640625; + + test_msg.pos[2] = -22373708.49609375; + test_msg.tau = -8.36281105875969e-05; + + test_msg.vel[0] = -1726.506233215332; + + test_msg.vel[1] = -2542.6149368286133; + + test_msg.vel[2] = 869.8177337646484; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " + << last_msg_.acc[0]; + EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " + << last_msg_.acc[1]; + EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " + << last_msg_.acc[2]; + EXPECT_EQ(last_msg_.common.fit_interval, 2400) + << "incorrect value for last_msg_.common.fit_interval, expected 2400, is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 3) + << "incorrect value for last_msg_.common.sid.code, expected 3, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.sat, 4) + << "incorrect value for last_msg_.common.sid.sat, expected 4, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toe.tow, 443718) + << "incorrect value for last_msg_.common.toe.tow, expected 443718, is " + << last_msg_.common.toe.tow; + EXPECT_EQ(last_msg_.common.toe.wn, 2154) + << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " + << last_msg_.common.toe.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 5.2 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 5.2, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.d_tau * 100 - -2.79396772385e-09 * 100), 0.05) + << "incorrect value for last_msg_.d_tau, expected -2.79396772385e-09, is " + << last_msg_.d_tau; + EXPECT_EQ(last_msg_.fcn, 14) + << "incorrect value for last_msg_.fcn, expected 14, is " << last_msg_.fcn; + EXPECT_LT((last_msg_.gamma * 100 - 9.09494701773e-13 * 100), 0.05) + << "incorrect value for last_msg_.gamma, expected 9.09494701773e-13, is " + << last_msg_.gamma; + EXPECT_EQ(last_msg_.iod, 100) + << "incorrect value for last_msg_.iod, expected 100, is " + << last_msg_.iod; + EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " + << last_msg_.pos[0]; + EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " + << last_msg_.pos[1]; + EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " + << last_msg_.pos[2]; + EXPECT_LT((last_msg_.tau * 100 - -8.36281105876e-05 * 100), 0.05) + << "incorrect value for last_msg_.tau, expected -8.36281105876e-05, is " + << last_msg_.tau; + EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50623322 * 100), 0.05) + << "incorrect value for last_msg_.vel[0], expected -1726.50623322, is " + << last_msg_.vel[0]; + EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61493683 * 100), 0.05) + << "incorrect value for last_msg_.vel[1], expected -2542.61493683, is " + << last_msg_.vel[1]; + EXPECT_LT((last_msg_.vel[2] * 100 - 869.817733765 * 100), 0.05) + << "incorrect value for last_msg_.vel[2], expected 869.817733765, is " + << last_msg_.vel[2]; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGPS.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGPS.cc index 028964da6..ffa31e4f7 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGPS.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGPS.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPS.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisGPS0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisGPS0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisGPS0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisGPS0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_gps_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_gps_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,92 +67,166 @@ class Test_auto_check_sbp_observation_MsgEphemerisGPS0 : sbp_msg_ephemeris_gps_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGPS0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGPS0, Test) { + uint8_t encoded_frame[] = { + 85, 138, 0, 10, 9, 139, 22, 0, 176, 207, 6, 0, 106, 8, 0, + 0, 0, 64, 64, 56, 0, 0, 1, 0, 0, 0, 152, 178, 0, 64, + 81, 194, 0, 80, 154, 67, 0, 32, 56, 182, 0, 128, 82, 54, 0, + 0, 0, 50, 0, 0, 248, 179, 114, 216, 96, 180, 49, 117, 56, 62, + 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, + 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, + 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, + 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, 221, 47, 100, 224, + 255, 47, 198, 189, 96, 139, 37, 186, 0, 0, 30, 45, 0, 0, 0, + 0, 176, 207, 6, 0, 106, 8, 45, 45, 0, 170, 4, + }; - uint8_t encoded_frame[] = {85,138,0,10,9,139,22,0,176,207,6,0,106,8,0,0,0,64,64,56,0,0,1,0,0,0,152,178,0,64,81,194,0,80,154,67,0,32,56,182,0,128,82,54,0,0,0,50,0,0,248,179,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,96,139,37,186,0,0,30,45,0,0,0,0,176,207,6,0,106,8,45,45,0,170,4, }; + sbp_msg_ephemeris_gps_t test_msg{}; + test_msg.af0 = -0.0006315018981695175; + test_msg.af1 = 8.981260180007666e-12; + test_msg.af2 = 0.0; + test_msg.c_ic = 7.450580596923828e-09; + test_msg.c_is = -1.1548399925231934e-07; + test_msg.c_rc = 308.625; + test_msg.c_rs = -52.3125; + test_msg.c_uc = -2.7436763048171997e-06; + test_msg.c_us = 3.1366944313049316e-06; + test_msg.common.fit_interval = 14400; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 0; + test_msg.common.sid.sat = 22; + test_msg.common.toe.tow = 446384; + test_msg.common.toe.wn = 2154; + test_msg.common.ura = 2.0; + test_msg.common.valid = 1; + test_msg.dn = 5.694522914022375e-09; + test_msg.ecc = 0.007072207052260637; + test_msg.inc = 0.9341514480259797; + test_msg.inc_dot = -4.035882396415757e-11; + test_msg.iodc = 45; + test_msg.iode = 45; + test_msg.m0 = -0.02200078842114688; + test_msg.omega0 = -1.8731818448797617; + test_msg.omegadot = -8.903585155774196e-09; + test_msg.sqrta = 5153.550029754639; + test_msg.tgd = -1.7695128917694092e-08; + test_msg.toc.tow = 446384; + test_msg.toc.wn = 2154; + test_msg.w = -0.9893036629599647; - sbp_msg_ephemeris_gps_t test_msg{}; - test_msg.af0 = -0.0006315018981695175; - test_msg.af1 = 8.981260180007666e-12; - test_msg.af2 = 0.0; - test_msg.c_ic = 7.450580596923828e-09; - test_msg.c_is = -1.1548399925231934e-07; - test_msg.c_rc = 308.625; - test_msg.c_rs = -52.3125; - test_msg.c_uc = -2.7436763048171997e-06; - test_msg.c_us = 3.1366944313049316e-06; - test_msg.common.fit_interval = 14400; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 0; - test_msg.common.sid.sat = 22; - test_msg.common.toe.tow = 446384; - test_msg.common.toe.wn = 2154; - test_msg.common.ura = 2.0; - test_msg.common.valid = 1; - test_msg.dn = 5.694522914022375e-09; - test_msg.ecc = 0.007072207052260637; - test_msg.inc = 0.9341514480259797; - test_msg.inc_dot = -4.035882396415757e-11; - test_msg.iodc = 45; - test_msg.iode = 45; - test_msg.m0 = -0.02200078842114688; - test_msg.omega0 = -1.8731818448797617; - test_msg.omegadot = -8.903585155774196e-09; - test_msg.sqrta = 5153.550029754639; - test_msg.tgd = -1.7695128917694092e-08; - test_msg.toc.tow = 446384; - test_msg.toc.wn = 2154; - test_msg.w = -0.9893036629599647; - - EXPECT_EQ(send_message( 2314, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(2314, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 2314); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.af2, expected 0.0, is " << last_msg_.af2; - EXPECT_LT((last_msg_.c_ic * 100 - 7.45058059692e-09 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected 7.45058059692e-09, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - -1.15483999252e-07 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected -1.15483999252e-07, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - 308.625 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected 308.625, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - -52.3125 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected -52.3125, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - -2.74367630482e-06 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected -2.74367630482e-06, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 3.1366944313e-06 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 3.1366944313e-06, is " << last_msg_.c_us; - EXPECT_EQ(last_msg_.common.fit_interval, 14400) << "incorrect value for last_msg_.common.fit_interval, expected 14400, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 0) << "incorrect value for last_msg_.common.sid.code, expected 0, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.sat, 22) << "incorrect value for last_msg_.common.sid.sat, expected 22, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toe.tow, 446384) << "incorrect value for last_msg_.common.toe.tow, expected 446384, is " << last_msg_.common.toe.tow; - EXPECT_EQ(last_msg_.common.toe.wn, 2154) << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " << last_msg_.common.toe.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 2.0, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.dn * 100 - 5.69452291402e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 5.69452291402e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " << last_msg_.ecc; - EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.934151448026, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected -4.03588239642e-11, is " << last_msg_.inc_dot; - EXPECT_EQ(last_msg_.iodc, 45) << "incorrect value for last_msg_.iodc, expected 45, is " << last_msg_.iodc; - EXPECT_EQ(last_msg_.iode, 45) << "incorrect value for last_msg_.iode, expected 45, is " << last_msg_.iode; - EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, is " << last_msg_.omegadot; - EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.tgd * 100 - -1.76951289177e-08 * 100), 0.05) << "incorrect value for last_msg_.tgd, expected -1.76951289177e-08, is " << last_msg_.tgd; - EXPECT_EQ(last_msg_.toc.tow, 446384) << "incorrect value for last_msg_.toc.tow, expected 446384, is " << last_msg_.toc.tow; - EXPECT_EQ(last_msg_.toc.wn, 2154) << "incorrect value for last_msg_.toc.wn, expected 2154, is " << last_msg_.toc.wn; - EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) << "incorrect value for last_msg_.w, expected -0.98930366296, is " << last_msg_.w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 2314); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected 0.0, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.c_ic * 100 - 7.45058059692e-09 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected 7.45058059692e-09, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - -1.15483999252e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected -1.15483999252e-07, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - 308.625 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected 308.625, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - -52.3125 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected -52.3125, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - -2.74367630482e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected -2.74367630482e-06, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 3.1366944313e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 3.1366944313e-06, is " + << last_msg_.c_us; + EXPECT_EQ(last_msg_.common.fit_interval, 14400) + << "incorrect value for last_msg_.common.fit_interval, expected 14400, " + "is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 0) + << "incorrect value for last_msg_.common.sid.code, expected 0, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.sat, 22) + << "incorrect value for last_msg_.common.sid.sat, expected 22, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toe.tow, 446384) + << "incorrect value for last_msg_.common.toe.tow, expected 446384, is " + << last_msg_.common.toe.tow; + EXPECT_EQ(last_msg_.common.toe.wn, 2154) + << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " + << last_msg_.common.toe.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 2.0, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.dn * 100 - 5.69452291402e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 5.69452291402e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " + << last_msg_.ecc; + EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.934151448026, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected -4.03588239642e-11, " + "is " + << last_msg_.inc_dot; + EXPECT_EQ(last_msg_.iodc, 45) + << "incorrect value for last_msg_.iodc, expected 45, is " + << last_msg_.iodc; + EXPECT_EQ(last_msg_.iode, 45) + << "incorrect value for last_msg_.iode, expected 45, is " + << last_msg_.iode; + EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, " + "is " + << last_msg_.omegadot; + EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.tgd * 100 - -1.76951289177e-08 * 100), 0.05) + << "incorrect value for last_msg_.tgd, expected -1.76951289177e-08, is " + << last_msg_.tgd; + EXPECT_EQ(last_msg_.toc.tow, 446384) + << "incorrect value for last_msg_.toc.tow, expected 446384, is " + << last_msg_.toc.tow; + EXPECT_EQ(last_msg_.toc.wn, 2154) + << "incorrect value for last_msg_.toc.wn, expected 2154, is " + << last_msg_.toc.wn; + EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for last_msg_.w, expected -0.98930366296, is " + << last_msg_.w; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepE.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepE.cc index 45d92d74e..65d92f2b1 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepE.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepE.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepE.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepE.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisGPSDepE0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisGPSDepE0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisGPSDepE0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisGPSDepE0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_gps_dep_e_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_gps_dep_e_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,94 +67,173 @@ class Test_auto_check_sbp_observation_MsgEphemerisGPSDepE0 : sbp_msg_ephemeris_gps_dep_e_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGPSDepE0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGPSDepE0, Test) { + uint8_t encoded_frame[] = { + 85, 129, 0, 123, 0, 185, 22, 0, 0, 0, 176, 207, 6, 0, 106, + 8, 0, 0, 0, 0, 0, 0, 0, 64, 64, 56, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 83, 190, 0, 0, 0, 0, 0, 40, 74, + 192, 0, 0, 0, 0, 0, 74, 115, 64, 0, 0, 0, 0, 0, 4, + 199, 190, 0, 0, 0, 0, 0, 80, 202, 62, 0, 0, 0, 0, 0, + 0, 64, 62, 0, 0, 0, 0, 0, 0, 127, 190, 114, 216, 96, 180, + 49, 117, 56, 62, 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, + 32, 191, 247, 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, + 179, 134, 141, 248, 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, + 59, 199, 39, 96, 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, + 221, 47, 100, 224, 255, 47, 198, 189, 0, 0, 0, 0, 108, 177, 68, + 191, 0, 0, 0, 0, 0, 192, 163, 61, 0, 0, 0, 0, 0, 0, + 0, 0, 176, 207, 6, 0, 106, 8, 45, 45, 0, 6, 238, + }; - uint8_t encoded_frame[] = {85,129,0,123,0,185,22,0,0,0,176,207,6,0,106,8,0,0,0,0,0,0,0,64,64,56,0,0,1,0,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,0,0,0,0,0,0,0,0,176,207,6,0,106,8,45,45,0,6,238, }; + sbp_msg_ephemeris_gps_dep_e_t test_msg{}; + test_msg.af0 = -0.0006315018981695175; + test_msg.af1 = 8.981260180007666e-12; + test_msg.af2 = 0.0; + test_msg.c_ic = 7.450580596923828e-09; + test_msg.c_is = -1.1548399925231934e-07; + test_msg.c_rc = 308.625; + test_msg.c_rs = -52.3125; + test_msg.c_uc = -2.7436763048171997e-06; + test_msg.c_us = 3.1366944313049316e-06; + test_msg.common.fit_interval = 14400; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 0; + test_msg.common.sid.reserved = 0; + test_msg.common.sid.sat = 22; + test_msg.common.toe.tow = 446384; + test_msg.common.toe.wn = 2154; + test_msg.common.ura = 2.0; + test_msg.common.valid = 1; + test_msg.dn = 5.694522914022375e-09; + test_msg.ecc = 0.007072207052260637; + test_msg.inc = 0.9341514480259797; + test_msg.inc_dot = -4.035882396415757e-11; + test_msg.iodc = 45; + test_msg.iode = 45; + test_msg.m0 = -0.02200078842114688; + test_msg.omega0 = -1.8731818448797617; + test_msg.omegadot = -8.903585155774196e-09; + test_msg.sqrta = 5153.550029754639; + test_msg.tgd = -1.7695128917694092e-08; + test_msg.toc.tow = 446384; + test_msg.toc.wn = 2154; + test_msg.w = -0.9893036629599647; - sbp_msg_ephemeris_gps_dep_e_t test_msg{}; - test_msg.af0 = -0.0006315018981695175; - test_msg.af1 = 8.981260180007666e-12; - test_msg.af2 = 0.0; - test_msg.c_ic = 7.450580596923828e-09; - test_msg.c_is = -1.1548399925231934e-07; - test_msg.c_rc = 308.625; - test_msg.c_rs = -52.3125; - test_msg.c_uc = -2.7436763048171997e-06; - test_msg.c_us = 3.1366944313049316e-06; - test_msg.common.fit_interval = 14400; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 0; - test_msg.common.sid.reserved = 0; - test_msg.common.sid.sat = 22; - test_msg.common.toe.tow = 446384; - test_msg.common.toe.wn = 2154; - test_msg.common.ura = 2.0; - test_msg.common.valid = 1; - test_msg.dn = 5.694522914022375e-09; - test_msg.ecc = 0.007072207052260637; - test_msg.inc = 0.9341514480259797; - test_msg.inc_dot = -4.035882396415757e-11; - test_msg.iodc = 45; - test_msg.iode = 45; - test_msg.m0 = -0.02200078842114688; - test_msg.omega0 = -1.8731818448797617; - test_msg.omegadot = -8.903585155774196e-09; - test_msg.sqrta = 5153.550029754639; - test_msg.tgd = -1.7695128917694092e-08; - test_msg.toc.tow = 446384; - test_msg.toc.wn = 2154; - test_msg.w = -0.9893036629599647; - - EXPECT_EQ(send_message( 123, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(123, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.af2, expected 0.0, is " << last_msg_.af2; - EXPECT_LT((last_msg_.c_ic * 100 - 7.45058059692e-09 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected 7.45058059692e-09, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - -1.15483999252e-07 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected -1.15483999252e-07, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - 308.625 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected 308.625, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - -52.3125 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected -52.3125, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - -2.74367630482e-06 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected -2.74367630482e-06, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 3.1366944313e-06 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 3.1366944313e-06, is " << last_msg_.c_us; - EXPECT_EQ(last_msg_.common.fit_interval, 14400) << "incorrect value for last_msg_.common.fit_interval, expected 14400, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 0) << "incorrect value for last_msg_.common.sid.code, expected 0, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.reserved, 0) << "incorrect value for last_msg_.common.sid.reserved, expected 0, is " << last_msg_.common.sid.reserved; - EXPECT_EQ(last_msg_.common.sid.sat, 22) << "incorrect value for last_msg_.common.sid.sat, expected 22, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toe.tow, 446384) << "incorrect value for last_msg_.common.toe.tow, expected 446384, is " << last_msg_.common.toe.tow; - EXPECT_EQ(last_msg_.common.toe.wn, 2154) << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " << last_msg_.common.toe.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 2.0, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.dn * 100 - 5.69452291402e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 5.69452291402e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " << last_msg_.ecc; - EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.934151448026, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected -4.03588239642e-11, is " << last_msg_.inc_dot; - EXPECT_EQ(last_msg_.iodc, 45) << "incorrect value for last_msg_.iodc, expected 45, is " << last_msg_.iodc; - EXPECT_EQ(last_msg_.iode, 45) << "incorrect value for last_msg_.iode, expected 45, is " << last_msg_.iode; - EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, is " << last_msg_.omegadot; - EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.tgd * 100 - -1.76951289177e-08 * 100), 0.05) << "incorrect value for last_msg_.tgd, expected -1.76951289177e-08, is " << last_msg_.tgd; - EXPECT_EQ(last_msg_.toc.tow, 446384) << "incorrect value for last_msg_.toc.tow, expected 446384, is " << last_msg_.toc.tow; - EXPECT_EQ(last_msg_.toc.wn, 2154) << "incorrect value for last_msg_.toc.wn, expected 2154, is " << last_msg_.toc.wn; - EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) << "incorrect value for last_msg_.w, expected -0.98930366296, is " << last_msg_.w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected 0.0, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.c_ic * 100 - 7.45058059692e-09 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected 7.45058059692e-09, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - -1.15483999252e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected -1.15483999252e-07, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - 308.625 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected 308.625, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - -52.3125 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected -52.3125, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - -2.74367630482e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected -2.74367630482e-06, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 3.1366944313e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 3.1366944313e-06, is " + << last_msg_.c_us; + EXPECT_EQ(last_msg_.common.fit_interval, 14400) + << "incorrect value for last_msg_.common.fit_interval, expected 14400, " + "is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 0) + << "incorrect value for last_msg_.common.sid.code, expected 0, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.reserved, 0) + << "incorrect value for last_msg_.common.sid.reserved, expected 0, is " + << last_msg_.common.sid.reserved; + EXPECT_EQ(last_msg_.common.sid.sat, 22) + << "incorrect value for last_msg_.common.sid.sat, expected 22, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toe.tow, 446384) + << "incorrect value for last_msg_.common.toe.tow, expected 446384, is " + << last_msg_.common.toe.tow; + EXPECT_EQ(last_msg_.common.toe.wn, 2154) + << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " + << last_msg_.common.toe.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 2.0, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.dn * 100 - 5.69452291402e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 5.69452291402e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " + << last_msg_.ecc; + EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.934151448026, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected -4.03588239642e-11, " + "is " + << last_msg_.inc_dot; + EXPECT_EQ(last_msg_.iodc, 45) + << "incorrect value for last_msg_.iodc, expected 45, is " + << last_msg_.iodc; + EXPECT_EQ(last_msg_.iode, 45) + << "incorrect value for last_msg_.iode, expected 45, is " + << last_msg_.iode; + EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, " + "is " + << last_msg_.omegadot; + EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.tgd * 100 - -1.76951289177e-08 * 100), 0.05) + << "incorrect value for last_msg_.tgd, expected -1.76951289177e-08, is " + << last_msg_.tgd; + EXPECT_EQ(last_msg_.toc.tow, 446384) + << "incorrect value for last_msg_.toc.tow, expected 446384, is " + << last_msg_.toc.tow; + EXPECT_EQ(last_msg_.toc.wn, 2154) + << "incorrect value for last_msg_.toc.wn, expected 2154, is " + << last_msg_.toc.wn; + EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for last_msg_.w, expected -0.98930366296, is " + << last_msg_.w; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepF.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepF.cc index 35c070e1b..ade2ffcf2 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepF.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepF.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepF.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisGPSDepF0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisGPSDepF0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisGPSDepF0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisGPSDepF0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_gps_dep_f_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_gps_dep_f_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,92 +67,169 @@ class Test_auto_check_sbp_observation_MsgEphemerisGPSDepF0 : sbp_msg_ephemeris_gps_dep_f_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGPSDepF0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGPSDepF0, Test) { + uint8_t encoded_frame[] = { + 85, 134, 0, 123, 0, 183, 22, 0, 176, 207, 6, 0, 106, 8, 0, + 0, 0, 0, 0, 0, 0, 64, 64, 56, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 83, 190, 0, 0, 0, 0, 0, 40, 74, 192, 0, + 0, 0, 0, 0, 74, 115, 64, 0, 0, 0, 0, 0, 4, 199, 190, + 0, 0, 0, 0, 0, 80, 202, 62, 0, 0, 0, 0, 0, 0, 64, + 62, 0, 0, 0, 0, 0, 0, 127, 190, 114, 216, 96, 180, 49, 117, + 56, 62, 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, + 247, 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, + 141, 248, 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, 199, + 39, 96, 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, 221, 47, + 100, 224, 255, 47, 198, 189, 0, 0, 0, 0, 108, 177, 68, 191, 0, + 0, 0, 0, 0, 192, 163, 61, 0, 0, 0, 0, 0, 0, 0, 0, + 176, 207, 6, 0, 106, 8, 45, 45, 0, 115, 254, + }; - uint8_t encoded_frame[] = {85,134,0,123,0,183,22,0,176,207,6,0,106,8,0,0,0,0,0,0,0,64,64,56,0,0,1,0,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,0,0,0,0,0,0,0,0,176,207,6,0,106,8,45,45,0,115,254, }; + sbp_msg_ephemeris_gps_dep_f_t test_msg{}; + test_msg.af0 = -0.0006315018981695175; + test_msg.af1 = 8.981260180007666e-12; + test_msg.af2 = 0.0; + test_msg.c_ic = 7.450580596923828e-09; + test_msg.c_is = -1.1548399925231934e-07; + test_msg.c_rc = 308.625; + test_msg.c_rs = -52.3125; + test_msg.c_uc = -2.7436763048171997e-06; + test_msg.c_us = 3.1366944313049316e-06; + test_msg.common.fit_interval = 14400; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 0; + test_msg.common.sid.sat = 22; + test_msg.common.toe.tow = 446384; + test_msg.common.toe.wn = 2154; + test_msg.common.ura = 2.0; + test_msg.common.valid = 1; + test_msg.dn = 5.694522914022375e-09; + test_msg.ecc = 0.007072207052260637; + test_msg.inc = 0.9341514480259797; + test_msg.inc_dot = -4.035882396415757e-11; + test_msg.iodc = 45; + test_msg.iode = 45; + test_msg.m0 = -0.02200078842114688; + test_msg.omega0 = -1.8731818448797617; + test_msg.omegadot = -8.903585155774196e-09; + test_msg.sqrta = 5153.550029754639; + test_msg.tgd = -1.7695128917694092e-08; + test_msg.toc.tow = 446384; + test_msg.toc.wn = 2154; + test_msg.w = -0.9893036629599647; - sbp_msg_ephemeris_gps_dep_f_t test_msg{}; - test_msg.af0 = -0.0006315018981695175; - test_msg.af1 = 8.981260180007666e-12; - test_msg.af2 = 0.0; - test_msg.c_ic = 7.450580596923828e-09; - test_msg.c_is = -1.1548399925231934e-07; - test_msg.c_rc = 308.625; - test_msg.c_rs = -52.3125; - test_msg.c_uc = -2.7436763048171997e-06; - test_msg.c_us = 3.1366944313049316e-06; - test_msg.common.fit_interval = 14400; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 0; - test_msg.common.sid.sat = 22; - test_msg.common.toe.tow = 446384; - test_msg.common.toe.wn = 2154; - test_msg.common.ura = 2.0; - test_msg.common.valid = 1; - test_msg.dn = 5.694522914022375e-09; - test_msg.ecc = 0.007072207052260637; - test_msg.inc = 0.9341514480259797; - test_msg.inc_dot = -4.035882396415757e-11; - test_msg.iodc = 45; - test_msg.iode = 45; - test_msg.m0 = -0.02200078842114688; - test_msg.omega0 = -1.8731818448797617; - test_msg.omegadot = -8.903585155774196e-09; - test_msg.sqrta = 5153.550029754639; - test_msg.tgd = -1.7695128917694092e-08; - test_msg.toc.tow = 446384; - test_msg.toc.wn = 2154; - test_msg.w = -0.9893036629599647; - - EXPECT_EQ(send_message( 123, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(123, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.af2, expected 0.0, is " << last_msg_.af2; - EXPECT_LT((last_msg_.c_ic * 100 - 7.45058059692e-09 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected 7.45058059692e-09, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - -1.15483999252e-07 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected -1.15483999252e-07, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - 308.625 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected 308.625, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - -52.3125 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected -52.3125, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - -2.74367630482e-06 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected -2.74367630482e-06, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 3.1366944313e-06 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 3.1366944313e-06, is " << last_msg_.c_us; - EXPECT_EQ(last_msg_.common.fit_interval, 14400) << "incorrect value for last_msg_.common.fit_interval, expected 14400, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 0) << "incorrect value for last_msg_.common.sid.code, expected 0, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.sat, 22) << "incorrect value for last_msg_.common.sid.sat, expected 22, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toe.tow, 446384) << "incorrect value for last_msg_.common.toe.tow, expected 446384, is " << last_msg_.common.toe.tow; - EXPECT_EQ(last_msg_.common.toe.wn, 2154) << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " << last_msg_.common.toe.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 2.0, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.dn * 100 - 5.69452291402e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 5.69452291402e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " << last_msg_.ecc; - EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.934151448026, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected -4.03588239642e-11, is " << last_msg_.inc_dot; - EXPECT_EQ(last_msg_.iodc, 45) << "incorrect value for last_msg_.iodc, expected 45, is " << last_msg_.iodc; - EXPECT_EQ(last_msg_.iode, 45) << "incorrect value for last_msg_.iode, expected 45, is " << last_msg_.iode; - EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, is " << last_msg_.omegadot; - EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.tgd * 100 - -1.76951289177e-08 * 100), 0.05) << "incorrect value for last_msg_.tgd, expected -1.76951289177e-08, is " << last_msg_.tgd; - EXPECT_EQ(last_msg_.toc.tow, 446384) << "incorrect value for last_msg_.toc.tow, expected 446384, is " << last_msg_.toc.tow; - EXPECT_EQ(last_msg_.toc.wn, 2154) << "incorrect value for last_msg_.toc.wn, expected 2154, is " << last_msg_.toc.wn; - EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) << "incorrect value for last_msg_.w, expected -0.98930366296, is " << last_msg_.w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected -0.00063150189817, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected 8.98126018001e-12, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected 0.0, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.c_ic * 100 - 7.45058059692e-09 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected 7.45058059692e-09, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - -1.15483999252e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected -1.15483999252e-07, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - 308.625 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected 308.625, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - -52.3125 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected -52.3125, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - -2.74367630482e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected -2.74367630482e-06, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 3.1366944313e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 3.1366944313e-06, is " + << last_msg_.c_us; + EXPECT_EQ(last_msg_.common.fit_interval, 14400) + << "incorrect value for last_msg_.common.fit_interval, expected 14400, " + "is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 0) + << "incorrect value for last_msg_.common.sid.code, expected 0, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.sat, 22) + << "incorrect value for last_msg_.common.sid.sat, expected 22, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toe.tow, 446384) + << "incorrect value for last_msg_.common.toe.tow, expected 446384, is " + << last_msg_.common.toe.tow; + EXPECT_EQ(last_msg_.common.toe.wn, 2154) + << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " + << last_msg_.common.toe.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 2.0, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.dn * 100 - 5.69452291402e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 5.69452291402e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.00707220705226, is " + << last_msg_.ecc; + EXPECT_LT((last_msg_.inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.934151448026, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected -4.03588239642e-11, " + "is " + << last_msg_.inc_dot; + EXPECT_EQ(last_msg_.iodc, 45) + << "incorrect value for last_msg_.iodc, expected 45, is " + << last_msg_.iodc; + EXPECT_EQ(last_msg_.iode, 45) + << "incorrect value for last_msg_.iode, expected 45, is " + << last_msg_.iode; + EXPECT_LT((last_msg_.m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected -0.0220007884211, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected -1.87318184488, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -8.90358515577e-09, " + "is " + << last_msg_.omegadot; + EXPECT_LT((last_msg_.sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5153.55002975, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.tgd * 100 - -1.76951289177e-08 * 100), 0.05) + << "incorrect value for last_msg_.tgd, expected -1.76951289177e-08, is " + << last_msg_.tgd; + EXPECT_EQ(last_msg_.toc.tow, 446384) + << "incorrect value for last_msg_.toc.tow, expected 446384, is " + << last_msg_.toc.tow; + EXPECT_EQ(last_msg_.toc.wn, 2154) + << "incorrect value for last_msg_.toc.wn, expected 2154, is " + << last_msg_.toc.wn; + EXPECT_LT((last_msg_.w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for last_msg_.w, expected -0.98930366296, is " + << last_msg_.w; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGal.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGal.cc index 98e54fc7e..e4395163e 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGal.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGal.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGal.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGal.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisGal0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisGal0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisGal0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisGal0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_gal_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_gal_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,96 +67,177 @@ class Test_auto_check_sbp_observation_MsgEphemerisGal0 : sbp_msg_ephemeris_gal_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGal0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGal0, Test) { + uint8_t encoded_frame[] = { + 85, 141, 0, 128, 240, 153, 27, 14, 32, 217, 6, 0, 106, 8, 20, + 174, 71, 64, 64, 56, 0, 0, 1, 0, 0, 0, 16, 49, 0, 0, + 16, 49, 0, 0, 34, 65, 0, 184, 132, 67, 0, 0, 16, 53, 0, + 0, 134, 54, 0, 0, 8, 179, 0, 0, 8, 179, 217, 204, 130, 105, + 128, 182, 43, 62, 248, 106, 31, 220, 8, 136, 253, 191, 0, 0, 0, + 0, 151, 92, 38, 63, 0, 0, 0, 55, 154, 64, 181, 64, 56, 38, + 1, 141, 255, 182, 242, 63, 222, 147, 136, 39, 79, 186, 56, 190, 80, + 114, 204, 251, 193, 92, 191, 63, 237, 55, 19, 41, 177, 73, 239, 63, + 49, 65, 189, 240, 8, 216, 245, 189, 255, 255, 255, 255, 67, 235, 241, + 190, 255, 255, 255, 255, 255, 255, 161, 189, 0, 0, 0, 0, 32, 217, + 6, 0, 106, 8, 108, 0, 108, 0, 0, 71, 208, + }; - uint8_t encoded_frame[] = {85,141,0,128,240,153,27,14,32,217,6,0,106,8,20,174,71,64,64,56,0,0,1,0,0,0,16,49,0,0,16,49,0,0,34,65,0,184,132,67,0,0,16,53,0,0,134,54,0,0,8,179,0,0,8,179,217,204,130,105,128,182,43,62,248,106,31,220,8,136,253,191,0,0,0,0,151,92,38,63,0,0,0,55,154,64,181,64,56,38,1,141,255,182,242,63,222,147,136,39,79,186,56,190,80,114,204,251,193,92,191,63,237,55,19,41,177,73,239,63,49,65,189,240,8,216,245,189,255,255,255,255,67,235,241,190,255,255,255,255,255,255,161,189,0,0,0,0,32,217,6,0,106,8,108,0,108,0,0,71,208, }; + sbp_msg_ephemeris_gal_t test_msg{}; + test_msg.af0 = -1.7088896129280325e-05; + test_msg.af1 = -8.185452315956353e-12; + test_msg.af2 = 0.0; + test_msg.bgd_e1e5a = 2.0954757928848267e-09; + test_msg.bgd_e1e5b = 2.0954757928848267e-09; + test_msg.c_ic = -3.166496753692627e-08; + test_msg.c_is = -3.166496753692627e-08; + test_msg.c_rc = 265.4375; + test_msg.c_rs = 10.125; + test_msg.c_uc = 5.364418029785156e-07; + test_msg.c_us = 3.993511199951172e-06; + test_msg.common.fit_interval = 14400; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 14; + test_msg.common.sid.sat = 27; + test_msg.common.toe.tow = 448800; + test_msg.common.toe.wn = 2154; + test_msg.common.ura = 3.119999885559082; + test_msg.common.valid = 1; + test_msg.dn = 3.2262058129932258e-09; + test_msg.ecc = 0.00017060607206076384; + test_msg.inc = 0.9777456094977858; + test_msg.inc_dot = -3.1787038343451465e-10; + test_msg.iodc = 108; + test_msg.iode = 108; + test_msg.m0 = -1.8457115744155868; + test_msg.omega0 = 1.16967730598334; + test_msg.omegadot = -5.757382675240872e-09; + test_msg.source = 0; + test_msg.sqrta = 5440.602401733398; + test_msg.toc.tow = 448800; + test_msg.toc.wn = 2154; + test_msg.w = 0.12250912091662625; - sbp_msg_ephemeris_gal_t test_msg{}; - test_msg.af0 = -1.7088896129280325e-05; - test_msg.af1 = -8.185452315956353e-12; - test_msg.af2 = 0.0; - test_msg.bgd_e1e5a = 2.0954757928848267e-09; - test_msg.bgd_e1e5b = 2.0954757928848267e-09; - test_msg.c_ic = -3.166496753692627e-08; - test_msg.c_is = -3.166496753692627e-08; - test_msg.c_rc = 265.4375; - test_msg.c_rs = 10.125; - test_msg.c_uc = 5.364418029785156e-07; - test_msg.c_us = 3.993511199951172e-06; - test_msg.common.fit_interval = 14400; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 14; - test_msg.common.sid.sat = 27; - test_msg.common.toe.tow = 448800; - test_msg.common.toe.wn = 2154; - test_msg.common.ura = 3.119999885559082; - test_msg.common.valid = 1; - test_msg.dn = 3.2262058129932258e-09; - test_msg.ecc = 0.00017060607206076384; - test_msg.inc = 0.9777456094977858; - test_msg.inc_dot = -3.1787038343451465e-10; - test_msg.iodc = 108; - test_msg.iode = 108; - test_msg.m0 = -1.8457115744155868; - test_msg.omega0 = 1.16967730598334; - test_msg.omegadot = -5.757382675240872e-09; - test_msg.source = 0; - test_msg.sqrta = 5440.602401733398; - test_msg.toc.tow = 448800; - test_msg.toc.wn = 2154; - test_msg.w = 0.12250912091662625; - - EXPECT_EQ(send_message( 61568, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(61568, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61568); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - -1.70888961293e-05 * 100), 0.05) << "incorrect value for last_msg_.af0, expected -1.70888961293e-05, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - -8.18545231596e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected -8.18545231596e-12, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.af2, expected 0.0, is " << last_msg_.af2; - EXPECT_LT((last_msg_.bgd_e1e5a * 100 - 2.09547579288e-09 * 100), 0.05) << "incorrect value for last_msg_.bgd_e1e5a, expected 2.09547579288e-09, is " << last_msg_.bgd_e1e5a; - EXPECT_LT((last_msg_.bgd_e1e5b * 100 - 2.09547579288e-09 * 100), 0.05) << "incorrect value for last_msg_.bgd_e1e5b, expected 2.09547579288e-09, is " << last_msg_.bgd_e1e5b; - EXPECT_LT((last_msg_.c_ic * 100 - -3.16649675369e-08 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected -3.16649675369e-08, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - -3.16649675369e-08 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected -3.16649675369e-08, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - 265.4375 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected 265.4375, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - 10.125 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected 10.125, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - 5.36441802979e-07 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected 5.36441802979e-07, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 3.99351119995e-06 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 3.99351119995e-06, is " << last_msg_.c_us; - EXPECT_EQ(last_msg_.common.fit_interval, 14400) << "incorrect value for last_msg_.common.fit_interval, expected 14400, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 14) << "incorrect value for last_msg_.common.sid.code, expected 14, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.sat, 27) << "incorrect value for last_msg_.common.sid.sat, expected 27, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toe.tow, 448800) << "incorrect value for last_msg_.common.toe.tow, expected 448800, is " << last_msg_.common.toe.tow; - EXPECT_EQ(last_msg_.common.toe.wn, 2154) << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " << last_msg_.common.toe.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 3.11999988556 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 3.11999988556, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.dn * 100 - 3.22620581299e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 3.22620581299e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.000170606072061 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.000170606072061, is " << last_msg_.ecc; - EXPECT_LT((last_msg_.inc * 100 - 0.977745609498 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.977745609498, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - -3.17870383435e-10 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected -3.17870383435e-10, is " << last_msg_.inc_dot; - EXPECT_EQ(last_msg_.iodc, 108) << "incorrect value for last_msg_.iodc, expected 108, is " << last_msg_.iodc; - EXPECT_EQ(last_msg_.iode, 108) << "incorrect value for last_msg_.iode, expected 108, is " << last_msg_.iode; - EXPECT_LT((last_msg_.m0 * 100 - -1.84571157442 * 100), 0.05) << "incorrect value for last_msg_.m0, expected -1.84571157442, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - 1.16967730598 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected 1.16967730598, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -5.75738267524e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -5.75738267524e-09, is " << last_msg_.omegadot; - EXPECT_EQ(last_msg_.source, 0) << "incorrect value for last_msg_.source, expected 0, is " << last_msg_.source; - EXPECT_LT((last_msg_.sqrta * 100 - 5440.60240173 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5440.60240173, is " << last_msg_.sqrta; - EXPECT_EQ(last_msg_.toc.tow, 448800) << "incorrect value for last_msg_.toc.tow, expected 448800, is " << last_msg_.toc.tow; - EXPECT_EQ(last_msg_.toc.wn, 2154) << "incorrect value for last_msg_.toc.wn, expected 2154, is " << last_msg_.toc.wn; - EXPECT_LT((last_msg_.w * 100 - 0.122509120917 * 100), 0.05) << "incorrect value for last_msg_.w, expected 0.122509120917, is " << last_msg_.w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61568); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - -1.70888961293e-05 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected -1.70888961293e-05, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - -8.18545231596e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected -8.18545231596e-12, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected 0.0, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.bgd_e1e5a * 100 - 2.09547579288e-09 * 100), 0.05) + << "incorrect value for last_msg_.bgd_e1e5a, expected 2.09547579288e-09, " + "is " + << last_msg_.bgd_e1e5a; + EXPECT_LT((last_msg_.bgd_e1e5b * 100 - 2.09547579288e-09 * 100), 0.05) + << "incorrect value for last_msg_.bgd_e1e5b, expected 2.09547579288e-09, " + "is " + << last_msg_.bgd_e1e5b; + EXPECT_LT((last_msg_.c_ic * 100 - -3.16649675369e-08 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected -3.16649675369e-08, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - -3.16649675369e-08 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected -3.16649675369e-08, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - 265.4375 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected 265.4375, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - 10.125 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected 10.125, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - 5.36441802979e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected 5.36441802979e-07, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 3.99351119995e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 3.99351119995e-06, is " + << last_msg_.c_us; + EXPECT_EQ(last_msg_.common.fit_interval, 14400) + << "incorrect value for last_msg_.common.fit_interval, expected 14400, " + "is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 14) + << "incorrect value for last_msg_.common.sid.code, expected 14, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.sat, 27) + << "incorrect value for last_msg_.common.sid.sat, expected 27, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toe.tow, 448800) + << "incorrect value for last_msg_.common.toe.tow, expected 448800, is " + << last_msg_.common.toe.tow; + EXPECT_EQ(last_msg_.common.toe.wn, 2154) + << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " + << last_msg_.common.toe.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 3.11999988556 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 3.11999988556, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.dn * 100 - 3.22620581299e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 3.22620581299e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.000170606072061 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.000170606072061, is " + << last_msg_.ecc; + EXPECT_LT((last_msg_.inc * 100 - 0.977745609498 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.977745609498, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - -3.17870383435e-10 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected -3.17870383435e-10, " + "is " + << last_msg_.inc_dot; + EXPECT_EQ(last_msg_.iodc, 108) + << "incorrect value for last_msg_.iodc, expected 108, is " + << last_msg_.iodc; + EXPECT_EQ(last_msg_.iode, 108) + << "incorrect value for last_msg_.iode, expected 108, is " + << last_msg_.iode; + EXPECT_LT((last_msg_.m0 * 100 - -1.84571157442 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected -1.84571157442, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - 1.16967730598 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected 1.16967730598, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -5.75738267524e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -5.75738267524e-09, " + "is " + << last_msg_.omegadot; + EXPECT_EQ(last_msg_.source, 0) + << "incorrect value for last_msg_.source, expected 0, is " + << last_msg_.source; + EXPECT_LT((last_msg_.sqrta * 100 - 5440.60240173 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5440.60240173, is " + << last_msg_.sqrta; + EXPECT_EQ(last_msg_.toc.tow, 448800) + << "incorrect value for last_msg_.toc.tow, expected 448800, is " + << last_msg_.toc.tow; + EXPECT_EQ(last_msg_.toc.wn, 2154) + << "incorrect value for last_msg_.toc.wn, expected 2154, is " + << last_msg_.toc.wn; + EXPECT_LT((last_msg_.w * 100 - 0.122509120917 * 100), 0.05) + << "incorrect value for last_msg_.w, expected 0.122509120917, is " + << last_msg_.w; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGalDepA.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGalDepA.cc index 36c2968a3..d307605f5 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGalDepA.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisGalDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGalDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGalDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisGalDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisGalDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisGalDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisGalDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_gal_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_gal_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,94 +67,171 @@ class Test_auto_check_sbp_observation_MsgEphemerisGalDepA0 : sbp_msg_ephemeris_gal_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGalDepA0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisGalDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 149, 0, 195, 4, 152, 27, 14, 32, 217, 6, 0, 106, 8, 102, + 102, 230, 64, 64, 56, 0, 0, 1, 0, 154, 153, 153, 63, 205, 204, + 12, 64, 0, 0, 34, 65, 0, 184, 132, 67, 102, 102, 166, 64, 102, + 102, 198, 64, 205, 204, 76, 64, 102, 102, 134, 64, 217, 204, 130, 105, + 128, 182, 43, 62, 248, 106, 31, 220, 8, 136, 253, 191, 0, 0, 0, + 0, 151, 92, 38, 63, 0, 0, 0, 55, 154, 64, 181, 64, 56, 38, + 1, 141, 255, 182, 242, 63, 222, 147, 136, 39, 79, 186, 56, 190, 80, + 114, 204, 251, 193, 92, 191, 63, 237, 55, 19, 41, 177, 73, 239, 63, + 49, 65, 189, 240, 8, 216, 245, 189, 255, 255, 255, 255, 67, 235, 241, + 190, 255, 255, 255, 255, 255, 255, 161, 189, 205, 204, 76, 62, 32, 217, + 6, 0, 106, 8, 108, 0, 108, 0, 168, 49, + }; - uint8_t encoded_frame[] = {85,149,0,195,4,152,27,14,32,217,6,0,106,8,102,102,230,64,64,56,0,0,1,0,154,153,153,63,205,204,12,64,0,0,34,65,0,184,132,67,102,102,166,64,102,102,198,64,205,204,76,64,102,102,134,64,217,204,130,105,128,182,43,62,248,106,31,220,8,136,253,191,0,0,0,0,151,92,38,63,0,0,0,55,154,64,181,64,56,38,1,141,255,182,242,63,222,147,136,39,79,186,56,190,80,114,204,251,193,92,191,63,237,55,19,41,177,73,239,63,49,65,189,240,8,216,245,189,255,255,255,255,67,235,241,190,255,255,255,255,255,255,161,189,205,204,76,62,32,217,6,0,106,8,108,0,108,0,168,49, }; + sbp_msg_ephemeris_gal_dep_a_t test_msg{}; + test_msg.af0 = -1.7088896129280325e-05; + test_msg.af1 = -8.185452315956353e-12; + test_msg.af2 = 0.20000000298023224; + test_msg.bgd_e1e5a = 1.2000000476837158; + test_msg.bgd_e1e5b = 2.200000047683716; + test_msg.c_ic = 3.200000047683716; + test_msg.c_is = 4.199999809265137; + test_msg.c_rc = 265.4375; + test_msg.c_rs = 10.125; + test_msg.c_uc = 5.199999809265137; + test_msg.c_us = 6.199999809265137; + test_msg.common.fit_interval = 14400; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 14; + test_msg.common.sid.sat = 27; + test_msg.common.toe.tow = 448800; + test_msg.common.toe.wn = 2154; + test_msg.common.ura = 7.199999809265137; + test_msg.common.valid = 1; + test_msg.dn = 3.2262058129932258e-09; + test_msg.ecc = 0.00017060607206076384; + test_msg.inc = 0.9777456094977858; + test_msg.inc_dot = -3.1787038343451465e-10; + test_msg.iodc = 108; + test_msg.iode = 108; + test_msg.m0 = -1.8457115744155868; + test_msg.omega0 = 1.16967730598334; + test_msg.omegadot = -5.757382675240872e-09; + test_msg.sqrta = 5440.602401733398; + test_msg.toc.tow = 448800; + test_msg.toc.wn = 2154; + test_msg.w = 0.12250912091662625; - sbp_msg_ephemeris_gal_dep_a_t test_msg{}; - test_msg.af0 = -1.7088896129280325e-05; - test_msg.af1 = -8.185452315956353e-12; - test_msg.af2 = 0.20000000298023224; - test_msg.bgd_e1e5a = 1.2000000476837158; - test_msg.bgd_e1e5b = 2.200000047683716; - test_msg.c_ic = 3.200000047683716; - test_msg.c_is = 4.199999809265137; - test_msg.c_rc = 265.4375; - test_msg.c_rs = 10.125; - test_msg.c_uc = 5.199999809265137; - test_msg.c_us = 6.199999809265137; - test_msg.common.fit_interval = 14400; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 14; - test_msg.common.sid.sat = 27; - test_msg.common.toe.tow = 448800; - test_msg.common.toe.wn = 2154; - test_msg.common.ura = 7.199999809265137; - test_msg.common.valid = 1; - test_msg.dn = 3.2262058129932258e-09; - test_msg.ecc = 0.00017060607206076384; - test_msg.inc = 0.9777456094977858; - test_msg.inc_dot = -3.1787038343451465e-10; - test_msg.iodc = 108; - test_msg.iode = 108; - test_msg.m0 = -1.8457115744155868; - test_msg.omega0 = 1.16967730598334; - test_msg.omegadot = -5.757382675240872e-09; - test_msg.sqrta = 5440.602401733398; - test_msg.toc.tow = 448800; - test_msg.toc.wn = 2154; - test_msg.w = 0.12250912091662625; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - -1.70888961293e-05 * 100), 0.05) << "incorrect value for last_msg_.af0, expected -1.70888961293e-05, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - -8.18545231596e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected -8.18545231596e-12, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - 0.20000000298 * 100), 0.05) << "incorrect value for last_msg_.af2, expected 0.20000000298, is " << last_msg_.af2; - EXPECT_LT((last_msg_.bgd_e1e5a * 100 - 1.20000004768 * 100), 0.05) << "incorrect value for last_msg_.bgd_e1e5a, expected 1.20000004768, is " << last_msg_.bgd_e1e5a; - EXPECT_LT((last_msg_.bgd_e1e5b * 100 - 2.20000004768 * 100), 0.05) << "incorrect value for last_msg_.bgd_e1e5b, expected 2.20000004768, is " << last_msg_.bgd_e1e5b; - EXPECT_LT((last_msg_.c_ic * 100 - 3.20000004768 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected 3.20000004768, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - 4.19999980927 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected 4.19999980927, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - 265.4375 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected 265.4375, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - 10.125 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected 10.125, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - 5.19999980927 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected 5.19999980927, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 6.19999980927 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 6.19999980927, is " << last_msg_.c_us; - EXPECT_EQ(last_msg_.common.fit_interval, 14400) << "incorrect value for last_msg_.common.fit_interval, expected 14400, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 14) << "incorrect value for last_msg_.common.sid.code, expected 14, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.sat, 27) << "incorrect value for last_msg_.common.sid.sat, expected 27, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toe.tow, 448800) << "incorrect value for last_msg_.common.toe.tow, expected 448800, is " << last_msg_.common.toe.tow; - EXPECT_EQ(last_msg_.common.toe.wn, 2154) << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " << last_msg_.common.toe.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 7.19999980927 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 7.19999980927, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.dn * 100 - 3.22620581299e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 3.22620581299e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.000170606072061 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.000170606072061, is " << last_msg_.ecc; - EXPECT_LT((last_msg_.inc * 100 - 0.977745609498 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.977745609498, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - -3.17870383435e-10 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected -3.17870383435e-10, is " << last_msg_.inc_dot; - EXPECT_EQ(last_msg_.iodc, 108) << "incorrect value for last_msg_.iodc, expected 108, is " << last_msg_.iodc; - EXPECT_EQ(last_msg_.iode, 108) << "incorrect value for last_msg_.iode, expected 108, is " << last_msg_.iode; - EXPECT_LT((last_msg_.m0 * 100 - -1.84571157442 * 100), 0.05) << "incorrect value for last_msg_.m0, expected -1.84571157442, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - 1.16967730598 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected 1.16967730598, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -5.75738267524e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -5.75738267524e-09, is " << last_msg_.omegadot; - EXPECT_LT((last_msg_.sqrta * 100 - 5440.60240173 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5440.60240173, is " << last_msg_.sqrta; - EXPECT_EQ(last_msg_.toc.tow, 448800) << "incorrect value for last_msg_.toc.tow, expected 448800, is " << last_msg_.toc.tow; - EXPECT_EQ(last_msg_.toc.wn, 2154) << "incorrect value for last_msg_.toc.wn, expected 2154, is " << last_msg_.toc.wn; - EXPECT_LT((last_msg_.w * 100 - 0.122509120917 * 100), 0.05) << "incorrect value for last_msg_.w, expected 0.122509120917, is " << last_msg_.w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - -1.70888961293e-05 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected -1.70888961293e-05, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - -8.18545231596e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected -8.18545231596e-12, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - 0.20000000298 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected 0.20000000298, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.bgd_e1e5a * 100 - 1.20000004768 * 100), 0.05) + << "incorrect value for last_msg_.bgd_e1e5a, expected 1.20000004768, is " + << last_msg_.bgd_e1e5a; + EXPECT_LT((last_msg_.bgd_e1e5b * 100 - 2.20000004768 * 100), 0.05) + << "incorrect value for last_msg_.bgd_e1e5b, expected 2.20000004768, is " + << last_msg_.bgd_e1e5b; + EXPECT_LT((last_msg_.c_ic * 100 - 3.20000004768 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected 3.20000004768, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - 4.19999980927 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected 4.19999980927, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - 265.4375 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected 265.4375, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - 10.125 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected 10.125, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - 5.19999980927 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected 5.19999980927, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 6.19999980927 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 6.19999980927, is " + << last_msg_.c_us; + EXPECT_EQ(last_msg_.common.fit_interval, 14400) + << "incorrect value for last_msg_.common.fit_interval, expected 14400, " + "is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 14) + << "incorrect value for last_msg_.common.sid.code, expected 14, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.sat, 27) + << "incorrect value for last_msg_.common.sid.sat, expected 27, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toe.tow, 448800) + << "incorrect value for last_msg_.common.toe.tow, expected 448800, is " + << last_msg_.common.toe.tow; + EXPECT_EQ(last_msg_.common.toe.wn, 2154) + << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " + << last_msg_.common.toe.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 7.19999980927 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 7.19999980927, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.dn * 100 - 3.22620581299e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 3.22620581299e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.000170606072061 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.000170606072061, is " + << last_msg_.ecc; + EXPECT_LT((last_msg_.inc * 100 - 0.977745609498 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.977745609498, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - -3.17870383435e-10 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected -3.17870383435e-10, " + "is " + << last_msg_.inc_dot; + EXPECT_EQ(last_msg_.iodc, 108) + << "incorrect value for last_msg_.iodc, expected 108, is " + << last_msg_.iodc; + EXPECT_EQ(last_msg_.iode, 108) + << "incorrect value for last_msg_.iode, expected 108, is " + << last_msg_.iode; + EXPECT_LT((last_msg_.m0 * 100 - -1.84571157442 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected -1.84571157442, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - 1.16967730598 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected 1.16967730598, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -5.75738267524e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -5.75738267524e-09, " + "is " + << last_msg_.omegadot; + EXPECT_LT((last_msg_.sqrta * 100 - 5440.60240173 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5440.60240173, is " + << last_msg_.sqrta; + EXPECT_EQ(last_msg_.toc.tow, 448800) + << "incorrect value for last_msg_.toc.tow, expected 448800, is " + << last_msg_.toc.tow; + EXPECT_EQ(last_msg_.toc.wn, 2154) + << "incorrect value for last_msg_.toc.wn, expected 2154, is " + << last_msg_.toc.wn; + EXPECT_LT((last_msg_.w * 100 - 0.122509120917 * 100), 0.05) + << "incorrect value for last_msg_.w, expected 0.122509120917, is " + << last_msg_.w; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisSbas.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisSbas.cc index 940df5e6f..c49411257 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisSbas.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisSbas.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbas.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbas.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisSbas0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisSbas0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisSbas0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisSbas0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_sbas_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_sbas_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,77 +67,121 @@ class Test_auto_check_sbp_observation_MsgEphemerisSbas0 : sbp_msg_ephemeris_sbas_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisSbas0, Test) -{ - - uint8_t encoded_frame[] = {85,140,0,195,4,74,22,6,176,207,6,0,106,8,0,0,64,177,0,0,0,0,1,0,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,51,208,215,196,215,233,30,197,86,116,89,68,0,0,122,53,0,0,122,53,0,128,59,54,96,139,37,186,0,0,30,45,192,147, }; - - sbp_msg_ephemeris_sbas_t test_msg{}; - test_msg.a_gf0 = -0.0006315018981695175; - test_msg.a_gf1 = 8.981260180007666e-12; - - test_msg.acc[0] = 9.313225746154785e-07; - - test_msg.acc[1] = 9.313225746154785e-07; - - test_msg.acc[2] = 2.7939677238464355e-06; - test_msg.common.fit_interval = 0; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 6; - test_msg.common.sid.sat = 22; - test_msg.common.toe.tow = 446384; - test_msg.common.toe.wn = 2154; - test_msg.common.ura = -2.7939677238464355e-09; - test_msg.common.valid = 1; - - test_msg.pos[0] = -12177330.078125; - - test_msg.pos[1] = 599893.06640625; - - test_msg.pos[2] = -22373708.49609375; - - test_msg.vel[0] = -1726.5062255859375; - - test_msg.vel[1] = -2542.614990234375; - - test_msg.vel[2] = 869.8177490234375; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.a_gf0 * 100 - -0.00063150189817 * 100), 0.05) << "incorrect value for last_msg_.a_gf0, expected -0.00063150189817, is " << last_msg_.a_gf0; - EXPECT_LT((last_msg_.a_gf1 * 100 - 8.98126018001e-12 * 100), 0.05) << "incorrect value for last_msg_.a_gf1, expected 8.98126018001e-12, is " << last_msg_.a_gf1; - EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " << last_msg_.acc[0]; - EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " << last_msg_.acc[1]; - EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " << last_msg_.acc[2]; - EXPECT_EQ(last_msg_.common.fit_interval, 0) << "incorrect value for last_msg_.common.fit_interval, expected 0, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 6) << "incorrect value for last_msg_.common.sid.code, expected 6, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.sat, 22) << "incorrect value for last_msg_.common.sid.sat, expected 22, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toe.tow, 446384) << "incorrect value for last_msg_.common.toe.tow, expected 446384, is " << last_msg_.common.toe.tow; - EXPECT_EQ(last_msg_.common.toe.wn, 2154) << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " << last_msg_.common.toe.wn; - EXPECT_LT((last_msg_.common.ura * 100 - -2.79396772385e-09 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected -2.79396772385e-09, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " << last_msg_.pos[0]; - EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " << last_msg_.pos[1]; - EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " << last_msg_.pos[2]; - EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50622559 * 100), 0.05) << "incorrect value for last_msg_.vel[0], expected -1726.50622559, is " << last_msg_.vel[0]; - EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61499023 * 100), 0.05) << "incorrect value for last_msg_.vel[1], expected -2542.61499023, is " << last_msg_.vel[1]; - EXPECT_LT((last_msg_.vel[2] * 100 - 869.817749023 * 100), 0.05) << "incorrect value for last_msg_.vel[2], expected 869.817749023, is " << last_msg_.vel[2]; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisSbas0, Test) { + uint8_t encoded_frame[] = { + 85, 140, 0, 195, 4, 74, 22, 6, 176, 207, 6, 0, 106, 8, + 0, 0, 64, 177, 0, 0, 0, 0, 1, 0, 0, 0, 128, 66, + 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, 34, 65, 0, 0, + 240, 199, 84, 86, 117, 193, 51, 208, 215, 196, 215, 233, 30, 197, + 86, 116, 89, 68, 0, 0, 122, 53, 0, 0, 122, 53, 0, 128, + 59, 54, 96, 139, 37, 186, 0, 0, 30, 45, 192, 147, + }; + + sbp_msg_ephemeris_sbas_t test_msg{}; + test_msg.a_gf0 = -0.0006315018981695175; + test_msg.a_gf1 = 8.981260180007666e-12; + + test_msg.acc[0] = 9.313225746154785e-07; + + test_msg.acc[1] = 9.313225746154785e-07; + + test_msg.acc[2] = 2.7939677238464355e-06; + test_msg.common.fit_interval = 0; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 6; + test_msg.common.sid.sat = 22; + test_msg.common.toe.tow = 446384; + test_msg.common.toe.wn = 2154; + test_msg.common.ura = -2.7939677238464355e-09; + test_msg.common.valid = 1; + + test_msg.pos[0] = -12177330.078125; + + test_msg.pos[1] = 599893.06640625; + + test_msg.pos[2] = -22373708.49609375; + + test_msg.vel[0] = -1726.5062255859375; + + test_msg.vel[1] = -2542.614990234375; + + test_msg.vel[2] = 869.8177490234375; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.a_gf0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for last_msg_.a_gf0, expected -0.00063150189817, is " + << last_msg_.a_gf0; + EXPECT_LT((last_msg_.a_gf1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for last_msg_.a_gf1, expected 8.98126018001e-12, is " + << last_msg_.a_gf1; + EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " + << last_msg_.acc[0]; + EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " + << last_msg_.acc[1]; + EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " + << last_msg_.acc[2]; + EXPECT_EQ(last_msg_.common.fit_interval, 0) + << "incorrect value for last_msg_.common.fit_interval, expected 0, is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 6) + << "incorrect value for last_msg_.common.sid.code, expected 6, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.sat, 22) + << "incorrect value for last_msg_.common.sid.sat, expected 22, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toe.tow, 446384) + << "incorrect value for last_msg_.common.toe.tow, expected 446384, is " + << last_msg_.common.toe.tow; + EXPECT_EQ(last_msg_.common.toe.wn, 2154) + << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " + << last_msg_.common.toe.wn; + EXPECT_LT((last_msg_.common.ura * 100 - -2.79396772385e-09 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected " + "-2.79396772385e-09, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " + << last_msg_.pos[0]; + EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " + << last_msg_.pos[1]; + EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " + << last_msg_.pos[2]; + EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50622559 * 100), 0.05) + << "incorrect value for last_msg_.vel[0], expected -1726.50622559, is " + << last_msg_.vel[0]; + EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61499023 * 100), 0.05) + << "incorrect value for last_msg_.vel[1], expected -2542.61499023, is " + << last_msg_.vel[1]; + EXPECT_LT((last_msg_.vel[2] * 100 - 869.817749023 * 100), 0.05) + << "incorrect value for last_msg_.vel[2], expected 869.817749023, is " + << last_msg_.vel[2]; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepA.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepA.cc index 6d8db216d..83fe7f074 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepA.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisSbasDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisSbasDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisSbasDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisSbasDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_sbas_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_sbas_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,79 +67,126 @@ class Test_auto_check_sbp_observation_MsgEphemerisSbasDepA0 : sbp_msg_ephemeris_sbas_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisSbasDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,130,0,123,0,112,22,0,6,0,176,207,6,0,106,8,0,0,0,0,0,0,0,64,0,0,0,0,1,0,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,178,180, }; - - sbp_msg_ephemeris_sbas_dep_a_t test_msg{}; - test_msg.a_gf0 = -0.0006315018981695175; - test_msg.a_gf1 = 8.981260180007666e-12; - - test_msg.acc[0] = 9.313225746154785e-07; - - test_msg.acc[1] = 9.313225746154785e-07; - - test_msg.acc[2] = 2.7939677238464355e-06; - test_msg.common.fit_interval = 0; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 6; - test_msg.common.sid.reserved = 0; - test_msg.common.sid.sat = 22; - test_msg.common.toe.tow = 446384; - test_msg.common.toe.wn = 2154; - test_msg.common.ura = 2.0; - test_msg.common.valid = 1; - - test_msg.pos[0] = -12177330.078125; - - test_msg.pos[1] = 599893.06640625; - - test_msg.pos[2] = -22373708.49609375; - - test_msg.vel[0] = -1726.506233215332; - - test_msg.vel[1] = -2542.6149368286133; - - test_msg.vel[2] = 869.8177337646484; - - EXPECT_EQ(send_message( 123, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.a_gf0 * 100 - -0.00063150189817 * 100), 0.05) << "incorrect value for last_msg_.a_gf0, expected -0.00063150189817, is " << last_msg_.a_gf0; - EXPECT_LT((last_msg_.a_gf1 * 100 - 8.98126018001e-12 * 100), 0.05) << "incorrect value for last_msg_.a_gf1, expected 8.98126018001e-12, is " << last_msg_.a_gf1; - EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " << last_msg_.acc[0]; - EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " << last_msg_.acc[1]; - EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " << last_msg_.acc[2]; - EXPECT_EQ(last_msg_.common.fit_interval, 0) << "incorrect value for last_msg_.common.fit_interval, expected 0, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 6) << "incorrect value for last_msg_.common.sid.code, expected 6, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.reserved, 0) << "incorrect value for last_msg_.common.sid.reserved, expected 0, is " << last_msg_.common.sid.reserved; - EXPECT_EQ(last_msg_.common.sid.sat, 22) << "incorrect value for last_msg_.common.sid.sat, expected 22, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toe.tow, 446384) << "incorrect value for last_msg_.common.toe.tow, expected 446384, is " << last_msg_.common.toe.tow; - EXPECT_EQ(last_msg_.common.toe.wn, 2154) << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " << last_msg_.common.toe.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 2.0, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " << last_msg_.pos[0]; - EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " << last_msg_.pos[1]; - EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " << last_msg_.pos[2]; - EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50623322 * 100), 0.05) << "incorrect value for last_msg_.vel[0], expected -1726.50623322, is " << last_msg_.vel[0]; - EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61493683 * 100), 0.05) << "incorrect value for last_msg_.vel[1], expected -2542.61493683, is " << last_msg_.vel[1]; - EXPECT_LT((last_msg_.vel[2] * 100 - 869.817733765 * 100), 0.05) << "incorrect value for last_msg_.vel[2], expected 869.817733765, is " << last_msg_.vel[2]; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisSbasDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 130, 0, 123, 0, 112, 22, 0, 6, 0, 176, 207, 6, 0, 106, + 8, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 1, 0, + 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, 34, + 65, 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, 0, 98, 6, 250, + 154, 192, 0, 0, 0, 217, 58, 221, 163, 192, 0, 0, 0, 184, 138, + 46, 139, 64, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, + 0, 64, 175, 62, 0, 0, 0, 0, 0, 112, 199, 62, 0, 0, 0, + 0, 108, 177, 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 178, 180, + }; + + sbp_msg_ephemeris_sbas_dep_a_t test_msg{}; + test_msg.a_gf0 = -0.0006315018981695175; + test_msg.a_gf1 = 8.981260180007666e-12; + + test_msg.acc[0] = 9.313225746154785e-07; + + test_msg.acc[1] = 9.313225746154785e-07; + + test_msg.acc[2] = 2.7939677238464355e-06; + test_msg.common.fit_interval = 0; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 6; + test_msg.common.sid.reserved = 0; + test_msg.common.sid.sat = 22; + test_msg.common.toe.tow = 446384; + test_msg.common.toe.wn = 2154; + test_msg.common.ura = 2.0; + test_msg.common.valid = 1; + + test_msg.pos[0] = -12177330.078125; + + test_msg.pos[1] = 599893.06640625; + + test_msg.pos[2] = -22373708.49609375; + + test_msg.vel[0] = -1726.506233215332; + + test_msg.vel[1] = -2542.6149368286133; + + test_msg.vel[2] = 869.8177337646484; + + EXPECT_EQ(send_message(123, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.a_gf0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for last_msg_.a_gf0, expected -0.00063150189817, is " + << last_msg_.a_gf0; + EXPECT_LT((last_msg_.a_gf1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for last_msg_.a_gf1, expected 8.98126018001e-12, is " + << last_msg_.a_gf1; + EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " + << last_msg_.acc[0]; + EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " + << last_msg_.acc[1]; + EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " + << last_msg_.acc[2]; + EXPECT_EQ(last_msg_.common.fit_interval, 0) + << "incorrect value for last_msg_.common.fit_interval, expected 0, is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 6) + << "incorrect value for last_msg_.common.sid.code, expected 6, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.reserved, 0) + << "incorrect value for last_msg_.common.sid.reserved, expected 0, is " + << last_msg_.common.sid.reserved; + EXPECT_EQ(last_msg_.common.sid.sat, 22) + << "incorrect value for last_msg_.common.sid.sat, expected 22, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toe.tow, 446384) + << "incorrect value for last_msg_.common.toe.tow, expected 446384, is " + << last_msg_.common.toe.tow; + EXPECT_EQ(last_msg_.common.toe.wn, 2154) + << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " + << last_msg_.common.toe.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 2.0, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " + << last_msg_.pos[0]; + EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " + << last_msg_.pos[1]; + EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " + << last_msg_.pos[2]; + EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50623322 * 100), 0.05) + << "incorrect value for last_msg_.vel[0], expected -1726.50623322, is " + << last_msg_.vel[0]; + EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61493683 * 100), 0.05) + << "incorrect value for last_msg_.vel[1], expected -2542.61493683, is " + << last_msg_.vel[1]; + EXPECT_LT((last_msg_.vel[2] * 100 - 869.817733765 * 100), 0.05) + << "incorrect value for last_msg_.vel[2], expected 869.817733765, is " + << last_msg_.vel[2]; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepB.cc b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepB.cc index 643985793..f096bfb24 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepB.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepB.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepB.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgEphemerisSbasDepB0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgEphemerisSbasDepB0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgEphemerisSbasDepB0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgEphemerisSbasDepB0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_sbas_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_sbas_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,77 +67,122 @@ class Test_auto_check_sbp_observation_MsgEphemerisSbasDepB0 : sbp_msg_ephemeris_sbas_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgEphemerisSbasDepB0, Test) -{ - - uint8_t encoded_frame[] = {85,132,0,123,0,110,22,6,176,207,6,0,106,8,0,0,0,0,0,0,0,64,0,0,0,0,1,0,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,145,104, }; - - sbp_msg_ephemeris_sbas_dep_b_t test_msg{}; - test_msg.a_gf0 = -0.0006315018981695175; - test_msg.a_gf1 = 8.981260180007666e-12; - - test_msg.acc[0] = 9.313225746154785e-07; - - test_msg.acc[1] = 9.313225746154785e-07; - - test_msg.acc[2] = 2.7939677238464355e-06; - test_msg.common.fit_interval = 0; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 6; - test_msg.common.sid.sat = 22; - test_msg.common.toe.tow = 446384; - test_msg.common.toe.wn = 2154; - test_msg.common.ura = 2.0; - test_msg.common.valid = 1; - - test_msg.pos[0] = -12177330.078125; - - test_msg.pos[1] = 599893.06640625; - - test_msg.pos[2] = -22373708.49609375; - - test_msg.vel[0] = -1726.506233215332; - - test_msg.vel[1] = -2542.6149368286133; - - test_msg.vel[2] = 869.8177337646484; - - EXPECT_EQ(send_message( 123, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.a_gf0 * 100 - -0.00063150189817 * 100), 0.05) << "incorrect value for last_msg_.a_gf0, expected -0.00063150189817, is " << last_msg_.a_gf0; - EXPECT_LT((last_msg_.a_gf1 * 100 - 8.98126018001e-12 * 100), 0.05) << "incorrect value for last_msg_.a_gf1, expected 8.98126018001e-12, is " << last_msg_.a_gf1; - EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " << last_msg_.acc[0]; - EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " << last_msg_.acc[1]; - EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " << last_msg_.acc[2]; - EXPECT_EQ(last_msg_.common.fit_interval, 0) << "incorrect value for last_msg_.common.fit_interval, expected 0, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 6) << "incorrect value for last_msg_.common.sid.code, expected 6, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.sat, 22) << "incorrect value for last_msg_.common.sid.sat, expected 22, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toe.tow, 446384) << "incorrect value for last_msg_.common.toe.tow, expected 446384, is " << last_msg_.common.toe.tow; - EXPECT_EQ(last_msg_.common.toe.wn, 2154) << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " << last_msg_.common.toe.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 2.0, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 1) << "incorrect value for last_msg_.common.valid, expected 1, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " << last_msg_.pos[0]; - EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " << last_msg_.pos[1]; - EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " << last_msg_.pos[2]; - EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50623322 * 100), 0.05) << "incorrect value for last_msg_.vel[0], expected -1726.50623322, is " << last_msg_.vel[0]; - EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61493683 * 100), 0.05) << "incorrect value for last_msg_.vel[1], expected -2542.61493683, is " << last_msg_.vel[1]; - EXPECT_LT((last_msg_.vel[2] * 100 - 869.817733765 * 100), 0.05) << "incorrect value for last_msg_.vel[2], expected 869.817733765, is " << last_msg_.vel[2]; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgEphemerisSbasDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 132, 0, 123, 0, 110, 22, 6, 176, 207, 6, 0, 106, 8, 0, + 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 1, 0, 0, 0, + 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, 34, 65, 0, + 0, 240, 199, 84, 86, 117, 193, 0, 0, 0, 98, 6, 250, 154, 192, + 0, 0, 0, 217, 58, 221, 163, 192, 0, 0, 0, 184, 138, 46, 139, + 64, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, 0, 64, + 175, 62, 0, 0, 0, 0, 0, 112, 199, 62, 0, 0, 0, 0, 108, + 177, 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 145, 104, + }; + + sbp_msg_ephemeris_sbas_dep_b_t test_msg{}; + test_msg.a_gf0 = -0.0006315018981695175; + test_msg.a_gf1 = 8.981260180007666e-12; + + test_msg.acc[0] = 9.313225746154785e-07; + + test_msg.acc[1] = 9.313225746154785e-07; + + test_msg.acc[2] = 2.7939677238464355e-06; + test_msg.common.fit_interval = 0; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 6; + test_msg.common.sid.sat = 22; + test_msg.common.toe.tow = 446384; + test_msg.common.toe.wn = 2154; + test_msg.common.ura = 2.0; + test_msg.common.valid = 1; + + test_msg.pos[0] = -12177330.078125; + + test_msg.pos[1] = 599893.06640625; + + test_msg.pos[2] = -22373708.49609375; + + test_msg.vel[0] = -1726.506233215332; + + test_msg.vel[1] = -2542.6149368286133; + + test_msg.vel[2] = 869.8177337646484; + + EXPECT_EQ(send_message(123, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.a_gf0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for last_msg_.a_gf0, expected -0.00063150189817, is " + << last_msg_.a_gf0; + EXPECT_LT((last_msg_.a_gf1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for last_msg_.a_gf1, expected 8.98126018001e-12, is " + << last_msg_.a_gf1; + EXPECT_LT((last_msg_.acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[0], expected 9.31322574615e-07, is " + << last_msg_.acc[0]; + EXPECT_LT((last_msg_.acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for last_msg_.acc[1], expected 9.31322574615e-07, is " + << last_msg_.acc[1]; + EXPECT_LT((last_msg_.acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for last_msg_.acc[2], expected 2.79396772385e-06, is " + << last_msg_.acc[2]; + EXPECT_EQ(last_msg_.common.fit_interval, 0) + << "incorrect value for last_msg_.common.fit_interval, expected 0, is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 6) + << "incorrect value for last_msg_.common.sid.code, expected 6, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.sat, 22) + << "incorrect value for last_msg_.common.sid.sat, expected 22, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toe.tow, 446384) + << "incorrect value for last_msg_.common.toe.tow, expected 446384, is " + << last_msg_.common.toe.tow; + EXPECT_EQ(last_msg_.common.toe.wn, 2154) + << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " + << last_msg_.common.toe.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 2.0, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 1) + << "incorrect value for last_msg_.common.valid, expected 1, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for last_msg_.pos[0], expected -12177330.0781, is " + << last_msg_.pos[0]; + EXPECT_LT((last_msg_.pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for last_msg_.pos[1], expected 599893.066406, is " + << last_msg_.pos[1]; + EXPECT_LT((last_msg_.pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for last_msg_.pos[2], expected -22373708.4961, is " + << last_msg_.pos[2]; + EXPECT_LT((last_msg_.vel[0] * 100 - -1726.50623322 * 100), 0.05) + << "incorrect value for last_msg_.vel[0], expected -1726.50623322, is " + << last_msg_.vel[0]; + EXPECT_LT((last_msg_.vel[1] * 100 - -2542.61493683 * 100), 0.05) + << "incorrect value for last_msg_.vel[1], expected -2542.61493683, is " + << last_msg_.vel[1]; + EXPECT_LT((last_msg_.vel[2] * 100 - 869.817733765 * 100), 0.05) + << "incorrect value for last_msg_.vel[2], expected 869.817733765, is " + << last_msg_.vel[2]; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgGloBiases.cc b/c/test/cpp/auto_check_sbp_observation_MsgGloBiases.cc index 91b7315a7..7f21221b3 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgGloBiases.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgGloBiases.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGloBiases.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGloBiases.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgGloBiases0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgGloBiases0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgGloBiases0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgGloBiases0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_glo_biases_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_glo_biases_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,40 +67,50 @@ class Test_auto_check_sbp_observation_MsgGloBiases0 : sbp_msg_glo_biases_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgGloBiases0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgGloBiases0, Test) { + uint8_t encoded_frame[] = { + 85, 117, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 211, + }; - uint8_t encoded_frame[] = {85,117,0,0,0,9,0,0,0,0,0,0,0,0,0,77,211, }; + sbp_msg_glo_biases_t test_msg{}; + test_msg.l1ca_bias = 0; + test_msg.l1p_bias = 0; + test_msg.l2ca_bias = 0; + test_msg.l2p_bias = 0; + test_msg.mask = 0; - sbp_msg_glo_biases_t test_msg{}; - test_msg.l1ca_bias = 0; - test_msg.l1p_bias = 0; - test_msg.l2ca_bias = 0; - test_msg.l2p_bias = 0; - test_msg.mask = 0; - - EXPECT_EQ(send_message( 0, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(0, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.l1ca_bias, 0) << "incorrect value for last_msg_.l1ca_bias, expected 0, is " << last_msg_.l1ca_bias; - EXPECT_EQ(last_msg_.l1p_bias, 0) << "incorrect value for last_msg_.l1p_bias, expected 0, is " << last_msg_.l1p_bias; - EXPECT_EQ(last_msg_.l2ca_bias, 0) << "incorrect value for last_msg_.l2ca_bias, expected 0, is " << last_msg_.l2ca_bias; - EXPECT_EQ(last_msg_.l2p_bias, 0) << "incorrect value for last_msg_.l2p_bias, expected 0, is " << last_msg_.l2p_bias; - EXPECT_EQ(last_msg_.mask, 0) << "incorrect value for last_msg_.mask, expected 0, is " << last_msg_.mask; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.l1ca_bias, 0) + << "incorrect value for last_msg_.l1ca_bias, expected 0, is " + << last_msg_.l1ca_bias; + EXPECT_EQ(last_msg_.l1p_bias, 0) + << "incorrect value for last_msg_.l1p_bias, expected 0, is " + << last_msg_.l1p_bias; + EXPECT_EQ(last_msg_.l2ca_bias, 0) + << "incorrect value for last_msg_.l2ca_bias, expected 0, is " + << last_msg_.l2ca_bias; + EXPECT_EQ(last_msg_.l2p_bias, 0) + << "incorrect value for last_msg_.l2p_bias, expected 0, is " + << last_msg_.l2p_bias; + EXPECT_EQ(last_msg_.mask, 0) + << "incorrect value for last_msg_.mask, expected 0, is " + << last_msg_.mask; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgGnssCapb.cc b/c/test/cpp/auto_check_sbp_observation_MsgGnssCapb.cc index 806cb5ff7..f5a36a550 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgGnssCapb.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgGnssCapb.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGnssCapb.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGnssCapb.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgGnssCapb0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgGnssCapb0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgGnssCapb0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgGnssCapb0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gnss_capb_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gnss_capb_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,64 +67,105 @@ class Test_auto_check_sbp_observation_MsgGnssCapb0 : sbp_msg_gnss_capb_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgGnssCapb0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgGnssCapb0, Test) { + uint8_t encoded_frame[] = { + 85, 150, 0, 123, 0, 110, 176, 207, 6, 0, 106, 8, 26, 171, 80, + 64, 0, 0, 0, 0, 81, 173, 144, 46, 0, 0, 0, 0, 209, 139, + 93, 108, 0, 0, 0, 0, 252, 204, 200, 0, 205, 92, 30, 49, 240, + 203, 21, 24, 212, 93, 182, 32, 0, 0, 0, 0, 105, 32, 192, 27, + 0, 0, 0, 0, 40, 75, 250, 114, 0, 0, 0, 0, 119, 147, 123, + 81, 0, 0, 0, 0, 85, 89, 4, 2, 0, 0, 0, 0, 233, 116, + 137, 22, 0, 0, 0, 0, 199, 109, 219, 11, 221, 171, 248, 82, 0, + 0, 0, 0, 252, 62, 221, 28, 0, 0, 0, 0, 163, 90, + }; - uint8_t encoded_frame[] = {85,150,0,123,0,110,176,207,6,0,106,8,26,171,80,64,0,0,0,0,81,173,144,46,0,0,0,0,209,139,93,108,0,0,0,0,252,204,200,0,205,92,30,49,240,203,21,24,212,93,182,32,0,0,0,0,105,32,192,27,0,0,0,0,40,75,250,114,0,0,0,0,119,147,123,81,0,0,0,0,85,89,4,2,0,0,0,0,233,116,137,22,0,0,0,0,199,109,219,11,221,171,248,82,0,0,0,0,252,62,221,28,0,0,0,0,163,90, }; + sbp_msg_gnss_capb_t test_msg{}; + test_msg.gc.bds_active = 1929005864; + test_msg.gc.bds_b2 = 33839445; + test_msg.gc.bds_b2a = 378107113; + test_msg.gc.bds_d2nav = 1367053175; + test_msg.gc.gal_active = 1392028637; + test_msg.gc.gal_e5 = 484261628; + test_msg.gc.glo_active = 13159676; + test_msg.gc.glo_l2of = 824073421; + test_msg.gc.glo_l3 = 404081648; + test_msg.gc.gps_active = 1079028506; + test_msg.gc.gps_l2c = 781233489; + test_msg.gc.gps_l5 = 1818069969; + test_msg.gc.qzss_active = 198929863; + test_msg.gc.sbas_active = 548822484; + test_msg.gc.sbas_l5 = 465576041; + test_msg.t_nmct.tow = 446384; + test_msg.t_nmct.wn = 2154; - sbp_msg_gnss_capb_t test_msg{}; - test_msg.gc.bds_active = 1929005864; - test_msg.gc.bds_b2 = 33839445; - test_msg.gc.bds_b2a = 378107113; - test_msg.gc.bds_d2nav = 1367053175; - test_msg.gc.gal_active = 1392028637; - test_msg.gc.gal_e5 = 484261628; - test_msg.gc.glo_active = 13159676; - test_msg.gc.glo_l2of = 824073421; - test_msg.gc.glo_l3 = 404081648; - test_msg.gc.gps_active = 1079028506; - test_msg.gc.gps_l2c = 781233489; - test_msg.gc.gps_l5 = 1818069969; - test_msg.gc.qzss_active = 198929863; - test_msg.gc.sbas_active = 548822484; - test_msg.gc.sbas_l5 = 465576041; - test_msg.t_nmct.tow = 446384; - test_msg.t_nmct.wn = 2154; - - EXPECT_EQ(send_message( 123, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(123, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.gc.bds_active, 1929005864) << "incorrect value for last_msg_.gc.bds_active, expected 1929005864, is " << last_msg_.gc.bds_active; - EXPECT_EQ(last_msg_.gc.bds_b2, 33839445) << "incorrect value for last_msg_.gc.bds_b2, expected 33839445, is " << last_msg_.gc.bds_b2; - EXPECT_EQ(last_msg_.gc.bds_b2a, 378107113) << "incorrect value for last_msg_.gc.bds_b2a, expected 378107113, is " << last_msg_.gc.bds_b2a; - EXPECT_EQ(last_msg_.gc.bds_d2nav, 1367053175) << "incorrect value for last_msg_.gc.bds_d2nav, expected 1367053175, is " << last_msg_.gc.bds_d2nav; - EXPECT_EQ(last_msg_.gc.gal_active, 1392028637) << "incorrect value for last_msg_.gc.gal_active, expected 1392028637, is " << last_msg_.gc.gal_active; - EXPECT_EQ(last_msg_.gc.gal_e5, 484261628) << "incorrect value for last_msg_.gc.gal_e5, expected 484261628, is " << last_msg_.gc.gal_e5; - EXPECT_EQ(last_msg_.gc.glo_active, 13159676) << "incorrect value for last_msg_.gc.glo_active, expected 13159676, is " << last_msg_.gc.glo_active; - EXPECT_EQ(last_msg_.gc.glo_l2of, 824073421) << "incorrect value for last_msg_.gc.glo_l2of, expected 824073421, is " << last_msg_.gc.glo_l2of; - EXPECT_EQ(last_msg_.gc.glo_l3, 404081648) << "incorrect value for last_msg_.gc.glo_l3, expected 404081648, is " << last_msg_.gc.glo_l3; - EXPECT_EQ(last_msg_.gc.gps_active, 1079028506) << "incorrect value for last_msg_.gc.gps_active, expected 1079028506, is " << last_msg_.gc.gps_active; - EXPECT_EQ(last_msg_.gc.gps_l2c, 781233489) << "incorrect value for last_msg_.gc.gps_l2c, expected 781233489, is " << last_msg_.gc.gps_l2c; - EXPECT_EQ(last_msg_.gc.gps_l5, 1818069969) << "incorrect value for last_msg_.gc.gps_l5, expected 1818069969, is " << last_msg_.gc.gps_l5; - EXPECT_EQ(last_msg_.gc.qzss_active, 198929863) << "incorrect value for last_msg_.gc.qzss_active, expected 198929863, is " << last_msg_.gc.qzss_active; - EXPECT_EQ(last_msg_.gc.sbas_active, 548822484) << "incorrect value for last_msg_.gc.sbas_active, expected 548822484, is " << last_msg_.gc.sbas_active; - EXPECT_EQ(last_msg_.gc.sbas_l5, 465576041) << "incorrect value for last_msg_.gc.sbas_l5, expected 465576041, is " << last_msg_.gc.sbas_l5; - EXPECT_EQ(last_msg_.t_nmct.tow, 446384) << "incorrect value for last_msg_.t_nmct.tow, expected 446384, is " << last_msg_.t_nmct.tow; - EXPECT_EQ(last_msg_.t_nmct.wn, 2154) << "incorrect value for last_msg_.t_nmct.wn, expected 2154, is " << last_msg_.t_nmct.wn; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.gc.bds_active, 1929005864) + << "incorrect value for last_msg_.gc.bds_active, expected 1929005864, is " + << last_msg_.gc.bds_active; + EXPECT_EQ(last_msg_.gc.bds_b2, 33839445) + << "incorrect value for last_msg_.gc.bds_b2, expected 33839445, is " + << last_msg_.gc.bds_b2; + EXPECT_EQ(last_msg_.gc.bds_b2a, 378107113) + << "incorrect value for last_msg_.gc.bds_b2a, expected 378107113, is " + << last_msg_.gc.bds_b2a; + EXPECT_EQ(last_msg_.gc.bds_d2nav, 1367053175) + << "incorrect value for last_msg_.gc.bds_d2nav, expected 1367053175, is " + << last_msg_.gc.bds_d2nav; + EXPECT_EQ(last_msg_.gc.gal_active, 1392028637) + << "incorrect value for last_msg_.gc.gal_active, expected 1392028637, is " + << last_msg_.gc.gal_active; + EXPECT_EQ(last_msg_.gc.gal_e5, 484261628) + << "incorrect value for last_msg_.gc.gal_e5, expected 484261628, is " + << last_msg_.gc.gal_e5; + EXPECT_EQ(last_msg_.gc.glo_active, 13159676) + << "incorrect value for last_msg_.gc.glo_active, expected 13159676, is " + << last_msg_.gc.glo_active; + EXPECT_EQ(last_msg_.gc.glo_l2of, 824073421) + << "incorrect value for last_msg_.gc.glo_l2of, expected 824073421, is " + << last_msg_.gc.glo_l2of; + EXPECT_EQ(last_msg_.gc.glo_l3, 404081648) + << "incorrect value for last_msg_.gc.glo_l3, expected 404081648, is " + << last_msg_.gc.glo_l3; + EXPECT_EQ(last_msg_.gc.gps_active, 1079028506) + << "incorrect value for last_msg_.gc.gps_active, expected 1079028506, is " + << last_msg_.gc.gps_active; + EXPECT_EQ(last_msg_.gc.gps_l2c, 781233489) + << "incorrect value for last_msg_.gc.gps_l2c, expected 781233489, is " + << last_msg_.gc.gps_l2c; + EXPECT_EQ(last_msg_.gc.gps_l5, 1818069969) + << "incorrect value for last_msg_.gc.gps_l5, expected 1818069969, is " + << last_msg_.gc.gps_l5; + EXPECT_EQ(last_msg_.gc.qzss_active, 198929863) + << "incorrect value for last_msg_.gc.qzss_active, expected 198929863, is " + << last_msg_.gc.qzss_active; + EXPECT_EQ(last_msg_.gc.sbas_active, 548822484) + << "incorrect value for last_msg_.gc.sbas_active, expected 548822484, is " + << last_msg_.gc.sbas_active; + EXPECT_EQ(last_msg_.gc.sbas_l5, 465576041) + << "incorrect value for last_msg_.gc.sbas_l5, expected 465576041, is " + << last_msg_.gc.sbas_l5; + EXPECT_EQ(last_msg_.t_nmct.tow, 446384) + << "incorrect value for last_msg_.t_nmct.tow, expected 446384, is " + << last_msg_.t_nmct.tow; + EXPECT_EQ(last_msg_.t_nmct.wn, 2154) + << "incorrect value for last_msg_.t_nmct.wn, expected 2154, is " + << last_msg_.t_nmct.wn; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgGroupDelay.cc b/c/test/cpp/auto_check_sbp_observation_MsgGroupDelay.cc index 12ed9527e..99efba200 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgGroupDelay.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgGroupDelay.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelay.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelay.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgGroupDelay0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgGroupDelay0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgGroupDelay0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgGroupDelay0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_group_delay_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_group_delay_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,46 +67,63 @@ class Test_auto_check_sbp_observation_MsgGroupDelay0 : sbp_msg_group_delay_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgGroupDelay0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgGroupDelay0, Test) { + uint8_t encoded_frame[] = { + 85, 148, 0, 123, 0, 15, 176, 207, 6, 0, 106, 8, + 22, 0, 1, 254, 253, 165, 255, 237, 23, 2, 201, + }; - uint8_t encoded_frame[] = {85,148,0,123,0,15,176,207,6,0,106,8,22,0,1,254,253,165,255,237,23,2,201, }; + sbp_msg_group_delay_t test_msg{}; + test_msg.isc_l1ca = -91; + test_msg.isc_l2c = 6125; + test_msg.sid.code = 0; + test_msg.sid.sat = 22; + test_msg.t_op.tow = 446384; + test_msg.t_op.wn = 2154; + test_msg.tgd = -514; + test_msg.valid = 1; - sbp_msg_group_delay_t test_msg{}; - test_msg.isc_l1ca = -91; - test_msg.isc_l2c = 6125; - test_msg.sid.code = 0; - test_msg.sid.sat = 22; - test_msg.t_op.tow = 446384; - test_msg.t_op.wn = 2154; - test_msg.tgd = -514; - test_msg.valid = 1; - - EXPECT_EQ(send_message( 123, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(123, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.isc_l1ca, -91) << "incorrect value for last_msg_.isc_l1ca, expected -91, is " << last_msg_.isc_l1ca; - EXPECT_EQ(last_msg_.isc_l2c, 6125) << "incorrect value for last_msg_.isc_l2c, expected 6125, is " << last_msg_.isc_l2c; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.sat, 22) << "incorrect value for last_msg_.sid.sat, expected 22, is " << last_msg_.sid.sat; - EXPECT_EQ(last_msg_.t_op.tow, 446384) << "incorrect value for last_msg_.t_op.tow, expected 446384, is " << last_msg_.t_op.tow; - EXPECT_EQ(last_msg_.t_op.wn, 2154) << "incorrect value for last_msg_.t_op.wn, expected 2154, is " << last_msg_.t_op.wn; - EXPECT_EQ(last_msg_.tgd, -514) << "incorrect value for last_msg_.tgd, expected -514, is " << last_msg_.tgd; - EXPECT_EQ(last_msg_.valid, 1) << "incorrect value for last_msg_.valid, expected 1, is " << last_msg_.valid; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.isc_l1ca, -91) + << "incorrect value for last_msg_.isc_l1ca, expected -91, is " + << last_msg_.isc_l1ca; + EXPECT_EQ(last_msg_.isc_l2c, 6125) + << "incorrect value for last_msg_.isc_l2c, expected 6125, is " + << last_msg_.isc_l2c; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.sat, 22) + << "incorrect value for last_msg_.sid.sat, expected 22, is " + << last_msg_.sid.sat; + EXPECT_EQ(last_msg_.t_op.tow, 446384) + << "incorrect value for last_msg_.t_op.tow, expected 446384, is " + << last_msg_.t_op.tow; + EXPECT_EQ(last_msg_.t_op.wn, 2154) + << "incorrect value for last_msg_.t_op.wn, expected 2154, is " + << last_msg_.t_op.wn; + EXPECT_EQ(last_msg_.tgd, -514) + << "incorrect value for last_msg_.tgd, expected -514, is " + << last_msg_.tgd; + EXPECT_EQ(last_msg_.valid, 1) + << "incorrect value for last_msg_.valid, expected 1, is " + << last_msg_.valid; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgGroupDelayDepA.cc b/c/test/cpp/auto_check_sbp_observation_MsgGroupDelayDepA.cc index 2d561cfcb..94b84985b 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgGroupDelayDepA.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgGroupDelayDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgGroupDelayDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgGroupDelayDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgGroupDelayDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgGroupDelayDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_group_delay_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_group_delay_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,44 +67,58 @@ class Test_auto_check_sbp_observation_MsgGroupDelayDepA0 : sbp_msg_group_delay_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgGroupDelayDepA0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgGroupDelayDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 146, 0, 123, 0, 14, 176, 207, 6, 0, 106, + 8, 22, 1, 254, 253, 165, 255, 237, 23, 162, 91, + }; - uint8_t encoded_frame[] = {85,146,0,123,0,14,176,207,6,0,106,8,22,1,254,253,165,255,237,23,162,91, }; + sbp_msg_group_delay_dep_a_t test_msg{}; + test_msg.isc_l1ca = -91; + test_msg.isc_l2c = 6125; + test_msg.prn = 22; + test_msg.t_op.tow = 446384; + test_msg.t_op.wn = 2154; + test_msg.tgd = -514; + test_msg.valid = 1; - sbp_msg_group_delay_dep_a_t test_msg{}; - test_msg.isc_l1ca = -91; - test_msg.isc_l2c = 6125; - test_msg.prn = 22; - test_msg.t_op.tow = 446384; - test_msg.t_op.wn = 2154; - test_msg.tgd = -514; - test_msg.valid = 1; - - EXPECT_EQ(send_message( 123, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(123, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.isc_l1ca, -91) << "incorrect value for last_msg_.isc_l1ca, expected -91, is " << last_msg_.isc_l1ca; - EXPECT_EQ(last_msg_.isc_l2c, 6125) << "incorrect value for last_msg_.isc_l2c, expected 6125, is " << last_msg_.isc_l2c; - EXPECT_EQ(last_msg_.prn, 22) << "incorrect value for last_msg_.prn, expected 22, is " << last_msg_.prn; - EXPECT_EQ(last_msg_.t_op.tow, 446384) << "incorrect value for last_msg_.t_op.tow, expected 446384, is " << last_msg_.t_op.tow; - EXPECT_EQ(last_msg_.t_op.wn, 2154) << "incorrect value for last_msg_.t_op.wn, expected 2154, is " << last_msg_.t_op.wn; - EXPECT_EQ(last_msg_.tgd, -514) << "incorrect value for last_msg_.tgd, expected -514, is " << last_msg_.tgd; - EXPECT_EQ(last_msg_.valid, 1) << "incorrect value for last_msg_.valid, expected 1, is " << last_msg_.valid; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.isc_l1ca, -91) + << "incorrect value for last_msg_.isc_l1ca, expected -91, is " + << last_msg_.isc_l1ca; + EXPECT_EQ(last_msg_.isc_l2c, 6125) + << "incorrect value for last_msg_.isc_l2c, expected 6125, is " + << last_msg_.isc_l2c; + EXPECT_EQ(last_msg_.prn, 22) + << "incorrect value for last_msg_.prn, expected 22, is " << last_msg_.prn; + EXPECT_EQ(last_msg_.t_op.tow, 446384) + << "incorrect value for last_msg_.t_op.tow, expected 446384, is " + << last_msg_.t_op.tow; + EXPECT_EQ(last_msg_.t_op.wn, 2154) + << "incorrect value for last_msg_.t_op.wn, expected 2154, is " + << last_msg_.t_op.wn; + EXPECT_EQ(last_msg_.tgd, -514) + << "incorrect value for last_msg_.tgd, expected -514, is " + << last_msg_.tgd; + EXPECT_EQ(last_msg_.valid, 1) + << "incorrect value for last_msg_.valid, expected 1, is " + << last_msg_.valid; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgGroupDelayDepB.cc b/c/test/cpp/auto_check_sbp_observation_MsgGroupDelayDepB.cc index a43502842..9bea07ffd 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgGroupDelayDepB.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgGroupDelayDepB.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepB.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgGroupDelayDepB0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgGroupDelayDepB0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgGroupDelayDepB0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgGroupDelayDepB0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_group_delay_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_group_delay_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,48 +67,67 @@ class Test_auto_check_sbp_observation_MsgGroupDelayDepB0 : sbp_msg_group_delay_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgGroupDelayDepB0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgGroupDelayDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 147, 0, 123, 0, 17, 176, 207, 6, 0, 106, 8, 22, + 0, 0, 0, 1, 254, 253, 165, 255, 237, 23, 221, 202, + }; - uint8_t encoded_frame[] = {85,147,0,123,0,17,176,207,6,0,106,8,22,0,0,0,1,254,253,165,255,237,23,221,202, }; + sbp_msg_group_delay_dep_b_t test_msg{}; + test_msg.isc_l1ca = -91; + test_msg.isc_l2c = 6125; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 22; + test_msg.t_op.tow = 446384; + test_msg.t_op.wn = 2154; + test_msg.tgd = -514; + test_msg.valid = 1; - sbp_msg_group_delay_dep_b_t test_msg{}; - test_msg.isc_l1ca = -91; - test_msg.isc_l2c = 6125; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 22; - test_msg.t_op.tow = 446384; - test_msg.t_op.wn = 2154; - test_msg.tgd = -514; - test_msg.valid = 1; - - EXPECT_EQ(send_message( 123, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(123, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.isc_l1ca, -91) << "incorrect value for last_msg_.isc_l1ca, expected -91, is " << last_msg_.isc_l1ca; - EXPECT_EQ(last_msg_.isc_l2c, 6125) << "incorrect value for last_msg_.isc_l2c, expected 6125, is " << last_msg_.isc_l2c; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 22) << "incorrect value for last_msg_.sid.sat, expected 22, is " << last_msg_.sid.sat; - EXPECT_EQ(last_msg_.t_op.tow, 446384) << "incorrect value for last_msg_.t_op.tow, expected 446384, is " << last_msg_.t_op.tow; - EXPECT_EQ(last_msg_.t_op.wn, 2154) << "incorrect value for last_msg_.t_op.wn, expected 2154, is " << last_msg_.t_op.wn; - EXPECT_EQ(last_msg_.tgd, -514) << "incorrect value for last_msg_.tgd, expected -514, is " << last_msg_.tgd; - EXPECT_EQ(last_msg_.valid, 1) << "incorrect value for last_msg_.valid, expected 1, is " << last_msg_.valid; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.isc_l1ca, -91) + << "incorrect value for last_msg_.isc_l1ca, expected -91, is " + << last_msg_.isc_l1ca; + EXPECT_EQ(last_msg_.isc_l2c, 6125) + << "incorrect value for last_msg_.isc_l2c, expected 6125, is " + << last_msg_.isc_l2c; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 22) + << "incorrect value for last_msg_.sid.sat, expected 22, is " + << last_msg_.sid.sat; + EXPECT_EQ(last_msg_.t_op.tow, 446384) + << "incorrect value for last_msg_.t_op.tow, expected 446384, is " + << last_msg_.t_op.tow; + EXPECT_EQ(last_msg_.t_op.wn, 2154) + << "incorrect value for last_msg_.t_op.wn, expected 2154, is " + << last_msg_.t_op.wn; + EXPECT_EQ(last_msg_.tgd, -514) + << "incorrect value for last_msg_.tgd, expected -514, is " + << last_msg_.tgd; + EXPECT_EQ(last_msg_.valid, 1) + << "incorrect value for last_msg_.valid, expected 1, is " + << last_msg_.valid; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgIono.cc b/c/test/cpp/auto_check_sbp_observation_MsgIono.cc index e72bf7de7..f4dec1826 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgIono.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgIono.cc @@ -10,60 +10,55 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgIono.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgIono.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgIono0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgIono0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgIono0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgIono0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_iono_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, const sbp_msg_iono_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,50 +66,74 @@ class Test_auto_check_sbp_observation_MsgIono0 : sbp_msg_iono_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgIono0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgIono0, Test) { + uint8_t encoded_frame[] = { + 85, 144, 0, 123, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 62, 0, 0, 0, 0, 0, 0, 80, 62, 0, 0, 0, 0, + 0, 0, 112, 190, 0, 0, 0, 0, 0, 0, 112, 190, 0, 0, 0, 0, + 0, 0, 243, 64, 0, 0, 0, 0, 0, 0, 232, 64, 0, 0, 0, 0, + 0, 0, 240, 192, 0, 0, 0, 0, 0, 0, 20, 193, 101, 31, + }; - uint8_t encoded_frame[] = {85,144,0,123,0,70,0,0,0,0,0,0,0,0,0,0,0,0,52,62,0,0,0,0,0,0,80,62,0,0,0,0,0,0,112,190,0,0,0,0,0,0,112,190,0,0,0,0,0,0,243,64,0,0,0,0,0,0,232,64,0,0,0,0,0,0,240,192,0,0,0,0,0,0,20,193,101,31, }; + sbp_msg_iono_t test_msg{}; + test_msg.a0 = 4.6566128730773926e-09; + test_msg.a1 = 1.4901161193847656e-08; + test_msg.a2 = -5.960464477539063e-08; + test_msg.a3 = -5.960464477539063e-08; + test_msg.b0 = 77824.0; + test_msg.b1 = 49152.0; + test_msg.b2 = -65536.0; + test_msg.b3 = -327680.0; + test_msg.t_nmct.tow = 0; + test_msg.t_nmct.wn = 0; - sbp_msg_iono_t test_msg{}; - test_msg.a0 = 4.6566128730773926e-09; - test_msg.a1 = 1.4901161193847656e-08; - test_msg.a2 = -5.960464477539063e-08; - test_msg.a3 = -5.960464477539063e-08; - test_msg.b0 = 77824.0; - test_msg.b1 = 49152.0; - test_msg.b2 = -65536.0; - test_msg.b3 = -327680.0; - test_msg.t_nmct.tow = 0; - test_msg.t_nmct.wn = 0; - - EXPECT_EQ(send_message( 123, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(123, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.a0 * 100 - 4.65661287308e-09 * 100), 0.05) << "incorrect value for last_msg_.a0, expected 4.65661287308e-09, is " << last_msg_.a0; - EXPECT_LT((last_msg_.a1 * 100 - 1.49011611938e-08 * 100), 0.05) << "incorrect value for last_msg_.a1, expected 1.49011611938e-08, is " << last_msg_.a1; - EXPECT_LT((last_msg_.a2 * 100 - -5.96046447754e-08 * 100), 0.05) << "incorrect value for last_msg_.a2, expected -5.96046447754e-08, is " << last_msg_.a2; - EXPECT_LT((last_msg_.a3 * 100 - -5.96046447754e-08 * 100), 0.05) << "incorrect value for last_msg_.a3, expected -5.96046447754e-08, is " << last_msg_.a3; - EXPECT_LT((last_msg_.b0 * 100 - 77824.0 * 100), 0.05) << "incorrect value for last_msg_.b0, expected 77824.0, is " << last_msg_.b0; - EXPECT_LT((last_msg_.b1 * 100 - 49152.0 * 100), 0.05) << "incorrect value for last_msg_.b1, expected 49152.0, is " << last_msg_.b1; - EXPECT_LT((last_msg_.b2 * 100 - -65536.0 * 100), 0.05) << "incorrect value for last_msg_.b2, expected -65536.0, is " << last_msg_.b2; - EXPECT_LT((last_msg_.b3 * 100 - -327680.0 * 100), 0.05) << "incorrect value for last_msg_.b3, expected -327680.0, is " << last_msg_.b3; - EXPECT_EQ(last_msg_.t_nmct.tow, 0) << "incorrect value for last_msg_.t_nmct.tow, expected 0, is " << last_msg_.t_nmct.tow; - EXPECT_EQ(last_msg_.t_nmct.wn, 0) << "incorrect value for last_msg_.t_nmct.wn, expected 0, is " << last_msg_.t_nmct.wn; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.a0 * 100 - 4.65661287308e-09 * 100), 0.05) + << "incorrect value for last_msg_.a0, expected 4.65661287308e-09, is " + << last_msg_.a0; + EXPECT_LT((last_msg_.a1 * 100 - 1.49011611938e-08 * 100), 0.05) + << "incorrect value for last_msg_.a1, expected 1.49011611938e-08, is " + << last_msg_.a1; + EXPECT_LT((last_msg_.a2 * 100 - -5.96046447754e-08 * 100), 0.05) + << "incorrect value for last_msg_.a2, expected -5.96046447754e-08, is " + << last_msg_.a2; + EXPECT_LT((last_msg_.a3 * 100 - -5.96046447754e-08 * 100), 0.05) + << "incorrect value for last_msg_.a3, expected -5.96046447754e-08, is " + << last_msg_.a3; + EXPECT_LT((last_msg_.b0 * 100 - 77824.0 * 100), 0.05) + << "incorrect value for last_msg_.b0, expected 77824.0, is " + << last_msg_.b0; + EXPECT_LT((last_msg_.b1 * 100 - 49152.0 * 100), 0.05) + << "incorrect value for last_msg_.b1, expected 49152.0, is " + << last_msg_.b1; + EXPECT_LT((last_msg_.b2 * 100 - -65536.0 * 100), 0.05) + << "incorrect value for last_msg_.b2, expected -65536.0, is " + << last_msg_.b2; + EXPECT_LT((last_msg_.b3 * 100 - -327680.0 * 100), 0.05) + << "incorrect value for last_msg_.b3, expected -327680.0, is " + << last_msg_.b3; + EXPECT_EQ(last_msg_.t_nmct.tow, 0) + << "incorrect value for last_msg_.t_nmct.tow, expected 0, is " + << last_msg_.t_nmct.tow; + EXPECT_EQ(last_msg_.t_nmct.wn, 0) + << "incorrect value for last_msg_.t_nmct.wn, expected 0, is " + << last_msg_.t_nmct.wn; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgObs.cc b/c/test/cpp/auto_check_sbp_observation_MsgObs.cc index 53f2f0d91..e109452c1 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgObs.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgObs.cc @@ -10,60 +10,55 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgObs.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgObs.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgObs0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgObs0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgObs0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgObs0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,400 +66,712 @@ class Test_auto_check_sbp_observation_MsgObs0 : sbp_msg_obs_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgObs0, Test) -{ - - uint8_t encoded_frame[] = {85,74,0,129,240,249,152,202,226,25,0,0,0,0,106,8,32,49,227,254,62,121,242,158,6,146,0,250,172,182,10,15,10,0,30,228,254,62,12,189,40,5,59,83,251,172,178,10,15,10,1,215,205,144,72,106,111,160,7,243,109,243,119,158,10,15,18,0,25,207,144,72,223,96,241,5,12,52,246,27,125,9,11,18,1,34,184,223,74,150,138,222,7,53,13,11,245,114,9,15,22,0,113,80,6,69,162,41,65,7,70,127,246,246,189,9,15,23,0,247,80,6,69,213,35,167,5,221,152,248,231,158,9,11,23,1,8,146,166,64,12,122,203,6,114,51,248,67,93,3,11,27,0,221,172,173,75,217,47,244,7,232,225,11,237,123,5,15,31,0,250,174,173,75,216,163,50,6,40,70,9,62,120,3,11,31,1,135,16,6,66,99,218,11,7,7,138,242,96,176,10,15,2,3,148,130,6,58,217,88,54,6,203,21,252,96,170,10,15,3,3,186,108,197,63,127,54,211,6,80,4,241,219,200,10,15,17,3,167,195,8,57,19,204,22,6,105,51,254,182,152,10,15,18,3,237,248, }; - - sbp_msg_obs_t test_msg{}; - test_msg.header.n_obs = 32; - test_msg.header.t.ns_residual = 0; - test_msg.header.t.tow = 434293400; - test_msg.header.t.wn = 2154; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 14; - - test_msg.obs[0].D.f = 172; - test_msg.obs[0].D.i = -1536; - test_msg.obs[0].L.f = 146; - test_msg.obs[0].L.i = 111080057; - test_msg.obs[0].P = 1056891697; - test_msg.obs[0].cn0 = 182; - test_msg.obs[0].flags = 15; - test_msg.obs[0].lock = 10; - test_msg.obs[0].sid.code = 0; - test_msg.obs[0].sid.sat = 10; - - test_msg.obs[1].D.f = 172; - test_msg.obs[1].D.i = -1197; - test_msg.obs[1].L.f = 59; - test_msg.obs[1].L.i = 86555916; - test_msg.obs[1].P = 1056891934; - test_msg.obs[1].cn0 = 178; - test_msg.obs[1].flags = 15; - test_msg.obs[1].lock = 10; - test_msg.obs[1].sid.code = 1; - test_msg.obs[1].sid.sat = 10; - - test_msg.obs[2].D.f = 119; - test_msg.obs[2].D.i = -3219; - test_msg.obs[2].L.f = 243; - test_msg.obs[2].L.i = 127954794; - test_msg.obs[2].P = 1217449431; - test_msg.obs[2].cn0 = 158; - test_msg.obs[2].flags = 15; - test_msg.obs[2].lock = 10; - test_msg.obs[2].sid.code = 0; - test_msg.obs[2].sid.sat = 18; - - test_msg.obs[3].D.f = 27; - test_msg.obs[3].D.i = -2508; - test_msg.obs[3].L.f = 12; - test_msg.obs[3].L.i = 99705055; - test_msg.obs[3].P = 1217449753; - test_msg.obs[3].cn0 = 125; - test_msg.obs[3].flags = 11; - test_msg.obs[3].lock = 9; - test_msg.obs[3].sid.code = 1; - test_msg.obs[3].sid.sat = 18; - - test_msg.obs[4].D.f = 245; - test_msg.obs[4].D.i = 2829; - test_msg.obs[4].L.f = 53; - test_msg.obs[4].L.i = 132024982; - test_msg.obs[4].P = 1256175650; - test_msg.obs[4].cn0 = 114; - test_msg.obs[4].flags = 15; - test_msg.obs[4].lock = 9; - test_msg.obs[4].sid.code = 0; - test_msg.obs[4].sid.sat = 22; - - test_msg.obs[5].D.f = 246; - test_msg.obs[5].D.i = -2433; - test_msg.obs[5].L.f = 70; - test_msg.obs[5].L.i = 121711010; - test_msg.obs[5].P = 1158041713; - test_msg.obs[5].cn0 = 189; - test_msg.obs[5].flags = 15; - test_msg.obs[5].lock = 9; - test_msg.obs[5].sid.code = 0; - test_msg.obs[5].sid.sat = 23; - - test_msg.obs[6].D.f = 231; - test_msg.obs[6].D.i = -1896; - test_msg.obs[6].L.f = 221; - test_msg.obs[6].L.i = 94839765; - test_msg.obs[6].P = 1158041847; - test_msg.obs[6].cn0 = 158; - test_msg.obs[6].flags = 11; - test_msg.obs[6].lock = 9; - test_msg.obs[6].sid.code = 1; - test_msg.obs[6].sid.sat = 23; - - test_msg.obs[7].D.f = 67; - test_msg.obs[7].D.i = -1997; - test_msg.obs[7].L.f = 114; - test_msg.obs[7].L.i = 113998348; - test_msg.obs[7].P = 1084658184; - test_msg.obs[7].cn0 = 93; - test_msg.obs[7].flags = 11; - test_msg.obs[7].lock = 3; - test_msg.obs[7].sid.code = 0; - test_msg.obs[7].sid.sat = 27; - - test_msg.obs[8].D.f = 237; - test_msg.obs[8].D.i = 3041; - test_msg.obs[8].L.f = 232; - test_msg.obs[8].L.i = 133443545; - test_msg.obs[8].P = 1269673181; - test_msg.obs[8].cn0 = 123; - test_msg.obs[8].flags = 15; - test_msg.obs[8].lock = 5; - test_msg.obs[8].sid.code = 0; - test_msg.obs[8].sid.sat = 31; - - test_msg.obs[9].D.f = 62; - test_msg.obs[9].D.i = 2374; - test_msg.obs[9].L.f = 40; - test_msg.obs[9].L.i = 103982040; - test_msg.obs[9].P = 1269673722; - test_msg.obs[9].cn0 = 120; - test_msg.obs[9].flags = 11; - test_msg.obs[9].lock = 3; - test_msg.obs[9].sid.code = 1; - test_msg.obs[9].sid.sat = 31; - - test_msg.obs[10].D.f = 96; - test_msg.obs[10].D.i = -3446; - test_msg.obs[10].L.f = 7; - test_msg.obs[10].L.i = 118217315; - test_msg.obs[10].P = 1107693703; - test_msg.obs[10].cn0 = 176; - test_msg.obs[10].flags = 15; - test_msg.obs[10].lock = 10; - test_msg.obs[10].sid.code = 3; - test_msg.obs[10].sid.sat = 2; - - test_msg.obs[11].D.f = 96; - test_msg.obs[11].D.i = -1003; - test_msg.obs[11].L.f = 203; - test_msg.obs[11].L.i = 104224985; - test_msg.obs[11].P = 973505172; - test_msg.obs[11].cn0 = 170; - test_msg.obs[11].flags = 15; - test_msg.obs[11].lock = 10; - test_msg.obs[11].sid.code = 3; - test_msg.obs[11].sid.sat = 3; - - test_msg.obs[12].D.f = 219; - test_msg.obs[12].D.i = -3836; - test_msg.obs[12].L.f = 80; - test_msg.obs[12].L.i = 114505343; - test_msg.obs[12].P = 1069903034; - test_msg.obs[12].cn0 = 200; - test_msg.obs[12].flags = 15; - test_msg.obs[12].lock = 10; - test_msg.obs[12].sid.code = 3; - test_msg.obs[12].sid.sat = 17; - - test_msg.obs[13].D.f = 182; - test_msg.obs[13].D.i = -461; - test_msg.obs[13].L.f = 105; - test_msg.obs[13].L.i = 102157331; - test_msg.obs[13].P = 956875687; - test_msg.obs[13].cn0 = 152; - test_msg.obs[13].flags = 15; - test_msg.obs[13].lock = 10; - test_msg.obs[13].sid.code = 3; - test_msg.obs[13].sid.sat = 18; - - EXPECT_EQ(send_message( 61569, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61569); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 32) << "incorrect value for last_msg_.header.n_obs, expected 32, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.ns_residual, 0) << "incorrect value for last_msg_.header.t.ns_residual, expected 0, is " << last_msg_.header.t.ns_residual; - EXPECT_EQ(last_msg_.header.t.tow, 434293400) << "incorrect value for last_msg_.header.t.tow, expected 434293400, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 2154) << "incorrect value for last_msg_.header.t.wn, expected 2154, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 14) << "incorrect value for last_msg_.n_obs.value, expected 14, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].D.f, 172) << "incorrect value for last_msg_.obs[0].D.f, expected 172, is " << last_msg_.obs[0].D.f; - EXPECT_EQ(last_msg_.obs[0].D.i, -1536) << "incorrect value for last_msg_.obs[0].D.i, expected -1536, is " << last_msg_.obs[0].D.i; - EXPECT_EQ(last_msg_.obs[0].L.f, 146) << "incorrect value for last_msg_.obs[0].L.f, expected 146, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, 111080057) << "incorrect value for last_msg_.obs[0].L.i, expected 111080057, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 1056891697) << "incorrect value for last_msg_.obs[0].P, expected 1056891697, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 182) << "incorrect value for last_msg_.obs[0].cn0, expected 182, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].flags, 15) << "incorrect value for last_msg_.obs[0].flags, expected 15, is " << last_msg_.obs[0].flags; - EXPECT_EQ(last_msg_.obs[0].lock, 10) << "incorrect value for last_msg_.obs[0].lock, expected 10, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].sid.code, 0) << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " << last_msg_.obs[0].sid.code; - EXPECT_EQ(last_msg_.obs[0].sid.sat, 10) << "incorrect value for last_msg_.obs[0].sid.sat, expected 10, is " << last_msg_.obs[0].sid.sat; - EXPECT_EQ(last_msg_.obs[1].D.f, 172) << "incorrect value for last_msg_.obs[1].D.f, expected 172, is " << last_msg_.obs[1].D.f; - EXPECT_EQ(last_msg_.obs[1].D.i, -1197) << "incorrect value for last_msg_.obs[1].D.i, expected -1197, is " << last_msg_.obs[1].D.i; - EXPECT_EQ(last_msg_.obs[1].L.f, 59) << "incorrect value for last_msg_.obs[1].L.f, expected 59, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, 86555916) << "incorrect value for last_msg_.obs[1].L.i, expected 86555916, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 1056891934) << "incorrect value for last_msg_.obs[1].P, expected 1056891934, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].cn0, 178) << "incorrect value for last_msg_.obs[1].cn0, expected 178, is " << last_msg_.obs[1].cn0; - EXPECT_EQ(last_msg_.obs[1].flags, 15) << "incorrect value for last_msg_.obs[1].flags, expected 15, is " << last_msg_.obs[1].flags; - EXPECT_EQ(last_msg_.obs[1].lock, 10) << "incorrect value for last_msg_.obs[1].lock, expected 10, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].sid.code, 1) << "incorrect value for last_msg_.obs[1].sid.code, expected 1, is " << last_msg_.obs[1].sid.code; - EXPECT_EQ(last_msg_.obs[1].sid.sat, 10) << "incorrect value for last_msg_.obs[1].sid.sat, expected 10, is " << last_msg_.obs[1].sid.sat; - EXPECT_EQ(last_msg_.obs[2].D.f, 119) << "incorrect value for last_msg_.obs[2].D.f, expected 119, is " << last_msg_.obs[2].D.f; - EXPECT_EQ(last_msg_.obs[2].D.i, -3219) << "incorrect value for last_msg_.obs[2].D.i, expected -3219, is " << last_msg_.obs[2].D.i; - EXPECT_EQ(last_msg_.obs[2].L.f, 243) << "incorrect value for last_msg_.obs[2].L.f, expected 243, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, 127954794) << "incorrect value for last_msg_.obs[2].L.i, expected 127954794, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 1217449431) << "incorrect value for last_msg_.obs[2].P, expected 1217449431, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].cn0, 158) << "incorrect value for last_msg_.obs[2].cn0, expected 158, is " << last_msg_.obs[2].cn0; - EXPECT_EQ(last_msg_.obs[2].flags, 15) << "incorrect value for last_msg_.obs[2].flags, expected 15, is " << last_msg_.obs[2].flags; - EXPECT_EQ(last_msg_.obs[2].lock, 10) << "incorrect value for last_msg_.obs[2].lock, expected 10, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].sid.code, 0) << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " << last_msg_.obs[2].sid.code; - EXPECT_EQ(last_msg_.obs[2].sid.sat, 18) << "incorrect value for last_msg_.obs[2].sid.sat, expected 18, is " << last_msg_.obs[2].sid.sat; - EXPECT_EQ(last_msg_.obs[3].D.f, 27) << "incorrect value for last_msg_.obs[3].D.f, expected 27, is " << last_msg_.obs[3].D.f; - EXPECT_EQ(last_msg_.obs[3].D.i, -2508) << "incorrect value for last_msg_.obs[3].D.i, expected -2508, is " << last_msg_.obs[3].D.i; - EXPECT_EQ(last_msg_.obs[3].L.f, 12) << "incorrect value for last_msg_.obs[3].L.f, expected 12, is " << last_msg_.obs[3].L.f; - EXPECT_EQ(last_msg_.obs[3].L.i, 99705055) << "incorrect value for last_msg_.obs[3].L.i, expected 99705055, is " << last_msg_.obs[3].L.i; - EXPECT_EQ(last_msg_.obs[3].P, 1217449753) << "incorrect value for last_msg_.obs[3].P, expected 1217449753, is " << last_msg_.obs[3].P; - EXPECT_EQ(last_msg_.obs[3].cn0, 125) << "incorrect value for last_msg_.obs[3].cn0, expected 125, is " << last_msg_.obs[3].cn0; - EXPECT_EQ(last_msg_.obs[3].flags, 11) << "incorrect value for last_msg_.obs[3].flags, expected 11, is " << last_msg_.obs[3].flags; - EXPECT_EQ(last_msg_.obs[3].lock, 9) << "incorrect value for last_msg_.obs[3].lock, expected 9, is " << last_msg_.obs[3].lock; - EXPECT_EQ(last_msg_.obs[3].sid.code, 1) << "incorrect value for last_msg_.obs[3].sid.code, expected 1, is " << last_msg_.obs[3].sid.code; - EXPECT_EQ(last_msg_.obs[3].sid.sat, 18) << "incorrect value for last_msg_.obs[3].sid.sat, expected 18, is " << last_msg_.obs[3].sid.sat; - EXPECT_EQ(last_msg_.obs[4].D.f, 245) << "incorrect value for last_msg_.obs[4].D.f, expected 245, is " << last_msg_.obs[4].D.f; - EXPECT_EQ(last_msg_.obs[4].D.i, 2829) << "incorrect value for last_msg_.obs[4].D.i, expected 2829, is " << last_msg_.obs[4].D.i; - EXPECT_EQ(last_msg_.obs[4].L.f, 53) << "incorrect value for last_msg_.obs[4].L.f, expected 53, is " << last_msg_.obs[4].L.f; - EXPECT_EQ(last_msg_.obs[4].L.i, 132024982) << "incorrect value for last_msg_.obs[4].L.i, expected 132024982, is " << last_msg_.obs[4].L.i; - EXPECT_EQ(last_msg_.obs[4].P, 1256175650) << "incorrect value for last_msg_.obs[4].P, expected 1256175650, is " << last_msg_.obs[4].P; - EXPECT_EQ(last_msg_.obs[4].cn0, 114) << "incorrect value for last_msg_.obs[4].cn0, expected 114, is " << last_msg_.obs[4].cn0; - EXPECT_EQ(last_msg_.obs[4].flags, 15) << "incorrect value for last_msg_.obs[4].flags, expected 15, is " << last_msg_.obs[4].flags; - EXPECT_EQ(last_msg_.obs[4].lock, 9) << "incorrect value for last_msg_.obs[4].lock, expected 9, is " << last_msg_.obs[4].lock; - EXPECT_EQ(last_msg_.obs[4].sid.code, 0) << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " << last_msg_.obs[4].sid.code; - EXPECT_EQ(last_msg_.obs[4].sid.sat, 22) << "incorrect value for last_msg_.obs[4].sid.sat, expected 22, is " << last_msg_.obs[4].sid.sat; - EXPECT_EQ(last_msg_.obs[5].D.f, 246) << "incorrect value for last_msg_.obs[5].D.f, expected 246, is " << last_msg_.obs[5].D.f; - EXPECT_EQ(last_msg_.obs[5].D.i, -2433) << "incorrect value for last_msg_.obs[5].D.i, expected -2433, is " << last_msg_.obs[5].D.i; - EXPECT_EQ(last_msg_.obs[5].L.f, 70) << "incorrect value for last_msg_.obs[5].L.f, expected 70, is " << last_msg_.obs[5].L.f; - EXPECT_EQ(last_msg_.obs[5].L.i, 121711010) << "incorrect value for last_msg_.obs[5].L.i, expected 121711010, is " << last_msg_.obs[5].L.i; - EXPECT_EQ(last_msg_.obs[5].P, 1158041713) << "incorrect value for last_msg_.obs[5].P, expected 1158041713, is " << last_msg_.obs[5].P; - EXPECT_EQ(last_msg_.obs[5].cn0, 189) << "incorrect value for last_msg_.obs[5].cn0, expected 189, is " << last_msg_.obs[5].cn0; - EXPECT_EQ(last_msg_.obs[5].flags, 15) << "incorrect value for last_msg_.obs[5].flags, expected 15, is " << last_msg_.obs[5].flags; - EXPECT_EQ(last_msg_.obs[5].lock, 9) << "incorrect value for last_msg_.obs[5].lock, expected 9, is " << last_msg_.obs[5].lock; - EXPECT_EQ(last_msg_.obs[5].sid.code, 0) << "incorrect value for last_msg_.obs[5].sid.code, expected 0, is " << last_msg_.obs[5].sid.code; - EXPECT_EQ(last_msg_.obs[5].sid.sat, 23) << "incorrect value for last_msg_.obs[5].sid.sat, expected 23, is " << last_msg_.obs[5].sid.sat; - EXPECT_EQ(last_msg_.obs[6].D.f, 231) << "incorrect value for last_msg_.obs[6].D.f, expected 231, is " << last_msg_.obs[6].D.f; - EXPECT_EQ(last_msg_.obs[6].D.i, -1896) << "incorrect value for last_msg_.obs[6].D.i, expected -1896, is " << last_msg_.obs[6].D.i; - EXPECT_EQ(last_msg_.obs[6].L.f, 221) << "incorrect value for last_msg_.obs[6].L.f, expected 221, is " << last_msg_.obs[6].L.f; - EXPECT_EQ(last_msg_.obs[6].L.i, 94839765) << "incorrect value for last_msg_.obs[6].L.i, expected 94839765, is " << last_msg_.obs[6].L.i; - EXPECT_EQ(last_msg_.obs[6].P, 1158041847) << "incorrect value for last_msg_.obs[6].P, expected 1158041847, is " << last_msg_.obs[6].P; - EXPECT_EQ(last_msg_.obs[6].cn0, 158) << "incorrect value for last_msg_.obs[6].cn0, expected 158, is " << last_msg_.obs[6].cn0; - EXPECT_EQ(last_msg_.obs[6].flags, 11) << "incorrect value for last_msg_.obs[6].flags, expected 11, is " << last_msg_.obs[6].flags; - EXPECT_EQ(last_msg_.obs[6].lock, 9) << "incorrect value for last_msg_.obs[6].lock, expected 9, is " << last_msg_.obs[6].lock; - EXPECT_EQ(last_msg_.obs[6].sid.code, 1) << "incorrect value for last_msg_.obs[6].sid.code, expected 1, is " << last_msg_.obs[6].sid.code; - EXPECT_EQ(last_msg_.obs[6].sid.sat, 23) << "incorrect value for last_msg_.obs[6].sid.sat, expected 23, is " << last_msg_.obs[6].sid.sat; - EXPECT_EQ(last_msg_.obs[7].D.f, 67) << "incorrect value for last_msg_.obs[7].D.f, expected 67, is " << last_msg_.obs[7].D.f; - EXPECT_EQ(last_msg_.obs[7].D.i, -1997) << "incorrect value for last_msg_.obs[7].D.i, expected -1997, is " << last_msg_.obs[7].D.i; - EXPECT_EQ(last_msg_.obs[7].L.f, 114) << "incorrect value for last_msg_.obs[7].L.f, expected 114, is " << last_msg_.obs[7].L.f; - EXPECT_EQ(last_msg_.obs[7].L.i, 113998348) << "incorrect value for last_msg_.obs[7].L.i, expected 113998348, is " << last_msg_.obs[7].L.i; - EXPECT_EQ(last_msg_.obs[7].P, 1084658184) << "incorrect value for last_msg_.obs[7].P, expected 1084658184, is " << last_msg_.obs[7].P; - EXPECT_EQ(last_msg_.obs[7].cn0, 93) << "incorrect value for last_msg_.obs[7].cn0, expected 93, is " << last_msg_.obs[7].cn0; - EXPECT_EQ(last_msg_.obs[7].flags, 11) << "incorrect value for last_msg_.obs[7].flags, expected 11, is " << last_msg_.obs[7].flags; - EXPECT_EQ(last_msg_.obs[7].lock, 3) << "incorrect value for last_msg_.obs[7].lock, expected 3, is " << last_msg_.obs[7].lock; - EXPECT_EQ(last_msg_.obs[7].sid.code, 0) << "incorrect value for last_msg_.obs[7].sid.code, expected 0, is " << last_msg_.obs[7].sid.code; - EXPECT_EQ(last_msg_.obs[7].sid.sat, 27) << "incorrect value for last_msg_.obs[7].sid.sat, expected 27, is " << last_msg_.obs[7].sid.sat; - EXPECT_EQ(last_msg_.obs[8].D.f, 237) << "incorrect value for last_msg_.obs[8].D.f, expected 237, is " << last_msg_.obs[8].D.f; - EXPECT_EQ(last_msg_.obs[8].D.i, 3041) << "incorrect value for last_msg_.obs[8].D.i, expected 3041, is " << last_msg_.obs[8].D.i; - EXPECT_EQ(last_msg_.obs[8].L.f, 232) << "incorrect value for last_msg_.obs[8].L.f, expected 232, is " << last_msg_.obs[8].L.f; - EXPECT_EQ(last_msg_.obs[8].L.i, 133443545) << "incorrect value for last_msg_.obs[8].L.i, expected 133443545, is " << last_msg_.obs[8].L.i; - EXPECT_EQ(last_msg_.obs[8].P, 1269673181) << "incorrect value for last_msg_.obs[8].P, expected 1269673181, is " << last_msg_.obs[8].P; - EXPECT_EQ(last_msg_.obs[8].cn0, 123) << "incorrect value for last_msg_.obs[8].cn0, expected 123, is " << last_msg_.obs[8].cn0; - EXPECT_EQ(last_msg_.obs[8].flags, 15) << "incorrect value for last_msg_.obs[8].flags, expected 15, is " << last_msg_.obs[8].flags; - EXPECT_EQ(last_msg_.obs[8].lock, 5) << "incorrect value for last_msg_.obs[8].lock, expected 5, is " << last_msg_.obs[8].lock; - EXPECT_EQ(last_msg_.obs[8].sid.code, 0) << "incorrect value for last_msg_.obs[8].sid.code, expected 0, is " << last_msg_.obs[8].sid.code; - EXPECT_EQ(last_msg_.obs[8].sid.sat, 31) << "incorrect value for last_msg_.obs[8].sid.sat, expected 31, is " << last_msg_.obs[8].sid.sat; - EXPECT_EQ(last_msg_.obs[9].D.f, 62) << "incorrect value for last_msg_.obs[9].D.f, expected 62, is " << last_msg_.obs[9].D.f; - EXPECT_EQ(last_msg_.obs[9].D.i, 2374) << "incorrect value for last_msg_.obs[9].D.i, expected 2374, is " << last_msg_.obs[9].D.i; - EXPECT_EQ(last_msg_.obs[9].L.f, 40) << "incorrect value for last_msg_.obs[9].L.f, expected 40, is " << last_msg_.obs[9].L.f; - EXPECT_EQ(last_msg_.obs[9].L.i, 103982040) << "incorrect value for last_msg_.obs[9].L.i, expected 103982040, is " << last_msg_.obs[9].L.i; - EXPECT_EQ(last_msg_.obs[9].P, 1269673722) << "incorrect value for last_msg_.obs[9].P, expected 1269673722, is " << last_msg_.obs[9].P; - EXPECT_EQ(last_msg_.obs[9].cn0, 120) << "incorrect value for last_msg_.obs[9].cn0, expected 120, is " << last_msg_.obs[9].cn0; - EXPECT_EQ(last_msg_.obs[9].flags, 11) << "incorrect value for last_msg_.obs[9].flags, expected 11, is " << last_msg_.obs[9].flags; - EXPECT_EQ(last_msg_.obs[9].lock, 3) << "incorrect value for last_msg_.obs[9].lock, expected 3, is " << last_msg_.obs[9].lock; - EXPECT_EQ(last_msg_.obs[9].sid.code, 1) << "incorrect value for last_msg_.obs[9].sid.code, expected 1, is " << last_msg_.obs[9].sid.code; - EXPECT_EQ(last_msg_.obs[9].sid.sat, 31) << "incorrect value for last_msg_.obs[9].sid.sat, expected 31, is " << last_msg_.obs[9].sid.sat; - EXPECT_EQ(last_msg_.obs[10].D.f, 96) << "incorrect value for last_msg_.obs[10].D.f, expected 96, is " << last_msg_.obs[10].D.f; - EXPECT_EQ(last_msg_.obs[10].D.i, -3446) << "incorrect value for last_msg_.obs[10].D.i, expected -3446, is " << last_msg_.obs[10].D.i; - EXPECT_EQ(last_msg_.obs[10].L.f, 7) << "incorrect value for last_msg_.obs[10].L.f, expected 7, is " << last_msg_.obs[10].L.f; - EXPECT_EQ(last_msg_.obs[10].L.i, 118217315) << "incorrect value for last_msg_.obs[10].L.i, expected 118217315, is " << last_msg_.obs[10].L.i; - EXPECT_EQ(last_msg_.obs[10].P, 1107693703) << "incorrect value for last_msg_.obs[10].P, expected 1107693703, is " << last_msg_.obs[10].P; - EXPECT_EQ(last_msg_.obs[10].cn0, 176) << "incorrect value for last_msg_.obs[10].cn0, expected 176, is " << last_msg_.obs[10].cn0; - EXPECT_EQ(last_msg_.obs[10].flags, 15) << "incorrect value for last_msg_.obs[10].flags, expected 15, is " << last_msg_.obs[10].flags; - EXPECT_EQ(last_msg_.obs[10].lock, 10) << "incorrect value for last_msg_.obs[10].lock, expected 10, is " << last_msg_.obs[10].lock; - EXPECT_EQ(last_msg_.obs[10].sid.code, 3) << "incorrect value for last_msg_.obs[10].sid.code, expected 3, is " << last_msg_.obs[10].sid.code; - EXPECT_EQ(last_msg_.obs[10].sid.sat, 2) << "incorrect value for last_msg_.obs[10].sid.sat, expected 2, is " << last_msg_.obs[10].sid.sat; - EXPECT_EQ(last_msg_.obs[11].D.f, 96) << "incorrect value for last_msg_.obs[11].D.f, expected 96, is " << last_msg_.obs[11].D.f; - EXPECT_EQ(last_msg_.obs[11].D.i, -1003) << "incorrect value for last_msg_.obs[11].D.i, expected -1003, is " << last_msg_.obs[11].D.i; - EXPECT_EQ(last_msg_.obs[11].L.f, 203) << "incorrect value for last_msg_.obs[11].L.f, expected 203, is " << last_msg_.obs[11].L.f; - EXPECT_EQ(last_msg_.obs[11].L.i, 104224985) << "incorrect value for last_msg_.obs[11].L.i, expected 104224985, is " << last_msg_.obs[11].L.i; - EXPECT_EQ(last_msg_.obs[11].P, 973505172) << "incorrect value for last_msg_.obs[11].P, expected 973505172, is " << last_msg_.obs[11].P; - EXPECT_EQ(last_msg_.obs[11].cn0, 170) << "incorrect value for last_msg_.obs[11].cn0, expected 170, is " << last_msg_.obs[11].cn0; - EXPECT_EQ(last_msg_.obs[11].flags, 15) << "incorrect value for last_msg_.obs[11].flags, expected 15, is " << last_msg_.obs[11].flags; - EXPECT_EQ(last_msg_.obs[11].lock, 10) << "incorrect value for last_msg_.obs[11].lock, expected 10, is " << last_msg_.obs[11].lock; - EXPECT_EQ(last_msg_.obs[11].sid.code, 3) << "incorrect value for last_msg_.obs[11].sid.code, expected 3, is " << last_msg_.obs[11].sid.code; - EXPECT_EQ(last_msg_.obs[11].sid.sat, 3) << "incorrect value for last_msg_.obs[11].sid.sat, expected 3, is " << last_msg_.obs[11].sid.sat; - EXPECT_EQ(last_msg_.obs[12].D.f, 219) << "incorrect value for last_msg_.obs[12].D.f, expected 219, is " << last_msg_.obs[12].D.f; - EXPECT_EQ(last_msg_.obs[12].D.i, -3836) << "incorrect value for last_msg_.obs[12].D.i, expected -3836, is " << last_msg_.obs[12].D.i; - EXPECT_EQ(last_msg_.obs[12].L.f, 80) << "incorrect value for last_msg_.obs[12].L.f, expected 80, is " << last_msg_.obs[12].L.f; - EXPECT_EQ(last_msg_.obs[12].L.i, 114505343) << "incorrect value for last_msg_.obs[12].L.i, expected 114505343, is " << last_msg_.obs[12].L.i; - EXPECT_EQ(last_msg_.obs[12].P, 1069903034) << "incorrect value for last_msg_.obs[12].P, expected 1069903034, is " << last_msg_.obs[12].P; - EXPECT_EQ(last_msg_.obs[12].cn0, 200) << "incorrect value for last_msg_.obs[12].cn0, expected 200, is " << last_msg_.obs[12].cn0; - EXPECT_EQ(last_msg_.obs[12].flags, 15) << "incorrect value for last_msg_.obs[12].flags, expected 15, is " << last_msg_.obs[12].flags; - EXPECT_EQ(last_msg_.obs[12].lock, 10) << "incorrect value for last_msg_.obs[12].lock, expected 10, is " << last_msg_.obs[12].lock; - EXPECT_EQ(last_msg_.obs[12].sid.code, 3) << "incorrect value for last_msg_.obs[12].sid.code, expected 3, is " << last_msg_.obs[12].sid.code; - EXPECT_EQ(last_msg_.obs[12].sid.sat, 17) << "incorrect value for last_msg_.obs[12].sid.sat, expected 17, is " << last_msg_.obs[12].sid.sat; - EXPECT_EQ(last_msg_.obs[13].D.f, 182) << "incorrect value for last_msg_.obs[13].D.f, expected 182, is " << last_msg_.obs[13].D.f; - EXPECT_EQ(last_msg_.obs[13].D.i, -461) << "incorrect value for last_msg_.obs[13].D.i, expected -461, is " << last_msg_.obs[13].D.i; - EXPECT_EQ(last_msg_.obs[13].L.f, 105) << "incorrect value for last_msg_.obs[13].L.f, expected 105, is " << last_msg_.obs[13].L.f; - EXPECT_EQ(last_msg_.obs[13].L.i, 102157331) << "incorrect value for last_msg_.obs[13].L.i, expected 102157331, is " << last_msg_.obs[13].L.i; - EXPECT_EQ(last_msg_.obs[13].P, 956875687) << "incorrect value for last_msg_.obs[13].P, expected 956875687, is " << last_msg_.obs[13].P; - EXPECT_EQ(last_msg_.obs[13].cn0, 152) << "incorrect value for last_msg_.obs[13].cn0, expected 152, is " << last_msg_.obs[13].cn0; - EXPECT_EQ(last_msg_.obs[13].flags, 15) << "incorrect value for last_msg_.obs[13].flags, expected 15, is " << last_msg_.obs[13].flags; - EXPECT_EQ(last_msg_.obs[13].lock, 10) << "incorrect value for last_msg_.obs[13].lock, expected 10, is " << last_msg_.obs[13].lock; - EXPECT_EQ(last_msg_.obs[13].sid.code, 3) << "incorrect value for last_msg_.obs[13].sid.code, expected 3, is " << last_msg_.obs[13].sid.code; - EXPECT_EQ(last_msg_.obs[13].sid.sat, 18) << "incorrect value for last_msg_.obs[13].sid.sat, expected 18, is " << last_msg_.obs[13].sid.sat; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgObs0, Test) { + uint8_t encoded_frame[] = { + 85, 74, 0, 129, 240, 249, 152, 202, 226, 25, 0, 0, 0, 0, 106, + 8, 32, 49, 227, 254, 62, 121, 242, 158, 6, 146, 0, 250, 172, 182, + 10, 15, 10, 0, 30, 228, 254, 62, 12, 189, 40, 5, 59, 83, 251, + 172, 178, 10, 15, 10, 1, 215, 205, 144, 72, 106, 111, 160, 7, 243, + 109, 243, 119, 158, 10, 15, 18, 0, 25, 207, 144, 72, 223, 96, 241, + 5, 12, 52, 246, 27, 125, 9, 11, 18, 1, 34, 184, 223, 74, 150, + 138, 222, 7, 53, 13, 11, 245, 114, 9, 15, 22, 0, 113, 80, 6, + 69, 162, 41, 65, 7, 70, 127, 246, 246, 189, 9, 15, 23, 0, 247, + 80, 6, 69, 213, 35, 167, 5, 221, 152, 248, 231, 158, 9, 11, 23, + 1, 8, 146, 166, 64, 12, 122, 203, 6, 114, 51, 248, 67, 93, 3, + 11, 27, 0, 221, 172, 173, 75, 217, 47, 244, 7, 232, 225, 11, 237, + 123, 5, 15, 31, 0, 250, 174, 173, 75, 216, 163, 50, 6, 40, 70, + 9, 62, 120, 3, 11, 31, 1, 135, 16, 6, 66, 99, 218, 11, 7, + 7, 138, 242, 96, 176, 10, 15, 2, 3, 148, 130, 6, 58, 217, 88, + 54, 6, 203, 21, 252, 96, 170, 10, 15, 3, 3, 186, 108, 197, 63, + 127, 54, 211, 6, 80, 4, 241, 219, 200, 10, 15, 17, 3, 167, 195, + 8, 57, 19, 204, 22, 6, 105, 51, 254, 182, 152, 10, 15, 18, 3, + 237, 248, + }; + + sbp_msg_obs_t test_msg{}; + test_msg.header.n_obs = 32; + test_msg.header.t.ns_residual = 0; + test_msg.header.t.tow = 434293400; + test_msg.header.t.wn = 2154; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 14; + + test_msg.obs[0].D.f = 172; + test_msg.obs[0].D.i = -1536; + test_msg.obs[0].L.f = 146; + test_msg.obs[0].L.i = 111080057; + test_msg.obs[0].P = 1056891697; + test_msg.obs[0].cn0 = 182; + test_msg.obs[0].flags = 15; + test_msg.obs[0].lock = 10; + test_msg.obs[0].sid.code = 0; + test_msg.obs[0].sid.sat = 10; + + test_msg.obs[1].D.f = 172; + test_msg.obs[1].D.i = -1197; + test_msg.obs[1].L.f = 59; + test_msg.obs[1].L.i = 86555916; + test_msg.obs[1].P = 1056891934; + test_msg.obs[1].cn0 = 178; + test_msg.obs[1].flags = 15; + test_msg.obs[1].lock = 10; + test_msg.obs[1].sid.code = 1; + test_msg.obs[1].sid.sat = 10; + + test_msg.obs[2].D.f = 119; + test_msg.obs[2].D.i = -3219; + test_msg.obs[2].L.f = 243; + test_msg.obs[2].L.i = 127954794; + test_msg.obs[2].P = 1217449431; + test_msg.obs[2].cn0 = 158; + test_msg.obs[2].flags = 15; + test_msg.obs[2].lock = 10; + test_msg.obs[2].sid.code = 0; + test_msg.obs[2].sid.sat = 18; + + test_msg.obs[3].D.f = 27; + test_msg.obs[3].D.i = -2508; + test_msg.obs[3].L.f = 12; + test_msg.obs[3].L.i = 99705055; + test_msg.obs[3].P = 1217449753; + test_msg.obs[3].cn0 = 125; + test_msg.obs[3].flags = 11; + test_msg.obs[3].lock = 9; + test_msg.obs[3].sid.code = 1; + test_msg.obs[3].sid.sat = 18; + + test_msg.obs[4].D.f = 245; + test_msg.obs[4].D.i = 2829; + test_msg.obs[4].L.f = 53; + test_msg.obs[4].L.i = 132024982; + test_msg.obs[4].P = 1256175650; + test_msg.obs[4].cn0 = 114; + test_msg.obs[4].flags = 15; + test_msg.obs[4].lock = 9; + test_msg.obs[4].sid.code = 0; + test_msg.obs[4].sid.sat = 22; + + test_msg.obs[5].D.f = 246; + test_msg.obs[5].D.i = -2433; + test_msg.obs[5].L.f = 70; + test_msg.obs[5].L.i = 121711010; + test_msg.obs[5].P = 1158041713; + test_msg.obs[5].cn0 = 189; + test_msg.obs[5].flags = 15; + test_msg.obs[5].lock = 9; + test_msg.obs[5].sid.code = 0; + test_msg.obs[5].sid.sat = 23; + + test_msg.obs[6].D.f = 231; + test_msg.obs[6].D.i = -1896; + test_msg.obs[6].L.f = 221; + test_msg.obs[6].L.i = 94839765; + test_msg.obs[6].P = 1158041847; + test_msg.obs[6].cn0 = 158; + test_msg.obs[6].flags = 11; + test_msg.obs[6].lock = 9; + test_msg.obs[6].sid.code = 1; + test_msg.obs[6].sid.sat = 23; + + test_msg.obs[7].D.f = 67; + test_msg.obs[7].D.i = -1997; + test_msg.obs[7].L.f = 114; + test_msg.obs[7].L.i = 113998348; + test_msg.obs[7].P = 1084658184; + test_msg.obs[7].cn0 = 93; + test_msg.obs[7].flags = 11; + test_msg.obs[7].lock = 3; + test_msg.obs[7].sid.code = 0; + test_msg.obs[7].sid.sat = 27; + + test_msg.obs[8].D.f = 237; + test_msg.obs[8].D.i = 3041; + test_msg.obs[8].L.f = 232; + test_msg.obs[8].L.i = 133443545; + test_msg.obs[8].P = 1269673181; + test_msg.obs[8].cn0 = 123; + test_msg.obs[8].flags = 15; + test_msg.obs[8].lock = 5; + test_msg.obs[8].sid.code = 0; + test_msg.obs[8].sid.sat = 31; + + test_msg.obs[9].D.f = 62; + test_msg.obs[9].D.i = 2374; + test_msg.obs[9].L.f = 40; + test_msg.obs[9].L.i = 103982040; + test_msg.obs[9].P = 1269673722; + test_msg.obs[9].cn0 = 120; + test_msg.obs[9].flags = 11; + test_msg.obs[9].lock = 3; + test_msg.obs[9].sid.code = 1; + test_msg.obs[9].sid.sat = 31; + + test_msg.obs[10].D.f = 96; + test_msg.obs[10].D.i = -3446; + test_msg.obs[10].L.f = 7; + test_msg.obs[10].L.i = 118217315; + test_msg.obs[10].P = 1107693703; + test_msg.obs[10].cn0 = 176; + test_msg.obs[10].flags = 15; + test_msg.obs[10].lock = 10; + test_msg.obs[10].sid.code = 3; + test_msg.obs[10].sid.sat = 2; + + test_msg.obs[11].D.f = 96; + test_msg.obs[11].D.i = -1003; + test_msg.obs[11].L.f = 203; + test_msg.obs[11].L.i = 104224985; + test_msg.obs[11].P = 973505172; + test_msg.obs[11].cn0 = 170; + test_msg.obs[11].flags = 15; + test_msg.obs[11].lock = 10; + test_msg.obs[11].sid.code = 3; + test_msg.obs[11].sid.sat = 3; + + test_msg.obs[12].D.f = 219; + test_msg.obs[12].D.i = -3836; + test_msg.obs[12].L.f = 80; + test_msg.obs[12].L.i = 114505343; + test_msg.obs[12].P = 1069903034; + test_msg.obs[12].cn0 = 200; + test_msg.obs[12].flags = 15; + test_msg.obs[12].lock = 10; + test_msg.obs[12].sid.code = 3; + test_msg.obs[12].sid.sat = 17; + + test_msg.obs[13].D.f = 182; + test_msg.obs[13].D.i = -461; + test_msg.obs[13].L.f = 105; + test_msg.obs[13].L.i = 102157331; + test_msg.obs[13].P = 956875687; + test_msg.obs[13].cn0 = 152; + test_msg.obs[13].flags = 15; + test_msg.obs[13].lock = 10; + test_msg.obs[13].sid.code = 3; + test_msg.obs[13].sid.sat = 18; + + EXPECT_EQ(send_message(61569, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61569); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 32) + << "incorrect value for last_msg_.header.n_obs, expected 32, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.ns_residual, 0) + << "incorrect value for last_msg_.header.t.ns_residual, expected 0, is " + << last_msg_.header.t.ns_residual; + EXPECT_EQ(last_msg_.header.t.tow, 434293400) + << "incorrect value for last_msg_.header.t.tow, expected 434293400, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 2154) + << "incorrect value for last_msg_.header.t.wn, expected 2154, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 14) + << "incorrect value for last_msg_.n_obs.value, expected 14, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].D.f, 172) + << "incorrect value for last_msg_.obs[0].D.f, expected 172, is " + << last_msg_.obs[0].D.f; + EXPECT_EQ(last_msg_.obs[0].D.i, -1536) + << "incorrect value for last_msg_.obs[0].D.i, expected -1536, is " + << last_msg_.obs[0].D.i; + EXPECT_EQ(last_msg_.obs[0].L.f, 146) + << "incorrect value for last_msg_.obs[0].L.f, expected 146, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, 111080057) + << "incorrect value for last_msg_.obs[0].L.i, expected 111080057, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 1056891697) + << "incorrect value for last_msg_.obs[0].P, expected 1056891697, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 182) + << "incorrect value for last_msg_.obs[0].cn0, expected 182, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].flags, 15) + << "incorrect value for last_msg_.obs[0].flags, expected 15, is " + << last_msg_.obs[0].flags; + EXPECT_EQ(last_msg_.obs[0].lock, 10) + << "incorrect value for last_msg_.obs[0].lock, expected 10, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].sid.code, 0) + << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " + << last_msg_.obs[0].sid.code; + EXPECT_EQ(last_msg_.obs[0].sid.sat, 10) + << "incorrect value for last_msg_.obs[0].sid.sat, expected 10, is " + << last_msg_.obs[0].sid.sat; + EXPECT_EQ(last_msg_.obs[1].D.f, 172) + << "incorrect value for last_msg_.obs[1].D.f, expected 172, is " + << last_msg_.obs[1].D.f; + EXPECT_EQ(last_msg_.obs[1].D.i, -1197) + << "incorrect value for last_msg_.obs[1].D.i, expected -1197, is " + << last_msg_.obs[1].D.i; + EXPECT_EQ(last_msg_.obs[1].L.f, 59) + << "incorrect value for last_msg_.obs[1].L.f, expected 59, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, 86555916) + << "incorrect value for last_msg_.obs[1].L.i, expected 86555916, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 1056891934) + << "incorrect value for last_msg_.obs[1].P, expected 1056891934, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].cn0, 178) + << "incorrect value for last_msg_.obs[1].cn0, expected 178, is " + << last_msg_.obs[1].cn0; + EXPECT_EQ(last_msg_.obs[1].flags, 15) + << "incorrect value for last_msg_.obs[1].flags, expected 15, is " + << last_msg_.obs[1].flags; + EXPECT_EQ(last_msg_.obs[1].lock, 10) + << "incorrect value for last_msg_.obs[1].lock, expected 10, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].sid.code, 1) + << "incorrect value for last_msg_.obs[1].sid.code, expected 1, is " + << last_msg_.obs[1].sid.code; + EXPECT_EQ(last_msg_.obs[1].sid.sat, 10) + << "incorrect value for last_msg_.obs[1].sid.sat, expected 10, is " + << last_msg_.obs[1].sid.sat; + EXPECT_EQ(last_msg_.obs[2].D.f, 119) + << "incorrect value for last_msg_.obs[2].D.f, expected 119, is " + << last_msg_.obs[2].D.f; + EXPECT_EQ(last_msg_.obs[2].D.i, -3219) + << "incorrect value for last_msg_.obs[2].D.i, expected -3219, is " + << last_msg_.obs[2].D.i; + EXPECT_EQ(last_msg_.obs[2].L.f, 243) + << "incorrect value for last_msg_.obs[2].L.f, expected 243, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, 127954794) + << "incorrect value for last_msg_.obs[2].L.i, expected 127954794, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 1217449431) + << "incorrect value for last_msg_.obs[2].P, expected 1217449431, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].cn0, 158) + << "incorrect value for last_msg_.obs[2].cn0, expected 158, is " + << last_msg_.obs[2].cn0; + EXPECT_EQ(last_msg_.obs[2].flags, 15) + << "incorrect value for last_msg_.obs[2].flags, expected 15, is " + << last_msg_.obs[2].flags; + EXPECT_EQ(last_msg_.obs[2].lock, 10) + << "incorrect value for last_msg_.obs[2].lock, expected 10, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].sid.code, 0) + << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " + << last_msg_.obs[2].sid.code; + EXPECT_EQ(last_msg_.obs[2].sid.sat, 18) + << "incorrect value for last_msg_.obs[2].sid.sat, expected 18, is " + << last_msg_.obs[2].sid.sat; + EXPECT_EQ(last_msg_.obs[3].D.f, 27) + << "incorrect value for last_msg_.obs[3].D.f, expected 27, is " + << last_msg_.obs[3].D.f; + EXPECT_EQ(last_msg_.obs[3].D.i, -2508) + << "incorrect value for last_msg_.obs[3].D.i, expected -2508, is " + << last_msg_.obs[3].D.i; + EXPECT_EQ(last_msg_.obs[3].L.f, 12) + << "incorrect value for last_msg_.obs[3].L.f, expected 12, is " + << last_msg_.obs[3].L.f; + EXPECT_EQ(last_msg_.obs[3].L.i, 99705055) + << "incorrect value for last_msg_.obs[3].L.i, expected 99705055, is " + << last_msg_.obs[3].L.i; + EXPECT_EQ(last_msg_.obs[3].P, 1217449753) + << "incorrect value for last_msg_.obs[3].P, expected 1217449753, is " + << last_msg_.obs[3].P; + EXPECT_EQ(last_msg_.obs[3].cn0, 125) + << "incorrect value for last_msg_.obs[3].cn0, expected 125, is " + << last_msg_.obs[3].cn0; + EXPECT_EQ(last_msg_.obs[3].flags, 11) + << "incorrect value for last_msg_.obs[3].flags, expected 11, is " + << last_msg_.obs[3].flags; + EXPECT_EQ(last_msg_.obs[3].lock, 9) + << "incorrect value for last_msg_.obs[3].lock, expected 9, is " + << last_msg_.obs[3].lock; + EXPECT_EQ(last_msg_.obs[3].sid.code, 1) + << "incorrect value for last_msg_.obs[3].sid.code, expected 1, is " + << last_msg_.obs[3].sid.code; + EXPECT_EQ(last_msg_.obs[3].sid.sat, 18) + << "incorrect value for last_msg_.obs[3].sid.sat, expected 18, is " + << last_msg_.obs[3].sid.sat; + EXPECT_EQ(last_msg_.obs[4].D.f, 245) + << "incorrect value for last_msg_.obs[4].D.f, expected 245, is " + << last_msg_.obs[4].D.f; + EXPECT_EQ(last_msg_.obs[4].D.i, 2829) + << "incorrect value for last_msg_.obs[4].D.i, expected 2829, is " + << last_msg_.obs[4].D.i; + EXPECT_EQ(last_msg_.obs[4].L.f, 53) + << "incorrect value for last_msg_.obs[4].L.f, expected 53, is " + << last_msg_.obs[4].L.f; + EXPECT_EQ(last_msg_.obs[4].L.i, 132024982) + << "incorrect value for last_msg_.obs[4].L.i, expected 132024982, is " + << last_msg_.obs[4].L.i; + EXPECT_EQ(last_msg_.obs[4].P, 1256175650) + << "incorrect value for last_msg_.obs[4].P, expected 1256175650, is " + << last_msg_.obs[4].P; + EXPECT_EQ(last_msg_.obs[4].cn0, 114) + << "incorrect value for last_msg_.obs[4].cn0, expected 114, is " + << last_msg_.obs[4].cn0; + EXPECT_EQ(last_msg_.obs[4].flags, 15) + << "incorrect value for last_msg_.obs[4].flags, expected 15, is " + << last_msg_.obs[4].flags; + EXPECT_EQ(last_msg_.obs[4].lock, 9) + << "incorrect value for last_msg_.obs[4].lock, expected 9, is " + << last_msg_.obs[4].lock; + EXPECT_EQ(last_msg_.obs[4].sid.code, 0) + << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " + << last_msg_.obs[4].sid.code; + EXPECT_EQ(last_msg_.obs[4].sid.sat, 22) + << "incorrect value for last_msg_.obs[4].sid.sat, expected 22, is " + << last_msg_.obs[4].sid.sat; + EXPECT_EQ(last_msg_.obs[5].D.f, 246) + << "incorrect value for last_msg_.obs[5].D.f, expected 246, is " + << last_msg_.obs[5].D.f; + EXPECT_EQ(last_msg_.obs[5].D.i, -2433) + << "incorrect value for last_msg_.obs[5].D.i, expected -2433, is " + << last_msg_.obs[5].D.i; + EXPECT_EQ(last_msg_.obs[5].L.f, 70) + << "incorrect value for last_msg_.obs[5].L.f, expected 70, is " + << last_msg_.obs[5].L.f; + EXPECT_EQ(last_msg_.obs[5].L.i, 121711010) + << "incorrect value for last_msg_.obs[5].L.i, expected 121711010, is " + << last_msg_.obs[5].L.i; + EXPECT_EQ(last_msg_.obs[5].P, 1158041713) + << "incorrect value for last_msg_.obs[5].P, expected 1158041713, is " + << last_msg_.obs[5].P; + EXPECT_EQ(last_msg_.obs[5].cn0, 189) + << "incorrect value for last_msg_.obs[5].cn0, expected 189, is " + << last_msg_.obs[5].cn0; + EXPECT_EQ(last_msg_.obs[5].flags, 15) + << "incorrect value for last_msg_.obs[5].flags, expected 15, is " + << last_msg_.obs[5].flags; + EXPECT_EQ(last_msg_.obs[5].lock, 9) + << "incorrect value for last_msg_.obs[5].lock, expected 9, is " + << last_msg_.obs[5].lock; + EXPECT_EQ(last_msg_.obs[5].sid.code, 0) + << "incorrect value for last_msg_.obs[5].sid.code, expected 0, is " + << last_msg_.obs[5].sid.code; + EXPECT_EQ(last_msg_.obs[5].sid.sat, 23) + << "incorrect value for last_msg_.obs[5].sid.sat, expected 23, is " + << last_msg_.obs[5].sid.sat; + EXPECT_EQ(last_msg_.obs[6].D.f, 231) + << "incorrect value for last_msg_.obs[6].D.f, expected 231, is " + << last_msg_.obs[6].D.f; + EXPECT_EQ(last_msg_.obs[6].D.i, -1896) + << "incorrect value for last_msg_.obs[6].D.i, expected -1896, is " + << last_msg_.obs[6].D.i; + EXPECT_EQ(last_msg_.obs[6].L.f, 221) + << "incorrect value for last_msg_.obs[6].L.f, expected 221, is " + << last_msg_.obs[6].L.f; + EXPECT_EQ(last_msg_.obs[6].L.i, 94839765) + << "incorrect value for last_msg_.obs[6].L.i, expected 94839765, is " + << last_msg_.obs[6].L.i; + EXPECT_EQ(last_msg_.obs[6].P, 1158041847) + << "incorrect value for last_msg_.obs[6].P, expected 1158041847, is " + << last_msg_.obs[6].P; + EXPECT_EQ(last_msg_.obs[6].cn0, 158) + << "incorrect value for last_msg_.obs[6].cn0, expected 158, is " + << last_msg_.obs[6].cn0; + EXPECT_EQ(last_msg_.obs[6].flags, 11) + << "incorrect value for last_msg_.obs[6].flags, expected 11, is " + << last_msg_.obs[6].flags; + EXPECT_EQ(last_msg_.obs[6].lock, 9) + << "incorrect value for last_msg_.obs[6].lock, expected 9, is " + << last_msg_.obs[6].lock; + EXPECT_EQ(last_msg_.obs[6].sid.code, 1) + << "incorrect value for last_msg_.obs[6].sid.code, expected 1, is " + << last_msg_.obs[6].sid.code; + EXPECT_EQ(last_msg_.obs[6].sid.sat, 23) + << "incorrect value for last_msg_.obs[6].sid.sat, expected 23, is " + << last_msg_.obs[6].sid.sat; + EXPECT_EQ(last_msg_.obs[7].D.f, 67) + << "incorrect value for last_msg_.obs[7].D.f, expected 67, is " + << last_msg_.obs[7].D.f; + EXPECT_EQ(last_msg_.obs[7].D.i, -1997) + << "incorrect value for last_msg_.obs[7].D.i, expected -1997, is " + << last_msg_.obs[7].D.i; + EXPECT_EQ(last_msg_.obs[7].L.f, 114) + << "incorrect value for last_msg_.obs[7].L.f, expected 114, is " + << last_msg_.obs[7].L.f; + EXPECT_EQ(last_msg_.obs[7].L.i, 113998348) + << "incorrect value for last_msg_.obs[7].L.i, expected 113998348, is " + << last_msg_.obs[7].L.i; + EXPECT_EQ(last_msg_.obs[7].P, 1084658184) + << "incorrect value for last_msg_.obs[7].P, expected 1084658184, is " + << last_msg_.obs[7].P; + EXPECT_EQ(last_msg_.obs[7].cn0, 93) + << "incorrect value for last_msg_.obs[7].cn0, expected 93, is " + << last_msg_.obs[7].cn0; + EXPECT_EQ(last_msg_.obs[7].flags, 11) + << "incorrect value for last_msg_.obs[7].flags, expected 11, is " + << last_msg_.obs[7].flags; + EXPECT_EQ(last_msg_.obs[7].lock, 3) + << "incorrect value for last_msg_.obs[7].lock, expected 3, is " + << last_msg_.obs[7].lock; + EXPECT_EQ(last_msg_.obs[7].sid.code, 0) + << "incorrect value for last_msg_.obs[7].sid.code, expected 0, is " + << last_msg_.obs[7].sid.code; + EXPECT_EQ(last_msg_.obs[7].sid.sat, 27) + << "incorrect value for last_msg_.obs[7].sid.sat, expected 27, is " + << last_msg_.obs[7].sid.sat; + EXPECT_EQ(last_msg_.obs[8].D.f, 237) + << "incorrect value for last_msg_.obs[8].D.f, expected 237, is " + << last_msg_.obs[8].D.f; + EXPECT_EQ(last_msg_.obs[8].D.i, 3041) + << "incorrect value for last_msg_.obs[8].D.i, expected 3041, is " + << last_msg_.obs[8].D.i; + EXPECT_EQ(last_msg_.obs[8].L.f, 232) + << "incorrect value for last_msg_.obs[8].L.f, expected 232, is " + << last_msg_.obs[8].L.f; + EXPECT_EQ(last_msg_.obs[8].L.i, 133443545) + << "incorrect value for last_msg_.obs[8].L.i, expected 133443545, is " + << last_msg_.obs[8].L.i; + EXPECT_EQ(last_msg_.obs[8].P, 1269673181) + << "incorrect value for last_msg_.obs[8].P, expected 1269673181, is " + << last_msg_.obs[8].P; + EXPECT_EQ(last_msg_.obs[8].cn0, 123) + << "incorrect value for last_msg_.obs[8].cn0, expected 123, is " + << last_msg_.obs[8].cn0; + EXPECT_EQ(last_msg_.obs[8].flags, 15) + << "incorrect value for last_msg_.obs[8].flags, expected 15, is " + << last_msg_.obs[8].flags; + EXPECT_EQ(last_msg_.obs[8].lock, 5) + << "incorrect value for last_msg_.obs[8].lock, expected 5, is " + << last_msg_.obs[8].lock; + EXPECT_EQ(last_msg_.obs[8].sid.code, 0) + << "incorrect value for last_msg_.obs[8].sid.code, expected 0, is " + << last_msg_.obs[8].sid.code; + EXPECT_EQ(last_msg_.obs[8].sid.sat, 31) + << "incorrect value for last_msg_.obs[8].sid.sat, expected 31, is " + << last_msg_.obs[8].sid.sat; + EXPECT_EQ(last_msg_.obs[9].D.f, 62) + << "incorrect value for last_msg_.obs[9].D.f, expected 62, is " + << last_msg_.obs[9].D.f; + EXPECT_EQ(last_msg_.obs[9].D.i, 2374) + << "incorrect value for last_msg_.obs[9].D.i, expected 2374, is " + << last_msg_.obs[9].D.i; + EXPECT_EQ(last_msg_.obs[9].L.f, 40) + << "incorrect value for last_msg_.obs[9].L.f, expected 40, is " + << last_msg_.obs[9].L.f; + EXPECT_EQ(last_msg_.obs[9].L.i, 103982040) + << "incorrect value for last_msg_.obs[9].L.i, expected 103982040, is " + << last_msg_.obs[9].L.i; + EXPECT_EQ(last_msg_.obs[9].P, 1269673722) + << "incorrect value for last_msg_.obs[9].P, expected 1269673722, is " + << last_msg_.obs[9].P; + EXPECT_EQ(last_msg_.obs[9].cn0, 120) + << "incorrect value for last_msg_.obs[9].cn0, expected 120, is " + << last_msg_.obs[9].cn0; + EXPECT_EQ(last_msg_.obs[9].flags, 11) + << "incorrect value for last_msg_.obs[9].flags, expected 11, is " + << last_msg_.obs[9].flags; + EXPECT_EQ(last_msg_.obs[9].lock, 3) + << "incorrect value for last_msg_.obs[9].lock, expected 3, is " + << last_msg_.obs[9].lock; + EXPECT_EQ(last_msg_.obs[9].sid.code, 1) + << "incorrect value for last_msg_.obs[9].sid.code, expected 1, is " + << last_msg_.obs[9].sid.code; + EXPECT_EQ(last_msg_.obs[9].sid.sat, 31) + << "incorrect value for last_msg_.obs[9].sid.sat, expected 31, is " + << last_msg_.obs[9].sid.sat; + EXPECT_EQ(last_msg_.obs[10].D.f, 96) + << "incorrect value for last_msg_.obs[10].D.f, expected 96, is " + << last_msg_.obs[10].D.f; + EXPECT_EQ(last_msg_.obs[10].D.i, -3446) + << "incorrect value for last_msg_.obs[10].D.i, expected -3446, is " + << last_msg_.obs[10].D.i; + EXPECT_EQ(last_msg_.obs[10].L.f, 7) + << "incorrect value for last_msg_.obs[10].L.f, expected 7, is " + << last_msg_.obs[10].L.f; + EXPECT_EQ(last_msg_.obs[10].L.i, 118217315) + << "incorrect value for last_msg_.obs[10].L.i, expected 118217315, is " + << last_msg_.obs[10].L.i; + EXPECT_EQ(last_msg_.obs[10].P, 1107693703) + << "incorrect value for last_msg_.obs[10].P, expected 1107693703, is " + << last_msg_.obs[10].P; + EXPECT_EQ(last_msg_.obs[10].cn0, 176) + << "incorrect value for last_msg_.obs[10].cn0, expected 176, is " + << last_msg_.obs[10].cn0; + EXPECT_EQ(last_msg_.obs[10].flags, 15) + << "incorrect value for last_msg_.obs[10].flags, expected 15, is " + << last_msg_.obs[10].flags; + EXPECT_EQ(last_msg_.obs[10].lock, 10) + << "incorrect value for last_msg_.obs[10].lock, expected 10, is " + << last_msg_.obs[10].lock; + EXPECT_EQ(last_msg_.obs[10].sid.code, 3) + << "incorrect value for last_msg_.obs[10].sid.code, expected 3, is " + << last_msg_.obs[10].sid.code; + EXPECT_EQ(last_msg_.obs[10].sid.sat, 2) + << "incorrect value for last_msg_.obs[10].sid.sat, expected 2, is " + << last_msg_.obs[10].sid.sat; + EXPECT_EQ(last_msg_.obs[11].D.f, 96) + << "incorrect value for last_msg_.obs[11].D.f, expected 96, is " + << last_msg_.obs[11].D.f; + EXPECT_EQ(last_msg_.obs[11].D.i, -1003) + << "incorrect value for last_msg_.obs[11].D.i, expected -1003, is " + << last_msg_.obs[11].D.i; + EXPECT_EQ(last_msg_.obs[11].L.f, 203) + << "incorrect value for last_msg_.obs[11].L.f, expected 203, is " + << last_msg_.obs[11].L.f; + EXPECT_EQ(last_msg_.obs[11].L.i, 104224985) + << "incorrect value for last_msg_.obs[11].L.i, expected 104224985, is " + << last_msg_.obs[11].L.i; + EXPECT_EQ(last_msg_.obs[11].P, 973505172) + << "incorrect value for last_msg_.obs[11].P, expected 973505172, is " + << last_msg_.obs[11].P; + EXPECT_EQ(last_msg_.obs[11].cn0, 170) + << "incorrect value for last_msg_.obs[11].cn0, expected 170, is " + << last_msg_.obs[11].cn0; + EXPECT_EQ(last_msg_.obs[11].flags, 15) + << "incorrect value for last_msg_.obs[11].flags, expected 15, is " + << last_msg_.obs[11].flags; + EXPECT_EQ(last_msg_.obs[11].lock, 10) + << "incorrect value for last_msg_.obs[11].lock, expected 10, is " + << last_msg_.obs[11].lock; + EXPECT_EQ(last_msg_.obs[11].sid.code, 3) + << "incorrect value for last_msg_.obs[11].sid.code, expected 3, is " + << last_msg_.obs[11].sid.code; + EXPECT_EQ(last_msg_.obs[11].sid.sat, 3) + << "incorrect value for last_msg_.obs[11].sid.sat, expected 3, is " + << last_msg_.obs[11].sid.sat; + EXPECT_EQ(last_msg_.obs[12].D.f, 219) + << "incorrect value for last_msg_.obs[12].D.f, expected 219, is " + << last_msg_.obs[12].D.f; + EXPECT_EQ(last_msg_.obs[12].D.i, -3836) + << "incorrect value for last_msg_.obs[12].D.i, expected -3836, is " + << last_msg_.obs[12].D.i; + EXPECT_EQ(last_msg_.obs[12].L.f, 80) + << "incorrect value for last_msg_.obs[12].L.f, expected 80, is " + << last_msg_.obs[12].L.f; + EXPECT_EQ(last_msg_.obs[12].L.i, 114505343) + << "incorrect value for last_msg_.obs[12].L.i, expected 114505343, is " + << last_msg_.obs[12].L.i; + EXPECT_EQ(last_msg_.obs[12].P, 1069903034) + << "incorrect value for last_msg_.obs[12].P, expected 1069903034, is " + << last_msg_.obs[12].P; + EXPECT_EQ(last_msg_.obs[12].cn0, 200) + << "incorrect value for last_msg_.obs[12].cn0, expected 200, is " + << last_msg_.obs[12].cn0; + EXPECT_EQ(last_msg_.obs[12].flags, 15) + << "incorrect value for last_msg_.obs[12].flags, expected 15, is " + << last_msg_.obs[12].flags; + EXPECT_EQ(last_msg_.obs[12].lock, 10) + << "incorrect value for last_msg_.obs[12].lock, expected 10, is " + << last_msg_.obs[12].lock; + EXPECT_EQ(last_msg_.obs[12].sid.code, 3) + << "incorrect value for last_msg_.obs[12].sid.code, expected 3, is " + << last_msg_.obs[12].sid.code; + EXPECT_EQ(last_msg_.obs[12].sid.sat, 17) + << "incorrect value for last_msg_.obs[12].sid.sat, expected 17, is " + << last_msg_.obs[12].sid.sat; + EXPECT_EQ(last_msg_.obs[13].D.f, 182) + << "incorrect value for last_msg_.obs[13].D.f, expected 182, is " + << last_msg_.obs[13].D.f; + EXPECT_EQ(last_msg_.obs[13].D.i, -461) + << "incorrect value for last_msg_.obs[13].D.i, expected -461, is " + << last_msg_.obs[13].D.i; + EXPECT_EQ(last_msg_.obs[13].L.f, 105) + << "incorrect value for last_msg_.obs[13].L.f, expected 105, is " + << last_msg_.obs[13].L.f; + EXPECT_EQ(last_msg_.obs[13].L.i, 102157331) + << "incorrect value for last_msg_.obs[13].L.i, expected 102157331, is " + << last_msg_.obs[13].L.i; + EXPECT_EQ(last_msg_.obs[13].P, 956875687) + << "incorrect value for last_msg_.obs[13].P, expected 956875687, is " + << last_msg_.obs[13].P; + EXPECT_EQ(last_msg_.obs[13].cn0, 152) + << "incorrect value for last_msg_.obs[13].cn0, expected 152, is " + << last_msg_.obs[13].cn0; + EXPECT_EQ(last_msg_.obs[13].flags, 15) + << "incorrect value for last_msg_.obs[13].flags, expected 15, is " + << last_msg_.obs[13].flags; + EXPECT_EQ(last_msg_.obs[13].lock, 10) + << "incorrect value for last_msg_.obs[13].lock, expected 10, is " + << last_msg_.obs[13].lock; + EXPECT_EQ(last_msg_.obs[13].sid.code, 3) + << "incorrect value for last_msg_.obs[13].sid.code, expected 3, is " + << last_msg_.obs[13].sid.code; + EXPECT_EQ(last_msg_.obs[13].sid.sat, 18) + << "incorrect value for last_msg_.obs[13].sid.sat, expected 18, is " + << last_msg_.obs[13].sid.sat; } -class Test_auto_check_sbp_observation_MsgObs1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgObs1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_MsgObs1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgObs1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -472,38 +779,47 @@ class Test_auto_check_sbp_observation_MsgObs1 : sbp_msg_obs_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgObs1, Test) -{ - - uint8_t encoded_frame[] = {85,74,0,129,240,11,152,202,226,25,0,0,0,0,106,8,16,201,101, }; - - sbp_msg_obs_t test_msg{}; - test_msg.header.n_obs = 16; - test_msg.header.t.ns_residual = 0; - test_msg.header.t.tow = 434293400; - test_msg.header.t.wn = 2154; - - EXPECT_EQ(send_message( 61569, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61569); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 16) << "incorrect value for last_msg_.header.n_obs, expected 16, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.ns_residual, 0) << "incorrect value for last_msg_.header.t.ns_residual, expected 0, is " << last_msg_.header.t.ns_residual; - EXPECT_EQ(last_msg_.header.t.tow, 434293400) << "incorrect value for last_msg_.header.t.tow, expected 434293400, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 2154) << "incorrect value for last_msg_.header.t.wn, expected 2154, is " << last_msg_.header.t.wn; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgObs1, Test) { + uint8_t encoded_frame[] = { + 85, 74, 0, 129, 240, 11, 152, 202, 226, 25, + 0, 0, 0, 0, 106, 8, 16, 201, 101, + }; + + sbp_msg_obs_t test_msg{}; + test_msg.header.n_obs = 16; + test_msg.header.t.ns_residual = 0; + test_msg.header.t.tow = 434293400; + test_msg.header.t.wn = 2154; + + EXPECT_EQ(send_message(61569, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61569); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 16) + << "incorrect value for last_msg_.header.n_obs, expected 16, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.ns_residual, 0) + << "incorrect value for last_msg_.header.t.ns_residual, expected 0, is " + << last_msg_.header.t.ns_residual; + EXPECT_EQ(last_msg_.header.t.tow, 434293400) + << "incorrect value for last_msg_.header.t.tow, expected 434293400, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 2154) + << "incorrect value for last_msg_.header.t.wn, expected 2154, is " + << last_msg_.header.t.wn; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgObsDepB.cc b/c/test/cpp/auto_check_sbp_observation_MsgObsDepB.cc index 59d9bb587..c6021649c 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgObsDepB.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgObsDepB.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepB.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgObsDepB0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgObsDepB0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgObsDepB0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgObsDepB0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,206 +67,322 @@ class Test_auto_check_sbp_observation_MsgObsDepB0 : sbp_msg_obs_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgObsDepB0, Test) -{ - - uint8_t encoded_frame[] = {85,67,0,246,215,103,120,46,39,0,251,6,32,180,175,187,133,223,53,7,7,27,157,0,0,202,0,0,0,58,140,85,147,88,28,190,7,175,144,0,0,203,0,0,0,220,140,248,138,208,172,77,7,135,151,0,0,208,0,0,0,173,194,72,135,115,18,28,7,242,156,0,0,212,0,0,0,164,144,105,124,18,196,137,6,120,168,0,0,217,0,0,0,30,232,228,139,210,7,90,7,87,150,0,0,218,0,0,0,169,85, }; - - sbp_msg_obs_dep_b_t test_msg{}; - test_msg.header.n_obs = 32; - test_msg.header.t.tow = 2567800; - test_msg.header.t.wn = 1787; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 6; - - test_msg.obs[0].L.f = 27; - test_msg.obs[0].L.i = 117913055; - test_msg.obs[0].P = 2243669940; - test_msg.obs[0].cn0 = 157; - test_msg.obs[0].lock = 0; - test_msg.obs[0].sid.code = 0; - test_msg.obs[0].sid.reserved = 0; - test_msg.obs[0].sid.sat = 202; - - test_msg.obs[1].L.f = 175; - test_msg.obs[1].L.i = 129899608; - test_msg.obs[1].P = 2471857210; - test_msg.obs[1].cn0 = 144; - test_msg.obs[1].lock = 0; - test_msg.obs[1].sid.code = 0; - test_msg.obs[1].sid.reserved = 0; - test_msg.obs[1].sid.sat = 203; - - test_msg.obs[2].L.f = 135; - test_msg.obs[2].L.i = 122531024; - test_msg.obs[2].P = 2331544796; - test_msg.obs[2].cn0 = 151; - test_msg.obs[2].lock = 0; - test_msg.obs[2].sid.code = 0; - test_msg.obs[2].sid.reserved = 0; - test_msg.obs[2].sid.sat = 208; - - test_msg.obs[3].L.f = 242; - test_msg.obs[3].L.i = 119280243; - test_msg.obs[3].P = 2269692589; - test_msg.obs[3].cn0 = 156; - test_msg.obs[3].lock = 0; - test_msg.obs[3].sid.code = 0; - test_msg.obs[3].sid.reserved = 0; - test_msg.obs[3].sid.sat = 212; - - test_msg.obs[4].L.f = 120; - test_msg.obs[4].L.i = 109691922; - test_msg.obs[4].P = 2087293092; - test_msg.obs[4].cn0 = 168; - test_msg.obs[4].lock = 0; - test_msg.obs[4].sid.code = 0; - test_msg.obs[4].sid.reserved = 0; - test_msg.obs[4].sid.sat = 217; - - test_msg.obs[5].L.f = 87; - test_msg.obs[5].L.i = 123340754; - test_msg.obs[5].P = 2347034654; - test_msg.obs[5].cn0 = 150; - test_msg.obs[5].lock = 0; - test_msg.obs[5].sid.code = 0; - test_msg.obs[5].sid.reserved = 0; - test_msg.obs[5].sid.sat = 218; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 32) << "incorrect value for last_msg_.header.n_obs, expected 32, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 2567800) << "incorrect value for last_msg_.header.t.tow, expected 2567800, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1787) << "incorrect value for last_msg_.header.t.wn, expected 1787, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 6) << "incorrect value for last_msg_.n_obs.value, expected 6, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 27) << "incorrect value for last_msg_.obs[0].L.f, expected 27, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, 117913055) << "incorrect value for last_msg_.obs[0].L.i, expected 117913055, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 2243669940) << "incorrect value for last_msg_.obs[0].P, expected 2243669940, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 157) << "incorrect value for last_msg_.obs[0].cn0, expected 157, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 0) << "incorrect value for last_msg_.obs[0].lock, expected 0, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].sid.code, 0) << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " << last_msg_.obs[0].sid.code; - EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " << last_msg_.obs[0].sid.reserved; - EXPECT_EQ(last_msg_.obs[0].sid.sat, 202) << "incorrect value for last_msg_.obs[0].sid.sat, expected 202, is " << last_msg_.obs[0].sid.sat; - EXPECT_EQ(last_msg_.obs[1].L.f, 175) << "incorrect value for last_msg_.obs[1].L.f, expected 175, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, 129899608) << "incorrect value for last_msg_.obs[1].L.i, expected 129899608, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 2471857210) << "incorrect value for last_msg_.obs[1].P, expected 2471857210, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].cn0, 144) << "incorrect value for last_msg_.obs[1].cn0, expected 144, is " << last_msg_.obs[1].cn0; - EXPECT_EQ(last_msg_.obs[1].lock, 0) << "incorrect value for last_msg_.obs[1].lock, expected 0, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].sid.code, 0) << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " << last_msg_.obs[1].sid.code; - EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " << last_msg_.obs[1].sid.reserved; - EXPECT_EQ(last_msg_.obs[1].sid.sat, 203) << "incorrect value for last_msg_.obs[1].sid.sat, expected 203, is " << last_msg_.obs[1].sid.sat; - EXPECT_EQ(last_msg_.obs[2].L.f, 135) << "incorrect value for last_msg_.obs[2].L.f, expected 135, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, 122531024) << "incorrect value for last_msg_.obs[2].L.i, expected 122531024, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 2331544796) << "incorrect value for last_msg_.obs[2].P, expected 2331544796, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].cn0, 151) << "incorrect value for last_msg_.obs[2].cn0, expected 151, is " << last_msg_.obs[2].cn0; - EXPECT_EQ(last_msg_.obs[2].lock, 0) << "incorrect value for last_msg_.obs[2].lock, expected 0, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].sid.code, 0) << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " << last_msg_.obs[2].sid.code; - EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " << last_msg_.obs[2].sid.reserved; - EXPECT_EQ(last_msg_.obs[2].sid.sat, 208) << "incorrect value for last_msg_.obs[2].sid.sat, expected 208, is " << last_msg_.obs[2].sid.sat; - EXPECT_EQ(last_msg_.obs[3].L.f, 242) << "incorrect value for last_msg_.obs[3].L.f, expected 242, is " << last_msg_.obs[3].L.f; - EXPECT_EQ(last_msg_.obs[3].L.i, 119280243) << "incorrect value for last_msg_.obs[3].L.i, expected 119280243, is " << last_msg_.obs[3].L.i; - EXPECT_EQ(last_msg_.obs[3].P, 2269692589) << "incorrect value for last_msg_.obs[3].P, expected 2269692589, is " << last_msg_.obs[3].P; - EXPECT_EQ(last_msg_.obs[3].cn0, 156) << "incorrect value for last_msg_.obs[3].cn0, expected 156, is " << last_msg_.obs[3].cn0; - EXPECT_EQ(last_msg_.obs[3].lock, 0) << "incorrect value for last_msg_.obs[3].lock, expected 0, is " << last_msg_.obs[3].lock; - EXPECT_EQ(last_msg_.obs[3].sid.code, 0) << "incorrect value for last_msg_.obs[3].sid.code, expected 0, is " << last_msg_.obs[3].sid.code; - EXPECT_EQ(last_msg_.obs[3].sid.reserved, 0) << "incorrect value for last_msg_.obs[3].sid.reserved, expected 0, is " << last_msg_.obs[3].sid.reserved; - EXPECT_EQ(last_msg_.obs[3].sid.sat, 212) << "incorrect value for last_msg_.obs[3].sid.sat, expected 212, is " << last_msg_.obs[3].sid.sat; - EXPECT_EQ(last_msg_.obs[4].L.f, 120) << "incorrect value for last_msg_.obs[4].L.f, expected 120, is " << last_msg_.obs[4].L.f; - EXPECT_EQ(last_msg_.obs[4].L.i, 109691922) << "incorrect value for last_msg_.obs[4].L.i, expected 109691922, is " << last_msg_.obs[4].L.i; - EXPECT_EQ(last_msg_.obs[4].P, 2087293092) << "incorrect value for last_msg_.obs[4].P, expected 2087293092, is " << last_msg_.obs[4].P; - EXPECT_EQ(last_msg_.obs[4].cn0, 168) << "incorrect value for last_msg_.obs[4].cn0, expected 168, is " << last_msg_.obs[4].cn0; - EXPECT_EQ(last_msg_.obs[4].lock, 0) << "incorrect value for last_msg_.obs[4].lock, expected 0, is " << last_msg_.obs[4].lock; - EXPECT_EQ(last_msg_.obs[4].sid.code, 0) << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " << last_msg_.obs[4].sid.code; - EXPECT_EQ(last_msg_.obs[4].sid.reserved, 0) << "incorrect value for last_msg_.obs[4].sid.reserved, expected 0, is " << last_msg_.obs[4].sid.reserved; - EXPECT_EQ(last_msg_.obs[4].sid.sat, 217) << "incorrect value for last_msg_.obs[4].sid.sat, expected 217, is " << last_msg_.obs[4].sid.sat; - EXPECT_EQ(last_msg_.obs[5].L.f, 87) << "incorrect value for last_msg_.obs[5].L.f, expected 87, is " << last_msg_.obs[5].L.f; - EXPECT_EQ(last_msg_.obs[5].L.i, 123340754) << "incorrect value for last_msg_.obs[5].L.i, expected 123340754, is " << last_msg_.obs[5].L.i; - EXPECT_EQ(last_msg_.obs[5].P, 2347034654) << "incorrect value for last_msg_.obs[5].P, expected 2347034654, is " << last_msg_.obs[5].P; - EXPECT_EQ(last_msg_.obs[5].cn0, 150) << "incorrect value for last_msg_.obs[5].cn0, expected 150, is " << last_msg_.obs[5].cn0; - EXPECT_EQ(last_msg_.obs[5].lock, 0) << "incorrect value for last_msg_.obs[5].lock, expected 0, is " << last_msg_.obs[5].lock; - EXPECT_EQ(last_msg_.obs[5].sid.code, 0) << "incorrect value for last_msg_.obs[5].sid.code, expected 0, is " << last_msg_.obs[5].sid.code; - EXPECT_EQ(last_msg_.obs[5].sid.reserved, 0) << "incorrect value for last_msg_.obs[5].sid.reserved, expected 0, is " << last_msg_.obs[5].sid.reserved; - EXPECT_EQ(last_msg_.obs[5].sid.sat, 218) << "incorrect value for last_msg_.obs[5].sid.sat, expected 218, is " << last_msg_.obs[5].sid.sat; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgObsDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 67, 0, 246, 215, 103, 120, 46, 39, 0, 251, 6, 32, 180, 175, 187, + 133, 223, 53, 7, 7, 27, 157, 0, 0, 202, 0, 0, 0, 58, 140, 85, + 147, 88, 28, 190, 7, 175, 144, 0, 0, 203, 0, 0, 0, 220, 140, 248, + 138, 208, 172, 77, 7, 135, 151, 0, 0, 208, 0, 0, 0, 173, 194, 72, + 135, 115, 18, 28, 7, 242, 156, 0, 0, 212, 0, 0, 0, 164, 144, 105, + 124, 18, 196, 137, 6, 120, 168, 0, 0, 217, 0, 0, 0, 30, 232, 228, + 139, 210, 7, 90, 7, 87, 150, 0, 0, 218, 0, 0, 0, 169, 85, + }; + + sbp_msg_obs_dep_b_t test_msg{}; + test_msg.header.n_obs = 32; + test_msg.header.t.tow = 2567800; + test_msg.header.t.wn = 1787; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 6; + + test_msg.obs[0].L.f = 27; + test_msg.obs[0].L.i = 117913055; + test_msg.obs[0].P = 2243669940; + test_msg.obs[0].cn0 = 157; + test_msg.obs[0].lock = 0; + test_msg.obs[0].sid.code = 0; + test_msg.obs[0].sid.reserved = 0; + test_msg.obs[0].sid.sat = 202; + + test_msg.obs[1].L.f = 175; + test_msg.obs[1].L.i = 129899608; + test_msg.obs[1].P = 2471857210; + test_msg.obs[1].cn0 = 144; + test_msg.obs[1].lock = 0; + test_msg.obs[1].sid.code = 0; + test_msg.obs[1].sid.reserved = 0; + test_msg.obs[1].sid.sat = 203; + + test_msg.obs[2].L.f = 135; + test_msg.obs[2].L.i = 122531024; + test_msg.obs[2].P = 2331544796; + test_msg.obs[2].cn0 = 151; + test_msg.obs[2].lock = 0; + test_msg.obs[2].sid.code = 0; + test_msg.obs[2].sid.reserved = 0; + test_msg.obs[2].sid.sat = 208; + + test_msg.obs[3].L.f = 242; + test_msg.obs[3].L.i = 119280243; + test_msg.obs[3].P = 2269692589; + test_msg.obs[3].cn0 = 156; + test_msg.obs[3].lock = 0; + test_msg.obs[3].sid.code = 0; + test_msg.obs[3].sid.reserved = 0; + test_msg.obs[3].sid.sat = 212; + + test_msg.obs[4].L.f = 120; + test_msg.obs[4].L.i = 109691922; + test_msg.obs[4].P = 2087293092; + test_msg.obs[4].cn0 = 168; + test_msg.obs[4].lock = 0; + test_msg.obs[4].sid.code = 0; + test_msg.obs[4].sid.reserved = 0; + test_msg.obs[4].sid.sat = 217; + + test_msg.obs[5].L.f = 87; + test_msg.obs[5].L.i = 123340754; + test_msg.obs[5].P = 2347034654; + test_msg.obs[5].cn0 = 150; + test_msg.obs[5].lock = 0; + test_msg.obs[5].sid.code = 0; + test_msg.obs[5].sid.reserved = 0; + test_msg.obs[5].sid.sat = 218; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 32) + << "incorrect value for last_msg_.header.n_obs, expected 32, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 2567800) + << "incorrect value for last_msg_.header.t.tow, expected 2567800, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1787) + << "incorrect value for last_msg_.header.t.wn, expected 1787, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 6) + << "incorrect value for last_msg_.n_obs.value, expected 6, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 27) + << "incorrect value for last_msg_.obs[0].L.f, expected 27, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, 117913055) + << "incorrect value for last_msg_.obs[0].L.i, expected 117913055, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 2243669940) + << "incorrect value for last_msg_.obs[0].P, expected 2243669940, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 157) + << "incorrect value for last_msg_.obs[0].cn0, expected 157, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 0) + << "incorrect value for last_msg_.obs[0].lock, expected 0, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].sid.code, 0) + << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " + << last_msg_.obs[0].sid.code; + EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) + << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " + << last_msg_.obs[0].sid.reserved; + EXPECT_EQ(last_msg_.obs[0].sid.sat, 202) + << "incorrect value for last_msg_.obs[0].sid.sat, expected 202, is " + << last_msg_.obs[0].sid.sat; + EXPECT_EQ(last_msg_.obs[1].L.f, 175) + << "incorrect value for last_msg_.obs[1].L.f, expected 175, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, 129899608) + << "incorrect value for last_msg_.obs[1].L.i, expected 129899608, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 2471857210) + << "incorrect value for last_msg_.obs[1].P, expected 2471857210, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].cn0, 144) + << "incorrect value for last_msg_.obs[1].cn0, expected 144, is " + << last_msg_.obs[1].cn0; + EXPECT_EQ(last_msg_.obs[1].lock, 0) + << "incorrect value for last_msg_.obs[1].lock, expected 0, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].sid.code, 0) + << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " + << last_msg_.obs[1].sid.code; + EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) + << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " + << last_msg_.obs[1].sid.reserved; + EXPECT_EQ(last_msg_.obs[1].sid.sat, 203) + << "incorrect value for last_msg_.obs[1].sid.sat, expected 203, is " + << last_msg_.obs[1].sid.sat; + EXPECT_EQ(last_msg_.obs[2].L.f, 135) + << "incorrect value for last_msg_.obs[2].L.f, expected 135, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, 122531024) + << "incorrect value for last_msg_.obs[2].L.i, expected 122531024, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 2331544796) + << "incorrect value for last_msg_.obs[2].P, expected 2331544796, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].cn0, 151) + << "incorrect value for last_msg_.obs[2].cn0, expected 151, is " + << last_msg_.obs[2].cn0; + EXPECT_EQ(last_msg_.obs[2].lock, 0) + << "incorrect value for last_msg_.obs[2].lock, expected 0, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].sid.code, 0) + << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " + << last_msg_.obs[2].sid.code; + EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) + << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " + << last_msg_.obs[2].sid.reserved; + EXPECT_EQ(last_msg_.obs[2].sid.sat, 208) + << "incorrect value for last_msg_.obs[2].sid.sat, expected 208, is " + << last_msg_.obs[2].sid.sat; + EXPECT_EQ(last_msg_.obs[3].L.f, 242) + << "incorrect value for last_msg_.obs[3].L.f, expected 242, is " + << last_msg_.obs[3].L.f; + EXPECT_EQ(last_msg_.obs[3].L.i, 119280243) + << "incorrect value for last_msg_.obs[3].L.i, expected 119280243, is " + << last_msg_.obs[3].L.i; + EXPECT_EQ(last_msg_.obs[3].P, 2269692589) + << "incorrect value for last_msg_.obs[3].P, expected 2269692589, is " + << last_msg_.obs[3].P; + EXPECT_EQ(last_msg_.obs[3].cn0, 156) + << "incorrect value for last_msg_.obs[3].cn0, expected 156, is " + << last_msg_.obs[3].cn0; + EXPECT_EQ(last_msg_.obs[3].lock, 0) + << "incorrect value for last_msg_.obs[3].lock, expected 0, is " + << last_msg_.obs[3].lock; + EXPECT_EQ(last_msg_.obs[3].sid.code, 0) + << "incorrect value for last_msg_.obs[3].sid.code, expected 0, is " + << last_msg_.obs[3].sid.code; + EXPECT_EQ(last_msg_.obs[3].sid.reserved, 0) + << "incorrect value for last_msg_.obs[3].sid.reserved, expected 0, is " + << last_msg_.obs[3].sid.reserved; + EXPECT_EQ(last_msg_.obs[3].sid.sat, 212) + << "incorrect value for last_msg_.obs[3].sid.sat, expected 212, is " + << last_msg_.obs[3].sid.sat; + EXPECT_EQ(last_msg_.obs[4].L.f, 120) + << "incorrect value for last_msg_.obs[4].L.f, expected 120, is " + << last_msg_.obs[4].L.f; + EXPECT_EQ(last_msg_.obs[4].L.i, 109691922) + << "incorrect value for last_msg_.obs[4].L.i, expected 109691922, is " + << last_msg_.obs[4].L.i; + EXPECT_EQ(last_msg_.obs[4].P, 2087293092) + << "incorrect value for last_msg_.obs[4].P, expected 2087293092, is " + << last_msg_.obs[4].P; + EXPECT_EQ(last_msg_.obs[4].cn0, 168) + << "incorrect value for last_msg_.obs[4].cn0, expected 168, is " + << last_msg_.obs[4].cn0; + EXPECT_EQ(last_msg_.obs[4].lock, 0) + << "incorrect value for last_msg_.obs[4].lock, expected 0, is " + << last_msg_.obs[4].lock; + EXPECT_EQ(last_msg_.obs[4].sid.code, 0) + << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " + << last_msg_.obs[4].sid.code; + EXPECT_EQ(last_msg_.obs[4].sid.reserved, 0) + << "incorrect value for last_msg_.obs[4].sid.reserved, expected 0, is " + << last_msg_.obs[4].sid.reserved; + EXPECT_EQ(last_msg_.obs[4].sid.sat, 217) + << "incorrect value for last_msg_.obs[4].sid.sat, expected 217, is " + << last_msg_.obs[4].sid.sat; + EXPECT_EQ(last_msg_.obs[5].L.f, 87) + << "incorrect value for last_msg_.obs[5].L.f, expected 87, is " + << last_msg_.obs[5].L.f; + EXPECT_EQ(last_msg_.obs[5].L.i, 123340754) + << "incorrect value for last_msg_.obs[5].L.i, expected 123340754, is " + << last_msg_.obs[5].L.i; + EXPECT_EQ(last_msg_.obs[5].P, 2347034654) + << "incorrect value for last_msg_.obs[5].P, expected 2347034654, is " + << last_msg_.obs[5].P; + EXPECT_EQ(last_msg_.obs[5].cn0, 150) + << "incorrect value for last_msg_.obs[5].cn0, expected 150, is " + << last_msg_.obs[5].cn0; + EXPECT_EQ(last_msg_.obs[5].lock, 0) + << "incorrect value for last_msg_.obs[5].lock, expected 0, is " + << last_msg_.obs[5].lock; + EXPECT_EQ(last_msg_.obs[5].sid.code, 0) + << "incorrect value for last_msg_.obs[5].sid.code, expected 0, is " + << last_msg_.obs[5].sid.code; + EXPECT_EQ(last_msg_.obs[5].sid.reserved, 0) + << "incorrect value for last_msg_.obs[5].sid.reserved, expected 0, is " + << last_msg_.obs[5].sid.reserved; + EXPECT_EQ(last_msg_.obs[5].sid.sat, 218) + << "incorrect value for last_msg_.obs[5].sid.sat, expected 218, is " + << last_msg_.obs[5].sid.sat; } -class Test_auto_check_sbp_observation_MsgObsDepB1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgObsDepB1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_MsgObsDepB1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgObsDepB1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -278,155 +390,220 @@ class Test_auto_check_sbp_observation_MsgObsDepB1 : sbp_msg_obs_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgObsDepB1, Test) -{ - - uint8_t encoded_frame[] = {85,67,0,246,215,55,120,46,39,0,251,6,33,68,199,101,136,133,247,42,7,219,154,0,0,220,0,0,0,219,14,123,133,96,215,3,7,235,156,0,0,222,0,0,0,87,166,81,122,5,173,109,6,174,170,0,0,225,0,0,0,11,233, }; - - sbp_msg_obs_dep_b_t test_msg{}; - test_msg.header.n_obs = 33; - test_msg.header.t.tow = 2567800; - test_msg.header.t.wn = 1787; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 3; - - test_msg.obs[0].L.f = 219; - test_msg.obs[0].L.i = 120256389; - test_msg.obs[0].P = 2288371524; - test_msg.obs[0].cn0 = 154; - test_msg.obs[0].lock = 0; - test_msg.obs[0].sid.code = 0; - test_msg.obs[0].sid.reserved = 0; - test_msg.obs[0].sid.sat = 220; - - test_msg.obs[1].L.f = 235; - test_msg.obs[1].L.i = 117692256; - test_msg.obs[1].P = 2239434459; - test_msg.obs[1].cn0 = 156; - test_msg.obs[1].lock = 0; - test_msg.obs[1].sid.code = 0; - test_msg.obs[1].sid.reserved = 0; - test_msg.obs[1].sid.sat = 222; - - test_msg.obs[2].L.f = 174; - test_msg.obs[2].L.i = 107851013; - test_msg.obs[2].P = 2052171351; - test_msg.obs[2].cn0 = 170; - test_msg.obs[2].lock = 0; - test_msg.obs[2].sid.code = 0; - test_msg.obs[2].sid.reserved = 0; - test_msg.obs[2].sid.sat = 225; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 33) << "incorrect value for last_msg_.header.n_obs, expected 33, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 2567800) << "incorrect value for last_msg_.header.t.tow, expected 2567800, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1787) << "incorrect value for last_msg_.header.t.wn, expected 1787, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 3) << "incorrect value for last_msg_.n_obs.value, expected 3, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 219) << "incorrect value for last_msg_.obs[0].L.f, expected 219, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, 120256389) << "incorrect value for last_msg_.obs[0].L.i, expected 120256389, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 2288371524) << "incorrect value for last_msg_.obs[0].P, expected 2288371524, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 154) << "incorrect value for last_msg_.obs[0].cn0, expected 154, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 0) << "incorrect value for last_msg_.obs[0].lock, expected 0, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].sid.code, 0) << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " << last_msg_.obs[0].sid.code; - EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " << last_msg_.obs[0].sid.reserved; - EXPECT_EQ(last_msg_.obs[0].sid.sat, 220) << "incorrect value for last_msg_.obs[0].sid.sat, expected 220, is " << last_msg_.obs[0].sid.sat; - EXPECT_EQ(last_msg_.obs[1].L.f, 235) << "incorrect value for last_msg_.obs[1].L.f, expected 235, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, 117692256) << "incorrect value for last_msg_.obs[1].L.i, expected 117692256, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 2239434459) << "incorrect value for last_msg_.obs[1].P, expected 2239434459, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].cn0, 156) << "incorrect value for last_msg_.obs[1].cn0, expected 156, is " << last_msg_.obs[1].cn0; - EXPECT_EQ(last_msg_.obs[1].lock, 0) << "incorrect value for last_msg_.obs[1].lock, expected 0, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].sid.code, 0) << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " << last_msg_.obs[1].sid.code; - EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " << last_msg_.obs[1].sid.reserved; - EXPECT_EQ(last_msg_.obs[1].sid.sat, 222) << "incorrect value for last_msg_.obs[1].sid.sat, expected 222, is " << last_msg_.obs[1].sid.sat; - EXPECT_EQ(last_msg_.obs[2].L.f, 174) << "incorrect value for last_msg_.obs[2].L.f, expected 174, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, 107851013) << "incorrect value for last_msg_.obs[2].L.i, expected 107851013, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 2052171351) << "incorrect value for last_msg_.obs[2].P, expected 2052171351, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].cn0, 170) << "incorrect value for last_msg_.obs[2].cn0, expected 170, is " << last_msg_.obs[2].cn0; - EXPECT_EQ(last_msg_.obs[2].lock, 0) << "incorrect value for last_msg_.obs[2].lock, expected 0, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].sid.code, 0) << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " << last_msg_.obs[2].sid.code; - EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " << last_msg_.obs[2].sid.reserved; - EXPECT_EQ(last_msg_.obs[2].sid.sat, 225) << "incorrect value for last_msg_.obs[2].sid.sat, expected 225, is " << last_msg_.obs[2].sid.sat; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgObsDepB1, Test) { + uint8_t encoded_frame[] = { + 85, 67, 0, 246, 215, 55, 120, 46, 39, 0, 251, 6, 33, 68, 199, 101, + 136, 133, 247, 42, 7, 219, 154, 0, 0, 220, 0, 0, 0, 219, 14, 123, + 133, 96, 215, 3, 7, 235, 156, 0, 0, 222, 0, 0, 0, 87, 166, 81, + 122, 5, 173, 109, 6, 174, 170, 0, 0, 225, 0, 0, 0, 11, 233, + }; + + sbp_msg_obs_dep_b_t test_msg{}; + test_msg.header.n_obs = 33; + test_msg.header.t.tow = 2567800; + test_msg.header.t.wn = 1787; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 3; + + test_msg.obs[0].L.f = 219; + test_msg.obs[0].L.i = 120256389; + test_msg.obs[0].P = 2288371524; + test_msg.obs[0].cn0 = 154; + test_msg.obs[0].lock = 0; + test_msg.obs[0].sid.code = 0; + test_msg.obs[0].sid.reserved = 0; + test_msg.obs[0].sid.sat = 220; + + test_msg.obs[1].L.f = 235; + test_msg.obs[1].L.i = 117692256; + test_msg.obs[1].P = 2239434459; + test_msg.obs[1].cn0 = 156; + test_msg.obs[1].lock = 0; + test_msg.obs[1].sid.code = 0; + test_msg.obs[1].sid.reserved = 0; + test_msg.obs[1].sid.sat = 222; + + test_msg.obs[2].L.f = 174; + test_msg.obs[2].L.i = 107851013; + test_msg.obs[2].P = 2052171351; + test_msg.obs[2].cn0 = 170; + test_msg.obs[2].lock = 0; + test_msg.obs[2].sid.code = 0; + test_msg.obs[2].sid.reserved = 0; + test_msg.obs[2].sid.sat = 225; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 33) + << "incorrect value for last_msg_.header.n_obs, expected 33, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 2567800) + << "incorrect value for last_msg_.header.t.tow, expected 2567800, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1787) + << "incorrect value for last_msg_.header.t.wn, expected 1787, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 3) + << "incorrect value for last_msg_.n_obs.value, expected 3, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 219) + << "incorrect value for last_msg_.obs[0].L.f, expected 219, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, 120256389) + << "incorrect value for last_msg_.obs[0].L.i, expected 120256389, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 2288371524) + << "incorrect value for last_msg_.obs[0].P, expected 2288371524, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 154) + << "incorrect value for last_msg_.obs[0].cn0, expected 154, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 0) + << "incorrect value for last_msg_.obs[0].lock, expected 0, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].sid.code, 0) + << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " + << last_msg_.obs[0].sid.code; + EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) + << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " + << last_msg_.obs[0].sid.reserved; + EXPECT_EQ(last_msg_.obs[0].sid.sat, 220) + << "incorrect value for last_msg_.obs[0].sid.sat, expected 220, is " + << last_msg_.obs[0].sid.sat; + EXPECT_EQ(last_msg_.obs[1].L.f, 235) + << "incorrect value for last_msg_.obs[1].L.f, expected 235, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, 117692256) + << "incorrect value for last_msg_.obs[1].L.i, expected 117692256, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 2239434459) + << "incorrect value for last_msg_.obs[1].P, expected 2239434459, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].cn0, 156) + << "incorrect value for last_msg_.obs[1].cn0, expected 156, is " + << last_msg_.obs[1].cn0; + EXPECT_EQ(last_msg_.obs[1].lock, 0) + << "incorrect value for last_msg_.obs[1].lock, expected 0, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].sid.code, 0) + << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " + << last_msg_.obs[1].sid.code; + EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) + << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " + << last_msg_.obs[1].sid.reserved; + EXPECT_EQ(last_msg_.obs[1].sid.sat, 222) + << "incorrect value for last_msg_.obs[1].sid.sat, expected 222, is " + << last_msg_.obs[1].sid.sat; + EXPECT_EQ(last_msg_.obs[2].L.f, 174) + << "incorrect value for last_msg_.obs[2].L.f, expected 174, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, 107851013) + << "incorrect value for last_msg_.obs[2].L.i, expected 107851013, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 2052171351) + << "incorrect value for last_msg_.obs[2].P, expected 2052171351, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].cn0, 170) + << "incorrect value for last_msg_.obs[2].cn0, expected 170, is " + << last_msg_.obs[2].cn0; + EXPECT_EQ(last_msg_.obs[2].lock, 0) + << "incorrect value for last_msg_.obs[2].lock, expected 0, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].sid.code, 0) + << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " + << last_msg_.obs[2].sid.code; + EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) + << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " + << last_msg_.obs[2].sid.reserved; + EXPECT_EQ(last_msg_.obs[2].sid.sat, 225) + << "incorrect value for last_msg_.obs[2].sid.sat, expected 225, is " + << last_msg_.obs[2].sid.sat; } -class Test_auto_check_sbp_observation_MsgObsDepB2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgObsDepB2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_MsgObsDepB2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgObsDepB2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -434,206 +611,322 @@ class Test_auto_check_sbp_observation_MsgObsDepB2 : sbp_msg_obs_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgObsDepB2, Test) -{ - - uint8_t encoded_frame[] = {85,67,0,246,215,103,64,47,39,0,251,6,32,100,132,187,133,236,51,7,7,94,156,0,0,202,0,0,0,97,184,85,147,178,30,190,7,40,140,0,0,203,0,0,0,135,111,248,138,90,171,77,7,2,150,0,0,208,0,0,0,180,238,72,135,190,20,28,7,241,155,0,0,212,0,0,0,15,153,105,124,92,196,137,6,153,168,0,0,217,0,0,0,49,185,228,139,144,5,90,7,41,150,0,0,218,0,0,0,241,98, }; - - sbp_msg_obs_dep_b_t test_msg{}; - test_msg.header.n_obs = 32; - test_msg.header.t.tow = 2568000; - test_msg.header.t.wn = 1787; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 6; - - test_msg.obs[0].L.f = 94; - test_msg.obs[0].L.i = 117912556; - test_msg.obs[0].P = 2243658852; - test_msg.obs[0].cn0 = 156; - test_msg.obs[0].lock = 0; - test_msg.obs[0].sid.code = 0; - test_msg.obs[0].sid.reserved = 0; - test_msg.obs[0].sid.sat = 202; - - test_msg.obs[1].L.f = 40; - test_msg.obs[1].L.i = 129900210; - test_msg.obs[1].P = 2471868513; - test_msg.obs[1].cn0 = 140; - test_msg.obs[1].lock = 0; - test_msg.obs[1].sid.code = 0; - test_msg.obs[1].sid.reserved = 0; - test_msg.obs[1].sid.sat = 203; - - test_msg.obs[2].L.f = 2; - test_msg.obs[2].L.i = 122530650; - test_msg.obs[2].P = 2331537287; - test_msg.obs[2].cn0 = 150; - test_msg.obs[2].lock = 0; - test_msg.obs[2].sid.code = 0; - test_msg.obs[2].sid.reserved = 0; - test_msg.obs[2].sid.sat = 208; - - test_msg.obs[3].L.f = 241; - test_msg.obs[3].L.i = 119280830; - test_msg.obs[3].P = 2269703860; - test_msg.obs[3].cn0 = 155; - test_msg.obs[3].lock = 0; - test_msg.obs[3].sid.code = 0; - test_msg.obs[3].sid.reserved = 0; - test_msg.obs[3].sid.sat = 212; - - test_msg.obs[4].L.f = 153; - test_msg.obs[4].L.i = 109691996; - test_msg.obs[4].P = 2087295247; - test_msg.obs[4].cn0 = 168; - test_msg.obs[4].lock = 0; - test_msg.obs[4].sid.code = 0; - test_msg.obs[4].sid.reserved = 0; - test_msg.obs[4].sid.sat = 217; - - test_msg.obs[5].L.f = 41; - test_msg.obs[5].L.i = 123340176; - test_msg.obs[5].P = 2347022641; - test_msg.obs[5].cn0 = 150; - test_msg.obs[5].lock = 0; - test_msg.obs[5].sid.code = 0; - test_msg.obs[5].sid.reserved = 0; - test_msg.obs[5].sid.sat = 218; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 32) << "incorrect value for last_msg_.header.n_obs, expected 32, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 2568000) << "incorrect value for last_msg_.header.t.tow, expected 2568000, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1787) << "incorrect value for last_msg_.header.t.wn, expected 1787, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 6) << "incorrect value for last_msg_.n_obs.value, expected 6, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 94) << "incorrect value for last_msg_.obs[0].L.f, expected 94, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, 117912556) << "incorrect value for last_msg_.obs[0].L.i, expected 117912556, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 2243658852) << "incorrect value for last_msg_.obs[0].P, expected 2243658852, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 156) << "incorrect value for last_msg_.obs[0].cn0, expected 156, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 0) << "incorrect value for last_msg_.obs[0].lock, expected 0, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].sid.code, 0) << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " << last_msg_.obs[0].sid.code; - EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " << last_msg_.obs[0].sid.reserved; - EXPECT_EQ(last_msg_.obs[0].sid.sat, 202) << "incorrect value for last_msg_.obs[0].sid.sat, expected 202, is " << last_msg_.obs[0].sid.sat; - EXPECT_EQ(last_msg_.obs[1].L.f, 40) << "incorrect value for last_msg_.obs[1].L.f, expected 40, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, 129900210) << "incorrect value for last_msg_.obs[1].L.i, expected 129900210, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 2471868513) << "incorrect value for last_msg_.obs[1].P, expected 2471868513, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].cn0, 140) << "incorrect value for last_msg_.obs[1].cn0, expected 140, is " << last_msg_.obs[1].cn0; - EXPECT_EQ(last_msg_.obs[1].lock, 0) << "incorrect value for last_msg_.obs[1].lock, expected 0, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].sid.code, 0) << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " << last_msg_.obs[1].sid.code; - EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " << last_msg_.obs[1].sid.reserved; - EXPECT_EQ(last_msg_.obs[1].sid.sat, 203) << "incorrect value for last_msg_.obs[1].sid.sat, expected 203, is " << last_msg_.obs[1].sid.sat; - EXPECT_EQ(last_msg_.obs[2].L.f, 2) << "incorrect value for last_msg_.obs[2].L.f, expected 2, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, 122530650) << "incorrect value for last_msg_.obs[2].L.i, expected 122530650, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 2331537287) << "incorrect value for last_msg_.obs[2].P, expected 2331537287, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].cn0, 150) << "incorrect value for last_msg_.obs[2].cn0, expected 150, is " << last_msg_.obs[2].cn0; - EXPECT_EQ(last_msg_.obs[2].lock, 0) << "incorrect value for last_msg_.obs[2].lock, expected 0, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].sid.code, 0) << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " << last_msg_.obs[2].sid.code; - EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " << last_msg_.obs[2].sid.reserved; - EXPECT_EQ(last_msg_.obs[2].sid.sat, 208) << "incorrect value for last_msg_.obs[2].sid.sat, expected 208, is " << last_msg_.obs[2].sid.sat; - EXPECT_EQ(last_msg_.obs[3].L.f, 241) << "incorrect value for last_msg_.obs[3].L.f, expected 241, is " << last_msg_.obs[3].L.f; - EXPECT_EQ(last_msg_.obs[3].L.i, 119280830) << "incorrect value for last_msg_.obs[3].L.i, expected 119280830, is " << last_msg_.obs[3].L.i; - EXPECT_EQ(last_msg_.obs[3].P, 2269703860) << "incorrect value for last_msg_.obs[3].P, expected 2269703860, is " << last_msg_.obs[3].P; - EXPECT_EQ(last_msg_.obs[3].cn0, 155) << "incorrect value for last_msg_.obs[3].cn0, expected 155, is " << last_msg_.obs[3].cn0; - EXPECT_EQ(last_msg_.obs[3].lock, 0) << "incorrect value for last_msg_.obs[3].lock, expected 0, is " << last_msg_.obs[3].lock; - EXPECT_EQ(last_msg_.obs[3].sid.code, 0) << "incorrect value for last_msg_.obs[3].sid.code, expected 0, is " << last_msg_.obs[3].sid.code; - EXPECT_EQ(last_msg_.obs[3].sid.reserved, 0) << "incorrect value for last_msg_.obs[3].sid.reserved, expected 0, is " << last_msg_.obs[3].sid.reserved; - EXPECT_EQ(last_msg_.obs[3].sid.sat, 212) << "incorrect value for last_msg_.obs[3].sid.sat, expected 212, is " << last_msg_.obs[3].sid.sat; - EXPECT_EQ(last_msg_.obs[4].L.f, 153) << "incorrect value for last_msg_.obs[4].L.f, expected 153, is " << last_msg_.obs[4].L.f; - EXPECT_EQ(last_msg_.obs[4].L.i, 109691996) << "incorrect value for last_msg_.obs[4].L.i, expected 109691996, is " << last_msg_.obs[4].L.i; - EXPECT_EQ(last_msg_.obs[4].P, 2087295247) << "incorrect value for last_msg_.obs[4].P, expected 2087295247, is " << last_msg_.obs[4].P; - EXPECT_EQ(last_msg_.obs[4].cn0, 168) << "incorrect value for last_msg_.obs[4].cn0, expected 168, is " << last_msg_.obs[4].cn0; - EXPECT_EQ(last_msg_.obs[4].lock, 0) << "incorrect value for last_msg_.obs[4].lock, expected 0, is " << last_msg_.obs[4].lock; - EXPECT_EQ(last_msg_.obs[4].sid.code, 0) << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " << last_msg_.obs[4].sid.code; - EXPECT_EQ(last_msg_.obs[4].sid.reserved, 0) << "incorrect value for last_msg_.obs[4].sid.reserved, expected 0, is " << last_msg_.obs[4].sid.reserved; - EXPECT_EQ(last_msg_.obs[4].sid.sat, 217) << "incorrect value for last_msg_.obs[4].sid.sat, expected 217, is " << last_msg_.obs[4].sid.sat; - EXPECT_EQ(last_msg_.obs[5].L.f, 41) << "incorrect value for last_msg_.obs[5].L.f, expected 41, is " << last_msg_.obs[5].L.f; - EXPECT_EQ(last_msg_.obs[5].L.i, 123340176) << "incorrect value for last_msg_.obs[5].L.i, expected 123340176, is " << last_msg_.obs[5].L.i; - EXPECT_EQ(last_msg_.obs[5].P, 2347022641) << "incorrect value for last_msg_.obs[5].P, expected 2347022641, is " << last_msg_.obs[5].P; - EXPECT_EQ(last_msg_.obs[5].cn0, 150) << "incorrect value for last_msg_.obs[5].cn0, expected 150, is " << last_msg_.obs[5].cn0; - EXPECT_EQ(last_msg_.obs[5].lock, 0) << "incorrect value for last_msg_.obs[5].lock, expected 0, is " << last_msg_.obs[5].lock; - EXPECT_EQ(last_msg_.obs[5].sid.code, 0) << "incorrect value for last_msg_.obs[5].sid.code, expected 0, is " << last_msg_.obs[5].sid.code; - EXPECT_EQ(last_msg_.obs[5].sid.reserved, 0) << "incorrect value for last_msg_.obs[5].sid.reserved, expected 0, is " << last_msg_.obs[5].sid.reserved; - EXPECT_EQ(last_msg_.obs[5].sid.sat, 218) << "incorrect value for last_msg_.obs[5].sid.sat, expected 218, is " << last_msg_.obs[5].sid.sat; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgObsDepB2, Test) { + uint8_t encoded_frame[] = { + 85, 67, 0, 246, 215, 103, 64, 47, 39, 0, 251, 6, 32, 100, 132, 187, + 133, 236, 51, 7, 7, 94, 156, 0, 0, 202, 0, 0, 0, 97, 184, 85, + 147, 178, 30, 190, 7, 40, 140, 0, 0, 203, 0, 0, 0, 135, 111, 248, + 138, 90, 171, 77, 7, 2, 150, 0, 0, 208, 0, 0, 0, 180, 238, 72, + 135, 190, 20, 28, 7, 241, 155, 0, 0, 212, 0, 0, 0, 15, 153, 105, + 124, 92, 196, 137, 6, 153, 168, 0, 0, 217, 0, 0, 0, 49, 185, 228, + 139, 144, 5, 90, 7, 41, 150, 0, 0, 218, 0, 0, 0, 241, 98, + }; + + sbp_msg_obs_dep_b_t test_msg{}; + test_msg.header.n_obs = 32; + test_msg.header.t.tow = 2568000; + test_msg.header.t.wn = 1787; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 6; + + test_msg.obs[0].L.f = 94; + test_msg.obs[0].L.i = 117912556; + test_msg.obs[0].P = 2243658852; + test_msg.obs[0].cn0 = 156; + test_msg.obs[0].lock = 0; + test_msg.obs[0].sid.code = 0; + test_msg.obs[0].sid.reserved = 0; + test_msg.obs[0].sid.sat = 202; + + test_msg.obs[1].L.f = 40; + test_msg.obs[1].L.i = 129900210; + test_msg.obs[1].P = 2471868513; + test_msg.obs[1].cn0 = 140; + test_msg.obs[1].lock = 0; + test_msg.obs[1].sid.code = 0; + test_msg.obs[1].sid.reserved = 0; + test_msg.obs[1].sid.sat = 203; + + test_msg.obs[2].L.f = 2; + test_msg.obs[2].L.i = 122530650; + test_msg.obs[2].P = 2331537287; + test_msg.obs[2].cn0 = 150; + test_msg.obs[2].lock = 0; + test_msg.obs[2].sid.code = 0; + test_msg.obs[2].sid.reserved = 0; + test_msg.obs[2].sid.sat = 208; + + test_msg.obs[3].L.f = 241; + test_msg.obs[3].L.i = 119280830; + test_msg.obs[3].P = 2269703860; + test_msg.obs[3].cn0 = 155; + test_msg.obs[3].lock = 0; + test_msg.obs[3].sid.code = 0; + test_msg.obs[3].sid.reserved = 0; + test_msg.obs[3].sid.sat = 212; + + test_msg.obs[4].L.f = 153; + test_msg.obs[4].L.i = 109691996; + test_msg.obs[4].P = 2087295247; + test_msg.obs[4].cn0 = 168; + test_msg.obs[4].lock = 0; + test_msg.obs[4].sid.code = 0; + test_msg.obs[4].sid.reserved = 0; + test_msg.obs[4].sid.sat = 217; + + test_msg.obs[5].L.f = 41; + test_msg.obs[5].L.i = 123340176; + test_msg.obs[5].P = 2347022641; + test_msg.obs[5].cn0 = 150; + test_msg.obs[5].lock = 0; + test_msg.obs[5].sid.code = 0; + test_msg.obs[5].sid.reserved = 0; + test_msg.obs[5].sid.sat = 218; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 32) + << "incorrect value for last_msg_.header.n_obs, expected 32, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 2568000) + << "incorrect value for last_msg_.header.t.tow, expected 2568000, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1787) + << "incorrect value for last_msg_.header.t.wn, expected 1787, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 6) + << "incorrect value for last_msg_.n_obs.value, expected 6, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 94) + << "incorrect value for last_msg_.obs[0].L.f, expected 94, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, 117912556) + << "incorrect value for last_msg_.obs[0].L.i, expected 117912556, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 2243658852) + << "incorrect value for last_msg_.obs[0].P, expected 2243658852, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 156) + << "incorrect value for last_msg_.obs[0].cn0, expected 156, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 0) + << "incorrect value for last_msg_.obs[0].lock, expected 0, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].sid.code, 0) + << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " + << last_msg_.obs[0].sid.code; + EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) + << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " + << last_msg_.obs[0].sid.reserved; + EXPECT_EQ(last_msg_.obs[0].sid.sat, 202) + << "incorrect value for last_msg_.obs[0].sid.sat, expected 202, is " + << last_msg_.obs[0].sid.sat; + EXPECT_EQ(last_msg_.obs[1].L.f, 40) + << "incorrect value for last_msg_.obs[1].L.f, expected 40, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, 129900210) + << "incorrect value for last_msg_.obs[1].L.i, expected 129900210, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 2471868513) + << "incorrect value for last_msg_.obs[1].P, expected 2471868513, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].cn0, 140) + << "incorrect value for last_msg_.obs[1].cn0, expected 140, is " + << last_msg_.obs[1].cn0; + EXPECT_EQ(last_msg_.obs[1].lock, 0) + << "incorrect value for last_msg_.obs[1].lock, expected 0, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].sid.code, 0) + << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " + << last_msg_.obs[1].sid.code; + EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) + << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " + << last_msg_.obs[1].sid.reserved; + EXPECT_EQ(last_msg_.obs[1].sid.sat, 203) + << "incorrect value for last_msg_.obs[1].sid.sat, expected 203, is " + << last_msg_.obs[1].sid.sat; + EXPECT_EQ(last_msg_.obs[2].L.f, 2) + << "incorrect value for last_msg_.obs[2].L.f, expected 2, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, 122530650) + << "incorrect value for last_msg_.obs[2].L.i, expected 122530650, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 2331537287) + << "incorrect value for last_msg_.obs[2].P, expected 2331537287, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].cn0, 150) + << "incorrect value for last_msg_.obs[2].cn0, expected 150, is " + << last_msg_.obs[2].cn0; + EXPECT_EQ(last_msg_.obs[2].lock, 0) + << "incorrect value for last_msg_.obs[2].lock, expected 0, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].sid.code, 0) + << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " + << last_msg_.obs[2].sid.code; + EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) + << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " + << last_msg_.obs[2].sid.reserved; + EXPECT_EQ(last_msg_.obs[2].sid.sat, 208) + << "incorrect value for last_msg_.obs[2].sid.sat, expected 208, is " + << last_msg_.obs[2].sid.sat; + EXPECT_EQ(last_msg_.obs[3].L.f, 241) + << "incorrect value for last_msg_.obs[3].L.f, expected 241, is " + << last_msg_.obs[3].L.f; + EXPECT_EQ(last_msg_.obs[3].L.i, 119280830) + << "incorrect value for last_msg_.obs[3].L.i, expected 119280830, is " + << last_msg_.obs[3].L.i; + EXPECT_EQ(last_msg_.obs[3].P, 2269703860) + << "incorrect value for last_msg_.obs[3].P, expected 2269703860, is " + << last_msg_.obs[3].P; + EXPECT_EQ(last_msg_.obs[3].cn0, 155) + << "incorrect value for last_msg_.obs[3].cn0, expected 155, is " + << last_msg_.obs[3].cn0; + EXPECT_EQ(last_msg_.obs[3].lock, 0) + << "incorrect value for last_msg_.obs[3].lock, expected 0, is " + << last_msg_.obs[3].lock; + EXPECT_EQ(last_msg_.obs[3].sid.code, 0) + << "incorrect value for last_msg_.obs[3].sid.code, expected 0, is " + << last_msg_.obs[3].sid.code; + EXPECT_EQ(last_msg_.obs[3].sid.reserved, 0) + << "incorrect value for last_msg_.obs[3].sid.reserved, expected 0, is " + << last_msg_.obs[3].sid.reserved; + EXPECT_EQ(last_msg_.obs[3].sid.sat, 212) + << "incorrect value for last_msg_.obs[3].sid.sat, expected 212, is " + << last_msg_.obs[3].sid.sat; + EXPECT_EQ(last_msg_.obs[4].L.f, 153) + << "incorrect value for last_msg_.obs[4].L.f, expected 153, is " + << last_msg_.obs[4].L.f; + EXPECT_EQ(last_msg_.obs[4].L.i, 109691996) + << "incorrect value for last_msg_.obs[4].L.i, expected 109691996, is " + << last_msg_.obs[4].L.i; + EXPECT_EQ(last_msg_.obs[4].P, 2087295247) + << "incorrect value for last_msg_.obs[4].P, expected 2087295247, is " + << last_msg_.obs[4].P; + EXPECT_EQ(last_msg_.obs[4].cn0, 168) + << "incorrect value for last_msg_.obs[4].cn0, expected 168, is " + << last_msg_.obs[4].cn0; + EXPECT_EQ(last_msg_.obs[4].lock, 0) + << "incorrect value for last_msg_.obs[4].lock, expected 0, is " + << last_msg_.obs[4].lock; + EXPECT_EQ(last_msg_.obs[4].sid.code, 0) + << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " + << last_msg_.obs[4].sid.code; + EXPECT_EQ(last_msg_.obs[4].sid.reserved, 0) + << "incorrect value for last_msg_.obs[4].sid.reserved, expected 0, is " + << last_msg_.obs[4].sid.reserved; + EXPECT_EQ(last_msg_.obs[4].sid.sat, 217) + << "incorrect value for last_msg_.obs[4].sid.sat, expected 217, is " + << last_msg_.obs[4].sid.sat; + EXPECT_EQ(last_msg_.obs[5].L.f, 41) + << "incorrect value for last_msg_.obs[5].L.f, expected 41, is " + << last_msg_.obs[5].L.f; + EXPECT_EQ(last_msg_.obs[5].L.i, 123340176) + << "incorrect value for last_msg_.obs[5].L.i, expected 123340176, is " + << last_msg_.obs[5].L.i; + EXPECT_EQ(last_msg_.obs[5].P, 2347022641) + << "incorrect value for last_msg_.obs[5].P, expected 2347022641, is " + << last_msg_.obs[5].P; + EXPECT_EQ(last_msg_.obs[5].cn0, 150) + << "incorrect value for last_msg_.obs[5].cn0, expected 150, is " + << last_msg_.obs[5].cn0; + EXPECT_EQ(last_msg_.obs[5].lock, 0) + << "incorrect value for last_msg_.obs[5].lock, expected 0, is " + << last_msg_.obs[5].lock; + EXPECT_EQ(last_msg_.obs[5].sid.code, 0) + << "incorrect value for last_msg_.obs[5].sid.code, expected 0, is " + << last_msg_.obs[5].sid.code; + EXPECT_EQ(last_msg_.obs[5].sid.reserved, 0) + << "incorrect value for last_msg_.obs[5].sid.reserved, expected 0, is " + << last_msg_.obs[5].sid.reserved; + EXPECT_EQ(last_msg_.obs[5].sid.sat, 218) + << "incorrect value for last_msg_.obs[5].sid.sat, expected 218, is " + << last_msg_.obs[5].sid.sat; } -class Test_auto_check_sbp_observation_MsgObsDepB3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgObsDepB3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_MsgObsDepB3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgObsDepB3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -641,155 +934,220 @@ class Test_auto_check_sbp_observation_MsgObsDepB3 : sbp_msg_obs_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgObsDepB3, Test) -{ - - uint8_t encoded_frame[] = {85,67,0,246,215,55,64,47,39,0,251,6,33,234,148,101,136,15,245,42,7,20,154,0,0,220,0,0,0,208,247,122,133,16,214,3,7,38,156,0,0,222,0,0,0,15,150,81,122,22,172,109,6,7,172,0,0,225,0,0,0,201,13, }; - - sbp_msg_obs_dep_b_t test_msg{}; - test_msg.header.n_obs = 33; - test_msg.header.t.tow = 2568000; - test_msg.header.t.wn = 1787; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 3; - - test_msg.obs[0].L.f = 20; - test_msg.obs[0].L.i = 120255759; - test_msg.obs[0].P = 2288358634; - test_msg.obs[0].cn0 = 154; - test_msg.obs[0].lock = 0; - test_msg.obs[0].sid.code = 0; - test_msg.obs[0].sid.reserved = 0; - test_msg.obs[0].sid.sat = 220; - - test_msg.obs[1].L.f = 38; - test_msg.obs[1].L.i = 117691920; - test_msg.obs[1].P = 2239428560; - test_msg.obs[1].cn0 = 156; - test_msg.obs[1].lock = 0; - test_msg.obs[1].sid.code = 0; - test_msg.obs[1].sid.reserved = 0; - test_msg.obs[1].sid.sat = 222; - - test_msg.obs[2].L.f = 7; - test_msg.obs[2].L.i = 107850774; - test_msg.obs[2].P = 2052167183; - test_msg.obs[2].cn0 = 172; - test_msg.obs[2].lock = 0; - test_msg.obs[2].sid.code = 0; - test_msg.obs[2].sid.reserved = 0; - test_msg.obs[2].sid.sat = 225; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 33) << "incorrect value for last_msg_.header.n_obs, expected 33, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 2568000) << "incorrect value for last_msg_.header.t.tow, expected 2568000, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1787) << "incorrect value for last_msg_.header.t.wn, expected 1787, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 3) << "incorrect value for last_msg_.n_obs.value, expected 3, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 20) << "incorrect value for last_msg_.obs[0].L.f, expected 20, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, 120255759) << "incorrect value for last_msg_.obs[0].L.i, expected 120255759, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 2288358634) << "incorrect value for last_msg_.obs[0].P, expected 2288358634, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 154) << "incorrect value for last_msg_.obs[0].cn0, expected 154, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 0) << "incorrect value for last_msg_.obs[0].lock, expected 0, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].sid.code, 0) << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " << last_msg_.obs[0].sid.code; - EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " << last_msg_.obs[0].sid.reserved; - EXPECT_EQ(last_msg_.obs[0].sid.sat, 220) << "incorrect value for last_msg_.obs[0].sid.sat, expected 220, is " << last_msg_.obs[0].sid.sat; - EXPECT_EQ(last_msg_.obs[1].L.f, 38) << "incorrect value for last_msg_.obs[1].L.f, expected 38, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, 117691920) << "incorrect value for last_msg_.obs[1].L.i, expected 117691920, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 2239428560) << "incorrect value for last_msg_.obs[1].P, expected 2239428560, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].cn0, 156) << "incorrect value for last_msg_.obs[1].cn0, expected 156, is " << last_msg_.obs[1].cn0; - EXPECT_EQ(last_msg_.obs[1].lock, 0) << "incorrect value for last_msg_.obs[1].lock, expected 0, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].sid.code, 0) << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " << last_msg_.obs[1].sid.code; - EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " << last_msg_.obs[1].sid.reserved; - EXPECT_EQ(last_msg_.obs[1].sid.sat, 222) << "incorrect value for last_msg_.obs[1].sid.sat, expected 222, is " << last_msg_.obs[1].sid.sat; - EXPECT_EQ(last_msg_.obs[2].L.f, 7) << "incorrect value for last_msg_.obs[2].L.f, expected 7, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, 107850774) << "incorrect value for last_msg_.obs[2].L.i, expected 107850774, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 2052167183) << "incorrect value for last_msg_.obs[2].P, expected 2052167183, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].cn0, 172) << "incorrect value for last_msg_.obs[2].cn0, expected 172, is " << last_msg_.obs[2].cn0; - EXPECT_EQ(last_msg_.obs[2].lock, 0) << "incorrect value for last_msg_.obs[2].lock, expected 0, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].sid.code, 0) << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " << last_msg_.obs[2].sid.code; - EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " << last_msg_.obs[2].sid.reserved; - EXPECT_EQ(last_msg_.obs[2].sid.sat, 225) << "incorrect value for last_msg_.obs[2].sid.sat, expected 225, is " << last_msg_.obs[2].sid.sat; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgObsDepB3, Test) { + uint8_t encoded_frame[] = { + 85, 67, 0, 246, 215, 55, 64, 47, 39, 0, 251, 6, 33, 234, 148, 101, + 136, 15, 245, 42, 7, 20, 154, 0, 0, 220, 0, 0, 0, 208, 247, 122, + 133, 16, 214, 3, 7, 38, 156, 0, 0, 222, 0, 0, 0, 15, 150, 81, + 122, 22, 172, 109, 6, 7, 172, 0, 0, 225, 0, 0, 0, 201, 13, + }; + + sbp_msg_obs_dep_b_t test_msg{}; + test_msg.header.n_obs = 33; + test_msg.header.t.tow = 2568000; + test_msg.header.t.wn = 1787; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 3; + + test_msg.obs[0].L.f = 20; + test_msg.obs[0].L.i = 120255759; + test_msg.obs[0].P = 2288358634; + test_msg.obs[0].cn0 = 154; + test_msg.obs[0].lock = 0; + test_msg.obs[0].sid.code = 0; + test_msg.obs[0].sid.reserved = 0; + test_msg.obs[0].sid.sat = 220; + + test_msg.obs[1].L.f = 38; + test_msg.obs[1].L.i = 117691920; + test_msg.obs[1].P = 2239428560; + test_msg.obs[1].cn0 = 156; + test_msg.obs[1].lock = 0; + test_msg.obs[1].sid.code = 0; + test_msg.obs[1].sid.reserved = 0; + test_msg.obs[1].sid.sat = 222; + + test_msg.obs[2].L.f = 7; + test_msg.obs[2].L.i = 107850774; + test_msg.obs[2].P = 2052167183; + test_msg.obs[2].cn0 = 172; + test_msg.obs[2].lock = 0; + test_msg.obs[2].sid.code = 0; + test_msg.obs[2].sid.reserved = 0; + test_msg.obs[2].sid.sat = 225; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 33) + << "incorrect value for last_msg_.header.n_obs, expected 33, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 2568000) + << "incorrect value for last_msg_.header.t.tow, expected 2568000, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1787) + << "incorrect value for last_msg_.header.t.wn, expected 1787, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 3) + << "incorrect value for last_msg_.n_obs.value, expected 3, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 20) + << "incorrect value for last_msg_.obs[0].L.f, expected 20, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, 120255759) + << "incorrect value for last_msg_.obs[0].L.i, expected 120255759, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 2288358634) + << "incorrect value for last_msg_.obs[0].P, expected 2288358634, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 154) + << "incorrect value for last_msg_.obs[0].cn0, expected 154, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 0) + << "incorrect value for last_msg_.obs[0].lock, expected 0, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].sid.code, 0) + << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " + << last_msg_.obs[0].sid.code; + EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) + << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " + << last_msg_.obs[0].sid.reserved; + EXPECT_EQ(last_msg_.obs[0].sid.sat, 220) + << "incorrect value for last_msg_.obs[0].sid.sat, expected 220, is " + << last_msg_.obs[0].sid.sat; + EXPECT_EQ(last_msg_.obs[1].L.f, 38) + << "incorrect value for last_msg_.obs[1].L.f, expected 38, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, 117691920) + << "incorrect value for last_msg_.obs[1].L.i, expected 117691920, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 2239428560) + << "incorrect value for last_msg_.obs[1].P, expected 2239428560, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].cn0, 156) + << "incorrect value for last_msg_.obs[1].cn0, expected 156, is " + << last_msg_.obs[1].cn0; + EXPECT_EQ(last_msg_.obs[1].lock, 0) + << "incorrect value for last_msg_.obs[1].lock, expected 0, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].sid.code, 0) + << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " + << last_msg_.obs[1].sid.code; + EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) + << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " + << last_msg_.obs[1].sid.reserved; + EXPECT_EQ(last_msg_.obs[1].sid.sat, 222) + << "incorrect value for last_msg_.obs[1].sid.sat, expected 222, is " + << last_msg_.obs[1].sid.sat; + EXPECT_EQ(last_msg_.obs[2].L.f, 7) + << "incorrect value for last_msg_.obs[2].L.f, expected 7, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, 107850774) + << "incorrect value for last_msg_.obs[2].L.i, expected 107850774, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 2052167183) + << "incorrect value for last_msg_.obs[2].P, expected 2052167183, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].cn0, 172) + << "incorrect value for last_msg_.obs[2].cn0, expected 172, is " + << last_msg_.obs[2].cn0; + EXPECT_EQ(last_msg_.obs[2].lock, 0) + << "incorrect value for last_msg_.obs[2].lock, expected 0, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].sid.code, 0) + << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " + << last_msg_.obs[2].sid.code; + EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) + << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " + << last_msg_.obs[2].sid.reserved; + EXPECT_EQ(last_msg_.obs[2].sid.sat, 225) + << "incorrect value for last_msg_.obs[2].sid.sat, expected 225, is " + << last_msg_.obs[2].sid.sat; } -class Test_auto_check_sbp_observation_MsgObsDepB4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgObsDepB4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_MsgObsDepB4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgObsDepB4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -797,156 +1155,278 @@ class Test_auto_check_sbp_observation_MsgObsDepB4 : sbp_msg_obs_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgObsDepB4, Test) -{ - - uint8_t encoded_frame[] = {85,67,0,246,215,103,8,48,39,0,251,6,32,254,96,187,133,249,49,7,7,165,156,0,0,202,0,0,0,113,229,85,147,11,33,190,7,106,143,0,0,203,0,0,0,182,85,248,138,227,169,77,7,159,150,0,0,208,0,0,0,17,24,73,135,10,23,28,7,7,156,0,0,212,0,0,0,108,155,105,124,166,196,137,6,186,170,0,0,217,0,0,0,214,142,228,139,77,3,90,7,236,151,0,0,218,0,0,0,59,118, }; - - sbp_msg_obs_dep_b_t test_msg{}; - test_msg.header.n_obs = 32; - test_msg.header.t.tow = 2568200; - test_msg.header.t.wn = 1787; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 6; - - test_msg.obs[0].L.f = 165; - test_msg.obs[0].L.i = 117912057; - test_msg.obs[0].P = 2243649790; - test_msg.obs[0].cn0 = 156; - test_msg.obs[0].lock = 0; - test_msg.obs[0].sid.code = 0; - test_msg.obs[0].sid.reserved = 0; - test_msg.obs[0].sid.sat = 202; - - test_msg.obs[1].L.f = 106; - test_msg.obs[1].L.i = 129900811; - test_msg.obs[1].P = 2471880049; - test_msg.obs[1].cn0 = 143; - test_msg.obs[1].lock = 0; - test_msg.obs[1].sid.code = 0; - test_msg.obs[1].sid.reserved = 0; - test_msg.obs[1].sid.sat = 203; - - test_msg.obs[2].L.f = 159; - test_msg.obs[2].L.i = 122530275; - test_msg.obs[2].P = 2331530678; - test_msg.obs[2].cn0 = 150; - test_msg.obs[2].lock = 0; - test_msg.obs[2].sid.code = 0; - test_msg.obs[2].sid.reserved = 0; - test_msg.obs[2].sid.sat = 208; - - test_msg.obs[3].L.f = 7; - test_msg.obs[3].L.i = 119281418; - test_msg.obs[3].P = 2269714449; - test_msg.obs[3].cn0 = 156; - test_msg.obs[3].lock = 0; - test_msg.obs[3].sid.code = 0; - test_msg.obs[3].sid.reserved = 0; - test_msg.obs[3].sid.sat = 212; - - test_msg.obs[4].L.f = 186; - test_msg.obs[4].L.i = 109692070; - test_msg.obs[4].P = 2087295852; - test_msg.obs[4].cn0 = 170; - test_msg.obs[4].lock = 0; - test_msg.obs[4].sid.code = 0; - test_msg.obs[4].sid.reserved = 0; - test_msg.obs[4].sid.sat = 217; - - test_msg.obs[5].L.f = 236; - test_msg.obs[5].L.i = 123339597; - test_msg.obs[5].P = 2347011798; - test_msg.obs[5].cn0 = 151; - test_msg.obs[5].lock = 0; - test_msg.obs[5].sid.code = 0; - test_msg.obs[5].sid.reserved = 0; - test_msg.obs[5].sid.sat = 218; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 32) << "incorrect value for last_msg_.header.n_obs, expected 32, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 2568200) << "incorrect value for last_msg_.header.t.tow, expected 2568200, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1787) << "incorrect value for last_msg_.header.t.wn, expected 1787, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 6) << "incorrect value for last_msg_.n_obs.value, expected 6, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 165) << "incorrect value for last_msg_.obs[0].L.f, expected 165, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, 117912057) << "incorrect value for last_msg_.obs[0].L.i, expected 117912057, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 2243649790) << "incorrect value for last_msg_.obs[0].P, expected 2243649790, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 156) << "incorrect value for last_msg_.obs[0].cn0, expected 156, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 0) << "incorrect value for last_msg_.obs[0].lock, expected 0, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].sid.code, 0) << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " << last_msg_.obs[0].sid.code; - EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " << last_msg_.obs[0].sid.reserved; - EXPECT_EQ(last_msg_.obs[0].sid.sat, 202) << "incorrect value for last_msg_.obs[0].sid.sat, expected 202, is " << last_msg_.obs[0].sid.sat; - EXPECT_EQ(last_msg_.obs[1].L.f, 106) << "incorrect value for last_msg_.obs[1].L.f, expected 106, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, 129900811) << "incorrect value for last_msg_.obs[1].L.i, expected 129900811, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 2471880049) << "incorrect value for last_msg_.obs[1].P, expected 2471880049, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].cn0, 143) << "incorrect value for last_msg_.obs[1].cn0, expected 143, is " << last_msg_.obs[1].cn0; - EXPECT_EQ(last_msg_.obs[1].lock, 0) << "incorrect value for last_msg_.obs[1].lock, expected 0, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].sid.code, 0) << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " << last_msg_.obs[1].sid.code; - EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " << last_msg_.obs[1].sid.reserved; - EXPECT_EQ(last_msg_.obs[1].sid.sat, 203) << "incorrect value for last_msg_.obs[1].sid.sat, expected 203, is " << last_msg_.obs[1].sid.sat; - EXPECT_EQ(last_msg_.obs[2].L.f, 159) << "incorrect value for last_msg_.obs[2].L.f, expected 159, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, 122530275) << "incorrect value for last_msg_.obs[2].L.i, expected 122530275, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 2331530678) << "incorrect value for last_msg_.obs[2].P, expected 2331530678, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].cn0, 150) << "incorrect value for last_msg_.obs[2].cn0, expected 150, is " << last_msg_.obs[2].cn0; - EXPECT_EQ(last_msg_.obs[2].lock, 0) << "incorrect value for last_msg_.obs[2].lock, expected 0, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].sid.code, 0) << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " << last_msg_.obs[2].sid.code; - EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " << last_msg_.obs[2].sid.reserved; - EXPECT_EQ(last_msg_.obs[2].sid.sat, 208) << "incorrect value for last_msg_.obs[2].sid.sat, expected 208, is " << last_msg_.obs[2].sid.sat; - EXPECT_EQ(last_msg_.obs[3].L.f, 7) << "incorrect value for last_msg_.obs[3].L.f, expected 7, is " << last_msg_.obs[3].L.f; - EXPECT_EQ(last_msg_.obs[3].L.i, 119281418) << "incorrect value for last_msg_.obs[3].L.i, expected 119281418, is " << last_msg_.obs[3].L.i; - EXPECT_EQ(last_msg_.obs[3].P, 2269714449) << "incorrect value for last_msg_.obs[3].P, expected 2269714449, is " << last_msg_.obs[3].P; - EXPECT_EQ(last_msg_.obs[3].cn0, 156) << "incorrect value for last_msg_.obs[3].cn0, expected 156, is " << last_msg_.obs[3].cn0; - EXPECT_EQ(last_msg_.obs[3].lock, 0) << "incorrect value for last_msg_.obs[3].lock, expected 0, is " << last_msg_.obs[3].lock; - EXPECT_EQ(last_msg_.obs[3].sid.code, 0) << "incorrect value for last_msg_.obs[3].sid.code, expected 0, is " << last_msg_.obs[3].sid.code; - EXPECT_EQ(last_msg_.obs[3].sid.reserved, 0) << "incorrect value for last_msg_.obs[3].sid.reserved, expected 0, is " << last_msg_.obs[3].sid.reserved; - EXPECT_EQ(last_msg_.obs[3].sid.sat, 212) << "incorrect value for last_msg_.obs[3].sid.sat, expected 212, is " << last_msg_.obs[3].sid.sat; - EXPECT_EQ(last_msg_.obs[4].L.f, 186) << "incorrect value for last_msg_.obs[4].L.f, expected 186, is " << last_msg_.obs[4].L.f; - EXPECT_EQ(last_msg_.obs[4].L.i, 109692070) << "incorrect value for last_msg_.obs[4].L.i, expected 109692070, is " << last_msg_.obs[4].L.i; - EXPECT_EQ(last_msg_.obs[4].P, 2087295852) << "incorrect value for last_msg_.obs[4].P, expected 2087295852, is " << last_msg_.obs[4].P; - EXPECT_EQ(last_msg_.obs[4].cn0, 170) << "incorrect value for last_msg_.obs[4].cn0, expected 170, is " << last_msg_.obs[4].cn0; - EXPECT_EQ(last_msg_.obs[4].lock, 0) << "incorrect value for last_msg_.obs[4].lock, expected 0, is " << last_msg_.obs[4].lock; - EXPECT_EQ(last_msg_.obs[4].sid.code, 0) << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " << last_msg_.obs[4].sid.code; - EXPECT_EQ(last_msg_.obs[4].sid.reserved, 0) << "incorrect value for last_msg_.obs[4].sid.reserved, expected 0, is " << last_msg_.obs[4].sid.reserved; - EXPECT_EQ(last_msg_.obs[4].sid.sat, 217) << "incorrect value for last_msg_.obs[4].sid.sat, expected 217, is " << last_msg_.obs[4].sid.sat; - EXPECT_EQ(last_msg_.obs[5].L.f, 236) << "incorrect value for last_msg_.obs[5].L.f, expected 236, is " << last_msg_.obs[5].L.f; - EXPECT_EQ(last_msg_.obs[5].L.i, 123339597) << "incorrect value for last_msg_.obs[5].L.i, expected 123339597, is " << last_msg_.obs[5].L.i; - EXPECT_EQ(last_msg_.obs[5].P, 2347011798) << "incorrect value for last_msg_.obs[5].P, expected 2347011798, is " << last_msg_.obs[5].P; - EXPECT_EQ(last_msg_.obs[5].cn0, 151) << "incorrect value for last_msg_.obs[5].cn0, expected 151, is " << last_msg_.obs[5].cn0; - EXPECT_EQ(last_msg_.obs[5].lock, 0) << "incorrect value for last_msg_.obs[5].lock, expected 0, is " << last_msg_.obs[5].lock; - EXPECT_EQ(last_msg_.obs[5].sid.code, 0) << "incorrect value for last_msg_.obs[5].sid.code, expected 0, is " << last_msg_.obs[5].sid.code; - EXPECT_EQ(last_msg_.obs[5].sid.reserved, 0) << "incorrect value for last_msg_.obs[5].sid.reserved, expected 0, is " << last_msg_.obs[5].sid.reserved; - EXPECT_EQ(last_msg_.obs[5].sid.sat, 218) << "incorrect value for last_msg_.obs[5].sid.sat, expected 218, is " << last_msg_.obs[5].sid.sat; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgObsDepB4, Test) { + uint8_t encoded_frame[] = { + 85, 67, 0, 246, 215, 103, 8, 48, 39, 0, 251, 6, 32, 254, 96, 187, + 133, 249, 49, 7, 7, 165, 156, 0, 0, 202, 0, 0, 0, 113, 229, 85, + 147, 11, 33, 190, 7, 106, 143, 0, 0, 203, 0, 0, 0, 182, 85, 248, + 138, 227, 169, 77, 7, 159, 150, 0, 0, 208, 0, 0, 0, 17, 24, 73, + 135, 10, 23, 28, 7, 7, 156, 0, 0, 212, 0, 0, 0, 108, 155, 105, + 124, 166, 196, 137, 6, 186, 170, 0, 0, 217, 0, 0, 0, 214, 142, 228, + 139, 77, 3, 90, 7, 236, 151, 0, 0, 218, 0, 0, 0, 59, 118, + }; + + sbp_msg_obs_dep_b_t test_msg{}; + test_msg.header.n_obs = 32; + test_msg.header.t.tow = 2568200; + test_msg.header.t.wn = 1787; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 6; + + test_msg.obs[0].L.f = 165; + test_msg.obs[0].L.i = 117912057; + test_msg.obs[0].P = 2243649790; + test_msg.obs[0].cn0 = 156; + test_msg.obs[0].lock = 0; + test_msg.obs[0].sid.code = 0; + test_msg.obs[0].sid.reserved = 0; + test_msg.obs[0].sid.sat = 202; + + test_msg.obs[1].L.f = 106; + test_msg.obs[1].L.i = 129900811; + test_msg.obs[1].P = 2471880049; + test_msg.obs[1].cn0 = 143; + test_msg.obs[1].lock = 0; + test_msg.obs[1].sid.code = 0; + test_msg.obs[1].sid.reserved = 0; + test_msg.obs[1].sid.sat = 203; + + test_msg.obs[2].L.f = 159; + test_msg.obs[2].L.i = 122530275; + test_msg.obs[2].P = 2331530678; + test_msg.obs[2].cn0 = 150; + test_msg.obs[2].lock = 0; + test_msg.obs[2].sid.code = 0; + test_msg.obs[2].sid.reserved = 0; + test_msg.obs[2].sid.sat = 208; + + test_msg.obs[3].L.f = 7; + test_msg.obs[3].L.i = 119281418; + test_msg.obs[3].P = 2269714449; + test_msg.obs[3].cn0 = 156; + test_msg.obs[3].lock = 0; + test_msg.obs[3].sid.code = 0; + test_msg.obs[3].sid.reserved = 0; + test_msg.obs[3].sid.sat = 212; + + test_msg.obs[4].L.f = 186; + test_msg.obs[4].L.i = 109692070; + test_msg.obs[4].P = 2087295852; + test_msg.obs[4].cn0 = 170; + test_msg.obs[4].lock = 0; + test_msg.obs[4].sid.code = 0; + test_msg.obs[4].sid.reserved = 0; + test_msg.obs[4].sid.sat = 217; + + test_msg.obs[5].L.f = 236; + test_msg.obs[5].L.i = 123339597; + test_msg.obs[5].P = 2347011798; + test_msg.obs[5].cn0 = 151; + test_msg.obs[5].lock = 0; + test_msg.obs[5].sid.code = 0; + test_msg.obs[5].sid.reserved = 0; + test_msg.obs[5].sid.sat = 218; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 32) + << "incorrect value for last_msg_.header.n_obs, expected 32, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 2568200) + << "incorrect value for last_msg_.header.t.tow, expected 2568200, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1787) + << "incorrect value for last_msg_.header.t.wn, expected 1787, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 6) + << "incorrect value for last_msg_.n_obs.value, expected 6, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 165) + << "incorrect value for last_msg_.obs[0].L.f, expected 165, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, 117912057) + << "incorrect value for last_msg_.obs[0].L.i, expected 117912057, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 2243649790) + << "incorrect value for last_msg_.obs[0].P, expected 2243649790, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 156) + << "incorrect value for last_msg_.obs[0].cn0, expected 156, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 0) + << "incorrect value for last_msg_.obs[0].lock, expected 0, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].sid.code, 0) + << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " + << last_msg_.obs[0].sid.code; + EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) + << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " + << last_msg_.obs[0].sid.reserved; + EXPECT_EQ(last_msg_.obs[0].sid.sat, 202) + << "incorrect value for last_msg_.obs[0].sid.sat, expected 202, is " + << last_msg_.obs[0].sid.sat; + EXPECT_EQ(last_msg_.obs[1].L.f, 106) + << "incorrect value for last_msg_.obs[1].L.f, expected 106, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, 129900811) + << "incorrect value for last_msg_.obs[1].L.i, expected 129900811, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 2471880049) + << "incorrect value for last_msg_.obs[1].P, expected 2471880049, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].cn0, 143) + << "incorrect value for last_msg_.obs[1].cn0, expected 143, is " + << last_msg_.obs[1].cn0; + EXPECT_EQ(last_msg_.obs[1].lock, 0) + << "incorrect value for last_msg_.obs[1].lock, expected 0, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].sid.code, 0) + << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " + << last_msg_.obs[1].sid.code; + EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) + << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " + << last_msg_.obs[1].sid.reserved; + EXPECT_EQ(last_msg_.obs[1].sid.sat, 203) + << "incorrect value for last_msg_.obs[1].sid.sat, expected 203, is " + << last_msg_.obs[1].sid.sat; + EXPECT_EQ(last_msg_.obs[2].L.f, 159) + << "incorrect value for last_msg_.obs[2].L.f, expected 159, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, 122530275) + << "incorrect value for last_msg_.obs[2].L.i, expected 122530275, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 2331530678) + << "incorrect value for last_msg_.obs[2].P, expected 2331530678, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].cn0, 150) + << "incorrect value for last_msg_.obs[2].cn0, expected 150, is " + << last_msg_.obs[2].cn0; + EXPECT_EQ(last_msg_.obs[2].lock, 0) + << "incorrect value for last_msg_.obs[2].lock, expected 0, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].sid.code, 0) + << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " + << last_msg_.obs[2].sid.code; + EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) + << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " + << last_msg_.obs[2].sid.reserved; + EXPECT_EQ(last_msg_.obs[2].sid.sat, 208) + << "incorrect value for last_msg_.obs[2].sid.sat, expected 208, is " + << last_msg_.obs[2].sid.sat; + EXPECT_EQ(last_msg_.obs[3].L.f, 7) + << "incorrect value for last_msg_.obs[3].L.f, expected 7, is " + << last_msg_.obs[3].L.f; + EXPECT_EQ(last_msg_.obs[3].L.i, 119281418) + << "incorrect value for last_msg_.obs[3].L.i, expected 119281418, is " + << last_msg_.obs[3].L.i; + EXPECT_EQ(last_msg_.obs[3].P, 2269714449) + << "incorrect value for last_msg_.obs[3].P, expected 2269714449, is " + << last_msg_.obs[3].P; + EXPECT_EQ(last_msg_.obs[3].cn0, 156) + << "incorrect value for last_msg_.obs[3].cn0, expected 156, is " + << last_msg_.obs[3].cn0; + EXPECT_EQ(last_msg_.obs[3].lock, 0) + << "incorrect value for last_msg_.obs[3].lock, expected 0, is " + << last_msg_.obs[3].lock; + EXPECT_EQ(last_msg_.obs[3].sid.code, 0) + << "incorrect value for last_msg_.obs[3].sid.code, expected 0, is " + << last_msg_.obs[3].sid.code; + EXPECT_EQ(last_msg_.obs[3].sid.reserved, 0) + << "incorrect value for last_msg_.obs[3].sid.reserved, expected 0, is " + << last_msg_.obs[3].sid.reserved; + EXPECT_EQ(last_msg_.obs[3].sid.sat, 212) + << "incorrect value for last_msg_.obs[3].sid.sat, expected 212, is " + << last_msg_.obs[3].sid.sat; + EXPECT_EQ(last_msg_.obs[4].L.f, 186) + << "incorrect value for last_msg_.obs[4].L.f, expected 186, is " + << last_msg_.obs[4].L.f; + EXPECT_EQ(last_msg_.obs[4].L.i, 109692070) + << "incorrect value for last_msg_.obs[4].L.i, expected 109692070, is " + << last_msg_.obs[4].L.i; + EXPECT_EQ(last_msg_.obs[4].P, 2087295852) + << "incorrect value for last_msg_.obs[4].P, expected 2087295852, is " + << last_msg_.obs[4].P; + EXPECT_EQ(last_msg_.obs[4].cn0, 170) + << "incorrect value for last_msg_.obs[4].cn0, expected 170, is " + << last_msg_.obs[4].cn0; + EXPECT_EQ(last_msg_.obs[4].lock, 0) + << "incorrect value for last_msg_.obs[4].lock, expected 0, is " + << last_msg_.obs[4].lock; + EXPECT_EQ(last_msg_.obs[4].sid.code, 0) + << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " + << last_msg_.obs[4].sid.code; + EXPECT_EQ(last_msg_.obs[4].sid.reserved, 0) + << "incorrect value for last_msg_.obs[4].sid.reserved, expected 0, is " + << last_msg_.obs[4].sid.reserved; + EXPECT_EQ(last_msg_.obs[4].sid.sat, 217) + << "incorrect value for last_msg_.obs[4].sid.sat, expected 217, is " + << last_msg_.obs[4].sid.sat; + EXPECT_EQ(last_msg_.obs[5].L.f, 236) + << "incorrect value for last_msg_.obs[5].L.f, expected 236, is " + << last_msg_.obs[5].L.f; + EXPECT_EQ(last_msg_.obs[5].L.i, 123339597) + << "incorrect value for last_msg_.obs[5].L.i, expected 123339597, is " + << last_msg_.obs[5].L.i; + EXPECT_EQ(last_msg_.obs[5].P, 2347011798) + << "incorrect value for last_msg_.obs[5].P, expected 2347011798, is " + << last_msg_.obs[5].P; + EXPECT_EQ(last_msg_.obs[5].cn0, 151) + << "incorrect value for last_msg_.obs[5].cn0, expected 151, is " + << last_msg_.obs[5].cn0; + EXPECT_EQ(last_msg_.obs[5].lock, 0) + << "incorrect value for last_msg_.obs[5].lock, expected 0, is " + << last_msg_.obs[5].lock; + EXPECT_EQ(last_msg_.obs[5].sid.code, 0) + << "incorrect value for last_msg_.obs[5].sid.code, expected 0, is " + << last_msg_.obs[5].sid.code; + EXPECT_EQ(last_msg_.obs[5].sid.reserved, 0) + << "incorrect value for last_msg_.obs[5].sid.reserved, expected 0, is " + << last_msg_.obs[5].sid.reserved; + EXPECT_EQ(last_msg_.obs[5].sid.sat, 218) + << "incorrect value for last_msg_.obs[5].sid.sat, expected 218, is " + << last_msg_.obs[5].sid.sat; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgObsDepC.cc b/c/test/cpp/auto_check_sbp_observation_MsgObsDepC.cc index 68d31be8e..68d590b8e 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgObsDepC.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgObsDepC.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepC.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgObsDepC0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgObsDepC0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgObsDepC0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgObsDepC0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_c_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,189 +67,288 @@ class Test_auto_check_sbp_observation_MsgObsDepC0 : sbp_msg_obs_dep_c_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgObsDepC0, Test) -{ - - uint8_t encoded_frame[] = {85,73,0,70,152,87,8,95,183,24,106,7,32,126,250,73,80,113,94,247,255,231,163,229,229,4,0,0,0,60,220,96,70,81,147,250,255,196,208,20,28,6,0,0,0,248,61,62,77,28,60,242,255,110,171,180,178,7,0,0,0,237,84,190,77,172,37,13,0,41,170,233,164,10,0,0,0,36,85,9,75,240,188,21,0,19,182,196,209,12,0,0,0,190,175, }; - - sbp_msg_obs_dep_c_t test_msg{}; - test_msg.header.n_obs = 32; - test_msg.header.t.tow = 414670600; - test_msg.header.t.wn = 1898; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 5; - - test_msg.obs[0].L.f = 231; - test_msg.obs[0].L.i = -565647; - test_msg.obs[0].P = 1347025534; - test_msg.obs[0].cn0 = 163; - test_msg.obs[0].lock = 58853; - test_msg.obs[0].sid.code = 0; - test_msg.obs[0].sid.reserved = 0; - test_msg.obs[0].sid.sat = 4; - - test_msg.obs[1].L.f = 196; - test_msg.obs[1].L.i = -355503; - test_msg.obs[1].P = 1180752956; - test_msg.obs[1].cn0 = 208; - test_msg.obs[1].lock = 7188; - test_msg.obs[1].sid.code = 0; - test_msg.obs[1].sid.reserved = 0; - test_msg.obs[1].sid.sat = 6; - - test_msg.obs[2].L.f = 110; - test_msg.obs[2].L.i = -902116; - test_msg.obs[2].P = 1295924728; - test_msg.obs[2].cn0 = 171; - test_msg.obs[2].lock = 45748; - test_msg.obs[2].sid.code = 0; - test_msg.obs[2].sid.reserved = 0; - test_msg.obs[2].sid.sat = 7; - - test_msg.obs[3].L.f = 41; - test_msg.obs[3].L.i = 861612; - test_msg.obs[3].P = 1304319213; - test_msg.obs[3].cn0 = 170; - test_msg.obs[3].lock = 42217; - test_msg.obs[3].sid.code = 0; - test_msg.obs[3].sid.reserved = 0; - test_msg.obs[3].sid.sat = 10; - - test_msg.obs[4].L.f = 19; - test_msg.obs[4].L.i = 1424624; - test_msg.obs[4].P = 1258902820; - test_msg.obs[4].cn0 = 182; - test_msg.obs[4].lock = 53700; - test_msg.obs[4].sid.code = 0; - test_msg.obs[4].sid.reserved = 0; - test_msg.obs[4].sid.sat = 12; - - EXPECT_EQ(send_message( 38982, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 38982); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 32) << "incorrect value for last_msg_.header.n_obs, expected 32, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 414670600) << "incorrect value for last_msg_.header.t.tow, expected 414670600, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1898) << "incorrect value for last_msg_.header.t.wn, expected 1898, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 5) << "incorrect value for last_msg_.n_obs.value, expected 5, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 231) << "incorrect value for last_msg_.obs[0].L.f, expected 231, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, -565647) << "incorrect value for last_msg_.obs[0].L.i, expected -565647, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 1347025534) << "incorrect value for last_msg_.obs[0].P, expected 1347025534, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 163) << "incorrect value for last_msg_.obs[0].cn0, expected 163, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 58853) << "incorrect value for last_msg_.obs[0].lock, expected 58853, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].sid.code, 0) << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " << last_msg_.obs[0].sid.code; - EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " << last_msg_.obs[0].sid.reserved; - EXPECT_EQ(last_msg_.obs[0].sid.sat, 4) << "incorrect value for last_msg_.obs[0].sid.sat, expected 4, is " << last_msg_.obs[0].sid.sat; - EXPECT_EQ(last_msg_.obs[1].L.f, 196) << "incorrect value for last_msg_.obs[1].L.f, expected 196, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, -355503) << "incorrect value for last_msg_.obs[1].L.i, expected -355503, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 1180752956) << "incorrect value for last_msg_.obs[1].P, expected 1180752956, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].cn0, 208) << "incorrect value for last_msg_.obs[1].cn0, expected 208, is " << last_msg_.obs[1].cn0; - EXPECT_EQ(last_msg_.obs[1].lock, 7188) << "incorrect value for last_msg_.obs[1].lock, expected 7188, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].sid.code, 0) << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " << last_msg_.obs[1].sid.code; - EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " << last_msg_.obs[1].sid.reserved; - EXPECT_EQ(last_msg_.obs[1].sid.sat, 6) << "incorrect value for last_msg_.obs[1].sid.sat, expected 6, is " << last_msg_.obs[1].sid.sat; - EXPECT_EQ(last_msg_.obs[2].L.f, 110) << "incorrect value for last_msg_.obs[2].L.f, expected 110, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, -902116) << "incorrect value for last_msg_.obs[2].L.i, expected -902116, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 1295924728) << "incorrect value for last_msg_.obs[2].P, expected 1295924728, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].cn0, 171) << "incorrect value for last_msg_.obs[2].cn0, expected 171, is " << last_msg_.obs[2].cn0; - EXPECT_EQ(last_msg_.obs[2].lock, 45748) << "incorrect value for last_msg_.obs[2].lock, expected 45748, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].sid.code, 0) << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " << last_msg_.obs[2].sid.code; - EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " << last_msg_.obs[2].sid.reserved; - EXPECT_EQ(last_msg_.obs[2].sid.sat, 7) << "incorrect value for last_msg_.obs[2].sid.sat, expected 7, is " << last_msg_.obs[2].sid.sat; - EXPECT_EQ(last_msg_.obs[3].L.f, 41) << "incorrect value for last_msg_.obs[3].L.f, expected 41, is " << last_msg_.obs[3].L.f; - EXPECT_EQ(last_msg_.obs[3].L.i, 861612) << "incorrect value for last_msg_.obs[3].L.i, expected 861612, is " << last_msg_.obs[3].L.i; - EXPECT_EQ(last_msg_.obs[3].P, 1304319213) << "incorrect value for last_msg_.obs[3].P, expected 1304319213, is " << last_msg_.obs[3].P; - EXPECT_EQ(last_msg_.obs[3].cn0, 170) << "incorrect value for last_msg_.obs[3].cn0, expected 170, is " << last_msg_.obs[3].cn0; - EXPECT_EQ(last_msg_.obs[3].lock, 42217) << "incorrect value for last_msg_.obs[3].lock, expected 42217, is " << last_msg_.obs[3].lock; - EXPECT_EQ(last_msg_.obs[3].sid.code, 0) << "incorrect value for last_msg_.obs[3].sid.code, expected 0, is " << last_msg_.obs[3].sid.code; - EXPECT_EQ(last_msg_.obs[3].sid.reserved, 0) << "incorrect value for last_msg_.obs[3].sid.reserved, expected 0, is " << last_msg_.obs[3].sid.reserved; - EXPECT_EQ(last_msg_.obs[3].sid.sat, 10) << "incorrect value for last_msg_.obs[3].sid.sat, expected 10, is " << last_msg_.obs[3].sid.sat; - EXPECT_EQ(last_msg_.obs[4].L.f, 19) << "incorrect value for last_msg_.obs[4].L.f, expected 19, is " << last_msg_.obs[4].L.f; - EXPECT_EQ(last_msg_.obs[4].L.i, 1424624) << "incorrect value for last_msg_.obs[4].L.i, expected 1424624, is " << last_msg_.obs[4].L.i; - EXPECT_EQ(last_msg_.obs[4].P, 1258902820) << "incorrect value for last_msg_.obs[4].P, expected 1258902820, is " << last_msg_.obs[4].P; - EXPECT_EQ(last_msg_.obs[4].cn0, 182) << "incorrect value for last_msg_.obs[4].cn0, expected 182, is " << last_msg_.obs[4].cn0; - EXPECT_EQ(last_msg_.obs[4].lock, 53700) << "incorrect value for last_msg_.obs[4].lock, expected 53700, is " << last_msg_.obs[4].lock; - EXPECT_EQ(last_msg_.obs[4].sid.code, 0) << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " << last_msg_.obs[4].sid.code; - EXPECT_EQ(last_msg_.obs[4].sid.reserved, 0) << "incorrect value for last_msg_.obs[4].sid.reserved, expected 0, is " << last_msg_.obs[4].sid.reserved; - EXPECT_EQ(last_msg_.obs[4].sid.sat, 12) << "incorrect value for last_msg_.obs[4].sid.sat, expected 12, is " << last_msg_.obs[4].sid.sat; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgObsDepC0, Test) { + uint8_t encoded_frame[] = { + 85, 73, 0, 70, 152, 87, 8, 95, 183, 24, 106, 7, 32, 126, 250, 73, + 80, 113, 94, 247, 255, 231, 163, 229, 229, 4, 0, 0, 0, 60, 220, 96, + 70, 81, 147, 250, 255, 196, 208, 20, 28, 6, 0, 0, 0, 248, 61, 62, + 77, 28, 60, 242, 255, 110, 171, 180, 178, 7, 0, 0, 0, 237, 84, 190, + 77, 172, 37, 13, 0, 41, 170, 233, 164, 10, 0, 0, 0, 36, 85, 9, + 75, 240, 188, 21, 0, 19, 182, 196, 209, 12, 0, 0, 0, 190, 175, + }; + + sbp_msg_obs_dep_c_t test_msg{}; + test_msg.header.n_obs = 32; + test_msg.header.t.tow = 414670600; + test_msg.header.t.wn = 1898; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 5; + + test_msg.obs[0].L.f = 231; + test_msg.obs[0].L.i = -565647; + test_msg.obs[0].P = 1347025534; + test_msg.obs[0].cn0 = 163; + test_msg.obs[0].lock = 58853; + test_msg.obs[0].sid.code = 0; + test_msg.obs[0].sid.reserved = 0; + test_msg.obs[0].sid.sat = 4; + + test_msg.obs[1].L.f = 196; + test_msg.obs[1].L.i = -355503; + test_msg.obs[1].P = 1180752956; + test_msg.obs[1].cn0 = 208; + test_msg.obs[1].lock = 7188; + test_msg.obs[1].sid.code = 0; + test_msg.obs[1].sid.reserved = 0; + test_msg.obs[1].sid.sat = 6; + + test_msg.obs[2].L.f = 110; + test_msg.obs[2].L.i = -902116; + test_msg.obs[2].P = 1295924728; + test_msg.obs[2].cn0 = 171; + test_msg.obs[2].lock = 45748; + test_msg.obs[2].sid.code = 0; + test_msg.obs[2].sid.reserved = 0; + test_msg.obs[2].sid.sat = 7; + + test_msg.obs[3].L.f = 41; + test_msg.obs[3].L.i = 861612; + test_msg.obs[3].P = 1304319213; + test_msg.obs[3].cn0 = 170; + test_msg.obs[3].lock = 42217; + test_msg.obs[3].sid.code = 0; + test_msg.obs[3].sid.reserved = 0; + test_msg.obs[3].sid.sat = 10; + + test_msg.obs[4].L.f = 19; + test_msg.obs[4].L.i = 1424624; + test_msg.obs[4].P = 1258902820; + test_msg.obs[4].cn0 = 182; + test_msg.obs[4].lock = 53700; + test_msg.obs[4].sid.code = 0; + test_msg.obs[4].sid.reserved = 0; + test_msg.obs[4].sid.sat = 12; + + EXPECT_EQ(send_message(38982, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 38982); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 32) + << "incorrect value for last_msg_.header.n_obs, expected 32, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 414670600) + << "incorrect value for last_msg_.header.t.tow, expected 414670600, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1898) + << "incorrect value for last_msg_.header.t.wn, expected 1898, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 5) + << "incorrect value for last_msg_.n_obs.value, expected 5, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 231) + << "incorrect value for last_msg_.obs[0].L.f, expected 231, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, -565647) + << "incorrect value for last_msg_.obs[0].L.i, expected -565647, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 1347025534) + << "incorrect value for last_msg_.obs[0].P, expected 1347025534, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 163) + << "incorrect value for last_msg_.obs[0].cn0, expected 163, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 58853) + << "incorrect value for last_msg_.obs[0].lock, expected 58853, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].sid.code, 0) + << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " + << last_msg_.obs[0].sid.code; + EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) + << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " + << last_msg_.obs[0].sid.reserved; + EXPECT_EQ(last_msg_.obs[0].sid.sat, 4) + << "incorrect value for last_msg_.obs[0].sid.sat, expected 4, is " + << last_msg_.obs[0].sid.sat; + EXPECT_EQ(last_msg_.obs[1].L.f, 196) + << "incorrect value for last_msg_.obs[1].L.f, expected 196, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, -355503) + << "incorrect value for last_msg_.obs[1].L.i, expected -355503, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 1180752956) + << "incorrect value for last_msg_.obs[1].P, expected 1180752956, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].cn0, 208) + << "incorrect value for last_msg_.obs[1].cn0, expected 208, is " + << last_msg_.obs[1].cn0; + EXPECT_EQ(last_msg_.obs[1].lock, 7188) + << "incorrect value for last_msg_.obs[1].lock, expected 7188, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].sid.code, 0) + << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " + << last_msg_.obs[1].sid.code; + EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) + << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " + << last_msg_.obs[1].sid.reserved; + EXPECT_EQ(last_msg_.obs[1].sid.sat, 6) + << "incorrect value for last_msg_.obs[1].sid.sat, expected 6, is " + << last_msg_.obs[1].sid.sat; + EXPECT_EQ(last_msg_.obs[2].L.f, 110) + << "incorrect value for last_msg_.obs[2].L.f, expected 110, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, -902116) + << "incorrect value for last_msg_.obs[2].L.i, expected -902116, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 1295924728) + << "incorrect value for last_msg_.obs[2].P, expected 1295924728, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].cn0, 171) + << "incorrect value for last_msg_.obs[2].cn0, expected 171, is " + << last_msg_.obs[2].cn0; + EXPECT_EQ(last_msg_.obs[2].lock, 45748) + << "incorrect value for last_msg_.obs[2].lock, expected 45748, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].sid.code, 0) + << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " + << last_msg_.obs[2].sid.code; + EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) + << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " + << last_msg_.obs[2].sid.reserved; + EXPECT_EQ(last_msg_.obs[2].sid.sat, 7) + << "incorrect value for last_msg_.obs[2].sid.sat, expected 7, is " + << last_msg_.obs[2].sid.sat; + EXPECT_EQ(last_msg_.obs[3].L.f, 41) + << "incorrect value for last_msg_.obs[3].L.f, expected 41, is " + << last_msg_.obs[3].L.f; + EXPECT_EQ(last_msg_.obs[3].L.i, 861612) + << "incorrect value for last_msg_.obs[3].L.i, expected 861612, is " + << last_msg_.obs[3].L.i; + EXPECT_EQ(last_msg_.obs[3].P, 1304319213) + << "incorrect value for last_msg_.obs[3].P, expected 1304319213, is " + << last_msg_.obs[3].P; + EXPECT_EQ(last_msg_.obs[3].cn0, 170) + << "incorrect value for last_msg_.obs[3].cn0, expected 170, is " + << last_msg_.obs[3].cn0; + EXPECT_EQ(last_msg_.obs[3].lock, 42217) + << "incorrect value for last_msg_.obs[3].lock, expected 42217, is " + << last_msg_.obs[3].lock; + EXPECT_EQ(last_msg_.obs[3].sid.code, 0) + << "incorrect value for last_msg_.obs[3].sid.code, expected 0, is " + << last_msg_.obs[3].sid.code; + EXPECT_EQ(last_msg_.obs[3].sid.reserved, 0) + << "incorrect value for last_msg_.obs[3].sid.reserved, expected 0, is " + << last_msg_.obs[3].sid.reserved; + EXPECT_EQ(last_msg_.obs[3].sid.sat, 10) + << "incorrect value for last_msg_.obs[3].sid.sat, expected 10, is " + << last_msg_.obs[3].sid.sat; + EXPECT_EQ(last_msg_.obs[4].L.f, 19) + << "incorrect value for last_msg_.obs[4].L.f, expected 19, is " + << last_msg_.obs[4].L.f; + EXPECT_EQ(last_msg_.obs[4].L.i, 1424624) + << "incorrect value for last_msg_.obs[4].L.i, expected 1424624, is " + << last_msg_.obs[4].L.i; + EXPECT_EQ(last_msg_.obs[4].P, 1258902820) + << "incorrect value for last_msg_.obs[4].P, expected 1258902820, is " + << last_msg_.obs[4].P; + EXPECT_EQ(last_msg_.obs[4].cn0, 182) + << "incorrect value for last_msg_.obs[4].cn0, expected 182, is " + << last_msg_.obs[4].cn0; + EXPECT_EQ(last_msg_.obs[4].lock, 53700) + << "incorrect value for last_msg_.obs[4].lock, expected 53700, is " + << last_msg_.obs[4].lock; + EXPECT_EQ(last_msg_.obs[4].sid.code, 0) + << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " + << last_msg_.obs[4].sid.code; + EXPECT_EQ(last_msg_.obs[4].sid.reserved, 0) + << "incorrect value for last_msg_.obs[4].sid.reserved, expected 0, is " + << last_msg_.obs[4].sid.reserved; + EXPECT_EQ(last_msg_.obs[4].sid.sat, 12) + << "incorrect value for last_msg_.obs[4].sid.sat, expected 12, is " + << last_msg_.obs[4].sid.sat; } -class Test_auto_check_sbp_observation_MsgObsDepC1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgObsDepC1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_MsgObsDepC1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgObsDepC1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_c_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -261,155 +356,220 @@ class Test_auto_check_sbp_observation_MsgObsDepC1 : sbp_msg_obs_dep_c_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgObsDepC1, Test) -{ - - uint8_t encoded_frame[] = {85,73,0,70,152,55,8,95,183,24,106,7,33,68,166,75,77,186,230,24,0,101,186,162,102,16,0,0,0,87,255,155,69,74,158,5,0,26,190,206,30,27,0,0,0,64,89,124,68,26,22,3,0,114,217,225,73,29,0,0,0,37,179, }; - - sbp_msg_obs_dep_c_t test_msg{}; - test_msg.header.n_obs = 33; - test_msg.header.t.tow = 414670600; - test_msg.header.t.wn = 1898; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 3; - - test_msg.obs[0].L.f = 101; - test_msg.obs[0].L.i = 1631930; - test_msg.obs[0].P = 1296803396; - test_msg.obs[0].cn0 = 186; - test_msg.obs[0].lock = 26274; - test_msg.obs[0].sid.code = 0; - test_msg.obs[0].sid.reserved = 0; - test_msg.obs[0].sid.sat = 16; - - test_msg.obs[1].L.f = 26; - test_msg.obs[1].L.i = 368202; - test_msg.obs[1].P = 1167851351; - test_msg.obs[1].cn0 = 190; - test_msg.obs[1].lock = 7886; - test_msg.obs[1].sid.code = 0; - test_msg.obs[1].sid.reserved = 0; - test_msg.obs[1].sid.sat = 27; - - test_msg.obs[2].L.f = 114; - test_msg.obs[2].L.i = 202266; - test_msg.obs[2].P = 1149000000; - test_msg.obs[2].cn0 = 217; - test_msg.obs[2].lock = 18913; - test_msg.obs[2].sid.code = 0; - test_msg.obs[2].sid.reserved = 0; - test_msg.obs[2].sid.sat = 29; - - EXPECT_EQ(send_message( 38982, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 38982); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 33) << "incorrect value for last_msg_.header.n_obs, expected 33, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 414670600) << "incorrect value for last_msg_.header.t.tow, expected 414670600, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1898) << "incorrect value for last_msg_.header.t.wn, expected 1898, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 3) << "incorrect value for last_msg_.n_obs.value, expected 3, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 101) << "incorrect value for last_msg_.obs[0].L.f, expected 101, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, 1631930) << "incorrect value for last_msg_.obs[0].L.i, expected 1631930, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 1296803396) << "incorrect value for last_msg_.obs[0].P, expected 1296803396, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 186) << "incorrect value for last_msg_.obs[0].cn0, expected 186, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 26274) << "incorrect value for last_msg_.obs[0].lock, expected 26274, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].sid.code, 0) << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " << last_msg_.obs[0].sid.code; - EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " << last_msg_.obs[0].sid.reserved; - EXPECT_EQ(last_msg_.obs[0].sid.sat, 16) << "incorrect value for last_msg_.obs[0].sid.sat, expected 16, is " << last_msg_.obs[0].sid.sat; - EXPECT_EQ(last_msg_.obs[1].L.f, 26) << "incorrect value for last_msg_.obs[1].L.f, expected 26, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, 368202) << "incorrect value for last_msg_.obs[1].L.i, expected 368202, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 1167851351) << "incorrect value for last_msg_.obs[1].P, expected 1167851351, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].cn0, 190) << "incorrect value for last_msg_.obs[1].cn0, expected 190, is " << last_msg_.obs[1].cn0; - EXPECT_EQ(last_msg_.obs[1].lock, 7886) << "incorrect value for last_msg_.obs[1].lock, expected 7886, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].sid.code, 0) << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " << last_msg_.obs[1].sid.code; - EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " << last_msg_.obs[1].sid.reserved; - EXPECT_EQ(last_msg_.obs[1].sid.sat, 27) << "incorrect value for last_msg_.obs[1].sid.sat, expected 27, is " << last_msg_.obs[1].sid.sat; - EXPECT_EQ(last_msg_.obs[2].L.f, 114) << "incorrect value for last_msg_.obs[2].L.f, expected 114, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, 202266) << "incorrect value for last_msg_.obs[2].L.i, expected 202266, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 1149000000) << "incorrect value for last_msg_.obs[2].P, expected 1149000000, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].cn0, 217) << "incorrect value for last_msg_.obs[2].cn0, expected 217, is " << last_msg_.obs[2].cn0; - EXPECT_EQ(last_msg_.obs[2].lock, 18913) << "incorrect value for last_msg_.obs[2].lock, expected 18913, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].sid.code, 0) << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " << last_msg_.obs[2].sid.code; - EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " << last_msg_.obs[2].sid.reserved; - EXPECT_EQ(last_msg_.obs[2].sid.sat, 29) << "incorrect value for last_msg_.obs[2].sid.sat, expected 29, is " << last_msg_.obs[2].sid.sat; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgObsDepC1, Test) { + uint8_t encoded_frame[] = { + 85, 73, 0, 70, 152, 55, 8, 95, 183, 24, 106, 7, 33, 68, 166, 75, + 77, 186, 230, 24, 0, 101, 186, 162, 102, 16, 0, 0, 0, 87, 255, 155, + 69, 74, 158, 5, 0, 26, 190, 206, 30, 27, 0, 0, 0, 64, 89, 124, + 68, 26, 22, 3, 0, 114, 217, 225, 73, 29, 0, 0, 0, 37, 179, + }; + + sbp_msg_obs_dep_c_t test_msg{}; + test_msg.header.n_obs = 33; + test_msg.header.t.tow = 414670600; + test_msg.header.t.wn = 1898; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 3; + + test_msg.obs[0].L.f = 101; + test_msg.obs[0].L.i = 1631930; + test_msg.obs[0].P = 1296803396; + test_msg.obs[0].cn0 = 186; + test_msg.obs[0].lock = 26274; + test_msg.obs[0].sid.code = 0; + test_msg.obs[0].sid.reserved = 0; + test_msg.obs[0].sid.sat = 16; + + test_msg.obs[1].L.f = 26; + test_msg.obs[1].L.i = 368202; + test_msg.obs[1].P = 1167851351; + test_msg.obs[1].cn0 = 190; + test_msg.obs[1].lock = 7886; + test_msg.obs[1].sid.code = 0; + test_msg.obs[1].sid.reserved = 0; + test_msg.obs[1].sid.sat = 27; + + test_msg.obs[2].L.f = 114; + test_msg.obs[2].L.i = 202266; + test_msg.obs[2].P = 1149000000; + test_msg.obs[2].cn0 = 217; + test_msg.obs[2].lock = 18913; + test_msg.obs[2].sid.code = 0; + test_msg.obs[2].sid.reserved = 0; + test_msg.obs[2].sid.sat = 29; + + EXPECT_EQ(send_message(38982, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 38982); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 33) + << "incorrect value for last_msg_.header.n_obs, expected 33, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 414670600) + << "incorrect value for last_msg_.header.t.tow, expected 414670600, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1898) + << "incorrect value for last_msg_.header.t.wn, expected 1898, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 3) + << "incorrect value for last_msg_.n_obs.value, expected 3, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 101) + << "incorrect value for last_msg_.obs[0].L.f, expected 101, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, 1631930) + << "incorrect value for last_msg_.obs[0].L.i, expected 1631930, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 1296803396) + << "incorrect value for last_msg_.obs[0].P, expected 1296803396, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 186) + << "incorrect value for last_msg_.obs[0].cn0, expected 186, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 26274) + << "incorrect value for last_msg_.obs[0].lock, expected 26274, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].sid.code, 0) + << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " + << last_msg_.obs[0].sid.code; + EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) + << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " + << last_msg_.obs[0].sid.reserved; + EXPECT_EQ(last_msg_.obs[0].sid.sat, 16) + << "incorrect value for last_msg_.obs[0].sid.sat, expected 16, is " + << last_msg_.obs[0].sid.sat; + EXPECT_EQ(last_msg_.obs[1].L.f, 26) + << "incorrect value for last_msg_.obs[1].L.f, expected 26, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, 368202) + << "incorrect value for last_msg_.obs[1].L.i, expected 368202, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 1167851351) + << "incorrect value for last_msg_.obs[1].P, expected 1167851351, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].cn0, 190) + << "incorrect value for last_msg_.obs[1].cn0, expected 190, is " + << last_msg_.obs[1].cn0; + EXPECT_EQ(last_msg_.obs[1].lock, 7886) + << "incorrect value for last_msg_.obs[1].lock, expected 7886, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].sid.code, 0) + << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " + << last_msg_.obs[1].sid.code; + EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) + << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " + << last_msg_.obs[1].sid.reserved; + EXPECT_EQ(last_msg_.obs[1].sid.sat, 27) + << "incorrect value for last_msg_.obs[1].sid.sat, expected 27, is " + << last_msg_.obs[1].sid.sat; + EXPECT_EQ(last_msg_.obs[2].L.f, 114) + << "incorrect value for last_msg_.obs[2].L.f, expected 114, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, 202266) + << "incorrect value for last_msg_.obs[2].L.i, expected 202266, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 1149000000) + << "incorrect value for last_msg_.obs[2].P, expected 1149000000, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].cn0, 217) + << "incorrect value for last_msg_.obs[2].cn0, expected 217, is " + << last_msg_.obs[2].cn0; + EXPECT_EQ(last_msg_.obs[2].lock, 18913) + << "incorrect value for last_msg_.obs[2].lock, expected 18913, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].sid.code, 0) + << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " + << last_msg_.obs[2].sid.code; + EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) + << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " + << last_msg_.obs[2].sid.reserved; + EXPECT_EQ(last_msg_.obs[2].sid.sat, 29) + << "incorrect value for last_msg_.obs[2].sid.sat, expected 29, is " + << last_msg_.obs[2].sid.sat; } -class Test_auto_check_sbp_observation_MsgObsDepC2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgObsDepC2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_MsgObsDepC2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgObsDepC2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_c_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -417,189 +577,288 @@ class Test_auto_check_sbp_observation_MsgObsDepC2 : sbp_msg_obs_dep_c_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgObsDepC2, Test) -{ - - uint8_t encoded_frame[] = {85,73,0,0,0,87,8,95,183,24,106,7,32,217,251,73,80,9,72,248,255,30,168,113,81,4,0,0,0,211,220,96,70,198,107,251,255,115,195,53,144,6,0,0,0,77,61,62,77,40,161,243,255,130,176,93,142,7,0,0,0,1,86,190,77,88,77,12,0,116,199,229,213,10,0,0,0,93,85,9,75,64,139,20,0,120,177,196,194,12,0,0,0,141,161, }; - - sbp_msg_obs_dep_c_t test_msg{}; - test_msg.header.n_obs = 32; - test_msg.header.t.tow = 414670600; - test_msg.header.t.wn = 1898; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 5; - - test_msg.obs[0].L.f = 30; - test_msg.obs[0].L.i = -505847; - test_msg.obs[0].P = 1347025881; - test_msg.obs[0].cn0 = 168; - test_msg.obs[0].lock = 20849; - test_msg.obs[0].sid.code = 0; - test_msg.obs[0].sid.reserved = 0; - test_msg.obs[0].sid.sat = 4; - - test_msg.obs[1].L.f = 115; - test_msg.obs[1].L.i = -300090; - test_msg.obs[1].P = 1180753107; - test_msg.obs[1].cn0 = 195; - test_msg.obs[1].lock = 36917; - test_msg.obs[1].sid.code = 0; - test_msg.obs[1].sid.reserved = 0; - test_msg.obs[1].sid.sat = 6; - - test_msg.obs[2].L.f = 130; - test_msg.obs[2].L.i = -810712; - test_msg.obs[2].P = 1295924557; - test_msg.obs[2].cn0 = 176; - test_msg.obs[2].lock = 36445; - test_msg.obs[2].sid.code = 0; - test_msg.obs[2].sid.reserved = 0; - test_msg.obs[2].sid.sat = 7; - - test_msg.obs[3].L.f = 116; - test_msg.obs[3].L.i = 806232; - test_msg.obs[3].P = 1304319489; - test_msg.obs[3].cn0 = 199; - test_msg.obs[3].lock = 54757; - test_msg.obs[3].sid.code = 0; - test_msg.obs[3].sid.reserved = 0; - test_msg.obs[3].sid.sat = 10; - - test_msg.obs[4].L.f = 120; - test_msg.obs[4].L.i = 1346368; - test_msg.obs[4].P = 1258902877; - test_msg.obs[4].cn0 = 177; - test_msg.obs[4].lock = 49860; - test_msg.obs[4].sid.code = 0; - test_msg.obs[4].sid.reserved = 0; - test_msg.obs[4].sid.sat = 12; - - EXPECT_EQ(send_message( 0, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 32) << "incorrect value for last_msg_.header.n_obs, expected 32, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 414670600) << "incorrect value for last_msg_.header.t.tow, expected 414670600, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1898) << "incorrect value for last_msg_.header.t.wn, expected 1898, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 5) << "incorrect value for last_msg_.n_obs.value, expected 5, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 30) << "incorrect value for last_msg_.obs[0].L.f, expected 30, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, -505847) << "incorrect value for last_msg_.obs[0].L.i, expected -505847, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 1347025881) << "incorrect value for last_msg_.obs[0].P, expected 1347025881, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 168) << "incorrect value for last_msg_.obs[0].cn0, expected 168, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 20849) << "incorrect value for last_msg_.obs[0].lock, expected 20849, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].sid.code, 0) << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " << last_msg_.obs[0].sid.code; - EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " << last_msg_.obs[0].sid.reserved; - EXPECT_EQ(last_msg_.obs[0].sid.sat, 4) << "incorrect value for last_msg_.obs[0].sid.sat, expected 4, is " << last_msg_.obs[0].sid.sat; - EXPECT_EQ(last_msg_.obs[1].L.f, 115) << "incorrect value for last_msg_.obs[1].L.f, expected 115, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, -300090) << "incorrect value for last_msg_.obs[1].L.i, expected -300090, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 1180753107) << "incorrect value for last_msg_.obs[1].P, expected 1180753107, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].cn0, 195) << "incorrect value for last_msg_.obs[1].cn0, expected 195, is " << last_msg_.obs[1].cn0; - EXPECT_EQ(last_msg_.obs[1].lock, 36917) << "incorrect value for last_msg_.obs[1].lock, expected 36917, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].sid.code, 0) << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " << last_msg_.obs[1].sid.code; - EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " << last_msg_.obs[1].sid.reserved; - EXPECT_EQ(last_msg_.obs[1].sid.sat, 6) << "incorrect value for last_msg_.obs[1].sid.sat, expected 6, is " << last_msg_.obs[1].sid.sat; - EXPECT_EQ(last_msg_.obs[2].L.f, 130) << "incorrect value for last_msg_.obs[2].L.f, expected 130, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, -810712) << "incorrect value for last_msg_.obs[2].L.i, expected -810712, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 1295924557) << "incorrect value for last_msg_.obs[2].P, expected 1295924557, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].cn0, 176) << "incorrect value for last_msg_.obs[2].cn0, expected 176, is " << last_msg_.obs[2].cn0; - EXPECT_EQ(last_msg_.obs[2].lock, 36445) << "incorrect value for last_msg_.obs[2].lock, expected 36445, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].sid.code, 0) << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " << last_msg_.obs[2].sid.code; - EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " << last_msg_.obs[2].sid.reserved; - EXPECT_EQ(last_msg_.obs[2].sid.sat, 7) << "incorrect value for last_msg_.obs[2].sid.sat, expected 7, is " << last_msg_.obs[2].sid.sat; - EXPECT_EQ(last_msg_.obs[3].L.f, 116) << "incorrect value for last_msg_.obs[3].L.f, expected 116, is " << last_msg_.obs[3].L.f; - EXPECT_EQ(last_msg_.obs[3].L.i, 806232) << "incorrect value for last_msg_.obs[3].L.i, expected 806232, is " << last_msg_.obs[3].L.i; - EXPECT_EQ(last_msg_.obs[3].P, 1304319489) << "incorrect value for last_msg_.obs[3].P, expected 1304319489, is " << last_msg_.obs[3].P; - EXPECT_EQ(last_msg_.obs[3].cn0, 199) << "incorrect value for last_msg_.obs[3].cn0, expected 199, is " << last_msg_.obs[3].cn0; - EXPECT_EQ(last_msg_.obs[3].lock, 54757) << "incorrect value for last_msg_.obs[3].lock, expected 54757, is " << last_msg_.obs[3].lock; - EXPECT_EQ(last_msg_.obs[3].sid.code, 0) << "incorrect value for last_msg_.obs[3].sid.code, expected 0, is " << last_msg_.obs[3].sid.code; - EXPECT_EQ(last_msg_.obs[3].sid.reserved, 0) << "incorrect value for last_msg_.obs[3].sid.reserved, expected 0, is " << last_msg_.obs[3].sid.reserved; - EXPECT_EQ(last_msg_.obs[3].sid.sat, 10) << "incorrect value for last_msg_.obs[3].sid.sat, expected 10, is " << last_msg_.obs[3].sid.sat; - EXPECT_EQ(last_msg_.obs[4].L.f, 120) << "incorrect value for last_msg_.obs[4].L.f, expected 120, is " << last_msg_.obs[4].L.f; - EXPECT_EQ(last_msg_.obs[4].L.i, 1346368) << "incorrect value for last_msg_.obs[4].L.i, expected 1346368, is " << last_msg_.obs[4].L.i; - EXPECT_EQ(last_msg_.obs[4].P, 1258902877) << "incorrect value for last_msg_.obs[4].P, expected 1258902877, is " << last_msg_.obs[4].P; - EXPECT_EQ(last_msg_.obs[4].cn0, 177) << "incorrect value for last_msg_.obs[4].cn0, expected 177, is " << last_msg_.obs[4].cn0; - EXPECT_EQ(last_msg_.obs[4].lock, 49860) << "incorrect value for last_msg_.obs[4].lock, expected 49860, is " << last_msg_.obs[4].lock; - EXPECT_EQ(last_msg_.obs[4].sid.code, 0) << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " << last_msg_.obs[4].sid.code; - EXPECT_EQ(last_msg_.obs[4].sid.reserved, 0) << "incorrect value for last_msg_.obs[4].sid.reserved, expected 0, is " << last_msg_.obs[4].sid.reserved; - EXPECT_EQ(last_msg_.obs[4].sid.sat, 12) << "incorrect value for last_msg_.obs[4].sid.sat, expected 12, is " << last_msg_.obs[4].sid.sat; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgObsDepC2, Test) { + uint8_t encoded_frame[] = { + 85, 73, 0, 0, 0, 87, 8, 95, 183, 24, 106, 7, 32, 217, 251, 73, + 80, 9, 72, 248, 255, 30, 168, 113, 81, 4, 0, 0, 0, 211, 220, 96, + 70, 198, 107, 251, 255, 115, 195, 53, 144, 6, 0, 0, 0, 77, 61, 62, + 77, 40, 161, 243, 255, 130, 176, 93, 142, 7, 0, 0, 0, 1, 86, 190, + 77, 88, 77, 12, 0, 116, 199, 229, 213, 10, 0, 0, 0, 93, 85, 9, + 75, 64, 139, 20, 0, 120, 177, 196, 194, 12, 0, 0, 0, 141, 161, + }; + + sbp_msg_obs_dep_c_t test_msg{}; + test_msg.header.n_obs = 32; + test_msg.header.t.tow = 414670600; + test_msg.header.t.wn = 1898; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 5; + + test_msg.obs[0].L.f = 30; + test_msg.obs[0].L.i = -505847; + test_msg.obs[0].P = 1347025881; + test_msg.obs[0].cn0 = 168; + test_msg.obs[0].lock = 20849; + test_msg.obs[0].sid.code = 0; + test_msg.obs[0].sid.reserved = 0; + test_msg.obs[0].sid.sat = 4; + + test_msg.obs[1].L.f = 115; + test_msg.obs[1].L.i = -300090; + test_msg.obs[1].P = 1180753107; + test_msg.obs[1].cn0 = 195; + test_msg.obs[1].lock = 36917; + test_msg.obs[1].sid.code = 0; + test_msg.obs[1].sid.reserved = 0; + test_msg.obs[1].sid.sat = 6; + + test_msg.obs[2].L.f = 130; + test_msg.obs[2].L.i = -810712; + test_msg.obs[2].P = 1295924557; + test_msg.obs[2].cn0 = 176; + test_msg.obs[2].lock = 36445; + test_msg.obs[2].sid.code = 0; + test_msg.obs[2].sid.reserved = 0; + test_msg.obs[2].sid.sat = 7; + + test_msg.obs[3].L.f = 116; + test_msg.obs[3].L.i = 806232; + test_msg.obs[3].P = 1304319489; + test_msg.obs[3].cn0 = 199; + test_msg.obs[3].lock = 54757; + test_msg.obs[3].sid.code = 0; + test_msg.obs[3].sid.reserved = 0; + test_msg.obs[3].sid.sat = 10; + + test_msg.obs[4].L.f = 120; + test_msg.obs[4].L.i = 1346368; + test_msg.obs[4].P = 1258902877; + test_msg.obs[4].cn0 = 177; + test_msg.obs[4].lock = 49860; + test_msg.obs[4].sid.code = 0; + test_msg.obs[4].sid.reserved = 0; + test_msg.obs[4].sid.sat = 12; + + EXPECT_EQ(send_message(0, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 32) + << "incorrect value for last_msg_.header.n_obs, expected 32, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 414670600) + << "incorrect value for last_msg_.header.t.tow, expected 414670600, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1898) + << "incorrect value for last_msg_.header.t.wn, expected 1898, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 5) + << "incorrect value for last_msg_.n_obs.value, expected 5, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 30) + << "incorrect value for last_msg_.obs[0].L.f, expected 30, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, -505847) + << "incorrect value for last_msg_.obs[0].L.i, expected -505847, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 1347025881) + << "incorrect value for last_msg_.obs[0].P, expected 1347025881, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 168) + << "incorrect value for last_msg_.obs[0].cn0, expected 168, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 20849) + << "incorrect value for last_msg_.obs[0].lock, expected 20849, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].sid.code, 0) + << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " + << last_msg_.obs[0].sid.code; + EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) + << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " + << last_msg_.obs[0].sid.reserved; + EXPECT_EQ(last_msg_.obs[0].sid.sat, 4) + << "incorrect value for last_msg_.obs[0].sid.sat, expected 4, is " + << last_msg_.obs[0].sid.sat; + EXPECT_EQ(last_msg_.obs[1].L.f, 115) + << "incorrect value for last_msg_.obs[1].L.f, expected 115, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, -300090) + << "incorrect value for last_msg_.obs[1].L.i, expected -300090, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 1180753107) + << "incorrect value for last_msg_.obs[1].P, expected 1180753107, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].cn0, 195) + << "incorrect value for last_msg_.obs[1].cn0, expected 195, is " + << last_msg_.obs[1].cn0; + EXPECT_EQ(last_msg_.obs[1].lock, 36917) + << "incorrect value for last_msg_.obs[1].lock, expected 36917, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].sid.code, 0) + << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " + << last_msg_.obs[1].sid.code; + EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) + << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " + << last_msg_.obs[1].sid.reserved; + EXPECT_EQ(last_msg_.obs[1].sid.sat, 6) + << "incorrect value for last_msg_.obs[1].sid.sat, expected 6, is " + << last_msg_.obs[1].sid.sat; + EXPECT_EQ(last_msg_.obs[2].L.f, 130) + << "incorrect value for last_msg_.obs[2].L.f, expected 130, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, -810712) + << "incorrect value for last_msg_.obs[2].L.i, expected -810712, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 1295924557) + << "incorrect value for last_msg_.obs[2].P, expected 1295924557, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].cn0, 176) + << "incorrect value for last_msg_.obs[2].cn0, expected 176, is " + << last_msg_.obs[2].cn0; + EXPECT_EQ(last_msg_.obs[2].lock, 36445) + << "incorrect value for last_msg_.obs[2].lock, expected 36445, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].sid.code, 0) + << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " + << last_msg_.obs[2].sid.code; + EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) + << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " + << last_msg_.obs[2].sid.reserved; + EXPECT_EQ(last_msg_.obs[2].sid.sat, 7) + << "incorrect value for last_msg_.obs[2].sid.sat, expected 7, is " + << last_msg_.obs[2].sid.sat; + EXPECT_EQ(last_msg_.obs[3].L.f, 116) + << "incorrect value for last_msg_.obs[3].L.f, expected 116, is " + << last_msg_.obs[3].L.f; + EXPECT_EQ(last_msg_.obs[3].L.i, 806232) + << "incorrect value for last_msg_.obs[3].L.i, expected 806232, is " + << last_msg_.obs[3].L.i; + EXPECT_EQ(last_msg_.obs[3].P, 1304319489) + << "incorrect value for last_msg_.obs[3].P, expected 1304319489, is " + << last_msg_.obs[3].P; + EXPECT_EQ(last_msg_.obs[3].cn0, 199) + << "incorrect value for last_msg_.obs[3].cn0, expected 199, is " + << last_msg_.obs[3].cn0; + EXPECT_EQ(last_msg_.obs[3].lock, 54757) + << "incorrect value for last_msg_.obs[3].lock, expected 54757, is " + << last_msg_.obs[3].lock; + EXPECT_EQ(last_msg_.obs[3].sid.code, 0) + << "incorrect value for last_msg_.obs[3].sid.code, expected 0, is " + << last_msg_.obs[3].sid.code; + EXPECT_EQ(last_msg_.obs[3].sid.reserved, 0) + << "incorrect value for last_msg_.obs[3].sid.reserved, expected 0, is " + << last_msg_.obs[3].sid.reserved; + EXPECT_EQ(last_msg_.obs[3].sid.sat, 10) + << "incorrect value for last_msg_.obs[3].sid.sat, expected 10, is " + << last_msg_.obs[3].sid.sat; + EXPECT_EQ(last_msg_.obs[4].L.f, 120) + << "incorrect value for last_msg_.obs[4].L.f, expected 120, is " + << last_msg_.obs[4].L.f; + EXPECT_EQ(last_msg_.obs[4].L.i, 1346368) + << "incorrect value for last_msg_.obs[4].L.i, expected 1346368, is " + << last_msg_.obs[4].L.i; + EXPECT_EQ(last_msg_.obs[4].P, 1258902877) + << "incorrect value for last_msg_.obs[4].P, expected 1258902877, is " + << last_msg_.obs[4].P; + EXPECT_EQ(last_msg_.obs[4].cn0, 177) + << "incorrect value for last_msg_.obs[4].cn0, expected 177, is " + << last_msg_.obs[4].cn0; + EXPECT_EQ(last_msg_.obs[4].lock, 49860) + << "incorrect value for last_msg_.obs[4].lock, expected 49860, is " + << last_msg_.obs[4].lock; + EXPECT_EQ(last_msg_.obs[4].sid.code, 0) + << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " + << last_msg_.obs[4].sid.code; + EXPECT_EQ(last_msg_.obs[4].sid.reserved, 0) + << "incorrect value for last_msg_.obs[4].sid.reserved, expected 0, is " + << last_msg_.obs[4].sid.reserved; + EXPECT_EQ(last_msg_.obs[4].sid.sat, 12) + << "incorrect value for last_msg_.obs[4].sid.sat, expected 12, is " + << last_msg_.obs[4].sid.sat; } -class Test_auto_check_sbp_observation_MsgObsDepC3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgObsDepC3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_MsgObsDepC3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgObsDepC3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_c_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -607,155 +866,220 @@ class Test_auto_check_sbp_observation_MsgObsDepC3 : sbp_msg_obs_dep_c_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgObsDepC3, Test) -{ - - uint8_t encoded_frame[] = {85,73,0,0,0,55,8,95,183,24,106,7,33,70,167,75,77,140,136,23,0,90,187,158,129,16,0,0,0,232,255,155,69,45,175,5,0,17,208,175,56,27,0,0,0,64,89,124,68,45,96,3,0,75,185,73,206,29,0,0,0,220,158, }; - - sbp_msg_obs_dep_c_t test_msg{}; - test_msg.header.n_obs = 33; - test_msg.header.t.tow = 414670600; - test_msg.header.t.wn = 1898; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 3; - - test_msg.obs[0].L.f = 90; - test_msg.obs[0].L.i = 1542284; - test_msg.obs[0].P = 1296803654; - test_msg.obs[0].cn0 = 187; - test_msg.obs[0].lock = 33182; - test_msg.obs[0].sid.code = 0; - test_msg.obs[0].sid.reserved = 0; - test_msg.obs[0].sid.sat = 16; - - test_msg.obs[1].L.f = 17; - test_msg.obs[1].L.i = 372525; - test_msg.obs[1].P = 1167851496; - test_msg.obs[1].cn0 = 208; - test_msg.obs[1].lock = 14511; - test_msg.obs[1].sid.code = 0; - test_msg.obs[1].sid.reserved = 0; - test_msg.obs[1].sid.sat = 27; - - test_msg.obs[2].L.f = 75; - test_msg.obs[2].L.i = 221229; - test_msg.obs[2].P = 1149000000; - test_msg.obs[2].cn0 = 185; - test_msg.obs[2].lock = 52809; - test_msg.obs[2].sid.code = 0; - test_msg.obs[2].sid.reserved = 0; - test_msg.obs[2].sid.sat = 29; - - EXPECT_EQ(send_message( 0, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 33) << "incorrect value for last_msg_.header.n_obs, expected 33, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 414670600) << "incorrect value for last_msg_.header.t.tow, expected 414670600, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1898) << "incorrect value for last_msg_.header.t.wn, expected 1898, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 3) << "incorrect value for last_msg_.n_obs.value, expected 3, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 90) << "incorrect value for last_msg_.obs[0].L.f, expected 90, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, 1542284) << "incorrect value for last_msg_.obs[0].L.i, expected 1542284, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 1296803654) << "incorrect value for last_msg_.obs[0].P, expected 1296803654, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 187) << "incorrect value for last_msg_.obs[0].cn0, expected 187, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 33182) << "incorrect value for last_msg_.obs[0].lock, expected 33182, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].sid.code, 0) << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " << last_msg_.obs[0].sid.code; - EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " << last_msg_.obs[0].sid.reserved; - EXPECT_EQ(last_msg_.obs[0].sid.sat, 16) << "incorrect value for last_msg_.obs[0].sid.sat, expected 16, is " << last_msg_.obs[0].sid.sat; - EXPECT_EQ(last_msg_.obs[1].L.f, 17) << "incorrect value for last_msg_.obs[1].L.f, expected 17, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, 372525) << "incorrect value for last_msg_.obs[1].L.i, expected 372525, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 1167851496) << "incorrect value for last_msg_.obs[1].P, expected 1167851496, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].cn0, 208) << "incorrect value for last_msg_.obs[1].cn0, expected 208, is " << last_msg_.obs[1].cn0; - EXPECT_EQ(last_msg_.obs[1].lock, 14511) << "incorrect value for last_msg_.obs[1].lock, expected 14511, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].sid.code, 0) << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " << last_msg_.obs[1].sid.code; - EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " << last_msg_.obs[1].sid.reserved; - EXPECT_EQ(last_msg_.obs[1].sid.sat, 27) << "incorrect value for last_msg_.obs[1].sid.sat, expected 27, is " << last_msg_.obs[1].sid.sat; - EXPECT_EQ(last_msg_.obs[2].L.f, 75) << "incorrect value for last_msg_.obs[2].L.f, expected 75, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, 221229) << "incorrect value for last_msg_.obs[2].L.i, expected 221229, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 1149000000) << "incorrect value for last_msg_.obs[2].P, expected 1149000000, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].cn0, 185) << "incorrect value for last_msg_.obs[2].cn0, expected 185, is " << last_msg_.obs[2].cn0; - EXPECT_EQ(last_msg_.obs[2].lock, 52809) << "incorrect value for last_msg_.obs[2].lock, expected 52809, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].sid.code, 0) << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " << last_msg_.obs[2].sid.code; - EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " << last_msg_.obs[2].sid.reserved; - EXPECT_EQ(last_msg_.obs[2].sid.sat, 29) << "incorrect value for last_msg_.obs[2].sid.sat, expected 29, is " << last_msg_.obs[2].sid.sat; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgObsDepC3, Test) { + uint8_t encoded_frame[] = { + 85, 73, 0, 0, 0, 55, 8, 95, 183, 24, 106, 7, 33, 70, 167, 75, + 77, 140, 136, 23, 0, 90, 187, 158, 129, 16, 0, 0, 0, 232, 255, 155, + 69, 45, 175, 5, 0, 17, 208, 175, 56, 27, 0, 0, 0, 64, 89, 124, + 68, 45, 96, 3, 0, 75, 185, 73, 206, 29, 0, 0, 0, 220, 158, + }; + + sbp_msg_obs_dep_c_t test_msg{}; + test_msg.header.n_obs = 33; + test_msg.header.t.tow = 414670600; + test_msg.header.t.wn = 1898; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 3; + + test_msg.obs[0].L.f = 90; + test_msg.obs[0].L.i = 1542284; + test_msg.obs[0].P = 1296803654; + test_msg.obs[0].cn0 = 187; + test_msg.obs[0].lock = 33182; + test_msg.obs[0].sid.code = 0; + test_msg.obs[0].sid.reserved = 0; + test_msg.obs[0].sid.sat = 16; + + test_msg.obs[1].L.f = 17; + test_msg.obs[1].L.i = 372525; + test_msg.obs[1].P = 1167851496; + test_msg.obs[1].cn0 = 208; + test_msg.obs[1].lock = 14511; + test_msg.obs[1].sid.code = 0; + test_msg.obs[1].sid.reserved = 0; + test_msg.obs[1].sid.sat = 27; + + test_msg.obs[2].L.f = 75; + test_msg.obs[2].L.i = 221229; + test_msg.obs[2].P = 1149000000; + test_msg.obs[2].cn0 = 185; + test_msg.obs[2].lock = 52809; + test_msg.obs[2].sid.code = 0; + test_msg.obs[2].sid.reserved = 0; + test_msg.obs[2].sid.sat = 29; + + EXPECT_EQ(send_message(0, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 33) + << "incorrect value for last_msg_.header.n_obs, expected 33, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 414670600) + << "incorrect value for last_msg_.header.t.tow, expected 414670600, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1898) + << "incorrect value for last_msg_.header.t.wn, expected 1898, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 3) + << "incorrect value for last_msg_.n_obs.value, expected 3, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 90) + << "incorrect value for last_msg_.obs[0].L.f, expected 90, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, 1542284) + << "incorrect value for last_msg_.obs[0].L.i, expected 1542284, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 1296803654) + << "incorrect value for last_msg_.obs[0].P, expected 1296803654, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 187) + << "incorrect value for last_msg_.obs[0].cn0, expected 187, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 33182) + << "incorrect value for last_msg_.obs[0].lock, expected 33182, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].sid.code, 0) + << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " + << last_msg_.obs[0].sid.code; + EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) + << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " + << last_msg_.obs[0].sid.reserved; + EXPECT_EQ(last_msg_.obs[0].sid.sat, 16) + << "incorrect value for last_msg_.obs[0].sid.sat, expected 16, is " + << last_msg_.obs[0].sid.sat; + EXPECT_EQ(last_msg_.obs[1].L.f, 17) + << "incorrect value for last_msg_.obs[1].L.f, expected 17, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, 372525) + << "incorrect value for last_msg_.obs[1].L.i, expected 372525, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 1167851496) + << "incorrect value for last_msg_.obs[1].P, expected 1167851496, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].cn0, 208) + << "incorrect value for last_msg_.obs[1].cn0, expected 208, is " + << last_msg_.obs[1].cn0; + EXPECT_EQ(last_msg_.obs[1].lock, 14511) + << "incorrect value for last_msg_.obs[1].lock, expected 14511, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].sid.code, 0) + << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " + << last_msg_.obs[1].sid.code; + EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) + << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " + << last_msg_.obs[1].sid.reserved; + EXPECT_EQ(last_msg_.obs[1].sid.sat, 27) + << "incorrect value for last_msg_.obs[1].sid.sat, expected 27, is " + << last_msg_.obs[1].sid.sat; + EXPECT_EQ(last_msg_.obs[2].L.f, 75) + << "incorrect value for last_msg_.obs[2].L.f, expected 75, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, 221229) + << "incorrect value for last_msg_.obs[2].L.i, expected 221229, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 1149000000) + << "incorrect value for last_msg_.obs[2].P, expected 1149000000, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].cn0, 185) + << "incorrect value for last_msg_.obs[2].cn0, expected 185, is " + << last_msg_.obs[2].cn0; + EXPECT_EQ(last_msg_.obs[2].lock, 52809) + << "incorrect value for last_msg_.obs[2].lock, expected 52809, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].sid.code, 0) + << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " + << last_msg_.obs[2].sid.code; + EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) + << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " + << last_msg_.obs[2].sid.reserved; + EXPECT_EQ(last_msg_.obs[2].sid.sat, 29) + << "incorrect value for last_msg_.obs[2].sid.sat, expected 29, is " + << last_msg_.obs[2].sid.sat; } -class Test_auto_check_sbp_observation_MsgObsDepC4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgObsDepC4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_MsgObsDepC4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgObsDepC4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_c_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -763,139 +1087,244 @@ class Test_auto_check_sbp_observation_MsgObsDepC4 : sbp_msg_obs_dep_c_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgObsDepC4, Test) -{ - - uint8_t encoded_frame[] = {85,73,0,70,152,87,208,95,183,24,106,7,32,44,8,74,80,86,93,247,255,57,158,229,229,4,0,0,0,224,229,96,70,156,146,250,255,221,200,20,28,6,0,0,0,60,82,62,77,93,58,242,255,39,164,180,178,7,0,0,0,222,73,190,77,46,39,13,0,202,181,233,164,10,0,0,0,149,64,9,75,114,191,21,0,249,182,196,209,12,0,0,0,112,8, }; - - sbp_msg_obs_dep_c_t test_msg{}; - test_msg.header.n_obs = 32; - test_msg.header.t.tow = 414670800; - test_msg.header.t.wn = 1898; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 5; - - test_msg.obs[0].L.f = 57; - test_msg.obs[0].L.i = -565930; - test_msg.obs[0].P = 1347029036; - test_msg.obs[0].cn0 = 158; - test_msg.obs[0].lock = 58853; - test_msg.obs[0].sid.code = 0; - test_msg.obs[0].sid.reserved = 0; - test_msg.obs[0].sid.sat = 4; - - test_msg.obs[1].L.f = 221; - test_msg.obs[1].L.i = -355684; - test_msg.obs[1].P = 1180755424; - test_msg.obs[1].cn0 = 200; - test_msg.obs[1].lock = 7188; - test_msg.obs[1].sid.code = 0; - test_msg.obs[1].sid.reserved = 0; - test_msg.obs[1].sid.sat = 6; - - test_msg.obs[2].L.f = 39; - test_msg.obs[2].L.i = -902563; - test_msg.obs[2].P = 1295929916; - test_msg.obs[2].cn0 = 164; - test_msg.obs[2].lock = 45748; - test_msg.obs[2].sid.code = 0; - test_msg.obs[2].sid.reserved = 0; - test_msg.obs[2].sid.sat = 7; - - test_msg.obs[3].L.f = 202; - test_msg.obs[3].L.i = 861998; - test_msg.obs[3].P = 1304316382; - test_msg.obs[3].cn0 = 181; - test_msg.obs[3].lock = 42217; - test_msg.obs[3].sid.code = 0; - test_msg.obs[3].sid.reserved = 0; - test_msg.obs[3].sid.sat = 10; - - test_msg.obs[4].L.f = 249; - test_msg.obs[4].L.i = 1425266; - test_msg.obs[4].P = 1258897557; - test_msg.obs[4].cn0 = 182; - test_msg.obs[4].lock = 53700; - test_msg.obs[4].sid.code = 0; - test_msg.obs[4].sid.reserved = 0; - test_msg.obs[4].sid.sat = 12; - - EXPECT_EQ(send_message( 38982, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 38982); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 32) << "incorrect value for last_msg_.header.n_obs, expected 32, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 414670800) << "incorrect value for last_msg_.header.t.tow, expected 414670800, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1898) << "incorrect value for last_msg_.header.t.wn, expected 1898, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 5) << "incorrect value for last_msg_.n_obs.value, expected 5, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 57) << "incorrect value for last_msg_.obs[0].L.f, expected 57, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, -565930) << "incorrect value for last_msg_.obs[0].L.i, expected -565930, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 1347029036) << "incorrect value for last_msg_.obs[0].P, expected 1347029036, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 158) << "incorrect value for last_msg_.obs[0].cn0, expected 158, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 58853) << "incorrect value for last_msg_.obs[0].lock, expected 58853, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].sid.code, 0) << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " << last_msg_.obs[0].sid.code; - EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " << last_msg_.obs[0].sid.reserved; - EXPECT_EQ(last_msg_.obs[0].sid.sat, 4) << "incorrect value for last_msg_.obs[0].sid.sat, expected 4, is " << last_msg_.obs[0].sid.sat; - EXPECT_EQ(last_msg_.obs[1].L.f, 221) << "incorrect value for last_msg_.obs[1].L.f, expected 221, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, -355684) << "incorrect value for last_msg_.obs[1].L.i, expected -355684, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 1180755424) << "incorrect value for last_msg_.obs[1].P, expected 1180755424, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].cn0, 200) << "incorrect value for last_msg_.obs[1].cn0, expected 200, is " << last_msg_.obs[1].cn0; - EXPECT_EQ(last_msg_.obs[1].lock, 7188) << "incorrect value for last_msg_.obs[1].lock, expected 7188, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].sid.code, 0) << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " << last_msg_.obs[1].sid.code; - EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " << last_msg_.obs[1].sid.reserved; - EXPECT_EQ(last_msg_.obs[1].sid.sat, 6) << "incorrect value for last_msg_.obs[1].sid.sat, expected 6, is " << last_msg_.obs[1].sid.sat; - EXPECT_EQ(last_msg_.obs[2].L.f, 39) << "incorrect value for last_msg_.obs[2].L.f, expected 39, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, -902563) << "incorrect value for last_msg_.obs[2].L.i, expected -902563, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 1295929916) << "incorrect value for last_msg_.obs[2].P, expected 1295929916, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].cn0, 164) << "incorrect value for last_msg_.obs[2].cn0, expected 164, is " << last_msg_.obs[2].cn0; - EXPECT_EQ(last_msg_.obs[2].lock, 45748) << "incorrect value for last_msg_.obs[2].lock, expected 45748, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].sid.code, 0) << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " << last_msg_.obs[2].sid.code; - EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " << last_msg_.obs[2].sid.reserved; - EXPECT_EQ(last_msg_.obs[2].sid.sat, 7) << "incorrect value for last_msg_.obs[2].sid.sat, expected 7, is " << last_msg_.obs[2].sid.sat; - EXPECT_EQ(last_msg_.obs[3].L.f, 202) << "incorrect value for last_msg_.obs[3].L.f, expected 202, is " << last_msg_.obs[3].L.f; - EXPECT_EQ(last_msg_.obs[3].L.i, 861998) << "incorrect value for last_msg_.obs[3].L.i, expected 861998, is " << last_msg_.obs[3].L.i; - EXPECT_EQ(last_msg_.obs[3].P, 1304316382) << "incorrect value for last_msg_.obs[3].P, expected 1304316382, is " << last_msg_.obs[3].P; - EXPECT_EQ(last_msg_.obs[3].cn0, 181) << "incorrect value for last_msg_.obs[3].cn0, expected 181, is " << last_msg_.obs[3].cn0; - EXPECT_EQ(last_msg_.obs[3].lock, 42217) << "incorrect value for last_msg_.obs[3].lock, expected 42217, is " << last_msg_.obs[3].lock; - EXPECT_EQ(last_msg_.obs[3].sid.code, 0) << "incorrect value for last_msg_.obs[3].sid.code, expected 0, is " << last_msg_.obs[3].sid.code; - EXPECT_EQ(last_msg_.obs[3].sid.reserved, 0) << "incorrect value for last_msg_.obs[3].sid.reserved, expected 0, is " << last_msg_.obs[3].sid.reserved; - EXPECT_EQ(last_msg_.obs[3].sid.sat, 10) << "incorrect value for last_msg_.obs[3].sid.sat, expected 10, is " << last_msg_.obs[3].sid.sat; - EXPECT_EQ(last_msg_.obs[4].L.f, 249) << "incorrect value for last_msg_.obs[4].L.f, expected 249, is " << last_msg_.obs[4].L.f; - EXPECT_EQ(last_msg_.obs[4].L.i, 1425266) << "incorrect value for last_msg_.obs[4].L.i, expected 1425266, is " << last_msg_.obs[4].L.i; - EXPECT_EQ(last_msg_.obs[4].P, 1258897557) << "incorrect value for last_msg_.obs[4].P, expected 1258897557, is " << last_msg_.obs[4].P; - EXPECT_EQ(last_msg_.obs[4].cn0, 182) << "incorrect value for last_msg_.obs[4].cn0, expected 182, is " << last_msg_.obs[4].cn0; - EXPECT_EQ(last_msg_.obs[4].lock, 53700) << "incorrect value for last_msg_.obs[4].lock, expected 53700, is " << last_msg_.obs[4].lock; - EXPECT_EQ(last_msg_.obs[4].sid.code, 0) << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " << last_msg_.obs[4].sid.code; - EXPECT_EQ(last_msg_.obs[4].sid.reserved, 0) << "incorrect value for last_msg_.obs[4].sid.reserved, expected 0, is " << last_msg_.obs[4].sid.reserved; - EXPECT_EQ(last_msg_.obs[4].sid.sat, 12) << "incorrect value for last_msg_.obs[4].sid.sat, expected 12, is " << last_msg_.obs[4].sid.sat; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgObsDepC4, Test) { + uint8_t encoded_frame[] = { + 85, 73, 0, 70, 152, 87, 208, 95, 183, 24, 106, 7, 32, 44, 8, 74, + 80, 86, 93, 247, 255, 57, 158, 229, 229, 4, 0, 0, 0, 224, 229, 96, + 70, 156, 146, 250, 255, 221, 200, 20, 28, 6, 0, 0, 0, 60, 82, 62, + 77, 93, 58, 242, 255, 39, 164, 180, 178, 7, 0, 0, 0, 222, 73, 190, + 77, 46, 39, 13, 0, 202, 181, 233, 164, 10, 0, 0, 0, 149, 64, 9, + 75, 114, 191, 21, 0, 249, 182, 196, 209, 12, 0, 0, 0, 112, 8, + }; + + sbp_msg_obs_dep_c_t test_msg{}; + test_msg.header.n_obs = 32; + test_msg.header.t.tow = 414670800; + test_msg.header.t.wn = 1898; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 5; + + test_msg.obs[0].L.f = 57; + test_msg.obs[0].L.i = -565930; + test_msg.obs[0].P = 1347029036; + test_msg.obs[0].cn0 = 158; + test_msg.obs[0].lock = 58853; + test_msg.obs[0].sid.code = 0; + test_msg.obs[0].sid.reserved = 0; + test_msg.obs[0].sid.sat = 4; + + test_msg.obs[1].L.f = 221; + test_msg.obs[1].L.i = -355684; + test_msg.obs[1].P = 1180755424; + test_msg.obs[1].cn0 = 200; + test_msg.obs[1].lock = 7188; + test_msg.obs[1].sid.code = 0; + test_msg.obs[1].sid.reserved = 0; + test_msg.obs[1].sid.sat = 6; + + test_msg.obs[2].L.f = 39; + test_msg.obs[2].L.i = -902563; + test_msg.obs[2].P = 1295929916; + test_msg.obs[2].cn0 = 164; + test_msg.obs[2].lock = 45748; + test_msg.obs[2].sid.code = 0; + test_msg.obs[2].sid.reserved = 0; + test_msg.obs[2].sid.sat = 7; + + test_msg.obs[3].L.f = 202; + test_msg.obs[3].L.i = 861998; + test_msg.obs[3].P = 1304316382; + test_msg.obs[3].cn0 = 181; + test_msg.obs[3].lock = 42217; + test_msg.obs[3].sid.code = 0; + test_msg.obs[3].sid.reserved = 0; + test_msg.obs[3].sid.sat = 10; + + test_msg.obs[4].L.f = 249; + test_msg.obs[4].L.i = 1425266; + test_msg.obs[4].P = 1258897557; + test_msg.obs[4].cn0 = 182; + test_msg.obs[4].lock = 53700; + test_msg.obs[4].sid.code = 0; + test_msg.obs[4].sid.reserved = 0; + test_msg.obs[4].sid.sat = 12; + + EXPECT_EQ(send_message(38982, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 38982); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 32) + << "incorrect value for last_msg_.header.n_obs, expected 32, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 414670800) + << "incorrect value for last_msg_.header.t.tow, expected 414670800, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1898) + << "incorrect value for last_msg_.header.t.wn, expected 1898, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 5) + << "incorrect value for last_msg_.n_obs.value, expected 5, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 57) + << "incorrect value for last_msg_.obs[0].L.f, expected 57, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, -565930) + << "incorrect value for last_msg_.obs[0].L.i, expected -565930, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 1347029036) + << "incorrect value for last_msg_.obs[0].P, expected 1347029036, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 158) + << "incorrect value for last_msg_.obs[0].cn0, expected 158, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 58853) + << "incorrect value for last_msg_.obs[0].lock, expected 58853, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].sid.code, 0) + << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " + << last_msg_.obs[0].sid.code; + EXPECT_EQ(last_msg_.obs[0].sid.reserved, 0) + << "incorrect value for last_msg_.obs[0].sid.reserved, expected 0, is " + << last_msg_.obs[0].sid.reserved; + EXPECT_EQ(last_msg_.obs[0].sid.sat, 4) + << "incorrect value for last_msg_.obs[0].sid.sat, expected 4, is " + << last_msg_.obs[0].sid.sat; + EXPECT_EQ(last_msg_.obs[1].L.f, 221) + << "incorrect value for last_msg_.obs[1].L.f, expected 221, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, -355684) + << "incorrect value for last_msg_.obs[1].L.i, expected -355684, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 1180755424) + << "incorrect value for last_msg_.obs[1].P, expected 1180755424, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].cn0, 200) + << "incorrect value for last_msg_.obs[1].cn0, expected 200, is " + << last_msg_.obs[1].cn0; + EXPECT_EQ(last_msg_.obs[1].lock, 7188) + << "incorrect value for last_msg_.obs[1].lock, expected 7188, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].sid.code, 0) + << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " + << last_msg_.obs[1].sid.code; + EXPECT_EQ(last_msg_.obs[1].sid.reserved, 0) + << "incorrect value for last_msg_.obs[1].sid.reserved, expected 0, is " + << last_msg_.obs[1].sid.reserved; + EXPECT_EQ(last_msg_.obs[1].sid.sat, 6) + << "incorrect value for last_msg_.obs[1].sid.sat, expected 6, is " + << last_msg_.obs[1].sid.sat; + EXPECT_EQ(last_msg_.obs[2].L.f, 39) + << "incorrect value for last_msg_.obs[2].L.f, expected 39, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, -902563) + << "incorrect value for last_msg_.obs[2].L.i, expected -902563, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 1295929916) + << "incorrect value for last_msg_.obs[2].P, expected 1295929916, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].cn0, 164) + << "incorrect value for last_msg_.obs[2].cn0, expected 164, is " + << last_msg_.obs[2].cn0; + EXPECT_EQ(last_msg_.obs[2].lock, 45748) + << "incorrect value for last_msg_.obs[2].lock, expected 45748, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].sid.code, 0) + << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " + << last_msg_.obs[2].sid.code; + EXPECT_EQ(last_msg_.obs[2].sid.reserved, 0) + << "incorrect value for last_msg_.obs[2].sid.reserved, expected 0, is " + << last_msg_.obs[2].sid.reserved; + EXPECT_EQ(last_msg_.obs[2].sid.sat, 7) + << "incorrect value for last_msg_.obs[2].sid.sat, expected 7, is " + << last_msg_.obs[2].sid.sat; + EXPECT_EQ(last_msg_.obs[3].L.f, 202) + << "incorrect value for last_msg_.obs[3].L.f, expected 202, is " + << last_msg_.obs[3].L.f; + EXPECT_EQ(last_msg_.obs[3].L.i, 861998) + << "incorrect value for last_msg_.obs[3].L.i, expected 861998, is " + << last_msg_.obs[3].L.i; + EXPECT_EQ(last_msg_.obs[3].P, 1304316382) + << "incorrect value for last_msg_.obs[3].P, expected 1304316382, is " + << last_msg_.obs[3].P; + EXPECT_EQ(last_msg_.obs[3].cn0, 181) + << "incorrect value for last_msg_.obs[3].cn0, expected 181, is " + << last_msg_.obs[3].cn0; + EXPECT_EQ(last_msg_.obs[3].lock, 42217) + << "incorrect value for last_msg_.obs[3].lock, expected 42217, is " + << last_msg_.obs[3].lock; + EXPECT_EQ(last_msg_.obs[3].sid.code, 0) + << "incorrect value for last_msg_.obs[3].sid.code, expected 0, is " + << last_msg_.obs[3].sid.code; + EXPECT_EQ(last_msg_.obs[3].sid.reserved, 0) + << "incorrect value for last_msg_.obs[3].sid.reserved, expected 0, is " + << last_msg_.obs[3].sid.reserved; + EXPECT_EQ(last_msg_.obs[3].sid.sat, 10) + << "incorrect value for last_msg_.obs[3].sid.sat, expected 10, is " + << last_msg_.obs[3].sid.sat; + EXPECT_EQ(last_msg_.obs[4].L.f, 249) + << "incorrect value for last_msg_.obs[4].L.f, expected 249, is " + << last_msg_.obs[4].L.f; + EXPECT_EQ(last_msg_.obs[4].L.i, 1425266) + << "incorrect value for last_msg_.obs[4].L.i, expected 1425266, is " + << last_msg_.obs[4].L.i; + EXPECT_EQ(last_msg_.obs[4].P, 1258897557) + << "incorrect value for last_msg_.obs[4].P, expected 1258897557, is " + << last_msg_.obs[4].P; + EXPECT_EQ(last_msg_.obs[4].cn0, 182) + << "incorrect value for last_msg_.obs[4].cn0, expected 182, is " + << last_msg_.obs[4].cn0; + EXPECT_EQ(last_msg_.obs[4].lock, 53700) + << "incorrect value for last_msg_.obs[4].lock, expected 53700, is " + << last_msg_.obs[4].lock; + EXPECT_EQ(last_msg_.obs[4].sid.code, 0) + << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " + << last_msg_.obs[4].sid.code; + EXPECT_EQ(last_msg_.obs[4].sid.reserved, 0) + << "incorrect value for last_msg_.obs[4].sid.reserved, expected 0, is " + << last_msg_.obs[4].sid.reserved; + EXPECT_EQ(last_msg_.obs[4].sid.sat, 12) + << "incorrect value for last_msg_.obs[4].sid.sat, expected 12, is " + << last_msg_.obs[4].sid.sat; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgOsr.cc b/c/test/cpp/auto_check_sbp_observation_MsgOsr.cc index ab3012ae8..7b9d3a842 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgOsr.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgOsr.cc @@ -10,60 +10,55 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgOsr.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgOsr.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgOsr0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgOsr0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgOsr0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgOsr0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_osr_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, const sbp_msg_osr_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,308 +66,586 @@ class Test_auto_check_sbp_observation_MsgOsr0 : sbp_msg_osr_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgOsr0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgOsr0, Test) { + uint8_t encoded_frame[] = { + 85, 64, 6, 0, 0, 239, 248, 225, 233, 29, 0, 0, 0, 0, 104, + 8, 64, 75, 143, 241, 68, 230, 250, 62, 7, 66, 15, 3, 1, 0, + 13, 0, 7, 0, 7, 0, 206, 232, 105, 63, 236, 49, 170, 6, 75, + 15, 3, 13, 0, 13, 0, 3, 0, 3, 0, 45, 145, 198, 62, 33, + 7, 153, 6, 128, 15, 3, 14, 0, 13, 0, 3, 0, 3, 0, 89, + 132, 204, 67, 143, 46, 32, 7, 127, 15, 3, 15, 0, 13, 0, 5, + 0, 5, 0, 244, 254, 164, 60, 22, 176, 95, 6, 55, 15, 3, 17, + 0, 0, 0, 2, 0, 2, 0, 106, 157, 101, 62, 151, 214, 142, 6, + 108, 15, 3, 19, 0, 13, 0, 3, 0, 3, 0, 81, 237, 60, 63, + 181, 119, 165, 6, 206, 15, 3, 28, 0, 13, 0, 3, 0, 3, 0, + 134, 228, 110, 64, 183, 159, 197, 6, 200, 15, 3, 30, 0, 13, 0, + 3, 0, 3, 0, 53, 144, 241, 68, 78, 112, 165, 5, 170, 15, 3, + 1, 6, 21, 0, 7, 0, 7, 0, 251, 232, 105, 63, 163, 128, 49, + 5, 129, 15, 3, 13, 6, 21, 0, 3, 0, 3, 0, 112, 145, 198, + 62, 37, 32, 36, 5, 46, 15, 3, 14, 6, 21, 0, 3, 0, 3, + 0, 166, 132, 204, 67, 184, 112, 141, 5, 95, 15, 3, 15, 6, 21, + 0, 5, 0, 5, 0, 121, 227, + }; + + sbp_msg_osr_t test_msg{}; + test_msg.header.n_obs = 64; + test_msg.header.t.ns_residual = 0; + test_msg.header.t.tow = 501867000; + test_msg.header.t.wn = 2152; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 12; - uint8_t encoded_frame[] = {85,64,6,0,0,239,248,225,233,29,0,0,0,0,104,8,64,75,143,241,68,230,250,62,7,66,15,3,1,0,13,0,7,0,7,0,206,232,105,63,236,49,170,6,75,15,3,13,0,13,0,3,0,3,0,45,145,198,62,33,7,153,6,128,15,3,14,0,13,0,3,0,3,0,89,132,204,67,143,46,32,7,127,15,3,15,0,13,0,5,0,5,0,244,254,164,60,22,176,95,6,55,15,3,17,0,0,0,2,0,2,0,106,157,101,62,151,214,142,6,108,15,3,19,0,13,0,3,0,3,0,81,237,60,63,181,119,165,6,206,15,3,28,0,13,0,3,0,3,0,134,228,110,64,183,159,197,6,200,15,3,30,0,13,0,3,0,3,0,53,144,241,68,78,112,165,5,170,15,3,1,6,21,0,7,0,7,0,251,232,105,63,163,128,49,5,129,15,3,13,6,21,0,3,0,3,0,112,145,198,62,37,32,36,5,46,15,3,14,6,21,0,3,0,3,0,166,132,204,67,184,112,141,5,95,15,3,15,6,21,0,5,0,5,0,121,227, }; + test_msg.obs[0].L.f = 66; + test_msg.obs[0].L.i = 121567974; + test_msg.obs[0].P = 1156681547; + test_msg.obs[0].flags = 3; + test_msg.obs[0].iono_std = 13; + test_msg.obs[0].lock = 15; + test_msg.obs[0].range_std = 7; + test_msg.obs[0].sid.code = 0; + test_msg.obs[0].sid.sat = 1; + test_msg.obs[0].tropo_std = 7; - sbp_msg_osr_t test_msg{}; - test_msg.header.n_obs = 64; - test_msg.header.t.ns_residual = 0; - test_msg.header.t.tow = 501867000; - test_msg.header.t.wn = 2152; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 12; - - test_msg.obs[0].L.f = 66; - test_msg.obs[0].L.i = 121567974; - test_msg.obs[0].P = 1156681547; - test_msg.obs[0].flags = 3; - test_msg.obs[0].iono_std = 13; - test_msg.obs[0].lock = 15; - test_msg.obs[0].range_std = 7; - test_msg.obs[0].sid.code = 0; - test_msg.obs[0].sid.sat = 1; - test_msg.obs[0].tropo_std = 7; - - test_msg.obs[1].L.f = 75; - test_msg.obs[1].L.i = 111817196; - test_msg.obs[1].P = 1063905486; - test_msg.obs[1].flags = 3; - test_msg.obs[1].iono_std = 13; - test_msg.obs[1].lock = 15; - test_msg.obs[1].range_std = 3; - test_msg.obs[1].sid.code = 0; - test_msg.obs[1].sid.sat = 13; - test_msg.obs[1].tropo_std = 3; - - test_msg.obs[2].L.f = 128; - test_msg.obs[2].L.i = 110692129; - test_msg.obs[2].P = 1053200685; - test_msg.obs[2].flags = 3; - test_msg.obs[2].iono_std = 13; - test_msg.obs[2].lock = 15; - test_msg.obs[2].range_std = 3; - test_msg.obs[2].sid.code = 0; - test_msg.obs[2].sid.sat = 14; - test_msg.obs[2].tropo_std = 3; - - test_msg.obs[3].L.f = 127; - test_msg.obs[3].L.i = 119549583; - test_msg.obs[3].P = 1137476697; - test_msg.obs[3].flags = 3; - test_msg.obs[3].iono_std = 13; - test_msg.obs[3].lock = 15; - test_msg.obs[3].range_std = 5; - test_msg.obs[3].sid.code = 0; - test_msg.obs[3].sid.sat = 15; - test_msg.obs[3].tropo_std = 5; - - test_msg.obs[4].L.f = 55; - test_msg.obs[4].L.i = 106934294; - test_msg.obs[4].P = 1017446132; - test_msg.obs[4].flags = 3; - test_msg.obs[4].iono_std = 0; - test_msg.obs[4].lock = 15; - test_msg.obs[4].range_std = 2; - test_msg.obs[4].sid.code = 0; - test_msg.obs[4].sid.sat = 17; - test_msg.obs[4].tropo_std = 2; - - test_msg.obs[5].L.f = 108; - test_msg.obs[5].L.i = 110024343; - test_msg.obs[5].P = 1046846826; - test_msg.obs[5].flags = 3; - test_msg.obs[5].iono_std = 13; - test_msg.obs[5].lock = 15; - test_msg.obs[5].range_std = 3; - test_msg.obs[5].sid.code = 0; - test_msg.obs[5].sid.sat = 19; - test_msg.obs[5].tropo_std = 3; - - test_msg.obs[6].L.f = 206; - test_msg.obs[6].L.i = 111507381; - test_msg.obs[6].P = 1060957521; - test_msg.obs[6].flags = 3; - test_msg.obs[6].iono_std = 13; - test_msg.obs[6].lock = 15; - test_msg.obs[6].range_std = 3; - test_msg.obs[6].sid.code = 0; - test_msg.obs[6].sid.sat = 28; - test_msg.obs[6].tropo_std = 3; - - test_msg.obs[7].L.f = 200; - test_msg.obs[7].L.i = 113614775; - test_msg.obs[7].P = 1081009286; - test_msg.obs[7].flags = 3; - test_msg.obs[7].iono_std = 13; - test_msg.obs[7].lock = 15; - test_msg.obs[7].range_std = 3; - test_msg.obs[7].sid.code = 0; - test_msg.obs[7].sid.sat = 30; - test_msg.obs[7].tropo_std = 3; - - test_msg.obs[8].L.f = 170; - test_msg.obs[8].L.i = 94728270; - test_msg.obs[8].P = 1156681781; - test_msg.obs[8].flags = 3; - test_msg.obs[8].iono_std = 21; - test_msg.obs[8].lock = 15; - test_msg.obs[8].range_std = 7; - test_msg.obs[8].sid.code = 6; - test_msg.obs[8].sid.sat = 1; - test_msg.obs[8].tropo_std = 7; - - test_msg.obs[9].L.f = 129; - test_msg.obs[9].L.i = 87130275; - test_msg.obs[9].P = 1063905531; - test_msg.obs[9].flags = 3; - test_msg.obs[9].iono_std = 21; - test_msg.obs[9].lock = 15; - test_msg.obs[9].range_std = 3; - test_msg.obs[9].sid.code = 6; - test_msg.obs[9].sid.sat = 13; - test_msg.obs[9].tropo_std = 3; - - test_msg.obs[10].L.f = 46; - test_msg.obs[10].L.i = 86253605; - test_msg.obs[10].P = 1053200752; - test_msg.obs[10].flags = 3; - test_msg.obs[10].iono_std = 21; - test_msg.obs[10].lock = 15; - test_msg.obs[10].range_std = 3; - test_msg.obs[10].sid.code = 6; - test_msg.obs[10].sid.sat = 14; - test_msg.obs[10].tropo_std = 3; - - test_msg.obs[11].L.f = 95; - test_msg.obs[11].L.i = 93155512; - test_msg.obs[11].P = 1137476774; - test_msg.obs[11].flags = 3; - test_msg.obs[11].iono_std = 21; - test_msg.obs[11].lock = 15; - test_msg.obs[11].range_std = 5; - test_msg.obs[11].sid.code = 6; - test_msg.obs[11].sid.sat = 15; - test_msg.obs[11].tropo_std = 5; - - EXPECT_EQ(send_message( 0, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + test_msg.obs[1].L.f = 75; + test_msg.obs[1].L.i = 111817196; + test_msg.obs[1].P = 1063905486; + test_msg.obs[1].flags = 3; + test_msg.obs[1].iono_std = 13; + test_msg.obs[1].lock = 15; + test_msg.obs[1].range_std = 3; + test_msg.obs[1].sid.code = 0; + test_msg.obs[1].sid.sat = 13; + test_msg.obs[1].tropo_std = 3; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 64) << "incorrect value for last_msg_.header.n_obs, expected 64, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.ns_residual, 0) << "incorrect value for last_msg_.header.t.ns_residual, expected 0, is " << last_msg_.header.t.ns_residual; - EXPECT_EQ(last_msg_.header.t.tow, 501867000) << "incorrect value for last_msg_.header.t.tow, expected 501867000, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 2152) << "incorrect value for last_msg_.header.t.wn, expected 2152, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 12) << "incorrect value for last_msg_.n_obs.value, expected 12, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 66) << "incorrect value for last_msg_.obs[0].L.f, expected 66, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, 121567974) << "incorrect value for last_msg_.obs[0].L.i, expected 121567974, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 1156681547) << "incorrect value for last_msg_.obs[0].P, expected 1156681547, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].flags, 3) << "incorrect value for last_msg_.obs[0].flags, expected 3, is " << last_msg_.obs[0].flags; - EXPECT_EQ(last_msg_.obs[0].iono_std, 13) << "incorrect value for last_msg_.obs[0].iono_std, expected 13, is " << last_msg_.obs[0].iono_std; - EXPECT_EQ(last_msg_.obs[0].lock, 15) << "incorrect value for last_msg_.obs[0].lock, expected 15, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].range_std, 7) << "incorrect value for last_msg_.obs[0].range_std, expected 7, is " << last_msg_.obs[0].range_std; - EXPECT_EQ(last_msg_.obs[0].sid.code, 0) << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " << last_msg_.obs[0].sid.code; - EXPECT_EQ(last_msg_.obs[0].sid.sat, 1) << "incorrect value for last_msg_.obs[0].sid.sat, expected 1, is " << last_msg_.obs[0].sid.sat; - EXPECT_EQ(last_msg_.obs[0].tropo_std, 7) << "incorrect value for last_msg_.obs[0].tropo_std, expected 7, is " << last_msg_.obs[0].tropo_std; - EXPECT_EQ(last_msg_.obs[1].L.f, 75) << "incorrect value for last_msg_.obs[1].L.f, expected 75, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, 111817196) << "incorrect value for last_msg_.obs[1].L.i, expected 111817196, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 1063905486) << "incorrect value for last_msg_.obs[1].P, expected 1063905486, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].flags, 3) << "incorrect value for last_msg_.obs[1].flags, expected 3, is " << last_msg_.obs[1].flags; - EXPECT_EQ(last_msg_.obs[1].iono_std, 13) << "incorrect value for last_msg_.obs[1].iono_std, expected 13, is " << last_msg_.obs[1].iono_std; - EXPECT_EQ(last_msg_.obs[1].lock, 15) << "incorrect value for last_msg_.obs[1].lock, expected 15, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].range_std, 3) << "incorrect value for last_msg_.obs[1].range_std, expected 3, is " << last_msg_.obs[1].range_std; - EXPECT_EQ(last_msg_.obs[1].sid.code, 0) << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " << last_msg_.obs[1].sid.code; - EXPECT_EQ(last_msg_.obs[1].sid.sat, 13) << "incorrect value for last_msg_.obs[1].sid.sat, expected 13, is " << last_msg_.obs[1].sid.sat; - EXPECT_EQ(last_msg_.obs[1].tropo_std, 3) << "incorrect value for last_msg_.obs[1].tropo_std, expected 3, is " << last_msg_.obs[1].tropo_std; - EXPECT_EQ(last_msg_.obs[2].L.f, 128) << "incorrect value for last_msg_.obs[2].L.f, expected 128, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, 110692129) << "incorrect value for last_msg_.obs[2].L.i, expected 110692129, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 1053200685) << "incorrect value for last_msg_.obs[2].P, expected 1053200685, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].flags, 3) << "incorrect value for last_msg_.obs[2].flags, expected 3, is " << last_msg_.obs[2].flags; - EXPECT_EQ(last_msg_.obs[2].iono_std, 13) << "incorrect value for last_msg_.obs[2].iono_std, expected 13, is " << last_msg_.obs[2].iono_std; - EXPECT_EQ(last_msg_.obs[2].lock, 15) << "incorrect value for last_msg_.obs[2].lock, expected 15, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].range_std, 3) << "incorrect value for last_msg_.obs[2].range_std, expected 3, is " << last_msg_.obs[2].range_std; - EXPECT_EQ(last_msg_.obs[2].sid.code, 0) << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " << last_msg_.obs[2].sid.code; - EXPECT_EQ(last_msg_.obs[2].sid.sat, 14) << "incorrect value for last_msg_.obs[2].sid.sat, expected 14, is " << last_msg_.obs[2].sid.sat; - EXPECT_EQ(last_msg_.obs[2].tropo_std, 3) << "incorrect value for last_msg_.obs[2].tropo_std, expected 3, is " << last_msg_.obs[2].tropo_std; - EXPECT_EQ(last_msg_.obs[3].L.f, 127) << "incorrect value for last_msg_.obs[3].L.f, expected 127, is " << last_msg_.obs[3].L.f; - EXPECT_EQ(last_msg_.obs[3].L.i, 119549583) << "incorrect value for last_msg_.obs[3].L.i, expected 119549583, is " << last_msg_.obs[3].L.i; - EXPECT_EQ(last_msg_.obs[3].P, 1137476697) << "incorrect value for last_msg_.obs[3].P, expected 1137476697, is " << last_msg_.obs[3].P; - EXPECT_EQ(last_msg_.obs[3].flags, 3) << "incorrect value for last_msg_.obs[3].flags, expected 3, is " << last_msg_.obs[3].flags; - EXPECT_EQ(last_msg_.obs[3].iono_std, 13) << "incorrect value for last_msg_.obs[3].iono_std, expected 13, is " << last_msg_.obs[3].iono_std; - EXPECT_EQ(last_msg_.obs[3].lock, 15) << "incorrect value for last_msg_.obs[3].lock, expected 15, is " << last_msg_.obs[3].lock; - EXPECT_EQ(last_msg_.obs[3].range_std, 5) << "incorrect value for last_msg_.obs[3].range_std, expected 5, is " << last_msg_.obs[3].range_std; - EXPECT_EQ(last_msg_.obs[3].sid.code, 0) << "incorrect value for last_msg_.obs[3].sid.code, expected 0, is " << last_msg_.obs[3].sid.code; - EXPECT_EQ(last_msg_.obs[3].sid.sat, 15) << "incorrect value for last_msg_.obs[3].sid.sat, expected 15, is " << last_msg_.obs[3].sid.sat; - EXPECT_EQ(last_msg_.obs[3].tropo_std, 5) << "incorrect value for last_msg_.obs[3].tropo_std, expected 5, is " << last_msg_.obs[3].tropo_std; - EXPECT_EQ(last_msg_.obs[4].L.f, 55) << "incorrect value for last_msg_.obs[4].L.f, expected 55, is " << last_msg_.obs[4].L.f; - EXPECT_EQ(last_msg_.obs[4].L.i, 106934294) << "incorrect value for last_msg_.obs[4].L.i, expected 106934294, is " << last_msg_.obs[4].L.i; - EXPECT_EQ(last_msg_.obs[4].P, 1017446132) << "incorrect value for last_msg_.obs[4].P, expected 1017446132, is " << last_msg_.obs[4].P; - EXPECT_EQ(last_msg_.obs[4].flags, 3) << "incorrect value for last_msg_.obs[4].flags, expected 3, is " << last_msg_.obs[4].flags; - EXPECT_EQ(last_msg_.obs[4].iono_std, 0) << "incorrect value for last_msg_.obs[4].iono_std, expected 0, is " << last_msg_.obs[4].iono_std; - EXPECT_EQ(last_msg_.obs[4].lock, 15) << "incorrect value for last_msg_.obs[4].lock, expected 15, is " << last_msg_.obs[4].lock; - EXPECT_EQ(last_msg_.obs[4].range_std, 2) << "incorrect value for last_msg_.obs[4].range_std, expected 2, is " << last_msg_.obs[4].range_std; - EXPECT_EQ(last_msg_.obs[4].sid.code, 0) << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " << last_msg_.obs[4].sid.code; - EXPECT_EQ(last_msg_.obs[4].sid.sat, 17) << "incorrect value for last_msg_.obs[4].sid.sat, expected 17, is " << last_msg_.obs[4].sid.sat; - EXPECT_EQ(last_msg_.obs[4].tropo_std, 2) << "incorrect value for last_msg_.obs[4].tropo_std, expected 2, is " << last_msg_.obs[4].tropo_std; - EXPECT_EQ(last_msg_.obs[5].L.f, 108) << "incorrect value for last_msg_.obs[5].L.f, expected 108, is " << last_msg_.obs[5].L.f; - EXPECT_EQ(last_msg_.obs[5].L.i, 110024343) << "incorrect value for last_msg_.obs[5].L.i, expected 110024343, is " << last_msg_.obs[5].L.i; - EXPECT_EQ(last_msg_.obs[5].P, 1046846826) << "incorrect value for last_msg_.obs[5].P, expected 1046846826, is " << last_msg_.obs[5].P; - EXPECT_EQ(last_msg_.obs[5].flags, 3) << "incorrect value for last_msg_.obs[5].flags, expected 3, is " << last_msg_.obs[5].flags; - EXPECT_EQ(last_msg_.obs[5].iono_std, 13) << "incorrect value for last_msg_.obs[5].iono_std, expected 13, is " << last_msg_.obs[5].iono_std; - EXPECT_EQ(last_msg_.obs[5].lock, 15) << "incorrect value for last_msg_.obs[5].lock, expected 15, is " << last_msg_.obs[5].lock; - EXPECT_EQ(last_msg_.obs[5].range_std, 3) << "incorrect value for last_msg_.obs[5].range_std, expected 3, is " << last_msg_.obs[5].range_std; - EXPECT_EQ(last_msg_.obs[5].sid.code, 0) << "incorrect value for last_msg_.obs[5].sid.code, expected 0, is " << last_msg_.obs[5].sid.code; - EXPECT_EQ(last_msg_.obs[5].sid.sat, 19) << "incorrect value for last_msg_.obs[5].sid.sat, expected 19, is " << last_msg_.obs[5].sid.sat; - EXPECT_EQ(last_msg_.obs[5].tropo_std, 3) << "incorrect value for last_msg_.obs[5].tropo_std, expected 3, is " << last_msg_.obs[5].tropo_std; - EXPECT_EQ(last_msg_.obs[6].L.f, 206) << "incorrect value for last_msg_.obs[6].L.f, expected 206, is " << last_msg_.obs[6].L.f; - EXPECT_EQ(last_msg_.obs[6].L.i, 111507381) << "incorrect value for last_msg_.obs[6].L.i, expected 111507381, is " << last_msg_.obs[6].L.i; - EXPECT_EQ(last_msg_.obs[6].P, 1060957521) << "incorrect value for last_msg_.obs[6].P, expected 1060957521, is " << last_msg_.obs[6].P; - EXPECT_EQ(last_msg_.obs[6].flags, 3) << "incorrect value for last_msg_.obs[6].flags, expected 3, is " << last_msg_.obs[6].flags; - EXPECT_EQ(last_msg_.obs[6].iono_std, 13) << "incorrect value for last_msg_.obs[6].iono_std, expected 13, is " << last_msg_.obs[6].iono_std; - EXPECT_EQ(last_msg_.obs[6].lock, 15) << "incorrect value for last_msg_.obs[6].lock, expected 15, is " << last_msg_.obs[6].lock; - EXPECT_EQ(last_msg_.obs[6].range_std, 3) << "incorrect value for last_msg_.obs[6].range_std, expected 3, is " << last_msg_.obs[6].range_std; - EXPECT_EQ(last_msg_.obs[6].sid.code, 0) << "incorrect value for last_msg_.obs[6].sid.code, expected 0, is " << last_msg_.obs[6].sid.code; - EXPECT_EQ(last_msg_.obs[6].sid.sat, 28) << "incorrect value for last_msg_.obs[6].sid.sat, expected 28, is " << last_msg_.obs[6].sid.sat; - EXPECT_EQ(last_msg_.obs[6].tropo_std, 3) << "incorrect value for last_msg_.obs[6].tropo_std, expected 3, is " << last_msg_.obs[6].tropo_std; - EXPECT_EQ(last_msg_.obs[7].L.f, 200) << "incorrect value for last_msg_.obs[7].L.f, expected 200, is " << last_msg_.obs[7].L.f; - EXPECT_EQ(last_msg_.obs[7].L.i, 113614775) << "incorrect value for last_msg_.obs[7].L.i, expected 113614775, is " << last_msg_.obs[7].L.i; - EXPECT_EQ(last_msg_.obs[7].P, 1081009286) << "incorrect value for last_msg_.obs[7].P, expected 1081009286, is " << last_msg_.obs[7].P; - EXPECT_EQ(last_msg_.obs[7].flags, 3) << "incorrect value for last_msg_.obs[7].flags, expected 3, is " << last_msg_.obs[7].flags; - EXPECT_EQ(last_msg_.obs[7].iono_std, 13) << "incorrect value for last_msg_.obs[7].iono_std, expected 13, is " << last_msg_.obs[7].iono_std; - EXPECT_EQ(last_msg_.obs[7].lock, 15) << "incorrect value for last_msg_.obs[7].lock, expected 15, is " << last_msg_.obs[7].lock; - EXPECT_EQ(last_msg_.obs[7].range_std, 3) << "incorrect value for last_msg_.obs[7].range_std, expected 3, is " << last_msg_.obs[7].range_std; - EXPECT_EQ(last_msg_.obs[7].sid.code, 0) << "incorrect value for last_msg_.obs[7].sid.code, expected 0, is " << last_msg_.obs[7].sid.code; - EXPECT_EQ(last_msg_.obs[7].sid.sat, 30) << "incorrect value for last_msg_.obs[7].sid.sat, expected 30, is " << last_msg_.obs[7].sid.sat; - EXPECT_EQ(last_msg_.obs[7].tropo_std, 3) << "incorrect value for last_msg_.obs[7].tropo_std, expected 3, is " << last_msg_.obs[7].tropo_std; - EXPECT_EQ(last_msg_.obs[8].L.f, 170) << "incorrect value for last_msg_.obs[8].L.f, expected 170, is " << last_msg_.obs[8].L.f; - EXPECT_EQ(last_msg_.obs[8].L.i, 94728270) << "incorrect value for last_msg_.obs[8].L.i, expected 94728270, is " << last_msg_.obs[8].L.i; - EXPECT_EQ(last_msg_.obs[8].P, 1156681781) << "incorrect value for last_msg_.obs[8].P, expected 1156681781, is " << last_msg_.obs[8].P; - EXPECT_EQ(last_msg_.obs[8].flags, 3) << "incorrect value for last_msg_.obs[8].flags, expected 3, is " << last_msg_.obs[8].flags; - EXPECT_EQ(last_msg_.obs[8].iono_std, 21) << "incorrect value for last_msg_.obs[8].iono_std, expected 21, is " << last_msg_.obs[8].iono_std; - EXPECT_EQ(last_msg_.obs[8].lock, 15) << "incorrect value for last_msg_.obs[8].lock, expected 15, is " << last_msg_.obs[8].lock; - EXPECT_EQ(last_msg_.obs[8].range_std, 7) << "incorrect value for last_msg_.obs[8].range_std, expected 7, is " << last_msg_.obs[8].range_std; - EXPECT_EQ(last_msg_.obs[8].sid.code, 6) << "incorrect value for last_msg_.obs[8].sid.code, expected 6, is " << last_msg_.obs[8].sid.code; - EXPECT_EQ(last_msg_.obs[8].sid.sat, 1) << "incorrect value for last_msg_.obs[8].sid.sat, expected 1, is " << last_msg_.obs[8].sid.sat; - EXPECT_EQ(last_msg_.obs[8].tropo_std, 7) << "incorrect value for last_msg_.obs[8].tropo_std, expected 7, is " << last_msg_.obs[8].tropo_std; - EXPECT_EQ(last_msg_.obs[9].L.f, 129) << "incorrect value for last_msg_.obs[9].L.f, expected 129, is " << last_msg_.obs[9].L.f; - EXPECT_EQ(last_msg_.obs[9].L.i, 87130275) << "incorrect value for last_msg_.obs[9].L.i, expected 87130275, is " << last_msg_.obs[9].L.i; - EXPECT_EQ(last_msg_.obs[9].P, 1063905531) << "incorrect value for last_msg_.obs[9].P, expected 1063905531, is " << last_msg_.obs[9].P; - EXPECT_EQ(last_msg_.obs[9].flags, 3) << "incorrect value for last_msg_.obs[9].flags, expected 3, is " << last_msg_.obs[9].flags; - EXPECT_EQ(last_msg_.obs[9].iono_std, 21) << "incorrect value for last_msg_.obs[9].iono_std, expected 21, is " << last_msg_.obs[9].iono_std; - EXPECT_EQ(last_msg_.obs[9].lock, 15) << "incorrect value for last_msg_.obs[9].lock, expected 15, is " << last_msg_.obs[9].lock; - EXPECT_EQ(last_msg_.obs[9].range_std, 3) << "incorrect value for last_msg_.obs[9].range_std, expected 3, is " << last_msg_.obs[9].range_std; - EXPECT_EQ(last_msg_.obs[9].sid.code, 6) << "incorrect value for last_msg_.obs[9].sid.code, expected 6, is " << last_msg_.obs[9].sid.code; - EXPECT_EQ(last_msg_.obs[9].sid.sat, 13) << "incorrect value for last_msg_.obs[9].sid.sat, expected 13, is " << last_msg_.obs[9].sid.sat; - EXPECT_EQ(last_msg_.obs[9].tropo_std, 3) << "incorrect value for last_msg_.obs[9].tropo_std, expected 3, is " << last_msg_.obs[9].tropo_std; - EXPECT_EQ(last_msg_.obs[10].L.f, 46) << "incorrect value for last_msg_.obs[10].L.f, expected 46, is " << last_msg_.obs[10].L.f; - EXPECT_EQ(last_msg_.obs[10].L.i, 86253605) << "incorrect value for last_msg_.obs[10].L.i, expected 86253605, is " << last_msg_.obs[10].L.i; - EXPECT_EQ(last_msg_.obs[10].P, 1053200752) << "incorrect value for last_msg_.obs[10].P, expected 1053200752, is " << last_msg_.obs[10].P; - EXPECT_EQ(last_msg_.obs[10].flags, 3) << "incorrect value for last_msg_.obs[10].flags, expected 3, is " << last_msg_.obs[10].flags; - EXPECT_EQ(last_msg_.obs[10].iono_std, 21) << "incorrect value for last_msg_.obs[10].iono_std, expected 21, is " << last_msg_.obs[10].iono_std; - EXPECT_EQ(last_msg_.obs[10].lock, 15) << "incorrect value for last_msg_.obs[10].lock, expected 15, is " << last_msg_.obs[10].lock; - EXPECT_EQ(last_msg_.obs[10].range_std, 3) << "incorrect value for last_msg_.obs[10].range_std, expected 3, is " << last_msg_.obs[10].range_std; - EXPECT_EQ(last_msg_.obs[10].sid.code, 6) << "incorrect value for last_msg_.obs[10].sid.code, expected 6, is " << last_msg_.obs[10].sid.code; - EXPECT_EQ(last_msg_.obs[10].sid.sat, 14) << "incorrect value for last_msg_.obs[10].sid.sat, expected 14, is " << last_msg_.obs[10].sid.sat; - EXPECT_EQ(last_msg_.obs[10].tropo_std, 3) << "incorrect value for last_msg_.obs[10].tropo_std, expected 3, is " << last_msg_.obs[10].tropo_std; - EXPECT_EQ(last_msg_.obs[11].L.f, 95) << "incorrect value for last_msg_.obs[11].L.f, expected 95, is " << last_msg_.obs[11].L.f; - EXPECT_EQ(last_msg_.obs[11].L.i, 93155512) << "incorrect value for last_msg_.obs[11].L.i, expected 93155512, is " << last_msg_.obs[11].L.i; - EXPECT_EQ(last_msg_.obs[11].P, 1137476774) << "incorrect value for last_msg_.obs[11].P, expected 1137476774, is " << last_msg_.obs[11].P; - EXPECT_EQ(last_msg_.obs[11].flags, 3) << "incorrect value for last_msg_.obs[11].flags, expected 3, is " << last_msg_.obs[11].flags; - EXPECT_EQ(last_msg_.obs[11].iono_std, 21) << "incorrect value for last_msg_.obs[11].iono_std, expected 21, is " << last_msg_.obs[11].iono_std; - EXPECT_EQ(last_msg_.obs[11].lock, 15) << "incorrect value for last_msg_.obs[11].lock, expected 15, is " << last_msg_.obs[11].lock; - EXPECT_EQ(last_msg_.obs[11].range_std, 5) << "incorrect value for last_msg_.obs[11].range_std, expected 5, is " << last_msg_.obs[11].range_std; - EXPECT_EQ(last_msg_.obs[11].sid.code, 6) << "incorrect value for last_msg_.obs[11].sid.code, expected 6, is " << last_msg_.obs[11].sid.code; - EXPECT_EQ(last_msg_.obs[11].sid.sat, 15) << "incorrect value for last_msg_.obs[11].sid.sat, expected 15, is " << last_msg_.obs[11].sid.sat; - EXPECT_EQ(last_msg_.obs[11].tropo_std, 5) << "incorrect value for last_msg_.obs[11].tropo_std, expected 5, is " << last_msg_.obs[11].tropo_std; + test_msg.obs[2].L.f = 128; + test_msg.obs[2].L.i = 110692129; + test_msg.obs[2].P = 1053200685; + test_msg.obs[2].flags = 3; + test_msg.obs[2].iono_std = 13; + test_msg.obs[2].lock = 15; + test_msg.obs[2].range_std = 3; + test_msg.obs[2].sid.code = 0; + test_msg.obs[2].sid.sat = 14; + test_msg.obs[2].tropo_std = 3; + + test_msg.obs[3].L.f = 127; + test_msg.obs[3].L.i = 119549583; + test_msg.obs[3].P = 1137476697; + test_msg.obs[3].flags = 3; + test_msg.obs[3].iono_std = 13; + test_msg.obs[3].lock = 15; + test_msg.obs[3].range_std = 5; + test_msg.obs[3].sid.code = 0; + test_msg.obs[3].sid.sat = 15; + test_msg.obs[3].tropo_std = 5; + + test_msg.obs[4].L.f = 55; + test_msg.obs[4].L.i = 106934294; + test_msg.obs[4].P = 1017446132; + test_msg.obs[4].flags = 3; + test_msg.obs[4].iono_std = 0; + test_msg.obs[4].lock = 15; + test_msg.obs[4].range_std = 2; + test_msg.obs[4].sid.code = 0; + test_msg.obs[4].sid.sat = 17; + test_msg.obs[4].tropo_std = 2; + + test_msg.obs[5].L.f = 108; + test_msg.obs[5].L.i = 110024343; + test_msg.obs[5].P = 1046846826; + test_msg.obs[5].flags = 3; + test_msg.obs[5].iono_std = 13; + test_msg.obs[5].lock = 15; + test_msg.obs[5].range_std = 3; + test_msg.obs[5].sid.code = 0; + test_msg.obs[5].sid.sat = 19; + test_msg.obs[5].tropo_std = 3; + + test_msg.obs[6].L.f = 206; + test_msg.obs[6].L.i = 111507381; + test_msg.obs[6].P = 1060957521; + test_msg.obs[6].flags = 3; + test_msg.obs[6].iono_std = 13; + test_msg.obs[6].lock = 15; + test_msg.obs[6].range_std = 3; + test_msg.obs[6].sid.code = 0; + test_msg.obs[6].sid.sat = 28; + test_msg.obs[6].tropo_std = 3; + + test_msg.obs[7].L.f = 200; + test_msg.obs[7].L.i = 113614775; + test_msg.obs[7].P = 1081009286; + test_msg.obs[7].flags = 3; + test_msg.obs[7].iono_std = 13; + test_msg.obs[7].lock = 15; + test_msg.obs[7].range_std = 3; + test_msg.obs[7].sid.code = 0; + test_msg.obs[7].sid.sat = 30; + test_msg.obs[7].tropo_std = 3; + + test_msg.obs[8].L.f = 170; + test_msg.obs[8].L.i = 94728270; + test_msg.obs[8].P = 1156681781; + test_msg.obs[8].flags = 3; + test_msg.obs[8].iono_std = 21; + test_msg.obs[8].lock = 15; + test_msg.obs[8].range_std = 7; + test_msg.obs[8].sid.code = 6; + test_msg.obs[8].sid.sat = 1; + test_msg.obs[8].tropo_std = 7; + + test_msg.obs[9].L.f = 129; + test_msg.obs[9].L.i = 87130275; + test_msg.obs[9].P = 1063905531; + test_msg.obs[9].flags = 3; + test_msg.obs[9].iono_std = 21; + test_msg.obs[9].lock = 15; + test_msg.obs[9].range_std = 3; + test_msg.obs[9].sid.code = 6; + test_msg.obs[9].sid.sat = 13; + test_msg.obs[9].tropo_std = 3; + + test_msg.obs[10].L.f = 46; + test_msg.obs[10].L.i = 86253605; + test_msg.obs[10].P = 1053200752; + test_msg.obs[10].flags = 3; + test_msg.obs[10].iono_std = 21; + test_msg.obs[10].lock = 15; + test_msg.obs[10].range_std = 3; + test_msg.obs[10].sid.code = 6; + test_msg.obs[10].sid.sat = 14; + test_msg.obs[10].tropo_std = 3; + + test_msg.obs[11].L.f = 95; + test_msg.obs[11].L.i = 93155512; + test_msg.obs[11].P = 1137476774; + test_msg.obs[11].flags = 3; + test_msg.obs[11].iono_std = 21; + test_msg.obs[11].lock = 15; + test_msg.obs[11].range_std = 5; + test_msg.obs[11].sid.code = 6; + test_msg.obs[11].sid.sat = 15; + test_msg.obs[11].tropo_std = 5; + + EXPECT_EQ(send_message(0, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 64) + << "incorrect value for last_msg_.header.n_obs, expected 64, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.ns_residual, 0) + << "incorrect value for last_msg_.header.t.ns_residual, expected 0, is " + << last_msg_.header.t.ns_residual; + EXPECT_EQ(last_msg_.header.t.tow, 501867000) + << "incorrect value for last_msg_.header.t.tow, expected 501867000, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 2152) + << "incorrect value for last_msg_.header.t.wn, expected 2152, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 12) + << "incorrect value for last_msg_.n_obs.value, expected 12, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 66) + << "incorrect value for last_msg_.obs[0].L.f, expected 66, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, 121567974) + << "incorrect value for last_msg_.obs[0].L.i, expected 121567974, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 1156681547) + << "incorrect value for last_msg_.obs[0].P, expected 1156681547, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].flags, 3) + << "incorrect value for last_msg_.obs[0].flags, expected 3, is " + << last_msg_.obs[0].flags; + EXPECT_EQ(last_msg_.obs[0].iono_std, 13) + << "incorrect value for last_msg_.obs[0].iono_std, expected 13, is " + << last_msg_.obs[0].iono_std; + EXPECT_EQ(last_msg_.obs[0].lock, 15) + << "incorrect value for last_msg_.obs[0].lock, expected 15, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].range_std, 7) + << "incorrect value for last_msg_.obs[0].range_std, expected 7, is " + << last_msg_.obs[0].range_std; + EXPECT_EQ(last_msg_.obs[0].sid.code, 0) + << "incorrect value for last_msg_.obs[0].sid.code, expected 0, is " + << last_msg_.obs[0].sid.code; + EXPECT_EQ(last_msg_.obs[0].sid.sat, 1) + << "incorrect value for last_msg_.obs[0].sid.sat, expected 1, is " + << last_msg_.obs[0].sid.sat; + EXPECT_EQ(last_msg_.obs[0].tropo_std, 7) + << "incorrect value for last_msg_.obs[0].tropo_std, expected 7, is " + << last_msg_.obs[0].tropo_std; + EXPECT_EQ(last_msg_.obs[1].L.f, 75) + << "incorrect value for last_msg_.obs[1].L.f, expected 75, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, 111817196) + << "incorrect value for last_msg_.obs[1].L.i, expected 111817196, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 1063905486) + << "incorrect value for last_msg_.obs[1].P, expected 1063905486, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].flags, 3) + << "incorrect value for last_msg_.obs[1].flags, expected 3, is " + << last_msg_.obs[1].flags; + EXPECT_EQ(last_msg_.obs[1].iono_std, 13) + << "incorrect value for last_msg_.obs[1].iono_std, expected 13, is " + << last_msg_.obs[1].iono_std; + EXPECT_EQ(last_msg_.obs[1].lock, 15) + << "incorrect value for last_msg_.obs[1].lock, expected 15, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].range_std, 3) + << "incorrect value for last_msg_.obs[1].range_std, expected 3, is " + << last_msg_.obs[1].range_std; + EXPECT_EQ(last_msg_.obs[1].sid.code, 0) + << "incorrect value for last_msg_.obs[1].sid.code, expected 0, is " + << last_msg_.obs[1].sid.code; + EXPECT_EQ(last_msg_.obs[1].sid.sat, 13) + << "incorrect value for last_msg_.obs[1].sid.sat, expected 13, is " + << last_msg_.obs[1].sid.sat; + EXPECT_EQ(last_msg_.obs[1].tropo_std, 3) + << "incorrect value for last_msg_.obs[1].tropo_std, expected 3, is " + << last_msg_.obs[1].tropo_std; + EXPECT_EQ(last_msg_.obs[2].L.f, 128) + << "incorrect value for last_msg_.obs[2].L.f, expected 128, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, 110692129) + << "incorrect value for last_msg_.obs[2].L.i, expected 110692129, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 1053200685) + << "incorrect value for last_msg_.obs[2].P, expected 1053200685, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].flags, 3) + << "incorrect value for last_msg_.obs[2].flags, expected 3, is " + << last_msg_.obs[2].flags; + EXPECT_EQ(last_msg_.obs[2].iono_std, 13) + << "incorrect value for last_msg_.obs[2].iono_std, expected 13, is " + << last_msg_.obs[2].iono_std; + EXPECT_EQ(last_msg_.obs[2].lock, 15) + << "incorrect value for last_msg_.obs[2].lock, expected 15, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].range_std, 3) + << "incorrect value for last_msg_.obs[2].range_std, expected 3, is " + << last_msg_.obs[2].range_std; + EXPECT_EQ(last_msg_.obs[2].sid.code, 0) + << "incorrect value for last_msg_.obs[2].sid.code, expected 0, is " + << last_msg_.obs[2].sid.code; + EXPECT_EQ(last_msg_.obs[2].sid.sat, 14) + << "incorrect value for last_msg_.obs[2].sid.sat, expected 14, is " + << last_msg_.obs[2].sid.sat; + EXPECT_EQ(last_msg_.obs[2].tropo_std, 3) + << "incorrect value for last_msg_.obs[2].tropo_std, expected 3, is " + << last_msg_.obs[2].tropo_std; + EXPECT_EQ(last_msg_.obs[3].L.f, 127) + << "incorrect value for last_msg_.obs[3].L.f, expected 127, is " + << last_msg_.obs[3].L.f; + EXPECT_EQ(last_msg_.obs[3].L.i, 119549583) + << "incorrect value for last_msg_.obs[3].L.i, expected 119549583, is " + << last_msg_.obs[3].L.i; + EXPECT_EQ(last_msg_.obs[3].P, 1137476697) + << "incorrect value for last_msg_.obs[3].P, expected 1137476697, is " + << last_msg_.obs[3].P; + EXPECT_EQ(last_msg_.obs[3].flags, 3) + << "incorrect value for last_msg_.obs[3].flags, expected 3, is " + << last_msg_.obs[3].flags; + EXPECT_EQ(last_msg_.obs[3].iono_std, 13) + << "incorrect value for last_msg_.obs[3].iono_std, expected 13, is " + << last_msg_.obs[3].iono_std; + EXPECT_EQ(last_msg_.obs[3].lock, 15) + << "incorrect value for last_msg_.obs[3].lock, expected 15, is " + << last_msg_.obs[3].lock; + EXPECT_EQ(last_msg_.obs[3].range_std, 5) + << "incorrect value for last_msg_.obs[3].range_std, expected 5, is " + << last_msg_.obs[3].range_std; + EXPECT_EQ(last_msg_.obs[3].sid.code, 0) + << "incorrect value for last_msg_.obs[3].sid.code, expected 0, is " + << last_msg_.obs[3].sid.code; + EXPECT_EQ(last_msg_.obs[3].sid.sat, 15) + << "incorrect value for last_msg_.obs[3].sid.sat, expected 15, is " + << last_msg_.obs[3].sid.sat; + EXPECT_EQ(last_msg_.obs[3].tropo_std, 5) + << "incorrect value for last_msg_.obs[3].tropo_std, expected 5, is " + << last_msg_.obs[3].tropo_std; + EXPECT_EQ(last_msg_.obs[4].L.f, 55) + << "incorrect value for last_msg_.obs[4].L.f, expected 55, is " + << last_msg_.obs[4].L.f; + EXPECT_EQ(last_msg_.obs[4].L.i, 106934294) + << "incorrect value for last_msg_.obs[4].L.i, expected 106934294, is " + << last_msg_.obs[4].L.i; + EXPECT_EQ(last_msg_.obs[4].P, 1017446132) + << "incorrect value for last_msg_.obs[4].P, expected 1017446132, is " + << last_msg_.obs[4].P; + EXPECT_EQ(last_msg_.obs[4].flags, 3) + << "incorrect value for last_msg_.obs[4].flags, expected 3, is " + << last_msg_.obs[4].flags; + EXPECT_EQ(last_msg_.obs[4].iono_std, 0) + << "incorrect value for last_msg_.obs[4].iono_std, expected 0, is " + << last_msg_.obs[4].iono_std; + EXPECT_EQ(last_msg_.obs[4].lock, 15) + << "incorrect value for last_msg_.obs[4].lock, expected 15, is " + << last_msg_.obs[4].lock; + EXPECT_EQ(last_msg_.obs[4].range_std, 2) + << "incorrect value for last_msg_.obs[4].range_std, expected 2, is " + << last_msg_.obs[4].range_std; + EXPECT_EQ(last_msg_.obs[4].sid.code, 0) + << "incorrect value for last_msg_.obs[4].sid.code, expected 0, is " + << last_msg_.obs[4].sid.code; + EXPECT_EQ(last_msg_.obs[4].sid.sat, 17) + << "incorrect value for last_msg_.obs[4].sid.sat, expected 17, is " + << last_msg_.obs[4].sid.sat; + EXPECT_EQ(last_msg_.obs[4].tropo_std, 2) + << "incorrect value for last_msg_.obs[4].tropo_std, expected 2, is " + << last_msg_.obs[4].tropo_std; + EXPECT_EQ(last_msg_.obs[5].L.f, 108) + << "incorrect value for last_msg_.obs[5].L.f, expected 108, is " + << last_msg_.obs[5].L.f; + EXPECT_EQ(last_msg_.obs[5].L.i, 110024343) + << "incorrect value for last_msg_.obs[5].L.i, expected 110024343, is " + << last_msg_.obs[5].L.i; + EXPECT_EQ(last_msg_.obs[5].P, 1046846826) + << "incorrect value for last_msg_.obs[5].P, expected 1046846826, is " + << last_msg_.obs[5].P; + EXPECT_EQ(last_msg_.obs[5].flags, 3) + << "incorrect value for last_msg_.obs[5].flags, expected 3, is " + << last_msg_.obs[5].flags; + EXPECT_EQ(last_msg_.obs[5].iono_std, 13) + << "incorrect value for last_msg_.obs[5].iono_std, expected 13, is " + << last_msg_.obs[5].iono_std; + EXPECT_EQ(last_msg_.obs[5].lock, 15) + << "incorrect value for last_msg_.obs[5].lock, expected 15, is " + << last_msg_.obs[5].lock; + EXPECT_EQ(last_msg_.obs[5].range_std, 3) + << "incorrect value for last_msg_.obs[5].range_std, expected 3, is " + << last_msg_.obs[5].range_std; + EXPECT_EQ(last_msg_.obs[5].sid.code, 0) + << "incorrect value for last_msg_.obs[5].sid.code, expected 0, is " + << last_msg_.obs[5].sid.code; + EXPECT_EQ(last_msg_.obs[5].sid.sat, 19) + << "incorrect value for last_msg_.obs[5].sid.sat, expected 19, is " + << last_msg_.obs[5].sid.sat; + EXPECT_EQ(last_msg_.obs[5].tropo_std, 3) + << "incorrect value for last_msg_.obs[5].tropo_std, expected 3, is " + << last_msg_.obs[5].tropo_std; + EXPECT_EQ(last_msg_.obs[6].L.f, 206) + << "incorrect value for last_msg_.obs[6].L.f, expected 206, is " + << last_msg_.obs[6].L.f; + EXPECT_EQ(last_msg_.obs[6].L.i, 111507381) + << "incorrect value for last_msg_.obs[6].L.i, expected 111507381, is " + << last_msg_.obs[6].L.i; + EXPECT_EQ(last_msg_.obs[6].P, 1060957521) + << "incorrect value for last_msg_.obs[6].P, expected 1060957521, is " + << last_msg_.obs[6].P; + EXPECT_EQ(last_msg_.obs[6].flags, 3) + << "incorrect value for last_msg_.obs[6].flags, expected 3, is " + << last_msg_.obs[6].flags; + EXPECT_EQ(last_msg_.obs[6].iono_std, 13) + << "incorrect value for last_msg_.obs[6].iono_std, expected 13, is " + << last_msg_.obs[6].iono_std; + EXPECT_EQ(last_msg_.obs[6].lock, 15) + << "incorrect value for last_msg_.obs[6].lock, expected 15, is " + << last_msg_.obs[6].lock; + EXPECT_EQ(last_msg_.obs[6].range_std, 3) + << "incorrect value for last_msg_.obs[6].range_std, expected 3, is " + << last_msg_.obs[6].range_std; + EXPECT_EQ(last_msg_.obs[6].sid.code, 0) + << "incorrect value for last_msg_.obs[6].sid.code, expected 0, is " + << last_msg_.obs[6].sid.code; + EXPECT_EQ(last_msg_.obs[6].sid.sat, 28) + << "incorrect value for last_msg_.obs[6].sid.sat, expected 28, is " + << last_msg_.obs[6].sid.sat; + EXPECT_EQ(last_msg_.obs[6].tropo_std, 3) + << "incorrect value for last_msg_.obs[6].tropo_std, expected 3, is " + << last_msg_.obs[6].tropo_std; + EXPECT_EQ(last_msg_.obs[7].L.f, 200) + << "incorrect value for last_msg_.obs[7].L.f, expected 200, is " + << last_msg_.obs[7].L.f; + EXPECT_EQ(last_msg_.obs[7].L.i, 113614775) + << "incorrect value for last_msg_.obs[7].L.i, expected 113614775, is " + << last_msg_.obs[7].L.i; + EXPECT_EQ(last_msg_.obs[7].P, 1081009286) + << "incorrect value for last_msg_.obs[7].P, expected 1081009286, is " + << last_msg_.obs[7].P; + EXPECT_EQ(last_msg_.obs[7].flags, 3) + << "incorrect value for last_msg_.obs[7].flags, expected 3, is " + << last_msg_.obs[7].flags; + EXPECT_EQ(last_msg_.obs[7].iono_std, 13) + << "incorrect value for last_msg_.obs[7].iono_std, expected 13, is " + << last_msg_.obs[7].iono_std; + EXPECT_EQ(last_msg_.obs[7].lock, 15) + << "incorrect value for last_msg_.obs[7].lock, expected 15, is " + << last_msg_.obs[7].lock; + EXPECT_EQ(last_msg_.obs[7].range_std, 3) + << "incorrect value for last_msg_.obs[7].range_std, expected 3, is " + << last_msg_.obs[7].range_std; + EXPECT_EQ(last_msg_.obs[7].sid.code, 0) + << "incorrect value for last_msg_.obs[7].sid.code, expected 0, is " + << last_msg_.obs[7].sid.code; + EXPECT_EQ(last_msg_.obs[7].sid.sat, 30) + << "incorrect value for last_msg_.obs[7].sid.sat, expected 30, is " + << last_msg_.obs[7].sid.sat; + EXPECT_EQ(last_msg_.obs[7].tropo_std, 3) + << "incorrect value for last_msg_.obs[7].tropo_std, expected 3, is " + << last_msg_.obs[7].tropo_std; + EXPECT_EQ(last_msg_.obs[8].L.f, 170) + << "incorrect value for last_msg_.obs[8].L.f, expected 170, is " + << last_msg_.obs[8].L.f; + EXPECT_EQ(last_msg_.obs[8].L.i, 94728270) + << "incorrect value for last_msg_.obs[8].L.i, expected 94728270, is " + << last_msg_.obs[8].L.i; + EXPECT_EQ(last_msg_.obs[8].P, 1156681781) + << "incorrect value for last_msg_.obs[8].P, expected 1156681781, is " + << last_msg_.obs[8].P; + EXPECT_EQ(last_msg_.obs[8].flags, 3) + << "incorrect value for last_msg_.obs[8].flags, expected 3, is " + << last_msg_.obs[8].flags; + EXPECT_EQ(last_msg_.obs[8].iono_std, 21) + << "incorrect value for last_msg_.obs[8].iono_std, expected 21, is " + << last_msg_.obs[8].iono_std; + EXPECT_EQ(last_msg_.obs[8].lock, 15) + << "incorrect value for last_msg_.obs[8].lock, expected 15, is " + << last_msg_.obs[8].lock; + EXPECT_EQ(last_msg_.obs[8].range_std, 7) + << "incorrect value for last_msg_.obs[8].range_std, expected 7, is " + << last_msg_.obs[8].range_std; + EXPECT_EQ(last_msg_.obs[8].sid.code, 6) + << "incorrect value for last_msg_.obs[8].sid.code, expected 6, is " + << last_msg_.obs[8].sid.code; + EXPECT_EQ(last_msg_.obs[8].sid.sat, 1) + << "incorrect value for last_msg_.obs[8].sid.sat, expected 1, is " + << last_msg_.obs[8].sid.sat; + EXPECT_EQ(last_msg_.obs[8].tropo_std, 7) + << "incorrect value for last_msg_.obs[8].tropo_std, expected 7, is " + << last_msg_.obs[8].tropo_std; + EXPECT_EQ(last_msg_.obs[9].L.f, 129) + << "incorrect value for last_msg_.obs[9].L.f, expected 129, is " + << last_msg_.obs[9].L.f; + EXPECT_EQ(last_msg_.obs[9].L.i, 87130275) + << "incorrect value for last_msg_.obs[9].L.i, expected 87130275, is " + << last_msg_.obs[9].L.i; + EXPECT_EQ(last_msg_.obs[9].P, 1063905531) + << "incorrect value for last_msg_.obs[9].P, expected 1063905531, is " + << last_msg_.obs[9].P; + EXPECT_EQ(last_msg_.obs[9].flags, 3) + << "incorrect value for last_msg_.obs[9].flags, expected 3, is " + << last_msg_.obs[9].flags; + EXPECT_EQ(last_msg_.obs[9].iono_std, 21) + << "incorrect value for last_msg_.obs[9].iono_std, expected 21, is " + << last_msg_.obs[9].iono_std; + EXPECT_EQ(last_msg_.obs[9].lock, 15) + << "incorrect value for last_msg_.obs[9].lock, expected 15, is " + << last_msg_.obs[9].lock; + EXPECT_EQ(last_msg_.obs[9].range_std, 3) + << "incorrect value for last_msg_.obs[9].range_std, expected 3, is " + << last_msg_.obs[9].range_std; + EXPECT_EQ(last_msg_.obs[9].sid.code, 6) + << "incorrect value for last_msg_.obs[9].sid.code, expected 6, is " + << last_msg_.obs[9].sid.code; + EXPECT_EQ(last_msg_.obs[9].sid.sat, 13) + << "incorrect value for last_msg_.obs[9].sid.sat, expected 13, is " + << last_msg_.obs[9].sid.sat; + EXPECT_EQ(last_msg_.obs[9].tropo_std, 3) + << "incorrect value for last_msg_.obs[9].tropo_std, expected 3, is " + << last_msg_.obs[9].tropo_std; + EXPECT_EQ(last_msg_.obs[10].L.f, 46) + << "incorrect value for last_msg_.obs[10].L.f, expected 46, is " + << last_msg_.obs[10].L.f; + EXPECT_EQ(last_msg_.obs[10].L.i, 86253605) + << "incorrect value for last_msg_.obs[10].L.i, expected 86253605, is " + << last_msg_.obs[10].L.i; + EXPECT_EQ(last_msg_.obs[10].P, 1053200752) + << "incorrect value for last_msg_.obs[10].P, expected 1053200752, is " + << last_msg_.obs[10].P; + EXPECT_EQ(last_msg_.obs[10].flags, 3) + << "incorrect value for last_msg_.obs[10].flags, expected 3, is " + << last_msg_.obs[10].flags; + EXPECT_EQ(last_msg_.obs[10].iono_std, 21) + << "incorrect value for last_msg_.obs[10].iono_std, expected 21, is " + << last_msg_.obs[10].iono_std; + EXPECT_EQ(last_msg_.obs[10].lock, 15) + << "incorrect value for last_msg_.obs[10].lock, expected 15, is " + << last_msg_.obs[10].lock; + EXPECT_EQ(last_msg_.obs[10].range_std, 3) + << "incorrect value for last_msg_.obs[10].range_std, expected 3, is " + << last_msg_.obs[10].range_std; + EXPECT_EQ(last_msg_.obs[10].sid.code, 6) + << "incorrect value for last_msg_.obs[10].sid.code, expected 6, is " + << last_msg_.obs[10].sid.code; + EXPECT_EQ(last_msg_.obs[10].sid.sat, 14) + << "incorrect value for last_msg_.obs[10].sid.sat, expected 14, is " + << last_msg_.obs[10].sid.sat; + EXPECT_EQ(last_msg_.obs[10].tropo_std, 3) + << "incorrect value for last_msg_.obs[10].tropo_std, expected 3, is " + << last_msg_.obs[10].tropo_std; + EXPECT_EQ(last_msg_.obs[11].L.f, 95) + << "incorrect value for last_msg_.obs[11].L.f, expected 95, is " + << last_msg_.obs[11].L.f; + EXPECT_EQ(last_msg_.obs[11].L.i, 93155512) + << "incorrect value for last_msg_.obs[11].L.i, expected 93155512, is " + << last_msg_.obs[11].L.i; + EXPECT_EQ(last_msg_.obs[11].P, 1137476774) + << "incorrect value for last_msg_.obs[11].P, expected 1137476774, is " + << last_msg_.obs[11].P; + EXPECT_EQ(last_msg_.obs[11].flags, 3) + << "incorrect value for last_msg_.obs[11].flags, expected 3, is " + << last_msg_.obs[11].flags; + EXPECT_EQ(last_msg_.obs[11].iono_std, 21) + << "incorrect value for last_msg_.obs[11].iono_std, expected 21, is " + << last_msg_.obs[11].iono_std; + EXPECT_EQ(last_msg_.obs[11].lock, 15) + << "incorrect value for last_msg_.obs[11].lock, expected 15, is " + << last_msg_.obs[11].lock; + EXPECT_EQ(last_msg_.obs[11].range_std, 5) + << "incorrect value for last_msg_.obs[11].range_std, expected 5, is " + << last_msg_.obs[11].range_std; + EXPECT_EQ(last_msg_.obs[11].sid.code, 6) + << "incorrect value for last_msg_.obs[11].sid.code, expected 6, is " + << last_msg_.obs[11].sid.code; + EXPECT_EQ(last_msg_.obs[11].sid.sat, 15) + << "incorrect value for last_msg_.obs[11].sid.sat, expected 15, is " + << last_msg_.obs[11].sid.sat; + EXPECT_EQ(last_msg_.obs[11].tropo_std, 5) + << "incorrect value for last_msg_.obs[11].tropo_std, expected 5, is " + << last_msg_.obs[11].tropo_std; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgSvAzEl.cc b/c/test/cpp/auto_check_sbp_observation_MsgSvAzEl.cc index de71948f1..b05505167 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgSvAzEl.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgSvAzEl.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvAzEl.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvAzEl.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgSvAzEl0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgSvAzEl0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgSvAzEl0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgSvAzEl0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_sv_az_el_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_sv_az_el_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,345 +67,631 @@ class Test_auto_check_sbp_observation_MsgSvAzEl0 : sbp_msg_sv_az_el_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgSvAzEl0, Test) -{ - - uint8_t encoded_frame[] = {85,151,0,207,121,132,8,0,160,12,10,0,139,66,13,0,16,1,15,0,24,25,16,0,127,18,18,0,42,53,20,0,31,16,23,0,12,67,24,0,47,10,26,0,116,8,27,0,153,43,29,0,77,10,32,0,94,26,1,3,16,58,2,3,108,53,8,3,17,13,17,3,165,40,23,3,63,35,24,3,41,73,20,12,114,26,27,12,72,54,28,12,69,3,29,12,158,14,30,12,152,68,32,12,120,82,2,14,131,6,4,14,27,44,5,14,101,21,9,14,81,65,11,14,49,56,12,14,59,6,30,14,154,4,36,14,165,62,168,36, }; - - sbp_msg_sv_az_el_t test_msg{}; - - test_msg.azel[0].az = 160; - test_msg.azel[0].el = 12; - test_msg.azel[0].sid.code = 0; - test_msg.azel[0].sid.sat = 8; - - test_msg.azel[1].az = 139; - test_msg.azel[1].el = 66; - test_msg.azel[1].sid.code = 0; - test_msg.azel[1].sid.sat = 10; - - test_msg.azel[2].az = 16; - test_msg.azel[2].el = 1; - test_msg.azel[2].sid.code = 0; - test_msg.azel[2].sid.sat = 13; - - test_msg.azel[3].az = 24; - test_msg.azel[3].el = 25; - test_msg.azel[3].sid.code = 0; - test_msg.azel[3].sid.sat = 15; - - test_msg.azel[4].az = 127; - test_msg.azel[4].el = 18; - test_msg.azel[4].sid.code = 0; - test_msg.azel[4].sid.sat = 16; - - test_msg.azel[5].az = 42; - test_msg.azel[5].el = 53; - test_msg.azel[5].sid.code = 0; - test_msg.azel[5].sid.sat = 18; - - test_msg.azel[6].az = 31; - test_msg.azel[6].el = 16; - test_msg.azel[6].sid.code = 0; - test_msg.azel[6].sid.sat = 20; - - test_msg.azel[7].az = 12; - test_msg.azel[7].el = 67; - test_msg.azel[7].sid.code = 0; - test_msg.azel[7].sid.sat = 23; - - test_msg.azel[8].az = 47; - test_msg.azel[8].el = 10; - test_msg.azel[8].sid.code = 0; - test_msg.azel[8].sid.sat = 24; - - test_msg.azel[9].az = 116; - test_msg.azel[9].el = 8; - test_msg.azel[9].sid.code = 0; - test_msg.azel[9].sid.sat = 26; - - test_msg.azel[10].az = 153; - test_msg.azel[10].el = 43; - test_msg.azel[10].sid.code = 0; - test_msg.azel[10].sid.sat = 27; - - test_msg.azel[11].az = 77; - test_msg.azel[11].el = 10; - test_msg.azel[11].sid.code = 0; - test_msg.azel[11].sid.sat = 29; - - test_msg.azel[12].az = 94; - test_msg.azel[12].el = 26; - test_msg.azel[12].sid.code = 0; - test_msg.azel[12].sid.sat = 32; - - test_msg.azel[13].az = 16; - test_msg.azel[13].el = 58; - test_msg.azel[13].sid.code = 3; - test_msg.azel[13].sid.sat = 1; - - test_msg.azel[14].az = 108; - test_msg.azel[14].el = 53; - test_msg.azel[14].sid.code = 3; - test_msg.azel[14].sid.sat = 2; - - test_msg.azel[15].az = 17; - test_msg.azel[15].el = 13; - test_msg.azel[15].sid.code = 3; - test_msg.azel[15].sid.sat = 8; - - test_msg.azel[16].az = 165; - test_msg.azel[16].el = 40; - test_msg.azel[16].sid.code = 3; - test_msg.azel[16].sid.sat = 17; - - test_msg.azel[17].az = 63; - test_msg.azel[17].el = 35; - test_msg.azel[17].sid.code = 3; - test_msg.azel[17].sid.sat = 23; - - test_msg.azel[18].az = 41; - test_msg.azel[18].el = 73; - test_msg.azel[18].sid.code = 3; - test_msg.azel[18].sid.sat = 24; - - test_msg.azel[19].az = 114; - test_msg.azel[19].el = 26; - test_msg.azel[19].sid.code = 12; - test_msg.azel[19].sid.sat = 20; - - test_msg.azel[20].az = 72; - test_msg.azel[20].el = 54; - test_msg.azel[20].sid.code = 12; - test_msg.azel[20].sid.sat = 27; - - test_msg.azel[21].az = 69; - test_msg.azel[21].el = 3; - test_msg.azel[21].sid.code = 12; - test_msg.azel[21].sid.sat = 28; - - test_msg.azel[22].az = 158; - test_msg.azel[22].el = 14; - test_msg.azel[22].sid.code = 12; - test_msg.azel[22].sid.sat = 29; - - test_msg.azel[23].az = 152; - test_msg.azel[23].el = 68; - test_msg.azel[23].sid.code = 12; - test_msg.azel[23].sid.sat = 30; - - test_msg.azel[24].az = 120; - test_msg.azel[24].el = 82; - test_msg.azel[24].sid.code = 12; - test_msg.azel[24].sid.sat = 32; - - test_msg.azel[25].az = 131; - test_msg.azel[25].el = 6; - test_msg.azel[25].sid.code = 14; - test_msg.azel[25].sid.sat = 2; - - test_msg.azel[26].az = 27; - test_msg.azel[26].el = 44; - test_msg.azel[26].sid.code = 14; - test_msg.azel[26].sid.sat = 4; - - test_msg.azel[27].az = 101; - test_msg.azel[27].el = 21; - test_msg.azel[27].sid.code = 14; - test_msg.azel[27].sid.sat = 5; - - test_msg.azel[28].az = 81; - test_msg.azel[28].el = 65; - test_msg.azel[28].sid.code = 14; - test_msg.azel[28].sid.sat = 9; - - test_msg.azel[29].az = 49; - test_msg.azel[29].el = 56; - test_msg.azel[29].sid.code = 14; - test_msg.azel[29].sid.sat = 11; - - test_msg.azel[30].az = 59; - test_msg.azel[30].el = 6; - test_msg.azel[30].sid.code = 14; - test_msg.azel[30].sid.sat = 12; - - test_msg.azel[31].az = 154; - test_msg.azel[31].el = 4; - test_msg.azel[31].sid.code = 14; - test_msg.azel[31].sid.sat = 30; - - test_msg.azel[32].az = 165; - test_msg.azel[32].el = 62; - test_msg.azel[32].sid.code = 14; - test_msg.azel[32].sid.sat = 36; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_azel.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)97,(char)122,(char)101,(char)108 }; - memcpy(test_msg.n_azel.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_azel.value = 33; - - EXPECT_EQ(send_message( 31183, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 31183); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.azel[0].az, 160) << "incorrect value for last_msg_.azel[0].az, expected 160, is " << last_msg_.azel[0].az; - EXPECT_EQ(last_msg_.azel[0].el, 12) << "incorrect value for last_msg_.azel[0].el, expected 12, is " << last_msg_.azel[0].el; - EXPECT_EQ(last_msg_.azel[0].sid.code, 0) << "incorrect value for last_msg_.azel[0].sid.code, expected 0, is " << last_msg_.azel[0].sid.code; - EXPECT_EQ(last_msg_.azel[0].sid.sat, 8) << "incorrect value for last_msg_.azel[0].sid.sat, expected 8, is " << last_msg_.azel[0].sid.sat; - EXPECT_EQ(last_msg_.azel[1].az, 139) << "incorrect value for last_msg_.azel[1].az, expected 139, is " << last_msg_.azel[1].az; - EXPECT_EQ(last_msg_.azel[1].el, 66) << "incorrect value for last_msg_.azel[1].el, expected 66, is " << last_msg_.azel[1].el; - EXPECT_EQ(last_msg_.azel[1].sid.code, 0) << "incorrect value for last_msg_.azel[1].sid.code, expected 0, is " << last_msg_.azel[1].sid.code; - EXPECT_EQ(last_msg_.azel[1].sid.sat, 10) << "incorrect value for last_msg_.azel[1].sid.sat, expected 10, is " << last_msg_.azel[1].sid.sat; - EXPECT_EQ(last_msg_.azel[2].az, 16) << "incorrect value for last_msg_.azel[2].az, expected 16, is " << last_msg_.azel[2].az; - EXPECT_EQ(last_msg_.azel[2].el, 1) << "incorrect value for last_msg_.azel[2].el, expected 1, is " << last_msg_.azel[2].el; - EXPECT_EQ(last_msg_.azel[2].sid.code, 0) << "incorrect value for last_msg_.azel[2].sid.code, expected 0, is " << last_msg_.azel[2].sid.code; - EXPECT_EQ(last_msg_.azel[2].sid.sat, 13) << "incorrect value for last_msg_.azel[2].sid.sat, expected 13, is " << last_msg_.azel[2].sid.sat; - EXPECT_EQ(last_msg_.azel[3].az, 24) << "incorrect value for last_msg_.azel[3].az, expected 24, is " << last_msg_.azel[3].az; - EXPECT_EQ(last_msg_.azel[3].el, 25) << "incorrect value for last_msg_.azel[3].el, expected 25, is " << last_msg_.azel[3].el; - EXPECT_EQ(last_msg_.azel[3].sid.code, 0) << "incorrect value for last_msg_.azel[3].sid.code, expected 0, is " << last_msg_.azel[3].sid.code; - EXPECT_EQ(last_msg_.azel[3].sid.sat, 15) << "incorrect value for last_msg_.azel[3].sid.sat, expected 15, is " << last_msg_.azel[3].sid.sat; - EXPECT_EQ(last_msg_.azel[4].az, 127) << "incorrect value for last_msg_.azel[4].az, expected 127, is " << last_msg_.azel[4].az; - EXPECT_EQ(last_msg_.azel[4].el, 18) << "incorrect value for last_msg_.azel[4].el, expected 18, is " << last_msg_.azel[4].el; - EXPECT_EQ(last_msg_.azel[4].sid.code, 0) << "incorrect value for last_msg_.azel[4].sid.code, expected 0, is " << last_msg_.azel[4].sid.code; - EXPECT_EQ(last_msg_.azel[4].sid.sat, 16) << "incorrect value for last_msg_.azel[4].sid.sat, expected 16, is " << last_msg_.azel[4].sid.sat; - EXPECT_EQ(last_msg_.azel[5].az, 42) << "incorrect value for last_msg_.azel[5].az, expected 42, is " << last_msg_.azel[5].az; - EXPECT_EQ(last_msg_.azel[5].el, 53) << "incorrect value for last_msg_.azel[5].el, expected 53, is " << last_msg_.azel[5].el; - EXPECT_EQ(last_msg_.azel[5].sid.code, 0) << "incorrect value for last_msg_.azel[5].sid.code, expected 0, is " << last_msg_.azel[5].sid.code; - EXPECT_EQ(last_msg_.azel[5].sid.sat, 18) << "incorrect value for last_msg_.azel[5].sid.sat, expected 18, is " << last_msg_.azel[5].sid.sat; - EXPECT_EQ(last_msg_.azel[6].az, 31) << "incorrect value for last_msg_.azel[6].az, expected 31, is " << last_msg_.azel[6].az; - EXPECT_EQ(last_msg_.azel[6].el, 16) << "incorrect value for last_msg_.azel[6].el, expected 16, is " << last_msg_.azel[6].el; - EXPECT_EQ(last_msg_.azel[6].sid.code, 0) << "incorrect value for last_msg_.azel[6].sid.code, expected 0, is " << last_msg_.azel[6].sid.code; - EXPECT_EQ(last_msg_.azel[6].sid.sat, 20) << "incorrect value for last_msg_.azel[6].sid.sat, expected 20, is " << last_msg_.azel[6].sid.sat; - EXPECT_EQ(last_msg_.azel[7].az, 12) << "incorrect value for last_msg_.azel[7].az, expected 12, is " << last_msg_.azel[7].az; - EXPECT_EQ(last_msg_.azel[7].el, 67) << "incorrect value for last_msg_.azel[7].el, expected 67, is " << last_msg_.azel[7].el; - EXPECT_EQ(last_msg_.azel[7].sid.code, 0) << "incorrect value for last_msg_.azel[7].sid.code, expected 0, is " << last_msg_.azel[7].sid.code; - EXPECT_EQ(last_msg_.azel[7].sid.sat, 23) << "incorrect value for last_msg_.azel[7].sid.sat, expected 23, is " << last_msg_.azel[7].sid.sat; - EXPECT_EQ(last_msg_.azel[8].az, 47) << "incorrect value for last_msg_.azel[8].az, expected 47, is " << last_msg_.azel[8].az; - EXPECT_EQ(last_msg_.azel[8].el, 10) << "incorrect value for last_msg_.azel[8].el, expected 10, is " << last_msg_.azel[8].el; - EXPECT_EQ(last_msg_.azel[8].sid.code, 0) << "incorrect value for last_msg_.azel[8].sid.code, expected 0, is " << last_msg_.azel[8].sid.code; - EXPECT_EQ(last_msg_.azel[8].sid.sat, 24) << "incorrect value for last_msg_.azel[8].sid.sat, expected 24, is " << last_msg_.azel[8].sid.sat; - EXPECT_EQ(last_msg_.azel[9].az, 116) << "incorrect value for last_msg_.azel[9].az, expected 116, is " << last_msg_.azel[9].az; - EXPECT_EQ(last_msg_.azel[9].el, 8) << "incorrect value for last_msg_.azel[9].el, expected 8, is " << last_msg_.azel[9].el; - EXPECT_EQ(last_msg_.azel[9].sid.code, 0) << "incorrect value for last_msg_.azel[9].sid.code, expected 0, is " << last_msg_.azel[9].sid.code; - EXPECT_EQ(last_msg_.azel[9].sid.sat, 26) << "incorrect value for last_msg_.azel[9].sid.sat, expected 26, is " << last_msg_.azel[9].sid.sat; - EXPECT_EQ(last_msg_.azel[10].az, 153) << "incorrect value for last_msg_.azel[10].az, expected 153, is " << last_msg_.azel[10].az; - EXPECT_EQ(last_msg_.azel[10].el, 43) << "incorrect value for last_msg_.azel[10].el, expected 43, is " << last_msg_.azel[10].el; - EXPECT_EQ(last_msg_.azel[10].sid.code, 0) << "incorrect value for last_msg_.azel[10].sid.code, expected 0, is " << last_msg_.azel[10].sid.code; - EXPECT_EQ(last_msg_.azel[10].sid.sat, 27) << "incorrect value for last_msg_.azel[10].sid.sat, expected 27, is " << last_msg_.azel[10].sid.sat; - EXPECT_EQ(last_msg_.azel[11].az, 77) << "incorrect value for last_msg_.azel[11].az, expected 77, is " << last_msg_.azel[11].az; - EXPECT_EQ(last_msg_.azel[11].el, 10) << "incorrect value for last_msg_.azel[11].el, expected 10, is " << last_msg_.azel[11].el; - EXPECT_EQ(last_msg_.azel[11].sid.code, 0) << "incorrect value for last_msg_.azel[11].sid.code, expected 0, is " << last_msg_.azel[11].sid.code; - EXPECT_EQ(last_msg_.azel[11].sid.sat, 29) << "incorrect value for last_msg_.azel[11].sid.sat, expected 29, is " << last_msg_.azel[11].sid.sat; - EXPECT_EQ(last_msg_.azel[12].az, 94) << "incorrect value for last_msg_.azel[12].az, expected 94, is " << last_msg_.azel[12].az; - EXPECT_EQ(last_msg_.azel[12].el, 26) << "incorrect value for last_msg_.azel[12].el, expected 26, is " << last_msg_.azel[12].el; - EXPECT_EQ(last_msg_.azel[12].sid.code, 0) << "incorrect value for last_msg_.azel[12].sid.code, expected 0, is " << last_msg_.azel[12].sid.code; - EXPECT_EQ(last_msg_.azel[12].sid.sat, 32) << "incorrect value for last_msg_.azel[12].sid.sat, expected 32, is " << last_msg_.azel[12].sid.sat; - EXPECT_EQ(last_msg_.azel[13].az, 16) << "incorrect value for last_msg_.azel[13].az, expected 16, is " << last_msg_.azel[13].az; - EXPECT_EQ(last_msg_.azel[13].el, 58) << "incorrect value for last_msg_.azel[13].el, expected 58, is " << last_msg_.azel[13].el; - EXPECT_EQ(last_msg_.azel[13].sid.code, 3) << "incorrect value for last_msg_.azel[13].sid.code, expected 3, is " << last_msg_.azel[13].sid.code; - EXPECT_EQ(last_msg_.azel[13].sid.sat, 1) << "incorrect value for last_msg_.azel[13].sid.sat, expected 1, is " << last_msg_.azel[13].sid.sat; - EXPECT_EQ(last_msg_.azel[14].az, 108) << "incorrect value for last_msg_.azel[14].az, expected 108, is " << last_msg_.azel[14].az; - EXPECT_EQ(last_msg_.azel[14].el, 53) << "incorrect value for last_msg_.azel[14].el, expected 53, is " << last_msg_.azel[14].el; - EXPECT_EQ(last_msg_.azel[14].sid.code, 3) << "incorrect value for last_msg_.azel[14].sid.code, expected 3, is " << last_msg_.azel[14].sid.code; - EXPECT_EQ(last_msg_.azel[14].sid.sat, 2) << "incorrect value for last_msg_.azel[14].sid.sat, expected 2, is " << last_msg_.azel[14].sid.sat; - EXPECT_EQ(last_msg_.azel[15].az, 17) << "incorrect value for last_msg_.azel[15].az, expected 17, is " << last_msg_.azel[15].az; - EXPECT_EQ(last_msg_.azel[15].el, 13) << "incorrect value for last_msg_.azel[15].el, expected 13, is " << last_msg_.azel[15].el; - EXPECT_EQ(last_msg_.azel[15].sid.code, 3) << "incorrect value for last_msg_.azel[15].sid.code, expected 3, is " << last_msg_.azel[15].sid.code; - EXPECT_EQ(last_msg_.azel[15].sid.sat, 8) << "incorrect value for last_msg_.azel[15].sid.sat, expected 8, is " << last_msg_.azel[15].sid.sat; - EXPECT_EQ(last_msg_.azel[16].az, 165) << "incorrect value for last_msg_.azel[16].az, expected 165, is " << last_msg_.azel[16].az; - EXPECT_EQ(last_msg_.azel[16].el, 40) << "incorrect value for last_msg_.azel[16].el, expected 40, is " << last_msg_.azel[16].el; - EXPECT_EQ(last_msg_.azel[16].sid.code, 3) << "incorrect value for last_msg_.azel[16].sid.code, expected 3, is " << last_msg_.azel[16].sid.code; - EXPECT_EQ(last_msg_.azel[16].sid.sat, 17) << "incorrect value for last_msg_.azel[16].sid.sat, expected 17, is " << last_msg_.azel[16].sid.sat; - EXPECT_EQ(last_msg_.azel[17].az, 63) << "incorrect value for last_msg_.azel[17].az, expected 63, is " << last_msg_.azel[17].az; - EXPECT_EQ(last_msg_.azel[17].el, 35) << "incorrect value for last_msg_.azel[17].el, expected 35, is " << last_msg_.azel[17].el; - EXPECT_EQ(last_msg_.azel[17].sid.code, 3) << "incorrect value for last_msg_.azel[17].sid.code, expected 3, is " << last_msg_.azel[17].sid.code; - EXPECT_EQ(last_msg_.azel[17].sid.sat, 23) << "incorrect value for last_msg_.azel[17].sid.sat, expected 23, is " << last_msg_.azel[17].sid.sat; - EXPECT_EQ(last_msg_.azel[18].az, 41) << "incorrect value for last_msg_.azel[18].az, expected 41, is " << last_msg_.azel[18].az; - EXPECT_EQ(last_msg_.azel[18].el, 73) << "incorrect value for last_msg_.azel[18].el, expected 73, is " << last_msg_.azel[18].el; - EXPECT_EQ(last_msg_.azel[18].sid.code, 3) << "incorrect value for last_msg_.azel[18].sid.code, expected 3, is " << last_msg_.azel[18].sid.code; - EXPECT_EQ(last_msg_.azel[18].sid.sat, 24) << "incorrect value for last_msg_.azel[18].sid.sat, expected 24, is " << last_msg_.azel[18].sid.sat; - EXPECT_EQ(last_msg_.azel[19].az, 114) << "incorrect value for last_msg_.azel[19].az, expected 114, is " << last_msg_.azel[19].az; - EXPECT_EQ(last_msg_.azel[19].el, 26) << "incorrect value for last_msg_.azel[19].el, expected 26, is " << last_msg_.azel[19].el; - EXPECT_EQ(last_msg_.azel[19].sid.code, 12) << "incorrect value for last_msg_.azel[19].sid.code, expected 12, is " << last_msg_.azel[19].sid.code; - EXPECT_EQ(last_msg_.azel[19].sid.sat, 20) << "incorrect value for last_msg_.azel[19].sid.sat, expected 20, is " << last_msg_.azel[19].sid.sat; - EXPECT_EQ(last_msg_.azel[20].az, 72) << "incorrect value for last_msg_.azel[20].az, expected 72, is " << last_msg_.azel[20].az; - EXPECT_EQ(last_msg_.azel[20].el, 54) << "incorrect value for last_msg_.azel[20].el, expected 54, is " << last_msg_.azel[20].el; - EXPECT_EQ(last_msg_.azel[20].sid.code, 12) << "incorrect value for last_msg_.azel[20].sid.code, expected 12, is " << last_msg_.azel[20].sid.code; - EXPECT_EQ(last_msg_.azel[20].sid.sat, 27) << "incorrect value for last_msg_.azel[20].sid.sat, expected 27, is " << last_msg_.azel[20].sid.sat; - EXPECT_EQ(last_msg_.azel[21].az, 69) << "incorrect value for last_msg_.azel[21].az, expected 69, is " << last_msg_.azel[21].az; - EXPECT_EQ(last_msg_.azel[21].el, 3) << "incorrect value for last_msg_.azel[21].el, expected 3, is " << last_msg_.azel[21].el; - EXPECT_EQ(last_msg_.azel[21].sid.code, 12) << "incorrect value for last_msg_.azel[21].sid.code, expected 12, is " << last_msg_.azel[21].sid.code; - EXPECT_EQ(last_msg_.azel[21].sid.sat, 28) << "incorrect value for last_msg_.azel[21].sid.sat, expected 28, is " << last_msg_.azel[21].sid.sat; - EXPECT_EQ(last_msg_.azel[22].az, 158) << "incorrect value for last_msg_.azel[22].az, expected 158, is " << last_msg_.azel[22].az; - EXPECT_EQ(last_msg_.azel[22].el, 14) << "incorrect value for last_msg_.azel[22].el, expected 14, is " << last_msg_.azel[22].el; - EXPECT_EQ(last_msg_.azel[22].sid.code, 12) << "incorrect value for last_msg_.azel[22].sid.code, expected 12, is " << last_msg_.azel[22].sid.code; - EXPECT_EQ(last_msg_.azel[22].sid.sat, 29) << "incorrect value for last_msg_.azel[22].sid.sat, expected 29, is " << last_msg_.azel[22].sid.sat; - EXPECT_EQ(last_msg_.azel[23].az, 152) << "incorrect value for last_msg_.azel[23].az, expected 152, is " << last_msg_.azel[23].az; - EXPECT_EQ(last_msg_.azel[23].el, 68) << "incorrect value for last_msg_.azel[23].el, expected 68, is " << last_msg_.azel[23].el; - EXPECT_EQ(last_msg_.azel[23].sid.code, 12) << "incorrect value for last_msg_.azel[23].sid.code, expected 12, is " << last_msg_.azel[23].sid.code; - EXPECT_EQ(last_msg_.azel[23].sid.sat, 30) << "incorrect value for last_msg_.azel[23].sid.sat, expected 30, is " << last_msg_.azel[23].sid.sat; - EXPECT_EQ(last_msg_.azel[24].az, 120) << "incorrect value for last_msg_.azel[24].az, expected 120, is " << last_msg_.azel[24].az; - EXPECT_EQ(last_msg_.azel[24].el, 82) << "incorrect value for last_msg_.azel[24].el, expected 82, is " << last_msg_.azel[24].el; - EXPECT_EQ(last_msg_.azel[24].sid.code, 12) << "incorrect value for last_msg_.azel[24].sid.code, expected 12, is " << last_msg_.azel[24].sid.code; - EXPECT_EQ(last_msg_.azel[24].sid.sat, 32) << "incorrect value for last_msg_.azel[24].sid.sat, expected 32, is " << last_msg_.azel[24].sid.sat; - EXPECT_EQ(last_msg_.azel[25].az, 131) << "incorrect value for last_msg_.azel[25].az, expected 131, is " << last_msg_.azel[25].az; - EXPECT_EQ(last_msg_.azel[25].el, 6) << "incorrect value for last_msg_.azel[25].el, expected 6, is " << last_msg_.azel[25].el; - EXPECT_EQ(last_msg_.azel[25].sid.code, 14) << "incorrect value for last_msg_.azel[25].sid.code, expected 14, is " << last_msg_.azel[25].sid.code; - EXPECT_EQ(last_msg_.azel[25].sid.sat, 2) << "incorrect value for last_msg_.azel[25].sid.sat, expected 2, is " << last_msg_.azel[25].sid.sat; - EXPECT_EQ(last_msg_.azel[26].az, 27) << "incorrect value for last_msg_.azel[26].az, expected 27, is " << last_msg_.azel[26].az; - EXPECT_EQ(last_msg_.azel[26].el, 44) << "incorrect value for last_msg_.azel[26].el, expected 44, is " << last_msg_.azel[26].el; - EXPECT_EQ(last_msg_.azel[26].sid.code, 14) << "incorrect value for last_msg_.azel[26].sid.code, expected 14, is " << last_msg_.azel[26].sid.code; - EXPECT_EQ(last_msg_.azel[26].sid.sat, 4) << "incorrect value for last_msg_.azel[26].sid.sat, expected 4, is " << last_msg_.azel[26].sid.sat; - EXPECT_EQ(last_msg_.azel[27].az, 101) << "incorrect value for last_msg_.azel[27].az, expected 101, is " << last_msg_.azel[27].az; - EXPECT_EQ(last_msg_.azel[27].el, 21) << "incorrect value for last_msg_.azel[27].el, expected 21, is " << last_msg_.azel[27].el; - EXPECT_EQ(last_msg_.azel[27].sid.code, 14) << "incorrect value for last_msg_.azel[27].sid.code, expected 14, is " << last_msg_.azel[27].sid.code; - EXPECT_EQ(last_msg_.azel[27].sid.sat, 5) << "incorrect value for last_msg_.azel[27].sid.sat, expected 5, is " << last_msg_.azel[27].sid.sat; - EXPECT_EQ(last_msg_.azel[28].az, 81) << "incorrect value for last_msg_.azel[28].az, expected 81, is " << last_msg_.azel[28].az; - EXPECT_EQ(last_msg_.azel[28].el, 65) << "incorrect value for last_msg_.azel[28].el, expected 65, is " << last_msg_.azel[28].el; - EXPECT_EQ(last_msg_.azel[28].sid.code, 14) << "incorrect value for last_msg_.azel[28].sid.code, expected 14, is " << last_msg_.azel[28].sid.code; - EXPECT_EQ(last_msg_.azel[28].sid.sat, 9) << "incorrect value for last_msg_.azel[28].sid.sat, expected 9, is " << last_msg_.azel[28].sid.sat; - EXPECT_EQ(last_msg_.azel[29].az, 49) << "incorrect value for last_msg_.azel[29].az, expected 49, is " << last_msg_.azel[29].az; - EXPECT_EQ(last_msg_.azel[29].el, 56) << "incorrect value for last_msg_.azel[29].el, expected 56, is " << last_msg_.azel[29].el; - EXPECT_EQ(last_msg_.azel[29].sid.code, 14) << "incorrect value for last_msg_.azel[29].sid.code, expected 14, is " << last_msg_.azel[29].sid.code; - EXPECT_EQ(last_msg_.azel[29].sid.sat, 11) << "incorrect value for last_msg_.azel[29].sid.sat, expected 11, is " << last_msg_.azel[29].sid.sat; - EXPECT_EQ(last_msg_.azel[30].az, 59) << "incorrect value for last_msg_.azel[30].az, expected 59, is " << last_msg_.azel[30].az; - EXPECT_EQ(last_msg_.azel[30].el, 6) << "incorrect value for last_msg_.azel[30].el, expected 6, is " << last_msg_.azel[30].el; - EXPECT_EQ(last_msg_.azel[30].sid.code, 14) << "incorrect value for last_msg_.azel[30].sid.code, expected 14, is " << last_msg_.azel[30].sid.code; - EXPECT_EQ(last_msg_.azel[30].sid.sat, 12) << "incorrect value for last_msg_.azel[30].sid.sat, expected 12, is " << last_msg_.azel[30].sid.sat; - EXPECT_EQ(last_msg_.azel[31].az, 154) << "incorrect value for last_msg_.azel[31].az, expected 154, is " << last_msg_.azel[31].az; - EXPECT_EQ(last_msg_.azel[31].el, 4) << "incorrect value for last_msg_.azel[31].el, expected 4, is " << last_msg_.azel[31].el; - EXPECT_EQ(last_msg_.azel[31].sid.code, 14) << "incorrect value for last_msg_.azel[31].sid.code, expected 14, is " << last_msg_.azel[31].sid.code; - EXPECT_EQ(last_msg_.azel[31].sid.sat, 30) << "incorrect value for last_msg_.azel[31].sid.sat, expected 30, is " << last_msg_.azel[31].sid.sat; - EXPECT_EQ(last_msg_.azel[32].az, 165) << "incorrect value for last_msg_.azel[32].az, expected 165, is " << last_msg_.azel[32].az; - EXPECT_EQ(last_msg_.azel[32].el, 62) << "incorrect value for last_msg_.azel[32].el, expected 62, is " << last_msg_.azel[32].el; - EXPECT_EQ(last_msg_.azel[32].sid.code, 14) << "incorrect value for last_msg_.azel[32].sid.code, expected 14, is " << last_msg_.azel[32].sid.code; - EXPECT_EQ(last_msg_.azel[32].sid.sat, 36) << "incorrect value for last_msg_.azel[32].sid.sat, expected 36, is " << last_msg_.azel[32].sid.sat; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_azel.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_azel.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_azel.handle_as << "'"; - } - { - const char check_string[] = { (char)97,(char)122,(char)101,(char)108 }; - EXPECT_EQ(memcmp(last_msg_.n_azel.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_azel.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_azel.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_azel.value, 33) << "incorrect value for last_msg_.n_azel.value, expected 33, is " << last_msg_.n_azel.value; +}; + +TEST_F(Test_auto_check_sbp_observation_MsgSvAzEl0, Test) { + uint8_t encoded_frame[] = { + 85, 151, 0, 207, 121, 132, 8, 0, 160, 12, 10, 0, 139, 66, 13, 0, + 16, 1, 15, 0, 24, 25, 16, 0, 127, 18, 18, 0, 42, 53, 20, 0, + 31, 16, 23, 0, 12, 67, 24, 0, 47, 10, 26, 0, 116, 8, 27, 0, + 153, 43, 29, 0, 77, 10, 32, 0, 94, 26, 1, 3, 16, 58, 2, 3, + 108, 53, 8, 3, 17, 13, 17, 3, 165, 40, 23, 3, 63, 35, 24, 3, + 41, 73, 20, 12, 114, 26, 27, 12, 72, 54, 28, 12, 69, 3, 29, 12, + 158, 14, 30, 12, 152, 68, 32, 12, 120, 82, 2, 14, 131, 6, 4, 14, + 27, 44, 5, 14, 101, 21, 9, 14, 81, 65, 11, 14, 49, 56, 12, 14, + 59, 6, 30, 14, 154, 4, 36, 14, 165, 62, 168, 36, + }; + + sbp_msg_sv_az_el_t test_msg{}; + + test_msg.azel[0].az = 160; + test_msg.azel[0].el = 12; + test_msg.azel[0].sid.code = 0; + test_msg.azel[0].sid.sat = 8; + + test_msg.azel[1].az = 139; + test_msg.azel[1].el = 66; + test_msg.azel[1].sid.code = 0; + test_msg.azel[1].sid.sat = 10; + + test_msg.azel[2].az = 16; + test_msg.azel[2].el = 1; + test_msg.azel[2].sid.code = 0; + test_msg.azel[2].sid.sat = 13; + + test_msg.azel[3].az = 24; + test_msg.azel[3].el = 25; + test_msg.azel[3].sid.code = 0; + test_msg.azel[3].sid.sat = 15; + + test_msg.azel[4].az = 127; + test_msg.azel[4].el = 18; + test_msg.azel[4].sid.code = 0; + test_msg.azel[4].sid.sat = 16; + + test_msg.azel[5].az = 42; + test_msg.azel[5].el = 53; + test_msg.azel[5].sid.code = 0; + test_msg.azel[5].sid.sat = 18; + + test_msg.azel[6].az = 31; + test_msg.azel[6].el = 16; + test_msg.azel[6].sid.code = 0; + test_msg.azel[6].sid.sat = 20; + + test_msg.azel[7].az = 12; + test_msg.azel[7].el = 67; + test_msg.azel[7].sid.code = 0; + test_msg.azel[7].sid.sat = 23; + + test_msg.azel[8].az = 47; + test_msg.azel[8].el = 10; + test_msg.azel[8].sid.code = 0; + test_msg.azel[8].sid.sat = 24; + + test_msg.azel[9].az = 116; + test_msg.azel[9].el = 8; + test_msg.azel[9].sid.code = 0; + test_msg.azel[9].sid.sat = 26; + + test_msg.azel[10].az = 153; + test_msg.azel[10].el = 43; + test_msg.azel[10].sid.code = 0; + test_msg.azel[10].sid.sat = 27; + + test_msg.azel[11].az = 77; + test_msg.azel[11].el = 10; + test_msg.azel[11].sid.code = 0; + test_msg.azel[11].sid.sat = 29; + + test_msg.azel[12].az = 94; + test_msg.azel[12].el = 26; + test_msg.azel[12].sid.code = 0; + test_msg.azel[12].sid.sat = 32; + + test_msg.azel[13].az = 16; + test_msg.azel[13].el = 58; + test_msg.azel[13].sid.code = 3; + test_msg.azel[13].sid.sat = 1; + + test_msg.azel[14].az = 108; + test_msg.azel[14].el = 53; + test_msg.azel[14].sid.code = 3; + test_msg.azel[14].sid.sat = 2; + + test_msg.azel[15].az = 17; + test_msg.azel[15].el = 13; + test_msg.azel[15].sid.code = 3; + test_msg.azel[15].sid.sat = 8; + + test_msg.azel[16].az = 165; + test_msg.azel[16].el = 40; + test_msg.azel[16].sid.code = 3; + test_msg.azel[16].sid.sat = 17; + + test_msg.azel[17].az = 63; + test_msg.azel[17].el = 35; + test_msg.azel[17].sid.code = 3; + test_msg.azel[17].sid.sat = 23; + + test_msg.azel[18].az = 41; + test_msg.azel[18].el = 73; + test_msg.azel[18].sid.code = 3; + test_msg.azel[18].sid.sat = 24; + + test_msg.azel[19].az = 114; + test_msg.azel[19].el = 26; + test_msg.azel[19].sid.code = 12; + test_msg.azel[19].sid.sat = 20; + + test_msg.azel[20].az = 72; + test_msg.azel[20].el = 54; + test_msg.azel[20].sid.code = 12; + test_msg.azel[20].sid.sat = 27; + + test_msg.azel[21].az = 69; + test_msg.azel[21].el = 3; + test_msg.azel[21].sid.code = 12; + test_msg.azel[21].sid.sat = 28; + + test_msg.azel[22].az = 158; + test_msg.azel[22].el = 14; + test_msg.azel[22].sid.code = 12; + test_msg.azel[22].sid.sat = 29; + + test_msg.azel[23].az = 152; + test_msg.azel[23].el = 68; + test_msg.azel[23].sid.code = 12; + test_msg.azel[23].sid.sat = 30; + + test_msg.azel[24].az = 120; + test_msg.azel[24].el = 82; + test_msg.azel[24].sid.code = 12; + test_msg.azel[24].sid.sat = 32; + + test_msg.azel[25].az = 131; + test_msg.azel[25].el = 6; + test_msg.azel[25].sid.code = 14; + test_msg.azel[25].sid.sat = 2; + + test_msg.azel[26].az = 27; + test_msg.azel[26].el = 44; + test_msg.azel[26].sid.code = 14; + test_msg.azel[26].sid.sat = 4; + + test_msg.azel[27].az = 101; + test_msg.azel[27].el = 21; + test_msg.azel[27].sid.code = 14; + test_msg.azel[27].sid.sat = 5; + + test_msg.azel[28].az = 81; + test_msg.azel[28].el = 65; + test_msg.azel[28].sid.code = 14; + test_msg.azel[28].sid.sat = 9; + + test_msg.azel[29].az = 49; + test_msg.azel[29].el = 56; + test_msg.azel[29].sid.code = 14; + test_msg.azel[29].sid.sat = 11; + + test_msg.azel[30].az = 59; + test_msg.azel[30].el = 6; + test_msg.azel[30].sid.code = 14; + test_msg.azel[30].sid.sat = 12; + + test_msg.azel[31].az = 154; + test_msg.azel[31].el = 4; + test_msg.azel[31].sid.code = 14; + test_msg.azel[31].sid.sat = 30; + + test_msg.azel[32].az = 165; + test_msg.azel[32].el = 62; + test_msg.azel[32].sid.code = 14; + test_msg.azel[32].sid.sat = 36; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_azel.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)97, (char)122, (char)101, (char)108}; + memcpy(test_msg.n_azel.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_azel.value = 33; + + EXPECT_EQ(send_message(31183, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 31183); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.azel[0].az, 160) + << "incorrect value for last_msg_.azel[0].az, expected 160, is " + << last_msg_.azel[0].az; + EXPECT_EQ(last_msg_.azel[0].el, 12) + << "incorrect value for last_msg_.azel[0].el, expected 12, is " + << last_msg_.azel[0].el; + EXPECT_EQ(last_msg_.azel[0].sid.code, 0) + << "incorrect value for last_msg_.azel[0].sid.code, expected 0, is " + << last_msg_.azel[0].sid.code; + EXPECT_EQ(last_msg_.azel[0].sid.sat, 8) + << "incorrect value for last_msg_.azel[0].sid.sat, expected 8, is " + << last_msg_.azel[0].sid.sat; + EXPECT_EQ(last_msg_.azel[1].az, 139) + << "incorrect value for last_msg_.azel[1].az, expected 139, is " + << last_msg_.azel[1].az; + EXPECT_EQ(last_msg_.azel[1].el, 66) + << "incorrect value for last_msg_.azel[1].el, expected 66, is " + << last_msg_.azel[1].el; + EXPECT_EQ(last_msg_.azel[1].sid.code, 0) + << "incorrect value for last_msg_.azel[1].sid.code, expected 0, is " + << last_msg_.azel[1].sid.code; + EXPECT_EQ(last_msg_.azel[1].sid.sat, 10) + << "incorrect value for last_msg_.azel[1].sid.sat, expected 10, is " + << last_msg_.azel[1].sid.sat; + EXPECT_EQ(last_msg_.azel[2].az, 16) + << "incorrect value for last_msg_.azel[2].az, expected 16, is " + << last_msg_.azel[2].az; + EXPECT_EQ(last_msg_.azel[2].el, 1) + << "incorrect value for last_msg_.azel[2].el, expected 1, is " + << last_msg_.azel[2].el; + EXPECT_EQ(last_msg_.azel[2].sid.code, 0) + << "incorrect value for last_msg_.azel[2].sid.code, expected 0, is " + << last_msg_.azel[2].sid.code; + EXPECT_EQ(last_msg_.azel[2].sid.sat, 13) + << "incorrect value for last_msg_.azel[2].sid.sat, expected 13, is " + << last_msg_.azel[2].sid.sat; + EXPECT_EQ(last_msg_.azel[3].az, 24) + << "incorrect value for last_msg_.azel[3].az, expected 24, is " + << last_msg_.azel[3].az; + EXPECT_EQ(last_msg_.azel[3].el, 25) + << "incorrect value for last_msg_.azel[3].el, expected 25, is " + << last_msg_.azel[3].el; + EXPECT_EQ(last_msg_.azel[3].sid.code, 0) + << "incorrect value for last_msg_.azel[3].sid.code, expected 0, is " + << last_msg_.azel[3].sid.code; + EXPECT_EQ(last_msg_.azel[3].sid.sat, 15) + << "incorrect value for last_msg_.azel[3].sid.sat, expected 15, is " + << last_msg_.azel[3].sid.sat; + EXPECT_EQ(last_msg_.azel[4].az, 127) + << "incorrect value for last_msg_.azel[4].az, expected 127, is " + << last_msg_.azel[4].az; + EXPECT_EQ(last_msg_.azel[4].el, 18) + << "incorrect value for last_msg_.azel[4].el, expected 18, is " + << last_msg_.azel[4].el; + EXPECT_EQ(last_msg_.azel[4].sid.code, 0) + << "incorrect value for last_msg_.azel[4].sid.code, expected 0, is " + << last_msg_.azel[4].sid.code; + EXPECT_EQ(last_msg_.azel[4].sid.sat, 16) + << "incorrect value for last_msg_.azel[4].sid.sat, expected 16, is " + << last_msg_.azel[4].sid.sat; + EXPECT_EQ(last_msg_.azel[5].az, 42) + << "incorrect value for last_msg_.azel[5].az, expected 42, is " + << last_msg_.azel[5].az; + EXPECT_EQ(last_msg_.azel[5].el, 53) + << "incorrect value for last_msg_.azel[5].el, expected 53, is " + << last_msg_.azel[5].el; + EXPECT_EQ(last_msg_.azel[5].sid.code, 0) + << "incorrect value for last_msg_.azel[5].sid.code, expected 0, is " + << last_msg_.azel[5].sid.code; + EXPECT_EQ(last_msg_.azel[5].sid.sat, 18) + << "incorrect value for last_msg_.azel[5].sid.sat, expected 18, is " + << last_msg_.azel[5].sid.sat; + EXPECT_EQ(last_msg_.azel[6].az, 31) + << "incorrect value for last_msg_.azel[6].az, expected 31, is " + << last_msg_.azel[6].az; + EXPECT_EQ(last_msg_.azel[6].el, 16) + << "incorrect value for last_msg_.azel[6].el, expected 16, is " + << last_msg_.azel[6].el; + EXPECT_EQ(last_msg_.azel[6].sid.code, 0) + << "incorrect value for last_msg_.azel[6].sid.code, expected 0, is " + << last_msg_.azel[6].sid.code; + EXPECT_EQ(last_msg_.azel[6].sid.sat, 20) + << "incorrect value for last_msg_.azel[6].sid.sat, expected 20, is " + << last_msg_.azel[6].sid.sat; + EXPECT_EQ(last_msg_.azel[7].az, 12) + << "incorrect value for last_msg_.azel[7].az, expected 12, is " + << last_msg_.azel[7].az; + EXPECT_EQ(last_msg_.azel[7].el, 67) + << "incorrect value for last_msg_.azel[7].el, expected 67, is " + << last_msg_.azel[7].el; + EXPECT_EQ(last_msg_.azel[7].sid.code, 0) + << "incorrect value for last_msg_.azel[7].sid.code, expected 0, is " + << last_msg_.azel[7].sid.code; + EXPECT_EQ(last_msg_.azel[7].sid.sat, 23) + << "incorrect value for last_msg_.azel[7].sid.sat, expected 23, is " + << last_msg_.azel[7].sid.sat; + EXPECT_EQ(last_msg_.azel[8].az, 47) + << "incorrect value for last_msg_.azel[8].az, expected 47, is " + << last_msg_.azel[8].az; + EXPECT_EQ(last_msg_.azel[8].el, 10) + << "incorrect value for last_msg_.azel[8].el, expected 10, is " + << last_msg_.azel[8].el; + EXPECT_EQ(last_msg_.azel[8].sid.code, 0) + << "incorrect value for last_msg_.azel[8].sid.code, expected 0, is " + << last_msg_.azel[8].sid.code; + EXPECT_EQ(last_msg_.azel[8].sid.sat, 24) + << "incorrect value for last_msg_.azel[8].sid.sat, expected 24, is " + << last_msg_.azel[8].sid.sat; + EXPECT_EQ(last_msg_.azel[9].az, 116) + << "incorrect value for last_msg_.azel[9].az, expected 116, is " + << last_msg_.azel[9].az; + EXPECT_EQ(last_msg_.azel[9].el, 8) + << "incorrect value for last_msg_.azel[9].el, expected 8, is " + << last_msg_.azel[9].el; + EXPECT_EQ(last_msg_.azel[9].sid.code, 0) + << "incorrect value for last_msg_.azel[9].sid.code, expected 0, is " + << last_msg_.azel[9].sid.code; + EXPECT_EQ(last_msg_.azel[9].sid.sat, 26) + << "incorrect value for last_msg_.azel[9].sid.sat, expected 26, is " + << last_msg_.azel[9].sid.sat; + EXPECT_EQ(last_msg_.azel[10].az, 153) + << "incorrect value for last_msg_.azel[10].az, expected 153, is " + << last_msg_.azel[10].az; + EXPECT_EQ(last_msg_.azel[10].el, 43) + << "incorrect value for last_msg_.azel[10].el, expected 43, is " + << last_msg_.azel[10].el; + EXPECT_EQ(last_msg_.azel[10].sid.code, 0) + << "incorrect value for last_msg_.azel[10].sid.code, expected 0, is " + << last_msg_.azel[10].sid.code; + EXPECT_EQ(last_msg_.azel[10].sid.sat, 27) + << "incorrect value for last_msg_.azel[10].sid.sat, expected 27, is " + << last_msg_.azel[10].sid.sat; + EXPECT_EQ(last_msg_.azel[11].az, 77) + << "incorrect value for last_msg_.azel[11].az, expected 77, is " + << last_msg_.azel[11].az; + EXPECT_EQ(last_msg_.azel[11].el, 10) + << "incorrect value for last_msg_.azel[11].el, expected 10, is " + << last_msg_.azel[11].el; + EXPECT_EQ(last_msg_.azel[11].sid.code, 0) + << "incorrect value for last_msg_.azel[11].sid.code, expected 0, is " + << last_msg_.azel[11].sid.code; + EXPECT_EQ(last_msg_.azel[11].sid.sat, 29) + << "incorrect value for last_msg_.azel[11].sid.sat, expected 29, is " + << last_msg_.azel[11].sid.sat; + EXPECT_EQ(last_msg_.azel[12].az, 94) + << "incorrect value for last_msg_.azel[12].az, expected 94, is " + << last_msg_.azel[12].az; + EXPECT_EQ(last_msg_.azel[12].el, 26) + << "incorrect value for last_msg_.azel[12].el, expected 26, is " + << last_msg_.azel[12].el; + EXPECT_EQ(last_msg_.azel[12].sid.code, 0) + << "incorrect value for last_msg_.azel[12].sid.code, expected 0, is " + << last_msg_.azel[12].sid.code; + EXPECT_EQ(last_msg_.azel[12].sid.sat, 32) + << "incorrect value for last_msg_.azel[12].sid.sat, expected 32, is " + << last_msg_.azel[12].sid.sat; + EXPECT_EQ(last_msg_.azel[13].az, 16) + << "incorrect value for last_msg_.azel[13].az, expected 16, is " + << last_msg_.azel[13].az; + EXPECT_EQ(last_msg_.azel[13].el, 58) + << "incorrect value for last_msg_.azel[13].el, expected 58, is " + << last_msg_.azel[13].el; + EXPECT_EQ(last_msg_.azel[13].sid.code, 3) + << "incorrect value for last_msg_.azel[13].sid.code, expected 3, is " + << last_msg_.azel[13].sid.code; + EXPECT_EQ(last_msg_.azel[13].sid.sat, 1) + << "incorrect value for last_msg_.azel[13].sid.sat, expected 1, is " + << last_msg_.azel[13].sid.sat; + EXPECT_EQ(last_msg_.azel[14].az, 108) + << "incorrect value for last_msg_.azel[14].az, expected 108, is " + << last_msg_.azel[14].az; + EXPECT_EQ(last_msg_.azel[14].el, 53) + << "incorrect value for last_msg_.azel[14].el, expected 53, is " + << last_msg_.azel[14].el; + EXPECT_EQ(last_msg_.azel[14].sid.code, 3) + << "incorrect value for last_msg_.azel[14].sid.code, expected 3, is " + << last_msg_.azel[14].sid.code; + EXPECT_EQ(last_msg_.azel[14].sid.sat, 2) + << "incorrect value for last_msg_.azel[14].sid.sat, expected 2, is " + << last_msg_.azel[14].sid.sat; + EXPECT_EQ(last_msg_.azel[15].az, 17) + << "incorrect value for last_msg_.azel[15].az, expected 17, is " + << last_msg_.azel[15].az; + EXPECT_EQ(last_msg_.azel[15].el, 13) + << "incorrect value for last_msg_.azel[15].el, expected 13, is " + << last_msg_.azel[15].el; + EXPECT_EQ(last_msg_.azel[15].sid.code, 3) + << "incorrect value for last_msg_.azel[15].sid.code, expected 3, is " + << last_msg_.azel[15].sid.code; + EXPECT_EQ(last_msg_.azel[15].sid.sat, 8) + << "incorrect value for last_msg_.azel[15].sid.sat, expected 8, is " + << last_msg_.azel[15].sid.sat; + EXPECT_EQ(last_msg_.azel[16].az, 165) + << "incorrect value for last_msg_.azel[16].az, expected 165, is " + << last_msg_.azel[16].az; + EXPECT_EQ(last_msg_.azel[16].el, 40) + << "incorrect value for last_msg_.azel[16].el, expected 40, is " + << last_msg_.azel[16].el; + EXPECT_EQ(last_msg_.azel[16].sid.code, 3) + << "incorrect value for last_msg_.azel[16].sid.code, expected 3, is " + << last_msg_.azel[16].sid.code; + EXPECT_EQ(last_msg_.azel[16].sid.sat, 17) + << "incorrect value for last_msg_.azel[16].sid.sat, expected 17, is " + << last_msg_.azel[16].sid.sat; + EXPECT_EQ(last_msg_.azel[17].az, 63) + << "incorrect value for last_msg_.azel[17].az, expected 63, is " + << last_msg_.azel[17].az; + EXPECT_EQ(last_msg_.azel[17].el, 35) + << "incorrect value for last_msg_.azel[17].el, expected 35, is " + << last_msg_.azel[17].el; + EXPECT_EQ(last_msg_.azel[17].sid.code, 3) + << "incorrect value for last_msg_.azel[17].sid.code, expected 3, is " + << last_msg_.azel[17].sid.code; + EXPECT_EQ(last_msg_.azel[17].sid.sat, 23) + << "incorrect value for last_msg_.azel[17].sid.sat, expected 23, is " + << last_msg_.azel[17].sid.sat; + EXPECT_EQ(last_msg_.azel[18].az, 41) + << "incorrect value for last_msg_.azel[18].az, expected 41, is " + << last_msg_.azel[18].az; + EXPECT_EQ(last_msg_.azel[18].el, 73) + << "incorrect value for last_msg_.azel[18].el, expected 73, is " + << last_msg_.azel[18].el; + EXPECT_EQ(last_msg_.azel[18].sid.code, 3) + << "incorrect value for last_msg_.azel[18].sid.code, expected 3, is " + << last_msg_.azel[18].sid.code; + EXPECT_EQ(last_msg_.azel[18].sid.sat, 24) + << "incorrect value for last_msg_.azel[18].sid.sat, expected 24, is " + << last_msg_.azel[18].sid.sat; + EXPECT_EQ(last_msg_.azel[19].az, 114) + << "incorrect value for last_msg_.azel[19].az, expected 114, is " + << last_msg_.azel[19].az; + EXPECT_EQ(last_msg_.azel[19].el, 26) + << "incorrect value for last_msg_.azel[19].el, expected 26, is " + << last_msg_.azel[19].el; + EXPECT_EQ(last_msg_.azel[19].sid.code, 12) + << "incorrect value for last_msg_.azel[19].sid.code, expected 12, is " + << last_msg_.azel[19].sid.code; + EXPECT_EQ(last_msg_.azel[19].sid.sat, 20) + << "incorrect value for last_msg_.azel[19].sid.sat, expected 20, is " + << last_msg_.azel[19].sid.sat; + EXPECT_EQ(last_msg_.azel[20].az, 72) + << "incorrect value for last_msg_.azel[20].az, expected 72, is " + << last_msg_.azel[20].az; + EXPECT_EQ(last_msg_.azel[20].el, 54) + << "incorrect value for last_msg_.azel[20].el, expected 54, is " + << last_msg_.azel[20].el; + EXPECT_EQ(last_msg_.azel[20].sid.code, 12) + << "incorrect value for last_msg_.azel[20].sid.code, expected 12, is " + << last_msg_.azel[20].sid.code; + EXPECT_EQ(last_msg_.azel[20].sid.sat, 27) + << "incorrect value for last_msg_.azel[20].sid.sat, expected 27, is " + << last_msg_.azel[20].sid.sat; + EXPECT_EQ(last_msg_.azel[21].az, 69) + << "incorrect value for last_msg_.azel[21].az, expected 69, is " + << last_msg_.azel[21].az; + EXPECT_EQ(last_msg_.azel[21].el, 3) + << "incorrect value for last_msg_.azel[21].el, expected 3, is " + << last_msg_.azel[21].el; + EXPECT_EQ(last_msg_.azel[21].sid.code, 12) + << "incorrect value for last_msg_.azel[21].sid.code, expected 12, is " + << last_msg_.azel[21].sid.code; + EXPECT_EQ(last_msg_.azel[21].sid.sat, 28) + << "incorrect value for last_msg_.azel[21].sid.sat, expected 28, is " + << last_msg_.azel[21].sid.sat; + EXPECT_EQ(last_msg_.azel[22].az, 158) + << "incorrect value for last_msg_.azel[22].az, expected 158, is " + << last_msg_.azel[22].az; + EXPECT_EQ(last_msg_.azel[22].el, 14) + << "incorrect value for last_msg_.azel[22].el, expected 14, is " + << last_msg_.azel[22].el; + EXPECT_EQ(last_msg_.azel[22].sid.code, 12) + << "incorrect value for last_msg_.azel[22].sid.code, expected 12, is " + << last_msg_.azel[22].sid.code; + EXPECT_EQ(last_msg_.azel[22].sid.sat, 29) + << "incorrect value for last_msg_.azel[22].sid.sat, expected 29, is " + << last_msg_.azel[22].sid.sat; + EXPECT_EQ(last_msg_.azel[23].az, 152) + << "incorrect value for last_msg_.azel[23].az, expected 152, is " + << last_msg_.azel[23].az; + EXPECT_EQ(last_msg_.azel[23].el, 68) + << "incorrect value for last_msg_.azel[23].el, expected 68, is " + << last_msg_.azel[23].el; + EXPECT_EQ(last_msg_.azel[23].sid.code, 12) + << "incorrect value for last_msg_.azel[23].sid.code, expected 12, is " + << last_msg_.azel[23].sid.code; + EXPECT_EQ(last_msg_.azel[23].sid.sat, 30) + << "incorrect value for last_msg_.azel[23].sid.sat, expected 30, is " + << last_msg_.azel[23].sid.sat; + EXPECT_EQ(last_msg_.azel[24].az, 120) + << "incorrect value for last_msg_.azel[24].az, expected 120, is " + << last_msg_.azel[24].az; + EXPECT_EQ(last_msg_.azel[24].el, 82) + << "incorrect value for last_msg_.azel[24].el, expected 82, is " + << last_msg_.azel[24].el; + EXPECT_EQ(last_msg_.azel[24].sid.code, 12) + << "incorrect value for last_msg_.azel[24].sid.code, expected 12, is " + << last_msg_.azel[24].sid.code; + EXPECT_EQ(last_msg_.azel[24].sid.sat, 32) + << "incorrect value for last_msg_.azel[24].sid.sat, expected 32, is " + << last_msg_.azel[24].sid.sat; + EXPECT_EQ(last_msg_.azel[25].az, 131) + << "incorrect value for last_msg_.azel[25].az, expected 131, is " + << last_msg_.azel[25].az; + EXPECT_EQ(last_msg_.azel[25].el, 6) + << "incorrect value for last_msg_.azel[25].el, expected 6, is " + << last_msg_.azel[25].el; + EXPECT_EQ(last_msg_.azel[25].sid.code, 14) + << "incorrect value for last_msg_.azel[25].sid.code, expected 14, is " + << last_msg_.azel[25].sid.code; + EXPECT_EQ(last_msg_.azel[25].sid.sat, 2) + << "incorrect value for last_msg_.azel[25].sid.sat, expected 2, is " + << last_msg_.azel[25].sid.sat; + EXPECT_EQ(last_msg_.azel[26].az, 27) + << "incorrect value for last_msg_.azel[26].az, expected 27, is " + << last_msg_.azel[26].az; + EXPECT_EQ(last_msg_.azel[26].el, 44) + << "incorrect value for last_msg_.azel[26].el, expected 44, is " + << last_msg_.azel[26].el; + EXPECT_EQ(last_msg_.azel[26].sid.code, 14) + << "incorrect value for last_msg_.azel[26].sid.code, expected 14, is " + << last_msg_.azel[26].sid.code; + EXPECT_EQ(last_msg_.azel[26].sid.sat, 4) + << "incorrect value for last_msg_.azel[26].sid.sat, expected 4, is " + << last_msg_.azel[26].sid.sat; + EXPECT_EQ(last_msg_.azel[27].az, 101) + << "incorrect value for last_msg_.azel[27].az, expected 101, is " + << last_msg_.azel[27].az; + EXPECT_EQ(last_msg_.azel[27].el, 21) + << "incorrect value for last_msg_.azel[27].el, expected 21, is " + << last_msg_.azel[27].el; + EXPECT_EQ(last_msg_.azel[27].sid.code, 14) + << "incorrect value for last_msg_.azel[27].sid.code, expected 14, is " + << last_msg_.azel[27].sid.code; + EXPECT_EQ(last_msg_.azel[27].sid.sat, 5) + << "incorrect value for last_msg_.azel[27].sid.sat, expected 5, is " + << last_msg_.azel[27].sid.sat; + EXPECT_EQ(last_msg_.azel[28].az, 81) + << "incorrect value for last_msg_.azel[28].az, expected 81, is " + << last_msg_.azel[28].az; + EXPECT_EQ(last_msg_.azel[28].el, 65) + << "incorrect value for last_msg_.azel[28].el, expected 65, is " + << last_msg_.azel[28].el; + EXPECT_EQ(last_msg_.azel[28].sid.code, 14) + << "incorrect value for last_msg_.azel[28].sid.code, expected 14, is " + << last_msg_.azel[28].sid.code; + EXPECT_EQ(last_msg_.azel[28].sid.sat, 9) + << "incorrect value for last_msg_.azel[28].sid.sat, expected 9, is " + << last_msg_.azel[28].sid.sat; + EXPECT_EQ(last_msg_.azel[29].az, 49) + << "incorrect value for last_msg_.azel[29].az, expected 49, is " + << last_msg_.azel[29].az; + EXPECT_EQ(last_msg_.azel[29].el, 56) + << "incorrect value for last_msg_.azel[29].el, expected 56, is " + << last_msg_.azel[29].el; + EXPECT_EQ(last_msg_.azel[29].sid.code, 14) + << "incorrect value for last_msg_.azel[29].sid.code, expected 14, is " + << last_msg_.azel[29].sid.code; + EXPECT_EQ(last_msg_.azel[29].sid.sat, 11) + << "incorrect value for last_msg_.azel[29].sid.sat, expected 11, is " + << last_msg_.azel[29].sid.sat; + EXPECT_EQ(last_msg_.azel[30].az, 59) + << "incorrect value for last_msg_.azel[30].az, expected 59, is " + << last_msg_.azel[30].az; + EXPECT_EQ(last_msg_.azel[30].el, 6) + << "incorrect value for last_msg_.azel[30].el, expected 6, is " + << last_msg_.azel[30].el; + EXPECT_EQ(last_msg_.azel[30].sid.code, 14) + << "incorrect value for last_msg_.azel[30].sid.code, expected 14, is " + << last_msg_.azel[30].sid.code; + EXPECT_EQ(last_msg_.azel[30].sid.sat, 12) + << "incorrect value for last_msg_.azel[30].sid.sat, expected 12, is " + << last_msg_.azel[30].sid.sat; + EXPECT_EQ(last_msg_.azel[31].az, 154) + << "incorrect value for last_msg_.azel[31].az, expected 154, is " + << last_msg_.azel[31].az; + EXPECT_EQ(last_msg_.azel[31].el, 4) + << "incorrect value for last_msg_.azel[31].el, expected 4, is " + << last_msg_.azel[31].el; + EXPECT_EQ(last_msg_.azel[31].sid.code, 14) + << "incorrect value for last_msg_.azel[31].sid.code, expected 14, is " + << last_msg_.azel[31].sid.code; + EXPECT_EQ(last_msg_.azel[31].sid.sat, 30) + << "incorrect value for last_msg_.azel[31].sid.sat, expected 30, is " + << last_msg_.azel[31].sid.sat; + EXPECT_EQ(last_msg_.azel[32].az, 165) + << "incorrect value for last_msg_.azel[32].az, expected 165, is " + << last_msg_.azel[32].az; + EXPECT_EQ(last_msg_.azel[32].el, 62) + << "incorrect value for last_msg_.azel[32].el, expected 62, is " + << last_msg_.azel[32].el; + EXPECT_EQ(last_msg_.azel[32].sid.code, 14) + << "incorrect value for last_msg_.azel[32].sid.code, expected 14, is " + << last_msg_.azel[32].sid.code; + EXPECT_EQ(last_msg_.azel[32].sid.sat, 36) + << "incorrect value for last_msg_.azel[32].sid.sat, expected 36, is " + << last_msg_.azel[32].sid.sat; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_azel.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_azel.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_azel.handle_as << "'"; + } + { + const char check_string[] = {(char)97, (char)122, (char)101, (char)108}; + EXPECT_EQ( + memcmp(last_msg_.n_azel.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_azel.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_azel.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_azel.value, 33) + << "incorrect value for last_msg_.n_azel.value, expected 33, is " + << last_msg_.n_azel.value; } diff --git a/c/test/cpp/auto_check_sbp_observation_MsgSvConfigurationGpsDep.cc b/c/test/cpp/auto_check_sbp_observation_MsgSvConfigurationGpsDep.cc index 6ae5f57ad..6722d15bd 100644 --- a/c/test/cpp/auto_check_sbp_observation_MsgSvConfigurationGpsDep.cc +++ b/c/test/cpp/auto_check_sbp_observation_MsgSvConfigurationGpsDep.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvConfigurationGpsDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvConfigurationGpsDep.yaml +// by generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_MsgSvConfigurationGpsDep0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_MsgSvConfigurationGpsDep0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_MsgSvConfigurationGpsDep0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_MsgSvConfigurationGpsDep0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_sv_configuration_gps_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_sv_configuration_gps_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,36 +67,42 @@ class Test_auto_check_sbp_observation_MsgSvConfigurationGpsDep0 : sbp_msg_sv_configuration_gps_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_MsgSvConfigurationGpsDep0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_MsgSvConfigurationGpsDep0, Test) { + uint8_t encoded_frame[] = { + 85, 145, 0, 123, 0, 10, 0, 0, 0, 0, 0, 0, 66, 188, 101, 167, 18, 42, + }; - uint8_t encoded_frame[] = {85,145,0,123,0,10,0,0,0,0,0,0,66,188,101,167,18,42, }; + sbp_msg_sv_configuration_gps_dep_t test_msg{}; + test_msg.l2c_mask = 2808462402; + test_msg.t_nmct.tow = 0; + test_msg.t_nmct.wn = 0; - sbp_msg_sv_configuration_gps_dep_t test_msg{}; - test_msg.l2c_mask = 2808462402; - test_msg.t_nmct.tow = 0; - test_msg.t_nmct.wn = 0; - - EXPECT_EQ(send_message( 123, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(123, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.l2c_mask, 2808462402) << "incorrect value for last_msg_.l2c_mask, expected 2808462402, is " << last_msg_.l2c_mask; - EXPECT_EQ(last_msg_.t_nmct.tow, 0) << "incorrect value for last_msg_.t_nmct.tow, expected 0, is " << last_msg_.t_nmct.tow; - EXPECT_EQ(last_msg_.t_nmct.wn, 0) << "incorrect value for last_msg_.t_nmct.wn, expected 0, is " << last_msg_.t_nmct.wn; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.l2c_mask, 2808462402) + << "incorrect value for last_msg_.l2c_mask, expected 2808462402, is " + << last_msg_.l2c_mask; + EXPECT_EQ(last_msg_.t_nmct.tow, 0) + << "incorrect value for last_msg_.t_nmct.tow, expected 0, is " + << last_msg_.t_nmct.tow; + EXPECT_EQ(last_msg_.t_nmct.wn, 0) + << "incorrect value for last_msg_.t_nmct.wn, expected 0, is " + << last_msg_.t_nmct.wn; } diff --git a/c/test/cpp/auto_check_sbp_observation_msgEphemerisDepB.cc b/c/test/cpp/auto_check_sbp_observation_msgEphemerisDepB.cc index 2570c1ee8..98c5d06bb 100644 --- a/c/test/cpp/auto_check_sbp_observation_msgEphemerisDepB.cc +++ b/c/test/cpp/auto_check_sbp_observation_msgEphemerisDepB.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisDepB.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_msgEphemerisDepB0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_msgEphemerisDepB0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_msgEphemerisDepB0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_msgEphemerisDepB0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,134 +67,195 @@ class Test_auto_check_sbp_observation_msgEphemerisDepB0 : sbp_msg_ephemeris_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_msgEphemerisDepB0, Test) -{ - - uint8_t encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,60,190,0,0,0,0,0,186,82,192,0,0,0,0,0,76,109,64,0,0,0,0,0,132,208,190,0,0,0,0,0,254,220,62,0,0,0,0,0,0,113,62,0,0,0,0,0,0,133,190,28,36,25,81,223,254,52,62,220,116,216,39,33,189,3,64,0,0,0,156,177,204,134,63,0,0,160,220,182,33,180,64,152,225,192,44,254,76,238,191,41,150,24,2,148,156,65,190,252,90,119,48,15,215,240,63,124,127,115,94,208,16,238,63,165,115,52,74,97,167,246,189,0,0,0,0,192,180,229,190,0,0,0,0,0,0,112,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,3,0,225,156, }; - - sbp_msg_ephemeris_dep_b_t test_msg{}; - test_msg.af0 = -1.035025343298912e-05; - test_msg.af1 = -9.094947017729282e-13; - test_msg.af2 = 0.0; - test_msg.c_ic = 6.332993507385254e-08; - test_msg.c_is = -1.564621925354004e-07; - test_msg.c_rc = 234.375; - test_msg.c_rs = -74.90625; - test_msg.c_uc = -3.937631845474243e-06; - test_msg.c_us = 6.9122761487960815e-06; - test_msg.dn = 4.8884179079418005e-09; - test_msg.ecc = 0.011132609914056957; - test_msg.healthy = 1; - test_msg.inc = 0.9395524830579087; - test_msg.inc_dot = -3.296565886629854e-10; - test_msg.iode = 0; - test_msg.m0 = 2.467348395627239; - test_msg.omega0 = -0.9468985437479658; - test_msg.omegadot = -8.201055892610478e-09; - test_msg.prn = 3; - test_msg.sqrta = 5153.714303970337; - test_msg.tgd = -6.51925802230835e-09; - test_msg.toc_tow = 410400.0; - test_msg.toc_wn = 1838; - test_msg.toe_tow = 410400.0; - test_msg.toe_wn = 1838; - test_msg.valid = 1; - test_msg.w = 1.0525047200405302; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - -1.0350253433e-05 * 100), 0.05) << "incorrect value for last_msg_.af0, expected -1.0350253433e-05, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - -9.09494701773e-13 * 100), 0.05) << "incorrect value for last_msg_.af1, expected -9.09494701773e-13, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.af2, expected 0.0, is " << last_msg_.af2; - EXPECT_LT((last_msg_.c_ic * 100 - 6.33299350739e-08 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected 6.33299350739e-08, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - -1.56462192535e-07 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected -1.56462192535e-07, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - 234.375 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected 234.375, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - -74.90625 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected -74.90625, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - -3.93763184547e-06 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected -3.93763184547e-06, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 6.9122761488e-06 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 6.9122761488e-06, is " << last_msg_.c_us; - EXPECT_LT((last_msg_.dn * 100 - 4.88841790794e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 4.88841790794e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.0111326099141 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.0111326099141, is " << last_msg_.ecc; - EXPECT_EQ(last_msg_.healthy, 1) << "incorrect value for last_msg_.healthy, expected 1, is " << last_msg_.healthy; - EXPECT_LT((last_msg_.inc * 100 - 0.939552483058 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.939552483058, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - -3.29656588663e-10 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected -3.29656588663e-10, is " << last_msg_.inc_dot; - EXPECT_EQ(last_msg_.iode, 0) << "incorrect value for last_msg_.iode, expected 0, is " << last_msg_.iode; - EXPECT_LT((last_msg_.m0 * 100 - 2.46734839563 * 100), 0.05) << "incorrect value for last_msg_.m0, expected 2.46734839563, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - -0.946898543748 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected -0.946898543748, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -8.20105589261e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -8.20105589261e-09, is " << last_msg_.omegadot; - EXPECT_EQ(last_msg_.prn, 3) << "incorrect value for last_msg_.prn, expected 3, is " << last_msg_.prn; - EXPECT_LT((last_msg_.sqrta * 100 - 5153.71430397 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5153.71430397, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.tgd * 100 - -6.51925802231e-09 * 100), 0.05) << "incorrect value for last_msg_.tgd, expected -6.51925802231e-09, is " << last_msg_.tgd; - EXPECT_LT((last_msg_.toc_tow * 100 - 410400.0 * 100), 0.05) << "incorrect value for last_msg_.toc_tow, expected 410400.0, is " << last_msg_.toc_tow; - EXPECT_EQ(last_msg_.toc_wn, 1838) << "incorrect value for last_msg_.toc_wn, expected 1838, is " << last_msg_.toc_wn; - EXPECT_LT((last_msg_.toe_tow * 100 - 410400.0 * 100), 0.05) << "incorrect value for last_msg_.toe_tow, expected 410400.0, is " << last_msg_.toe_tow; - EXPECT_EQ(last_msg_.toe_wn, 1838) << "incorrect value for last_msg_.toe_wn, expected 1838, is " << last_msg_.toe_wn; - EXPECT_EQ(last_msg_.valid, 1) << "incorrect value for last_msg_.valid, expected 1, is " << last_msg_.valid; - EXPECT_LT((last_msg_.w * 100 - 1.05250472004 * 100), 0.05) << "incorrect value for last_msg_.w, expected 1.05250472004, is " << last_msg_.w; +}; + +TEST_F(Test_auto_check_sbp_observation_msgEphemerisDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 60, 190, 0, + 0, 0, 0, 0, 186, 82, 192, 0, 0, 0, 0, 0, 76, 109, 64, + 0, 0, 0, 0, 0, 132, 208, 190, 0, 0, 0, 0, 0, 254, 220, + 62, 0, 0, 0, 0, 0, 0, 113, 62, 0, 0, 0, 0, 0, 0, + 133, 190, 28, 36, 25, 81, 223, 254, 52, 62, 220, 116, 216, 39, 33, + 189, 3, 64, 0, 0, 0, 156, 177, 204, 134, 63, 0, 0, 160, 220, + 182, 33, 180, 64, 152, 225, 192, 44, 254, 76, 238, 191, 41, 150, 24, + 2, 148, 156, 65, 190, 252, 90, 119, 48, 15, 215, 240, 63, 124, 127, + 115, 94, 208, 16, 238, 63, 165, 115, 52, 74, 97, 167, 246, 189, 0, + 0, 0, 0, 192, 180, 229, 190, 0, 0, 0, 0, 0, 0, 112, 189, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, + 65, 46, 7, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, + 3, 0, 225, 156, + }; + + sbp_msg_ephemeris_dep_b_t test_msg{}; + test_msg.af0 = -1.035025343298912e-05; + test_msg.af1 = -9.094947017729282e-13; + test_msg.af2 = 0.0; + test_msg.c_ic = 6.332993507385254e-08; + test_msg.c_is = -1.564621925354004e-07; + test_msg.c_rc = 234.375; + test_msg.c_rs = -74.90625; + test_msg.c_uc = -3.937631845474243e-06; + test_msg.c_us = 6.9122761487960815e-06; + test_msg.dn = 4.8884179079418005e-09; + test_msg.ecc = 0.011132609914056957; + test_msg.healthy = 1; + test_msg.inc = 0.9395524830579087; + test_msg.inc_dot = -3.296565886629854e-10; + test_msg.iode = 0; + test_msg.m0 = 2.467348395627239; + test_msg.omega0 = -0.9468985437479658; + test_msg.omegadot = -8.201055892610478e-09; + test_msg.prn = 3; + test_msg.sqrta = 5153.714303970337; + test_msg.tgd = -6.51925802230835e-09; + test_msg.toc_tow = 410400.0; + test_msg.toc_wn = 1838; + test_msg.toe_tow = 410400.0; + test_msg.toe_wn = 1838; + test_msg.valid = 1; + test_msg.w = 1.0525047200405302; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - -1.0350253433e-05 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected -1.0350253433e-05, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - -9.09494701773e-13 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected -9.09494701773e-13, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected 0.0, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.c_ic * 100 - 6.33299350739e-08 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected 6.33299350739e-08, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - -1.56462192535e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected -1.56462192535e-07, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - 234.375 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected 234.375, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - -74.90625 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected -74.90625, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - -3.93763184547e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected -3.93763184547e-06, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 6.9122761488e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 6.9122761488e-06, is " + << last_msg_.c_us; + EXPECT_LT((last_msg_.dn * 100 - 4.88841790794e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 4.88841790794e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.0111326099141 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.0111326099141, is " + << last_msg_.ecc; + EXPECT_EQ(last_msg_.healthy, 1) + << "incorrect value for last_msg_.healthy, expected 1, is " + << last_msg_.healthy; + EXPECT_LT((last_msg_.inc * 100 - 0.939552483058 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.939552483058, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - -3.29656588663e-10 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected -3.29656588663e-10, " + "is " + << last_msg_.inc_dot; + EXPECT_EQ(last_msg_.iode, 0) + << "incorrect value for last_msg_.iode, expected 0, is " + << last_msg_.iode; + EXPECT_LT((last_msg_.m0 * 100 - 2.46734839563 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected 2.46734839563, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - -0.946898543748 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected -0.946898543748, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -8.20105589261e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -8.20105589261e-09, " + "is " + << last_msg_.omegadot; + EXPECT_EQ(last_msg_.prn, 3) + << "incorrect value for last_msg_.prn, expected 3, is " << last_msg_.prn; + EXPECT_LT((last_msg_.sqrta * 100 - 5153.71430397 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5153.71430397, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.tgd * 100 - -6.51925802231e-09 * 100), 0.05) + << "incorrect value for last_msg_.tgd, expected -6.51925802231e-09, is " + << last_msg_.tgd; + EXPECT_LT((last_msg_.toc_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for last_msg_.toc_tow, expected 410400.0, is " + << last_msg_.toc_tow; + EXPECT_EQ(last_msg_.toc_wn, 1838) + << "incorrect value for last_msg_.toc_wn, expected 1838, is " + << last_msg_.toc_wn; + EXPECT_LT((last_msg_.toe_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for last_msg_.toe_tow, expected 410400.0, is " + << last_msg_.toe_tow; + EXPECT_EQ(last_msg_.toe_wn, 1838) + << "incorrect value for last_msg_.toe_wn, expected 1838, is " + << last_msg_.toe_wn; + EXPECT_EQ(last_msg_.valid, 1) + << "incorrect value for last_msg_.valid, expected 1, is " + << last_msg_.valid; + EXPECT_LT((last_msg_.w * 100 - 1.05250472004 * 100), 0.05) + << "incorrect value for last_msg_.w, expected 1.05250472004, is " + << last_msg_.w; } -class Test_auto_check_sbp_observation_msgEphemerisDepB1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_msgEphemerisDepB1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_msgEphemerisDepB1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_msgEphemerisDepB1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -206,134 +263,195 @@ class Test_auto_check_sbp_observation_msgEphemerisDepB1 : sbp_msg_ephemeris_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_msgEphemerisDepB1, Test) -{ - - uint8_t encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,68,190,0,0,0,0,0,72,66,64,0,0,0,0,128,188,115,64,0,0,0,0,0,80,193,62,0,0,0,0,0,164,204,62,0,0,0,0,0,0,130,62,0,0,0,0,0,0,128,62,72,181,127,6,208,225,52,62,158,174,129,91,27,105,249,191,0,0,0,96,204,57,128,63,0,0,160,35,146,33,180,64,247,169,1,36,133,206,243,63,79,11,109,92,156,208,65,190,103,78,3,253,223,147,255,191,164,214,90,250,218,240,238,63,94,239,187,37,36,10,242,61,0,0,0,0,176,91,19,63,0,0,0,0,0,0,137,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,13,0,180,21, }; - - sbp_msg_ephemeris_dep_b_t test_msg{}; - test_msg.af0 = 7.384549826383591e-05; - test_msg.af1 = -2.8421709430404007e-12; - test_msg.af2 = 0.0; - test_msg.c_ic = 1.341104507446289e-07; - test_msg.c_is = 1.1920928955078125e-07; - test_msg.c_rc = 315.78125; - test_msg.c_rs = 36.5625; - test_msg.c_uc = 2.0638108253479004e-06; - test_msg.c_us = 3.4142285585403442e-06; - test_msg.dn = 4.86198823561129e-09; - test_msg.ecc = 0.007922741584479809; - test_msg.healthy = 1; - test_msg.inc = 0.9669012918227122; - test_msg.inc_dot = 2.6251093463412166e-10; - test_msg.iode = 0; - test_msg.m0 = -1.588160855720083; - test_msg.omega0 = 1.237919941568746; - test_msg.omegadot = -8.295702692172441e-09; - test_msg.prn = 13; - test_msg.sqrta = 5153.57085609436; - test_msg.tgd = -9.313225746154785e-09; - test_msg.toc_tow = 410400.0; - test_msg.toc_wn = 1838; - test_msg.toe_tow = 410400.0; - test_msg.toe_wn = 1838; - test_msg.valid = 1; - test_msg.w = -1.9736022837941165; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - 7.38454982638e-05 * 100), 0.05) << "incorrect value for last_msg_.af0, expected 7.38454982638e-05, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - -2.84217094304e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected -2.84217094304e-12, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.af2, expected 0.0, is " << last_msg_.af2; - EXPECT_LT((last_msg_.c_ic * 100 - 1.34110450745e-07 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected 1.34110450745e-07, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - 1.19209289551e-07 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected 1.19209289551e-07, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - 315.78125 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected 315.78125, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - 36.5625 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected 36.5625, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - 2.06381082535e-06 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected 2.06381082535e-06, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 3.41422855854e-06 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 3.41422855854e-06, is " << last_msg_.c_us; - EXPECT_LT((last_msg_.dn * 100 - 4.86198823561e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 4.86198823561e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.00792274158448 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.00792274158448, is " << last_msg_.ecc; - EXPECT_EQ(last_msg_.healthy, 1) << "incorrect value for last_msg_.healthy, expected 1, is " << last_msg_.healthy; - EXPECT_LT((last_msg_.inc * 100 - 0.966901291823 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.966901291823, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - 2.62510934634e-10 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected 2.62510934634e-10, is " << last_msg_.inc_dot; - EXPECT_EQ(last_msg_.iode, 0) << "incorrect value for last_msg_.iode, expected 0, is " << last_msg_.iode; - EXPECT_LT((last_msg_.m0 * 100 - -1.58816085572 * 100), 0.05) << "incorrect value for last_msg_.m0, expected -1.58816085572, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - 1.23791994157 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected 1.23791994157, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -8.29570269217e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -8.29570269217e-09, is " << last_msg_.omegadot; - EXPECT_EQ(last_msg_.prn, 13) << "incorrect value for last_msg_.prn, expected 13, is " << last_msg_.prn; - EXPECT_LT((last_msg_.sqrta * 100 - 5153.57085609 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5153.57085609, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.tgd * 100 - -9.31322574615e-09 * 100), 0.05) << "incorrect value for last_msg_.tgd, expected -9.31322574615e-09, is " << last_msg_.tgd; - EXPECT_LT((last_msg_.toc_tow * 100 - 410400.0 * 100), 0.05) << "incorrect value for last_msg_.toc_tow, expected 410400.0, is " << last_msg_.toc_tow; - EXPECT_EQ(last_msg_.toc_wn, 1838) << "incorrect value for last_msg_.toc_wn, expected 1838, is " << last_msg_.toc_wn; - EXPECT_LT((last_msg_.toe_tow * 100 - 410400.0 * 100), 0.05) << "incorrect value for last_msg_.toe_tow, expected 410400.0, is " << last_msg_.toe_tow; - EXPECT_EQ(last_msg_.toe_wn, 1838) << "incorrect value for last_msg_.toe_wn, expected 1838, is " << last_msg_.toe_wn; - EXPECT_EQ(last_msg_.valid, 1) << "incorrect value for last_msg_.valid, expected 1, is " << last_msg_.valid; - EXPECT_LT((last_msg_.w * 100 - -1.97360228379 * 100), 0.05) << "incorrect value for last_msg_.w, expected -1.97360228379, is " << last_msg_.w; +}; + +TEST_F(Test_auto_check_sbp_observation_msgEphemerisDepB1, Test) { + uint8_t encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 68, 190, 0, + 0, 0, 0, 0, 72, 66, 64, 0, 0, 0, 0, 128, 188, 115, 64, + 0, 0, 0, 0, 0, 80, 193, 62, 0, 0, 0, 0, 0, 164, 204, + 62, 0, 0, 0, 0, 0, 0, 130, 62, 0, 0, 0, 0, 0, 0, + 128, 62, 72, 181, 127, 6, 208, 225, 52, 62, 158, 174, 129, 91, 27, + 105, 249, 191, 0, 0, 0, 96, 204, 57, 128, 63, 0, 0, 160, 35, + 146, 33, 180, 64, 247, 169, 1, 36, 133, 206, 243, 63, 79, 11, 109, + 92, 156, 208, 65, 190, 103, 78, 3, 253, 223, 147, 255, 191, 164, 214, + 90, 250, 218, 240, 238, 63, 94, 239, 187, 37, 36, 10, 242, 61, 0, + 0, 0, 0, 176, 91, 19, 63, 0, 0, 0, 0, 0, 0, 137, 189, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, + 65, 46, 7, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, + 13, 0, 180, 21, + }; + + sbp_msg_ephemeris_dep_b_t test_msg{}; + test_msg.af0 = 7.384549826383591e-05; + test_msg.af1 = -2.8421709430404007e-12; + test_msg.af2 = 0.0; + test_msg.c_ic = 1.341104507446289e-07; + test_msg.c_is = 1.1920928955078125e-07; + test_msg.c_rc = 315.78125; + test_msg.c_rs = 36.5625; + test_msg.c_uc = 2.0638108253479004e-06; + test_msg.c_us = 3.4142285585403442e-06; + test_msg.dn = 4.86198823561129e-09; + test_msg.ecc = 0.007922741584479809; + test_msg.healthy = 1; + test_msg.inc = 0.9669012918227122; + test_msg.inc_dot = 2.6251093463412166e-10; + test_msg.iode = 0; + test_msg.m0 = -1.588160855720083; + test_msg.omega0 = 1.237919941568746; + test_msg.omegadot = -8.295702692172441e-09; + test_msg.prn = 13; + test_msg.sqrta = 5153.57085609436; + test_msg.tgd = -9.313225746154785e-09; + test_msg.toc_tow = 410400.0; + test_msg.toc_wn = 1838; + test_msg.toe_tow = 410400.0; + test_msg.toe_wn = 1838; + test_msg.valid = 1; + test_msg.w = -1.9736022837941165; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - 7.38454982638e-05 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected 7.38454982638e-05, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - -2.84217094304e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected -2.84217094304e-12, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected 0.0, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.c_ic * 100 - 1.34110450745e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected 1.34110450745e-07, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - 1.19209289551e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected 1.19209289551e-07, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - 315.78125 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected 315.78125, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - 36.5625 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected 36.5625, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - 2.06381082535e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected 2.06381082535e-06, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 3.41422855854e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 3.41422855854e-06, is " + << last_msg_.c_us; + EXPECT_LT((last_msg_.dn * 100 - 4.86198823561e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 4.86198823561e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.00792274158448 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.00792274158448, is " + << last_msg_.ecc; + EXPECT_EQ(last_msg_.healthy, 1) + << "incorrect value for last_msg_.healthy, expected 1, is " + << last_msg_.healthy; + EXPECT_LT((last_msg_.inc * 100 - 0.966901291823 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.966901291823, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - 2.62510934634e-10 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected 2.62510934634e-10, " + "is " + << last_msg_.inc_dot; + EXPECT_EQ(last_msg_.iode, 0) + << "incorrect value for last_msg_.iode, expected 0, is " + << last_msg_.iode; + EXPECT_LT((last_msg_.m0 * 100 - -1.58816085572 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected -1.58816085572, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - 1.23791994157 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected 1.23791994157, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -8.29570269217e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -8.29570269217e-09, " + "is " + << last_msg_.omegadot; + EXPECT_EQ(last_msg_.prn, 13) + << "incorrect value for last_msg_.prn, expected 13, is " << last_msg_.prn; + EXPECT_LT((last_msg_.sqrta * 100 - 5153.57085609 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5153.57085609, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.tgd * 100 - -9.31322574615e-09 * 100), 0.05) + << "incorrect value for last_msg_.tgd, expected -9.31322574615e-09, is " + << last_msg_.tgd; + EXPECT_LT((last_msg_.toc_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for last_msg_.toc_tow, expected 410400.0, is " + << last_msg_.toc_tow; + EXPECT_EQ(last_msg_.toc_wn, 1838) + << "incorrect value for last_msg_.toc_wn, expected 1838, is " + << last_msg_.toc_wn; + EXPECT_LT((last_msg_.toe_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for last_msg_.toe_tow, expected 410400.0, is " + << last_msg_.toe_tow; + EXPECT_EQ(last_msg_.toe_wn, 1838) + << "incorrect value for last_msg_.toe_wn, expected 1838, is " + << last_msg_.toe_wn; + EXPECT_EQ(last_msg_.valid, 1) + << "incorrect value for last_msg_.valid, expected 1, is " + << last_msg_.valid; + EXPECT_LT((last_msg_.w * 100 - -1.97360228379 * 100), 0.05) + << "incorrect value for last_msg_.w, expected -1.97360228379, is " + << last_msg_.w; } -class Test_auto_check_sbp_observation_msgEphemerisDepB2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_msgEphemerisDepB2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_msgEphemerisDepB2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_msgEphemerisDepB2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -341,134 +459,195 @@ class Test_auto_check_sbp_observation_msgEphemerisDepB2 : sbp_msg_ephemeris_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_msgEphemerisDepB2, Test) -{ - - uint8_t encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,56,62,0,0,0,0,0,40,81,192,0,0,0,0,0,129,109,64,0,0,0,0,0,28,205,190,0,0,0,0,0,76,223,62,0,0,0,0,0,0,105,190,0,0,0,0,0,0,92,190,134,161,223,255,243,43,51,62,146,176,113,142,234,164,5,64,0,0,0,56,175,140,112,63,0,0,192,90,171,33,180,64,36,38,237,255,200,160,237,191,204,92,63,154,49,91,65,190,125,94,251,132,52,61,216,63,2,139,28,27,231,199,238,63,124,183,4,180,194,30,247,189,0,0,0,0,0,104,222,190,0,0,0,0,0,0,96,61,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,0,0,222,152, }; - - sbp_msg_ephemeris_dep_b_t test_msg{}; - test_msg.af0 = -7.249414920806885e-06; - test_msg.af1 = 4.547473508864641e-13; - test_msg.af2 = 0.0; - test_msg.c_ic = -4.6566128730773926e-08; - test_msg.c_is = -2.60770320892334e-08; - test_msg.c_rc = 236.03125; - test_msg.c_rs = -68.625; - test_msg.c_uc = -3.470107913017273e-06; - test_msg.c_us = 7.461756467819214e-06; - test_msg.dn = 4.4637573619826565e-09; - test_msg.ecc = 0.004040417145006359; - test_msg.healthy = 1; - test_msg.inc = 0.9619021920701416; - test_msg.inc_dot = -3.3644258561271105e-10; - test_msg.iode = 0; - test_msg.m0 = 2.7055255058713295; - test_msg.omega0 = -0.9258770941316397; - test_msg.omegadot = -8.082122367123182e-09; - test_msg.prn = 0; - test_msg.sqrta = 5153.669353485107; - test_msg.tgd = 5.587935447692871e-09; - test_msg.toc_tow = 410400.0; - test_msg.toc_wn = 1838; - test_msg.toe_tow = 410400.0; - test_msg.toe_wn = 1838; - test_msg.valid = 1; - test_msg.w = 0.37873566614641857; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - -7.24941492081e-06 * 100), 0.05) << "incorrect value for last_msg_.af0, expected -7.24941492081e-06, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - 4.54747350886e-13 * 100), 0.05) << "incorrect value for last_msg_.af1, expected 4.54747350886e-13, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.af2, expected 0.0, is " << last_msg_.af2; - EXPECT_LT((last_msg_.c_ic * 100 - -4.65661287308e-08 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected -4.65661287308e-08, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - -2.60770320892e-08 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected -2.60770320892e-08, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - 236.03125 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected 236.03125, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - -68.625 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected -68.625, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - -3.47010791302e-06 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected -3.47010791302e-06, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 7.46175646782e-06 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 7.46175646782e-06, is " << last_msg_.c_us; - EXPECT_LT((last_msg_.dn * 100 - 4.46375736198e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 4.46375736198e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.00404041714501 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.00404041714501, is " << last_msg_.ecc; - EXPECT_EQ(last_msg_.healthy, 1) << "incorrect value for last_msg_.healthy, expected 1, is " << last_msg_.healthy; - EXPECT_LT((last_msg_.inc * 100 - 0.96190219207 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.96190219207, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - -3.36442585613e-10 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected -3.36442585613e-10, is " << last_msg_.inc_dot; - EXPECT_EQ(last_msg_.iode, 0) << "incorrect value for last_msg_.iode, expected 0, is " << last_msg_.iode; - EXPECT_LT((last_msg_.m0 * 100 - 2.70552550587 * 100), 0.05) << "incorrect value for last_msg_.m0, expected 2.70552550587, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - -0.925877094132 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected -0.925877094132, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -8.08212236712e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -8.08212236712e-09, is " << last_msg_.omegadot; - EXPECT_EQ(last_msg_.prn, 0) << "incorrect value for last_msg_.prn, expected 0, is " << last_msg_.prn; - EXPECT_LT((last_msg_.sqrta * 100 - 5153.66935349 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5153.66935349, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.tgd * 100 - 5.58793544769e-09 * 100), 0.05) << "incorrect value for last_msg_.tgd, expected 5.58793544769e-09, is " << last_msg_.tgd; - EXPECT_LT((last_msg_.toc_tow * 100 - 410400.0 * 100), 0.05) << "incorrect value for last_msg_.toc_tow, expected 410400.0, is " << last_msg_.toc_tow; - EXPECT_EQ(last_msg_.toc_wn, 1838) << "incorrect value for last_msg_.toc_wn, expected 1838, is " << last_msg_.toc_wn; - EXPECT_LT((last_msg_.toe_tow * 100 - 410400.0 * 100), 0.05) << "incorrect value for last_msg_.toe_tow, expected 410400.0, is " << last_msg_.toe_tow; - EXPECT_EQ(last_msg_.toe_wn, 1838) << "incorrect value for last_msg_.toe_wn, expected 1838, is " << last_msg_.toe_wn; - EXPECT_EQ(last_msg_.valid, 1) << "incorrect value for last_msg_.valid, expected 1, is " << last_msg_.valid; - EXPECT_LT((last_msg_.w * 100 - 0.378735666146 * 100), 0.05) << "incorrect value for last_msg_.w, expected 0.378735666146, is " << last_msg_.w; +}; + +TEST_F(Test_auto_check_sbp_observation_msgEphemerisDepB2, Test) { + uint8_t encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 56, 62, 0, + 0, 0, 0, 0, 40, 81, 192, 0, 0, 0, 0, 0, 129, 109, 64, + 0, 0, 0, 0, 0, 28, 205, 190, 0, 0, 0, 0, 0, 76, 223, + 62, 0, 0, 0, 0, 0, 0, 105, 190, 0, 0, 0, 0, 0, 0, + 92, 190, 134, 161, 223, 255, 243, 43, 51, 62, 146, 176, 113, 142, 234, + 164, 5, 64, 0, 0, 0, 56, 175, 140, 112, 63, 0, 0, 192, 90, + 171, 33, 180, 64, 36, 38, 237, 255, 200, 160, 237, 191, 204, 92, 63, + 154, 49, 91, 65, 190, 125, 94, 251, 132, 52, 61, 216, 63, 2, 139, + 28, 27, 231, 199, 238, 63, 124, 183, 4, 180, 194, 30, 247, 189, 0, + 0, 0, 0, 0, 104, 222, 190, 0, 0, 0, 0, 0, 0, 96, 61, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, + 65, 46, 7, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, + 0, 0, 222, 152, + }; + + sbp_msg_ephemeris_dep_b_t test_msg{}; + test_msg.af0 = -7.249414920806885e-06; + test_msg.af1 = 4.547473508864641e-13; + test_msg.af2 = 0.0; + test_msg.c_ic = -4.6566128730773926e-08; + test_msg.c_is = -2.60770320892334e-08; + test_msg.c_rc = 236.03125; + test_msg.c_rs = -68.625; + test_msg.c_uc = -3.470107913017273e-06; + test_msg.c_us = 7.461756467819214e-06; + test_msg.dn = 4.4637573619826565e-09; + test_msg.ecc = 0.004040417145006359; + test_msg.healthy = 1; + test_msg.inc = 0.9619021920701416; + test_msg.inc_dot = -3.3644258561271105e-10; + test_msg.iode = 0; + test_msg.m0 = 2.7055255058713295; + test_msg.omega0 = -0.9258770941316397; + test_msg.omegadot = -8.082122367123182e-09; + test_msg.prn = 0; + test_msg.sqrta = 5153.669353485107; + test_msg.tgd = 5.587935447692871e-09; + test_msg.toc_tow = 410400.0; + test_msg.toc_wn = 1838; + test_msg.toe_tow = 410400.0; + test_msg.toe_wn = 1838; + test_msg.valid = 1; + test_msg.w = 0.37873566614641857; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - -7.24941492081e-06 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected -7.24941492081e-06, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - 4.54747350886e-13 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected 4.54747350886e-13, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected 0.0, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.c_ic * 100 - -4.65661287308e-08 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected -4.65661287308e-08, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - -2.60770320892e-08 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected -2.60770320892e-08, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - 236.03125 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected 236.03125, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - -68.625 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected -68.625, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - -3.47010791302e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected -3.47010791302e-06, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 7.46175646782e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 7.46175646782e-06, is " + << last_msg_.c_us; + EXPECT_LT((last_msg_.dn * 100 - 4.46375736198e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 4.46375736198e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.00404041714501 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.00404041714501, is " + << last_msg_.ecc; + EXPECT_EQ(last_msg_.healthy, 1) + << "incorrect value for last_msg_.healthy, expected 1, is " + << last_msg_.healthy; + EXPECT_LT((last_msg_.inc * 100 - 0.96190219207 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.96190219207, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - -3.36442585613e-10 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected -3.36442585613e-10, " + "is " + << last_msg_.inc_dot; + EXPECT_EQ(last_msg_.iode, 0) + << "incorrect value for last_msg_.iode, expected 0, is " + << last_msg_.iode; + EXPECT_LT((last_msg_.m0 * 100 - 2.70552550587 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected 2.70552550587, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - -0.925877094132 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected -0.925877094132, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -8.08212236712e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -8.08212236712e-09, " + "is " + << last_msg_.omegadot; + EXPECT_EQ(last_msg_.prn, 0) + << "incorrect value for last_msg_.prn, expected 0, is " << last_msg_.prn; + EXPECT_LT((last_msg_.sqrta * 100 - 5153.66935349 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5153.66935349, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.tgd * 100 - 5.58793544769e-09 * 100), 0.05) + << "incorrect value for last_msg_.tgd, expected 5.58793544769e-09, is " + << last_msg_.tgd; + EXPECT_LT((last_msg_.toc_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for last_msg_.toc_tow, expected 410400.0, is " + << last_msg_.toc_tow; + EXPECT_EQ(last_msg_.toc_wn, 1838) + << "incorrect value for last_msg_.toc_wn, expected 1838, is " + << last_msg_.toc_wn; + EXPECT_LT((last_msg_.toe_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for last_msg_.toe_tow, expected 410400.0, is " + << last_msg_.toe_tow; + EXPECT_EQ(last_msg_.toe_wn, 1838) + << "incorrect value for last_msg_.toe_wn, expected 1838, is " + << last_msg_.toe_wn; + EXPECT_EQ(last_msg_.valid, 1) + << "incorrect value for last_msg_.valid, expected 1, is " + << last_msg_.valid; + EXPECT_LT((last_msg_.w * 100 - 0.378735666146 * 100), 0.05) + << "incorrect value for last_msg_.w, expected 0.378735666146, is " + << last_msg_.w; } -class Test_auto_check_sbp_observation_msgEphemerisDepB3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_msgEphemerisDepB3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_msgEphemerisDepB3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_msgEphemerisDepB3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -476,134 +655,195 @@ class Test_auto_check_sbp_observation_msgEphemerisDepB3 : sbp_msg_ephemeris_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_msgEphemerisDepB3, Test) -{ - - uint8_t encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,68,190,0,0,0,0,0,72,66,64,0,0,0,0,128,188,115,64,0,0,0,0,0,80,193,62,0,0,0,0,0,164,204,62,0,0,0,0,0,0,130,62,0,0,0,0,0,0,128,62,72,181,127,6,208,225,52,62,158,174,129,91,27,105,249,191,0,0,0,96,204,57,128,63,0,0,160,35,146,33,180,64,247,169,1,36,133,206,243,63,79,11,109,92,156,208,65,190,103,78,3,253,223,147,255,191,164,214,90,250,218,240,238,63,94,239,187,37,36,10,242,61,0,0,0,0,176,91,19,63,0,0,0,0,0,0,137,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,13,0,180,21, }; - - sbp_msg_ephemeris_dep_b_t test_msg{}; - test_msg.af0 = 7.384549826383591e-05; - test_msg.af1 = -2.8421709430404007e-12; - test_msg.af2 = 0.0; - test_msg.c_ic = 1.341104507446289e-07; - test_msg.c_is = 1.1920928955078125e-07; - test_msg.c_rc = 315.78125; - test_msg.c_rs = 36.5625; - test_msg.c_uc = 2.0638108253479004e-06; - test_msg.c_us = 3.4142285585403442e-06; - test_msg.dn = 4.86198823561129e-09; - test_msg.ecc = 0.007922741584479809; - test_msg.healthy = 1; - test_msg.inc = 0.9669012918227122; - test_msg.inc_dot = 2.6251093463412166e-10; - test_msg.iode = 0; - test_msg.m0 = -1.588160855720083; - test_msg.omega0 = 1.237919941568746; - test_msg.omegadot = -8.295702692172441e-09; - test_msg.prn = 13; - test_msg.sqrta = 5153.57085609436; - test_msg.tgd = -9.313225746154785e-09; - test_msg.toc_tow = 410400.0; - test_msg.toc_wn = 1838; - test_msg.toe_tow = 410400.0; - test_msg.toe_wn = 1838; - test_msg.valid = 1; - test_msg.w = -1.9736022837941165; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - 7.38454982638e-05 * 100), 0.05) << "incorrect value for last_msg_.af0, expected 7.38454982638e-05, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - -2.84217094304e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected -2.84217094304e-12, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.af2, expected 0.0, is " << last_msg_.af2; - EXPECT_LT((last_msg_.c_ic * 100 - 1.34110450745e-07 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected 1.34110450745e-07, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - 1.19209289551e-07 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected 1.19209289551e-07, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - 315.78125 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected 315.78125, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - 36.5625 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected 36.5625, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - 2.06381082535e-06 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected 2.06381082535e-06, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 3.41422855854e-06 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 3.41422855854e-06, is " << last_msg_.c_us; - EXPECT_LT((last_msg_.dn * 100 - 4.86198823561e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 4.86198823561e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.00792274158448 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.00792274158448, is " << last_msg_.ecc; - EXPECT_EQ(last_msg_.healthy, 1) << "incorrect value for last_msg_.healthy, expected 1, is " << last_msg_.healthy; - EXPECT_LT((last_msg_.inc * 100 - 0.966901291823 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.966901291823, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - 2.62510934634e-10 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected 2.62510934634e-10, is " << last_msg_.inc_dot; - EXPECT_EQ(last_msg_.iode, 0) << "incorrect value for last_msg_.iode, expected 0, is " << last_msg_.iode; - EXPECT_LT((last_msg_.m0 * 100 - -1.58816085572 * 100), 0.05) << "incorrect value for last_msg_.m0, expected -1.58816085572, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - 1.23791994157 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected 1.23791994157, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -8.29570269217e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -8.29570269217e-09, is " << last_msg_.omegadot; - EXPECT_EQ(last_msg_.prn, 13) << "incorrect value for last_msg_.prn, expected 13, is " << last_msg_.prn; - EXPECT_LT((last_msg_.sqrta * 100 - 5153.57085609 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5153.57085609, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.tgd * 100 - -9.31322574615e-09 * 100), 0.05) << "incorrect value for last_msg_.tgd, expected -9.31322574615e-09, is " << last_msg_.tgd; - EXPECT_LT((last_msg_.toc_tow * 100 - 410400.0 * 100), 0.05) << "incorrect value for last_msg_.toc_tow, expected 410400.0, is " << last_msg_.toc_tow; - EXPECT_EQ(last_msg_.toc_wn, 1838) << "incorrect value for last_msg_.toc_wn, expected 1838, is " << last_msg_.toc_wn; - EXPECT_LT((last_msg_.toe_tow * 100 - 410400.0 * 100), 0.05) << "incorrect value for last_msg_.toe_tow, expected 410400.0, is " << last_msg_.toe_tow; - EXPECT_EQ(last_msg_.toe_wn, 1838) << "incorrect value for last_msg_.toe_wn, expected 1838, is " << last_msg_.toe_wn; - EXPECT_EQ(last_msg_.valid, 1) << "incorrect value for last_msg_.valid, expected 1, is " << last_msg_.valid; - EXPECT_LT((last_msg_.w * 100 - -1.97360228379 * 100), 0.05) << "incorrect value for last_msg_.w, expected -1.97360228379, is " << last_msg_.w; +}; + +TEST_F(Test_auto_check_sbp_observation_msgEphemerisDepB3, Test) { + uint8_t encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 68, 190, 0, + 0, 0, 0, 0, 72, 66, 64, 0, 0, 0, 0, 128, 188, 115, 64, + 0, 0, 0, 0, 0, 80, 193, 62, 0, 0, 0, 0, 0, 164, 204, + 62, 0, 0, 0, 0, 0, 0, 130, 62, 0, 0, 0, 0, 0, 0, + 128, 62, 72, 181, 127, 6, 208, 225, 52, 62, 158, 174, 129, 91, 27, + 105, 249, 191, 0, 0, 0, 96, 204, 57, 128, 63, 0, 0, 160, 35, + 146, 33, 180, 64, 247, 169, 1, 36, 133, 206, 243, 63, 79, 11, 109, + 92, 156, 208, 65, 190, 103, 78, 3, 253, 223, 147, 255, 191, 164, 214, + 90, 250, 218, 240, 238, 63, 94, 239, 187, 37, 36, 10, 242, 61, 0, + 0, 0, 0, 176, 91, 19, 63, 0, 0, 0, 0, 0, 0, 137, 189, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, + 65, 46, 7, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, + 13, 0, 180, 21, + }; + + sbp_msg_ephemeris_dep_b_t test_msg{}; + test_msg.af0 = 7.384549826383591e-05; + test_msg.af1 = -2.8421709430404007e-12; + test_msg.af2 = 0.0; + test_msg.c_ic = 1.341104507446289e-07; + test_msg.c_is = 1.1920928955078125e-07; + test_msg.c_rc = 315.78125; + test_msg.c_rs = 36.5625; + test_msg.c_uc = 2.0638108253479004e-06; + test_msg.c_us = 3.4142285585403442e-06; + test_msg.dn = 4.86198823561129e-09; + test_msg.ecc = 0.007922741584479809; + test_msg.healthy = 1; + test_msg.inc = 0.9669012918227122; + test_msg.inc_dot = 2.6251093463412166e-10; + test_msg.iode = 0; + test_msg.m0 = -1.588160855720083; + test_msg.omega0 = 1.237919941568746; + test_msg.omegadot = -8.295702692172441e-09; + test_msg.prn = 13; + test_msg.sqrta = 5153.57085609436; + test_msg.tgd = -9.313225746154785e-09; + test_msg.toc_tow = 410400.0; + test_msg.toc_wn = 1838; + test_msg.toe_tow = 410400.0; + test_msg.toe_wn = 1838; + test_msg.valid = 1; + test_msg.w = -1.9736022837941165; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - 7.38454982638e-05 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected 7.38454982638e-05, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - -2.84217094304e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected -2.84217094304e-12, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected 0.0, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.c_ic * 100 - 1.34110450745e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected 1.34110450745e-07, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - 1.19209289551e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected 1.19209289551e-07, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - 315.78125 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected 315.78125, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - 36.5625 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected 36.5625, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - 2.06381082535e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected 2.06381082535e-06, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 3.41422855854e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 3.41422855854e-06, is " + << last_msg_.c_us; + EXPECT_LT((last_msg_.dn * 100 - 4.86198823561e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 4.86198823561e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.00792274158448 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.00792274158448, is " + << last_msg_.ecc; + EXPECT_EQ(last_msg_.healthy, 1) + << "incorrect value for last_msg_.healthy, expected 1, is " + << last_msg_.healthy; + EXPECT_LT((last_msg_.inc * 100 - 0.966901291823 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.966901291823, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - 2.62510934634e-10 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected 2.62510934634e-10, " + "is " + << last_msg_.inc_dot; + EXPECT_EQ(last_msg_.iode, 0) + << "incorrect value for last_msg_.iode, expected 0, is " + << last_msg_.iode; + EXPECT_LT((last_msg_.m0 * 100 - -1.58816085572 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected -1.58816085572, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - 1.23791994157 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected 1.23791994157, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -8.29570269217e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -8.29570269217e-09, " + "is " + << last_msg_.omegadot; + EXPECT_EQ(last_msg_.prn, 13) + << "incorrect value for last_msg_.prn, expected 13, is " << last_msg_.prn; + EXPECT_LT((last_msg_.sqrta * 100 - 5153.57085609 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5153.57085609, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.tgd * 100 - -9.31322574615e-09 * 100), 0.05) + << "incorrect value for last_msg_.tgd, expected -9.31322574615e-09, is " + << last_msg_.tgd; + EXPECT_LT((last_msg_.toc_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for last_msg_.toc_tow, expected 410400.0, is " + << last_msg_.toc_tow; + EXPECT_EQ(last_msg_.toc_wn, 1838) + << "incorrect value for last_msg_.toc_wn, expected 1838, is " + << last_msg_.toc_wn; + EXPECT_LT((last_msg_.toe_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for last_msg_.toe_tow, expected 410400.0, is " + << last_msg_.toe_tow; + EXPECT_EQ(last_msg_.toe_wn, 1838) + << "incorrect value for last_msg_.toe_wn, expected 1838, is " + << last_msg_.toe_wn; + EXPECT_EQ(last_msg_.valid, 1) + << "incorrect value for last_msg_.valid, expected 1, is " + << last_msg_.valid; + EXPECT_LT((last_msg_.w * 100 - -1.97360228379 * 100), 0.05) + << "incorrect value for last_msg_.w, expected -1.97360228379, is " + << last_msg_.w; } -class Test_auto_check_sbp_observation_msgEphemerisDepB4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_msgEphemerisDepB4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_msgEphemerisDepB4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_msgEphemerisDepB4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -611,134 +851,195 @@ class Test_auto_check_sbp_observation_msgEphemerisDepB4 : sbp_msg_ephemeris_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_msgEphemerisDepB4, Test) -{ - - uint8_t encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,128,85,190,0,0,0,0,0,156,69,64,0,0,0,0,128,19,115,64,0,0,0,0,0,160,193,62,0,0,0,0,0,152,207,62,0,0,0,0,0,0,97,190,0,0,0,0,0,192,139,190,26,26,13,149,16,152,54,62,104,7,46,214,75,84,5,192,0,0,0,128,230,82,132,63,0,0,160,252,162,33,180,64,73,6,130,54,217,171,242,63,81,224,163,123,238,42,66,190,206,43,141,67,243,157,5,192,113,179,153,187,43,92,238,63,254,236,31,43,224,157,244,61,0,0,0,0,232,4,26,191,0,0,0,0,0,0,134,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,22,0,99,61, }; - - sbp_msg_ephemeris_dep_b_t test_msg{}; - test_msg.af0 = -9.925523772835732e-05; - test_msg.af1 = -2.5011104298755527e-12; - test_msg.af2 = 0.0; - test_msg.c_ic = -3.166496753692627e-08; - test_msg.c_is = -2.0675361156463623e-07; - test_msg.c_rc = 305.21875; - test_msg.c_rs = 43.21875; - test_msg.c_uc = 2.1010637283325195e-06; - test_msg.c_us = 3.766268491744995e-06; - test_msg.dn = 5.26057626697412e-09; - test_msg.ecc = 0.009923744946718216; - test_msg.healthy = 1; - test_msg.inc = 0.9487513221807672; - test_msg.inc_dot = 3.000124967247105e-10; - test_msg.iode = 0; - test_msg.m0 = -2.666160271911327; - test_msg.omega0 = 1.1669551972594425; - test_msg.omegadot = -8.45999524990264e-09; - test_msg.prn = 22; - test_msg.sqrta = 5153.636667251587; - test_msg.tgd = -2.0023435354232788e-08; - test_msg.toc_tow = 410400.0; - test_msg.toc_wn = 1838; - test_msg.toe_tow = 410400.0; - test_msg.toe_wn = 1838; - test_msg.valid = 1; - test_msg.w = -2.7021241452652935; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - -9.92552377284e-05 * 100), 0.05) << "incorrect value for last_msg_.af0, expected -9.92552377284e-05, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - -2.50111042988e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected -2.50111042988e-12, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.af2, expected 0.0, is " << last_msg_.af2; - EXPECT_LT((last_msg_.c_ic * 100 - -3.16649675369e-08 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected -3.16649675369e-08, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - -2.06753611565e-07 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected -2.06753611565e-07, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - 305.21875 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected 305.21875, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - 43.21875 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected 43.21875, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - 2.10106372833e-06 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected 2.10106372833e-06, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 3.76626849174e-06 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 3.76626849174e-06, is " << last_msg_.c_us; - EXPECT_LT((last_msg_.dn * 100 - 5.26057626697e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 5.26057626697e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.00992374494672 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.00992374494672, is " << last_msg_.ecc; - EXPECT_EQ(last_msg_.healthy, 1) << "incorrect value for last_msg_.healthy, expected 1, is " << last_msg_.healthy; - EXPECT_LT((last_msg_.inc * 100 - 0.948751322181 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.948751322181, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - 3.00012496725e-10 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected 3.00012496725e-10, is " << last_msg_.inc_dot; - EXPECT_EQ(last_msg_.iode, 0) << "incorrect value for last_msg_.iode, expected 0, is " << last_msg_.iode; - EXPECT_LT((last_msg_.m0 * 100 - -2.66616027191 * 100), 0.05) << "incorrect value for last_msg_.m0, expected -2.66616027191, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - 1.16695519726 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected 1.16695519726, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -8.4599952499e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -8.4599952499e-09, is " << last_msg_.omegadot; - EXPECT_EQ(last_msg_.prn, 22) << "incorrect value for last_msg_.prn, expected 22, is " << last_msg_.prn; - EXPECT_LT((last_msg_.sqrta * 100 - 5153.63666725 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5153.63666725, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.tgd * 100 - -2.00234353542e-08 * 100), 0.05) << "incorrect value for last_msg_.tgd, expected -2.00234353542e-08, is " << last_msg_.tgd; - EXPECT_LT((last_msg_.toc_tow * 100 - 410400.0 * 100), 0.05) << "incorrect value for last_msg_.toc_tow, expected 410400.0, is " << last_msg_.toc_tow; - EXPECT_EQ(last_msg_.toc_wn, 1838) << "incorrect value for last_msg_.toc_wn, expected 1838, is " << last_msg_.toc_wn; - EXPECT_LT((last_msg_.toe_tow * 100 - 410400.0 * 100), 0.05) << "incorrect value for last_msg_.toe_tow, expected 410400.0, is " << last_msg_.toe_tow; - EXPECT_EQ(last_msg_.toe_wn, 1838) << "incorrect value for last_msg_.toe_wn, expected 1838, is " << last_msg_.toe_wn; - EXPECT_EQ(last_msg_.valid, 1) << "incorrect value for last_msg_.valid, expected 1, is " << last_msg_.valid; - EXPECT_LT((last_msg_.w * 100 - -2.70212414527 * 100), 0.05) << "incorrect value for last_msg_.w, expected -2.70212414527, is " << last_msg_.w; +}; + +TEST_F(Test_auto_check_sbp_observation_msgEphemerisDepB4, Test) { + uint8_t encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 128, 85, 190, 0, + 0, 0, 0, 0, 156, 69, 64, 0, 0, 0, 0, 128, 19, 115, 64, + 0, 0, 0, 0, 0, 160, 193, 62, 0, 0, 0, 0, 0, 152, 207, + 62, 0, 0, 0, 0, 0, 0, 97, 190, 0, 0, 0, 0, 0, 192, + 139, 190, 26, 26, 13, 149, 16, 152, 54, 62, 104, 7, 46, 214, 75, + 84, 5, 192, 0, 0, 0, 128, 230, 82, 132, 63, 0, 0, 160, 252, + 162, 33, 180, 64, 73, 6, 130, 54, 217, 171, 242, 63, 81, 224, 163, + 123, 238, 42, 66, 190, 206, 43, 141, 67, 243, 157, 5, 192, 113, 179, + 153, 187, 43, 92, 238, 63, 254, 236, 31, 43, 224, 157, 244, 61, 0, + 0, 0, 0, 232, 4, 26, 191, 0, 0, 0, 0, 0, 0, 134, 189, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, + 65, 46, 7, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, + 22, 0, 99, 61, + }; + + sbp_msg_ephemeris_dep_b_t test_msg{}; + test_msg.af0 = -9.925523772835732e-05; + test_msg.af1 = -2.5011104298755527e-12; + test_msg.af2 = 0.0; + test_msg.c_ic = -3.166496753692627e-08; + test_msg.c_is = -2.0675361156463623e-07; + test_msg.c_rc = 305.21875; + test_msg.c_rs = 43.21875; + test_msg.c_uc = 2.1010637283325195e-06; + test_msg.c_us = 3.766268491744995e-06; + test_msg.dn = 5.26057626697412e-09; + test_msg.ecc = 0.009923744946718216; + test_msg.healthy = 1; + test_msg.inc = 0.9487513221807672; + test_msg.inc_dot = 3.000124967247105e-10; + test_msg.iode = 0; + test_msg.m0 = -2.666160271911327; + test_msg.omega0 = 1.1669551972594425; + test_msg.omegadot = -8.45999524990264e-09; + test_msg.prn = 22; + test_msg.sqrta = 5153.636667251587; + test_msg.tgd = -2.0023435354232788e-08; + test_msg.toc_tow = 410400.0; + test_msg.toc_wn = 1838; + test_msg.toe_tow = 410400.0; + test_msg.toe_wn = 1838; + test_msg.valid = 1; + test_msg.w = -2.7021241452652935; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - -9.92552377284e-05 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected -9.92552377284e-05, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - -2.50111042988e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected -2.50111042988e-12, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected 0.0, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.c_ic * 100 - -3.16649675369e-08 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected -3.16649675369e-08, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - -2.06753611565e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected -2.06753611565e-07, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - 305.21875 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected 305.21875, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - 43.21875 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected 43.21875, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - 2.10106372833e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected 2.10106372833e-06, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 3.76626849174e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 3.76626849174e-06, is " + << last_msg_.c_us; + EXPECT_LT((last_msg_.dn * 100 - 5.26057626697e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 5.26057626697e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.00992374494672 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.00992374494672, is " + << last_msg_.ecc; + EXPECT_EQ(last_msg_.healthy, 1) + << "incorrect value for last_msg_.healthy, expected 1, is " + << last_msg_.healthy; + EXPECT_LT((last_msg_.inc * 100 - 0.948751322181 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.948751322181, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - 3.00012496725e-10 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected 3.00012496725e-10, " + "is " + << last_msg_.inc_dot; + EXPECT_EQ(last_msg_.iode, 0) + << "incorrect value for last_msg_.iode, expected 0, is " + << last_msg_.iode; + EXPECT_LT((last_msg_.m0 * 100 - -2.66616027191 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected -2.66616027191, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - 1.16695519726 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected 1.16695519726, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -8.4599952499e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -8.4599952499e-09, " + "is " + << last_msg_.omegadot; + EXPECT_EQ(last_msg_.prn, 22) + << "incorrect value for last_msg_.prn, expected 22, is " << last_msg_.prn; + EXPECT_LT((last_msg_.sqrta * 100 - 5153.63666725 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5153.63666725, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.tgd * 100 - -2.00234353542e-08 * 100), 0.05) + << "incorrect value for last_msg_.tgd, expected -2.00234353542e-08, is " + << last_msg_.tgd; + EXPECT_LT((last_msg_.toc_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for last_msg_.toc_tow, expected 410400.0, is " + << last_msg_.toc_tow; + EXPECT_EQ(last_msg_.toc_wn, 1838) + << "incorrect value for last_msg_.toc_wn, expected 1838, is " + << last_msg_.toc_wn; + EXPECT_LT((last_msg_.toe_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for last_msg_.toe_tow, expected 410400.0, is " + << last_msg_.toe_tow; + EXPECT_EQ(last_msg_.toe_wn, 1838) + << "incorrect value for last_msg_.toe_wn, expected 1838, is " + << last_msg_.toe_wn; + EXPECT_EQ(last_msg_.valid, 1) + << "incorrect value for last_msg_.valid, expected 1, is " + << last_msg_.valid; + EXPECT_LT((last_msg_.w * 100 - -2.70212414527 * 100), 0.05) + << "incorrect value for last_msg_.w, expected -2.70212414527, is " + << last_msg_.w; } -class Test_auto_check_sbp_observation_msgEphemerisDepB5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_msgEphemerisDepB5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_msgEphemerisDepB5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_msgEphemerisDepB5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -746,84 +1047,151 @@ class Test_auto_check_sbp_observation_msgEphemerisDepB5 : sbp_msg_ephemeris_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_msgEphemerisDepB5, Test) -{ - - uint8_t encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,77,190,0,0,0,0,0,122,83,192,0,0,0,0,0,233,110,64,0,0,0,0,0,60,207,190,0,0,0,0,0,28,222,62,0,0,0,0,0,128,120,62,0,0,0,0,0,0,108,62,10,230,183,140,214,230,50,62,54,86,196,164,252,10,255,63,0,0,0,36,247,191,128,63,0,0,160,5,193,33,180,64,186,138,81,129,88,239,1,64,94,210,120,170,106,25,65,190,103,213,32,155,227,194,224,191,156,47,104,93,101,55,239,63,196,83,100,254,51,54,4,190,0,0,0,0,50,242,52,63,0,0,0,0,0,0,114,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,30,0,170,33, }; - - sbp_msg_ephemeris_dep_b_t test_msg{}; - test_msg.af0 = 0.0003196117468178272; - test_msg.af1 = -1.0231815394945443e-12; - test_msg.af2 = 0.0; - test_msg.c_ic = 9.12696123123169e-08; - test_msg.c_is = 5.21540641784668e-08; - test_msg.c_rc = 247.28125; - test_msg.c_rs = -77.90625; - test_msg.c_uc = -3.723427653312683e-06; - test_msg.c_us = 7.178634405136108e-06; - test_msg.dn = 4.400897600764146e-09; - test_msg.ecc = 0.008178644930012524; - test_msg.healthy = 1; - test_msg.inc = 0.9755122017245301; - test_msg.inc_dot = -5.882387882209502e-10; - test_msg.iode = 0; - test_msg.m0 = 1.9401823459824192; - test_msg.omega0 = 2.241868028927766; - test_msg.omegadot = -7.962474526167494e-09; - test_msg.prn = 30; - test_msg.sqrta = 5153.7539920806885; - test_msg.tgd = -1.3504177331924438e-08; - test_msg.toc_tow = 410400.0; - test_msg.toc_wn = 1838; - test_msg.toe_tow = 410400.0; - test_msg.toe_wn = 1838; - test_msg.valid = 1; - test_msg.w = -0.5237901716088061; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - 0.000319611746818 * 100), 0.05) << "incorrect value for last_msg_.af0, expected 0.000319611746818, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - -1.02318153949e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected -1.02318153949e-12, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.af2, expected 0.0, is " << last_msg_.af2; - EXPECT_LT((last_msg_.c_ic * 100 - 9.12696123123e-08 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected 9.12696123123e-08, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - 5.21540641785e-08 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected 5.21540641785e-08, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - 247.28125 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected 247.28125, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - -77.90625 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected -77.90625, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - -3.72342765331e-06 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected -3.72342765331e-06, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 7.17863440514e-06 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 7.17863440514e-06, is " << last_msg_.c_us; - EXPECT_LT((last_msg_.dn * 100 - 4.40089760076e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 4.40089760076e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.00817864493001 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.00817864493001, is " << last_msg_.ecc; - EXPECT_EQ(last_msg_.healthy, 1) << "incorrect value for last_msg_.healthy, expected 1, is " << last_msg_.healthy; - EXPECT_LT((last_msg_.inc * 100 - 0.975512201725 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.975512201725, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - -5.88238788221e-10 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected -5.88238788221e-10, is " << last_msg_.inc_dot; - EXPECT_EQ(last_msg_.iode, 0) << "incorrect value for last_msg_.iode, expected 0, is " << last_msg_.iode; - EXPECT_LT((last_msg_.m0 * 100 - 1.94018234598 * 100), 0.05) << "incorrect value for last_msg_.m0, expected 1.94018234598, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - 2.24186802893 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected 2.24186802893, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -7.96247452617e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -7.96247452617e-09, is " << last_msg_.omegadot; - EXPECT_EQ(last_msg_.prn, 30) << "incorrect value for last_msg_.prn, expected 30, is " << last_msg_.prn; - EXPECT_LT((last_msg_.sqrta * 100 - 5153.75399208 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 5153.75399208, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.tgd * 100 - -1.35041773319e-08 * 100), 0.05) << "incorrect value for last_msg_.tgd, expected -1.35041773319e-08, is " << last_msg_.tgd; - EXPECT_LT((last_msg_.toc_tow * 100 - 410400.0 * 100), 0.05) << "incorrect value for last_msg_.toc_tow, expected 410400.0, is " << last_msg_.toc_tow; - EXPECT_EQ(last_msg_.toc_wn, 1838) << "incorrect value for last_msg_.toc_wn, expected 1838, is " << last_msg_.toc_wn; - EXPECT_LT((last_msg_.toe_tow * 100 - 410400.0 * 100), 0.05) << "incorrect value for last_msg_.toe_tow, expected 410400.0, is " << last_msg_.toe_tow; - EXPECT_EQ(last_msg_.toe_wn, 1838) << "incorrect value for last_msg_.toe_wn, expected 1838, is " << last_msg_.toe_wn; - EXPECT_EQ(last_msg_.valid, 1) << "incorrect value for last_msg_.valid, expected 1, is " << last_msg_.valid; - EXPECT_LT((last_msg_.w * 100 - -0.523790171609 * 100), 0.05) << "incorrect value for last_msg_.w, expected -0.523790171609, is " << last_msg_.w; +}; + +TEST_F(Test_auto_check_sbp_observation_msgEphemerisDepB5, Test) { + uint8_t encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 77, 190, 0, + 0, 0, 0, 0, 122, 83, 192, 0, 0, 0, 0, 0, 233, 110, 64, + 0, 0, 0, 0, 0, 60, 207, 190, 0, 0, 0, 0, 0, 28, 222, + 62, 0, 0, 0, 0, 0, 128, 120, 62, 0, 0, 0, 0, 0, 0, + 108, 62, 10, 230, 183, 140, 214, 230, 50, 62, 54, 86, 196, 164, 252, + 10, 255, 63, 0, 0, 0, 36, 247, 191, 128, 63, 0, 0, 160, 5, + 193, 33, 180, 64, 186, 138, 81, 129, 88, 239, 1, 64, 94, 210, 120, + 170, 106, 25, 65, 190, 103, 213, 32, 155, 227, 194, 224, 191, 156, 47, + 104, 93, 101, 55, 239, 63, 196, 83, 100, 254, 51, 54, 4, 190, 0, + 0, 0, 0, 50, 242, 52, 63, 0, 0, 0, 0, 0, 0, 114, 189, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, + 65, 46, 7, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, + 30, 0, 170, 33, + }; + + sbp_msg_ephemeris_dep_b_t test_msg{}; + test_msg.af0 = 0.0003196117468178272; + test_msg.af1 = -1.0231815394945443e-12; + test_msg.af2 = 0.0; + test_msg.c_ic = 9.12696123123169e-08; + test_msg.c_is = 5.21540641784668e-08; + test_msg.c_rc = 247.28125; + test_msg.c_rs = -77.90625; + test_msg.c_uc = -3.723427653312683e-06; + test_msg.c_us = 7.178634405136108e-06; + test_msg.dn = 4.400897600764146e-09; + test_msg.ecc = 0.008178644930012524; + test_msg.healthy = 1; + test_msg.inc = 0.9755122017245301; + test_msg.inc_dot = -5.882387882209502e-10; + test_msg.iode = 0; + test_msg.m0 = 1.9401823459824192; + test_msg.omega0 = 2.241868028927766; + test_msg.omegadot = -7.962474526167494e-09; + test_msg.prn = 30; + test_msg.sqrta = 5153.7539920806885; + test_msg.tgd = -1.3504177331924438e-08; + test_msg.toc_tow = 410400.0; + test_msg.toc_wn = 1838; + test_msg.toe_tow = 410400.0; + test_msg.toe_wn = 1838; + test_msg.valid = 1; + test_msg.w = -0.5237901716088061; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - 0.000319611746818 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected 0.000319611746818, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - -1.02318153949e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected -1.02318153949e-12, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected 0.0, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.c_ic * 100 - 9.12696123123e-08 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected 9.12696123123e-08, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - 5.21540641785e-08 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected 5.21540641785e-08, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - 247.28125 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected 247.28125, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - -77.90625 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected -77.90625, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - -3.72342765331e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected -3.72342765331e-06, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 7.17863440514e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 7.17863440514e-06, is " + << last_msg_.c_us; + EXPECT_LT((last_msg_.dn * 100 - 4.40089760076e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 4.40089760076e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.00817864493001 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.00817864493001, is " + << last_msg_.ecc; + EXPECT_EQ(last_msg_.healthy, 1) + << "incorrect value for last_msg_.healthy, expected 1, is " + << last_msg_.healthy; + EXPECT_LT((last_msg_.inc * 100 - 0.975512201725 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.975512201725, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - -5.88238788221e-10 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected -5.88238788221e-10, " + "is " + << last_msg_.inc_dot; + EXPECT_EQ(last_msg_.iode, 0) + << "incorrect value for last_msg_.iode, expected 0, is " + << last_msg_.iode; + EXPECT_LT((last_msg_.m0 * 100 - 1.94018234598 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected 1.94018234598, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - 2.24186802893 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected 2.24186802893, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -7.96247452617e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -7.96247452617e-09, " + "is " + << last_msg_.omegadot; + EXPECT_EQ(last_msg_.prn, 30) + << "incorrect value for last_msg_.prn, expected 30, is " << last_msg_.prn; + EXPECT_LT((last_msg_.sqrta * 100 - 5153.75399208 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 5153.75399208, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.tgd * 100 - -1.35041773319e-08 * 100), 0.05) + << "incorrect value for last_msg_.tgd, expected -1.35041773319e-08, is " + << last_msg_.tgd; + EXPECT_LT((last_msg_.toc_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for last_msg_.toc_tow, expected 410400.0, is " + << last_msg_.toc_tow; + EXPECT_EQ(last_msg_.toc_wn, 1838) + << "incorrect value for last_msg_.toc_wn, expected 1838, is " + << last_msg_.toc_wn; + EXPECT_LT((last_msg_.toe_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for last_msg_.toe_tow, expected 410400.0, is " + << last_msg_.toe_tow; + EXPECT_EQ(last_msg_.toe_wn, 1838) + << "incorrect value for last_msg_.toe_wn, expected 1838, is " + << last_msg_.toe_wn; + EXPECT_EQ(last_msg_.valid, 1) + << "incorrect value for last_msg_.valid, expected 1, is " + << last_msg_.valid; + EXPECT_LT((last_msg_.w * 100 - -0.523790171609 * 100), 0.05) + << "incorrect value for last_msg_.w, expected -0.523790171609, is " + << last_msg_.w; } diff --git a/c/test/cpp/auto_check_sbp_observation_msgEphemerisQzss.cc b/c/test/cpp/auto_check_sbp_observation_msgEphemerisQzss.cc index dd119b8c5..bc667d9f2 100644 --- a/c/test/cpp/auto_check_sbp_observation_msgEphemerisQzss.cc +++ b/c/test/cpp/auto_check_sbp_observation_msgEphemerisQzss.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisQzss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisQzss.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_msgEphemerisQzss0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_msgEphemerisQzss0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_msgEphemerisQzss0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_msgEphemerisQzss0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ephemeris_qzss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ephemeris_qzss_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,92 +67,165 @@ class Test_auto_check_sbp_observation_msgEphemerisQzss0 : sbp_msg_ephemeris_qzss_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_msgEphemerisQzss0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_observation_msgEphemerisQzss0, Test) { + uint8_t encoded_frame[] = { + 85, 142, 0, 128, 240, 139, 193, 31, 208, 221, 6, 0, 106, 8, 0, + 0, 0, 64, 64, 56, 0, 0, 0, 0, 0, 0, 192, 177, 0, 232, + 228, 195, 0, 160, 19, 194, 0, 224, 135, 183, 0, 96, 10, 55, 0, + 192, 157, 181, 0, 0, 46, 52, 167, 72, 107, 105, 179, 1, 39, 62, + 15, 224, 158, 211, 241, 164, 211, 63, 0, 0, 0, 24, 251, 83, 179, + 63, 0, 0, 0, 34, 44, 93, 185, 64, 143, 62, 206, 232, 193, 181, + 242, 191, 207, 216, 69, 106, 98, 255, 39, 190, 65, 132, 95, 22, 48, + 15, 249, 191, 249, 82, 67, 94, 30, 100, 231, 63, 117, 167, 187, 233, + 187, 253, 181, 61, 160, 129, 193, 185, 0, 0, 168, 172, 0, 0, 0, + 0, 208, 221, 6, 0, 106, 8, 49, 49, 3, 126, 23, + }; - uint8_t encoded_frame[] = {85,142,0,128,240,139,193,31,208,221,6,0,106,8,0,0,0,64,64,56,0,0,0,0,0,0,192,177,0,232,228,195,0,160,19,194,0,224,135,183,0,96,10,55,0,192,157,181,0,0,46,52,167,72,107,105,179,1,39,62,15,224,158,211,241,164,211,63,0,0,0,24,251,83,179,63,0,0,0,34,44,93,185,64,143,62,206,232,193,181,242,191,207,216,69,106,98,255,39,190,65,132,95,22,48,15,249,191,249,82,67,94,30,100,231,63,117,167,187,233,187,253,181,61,160,129,193,185,0,0,168,172,0,0,0,0,208,221,6,0,106,8,49,49,3,126,23, }; + sbp_msg_ephemeris_qzss_t test_msg{}; + test_msg.af0 = -0.00036908406764268875; + test_msg.af1 = -4.774847184307873e-12; + test_msg.af2 = 0.0; + test_msg.c_ic = -1.1753290891647339e-06; + test_msg.c_is = 1.6205012798309326e-07; + test_msg.c_rc = -36.90625; + test_msg.c_rs = -457.8125; + test_msg.c_uc = -1.6197562217712402e-05; + test_msg.c_us = 8.247792720794678e-06; + test_msg.common.fit_interval = 14400; + test_msg.common.health_bits = 0; + test_msg.common.sid.code = 31; + test_msg.common.sid.sat = 193; + test_msg.common.toe.tow = 450000; + test_msg.common.toe.wn = 2154; + test_msg.common.ura = 2.0; + test_msg.common.valid = 0; + test_msg.dn = 2.678325848736433e-09; + test_msg.ecc = 0.07550019584596157; + test_msg.inc = 0.7309715119432375; + test_msg.inc_dot = 2.0000833114980698e-11; + test_msg.iodc = 817; + test_msg.iode = 49; + test_msg.m0 = 0.30694242158961144; + test_msg.omega0 = -1.1693743795366662; + test_msg.omegadot = -2.7936877968817684e-09; + test_msg.sqrta = 6493.172393798828; + test_msg.tgd = -5.587935447692871e-09; + test_msg.toc.tow = 450000; + test_msg.toc.wn = 2154; + test_msg.w = -1.5662079690885238; - sbp_msg_ephemeris_qzss_t test_msg{}; - test_msg.af0 = -0.00036908406764268875; - test_msg.af1 = -4.774847184307873e-12; - test_msg.af2 = 0.0; - test_msg.c_ic = -1.1753290891647339e-06; - test_msg.c_is = 1.6205012798309326e-07; - test_msg.c_rc = -36.90625; - test_msg.c_rs = -457.8125; - test_msg.c_uc = -1.6197562217712402e-05; - test_msg.c_us = 8.247792720794678e-06; - test_msg.common.fit_interval = 14400; - test_msg.common.health_bits = 0; - test_msg.common.sid.code = 31; - test_msg.common.sid.sat = 193; - test_msg.common.toe.tow = 450000; - test_msg.common.toe.wn = 2154; - test_msg.common.ura = 2.0; - test_msg.common.valid = 0; - test_msg.dn = 2.678325848736433e-09; - test_msg.ecc = 0.07550019584596157; - test_msg.inc = 0.7309715119432375; - test_msg.inc_dot = 2.0000833114980698e-11; - test_msg.iodc = 817; - test_msg.iode = 49; - test_msg.m0 = 0.30694242158961144; - test_msg.omega0 = -1.1693743795366662; - test_msg.omegadot = -2.7936877968817684e-09; - test_msg.sqrta = 6493.172393798828; - test_msg.tgd = -5.587935447692871e-09; - test_msg.toc.tow = 450000; - test_msg.toc.wn = 2154; - test_msg.w = -1.5662079690885238; - - EXPECT_EQ(send_message( 61568, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(61568, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61568); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.af0 * 100 - -0.000369084067643 * 100), 0.05) << "incorrect value for last_msg_.af0, expected -0.000369084067643, is " << last_msg_.af0; - EXPECT_LT((last_msg_.af1 * 100 - -4.77484718431e-12 * 100), 0.05) << "incorrect value for last_msg_.af1, expected -4.77484718431e-12, is " << last_msg_.af1; - EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.af2, expected 0.0, is " << last_msg_.af2; - EXPECT_LT((last_msg_.c_ic * 100 - -1.17532908916e-06 * 100), 0.05) << "incorrect value for last_msg_.c_ic, expected -1.17532908916e-06, is " << last_msg_.c_ic; - EXPECT_LT((last_msg_.c_is * 100 - 1.62050127983e-07 * 100), 0.05) << "incorrect value for last_msg_.c_is, expected 1.62050127983e-07, is " << last_msg_.c_is; - EXPECT_LT((last_msg_.c_rc * 100 - -36.90625 * 100), 0.05) << "incorrect value for last_msg_.c_rc, expected -36.90625, is " << last_msg_.c_rc; - EXPECT_LT((last_msg_.c_rs * 100 - -457.8125 * 100), 0.05) << "incorrect value for last_msg_.c_rs, expected -457.8125, is " << last_msg_.c_rs; - EXPECT_LT((last_msg_.c_uc * 100 - -1.61975622177e-05 * 100), 0.05) << "incorrect value for last_msg_.c_uc, expected -1.61975622177e-05, is " << last_msg_.c_uc; - EXPECT_LT((last_msg_.c_us * 100 - 8.24779272079e-06 * 100), 0.05) << "incorrect value for last_msg_.c_us, expected 8.24779272079e-06, is " << last_msg_.c_us; - EXPECT_EQ(last_msg_.common.fit_interval, 14400) << "incorrect value for last_msg_.common.fit_interval, expected 14400, is " << last_msg_.common.fit_interval; - EXPECT_EQ(last_msg_.common.health_bits, 0) << "incorrect value for last_msg_.common.health_bits, expected 0, is " << last_msg_.common.health_bits; - EXPECT_EQ(last_msg_.common.sid.code, 31) << "incorrect value for last_msg_.common.sid.code, expected 31, is " << last_msg_.common.sid.code; - EXPECT_EQ(last_msg_.common.sid.sat, 193) << "incorrect value for last_msg_.common.sid.sat, expected 193, is " << last_msg_.common.sid.sat; - EXPECT_EQ(last_msg_.common.toe.tow, 450000) << "incorrect value for last_msg_.common.toe.tow, expected 450000, is " << last_msg_.common.toe.tow; - EXPECT_EQ(last_msg_.common.toe.wn, 2154) << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " << last_msg_.common.toe.wn; - EXPECT_LT((last_msg_.common.ura * 100 - 2.0 * 100), 0.05) << "incorrect value for last_msg_.common.ura, expected 2.0, is " << last_msg_.common.ura; - EXPECT_EQ(last_msg_.common.valid, 0) << "incorrect value for last_msg_.common.valid, expected 0, is " << last_msg_.common.valid; - EXPECT_LT((last_msg_.dn * 100 - 2.67832584874e-09 * 100), 0.05) << "incorrect value for last_msg_.dn, expected 2.67832584874e-09, is " << last_msg_.dn; - EXPECT_LT((last_msg_.ecc * 100 - 0.075500195846 * 100), 0.05) << "incorrect value for last_msg_.ecc, expected 0.075500195846, is " << last_msg_.ecc; - EXPECT_LT((last_msg_.inc * 100 - 0.730971511943 * 100), 0.05) << "incorrect value for last_msg_.inc, expected 0.730971511943, is " << last_msg_.inc; - EXPECT_LT((last_msg_.inc_dot * 100 - 2.0000833115e-11 * 100), 0.05) << "incorrect value for last_msg_.inc_dot, expected 2.0000833115e-11, is " << last_msg_.inc_dot; - EXPECT_EQ(last_msg_.iodc, 817) << "incorrect value for last_msg_.iodc, expected 817, is " << last_msg_.iodc; - EXPECT_EQ(last_msg_.iode, 49) << "incorrect value for last_msg_.iode, expected 49, is " << last_msg_.iode; - EXPECT_LT((last_msg_.m0 * 100 - 0.30694242159 * 100), 0.05) << "incorrect value for last_msg_.m0, expected 0.30694242159, is " << last_msg_.m0; - EXPECT_LT((last_msg_.omega0 * 100 - -1.16937437954 * 100), 0.05) << "incorrect value for last_msg_.omega0, expected -1.16937437954, is " << last_msg_.omega0; - EXPECT_LT((last_msg_.omegadot * 100 - -2.79368779688e-09 * 100), 0.05) << "incorrect value for last_msg_.omegadot, expected -2.79368779688e-09, is " << last_msg_.omegadot; - EXPECT_LT((last_msg_.sqrta * 100 - 6493.1723938 * 100), 0.05) << "incorrect value for last_msg_.sqrta, expected 6493.1723938, is " << last_msg_.sqrta; - EXPECT_LT((last_msg_.tgd * 100 - -5.58793544769e-09 * 100), 0.05) << "incorrect value for last_msg_.tgd, expected -5.58793544769e-09, is " << last_msg_.tgd; - EXPECT_EQ(last_msg_.toc.tow, 450000) << "incorrect value for last_msg_.toc.tow, expected 450000, is " << last_msg_.toc.tow; - EXPECT_EQ(last_msg_.toc.wn, 2154) << "incorrect value for last_msg_.toc.wn, expected 2154, is " << last_msg_.toc.wn; - EXPECT_LT((last_msg_.w * 100 - -1.56620796909 * 100), 0.05) << "incorrect value for last_msg_.w, expected -1.56620796909, is " << last_msg_.w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61568); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.af0 * 100 - -0.000369084067643 * 100), 0.05) + << "incorrect value for last_msg_.af0, expected -0.000369084067643, is " + << last_msg_.af0; + EXPECT_LT((last_msg_.af1 * 100 - -4.77484718431e-12 * 100), 0.05) + << "incorrect value for last_msg_.af1, expected -4.77484718431e-12, is " + << last_msg_.af1; + EXPECT_LT((last_msg_.af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.af2, expected 0.0, is " + << last_msg_.af2; + EXPECT_LT((last_msg_.c_ic * 100 - -1.17532908916e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_ic, expected -1.17532908916e-06, is " + << last_msg_.c_ic; + EXPECT_LT((last_msg_.c_is * 100 - 1.62050127983e-07 * 100), 0.05) + << "incorrect value for last_msg_.c_is, expected 1.62050127983e-07, is " + << last_msg_.c_is; + EXPECT_LT((last_msg_.c_rc * 100 - -36.90625 * 100), 0.05) + << "incorrect value for last_msg_.c_rc, expected -36.90625, is " + << last_msg_.c_rc; + EXPECT_LT((last_msg_.c_rs * 100 - -457.8125 * 100), 0.05) + << "incorrect value for last_msg_.c_rs, expected -457.8125, is " + << last_msg_.c_rs; + EXPECT_LT((last_msg_.c_uc * 100 - -1.61975622177e-05 * 100), 0.05) + << "incorrect value for last_msg_.c_uc, expected -1.61975622177e-05, is " + << last_msg_.c_uc; + EXPECT_LT((last_msg_.c_us * 100 - 8.24779272079e-06 * 100), 0.05) + << "incorrect value for last_msg_.c_us, expected 8.24779272079e-06, is " + << last_msg_.c_us; + EXPECT_EQ(last_msg_.common.fit_interval, 14400) + << "incorrect value for last_msg_.common.fit_interval, expected 14400, " + "is " + << last_msg_.common.fit_interval; + EXPECT_EQ(last_msg_.common.health_bits, 0) + << "incorrect value for last_msg_.common.health_bits, expected 0, is " + << last_msg_.common.health_bits; + EXPECT_EQ(last_msg_.common.sid.code, 31) + << "incorrect value for last_msg_.common.sid.code, expected 31, is " + << last_msg_.common.sid.code; + EXPECT_EQ(last_msg_.common.sid.sat, 193) + << "incorrect value for last_msg_.common.sid.sat, expected 193, is " + << last_msg_.common.sid.sat; + EXPECT_EQ(last_msg_.common.toe.tow, 450000) + << "incorrect value for last_msg_.common.toe.tow, expected 450000, is " + << last_msg_.common.toe.tow; + EXPECT_EQ(last_msg_.common.toe.wn, 2154) + << "incorrect value for last_msg_.common.toe.wn, expected 2154, is " + << last_msg_.common.toe.wn; + EXPECT_LT((last_msg_.common.ura * 100 - 2.0 * 100), 0.05) + << "incorrect value for last_msg_.common.ura, expected 2.0, is " + << last_msg_.common.ura; + EXPECT_EQ(last_msg_.common.valid, 0) + << "incorrect value for last_msg_.common.valid, expected 0, is " + << last_msg_.common.valid; + EXPECT_LT((last_msg_.dn * 100 - 2.67832584874e-09 * 100), 0.05) + << "incorrect value for last_msg_.dn, expected 2.67832584874e-09, is " + << last_msg_.dn; + EXPECT_LT((last_msg_.ecc * 100 - 0.075500195846 * 100), 0.05) + << "incorrect value for last_msg_.ecc, expected 0.075500195846, is " + << last_msg_.ecc; + EXPECT_LT((last_msg_.inc * 100 - 0.730971511943 * 100), 0.05) + << "incorrect value for last_msg_.inc, expected 0.730971511943, is " + << last_msg_.inc; + EXPECT_LT((last_msg_.inc_dot * 100 - 2.0000833115e-11 * 100), 0.05) + << "incorrect value for last_msg_.inc_dot, expected 2.0000833115e-11, is " + << last_msg_.inc_dot; + EXPECT_EQ(last_msg_.iodc, 817) + << "incorrect value for last_msg_.iodc, expected 817, is " + << last_msg_.iodc; + EXPECT_EQ(last_msg_.iode, 49) + << "incorrect value for last_msg_.iode, expected 49, is " + << last_msg_.iode; + EXPECT_LT((last_msg_.m0 * 100 - 0.30694242159 * 100), 0.05) + << "incorrect value for last_msg_.m0, expected 0.30694242159, is " + << last_msg_.m0; + EXPECT_LT((last_msg_.omega0 * 100 - -1.16937437954 * 100), 0.05) + << "incorrect value for last_msg_.omega0, expected -1.16937437954, is " + << last_msg_.omega0; + EXPECT_LT((last_msg_.omegadot * 100 - -2.79368779688e-09 * 100), 0.05) + << "incorrect value for last_msg_.omegadot, expected -2.79368779688e-09, " + "is " + << last_msg_.omegadot; + EXPECT_LT((last_msg_.sqrta * 100 - 6493.1723938 * 100), 0.05) + << "incorrect value for last_msg_.sqrta, expected 6493.1723938, is " + << last_msg_.sqrta; + EXPECT_LT((last_msg_.tgd * 100 - -5.58793544769e-09 * 100), 0.05) + << "incorrect value for last_msg_.tgd, expected -5.58793544769e-09, is " + << last_msg_.tgd; + EXPECT_EQ(last_msg_.toc.tow, 450000) + << "incorrect value for last_msg_.toc.tow, expected 450000, is " + << last_msg_.toc.tow; + EXPECT_EQ(last_msg_.toc.wn, 2154) + << "incorrect value for last_msg_.toc.wn, expected 2154, is " + << last_msg_.toc.wn; + EXPECT_LT((last_msg_.w * 100 - -1.56620796909 * 100), 0.05) + << "incorrect value for last_msg_.w, expected -1.56620796909, is " + << last_msg_.w; } diff --git a/c/test/cpp/auto_check_sbp_observation_msgObsDepA.cc b/c/test/cpp/auto_check_sbp_observation_msgObsDepA.cc index 47cbbfb7a..5e61a144c 100644 --- a/c/test/cpp/auto_check_sbp_observation_msgObsDepA.cc +++ b/c/test/cpp/auto_check_sbp_observation_msgObsDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_msgObsDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_msgObsDepA.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_observation_msgObsDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_msgObsDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_observation_msgObsDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_msgObsDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,195 +67,300 @@ class Test_auto_check_sbp_observation_msgObsDepA0 : sbp_msg_obs_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_msgObsDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,69,0,195,4,98,56,158,67,24,46,7,32,56,235,249,121,244,114,255,255,33,46,67,218,0,238,203,70,124,22,25,3,0,98,43,184,157,2,176,133,197,125,126,71,253,255,185,39,68,55,3,60,173,162,131,98,231,253,255,139,30,33,16,10,128,178,248,136,42,113,253,255,40,20,42,71,13,246,246,17,135,255,51,3,0,64,27,108,249,22,210,41,114,118,131,48,255,255,31,52,226,58,30,23,217, }; - - sbp_msg_obs_dep_a_t test_msg{}; - test_msg.header.n_obs = 32; - test_msg.header.t.tow = 407084600; - test_msg.header.t.wn = 1838; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 7; - - test_msg.obs[0].L.f = 33; - test_msg.obs[0].L.i = -36108; - test_msg.obs[0].P = 2046421816; - test_msg.obs[0].cn0 = 46; - test_msg.obs[0].lock = 55875; - test_msg.obs[0].prn = 0; - - test_msg.obs[1].L.f = 98; - test_msg.obs[1].L.i = 203030; - test_msg.obs[1].P = 2085014510; - test_msg.obs[1].cn0 = 43; - test_msg.obs[1].lock = 40376; - test_msg.obs[1].prn = 2; - - test_msg.obs[2].L.f = 185; - test_msg.obs[2].L.i = -178306; - test_msg.obs[2].P = 2110096816; - test_msg.obs[2].cn0 = 39; - test_msg.obs[2].lock = 14148; - test_msg.obs[2].prn = 3; - - test_msg.obs[3].L.f = 139; - test_msg.obs[3].L.i = -137374; - test_msg.obs[3].P = 2208476476; - test_msg.obs[3].cn0 = 30; - test_msg.obs[3].lock = 4129; - test_msg.obs[3].prn = 10; - - test_msg.obs[4].L.f = 40; - test_msg.obs[4].L.i = -167638; - test_msg.obs[4].P = 2298000000; - test_msg.obs[4].cn0 = 20; - test_msg.obs[4].lock = 18218; - test_msg.obs[4].prn = 13; - - test_msg.obs[5].L.f = 64; - test_msg.obs[5].L.i = 209919; - test_msg.obs[5].P = 2266101494; - test_msg.obs[5].cn0 = 27; - test_msg.obs[5].lock = 63852; - test_msg.obs[5].prn = 22; - - test_msg.obs[6].L.f = 31; - test_msg.obs[6].L.i = -53117; - test_msg.obs[6].P = 1987193298; - test_msg.obs[6].cn0 = 52; - test_msg.obs[6].lock = 15074; - test_msg.obs[6].prn = 30; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 32) << "incorrect value for last_msg_.header.n_obs, expected 32, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 407084600) << "incorrect value for last_msg_.header.t.tow, expected 407084600, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1838) << "incorrect value for last_msg_.header.t.wn, expected 1838, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 7) << "incorrect value for last_msg_.n_obs.value, expected 7, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 33) << "incorrect value for last_msg_.obs[0].L.f, expected 33, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, -36108) << "incorrect value for last_msg_.obs[0].L.i, expected -36108, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 2046421816) << "incorrect value for last_msg_.obs[0].P, expected 2046421816, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 46) << "incorrect value for last_msg_.obs[0].cn0, expected 46, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 55875) << "incorrect value for last_msg_.obs[0].lock, expected 55875, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].prn, 0) << "incorrect value for last_msg_.obs[0].prn, expected 0, is " << last_msg_.obs[0].prn; - EXPECT_EQ(last_msg_.obs[1].L.f, 98) << "incorrect value for last_msg_.obs[1].L.f, expected 98, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, 203030) << "incorrect value for last_msg_.obs[1].L.i, expected 203030, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 2085014510) << "incorrect value for last_msg_.obs[1].P, expected 2085014510, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].cn0, 43) << "incorrect value for last_msg_.obs[1].cn0, expected 43, is " << last_msg_.obs[1].cn0; - EXPECT_EQ(last_msg_.obs[1].lock, 40376) << "incorrect value for last_msg_.obs[1].lock, expected 40376, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].prn, 2) << "incorrect value for last_msg_.obs[1].prn, expected 2, is " << last_msg_.obs[1].prn; - EXPECT_EQ(last_msg_.obs[2].L.f, 185) << "incorrect value for last_msg_.obs[2].L.f, expected 185, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, -178306) << "incorrect value for last_msg_.obs[2].L.i, expected -178306, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 2110096816) << "incorrect value for last_msg_.obs[2].P, expected 2110096816, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].cn0, 39) << "incorrect value for last_msg_.obs[2].cn0, expected 39, is " << last_msg_.obs[2].cn0; - EXPECT_EQ(last_msg_.obs[2].lock, 14148) << "incorrect value for last_msg_.obs[2].lock, expected 14148, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].prn, 3) << "incorrect value for last_msg_.obs[2].prn, expected 3, is " << last_msg_.obs[2].prn; - EXPECT_EQ(last_msg_.obs[3].L.f, 139) << "incorrect value for last_msg_.obs[3].L.f, expected 139, is " << last_msg_.obs[3].L.f; - EXPECT_EQ(last_msg_.obs[3].L.i, -137374) << "incorrect value for last_msg_.obs[3].L.i, expected -137374, is " << last_msg_.obs[3].L.i; - EXPECT_EQ(last_msg_.obs[3].P, 2208476476) << "incorrect value for last_msg_.obs[3].P, expected 2208476476, is " << last_msg_.obs[3].P; - EXPECT_EQ(last_msg_.obs[3].cn0, 30) << "incorrect value for last_msg_.obs[3].cn0, expected 30, is " << last_msg_.obs[3].cn0; - EXPECT_EQ(last_msg_.obs[3].lock, 4129) << "incorrect value for last_msg_.obs[3].lock, expected 4129, is " << last_msg_.obs[3].lock; - EXPECT_EQ(last_msg_.obs[3].prn, 10) << "incorrect value for last_msg_.obs[3].prn, expected 10, is " << last_msg_.obs[3].prn; - EXPECT_EQ(last_msg_.obs[4].L.f, 40) << "incorrect value for last_msg_.obs[4].L.f, expected 40, is " << last_msg_.obs[4].L.f; - EXPECT_EQ(last_msg_.obs[4].L.i, -167638) << "incorrect value for last_msg_.obs[4].L.i, expected -167638, is " << last_msg_.obs[4].L.i; - EXPECT_EQ(last_msg_.obs[4].P, 2298000000) << "incorrect value for last_msg_.obs[4].P, expected 2298000000, is " << last_msg_.obs[4].P; - EXPECT_EQ(last_msg_.obs[4].cn0, 20) << "incorrect value for last_msg_.obs[4].cn0, expected 20, is " << last_msg_.obs[4].cn0; - EXPECT_EQ(last_msg_.obs[4].lock, 18218) << "incorrect value for last_msg_.obs[4].lock, expected 18218, is " << last_msg_.obs[4].lock; - EXPECT_EQ(last_msg_.obs[4].prn, 13) << "incorrect value for last_msg_.obs[4].prn, expected 13, is " << last_msg_.obs[4].prn; - EXPECT_EQ(last_msg_.obs[5].L.f, 64) << "incorrect value for last_msg_.obs[5].L.f, expected 64, is " << last_msg_.obs[5].L.f; - EXPECT_EQ(last_msg_.obs[5].L.i, 209919) << "incorrect value for last_msg_.obs[5].L.i, expected 209919, is " << last_msg_.obs[5].L.i; - EXPECT_EQ(last_msg_.obs[5].P, 2266101494) << "incorrect value for last_msg_.obs[5].P, expected 2266101494, is " << last_msg_.obs[5].P; - EXPECT_EQ(last_msg_.obs[5].cn0, 27) << "incorrect value for last_msg_.obs[5].cn0, expected 27, is " << last_msg_.obs[5].cn0; - EXPECT_EQ(last_msg_.obs[5].lock, 63852) << "incorrect value for last_msg_.obs[5].lock, expected 63852, is " << last_msg_.obs[5].lock; - EXPECT_EQ(last_msg_.obs[5].prn, 22) << "incorrect value for last_msg_.obs[5].prn, expected 22, is " << last_msg_.obs[5].prn; - EXPECT_EQ(last_msg_.obs[6].L.f, 31) << "incorrect value for last_msg_.obs[6].L.f, expected 31, is " << last_msg_.obs[6].L.f; - EXPECT_EQ(last_msg_.obs[6].L.i, -53117) << "incorrect value for last_msg_.obs[6].L.i, expected -53117, is " << last_msg_.obs[6].L.i; - EXPECT_EQ(last_msg_.obs[6].P, 1987193298) << "incorrect value for last_msg_.obs[6].P, expected 1987193298, is " << last_msg_.obs[6].P; - EXPECT_EQ(last_msg_.obs[6].cn0, 52) << "incorrect value for last_msg_.obs[6].cn0, expected 52, is " << last_msg_.obs[6].cn0; - EXPECT_EQ(last_msg_.obs[6].lock, 15074) << "incorrect value for last_msg_.obs[6].lock, expected 15074, is " << last_msg_.obs[6].lock; - EXPECT_EQ(last_msg_.obs[6].prn, 30) << "incorrect value for last_msg_.obs[6].prn, expected 30, is " << last_msg_.obs[6].prn; +}; + +TEST_F(Test_auto_check_sbp_observation_msgObsDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 69, 0, 195, 4, 98, 56, 158, 67, 24, 46, 7, 32, 56, + 235, 249, 121, 244, 114, 255, 255, 33, 46, 67, 218, 0, 238, 203, + 70, 124, 22, 25, 3, 0, 98, 43, 184, 157, 2, 176, 133, 197, + 125, 126, 71, 253, 255, 185, 39, 68, 55, 3, 60, 173, 162, 131, + 98, 231, 253, 255, 139, 30, 33, 16, 10, 128, 178, 248, 136, 42, + 113, 253, 255, 40, 20, 42, 71, 13, 246, 246, 17, 135, 255, 51, + 3, 0, 64, 27, 108, 249, 22, 210, 41, 114, 118, 131, 48, 255, + 255, 31, 52, 226, 58, 30, 23, 217, + }; + + sbp_msg_obs_dep_a_t test_msg{}; + test_msg.header.n_obs = 32; + test_msg.header.t.tow = 407084600; + test_msg.header.t.wn = 1838; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 7; + + test_msg.obs[0].L.f = 33; + test_msg.obs[0].L.i = -36108; + test_msg.obs[0].P = 2046421816; + test_msg.obs[0].cn0 = 46; + test_msg.obs[0].lock = 55875; + test_msg.obs[0].prn = 0; + + test_msg.obs[1].L.f = 98; + test_msg.obs[1].L.i = 203030; + test_msg.obs[1].P = 2085014510; + test_msg.obs[1].cn0 = 43; + test_msg.obs[1].lock = 40376; + test_msg.obs[1].prn = 2; + + test_msg.obs[2].L.f = 185; + test_msg.obs[2].L.i = -178306; + test_msg.obs[2].P = 2110096816; + test_msg.obs[2].cn0 = 39; + test_msg.obs[2].lock = 14148; + test_msg.obs[2].prn = 3; + + test_msg.obs[3].L.f = 139; + test_msg.obs[3].L.i = -137374; + test_msg.obs[3].P = 2208476476; + test_msg.obs[3].cn0 = 30; + test_msg.obs[3].lock = 4129; + test_msg.obs[3].prn = 10; + + test_msg.obs[4].L.f = 40; + test_msg.obs[4].L.i = -167638; + test_msg.obs[4].P = 2298000000; + test_msg.obs[4].cn0 = 20; + test_msg.obs[4].lock = 18218; + test_msg.obs[4].prn = 13; + + test_msg.obs[5].L.f = 64; + test_msg.obs[5].L.i = 209919; + test_msg.obs[5].P = 2266101494; + test_msg.obs[5].cn0 = 27; + test_msg.obs[5].lock = 63852; + test_msg.obs[5].prn = 22; + + test_msg.obs[6].L.f = 31; + test_msg.obs[6].L.i = -53117; + test_msg.obs[6].P = 1987193298; + test_msg.obs[6].cn0 = 52; + test_msg.obs[6].lock = 15074; + test_msg.obs[6].prn = 30; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 32) + << "incorrect value for last_msg_.header.n_obs, expected 32, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 407084600) + << "incorrect value for last_msg_.header.t.tow, expected 407084600, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1838) + << "incorrect value for last_msg_.header.t.wn, expected 1838, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 7) + << "incorrect value for last_msg_.n_obs.value, expected 7, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 33) + << "incorrect value for last_msg_.obs[0].L.f, expected 33, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, -36108) + << "incorrect value for last_msg_.obs[0].L.i, expected -36108, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 2046421816) + << "incorrect value for last_msg_.obs[0].P, expected 2046421816, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 46) + << "incorrect value for last_msg_.obs[0].cn0, expected 46, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 55875) + << "incorrect value for last_msg_.obs[0].lock, expected 55875, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].prn, 0) + << "incorrect value for last_msg_.obs[0].prn, expected 0, is " + << last_msg_.obs[0].prn; + EXPECT_EQ(last_msg_.obs[1].L.f, 98) + << "incorrect value for last_msg_.obs[1].L.f, expected 98, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, 203030) + << "incorrect value for last_msg_.obs[1].L.i, expected 203030, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 2085014510) + << "incorrect value for last_msg_.obs[1].P, expected 2085014510, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].cn0, 43) + << "incorrect value for last_msg_.obs[1].cn0, expected 43, is " + << last_msg_.obs[1].cn0; + EXPECT_EQ(last_msg_.obs[1].lock, 40376) + << "incorrect value for last_msg_.obs[1].lock, expected 40376, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].prn, 2) + << "incorrect value for last_msg_.obs[1].prn, expected 2, is " + << last_msg_.obs[1].prn; + EXPECT_EQ(last_msg_.obs[2].L.f, 185) + << "incorrect value for last_msg_.obs[2].L.f, expected 185, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, -178306) + << "incorrect value for last_msg_.obs[2].L.i, expected -178306, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 2110096816) + << "incorrect value for last_msg_.obs[2].P, expected 2110096816, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].cn0, 39) + << "incorrect value for last_msg_.obs[2].cn0, expected 39, is " + << last_msg_.obs[2].cn0; + EXPECT_EQ(last_msg_.obs[2].lock, 14148) + << "incorrect value for last_msg_.obs[2].lock, expected 14148, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].prn, 3) + << "incorrect value for last_msg_.obs[2].prn, expected 3, is " + << last_msg_.obs[2].prn; + EXPECT_EQ(last_msg_.obs[3].L.f, 139) + << "incorrect value for last_msg_.obs[3].L.f, expected 139, is " + << last_msg_.obs[3].L.f; + EXPECT_EQ(last_msg_.obs[3].L.i, -137374) + << "incorrect value for last_msg_.obs[3].L.i, expected -137374, is " + << last_msg_.obs[3].L.i; + EXPECT_EQ(last_msg_.obs[3].P, 2208476476) + << "incorrect value for last_msg_.obs[3].P, expected 2208476476, is " + << last_msg_.obs[3].P; + EXPECT_EQ(last_msg_.obs[3].cn0, 30) + << "incorrect value for last_msg_.obs[3].cn0, expected 30, is " + << last_msg_.obs[3].cn0; + EXPECT_EQ(last_msg_.obs[3].lock, 4129) + << "incorrect value for last_msg_.obs[3].lock, expected 4129, is " + << last_msg_.obs[3].lock; + EXPECT_EQ(last_msg_.obs[3].prn, 10) + << "incorrect value for last_msg_.obs[3].prn, expected 10, is " + << last_msg_.obs[3].prn; + EXPECT_EQ(last_msg_.obs[4].L.f, 40) + << "incorrect value for last_msg_.obs[4].L.f, expected 40, is " + << last_msg_.obs[4].L.f; + EXPECT_EQ(last_msg_.obs[4].L.i, -167638) + << "incorrect value for last_msg_.obs[4].L.i, expected -167638, is " + << last_msg_.obs[4].L.i; + EXPECT_EQ(last_msg_.obs[4].P, 2298000000) + << "incorrect value for last_msg_.obs[4].P, expected 2298000000, is " + << last_msg_.obs[4].P; + EXPECT_EQ(last_msg_.obs[4].cn0, 20) + << "incorrect value for last_msg_.obs[4].cn0, expected 20, is " + << last_msg_.obs[4].cn0; + EXPECT_EQ(last_msg_.obs[4].lock, 18218) + << "incorrect value for last_msg_.obs[4].lock, expected 18218, is " + << last_msg_.obs[4].lock; + EXPECT_EQ(last_msg_.obs[4].prn, 13) + << "incorrect value for last_msg_.obs[4].prn, expected 13, is " + << last_msg_.obs[4].prn; + EXPECT_EQ(last_msg_.obs[5].L.f, 64) + << "incorrect value for last_msg_.obs[5].L.f, expected 64, is " + << last_msg_.obs[5].L.f; + EXPECT_EQ(last_msg_.obs[5].L.i, 209919) + << "incorrect value for last_msg_.obs[5].L.i, expected 209919, is " + << last_msg_.obs[5].L.i; + EXPECT_EQ(last_msg_.obs[5].P, 2266101494) + << "incorrect value for last_msg_.obs[5].P, expected 2266101494, is " + << last_msg_.obs[5].P; + EXPECT_EQ(last_msg_.obs[5].cn0, 27) + << "incorrect value for last_msg_.obs[5].cn0, expected 27, is " + << last_msg_.obs[5].cn0; + EXPECT_EQ(last_msg_.obs[5].lock, 63852) + << "incorrect value for last_msg_.obs[5].lock, expected 63852, is " + << last_msg_.obs[5].lock; + EXPECT_EQ(last_msg_.obs[5].prn, 22) + << "incorrect value for last_msg_.obs[5].prn, expected 22, is " + << last_msg_.obs[5].prn; + EXPECT_EQ(last_msg_.obs[6].L.f, 31) + << "incorrect value for last_msg_.obs[6].L.f, expected 31, is " + << last_msg_.obs[6].L.f; + EXPECT_EQ(last_msg_.obs[6].L.i, -53117) + << "incorrect value for last_msg_.obs[6].L.i, expected -53117, is " + << last_msg_.obs[6].L.i; + EXPECT_EQ(last_msg_.obs[6].P, 1987193298) + << "incorrect value for last_msg_.obs[6].P, expected 1987193298, is " + << last_msg_.obs[6].P; + EXPECT_EQ(last_msg_.obs[6].cn0, 52) + << "incorrect value for last_msg_.obs[6].cn0, expected 52, is " + << last_msg_.obs[6].cn0; + EXPECT_EQ(last_msg_.obs[6].lock, 15074) + << "incorrect value for last_msg_.obs[6].lock, expected 15074, is " + << last_msg_.obs[6].lock; + EXPECT_EQ(last_msg_.obs[6].prn, 30) + << "incorrect value for last_msg_.obs[6].prn, expected 30, is " + << last_msg_.obs[6].prn; } -class Test_auto_check_sbp_observation_msgObsDepA1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_msgObsDepA1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_msgObsDepA1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_msgObsDepA1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -267,117 +368,144 @@ class Test_auto_check_sbp_observation_msgObsDepA1 : sbp_msg_obs_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_msgObsDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,69,0,195,4,20,56,158,67,24,46,7,33,84,52,164,117,102,32,0,0,147,62,62,250,31,234,14, }; - - sbp_msg_obs_dep_a_t test_msg{}; - test_msg.header.n_obs = 33; - test_msg.header.t.tow = 407084600; - test_msg.header.t.wn = 1838; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 1; - - test_msg.obs[0].L.f = 147; - test_msg.obs[0].L.i = 8294; - test_msg.obs[0].P = 1973695572; - test_msg.obs[0].cn0 = 62; - test_msg.obs[0].lock = 64062; - test_msg.obs[0].prn = 31; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 33) << "incorrect value for last_msg_.header.n_obs, expected 33, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 407084600) << "incorrect value for last_msg_.header.t.tow, expected 407084600, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1838) << "incorrect value for last_msg_.header.t.wn, expected 1838, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 1) << "incorrect value for last_msg_.n_obs.value, expected 1, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 147) << "incorrect value for last_msg_.obs[0].L.f, expected 147, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, 8294) << "incorrect value for last_msg_.obs[0].L.i, expected 8294, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 1973695572) << "incorrect value for last_msg_.obs[0].P, expected 1973695572, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 62) << "incorrect value for last_msg_.obs[0].cn0, expected 62, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 64062) << "incorrect value for last_msg_.obs[0].lock, expected 64062, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].prn, 31) << "incorrect value for last_msg_.obs[0].prn, expected 31, is " << last_msg_.obs[0].prn; +}; + +TEST_F(Test_auto_check_sbp_observation_msgObsDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 69, 0, 195, 4, 20, 56, 158, 67, 24, 46, 7, 33, 84, + 52, 164, 117, 102, 32, 0, 0, 147, 62, 62, 250, 31, 234, 14, + }; + + sbp_msg_obs_dep_a_t test_msg{}; + test_msg.header.n_obs = 33; + test_msg.header.t.tow = 407084600; + test_msg.header.t.wn = 1838; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 1; + + test_msg.obs[0].L.f = 147; + test_msg.obs[0].L.i = 8294; + test_msg.obs[0].P = 1973695572; + test_msg.obs[0].cn0 = 62; + test_msg.obs[0].lock = 64062; + test_msg.obs[0].prn = 31; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 33) + << "incorrect value for last_msg_.header.n_obs, expected 33, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 407084600) + << "incorrect value for last_msg_.header.t.tow, expected 407084600, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1838) + << "incorrect value for last_msg_.header.t.wn, expected 1838, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 1) + << "incorrect value for last_msg_.n_obs.value, expected 1, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 147) + << "incorrect value for last_msg_.obs[0].L.f, expected 147, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, 8294) + << "incorrect value for last_msg_.obs[0].L.i, expected 8294, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 1973695572) + << "incorrect value for last_msg_.obs[0].P, expected 1973695572, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 62) + << "incorrect value for last_msg_.obs[0].cn0, expected 62, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 64062) + << "incorrect value for last_msg_.obs[0].lock, expected 64062, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].prn, 31) + << "incorrect value for last_msg_.obs[0].prn, expected 31, is " + << last_msg_.obs[0].prn; } -class Test_auto_check_sbp_observation_msgObsDepA2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_msgObsDepA2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_msgObsDepA2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_msgObsDepA2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -385,195 +513,300 @@ class Test_auto_check_sbp_observation_msgObsDepA2 : sbp_msg_obs_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_msgObsDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,69,0,195,4,98,0,159,67,24,46,7,32,32,209,249,121,145,114,255,255,141,45,67,218,0,177,128,70,124,79,27,3,0,159,44,184,157,2,59,135,197,125,175,69,253,255,77,40,68,55,3,211,172,162,131,177,229,253,255,20,31,33,16,10,128,178,248,136,116,111,253,255,94,21,42,71,13,182,173,17,135,37,54,3,0,214,27,108,249,22,91,20,114,118,240,47,255,255,129,52,226,58,30,200,119, }; - - sbp_msg_obs_dep_a_t test_msg{}; - test_msg.header.n_obs = 32; - test_msg.header.t.tow = 407084800; - test_msg.header.t.wn = 1838; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 7; - - test_msg.obs[0].L.f = 141; - test_msg.obs[0].L.i = -36207; - test_msg.obs[0].P = 2046415136; - test_msg.obs[0].cn0 = 45; - test_msg.obs[0].lock = 55875; - test_msg.obs[0].prn = 0; - - test_msg.obs[1].L.f = 159; - test_msg.obs[1].L.i = 203599; - test_msg.obs[1].P = 2084995249; - test_msg.obs[1].cn0 = 44; - test_msg.obs[1].lock = 40376; - test_msg.obs[1].prn = 2; - - test_msg.obs[2].L.f = 77; - test_msg.obs[2].L.i = -178769; - test_msg.obs[2].P = 2110097211; - test_msg.obs[2].cn0 = 40; - test_msg.obs[2].lock = 14148; - test_msg.obs[2].prn = 3; - - test_msg.obs[3].L.f = 20; - test_msg.obs[3].L.i = -137807; - test_msg.obs[3].P = 2208476371; - test_msg.obs[3].cn0 = 31; - test_msg.obs[3].lock = 4129; - test_msg.obs[3].prn = 10; - - test_msg.obs[4].L.f = 94; - test_msg.obs[4].L.i = -168076; - test_msg.obs[4].P = 2298000000; - test_msg.obs[4].cn0 = 21; - test_msg.obs[4].lock = 18218; - test_msg.obs[4].prn = 13; - - test_msg.obs[5].L.f = 214; - test_msg.obs[5].L.i = 210469; - test_msg.obs[5].P = 2266082742; - test_msg.obs[5].cn0 = 27; - test_msg.obs[5].lock = 63852; - test_msg.obs[5].prn = 22; - - test_msg.obs[6].L.f = 129; - test_msg.obs[6].L.i = -53264; - test_msg.obs[6].P = 1987187803; - test_msg.obs[6].cn0 = 52; - test_msg.obs[6].lock = 15074; - test_msg.obs[6].prn = 30; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 32) << "incorrect value for last_msg_.header.n_obs, expected 32, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 407084800) << "incorrect value for last_msg_.header.t.tow, expected 407084800, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1838) << "incorrect value for last_msg_.header.t.wn, expected 1838, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 7) << "incorrect value for last_msg_.n_obs.value, expected 7, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 141) << "incorrect value for last_msg_.obs[0].L.f, expected 141, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, -36207) << "incorrect value for last_msg_.obs[0].L.i, expected -36207, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 2046415136) << "incorrect value for last_msg_.obs[0].P, expected 2046415136, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 45) << "incorrect value for last_msg_.obs[0].cn0, expected 45, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 55875) << "incorrect value for last_msg_.obs[0].lock, expected 55875, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].prn, 0) << "incorrect value for last_msg_.obs[0].prn, expected 0, is " << last_msg_.obs[0].prn; - EXPECT_EQ(last_msg_.obs[1].L.f, 159) << "incorrect value for last_msg_.obs[1].L.f, expected 159, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, 203599) << "incorrect value for last_msg_.obs[1].L.i, expected 203599, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 2084995249) << "incorrect value for last_msg_.obs[1].P, expected 2084995249, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].cn0, 44) << "incorrect value for last_msg_.obs[1].cn0, expected 44, is " << last_msg_.obs[1].cn0; - EXPECT_EQ(last_msg_.obs[1].lock, 40376) << "incorrect value for last_msg_.obs[1].lock, expected 40376, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].prn, 2) << "incorrect value for last_msg_.obs[1].prn, expected 2, is " << last_msg_.obs[1].prn; - EXPECT_EQ(last_msg_.obs[2].L.f, 77) << "incorrect value for last_msg_.obs[2].L.f, expected 77, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, -178769) << "incorrect value for last_msg_.obs[2].L.i, expected -178769, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 2110097211) << "incorrect value for last_msg_.obs[2].P, expected 2110097211, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].cn0, 40) << "incorrect value for last_msg_.obs[2].cn0, expected 40, is " << last_msg_.obs[2].cn0; - EXPECT_EQ(last_msg_.obs[2].lock, 14148) << "incorrect value for last_msg_.obs[2].lock, expected 14148, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].prn, 3) << "incorrect value for last_msg_.obs[2].prn, expected 3, is " << last_msg_.obs[2].prn; - EXPECT_EQ(last_msg_.obs[3].L.f, 20) << "incorrect value for last_msg_.obs[3].L.f, expected 20, is " << last_msg_.obs[3].L.f; - EXPECT_EQ(last_msg_.obs[3].L.i, -137807) << "incorrect value for last_msg_.obs[3].L.i, expected -137807, is " << last_msg_.obs[3].L.i; - EXPECT_EQ(last_msg_.obs[3].P, 2208476371) << "incorrect value for last_msg_.obs[3].P, expected 2208476371, is " << last_msg_.obs[3].P; - EXPECT_EQ(last_msg_.obs[3].cn0, 31) << "incorrect value for last_msg_.obs[3].cn0, expected 31, is " << last_msg_.obs[3].cn0; - EXPECT_EQ(last_msg_.obs[3].lock, 4129) << "incorrect value for last_msg_.obs[3].lock, expected 4129, is " << last_msg_.obs[3].lock; - EXPECT_EQ(last_msg_.obs[3].prn, 10) << "incorrect value for last_msg_.obs[3].prn, expected 10, is " << last_msg_.obs[3].prn; - EXPECT_EQ(last_msg_.obs[4].L.f, 94) << "incorrect value for last_msg_.obs[4].L.f, expected 94, is " << last_msg_.obs[4].L.f; - EXPECT_EQ(last_msg_.obs[4].L.i, -168076) << "incorrect value for last_msg_.obs[4].L.i, expected -168076, is " << last_msg_.obs[4].L.i; - EXPECT_EQ(last_msg_.obs[4].P, 2298000000) << "incorrect value for last_msg_.obs[4].P, expected 2298000000, is " << last_msg_.obs[4].P; - EXPECT_EQ(last_msg_.obs[4].cn0, 21) << "incorrect value for last_msg_.obs[4].cn0, expected 21, is " << last_msg_.obs[4].cn0; - EXPECT_EQ(last_msg_.obs[4].lock, 18218) << "incorrect value for last_msg_.obs[4].lock, expected 18218, is " << last_msg_.obs[4].lock; - EXPECT_EQ(last_msg_.obs[4].prn, 13) << "incorrect value for last_msg_.obs[4].prn, expected 13, is " << last_msg_.obs[4].prn; - EXPECT_EQ(last_msg_.obs[5].L.f, 214) << "incorrect value for last_msg_.obs[5].L.f, expected 214, is " << last_msg_.obs[5].L.f; - EXPECT_EQ(last_msg_.obs[5].L.i, 210469) << "incorrect value for last_msg_.obs[5].L.i, expected 210469, is " << last_msg_.obs[5].L.i; - EXPECT_EQ(last_msg_.obs[5].P, 2266082742) << "incorrect value for last_msg_.obs[5].P, expected 2266082742, is " << last_msg_.obs[5].P; - EXPECT_EQ(last_msg_.obs[5].cn0, 27) << "incorrect value for last_msg_.obs[5].cn0, expected 27, is " << last_msg_.obs[5].cn0; - EXPECT_EQ(last_msg_.obs[5].lock, 63852) << "incorrect value for last_msg_.obs[5].lock, expected 63852, is " << last_msg_.obs[5].lock; - EXPECT_EQ(last_msg_.obs[5].prn, 22) << "incorrect value for last_msg_.obs[5].prn, expected 22, is " << last_msg_.obs[5].prn; - EXPECT_EQ(last_msg_.obs[6].L.f, 129) << "incorrect value for last_msg_.obs[6].L.f, expected 129, is " << last_msg_.obs[6].L.f; - EXPECT_EQ(last_msg_.obs[6].L.i, -53264) << "incorrect value for last_msg_.obs[6].L.i, expected -53264, is " << last_msg_.obs[6].L.i; - EXPECT_EQ(last_msg_.obs[6].P, 1987187803) << "incorrect value for last_msg_.obs[6].P, expected 1987187803, is " << last_msg_.obs[6].P; - EXPECT_EQ(last_msg_.obs[6].cn0, 52) << "incorrect value for last_msg_.obs[6].cn0, expected 52, is " << last_msg_.obs[6].cn0; - EXPECT_EQ(last_msg_.obs[6].lock, 15074) << "incorrect value for last_msg_.obs[6].lock, expected 15074, is " << last_msg_.obs[6].lock; - EXPECT_EQ(last_msg_.obs[6].prn, 30) << "incorrect value for last_msg_.obs[6].prn, expected 30, is " << last_msg_.obs[6].prn; +}; + +TEST_F(Test_auto_check_sbp_observation_msgObsDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 69, 0, 195, 4, 98, 0, 159, 67, 24, 46, 7, 32, 32, + 209, 249, 121, 145, 114, 255, 255, 141, 45, 67, 218, 0, 177, 128, + 70, 124, 79, 27, 3, 0, 159, 44, 184, 157, 2, 59, 135, 197, + 125, 175, 69, 253, 255, 77, 40, 68, 55, 3, 211, 172, 162, 131, + 177, 229, 253, 255, 20, 31, 33, 16, 10, 128, 178, 248, 136, 116, + 111, 253, 255, 94, 21, 42, 71, 13, 182, 173, 17, 135, 37, 54, + 3, 0, 214, 27, 108, 249, 22, 91, 20, 114, 118, 240, 47, 255, + 255, 129, 52, 226, 58, 30, 200, 119, + }; + + sbp_msg_obs_dep_a_t test_msg{}; + test_msg.header.n_obs = 32; + test_msg.header.t.tow = 407084800; + test_msg.header.t.wn = 1838; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 7; + + test_msg.obs[0].L.f = 141; + test_msg.obs[0].L.i = -36207; + test_msg.obs[0].P = 2046415136; + test_msg.obs[0].cn0 = 45; + test_msg.obs[0].lock = 55875; + test_msg.obs[0].prn = 0; + + test_msg.obs[1].L.f = 159; + test_msg.obs[1].L.i = 203599; + test_msg.obs[1].P = 2084995249; + test_msg.obs[1].cn0 = 44; + test_msg.obs[1].lock = 40376; + test_msg.obs[1].prn = 2; + + test_msg.obs[2].L.f = 77; + test_msg.obs[2].L.i = -178769; + test_msg.obs[2].P = 2110097211; + test_msg.obs[2].cn0 = 40; + test_msg.obs[2].lock = 14148; + test_msg.obs[2].prn = 3; + + test_msg.obs[3].L.f = 20; + test_msg.obs[3].L.i = -137807; + test_msg.obs[3].P = 2208476371; + test_msg.obs[3].cn0 = 31; + test_msg.obs[3].lock = 4129; + test_msg.obs[3].prn = 10; + + test_msg.obs[4].L.f = 94; + test_msg.obs[4].L.i = -168076; + test_msg.obs[4].P = 2298000000; + test_msg.obs[4].cn0 = 21; + test_msg.obs[4].lock = 18218; + test_msg.obs[4].prn = 13; + + test_msg.obs[5].L.f = 214; + test_msg.obs[5].L.i = 210469; + test_msg.obs[5].P = 2266082742; + test_msg.obs[5].cn0 = 27; + test_msg.obs[5].lock = 63852; + test_msg.obs[5].prn = 22; + + test_msg.obs[6].L.f = 129; + test_msg.obs[6].L.i = -53264; + test_msg.obs[6].P = 1987187803; + test_msg.obs[6].cn0 = 52; + test_msg.obs[6].lock = 15074; + test_msg.obs[6].prn = 30; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 32) + << "incorrect value for last_msg_.header.n_obs, expected 32, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 407084800) + << "incorrect value for last_msg_.header.t.tow, expected 407084800, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1838) + << "incorrect value for last_msg_.header.t.wn, expected 1838, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 7) + << "incorrect value for last_msg_.n_obs.value, expected 7, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 141) + << "incorrect value for last_msg_.obs[0].L.f, expected 141, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, -36207) + << "incorrect value for last_msg_.obs[0].L.i, expected -36207, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 2046415136) + << "incorrect value for last_msg_.obs[0].P, expected 2046415136, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 45) + << "incorrect value for last_msg_.obs[0].cn0, expected 45, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 55875) + << "incorrect value for last_msg_.obs[0].lock, expected 55875, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].prn, 0) + << "incorrect value for last_msg_.obs[0].prn, expected 0, is " + << last_msg_.obs[0].prn; + EXPECT_EQ(last_msg_.obs[1].L.f, 159) + << "incorrect value for last_msg_.obs[1].L.f, expected 159, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, 203599) + << "incorrect value for last_msg_.obs[1].L.i, expected 203599, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 2084995249) + << "incorrect value for last_msg_.obs[1].P, expected 2084995249, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].cn0, 44) + << "incorrect value for last_msg_.obs[1].cn0, expected 44, is " + << last_msg_.obs[1].cn0; + EXPECT_EQ(last_msg_.obs[1].lock, 40376) + << "incorrect value for last_msg_.obs[1].lock, expected 40376, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].prn, 2) + << "incorrect value for last_msg_.obs[1].prn, expected 2, is " + << last_msg_.obs[1].prn; + EXPECT_EQ(last_msg_.obs[2].L.f, 77) + << "incorrect value for last_msg_.obs[2].L.f, expected 77, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, -178769) + << "incorrect value for last_msg_.obs[2].L.i, expected -178769, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 2110097211) + << "incorrect value for last_msg_.obs[2].P, expected 2110097211, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].cn0, 40) + << "incorrect value for last_msg_.obs[2].cn0, expected 40, is " + << last_msg_.obs[2].cn0; + EXPECT_EQ(last_msg_.obs[2].lock, 14148) + << "incorrect value for last_msg_.obs[2].lock, expected 14148, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].prn, 3) + << "incorrect value for last_msg_.obs[2].prn, expected 3, is " + << last_msg_.obs[2].prn; + EXPECT_EQ(last_msg_.obs[3].L.f, 20) + << "incorrect value for last_msg_.obs[3].L.f, expected 20, is " + << last_msg_.obs[3].L.f; + EXPECT_EQ(last_msg_.obs[3].L.i, -137807) + << "incorrect value for last_msg_.obs[3].L.i, expected -137807, is " + << last_msg_.obs[3].L.i; + EXPECT_EQ(last_msg_.obs[3].P, 2208476371) + << "incorrect value for last_msg_.obs[3].P, expected 2208476371, is " + << last_msg_.obs[3].P; + EXPECT_EQ(last_msg_.obs[3].cn0, 31) + << "incorrect value for last_msg_.obs[3].cn0, expected 31, is " + << last_msg_.obs[3].cn0; + EXPECT_EQ(last_msg_.obs[3].lock, 4129) + << "incorrect value for last_msg_.obs[3].lock, expected 4129, is " + << last_msg_.obs[3].lock; + EXPECT_EQ(last_msg_.obs[3].prn, 10) + << "incorrect value for last_msg_.obs[3].prn, expected 10, is " + << last_msg_.obs[3].prn; + EXPECT_EQ(last_msg_.obs[4].L.f, 94) + << "incorrect value for last_msg_.obs[4].L.f, expected 94, is " + << last_msg_.obs[4].L.f; + EXPECT_EQ(last_msg_.obs[4].L.i, -168076) + << "incorrect value for last_msg_.obs[4].L.i, expected -168076, is " + << last_msg_.obs[4].L.i; + EXPECT_EQ(last_msg_.obs[4].P, 2298000000) + << "incorrect value for last_msg_.obs[4].P, expected 2298000000, is " + << last_msg_.obs[4].P; + EXPECT_EQ(last_msg_.obs[4].cn0, 21) + << "incorrect value for last_msg_.obs[4].cn0, expected 21, is " + << last_msg_.obs[4].cn0; + EXPECT_EQ(last_msg_.obs[4].lock, 18218) + << "incorrect value for last_msg_.obs[4].lock, expected 18218, is " + << last_msg_.obs[4].lock; + EXPECT_EQ(last_msg_.obs[4].prn, 13) + << "incorrect value for last_msg_.obs[4].prn, expected 13, is " + << last_msg_.obs[4].prn; + EXPECT_EQ(last_msg_.obs[5].L.f, 214) + << "incorrect value for last_msg_.obs[5].L.f, expected 214, is " + << last_msg_.obs[5].L.f; + EXPECT_EQ(last_msg_.obs[5].L.i, 210469) + << "incorrect value for last_msg_.obs[5].L.i, expected 210469, is " + << last_msg_.obs[5].L.i; + EXPECT_EQ(last_msg_.obs[5].P, 2266082742) + << "incorrect value for last_msg_.obs[5].P, expected 2266082742, is " + << last_msg_.obs[5].P; + EXPECT_EQ(last_msg_.obs[5].cn0, 27) + << "incorrect value for last_msg_.obs[5].cn0, expected 27, is " + << last_msg_.obs[5].cn0; + EXPECT_EQ(last_msg_.obs[5].lock, 63852) + << "incorrect value for last_msg_.obs[5].lock, expected 63852, is " + << last_msg_.obs[5].lock; + EXPECT_EQ(last_msg_.obs[5].prn, 22) + << "incorrect value for last_msg_.obs[5].prn, expected 22, is " + << last_msg_.obs[5].prn; + EXPECT_EQ(last_msg_.obs[6].L.f, 129) + << "incorrect value for last_msg_.obs[6].L.f, expected 129, is " + << last_msg_.obs[6].L.f; + EXPECT_EQ(last_msg_.obs[6].L.i, -53264) + << "incorrect value for last_msg_.obs[6].L.i, expected -53264, is " + << last_msg_.obs[6].L.i; + EXPECT_EQ(last_msg_.obs[6].P, 1987187803) + << "incorrect value for last_msg_.obs[6].P, expected 1987187803, is " + << last_msg_.obs[6].P; + EXPECT_EQ(last_msg_.obs[6].cn0, 52) + << "incorrect value for last_msg_.obs[6].cn0, expected 52, is " + << last_msg_.obs[6].cn0; + EXPECT_EQ(last_msg_.obs[6].lock, 15074) + << "incorrect value for last_msg_.obs[6].lock, expected 15074, is " + << last_msg_.obs[6].lock; + EXPECT_EQ(last_msg_.obs[6].prn, 30) + << "incorrect value for last_msg_.obs[6].prn, expected 30, is " + << last_msg_.obs[6].prn; } -class Test_auto_check_sbp_observation_msgObsDepA3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_msgObsDepA3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_msgObsDepA3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_msgObsDepA3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -581,117 +814,144 @@ class Test_auto_check_sbp_observation_msgObsDepA3 : sbp_msg_obs_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_msgObsDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,69,0,195,4,20,0,159,67,24,46,7,33,49,19,164,117,120,32,0,0,222,63,62,250,31,11,231, }; - - sbp_msg_obs_dep_a_t test_msg{}; - test_msg.header.n_obs = 33; - test_msg.header.t.tow = 407084800; - test_msg.header.t.wn = 1838; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 1; - - test_msg.obs[0].L.f = 222; - test_msg.obs[0].L.i = 8312; - test_msg.obs[0].P = 1973687089; - test_msg.obs[0].cn0 = 63; - test_msg.obs[0].lock = 64062; - test_msg.obs[0].prn = 31; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 33) << "incorrect value for last_msg_.header.n_obs, expected 33, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 407084800) << "incorrect value for last_msg_.header.t.tow, expected 407084800, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1838) << "incorrect value for last_msg_.header.t.wn, expected 1838, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 1) << "incorrect value for last_msg_.n_obs.value, expected 1, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 222) << "incorrect value for last_msg_.obs[0].L.f, expected 222, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, 8312) << "incorrect value for last_msg_.obs[0].L.i, expected 8312, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 1973687089) << "incorrect value for last_msg_.obs[0].P, expected 1973687089, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 63) << "incorrect value for last_msg_.obs[0].cn0, expected 63, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 64062) << "incorrect value for last_msg_.obs[0].lock, expected 64062, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].prn, 31) << "incorrect value for last_msg_.obs[0].prn, expected 31, is " << last_msg_.obs[0].prn; +}; + +TEST_F(Test_auto_check_sbp_observation_msgObsDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 69, 0, 195, 4, 20, 0, 159, 67, 24, 46, 7, 33, 49, + 19, 164, 117, 120, 32, 0, 0, 222, 63, 62, 250, 31, 11, 231, + }; + + sbp_msg_obs_dep_a_t test_msg{}; + test_msg.header.n_obs = 33; + test_msg.header.t.tow = 407084800; + test_msg.header.t.wn = 1838; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 1; + + test_msg.obs[0].L.f = 222; + test_msg.obs[0].L.i = 8312; + test_msg.obs[0].P = 1973687089; + test_msg.obs[0].cn0 = 63; + test_msg.obs[0].lock = 64062; + test_msg.obs[0].prn = 31; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 33) + << "incorrect value for last_msg_.header.n_obs, expected 33, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 407084800) + << "incorrect value for last_msg_.header.t.tow, expected 407084800, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1838) + << "incorrect value for last_msg_.header.t.wn, expected 1838, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 1) + << "incorrect value for last_msg_.n_obs.value, expected 1, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 222) + << "incorrect value for last_msg_.obs[0].L.f, expected 222, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, 8312) + << "incorrect value for last_msg_.obs[0].L.i, expected 8312, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 1973687089) + << "incorrect value for last_msg_.obs[0].P, expected 1973687089, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 63) + << "incorrect value for last_msg_.obs[0].cn0, expected 63, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 64062) + << "incorrect value for last_msg_.obs[0].lock, expected 64062, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].prn, 31) + << "incorrect value for last_msg_.obs[0].prn, expected 31, is " + << last_msg_.obs[0].prn; } -class Test_auto_check_sbp_observation_msgObsDepA4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_msgObsDepA4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_msgObsDepA4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_msgObsDepA4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -699,169 +959,248 @@ class Test_auto_check_sbp_observation_msgObsDepA4 : sbp_msg_obs_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_msgObsDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,69,0,195,4,72,96,162,68,24,46,7,16,87,132,217,121,121,148,255,255,189,43,175,147,0,132,64,200,125,106,31,254,255,1,41,14,177,3,128,178,248,136,70,68,254,255,166,18,184,133,13,24,127,178,134,6,25,2,0,249,28,33,96,22,170,104,86,118,67,112,255,255,203,56,208,88,30,43,107, }; - - sbp_msg_obs_dep_a_t test_msg{}; - test_msg.header.n_obs = 16; - test_msg.header.t.tow = 407151200; - test_msg.header.t.wn = 1838; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 5; - - test_msg.obs[0].L.f = 189; - test_msg.obs[0].L.i = -27527; - test_msg.obs[0].P = 2044298327; - test_msg.obs[0].cn0 = 43; - test_msg.obs[0].lock = 37807; - test_msg.obs[0].prn = 0; - - test_msg.obs[1].L.f = 1; - test_msg.obs[1].L.i = -123030; - test_msg.obs[1].P = 2110275716; - test_msg.obs[1].cn0 = 41; - test_msg.obs[1].lock = 45326; - test_msg.obs[1].prn = 3; - - test_msg.obs[2].L.f = 166; - test_msg.obs[2].L.i = -113594; - test_msg.obs[2].P = 2298000000; - test_msg.obs[2].cn0 = 18; - test_msg.obs[2].lock = 34232; - test_msg.obs[2].prn = 13; - - test_msg.obs[3].L.f = 249; - test_msg.obs[3].L.i = 137478; - test_msg.obs[3].P = 2259844888; - test_msg.obs[3].cn0 = 28; - test_msg.obs[3].lock = 24609; - test_msg.obs[3].prn = 22; - - test_msg.obs[4].L.f = 203; - test_msg.obs[4].L.i = -36797; - test_msg.obs[4].P = 1985374378; - test_msg.obs[4].cn0 = 56; - test_msg.obs[4].lock = 22736; - test_msg.obs[4].prn = 30; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 16) << "incorrect value for last_msg_.header.n_obs, expected 16, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 407151200) << "incorrect value for last_msg_.header.t.tow, expected 407151200, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1838) << "incorrect value for last_msg_.header.t.wn, expected 1838, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 5) << "incorrect value for last_msg_.n_obs.value, expected 5, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 189) << "incorrect value for last_msg_.obs[0].L.f, expected 189, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, -27527) << "incorrect value for last_msg_.obs[0].L.i, expected -27527, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 2044298327) << "incorrect value for last_msg_.obs[0].P, expected 2044298327, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 43) << "incorrect value for last_msg_.obs[0].cn0, expected 43, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 37807) << "incorrect value for last_msg_.obs[0].lock, expected 37807, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].prn, 0) << "incorrect value for last_msg_.obs[0].prn, expected 0, is " << last_msg_.obs[0].prn; - EXPECT_EQ(last_msg_.obs[1].L.f, 1) << "incorrect value for last_msg_.obs[1].L.f, expected 1, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, -123030) << "incorrect value for last_msg_.obs[1].L.i, expected -123030, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 2110275716) << "incorrect value for last_msg_.obs[1].P, expected 2110275716, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].cn0, 41) << "incorrect value for last_msg_.obs[1].cn0, expected 41, is " << last_msg_.obs[1].cn0; - EXPECT_EQ(last_msg_.obs[1].lock, 45326) << "incorrect value for last_msg_.obs[1].lock, expected 45326, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].prn, 3) << "incorrect value for last_msg_.obs[1].prn, expected 3, is " << last_msg_.obs[1].prn; - EXPECT_EQ(last_msg_.obs[2].L.f, 166) << "incorrect value for last_msg_.obs[2].L.f, expected 166, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, -113594) << "incorrect value for last_msg_.obs[2].L.i, expected -113594, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 2298000000) << "incorrect value for last_msg_.obs[2].P, expected 2298000000, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].cn0, 18) << "incorrect value for last_msg_.obs[2].cn0, expected 18, is " << last_msg_.obs[2].cn0; - EXPECT_EQ(last_msg_.obs[2].lock, 34232) << "incorrect value for last_msg_.obs[2].lock, expected 34232, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].prn, 13) << "incorrect value for last_msg_.obs[2].prn, expected 13, is " << last_msg_.obs[2].prn; - EXPECT_EQ(last_msg_.obs[3].L.f, 249) << "incorrect value for last_msg_.obs[3].L.f, expected 249, is " << last_msg_.obs[3].L.f; - EXPECT_EQ(last_msg_.obs[3].L.i, 137478) << "incorrect value for last_msg_.obs[3].L.i, expected 137478, is " << last_msg_.obs[3].L.i; - EXPECT_EQ(last_msg_.obs[3].P, 2259844888) << "incorrect value for last_msg_.obs[3].P, expected 2259844888, is " << last_msg_.obs[3].P; - EXPECT_EQ(last_msg_.obs[3].cn0, 28) << "incorrect value for last_msg_.obs[3].cn0, expected 28, is " << last_msg_.obs[3].cn0; - EXPECT_EQ(last_msg_.obs[3].lock, 24609) << "incorrect value for last_msg_.obs[3].lock, expected 24609, is " << last_msg_.obs[3].lock; - EXPECT_EQ(last_msg_.obs[3].prn, 22) << "incorrect value for last_msg_.obs[3].prn, expected 22, is " << last_msg_.obs[3].prn; - EXPECT_EQ(last_msg_.obs[4].L.f, 203) << "incorrect value for last_msg_.obs[4].L.f, expected 203, is " << last_msg_.obs[4].L.f; - EXPECT_EQ(last_msg_.obs[4].L.i, -36797) << "incorrect value for last_msg_.obs[4].L.i, expected -36797, is " << last_msg_.obs[4].L.i; - EXPECT_EQ(last_msg_.obs[4].P, 1985374378) << "incorrect value for last_msg_.obs[4].P, expected 1985374378, is " << last_msg_.obs[4].P; - EXPECT_EQ(last_msg_.obs[4].cn0, 56) << "incorrect value for last_msg_.obs[4].cn0, expected 56, is " << last_msg_.obs[4].cn0; - EXPECT_EQ(last_msg_.obs[4].lock, 22736) << "incorrect value for last_msg_.obs[4].lock, expected 22736, is " << last_msg_.obs[4].lock; - EXPECT_EQ(last_msg_.obs[4].prn, 30) << "incorrect value for last_msg_.obs[4].prn, expected 30, is " << last_msg_.obs[4].prn; +}; + +TEST_F(Test_auto_check_sbp_observation_msgObsDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 69, 0, 195, 4, 72, 96, 162, 68, 24, 46, 7, 16, 87, + 132, 217, 121, 121, 148, 255, 255, 189, 43, 175, 147, 0, 132, 64, + 200, 125, 106, 31, 254, 255, 1, 41, 14, 177, 3, 128, 178, 248, + 136, 70, 68, 254, 255, 166, 18, 184, 133, 13, 24, 127, 178, 134, + 6, 25, 2, 0, 249, 28, 33, 96, 22, 170, 104, 86, 118, 67, + 112, 255, 255, 203, 56, 208, 88, 30, 43, 107, + }; + + sbp_msg_obs_dep_a_t test_msg{}; + test_msg.header.n_obs = 16; + test_msg.header.t.tow = 407151200; + test_msg.header.t.wn = 1838; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 5; + + test_msg.obs[0].L.f = 189; + test_msg.obs[0].L.i = -27527; + test_msg.obs[0].P = 2044298327; + test_msg.obs[0].cn0 = 43; + test_msg.obs[0].lock = 37807; + test_msg.obs[0].prn = 0; + + test_msg.obs[1].L.f = 1; + test_msg.obs[1].L.i = -123030; + test_msg.obs[1].P = 2110275716; + test_msg.obs[1].cn0 = 41; + test_msg.obs[1].lock = 45326; + test_msg.obs[1].prn = 3; + + test_msg.obs[2].L.f = 166; + test_msg.obs[2].L.i = -113594; + test_msg.obs[2].P = 2298000000; + test_msg.obs[2].cn0 = 18; + test_msg.obs[2].lock = 34232; + test_msg.obs[2].prn = 13; + + test_msg.obs[3].L.f = 249; + test_msg.obs[3].L.i = 137478; + test_msg.obs[3].P = 2259844888; + test_msg.obs[3].cn0 = 28; + test_msg.obs[3].lock = 24609; + test_msg.obs[3].prn = 22; + + test_msg.obs[4].L.f = 203; + test_msg.obs[4].L.i = -36797; + test_msg.obs[4].P = 1985374378; + test_msg.obs[4].cn0 = 56; + test_msg.obs[4].lock = 22736; + test_msg.obs[4].prn = 30; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 16) + << "incorrect value for last_msg_.header.n_obs, expected 16, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 407151200) + << "incorrect value for last_msg_.header.t.tow, expected 407151200, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1838) + << "incorrect value for last_msg_.header.t.wn, expected 1838, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 5) + << "incorrect value for last_msg_.n_obs.value, expected 5, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 189) + << "incorrect value for last_msg_.obs[0].L.f, expected 189, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, -27527) + << "incorrect value for last_msg_.obs[0].L.i, expected -27527, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 2044298327) + << "incorrect value for last_msg_.obs[0].P, expected 2044298327, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 43) + << "incorrect value for last_msg_.obs[0].cn0, expected 43, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 37807) + << "incorrect value for last_msg_.obs[0].lock, expected 37807, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].prn, 0) + << "incorrect value for last_msg_.obs[0].prn, expected 0, is " + << last_msg_.obs[0].prn; + EXPECT_EQ(last_msg_.obs[1].L.f, 1) + << "incorrect value for last_msg_.obs[1].L.f, expected 1, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, -123030) + << "incorrect value for last_msg_.obs[1].L.i, expected -123030, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 2110275716) + << "incorrect value for last_msg_.obs[1].P, expected 2110275716, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].cn0, 41) + << "incorrect value for last_msg_.obs[1].cn0, expected 41, is " + << last_msg_.obs[1].cn0; + EXPECT_EQ(last_msg_.obs[1].lock, 45326) + << "incorrect value for last_msg_.obs[1].lock, expected 45326, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].prn, 3) + << "incorrect value for last_msg_.obs[1].prn, expected 3, is " + << last_msg_.obs[1].prn; + EXPECT_EQ(last_msg_.obs[2].L.f, 166) + << "incorrect value for last_msg_.obs[2].L.f, expected 166, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, -113594) + << "incorrect value for last_msg_.obs[2].L.i, expected -113594, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 2298000000) + << "incorrect value for last_msg_.obs[2].P, expected 2298000000, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].cn0, 18) + << "incorrect value for last_msg_.obs[2].cn0, expected 18, is " + << last_msg_.obs[2].cn0; + EXPECT_EQ(last_msg_.obs[2].lock, 34232) + << "incorrect value for last_msg_.obs[2].lock, expected 34232, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].prn, 13) + << "incorrect value for last_msg_.obs[2].prn, expected 13, is " + << last_msg_.obs[2].prn; + EXPECT_EQ(last_msg_.obs[3].L.f, 249) + << "incorrect value for last_msg_.obs[3].L.f, expected 249, is " + << last_msg_.obs[3].L.f; + EXPECT_EQ(last_msg_.obs[3].L.i, 137478) + << "incorrect value for last_msg_.obs[3].L.i, expected 137478, is " + << last_msg_.obs[3].L.i; + EXPECT_EQ(last_msg_.obs[3].P, 2259844888) + << "incorrect value for last_msg_.obs[3].P, expected 2259844888, is " + << last_msg_.obs[3].P; + EXPECT_EQ(last_msg_.obs[3].cn0, 28) + << "incorrect value for last_msg_.obs[3].cn0, expected 28, is " + << last_msg_.obs[3].cn0; + EXPECT_EQ(last_msg_.obs[3].lock, 24609) + << "incorrect value for last_msg_.obs[3].lock, expected 24609, is " + << last_msg_.obs[3].lock; + EXPECT_EQ(last_msg_.obs[3].prn, 22) + << "incorrect value for last_msg_.obs[3].prn, expected 22, is " + << last_msg_.obs[3].prn; + EXPECT_EQ(last_msg_.obs[4].L.f, 203) + << "incorrect value for last_msg_.obs[4].L.f, expected 203, is " + << last_msg_.obs[4].L.f; + EXPECT_EQ(last_msg_.obs[4].L.i, -36797) + << "incorrect value for last_msg_.obs[4].L.i, expected -36797, is " + << last_msg_.obs[4].L.i; + EXPECT_EQ(last_msg_.obs[4].P, 1985374378) + << "incorrect value for last_msg_.obs[4].P, expected 1985374378, is " + << last_msg_.obs[4].P; + EXPECT_EQ(last_msg_.obs[4].cn0, 56) + << "incorrect value for last_msg_.obs[4].cn0, expected 56, is " + << last_msg_.obs[4].cn0; + EXPECT_EQ(last_msg_.obs[4].lock, 22736) + << "incorrect value for last_msg_.obs[4].lock, expected 22736, is " + << last_msg_.obs[4].lock; + EXPECT_EQ(last_msg_.obs[4].prn, 30) + << "incorrect value for last_msg_.obs[4].prn, expected 30, is " + << last_msg_.obs[4].prn; } -class Test_auto_check_sbp_observation_msgObsDepA5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_observation_msgObsDepA5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_observation_msgObsDepA5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_observation_msgObsDepA5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_obs_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_obs_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -869,119 +1208,204 @@ class Test_auto_check_sbp_observation_msgObsDepA5 : sbp_msg_obs_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_observation_msgObsDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,69,0,195,4,72,40,163,68,24,46,7,16,132,107,217,121,14,148,255,255,1,44,175,147,0,129,66,200,125,148,29,254,255,153,41,14,177,3,128,178,248,136,143,66,254,255,222,18,184,133,13,158,53,178,134,42,27,2,0,237,30,33,96,22,38,83,86,118,168,111,255,255,45,56,208,88,30,1,175, }; - - sbp_msg_obs_dep_a_t test_msg{}; - test_msg.header.n_obs = 16; - test_msg.header.t.tow = 407151400; - test_msg.header.t.wn = 1838; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)98,(char)115 }; - memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_obs.value = 5; - - test_msg.obs[0].L.f = 1; - test_msg.obs[0].L.i = -27634; - test_msg.obs[0].P = 2044291972; - test_msg.obs[0].cn0 = 44; - test_msg.obs[0].lock = 37807; - test_msg.obs[0].prn = 0; - - test_msg.obs[1].L.f = 153; - test_msg.obs[1].L.i = -123500; - test_msg.obs[1].P = 2110276225; - test_msg.obs[1].cn0 = 41; - test_msg.obs[1].lock = 45326; - test_msg.obs[1].prn = 3; - - test_msg.obs[2].L.f = 222; - test_msg.obs[2].L.i = -114033; - test_msg.obs[2].P = 2298000000; - test_msg.obs[2].cn0 = 18; - test_msg.obs[2].lock = 34232; - test_msg.obs[2].prn = 13; - - test_msg.obs[3].L.f = 237; - test_msg.obs[3].L.i = 138026; - test_msg.obs[3].P = 2259826078; - test_msg.obs[3].cn0 = 30; - test_msg.obs[3].lock = 24609; - test_msg.obs[3].prn = 22; - - test_msg.obs[4].L.f = 45; - test_msg.obs[4].L.i = -36952; - test_msg.obs[4].P = 1985368870; - test_msg.obs[4].cn0 = 56; - test_msg.obs[4].lock = 22736; - test_msg.obs[4].prn = 30; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.n_obs, 16) << "incorrect value for last_msg_.header.n_obs, expected 16, is " << last_msg_.header.n_obs; - EXPECT_EQ(last_msg_.header.t.tow, 407151400) << "incorrect value for last_msg_.header.t.tow, expected 407151400, is " << last_msg_.header.t.tow; - EXPECT_EQ(last_msg_.header.t.wn, 1838) << "incorrect value for last_msg_.header.t.wn, expected 1838, is " << last_msg_.header.t.wn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)98,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_obs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_obs.value, 5) << "incorrect value for last_msg_.n_obs.value, expected 5, is " << last_msg_.n_obs.value; - EXPECT_EQ(last_msg_.obs[0].L.f, 1) << "incorrect value for last_msg_.obs[0].L.f, expected 1, is " << last_msg_.obs[0].L.f; - EXPECT_EQ(last_msg_.obs[0].L.i, -27634) << "incorrect value for last_msg_.obs[0].L.i, expected -27634, is " << last_msg_.obs[0].L.i; - EXPECT_EQ(last_msg_.obs[0].P, 2044291972) << "incorrect value for last_msg_.obs[0].P, expected 2044291972, is " << last_msg_.obs[0].P; - EXPECT_EQ(last_msg_.obs[0].cn0, 44) << "incorrect value for last_msg_.obs[0].cn0, expected 44, is " << last_msg_.obs[0].cn0; - EXPECT_EQ(last_msg_.obs[0].lock, 37807) << "incorrect value for last_msg_.obs[0].lock, expected 37807, is " << last_msg_.obs[0].lock; - EXPECT_EQ(last_msg_.obs[0].prn, 0) << "incorrect value for last_msg_.obs[0].prn, expected 0, is " << last_msg_.obs[0].prn; - EXPECT_EQ(last_msg_.obs[1].L.f, 153) << "incorrect value for last_msg_.obs[1].L.f, expected 153, is " << last_msg_.obs[1].L.f; - EXPECT_EQ(last_msg_.obs[1].L.i, -123500) << "incorrect value for last_msg_.obs[1].L.i, expected -123500, is " << last_msg_.obs[1].L.i; - EXPECT_EQ(last_msg_.obs[1].P, 2110276225) << "incorrect value for last_msg_.obs[1].P, expected 2110276225, is " << last_msg_.obs[1].P; - EXPECT_EQ(last_msg_.obs[1].cn0, 41) << "incorrect value for last_msg_.obs[1].cn0, expected 41, is " << last_msg_.obs[1].cn0; - EXPECT_EQ(last_msg_.obs[1].lock, 45326) << "incorrect value for last_msg_.obs[1].lock, expected 45326, is " << last_msg_.obs[1].lock; - EXPECT_EQ(last_msg_.obs[1].prn, 3) << "incorrect value for last_msg_.obs[1].prn, expected 3, is " << last_msg_.obs[1].prn; - EXPECT_EQ(last_msg_.obs[2].L.f, 222) << "incorrect value for last_msg_.obs[2].L.f, expected 222, is " << last_msg_.obs[2].L.f; - EXPECT_EQ(last_msg_.obs[2].L.i, -114033) << "incorrect value for last_msg_.obs[2].L.i, expected -114033, is " << last_msg_.obs[2].L.i; - EXPECT_EQ(last_msg_.obs[2].P, 2298000000) << "incorrect value for last_msg_.obs[2].P, expected 2298000000, is " << last_msg_.obs[2].P; - EXPECT_EQ(last_msg_.obs[2].cn0, 18) << "incorrect value for last_msg_.obs[2].cn0, expected 18, is " << last_msg_.obs[2].cn0; - EXPECT_EQ(last_msg_.obs[2].lock, 34232) << "incorrect value for last_msg_.obs[2].lock, expected 34232, is " << last_msg_.obs[2].lock; - EXPECT_EQ(last_msg_.obs[2].prn, 13) << "incorrect value for last_msg_.obs[2].prn, expected 13, is " << last_msg_.obs[2].prn; - EXPECT_EQ(last_msg_.obs[3].L.f, 237) << "incorrect value for last_msg_.obs[3].L.f, expected 237, is " << last_msg_.obs[3].L.f; - EXPECT_EQ(last_msg_.obs[3].L.i, 138026) << "incorrect value for last_msg_.obs[3].L.i, expected 138026, is " << last_msg_.obs[3].L.i; - EXPECT_EQ(last_msg_.obs[3].P, 2259826078) << "incorrect value for last_msg_.obs[3].P, expected 2259826078, is " << last_msg_.obs[3].P; - EXPECT_EQ(last_msg_.obs[3].cn0, 30) << "incorrect value for last_msg_.obs[3].cn0, expected 30, is " << last_msg_.obs[3].cn0; - EXPECT_EQ(last_msg_.obs[3].lock, 24609) << "incorrect value for last_msg_.obs[3].lock, expected 24609, is " << last_msg_.obs[3].lock; - EXPECT_EQ(last_msg_.obs[3].prn, 22) << "incorrect value for last_msg_.obs[3].prn, expected 22, is " << last_msg_.obs[3].prn; - EXPECT_EQ(last_msg_.obs[4].L.f, 45) << "incorrect value for last_msg_.obs[4].L.f, expected 45, is " << last_msg_.obs[4].L.f; - EXPECT_EQ(last_msg_.obs[4].L.i, -36952) << "incorrect value for last_msg_.obs[4].L.i, expected -36952, is " << last_msg_.obs[4].L.i; - EXPECT_EQ(last_msg_.obs[4].P, 1985368870) << "incorrect value for last_msg_.obs[4].P, expected 1985368870, is " << last_msg_.obs[4].P; - EXPECT_EQ(last_msg_.obs[4].cn0, 56) << "incorrect value for last_msg_.obs[4].cn0, expected 56, is " << last_msg_.obs[4].cn0; - EXPECT_EQ(last_msg_.obs[4].lock, 22736) << "incorrect value for last_msg_.obs[4].lock, expected 22736, is " << last_msg_.obs[4].lock; - EXPECT_EQ(last_msg_.obs[4].prn, 30) << "incorrect value for last_msg_.obs[4].prn, expected 30, is " << last_msg_.obs[4].prn; +}; + +TEST_F(Test_auto_check_sbp_observation_msgObsDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 69, 0, 195, 4, 72, 40, 163, 68, 24, 46, 7, 16, 132, + 107, 217, 121, 14, 148, 255, 255, 1, 44, 175, 147, 0, 129, 66, + 200, 125, 148, 29, 254, 255, 153, 41, 14, 177, 3, 128, 178, 248, + 136, 143, 66, 254, 255, 222, 18, 184, 133, 13, 158, 53, 178, 134, + 42, 27, 2, 0, 237, 30, 33, 96, 22, 38, 83, 86, 118, 168, + 111, 255, 255, 45, 56, 208, 88, 30, 1, 175, + }; + + sbp_msg_obs_dep_a_t test_msg{}; + test_msg.header.n_obs = 16; + test_msg.header.t.tow = 407151400; + test_msg.header.t.wn = 1838; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_obs.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)111, (char)98, (char)115}; + memcpy(test_msg.n_obs.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_obs.value = 5; + + test_msg.obs[0].L.f = 1; + test_msg.obs[0].L.i = -27634; + test_msg.obs[0].P = 2044291972; + test_msg.obs[0].cn0 = 44; + test_msg.obs[0].lock = 37807; + test_msg.obs[0].prn = 0; + + test_msg.obs[1].L.f = 153; + test_msg.obs[1].L.i = -123500; + test_msg.obs[1].P = 2110276225; + test_msg.obs[1].cn0 = 41; + test_msg.obs[1].lock = 45326; + test_msg.obs[1].prn = 3; + + test_msg.obs[2].L.f = 222; + test_msg.obs[2].L.i = -114033; + test_msg.obs[2].P = 2298000000; + test_msg.obs[2].cn0 = 18; + test_msg.obs[2].lock = 34232; + test_msg.obs[2].prn = 13; + + test_msg.obs[3].L.f = 237; + test_msg.obs[3].L.i = 138026; + test_msg.obs[3].P = 2259826078; + test_msg.obs[3].cn0 = 30; + test_msg.obs[3].lock = 24609; + test_msg.obs[3].prn = 22; + + test_msg.obs[4].L.f = 45; + test_msg.obs[4].L.i = -36952; + test_msg.obs[4].P = 1985368870; + test_msg.obs[4].cn0 = 56; + test_msg.obs[4].lock = 22736; + test_msg.obs[4].prn = 30; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.n_obs, 16) + << "incorrect value for last_msg_.header.n_obs, expected 16, is " + << last_msg_.header.n_obs; + EXPECT_EQ(last_msg_.header.t.tow, 407151400) + << "incorrect value for last_msg_.header.t.tow, expected 407151400, is " + << last_msg_.header.t.tow; + EXPECT_EQ(last_msg_.header.t.wn, 1838) + << "incorrect value for last_msg_.header.t.wn, expected 1838, is " + << last_msg_.header.t.wn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_obs.handle_as << "'"; + } + { + const char check_string[] = {(char)111, (char)98, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_obs.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_obs.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_obs.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_obs.value, 5) + << "incorrect value for last_msg_.n_obs.value, expected 5, is " + << last_msg_.n_obs.value; + EXPECT_EQ(last_msg_.obs[0].L.f, 1) + << "incorrect value for last_msg_.obs[0].L.f, expected 1, is " + << last_msg_.obs[0].L.f; + EXPECT_EQ(last_msg_.obs[0].L.i, -27634) + << "incorrect value for last_msg_.obs[0].L.i, expected -27634, is " + << last_msg_.obs[0].L.i; + EXPECT_EQ(last_msg_.obs[0].P, 2044291972) + << "incorrect value for last_msg_.obs[0].P, expected 2044291972, is " + << last_msg_.obs[0].P; + EXPECT_EQ(last_msg_.obs[0].cn0, 44) + << "incorrect value for last_msg_.obs[0].cn0, expected 44, is " + << last_msg_.obs[0].cn0; + EXPECT_EQ(last_msg_.obs[0].lock, 37807) + << "incorrect value for last_msg_.obs[0].lock, expected 37807, is " + << last_msg_.obs[0].lock; + EXPECT_EQ(last_msg_.obs[0].prn, 0) + << "incorrect value for last_msg_.obs[0].prn, expected 0, is " + << last_msg_.obs[0].prn; + EXPECT_EQ(last_msg_.obs[1].L.f, 153) + << "incorrect value for last_msg_.obs[1].L.f, expected 153, is " + << last_msg_.obs[1].L.f; + EXPECT_EQ(last_msg_.obs[1].L.i, -123500) + << "incorrect value for last_msg_.obs[1].L.i, expected -123500, is " + << last_msg_.obs[1].L.i; + EXPECT_EQ(last_msg_.obs[1].P, 2110276225) + << "incorrect value for last_msg_.obs[1].P, expected 2110276225, is " + << last_msg_.obs[1].P; + EXPECT_EQ(last_msg_.obs[1].cn0, 41) + << "incorrect value for last_msg_.obs[1].cn0, expected 41, is " + << last_msg_.obs[1].cn0; + EXPECT_EQ(last_msg_.obs[1].lock, 45326) + << "incorrect value for last_msg_.obs[1].lock, expected 45326, is " + << last_msg_.obs[1].lock; + EXPECT_EQ(last_msg_.obs[1].prn, 3) + << "incorrect value for last_msg_.obs[1].prn, expected 3, is " + << last_msg_.obs[1].prn; + EXPECT_EQ(last_msg_.obs[2].L.f, 222) + << "incorrect value for last_msg_.obs[2].L.f, expected 222, is " + << last_msg_.obs[2].L.f; + EXPECT_EQ(last_msg_.obs[2].L.i, -114033) + << "incorrect value for last_msg_.obs[2].L.i, expected -114033, is " + << last_msg_.obs[2].L.i; + EXPECT_EQ(last_msg_.obs[2].P, 2298000000) + << "incorrect value for last_msg_.obs[2].P, expected 2298000000, is " + << last_msg_.obs[2].P; + EXPECT_EQ(last_msg_.obs[2].cn0, 18) + << "incorrect value for last_msg_.obs[2].cn0, expected 18, is " + << last_msg_.obs[2].cn0; + EXPECT_EQ(last_msg_.obs[2].lock, 34232) + << "incorrect value for last_msg_.obs[2].lock, expected 34232, is " + << last_msg_.obs[2].lock; + EXPECT_EQ(last_msg_.obs[2].prn, 13) + << "incorrect value for last_msg_.obs[2].prn, expected 13, is " + << last_msg_.obs[2].prn; + EXPECT_EQ(last_msg_.obs[3].L.f, 237) + << "incorrect value for last_msg_.obs[3].L.f, expected 237, is " + << last_msg_.obs[3].L.f; + EXPECT_EQ(last_msg_.obs[3].L.i, 138026) + << "incorrect value for last_msg_.obs[3].L.i, expected 138026, is " + << last_msg_.obs[3].L.i; + EXPECT_EQ(last_msg_.obs[3].P, 2259826078) + << "incorrect value for last_msg_.obs[3].P, expected 2259826078, is " + << last_msg_.obs[3].P; + EXPECT_EQ(last_msg_.obs[3].cn0, 30) + << "incorrect value for last_msg_.obs[3].cn0, expected 30, is " + << last_msg_.obs[3].cn0; + EXPECT_EQ(last_msg_.obs[3].lock, 24609) + << "incorrect value for last_msg_.obs[3].lock, expected 24609, is " + << last_msg_.obs[3].lock; + EXPECT_EQ(last_msg_.obs[3].prn, 22) + << "incorrect value for last_msg_.obs[3].prn, expected 22, is " + << last_msg_.obs[3].prn; + EXPECT_EQ(last_msg_.obs[4].L.f, 45) + << "incorrect value for last_msg_.obs[4].L.f, expected 45, is " + << last_msg_.obs[4].L.f; + EXPECT_EQ(last_msg_.obs[4].L.i, -36952) + << "incorrect value for last_msg_.obs[4].L.i, expected -36952, is " + << last_msg_.obs[4].L.i; + EXPECT_EQ(last_msg_.obs[4].P, 1985368870) + << "incorrect value for last_msg_.obs[4].P, expected 1985368870, is " + << last_msg_.obs[4].P; + EXPECT_EQ(last_msg_.obs[4].cn0, 56) + << "incorrect value for last_msg_.obs[4].cn0, expected 56, is " + << last_msg_.obs[4].cn0; + EXPECT_EQ(last_msg_.obs[4].lock, 22736) + << "incorrect value for last_msg_.obs[4].lock, expected 22736, is " + << last_msg_.obs[4].lock; + EXPECT_EQ(last_msg_.obs[4].prn, 30) + << "incorrect value for last_msg_.obs[4].prn, expected 30, is " + << last_msg_.obs[4].prn; } diff --git a/c/test/cpp/auto_check_sbp_orientation_MsgAngularRate.cc b/c/test/cpp/auto_check_sbp_orientation_MsgAngularRate.cc index e0230f538..e87867387 100644 --- a/c/test/cpp/auto_check_sbp_orientation_MsgAngularRate.cc +++ b/c/test/cpp/auto_check_sbp_orientation_MsgAngularRate.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgAngularRate.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgAngularRate.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_orientation_MsgAngularRate0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_orientation_MsgAngularRate0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_orientation_MsgAngularRate0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_orientation_MsgAngularRate0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_angular_rate_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_angular_rate_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,40 +67,47 @@ class Test_auto_check_sbp_orientation_MsgAngularRate0 : sbp_msg_angular_rate_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_orientation_MsgAngularRate0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_orientation_MsgAngularRate0, Test) { + uint8_t encoded_frame[] = { + 85, 34, 2, 66, 0, 17, 2, 0, 0, 0, 2, 0, 0, + 0, 5, 0, 0, 0, 2, 0, 0, 0, 0, 88, 70, + }; - uint8_t encoded_frame[] = {85,34,2,66,0,17,2,0,0,0,2,0,0,0,5,0,0,0,2,0,0,0,0,88,70, }; + sbp_msg_angular_rate_t test_msg{}; + test_msg.flags = 0; + test_msg.tow = 2; + test_msg.x = 2; + test_msg.y = 5; + test_msg.z = 2; - sbp_msg_angular_rate_t test_msg{}; - test_msg.flags = 0; - test_msg.tow = 2; - test_msg.x = 2; - test_msg.y = 5; - test_msg.z = 2; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.tow, 2) << "incorrect value for last_msg_.tow, expected 2, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.x, 2) << "incorrect value for last_msg_.x, expected 2, is " << last_msg_.x; - EXPECT_EQ(last_msg_.y, 5) << "incorrect value for last_msg_.y, expected 5, is " << last_msg_.y; - EXPECT_EQ(last_msg_.z, 2) << "incorrect value for last_msg_.z, expected 2, is " << last_msg_.z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.tow, 2) + << "incorrect value for last_msg_.tow, expected 2, is " << last_msg_.tow; + EXPECT_EQ(last_msg_.x, 2) + << "incorrect value for last_msg_.x, expected 2, is " << last_msg_.x; + EXPECT_EQ(last_msg_.y, 5) + << "incorrect value for last_msg_.y, expected 5, is " << last_msg_.y; + EXPECT_EQ(last_msg_.z, 2) + << "incorrect value for last_msg_.z, expected 2, is " << last_msg_.z; } diff --git a/c/test/cpp/auto_check_sbp_orientation_MsgBaselineHeading.cc b/c/test/cpp/auto_check_sbp_orientation_MsgBaselineHeading.cc index baee09844..6b3750c66 100644 --- a/c/test/cpp/auto_check_sbp_orientation_MsgBaselineHeading.cc +++ b/c/test/cpp/auto_check_sbp_orientation_MsgBaselineHeading.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgBaselineHeading.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgBaselineHeading.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_orientation_MsgBaselineHeading0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_orientation_MsgBaselineHeading0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_orientation_MsgBaselineHeading0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_orientation_MsgBaselineHeading0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_baseline_heading_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_baseline_heading_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,38 +67,47 @@ class Test_auto_check_sbp_orientation_MsgBaselineHeading0 : sbp_msg_baseline_heading_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_orientation_MsgBaselineHeading0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_orientation_MsgBaselineHeading0, Test) { + uint8_t encoded_frame[] = { + 85, 15, 2, 211, 93, 10, 156, 45, 13, + 196, 44, 84, 197, 61, 91, 91, 224, 254, + }; - uint8_t encoded_frame[] = {85,15,2,211,93,10,156,45,13,196,44,84,197,61,91,91,224,254, }; + sbp_msg_baseline_heading_t test_msg{}; + test_msg.flags = 91; + test_msg.heading = 1036342316; + test_msg.n_sats = 91; + test_msg.tow = 3289197980; - sbp_msg_baseline_heading_t test_msg{}; - test_msg.flags = 91; - test_msg.heading = 1036342316; - test_msg.n_sats = 91; - test_msg.tow = 3289197980; - - EXPECT_EQ(send_message( 24019, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(24019, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 24019); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 91) << "incorrect value for last_msg_.flags, expected 91, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.heading, 1036342316) << "incorrect value for last_msg_.heading, expected 1036342316, is " << last_msg_.heading; - EXPECT_EQ(last_msg_.n_sats, 91) << "incorrect value for last_msg_.n_sats, expected 91, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.tow, 3289197980) << "incorrect value for last_msg_.tow, expected 3289197980, is " << last_msg_.tow; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 24019); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 91) + << "incorrect value for last_msg_.flags, expected 91, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.heading, 1036342316) + << "incorrect value for last_msg_.heading, expected 1036342316, is " + << last_msg_.heading; + EXPECT_EQ(last_msg_.n_sats, 91) + << "incorrect value for last_msg_.n_sats, expected 91, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.tow, 3289197980) + << "incorrect value for last_msg_.tow, expected 3289197980, is " + << last_msg_.tow; } diff --git a/c/test/cpp/auto_check_sbp_orientation_MsgOrientEuler.cc b/c/test/cpp/auto_check_sbp_orientation_MsgOrientEuler.cc index c1f615a07..7f8b87c3a 100644 --- a/c/test/cpp/auto_check_sbp_orientation_MsgOrientEuler.cc +++ b/c/test/cpp/auto_check_sbp_orientation_MsgOrientEuler.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientEuler.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientEuler.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_orientation_MsgOrientEuler0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_orientation_MsgOrientEuler0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_orientation_MsgOrientEuler0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_orientation_MsgOrientEuler0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_orient_euler_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_orient_euler_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,46 +67,61 @@ class Test_auto_check_sbp_orientation_MsgOrientEuler0 : sbp_msg_orient_euler_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_orientation_MsgOrientEuler0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_orientation_MsgOrientEuler0, Test) { + uint8_t encoded_frame[] = { + 85, 33, 2, 66, 0, 29, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 8, + 0, 0, 0, 0, 0, 224, 64, 0, 0, 64, 64, 0, 0, 224, 64, 3, 44, 226, + }; - uint8_t encoded_frame[] = {85,33,2,66,0,29,1,0,0,0,1,0,0,0,2,0,0,0,8,0,0,0,0,0,224,64,0,0,64,64,0,0,224,64,3,44,226, }; + sbp_msg_orient_euler_t test_msg{}; + test_msg.flags = 3; + test_msg.pitch = 2; + test_msg.pitch_accuracy = 3.0; + test_msg.roll = 1; + test_msg.roll_accuracy = 7.0; + test_msg.tow = 1; + test_msg.yaw = 8; + test_msg.yaw_accuracy = 7.0; - sbp_msg_orient_euler_t test_msg{}; - test_msg.flags = 3; - test_msg.pitch = 2; - test_msg.pitch_accuracy = 3.0; - test_msg.roll = 1; - test_msg.roll_accuracy = 7.0; - test_msg.tow = 1; - test_msg.yaw = 8; - test_msg.yaw_accuracy = 7.0; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 3) << "incorrect value for last_msg_.flags, expected 3, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.pitch, 2) << "incorrect value for last_msg_.pitch, expected 2, is " << last_msg_.pitch; - EXPECT_LT((last_msg_.pitch_accuracy * 100 - 3.0 * 100), 0.05) << "incorrect value for last_msg_.pitch_accuracy, expected 3.0, is " << last_msg_.pitch_accuracy; - EXPECT_EQ(last_msg_.roll, 1) << "incorrect value for last_msg_.roll, expected 1, is " << last_msg_.roll; - EXPECT_LT((last_msg_.roll_accuracy * 100 - 7.0 * 100), 0.05) << "incorrect value for last_msg_.roll_accuracy, expected 7.0, is " << last_msg_.roll_accuracy; - EXPECT_EQ(last_msg_.tow, 1) << "incorrect value for last_msg_.tow, expected 1, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.yaw, 8) << "incorrect value for last_msg_.yaw, expected 8, is " << last_msg_.yaw; - EXPECT_LT((last_msg_.yaw_accuracy * 100 - 7.0 * 100), 0.05) << "incorrect value for last_msg_.yaw_accuracy, expected 7.0, is " << last_msg_.yaw_accuracy; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 3) + << "incorrect value for last_msg_.flags, expected 3, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.pitch, 2) + << "incorrect value for last_msg_.pitch, expected 2, is " + << last_msg_.pitch; + EXPECT_LT((last_msg_.pitch_accuracy * 100 - 3.0 * 100), 0.05) + << "incorrect value for last_msg_.pitch_accuracy, expected 3.0, is " + << last_msg_.pitch_accuracy; + EXPECT_EQ(last_msg_.roll, 1) + << "incorrect value for last_msg_.roll, expected 1, is " + << last_msg_.roll; + EXPECT_LT((last_msg_.roll_accuracy * 100 - 7.0 * 100), 0.05) + << "incorrect value for last_msg_.roll_accuracy, expected 7.0, is " + << last_msg_.roll_accuracy; + EXPECT_EQ(last_msg_.tow, 1) + << "incorrect value for last_msg_.tow, expected 1, is " << last_msg_.tow; + EXPECT_EQ(last_msg_.yaw, 8) + << "incorrect value for last_msg_.yaw, expected 8, is " << last_msg_.yaw; + EXPECT_LT((last_msg_.yaw_accuracy * 100 - 7.0 * 100), 0.05) + << "incorrect value for last_msg_.yaw_accuracy, expected 7.0, is " + << last_msg_.yaw_accuracy; } diff --git a/c/test/cpp/auto_check_sbp_orientation_MsgOrientQuat.cc b/c/test/cpp/auto_check_sbp_orientation_MsgOrientQuat.cc index 2699c7634..0223ee72d 100644 --- a/c/test/cpp/auto_check_sbp_orientation_MsgOrientQuat.cc +++ b/c/test/cpp/auto_check_sbp_orientation_MsgOrientQuat.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientQuat.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientQuat.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_orientation_MsgOrientQuat0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_orientation_MsgOrientQuat0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_orientation_MsgOrientQuat0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_orientation_MsgOrientQuat0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_orient_quat_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_orient_quat_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,50 +67,67 @@ class Test_auto_check_sbp_orientation_MsgOrientQuat0 : sbp_msg_orient_quat_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_orientation_MsgOrientQuat0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_orientation_MsgOrientQuat0, Test) { + uint8_t encoded_frame[] = { + 85, 32, 2, 66, 0, 37, 0, 0, 0, 0, 3, 0, 0, 0, 7, + 0, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0, 0, 0, 64, 64, + 0, 0, 128, 64, 0, 0, 0, 65, 0, 0, 64, 64, 1, 186, 6, + }; - uint8_t encoded_frame[] = {85,32,2,66,0,37,0,0,0,0,3,0,0,0,7,0,0,0,8,0,0,0,4,0,0,0,0,0,64,64,0,0,128,64,0,0,0,65,0,0,64,64,1,186,6, }; + sbp_msg_orient_quat_t test_msg{}; + test_msg.flags = 1; + test_msg.tow = 0; + test_msg.w = 3; + test_msg.w_accuracy = 3.0; + test_msg.x = 7; + test_msg.x_accuracy = 4.0; + test_msg.y = 8; + test_msg.y_accuracy = 8.0; + test_msg.z = 4; + test_msg.z_accuracy = 3.0; - sbp_msg_orient_quat_t test_msg{}; - test_msg.flags = 1; - test_msg.tow = 0; - test_msg.w = 3; - test_msg.w_accuracy = 3.0; - test_msg.x = 7; - test_msg.x_accuracy = 4.0; - test_msg.y = 8; - test_msg.y_accuracy = 8.0; - test_msg.z = 4; - test_msg.z_accuracy = 3.0; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.tow, 0) << "incorrect value for last_msg_.tow, expected 0, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.w, 3) << "incorrect value for last_msg_.w, expected 3, is " << last_msg_.w; - EXPECT_LT((last_msg_.w_accuracy * 100 - 3.0 * 100), 0.05) << "incorrect value for last_msg_.w_accuracy, expected 3.0, is " << last_msg_.w_accuracy; - EXPECT_EQ(last_msg_.x, 7) << "incorrect value for last_msg_.x, expected 7, is " << last_msg_.x; - EXPECT_LT((last_msg_.x_accuracy * 100 - 4.0 * 100), 0.05) << "incorrect value for last_msg_.x_accuracy, expected 4.0, is " << last_msg_.x_accuracy; - EXPECT_EQ(last_msg_.y, 8) << "incorrect value for last_msg_.y, expected 8, is " << last_msg_.y; - EXPECT_LT((last_msg_.y_accuracy * 100 - 8.0 * 100), 0.05) << "incorrect value for last_msg_.y_accuracy, expected 8.0, is " << last_msg_.y_accuracy; - EXPECT_EQ(last_msg_.z, 4) << "incorrect value for last_msg_.z, expected 4, is " << last_msg_.z; - EXPECT_LT((last_msg_.z_accuracy * 100 - 3.0 * 100), 0.05) << "incorrect value for last_msg_.z_accuracy, expected 3.0, is " << last_msg_.z_accuracy; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.tow, 0) + << "incorrect value for last_msg_.tow, expected 0, is " << last_msg_.tow; + EXPECT_EQ(last_msg_.w, 3) + << "incorrect value for last_msg_.w, expected 3, is " << last_msg_.w; + EXPECT_LT((last_msg_.w_accuracy * 100 - 3.0 * 100), 0.05) + << "incorrect value for last_msg_.w_accuracy, expected 3.0, is " + << last_msg_.w_accuracy; + EXPECT_EQ(last_msg_.x, 7) + << "incorrect value for last_msg_.x, expected 7, is " << last_msg_.x; + EXPECT_LT((last_msg_.x_accuracy * 100 - 4.0 * 100), 0.05) + << "incorrect value for last_msg_.x_accuracy, expected 4.0, is " + << last_msg_.x_accuracy; + EXPECT_EQ(last_msg_.y, 8) + << "incorrect value for last_msg_.y, expected 8, is " << last_msg_.y; + EXPECT_LT((last_msg_.y_accuracy * 100 - 8.0 * 100), 0.05) + << "incorrect value for last_msg_.y_accuracy, expected 8.0, is " + << last_msg_.y_accuracy; + EXPECT_EQ(last_msg_.z, 4) + << "incorrect value for last_msg_.z, expected 4, is " << last_msg_.z; + EXPECT_LT((last_msg_.z_accuracy * 100 - 3.0 * 100), 0.05) + << "incorrect value for last_msg_.z_accuracy, expected 3.0, is " + << last_msg_.z_accuracy; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgAlmanac.cc b/c/test/cpp/auto_check_sbp_piksi_MsgAlmanac.cc index ee039adb9..41210c7ed 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgAlmanac.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgAlmanac.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgAlmanac.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgAlmanac.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgAlmanac0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgAlmanac0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgAlmanac0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgAlmanac0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_almanac_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_almanac_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,30 +67,30 @@ class Test_auto_check_sbp_piksi_MsgAlmanac0 : sbp_msg_almanac_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgAlmanac0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgAlmanac0, Test) { + uint8_t encoded_frame[] = { + 85, 105, 0, 108, 138, 0, 249, 171, + }; - uint8_t encoded_frame[] = {85,105,0,108,138,0,249,171, }; + sbp_msg_almanac_t test_msg{}; - sbp_msg_almanac_t test_msg{}; - - EXPECT_EQ(send_message( 35436, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(35436, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35436); - EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35436); + EXPECT_EQ(last_msg_, test_msg); } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgCellModemStatus.cc b/c/test/cpp/auto_check_sbp_piksi_MsgCellModemStatus.cc index 480003115..1aa70174c 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgCellModemStatus.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgCellModemStatus.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCellModemStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCellModemStatus.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgCellModemStatus0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgCellModemStatus0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgCellModemStatus0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgCellModemStatus0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_cell_modem_status_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_cell_modem_status_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,802 +67,1343 @@ class Test_auto_check_sbp_piksi_MsgCellModemStatus0 : sbp_msg_cell_modem_status_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgCellModemStatus0, Test) -{ - - uint8_t encoded_frame[] = {85,190,0,19,27,255,103,205,48,6,70,123,242,46,52,64,176,154,98,43,132,196,89,253,161,250,174,204,110,47,38,187,63,102,177,162,49,80,194,37,107,60,225,52,101,178,142,246,21,17,93,75,169,86,16,209,80,243,30,206,220,206,115,47,154,91,227,88,11,1,85,146,100,190,232,207,61,61,201,220,31,78,34,57,82,59,104,65,221,0,43,210,9,32,122,29,237,11,151,223,18,81,204,172,234,127,3,82,133,169,12,176,193,0,24,121,85,55,214,198,75,234,179,214,85,94,115,21,73,121,75,46,158,63,100,122,213,20,85,212,131,50,224,218,215,215,149,2,19,129,39,164,5,175,6,62,51,78,66,248,116,88,90,128,226,177,0,47,140,33,126,221,110,144,97,74,250,181,199,27,176,65,185,110,92,34,44,131,96,178,40,176,4,90,36,7,180,244,244,23,108,171,204,196,61,51,179,242,156,81,83,16,15,134,40,245,253,150,94,150,144,197,113,5,141,232,33,101,231,38,75,178,243,119,1,248,218,86,7,88,197,148,240,227,2,65,173,122,143,251,156,217,67,239,219,31,224,176,129,81,80,40,230, }; - - sbp_msg_cell_modem_status_t test_msg{}; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_reserved.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)114,(char)101,(char)115,(char)101,(char)114,(char)118,(char)101,(char)100 }; - memcpy(test_msg.n_reserved.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_reserved.value = 250; - - test_msg.reserved[0] = 123; - - test_msg.reserved[1] = 242; - - test_msg.reserved[2] = 46; - - test_msg.reserved[3] = 52; - - test_msg.reserved[4] = 64; - - test_msg.reserved[5] = 176; - - test_msg.reserved[6] = 154; - - test_msg.reserved[7] = 98; - - test_msg.reserved[8] = 43; - - test_msg.reserved[9] = 132; - - test_msg.reserved[10] = 196; - - test_msg.reserved[11] = 89; - - test_msg.reserved[12] = 253; - - test_msg.reserved[13] = 161; - - test_msg.reserved[14] = 250; - - test_msg.reserved[15] = 174; - - test_msg.reserved[16] = 204; - - test_msg.reserved[17] = 110; - - test_msg.reserved[18] = 47; - - test_msg.reserved[19] = 38; - - test_msg.reserved[20] = 187; - - test_msg.reserved[21] = 63; - - test_msg.reserved[22] = 102; - - test_msg.reserved[23] = 177; - - test_msg.reserved[24] = 162; - - test_msg.reserved[25] = 49; - - test_msg.reserved[26] = 80; - - test_msg.reserved[27] = 194; - - test_msg.reserved[28] = 37; - - test_msg.reserved[29] = 107; - - test_msg.reserved[30] = 60; - - test_msg.reserved[31] = 225; - - test_msg.reserved[32] = 52; - - test_msg.reserved[33] = 101; - - test_msg.reserved[34] = 178; - - test_msg.reserved[35] = 142; - - test_msg.reserved[36] = 246; - - test_msg.reserved[37] = 21; - - test_msg.reserved[38] = 17; - - test_msg.reserved[39] = 93; - - test_msg.reserved[40] = 75; - - test_msg.reserved[41] = 169; - - test_msg.reserved[42] = 86; - - test_msg.reserved[43] = 16; - - test_msg.reserved[44] = 209; - - test_msg.reserved[45] = 80; - - test_msg.reserved[46] = 243; - - test_msg.reserved[47] = 30; - - test_msg.reserved[48] = 206; - - test_msg.reserved[49] = 220; - - test_msg.reserved[50] = 206; - - test_msg.reserved[51] = 115; - - test_msg.reserved[52] = 47; - - test_msg.reserved[53] = 154; - - test_msg.reserved[54] = 91; - - test_msg.reserved[55] = 227; - - test_msg.reserved[56] = 88; - - test_msg.reserved[57] = 11; - - test_msg.reserved[58] = 1; - - test_msg.reserved[59] = 85; - - test_msg.reserved[60] = 146; - - test_msg.reserved[61] = 100; - - test_msg.reserved[62] = 190; - - test_msg.reserved[63] = 232; - - test_msg.reserved[64] = 207; - - test_msg.reserved[65] = 61; - - test_msg.reserved[66] = 61; - - test_msg.reserved[67] = 201; - - test_msg.reserved[68] = 220; - - test_msg.reserved[69] = 31; - - test_msg.reserved[70] = 78; - - test_msg.reserved[71] = 34; - - test_msg.reserved[72] = 57; - - test_msg.reserved[73] = 82; - - test_msg.reserved[74] = 59; - - test_msg.reserved[75] = 104; - - test_msg.reserved[76] = 65; - - test_msg.reserved[77] = 221; - - test_msg.reserved[78] = 0; - - test_msg.reserved[79] = 43; - - test_msg.reserved[80] = 210; - - test_msg.reserved[81] = 9; - - test_msg.reserved[82] = 32; - - test_msg.reserved[83] = 122; - - test_msg.reserved[84] = 29; - - test_msg.reserved[85] = 237; - - test_msg.reserved[86] = 11; - - test_msg.reserved[87] = 151; - - test_msg.reserved[88] = 223; - - test_msg.reserved[89] = 18; - - test_msg.reserved[90] = 81; - - test_msg.reserved[91] = 204; - - test_msg.reserved[92] = 172; - - test_msg.reserved[93] = 234; - - test_msg.reserved[94] = 127; - - test_msg.reserved[95] = 3; - - test_msg.reserved[96] = 82; - - test_msg.reserved[97] = 133; - - test_msg.reserved[98] = 169; - - test_msg.reserved[99] = 12; - - test_msg.reserved[100] = 176; - - test_msg.reserved[101] = 193; - - test_msg.reserved[102] = 0; - - test_msg.reserved[103] = 24; - - test_msg.reserved[104] = 121; - - test_msg.reserved[105] = 85; - - test_msg.reserved[106] = 55; - - test_msg.reserved[107] = 214; - - test_msg.reserved[108] = 198; - - test_msg.reserved[109] = 75; - - test_msg.reserved[110] = 234; - - test_msg.reserved[111] = 179; - - test_msg.reserved[112] = 214; - - test_msg.reserved[113] = 85; - - test_msg.reserved[114] = 94; - - test_msg.reserved[115] = 115; - - test_msg.reserved[116] = 21; - - test_msg.reserved[117] = 73; - - test_msg.reserved[118] = 121; - - test_msg.reserved[119] = 75; - - test_msg.reserved[120] = 46; - - test_msg.reserved[121] = 158; - - test_msg.reserved[122] = 63; - - test_msg.reserved[123] = 100; - - test_msg.reserved[124] = 122; - - test_msg.reserved[125] = 213; - - test_msg.reserved[126] = 20; - - test_msg.reserved[127] = 85; - - test_msg.reserved[128] = 212; - - test_msg.reserved[129] = 131; - - test_msg.reserved[130] = 50; - - test_msg.reserved[131] = 224; - - test_msg.reserved[132] = 218; - - test_msg.reserved[133] = 215; - - test_msg.reserved[134] = 215; - - test_msg.reserved[135] = 149; - - test_msg.reserved[136] = 2; - - test_msg.reserved[137] = 19; - - test_msg.reserved[138] = 129; - - test_msg.reserved[139] = 39; - - test_msg.reserved[140] = 164; - - test_msg.reserved[141] = 5; - - test_msg.reserved[142] = 175; - - test_msg.reserved[143] = 6; - - test_msg.reserved[144] = 62; - - test_msg.reserved[145] = 51; - - test_msg.reserved[146] = 78; - - test_msg.reserved[147] = 66; - - test_msg.reserved[148] = 248; - - test_msg.reserved[149] = 116; - - test_msg.reserved[150] = 88; - - test_msg.reserved[151] = 90; - - test_msg.reserved[152] = 128; - - test_msg.reserved[153] = 226; - - test_msg.reserved[154] = 177; - - test_msg.reserved[155] = 0; - - test_msg.reserved[156] = 47; - - test_msg.reserved[157] = 140; - - test_msg.reserved[158] = 33; - - test_msg.reserved[159] = 126; - - test_msg.reserved[160] = 221; - - test_msg.reserved[161] = 110; - - test_msg.reserved[162] = 144; - - test_msg.reserved[163] = 97; - - test_msg.reserved[164] = 74; - - test_msg.reserved[165] = 250; - - test_msg.reserved[166] = 181; - - test_msg.reserved[167] = 199; - - test_msg.reserved[168] = 27; - - test_msg.reserved[169] = 176; - - test_msg.reserved[170] = 65; - - test_msg.reserved[171] = 185; - - test_msg.reserved[172] = 110; - - test_msg.reserved[173] = 92; - - test_msg.reserved[174] = 34; - - test_msg.reserved[175] = 44; - - test_msg.reserved[176] = 131; - - test_msg.reserved[177] = 96; - - test_msg.reserved[178] = 178; - - test_msg.reserved[179] = 40; - - test_msg.reserved[180] = 176; - - test_msg.reserved[181] = 4; - - test_msg.reserved[182] = 90; - - test_msg.reserved[183] = 36; - - test_msg.reserved[184] = 7; - - test_msg.reserved[185] = 180; - - test_msg.reserved[186] = 244; - - test_msg.reserved[187] = 244; - - test_msg.reserved[188] = 23; - - test_msg.reserved[189] = 108; - - test_msg.reserved[190] = 171; - - test_msg.reserved[191] = 204; - - test_msg.reserved[192] = 196; - - test_msg.reserved[193] = 61; - - test_msg.reserved[194] = 51; - - test_msg.reserved[195] = 179; - - test_msg.reserved[196] = 242; - - test_msg.reserved[197] = 156; - - test_msg.reserved[198] = 81; - - test_msg.reserved[199] = 83; - - test_msg.reserved[200] = 16; - - test_msg.reserved[201] = 15; - - test_msg.reserved[202] = 134; - - test_msg.reserved[203] = 40; - - test_msg.reserved[204] = 245; - - test_msg.reserved[205] = 253; - - test_msg.reserved[206] = 150; - - test_msg.reserved[207] = 94; - - test_msg.reserved[208] = 150; - - test_msg.reserved[209] = 144; - - test_msg.reserved[210] = 197; - - test_msg.reserved[211] = 113; - - test_msg.reserved[212] = 5; - - test_msg.reserved[213] = 141; - - test_msg.reserved[214] = 232; - - test_msg.reserved[215] = 33; - - test_msg.reserved[216] = 101; - - test_msg.reserved[217] = 231; - - test_msg.reserved[218] = 38; - - test_msg.reserved[219] = 75; - - test_msg.reserved[220] = 178; - - test_msg.reserved[221] = 243; - - test_msg.reserved[222] = 119; - - test_msg.reserved[223] = 1; - - test_msg.reserved[224] = 248; - - test_msg.reserved[225] = 218; - - test_msg.reserved[226] = 86; - - test_msg.reserved[227] = 7; - - test_msg.reserved[228] = 88; - - test_msg.reserved[229] = 197; - - test_msg.reserved[230] = 148; - - test_msg.reserved[231] = 240; - - test_msg.reserved[232] = 227; - - test_msg.reserved[233] = 2; - - test_msg.reserved[234] = 65; - - test_msg.reserved[235] = 173; - - test_msg.reserved[236] = 122; - - test_msg.reserved[237] = 143; - - test_msg.reserved[238] = 251; - - test_msg.reserved[239] = 156; - - test_msg.reserved[240] = 217; - - test_msg.reserved[241] = 67; - - test_msg.reserved[242] = 239; - - test_msg.reserved[243] = 219; - - test_msg.reserved[244] = 31; - - test_msg.reserved[245] = 224; - - test_msg.reserved[246] = 176; - - test_msg.reserved[247] = 129; - - test_msg.reserved[248] = 81; - - test_msg.reserved[249] = 80; - test_msg.signal_error_rate = 8588.2001953125; - test_msg.signal_strength = 103; - - EXPECT_EQ(send_message( 6931, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 6931); - EXPECT_EQ(last_msg_, test_msg); - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_reserved.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_reserved.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_reserved.handle_as << "'"; - } - { - const char check_string[] = { (char)114,(char)101,(char)115,(char)101,(char)114,(char)118,(char)101,(char)100 }; - EXPECT_EQ(memcmp(last_msg_.n_reserved.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_reserved.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_reserved.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_reserved.value, 250) << "incorrect value for last_msg_.n_reserved.value, expected 250, is " << last_msg_.n_reserved.value; - EXPECT_EQ(last_msg_.reserved[0], 123) << "incorrect value for last_msg_.reserved[0], expected 123, is " << last_msg_.reserved[0]; - EXPECT_EQ(last_msg_.reserved[1], 242) << "incorrect value for last_msg_.reserved[1], expected 242, is " << last_msg_.reserved[1]; - EXPECT_EQ(last_msg_.reserved[2], 46) << "incorrect value for last_msg_.reserved[2], expected 46, is " << last_msg_.reserved[2]; - EXPECT_EQ(last_msg_.reserved[3], 52) << "incorrect value for last_msg_.reserved[3], expected 52, is " << last_msg_.reserved[3]; - EXPECT_EQ(last_msg_.reserved[4], 64) << "incorrect value for last_msg_.reserved[4], expected 64, is " << last_msg_.reserved[4]; - EXPECT_EQ(last_msg_.reserved[5], 176) << "incorrect value for last_msg_.reserved[5], expected 176, is " << last_msg_.reserved[5]; - EXPECT_EQ(last_msg_.reserved[6], 154) << "incorrect value for last_msg_.reserved[6], expected 154, is " << last_msg_.reserved[6]; - EXPECT_EQ(last_msg_.reserved[7], 98) << "incorrect value for last_msg_.reserved[7], expected 98, is " << last_msg_.reserved[7]; - EXPECT_EQ(last_msg_.reserved[8], 43) << "incorrect value for last_msg_.reserved[8], expected 43, is " << last_msg_.reserved[8]; - EXPECT_EQ(last_msg_.reserved[9], 132) << "incorrect value for last_msg_.reserved[9], expected 132, is " << last_msg_.reserved[9]; - EXPECT_EQ(last_msg_.reserved[10], 196) << "incorrect value for last_msg_.reserved[10], expected 196, is " << last_msg_.reserved[10]; - EXPECT_EQ(last_msg_.reserved[11], 89) << "incorrect value for last_msg_.reserved[11], expected 89, is " << last_msg_.reserved[11]; - EXPECT_EQ(last_msg_.reserved[12], 253) << "incorrect value for last_msg_.reserved[12], expected 253, is " << last_msg_.reserved[12]; - EXPECT_EQ(last_msg_.reserved[13], 161) << "incorrect value for last_msg_.reserved[13], expected 161, is " << last_msg_.reserved[13]; - EXPECT_EQ(last_msg_.reserved[14], 250) << "incorrect value for last_msg_.reserved[14], expected 250, is " << last_msg_.reserved[14]; - EXPECT_EQ(last_msg_.reserved[15], 174) << "incorrect value for last_msg_.reserved[15], expected 174, is " << last_msg_.reserved[15]; - EXPECT_EQ(last_msg_.reserved[16], 204) << "incorrect value for last_msg_.reserved[16], expected 204, is " << last_msg_.reserved[16]; - EXPECT_EQ(last_msg_.reserved[17], 110) << "incorrect value for last_msg_.reserved[17], expected 110, is " << last_msg_.reserved[17]; - EXPECT_EQ(last_msg_.reserved[18], 47) << "incorrect value for last_msg_.reserved[18], expected 47, is " << last_msg_.reserved[18]; - EXPECT_EQ(last_msg_.reserved[19], 38) << "incorrect value for last_msg_.reserved[19], expected 38, is " << last_msg_.reserved[19]; - EXPECT_EQ(last_msg_.reserved[20], 187) << "incorrect value for last_msg_.reserved[20], expected 187, is " << last_msg_.reserved[20]; - EXPECT_EQ(last_msg_.reserved[21], 63) << "incorrect value for last_msg_.reserved[21], expected 63, is " << last_msg_.reserved[21]; - EXPECT_EQ(last_msg_.reserved[22], 102) << "incorrect value for last_msg_.reserved[22], expected 102, is " << last_msg_.reserved[22]; - EXPECT_EQ(last_msg_.reserved[23], 177) << "incorrect value for last_msg_.reserved[23], expected 177, is " << last_msg_.reserved[23]; - EXPECT_EQ(last_msg_.reserved[24], 162) << "incorrect value for last_msg_.reserved[24], expected 162, is " << last_msg_.reserved[24]; - EXPECT_EQ(last_msg_.reserved[25], 49) << "incorrect value for last_msg_.reserved[25], expected 49, is " << last_msg_.reserved[25]; - EXPECT_EQ(last_msg_.reserved[26], 80) << "incorrect value for last_msg_.reserved[26], expected 80, is " << last_msg_.reserved[26]; - EXPECT_EQ(last_msg_.reserved[27], 194) << "incorrect value for last_msg_.reserved[27], expected 194, is " << last_msg_.reserved[27]; - EXPECT_EQ(last_msg_.reserved[28], 37) << "incorrect value for last_msg_.reserved[28], expected 37, is " << last_msg_.reserved[28]; - EXPECT_EQ(last_msg_.reserved[29], 107) << "incorrect value for last_msg_.reserved[29], expected 107, is " << last_msg_.reserved[29]; - EXPECT_EQ(last_msg_.reserved[30], 60) << "incorrect value for last_msg_.reserved[30], expected 60, is " << last_msg_.reserved[30]; - EXPECT_EQ(last_msg_.reserved[31], 225) << "incorrect value for last_msg_.reserved[31], expected 225, is " << last_msg_.reserved[31]; - EXPECT_EQ(last_msg_.reserved[32], 52) << "incorrect value for last_msg_.reserved[32], expected 52, is " << last_msg_.reserved[32]; - EXPECT_EQ(last_msg_.reserved[33], 101) << "incorrect value for last_msg_.reserved[33], expected 101, is " << last_msg_.reserved[33]; - EXPECT_EQ(last_msg_.reserved[34], 178) << "incorrect value for last_msg_.reserved[34], expected 178, is " << last_msg_.reserved[34]; - EXPECT_EQ(last_msg_.reserved[35], 142) << "incorrect value for last_msg_.reserved[35], expected 142, is " << last_msg_.reserved[35]; - EXPECT_EQ(last_msg_.reserved[36], 246) << "incorrect value for last_msg_.reserved[36], expected 246, is " << last_msg_.reserved[36]; - EXPECT_EQ(last_msg_.reserved[37], 21) << "incorrect value for last_msg_.reserved[37], expected 21, is " << last_msg_.reserved[37]; - EXPECT_EQ(last_msg_.reserved[38], 17) << "incorrect value for last_msg_.reserved[38], expected 17, is " << last_msg_.reserved[38]; - EXPECT_EQ(last_msg_.reserved[39], 93) << "incorrect value for last_msg_.reserved[39], expected 93, is " << last_msg_.reserved[39]; - EXPECT_EQ(last_msg_.reserved[40], 75) << "incorrect value for last_msg_.reserved[40], expected 75, is " << last_msg_.reserved[40]; - EXPECT_EQ(last_msg_.reserved[41], 169) << "incorrect value for last_msg_.reserved[41], expected 169, is " << last_msg_.reserved[41]; - EXPECT_EQ(last_msg_.reserved[42], 86) << "incorrect value for last_msg_.reserved[42], expected 86, is " << last_msg_.reserved[42]; - EXPECT_EQ(last_msg_.reserved[43], 16) << "incorrect value for last_msg_.reserved[43], expected 16, is " << last_msg_.reserved[43]; - EXPECT_EQ(last_msg_.reserved[44], 209) << "incorrect value for last_msg_.reserved[44], expected 209, is " << last_msg_.reserved[44]; - EXPECT_EQ(last_msg_.reserved[45], 80) << "incorrect value for last_msg_.reserved[45], expected 80, is " << last_msg_.reserved[45]; - EXPECT_EQ(last_msg_.reserved[46], 243) << "incorrect value for last_msg_.reserved[46], expected 243, is " << last_msg_.reserved[46]; - EXPECT_EQ(last_msg_.reserved[47], 30) << "incorrect value for last_msg_.reserved[47], expected 30, is " << last_msg_.reserved[47]; - EXPECT_EQ(last_msg_.reserved[48], 206) << "incorrect value for last_msg_.reserved[48], expected 206, is " << last_msg_.reserved[48]; - EXPECT_EQ(last_msg_.reserved[49], 220) << "incorrect value for last_msg_.reserved[49], expected 220, is " << last_msg_.reserved[49]; - EXPECT_EQ(last_msg_.reserved[50], 206) << "incorrect value for last_msg_.reserved[50], expected 206, is " << last_msg_.reserved[50]; - EXPECT_EQ(last_msg_.reserved[51], 115) << "incorrect value for last_msg_.reserved[51], expected 115, is " << last_msg_.reserved[51]; - EXPECT_EQ(last_msg_.reserved[52], 47) << "incorrect value for last_msg_.reserved[52], expected 47, is " << last_msg_.reserved[52]; - EXPECT_EQ(last_msg_.reserved[53], 154) << "incorrect value for last_msg_.reserved[53], expected 154, is " << last_msg_.reserved[53]; - EXPECT_EQ(last_msg_.reserved[54], 91) << "incorrect value for last_msg_.reserved[54], expected 91, is " << last_msg_.reserved[54]; - EXPECT_EQ(last_msg_.reserved[55], 227) << "incorrect value for last_msg_.reserved[55], expected 227, is " << last_msg_.reserved[55]; - EXPECT_EQ(last_msg_.reserved[56], 88) << "incorrect value for last_msg_.reserved[56], expected 88, is " << last_msg_.reserved[56]; - EXPECT_EQ(last_msg_.reserved[57], 11) << "incorrect value for last_msg_.reserved[57], expected 11, is " << last_msg_.reserved[57]; - EXPECT_EQ(last_msg_.reserved[58], 1) << "incorrect value for last_msg_.reserved[58], expected 1, is " << last_msg_.reserved[58]; - EXPECT_EQ(last_msg_.reserved[59], 85) << "incorrect value for last_msg_.reserved[59], expected 85, is " << last_msg_.reserved[59]; - EXPECT_EQ(last_msg_.reserved[60], 146) << "incorrect value for last_msg_.reserved[60], expected 146, is " << last_msg_.reserved[60]; - EXPECT_EQ(last_msg_.reserved[61], 100) << "incorrect value for last_msg_.reserved[61], expected 100, is " << last_msg_.reserved[61]; - EXPECT_EQ(last_msg_.reserved[62], 190) << "incorrect value for last_msg_.reserved[62], expected 190, is " << last_msg_.reserved[62]; - EXPECT_EQ(last_msg_.reserved[63], 232) << "incorrect value for last_msg_.reserved[63], expected 232, is " << last_msg_.reserved[63]; - EXPECT_EQ(last_msg_.reserved[64], 207) << "incorrect value for last_msg_.reserved[64], expected 207, is " << last_msg_.reserved[64]; - EXPECT_EQ(last_msg_.reserved[65], 61) << "incorrect value for last_msg_.reserved[65], expected 61, is " << last_msg_.reserved[65]; - EXPECT_EQ(last_msg_.reserved[66], 61) << "incorrect value for last_msg_.reserved[66], expected 61, is " << last_msg_.reserved[66]; - EXPECT_EQ(last_msg_.reserved[67], 201) << "incorrect value for last_msg_.reserved[67], expected 201, is " << last_msg_.reserved[67]; - EXPECT_EQ(last_msg_.reserved[68], 220) << "incorrect value for last_msg_.reserved[68], expected 220, is " << last_msg_.reserved[68]; - EXPECT_EQ(last_msg_.reserved[69], 31) << "incorrect value for last_msg_.reserved[69], expected 31, is " << last_msg_.reserved[69]; - EXPECT_EQ(last_msg_.reserved[70], 78) << "incorrect value for last_msg_.reserved[70], expected 78, is " << last_msg_.reserved[70]; - EXPECT_EQ(last_msg_.reserved[71], 34) << "incorrect value for last_msg_.reserved[71], expected 34, is " << last_msg_.reserved[71]; - EXPECT_EQ(last_msg_.reserved[72], 57) << "incorrect value for last_msg_.reserved[72], expected 57, is " << last_msg_.reserved[72]; - EXPECT_EQ(last_msg_.reserved[73], 82) << "incorrect value for last_msg_.reserved[73], expected 82, is " << last_msg_.reserved[73]; - EXPECT_EQ(last_msg_.reserved[74], 59) << "incorrect value for last_msg_.reserved[74], expected 59, is " << last_msg_.reserved[74]; - EXPECT_EQ(last_msg_.reserved[75], 104) << "incorrect value for last_msg_.reserved[75], expected 104, is " << last_msg_.reserved[75]; - EXPECT_EQ(last_msg_.reserved[76], 65) << "incorrect value for last_msg_.reserved[76], expected 65, is " << last_msg_.reserved[76]; - EXPECT_EQ(last_msg_.reserved[77], 221) << "incorrect value for last_msg_.reserved[77], expected 221, is " << last_msg_.reserved[77]; - EXPECT_EQ(last_msg_.reserved[78], 0) << "incorrect value for last_msg_.reserved[78], expected 0, is " << last_msg_.reserved[78]; - EXPECT_EQ(last_msg_.reserved[79], 43) << "incorrect value for last_msg_.reserved[79], expected 43, is " << last_msg_.reserved[79]; - EXPECT_EQ(last_msg_.reserved[80], 210) << "incorrect value for last_msg_.reserved[80], expected 210, is " << last_msg_.reserved[80]; - EXPECT_EQ(last_msg_.reserved[81], 9) << "incorrect value for last_msg_.reserved[81], expected 9, is " << last_msg_.reserved[81]; - EXPECT_EQ(last_msg_.reserved[82], 32) << "incorrect value for last_msg_.reserved[82], expected 32, is " << last_msg_.reserved[82]; - EXPECT_EQ(last_msg_.reserved[83], 122) << "incorrect value for last_msg_.reserved[83], expected 122, is " << last_msg_.reserved[83]; - EXPECT_EQ(last_msg_.reserved[84], 29) << "incorrect value for last_msg_.reserved[84], expected 29, is " << last_msg_.reserved[84]; - EXPECT_EQ(last_msg_.reserved[85], 237) << "incorrect value for last_msg_.reserved[85], expected 237, is " << last_msg_.reserved[85]; - EXPECT_EQ(last_msg_.reserved[86], 11) << "incorrect value for last_msg_.reserved[86], expected 11, is " << last_msg_.reserved[86]; - EXPECT_EQ(last_msg_.reserved[87], 151) << "incorrect value for last_msg_.reserved[87], expected 151, is " << last_msg_.reserved[87]; - EXPECT_EQ(last_msg_.reserved[88], 223) << "incorrect value for last_msg_.reserved[88], expected 223, is " << last_msg_.reserved[88]; - EXPECT_EQ(last_msg_.reserved[89], 18) << "incorrect value for last_msg_.reserved[89], expected 18, is " << last_msg_.reserved[89]; - EXPECT_EQ(last_msg_.reserved[90], 81) << "incorrect value for last_msg_.reserved[90], expected 81, is " << last_msg_.reserved[90]; - EXPECT_EQ(last_msg_.reserved[91], 204) << "incorrect value for last_msg_.reserved[91], expected 204, is " << last_msg_.reserved[91]; - EXPECT_EQ(last_msg_.reserved[92], 172) << "incorrect value for last_msg_.reserved[92], expected 172, is " << last_msg_.reserved[92]; - EXPECT_EQ(last_msg_.reserved[93], 234) << "incorrect value for last_msg_.reserved[93], expected 234, is " << last_msg_.reserved[93]; - EXPECT_EQ(last_msg_.reserved[94], 127) << "incorrect value for last_msg_.reserved[94], expected 127, is " << last_msg_.reserved[94]; - EXPECT_EQ(last_msg_.reserved[95], 3) << "incorrect value for last_msg_.reserved[95], expected 3, is " << last_msg_.reserved[95]; - EXPECT_EQ(last_msg_.reserved[96], 82) << "incorrect value for last_msg_.reserved[96], expected 82, is " << last_msg_.reserved[96]; - EXPECT_EQ(last_msg_.reserved[97], 133) << "incorrect value for last_msg_.reserved[97], expected 133, is " << last_msg_.reserved[97]; - EXPECT_EQ(last_msg_.reserved[98], 169) << "incorrect value for last_msg_.reserved[98], expected 169, is " << last_msg_.reserved[98]; - EXPECT_EQ(last_msg_.reserved[99], 12) << "incorrect value for last_msg_.reserved[99], expected 12, is " << last_msg_.reserved[99]; - EXPECT_EQ(last_msg_.reserved[100], 176) << "incorrect value for last_msg_.reserved[100], expected 176, is " << last_msg_.reserved[100]; - EXPECT_EQ(last_msg_.reserved[101], 193) << "incorrect value for last_msg_.reserved[101], expected 193, is " << last_msg_.reserved[101]; - EXPECT_EQ(last_msg_.reserved[102], 0) << "incorrect value for last_msg_.reserved[102], expected 0, is " << last_msg_.reserved[102]; - EXPECT_EQ(last_msg_.reserved[103], 24) << "incorrect value for last_msg_.reserved[103], expected 24, is " << last_msg_.reserved[103]; - EXPECT_EQ(last_msg_.reserved[104], 121) << "incorrect value for last_msg_.reserved[104], expected 121, is " << last_msg_.reserved[104]; - EXPECT_EQ(last_msg_.reserved[105], 85) << "incorrect value for last_msg_.reserved[105], expected 85, is " << last_msg_.reserved[105]; - EXPECT_EQ(last_msg_.reserved[106], 55) << "incorrect value for last_msg_.reserved[106], expected 55, is " << last_msg_.reserved[106]; - EXPECT_EQ(last_msg_.reserved[107], 214) << "incorrect value for last_msg_.reserved[107], expected 214, is " << last_msg_.reserved[107]; - EXPECT_EQ(last_msg_.reserved[108], 198) << "incorrect value for last_msg_.reserved[108], expected 198, is " << last_msg_.reserved[108]; - EXPECT_EQ(last_msg_.reserved[109], 75) << "incorrect value for last_msg_.reserved[109], expected 75, is " << last_msg_.reserved[109]; - EXPECT_EQ(last_msg_.reserved[110], 234) << "incorrect value for last_msg_.reserved[110], expected 234, is " << last_msg_.reserved[110]; - EXPECT_EQ(last_msg_.reserved[111], 179) << "incorrect value for last_msg_.reserved[111], expected 179, is " << last_msg_.reserved[111]; - EXPECT_EQ(last_msg_.reserved[112], 214) << "incorrect value for last_msg_.reserved[112], expected 214, is " << last_msg_.reserved[112]; - EXPECT_EQ(last_msg_.reserved[113], 85) << "incorrect value for last_msg_.reserved[113], expected 85, is " << last_msg_.reserved[113]; - EXPECT_EQ(last_msg_.reserved[114], 94) << "incorrect value for last_msg_.reserved[114], expected 94, is " << last_msg_.reserved[114]; - EXPECT_EQ(last_msg_.reserved[115], 115) << "incorrect value for last_msg_.reserved[115], expected 115, is " << last_msg_.reserved[115]; - EXPECT_EQ(last_msg_.reserved[116], 21) << "incorrect value for last_msg_.reserved[116], expected 21, is " << last_msg_.reserved[116]; - EXPECT_EQ(last_msg_.reserved[117], 73) << "incorrect value for last_msg_.reserved[117], expected 73, is " << last_msg_.reserved[117]; - EXPECT_EQ(last_msg_.reserved[118], 121) << "incorrect value for last_msg_.reserved[118], expected 121, is " << last_msg_.reserved[118]; - EXPECT_EQ(last_msg_.reserved[119], 75) << "incorrect value for last_msg_.reserved[119], expected 75, is " << last_msg_.reserved[119]; - EXPECT_EQ(last_msg_.reserved[120], 46) << "incorrect value for last_msg_.reserved[120], expected 46, is " << last_msg_.reserved[120]; - EXPECT_EQ(last_msg_.reserved[121], 158) << "incorrect value for last_msg_.reserved[121], expected 158, is " << last_msg_.reserved[121]; - EXPECT_EQ(last_msg_.reserved[122], 63) << "incorrect value for last_msg_.reserved[122], expected 63, is " << last_msg_.reserved[122]; - EXPECT_EQ(last_msg_.reserved[123], 100) << "incorrect value for last_msg_.reserved[123], expected 100, is " << last_msg_.reserved[123]; - EXPECT_EQ(last_msg_.reserved[124], 122) << "incorrect value for last_msg_.reserved[124], expected 122, is " << last_msg_.reserved[124]; - EXPECT_EQ(last_msg_.reserved[125], 213) << "incorrect value for last_msg_.reserved[125], expected 213, is " << last_msg_.reserved[125]; - EXPECT_EQ(last_msg_.reserved[126], 20) << "incorrect value for last_msg_.reserved[126], expected 20, is " << last_msg_.reserved[126]; - EXPECT_EQ(last_msg_.reserved[127], 85) << "incorrect value for last_msg_.reserved[127], expected 85, is " << last_msg_.reserved[127]; - EXPECT_EQ(last_msg_.reserved[128], 212) << "incorrect value for last_msg_.reserved[128], expected 212, is " << last_msg_.reserved[128]; - EXPECT_EQ(last_msg_.reserved[129], 131) << "incorrect value for last_msg_.reserved[129], expected 131, is " << last_msg_.reserved[129]; - EXPECT_EQ(last_msg_.reserved[130], 50) << "incorrect value for last_msg_.reserved[130], expected 50, is " << last_msg_.reserved[130]; - EXPECT_EQ(last_msg_.reserved[131], 224) << "incorrect value for last_msg_.reserved[131], expected 224, is " << last_msg_.reserved[131]; - EXPECT_EQ(last_msg_.reserved[132], 218) << "incorrect value for last_msg_.reserved[132], expected 218, is " << last_msg_.reserved[132]; - EXPECT_EQ(last_msg_.reserved[133], 215) << "incorrect value for last_msg_.reserved[133], expected 215, is " << last_msg_.reserved[133]; - EXPECT_EQ(last_msg_.reserved[134], 215) << "incorrect value for last_msg_.reserved[134], expected 215, is " << last_msg_.reserved[134]; - EXPECT_EQ(last_msg_.reserved[135], 149) << "incorrect value for last_msg_.reserved[135], expected 149, is " << last_msg_.reserved[135]; - EXPECT_EQ(last_msg_.reserved[136], 2) << "incorrect value for last_msg_.reserved[136], expected 2, is " << last_msg_.reserved[136]; - EXPECT_EQ(last_msg_.reserved[137], 19) << "incorrect value for last_msg_.reserved[137], expected 19, is " << last_msg_.reserved[137]; - EXPECT_EQ(last_msg_.reserved[138], 129) << "incorrect value for last_msg_.reserved[138], expected 129, is " << last_msg_.reserved[138]; - EXPECT_EQ(last_msg_.reserved[139], 39) << "incorrect value for last_msg_.reserved[139], expected 39, is " << last_msg_.reserved[139]; - EXPECT_EQ(last_msg_.reserved[140], 164) << "incorrect value for last_msg_.reserved[140], expected 164, is " << last_msg_.reserved[140]; - EXPECT_EQ(last_msg_.reserved[141], 5) << "incorrect value for last_msg_.reserved[141], expected 5, is " << last_msg_.reserved[141]; - EXPECT_EQ(last_msg_.reserved[142], 175) << "incorrect value for last_msg_.reserved[142], expected 175, is " << last_msg_.reserved[142]; - EXPECT_EQ(last_msg_.reserved[143], 6) << "incorrect value for last_msg_.reserved[143], expected 6, is " << last_msg_.reserved[143]; - EXPECT_EQ(last_msg_.reserved[144], 62) << "incorrect value for last_msg_.reserved[144], expected 62, is " << last_msg_.reserved[144]; - EXPECT_EQ(last_msg_.reserved[145], 51) << "incorrect value for last_msg_.reserved[145], expected 51, is " << last_msg_.reserved[145]; - EXPECT_EQ(last_msg_.reserved[146], 78) << "incorrect value for last_msg_.reserved[146], expected 78, is " << last_msg_.reserved[146]; - EXPECT_EQ(last_msg_.reserved[147], 66) << "incorrect value for last_msg_.reserved[147], expected 66, is " << last_msg_.reserved[147]; - EXPECT_EQ(last_msg_.reserved[148], 248) << "incorrect value for last_msg_.reserved[148], expected 248, is " << last_msg_.reserved[148]; - EXPECT_EQ(last_msg_.reserved[149], 116) << "incorrect value for last_msg_.reserved[149], expected 116, is " << last_msg_.reserved[149]; - EXPECT_EQ(last_msg_.reserved[150], 88) << "incorrect value for last_msg_.reserved[150], expected 88, is " << last_msg_.reserved[150]; - EXPECT_EQ(last_msg_.reserved[151], 90) << "incorrect value for last_msg_.reserved[151], expected 90, is " << last_msg_.reserved[151]; - EXPECT_EQ(last_msg_.reserved[152], 128) << "incorrect value for last_msg_.reserved[152], expected 128, is " << last_msg_.reserved[152]; - EXPECT_EQ(last_msg_.reserved[153], 226) << "incorrect value for last_msg_.reserved[153], expected 226, is " << last_msg_.reserved[153]; - EXPECT_EQ(last_msg_.reserved[154], 177) << "incorrect value for last_msg_.reserved[154], expected 177, is " << last_msg_.reserved[154]; - EXPECT_EQ(last_msg_.reserved[155], 0) << "incorrect value for last_msg_.reserved[155], expected 0, is " << last_msg_.reserved[155]; - EXPECT_EQ(last_msg_.reserved[156], 47) << "incorrect value for last_msg_.reserved[156], expected 47, is " << last_msg_.reserved[156]; - EXPECT_EQ(last_msg_.reserved[157], 140) << "incorrect value for last_msg_.reserved[157], expected 140, is " << last_msg_.reserved[157]; - EXPECT_EQ(last_msg_.reserved[158], 33) << "incorrect value for last_msg_.reserved[158], expected 33, is " << last_msg_.reserved[158]; - EXPECT_EQ(last_msg_.reserved[159], 126) << "incorrect value for last_msg_.reserved[159], expected 126, is " << last_msg_.reserved[159]; - EXPECT_EQ(last_msg_.reserved[160], 221) << "incorrect value for last_msg_.reserved[160], expected 221, is " << last_msg_.reserved[160]; - EXPECT_EQ(last_msg_.reserved[161], 110) << "incorrect value for last_msg_.reserved[161], expected 110, is " << last_msg_.reserved[161]; - EXPECT_EQ(last_msg_.reserved[162], 144) << "incorrect value for last_msg_.reserved[162], expected 144, is " << last_msg_.reserved[162]; - EXPECT_EQ(last_msg_.reserved[163], 97) << "incorrect value for last_msg_.reserved[163], expected 97, is " << last_msg_.reserved[163]; - EXPECT_EQ(last_msg_.reserved[164], 74) << "incorrect value for last_msg_.reserved[164], expected 74, is " << last_msg_.reserved[164]; - EXPECT_EQ(last_msg_.reserved[165], 250) << "incorrect value for last_msg_.reserved[165], expected 250, is " << last_msg_.reserved[165]; - EXPECT_EQ(last_msg_.reserved[166], 181) << "incorrect value for last_msg_.reserved[166], expected 181, is " << last_msg_.reserved[166]; - EXPECT_EQ(last_msg_.reserved[167], 199) << "incorrect value for last_msg_.reserved[167], expected 199, is " << last_msg_.reserved[167]; - EXPECT_EQ(last_msg_.reserved[168], 27) << "incorrect value for last_msg_.reserved[168], expected 27, is " << last_msg_.reserved[168]; - EXPECT_EQ(last_msg_.reserved[169], 176) << "incorrect value for last_msg_.reserved[169], expected 176, is " << last_msg_.reserved[169]; - EXPECT_EQ(last_msg_.reserved[170], 65) << "incorrect value for last_msg_.reserved[170], expected 65, is " << last_msg_.reserved[170]; - EXPECT_EQ(last_msg_.reserved[171], 185) << "incorrect value for last_msg_.reserved[171], expected 185, is " << last_msg_.reserved[171]; - EXPECT_EQ(last_msg_.reserved[172], 110) << "incorrect value for last_msg_.reserved[172], expected 110, is " << last_msg_.reserved[172]; - EXPECT_EQ(last_msg_.reserved[173], 92) << "incorrect value for last_msg_.reserved[173], expected 92, is " << last_msg_.reserved[173]; - EXPECT_EQ(last_msg_.reserved[174], 34) << "incorrect value for last_msg_.reserved[174], expected 34, is " << last_msg_.reserved[174]; - EXPECT_EQ(last_msg_.reserved[175], 44) << "incorrect value for last_msg_.reserved[175], expected 44, is " << last_msg_.reserved[175]; - EXPECT_EQ(last_msg_.reserved[176], 131) << "incorrect value for last_msg_.reserved[176], expected 131, is " << last_msg_.reserved[176]; - EXPECT_EQ(last_msg_.reserved[177], 96) << "incorrect value for last_msg_.reserved[177], expected 96, is " << last_msg_.reserved[177]; - EXPECT_EQ(last_msg_.reserved[178], 178) << "incorrect value for last_msg_.reserved[178], expected 178, is " << last_msg_.reserved[178]; - EXPECT_EQ(last_msg_.reserved[179], 40) << "incorrect value for last_msg_.reserved[179], expected 40, is " << last_msg_.reserved[179]; - EXPECT_EQ(last_msg_.reserved[180], 176) << "incorrect value for last_msg_.reserved[180], expected 176, is " << last_msg_.reserved[180]; - EXPECT_EQ(last_msg_.reserved[181], 4) << "incorrect value for last_msg_.reserved[181], expected 4, is " << last_msg_.reserved[181]; - EXPECT_EQ(last_msg_.reserved[182], 90) << "incorrect value for last_msg_.reserved[182], expected 90, is " << last_msg_.reserved[182]; - EXPECT_EQ(last_msg_.reserved[183], 36) << "incorrect value for last_msg_.reserved[183], expected 36, is " << last_msg_.reserved[183]; - EXPECT_EQ(last_msg_.reserved[184], 7) << "incorrect value for last_msg_.reserved[184], expected 7, is " << last_msg_.reserved[184]; - EXPECT_EQ(last_msg_.reserved[185], 180) << "incorrect value for last_msg_.reserved[185], expected 180, is " << last_msg_.reserved[185]; - EXPECT_EQ(last_msg_.reserved[186], 244) << "incorrect value for last_msg_.reserved[186], expected 244, is " << last_msg_.reserved[186]; - EXPECT_EQ(last_msg_.reserved[187], 244) << "incorrect value for last_msg_.reserved[187], expected 244, is " << last_msg_.reserved[187]; - EXPECT_EQ(last_msg_.reserved[188], 23) << "incorrect value for last_msg_.reserved[188], expected 23, is " << last_msg_.reserved[188]; - EXPECT_EQ(last_msg_.reserved[189], 108) << "incorrect value for last_msg_.reserved[189], expected 108, is " << last_msg_.reserved[189]; - EXPECT_EQ(last_msg_.reserved[190], 171) << "incorrect value for last_msg_.reserved[190], expected 171, is " << last_msg_.reserved[190]; - EXPECT_EQ(last_msg_.reserved[191], 204) << "incorrect value for last_msg_.reserved[191], expected 204, is " << last_msg_.reserved[191]; - EXPECT_EQ(last_msg_.reserved[192], 196) << "incorrect value for last_msg_.reserved[192], expected 196, is " << last_msg_.reserved[192]; - EXPECT_EQ(last_msg_.reserved[193], 61) << "incorrect value for last_msg_.reserved[193], expected 61, is " << last_msg_.reserved[193]; - EXPECT_EQ(last_msg_.reserved[194], 51) << "incorrect value for last_msg_.reserved[194], expected 51, is " << last_msg_.reserved[194]; - EXPECT_EQ(last_msg_.reserved[195], 179) << "incorrect value for last_msg_.reserved[195], expected 179, is " << last_msg_.reserved[195]; - EXPECT_EQ(last_msg_.reserved[196], 242) << "incorrect value for last_msg_.reserved[196], expected 242, is " << last_msg_.reserved[196]; - EXPECT_EQ(last_msg_.reserved[197], 156) << "incorrect value for last_msg_.reserved[197], expected 156, is " << last_msg_.reserved[197]; - EXPECT_EQ(last_msg_.reserved[198], 81) << "incorrect value for last_msg_.reserved[198], expected 81, is " << last_msg_.reserved[198]; - EXPECT_EQ(last_msg_.reserved[199], 83) << "incorrect value for last_msg_.reserved[199], expected 83, is " << last_msg_.reserved[199]; - EXPECT_EQ(last_msg_.reserved[200], 16) << "incorrect value for last_msg_.reserved[200], expected 16, is " << last_msg_.reserved[200]; - EXPECT_EQ(last_msg_.reserved[201], 15) << "incorrect value for last_msg_.reserved[201], expected 15, is " << last_msg_.reserved[201]; - EXPECT_EQ(last_msg_.reserved[202], 134) << "incorrect value for last_msg_.reserved[202], expected 134, is " << last_msg_.reserved[202]; - EXPECT_EQ(last_msg_.reserved[203], 40) << "incorrect value for last_msg_.reserved[203], expected 40, is " << last_msg_.reserved[203]; - EXPECT_EQ(last_msg_.reserved[204], 245) << "incorrect value for last_msg_.reserved[204], expected 245, is " << last_msg_.reserved[204]; - EXPECT_EQ(last_msg_.reserved[205], 253) << "incorrect value for last_msg_.reserved[205], expected 253, is " << last_msg_.reserved[205]; - EXPECT_EQ(last_msg_.reserved[206], 150) << "incorrect value for last_msg_.reserved[206], expected 150, is " << last_msg_.reserved[206]; - EXPECT_EQ(last_msg_.reserved[207], 94) << "incorrect value for last_msg_.reserved[207], expected 94, is " << last_msg_.reserved[207]; - EXPECT_EQ(last_msg_.reserved[208], 150) << "incorrect value for last_msg_.reserved[208], expected 150, is " << last_msg_.reserved[208]; - EXPECT_EQ(last_msg_.reserved[209], 144) << "incorrect value for last_msg_.reserved[209], expected 144, is " << last_msg_.reserved[209]; - EXPECT_EQ(last_msg_.reserved[210], 197) << "incorrect value for last_msg_.reserved[210], expected 197, is " << last_msg_.reserved[210]; - EXPECT_EQ(last_msg_.reserved[211], 113) << "incorrect value for last_msg_.reserved[211], expected 113, is " << last_msg_.reserved[211]; - EXPECT_EQ(last_msg_.reserved[212], 5) << "incorrect value for last_msg_.reserved[212], expected 5, is " << last_msg_.reserved[212]; - EXPECT_EQ(last_msg_.reserved[213], 141) << "incorrect value for last_msg_.reserved[213], expected 141, is " << last_msg_.reserved[213]; - EXPECT_EQ(last_msg_.reserved[214], 232) << "incorrect value for last_msg_.reserved[214], expected 232, is " << last_msg_.reserved[214]; - EXPECT_EQ(last_msg_.reserved[215], 33) << "incorrect value for last_msg_.reserved[215], expected 33, is " << last_msg_.reserved[215]; - EXPECT_EQ(last_msg_.reserved[216], 101) << "incorrect value for last_msg_.reserved[216], expected 101, is " << last_msg_.reserved[216]; - EXPECT_EQ(last_msg_.reserved[217], 231) << "incorrect value for last_msg_.reserved[217], expected 231, is " << last_msg_.reserved[217]; - EXPECT_EQ(last_msg_.reserved[218], 38) << "incorrect value for last_msg_.reserved[218], expected 38, is " << last_msg_.reserved[218]; - EXPECT_EQ(last_msg_.reserved[219], 75) << "incorrect value for last_msg_.reserved[219], expected 75, is " << last_msg_.reserved[219]; - EXPECT_EQ(last_msg_.reserved[220], 178) << "incorrect value for last_msg_.reserved[220], expected 178, is " << last_msg_.reserved[220]; - EXPECT_EQ(last_msg_.reserved[221], 243) << "incorrect value for last_msg_.reserved[221], expected 243, is " << last_msg_.reserved[221]; - EXPECT_EQ(last_msg_.reserved[222], 119) << "incorrect value for last_msg_.reserved[222], expected 119, is " << last_msg_.reserved[222]; - EXPECT_EQ(last_msg_.reserved[223], 1) << "incorrect value for last_msg_.reserved[223], expected 1, is " << last_msg_.reserved[223]; - EXPECT_EQ(last_msg_.reserved[224], 248) << "incorrect value for last_msg_.reserved[224], expected 248, is " << last_msg_.reserved[224]; - EXPECT_EQ(last_msg_.reserved[225], 218) << "incorrect value for last_msg_.reserved[225], expected 218, is " << last_msg_.reserved[225]; - EXPECT_EQ(last_msg_.reserved[226], 86) << "incorrect value for last_msg_.reserved[226], expected 86, is " << last_msg_.reserved[226]; - EXPECT_EQ(last_msg_.reserved[227], 7) << "incorrect value for last_msg_.reserved[227], expected 7, is " << last_msg_.reserved[227]; - EXPECT_EQ(last_msg_.reserved[228], 88) << "incorrect value for last_msg_.reserved[228], expected 88, is " << last_msg_.reserved[228]; - EXPECT_EQ(last_msg_.reserved[229], 197) << "incorrect value for last_msg_.reserved[229], expected 197, is " << last_msg_.reserved[229]; - EXPECT_EQ(last_msg_.reserved[230], 148) << "incorrect value for last_msg_.reserved[230], expected 148, is " << last_msg_.reserved[230]; - EXPECT_EQ(last_msg_.reserved[231], 240) << "incorrect value for last_msg_.reserved[231], expected 240, is " << last_msg_.reserved[231]; - EXPECT_EQ(last_msg_.reserved[232], 227) << "incorrect value for last_msg_.reserved[232], expected 227, is " << last_msg_.reserved[232]; - EXPECT_EQ(last_msg_.reserved[233], 2) << "incorrect value for last_msg_.reserved[233], expected 2, is " << last_msg_.reserved[233]; - EXPECT_EQ(last_msg_.reserved[234], 65) << "incorrect value for last_msg_.reserved[234], expected 65, is " << last_msg_.reserved[234]; - EXPECT_EQ(last_msg_.reserved[235], 173) << "incorrect value for last_msg_.reserved[235], expected 173, is " << last_msg_.reserved[235]; - EXPECT_EQ(last_msg_.reserved[236], 122) << "incorrect value for last_msg_.reserved[236], expected 122, is " << last_msg_.reserved[236]; - EXPECT_EQ(last_msg_.reserved[237], 143) << "incorrect value for last_msg_.reserved[237], expected 143, is " << last_msg_.reserved[237]; - EXPECT_EQ(last_msg_.reserved[238], 251) << "incorrect value for last_msg_.reserved[238], expected 251, is " << last_msg_.reserved[238]; - EXPECT_EQ(last_msg_.reserved[239], 156) << "incorrect value for last_msg_.reserved[239], expected 156, is " << last_msg_.reserved[239]; - EXPECT_EQ(last_msg_.reserved[240], 217) << "incorrect value for last_msg_.reserved[240], expected 217, is " << last_msg_.reserved[240]; - EXPECT_EQ(last_msg_.reserved[241], 67) << "incorrect value for last_msg_.reserved[241], expected 67, is " << last_msg_.reserved[241]; - EXPECT_EQ(last_msg_.reserved[242], 239) << "incorrect value for last_msg_.reserved[242], expected 239, is " << last_msg_.reserved[242]; - EXPECT_EQ(last_msg_.reserved[243], 219) << "incorrect value for last_msg_.reserved[243], expected 219, is " << last_msg_.reserved[243]; - EXPECT_EQ(last_msg_.reserved[244], 31) << "incorrect value for last_msg_.reserved[244], expected 31, is " << last_msg_.reserved[244]; - EXPECT_EQ(last_msg_.reserved[245], 224) << "incorrect value for last_msg_.reserved[245], expected 224, is " << last_msg_.reserved[245]; - EXPECT_EQ(last_msg_.reserved[246], 176) << "incorrect value for last_msg_.reserved[246], expected 176, is " << last_msg_.reserved[246]; - EXPECT_EQ(last_msg_.reserved[247], 129) << "incorrect value for last_msg_.reserved[247], expected 129, is " << last_msg_.reserved[247]; - EXPECT_EQ(last_msg_.reserved[248], 81) << "incorrect value for last_msg_.reserved[248], expected 81, is " << last_msg_.reserved[248]; - EXPECT_EQ(last_msg_.reserved[249], 80) << "incorrect value for last_msg_.reserved[249], expected 80, is " << last_msg_.reserved[249]; - EXPECT_LT((last_msg_.signal_error_rate * 100 - 8588.20019531 * 100), 0.05) << "incorrect value for last_msg_.signal_error_rate, expected 8588.20019531, is " << last_msg_.signal_error_rate; - EXPECT_EQ(last_msg_.signal_strength, 103) << "incorrect value for last_msg_.signal_strength, expected 103, is " << last_msg_.signal_strength; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgCellModemStatus0, Test) { + uint8_t encoded_frame[] = { + 85, 190, 0, 19, 27, 255, 103, 205, 48, 6, 70, 123, 242, 46, 52, + 64, 176, 154, 98, 43, 132, 196, 89, 253, 161, 250, 174, 204, 110, 47, + 38, 187, 63, 102, 177, 162, 49, 80, 194, 37, 107, 60, 225, 52, 101, + 178, 142, 246, 21, 17, 93, 75, 169, 86, 16, 209, 80, 243, 30, 206, + 220, 206, 115, 47, 154, 91, 227, 88, 11, 1, 85, 146, 100, 190, 232, + 207, 61, 61, 201, 220, 31, 78, 34, 57, 82, 59, 104, 65, 221, 0, + 43, 210, 9, 32, 122, 29, 237, 11, 151, 223, 18, 81, 204, 172, 234, + 127, 3, 82, 133, 169, 12, 176, 193, 0, 24, 121, 85, 55, 214, 198, + 75, 234, 179, 214, 85, 94, 115, 21, 73, 121, 75, 46, 158, 63, 100, + 122, 213, 20, 85, 212, 131, 50, 224, 218, 215, 215, 149, 2, 19, 129, + 39, 164, 5, 175, 6, 62, 51, 78, 66, 248, 116, 88, 90, 128, 226, + 177, 0, 47, 140, 33, 126, 221, 110, 144, 97, 74, 250, 181, 199, 27, + 176, 65, 185, 110, 92, 34, 44, 131, 96, 178, 40, 176, 4, 90, 36, + 7, 180, 244, 244, 23, 108, 171, 204, 196, 61, 51, 179, 242, 156, 81, + 83, 16, 15, 134, 40, 245, 253, 150, 94, 150, 144, 197, 113, 5, 141, + 232, 33, 101, 231, 38, 75, 178, 243, 119, 1, 248, 218, 86, 7, 88, + 197, 148, 240, 227, 2, 65, 173, 122, 143, 251, 156, 217, 67, 239, 219, + 31, 224, 176, 129, 81, 80, 40, 230, + }; + + sbp_msg_cell_modem_status_t test_msg{}; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_reserved.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)114, (char)101, (char)115, (char)101, + (char)114, (char)118, (char)101, (char)100}; + memcpy(test_msg.n_reserved.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_reserved.value = 250; + + test_msg.reserved[0] = 123; + + test_msg.reserved[1] = 242; + + test_msg.reserved[2] = 46; + + test_msg.reserved[3] = 52; + + test_msg.reserved[4] = 64; + + test_msg.reserved[5] = 176; + + test_msg.reserved[6] = 154; + + test_msg.reserved[7] = 98; + + test_msg.reserved[8] = 43; + + test_msg.reserved[9] = 132; + + test_msg.reserved[10] = 196; + + test_msg.reserved[11] = 89; + + test_msg.reserved[12] = 253; + + test_msg.reserved[13] = 161; + + test_msg.reserved[14] = 250; + + test_msg.reserved[15] = 174; + + test_msg.reserved[16] = 204; + + test_msg.reserved[17] = 110; + + test_msg.reserved[18] = 47; + + test_msg.reserved[19] = 38; + + test_msg.reserved[20] = 187; + + test_msg.reserved[21] = 63; + + test_msg.reserved[22] = 102; + + test_msg.reserved[23] = 177; + + test_msg.reserved[24] = 162; + + test_msg.reserved[25] = 49; + + test_msg.reserved[26] = 80; + + test_msg.reserved[27] = 194; + + test_msg.reserved[28] = 37; + + test_msg.reserved[29] = 107; + + test_msg.reserved[30] = 60; + + test_msg.reserved[31] = 225; + + test_msg.reserved[32] = 52; + + test_msg.reserved[33] = 101; + + test_msg.reserved[34] = 178; + + test_msg.reserved[35] = 142; + + test_msg.reserved[36] = 246; + + test_msg.reserved[37] = 21; + + test_msg.reserved[38] = 17; + + test_msg.reserved[39] = 93; + + test_msg.reserved[40] = 75; + + test_msg.reserved[41] = 169; + + test_msg.reserved[42] = 86; + + test_msg.reserved[43] = 16; + + test_msg.reserved[44] = 209; + + test_msg.reserved[45] = 80; + + test_msg.reserved[46] = 243; + + test_msg.reserved[47] = 30; + + test_msg.reserved[48] = 206; + + test_msg.reserved[49] = 220; + + test_msg.reserved[50] = 206; + + test_msg.reserved[51] = 115; + + test_msg.reserved[52] = 47; + + test_msg.reserved[53] = 154; + + test_msg.reserved[54] = 91; + + test_msg.reserved[55] = 227; + + test_msg.reserved[56] = 88; + + test_msg.reserved[57] = 11; + + test_msg.reserved[58] = 1; + + test_msg.reserved[59] = 85; + + test_msg.reserved[60] = 146; + + test_msg.reserved[61] = 100; + + test_msg.reserved[62] = 190; + + test_msg.reserved[63] = 232; + + test_msg.reserved[64] = 207; + + test_msg.reserved[65] = 61; + + test_msg.reserved[66] = 61; + + test_msg.reserved[67] = 201; + + test_msg.reserved[68] = 220; + + test_msg.reserved[69] = 31; + + test_msg.reserved[70] = 78; + + test_msg.reserved[71] = 34; + + test_msg.reserved[72] = 57; + + test_msg.reserved[73] = 82; + + test_msg.reserved[74] = 59; + + test_msg.reserved[75] = 104; + + test_msg.reserved[76] = 65; + + test_msg.reserved[77] = 221; + + test_msg.reserved[78] = 0; + + test_msg.reserved[79] = 43; + + test_msg.reserved[80] = 210; + + test_msg.reserved[81] = 9; + + test_msg.reserved[82] = 32; + + test_msg.reserved[83] = 122; + + test_msg.reserved[84] = 29; + + test_msg.reserved[85] = 237; + + test_msg.reserved[86] = 11; + + test_msg.reserved[87] = 151; + + test_msg.reserved[88] = 223; + + test_msg.reserved[89] = 18; + + test_msg.reserved[90] = 81; + + test_msg.reserved[91] = 204; + + test_msg.reserved[92] = 172; + + test_msg.reserved[93] = 234; + + test_msg.reserved[94] = 127; + + test_msg.reserved[95] = 3; + + test_msg.reserved[96] = 82; + + test_msg.reserved[97] = 133; + + test_msg.reserved[98] = 169; + + test_msg.reserved[99] = 12; + + test_msg.reserved[100] = 176; + + test_msg.reserved[101] = 193; + + test_msg.reserved[102] = 0; + + test_msg.reserved[103] = 24; + + test_msg.reserved[104] = 121; + + test_msg.reserved[105] = 85; + + test_msg.reserved[106] = 55; + + test_msg.reserved[107] = 214; + + test_msg.reserved[108] = 198; + + test_msg.reserved[109] = 75; + + test_msg.reserved[110] = 234; + + test_msg.reserved[111] = 179; + + test_msg.reserved[112] = 214; + + test_msg.reserved[113] = 85; + + test_msg.reserved[114] = 94; + + test_msg.reserved[115] = 115; + + test_msg.reserved[116] = 21; + + test_msg.reserved[117] = 73; + + test_msg.reserved[118] = 121; + + test_msg.reserved[119] = 75; + + test_msg.reserved[120] = 46; + + test_msg.reserved[121] = 158; + + test_msg.reserved[122] = 63; + + test_msg.reserved[123] = 100; + + test_msg.reserved[124] = 122; + + test_msg.reserved[125] = 213; + + test_msg.reserved[126] = 20; + + test_msg.reserved[127] = 85; + + test_msg.reserved[128] = 212; + + test_msg.reserved[129] = 131; + + test_msg.reserved[130] = 50; + + test_msg.reserved[131] = 224; + + test_msg.reserved[132] = 218; + + test_msg.reserved[133] = 215; + + test_msg.reserved[134] = 215; + + test_msg.reserved[135] = 149; + + test_msg.reserved[136] = 2; + + test_msg.reserved[137] = 19; + + test_msg.reserved[138] = 129; + + test_msg.reserved[139] = 39; + + test_msg.reserved[140] = 164; + + test_msg.reserved[141] = 5; + + test_msg.reserved[142] = 175; + + test_msg.reserved[143] = 6; + + test_msg.reserved[144] = 62; + + test_msg.reserved[145] = 51; + + test_msg.reserved[146] = 78; + + test_msg.reserved[147] = 66; + + test_msg.reserved[148] = 248; + + test_msg.reserved[149] = 116; + + test_msg.reserved[150] = 88; + + test_msg.reserved[151] = 90; + + test_msg.reserved[152] = 128; + + test_msg.reserved[153] = 226; + + test_msg.reserved[154] = 177; + + test_msg.reserved[155] = 0; + + test_msg.reserved[156] = 47; + + test_msg.reserved[157] = 140; + + test_msg.reserved[158] = 33; + + test_msg.reserved[159] = 126; + + test_msg.reserved[160] = 221; + + test_msg.reserved[161] = 110; + + test_msg.reserved[162] = 144; + + test_msg.reserved[163] = 97; + + test_msg.reserved[164] = 74; + + test_msg.reserved[165] = 250; + + test_msg.reserved[166] = 181; + + test_msg.reserved[167] = 199; + + test_msg.reserved[168] = 27; + + test_msg.reserved[169] = 176; + + test_msg.reserved[170] = 65; + + test_msg.reserved[171] = 185; + + test_msg.reserved[172] = 110; + + test_msg.reserved[173] = 92; + + test_msg.reserved[174] = 34; + + test_msg.reserved[175] = 44; + + test_msg.reserved[176] = 131; + + test_msg.reserved[177] = 96; + + test_msg.reserved[178] = 178; + + test_msg.reserved[179] = 40; + + test_msg.reserved[180] = 176; + + test_msg.reserved[181] = 4; + + test_msg.reserved[182] = 90; + + test_msg.reserved[183] = 36; + + test_msg.reserved[184] = 7; + + test_msg.reserved[185] = 180; + + test_msg.reserved[186] = 244; + + test_msg.reserved[187] = 244; + + test_msg.reserved[188] = 23; + + test_msg.reserved[189] = 108; + + test_msg.reserved[190] = 171; + + test_msg.reserved[191] = 204; + + test_msg.reserved[192] = 196; + + test_msg.reserved[193] = 61; + + test_msg.reserved[194] = 51; + + test_msg.reserved[195] = 179; + + test_msg.reserved[196] = 242; + + test_msg.reserved[197] = 156; + + test_msg.reserved[198] = 81; + + test_msg.reserved[199] = 83; + + test_msg.reserved[200] = 16; + + test_msg.reserved[201] = 15; + + test_msg.reserved[202] = 134; + + test_msg.reserved[203] = 40; + + test_msg.reserved[204] = 245; + + test_msg.reserved[205] = 253; + + test_msg.reserved[206] = 150; + + test_msg.reserved[207] = 94; + + test_msg.reserved[208] = 150; + + test_msg.reserved[209] = 144; + + test_msg.reserved[210] = 197; + + test_msg.reserved[211] = 113; + + test_msg.reserved[212] = 5; + + test_msg.reserved[213] = 141; + + test_msg.reserved[214] = 232; + + test_msg.reserved[215] = 33; + + test_msg.reserved[216] = 101; + + test_msg.reserved[217] = 231; + + test_msg.reserved[218] = 38; + + test_msg.reserved[219] = 75; + + test_msg.reserved[220] = 178; + + test_msg.reserved[221] = 243; + + test_msg.reserved[222] = 119; + + test_msg.reserved[223] = 1; + + test_msg.reserved[224] = 248; + + test_msg.reserved[225] = 218; + + test_msg.reserved[226] = 86; + + test_msg.reserved[227] = 7; + + test_msg.reserved[228] = 88; + + test_msg.reserved[229] = 197; + + test_msg.reserved[230] = 148; + + test_msg.reserved[231] = 240; + + test_msg.reserved[232] = 227; + + test_msg.reserved[233] = 2; + + test_msg.reserved[234] = 65; + + test_msg.reserved[235] = 173; + + test_msg.reserved[236] = 122; + + test_msg.reserved[237] = 143; + + test_msg.reserved[238] = 251; + + test_msg.reserved[239] = 156; + + test_msg.reserved[240] = 217; + + test_msg.reserved[241] = 67; + + test_msg.reserved[242] = 239; + + test_msg.reserved[243] = 219; + + test_msg.reserved[244] = 31; + + test_msg.reserved[245] = 224; + + test_msg.reserved[246] = 176; + + test_msg.reserved[247] = 129; + + test_msg.reserved[248] = 81; + + test_msg.reserved[249] = 80; + test_msg.signal_error_rate = 8588.2001953125; + test_msg.signal_strength = 103; + + EXPECT_EQ(send_message(6931, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 6931); + EXPECT_EQ(last_msg_, test_msg); + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_reserved.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_reserved.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_reserved.handle_as << "'"; + } + { + const char check_string[] = {(char)114, (char)101, (char)115, (char)101, + (char)114, (char)118, (char)101, (char)100}; + EXPECT_EQ(memcmp(last_msg_.n_reserved.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_reserved.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_reserved.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_reserved.value, 250) + << "incorrect value for last_msg_.n_reserved.value, expected 250, is " + << last_msg_.n_reserved.value; + EXPECT_EQ(last_msg_.reserved[0], 123) + << "incorrect value for last_msg_.reserved[0], expected 123, is " + << last_msg_.reserved[0]; + EXPECT_EQ(last_msg_.reserved[1], 242) + << "incorrect value for last_msg_.reserved[1], expected 242, is " + << last_msg_.reserved[1]; + EXPECT_EQ(last_msg_.reserved[2], 46) + << "incorrect value for last_msg_.reserved[2], expected 46, is " + << last_msg_.reserved[2]; + EXPECT_EQ(last_msg_.reserved[3], 52) + << "incorrect value for last_msg_.reserved[3], expected 52, is " + << last_msg_.reserved[3]; + EXPECT_EQ(last_msg_.reserved[4], 64) + << "incorrect value for last_msg_.reserved[4], expected 64, is " + << last_msg_.reserved[4]; + EXPECT_EQ(last_msg_.reserved[5], 176) + << "incorrect value for last_msg_.reserved[5], expected 176, is " + << last_msg_.reserved[5]; + EXPECT_EQ(last_msg_.reserved[6], 154) + << "incorrect value for last_msg_.reserved[6], expected 154, is " + << last_msg_.reserved[6]; + EXPECT_EQ(last_msg_.reserved[7], 98) + << "incorrect value for last_msg_.reserved[7], expected 98, is " + << last_msg_.reserved[7]; + EXPECT_EQ(last_msg_.reserved[8], 43) + << "incorrect value for last_msg_.reserved[8], expected 43, is " + << last_msg_.reserved[8]; + EXPECT_EQ(last_msg_.reserved[9], 132) + << "incorrect value for last_msg_.reserved[9], expected 132, is " + << last_msg_.reserved[9]; + EXPECT_EQ(last_msg_.reserved[10], 196) + << "incorrect value for last_msg_.reserved[10], expected 196, is " + << last_msg_.reserved[10]; + EXPECT_EQ(last_msg_.reserved[11], 89) + << "incorrect value for last_msg_.reserved[11], expected 89, is " + << last_msg_.reserved[11]; + EXPECT_EQ(last_msg_.reserved[12], 253) + << "incorrect value for last_msg_.reserved[12], expected 253, is " + << last_msg_.reserved[12]; + EXPECT_EQ(last_msg_.reserved[13], 161) + << "incorrect value for last_msg_.reserved[13], expected 161, is " + << last_msg_.reserved[13]; + EXPECT_EQ(last_msg_.reserved[14], 250) + << "incorrect value for last_msg_.reserved[14], expected 250, is " + << last_msg_.reserved[14]; + EXPECT_EQ(last_msg_.reserved[15], 174) + << "incorrect value for last_msg_.reserved[15], expected 174, is " + << last_msg_.reserved[15]; + EXPECT_EQ(last_msg_.reserved[16], 204) + << "incorrect value for last_msg_.reserved[16], expected 204, is " + << last_msg_.reserved[16]; + EXPECT_EQ(last_msg_.reserved[17], 110) + << "incorrect value for last_msg_.reserved[17], expected 110, is " + << last_msg_.reserved[17]; + EXPECT_EQ(last_msg_.reserved[18], 47) + << "incorrect value for last_msg_.reserved[18], expected 47, is " + << last_msg_.reserved[18]; + EXPECT_EQ(last_msg_.reserved[19], 38) + << "incorrect value for last_msg_.reserved[19], expected 38, is " + << last_msg_.reserved[19]; + EXPECT_EQ(last_msg_.reserved[20], 187) + << "incorrect value for last_msg_.reserved[20], expected 187, is " + << last_msg_.reserved[20]; + EXPECT_EQ(last_msg_.reserved[21], 63) + << "incorrect value for last_msg_.reserved[21], expected 63, is " + << last_msg_.reserved[21]; + EXPECT_EQ(last_msg_.reserved[22], 102) + << "incorrect value for last_msg_.reserved[22], expected 102, is " + << last_msg_.reserved[22]; + EXPECT_EQ(last_msg_.reserved[23], 177) + << "incorrect value for last_msg_.reserved[23], expected 177, is " + << last_msg_.reserved[23]; + EXPECT_EQ(last_msg_.reserved[24], 162) + << "incorrect value for last_msg_.reserved[24], expected 162, is " + << last_msg_.reserved[24]; + EXPECT_EQ(last_msg_.reserved[25], 49) + << "incorrect value for last_msg_.reserved[25], expected 49, is " + << last_msg_.reserved[25]; + EXPECT_EQ(last_msg_.reserved[26], 80) + << "incorrect value for last_msg_.reserved[26], expected 80, is " + << last_msg_.reserved[26]; + EXPECT_EQ(last_msg_.reserved[27], 194) + << "incorrect value for last_msg_.reserved[27], expected 194, is " + << last_msg_.reserved[27]; + EXPECT_EQ(last_msg_.reserved[28], 37) + << "incorrect value for last_msg_.reserved[28], expected 37, is " + << last_msg_.reserved[28]; + EXPECT_EQ(last_msg_.reserved[29], 107) + << "incorrect value for last_msg_.reserved[29], expected 107, is " + << last_msg_.reserved[29]; + EXPECT_EQ(last_msg_.reserved[30], 60) + << "incorrect value for last_msg_.reserved[30], expected 60, is " + << last_msg_.reserved[30]; + EXPECT_EQ(last_msg_.reserved[31], 225) + << "incorrect value for last_msg_.reserved[31], expected 225, is " + << last_msg_.reserved[31]; + EXPECT_EQ(last_msg_.reserved[32], 52) + << "incorrect value for last_msg_.reserved[32], expected 52, is " + << last_msg_.reserved[32]; + EXPECT_EQ(last_msg_.reserved[33], 101) + << "incorrect value for last_msg_.reserved[33], expected 101, is " + << last_msg_.reserved[33]; + EXPECT_EQ(last_msg_.reserved[34], 178) + << "incorrect value for last_msg_.reserved[34], expected 178, is " + << last_msg_.reserved[34]; + EXPECT_EQ(last_msg_.reserved[35], 142) + << "incorrect value for last_msg_.reserved[35], expected 142, is " + << last_msg_.reserved[35]; + EXPECT_EQ(last_msg_.reserved[36], 246) + << "incorrect value for last_msg_.reserved[36], expected 246, is " + << last_msg_.reserved[36]; + EXPECT_EQ(last_msg_.reserved[37], 21) + << "incorrect value for last_msg_.reserved[37], expected 21, is " + << last_msg_.reserved[37]; + EXPECT_EQ(last_msg_.reserved[38], 17) + << "incorrect value for last_msg_.reserved[38], expected 17, is " + << last_msg_.reserved[38]; + EXPECT_EQ(last_msg_.reserved[39], 93) + << "incorrect value for last_msg_.reserved[39], expected 93, is " + << last_msg_.reserved[39]; + EXPECT_EQ(last_msg_.reserved[40], 75) + << "incorrect value for last_msg_.reserved[40], expected 75, is " + << last_msg_.reserved[40]; + EXPECT_EQ(last_msg_.reserved[41], 169) + << "incorrect value for last_msg_.reserved[41], expected 169, is " + << last_msg_.reserved[41]; + EXPECT_EQ(last_msg_.reserved[42], 86) + << "incorrect value for last_msg_.reserved[42], expected 86, is " + << last_msg_.reserved[42]; + EXPECT_EQ(last_msg_.reserved[43], 16) + << "incorrect value for last_msg_.reserved[43], expected 16, is " + << last_msg_.reserved[43]; + EXPECT_EQ(last_msg_.reserved[44], 209) + << "incorrect value for last_msg_.reserved[44], expected 209, is " + << last_msg_.reserved[44]; + EXPECT_EQ(last_msg_.reserved[45], 80) + << "incorrect value for last_msg_.reserved[45], expected 80, is " + << last_msg_.reserved[45]; + EXPECT_EQ(last_msg_.reserved[46], 243) + << "incorrect value for last_msg_.reserved[46], expected 243, is " + << last_msg_.reserved[46]; + EXPECT_EQ(last_msg_.reserved[47], 30) + << "incorrect value for last_msg_.reserved[47], expected 30, is " + << last_msg_.reserved[47]; + EXPECT_EQ(last_msg_.reserved[48], 206) + << "incorrect value for last_msg_.reserved[48], expected 206, is " + << last_msg_.reserved[48]; + EXPECT_EQ(last_msg_.reserved[49], 220) + << "incorrect value for last_msg_.reserved[49], expected 220, is " + << last_msg_.reserved[49]; + EXPECT_EQ(last_msg_.reserved[50], 206) + << "incorrect value for last_msg_.reserved[50], expected 206, is " + << last_msg_.reserved[50]; + EXPECT_EQ(last_msg_.reserved[51], 115) + << "incorrect value for last_msg_.reserved[51], expected 115, is " + << last_msg_.reserved[51]; + EXPECT_EQ(last_msg_.reserved[52], 47) + << "incorrect value for last_msg_.reserved[52], expected 47, is " + << last_msg_.reserved[52]; + EXPECT_EQ(last_msg_.reserved[53], 154) + << "incorrect value for last_msg_.reserved[53], expected 154, is " + << last_msg_.reserved[53]; + EXPECT_EQ(last_msg_.reserved[54], 91) + << "incorrect value for last_msg_.reserved[54], expected 91, is " + << last_msg_.reserved[54]; + EXPECT_EQ(last_msg_.reserved[55], 227) + << "incorrect value for last_msg_.reserved[55], expected 227, is " + << last_msg_.reserved[55]; + EXPECT_EQ(last_msg_.reserved[56], 88) + << "incorrect value for last_msg_.reserved[56], expected 88, is " + << last_msg_.reserved[56]; + EXPECT_EQ(last_msg_.reserved[57], 11) + << "incorrect value for last_msg_.reserved[57], expected 11, is " + << last_msg_.reserved[57]; + EXPECT_EQ(last_msg_.reserved[58], 1) + << "incorrect value for last_msg_.reserved[58], expected 1, is " + << last_msg_.reserved[58]; + EXPECT_EQ(last_msg_.reserved[59], 85) + << "incorrect value for last_msg_.reserved[59], expected 85, is " + << last_msg_.reserved[59]; + EXPECT_EQ(last_msg_.reserved[60], 146) + << "incorrect value for last_msg_.reserved[60], expected 146, is " + << last_msg_.reserved[60]; + EXPECT_EQ(last_msg_.reserved[61], 100) + << "incorrect value for last_msg_.reserved[61], expected 100, is " + << last_msg_.reserved[61]; + EXPECT_EQ(last_msg_.reserved[62], 190) + << "incorrect value for last_msg_.reserved[62], expected 190, is " + << last_msg_.reserved[62]; + EXPECT_EQ(last_msg_.reserved[63], 232) + << "incorrect value for last_msg_.reserved[63], expected 232, is " + << last_msg_.reserved[63]; + EXPECT_EQ(last_msg_.reserved[64], 207) + << "incorrect value for last_msg_.reserved[64], expected 207, is " + << last_msg_.reserved[64]; + EXPECT_EQ(last_msg_.reserved[65], 61) + << "incorrect value for last_msg_.reserved[65], expected 61, is " + << last_msg_.reserved[65]; + EXPECT_EQ(last_msg_.reserved[66], 61) + << "incorrect value for last_msg_.reserved[66], expected 61, is " + << last_msg_.reserved[66]; + EXPECT_EQ(last_msg_.reserved[67], 201) + << "incorrect value for last_msg_.reserved[67], expected 201, is " + << last_msg_.reserved[67]; + EXPECT_EQ(last_msg_.reserved[68], 220) + << "incorrect value for last_msg_.reserved[68], expected 220, is " + << last_msg_.reserved[68]; + EXPECT_EQ(last_msg_.reserved[69], 31) + << "incorrect value for last_msg_.reserved[69], expected 31, is " + << last_msg_.reserved[69]; + EXPECT_EQ(last_msg_.reserved[70], 78) + << "incorrect value for last_msg_.reserved[70], expected 78, is " + << last_msg_.reserved[70]; + EXPECT_EQ(last_msg_.reserved[71], 34) + << "incorrect value for last_msg_.reserved[71], expected 34, is " + << last_msg_.reserved[71]; + EXPECT_EQ(last_msg_.reserved[72], 57) + << "incorrect value for last_msg_.reserved[72], expected 57, is " + << last_msg_.reserved[72]; + EXPECT_EQ(last_msg_.reserved[73], 82) + << "incorrect value for last_msg_.reserved[73], expected 82, is " + << last_msg_.reserved[73]; + EXPECT_EQ(last_msg_.reserved[74], 59) + << "incorrect value for last_msg_.reserved[74], expected 59, is " + << last_msg_.reserved[74]; + EXPECT_EQ(last_msg_.reserved[75], 104) + << "incorrect value for last_msg_.reserved[75], expected 104, is " + << last_msg_.reserved[75]; + EXPECT_EQ(last_msg_.reserved[76], 65) + << "incorrect value for last_msg_.reserved[76], expected 65, is " + << last_msg_.reserved[76]; + EXPECT_EQ(last_msg_.reserved[77], 221) + << "incorrect value for last_msg_.reserved[77], expected 221, is " + << last_msg_.reserved[77]; + EXPECT_EQ(last_msg_.reserved[78], 0) + << "incorrect value for last_msg_.reserved[78], expected 0, is " + << last_msg_.reserved[78]; + EXPECT_EQ(last_msg_.reserved[79], 43) + << "incorrect value for last_msg_.reserved[79], expected 43, is " + << last_msg_.reserved[79]; + EXPECT_EQ(last_msg_.reserved[80], 210) + << "incorrect value for last_msg_.reserved[80], expected 210, is " + << last_msg_.reserved[80]; + EXPECT_EQ(last_msg_.reserved[81], 9) + << "incorrect value for last_msg_.reserved[81], expected 9, is " + << last_msg_.reserved[81]; + EXPECT_EQ(last_msg_.reserved[82], 32) + << "incorrect value for last_msg_.reserved[82], expected 32, is " + << last_msg_.reserved[82]; + EXPECT_EQ(last_msg_.reserved[83], 122) + << "incorrect value for last_msg_.reserved[83], expected 122, is " + << last_msg_.reserved[83]; + EXPECT_EQ(last_msg_.reserved[84], 29) + << "incorrect value for last_msg_.reserved[84], expected 29, is " + << last_msg_.reserved[84]; + EXPECT_EQ(last_msg_.reserved[85], 237) + << "incorrect value for last_msg_.reserved[85], expected 237, is " + << last_msg_.reserved[85]; + EXPECT_EQ(last_msg_.reserved[86], 11) + << "incorrect value for last_msg_.reserved[86], expected 11, is " + << last_msg_.reserved[86]; + EXPECT_EQ(last_msg_.reserved[87], 151) + << "incorrect value for last_msg_.reserved[87], expected 151, is " + << last_msg_.reserved[87]; + EXPECT_EQ(last_msg_.reserved[88], 223) + << "incorrect value for last_msg_.reserved[88], expected 223, is " + << last_msg_.reserved[88]; + EXPECT_EQ(last_msg_.reserved[89], 18) + << "incorrect value for last_msg_.reserved[89], expected 18, is " + << last_msg_.reserved[89]; + EXPECT_EQ(last_msg_.reserved[90], 81) + << "incorrect value for last_msg_.reserved[90], expected 81, is " + << last_msg_.reserved[90]; + EXPECT_EQ(last_msg_.reserved[91], 204) + << "incorrect value for last_msg_.reserved[91], expected 204, is " + << last_msg_.reserved[91]; + EXPECT_EQ(last_msg_.reserved[92], 172) + << "incorrect value for last_msg_.reserved[92], expected 172, is " + << last_msg_.reserved[92]; + EXPECT_EQ(last_msg_.reserved[93], 234) + << "incorrect value for last_msg_.reserved[93], expected 234, is " + << last_msg_.reserved[93]; + EXPECT_EQ(last_msg_.reserved[94], 127) + << "incorrect value for last_msg_.reserved[94], expected 127, is " + << last_msg_.reserved[94]; + EXPECT_EQ(last_msg_.reserved[95], 3) + << "incorrect value for last_msg_.reserved[95], expected 3, is " + << last_msg_.reserved[95]; + EXPECT_EQ(last_msg_.reserved[96], 82) + << "incorrect value for last_msg_.reserved[96], expected 82, is " + << last_msg_.reserved[96]; + EXPECT_EQ(last_msg_.reserved[97], 133) + << "incorrect value for last_msg_.reserved[97], expected 133, is " + << last_msg_.reserved[97]; + EXPECT_EQ(last_msg_.reserved[98], 169) + << "incorrect value for last_msg_.reserved[98], expected 169, is " + << last_msg_.reserved[98]; + EXPECT_EQ(last_msg_.reserved[99], 12) + << "incorrect value for last_msg_.reserved[99], expected 12, is " + << last_msg_.reserved[99]; + EXPECT_EQ(last_msg_.reserved[100], 176) + << "incorrect value for last_msg_.reserved[100], expected 176, is " + << last_msg_.reserved[100]; + EXPECT_EQ(last_msg_.reserved[101], 193) + << "incorrect value for last_msg_.reserved[101], expected 193, is " + << last_msg_.reserved[101]; + EXPECT_EQ(last_msg_.reserved[102], 0) + << "incorrect value for last_msg_.reserved[102], expected 0, is " + << last_msg_.reserved[102]; + EXPECT_EQ(last_msg_.reserved[103], 24) + << "incorrect value for last_msg_.reserved[103], expected 24, is " + << last_msg_.reserved[103]; + EXPECT_EQ(last_msg_.reserved[104], 121) + << "incorrect value for last_msg_.reserved[104], expected 121, is " + << last_msg_.reserved[104]; + EXPECT_EQ(last_msg_.reserved[105], 85) + << "incorrect value for last_msg_.reserved[105], expected 85, is " + << last_msg_.reserved[105]; + EXPECT_EQ(last_msg_.reserved[106], 55) + << "incorrect value for last_msg_.reserved[106], expected 55, is " + << last_msg_.reserved[106]; + EXPECT_EQ(last_msg_.reserved[107], 214) + << "incorrect value for last_msg_.reserved[107], expected 214, is " + << last_msg_.reserved[107]; + EXPECT_EQ(last_msg_.reserved[108], 198) + << "incorrect value for last_msg_.reserved[108], expected 198, is " + << last_msg_.reserved[108]; + EXPECT_EQ(last_msg_.reserved[109], 75) + << "incorrect value for last_msg_.reserved[109], expected 75, is " + << last_msg_.reserved[109]; + EXPECT_EQ(last_msg_.reserved[110], 234) + << "incorrect value for last_msg_.reserved[110], expected 234, is " + << last_msg_.reserved[110]; + EXPECT_EQ(last_msg_.reserved[111], 179) + << "incorrect value for last_msg_.reserved[111], expected 179, is " + << last_msg_.reserved[111]; + EXPECT_EQ(last_msg_.reserved[112], 214) + << "incorrect value for last_msg_.reserved[112], expected 214, is " + << last_msg_.reserved[112]; + EXPECT_EQ(last_msg_.reserved[113], 85) + << "incorrect value for last_msg_.reserved[113], expected 85, is " + << last_msg_.reserved[113]; + EXPECT_EQ(last_msg_.reserved[114], 94) + << "incorrect value for last_msg_.reserved[114], expected 94, is " + << last_msg_.reserved[114]; + EXPECT_EQ(last_msg_.reserved[115], 115) + << "incorrect value for last_msg_.reserved[115], expected 115, is " + << last_msg_.reserved[115]; + EXPECT_EQ(last_msg_.reserved[116], 21) + << "incorrect value for last_msg_.reserved[116], expected 21, is " + << last_msg_.reserved[116]; + EXPECT_EQ(last_msg_.reserved[117], 73) + << "incorrect value for last_msg_.reserved[117], expected 73, is " + << last_msg_.reserved[117]; + EXPECT_EQ(last_msg_.reserved[118], 121) + << "incorrect value for last_msg_.reserved[118], expected 121, is " + << last_msg_.reserved[118]; + EXPECT_EQ(last_msg_.reserved[119], 75) + << "incorrect value for last_msg_.reserved[119], expected 75, is " + << last_msg_.reserved[119]; + EXPECT_EQ(last_msg_.reserved[120], 46) + << "incorrect value for last_msg_.reserved[120], expected 46, is " + << last_msg_.reserved[120]; + EXPECT_EQ(last_msg_.reserved[121], 158) + << "incorrect value for last_msg_.reserved[121], expected 158, is " + << last_msg_.reserved[121]; + EXPECT_EQ(last_msg_.reserved[122], 63) + << "incorrect value for last_msg_.reserved[122], expected 63, is " + << last_msg_.reserved[122]; + EXPECT_EQ(last_msg_.reserved[123], 100) + << "incorrect value for last_msg_.reserved[123], expected 100, is " + << last_msg_.reserved[123]; + EXPECT_EQ(last_msg_.reserved[124], 122) + << "incorrect value for last_msg_.reserved[124], expected 122, is " + << last_msg_.reserved[124]; + EXPECT_EQ(last_msg_.reserved[125], 213) + << "incorrect value for last_msg_.reserved[125], expected 213, is " + << last_msg_.reserved[125]; + EXPECT_EQ(last_msg_.reserved[126], 20) + << "incorrect value for last_msg_.reserved[126], expected 20, is " + << last_msg_.reserved[126]; + EXPECT_EQ(last_msg_.reserved[127], 85) + << "incorrect value for last_msg_.reserved[127], expected 85, is " + << last_msg_.reserved[127]; + EXPECT_EQ(last_msg_.reserved[128], 212) + << "incorrect value for last_msg_.reserved[128], expected 212, is " + << last_msg_.reserved[128]; + EXPECT_EQ(last_msg_.reserved[129], 131) + << "incorrect value for last_msg_.reserved[129], expected 131, is " + << last_msg_.reserved[129]; + EXPECT_EQ(last_msg_.reserved[130], 50) + << "incorrect value for last_msg_.reserved[130], expected 50, is " + << last_msg_.reserved[130]; + EXPECT_EQ(last_msg_.reserved[131], 224) + << "incorrect value for last_msg_.reserved[131], expected 224, is " + << last_msg_.reserved[131]; + EXPECT_EQ(last_msg_.reserved[132], 218) + << "incorrect value for last_msg_.reserved[132], expected 218, is " + << last_msg_.reserved[132]; + EXPECT_EQ(last_msg_.reserved[133], 215) + << "incorrect value for last_msg_.reserved[133], expected 215, is " + << last_msg_.reserved[133]; + EXPECT_EQ(last_msg_.reserved[134], 215) + << "incorrect value for last_msg_.reserved[134], expected 215, is " + << last_msg_.reserved[134]; + EXPECT_EQ(last_msg_.reserved[135], 149) + << "incorrect value for last_msg_.reserved[135], expected 149, is " + << last_msg_.reserved[135]; + EXPECT_EQ(last_msg_.reserved[136], 2) + << "incorrect value for last_msg_.reserved[136], expected 2, is " + << last_msg_.reserved[136]; + EXPECT_EQ(last_msg_.reserved[137], 19) + << "incorrect value for last_msg_.reserved[137], expected 19, is " + << last_msg_.reserved[137]; + EXPECT_EQ(last_msg_.reserved[138], 129) + << "incorrect value for last_msg_.reserved[138], expected 129, is " + << last_msg_.reserved[138]; + EXPECT_EQ(last_msg_.reserved[139], 39) + << "incorrect value for last_msg_.reserved[139], expected 39, is " + << last_msg_.reserved[139]; + EXPECT_EQ(last_msg_.reserved[140], 164) + << "incorrect value for last_msg_.reserved[140], expected 164, is " + << last_msg_.reserved[140]; + EXPECT_EQ(last_msg_.reserved[141], 5) + << "incorrect value for last_msg_.reserved[141], expected 5, is " + << last_msg_.reserved[141]; + EXPECT_EQ(last_msg_.reserved[142], 175) + << "incorrect value for last_msg_.reserved[142], expected 175, is " + << last_msg_.reserved[142]; + EXPECT_EQ(last_msg_.reserved[143], 6) + << "incorrect value for last_msg_.reserved[143], expected 6, is " + << last_msg_.reserved[143]; + EXPECT_EQ(last_msg_.reserved[144], 62) + << "incorrect value for last_msg_.reserved[144], expected 62, is " + << last_msg_.reserved[144]; + EXPECT_EQ(last_msg_.reserved[145], 51) + << "incorrect value for last_msg_.reserved[145], expected 51, is " + << last_msg_.reserved[145]; + EXPECT_EQ(last_msg_.reserved[146], 78) + << "incorrect value for last_msg_.reserved[146], expected 78, is " + << last_msg_.reserved[146]; + EXPECT_EQ(last_msg_.reserved[147], 66) + << "incorrect value for last_msg_.reserved[147], expected 66, is " + << last_msg_.reserved[147]; + EXPECT_EQ(last_msg_.reserved[148], 248) + << "incorrect value for last_msg_.reserved[148], expected 248, is " + << last_msg_.reserved[148]; + EXPECT_EQ(last_msg_.reserved[149], 116) + << "incorrect value for last_msg_.reserved[149], expected 116, is " + << last_msg_.reserved[149]; + EXPECT_EQ(last_msg_.reserved[150], 88) + << "incorrect value for last_msg_.reserved[150], expected 88, is " + << last_msg_.reserved[150]; + EXPECT_EQ(last_msg_.reserved[151], 90) + << "incorrect value for last_msg_.reserved[151], expected 90, is " + << last_msg_.reserved[151]; + EXPECT_EQ(last_msg_.reserved[152], 128) + << "incorrect value for last_msg_.reserved[152], expected 128, is " + << last_msg_.reserved[152]; + EXPECT_EQ(last_msg_.reserved[153], 226) + << "incorrect value for last_msg_.reserved[153], expected 226, is " + << last_msg_.reserved[153]; + EXPECT_EQ(last_msg_.reserved[154], 177) + << "incorrect value for last_msg_.reserved[154], expected 177, is " + << last_msg_.reserved[154]; + EXPECT_EQ(last_msg_.reserved[155], 0) + << "incorrect value for last_msg_.reserved[155], expected 0, is " + << last_msg_.reserved[155]; + EXPECT_EQ(last_msg_.reserved[156], 47) + << "incorrect value for last_msg_.reserved[156], expected 47, is " + << last_msg_.reserved[156]; + EXPECT_EQ(last_msg_.reserved[157], 140) + << "incorrect value for last_msg_.reserved[157], expected 140, is " + << last_msg_.reserved[157]; + EXPECT_EQ(last_msg_.reserved[158], 33) + << "incorrect value for last_msg_.reserved[158], expected 33, is " + << last_msg_.reserved[158]; + EXPECT_EQ(last_msg_.reserved[159], 126) + << "incorrect value for last_msg_.reserved[159], expected 126, is " + << last_msg_.reserved[159]; + EXPECT_EQ(last_msg_.reserved[160], 221) + << "incorrect value for last_msg_.reserved[160], expected 221, is " + << last_msg_.reserved[160]; + EXPECT_EQ(last_msg_.reserved[161], 110) + << "incorrect value for last_msg_.reserved[161], expected 110, is " + << last_msg_.reserved[161]; + EXPECT_EQ(last_msg_.reserved[162], 144) + << "incorrect value for last_msg_.reserved[162], expected 144, is " + << last_msg_.reserved[162]; + EXPECT_EQ(last_msg_.reserved[163], 97) + << "incorrect value for last_msg_.reserved[163], expected 97, is " + << last_msg_.reserved[163]; + EXPECT_EQ(last_msg_.reserved[164], 74) + << "incorrect value for last_msg_.reserved[164], expected 74, is " + << last_msg_.reserved[164]; + EXPECT_EQ(last_msg_.reserved[165], 250) + << "incorrect value for last_msg_.reserved[165], expected 250, is " + << last_msg_.reserved[165]; + EXPECT_EQ(last_msg_.reserved[166], 181) + << "incorrect value for last_msg_.reserved[166], expected 181, is " + << last_msg_.reserved[166]; + EXPECT_EQ(last_msg_.reserved[167], 199) + << "incorrect value for last_msg_.reserved[167], expected 199, is " + << last_msg_.reserved[167]; + EXPECT_EQ(last_msg_.reserved[168], 27) + << "incorrect value for last_msg_.reserved[168], expected 27, is " + << last_msg_.reserved[168]; + EXPECT_EQ(last_msg_.reserved[169], 176) + << "incorrect value for last_msg_.reserved[169], expected 176, is " + << last_msg_.reserved[169]; + EXPECT_EQ(last_msg_.reserved[170], 65) + << "incorrect value for last_msg_.reserved[170], expected 65, is " + << last_msg_.reserved[170]; + EXPECT_EQ(last_msg_.reserved[171], 185) + << "incorrect value for last_msg_.reserved[171], expected 185, is " + << last_msg_.reserved[171]; + EXPECT_EQ(last_msg_.reserved[172], 110) + << "incorrect value for last_msg_.reserved[172], expected 110, is " + << last_msg_.reserved[172]; + EXPECT_EQ(last_msg_.reserved[173], 92) + << "incorrect value for last_msg_.reserved[173], expected 92, is " + << last_msg_.reserved[173]; + EXPECT_EQ(last_msg_.reserved[174], 34) + << "incorrect value for last_msg_.reserved[174], expected 34, is " + << last_msg_.reserved[174]; + EXPECT_EQ(last_msg_.reserved[175], 44) + << "incorrect value for last_msg_.reserved[175], expected 44, is " + << last_msg_.reserved[175]; + EXPECT_EQ(last_msg_.reserved[176], 131) + << "incorrect value for last_msg_.reserved[176], expected 131, is " + << last_msg_.reserved[176]; + EXPECT_EQ(last_msg_.reserved[177], 96) + << "incorrect value for last_msg_.reserved[177], expected 96, is " + << last_msg_.reserved[177]; + EXPECT_EQ(last_msg_.reserved[178], 178) + << "incorrect value for last_msg_.reserved[178], expected 178, is " + << last_msg_.reserved[178]; + EXPECT_EQ(last_msg_.reserved[179], 40) + << "incorrect value for last_msg_.reserved[179], expected 40, is " + << last_msg_.reserved[179]; + EXPECT_EQ(last_msg_.reserved[180], 176) + << "incorrect value for last_msg_.reserved[180], expected 176, is " + << last_msg_.reserved[180]; + EXPECT_EQ(last_msg_.reserved[181], 4) + << "incorrect value for last_msg_.reserved[181], expected 4, is " + << last_msg_.reserved[181]; + EXPECT_EQ(last_msg_.reserved[182], 90) + << "incorrect value for last_msg_.reserved[182], expected 90, is " + << last_msg_.reserved[182]; + EXPECT_EQ(last_msg_.reserved[183], 36) + << "incorrect value for last_msg_.reserved[183], expected 36, is " + << last_msg_.reserved[183]; + EXPECT_EQ(last_msg_.reserved[184], 7) + << "incorrect value for last_msg_.reserved[184], expected 7, is " + << last_msg_.reserved[184]; + EXPECT_EQ(last_msg_.reserved[185], 180) + << "incorrect value for last_msg_.reserved[185], expected 180, is " + << last_msg_.reserved[185]; + EXPECT_EQ(last_msg_.reserved[186], 244) + << "incorrect value for last_msg_.reserved[186], expected 244, is " + << last_msg_.reserved[186]; + EXPECT_EQ(last_msg_.reserved[187], 244) + << "incorrect value for last_msg_.reserved[187], expected 244, is " + << last_msg_.reserved[187]; + EXPECT_EQ(last_msg_.reserved[188], 23) + << "incorrect value for last_msg_.reserved[188], expected 23, is " + << last_msg_.reserved[188]; + EXPECT_EQ(last_msg_.reserved[189], 108) + << "incorrect value for last_msg_.reserved[189], expected 108, is " + << last_msg_.reserved[189]; + EXPECT_EQ(last_msg_.reserved[190], 171) + << "incorrect value for last_msg_.reserved[190], expected 171, is " + << last_msg_.reserved[190]; + EXPECT_EQ(last_msg_.reserved[191], 204) + << "incorrect value for last_msg_.reserved[191], expected 204, is " + << last_msg_.reserved[191]; + EXPECT_EQ(last_msg_.reserved[192], 196) + << "incorrect value for last_msg_.reserved[192], expected 196, is " + << last_msg_.reserved[192]; + EXPECT_EQ(last_msg_.reserved[193], 61) + << "incorrect value for last_msg_.reserved[193], expected 61, is " + << last_msg_.reserved[193]; + EXPECT_EQ(last_msg_.reserved[194], 51) + << "incorrect value for last_msg_.reserved[194], expected 51, is " + << last_msg_.reserved[194]; + EXPECT_EQ(last_msg_.reserved[195], 179) + << "incorrect value for last_msg_.reserved[195], expected 179, is " + << last_msg_.reserved[195]; + EXPECT_EQ(last_msg_.reserved[196], 242) + << "incorrect value for last_msg_.reserved[196], expected 242, is " + << last_msg_.reserved[196]; + EXPECT_EQ(last_msg_.reserved[197], 156) + << "incorrect value for last_msg_.reserved[197], expected 156, is " + << last_msg_.reserved[197]; + EXPECT_EQ(last_msg_.reserved[198], 81) + << "incorrect value for last_msg_.reserved[198], expected 81, is " + << last_msg_.reserved[198]; + EXPECT_EQ(last_msg_.reserved[199], 83) + << "incorrect value for last_msg_.reserved[199], expected 83, is " + << last_msg_.reserved[199]; + EXPECT_EQ(last_msg_.reserved[200], 16) + << "incorrect value for last_msg_.reserved[200], expected 16, is " + << last_msg_.reserved[200]; + EXPECT_EQ(last_msg_.reserved[201], 15) + << "incorrect value for last_msg_.reserved[201], expected 15, is " + << last_msg_.reserved[201]; + EXPECT_EQ(last_msg_.reserved[202], 134) + << "incorrect value for last_msg_.reserved[202], expected 134, is " + << last_msg_.reserved[202]; + EXPECT_EQ(last_msg_.reserved[203], 40) + << "incorrect value for last_msg_.reserved[203], expected 40, is " + << last_msg_.reserved[203]; + EXPECT_EQ(last_msg_.reserved[204], 245) + << "incorrect value for last_msg_.reserved[204], expected 245, is " + << last_msg_.reserved[204]; + EXPECT_EQ(last_msg_.reserved[205], 253) + << "incorrect value for last_msg_.reserved[205], expected 253, is " + << last_msg_.reserved[205]; + EXPECT_EQ(last_msg_.reserved[206], 150) + << "incorrect value for last_msg_.reserved[206], expected 150, is " + << last_msg_.reserved[206]; + EXPECT_EQ(last_msg_.reserved[207], 94) + << "incorrect value for last_msg_.reserved[207], expected 94, is " + << last_msg_.reserved[207]; + EXPECT_EQ(last_msg_.reserved[208], 150) + << "incorrect value for last_msg_.reserved[208], expected 150, is " + << last_msg_.reserved[208]; + EXPECT_EQ(last_msg_.reserved[209], 144) + << "incorrect value for last_msg_.reserved[209], expected 144, is " + << last_msg_.reserved[209]; + EXPECT_EQ(last_msg_.reserved[210], 197) + << "incorrect value for last_msg_.reserved[210], expected 197, is " + << last_msg_.reserved[210]; + EXPECT_EQ(last_msg_.reserved[211], 113) + << "incorrect value for last_msg_.reserved[211], expected 113, is " + << last_msg_.reserved[211]; + EXPECT_EQ(last_msg_.reserved[212], 5) + << "incorrect value for last_msg_.reserved[212], expected 5, is " + << last_msg_.reserved[212]; + EXPECT_EQ(last_msg_.reserved[213], 141) + << "incorrect value for last_msg_.reserved[213], expected 141, is " + << last_msg_.reserved[213]; + EXPECT_EQ(last_msg_.reserved[214], 232) + << "incorrect value for last_msg_.reserved[214], expected 232, is " + << last_msg_.reserved[214]; + EXPECT_EQ(last_msg_.reserved[215], 33) + << "incorrect value for last_msg_.reserved[215], expected 33, is " + << last_msg_.reserved[215]; + EXPECT_EQ(last_msg_.reserved[216], 101) + << "incorrect value for last_msg_.reserved[216], expected 101, is " + << last_msg_.reserved[216]; + EXPECT_EQ(last_msg_.reserved[217], 231) + << "incorrect value for last_msg_.reserved[217], expected 231, is " + << last_msg_.reserved[217]; + EXPECT_EQ(last_msg_.reserved[218], 38) + << "incorrect value for last_msg_.reserved[218], expected 38, is " + << last_msg_.reserved[218]; + EXPECT_EQ(last_msg_.reserved[219], 75) + << "incorrect value for last_msg_.reserved[219], expected 75, is " + << last_msg_.reserved[219]; + EXPECT_EQ(last_msg_.reserved[220], 178) + << "incorrect value for last_msg_.reserved[220], expected 178, is " + << last_msg_.reserved[220]; + EXPECT_EQ(last_msg_.reserved[221], 243) + << "incorrect value for last_msg_.reserved[221], expected 243, is " + << last_msg_.reserved[221]; + EXPECT_EQ(last_msg_.reserved[222], 119) + << "incorrect value for last_msg_.reserved[222], expected 119, is " + << last_msg_.reserved[222]; + EXPECT_EQ(last_msg_.reserved[223], 1) + << "incorrect value for last_msg_.reserved[223], expected 1, is " + << last_msg_.reserved[223]; + EXPECT_EQ(last_msg_.reserved[224], 248) + << "incorrect value for last_msg_.reserved[224], expected 248, is " + << last_msg_.reserved[224]; + EXPECT_EQ(last_msg_.reserved[225], 218) + << "incorrect value for last_msg_.reserved[225], expected 218, is " + << last_msg_.reserved[225]; + EXPECT_EQ(last_msg_.reserved[226], 86) + << "incorrect value for last_msg_.reserved[226], expected 86, is " + << last_msg_.reserved[226]; + EXPECT_EQ(last_msg_.reserved[227], 7) + << "incorrect value for last_msg_.reserved[227], expected 7, is " + << last_msg_.reserved[227]; + EXPECT_EQ(last_msg_.reserved[228], 88) + << "incorrect value for last_msg_.reserved[228], expected 88, is " + << last_msg_.reserved[228]; + EXPECT_EQ(last_msg_.reserved[229], 197) + << "incorrect value for last_msg_.reserved[229], expected 197, is " + << last_msg_.reserved[229]; + EXPECT_EQ(last_msg_.reserved[230], 148) + << "incorrect value for last_msg_.reserved[230], expected 148, is " + << last_msg_.reserved[230]; + EXPECT_EQ(last_msg_.reserved[231], 240) + << "incorrect value for last_msg_.reserved[231], expected 240, is " + << last_msg_.reserved[231]; + EXPECT_EQ(last_msg_.reserved[232], 227) + << "incorrect value for last_msg_.reserved[232], expected 227, is " + << last_msg_.reserved[232]; + EXPECT_EQ(last_msg_.reserved[233], 2) + << "incorrect value for last_msg_.reserved[233], expected 2, is " + << last_msg_.reserved[233]; + EXPECT_EQ(last_msg_.reserved[234], 65) + << "incorrect value for last_msg_.reserved[234], expected 65, is " + << last_msg_.reserved[234]; + EXPECT_EQ(last_msg_.reserved[235], 173) + << "incorrect value for last_msg_.reserved[235], expected 173, is " + << last_msg_.reserved[235]; + EXPECT_EQ(last_msg_.reserved[236], 122) + << "incorrect value for last_msg_.reserved[236], expected 122, is " + << last_msg_.reserved[236]; + EXPECT_EQ(last_msg_.reserved[237], 143) + << "incorrect value for last_msg_.reserved[237], expected 143, is " + << last_msg_.reserved[237]; + EXPECT_EQ(last_msg_.reserved[238], 251) + << "incorrect value for last_msg_.reserved[238], expected 251, is " + << last_msg_.reserved[238]; + EXPECT_EQ(last_msg_.reserved[239], 156) + << "incorrect value for last_msg_.reserved[239], expected 156, is " + << last_msg_.reserved[239]; + EXPECT_EQ(last_msg_.reserved[240], 217) + << "incorrect value for last_msg_.reserved[240], expected 217, is " + << last_msg_.reserved[240]; + EXPECT_EQ(last_msg_.reserved[241], 67) + << "incorrect value for last_msg_.reserved[241], expected 67, is " + << last_msg_.reserved[241]; + EXPECT_EQ(last_msg_.reserved[242], 239) + << "incorrect value for last_msg_.reserved[242], expected 239, is " + << last_msg_.reserved[242]; + EXPECT_EQ(last_msg_.reserved[243], 219) + << "incorrect value for last_msg_.reserved[243], expected 219, is " + << last_msg_.reserved[243]; + EXPECT_EQ(last_msg_.reserved[244], 31) + << "incorrect value for last_msg_.reserved[244], expected 31, is " + << last_msg_.reserved[244]; + EXPECT_EQ(last_msg_.reserved[245], 224) + << "incorrect value for last_msg_.reserved[245], expected 224, is " + << last_msg_.reserved[245]; + EXPECT_EQ(last_msg_.reserved[246], 176) + << "incorrect value for last_msg_.reserved[246], expected 176, is " + << last_msg_.reserved[246]; + EXPECT_EQ(last_msg_.reserved[247], 129) + << "incorrect value for last_msg_.reserved[247], expected 129, is " + << last_msg_.reserved[247]; + EXPECT_EQ(last_msg_.reserved[248], 81) + << "incorrect value for last_msg_.reserved[248], expected 81, is " + << last_msg_.reserved[248]; + EXPECT_EQ(last_msg_.reserved[249], 80) + << "incorrect value for last_msg_.reserved[249], expected 80, is " + << last_msg_.reserved[249]; + EXPECT_LT((last_msg_.signal_error_rate * 100 - 8588.20019531 * 100), 0.05) + << "incorrect value for last_msg_.signal_error_rate, expected " + "8588.20019531, is " + << last_msg_.signal_error_rate; + EXPECT_EQ(last_msg_.signal_strength, 103) + << "incorrect value for last_msg_.signal_strength, expected 103, is " + << last_msg_.signal_strength; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgCommandOutput.cc b/c/test/cpp/auto_check_sbp_piksi_MsgCommandOutput.cc index cf5d0034a..1b4fe7324 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgCommandOutput.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgCommandOutput.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandOutput.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandOutput.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgCommandOutput0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgCommandOutput0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgCommandOutput0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgCommandOutput0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_command_output_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_command_output_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,40 +67,44 @@ class Test_auto_check_sbp_piksi_MsgCommandOutput0 : sbp_msg_command_output_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgCommandOutput0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgCommandOutput0, Test) { + uint8_t encoded_frame[] = { + 85, 188, 0, 50, 84, 20, 126, 164, 116, 149, 83, 111, 109, 101, + 32, 111, 117, 116, 112, 117, 116, 32, 116, 101, 120, 116, 11, 109, + }; + + sbp_msg_command_output_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_command_output_line_set(&test_msg, "Some output text", + false, &written)); + EXPECT_EQ(written, strlen("Some output text")); + EXPECT_EQ(sbp_msg_command_output_line_encoded_len(&test_msg), 16); + test_msg.sequence = 2507449470; - uint8_t encoded_frame[] = {85,188,0,50,84,20,126,164,116,149,83,111,109,101,32,111,117,116,112,117,116,32,116,101,120,116,11,109, }; + EXPECT_EQ(send_message(21554, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_command_output_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_command_output_line_set(&test_msg, "Some output text", false, &written)); - EXPECT_EQ( written, strlen("Some output text")); - EXPECT_EQ(sbp_msg_command_output_line_encoded_len(&test_msg), 16); - test_msg.sequence = 2507449470; - - EXPECT_EQ(send_message( 21554, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 21554); + EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 21554); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_command_output_line_encoded_len(&last_msg_), 16); - EXPECT_STREQ(sbp_msg_command_output_line_get(&last_msg_), "Some output text"); - EXPECT_EQ(last_msg_.sequence, 2507449470) << "incorrect value for last_msg_.sequence, expected 2507449470, is " << last_msg_.sequence; + EXPECT_EQ(sbp_msg_command_output_line_encoded_len(&last_msg_), 16); + EXPECT_STREQ(sbp_msg_command_output_line_get(&last_msg_), "Some output text"); + EXPECT_EQ(last_msg_.sequence, 2507449470) + << "incorrect value for last_msg_.sequence, expected 2507449470, is " + << last_msg_.sequence; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgCommandReq.cc b/c/test/cpp/auto_check_sbp_piksi_MsgCommandReq.cc index e031e237b..7027782a4 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgCommandReq.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgCommandReq.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandReq.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgCommandReq0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgCommandReq0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgCommandReq0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgCommandReq0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_command_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_command_req_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,40 +67,46 @@ class Test_auto_check_sbp_piksi_MsgCommandReq0 : sbp_msg_command_req_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgCommandReq0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgCommandReq0, Test) { + uint8_t encoded_frame[] = { + 85, 184, 0, 170, 184, 31, 51, 77, 163, 104, 47, 112, 97, + 116, 104, 47, 116, 111, 47, 99, 111, 109, 109, 97, 110, 100, + 32, 119, 105, 116, 104, 32, 97, 114, 103, 115, 0, 38, 24, + }; + + sbp_msg_command_req_t test_msg{}; + + size_t written; + EXPECT_TRUE(sbp_msg_command_req_command_set( + &test_msg, "/path/to/command with args", false, &written)); + EXPECT_EQ(written, strlen("/path/to/command with args")); + EXPECT_EQ(sbp_msg_command_req_command_encoded_len(&test_msg), 27); + test_msg.sequence = 1755532595; - uint8_t encoded_frame[] = {85,184,0,170,184,31,51,77,163,104,47,112,97,116,104,47,116,111,47,99,111,109,109,97,110,100,32,119,105,116,104,32,97,114,103,115,0,38,24, }; + EXPECT_EQ(send_message(47274, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_command_req_t test_msg{}; - - size_t written; - EXPECT_TRUE(sbp_msg_command_req_command_set(&test_msg, "/path/to/command with args", false, &written)); - EXPECT_EQ( written, strlen("/path/to/command with args")); - EXPECT_EQ(sbp_msg_command_req_command_encoded_len(&test_msg), 27); - test_msg.sequence = 1755532595; - - EXPECT_EQ(send_message( 47274, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 47274); + EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 47274); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_command_req_command_encoded_len(&last_msg_), 27); - EXPECT_STREQ(sbp_msg_command_req_command_get(&last_msg_), "/path/to/command with args"); - EXPECT_EQ(last_msg_.sequence, 1755532595) << "incorrect value for last_msg_.sequence, expected 1755532595, is " << last_msg_.sequence; + EXPECT_EQ(sbp_msg_command_req_command_encoded_len(&last_msg_), 27); + EXPECT_STREQ(sbp_msg_command_req_command_get(&last_msg_), + "/path/to/command with args"); + EXPECT_EQ(last_msg_.sequence, 1755532595) + << "incorrect value for last_msg_.sequence, expected 1755532595, is " + << last_msg_.sequence; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgCommandResp.cc b/c/test/cpp/auto_check_sbp_piksi_MsgCommandResp.cc index cbfd636e3..330274584 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgCommandResp.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgCommandResp.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandResp.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgCommandResp0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgCommandResp0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgCommandResp0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgCommandResp0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_command_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_command_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,34 +67,38 @@ class Test_auto_check_sbp_piksi_MsgCommandResp0 : sbp_msg_command_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgCommandResp0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgCommandResp0, Test) { + uint8_t encoded_frame[] = { + 85, 185, 0, 57, 206, 8, 118, 215, 131, 160, 210, 110, 150, 103, 164, 240, + }; - uint8_t encoded_frame[] = {85,185,0,57,206,8,118,215,131,160,210,110,150,103,164,240, }; + sbp_msg_command_resp_t test_msg{}; + test_msg.code = 1737912018; + test_msg.sequence = 2692994934; - sbp_msg_command_resp_t test_msg{}; - test_msg.code = 1737912018; - test_msg.sequence = 2692994934; - - EXPECT_EQ(send_message( 52793, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(52793, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 52793); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.code, 1737912018) << "incorrect value for last_msg_.code, expected 1737912018, is " << last_msg_.code; - EXPECT_EQ(last_msg_.sequence, 2692994934) << "incorrect value for last_msg_.sequence, expected 2692994934, is " << last_msg_.sequence; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 52793); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.code, 1737912018) + << "incorrect value for last_msg_.code, expected 1737912018, is " + << last_msg_.code; + EXPECT_EQ(last_msg_.sequence, 2692994934) + << "incorrect value for last_msg_.sequence, expected 2692994934, is " + << last_msg_.sequence; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgCwResults.cc b/c/test/cpp/auto_check_sbp_piksi_MsgCwResults.cc index 8fbeb5d49..682d5198b 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgCwResults.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgCwResults.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwResults.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwResults.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgCwResults0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgCwResults0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgCwResults0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgCwResults0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_cw_results_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_cw_results_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,30 +67,30 @@ class Test_auto_check_sbp_piksi_MsgCwResults0 : sbp_msg_cw_results_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgCwResults0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgCwResults0, Test) { + uint8_t encoded_frame[] = { + 85, 192, 0, 99, 246, 0, 228, 72, + }; - uint8_t encoded_frame[] = {85,192,0,99,246,0,228,72, }; + sbp_msg_cw_results_t test_msg{}; - sbp_msg_cw_results_t test_msg{}; - - EXPECT_EQ(send_message( 63075, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(63075, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 63075); - EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 63075); + EXPECT_EQ(last_msg_, test_msg); } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgCwStart.cc b/c/test/cpp/auto_check_sbp_piksi_MsgCwStart.cc index c377c2d5b..862660bed 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgCwStart.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgCwStart.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwStart.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwStart.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgCwStart0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgCwStart0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgCwStart0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgCwStart0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_cw_start_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_cw_start_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,30 +67,30 @@ class Test_auto_check_sbp_piksi_MsgCwStart0 : sbp_msg_cw_start_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgCwStart0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgCwStart0, Test) { + uint8_t encoded_frame[] = { + 85, 193, 0, 30, 179, 0, 213, 138, + }; - uint8_t encoded_frame[] = {85,193,0,30,179,0,213,138, }; + sbp_msg_cw_start_t test_msg{}; - sbp_msg_cw_start_t test_msg{}; - - EXPECT_EQ(send_message( 45854, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(45854, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 45854); - EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 45854); + EXPECT_EQ(last_msg_, test_msg); } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgDeviceMonitor.cc b/c/test/cpp/auto_check_sbp_piksi_MsgDeviceMonitor.cc index 373011b63..56233bcd5 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgDeviceMonitor.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgDeviceMonitor.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgDeviceMonitor.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgDeviceMonitor.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgDeviceMonitor0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgDeviceMonitor0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgDeviceMonitor0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgDeviceMonitor0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_device_monitor_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_device_monitor_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,90 +67,95 @@ class Test_auto_check_sbp_piksi_MsgDeviceMonitor0 : sbp_msg_device_monitor_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgDeviceMonitor0, Test) -{ - - uint8_t encoded_frame[] = {85,181,0,95,66,10,241,216,219,3,253,6,21,24,168,18,207,233, }; - - sbp_msg_device_monitor_t test_msg{}; - test_msg.cpu_temperature = 6165; - test_msg.cpu_vaux = 1789; - test_msg.cpu_vint = 987; - test_msg.dev_vin = -9999; - test_msg.fe_temperature = 4776; - - EXPECT_EQ(send_message( 16991, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 16991); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu_temperature, 6165) << "incorrect value for last_msg_.cpu_temperature, expected 6165, is " << last_msg_.cpu_temperature; - EXPECT_EQ(last_msg_.cpu_vaux, 1789) << "incorrect value for last_msg_.cpu_vaux, expected 1789, is " << last_msg_.cpu_vaux; - EXPECT_EQ(last_msg_.cpu_vint, 987) << "incorrect value for last_msg_.cpu_vint, expected 987, is " << last_msg_.cpu_vint; - EXPECT_EQ(last_msg_.dev_vin, -9999) << "incorrect value for last_msg_.dev_vin, expected -9999, is " << last_msg_.dev_vin; - EXPECT_EQ(last_msg_.fe_temperature, 4776) << "incorrect value for last_msg_.fe_temperature, expected 4776, is " << last_msg_.fe_temperature; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgDeviceMonitor0, Test) { + uint8_t encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 219, + 3, 253, 6, 21, 24, 168, 18, 207, 233, + }; + + sbp_msg_device_monitor_t test_msg{}; + test_msg.cpu_temperature = 6165; + test_msg.cpu_vaux = 1789; + test_msg.cpu_vint = 987; + test_msg.dev_vin = -9999; + test_msg.fe_temperature = 4776; + + EXPECT_EQ(send_message(16991, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 16991); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu_temperature, 6165) + << "incorrect value for last_msg_.cpu_temperature, expected 6165, is " + << last_msg_.cpu_temperature; + EXPECT_EQ(last_msg_.cpu_vaux, 1789) + << "incorrect value for last_msg_.cpu_vaux, expected 1789, is " + << last_msg_.cpu_vaux; + EXPECT_EQ(last_msg_.cpu_vint, 987) + << "incorrect value for last_msg_.cpu_vint, expected 987, is " + << last_msg_.cpu_vint; + EXPECT_EQ(last_msg_.dev_vin, -9999) + << "incorrect value for last_msg_.dev_vin, expected -9999, is " + << last_msg_.dev_vin; + EXPECT_EQ(last_msg_.fe_temperature, 4776) + << "incorrect value for last_msg_.fe_temperature, expected 4776, is " + << last_msg_.fe_temperature; } -class Test_auto_check_sbp_piksi_MsgDeviceMonitor1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgDeviceMonitor1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgDeviceMonitor1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgDeviceMonitor1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_device_monitor_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_device_monitor_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -162,90 +163,95 @@ class Test_auto_check_sbp_piksi_MsgDeviceMonitor1 : sbp_msg_device_monitor_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgDeviceMonitor1, Test) -{ - - uint8_t encoded_frame[] = {85,181,0,95,66,10,241,216,219,3,254,6,24,24,168,18,169,30, }; - - sbp_msg_device_monitor_t test_msg{}; - test_msg.cpu_temperature = 6168; - test_msg.cpu_vaux = 1790; - test_msg.cpu_vint = 987; - test_msg.dev_vin = -9999; - test_msg.fe_temperature = 4776; - - EXPECT_EQ(send_message( 16991, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 16991); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu_temperature, 6168) << "incorrect value for last_msg_.cpu_temperature, expected 6168, is " << last_msg_.cpu_temperature; - EXPECT_EQ(last_msg_.cpu_vaux, 1790) << "incorrect value for last_msg_.cpu_vaux, expected 1790, is " << last_msg_.cpu_vaux; - EXPECT_EQ(last_msg_.cpu_vint, 987) << "incorrect value for last_msg_.cpu_vint, expected 987, is " << last_msg_.cpu_vint; - EXPECT_EQ(last_msg_.dev_vin, -9999) << "incorrect value for last_msg_.dev_vin, expected -9999, is " << last_msg_.dev_vin; - EXPECT_EQ(last_msg_.fe_temperature, 4776) << "incorrect value for last_msg_.fe_temperature, expected 4776, is " << last_msg_.fe_temperature; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgDeviceMonitor1, Test) { + uint8_t encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 219, + 3, 254, 6, 24, 24, 168, 18, 169, 30, + }; + + sbp_msg_device_monitor_t test_msg{}; + test_msg.cpu_temperature = 6168; + test_msg.cpu_vaux = 1790; + test_msg.cpu_vint = 987; + test_msg.dev_vin = -9999; + test_msg.fe_temperature = 4776; + + EXPECT_EQ(send_message(16991, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 16991); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu_temperature, 6168) + << "incorrect value for last_msg_.cpu_temperature, expected 6168, is " + << last_msg_.cpu_temperature; + EXPECT_EQ(last_msg_.cpu_vaux, 1790) + << "incorrect value for last_msg_.cpu_vaux, expected 1790, is " + << last_msg_.cpu_vaux; + EXPECT_EQ(last_msg_.cpu_vint, 987) + << "incorrect value for last_msg_.cpu_vint, expected 987, is " + << last_msg_.cpu_vint; + EXPECT_EQ(last_msg_.dev_vin, -9999) + << "incorrect value for last_msg_.dev_vin, expected -9999, is " + << last_msg_.dev_vin; + EXPECT_EQ(last_msg_.fe_temperature, 4776) + << "incorrect value for last_msg_.fe_temperature, expected 4776, is " + << last_msg_.fe_temperature; } -class Test_auto_check_sbp_piksi_MsgDeviceMonitor2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgDeviceMonitor2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgDeviceMonitor2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgDeviceMonitor2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_device_monitor_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_device_monitor_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -253,90 +259,95 @@ class Test_auto_check_sbp_piksi_MsgDeviceMonitor2 : sbp_msg_device_monitor_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgDeviceMonitor2, Test) -{ - - uint8_t encoded_frame[] = {85,181,0,95,66,10,241,216,219,3,253,6,22,24,168,18,19,114, }; - - sbp_msg_device_monitor_t test_msg{}; - test_msg.cpu_temperature = 6166; - test_msg.cpu_vaux = 1789; - test_msg.cpu_vint = 987; - test_msg.dev_vin = -9999; - test_msg.fe_temperature = 4776; - - EXPECT_EQ(send_message( 16991, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 16991); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu_temperature, 6166) << "incorrect value for last_msg_.cpu_temperature, expected 6166, is " << last_msg_.cpu_temperature; - EXPECT_EQ(last_msg_.cpu_vaux, 1789) << "incorrect value for last_msg_.cpu_vaux, expected 1789, is " << last_msg_.cpu_vaux; - EXPECT_EQ(last_msg_.cpu_vint, 987) << "incorrect value for last_msg_.cpu_vint, expected 987, is " << last_msg_.cpu_vint; - EXPECT_EQ(last_msg_.dev_vin, -9999) << "incorrect value for last_msg_.dev_vin, expected -9999, is " << last_msg_.dev_vin; - EXPECT_EQ(last_msg_.fe_temperature, 4776) << "incorrect value for last_msg_.fe_temperature, expected 4776, is " << last_msg_.fe_temperature; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgDeviceMonitor2, Test) { + uint8_t encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 219, + 3, 253, 6, 22, 24, 168, 18, 19, 114, + }; + + sbp_msg_device_monitor_t test_msg{}; + test_msg.cpu_temperature = 6166; + test_msg.cpu_vaux = 1789; + test_msg.cpu_vint = 987; + test_msg.dev_vin = -9999; + test_msg.fe_temperature = 4776; + + EXPECT_EQ(send_message(16991, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 16991); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu_temperature, 6166) + << "incorrect value for last_msg_.cpu_temperature, expected 6166, is " + << last_msg_.cpu_temperature; + EXPECT_EQ(last_msg_.cpu_vaux, 1789) + << "incorrect value for last_msg_.cpu_vaux, expected 1789, is " + << last_msg_.cpu_vaux; + EXPECT_EQ(last_msg_.cpu_vint, 987) + << "incorrect value for last_msg_.cpu_vint, expected 987, is " + << last_msg_.cpu_vint; + EXPECT_EQ(last_msg_.dev_vin, -9999) + << "incorrect value for last_msg_.dev_vin, expected -9999, is " + << last_msg_.dev_vin; + EXPECT_EQ(last_msg_.fe_temperature, 4776) + << "incorrect value for last_msg_.fe_temperature, expected 4776, is " + << last_msg_.fe_temperature; } -class Test_auto_check_sbp_piksi_MsgDeviceMonitor3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgDeviceMonitor3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgDeviceMonitor3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgDeviceMonitor3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_device_monitor_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_device_monitor_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -344,90 +355,95 @@ class Test_auto_check_sbp_piksi_MsgDeviceMonitor3 : sbp_msg_device_monitor_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgDeviceMonitor3, Test) -{ - - uint8_t encoded_frame[] = {85,181,0,95,66,10,241,216,218,3,252,6,6,24,168,18,199,107, }; - - sbp_msg_device_monitor_t test_msg{}; - test_msg.cpu_temperature = 6150; - test_msg.cpu_vaux = 1788; - test_msg.cpu_vint = 986; - test_msg.dev_vin = -9999; - test_msg.fe_temperature = 4776; - - EXPECT_EQ(send_message( 16991, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 16991); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu_temperature, 6150) << "incorrect value for last_msg_.cpu_temperature, expected 6150, is " << last_msg_.cpu_temperature; - EXPECT_EQ(last_msg_.cpu_vaux, 1788) << "incorrect value for last_msg_.cpu_vaux, expected 1788, is " << last_msg_.cpu_vaux; - EXPECT_EQ(last_msg_.cpu_vint, 986) << "incorrect value for last_msg_.cpu_vint, expected 986, is " << last_msg_.cpu_vint; - EXPECT_EQ(last_msg_.dev_vin, -9999) << "incorrect value for last_msg_.dev_vin, expected -9999, is " << last_msg_.dev_vin; - EXPECT_EQ(last_msg_.fe_temperature, 4776) << "incorrect value for last_msg_.fe_temperature, expected 4776, is " << last_msg_.fe_temperature; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgDeviceMonitor3, Test) { + uint8_t encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 218, + 3, 252, 6, 6, 24, 168, 18, 199, 107, + }; + + sbp_msg_device_monitor_t test_msg{}; + test_msg.cpu_temperature = 6150; + test_msg.cpu_vaux = 1788; + test_msg.cpu_vint = 986; + test_msg.dev_vin = -9999; + test_msg.fe_temperature = 4776; + + EXPECT_EQ(send_message(16991, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 16991); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu_temperature, 6150) + << "incorrect value for last_msg_.cpu_temperature, expected 6150, is " + << last_msg_.cpu_temperature; + EXPECT_EQ(last_msg_.cpu_vaux, 1788) + << "incorrect value for last_msg_.cpu_vaux, expected 1788, is " + << last_msg_.cpu_vaux; + EXPECT_EQ(last_msg_.cpu_vint, 986) + << "incorrect value for last_msg_.cpu_vint, expected 986, is " + << last_msg_.cpu_vint; + EXPECT_EQ(last_msg_.dev_vin, -9999) + << "incorrect value for last_msg_.dev_vin, expected -9999, is " + << last_msg_.dev_vin; + EXPECT_EQ(last_msg_.fe_temperature, 4776) + << "incorrect value for last_msg_.fe_temperature, expected 4776, is " + << last_msg_.fe_temperature; } -class Test_auto_check_sbp_piksi_MsgDeviceMonitor4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgDeviceMonitor4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgDeviceMonitor4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgDeviceMonitor4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_device_monitor_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_device_monitor_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -435,40 +451,51 @@ class Test_auto_check_sbp_piksi_MsgDeviceMonitor4 : sbp_msg_device_monitor_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgDeviceMonitor4, Test) -{ - - uint8_t encoded_frame[] = {85,181,0,95,66,10,241,216,220,3,253,6,235,23,168,18,241,63, }; - - sbp_msg_device_monitor_t test_msg{}; - test_msg.cpu_temperature = 6123; - test_msg.cpu_vaux = 1789; - test_msg.cpu_vint = 988; - test_msg.dev_vin = -9999; - test_msg.fe_temperature = 4776; - - EXPECT_EQ(send_message( 16991, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 16991); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu_temperature, 6123) << "incorrect value for last_msg_.cpu_temperature, expected 6123, is " << last_msg_.cpu_temperature; - EXPECT_EQ(last_msg_.cpu_vaux, 1789) << "incorrect value for last_msg_.cpu_vaux, expected 1789, is " << last_msg_.cpu_vaux; - EXPECT_EQ(last_msg_.cpu_vint, 988) << "incorrect value for last_msg_.cpu_vint, expected 988, is " << last_msg_.cpu_vint; - EXPECT_EQ(last_msg_.dev_vin, -9999) << "incorrect value for last_msg_.dev_vin, expected -9999, is " << last_msg_.dev_vin; - EXPECT_EQ(last_msg_.fe_temperature, 4776) << "incorrect value for last_msg_.fe_temperature, expected 4776, is " << last_msg_.fe_temperature; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgDeviceMonitor4, Test) { + uint8_t encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 220, + 3, 253, 6, 235, 23, 168, 18, 241, 63, + }; + + sbp_msg_device_monitor_t test_msg{}; + test_msg.cpu_temperature = 6123; + test_msg.cpu_vaux = 1789; + test_msg.cpu_vint = 988; + test_msg.dev_vin = -9999; + test_msg.fe_temperature = 4776; + + EXPECT_EQ(send_message(16991, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 16991); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu_temperature, 6123) + << "incorrect value for last_msg_.cpu_temperature, expected 6123, is " + << last_msg_.cpu_temperature; + EXPECT_EQ(last_msg_.cpu_vaux, 1789) + << "incorrect value for last_msg_.cpu_vaux, expected 1789, is " + << last_msg_.cpu_vaux; + EXPECT_EQ(last_msg_.cpu_vint, 988) + << "incorrect value for last_msg_.cpu_vint, expected 988, is " + << last_msg_.cpu_vint; + EXPECT_EQ(last_msg_.dev_vin, -9999) + << "incorrect value for last_msg_.dev_vin, expected -9999, is " + << last_msg_.dev_vin; + EXPECT_EQ(last_msg_.fe_temperature, 4776) + << "incorrect value for last_msg_.fe_temperature, expected 4776, is " + << last_msg_.fe_temperature; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgFrontEndGain.cc b/c/test/cpp/auto_check_sbp_piksi_MsgFrontEndGain.cc index af42a87ae..a37eac54a 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgFrontEndGain.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgFrontEndGain.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgFrontEndGain.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgFrontEndGain.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgFrontEndGain0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgFrontEndGain0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgFrontEndGain0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgFrontEndGain0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_front_end_gain_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_front_end_gain_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,78 +67,111 @@ class Test_auto_check_sbp_piksi_MsgFrontEndGain0 : sbp_msg_front_end_gain_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgFrontEndGain0, Test) -{ - - uint8_t encoded_frame[] = {85,191,0,175,245,16,41,133,134,10,105,20,38,38,246,233,216,80,187,213,85,2,235,135, }; - - sbp_msg_front_end_gain_t test_msg{}; - - test_msg.if_gain[0] = -10; - - test_msg.if_gain[1] = -23; - - test_msg.if_gain[2] = -40; - - test_msg.if_gain[3] = 80; - - test_msg.if_gain[4] = -69; - - test_msg.if_gain[5] = -43; - - test_msg.if_gain[6] = 85; - - test_msg.if_gain[7] = 2; - - test_msg.rf_gain[0] = 41; - - test_msg.rf_gain[1] = -123; - - test_msg.rf_gain[2] = -122; - - test_msg.rf_gain[3] = 10; - - test_msg.rf_gain[4] = 105; - - test_msg.rf_gain[5] = 20; - - test_msg.rf_gain[6] = 38; - - test_msg.rf_gain[7] = 38; - - EXPECT_EQ(send_message( 62895, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 62895); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.if_gain[0], -10) << "incorrect value for last_msg_.if_gain[0], expected -10, is " << last_msg_.if_gain[0]; - EXPECT_EQ(last_msg_.if_gain[1], -23) << "incorrect value for last_msg_.if_gain[1], expected -23, is " << last_msg_.if_gain[1]; - EXPECT_EQ(last_msg_.if_gain[2], -40) << "incorrect value for last_msg_.if_gain[2], expected -40, is " << last_msg_.if_gain[2]; - EXPECT_EQ(last_msg_.if_gain[3], 80) << "incorrect value for last_msg_.if_gain[3], expected 80, is " << last_msg_.if_gain[3]; - EXPECT_EQ(last_msg_.if_gain[4], -69) << "incorrect value for last_msg_.if_gain[4], expected -69, is " << last_msg_.if_gain[4]; - EXPECT_EQ(last_msg_.if_gain[5], -43) << "incorrect value for last_msg_.if_gain[5], expected -43, is " << last_msg_.if_gain[5]; - EXPECT_EQ(last_msg_.if_gain[6], 85) << "incorrect value for last_msg_.if_gain[6], expected 85, is " << last_msg_.if_gain[6]; - EXPECT_EQ(last_msg_.if_gain[7], 2) << "incorrect value for last_msg_.if_gain[7], expected 2, is " << last_msg_.if_gain[7]; - EXPECT_EQ(last_msg_.rf_gain[0], 41) << "incorrect value for last_msg_.rf_gain[0], expected 41, is " << last_msg_.rf_gain[0]; - EXPECT_EQ(last_msg_.rf_gain[1], -123) << "incorrect value for last_msg_.rf_gain[1], expected -123, is " << last_msg_.rf_gain[1]; - EXPECT_EQ(last_msg_.rf_gain[2], -122) << "incorrect value for last_msg_.rf_gain[2], expected -122, is " << last_msg_.rf_gain[2]; - EXPECT_EQ(last_msg_.rf_gain[3], 10) << "incorrect value for last_msg_.rf_gain[3], expected 10, is " << last_msg_.rf_gain[3]; - EXPECT_EQ(last_msg_.rf_gain[4], 105) << "incorrect value for last_msg_.rf_gain[4], expected 105, is " << last_msg_.rf_gain[4]; - EXPECT_EQ(last_msg_.rf_gain[5], 20) << "incorrect value for last_msg_.rf_gain[5], expected 20, is " << last_msg_.rf_gain[5]; - EXPECT_EQ(last_msg_.rf_gain[6], 38) << "incorrect value for last_msg_.rf_gain[6], expected 38, is " << last_msg_.rf_gain[6]; - EXPECT_EQ(last_msg_.rf_gain[7], 38) << "incorrect value for last_msg_.rf_gain[7], expected 38, is " << last_msg_.rf_gain[7]; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgFrontEndGain0, Test) { + uint8_t encoded_frame[] = { + 85, 191, 0, 175, 245, 16, 41, 133, 134, 10, 105, 20, + 38, 38, 246, 233, 216, 80, 187, 213, 85, 2, 235, 135, + }; + + sbp_msg_front_end_gain_t test_msg{}; + + test_msg.if_gain[0] = -10; + + test_msg.if_gain[1] = -23; + + test_msg.if_gain[2] = -40; + + test_msg.if_gain[3] = 80; + + test_msg.if_gain[4] = -69; + + test_msg.if_gain[5] = -43; + + test_msg.if_gain[6] = 85; + + test_msg.if_gain[7] = 2; + + test_msg.rf_gain[0] = 41; + + test_msg.rf_gain[1] = -123; + + test_msg.rf_gain[2] = -122; + + test_msg.rf_gain[3] = 10; + + test_msg.rf_gain[4] = 105; + + test_msg.rf_gain[5] = 20; + + test_msg.rf_gain[6] = 38; + + test_msg.rf_gain[7] = 38; + + EXPECT_EQ(send_message(62895, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 62895); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.if_gain[0], -10) + << "incorrect value for last_msg_.if_gain[0], expected -10, is " + << last_msg_.if_gain[0]; + EXPECT_EQ(last_msg_.if_gain[1], -23) + << "incorrect value for last_msg_.if_gain[1], expected -23, is " + << last_msg_.if_gain[1]; + EXPECT_EQ(last_msg_.if_gain[2], -40) + << "incorrect value for last_msg_.if_gain[2], expected -40, is " + << last_msg_.if_gain[2]; + EXPECT_EQ(last_msg_.if_gain[3], 80) + << "incorrect value for last_msg_.if_gain[3], expected 80, is " + << last_msg_.if_gain[3]; + EXPECT_EQ(last_msg_.if_gain[4], -69) + << "incorrect value for last_msg_.if_gain[4], expected -69, is " + << last_msg_.if_gain[4]; + EXPECT_EQ(last_msg_.if_gain[5], -43) + << "incorrect value for last_msg_.if_gain[5], expected -43, is " + << last_msg_.if_gain[5]; + EXPECT_EQ(last_msg_.if_gain[6], 85) + << "incorrect value for last_msg_.if_gain[6], expected 85, is " + << last_msg_.if_gain[6]; + EXPECT_EQ(last_msg_.if_gain[7], 2) + << "incorrect value for last_msg_.if_gain[7], expected 2, is " + << last_msg_.if_gain[7]; + EXPECT_EQ(last_msg_.rf_gain[0], 41) + << "incorrect value for last_msg_.rf_gain[0], expected 41, is " + << last_msg_.rf_gain[0]; + EXPECT_EQ(last_msg_.rf_gain[1], -123) + << "incorrect value for last_msg_.rf_gain[1], expected -123, is " + << last_msg_.rf_gain[1]; + EXPECT_EQ(last_msg_.rf_gain[2], -122) + << "incorrect value for last_msg_.rf_gain[2], expected -122, is " + << last_msg_.rf_gain[2]; + EXPECT_EQ(last_msg_.rf_gain[3], 10) + << "incorrect value for last_msg_.rf_gain[3], expected 10, is " + << last_msg_.rf_gain[3]; + EXPECT_EQ(last_msg_.rf_gain[4], 105) + << "incorrect value for last_msg_.rf_gain[4], expected 105, is " + << last_msg_.rf_gain[4]; + EXPECT_EQ(last_msg_.rf_gain[5], 20) + << "incorrect value for last_msg_.rf_gain[5], expected 20, is " + << last_msg_.rf_gain[5]; + EXPECT_EQ(last_msg_.rf_gain[6], 38) + << "incorrect value for last_msg_.rf_gain[6], expected 38, is " + << last_msg_.rf_gain[6]; + EXPECT_EQ(last_msg_.rf_gain[7], 38) + << "incorrect value for last_msg_.rf_gain[7], expected 38, is " + << last_msg_.rf_gain[7]; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgIarState.cc b/c/test/cpp/auto_check_sbp_piksi_MsgIarState.cc index 205f7b860..ea30328db 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgIarState.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgIarState.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgIarState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgIarState.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgIarState0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgIarState0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgIarState0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgIarState0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_iar_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_iar_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,82 +67,78 @@ class Test_auto_check_sbp_piksi_MsgIarState0 : sbp_msg_iar_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgIarState0, Test) -{ - - uint8_t encoded_frame[] = {85,25,0,246,215,4,1,0,0,0,216,140, }; - - sbp_msg_iar_state_t test_msg{}; - test_msg.num_hyps = 1; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.num_hyps, 1) << "incorrect value for last_msg_.num_hyps, expected 1, is " << last_msg_.num_hyps; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgIarState0, Test) { + uint8_t encoded_frame[] = { + 85, 25, 0, 246, 215, 4, 1, 0, 0, 0, 216, 140, + }; + + sbp_msg_iar_state_t test_msg{}; + test_msg.num_hyps = 1; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.num_hyps, 1) + << "incorrect value for last_msg_.num_hyps, expected 1, is " + << last_msg_.num_hyps; } -class Test_auto_check_sbp_piksi_MsgIarState1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgIarState1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgIarState1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgIarState1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_iar_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_iar_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -154,82 +146,78 @@ class Test_auto_check_sbp_piksi_MsgIarState1 : sbp_msg_iar_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgIarState1, Test) -{ - - uint8_t encoded_frame[] = {85,25,0,195,4,4,0,0,0,0,18,176, }; - - sbp_msg_iar_state_t test_msg{}; - test_msg.num_hyps = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.num_hyps, 0) << "incorrect value for last_msg_.num_hyps, expected 0, is " << last_msg_.num_hyps; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgIarState1, Test) { + uint8_t encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 0, 0, 0, 0, 18, 176, + }; + + sbp_msg_iar_state_t test_msg{}; + test_msg.num_hyps = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.num_hyps, 0) + << "incorrect value for last_msg_.num_hyps, expected 0, is " + << last_msg_.num_hyps; } -class Test_auto_check_sbp_piksi_MsgIarState2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgIarState2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgIarState2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgIarState2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_iar_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_iar_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -237,82 +225,78 @@ class Test_auto_check_sbp_piksi_MsgIarState2 : sbp_msg_iar_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgIarState2, Test) -{ - - uint8_t encoded_frame[] = {85,25,0,195,4,4,1,0,0,0,166,198, }; - - sbp_msg_iar_state_t test_msg{}; - test_msg.num_hyps = 1; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.num_hyps, 1) << "incorrect value for last_msg_.num_hyps, expected 1, is " << last_msg_.num_hyps; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgIarState2, Test) { + uint8_t encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 1, 0, 0, 0, 166, 198, + }; + + sbp_msg_iar_state_t test_msg{}; + test_msg.num_hyps = 1; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.num_hyps, 1) + << "incorrect value for last_msg_.num_hyps, expected 1, is " + << last_msg_.num_hyps; } -class Test_auto_check_sbp_piksi_MsgIarState3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgIarState3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgIarState3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgIarState3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_iar_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_iar_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -320,82 +304,78 @@ class Test_auto_check_sbp_piksi_MsgIarState3 : sbp_msg_iar_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgIarState3, Test) -{ - - uint8_t encoded_frame[] = {85,25,0,195,4,4,217,2,0,0,6,133, }; - - sbp_msg_iar_state_t test_msg{}; - test_msg.num_hyps = 729; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.num_hyps, 729) << "incorrect value for last_msg_.num_hyps, expected 729, is " << last_msg_.num_hyps; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgIarState3, Test) { + uint8_t encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 217, 2, 0, 0, 6, 133, + }; + + sbp_msg_iar_state_t test_msg{}; + test_msg.num_hyps = 729; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.num_hyps, 729) + << "incorrect value for last_msg_.num_hyps, expected 729, is " + << last_msg_.num_hyps; } -class Test_auto_check_sbp_piksi_MsgIarState4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgIarState4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgIarState4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgIarState4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_iar_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_iar_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -403,82 +383,78 @@ class Test_auto_check_sbp_piksi_MsgIarState4 : sbp_msg_iar_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgIarState4, Test) -{ - - uint8_t encoded_frame[] = {85,25,0,195,4,4,216,2,0,0,178,243, }; - - sbp_msg_iar_state_t test_msg{}; - test_msg.num_hyps = 728; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.num_hyps, 728) << "incorrect value for last_msg_.num_hyps, expected 728, is " << last_msg_.num_hyps; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgIarState4, Test) { + uint8_t encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 216, 2, 0, 0, 178, 243, + }; + + sbp_msg_iar_state_t test_msg{}; + test_msg.num_hyps = 728; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.num_hyps, 728) + << "incorrect value for last_msg_.num_hyps, expected 728, is " + << last_msg_.num_hyps; } -class Test_auto_check_sbp_piksi_MsgIarState5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgIarState5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgIarState5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgIarState5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_iar_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_iar_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -486,82 +462,78 @@ class Test_auto_check_sbp_piksi_MsgIarState5 : sbp_msg_iar_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgIarState5, Test) -{ - - uint8_t encoded_frame[] = {85,25,0,195,4,4,215,2,0,0,92,39, }; - - sbp_msg_iar_state_t test_msg{}; - test_msg.num_hyps = 727; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.num_hyps, 727) << "incorrect value for last_msg_.num_hyps, expected 727, is " << last_msg_.num_hyps; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgIarState5, Test) { + uint8_t encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 215, 2, 0, 0, 92, 39, + }; + + sbp_msg_iar_state_t test_msg{}; + test_msg.num_hyps = 727; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.num_hyps, 727) + << "incorrect value for last_msg_.num_hyps, expected 727, is " + << last_msg_.num_hyps; } -class Test_auto_check_sbp_piksi_MsgIarState6 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgIarState6() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgIarState6 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgIarState6() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_iar_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_iar_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -569,32 +541,34 @@ class Test_auto_check_sbp_piksi_MsgIarState6 : sbp_msg_iar_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgIarState6, Test) -{ - - uint8_t encoded_frame[] = {85,25,0,195,4,4,211,2,0,0,173,237, }; - - sbp_msg_iar_state_t test_msg{}; - test_msg.num_hyps = 723; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.num_hyps, 723) << "incorrect value for last_msg_.num_hyps, expected 723, is " << last_msg_.num_hyps; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgIarState6, Test) { + uint8_t encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 211, 2, 0, 0, 173, 237, + }; + + sbp_msg_iar_state_t test_msg{}; + test_msg.num_hyps = 723; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.num_hyps, 723) + << "incorrect value for last_msg_.num_hyps, expected 723, is " + << last_msg_.num_hyps; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgInitBaseDep.cc b/c/test/cpp/auto_check_sbp_piksi_MsgInitBaseDep.cc index 2f8cb4a97..03ffd9113 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgInitBaseDep.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgInitBaseDep.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgInitBaseDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgInitBaseDep.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgInitBaseDep0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgInitBaseDep0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgInitBaseDep0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgInitBaseDep0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_init_base_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_init_base_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,30 +67,30 @@ class Test_auto_check_sbp_piksi_MsgInitBaseDep0 : sbp_msg_init_base_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgInitBaseDep0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgInitBaseDep0, Test) { + uint8_t encoded_frame[] = { + 85, 35, 0, 184, 41, 0, 70, 13, + }; - uint8_t encoded_frame[] = {85,35,0,184,41,0,70,13, }; + sbp_msg_init_base_dep_t test_msg{}; - sbp_msg_init_base_dep_t test_msg{}; - - EXPECT_EQ(send_message( 10680, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(10680, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 10680); - EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 10680); + EXPECT_EQ(last_msg_, test_msg); } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgMaskSatellite.cc b/c/test/cpp/auto_check_sbp_piksi_MsgMaskSatellite.cc index 288991a30..81bdd0aaa 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgMaskSatellite.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgMaskSatellite.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatellite.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatellite.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgMaskSatellite0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgMaskSatellite0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgMaskSatellite0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgMaskSatellite0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_mask_satellite_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_mask_satellite_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,36 +67,42 @@ class Test_auto_check_sbp_piksi_MsgMaskSatellite0 : sbp_msg_mask_satellite_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgMaskSatellite0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgMaskSatellite0, Test) { + uint8_t encoded_frame[] = { + 85, 43, 0, 173, 151, 3, 183, 87, 57, 19, 147, + }; - uint8_t encoded_frame[] = {85,43,0,173,151,3,183,87,57,19,147, }; + sbp_msg_mask_satellite_t test_msg{}; + test_msg.mask = 183; + test_msg.sid.code = 57; + test_msg.sid.sat = 87; - sbp_msg_mask_satellite_t test_msg{}; - test_msg.mask = 183; - test_msg.sid.code = 57; - test_msg.sid.sat = 87; - - EXPECT_EQ(send_message( 38829, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(38829, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 38829); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.mask, 183) << "incorrect value for last_msg_.mask, expected 183, is " << last_msg_.mask; - EXPECT_EQ(last_msg_.sid.code, 57) << "incorrect value for last_msg_.sid.code, expected 57, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.sat, 87) << "incorrect value for last_msg_.sid.sat, expected 87, is " << last_msg_.sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 38829); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.mask, 183) + << "incorrect value for last_msg_.mask, expected 183, is " + << last_msg_.mask; + EXPECT_EQ(last_msg_.sid.code, 57) + << "incorrect value for last_msg_.sid.code, expected 57, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.sat, 87) + << "incorrect value for last_msg_.sid.sat, expected 87, is " + << last_msg_.sid.sat; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgMaskSatelliteDep.cc b/c/test/cpp/auto_check_sbp_piksi_MsgMaskSatelliteDep.cc index ed8552c4a..c5eeea6ee 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgMaskSatelliteDep.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgMaskSatelliteDep.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatelliteDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatelliteDep.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgMaskSatelliteDep0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgMaskSatelliteDep0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgMaskSatelliteDep0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgMaskSatelliteDep0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_mask_satellite_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_mask_satellite_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,38 +67,46 @@ class Test_auto_check_sbp_piksi_MsgMaskSatelliteDep0 : sbp_msg_mask_satellite_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgMaskSatelliteDep0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgMaskSatelliteDep0, Test) { + uint8_t encoded_frame[] = { + 85, 27, 0, 187, 134, 5, 33, 2, 153, 95, 4, 29, 188, + }; - uint8_t encoded_frame[] = {85,27,0,187,134,5,33,2,153,95,4,29,188, }; + sbp_msg_mask_satellite_dep_t test_msg{}; + test_msg.mask = 33; + test_msg.sid.code = 95; + test_msg.sid.reserved = 4; + test_msg.sid.sat = 39170; - sbp_msg_mask_satellite_dep_t test_msg{}; - test_msg.mask = 33; - test_msg.sid.code = 95; - test_msg.sid.reserved = 4; - test_msg.sid.sat = 39170; - - EXPECT_EQ(send_message( 34491, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(34491, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 34491); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.mask, 33) << "incorrect value for last_msg_.mask, expected 33, is " << last_msg_.mask; - EXPECT_EQ(last_msg_.sid.code, 95) << "incorrect value for last_msg_.sid.code, expected 95, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 4) << "incorrect value for last_msg_.sid.reserved, expected 4, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 39170) << "incorrect value for last_msg_.sid.sat, expected 39170, is " << last_msg_.sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 34491); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.mask, 33) + << "incorrect value for last_msg_.mask, expected 33, is " + << last_msg_.mask; + EXPECT_EQ(last_msg_.sid.code, 95) + << "incorrect value for last_msg_.sid.code, expected 95, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 4) + << "incorrect value for last_msg_.sid.reserved, expected 4, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 39170) + << "incorrect value for last_msg_.sid.sat, expected 39170, is " + << last_msg_.sid.sat; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.cc b/c/test/cpp/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.cc index 28b38853c..283ce8395 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkBandwidthUsage.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkBandwidthUsage.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgNetworkBandwidthUsage0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgNetworkBandwidthUsage0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgNetworkBandwidthUsage0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgNetworkBandwidthUsage0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_network_bandwidth_usage_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_network_bandwidth_usage_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,133 +67,286 @@ class Test_auto_check_sbp_piksi_MsgNetworkBandwidthUsage0 : sbp_msg_network_bandwidth_usage_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgNetworkBandwidthUsage0, Test) -{ - - uint8_t encoded_frame[] = {85,189,0,207,121,200,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,99,97,110,48,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,99,97,110,49,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,165,235,94,203,0,0,0,0,237,14,148,240,184,220,202,218,101,116,104,48,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,115,105,116,48,0,0,0,0,0,0,0,0,0,0,0,0,27,133, }; - - sbp_msg_network_bandwidth_usage_t test_msg{}; - - test_msg.interfaces[0].duration = 2159176030; - { - const char assign_string[] = { (char)99,(char)97,(char)110,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.interfaces[0].interface_name, assign_string, sizeof(assign_string)); - } - test_msg.interfaces[0].rx_bytes = 0; - test_msg.interfaces[0].total_bytes = 0; - test_msg.interfaces[0].tx_bytes = 0; - - test_msg.interfaces[1].duration = 2159176030; - { - const char assign_string[] = { (char)99,(char)97,(char)110,(char)49,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.interfaces[1].interface_name, assign_string, sizeof(assign_string)); - } - test_msg.interfaces[1].rx_bytes = 0; - test_msg.interfaces[1].total_bytes = 0; - test_msg.interfaces[1].tx_bytes = 0; - - test_msg.interfaces[2].duration = 2159176030; - { - const char assign_string[] = { (char)101,(char)116,(char)104,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.interfaces[2].interface_name, assign_string, sizeof(assign_string)); - } - test_msg.interfaces[2].rx_bytes = 4036234989; - test_msg.interfaces[2].total_bytes = 3411995557; - test_msg.interfaces[2].tx_bytes = 3670727864; - - test_msg.interfaces[3].duration = 2159176030; - { - const char assign_string[] = { (char)108,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.interfaces[3].interface_name, assign_string, sizeof(assign_string)); - } - test_msg.interfaces[3].rx_bytes = 0; - test_msg.interfaces[3].total_bytes = 0; - test_msg.interfaces[3].tx_bytes = 0; - - test_msg.interfaces[4].duration = 2159176030; - { - const char assign_string[] = { (char)115,(char)105,(char)116,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.interfaces[4].interface_name, assign_string, sizeof(assign_string)); - } - test_msg.interfaces[4].rx_bytes = 0; - test_msg.interfaces[4].total_bytes = 0; - test_msg.interfaces[4].tx_bytes = 0; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_interfaces.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)105,(char)110,(char)116,(char)101,(char)114,(char)102,(char)97,(char)99,(char)101,(char)115 }; - memcpy(test_msg.n_interfaces.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_interfaces.value = 5; - - EXPECT_EQ(send_message( 31183, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 31183); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.interfaces[0].duration, 2159176030) << "incorrect value for last_msg_.interfaces[0].duration, expected 2159176030, is " << last_msg_.interfaces[0].duration; - { - const char check_string[] = { (char)99,(char)97,(char)110,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.interfaces[0].interface_name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.interfaces[0].interface_name, expected string '" << check_string << "', is '" << last_msg_.interfaces[0].interface_name << "'"; - } - EXPECT_EQ(last_msg_.interfaces[0].rx_bytes, 0) << "incorrect value for last_msg_.interfaces[0].rx_bytes, expected 0, is " << last_msg_.interfaces[0].rx_bytes; - EXPECT_EQ(last_msg_.interfaces[0].total_bytes, 0) << "incorrect value for last_msg_.interfaces[0].total_bytes, expected 0, is " << last_msg_.interfaces[0].total_bytes; - EXPECT_EQ(last_msg_.interfaces[0].tx_bytes, 0) << "incorrect value for last_msg_.interfaces[0].tx_bytes, expected 0, is " << last_msg_.interfaces[0].tx_bytes; - EXPECT_EQ(last_msg_.interfaces[1].duration, 2159176030) << "incorrect value for last_msg_.interfaces[1].duration, expected 2159176030, is " << last_msg_.interfaces[1].duration; - { - const char check_string[] = { (char)99,(char)97,(char)110,(char)49,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.interfaces[1].interface_name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.interfaces[1].interface_name, expected string '" << check_string << "', is '" << last_msg_.interfaces[1].interface_name << "'"; - } - EXPECT_EQ(last_msg_.interfaces[1].rx_bytes, 0) << "incorrect value for last_msg_.interfaces[1].rx_bytes, expected 0, is " << last_msg_.interfaces[1].rx_bytes; - EXPECT_EQ(last_msg_.interfaces[1].total_bytes, 0) << "incorrect value for last_msg_.interfaces[1].total_bytes, expected 0, is " << last_msg_.interfaces[1].total_bytes; - EXPECT_EQ(last_msg_.interfaces[1].tx_bytes, 0) << "incorrect value for last_msg_.interfaces[1].tx_bytes, expected 0, is " << last_msg_.interfaces[1].tx_bytes; - EXPECT_EQ(last_msg_.interfaces[2].duration, 2159176030) << "incorrect value for last_msg_.interfaces[2].duration, expected 2159176030, is " << last_msg_.interfaces[2].duration; - { - const char check_string[] = { (char)101,(char)116,(char)104,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.interfaces[2].interface_name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.interfaces[2].interface_name, expected string '" << check_string << "', is '" << last_msg_.interfaces[2].interface_name << "'"; - } - EXPECT_EQ(last_msg_.interfaces[2].rx_bytes, 4036234989) << "incorrect value for last_msg_.interfaces[2].rx_bytes, expected 4036234989, is " << last_msg_.interfaces[2].rx_bytes; - EXPECT_EQ(last_msg_.interfaces[2].total_bytes, 3411995557) << "incorrect value for last_msg_.interfaces[2].total_bytes, expected 3411995557, is " << last_msg_.interfaces[2].total_bytes; - EXPECT_EQ(last_msg_.interfaces[2].tx_bytes, 3670727864) << "incorrect value for last_msg_.interfaces[2].tx_bytes, expected 3670727864, is " << last_msg_.interfaces[2].tx_bytes; - EXPECT_EQ(last_msg_.interfaces[3].duration, 2159176030) << "incorrect value for last_msg_.interfaces[3].duration, expected 2159176030, is " << last_msg_.interfaces[3].duration; - { - const char check_string[] = { (char)108,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.interfaces[3].interface_name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.interfaces[3].interface_name, expected string '" << check_string << "', is '" << last_msg_.interfaces[3].interface_name << "'"; - } - EXPECT_EQ(last_msg_.interfaces[3].rx_bytes, 0) << "incorrect value for last_msg_.interfaces[3].rx_bytes, expected 0, is " << last_msg_.interfaces[3].rx_bytes; - EXPECT_EQ(last_msg_.interfaces[3].total_bytes, 0) << "incorrect value for last_msg_.interfaces[3].total_bytes, expected 0, is " << last_msg_.interfaces[3].total_bytes; - EXPECT_EQ(last_msg_.interfaces[3].tx_bytes, 0) << "incorrect value for last_msg_.interfaces[3].tx_bytes, expected 0, is " << last_msg_.interfaces[3].tx_bytes; - EXPECT_EQ(last_msg_.interfaces[4].duration, 2159176030) << "incorrect value for last_msg_.interfaces[4].duration, expected 2159176030, is " << last_msg_.interfaces[4].duration; - { - const char check_string[] = { (char)115,(char)105,(char)116,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.interfaces[4].interface_name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.interfaces[4].interface_name, expected string '" << check_string << "', is '" << last_msg_.interfaces[4].interface_name << "'"; - } - EXPECT_EQ(last_msg_.interfaces[4].rx_bytes, 0) << "incorrect value for last_msg_.interfaces[4].rx_bytes, expected 0, is " << last_msg_.interfaces[4].rx_bytes; - EXPECT_EQ(last_msg_.interfaces[4].total_bytes, 0) << "incorrect value for last_msg_.interfaces[4].total_bytes, expected 0, is " << last_msg_.interfaces[4].total_bytes; - EXPECT_EQ(last_msg_.interfaces[4].tx_bytes, 0) << "incorrect value for last_msg_.interfaces[4].tx_bytes, expected 0, is " << last_msg_.interfaces[4].tx_bytes; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_interfaces.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_interfaces.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_interfaces.handle_as << "'"; - } - { - const char check_string[] = { (char)105,(char)110,(char)116,(char)101,(char)114,(char)102,(char)97,(char)99,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_interfaces.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_interfaces.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_interfaces.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_interfaces.value, 5) << "incorrect value for last_msg_.n_interfaces.value, expected 5, is " << last_msg_.n_interfaces.value; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgNetworkBandwidthUsage0, Test) { + uint8_t encoded_frame[] = { + 85, 189, 0, 207, 121, 200, 94, 105, 178, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 94, 105, 178, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 97, 110, 49, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 105, 178, 128, + 0, 0, 0, 0, 165, 235, 94, 203, 0, 0, 0, 0, 237, 14, 148, + 240, 184, 220, 202, 218, 101, 116, 104, 48, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 94, 105, 178, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 94, 105, 178, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, 105, 116, 48, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 133, + }; + + sbp_msg_network_bandwidth_usage_t test_msg{}; + + test_msg.interfaces[0].duration = 2159176030; + { + const char assign_string[] = {(char)99, (char)97, (char)110, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.interfaces[0].interface_name, assign_string, + sizeof(assign_string)); + } + test_msg.interfaces[0].rx_bytes = 0; + test_msg.interfaces[0].total_bytes = 0; + test_msg.interfaces[0].tx_bytes = 0; + + test_msg.interfaces[1].duration = 2159176030; + { + const char assign_string[] = {(char)99, (char)97, (char)110, (char)49, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.interfaces[1].interface_name, assign_string, + sizeof(assign_string)); + } + test_msg.interfaces[1].rx_bytes = 0; + test_msg.interfaces[1].total_bytes = 0; + test_msg.interfaces[1].tx_bytes = 0; + + test_msg.interfaces[2].duration = 2159176030; + { + const char assign_string[] = {(char)101, (char)116, (char)104, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.interfaces[2].interface_name, assign_string, + sizeof(assign_string)); + } + test_msg.interfaces[2].rx_bytes = 4036234989; + test_msg.interfaces[2].total_bytes = 3411995557; + test_msg.interfaces[2].tx_bytes = 3670727864; + + test_msg.interfaces[3].duration = 2159176030; + { + const char assign_string[] = {(char)108, (char)111, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.interfaces[3].interface_name, assign_string, + sizeof(assign_string)); + } + test_msg.interfaces[3].rx_bytes = 0; + test_msg.interfaces[3].total_bytes = 0; + test_msg.interfaces[3].tx_bytes = 0; + + test_msg.interfaces[4].duration = 2159176030; + { + const char assign_string[] = {(char)115, (char)105, (char)116, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.interfaces[4].interface_name, assign_string, + sizeof(assign_string)); + } + test_msg.interfaces[4].rx_bytes = 0; + test_msg.interfaces[4].total_bytes = 0; + test_msg.interfaces[4].tx_bytes = 0; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_interfaces.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)105, (char)110, (char)116, (char)101, + (char)114, (char)102, (char)97, (char)99, + (char)101, (char)115}; + memcpy(test_msg.n_interfaces.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_interfaces.value = 5; + + EXPECT_EQ(send_message(31183, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 31183); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.interfaces[0].duration, 2159176030) + << "incorrect value for last_msg_.interfaces[0].duration, expected " + "2159176030, is " + << last_msg_.interfaces[0].duration; + { + const char check_string[] = {(char)99, (char)97, (char)110, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.interfaces[0].interface_name, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.interfaces[0].interface_name, " + "expected string '" + << check_string << "', is '" << last_msg_.interfaces[0].interface_name + << "'"; + } + EXPECT_EQ(last_msg_.interfaces[0].rx_bytes, 0) + << "incorrect value for last_msg_.interfaces[0].rx_bytes, expected 0, is " + << last_msg_.interfaces[0].rx_bytes; + EXPECT_EQ(last_msg_.interfaces[0].total_bytes, 0) + << "incorrect value for last_msg_.interfaces[0].total_bytes, expected 0, " + "is " + << last_msg_.interfaces[0].total_bytes; + EXPECT_EQ(last_msg_.interfaces[0].tx_bytes, 0) + << "incorrect value for last_msg_.interfaces[0].tx_bytes, expected 0, is " + << last_msg_.interfaces[0].tx_bytes; + EXPECT_EQ(last_msg_.interfaces[1].duration, 2159176030) + << "incorrect value for last_msg_.interfaces[1].duration, expected " + "2159176030, is " + << last_msg_.interfaces[1].duration; + { + const char check_string[] = {(char)99, (char)97, (char)110, (char)49, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.interfaces[1].interface_name, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.interfaces[1].interface_name, " + "expected string '" + << check_string << "', is '" << last_msg_.interfaces[1].interface_name + << "'"; + } + EXPECT_EQ(last_msg_.interfaces[1].rx_bytes, 0) + << "incorrect value for last_msg_.interfaces[1].rx_bytes, expected 0, is " + << last_msg_.interfaces[1].rx_bytes; + EXPECT_EQ(last_msg_.interfaces[1].total_bytes, 0) + << "incorrect value for last_msg_.interfaces[1].total_bytes, expected 0, " + "is " + << last_msg_.interfaces[1].total_bytes; + EXPECT_EQ(last_msg_.interfaces[1].tx_bytes, 0) + << "incorrect value for last_msg_.interfaces[1].tx_bytes, expected 0, is " + << last_msg_.interfaces[1].tx_bytes; + EXPECT_EQ(last_msg_.interfaces[2].duration, 2159176030) + << "incorrect value for last_msg_.interfaces[2].duration, expected " + "2159176030, is " + << last_msg_.interfaces[2].duration; + { + const char check_string[] = {(char)101, (char)116, (char)104, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.interfaces[2].interface_name, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.interfaces[2].interface_name, " + "expected string '" + << check_string << "', is '" << last_msg_.interfaces[2].interface_name + << "'"; + } + EXPECT_EQ(last_msg_.interfaces[2].rx_bytes, 4036234989) + << "incorrect value for last_msg_.interfaces[2].rx_bytes, expected " + "4036234989, is " + << last_msg_.interfaces[2].rx_bytes; + EXPECT_EQ(last_msg_.interfaces[2].total_bytes, 3411995557) + << "incorrect value for last_msg_.interfaces[2].total_bytes, expected " + "3411995557, is " + << last_msg_.interfaces[2].total_bytes; + EXPECT_EQ(last_msg_.interfaces[2].tx_bytes, 3670727864) + << "incorrect value for last_msg_.interfaces[2].tx_bytes, expected " + "3670727864, is " + << last_msg_.interfaces[2].tx_bytes; + EXPECT_EQ(last_msg_.interfaces[3].duration, 2159176030) + << "incorrect value for last_msg_.interfaces[3].duration, expected " + "2159176030, is " + << last_msg_.interfaces[3].duration; + { + const char check_string[] = {(char)108, (char)111, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.interfaces[3].interface_name, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.interfaces[3].interface_name, " + "expected string '" + << check_string << "', is '" << last_msg_.interfaces[3].interface_name + << "'"; + } + EXPECT_EQ(last_msg_.interfaces[3].rx_bytes, 0) + << "incorrect value for last_msg_.interfaces[3].rx_bytes, expected 0, is " + << last_msg_.interfaces[3].rx_bytes; + EXPECT_EQ(last_msg_.interfaces[3].total_bytes, 0) + << "incorrect value for last_msg_.interfaces[3].total_bytes, expected 0, " + "is " + << last_msg_.interfaces[3].total_bytes; + EXPECT_EQ(last_msg_.interfaces[3].tx_bytes, 0) + << "incorrect value for last_msg_.interfaces[3].tx_bytes, expected 0, is " + << last_msg_.interfaces[3].tx_bytes; + EXPECT_EQ(last_msg_.interfaces[4].duration, 2159176030) + << "incorrect value for last_msg_.interfaces[4].duration, expected " + "2159176030, is " + << last_msg_.interfaces[4].duration; + { + const char check_string[] = {(char)115, (char)105, (char)116, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.interfaces[4].interface_name, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.interfaces[4].interface_name, " + "expected string '" + << check_string << "', is '" << last_msg_.interfaces[4].interface_name + << "'"; + } + EXPECT_EQ(last_msg_.interfaces[4].rx_bytes, 0) + << "incorrect value for last_msg_.interfaces[4].rx_bytes, expected 0, is " + << last_msg_.interfaces[4].rx_bytes; + EXPECT_EQ(last_msg_.interfaces[4].total_bytes, 0) + << "incorrect value for last_msg_.interfaces[4].total_bytes, expected 0, " + "is " + << last_msg_.interfaces[4].total_bytes; + EXPECT_EQ(last_msg_.interfaces[4].tx_bytes, 0) + << "incorrect value for last_msg_.interfaces[4].tx_bytes, expected 0, is " + << last_msg_.interfaces[4].tx_bytes; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_interfaces.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_interfaces.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_interfaces.handle_as << "'"; + } + { + const char check_string[] = {(char)105, (char)110, (char)116, (char)101, + (char)114, (char)102, (char)97, (char)99, + (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_interfaces.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_interfaces.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_interfaces.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_interfaces.value, 5) + << "incorrect value for last_msg_.n_interfaces.value, expected 5, is " + << last_msg_.n_interfaces.value; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgNetworkStateReq.cc b/c/test/cpp/auto_check_sbp_piksi_MsgNetworkStateReq.cc index 1f25ec828..0861e0896 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgNetworkStateReq.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgNetworkStateReq.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateReq.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgNetworkStateReq0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgNetworkStateReq0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgNetworkStateReq0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgNetworkStateReq0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_network_state_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_network_state_req_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,30 +67,30 @@ class Test_auto_check_sbp_piksi_MsgNetworkStateReq0 : sbp_msg_network_state_req_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgNetworkStateReq0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgNetworkStateReq0, Test) { + uint8_t encoded_frame[] = { + 85, 186, 0, 83, 62, 0, 148, 73, + }; - uint8_t encoded_frame[] = {85,186,0,83,62,0,148,73, }; + sbp_msg_network_state_req_t test_msg{}; - sbp_msg_network_state_req_t test_msg{}; - - EXPECT_EQ(send_message( 15955, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(15955, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 15955); - EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 15955); + EXPECT_EQ(last_msg_, test_msg); } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgNetworkStateResp.cc b/c/test/cpp/auto_check_sbp_piksi_MsgNetworkStateResp.cc index f83c53fcf..8e5a52ebb 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgNetworkStateResp.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgNetworkStateResp.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateResp.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgNetworkStateResp0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgNetworkStateResp0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgNetworkStateResp0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgNetworkStateResp0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_network_state_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_network_state_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,108 +67,170 @@ class Test_auto_check_sbp_piksi_MsgNetworkStateResp0 : sbp_msg_network_state_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgNetworkStateResp0, Test) -{ - - uint8_t encoded_frame[] = {85,187,0,40,15,50,143,241,84,180,152,194,137,32,44,114,147,68,222,92,192,78,235,63,208,114,53,183,24,244,231,26,105,25,136,3,105,102,48,0,0,0,0,0,0,0,0,0,0,0,0,0,195,229,80,147,118,193, }; - - sbp_msg_network_state_resp_t test_msg{}; - test_msg.flags = 2471552451; - { - const char assign_string[] = { (char)105,(char)102,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.interface_name, assign_string, sizeof(assign_string)); - } - - test_msg.ipv4_address[0] = 143; - - test_msg.ipv4_address[1] = 241; - - test_msg.ipv4_address[2] = 84; - - test_msg.ipv4_address[3] = 180; - test_msg.ipv4_mask_size = 152; - - test_msg.ipv6_address[0] = 194; - - test_msg.ipv6_address[1] = 137; - - test_msg.ipv6_address[2] = 32; - - test_msg.ipv6_address[3] = 44; - - test_msg.ipv6_address[4] = 114; - - test_msg.ipv6_address[5] = 147; - - test_msg.ipv6_address[6] = 68; - - test_msg.ipv6_address[7] = 222; - - test_msg.ipv6_address[8] = 92; - - test_msg.ipv6_address[9] = 192; - - test_msg.ipv6_address[10] = 78; - - test_msg.ipv6_address[11] = 235; - - test_msg.ipv6_address[12] = 63; - - test_msg.ipv6_address[13] = 208; - - test_msg.ipv6_address[14] = 114; - - test_msg.ipv6_address[15] = 53; - test_msg.ipv6_mask_size = 183; - test_msg.rx_bytes = 451408920; - test_msg.tx_bytes = 59251049; - - EXPECT_EQ(send_message( 3880, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 3880); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 2471552451) << "incorrect value for last_msg_.flags, expected 2471552451, is " << last_msg_.flags; - { - const char check_string[] = { (char)105,(char)102,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.interface_name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.interface_name, expected string '" << check_string << "', is '" << last_msg_.interface_name << "'"; - } - EXPECT_EQ(last_msg_.ipv4_address[0], 143) << "incorrect value for last_msg_.ipv4_address[0], expected 143, is " << last_msg_.ipv4_address[0]; - EXPECT_EQ(last_msg_.ipv4_address[1], 241) << "incorrect value for last_msg_.ipv4_address[1], expected 241, is " << last_msg_.ipv4_address[1]; - EXPECT_EQ(last_msg_.ipv4_address[2], 84) << "incorrect value for last_msg_.ipv4_address[2], expected 84, is " << last_msg_.ipv4_address[2]; - EXPECT_EQ(last_msg_.ipv4_address[3], 180) << "incorrect value for last_msg_.ipv4_address[3], expected 180, is " << last_msg_.ipv4_address[3]; - EXPECT_EQ(last_msg_.ipv4_mask_size, 152) << "incorrect value for last_msg_.ipv4_mask_size, expected 152, is " << last_msg_.ipv4_mask_size; - EXPECT_EQ(last_msg_.ipv6_address[0], 194) << "incorrect value for last_msg_.ipv6_address[0], expected 194, is " << last_msg_.ipv6_address[0]; - EXPECT_EQ(last_msg_.ipv6_address[1], 137) << "incorrect value for last_msg_.ipv6_address[1], expected 137, is " << last_msg_.ipv6_address[1]; - EXPECT_EQ(last_msg_.ipv6_address[2], 32) << "incorrect value for last_msg_.ipv6_address[2], expected 32, is " << last_msg_.ipv6_address[2]; - EXPECT_EQ(last_msg_.ipv6_address[3], 44) << "incorrect value for last_msg_.ipv6_address[3], expected 44, is " << last_msg_.ipv6_address[3]; - EXPECT_EQ(last_msg_.ipv6_address[4], 114) << "incorrect value for last_msg_.ipv6_address[4], expected 114, is " << last_msg_.ipv6_address[4]; - EXPECT_EQ(last_msg_.ipv6_address[5], 147) << "incorrect value for last_msg_.ipv6_address[5], expected 147, is " << last_msg_.ipv6_address[5]; - EXPECT_EQ(last_msg_.ipv6_address[6], 68) << "incorrect value for last_msg_.ipv6_address[6], expected 68, is " << last_msg_.ipv6_address[6]; - EXPECT_EQ(last_msg_.ipv6_address[7], 222) << "incorrect value for last_msg_.ipv6_address[7], expected 222, is " << last_msg_.ipv6_address[7]; - EXPECT_EQ(last_msg_.ipv6_address[8], 92) << "incorrect value for last_msg_.ipv6_address[8], expected 92, is " << last_msg_.ipv6_address[8]; - EXPECT_EQ(last_msg_.ipv6_address[9], 192) << "incorrect value for last_msg_.ipv6_address[9], expected 192, is " << last_msg_.ipv6_address[9]; - EXPECT_EQ(last_msg_.ipv6_address[10], 78) << "incorrect value for last_msg_.ipv6_address[10], expected 78, is " << last_msg_.ipv6_address[10]; - EXPECT_EQ(last_msg_.ipv6_address[11], 235) << "incorrect value for last_msg_.ipv6_address[11], expected 235, is " << last_msg_.ipv6_address[11]; - EXPECT_EQ(last_msg_.ipv6_address[12], 63) << "incorrect value for last_msg_.ipv6_address[12], expected 63, is " << last_msg_.ipv6_address[12]; - EXPECT_EQ(last_msg_.ipv6_address[13], 208) << "incorrect value for last_msg_.ipv6_address[13], expected 208, is " << last_msg_.ipv6_address[13]; - EXPECT_EQ(last_msg_.ipv6_address[14], 114) << "incorrect value for last_msg_.ipv6_address[14], expected 114, is " << last_msg_.ipv6_address[14]; - EXPECT_EQ(last_msg_.ipv6_address[15], 53) << "incorrect value for last_msg_.ipv6_address[15], expected 53, is " << last_msg_.ipv6_address[15]; - EXPECT_EQ(last_msg_.ipv6_mask_size, 183) << "incorrect value for last_msg_.ipv6_mask_size, expected 183, is " << last_msg_.ipv6_mask_size; - EXPECT_EQ(last_msg_.rx_bytes, 451408920) << "incorrect value for last_msg_.rx_bytes, expected 451408920, is " << last_msg_.rx_bytes; - EXPECT_EQ(last_msg_.tx_bytes, 59251049) << "incorrect value for last_msg_.tx_bytes, expected 59251049, is " << last_msg_.tx_bytes; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgNetworkStateResp0, Test) { + uint8_t encoded_frame[] = { + 85, 187, 0, 40, 15, 50, 143, 241, 84, 180, 152, 194, 137, 32, 44, + 114, 147, 68, 222, 92, 192, 78, 235, 63, 208, 114, 53, 183, 24, 244, + 231, 26, 105, 25, 136, 3, 105, 102, 48, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 195, 229, 80, 147, 118, 193, + }; + + sbp_msg_network_state_resp_t test_msg{}; + test_msg.flags = 2471552451; + { + const char assign_string[] = {(char)105, (char)102, (char)48, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.interface_name, assign_string, sizeof(assign_string)); + } + + test_msg.ipv4_address[0] = 143; + + test_msg.ipv4_address[1] = 241; + + test_msg.ipv4_address[2] = 84; + + test_msg.ipv4_address[3] = 180; + test_msg.ipv4_mask_size = 152; + + test_msg.ipv6_address[0] = 194; + + test_msg.ipv6_address[1] = 137; + + test_msg.ipv6_address[2] = 32; + + test_msg.ipv6_address[3] = 44; + + test_msg.ipv6_address[4] = 114; + + test_msg.ipv6_address[5] = 147; + + test_msg.ipv6_address[6] = 68; + + test_msg.ipv6_address[7] = 222; + + test_msg.ipv6_address[8] = 92; + + test_msg.ipv6_address[9] = 192; + + test_msg.ipv6_address[10] = 78; + + test_msg.ipv6_address[11] = 235; + + test_msg.ipv6_address[12] = 63; + + test_msg.ipv6_address[13] = 208; + + test_msg.ipv6_address[14] = 114; + + test_msg.ipv6_address[15] = 53; + test_msg.ipv6_mask_size = 183; + test_msg.rx_bytes = 451408920; + test_msg.tx_bytes = 59251049; + + EXPECT_EQ(send_message(3880, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 3880); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 2471552451) + << "incorrect value for last_msg_.flags, expected 2471552451, is " + << last_msg_.flags; + { + const char check_string[] = {(char)105, (char)102, (char)48, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ( + memcmp(last_msg_.interface_name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.interface_name, expected string '" + << check_string << "', is '" << last_msg_.interface_name << "'"; + } + EXPECT_EQ(last_msg_.ipv4_address[0], 143) + << "incorrect value for last_msg_.ipv4_address[0], expected 143, is " + << last_msg_.ipv4_address[0]; + EXPECT_EQ(last_msg_.ipv4_address[1], 241) + << "incorrect value for last_msg_.ipv4_address[1], expected 241, is " + << last_msg_.ipv4_address[1]; + EXPECT_EQ(last_msg_.ipv4_address[2], 84) + << "incorrect value for last_msg_.ipv4_address[2], expected 84, is " + << last_msg_.ipv4_address[2]; + EXPECT_EQ(last_msg_.ipv4_address[3], 180) + << "incorrect value for last_msg_.ipv4_address[3], expected 180, is " + << last_msg_.ipv4_address[3]; + EXPECT_EQ(last_msg_.ipv4_mask_size, 152) + << "incorrect value for last_msg_.ipv4_mask_size, expected 152, is " + << last_msg_.ipv4_mask_size; + EXPECT_EQ(last_msg_.ipv6_address[0], 194) + << "incorrect value for last_msg_.ipv6_address[0], expected 194, is " + << last_msg_.ipv6_address[0]; + EXPECT_EQ(last_msg_.ipv6_address[1], 137) + << "incorrect value for last_msg_.ipv6_address[1], expected 137, is " + << last_msg_.ipv6_address[1]; + EXPECT_EQ(last_msg_.ipv6_address[2], 32) + << "incorrect value for last_msg_.ipv6_address[2], expected 32, is " + << last_msg_.ipv6_address[2]; + EXPECT_EQ(last_msg_.ipv6_address[3], 44) + << "incorrect value for last_msg_.ipv6_address[3], expected 44, is " + << last_msg_.ipv6_address[3]; + EXPECT_EQ(last_msg_.ipv6_address[4], 114) + << "incorrect value for last_msg_.ipv6_address[4], expected 114, is " + << last_msg_.ipv6_address[4]; + EXPECT_EQ(last_msg_.ipv6_address[5], 147) + << "incorrect value for last_msg_.ipv6_address[5], expected 147, is " + << last_msg_.ipv6_address[5]; + EXPECT_EQ(last_msg_.ipv6_address[6], 68) + << "incorrect value for last_msg_.ipv6_address[6], expected 68, is " + << last_msg_.ipv6_address[6]; + EXPECT_EQ(last_msg_.ipv6_address[7], 222) + << "incorrect value for last_msg_.ipv6_address[7], expected 222, is " + << last_msg_.ipv6_address[7]; + EXPECT_EQ(last_msg_.ipv6_address[8], 92) + << "incorrect value for last_msg_.ipv6_address[8], expected 92, is " + << last_msg_.ipv6_address[8]; + EXPECT_EQ(last_msg_.ipv6_address[9], 192) + << "incorrect value for last_msg_.ipv6_address[9], expected 192, is " + << last_msg_.ipv6_address[9]; + EXPECT_EQ(last_msg_.ipv6_address[10], 78) + << "incorrect value for last_msg_.ipv6_address[10], expected 78, is " + << last_msg_.ipv6_address[10]; + EXPECT_EQ(last_msg_.ipv6_address[11], 235) + << "incorrect value for last_msg_.ipv6_address[11], expected 235, is " + << last_msg_.ipv6_address[11]; + EXPECT_EQ(last_msg_.ipv6_address[12], 63) + << "incorrect value for last_msg_.ipv6_address[12], expected 63, is " + << last_msg_.ipv6_address[12]; + EXPECT_EQ(last_msg_.ipv6_address[13], 208) + << "incorrect value for last_msg_.ipv6_address[13], expected 208, is " + << last_msg_.ipv6_address[13]; + EXPECT_EQ(last_msg_.ipv6_address[14], 114) + << "incorrect value for last_msg_.ipv6_address[14], expected 114, is " + << last_msg_.ipv6_address[14]; + EXPECT_EQ(last_msg_.ipv6_address[15], 53) + << "incorrect value for last_msg_.ipv6_address[15], expected 53, is " + << last_msg_.ipv6_address[15]; + EXPECT_EQ(last_msg_.ipv6_mask_size, 183) + << "incorrect value for last_msg_.ipv6_mask_size, expected 183, is " + << last_msg_.ipv6_mask_size; + EXPECT_EQ(last_msg_.rx_bytes, 451408920) + << "incorrect value for last_msg_.rx_bytes, expected 451408920, is " + << last_msg_.rx_bytes; + EXPECT_EQ(last_msg_.tx_bytes, 59251049) + << "incorrect value for last_msg_.tx_bytes, expected 59251049, is " + << last_msg_.tx_bytes; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgReset.cc b/c/test/cpp/auto_check_sbp_piksi_MsgReset.cc index f7404fb90..3b9bfa857 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgReset.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgReset.cc @@ -10,60 +10,55 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgReset.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgReset.yaml by generate.py. Do not +// modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgReset0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgReset0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgReset0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgReset0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_reset_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, const sbp_msg_reset_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,32 +66,34 @@ class Test_auto_check_sbp_piksi_MsgReset0 : sbp_msg_reset_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgReset0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgReset0, Test) { + uint8_t encoded_frame[] = { + 85, 182, 0, 63, 210, 4, 88, 248, 238, 19, 74, 207, + }; - uint8_t encoded_frame[] = {85,182,0,63,210,4,88,248,238,19,74,207, }; + sbp_msg_reset_t test_msg{}; + test_msg.flags = 334428248; - sbp_msg_reset_t test_msg{}; - test_msg.flags = 334428248; - - EXPECT_EQ(send_message( 53823, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(53823, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 53823); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 334428248) << "incorrect value for last_msg_.flags, expected 334428248, is " << last_msg_.flags; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 53823); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 334428248) + << "incorrect value for last_msg_.flags, expected 334428248, is " + << last_msg_.flags; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgResetDep.cc b/c/test/cpp/auto_check_sbp_piksi_MsgResetDep.cc index aa37dd36b..0e9df9ce1 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgResetDep.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgResetDep.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetDep.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgResetDep0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgResetDep0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgResetDep0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgResetDep0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_reset_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_reset_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,30 +67,30 @@ class Test_auto_check_sbp_piksi_MsgResetDep0 : sbp_msg_reset_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgResetDep0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgResetDep0, Test) { + uint8_t encoded_frame[] = { + 85, 178, 0, 64, 11, 0, 234, 171, + }; - uint8_t encoded_frame[] = {85,178,0,64,11,0,234,171, }; + sbp_msg_reset_dep_t test_msg{}; - sbp_msg_reset_dep_t test_msg{}; - - EXPECT_EQ(send_message( 2880, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(2880, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 2880); - EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 2880); + EXPECT_EQ(last_msg_, test_msg); } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgResetFilters.cc b/c/test/cpp/auto_check_sbp_piksi_MsgResetFilters.cc index 05532e679..12fadbd7e 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgResetFilters.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgResetFilters.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetFilters.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetFilters.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgResetFilters0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgResetFilters0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgResetFilters0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgResetFilters0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_reset_filters_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_reset_filters_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,32 +67,34 @@ class Test_auto_check_sbp_piksi_MsgResetFilters0 : sbp_msg_reset_filters_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgResetFilters0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgResetFilters0, Test) { + uint8_t encoded_frame[] = { + 85, 34, 0, 81, 200, 1, 100, 130, 45, + }; - uint8_t encoded_frame[] = {85,34,0,81,200,1,100,130,45, }; + sbp_msg_reset_filters_t test_msg{}; + test_msg.filter = 100; - sbp_msg_reset_filters_t test_msg{}; - test_msg.filter = 100; - - EXPECT_EQ(send_message( 51281, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(51281, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 51281); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.filter, 100) << "incorrect value for last_msg_.filter, expected 100, is " << last_msg_.filter; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 51281); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.filter, 100) + << "incorrect value for last_msg_.filter, expected 100, is " + << last_msg_.filter; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgSetTime.cc b/c/test/cpp/auto_check_sbp_piksi_MsgSetTime.cc index f15bac491..4b6720b92 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgSetTime.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgSetTime.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSetTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSetTime.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgSetTime0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgSetTime0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgSetTime0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgSetTime0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_set_time_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_set_time_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,30 +67,30 @@ class Test_auto_check_sbp_piksi_MsgSetTime0 : sbp_msg_set_time_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgSetTime0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgSetTime0, Test) { + uint8_t encoded_frame[] = { + 85, 104, 0, 21, 170, 0, 215, 65, + }; - uint8_t encoded_frame[] = {85,104,0,21,170,0,215,65, }; + sbp_msg_set_time_t test_msg{}; - sbp_msg_set_time_t test_msg{}; - - EXPECT_EQ(send_message( 43541, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(43541, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 43541); - EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 43541); + EXPECT_EQ(last_msg_, test_msg); } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgSpecan.cc b/c/test/cpp/auto_check_sbp_piksi_MsgSpecan.cc index 108f8418d..b56fe5dcb 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgSpecan.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgSpecan.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecan.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecan.yaml by generate.py. Do not +// modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgSpecan0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgSpecan0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgSpecan0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgSpecan0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_specan_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_specan_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,745 +67,1262 @@ class Test_auto_check_sbp_piksi_MsgSpecan0 : sbp_msg_specan_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgSpecan0, Test) -{ - - uint8_t encoded_frame[] = {85,81,0,28,212,255,74,137,71,245,34,73,12,221,215,167,211,19,154,201,241,69,205,136,0,70,51,67,108,69,102,38,166,68,100,179,185,17,175,49,193,228,228,47,33,24,141,177,18,99,246,121,61,40,91,145,223,167,174,9,116,11,247,84,49,153,205,2,230,194,218,241,101,107,45,137,93,114,230,43,224,23,74,209,199,211,130,89,220,163,68,20,253,7,206,50,129,116,194,23,31,226,217,157,205,221,5,224,92,82,109,223,195,233,165,1,82,141,157,177,169,244,131,96,109,111,253,149,28,225,225,72,158,158,210,196,206,70,63,225,184,150,174,240,45,146,59,82,194,4,179,148,66,254,115,77,30,46,4,204,37,200,121,18,17,171,102,163,175,50,66,101,69,13,223,172,160,233,220,101,237,156,62,117,47,143,94,135,22,155,113,110,15,243,141,227,46,143,227,209,249,2,153,168,131,249,160,88,38,117,129,57,40,109,209,177,38,47,12,15,16,9,175,69,70,182,239,117,135,6,71,99,230,115,2,71,165,228,123,210,168,90,124,20,7,220,144,168,69,22,72,162,69,111,91,251,72,220,28,119,150,95,2, }; - - sbp_msg_specan_t test_msg{}; - test_msg.amplitude_ref = 3780.199951171875; - test_msg.amplitude_unit = 1329.199951171875; - - test_msg.amplitude_value[0] = 100; - - test_msg.amplitude_value[1] = 179; - - test_msg.amplitude_value[2] = 185; - - test_msg.amplitude_value[3] = 17; - - test_msg.amplitude_value[4] = 175; - - test_msg.amplitude_value[5] = 49; - - test_msg.amplitude_value[6] = 193; - - test_msg.amplitude_value[7] = 228; - - test_msg.amplitude_value[8] = 228; - - test_msg.amplitude_value[9] = 47; - - test_msg.amplitude_value[10] = 33; - - test_msg.amplitude_value[11] = 24; - - test_msg.amplitude_value[12] = 141; - - test_msg.amplitude_value[13] = 177; - - test_msg.amplitude_value[14] = 18; - - test_msg.amplitude_value[15] = 99; - - test_msg.amplitude_value[16] = 246; - - test_msg.amplitude_value[17] = 121; - - test_msg.amplitude_value[18] = 61; - - test_msg.amplitude_value[19] = 40; - - test_msg.amplitude_value[20] = 91; - - test_msg.amplitude_value[21] = 145; - - test_msg.amplitude_value[22] = 223; - - test_msg.amplitude_value[23] = 167; - - test_msg.amplitude_value[24] = 174; - - test_msg.amplitude_value[25] = 9; - - test_msg.amplitude_value[26] = 116; - - test_msg.amplitude_value[27] = 11; - - test_msg.amplitude_value[28] = 247; - - test_msg.amplitude_value[29] = 84; - - test_msg.amplitude_value[30] = 49; - - test_msg.amplitude_value[31] = 153; - - test_msg.amplitude_value[32] = 205; - - test_msg.amplitude_value[33] = 2; - - test_msg.amplitude_value[34] = 230; - - test_msg.amplitude_value[35] = 194; - - test_msg.amplitude_value[36] = 218; - - test_msg.amplitude_value[37] = 241; - - test_msg.amplitude_value[38] = 101; - - test_msg.amplitude_value[39] = 107; - - test_msg.amplitude_value[40] = 45; - - test_msg.amplitude_value[41] = 137; - - test_msg.amplitude_value[42] = 93; - - test_msg.amplitude_value[43] = 114; - - test_msg.amplitude_value[44] = 230; - - test_msg.amplitude_value[45] = 43; - - test_msg.amplitude_value[46] = 224; - - test_msg.amplitude_value[47] = 23; - - test_msg.amplitude_value[48] = 74; - - test_msg.amplitude_value[49] = 209; - - test_msg.amplitude_value[50] = 199; - - test_msg.amplitude_value[51] = 211; - - test_msg.amplitude_value[52] = 130; - - test_msg.amplitude_value[53] = 89; - - test_msg.amplitude_value[54] = 220; - - test_msg.amplitude_value[55] = 163; - - test_msg.amplitude_value[56] = 68; - - test_msg.amplitude_value[57] = 20; - - test_msg.amplitude_value[58] = 253; - - test_msg.amplitude_value[59] = 7; - - test_msg.amplitude_value[60] = 206; - - test_msg.amplitude_value[61] = 50; - - test_msg.amplitude_value[62] = 129; - - test_msg.amplitude_value[63] = 116; - - test_msg.amplitude_value[64] = 194; - - test_msg.amplitude_value[65] = 23; - - test_msg.amplitude_value[66] = 31; - - test_msg.amplitude_value[67] = 226; - - test_msg.amplitude_value[68] = 217; - - test_msg.amplitude_value[69] = 157; - - test_msg.amplitude_value[70] = 205; - - test_msg.amplitude_value[71] = 221; - - test_msg.amplitude_value[72] = 5; - - test_msg.amplitude_value[73] = 224; - - test_msg.amplitude_value[74] = 92; - - test_msg.amplitude_value[75] = 82; - - test_msg.amplitude_value[76] = 109; - - test_msg.amplitude_value[77] = 223; - - test_msg.amplitude_value[78] = 195; - - test_msg.amplitude_value[79] = 233; - - test_msg.amplitude_value[80] = 165; - - test_msg.amplitude_value[81] = 1; - - test_msg.amplitude_value[82] = 82; - - test_msg.amplitude_value[83] = 141; - - test_msg.amplitude_value[84] = 157; - - test_msg.amplitude_value[85] = 177; - - test_msg.amplitude_value[86] = 169; - - test_msg.amplitude_value[87] = 244; - - test_msg.amplitude_value[88] = 131; - - test_msg.amplitude_value[89] = 96; - - test_msg.amplitude_value[90] = 109; - - test_msg.amplitude_value[91] = 111; - - test_msg.amplitude_value[92] = 253; - - test_msg.amplitude_value[93] = 149; - - test_msg.amplitude_value[94] = 28; - - test_msg.amplitude_value[95] = 225; - - test_msg.amplitude_value[96] = 225; - - test_msg.amplitude_value[97] = 72; - - test_msg.amplitude_value[98] = 158; - - test_msg.amplitude_value[99] = 158; - - test_msg.amplitude_value[100] = 210; - - test_msg.amplitude_value[101] = 196; - - test_msg.amplitude_value[102] = 206; - - test_msg.amplitude_value[103] = 70; - - test_msg.amplitude_value[104] = 63; - - test_msg.amplitude_value[105] = 225; - - test_msg.amplitude_value[106] = 184; - - test_msg.amplitude_value[107] = 150; - - test_msg.amplitude_value[108] = 174; - - test_msg.amplitude_value[109] = 240; - - test_msg.amplitude_value[110] = 45; - - test_msg.amplitude_value[111] = 146; - - test_msg.amplitude_value[112] = 59; - - test_msg.amplitude_value[113] = 82; - - test_msg.amplitude_value[114] = 194; - - test_msg.amplitude_value[115] = 4; - - test_msg.amplitude_value[116] = 179; - - test_msg.amplitude_value[117] = 148; - - test_msg.amplitude_value[118] = 66; - - test_msg.amplitude_value[119] = 254; - - test_msg.amplitude_value[120] = 115; - - test_msg.amplitude_value[121] = 77; - - test_msg.amplitude_value[122] = 30; - - test_msg.amplitude_value[123] = 46; - - test_msg.amplitude_value[124] = 4; - - test_msg.amplitude_value[125] = 204; - - test_msg.amplitude_value[126] = 37; - - test_msg.amplitude_value[127] = 200; - - test_msg.amplitude_value[128] = 121; - - test_msg.amplitude_value[129] = 18; - - test_msg.amplitude_value[130] = 17; - - test_msg.amplitude_value[131] = 171; - - test_msg.amplitude_value[132] = 102; - - test_msg.amplitude_value[133] = 163; - - test_msg.amplitude_value[134] = 175; - - test_msg.amplitude_value[135] = 50; - - test_msg.amplitude_value[136] = 66; - - test_msg.amplitude_value[137] = 101; - - test_msg.amplitude_value[138] = 69; - - test_msg.amplitude_value[139] = 13; - - test_msg.amplitude_value[140] = 223; - - test_msg.amplitude_value[141] = 172; - - test_msg.amplitude_value[142] = 160; - - test_msg.amplitude_value[143] = 233; - - test_msg.amplitude_value[144] = 220; - - test_msg.amplitude_value[145] = 101; - - test_msg.amplitude_value[146] = 237; - - test_msg.amplitude_value[147] = 156; - - test_msg.amplitude_value[148] = 62; - - test_msg.amplitude_value[149] = 117; - - test_msg.amplitude_value[150] = 47; - - test_msg.amplitude_value[151] = 143; - - test_msg.amplitude_value[152] = 94; - - test_msg.amplitude_value[153] = 135; - - test_msg.amplitude_value[154] = 22; - - test_msg.amplitude_value[155] = 155; - - test_msg.amplitude_value[156] = 113; - - test_msg.amplitude_value[157] = 110; - - test_msg.amplitude_value[158] = 15; - - test_msg.amplitude_value[159] = 243; - - test_msg.amplitude_value[160] = 141; - - test_msg.amplitude_value[161] = 227; - - test_msg.amplitude_value[162] = 46; - - test_msg.amplitude_value[163] = 143; - - test_msg.amplitude_value[164] = 227; - - test_msg.amplitude_value[165] = 209; - - test_msg.amplitude_value[166] = 249; - - test_msg.amplitude_value[167] = 2; - - test_msg.amplitude_value[168] = 153; - - test_msg.amplitude_value[169] = 168; - - test_msg.amplitude_value[170] = 131; - - test_msg.amplitude_value[171] = 249; - - test_msg.amplitude_value[172] = 160; - - test_msg.amplitude_value[173] = 88; - - test_msg.amplitude_value[174] = 38; - - test_msg.amplitude_value[175] = 117; - - test_msg.amplitude_value[176] = 129; - - test_msg.amplitude_value[177] = 57; - - test_msg.amplitude_value[178] = 40; - - test_msg.amplitude_value[179] = 109; - - test_msg.amplitude_value[180] = 209; - - test_msg.amplitude_value[181] = 177; - - test_msg.amplitude_value[182] = 38; - - test_msg.amplitude_value[183] = 47; - - test_msg.amplitude_value[184] = 12; - - test_msg.amplitude_value[185] = 15; - - test_msg.amplitude_value[186] = 16; - - test_msg.amplitude_value[187] = 9; - - test_msg.amplitude_value[188] = 175; - - test_msg.amplitude_value[189] = 69; - - test_msg.amplitude_value[190] = 70; - - test_msg.amplitude_value[191] = 182; - - test_msg.amplitude_value[192] = 239; - - test_msg.amplitude_value[193] = 117; - - test_msg.amplitude_value[194] = 135; - - test_msg.amplitude_value[195] = 6; - - test_msg.amplitude_value[196] = 71; - - test_msg.amplitude_value[197] = 99; - - test_msg.amplitude_value[198] = 230; - - test_msg.amplitude_value[199] = 115; - - test_msg.amplitude_value[200] = 2; - - test_msg.amplitude_value[201] = 71; - - test_msg.amplitude_value[202] = 165; - - test_msg.amplitude_value[203] = 228; - - test_msg.amplitude_value[204] = 123; - - test_msg.amplitude_value[205] = 210; - - test_msg.amplitude_value[206] = 168; - - test_msg.amplitude_value[207] = 90; - - test_msg.amplitude_value[208] = 124; - - test_msg.amplitude_value[209] = 20; - - test_msg.amplitude_value[210] = 7; - - test_msg.amplitude_value[211] = 220; - - test_msg.amplitude_value[212] = 144; - - test_msg.amplitude_value[213] = 168; - - test_msg.amplitude_value[214] = 69; - - test_msg.amplitude_value[215] = 22; - - test_msg.amplitude_value[216] = 72; - - test_msg.amplitude_value[217] = 162; - - test_msg.amplitude_value[218] = 69; - - test_msg.amplitude_value[219] = 111; - - test_msg.amplitude_value[220] = 91; - - test_msg.amplitude_value[221] = 251; - - test_msg.amplitude_value[222] = 72; - - test_msg.amplitude_value[223] = 220; - - test_msg.amplitude_value[224] = 28; - - test_msg.amplitude_value[225] = 119; - - test_msg.amplitude_value[226] = 150; - test_msg.channel_tag = 35146; - test_msg.freq_ref = 7737.2001953125; - test_msg.freq_step = 8226.2001953125; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_amplitude_value.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)97,(char)109,(char)112,(char)108,(char)105,(char)116,(char)117,(char)100,(char)101,(char)95,(char)118,(char)97,(char)108,(char)117,(char)101 }; - memcpy(test_msg.n_amplitude_value.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_amplitude_value.value = 227; - test_msg.t.ns_residual = -1479025396; - test_msg.t.tow = 1227027783; - test_msg.t.wn = 5075; - - EXPECT_EQ(send_message( 54300, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 54300); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.amplitude_ref * 100 - 3780.19995117 * 100), 0.05) << "incorrect value for last_msg_.amplitude_ref, expected 3780.19995117, is " << last_msg_.amplitude_ref; - EXPECT_LT((last_msg_.amplitude_unit * 100 - 1329.19995117 * 100), 0.05) << "incorrect value for last_msg_.amplitude_unit, expected 1329.19995117, is " << last_msg_.amplitude_unit; - EXPECT_EQ(last_msg_.amplitude_value[0], 100) << "incorrect value for last_msg_.amplitude_value[0], expected 100, is " << last_msg_.amplitude_value[0]; - EXPECT_EQ(last_msg_.amplitude_value[1], 179) << "incorrect value for last_msg_.amplitude_value[1], expected 179, is " << last_msg_.amplitude_value[1]; - EXPECT_EQ(last_msg_.amplitude_value[2], 185) << "incorrect value for last_msg_.amplitude_value[2], expected 185, is " << last_msg_.amplitude_value[2]; - EXPECT_EQ(last_msg_.amplitude_value[3], 17) << "incorrect value for last_msg_.amplitude_value[3], expected 17, is " << last_msg_.amplitude_value[3]; - EXPECT_EQ(last_msg_.amplitude_value[4], 175) << "incorrect value for last_msg_.amplitude_value[4], expected 175, is " << last_msg_.amplitude_value[4]; - EXPECT_EQ(last_msg_.amplitude_value[5], 49) << "incorrect value for last_msg_.amplitude_value[5], expected 49, is " << last_msg_.amplitude_value[5]; - EXPECT_EQ(last_msg_.amplitude_value[6], 193) << "incorrect value for last_msg_.amplitude_value[6], expected 193, is " << last_msg_.amplitude_value[6]; - EXPECT_EQ(last_msg_.amplitude_value[7], 228) << "incorrect value for last_msg_.amplitude_value[7], expected 228, is " << last_msg_.amplitude_value[7]; - EXPECT_EQ(last_msg_.amplitude_value[8], 228) << "incorrect value for last_msg_.amplitude_value[8], expected 228, is " << last_msg_.amplitude_value[8]; - EXPECT_EQ(last_msg_.amplitude_value[9], 47) << "incorrect value for last_msg_.amplitude_value[9], expected 47, is " << last_msg_.amplitude_value[9]; - EXPECT_EQ(last_msg_.amplitude_value[10], 33) << "incorrect value for last_msg_.amplitude_value[10], expected 33, is " << last_msg_.amplitude_value[10]; - EXPECT_EQ(last_msg_.amplitude_value[11], 24) << "incorrect value for last_msg_.amplitude_value[11], expected 24, is " << last_msg_.amplitude_value[11]; - EXPECT_EQ(last_msg_.amplitude_value[12], 141) << "incorrect value for last_msg_.amplitude_value[12], expected 141, is " << last_msg_.amplitude_value[12]; - EXPECT_EQ(last_msg_.amplitude_value[13], 177) << "incorrect value for last_msg_.amplitude_value[13], expected 177, is " << last_msg_.amplitude_value[13]; - EXPECT_EQ(last_msg_.amplitude_value[14], 18) << "incorrect value for last_msg_.amplitude_value[14], expected 18, is " << last_msg_.amplitude_value[14]; - EXPECT_EQ(last_msg_.amplitude_value[15], 99) << "incorrect value for last_msg_.amplitude_value[15], expected 99, is " << last_msg_.amplitude_value[15]; - EXPECT_EQ(last_msg_.amplitude_value[16], 246) << "incorrect value for last_msg_.amplitude_value[16], expected 246, is " << last_msg_.amplitude_value[16]; - EXPECT_EQ(last_msg_.amplitude_value[17], 121) << "incorrect value for last_msg_.amplitude_value[17], expected 121, is " << last_msg_.amplitude_value[17]; - EXPECT_EQ(last_msg_.amplitude_value[18], 61) << "incorrect value for last_msg_.amplitude_value[18], expected 61, is " << last_msg_.amplitude_value[18]; - EXPECT_EQ(last_msg_.amplitude_value[19], 40) << "incorrect value for last_msg_.amplitude_value[19], expected 40, is " << last_msg_.amplitude_value[19]; - EXPECT_EQ(last_msg_.amplitude_value[20], 91) << "incorrect value for last_msg_.amplitude_value[20], expected 91, is " << last_msg_.amplitude_value[20]; - EXPECT_EQ(last_msg_.amplitude_value[21], 145) << "incorrect value for last_msg_.amplitude_value[21], expected 145, is " << last_msg_.amplitude_value[21]; - EXPECT_EQ(last_msg_.amplitude_value[22], 223) << "incorrect value for last_msg_.amplitude_value[22], expected 223, is " << last_msg_.amplitude_value[22]; - EXPECT_EQ(last_msg_.amplitude_value[23], 167) << "incorrect value for last_msg_.amplitude_value[23], expected 167, is " << last_msg_.amplitude_value[23]; - EXPECT_EQ(last_msg_.amplitude_value[24], 174) << "incorrect value for last_msg_.amplitude_value[24], expected 174, is " << last_msg_.amplitude_value[24]; - EXPECT_EQ(last_msg_.amplitude_value[25], 9) << "incorrect value for last_msg_.amplitude_value[25], expected 9, is " << last_msg_.amplitude_value[25]; - EXPECT_EQ(last_msg_.amplitude_value[26], 116) << "incorrect value for last_msg_.amplitude_value[26], expected 116, is " << last_msg_.amplitude_value[26]; - EXPECT_EQ(last_msg_.amplitude_value[27], 11) << "incorrect value for last_msg_.amplitude_value[27], expected 11, is " << last_msg_.amplitude_value[27]; - EXPECT_EQ(last_msg_.amplitude_value[28], 247) << "incorrect value for last_msg_.amplitude_value[28], expected 247, is " << last_msg_.amplitude_value[28]; - EXPECT_EQ(last_msg_.amplitude_value[29], 84) << "incorrect value for last_msg_.amplitude_value[29], expected 84, is " << last_msg_.amplitude_value[29]; - EXPECT_EQ(last_msg_.amplitude_value[30], 49) << "incorrect value for last_msg_.amplitude_value[30], expected 49, is " << last_msg_.amplitude_value[30]; - EXPECT_EQ(last_msg_.amplitude_value[31], 153) << "incorrect value for last_msg_.amplitude_value[31], expected 153, is " << last_msg_.amplitude_value[31]; - EXPECT_EQ(last_msg_.amplitude_value[32], 205) << "incorrect value for last_msg_.amplitude_value[32], expected 205, is " << last_msg_.amplitude_value[32]; - EXPECT_EQ(last_msg_.amplitude_value[33], 2) << "incorrect value for last_msg_.amplitude_value[33], expected 2, is " << last_msg_.amplitude_value[33]; - EXPECT_EQ(last_msg_.amplitude_value[34], 230) << "incorrect value for last_msg_.amplitude_value[34], expected 230, is " << last_msg_.amplitude_value[34]; - EXPECT_EQ(last_msg_.amplitude_value[35], 194) << "incorrect value for last_msg_.amplitude_value[35], expected 194, is " << last_msg_.amplitude_value[35]; - EXPECT_EQ(last_msg_.amplitude_value[36], 218) << "incorrect value for last_msg_.amplitude_value[36], expected 218, is " << last_msg_.amplitude_value[36]; - EXPECT_EQ(last_msg_.amplitude_value[37], 241) << "incorrect value for last_msg_.amplitude_value[37], expected 241, is " << last_msg_.amplitude_value[37]; - EXPECT_EQ(last_msg_.amplitude_value[38], 101) << "incorrect value for last_msg_.amplitude_value[38], expected 101, is " << last_msg_.amplitude_value[38]; - EXPECT_EQ(last_msg_.amplitude_value[39], 107) << "incorrect value for last_msg_.amplitude_value[39], expected 107, is " << last_msg_.amplitude_value[39]; - EXPECT_EQ(last_msg_.amplitude_value[40], 45) << "incorrect value for last_msg_.amplitude_value[40], expected 45, is " << last_msg_.amplitude_value[40]; - EXPECT_EQ(last_msg_.amplitude_value[41], 137) << "incorrect value for last_msg_.amplitude_value[41], expected 137, is " << last_msg_.amplitude_value[41]; - EXPECT_EQ(last_msg_.amplitude_value[42], 93) << "incorrect value for last_msg_.amplitude_value[42], expected 93, is " << last_msg_.amplitude_value[42]; - EXPECT_EQ(last_msg_.amplitude_value[43], 114) << "incorrect value for last_msg_.amplitude_value[43], expected 114, is " << last_msg_.amplitude_value[43]; - EXPECT_EQ(last_msg_.amplitude_value[44], 230) << "incorrect value for last_msg_.amplitude_value[44], expected 230, is " << last_msg_.amplitude_value[44]; - EXPECT_EQ(last_msg_.amplitude_value[45], 43) << "incorrect value for last_msg_.amplitude_value[45], expected 43, is " << last_msg_.amplitude_value[45]; - EXPECT_EQ(last_msg_.amplitude_value[46], 224) << "incorrect value for last_msg_.amplitude_value[46], expected 224, is " << last_msg_.amplitude_value[46]; - EXPECT_EQ(last_msg_.amplitude_value[47], 23) << "incorrect value for last_msg_.amplitude_value[47], expected 23, is " << last_msg_.amplitude_value[47]; - EXPECT_EQ(last_msg_.amplitude_value[48], 74) << "incorrect value for last_msg_.amplitude_value[48], expected 74, is " << last_msg_.amplitude_value[48]; - EXPECT_EQ(last_msg_.amplitude_value[49], 209) << "incorrect value for last_msg_.amplitude_value[49], expected 209, is " << last_msg_.amplitude_value[49]; - EXPECT_EQ(last_msg_.amplitude_value[50], 199) << "incorrect value for last_msg_.amplitude_value[50], expected 199, is " << last_msg_.amplitude_value[50]; - EXPECT_EQ(last_msg_.amplitude_value[51], 211) << "incorrect value for last_msg_.amplitude_value[51], expected 211, is " << last_msg_.amplitude_value[51]; - EXPECT_EQ(last_msg_.amplitude_value[52], 130) << "incorrect value for last_msg_.amplitude_value[52], expected 130, is " << last_msg_.amplitude_value[52]; - EXPECT_EQ(last_msg_.amplitude_value[53], 89) << "incorrect value for last_msg_.amplitude_value[53], expected 89, is " << last_msg_.amplitude_value[53]; - EXPECT_EQ(last_msg_.amplitude_value[54], 220) << "incorrect value for last_msg_.amplitude_value[54], expected 220, is " << last_msg_.amplitude_value[54]; - EXPECT_EQ(last_msg_.amplitude_value[55], 163) << "incorrect value for last_msg_.amplitude_value[55], expected 163, is " << last_msg_.amplitude_value[55]; - EXPECT_EQ(last_msg_.amplitude_value[56], 68) << "incorrect value for last_msg_.amplitude_value[56], expected 68, is " << last_msg_.amplitude_value[56]; - EXPECT_EQ(last_msg_.amplitude_value[57], 20) << "incorrect value for last_msg_.amplitude_value[57], expected 20, is " << last_msg_.amplitude_value[57]; - EXPECT_EQ(last_msg_.amplitude_value[58], 253) << "incorrect value for last_msg_.amplitude_value[58], expected 253, is " << last_msg_.amplitude_value[58]; - EXPECT_EQ(last_msg_.amplitude_value[59], 7) << "incorrect value for last_msg_.amplitude_value[59], expected 7, is " << last_msg_.amplitude_value[59]; - EXPECT_EQ(last_msg_.amplitude_value[60], 206) << "incorrect value for last_msg_.amplitude_value[60], expected 206, is " << last_msg_.amplitude_value[60]; - EXPECT_EQ(last_msg_.amplitude_value[61], 50) << "incorrect value for last_msg_.amplitude_value[61], expected 50, is " << last_msg_.amplitude_value[61]; - EXPECT_EQ(last_msg_.amplitude_value[62], 129) << "incorrect value for last_msg_.amplitude_value[62], expected 129, is " << last_msg_.amplitude_value[62]; - EXPECT_EQ(last_msg_.amplitude_value[63], 116) << "incorrect value for last_msg_.amplitude_value[63], expected 116, is " << last_msg_.amplitude_value[63]; - EXPECT_EQ(last_msg_.amplitude_value[64], 194) << "incorrect value for last_msg_.amplitude_value[64], expected 194, is " << last_msg_.amplitude_value[64]; - EXPECT_EQ(last_msg_.amplitude_value[65], 23) << "incorrect value for last_msg_.amplitude_value[65], expected 23, is " << last_msg_.amplitude_value[65]; - EXPECT_EQ(last_msg_.amplitude_value[66], 31) << "incorrect value for last_msg_.amplitude_value[66], expected 31, is " << last_msg_.amplitude_value[66]; - EXPECT_EQ(last_msg_.amplitude_value[67], 226) << "incorrect value for last_msg_.amplitude_value[67], expected 226, is " << last_msg_.amplitude_value[67]; - EXPECT_EQ(last_msg_.amplitude_value[68], 217) << "incorrect value for last_msg_.amplitude_value[68], expected 217, is " << last_msg_.amplitude_value[68]; - EXPECT_EQ(last_msg_.amplitude_value[69], 157) << "incorrect value for last_msg_.amplitude_value[69], expected 157, is " << last_msg_.amplitude_value[69]; - EXPECT_EQ(last_msg_.amplitude_value[70], 205) << "incorrect value for last_msg_.amplitude_value[70], expected 205, is " << last_msg_.amplitude_value[70]; - EXPECT_EQ(last_msg_.amplitude_value[71], 221) << "incorrect value for last_msg_.amplitude_value[71], expected 221, is " << last_msg_.amplitude_value[71]; - EXPECT_EQ(last_msg_.amplitude_value[72], 5) << "incorrect value for last_msg_.amplitude_value[72], expected 5, is " << last_msg_.amplitude_value[72]; - EXPECT_EQ(last_msg_.amplitude_value[73], 224) << "incorrect value for last_msg_.amplitude_value[73], expected 224, is " << last_msg_.amplitude_value[73]; - EXPECT_EQ(last_msg_.amplitude_value[74], 92) << "incorrect value for last_msg_.amplitude_value[74], expected 92, is " << last_msg_.amplitude_value[74]; - EXPECT_EQ(last_msg_.amplitude_value[75], 82) << "incorrect value for last_msg_.amplitude_value[75], expected 82, is " << last_msg_.amplitude_value[75]; - EXPECT_EQ(last_msg_.amplitude_value[76], 109) << "incorrect value for last_msg_.amplitude_value[76], expected 109, is " << last_msg_.amplitude_value[76]; - EXPECT_EQ(last_msg_.amplitude_value[77], 223) << "incorrect value for last_msg_.amplitude_value[77], expected 223, is " << last_msg_.amplitude_value[77]; - EXPECT_EQ(last_msg_.amplitude_value[78], 195) << "incorrect value for last_msg_.amplitude_value[78], expected 195, is " << last_msg_.amplitude_value[78]; - EXPECT_EQ(last_msg_.amplitude_value[79], 233) << "incorrect value for last_msg_.amplitude_value[79], expected 233, is " << last_msg_.amplitude_value[79]; - EXPECT_EQ(last_msg_.amplitude_value[80], 165) << "incorrect value for last_msg_.amplitude_value[80], expected 165, is " << last_msg_.amplitude_value[80]; - EXPECT_EQ(last_msg_.amplitude_value[81], 1) << "incorrect value for last_msg_.amplitude_value[81], expected 1, is " << last_msg_.amplitude_value[81]; - EXPECT_EQ(last_msg_.amplitude_value[82], 82) << "incorrect value for last_msg_.amplitude_value[82], expected 82, is " << last_msg_.amplitude_value[82]; - EXPECT_EQ(last_msg_.amplitude_value[83], 141) << "incorrect value for last_msg_.amplitude_value[83], expected 141, is " << last_msg_.amplitude_value[83]; - EXPECT_EQ(last_msg_.amplitude_value[84], 157) << "incorrect value for last_msg_.amplitude_value[84], expected 157, is " << last_msg_.amplitude_value[84]; - EXPECT_EQ(last_msg_.amplitude_value[85], 177) << "incorrect value for last_msg_.amplitude_value[85], expected 177, is " << last_msg_.amplitude_value[85]; - EXPECT_EQ(last_msg_.amplitude_value[86], 169) << "incorrect value for last_msg_.amplitude_value[86], expected 169, is " << last_msg_.amplitude_value[86]; - EXPECT_EQ(last_msg_.amplitude_value[87], 244) << "incorrect value for last_msg_.amplitude_value[87], expected 244, is " << last_msg_.amplitude_value[87]; - EXPECT_EQ(last_msg_.amplitude_value[88], 131) << "incorrect value for last_msg_.amplitude_value[88], expected 131, is " << last_msg_.amplitude_value[88]; - EXPECT_EQ(last_msg_.amplitude_value[89], 96) << "incorrect value for last_msg_.amplitude_value[89], expected 96, is " << last_msg_.amplitude_value[89]; - EXPECT_EQ(last_msg_.amplitude_value[90], 109) << "incorrect value for last_msg_.amplitude_value[90], expected 109, is " << last_msg_.amplitude_value[90]; - EXPECT_EQ(last_msg_.amplitude_value[91], 111) << "incorrect value for last_msg_.amplitude_value[91], expected 111, is " << last_msg_.amplitude_value[91]; - EXPECT_EQ(last_msg_.amplitude_value[92], 253) << "incorrect value for last_msg_.amplitude_value[92], expected 253, is " << last_msg_.amplitude_value[92]; - EXPECT_EQ(last_msg_.amplitude_value[93], 149) << "incorrect value for last_msg_.amplitude_value[93], expected 149, is " << last_msg_.amplitude_value[93]; - EXPECT_EQ(last_msg_.amplitude_value[94], 28) << "incorrect value for last_msg_.amplitude_value[94], expected 28, is " << last_msg_.amplitude_value[94]; - EXPECT_EQ(last_msg_.amplitude_value[95], 225) << "incorrect value for last_msg_.amplitude_value[95], expected 225, is " << last_msg_.amplitude_value[95]; - EXPECT_EQ(last_msg_.amplitude_value[96], 225) << "incorrect value for last_msg_.amplitude_value[96], expected 225, is " << last_msg_.amplitude_value[96]; - EXPECT_EQ(last_msg_.amplitude_value[97], 72) << "incorrect value for last_msg_.amplitude_value[97], expected 72, is " << last_msg_.amplitude_value[97]; - EXPECT_EQ(last_msg_.amplitude_value[98], 158) << "incorrect value for last_msg_.amplitude_value[98], expected 158, is " << last_msg_.amplitude_value[98]; - EXPECT_EQ(last_msg_.amplitude_value[99], 158) << "incorrect value for last_msg_.amplitude_value[99], expected 158, is " << last_msg_.amplitude_value[99]; - EXPECT_EQ(last_msg_.amplitude_value[100], 210) << "incorrect value for last_msg_.amplitude_value[100], expected 210, is " << last_msg_.amplitude_value[100]; - EXPECT_EQ(last_msg_.amplitude_value[101], 196) << "incorrect value for last_msg_.amplitude_value[101], expected 196, is " << last_msg_.amplitude_value[101]; - EXPECT_EQ(last_msg_.amplitude_value[102], 206) << "incorrect value for last_msg_.amplitude_value[102], expected 206, is " << last_msg_.amplitude_value[102]; - EXPECT_EQ(last_msg_.amplitude_value[103], 70) << "incorrect value for last_msg_.amplitude_value[103], expected 70, is " << last_msg_.amplitude_value[103]; - EXPECT_EQ(last_msg_.amplitude_value[104], 63) << "incorrect value for last_msg_.amplitude_value[104], expected 63, is " << last_msg_.amplitude_value[104]; - EXPECT_EQ(last_msg_.amplitude_value[105], 225) << "incorrect value for last_msg_.amplitude_value[105], expected 225, is " << last_msg_.amplitude_value[105]; - EXPECT_EQ(last_msg_.amplitude_value[106], 184) << "incorrect value for last_msg_.amplitude_value[106], expected 184, is " << last_msg_.amplitude_value[106]; - EXPECT_EQ(last_msg_.amplitude_value[107], 150) << "incorrect value for last_msg_.amplitude_value[107], expected 150, is " << last_msg_.amplitude_value[107]; - EXPECT_EQ(last_msg_.amplitude_value[108], 174) << "incorrect value for last_msg_.amplitude_value[108], expected 174, is " << last_msg_.amplitude_value[108]; - EXPECT_EQ(last_msg_.amplitude_value[109], 240) << "incorrect value for last_msg_.amplitude_value[109], expected 240, is " << last_msg_.amplitude_value[109]; - EXPECT_EQ(last_msg_.amplitude_value[110], 45) << "incorrect value for last_msg_.amplitude_value[110], expected 45, is " << last_msg_.amplitude_value[110]; - EXPECT_EQ(last_msg_.amplitude_value[111], 146) << "incorrect value for last_msg_.amplitude_value[111], expected 146, is " << last_msg_.amplitude_value[111]; - EXPECT_EQ(last_msg_.amplitude_value[112], 59) << "incorrect value for last_msg_.amplitude_value[112], expected 59, is " << last_msg_.amplitude_value[112]; - EXPECT_EQ(last_msg_.amplitude_value[113], 82) << "incorrect value for last_msg_.amplitude_value[113], expected 82, is " << last_msg_.amplitude_value[113]; - EXPECT_EQ(last_msg_.amplitude_value[114], 194) << "incorrect value for last_msg_.amplitude_value[114], expected 194, is " << last_msg_.amplitude_value[114]; - EXPECT_EQ(last_msg_.amplitude_value[115], 4) << "incorrect value for last_msg_.amplitude_value[115], expected 4, is " << last_msg_.amplitude_value[115]; - EXPECT_EQ(last_msg_.amplitude_value[116], 179) << "incorrect value for last_msg_.amplitude_value[116], expected 179, is " << last_msg_.amplitude_value[116]; - EXPECT_EQ(last_msg_.amplitude_value[117], 148) << "incorrect value for last_msg_.amplitude_value[117], expected 148, is " << last_msg_.amplitude_value[117]; - EXPECT_EQ(last_msg_.amplitude_value[118], 66) << "incorrect value for last_msg_.amplitude_value[118], expected 66, is " << last_msg_.amplitude_value[118]; - EXPECT_EQ(last_msg_.amplitude_value[119], 254) << "incorrect value for last_msg_.amplitude_value[119], expected 254, is " << last_msg_.amplitude_value[119]; - EXPECT_EQ(last_msg_.amplitude_value[120], 115) << "incorrect value for last_msg_.amplitude_value[120], expected 115, is " << last_msg_.amplitude_value[120]; - EXPECT_EQ(last_msg_.amplitude_value[121], 77) << "incorrect value for last_msg_.amplitude_value[121], expected 77, is " << last_msg_.amplitude_value[121]; - EXPECT_EQ(last_msg_.amplitude_value[122], 30) << "incorrect value for last_msg_.amplitude_value[122], expected 30, is " << last_msg_.amplitude_value[122]; - EXPECT_EQ(last_msg_.amplitude_value[123], 46) << "incorrect value for last_msg_.amplitude_value[123], expected 46, is " << last_msg_.amplitude_value[123]; - EXPECT_EQ(last_msg_.amplitude_value[124], 4) << "incorrect value for last_msg_.amplitude_value[124], expected 4, is " << last_msg_.amplitude_value[124]; - EXPECT_EQ(last_msg_.amplitude_value[125], 204) << "incorrect value for last_msg_.amplitude_value[125], expected 204, is " << last_msg_.amplitude_value[125]; - EXPECT_EQ(last_msg_.amplitude_value[126], 37) << "incorrect value for last_msg_.amplitude_value[126], expected 37, is " << last_msg_.amplitude_value[126]; - EXPECT_EQ(last_msg_.amplitude_value[127], 200) << "incorrect value for last_msg_.amplitude_value[127], expected 200, is " << last_msg_.amplitude_value[127]; - EXPECT_EQ(last_msg_.amplitude_value[128], 121) << "incorrect value for last_msg_.amplitude_value[128], expected 121, is " << last_msg_.amplitude_value[128]; - EXPECT_EQ(last_msg_.amplitude_value[129], 18) << "incorrect value for last_msg_.amplitude_value[129], expected 18, is " << last_msg_.amplitude_value[129]; - EXPECT_EQ(last_msg_.amplitude_value[130], 17) << "incorrect value for last_msg_.amplitude_value[130], expected 17, is " << last_msg_.amplitude_value[130]; - EXPECT_EQ(last_msg_.amplitude_value[131], 171) << "incorrect value for last_msg_.amplitude_value[131], expected 171, is " << last_msg_.amplitude_value[131]; - EXPECT_EQ(last_msg_.amplitude_value[132], 102) << "incorrect value for last_msg_.amplitude_value[132], expected 102, is " << last_msg_.amplitude_value[132]; - EXPECT_EQ(last_msg_.amplitude_value[133], 163) << "incorrect value for last_msg_.amplitude_value[133], expected 163, is " << last_msg_.amplitude_value[133]; - EXPECT_EQ(last_msg_.amplitude_value[134], 175) << "incorrect value for last_msg_.amplitude_value[134], expected 175, is " << last_msg_.amplitude_value[134]; - EXPECT_EQ(last_msg_.amplitude_value[135], 50) << "incorrect value for last_msg_.amplitude_value[135], expected 50, is " << last_msg_.amplitude_value[135]; - EXPECT_EQ(last_msg_.amplitude_value[136], 66) << "incorrect value for last_msg_.amplitude_value[136], expected 66, is " << last_msg_.amplitude_value[136]; - EXPECT_EQ(last_msg_.amplitude_value[137], 101) << "incorrect value for last_msg_.amplitude_value[137], expected 101, is " << last_msg_.amplitude_value[137]; - EXPECT_EQ(last_msg_.amplitude_value[138], 69) << "incorrect value for last_msg_.amplitude_value[138], expected 69, is " << last_msg_.amplitude_value[138]; - EXPECT_EQ(last_msg_.amplitude_value[139], 13) << "incorrect value for last_msg_.amplitude_value[139], expected 13, is " << last_msg_.amplitude_value[139]; - EXPECT_EQ(last_msg_.amplitude_value[140], 223) << "incorrect value for last_msg_.amplitude_value[140], expected 223, is " << last_msg_.amplitude_value[140]; - EXPECT_EQ(last_msg_.amplitude_value[141], 172) << "incorrect value for last_msg_.amplitude_value[141], expected 172, is " << last_msg_.amplitude_value[141]; - EXPECT_EQ(last_msg_.amplitude_value[142], 160) << "incorrect value for last_msg_.amplitude_value[142], expected 160, is " << last_msg_.amplitude_value[142]; - EXPECT_EQ(last_msg_.amplitude_value[143], 233) << "incorrect value for last_msg_.amplitude_value[143], expected 233, is " << last_msg_.amplitude_value[143]; - EXPECT_EQ(last_msg_.amplitude_value[144], 220) << "incorrect value for last_msg_.amplitude_value[144], expected 220, is " << last_msg_.amplitude_value[144]; - EXPECT_EQ(last_msg_.amplitude_value[145], 101) << "incorrect value for last_msg_.amplitude_value[145], expected 101, is " << last_msg_.amplitude_value[145]; - EXPECT_EQ(last_msg_.amplitude_value[146], 237) << "incorrect value for last_msg_.amplitude_value[146], expected 237, is " << last_msg_.amplitude_value[146]; - EXPECT_EQ(last_msg_.amplitude_value[147], 156) << "incorrect value for last_msg_.amplitude_value[147], expected 156, is " << last_msg_.amplitude_value[147]; - EXPECT_EQ(last_msg_.amplitude_value[148], 62) << "incorrect value for last_msg_.amplitude_value[148], expected 62, is " << last_msg_.amplitude_value[148]; - EXPECT_EQ(last_msg_.amplitude_value[149], 117) << "incorrect value for last_msg_.amplitude_value[149], expected 117, is " << last_msg_.amplitude_value[149]; - EXPECT_EQ(last_msg_.amplitude_value[150], 47) << "incorrect value for last_msg_.amplitude_value[150], expected 47, is " << last_msg_.amplitude_value[150]; - EXPECT_EQ(last_msg_.amplitude_value[151], 143) << "incorrect value for last_msg_.amplitude_value[151], expected 143, is " << last_msg_.amplitude_value[151]; - EXPECT_EQ(last_msg_.amplitude_value[152], 94) << "incorrect value for last_msg_.amplitude_value[152], expected 94, is " << last_msg_.amplitude_value[152]; - EXPECT_EQ(last_msg_.amplitude_value[153], 135) << "incorrect value for last_msg_.amplitude_value[153], expected 135, is " << last_msg_.amplitude_value[153]; - EXPECT_EQ(last_msg_.amplitude_value[154], 22) << "incorrect value for last_msg_.amplitude_value[154], expected 22, is " << last_msg_.amplitude_value[154]; - EXPECT_EQ(last_msg_.amplitude_value[155], 155) << "incorrect value for last_msg_.amplitude_value[155], expected 155, is " << last_msg_.amplitude_value[155]; - EXPECT_EQ(last_msg_.amplitude_value[156], 113) << "incorrect value for last_msg_.amplitude_value[156], expected 113, is " << last_msg_.amplitude_value[156]; - EXPECT_EQ(last_msg_.amplitude_value[157], 110) << "incorrect value for last_msg_.amplitude_value[157], expected 110, is " << last_msg_.amplitude_value[157]; - EXPECT_EQ(last_msg_.amplitude_value[158], 15) << "incorrect value for last_msg_.amplitude_value[158], expected 15, is " << last_msg_.amplitude_value[158]; - EXPECT_EQ(last_msg_.amplitude_value[159], 243) << "incorrect value for last_msg_.amplitude_value[159], expected 243, is " << last_msg_.amplitude_value[159]; - EXPECT_EQ(last_msg_.amplitude_value[160], 141) << "incorrect value for last_msg_.amplitude_value[160], expected 141, is " << last_msg_.amplitude_value[160]; - EXPECT_EQ(last_msg_.amplitude_value[161], 227) << "incorrect value for last_msg_.amplitude_value[161], expected 227, is " << last_msg_.amplitude_value[161]; - EXPECT_EQ(last_msg_.amplitude_value[162], 46) << "incorrect value for last_msg_.amplitude_value[162], expected 46, is " << last_msg_.amplitude_value[162]; - EXPECT_EQ(last_msg_.amplitude_value[163], 143) << "incorrect value for last_msg_.amplitude_value[163], expected 143, is " << last_msg_.amplitude_value[163]; - EXPECT_EQ(last_msg_.amplitude_value[164], 227) << "incorrect value for last_msg_.amplitude_value[164], expected 227, is " << last_msg_.amplitude_value[164]; - EXPECT_EQ(last_msg_.amplitude_value[165], 209) << "incorrect value for last_msg_.amplitude_value[165], expected 209, is " << last_msg_.amplitude_value[165]; - EXPECT_EQ(last_msg_.amplitude_value[166], 249) << "incorrect value for last_msg_.amplitude_value[166], expected 249, is " << last_msg_.amplitude_value[166]; - EXPECT_EQ(last_msg_.amplitude_value[167], 2) << "incorrect value for last_msg_.amplitude_value[167], expected 2, is " << last_msg_.amplitude_value[167]; - EXPECT_EQ(last_msg_.amplitude_value[168], 153) << "incorrect value for last_msg_.amplitude_value[168], expected 153, is " << last_msg_.amplitude_value[168]; - EXPECT_EQ(last_msg_.amplitude_value[169], 168) << "incorrect value for last_msg_.amplitude_value[169], expected 168, is " << last_msg_.amplitude_value[169]; - EXPECT_EQ(last_msg_.amplitude_value[170], 131) << "incorrect value for last_msg_.amplitude_value[170], expected 131, is " << last_msg_.amplitude_value[170]; - EXPECT_EQ(last_msg_.amplitude_value[171], 249) << "incorrect value for last_msg_.amplitude_value[171], expected 249, is " << last_msg_.amplitude_value[171]; - EXPECT_EQ(last_msg_.amplitude_value[172], 160) << "incorrect value for last_msg_.amplitude_value[172], expected 160, is " << last_msg_.amplitude_value[172]; - EXPECT_EQ(last_msg_.amplitude_value[173], 88) << "incorrect value for last_msg_.amplitude_value[173], expected 88, is " << last_msg_.amplitude_value[173]; - EXPECT_EQ(last_msg_.amplitude_value[174], 38) << "incorrect value for last_msg_.amplitude_value[174], expected 38, is " << last_msg_.amplitude_value[174]; - EXPECT_EQ(last_msg_.amplitude_value[175], 117) << "incorrect value for last_msg_.amplitude_value[175], expected 117, is " << last_msg_.amplitude_value[175]; - EXPECT_EQ(last_msg_.amplitude_value[176], 129) << "incorrect value for last_msg_.amplitude_value[176], expected 129, is " << last_msg_.amplitude_value[176]; - EXPECT_EQ(last_msg_.amplitude_value[177], 57) << "incorrect value for last_msg_.amplitude_value[177], expected 57, is " << last_msg_.amplitude_value[177]; - EXPECT_EQ(last_msg_.amplitude_value[178], 40) << "incorrect value for last_msg_.amplitude_value[178], expected 40, is " << last_msg_.amplitude_value[178]; - EXPECT_EQ(last_msg_.amplitude_value[179], 109) << "incorrect value for last_msg_.amplitude_value[179], expected 109, is " << last_msg_.amplitude_value[179]; - EXPECT_EQ(last_msg_.amplitude_value[180], 209) << "incorrect value for last_msg_.amplitude_value[180], expected 209, is " << last_msg_.amplitude_value[180]; - EXPECT_EQ(last_msg_.amplitude_value[181], 177) << "incorrect value for last_msg_.amplitude_value[181], expected 177, is " << last_msg_.amplitude_value[181]; - EXPECT_EQ(last_msg_.amplitude_value[182], 38) << "incorrect value for last_msg_.amplitude_value[182], expected 38, is " << last_msg_.amplitude_value[182]; - EXPECT_EQ(last_msg_.amplitude_value[183], 47) << "incorrect value for last_msg_.amplitude_value[183], expected 47, is " << last_msg_.amplitude_value[183]; - EXPECT_EQ(last_msg_.amplitude_value[184], 12) << "incorrect value for last_msg_.amplitude_value[184], expected 12, is " << last_msg_.amplitude_value[184]; - EXPECT_EQ(last_msg_.amplitude_value[185], 15) << "incorrect value for last_msg_.amplitude_value[185], expected 15, is " << last_msg_.amplitude_value[185]; - EXPECT_EQ(last_msg_.amplitude_value[186], 16) << "incorrect value for last_msg_.amplitude_value[186], expected 16, is " << last_msg_.amplitude_value[186]; - EXPECT_EQ(last_msg_.amplitude_value[187], 9) << "incorrect value for last_msg_.amplitude_value[187], expected 9, is " << last_msg_.amplitude_value[187]; - EXPECT_EQ(last_msg_.amplitude_value[188], 175) << "incorrect value for last_msg_.amplitude_value[188], expected 175, is " << last_msg_.amplitude_value[188]; - EXPECT_EQ(last_msg_.amplitude_value[189], 69) << "incorrect value for last_msg_.amplitude_value[189], expected 69, is " << last_msg_.amplitude_value[189]; - EXPECT_EQ(last_msg_.amplitude_value[190], 70) << "incorrect value for last_msg_.amplitude_value[190], expected 70, is " << last_msg_.amplitude_value[190]; - EXPECT_EQ(last_msg_.amplitude_value[191], 182) << "incorrect value for last_msg_.amplitude_value[191], expected 182, is " << last_msg_.amplitude_value[191]; - EXPECT_EQ(last_msg_.amplitude_value[192], 239) << "incorrect value for last_msg_.amplitude_value[192], expected 239, is " << last_msg_.amplitude_value[192]; - EXPECT_EQ(last_msg_.amplitude_value[193], 117) << "incorrect value for last_msg_.amplitude_value[193], expected 117, is " << last_msg_.amplitude_value[193]; - EXPECT_EQ(last_msg_.amplitude_value[194], 135) << "incorrect value for last_msg_.amplitude_value[194], expected 135, is " << last_msg_.amplitude_value[194]; - EXPECT_EQ(last_msg_.amplitude_value[195], 6) << "incorrect value for last_msg_.amplitude_value[195], expected 6, is " << last_msg_.amplitude_value[195]; - EXPECT_EQ(last_msg_.amplitude_value[196], 71) << "incorrect value for last_msg_.amplitude_value[196], expected 71, is " << last_msg_.amplitude_value[196]; - EXPECT_EQ(last_msg_.amplitude_value[197], 99) << "incorrect value for last_msg_.amplitude_value[197], expected 99, is " << last_msg_.amplitude_value[197]; - EXPECT_EQ(last_msg_.amplitude_value[198], 230) << "incorrect value for last_msg_.amplitude_value[198], expected 230, is " << last_msg_.amplitude_value[198]; - EXPECT_EQ(last_msg_.amplitude_value[199], 115) << "incorrect value for last_msg_.amplitude_value[199], expected 115, is " << last_msg_.amplitude_value[199]; - EXPECT_EQ(last_msg_.amplitude_value[200], 2) << "incorrect value for last_msg_.amplitude_value[200], expected 2, is " << last_msg_.amplitude_value[200]; - EXPECT_EQ(last_msg_.amplitude_value[201], 71) << "incorrect value for last_msg_.amplitude_value[201], expected 71, is " << last_msg_.amplitude_value[201]; - EXPECT_EQ(last_msg_.amplitude_value[202], 165) << "incorrect value for last_msg_.amplitude_value[202], expected 165, is " << last_msg_.amplitude_value[202]; - EXPECT_EQ(last_msg_.amplitude_value[203], 228) << "incorrect value for last_msg_.amplitude_value[203], expected 228, is " << last_msg_.amplitude_value[203]; - EXPECT_EQ(last_msg_.amplitude_value[204], 123) << "incorrect value for last_msg_.amplitude_value[204], expected 123, is " << last_msg_.amplitude_value[204]; - EXPECT_EQ(last_msg_.amplitude_value[205], 210) << "incorrect value for last_msg_.amplitude_value[205], expected 210, is " << last_msg_.amplitude_value[205]; - EXPECT_EQ(last_msg_.amplitude_value[206], 168) << "incorrect value for last_msg_.amplitude_value[206], expected 168, is " << last_msg_.amplitude_value[206]; - EXPECT_EQ(last_msg_.amplitude_value[207], 90) << "incorrect value for last_msg_.amplitude_value[207], expected 90, is " << last_msg_.amplitude_value[207]; - EXPECT_EQ(last_msg_.amplitude_value[208], 124) << "incorrect value for last_msg_.amplitude_value[208], expected 124, is " << last_msg_.amplitude_value[208]; - EXPECT_EQ(last_msg_.amplitude_value[209], 20) << "incorrect value for last_msg_.amplitude_value[209], expected 20, is " << last_msg_.amplitude_value[209]; - EXPECT_EQ(last_msg_.amplitude_value[210], 7) << "incorrect value for last_msg_.amplitude_value[210], expected 7, is " << last_msg_.amplitude_value[210]; - EXPECT_EQ(last_msg_.amplitude_value[211], 220) << "incorrect value for last_msg_.amplitude_value[211], expected 220, is " << last_msg_.amplitude_value[211]; - EXPECT_EQ(last_msg_.amplitude_value[212], 144) << "incorrect value for last_msg_.amplitude_value[212], expected 144, is " << last_msg_.amplitude_value[212]; - EXPECT_EQ(last_msg_.amplitude_value[213], 168) << "incorrect value for last_msg_.amplitude_value[213], expected 168, is " << last_msg_.amplitude_value[213]; - EXPECT_EQ(last_msg_.amplitude_value[214], 69) << "incorrect value for last_msg_.amplitude_value[214], expected 69, is " << last_msg_.amplitude_value[214]; - EXPECT_EQ(last_msg_.amplitude_value[215], 22) << "incorrect value for last_msg_.amplitude_value[215], expected 22, is " << last_msg_.amplitude_value[215]; - EXPECT_EQ(last_msg_.amplitude_value[216], 72) << "incorrect value for last_msg_.amplitude_value[216], expected 72, is " << last_msg_.amplitude_value[216]; - EXPECT_EQ(last_msg_.amplitude_value[217], 162) << "incorrect value for last_msg_.amplitude_value[217], expected 162, is " << last_msg_.amplitude_value[217]; - EXPECT_EQ(last_msg_.amplitude_value[218], 69) << "incorrect value for last_msg_.amplitude_value[218], expected 69, is " << last_msg_.amplitude_value[218]; - EXPECT_EQ(last_msg_.amplitude_value[219], 111) << "incorrect value for last_msg_.amplitude_value[219], expected 111, is " << last_msg_.amplitude_value[219]; - EXPECT_EQ(last_msg_.amplitude_value[220], 91) << "incorrect value for last_msg_.amplitude_value[220], expected 91, is " << last_msg_.amplitude_value[220]; - EXPECT_EQ(last_msg_.amplitude_value[221], 251) << "incorrect value for last_msg_.amplitude_value[221], expected 251, is " << last_msg_.amplitude_value[221]; - EXPECT_EQ(last_msg_.amplitude_value[222], 72) << "incorrect value for last_msg_.amplitude_value[222], expected 72, is " << last_msg_.amplitude_value[222]; - EXPECT_EQ(last_msg_.amplitude_value[223], 220) << "incorrect value for last_msg_.amplitude_value[223], expected 220, is " << last_msg_.amplitude_value[223]; - EXPECT_EQ(last_msg_.amplitude_value[224], 28) << "incorrect value for last_msg_.amplitude_value[224], expected 28, is " << last_msg_.amplitude_value[224]; - EXPECT_EQ(last_msg_.amplitude_value[225], 119) << "incorrect value for last_msg_.amplitude_value[225], expected 119, is " << last_msg_.amplitude_value[225]; - EXPECT_EQ(last_msg_.amplitude_value[226], 150) << "incorrect value for last_msg_.amplitude_value[226], expected 150, is " << last_msg_.amplitude_value[226]; - EXPECT_EQ(last_msg_.channel_tag, 35146) << "incorrect value for last_msg_.channel_tag, expected 35146, is " << last_msg_.channel_tag; - EXPECT_LT((last_msg_.freq_ref * 100 - 7737.20019531 * 100), 0.05) << "incorrect value for last_msg_.freq_ref, expected 7737.20019531, is " << last_msg_.freq_ref; - EXPECT_LT((last_msg_.freq_step * 100 - 8226.20019531 * 100), 0.05) << "incorrect value for last_msg_.freq_step, expected 8226.20019531, is " << last_msg_.freq_step; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_amplitude_value.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_amplitude_value.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_amplitude_value.handle_as << "'"; - } - { - const char check_string[] = { (char)97,(char)109,(char)112,(char)108,(char)105,(char)116,(char)117,(char)100,(char)101,(char)95,(char)118,(char)97,(char)108,(char)117,(char)101 }; - EXPECT_EQ(memcmp(last_msg_.n_amplitude_value.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_amplitude_value.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_amplitude_value.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_amplitude_value.value, 227) << "incorrect value for last_msg_.n_amplitude_value.value, expected 227, is " << last_msg_.n_amplitude_value.value; - EXPECT_EQ(last_msg_.t.ns_residual, -1479025396) << "incorrect value for last_msg_.t.ns_residual, expected -1479025396, is " << last_msg_.t.ns_residual; - EXPECT_EQ(last_msg_.t.tow, 1227027783) << "incorrect value for last_msg_.t.tow, expected 1227027783, is " << last_msg_.t.tow; - EXPECT_EQ(last_msg_.t.wn, 5075) << "incorrect value for last_msg_.t.wn, expected 5075, is " << last_msg_.t.wn; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgSpecan0, Test) { + uint8_t encoded_frame[] = { + 85, 81, 0, 28, 212, 255, 74, 137, 71, 245, 34, 73, 12, 221, 215, + 167, 211, 19, 154, 201, 241, 69, 205, 136, 0, 70, 51, 67, 108, 69, + 102, 38, 166, 68, 100, 179, 185, 17, 175, 49, 193, 228, 228, 47, 33, + 24, 141, 177, 18, 99, 246, 121, 61, 40, 91, 145, 223, 167, 174, 9, + 116, 11, 247, 84, 49, 153, 205, 2, 230, 194, 218, 241, 101, 107, 45, + 137, 93, 114, 230, 43, 224, 23, 74, 209, 199, 211, 130, 89, 220, 163, + 68, 20, 253, 7, 206, 50, 129, 116, 194, 23, 31, 226, 217, 157, 205, + 221, 5, 224, 92, 82, 109, 223, 195, 233, 165, 1, 82, 141, 157, 177, + 169, 244, 131, 96, 109, 111, 253, 149, 28, 225, 225, 72, 158, 158, 210, + 196, 206, 70, 63, 225, 184, 150, 174, 240, 45, 146, 59, 82, 194, 4, + 179, 148, 66, 254, 115, 77, 30, 46, 4, 204, 37, 200, 121, 18, 17, + 171, 102, 163, 175, 50, 66, 101, 69, 13, 223, 172, 160, 233, 220, 101, + 237, 156, 62, 117, 47, 143, 94, 135, 22, 155, 113, 110, 15, 243, 141, + 227, 46, 143, 227, 209, 249, 2, 153, 168, 131, 249, 160, 88, 38, 117, + 129, 57, 40, 109, 209, 177, 38, 47, 12, 15, 16, 9, 175, 69, 70, + 182, 239, 117, 135, 6, 71, 99, 230, 115, 2, 71, 165, 228, 123, 210, + 168, 90, 124, 20, 7, 220, 144, 168, 69, 22, 72, 162, 69, 111, 91, + 251, 72, 220, 28, 119, 150, 95, 2, + }; + + sbp_msg_specan_t test_msg{}; + test_msg.amplitude_ref = 3780.199951171875; + test_msg.amplitude_unit = 1329.199951171875; + + test_msg.amplitude_value[0] = 100; + + test_msg.amplitude_value[1] = 179; + + test_msg.amplitude_value[2] = 185; + + test_msg.amplitude_value[3] = 17; + + test_msg.amplitude_value[4] = 175; + + test_msg.amplitude_value[5] = 49; + + test_msg.amplitude_value[6] = 193; + + test_msg.amplitude_value[7] = 228; + + test_msg.amplitude_value[8] = 228; + + test_msg.amplitude_value[9] = 47; + + test_msg.amplitude_value[10] = 33; + + test_msg.amplitude_value[11] = 24; + + test_msg.amplitude_value[12] = 141; + + test_msg.amplitude_value[13] = 177; + + test_msg.amplitude_value[14] = 18; + + test_msg.amplitude_value[15] = 99; + + test_msg.amplitude_value[16] = 246; + + test_msg.amplitude_value[17] = 121; + + test_msg.amplitude_value[18] = 61; + + test_msg.amplitude_value[19] = 40; + + test_msg.amplitude_value[20] = 91; + + test_msg.amplitude_value[21] = 145; + + test_msg.amplitude_value[22] = 223; + + test_msg.amplitude_value[23] = 167; + + test_msg.amplitude_value[24] = 174; + + test_msg.amplitude_value[25] = 9; + + test_msg.amplitude_value[26] = 116; + + test_msg.amplitude_value[27] = 11; + + test_msg.amplitude_value[28] = 247; + + test_msg.amplitude_value[29] = 84; + + test_msg.amplitude_value[30] = 49; + + test_msg.amplitude_value[31] = 153; + + test_msg.amplitude_value[32] = 205; + + test_msg.amplitude_value[33] = 2; + + test_msg.amplitude_value[34] = 230; + + test_msg.amplitude_value[35] = 194; + + test_msg.amplitude_value[36] = 218; + + test_msg.amplitude_value[37] = 241; + + test_msg.amplitude_value[38] = 101; + + test_msg.amplitude_value[39] = 107; + + test_msg.amplitude_value[40] = 45; + + test_msg.amplitude_value[41] = 137; + + test_msg.amplitude_value[42] = 93; + + test_msg.amplitude_value[43] = 114; + + test_msg.amplitude_value[44] = 230; + + test_msg.amplitude_value[45] = 43; + + test_msg.amplitude_value[46] = 224; + + test_msg.amplitude_value[47] = 23; + + test_msg.amplitude_value[48] = 74; + + test_msg.amplitude_value[49] = 209; + + test_msg.amplitude_value[50] = 199; + + test_msg.amplitude_value[51] = 211; + + test_msg.amplitude_value[52] = 130; + + test_msg.amplitude_value[53] = 89; + + test_msg.amplitude_value[54] = 220; + + test_msg.amplitude_value[55] = 163; + + test_msg.amplitude_value[56] = 68; + + test_msg.amplitude_value[57] = 20; + + test_msg.amplitude_value[58] = 253; + + test_msg.amplitude_value[59] = 7; + + test_msg.amplitude_value[60] = 206; + + test_msg.amplitude_value[61] = 50; + + test_msg.amplitude_value[62] = 129; + + test_msg.amplitude_value[63] = 116; + + test_msg.amplitude_value[64] = 194; + + test_msg.amplitude_value[65] = 23; + + test_msg.amplitude_value[66] = 31; + + test_msg.amplitude_value[67] = 226; + + test_msg.amplitude_value[68] = 217; + + test_msg.amplitude_value[69] = 157; + + test_msg.amplitude_value[70] = 205; + + test_msg.amplitude_value[71] = 221; + + test_msg.amplitude_value[72] = 5; + + test_msg.amplitude_value[73] = 224; + + test_msg.amplitude_value[74] = 92; + + test_msg.amplitude_value[75] = 82; + + test_msg.amplitude_value[76] = 109; + + test_msg.amplitude_value[77] = 223; + + test_msg.amplitude_value[78] = 195; + + test_msg.amplitude_value[79] = 233; + + test_msg.amplitude_value[80] = 165; + + test_msg.amplitude_value[81] = 1; + + test_msg.amplitude_value[82] = 82; + + test_msg.amplitude_value[83] = 141; + + test_msg.amplitude_value[84] = 157; + + test_msg.amplitude_value[85] = 177; + + test_msg.amplitude_value[86] = 169; + + test_msg.amplitude_value[87] = 244; + + test_msg.amplitude_value[88] = 131; + + test_msg.amplitude_value[89] = 96; + + test_msg.amplitude_value[90] = 109; + + test_msg.amplitude_value[91] = 111; + + test_msg.amplitude_value[92] = 253; + + test_msg.amplitude_value[93] = 149; + + test_msg.amplitude_value[94] = 28; + + test_msg.amplitude_value[95] = 225; + + test_msg.amplitude_value[96] = 225; + + test_msg.amplitude_value[97] = 72; + + test_msg.amplitude_value[98] = 158; + + test_msg.amplitude_value[99] = 158; + + test_msg.amplitude_value[100] = 210; + + test_msg.amplitude_value[101] = 196; + + test_msg.amplitude_value[102] = 206; + + test_msg.amplitude_value[103] = 70; + + test_msg.amplitude_value[104] = 63; + + test_msg.amplitude_value[105] = 225; + + test_msg.amplitude_value[106] = 184; + + test_msg.amplitude_value[107] = 150; + + test_msg.amplitude_value[108] = 174; + + test_msg.amplitude_value[109] = 240; + + test_msg.amplitude_value[110] = 45; + + test_msg.amplitude_value[111] = 146; + + test_msg.amplitude_value[112] = 59; + + test_msg.amplitude_value[113] = 82; + + test_msg.amplitude_value[114] = 194; + + test_msg.amplitude_value[115] = 4; + + test_msg.amplitude_value[116] = 179; + + test_msg.amplitude_value[117] = 148; + + test_msg.amplitude_value[118] = 66; + + test_msg.amplitude_value[119] = 254; + + test_msg.amplitude_value[120] = 115; + + test_msg.amplitude_value[121] = 77; + + test_msg.amplitude_value[122] = 30; + + test_msg.amplitude_value[123] = 46; + + test_msg.amplitude_value[124] = 4; + + test_msg.amplitude_value[125] = 204; + + test_msg.amplitude_value[126] = 37; + + test_msg.amplitude_value[127] = 200; + + test_msg.amplitude_value[128] = 121; + + test_msg.amplitude_value[129] = 18; + + test_msg.amplitude_value[130] = 17; + + test_msg.amplitude_value[131] = 171; + + test_msg.amplitude_value[132] = 102; + + test_msg.amplitude_value[133] = 163; + + test_msg.amplitude_value[134] = 175; + + test_msg.amplitude_value[135] = 50; + + test_msg.amplitude_value[136] = 66; + + test_msg.amplitude_value[137] = 101; + + test_msg.amplitude_value[138] = 69; + + test_msg.amplitude_value[139] = 13; + + test_msg.amplitude_value[140] = 223; + + test_msg.amplitude_value[141] = 172; + + test_msg.amplitude_value[142] = 160; + + test_msg.amplitude_value[143] = 233; + + test_msg.amplitude_value[144] = 220; + + test_msg.amplitude_value[145] = 101; + + test_msg.amplitude_value[146] = 237; + + test_msg.amplitude_value[147] = 156; + + test_msg.amplitude_value[148] = 62; + + test_msg.amplitude_value[149] = 117; + + test_msg.amplitude_value[150] = 47; + + test_msg.amplitude_value[151] = 143; + + test_msg.amplitude_value[152] = 94; + + test_msg.amplitude_value[153] = 135; + + test_msg.amplitude_value[154] = 22; + + test_msg.amplitude_value[155] = 155; + + test_msg.amplitude_value[156] = 113; + + test_msg.amplitude_value[157] = 110; + + test_msg.amplitude_value[158] = 15; + + test_msg.amplitude_value[159] = 243; + + test_msg.amplitude_value[160] = 141; + + test_msg.amplitude_value[161] = 227; + + test_msg.amplitude_value[162] = 46; + + test_msg.amplitude_value[163] = 143; + + test_msg.amplitude_value[164] = 227; + + test_msg.amplitude_value[165] = 209; + + test_msg.amplitude_value[166] = 249; + + test_msg.amplitude_value[167] = 2; + + test_msg.amplitude_value[168] = 153; + + test_msg.amplitude_value[169] = 168; + + test_msg.amplitude_value[170] = 131; + + test_msg.amplitude_value[171] = 249; + + test_msg.amplitude_value[172] = 160; + + test_msg.amplitude_value[173] = 88; + + test_msg.amplitude_value[174] = 38; + + test_msg.amplitude_value[175] = 117; + + test_msg.amplitude_value[176] = 129; + + test_msg.amplitude_value[177] = 57; + + test_msg.amplitude_value[178] = 40; + + test_msg.amplitude_value[179] = 109; + + test_msg.amplitude_value[180] = 209; + + test_msg.amplitude_value[181] = 177; + + test_msg.amplitude_value[182] = 38; + + test_msg.amplitude_value[183] = 47; + + test_msg.amplitude_value[184] = 12; + + test_msg.amplitude_value[185] = 15; + + test_msg.amplitude_value[186] = 16; + + test_msg.amplitude_value[187] = 9; + + test_msg.amplitude_value[188] = 175; + + test_msg.amplitude_value[189] = 69; + + test_msg.amplitude_value[190] = 70; + + test_msg.amplitude_value[191] = 182; + + test_msg.amplitude_value[192] = 239; + + test_msg.amplitude_value[193] = 117; + + test_msg.amplitude_value[194] = 135; + + test_msg.amplitude_value[195] = 6; + + test_msg.amplitude_value[196] = 71; + + test_msg.amplitude_value[197] = 99; + + test_msg.amplitude_value[198] = 230; + + test_msg.amplitude_value[199] = 115; + + test_msg.amplitude_value[200] = 2; + + test_msg.amplitude_value[201] = 71; + + test_msg.amplitude_value[202] = 165; + + test_msg.amplitude_value[203] = 228; + + test_msg.amplitude_value[204] = 123; + + test_msg.amplitude_value[205] = 210; + + test_msg.amplitude_value[206] = 168; + + test_msg.amplitude_value[207] = 90; + + test_msg.amplitude_value[208] = 124; + + test_msg.amplitude_value[209] = 20; + + test_msg.amplitude_value[210] = 7; + + test_msg.amplitude_value[211] = 220; + + test_msg.amplitude_value[212] = 144; + + test_msg.amplitude_value[213] = 168; + + test_msg.amplitude_value[214] = 69; + + test_msg.amplitude_value[215] = 22; + + test_msg.amplitude_value[216] = 72; + + test_msg.amplitude_value[217] = 162; + + test_msg.amplitude_value[218] = 69; + + test_msg.amplitude_value[219] = 111; + + test_msg.amplitude_value[220] = 91; + + test_msg.amplitude_value[221] = 251; + + test_msg.amplitude_value[222] = 72; + + test_msg.amplitude_value[223] = 220; + + test_msg.amplitude_value[224] = 28; + + test_msg.amplitude_value[225] = 119; + + test_msg.amplitude_value[226] = 150; + test_msg.channel_tag = 35146; + test_msg.freq_ref = 7737.2001953125; + test_msg.freq_step = 8226.2001953125; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_amplitude_value.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)97, (char)109, (char)112, (char)108, + (char)105, (char)116, (char)117, (char)100, + (char)101, (char)95, (char)118, (char)97, + (char)108, (char)117, (char)101}; + memcpy(test_msg.n_amplitude_value.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_amplitude_value.value = 227; + test_msg.t.ns_residual = -1479025396; + test_msg.t.tow = 1227027783; + test_msg.t.wn = 5075; + + EXPECT_EQ(send_message(54300, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 54300); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.amplitude_ref * 100 - 3780.19995117 * 100), 0.05) + << "incorrect value for last_msg_.amplitude_ref, expected 3780.19995117, " + "is " + << last_msg_.amplitude_ref; + EXPECT_LT((last_msg_.amplitude_unit * 100 - 1329.19995117 * 100), 0.05) + << "incorrect value for last_msg_.amplitude_unit, expected " + "1329.19995117, is " + << last_msg_.amplitude_unit; + EXPECT_EQ(last_msg_.amplitude_value[0], 100) + << "incorrect value for last_msg_.amplitude_value[0], expected 100, is " + << last_msg_.amplitude_value[0]; + EXPECT_EQ(last_msg_.amplitude_value[1], 179) + << "incorrect value for last_msg_.amplitude_value[1], expected 179, is " + << last_msg_.amplitude_value[1]; + EXPECT_EQ(last_msg_.amplitude_value[2], 185) + << "incorrect value for last_msg_.amplitude_value[2], expected 185, is " + << last_msg_.amplitude_value[2]; + EXPECT_EQ(last_msg_.amplitude_value[3], 17) + << "incorrect value for last_msg_.amplitude_value[3], expected 17, is " + << last_msg_.amplitude_value[3]; + EXPECT_EQ(last_msg_.amplitude_value[4], 175) + << "incorrect value for last_msg_.amplitude_value[4], expected 175, is " + << last_msg_.amplitude_value[4]; + EXPECT_EQ(last_msg_.amplitude_value[5], 49) + << "incorrect value for last_msg_.amplitude_value[5], expected 49, is " + << last_msg_.amplitude_value[5]; + EXPECT_EQ(last_msg_.amplitude_value[6], 193) + << "incorrect value for last_msg_.amplitude_value[6], expected 193, is " + << last_msg_.amplitude_value[6]; + EXPECT_EQ(last_msg_.amplitude_value[7], 228) + << "incorrect value for last_msg_.amplitude_value[7], expected 228, is " + << last_msg_.amplitude_value[7]; + EXPECT_EQ(last_msg_.amplitude_value[8], 228) + << "incorrect value for last_msg_.amplitude_value[8], expected 228, is " + << last_msg_.amplitude_value[8]; + EXPECT_EQ(last_msg_.amplitude_value[9], 47) + << "incorrect value for last_msg_.amplitude_value[9], expected 47, is " + << last_msg_.amplitude_value[9]; + EXPECT_EQ(last_msg_.amplitude_value[10], 33) + << "incorrect value for last_msg_.amplitude_value[10], expected 33, is " + << last_msg_.amplitude_value[10]; + EXPECT_EQ(last_msg_.amplitude_value[11], 24) + << "incorrect value for last_msg_.amplitude_value[11], expected 24, is " + << last_msg_.amplitude_value[11]; + EXPECT_EQ(last_msg_.amplitude_value[12], 141) + << "incorrect value for last_msg_.amplitude_value[12], expected 141, is " + << last_msg_.amplitude_value[12]; + EXPECT_EQ(last_msg_.amplitude_value[13], 177) + << "incorrect value for last_msg_.amplitude_value[13], expected 177, is " + << last_msg_.amplitude_value[13]; + EXPECT_EQ(last_msg_.amplitude_value[14], 18) + << "incorrect value for last_msg_.amplitude_value[14], expected 18, is " + << last_msg_.amplitude_value[14]; + EXPECT_EQ(last_msg_.amplitude_value[15], 99) + << "incorrect value for last_msg_.amplitude_value[15], expected 99, is " + << last_msg_.amplitude_value[15]; + EXPECT_EQ(last_msg_.amplitude_value[16], 246) + << "incorrect value for last_msg_.amplitude_value[16], expected 246, is " + << last_msg_.amplitude_value[16]; + EXPECT_EQ(last_msg_.amplitude_value[17], 121) + << "incorrect value for last_msg_.amplitude_value[17], expected 121, is " + << last_msg_.amplitude_value[17]; + EXPECT_EQ(last_msg_.amplitude_value[18], 61) + << "incorrect value for last_msg_.amplitude_value[18], expected 61, is " + << last_msg_.amplitude_value[18]; + EXPECT_EQ(last_msg_.amplitude_value[19], 40) + << "incorrect value for last_msg_.amplitude_value[19], expected 40, is " + << last_msg_.amplitude_value[19]; + EXPECT_EQ(last_msg_.amplitude_value[20], 91) + << "incorrect value for last_msg_.amplitude_value[20], expected 91, is " + << last_msg_.amplitude_value[20]; + EXPECT_EQ(last_msg_.amplitude_value[21], 145) + << "incorrect value for last_msg_.amplitude_value[21], expected 145, is " + << last_msg_.amplitude_value[21]; + EXPECT_EQ(last_msg_.amplitude_value[22], 223) + << "incorrect value for last_msg_.amplitude_value[22], expected 223, is " + << last_msg_.amplitude_value[22]; + EXPECT_EQ(last_msg_.amplitude_value[23], 167) + << "incorrect value for last_msg_.amplitude_value[23], expected 167, is " + << last_msg_.amplitude_value[23]; + EXPECT_EQ(last_msg_.amplitude_value[24], 174) + << "incorrect value for last_msg_.amplitude_value[24], expected 174, is " + << last_msg_.amplitude_value[24]; + EXPECT_EQ(last_msg_.amplitude_value[25], 9) + << "incorrect value for last_msg_.amplitude_value[25], expected 9, is " + << last_msg_.amplitude_value[25]; + EXPECT_EQ(last_msg_.amplitude_value[26], 116) + << "incorrect value for last_msg_.amplitude_value[26], expected 116, is " + << last_msg_.amplitude_value[26]; + EXPECT_EQ(last_msg_.amplitude_value[27], 11) + << "incorrect value for last_msg_.amplitude_value[27], expected 11, is " + << last_msg_.amplitude_value[27]; + EXPECT_EQ(last_msg_.amplitude_value[28], 247) + << "incorrect value for last_msg_.amplitude_value[28], expected 247, is " + << last_msg_.amplitude_value[28]; + EXPECT_EQ(last_msg_.amplitude_value[29], 84) + << "incorrect value for last_msg_.amplitude_value[29], expected 84, is " + << last_msg_.amplitude_value[29]; + EXPECT_EQ(last_msg_.amplitude_value[30], 49) + << "incorrect value for last_msg_.amplitude_value[30], expected 49, is " + << last_msg_.amplitude_value[30]; + EXPECT_EQ(last_msg_.amplitude_value[31], 153) + << "incorrect value for last_msg_.amplitude_value[31], expected 153, is " + << last_msg_.amplitude_value[31]; + EXPECT_EQ(last_msg_.amplitude_value[32], 205) + << "incorrect value for last_msg_.amplitude_value[32], expected 205, is " + << last_msg_.amplitude_value[32]; + EXPECT_EQ(last_msg_.amplitude_value[33], 2) + << "incorrect value for last_msg_.amplitude_value[33], expected 2, is " + << last_msg_.amplitude_value[33]; + EXPECT_EQ(last_msg_.amplitude_value[34], 230) + << "incorrect value for last_msg_.amplitude_value[34], expected 230, is " + << last_msg_.amplitude_value[34]; + EXPECT_EQ(last_msg_.amplitude_value[35], 194) + << "incorrect value for last_msg_.amplitude_value[35], expected 194, is " + << last_msg_.amplitude_value[35]; + EXPECT_EQ(last_msg_.amplitude_value[36], 218) + << "incorrect value for last_msg_.amplitude_value[36], expected 218, is " + << last_msg_.amplitude_value[36]; + EXPECT_EQ(last_msg_.amplitude_value[37], 241) + << "incorrect value for last_msg_.amplitude_value[37], expected 241, is " + << last_msg_.amplitude_value[37]; + EXPECT_EQ(last_msg_.amplitude_value[38], 101) + << "incorrect value for last_msg_.amplitude_value[38], expected 101, is " + << last_msg_.amplitude_value[38]; + EXPECT_EQ(last_msg_.amplitude_value[39], 107) + << "incorrect value for last_msg_.amplitude_value[39], expected 107, is " + << last_msg_.amplitude_value[39]; + EXPECT_EQ(last_msg_.amplitude_value[40], 45) + << "incorrect value for last_msg_.amplitude_value[40], expected 45, is " + << last_msg_.amplitude_value[40]; + EXPECT_EQ(last_msg_.amplitude_value[41], 137) + << "incorrect value for last_msg_.amplitude_value[41], expected 137, is " + << last_msg_.amplitude_value[41]; + EXPECT_EQ(last_msg_.amplitude_value[42], 93) + << "incorrect value for last_msg_.amplitude_value[42], expected 93, is " + << last_msg_.amplitude_value[42]; + EXPECT_EQ(last_msg_.amplitude_value[43], 114) + << "incorrect value for last_msg_.amplitude_value[43], expected 114, is " + << last_msg_.amplitude_value[43]; + EXPECT_EQ(last_msg_.amplitude_value[44], 230) + << "incorrect value for last_msg_.amplitude_value[44], expected 230, is " + << last_msg_.amplitude_value[44]; + EXPECT_EQ(last_msg_.amplitude_value[45], 43) + << "incorrect value for last_msg_.amplitude_value[45], expected 43, is " + << last_msg_.amplitude_value[45]; + EXPECT_EQ(last_msg_.amplitude_value[46], 224) + << "incorrect value for last_msg_.amplitude_value[46], expected 224, is " + << last_msg_.amplitude_value[46]; + EXPECT_EQ(last_msg_.amplitude_value[47], 23) + << "incorrect value for last_msg_.amplitude_value[47], expected 23, is " + << last_msg_.amplitude_value[47]; + EXPECT_EQ(last_msg_.amplitude_value[48], 74) + << "incorrect value for last_msg_.amplitude_value[48], expected 74, is " + << last_msg_.amplitude_value[48]; + EXPECT_EQ(last_msg_.amplitude_value[49], 209) + << "incorrect value for last_msg_.amplitude_value[49], expected 209, is " + << last_msg_.amplitude_value[49]; + EXPECT_EQ(last_msg_.amplitude_value[50], 199) + << "incorrect value for last_msg_.amplitude_value[50], expected 199, is " + << last_msg_.amplitude_value[50]; + EXPECT_EQ(last_msg_.amplitude_value[51], 211) + << "incorrect value for last_msg_.amplitude_value[51], expected 211, is " + << last_msg_.amplitude_value[51]; + EXPECT_EQ(last_msg_.amplitude_value[52], 130) + << "incorrect value for last_msg_.amplitude_value[52], expected 130, is " + << last_msg_.amplitude_value[52]; + EXPECT_EQ(last_msg_.amplitude_value[53], 89) + << "incorrect value for last_msg_.amplitude_value[53], expected 89, is " + << last_msg_.amplitude_value[53]; + EXPECT_EQ(last_msg_.amplitude_value[54], 220) + << "incorrect value for last_msg_.amplitude_value[54], expected 220, is " + << last_msg_.amplitude_value[54]; + EXPECT_EQ(last_msg_.amplitude_value[55], 163) + << "incorrect value for last_msg_.amplitude_value[55], expected 163, is " + << last_msg_.amplitude_value[55]; + EXPECT_EQ(last_msg_.amplitude_value[56], 68) + << "incorrect value for last_msg_.amplitude_value[56], expected 68, is " + << last_msg_.amplitude_value[56]; + EXPECT_EQ(last_msg_.amplitude_value[57], 20) + << "incorrect value for last_msg_.amplitude_value[57], expected 20, is " + << last_msg_.amplitude_value[57]; + EXPECT_EQ(last_msg_.amplitude_value[58], 253) + << "incorrect value for last_msg_.amplitude_value[58], expected 253, is " + << last_msg_.amplitude_value[58]; + EXPECT_EQ(last_msg_.amplitude_value[59], 7) + << "incorrect value for last_msg_.amplitude_value[59], expected 7, is " + << last_msg_.amplitude_value[59]; + EXPECT_EQ(last_msg_.amplitude_value[60], 206) + << "incorrect value for last_msg_.amplitude_value[60], expected 206, is " + << last_msg_.amplitude_value[60]; + EXPECT_EQ(last_msg_.amplitude_value[61], 50) + << "incorrect value for last_msg_.amplitude_value[61], expected 50, is " + << last_msg_.amplitude_value[61]; + EXPECT_EQ(last_msg_.amplitude_value[62], 129) + << "incorrect value for last_msg_.amplitude_value[62], expected 129, is " + << last_msg_.amplitude_value[62]; + EXPECT_EQ(last_msg_.amplitude_value[63], 116) + << "incorrect value for last_msg_.amplitude_value[63], expected 116, is " + << last_msg_.amplitude_value[63]; + EXPECT_EQ(last_msg_.amplitude_value[64], 194) + << "incorrect value for last_msg_.amplitude_value[64], expected 194, is " + << last_msg_.amplitude_value[64]; + EXPECT_EQ(last_msg_.amplitude_value[65], 23) + << "incorrect value for last_msg_.amplitude_value[65], expected 23, is " + << last_msg_.amplitude_value[65]; + EXPECT_EQ(last_msg_.amplitude_value[66], 31) + << "incorrect value for last_msg_.amplitude_value[66], expected 31, is " + << last_msg_.amplitude_value[66]; + EXPECT_EQ(last_msg_.amplitude_value[67], 226) + << "incorrect value for last_msg_.amplitude_value[67], expected 226, is " + << last_msg_.amplitude_value[67]; + EXPECT_EQ(last_msg_.amplitude_value[68], 217) + << "incorrect value for last_msg_.amplitude_value[68], expected 217, is " + << last_msg_.amplitude_value[68]; + EXPECT_EQ(last_msg_.amplitude_value[69], 157) + << "incorrect value for last_msg_.amplitude_value[69], expected 157, is " + << last_msg_.amplitude_value[69]; + EXPECT_EQ(last_msg_.amplitude_value[70], 205) + << "incorrect value for last_msg_.amplitude_value[70], expected 205, is " + << last_msg_.amplitude_value[70]; + EXPECT_EQ(last_msg_.amplitude_value[71], 221) + << "incorrect value for last_msg_.amplitude_value[71], expected 221, is " + << last_msg_.amplitude_value[71]; + EXPECT_EQ(last_msg_.amplitude_value[72], 5) + << "incorrect value for last_msg_.amplitude_value[72], expected 5, is " + << last_msg_.amplitude_value[72]; + EXPECT_EQ(last_msg_.amplitude_value[73], 224) + << "incorrect value for last_msg_.amplitude_value[73], expected 224, is " + << last_msg_.amplitude_value[73]; + EXPECT_EQ(last_msg_.amplitude_value[74], 92) + << "incorrect value for last_msg_.amplitude_value[74], expected 92, is " + << last_msg_.amplitude_value[74]; + EXPECT_EQ(last_msg_.amplitude_value[75], 82) + << "incorrect value for last_msg_.amplitude_value[75], expected 82, is " + << last_msg_.amplitude_value[75]; + EXPECT_EQ(last_msg_.amplitude_value[76], 109) + << "incorrect value for last_msg_.amplitude_value[76], expected 109, is " + << last_msg_.amplitude_value[76]; + EXPECT_EQ(last_msg_.amplitude_value[77], 223) + << "incorrect value for last_msg_.amplitude_value[77], expected 223, is " + << last_msg_.amplitude_value[77]; + EXPECT_EQ(last_msg_.amplitude_value[78], 195) + << "incorrect value for last_msg_.amplitude_value[78], expected 195, is " + << last_msg_.amplitude_value[78]; + EXPECT_EQ(last_msg_.amplitude_value[79], 233) + << "incorrect value for last_msg_.amplitude_value[79], expected 233, is " + << last_msg_.amplitude_value[79]; + EXPECT_EQ(last_msg_.amplitude_value[80], 165) + << "incorrect value for last_msg_.amplitude_value[80], expected 165, is " + << last_msg_.amplitude_value[80]; + EXPECT_EQ(last_msg_.amplitude_value[81], 1) + << "incorrect value for last_msg_.amplitude_value[81], expected 1, is " + << last_msg_.amplitude_value[81]; + EXPECT_EQ(last_msg_.amplitude_value[82], 82) + << "incorrect value for last_msg_.amplitude_value[82], expected 82, is " + << last_msg_.amplitude_value[82]; + EXPECT_EQ(last_msg_.amplitude_value[83], 141) + << "incorrect value for last_msg_.amplitude_value[83], expected 141, is " + << last_msg_.amplitude_value[83]; + EXPECT_EQ(last_msg_.amplitude_value[84], 157) + << "incorrect value for last_msg_.amplitude_value[84], expected 157, is " + << last_msg_.amplitude_value[84]; + EXPECT_EQ(last_msg_.amplitude_value[85], 177) + << "incorrect value for last_msg_.amplitude_value[85], expected 177, is " + << last_msg_.amplitude_value[85]; + EXPECT_EQ(last_msg_.amplitude_value[86], 169) + << "incorrect value for last_msg_.amplitude_value[86], expected 169, is " + << last_msg_.amplitude_value[86]; + EXPECT_EQ(last_msg_.amplitude_value[87], 244) + << "incorrect value for last_msg_.amplitude_value[87], expected 244, is " + << last_msg_.amplitude_value[87]; + EXPECT_EQ(last_msg_.amplitude_value[88], 131) + << "incorrect value for last_msg_.amplitude_value[88], expected 131, is " + << last_msg_.amplitude_value[88]; + EXPECT_EQ(last_msg_.amplitude_value[89], 96) + << "incorrect value for last_msg_.amplitude_value[89], expected 96, is " + << last_msg_.amplitude_value[89]; + EXPECT_EQ(last_msg_.amplitude_value[90], 109) + << "incorrect value for last_msg_.amplitude_value[90], expected 109, is " + << last_msg_.amplitude_value[90]; + EXPECT_EQ(last_msg_.amplitude_value[91], 111) + << "incorrect value for last_msg_.amplitude_value[91], expected 111, is " + << last_msg_.amplitude_value[91]; + EXPECT_EQ(last_msg_.amplitude_value[92], 253) + << "incorrect value for last_msg_.amplitude_value[92], expected 253, is " + << last_msg_.amplitude_value[92]; + EXPECT_EQ(last_msg_.amplitude_value[93], 149) + << "incorrect value for last_msg_.amplitude_value[93], expected 149, is " + << last_msg_.amplitude_value[93]; + EXPECT_EQ(last_msg_.amplitude_value[94], 28) + << "incorrect value for last_msg_.amplitude_value[94], expected 28, is " + << last_msg_.amplitude_value[94]; + EXPECT_EQ(last_msg_.amplitude_value[95], 225) + << "incorrect value for last_msg_.amplitude_value[95], expected 225, is " + << last_msg_.amplitude_value[95]; + EXPECT_EQ(last_msg_.amplitude_value[96], 225) + << "incorrect value for last_msg_.amplitude_value[96], expected 225, is " + << last_msg_.amplitude_value[96]; + EXPECT_EQ(last_msg_.amplitude_value[97], 72) + << "incorrect value for last_msg_.amplitude_value[97], expected 72, is " + << last_msg_.amplitude_value[97]; + EXPECT_EQ(last_msg_.amplitude_value[98], 158) + << "incorrect value for last_msg_.amplitude_value[98], expected 158, is " + << last_msg_.amplitude_value[98]; + EXPECT_EQ(last_msg_.amplitude_value[99], 158) + << "incorrect value for last_msg_.amplitude_value[99], expected 158, is " + << last_msg_.amplitude_value[99]; + EXPECT_EQ(last_msg_.amplitude_value[100], 210) + << "incorrect value for last_msg_.amplitude_value[100], expected 210, is " + << last_msg_.amplitude_value[100]; + EXPECT_EQ(last_msg_.amplitude_value[101], 196) + << "incorrect value for last_msg_.amplitude_value[101], expected 196, is " + << last_msg_.amplitude_value[101]; + EXPECT_EQ(last_msg_.amplitude_value[102], 206) + << "incorrect value for last_msg_.amplitude_value[102], expected 206, is " + << last_msg_.amplitude_value[102]; + EXPECT_EQ(last_msg_.amplitude_value[103], 70) + << "incorrect value for last_msg_.amplitude_value[103], expected 70, is " + << last_msg_.amplitude_value[103]; + EXPECT_EQ(last_msg_.amplitude_value[104], 63) + << "incorrect value for last_msg_.amplitude_value[104], expected 63, is " + << last_msg_.amplitude_value[104]; + EXPECT_EQ(last_msg_.amplitude_value[105], 225) + << "incorrect value for last_msg_.amplitude_value[105], expected 225, is " + << last_msg_.amplitude_value[105]; + EXPECT_EQ(last_msg_.amplitude_value[106], 184) + << "incorrect value for last_msg_.amplitude_value[106], expected 184, is " + << last_msg_.amplitude_value[106]; + EXPECT_EQ(last_msg_.amplitude_value[107], 150) + << "incorrect value for last_msg_.amplitude_value[107], expected 150, is " + << last_msg_.amplitude_value[107]; + EXPECT_EQ(last_msg_.amplitude_value[108], 174) + << "incorrect value for last_msg_.amplitude_value[108], expected 174, is " + << last_msg_.amplitude_value[108]; + EXPECT_EQ(last_msg_.amplitude_value[109], 240) + << "incorrect value for last_msg_.amplitude_value[109], expected 240, is " + << last_msg_.amplitude_value[109]; + EXPECT_EQ(last_msg_.amplitude_value[110], 45) + << "incorrect value for last_msg_.amplitude_value[110], expected 45, is " + << last_msg_.amplitude_value[110]; + EXPECT_EQ(last_msg_.amplitude_value[111], 146) + << "incorrect value for last_msg_.amplitude_value[111], expected 146, is " + << last_msg_.amplitude_value[111]; + EXPECT_EQ(last_msg_.amplitude_value[112], 59) + << "incorrect value for last_msg_.amplitude_value[112], expected 59, is " + << last_msg_.amplitude_value[112]; + EXPECT_EQ(last_msg_.amplitude_value[113], 82) + << "incorrect value for last_msg_.amplitude_value[113], expected 82, is " + << last_msg_.amplitude_value[113]; + EXPECT_EQ(last_msg_.amplitude_value[114], 194) + << "incorrect value for last_msg_.amplitude_value[114], expected 194, is " + << last_msg_.amplitude_value[114]; + EXPECT_EQ(last_msg_.amplitude_value[115], 4) + << "incorrect value for last_msg_.amplitude_value[115], expected 4, is " + << last_msg_.amplitude_value[115]; + EXPECT_EQ(last_msg_.amplitude_value[116], 179) + << "incorrect value for last_msg_.amplitude_value[116], expected 179, is " + << last_msg_.amplitude_value[116]; + EXPECT_EQ(last_msg_.amplitude_value[117], 148) + << "incorrect value for last_msg_.amplitude_value[117], expected 148, is " + << last_msg_.amplitude_value[117]; + EXPECT_EQ(last_msg_.amplitude_value[118], 66) + << "incorrect value for last_msg_.amplitude_value[118], expected 66, is " + << last_msg_.amplitude_value[118]; + EXPECT_EQ(last_msg_.amplitude_value[119], 254) + << "incorrect value for last_msg_.amplitude_value[119], expected 254, is " + << last_msg_.amplitude_value[119]; + EXPECT_EQ(last_msg_.amplitude_value[120], 115) + << "incorrect value for last_msg_.amplitude_value[120], expected 115, is " + << last_msg_.amplitude_value[120]; + EXPECT_EQ(last_msg_.amplitude_value[121], 77) + << "incorrect value for last_msg_.amplitude_value[121], expected 77, is " + << last_msg_.amplitude_value[121]; + EXPECT_EQ(last_msg_.amplitude_value[122], 30) + << "incorrect value for last_msg_.amplitude_value[122], expected 30, is " + << last_msg_.amplitude_value[122]; + EXPECT_EQ(last_msg_.amplitude_value[123], 46) + << "incorrect value for last_msg_.amplitude_value[123], expected 46, is " + << last_msg_.amplitude_value[123]; + EXPECT_EQ(last_msg_.amplitude_value[124], 4) + << "incorrect value for last_msg_.amplitude_value[124], expected 4, is " + << last_msg_.amplitude_value[124]; + EXPECT_EQ(last_msg_.amplitude_value[125], 204) + << "incorrect value for last_msg_.amplitude_value[125], expected 204, is " + << last_msg_.amplitude_value[125]; + EXPECT_EQ(last_msg_.amplitude_value[126], 37) + << "incorrect value for last_msg_.amplitude_value[126], expected 37, is " + << last_msg_.amplitude_value[126]; + EXPECT_EQ(last_msg_.amplitude_value[127], 200) + << "incorrect value for last_msg_.amplitude_value[127], expected 200, is " + << last_msg_.amplitude_value[127]; + EXPECT_EQ(last_msg_.amplitude_value[128], 121) + << "incorrect value for last_msg_.amplitude_value[128], expected 121, is " + << last_msg_.amplitude_value[128]; + EXPECT_EQ(last_msg_.amplitude_value[129], 18) + << "incorrect value for last_msg_.amplitude_value[129], expected 18, is " + << last_msg_.amplitude_value[129]; + EXPECT_EQ(last_msg_.amplitude_value[130], 17) + << "incorrect value for last_msg_.amplitude_value[130], expected 17, is " + << last_msg_.amplitude_value[130]; + EXPECT_EQ(last_msg_.amplitude_value[131], 171) + << "incorrect value for last_msg_.amplitude_value[131], expected 171, is " + << last_msg_.amplitude_value[131]; + EXPECT_EQ(last_msg_.amplitude_value[132], 102) + << "incorrect value for last_msg_.amplitude_value[132], expected 102, is " + << last_msg_.amplitude_value[132]; + EXPECT_EQ(last_msg_.amplitude_value[133], 163) + << "incorrect value for last_msg_.amplitude_value[133], expected 163, is " + << last_msg_.amplitude_value[133]; + EXPECT_EQ(last_msg_.amplitude_value[134], 175) + << "incorrect value for last_msg_.amplitude_value[134], expected 175, is " + << last_msg_.amplitude_value[134]; + EXPECT_EQ(last_msg_.amplitude_value[135], 50) + << "incorrect value for last_msg_.amplitude_value[135], expected 50, is " + << last_msg_.amplitude_value[135]; + EXPECT_EQ(last_msg_.amplitude_value[136], 66) + << "incorrect value for last_msg_.amplitude_value[136], expected 66, is " + << last_msg_.amplitude_value[136]; + EXPECT_EQ(last_msg_.amplitude_value[137], 101) + << "incorrect value for last_msg_.amplitude_value[137], expected 101, is " + << last_msg_.amplitude_value[137]; + EXPECT_EQ(last_msg_.amplitude_value[138], 69) + << "incorrect value for last_msg_.amplitude_value[138], expected 69, is " + << last_msg_.amplitude_value[138]; + EXPECT_EQ(last_msg_.amplitude_value[139], 13) + << "incorrect value for last_msg_.amplitude_value[139], expected 13, is " + << last_msg_.amplitude_value[139]; + EXPECT_EQ(last_msg_.amplitude_value[140], 223) + << "incorrect value for last_msg_.amplitude_value[140], expected 223, is " + << last_msg_.amplitude_value[140]; + EXPECT_EQ(last_msg_.amplitude_value[141], 172) + << "incorrect value for last_msg_.amplitude_value[141], expected 172, is " + << last_msg_.amplitude_value[141]; + EXPECT_EQ(last_msg_.amplitude_value[142], 160) + << "incorrect value for last_msg_.amplitude_value[142], expected 160, is " + << last_msg_.amplitude_value[142]; + EXPECT_EQ(last_msg_.amplitude_value[143], 233) + << "incorrect value for last_msg_.amplitude_value[143], expected 233, is " + << last_msg_.amplitude_value[143]; + EXPECT_EQ(last_msg_.amplitude_value[144], 220) + << "incorrect value for last_msg_.amplitude_value[144], expected 220, is " + << last_msg_.amplitude_value[144]; + EXPECT_EQ(last_msg_.amplitude_value[145], 101) + << "incorrect value for last_msg_.amplitude_value[145], expected 101, is " + << last_msg_.amplitude_value[145]; + EXPECT_EQ(last_msg_.amplitude_value[146], 237) + << "incorrect value for last_msg_.amplitude_value[146], expected 237, is " + << last_msg_.amplitude_value[146]; + EXPECT_EQ(last_msg_.amplitude_value[147], 156) + << "incorrect value for last_msg_.amplitude_value[147], expected 156, is " + << last_msg_.amplitude_value[147]; + EXPECT_EQ(last_msg_.amplitude_value[148], 62) + << "incorrect value for last_msg_.amplitude_value[148], expected 62, is " + << last_msg_.amplitude_value[148]; + EXPECT_EQ(last_msg_.amplitude_value[149], 117) + << "incorrect value for last_msg_.amplitude_value[149], expected 117, is " + << last_msg_.amplitude_value[149]; + EXPECT_EQ(last_msg_.amplitude_value[150], 47) + << "incorrect value for last_msg_.amplitude_value[150], expected 47, is " + << last_msg_.amplitude_value[150]; + EXPECT_EQ(last_msg_.amplitude_value[151], 143) + << "incorrect value for last_msg_.amplitude_value[151], expected 143, is " + << last_msg_.amplitude_value[151]; + EXPECT_EQ(last_msg_.amplitude_value[152], 94) + << "incorrect value for last_msg_.amplitude_value[152], expected 94, is " + << last_msg_.amplitude_value[152]; + EXPECT_EQ(last_msg_.amplitude_value[153], 135) + << "incorrect value for last_msg_.amplitude_value[153], expected 135, is " + << last_msg_.amplitude_value[153]; + EXPECT_EQ(last_msg_.amplitude_value[154], 22) + << "incorrect value for last_msg_.amplitude_value[154], expected 22, is " + << last_msg_.amplitude_value[154]; + EXPECT_EQ(last_msg_.amplitude_value[155], 155) + << "incorrect value for last_msg_.amplitude_value[155], expected 155, is " + << last_msg_.amplitude_value[155]; + EXPECT_EQ(last_msg_.amplitude_value[156], 113) + << "incorrect value for last_msg_.amplitude_value[156], expected 113, is " + << last_msg_.amplitude_value[156]; + EXPECT_EQ(last_msg_.amplitude_value[157], 110) + << "incorrect value for last_msg_.amplitude_value[157], expected 110, is " + << last_msg_.amplitude_value[157]; + EXPECT_EQ(last_msg_.amplitude_value[158], 15) + << "incorrect value for last_msg_.amplitude_value[158], expected 15, is " + << last_msg_.amplitude_value[158]; + EXPECT_EQ(last_msg_.amplitude_value[159], 243) + << "incorrect value for last_msg_.amplitude_value[159], expected 243, is " + << last_msg_.amplitude_value[159]; + EXPECT_EQ(last_msg_.amplitude_value[160], 141) + << "incorrect value for last_msg_.amplitude_value[160], expected 141, is " + << last_msg_.amplitude_value[160]; + EXPECT_EQ(last_msg_.amplitude_value[161], 227) + << "incorrect value for last_msg_.amplitude_value[161], expected 227, is " + << last_msg_.amplitude_value[161]; + EXPECT_EQ(last_msg_.amplitude_value[162], 46) + << "incorrect value for last_msg_.amplitude_value[162], expected 46, is " + << last_msg_.amplitude_value[162]; + EXPECT_EQ(last_msg_.amplitude_value[163], 143) + << "incorrect value for last_msg_.amplitude_value[163], expected 143, is " + << last_msg_.amplitude_value[163]; + EXPECT_EQ(last_msg_.amplitude_value[164], 227) + << "incorrect value for last_msg_.amplitude_value[164], expected 227, is " + << last_msg_.amplitude_value[164]; + EXPECT_EQ(last_msg_.amplitude_value[165], 209) + << "incorrect value for last_msg_.amplitude_value[165], expected 209, is " + << last_msg_.amplitude_value[165]; + EXPECT_EQ(last_msg_.amplitude_value[166], 249) + << "incorrect value for last_msg_.amplitude_value[166], expected 249, is " + << last_msg_.amplitude_value[166]; + EXPECT_EQ(last_msg_.amplitude_value[167], 2) + << "incorrect value for last_msg_.amplitude_value[167], expected 2, is " + << last_msg_.amplitude_value[167]; + EXPECT_EQ(last_msg_.amplitude_value[168], 153) + << "incorrect value for last_msg_.amplitude_value[168], expected 153, is " + << last_msg_.amplitude_value[168]; + EXPECT_EQ(last_msg_.amplitude_value[169], 168) + << "incorrect value for last_msg_.amplitude_value[169], expected 168, is " + << last_msg_.amplitude_value[169]; + EXPECT_EQ(last_msg_.amplitude_value[170], 131) + << "incorrect value for last_msg_.amplitude_value[170], expected 131, is " + << last_msg_.amplitude_value[170]; + EXPECT_EQ(last_msg_.amplitude_value[171], 249) + << "incorrect value for last_msg_.amplitude_value[171], expected 249, is " + << last_msg_.amplitude_value[171]; + EXPECT_EQ(last_msg_.amplitude_value[172], 160) + << "incorrect value for last_msg_.amplitude_value[172], expected 160, is " + << last_msg_.amplitude_value[172]; + EXPECT_EQ(last_msg_.amplitude_value[173], 88) + << "incorrect value for last_msg_.amplitude_value[173], expected 88, is " + << last_msg_.amplitude_value[173]; + EXPECT_EQ(last_msg_.amplitude_value[174], 38) + << "incorrect value for last_msg_.amplitude_value[174], expected 38, is " + << last_msg_.amplitude_value[174]; + EXPECT_EQ(last_msg_.amplitude_value[175], 117) + << "incorrect value for last_msg_.amplitude_value[175], expected 117, is " + << last_msg_.amplitude_value[175]; + EXPECT_EQ(last_msg_.amplitude_value[176], 129) + << "incorrect value for last_msg_.amplitude_value[176], expected 129, is " + << last_msg_.amplitude_value[176]; + EXPECT_EQ(last_msg_.amplitude_value[177], 57) + << "incorrect value for last_msg_.amplitude_value[177], expected 57, is " + << last_msg_.amplitude_value[177]; + EXPECT_EQ(last_msg_.amplitude_value[178], 40) + << "incorrect value for last_msg_.amplitude_value[178], expected 40, is " + << last_msg_.amplitude_value[178]; + EXPECT_EQ(last_msg_.amplitude_value[179], 109) + << "incorrect value for last_msg_.amplitude_value[179], expected 109, is " + << last_msg_.amplitude_value[179]; + EXPECT_EQ(last_msg_.amplitude_value[180], 209) + << "incorrect value for last_msg_.amplitude_value[180], expected 209, is " + << last_msg_.amplitude_value[180]; + EXPECT_EQ(last_msg_.amplitude_value[181], 177) + << "incorrect value for last_msg_.amplitude_value[181], expected 177, is " + << last_msg_.amplitude_value[181]; + EXPECT_EQ(last_msg_.amplitude_value[182], 38) + << "incorrect value for last_msg_.amplitude_value[182], expected 38, is " + << last_msg_.amplitude_value[182]; + EXPECT_EQ(last_msg_.amplitude_value[183], 47) + << "incorrect value for last_msg_.amplitude_value[183], expected 47, is " + << last_msg_.amplitude_value[183]; + EXPECT_EQ(last_msg_.amplitude_value[184], 12) + << "incorrect value for last_msg_.amplitude_value[184], expected 12, is " + << last_msg_.amplitude_value[184]; + EXPECT_EQ(last_msg_.amplitude_value[185], 15) + << "incorrect value for last_msg_.amplitude_value[185], expected 15, is " + << last_msg_.amplitude_value[185]; + EXPECT_EQ(last_msg_.amplitude_value[186], 16) + << "incorrect value for last_msg_.amplitude_value[186], expected 16, is " + << last_msg_.amplitude_value[186]; + EXPECT_EQ(last_msg_.amplitude_value[187], 9) + << "incorrect value for last_msg_.amplitude_value[187], expected 9, is " + << last_msg_.amplitude_value[187]; + EXPECT_EQ(last_msg_.amplitude_value[188], 175) + << "incorrect value for last_msg_.amplitude_value[188], expected 175, is " + << last_msg_.amplitude_value[188]; + EXPECT_EQ(last_msg_.amplitude_value[189], 69) + << "incorrect value for last_msg_.amplitude_value[189], expected 69, is " + << last_msg_.amplitude_value[189]; + EXPECT_EQ(last_msg_.amplitude_value[190], 70) + << "incorrect value for last_msg_.amplitude_value[190], expected 70, is " + << last_msg_.amplitude_value[190]; + EXPECT_EQ(last_msg_.amplitude_value[191], 182) + << "incorrect value for last_msg_.amplitude_value[191], expected 182, is " + << last_msg_.amplitude_value[191]; + EXPECT_EQ(last_msg_.amplitude_value[192], 239) + << "incorrect value for last_msg_.amplitude_value[192], expected 239, is " + << last_msg_.amplitude_value[192]; + EXPECT_EQ(last_msg_.amplitude_value[193], 117) + << "incorrect value for last_msg_.amplitude_value[193], expected 117, is " + << last_msg_.amplitude_value[193]; + EXPECT_EQ(last_msg_.amplitude_value[194], 135) + << "incorrect value for last_msg_.amplitude_value[194], expected 135, is " + << last_msg_.amplitude_value[194]; + EXPECT_EQ(last_msg_.amplitude_value[195], 6) + << "incorrect value for last_msg_.amplitude_value[195], expected 6, is " + << last_msg_.amplitude_value[195]; + EXPECT_EQ(last_msg_.amplitude_value[196], 71) + << "incorrect value for last_msg_.amplitude_value[196], expected 71, is " + << last_msg_.amplitude_value[196]; + EXPECT_EQ(last_msg_.amplitude_value[197], 99) + << "incorrect value for last_msg_.amplitude_value[197], expected 99, is " + << last_msg_.amplitude_value[197]; + EXPECT_EQ(last_msg_.amplitude_value[198], 230) + << "incorrect value for last_msg_.amplitude_value[198], expected 230, is " + << last_msg_.amplitude_value[198]; + EXPECT_EQ(last_msg_.amplitude_value[199], 115) + << "incorrect value for last_msg_.amplitude_value[199], expected 115, is " + << last_msg_.amplitude_value[199]; + EXPECT_EQ(last_msg_.amplitude_value[200], 2) + << "incorrect value for last_msg_.amplitude_value[200], expected 2, is " + << last_msg_.amplitude_value[200]; + EXPECT_EQ(last_msg_.amplitude_value[201], 71) + << "incorrect value for last_msg_.amplitude_value[201], expected 71, is " + << last_msg_.amplitude_value[201]; + EXPECT_EQ(last_msg_.amplitude_value[202], 165) + << "incorrect value for last_msg_.amplitude_value[202], expected 165, is " + << last_msg_.amplitude_value[202]; + EXPECT_EQ(last_msg_.amplitude_value[203], 228) + << "incorrect value for last_msg_.amplitude_value[203], expected 228, is " + << last_msg_.amplitude_value[203]; + EXPECT_EQ(last_msg_.amplitude_value[204], 123) + << "incorrect value for last_msg_.amplitude_value[204], expected 123, is " + << last_msg_.amplitude_value[204]; + EXPECT_EQ(last_msg_.amplitude_value[205], 210) + << "incorrect value for last_msg_.amplitude_value[205], expected 210, is " + << last_msg_.amplitude_value[205]; + EXPECT_EQ(last_msg_.amplitude_value[206], 168) + << "incorrect value for last_msg_.amplitude_value[206], expected 168, is " + << last_msg_.amplitude_value[206]; + EXPECT_EQ(last_msg_.amplitude_value[207], 90) + << "incorrect value for last_msg_.amplitude_value[207], expected 90, is " + << last_msg_.amplitude_value[207]; + EXPECT_EQ(last_msg_.amplitude_value[208], 124) + << "incorrect value for last_msg_.amplitude_value[208], expected 124, is " + << last_msg_.amplitude_value[208]; + EXPECT_EQ(last_msg_.amplitude_value[209], 20) + << "incorrect value for last_msg_.amplitude_value[209], expected 20, is " + << last_msg_.amplitude_value[209]; + EXPECT_EQ(last_msg_.amplitude_value[210], 7) + << "incorrect value for last_msg_.amplitude_value[210], expected 7, is " + << last_msg_.amplitude_value[210]; + EXPECT_EQ(last_msg_.amplitude_value[211], 220) + << "incorrect value for last_msg_.amplitude_value[211], expected 220, is " + << last_msg_.amplitude_value[211]; + EXPECT_EQ(last_msg_.amplitude_value[212], 144) + << "incorrect value for last_msg_.amplitude_value[212], expected 144, is " + << last_msg_.amplitude_value[212]; + EXPECT_EQ(last_msg_.amplitude_value[213], 168) + << "incorrect value for last_msg_.amplitude_value[213], expected 168, is " + << last_msg_.amplitude_value[213]; + EXPECT_EQ(last_msg_.amplitude_value[214], 69) + << "incorrect value for last_msg_.amplitude_value[214], expected 69, is " + << last_msg_.amplitude_value[214]; + EXPECT_EQ(last_msg_.amplitude_value[215], 22) + << "incorrect value for last_msg_.amplitude_value[215], expected 22, is " + << last_msg_.amplitude_value[215]; + EXPECT_EQ(last_msg_.amplitude_value[216], 72) + << "incorrect value for last_msg_.amplitude_value[216], expected 72, is " + << last_msg_.amplitude_value[216]; + EXPECT_EQ(last_msg_.amplitude_value[217], 162) + << "incorrect value for last_msg_.amplitude_value[217], expected 162, is " + << last_msg_.amplitude_value[217]; + EXPECT_EQ(last_msg_.amplitude_value[218], 69) + << "incorrect value for last_msg_.amplitude_value[218], expected 69, is " + << last_msg_.amplitude_value[218]; + EXPECT_EQ(last_msg_.amplitude_value[219], 111) + << "incorrect value for last_msg_.amplitude_value[219], expected 111, is " + << last_msg_.amplitude_value[219]; + EXPECT_EQ(last_msg_.amplitude_value[220], 91) + << "incorrect value for last_msg_.amplitude_value[220], expected 91, is " + << last_msg_.amplitude_value[220]; + EXPECT_EQ(last_msg_.amplitude_value[221], 251) + << "incorrect value for last_msg_.amplitude_value[221], expected 251, is " + << last_msg_.amplitude_value[221]; + EXPECT_EQ(last_msg_.amplitude_value[222], 72) + << "incorrect value for last_msg_.amplitude_value[222], expected 72, is " + << last_msg_.amplitude_value[222]; + EXPECT_EQ(last_msg_.amplitude_value[223], 220) + << "incorrect value for last_msg_.amplitude_value[223], expected 220, is " + << last_msg_.amplitude_value[223]; + EXPECT_EQ(last_msg_.amplitude_value[224], 28) + << "incorrect value for last_msg_.amplitude_value[224], expected 28, is " + << last_msg_.amplitude_value[224]; + EXPECT_EQ(last_msg_.amplitude_value[225], 119) + << "incorrect value for last_msg_.amplitude_value[225], expected 119, is " + << last_msg_.amplitude_value[225]; + EXPECT_EQ(last_msg_.amplitude_value[226], 150) + << "incorrect value for last_msg_.amplitude_value[226], expected 150, is " + << last_msg_.amplitude_value[226]; + EXPECT_EQ(last_msg_.channel_tag, 35146) + << "incorrect value for last_msg_.channel_tag, expected 35146, is " + << last_msg_.channel_tag; + EXPECT_LT((last_msg_.freq_ref * 100 - 7737.20019531 * 100), 0.05) + << "incorrect value for last_msg_.freq_ref, expected 7737.20019531, is " + << last_msg_.freq_ref; + EXPECT_LT((last_msg_.freq_step * 100 - 8226.20019531 * 100), 0.05) + << "incorrect value for last_msg_.freq_step, expected 8226.20019531, is " + << last_msg_.freq_step; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_amplitude_value.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_amplitude_value.handle_as, " + "expected string '" + << check_string << "', is '" << last_msg_.n_amplitude_value.handle_as + << "'"; + } + { + const char check_string[] = {(char)97, (char)109, (char)112, (char)108, + (char)105, (char)116, (char)117, (char)100, + (char)101, (char)95, (char)118, (char)97, + (char)108, (char)117, (char)101}; + EXPECT_EQ(memcmp(last_msg_.n_amplitude_value.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_amplitude_value.relates_to, " + "expected string '" + << check_string << "', is '" << last_msg_.n_amplitude_value.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_amplitude_value.value, 227) + << "incorrect value for last_msg_.n_amplitude_value.value, expected 227, " + "is " + << last_msg_.n_amplitude_value.value; + EXPECT_EQ(last_msg_.t.ns_residual, -1479025396) + << "incorrect value for last_msg_.t.ns_residual, expected -1479025396, " + "is " + << last_msg_.t.ns_residual; + EXPECT_EQ(last_msg_.t.tow, 1227027783) + << "incorrect value for last_msg_.t.tow, expected 1227027783, is " + << last_msg_.t.tow; + EXPECT_EQ(last_msg_.t.wn, 5075) + << "incorrect value for last_msg_.t.wn, expected 5075, is " + << last_msg_.t.wn; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgSpecanDep.cc b/c/test/cpp/auto_check_sbp_piksi_MsgSpecanDep.cc index 21438dac7..111ca6d21 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgSpecanDep.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgSpecanDep.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecanDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecanDep.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgSpecanDep0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgSpecanDep0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgSpecanDep0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgSpecanDep0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_specan_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_specan_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,755 +67,1277 @@ class Test_auto_check_sbp_piksi_MsgSpecanDep0 : sbp_msg_specan_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgSpecanDep0, Test) -{ - - uint8_t encoded_frame[] = {85,80,0,112,217,255,246,22,221,56,37,59,45,27,154,97,198,69,154,1,144,69,205,20,18,70,51,211,89,69,240,14,179,186,227,244,173,240,182,71,166,117,196,13,44,27,33,28,67,254,3,249,92,44,122,169,77,186,68,135,63,168,162,89,36,186,99,63,105,116,216,44,67,212,156,75,81,53,250,225,23,205,26,34,119,50,101,64,7,231,124,183,203,102,234,84,83,208,23,68,54,179,98,96,116,244,246,94,104,94,13,56,210,18,191,22,133,81,153,159,161,219,59,21,164,121,145,203,171,132,57,180,102,101,11,229,175,145,73,72,124,4,184,228,61,234,218,62,226,217,193,7,109,44,83,201,20,101,9,140,186,162,81,91,30,231,161,81,216,114,60,231,163,163,49,237,244,185,240,89,143,174,165,211,241,13,16,61,141,101,89,37,117,189,86,118,176,228,12,14,119,135,129,243,50,29,207,198,117,100,225,6,139,110,39,210,68,199,43,132,64,17,51,173,181,12,140,16,247,84,183,105,39,157,77,30,205,194,59,64,241,183,238,105,181,170,45,8,166,164,238,83,148,173,108,228,67,89,189,67,26,39,216, }; - - sbp_msg_specan_dep_t test_msg{}; - test_msg.amplitude_ref = 9349.2001953125; - test_msg.amplitude_unit = 3485.199951171875; - - test_msg.amplitude_value[0] = 240; - - test_msg.amplitude_value[1] = 14; - - test_msg.amplitude_value[2] = 179; - - test_msg.amplitude_value[3] = 186; - - test_msg.amplitude_value[4] = 227; - - test_msg.amplitude_value[5] = 244; - - test_msg.amplitude_value[6] = 173; - - test_msg.amplitude_value[7] = 240; - - test_msg.amplitude_value[8] = 182; - - test_msg.amplitude_value[9] = 71; - - test_msg.amplitude_value[10] = 166; - - test_msg.amplitude_value[11] = 117; - - test_msg.amplitude_value[12] = 196; - - test_msg.amplitude_value[13] = 13; - - test_msg.amplitude_value[14] = 44; - - test_msg.amplitude_value[15] = 27; - - test_msg.amplitude_value[16] = 33; - - test_msg.amplitude_value[17] = 28; - - test_msg.amplitude_value[18] = 67; - - test_msg.amplitude_value[19] = 254; - - test_msg.amplitude_value[20] = 3; - - test_msg.amplitude_value[21] = 249; - - test_msg.amplitude_value[22] = 92; - - test_msg.amplitude_value[23] = 44; - - test_msg.amplitude_value[24] = 122; - - test_msg.amplitude_value[25] = 169; - - test_msg.amplitude_value[26] = 77; - - test_msg.amplitude_value[27] = 186; - - test_msg.amplitude_value[28] = 68; - - test_msg.amplitude_value[29] = 135; - - test_msg.amplitude_value[30] = 63; - - test_msg.amplitude_value[31] = 168; - - test_msg.amplitude_value[32] = 162; - - test_msg.amplitude_value[33] = 89; - - test_msg.amplitude_value[34] = 36; - - test_msg.amplitude_value[35] = 186; - - test_msg.amplitude_value[36] = 99; - - test_msg.amplitude_value[37] = 63; - - test_msg.amplitude_value[38] = 105; - - test_msg.amplitude_value[39] = 116; - - test_msg.amplitude_value[40] = 216; - - test_msg.amplitude_value[41] = 44; - - test_msg.amplitude_value[42] = 67; - - test_msg.amplitude_value[43] = 212; - - test_msg.amplitude_value[44] = 156; - - test_msg.amplitude_value[45] = 75; - - test_msg.amplitude_value[46] = 81; - - test_msg.amplitude_value[47] = 53; - - test_msg.amplitude_value[48] = 250; - - test_msg.amplitude_value[49] = 225; - - test_msg.amplitude_value[50] = 23; - - test_msg.amplitude_value[51] = 205; - - test_msg.amplitude_value[52] = 26; - - test_msg.amplitude_value[53] = 34; - - test_msg.amplitude_value[54] = 119; - - test_msg.amplitude_value[55] = 50; - - test_msg.amplitude_value[56] = 101; - - test_msg.amplitude_value[57] = 64; - - test_msg.amplitude_value[58] = 7; - - test_msg.amplitude_value[59] = 231; - - test_msg.amplitude_value[60] = 124; - - test_msg.amplitude_value[61] = 183; - - test_msg.amplitude_value[62] = 203; - - test_msg.amplitude_value[63] = 102; - - test_msg.amplitude_value[64] = 234; - - test_msg.amplitude_value[65] = 84; - - test_msg.amplitude_value[66] = 83; - - test_msg.amplitude_value[67] = 208; - - test_msg.amplitude_value[68] = 23; - - test_msg.amplitude_value[69] = 68; - - test_msg.amplitude_value[70] = 54; - - test_msg.amplitude_value[71] = 179; - - test_msg.amplitude_value[72] = 98; - - test_msg.amplitude_value[73] = 96; - - test_msg.amplitude_value[74] = 116; - - test_msg.amplitude_value[75] = 244; - - test_msg.amplitude_value[76] = 246; - - test_msg.amplitude_value[77] = 94; - - test_msg.amplitude_value[78] = 104; - - test_msg.amplitude_value[79] = 94; - - test_msg.amplitude_value[80] = 13; - - test_msg.amplitude_value[81] = 56; - - test_msg.amplitude_value[82] = 210; - - test_msg.amplitude_value[83] = 18; - - test_msg.amplitude_value[84] = 191; - - test_msg.amplitude_value[85] = 22; - - test_msg.amplitude_value[86] = 133; - - test_msg.amplitude_value[87] = 81; - - test_msg.amplitude_value[88] = 153; - - test_msg.amplitude_value[89] = 159; - - test_msg.amplitude_value[90] = 161; - - test_msg.amplitude_value[91] = 219; - - test_msg.amplitude_value[92] = 59; - - test_msg.amplitude_value[93] = 21; - - test_msg.amplitude_value[94] = 164; - - test_msg.amplitude_value[95] = 121; - - test_msg.amplitude_value[96] = 145; - - test_msg.amplitude_value[97] = 203; - - test_msg.amplitude_value[98] = 171; - - test_msg.amplitude_value[99] = 132; - - test_msg.amplitude_value[100] = 57; - - test_msg.amplitude_value[101] = 180; - - test_msg.amplitude_value[102] = 102; - - test_msg.amplitude_value[103] = 101; - - test_msg.amplitude_value[104] = 11; - - test_msg.amplitude_value[105] = 229; - - test_msg.amplitude_value[106] = 175; - - test_msg.amplitude_value[107] = 145; - - test_msg.amplitude_value[108] = 73; - - test_msg.amplitude_value[109] = 72; - - test_msg.amplitude_value[110] = 124; - - test_msg.amplitude_value[111] = 4; - - test_msg.amplitude_value[112] = 184; - - test_msg.amplitude_value[113] = 228; - - test_msg.amplitude_value[114] = 61; - - test_msg.amplitude_value[115] = 234; - - test_msg.amplitude_value[116] = 218; - - test_msg.amplitude_value[117] = 62; - - test_msg.amplitude_value[118] = 226; - - test_msg.amplitude_value[119] = 217; - - test_msg.amplitude_value[120] = 193; - - test_msg.amplitude_value[121] = 7; - - test_msg.amplitude_value[122] = 109; - - test_msg.amplitude_value[123] = 44; - - test_msg.amplitude_value[124] = 83; - - test_msg.amplitude_value[125] = 201; - - test_msg.amplitude_value[126] = 20; - - test_msg.amplitude_value[127] = 101; - - test_msg.amplitude_value[128] = 9; - - test_msg.amplitude_value[129] = 140; - - test_msg.amplitude_value[130] = 186; - - test_msg.amplitude_value[131] = 162; - - test_msg.amplitude_value[132] = 81; - - test_msg.amplitude_value[133] = 91; - - test_msg.amplitude_value[134] = 30; - - test_msg.amplitude_value[135] = 231; - - test_msg.amplitude_value[136] = 161; - - test_msg.amplitude_value[137] = 81; - - test_msg.amplitude_value[138] = 216; - - test_msg.amplitude_value[139] = 114; - - test_msg.amplitude_value[140] = 60; - - test_msg.amplitude_value[141] = 231; - - test_msg.amplitude_value[142] = 163; - - test_msg.amplitude_value[143] = 163; - - test_msg.amplitude_value[144] = 49; - - test_msg.amplitude_value[145] = 237; - - test_msg.amplitude_value[146] = 244; - - test_msg.amplitude_value[147] = 185; - - test_msg.amplitude_value[148] = 240; - - test_msg.amplitude_value[149] = 89; - - test_msg.amplitude_value[150] = 143; - - test_msg.amplitude_value[151] = 174; - - test_msg.amplitude_value[152] = 165; - - test_msg.amplitude_value[153] = 211; - - test_msg.amplitude_value[154] = 241; - - test_msg.amplitude_value[155] = 13; - - test_msg.amplitude_value[156] = 16; - - test_msg.amplitude_value[157] = 61; - - test_msg.amplitude_value[158] = 141; - - test_msg.amplitude_value[159] = 101; - - test_msg.amplitude_value[160] = 89; - - test_msg.amplitude_value[161] = 37; - - test_msg.amplitude_value[162] = 117; - - test_msg.amplitude_value[163] = 189; - - test_msg.amplitude_value[164] = 86; - - test_msg.amplitude_value[165] = 118; - - test_msg.amplitude_value[166] = 176; - - test_msg.amplitude_value[167] = 228; - - test_msg.amplitude_value[168] = 12; - - test_msg.amplitude_value[169] = 14; - - test_msg.amplitude_value[170] = 119; - - test_msg.amplitude_value[171] = 135; - - test_msg.amplitude_value[172] = 129; - - test_msg.amplitude_value[173] = 243; - - test_msg.amplitude_value[174] = 50; - - test_msg.amplitude_value[175] = 29; - - test_msg.amplitude_value[176] = 207; - - test_msg.amplitude_value[177] = 198; - - test_msg.amplitude_value[178] = 117; - - test_msg.amplitude_value[179] = 100; - - test_msg.amplitude_value[180] = 225; - - test_msg.amplitude_value[181] = 6; - - test_msg.amplitude_value[182] = 139; - - test_msg.amplitude_value[183] = 110; - - test_msg.amplitude_value[184] = 39; - - test_msg.amplitude_value[185] = 210; - - test_msg.amplitude_value[186] = 68; - - test_msg.amplitude_value[187] = 199; - - test_msg.amplitude_value[188] = 43; - - test_msg.amplitude_value[189] = 132; - - test_msg.amplitude_value[190] = 64; - - test_msg.amplitude_value[191] = 17; - - test_msg.amplitude_value[192] = 51; - - test_msg.amplitude_value[193] = 173; - - test_msg.amplitude_value[194] = 181; - - test_msg.amplitude_value[195] = 12; - - test_msg.amplitude_value[196] = 140; - - test_msg.amplitude_value[197] = 16; - - test_msg.amplitude_value[198] = 247; - - test_msg.amplitude_value[199] = 84; - - test_msg.amplitude_value[200] = 183; - - test_msg.amplitude_value[201] = 105; - - test_msg.amplitude_value[202] = 39; - - test_msg.amplitude_value[203] = 157; - - test_msg.amplitude_value[204] = 77; - - test_msg.amplitude_value[205] = 30; - - test_msg.amplitude_value[206] = 205; - - test_msg.amplitude_value[207] = 194; - - test_msg.amplitude_value[208] = 59; - - test_msg.amplitude_value[209] = 64; - - test_msg.amplitude_value[210] = 241; - - test_msg.amplitude_value[211] = 183; - - test_msg.amplitude_value[212] = 238; - - test_msg.amplitude_value[213] = 105; - - test_msg.amplitude_value[214] = 181; - - test_msg.amplitude_value[215] = 170; - - test_msg.amplitude_value[216] = 45; - - test_msg.amplitude_value[217] = 8; - - test_msg.amplitude_value[218] = 166; - - test_msg.amplitude_value[219] = 164; - - test_msg.amplitude_value[220] = 238; - - test_msg.amplitude_value[221] = 83; - - test_msg.amplitude_value[222] = 148; - - test_msg.amplitude_value[223] = 173; - - test_msg.amplitude_value[224] = 108; - - test_msg.amplitude_value[225] = 228; - - test_msg.amplitude_value[226] = 67; - - test_msg.amplitude_value[227] = 89; - - test_msg.amplitude_value[228] = 189; - - test_msg.amplitude_value[229] = 67; - - test_msg.amplitude_value[230] = 26; - test_msg.channel_tag = 5878; - test_msg.freq_ref = 6348.2001953125; - test_msg.freq_step = 4608.2001953125; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_amplitude_value.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)97,(char)109,(char)112,(char)108,(char)105,(char)116,(char)117,(char)100,(char)101,(char)95,(char)118,(char)97,(char)108,(char)117,(char)101 }; - memcpy(test_msg.n_amplitude_value.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_amplitude_value.value = 231; - test_msg.t.tow = 992295133; - test_msg.t.wn = 6957; - - EXPECT_EQ(send_message( 55664, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55664); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_LT((last_msg_.amplitude_ref * 100 - 9349.20019531 * 100), 0.05) << "incorrect value for last_msg_.amplitude_ref, expected 9349.20019531, is " << last_msg_.amplitude_ref; - EXPECT_LT((last_msg_.amplitude_unit * 100 - 3485.19995117 * 100), 0.05) << "incorrect value for last_msg_.amplitude_unit, expected 3485.19995117, is " << last_msg_.amplitude_unit; - EXPECT_EQ(last_msg_.amplitude_value[0], 240) << "incorrect value for last_msg_.amplitude_value[0], expected 240, is " << last_msg_.amplitude_value[0]; - EXPECT_EQ(last_msg_.amplitude_value[1], 14) << "incorrect value for last_msg_.amplitude_value[1], expected 14, is " << last_msg_.amplitude_value[1]; - EXPECT_EQ(last_msg_.amplitude_value[2], 179) << "incorrect value for last_msg_.amplitude_value[2], expected 179, is " << last_msg_.amplitude_value[2]; - EXPECT_EQ(last_msg_.amplitude_value[3], 186) << "incorrect value for last_msg_.amplitude_value[3], expected 186, is " << last_msg_.amplitude_value[3]; - EXPECT_EQ(last_msg_.amplitude_value[4], 227) << "incorrect value for last_msg_.amplitude_value[4], expected 227, is " << last_msg_.amplitude_value[4]; - EXPECT_EQ(last_msg_.amplitude_value[5], 244) << "incorrect value for last_msg_.amplitude_value[5], expected 244, is " << last_msg_.amplitude_value[5]; - EXPECT_EQ(last_msg_.amplitude_value[6], 173) << "incorrect value for last_msg_.amplitude_value[6], expected 173, is " << last_msg_.amplitude_value[6]; - EXPECT_EQ(last_msg_.amplitude_value[7], 240) << "incorrect value for last_msg_.amplitude_value[7], expected 240, is " << last_msg_.amplitude_value[7]; - EXPECT_EQ(last_msg_.amplitude_value[8], 182) << "incorrect value for last_msg_.amplitude_value[8], expected 182, is " << last_msg_.amplitude_value[8]; - EXPECT_EQ(last_msg_.amplitude_value[9], 71) << "incorrect value for last_msg_.amplitude_value[9], expected 71, is " << last_msg_.amplitude_value[9]; - EXPECT_EQ(last_msg_.amplitude_value[10], 166) << "incorrect value for last_msg_.amplitude_value[10], expected 166, is " << last_msg_.amplitude_value[10]; - EXPECT_EQ(last_msg_.amplitude_value[11], 117) << "incorrect value for last_msg_.amplitude_value[11], expected 117, is " << last_msg_.amplitude_value[11]; - EXPECT_EQ(last_msg_.amplitude_value[12], 196) << "incorrect value for last_msg_.amplitude_value[12], expected 196, is " << last_msg_.amplitude_value[12]; - EXPECT_EQ(last_msg_.amplitude_value[13], 13) << "incorrect value for last_msg_.amplitude_value[13], expected 13, is " << last_msg_.amplitude_value[13]; - EXPECT_EQ(last_msg_.amplitude_value[14], 44) << "incorrect value for last_msg_.amplitude_value[14], expected 44, is " << last_msg_.amplitude_value[14]; - EXPECT_EQ(last_msg_.amplitude_value[15], 27) << "incorrect value for last_msg_.amplitude_value[15], expected 27, is " << last_msg_.amplitude_value[15]; - EXPECT_EQ(last_msg_.amplitude_value[16], 33) << "incorrect value for last_msg_.amplitude_value[16], expected 33, is " << last_msg_.amplitude_value[16]; - EXPECT_EQ(last_msg_.amplitude_value[17], 28) << "incorrect value for last_msg_.amplitude_value[17], expected 28, is " << last_msg_.amplitude_value[17]; - EXPECT_EQ(last_msg_.amplitude_value[18], 67) << "incorrect value for last_msg_.amplitude_value[18], expected 67, is " << last_msg_.amplitude_value[18]; - EXPECT_EQ(last_msg_.amplitude_value[19], 254) << "incorrect value for last_msg_.amplitude_value[19], expected 254, is " << last_msg_.amplitude_value[19]; - EXPECT_EQ(last_msg_.amplitude_value[20], 3) << "incorrect value for last_msg_.amplitude_value[20], expected 3, is " << last_msg_.amplitude_value[20]; - EXPECT_EQ(last_msg_.amplitude_value[21], 249) << "incorrect value for last_msg_.amplitude_value[21], expected 249, is " << last_msg_.amplitude_value[21]; - EXPECT_EQ(last_msg_.amplitude_value[22], 92) << "incorrect value for last_msg_.amplitude_value[22], expected 92, is " << last_msg_.amplitude_value[22]; - EXPECT_EQ(last_msg_.amplitude_value[23], 44) << "incorrect value for last_msg_.amplitude_value[23], expected 44, is " << last_msg_.amplitude_value[23]; - EXPECT_EQ(last_msg_.amplitude_value[24], 122) << "incorrect value for last_msg_.amplitude_value[24], expected 122, is " << last_msg_.amplitude_value[24]; - EXPECT_EQ(last_msg_.amplitude_value[25], 169) << "incorrect value for last_msg_.amplitude_value[25], expected 169, is " << last_msg_.amplitude_value[25]; - EXPECT_EQ(last_msg_.amplitude_value[26], 77) << "incorrect value for last_msg_.amplitude_value[26], expected 77, is " << last_msg_.amplitude_value[26]; - EXPECT_EQ(last_msg_.amplitude_value[27], 186) << "incorrect value for last_msg_.amplitude_value[27], expected 186, is " << last_msg_.amplitude_value[27]; - EXPECT_EQ(last_msg_.amplitude_value[28], 68) << "incorrect value for last_msg_.amplitude_value[28], expected 68, is " << last_msg_.amplitude_value[28]; - EXPECT_EQ(last_msg_.amplitude_value[29], 135) << "incorrect value for last_msg_.amplitude_value[29], expected 135, is " << last_msg_.amplitude_value[29]; - EXPECT_EQ(last_msg_.amplitude_value[30], 63) << "incorrect value for last_msg_.amplitude_value[30], expected 63, is " << last_msg_.amplitude_value[30]; - EXPECT_EQ(last_msg_.amplitude_value[31], 168) << "incorrect value for last_msg_.amplitude_value[31], expected 168, is " << last_msg_.amplitude_value[31]; - EXPECT_EQ(last_msg_.amplitude_value[32], 162) << "incorrect value for last_msg_.amplitude_value[32], expected 162, is " << last_msg_.amplitude_value[32]; - EXPECT_EQ(last_msg_.amplitude_value[33], 89) << "incorrect value for last_msg_.amplitude_value[33], expected 89, is " << last_msg_.amplitude_value[33]; - EXPECT_EQ(last_msg_.amplitude_value[34], 36) << "incorrect value for last_msg_.amplitude_value[34], expected 36, is " << last_msg_.amplitude_value[34]; - EXPECT_EQ(last_msg_.amplitude_value[35], 186) << "incorrect value for last_msg_.amplitude_value[35], expected 186, is " << last_msg_.amplitude_value[35]; - EXPECT_EQ(last_msg_.amplitude_value[36], 99) << "incorrect value for last_msg_.amplitude_value[36], expected 99, is " << last_msg_.amplitude_value[36]; - EXPECT_EQ(last_msg_.amplitude_value[37], 63) << "incorrect value for last_msg_.amplitude_value[37], expected 63, is " << last_msg_.amplitude_value[37]; - EXPECT_EQ(last_msg_.amplitude_value[38], 105) << "incorrect value for last_msg_.amplitude_value[38], expected 105, is " << last_msg_.amplitude_value[38]; - EXPECT_EQ(last_msg_.amplitude_value[39], 116) << "incorrect value for last_msg_.amplitude_value[39], expected 116, is " << last_msg_.amplitude_value[39]; - EXPECT_EQ(last_msg_.amplitude_value[40], 216) << "incorrect value for last_msg_.amplitude_value[40], expected 216, is " << last_msg_.amplitude_value[40]; - EXPECT_EQ(last_msg_.amplitude_value[41], 44) << "incorrect value for last_msg_.amplitude_value[41], expected 44, is " << last_msg_.amplitude_value[41]; - EXPECT_EQ(last_msg_.amplitude_value[42], 67) << "incorrect value for last_msg_.amplitude_value[42], expected 67, is " << last_msg_.amplitude_value[42]; - EXPECT_EQ(last_msg_.amplitude_value[43], 212) << "incorrect value for last_msg_.amplitude_value[43], expected 212, is " << last_msg_.amplitude_value[43]; - EXPECT_EQ(last_msg_.amplitude_value[44], 156) << "incorrect value for last_msg_.amplitude_value[44], expected 156, is " << last_msg_.amplitude_value[44]; - EXPECT_EQ(last_msg_.amplitude_value[45], 75) << "incorrect value for last_msg_.amplitude_value[45], expected 75, is " << last_msg_.amplitude_value[45]; - EXPECT_EQ(last_msg_.amplitude_value[46], 81) << "incorrect value for last_msg_.amplitude_value[46], expected 81, is " << last_msg_.amplitude_value[46]; - EXPECT_EQ(last_msg_.amplitude_value[47], 53) << "incorrect value for last_msg_.amplitude_value[47], expected 53, is " << last_msg_.amplitude_value[47]; - EXPECT_EQ(last_msg_.amplitude_value[48], 250) << "incorrect value for last_msg_.amplitude_value[48], expected 250, is " << last_msg_.amplitude_value[48]; - EXPECT_EQ(last_msg_.amplitude_value[49], 225) << "incorrect value for last_msg_.amplitude_value[49], expected 225, is " << last_msg_.amplitude_value[49]; - EXPECT_EQ(last_msg_.amplitude_value[50], 23) << "incorrect value for last_msg_.amplitude_value[50], expected 23, is " << last_msg_.amplitude_value[50]; - EXPECT_EQ(last_msg_.amplitude_value[51], 205) << "incorrect value for last_msg_.amplitude_value[51], expected 205, is " << last_msg_.amplitude_value[51]; - EXPECT_EQ(last_msg_.amplitude_value[52], 26) << "incorrect value for last_msg_.amplitude_value[52], expected 26, is " << last_msg_.amplitude_value[52]; - EXPECT_EQ(last_msg_.amplitude_value[53], 34) << "incorrect value for last_msg_.amplitude_value[53], expected 34, is " << last_msg_.amplitude_value[53]; - EXPECT_EQ(last_msg_.amplitude_value[54], 119) << "incorrect value for last_msg_.amplitude_value[54], expected 119, is " << last_msg_.amplitude_value[54]; - EXPECT_EQ(last_msg_.amplitude_value[55], 50) << "incorrect value for last_msg_.amplitude_value[55], expected 50, is " << last_msg_.amplitude_value[55]; - EXPECT_EQ(last_msg_.amplitude_value[56], 101) << "incorrect value for last_msg_.amplitude_value[56], expected 101, is " << last_msg_.amplitude_value[56]; - EXPECT_EQ(last_msg_.amplitude_value[57], 64) << "incorrect value for last_msg_.amplitude_value[57], expected 64, is " << last_msg_.amplitude_value[57]; - EXPECT_EQ(last_msg_.amplitude_value[58], 7) << "incorrect value for last_msg_.amplitude_value[58], expected 7, is " << last_msg_.amplitude_value[58]; - EXPECT_EQ(last_msg_.amplitude_value[59], 231) << "incorrect value for last_msg_.amplitude_value[59], expected 231, is " << last_msg_.amplitude_value[59]; - EXPECT_EQ(last_msg_.amplitude_value[60], 124) << "incorrect value for last_msg_.amplitude_value[60], expected 124, is " << last_msg_.amplitude_value[60]; - EXPECT_EQ(last_msg_.amplitude_value[61], 183) << "incorrect value for last_msg_.amplitude_value[61], expected 183, is " << last_msg_.amplitude_value[61]; - EXPECT_EQ(last_msg_.amplitude_value[62], 203) << "incorrect value for last_msg_.amplitude_value[62], expected 203, is " << last_msg_.amplitude_value[62]; - EXPECT_EQ(last_msg_.amplitude_value[63], 102) << "incorrect value for last_msg_.amplitude_value[63], expected 102, is " << last_msg_.amplitude_value[63]; - EXPECT_EQ(last_msg_.amplitude_value[64], 234) << "incorrect value for last_msg_.amplitude_value[64], expected 234, is " << last_msg_.amplitude_value[64]; - EXPECT_EQ(last_msg_.amplitude_value[65], 84) << "incorrect value for last_msg_.amplitude_value[65], expected 84, is " << last_msg_.amplitude_value[65]; - EXPECT_EQ(last_msg_.amplitude_value[66], 83) << "incorrect value for last_msg_.amplitude_value[66], expected 83, is " << last_msg_.amplitude_value[66]; - EXPECT_EQ(last_msg_.amplitude_value[67], 208) << "incorrect value for last_msg_.amplitude_value[67], expected 208, is " << last_msg_.amplitude_value[67]; - EXPECT_EQ(last_msg_.amplitude_value[68], 23) << "incorrect value for last_msg_.amplitude_value[68], expected 23, is " << last_msg_.amplitude_value[68]; - EXPECT_EQ(last_msg_.amplitude_value[69], 68) << "incorrect value for last_msg_.amplitude_value[69], expected 68, is " << last_msg_.amplitude_value[69]; - EXPECT_EQ(last_msg_.amplitude_value[70], 54) << "incorrect value for last_msg_.amplitude_value[70], expected 54, is " << last_msg_.amplitude_value[70]; - EXPECT_EQ(last_msg_.amplitude_value[71], 179) << "incorrect value for last_msg_.amplitude_value[71], expected 179, is " << last_msg_.amplitude_value[71]; - EXPECT_EQ(last_msg_.amplitude_value[72], 98) << "incorrect value for last_msg_.amplitude_value[72], expected 98, is " << last_msg_.amplitude_value[72]; - EXPECT_EQ(last_msg_.amplitude_value[73], 96) << "incorrect value for last_msg_.amplitude_value[73], expected 96, is " << last_msg_.amplitude_value[73]; - EXPECT_EQ(last_msg_.amplitude_value[74], 116) << "incorrect value for last_msg_.amplitude_value[74], expected 116, is " << last_msg_.amplitude_value[74]; - EXPECT_EQ(last_msg_.amplitude_value[75], 244) << "incorrect value for last_msg_.amplitude_value[75], expected 244, is " << last_msg_.amplitude_value[75]; - EXPECT_EQ(last_msg_.amplitude_value[76], 246) << "incorrect value for last_msg_.amplitude_value[76], expected 246, is " << last_msg_.amplitude_value[76]; - EXPECT_EQ(last_msg_.amplitude_value[77], 94) << "incorrect value for last_msg_.amplitude_value[77], expected 94, is " << last_msg_.amplitude_value[77]; - EXPECT_EQ(last_msg_.amplitude_value[78], 104) << "incorrect value for last_msg_.amplitude_value[78], expected 104, is " << last_msg_.amplitude_value[78]; - EXPECT_EQ(last_msg_.amplitude_value[79], 94) << "incorrect value for last_msg_.amplitude_value[79], expected 94, is " << last_msg_.amplitude_value[79]; - EXPECT_EQ(last_msg_.amplitude_value[80], 13) << "incorrect value for last_msg_.amplitude_value[80], expected 13, is " << last_msg_.amplitude_value[80]; - EXPECT_EQ(last_msg_.amplitude_value[81], 56) << "incorrect value for last_msg_.amplitude_value[81], expected 56, is " << last_msg_.amplitude_value[81]; - EXPECT_EQ(last_msg_.amplitude_value[82], 210) << "incorrect value for last_msg_.amplitude_value[82], expected 210, is " << last_msg_.amplitude_value[82]; - EXPECT_EQ(last_msg_.amplitude_value[83], 18) << "incorrect value for last_msg_.amplitude_value[83], expected 18, is " << last_msg_.amplitude_value[83]; - EXPECT_EQ(last_msg_.amplitude_value[84], 191) << "incorrect value for last_msg_.amplitude_value[84], expected 191, is " << last_msg_.amplitude_value[84]; - EXPECT_EQ(last_msg_.amplitude_value[85], 22) << "incorrect value for last_msg_.amplitude_value[85], expected 22, is " << last_msg_.amplitude_value[85]; - EXPECT_EQ(last_msg_.amplitude_value[86], 133) << "incorrect value for last_msg_.amplitude_value[86], expected 133, is " << last_msg_.amplitude_value[86]; - EXPECT_EQ(last_msg_.amplitude_value[87], 81) << "incorrect value for last_msg_.amplitude_value[87], expected 81, is " << last_msg_.amplitude_value[87]; - EXPECT_EQ(last_msg_.amplitude_value[88], 153) << "incorrect value for last_msg_.amplitude_value[88], expected 153, is " << last_msg_.amplitude_value[88]; - EXPECT_EQ(last_msg_.amplitude_value[89], 159) << "incorrect value for last_msg_.amplitude_value[89], expected 159, is " << last_msg_.amplitude_value[89]; - EXPECT_EQ(last_msg_.amplitude_value[90], 161) << "incorrect value for last_msg_.amplitude_value[90], expected 161, is " << last_msg_.amplitude_value[90]; - EXPECT_EQ(last_msg_.amplitude_value[91], 219) << "incorrect value for last_msg_.amplitude_value[91], expected 219, is " << last_msg_.amplitude_value[91]; - EXPECT_EQ(last_msg_.amplitude_value[92], 59) << "incorrect value for last_msg_.amplitude_value[92], expected 59, is " << last_msg_.amplitude_value[92]; - EXPECT_EQ(last_msg_.amplitude_value[93], 21) << "incorrect value for last_msg_.amplitude_value[93], expected 21, is " << last_msg_.amplitude_value[93]; - EXPECT_EQ(last_msg_.amplitude_value[94], 164) << "incorrect value for last_msg_.amplitude_value[94], expected 164, is " << last_msg_.amplitude_value[94]; - EXPECT_EQ(last_msg_.amplitude_value[95], 121) << "incorrect value for last_msg_.amplitude_value[95], expected 121, is " << last_msg_.amplitude_value[95]; - EXPECT_EQ(last_msg_.amplitude_value[96], 145) << "incorrect value for last_msg_.amplitude_value[96], expected 145, is " << last_msg_.amplitude_value[96]; - EXPECT_EQ(last_msg_.amplitude_value[97], 203) << "incorrect value for last_msg_.amplitude_value[97], expected 203, is " << last_msg_.amplitude_value[97]; - EXPECT_EQ(last_msg_.amplitude_value[98], 171) << "incorrect value for last_msg_.amplitude_value[98], expected 171, is " << last_msg_.amplitude_value[98]; - EXPECT_EQ(last_msg_.amplitude_value[99], 132) << "incorrect value for last_msg_.amplitude_value[99], expected 132, is " << last_msg_.amplitude_value[99]; - EXPECT_EQ(last_msg_.amplitude_value[100], 57) << "incorrect value for last_msg_.amplitude_value[100], expected 57, is " << last_msg_.amplitude_value[100]; - EXPECT_EQ(last_msg_.amplitude_value[101], 180) << "incorrect value for last_msg_.amplitude_value[101], expected 180, is " << last_msg_.amplitude_value[101]; - EXPECT_EQ(last_msg_.amplitude_value[102], 102) << "incorrect value for last_msg_.amplitude_value[102], expected 102, is " << last_msg_.amplitude_value[102]; - EXPECT_EQ(last_msg_.amplitude_value[103], 101) << "incorrect value for last_msg_.amplitude_value[103], expected 101, is " << last_msg_.amplitude_value[103]; - EXPECT_EQ(last_msg_.amplitude_value[104], 11) << "incorrect value for last_msg_.amplitude_value[104], expected 11, is " << last_msg_.amplitude_value[104]; - EXPECT_EQ(last_msg_.amplitude_value[105], 229) << "incorrect value for last_msg_.amplitude_value[105], expected 229, is " << last_msg_.amplitude_value[105]; - EXPECT_EQ(last_msg_.amplitude_value[106], 175) << "incorrect value for last_msg_.amplitude_value[106], expected 175, is " << last_msg_.amplitude_value[106]; - EXPECT_EQ(last_msg_.amplitude_value[107], 145) << "incorrect value for last_msg_.amplitude_value[107], expected 145, is " << last_msg_.amplitude_value[107]; - EXPECT_EQ(last_msg_.amplitude_value[108], 73) << "incorrect value for last_msg_.amplitude_value[108], expected 73, is " << last_msg_.amplitude_value[108]; - EXPECT_EQ(last_msg_.amplitude_value[109], 72) << "incorrect value for last_msg_.amplitude_value[109], expected 72, is " << last_msg_.amplitude_value[109]; - EXPECT_EQ(last_msg_.amplitude_value[110], 124) << "incorrect value for last_msg_.amplitude_value[110], expected 124, is " << last_msg_.amplitude_value[110]; - EXPECT_EQ(last_msg_.amplitude_value[111], 4) << "incorrect value for last_msg_.amplitude_value[111], expected 4, is " << last_msg_.amplitude_value[111]; - EXPECT_EQ(last_msg_.amplitude_value[112], 184) << "incorrect value for last_msg_.amplitude_value[112], expected 184, is " << last_msg_.amplitude_value[112]; - EXPECT_EQ(last_msg_.amplitude_value[113], 228) << "incorrect value for last_msg_.amplitude_value[113], expected 228, is " << last_msg_.amplitude_value[113]; - EXPECT_EQ(last_msg_.amplitude_value[114], 61) << "incorrect value for last_msg_.amplitude_value[114], expected 61, is " << last_msg_.amplitude_value[114]; - EXPECT_EQ(last_msg_.amplitude_value[115], 234) << "incorrect value for last_msg_.amplitude_value[115], expected 234, is " << last_msg_.amplitude_value[115]; - EXPECT_EQ(last_msg_.amplitude_value[116], 218) << "incorrect value for last_msg_.amplitude_value[116], expected 218, is " << last_msg_.amplitude_value[116]; - EXPECT_EQ(last_msg_.amplitude_value[117], 62) << "incorrect value for last_msg_.amplitude_value[117], expected 62, is " << last_msg_.amplitude_value[117]; - EXPECT_EQ(last_msg_.amplitude_value[118], 226) << "incorrect value for last_msg_.amplitude_value[118], expected 226, is " << last_msg_.amplitude_value[118]; - EXPECT_EQ(last_msg_.amplitude_value[119], 217) << "incorrect value for last_msg_.amplitude_value[119], expected 217, is " << last_msg_.amplitude_value[119]; - EXPECT_EQ(last_msg_.amplitude_value[120], 193) << "incorrect value for last_msg_.amplitude_value[120], expected 193, is " << last_msg_.amplitude_value[120]; - EXPECT_EQ(last_msg_.amplitude_value[121], 7) << "incorrect value for last_msg_.amplitude_value[121], expected 7, is " << last_msg_.amplitude_value[121]; - EXPECT_EQ(last_msg_.amplitude_value[122], 109) << "incorrect value for last_msg_.amplitude_value[122], expected 109, is " << last_msg_.amplitude_value[122]; - EXPECT_EQ(last_msg_.amplitude_value[123], 44) << "incorrect value for last_msg_.amplitude_value[123], expected 44, is " << last_msg_.amplitude_value[123]; - EXPECT_EQ(last_msg_.amplitude_value[124], 83) << "incorrect value for last_msg_.amplitude_value[124], expected 83, is " << last_msg_.amplitude_value[124]; - EXPECT_EQ(last_msg_.amplitude_value[125], 201) << "incorrect value for last_msg_.amplitude_value[125], expected 201, is " << last_msg_.amplitude_value[125]; - EXPECT_EQ(last_msg_.amplitude_value[126], 20) << "incorrect value for last_msg_.amplitude_value[126], expected 20, is " << last_msg_.amplitude_value[126]; - EXPECT_EQ(last_msg_.amplitude_value[127], 101) << "incorrect value for last_msg_.amplitude_value[127], expected 101, is " << last_msg_.amplitude_value[127]; - EXPECT_EQ(last_msg_.amplitude_value[128], 9) << "incorrect value for last_msg_.amplitude_value[128], expected 9, is " << last_msg_.amplitude_value[128]; - EXPECT_EQ(last_msg_.amplitude_value[129], 140) << "incorrect value for last_msg_.amplitude_value[129], expected 140, is " << last_msg_.amplitude_value[129]; - EXPECT_EQ(last_msg_.amplitude_value[130], 186) << "incorrect value for last_msg_.amplitude_value[130], expected 186, is " << last_msg_.amplitude_value[130]; - EXPECT_EQ(last_msg_.amplitude_value[131], 162) << "incorrect value for last_msg_.amplitude_value[131], expected 162, is " << last_msg_.amplitude_value[131]; - EXPECT_EQ(last_msg_.amplitude_value[132], 81) << "incorrect value for last_msg_.amplitude_value[132], expected 81, is " << last_msg_.amplitude_value[132]; - EXPECT_EQ(last_msg_.amplitude_value[133], 91) << "incorrect value for last_msg_.amplitude_value[133], expected 91, is " << last_msg_.amplitude_value[133]; - EXPECT_EQ(last_msg_.amplitude_value[134], 30) << "incorrect value for last_msg_.amplitude_value[134], expected 30, is " << last_msg_.amplitude_value[134]; - EXPECT_EQ(last_msg_.amplitude_value[135], 231) << "incorrect value for last_msg_.amplitude_value[135], expected 231, is " << last_msg_.amplitude_value[135]; - EXPECT_EQ(last_msg_.amplitude_value[136], 161) << "incorrect value for last_msg_.amplitude_value[136], expected 161, is " << last_msg_.amplitude_value[136]; - EXPECT_EQ(last_msg_.amplitude_value[137], 81) << "incorrect value for last_msg_.amplitude_value[137], expected 81, is " << last_msg_.amplitude_value[137]; - EXPECT_EQ(last_msg_.amplitude_value[138], 216) << "incorrect value for last_msg_.amplitude_value[138], expected 216, is " << last_msg_.amplitude_value[138]; - EXPECT_EQ(last_msg_.amplitude_value[139], 114) << "incorrect value for last_msg_.amplitude_value[139], expected 114, is " << last_msg_.amplitude_value[139]; - EXPECT_EQ(last_msg_.amplitude_value[140], 60) << "incorrect value for last_msg_.amplitude_value[140], expected 60, is " << last_msg_.amplitude_value[140]; - EXPECT_EQ(last_msg_.amplitude_value[141], 231) << "incorrect value for last_msg_.amplitude_value[141], expected 231, is " << last_msg_.amplitude_value[141]; - EXPECT_EQ(last_msg_.amplitude_value[142], 163) << "incorrect value for last_msg_.amplitude_value[142], expected 163, is " << last_msg_.amplitude_value[142]; - EXPECT_EQ(last_msg_.amplitude_value[143], 163) << "incorrect value for last_msg_.amplitude_value[143], expected 163, is " << last_msg_.amplitude_value[143]; - EXPECT_EQ(last_msg_.amplitude_value[144], 49) << "incorrect value for last_msg_.amplitude_value[144], expected 49, is " << last_msg_.amplitude_value[144]; - EXPECT_EQ(last_msg_.amplitude_value[145], 237) << "incorrect value for last_msg_.amplitude_value[145], expected 237, is " << last_msg_.amplitude_value[145]; - EXPECT_EQ(last_msg_.amplitude_value[146], 244) << "incorrect value for last_msg_.amplitude_value[146], expected 244, is " << last_msg_.amplitude_value[146]; - EXPECT_EQ(last_msg_.amplitude_value[147], 185) << "incorrect value for last_msg_.amplitude_value[147], expected 185, is " << last_msg_.amplitude_value[147]; - EXPECT_EQ(last_msg_.amplitude_value[148], 240) << "incorrect value for last_msg_.amplitude_value[148], expected 240, is " << last_msg_.amplitude_value[148]; - EXPECT_EQ(last_msg_.amplitude_value[149], 89) << "incorrect value for last_msg_.amplitude_value[149], expected 89, is " << last_msg_.amplitude_value[149]; - EXPECT_EQ(last_msg_.amplitude_value[150], 143) << "incorrect value for last_msg_.amplitude_value[150], expected 143, is " << last_msg_.amplitude_value[150]; - EXPECT_EQ(last_msg_.amplitude_value[151], 174) << "incorrect value for last_msg_.amplitude_value[151], expected 174, is " << last_msg_.amplitude_value[151]; - EXPECT_EQ(last_msg_.amplitude_value[152], 165) << "incorrect value for last_msg_.amplitude_value[152], expected 165, is " << last_msg_.amplitude_value[152]; - EXPECT_EQ(last_msg_.amplitude_value[153], 211) << "incorrect value for last_msg_.amplitude_value[153], expected 211, is " << last_msg_.amplitude_value[153]; - EXPECT_EQ(last_msg_.amplitude_value[154], 241) << "incorrect value for last_msg_.amplitude_value[154], expected 241, is " << last_msg_.amplitude_value[154]; - EXPECT_EQ(last_msg_.amplitude_value[155], 13) << "incorrect value for last_msg_.amplitude_value[155], expected 13, is " << last_msg_.amplitude_value[155]; - EXPECT_EQ(last_msg_.amplitude_value[156], 16) << "incorrect value for last_msg_.amplitude_value[156], expected 16, is " << last_msg_.amplitude_value[156]; - EXPECT_EQ(last_msg_.amplitude_value[157], 61) << "incorrect value for last_msg_.amplitude_value[157], expected 61, is " << last_msg_.amplitude_value[157]; - EXPECT_EQ(last_msg_.amplitude_value[158], 141) << "incorrect value for last_msg_.amplitude_value[158], expected 141, is " << last_msg_.amplitude_value[158]; - EXPECT_EQ(last_msg_.amplitude_value[159], 101) << "incorrect value for last_msg_.amplitude_value[159], expected 101, is " << last_msg_.amplitude_value[159]; - EXPECT_EQ(last_msg_.amplitude_value[160], 89) << "incorrect value for last_msg_.amplitude_value[160], expected 89, is " << last_msg_.amplitude_value[160]; - EXPECT_EQ(last_msg_.amplitude_value[161], 37) << "incorrect value for last_msg_.amplitude_value[161], expected 37, is " << last_msg_.amplitude_value[161]; - EXPECT_EQ(last_msg_.amplitude_value[162], 117) << "incorrect value for last_msg_.amplitude_value[162], expected 117, is " << last_msg_.amplitude_value[162]; - EXPECT_EQ(last_msg_.amplitude_value[163], 189) << "incorrect value for last_msg_.amplitude_value[163], expected 189, is " << last_msg_.amplitude_value[163]; - EXPECT_EQ(last_msg_.amplitude_value[164], 86) << "incorrect value for last_msg_.amplitude_value[164], expected 86, is " << last_msg_.amplitude_value[164]; - EXPECT_EQ(last_msg_.amplitude_value[165], 118) << "incorrect value for last_msg_.amplitude_value[165], expected 118, is " << last_msg_.amplitude_value[165]; - EXPECT_EQ(last_msg_.amplitude_value[166], 176) << "incorrect value for last_msg_.amplitude_value[166], expected 176, is " << last_msg_.amplitude_value[166]; - EXPECT_EQ(last_msg_.amplitude_value[167], 228) << "incorrect value for last_msg_.amplitude_value[167], expected 228, is " << last_msg_.amplitude_value[167]; - EXPECT_EQ(last_msg_.amplitude_value[168], 12) << "incorrect value for last_msg_.amplitude_value[168], expected 12, is " << last_msg_.amplitude_value[168]; - EXPECT_EQ(last_msg_.amplitude_value[169], 14) << "incorrect value for last_msg_.amplitude_value[169], expected 14, is " << last_msg_.amplitude_value[169]; - EXPECT_EQ(last_msg_.amplitude_value[170], 119) << "incorrect value for last_msg_.amplitude_value[170], expected 119, is " << last_msg_.amplitude_value[170]; - EXPECT_EQ(last_msg_.amplitude_value[171], 135) << "incorrect value for last_msg_.amplitude_value[171], expected 135, is " << last_msg_.amplitude_value[171]; - EXPECT_EQ(last_msg_.amplitude_value[172], 129) << "incorrect value for last_msg_.amplitude_value[172], expected 129, is " << last_msg_.amplitude_value[172]; - EXPECT_EQ(last_msg_.amplitude_value[173], 243) << "incorrect value for last_msg_.amplitude_value[173], expected 243, is " << last_msg_.amplitude_value[173]; - EXPECT_EQ(last_msg_.amplitude_value[174], 50) << "incorrect value for last_msg_.amplitude_value[174], expected 50, is " << last_msg_.amplitude_value[174]; - EXPECT_EQ(last_msg_.amplitude_value[175], 29) << "incorrect value for last_msg_.amplitude_value[175], expected 29, is " << last_msg_.amplitude_value[175]; - EXPECT_EQ(last_msg_.amplitude_value[176], 207) << "incorrect value for last_msg_.amplitude_value[176], expected 207, is " << last_msg_.amplitude_value[176]; - EXPECT_EQ(last_msg_.amplitude_value[177], 198) << "incorrect value for last_msg_.amplitude_value[177], expected 198, is " << last_msg_.amplitude_value[177]; - EXPECT_EQ(last_msg_.amplitude_value[178], 117) << "incorrect value for last_msg_.amplitude_value[178], expected 117, is " << last_msg_.amplitude_value[178]; - EXPECT_EQ(last_msg_.amplitude_value[179], 100) << "incorrect value for last_msg_.amplitude_value[179], expected 100, is " << last_msg_.amplitude_value[179]; - EXPECT_EQ(last_msg_.amplitude_value[180], 225) << "incorrect value for last_msg_.amplitude_value[180], expected 225, is " << last_msg_.amplitude_value[180]; - EXPECT_EQ(last_msg_.amplitude_value[181], 6) << "incorrect value for last_msg_.amplitude_value[181], expected 6, is " << last_msg_.amplitude_value[181]; - EXPECT_EQ(last_msg_.amplitude_value[182], 139) << "incorrect value for last_msg_.amplitude_value[182], expected 139, is " << last_msg_.amplitude_value[182]; - EXPECT_EQ(last_msg_.amplitude_value[183], 110) << "incorrect value for last_msg_.amplitude_value[183], expected 110, is " << last_msg_.amplitude_value[183]; - EXPECT_EQ(last_msg_.amplitude_value[184], 39) << "incorrect value for last_msg_.amplitude_value[184], expected 39, is " << last_msg_.amplitude_value[184]; - EXPECT_EQ(last_msg_.amplitude_value[185], 210) << "incorrect value for last_msg_.amplitude_value[185], expected 210, is " << last_msg_.amplitude_value[185]; - EXPECT_EQ(last_msg_.amplitude_value[186], 68) << "incorrect value for last_msg_.amplitude_value[186], expected 68, is " << last_msg_.amplitude_value[186]; - EXPECT_EQ(last_msg_.amplitude_value[187], 199) << "incorrect value for last_msg_.amplitude_value[187], expected 199, is " << last_msg_.amplitude_value[187]; - EXPECT_EQ(last_msg_.amplitude_value[188], 43) << "incorrect value for last_msg_.amplitude_value[188], expected 43, is " << last_msg_.amplitude_value[188]; - EXPECT_EQ(last_msg_.amplitude_value[189], 132) << "incorrect value for last_msg_.amplitude_value[189], expected 132, is " << last_msg_.amplitude_value[189]; - EXPECT_EQ(last_msg_.amplitude_value[190], 64) << "incorrect value for last_msg_.amplitude_value[190], expected 64, is " << last_msg_.amplitude_value[190]; - EXPECT_EQ(last_msg_.amplitude_value[191], 17) << "incorrect value for last_msg_.amplitude_value[191], expected 17, is " << last_msg_.amplitude_value[191]; - EXPECT_EQ(last_msg_.amplitude_value[192], 51) << "incorrect value for last_msg_.amplitude_value[192], expected 51, is " << last_msg_.amplitude_value[192]; - EXPECT_EQ(last_msg_.amplitude_value[193], 173) << "incorrect value for last_msg_.amplitude_value[193], expected 173, is " << last_msg_.amplitude_value[193]; - EXPECT_EQ(last_msg_.amplitude_value[194], 181) << "incorrect value for last_msg_.amplitude_value[194], expected 181, is " << last_msg_.amplitude_value[194]; - EXPECT_EQ(last_msg_.amplitude_value[195], 12) << "incorrect value for last_msg_.amplitude_value[195], expected 12, is " << last_msg_.amplitude_value[195]; - EXPECT_EQ(last_msg_.amplitude_value[196], 140) << "incorrect value for last_msg_.amplitude_value[196], expected 140, is " << last_msg_.amplitude_value[196]; - EXPECT_EQ(last_msg_.amplitude_value[197], 16) << "incorrect value for last_msg_.amplitude_value[197], expected 16, is " << last_msg_.amplitude_value[197]; - EXPECT_EQ(last_msg_.amplitude_value[198], 247) << "incorrect value for last_msg_.amplitude_value[198], expected 247, is " << last_msg_.amplitude_value[198]; - EXPECT_EQ(last_msg_.amplitude_value[199], 84) << "incorrect value for last_msg_.amplitude_value[199], expected 84, is " << last_msg_.amplitude_value[199]; - EXPECT_EQ(last_msg_.amplitude_value[200], 183) << "incorrect value for last_msg_.amplitude_value[200], expected 183, is " << last_msg_.amplitude_value[200]; - EXPECT_EQ(last_msg_.amplitude_value[201], 105) << "incorrect value for last_msg_.amplitude_value[201], expected 105, is " << last_msg_.amplitude_value[201]; - EXPECT_EQ(last_msg_.amplitude_value[202], 39) << "incorrect value for last_msg_.amplitude_value[202], expected 39, is " << last_msg_.amplitude_value[202]; - EXPECT_EQ(last_msg_.amplitude_value[203], 157) << "incorrect value for last_msg_.amplitude_value[203], expected 157, is " << last_msg_.amplitude_value[203]; - EXPECT_EQ(last_msg_.amplitude_value[204], 77) << "incorrect value for last_msg_.amplitude_value[204], expected 77, is " << last_msg_.amplitude_value[204]; - EXPECT_EQ(last_msg_.amplitude_value[205], 30) << "incorrect value for last_msg_.amplitude_value[205], expected 30, is " << last_msg_.amplitude_value[205]; - EXPECT_EQ(last_msg_.amplitude_value[206], 205) << "incorrect value for last_msg_.amplitude_value[206], expected 205, is " << last_msg_.amplitude_value[206]; - EXPECT_EQ(last_msg_.amplitude_value[207], 194) << "incorrect value for last_msg_.amplitude_value[207], expected 194, is " << last_msg_.amplitude_value[207]; - EXPECT_EQ(last_msg_.amplitude_value[208], 59) << "incorrect value for last_msg_.amplitude_value[208], expected 59, is " << last_msg_.amplitude_value[208]; - EXPECT_EQ(last_msg_.amplitude_value[209], 64) << "incorrect value for last_msg_.amplitude_value[209], expected 64, is " << last_msg_.amplitude_value[209]; - EXPECT_EQ(last_msg_.amplitude_value[210], 241) << "incorrect value for last_msg_.amplitude_value[210], expected 241, is " << last_msg_.amplitude_value[210]; - EXPECT_EQ(last_msg_.amplitude_value[211], 183) << "incorrect value for last_msg_.amplitude_value[211], expected 183, is " << last_msg_.amplitude_value[211]; - EXPECT_EQ(last_msg_.amplitude_value[212], 238) << "incorrect value for last_msg_.amplitude_value[212], expected 238, is " << last_msg_.amplitude_value[212]; - EXPECT_EQ(last_msg_.amplitude_value[213], 105) << "incorrect value for last_msg_.amplitude_value[213], expected 105, is " << last_msg_.amplitude_value[213]; - EXPECT_EQ(last_msg_.amplitude_value[214], 181) << "incorrect value for last_msg_.amplitude_value[214], expected 181, is " << last_msg_.amplitude_value[214]; - EXPECT_EQ(last_msg_.amplitude_value[215], 170) << "incorrect value for last_msg_.amplitude_value[215], expected 170, is " << last_msg_.amplitude_value[215]; - EXPECT_EQ(last_msg_.amplitude_value[216], 45) << "incorrect value for last_msg_.amplitude_value[216], expected 45, is " << last_msg_.amplitude_value[216]; - EXPECT_EQ(last_msg_.amplitude_value[217], 8) << "incorrect value for last_msg_.amplitude_value[217], expected 8, is " << last_msg_.amplitude_value[217]; - EXPECT_EQ(last_msg_.amplitude_value[218], 166) << "incorrect value for last_msg_.amplitude_value[218], expected 166, is " << last_msg_.amplitude_value[218]; - EXPECT_EQ(last_msg_.amplitude_value[219], 164) << "incorrect value for last_msg_.amplitude_value[219], expected 164, is " << last_msg_.amplitude_value[219]; - EXPECT_EQ(last_msg_.amplitude_value[220], 238) << "incorrect value for last_msg_.amplitude_value[220], expected 238, is " << last_msg_.amplitude_value[220]; - EXPECT_EQ(last_msg_.amplitude_value[221], 83) << "incorrect value for last_msg_.amplitude_value[221], expected 83, is " << last_msg_.amplitude_value[221]; - EXPECT_EQ(last_msg_.amplitude_value[222], 148) << "incorrect value for last_msg_.amplitude_value[222], expected 148, is " << last_msg_.amplitude_value[222]; - EXPECT_EQ(last_msg_.amplitude_value[223], 173) << "incorrect value for last_msg_.amplitude_value[223], expected 173, is " << last_msg_.amplitude_value[223]; - EXPECT_EQ(last_msg_.amplitude_value[224], 108) << "incorrect value for last_msg_.amplitude_value[224], expected 108, is " << last_msg_.amplitude_value[224]; - EXPECT_EQ(last_msg_.amplitude_value[225], 228) << "incorrect value for last_msg_.amplitude_value[225], expected 228, is " << last_msg_.amplitude_value[225]; - EXPECT_EQ(last_msg_.amplitude_value[226], 67) << "incorrect value for last_msg_.amplitude_value[226], expected 67, is " << last_msg_.amplitude_value[226]; - EXPECT_EQ(last_msg_.amplitude_value[227], 89) << "incorrect value for last_msg_.amplitude_value[227], expected 89, is " << last_msg_.amplitude_value[227]; - EXPECT_EQ(last_msg_.amplitude_value[228], 189) << "incorrect value for last_msg_.amplitude_value[228], expected 189, is " << last_msg_.amplitude_value[228]; - EXPECT_EQ(last_msg_.amplitude_value[229], 67) << "incorrect value for last_msg_.amplitude_value[229], expected 67, is " << last_msg_.amplitude_value[229]; - EXPECT_EQ(last_msg_.amplitude_value[230], 26) << "incorrect value for last_msg_.amplitude_value[230], expected 26, is " << last_msg_.amplitude_value[230]; - EXPECT_EQ(last_msg_.channel_tag, 5878) << "incorrect value for last_msg_.channel_tag, expected 5878, is " << last_msg_.channel_tag; - EXPECT_LT((last_msg_.freq_ref * 100 - 6348.20019531 * 100), 0.05) << "incorrect value for last_msg_.freq_ref, expected 6348.20019531, is " << last_msg_.freq_ref; - EXPECT_LT((last_msg_.freq_step * 100 - 4608.20019531 * 100), 0.05) << "incorrect value for last_msg_.freq_step, expected 4608.20019531, is " << last_msg_.freq_step; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_amplitude_value.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_amplitude_value.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_amplitude_value.handle_as << "'"; - } - { - const char check_string[] = { (char)97,(char)109,(char)112,(char)108,(char)105,(char)116,(char)117,(char)100,(char)101,(char)95,(char)118,(char)97,(char)108,(char)117,(char)101 }; - EXPECT_EQ(memcmp(last_msg_.n_amplitude_value.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_amplitude_value.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_amplitude_value.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_amplitude_value.value, 231) << "incorrect value for last_msg_.n_amplitude_value.value, expected 231, is " << last_msg_.n_amplitude_value.value; - EXPECT_EQ(last_msg_.t.tow, 992295133) << "incorrect value for last_msg_.t.tow, expected 992295133, is " << last_msg_.t.tow; - EXPECT_EQ(last_msg_.t.wn, 6957) << "incorrect value for last_msg_.t.wn, expected 6957, is " << last_msg_.t.wn; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgSpecanDep0, Test) { + uint8_t encoded_frame[] = { + 85, 80, 0, 112, 217, 255, 246, 22, 221, 56, 37, 59, 45, 27, 154, + 97, 198, 69, 154, 1, 144, 69, 205, 20, 18, 70, 51, 211, 89, 69, + 240, 14, 179, 186, 227, 244, 173, 240, 182, 71, 166, 117, 196, 13, 44, + 27, 33, 28, 67, 254, 3, 249, 92, 44, 122, 169, 77, 186, 68, 135, + 63, 168, 162, 89, 36, 186, 99, 63, 105, 116, 216, 44, 67, 212, 156, + 75, 81, 53, 250, 225, 23, 205, 26, 34, 119, 50, 101, 64, 7, 231, + 124, 183, 203, 102, 234, 84, 83, 208, 23, 68, 54, 179, 98, 96, 116, + 244, 246, 94, 104, 94, 13, 56, 210, 18, 191, 22, 133, 81, 153, 159, + 161, 219, 59, 21, 164, 121, 145, 203, 171, 132, 57, 180, 102, 101, 11, + 229, 175, 145, 73, 72, 124, 4, 184, 228, 61, 234, 218, 62, 226, 217, + 193, 7, 109, 44, 83, 201, 20, 101, 9, 140, 186, 162, 81, 91, 30, + 231, 161, 81, 216, 114, 60, 231, 163, 163, 49, 237, 244, 185, 240, 89, + 143, 174, 165, 211, 241, 13, 16, 61, 141, 101, 89, 37, 117, 189, 86, + 118, 176, 228, 12, 14, 119, 135, 129, 243, 50, 29, 207, 198, 117, 100, + 225, 6, 139, 110, 39, 210, 68, 199, 43, 132, 64, 17, 51, 173, 181, + 12, 140, 16, 247, 84, 183, 105, 39, 157, 77, 30, 205, 194, 59, 64, + 241, 183, 238, 105, 181, 170, 45, 8, 166, 164, 238, 83, 148, 173, 108, + 228, 67, 89, 189, 67, 26, 39, 216, + }; + + sbp_msg_specan_dep_t test_msg{}; + test_msg.amplitude_ref = 9349.2001953125; + test_msg.amplitude_unit = 3485.199951171875; + + test_msg.amplitude_value[0] = 240; + + test_msg.amplitude_value[1] = 14; + + test_msg.amplitude_value[2] = 179; + + test_msg.amplitude_value[3] = 186; + + test_msg.amplitude_value[4] = 227; + + test_msg.amplitude_value[5] = 244; + + test_msg.amplitude_value[6] = 173; + + test_msg.amplitude_value[7] = 240; + + test_msg.amplitude_value[8] = 182; + + test_msg.amplitude_value[9] = 71; + + test_msg.amplitude_value[10] = 166; + + test_msg.amplitude_value[11] = 117; + + test_msg.amplitude_value[12] = 196; + + test_msg.amplitude_value[13] = 13; + + test_msg.amplitude_value[14] = 44; + + test_msg.amplitude_value[15] = 27; + + test_msg.amplitude_value[16] = 33; + + test_msg.amplitude_value[17] = 28; + + test_msg.amplitude_value[18] = 67; + + test_msg.amplitude_value[19] = 254; + + test_msg.amplitude_value[20] = 3; + + test_msg.amplitude_value[21] = 249; + + test_msg.amplitude_value[22] = 92; + + test_msg.amplitude_value[23] = 44; + + test_msg.amplitude_value[24] = 122; + + test_msg.amplitude_value[25] = 169; + + test_msg.amplitude_value[26] = 77; + + test_msg.amplitude_value[27] = 186; + + test_msg.amplitude_value[28] = 68; + + test_msg.amplitude_value[29] = 135; + + test_msg.amplitude_value[30] = 63; + + test_msg.amplitude_value[31] = 168; + + test_msg.amplitude_value[32] = 162; + + test_msg.amplitude_value[33] = 89; + + test_msg.amplitude_value[34] = 36; + + test_msg.amplitude_value[35] = 186; + + test_msg.amplitude_value[36] = 99; + + test_msg.amplitude_value[37] = 63; + + test_msg.amplitude_value[38] = 105; + + test_msg.amplitude_value[39] = 116; + + test_msg.amplitude_value[40] = 216; + + test_msg.amplitude_value[41] = 44; + + test_msg.amplitude_value[42] = 67; + + test_msg.amplitude_value[43] = 212; + + test_msg.amplitude_value[44] = 156; + + test_msg.amplitude_value[45] = 75; + + test_msg.amplitude_value[46] = 81; + + test_msg.amplitude_value[47] = 53; + + test_msg.amplitude_value[48] = 250; + + test_msg.amplitude_value[49] = 225; + + test_msg.amplitude_value[50] = 23; + + test_msg.amplitude_value[51] = 205; + + test_msg.amplitude_value[52] = 26; + + test_msg.amplitude_value[53] = 34; + + test_msg.amplitude_value[54] = 119; + + test_msg.amplitude_value[55] = 50; + + test_msg.amplitude_value[56] = 101; + + test_msg.amplitude_value[57] = 64; + + test_msg.amplitude_value[58] = 7; + + test_msg.amplitude_value[59] = 231; + + test_msg.amplitude_value[60] = 124; + + test_msg.amplitude_value[61] = 183; + + test_msg.amplitude_value[62] = 203; + + test_msg.amplitude_value[63] = 102; + + test_msg.amplitude_value[64] = 234; + + test_msg.amplitude_value[65] = 84; + + test_msg.amplitude_value[66] = 83; + + test_msg.amplitude_value[67] = 208; + + test_msg.amplitude_value[68] = 23; + + test_msg.amplitude_value[69] = 68; + + test_msg.amplitude_value[70] = 54; + + test_msg.amplitude_value[71] = 179; + + test_msg.amplitude_value[72] = 98; + + test_msg.amplitude_value[73] = 96; + + test_msg.amplitude_value[74] = 116; + + test_msg.amplitude_value[75] = 244; + + test_msg.amplitude_value[76] = 246; + + test_msg.amplitude_value[77] = 94; + + test_msg.amplitude_value[78] = 104; + + test_msg.amplitude_value[79] = 94; + + test_msg.amplitude_value[80] = 13; + + test_msg.amplitude_value[81] = 56; + + test_msg.amplitude_value[82] = 210; + + test_msg.amplitude_value[83] = 18; + + test_msg.amplitude_value[84] = 191; + + test_msg.amplitude_value[85] = 22; + + test_msg.amplitude_value[86] = 133; + + test_msg.amplitude_value[87] = 81; + + test_msg.amplitude_value[88] = 153; + + test_msg.amplitude_value[89] = 159; + + test_msg.amplitude_value[90] = 161; + + test_msg.amplitude_value[91] = 219; + + test_msg.amplitude_value[92] = 59; + + test_msg.amplitude_value[93] = 21; + + test_msg.amplitude_value[94] = 164; + + test_msg.amplitude_value[95] = 121; + + test_msg.amplitude_value[96] = 145; + + test_msg.amplitude_value[97] = 203; + + test_msg.amplitude_value[98] = 171; + + test_msg.amplitude_value[99] = 132; + + test_msg.amplitude_value[100] = 57; + + test_msg.amplitude_value[101] = 180; + + test_msg.amplitude_value[102] = 102; + + test_msg.amplitude_value[103] = 101; + + test_msg.amplitude_value[104] = 11; + + test_msg.amplitude_value[105] = 229; + + test_msg.amplitude_value[106] = 175; + + test_msg.amplitude_value[107] = 145; + + test_msg.amplitude_value[108] = 73; + + test_msg.amplitude_value[109] = 72; + + test_msg.amplitude_value[110] = 124; + + test_msg.amplitude_value[111] = 4; + + test_msg.amplitude_value[112] = 184; + + test_msg.amplitude_value[113] = 228; + + test_msg.amplitude_value[114] = 61; + + test_msg.amplitude_value[115] = 234; + + test_msg.amplitude_value[116] = 218; + + test_msg.amplitude_value[117] = 62; + + test_msg.amplitude_value[118] = 226; + + test_msg.amplitude_value[119] = 217; + + test_msg.amplitude_value[120] = 193; + + test_msg.amplitude_value[121] = 7; + + test_msg.amplitude_value[122] = 109; + + test_msg.amplitude_value[123] = 44; + + test_msg.amplitude_value[124] = 83; + + test_msg.amplitude_value[125] = 201; + + test_msg.amplitude_value[126] = 20; + + test_msg.amplitude_value[127] = 101; + + test_msg.amplitude_value[128] = 9; + + test_msg.amplitude_value[129] = 140; + + test_msg.amplitude_value[130] = 186; + + test_msg.amplitude_value[131] = 162; + + test_msg.amplitude_value[132] = 81; + + test_msg.amplitude_value[133] = 91; + + test_msg.amplitude_value[134] = 30; + + test_msg.amplitude_value[135] = 231; + + test_msg.amplitude_value[136] = 161; + + test_msg.amplitude_value[137] = 81; + + test_msg.amplitude_value[138] = 216; + + test_msg.amplitude_value[139] = 114; + + test_msg.amplitude_value[140] = 60; + + test_msg.amplitude_value[141] = 231; + + test_msg.amplitude_value[142] = 163; + + test_msg.amplitude_value[143] = 163; + + test_msg.amplitude_value[144] = 49; + + test_msg.amplitude_value[145] = 237; + + test_msg.amplitude_value[146] = 244; + + test_msg.amplitude_value[147] = 185; + + test_msg.amplitude_value[148] = 240; + + test_msg.amplitude_value[149] = 89; + + test_msg.amplitude_value[150] = 143; + + test_msg.amplitude_value[151] = 174; + + test_msg.amplitude_value[152] = 165; + + test_msg.amplitude_value[153] = 211; + + test_msg.amplitude_value[154] = 241; + + test_msg.amplitude_value[155] = 13; + + test_msg.amplitude_value[156] = 16; + + test_msg.amplitude_value[157] = 61; + + test_msg.amplitude_value[158] = 141; + + test_msg.amplitude_value[159] = 101; + + test_msg.amplitude_value[160] = 89; + + test_msg.amplitude_value[161] = 37; + + test_msg.amplitude_value[162] = 117; + + test_msg.amplitude_value[163] = 189; + + test_msg.amplitude_value[164] = 86; + + test_msg.amplitude_value[165] = 118; + + test_msg.amplitude_value[166] = 176; + + test_msg.amplitude_value[167] = 228; + + test_msg.amplitude_value[168] = 12; + + test_msg.amplitude_value[169] = 14; + + test_msg.amplitude_value[170] = 119; + + test_msg.amplitude_value[171] = 135; + + test_msg.amplitude_value[172] = 129; + + test_msg.amplitude_value[173] = 243; + + test_msg.amplitude_value[174] = 50; + + test_msg.amplitude_value[175] = 29; + + test_msg.amplitude_value[176] = 207; + + test_msg.amplitude_value[177] = 198; + + test_msg.amplitude_value[178] = 117; + + test_msg.amplitude_value[179] = 100; + + test_msg.amplitude_value[180] = 225; + + test_msg.amplitude_value[181] = 6; + + test_msg.amplitude_value[182] = 139; + + test_msg.amplitude_value[183] = 110; + + test_msg.amplitude_value[184] = 39; + + test_msg.amplitude_value[185] = 210; + + test_msg.amplitude_value[186] = 68; + + test_msg.amplitude_value[187] = 199; + + test_msg.amplitude_value[188] = 43; + + test_msg.amplitude_value[189] = 132; + + test_msg.amplitude_value[190] = 64; + + test_msg.amplitude_value[191] = 17; + + test_msg.amplitude_value[192] = 51; + + test_msg.amplitude_value[193] = 173; + + test_msg.amplitude_value[194] = 181; + + test_msg.amplitude_value[195] = 12; + + test_msg.amplitude_value[196] = 140; + + test_msg.amplitude_value[197] = 16; + + test_msg.amplitude_value[198] = 247; + + test_msg.amplitude_value[199] = 84; + + test_msg.amplitude_value[200] = 183; + + test_msg.amplitude_value[201] = 105; + + test_msg.amplitude_value[202] = 39; + + test_msg.amplitude_value[203] = 157; + + test_msg.amplitude_value[204] = 77; + + test_msg.amplitude_value[205] = 30; + + test_msg.amplitude_value[206] = 205; + + test_msg.amplitude_value[207] = 194; + + test_msg.amplitude_value[208] = 59; + + test_msg.amplitude_value[209] = 64; + + test_msg.amplitude_value[210] = 241; + + test_msg.amplitude_value[211] = 183; + + test_msg.amplitude_value[212] = 238; + + test_msg.amplitude_value[213] = 105; + + test_msg.amplitude_value[214] = 181; + + test_msg.amplitude_value[215] = 170; + + test_msg.amplitude_value[216] = 45; + + test_msg.amplitude_value[217] = 8; + + test_msg.amplitude_value[218] = 166; + + test_msg.amplitude_value[219] = 164; + + test_msg.amplitude_value[220] = 238; + + test_msg.amplitude_value[221] = 83; + + test_msg.amplitude_value[222] = 148; + + test_msg.amplitude_value[223] = 173; + + test_msg.amplitude_value[224] = 108; + + test_msg.amplitude_value[225] = 228; + + test_msg.amplitude_value[226] = 67; + + test_msg.amplitude_value[227] = 89; + + test_msg.amplitude_value[228] = 189; + + test_msg.amplitude_value[229] = 67; + + test_msg.amplitude_value[230] = 26; + test_msg.channel_tag = 5878; + test_msg.freq_ref = 6348.2001953125; + test_msg.freq_step = 4608.2001953125; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_amplitude_value.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)97, (char)109, (char)112, (char)108, + (char)105, (char)116, (char)117, (char)100, + (char)101, (char)95, (char)118, (char)97, + (char)108, (char)117, (char)101}; + memcpy(test_msg.n_amplitude_value.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_amplitude_value.value = 231; + test_msg.t.tow = 992295133; + test_msg.t.wn = 6957; + + EXPECT_EQ(send_message(55664, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55664); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_LT((last_msg_.amplitude_ref * 100 - 9349.20019531 * 100), 0.05) + << "incorrect value for last_msg_.amplitude_ref, expected 9349.20019531, " + "is " + << last_msg_.amplitude_ref; + EXPECT_LT((last_msg_.amplitude_unit * 100 - 3485.19995117 * 100), 0.05) + << "incorrect value for last_msg_.amplitude_unit, expected " + "3485.19995117, is " + << last_msg_.amplitude_unit; + EXPECT_EQ(last_msg_.amplitude_value[0], 240) + << "incorrect value for last_msg_.amplitude_value[0], expected 240, is " + << last_msg_.amplitude_value[0]; + EXPECT_EQ(last_msg_.amplitude_value[1], 14) + << "incorrect value for last_msg_.amplitude_value[1], expected 14, is " + << last_msg_.amplitude_value[1]; + EXPECT_EQ(last_msg_.amplitude_value[2], 179) + << "incorrect value for last_msg_.amplitude_value[2], expected 179, is " + << last_msg_.amplitude_value[2]; + EXPECT_EQ(last_msg_.amplitude_value[3], 186) + << "incorrect value for last_msg_.amplitude_value[3], expected 186, is " + << last_msg_.amplitude_value[3]; + EXPECT_EQ(last_msg_.amplitude_value[4], 227) + << "incorrect value for last_msg_.amplitude_value[4], expected 227, is " + << last_msg_.amplitude_value[4]; + EXPECT_EQ(last_msg_.amplitude_value[5], 244) + << "incorrect value for last_msg_.amplitude_value[5], expected 244, is " + << last_msg_.amplitude_value[5]; + EXPECT_EQ(last_msg_.amplitude_value[6], 173) + << "incorrect value for last_msg_.amplitude_value[6], expected 173, is " + << last_msg_.amplitude_value[6]; + EXPECT_EQ(last_msg_.amplitude_value[7], 240) + << "incorrect value for last_msg_.amplitude_value[7], expected 240, is " + << last_msg_.amplitude_value[7]; + EXPECT_EQ(last_msg_.amplitude_value[8], 182) + << "incorrect value for last_msg_.amplitude_value[8], expected 182, is " + << last_msg_.amplitude_value[8]; + EXPECT_EQ(last_msg_.amplitude_value[9], 71) + << "incorrect value for last_msg_.amplitude_value[9], expected 71, is " + << last_msg_.amplitude_value[9]; + EXPECT_EQ(last_msg_.amplitude_value[10], 166) + << "incorrect value for last_msg_.amplitude_value[10], expected 166, is " + << last_msg_.amplitude_value[10]; + EXPECT_EQ(last_msg_.amplitude_value[11], 117) + << "incorrect value for last_msg_.amplitude_value[11], expected 117, is " + << last_msg_.amplitude_value[11]; + EXPECT_EQ(last_msg_.amplitude_value[12], 196) + << "incorrect value for last_msg_.amplitude_value[12], expected 196, is " + << last_msg_.amplitude_value[12]; + EXPECT_EQ(last_msg_.amplitude_value[13], 13) + << "incorrect value for last_msg_.amplitude_value[13], expected 13, is " + << last_msg_.amplitude_value[13]; + EXPECT_EQ(last_msg_.amplitude_value[14], 44) + << "incorrect value for last_msg_.amplitude_value[14], expected 44, is " + << last_msg_.amplitude_value[14]; + EXPECT_EQ(last_msg_.amplitude_value[15], 27) + << "incorrect value for last_msg_.amplitude_value[15], expected 27, is " + << last_msg_.amplitude_value[15]; + EXPECT_EQ(last_msg_.amplitude_value[16], 33) + << "incorrect value for last_msg_.amplitude_value[16], expected 33, is " + << last_msg_.amplitude_value[16]; + EXPECT_EQ(last_msg_.amplitude_value[17], 28) + << "incorrect value for last_msg_.amplitude_value[17], expected 28, is " + << last_msg_.amplitude_value[17]; + EXPECT_EQ(last_msg_.amplitude_value[18], 67) + << "incorrect value for last_msg_.amplitude_value[18], expected 67, is " + << last_msg_.amplitude_value[18]; + EXPECT_EQ(last_msg_.amplitude_value[19], 254) + << "incorrect value for last_msg_.amplitude_value[19], expected 254, is " + << last_msg_.amplitude_value[19]; + EXPECT_EQ(last_msg_.amplitude_value[20], 3) + << "incorrect value for last_msg_.amplitude_value[20], expected 3, is " + << last_msg_.amplitude_value[20]; + EXPECT_EQ(last_msg_.amplitude_value[21], 249) + << "incorrect value for last_msg_.amplitude_value[21], expected 249, is " + << last_msg_.amplitude_value[21]; + EXPECT_EQ(last_msg_.amplitude_value[22], 92) + << "incorrect value for last_msg_.amplitude_value[22], expected 92, is " + << last_msg_.amplitude_value[22]; + EXPECT_EQ(last_msg_.amplitude_value[23], 44) + << "incorrect value for last_msg_.amplitude_value[23], expected 44, is " + << last_msg_.amplitude_value[23]; + EXPECT_EQ(last_msg_.amplitude_value[24], 122) + << "incorrect value for last_msg_.amplitude_value[24], expected 122, is " + << last_msg_.amplitude_value[24]; + EXPECT_EQ(last_msg_.amplitude_value[25], 169) + << "incorrect value for last_msg_.amplitude_value[25], expected 169, is " + << last_msg_.amplitude_value[25]; + EXPECT_EQ(last_msg_.amplitude_value[26], 77) + << "incorrect value for last_msg_.amplitude_value[26], expected 77, is " + << last_msg_.amplitude_value[26]; + EXPECT_EQ(last_msg_.amplitude_value[27], 186) + << "incorrect value for last_msg_.amplitude_value[27], expected 186, is " + << last_msg_.amplitude_value[27]; + EXPECT_EQ(last_msg_.amplitude_value[28], 68) + << "incorrect value for last_msg_.amplitude_value[28], expected 68, is " + << last_msg_.amplitude_value[28]; + EXPECT_EQ(last_msg_.amplitude_value[29], 135) + << "incorrect value for last_msg_.amplitude_value[29], expected 135, is " + << last_msg_.amplitude_value[29]; + EXPECT_EQ(last_msg_.amplitude_value[30], 63) + << "incorrect value for last_msg_.amplitude_value[30], expected 63, is " + << last_msg_.amplitude_value[30]; + EXPECT_EQ(last_msg_.amplitude_value[31], 168) + << "incorrect value for last_msg_.amplitude_value[31], expected 168, is " + << last_msg_.amplitude_value[31]; + EXPECT_EQ(last_msg_.amplitude_value[32], 162) + << "incorrect value for last_msg_.amplitude_value[32], expected 162, is " + << last_msg_.amplitude_value[32]; + EXPECT_EQ(last_msg_.amplitude_value[33], 89) + << "incorrect value for last_msg_.amplitude_value[33], expected 89, is " + << last_msg_.amplitude_value[33]; + EXPECT_EQ(last_msg_.amplitude_value[34], 36) + << "incorrect value for last_msg_.amplitude_value[34], expected 36, is " + << last_msg_.amplitude_value[34]; + EXPECT_EQ(last_msg_.amplitude_value[35], 186) + << "incorrect value for last_msg_.amplitude_value[35], expected 186, is " + << last_msg_.amplitude_value[35]; + EXPECT_EQ(last_msg_.amplitude_value[36], 99) + << "incorrect value for last_msg_.amplitude_value[36], expected 99, is " + << last_msg_.amplitude_value[36]; + EXPECT_EQ(last_msg_.amplitude_value[37], 63) + << "incorrect value for last_msg_.amplitude_value[37], expected 63, is " + << last_msg_.amplitude_value[37]; + EXPECT_EQ(last_msg_.amplitude_value[38], 105) + << "incorrect value for last_msg_.amplitude_value[38], expected 105, is " + << last_msg_.amplitude_value[38]; + EXPECT_EQ(last_msg_.amplitude_value[39], 116) + << "incorrect value for last_msg_.amplitude_value[39], expected 116, is " + << last_msg_.amplitude_value[39]; + EXPECT_EQ(last_msg_.amplitude_value[40], 216) + << "incorrect value for last_msg_.amplitude_value[40], expected 216, is " + << last_msg_.amplitude_value[40]; + EXPECT_EQ(last_msg_.amplitude_value[41], 44) + << "incorrect value for last_msg_.amplitude_value[41], expected 44, is " + << last_msg_.amplitude_value[41]; + EXPECT_EQ(last_msg_.amplitude_value[42], 67) + << "incorrect value for last_msg_.amplitude_value[42], expected 67, is " + << last_msg_.amplitude_value[42]; + EXPECT_EQ(last_msg_.amplitude_value[43], 212) + << "incorrect value for last_msg_.amplitude_value[43], expected 212, is " + << last_msg_.amplitude_value[43]; + EXPECT_EQ(last_msg_.amplitude_value[44], 156) + << "incorrect value for last_msg_.amplitude_value[44], expected 156, is " + << last_msg_.amplitude_value[44]; + EXPECT_EQ(last_msg_.amplitude_value[45], 75) + << "incorrect value for last_msg_.amplitude_value[45], expected 75, is " + << last_msg_.amplitude_value[45]; + EXPECT_EQ(last_msg_.amplitude_value[46], 81) + << "incorrect value for last_msg_.amplitude_value[46], expected 81, is " + << last_msg_.amplitude_value[46]; + EXPECT_EQ(last_msg_.amplitude_value[47], 53) + << "incorrect value for last_msg_.amplitude_value[47], expected 53, is " + << last_msg_.amplitude_value[47]; + EXPECT_EQ(last_msg_.amplitude_value[48], 250) + << "incorrect value for last_msg_.amplitude_value[48], expected 250, is " + << last_msg_.amplitude_value[48]; + EXPECT_EQ(last_msg_.amplitude_value[49], 225) + << "incorrect value for last_msg_.amplitude_value[49], expected 225, is " + << last_msg_.amplitude_value[49]; + EXPECT_EQ(last_msg_.amplitude_value[50], 23) + << "incorrect value for last_msg_.amplitude_value[50], expected 23, is " + << last_msg_.amplitude_value[50]; + EXPECT_EQ(last_msg_.amplitude_value[51], 205) + << "incorrect value for last_msg_.amplitude_value[51], expected 205, is " + << last_msg_.amplitude_value[51]; + EXPECT_EQ(last_msg_.amplitude_value[52], 26) + << "incorrect value for last_msg_.amplitude_value[52], expected 26, is " + << last_msg_.amplitude_value[52]; + EXPECT_EQ(last_msg_.amplitude_value[53], 34) + << "incorrect value for last_msg_.amplitude_value[53], expected 34, is " + << last_msg_.amplitude_value[53]; + EXPECT_EQ(last_msg_.amplitude_value[54], 119) + << "incorrect value for last_msg_.amplitude_value[54], expected 119, is " + << last_msg_.amplitude_value[54]; + EXPECT_EQ(last_msg_.amplitude_value[55], 50) + << "incorrect value for last_msg_.amplitude_value[55], expected 50, is " + << last_msg_.amplitude_value[55]; + EXPECT_EQ(last_msg_.amplitude_value[56], 101) + << "incorrect value for last_msg_.amplitude_value[56], expected 101, is " + << last_msg_.amplitude_value[56]; + EXPECT_EQ(last_msg_.amplitude_value[57], 64) + << "incorrect value for last_msg_.amplitude_value[57], expected 64, is " + << last_msg_.amplitude_value[57]; + EXPECT_EQ(last_msg_.amplitude_value[58], 7) + << "incorrect value for last_msg_.amplitude_value[58], expected 7, is " + << last_msg_.amplitude_value[58]; + EXPECT_EQ(last_msg_.amplitude_value[59], 231) + << "incorrect value for last_msg_.amplitude_value[59], expected 231, is " + << last_msg_.amplitude_value[59]; + EXPECT_EQ(last_msg_.amplitude_value[60], 124) + << "incorrect value for last_msg_.amplitude_value[60], expected 124, is " + << last_msg_.amplitude_value[60]; + EXPECT_EQ(last_msg_.amplitude_value[61], 183) + << "incorrect value for last_msg_.amplitude_value[61], expected 183, is " + << last_msg_.amplitude_value[61]; + EXPECT_EQ(last_msg_.amplitude_value[62], 203) + << "incorrect value for last_msg_.amplitude_value[62], expected 203, is " + << last_msg_.amplitude_value[62]; + EXPECT_EQ(last_msg_.amplitude_value[63], 102) + << "incorrect value for last_msg_.amplitude_value[63], expected 102, is " + << last_msg_.amplitude_value[63]; + EXPECT_EQ(last_msg_.amplitude_value[64], 234) + << "incorrect value for last_msg_.amplitude_value[64], expected 234, is " + << last_msg_.amplitude_value[64]; + EXPECT_EQ(last_msg_.amplitude_value[65], 84) + << "incorrect value for last_msg_.amplitude_value[65], expected 84, is " + << last_msg_.amplitude_value[65]; + EXPECT_EQ(last_msg_.amplitude_value[66], 83) + << "incorrect value for last_msg_.amplitude_value[66], expected 83, is " + << last_msg_.amplitude_value[66]; + EXPECT_EQ(last_msg_.amplitude_value[67], 208) + << "incorrect value for last_msg_.amplitude_value[67], expected 208, is " + << last_msg_.amplitude_value[67]; + EXPECT_EQ(last_msg_.amplitude_value[68], 23) + << "incorrect value for last_msg_.amplitude_value[68], expected 23, is " + << last_msg_.amplitude_value[68]; + EXPECT_EQ(last_msg_.amplitude_value[69], 68) + << "incorrect value for last_msg_.amplitude_value[69], expected 68, is " + << last_msg_.amplitude_value[69]; + EXPECT_EQ(last_msg_.amplitude_value[70], 54) + << "incorrect value for last_msg_.amplitude_value[70], expected 54, is " + << last_msg_.amplitude_value[70]; + EXPECT_EQ(last_msg_.amplitude_value[71], 179) + << "incorrect value for last_msg_.amplitude_value[71], expected 179, is " + << last_msg_.amplitude_value[71]; + EXPECT_EQ(last_msg_.amplitude_value[72], 98) + << "incorrect value for last_msg_.amplitude_value[72], expected 98, is " + << last_msg_.amplitude_value[72]; + EXPECT_EQ(last_msg_.amplitude_value[73], 96) + << "incorrect value for last_msg_.amplitude_value[73], expected 96, is " + << last_msg_.amplitude_value[73]; + EXPECT_EQ(last_msg_.amplitude_value[74], 116) + << "incorrect value for last_msg_.amplitude_value[74], expected 116, is " + << last_msg_.amplitude_value[74]; + EXPECT_EQ(last_msg_.amplitude_value[75], 244) + << "incorrect value for last_msg_.amplitude_value[75], expected 244, is " + << last_msg_.amplitude_value[75]; + EXPECT_EQ(last_msg_.amplitude_value[76], 246) + << "incorrect value for last_msg_.amplitude_value[76], expected 246, is " + << last_msg_.amplitude_value[76]; + EXPECT_EQ(last_msg_.amplitude_value[77], 94) + << "incorrect value for last_msg_.amplitude_value[77], expected 94, is " + << last_msg_.amplitude_value[77]; + EXPECT_EQ(last_msg_.amplitude_value[78], 104) + << "incorrect value for last_msg_.amplitude_value[78], expected 104, is " + << last_msg_.amplitude_value[78]; + EXPECT_EQ(last_msg_.amplitude_value[79], 94) + << "incorrect value for last_msg_.amplitude_value[79], expected 94, is " + << last_msg_.amplitude_value[79]; + EXPECT_EQ(last_msg_.amplitude_value[80], 13) + << "incorrect value for last_msg_.amplitude_value[80], expected 13, is " + << last_msg_.amplitude_value[80]; + EXPECT_EQ(last_msg_.amplitude_value[81], 56) + << "incorrect value for last_msg_.amplitude_value[81], expected 56, is " + << last_msg_.amplitude_value[81]; + EXPECT_EQ(last_msg_.amplitude_value[82], 210) + << "incorrect value for last_msg_.amplitude_value[82], expected 210, is " + << last_msg_.amplitude_value[82]; + EXPECT_EQ(last_msg_.amplitude_value[83], 18) + << "incorrect value for last_msg_.amplitude_value[83], expected 18, is " + << last_msg_.amplitude_value[83]; + EXPECT_EQ(last_msg_.amplitude_value[84], 191) + << "incorrect value for last_msg_.amplitude_value[84], expected 191, is " + << last_msg_.amplitude_value[84]; + EXPECT_EQ(last_msg_.amplitude_value[85], 22) + << "incorrect value for last_msg_.amplitude_value[85], expected 22, is " + << last_msg_.amplitude_value[85]; + EXPECT_EQ(last_msg_.amplitude_value[86], 133) + << "incorrect value for last_msg_.amplitude_value[86], expected 133, is " + << last_msg_.amplitude_value[86]; + EXPECT_EQ(last_msg_.amplitude_value[87], 81) + << "incorrect value for last_msg_.amplitude_value[87], expected 81, is " + << last_msg_.amplitude_value[87]; + EXPECT_EQ(last_msg_.amplitude_value[88], 153) + << "incorrect value for last_msg_.amplitude_value[88], expected 153, is " + << last_msg_.amplitude_value[88]; + EXPECT_EQ(last_msg_.amplitude_value[89], 159) + << "incorrect value for last_msg_.amplitude_value[89], expected 159, is " + << last_msg_.amplitude_value[89]; + EXPECT_EQ(last_msg_.amplitude_value[90], 161) + << "incorrect value for last_msg_.amplitude_value[90], expected 161, is " + << last_msg_.amplitude_value[90]; + EXPECT_EQ(last_msg_.amplitude_value[91], 219) + << "incorrect value for last_msg_.amplitude_value[91], expected 219, is " + << last_msg_.amplitude_value[91]; + EXPECT_EQ(last_msg_.amplitude_value[92], 59) + << "incorrect value for last_msg_.amplitude_value[92], expected 59, is " + << last_msg_.amplitude_value[92]; + EXPECT_EQ(last_msg_.amplitude_value[93], 21) + << "incorrect value for last_msg_.amplitude_value[93], expected 21, is " + << last_msg_.amplitude_value[93]; + EXPECT_EQ(last_msg_.amplitude_value[94], 164) + << "incorrect value for last_msg_.amplitude_value[94], expected 164, is " + << last_msg_.amplitude_value[94]; + EXPECT_EQ(last_msg_.amplitude_value[95], 121) + << "incorrect value for last_msg_.amplitude_value[95], expected 121, is " + << last_msg_.amplitude_value[95]; + EXPECT_EQ(last_msg_.amplitude_value[96], 145) + << "incorrect value for last_msg_.amplitude_value[96], expected 145, is " + << last_msg_.amplitude_value[96]; + EXPECT_EQ(last_msg_.amplitude_value[97], 203) + << "incorrect value for last_msg_.amplitude_value[97], expected 203, is " + << last_msg_.amplitude_value[97]; + EXPECT_EQ(last_msg_.amplitude_value[98], 171) + << "incorrect value for last_msg_.amplitude_value[98], expected 171, is " + << last_msg_.amplitude_value[98]; + EXPECT_EQ(last_msg_.amplitude_value[99], 132) + << "incorrect value for last_msg_.amplitude_value[99], expected 132, is " + << last_msg_.amplitude_value[99]; + EXPECT_EQ(last_msg_.amplitude_value[100], 57) + << "incorrect value for last_msg_.amplitude_value[100], expected 57, is " + << last_msg_.amplitude_value[100]; + EXPECT_EQ(last_msg_.amplitude_value[101], 180) + << "incorrect value for last_msg_.amplitude_value[101], expected 180, is " + << last_msg_.amplitude_value[101]; + EXPECT_EQ(last_msg_.amplitude_value[102], 102) + << "incorrect value for last_msg_.amplitude_value[102], expected 102, is " + << last_msg_.amplitude_value[102]; + EXPECT_EQ(last_msg_.amplitude_value[103], 101) + << "incorrect value for last_msg_.amplitude_value[103], expected 101, is " + << last_msg_.amplitude_value[103]; + EXPECT_EQ(last_msg_.amplitude_value[104], 11) + << "incorrect value for last_msg_.amplitude_value[104], expected 11, is " + << last_msg_.amplitude_value[104]; + EXPECT_EQ(last_msg_.amplitude_value[105], 229) + << "incorrect value for last_msg_.amplitude_value[105], expected 229, is " + << last_msg_.amplitude_value[105]; + EXPECT_EQ(last_msg_.amplitude_value[106], 175) + << "incorrect value for last_msg_.amplitude_value[106], expected 175, is " + << last_msg_.amplitude_value[106]; + EXPECT_EQ(last_msg_.amplitude_value[107], 145) + << "incorrect value for last_msg_.amplitude_value[107], expected 145, is " + << last_msg_.amplitude_value[107]; + EXPECT_EQ(last_msg_.amplitude_value[108], 73) + << "incorrect value for last_msg_.amplitude_value[108], expected 73, is " + << last_msg_.amplitude_value[108]; + EXPECT_EQ(last_msg_.amplitude_value[109], 72) + << "incorrect value for last_msg_.amplitude_value[109], expected 72, is " + << last_msg_.amplitude_value[109]; + EXPECT_EQ(last_msg_.amplitude_value[110], 124) + << "incorrect value for last_msg_.amplitude_value[110], expected 124, is " + << last_msg_.amplitude_value[110]; + EXPECT_EQ(last_msg_.amplitude_value[111], 4) + << "incorrect value for last_msg_.amplitude_value[111], expected 4, is " + << last_msg_.amplitude_value[111]; + EXPECT_EQ(last_msg_.amplitude_value[112], 184) + << "incorrect value for last_msg_.amplitude_value[112], expected 184, is " + << last_msg_.amplitude_value[112]; + EXPECT_EQ(last_msg_.amplitude_value[113], 228) + << "incorrect value for last_msg_.amplitude_value[113], expected 228, is " + << last_msg_.amplitude_value[113]; + EXPECT_EQ(last_msg_.amplitude_value[114], 61) + << "incorrect value for last_msg_.amplitude_value[114], expected 61, is " + << last_msg_.amplitude_value[114]; + EXPECT_EQ(last_msg_.amplitude_value[115], 234) + << "incorrect value for last_msg_.amplitude_value[115], expected 234, is " + << last_msg_.amplitude_value[115]; + EXPECT_EQ(last_msg_.amplitude_value[116], 218) + << "incorrect value for last_msg_.amplitude_value[116], expected 218, is " + << last_msg_.amplitude_value[116]; + EXPECT_EQ(last_msg_.amplitude_value[117], 62) + << "incorrect value for last_msg_.amplitude_value[117], expected 62, is " + << last_msg_.amplitude_value[117]; + EXPECT_EQ(last_msg_.amplitude_value[118], 226) + << "incorrect value for last_msg_.amplitude_value[118], expected 226, is " + << last_msg_.amplitude_value[118]; + EXPECT_EQ(last_msg_.amplitude_value[119], 217) + << "incorrect value for last_msg_.amplitude_value[119], expected 217, is " + << last_msg_.amplitude_value[119]; + EXPECT_EQ(last_msg_.amplitude_value[120], 193) + << "incorrect value for last_msg_.amplitude_value[120], expected 193, is " + << last_msg_.amplitude_value[120]; + EXPECT_EQ(last_msg_.amplitude_value[121], 7) + << "incorrect value for last_msg_.amplitude_value[121], expected 7, is " + << last_msg_.amplitude_value[121]; + EXPECT_EQ(last_msg_.amplitude_value[122], 109) + << "incorrect value for last_msg_.amplitude_value[122], expected 109, is " + << last_msg_.amplitude_value[122]; + EXPECT_EQ(last_msg_.amplitude_value[123], 44) + << "incorrect value for last_msg_.amplitude_value[123], expected 44, is " + << last_msg_.amplitude_value[123]; + EXPECT_EQ(last_msg_.amplitude_value[124], 83) + << "incorrect value for last_msg_.amplitude_value[124], expected 83, is " + << last_msg_.amplitude_value[124]; + EXPECT_EQ(last_msg_.amplitude_value[125], 201) + << "incorrect value for last_msg_.amplitude_value[125], expected 201, is " + << last_msg_.amplitude_value[125]; + EXPECT_EQ(last_msg_.amplitude_value[126], 20) + << "incorrect value for last_msg_.amplitude_value[126], expected 20, is " + << last_msg_.amplitude_value[126]; + EXPECT_EQ(last_msg_.amplitude_value[127], 101) + << "incorrect value for last_msg_.amplitude_value[127], expected 101, is " + << last_msg_.amplitude_value[127]; + EXPECT_EQ(last_msg_.amplitude_value[128], 9) + << "incorrect value for last_msg_.amplitude_value[128], expected 9, is " + << last_msg_.amplitude_value[128]; + EXPECT_EQ(last_msg_.amplitude_value[129], 140) + << "incorrect value for last_msg_.amplitude_value[129], expected 140, is " + << last_msg_.amplitude_value[129]; + EXPECT_EQ(last_msg_.amplitude_value[130], 186) + << "incorrect value for last_msg_.amplitude_value[130], expected 186, is " + << last_msg_.amplitude_value[130]; + EXPECT_EQ(last_msg_.amplitude_value[131], 162) + << "incorrect value for last_msg_.amplitude_value[131], expected 162, is " + << last_msg_.amplitude_value[131]; + EXPECT_EQ(last_msg_.amplitude_value[132], 81) + << "incorrect value for last_msg_.amplitude_value[132], expected 81, is " + << last_msg_.amplitude_value[132]; + EXPECT_EQ(last_msg_.amplitude_value[133], 91) + << "incorrect value for last_msg_.amplitude_value[133], expected 91, is " + << last_msg_.amplitude_value[133]; + EXPECT_EQ(last_msg_.amplitude_value[134], 30) + << "incorrect value for last_msg_.amplitude_value[134], expected 30, is " + << last_msg_.amplitude_value[134]; + EXPECT_EQ(last_msg_.amplitude_value[135], 231) + << "incorrect value for last_msg_.amplitude_value[135], expected 231, is " + << last_msg_.amplitude_value[135]; + EXPECT_EQ(last_msg_.amplitude_value[136], 161) + << "incorrect value for last_msg_.amplitude_value[136], expected 161, is " + << last_msg_.amplitude_value[136]; + EXPECT_EQ(last_msg_.amplitude_value[137], 81) + << "incorrect value for last_msg_.amplitude_value[137], expected 81, is " + << last_msg_.amplitude_value[137]; + EXPECT_EQ(last_msg_.amplitude_value[138], 216) + << "incorrect value for last_msg_.amplitude_value[138], expected 216, is " + << last_msg_.amplitude_value[138]; + EXPECT_EQ(last_msg_.amplitude_value[139], 114) + << "incorrect value for last_msg_.amplitude_value[139], expected 114, is " + << last_msg_.amplitude_value[139]; + EXPECT_EQ(last_msg_.amplitude_value[140], 60) + << "incorrect value for last_msg_.amplitude_value[140], expected 60, is " + << last_msg_.amplitude_value[140]; + EXPECT_EQ(last_msg_.amplitude_value[141], 231) + << "incorrect value for last_msg_.amplitude_value[141], expected 231, is " + << last_msg_.amplitude_value[141]; + EXPECT_EQ(last_msg_.amplitude_value[142], 163) + << "incorrect value for last_msg_.amplitude_value[142], expected 163, is " + << last_msg_.amplitude_value[142]; + EXPECT_EQ(last_msg_.amplitude_value[143], 163) + << "incorrect value for last_msg_.amplitude_value[143], expected 163, is " + << last_msg_.amplitude_value[143]; + EXPECT_EQ(last_msg_.amplitude_value[144], 49) + << "incorrect value for last_msg_.amplitude_value[144], expected 49, is " + << last_msg_.amplitude_value[144]; + EXPECT_EQ(last_msg_.amplitude_value[145], 237) + << "incorrect value for last_msg_.amplitude_value[145], expected 237, is " + << last_msg_.amplitude_value[145]; + EXPECT_EQ(last_msg_.amplitude_value[146], 244) + << "incorrect value for last_msg_.amplitude_value[146], expected 244, is " + << last_msg_.amplitude_value[146]; + EXPECT_EQ(last_msg_.amplitude_value[147], 185) + << "incorrect value for last_msg_.amplitude_value[147], expected 185, is " + << last_msg_.amplitude_value[147]; + EXPECT_EQ(last_msg_.amplitude_value[148], 240) + << "incorrect value for last_msg_.amplitude_value[148], expected 240, is " + << last_msg_.amplitude_value[148]; + EXPECT_EQ(last_msg_.amplitude_value[149], 89) + << "incorrect value for last_msg_.amplitude_value[149], expected 89, is " + << last_msg_.amplitude_value[149]; + EXPECT_EQ(last_msg_.amplitude_value[150], 143) + << "incorrect value for last_msg_.amplitude_value[150], expected 143, is " + << last_msg_.amplitude_value[150]; + EXPECT_EQ(last_msg_.amplitude_value[151], 174) + << "incorrect value for last_msg_.amplitude_value[151], expected 174, is " + << last_msg_.amplitude_value[151]; + EXPECT_EQ(last_msg_.amplitude_value[152], 165) + << "incorrect value for last_msg_.amplitude_value[152], expected 165, is " + << last_msg_.amplitude_value[152]; + EXPECT_EQ(last_msg_.amplitude_value[153], 211) + << "incorrect value for last_msg_.amplitude_value[153], expected 211, is " + << last_msg_.amplitude_value[153]; + EXPECT_EQ(last_msg_.amplitude_value[154], 241) + << "incorrect value for last_msg_.amplitude_value[154], expected 241, is " + << last_msg_.amplitude_value[154]; + EXPECT_EQ(last_msg_.amplitude_value[155], 13) + << "incorrect value for last_msg_.amplitude_value[155], expected 13, is " + << last_msg_.amplitude_value[155]; + EXPECT_EQ(last_msg_.amplitude_value[156], 16) + << "incorrect value for last_msg_.amplitude_value[156], expected 16, is " + << last_msg_.amplitude_value[156]; + EXPECT_EQ(last_msg_.amplitude_value[157], 61) + << "incorrect value for last_msg_.amplitude_value[157], expected 61, is " + << last_msg_.amplitude_value[157]; + EXPECT_EQ(last_msg_.amplitude_value[158], 141) + << "incorrect value for last_msg_.amplitude_value[158], expected 141, is " + << last_msg_.amplitude_value[158]; + EXPECT_EQ(last_msg_.amplitude_value[159], 101) + << "incorrect value for last_msg_.amplitude_value[159], expected 101, is " + << last_msg_.amplitude_value[159]; + EXPECT_EQ(last_msg_.amplitude_value[160], 89) + << "incorrect value for last_msg_.amplitude_value[160], expected 89, is " + << last_msg_.amplitude_value[160]; + EXPECT_EQ(last_msg_.amplitude_value[161], 37) + << "incorrect value for last_msg_.amplitude_value[161], expected 37, is " + << last_msg_.amplitude_value[161]; + EXPECT_EQ(last_msg_.amplitude_value[162], 117) + << "incorrect value for last_msg_.amplitude_value[162], expected 117, is " + << last_msg_.amplitude_value[162]; + EXPECT_EQ(last_msg_.amplitude_value[163], 189) + << "incorrect value for last_msg_.amplitude_value[163], expected 189, is " + << last_msg_.amplitude_value[163]; + EXPECT_EQ(last_msg_.amplitude_value[164], 86) + << "incorrect value for last_msg_.amplitude_value[164], expected 86, is " + << last_msg_.amplitude_value[164]; + EXPECT_EQ(last_msg_.amplitude_value[165], 118) + << "incorrect value for last_msg_.amplitude_value[165], expected 118, is " + << last_msg_.amplitude_value[165]; + EXPECT_EQ(last_msg_.amplitude_value[166], 176) + << "incorrect value for last_msg_.amplitude_value[166], expected 176, is " + << last_msg_.amplitude_value[166]; + EXPECT_EQ(last_msg_.amplitude_value[167], 228) + << "incorrect value for last_msg_.amplitude_value[167], expected 228, is " + << last_msg_.amplitude_value[167]; + EXPECT_EQ(last_msg_.amplitude_value[168], 12) + << "incorrect value for last_msg_.amplitude_value[168], expected 12, is " + << last_msg_.amplitude_value[168]; + EXPECT_EQ(last_msg_.amplitude_value[169], 14) + << "incorrect value for last_msg_.amplitude_value[169], expected 14, is " + << last_msg_.amplitude_value[169]; + EXPECT_EQ(last_msg_.amplitude_value[170], 119) + << "incorrect value for last_msg_.amplitude_value[170], expected 119, is " + << last_msg_.amplitude_value[170]; + EXPECT_EQ(last_msg_.amplitude_value[171], 135) + << "incorrect value for last_msg_.amplitude_value[171], expected 135, is " + << last_msg_.amplitude_value[171]; + EXPECT_EQ(last_msg_.amplitude_value[172], 129) + << "incorrect value for last_msg_.amplitude_value[172], expected 129, is " + << last_msg_.amplitude_value[172]; + EXPECT_EQ(last_msg_.amplitude_value[173], 243) + << "incorrect value for last_msg_.amplitude_value[173], expected 243, is " + << last_msg_.amplitude_value[173]; + EXPECT_EQ(last_msg_.amplitude_value[174], 50) + << "incorrect value for last_msg_.amplitude_value[174], expected 50, is " + << last_msg_.amplitude_value[174]; + EXPECT_EQ(last_msg_.amplitude_value[175], 29) + << "incorrect value for last_msg_.amplitude_value[175], expected 29, is " + << last_msg_.amplitude_value[175]; + EXPECT_EQ(last_msg_.amplitude_value[176], 207) + << "incorrect value for last_msg_.amplitude_value[176], expected 207, is " + << last_msg_.amplitude_value[176]; + EXPECT_EQ(last_msg_.amplitude_value[177], 198) + << "incorrect value for last_msg_.amplitude_value[177], expected 198, is " + << last_msg_.amplitude_value[177]; + EXPECT_EQ(last_msg_.amplitude_value[178], 117) + << "incorrect value for last_msg_.amplitude_value[178], expected 117, is " + << last_msg_.amplitude_value[178]; + EXPECT_EQ(last_msg_.amplitude_value[179], 100) + << "incorrect value for last_msg_.amplitude_value[179], expected 100, is " + << last_msg_.amplitude_value[179]; + EXPECT_EQ(last_msg_.amplitude_value[180], 225) + << "incorrect value for last_msg_.amplitude_value[180], expected 225, is " + << last_msg_.amplitude_value[180]; + EXPECT_EQ(last_msg_.amplitude_value[181], 6) + << "incorrect value for last_msg_.amplitude_value[181], expected 6, is " + << last_msg_.amplitude_value[181]; + EXPECT_EQ(last_msg_.amplitude_value[182], 139) + << "incorrect value for last_msg_.amplitude_value[182], expected 139, is " + << last_msg_.amplitude_value[182]; + EXPECT_EQ(last_msg_.amplitude_value[183], 110) + << "incorrect value for last_msg_.amplitude_value[183], expected 110, is " + << last_msg_.amplitude_value[183]; + EXPECT_EQ(last_msg_.amplitude_value[184], 39) + << "incorrect value for last_msg_.amplitude_value[184], expected 39, is " + << last_msg_.amplitude_value[184]; + EXPECT_EQ(last_msg_.amplitude_value[185], 210) + << "incorrect value for last_msg_.amplitude_value[185], expected 210, is " + << last_msg_.amplitude_value[185]; + EXPECT_EQ(last_msg_.amplitude_value[186], 68) + << "incorrect value for last_msg_.amplitude_value[186], expected 68, is " + << last_msg_.amplitude_value[186]; + EXPECT_EQ(last_msg_.amplitude_value[187], 199) + << "incorrect value for last_msg_.amplitude_value[187], expected 199, is " + << last_msg_.amplitude_value[187]; + EXPECT_EQ(last_msg_.amplitude_value[188], 43) + << "incorrect value for last_msg_.amplitude_value[188], expected 43, is " + << last_msg_.amplitude_value[188]; + EXPECT_EQ(last_msg_.amplitude_value[189], 132) + << "incorrect value for last_msg_.amplitude_value[189], expected 132, is " + << last_msg_.amplitude_value[189]; + EXPECT_EQ(last_msg_.amplitude_value[190], 64) + << "incorrect value for last_msg_.amplitude_value[190], expected 64, is " + << last_msg_.amplitude_value[190]; + EXPECT_EQ(last_msg_.amplitude_value[191], 17) + << "incorrect value for last_msg_.amplitude_value[191], expected 17, is " + << last_msg_.amplitude_value[191]; + EXPECT_EQ(last_msg_.amplitude_value[192], 51) + << "incorrect value for last_msg_.amplitude_value[192], expected 51, is " + << last_msg_.amplitude_value[192]; + EXPECT_EQ(last_msg_.amplitude_value[193], 173) + << "incorrect value for last_msg_.amplitude_value[193], expected 173, is " + << last_msg_.amplitude_value[193]; + EXPECT_EQ(last_msg_.amplitude_value[194], 181) + << "incorrect value for last_msg_.amplitude_value[194], expected 181, is " + << last_msg_.amplitude_value[194]; + EXPECT_EQ(last_msg_.amplitude_value[195], 12) + << "incorrect value for last_msg_.amplitude_value[195], expected 12, is " + << last_msg_.amplitude_value[195]; + EXPECT_EQ(last_msg_.amplitude_value[196], 140) + << "incorrect value for last_msg_.amplitude_value[196], expected 140, is " + << last_msg_.amplitude_value[196]; + EXPECT_EQ(last_msg_.amplitude_value[197], 16) + << "incorrect value for last_msg_.amplitude_value[197], expected 16, is " + << last_msg_.amplitude_value[197]; + EXPECT_EQ(last_msg_.amplitude_value[198], 247) + << "incorrect value for last_msg_.amplitude_value[198], expected 247, is " + << last_msg_.amplitude_value[198]; + EXPECT_EQ(last_msg_.amplitude_value[199], 84) + << "incorrect value for last_msg_.amplitude_value[199], expected 84, is " + << last_msg_.amplitude_value[199]; + EXPECT_EQ(last_msg_.amplitude_value[200], 183) + << "incorrect value for last_msg_.amplitude_value[200], expected 183, is " + << last_msg_.amplitude_value[200]; + EXPECT_EQ(last_msg_.amplitude_value[201], 105) + << "incorrect value for last_msg_.amplitude_value[201], expected 105, is " + << last_msg_.amplitude_value[201]; + EXPECT_EQ(last_msg_.amplitude_value[202], 39) + << "incorrect value for last_msg_.amplitude_value[202], expected 39, is " + << last_msg_.amplitude_value[202]; + EXPECT_EQ(last_msg_.amplitude_value[203], 157) + << "incorrect value for last_msg_.amplitude_value[203], expected 157, is " + << last_msg_.amplitude_value[203]; + EXPECT_EQ(last_msg_.amplitude_value[204], 77) + << "incorrect value for last_msg_.amplitude_value[204], expected 77, is " + << last_msg_.amplitude_value[204]; + EXPECT_EQ(last_msg_.amplitude_value[205], 30) + << "incorrect value for last_msg_.amplitude_value[205], expected 30, is " + << last_msg_.amplitude_value[205]; + EXPECT_EQ(last_msg_.amplitude_value[206], 205) + << "incorrect value for last_msg_.amplitude_value[206], expected 205, is " + << last_msg_.amplitude_value[206]; + EXPECT_EQ(last_msg_.amplitude_value[207], 194) + << "incorrect value for last_msg_.amplitude_value[207], expected 194, is " + << last_msg_.amplitude_value[207]; + EXPECT_EQ(last_msg_.amplitude_value[208], 59) + << "incorrect value for last_msg_.amplitude_value[208], expected 59, is " + << last_msg_.amplitude_value[208]; + EXPECT_EQ(last_msg_.amplitude_value[209], 64) + << "incorrect value for last_msg_.amplitude_value[209], expected 64, is " + << last_msg_.amplitude_value[209]; + EXPECT_EQ(last_msg_.amplitude_value[210], 241) + << "incorrect value for last_msg_.amplitude_value[210], expected 241, is " + << last_msg_.amplitude_value[210]; + EXPECT_EQ(last_msg_.amplitude_value[211], 183) + << "incorrect value for last_msg_.amplitude_value[211], expected 183, is " + << last_msg_.amplitude_value[211]; + EXPECT_EQ(last_msg_.amplitude_value[212], 238) + << "incorrect value for last_msg_.amplitude_value[212], expected 238, is " + << last_msg_.amplitude_value[212]; + EXPECT_EQ(last_msg_.amplitude_value[213], 105) + << "incorrect value for last_msg_.amplitude_value[213], expected 105, is " + << last_msg_.amplitude_value[213]; + EXPECT_EQ(last_msg_.amplitude_value[214], 181) + << "incorrect value for last_msg_.amplitude_value[214], expected 181, is " + << last_msg_.amplitude_value[214]; + EXPECT_EQ(last_msg_.amplitude_value[215], 170) + << "incorrect value for last_msg_.amplitude_value[215], expected 170, is " + << last_msg_.amplitude_value[215]; + EXPECT_EQ(last_msg_.amplitude_value[216], 45) + << "incorrect value for last_msg_.amplitude_value[216], expected 45, is " + << last_msg_.amplitude_value[216]; + EXPECT_EQ(last_msg_.amplitude_value[217], 8) + << "incorrect value for last_msg_.amplitude_value[217], expected 8, is " + << last_msg_.amplitude_value[217]; + EXPECT_EQ(last_msg_.amplitude_value[218], 166) + << "incorrect value for last_msg_.amplitude_value[218], expected 166, is " + << last_msg_.amplitude_value[218]; + EXPECT_EQ(last_msg_.amplitude_value[219], 164) + << "incorrect value for last_msg_.amplitude_value[219], expected 164, is " + << last_msg_.amplitude_value[219]; + EXPECT_EQ(last_msg_.amplitude_value[220], 238) + << "incorrect value for last_msg_.amplitude_value[220], expected 238, is " + << last_msg_.amplitude_value[220]; + EXPECT_EQ(last_msg_.amplitude_value[221], 83) + << "incorrect value for last_msg_.amplitude_value[221], expected 83, is " + << last_msg_.amplitude_value[221]; + EXPECT_EQ(last_msg_.amplitude_value[222], 148) + << "incorrect value for last_msg_.amplitude_value[222], expected 148, is " + << last_msg_.amplitude_value[222]; + EXPECT_EQ(last_msg_.amplitude_value[223], 173) + << "incorrect value for last_msg_.amplitude_value[223], expected 173, is " + << last_msg_.amplitude_value[223]; + EXPECT_EQ(last_msg_.amplitude_value[224], 108) + << "incorrect value for last_msg_.amplitude_value[224], expected 108, is " + << last_msg_.amplitude_value[224]; + EXPECT_EQ(last_msg_.amplitude_value[225], 228) + << "incorrect value for last_msg_.amplitude_value[225], expected 228, is " + << last_msg_.amplitude_value[225]; + EXPECT_EQ(last_msg_.amplitude_value[226], 67) + << "incorrect value for last_msg_.amplitude_value[226], expected 67, is " + << last_msg_.amplitude_value[226]; + EXPECT_EQ(last_msg_.amplitude_value[227], 89) + << "incorrect value for last_msg_.amplitude_value[227], expected 89, is " + << last_msg_.amplitude_value[227]; + EXPECT_EQ(last_msg_.amplitude_value[228], 189) + << "incorrect value for last_msg_.amplitude_value[228], expected 189, is " + << last_msg_.amplitude_value[228]; + EXPECT_EQ(last_msg_.amplitude_value[229], 67) + << "incorrect value for last_msg_.amplitude_value[229], expected 67, is " + << last_msg_.amplitude_value[229]; + EXPECT_EQ(last_msg_.amplitude_value[230], 26) + << "incorrect value for last_msg_.amplitude_value[230], expected 26, is " + << last_msg_.amplitude_value[230]; + EXPECT_EQ(last_msg_.channel_tag, 5878) + << "incorrect value for last_msg_.channel_tag, expected 5878, is " + << last_msg_.channel_tag; + EXPECT_LT((last_msg_.freq_ref * 100 - 6348.20019531 * 100), 0.05) + << "incorrect value for last_msg_.freq_ref, expected 6348.20019531, is " + << last_msg_.freq_ref; + EXPECT_LT((last_msg_.freq_step * 100 - 4608.20019531 * 100), 0.05) + << "incorrect value for last_msg_.freq_step, expected 4608.20019531, is " + << last_msg_.freq_step; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_amplitude_value.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_amplitude_value.handle_as, " + "expected string '" + << check_string << "', is '" << last_msg_.n_amplitude_value.handle_as + << "'"; + } + { + const char check_string[] = {(char)97, (char)109, (char)112, (char)108, + (char)105, (char)116, (char)117, (char)100, + (char)101, (char)95, (char)118, (char)97, + (char)108, (char)117, (char)101}; + EXPECT_EQ(memcmp(last_msg_.n_amplitude_value.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_amplitude_value.relates_to, " + "expected string '" + << check_string << "', is '" << last_msg_.n_amplitude_value.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_amplitude_value.value, 231) + << "incorrect value for last_msg_.n_amplitude_value.value, expected 231, " + "is " + << last_msg_.n_amplitude_value.value; + EXPECT_EQ(last_msg_.t.tow, 992295133) + << "incorrect value for last_msg_.t.tow, expected 992295133, is " + << last_msg_.t.tow; + EXPECT_EQ(last_msg_.t.wn, 6957) + << "incorrect value for last_msg_.t.wn, expected 6957, is " + << last_msg_.t.wn; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgThreadState.cc b/c/test/cpp/auto_check_sbp_piksi_MsgThreadState.cc index eda6de793..d73b9c2ea 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgThreadState.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgThreadState.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgThreadState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgThreadState.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgThreadState0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgThreadState0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgThreadState0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgThreadState0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_thread_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,92 +67,98 @@ class Test_auto_check_sbp_piksi_MsgThreadState0 : sbp_msg_thread_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgThreadState0, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,246,215,26,109,97,105,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,156,9,0,0,73,138, }; - - sbp_msg_thread_state_t test_msg{}; - test_msg.cpu = 0; - { - const char assign_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.name, assign_string, sizeof(assign_string)); - } - test_msg.stack_free = 2460; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu, 0) << "incorrect value for last_msg_.cpu, expected 0, is " << last_msg_.cpu; - { - const char check_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.name, expected string '" << check_string << "', is '" << last_msg_.name << "'"; - } - EXPECT_EQ(last_msg_.stack_free, 2460) << "incorrect value for last_msg_.stack_free, expected 2460, is " << last_msg_.stack_free; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgThreadState0, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 109, 97, 105, 110, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 9, 0, 0, 73, 138, + }; + + sbp_msg_thread_state_t test_msg{}; + test_msg.cpu = 0; + { + const char assign_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.name, assign_string, sizeof(assign_string)); + } + test_msg.stack_free = 2460; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu, 0) + << "incorrect value for last_msg_.cpu, expected 0, is " << last_msg_.cpu; + { + const char check_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.name, expected string '" + << check_string << "', is '" << last_msg_.name << "'"; + } + EXPECT_EQ(last_msg_.stack_free, 2460) + << "incorrect value for last_msg_.stack_free, expected 2460, is " + << last_msg_.stack_free; } -class Test_auto_check_sbp_piksi_MsgThreadState1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgThreadState1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgThreadState1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgThreadState1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_thread_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -164,92 +166,99 @@ class Test_auto_check_sbp_piksi_MsgThreadState1 : sbp_msg_thread_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgThreadState1, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,246,215,26,105,100,108,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,2,36,0,0,0,151,20, }; - - sbp_msg_thread_state_t test_msg{}; - test_msg.cpu = 595; - { - const char assign_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.name, assign_string, sizeof(assign_string)); - } - test_msg.stack_free = 36; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu, 595) << "incorrect value for last_msg_.cpu, expected 595, is " << last_msg_.cpu; - { - const char check_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.name, expected string '" << check_string << "', is '" << last_msg_.name << "'"; - } - EXPECT_EQ(last_msg_.stack_free, 36) << "incorrect value for last_msg_.stack_free, expected 36, is " << last_msg_.stack_free; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgThreadState1, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 105, 100, 108, 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 2, 36, 0, 0, 0, 151, 20, + }; + + sbp_msg_thread_state_t test_msg{}; + test_msg.cpu = 595; + { + const char assign_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.name, assign_string, sizeof(assign_string)); + } + test_msg.stack_free = 36; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu, 595) + << "incorrect value for last_msg_.cpu, expected 595, is " + << last_msg_.cpu; + { + const char check_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.name, expected string '" + << check_string << "', is '" << last_msg_.name << "'"; + } + EXPECT_EQ(last_msg_.stack_free, 36) + << "incorrect value for last_msg_.stack_free, expected 36, is " + << last_msg_.stack_free; } -class Test_auto_check_sbp_piksi_MsgThreadState2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgThreadState2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgThreadState2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgThreadState2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_thread_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -257,92 +266,98 @@ class Test_auto_check_sbp_piksi_MsgThreadState2 : sbp_msg_thread_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgThreadState2, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,246,215,26,78,65,80,32,73,83,82,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,116,4,0,0,226,60, }; - - sbp_msg_thread_state_t test_msg{}; - test_msg.cpu = 14; - { - const char assign_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.name, assign_string, sizeof(assign_string)); - } - test_msg.stack_free = 1140; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu, 14) << "incorrect value for last_msg_.cpu, expected 14, is " << last_msg_.cpu; - { - const char check_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.name, expected string '" << check_string << "', is '" << last_msg_.name << "'"; - } - EXPECT_EQ(last_msg_.stack_free, 1140) << "incorrect value for last_msg_.stack_free, expected 1140, is " << last_msg_.stack_free; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgThreadState2, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 78, 65, 80, 32, 73, 83, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 116, 4, 0, 0, 226, 60, + }; + + sbp_msg_thread_state_t test_msg{}; + test_msg.cpu = 14; + { + const char assign_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.name, assign_string, sizeof(assign_string)); + } + test_msg.stack_free = 1140; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu, 14) + << "incorrect value for last_msg_.cpu, expected 14, is " << last_msg_.cpu; + { + const char check_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.name, expected string '" + << check_string << "', is '" << last_msg_.name << "'"; + } + EXPECT_EQ(last_msg_.stack_free, 1140) + << "incorrect value for last_msg_.stack_free, expected 1140, is " + << last_msg_.stack_free; } -class Test_auto_check_sbp_piksi_MsgThreadState3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgThreadState3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgThreadState3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgThreadState3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_thread_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -350,92 +365,98 @@ class Test_auto_check_sbp_piksi_MsgThreadState3 : sbp_msg_thread_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgThreadState3, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,246,215,26,83,66,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,196,19,0,0,90,169, }; - - sbp_msg_thread_state_t test_msg{}; - test_msg.cpu = 1; - { - const char assign_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.name, assign_string, sizeof(assign_string)); - } - test_msg.stack_free = 5060; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu, 1) << "incorrect value for last_msg_.cpu, expected 1, is " << last_msg_.cpu; - { - const char check_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.name, expected string '" << check_string << "', is '" << last_msg_.name << "'"; - } - EXPECT_EQ(last_msg_.stack_free, 5060) << "incorrect value for last_msg_.stack_free, expected 5060, is " << last_msg_.stack_free; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgThreadState3, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 83, 66, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 196, 19, 0, 0, 90, 169, + }; + + sbp_msg_thread_state_t test_msg{}; + test_msg.cpu = 1; + { + const char assign_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.name, assign_string, sizeof(assign_string)); + } + test_msg.stack_free = 5060; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu, 1) + << "incorrect value for last_msg_.cpu, expected 1, is " << last_msg_.cpu; + { + const char check_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.name, expected string '" + << check_string << "', is '" << last_msg_.name << "'"; + } + EXPECT_EQ(last_msg_.stack_free, 5060) + << "incorrect value for last_msg_.stack_free, expected 5060, is " + << last_msg_.stack_free; } -class Test_auto_check_sbp_piksi_MsgThreadState4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgThreadState4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgThreadState4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgThreadState4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_thread_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -443,92 +464,100 @@ class Test_auto_check_sbp_piksi_MsgThreadState4 : sbp_msg_thread_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgThreadState4, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,246,215,26,109,97,110,97,103,101,32,97,99,113,0,0,0,0,0,0,0,0,0,0,7,0,20,9,0,0,47,75, }; - - sbp_msg_thread_state_t test_msg{}; - test_msg.cpu = 7; - { - const char assign_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.name, assign_string, sizeof(assign_string)); - } - test_msg.stack_free = 2324; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu, 7) << "incorrect value for last_msg_.cpu, expected 7, is " << last_msg_.cpu; - { - const char check_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.name, expected string '" << check_string << "', is '" << last_msg_.name << "'"; - } - EXPECT_EQ(last_msg_.stack_free, 2324) << "incorrect value for last_msg_.stack_free, expected 2324, is " << last_msg_.stack_free; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgThreadState4, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 109, 97, 110, 97, 103, 101, 32, 97, 99, 113, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 20, 9, 0, 0, 47, 75, + }; + + sbp_msg_thread_state_t test_msg{}; + test_msg.cpu = 7; + { + const char assign_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.name, assign_string, sizeof(assign_string)); + } + test_msg.stack_free = 2324; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu, 7) + << "incorrect value for last_msg_.cpu, expected 7, is " << last_msg_.cpu; + { + const char check_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.name, expected string '" + << check_string << "', is '" << last_msg_.name << "'"; + } + EXPECT_EQ(last_msg_.stack_free, 2324) + << "incorrect value for last_msg_.stack_free, expected 2324, is " + << last_msg_.stack_free; } -class Test_auto_check_sbp_piksi_MsgThreadState5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgThreadState5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgThreadState5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgThreadState5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_thread_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -536,92 +565,98 @@ class Test_auto_check_sbp_piksi_MsgThreadState5 : sbp_msg_thread_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgThreadState5, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,195,4,26,109,97,105,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148,9,0,0,195,212, }; - - sbp_msg_thread_state_t test_msg{}; - test_msg.cpu = 0; - { - const char assign_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.name, assign_string, sizeof(assign_string)); - } - test_msg.stack_free = 2452; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu, 0) << "incorrect value for last_msg_.cpu, expected 0, is " << last_msg_.cpu; - { - const char check_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.name, expected string '" << check_string << "', is '" << last_msg_.name << "'"; - } - EXPECT_EQ(last_msg_.stack_free, 2452) << "incorrect value for last_msg_.stack_free, expected 2452, is " << last_msg_.stack_free; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgThreadState5, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 109, 97, 105, 110, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 9, 0, 0, 195, 212, + }; + + sbp_msg_thread_state_t test_msg{}; + test_msg.cpu = 0; + { + const char assign_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.name, assign_string, sizeof(assign_string)); + } + test_msg.stack_free = 2452; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu, 0) + << "incorrect value for last_msg_.cpu, expected 0, is " << last_msg_.cpu; + { + const char check_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.name, expected string '" + << check_string << "', is '" << last_msg_.name << "'"; + } + EXPECT_EQ(last_msg_.stack_free, 2452) + << "incorrect value for last_msg_.stack_free, expected 2452, is " + << last_msg_.stack_free; } -class Test_auto_check_sbp_piksi_MsgThreadState6 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgThreadState6() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgThreadState6 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgThreadState6() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_thread_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -629,92 +664,99 @@ class Test_auto_check_sbp_piksi_MsgThreadState6 : sbp_msg_thread_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgThreadState6, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,195,4,26,105,100,108,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,228,1,36,0,0,0,225,18, }; - - sbp_msg_thread_state_t test_msg{}; - test_msg.cpu = 484; - { - const char assign_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.name, assign_string, sizeof(assign_string)); - } - test_msg.stack_free = 36; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu, 484) << "incorrect value for last_msg_.cpu, expected 484, is " << last_msg_.cpu; - { - const char check_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.name, expected string '" << check_string << "', is '" << last_msg_.name << "'"; - } - EXPECT_EQ(last_msg_.stack_free, 36) << "incorrect value for last_msg_.stack_free, expected 36, is " << last_msg_.stack_free; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgThreadState6, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 105, 100, 108, 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 1, 36, 0, 0, 0, 225, 18, + }; + + sbp_msg_thread_state_t test_msg{}; + test_msg.cpu = 484; + { + const char assign_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.name, assign_string, sizeof(assign_string)); + } + test_msg.stack_free = 36; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu, 484) + << "incorrect value for last_msg_.cpu, expected 484, is " + << last_msg_.cpu; + { + const char check_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.name, expected string '" + << check_string << "', is '" << last_msg_.name << "'"; + } + EXPECT_EQ(last_msg_.stack_free, 36) + << "incorrect value for last_msg_.stack_free, expected 36, is " + << last_msg_.stack_free; } -class Test_auto_check_sbp_piksi_MsgThreadState7 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgThreadState7() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgThreadState7 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgThreadState7() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_thread_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -722,92 +764,99 @@ class Test_auto_check_sbp_piksi_MsgThreadState7 : sbp_msg_thread_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgThreadState7, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,195,4,26,78,65,80,32,73,83,82,0,0,0,0,0,0,0,0,0,0,0,0,0,138,1,92,7,0,0,166,116, }; - - sbp_msg_thread_state_t test_msg{}; - test_msg.cpu = 394; - { - const char assign_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.name, assign_string, sizeof(assign_string)); - } - test_msg.stack_free = 1884; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu, 394) << "incorrect value for last_msg_.cpu, expected 394, is " << last_msg_.cpu; - { - const char check_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.name, expected string '" << check_string << "', is '" << last_msg_.name << "'"; - } - EXPECT_EQ(last_msg_.stack_free, 1884) << "incorrect value for last_msg_.stack_free, expected 1884, is " << last_msg_.stack_free; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgThreadState7, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 78, 65, 80, 32, 73, 83, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 1, 92, 7, 0, 0, 166, 116, + }; + + sbp_msg_thread_state_t test_msg{}; + test_msg.cpu = 394; + { + const char assign_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.name, assign_string, sizeof(assign_string)); + } + test_msg.stack_free = 1884; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu, 394) + << "incorrect value for last_msg_.cpu, expected 394, is " + << last_msg_.cpu; + { + const char check_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.name, expected string '" + << check_string << "', is '" << last_msg_.name << "'"; + } + EXPECT_EQ(last_msg_.stack_free, 1884) + << "incorrect value for last_msg_.stack_free, expected 1884, is " + << last_msg_.stack_free; } -class Test_auto_check_sbp_piksi_MsgThreadState8 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgThreadState8() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgThreadState8 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgThreadState8() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_thread_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -815,92 +864,98 @@ class Test_auto_check_sbp_piksi_MsgThreadState8 : sbp_msg_thread_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgThreadState8, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,195,4,26,83,66,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,4,12,0,0,229,174, }; - - sbp_msg_thread_state_t test_msg{}; - test_msg.cpu = 1; - { - const char assign_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.name, assign_string, sizeof(assign_string)); - } - test_msg.stack_free = 3076; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu, 1) << "incorrect value for last_msg_.cpu, expected 1, is " << last_msg_.cpu; - { - const char check_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.name, expected string '" << check_string << "', is '" << last_msg_.name << "'"; - } - EXPECT_EQ(last_msg_.stack_free, 3076) << "incorrect value for last_msg_.stack_free, expected 3076, is " << last_msg_.stack_free; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgThreadState8, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 83, 66, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 12, 0, 0, 229, 174, + }; + + sbp_msg_thread_state_t test_msg{}; + test_msg.cpu = 1; + { + const char assign_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.name, assign_string, sizeof(assign_string)); + } + test_msg.stack_free = 3076; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu, 1) + << "incorrect value for last_msg_.cpu, expected 1, is " << last_msg_.cpu; + { + const char check_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.name, expected string '" + << check_string << "', is '" << last_msg_.name << "'"; + } + EXPECT_EQ(last_msg_.stack_free, 3076) + << "incorrect value for last_msg_.stack_free, expected 3076, is " + << last_msg_.stack_free; } -class Test_auto_check_sbp_piksi_MsgThreadState9 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgThreadState9() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgThreadState9 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgThreadState9() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_thread_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -908,92 +963,100 @@ class Test_auto_check_sbp_piksi_MsgThreadState9 : sbp_msg_thread_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgThreadState9, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,195,4,26,109,97,110,97,103,101,32,97,99,113,0,0,0,0,0,0,0,0,0,0,10,0,124,9,0,0,52,2, }; - - sbp_msg_thread_state_t test_msg{}; - test_msg.cpu = 10; - { - const char assign_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.name, assign_string, sizeof(assign_string)); - } - test_msg.stack_free = 2428; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu, 10) << "incorrect value for last_msg_.cpu, expected 10, is " << last_msg_.cpu; - { - const char check_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.name, expected string '" << check_string << "', is '" << last_msg_.name << "'"; - } - EXPECT_EQ(last_msg_.stack_free, 2428) << "incorrect value for last_msg_.stack_free, expected 2428, is " << last_msg_.stack_free; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgThreadState9, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 109, 97, 110, 97, 103, 101, 32, 97, 99, 113, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 124, 9, 0, 0, 52, 2, + }; + + sbp_msg_thread_state_t test_msg{}; + test_msg.cpu = 10; + { + const char assign_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.name, assign_string, sizeof(assign_string)); + } + test_msg.stack_free = 2428; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu, 10) + << "incorrect value for last_msg_.cpu, expected 10, is " << last_msg_.cpu; + { + const char check_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.name, expected string '" + << check_string << "', is '" << last_msg_.name << "'"; + } + EXPECT_EQ(last_msg_.stack_free, 2428) + << "incorrect value for last_msg_.stack_free, expected 2428, is " + << last_msg_.stack_free; } -class Test_auto_check_sbp_piksi_MsgThreadState10 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgThreadState10() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgThreadState10 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgThreadState10() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_thread_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -1001,42 +1064,56 @@ class Test_auto_check_sbp_piksi_MsgThreadState10 : sbp_msg_thread_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgThreadState10, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,195,4,26,109,97,110,97,103,101,32,116,114,97,99,107,0,0,0,0,0,0,0,0,0,0,28,9,0,0,122,54, }; - - sbp_msg_thread_state_t test_msg{}; - test_msg.cpu = 0; - { - const char assign_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)116,(char)114,(char)97,(char)99,(char)107,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg.name, assign_string, sizeof(assign_string)); - } - test_msg.stack_free = 2332; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cpu, 0) << "incorrect value for last_msg_.cpu, expected 0, is " << last_msg_.cpu; - { - const char check_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)116,(char)114,(char)97,(char)99,(char)107,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.name, expected string '" << check_string << "', is '" << last_msg_.name << "'"; - } - EXPECT_EQ(last_msg_.stack_free, 2332) << "incorrect value for last_msg_.stack_free, expected 2332, is " << last_msg_.stack_free; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgThreadState10, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 109, 97, 110, 97, 103, 101, 32, 116, 114, 97, 99, + 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 9, 0, 0, 122, 54, + }; + + sbp_msg_thread_state_t test_msg{}; + test_msg.cpu = 0; + { + const char assign_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)116, + (char)114, (char)97, (char)99, (char)107, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg.name, assign_string, sizeof(assign_string)); + } + test_msg.stack_free = 2332; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cpu, 0) + << "incorrect value for last_msg_.cpu, expected 0, is " << last_msg_.cpu; + { + const char check_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)116, + (char)114, (char)97, (char)99, (char)107, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_.name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_.name, expected string '" + << check_string << "', is '" << last_msg_.name << "'"; + } + EXPECT_EQ(last_msg_.stack_free, 2332) + << "incorrect value for last_msg_.stack_free, expected 2332, is " + << last_msg_.stack_free; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgUartState.cc b/c/test/cpp/auto_check_sbp_piksi_MsgUartState.cc index 7c8981b84..455776aef 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgUartState.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgUartState.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartState.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgUartState0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgUartState0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgUartState0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgUartState0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_uart_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_uart_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,82 +67,164 @@ class Test_auto_check_sbp_piksi_MsgUartState0 : sbp_msg_uart_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgUartState0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgUartState0, Test) { + uint8_t encoded_frame[] = { + 85, 29, 0, 200, 224, 74, 154, 169, 242, 69, 102, 166, 231, 68, + 89, 98, 79, 184, 138, 244, 154, 73, 201, 69, 154, 65, 211, 69, + 201, 16, 103, 249, 143, 161, 154, 17, 186, 69, 51, 211, 7, 69, + 215, 149, 253, 25, 218, 24, 29, 195, 16, 19, 159, 142, 71, 17, + 10, 113, 137, 219, 135, 18, 182, 21, 38, 190, 59, 196, 169, 155, + 107, 111, 253, 168, 244, 158, 112, 19, 251, 131, 100, 225, + }; - uint8_t encoded_frame[] = {85,29,0,200,224,74,154,169,242,69,102,166,231,68,89,98,79,184,138,244,154,73,201,69,154,65,211,69,201,16,103,249,143,161,154,17,186,69,51,211,7,69,215,149,253,25,218,24,29,195,16,19,159,142,71,17,10,113,137,219,135,18,182,21,38,190,59,196,169,155,107,111,253,168,244,158,112,19,251,131,100,225, }; + sbp_msg_uart_state_t test_msg{}; + test_msg.latency.avg = 319865629; + test_msg.latency.current = 364253831; + test_msg.latency.lmax = -611749622; + test_msg.latency.lmin = 289902239; + test_msg.obs_period.avg = -1002717658; + test_msg.obs_period.current = -2080697488; + test_msg.obs_period.pmax = -1628133123; + test_msg.obs_period.pmin = 1869323177; + test_msg.uart_a.crc_error_count = 25177; + test_msg.uart_a.io_error_count = 47183; + test_msg.uart_a.rx_buffer_level = 244; + test_msg.uart_a.rx_throughput = 1853.199951171875; + test_msg.uart_a.tx_buffer_level = 138; + test_msg.uart_a.tx_throughput = 7765.2001953125; + test_msg.uart_b.crc_error_count = 4297; + test_msg.uart_b.io_error_count = 63847; + test_msg.uart_b.rx_buffer_level = 161; + test_msg.uart_b.rx_throughput = 6760.2001953125; + test_msg.uart_b.tx_buffer_level = 143; + test_msg.uart_b.tx_throughput = 6441.2001953125; + test_msg.uart_ftdi.crc_error_count = 38359; + test_msg.uart_ftdi.io_error_count = 6653; + test_msg.uart_ftdi.rx_buffer_level = 24; + test_msg.uart_ftdi.rx_throughput = 2173.199951171875; + test_msg.uart_ftdi.tx_buffer_level = 218; + test_msg.uart_ftdi.tx_throughput = 5954.2001953125; - sbp_msg_uart_state_t test_msg{}; - test_msg.latency.avg = 319865629; - test_msg.latency.current = 364253831; - test_msg.latency.lmax = -611749622; - test_msg.latency.lmin = 289902239; - test_msg.obs_period.avg = -1002717658; - test_msg.obs_period.current = -2080697488; - test_msg.obs_period.pmax = -1628133123; - test_msg.obs_period.pmin = 1869323177; - test_msg.uart_a.crc_error_count = 25177; - test_msg.uart_a.io_error_count = 47183; - test_msg.uart_a.rx_buffer_level = 244; - test_msg.uart_a.rx_throughput = 1853.199951171875; - test_msg.uart_a.tx_buffer_level = 138; - test_msg.uart_a.tx_throughput = 7765.2001953125; - test_msg.uart_b.crc_error_count = 4297; - test_msg.uart_b.io_error_count = 63847; - test_msg.uart_b.rx_buffer_level = 161; - test_msg.uart_b.rx_throughput = 6760.2001953125; - test_msg.uart_b.tx_buffer_level = 143; - test_msg.uart_b.tx_throughput = 6441.2001953125; - test_msg.uart_ftdi.crc_error_count = 38359; - test_msg.uart_ftdi.io_error_count = 6653; - test_msg.uart_ftdi.rx_buffer_level = 24; - test_msg.uart_ftdi.rx_throughput = 2173.199951171875; - test_msg.uart_ftdi.tx_buffer_level = 218; - test_msg.uart_ftdi.tx_throughput = 5954.2001953125; - - EXPECT_EQ(send_message( 57544, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(57544, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 57544); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.latency.avg, 319865629) << "incorrect value for last_msg_.latency.avg, expected 319865629, is " << last_msg_.latency.avg; - EXPECT_EQ(last_msg_.latency.current, 364253831) << "incorrect value for last_msg_.latency.current, expected 364253831, is " << last_msg_.latency.current; - EXPECT_EQ(last_msg_.latency.lmax, -611749622) << "incorrect value for last_msg_.latency.lmax, expected -611749622, is " << last_msg_.latency.lmax; - EXPECT_EQ(last_msg_.latency.lmin, 289902239) << "incorrect value for last_msg_.latency.lmin, expected 289902239, is " << last_msg_.latency.lmin; - EXPECT_EQ(last_msg_.obs_period.avg, -1002717658) << "incorrect value for last_msg_.obs_period.avg, expected -1002717658, is " << last_msg_.obs_period.avg; - EXPECT_EQ(last_msg_.obs_period.current, -2080697488) << "incorrect value for last_msg_.obs_period.current, expected -2080697488, is " << last_msg_.obs_period.current; - EXPECT_EQ(last_msg_.obs_period.pmax, -1628133123) << "incorrect value for last_msg_.obs_period.pmax, expected -1628133123, is " << last_msg_.obs_period.pmax; - EXPECT_EQ(last_msg_.obs_period.pmin, 1869323177) << "incorrect value for last_msg_.obs_period.pmin, expected 1869323177, is " << last_msg_.obs_period.pmin; - EXPECT_EQ(last_msg_.uart_a.crc_error_count, 25177) << "incorrect value for last_msg_.uart_a.crc_error_count, expected 25177, is " << last_msg_.uart_a.crc_error_count; - EXPECT_EQ(last_msg_.uart_a.io_error_count, 47183) << "incorrect value for last_msg_.uart_a.io_error_count, expected 47183, is " << last_msg_.uart_a.io_error_count; - EXPECT_EQ(last_msg_.uart_a.rx_buffer_level, 244) << "incorrect value for last_msg_.uart_a.rx_buffer_level, expected 244, is " << last_msg_.uart_a.rx_buffer_level; - EXPECT_LT((last_msg_.uart_a.rx_throughput * 100 - 1853.19995117 * 100), 0.05) << "incorrect value for last_msg_.uart_a.rx_throughput, expected 1853.19995117, is " << last_msg_.uart_a.rx_throughput; - EXPECT_EQ(last_msg_.uart_a.tx_buffer_level, 138) << "incorrect value for last_msg_.uart_a.tx_buffer_level, expected 138, is " << last_msg_.uart_a.tx_buffer_level; - EXPECT_LT((last_msg_.uart_a.tx_throughput * 100 - 7765.20019531 * 100), 0.05) << "incorrect value for last_msg_.uart_a.tx_throughput, expected 7765.20019531, is " << last_msg_.uart_a.tx_throughput; - EXPECT_EQ(last_msg_.uart_b.crc_error_count, 4297) << "incorrect value for last_msg_.uart_b.crc_error_count, expected 4297, is " << last_msg_.uart_b.crc_error_count; - EXPECT_EQ(last_msg_.uart_b.io_error_count, 63847) << "incorrect value for last_msg_.uart_b.io_error_count, expected 63847, is " << last_msg_.uart_b.io_error_count; - EXPECT_EQ(last_msg_.uart_b.rx_buffer_level, 161) << "incorrect value for last_msg_.uart_b.rx_buffer_level, expected 161, is " << last_msg_.uart_b.rx_buffer_level; - EXPECT_LT((last_msg_.uart_b.rx_throughput * 100 - 6760.20019531 * 100), 0.05) << "incorrect value for last_msg_.uart_b.rx_throughput, expected 6760.20019531, is " << last_msg_.uart_b.rx_throughput; - EXPECT_EQ(last_msg_.uart_b.tx_buffer_level, 143) << "incorrect value for last_msg_.uart_b.tx_buffer_level, expected 143, is " << last_msg_.uart_b.tx_buffer_level; - EXPECT_LT((last_msg_.uart_b.tx_throughput * 100 - 6441.20019531 * 100), 0.05) << "incorrect value for last_msg_.uart_b.tx_throughput, expected 6441.20019531, is " << last_msg_.uart_b.tx_throughput; - EXPECT_EQ(last_msg_.uart_ftdi.crc_error_count, 38359) << "incorrect value for last_msg_.uart_ftdi.crc_error_count, expected 38359, is " << last_msg_.uart_ftdi.crc_error_count; - EXPECT_EQ(last_msg_.uart_ftdi.io_error_count, 6653) << "incorrect value for last_msg_.uart_ftdi.io_error_count, expected 6653, is " << last_msg_.uart_ftdi.io_error_count; - EXPECT_EQ(last_msg_.uart_ftdi.rx_buffer_level, 24) << "incorrect value for last_msg_.uart_ftdi.rx_buffer_level, expected 24, is " << last_msg_.uart_ftdi.rx_buffer_level; - EXPECT_LT((last_msg_.uart_ftdi.rx_throughput * 100 - 2173.19995117 * 100), 0.05) << "incorrect value for last_msg_.uart_ftdi.rx_throughput, expected 2173.19995117, is " << last_msg_.uart_ftdi.rx_throughput; - EXPECT_EQ(last_msg_.uart_ftdi.tx_buffer_level, 218) << "incorrect value for last_msg_.uart_ftdi.tx_buffer_level, expected 218, is " << last_msg_.uart_ftdi.tx_buffer_level; - EXPECT_LT((last_msg_.uart_ftdi.tx_throughput * 100 - 5954.20019531 * 100), 0.05) << "incorrect value for last_msg_.uart_ftdi.tx_throughput, expected 5954.20019531, is " << last_msg_.uart_ftdi.tx_throughput; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 57544); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.latency.avg, 319865629) + << "incorrect value for last_msg_.latency.avg, expected 319865629, is " + << last_msg_.latency.avg; + EXPECT_EQ(last_msg_.latency.current, 364253831) + << "incorrect value for last_msg_.latency.current, expected 364253831, " + "is " + << last_msg_.latency.current; + EXPECT_EQ(last_msg_.latency.lmax, -611749622) + << "incorrect value for last_msg_.latency.lmax, expected -611749622, is " + << last_msg_.latency.lmax; + EXPECT_EQ(last_msg_.latency.lmin, 289902239) + << "incorrect value for last_msg_.latency.lmin, expected 289902239, is " + << last_msg_.latency.lmin; + EXPECT_EQ(last_msg_.obs_period.avg, -1002717658) + << "incorrect value for last_msg_.obs_period.avg, expected -1002717658, " + "is " + << last_msg_.obs_period.avg; + EXPECT_EQ(last_msg_.obs_period.current, -2080697488) + << "incorrect value for last_msg_.obs_period.current, expected " + "-2080697488, is " + << last_msg_.obs_period.current; + EXPECT_EQ(last_msg_.obs_period.pmax, -1628133123) + << "incorrect value for last_msg_.obs_period.pmax, expected -1628133123, " + "is " + << last_msg_.obs_period.pmax; + EXPECT_EQ(last_msg_.obs_period.pmin, 1869323177) + << "incorrect value for last_msg_.obs_period.pmin, expected 1869323177, " + "is " + << last_msg_.obs_period.pmin; + EXPECT_EQ(last_msg_.uart_a.crc_error_count, 25177) + << "incorrect value for last_msg_.uart_a.crc_error_count, expected " + "25177, is " + << last_msg_.uart_a.crc_error_count; + EXPECT_EQ(last_msg_.uart_a.io_error_count, 47183) + << "incorrect value for last_msg_.uart_a.io_error_count, expected 47183, " + "is " + << last_msg_.uart_a.io_error_count; + EXPECT_EQ(last_msg_.uart_a.rx_buffer_level, 244) + << "incorrect value for last_msg_.uart_a.rx_buffer_level, expected 244, " + "is " + << last_msg_.uart_a.rx_buffer_level; + EXPECT_LT((last_msg_.uart_a.rx_throughput * 100 - 1853.19995117 * 100), 0.05) + << "incorrect value for last_msg_.uart_a.rx_throughput, expected " + "1853.19995117, is " + << last_msg_.uart_a.rx_throughput; + EXPECT_EQ(last_msg_.uart_a.tx_buffer_level, 138) + << "incorrect value for last_msg_.uart_a.tx_buffer_level, expected 138, " + "is " + << last_msg_.uart_a.tx_buffer_level; + EXPECT_LT((last_msg_.uart_a.tx_throughput * 100 - 7765.20019531 * 100), 0.05) + << "incorrect value for last_msg_.uart_a.tx_throughput, expected " + "7765.20019531, is " + << last_msg_.uart_a.tx_throughput; + EXPECT_EQ(last_msg_.uart_b.crc_error_count, 4297) + << "incorrect value for last_msg_.uart_b.crc_error_count, expected 4297, " + "is " + << last_msg_.uart_b.crc_error_count; + EXPECT_EQ(last_msg_.uart_b.io_error_count, 63847) + << "incorrect value for last_msg_.uart_b.io_error_count, expected 63847, " + "is " + << last_msg_.uart_b.io_error_count; + EXPECT_EQ(last_msg_.uart_b.rx_buffer_level, 161) + << "incorrect value for last_msg_.uart_b.rx_buffer_level, expected 161, " + "is " + << last_msg_.uart_b.rx_buffer_level; + EXPECT_LT((last_msg_.uart_b.rx_throughput * 100 - 6760.20019531 * 100), 0.05) + << "incorrect value for last_msg_.uart_b.rx_throughput, expected " + "6760.20019531, is " + << last_msg_.uart_b.rx_throughput; + EXPECT_EQ(last_msg_.uart_b.tx_buffer_level, 143) + << "incorrect value for last_msg_.uart_b.tx_buffer_level, expected 143, " + "is " + << last_msg_.uart_b.tx_buffer_level; + EXPECT_LT((last_msg_.uart_b.tx_throughput * 100 - 6441.20019531 * 100), 0.05) + << "incorrect value for last_msg_.uart_b.tx_throughput, expected " + "6441.20019531, is " + << last_msg_.uart_b.tx_throughput; + EXPECT_EQ(last_msg_.uart_ftdi.crc_error_count, 38359) + << "incorrect value for last_msg_.uart_ftdi.crc_error_count, expected " + "38359, is " + << last_msg_.uart_ftdi.crc_error_count; + EXPECT_EQ(last_msg_.uart_ftdi.io_error_count, 6653) + << "incorrect value for last_msg_.uart_ftdi.io_error_count, expected " + "6653, is " + << last_msg_.uart_ftdi.io_error_count; + EXPECT_EQ(last_msg_.uart_ftdi.rx_buffer_level, 24) + << "incorrect value for last_msg_.uart_ftdi.rx_buffer_level, expected " + "24, is " + << last_msg_.uart_ftdi.rx_buffer_level; + EXPECT_LT((last_msg_.uart_ftdi.rx_throughput * 100 - 2173.19995117 * 100), + 0.05) + << "incorrect value for last_msg_.uart_ftdi.rx_throughput, expected " + "2173.19995117, is " + << last_msg_.uart_ftdi.rx_throughput; + EXPECT_EQ(last_msg_.uart_ftdi.tx_buffer_level, 218) + << "incorrect value for last_msg_.uart_ftdi.tx_buffer_level, expected " + "218, is " + << last_msg_.uart_ftdi.tx_buffer_level; + EXPECT_LT((last_msg_.uart_ftdi.tx_throughput * 100 - 5954.20019531 * 100), + 0.05) + << "incorrect value for last_msg_.uart_ftdi.tx_throughput, expected " + "5954.20019531, is " + << last_msg_.uart_ftdi.tx_throughput; } diff --git a/c/test/cpp/auto_check_sbp_piksi_MsgUartStateDepA.cc b/c/test/cpp/auto_check_sbp_piksi_MsgUartStateDepA.cc index b5e79e0f6..141b2283d 100644 --- a/c/test/cpp/auto_check_sbp_piksi_MsgUartStateDepA.cc +++ b/c/test/cpp/auto_check_sbp_piksi_MsgUartStateDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartStateDepA.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_piksi_MsgUartStateDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgUartStateDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_piksi_MsgUartStateDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgUartStateDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_uart_state_depa_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_uart_state_depa_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,124 +67,172 @@ class Test_auto_check_sbp_piksi_MsgUartStateDepA0 : sbp_msg_uart_state_depa_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgUartStateDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,154,153,57,65,0,0,0,0,0,0,0,0,15,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,247,5, }; - - sbp_msg_uart_state_depa_t test_msg{}; - test_msg.latency.avg = -1; - test_msg.latency.current = -1; - test_msg.latency.lmax = 0; - test_msg.latency.lmin = 0; - test_msg.uart_a.crc_error_count = 0; - test_msg.uart_a.io_error_count = 0; - test_msg.uart_a.rx_buffer_level = 0; - test_msg.uart_a.rx_throughput = 0.0; - test_msg.uart_a.tx_buffer_level = 0; - test_msg.uart_a.tx_throughput = 0.0; - test_msg.uart_b.crc_error_count = 0; - test_msg.uart_b.io_error_count = 0; - test_msg.uart_b.rx_buffer_level = 0; - test_msg.uart_b.rx_throughput = 0.0; - test_msg.uart_b.tx_buffer_level = 0; - test_msg.uart_b.tx_throughput = 0.0; - test_msg.uart_ftdi.crc_error_count = 0; - test_msg.uart_ftdi.io_error_count = 0; - test_msg.uart_ftdi.rx_buffer_level = 0; - test_msg.uart_ftdi.rx_throughput = 0.0; - test_msg.uart_ftdi.tx_buffer_level = 15; - test_msg.uart_ftdi.tx_throughput = 11.600000381469727; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.latency.avg, -1) << "incorrect value for last_msg_.latency.avg, expected -1, is " << last_msg_.latency.avg; - EXPECT_EQ(last_msg_.latency.current, -1) << "incorrect value for last_msg_.latency.current, expected -1, is " << last_msg_.latency.current; - EXPECT_EQ(last_msg_.latency.lmax, 0) << "incorrect value for last_msg_.latency.lmax, expected 0, is " << last_msg_.latency.lmax; - EXPECT_EQ(last_msg_.latency.lmin, 0) << "incorrect value for last_msg_.latency.lmin, expected 0, is " << last_msg_.latency.lmin; - EXPECT_EQ(last_msg_.uart_a.crc_error_count, 0) << "incorrect value for last_msg_.uart_a.crc_error_count, expected 0, is " << last_msg_.uart_a.crc_error_count; - EXPECT_EQ(last_msg_.uart_a.io_error_count, 0) << "incorrect value for last_msg_.uart_a.io_error_count, expected 0, is " << last_msg_.uart_a.io_error_count; - EXPECT_EQ(last_msg_.uart_a.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_a.rx_buffer_level, expected 0, is " << last_msg_.uart_a.rx_buffer_level; - EXPECT_LT((last_msg_.uart_a.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_a.rx_throughput, expected 0.0, is " << last_msg_.uart_a.rx_throughput; - EXPECT_EQ(last_msg_.uart_a.tx_buffer_level, 0) << "incorrect value for last_msg_.uart_a.tx_buffer_level, expected 0, is " << last_msg_.uart_a.tx_buffer_level; - EXPECT_LT((last_msg_.uart_a.tx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_a.tx_throughput, expected 0.0, is " << last_msg_.uart_a.tx_throughput; - EXPECT_EQ(last_msg_.uart_b.crc_error_count, 0) << "incorrect value for last_msg_.uart_b.crc_error_count, expected 0, is " << last_msg_.uart_b.crc_error_count; - EXPECT_EQ(last_msg_.uart_b.io_error_count, 0) << "incorrect value for last_msg_.uart_b.io_error_count, expected 0, is " << last_msg_.uart_b.io_error_count; - EXPECT_EQ(last_msg_.uart_b.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_b.rx_buffer_level, expected 0, is " << last_msg_.uart_b.rx_buffer_level; - EXPECT_LT((last_msg_.uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_b.rx_throughput, expected 0.0, is " << last_msg_.uart_b.rx_throughput; - EXPECT_EQ(last_msg_.uart_b.tx_buffer_level, 0) << "incorrect value for last_msg_.uart_b.tx_buffer_level, expected 0, is " << last_msg_.uart_b.tx_buffer_level; - EXPECT_LT((last_msg_.uart_b.tx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_b.tx_throughput, expected 0.0, is " << last_msg_.uart_b.tx_throughput; - EXPECT_EQ(last_msg_.uart_ftdi.crc_error_count, 0) << "incorrect value for last_msg_.uart_ftdi.crc_error_count, expected 0, is " << last_msg_.uart_ftdi.crc_error_count; - EXPECT_EQ(last_msg_.uart_ftdi.io_error_count, 0) << "incorrect value for last_msg_.uart_ftdi.io_error_count, expected 0, is " << last_msg_.uart_ftdi.io_error_count; - EXPECT_EQ(last_msg_.uart_ftdi.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_ftdi.rx_buffer_level, expected 0, is " << last_msg_.uart_ftdi.rx_buffer_level; - EXPECT_LT((last_msg_.uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_ftdi.rx_throughput, expected 0.0, is " << last_msg_.uart_ftdi.rx_throughput; - EXPECT_EQ(last_msg_.uart_ftdi.tx_buffer_level, 15) << "incorrect value for last_msg_.uart_ftdi.tx_buffer_level, expected 15, is " << last_msg_.uart_ftdi.tx_buffer_level; - EXPECT_LT((last_msg_.uart_ftdi.tx_throughput * 100 - 11.6000003815 * 100), 0.05) << "incorrect value for last_msg_.uart_ftdi.tx_throughput, expected 11.6000003815, is " << last_msg_.uart_ftdi.tx_throughput; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgUartStateDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 154, 153, 57, 65, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 255, 255, 255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 247, 5, + }; + + sbp_msg_uart_state_depa_t test_msg{}; + test_msg.latency.avg = -1; + test_msg.latency.current = -1; + test_msg.latency.lmax = 0; + test_msg.latency.lmin = 0; + test_msg.uart_a.crc_error_count = 0; + test_msg.uart_a.io_error_count = 0; + test_msg.uart_a.rx_buffer_level = 0; + test_msg.uart_a.rx_throughput = 0.0; + test_msg.uart_a.tx_buffer_level = 0; + test_msg.uart_a.tx_throughput = 0.0; + test_msg.uart_b.crc_error_count = 0; + test_msg.uart_b.io_error_count = 0; + test_msg.uart_b.rx_buffer_level = 0; + test_msg.uart_b.rx_throughput = 0.0; + test_msg.uart_b.tx_buffer_level = 0; + test_msg.uart_b.tx_throughput = 0.0; + test_msg.uart_ftdi.crc_error_count = 0; + test_msg.uart_ftdi.io_error_count = 0; + test_msg.uart_ftdi.rx_buffer_level = 0; + test_msg.uart_ftdi.rx_throughput = 0.0; + test_msg.uart_ftdi.tx_buffer_level = 15; + test_msg.uart_ftdi.tx_throughput = 11.600000381469727; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.latency.avg, -1) + << "incorrect value for last_msg_.latency.avg, expected -1, is " + << last_msg_.latency.avg; + EXPECT_EQ(last_msg_.latency.current, -1) + << "incorrect value for last_msg_.latency.current, expected -1, is " + << last_msg_.latency.current; + EXPECT_EQ(last_msg_.latency.lmax, 0) + << "incorrect value for last_msg_.latency.lmax, expected 0, is " + << last_msg_.latency.lmax; + EXPECT_EQ(last_msg_.latency.lmin, 0) + << "incorrect value for last_msg_.latency.lmin, expected 0, is " + << last_msg_.latency.lmin; + EXPECT_EQ(last_msg_.uart_a.crc_error_count, 0) + << "incorrect value for last_msg_.uart_a.crc_error_count, expected 0, is " + << last_msg_.uart_a.crc_error_count; + EXPECT_EQ(last_msg_.uart_a.io_error_count, 0) + << "incorrect value for last_msg_.uart_a.io_error_count, expected 0, is " + << last_msg_.uart_a.io_error_count; + EXPECT_EQ(last_msg_.uart_a.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_a.rx_buffer_level, expected 0, is " + << last_msg_.uart_a.rx_buffer_level; + EXPECT_LT((last_msg_.uart_a.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_a.rx_throughput, expected 0.0, is " + << last_msg_.uart_a.rx_throughput; + EXPECT_EQ(last_msg_.uart_a.tx_buffer_level, 0) + << "incorrect value for last_msg_.uart_a.tx_buffer_level, expected 0, is " + << last_msg_.uart_a.tx_buffer_level; + EXPECT_LT((last_msg_.uart_a.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_a.tx_throughput, expected 0.0, is " + << last_msg_.uart_a.tx_throughput; + EXPECT_EQ(last_msg_.uart_b.crc_error_count, 0) + << "incorrect value for last_msg_.uart_b.crc_error_count, expected 0, is " + << last_msg_.uart_b.crc_error_count; + EXPECT_EQ(last_msg_.uart_b.io_error_count, 0) + << "incorrect value for last_msg_.uart_b.io_error_count, expected 0, is " + << last_msg_.uart_b.io_error_count; + EXPECT_EQ(last_msg_.uart_b.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_b.rx_buffer_level, expected 0, is " + << last_msg_.uart_b.rx_buffer_level; + EXPECT_LT((last_msg_.uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_b.rx_throughput, expected 0.0, is " + << last_msg_.uart_b.rx_throughput; + EXPECT_EQ(last_msg_.uart_b.tx_buffer_level, 0) + << "incorrect value for last_msg_.uart_b.tx_buffer_level, expected 0, is " + << last_msg_.uart_b.tx_buffer_level; + EXPECT_LT((last_msg_.uart_b.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_b.tx_throughput, expected 0.0, is " + << last_msg_.uart_b.tx_throughput; + EXPECT_EQ(last_msg_.uart_ftdi.crc_error_count, 0) + << "incorrect value for last_msg_.uart_ftdi.crc_error_count, expected 0, " + "is " + << last_msg_.uart_ftdi.crc_error_count; + EXPECT_EQ(last_msg_.uart_ftdi.io_error_count, 0) + << "incorrect value for last_msg_.uart_ftdi.io_error_count, expected 0, " + "is " + << last_msg_.uart_ftdi.io_error_count; + EXPECT_EQ(last_msg_.uart_ftdi.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_ftdi.rx_buffer_level, expected 0, " + "is " + << last_msg_.uart_ftdi.rx_buffer_level; + EXPECT_LT((last_msg_.uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_ftdi.rx_throughput, expected 0.0, " + "is " + << last_msg_.uart_ftdi.rx_throughput; + EXPECT_EQ(last_msg_.uart_ftdi.tx_buffer_level, 15) + << "incorrect value for last_msg_.uart_ftdi.tx_buffer_level, expected " + "15, is " + << last_msg_.uart_ftdi.tx_buffer_level; + EXPECT_LT((last_msg_.uart_ftdi.tx_throughput * 100 - 11.6000003815 * 100), + 0.05) + << "incorrect value for last_msg_.uart_ftdi.tx_throughput, expected " + "11.6000003815, is " + << last_msg_.uart_ftdi.tx_throughput; } -class Test_auto_check_sbp_piksi_MsgUartStateDepA1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgUartStateDepA1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgUartStateDepA1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgUartStateDepA1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_uart_state_depa_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_uart_state_depa_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -196,124 +240,172 @@ class Test_auto_check_sbp_piksi_MsgUartStateDepA1 : sbp_msg_uart_state_depa_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgUartStateDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,43,135,61,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,65,110, }; - - sbp_msg_uart_state_depa_t test_msg{}; - test_msg.latency.avg = -1; - test_msg.latency.current = -1; - test_msg.latency.lmax = 0; - test_msg.latency.lmin = 0; - test_msg.uart_a.crc_error_count = 0; - test_msg.uart_a.io_error_count = 0; - test_msg.uart_a.rx_buffer_level = 0; - test_msg.uart_a.rx_throughput = 0.0; - test_msg.uart_a.tx_buffer_level = 0; - test_msg.uart_a.tx_throughput = 0.0; - test_msg.uart_b.crc_error_count = 0; - test_msg.uart_b.io_error_count = 0; - test_msg.uart_b.rx_buffer_level = 0; - test_msg.uart_b.rx_throughput = 0.0; - test_msg.uart_b.tx_buffer_level = 0; - test_msg.uart_b.tx_throughput = 0.0; - test_msg.uart_ftdi.crc_error_count = 0; - test_msg.uart_ftdi.io_error_count = 0; - test_msg.uart_ftdi.rx_buffer_level = 0; - test_msg.uart_ftdi.rx_throughput = 0.0; - test_msg.uart_ftdi.tx_buffer_level = 0; - test_msg.uart_ftdi.tx_throughput = 0.06599999964237213; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.latency.avg, -1) << "incorrect value for last_msg_.latency.avg, expected -1, is " << last_msg_.latency.avg; - EXPECT_EQ(last_msg_.latency.current, -1) << "incorrect value for last_msg_.latency.current, expected -1, is " << last_msg_.latency.current; - EXPECT_EQ(last_msg_.latency.lmax, 0) << "incorrect value for last_msg_.latency.lmax, expected 0, is " << last_msg_.latency.lmax; - EXPECT_EQ(last_msg_.latency.lmin, 0) << "incorrect value for last_msg_.latency.lmin, expected 0, is " << last_msg_.latency.lmin; - EXPECT_EQ(last_msg_.uart_a.crc_error_count, 0) << "incorrect value for last_msg_.uart_a.crc_error_count, expected 0, is " << last_msg_.uart_a.crc_error_count; - EXPECT_EQ(last_msg_.uart_a.io_error_count, 0) << "incorrect value for last_msg_.uart_a.io_error_count, expected 0, is " << last_msg_.uart_a.io_error_count; - EXPECT_EQ(last_msg_.uart_a.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_a.rx_buffer_level, expected 0, is " << last_msg_.uart_a.rx_buffer_level; - EXPECT_LT((last_msg_.uart_a.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_a.rx_throughput, expected 0.0, is " << last_msg_.uart_a.rx_throughput; - EXPECT_EQ(last_msg_.uart_a.tx_buffer_level, 0) << "incorrect value for last_msg_.uart_a.tx_buffer_level, expected 0, is " << last_msg_.uart_a.tx_buffer_level; - EXPECT_LT((last_msg_.uart_a.tx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_a.tx_throughput, expected 0.0, is " << last_msg_.uart_a.tx_throughput; - EXPECT_EQ(last_msg_.uart_b.crc_error_count, 0) << "incorrect value for last_msg_.uart_b.crc_error_count, expected 0, is " << last_msg_.uart_b.crc_error_count; - EXPECT_EQ(last_msg_.uart_b.io_error_count, 0) << "incorrect value for last_msg_.uart_b.io_error_count, expected 0, is " << last_msg_.uart_b.io_error_count; - EXPECT_EQ(last_msg_.uart_b.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_b.rx_buffer_level, expected 0, is " << last_msg_.uart_b.rx_buffer_level; - EXPECT_LT((last_msg_.uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_b.rx_throughput, expected 0.0, is " << last_msg_.uart_b.rx_throughput; - EXPECT_EQ(last_msg_.uart_b.tx_buffer_level, 0) << "incorrect value for last_msg_.uart_b.tx_buffer_level, expected 0, is " << last_msg_.uart_b.tx_buffer_level; - EXPECT_LT((last_msg_.uart_b.tx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_b.tx_throughput, expected 0.0, is " << last_msg_.uart_b.tx_throughput; - EXPECT_EQ(last_msg_.uart_ftdi.crc_error_count, 0) << "incorrect value for last_msg_.uart_ftdi.crc_error_count, expected 0, is " << last_msg_.uart_ftdi.crc_error_count; - EXPECT_EQ(last_msg_.uart_ftdi.io_error_count, 0) << "incorrect value for last_msg_.uart_ftdi.io_error_count, expected 0, is " << last_msg_.uart_ftdi.io_error_count; - EXPECT_EQ(last_msg_.uart_ftdi.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_ftdi.rx_buffer_level, expected 0, is " << last_msg_.uart_ftdi.rx_buffer_level; - EXPECT_LT((last_msg_.uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_ftdi.rx_throughput, expected 0.0, is " << last_msg_.uart_ftdi.rx_throughput; - EXPECT_EQ(last_msg_.uart_ftdi.tx_buffer_level, 0) << "incorrect value for last_msg_.uart_ftdi.tx_buffer_level, expected 0, is " << last_msg_.uart_ftdi.tx_buffer_level; - EXPECT_LT((last_msg_.uart_ftdi.tx_throughput * 100 - 0.0659999996424 * 100), 0.05) << "incorrect value for last_msg_.uart_ftdi.tx_throughput, expected 0.0659999996424, is " << last_msg_.uart_ftdi.tx_throughput; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgUartStateDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 43, 135, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 65, 110, + }; + + sbp_msg_uart_state_depa_t test_msg{}; + test_msg.latency.avg = -1; + test_msg.latency.current = -1; + test_msg.latency.lmax = 0; + test_msg.latency.lmin = 0; + test_msg.uart_a.crc_error_count = 0; + test_msg.uart_a.io_error_count = 0; + test_msg.uart_a.rx_buffer_level = 0; + test_msg.uart_a.rx_throughput = 0.0; + test_msg.uart_a.tx_buffer_level = 0; + test_msg.uart_a.tx_throughput = 0.0; + test_msg.uart_b.crc_error_count = 0; + test_msg.uart_b.io_error_count = 0; + test_msg.uart_b.rx_buffer_level = 0; + test_msg.uart_b.rx_throughput = 0.0; + test_msg.uart_b.tx_buffer_level = 0; + test_msg.uart_b.tx_throughput = 0.0; + test_msg.uart_ftdi.crc_error_count = 0; + test_msg.uart_ftdi.io_error_count = 0; + test_msg.uart_ftdi.rx_buffer_level = 0; + test_msg.uart_ftdi.rx_throughput = 0.0; + test_msg.uart_ftdi.tx_buffer_level = 0; + test_msg.uart_ftdi.tx_throughput = 0.06599999964237213; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.latency.avg, -1) + << "incorrect value for last_msg_.latency.avg, expected -1, is " + << last_msg_.latency.avg; + EXPECT_EQ(last_msg_.latency.current, -1) + << "incorrect value for last_msg_.latency.current, expected -1, is " + << last_msg_.latency.current; + EXPECT_EQ(last_msg_.latency.lmax, 0) + << "incorrect value for last_msg_.latency.lmax, expected 0, is " + << last_msg_.latency.lmax; + EXPECT_EQ(last_msg_.latency.lmin, 0) + << "incorrect value for last_msg_.latency.lmin, expected 0, is " + << last_msg_.latency.lmin; + EXPECT_EQ(last_msg_.uart_a.crc_error_count, 0) + << "incorrect value for last_msg_.uart_a.crc_error_count, expected 0, is " + << last_msg_.uart_a.crc_error_count; + EXPECT_EQ(last_msg_.uart_a.io_error_count, 0) + << "incorrect value for last_msg_.uart_a.io_error_count, expected 0, is " + << last_msg_.uart_a.io_error_count; + EXPECT_EQ(last_msg_.uart_a.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_a.rx_buffer_level, expected 0, is " + << last_msg_.uart_a.rx_buffer_level; + EXPECT_LT((last_msg_.uart_a.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_a.rx_throughput, expected 0.0, is " + << last_msg_.uart_a.rx_throughput; + EXPECT_EQ(last_msg_.uart_a.tx_buffer_level, 0) + << "incorrect value for last_msg_.uart_a.tx_buffer_level, expected 0, is " + << last_msg_.uart_a.tx_buffer_level; + EXPECT_LT((last_msg_.uart_a.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_a.tx_throughput, expected 0.0, is " + << last_msg_.uart_a.tx_throughput; + EXPECT_EQ(last_msg_.uart_b.crc_error_count, 0) + << "incorrect value for last_msg_.uart_b.crc_error_count, expected 0, is " + << last_msg_.uart_b.crc_error_count; + EXPECT_EQ(last_msg_.uart_b.io_error_count, 0) + << "incorrect value for last_msg_.uart_b.io_error_count, expected 0, is " + << last_msg_.uart_b.io_error_count; + EXPECT_EQ(last_msg_.uart_b.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_b.rx_buffer_level, expected 0, is " + << last_msg_.uart_b.rx_buffer_level; + EXPECT_LT((last_msg_.uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_b.rx_throughput, expected 0.0, is " + << last_msg_.uart_b.rx_throughput; + EXPECT_EQ(last_msg_.uart_b.tx_buffer_level, 0) + << "incorrect value for last_msg_.uart_b.tx_buffer_level, expected 0, is " + << last_msg_.uart_b.tx_buffer_level; + EXPECT_LT((last_msg_.uart_b.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_b.tx_throughput, expected 0.0, is " + << last_msg_.uart_b.tx_throughput; + EXPECT_EQ(last_msg_.uart_ftdi.crc_error_count, 0) + << "incorrect value for last_msg_.uart_ftdi.crc_error_count, expected 0, " + "is " + << last_msg_.uart_ftdi.crc_error_count; + EXPECT_EQ(last_msg_.uart_ftdi.io_error_count, 0) + << "incorrect value for last_msg_.uart_ftdi.io_error_count, expected 0, " + "is " + << last_msg_.uart_ftdi.io_error_count; + EXPECT_EQ(last_msg_.uart_ftdi.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_ftdi.rx_buffer_level, expected 0, " + "is " + << last_msg_.uart_ftdi.rx_buffer_level; + EXPECT_LT((last_msg_.uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_ftdi.rx_throughput, expected 0.0, " + "is " + << last_msg_.uart_ftdi.rx_throughput; + EXPECT_EQ(last_msg_.uart_ftdi.tx_buffer_level, 0) + << "incorrect value for last_msg_.uart_ftdi.tx_buffer_level, expected 0, " + "is " + << last_msg_.uart_ftdi.tx_buffer_level; + EXPECT_LT((last_msg_.uart_ftdi.tx_throughput * 100 - 0.0659999996424 * 100), + 0.05) + << "incorrect value for last_msg_.uart_ftdi.tx_throughput, expected " + "0.0659999996424, is " + << last_msg_.uart_ftdi.tx_throughput; } -class Test_auto_check_sbp_piksi_MsgUartStateDepA2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgUartStateDepA2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgUartStateDepA2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgUartStateDepA2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_uart_state_depa_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_uart_state_depa_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -321,124 +413,172 @@ class Test_auto_check_sbp_piksi_MsgUartStateDepA2 : sbp_msg_uart_state_depa_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgUartStateDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,86,14,62,0,0,0,0,0,0,0,0,10,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,198,36, }; - - sbp_msg_uart_state_depa_t test_msg{}; - test_msg.latency.avg = -1; - test_msg.latency.current = -1; - test_msg.latency.lmax = 0; - test_msg.latency.lmin = 0; - test_msg.uart_a.crc_error_count = 0; - test_msg.uart_a.io_error_count = 0; - test_msg.uart_a.rx_buffer_level = 0; - test_msg.uart_a.rx_throughput = 0.0; - test_msg.uart_a.tx_buffer_level = 0; - test_msg.uart_a.tx_throughput = 0.0; - test_msg.uart_b.crc_error_count = 0; - test_msg.uart_b.io_error_count = 0; - test_msg.uart_b.rx_buffer_level = 0; - test_msg.uart_b.rx_throughput = 0.0; - test_msg.uart_b.tx_buffer_level = 0; - test_msg.uart_b.tx_throughput = 0.0; - test_msg.uart_ftdi.crc_error_count = 0; - test_msg.uart_ftdi.io_error_count = 0; - test_msg.uart_ftdi.rx_buffer_level = 0; - test_msg.uart_ftdi.rx_throughput = 0.0; - test_msg.uart_ftdi.tx_buffer_level = 10; - test_msg.uart_ftdi.tx_throughput = 0.13899999856948853; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.latency.avg, -1) << "incorrect value for last_msg_.latency.avg, expected -1, is " << last_msg_.latency.avg; - EXPECT_EQ(last_msg_.latency.current, -1) << "incorrect value for last_msg_.latency.current, expected -1, is " << last_msg_.latency.current; - EXPECT_EQ(last_msg_.latency.lmax, 0) << "incorrect value for last_msg_.latency.lmax, expected 0, is " << last_msg_.latency.lmax; - EXPECT_EQ(last_msg_.latency.lmin, 0) << "incorrect value for last_msg_.latency.lmin, expected 0, is " << last_msg_.latency.lmin; - EXPECT_EQ(last_msg_.uart_a.crc_error_count, 0) << "incorrect value for last_msg_.uart_a.crc_error_count, expected 0, is " << last_msg_.uart_a.crc_error_count; - EXPECT_EQ(last_msg_.uart_a.io_error_count, 0) << "incorrect value for last_msg_.uart_a.io_error_count, expected 0, is " << last_msg_.uart_a.io_error_count; - EXPECT_EQ(last_msg_.uart_a.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_a.rx_buffer_level, expected 0, is " << last_msg_.uart_a.rx_buffer_level; - EXPECT_LT((last_msg_.uart_a.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_a.rx_throughput, expected 0.0, is " << last_msg_.uart_a.rx_throughput; - EXPECT_EQ(last_msg_.uart_a.tx_buffer_level, 0) << "incorrect value for last_msg_.uart_a.tx_buffer_level, expected 0, is " << last_msg_.uart_a.tx_buffer_level; - EXPECT_LT((last_msg_.uart_a.tx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_a.tx_throughput, expected 0.0, is " << last_msg_.uart_a.tx_throughput; - EXPECT_EQ(last_msg_.uart_b.crc_error_count, 0) << "incorrect value for last_msg_.uart_b.crc_error_count, expected 0, is " << last_msg_.uart_b.crc_error_count; - EXPECT_EQ(last_msg_.uart_b.io_error_count, 0) << "incorrect value for last_msg_.uart_b.io_error_count, expected 0, is " << last_msg_.uart_b.io_error_count; - EXPECT_EQ(last_msg_.uart_b.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_b.rx_buffer_level, expected 0, is " << last_msg_.uart_b.rx_buffer_level; - EXPECT_LT((last_msg_.uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_b.rx_throughput, expected 0.0, is " << last_msg_.uart_b.rx_throughput; - EXPECT_EQ(last_msg_.uart_b.tx_buffer_level, 0) << "incorrect value for last_msg_.uart_b.tx_buffer_level, expected 0, is " << last_msg_.uart_b.tx_buffer_level; - EXPECT_LT((last_msg_.uart_b.tx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_b.tx_throughput, expected 0.0, is " << last_msg_.uart_b.tx_throughput; - EXPECT_EQ(last_msg_.uart_ftdi.crc_error_count, 0) << "incorrect value for last_msg_.uart_ftdi.crc_error_count, expected 0, is " << last_msg_.uart_ftdi.crc_error_count; - EXPECT_EQ(last_msg_.uart_ftdi.io_error_count, 0) << "incorrect value for last_msg_.uart_ftdi.io_error_count, expected 0, is " << last_msg_.uart_ftdi.io_error_count; - EXPECT_EQ(last_msg_.uart_ftdi.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_ftdi.rx_buffer_level, expected 0, is " << last_msg_.uart_ftdi.rx_buffer_level; - EXPECT_LT((last_msg_.uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_ftdi.rx_throughput, expected 0.0, is " << last_msg_.uart_ftdi.rx_throughput; - EXPECT_EQ(last_msg_.uart_ftdi.tx_buffer_level, 10) << "incorrect value for last_msg_.uart_ftdi.tx_buffer_level, expected 10, is " << last_msg_.uart_ftdi.tx_buffer_level; - EXPECT_LT((last_msg_.uart_ftdi.tx_throughput * 100 - 0.138999998569 * 100), 0.05) << "incorrect value for last_msg_.uart_ftdi.tx_throughput, expected 0.138999998569, is " << last_msg_.uart_ftdi.tx_throughput; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgUartStateDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 86, 14, 62, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 255, 255, 255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 198, 36, + }; + + sbp_msg_uart_state_depa_t test_msg{}; + test_msg.latency.avg = -1; + test_msg.latency.current = -1; + test_msg.latency.lmax = 0; + test_msg.latency.lmin = 0; + test_msg.uart_a.crc_error_count = 0; + test_msg.uart_a.io_error_count = 0; + test_msg.uart_a.rx_buffer_level = 0; + test_msg.uart_a.rx_throughput = 0.0; + test_msg.uart_a.tx_buffer_level = 0; + test_msg.uart_a.tx_throughput = 0.0; + test_msg.uart_b.crc_error_count = 0; + test_msg.uart_b.io_error_count = 0; + test_msg.uart_b.rx_buffer_level = 0; + test_msg.uart_b.rx_throughput = 0.0; + test_msg.uart_b.tx_buffer_level = 0; + test_msg.uart_b.tx_throughput = 0.0; + test_msg.uart_ftdi.crc_error_count = 0; + test_msg.uart_ftdi.io_error_count = 0; + test_msg.uart_ftdi.rx_buffer_level = 0; + test_msg.uart_ftdi.rx_throughput = 0.0; + test_msg.uart_ftdi.tx_buffer_level = 10; + test_msg.uart_ftdi.tx_throughput = 0.13899999856948853; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.latency.avg, -1) + << "incorrect value for last_msg_.latency.avg, expected -1, is " + << last_msg_.latency.avg; + EXPECT_EQ(last_msg_.latency.current, -1) + << "incorrect value for last_msg_.latency.current, expected -1, is " + << last_msg_.latency.current; + EXPECT_EQ(last_msg_.latency.lmax, 0) + << "incorrect value for last_msg_.latency.lmax, expected 0, is " + << last_msg_.latency.lmax; + EXPECT_EQ(last_msg_.latency.lmin, 0) + << "incorrect value for last_msg_.latency.lmin, expected 0, is " + << last_msg_.latency.lmin; + EXPECT_EQ(last_msg_.uart_a.crc_error_count, 0) + << "incorrect value for last_msg_.uart_a.crc_error_count, expected 0, is " + << last_msg_.uart_a.crc_error_count; + EXPECT_EQ(last_msg_.uart_a.io_error_count, 0) + << "incorrect value for last_msg_.uart_a.io_error_count, expected 0, is " + << last_msg_.uart_a.io_error_count; + EXPECT_EQ(last_msg_.uart_a.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_a.rx_buffer_level, expected 0, is " + << last_msg_.uart_a.rx_buffer_level; + EXPECT_LT((last_msg_.uart_a.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_a.rx_throughput, expected 0.0, is " + << last_msg_.uart_a.rx_throughput; + EXPECT_EQ(last_msg_.uart_a.tx_buffer_level, 0) + << "incorrect value for last_msg_.uart_a.tx_buffer_level, expected 0, is " + << last_msg_.uart_a.tx_buffer_level; + EXPECT_LT((last_msg_.uart_a.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_a.tx_throughput, expected 0.0, is " + << last_msg_.uart_a.tx_throughput; + EXPECT_EQ(last_msg_.uart_b.crc_error_count, 0) + << "incorrect value for last_msg_.uart_b.crc_error_count, expected 0, is " + << last_msg_.uart_b.crc_error_count; + EXPECT_EQ(last_msg_.uart_b.io_error_count, 0) + << "incorrect value for last_msg_.uart_b.io_error_count, expected 0, is " + << last_msg_.uart_b.io_error_count; + EXPECT_EQ(last_msg_.uart_b.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_b.rx_buffer_level, expected 0, is " + << last_msg_.uart_b.rx_buffer_level; + EXPECT_LT((last_msg_.uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_b.rx_throughput, expected 0.0, is " + << last_msg_.uart_b.rx_throughput; + EXPECT_EQ(last_msg_.uart_b.tx_buffer_level, 0) + << "incorrect value for last_msg_.uart_b.tx_buffer_level, expected 0, is " + << last_msg_.uart_b.tx_buffer_level; + EXPECT_LT((last_msg_.uart_b.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_b.tx_throughput, expected 0.0, is " + << last_msg_.uart_b.tx_throughput; + EXPECT_EQ(last_msg_.uart_ftdi.crc_error_count, 0) + << "incorrect value for last_msg_.uart_ftdi.crc_error_count, expected 0, " + "is " + << last_msg_.uart_ftdi.crc_error_count; + EXPECT_EQ(last_msg_.uart_ftdi.io_error_count, 0) + << "incorrect value for last_msg_.uart_ftdi.io_error_count, expected 0, " + "is " + << last_msg_.uart_ftdi.io_error_count; + EXPECT_EQ(last_msg_.uart_ftdi.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_ftdi.rx_buffer_level, expected 0, " + "is " + << last_msg_.uart_ftdi.rx_buffer_level; + EXPECT_LT((last_msg_.uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_ftdi.rx_throughput, expected 0.0, " + "is " + << last_msg_.uart_ftdi.rx_throughput; + EXPECT_EQ(last_msg_.uart_ftdi.tx_buffer_level, 10) + << "incorrect value for last_msg_.uart_ftdi.tx_buffer_level, expected " + "10, is " + << last_msg_.uart_ftdi.tx_buffer_level; + EXPECT_LT((last_msg_.uart_ftdi.tx_throughput * 100 - 0.138999998569 * 100), + 0.05) + << "incorrect value for last_msg_.uart_ftdi.tx_throughput, expected " + "0.138999998569, is " + << last_msg_.uart_ftdi.tx_throughput; } -class Test_auto_check_sbp_piksi_MsgUartStateDepA3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgUartStateDepA3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgUartStateDepA3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgUartStateDepA3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_uart_state_depa_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_uart_state_depa_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -446,124 +586,172 @@ class Test_auto_check_sbp_piksi_MsgUartStateDepA3 : sbp_msg_uart_state_depa_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgUartStateDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,43,135,61,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,65,110, }; - - sbp_msg_uart_state_depa_t test_msg{}; - test_msg.latency.avg = -1; - test_msg.latency.current = -1; - test_msg.latency.lmax = 0; - test_msg.latency.lmin = 0; - test_msg.uart_a.crc_error_count = 0; - test_msg.uart_a.io_error_count = 0; - test_msg.uart_a.rx_buffer_level = 0; - test_msg.uart_a.rx_throughput = 0.0; - test_msg.uart_a.tx_buffer_level = 0; - test_msg.uart_a.tx_throughput = 0.0; - test_msg.uart_b.crc_error_count = 0; - test_msg.uart_b.io_error_count = 0; - test_msg.uart_b.rx_buffer_level = 0; - test_msg.uart_b.rx_throughput = 0.0; - test_msg.uart_b.tx_buffer_level = 0; - test_msg.uart_b.tx_throughput = 0.0; - test_msg.uart_ftdi.crc_error_count = 0; - test_msg.uart_ftdi.io_error_count = 0; - test_msg.uart_ftdi.rx_buffer_level = 0; - test_msg.uart_ftdi.rx_throughput = 0.0; - test_msg.uart_ftdi.tx_buffer_level = 0; - test_msg.uart_ftdi.tx_throughput = 0.06599999964237213; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.latency.avg, -1) << "incorrect value for last_msg_.latency.avg, expected -1, is " << last_msg_.latency.avg; - EXPECT_EQ(last_msg_.latency.current, -1) << "incorrect value for last_msg_.latency.current, expected -1, is " << last_msg_.latency.current; - EXPECT_EQ(last_msg_.latency.lmax, 0) << "incorrect value for last_msg_.latency.lmax, expected 0, is " << last_msg_.latency.lmax; - EXPECT_EQ(last_msg_.latency.lmin, 0) << "incorrect value for last_msg_.latency.lmin, expected 0, is " << last_msg_.latency.lmin; - EXPECT_EQ(last_msg_.uart_a.crc_error_count, 0) << "incorrect value for last_msg_.uart_a.crc_error_count, expected 0, is " << last_msg_.uart_a.crc_error_count; - EXPECT_EQ(last_msg_.uart_a.io_error_count, 0) << "incorrect value for last_msg_.uart_a.io_error_count, expected 0, is " << last_msg_.uart_a.io_error_count; - EXPECT_EQ(last_msg_.uart_a.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_a.rx_buffer_level, expected 0, is " << last_msg_.uart_a.rx_buffer_level; - EXPECT_LT((last_msg_.uart_a.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_a.rx_throughput, expected 0.0, is " << last_msg_.uart_a.rx_throughput; - EXPECT_EQ(last_msg_.uart_a.tx_buffer_level, 0) << "incorrect value for last_msg_.uart_a.tx_buffer_level, expected 0, is " << last_msg_.uart_a.tx_buffer_level; - EXPECT_LT((last_msg_.uart_a.tx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_a.tx_throughput, expected 0.0, is " << last_msg_.uart_a.tx_throughput; - EXPECT_EQ(last_msg_.uart_b.crc_error_count, 0) << "incorrect value for last_msg_.uart_b.crc_error_count, expected 0, is " << last_msg_.uart_b.crc_error_count; - EXPECT_EQ(last_msg_.uart_b.io_error_count, 0) << "incorrect value for last_msg_.uart_b.io_error_count, expected 0, is " << last_msg_.uart_b.io_error_count; - EXPECT_EQ(last_msg_.uart_b.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_b.rx_buffer_level, expected 0, is " << last_msg_.uart_b.rx_buffer_level; - EXPECT_LT((last_msg_.uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_b.rx_throughput, expected 0.0, is " << last_msg_.uart_b.rx_throughput; - EXPECT_EQ(last_msg_.uart_b.tx_buffer_level, 0) << "incorrect value for last_msg_.uart_b.tx_buffer_level, expected 0, is " << last_msg_.uart_b.tx_buffer_level; - EXPECT_LT((last_msg_.uart_b.tx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_b.tx_throughput, expected 0.0, is " << last_msg_.uart_b.tx_throughput; - EXPECT_EQ(last_msg_.uart_ftdi.crc_error_count, 0) << "incorrect value for last_msg_.uart_ftdi.crc_error_count, expected 0, is " << last_msg_.uart_ftdi.crc_error_count; - EXPECT_EQ(last_msg_.uart_ftdi.io_error_count, 0) << "incorrect value for last_msg_.uart_ftdi.io_error_count, expected 0, is " << last_msg_.uart_ftdi.io_error_count; - EXPECT_EQ(last_msg_.uart_ftdi.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_ftdi.rx_buffer_level, expected 0, is " << last_msg_.uart_ftdi.rx_buffer_level; - EXPECT_LT((last_msg_.uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_ftdi.rx_throughput, expected 0.0, is " << last_msg_.uart_ftdi.rx_throughput; - EXPECT_EQ(last_msg_.uart_ftdi.tx_buffer_level, 0) << "incorrect value for last_msg_.uart_ftdi.tx_buffer_level, expected 0, is " << last_msg_.uart_ftdi.tx_buffer_level; - EXPECT_LT((last_msg_.uart_ftdi.tx_throughput * 100 - 0.0659999996424 * 100), 0.05) << "incorrect value for last_msg_.uart_ftdi.tx_throughput, expected 0.0659999996424, is " << last_msg_.uart_ftdi.tx_throughput; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgUartStateDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 43, 135, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 65, 110, + }; + + sbp_msg_uart_state_depa_t test_msg{}; + test_msg.latency.avg = -1; + test_msg.latency.current = -1; + test_msg.latency.lmax = 0; + test_msg.latency.lmin = 0; + test_msg.uart_a.crc_error_count = 0; + test_msg.uart_a.io_error_count = 0; + test_msg.uart_a.rx_buffer_level = 0; + test_msg.uart_a.rx_throughput = 0.0; + test_msg.uart_a.tx_buffer_level = 0; + test_msg.uart_a.tx_throughput = 0.0; + test_msg.uart_b.crc_error_count = 0; + test_msg.uart_b.io_error_count = 0; + test_msg.uart_b.rx_buffer_level = 0; + test_msg.uart_b.rx_throughput = 0.0; + test_msg.uart_b.tx_buffer_level = 0; + test_msg.uart_b.tx_throughput = 0.0; + test_msg.uart_ftdi.crc_error_count = 0; + test_msg.uart_ftdi.io_error_count = 0; + test_msg.uart_ftdi.rx_buffer_level = 0; + test_msg.uart_ftdi.rx_throughput = 0.0; + test_msg.uart_ftdi.tx_buffer_level = 0; + test_msg.uart_ftdi.tx_throughput = 0.06599999964237213; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.latency.avg, -1) + << "incorrect value for last_msg_.latency.avg, expected -1, is " + << last_msg_.latency.avg; + EXPECT_EQ(last_msg_.latency.current, -1) + << "incorrect value for last_msg_.latency.current, expected -1, is " + << last_msg_.latency.current; + EXPECT_EQ(last_msg_.latency.lmax, 0) + << "incorrect value for last_msg_.latency.lmax, expected 0, is " + << last_msg_.latency.lmax; + EXPECT_EQ(last_msg_.latency.lmin, 0) + << "incorrect value for last_msg_.latency.lmin, expected 0, is " + << last_msg_.latency.lmin; + EXPECT_EQ(last_msg_.uart_a.crc_error_count, 0) + << "incorrect value for last_msg_.uart_a.crc_error_count, expected 0, is " + << last_msg_.uart_a.crc_error_count; + EXPECT_EQ(last_msg_.uart_a.io_error_count, 0) + << "incorrect value for last_msg_.uart_a.io_error_count, expected 0, is " + << last_msg_.uart_a.io_error_count; + EXPECT_EQ(last_msg_.uart_a.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_a.rx_buffer_level, expected 0, is " + << last_msg_.uart_a.rx_buffer_level; + EXPECT_LT((last_msg_.uart_a.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_a.rx_throughput, expected 0.0, is " + << last_msg_.uart_a.rx_throughput; + EXPECT_EQ(last_msg_.uart_a.tx_buffer_level, 0) + << "incorrect value for last_msg_.uart_a.tx_buffer_level, expected 0, is " + << last_msg_.uart_a.tx_buffer_level; + EXPECT_LT((last_msg_.uart_a.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_a.tx_throughput, expected 0.0, is " + << last_msg_.uart_a.tx_throughput; + EXPECT_EQ(last_msg_.uart_b.crc_error_count, 0) + << "incorrect value for last_msg_.uart_b.crc_error_count, expected 0, is " + << last_msg_.uart_b.crc_error_count; + EXPECT_EQ(last_msg_.uart_b.io_error_count, 0) + << "incorrect value for last_msg_.uart_b.io_error_count, expected 0, is " + << last_msg_.uart_b.io_error_count; + EXPECT_EQ(last_msg_.uart_b.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_b.rx_buffer_level, expected 0, is " + << last_msg_.uart_b.rx_buffer_level; + EXPECT_LT((last_msg_.uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_b.rx_throughput, expected 0.0, is " + << last_msg_.uart_b.rx_throughput; + EXPECT_EQ(last_msg_.uart_b.tx_buffer_level, 0) + << "incorrect value for last_msg_.uart_b.tx_buffer_level, expected 0, is " + << last_msg_.uart_b.tx_buffer_level; + EXPECT_LT((last_msg_.uart_b.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_b.tx_throughput, expected 0.0, is " + << last_msg_.uart_b.tx_throughput; + EXPECT_EQ(last_msg_.uart_ftdi.crc_error_count, 0) + << "incorrect value for last_msg_.uart_ftdi.crc_error_count, expected 0, " + "is " + << last_msg_.uart_ftdi.crc_error_count; + EXPECT_EQ(last_msg_.uart_ftdi.io_error_count, 0) + << "incorrect value for last_msg_.uart_ftdi.io_error_count, expected 0, " + "is " + << last_msg_.uart_ftdi.io_error_count; + EXPECT_EQ(last_msg_.uart_ftdi.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_ftdi.rx_buffer_level, expected 0, " + "is " + << last_msg_.uart_ftdi.rx_buffer_level; + EXPECT_LT((last_msg_.uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_ftdi.rx_throughput, expected 0.0, " + "is " + << last_msg_.uart_ftdi.rx_throughput; + EXPECT_EQ(last_msg_.uart_ftdi.tx_buffer_level, 0) + << "incorrect value for last_msg_.uart_ftdi.tx_buffer_level, expected 0, " + "is " + << last_msg_.uart_ftdi.tx_buffer_level; + EXPECT_LT((last_msg_.uart_ftdi.tx_throughput * 100 - 0.0659999996424 * 100), + 0.05) + << "incorrect value for last_msg_.uart_ftdi.tx_throughput, expected " + "0.0659999996424, is " + << last_msg_.uart_ftdi.tx_throughput; } -class Test_auto_check_sbp_piksi_MsgUartStateDepA4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgUartStateDepA4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgUartStateDepA4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgUartStateDepA4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_uart_state_depa_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_uart_state_depa_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -571,124 +759,176 @@ class Test_auto_check_sbp_piksi_MsgUartStateDepA4 : sbp_msg_uart_state_depa_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgUartStateDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,138,75,6,60,0,0,0,0,0,0,80,113,201,61,0,0,0,0,0,0,0,0,2,0,145,237,252,62,0,0,0,0,0,0,0,0,38,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,112,111, }; - - sbp_msg_uart_state_depa_t test_msg{}; - test_msg.latency.avg = -1; - test_msg.latency.current = -1; - test_msg.latency.lmax = 0; - test_msg.latency.lmin = 0; - test_msg.uart_a.crc_error_count = 0; - test_msg.uart_a.io_error_count = 0; - test_msg.uart_a.rx_buffer_level = 0; - test_msg.uart_a.rx_throughput = 0.008196720853447914; - test_msg.uart_a.tx_buffer_level = 0; - test_msg.uart_a.tx_throughput = 0.0; - test_msg.uart_b.crc_error_count = 0; - test_msg.uart_b.io_error_count = 0; - test_msg.uart_b.rx_buffer_level = 0; - test_msg.uart_b.rx_throughput = 0.0; - test_msg.uart_b.tx_buffer_level = 2; - test_msg.uart_b.tx_throughput = 0.09836065769195557; - test_msg.uart_ftdi.crc_error_count = 0; - test_msg.uart_ftdi.io_error_count = 0; - test_msg.uart_ftdi.rx_buffer_level = 0; - test_msg.uart_ftdi.rx_throughput = 0.0; - test_msg.uart_ftdi.tx_buffer_level = 38; - test_msg.uart_ftdi.tx_throughput = 0.49399998784065247; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.latency.avg, -1) << "incorrect value for last_msg_.latency.avg, expected -1, is " << last_msg_.latency.avg; - EXPECT_EQ(last_msg_.latency.current, -1) << "incorrect value for last_msg_.latency.current, expected -1, is " << last_msg_.latency.current; - EXPECT_EQ(last_msg_.latency.lmax, 0) << "incorrect value for last_msg_.latency.lmax, expected 0, is " << last_msg_.latency.lmax; - EXPECT_EQ(last_msg_.latency.lmin, 0) << "incorrect value for last_msg_.latency.lmin, expected 0, is " << last_msg_.latency.lmin; - EXPECT_EQ(last_msg_.uart_a.crc_error_count, 0) << "incorrect value for last_msg_.uart_a.crc_error_count, expected 0, is " << last_msg_.uart_a.crc_error_count; - EXPECT_EQ(last_msg_.uart_a.io_error_count, 0) << "incorrect value for last_msg_.uart_a.io_error_count, expected 0, is " << last_msg_.uart_a.io_error_count; - EXPECT_EQ(last_msg_.uart_a.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_a.rx_buffer_level, expected 0, is " << last_msg_.uart_a.rx_buffer_level; - EXPECT_LT((last_msg_.uart_a.rx_throughput * 100 - 0.00819672085345 * 100), 0.05) << "incorrect value for last_msg_.uart_a.rx_throughput, expected 0.00819672085345, is " << last_msg_.uart_a.rx_throughput; - EXPECT_EQ(last_msg_.uart_a.tx_buffer_level, 0) << "incorrect value for last_msg_.uart_a.tx_buffer_level, expected 0, is " << last_msg_.uart_a.tx_buffer_level; - EXPECT_LT((last_msg_.uart_a.tx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_a.tx_throughput, expected 0.0, is " << last_msg_.uart_a.tx_throughput; - EXPECT_EQ(last_msg_.uart_b.crc_error_count, 0) << "incorrect value for last_msg_.uart_b.crc_error_count, expected 0, is " << last_msg_.uart_b.crc_error_count; - EXPECT_EQ(last_msg_.uart_b.io_error_count, 0) << "incorrect value for last_msg_.uart_b.io_error_count, expected 0, is " << last_msg_.uart_b.io_error_count; - EXPECT_EQ(last_msg_.uart_b.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_b.rx_buffer_level, expected 0, is " << last_msg_.uart_b.rx_buffer_level; - EXPECT_LT((last_msg_.uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_b.rx_throughput, expected 0.0, is " << last_msg_.uart_b.rx_throughput; - EXPECT_EQ(last_msg_.uart_b.tx_buffer_level, 2) << "incorrect value for last_msg_.uart_b.tx_buffer_level, expected 2, is " << last_msg_.uart_b.tx_buffer_level; - EXPECT_LT((last_msg_.uart_b.tx_throughput * 100 - 0.098360657692 * 100), 0.05) << "incorrect value for last_msg_.uart_b.tx_throughput, expected 0.098360657692, is " << last_msg_.uart_b.tx_throughput; - EXPECT_EQ(last_msg_.uart_ftdi.crc_error_count, 0) << "incorrect value for last_msg_.uart_ftdi.crc_error_count, expected 0, is " << last_msg_.uart_ftdi.crc_error_count; - EXPECT_EQ(last_msg_.uart_ftdi.io_error_count, 0) << "incorrect value for last_msg_.uart_ftdi.io_error_count, expected 0, is " << last_msg_.uart_ftdi.io_error_count; - EXPECT_EQ(last_msg_.uart_ftdi.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_ftdi.rx_buffer_level, expected 0, is " << last_msg_.uart_ftdi.rx_buffer_level; - EXPECT_LT((last_msg_.uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_ftdi.rx_throughput, expected 0.0, is " << last_msg_.uart_ftdi.rx_throughput; - EXPECT_EQ(last_msg_.uart_ftdi.tx_buffer_level, 38) << "incorrect value for last_msg_.uart_ftdi.tx_buffer_level, expected 38, is " << last_msg_.uart_ftdi.tx_buffer_level; - EXPECT_LT((last_msg_.uart_ftdi.tx_throughput * 100 - 0.493999987841 * 100), 0.05) << "incorrect value for last_msg_.uart_ftdi.tx_throughput, expected 0.493999987841, is " << last_msg_.uart_ftdi.tx_throughput; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgUartStateDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 138, 75, 6, 60, + 0, 0, 0, 0, 0, 0, 80, 113, 201, 61, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 145, 237, 252, 62, 0, 0, 0, 0, + 0, 0, 0, 0, 38, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 112, 111, + }; + + sbp_msg_uart_state_depa_t test_msg{}; + test_msg.latency.avg = -1; + test_msg.latency.current = -1; + test_msg.latency.lmax = 0; + test_msg.latency.lmin = 0; + test_msg.uart_a.crc_error_count = 0; + test_msg.uart_a.io_error_count = 0; + test_msg.uart_a.rx_buffer_level = 0; + test_msg.uart_a.rx_throughput = 0.008196720853447914; + test_msg.uart_a.tx_buffer_level = 0; + test_msg.uart_a.tx_throughput = 0.0; + test_msg.uart_b.crc_error_count = 0; + test_msg.uart_b.io_error_count = 0; + test_msg.uart_b.rx_buffer_level = 0; + test_msg.uart_b.rx_throughput = 0.0; + test_msg.uart_b.tx_buffer_level = 2; + test_msg.uart_b.tx_throughput = 0.09836065769195557; + test_msg.uart_ftdi.crc_error_count = 0; + test_msg.uart_ftdi.io_error_count = 0; + test_msg.uart_ftdi.rx_buffer_level = 0; + test_msg.uart_ftdi.rx_throughput = 0.0; + test_msg.uart_ftdi.tx_buffer_level = 38; + test_msg.uart_ftdi.tx_throughput = 0.49399998784065247; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.latency.avg, -1) + << "incorrect value for last_msg_.latency.avg, expected -1, is " + << last_msg_.latency.avg; + EXPECT_EQ(last_msg_.latency.current, -1) + << "incorrect value for last_msg_.latency.current, expected -1, is " + << last_msg_.latency.current; + EXPECT_EQ(last_msg_.latency.lmax, 0) + << "incorrect value for last_msg_.latency.lmax, expected 0, is " + << last_msg_.latency.lmax; + EXPECT_EQ(last_msg_.latency.lmin, 0) + << "incorrect value for last_msg_.latency.lmin, expected 0, is " + << last_msg_.latency.lmin; + EXPECT_EQ(last_msg_.uart_a.crc_error_count, 0) + << "incorrect value for last_msg_.uart_a.crc_error_count, expected 0, is " + << last_msg_.uart_a.crc_error_count; + EXPECT_EQ(last_msg_.uart_a.io_error_count, 0) + << "incorrect value for last_msg_.uart_a.io_error_count, expected 0, is " + << last_msg_.uart_a.io_error_count; + EXPECT_EQ(last_msg_.uart_a.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_a.rx_buffer_level, expected 0, is " + << last_msg_.uart_a.rx_buffer_level; + EXPECT_LT((last_msg_.uart_a.rx_throughput * 100 - 0.00819672085345 * 100), + 0.05) + << "incorrect value for last_msg_.uart_a.rx_throughput, expected " + "0.00819672085345, is " + << last_msg_.uart_a.rx_throughput; + EXPECT_EQ(last_msg_.uart_a.tx_buffer_level, 0) + << "incorrect value for last_msg_.uart_a.tx_buffer_level, expected 0, is " + << last_msg_.uart_a.tx_buffer_level; + EXPECT_LT((last_msg_.uart_a.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_a.tx_throughput, expected 0.0, is " + << last_msg_.uart_a.tx_throughput; + EXPECT_EQ(last_msg_.uart_b.crc_error_count, 0) + << "incorrect value for last_msg_.uart_b.crc_error_count, expected 0, is " + << last_msg_.uart_b.crc_error_count; + EXPECT_EQ(last_msg_.uart_b.io_error_count, 0) + << "incorrect value for last_msg_.uart_b.io_error_count, expected 0, is " + << last_msg_.uart_b.io_error_count; + EXPECT_EQ(last_msg_.uart_b.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_b.rx_buffer_level, expected 0, is " + << last_msg_.uart_b.rx_buffer_level; + EXPECT_LT((last_msg_.uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_b.rx_throughput, expected 0.0, is " + << last_msg_.uart_b.rx_throughput; + EXPECT_EQ(last_msg_.uart_b.tx_buffer_level, 2) + << "incorrect value for last_msg_.uart_b.tx_buffer_level, expected 2, is " + << last_msg_.uart_b.tx_buffer_level; + EXPECT_LT((last_msg_.uart_b.tx_throughput * 100 - 0.098360657692 * 100), 0.05) + << "incorrect value for last_msg_.uart_b.tx_throughput, expected " + "0.098360657692, is " + << last_msg_.uart_b.tx_throughput; + EXPECT_EQ(last_msg_.uart_ftdi.crc_error_count, 0) + << "incorrect value for last_msg_.uart_ftdi.crc_error_count, expected 0, " + "is " + << last_msg_.uart_ftdi.crc_error_count; + EXPECT_EQ(last_msg_.uart_ftdi.io_error_count, 0) + << "incorrect value for last_msg_.uart_ftdi.io_error_count, expected 0, " + "is " + << last_msg_.uart_ftdi.io_error_count; + EXPECT_EQ(last_msg_.uart_ftdi.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_ftdi.rx_buffer_level, expected 0, " + "is " + << last_msg_.uart_ftdi.rx_buffer_level; + EXPECT_LT((last_msg_.uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_ftdi.rx_throughput, expected 0.0, " + "is " + << last_msg_.uart_ftdi.rx_throughput; + EXPECT_EQ(last_msg_.uart_ftdi.tx_buffer_level, 38) + << "incorrect value for last_msg_.uart_ftdi.tx_buffer_level, expected " + "38, is " + << last_msg_.uart_ftdi.tx_buffer_level; + EXPECT_LT((last_msg_.uart_ftdi.tx_throughput * 100 - 0.493999987841 * 100), + 0.05) + << "incorrect value for last_msg_.uart_ftdi.tx_throughput, expected " + "0.493999987841, is " + << last_msg_.uart_ftdi.tx_throughput; } -class Test_auto_check_sbp_piksi_MsgUartStateDepA5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_piksi_MsgUartStateDepA5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_piksi_MsgUartStateDepA5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_piksi_MsgUartStateDepA5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_uart_state_depa_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_uart_state_depa_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -696,74 +936,133 @@ class Test_auto_check_sbp_piksi_MsgUartStateDepA5 : sbp_msg_uart_state_depa_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_piksi_MsgUartStateDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,24,0,195,4,58,166,155,68,60,0,0,0,0,0,0,0,0,2,0,166,155,68,60,0,0,0,0,0,0,0,0,2,0,236,81,168,63,0,0,0,0,0,0,0,0,50,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,22,72, }; - - sbp_msg_uart_state_depa_t test_msg{}; - test_msg.latency.avg = -1; - test_msg.latency.current = -1; - test_msg.latency.lmax = 0; - test_msg.latency.lmin = 0; - test_msg.uart_a.crc_error_count = 0; - test_msg.uart_a.io_error_count = 0; - test_msg.uart_a.rx_buffer_level = 0; - test_msg.uart_a.rx_throughput = 0.0; - test_msg.uart_a.tx_buffer_level = 2; - test_msg.uart_a.tx_throughput = 0.012000000104308128; - test_msg.uart_b.crc_error_count = 0; - test_msg.uart_b.io_error_count = 0; - test_msg.uart_b.rx_buffer_level = 0; - test_msg.uart_b.rx_throughput = 0.0; - test_msg.uart_b.tx_buffer_level = 2; - test_msg.uart_b.tx_throughput = 0.012000000104308128; - test_msg.uart_ftdi.crc_error_count = 0; - test_msg.uart_ftdi.io_error_count = 0; - test_msg.uart_ftdi.rx_buffer_level = 0; - test_msg.uart_ftdi.rx_throughput = 0.0; - test_msg.uart_ftdi.tx_buffer_level = 50; - test_msg.uart_ftdi.tx_throughput = 1.315000057220459; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.latency.avg, -1) << "incorrect value for last_msg_.latency.avg, expected -1, is " << last_msg_.latency.avg; - EXPECT_EQ(last_msg_.latency.current, -1) << "incorrect value for last_msg_.latency.current, expected -1, is " << last_msg_.latency.current; - EXPECT_EQ(last_msg_.latency.lmax, 0) << "incorrect value for last_msg_.latency.lmax, expected 0, is " << last_msg_.latency.lmax; - EXPECT_EQ(last_msg_.latency.lmin, 0) << "incorrect value for last_msg_.latency.lmin, expected 0, is " << last_msg_.latency.lmin; - EXPECT_EQ(last_msg_.uart_a.crc_error_count, 0) << "incorrect value for last_msg_.uart_a.crc_error_count, expected 0, is " << last_msg_.uart_a.crc_error_count; - EXPECT_EQ(last_msg_.uart_a.io_error_count, 0) << "incorrect value for last_msg_.uart_a.io_error_count, expected 0, is " << last_msg_.uart_a.io_error_count; - EXPECT_EQ(last_msg_.uart_a.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_a.rx_buffer_level, expected 0, is " << last_msg_.uart_a.rx_buffer_level; - EXPECT_LT((last_msg_.uart_a.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_a.rx_throughput, expected 0.0, is " << last_msg_.uart_a.rx_throughput; - EXPECT_EQ(last_msg_.uart_a.tx_buffer_level, 2) << "incorrect value for last_msg_.uart_a.tx_buffer_level, expected 2, is " << last_msg_.uart_a.tx_buffer_level; - EXPECT_LT((last_msg_.uart_a.tx_throughput * 100 - 0.0120000001043 * 100), 0.05) << "incorrect value for last_msg_.uart_a.tx_throughput, expected 0.0120000001043, is " << last_msg_.uart_a.tx_throughput; - EXPECT_EQ(last_msg_.uart_b.crc_error_count, 0) << "incorrect value for last_msg_.uart_b.crc_error_count, expected 0, is " << last_msg_.uart_b.crc_error_count; - EXPECT_EQ(last_msg_.uart_b.io_error_count, 0) << "incorrect value for last_msg_.uart_b.io_error_count, expected 0, is " << last_msg_.uart_b.io_error_count; - EXPECT_EQ(last_msg_.uart_b.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_b.rx_buffer_level, expected 0, is " << last_msg_.uart_b.rx_buffer_level; - EXPECT_LT((last_msg_.uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_b.rx_throughput, expected 0.0, is " << last_msg_.uart_b.rx_throughput; - EXPECT_EQ(last_msg_.uart_b.tx_buffer_level, 2) << "incorrect value for last_msg_.uart_b.tx_buffer_level, expected 2, is " << last_msg_.uart_b.tx_buffer_level; - EXPECT_LT((last_msg_.uart_b.tx_throughput * 100 - 0.0120000001043 * 100), 0.05) << "incorrect value for last_msg_.uart_b.tx_throughput, expected 0.0120000001043, is " << last_msg_.uart_b.tx_throughput; - EXPECT_EQ(last_msg_.uart_ftdi.crc_error_count, 0) << "incorrect value for last_msg_.uart_ftdi.crc_error_count, expected 0, is " << last_msg_.uart_ftdi.crc_error_count; - EXPECT_EQ(last_msg_.uart_ftdi.io_error_count, 0) << "incorrect value for last_msg_.uart_ftdi.io_error_count, expected 0, is " << last_msg_.uart_ftdi.io_error_count; - EXPECT_EQ(last_msg_.uart_ftdi.rx_buffer_level, 0) << "incorrect value for last_msg_.uart_ftdi.rx_buffer_level, expected 0, is " << last_msg_.uart_ftdi.rx_buffer_level; - EXPECT_LT((last_msg_.uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) << "incorrect value for last_msg_.uart_ftdi.rx_throughput, expected 0.0, is " << last_msg_.uart_ftdi.rx_throughput; - EXPECT_EQ(last_msg_.uart_ftdi.tx_buffer_level, 50) << "incorrect value for last_msg_.uart_ftdi.tx_buffer_level, expected 50, is " << last_msg_.uart_ftdi.tx_buffer_level; - EXPECT_LT((last_msg_.uart_ftdi.tx_throughput * 100 - 1.31500005722 * 100), 0.05) << "incorrect value for last_msg_.uart_ftdi.tx_throughput, expected 1.31500005722, is " << last_msg_.uart_ftdi.tx_throughput; +}; + +TEST_F(Test_auto_check_sbp_piksi_MsgUartStateDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 166, 155, 68, 60, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 166, 155, 68, 60, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 236, 81, 168, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 22, 72, + }; + + sbp_msg_uart_state_depa_t test_msg{}; + test_msg.latency.avg = -1; + test_msg.latency.current = -1; + test_msg.latency.lmax = 0; + test_msg.latency.lmin = 0; + test_msg.uart_a.crc_error_count = 0; + test_msg.uart_a.io_error_count = 0; + test_msg.uart_a.rx_buffer_level = 0; + test_msg.uart_a.rx_throughput = 0.0; + test_msg.uart_a.tx_buffer_level = 2; + test_msg.uart_a.tx_throughput = 0.012000000104308128; + test_msg.uart_b.crc_error_count = 0; + test_msg.uart_b.io_error_count = 0; + test_msg.uart_b.rx_buffer_level = 0; + test_msg.uart_b.rx_throughput = 0.0; + test_msg.uart_b.tx_buffer_level = 2; + test_msg.uart_b.tx_throughput = 0.012000000104308128; + test_msg.uart_ftdi.crc_error_count = 0; + test_msg.uart_ftdi.io_error_count = 0; + test_msg.uart_ftdi.rx_buffer_level = 0; + test_msg.uart_ftdi.rx_throughput = 0.0; + test_msg.uart_ftdi.tx_buffer_level = 50; + test_msg.uart_ftdi.tx_throughput = 1.315000057220459; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.latency.avg, -1) + << "incorrect value for last_msg_.latency.avg, expected -1, is " + << last_msg_.latency.avg; + EXPECT_EQ(last_msg_.latency.current, -1) + << "incorrect value for last_msg_.latency.current, expected -1, is " + << last_msg_.latency.current; + EXPECT_EQ(last_msg_.latency.lmax, 0) + << "incorrect value for last_msg_.latency.lmax, expected 0, is " + << last_msg_.latency.lmax; + EXPECT_EQ(last_msg_.latency.lmin, 0) + << "incorrect value for last_msg_.latency.lmin, expected 0, is " + << last_msg_.latency.lmin; + EXPECT_EQ(last_msg_.uart_a.crc_error_count, 0) + << "incorrect value for last_msg_.uart_a.crc_error_count, expected 0, is " + << last_msg_.uart_a.crc_error_count; + EXPECT_EQ(last_msg_.uart_a.io_error_count, 0) + << "incorrect value for last_msg_.uart_a.io_error_count, expected 0, is " + << last_msg_.uart_a.io_error_count; + EXPECT_EQ(last_msg_.uart_a.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_a.rx_buffer_level, expected 0, is " + << last_msg_.uart_a.rx_buffer_level; + EXPECT_LT((last_msg_.uart_a.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_a.rx_throughput, expected 0.0, is " + << last_msg_.uart_a.rx_throughput; + EXPECT_EQ(last_msg_.uart_a.tx_buffer_level, 2) + << "incorrect value for last_msg_.uart_a.tx_buffer_level, expected 2, is " + << last_msg_.uart_a.tx_buffer_level; + EXPECT_LT((last_msg_.uart_a.tx_throughput * 100 - 0.0120000001043 * 100), + 0.05) + << "incorrect value for last_msg_.uart_a.tx_throughput, expected " + "0.0120000001043, is " + << last_msg_.uart_a.tx_throughput; + EXPECT_EQ(last_msg_.uart_b.crc_error_count, 0) + << "incorrect value for last_msg_.uart_b.crc_error_count, expected 0, is " + << last_msg_.uart_b.crc_error_count; + EXPECT_EQ(last_msg_.uart_b.io_error_count, 0) + << "incorrect value for last_msg_.uart_b.io_error_count, expected 0, is " + << last_msg_.uart_b.io_error_count; + EXPECT_EQ(last_msg_.uart_b.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_b.rx_buffer_level, expected 0, is " + << last_msg_.uart_b.rx_buffer_level; + EXPECT_LT((last_msg_.uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_b.rx_throughput, expected 0.0, is " + << last_msg_.uart_b.rx_throughput; + EXPECT_EQ(last_msg_.uart_b.tx_buffer_level, 2) + << "incorrect value for last_msg_.uart_b.tx_buffer_level, expected 2, is " + << last_msg_.uart_b.tx_buffer_level; + EXPECT_LT((last_msg_.uart_b.tx_throughput * 100 - 0.0120000001043 * 100), + 0.05) + << "incorrect value for last_msg_.uart_b.tx_throughput, expected " + "0.0120000001043, is " + << last_msg_.uart_b.tx_throughput; + EXPECT_EQ(last_msg_.uart_ftdi.crc_error_count, 0) + << "incorrect value for last_msg_.uart_ftdi.crc_error_count, expected 0, " + "is " + << last_msg_.uart_ftdi.crc_error_count; + EXPECT_EQ(last_msg_.uart_ftdi.io_error_count, 0) + << "incorrect value for last_msg_.uart_ftdi.io_error_count, expected 0, " + "is " + << last_msg_.uart_ftdi.io_error_count; + EXPECT_EQ(last_msg_.uart_ftdi.rx_buffer_level, 0) + << "incorrect value for last_msg_.uart_ftdi.rx_buffer_level, expected 0, " + "is " + << last_msg_.uart_ftdi.rx_buffer_level; + EXPECT_LT((last_msg_.uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for last_msg_.uart_ftdi.rx_throughput, expected 0.0, " + "is " + << last_msg_.uart_ftdi.rx_throughput; + EXPECT_EQ(last_msg_.uart_ftdi.tx_buffer_level, 50) + << "incorrect value for last_msg_.uart_ftdi.tx_buffer_level, expected " + "50, is " + << last_msg_.uart_ftdi.tx_buffer_level; + EXPECT_LT((last_msg_.uart_ftdi.tx_throughput * 100 - 1.31500005722 * 100), + 0.05) + << "incorrect value for last_msg_.uart_ftdi.tx_throughput, expected " + "1.31500005722, is " + << last_msg_.uart_ftdi.tx_throughput; } diff --git a/c/test/cpp/auto_check_sbp_sbas_MsgSbasRaw.cc b/c/test/cpp/auto_check_sbp_sbas_MsgSbasRaw.cc index 1f704cc45..0349576f5 100644 --- a/c/test/cpp/auto_check_sbp_sbas_MsgSbasRaw.cc +++ b/c/test/cpp/auto_check_sbp_sbas_MsgSbasRaw.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/sbas/test_MsgSbasRaw.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/sbas/test_MsgSbasRaw.yaml by generate.py. Do not +// modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_sbas_MsgSbasRaw0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_sbas_MsgSbasRaw0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_sbas_MsgSbasRaw0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_sbas_MsgSbasRaw0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_sbas_raw_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_sbas_raw_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,119 +67,183 @@ class Test_auto_check_sbp_sbas_MsgSbasRaw0 : sbp_msg_sbas_raw_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_sbas_MsgSbasRaw0, Test) -{ - - uint8_t encoded_frame[] = {85,119,119,28,200,34,131,2,201,228,233,29,4,23,255,0,23,255,0,23,255,127,240,2,255,192,3,127,247,255,127,247,255,229,229,238,170,175,255,240,167,14, }; - - sbp_msg_sbas_raw_t test_msg{}; - - test_msg.data[0] = 23; - - test_msg.data[1] = 255; - - test_msg.data[2] = 0; - - test_msg.data[3] = 23; - - test_msg.data[4] = 255; - - test_msg.data[5] = 0; - - test_msg.data[6] = 23; - - test_msg.data[7] = 255; - - test_msg.data[8] = 127; - - test_msg.data[9] = 240; - - test_msg.data[10] = 2; - - test_msg.data[11] = 255; - - test_msg.data[12] = 192; - - test_msg.data[13] = 3; - - test_msg.data[14] = 127; - - test_msg.data[15] = 247; - - test_msg.data[16] = 255; - - test_msg.data[17] = 127; - - test_msg.data[18] = 247; - - test_msg.data[19] = 255; - - test_msg.data[20] = 229; - - test_msg.data[21] = 229; - - test_msg.data[22] = 238; - - test_msg.data[23] = 170; - - test_msg.data[24] = 175; - - test_msg.data[25] = 255; - - test_msg.data[26] = 240; - test_msg.message_type = 4; - test_msg.sid.code = 2; - test_msg.sid.sat = 131; - test_msg.tow = 501867721; - - EXPECT_EQ(send_message( 51228, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 51228); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.data[0], 23) << "incorrect value for last_msg_.data[0], expected 23, is " << last_msg_.data[0]; - EXPECT_EQ(last_msg_.data[1], 255) << "incorrect value for last_msg_.data[1], expected 255, is " << last_msg_.data[1]; - EXPECT_EQ(last_msg_.data[2], 0) << "incorrect value for last_msg_.data[2], expected 0, is " << last_msg_.data[2]; - EXPECT_EQ(last_msg_.data[3], 23) << "incorrect value for last_msg_.data[3], expected 23, is " << last_msg_.data[3]; - EXPECT_EQ(last_msg_.data[4], 255) << "incorrect value for last_msg_.data[4], expected 255, is " << last_msg_.data[4]; - EXPECT_EQ(last_msg_.data[5], 0) << "incorrect value for last_msg_.data[5], expected 0, is " << last_msg_.data[5]; - EXPECT_EQ(last_msg_.data[6], 23) << "incorrect value for last_msg_.data[6], expected 23, is " << last_msg_.data[6]; - EXPECT_EQ(last_msg_.data[7], 255) << "incorrect value for last_msg_.data[7], expected 255, is " << last_msg_.data[7]; - EXPECT_EQ(last_msg_.data[8], 127) << "incorrect value for last_msg_.data[8], expected 127, is " << last_msg_.data[8]; - EXPECT_EQ(last_msg_.data[9], 240) << "incorrect value for last_msg_.data[9], expected 240, is " << last_msg_.data[9]; - EXPECT_EQ(last_msg_.data[10], 2) << "incorrect value for last_msg_.data[10], expected 2, is " << last_msg_.data[10]; - EXPECT_EQ(last_msg_.data[11], 255) << "incorrect value for last_msg_.data[11], expected 255, is " << last_msg_.data[11]; - EXPECT_EQ(last_msg_.data[12], 192) << "incorrect value for last_msg_.data[12], expected 192, is " << last_msg_.data[12]; - EXPECT_EQ(last_msg_.data[13], 3) << "incorrect value for last_msg_.data[13], expected 3, is " << last_msg_.data[13]; - EXPECT_EQ(last_msg_.data[14], 127) << "incorrect value for last_msg_.data[14], expected 127, is " << last_msg_.data[14]; - EXPECT_EQ(last_msg_.data[15], 247) << "incorrect value for last_msg_.data[15], expected 247, is " << last_msg_.data[15]; - EXPECT_EQ(last_msg_.data[16], 255) << "incorrect value for last_msg_.data[16], expected 255, is " << last_msg_.data[16]; - EXPECT_EQ(last_msg_.data[17], 127) << "incorrect value for last_msg_.data[17], expected 127, is " << last_msg_.data[17]; - EXPECT_EQ(last_msg_.data[18], 247) << "incorrect value for last_msg_.data[18], expected 247, is " << last_msg_.data[18]; - EXPECT_EQ(last_msg_.data[19], 255) << "incorrect value for last_msg_.data[19], expected 255, is " << last_msg_.data[19]; - EXPECT_EQ(last_msg_.data[20], 229) << "incorrect value for last_msg_.data[20], expected 229, is " << last_msg_.data[20]; - EXPECT_EQ(last_msg_.data[21], 229) << "incorrect value for last_msg_.data[21], expected 229, is " << last_msg_.data[21]; - EXPECT_EQ(last_msg_.data[22], 238) << "incorrect value for last_msg_.data[22], expected 238, is " << last_msg_.data[22]; - EXPECT_EQ(last_msg_.data[23], 170) << "incorrect value for last_msg_.data[23], expected 170, is " << last_msg_.data[23]; - EXPECT_EQ(last_msg_.data[24], 175) << "incorrect value for last_msg_.data[24], expected 175, is " << last_msg_.data[24]; - EXPECT_EQ(last_msg_.data[25], 255) << "incorrect value for last_msg_.data[25], expected 255, is " << last_msg_.data[25]; - EXPECT_EQ(last_msg_.data[26], 240) << "incorrect value for last_msg_.data[26], expected 240, is " << last_msg_.data[26]; - EXPECT_EQ(last_msg_.message_type, 4) << "incorrect value for last_msg_.message_type, expected 4, is " << last_msg_.message_type; - EXPECT_EQ(last_msg_.sid.code, 2) << "incorrect value for last_msg_.sid.code, expected 2, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.sat, 131) << "incorrect value for last_msg_.sid.sat, expected 131, is " << last_msg_.sid.sat; - EXPECT_EQ(last_msg_.tow, 501867721) << "incorrect value for last_msg_.tow, expected 501867721, is " << last_msg_.tow; +}; + +TEST_F(Test_auto_check_sbp_sbas_MsgSbasRaw0, Test) { + uint8_t encoded_frame[] = { + 85, 119, 119, 28, 200, 34, 131, 2, 201, 228, 233, 29, 4, 23, + 255, 0, 23, 255, 0, 23, 255, 127, 240, 2, 255, 192, 3, 127, + 247, 255, 127, 247, 255, 229, 229, 238, 170, 175, 255, 240, 167, 14, + }; + + sbp_msg_sbas_raw_t test_msg{}; + + test_msg.data[0] = 23; + + test_msg.data[1] = 255; + + test_msg.data[2] = 0; + + test_msg.data[3] = 23; + + test_msg.data[4] = 255; + + test_msg.data[5] = 0; + + test_msg.data[6] = 23; + + test_msg.data[7] = 255; + + test_msg.data[8] = 127; + + test_msg.data[9] = 240; + + test_msg.data[10] = 2; + + test_msg.data[11] = 255; + + test_msg.data[12] = 192; + + test_msg.data[13] = 3; + + test_msg.data[14] = 127; + + test_msg.data[15] = 247; + + test_msg.data[16] = 255; + + test_msg.data[17] = 127; + + test_msg.data[18] = 247; + + test_msg.data[19] = 255; + + test_msg.data[20] = 229; + + test_msg.data[21] = 229; + + test_msg.data[22] = 238; + + test_msg.data[23] = 170; + + test_msg.data[24] = 175; + + test_msg.data[25] = 255; + + test_msg.data[26] = 240; + test_msg.message_type = 4; + test_msg.sid.code = 2; + test_msg.sid.sat = 131; + test_msg.tow = 501867721; + + EXPECT_EQ(send_message(51228, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 51228); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.data[0], 23) + << "incorrect value for last_msg_.data[0], expected 23, is " + << last_msg_.data[0]; + EXPECT_EQ(last_msg_.data[1], 255) + << "incorrect value for last_msg_.data[1], expected 255, is " + << last_msg_.data[1]; + EXPECT_EQ(last_msg_.data[2], 0) + << "incorrect value for last_msg_.data[2], expected 0, is " + << last_msg_.data[2]; + EXPECT_EQ(last_msg_.data[3], 23) + << "incorrect value for last_msg_.data[3], expected 23, is " + << last_msg_.data[3]; + EXPECT_EQ(last_msg_.data[4], 255) + << "incorrect value for last_msg_.data[4], expected 255, is " + << last_msg_.data[4]; + EXPECT_EQ(last_msg_.data[5], 0) + << "incorrect value for last_msg_.data[5], expected 0, is " + << last_msg_.data[5]; + EXPECT_EQ(last_msg_.data[6], 23) + << "incorrect value for last_msg_.data[6], expected 23, is " + << last_msg_.data[6]; + EXPECT_EQ(last_msg_.data[7], 255) + << "incorrect value for last_msg_.data[7], expected 255, is " + << last_msg_.data[7]; + EXPECT_EQ(last_msg_.data[8], 127) + << "incorrect value for last_msg_.data[8], expected 127, is " + << last_msg_.data[8]; + EXPECT_EQ(last_msg_.data[9], 240) + << "incorrect value for last_msg_.data[9], expected 240, is " + << last_msg_.data[9]; + EXPECT_EQ(last_msg_.data[10], 2) + << "incorrect value for last_msg_.data[10], expected 2, is " + << last_msg_.data[10]; + EXPECT_EQ(last_msg_.data[11], 255) + << "incorrect value for last_msg_.data[11], expected 255, is " + << last_msg_.data[11]; + EXPECT_EQ(last_msg_.data[12], 192) + << "incorrect value for last_msg_.data[12], expected 192, is " + << last_msg_.data[12]; + EXPECT_EQ(last_msg_.data[13], 3) + << "incorrect value for last_msg_.data[13], expected 3, is " + << last_msg_.data[13]; + EXPECT_EQ(last_msg_.data[14], 127) + << "incorrect value for last_msg_.data[14], expected 127, is " + << last_msg_.data[14]; + EXPECT_EQ(last_msg_.data[15], 247) + << "incorrect value for last_msg_.data[15], expected 247, is " + << last_msg_.data[15]; + EXPECT_EQ(last_msg_.data[16], 255) + << "incorrect value for last_msg_.data[16], expected 255, is " + << last_msg_.data[16]; + EXPECT_EQ(last_msg_.data[17], 127) + << "incorrect value for last_msg_.data[17], expected 127, is " + << last_msg_.data[17]; + EXPECT_EQ(last_msg_.data[18], 247) + << "incorrect value for last_msg_.data[18], expected 247, is " + << last_msg_.data[18]; + EXPECT_EQ(last_msg_.data[19], 255) + << "incorrect value for last_msg_.data[19], expected 255, is " + << last_msg_.data[19]; + EXPECT_EQ(last_msg_.data[20], 229) + << "incorrect value for last_msg_.data[20], expected 229, is " + << last_msg_.data[20]; + EXPECT_EQ(last_msg_.data[21], 229) + << "incorrect value for last_msg_.data[21], expected 229, is " + << last_msg_.data[21]; + EXPECT_EQ(last_msg_.data[22], 238) + << "incorrect value for last_msg_.data[22], expected 238, is " + << last_msg_.data[22]; + EXPECT_EQ(last_msg_.data[23], 170) + << "incorrect value for last_msg_.data[23], expected 170, is " + << last_msg_.data[23]; + EXPECT_EQ(last_msg_.data[24], 175) + << "incorrect value for last_msg_.data[24], expected 175, is " + << last_msg_.data[24]; + EXPECT_EQ(last_msg_.data[25], 255) + << "incorrect value for last_msg_.data[25], expected 255, is " + << last_msg_.data[25]; + EXPECT_EQ(last_msg_.data[26], 240) + << "incorrect value for last_msg_.data[26], expected 240, is " + << last_msg_.data[26]; + EXPECT_EQ(last_msg_.message_type, 4) + << "incorrect value for last_msg_.message_type, expected 4, is " + << last_msg_.message_type; + EXPECT_EQ(last_msg_.sid.code, 2) + << "incorrect value for last_msg_.sid.code, expected 2, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.sat, 131) + << "incorrect value for last_msg_.sid.sat, expected 131, is " + << last_msg_.sid.sat; + EXPECT_EQ(last_msg_.tow, 501867721) + << "incorrect value for last_msg_.tow, expected 501867721, is " + << last_msg_.tow; } diff --git a/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexDone.cc b/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexDone.cc index 3bf2aced0..596be8ccc 100644 --- a/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexDone.cc +++ b/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexDone.cc @@ -10,60 +10,57 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexDone.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexDone.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_settings_MsgSettingsReadByIndexDone0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_settings_MsgSettingsReadByIndexDone0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_settings_MsgSettingsReadByIndexDone0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_settings_MsgSettingsReadByIndexDone0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_settings_read_by_index_done_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_settings_read_by_index_done_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,30 +68,30 @@ class Test_auto_check_sbp_settings_MsgSettingsReadByIndexDone0 : sbp_msg_settings_read_by_index_done_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadByIndexDone0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadByIndexDone0, Test) { + uint8_t encoded_frame[] = { + 85, 166, 0, 246, 215, 0, 163, 58, + }; - uint8_t encoded_frame[] = {85,166,0,246,215,0,163,58, }; + sbp_msg_settings_read_by_index_done_t test_msg{}; - sbp_msg_settings_read_by_index_done_t test_msg{}; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); } diff --git a/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexReq.cc b/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexReq.cc index 27391e621..00171aff9 100644 --- a/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexReq.cc +++ b/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexReq.cc @@ -10,60 +10,57 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexReq.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_settings_MsgSettingsReadByIndexReq0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_settings_MsgSettingsReadByIndexReq0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_settings_MsgSettingsReadByIndexReq0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_settings_MsgSettingsReadByIndexReq0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_settings_read_by_index_req_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_settings_read_by_index_req_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,32 +68,34 @@ class Test_auto_check_sbp_settings_MsgSettingsReadByIndexReq0 : sbp_msg_settings_read_by_index_req_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadByIndexReq0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadByIndexReq0, Test) { + uint8_t encoded_frame[] = { + 85, 162, 0, 122, 123, 2, 244, 34, 235, 23, + }; - uint8_t encoded_frame[] = {85,162,0,122,123,2,244,34,235,23, }; + sbp_msg_settings_read_by_index_req_t test_msg{}; + test_msg.index = 8948; - sbp_msg_settings_read_by_index_req_t test_msg{}; - test_msg.index = 8948; - - EXPECT_EQ(send_message( 31610, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(31610, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 31610); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.index, 8948) << "incorrect value for last_msg_.index, expected 8948, is " << last_msg_.index; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 31610); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.index, 8948) + << "incorrect value for last_msg_.index, expected 8948, is " + << last_msg_.index; } diff --git a/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexResp.cc b/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexResp.cc index b4703af4a..fb147e7f3 100644 --- a/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexResp.cc +++ b/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexResp.cc @@ -10,60 +10,57 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexResp.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_settings_read_by_index_resp_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_settings_read_by_index_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,92 +68,105 @@ class Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp0 : sbp_msg_settings_read_by_index_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp0, Test) -{ - - uint8_t encoded_frame[] = {85,167,0,246,215,78,0,0,116,101,108,101,109,101,116,114,121,95,114,97,100,105,111,0,99,111,110,102,105,103,117,114,97,116,105,111,110,95,115,116,114,105,110,103,0,65,84,38,70,44,65,84,83,49,61,49,49,53,44,65,84,83,50,61,49,50,56,44,65,84,83,53,61,48,44,65,84,38,87,44,65,84,90,0,248,233, }; - - sbp_msg_settings_read_by_index_resp_t test_msg{}; - test_msg.index = 0; - - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "telemetry_radio")); - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "configuration_string")); - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "AT&F,ATS1=115,ATS2=128,ATS5=0,AT&W,ATZ")); - EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&test_msg), 76); - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.index, 0) << "incorrect value for last_msg_.index, expected 0, is " << last_msg_.index; - - EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&last_msg_), 76); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 0), "telemetry_radio"); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 1), "configuration_string"); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 2), "AT&F,ATS1=115,ATS2=128,ATS5=0,AT&W,ATZ"); +}; + +TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp0, Test) { + uint8_t encoded_frame[] = { + 85, 167, 0, 246, 215, 78, 0, 0, 116, 101, 108, 101, 109, 101, 116, + 114, 121, 95, 114, 97, 100, 105, 111, 0, 99, 111, 110, 102, 105, 103, + 117, 114, 97, 116, 105, 111, 110, 95, 115, 116, 114, 105, 110, 103, 0, + 65, 84, 38, 70, 44, 65, 84, 83, 49, 61, 49, 49, 53, 44, 65, + 84, 83, 50, 61, 49, 50, 56, 44, 65, 84, 83, 53, 61, 48, 44, + 65, 84, 38, 87, 44, 65, 84, 90, 0, 248, 233, + }; + + sbp_msg_settings_read_by_index_resp_t test_msg{}; + test_msg.index = 0; + + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg, "telemetry_radio")); + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg, "configuration_string")); + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg, "AT&F,ATS1=115,ATS2=128,ATS5=0,AT&W,ATZ")); + EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&test_msg), + 76); + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.index, 0) + << "incorrect value for last_msg_.index, expected 0, is " + << last_msg_.index; + + EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&last_msg_), + 76); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 0), + "telemetry_radio"); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 1), + "configuration_string"); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 2), + "AT&F,ATS1=115,ATS2=128,ATS5=0,AT&W,ATZ"); } -class Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_settings_read_by_index_resp_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_settings_read_by_index_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -164,94 +174,107 @@ class Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp1 : sbp_msg_settings_read_by_index_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp1, Test) -{ - - uint8_t encoded_frame[] = {85,167,0,246,215,35,1,0,117,97,114,116,95,102,116,100,105,0,109,111,100,101,0,83,66,80,0,101,110,117,109,58,83,66,80,44,78,77,69,65,0,167,243, }; - - sbp_msg_settings_read_by_index_resp_t test_msg{}; - test_msg.index = 1; - - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "uart_ftdi")); - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "mode")); - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "SBP")); - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "enum:SBP,NMEA")); - EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&test_msg), 33); - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.index, 1) << "incorrect value for last_msg_.index, expected 1, is " << last_msg_.index; - - EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&last_msg_), 33); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 0), "uart_ftdi"); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 1), "mode"); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 2), "SBP"); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 3), "enum:SBP,NMEA"); +}; + +TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp1, Test) { + uint8_t encoded_frame[] = { + 85, 167, 0, 246, 215, 35, 1, 0, 117, 97, 114, 116, 95, 102, 116, + 100, 105, 0, 109, 111, 100, 101, 0, 83, 66, 80, 0, 101, 110, 117, + 109, 58, 83, 66, 80, 44, 78, 77, 69, 65, 0, 167, 243, + }; + + sbp_msg_settings_read_by_index_resp_t test_msg{}; + test_msg.index = 1; + + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg, "uart_ftdi")); + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, + "mode")); + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, + "SBP")); + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg, "enum:SBP,NMEA")); + EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&test_msg), + 33); + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.index, 1) + << "incorrect value for last_msg_.index, expected 1, is " + << last_msg_.index; + + EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&last_msg_), + 33); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 0), + "uart_ftdi"); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 1), + "mode"); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 2), + "SBP"); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 3), + "enum:SBP,NMEA"); } -class Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_settings_read_by_index_resp_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_settings_read_by_index_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -259,92 +282,102 @@ class Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp2 : sbp_msg_settings_read_by_index_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp2, Test) -{ - - uint8_t encoded_frame[] = {85,167,0,246,215,35,2,0,117,97,114,116,95,102,116,100,105,0,115,98,112,95,109,101,115,115,97,103,101,95,109,97,115,107,0,54,53,53,51,53,0,4,56, }; - - sbp_msg_settings_read_by_index_resp_t test_msg{}; - test_msg.index = 2; - - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "uart_ftdi")); - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "sbp_message_mask")); - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "65535")); - EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&test_msg), 33); - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.index, 2) << "incorrect value for last_msg_.index, expected 2, is " << last_msg_.index; - - EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&last_msg_), 33); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 0), "uart_ftdi"); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 1), "sbp_message_mask"); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 2), "65535"); +}; + +TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp2, Test) { + uint8_t encoded_frame[] = { + 85, 167, 0, 246, 215, 35, 2, 0, 117, 97, 114, 116, 95, 102, 116, + 100, 105, 0, 115, 98, 112, 95, 109, 101, 115, 115, 97, 103, 101, 95, + 109, 97, 115, 107, 0, 54, 53, 53, 51, 53, 0, 4, 56, + }; + + sbp_msg_settings_read_by_index_resp_t test_msg{}; + test_msg.index = 2; + + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg, "uart_ftdi")); + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg, "sbp_message_mask")); + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, + "65535")); + EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&test_msg), + 33); + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.index, 2) + << "incorrect value for last_msg_.index, expected 2, is " + << last_msg_.index; + + EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&last_msg_), + 33); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 0), + "uart_ftdi"); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 1), + "sbp_message_mask"); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 2), + "65535"); } -class Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_settings_read_by_index_resp_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_settings_read_by_index_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -352,92 +385,102 @@ class Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp3 : sbp_msg_settings_read_by_index_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp3, Test) -{ - - uint8_t encoded_frame[] = {85,167,0,246,215,29,3,0,117,97,114,116,95,102,116,100,105,0,98,97,117,100,114,97,116,101,0,49,48,48,48,48,48,48,0,242,146, }; - - sbp_msg_settings_read_by_index_resp_t test_msg{}; - test_msg.index = 3; - - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "uart_ftdi")); - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "baudrate")); - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "1000000")); - EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&test_msg), 27); - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.index, 3) << "incorrect value for last_msg_.index, expected 3, is " << last_msg_.index; - - EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&last_msg_), 27); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 0), "uart_ftdi"); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 1), "baudrate"); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 2), "1000000"); +}; + +TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp3, Test) { + uint8_t encoded_frame[] = { + 85, 167, 0, 246, 215, 29, 3, 0, 117, 97, 114, 116, 95, + 102, 116, 100, 105, 0, 98, 97, 117, 100, 114, 97, 116, 101, + 0, 49, 48, 48, 48, 48, 48, 48, 0, 242, 146, + }; + + sbp_msg_settings_read_by_index_resp_t test_msg{}; + test_msg.index = 3; + + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg, "uart_ftdi")); + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg, "baudrate")); + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg, "1000000")); + EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&test_msg), + 27); + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.index, 3) + << "incorrect value for last_msg_.index, expected 3, is " + << last_msg_.index; + + EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&last_msg_), + 27); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 0), + "uart_ftdi"); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 1), + "baudrate"); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 2), + "1000000"); } -class Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_settings_read_by_index_resp_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_settings_read_by_index_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -445,44 +488,62 @@ class Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp4 : sbp_msg_settings_read_by_index_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp4, Test) -{ - - uint8_t encoded_frame[] = {85,167,0,246,215,36,4,0,117,97,114,116,95,117,97,114,116,97,0,109,111,100,101,0,83,66,80,0,101,110,117,109,58,83,66,80,44,78,77,69,65,0,22,4, }; - - sbp_msg_settings_read_by_index_resp_t test_msg{}; - test_msg.index = 4; - - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "uart_uarta")); - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "mode")); - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "SBP")); - EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, "enum:SBP,NMEA")); - EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&test_msg), 34); - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.index, 4) << "incorrect value for last_msg_.index, expected 4, is " << last_msg_.index; - - EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&last_msg_), 34); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 0), "uart_uarta"); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 1), "mode"); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 2), "SBP"); - EXPECT_STREQ(sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 3), "enum:SBP,NMEA"); +}; + +TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadByIndexResp4, Test) { + uint8_t encoded_frame[] = { + 85, 167, 0, 246, 215, 36, 4, 0, 117, 97, 114, 116, 95, 117, 97, + 114, 116, 97, 0, 109, 111, 100, 101, 0, 83, 66, 80, 0, 101, 110, + 117, 109, 58, 83, 66, 80, 44, 78, 77, 69, 65, 0, 22, 4, + }; + + sbp_msg_settings_read_by_index_resp_t test_msg{}; + test_msg.index = 4; + + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg, "uart_uarta")); + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, + "mode")); + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section(&test_msg, + "SBP")); + EXPECT_TRUE(sbp_msg_settings_read_by_index_resp_setting_add_section( + &test_msg, "enum:SBP,NMEA")); + EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&test_msg), + 34); + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.index, 4) + << "incorrect value for last_msg_.index, expected 4, is " + << last_msg_.index; + + EXPECT_EQ(sbp_msg_settings_read_by_index_resp_setting_encoded_len(&last_msg_), + 34); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 0), + "uart_uarta"); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 1), + "mode"); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 2), + "SBP"); + EXPECT_STREQ( + sbp_msg_settings_read_by_index_resp_setting_get_section(&last_msg_, 3), + "enum:SBP,NMEA"); } diff --git a/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadReq.cc b/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadReq.cc index 488c448f9..bae4c3ca0 100644 --- a/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadReq.cc +++ b/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadReq.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadReq.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_settings_MsgSettingsReadReq0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_settings_MsgSettingsReadReq0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_settings_MsgSettingsReadReq0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_settings_MsgSettingsReadReq0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_settings_read_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_settings_read_req_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,38 +67,44 @@ class Test_auto_check_sbp_settings_MsgSettingsReadReq0 : sbp_msg_settings_read_req_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadReq0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadReq0, Test) { + uint8_t encoded_frame[] = { + 85, 164, 0, 152, 214, 26, 115, 101, 99, 116, 105, 111, + 110, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, + 110, 103, 45, 110, 97, 109, 101, 0, 181, 228, + }; + + sbp_msg_settings_read_req_t test_msg{}; + + EXPECT_TRUE( + sbp_msg_settings_read_req_setting_add_section(&test_msg, "section-name")); + EXPECT_TRUE( + sbp_msg_settings_read_req_setting_add_section(&test_msg, "setting-name")); + EXPECT_EQ(sbp_msg_settings_read_req_setting_encoded_len(&test_msg), 26); - uint8_t encoded_frame[] = {85,164,0,152,214,26,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,181,228, }; + EXPECT_EQ(send_message(54936, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_settings_read_req_t test_msg{}; - - EXPECT_TRUE(sbp_msg_settings_read_req_setting_add_section(&test_msg, "section-name")); - EXPECT_TRUE(sbp_msg_settings_read_req_setting_add_section(&test_msg, "setting-name")); - EXPECT_EQ(sbp_msg_settings_read_req_setting_encoded_len(&test_msg), 26); - - EXPECT_EQ(send_message( 54936, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 54936); + EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 54936); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_settings_read_req_setting_encoded_len(&last_msg_), 26); - EXPECT_STREQ(sbp_msg_settings_read_req_setting_get_section(&last_msg_, 0), "section-name"); - EXPECT_STREQ(sbp_msg_settings_read_req_setting_get_section(&last_msg_, 1), "setting-name"); + EXPECT_EQ(sbp_msg_settings_read_req_setting_encoded_len(&last_msg_), 26); + EXPECT_STREQ(sbp_msg_settings_read_req_setting_get_section(&last_msg_, 0), + "section-name"); + EXPECT_STREQ(sbp_msg_settings_read_req_setting_get_section(&last_msg_, 1), + "setting-name"); } diff --git a/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadResp.cc b/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadResp.cc index 13dbe4392..31899f4ae 100644 --- a/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadResp.cc +++ b/c/test/cpp/auto_check_sbp_settings_MsgSettingsReadResp.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadResp.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_settings_MsgSettingsReadResp0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_settings_MsgSettingsReadResp0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_settings_MsgSettingsReadResp0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_settings_MsgSettingsReadResp0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_settings_read_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_settings_read_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,42 +67,54 @@ class Test_auto_check_sbp_settings_MsgSettingsReadResp0 : sbp_msg_settings_read_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadResp0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_settings_MsgSettingsReadResp0, Test) { + uint8_t encoded_frame[] = { + 85, 165, 0, 136, 240, 66, 115, 101, 99, 116, 105, 111, 110, 45, 110, + 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 110, 97, 109, + 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 118, 97, 108, 117, 101, + 0, 101, 110, 117, 109, 59, 118, 97, 108, 117, 101, 49, 44, 118, 97, + 108, 117, 101, 50, 44, 118, 97, 108, 117, 101, 51, 0, 203, 199, + }; + + sbp_msg_settings_read_resp_t test_msg{}; + + EXPECT_TRUE(sbp_msg_settings_read_resp_setting_add_section(&test_msg, + "section-name")); + EXPECT_TRUE(sbp_msg_settings_read_resp_setting_add_section(&test_msg, + "setting-name")); + EXPECT_TRUE(sbp_msg_settings_read_resp_setting_add_section(&test_msg, + "setting-value")); + EXPECT_TRUE(sbp_msg_settings_read_resp_setting_add_section( + &test_msg, "enum;value1,value2,value3")); + EXPECT_EQ(sbp_msg_settings_read_resp_setting_encoded_len(&test_msg), 66); - uint8_t encoded_frame[] = {85,165,0,136,240,66,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,203,199, }; + EXPECT_EQ(send_message(61576, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_settings_read_resp_t test_msg{}; - - EXPECT_TRUE(sbp_msg_settings_read_resp_setting_add_section(&test_msg, "section-name")); - EXPECT_TRUE(sbp_msg_settings_read_resp_setting_add_section(&test_msg, "setting-name")); - EXPECT_TRUE(sbp_msg_settings_read_resp_setting_add_section(&test_msg, "setting-value")); - EXPECT_TRUE(sbp_msg_settings_read_resp_setting_add_section(&test_msg, "enum;value1,value2,value3")); - EXPECT_EQ(sbp_msg_settings_read_resp_setting_encoded_len(&test_msg), 66); - - EXPECT_EQ(send_message( 61576, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61576); + EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61576); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_settings_read_resp_setting_encoded_len(&last_msg_), 66); - EXPECT_STREQ(sbp_msg_settings_read_resp_setting_get_section(&last_msg_, 0), "section-name"); - EXPECT_STREQ(sbp_msg_settings_read_resp_setting_get_section(&last_msg_, 1), "setting-name"); - EXPECT_STREQ(sbp_msg_settings_read_resp_setting_get_section(&last_msg_, 2), "setting-value"); - EXPECT_STREQ(sbp_msg_settings_read_resp_setting_get_section(&last_msg_, 3), "enum;value1,value2,value3"); + EXPECT_EQ(sbp_msg_settings_read_resp_setting_encoded_len(&last_msg_), 66); + EXPECT_STREQ(sbp_msg_settings_read_resp_setting_get_section(&last_msg_, 0), + "section-name"); + EXPECT_STREQ(sbp_msg_settings_read_resp_setting_get_section(&last_msg_, 1), + "setting-name"); + EXPECT_STREQ(sbp_msg_settings_read_resp_setting_get_section(&last_msg_, 2), + "setting-value"); + EXPECT_STREQ(sbp_msg_settings_read_resp_setting_get_section(&last_msg_, 3), + "enum;value1,value2,value3"); } diff --git a/c/test/cpp/auto_check_sbp_settings_MsgSettingsRegister.cc b/c/test/cpp/auto_check_sbp_settings_MsgSettingsRegister.cc index a72bc3525..549328479 100644 --- a/c/test/cpp/auto_check_sbp_settings_MsgSettingsRegister.cc +++ b/c/test/cpp/auto_check_sbp_settings_MsgSettingsRegister.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegister.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegister.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_settings_MsgSettingsRegister0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_settings_MsgSettingsRegister0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_settings_MsgSettingsRegister0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_settings_MsgSettingsRegister0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_settings_register_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_settings_register_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,42 +67,54 @@ class Test_auto_check_sbp_settings_MsgSettingsRegister0 : sbp_msg_settings_register_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_settings_MsgSettingsRegister0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_settings_MsgSettingsRegister0, Test) { + uint8_t encoded_frame[] = { + 85, 174, 0, 84, 6, 66, 115, 101, 99, 116, 105, 111, 110, 45, 110, + 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 110, 97, 109, + 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 118, 97, 108, 117, 101, + 0, 101, 110, 117, 109, 59, 118, 97, 108, 117, 101, 49, 44, 118, 97, + 108, 117, 101, 50, 44, 118, 97, 108, 117, 101, 51, 0, 142, 235, + }; + + sbp_msg_settings_register_t test_msg{}; + + EXPECT_TRUE( + sbp_msg_settings_register_setting_add_section(&test_msg, "section-name")); + EXPECT_TRUE( + sbp_msg_settings_register_setting_add_section(&test_msg, "setting-name")); + EXPECT_TRUE(sbp_msg_settings_register_setting_add_section(&test_msg, + "setting-value")); + EXPECT_TRUE(sbp_msg_settings_register_setting_add_section( + &test_msg, "enum;value1,value2,value3")); + EXPECT_EQ(sbp_msg_settings_register_setting_encoded_len(&test_msg), 66); - uint8_t encoded_frame[] = {85,174,0,84,6,66,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,142,235, }; + EXPECT_EQ(send_message(1620, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_settings_register_t test_msg{}; - - EXPECT_TRUE(sbp_msg_settings_register_setting_add_section(&test_msg, "section-name")); - EXPECT_TRUE(sbp_msg_settings_register_setting_add_section(&test_msg, "setting-name")); - EXPECT_TRUE(sbp_msg_settings_register_setting_add_section(&test_msg, "setting-value")); - EXPECT_TRUE(sbp_msg_settings_register_setting_add_section(&test_msg, "enum;value1,value2,value3")); - EXPECT_EQ(sbp_msg_settings_register_setting_encoded_len(&test_msg), 66); - - EXPECT_EQ(send_message( 1620, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1620); + EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1620); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_settings_register_setting_encoded_len(&last_msg_), 66); - EXPECT_STREQ(sbp_msg_settings_register_setting_get_section(&last_msg_, 0), "section-name"); - EXPECT_STREQ(sbp_msg_settings_register_setting_get_section(&last_msg_, 1), "setting-name"); - EXPECT_STREQ(sbp_msg_settings_register_setting_get_section(&last_msg_, 2), "setting-value"); - EXPECT_STREQ(sbp_msg_settings_register_setting_get_section(&last_msg_, 3), "enum;value1,value2,value3"); + EXPECT_EQ(sbp_msg_settings_register_setting_encoded_len(&last_msg_), 66); + EXPECT_STREQ(sbp_msg_settings_register_setting_get_section(&last_msg_, 0), + "section-name"); + EXPECT_STREQ(sbp_msg_settings_register_setting_get_section(&last_msg_, 1), + "setting-name"); + EXPECT_STREQ(sbp_msg_settings_register_setting_get_section(&last_msg_, 2), + "setting-value"); + EXPECT_STREQ(sbp_msg_settings_register_setting_get_section(&last_msg_, 3), + "enum;value1,value2,value3"); } diff --git a/c/test/cpp/auto_check_sbp_settings_MsgSettingsRegisterResp.cc b/c/test/cpp/auto_check_sbp_settings_MsgSettingsRegisterResp.cc index 9eccbe6fd..5b1e3b34f 100644 --- a/c/test/cpp/auto_check_sbp_settings_MsgSettingsRegisterResp.cc +++ b/c/test/cpp/auto_check_sbp_settings_MsgSettingsRegisterResp.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegisterResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegisterResp.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_settings_MsgSettingsRegisterResp0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_settings_MsgSettingsRegisterResp0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_settings_MsgSettingsRegisterResp0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_settings_MsgSettingsRegisterResp0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_settings_register_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_settings_register_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,44 +67,62 @@ class Test_auto_check_sbp_settings_MsgSettingsRegisterResp0 : sbp_msg_settings_register_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_settings_MsgSettingsRegisterResp0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_settings_MsgSettingsRegisterResp0, Test) { + uint8_t encoded_frame[] = { + 85, 175, 1, 41, 213, 67, 18, 115, 101, 99, 116, 105, 111, 110, 45, + 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 110, 97, + 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 118, 97, 108, 117, + 101, 0, 101, 110, 117, 109, 59, 118, 97, 108, 117, 101, 49, 44, 118, + 97, 108, 117, 101, 50, 44, 118, 97, 108, 117, 101, 51, 0, 82, 16, + }; + + sbp_msg_settings_register_resp_t test_msg{}; + + EXPECT_TRUE(sbp_msg_settings_register_resp_setting_add_section( + &test_msg, "section-name")); + EXPECT_TRUE(sbp_msg_settings_register_resp_setting_add_section( + &test_msg, "setting-name")); + EXPECT_TRUE(sbp_msg_settings_register_resp_setting_add_section( + &test_msg, "setting-value")); + EXPECT_TRUE(sbp_msg_settings_register_resp_setting_add_section( + &test_msg, "enum;value1,value2,value3")); + EXPECT_EQ(sbp_msg_settings_register_resp_setting_encoded_len(&test_msg), 66); + test_msg.status = 18; - uint8_t encoded_frame[] = {85,175,1,41,213,67,18,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,82,16, }; + EXPECT_EQ(send_message(54569, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_settings_register_resp_t test_msg{}; - - EXPECT_TRUE(sbp_msg_settings_register_resp_setting_add_section(&test_msg, "section-name")); - EXPECT_TRUE(sbp_msg_settings_register_resp_setting_add_section(&test_msg, "setting-name")); - EXPECT_TRUE(sbp_msg_settings_register_resp_setting_add_section(&test_msg, "setting-value")); - EXPECT_TRUE(sbp_msg_settings_register_resp_setting_add_section(&test_msg, "enum;value1,value2,value3")); - EXPECT_EQ(sbp_msg_settings_register_resp_setting_encoded_len(&test_msg), 66); - test_msg.status = 18; - - EXPECT_EQ(send_message( 54569, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 54569); + EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 54569); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_settings_register_resp_setting_encoded_len(&last_msg_), 66); - EXPECT_STREQ(sbp_msg_settings_register_resp_setting_get_section(&last_msg_, 0), "section-name"); - EXPECT_STREQ(sbp_msg_settings_register_resp_setting_get_section(&last_msg_, 1), "setting-name"); - EXPECT_STREQ(sbp_msg_settings_register_resp_setting_get_section(&last_msg_, 2), "setting-value"); - EXPECT_STREQ(sbp_msg_settings_register_resp_setting_get_section(&last_msg_, 3), "enum;value1,value2,value3"); - EXPECT_EQ(last_msg_.status, 18) << "incorrect value for last_msg_.status, expected 18, is " << last_msg_.status; + EXPECT_EQ(sbp_msg_settings_register_resp_setting_encoded_len(&last_msg_), 66); + EXPECT_STREQ( + sbp_msg_settings_register_resp_setting_get_section(&last_msg_, 0), + "section-name"); + EXPECT_STREQ( + sbp_msg_settings_register_resp_setting_get_section(&last_msg_, 1), + "setting-name"); + EXPECT_STREQ( + sbp_msg_settings_register_resp_setting_get_section(&last_msg_, 2), + "setting-value"); + EXPECT_STREQ( + sbp_msg_settings_register_resp_setting_get_section(&last_msg_, 3), + "enum;value1,value2,value3"); + EXPECT_EQ(last_msg_.status, 18) + << "incorrect value for last_msg_.status, expected 18, is " + << last_msg_.status; } diff --git a/c/test/cpp/auto_check_sbp_settings_MsgSettingsSave.cc b/c/test/cpp/auto_check_sbp_settings_MsgSettingsSave.cc index 9bfd80f86..d0929338f 100644 --- a/c/test/cpp/auto_check_sbp_settings_MsgSettingsSave.cc +++ b/c/test/cpp/auto_check_sbp_settings_MsgSettingsSave.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsSave.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsSave.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_settings_MsgSettingsSave0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_settings_MsgSettingsSave0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_settings_MsgSettingsSave0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_settings_MsgSettingsSave0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_settings_save_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_settings_save_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,30 +67,30 @@ class Test_auto_check_sbp_settings_MsgSettingsSave0 : sbp_msg_settings_save_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_settings_MsgSettingsSave0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_settings_MsgSettingsSave0, Test) { + uint8_t encoded_frame[] = { + 85, 161, 0, 162, 224, 0, 123, 67, + }; - uint8_t encoded_frame[] = {85,161,0,162,224,0,123,67, }; + sbp_msg_settings_save_t test_msg{}; - sbp_msg_settings_save_t test_msg{}; - - EXPECT_EQ(send_message( 57506, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(57506, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 57506); - EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 57506); + EXPECT_EQ(last_msg_, test_msg); } diff --git a/c/test/cpp/auto_check_sbp_settings_MsgSettingsWrite.cc b/c/test/cpp/auto_check_sbp_settings_MsgSettingsWrite.cc index 3f954241d..04abf3a08 100644 --- a/c/test/cpp/auto_check_sbp_settings_MsgSettingsWrite.cc +++ b/c/test/cpp/auto_check_sbp_settings_MsgSettingsWrite.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWrite.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWrite.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_settings_MsgSettingsWrite0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_settings_MsgSettingsWrite0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_settings_MsgSettingsWrite0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_settings_MsgSettingsWrite0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_settings_write_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_settings_write_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,40 +67,49 @@ class Test_auto_check_sbp_settings_MsgSettingsWrite0 : sbp_msg_settings_write_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_settings_MsgSettingsWrite0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_settings_MsgSettingsWrite0, Test) { + uint8_t encoded_frame[] = { + 85, 160, 0, 123, 0, 40, 115, 101, 99, 116, 105, 111, + 110, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, + 110, 103, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, + 105, 110, 103, 45, 118, 97, 108, 117, 101, 0, 244, 10, + }; + + sbp_msg_settings_write_t test_msg{}; + + EXPECT_TRUE( + sbp_msg_settings_write_setting_add_section(&test_msg, "section-name")); + EXPECT_TRUE( + sbp_msg_settings_write_setting_add_section(&test_msg, "setting-name")); + EXPECT_TRUE( + sbp_msg_settings_write_setting_add_section(&test_msg, "setting-value")); + EXPECT_EQ(sbp_msg_settings_write_setting_encoded_len(&test_msg), 40); - uint8_t encoded_frame[] = {85,160,0,123,0,40,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,244,10, }; + EXPECT_EQ(send_message(123, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_settings_write_t test_msg{}; - - EXPECT_TRUE(sbp_msg_settings_write_setting_add_section(&test_msg, "section-name")); - EXPECT_TRUE(sbp_msg_settings_write_setting_add_section(&test_msg, "setting-name")); - EXPECT_TRUE(sbp_msg_settings_write_setting_add_section(&test_msg, "setting-value")); - EXPECT_EQ(sbp_msg_settings_write_setting_encoded_len(&test_msg), 40); - - EXPECT_EQ(send_message( 123, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_settings_write_setting_encoded_len(&last_msg_), 40); - EXPECT_STREQ(sbp_msg_settings_write_setting_get_section(&last_msg_, 0), "section-name"); - EXPECT_STREQ(sbp_msg_settings_write_setting_get_section(&last_msg_, 1), "setting-name"); - EXPECT_STREQ(sbp_msg_settings_write_setting_get_section(&last_msg_, 2), "setting-value"); + EXPECT_EQ(sbp_msg_settings_write_setting_encoded_len(&last_msg_), 40); + EXPECT_STREQ(sbp_msg_settings_write_setting_get_section(&last_msg_, 0), + "section-name"); + EXPECT_STREQ(sbp_msg_settings_write_setting_get_section(&last_msg_, 1), + "setting-name"); + EXPECT_STREQ(sbp_msg_settings_write_setting_get_section(&last_msg_, 2), + "setting-value"); } diff --git a/c/test/cpp/auto_check_sbp_settings_MsgSettingsWriteResp.cc b/c/test/cpp/auto_check_sbp_settings_MsgSettingsWriteResp.cc index 19b16511a..ee0a23469 100644 --- a/c/test/cpp/auto_check_sbp_settings_MsgSettingsWriteResp.cc +++ b/c/test/cpp/auto_check_sbp_settings_MsgSettingsWriteResp.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWriteResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWriteResp.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_settings_MsgSettingsWriteResp0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_settings_MsgSettingsWriteResp0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_settings_MsgSettingsWriteResp0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_settings_MsgSettingsWriteResp0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_settings_write_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_settings_write_resp_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,44 +67,58 @@ class Test_auto_check_sbp_settings_MsgSettingsWriteResp0 : sbp_msg_settings_write_resp_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_settings_MsgSettingsWriteResp0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_settings_MsgSettingsWriteResp0, Test) { + uint8_t encoded_frame[] = { + 85, 175, 0, 91, 55, 67, 152, 115, 101, 99, 116, 105, 111, 110, 45, + 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 110, 97, + 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 118, 97, 108, 117, + 101, 0, 101, 110, 117, 109, 59, 118, 97, 108, 117, 101, 49, 44, 118, + 97, 108, 117, 101, 50, 44, 118, 97, 108, 117, 101, 51, 0, 54, 0, + }; + + sbp_msg_settings_write_resp_t test_msg{}; + + EXPECT_TRUE(sbp_msg_settings_write_resp_setting_add_section(&test_msg, + "section-name")); + EXPECT_TRUE(sbp_msg_settings_write_resp_setting_add_section(&test_msg, + "setting-name")); + EXPECT_TRUE(sbp_msg_settings_write_resp_setting_add_section(&test_msg, + "setting-value")); + EXPECT_TRUE(sbp_msg_settings_write_resp_setting_add_section( + &test_msg, "enum;value1,value2,value3")); + EXPECT_EQ(sbp_msg_settings_write_resp_setting_encoded_len(&test_msg), 66); + test_msg.status = 152; - uint8_t encoded_frame[] = {85,175,0,91,55,67,152,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,54,0, }; + EXPECT_EQ(send_message(14171, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_settings_write_resp_t test_msg{}; - - EXPECT_TRUE(sbp_msg_settings_write_resp_setting_add_section(&test_msg, "section-name")); - EXPECT_TRUE(sbp_msg_settings_write_resp_setting_add_section(&test_msg, "setting-name")); - EXPECT_TRUE(sbp_msg_settings_write_resp_setting_add_section(&test_msg, "setting-value")); - EXPECT_TRUE(sbp_msg_settings_write_resp_setting_add_section(&test_msg, "enum;value1,value2,value3")); - EXPECT_EQ(sbp_msg_settings_write_resp_setting_encoded_len(&test_msg), 66); - test_msg.status = 152; - - EXPECT_EQ(send_message( 14171, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 14171); + EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 14171); - EXPECT_EQ(last_msg_, test_msg); - - EXPECT_EQ(sbp_msg_settings_write_resp_setting_encoded_len(&last_msg_), 66); - EXPECT_STREQ(sbp_msg_settings_write_resp_setting_get_section(&last_msg_, 0), "section-name"); - EXPECT_STREQ(sbp_msg_settings_write_resp_setting_get_section(&last_msg_, 1), "setting-name"); - EXPECT_STREQ(sbp_msg_settings_write_resp_setting_get_section(&last_msg_, 2), "setting-value"); - EXPECT_STREQ(sbp_msg_settings_write_resp_setting_get_section(&last_msg_, 3), "enum;value1,value2,value3"); - EXPECT_EQ(last_msg_.status, 152) << "incorrect value for last_msg_.status, expected 152, is " << last_msg_.status; + EXPECT_EQ(sbp_msg_settings_write_resp_setting_encoded_len(&last_msg_), 66); + EXPECT_STREQ(sbp_msg_settings_write_resp_setting_get_section(&last_msg_, 0), + "section-name"); + EXPECT_STREQ(sbp_msg_settings_write_resp_setting_get_section(&last_msg_, 1), + "setting-name"); + EXPECT_STREQ(sbp_msg_settings_write_resp_setting_get_section(&last_msg_, 2), + "setting-value"); + EXPECT_STREQ(sbp_msg_settings_write_resp_setting_get_section(&last_msg_, 3), + "enum;value1,value2,value3"); + EXPECT_EQ(last_msg_.status, 152) + << "incorrect value for last_msg_.status, expected 152, is " + << last_msg_.status; } diff --git a/c/test/cpp/auto_check_sbp_signing_MsgCertificateChain.cc b/c/test/cpp/auto_check_sbp_signing_MsgCertificateChain.cc index 127fe5937..0c11ddad0 100644 --- a/c/test/cpp/auto_check_sbp_signing_MsgCertificateChain.cc +++ b/c/test/cpp/auto_check_sbp_signing_MsgCertificateChain.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChain.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChain.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_signing_MsgCertificateChain0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_signing_MsgCertificateChain0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_signing_MsgCertificateChain0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_signing_MsgCertificateChain0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_certificate_chain_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_certificate_chain_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,442 +67,770 @@ class Test_auto_check_sbp_signing_MsgCertificateChain0 : sbp_msg_certificate_chain_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_signing_MsgCertificateChain0, Test) -{ - - uint8_t encoded_frame[] = {85,9,12,66,0,144,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,20,21,22,23,24,25,26,27,28,29,10,11,12,13,14,15,16,17,18,19,232,7,3,30,12,34,59,21,205,91,7,72,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,227,224, }; - - sbp_msg_certificate_chain_t test_msg{}; - - test_msg.corrections_certificate[0] = 20; - - test_msg.corrections_certificate[1] = 21; - - test_msg.corrections_certificate[2] = 22; - - test_msg.corrections_certificate[3] = 23; - - test_msg.corrections_certificate[4] = 24; - - test_msg.corrections_certificate[5] = 25; - - test_msg.corrections_certificate[6] = 26; - - test_msg.corrections_certificate[7] = 27; - - test_msg.corrections_certificate[8] = 28; - - test_msg.corrections_certificate[9] = 29; - - test_msg.corrections_certificate[10] = 10; - - test_msg.corrections_certificate[11] = 11; - - test_msg.corrections_certificate[12] = 12; - - test_msg.corrections_certificate[13] = 13; - - test_msg.corrections_certificate[14] = 14; - - test_msg.corrections_certificate[15] = 15; - - test_msg.corrections_certificate[16] = 16; - - test_msg.corrections_certificate[17] = 17; - - test_msg.corrections_certificate[18] = 18; - - test_msg.corrections_certificate[19] = 19; - test_msg.expiration.day = 30; - test_msg.expiration.hours = 12; - test_msg.expiration.minutes = 34; - test_msg.expiration.month = 3; - test_msg.expiration.ns = 123456789; - test_msg.expiration.seconds = 59; - test_msg.expiration.year = 2024; - - test_msg.intermediate_certificate[0] = 10; - - test_msg.intermediate_certificate[1] = 11; - - test_msg.intermediate_certificate[2] = 12; - - test_msg.intermediate_certificate[3] = 13; - - test_msg.intermediate_certificate[4] = 14; - - test_msg.intermediate_certificate[5] = 15; - - test_msg.intermediate_certificate[6] = 16; - - test_msg.intermediate_certificate[7] = 17; - - test_msg.intermediate_certificate[8] = 18; - - test_msg.intermediate_certificate[9] = 19; - - test_msg.intermediate_certificate[10] = 0; - - test_msg.intermediate_certificate[11] = 1; - - test_msg.intermediate_certificate[12] = 2; - - test_msg.intermediate_certificate[13] = 3; - - test_msg.intermediate_certificate[14] = 4; - - test_msg.intermediate_certificate[15] = 5; - - test_msg.intermediate_certificate[16] = 6; - - test_msg.intermediate_certificate[17] = 7; - - test_msg.intermediate_certificate[18] = 8; - - test_msg.intermediate_certificate[19] = 9; - - test_msg.root_certificate[0] = 0; - - test_msg.root_certificate[1] = 1; - - test_msg.root_certificate[2] = 2; - - test_msg.root_certificate[3] = 3; - - test_msg.root_certificate[4] = 4; - - test_msg.root_certificate[5] = 5; - - test_msg.root_certificate[6] = 6; - - test_msg.root_certificate[7] = 7; - - test_msg.root_certificate[8] = 8; - - test_msg.root_certificate[9] = 9; - - test_msg.root_certificate[10] = 10; - - test_msg.root_certificate[11] = 11; - - test_msg.root_certificate[12] = 12; - - test_msg.root_certificate[13] = 13; - - test_msg.root_certificate[14] = 14; - - test_msg.root_certificate[15] = 15; - - test_msg.root_certificate[16] = 16; - - test_msg.root_certificate[17] = 17; - - test_msg.root_certificate[18] = 18; - - test_msg.root_certificate[19] = 19; - - test_msg.signature.data[0] = 0; - - test_msg.signature.data[1] = 1; - - test_msg.signature.data[2] = 2; - - test_msg.signature.data[3] = 3; - - test_msg.signature.data[4] = 4; - - test_msg.signature.data[5] = 5; - - test_msg.signature.data[6] = 6; - - test_msg.signature.data[7] = 7; - - test_msg.signature.data[8] = 8; - - test_msg.signature.data[9] = 9; - - test_msg.signature.data[10] = 10; - - test_msg.signature.data[11] = 11; - - test_msg.signature.data[12] = 12; - - test_msg.signature.data[13] = 13; - - test_msg.signature.data[14] = 14; - - test_msg.signature.data[15] = 15; - - test_msg.signature.data[16] = 16; - - test_msg.signature.data[17] = 17; - - test_msg.signature.data[18] = 18; - - test_msg.signature.data[19] = 19; - - test_msg.signature.data[20] = 20; - - test_msg.signature.data[21] = 21; - - test_msg.signature.data[22] = 22; - - test_msg.signature.data[23] = 23; - - test_msg.signature.data[24] = 24; - - test_msg.signature.data[25] = 25; - - test_msg.signature.data[26] = 26; - - test_msg.signature.data[27] = 27; - - test_msg.signature.data[28] = 28; - - test_msg.signature.data[29] = 29; - - test_msg.signature.data[30] = 30; - - test_msg.signature.data[31] = 31; - - test_msg.signature.data[32] = 32; - - test_msg.signature.data[33] = 33; - - test_msg.signature.data[34] = 34; - - test_msg.signature.data[35] = 35; - - test_msg.signature.data[36] = 36; - - test_msg.signature.data[37] = 37; - - test_msg.signature.data[38] = 38; - - test_msg.signature.data[39] = 39; - - test_msg.signature.data[40] = 40; - - test_msg.signature.data[41] = 41; - - test_msg.signature.data[42] = 42; - - test_msg.signature.data[43] = 43; - - test_msg.signature.data[44] = 44; - - test_msg.signature.data[45] = 45; - - test_msg.signature.data[46] = 46; - - test_msg.signature.data[47] = 47; - - test_msg.signature.data[48] = 48; - - test_msg.signature.data[49] = 49; - - test_msg.signature.data[50] = 50; - - test_msg.signature.data[51] = 51; - - test_msg.signature.data[52] = 52; - - test_msg.signature.data[53] = 53; - - test_msg.signature.data[54] = 54; - - test_msg.signature.data[55] = 55; - - test_msg.signature.data[56] = 56; - - test_msg.signature.data[57] = 57; - - test_msg.signature.data[58] = 58; - - test_msg.signature.data[59] = 59; - - test_msg.signature.data[60] = 60; - - test_msg.signature.data[61] = 61; - - test_msg.signature.data[62] = 62; - - test_msg.signature.data[63] = 63; - - test_msg.signature.data[64] = 64; - - test_msg.signature.data[65] = 65; - - test_msg.signature.data[66] = 66; - - test_msg.signature.data[67] = 67; - - test_msg.signature.data[68] = 68; - - test_msg.signature.data[69] = 69; - - test_msg.signature.data[70] = 70; - - test_msg.signature.data[71] = 71; - test_msg.signature.len = 72; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.corrections_certificate[0], 20) << "incorrect value for last_msg_.corrections_certificate[0], expected 20, is " << last_msg_.corrections_certificate[0]; - EXPECT_EQ(last_msg_.corrections_certificate[1], 21) << "incorrect value for last_msg_.corrections_certificate[1], expected 21, is " << last_msg_.corrections_certificate[1]; - EXPECT_EQ(last_msg_.corrections_certificate[2], 22) << "incorrect value for last_msg_.corrections_certificate[2], expected 22, is " << last_msg_.corrections_certificate[2]; - EXPECT_EQ(last_msg_.corrections_certificate[3], 23) << "incorrect value for last_msg_.corrections_certificate[3], expected 23, is " << last_msg_.corrections_certificate[3]; - EXPECT_EQ(last_msg_.corrections_certificate[4], 24) << "incorrect value for last_msg_.corrections_certificate[4], expected 24, is " << last_msg_.corrections_certificate[4]; - EXPECT_EQ(last_msg_.corrections_certificate[5], 25) << "incorrect value for last_msg_.corrections_certificate[5], expected 25, is " << last_msg_.corrections_certificate[5]; - EXPECT_EQ(last_msg_.corrections_certificate[6], 26) << "incorrect value for last_msg_.corrections_certificate[6], expected 26, is " << last_msg_.corrections_certificate[6]; - EXPECT_EQ(last_msg_.corrections_certificate[7], 27) << "incorrect value for last_msg_.corrections_certificate[7], expected 27, is " << last_msg_.corrections_certificate[7]; - EXPECT_EQ(last_msg_.corrections_certificate[8], 28) << "incorrect value for last_msg_.corrections_certificate[8], expected 28, is " << last_msg_.corrections_certificate[8]; - EXPECT_EQ(last_msg_.corrections_certificate[9], 29) << "incorrect value for last_msg_.corrections_certificate[9], expected 29, is " << last_msg_.corrections_certificate[9]; - EXPECT_EQ(last_msg_.corrections_certificate[10], 10) << "incorrect value for last_msg_.corrections_certificate[10], expected 10, is " << last_msg_.corrections_certificate[10]; - EXPECT_EQ(last_msg_.corrections_certificate[11], 11) << "incorrect value for last_msg_.corrections_certificate[11], expected 11, is " << last_msg_.corrections_certificate[11]; - EXPECT_EQ(last_msg_.corrections_certificate[12], 12) << "incorrect value for last_msg_.corrections_certificate[12], expected 12, is " << last_msg_.corrections_certificate[12]; - EXPECT_EQ(last_msg_.corrections_certificate[13], 13) << "incorrect value for last_msg_.corrections_certificate[13], expected 13, is " << last_msg_.corrections_certificate[13]; - EXPECT_EQ(last_msg_.corrections_certificate[14], 14) << "incorrect value for last_msg_.corrections_certificate[14], expected 14, is " << last_msg_.corrections_certificate[14]; - EXPECT_EQ(last_msg_.corrections_certificate[15], 15) << "incorrect value for last_msg_.corrections_certificate[15], expected 15, is " << last_msg_.corrections_certificate[15]; - EXPECT_EQ(last_msg_.corrections_certificate[16], 16) << "incorrect value for last_msg_.corrections_certificate[16], expected 16, is " << last_msg_.corrections_certificate[16]; - EXPECT_EQ(last_msg_.corrections_certificate[17], 17) << "incorrect value for last_msg_.corrections_certificate[17], expected 17, is " << last_msg_.corrections_certificate[17]; - EXPECT_EQ(last_msg_.corrections_certificate[18], 18) << "incorrect value for last_msg_.corrections_certificate[18], expected 18, is " << last_msg_.corrections_certificate[18]; - EXPECT_EQ(last_msg_.corrections_certificate[19], 19) << "incorrect value for last_msg_.corrections_certificate[19], expected 19, is " << last_msg_.corrections_certificate[19]; - EXPECT_EQ(last_msg_.expiration.day, 30) << "incorrect value for last_msg_.expiration.day, expected 30, is " << last_msg_.expiration.day; - EXPECT_EQ(last_msg_.expiration.hours, 12) << "incorrect value for last_msg_.expiration.hours, expected 12, is " << last_msg_.expiration.hours; - EXPECT_EQ(last_msg_.expiration.minutes, 34) << "incorrect value for last_msg_.expiration.minutes, expected 34, is " << last_msg_.expiration.minutes; - EXPECT_EQ(last_msg_.expiration.month, 3) << "incorrect value for last_msg_.expiration.month, expected 3, is " << last_msg_.expiration.month; - EXPECT_EQ(last_msg_.expiration.ns, 123456789) << "incorrect value for last_msg_.expiration.ns, expected 123456789, is " << last_msg_.expiration.ns; - EXPECT_EQ(last_msg_.expiration.seconds, 59) << "incorrect value for last_msg_.expiration.seconds, expected 59, is " << last_msg_.expiration.seconds; - EXPECT_EQ(last_msg_.expiration.year, 2024) << "incorrect value for last_msg_.expiration.year, expected 2024, is " << last_msg_.expiration.year; - EXPECT_EQ(last_msg_.intermediate_certificate[0], 10) << "incorrect value for last_msg_.intermediate_certificate[0], expected 10, is " << last_msg_.intermediate_certificate[0]; - EXPECT_EQ(last_msg_.intermediate_certificate[1], 11) << "incorrect value for last_msg_.intermediate_certificate[1], expected 11, is " << last_msg_.intermediate_certificate[1]; - EXPECT_EQ(last_msg_.intermediate_certificate[2], 12) << "incorrect value for last_msg_.intermediate_certificate[2], expected 12, is " << last_msg_.intermediate_certificate[2]; - EXPECT_EQ(last_msg_.intermediate_certificate[3], 13) << "incorrect value for last_msg_.intermediate_certificate[3], expected 13, is " << last_msg_.intermediate_certificate[3]; - EXPECT_EQ(last_msg_.intermediate_certificate[4], 14) << "incorrect value for last_msg_.intermediate_certificate[4], expected 14, is " << last_msg_.intermediate_certificate[4]; - EXPECT_EQ(last_msg_.intermediate_certificate[5], 15) << "incorrect value for last_msg_.intermediate_certificate[5], expected 15, is " << last_msg_.intermediate_certificate[5]; - EXPECT_EQ(last_msg_.intermediate_certificate[6], 16) << "incorrect value for last_msg_.intermediate_certificate[6], expected 16, is " << last_msg_.intermediate_certificate[6]; - EXPECT_EQ(last_msg_.intermediate_certificate[7], 17) << "incorrect value for last_msg_.intermediate_certificate[7], expected 17, is " << last_msg_.intermediate_certificate[7]; - EXPECT_EQ(last_msg_.intermediate_certificate[8], 18) << "incorrect value for last_msg_.intermediate_certificate[8], expected 18, is " << last_msg_.intermediate_certificate[8]; - EXPECT_EQ(last_msg_.intermediate_certificate[9], 19) << "incorrect value for last_msg_.intermediate_certificate[9], expected 19, is " << last_msg_.intermediate_certificate[9]; - EXPECT_EQ(last_msg_.intermediate_certificate[10], 0) << "incorrect value for last_msg_.intermediate_certificate[10], expected 0, is " << last_msg_.intermediate_certificate[10]; - EXPECT_EQ(last_msg_.intermediate_certificate[11], 1) << "incorrect value for last_msg_.intermediate_certificate[11], expected 1, is " << last_msg_.intermediate_certificate[11]; - EXPECT_EQ(last_msg_.intermediate_certificate[12], 2) << "incorrect value for last_msg_.intermediate_certificate[12], expected 2, is " << last_msg_.intermediate_certificate[12]; - EXPECT_EQ(last_msg_.intermediate_certificate[13], 3) << "incorrect value for last_msg_.intermediate_certificate[13], expected 3, is " << last_msg_.intermediate_certificate[13]; - EXPECT_EQ(last_msg_.intermediate_certificate[14], 4) << "incorrect value for last_msg_.intermediate_certificate[14], expected 4, is " << last_msg_.intermediate_certificate[14]; - EXPECT_EQ(last_msg_.intermediate_certificate[15], 5) << "incorrect value for last_msg_.intermediate_certificate[15], expected 5, is " << last_msg_.intermediate_certificate[15]; - EXPECT_EQ(last_msg_.intermediate_certificate[16], 6) << "incorrect value for last_msg_.intermediate_certificate[16], expected 6, is " << last_msg_.intermediate_certificate[16]; - EXPECT_EQ(last_msg_.intermediate_certificate[17], 7) << "incorrect value for last_msg_.intermediate_certificate[17], expected 7, is " << last_msg_.intermediate_certificate[17]; - EXPECT_EQ(last_msg_.intermediate_certificate[18], 8) << "incorrect value for last_msg_.intermediate_certificate[18], expected 8, is " << last_msg_.intermediate_certificate[18]; - EXPECT_EQ(last_msg_.intermediate_certificate[19], 9) << "incorrect value for last_msg_.intermediate_certificate[19], expected 9, is " << last_msg_.intermediate_certificate[19]; - EXPECT_EQ(last_msg_.root_certificate[0], 0) << "incorrect value for last_msg_.root_certificate[0], expected 0, is " << last_msg_.root_certificate[0]; - EXPECT_EQ(last_msg_.root_certificate[1], 1) << "incorrect value for last_msg_.root_certificate[1], expected 1, is " << last_msg_.root_certificate[1]; - EXPECT_EQ(last_msg_.root_certificate[2], 2) << "incorrect value for last_msg_.root_certificate[2], expected 2, is " << last_msg_.root_certificate[2]; - EXPECT_EQ(last_msg_.root_certificate[3], 3) << "incorrect value for last_msg_.root_certificate[3], expected 3, is " << last_msg_.root_certificate[3]; - EXPECT_EQ(last_msg_.root_certificate[4], 4) << "incorrect value for last_msg_.root_certificate[4], expected 4, is " << last_msg_.root_certificate[4]; - EXPECT_EQ(last_msg_.root_certificate[5], 5) << "incorrect value for last_msg_.root_certificate[5], expected 5, is " << last_msg_.root_certificate[5]; - EXPECT_EQ(last_msg_.root_certificate[6], 6) << "incorrect value for last_msg_.root_certificate[6], expected 6, is " << last_msg_.root_certificate[6]; - EXPECT_EQ(last_msg_.root_certificate[7], 7) << "incorrect value for last_msg_.root_certificate[7], expected 7, is " << last_msg_.root_certificate[7]; - EXPECT_EQ(last_msg_.root_certificate[8], 8) << "incorrect value for last_msg_.root_certificate[8], expected 8, is " << last_msg_.root_certificate[8]; - EXPECT_EQ(last_msg_.root_certificate[9], 9) << "incorrect value for last_msg_.root_certificate[9], expected 9, is " << last_msg_.root_certificate[9]; - EXPECT_EQ(last_msg_.root_certificate[10], 10) << "incorrect value for last_msg_.root_certificate[10], expected 10, is " << last_msg_.root_certificate[10]; - EXPECT_EQ(last_msg_.root_certificate[11], 11) << "incorrect value for last_msg_.root_certificate[11], expected 11, is " << last_msg_.root_certificate[11]; - EXPECT_EQ(last_msg_.root_certificate[12], 12) << "incorrect value for last_msg_.root_certificate[12], expected 12, is " << last_msg_.root_certificate[12]; - EXPECT_EQ(last_msg_.root_certificate[13], 13) << "incorrect value for last_msg_.root_certificate[13], expected 13, is " << last_msg_.root_certificate[13]; - EXPECT_EQ(last_msg_.root_certificate[14], 14) << "incorrect value for last_msg_.root_certificate[14], expected 14, is " << last_msg_.root_certificate[14]; - EXPECT_EQ(last_msg_.root_certificate[15], 15) << "incorrect value for last_msg_.root_certificate[15], expected 15, is " << last_msg_.root_certificate[15]; - EXPECT_EQ(last_msg_.root_certificate[16], 16) << "incorrect value for last_msg_.root_certificate[16], expected 16, is " << last_msg_.root_certificate[16]; - EXPECT_EQ(last_msg_.root_certificate[17], 17) << "incorrect value for last_msg_.root_certificate[17], expected 17, is " << last_msg_.root_certificate[17]; - EXPECT_EQ(last_msg_.root_certificate[18], 18) << "incorrect value for last_msg_.root_certificate[18], expected 18, is " << last_msg_.root_certificate[18]; - EXPECT_EQ(last_msg_.root_certificate[19], 19) << "incorrect value for last_msg_.root_certificate[19], expected 19, is " << last_msg_.root_certificate[19]; - EXPECT_EQ(last_msg_.signature.data[0], 0) << "incorrect value for last_msg_.signature.data[0], expected 0, is " << last_msg_.signature.data[0]; - EXPECT_EQ(last_msg_.signature.data[1], 1) << "incorrect value for last_msg_.signature.data[1], expected 1, is " << last_msg_.signature.data[1]; - EXPECT_EQ(last_msg_.signature.data[2], 2) << "incorrect value for last_msg_.signature.data[2], expected 2, is " << last_msg_.signature.data[2]; - EXPECT_EQ(last_msg_.signature.data[3], 3) << "incorrect value for last_msg_.signature.data[3], expected 3, is " << last_msg_.signature.data[3]; - EXPECT_EQ(last_msg_.signature.data[4], 4) << "incorrect value for last_msg_.signature.data[4], expected 4, is " << last_msg_.signature.data[4]; - EXPECT_EQ(last_msg_.signature.data[5], 5) << "incorrect value for last_msg_.signature.data[5], expected 5, is " << last_msg_.signature.data[5]; - EXPECT_EQ(last_msg_.signature.data[6], 6) << "incorrect value for last_msg_.signature.data[6], expected 6, is " << last_msg_.signature.data[6]; - EXPECT_EQ(last_msg_.signature.data[7], 7) << "incorrect value for last_msg_.signature.data[7], expected 7, is " << last_msg_.signature.data[7]; - EXPECT_EQ(last_msg_.signature.data[8], 8) << "incorrect value for last_msg_.signature.data[8], expected 8, is " << last_msg_.signature.data[8]; - EXPECT_EQ(last_msg_.signature.data[9], 9) << "incorrect value for last_msg_.signature.data[9], expected 9, is " << last_msg_.signature.data[9]; - EXPECT_EQ(last_msg_.signature.data[10], 10) << "incorrect value for last_msg_.signature.data[10], expected 10, is " << last_msg_.signature.data[10]; - EXPECT_EQ(last_msg_.signature.data[11], 11) << "incorrect value for last_msg_.signature.data[11], expected 11, is " << last_msg_.signature.data[11]; - EXPECT_EQ(last_msg_.signature.data[12], 12) << "incorrect value for last_msg_.signature.data[12], expected 12, is " << last_msg_.signature.data[12]; - EXPECT_EQ(last_msg_.signature.data[13], 13) << "incorrect value for last_msg_.signature.data[13], expected 13, is " << last_msg_.signature.data[13]; - EXPECT_EQ(last_msg_.signature.data[14], 14) << "incorrect value for last_msg_.signature.data[14], expected 14, is " << last_msg_.signature.data[14]; - EXPECT_EQ(last_msg_.signature.data[15], 15) << "incorrect value for last_msg_.signature.data[15], expected 15, is " << last_msg_.signature.data[15]; - EXPECT_EQ(last_msg_.signature.data[16], 16) << "incorrect value for last_msg_.signature.data[16], expected 16, is " << last_msg_.signature.data[16]; - EXPECT_EQ(last_msg_.signature.data[17], 17) << "incorrect value for last_msg_.signature.data[17], expected 17, is " << last_msg_.signature.data[17]; - EXPECT_EQ(last_msg_.signature.data[18], 18) << "incorrect value for last_msg_.signature.data[18], expected 18, is " << last_msg_.signature.data[18]; - EXPECT_EQ(last_msg_.signature.data[19], 19) << "incorrect value for last_msg_.signature.data[19], expected 19, is " << last_msg_.signature.data[19]; - EXPECT_EQ(last_msg_.signature.data[20], 20) << "incorrect value for last_msg_.signature.data[20], expected 20, is " << last_msg_.signature.data[20]; - EXPECT_EQ(last_msg_.signature.data[21], 21) << "incorrect value for last_msg_.signature.data[21], expected 21, is " << last_msg_.signature.data[21]; - EXPECT_EQ(last_msg_.signature.data[22], 22) << "incorrect value for last_msg_.signature.data[22], expected 22, is " << last_msg_.signature.data[22]; - EXPECT_EQ(last_msg_.signature.data[23], 23) << "incorrect value for last_msg_.signature.data[23], expected 23, is " << last_msg_.signature.data[23]; - EXPECT_EQ(last_msg_.signature.data[24], 24) << "incorrect value for last_msg_.signature.data[24], expected 24, is " << last_msg_.signature.data[24]; - EXPECT_EQ(last_msg_.signature.data[25], 25) << "incorrect value for last_msg_.signature.data[25], expected 25, is " << last_msg_.signature.data[25]; - EXPECT_EQ(last_msg_.signature.data[26], 26) << "incorrect value for last_msg_.signature.data[26], expected 26, is " << last_msg_.signature.data[26]; - EXPECT_EQ(last_msg_.signature.data[27], 27) << "incorrect value for last_msg_.signature.data[27], expected 27, is " << last_msg_.signature.data[27]; - EXPECT_EQ(last_msg_.signature.data[28], 28) << "incorrect value for last_msg_.signature.data[28], expected 28, is " << last_msg_.signature.data[28]; - EXPECT_EQ(last_msg_.signature.data[29], 29) << "incorrect value for last_msg_.signature.data[29], expected 29, is " << last_msg_.signature.data[29]; - EXPECT_EQ(last_msg_.signature.data[30], 30) << "incorrect value for last_msg_.signature.data[30], expected 30, is " << last_msg_.signature.data[30]; - EXPECT_EQ(last_msg_.signature.data[31], 31) << "incorrect value for last_msg_.signature.data[31], expected 31, is " << last_msg_.signature.data[31]; - EXPECT_EQ(last_msg_.signature.data[32], 32) << "incorrect value for last_msg_.signature.data[32], expected 32, is " << last_msg_.signature.data[32]; - EXPECT_EQ(last_msg_.signature.data[33], 33) << "incorrect value for last_msg_.signature.data[33], expected 33, is " << last_msg_.signature.data[33]; - EXPECT_EQ(last_msg_.signature.data[34], 34) << "incorrect value for last_msg_.signature.data[34], expected 34, is " << last_msg_.signature.data[34]; - EXPECT_EQ(last_msg_.signature.data[35], 35) << "incorrect value for last_msg_.signature.data[35], expected 35, is " << last_msg_.signature.data[35]; - EXPECT_EQ(last_msg_.signature.data[36], 36) << "incorrect value for last_msg_.signature.data[36], expected 36, is " << last_msg_.signature.data[36]; - EXPECT_EQ(last_msg_.signature.data[37], 37) << "incorrect value for last_msg_.signature.data[37], expected 37, is " << last_msg_.signature.data[37]; - EXPECT_EQ(last_msg_.signature.data[38], 38) << "incorrect value for last_msg_.signature.data[38], expected 38, is " << last_msg_.signature.data[38]; - EXPECT_EQ(last_msg_.signature.data[39], 39) << "incorrect value for last_msg_.signature.data[39], expected 39, is " << last_msg_.signature.data[39]; - EXPECT_EQ(last_msg_.signature.data[40], 40) << "incorrect value for last_msg_.signature.data[40], expected 40, is " << last_msg_.signature.data[40]; - EXPECT_EQ(last_msg_.signature.data[41], 41) << "incorrect value for last_msg_.signature.data[41], expected 41, is " << last_msg_.signature.data[41]; - EXPECT_EQ(last_msg_.signature.data[42], 42) << "incorrect value for last_msg_.signature.data[42], expected 42, is " << last_msg_.signature.data[42]; - EXPECT_EQ(last_msg_.signature.data[43], 43) << "incorrect value for last_msg_.signature.data[43], expected 43, is " << last_msg_.signature.data[43]; - EXPECT_EQ(last_msg_.signature.data[44], 44) << "incorrect value for last_msg_.signature.data[44], expected 44, is " << last_msg_.signature.data[44]; - EXPECT_EQ(last_msg_.signature.data[45], 45) << "incorrect value for last_msg_.signature.data[45], expected 45, is " << last_msg_.signature.data[45]; - EXPECT_EQ(last_msg_.signature.data[46], 46) << "incorrect value for last_msg_.signature.data[46], expected 46, is " << last_msg_.signature.data[46]; - EXPECT_EQ(last_msg_.signature.data[47], 47) << "incorrect value for last_msg_.signature.data[47], expected 47, is " << last_msg_.signature.data[47]; - EXPECT_EQ(last_msg_.signature.data[48], 48) << "incorrect value for last_msg_.signature.data[48], expected 48, is " << last_msg_.signature.data[48]; - EXPECT_EQ(last_msg_.signature.data[49], 49) << "incorrect value for last_msg_.signature.data[49], expected 49, is " << last_msg_.signature.data[49]; - EXPECT_EQ(last_msg_.signature.data[50], 50) << "incorrect value for last_msg_.signature.data[50], expected 50, is " << last_msg_.signature.data[50]; - EXPECT_EQ(last_msg_.signature.data[51], 51) << "incorrect value for last_msg_.signature.data[51], expected 51, is " << last_msg_.signature.data[51]; - EXPECT_EQ(last_msg_.signature.data[52], 52) << "incorrect value for last_msg_.signature.data[52], expected 52, is " << last_msg_.signature.data[52]; - EXPECT_EQ(last_msg_.signature.data[53], 53) << "incorrect value for last_msg_.signature.data[53], expected 53, is " << last_msg_.signature.data[53]; - EXPECT_EQ(last_msg_.signature.data[54], 54) << "incorrect value for last_msg_.signature.data[54], expected 54, is " << last_msg_.signature.data[54]; - EXPECT_EQ(last_msg_.signature.data[55], 55) << "incorrect value for last_msg_.signature.data[55], expected 55, is " << last_msg_.signature.data[55]; - EXPECT_EQ(last_msg_.signature.data[56], 56) << "incorrect value for last_msg_.signature.data[56], expected 56, is " << last_msg_.signature.data[56]; - EXPECT_EQ(last_msg_.signature.data[57], 57) << "incorrect value for last_msg_.signature.data[57], expected 57, is " << last_msg_.signature.data[57]; - EXPECT_EQ(last_msg_.signature.data[58], 58) << "incorrect value for last_msg_.signature.data[58], expected 58, is " << last_msg_.signature.data[58]; - EXPECT_EQ(last_msg_.signature.data[59], 59) << "incorrect value for last_msg_.signature.data[59], expected 59, is " << last_msg_.signature.data[59]; - EXPECT_EQ(last_msg_.signature.data[60], 60) << "incorrect value for last_msg_.signature.data[60], expected 60, is " << last_msg_.signature.data[60]; - EXPECT_EQ(last_msg_.signature.data[61], 61) << "incorrect value for last_msg_.signature.data[61], expected 61, is " << last_msg_.signature.data[61]; - EXPECT_EQ(last_msg_.signature.data[62], 62) << "incorrect value for last_msg_.signature.data[62], expected 62, is " << last_msg_.signature.data[62]; - EXPECT_EQ(last_msg_.signature.data[63], 63) << "incorrect value for last_msg_.signature.data[63], expected 63, is " << last_msg_.signature.data[63]; - EXPECT_EQ(last_msg_.signature.data[64], 64) << "incorrect value for last_msg_.signature.data[64], expected 64, is " << last_msg_.signature.data[64]; - EXPECT_EQ(last_msg_.signature.data[65], 65) << "incorrect value for last_msg_.signature.data[65], expected 65, is " << last_msg_.signature.data[65]; - EXPECT_EQ(last_msg_.signature.data[66], 66) << "incorrect value for last_msg_.signature.data[66], expected 66, is " << last_msg_.signature.data[66]; - EXPECT_EQ(last_msg_.signature.data[67], 67) << "incorrect value for last_msg_.signature.data[67], expected 67, is " << last_msg_.signature.data[67]; - EXPECT_EQ(last_msg_.signature.data[68], 68) << "incorrect value for last_msg_.signature.data[68], expected 68, is " << last_msg_.signature.data[68]; - EXPECT_EQ(last_msg_.signature.data[69], 69) << "incorrect value for last_msg_.signature.data[69], expected 69, is " << last_msg_.signature.data[69]; - EXPECT_EQ(last_msg_.signature.data[70], 70) << "incorrect value for last_msg_.signature.data[70], expected 70, is " << last_msg_.signature.data[70]; - EXPECT_EQ(last_msg_.signature.data[71], 71) << "incorrect value for last_msg_.signature.data[71], expected 71, is " << last_msg_.signature.data[71]; - EXPECT_EQ(last_msg_.signature.len, 72) << "incorrect value for last_msg_.signature.len, expected 72, is " << last_msg_.signature.len; +}; + +TEST_F(Test_auto_check_sbp_signing_MsgCertificateChain0, Test) { + uint8_t encoded_frame[] = { + 85, 9, 12, 66, 0, 144, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 232, 7, + 3, 30, 12, 34, 59, 21, 205, 91, 7, 72, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 227, 224, + }; + + sbp_msg_certificate_chain_t test_msg{}; + + test_msg.corrections_certificate[0] = 20; + + test_msg.corrections_certificate[1] = 21; + + test_msg.corrections_certificate[2] = 22; + + test_msg.corrections_certificate[3] = 23; + + test_msg.corrections_certificate[4] = 24; + + test_msg.corrections_certificate[5] = 25; + + test_msg.corrections_certificate[6] = 26; + + test_msg.corrections_certificate[7] = 27; + + test_msg.corrections_certificate[8] = 28; + + test_msg.corrections_certificate[9] = 29; + + test_msg.corrections_certificate[10] = 10; + + test_msg.corrections_certificate[11] = 11; + + test_msg.corrections_certificate[12] = 12; + + test_msg.corrections_certificate[13] = 13; + + test_msg.corrections_certificate[14] = 14; + + test_msg.corrections_certificate[15] = 15; + + test_msg.corrections_certificate[16] = 16; + + test_msg.corrections_certificate[17] = 17; + + test_msg.corrections_certificate[18] = 18; + + test_msg.corrections_certificate[19] = 19; + test_msg.expiration.day = 30; + test_msg.expiration.hours = 12; + test_msg.expiration.minutes = 34; + test_msg.expiration.month = 3; + test_msg.expiration.ns = 123456789; + test_msg.expiration.seconds = 59; + test_msg.expiration.year = 2024; + + test_msg.intermediate_certificate[0] = 10; + + test_msg.intermediate_certificate[1] = 11; + + test_msg.intermediate_certificate[2] = 12; + + test_msg.intermediate_certificate[3] = 13; + + test_msg.intermediate_certificate[4] = 14; + + test_msg.intermediate_certificate[5] = 15; + + test_msg.intermediate_certificate[6] = 16; + + test_msg.intermediate_certificate[7] = 17; + + test_msg.intermediate_certificate[8] = 18; + + test_msg.intermediate_certificate[9] = 19; + + test_msg.intermediate_certificate[10] = 0; + + test_msg.intermediate_certificate[11] = 1; + + test_msg.intermediate_certificate[12] = 2; + + test_msg.intermediate_certificate[13] = 3; + + test_msg.intermediate_certificate[14] = 4; + + test_msg.intermediate_certificate[15] = 5; + + test_msg.intermediate_certificate[16] = 6; + + test_msg.intermediate_certificate[17] = 7; + + test_msg.intermediate_certificate[18] = 8; + + test_msg.intermediate_certificate[19] = 9; + + test_msg.root_certificate[0] = 0; + + test_msg.root_certificate[1] = 1; + + test_msg.root_certificate[2] = 2; + + test_msg.root_certificate[3] = 3; + + test_msg.root_certificate[4] = 4; + + test_msg.root_certificate[5] = 5; + + test_msg.root_certificate[6] = 6; + + test_msg.root_certificate[7] = 7; + + test_msg.root_certificate[8] = 8; + + test_msg.root_certificate[9] = 9; + + test_msg.root_certificate[10] = 10; + + test_msg.root_certificate[11] = 11; + + test_msg.root_certificate[12] = 12; + + test_msg.root_certificate[13] = 13; + + test_msg.root_certificate[14] = 14; + + test_msg.root_certificate[15] = 15; + + test_msg.root_certificate[16] = 16; + + test_msg.root_certificate[17] = 17; + + test_msg.root_certificate[18] = 18; + + test_msg.root_certificate[19] = 19; + + test_msg.signature.data[0] = 0; + + test_msg.signature.data[1] = 1; + + test_msg.signature.data[2] = 2; + + test_msg.signature.data[3] = 3; + + test_msg.signature.data[4] = 4; + + test_msg.signature.data[5] = 5; + + test_msg.signature.data[6] = 6; + + test_msg.signature.data[7] = 7; + + test_msg.signature.data[8] = 8; + + test_msg.signature.data[9] = 9; + + test_msg.signature.data[10] = 10; + + test_msg.signature.data[11] = 11; + + test_msg.signature.data[12] = 12; + + test_msg.signature.data[13] = 13; + + test_msg.signature.data[14] = 14; + + test_msg.signature.data[15] = 15; + + test_msg.signature.data[16] = 16; + + test_msg.signature.data[17] = 17; + + test_msg.signature.data[18] = 18; + + test_msg.signature.data[19] = 19; + + test_msg.signature.data[20] = 20; + + test_msg.signature.data[21] = 21; + + test_msg.signature.data[22] = 22; + + test_msg.signature.data[23] = 23; + + test_msg.signature.data[24] = 24; + + test_msg.signature.data[25] = 25; + + test_msg.signature.data[26] = 26; + + test_msg.signature.data[27] = 27; + + test_msg.signature.data[28] = 28; + + test_msg.signature.data[29] = 29; + + test_msg.signature.data[30] = 30; + + test_msg.signature.data[31] = 31; + + test_msg.signature.data[32] = 32; + + test_msg.signature.data[33] = 33; + + test_msg.signature.data[34] = 34; + + test_msg.signature.data[35] = 35; + + test_msg.signature.data[36] = 36; + + test_msg.signature.data[37] = 37; + + test_msg.signature.data[38] = 38; + + test_msg.signature.data[39] = 39; + + test_msg.signature.data[40] = 40; + + test_msg.signature.data[41] = 41; + + test_msg.signature.data[42] = 42; + + test_msg.signature.data[43] = 43; + + test_msg.signature.data[44] = 44; + + test_msg.signature.data[45] = 45; + + test_msg.signature.data[46] = 46; + + test_msg.signature.data[47] = 47; + + test_msg.signature.data[48] = 48; + + test_msg.signature.data[49] = 49; + + test_msg.signature.data[50] = 50; + + test_msg.signature.data[51] = 51; + + test_msg.signature.data[52] = 52; + + test_msg.signature.data[53] = 53; + + test_msg.signature.data[54] = 54; + + test_msg.signature.data[55] = 55; + + test_msg.signature.data[56] = 56; + + test_msg.signature.data[57] = 57; + + test_msg.signature.data[58] = 58; + + test_msg.signature.data[59] = 59; + + test_msg.signature.data[60] = 60; + + test_msg.signature.data[61] = 61; + + test_msg.signature.data[62] = 62; + + test_msg.signature.data[63] = 63; + + test_msg.signature.data[64] = 64; + + test_msg.signature.data[65] = 65; + + test_msg.signature.data[66] = 66; + + test_msg.signature.data[67] = 67; + + test_msg.signature.data[68] = 68; + + test_msg.signature.data[69] = 69; + + test_msg.signature.data[70] = 70; + + test_msg.signature.data[71] = 71; + test_msg.signature.len = 72; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.corrections_certificate[0], 20) + << "incorrect value for last_msg_.corrections_certificate[0], expected " + "20, is " + << last_msg_.corrections_certificate[0]; + EXPECT_EQ(last_msg_.corrections_certificate[1], 21) + << "incorrect value for last_msg_.corrections_certificate[1], expected " + "21, is " + << last_msg_.corrections_certificate[1]; + EXPECT_EQ(last_msg_.corrections_certificate[2], 22) + << "incorrect value for last_msg_.corrections_certificate[2], expected " + "22, is " + << last_msg_.corrections_certificate[2]; + EXPECT_EQ(last_msg_.corrections_certificate[3], 23) + << "incorrect value for last_msg_.corrections_certificate[3], expected " + "23, is " + << last_msg_.corrections_certificate[3]; + EXPECT_EQ(last_msg_.corrections_certificate[4], 24) + << "incorrect value for last_msg_.corrections_certificate[4], expected " + "24, is " + << last_msg_.corrections_certificate[4]; + EXPECT_EQ(last_msg_.corrections_certificate[5], 25) + << "incorrect value for last_msg_.corrections_certificate[5], expected " + "25, is " + << last_msg_.corrections_certificate[5]; + EXPECT_EQ(last_msg_.corrections_certificate[6], 26) + << "incorrect value for last_msg_.corrections_certificate[6], expected " + "26, is " + << last_msg_.corrections_certificate[6]; + EXPECT_EQ(last_msg_.corrections_certificate[7], 27) + << "incorrect value for last_msg_.corrections_certificate[7], expected " + "27, is " + << last_msg_.corrections_certificate[7]; + EXPECT_EQ(last_msg_.corrections_certificate[8], 28) + << "incorrect value for last_msg_.corrections_certificate[8], expected " + "28, is " + << last_msg_.corrections_certificate[8]; + EXPECT_EQ(last_msg_.corrections_certificate[9], 29) + << "incorrect value for last_msg_.corrections_certificate[9], expected " + "29, is " + << last_msg_.corrections_certificate[9]; + EXPECT_EQ(last_msg_.corrections_certificate[10], 10) + << "incorrect value for last_msg_.corrections_certificate[10], expected " + "10, is " + << last_msg_.corrections_certificate[10]; + EXPECT_EQ(last_msg_.corrections_certificate[11], 11) + << "incorrect value for last_msg_.corrections_certificate[11], expected " + "11, is " + << last_msg_.corrections_certificate[11]; + EXPECT_EQ(last_msg_.corrections_certificate[12], 12) + << "incorrect value for last_msg_.corrections_certificate[12], expected " + "12, is " + << last_msg_.corrections_certificate[12]; + EXPECT_EQ(last_msg_.corrections_certificate[13], 13) + << "incorrect value for last_msg_.corrections_certificate[13], expected " + "13, is " + << last_msg_.corrections_certificate[13]; + EXPECT_EQ(last_msg_.corrections_certificate[14], 14) + << "incorrect value for last_msg_.corrections_certificate[14], expected " + "14, is " + << last_msg_.corrections_certificate[14]; + EXPECT_EQ(last_msg_.corrections_certificate[15], 15) + << "incorrect value for last_msg_.corrections_certificate[15], expected " + "15, is " + << last_msg_.corrections_certificate[15]; + EXPECT_EQ(last_msg_.corrections_certificate[16], 16) + << "incorrect value for last_msg_.corrections_certificate[16], expected " + "16, is " + << last_msg_.corrections_certificate[16]; + EXPECT_EQ(last_msg_.corrections_certificate[17], 17) + << "incorrect value for last_msg_.corrections_certificate[17], expected " + "17, is " + << last_msg_.corrections_certificate[17]; + EXPECT_EQ(last_msg_.corrections_certificate[18], 18) + << "incorrect value for last_msg_.corrections_certificate[18], expected " + "18, is " + << last_msg_.corrections_certificate[18]; + EXPECT_EQ(last_msg_.corrections_certificate[19], 19) + << "incorrect value for last_msg_.corrections_certificate[19], expected " + "19, is " + << last_msg_.corrections_certificate[19]; + EXPECT_EQ(last_msg_.expiration.day, 30) + << "incorrect value for last_msg_.expiration.day, expected 30, is " + << last_msg_.expiration.day; + EXPECT_EQ(last_msg_.expiration.hours, 12) + << "incorrect value for last_msg_.expiration.hours, expected 12, is " + << last_msg_.expiration.hours; + EXPECT_EQ(last_msg_.expiration.minutes, 34) + << "incorrect value for last_msg_.expiration.minutes, expected 34, is " + << last_msg_.expiration.minutes; + EXPECT_EQ(last_msg_.expiration.month, 3) + << "incorrect value for last_msg_.expiration.month, expected 3, is " + << last_msg_.expiration.month; + EXPECT_EQ(last_msg_.expiration.ns, 123456789) + << "incorrect value for last_msg_.expiration.ns, expected 123456789, is " + << last_msg_.expiration.ns; + EXPECT_EQ(last_msg_.expiration.seconds, 59) + << "incorrect value for last_msg_.expiration.seconds, expected 59, is " + << last_msg_.expiration.seconds; + EXPECT_EQ(last_msg_.expiration.year, 2024) + << "incorrect value for last_msg_.expiration.year, expected 2024, is " + << last_msg_.expiration.year; + EXPECT_EQ(last_msg_.intermediate_certificate[0], 10) + << "incorrect value for last_msg_.intermediate_certificate[0], expected " + "10, is " + << last_msg_.intermediate_certificate[0]; + EXPECT_EQ(last_msg_.intermediate_certificate[1], 11) + << "incorrect value for last_msg_.intermediate_certificate[1], expected " + "11, is " + << last_msg_.intermediate_certificate[1]; + EXPECT_EQ(last_msg_.intermediate_certificate[2], 12) + << "incorrect value for last_msg_.intermediate_certificate[2], expected " + "12, is " + << last_msg_.intermediate_certificate[2]; + EXPECT_EQ(last_msg_.intermediate_certificate[3], 13) + << "incorrect value for last_msg_.intermediate_certificate[3], expected " + "13, is " + << last_msg_.intermediate_certificate[3]; + EXPECT_EQ(last_msg_.intermediate_certificate[4], 14) + << "incorrect value for last_msg_.intermediate_certificate[4], expected " + "14, is " + << last_msg_.intermediate_certificate[4]; + EXPECT_EQ(last_msg_.intermediate_certificate[5], 15) + << "incorrect value for last_msg_.intermediate_certificate[5], expected " + "15, is " + << last_msg_.intermediate_certificate[5]; + EXPECT_EQ(last_msg_.intermediate_certificate[6], 16) + << "incorrect value for last_msg_.intermediate_certificate[6], expected " + "16, is " + << last_msg_.intermediate_certificate[6]; + EXPECT_EQ(last_msg_.intermediate_certificate[7], 17) + << "incorrect value for last_msg_.intermediate_certificate[7], expected " + "17, is " + << last_msg_.intermediate_certificate[7]; + EXPECT_EQ(last_msg_.intermediate_certificate[8], 18) + << "incorrect value for last_msg_.intermediate_certificate[8], expected " + "18, is " + << last_msg_.intermediate_certificate[8]; + EXPECT_EQ(last_msg_.intermediate_certificate[9], 19) + << "incorrect value for last_msg_.intermediate_certificate[9], expected " + "19, is " + << last_msg_.intermediate_certificate[9]; + EXPECT_EQ(last_msg_.intermediate_certificate[10], 0) + << "incorrect value for last_msg_.intermediate_certificate[10], expected " + "0, is " + << last_msg_.intermediate_certificate[10]; + EXPECT_EQ(last_msg_.intermediate_certificate[11], 1) + << "incorrect value for last_msg_.intermediate_certificate[11], expected " + "1, is " + << last_msg_.intermediate_certificate[11]; + EXPECT_EQ(last_msg_.intermediate_certificate[12], 2) + << "incorrect value for last_msg_.intermediate_certificate[12], expected " + "2, is " + << last_msg_.intermediate_certificate[12]; + EXPECT_EQ(last_msg_.intermediate_certificate[13], 3) + << "incorrect value for last_msg_.intermediate_certificate[13], expected " + "3, is " + << last_msg_.intermediate_certificate[13]; + EXPECT_EQ(last_msg_.intermediate_certificate[14], 4) + << "incorrect value for last_msg_.intermediate_certificate[14], expected " + "4, is " + << last_msg_.intermediate_certificate[14]; + EXPECT_EQ(last_msg_.intermediate_certificate[15], 5) + << "incorrect value for last_msg_.intermediate_certificate[15], expected " + "5, is " + << last_msg_.intermediate_certificate[15]; + EXPECT_EQ(last_msg_.intermediate_certificate[16], 6) + << "incorrect value for last_msg_.intermediate_certificate[16], expected " + "6, is " + << last_msg_.intermediate_certificate[16]; + EXPECT_EQ(last_msg_.intermediate_certificate[17], 7) + << "incorrect value for last_msg_.intermediate_certificate[17], expected " + "7, is " + << last_msg_.intermediate_certificate[17]; + EXPECT_EQ(last_msg_.intermediate_certificate[18], 8) + << "incorrect value for last_msg_.intermediate_certificate[18], expected " + "8, is " + << last_msg_.intermediate_certificate[18]; + EXPECT_EQ(last_msg_.intermediate_certificate[19], 9) + << "incorrect value for last_msg_.intermediate_certificate[19], expected " + "9, is " + << last_msg_.intermediate_certificate[19]; + EXPECT_EQ(last_msg_.root_certificate[0], 0) + << "incorrect value for last_msg_.root_certificate[0], expected 0, is " + << last_msg_.root_certificate[0]; + EXPECT_EQ(last_msg_.root_certificate[1], 1) + << "incorrect value for last_msg_.root_certificate[1], expected 1, is " + << last_msg_.root_certificate[1]; + EXPECT_EQ(last_msg_.root_certificate[2], 2) + << "incorrect value for last_msg_.root_certificate[2], expected 2, is " + << last_msg_.root_certificate[2]; + EXPECT_EQ(last_msg_.root_certificate[3], 3) + << "incorrect value for last_msg_.root_certificate[3], expected 3, is " + << last_msg_.root_certificate[3]; + EXPECT_EQ(last_msg_.root_certificate[4], 4) + << "incorrect value for last_msg_.root_certificate[4], expected 4, is " + << last_msg_.root_certificate[4]; + EXPECT_EQ(last_msg_.root_certificate[5], 5) + << "incorrect value for last_msg_.root_certificate[5], expected 5, is " + << last_msg_.root_certificate[5]; + EXPECT_EQ(last_msg_.root_certificate[6], 6) + << "incorrect value for last_msg_.root_certificate[6], expected 6, is " + << last_msg_.root_certificate[6]; + EXPECT_EQ(last_msg_.root_certificate[7], 7) + << "incorrect value for last_msg_.root_certificate[7], expected 7, is " + << last_msg_.root_certificate[7]; + EXPECT_EQ(last_msg_.root_certificate[8], 8) + << "incorrect value for last_msg_.root_certificate[8], expected 8, is " + << last_msg_.root_certificate[8]; + EXPECT_EQ(last_msg_.root_certificate[9], 9) + << "incorrect value for last_msg_.root_certificate[9], expected 9, is " + << last_msg_.root_certificate[9]; + EXPECT_EQ(last_msg_.root_certificate[10], 10) + << "incorrect value for last_msg_.root_certificate[10], expected 10, is " + << last_msg_.root_certificate[10]; + EXPECT_EQ(last_msg_.root_certificate[11], 11) + << "incorrect value for last_msg_.root_certificate[11], expected 11, is " + << last_msg_.root_certificate[11]; + EXPECT_EQ(last_msg_.root_certificate[12], 12) + << "incorrect value for last_msg_.root_certificate[12], expected 12, is " + << last_msg_.root_certificate[12]; + EXPECT_EQ(last_msg_.root_certificate[13], 13) + << "incorrect value for last_msg_.root_certificate[13], expected 13, is " + << last_msg_.root_certificate[13]; + EXPECT_EQ(last_msg_.root_certificate[14], 14) + << "incorrect value for last_msg_.root_certificate[14], expected 14, is " + << last_msg_.root_certificate[14]; + EXPECT_EQ(last_msg_.root_certificate[15], 15) + << "incorrect value for last_msg_.root_certificate[15], expected 15, is " + << last_msg_.root_certificate[15]; + EXPECT_EQ(last_msg_.root_certificate[16], 16) + << "incorrect value for last_msg_.root_certificate[16], expected 16, is " + << last_msg_.root_certificate[16]; + EXPECT_EQ(last_msg_.root_certificate[17], 17) + << "incorrect value for last_msg_.root_certificate[17], expected 17, is " + << last_msg_.root_certificate[17]; + EXPECT_EQ(last_msg_.root_certificate[18], 18) + << "incorrect value for last_msg_.root_certificate[18], expected 18, is " + << last_msg_.root_certificate[18]; + EXPECT_EQ(last_msg_.root_certificate[19], 19) + << "incorrect value for last_msg_.root_certificate[19], expected 19, is " + << last_msg_.root_certificate[19]; + EXPECT_EQ(last_msg_.signature.data[0], 0) + << "incorrect value for last_msg_.signature.data[0], expected 0, is " + << last_msg_.signature.data[0]; + EXPECT_EQ(last_msg_.signature.data[1], 1) + << "incorrect value for last_msg_.signature.data[1], expected 1, is " + << last_msg_.signature.data[1]; + EXPECT_EQ(last_msg_.signature.data[2], 2) + << "incorrect value for last_msg_.signature.data[2], expected 2, is " + << last_msg_.signature.data[2]; + EXPECT_EQ(last_msg_.signature.data[3], 3) + << "incorrect value for last_msg_.signature.data[3], expected 3, is " + << last_msg_.signature.data[3]; + EXPECT_EQ(last_msg_.signature.data[4], 4) + << "incorrect value for last_msg_.signature.data[4], expected 4, is " + << last_msg_.signature.data[4]; + EXPECT_EQ(last_msg_.signature.data[5], 5) + << "incorrect value for last_msg_.signature.data[5], expected 5, is " + << last_msg_.signature.data[5]; + EXPECT_EQ(last_msg_.signature.data[6], 6) + << "incorrect value for last_msg_.signature.data[6], expected 6, is " + << last_msg_.signature.data[6]; + EXPECT_EQ(last_msg_.signature.data[7], 7) + << "incorrect value for last_msg_.signature.data[7], expected 7, is " + << last_msg_.signature.data[7]; + EXPECT_EQ(last_msg_.signature.data[8], 8) + << "incorrect value for last_msg_.signature.data[8], expected 8, is " + << last_msg_.signature.data[8]; + EXPECT_EQ(last_msg_.signature.data[9], 9) + << "incorrect value for last_msg_.signature.data[9], expected 9, is " + << last_msg_.signature.data[9]; + EXPECT_EQ(last_msg_.signature.data[10], 10) + << "incorrect value for last_msg_.signature.data[10], expected 10, is " + << last_msg_.signature.data[10]; + EXPECT_EQ(last_msg_.signature.data[11], 11) + << "incorrect value for last_msg_.signature.data[11], expected 11, is " + << last_msg_.signature.data[11]; + EXPECT_EQ(last_msg_.signature.data[12], 12) + << "incorrect value for last_msg_.signature.data[12], expected 12, is " + << last_msg_.signature.data[12]; + EXPECT_EQ(last_msg_.signature.data[13], 13) + << "incorrect value for last_msg_.signature.data[13], expected 13, is " + << last_msg_.signature.data[13]; + EXPECT_EQ(last_msg_.signature.data[14], 14) + << "incorrect value for last_msg_.signature.data[14], expected 14, is " + << last_msg_.signature.data[14]; + EXPECT_EQ(last_msg_.signature.data[15], 15) + << "incorrect value for last_msg_.signature.data[15], expected 15, is " + << last_msg_.signature.data[15]; + EXPECT_EQ(last_msg_.signature.data[16], 16) + << "incorrect value for last_msg_.signature.data[16], expected 16, is " + << last_msg_.signature.data[16]; + EXPECT_EQ(last_msg_.signature.data[17], 17) + << "incorrect value for last_msg_.signature.data[17], expected 17, is " + << last_msg_.signature.data[17]; + EXPECT_EQ(last_msg_.signature.data[18], 18) + << "incorrect value for last_msg_.signature.data[18], expected 18, is " + << last_msg_.signature.data[18]; + EXPECT_EQ(last_msg_.signature.data[19], 19) + << "incorrect value for last_msg_.signature.data[19], expected 19, is " + << last_msg_.signature.data[19]; + EXPECT_EQ(last_msg_.signature.data[20], 20) + << "incorrect value for last_msg_.signature.data[20], expected 20, is " + << last_msg_.signature.data[20]; + EXPECT_EQ(last_msg_.signature.data[21], 21) + << "incorrect value for last_msg_.signature.data[21], expected 21, is " + << last_msg_.signature.data[21]; + EXPECT_EQ(last_msg_.signature.data[22], 22) + << "incorrect value for last_msg_.signature.data[22], expected 22, is " + << last_msg_.signature.data[22]; + EXPECT_EQ(last_msg_.signature.data[23], 23) + << "incorrect value for last_msg_.signature.data[23], expected 23, is " + << last_msg_.signature.data[23]; + EXPECT_EQ(last_msg_.signature.data[24], 24) + << "incorrect value for last_msg_.signature.data[24], expected 24, is " + << last_msg_.signature.data[24]; + EXPECT_EQ(last_msg_.signature.data[25], 25) + << "incorrect value for last_msg_.signature.data[25], expected 25, is " + << last_msg_.signature.data[25]; + EXPECT_EQ(last_msg_.signature.data[26], 26) + << "incorrect value for last_msg_.signature.data[26], expected 26, is " + << last_msg_.signature.data[26]; + EXPECT_EQ(last_msg_.signature.data[27], 27) + << "incorrect value for last_msg_.signature.data[27], expected 27, is " + << last_msg_.signature.data[27]; + EXPECT_EQ(last_msg_.signature.data[28], 28) + << "incorrect value for last_msg_.signature.data[28], expected 28, is " + << last_msg_.signature.data[28]; + EXPECT_EQ(last_msg_.signature.data[29], 29) + << "incorrect value for last_msg_.signature.data[29], expected 29, is " + << last_msg_.signature.data[29]; + EXPECT_EQ(last_msg_.signature.data[30], 30) + << "incorrect value for last_msg_.signature.data[30], expected 30, is " + << last_msg_.signature.data[30]; + EXPECT_EQ(last_msg_.signature.data[31], 31) + << "incorrect value for last_msg_.signature.data[31], expected 31, is " + << last_msg_.signature.data[31]; + EXPECT_EQ(last_msg_.signature.data[32], 32) + << "incorrect value for last_msg_.signature.data[32], expected 32, is " + << last_msg_.signature.data[32]; + EXPECT_EQ(last_msg_.signature.data[33], 33) + << "incorrect value for last_msg_.signature.data[33], expected 33, is " + << last_msg_.signature.data[33]; + EXPECT_EQ(last_msg_.signature.data[34], 34) + << "incorrect value for last_msg_.signature.data[34], expected 34, is " + << last_msg_.signature.data[34]; + EXPECT_EQ(last_msg_.signature.data[35], 35) + << "incorrect value for last_msg_.signature.data[35], expected 35, is " + << last_msg_.signature.data[35]; + EXPECT_EQ(last_msg_.signature.data[36], 36) + << "incorrect value for last_msg_.signature.data[36], expected 36, is " + << last_msg_.signature.data[36]; + EXPECT_EQ(last_msg_.signature.data[37], 37) + << "incorrect value for last_msg_.signature.data[37], expected 37, is " + << last_msg_.signature.data[37]; + EXPECT_EQ(last_msg_.signature.data[38], 38) + << "incorrect value for last_msg_.signature.data[38], expected 38, is " + << last_msg_.signature.data[38]; + EXPECT_EQ(last_msg_.signature.data[39], 39) + << "incorrect value for last_msg_.signature.data[39], expected 39, is " + << last_msg_.signature.data[39]; + EXPECT_EQ(last_msg_.signature.data[40], 40) + << "incorrect value for last_msg_.signature.data[40], expected 40, is " + << last_msg_.signature.data[40]; + EXPECT_EQ(last_msg_.signature.data[41], 41) + << "incorrect value for last_msg_.signature.data[41], expected 41, is " + << last_msg_.signature.data[41]; + EXPECT_EQ(last_msg_.signature.data[42], 42) + << "incorrect value for last_msg_.signature.data[42], expected 42, is " + << last_msg_.signature.data[42]; + EXPECT_EQ(last_msg_.signature.data[43], 43) + << "incorrect value for last_msg_.signature.data[43], expected 43, is " + << last_msg_.signature.data[43]; + EXPECT_EQ(last_msg_.signature.data[44], 44) + << "incorrect value for last_msg_.signature.data[44], expected 44, is " + << last_msg_.signature.data[44]; + EXPECT_EQ(last_msg_.signature.data[45], 45) + << "incorrect value for last_msg_.signature.data[45], expected 45, is " + << last_msg_.signature.data[45]; + EXPECT_EQ(last_msg_.signature.data[46], 46) + << "incorrect value for last_msg_.signature.data[46], expected 46, is " + << last_msg_.signature.data[46]; + EXPECT_EQ(last_msg_.signature.data[47], 47) + << "incorrect value for last_msg_.signature.data[47], expected 47, is " + << last_msg_.signature.data[47]; + EXPECT_EQ(last_msg_.signature.data[48], 48) + << "incorrect value for last_msg_.signature.data[48], expected 48, is " + << last_msg_.signature.data[48]; + EXPECT_EQ(last_msg_.signature.data[49], 49) + << "incorrect value for last_msg_.signature.data[49], expected 49, is " + << last_msg_.signature.data[49]; + EXPECT_EQ(last_msg_.signature.data[50], 50) + << "incorrect value for last_msg_.signature.data[50], expected 50, is " + << last_msg_.signature.data[50]; + EXPECT_EQ(last_msg_.signature.data[51], 51) + << "incorrect value for last_msg_.signature.data[51], expected 51, is " + << last_msg_.signature.data[51]; + EXPECT_EQ(last_msg_.signature.data[52], 52) + << "incorrect value for last_msg_.signature.data[52], expected 52, is " + << last_msg_.signature.data[52]; + EXPECT_EQ(last_msg_.signature.data[53], 53) + << "incorrect value for last_msg_.signature.data[53], expected 53, is " + << last_msg_.signature.data[53]; + EXPECT_EQ(last_msg_.signature.data[54], 54) + << "incorrect value for last_msg_.signature.data[54], expected 54, is " + << last_msg_.signature.data[54]; + EXPECT_EQ(last_msg_.signature.data[55], 55) + << "incorrect value for last_msg_.signature.data[55], expected 55, is " + << last_msg_.signature.data[55]; + EXPECT_EQ(last_msg_.signature.data[56], 56) + << "incorrect value for last_msg_.signature.data[56], expected 56, is " + << last_msg_.signature.data[56]; + EXPECT_EQ(last_msg_.signature.data[57], 57) + << "incorrect value for last_msg_.signature.data[57], expected 57, is " + << last_msg_.signature.data[57]; + EXPECT_EQ(last_msg_.signature.data[58], 58) + << "incorrect value for last_msg_.signature.data[58], expected 58, is " + << last_msg_.signature.data[58]; + EXPECT_EQ(last_msg_.signature.data[59], 59) + << "incorrect value for last_msg_.signature.data[59], expected 59, is " + << last_msg_.signature.data[59]; + EXPECT_EQ(last_msg_.signature.data[60], 60) + << "incorrect value for last_msg_.signature.data[60], expected 60, is " + << last_msg_.signature.data[60]; + EXPECT_EQ(last_msg_.signature.data[61], 61) + << "incorrect value for last_msg_.signature.data[61], expected 61, is " + << last_msg_.signature.data[61]; + EXPECT_EQ(last_msg_.signature.data[62], 62) + << "incorrect value for last_msg_.signature.data[62], expected 62, is " + << last_msg_.signature.data[62]; + EXPECT_EQ(last_msg_.signature.data[63], 63) + << "incorrect value for last_msg_.signature.data[63], expected 63, is " + << last_msg_.signature.data[63]; + EXPECT_EQ(last_msg_.signature.data[64], 64) + << "incorrect value for last_msg_.signature.data[64], expected 64, is " + << last_msg_.signature.data[64]; + EXPECT_EQ(last_msg_.signature.data[65], 65) + << "incorrect value for last_msg_.signature.data[65], expected 65, is " + << last_msg_.signature.data[65]; + EXPECT_EQ(last_msg_.signature.data[66], 66) + << "incorrect value for last_msg_.signature.data[66], expected 66, is " + << last_msg_.signature.data[66]; + EXPECT_EQ(last_msg_.signature.data[67], 67) + << "incorrect value for last_msg_.signature.data[67], expected 67, is " + << last_msg_.signature.data[67]; + EXPECT_EQ(last_msg_.signature.data[68], 68) + << "incorrect value for last_msg_.signature.data[68], expected 68, is " + << last_msg_.signature.data[68]; + EXPECT_EQ(last_msg_.signature.data[69], 69) + << "incorrect value for last_msg_.signature.data[69], expected 69, is " + << last_msg_.signature.data[69]; + EXPECT_EQ(last_msg_.signature.data[70], 70) + << "incorrect value for last_msg_.signature.data[70], expected 70, is " + << last_msg_.signature.data[70]; + EXPECT_EQ(last_msg_.signature.data[71], 71) + << "incorrect value for last_msg_.signature.data[71], expected 71, is " + << last_msg_.signature.data[71]; + EXPECT_EQ(last_msg_.signature.len, 72) + << "incorrect value for last_msg_.signature.len, expected 72, is " + << last_msg_.signature.len; } diff --git a/c/test/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc b/c/test/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc index f84332d03..d35bc09da 100644 --- a/c/test/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc +++ b/c/test/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_signing_MsgCertificateChainDep0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_signing_MsgCertificateChainDep0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_signing_MsgCertificateChainDep0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_signing_MsgCertificateChainDep0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_certificate_chain_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_certificate_chain_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,416 +67,726 @@ class Test_auto_check_sbp_signing_MsgCertificateChainDep0 : sbp_msg_certificate_chain_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_signing_MsgCertificateChainDep0, Test) -{ - - uint8_t encoded_frame[] = {85,5,12,66,0,135,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,20,21,22,23,24,25,26,27,28,29,10,11,12,13,14,15,16,17,18,19,232,7,3,30,12,34,59,21,205,91,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,112,100, }; - - sbp_msg_certificate_chain_dep_t test_msg{}; - - test_msg.corrections_certificate[0] = 20; - - test_msg.corrections_certificate[1] = 21; - - test_msg.corrections_certificate[2] = 22; - - test_msg.corrections_certificate[3] = 23; - - test_msg.corrections_certificate[4] = 24; - - test_msg.corrections_certificate[5] = 25; - - test_msg.corrections_certificate[6] = 26; - - test_msg.corrections_certificate[7] = 27; - - test_msg.corrections_certificate[8] = 28; - - test_msg.corrections_certificate[9] = 29; - - test_msg.corrections_certificate[10] = 10; - - test_msg.corrections_certificate[11] = 11; - - test_msg.corrections_certificate[12] = 12; - - test_msg.corrections_certificate[13] = 13; - - test_msg.corrections_certificate[14] = 14; - - test_msg.corrections_certificate[15] = 15; - - test_msg.corrections_certificate[16] = 16; - - test_msg.corrections_certificate[17] = 17; - - test_msg.corrections_certificate[18] = 18; - - test_msg.corrections_certificate[19] = 19; - test_msg.expiration.day = 30; - test_msg.expiration.hours = 12; - test_msg.expiration.minutes = 34; - test_msg.expiration.month = 3; - test_msg.expiration.ns = 123456789; - test_msg.expiration.seconds = 59; - test_msg.expiration.year = 2024; - - test_msg.intermediate_certificate[0] = 10; - - test_msg.intermediate_certificate[1] = 11; - - test_msg.intermediate_certificate[2] = 12; - - test_msg.intermediate_certificate[3] = 13; - - test_msg.intermediate_certificate[4] = 14; - - test_msg.intermediate_certificate[5] = 15; - - test_msg.intermediate_certificate[6] = 16; - - test_msg.intermediate_certificate[7] = 17; - - test_msg.intermediate_certificate[8] = 18; - - test_msg.intermediate_certificate[9] = 19; - - test_msg.intermediate_certificate[10] = 0; - - test_msg.intermediate_certificate[11] = 1; - - test_msg.intermediate_certificate[12] = 2; - - test_msg.intermediate_certificate[13] = 3; - - test_msg.intermediate_certificate[14] = 4; - - test_msg.intermediate_certificate[15] = 5; - - test_msg.intermediate_certificate[16] = 6; - - test_msg.intermediate_certificate[17] = 7; - - test_msg.intermediate_certificate[18] = 8; - - test_msg.intermediate_certificate[19] = 9; - - test_msg.root_certificate[0] = 0; - - test_msg.root_certificate[1] = 1; - - test_msg.root_certificate[2] = 2; - - test_msg.root_certificate[3] = 3; - - test_msg.root_certificate[4] = 4; - - test_msg.root_certificate[5] = 5; - - test_msg.root_certificate[6] = 6; - - test_msg.root_certificate[7] = 7; - - test_msg.root_certificate[8] = 8; - - test_msg.root_certificate[9] = 9; - - test_msg.root_certificate[10] = 10; - - test_msg.root_certificate[11] = 11; - - test_msg.root_certificate[12] = 12; - - test_msg.root_certificate[13] = 13; - - test_msg.root_certificate[14] = 14; - - test_msg.root_certificate[15] = 15; - - test_msg.root_certificate[16] = 16; - - test_msg.root_certificate[17] = 17; - - test_msg.root_certificate[18] = 18; - - test_msg.root_certificate[19] = 19; - - test_msg.signature[0] = 0; - - test_msg.signature[1] = 1; - - test_msg.signature[2] = 2; - - test_msg.signature[3] = 3; - - test_msg.signature[4] = 4; - - test_msg.signature[5] = 5; - - test_msg.signature[6] = 6; - - test_msg.signature[7] = 7; - - test_msg.signature[8] = 0; - - test_msg.signature[9] = 1; - - test_msg.signature[10] = 2; - - test_msg.signature[11] = 3; - - test_msg.signature[12] = 4; - - test_msg.signature[13] = 5; - - test_msg.signature[14] = 6; - - test_msg.signature[15] = 7; - - test_msg.signature[16] = 0; - - test_msg.signature[17] = 1; - - test_msg.signature[18] = 2; - - test_msg.signature[19] = 3; - - test_msg.signature[20] = 4; - - test_msg.signature[21] = 5; - - test_msg.signature[22] = 6; - - test_msg.signature[23] = 7; - - test_msg.signature[24] = 0; - - test_msg.signature[25] = 1; - - test_msg.signature[26] = 2; - - test_msg.signature[27] = 3; - - test_msg.signature[28] = 4; - - test_msg.signature[29] = 5; - - test_msg.signature[30] = 6; - - test_msg.signature[31] = 7; - - test_msg.signature[32] = 0; - - test_msg.signature[33] = 1; - - test_msg.signature[34] = 2; - - test_msg.signature[35] = 3; - - test_msg.signature[36] = 4; - - test_msg.signature[37] = 5; - - test_msg.signature[38] = 6; - - test_msg.signature[39] = 7; - - test_msg.signature[40] = 0; - - test_msg.signature[41] = 1; - - test_msg.signature[42] = 2; - - test_msg.signature[43] = 3; - - test_msg.signature[44] = 4; - - test_msg.signature[45] = 5; - - test_msg.signature[46] = 6; - - test_msg.signature[47] = 7; - - test_msg.signature[48] = 0; - - test_msg.signature[49] = 1; - - test_msg.signature[50] = 2; - - test_msg.signature[51] = 3; - - test_msg.signature[52] = 4; - - test_msg.signature[53] = 5; - - test_msg.signature[54] = 6; - - test_msg.signature[55] = 7; - - test_msg.signature[56] = 0; - - test_msg.signature[57] = 1; - - test_msg.signature[58] = 2; - - test_msg.signature[59] = 3; - - test_msg.signature[60] = 4; - - test_msg.signature[61] = 5; - - test_msg.signature[62] = 6; - - test_msg.signature[63] = 7; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.corrections_certificate[0], 20) << "incorrect value for last_msg_.corrections_certificate[0], expected 20, is " << last_msg_.corrections_certificate[0]; - EXPECT_EQ(last_msg_.corrections_certificate[1], 21) << "incorrect value for last_msg_.corrections_certificate[1], expected 21, is " << last_msg_.corrections_certificate[1]; - EXPECT_EQ(last_msg_.corrections_certificate[2], 22) << "incorrect value for last_msg_.corrections_certificate[2], expected 22, is " << last_msg_.corrections_certificate[2]; - EXPECT_EQ(last_msg_.corrections_certificate[3], 23) << "incorrect value for last_msg_.corrections_certificate[3], expected 23, is " << last_msg_.corrections_certificate[3]; - EXPECT_EQ(last_msg_.corrections_certificate[4], 24) << "incorrect value for last_msg_.corrections_certificate[4], expected 24, is " << last_msg_.corrections_certificate[4]; - EXPECT_EQ(last_msg_.corrections_certificate[5], 25) << "incorrect value for last_msg_.corrections_certificate[5], expected 25, is " << last_msg_.corrections_certificate[5]; - EXPECT_EQ(last_msg_.corrections_certificate[6], 26) << "incorrect value for last_msg_.corrections_certificate[6], expected 26, is " << last_msg_.corrections_certificate[6]; - EXPECT_EQ(last_msg_.corrections_certificate[7], 27) << "incorrect value for last_msg_.corrections_certificate[7], expected 27, is " << last_msg_.corrections_certificate[7]; - EXPECT_EQ(last_msg_.corrections_certificate[8], 28) << "incorrect value for last_msg_.corrections_certificate[8], expected 28, is " << last_msg_.corrections_certificate[8]; - EXPECT_EQ(last_msg_.corrections_certificate[9], 29) << "incorrect value for last_msg_.corrections_certificate[9], expected 29, is " << last_msg_.corrections_certificate[9]; - EXPECT_EQ(last_msg_.corrections_certificate[10], 10) << "incorrect value for last_msg_.corrections_certificate[10], expected 10, is " << last_msg_.corrections_certificate[10]; - EXPECT_EQ(last_msg_.corrections_certificate[11], 11) << "incorrect value for last_msg_.corrections_certificate[11], expected 11, is " << last_msg_.corrections_certificate[11]; - EXPECT_EQ(last_msg_.corrections_certificate[12], 12) << "incorrect value for last_msg_.corrections_certificate[12], expected 12, is " << last_msg_.corrections_certificate[12]; - EXPECT_EQ(last_msg_.corrections_certificate[13], 13) << "incorrect value for last_msg_.corrections_certificate[13], expected 13, is " << last_msg_.corrections_certificate[13]; - EXPECT_EQ(last_msg_.corrections_certificate[14], 14) << "incorrect value for last_msg_.corrections_certificate[14], expected 14, is " << last_msg_.corrections_certificate[14]; - EXPECT_EQ(last_msg_.corrections_certificate[15], 15) << "incorrect value for last_msg_.corrections_certificate[15], expected 15, is " << last_msg_.corrections_certificate[15]; - EXPECT_EQ(last_msg_.corrections_certificate[16], 16) << "incorrect value for last_msg_.corrections_certificate[16], expected 16, is " << last_msg_.corrections_certificate[16]; - EXPECT_EQ(last_msg_.corrections_certificate[17], 17) << "incorrect value for last_msg_.corrections_certificate[17], expected 17, is " << last_msg_.corrections_certificate[17]; - EXPECT_EQ(last_msg_.corrections_certificate[18], 18) << "incorrect value for last_msg_.corrections_certificate[18], expected 18, is " << last_msg_.corrections_certificate[18]; - EXPECT_EQ(last_msg_.corrections_certificate[19], 19) << "incorrect value for last_msg_.corrections_certificate[19], expected 19, is " << last_msg_.corrections_certificate[19]; - EXPECT_EQ(last_msg_.expiration.day, 30) << "incorrect value for last_msg_.expiration.day, expected 30, is " << last_msg_.expiration.day; - EXPECT_EQ(last_msg_.expiration.hours, 12) << "incorrect value for last_msg_.expiration.hours, expected 12, is " << last_msg_.expiration.hours; - EXPECT_EQ(last_msg_.expiration.minutes, 34) << "incorrect value for last_msg_.expiration.minutes, expected 34, is " << last_msg_.expiration.minutes; - EXPECT_EQ(last_msg_.expiration.month, 3) << "incorrect value for last_msg_.expiration.month, expected 3, is " << last_msg_.expiration.month; - EXPECT_EQ(last_msg_.expiration.ns, 123456789) << "incorrect value for last_msg_.expiration.ns, expected 123456789, is " << last_msg_.expiration.ns; - EXPECT_EQ(last_msg_.expiration.seconds, 59) << "incorrect value for last_msg_.expiration.seconds, expected 59, is " << last_msg_.expiration.seconds; - EXPECT_EQ(last_msg_.expiration.year, 2024) << "incorrect value for last_msg_.expiration.year, expected 2024, is " << last_msg_.expiration.year; - EXPECT_EQ(last_msg_.intermediate_certificate[0], 10) << "incorrect value for last_msg_.intermediate_certificate[0], expected 10, is " << last_msg_.intermediate_certificate[0]; - EXPECT_EQ(last_msg_.intermediate_certificate[1], 11) << "incorrect value for last_msg_.intermediate_certificate[1], expected 11, is " << last_msg_.intermediate_certificate[1]; - EXPECT_EQ(last_msg_.intermediate_certificate[2], 12) << "incorrect value for last_msg_.intermediate_certificate[2], expected 12, is " << last_msg_.intermediate_certificate[2]; - EXPECT_EQ(last_msg_.intermediate_certificate[3], 13) << "incorrect value for last_msg_.intermediate_certificate[3], expected 13, is " << last_msg_.intermediate_certificate[3]; - EXPECT_EQ(last_msg_.intermediate_certificate[4], 14) << "incorrect value for last_msg_.intermediate_certificate[4], expected 14, is " << last_msg_.intermediate_certificate[4]; - EXPECT_EQ(last_msg_.intermediate_certificate[5], 15) << "incorrect value for last_msg_.intermediate_certificate[5], expected 15, is " << last_msg_.intermediate_certificate[5]; - EXPECT_EQ(last_msg_.intermediate_certificate[6], 16) << "incorrect value for last_msg_.intermediate_certificate[6], expected 16, is " << last_msg_.intermediate_certificate[6]; - EXPECT_EQ(last_msg_.intermediate_certificate[7], 17) << "incorrect value for last_msg_.intermediate_certificate[7], expected 17, is " << last_msg_.intermediate_certificate[7]; - EXPECT_EQ(last_msg_.intermediate_certificate[8], 18) << "incorrect value for last_msg_.intermediate_certificate[8], expected 18, is " << last_msg_.intermediate_certificate[8]; - EXPECT_EQ(last_msg_.intermediate_certificate[9], 19) << "incorrect value for last_msg_.intermediate_certificate[9], expected 19, is " << last_msg_.intermediate_certificate[9]; - EXPECT_EQ(last_msg_.intermediate_certificate[10], 0) << "incorrect value for last_msg_.intermediate_certificate[10], expected 0, is " << last_msg_.intermediate_certificate[10]; - EXPECT_EQ(last_msg_.intermediate_certificate[11], 1) << "incorrect value for last_msg_.intermediate_certificate[11], expected 1, is " << last_msg_.intermediate_certificate[11]; - EXPECT_EQ(last_msg_.intermediate_certificate[12], 2) << "incorrect value for last_msg_.intermediate_certificate[12], expected 2, is " << last_msg_.intermediate_certificate[12]; - EXPECT_EQ(last_msg_.intermediate_certificate[13], 3) << "incorrect value for last_msg_.intermediate_certificate[13], expected 3, is " << last_msg_.intermediate_certificate[13]; - EXPECT_EQ(last_msg_.intermediate_certificate[14], 4) << "incorrect value for last_msg_.intermediate_certificate[14], expected 4, is " << last_msg_.intermediate_certificate[14]; - EXPECT_EQ(last_msg_.intermediate_certificate[15], 5) << "incorrect value for last_msg_.intermediate_certificate[15], expected 5, is " << last_msg_.intermediate_certificate[15]; - EXPECT_EQ(last_msg_.intermediate_certificate[16], 6) << "incorrect value for last_msg_.intermediate_certificate[16], expected 6, is " << last_msg_.intermediate_certificate[16]; - EXPECT_EQ(last_msg_.intermediate_certificate[17], 7) << "incorrect value for last_msg_.intermediate_certificate[17], expected 7, is " << last_msg_.intermediate_certificate[17]; - EXPECT_EQ(last_msg_.intermediate_certificate[18], 8) << "incorrect value for last_msg_.intermediate_certificate[18], expected 8, is " << last_msg_.intermediate_certificate[18]; - EXPECT_EQ(last_msg_.intermediate_certificate[19], 9) << "incorrect value for last_msg_.intermediate_certificate[19], expected 9, is " << last_msg_.intermediate_certificate[19]; - EXPECT_EQ(last_msg_.root_certificate[0], 0) << "incorrect value for last_msg_.root_certificate[0], expected 0, is " << last_msg_.root_certificate[0]; - EXPECT_EQ(last_msg_.root_certificate[1], 1) << "incorrect value for last_msg_.root_certificate[1], expected 1, is " << last_msg_.root_certificate[1]; - EXPECT_EQ(last_msg_.root_certificate[2], 2) << "incorrect value for last_msg_.root_certificate[2], expected 2, is " << last_msg_.root_certificate[2]; - EXPECT_EQ(last_msg_.root_certificate[3], 3) << "incorrect value for last_msg_.root_certificate[3], expected 3, is " << last_msg_.root_certificate[3]; - EXPECT_EQ(last_msg_.root_certificate[4], 4) << "incorrect value for last_msg_.root_certificate[4], expected 4, is " << last_msg_.root_certificate[4]; - EXPECT_EQ(last_msg_.root_certificate[5], 5) << "incorrect value for last_msg_.root_certificate[5], expected 5, is " << last_msg_.root_certificate[5]; - EXPECT_EQ(last_msg_.root_certificate[6], 6) << "incorrect value for last_msg_.root_certificate[6], expected 6, is " << last_msg_.root_certificate[6]; - EXPECT_EQ(last_msg_.root_certificate[7], 7) << "incorrect value for last_msg_.root_certificate[7], expected 7, is " << last_msg_.root_certificate[7]; - EXPECT_EQ(last_msg_.root_certificate[8], 8) << "incorrect value for last_msg_.root_certificate[8], expected 8, is " << last_msg_.root_certificate[8]; - EXPECT_EQ(last_msg_.root_certificate[9], 9) << "incorrect value for last_msg_.root_certificate[9], expected 9, is " << last_msg_.root_certificate[9]; - EXPECT_EQ(last_msg_.root_certificate[10], 10) << "incorrect value for last_msg_.root_certificate[10], expected 10, is " << last_msg_.root_certificate[10]; - EXPECT_EQ(last_msg_.root_certificate[11], 11) << "incorrect value for last_msg_.root_certificate[11], expected 11, is " << last_msg_.root_certificate[11]; - EXPECT_EQ(last_msg_.root_certificate[12], 12) << "incorrect value for last_msg_.root_certificate[12], expected 12, is " << last_msg_.root_certificate[12]; - EXPECT_EQ(last_msg_.root_certificate[13], 13) << "incorrect value for last_msg_.root_certificate[13], expected 13, is " << last_msg_.root_certificate[13]; - EXPECT_EQ(last_msg_.root_certificate[14], 14) << "incorrect value for last_msg_.root_certificate[14], expected 14, is " << last_msg_.root_certificate[14]; - EXPECT_EQ(last_msg_.root_certificate[15], 15) << "incorrect value for last_msg_.root_certificate[15], expected 15, is " << last_msg_.root_certificate[15]; - EXPECT_EQ(last_msg_.root_certificate[16], 16) << "incorrect value for last_msg_.root_certificate[16], expected 16, is " << last_msg_.root_certificate[16]; - EXPECT_EQ(last_msg_.root_certificate[17], 17) << "incorrect value for last_msg_.root_certificate[17], expected 17, is " << last_msg_.root_certificate[17]; - EXPECT_EQ(last_msg_.root_certificate[18], 18) << "incorrect value for last_msg_.root_certificate[18], expected 18, is " << last_msg_.root_certificate[18]; - EXPECT_EQ(last_msg_.root_certificate[19], 19) << "incorrect value for last_msg_.root_certificate[19], expected 19, is " << last_msg_.root_certificate[19]; - EXPECT_EQ(last_msg_.signature[0], 0) << "incorrect value for last_msg_.signature[0], expected 0, is " << last_msg_.signature[0]; - EXPECT_EQ(last_msg_.signature[1], 1) << "incorrect value for last_msg_.signature[1], expected 1, is " << last_msg_.signature[1]; - EXPECT_EQ(last_msg_.signature[2], 2) << "incorrect value for last_msg_.signature[2], expected 2, is " << last_msg_.signature[2]; - EXPECT_EQ(last_msg_.signature[3], 3) << "incorrect value for last_msg_.signature[3], expected 3, is " << last_msg_.signature[3]; - EXPECT_EQ(last_msg_.signature[4], 4) << "incorrect value for last_msg_.signature[4], expected 4, is " << last_msg_.signature[4]; - EXPECT_EQ(last_msg_.signature[5], 5) << "incorrect value for last_msg_.signature[5], expected 5, is " << last_msg_.signature[5]; - EXPECT_EQ(last_msg_.signature[6], 6) << "incorrect value for last_msg_.signature[6], expected 6, is " << last_msg_.signature[6]; - EXPECT_EQ(last_msg_.signature[7], 7) << "incorrect value for last_msg_.signature[7], expected 7, is " << last_msg_.signature[7]; - EXPECT_EQ(last_msg_.signature[8], 0) << "incorrect value for last_msg_.signature[8], expected 0, is " << last_msg_.signature[8]; - EXPECT_EQ(last_msg_.signature[9], 1) << "incorrect value for last_msg_.signature[9], expected 1, is " << last_msg_.signature[9]; - EXPECT_EQ(last_msg_.signature[10], 2) << "incorrect value for last_msg_.signature[10], expected 2, is " << last_msg_.signature[10]; - EXPECT_EQ(last_msg_.signature[11], 3) << "incorrect value for last_msg_.signature[11], expected 3, is " << last_msg_.signature[11]; - EXPECT_EQ(last_msg_.signature[12], 4) << "incorrect value for last_msg_.signature[12], expected 4, is " << last_msg_.signature[12]; - EXPECT_EQ(last_msg_.signature[13], 5) << "incorrect value for last_msg_.signature[13], expected 5, is " << last_msg_.signature[13]; - EXPECT_EQ(last_msg_.signature[14], 6) << "incorrect value for last_msg_.signature[14], expected 6, is " << last_msg_.signature[14]; - EXPECT_EQ(last_msg_.signature[15], 7) << "incorrect value for last_msg_.signature[15], expected 7, is " << last_msg_.signature[15]; - EXPECT_EQ(last_msg_.signature[16], 0) << "incorrect value for last_msg_.signature[16], expected 0, is " << last_msg_.signature[16]; - EXPECT_EQ(last_msg_.signature[17], 1) << "incorrect value for last_msg_.signature[17], expected 1, is " << last_msg_.signature[17]; - EXPECT_EQ(last_msg_.signature[18], 2) << "incorrect value for last_msg_.signature[18], expected 2, is " << last_msg_.signature[18]; - EXPECT_EQ(last_msg_.signature[19], 3) << "incorrect value for last_msg_.signature[19], expected 3, is " << last_msg_.signature[19]; - EXPECT_EQ(last_msg_.signature[20], 4) << "incorrect value for last_msg_.signature[20], expected 4, is " << last_msg_.signature[20]; - EXPECT_EQ(last_msg_.signature[21], 5) << "incorrect value for last_msg_.signature[21], expected 5, is " << last_msg_.signature[21]; - EXPECT_EQ(last_msg_.signature[22], 6) << "incorrect value for last_msg_.signature[22], expected 6, is " << last_msg_.signature[22]; - EXPECT_EQ(last_msg_.signature[23], 7) << "incorrect value for last_msg_.signature[23], expected 7, is " << last_msg_.signature[23]; - EXPECT_EQ(last_msg_.signature[24], 0) << "incorrect value for last_msg_.signature[24], expected 0, is " << last_msg_.signature[24]; - EXPECT_EQ(last_msg_.signature[25], 1) << "incorrect value for last_msg_.signature[25], expected 1, is " << last_msg_.signature[25]; - EXPECT_EQ(last_msg_.signature[26], 2) << "incorrect value for last_msg_.signature[26], expected 2, is " << last_msg_.signature[26]; - EXPECT_EQ(last_msg_.signature[27], 3) << "incorrect value for last_msg_.signature[27], expected 3, is " << last_msg_.signature[27]; - EXPECT_EQ(last_msg_.signature[28], 4) << "incorrect value for last_msg_.signature[28], expected 4, is " << last_msg_.signature[28]; - EXPECT_EQ(last_msg_.signature[29], 5) << "incorrect value for last_msg_.signature[29], expected 5, is " << last_msg_.signature[29]; - EXPECT_EQ(last_msg_.signature[30], 6) << "incorrect value for last_msg_.signature[30], expected 6, is " << last_msg_.signature[30]; - EXPECT_EQ(last_msg_.signature[31], 7) << "incorrect value for last_msg_.signature[31], expected 7, is " << last_msg_.signature[31]; - EXPECT_EQ(last_msg_.signature[32], 0) << "incorrect value for last_msg_.signature[32], expected 0, is " << last_msg_.signature[32]; - EXPECT_EQ(last_msg_.signature[33], 1) << "incorrect value for last_msg_.signature[33], expected 1, is " << last_msg_.signature[33]; - EXPECT_EQ(last_msg_.signature[34], 2) << "incorrect value for last_msg_.signature[34], expected 2, is " << last_msg_.signature[34]; - EXPECT_EQ(last_msg_.signature[35], 3) << "incorrect value for last_msg_.signature[35], expected 3, is " << last_msg_.signature[35]; - EXPECT_EQ(last_msg_.signature[36], 4) << "incorrect value for last_msg_.signature[36], expected 4, is " << last_msg_.signature[36]; - EXPECT_EQ(last_msg_.signature[37], 5) << "incorrect value for last_msg_.signature[37], expected 5, is " << last_msg_.signature[37]; - EXPECT_EQ(last_msg_.signature[38], 6) << "incorrect value for last_msg_.signature[38], expected 6, is " << last_msg_.signature[38]; - EXPECT_EQ(last_msg_.signature[39], 7) << "incorrect value for last_msg_.signature[39], expected 7, is " << last_msg_.signature[39]; - EXPECT_EQ(last_msg_.signature[40], 0) << "incorrect value for last_msg_.signature[40], expected 0, is " << last_msg_.signature[40]; - EXPECT_EQ(last_msg_.signature[41], 1) << "incorrect value for last_msg_.signature[41], expected 1, is " << last_msg_.signature[41]; - EXPECT_EQ(last_msg_.signature[42], 2) << "incorrect value for last_msg_.signature[42], expected 2, is " << last_msg_.signature[42]; - EXPECT_EQ(last_msg_.signature[43], 3) << "incorrect value for last_msg_.signature[43], expected 3, is " << last_msg_.signature[43]; - EXPECT_EQ(last_msg_.signature[44], 4) << "incorrect value for last_msg_.signature[44], expected 4, is " << last_msg_.signature[44]; - EXPECT_EQ(last_msg_.signature[45], 5) << "incorrect value for last_msg_.signature[45], expected 5, is " << last_msg_.signature[45]; - EXPECT_EQ(last_msg_.signature[46], 6) << "incorrect value for last_msg_.signature[46], expected 6, is " << last_msg_.signature[46]; - EXPECT_EQ(last_msg_.signature[47], 7) << "incorrect value for last_msg_.signature[47], expected 7, is " << last_msg_.signature[47]; - EXPECT_EQ(last_msg_.signature[48], 0) << "incorrect value for last_msg_.signature[48], expected 0, is " << last_msg_.signature[48]; - EXPECT_EQ(last_msg_.signature[49], 1) << "incorrect value for last_msg_.signature[49], expected 1, is " << last_msg_.signature[49]; - EXPECT_EQ(last_msg_.signature[50], 2) << "incorrect value for last_msg_.signature[50], expected 2, is " << last_msg_.signature[50]; - EXPECT_EQ(last_msg_.signature[51], 3) << "incorrect value for last_msg_.signature[51], expected 3, is " << last_msg_.signature[51]; - EXPECT_EQ(last_msg_.signature[52], 4) << "incorrect value for last_msg_.signature[52], expected 4, is " << last_msg_.signature[52]; - EXPECT_EQ(last_msg_.signature[53], 5) << "incorrect value for last_msg_.signature[53], expected 5, is " << last_msg_.signature[53]; - EXPECT_EQ(last_msg_.signature[54], 6) << "incorrect value for last_msg_.signature[54], expected 6, is " << last_msg_.signature[54]; - EXPECT_EQ(last_msg_.signature[55], 7) << "incorrect value for last_msg_.signature[55], expected 7, is " << last_msg_.signature[55]; - EXPECT_EQ(last_msg_.signature[56], 0) << "incorrect value for last_msg_.signature[56], expected 0, is " << last_msg_.signature[56]; - EXPECT_EQ(last_msg_.signature[57], 1) << "incorrect value for last_msg_.signature[57], expected 1, is " << last_msg_.signature[57]; - EXPECT_EQ(last_msg_.signature[58], 2) << "incorrect value for last_msg_.signature[58], expected 2, is " << last_msg_.signature[58]; - EXPECT_EQ(last_msg_.signature[59], 3) << "incorrect value for last_msg_.signature[59], expected 3, is " << last_msg_.signature[59]; - EXPECT_EQ(last_msg_.signature[60], 4) << "incorrect value for last_msg_.signature[60], expected 4, is " << last_msg_.signature[60]; - EXPECT_EQ(last_msg_.signature[61], 5) << "incorrect value for last_msg_.signature[61], expected 5, is " << last_msg_.signature[61]; - EXPECT_EQ(last_msg_.signature[62], 6) << "incorrect value for last_msg_.signature[62], expected 6, is " << last_msg_.signature[62]; - EXPECT_EQ(last_msg_.signature[63], 7) << "incorrect value for last_msg_.signature[63], expected 7, is " << last_msg_.signature[63]; +}; + +TEST_F(Test_auto_check_sbp_signing_MsgCertificateChainDep0, Test) { + uint8_t encoded_frame[] = { + 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 232, 7, 3, 30, 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + }; + + sbp_msg_certificate_chain_dep_t test_msg{}; + + test_msg.corrections_certificate[0] = 20; + + test_msg.corrections_certificate[1] = 21; + + test_msg.corrections_certificate[2] = 22; + + test_msg.corrections_certificate[3] = 23; + + test_msg.corrections_certificate[4] = 24; + + test_msg.corrections_certificate[5] = 25; + + test_msg.corrections_certificate[6] = 26; + + test_msg.corrections_certificate[7] = 27; + + test_msg.corrections_certificate[8] = 28; + + test_msg.corrections_certificate[9] = 29; + + test_msg.corrections_certificate[10] = 10; + + test_msg.corrections_certificate[11] = 11; + + test_msg.corrections_certificate[12] = 12; + + test_msg.corrections_certificate[13] = 13; + + test_msg.corrections_certificate[14] = 14; + + test_msg.corrections_certificate[15] = 15; + + test_msg.corrections_certificate[16] = 16; + + test_msg.corrections_certificate[17] = 17; + + test_msg.corrections_certificate[18] = 18; + + test_msg.corrections_certificate[19] = 19; + test_msg.expiration.day = 30; + test_msg.expiration.hours = 12; + test_msg.expiration.minutes = 34; + test_msg.expiration.month = 3; + test_msg.expiration.ns = 123456789; + test_msg.expiration.seconds = 59; + test_msg.expiration.year = 2024; + + test_msg.intermediate_certificate[0] = 10; + + test_msg.intermediate_certificate[1] = 11; + + test_msg.intermediate_certificate[2] = 12; + + test_msg.intermediate_certificate[3] = 13; + + test_msg.intermediate_certificate[4] = 14; + + test_msg.intermediate_certificate[5] = 15; + + test_msg.intermediate_certificate[6] = 16; + + test_msg.intermediate_certificate[7] = 17; + + test_msg.intermediate_certificate[8] = 18; + + test_msg.intermediate_certificate[9] = 19; + + test_msg.intermediate_certificate[10] = 0; + + test_msg.intermediate_certificate[11] = 1; + + test_msg.intermediate_certificate[12] = 2; + + test_msg.intermediate_certificate[13] = 3; + + test_msg.intermediate_certificate[14] = 4; + + test_msg.intermediate_certificate[15] = 5; + + test_msg.intermediate_certificate[16] = 6; + + test_msg.intermediate_certificate[17] = 7; + + test_msg.intermediate_certificate[18] = 8; + + test_msg.intermediate_certificate[19] = 9; + + test_msg.root_certificate[0] = 0; + + test_msg.root_certificate[1] = 1; + + test_msg.root_certificate[2] = 2; + + test_msg.root_certificate[3] = 3; + + test_msg.root_certificate[4] = 4; + + test_msg.root_certificate[5] = 5; + + test_msg.root_certificate[6] = 6; + + test_msg.root_certificate[7] = 7; + + test_msg.root_certificate[8] = 8; + + test_msg.root_certificate[9] = 9; + + test_msg.root_certificate[10] = 10; + + test_msg.root_certificate[11] = 11; + + test_msg.root_certificate[12] = 12; + + test_msg.root_certificate[13] = 13; + + test_msg.root_certificate[14] = 14; + + test_msg.root_certificate[15] = 15; + + test_msg.root_certificate[16] = 16; + + test_msg.root_certificate[17] = 17; + + test_msg.root_certificate[18] = 18; + + test_msg.root_certificate[19] = 19; + + test_msg.signature[0] = 0; + + test_msg.signature[1] = 1; + + test_msg.signature[2] = 2; + + test_msg.signature[3] = 3; + + test_msg.signature[4] = 4; + + test_msg.signature[5] = 5; + + test_msg.signature[6] = 6; + + test_msg.signature[7] = 7; + + test_msg.signature[8] = 0; + + test_msg.signature[9] = 1; + + test_msg.signature[10] = 2; + + test_msg.signature[11] = 3; + + test_msg.signature[12] = 4; + + test_msg.signature[13] = 5; + + test_msg.signature[14] = 6; + + test_msg.signature[15] = 7; + + test_msg.signature[16] = 0; + + test_msg.signature[17] = 1; + + test_msg.signature[18] = 2; + + test_msg.signature[19] = 3; + + test_msg.signature[20] = 4; + + test_msg.signature[21] = 5; + + test_msg.signature[22] = 6; + + test_msg.signature[23] = 7; + + test_msg.signature[24] = 0; + + test_msg.signature[25] = 1; + + test_msg.signature[26] = 2; + + test_msg.signature[27] = 3; + + test_msg.signature[28] = 4; + + test_msg.signature[29] = 5; + + test_msg.signature[30] = 6; + + test_msg.signature[31] = 7; + + test_msg.signature[32] = 0; + + test_msg.signature[33] = 1; + + test_msg.signature[34] = 2; + + test_msg.signature[35] = 3; + + test_msg.signature[36] = 4; + + test_msg.signature[37] = 5; + + test_msg.signature[38] = 6; + + test_msg.signature[39] = 7; + + test_msg.signature[40] = 0; + + test_msg.signature[41] = 1; + + test_msg.signature[42] = 2; + + test_msg.signature[43] = 3; + + test_msg.signature[44] = 4; + + test_msg.signature[45] = 5; + + test_msg.signature[46] = 6; + + test_msg.signature[47] = 7; + + test_msg.signature[48] = 0; + + test_msg.signature[49] = 1; + + test_msg.signature[50] = 2; + + test_msg.signature[51] = 3; + + test_msg.signature[52] = 4; + + test_msg.signature[53] = 5; + + test_msg.signature[54] = 6; + + test_msg.signature[55] = 7; + + test_msg.signature[56] = 0; + + test_msg.signature[57] = 1; + + test_msg.signature[58] = 2; + + test_msg.signature[59] = 3; + + test_msg.signature[60] = 4; + + test_msg.signature[61] = 5; + + test_msg.signature[62] = 6; + + test_msg.signature[63] = 7; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.corrections_certificate[0], 20) + << "incorrect value for last_msg_.corrections_certificate[0], expected " + "20, is " + << last_msg_.corrections_certificate[0]; + EXPECT_EQ(last_msg_.corrections_certificate[1], 21) + << "incorrect value for last_msg_.corrections_certificate[1], expected " + "21, is " + << last_msg_.corrections_certificate[1]; + EXPECT_EQ(last_msg_.corrections_certificate[2], 22) + << "incorrect value for last_msg_.corrections_certificate[2], expected " + "22, is " + << last_msg_.corrections_certificate[2]; + EXPECT_EQ(last_msg_.corrections_certificate[3], 23) + << "incorrect value for last_msg_.corrections_certificate[3], expected " + "23, is " + << last_msg_.corrections_certificate[3]; + EXPECT_EQ(last_msg_.corrections_certificate[4], 24) + << "incorrect value for last_msg_.corrections_certificate[4], expected " + "24, is " + << last_msg_.corrections_certificate[4]; + EXPECT_EQ(last_msg_.corrections_certificate[5], 25) + << "incorrect value for last_msg_.corrections_certificate[5], expected " + "25, is " + << last_msg_.corrections_certificate[5]; + EXPECT_EQ(last_msg_.corrections_certificate[6], 26) + << "incorrect value for last_msg_.corrections_certificate[6], expected " + "26, is " + << last_msg_.corrections_certificate[6]; + EXPECT_EQ(last_msg_.corrections_certificate[7], 27) + << "incorrect value for last_msg_.corrections_certificate[7], expected " + "27, is " + << last_msg_.corrections_certificate[7]; + EXPECT_EQ(last_msg_.corrections_certificate[8], 28) + << "incorrect value for last_msg_.corrections_certificate[8], expected " + "28, is " + << last_msg_.corrections_certificate[8]; + EXPECT_EQ(last_msg_.corrections_certificate[9], 29) + << "incorrect value for last_msg_.corrections_certificate[9], expected " + "29, is " + << last_msg_.corrections_certificate[9]; + EXPECT_EQ(last_msg_.corrections_certificate[10], 10) + << "incorrect value for last_msg_.corrections_certificate[10], expected " + "10, is " + << last_msg_.corrections_certificate[10]; + EXPECT_EQ(last_msg_.corrections_certificate[11], 11) + << "incorrect value for last_msg_.corrections_certificate[11], expected " + "11, is " + << last_msg_.corrections_certificate[11]; + EXPECT_EQ(last_msg_.corrections_certificate[12], 12) + << "incorrect value for last_msg_.corrections_certificate[12], expected " + "12, is " + << last_msg_.corrections_certificate[12]; + EXPECT_EQ(last_msg_.corrections_certificate[13], 13) + << "incorrect value for last_msg_.corrections_certificate[13], expected " + "13, is " + << last_msg_.corrections_certificate[13]; + EXPECT_EQ(last_msg_.corrections_certificate[14], 14) + << "incorrect value for last_msg_.corrections_certificate[14], expected " + "14, is " + << last_msg_.corrections_certificate[14]; + EXPECT_EQ(last_msg_.corrections_certificate[15], 15) + << "incorrect value for last_msg_.corrections_certificate[15], expected " + "15, is " + << last_msg_.corrections_certificate[15]; + EXPECT_EQ(last_msg_.corrections_certificate[16], 16) + << "incorrect value for last_msg_.corrections_certificate[16], expected " + "16, is " + << last_msg_.corrections_certificate[16]; + EXPECT_EQ(last_msg_.corrections_certificate[17], 17) + << "incorrect value for last_msg_.corrections_certificate[17], expected " + "17, is " + << last_msg_.corrections_certificate[17]; + EXPECT_EQ(last_msg_.corrections_certificate[18], 18) + << "incorrect value for last_msg_.corrections_certificate[18], expected " + "18, is " + << last_msg_.corrections_certificate[18]; + EXPECT_EQ(last_msg_.corrections_certificate[19], 19) + << "incorrect value for last_msg_.corrections_certificate[19], expected " + "19, is " + << last_msg_.corrections_certificate[19]; + EXPECT_EQ(last_msg_.expiration.day, 30) + << "incorrect value for last_msg_.expiration.day, expected 30, is " + << last_msg_.expiration.day; + EXPECT_EQ(last_msg_.expiration.hours, 12) + << "incorrect value for last_msg_.expiration.hours, expected 12, is " + << last_msg_.expiration.hours; + EXPECT_EQ(last_msg_.expiration.minutes, 34) + << "incorrect value for last_msg_.expiration.minutes, expected 34, is " + << last_msg_.expiration.minutes; + EXPECT_EQ(last_msg_.expiration.month, 3) + << "incorrect value for last_msg_.expiration.month, expected 3, is " + << last_msg_.expiration.month; + EXPECT_EQ(last_msg_.expiration.ns, 123456789) + << "incorrect value for last_msg_.expiration.ns, expected 123456789, is " + << last_msg_.expiration.ns; + EXPECT_EQ(last_msg_.expiration.seconds, 59) + << "incorrect value for last_msg_.expiration.seconds, expected 59, is " + << last_msg_.expiration.seconds; + EXPECT_EQ(last_msg_.expiration.year, 2024) + << "incorrect value for last_msg_.expiration.year, expected 2024, is " + << last_msg_.expiration.year; + EXPECT_EQ(last_msg_.intermediate_certificate[0], 10) + << "incorrect value for last_msg_.intermediate_certificate[0], expected " + "10, is " + << last_msg_.intermediate_certificate[0]; + EXPECT_EQ(last_msg_.intermediate_certificate[1], 11) + << "incorrect value for last_msg_.intermediate_certificate[1], expected " + "11, is " + << last_msg_.intermediate_certificate[1]; + EXPECT_EQ(last_msg_.intermediate_certificate[2], 12) + << "incorrect value for last_msg_.intermediate_certificate[2], expected " + "12, is " + << last_msg_.intermediate_certificate[2]; + EXPECT_EQ(last_msg_.intermediate_certificate[3], 13) + << "incorrect value for last_msg_.intermediate_certificate[3], expected " + "13, is " + << last_msg_.intermediate_certificate[3]; + EXPECT_EQ(last_msg_.intermediate_certificate[4], 14) + << "incorrect value for last_msg_.intermediate_certificate[4], expected " + "14, is " + << last_msg_.intermediate_certificate[4]; + EXPECT_EQ(last_msg_.intermediate_certificate[5], 15) + << "incorrect value for last_msg_.intermediate_certificate[5], expected " + "15, is " + << last_msg_.intermediate_certificate[5]; + EXPECT_EQ(last_msg_.intermediate_certificate[6], 16) + << "incorrect value for last_msg_.intermediate_certificate[6], expected " + "16, is " + << last_msg_.intermediate_certificate[6]; + EXPECT_EQ(last_msg_.intermediate_certificate[7], 17) + << "incorrect value for last_msg_.intermediate_certificate[7], expected " + "17, is " + << last_msg_.intermediate_certificate[7]; + EXPECT_EQ(last_msg_.intermediate_certificate[8], 18) + << "incorrect value for last_msg_.intermediate_certificate[8], expected " + "18, is " + << last_msg_.intermediate_certificate[8]; + EXPECT_EQ(last_msg_.intermediate_certificate[9], 19) + << "incorrect value for last_msg_.intermediate_certificate[9], expected " + "19, is " + << last_msg_.intermediate_certificate[9]; + EXPECT_EQ(last_msg_.intermediate_certificate[10], 0) + << "incorrect value for last_msg_.intermediate_certificate[10], expected " + "0, is " + << last_msg_.intermediate_certificate[10]; + EXPECT_EQ(last_msg_.intermediate_certificate[11], 1) + << "incorrect value for last_msg_.intermediate_certificate[11], expected " + "1, is " + << last_msg_.intermediate_certificate[11]; + EXPECT_EQ(last_msg_.intermediate_certificate[12], 2) + << "incorrect value for last_msg_.intermediate_certificate[12], expected " + "2, is " + << last_msg_.intermediate_certificate[12]; + EXPECT_EQ(last_msg_.intermediate_certificate[13], 3) + << "incorrect value for last_msg_.intermediate_certificate[13], expected " + "3, is " + << last_msg_.intermediate_certificate[13]; + EXPECT_EQ(last_msg_.intermediate_certificate[14], 4) + << "incorrect value for last_msg_.intermediate_certificate[14], expected " + "4, is " + << last_msg_.intermediate_certificate[14]; + EXPECT_EQ(last_msg_.intermediate_certificate[15], 5) + << "incorrect value for last_msg_.intermediate_certificate[15], expected " + "5, is " + << last_msg_.intermediate_certificate[15]; + EXPECT_EQ(last_msg_.intermediate_certificate[16], 6) + << "incorrect value for last_msg_.intermediate_certificate[16], expected " + "6, is " + << last_msg_.intermediate_certificate[16]; + EXPECT_EQ(last_msg_.intermediate_certificate[17], 7) + << "incorrect value for last_msg_.intermediate_certificate[17], expected " + "7, is " + << last_msg_.intermediate_certificate[17]; + EXPECT_EQ(last_msg_.intermediate_certificate[18], 8) + << "incorrect value for last_msg_.intermediate_certificate[18], expected " + "8, is " + << last_msg_.intermediate_certificate[18]; + EXPECT_EQ(last_msg_.intermediate_certificate[19], 9) + << "incorrect value for last_msg_.intermediate_certificate[19], expected " + "9, is " + << last_msg_.intermediate_certificate[19]; + EXPECT_EQ(last_msg_.root_certificate[0], 0) + << "incorrect value for last_msg_.root_certificate[0], expected 0, is " + << last_msg_.root_certificate[0]; + EXPECT_EQ(last_msg_.root_certificate[1], 1) + << "incorrect value for last_msg_.root_certificate[1], expected 1, is " + << last_msg_.root_certificate[1]; + EXPECT_EQ(last_msg_.root_certificate[2], 2) + << "incorrect value for last_msg_.root_certificate[2], expected 2, is " + << last_msg_.root_certificate[2]; + EXPECT_EQ(last_msg_.root_certificate[3], 3) + << "incorrect value for last_msg_.root_certificate[3], expected 3, is " + << last_msg_.root_certificate[3]; + EXPECT_EQ(last_msg_.root_certificate[4], 4) + << "incorrect value for last_msg_.root_certificate[4], expected 4, is " + << last_msg_.root_certificate[4]; + EXPECT_EQ(last_msg_.root_certificate[5], 5) + << "incorrect value for last_msg_.root_certificate[5], expected 5, is " + << last_msg_.root_certificate[5]; + EXPECT_EQ(last_msg_.root_certificate[6], 6) + << "incorrect value for last_msg_.root_certificate[6], expected 6, is " + << last_msg_.root_certificate[6]; + EXPECT_EQ(last_msg_.root_certificate[7], 7) + << "incorrect value for last_msg_.root_certificate[7], expected 7, is " + << last_msg_.root_certificate[7]; + EXPECT_EQ(last_msg_.root_certificate[8], 8) + << "incorrect value for last_msg_.root_certificate[8], expected 8, is " + << last_msg_.root_certificate[8]; + EXPECT_EQ(last_msg_.root_certificate[9], 9) + << "incorrect value for last_msg_.root_certificate[9], expected 9, is " + << last_msg_.root_certificate[9]; + EXPECT_EQ(last_msg_.root_certificate[10], 10) + << "incorrect value for last_msg_.root_certificate[10], expected 10, is " + << last_msg_.root_certificate[10]; + EXPECT_EQ(last_msg_.root_certificate[11], 11) + << "incorrect value for last_msg_.root_certificate[11], expected 11, is " + << last_msg_.root_certificate[11]; + EXPECT_EQ(last_msg_.root_certificate[12], 12) + << "incorrect value for last_msg_.root_certificate[12], expected 12, is " + << last_msg_.root_certificate[12]; + EXPECT_EQ(last_msg_.root_certificate[13], 13) + << "incorrect value for last_msg_.root_certificate[13], expected 13, is " + << last_msg_.root_certificate[13]; + EXPECT_EQ(last_msg_.root_certificate[14], 14) + << "incorrect value for last_msg_.root_certificate[14], expected 14, is " + << last_msg_.root_certificate[14]; + EXPECT_EQ(last_msg_.root_certificate[15], 15) + << "incorrect value for last_msg_.root_certificate[15], expected 15, is " + << last_msg_.root_certificate[15]; + EXPECT_EQ(last_msg_.root_certificate[16], 16) + << "incorrect value for last_msg_.root_certificate[16], expected 16, is " + << last_msg_.root_certificate[16]; + EXPECT_EQ(last_msg_.root_certificate[17], 17) + << "incorrect value for last_msg_.root_certificate[17], expected 17, is " + << last_msg_.root_certificate[17]; + EXPECT_EQ(last_msg_.root_certificate[18], 18) + << "incorrect value for last_msg_.root_certificate[18], expected 18, is " + << last_msg_.root_certificate[18]; + EXPECT_EQ(last_msg_.root_certificate[19], 19) + << "incorrect value for last_msg_.root_certificate[19], expected 19, is " + << last_msg_.root_certificate[19]; + EXPECT_EQ(last_msg_.signature[0], 0) + << "incorrect value for last_msg_.signature[0], expected 0, is " + << last_msg_.signature[0]; + EXPECT_EQ(last_msg_.signature[1], 1) + << "incorrect value for last_msg_.signature[1], expected 1, is " + << last_msg_.signature[1]; + EXPECT_EQ(last_msg_.signature[2], 2) + << "incorrect value for last_msg_.signature[2], expected 2, is " + << last_msg_.signature[2]; + EXPECT_EQ(last_msg_.signature[3], 3) + << "incorrect value for last_msg_.signature[3], expected 3, is " + << last_msg_.signature[3]; + EXPECT_EQ(last_msg_.signature[4], 4) + << "incorrect value for last_msg_.signature[4], expected 4, is " + << last_msg_.signature[4]; + EXPECT_EQ(last_msg_.signature[5], 5) + << "incorrect value for last_msg_.signature[5], expected 5, is " + << last_msg_.signature[5]; + EXPECT_EQ(last_msg_.signature[6], 6) + << "incorrect value for last_msg_.signature[6], expected 6, is " + << last_msg_.signature[6]; + EXPECT_EQ(last_msg_.signature[7], 7) + << "incorrect value for last_msg_.signature[7], expected 7, is " + << last_msg_.signature[7]; + EXPECT_EQ(last_msg_.signature[8], 0) + << "incorrect value for last_msg_.signature[8], expected 0, is " + << last_msg_.signature[8]; + EXPECT_EQ(last_msg_.signature[9], 1) + << "incorrect value for last_msg_.signature[9], expected 1, is " + << last_msg_.signature[9]; + EXPECT_EQ(last_msg_.signature[10], 2) + << "incorrect value for last_msg_.signature[10], expected 2, is " + << last_msg_.signature[10]; + EXPECT_EQ(last_msg_.signature[11], 3) + << "incorrect value for last_msg_.signature[11], expected 3, is " + << last_msg_.signature[11]; + EXPECT_EQ(last_msg_.signature[12], 4) + << "incorrect value for last_msg_.signature[12], expected 4, is " + << last_msg_.signature[12]; + EXPECT_EQ(last_msg_.signature[13], 5) + << "incorrect value for last_msg_.signature[13], expected 5, is " + << last_msg_.signature[13]; + EXPECT_EQ(last_msg_.signature[14], 6) + << "incorrect value for last_msg_.signature[14], expected 6, is " + << last_msg_.signature[14]; + EXPECT_EQ(last_msg_.signature[15], 7) + << "incorrect value for last_msg_.signature[15], expected 7, is " + << last_msg_.signature[15]; + EXPECT_EQ(last_msg_.signature[16], 0) + << "incorrect value for last_msg_.signature[16], expected 0, is " + << last_msg_.signature[16]; + EXPECT_EQ(last_msg_.signature[17], 1) + << "incorrect value for last_msg_.signature[17], expected 1, is " + << last_msg_.signature[17]; + EXPECT_EQ(last_msg_.signature[18], 2) + << "incorrect value for last_msg_.signature[18], expected 2, is " + << last_msg_.signature[18]; + EXPECT_EQ(last_msg_.signature[19], 3) + << "incorrect value for last_msg_.signature[19], expected 3, is " + << last_msg_.signature[19]; + EXPECT_EQ(last_msg_.signature[20], 4) + << "incorrect value for last_msg_.signature[20], expected 4, is " + << last_msg_.signature[20]; + EXPECT_EQ(last_msg_.signature[21], 5) + << "incorrect value for last_msg_.signature[21], expected 5, is " + << last_msg_.signature[21]; + EXPECT_EQ(last_msg_.signature[22], 6) + << "incorrect value for last_msg_.signature[22], expected 6, is " + << last_msg_.signature[22]; + EXPECT_EQ(last_msg_.signature[23], 7) + << "incorrect value for last_msg_.signature[23], expected 7, is " + << last_msg_.signature[23]; + EXPECT_EQ(last_msg_.signature[24], 0) + << "incorrect value for last_msg_.signature[24], expected 0, is " + << last_msg_.signature[24]; + EXPECT_EQ(last_msg_.signature[25], 1) + << "incorrect value for last_msg_.signature[25], expected 1, is " + << last_msg_.signature[25]; + EXPECT_EQ(last_msg_.signature[26], 2) + << "incorrect value for last_msg_.signature[26], expected 2, is " + << last_msg_.signature[26]; + EXPECT_EQ(last_msg_.signature[27], 3) + << "incorrect value for last_msg_.signature[27], expected 3, is " + << last_msg_.signature[27]; + EXPECT_EQ(last_msg_.signature[28], 4) + << "incorrect value for last_msg_.signature[28], expected 4, is " + << last_msg_.signature[28]; + EXPECT_EQ(last_msg_.signature[29], 5) + << "incorrect value for last_msg_.signature[29], expected 5, is " + << last_msg_.signature[29]; + EXPECT_EQ(last_msg_.signature[30], 6) + << "incorrect value for last_msg_.signature[30], expected 6, is " + << last_msg_.signature[30]; + EXPECT_EQ(last_msg_.signature[31], 7) + << "incorrect value for last_msg_.signature[31], expected 7, is " + << last_msg_.signature[31]; + EXPECT_EQ(last_msg_.signature[32], 0) + << "incorrect value for last_msg_.signature[32], expected 0, is " + << last_msg_.signature[32]; + EXPECT_EQ(last_msg_.signature[33], 1) + << "incorrect value for last_msg_.signature[33], expected 1, is " + << last_msg_.signature[33]; + EXPECT_EQ(last_msg_.signature[34], 2) + << "incorrect value for last_msg_.signature[34], expected 2, is " + << last_msg_.signature[34]; + EXPECT_EQ(last_msg_.signature[35], 3) + << "incorrect value for last_msg_.signature[35], expected 3, is " + << last_msg_.signature[35]; + EXPECT_EQ(last_msg_.signature[36], 4) + << "incorrect value for last_msg_.signature[36], expected 4, is " + << last_msg_.signature[36]; + EXPECT_EQ(last_msg_.signature[37], 5) + << "incorrect value for last_msg_.signature[37], expected 5, is " + << last_msg_.signature[37]; + EXPECT_EQ(last_msg_.signature[38], 6) + << "incorrect value for last_msg_.signature[38], expected 6, is " + << last_msg_.signature[38]; + EXPECT_EQ(last_msg_.signature[39], 7) + << "incorrect value for last_msg_.signature[39], expected 7, is " + << last_msg_.signature[39]; + EXPECT_EQ(last_msg_.signature[40], 0) + << "incorrect value for last_msg_.signature[40], expected 0, is " + << last_msg_.signature[40]; + EXPECT_EQ(last_msg_.signature[41], 1) + << "incorrect value for last_msg_.signature[41], expected 1, is " + << last_msg_.signature[41]; + EXPECT_EQ(last_msg_.signature[42], 2) + << "incorrect value for last_msg_.signature[42], expected 2, is " + << last_msg_.signature[42]; + EXPECT_EQ(last_msg_.signature[43], 3) + << "incorrect value for last_msg_.signature[43], expected 3, is " + << last_msg_.signature[43]; + EXPECT_EQ(last_msg_.signature[44], 4) + << "incorrect value for last_msg_.signature[44], expected 4, is " + << last_msg_.signature[44]; + EXPECT_EQ(last_msg_.signature[45], 5) + << "incorrect value for last_msg_.signature[45], expected 5, is " + << last_msg_.signature[45]; + EXPECT_EQ(last_msg_.signature[46], 6) + << "incorrect value for last_msg_.signature[46], expected 6, is " + << last_msg_.signature[46]; + EXPECT_EQ(last_msg_.signature[47], 7) + << "incorrect value for last_msg_.signature[47], expected 7, is " + << last_msg_.signature[47]; + EXPECT_EQ(last_msg_.signature[48], 0) + << "incorrect value for last_msg_.signature[48], expected 0, is " + << last_msg_.signature[48]; + EXPECT_EQ(last_msg_.signature[49], 1) + << "incorrect value for last_msg_.signature[49], expected 1, is " + << last_msg_.signature[49]; + EXPECT_EQ(last_msg_.signature[50], 2) + << "incorrect value for last_msg_.signature[50], expected 2, is " + << last_msg_.signature[50]; + EXPECT_EQ(last_msg_.signature[51], 3) + << "incorrect value for last_msg_.signature[51], expected 3, is " + << last_msg_.signature[51]; + EXPECT_EQ(last_msg_.signature[52], 4) + << "incorrect value for last_msg_.signature[52], expected 4, is " + << last_msg_.signature[52]; + EXPECT_EQ(last_msg_.signature[53], 5) + << "incorrect value for last_msg_.signature[53], expected 5, is " + << last_msg_.signature[53]; + EXPECT_EQ(last_msg_.signature[54], 6) + << "incorrect value for last_msg_.signature[54], expected 6, is " + << last_msg_.signature[54]; + EXPECT_EQ(last_msg_.signature[55], 7) + << "incorrect value for last_msg_.signature[55], expected 7, is " + << last_msg_.signature[55]; + EXPECT_EQ(last_msg_.signature[56], 0) + << "incorrect value for last_msg_.signature[56], expected 0, is " + << last_msg_.signature[56]; + EXPECT_EQ(last_msg_.signature[57], 1) + << "incorrect value for last_msg_.signature[57], expected 1, is " + << last_msg_.signature[57]; + EXPECT_EQ(last_msg_.signature[58], 2) + << "incorrect value for last_msg_.signature[58], expected 2, is " + << last_msg_.signature[58]; + EXPECT_EQ(last_msg_.signature[59], 3) + << "incorrect value for last_msg_.signature[59], expected 3, is " + << last_msg_.signature[59]; + EXPECT_EQ(last_msg_.signature[60], 4) + << "incorrect value for last_msg_.signature[60], expected 4, is " + << last_msg_.signature[60]; + EXPECT_EQ(last_msg_.signature[61], 5) + << "incorrect value for last_msg_.signature[61], expected 5, is " + << last_msg_.signature[61]; + EXPECT_EQ(last_msg_.signature[62], 6) + << "incorrect value for last_msg_.signature[62], expected 6, is " + << last_msg_.signature[62]; + EXPECT_EQ(last_msg_.signature[63], 7) + << "incorrect value for last_msg_.signature[63], expected 7, is " + << last_msg_.signature[63]; } diff --git a/c/test/cpp/auto_check_sbp_signing_MsgEcdsaCertificate.cc b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaCertificate.cc index 433c92e94..d42920cbe 100644 --- a/c/test/cpp/auto_check_sbp_signing_MsgEcdsaCertificate.cc +++ b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaCertificate.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaCertificate.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaCertificate.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_signing_MsgEcdsaCertificate0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_signing_MsgEcdsaCertificate0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_signing_MsgEcdsaCertificate0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_signing_MsgEcdsaCertificate0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ecdsa_certificate_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ecdsa_certificate_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,805 +67,1551 @@ class Test_auto_check_sbp_signing_MsgEcdsaCertificate0 : sbp_msg_ecdsa_certificate_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_signing_MsgEcdsaCertificate0, Test) -{ - - uint8_t encoded_frame[] = {85,4,12,66,0,253,48,10,11,12,13,2,180,160,116,77,243,28,173,36,86,33,8,31,120,73,64,169,148,224,57,95,17,40,213,92,195,146,235,228,177,101,82,182,25,172,170,250,236,7,119,4,201,10,14,208,47,126,49,210,174,75,221,203,24,66,52,35,26,30,140,111,246,39,226,205,198,178,196,5,81,9,44,164,163,214,138,123,76,74,237,121,13,137,186,97,193,189,200,124,69,115,230,159,185,158,51,12,225,65,192,105,56,41,85,133,19,217,166,48,139,131,96,216,98,147,132,234,167,248,247,32,239,194,188,254,114,117,83,25,251,191,104,240,118,68,42,93,18,16,37,232,99,179,23,90,94,136,6,125,91,255,15,71,43,46,25,252,229,80,143,58,241,11,62,181,155,53,153,149,152,227,150,87,112,165,2,128,231,25,157,244,204,108,253,127,122,145,113,162,197,171,199,54,184,222,206,67,144,78,187,207,60,211,141,135,106,220,79,183,245,21,161,168,34,129,50,176,1,218,20,130,59,249,109,219,0,100,103,55,29,242,110,154,190,233,142,45,61,215,202,238,88,209,70,63,151,27,102,219,30, }; - - sbp_msg_ecdsa_certificate_t test_msg{}; - - test_msg.certificate_bytes[0] = 180; - - test_msg.certificate_bytes[1] = 160; - - test_msg.certificate_bytes[2] = 116; - - test_msg.certificate_bytes[3] = 77; - - test_msg.certificate_bytes[4] = 243; - - test_msg.certificate_bytes[5] = 28; - - test_msg.certificate_bytes[6] = 173; - - test_msg.certificate_bytes[7] = 36; - - test_msg.certificate_bytes[8] = 86; - - test_msg.certificate_bytes[9] = 33; - - test_msg.certificate_bytes[10] = 8; - - test_msg.certificate_bytes[11] = 31; - - test_msg.certificate_bytes[12] = 120; - - test_msg.certificate_bytes[13] = 73; - - test_msg.certificate_bytes[14] = 64; - - test_msg.certificate_bytes[15] = 169; - - test_msg.certificate_bytes[16] = 148; - - test_msg.certificate_bytes[17] = 224; - - test_msg.certificate_bytes[18] = 57; - - test_msg.certificate_bytes[19] = 95; - - test_msg.certificate_bytes[20] = 17; - - test_msg.certificate_bytes[21] = 40; - - test_msg.certificate_bytes[22] = 213; - - test_msg.certificate_bytes[23] = 92; - - test_msg.certificate_bytes[24] = 195; - - test_msg.certificate_bytes[25] = 146; - - test_msg.certificate_bytes[26] = 235; - - test_msg.certificate_bytes[27] = 228; - - test_msg.certificate_bytes[28] = 177; - - test_msg.certificate_bytes[29] = 101; - - test_msg.certificate_bytes[30] = 82; - - test_msg.certificate_bytes[31] = 182; - - test_msg.certificate_bytes[32] = 25; - - test_msg.certificate_bytes[33] = 172; - - test_msg.certificate_bytes[34] = 170; - - test_msg.certificate_bytes[35] = 250; - - test_msg.certificate_bytes[36] = 236; - - test_msg.certificate_bytes[37] = 7; - - test_msg.certificate_bytes[38] = 119; - - test_msg.certificate_bytes[39] = 4; - - test_msg.certificate_bytes[40] = 201; - - test_msg.certificate_bytes[41] = 10; - - test_msg.certificate_bytes[42] = 14; - - test_msg.certificate_bytes[43] = 208; - - test_msg.certificate_bytes[44] = 47; - - test_msg.certificate_bytes[45] = 126; - - test_msg.certificate_bytes[46] = 49; - - test_msg.certificate_bytes[47] = 210; - - test_msg.certificate_bytes[48] = 174; - - test_msg.certificate_bytes[49] = 75; - - test_msg.certificate_bytes[50] = 221; - - test_msg.certificate_bytes[51] = 203; - - test_msg.certificate_bytes[52] = 24; - - test_msg.certificate_bytes[53] = 66; - - test_msg.certificate_bytes[54] = 52; - - test_msg.certificate_bytes[55] = 35; - - test_msg.certificate_bytes[56] = 26; - - test_msg.certificate_bytes[57] = 30; - - test_msg.certificate_bytes[58] = 140; - - test_msg.certificate_bytes[59] = 111; - - test_msg.certificate_bytes[60] = 246; - - test_msg.certificate_bytes[61] = 39; - - test_msg.certificate_bytes[62] = 226; - - test_msg.certificate_bytes[63] = 205; - - test_msg.certificate_bytes[64] = 198; - - test_msg.certificate_bytes[65] = 178; - - test_msg.certificate_bytes[66] = 196; - - test_msg.certificate_bytes[67] = 5; - - test_msg.certificate_bytes[68] = 81; - - test_msg.certificate_bytes[69] = 9; - - test_msg.certificate_bytes[70] = 44; - - test_msg.certificate_bytes[71] = 164; - - test_msg.certificate_bytes[72] = 163; - - test_msg.certificate_bytes[73] = 214; - - test_msg.certificate_bytes[74] = 138; - - test_msg.certificate_bytes[75] = 123; - - test_msg.certificate_bytes[76] = 76; - - test_msg.certificate_bytes[77] = 74; - - test_msg.certificate_bytes[78] = 237; - - test_msg.certificate_bytes[79] = 121; - - test_msg.certificate_bytes[80] = 13; - - test_msg.certificate_bytes[81] = 137; - - test_msg.certificate_bytes[82] = 186; - - test_msg.certificate_bytes[83] = 97; - - test_msg.certificate_bytes[84] = 193; - - test_msg.certificate_bytes[85] = 189; - - test_msg.certificate_bytes[86] = 200; - - test_msg.certificate_bytes[87] = 124; - - test_msg.certificate_bytes[88] = 69; - - test_msg.certificate_bytes[89] = 115; - - test_msg.certificate_bytes[90] = 230; - - test_msg.certificate_bytes[91] = 159; - - test_msg.certificate_bytes[92] = 185; - - test_msg.certificate_bytes[93] = 158; - - test_msg.certificate_bytes[94] = 51; - - test_msg.certificate_bytes[95] = 12; - - test_msg.certificate_bytes[96] = 225; - - test_msg.certificate_bytes[97] = 65; - - test_msg.certificate_bytes[98] = 192; - - test_msg.certificate_bytes[99] = 105; - - test_msg.certificate_bytes[100] = 56; - - test_msg.certificate_bytes[101] = 41; - - test_msg.certificate_bytes[102] = 85; - - test_msg.certificate_bytes[103] = 133; - - test_msg.certificate_bytes[104] = 19; - - test_msg.certificate_bytes[105] = 217; - - test_msg.certificate_bytes[106] = 166; - - test_msg.certificate_bytes[107] = 48; - - test_msg.certificate_bytes[108] = 139; - - test_msg.certificate_bytes[109] = 131; - - test_msg.certificate_bytes[110] = 96; - - test_msg.certificate_bytes[111] = 216; - - test_msg.certificate_bytes[112] = 98; - - test_msg.certificate_bytes[113] = 147; - - test_msg.certificate_bytes[114] = 132; - - test_msg.certificate_bytes[115] = 234; - - test_msg.certificate_bytes[116] = 167; - - test_msg.certificate_bytes[117] = 248; - - test_msg.certificate_bytes[118] = 247; - - test_msg.certificate_bytes[119] = 32; - - test_msg.certificate_bytes[120] = 239; - - test_msg.certificate_bytes[121] = 194; - - test_msg.certificate_bytes[122] = 188; - - test_msg.certificate_bytes[123] = 254; - - test_msg.certificate_bytes[124] = 114; - - test_msg.certificate_bytes[125] = 117; - - test_msg.certificate_bytes[126] = 83; - - test_msg.certificate_bytes[127] = 25; - - test_msg.certificate_bytes[128] = 251; - - test_msg.certificate_bytes[129] = 191; - - test_msg.certificate_bytes[130] = 104; - - test_msg.certificate_bytes[131] = 240; - - test_msg.certificate_bytes[132] = 118; - - test_msg.certificate_bytes[133] = 68; - - test_msg.certificate_bytes[134] = 42; - - test_msg.certificate_bytes[135] = 93; - - test_msg.certificate_bytes[136] = 18; - - test_msg.certificate_bytes[137] = 16; - - test_msg.certificate_bytes[138] = 37; - - test_msg.certificate_bytes[139] = 232; - - test_msg.certificate_bytes[140] = 99; - - test_msg.certificate_bytes[141] = 179; - - test_msg.certificate_bytes[142] = 23; - - test_msg.certificate_bytes[143] = 90; - - test_msg.certificate_bytes[144] = 94; - - test_msg.certificate_bytes[145] = 136; - - test_msg.certificate_bytes[146] = 6; - - test_msg.certificate_bytes[147] = 125; - - test_msg.certificate_bytes[148] = 91; - - test_msg.certificate_bytes[149] = 255; - - test_msg.certificate_bytes[150] = 15; - - test_msg.certificate_bytes[151] = 71; - - test_msg.certificate_bytes[152] = 43; - - test_msg.certificate_bytes[153] = 46; - - test_msg.certificate_bytes[154] = 25; - - test_msg.certificate_bytes[155] = 252; - - test_msg.certificate_bytes[156] = 229; - - test_msg.certificate_bytes[157] = 80; - - test_msg.certificate_bytes[158] = 143; - - test_msg.certificate_bytes[159] = 58; - - test_msg.certificate_bytes[160] = 241; - - test_msg.certificate_bytes[161] = 11; - - test_msg.certificate_bytes[162] = 62; - - test_msg.certificate_bytes[163] = 181; - - test_msg.certificate_bytes[164] = 155; - - test_msg.certificate_bytes[165] = 53; - - test_msg.certificate_bytes[166] = 153; - - test_msg.certificate_bytes[167] = 149; - - test_msg.certificate_bytes[168] = 152; - - test_msg.certificate_bytes[169] = 227; - - test_msg.certificate_bytes[170] = 150; - - test_msg.certificate_bytes[171] = 87; - - test_msg.certificate_bytes[172] = 112; - - test_msg.certificate_bytes[173] = 165; - - test_msg.certificate_bytes[174] = 2; - - test_msg.certificate_bytes[175] = 128; - - test_msg.certificate_bytes[176] = 231; - - test_msg.certificate_bytes[177] = 25; - - test_msg.certificate_bytes[178] = 157; - - test_msg.certificate_bytes[179] = 244; - - test_msg.certificate_bytes[180] = 204; - - test_msg.certificate_bytes[181] = 108; - - test_msg.certificate_bytes[182] = 253; - - test_msg.certificate_bytes[183] = 127; - - test_msg.certificate_bytes[184] = 122; - - test_msg.certificate_bytes[185] = 145; - - test_msg.certificate_bytes[186] = 113; - - test_msg.certificate_bytes[187] = 162; - - test_msg.certificate_bytes[188] = 197; - - test_msg.certificate_bytes[189] = 171; - - test_msg.certificate_bytes[190] = 199; - - test_msg.certificate_bytes[191] = 54; - - test_msg.certificate_bytes[192] = 184; - - test_msg.certificate_bytes[193] = 222; - - test_msg.certificate_bytes[194] = 206; - - test_msg.certificate_bytes[195] = 67; - - test_msg.certificate_bytes[196] = 144; - - test_msg.certificate_bytes[197] = 78; - - test_msg.certificate_bytes[198] = 187; - - test_msg.certificate_bytes[199] = 207; - - test_msg.certificate_bytes[200] = 60; - - test_msg.certificate_bytes[201] = 211; - - test_msg.certificate_bytes[202] = 141; - - test_msg.certificate_bytes[203] = 135; - - test_msg.certificate_bytes[204] = 106; - - test_msg.certificate_bytes[205] = 220; - - test_msg.certificate_bytes[206] = 79; - - test_msg.certificate_bytes[207] = 183; - - test_msg.certificate_bytes[208] = 245; - - test_msg.certificate_bytes[209] = 21; - - test_msg.certificate_bytes[210] = 161; - - test_msg.certificate_bytes[211] = 168; - - test_msg.certificate_bytes[212] = 34; - - test_msg.certificate_bytes[213] = 129; - - test_msg.certificate_bytes[214] = 50; - - test_msg.certificate_bytes[215] = 176; - - test_msg.certificate_bytes[216] = 1; - - test_msg.certificate_bytes[217] = 218; - - test_msg.certificate_bytes[218] = 20; - - test_msg.certificate_bytes[219] = 130; - - test_msg.certificate_bytes[220] = 59; - - test_msg.certificate_bytes[221] = 249; - - test_msg.certificate_bytes[222] = 109; - - test_msg.certificate_bytes[223] = 219; - - test_msg.certificate_bytes[224] = 0; - - test_msg.certificate_bytes[225] = 100; - - test_msg.certificate_bytes[226] = 103; - - test_msg.certificate_bytes[227] = 55; - - test_msg.certificate_bytes[228] = 29; - - test_msg.certificate_bytes[229] = 242; - - test_msg.certificate_bytes[230] = 110; - - test_msg.certificate_bytes[231] = 154; - - test_msg.certificate_bytes[232] = 190; - - test_msg.certificate_bytes[233] = 233; - - test_msg.certificate_bytes[234] = 142; - - test_msg.certificate_bytes[235] = 45; - - test_msg.certificate_bytes[236] = 61; - - test_msg.certificate_bytes[237] = 215; - - test_msg.certificate_bytes[238] = 202; - - test_msg.certificate_bytes[239] = 238; - - test_msg.certificate_bytes[240] = 88; - - test_msg.certificate_bytes[241] = 209; - - test_msg.certificate_bytes[242] = 70; - - test_msg.certificate_bytes[243] = 63; - - test_msg.certificate_bytes[244] = 151; - - test_msg.certificate_bytes[245] = 27; - - test_msg.certificate_bytes[246] = 102; - - test_msg.certificate_id[0] = 10; - - test_msg.certificate_id[1] = 11; - - test_msg.certificate_id[2] = 12; - - test_msg.certificate_id[3] = 13; - test_msg.flags = 2; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_certificate_bytes.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)99,(char)101,(char)114,(char)116,(char)105,(char)102,(char)105,(char)99,(char)97,(char)116,(char)101,(char)95,(char)98,(char)121,(char)116,(char)101,(char)115 }; - memcpy(test_msg.n_certificate_bytes.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_certificate_bytes.value = 247; - test_msg.n_msg = 48; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.certificate_bytes[0], 180) << "incorrect value for last_msg_.certificate_bytes[0], expected 180, is " << last_msg_.certificate_bytes[0]; - EXPECT_EQ(last_msg_.certificate_bytes[1], 160) << "incorrect value for last_msg_.certificate_bytes[1], expected 160, is " << last_msg_.certificate_bytes[1]; - EXPECT_EQ(last_msg_.certificate_bytes[2], 116) << "incorrect value for last_msg_.certificate_bytes[2], expected 116, is " << last_msg_.certificate_bytes[2]; - EXPECT_EQ(last_msg_.certificate_bytes[3], 77) << "incorrect value for last_msg_.certificate_bytes[3], expected 77, is " << last_msg_.certificate_bytes[3]; - EXPECT_EQ(last_msg_.certificate_bytes[4], 243) << "incorrect value for last_msg_.certificate_bytes[4], expected 243, is " << last_msg_.certificate_bytes[4]; - EXPECT_EQ(last_msg_.certificate_bytes[5], 28) << "incorrect value for last_msg_.certificate_bytes[5], expected 28, is " << last_msg_.certificate_bytes[5]; - EXPECT_EQ(last_msg_.certificate_bytes[6], 173) << "incorrect value for last_msg_.certificate_bytes[6], expected 173, is " << last_msg_.certificate_bytes[6]; - EXPECT_EQ(last_msg_.certificate_bytes[7], 36) << "incorrect value for last_msg_.certificate_bytes[7], expected 36, is " << last_msg_.certificate_bytes[7]; - EXPECT_EQ(last_msg_.certificate_bytes[8], 86) << "incorrect value for last_msg_.certificate_bytes[8], expected 86, is " << last_msg_.certificate_bytes[8]; - EXPECT_EQ(last_msg_.certificate_bytes[9], 33) << "incorrect value for last_msg_.certificate_bytes[9], expected 33, is " << last_msg_.certificate_bytes[9]; - EXPECT_EQ(last_msg_.certificate_bytes[10], 8) << "incorrect value for last_msg_.certificate_bytes[10], expected 8, is " << last_msg_.certificate_bytes[10]; - EXPECT_EQ(last_msg_.certificate_bytes[11], 31) << "incorrect value for last_msg_.certificate_bytes[11], expected 31, is " << last_msg_.certificate_bytes[11]; - EXPECT_EQ(last_msg_.certificate_bytes[12], 120) << "incorrect value for last_msg_.certificate_bytes[12], expected 120, is " << last_msg_.certificate_bytes[12]; - EXPECT_EQ(last_msg_.certificate_bytes[13], 73) << "incorrect value for last_msg_.certificate_bytes[13], expected 73, is " << last_msg_.certificate_bytes[13]; - EXPECT_EQ(last_msg_.certificate_bytes[14], 64) << "incorrect value for last_msg_.certificate_bytes[14], expected 64, is " << last_msg_.certificate_bytes[14]; - EXPECT_EQ(last_msg_.certificate_bytes[15], 169) << "incorrect value for last_msg_.certificate_bytes[15], expected 169, is " << last_msg_.certificate_bytes[15]; - EXPECT_EQ(last_msg_.certificate_bytes[16], 148) << "incorrect value for last_msg_.certificate_bytes[16], expected 148, is " << last_msg_.certificate_bytes[16]; - EXPECT_EQ(last_msg_.certificate_bytes[17], 224) << "incorrect value for last_msg_.certificate_bytes[17], expected 224, is " << last_msg_.certificate_bytes[17]; - EXPECT_EQ(last_msg_.certificate_bytes[18], 57) << "incorrect value for last_msg_.certificate_bytes[18], expected 57, is " << last_msg_.certificate_bytes[18]; - EXPECT_EQ(last_msg_.certificate_bytes[19], 95) << "incorrect value for last_msg_.certificate_bytes[19], expected 95, is " << last_msg_.certificate_bytes[19]; - EXPECT_EQ(last_msg_.certificate_bytes[20], 17) << "incorrect value for last_msg_.certificate_bytes[20], expected 17, is " << last_msg_.certificate_bytes[20]; - EXPECT_EQ(last_msg_.certificate_bytes[21], 40) << "incorrect value for last_msg_.certificate_bytes[21], expected 40, is " << last_msg_.certificate_bytes[21]; - EXPECT_EQ(last_msg_.certificate_bytes[22], 213) << "incorrect value for last_msg_.certificate_bytes[22], expected 213, is " << last_msg_.certificate_bytes[22]; - EXPECT_EQ(last_msg_.certificate_bytes[23], 92) << "incorrect value for last_msg_.certificate_bytes[23], expected 92, is " << last_msg_.certificate_bytes[23]; - EXPECT_EQ(last_msg_.certificate_bytes[24], 195) << "incorrect value for last_msg_.certificate_bytes[24], expected 195, is " << last_msg_.certificate_bytes[24]; - EXPECT_EQ(last_msg_.certificate_bytes[25], 146) << "incorrect value for last_msg_.certificate_bytes[25], expected 146, is " << last_msg_.certificate_bytes[25]; - EXPECT_EQ(last_msg_.certificate_bytes[26], 235) << "incorrect value for last_msg_.certificate_bytes[26], expected 235, is " << last_msg_.certificate_bytes[26]; - EXPECT_EQ(last_msg_.certificate_bytes[27], 228) << "incorrect value for last_msg_.certificate_bytes[27], expected 228, is " << last_msg_.certificate_bytes[27]; - EXPECT_EQ(last_msg_.certificate_bytes[28], 177) << "incorrect value for last_msg_.certificate_bytes[28], expected 177, is " << last_msg_.certificate_bytes[28]; - EXPECT_EQ(last_msg_.certificate_bytes[29], 101) << "incorrect value for last_msg_.certificate_bytes[29], expected 101, is " << last_msg_.certificate_bytes[29]; - EXPECT_EQ(last_msg_.certificate_bytes[30], 82) << "incorrect value for last_msg_.certificate_bytes[30], expected 82, is " << last_msg_.certificate_bytes[30]; - EXPECT_EQ(last_msg_.certificate_bytes[31], 182) << "incorrect value for last_msg_.certificate_bytes[31], expected 182, is " << last_msg_.certificate_bytes[31]; - EXPECT_EQ(last_msg_.certificate_bytes[32], 25) << "incorrect value for last_msg_.certificate_bytes[32], expected 25, is " << last_msg_.certificate_bytes[32]; - EXPECT_EQ(last_msg_.certificate_bytes[33], 172) << "incorrect value for last_msg_.certificate_bytes[33], expected 172, is " << last_msg_.certificate_bytes[33]; - EXPECT_EQ(last_msg_.certificate_bytes[34], 170) << "incorrect value for last_msg_.certificate_bytes[34], expected 170, is " << last_msg_.certificate_bytes[34]; - EXPECT_EQ(last_msg_.certificate_bytes[35], 250) << "incorrect value for last_msg_.certificate_bytes[35], expected 250, is " << last_msg_.certificate_bytes[35]; - EXPECT_EQ(last_msg_.certificate_bytes[36], 236) << "incorrect value for last_msg_.certificate_bytes[36], expected 236, is " << last_msg_.certificate_bytes[36]; - EXPECT_EQ(last_msg_.certificate_bytes[37], 7) << "incorrect value for last_msg_.certificate_bytes[37], expected 7, is " << last_msg_.certificate_bytes[37]; - EXPECT_EQ(last_msg_.certificate_bytes[38], 119) << "incorrect value for last_msg_.certificate_bytes[38], expected 119, is " << last_msg_.certificate_bytes[38]; - EXPECT_EQ(last_msg_.certificate_bytes[39], 4) << "incorrect value for last_msg_.certificate_bytes[39], expected 4, is " << last_msg_.certificate_bytes[39]; - EXPECT_EQ(last_msg_.certificate_bytes[40], 201) << "incorrect value for last_msg_.certificate_bytes[40], expected 201, is " << last_msg_.certificate_bytes[40]; - EXPECT_EQ(last_msg_.certificate_bytes[41], 10) << "incorrect value for last_msg_.certificate_bytes[41], expected 10, is " << last_msg_.certificate_bytes[41]; - EXPECT_EQ(last_msg_.certificate_bytes[42], 14) << "incorrect value for last_msg_.certificate_bytes[42], expected 14, is " << last_msg_.certificate_bytes[42]; - EXPECT_EQ(last_msg_.certificate_bytes[43], 208) << "incorrect value for last_msg_.certificate_bytes[43], expected 208, is " << last_msg_.certificate_bytes[43]; - EXPECT_EQ(last_msg_.certificate_bytes[44], 47) << "incorrect value for last_msg_.certificate_bytes[44], expected 47, is " << last_msg_.certificate_bytes[44]; - EXPECT_EQ(last_msg_.certificate_bytes[45], 126) << "incorrect value for last_msg_.certificate_bytes[45], expected 126, is " << last_msg_.certificate_bytes[45]; - EXPECT_EQ(last_msg_.certificate_bytes[46], 49) << "incorrect value for last_msg_.certificate_bytes[46], expected 49, is " << last_msg_.certificate_bytes[46]; - EXPECT_EQ(last_msg_.certificate_bytes[47], 210) << "incorrect value for last_msg_.certificate_bytes[47], expected 210, is " << last_msg_.certificate_bytes[47]; - EXPECT_EQ(last_msg_.certificate_bytes[48], 174) << "incorrect value for last_msg_.certificate_bytes[48], expected 174, is " << last_msg_.certificate_bytes[48]; - EXPECT_EQ(last_msg_.certificate_bytes[49], 75) << "incorrect value for last_msg_.certificate_bytes[49], expected 75, is " << last_msg_.certificate_bytes[49]; - EXPECT_EQ(last_msg_.certificate_bytes[50], 221) << "incorrect value for last_msg_.certificate_bytes[50], expected 221, is " << last_msg_.certificate_bytes[50]; - EXPECT_EQ(last_msg_.certificate_bytes[51], 203) << "incorrect value for last_msg_.certificate_bytes[51], expected 203, is " << last_msg_.certificate_bytes[51]; - EXPECT_EQ(last_msg_.certificate_bytes[52], 24) << "incorrect value for last_msg_.certificate_bytes[52], expected 24, is " << last_msg_.certificate_bytes[52]; - EXPECT_EQ(last_msg_.certificate_bytes[53], 66) << "incorrect value for last_msg_.certificate_bytes[53], expected 66, is " << last_msg_.certificate_bytes[53]; - EXPECT_EQ(last_msg_.certificate_bytes[54], 52) << "incorrect value for last_msg_.certificate_bytes[54], expected 52, is " << last_msg_.certificate_bytes[54]; - EXPECT_EQ(last_msg_.certificate_bytes[55], 35) << "incorrect value for last_msg_.certificate_bytes[55], expected 35, is " << last_msg_.certificate_bytes[55]; - EXPECT_EQ(last_msg_.certificate_bytes[56], 26) << "incorrect value for last_msg_.certificate_bytes[56], expected 26, is " << last_msg_.certificate_bytes[56]; - EXPECT_EQ(last_msg_.certificate_bytes[57], 30) << "incorrect value for last_msg_.certificate_bytes[57], expected 30, is " << last_msg_.certificate_bytes[57]; - EXPECT_EQ(last_msg_.certificate_bytes[58], 140) << "incorrect value for last_msg_.certificate_bytes[58], expected 140, is " << last_msg_.certificate_bytes[58]; - EXPECT_EQ(last_msg_.certificate_bytes[59], 111) << "incorrect value for last_msg_.certificate_bytes[59], expected 111, is " << last_msg_.certificate_bytes[59]; - EXPECT_EQ(last_msg_.certificate_bytes[60], 246) << "incorrect value for last_msg_.certificate_bytes[60], expected 246, is " << last_msg_.certificate_bytes[60]; - EXPECT_EQ(last_msg_.certificate_bytes[61], 39) << "incorrect value for last_msg_.certificate_bytes[61], expected 39, is " << last_msg_.certificate_bytes[61]; - EXPECT_EQ(last_msg_.certificate_bytes[62], 226) << "incorrect value for last_msg_.certificate_bytes[62], expected 226, is " << last_msg_.certificate_bytes[62]; - EXPECT_EQ(last_msg_.certificate_bytes[63], 205) << "incorrect value for last_msg_.certificate_bytes[63], expected 205, is " << last_msg_.certificate_bytes[63]; - EXPECT_EQ(last_msg_.certificate_bytes[64], 198) << "incorrect value for last_msg_.certificate_bytes[64], expected 198, is " << last_msg_.certificate_bytes[64]; - EXPECT_EQ(last_msg_.certificate_bytes[65], 178) << "incorrect value for last_msg_.certificate_bytes[65], expected 178, is " << last_msg_.certificate_bytes[65]; - EXPECT_EQ(last_msg_.certificate_bytes[66], 196) << "incorrect value for last_msg_.certificate_bytes[66], expected 196, is " << last_msg_.certificate_bytes[66]; - EXPECT_EQ(last_msg_.certificate_bytes[67], 5) << "incorrect value for last_msg_.certificate_bytes[67], expected 5, is " << last_msg_.certificate_bytes[67]; - EXPECT_EQ(last_msg_.certificate_bytes[68], 81) << "incorrect value for last_msg_.certificate_bytes[68], expected 81, is " << last_msg_.certificate_bytes[68]; - EXPECT_EQ(last_msg_.certificate_bytes[69], 9) << "incorrect value for last_msg_.certificate_bytes[69], expected 9, is " << last_msg_.certificate_bytes[69]; - EXPECT_EQ(last_msg_.certificate_bytes[70], 44) << "incorrect value for last_msg_.certificate_bytes[70], expected 44, is " << last_msg_.certificate_bytes[70]; - EXPECT_EQ(last_msg_.certificate_bytes[71], 164) << "incorrect value for last_msg_.certificate_bytes[71], expected 164, is " << last_msg_.certificate_bytes[71]; - EXPECT_EQ(last_msg_.certificate_bytes[72], 163) << "incorrect value for last_msg_.certificate_bytes[72], expected 163, is " << last_msg_.certificate_bytes[72]; - EXPECT_EQ(last_msg_.certificate_bytes[73], 214) << "incorrect value for last_msg_.certificate_bytes[73], expected 214, is " << last_msg_.certificate_bytes[73]; - EXPECT_EQ(last_msg_.certificate_bytes[74], 138) << "incorrect value for last_msg_.certificate_bytes[74], expected 138, is " << last_msg_.certificate_bytes[74]; - EXPECT_EQ(last_msg_.certificate_bytes[75], 123) << "incorrect value for last_msg_.certificate_bytes[75], expected 123, is " << last_msg_.certificate_bytes[75]; - EXPECT_EQ(last_msg_.certificate_bytes[76], 76) << "incorrect value for last_msg_.certificate_bytes[76], expected 76, is " << last_msg_.certificate_bytes[76]; - EXPECT_EQ(last_msg_.certificate_bytes[77], 74) << "incorrect value for last_msg_.certificate_bytes[77], expected 74, is " << last_msg_.certificate_bytes[77]; - EXPECT_EQ(last_msg_.certificate_bytes[78], 237) << "incorrect value for last_msg_.certificate_bytes[78], expected 237, is " << last_msg_.certificate_bytes[78]; - EXPECT_EQ(last_msg_.certificate_bytes[79], 121) << "incorrect value for last_msg_.certificate_bytes[79], expected 121, is " << last_msg_.certificate_bytes[79]; - EXPECT_EQ(last_msg_.certificate_bytes[80], 13) << "incorrect value for last_msg_.certificate_bytes[80], expected 13, is " << last_msg_.certificate_bytes[80]; - EXPECT_EQ(last_msg_.certificate_bytes[81], 137) << "incorrect value for last_msg_.certificate_bytes[81], expected 137, is " << last_msg_.certificate_bytes[81]; - EXPECT_EQ(last_msg_.certificate_bytes[82], 186) << "incorrect value for last_msg_.certificate_bytes[82], expected 186, is " << last_msg_.certificate_bytes[82]; - EXPECT_EQ(last_msg_.certificate_bytes[83], 97) << "incorrect value for last_msg_.certificate_bytes[83], expected 97, is " << last_msg_.certificate_bytes[83]; - EXPECT_EQ(last_msg_.certificate_bytes[84], 193) << "incorrect value for last_msg_.certificate_bytes[84], expected 193, is " << last_msg_.certificate_bytes[84]; - EXPECT_EQ(last_msg_.certificate_bytes[85], 189) << "incorrect value for last_msg_.certificate_bytes[85], expected 189, is " << last_msg_.certificate_bytes[85]; - EXPECT_EQ(last_msg_.certificate_bytes[86], 200) << "incorrect value for last_msg_.certificate_bytes[86], expected 200, is " << last_msg_.certificate_bytes[86]; - EXPECT_EQ(last_msg_.certificate_bytes[87], 124) << "incorrect value for last_msg_.certificate_bytes[87], expected 124, is " << last_msg_.certificate_bytes[87]; - EXPECT_EQ(last_msg_.certificate_bytes[88], 69) << "incorrect value for last_msg_.certificate_bytes[88], expected 69, is " << last_msg_.certificate_bytes[88]; - EXPECT_EQ(last_msg_.certificate_bytes[89], 115) << "incorrect value for last_msg_.certificate_bytes[89], expected 115, is " << last_msg_.certificate_bytes[89]; - EXPECT_EQ(last_msg_.certificate_bytes[90], 230) << "incorrect value for last_msg_.certificate_bytes[90], expected 230, is " << last_msg_.certificate_bytes[90]; - EXPECT_EQ(last_msg_.certificate_bytes[91], 159) << "incorrect value for last_msg_.certificate_bytes[91], expected 159, is " << last_msg_.certificate_bytes[91]; - EXPECT_EQ(last_msg_.certificate_bytes[92], 185) << "incorrect value for last_msg_.certificate_bytes[92], expected 185, is " << last_msg_.certificate_bytes[92]; - EXPECT_EQ(last_msg_.certificate_bytes[93], 158) << "incorrect value for last_msg_.certificate_bytes[93], expected 158, is " << last_msg_.certificate_bytes[93]; - EXPECT_EQ(last_msg_.certificate_bytes[94], 51) << "incorrect value for last_msg_.certificate_bytes[94], expected 51, is " << last_msg_.certificate_bytes[94]; - EXPECT_EQ(last_msg_.certificate_bytes[95], 12) << "incorrect value for last_msg_.certificate_bytes[95], expected 12, is " << last_msg_.certificate_bytes[95]; - EXPECT_EQ(last_msg_.certificate_bytes[96], 225) << "incorrect value for last_msg_.certificate_bytes[96], expected 225, is " << last_msg_.certificate_bytes[96]; - EXPECT_EQ(last_msg_.certificate_bytes[97], 65) << "incorrect value for last_msg_.certificate_bytes[97], expected 65, is " << last_msg_.certificate_bytes[97]; - EXPECT_EQ(last_msg_.certificate_bytes[98], 192) << "incorrect value for last_msg_.certificate_bytes[98], expected 192, is " << last_msg_.certificate_bytes[98]; - EXPECT_EQ(last_msg_.certificate_bytes[99], 105) << "incorrect value for last_msg_.certificate_bytes[99], expected 105, is " << last_msg_.certificate_bytes[99]; - EXPECT_EQ(last_msg_.certificate_bytes[100], 56) << "incorrect value for last_msg_.certificate_bytes[100], expected 56, is " << last_msg_.certificate_bytes[100]; - EXPECT_EQ(last_msg_.certificate_bytes[101], 41) << "incorrect value for last_msg_.certificate_bytes[101], expected 41, is " << last_msg_.certificate_bytes[101]; - EXPECT_EQ(last_msg_.certificate_bytes[102], 85) << "incorrect value for last_msg_.certificate_bytes[102], expected 85, is " << last_msg_.certificate_bytes[102]; - EXPECT_EQ(last_msg_.certificate_bytes[103], 133) << "incorrect value for last_msg_.certificate_bytes[103], expected 133, is " << last_msg_.certificate_bytes[103]; - EXPECT_EQ(last_msg_.certificate_bytes[104], 19) << "incorrect value for last_msg_.certificate_bytes[104], expected 19, is " << last_msg_.certificate_bytes[104]; - EXPECT_EQ(last_msg_.certificate_bytes[105], 217) << "incorrect value for last_msg_.certificate_bytes[105], expected 217, is " << last_msg_.certificate_bytes[105]; - EXPECT_EQ(last_msg_.certificate_bytes[106], 166) << "incorrect value for last_msg_.certificate_bytes[106], expected 166, is " << last_msg_.certificate_bytes[106]; - EXPECT_EQ(last_msg_.certificate_bytes[107], 48) << "incorrect value for last_msg_.certificate_bytes[107], expected 48, is " << last_msg_.certificate_bytes[107]; - EXPECT_EQ(last_msg_.certificate_bytes[108], 139) << "incorrect value for last_msg_.certificate_bytes[108], expected 139, is " << last_msg_.certificate_bytes[108]; - EXPECT_EQ(last_msg_.certificate_bytes[109], 131) << "incorrect value for last_msg_.certificate_bytes[109], expected 131, is " << last_msg_.certificate_bytes[109]; - EXPECT_EQ(last_msg_.certificate_bytes[110], 96) << "incorrect value for last_msg_.certificate_bytes[110], expected 96, is " << last_msg_.certificate_bytes[110]; - EXPECT_EQ(last_msg_.certificate_bytes[111], 216) << "incorrect value for last_msg_.certificate_bytes[111], expected 216, is " << last_msg_.certificate_bytes[111]; - EXPECT_EQ(last_msg_.certificate_bytes[112], 98) << "incorrect value for last_msg_.certificate_bytes[112], expected 98, is " << last_msg_.certificate_bytes[112]; - EXPECT_EQ(last_msg_.certificate_bytes[113], 147) << "incorrect value for last_msg_.certificate_bytes[113], expected 147, is " << last_msg_.certificate_bytes[113]; - EXPECT_EQ(last_msg_.certificate_bytes[114], 132) << "incorrect value for last_msg_.certificate_bytes[114], expected 132, is " << last_msg_.certificate_bytes[114]; - EXPECT_EQ(last_msg_.certificate_bytes[115], 234) << "incorrect value for last_msg_.certificate_bytes[115], expected 234, is " << last_msg_.certificate_bytes[115]; - EXPECT_EQ(last_msg_.certificate_bytes[116], 167) << "incorrect value for last_msg_.certificate_bytes[116], expected 167, is " << last_msg_.certificate_bytes[116]; - EXPECT_EQ(last_msg_.certificate_bytes[117], 248) << "incorrect value for last_msg_.certificate_bytes[117], expected 248, is " << last_msg_.certificate_bytes[117]; - EXPECT_EQ(last_msg_.certificate_bytes[118], 247) << "incorrect value for last_msg_.certificate_bytes[118], expected 247, is " << last_msg_.certificate_bytes[118]; - EXPECT_EQ(last_msg_.certificate_bytes[119], 32) << "incorrect value for last_msg_.certificate_bytes[119], expected 32, is " << last_msg_.certificate_bytes[119]; - EXPECT_EQ(last_msg_.certificate_bytes[120], 239) << "incorrect value for last_msg_.certificate_bytes[120], expected 239, is " << last_msg_.certificate_bytes[120]; - EXPECT_EQ(last_msg_.certificate_bytes[121], 194) << "incorrect value for last_msg_.certificate_bytes[121], expected 194, is " << last_msg_.certificate_bytes[121]; - EXPECT_EQ(last_msg_.certificate_bytes[122], 188) << "incorrect value for last_msg_.certificate_bytes[122], expected 188, is " << last_msg_.certificate_bytes[122]; - EXPECT_EQ(last_msg_.certificate_bytes[123], 254) << "incorrect value for last_msg_.certificate_bytes[123], expected 254, is " << last_msg_.certificate_bytes[123]; - EXPECT_EQ(last_msg_.certificate_bytes[124], 114) << "incorrect value for last_msg_.certificate_bytes[124], expected 114, is " << last_msg_.certificate_bytes[124]; - EXPECT_EQ(last_msg_.certificate_bytes[125], 117) << "incorrect value for last_msg_.certificate_bytes[125], expected 117, is " << last_msg_.certificate_bytes[125]; - EXPECT_EQ(last_msg_.certificate_bytes[126], 83) << "incorrect value for last_msg_.certificate_bytes[126], expected 83, is " << last_msg_.certificate_bytes[126]; - EXPECT_EQ(last_msg_.certificate_bytes[127], 25) << "incorrect value for last_msg_.certificate_bytes[127], expected 25, is " << last_msg_.certificate_bytes[127]; - EXPECT_EQ(last_msg_.certificate_bytes[128], 251) << "incorrect value for last_msg_.certificate_bytes[128], expected 251, is " << last_msg_.certificate_bytes[128]; - EXPECT_EQ(last_msg_.certificate_bytes[129], 191) << "incorrect value for last_msg_.certificate_bytes[129], expected 191, is " << last_msg_.certificate_bytes[129]; - EXPECT_EQ(last_msg_.certificate_bytes[130], 104) << "incorrect value for last_msg_.certificate_bytes[130], expected 104, is " << last_msg_.certificate_bytes[130]; - EXPECT_EQ(last_msg_.certificate_bytes[131], 240) << "incorrect value for last_msg_.certificate_bytes[131], expected 240, is " << last_msg_.certificate_bytes[131]; - EXPECT_EQ(last_msg_.certificate_bytes[132], 118) << "incorrect value for last_msg_.certificate_bytes[132], expected 118, is " << last_msg_.certificate_bytes[132]; - EXPECT_EQ(last_msg_.certificate_bytes[133], 68) << "incorrect value for last_msg_.certificate_bytes[133], expected 68, is " << last_msg_.certificate_bytes[133]; - EXPECT_EQ(last_msg_.certificate_bytes[134], 42) << "incorrect value for last_msg_.certificate_bytes[134], expected 42, is " << last_msg_.certificate_bytes[134]; - EXPECT_EQ(last_msg_.certificate_bytes[135], 93) << "incorrect value for last_msg_.certificate_bytes[135], expected 93, is " << last_msg_.certificate_bytes[135]; - EXPECT_EQ(last_msg_.certificate_bytes[136], 18) << "incorrect value for last_msg_.certificate_bytes[136], expected 18, is " << last_msg_.certificate_bytes[136]; - EXPECT_EQ(last_msg_.certificate_bytes[137], 16) << "incorrect value for last_msg_.certificate_bytes[137], expected 16, is " << last_msg_.certificate_bytes[137]; - EXPECT_EQ(last_msg_.certificate_bytes[138], 37) << "incorrect value for last_msg_.certificate_bytes[138], expected 37, is " << last_msg_.certificate_bytes[138]; - EXPECT_EQ(last_msg_.certificate_bytes[139], 232) << "incorrect value for last_msg_.certificate_bytes[139], expected 232, is " << last_msg_.certificate_bytes[139]; - EXPECT_EQ(last_msg_.certificate_bytes[140], 99) << "incorrect value for last_msg_.certificate_bytes[140], expected 99, is " << last_msg_.certificate_bytes[140]; - EXPECT_EQ(last_msg_.certificate_bytes[141], 179) << "incorrect value for last_msg_.certificate_bytes[141], expected 179, is " << last_msg_.certificate_bytes[141]; - EXPECT_EQ(last_msg_.certificate_bytes[142], 23) << "incorrect value for last_msg_.certificate_bytes[142], expected 23, is " << last_msg_.certificate_bytes[142]; - EXPECT_EQ(last_msg_.certificate_bytes[143], 90) << "incorrect value for last_msg_.certificate_bytes[143], expected 90, is " << last_msg_.certificate_bytes[143]; - EXPECT_EQ(last_msg_.certificate_bytes[144], 94) << "incorrect value for last_msg_.certificate_bytes[144], expected 94, is " << last_msg_.certificate_bytes[144]; - EXPECT_EQ(last_msg_.certificate_bytes[145], 136) << "incorrect value for last_msg_.certificate_bytes[145], expected 136, is " << last_msg_.certificate_bytes[145]; - EXPECT_EQ(last_msg_.certificate_bytes[146], 6) << "incorrect value for last_msg_.certificate_bytes[146], expected 6, is " << last_msg_.certificate_bytes[146]; - EXPECT_EQ(last_msg_.certificate_bytes[147], 125) << "incorrect value for last_msg_.certificate_bytes[147], expected 125, is " << last_msg_.certificate_bytes[147]; - EXPECT_EQ(last_msg_.certificate_bytes[148], 91) << "incorrect value for last_msg_.certificate_bytes[148], expected 91, is " << last_msg_.certificate_bytes[148]; - EXPECT_EQ(last_msg_.certificate_bytes[149], 255) << "incorrect value for last_msg_.certificate_bytes[149], expected 255, is " << last_msg_.certificate_bytes[149]; - EXPECT_EQ(last_msg_.certificate_bytes[150], 15) << "incorrect value for last_msg_.certificate_bytes[150], expected 15, is " << last_msg_.certificate_bytes[150]; - EXPECT_EQ(last_msg_.certificate_bytes[151], 71) << "incorrect value for last_msg_.certificate_bytes[151], expected 71, is " << last_msg_.certificate_bytes[151]; - EXPECT_EQ(last_msg_.certificate_bytes[152], 43) << "incorrect value for last_msg_.certificate_bytes[152], expected 43, is " << last_msg_.certificate_bytes[152]; - EXPECT_EQ(last_msg_.certificate_bytes[153], 46) << "incorrect value for last_msg_.certificate_bytes[153], expected 46, is " << last_msg_.certificate_bytes[153]; - EXPECT_EQ(last_msg_.certificate_bytes[154], 25) << "incorrect value for last_msg_.certificate_bytes[154], expected 25, is " << last_msg_.certificate_bytes[154]; - EXPECT_EQ(last_msg_.certificate_bytes[155], 252) << "incorrect value for last_msg_.certificate_bytes[155], expected 252, is " << last_msg_.certificate_bytes[155]; - EXPECT_EQ(last_msg_.certificate_bytes[156], 229) << "incorrect value for last_msg_.certificate_bytes[156], expected 229, is " << last_msg_.certificate_bytes[156]; - EXPECT_EQ(last_msg_.certificate_bytes[157], 80) << "incorrect value for last_msg_.certificate_bytes[157], expected 80, is " << last_msg_.certificate_bytes[157]; - EXPECT_EQ(last_msg_.certificate_bytes[158], 143) << "incorrect value for last_msg_.certificate_bytes[158], expected 143, is " << last_msg_.certificate_bytes[158]; - EXPECT_EQ(last_msg_.certificate_bytes[159], 58) << "incorrect value for last_msg_.certificate_bytes[159], expected 58, is " << last_msg_.certificate_bytes[159]; - EXPECT_EQ(last_msg_.certificate_bytes[160], 241) << "incorrect value for last_msg_.certificate_bytes[160], expected 241, is " << last_msg_.certificate_bytes[160]; - EXPECT_EQ(last_msg_.certificate_bytes[161], 11) << "incorrect value for last_msg_.certificate_bytes[161], expected 11, is " << last_msg_.certificate_bytes[161]; - EXPECT_EQ(last_msg_.certificate_bytes[162], 62) << "incorrect value for last_msg_.certificate_bytes[162], expected 62, is " << last_msg_.certificate_bytes[162]; - EXPECT_EQ(last_msg_.certificate_bytes[163], 181) << "incorrect value for last_msg_.certificate_bytes[163], expected 181, is " << last_msg_.certificate_bytes[163]; - EXPECT_EQ(last_msg_.certificate_bytes[164], 155) << "incorrect value for last_msg_.certificate_bytes[164], expected 155, is " << last_msg_.certificate_bytes[164]; - EXPECT_EQ(last_msg_.certificate_bytes[165], 53) << "incorrect value for last_msg_.certificate_bytes[165], expected 53, is " << last_msg_.certificate_bytes[165]; - EXPECT_EQ(last_msg_.certificate_bytes[166], 153) << "incorrect value for last_msg_.certificate_bytes[166], expected 153, is " << last_msg_.certificate_bytes[166]; - EXPECT_EQ(last_msg_.certificate_bytes[167], 149) << "incorrect value for last_msg_.certificate_bytes[167], expected 149, is " << last_msg_.certificate_bytes[167]; - EXPECT_EQ(last_msg_.certificate_bytes[168], 152) << "incorrect value for last_msg_.certificate_bytes[168], expected 152, is " << last_msg_.certificate_bytes[168]; - EXPECT_EQ(last_msg_.certificate_bytes[169], 227) << "incorrect value for last_msg_.certificate_bytes[169], expected 227, is " << last_msg_.certificate_bytes[169]; - EXPECT_EQ(last_msg_.certificate_bytes[170], 150) << "incorrect value for last_msg_.certificate_bytes[170], expected 150, is " << last_msg_.certificate_bytes[170]; - EXPECT_EQ(last_msg_.certificate_bytes[171], 87) << "incorrect value for last_msg_.certificate_bytes[171], expected 87, is " << last_msg_.certificate_bytes[171]; - EXPECT_EQ(last_msg_.certificate_bytes[172], 112) << "incorrect value for last_msg_.certificate_bytes[172], expected 112, is " << last_msg_.certificate_bytes[172]; - EXPECT_EQ(last_msg_.certificate_bytes[173], 165) << "incorrect value for last_msg_.certificate_bytes[173], expected 165, is " << last_msg_.certificate_bytes[173]; - EXPECT_EQ(last_msg_.certificate_bytes[174], 2) << "incorrect value for last_msg_.certificate_bytes[174], expected 2, is " << last_msg_.certificate_bytes[174]; - EXPECT_EQ(last_msg_.certificate_bytes[175], 128) << "incorrect value for last_msg_.certificate_bytes[175], expected 128, is " << last_msg_.certificate_bytes[175]; - EXPECT_EQ(last_msg_.certificate_bytes[176], 231) << "incorrect value for last_msg_.certificate_bytes[176], expected 231, is " << last_msg_.certificate_bytes[176]; - EXPECT_EQ(last_msg_.certificate_bytes[177], 25) << "incorrect value for last_msg_.certificate_bytes[177], expected 25, is " << last_msg_.certificate_bytes[177]; - EXPECT_EQ(last_msg_.certificate_bytes[178], 157) << "incorrect value for last_msg_.certificate_bytes[178], expected 157, is " << last_msg_.certificate_bytes[178]; - EXPECT_EQ(last_msg_.certificate_bytes[179], 244) << "incorrect value for last_msg_.certificate_bytes[179], expected 244, is " << last_msg_.certificate_bytes[179]; - EXPECT_EQ(last_msg_.certificate_bytes[180], 204) << "incorrect value for last_msg_.certificate_bytes[180], expected 204, is " << last_msg_.certificate_bytes[180]; - EXPECT_EQ(last_msg_.certificate_bytes[181], 108) << "incorrect value for last_msg_.certificate_bytes[181], expected 108, is " << last_msg_.certificate_bytes[181]; - EXPECT_EQ(last_msg_.certificate_bytes[182], 253) << "incorrect value for last_msg_.certificate_bytes[182], expected 253, is " << last_msg_.certificate_bytes[182]; - EXPECT_EQ(last_msg_.certificate_bytes[183], 127) << "incorrect value for last_msg_.certificate_bytes[183], expected 127, is " << last_msg_.certificate_bytes[183]; - EXPECT_EQ(last_msg_.certificate_bytes[184], 122) << "incorrect value for last_msg_.certificate_bytes[184], expected 122, is " << last_msg_.certificate_bytes[184]; - EXPECT_EQ(last_msg_.certificate_bytes[185], 145) << "incorrect value for last_msg_.certificate_bytes[185], expected 145, is " << last_msg_.certificate_bytes[185]; - EXPECT_EQ(last_msg_.certificate_bytes[186], 113) << "incorrect value for last_msg_.certificate_bytes[186], expected 113, is " << last_msg_.certificate_bytes[186]; - EXPECT_EQ(last_msg_.certificate_bytes[187], 162) << "incorrect value for last_msg_.certificate_bytes[187], expected 162, is " << last_msg_.certificate_bytes[187]; - EXPECT_EQ(last_msg_.certificate_bytes[188], 197) << "incorrect value for last_msg_.certificate_bytes[188], expected 197, is " << last_msg_.certificate_bytes[188]; - EXPECT_EQ(last_msg_.certificate_bytes[189], 171) << "incorrect value for last_msg_.certificate_bytes[189], expected 171, is " << last_msg_.certificate_bytes[189]; - EXPECT_EQ(last_msg_.certificate_bytes[190], 199) << "incorrect value for last_msg_.certificate_bytes[190], expected 199, is " << last_msg_.certificate_bytes[190]; - EXPECT_EQ(last_msg_.certificate_bytes[191], 54) << "incorrect value for last_msg_.certificate_bytes[191], expected 54, is " << last_msg_.certificate_bytes[191]; - EXPECT_EQ(last_msg_.certificate_bytes[192], 184) << "incorrect value for last_msg_.certificate_bytes[192], expected 184, is " << last_msg_.certificate_bytes[192]; - EXPECT_EQ(last_msg_.certificate_bytes[193], 222) << "incorrect value for last_msg_.certificate_bytes[193], expected 222, is " << last_msg_.certificate_bytes[193]; - EXPECT_EQ(last_msg_.certificate_bytes[194], 206) << "incorrect value for last_msg_.certificate_bytes[194], expected 206, is " << last_msg_.certificate_bytes[194]; - EXPECT_EQ(last_msg_.certificate_bytes[195], 67) << "incorrect value for last_msg_.certificate_bytes[195], expected 67, is " << last_msg_.certificate_bytes[195]; - EXPECT_EQ(last_msg_.certificate_bytes[196], 144) << "incorrect value for last_msg_.certificate_bytes[196], expected 144, is " << last_msg_.certificate_bytes[196]; - EXPECT_EQ(last_msg_.certificate_bytes[197], 78) << "incorrect value for last_msg_.certificate_bytes[197], expected 78, is " << last_msg_.certificate_bytes[197]; - EXPECT_EQ(last_msg_.certificate_bytes[198], 187) << "incorrect value for last_msg_.certificate_bytes[198], expected 187, is " << last_msg_.certificate_bytes[198]; - EXPECT_EQ(last_msg_.certificate_bytes[199], 207) << "incorrect value for last_msg_.certificate_bytes[199], expected 207, is " << last_msg_.certificate_bytes[199]; - EXPECT_EQ(last_msg_.certificate_bytes[200], 60) << "incorrect value for last_msg_.certificate_bytes[200], expected 60, is " << last_msg_.certificate_bytes[200]; - EXPECT_EQ(last_msg_.certificate_bytes[201], 211) << "incorrect value for last_msg_.certificate_bytes[201], expected 211, is " << last_msg_.certificate_bytes[201]; - EXPECT_EQ(last_msg_.certificate_bytes[202], 141) << "incorrect value for last_msg_.certificate_bytes[202], expected 141, is " << last_msg_.certificate_bytes[202]; - EXPECT_EQ(last_msg_.certificate_bytes[203], 135) << "incorrect value for last_msg_.certificate_bytes[203], expected 135, is " << last_msg_.certificate_bytes[203]; - EXPECT_EQ(last_msg_.certificate_bytes[204], 106) << "incorrect value for last_msg_.certificate_bytes[204], expected 106, is " << last_msg_.certificate_bytes[204]; - EXPECT_EQ(last_msg_.certificate_bytes[205], 220) << "incorrect value for last_msg_.certificate_bytes[205], expected 220, is " << last_msg_.certificate_bytes[205]; - EXPECT_EQ(last_msg_.certificate_bytes[206], 79) << "incorrect value for last_msg_.certificate_bytes[206], expected 79, is " << last_msg_.certificate_bytes[206]; - EXPECT_EQ(last_msg_.certificate_bytes[207], 183) << "incorrect value for last_msg_.certificate_bytes[207], expected 183, is " << last_msg_.certificate_bytes[207]; - EXPECT_EQ(last_msg_.certificate_bytes[208], 245) << "incorrect value for last_msg_.certificate_bytes[208], expected 245, is " << last_msg_.certificate_bytes[208]; - EXPECT_EQ(last_msg_.certificate_bytes[209], 21) << "incorrect value for last_msg_.certificate_bytes[209], expected 21, is " << last_msg_.certificate_bytes[209]; - EXPECT_EQ(last_msg_.certificate_bytes[210], 161) << "incorrect value for last_msg_.certificate_bytes[210], expected 161, is " << last_msg_.certificate_bytes[210]; - EXPECT_EQ(last_msg_.certificate_bytes[211], 168) << "incorrect value for last_msg_.certificate_bytes[211], expected 168, is " << last_msg_.certificate_bytes[211]; - EXPECT_EQ(last_msg_.certificate_bytes[212], 34) << "incorrect value for last_msg_.certificate_bytes[212], expected 34, is " << last_msg_.certificate_bytes[212]; - EXPECT_EQ(last_msg_.certificate_bytes[213], 129) << "incorrect value for last_msg_.certificate_bytes[213], expected 129, is " << last_msg_.certificate_bytes[213]; - EXPECT_EQ(last_msg_.certificate_bytes[214], 50) << "incorrect value for last_msg_.certificate_bytes[214], expected 50, is " << last_msg_.certificate_bytes[214]; - EXPECT_EQ(last_msg_.certificate_bytes[215], 176) << "incorrect value for last_msg_.certificate_bytes[215], expected 176, is " << last_msg_.certificate_bytes[215]; - EXPECT_EQ(last_msg_.certificate_bytes[216], 1) << "incorrect value for last_msg_.certificate_bytes[216], expected 1, is " << last_msg_.certificate_bytes[216]; - EXPECT_EQ(last_msg_.certificate_bytes[217], 218) << "incorrect value for last_msg_.certificate_bytes[217], expected 218, is " << last_msg_.certificate_bytes[217]; - EXPECT_EQ(last_msg_.certificate_bytes[218], 20) << "incorrect value for last_msg_.certificate_bytes[218], expected 20, is " << last_msg_.certificate_bytes[218]; - EXPECT_EQ(last_msg_.certificate_bytes[219], 130) << "incorrect value for last_msg_.certificate_bytes[219], expected 130, is " << last_msg_.certificate_bytes[219]; - EXPECT_EQ(last_msg_.certificate_bytes[220], 59) << "incorrect value for last_msg_.certificate_bytes[220], expected 59, is " << last_msg_.certificate_bytes[220]; - EXPECT_EQ(last_msg_.certificate_bytes[221], 249) << "incorrect value for last_msg_.certificate_bytes[221], expected 249, is " << last_msg_.certificate_bytes[221]; - EXPECT_EQ(last_msg_.certificate_bytes[222], 109) << "incorrect value for last_msg_.certificate_bytes[222], expected 109, is " << last_msg_.certificate_bytes[222]; - EXPECT_EQ(last_msg_.certificate_bytes[223], 219) << "incorrect value for last_msg_.certificate_bytes[223], expected 219, is " << last_msg_.certificate_bytes[223]; - EXPECT_EQ(last_msg_.certificate_bytes[224], 0) << "incorrect value for last_msg_.certificate_bytes[224], expected 0, is " << last_msg_.certificate_bytes[224]; - EXPECT_EQ(last_msg_.certificate_bytes[225], 100) << "incorrect value for last_msg_.certificate_bytes[225], expected 100, is " << last_msg_.certificate_bytes[225]; - EXPECT_EQ(last_msg_.certificate_bytes[226], 103) << "incorrect value for last_msg_.certificate_bytes[226], expected 103, is " << last_msg_.certificate_bytes[226]; - EXPECT_EQ(last_msg_.certificate_bytes[227], 55) << "incorrect value for last_msg_.certificate_bytes[227], expected 55, is " << last_msg_.certificate_bytes[227]; - EXPECT_EQ(last_msg_.certificate_bytes[228], 29) << "incorrect value for last_msg_.certificate_bytes[228], expected 29, is " << last_msg_.certificate_bytes[228]; - EXPECT_EQ(last_msg_.certificate_bytes[229], 242) << "incorrect value for last_msg_.certificate_bytes[229], expected 242, is " << last_msg_.certificate_bytes[229]; - EXPECT_EQ(last_msg_.certificate_bytes[230], 110) << "incorrect value for last_msg_.certificate_bytes[230], expected 110, is " << last_msg_.certificate_bytes[230]; - EXPECT_EQ(last_msg_.certificate_bytes[231], 154) << "incorrect value for last_msg_.certificate_bytes[231], expected 154, is " << last_msg_.certificate_bytes[231]; - EXPECT_EQ(last_msg_.certificate_bytes[232], 190) << "incorrect value for last_msg_.certificate_bytes[232], expected 190, is " << last_msg_.certificate_bytes[232]; - EXPECT_EQ(last_msg_.certificate_bytes[233], 233) << "incorrect value for last_msg_.certificate_bytes[233], expected 233, is " << last_msg_.certificate_bytes[233]; - EXPECT_EQ(last_msg_.certificate_bytes[234], 142) << "incorrect value for last_msg_.certificate_bytes[234], expected 142, is " << last_msg_.certificate_bytes[234]; - EXPECT_EQ(last_msg_.certificate_bytes[235], 45) << "incorrect value for last_msg_.certificate_bytes[235], expected 45, is " << last_msg_.certificate_bytes[235]; - EXPECT_EQ(last_msg_.certificate_bytes[236], 61) << "incorrect value for last_msg_.certificate_bytes[236], expected 61, is " << last_msg_.certificate_bytes[236]; - EXPECT_EQ(last_msg_.certificate_bytes[237], 215) << "incorrect value for last_msg_.certificate_bytes[237], expected 215, is " << last_msg_.certificate_bytes[237]; - EXPECT_EQ(last_msg_.certificate_bytes[238], 202) << "incorrect value for last_msg_.certificate_bytes[238], expected 202, is " << last_msg_.certificate_bytes[238]; - EXPECT_EQ(last_msg_.certificate_bytes[239], 238) << "incorrect value for last_msg_.certificate_bytes[239], expected 238, is " << last_msg_.certificate_bytes[239]; - EXPECT_EQ(last_msg_.certificate_bytes[240], 88) << "incorrect value for last_msg_.certificate_bytes[240], expected 88, is " << last_msg_.certificate_bytes[240]; - EXPECT_EQ(last_msg_.certificate_bytes[241], 209) << "incorrect value for last_msg_.certificate_bytes[241], expected 209, is " << last_msg_.certificate_bytes[241]; - EXPECT_EQ(last_msg_.certificate_bytes[242], 70) << "incorrect value for last_msg_.certificate_bytes[242], expected 70, is " << last_msg_.certificate_bytes[242]; - EXPECT_EQ(last_msg_.certificate_bytes[243], 63) << "incorrect value for last_msg_.certificate_bytes[243], expected 63, is " << last_msg_.certificate_bytes[243]; - EXPECT_EQ(last_msg_.certificate_bytes[244], 151) << "incorrect value for last_msg_.certificate_bytes[244], expected 151, is " << last_msg_.certificate_bytes[244]; - EXPECT_EQ(last_msg_.certificate_bytes[245], 27) << "incorrect value for last_msg_.certificate_bytes[245], expected 27, is " << last_msg_.certificate_bytes[245]; - EXPECT_EQ(last_msg_.certificate_bytes[246], 102) << "incorrect value for last_msg_.certificate_bytes[246], expected 102, is " << last_msg_.certificate_bytes[246]; - EXPECT_EQ(last_msg_.certificate_id[0], 10) << "incorrect value for last_msg_.certificate_id[0], expected 10, is " << last_msg_.certificate_id[0]; - EXPECT_EQ(last_msg_.certificate_id[1], 11) << "incorrect value for last_msg_.certificate_id[1], expected 11, is " << last_msg_.certificate_id[1]; - EXPECT_EQ(last_msg_.certificate_id[2], 12) << "incorrect value for last_msg_.certificate_id[2], expected 12, is " << last_msg_.certificate_id[2]; - EXPECT_EQ(last_msg_.certificate_id[3], 13) << "incorrect value for last_msg_.certificate_id[3], expected 13, is " << last_msg_.certificate_id[3]; - EXPECT_EQ(last_msg_.flags, 2) << "incorrect value for last_msg_.flags, expected 2, is " << last_msg_.flags; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_certificate_bytes.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_certificate_bytes.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_certificate_bytes.handle_as << "'"; - } - { - const char check_string[] = { (char)99,(char)101,(char)114,(char)116,(char)105,(char)102,(char)105,(char)99,(char)97,(char)116,(char)101,(char)95,(char)98,(char)121,(char)116,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_certificate_bytes.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_certificate_bytes.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_certificate_bytes.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_certificate_bytes.value, 247) << "incorrect value for last_msg_.n_certificate_bytes.value, expected 247, is " << last_msg_.n_certificate_bytes.value; - EXPECT_EQ(last_msg_.n_msg, 48) << "incorrect value for last_msg_.n_msg, expected 48, is " << last_msg_.n_msg; +}; + +TEST_F(Test_auto_check_sbp_signing_MsgEcdsaCertificate0, Test) { + uint8_t encoded_frame[] = { + 85, 4, 12, 66, 0, 253, 48, 10, 11, 12, 13, 2, 180, 160, 116, + 77, 243, 28, 173, 36, 86, 33, 8, 31, 120, 73, 64, 169, 148, 224, + 57, 95, 17, 40, 213, 92, 195, 146, 235, 228, 177, 101, 82, 182, 25, + 172, 170, 250, 236, 7, 119, 4, 201, 10, 14, 208, 47, 126, 49, 210, + 174, 75, 221, 203, 24, 66, 52, 35, 26, 30, 140, 111, 246, 39, 226, + 205, 198, 178, 196, 5, 81, 9, 44, 164, 163, 214, 138, 123, 76, 74, + 237, 121, 13, 137, 186, 97, 193, 189, 200, 124, 69, 115, 230, 159, 185, + 158, 51, 12, 225, 65, 192, 105, 56, 41, 85, 133, 19, 217, 166, 48, + 139, 131, 96, 216, 98, 147, 132, 234, 167, 248, 247, 32, 239, 194, 188, + 254, 114, 117, 83, 25, 251, 191, 104, 240, 118, 68, 42, 93, 18, 16, + 37, 232, 99, 179, 23, 90, 94, 136, 6, 125, 91, 255, 15, 71, 43, + 46, 25, 252, 229, 80, 143, 58, 241, 11, 62, 181, 155, 53, 153, 149, + 152, 227, 150, 87, 112, 165, 2, 128, 231, 25, 157, 244, 204, 108, 253, + 127, 122, 145, 113, 162, 197, 171, 199, 54, 184, 222, 206, 67, 144, 78, + 187, 207, 60, 211, 141, 135, 106, 220, 79, 183, 245, 21, 161, 168, 34, + 129, 50, 176, 1, 218, 20, 130, 59, 249, 109, 219, 0, 100, 103, 55, + 29, 242, 110, 154, 190, 233, 142, 45, 61, 215, 202, 238, 88, 209, 70, + 63, 151, 27, 102, 219, 30, + }; + + sbp_msg_ecdsa_certificate_t test_msg{}; + + test_msg.certificate_bytes[0] = 180; + + test_msg.certificate_bytes[1] = 160; + + test_msg.certificate_bytes[2] = 116; + + test_msg.certificate_bytes[3] = 77; + + test_msg.certificate_bytes[4] = 243; + + test_msg.certificate_bytes[5] = 28; + + test_msg.certificate_bytes[6] = 173; + + test_msg.certificate_bytes[7] = 36; + + test_msg.certificate_bytes[8] = 86; + + test_msg.certificate_bytes[9] = 33; + + test_msg.certificate_bytes[10] = 8; + + test_msg.certificate_bytes[11] = 31; + + test_msg.certificate_bytes[12] = 120; + + test_msg.certificate_bytes[13] = 73; + + test_msg.certificate_bytes[14] = 64; + + test_msg.certificate_bytes[15] = 169; + + test_msg.certificate_bytes[16] = 148; + + test_msg.certificate_bytes[17] = 224; + + test_msg.certificate_bytes[18] = 57; + + test_msg.certificate_bytes[19] = 95; + + test_msg.certificate_bytes[20] = 17; + + test_msg.certificate_bytes[21] = 40; + + test_msg.certificate_bytes[22] = 213; + + test_msg.certificate_bytes[23] = 92; + + test_msg.certificate_bytes[24] = 195; + + test_msg.certificate_bytes[25] = 146; + + test_msg.certificate_bytes[26] = 235; + + test_msg.certificate_bytes[27] = 228; + + test_msg.certificate_bytes[28] = 177; + + test_msg.certificate_bytes[29] = 101; + + test_msg.certificate_bytes[30] = 82; + + test_msg.certificate_bytes[31] = 182; + + test_msg.certificate_bytes[32] = 25; + + test_msg.certificate_bytes[33] = 172; + + test_msg.certificate_bytes[34] = 170; + + test_msg.certificate_bytes[35] = 250; + + test_msg.certificate_bytes[36] = 236; + + test_msg.certificate_bytes[37] = 7; + + test_msg.certificate_bytes[38] = 119; + + test_msg.certificate_bytes[39] = 4; + + test_msg.certificate_bytes[40] = 201; + + test_msg.certificate_bytes[41] = 10; + + test_msg.certificate_bytes[42] = 14; + + test_msg.certificate_bytes[43] = 208; + + test_msg.certificate_bytes[44] = 47; + + test_msg.certificate_bytes[45] = 126; + + test_msg.certificate_bytes[46] = 49; + + test_msg.certificate_bytes[47] = 210; + + test_msg.certificate_bytes[48] = 174; + + test_msg.certificate_bytes[49] = 75; + + test_msg.certificate_bytes[50] = 221; + + test_msg.certificate_bytes[51] = 203; + + test_msg.certificate_bytes[52] = 24; + + test_msg.certificate_bytes[53] = 66; + + test_msg.certificate_bytes[54] = 52; + + test_msg.certificate_bytes[55] = 35; + + test_msg.certificate_bytes[56] = 26; + + test_msg.certificate_bytes[57] = 30; + + test_msg.certificate_bytes[58] = 140; + + test_msg.certificate_bytes[59] = 111; + + test_msg.certificate_bytes[60] = 246; + + test_msg.certificate_bytes[61] = 39; + + test_msg.certificate_bytes[62] = 226; + + test_msg.certificate_bytes[63] = 205; + + test_msg.certificate_bytes[64] = 198; + + test_msg.certificate_bytes[65] = 178; + + test_msg.certificate_bytes[66] = 196; + + test_msg.certificate_bytes[67] = 5; + + test_msg.certificate_bytes[68] = 81; + + test_msg.certificate_bytes[69] = 9; + + test_msg.certificate_bytes[70] = 44; + + test_msg.certificate_bytes[71] = 164; + + test_msg.certificate_bytes[72] = 163; + + test_msg.certificate_bytes[73] = 214; + + test_msg.certificate_bytes[74] = 138; + + test_msg.certificate_bytes[75] = 123; + + test_msg.certificate_bytes[76] = 76; + + test_msg.certificate_bytes[77] = 74; + + test_msg.certificate_bytes[78] = 237; + + test_msg.certificate_bytes[79] = 121; + + test_msg.certificate_bytes[80] = 13; + + test_msg.certificate_bytes[81] = 137; + + test_msg.certificate_bytes[82] = 186; + + test_msg.certificate_bytes[83] = 97; + + test_msg.certificate_bytes[84] = 193; + + test_msg.certificate_bytes[85] = 189; + + test_msg.certificate_bytes[86] = 200; + + test_msg.certificate_bytes[87] = 124; + + test_msg.certificate_bytes[88] = 69; + + test_msg.certificate_bytes[89] = 115; + + test_msg.certificate_bytes[90] = 230; + + test_msg.certificate_bytes[91] = 159; + + test_msg.certificate_bytes[92] = 185; + + test_msg.certificate_bytes[93] = 158; + + test_msg.certificate_bytes[94] = 51; + + test_msg.certificate_bytes[95] = 12; + + test_msg.certificate_bytes[96] = 225; + + test_msg.certificate_bytes[97] = 65; + + test_msg.certificate_bytes[98] = 192; + + test_msg.certificate_bytes[99] = 105; + + test_msg.certificate_bytes[100] = 56; + + test_msg.certificate_bytes[101] = 41; + + test_msg.certificate_bytes[102] = 85; + + test_msg.certificate_bytes[103] = 133; + + test_msg.certificate_bytes[104] = 19; + + test_msg.certificate_bytes[105] = 217; + + test_msg.certificate_bytes[106] = 166; + + test_msg.certificate_bytes[107] = 48; + + test_msg.certificate_bytes[108] = 139; + + test_msg.certificate_bytes[109] = 131; + + test_msg.certificate_bytes[110] = 96; + + test_msg.certificate_bytes[111] = 216; + + test_msg.certificate_bytes[112] = 98; + + test_msg.certificate_bytes[113] = 147; + + test_msg.certificate_bytes[114] = 132; + + test_msg.certificate_bytes[115] = 234; + + test_msg.certificate_bytes[116] = 167; + + test_msg.certificate_bytes[117] = 248; + + test_msg.certificate_bytes[118] = 247; + + test_msg.certificate_bytes[119] = 32; + + test_msg.certificate_bytes[120] = 239; + + test_msg.certificate_bytes[121] = 194; + + test_msg.certificate_bytes[122] = 188; + + test_msg.certificate_bytes[123] = 254; + + test_msg.certificate_bytes[124] = 114; + + test_msg.certificate_bytes[125] = 117; + + test_msg.certificate_bytes[126] = 83; + + test_msg.certificate_bytes[127] = 25; + + test_msg.certificate_bytes[128] = 251; + + test_msg.certificate_bytes[129] = 191; + + test_msg.certificate_bytes[130] = 104; + + test_msg.certificate_bytes[131] = 240; + + test_msg.certificate_bytes[132] = 118; + + test_msg.certificate_bytes[133] = 68; + + test_msg.certificate_bytes[134] = 42; + + test_msg.certificate_bytes[135] = 93; + + test_msg.certificate_bytes[136] = 18; + + test_msg.certificate_bytes[137] = 16; + + test_msg.certificate_bytes[138] = 37; + + test_msg.certificate_bytes[139] = 232; + + test_msg.certificate_bytes[140] = 99; + + test_msg.certificate_bytes[141] = 179; + + test_msg.certificate_bytes[142] = 23; + + test_msg.certificate_bytes[143] = 90; + + test_msg.certificate_bytes[144] = 94; + + test_msg.certificate_bytes[145] = 136; + + test_msg.certificate_bytes[146] = 6; + + test_msg.certificate_bytes[147] = 125; + + test_msg.certificate_bytes[148] = 91; + + test_msg.certificate_bytes[149] = 255; + + test_msg.certificate_bytes[150] = 15; + + test_msg.certificate_bytes[151] = 71; + + test_msg.certificate_bytes[152] = 43; + + test_msg.certificate_bytes[153] = 46; + + test_msg.certificate_bytes[154] = 25; + + test_msg.certificate_bytes[155] = 252; + + test_msg.certificate_bytes[156] = 229; + + test_msg.certificate_bytes[157] = 80; + + test_msg.certificate_bytes[158] = 143; + + test_msg.certificate_bytes[159] = 58; + + test_msg.certificate_bytes[160] = 241; + + test_msg.certificate_bytes[161] = 11; + + test_msg.certificate_bytes[162] = 62; + + test_msg.certificate_bytes[163] = 181; + + test_msg.certificate_bytes[164] = 155; + + test_msg.certificate_bytes[165] = 53; + + test_msg.certificate_bytes[166] = 153; + + test_msg.certificate_bytes[167] = 149; + + test_msg.certificate_bytes[168] = 152; + + test_msg.certificate_bytes[169] = 227; + + test_msg.certificate_bytes[170] = 150; + + test_msg.certificate_bytes[171] = 87; + + test_msg.certificate_bytes[172] = 112; + + test_msg.certificate_bytes[173] = 165; + + test_msg.certificate_bytes[174] = 2; + + test_msg.certificate_bytes[175] = 128; + + test_msg.certificate_bytes[176] = 231; + + test_msg.certificate_bytes[177] = 25; + + test_msg.certificate_bytes[178] = 157; + + test_msg.certificate_bytes[179] = 244; + + test_msg.certificate_bytes[180] = 204; + + test_msg.certificate_bytes[181] = 108; + + test_msg.certificate_bytes[182] = 253; + + test_msg.certificate_bytes[183] = 127; + + test_msg.certificate_bytes[184] = 122; + + test_msg.certificate_bytes[185] = 145; + + test_msg.certificate_bytes[186] = 113; + + test_msg.certificate_bytes[187] = 162; + + test_msg.certificate_bytes[188] = 197; + + test_msg.certificate_bytes[189] = 171; + + test_msg.certificate_bytes[190] = 199; + + test_msg.certificate_bytes[191] = 54; + + test_msg.certificate_bytes[192] = 184; + + test_msg.certificate_bytes[193] = 222; + + test_msg.certificate_bytes[194] = 206; + + test_msg.certificate_bytes[195] = 67; + + test_msg.certificate_bytes[196] = 144; + + test_msg.certificate_bytes[197] = 78; + + test_msg.certificate_bytes[198] = 187; + + test_msg.certificate_bytes[199] = 207; + + test_msg.certificate_bytes[200] = 60; + + test_msg.certificate_bytes[201] = 211; + + test_msg.certificate_bytes[202] = 141; + + test_msg.certificate_bytes[203] = 135; + + test_msg.certificate_bytes[204] = 106; + + test_msg.certificate_bytes[205] = 220; + + test_msg.certificate_bytes[206] = 79; + + test_msg.certificate_bytes[207] = 183; + + test_msg.certificate_bytes[208] = 245; + + test_msg.certificate_bytes[209] = 21; + + test_msg.certificate_bytes[210] = 161; + + test_msg.certificate_bytes[211] = 168; + + test_msg.certificate_bytes[212] = 34; + + test_msg.certificate_bytes[213] = 129; + + test_msg.certificate_bytes[214] = 50; + + test_msg.certificate_bytes[215] = 176; + + test_msg.certificate_bytes[216] = 1; + + test_msg.certificate_bytes[217] = 218; + + test_msg.certificate_bytes[218] = 20; + + test_msg.certificate_bytes[219] = 130; + + test_msg.certificate_bytes[220] = 59; + + test_msg.certificate_bytes[221] = 249; + + test_msg.certificate_bytes[222] = 109; + + test_msg.certificate_bytes[223] = 219; + + test_msg.certificate_bytes[224] = 0; + + test_msg.certificate_bytes[225] = 100; + + test_msg.certificate_bytes[226] = 103; + + test_msg.certificate_bytes[227] = 55; + + test_msg.certificate_bytes[228] = 29; + + test_msg.certificate_bytes[229] = 242; + + test_msg.certificate_bytes[230] = 110; + + test_msg.certificate_bytes[231] = 154; + + test_msg.certificate_bytes[232] = 190; + + test_msg.certificate_bytes[233] = 233; + + test_msg.certificate_bytes[234] = 142; + + test_msg.certificate_bytes[235] = 45; + + test_msg.certificate_bytes[236] = 61; + + test_msg.certificate_bytes[237] = 215; + + test_msg.certificate_bytes[238] = 202; + + test_msg.certificate_bytes[239] = 238; + + test_msg.certificate_bytes[240] = 88; + + test_msg.certificate_bytes[241] = 209; + + test_msg.certificate_bytes[242] = 70; + + test_msg.certificate_bytes[243] = 63; + + test_msg.certificate_bytes[244] = 151; + + test_msg.certificate_bytes[245] = 27; + + test_msg.certificate_bytes[246] = 102; + + test_msg.certificate_id[0] = 10; + + test_msg.certificate_id[1] = 11; + + test_msg.certificate_id[2] = 12; + + test_msg.certificate_id[3] = 13; + test_msg.flags = 2; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_certificate_bytes.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = { + (char)99, (char)101, (char)114, (char)116, (char)105, (char)102, + (char)105, (char)99, (char)97, (char)116, (char)101, (char)95, + (char)98, (char)121, (char)116, (char)101, (char)115}; + memcpy(test_msg.n_certificate_bytes.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_certificate_bytes.value = 247; + test_msg.n_msg = 48; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.certificate_bytes[0], 180) + << "incorrect value for last_msg_.certificate_bytes[0], expected 180, is " + << last_msg_.certificate_bytes[0]; + EXPECT_EQ(last_msg_.certificate_bytes[1], 160) + << "incorrect value for last_msg_.certificate_bytes[1], expected 160, is " + << last_msg_.certificate_bytes[1]; + EXPECT_EQ(last_msg_.certificate_bytes[2], 116) + << "incorrect value for last_msg_.certificate_bytes[2], expected 116, is " + << last_msg_.certificate_bytes[2]; + EXPECT_EQ(last_msg_.certificate_bytes[3], 77) + << "incorrect value for last_msg_.certificate_bytes[3], expected 77, is " + << last_msg_.certificate_bytes[3]; + EXPECT_EQ(last_msg_.certificate_bytes[4], 243) + << "incorrect value for last_msg_.certificate_bytes[4], expected 243, is " + << last_msg_.certificate_bytes[4]; + EXPECT_EQ(last_msg_.certificate_bytes[5], 28) + << "incorrect value for last_msg_.certificate_bytes[5], expected 28, is " + << last_msg_.certificate_bytes[5]; + EXPECT_EQ(last_msg_.certificate_bytes[6], 173) + << "incorrect value for last_msg_.certificate_bytes[6], expected 173, is " + << last_msg_.certificate_bytes[6]; + EXPECT_EQ(last_msg_.certificate_bytes[7], 36) + << "incorrect value for last_msg_.certificate_bytes[7], expected 36, is " + << last_msg_.certificate_bytes[7]; + EXPECT_EQ(last_msg_.certificate_bytes[8], 86) + << "incorrect value for last_msg_.certificate_bytes[8], expected 86, is " + << last_msg_.certificate_bytes[8]; + EXPECT_EQ(last_msg_.certificate_bytes[9], 33) + << "incorrect value for last_msg_.certificate_bytes[9], expected 33, is " + << last_msg_.certificate_bytes[9]; + EXPECT_EQ(last_msg_.certificate_bytes[10], 8) + << "incorrect value for last_msg_.certificate_bytes[10], expected 8, is " + << last_msg_.certificate_bytes[10]; + EXPECT_EQ(last_msg_.certificate_bytes[11], 31) + << "incorrect value for last_msg_.certificate_bytes[11], expected 31, is " + << last_msg_.certificate_bytes[11]; + EXPECT_EQ(last_msg_.certificate_bytes[12], 120) + << "incorrect value for last_msg_.certificate_bytes[12], expected 120, " + "is " + << last_msg_.certificate_bytes[12]; + EXPECT_EQ(last_msg_.certificate_bytes[13], 73) + << "incorrect value for last_msg_.certificate_bytes[13], expected 73, is " + << last_msg_.certificate_bytes[13]; + EXPECT_EQ(last_msg_.certificate_bytes[14], 64) + << "incorrect value for last_msg_.certificate_bytes[14], expected 64, is " + << last_msg_.certificate_bytes[14]; + EXPECT_EQ(last_msg_.certificate_bytes[15], 169) + << "incorrect value for last_msg_.certificate_bytes[15], expected 169, " + "is " + << last_msg_.certificate_bytes[15]; + EXPECT_EQ(last_msg_.certificate_bytes[16], 148) + << "incorrect value for last_msg_.certificate_bytes[16], expected 148, " + "is " + << last_msg_.certificate_bytes[16]; + EXPECT_EQ(last_msg_.certificate_bytes[17], 224) + << "incorrect value for last_msg_.certificate_bytes[17], expected 224, " + "is " + << last_msg_.certificate_bytes[17]; + EXPECT_EQ(last_msg_.certificate_bytes[18], 57) + << "incorrect value for last_msg_.certificate_bytes[18], expected 57, is " + << last_msg_.certificate_bytes[18]; + EXPECT_EQ(last_msg_.certificate_bytes[19], 95) + << "incorrect value for last_msg_.certificate_bytes[19], expected 95, is " + << last_msg_.certificate_bytes[19]; + EXPECT_EQ(last_msg_.certificate_bytes[20], 17) + << "incorrect value for last_msg_.certificate_bytes[20], expected 17, is " + << last_msg_.certificate_bytes[20]; + EXPECT_EQ(last_msg_.certificate_bytes[21], 40) + << "incorrect value for last_msg_.certificate_bytes[21], expected 40, is " + << last_msg_.certificate_bytes[21]; + EXPECT_EQ(last_msg_.certificate_bytes[22], 213) + << "incorrect value for last_msg_.certificate_bytes[22], expected 213, " + "is " + << last_msg_.certificate_bytes[22]; + EXPECT_EQ(last_msg_.certificate_bytes[23], 92) + << "incorrect value for last_msg_.certificate_bytes[23], expected 92, is " + << last_msg_.certificate_bytes[23]; + EXPECT_EQ(last_msg_.certificate_bytes[24], 195) + << "incorrect value for last_msg_.certificate_bytes[24], expected 195, " + "is " + << last_msg_.certificate_bytes[24]; + EXPECT_EQ(last_msg_.certificate_bytes[25], 146) + << "incorrect value for last_msg_.certificate_bytes[25], expected 146, " + "is " + << last_msg_.certificate_bytes[25]; + EXPECT_EQ(last_msg_.certificate_bytes[26], 235) + << "incorrect value for last_msg_.certificate_bytes[26], expected 235, " + "is " + << last_msg_.certificate_bytes[26]; + EXPECT_EQ(last_msg_.certificate_bytes[27], 228) + << "incorrect value for last_msg_.certificate_bytes[27], expected 228, " + "is " + << last_msg_.certificate_bytes[27]; + EXPECT_EQ(last_msg_.certificate_bytes[28], 177) + << "incorrect value for last_msg_.certificate_bytes[28], expected 177, " + "is " + << last_msg_.certificate_bytes[28]; + EXPECT_EQ(last_msg_.certificate_bytes[29], 101) + << "incorrect value for last_msg_.certificate_bytes[29], expected 101, " + "is " + << last_msg_.certificate_bytes[29]; + EXPECT_EQ(last_msg_.certificate_bytes[30], 82) + << "incorrect value for last_msg_.certificate_bytes[30], expected 82, is " + << last_msg_.certificate_bytes[30]; + EXPECT_EQ(last_msg_.certificate_bytes[31], 182) + << "incorrect value for last_msg_.certificate_bytes[31], expected 182, " + "is " + << last_msg_.certificate_bytes[31]; + EXPECT_EQ(last_msg_.certificate_bytes[32], 25) + << "incorrect value for last_msg_.certificate_bytes[32], expected 25, is " + << last_msg_.certificate_bytes[32]; + EXPECT_EQ(last_msg_.certificate_bytes[33], 172) + << "incorrect value for last_msg_.certificate_bytes[33], expected 172, " + "is " + << last_msg_.certificate_bytes[33]; + EXPECT_EQ(last_msg_.certificate_bytes[34], 170) + << "incorrect value for last_msg_.certificate_bytes[34], expected 170, " + "is " + << last_msg_.certificate_bytes[34]; + EXPECT_EQ(last_msg_.certificate_bytes[35], 250) + << "incorrect value for last_msg_.certificate_bytes[35], expected 250, " + "is " + << last_msg_.certificate_bytes[35]; + EXPECT_EQ(last_msg_.certificate_bytes[36], 236) + << "incorrect value for last_msg_.certificate_bytes[36], expected 236, " + "is " + << last_msg_.certificate_bytes[36]; + EXPECT_EQ(last_msg_.certificate_bytes[37], 7) + << "incorrect value for last_msg_.certificate_bytes[37], expected 7, is " + << last_msg_.certificate_bytes[37]; + EXPECT_EQ(last_msg_.certificate_bytes[38], 119) + << "incorrect value for last_msg_.certificate_bytes[38], expected 119, " + "is " + << last_msg_.certificate_bytes[38]; + EXPECT_EQ(last_msg_.certificate_bytes[39], 4) + << "incorrect value for last_msg_.certificate_bytes[39], expected 4, is " + << last_msg_.certificate_bytes[39]; + EXPECT_EQ(last_msg_.certificate_bytes[40], 201) + << "incorrect value for last_msg_.certificate_bytes[40], expected 201, " + "is " + << last_msg_.certificate_bytes[40]; + EXPECT_EQ(last_msg_.certificate_bytes[41], 10) + << "incorrect value for last_msg_.certificate_bytes[41], expected 10, is " + << last_msg_.certificate_bytes[41]; + EXPECT_EQ(last_msg_.certificate_bytes[42], 14) + << "incorrect value for last_msg_.certificate_bytes[42], expected 14, is " + << last_msg_.certificate_bytes[42]; + EXPECT_EQ(last_msg_.certificate_bytes[43], 208) + << "incorrect value for last_msg_.certificate_bytes[43], expected 208, " + "is " + << last_msg_.certificate_bytes[43]; + EXPECT_EQ(last_msg_.certificate_bytes[44], 47) + << "incorrect value for last_msg_.certificate_bytes[44], expected 47, is " + << last_msg_.certificate_bytes[44]; + EXPECT_EQ(last_msg_.certificate_bytes[45], 126) + << "incorrect value for last_msg_.certificate_bytes[45], expected 126, " + "is " + << last_msg_.certificate_bytes[45]; + EXPECT_EQ(last_msg_.certificate_bytes[46], 49) + << "incorrect value for last_msg_.certificate_bytes[46], expected 49, is " + << last_msg_.certificate_bytes[46]; + EXPECT_EQ(last_msg_.certificate_bytes[47], 210) + << "incorrect value for last_msg_.certificate_bytes[47], expected 210, " + "is " + << last_msg_.certificate_bytes[47]; + EXPECT_EQ(last_msg_.certificate_bytes[48], 174) + << "incorrect value for last_msg_.certificate_bytes[48], expected 174, " + "is " + << last_msg_.certificate_bytes[48]; + EXPECT_EQ(last_msg_.certificate_bytes[49], 75) + << "incorrect value for last_msg_.certificate_bytes[49], expected 75, is " + << last_msg_.certificate_bytes[49]; + EXPECT_EQ(last_msg_.certificate_bytes[50], 221) + << "incorrect value for last_msg_.certificate_bytes[50], expected 221, " + "is " + << last_msg_.certificate_bytes[50]; + EXPECT_EQ(last_msg_.certificate_bytes[51], 203) + << "incorrect value for last_msg_.certificate_bytes[51], expected 203, " + "is " + << last_msg_.certificate_bytes[51]; + EXPECT_EQ(last_msg_.certificate_bytes[52], 24) + << "incorrect value for last_msg_.certificate_bytes[52], expected 24, is " + << last_msg_.certificate_bytes[52]; + EXPECT_EQ(last_msg_.certificate_bytes[53], 66) + << "incorrect value for last_msg_.certificate_bytes[53], expected 66, is " + << last_msg_.certificate_bytes[53]; + EXPECT_EQ(last_msg_.certificate_bytes[54], 52) + << "incorrect value for last_msg_.certificate_bytes[54], expected 52, is " + << last_msg_.certificate_bytes[54]; + EXPECT_EQ(last_msg_.certificate_bytes[55], 35) + << "incorrect value for last_msg_.certificate_bytes[55], expected 35, is " + << last_msg_.certificate_bytes[55]; + EXPECT_EQ(last_msg_.certificate_bytes[56], 26) + << "incorrect value for last_msg_.certificate_bytes[56], expected 26, is " + << last_msg_.certificate_bytes[56]; + EXPECT_EQ(last_msg_.certificate_bytes[57], 30) + << "incorrect value for last_msg_.certificate_bytes[57], expected 30, is " + << last_msg_.certificate_bytes[57]; + EXPECT_EQ(last_msg_.certificate_bytes[58], 140) + << "incorrect value for last_msg_.certificate_bytes[58], expected 140, " + "is " + << last_msg_.certificate_bytes[58]; + EXPECT_EQ(last_msg_.certificate_bytes[59], 111) + << "incorrect value for last_msg_.certificate_bytes[59], expected 111, " + "is " + << last_msg_.certificate_bytes[59]; + EXPECT_EQ(last_msg_.certificate_bytes[60], 246) + << "incorrect value for last_msg_.certificate_bytes[60], expected 246, " + "is " + << last_msg_.certificate_bytes[60]; + EXPECT_EQ(last_msg_.certificate_bytes[61], 39) + << "incorrect value for last_msg_.certificate_bytes[61], expected 39, is " + << last_msg_.certificate_bytes[61]; + EXPECT_EQ(last_msg_.certificate_bytes[62], 226) + << "incorrect value for last_msg_.certificate_bytes[62], expected 226, " + "is " + << last_msg_.certificate_bytes[62]; + EXPECT_EQ(last_msg_.certificate_bytes[63], 205) + << "incorrect value for last_msg_.certificate_bytes[63], expected 205, " + "is " + << last_msg_.certificate_bytes[63]; + EXPECT_EQ(last_msg_.certificate_bytes[64], 198) + << "incorrect value for last_msg_.certificate_bytes[64], expected 198, " + "is " + << last_msg_.certificate_bytes[64]; + EXPECT_EQ(last_msg_.certificate_bytes[65], 178) + << "incorrect value for last_msg_.certificate_bytes[65], expected 178, " + "is " + << last_msg_.certificate_bytes[65]; + EXPECT_EQ(last_msg_.certificate_bytes[66], 196) + << "incorrect value for last_msg_.certificate_bytes[66], expected 196, " + "is " + << last_msg_.certificate_bytes[66]; + EXPECT_EQ(last_msg_.certificate_bytes[67], 5) + << "incorrect value for last_msg_.certificate_bytes[67], expected 5, is " + << last_msg_.certificate_bytes[67]; + EXPECT_EQ(last_msg_.certificate_bytes[68], 81) + << "incorrect value for last_msg_.certificate_bytes[68], expected 81, is " + << last_msg_.certificate_bytes[68]; + EXPECT_EQ(last_msg_.certificate_bytes[69], 9) + << "incorrect value for last_msg_.certificate_bytes[69], expected 9, is " + << last_msg_.certificate_bytes[69]; + EXPECT_EQ(last_msg_.certificate_bytes[70], 44) + << "incorrect value for last_msg_.certificate_bytes[70], expected 44, is " + << last_msg_.certificate_bytes[70]; + EXPECT_EQ(last_msg_.certificate_bytes[71], 164) + << "incorrect value for last_msg_.certificate_bytes[71], expected 164, " + "is " + << last_msg_.certificate_bytes[71]; + EXPECT_EQ(last_msg_.certificate_bytes[72], 163) + << "incorrect value for last_msg_.certificate_bytes[72], expected 163, " + "is " + << last_msg_.certificate_bytes[72]; + EXPECT_EQ(last_msg_.certificate_bytes[73], 214) + << "incorrect value for last_msg_.certificate_bytes[73], expected 214, " + "is " + << last_msg_.certificate_bytes[73]; + EXPECT_EQ(last_msg_.certificate_bytes[74], 138) + << "incorrect value for last_msg_.certificate_bytes[74], expected 138, " + "is " + << last_msg_.certificate_bytes[74]; + EXPECT_EQ(last_msg_.certificate_bytes[75], 123) + << "incorrect value for last_msg_.certificate_bytes[75], expected 123, " + "is " + << last_msg_.certificate_bytes[75]; + EXPECT_EQ(last_msg_.certificate_bytes[76], 76) + << "incorrect value for last_msg_.certificate_bytes[76], expected 76, is " + << last_msg_.certificate_bytes[76]; + EXPECT_EQ(last_msg_.certificate_bytes[77], 74) + << "incorrect value for last_msg_.certificate_bytes[77], expected 74, is " + << last_msg_.certificate_bytes[77]; + EXPECT_EQ(last_msg_.certificate_bytes[78], 237) + << "incorrect value for last_msg_.certificate_bytes[78], expected 237, " + "is " + << last_msg_.certificate_bytes[78]; + EXPECT_EQ(last_msg_.certificate_bytes[79], 121) + << "incorrect value for last_msg_.certificate_bytes[79], expected 121, " + "is " + << last_msg_.certificate_bytes[79]; + EXPECT_EQ(last_msg_.certificate_bytes[80], 13) + << "incorrect value for last_msg_.certificate_bytes[80], expected 13, is " + << last_msg_.certificate_bytes[80]; + EXPECT_EQ(last_msg_.certificate_bytes[81], 137) + << "incorrect value for last_msg_.certificate_bytes[81], expected 137, " + "is " + << last_msg_.certificate_bytes[81]; + EXPECT_EQ(last_msg_.certificate_bytes[82], 186) + << "incorrect value for last_msg_.certificate_bytes[82], expected 186, " + "is " + << last_msg_.certificate_bytes[82]; + EXPECT_EQ(last_msg_.certificate_bytes[83], 97) + << "incorrect value for last_msg_.certificate_bytes[83], expected 97, is " + << last_msg_.certificate_bytes[83]; + EXPECT_EQ(last_msg_.certificate_bytes[84], 193) + << "incorrect value for last_msg_.certificate_bytes[84], expected 193, " + "is " + << last_msg_.certificate_bytes[84]; + EXPECT_EQ(last_msg_.certificate_bytes[85], 189) + << "incorrect value for last_msg_.certificate_bytes[85], expected 189, " + "is " + << last_msg_.certificate_bytes[85]; + EXPECT_EQ(last_msg_.certificate_bytes[86], 200) + << "incorrect value for last_msg_.certificate_bytes[86], expected 200, " + "is " + << last_msg_.certificate_bytes[86]; + EXPECT_EQ(last_msg_.certificate_bytes[87], 124) + << "incorrect value for last_msg_.certificate_bytes[87], expected 124, " + "is " + << last_msg_.certificate_bytes[87]; + EXPECT_EQ(last_msg_.certificate_bytes[88], 69) + << "incorrect value for last_msg_.certificate_bytes[88], expected 69, is " + << last_msg_.certificate_bytes[88]; + EXPECT_EQ(last_msg_.certificate_bytes[89], 115) + << "incorrect value for last_msg_.certificate_bytes[89], expected 115, " + "is " + << last_msg_.certificate_bytes[89]; + EXPECT_EQ(last_msg_.certificate_bytes[90], 230) + << "incorrect value for last_msg_.certificate_bytes[90], expected 230, " + "is " + << last_msg_.certificate_bytes[90]; + EXPECT_EQ(last_msg_.certificate_bytes[91], 159) + << "incorrect value for last_msg_.certificate_bytes[91], expected 159, " + "is " + << last_msg_.certificate_bytes[91]; + EXPECT_EQ(last_msg_.certificate_bytes[92], 185) + << "incorrect value for last_msg_.certificate_bytes[92], expected 185, " + "is " + << last_msg_.certificate_bytes[92]; + EXPECT_EQ(last_msg_.certificate_bytes[93], 158) + << "incorrect value for last_msg_.certificate_bytes[93], expected 158, " + "is " + << last_msg_.certificate_bytes[93]; + EXPECT_EQ(last_msg_.certificate_bytes[94], 51) + << "incorrect value for last_msg_.certificate_bytes[94], expected 51, is " + << last_msg_.certificate_bytes[94]; + EXPECT_EQ(last_msg_.certificate_bytes[95], 12) + << "incorrect value for last_msg_.certificate_bytes[95], expected 12, is " + << last_msg_.certificate_bytes[95]; + EXPECT_EQ(last_msg_.certificate_bytes[96], 225) + << "incorrect value for last_msg_.certificate_bytes[96], expected 225, " + "is " + << last_msg_.certificate_bytes[96]; + EXPECT_EQ(last_msg_.certificate_bytes[97], 65) + << "incorrect value for last_msg_.certificate_bytes[97], expected 65, is " + << last_msg_.certificate_bytes[97]; + EXPECT_EQ(last_msg_.certificate_bytes[98], 192) + << "incorrect value for last_msg_.certificate_bytes[98], expected 192, " + "is " + << last_msg_.certificate_bytes[98]; + EXPECT_EQ(last_msg_.certificate_bytes[99], 105) + << "incorrect value for last_msg_.certificate_bytes[99], expected 105, " + "is " + << last_msg_.certificate_bytes[99]; + EXPECT_EQ(last_msg_.certificate_bytes[100], 56) + << "incorrect value for last_msg_.certificate_bytes[100], expected 56, " + "is " + << last_msg_.certificate_bytes[100]; + EXPECT_EQ(last_msg_.certificate_bytes[101], 41) + << "incorrect value for last_msg_.certificate_bytes[101], expected 41, " + "is " + << last_msg_.certificate_bytes[101]; + EXPECT_EQ(last_msg_.certificate_bytes[102], 85) + << "incorrect value for last_msg_.certificate_bytes[102], expected 85, " + "is " + << last_msg_.certificate_bytes[102]; + EXPECT_EQ(last_msg_.certificate_bytes[103], 133) + << "incorrect value for last_msg_.certificate_bytes[103], expected 133, " + "is " + << last_msg_.certificate_bytes[103]; + EXPECT_EQ(last_msg_.certificate_bytes[104], 19) + << "incorrect value for last_msg_.certificate_bytes[104], expected 19, " + "is " + << last_msg_.certificate_bytes[104]; + EXPECT_EQ(last_msg_.certificate_bytes[105], 217) + << "incorrect value for last_msg_.certificate_bytes[105], expected 217, " + "is " + << last_msg_.certificate_bytes[105]; + EXPECT_EQ(last_msg_.certificate_bytes[106], 166) + << "incorrect value for last_msg_.certificate_bytes[106], expected 166, " + "is " + << last_msg_.certificate_bytes[106]; + EXPECT_EQ(last_msg_.certificate_bytes[107], 48) + << "incorrect value for last_msg_.certificate_bytes[107], expected 48, " + "is " + << last_msg_.certificate_bytes[107]; + EXPECT_EQ(last_msg_.certificate_bytes[108], 139) + << "incorrect value for last_msg_.certificate_bytes[108], expected 139, " + "is " + << last_msg_.certificate_bytes[108]; + EXPECT_EQ(last_msg_.certificate_bytes[109], 131) + << "incorrect value for last_msg_.certificate_bytes[109], expected 131, " + "is " + << last_msg_.certificate_bytes[109]; + EXPECT_EQ(last_msg_.certificate_bytes[110], 96) + << "incorrect value for last_msg_.certificate_bytes[110], expected 96, " + "is " + << last_msg_.certificate_bytes[110]; + EXPECT_EQ(last_msg_.certificate_bytes[111], 216) + << "incorrect value for last_msg_.certificate_bytes[111], expected 216, " + "is " + << last_msg_.certificate_bytes[111]; + EXPECT_EQ(last_msg_.certificate_bytes[112], 98) + << "incorrect value for last_msg_.certificate_bytes[112], expected 98, " + "is " + << last_msg_.certificate_bytes[112]; + EXPECT_EQ(last_msg_.certificate_bytes[113], 147) + << "incorrect value for last_msg_.certificate_bytes[113], expected 147, " + "is " + << last_msg_.certificate_bytes[113]; + EXPECT_EQ(last_msg_.certificate_bytes[114], 132) + << "incorrect value for last_msg_.certificate_bytes[114], expected 132, " + "is " + << last_msg_.certificate_bytes[114]; + EXPECT_EQ(last_msg_.certificate_bytes[115], 234) + << "incorrect value for last_msg_.certificate_bytes[115], expected 234, " + "is " + << last_msg_.certificate_bytes[115]; + EXPECT_EQ(last_msg_.certificate_bytes[116], 167) + << "incorrect value for last_msg_.certificate_bytes[116], expected 167, " + "is " + << last_msg_.certificate_bytes[116]; + EXPECT_EQ(last_msg_.certificate_bytes[117], 248) + << "incorrect value for last_msg_.certificate_bytes[117], expected 248, " + "is " + << last_msg_.certificate_bytes[117]; + EXPECT_EQ(last_msg_.certificate_bytes[118], 247) + << "incorrect value for last_msg_.certificate_bytes[118], expected 247, " + "is " + << last_msg_.certificate_bytes[118]; + EXPECT_EQ(last_msg_.certificate_bytes[119], 32) + << "incorrect value for last_msg_.certificate_bytes[119], expected 32, " + "is " + << last_msg_.certificate_bytes[119]; + EXPECT_EQ(last_msg_.certificate_bytes[120], 239) + << "incorrect value for last_msg_.certificate_bytes[120], expected 239, " + "is " + << last_msg_.certificate_bytes[120]; + EXPECT_EQ(last_msg_.certificate_bytes[121], 194) + << "incorrect value for last_msg_.certificate_bytes[121], expected 194, " + "is " + << last_msg_.certificate_bytes[121]; + EXPECT_EQ(last_msg_.certificate_bytes[122], 188) + << "incorrect value for last_msg_.certificate_bytes[122], expected 188, " + "is " + << last_msg_.certificate_bytes[122]; + EXPECT_EQ(last_msg_.certificate_bytes[123], 254) + << "incorrect value for last_msg_.certificate_bytes[123], expected 254, " + "is " + << last_msg_.certificate_bytes[123]; + EXPECT_EQ(last_msg_.certificate_bytes[124], 114) + << "incorrect value for last_msg_.certificate_bytes[124], expected 114, " + "is " + << last_msg_.certificate_bytes[124]; + EXPECT_EQ(last_msg_.certificate_bytes[125], 117) + << "incorrect value for last_msg_.certificate_bytes[125], expected 117, " + "is " + << last_msg_.certificate_bytes[125]; + EXPECT_EQ(last_msg_.certificate_bytes[126], 83) + << "incorrect value for last_msg_.certificate_bytes[126], expected 83, " + "is " + << last_msg_.certificate_bytes[126]; + EXPECT_EQ(last_msg_.certificate_bytes[127], 25) + << "incorrect value for last_msg_.certificate_bytes[127], expected 25, " + "is " + << last_msg_.certificate_bytes[127]; + EXPECT_EQ(last_msg_.certificate_bytes[128], 251) + << "incorrect value for last_msg_.certificate_bytes[128], expected 251, " + "is " + << last_msg_.certificate_bytes[128]; + EXPECT_EQ(last_msg_.certificate_bytes[129], 191) + << "incorrect value for last_msg_.certificate_bytes[129], expected 191, " + "is " + << last_msg_.certificate_bytes[129]; + EXPECT_EQ(last_msg_.certificate_bytes[130], 104) + << "incorrect value for last_msg_.certificate_bytes[130], expected 104, " + "is " + << last_msg_.certificate_bytes[130]; + EXPECT_EQ(last_msg_.certificate_bytes[131], 240) + << "incorrect value for last_msg_.certificate_bytes[131], expected 240, " + "is " + << last_msg_.certificate_bytes[131]; + EXPECT_EQ(last_msg_.certificate_bytes[132], 118) + << "incorrect value for last_msg_.certificate_bytes[132], expected 118, " + "is " + << last_msg_.certificate_bytes[132]; + EXPECT_EQ(last_msg_.certificate_bytes[133], 68) + << "incorrect value for last_msg_.certificate_bytes[133], expected 68, " + "is " + << last_msg_.certificate_bytes[133]; + EXPECT_EQ(last_msg_.certificate_bytes[134], 42) + << "incorrect value for last_msg_.certificate_bytes[134], expected 42, " + "is " + << last_msg_.certificate_bytes[134]; + EXPECT_EQ(last_msg_.certificate_bytes[135], 93) + << "incorrect value for last_msg_.certificate_bytes[135], expected 93, " + "is " + << last_msg_.certificate_bytes[135]; + EXPECT_EQ(last_msg_.certificate_bytes[136], 18) + << "incorrect value for last_msg_.certificate_bytes[136], expected 18, " + "is " + << last_msg_.certificate_bytes[136]; + EXPECT_EQ(last_msg_.certificate_bytes[137], 16) + << "incorrect value for last_msg_.certificate_bytes[137], expected 16, " + "is " + << last_msg_.certificate_bytes[137]; + EXPECT_EQ(last_msg_.certificate_bytes[138], 37) + << "incorrect value for last_msg_.certificate_bytes[138], expected 37, " + "is " + << last_msg_.certificate_bytes[138]; + EXPECT_EQ(last_msg_.certificate_bytes[139], 232) + << "incorrect value for last_msg_.certificate_bytes[139], expected 232, " + "is " + << last_msg_.certificate_bytes[139]; + EXPECT_EQ(last_msg_.certificate_bytes[140], 99) + << "incorrect value for last_msg_.certificate_bytes[140], expected 99, " + "is " + << last_msg_.certificate_bytes[140]; + EXPECT_EQ(last_msg_.certificate_bytes[141], 179) + << "incorrect value for last_msg_.certificate_bytes[141], expected 179, " + "is " + << last_msg_.certificate_bytes[141]; + EXPECT_EQ(last_msg_.certificate_bytes[142], 23) + << "incorrect value for last_msg_.certificate_bytes[142], expected 23, " + "is " + << last_msg_.certificate_bytes[142]; + EXPECT_EQ(last_msg_.certificate_bytes[143], 90) + << "incorrect value for last_msg_.certificate_bytes[143], expected 90, " + "is " + << last_msg_.certificate_bytes[143]; + EXPECT_EQ(last_msg_.certificate_bytes[144], 94) + << "incorrect value for last_msg_.certificate_bytes[144], expected 94, " + "is " + << last_msg_.certificate_bytes[144]; + EXPECT_EQ(last_msg_.certificate_bytes[145], 136) + << "incorrect value for last_msg_.certificate_bytes[145], expected 136, " + "is " + << last_msg_.certificate_bytes[145]; + EXPECT_EQ(last_msg_.certificate_bytes[146], 6) + << "incorrect value for last_msg_.certificate_bytes[146], expected 6, is " + << last_msg_.certificate_bytes[146]; + EXPECT_EQ(last_msg_.certificate_bytes[147], 125) + << "incorrect value for last_msg_.certificate_bytes[147], expected 125, " + "is " + << last_msg_.certificate_bytes[147]; + EXPECT_EQ(last_msg_.certificate_bytes[148], 91) + << "incorrect value for last_msg_.certificate_bytes[148], expected 91, " + "is " + << last_msg_.certificate_bytes[148]; + EXPECT_EQ(last_msg_.certificate_bytes[149], 255) + << "incorrect value for last_msg_.certificate_bytes[149], expected 255, " + "is " + << last_msg_.certificate_bytes[149]; + EXPECT_EQ(last_msg_.certificate_bytes[150], 15) + << "incorrect value for last_msg_.certificate_bytes[150], expected 15, " + "is " + << last_msg_.certificate_bytes[150]; + EXPECT_EQ(last_msg_.certificate_bytes[151], 71) + << "incorrect value for last_msg_.certificate_bytes[151], expected 71, " + "is " + << last_msg_.certificate_bytes[151]; + EXPECT_EQ(last_msg_.certificate_bytes[152], 43) + << "incorrect value for last_msg_.certificate_bytes[152], expected 43, " + "is " + << last_msg_.certificate_bytes[152]; + EXPECT_EQ(last_msg_.certificate_bytes[153], 46) + << "incorrect value for last_msg_.certificate_bytes[153], expected 46, " + "is " + << last_msg_.certificate_bytes[153]; + EXPECT_EQ(last_msg_.certificate_bytes[154], 25) + << "incorrect value for last_msg_.certificate_bytes[154], expected 25, " + "is " + << last_msg_.certificate_bytes[154]; + EXPECT_EQ(last_msg_.certificate_bytes[155], 252) + << "incorrect value for last_msg_.certificate_bytes[155], expected 252, " + "is " + << last_msg_.certificate_bytes[155]; + EXPECT_EQ(last_msg_.certificate_bytes[156], 229) + << "incorrect value for last_msg_.certificate_bytes[156], expected 229, " + "is " + << last_msg_.certificate_bytes[156]; + EXPECT_EQ(last_msg_.certificate_bytes[157], 80) + << "incorrect value for last_msg_.certificate_bytes[157], expected 80, " + "is " + << last_msg_.certificate_bytes[157]; + EXPECT_EQ(last_msg_.certificate_bytes[158], 143) + << "incorrect value for last_msg_.certificate_bytes[158], expected 143, " + "is " + << last_msg_.certificate_bytes[158]; + EXPECT_EQ(last_msg_.certificate_bytes[159], 58) + << "incorrect value for last_msg_.certificate_bytes[159], expected 58, " + "is " + << last_msg_.certificate_bytes[159]; + EXPECT_EQ(last_msg_.certificate_bytes[160], 241) + << "incorrect value for last_msg_.certificate_bytes[160], expected 241, " + "is " + << last_msg_.certificate_bytes[160]; + EXPECT_EQ(last_msg_.certificate_bytes[161], 11) + << "incorrect value for last_msg_.certificate_bytes[161], expected 11, " + "is " + << last_msg_.certificate_bytes[161]; + EXPECT_EQ(last_msg_.certificate_bytes[162], 62) + << "incorrect value for last_msg_.certificate_bytes[162], expected 62, " + "is " + << last_msg_.certificate_bytes[162]; + EXPECT_EQ(last_msg_.certificate_bytes[163], 181) + << "incorrect value for last_msg_.certificate_bytes[163], expected 181, " + "is " + << last_msg_.certificate_bytes[163]; + EXPECT_EQ(last_msg_.certificate_bytes[164], 155) + << "incorrect value for last_msg_.certificate_bytes[164], expected 155, " + "is " + << last_msg_.certificate_bytes[164]; + EXPECT_EQ(last_msg_.certificate_bytes[165], 53) + << "incorrect value for last_msg_.certificate_bytes[165], expected 53, " + "is " + << last_msg_.certificate_bytes[165]; + EXPECT_EQ(last_msg_.certificate_bytes[166], 153) + << "incorrect value for last_msg_.certificate_bytes[166], expected 153, " + "is " + << last_msg_.certificate_bytes[166]; + EXPECT_EQ(last_msg_.certificate_bytes[167], 149) + << "incorrect value for last_msg_.certificate_bytes[167], expected 149, " + "is " + << last_msg_.certificate_bytes[167]; + EXPECT_EQ(last_msg_.certificate_bytes[168], 152) + << "incorrect value for last_msg_.certificate_bytes[168], expected 152, " + "is " + << last_msg_.certificate_bytes[168]; + EXPECT_EQ(last_msg_.certificate_bytes[169], 227) + << "incorrect value for last_msg_.certificate_bytes[169], expected 227, " + "is " + << last_msg_.certificate_bytes[169]; + EXPECT_EQ(last_msg_.certificate_bytes[170], 150) + << "incorrect value for last_msg_.certificate_bytes[170], expected 150, " + "is " + << last_msg_.certificate_bytes[170]; + EXPECT_EQ(last_msg_.certificate_bytes[171], 87) + << "incorrect value for last_msg_.certificate_bytes[171], expected 87, " + "is " + << last_msg_.certificate_bytes[171]; + EXPECT_EQ(last_msg_.certificate_bytes[172], 112) + << "incorrect value for last_msg_.certificate_bytes[172], expected 112, " + "is " + << last_msg_.certificate_bytes[172]; + EXPECT_EQ(last_msg_.certificate_bytes[173], 165) + << "incorrect value for last_msg_.certificate_bytes[173], expected 165, " + "is " + << last_msg_.certificate_bytes[173]; + EXPECT_EQ(last_msg_.certificate_bytes[174], 2) + << "incorrect value for last_msg_.certificate_bytes[174], expected 2, is " + << last_msg_.certificate_bytes[174]; + EXPECT_EQ(last_msg_.certificate_bytes[175], 128) + << "incorrect value for last_msg_.certificate_bytes[175], expected 128, " + "is " + << last_msg_.certificate_bytes[175]; + EXPECT_EQ(last_msg_.certificate_bytes[176], 231) + << "incorrect value for last_msg_.certificate_bytes[176], expected 231, " + "is " + << last_msg_.certificate_bytes[176]; + EXPECT_EQ(last_msg_.certificate_bytes[177], 25) + << "incorrect value for last_msg_.certificate_bytes[177], expected 25, " + "is " + << last_msg_.certificate_bytes[177]; + EXPECT_EQ(last_msg_.certificate_bytes[178], 157) + << "incorrect value for last_msg_.certificate_bytes[178], expected 157, " + "is " + << last_msg_.certificate_bytes[178]; + EXPECT_EQ(last_msg_.certificate_bytes[179], 244) + << "incorrect value for last_msg_.certificate_bytes[179], expected 244, " + "is " + << last_msg_.certificate_bytes[179]; + EXPECT_EQ(last_msg_.certificate_bytes[180], 204) + << "incorrect value for last_msg_.certificate_bytes[180], expected 204, " + "is " + << last_msg_.certificate_bytes[180]; + EXPECT_EQ(last_msg_.certificate_bytes[181], 108) + << "incorrect value for last_msg_.certificate_bytes[181], expected 108, " + "is " + << last_msg_.certificate_bytes[181]; + EXPECT_EQ(last_msg_.certificate_bytes[182], 253) + << "incorrect value for last_msg_.certificate_bytes[182], expected 253, " + "is " + << last_msg_.certificate_bytes[182]; + EXPECT_EQ(last_msg_.certificate_bytes[183], 127) + << "incorrect value for last_msg_.certificate_bytes[183], expected 127, " + "is " + << last_msg_.certificate_bytes[183]; + EXPECT_EQ(last_msg_.certificate_bytes[184], 122) + << "incorrect value for last_msg_.certificate_bytes[184], expected 122, " + "is " + << last_msg_.certificate_bytes[184]; + EXPECT_EQ(last_msg_.certificate_bytes[185], 145) + << "incorrect value for last_msg_.certificate_bytes[185], expected 145, " + "is " + << last_msg_.certificate_bytes[185]; + EXPECT_EQ(last_msg_.certificate_bytes[186], 113) + << "incorrect value for last_msg_.certificate_bytes[186], expected 113, " + "is " + << last_msg_.certificate_bytes[186]; + EXPECT_EQ(last_msg_.certificate_bytes[187], 162) + << "incorrect value for last_msg_.certificate_bytes[187], expected 162, " + "is " + << last_msg_.certificate_bytes[187]; + EXPECT_EQ(last_msg_.certificate_bytes[188], 197) + << "incorrect value for last_msg_.certificate_bytes[188], expected 197, " + "is " + << last_msg_.certificate_bytes[188]; + EXPECT_EQ(last_msg_.certificate_bytes[189], 171) + << "incorrect value for last_msg_.certificate_bytes[189], expected 171, " + "is " + << last_msg_.certificate_bytes[189]; + EXPECT_EQ(last_msg_.certificate_bytes[190], 199) + << "incorrect value for last_msg_.certificate_bytes[190], expected 199, " + "is " + << last_msg_.certificate_bytes[190]; + EXPECT_EQ(last_msg_.certificate_bytes[191], 54) + << "incorrect value for last_msg_.certificate_bytes[191], expected 54, " + "is " + << last_msg_.certificate_bytes[191]; + EXPECT_EQ(last_msg_.certificate_bytes[192], 184) + << "incorrect value for last_msg_.certificate_bytes[192], expected 184, " + "is " + << last_msg_.certificate_bytes[192]; + EXPECT_EQ(last_msg_.certificate_bytes[193], 222) + << "incorrect value for last_msg_.certificate_bytes[193], expected 222, " + "is " + << last_msg_.certificate_bytes[193]; + EXPECT_EQ(last_msg_.certificate_bytes[194], 206) + << "incorrect value for last_msg_.certificate_bytes[194], expected 206, " + "is " + << last_msg_.certificate_bytes[194]; + EXPECT_EQ(last_msg_.certificate_bytes[195], 67) + << "incorrect value for last_msg_.certificate_bytes[195], expected 67, " + "is " + << last_msg_.certificate_bytes[195]; + EXPECT_EQ(last_msg_.certificate_bytes[196], 144) + << "incorrect value for last_msg_.certificate_bytes[196], expected 144, " + "is " + << last_msg_.certificate_bytes[196]; + EXPECT_EQ(last_msg_.certificate_bytes[197], 78) + << "incorrect value for last_msg_.certificate_bytes[197], expected 78, " + "is " + << last_msg_.certificate_bytes[197]; + EXPECT_EQ(last_msg_.certificate_bytes[198], 187) + << "incorrect value for last_msg_.certificate_bytes[198], expected 187, " + "is " + << last_msg_.certificate_bytes[198]; + EXPECT_EQ(last_msg_.certificate_bytes[199], 207) + << "incorrect value for last_msg_.certificate_bytes[199], expected 207, " + "is " + << last_msg_.certificate_bytes[199]; + EXPECT_EQ(last_msg_.certificate_bytes[200], 60) + << "incorrect value for last_msg_.certificate_bytes[200], expected 60, " + "is " + << last_msg_.certificate_bytes[200]; + EXPECT_EQ(last_msg_.certificate_bytes[201], 211) + << "incorrect value for last_msg_.certificate_bytes[201], expected 211, " + "is " + << last_msg_.certificate_bytes[201]; + EXPECT_EQ(last_msg_.certificate_bytes[202], 141) + << "incorrect value for last_msg_.certificate_bytes[202], expected 141, " + "is " + << last_msg_.certificate_bytes[202]; + EXPECT_EQ(last_msg_.certificate_bytes[203], 135) + << "incorrect value for last_msg_.certificate_bytes[203], expected 135, " + "is " + << last_msg_.certificate_bytes[203]; + EXPECT_EQ(last_msg_.certificate_bytes[204], 106) + << "incorrect value for last_msg_.certificate_bytes[204], expected 106, " + "is " + << last_msg_.certificate_bytes[204]; + EXPECT_EQ(last_msg_.certificate_bytes[205], 220) + << "incorrect value for last_msg_.certificate_bytes[205], expected 220, " + "is " + << last_msg_.certificate_bytes[205]; + EXPECT_EQ(last_msg_.certificate_bytes[206], 79) + << "incorrect value for last_msg_.certificate_bytes[206], expected 79, " + "is " + << last_msg_.certificate_bytes[206]; + EXPECT_EQ(last_msg_.certificate_bytes[207], 183) + << "incorrect value for last_msg_.certificate_bytes[207], expected 183, " + "is " + << last_msg_.certificate_bytes[207]; + EXPECT_EQ(last_msg_.certificate_bytes[208], 245) + << "incorrect value for last_msg_.certificate_bytes[208], expected 245, " + "is " + << last_msg_.certificate_bytes[208]; + EXPECT_EQ(last_msg_.certificate_bytes[209], 21) + << "incorrect value for last_msg_.certificate_bytes[209], expected 21, " + "is " + << last_msg_.certificate_bytes[209]; + EXPECT_EQ(last_msg_.certificate_bytes[210], 161) + << "incorrect value for last_msg_.certificate_bytes[210], expected 161, " + "is " + << last_msg_.certificate_bytes[210]; + EXPECT_EQ(last_msg_.certificate_bytes[211], 168) + << "incorrect value for last_msg_.certificate_bytes[211], expected 168, " + "is " + << last_msg_.certificate_bytes[211]; + EXPECT_EQ(last_msg_.certificate_bytes[212], 34) + << "incorrect value for last_msg_.certificate_bytes[212], expected 34, " + "is " + << last_msg_.certificate_bytes[212]; + EXPECT_EQ(last_msg_.certificate_bytes[213], 129) + << "incorrect value for last_msg_.certificate_bytes[213], expected 129, " + "is " + << last_msg_.certificate_bytes[213]; + EXPECT_EQ(last_msg_.certificate_bytes[214], 50) + << "incorrect value for last_msg_.certificate_bytes[214], expected 50, " + "is " + << last_msg_.certificate_bytes[214]; + EXPECT_EQ(last_msg_.certificate_bytes[215], 176) + << "incorrect value for last_msg_.certificate_bytes[215], expected 176, " + "is " + << last_msg_.certificate_bytes[215]; + EXPECT_EQ(last_msg_.certificate_bytes[216], 1) + << "incorrect value for last_msg_.certificate_bytes[216], expected 1, is " + << last_msg_.certificate_bytes[216]; + EXPECT_EQ(last_msg_.certificate_bytes[217], 218) + << "incorrect value for last_msg_.certificate_bytes[217], expected 218, " + "is " + << last_msg_.certificate_bytes[217]; + EXPECT_EQ(last_msg_.certificate_bytes[218], 20) + << "incorrect value for last_msg_.certificate_bytes[218], expected 20, " + "is " + << last_msg_.certificate_bytes[218]; + EXPECT_EQ(last_msg_.certificate_bytes[219], 130) + << "incorrect value for last_msg_.certificate_bytes[219], expected 130, " + "is " + << last_msg_.certificate_bytes[219]; + EXPECT_EQ(last_msg_.certificate_bytes[220], 59) + << "incorrect value for last_msg_.certificate_bytes[220], expected 59, " + "is " + << last_msg_.certificate_bytes[220]; + EXPECT_EQ(last_msg_.certificate_bytes[221], 249) + << "incorrect value for last_msg_.certificate_bytes[221], expected 249, " + "is " + << last_msg_.certificate_bytes[221]; + EXPECT_EQ(last_msg_.certificate_bytes[222], 109) + << "incorrect value for last_msg_.certificate_bytes[222], expected 109, " + "is " + << last_msg_.certificate_bytes[222]; + EXPECT_EQ(last_msg_.certificate_bytes[223], 219) + << "incorrect value for last_msg_.certificate_bytes[223], expected 219, " + "is " + << last_msg_.certificate_bytes[223]; + EXPECT_EQ(last_msg_.certificate_bytes[224], 0) + << "incorrect value for last_msg_.certificate_bytes[224], expected 0, is " + << last_msg_.certificate_bytes[224]; + EXPECT_EQ(last_msg_.certificate_bytes[225], 100) + << "incorrect value for last_msg_.certificate_bytes[225], expected 100, " + "is " + << last_msg_.certificate_bytes[225]; + EXPECT_EQ(last_msg_.certificate_bytes[226], 103) + << "incorrect value for last_msg_.certificate_bytes[226], expected 103, " + "is " + << last_msg_.certificate_bytes[226]; + EXPECT_EQ(last_msg_.certificate_bytes[227], 55) + << "incorrect value for last_msg_.certificate_bytes[227], expected 55, " + "is " + << last_msg_.certificate_bytes[227]; + EXPECT_EQ(last_msg_.certificate_bytes[228], 29) + << "incorrect value for last_msg_.certificate_bytes[228], expected 29, " + "is " + << last_msg_.certificate_bytes[228]; + EXPECT_EQ(last_msg_.certificate_bytes[229], 242) + << "incorrect value for last_msg_.certificate_bytes[229], expected 242, " + "is " + << last_msg_.certificate_bytes[229]; + EXPECT_EQ(last_msg_.certificate_bytes[230], 110) + << "incorrect value for last_msg_.certificate_bytes[230], expected 110, " + "is " + << last_msg_.certificate_bytes[230]; + EXPECT_EQ(last_msg_.certificate_bytes[231], 154) + << "incorrect value for last_msg_.certificate_bytes[231], expected 154, " + "is " + << last_msg_.certificate_bytes[231]; + EXPECT_EQ(last_msg_.certificate_bytes[232], 190) + << "incorrect value for last_msg_.certificate_bytes[232], expected 190, " + "is " + << last_msg_.certificate_bytes[232]; + EXPECT_EQ(last_msg_.certificate_bytes[233], 233) + << "incorrect value for last_msg_.certificate_bytes[233], expected 233, " + "is " + << last_msg_.certificate_bytes[233]; + EXPECT_EQ(last_msg_.certificate_bytes[234], 142) + << "incorrect value for last_msg_.certificate_bytes[234], expected 142, " + "is " + << last_msg_.certificate_bytes[234]; + EXPECT_EQ(last_msg_.certificate_bytes[235], 45) + << "incorrect value for last_msg_.certificate_bytes[235], expected 45, " + "is " + << last_msg_.certificate_bytes[235]; + EXPECT_EQ(last_msg_.certificate_bytes[236], 61) + << "incorrect value for last_msg_.certificate_bytes[236], expected 61, " + "is " + << last_msg_.certificate_bytes[236]; + EXPECT_EQ(last_msg_.certificate_bytes[237], 215) + << "incorrect value for last_msg_.certificate_bytes[237], expected 215, " + "is " + << last_msg_.certificate_bytes[237]; + EXPECT_EQ(last_msg_.certificate_bytes[238], 202) + << "incorrect value for last_msg_.certificate_bytes[238], expected 202, " + "is " + << last_msg_.certificate_bytes[238]; + EXPECT_EQ(last_msg_.certificate_bytes[239], 238) + << "incorrect value for last_msg_.certificate_bytes[239], expected 238, " + "is " + << last_msg_.certificate_bytes[239]; + EXPECT_EQ(last_msg_.certificate_bytes[240], 88) + << "incorrect value for last_msg_.certificate_bytes[240], expected 88, " + "is " + << last_msg_.certificate_bytes[240]; + EXPECT_EQ(last_msg_.certificate_bytes[241], 209) + << "incorrect value for last_msg_.certificate_bytes[241], expected 209, " + "is " + << last_msg_.certificate_bytes[241]; + EXPECT_EQ(last_msg_.certificate_bytes[242], 70) + << "incorrect value for last_msg_.certificate_bytes[242], expected 70, " + "is " + << last_msg_.certificate_bytes[242]; + EXPECT_EQ(last_msg_.certificate_bytes[243], 63) + << "incorrect value for last_msg_.certificate_bytes[243], expected 63, " + "is " + << last_msg_.certificate_bytes[243]; + EXPECT_EQ(last_msg_.certificate_bytes[244], 151) + << "incorrect value for last_msg_.certificate_bytes[244], expected 151, " + "is " + << last_msg_.certificate_bytes[244]; + EXPECT_EQ(last_msg_.certificate_bytes[245], 27) + << "incorrect value for last_msg_.certificate_bytes[245], expected 27, " + "is " + << last_msg_.certificate_bytes[245]; + EXPECT_EQ(last_msg_.certificate_bytes[246], 102) + << "incorrect value for last_msg_.certificate_bytes[246], expected 102, " + "is " + << last_msg_.certificate_bytes[246]; + EXPECT_EQ(last_msg_.certificate_id[0], 10) + << "incorrect value for last_msg_.certificate_id[0], expected 10, is " + << last_msg_.certificate_id[0]; + EXPECT_EQ(last_msg_.certificate_id[1], 11) + << "incorrect value for last_msg_.certificate_id[1], expected 11, is " + << last_msg_.certificate_id[1]; + EXPECT_EQ(last_msg_.certificate_id[2], 12) + << "incorrect value for last_msg_.certificate_id[2], expected 12, is " + << last_msg_.certificate_id[2]; + EXPECT_EQ(last_msg_.certificate_id[3], 13) + << "incorrect value for last_msg_.certificate_id[3], expected 13, is " + << last_msg_.certificate_id[3]; + EXPECT_EQ(last_msg_.flags, 2) + << "incorrect value for last_msg_.flags, expected 2, is " + << last_msg_.flags; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_certificate_bytes.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_certificate_bytes.handle_as, " + "expected string '" + << check_string << "', is '" << last_msg_.n_certificate_bytes.handle_as + << "'"; + } + { + const char check_string[] = { + (char)99, (char)101, (char)114, (char)116, (char)105, (char)102, + (char)105, (char)99, (char)97, (char)116, (char)101, (char)95, + (char)98, (char)121, (char)116, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_certificate_bytes.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_certificate_bytes.relates_to, " + "expected string '" + << check_string << "', is '" << last_msg_.n_certificate_bytes.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_certificate_bytes.value, 247) + << "incorrect value for last_msg_.n_certificate_bytes.value, expected " + "247, is " + << last_msg_.n_certificate_bytes.value; + EXPECT_EQ(last_msg_.n_msg, 48) + << "incorrect value for last_msg_.n_msg, expected 48, is " + << last_msg_.n_msg; } diff --git a/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc index 08228ec64..4d01b67c3 100644 --- a/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc +++ b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_signing_MsgEcdsaSignature0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_signing_MsgEcdsaSignature0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_signing_MsgEcdsaSignature0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_signing_MsgEcdsaSignature0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ecdsa_signature_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ecdsa_signature_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,293 +67,491 @@ class Test_auto_check_sbp_signing_MsgEcdsaSignature0 : sbp_msg_ecdsa_signature_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_signing_MsgEcdsaSignature0, Test) -{ - - uint8_t encoded_frame[] = {85,8,12,66,0,83,0,1,2,1,2,3,4,72,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,10,21,23,232,131, }; - - sbp_msg_ecdsa_signature_t test_msg{}; - - test_msg.certificate_id[0] = 1; - - test_msg.certificate_id[1] = 2; - - test_msg.certificate_id[2] = 3; - - test_msg.certificate_id[3] = 4; - test_msg.flags = 0; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_signed_messages.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)105,(char)103,(char)110,(char)101,(char)100,(char)95,(char)109,(char)101,(char)115,(char)115,(char)97,(char)103,(char)101,(char)115 }; - memcpy(test_msg.n_signed_messages.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_signed_messages.value = 3; - test_msg.on_demand_counter = 2; - - test_msg.signature.data[0] = 0; - - test_msg.signature.data[1] = 1; - - test_msg.signature.data[2] = 2; - - test_msg.signature.data[3] = 3; - - test_msg.signature.data[4] = 4; - - test_msg.signature.data[5] = 5; - - test_msg.signature.data[6] = 6; - - test_msg.signature.data[7] = 7; - - test_msg.signature.data[8] = 8; - - test_msg.signature.data[9] = 9; - - test_msg.signature.data[10] = 10; - - test_msg.signature.data[11] = 11; - - test_msg.signature.data[12] = 12; - - test_msg.signature.data[13] = 13; - - test_msg.signature.data[14] = 14; - - test_msg.signature.data[15] = 15; - - test_msg.signature.data[16] = 16; - - test_msg.signature.data[17] = 17; - - test_msg.signature.data[18] = 18; - - test_msg.signature.data[19] = 19; - - test_msg.signature.data[20] = 20; - - test_msg.signature.data[21] = 21; - - test_msg.signature.data[22] = 22; - - test_msg.signature.data[23] = 23; - - test_msg.signature.data[24] = 24; - - test_msg.signature.data[25] = 25; - - test_msg.signature.data[26] = 26; - - test_msg.signature.data[27] = 27; - - test_msg.signature.data[28] = 28; - - test_msg.signature.data[29] = 29; - - test_msg.signature.data[30] = 30; - - test_msg.signature.data[31] = 31; - - test_msg.signature.data[32] = 32; - - test_msg.signature.data[33] = 33; - - test_msg.signature.data[34] = 34; - - test_msg.signature.data[35] = 35; - - test_msg.signature.data[36] = 36; - - test_msg.signature.data[37] = 37; - - test_msg.signature.data[38] = 38; - - test_msg.signature.data[39] = 39; - - test_msg.signature.data[40] = 40; - - test_msg.signature.data[41] = 41; - - test_msg.signature.data[42] = 42; - - test_msg.signature.data[43] = 43; - - test_msg.signature.data[44] = 44; - - test_msg.signature.data[45] = 45; - - test_msg.signature.data[46] = 46; - - test_msg.signature.data[47] = 47; - - test_msg.signature.data[48] = 48; - - test_msg.signature.data[49] = 49; - - test_msg.signature.data[50] = 50; - - test_msg.signature.data[51] = 51; - - test_msg.signature.data[52] = 52; - - test_msg.signature.data[53] = 53; - - test_msg.signature.data[54] = 54; - - test_msg.signature.data[55] = 55; - - test_msg.signature.data[56] = 56; - - test_msg.signature.data[57] = 57; - - test_msg.signature.data[58] = 58; - - test_msg.signature.data[59] = 59; - - test_msg.signature.data[60] = 60; - - test_msg.signature.data[61] = 61; - - test_msg.signature.data[62] = 62; - - test_msg.signature.data[63] = 63; - - test_msg.signature.data[64] = 64; - - test_msg.signature.data[65] = 65; - - test_msg.signature.data[66] = 66; - - test_msg.signature.data[67] = 67; - - test_msg.signature.data[68] = 68; - - test_msg.signature.data[69] = 69; - - test_msg.signature.data[70] = 70; - - test_msg.signature.data[71] = 71; - test_msg.signature.len = 72; - - test_msg.signed_messages[0] = 10; - - test_msg.signed_messages[1] = 21; - - test_msg.signed_messages[2] = 23; - test_msg.stream_counter = 1; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.certificate_id[0], 1) << "incorrect value for last_msg_.certificate_id[0], expected 1, is " << last_msg_.certificate_id[0]; - EXPECT_EQ(last_msg_.certificate_id[1], 2) << "incorrect value for last_msg_.certificate_id[1], expected 2, is " << last_msg_.certificate_id[1]; - EXPECT_EQ(last_msg_.certificate_id[2], 3) << "incorrect value for last_msg_.certificate_id[2], expected 3, is " << last_msg_.certificate_id[2]; - EXPECT_EQ(last_msg_.certificate_id[3], 4) << "incorrect value for last_msg_.certificate_id[3], expected 4, is " << last_msg_.certificate_id[3]; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_signed_messages.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_signed_messages.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_signed_messages.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)105,(char)103,(char)110,(char)101,(char)100,(char)95,(char)109,(char)101,(char)115,(char)115,(char)97,(char)103,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_signed_messages.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_signed_messages.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_signed_messages.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_signed_messages.value, 3) << "incorrect value for last_msg_.n_signed_messages.value, expected 3, is " << last_msg_.n_signed_messages.value; - EXPECT_EQ(last_msg_.on_demand_counter, 2) << "incorrect value for last_msg_.on_demand_counter, expected 2, is " << last_msg_.on_demand_counter; - EXPECT_EQ(last_msg_.signature.data[0], 0) << "incorrect value for last_msg_.signature.data[0], expected 0, is " << last_msg_.signature.data[0]; - EXPECT_EQ(last_msg_.signature.data[1], 1) << "incorrect value for last_msg_.signature.data[1], expected 1, is " << last_msg_.signature.data[1]; - EXPECT_EQ(last_msg_.signature.data[2], 2) << "incorrect value for last_msg_.signature.data[2], expected 2, is " << last_msg_.signature.data[2]; - EXPECT_EQ(last_msg_.signature.data[3], 3) << "incorrect value for last_msg_.signature.data[3], expected 3, is " << last_msg_.signature.data[3]; - EXPECT_EQ(last_msg_.signature.data[4], 4) << "incorrect value for last_msg_.signature.data[4], expected 4, is " << last_msg_.signature.data[4]; - EXPECT_EQ(last_msg_.signature.data[5], 5) << "incorrect value for last_msg_.signature.data[5], expected 5, is " << last_msg_.signature.data[5]; - EXPECT_EQ(last_msg_.signature.data[6], 6) << "incorrect value for last_msg_.signature.data[6], expected 6, is " << last_msg_.signature.data[6]; - EXPECT_EQ(last_msg_.signature.data[7], 7) << "incorrect value for last_msg_.signature.data[7], expected 7, is " << last_msg_.signature.data[7]; - EXPECT_EQ(last_msg_.signature.data[8], 8) << "incorrect value for last_msg_.signature.data[8], expected 8, is " << last_msg_.signature.data[8]; - EXPECT_EQ(last_msg_.signature.data[9], 9) << "incorrect value for last_msg_.signature.data[9], expected 9, is " << last_msg_.signature.data[9]; - EXPECT_EQ(last_msg_.signature.data[10], 10) << "incorrect value for last_msg_.signature.data[10], expected 10, is " << last_msg_.signature.data[10]; - EXPECT_EQ(last_msg_.signature.data[11], 11) << "incorrect value for last_msg_.signature.data[11], expected 11, is " << last_msg_.signature.data[11]; - EXPECT_EQ(last_msg_.signature.data[12], 12) << "incorrect value for last_msg_.signature.data[12], expected 12, is " << last_msg_.signature.data[12]; - EXPECT_EQ(last_msg_.signature.data[13], 13) << "incorrect value for last_msg_.signature.data[13], expected 13, is " << last_msg_.signature.data[13]; - EXPECT_EQ(last_msg_.signature.data[14], 14) << "incorrect value for last_msg_.signature.data[14], expected 14, is " << last_msg_.signature.data[14]; - EXPECT_EQ(last_msg_.signature.data[15], 15) << "incorrect value for last_msg_.signature.data[15], expected 15, is " << last_msg_.signature.data[15]; - EXPECT_EQ(last_msg_.signature.data[16], 16) << "incorrect value for last_msg_.signature.data[16], expected 16, is " << last_msg_.signature.data[16]; - EXPECT_EQ(last_msg_.signature.data[17], 17) << "incorrect value for last_msg_.signature.data[17], expected 17, is " << last_msg_.signature.data[17]; - EXPECT_EQ(last_msg_.signature.data[18], 18) << "incorrect value for last_msg_.signature.data[18], expected 18, is " << last_msg_.signature.data[18]; - EXPECT_EQ(last_msg_.signature.data[19], 19) << "incorrect value for last_msg_.signature.data[19], expected 19, is " << last_msg_.signature.data[19]; - EXPECT_EQ(last_msg_.signature.data[20], 20) << "incorrect value for last_msg_.signature.data[20], expected 20, is " << last_msg_.signature.data[20]; - EXPECT_EQ(last_msg_.signature.data[21], 21) << "incorrect value for last_msg_.signature.data[21], expected 21, is " << last_msg_.signature.data[21]; - EXPECT_EQ(last_msg_.signature.data[22], 22) << "incorrect value for last_msg_.signature.data[22], expected 22, is " << last_msg_.signature.data[22]; - EXPECT_EQ(last_msg_.signature.data[23], 23) << "incorrect value for last_msg_.signature.data[23], expected 23, is " << last_msg_.signature.data[23]; - EXPECT_EQ(last_msg_.signature.data[24], 24) << "incorrect value for last_msg_.signature.data[24], expected 24, is " << last_msg_.signature.data[24]; - EXPECT_EQ(last_msg_.signature.data[25], 25) << "incorrect value for last_msg_.signature.data[25], expected 25, is " << last_msg_.signature.data[25]; - EXPECT_EQ(last_msg_.signature.data[26], 26) << "incorrect value for last_msg_.signature.data[26], expected 26, is " << last_msg_.signature.data[26]; - EXPECT_EQ(last_msg_.signature.data[27], 27) << "incorrect value for last_msg_.signature.data[27], expected 27, is " << last_msg_.signature.data[27]; - EXPECT_EQ(last_msg_.signature.data[28], 28) << "incorrect value for last_msg_.signature.data[28], expected 28, is " << last_msg_.signature.data[28]; - EXPECT_EQ(last_msg_.signature.data[29], 29) << "incorrect value for last_msg_.signature.data[29], expected 29, is " << last_msg_.signature.data[29]; - EXPECT_EQ(last_msg_.signature.data[30], 30) << "incorrect value for last_msg_.signature.data[30], expected 30, is " << last_msg_.signature.data[30]; - EXPECT_EQ(last_msg_.signature.data[31], 31) << "incorrect value for last_msg_.signature.data[31], expected 31, is " << last_msg_.signature.data[31]; - EXPECT_EQ(last_msg_.signature.data[32], 32) << "incorrect value for last_msg_.signature.data[32], expected 32, is " << last_msg_.signature.data[32]; - EXPECT_EQ(last_msg_.signature.data[33], 33) << "incorrect value for last_msg_.signature.data[33], expected 33, is " << last_msg_.signature.data[33]; - EXPECT_EQ(last_msg_.signature.data[34], 34) << "incorrect value for last_msg_.signature.data[34], expected 34, is " << last_msg_.signature.data[34]; - EXPECT_EQ(last_msg_.signature.data[35], 35) << "incorrect value for last_msg_.signature.data[35], expected 35, is " << last_msg_.signature.data[35]; - EXPECT_EQ(last_msg_.signature.data[36], 36) << "incorrect value for last_msg_.signature.data[36], expected 36, is " << last_msg_.signature.data[36]; - EXPECT_EQ(last_msg_.signature.data[37], 37) << "incorrect value for last_msg_.signature.data[37], expected 37, is " << last_msg_.signature.data[37]; - EXPECT_EQ(last_msg_.signature.data[38], 38) << "incorrect value for last_msg_.signature.data[38], expected 38, is " << last_msg_.signature.data[38]; - EXPECT_EQ(last_msg_.signature.data[39], 39) << "incorrect value for last_msg_.signature.data[39], expected 39, is " << last_msg_.signature.data[39]; - EXPECT_EQ(last_msg_.signature.data[40], 40) << "incorrect value for last_msg_.signature.data[40], expected 40, is " << last_msg_.signature.data[40]; - EXPECT_EQ(last_msg_.signature.data[41], 41) << "incorrect value for last_msg_.signature.data[41], expected 41, is " << last_msg_.signature.data[41]; - EXPECT_EQ(last_msg_.signature.data[42], 42) << "incorrect value for last_msg_.signature.data[42], expected 42, is " << last_msg_.signature.data[42]; - EXPECT_EQ(last_msg_.signature.data[43], 43) << "incorrect value for last_msg_.signature.data[43], expected 43, is " << last_msg_.signature.data[43]; - EXPECT_EQ(last_msg_.signature.data[44], 44) << "incorrect value for last_msg_.signature.data[44], expected 44, is " << last_msg_.signature.data[44]; - EXPECT_EQ(last_msg_.signature.data[45], 45) << "incorrect value for last_msg_.signature.data[45], expected 45, is " << last_msg_.signature.data[45]; - EXPECT_EQ(last_msg_.signature.data[46], 46) << "incorrect value for last_msg_.signature.data[46], expected 46, is " << last_msg_.signature.data[46]; - EXPECT_EQ(last_msg_.signature.data[47], 47) << "incorrect value for last_msg_.signature.data[47], expected 47, is " << last_msg_.signature.data[47]; - EXPECT_EQ(last_msg_.signature.data[48], 48) << "incorrect value for last_msg_.signature.data[48], expected 48, is " << last_msg_.signature.data[48]; - EXPECT_EQ(last_msg_.signature.data[49], 49) << "incorrect value for last_msg_.signature.data[49], expected 49, is " << last_msg_.signature.data[49]; - EXPECT_EQ(last_msg_.signature.data[50], 50) << "incorrect value for last_msg_.signature.data[50], expected 50, is " << last_msg_.signature.data[50]; - EXPECT_EQ(last_msg_.signature.data[51], 51) << "incorrect value for last_msg_.signature.data[51], expected 51, is " << last_msg_.signature.data[51]; - EXPECT_EQ(last_msg_.signature.data[52], 52) << "incorrect value for last_msg_.signature.data[52], expected 52, is " << last_msg_.signature.data[52]; - EXPECT_EQ(last_msg_.signature.data[53], 53) << "incorrect value for last_msg_.signature.data[53], expected 53, is " << last_msg_.signature.data[53]; - EXPECT_EQ(last_msg_.signature.data[54], 54) << "incorrect value for last_msg_.signature.data[54], expected 54, is " << last_msg_.signature.data[54]; - EXPECT_EQ(last_msg_.signature.data[55], 55) << "incorrect value for last_msg_.signature.data[55], expected 55, is " << last_msg_.signature.data[55]; - EXPECT_EQ(last_msg_.signature.data[56], 56) << "incorrect value for last_msg_.signature.data[56], expected 56, is " << last_msg_.signature.data[56]; - EXPECT_EQ(last_msg_.signature.data[57], 57) << "incorrect value for last_msg_.signature.data[57], expected 57, is " << last_msg_.signature.data[57]; - EXPECT_EQ(last_msg_.signature.data[58], 58) << "incorrect value for last_msg_.signature.data[58], expected 58, is " << last_msg_.signature.data[58]; - EXPECT_EQ(last_msg_.signature.data[59], 59) << "incorrect value for last_msg_.signature.data[59], expected 59, is " << last_msg_.signature.data[59]; - EXPECT_EQ(last_msg_.signature.data[60], 60) << "incorrect value for last_msg_.signature.data[60], expected 60, is " << last_msg_.signature.data[60]; - EXPECT_EQ(last_msg_.signature.data[61], 61) << "incorrect value for last_msg_.signature.data[61], expected 61, is " << last_msg_.signature.data[61]; - EXPECT_EQ(last_msg_.signature.data[62], 62) << "incorrect value for last_msg_.signature.data[62], expected 62, is " << last_msg_.signature.data[62]; - EXPECT_EQ(last_msg_.signature.data[63], 63) << "incorrect value for last_msg_.signature.data[63], expected 63, is " << last_msg_.signature.data[63]; - EXPECT_EQ(last_msg_.signature.data[64], 64) << "incorrect value for last_msg_.signature.data[64], expected 64, is " << last_msg_.signature.data[64]; - EXPECT_EQ(last_msg_.signature.data[65], 65) << "incorrect value for last_msg_.signature.data[65], expected 65, is " << last_msg_.signature.data[65]; - EXPECT_EQ(last_msg_.signature.data[66], 66) << "incorrect value for last_msg_.signature.data[66], expected 66, is " << last_msg_.signature.data[66]; - EXPECT_EQ(last_msg_.signature.data[67], 67) << "incorrect value for last_msg_.signature.data[67], expected 67, is " << last_msg_.signature.data[67]; - EXPECT_EQ(last_msg_.signature.data[68], 68) << "incorrect value for last_msg_.signature.data[68], expected 68, is " << last_msg_.signature.data[68]; - EXPECT_EQ(last_msg_.signature.data[69], 69) << "incorrect value for last_msg_.signature.data[69], expected 69, is " << last_msg_.signature.data[69]; - EXPECT_EQ(last_msg_.signature.data[70], 70) << "incorrect value for last_msg_.signature.data[70], expected 70, is " << last_msg_.signature.data[70]; - EXPECT_EQ(last_msg_.signature.data[71], 71) << "incorrect value for last_msg_.signature.data[71], expected 71, is " << last_msg_.signature.data[71]; - EXPECT_EQ(last_msg_.signature.len, 72) << "incorrect value for last_msg_.signature.len, expected 72, is " << last_msg_.signature.len; - EXPECT_EQ(last_msg_.signed_messages[0], 10) << "incorrect value for last_msg_.signed_messages[0], expected 10, is " << last_msg_.signed_messages[0]; - EXPECT_EQ(last_msg_.signed_messages[1], 21) << "incorrect value for last_msg_.signed_messages[1], expected 21, is " << last_msg_.signed_messages[1]; - EXPECT_EQ(last_msg_.signed_messages[2], 23) << "incorrect value for last_msg_.signed_messages[2], expected 23, is " << last_msg_.signed_messages[2]; - EXPECT_EQ(last_msg_.stream_counter, 1) << "incorrect value for last_msg_.stream_counter, expected 1, is " << last_msg_.stream_counter; +}; + +TEST_F(Test_auto_check_sbp_signing_MsgEcdsaSignature0, Test) { + uint8_t encoded_frame[] = { + 85, 8, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 232, 131, + }; + + sbp_msg_ecdsa_signature_t test_msg{}; + + test_msg.certificate_id[0] = 1; + + test_msg.certificate_id[1] = 2; + + test_msg.certificate_id[2] = 3; + + test_msg.certificate_id[3] = 4; + test_msg.flags = 0; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_signed_messages.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)105, (char)103, (char)110, + (char)101, (char)100, (char)95, (char)109, + (char)101, (char)115, (char)115, (char)97, + (char)103, (char)101, (char)115}; + memcpy(test_msg.n_signed_messages.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_signed_messages.value = 3; + test_msg.on_demand_counter = 2; + + test_msg.signature.data[0] = 0; + + test_msg.signature.data[1] = 1; + + test_msg.signature.data[2] = 2; + + test_msg.signature.data[3] = 3; + + test_msg.signature.data[4] = 4; + + test_msg.signature.data[5] = 5; + + test_msg.signature.data[6] = 6; + + test_msg.signature.data[7] = 7; + + test_msg.signature.data[8] = 8; + + test_msg.signature.data[9] = 9; + + test_msg.signature.data[10] = 10; + + test_msg.signature.data[11] = 11; + + test_msg.signature.data[12] = 12; + + test_msg.signature.data[13] = 13; + + test_msg.signature.data[14] = 14; + + test_msg.signature.data[15] = 15; + + test_msg.signature.data[16] = 16; + + test_msg.signature.data[17] = 17; + + test_msg.signature.data[18] = 18; + + test_msg.signature.data[19] = 19; + + test_msg.signature.data[20] = 20; + + test_msg.signature.data[21] = 21; + + test_msg.signature.data[22] = 22; + + test_msg.signature.data[23] = 23; + + test_msg.signature.data[24] = 24; + + test_msg.signature.data[25] = 25; + + test_msg.signature.data[26] = 26; + + test_msg.signature.data[27] = 27; + + test_msg.signature.data[28] = 28; + + test_msg.signature.data[29] = 29; + + test_msg.signature.data[30] = 30; + + test_msg.signature.data[31] = 31; + + test_msg.signature.data[32] = 32; + + test_msg.signature.data[33] = 33; + + test_msg.signature.data[34] = 34; + + test_msg.signature.data[35] = 35; + + test_msg.signature.data[36] = 36; + + test_msg.signature.data[37] = 37; + + test_msg.signature.data[38] = 38; + + test_msg.signature.data[39] = 39; + + test_msg.signature.data[40] = 40; + + test_msg.signature.data[41] = 41; + + test_msg.signature.data[42] = 42; + + test_msg.signature.data[43] = 43; + + test_msg.signature.data[44] = 44; + + test_msg.signature.data[45] = 45; + + test_msg.signature.data[46] = 46; + + test_msg.signature.data[47] = 47; + + test_msg.signature.data[48] = 48; + + test_msg.signature.data[49] = 49; + + test_msg.signature.data[50] = 50; + + test_msg.signature.data[51] = 51; + + test_msg.signature.data[52] = 52; + + test_msg.signature.data[53] = 53; + + test_msg.signature.data[54] = 54; + + test_msg.signature.data[55] = 55; + + test_msg.signature.data[56] = 56; + + test_msg.signature.data[57] = 57; + + test_msg.signature.data[58] = 58; + + test_msg.signature.data[59] = 59; + + test_msg.signature.data[60] = 60; + + test_msg.signature.data[61] = 61; + + test_msg.signature.data[62] = 62; + + test_msg.signature.data[63] = 63; + + test_msg.signature.data[64] = 64; + + test_msg.signature.data[65] = 65; + + test_msg.signature.data[66] = 66; + + test_msg.signature.data[67] = 67; + + test_msg.signature.data[68] = 68; + + test_msg.signature.data[69] = 69; + + test_msg.signature.data[70] = 70; + + test_msg.signature.data[71] = 71; + test_msg.signature.len = 72; + + test_msg.signed_messages[0] = 10; + + test_msg.signed_messages[1] = 21; + + test_msg.signed_messages[2] = 23; + test_msg.stream_counter = 1; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.certificate_id[0], 1) + << "incorrect value for last_msg_.certificate_id[0], expected 1, is " + << last_msg_.certificate_id[0]; + EXPECT_EQ(last_msg_.certificate_id[1], 2) + << "incorrect value for last_msg_.certificate_id[1], expected 2, is " + << last_msg_.certificate_id[1]; + EXPECT_EQ(last_msg_.certificate_id[2], 3) + << "incorrect value for last_msg_.certificate_id[2], expected 3, is " + << last_msg_.certificate_id[2]; + EXPECT_EQ(last_msg_.certificate_id[3], 4) + << "incorrect value for last_msg_.certificate_id[3], expected 4, is " + << last_msg_.certificate_id[3]; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_signed_messages.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_signed_messages.handle_as, " + "expected string '" + << check_string << "', is '" << last_msg_.n_signed_messages.handle_as + << "'"; + } + { + const char check_string[] = {(char)115, (char)105, (char)103, (char)110, + (char)101, (char)100, (char)95, (char)109, + (char)101, (char)115, (char)115, (char)97, + (char)103, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_signed_messages.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_signed_messages.relates_to, " + "expected string '" + << check_string << "', is '" << last_msg_.n_signed_messages.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_signed_messages.value, 3) + << "incorrect value for last_msg_.n_signed_messages.value, expected 3, " + "is " + << last_msg_.n_signed_messages.value; + EXPECT_EQ(last_msg_.on_demand_counter, 2) + << "incorrect value for last_msg_.on_demand_counter, expected 2, is " + << last_msg_.on_demand_counter; + EXPECT_EQ(last_msg_.signature.data[0], 0) + << "incorrect value for last_msg_.signature.data[0], expected 0, is " + << last_msg_.signature.data[0]; + EXPECT_EQ(last_msg_.signature.data[1], 1) + << "incorrect value for last_msg_.signature.data[1], expected 1, is " + << last_msg_.signature.data[1]; + EXPECT_EQ(last_msg_.signature.data[2], 2) + << "incorrect value for last_msg_.signature.data[2], expected 2, is " + << last_msg_.signature.data[2]; + EXPECT_EQ(last_msg_.signature.data[3], 3) + << "incorrect value for last_msg_.signature.data[3], expected 3, is " + << last_msg_.signature.data[3]; + EXPECT_EQ(last_msg_.signature.data[4], 4) + << "incorrect value for last_msg_.signature.data[4], expected 4, is " + << last_msg_.signature.data[4]; + EXPECT_EQ(last_msg_.signature.data[5], 5) + << "incorrect value for last_msg_.signature.data[5], expected 5, is " + << last_msg_.signature.data[5]; + EXPECT_EQ(last_msg_.signature.data[6], 6) + << "incorrect value for last_msg_.signature.data[6], expected 6, is " + << last_msg_.signature.data[6]; + EXPECT_EQ(last_msg_.signature.data[7], 7) + << "incorrect value for last_msg_.signature.data[7], expected 7, is " + << last_msg_.signature.data[7]; + EXPECT_EQ(last_msg_.signature.data[8], 8) + << "incorrect value for last_msg_.signature.data[8], expected 8, is " + << last_msg_.signature.data[8]; + EXPECT_EQ(last_msg_.signature.data[9], 9) + << "incorrect value for last_msg_.signature.data[9], expected 9, is " + << last_msg_.signature.data[9]; + EXPECT_EQ(last_msg_.signature.data[10], 10) + << "incorrect value for last_msg_.signature.data[10], expected 10, is " + << last_msg_.signature.data[10]; + EXPECT_EQ(last_msg_.signature.data[11], 11) + << "incorrect value for last_msg_.signature.data[11], expected 11, is " + << last_msg_.signature.data[11]; + EXPECT_EQ(last_msg_.signature.data[12], 12) + << "incorrect value for last_msg_.signature.data[12], expected 12, is " + << last_msg_.signature.data[12]; + EXPECT_EQ(last_msg_.signature.data[13], 13) + << "incorrect value for last_msg_.signature.data[13], expected 13, is " + << last_msg_.signature.data[13]; + EXPECT_EQ(last_msg_.signature.data[14], 14) + << "incorrect value for last_msg_.signature.data[14], expected 14, is " + << last_msg_.signature.data[14]; + EXPECT_EQ(last_msg_.signature.data[15], 15) + << "incorrect value for last_msg_.signature.data[15], expected 15, is " + << last_msg_.signature.data[15]; + EXPECT_EQ(last_msg_.signature.data[16], 16) + << "incorrect value for last_msg_.signature.data[16], expected 16, is " + << last_msg_.signature.data[16]; + EXPECT_EQ(last_msg_.signature.data[17], 17) + << "incorrect value for last_msg_.signature.data[17], expected 17, is " + << last_msg_.signature.data[17]; + EXPECT_EQ(last_msg_.signature.data[18], 18) + << "incorrect value for last_msg_.signature.data[18], expected 18, is " + << last_msg_.signature.data[18]; + EXPECT_EQ(last_msg_.signature.data[19], 19) + << "incorrect value for last_msg_.signature.data[19], expected 19, is " + << last_msg_.signature.data[19]; + EXPECT_EQ(last_msg_.signature.data[20], 20) + << "incorrect value for last_msg_.signature.data[20], expected 20, is " + << last_msg_.signature.data[20]; + EXPECT_EQ(last_msg_.signature.data[21], 21) + << "incorrect value for last_msg_.signature.data[21], expected 21, is " + << last_msg_.signature.data[21]; + EXPECT_EQ(last_msg_.signature.data[22], 22) + << "incorrect value for last_msg_.signature.data[22], expected 22, is " + << last_msg_.signature.data[22]; + EXPECT_EQ(last_msg_.signature.data[23], 23) + << "incorrect value for last_msg_.signature.data[23], expected 23, is " + << last_msg_.signature.data[23]; + EXPECT_EQ(last_msg_.signature.data[24], 24) + << "incorrect value for last_msg_.signature.data[24], expected 24, is " + << last_msg_.signature.data[24]; + EXPECT_EQ(last_msg_.signature.data[25], 25) + << "incorrect value for last_msg_.signature.data[25], expected 25, is " + << last_msg_.signature.data[25]; + EXPECT_EQ(last_msg_.signature.data[26], 26) + << "incorrect value for last_msg_.signature.data[26], expected 26, is " + << last_msg_.signature.data[26]; + EXPECT_EQ(last_msg_.signature.data[27], 27) + << "incorrect value for last_msg_.signature.data[27], expected 27, is " + << last_msg_.signature.data[27]; + EXPECT_EQ(last_msg_.signature.data[28], 28) + << "incorrect value for last_msg_.signature.data[28], expected 28, is " + << last_msg_.signature.data[28]; + EXPECT_EQ(last_msg_.signature.data[29], 29) + << "incorrect value for last_msg_.signature.data[29], expected 29, is " + << last_msg_.signature.data[29]; + EXPECT_EQ(last_msg_.signature.data[30], 30) + << "incorrect value for last_msg_.signature.data[30], expected 30, is " + << last_msg_.signature.data[30]; + EXPECT_EQ(last_msg_.signature.data[31], 31) + << "incorrect value for last_msg_.signature.data[31], expected 31, is " + << last_msg_.signature.data[31]; + EXPECT_EQ(last_msg_.signature.data[32], 32) + << "incorrect value for last_msg_.signature.data[32], expected 32, is " + << last_msg_.signature.data[32]; + EXPECT_EQ(last_msg_.signature.data[33], 33) + << "incorrect value for last_msg_.signature.data[33], expected 33, is " + << last_msg_.signature.data[33]; + EXPECT_EQ(last_msg_.signature.data[34], 34) + << "incorrect value for last_msg_.signature.data[34], expected 34, is " + << last_msg_.signature.data[34]; + EXPECT_EQ(last_msg_.signature.data[35], 35) + << "incorrect value for last_msg_.signature.data[35], expected 35, is " + << last_msg_.signature.data[35]; + EXPECT_EQ(last_msg_.signature.data[36], 36) + << "incorrect value for last_msg_.signature.data[36], expected 36, is " + << last_msg_.signature.data[36]; + EXPECT_EQ(last_msg_.signature.data[37], 37) + << "incorrect value for last_msg_.signature.data[37], expected 37, is " + << last_msg_.signature.data[37]; + EXPECT_EQ(last_msg_.signature.data[38], 38) + << "incorrect value for last_msg_.signature.data[38], expected 38, is " + << last_msg_.signature.data[38]; + EXPECT_EQ(last_msg_.signature.data[39], 39) + << "incorrect value for last_msg_.signature.data[39], expected 39, is " + << last_msg_.signature.data[39]; + EXPECT_EQ(last_msg_.signature.data[40], 40) + << "incorrect value for last_msg_.signature.data[40], expected 40, is " + << last_msg_.signature.data[40]; + EXPECT_EQ(last_msg_.signature.data[41], 41) + << "incorrect value for last_msg_.signature.data[41], expected 41, is " + << last_msg_.signature.data[41]; + EXPECT_EQ(last_msg_.signature.data[42], 42) + << "incorrect value for last_msg_.signature.data[42], expected 42, is " + << last_msg_.signature.data[42]; + EXPECT_EQ(last_msg_.signature.data[43], 43) + << "incorrect value for last_msg_.signature.data[43], expected 43, is " + << last_msg_.signature.data[43]; + EXPECT_EQ(last_msg_.signature.data[44], 44) + << "incorrect value for last_msg_.signature.data[44], expected 44, is " + << last_msg_.signature.data[44]; + EXPECT_EQ(last_msg_.signature.data[45], 45) + << "incorrect value for last_msg_.signature.data[45], expected 45, is " + << last_msg_.signature.data[45]; + EXPECT_EQ(last_msg_.signature.data[46], 46) + << "incorrect value for last_msg_.signature.data[46], expected 46, is " + << last_msg_.signature.data[46]; + EXPECT_EQ(last_msg_.signature.data[47], 47) + << "incorrect value for last_msg_.signature.data[47], expected 47, is " + << last_msg_.signature.data[47]; + EXPECT_EQ(last_msg_.signature.data[48], 48) + << "incorrect value for last_msg_.signature.data[48], expected 48, is " + << last_msg_.signature.data[48]; + EXPECT_EQ(last_msg_.signature.data[49], 49) + << "incorrect value for last_msg_.signature.data[49], expected 49, is " + << last_msg_.signature.data[49]; + EXPECT_EQ(last_msg_.signature.data[50], 50) + << "incorrect value for last_msg_.signature.data[50], expected 50, is " + << last_msg_.signature.data[50]; + EXPECT_EQ(last_msg_.signature.data[51], 51) + << "incorrect value for last_msg_.signature.data[51], expected 51, is " + << last_msg_.signature.data[51]; + EXPECT_EQ(last_msg_.signature.data[52], 52) + << "incorrect value for last_msg_.signature.data[52], expected 52, is " + << last_msg_.signature.data[52]; + EXPECT_EQ(last_msg_.signature.data[53], 53) + << "incorrect value for last_msg_.signature.data[53], expected 53, is " + << last_msg_.signature.data[53]; + EXPECT_EQ(last_msg_.signature.data[54], 54) + << "incorrect value for last_msg_.signature.data[54], expected 54, is " + << last_msg_.signature.data[54]; + EXPECT_EQ(last_msg_.signature.data[55], 55) + << "incorrect value for last_msg_.signature.data[55], expected 55, is " + << last_msg_.signature.data[55]; + EXPECT_EQ(last_msg_.signature.data[56], 56) + << "incorrect value for last_msg_.signature.data[56], expected 56, is " + << last_msg_.signature.data[56]; + EXPECT_EQ(last_msg_.signature.data[57], 57) + << "incorrect value for last_msg_.signature.data[57], expected 57, is " + << last_msg_.signature.data[57]; + EXPECT_EQ(last_msg_.signature.data[58], 58) + << "incorrect value for last_msg_.signature.data[58], expected 58, is " + << last_msg_.signature.data[58]; + EXPECT_EQ(last_msg_.signature.data[59], 59) + << "incorrect value for last_msg_.signature.data[59], expected 59, is " + << last_msg_.signature.data[59]; + EXPECT_EQ(last_msg_.signature.data[60], 60) + << "incorrect value for last_msg_.signature.data[60], expected 60, is " + << last_msg_.signature.data[60]; + EXPECT_EQ(last_msg_.signature.data[61], 61) + << "incorrect value for last_msg_.signature.data[61], expected 61, is " + << last_msg_.signature.data[61]; + EXPECT_EQ(last_msg_.signature.data[62], 62) + << "incorrect value for last_msg_.signature.data[62], expected 62, is " + << last_msg_.signature.data[62]; + EXPECT_EQ(last_msg_.signature.data[63], 63) + << "incorrect value for last_msg_.signature.data[63], expected 63, is " + << last_msg_.signature.data[63]; + EXPECT_EQ(last_msg_.signature.data[64], 64) + << "incorrect value for last_msg_.signature.data[64], expected 64, is " + << last_msg_.signature.data[64]; + EXPECT_EQ(last_msg_.signature.data[65], 65) + << "incorrect value for last_msg_.signature.data[65], expected 65, is " + << last_msg_.signature.data[65]; + EXPECT_EQ(last_msg_.signature.data[66], 66) + << "incorrect value for last_msg_.signature.data[66], expected 66, is " + << last_msg_.signature.data[66]; + EXPECT_EQ(last_msg_.signature.data[67], 67) + << "incorrect value for last_msg_.signature.data[67], expected 67, is " + << last_msg_.signature.data[67]; + EXPECT_EQ(last_msg_.signature.data[68], 68) + << "incorrect value for last_msg_.signature.data[68], expected 68, is " + << last_msg_.signature.data[68]; + EXPECT_EQ(last_msg_.signature.data[69], 69) + << "incorrect value for last_msg_.signature.data[69], expected 69, is " + << last_msg_.signature.data[69]; + EXPECT_EQ(last_msg_.signature.data[70], 70) + << "incorrect value for last_msg_.signature.data[70], expected 70, is " + << last_msg_.signature.data[70]; + EXPECT_EQ(last_msg_.signature.data[71], 71) + << "incorrect value for last_msg_.signature.data[71], expected 71, is " + << last_msg_.signature.data[71]; + EXPECT_EQ(last_msg_.signature.len, 72) + << "incorrect value for last_msg_.signature.len, expected 72, is " + << last_msg_.signature.len; + EXPECT_EQ(last_msg_.signed_messages[0], 10) + << "incorrect value for last_msg_.signed_messages[0], expected 10, is " + << last_msg_.signed_messages[0]; + EXPECT_EQ(last_msg_.signed_messages[1], 21) + << "incorrect value for last_msg_.signed_messages[1], expected 21, is " + << last_msg_.signed_messages[1]; + EXPECT_EQ(last_msg_.signed_messages[2], 23) + << "incorrect value for last_msg_.signed_messages[2], expected 23, is " + << last_msg_.signed_messages[2]; + EXPECT_EQ(last_msg_.stream_counter, 1) + << "incorrect value for last_msg_.stream_counter, expected 1, is " + << last_msg_.stream_counter; } diff --git a/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc index 9072a3077..09a4ca44b 100644 --- a/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc +++ b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_signing_MsgEcdsaSignatureDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_signing_MsgEcdsaSignatureDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_signing_MsgEcdsaSignatureDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_signing_MsgEcdsaSignatureDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ecdsa_signature_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ecdsa_signature_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,810 +67,1364 @@ class Test_auto_check_sbp_signing_MsgEcdsaSignatureDepA0 : sbp_msg_ecdsa_signature_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_signing_MsgEcdsaSignatureDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,6,12,66,0,255,0,1,2,1,2,3,4,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,10,21,23,63,140,37,130,106,28,40,165,179,73,178,60,126,114,78,113,27,95,3,62,104,145,96,19,92,123,14,90,153,183,9,72,81,118,112,124,16,182,76,146,115,58,144,17,105,66,31,135,54,100,84,181,103,11,88,133,155,167,173,143,86,158,20,168,132,141,102,50,48,71,147,53,87,1,108,138,36,134,139,163,82,43,52,150,12,30,110,156,107,120,91,122,69,164,170,116,25,94,5,22,24,162,175,38,157,98,44,160,47,97,142,8,74,13,177,15,128,26,131,154,65,169,55,136,125,171,161,29,129,151,68,166,51,70,45,56,79,149,99,42,101,152,39,89,180,64,49,6,80,172,32,109,2,119,93,176,0,33,57,34,18,85,121,137,83,111,59,7,77,4,117,159,148,35,61,41,67,46,127,75,174,97,172, }; - - sbp_msg_ecdsa_signature_dep_a_t test_msg{}; - - test_msg.certificate_id[0] = 1; - - test_msg.certificate_id[1] = 2; - - test_msg.certificate_id[2] = 3; - - test_msg.certificate_id[3] = 4; - test_msg.flags = 0; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_signed_messages.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)105,(char)103,(char)110,(char)101,(char)100,(char)95,(char)109,(char)101,(char)115,(char)115,(char)97,(char)103,(char)101,(char)115 }; - memcpy(test_msg.n_signed_messages.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_signed_messages.value = 184; - test_msg.on_demand_counter = 2; - - test_msg.signature[0] = 0; - - test_msg.signature[1] = 1; - - test_msg.signature[2] = 2; - - test_msg.signature[3] = 3; - - test_msg.signature[4] = 4; - - test_msg.signature[5] = 5; - - test_msg.signature[6] = 6; - - test_msg.signature[7] = 7; - - test_msg.signature[8] = 0; - - test_msg.signature[9] = 1; - - test_msg.signature[10] = 2; - - test_msg.signature[11] = 3; - - test_msg.signature[12] = 4; - - test_msg.signature[13] = 5; - - test_msg.signature[14] = 6; - - test_msg.signature[15] = 7; - - test_msg.signature[16] = 0; - - test_msg.signature[17] = 1; - - test_msg.signature[18] = 2; - - test_msg.signature[19] = 3; - - test_msg.signature[20] = 4; - - test_msg.signature[21] = 5; - - test_msg.signature[22] = 6; - - test_msg.signature[23] = 7; - - test_msg.signature[24] = 0; - - test_msg.signature[25] = 1; - - test_msg.signature[26] = 2; - - test_msg.signature[27] = 3; - - test_msg.signature[28] = 4; - - test_msg.signature[29] = 5; - - test_msg.signature[30] = 6; - - test_msg.signature[31] = 7; - - test_msg.signature[32] = 0; - - test_msg.signature[33] = 1; - - test_msg.signature[34] = 2; - - test_msg.signature[35] = 3; - - test_msg.signature[36] = 4; - - test_msg.signature[37] = 5; - - test_msg.signature[38] = 6; - - test_msg.signature[39] = 7; - - test_msg.signature[40] = 0; - - test_msg.signature[41] = 1; - - test_msg.signature[42] = 2; - - test_msg.signature[43] = 3; - - test_msg.signature[44] = 4; - - test_msg.signature[45] = 5; - - test_msg.signature[46] = 6; - - test_msg.signature[47] = 7; - - test_msg.signature[48] = 0; - - test_msg.signature[49] = 1; - - test_msg.signature[50] = 2; - - test_msg.signature[51] = 3; - - test_msg.signature[52] = 4; - - test_msg.signature[53] = 5; - - test_msg.signature[54] = 6; - - test_msg.signature[55] = 7; - - test_msg.signature[56] = 0; - - test_msg.signature[57] = 1; - - test_msg.signature[58] = 2; - - test_msg.signature[59] = 3; - - test_msg.signature[60] = 4; - - test_msg.signature[61] = 5; - - test_msg.signature[62] = 6; - - test_msg.signature[63] = 7; - - test_msg.signed_messages[0] = 10; - - test_msg.signed_messages[1] = 21; - - test_msg.signed_messages[2] = 23; - - test_msg.signed_messages[3] = 63; - - test_msg.signed_messages[4] = 140; - - test_msg.signed_messages[5] = 37; - - test_msg.signed_messages[6] = 130; - - test_msg.signed_messages[7] = 106; - - test_msg.signed_messages[8] = 28; - - test_msg.signed_messages[9] = 40; - - test_msg.signed_messages[10] = 165; - - test_msg.signed_messages[11] = 179; - - test_msg.signed_messages[12] = 73; - - test_msg.signed_messages[13] = 178; - - test_msg.signed_messages[14] = 60; - - test_msg.signed_messages[15] = 126; - - test_msg.signed_messages[16] = 114; - - test_msg.signed_messages[17] = 78; - - test_msg.signed_messages[18] = 113; - - test_msg.signed_messages[19] = 27; - - test_msg.signed_messages[20] = 95; - - test_msg.signed_messages[21] = 3; - - test_msg.signed_messages[22] = 62; - - test_msg.signed_messages[23] = 104; - - test_msg.signed_messages[24] = 145; - - test_msg.signed_messages[25] = 96; - - test_msg.signed_messages[26] = 19; - - test_msg.signed_messages[27] = 92; - - test_msg.signed_messages[28] = 123; - - test_msg.signed_messages[29] = 14; - - test_msg.signed_messages[30] = 90; - - test_msg.signed_messages[31] = 153; - - test_msg.signed_messages[32] = 183; - - test_msg.signed_messages[33] = 9; - - test_msg.signed_messages[34] = 72; - - test_msg.signed_messages[35] = 81; - - test_msg.signed_messages[36] = 118; - - test_msg.signed_messages[37] = 112; - - test_msg.signed_messages[38] = 124; - - test_msg.signed_messages[39] = 16; - - test_msg.signed_messages[40] = 182; - - test_msg.signed_messages[41] = 76; - - test_msg.signed_messages[42] = 146; - - test_msg.signed_messages[43] = 115; - - test_msg.signed_messages[44] = 58; - - test_msg.signed_messages[45] = 144; - - test_msg.signed_messages[46] = 17; - - test_msg.signed_messages[47] = 105; - - test_msg.signed_messages[48] = 66; - - test_msg.signed_messages[49] = 31; - - test_msg.signed_messages[50] = 135; - - test_msg.signed_messages[51] = 54; - - test_msg.signed_messages[52] = 100; - - test_msg.signed_messages[53] = 84; - - test_msg.signed_messages[54] = 181; - - test_msg.signed_messages[55] = 103; - - test_msg.signed_messages[56] = 11; - - test_msg.signed_messages[57] = 88; - - test_msg.signed_messages[58] = 133; - - test_msg.signed_messages[59] = 155; - - test_msg.signed_messages[60] = 167; - - test_msg.signed_messages[61] = 173; - - test_msg.signed_messages[62] = 143; - - test_msg.signed_messages[63] = 86; - - test_msg.signed_messages[64] = 158; - - test_msg.signed_messages[65] = 20; - - test_msg.signed_messages[66] = 168; - - test_msg.signed_messages[67] = 132; - - test_msg.signed_messages[68] = 141; - - test_msg.signed_messages[69] = 102; - - test_msg.signed_messages[70] = 50; - - test_msg.signed_messages[71] = 48; - - test_msg.signed_messages[72] = 71; - - test_msg.signed_messages[73] = 147; - - test_msg.signed_messages[74] = 53; - - test_msg.signed_messages[75] = 87; - - test_msg.signed_messages[76] = 1; - - test_msg.signed_messages[77] = 108; - - test_msg.signed_messages[78] = 138; - - test_msg.signed_messages[79] = 36; - - test_msg.signed_messages[80] = 134; - - test_msg.signed_messages[81] = 139; - - test_msg.signed_messages[82] = 163; - - test_msg.signed_messages[83] = 82; - - test_msg.signed_messages[84] = 43; - - test_msg.signed_messages[85] = 52; - - test_msg.signed_messages[86] = 150; - - test_msg.signed_messages[87] = 12; - - test_msg.signed_messages[88] = 30; - - test_msg.signed_messages[89] = 110; - - test_msg.signed_messages[90] = 156; - - test_msg.signed_messages[91] = 107; - - test_msg.signed_messages[92] = 120; - - test_msg.signed_messages[93] = 91; - - test_msg.signed_messages[94] = 122; - - test_msg.signed_messages[95] = 69; - - test_msg.signed_messages[96] = 164; - - test_msg.signed_messages[97] = 170; - - test_msg.signed_messages[98] = 116; - - test_msg.signed_messages[99] = 25; - - test_msg.signed_messages[100] = 94; - - test_msg.signed_messages[101] = 5; - - test_msg.signed_messages[102] = 22; - - test_msg.signed_messages[103] = 24; - - test_msg.signed_messages[104] = 162; - - test_msg.signed_messages[105] = 175; - - test_msg.signed_messages[106] = 38; - - test_msg.signed_messages[107] = 157; - - test_msg.signed_messages[108] = 98; - - test_msg.signed_messages[109] = 44; - - test_msg.signed_messages[110] = 160; - - test_msg.signed_messages[111] = 47; - - test_msg.signed_messages[112] = 97; - - test_msg.signed_messages[113] = 142; - - test_msg.signed_messages[114] = 8; - - test_msg.signed_messages[115] = 74; - - test_msg.signed_messages[116] = 13; - - test_msg.signed_messages[117] = 177; - - test_msg.signed_messages[118] = 15; - - test_msg.signed_messages[119] = 128; - - test_msg.signed_messages[120] = 26; - - test_msg.signed_messages[121] = 131; - - test_msg.signed_messages[122] = 154; - - test_msg.signed_messages[123] = 65; - - test_msg.signed_messages[124] = 169; - - test_msg.signed_messages[125] = 55; - - test_msg.signed_messages[126] = 136; - - test_msg.signed_messages[127] = 125; - - test_msg.signed_messages[128] = 171; - - test_msg.signed_messages[129] = 161; - - test_msg.signed_messages[130] = 29; - - test_msg.signed_messages[131] = 129; - - test_msg.signed_messages[132] = 151; - - test_msg.signed_messages[133] = 68; - - test_msg.signed_messages[134] = 166; - - test_msg.signed_messages[135] = 51; - - test_msg.signed_messages[136] = 70; - - test_msg.signed_messages[137] = 45; - - test_msg.signed_messages[138] = 56; - - test_msg.signed_messages[139] = 79; - - test_msg.signed_messages[140] = 149; - - test_msg.signed_messages[141] = 99; - - test_msg.signed_messages[142] = 42; - - test_msg.signed_messages[143] = 101; - - test_msg.signed_messages[144] = 152; - - test_msg.signed_messages[145] = 39; - - test_msg.signed_messages[146] = 89; - - test_msg.signed_messages[147] = 180; - - test_msg.signed_messages[148] = 64; - - test_msg.signed_messages[149] = 49; - - test_msg.signed_messages[150] = 6; - - test_msg.signed_messages[151] = 80; - - test_msg.signed_messages[152] = 172; - - test_msg.signed_messages[153] = 32; - - test_msg.signed_messages[154] = 109; - - test_msg.signed_messages[155] = 2; - - test_msg.signed_messages[156] = 119; - - test_msg.signed_messages[157] = 93; - - test_msg.signed_messages[158] = 176; - - test_msg.signed_messages[159] = 0; - - test_msg.signed_messages[160] = 33; - - test_msg.signed_messages[161] = 57; - - test_msg.signed_messages[162] = 34; - - test_msg.signed_messages[163] = 18; - - test_msg.signed_messages[164] = 85; - - test_msg.signed_messages[165] = 121; - - test_msg.signed_messages[166] = 137; - - test_msg.signed_messages[167] = 83; - - test_msg.signed_messages[168] = 111; - - test_msg.signed_messages[169] = 59; - - test_msg.signed_messages[170] = 7; - - test_msg.signed_messages[171] = 77; - - test_msg.signed_messages[172] = 4; - - test_msg.signed_messages[173] = 117; - - test_msg.signed_messages[174] = 159; - - test_msg.signed_messages[175] = 148; - - test_msg.signed_messages[176] = 35; - - test_msg.signed_messages[177] = 61; - - test_msg.signed_messages[178] = 41; - - test_msg.signed_messages[179] = 67; - - test_msg.signed_messages[180] = 46; - - test_msg.signed_messages[181] = 127; - - test_msg.signed_messages[182] = 75; - - test_msg.signed_messages[183] = 174; - test_msg.stream_counter = 1; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.certificate_id[0], 1) << "incorrect value for last_msg_.certificate_id[0], expected 1, is " << last_msg_.certificate_id[0]; - EXPECT_EQ(last_msg_.certificate_id[1], 2) << "incorrect value for last_msg_.certificate_id[1], expected 2, is " << last_msg_.certificate_id[1]; - EXPECT_EQ(last_msg_.certificate_id[2], 3) << "incorrect value for last_msg_.certificate_id[2], expected 3, is " << last_msg_.certificate_id[2]; - EXPECT_EQ(last_msg_.certificate_id[3], 4) << "incorrect value for last_msg_.certificate_id[3], expected 4, is " << last_msg_.certificate_id[3]; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_signed_messages.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_signed_messages.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_signed_messages.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)105,(char)103,(char)110,(char)101,(char)100,(char)95,(char)109,(char)101,(char)115,(char)115,(char)97,(char)103,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_signed_messages.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_signed_messages.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_signed_messages.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_signed_messages.value, 184) << "incorrect value for last_msg_.n_signed_messages.value, expected 184, is " << last_msg_.n_signed_messages.value; - EXPECT_EQ(last_msg_.on_demand_counter, 2) << "incorrect value for last_msg_.on_demand_counter, expected 2, is " << last_msg_.on_demand_counter; - EXPECT_EQ(last_msg_.signature[0], 0) << "incorrect value for last_msg_.signature[0], expected 0, is " << last_msg_.signature[0]; - EXPECT_EQ(last_msg_.signature[1], 1) << "incorrect value for last_msg_.signature[1], expected 1, is " << last_msg_.signature[1]; - EXPECT_EQ(last_msg_.signature[2], 2) << "incorrect value for last_msg_.signature[2], expected 2, is " << last_msg_.signature[2]; - EXPECT_EQ(last_msg_.signature[3], 3) << "incorrect value for last_msg_.signature[3], expected 3, is " << last_msg_.signature[3]; - EXPECT_EQ(last_msg_.signature[4], 4) << "incorrect value for last_msg_.signature[4], expected 4, is " << last_msg_.signature[4]; - EXPECT_EQ(last_msg_.signature[5], 5) << "incorrect value for last_msg_.signature[5], expected 5, is " << last_msg_.signature[5]; - EXPECT_EQ(last_msg_.signature[6], 6) << "incorrect value for last_msg_.signature[6], expected 6, is " << last_msg_.signature[6]; - EXPECT_EQ(last_msg_.signature[7], 7) << "incorrect value for last_msg_.signature[7], expected 7, is " << last_msg_.signature[7]; - EXPECT_EQ(last_msg_.signature[8], 0) << "incorrect value for last_msg_.signature[8], expected 0, is " << last_msg_.signature[8]; - EXPECT_EQ(last_msg_.signature[9], 1) << "incorrect value for last_msg_.signature[9], expected 1, is " << last_msg_.signature[9]; - EXPECT_EQ(last_msg_.signature[10], 2) << "incorrect value for last_msg_.signature[10], expected 2, is " << last_msg_.signature[10]; - EXPECT_EQ(last_msg_.signature[11], 3) << "incorrect value for last_msg_.signature[11], expected 3, is " << last_msg_.signature[11]; - EXPECT_EQ(last_msg_.signature[12], 4) << "incorrect value for last_msg_.signature[12], expected 4, is " << last_msg_.signature[12]; - EXPECT_EQ(last_msg_.signature[13], 5) << "incorrect value for last_msg_.signature[13], expected 5, is " << last_msg_.signature[13]; - EXPECT_EQ(last_msg_.signature[14], 6) << "incorrect value for last_msg_.signature[14], expected 6, is " << last_msg_.signature[14]; - EXPECT_EQ(last_msg_.signature[15], 7) << "incorrect value for last_msg_.signature[15], expected 7, is " << last_msg_.signature[15]; - EXPECT_EQ(last_msg_.signature[16], 0) << "incorrect value for last_msg_.signature[16], expected 0, is " << last_msg_.signature[16]; - EXPECT_EQ(last_msg_.signature[17], 1) << "incorrect value for last_msg_.signature[17], expected 1, is " << last_msg_.signature[17]; - EXPECT_EQ(last_msg_.signature[18], 2) << "incorrect value for last_msg_.signature[18], expected 2, is " << last_msg_.signature[18]; - EXPECT_EQ(last_msg_.signature[19], 3) << "incorrect value for last_msg_.signature[19], expected 3, is " << last_msg_.signature[19]; - EXPECT_EQ(last_msg_.signature[20], 4) << "incorrect value for last_msg_.signature[20], expected 4, is " << last_msg_.signature[20]; - EXPECT_EQ(last_msg_.signature[21], 5) << "incorrect value for last_msg_.signature[21], expected 5, is " << last_msg_.signature[21]; - EXPECT_EQ(last_msg_.signature[22], 6) << "incorrect value for last_msg_.signature[22], expected 6, is " << last_msg_.signature[22]; - EXPECT_EQ(last_msg_.signature[23], 7) << "incorrect value for last_msg_.signature[23], expected 7, is " << last_msg_.signature[23]; - EXPECT_EQ(last_msg_.signature[24], 0) << "incorrect value for last_msg_.signature[24], expected 0, is " << last_msg_.signature[24]; - EXPECT_EQ(last_msg_.signature[25], 1) << "incorrect value for last_msg_.signature[25], expected 1, is " << last_msg_.signature[25]; - EXPECT_EQ(last_msg_.signature[26], 2) << "incorrect value for last_msg_.signature[26], expected 2, is " << last_msg_.signature[26]; - EXPECT_EQ(last_msg_.signature[27], 3) << "incorrect value for last_msg_.signature[27], expected 3, is " << last_msg_.signature[27]; - EXPECT_EQ(last_msg_.signature[28], 4) << "incorrect value for last_msg_.signature[28], expected 4, is " << last_msg_.signature[28]; - EXPECT_EQ(last_msg_.signature[29], 5) << "incorrect value for last_msg_.signature[29], expected 5, is " << last_msg_.signature[29]; - EXPECT_EQ(last_msg_.signature[30], 6) << "incorrect value for last_msg_.signature[30], expected 6, is " << last_msg_.signature[30]; - EXPECT_EQ(last_msg_.signature[31], 7) << "incorrect value for last_msg_.signature[31], expected 7, is " << last_msg_.signature[31]; - EXPECT_EQ(last_msg_.signature[32], 0) << "incorrect value for last_msg_.signature[32], expected 0, is " << last_msg_.signature[32]; - EXPECT_EQ(last_msg_.signature[33], 1) << "incorrect value for last_msg_.signature[33], expected 1, is " << last_msg_.signature[33]; - EXPECT_EQ(last_msg_.signature[34], 2) << "incorrect value for last_msg_.signature[34], expected 2, is " << last_msg_.signature[34]; - EXPECT_EQ(last_msg_.signature[35], 3) << "incorrect value for last_msg_.signature[35], expected 3, is " << last_msg_.signature[35]; - EXPECT_EQ(last_msg_.signature[36], 4) << "incorrect value for last_msg_.signature[36], expected 4, is " << last_msg_.signature[36]; - EXPECT_EQ(last_msg_.signature[37], 5) << "incorrect value for last_msg_.signature[37], expected 5, is " << last_msg_.signature[37]; - EXPECT_EQ(last_msg_.signature[38], 6) << "incorrect value for last_msg_.signature[38], expected 6, is " << last_msg_.signature[38]; - EXPECT_EQ(last_msg_.signature[39], 7) << "incorrect value for last_msg_.signature[39], expected 7, is " << last_msg_.signature[39]; - EXPECT_EQ(last_msg_.signature[40], 0) << "incorrect value for last_msg_.signature[40], expected 0, is " << last_msg_.signature[40]; - EXPECT_EQ(last_msg_.signature[41], 1) << "incorrect value for last_msg_.signature[41], expected 1, is " << last_msg_.signature[41]; - EXPECT_EQ(last_msg_.signature[42], 2) << "incorrect value for last_msg_.signature[42], expected 2, is " << last_msg_.signature[42]; - EXPECT_EQ(last_msg_.signature[43], 3) << "incorrect value for last_msg_.signature[43], expected 3, is " << last_msg_.signature[43]; - EXPECT_EQ(last_msg_.signature[44], 4) << "incorrect value for last_msg_.signature[44], expected 4, is " << last_msg_.signature[44]; - EXPECT_EQ(last_msg_.signature[45], 5) << "incorrect value for last_msg_.signature[45], expected 5, is " << last_msg_.signature[45]; - EXPECT_EQ(last_msg_.signature[46], 6) << "incorrect value for last_msg_.signature[46], expected 6, is " << last_msg_.signature[46]; - EXPECT_EQ(last_msg_.signature[47], 7) << "incorrect value for last_msg_.signature[47], expected 7, is " << last_msg_.signature[47]; - EXPECT_EQ(last_msg_.signature[48], 0) << "incorrect value for last_msg_.signature[48], expected 0, is " << last_msg_.signature[48]; - EXPECT_EQ(last_msg_.signature[49], 1) << "incorrect value for last_msg_.signature[49], expected 1, is " << last_msg_.signature[49]; - EXPECT_EQ(last_msg_.signature[50], 2) << "incorrect value for last_msg_.signature[50], expected 2, is " << last_msg_.signature[50]; - EXPECT_EQ(last_msg_.signature[51], 3) << "incorrect value for last_msg_.signature[51], expected 3, is " << last_msg_.signature[51]; - EXPECT_EQ(last_msg_.signature[52], 4) << "incorrect value for last_msg_.signature[52], expected 4, is " << last_msg_.signature[52]; - EXPECT_EQ(last_msg_.signature[53], 5) << "incorrect value for last_msg_.signature[53], expected 5, is " << last_msg_.signature[53]; - EXPECT_EQ(last_msg_.signature[54], 6) << "incorrect value for last_msg_.signature[54], expected 6, is " << last_msg_.signature[54]; - EXPECT_EQ(last_msg_.signature[55], 7) << "incorrect value for last_msg_.signature[55], expected 7, is " << last_msg_.signature[55]; - EXPECT_EQ(last_msg_.signature[56], 0) << "incorrect value for last_msg_.signature[56], expected 0, is " << last_msg_.signature[56]; - EXPECT_EQ(last_msg_.signature[57], 1) << "incorrect value for last_msg_.signature[57], expected 1, is " << last_msg_.signature[57]; - EXPECT_EQ(last_msg_.signature[58], 2) << "incorrect value for last_msg_.signature[58], expected 2, is " << last_msg_.signature[58]; - EXPECT_EQ(last_msg_.signature[59], 3) << "incorrect value for last_msg_.signature[59], expected 3, is " << last_msg_.signature[59]; - EXPECT_EQ(last_msg_.signature[60], 4) << "incorrect value for last_msg_.signature[60], expected 4, is " << last_msg_.signature[60]; - EXPECT_EQ(last_msg_.signature[61], 5) << "incorrect value for last_msg_.signature[61], expected 5, is " << last_msg_.signature[61]; - EXPECT_EQ(last_msg_.signature[62], 6) << "incorrect value for last_msg_.signature[62], expected 6, is " << last_msg_.signature[62]; - EXPECT_EQ(last_msg_.signature[63], 7) << "incorrect value for last_msg_.signature[63], expected 7, is " << last_msg_.signature[63]; - EXPECT_EQ(last_msg_.signed_messages[0], 10) << "incorrect value for last_msg_.signed_messages[0], expected 10, is " << last_msg_.signed_messages[0]; - EXPECT_EQ(last_msg_.signed_messages[1], 21) << "incorrect value for last_msg_.signed_messages[1], expected 21, is " << last_msg_.signed_messages[1]; - EXPECT_EQ(last_msg_.signed_messages[2], 23) << "incorrect value for last_msg_.signed_messages[2], expected 23, is " << last_msg_.signed_messages[2]; - EXPECT_EQ(last_msg_.signed_messages[3], 63) << "incorrect value for last_msg_.signed_messages[3], expected 63, is " << last_msg_.signed_messages[3]; - EXPECT_EQ(last_msg_.signed_messages[4], 140) << "incorrect value for last_msg_.signed_messages[4], expected 140, is " << last_msg_.signed_messages[4]; - EXPECT_EQ(last_msg_.signed_messages[5], 37) << "incorrect value for last_msg_.signed_messages[5], expected 37, is " << last_msg_.signed_messages[5]; - EXPECT_EQ(last_msg_.signed_messages[6], 130) << "incorrect value for last_msg_.signed_messages[6], expected 130, is " << last_msg_.signed_messages[6]; - EXPECT_EQ(last_msg_.signed_messages[7], 106) << "incorrect value for last_msg_.signed_messages[7], expected 106, is " << last_msg_.signed_messages[7]; - EXPECT_EQ(last_msg_.signed_messages[8], 28) << "incorrect value for last_msg_.signed_messages[8], expected 28, is " << last_msg_.signed_messages[8]; - EXPECT_EQ(last_msg_.signed_messages[9], 40) << "incorrect value for last_msg_.signed_messages[9], expected 40, is " << last_msg_.signed_messages[9]; - EXPECT_EQ(last_msg_.signed_messages[10], 165) << "incorrect value for last_msg_.signed_messages[10], expected 165, is " << last_msg_.signed_messages[10]; - EXPECT_EQ(last_msg_.signed_messages[11], 179) << "incorrect value for last_msg_.signed_messages[11], expected 179, is " << last_msg_.signed_messages[11]; - EXPECT_EQ(last_msg_.signed_messages[12], 73) << "incorrect value for last_msg_.signed_messages[12], expected 73, is " << last_msg_.signed_messages[12]; - EXPECT_EQ(last_msg_.signed_messages[13], 178) << "incorrect value for last_msg_.signed_messages[13], expected 178, is " << last_msg_.signed_messages[13]; - EXPECT_EQ(last_msg_.signed_messages[14], 60) << "incorrect value for last_msg_.signed_messages[14], expected 60, is " << last_msg_.signed_messages[14]; - EXPECT_EQ(last_msg_.signed_messages[15], 126) << "incorrect value for last_msg_.signed_messages[15], expected 126, is " << last_msg_.signed_messages[15]; - EXPECT_EQ(last_msg_.signed_messages[16], 114) << "incorrect value for last_msg_.signed_messages[16], expected 114, is " << last_msg_.signed_messages[16]; - EXPECT_EQ(last_msg_.signed_messages[17], 78) << "incorrect value for last_msg_.signed_messages[17], expected 78, is " << last_msg_.signed_messages[17]; - EXPECT_EQ(last_msg_.signed_messages[18], 113) << "incorrect value for last_msg_.signed_messages[18], expected 113, is " << last_msg_.signed_messages[18]; - EXPECT_EQ(last_msg_.signed_messages[19], 27) << "incorrect value for last_msg_.signed_messages[19], expected 27, is " << last_msg_.signed_messages[19]; - EXPECT_EQ(last_msg_.signed_messages[20], 95) << "incorrect value for last_msg_.signed_messages[20], expected 95, is " << last_msg_.signed_messages[20]; - EXPECT_EQ(last_msg_.signed_messages[21], 3) << "incorrect value for last_msg_.signed_messages[21], expected 3, is " << last_msg_.signed_messages[21]; - EXPECT_EQ(last_msg_.signed_messages[22], 62) << "incorrect value for last_msg_.signed_messages[22], expected 62, is " << last_msg_.signed_messages[22]; - EXPECT_EQ(last_msg_.signed_messages[23], 104) << "incorrect value for last_msg_.signed_messages[23], expected 104, is " << last_msg_.signed_messages[23]; - EXPECT_EQ(last_msg_.signed_messages[24], 145) << "incorrect value for last_msg_.signed_messages[24], expected 145, is " << last_msg_.signed_messages[24]; - EXPECT_EQ(last_msg_.signed_messages[25], 96) << "incorrect value for last_msg_.signed_messages[25], expected 96, is " << last_msg_.signed_messages[25]; - EXPECT_EQ(last_msg_.signed_messages[26], 19) << "incorrect value for last_msg_.signed_messages[26], expected 19, is " << last_msg_.signed_messages[26]; - EXPECT_EQ(last_msg_.signed_messages[27], 92) << "incorrect value for last_msg_.signed_messages[27], expected 92, is " << last_msg_.signed_messages[27]; - EXPECT_EQ(last_msg_.signed_messages[28], 123) << "incorrect value for last_msg_.signed_messages[28], expected 123, is " << last_msg_.signed_messages[28]; - EXPECT_EQ(last_msg_.signed_messages[29], 14) << "incorrect value for last_msg_.signed_messages[29], expected 14, is " << last_msg_.signed_messages[29]; - EXPECT_EQ(last_msg_.signed_messages[30], 90) << "incorrect value for last_msg_.signed_messages[30], expected 90, is " << last_msg_.signed_messages[30]; - EXPECT_EQ(last_msg_.signed_messages[31], 153) << "incorrect value for last_msg_.signed_messages[31], expected 153, is " << last_msg_.signed_messages[31]; - EXPECT_EQ(last_msg_.signed_messages[32], 183) << "incorrect value for last_msg_.signed_messages[32], expected 183, is " << last_msg_.signed_messages[32]; - EXPECT_EQ(last_msg_.signed_messages[33], 9) << "incorrect value for last_msg_.signed_messages[33], expected 9, is " << last_msg_.signed_messages[33]; - EXPECT_EQ(last_msg_.signed_messages[34], 72) << "incorrect value for last_msg_.signed_messages[34], expected 72, is " << last_msg_.signed_messages[34]; - EXPECT_EQ(last_msg_.signed_messages[35], 81) << "incorrect value for last_msg_.signed_messages[35], expected 81, is " << last_msg_.signed_messages[35]; - EXPECT_EQ(last_msg_.signed_messages[36], 118) << "incorrect value for last_msg_.signed_messages[36], expected 118, is " << last_msg_.signed_messages[36]; - EXPECT_EQ(last_msg_.signed_messages[37], 112) << "incorrect value for last_msg_.signed_messages[37], expected 112, is " << last_msg_.signed_messages[37]; - EXPECT_EQ(last_msg_.signed_messages[38], 124) << "incorrect value for last_msg_.signed_messages[38], expected 124, is " << last_msg_.signed_messages[38]; - EXPECT_EQ(last_msg_.signed_messages[39], 16) << "incorrect value for last_msg_.signed_messages[39], expected 16, is " << last_msg_.signed_messages[39]; - EXPECT_EQ(last_msg_.signed_messages[40], 182) << "incorrect value for last_msg_.signed_messages[40], expected 182, is " << last_msg_.signed_messages[40]; - EXPECT_EQ(last_msg_.signed_messages[41], 76) << "incorrect value for last_msg_.signed_messages[41], expected 76, is " << last_msg_.signed_messages[41]; - EXPECT_EQ(last_msg_.signed_messages[42], 146) << "incorrect value for last_msg_.signed_messages[42], expected 146, is " << last_msg_.signed_messages[42]; - EXPECT_EQ(last_msg_.signed_messages[43], 115) << "incorrect value for last_msg_.signed_messages[43], expected 115, is " << last_msg_.signed_messages[43]; - EXPECT_EQ(last_msg_.signed_messages[44], 58) << "incorrect value for last_msg_.signed_messages[44], expected 58, is " << last_msg_.signed_messages[44]; - EXPECT_EQ(last_msg_.signed_messages[45], 144) << "incorrect value for last_msg_.signed_messages[45], expected 144, is " << last_msg_.signed_messages[45]; - EXPECT_EQ(last_msg_.signed_messages[46], 17) << "incorrect value for last_msg_.signed_messages[46], expected 17, is " << last_msg_.signed_messages[46]; - EXPECT_EQ(last_msg_.signed_messages[47], 105) << "incorrect value for last_msg_.signed_messages[47], expected 105, is " << last_msg_.signed_messages[47]; - EXPECT_EQ(last_msg_.signed_messages[48], 66) << "incorrect value for last_msg_.signed_messages[48], expected 66, is " << last_msg_.signed_messages[48]; - EXPECT_EQ(last_msg_.signed_messages[49], 31) << "incorrect value for last_msg_.signed_messages[49], expected 31, is " << last_msg_.signed_messages[49]; - EXPECT_EQ(last_msg_.signed_messages[50], 135) << "incorrect value for last_msg_.signed_messages[50], expected 135, is " << last_msg_.signed_messages[50]; - EXPECT_EQ(last_msg_.signed_messages[51], 54) << "incorrect value for last_msg_.signed_messages[51], expected 54, is " << last_msg_.signed_messages[51]; - EXPECT_EQ(last_msg_.signed_messages[52], 100) << "incorrect value for last_msg_.signed_messages[52], expected 100, is " << last_msg_.signed_messages[52]; - EXPECT_EQ(last_msg_.signed_messages[53], 84) << "incorrect value for last_msg_.signed_messages[53], expected 84, is " << last_msg_.signed_messages[53]; - EXPECT_EQ(last_msg_.signed_messages[54], 181) << "incorrect value for last_msg_.signed_messages[54], expected 181, is " << last_msg_.signed_messages[54]; - EXPECT_EQ(last_msg_.signed_messages[55], 103) << "incorrect value for last_msg_.signed_messages[55], expected 103, is " << last_msg_.signed_messages[55]; - EXPECT_EQ(last_msg_.signed_messages[56], 11) << "incorrect value for last_msg_.signed_messages[56], expected 11, is " << last_msg_.signed_messages[56]; - EXPECT_EQ(last_msg_.signed_messages[57], 88) << "incorrect value for last_msg_.signed_messages[57], expected 88, is " << last_msg_.signed_messages[57]; - EXPECT_EQ(last_msg_.signed_messages[58], 133) << "incorrect value for last_msg_.signed_messages[58], expected 133, is " << last_msg_.signed_messages[58]; - EXPECT_EQ(last_msg_.signed_messages[59], 155) << "incorrect value for last_msg_.signed_messages[59], expected 155, is " << last_msg_.signed_messages[59]; - EXPECT_EQ(last_msg_.signed_messages[60], 167) << "incorrect value for last_msg_.signed_messages[60], expected 167, is " << last_msg_.signed_messages[60]; - EXPECT_EQ(last_msg_.signed_messages[61], 173) << "incorrect value for last_msg_.signed_messages[61], expected 173, is " << last_msg_.signed_messages[61]; - EXPECT_EQ(last_msg_.signed_messages[62], 143) << "incorrect value for last_msg_.signed_messages[62], expected 143, is " << last_msg_.signed_messages[62]; - EXPECT_EQ(last_msg_.signed_messages[63], 86) << "incorrect value for last_msg_.signed_messages[63], expected 86, is " << last_msg_.signed_messages[63]; - EXPECT_EQ(last_msg_.signed_messages[64], 158) << "incorrect value for last_msg_.signed_messages[64], expected 158, is " << last_msg_.signed_messages[64]; - EXPECT_EQ(last_msg_.signed_messages[65], 20) << "incorrect value for last_msg_.signed_messages[65], expected 20, is " << last_msg_.signed_messages[65]; - EXPECT_EQ(last_msg_.signed_messages[66], 168) << "incorrect value for last_msg_.signed_messages[66], expected 168, is " << last_msg_.signed_messages[66]; - EXPECT_EQ(last_msg_.signed_messages[67], 132) << "incorrect value for last_msg_.signed_messages[67], expected 132, is " << last_msg_.signed_messages[67]; - EXPECT_EQ(last_msg_.signed_messages[68], 141) << "incorrect value for last_msg_.signed_messages[68], expected 141, is " << last_msg_.signed_messages[68]; - EXPECT_EQ(last_msg_.signed_messages[69], 102) << "incorrect value for last_msg_.signed_messages[69], expected 102, is " << last_msg_.signed_messages[69]; - EXPECT_EQ(last_msg_.signed_messages[70], 50) << "incorrect value for last_msg_.signed_messages[70], expected 50, is " << last_msg_.signed_messages[70]; - EXPECT_EQ(last_msg_.signed_messages[71], 48) << "incorrect value for last_msg_.signed_messages[71], expected 48, is " << last_msg_.signed_messages[71]; - EXPECT_EQ(last_msg_.signed_messages[72], 71) << "incorrect value for last_msg_.signed_messages[72], expected 71, is " << last_msg_.signed_messages[72]; - EXPECT_EQ(last_msg_.signed_messages[73], 147) << "incorrect value for last_msg_.signed_messages[73], expected 147, is " << last_msg_.signed_messages[73]; - EXPECT_EQ(last_msg_.signed_messages[74], 53) << "incorrect value for last_msg_.signed_messages[74], expected 53, is " << last_msg_.signed_messages[74]; - EXPECT_EQ(last_msg_.signed_messages[75], 87) << "incorrect value for last_msg_.signed_messages[75], expected 87, is " << last_msg_.signed_messages[75]; - EXPECT_EQ(last_msg_.signed_messages[76], 1) << "incorrect value for last_msg_.signed_messages[76], expected 1, is " << last_msg_.signed_messages[76]; - EXPECT_EQ(last_msg_.signed_messages[77], 108) << "incorrect value for last_msg_.signed_messages[77], expected 108, is " << last_msg_.signed_messages[77]; - EXPECT_EQ(last_msg_.signed_messages[78], 138) << "incorrect value for last_msg_.signed_messages[78], expected 138, is " << last_msg_.signed_messages[78]; - EXPECT_EQ(last_msg_.signed_messages[79], 36) << "incorrect value for last_msg_.signed_messages[79], expected 36, is " << last_msg_.signed_messages[79]; - EXPECT_EQ(last_msg_.signed_messages[80], 134) << "incorrect value for last_msg_.signed_messages[80], expected 134, is " << last_msg_.signed_messages[80]; - EXPECT_EQ(last_msg_.signed_messages[81], 139) << "incorrect value for last_msg_.signed_messages[81], expected 139, is " << last_msg_.signed_messages[81]; - EXPECT_EQ(last_msg_.signed_messages[82], 163) << "incorrect value for last_msg_.signed_messages[82], expected 163, is " << last_msg_.signed_messages[82]; - EXPECT_EQ(last_msg_.signed_messages[83], 82) << "incorrect value for last_msg_.signed_messages[83], expected 82, is " << last_msg_.signed_messages[83]; - EXPECT_EQ(last_msg_.signed_messages[84], 43) << "incorrect value for last_msg_.signed_messages[84], expected 43, is " << last_msg_.signed_messages[84]; - EXPECT_EQ(last_msg_.signed_messages[85], 52) << "incorrect value for last_msg_.signed_messages[85], expected 52, is " << last_msg_.signed_messages[85]; - EXPECT_EQ(last_msg_.signed_messages[86], 150) << "incorrect value for last_msg_.signed_messages[86], expected 150, is " << last_msg_.signed_messages[86]; - EXPECT_EQ(last_msg_.signed_messages[87], 12) << "incorrect value for last_msg_.signed_messages[87], expected 12, is " << last_msg_.signed_messages[87]; - EXPECT_EQ(last_msg_.signed_messages[88], 30) << "incorrect value for last_msg_.signed_messages[88], expected 30, is " << last_msg_.signed_messages[88]; - EXPECT_EQ(last_msg_.signed_messages[89], 110) << "incorrect value for last_msg_.signed_messages[89], expected 110, is " << last_msg_.signed_messages[89]; - EXPECT_EQ(last_msg_.signed_messages[90], 156) << "incorrect value for last_msg_.signed_messages[90], expected 156, is " << last_msg_.signed_messages[90]; - EXPECT_EQ(last_msg_.signed_messages[91], 107) << "incorrect value for last_msg_.signed_messages[91], expected 107, is " << last_msg_.signed_messages[91]; - EXPECT_EQ(last_msg_.signed_messages[92], 120) << "incorrect value for last_msg_.signed_messages[92], expected 120, is " << last_msg_.signed_messages[92]; - EXPECT_EQ(last_msg_.signed_messages[93], 91) << "incorrect value for last_msg_.signed_messages[93], expected 91, is " << last_msg_.signed_messages[93]; - EXPECT_EQ(last_msg_.signed_messages[94], 122) << "incorrect value for last_msg_.signed_messages[94], expected 122, is " << last_msg_.signed_messages[94]; - EXPECT_EQ(last_msg_.signed_messages[95], 69) << "incorrect value for last_msg_.signed_messages[95], expected 69, is " << last_msg_.signed_messages[95]; - EXPECT_EQ(last_msg_.signed_messages[96], 164) << "incorrect value for last_msg_.signed_messages[96], expected 164, is " << last_msg_.signed_messages[96]; - EXPECT_EQ(last_msg_.signed_messages[97], 170) << "incorrect value for last_msg_.signed_messages[97], expected 170, is " << last_msg_.signed_messages[97]; - EXPECT_EQ(last_msg_.signed_messages[98], 116) << "incorrect value for last_msg_.signed_messages[98], expected 116, is " << last_msg_.signed_messages[98]; - EXPECT_EQ(last_msg_.signed_messages[99], 25) << "incorrect value for last_msg_.signed_messages[99], expected 25, is " << last_msg_.signed_messages[99]; - EXPECT_EQ(last_msg_.signed_messages[100], 94) << "incorrect value for last_msg_.signed_messages[100], expected 94, is " << last_msg_.signed_messages[100]; - EXPECT_EQ(last_msg_.signed_messages[101], 5) << "incorrect value for last_msg_.signed_messages[101], expected 5, is " << last_msg_.signed_messages[101]; - EXPECT_EQ(last_msg_.signed_messages[102], 22) << "incorrect value for last_msg_.signed_messages[102], expected 22, is " << last_msg_.signed_messages[102]; - EXPECT_EQ(last_msg_.signed_messages[103], 24) << "incorrect value for last_msg_.signed_messages[103], expected 24, is " << last_msg_.signed_messages[103]; - EXPECT_EQ(last_msg_.signed_messages[104], 162) << "incorrect value for last_msg_.signed_messages[104], expected 162, is " << last_msg_.signed_messages[104]; - EXPECT_EQ(last_msg_.signed_messages[105], 175) << "incorrect value for last_msg_.signed_messages[105], expected 175, is " << last_msg_.signed_messages[105]; - EXPECT_EQ(last_msg_.signed_messages[106], 38) << "incorrect value for last_msg_.signed_messages[106], expected 38, is " << last_msg_.signed_messages[106]; - EXPECT_EQ(last_msg_.signed_messages[107], 157) << "incorrect value for last_msg_.signed_messages[107], expected 157, is " << last_msg_.signed_messages[107]; - EXPECT_EQ(last_msg_.signed_messages[108], 98) << "incorrect value for last_msg_.signed_messages[108], expected 98, is " << last_msg_.signed_messages[108]; - EXPECT_EQ(last_msg_.signed_messages[109], 44) << "incorrect value for last_msg_.signed_messages[109], expected 44, is " << last_msg_.signed_messages[109]; - EXPECT_EQ(last_msg_.signed_messages[110], 160) << "incorrect value for last_msg_.signed_messages[110], expected 160, is " << last_msg_.signed_messages[110]; - EXPECT_EQ(last_msg_.signed_messages[111], 47) << "incorrect value for last_msg_.signed_messages[111], expected 47, is " << last_msg_.signed_messages[111]; - EXPECT_EQ(last_msg_.signed_messages[112], 97) << "incorrect value for last_msg_.signed_messages[112], expected 97, is " << last_msg_.signed_messages[112]; - EXPECT_EQ(last_msg_.signed_messages[113], 142) << "incorrect value for last_msg_.signed_messages[113], expected 142, is " << last_msg_.signed_messages[113]; - EXPECT_EQ(last_msg_.signed_messages[114], 8) << "incorrect value for last_msg_.signed_messages[114], expected 8, is " << last_msg_.signed_messages[114]; - EXPECT_EQ(last_msg_.signed_messages[115], 74) << "incorrect value for last_msg_.signed_messages[115], expected 74, is " << last_msg_.signed_messages[115]; - EXPECT_EQ(last_msg_.signed_messages[116], 13) << "incorrect value for last_msg_.signed_messages[116], expected 13, is " << last_msg_.signed_messages[116]; - EXPECT_EQ(last_msg_.signed_messages[117], 177) << "incorrect value for last_msg_.signed_messages[117], expected 177, is " << last_msg_.signed_messages[117]; - EXPECT_EQ(last_msg_.signed_messages[118], 15) << "incorrect value for last_msg_.signed_messages[118], expected 15, is " << last_msg_.signed_messages[118]; - EXPECT_EQ(last_msg_.signed_messages[119], 128) << "incorrect value for last_msg_.signed_messages[119], expected 128, is " << last_msg_.signed_messages[119]; - EXPECT_EQ(last_msg_.signed_messages[120], 26) << "incorrect value for last_msg_.signed_messages[120], expected 26, is " << last_msg_.signed_messages[120]; - EXPECT_EQ(last_msg_.signed_messages[121], 131) << "incorrect value for last_msg_.signed_messages[121], expected 131, is " << last_msg_.signed_messages[121]; - EXPECT_EQ(last_msg_.signed_messages[122], 154) << "incorrect value for last_msg_.signed_messages[122], expected 154, is " << last_msg_.signed_messages[122]; - EXPECT_EQ(last_msg_.signed_messages[123], 65) << "incorrect value for last_msg_.signed_messages[123], expected 65, is " << last_msg_.signed_messages[123]; - EXPECT_EQ(last_msg_.signed_messages[124], 169) << "incorrect value for last_msg_.signed_messages[124], expected 169, is " << last_msg_.signed_messages[124]; - EXPECT_EQ(last_msg_.signed_messages[125], 55) << "incorrect value for last_msg_.signed_messages[125], expected 55, is " << last_msg_.signed_messages[125]; - EXPECT_EQ(last_msg_.signed_messages[126], 136) << "incorrect value for last_msg_.signed_messages[126], expected 136, is " << last_msg_.signed_messages[126]; - EXPECT_EQ(last_msg_.signed_messages[127], 125) << "incorrect value for last_msg_.signed_messages[127], expected 125, is " << last_msg_.signed_messages[127]; - EXPECT_EQ(last_msg_.signed_messages[128], 171) << "incorrect value for last_msg_.signed_messages[128], expected 171, is " << last_msg_.signed_messages[128]; - EXPECT_EQ(last_msg_.signed_messages[129], 161) << "incorrect value for last_msg_.signed_messages[129], expected 161, is " << last_msg_.signed_messages[129]; - EXPECT_EQ(last_msg_.signed_messages[130], 29) << "incorrect value for last_msg_.signed_messages[130], expected 29, is " << last_msg_.signed_messages[130]; - EXPECT_EQ(last_msg_.signed_messages[131], 129) << "incorrect value for last_msg_.signed_messages[131], expected 129, is " << last_msg_.signed_messages[131]; - EXPECT_EQ(last_msg_.signed_messages[132], 151) << "incorrect value for last_msg_.signed_messages[132], expected 151, is " << last_msg_.signed_messages[132]; - EXPECT_EQ(last_msg_.signed_messages[133], 68) << "incorrect value for last_msg_.signed_messages[133], expected 68, is " << last_msg_.signed_messages[133]; - EXPECT_EQ(last_msg_.signed_messages[134], 166) << "incorrect value for last_msg_.signed_messages[134], expected 166, is " << last_msg_.signed_messages[134]; - EXPECT_EQ(last_msg_.signed_messages[135], 51) << "incorrect value for last_msg_.signed_messages[135], expected 51, is " << last_msg_.signed_messages[135]; - EXPECT_EQ(last_msg_.signed_messages[136], 70) << "incorrect value for last_msg_.signed_messages[136], expected 70, is " << last_msg_.signed_messages[136]; - EXPECT_EQ(last_msg_.signed_messages[137], 45) << "incorrect value for last_msg_.signed_messages[137], expected 45, is " << last_msg_.signed_messages[137]; - EXPECT_EQ(last_msg_.signed_messages[138], 56) << "incorrect value for last_msg_.signed_messages[138], expected 56, is " << last_msg_.signed_messages[138]; - EXPECT_EQ(last_msg_.signed_messages[139], 79) << "incorrect value for last_msg_.signed_messages[139], expected 79, is " << last_msg_.signed_messages[139]; - EXPECT_EQ(last_msg_.signed_messages[140], 149) << "incorrect value for last_msg_.signed_messages[140], expected 149, is " << last_msg_.signed_messages[140]; - EXPECT_EQ(last_msg_.signed_messages[141], 99) << "incorrect value for last_msg_.signed_messages[141], expected 99, is " << last_msg_.signed_messages[141]; - EXPECT_EQ(last_msg_.signed_messages[142], 42) << "incorrect value for last_msg_.signed_messages[142], expected 42, is " << last_msg_.signed_messages[142]; - EXPECT_EQ(last_msg_.signed_messages[143], 101) << "incorrect value for last_msg_.signed_messages[143], expected 101, is " << last_msg_.signed_messages[143]; - EXPECT_EQ(last_msg_.signed_messages[144], 152) << "incorrect value for last_msg_.signed_messages[144], expected 152, is " << last_msg_.signed_messages[144]; - EXPECT_EQ(last_msg_.signed_messages[145], 39) << "incorrect value for last_msg_.signed_messages[145], expected 39, is " << last_msg_.signed_messages[145]; - EXPECT_EQ(last_msg_.signed_messages[146], 89) << "incorrect value for last_msg_.signed_messages[146], expected 89, is " << last_msg_.signed_messages[146]; - EXPECT_EQ(last_msg_.signed_messages[147], 180) << "incorrect value for last_msg_.signed_messages[147], expected 180, is " << last_msg_.signed_messages[147]; - EXPECT_EQ(last_msg_.signed_messages[148], 64) << "incorrect value for last_msg_.signed_messages[148], expected 64, is " << last_msg_.signed_messages[148]; - EXPECT_EQ(last_msg_.signed_messages[149], 49) << "incorrect value for last_msg_.signed_messages[149], expected 49, is " << last_msg_.signed_messages[149]; - EXPECT_EQ(last_msg_.signed_messages[150], 6) << "incorrect value for last_msg_.signed_messages[150], expected 6, is " << last_msg_.signed_messages[150]; - EXPECT_EQ(last_msg_.signed_messages[151], 80) << "incorrect value for last_msg_.signed_messages[151], expected 80, is " << last_msg_.signed_messages[151]; - EXPECT_EQ(last_msg_.signed_messages[152], 172) << "incorrect value for last_msg_.signed_messages[152], expected 172, is " << last_msg_.signed_messages[152]; - EXPECT_EQ(last_msg_.signed_messages[153], 32) << "incorrect value for last_msg_.signed_messages[153], expected 32, is " << last_msg_.signed_messages[153]; - EXPECT_EQ(last_msg_.signed_messages[154], 109) << "incorrect value for last_msg_.signed_messages[154], expected 109, is " << last_msg_.signed_messages[154]; - EXPECT_EQ(last_msg_.signed_messages[155], 2) << "incorrect value for last_msg_.signed_messages[155], expected 2, is " << last_msg_.signed_messages[155]; - EXPECT_EQ(last_msg_.signed_messages[156], 119) << "incorrect value for last_msg_.signed_messages[156], expected 119, is " << last_msg_.signed_messages[156]; - EXPECT_EQ(last_msg_.signed_messages[157], 93) << "incorrect value for last_msg_.signed_messages[157], expected 93, is " << last_msg_.signed_messages[157]; - EXPECT_EQ(last_msg_.signed_messages[158], 176) << "incorrect value for last_msg_.signed_messages[158], expected 176, is " << last_msg_.signed_messages[158]; - EXPECT_EQ(last_msg_.signed_messages[159], 0) << "incorrect value for last_msg_.signed_messages[159], expected 0, is " << last_msg_.signed_messages[159]; - EXPECT_EQ(last_msg_.signed_messages[160], 33) << "incorrect value for last_msg_.signed_messages[160], expected 33, is " << last_msg_.signed_messages[160]; - EXPECT_EQ(last_msg_.signed_messages[161], 57) << "incorrect value for last_msg_.signed_messages[161], expected 57, is " << last_msg_.signed_messages[161]; - EXPECT_EQ(last_msg_.signed_messages[162], 34) << "incorrect value for last_msg_.signed_messages[162], expected 34, is " << last_msg_.signed_messages[162]; - EXPECT_EQ(last_msg_.signed_messages[163], 18) << "incorrect value for last_msg_.signed_messages[163], expected 18, is " << last_msg_.signed_messages[163]; - EXPECT_EQ(last_msg_.signed_messages[164], 85) << "incorrect value for last_msg_.signed_messages[164], expected 85, is " << last_msg_.signed_messages[164]; - EXPECT_EQ(last_msg_.signed_messages[165], 121) << "incorrect value for last_msg_.signed_messages[165], expected 121, is " << last_msg_.signed_messages[165]; - EXPECT_EQ(last_msg_.signed_messages[166], 137) << "incorrect value for last_msg_.signed_messages[166], expected 137, is " << last_msg_.signed_messages[166]; - EXPECT_EQ(last_msg_.signed_messages[167], 83) << "incorrect value for last_msg_.signed_messages[167], expected 83, is " << last_msg_.signed_messages[167]; - EXPECT_EQ(last_msg_.signed_messages[168], 111) << "incorrect value for last_msg_.signed_messages[168], expected 111, is " << last_msg_.signed_messages[168]; - EXPECT_EQ(last_msg_.signed_messages[169], 59) << "incorrect value for last_msg_.signed_messages[169], expected 59, is " << last_msg_.signed_messages[169]; - EXPECT_EQ(last_msg_.signed_messages[170], 7) << "incorrect value for last_msg_.signed_messages[170], expected 7, is " << last_msg_.signed_messages[170]; - EXPECT_EQ(last_msg_.signed_messages[171], 77) << "incorrect value for last_msg_.signed_messages[171], expected 77, is " << last_msg_.signed_messages[171]; - EXPECT_EQ(last_msg_.signed_messages[172], 4) << "incorrect value for last_msg_.signed_messages[172], expected 4, is " << last_msg_.signed_messages[172]; - EXPECT_EQ(last_msg_.signed_messages[173], 117) << "incorrect value for last_msg_.signed_messages[173], expected 117, is " << last_msg_.signed_messages[173]; - EXPECT_EQ(last_msg_.signed_messages[174], 159) << "incorrect value for last_msg_.signed_messages[174], expected 159, is " << last_msg_.signed_messages[174]; - EXPECT_EQ(last_msg_.signed_messages[175], 148) << "incorrect value for last_msg_.signed_messages[175], expected 148, is " << last_msg_.signed_messages[175]; - EXPECT_EQ(last_msg_.signed_messages[176], 35) << "incorrect value for last_msg_.signed_messages[176], expected 35, is " << last_msg_.signed_messages[176]; - EXPECT_EQ(last_msg_.signed_messages[177], 61) << "incorrect value for last_msg_.signed_messages[177], expected 61, is " << last_msg_.signed_messages[177]; - EXPECT_EQ(last_msg_.signed_messages[178], 41) << "incorrect value for last_msg_.signed_messages[178], expected 41, is " << last_msg_.signed_messages[178]; - EXPECT_EQ(last_msg_.signed_messages[179], 67) << "incorrect value for last_msg_.signed_messages[179], expected 67, is " << last_msg_.signed_messages[179]; - EXPECT_EQ(last_msg_.signed_messages[180], 46) << "incorrect value for last_msg_.signed_messages[180], expected 46, is " << last_msg_.signed_messages[180]; - EXPECT_EQ(last_msg_.signed_messages[181], 127) << "incorrect value for last_msg_.signed_messages[181], expected 127, is " << last_msg_.signed_messages[181]; - EXPECT_EQ(last_msg_.signed_messages[182], 75) << "incorrect value for last_msg_.signed_messages[182], expected 75, is " << last_msg_.signed_messages[182]; - EXPECT_EQ(last_msg_.signed_messages[183], 174) << "incorrect value for last_msg_.signed_messages[183], expected 174, is " << last_msg_.signed_messages[183]; - EXPECT_EQ(last_msg_.stream_counter, 1) << "incorrect value for last_msg_.stream_counter, expected 1, is " << last_msg_.stream_counter; +}; + +TEST_F(Test_auto_check_sbp_signing_MsgEcdsaSignatureDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 6, 12, 66, 0, 255, 0, 1, 2, 1, 2, 3, 4, 0, 1, + 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, + 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, + 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, + 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, + 6, 7, 10, 21, 23, 63, 140, 37, 130, 106, 28, 40, 165, 179, 73, + 178, 60, 126, 114, 78, 113, 27, 95, 3, 62, 104, 145, 96, 19, 92, + 123, 14, 90, 153, 183, 9, 72, 81, 118, 112, 124, 16, 182, 76, 146, + 115, 58, 144, 17, 105, 66, 31, 135, 54, 100, 84, 181, 103, 11, 88, + 133, 155, 167, 173, 143, 86, 158, 20, 168, 132, 141, 102, 50, 48, 71, + 147, 53, 87, 1, 108, 138, 36, 134, 139, 163, 82, 43, 52, 150, 12, + 30, 110, 156, 107, 120, 91, 122, 69, 164, 170, 116, 25, 94, 5, 22, + 24, 162, 175, 38, 157, 98, 44, 160, 47, 97, 142, 8, 74, 13, 177, + 15, 128, 26, 131, 154, 65, 169, 55, 136, 125, 171, 161, 29, 129, 151, + 68, 166, 51, 70, 45, 56, 79, 149, 99, 42, 101, 152, 39, 89, 180, + 64, 49, 6, 80, 172, 32, 109, 2, 119, 93, 176, 0, 33, 57, 34, + 18, 85, 121, 137, 83, 111, 59, 7, 77, 4, 117, 159, 148, 35, 61, + 41, 67, 46, 127, 75, 174, 97, 172, + }; + + sbp_msg_ecdsa_signature_dep_a_t test_msg{}; + + test_msg.certificate_id[0] = 1; + + test_msg.certificate_id[1] = 2; + + test_msg.certificate_id[2] = 3; + + test_msg.certificate_id[3] = 4; + test_msg.flags = 0; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_signed_messages.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)105, (char)103, (char)110, + (char)101, (char)100, (char)95, (char)109, + (char)101, (char)115, (char)115, (char)97, + (char)103, (char)101, (char)115}; + memcpy(test_msg.n_signed_messages.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_signed_messages.value = 184; + test_msg.on_demand_counter = 2; + + test_msg.signature[0] = 0; + + test_msg.signature[1] = 1; + + test_msg.signature[2] = 2; + + test_msg.signature[3] = 3; + + test_msg.signature[4] = 4; + + test_msg.signature[5] = 5; + + test_msg.signature[6] = 6; + + test_msg.signature[7] = 7; + + test_msg.signature[8] = 0; + + test_msg.signature[9] = 1; + + test_msg.signature[10] = 2; + + test_msg.signature[11] = 3; + + test_msg.signature[12] = 4; + + test_msg.signature[13] = 5; + + test_msg.signature[14] = 6; + + test_msg.signature[15] = 7; + + test_msg.signature[16] = 0; + + test_msg.signature[17] = 1; + + test_msg.signature[18] = 2; + + test_msg.signature[19] = 3; + + test_msg.signature[20] = 4; + + test_msg.signature[21] = 5; + + test_msg.signature[22] = 6; + + test_msg.signature[23] = 7; + + test_msg.signature[24] = 0; + + test_msg.signature[25] = 1; + + test_msg.signature[26] = 2; + + test_msg.signature[27] = 3; + + test_msg.signature[28] = 4; + + test_msg.signature[29] = 5; + + test_msg.signature[30] = 6; + + test_msg.signature[31] = 7; + + test_msg.signature[32] = 0; + + test_msg.signature[33] = 1; + + test_msg.signature[34] = 2; + + test_msg.signature[35] = 3; + + test_msg.signature[36] = 4; + + test_msg.signature[37] = 5; + + test_msg.signature[38] = 6; + + test_msg.signature[39] = 7; + + test_msg.signature[40] = 0; + + test_msg.signature[41] = 1; + + test_msg.signature[42] = 2; + + test_msg.signature[43] = 3; + + test_msg.signature[44] = 4; + + test_msg.signature[45] = 5; + + test_msg.signature[46] = 6; + + test_msg.signature[47] = 7; + + test_msg.signature[48] = 0; + + test_msg.signature[49] = 1; + + test_msg.signature[50] = 2; + + test_msg.signature[51] = 3; + + test_msg.signature[52] = 4; + + test_msg.signature[53] = 5; + + test_msg.signature[54] = 6; + + test_msg.signature[55] = 7; + + test_msg.signature[56] = 0; + + test_msg.signature[57] = 1; + + test_msg.signature[58] = 2; + + test_msg.signature[59] = 3; + + test_msg.signature[60] = 4; + + test_msg.signature[61] = 5; + + test_msg.signature[62] = 6; + + test_msg.signature[63] = 7; + + test_msg.signed_messages[0] = 10; + + test_msg.signed_messages[1] = 21; + + test_msg.signed_messages[2] = 23; + + test_msg.signed_messages[3] = 63; + + test_msg.signed_messages[4] = 140; + + test_msg.signed_messages[5] = 37; + + test_msg.signed_messages[6] = 130; + + test_msg.signed_messages[7] = 106; + + test_msg.signed_messages[8] = 28; + + test_msg.signed_messages[9] = 40; + + test_msg.signed_messages[10] = 165; + + test_msg.signed_messages[11] = 179; + + test_msg.signed_messages[12] = 73; + + test_msg.signed_messages[13] = 178; + + test_msg.signed_messages[14] = 60; + + test_msg.signed_messages[15] = 126; + + test_msg.signed_messages[16] = 114; + + test_msg.signed_messages[17] = 78; + + test_msg.signed_messages[18] = 113; + + test_msg.signed_messages[19] = 27; + + test_msg.signed_messages[20] = 95; + + test_msg.signed_messages[21] = 3; + + test_msg.signed_messages[22] = 62; + + test_msg.signed_messages[23] = 104; + + test_msg.signed_messages[24] = 145; + + test_msg.signed_messages[25] = 96; + + test_msg.signed_messages[26] = 19; + + test_msg.signed_messages[27] = 92; + + test_msg.signed_messages[28] = 123; + + test_msg.signed_messages[29] = 14; + + test_msg.signed_messages[30] = 90; + + test_msg.signed_messages[31] = 153; + + test_msg.signed_messages[32] = 183; + + test_msg.signed_messages[33] = 9; + + test_msg.signed_messages[34] = 72; + + test_msg.signed_messages[35] = 81; + + test_msg.signed_messages[36] = 118; + + test_msg.signed_messages[37] = 112; + + test_msg.signed_messages[38] = 124; + + test_msg.signed_messages[39] = 16; + + test_msg.signed_messages[40] = 182; + + test_msg.signed_messages[41] = 76; + + test_msg.signed_messages[42] = 146; + + test_msg.signed_messages[43] = 115; + + test_msg.signed_messages[44] = 58; + + test_msg.signed_messages[45] = 144; + + test_msg.signed_messages[46] = 17; + + test_msg.signed_messages[47] = 105; + + test_msg.signed_messages[48] = 66; + + test_msg.signed_messages[49] = 31; + + test_msg.signed_messages[50] = 135; + + test_msg.signed_messages[51] = 54; + + test_msg.signed_messages[52] = 100; + + test_msg.signed_messages[53] = 84; + + test_msg.signed_messages[54] = 181; + + test_msg.signed_messages[55] = 103; + + test_msg.signed_messages[56] = 11; + + test_msg.signed_messages[57] = 88; + + test_msg.signed_messages[58] = 133; + + test_msg.signed_messages[59] = 155; + + test_msg.signed_messages[60] = 167; + + test_msg.signed_messages[61] = 173; + + test_msg.signed_messages[62] = 143; + + test_msg.signed_messages[63] = 86; + + test_msg.signed_messages[64] = 158; + + test_msg.signed_messages[65] = 20; + + test_msg.signed_messages[66] = 168; + + test_msg.signed_messages[67] = 132; + + test_msg.signed_messages[68] = 141; + + test_msg.signed_messages[69] = 102; + + test_msg.signed_messages[70] = 50; + + test_msg.signed_messages[71] = 48; + + test_msg.signed_messages[72] = 71; + + test_msg.signed_messages[73] = 147; + + test_msg.signed_messages[74] = 53; + + test_msg.signed_messages[75] = 87; + + test_msg.signed_messages[76] = 1; + + test_msg.signed_messages[77] = 108; + + test_msg.signed_messages[78] = 138; + + test_msg.signed_messages[79] = 36; + + test_msg.signed_messages[80] = 134; + + test_msg.signed_messages[81] = 139; + + test_msg.signed_messages[82] = 163; + + test_msg.signed_messages[83] = 82; + + test_msg.signed_messages[84] = 43; + + test_msg.signed_messages[85] = 52; + + test_msg.signed_messages[86] = 150; + + test_msg.signed_messages[87] = 12; + + test_msg.signed_messages[88] = 30; + + test_msg.signed_messages[89] = 110; + + test_msg.signed_messages[90] = 156; + + test_msg.signed_messages[91] = 107; + + test_msg.signed_messages[92] = 120; + + test_msg.signed_messages[93] = 91; + + test_msg.signed_messages[94] = 122; + + test_msg.signed_messages[95] = 69; + + test_msg.signed_messages[96] = 164; + + test_msg.signed_messages[97] = 170; + + test_msg.signed_messages[98] = 116; + + test_msg.signed_messages[99] = 25; + + test_msg.signed_messages[100] = 94; + + test_msg.signed_messages[101] = 5; + + test_msg.signed_messages[102] = 22; + + test_msg.signed_messages[103] = 24; + + test_msg.signed_messages[104] = 162; + + test_msg.signed_messages[105] = 175; + + test_msg.signed_messages[106] = 38; + + test_msg.signed_messages[107] = 157; + + test_msg.signed_messages[108] = 98; + + test_msg.signed_messages[109] = 44; + + test_msg.signed_messages[110] = 160; + + test_msg.signed_messages[111] = 47; + + test_msg.signed_messages[112] = 97; + + test_msg.signed_messages[113] = 142; + + test_msg.signed_messages[114] = 8; + + test_msg.signed_messages[115] = 74; + + test_msg.signed_messages[116] = 13; + + test_msg.signed_messages[117] = 177; + + test_msg.signed_messages[118] = 15; + + test_msg.signed_messages[119] = 128; + + test_msg.signed_messages[120] = 26; + + test_msg.signed_messages[121] = 131; + + test_msg.signed_messages[122] = 154; + + test_msg.signed_messages[123] = 65; + + test_msg.signed_messages[124] = 169; + + test_msg.signed_messages[125] = 55; + + test_msg.signed_messages[126] = 136; + + test_msg.signed_messages[127] = 125; + + test_msg.signed_messages[128] = 171; + + test_msg.signed_messages[129] = 161; + + test_msg.signed_messages[130] = 29; + + test_msg.signed_messages[131] = 129; + + test_msg.signed_messages[132] = 151; + + test_msg.signed_messages[133] = 68; + + test_msg.signed_messages[134] = 166; + + test_msg.signed_messages[135] = 51; + + test_msg.signed_messages[136] = 70; + + test_msg.signed_messages[137] = 45; + + test_msg.signed_messages[138] = 56; + + test_msg.signed_messages[139] = 79; + + test_msg.signed_messages[140] = 149; + + test_msg.signed_messages[141] = 99; + + test_msg.signed_messages[142] = 42; + + test_msg.signed_messages[143] = 101; + + test_msg.signed_messages[144] = 152; + + test_msg.signed_messages[145] = 39; + + test_msg.signed_messages[146] = 89; + + test_msg.signed_messages[147] = 180; + + test_msg.signed_messages[148] = 64; + + test_msg.signed_messages[149] = 49; + + test_msg.signed_messages[150] = 6; + + test_msg.signed_messages[151] = 80; + + test_msg.signed_messages[152] = 172; + + test_msg.signed_messages[153] = 32; + + test_msg.signed_messages[154] = 109; + + test_msg.signed_messages[155] = 2; + + test_msg.signed_messages[156] = 119; + + test_msg.signed_messages[157] = 93; + + test_msg.signed_messages[158] = 176; + + test_msg.signed_messages[159] = 0; + + test_msg.signed_messages[160] = 33; + + test_msg.signed_messages[161] = 57; + + test_msg.signed_messages[162] = 34; + + test_msg.signed_messages[163] = 18; + + test_msg.signed_messages[164] = 85; + + test_msg.signed_messages[165] = 121; + + test_msg.signed_messages[166] = 137; + + test_msg.signed_messages[167] = 83; + + test_msg.signed_messages[168] = 111; + + test_msg.signed_messages[169] = 59; + + test_msg.signed_messages[170] = 7; + + test_msg.signed_messages[171] = 77; + + test_msg.signed_messages[172] = 4; + + test_msg.signed_messages[173] = 117; + + test_msg.signed_messages[174] = 159; + + test_msg.signed_messages[175] = 148; + + test_msg.signed_messages[176] = 35; + + test_msg.signed_messages[177] = 61; + + test_msg.signed_messages[178] = 41; + + test_msg.signed_messages[179] = 67; + + test_msg.signed_messages[180] = 46; + + test_msg.signed_messages[181] = 127; + + test_msg.signed_messages[182] = 75; + + test_msg.signed_messages[183] = 174; + test_msg.stream_counter = 1; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.certificate_id[0], 1) + << "incorrect value for last_msg_.certificate_id[0], expected 1, is " + << last_msg_.certificate_id[0]; + EXPECT_EQ(last_msg_.certificate_id[1], 2) + << "incorrect value for last_msg_.certificate_id[1], expected 2, is " + << last_msg_.certificate_id[1]; + EXPECT_EQ(last_msg_.certificate_id[2], 3) + << "incorrect value for last_msg_.certificate_id[2], expected 3, is " + << last_msg_.certificate_id[2]; + EXPECT_EQ(last_msg_.certificate_id[3], 4) + << "incorrect value for last_msg_.certificate_id[3], expected 4, is " + << last_msg_.certificate_id[3]; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_signed_messages.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_signed_messages.handle_as, " + "expected string '" + << check_string << "', is '" << last_msg_.n_signed_messages.handle_as + << "'"; + } + { + const char check_string[] = {(char)115, (char)105, (char)103, (char)110, + (char)101, (char)100, (char)95, (char)109, + (char)101, (char)115, (char)115, (char)97, + (char)103, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_signed_messages.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_signed_messages.relates_to, " + "expected string '" + << check_string << "', is '" << last_msg_.n_signed_messages.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_signed_messages.value, 184) + << "incorrect value for last_msg_.n_signed_messages.value, expected 184, " + "is " + << last_msg_.n_signed_messages.value; + EXPECT_EQ(last_msg_.on_demand_counter, 2) + << "incorrect value for last_msg_.on_demand_counter, expected 2, is " + << last_msg_.on_demand_counter; + EXPECT_EQ(last_msg_.signature[0], 0) + << "incorrect value for last_msg_.signature[0], expected 0, is " + << last_msg_.signature[0]; + EXPECT_EQ(last_msg_.signature[1], 1) + << "incorrect value for last_msg_.signature[1], expected 1, is " + << last_msg_.signature[1]; + EXPECT_EQ(last_msg_.signature[2], 2) + << "incorrect value for last_msg_.signature[2], expected 2, is " + << last_msg_.signature[2]; + EXPECT_EQ(last_msg_.signature[3], 3) + << "incorrect value for last_msg_.signature[3], expected 3, is " + << last_msg_.signature[3]; + EXPECT_EQ(last_msg_.signature[4], 4) + << "incorrect value for last_msg_.signature[4], expected 4, is " + << last_msg_.signature[4]; + EXPECT_EQ(last_msg_.signature[5], 5) + << "incorrect value for last_msg_.signature[5], expected 5, is " + << last_msg_.signature[5]; + EXPECT_EQ(last_msg_.signature[6], 6) + << "incorrect value for last_msg_.signature[6], expected 6, is " + << last_msg_.signature[6]; + EXPECT_EQ(last_msg_.signature[7], 7) + << "incorrect value for last_msg_.signature[7], expected 7, is " + << last_msg_.signature[7]; + EXPECT_EQ(last_msg_.signature[8], 0) + << "incorrect value for last_msg_.signature[8], expected 0, is " + << last_msg_.signature[8]; + EXPECT_EQ(last_msg_.signature[9], 1) + << "incorrect value for last_msg_.signature[9], expected 1, is " + << last_msg_.signature[9]; + EXPECT_EQ(last_msg_.signature[10], 2) + << "incorrect value for last_msg_.signature[10], expected 2, is " + << last_msg_.signature[10]; + EXPECT_EQ(last_msg_.signature[11], 3) + << "incorrect value for last_msg_.signature[11], expected 3, is " + << last_msg_.signature[11]; + EXPECT_EQ(last_msg_.signature[12], 4) + << "incorrect value for last_msg_.signature[12], expected 4, is " + << last_msg_.signature[12]; + EXPECT_EQ(last_msg_.signature[13], 5) + << "incorrect value for last_msg_.signature[13], expected 5, is " + << last_msg_.signature[13]; + EXPECT_EQ(last_msg_.signature[14], 6) + << "incorrect value for last_msg_.signature[14], expected 6, is " + << last_msg_.signature[14]; + EXPECT_EQ(last_msg_.signature[15], 7) + << "incorrect value for last_msg_.signature[15], expected 7, is " + << last_msg_.signature[15]; + EXPECT_EQ(last_msg_.signature[16], 0) + << "incorrect value for last_msg_.signature[16], expected 0, is " + << last_msg_.signature[16]; + EXPECT_EQ(last_msg_.signature[17], 1) + << "incorrect value for last_msg_.signature[17], expected 1, is " + << last_msg_.signature[17]; + EXPECT_EQ(last_msg_.signature[18], 2) + << "incorrect value for last_msg_.signature[18], expected 2, is " + << last_msg_.signature[18]; + EXPECT_EQ(last_msg_.signature[19], 3) + << "incorrect value for last_msg_.signature[19], expected 3, is " + << last_msg_.signature[19]; + EXPECT_EQ(last_msg_.signature[20], 4) + << "incorrect value for last_msg_.signature[20], expected 4, is " + << last_msg_.signature[20]; + EXPECT_EQ(last_msg_.signature[21], 5) + << "incorrect value for last_msg_.signature[21], expected 5, is " + << last_msg_.signature[21]; + EXPECT_EQ(last_msg_.signature[22], 6) + << "incorrect value for last_msg_.signature[22], expected 6, is " + << last_msg_.signature[22]; + EXPECT_EQ(last_msg_.signature[23], 7) + << "incorrect value for last_msg_.signature[23], expected 7, is " + << last_msg_.signature[23]; + EXPECT_EQ(last_msg_.signature[24], 0) + << "incorrect value for last_msg_.signature[24], expected 0, is " + << last_msg_.signature[24]; + EXPECT_EQ(last_msg_.signature[25], 1) + << "incorrect value for last_msg_.signature[25], expected 1, is " + << last_msg_.signature[25]; + EXPECT_EQ(last_msg_.signature[26], 2) + << "incorrect value for last_msg_.signature[26], expected 2, is " + << last_msg_.signature[26]; + EXPECT_EQ(last_msg_.signature[27], 3) + << "incorrect value for last_msg_.signature[27], expected 3, is " + << last_msg_.signature[27]; + EXPECT_EQ(last_msg_.signature[28], 4) + << "incorrect value for last_msg_.signature[28], expected 4, is " + << last_msg_.signature[28]; + EXPECT_EQ(last_msg_.signature[29], 5) + << "incorrect value for last_msg_.signature[29], expected 5, is " + << last_msg_.signature[29]; + EXPECT_EQ(last_msg_.signature[30], 6) + << "incorrect value for last_msg_.signature[30], expected 6, is " + << last_msg_.signature[30]; + EXPECT_EQ(last_msg_.signature[31], 7) + << "incorrect value for last_msg_.signature[31], expected 7, is " + << last_msg_.signature[31]; + EXPECT_EQ(last_msg_.signature[32], 0) + << "incorrect value for last_msg_.signature[32], expected 0, is " + << last_msg_.signature[32]; + EXPECT_EQ(last_msg_.signature[33], 1) + << "incorrect value for last_msg_.signature[33], expected 1, is " + << last_msg_.signature[33]; + EXPECT_EQ(last_msg_.signature[34], 2) + << "incorrect value for last_msg_.signature[34], expected 2, is " + << last_msg_.signature[34]; + EXPECT_EQ(last_msg_.signature[35], 3) + << "incorrect value for last_msg_.signature[35], expected 3, is " + << last_msg_.signature[35]; + EXPECT_EQ(last_msg_.signature[36], 4) + << "incorrect value for last_msg_.signature[36], expected 4, is " + << last_msg_.signature[36]; + EXPECT_EQ(last_msg_.signature[37], 5) + << "incorrect value for last_msg_.signature[37], expected 5, is " + << last_msg_.signature[37]; + EXPECT_EQ(last_msg_.signature[38], 6) + << "incorrect value for last_msg_.signature[38], expected 6, is " + << last_msg_.signature[38]; + EXPECT_EQ(last_msg_.signature[39], 7) + << "incorrect value for last_msg_.signature[39], expected 7, is " + << last_msg_.signature[39]; + EXPECT_EQ(last_msg_.signature[40], 0) + << "incorrect value for last_msg_.signature[40], expected 0, is " + << last_msg_.signature[40]; + EXPECT_EQ(last_msg_.signature[41], 1) + << "incorrect value for last_msg_.signature[41], expected 1, is " + << last_msg_.signature[41]; + EXPECT_EQ(last_msg_.signature[42], 2) + << "incorrect value for last_msg_.signature[42], expected 2, is " + << last_msg_.signature[42]; + EXPECT_EQ(last_msg_.signature[43], 3) + << "incorrect value for last_msg_.signature[43], expected 3, is " + << last_msg_.signature[43]; + EXPECT_EQ(last_msg_.signature[44], 4) + << "incorrect value for last_msg_.signature[44], expected 4, is " + << last_msg_.signature[44]; + EXPECT_EQ(last_msg_.signature[45], 5) + << "incorrect value for last_msg_.signature[45], expected 5, is " + << last_msg_.signature[45]; + EXPECT_EQ(last_msg_.signature[46], 6) + << "incorrect value for last_msg_.signature[46], expected 6, is " + << last_msg_.signature[46]; + EXPECT_EQ(last_msg_.signature[47], 7) + << "incorrect value for last_msg_.signature[47], expected 7, is " + << last_msg_.signature[47]; + EXPECT_EQ(last_msg_.signature[48], 0) + << "incorrect value for last_msg_.signature[48], expected 0, is " + << last_msg_.signature[48]; + EXPECT_EQ(last_msg_.signature[49], 1) + << "incorrect value for last_msg_.signature[49], expected 1, is " + << last_msg_.signature[49]; + EXPECT_EQ(last_msg_.signature[50], 2) + << "incorrect value for last_msg_.signature[50], expected 2, is " + << last_msg_.signature[50]; + EXPECT_EQ(last_msg_.signature[51], 3) + << "incorrect value for last_msg_.signature[51], expected 3, is " + << last_msg_.signature[51]; + EXPECT_EQ(last_msg_.signature[52], 4) + << "incorrect value for last_msg_.signature[52], expected 4, is " + << last_msg_.signature[52]; + EXPECT_EQ(last_msg_.signature[53], 5) + << "incorrect value for last_msg_.signature[53], expected 5, is " + << last_msg_.signature[53]; + EXPECT_EQ(last_msg_.signature[54], 6) + << "incorrect value for last_msg_.signature[54], expected 6, is " + << last_msg_.signature[54]; + EXPECT_EQ(last_msg_.signature[55], 7) + << "incorrect value for last_msg_.signature[55], expected 7, is " + << last_msg_.signature[55]; + EXPECT_EQ(last_msg_.signature[56], 0) + << "incorrect value for last_msg_.signature[56], expected 0, is " + << last_msg_.signature[56]; + EXPECT_EQ(last_msg_.signature[57], 1) + << "incorrect value for last_msg_.signature[57], expected 1, is " + << last_msg_.signature[57]; + EXPECT_EQ(last_msg_.signature[58], 2) + << "incorrect value for last_msg_.signature[58], expected 2, is " + << last_msg_.signature[58]; + EXPECT_EQ(last_msg_.signature[59], 3) + << "incorrect value for last_msg_.signature[59], expected 3, is " + << last_msg_.signature[59]; + EXPECT_EQ(last_msg_.signature[60], 4) + << "incorrect value for last_msg_.signature[60], expected 4, is " + << last_msg_.signature[60]; + EXPECT_EQ(last_msg_.signature[61], 5) + << "incorrect value for last_msg_.signature[61], expected 5, is " + << last_msg_.signature[61]; + EXPECT_EQ(last_msg_.signature[62], 6) + << "incorrect value for last_msg_.signature[62], expected 6, is " + << last_msg_.signature[62]; + EXPECT_EQ(last_msg_.signature[63], 7) + << "incorrect value for last_msg_.signature[63], expected 7, is " + << last_msg_.signature[63]; + EXPECT_EQ(last_msg_.signed_messages[0], 10) + << "incorrect value for last_msg_.signed_messages[0], expected 10, is " + << last_msg_.signed_messages[0]; + EXPECT_EQ(last_msg_.signed_messages[1], 21) + << "incorrect value for last_msg_.signed_messages[1], expected 21, is " + << last_msg_.signed_messages[1]; + EXPECT_EQ(last_msg_.signed_messages[2], 23) + << "incorrect value for last_msg_.signed_messages[2], expected 23, is " + << last_msg_.signed_messages[2]; + EXPECT_EQ(last_msg_.signed_messages[3], 63) + << "incorrect value for last_msg_.signed_messages[3], expected 63, is " + << last_msg_.signed_messages[3]; + EXPECT_EQ(last_msg_.signed_messages[4], 140) + << "incorrect value for last_msg_.signed_messages[4], expected 140, is " + << last_msg_.signed_messages[4]; + EXPECT_EQ(last_msg_.signed_messages[5], 37) + << "incorrect value for last_msg_.signed_messages[5], expected 37, is " + << last_msg_.signed_messages[5]; + EXPECT_EQ(last_msg_.signed_messages[6], 130) + << "incorrect value for last_msg_.signed_messages[6], expected 130, is " + << last_msg_.signed_messages[6]; + EXPECT_EQ(last_msg_.signed_messages[7], 106) + << "incorrect value for last_msg_.signed_messages[7], expected 106, is " + << last_msg_.signed_messages[7]; + EXPECT_EQ(last_msg_.signed_messages[8], 28) + << "incorrect value for last_msg_.signed_messages[8], expected 28, is " + << last_msg_.signed_messages[8]; + EXPECT_EQ(last_msg_.signed_messages[9], 40) + << "incorrect value for last_msg_.signed_messages[9], expected 40, is " + << last_msg_.signed_messages[9]; + EXPECT_EQ(last_msg_.signed_messages[10], 165) + << "incorrect value for last_msg_.signed_messages[10], expected 165, is " + << last_msg_.signed_messages[10]; + EXPECT_EQ(last_msg_.signed_messages[11], 179) + << "incorrect value for last_msg_.signed_messages[11], expected 179, is " + << last_msg_.signed_messages[11]; + EXPECT_EQ(last_msg_.signed_messages[12], 73) + << "incorrect value for last_msg_.signed_messages[12], expected 73, is " + << last_msg_.signed_messages[12]; + EXPECT_EQ(last_msg_.signed_messages[13], 178) + << "incorrect value for last_msg_.signed_messages[13], expected 178, is " + << last_msg_.signed_messages[13]; + EXPECT_EQ(last_msg_.signed_messages[14], 60) + << "incorrect value for last_msg_.signed_messages[14], expected 60, is " + << last_msg_.signed_messages[14]; + EXPECT_EQ(last_msg_.signed_messages[15], 126) + << "incorrect value for last_msg_.signed_messages[15], expected 126, is " + << last_msg_.signed_messages[15]; + EXPECT_EQ(last_msg_.signed_messages[16], 114) + << "incorrect value for last_msg_.signed_messages[16], expected 114, is " + << last_msg_.signed_messages[16]; + EXPECT_EQ(last_msg_.signed_messages[17], 78) + << "incorrect value for last_msg_.signed_messages[17], expected 78, is " + << last_msg_.signed_messages[17]; + EXPECT_EQ(last_msg_.signed_messages[18], 113) + << "incorrect value for last_msg_.signed_messages[18], expected 113, is " + << last_msg_.signed_messages[18]; + EXPECT_EQ(last_msg_.signed_messages[19], 27) + << "incorrect value for last_msg_.signed_messages[19], expected 27, is " + << last_msg_.signed_messages[19]; + EXPECT_EQ(last_msg_.signed_messages[20], 95) + << "incorrect value for last_msg_.signed_messages[20], expected 95, is " + << last_msg_.signed_messages[20]; + EXPECT_EQ(last_msg_.signed_messages[21], 3) + << "incorrect value for last_msg_.signed_messages[21], expected 3, is " + << last_msg_.signed_messages[21]; + EXPECT_EQ(last_msg_.signed_messages[22], 62) + << "incorrect value for last_msg_.signed_messages[22], expected 62, is " + << last_msg_.signed_messages[22]; + EXPECT_EQ(last_msg_.signed_messages[23], 104) + << "incorrect value for last_msg_.signed_messages[23], expected 104, is " + << last_msg_.signed_messages[23]; + EXPECT_EQ(last_msg_.signed_messages[24], 145) + << "incorrect value for last_msg_.signed_messages[24], expected 145, is " + << last_msg_.signed_messages[24]; + EXPECT_EQ(last_msg_.signed_messages[25], 96) + << "incorrect value for last_msg_.signed_messages[25], expected 96, is " + << last_msg_.signed_messages[25]; + EXPECT_EQ(last_msg_.signed_messages[26], 19) + << "incorrect value for last_msg_.signed_messages[26], expected 19, is " + << last_msg_.signed_messages[26]; + EXPECT_EQ(last_msg_.signed_messages[27], 92) + << "incorrect value for last_msg_.signed_messages[27], expected 92, is " + << last_msg_.signed_messages[27]; + EXPECT_EQ(last_msg_.signed_messages[28], 123) + << "incorrect value for last_msg_.signed_messages[28], expected 123, is " + << last_msg_.signed_messages[28]; + EXPECT_EQ(last_msg_.signed_messages[29], 14) + << "incorrect value for last_msg_.signed_messages[29], expected 14, is " + << last_msg_.signed_messages[29]; + EXPECT_EQ(last_msg_.signed_messages[30], 90) + << "incorrect value for last_msg_.signed_messages[30], expected 90, is " + << last_msg_.signed_messages[30]; + EXPECT_EQ(last_msg_.signed_messages[31], 153) + << "incorrect value for last_msg_.signed_messages[31], expected 153, is " + << last_msg_.signed_messages[31]; + EXPECT_EQ(last_msg_.signed_messages[32], 183) + << "incorrect value for last_msg_.signed_messages[32], expected 183, is " + << last_msg_.signed_messages[32]; + EXPECT_EQ(last_msg_.signed_messages[33], 9) + << "incorrect value for last_msg_.signed_messages[33], expected 9, is " + << last_msg_.signed_messages[33]; + EXPECT_EQ(last_msg_.signed_messages[34], 72) + << "incorrect value for last_msg_.signed_messages[34], expected 72, is " + << last_msg_.signed_messages[34]; + EXPECT_EQ(last_msg_.signed_messages[35], 81) + << "incorrect value for last_msg_.signed_messages[35], expected 81, is " + << last_msg_.signed_messages[35]; + EXPECT_EQ(last_msg_.signed_messages[36], 118) + << "incorrect value for last_msg_.signed_messages[36], expected 118, is " + << last_msg_.signed_messages[36]; + EXPECT_EQ(last_msg_.signed_messages[37], 112) + << "incorrect value for last_msg_.signed_messages[37], expected 112, is " + << last_msg_.signed_messages[37]; + EXPECT_EQ(last_msg_.signed_messages[38], 124) + << "incorrect value for last_msg_.signed_messages[38], expected 124, is " + << last_msg_.signed_messages[38]; + EXPECT_EQ(last_msg_.signed_messages[39], 16) + << "incorrect value for last_msg_.signed_messages[39], expected 16, is " + << last_msg_.signed_messages[39]; + EXPECT_EQ(last_msg_.signed_messages[40], 182) + << "incorrect value for last_msg_.signed_messages[40], expected 182, is " + << last_msg_.signed_messages[40]; + EXPECT_EQ(last_msg_.signed_messages[41], 76) + << "incorrect value for last_msg_.signed_messages[41], expected 76, is " + << last_msg_.signed_messages[41]; + EXPECT_EQ(last_msg_.signed_messages[42], 146) + << "incorrect value for last_msg_.signed_messages[42], expected 146, is " + << last_msg_.signed_messages[42]; + EXPECT_EQ(last_msg_.signed_messages[43], 115) + << "incorrect value for last_msg_.signed_messages[43], expected 115, is " + << last_msg_.signed_messages[43]; + EXPECT_EQ(last_msg_.signed_messages[44], 58) + << "incorrect value for last_msg_.signed_messages[44], expected 58, is " + << last_msg_.signed_messages[44]; + EXPECT_EQ(last_msg_.signed_messages[45], 144) + << "incorrect value for last_msg_.signed_messages[45], expected 144, is " + << last_msg_.signed_messages[45]; + EXPECT_EQ(last_msg_.signed_messages[46], 17) + << "incorrect value for last_msg_.signed_messages[46], expected 17, is " + << last_msg_.signed_messages[46]; + EXPECT_EQ(last_msg_.signed_messages[47], 105) + << "incorrect value for last_msg_.signed_messages[47], expected 105, is " + << last_msg_.signed_messages[47]; + EXPECT_EQ(last_msg_.signed_messages[48], 66) + << "incorrect value for last_msg_.signed_messages[48], expected 66, is " + << last_msg_.signed_messages[48]; + EXPECT_EQ(last_msg_.signed_messages[49], 31) + << "incorrect value for last_msg_.signed_messages[49], expected 31, is " + << last_msg_.signed_messages[49]; + EXPECT_EQ(last_msg_.signed_messages[50], 135) + << "incorrect value for last_msg_.signed_messages[50], expected 135, is " + << last_msg_.signed_messages[50]; + EXPECT_EQ(last_msg_.signed_messages[51], 54) + << "incorrect value for last_msg_.signed_messages[51], expected 54, is " + << last_msg_.signed_messages[51]; + EXPECT_EQ(last_msg_.signed_messages[52], 100) + << "incorrect value for last_msg_.signed_messages[52], expected 100, is " + << last_msg_.signed_messages[52]; + EXPECT_EQ(last_msg_.signed_messages[53], 84) + << "incorrect value for last_msg_.signed_messages[53], expected 84, is " + << last_msg_.signed_messages[53]; + EXPECT_EQ(last_msg_.signed_messages[54], 181) + << "incorrect value for last_msg_.signed_messages[54], expected 181, is " + << last_msg_.signed_messages[54]; + EXPECT_EQ(last_msg_.signed_messages[55], 103) + << "incorrect value for last_msg_.signed_messages[55], expected 103, is " + << last_msg_.signed_messages[55]; + EXPECT_EQ(last_msg_.signed_messages[56], 11) + << "incorrect value for last_msg_.signed_messages[56], expected 11, is " + << last_msg_.signed_messages[56]; + EXPECT_EQ(last_msg_.signed_messages[57], 88) + << "incorrect value for last_msg_.signed_messages[57], expected 88, is " + << last_msg_.signed_messages[57]; + EXPECT_EQ(last_msg_.signed_messages[58], 133) + << "incorrect value for last_msg_.signed_messages[58], expected 133, is " + << last_msg_.signed_messages[58]; + EXPECT_EQ(last_msg_.signed_messages[59], 155) + << "incorrect value for last_msg_.signed_messages[59], expected 155, is " + << last_msg_.signed_messages[59]; + EXPECT_EQ(last_msg_.signed_messages[60], 167) + << "incorrect value for last_msg_.signed_messages[60], expected 167, is " + << last_msg_.signed_messages[60]; + EXPECT_EQ(last_msg_.signed_messages[61], 173) + << "incorrect value for last_msg_.signed_messages[61], expected 173, is " + << last_msg_.signed_messages[61]; + EXPECT_EQ(last_msg_.signed_messages[62], 143) + << "incorrect value for last_msg_.signed_messages[62], expected 143, is " + << last_msg_.signed_messages[62]; + EXPECT_EQ(last_msg_.signed_messages[63], 86) + << "incorrect value for last_msg_.signed_messages[63], expected 86, is " + << last_msg_.signed_messages[63]; + EXPECT_EQ(last_msg_.signed_messages[64], 158) + << "incorrect value for last_msg_.signed_messages[64], expected 158, is " + << last_msg_.signed_messages[64]; + EXPECT_EQ(last_msg_.signed_messages[65], 20) + << "incorrect value for last_msg_.signed_messages[65], expected 20, is " + << last_msg_.signed_messages[65]; + EXPECT_EQ(last_msg_.signed_messages[66], 168) + << "incorrect value for last_msg_.signed_messages[66], expected 168, is " + << last_msg_.signed_messages[66]; + EXPECT_EQ(last_msg_.signed_messages[67], 132) + << "incorrect value for last_msg_.signed_messages[67], expected 132, is " + << last_msg_.signed_messages[67]; + EXPECT_EQ(last_msg_.signed_messages[68], 141) + << "incorrect value for last_msg_.signed_messages[68], expected 141, is " + << last_msg_.signed_messages[68]; + EXPECT_EQ(last_msg_.signed_messages[69], 102) + << "incorrect value for last_msg_.signed_messages[69], expected 102, is " + << last_msg_.signed_messages[69]; + EXPECT_EQ(last_msg_.signed_messages[70], 50) + << "incorrect value for last_msg_.signed_messages[70], expected 50, is " + << last_msg_.signed_messages[70]; + EXPECT_EQ(last_msg_.signed_messages[71], 48) + << "incorrect value for last_msg_.signed_messages[71], expected 48, is " + << last_msg_.signed_messages[71]; + EXPECT_EQ(last_msg_.signed_messages[72], 71) + << "incorrect value for last_msg_.signed_messages[72], expected 71, is " + << last_msg_.signed_messages[72]; + EXPECT_EQ(last_msg_.signed_messages[73], 147) + << "incorrect value for last_msg_.signed_messages[73], expected 147, is " + << last_msg_.signed_messages[73]; + EXPECT_EQ(last_msg_.signed_messages[74], 53) + << "incorrect value for last_msg_.signed_messages[74], expected 53, is " + << last_msg_.signed_messages[74]; + EXPECT_EQ(last_msg_.signed_messages[75], 87) + << "incorrect value for last_msg_.signed_messages[75], expected 87, is " + << last_msg_.signed_messages[75]; + EXPECT_EQ(last_msg_.signed_messages[76], 1) + << "incorrect value for last_msg_.signed_messages[76], expected 1, is " + << last_msg_.signed_messages[76]; + EXPECT_EQ(last_msg_.signed_messages[77], 108) + << "incorrect value for last_msg_.signed_messages[77], expected 108, is " + << last_msg_.signed_messages[77]; + EXPECT_EQ(last_msg_.signed_messages[78], 138) + << "incorrect value for last_msg_.signed_messages[78], expected 138, is " + << last_msg_.signed_messages[78]; + EXPECT_EQ(last_msg_.signed_messages[79], 36) + << "incorrect value for last_msg_.signed_messages[79], expected 36, is " + << last_msg_.signed_messages[79]; + EXPECT_EQ(last_msg_.signed_messages[80], 134) + << "incorrect value for last_msg_.signed_messages[80], expected 134, is " + << last_msg_.signed_messages[80]; + EXPECT_EQ(last_msg_.signed_messages[81], 139) + << "incorrect value for last_msg_.signed_messages[81], expected 139, is " + << last_msg_.signed_messages[81]; + EXPECT_EQ(last_msg_.signed_messages[82], 163) + << "incorrect value for last_msg_.signed_messages[82], expected 163, is " + << last_msg_.signed_messages[82]; + EXPECT_EQ(last_msg_.signed_messages[83], 82) + << "incorrect value for last_msg_.signed_messages[83], expected 82, is " + << last_msg_.signed_messages[83]; + EXPECT_EQ(last_msg_.signed_messages[84], 43) + << "incorrect value for last_msg_.signed_messages[84], expected 43, is " + << last_msg_.signed_messages[84]; + EXPECT_EQ(last_msg_.signed_messages[85], 52) + << "incorrect value for last_msg_.signed_messages[85], expected 52, is " + << last_msg_.signed_messages[85]; + EXPECT_EQ(last_msg_.signed_messages[86], 150) + << "incorrect value for last_msg_.signed_messages[86], expected 150, is " + << last_msg_.signed_messages[86]; + EXPECT_EQ(last_msg_.signed_messages[87], 12) + << "incorrect value for last_msg_.signed_messages[87], expected 12, is " + << last_msg_.signed_messages[87]; + EXPECT_EQ(last_msg_.signed_messages[88], 30) + << "incorrect value for last_msg_.signed_messages[88], expected 30, is " + << last_msg_.signed_messages[88]; + EXPECT_EQ(last_msg_.signed_messages[89], 110) + << "incorrect value for last_msg_.signed_messages[89], expected 110, is " + << last_msg_.signed_messages[89]; + EXPECT_EQ(last_msg_.signed_messages[90], 156) + << "incorrect value for last_msg_.signed_messages[90], expected 156, is " + << last_msg_.signed_messages[90]; + EXPECT_EQ(last_msg_.signed_messages[91], 107) + << "incorrect value for last_msg_.signed_messages[91], expected 107, is " + << last_msg_.signed_messages[91]; + EXPECT_EQ(last_msg_.signed_messages[92], 120) + << "incorrect value for last_msg_.signed_messages[92], expected 120, is " + << last_msg_.signed_messages[92]; + EXPECT_EQ(last_msg_.signed_messages[93], 91) + << "incorrect value for last_msg_.signed_messages[93], expected 91, is " + << last_msg_.signed_messages[93]; + EXPECT_EQ(last_msg_.signed_messages[94], 122) + << "incorrect value for last_msg_.signed_messages[94], expected 122, is " + << last_msg_.signed_messages[94]; + EXPECT_EQ(last_msg_.signed_messages[95], 69) + << "incorrect value for last_msg_.signed_messages[95], expected 69, is " + << last_msg_.signed_messages[95]; + EXPECT_EQ(last_msg_.signed_messages[96], 164) + << "incorrect value for last_msg_.signed_messages[96], expected 164, is " + << last_msg_.signed_messages[96]; + EXPECT_EQ(last_msg_.signed_messages[97], 170) + << "incorrect value for last_msg_.signed_messages[97], expected 170, is " + << last_msg_.signed_messages[97]; + EXPECT_EQ(last_msg_.signed_messages[98], 116) + << "incorrect value for last_msg_.signed_messages[98], expected 116, is " + << last_msg_.signed_messages[98]; + EXPECT_EQ(last_msg_.signed_messages[99], 25) + << "incorrect value for last_msg_.signed_messages[99], expected 25, is " + << last_msg_.signed_messages[99]; + EXPECT_EQ(last_msg_.signed_messages[100], 94) + << "incorrect value for last_msg_.signed_messages[100], expected 94, is " + << last_msg_.signed_messages[100]; + EXPECT_EQ(last_msg_.signed_messages[101], 5) + << "incorrect value for last_msg_.signed_messages[101], expected 5, is " + << last_msg_.signed_messages[101]; + EXPECT_EQ(last_msg_.signed_messages[102], 22) + << "incorrect value for last_msg_.signed_messages[102], expected 22, is " + << last_msg_.signed_messages[102]; + EXPECT_EQ(last_msg_.signed_messages[103], 24) + << "incorrect value for last_msg_.signed_messages[103], expected 24, is " + << last_msg_.signed_messages[103]; + EXPECT_EQ(last_msg_.signed_messages[104], 162) + << "incorrect value for last_msg_.signed_messages[104], expected 162, is " + << last_msg_.signed_messages[104]; + EXPECT_EQ(last_msg_.signed_messages[105], 175) + << "incorrect value for last_msg_.signed_messages[105], expected 175, is " + << last_msg_.signed_messages[105]; + EXPECT_EQ(last_msg_.signed_messages[106], 38) + << "incorrect value for last_msg_.signed_messages[106], expected 38, is " + << last_msg_.signed_messages[106]; + EXPECT_EQ(last_msg_.signed_messages[107], 157) + << "incorrect value for last_msg_.signed_messages[107], expected 157, is " + << last_msg_.signed_messages[107]; + EXPECT_EQ(last_msg_.signed_messages[108], 98) + << "incorrect value for last_msg_.signed_messages[108], expected 98, is " + << last_msg_.signed_messages[108]; + EXPECT_EQ(last_msg_.signed_messages[109], 44) + << "incorrect value for last_msg_.signed_messages[109], expected 44, is " + << last_msg_.signed_messages[109]; + EXPECT_EQ(last_msg_.signed_messages[110], 160) + << "incorrect value for last_msg_.signed_messages[110], expected 160, is " + << last_msg_.signed_messages[110]; + EXPECT_EQ(last_msg_.signed_messages[111], 47) + << "incorrect value for last_msg_.signed_messages[111], expected 47, is " + << last_msg_.signed_messages[111]; + EXPECT_EQ(last_msg_.signed_messages[112], 97) + << "incorrect value for last_msg_.signed_messages[112], expected 97, is " + << last_msg_.signed_messages[112]; + EXPECT_EQ(last_msg_.signed_messages[113], 142) + << "incorrect value for last_msg_.signed_messages[113], expected 142, is " + << last_msg_.signed_messages[113]; + EXPECT_EQ(last_msg_.signed_messages[114], 8) + << "incorrect value for last_msg_.signed_messages[114], expected 8, is " + << last_msg_.signed_messages[114]; + EXPECT_EQ(last_msg_.signed_messages[115], 74) + << "incorrect value for last_msg_.signed_messages[115], expected 74, is " + << last_msg_.signed_messages[115]; + EXPECT_EQ(last_msg_.signed_messages[116], 13) + << "incorrect value for last_msg_.signed_messages[116], expected 13, is " + << last_msg_.signed_messages[116]; + EXPECT_EQ(last_msg_.signed_messages[117], 177) + << "incorrect value for last_msg_.signed_messages[117], expected 177, is " + << last_msg_.signed_messages[117]; + EXPECT_EQ(last_msg_.signed_messages[118], 15) + << "incorrect value for last_msg_.signed_messages[118], expected 15, is " + << last_msg_.signed_messages[118]; + EXPECT_EQ(last_msg_.signed_messages[119], 128) + << "incorrect value for last_msg_.signed_messages[119], expected 128, is " + << last_msg_.signed_messages[119]; + EXPECT_EQ(last_msg_.signed_messages[120], 26) + << "incorrect value for last_msg_.signed_messages[120], expected 26, is " + << last_msg_.signed_messages[120]; + EXPECT_EQ(last_msg_.signed_messages[121], 131) + << "incorrect value for last_msg_.signed_messages[121], expected 131, is " + << last_msg_.signed_messages[121]; + EXPECT_EQ(last_msg_.signed_messages[122], 154) + << "incorrect value for last_msg_.signed_messages[122], expected 154, is " + << last_msg_.signed_messages[122]; + EXPECT_EQ(last_msg_.signed_messages[123], 65) + << "incorrect value for last_msg_.signed_messages[123], expected 65, is " + << last_msg_.signed_messages[123]; + EXPECT_EQ(last_msg_.signed_messages[124], 169) + << "incorrect value for last_msg_.signed_messages[124], expected 169, is " + << last_msg_.signed_messages[124]; + EXPECT_EQ(last_msg_.signed_messages[125], 55) + << "incorrect value for last_msg_.signed_messages[125], expected 55, is " + << last_msg_.signed_messages[125]; + EXPECT_EQ(last_msg_.signed_messages[126], 136) + << "incorrect value for last_msg_.signed_messages[126], expected 136, is " + << last_msg_.signed_messages[126]; + EXPECT_EQ(last_msg_.signed_messages[127], 125) + << "incorrect value for last_msg_.signed_messages[127], expected 125, is " + << last_msg_.signed_messages[127]; + EXPECT_EQ(last_msg_.signed_messages[128], 171) + << "incorrect value for last_msg_.signed_messages[128], expected 171, is " + << last_msg_.signed_messages[128]; + EXPECT_EQ(last_msg_.signed_messages[129], 161) + << "incorrect value for last_msg_.signed_messages[129], expected 161, is " + << last_msg_.signed_messages[129]; + EXPECT_EQ(last_msg_.signed_messages[130], 29) + << "incorrect value for last_msg_.signed_messages[130], expected 29, is " + << last_msg_.signed_messages[130]; + EXPECT_EQ(last_msg_.signed_messages[131], 129) + << "incorrect value for last_msg_.signed_messages[131], expected 129, is " + << last_msg_.signed_messages[131]; + EXPECT_EQ(last_msg_.signed_messages[132], 151) + << "incorrect value for last_msg_.signed_messages[132], expected 151, is " + << last_msg_.signed_messages[132]; + EXPECT_EQ(last_msg_.signed_messages[133], 68) + << "incorrect value for last_msg_.signed_messages[133], expected 68, is " + << last_msg_.signed_messages[133]; + EXPECT_EQ(last_msg_.signed_messages[134], 166) + << "incorrect value for last_msg_.signed_messages[134], expected 166, is " + << last_msg_.signed_messages[134]; + EXPECT_EQ(last_msg_.signed_messages[135], 51) + << "incorrect value for last_msg_.signed_messages[135], expected 51, is " + << last_msg_.signed_messages[135]; + EXPECT_EQ(last_msg_.signed_messages[136], 70) + << "incorrect value for last_msg_.signed_messages[136], expected 70, is " + << last_msg_.signed_messages[136]; + EXPECT_EQ(last_msg_.signed_messages[137], 45) + << "incorrect value for last_msg_.signed_messages[137], expected 45, is " + << last_msg_.signed_messages[137]; + EXPECT_EQ(last_msg_.signed_messages[138], 56) + << "incorrect value for last_msg_.signed_messages[138], expected 56, is " + << last_msg_.signed_messages[138]; + EXPECT_EQ(last_msg_.signed_messages[139], 79) + << "incorrect value for last_msg_.signed_messages[139], expected 79, is " + << last_msg_.signed_messages[139]; + EXPECT_EQ(last_msg_.signed_messages[140], 149) + << "incorrect value for last_msg_.signed_messages[140], expected 149, is " + << last_msg_.signed_messages[140]; + EXPECT_EQ(last_msg_.signed_messages[141], 99) + << "incorrect value for last_msg_.signed_messages[141], expected 99, is " + << last_msg_.signed_messages[141]; + EXPECT_EQ(last_msg_.signed_messages[142], 42) + << "incorrect value for last_msg_.signed_messages[142], expected 42, is " + << last_msg_.signed_messages[142]; + EXPECT_EQ(last_msg_.signed_messages[143], 101) + << "incorrect value for last_msg_.signed_messages[143], expected 101, is " + << last_msg_.signed_messages[143]; + EXPECT_EQ(last_msg_.signed_messages[144], 152) + << "incorrect value for last_msg_.signed_messages[144], expected 152, is " + << last_msg_.signed_messages[144]; + EXPECT_EQ(last_msg_.signed_messages[145], 39) + << "incorrect value for last_msg_.signed_messages[145], expected 39, is " + << last_msg_.signed_messages[145]; + EXPECT_EQ(last_msg_.signed_messages[146], 89) + << "incorrect value for last_msg_.signed_messages[146], expected 89, is " + << last_msg_.signed_messages[146]; + EXPECT_EQ(last_msg_.signed_messages[147], 180) + << "incorrect value for last_msg_.signed_messages[147], expected 180, is " + << last_msg_.signed_messages[147]; + EXPECT_EQ(last_msg_.signed_messages[148], 64) + << "incorrect value for last_msg_.signed_messages[148], expected 64, is " + << last_msg_.signed_messages[148]; + EXPECT_EQ(last_msg_.signed_messages[149], 49) + << "incorrect value for last_msg_.signed_messages[149], expected 49, is " + << last_msg_.signed_messages[149]; + EXPECT_EQ(last_msg_.signed_messages[150], 6) + << "incorrect value for last_msg_.signed_messages[150], expected 6, is " + << last_msg_.signed_messages[150]; + EXPECT_EQ(last_msg_.signed_messages[151], 80) + << "incorrect value for last_msg_.signed_messages[151], expected 80, is " + << last_msg_.signed_messages[151]; + EXPECT_EQ(last_msg_.signed_messages[152], 172) + << "incorrect value for last_msg_.signed_messages[152], expected 172, is " + << last_msg_.signed_messages[152]; + EXPECT_EQ(last_msg_.signed_messages[153], 32) + << "incorrect value for last_msg_.signed_messages[153], expected 32, is " + << last_msg_.signed_messages[153]; + EXPECT_EQ(last_msg_.signed_messages[154], 109) + << "incorrect value for last_msg_.signed_messages[154], expected 109, is " + << last_msg_.signed_messages[154]; + EXPECT_EQ(last_msg_.signed_messages[155], 2) + << "incorrect value for last_msg_.signed_messages[155], expected 2, is " + << last_msg_.signed_messages[155]; + EXPECT_EQ(last_msg_.signed_messages[156], 119) + << "incorrect value for last_msg_.signed_messages[156], expected 119, is " + << last_msg_.signed_messages[156]; + EXPECT_EQ(last_msg_.signed_messages[157], 93) + << "incorrect value for last_msg_.signed_messages[157], expected 93, is " + << last_msg_.signed_messages[157]; + EXPECT_EQ(last_msg_.signed_messages[158], 176) + << "incorrect value for last_msg_.signed_messages[158], expected 176, is " + << last_msg_.signed_messages[158]; + EXPECT_EQ(last_msg_.signed_messages[159], 0) + << "incorrect value for last_msg_.signed_messages[159], expected 0, is " + << last_msg_.signed_messages[159]; + EXPECT_EQ(last_msg_.signed_messages[160], 33) + << "incorrect value for last_msg_.signed_messages[160], expected 33, is " + << last_msg_.signed_messages[160]; + EXPECT_EQ(last_msg_.signed_messages[161], 57) + << "incorrect value for last_msg_.signed_messages[161], expected 57, is " + << last_msg_.signed_messages[161]; + EXPECT_EQ(last_msg_.signed_messages[162], 34) + << "incorrect value for last_msg_.signed_messages[162], expected 34, is " + << last_msg_.signed_messages[162]; + EXPECT_EQ(last_msg_.signed_messages[163], 18) + << "incorrect value for last_msg_.signed_messages[163], expected 18, is " + << last_msg_.signed_messages[163]; + EXPECT_EQ(last_msg_.signed_messages[164], 85) + << "incorrect value for last_msg_.signed_messages[164], expected 85, is " + << last_msg_.signed_messages[164]; + EXPECT_EQ(last_msg_.signed_messages[165], 121) + << "incorrect value for last_msg_.signed_messages[165], expected 121, is " + << last_msg_.signed_messages[165]; + EXPECT_EQ(last_msg_.signed_messages[166], 137) + << "incorrect value for last_msg_.signed_messages[166], expected 137, is " + << last_msg_.signed_messages[166]; + EXPECT_EQ(last_msg_.signed_messages[167], 83) + << "incorrect value for last_msg_.signed_messages[167], expected 83, is " + << last_msg_.signed_messages[167]; + EXPECT_EQ(last_msg_.signed_messages[168], 111) + << "incorrect value for last_msg_.signed_messages[168], expected 111, is " + << last_msg_.signed_messages[168]; + EXPECT_EQ(last_msg_.signed_messages[169], 59) + << "incorrect value for last_msg_.signed_messages[169], expected 59, is " + << last_msg_.signed_messages[169]; + EXPECT_EQ(last_msg_.signed_messages[170], 7) + << "incorrect value for last_msg_.signed_messages[170], expected 7, is " + << last_msg_.signed_messages[170]; + EXPECT_EQ(last_msg_.signed_messages[171], 77) + << "incorrect value for last_msg_.signed_messages[171], expected 77, is " + << last_msg_.signed_messages[171]; + EXPECT_EQ(last_msg_.signed_messages[172], 4) + << "incorrect value for last_msg_.signed_messages[172], expected 4, is " + << last_msg_.signed_messages[172]; + EXPECT_EQ(last_msg_.signed_messages[173], 117) + << "incorrect value for last_msg_.signed_messages[173], expected 117, is " + << last_msg_.signed_messages[173]; + EXPECT_EQ(last_msg_.signed_messages[174], 159) + << "incorrect value for last_msg_.signed_messages[174], expected 159, is " + << last_msg_.signed_messages[174]; + EXPECT_EQ(last_msg_.signed_messages[175], 148) + << "incorrect value for last_msg_.signed_messages[175], expected 148, is " + << last_msg_.signed_messages[175]; + EXPECT_EQ(last_msg_.signed_messages[176], 35) + << "incorrect value for last_msg_.signed_messages[176], expected 35, is " + << last_msg_.signed_messages[176]; + EXPECT_EQ(last_msg_.signed_messages[177], 61) + << "incorrect value for last_msg_.signed_messages[177], expected 61, is " + << last_msg_.signed_messages[177]; + EXPECT_EQ(last_msg_.signed_messages[178], 41) + << "incorrect value for last_msg_.signed_messages[178], expected 41, is " + << last_msg_.signed_messages[178]; + EXPECT_EQ(last_msg_.signed_messages[179], 67) + << "incorrect value for last_msg_.signed_messages[179], expected 67, is " + << last_msg_.signed_messages[179]; + EXPECT_EQ(last_msg_.signed_messages[180], 46) + << "incorrect value for last_msg_.signed_messages[180], expected 46, is " + << last_msg_.signed_messages[180]; + EXPECT_EQ(last_msg_.signed_messages[181], 127) + << "incorrect value for last_msg_.signed_messages[181], expected 127, is " + << last_msg_.signed_messages[181]; + EXPECT_EQ(last_msg_.signed_messages[182], 75) + << "incorrect value for last_msg_.signed_messages[182], expected 75, is " + << last_msg_.signed_messages[182]; + EXPECT_EQ(last_msg_.signed_messages[183], 174) + << "incorrect value for last_msg_.signed_messages[183], expected 174, is " + << last_msg_.signed_messages[183]; + EXPECT_EQ(last_msg_.stream_counter, 1) + << "incorrect value for last_msg_.stream_counter, expected 1, is " + << last_msg_.stream_counter; } diff --git a/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc index 4ed53b351..90f91aebf 100644 --- a/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc +++ b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_signing_MsgEcdsaSignatureDepB0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_signing_MsgEcdsaSignatureDepB0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_signing_MsgEcdsaSignatureDepB0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_signing_MsgEcdsaSignatureDepB0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ecdsa_signature_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ecdsa_signature_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,293 +67,491 @@ class Test_auto_check_sbp_signing_MsgEcdsaSignatureDepB0 : sbp_msg_ecdsa_signature_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_signing_MsgEcdsaSignatureDepB0, Test) -{ - - uint8_t encoded_frame[] = {85,7,12,66,0,83,0,1,2,1,2,3,4,72,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,10,21,23,254,159, }; - - sbp_msg_ecdsa_signature_dep_b_t test_msg{}; - - test_msg.certificate_id[0] = 1; - - test_msg.certificate_id[1] = 2; - - test_msg.certificate_id[2] = 3; - - test_msg.certificate_id[3] = 4; - test_msg.flags = 0; - test_msg.n_signature_bytes = 72; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_signed_messages.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)105,(char)103,(char)110,(char)101,(char)100,(char)95,(char)109,(char)101,(char)115,(char)115,(char)97,(char)103,(char)101,(char)115 }; - memcpy(test_msg.n_signed_messages.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_signed_messages.value = 3; - test_msg.on_demand_counter = 2; - - test_msg.signature[0] = 0; - - test_msg.signature[1] = 1; - - test_msg.signature[2] = 2; - - test_msg.signature[3] = 3; - - test_msg.signature[4] = 4; - - test_msg.signature[5] = 5; - - test_msg.signature[6] = 6; - - test_msg.signature[7] = 7; - - test_msg.signature[8] = 8; - - test_msg.signature[9] = 9; - - test_msg.signature[10] = 10; - - test_msg.signature[11] = 11; - - test_msg.signature[12] = 12; - - test_msg.signature[13] = 13; - - test_msg.signature[14] = 14; - - test_msg.signature[15] = 15; - - test_msg.signature[16] = 16; - - test_msg.signature[17] = 17; - - test_msg.signature[18] = 18; - - test_msg.signature[19] = 19; - - test_msg.signature[20] = 20; - - test_msg.signature[21] = 21; - - test_msg.signature[22] = 22; - - test_msg.signature[23] = 23; - - test_msg.signature[24] = 24; - - test_msg.signature[25] = 25; - - test_msg.signature[26] = 26; - - test_msg.signature[27] = 27; - - test_msg.signature[28] = 28; - - test_msg.signature[29] = 29; - - test_msg.signature[30] = 30; - - test_msg.signature[31] = 31; - - test_msg.signature[32] = 32; - - test_msg.signature[33] = 33; - - test_msg.signature[34] = 34; - - test_msg.signature[35] = 35; - - test_msg.signature[36] = 36; - - test_msg.signature[37] = 37; - - test_msg.signature[38] = 38; - - test_msg.signature[39] = 39; - - test_msg.signature[40] = 40; - - test_msg.signature[41] = 41; - - test_msg.signature[42] = 42; - - test_msg.signature[43] = 43; - - test_msg.signature[44] = 44; - - test_msg.signature[45] = 45; - - test_msg.signature[46] = 46; - - test_msg.signature[47] = 47; - - test_msg.signature[48] = 48; - - test_msg.signature[49] = 49; - - test_msg.signature[50] = 50; - - test_msg.signature[51] = 51; - - test_msg.signature[52] = 52; - - test_msg.signature[53] = 53; - - test_msg.signature[54] = 54; - - test_msg.signature[55] = 55; - - test_msg.signature[56] = 56; - - test_msg.signature[57] = 57; - - test_msg.signature[58] = 58; - - test_msg.signature[59] = 59; - - test_msg.signature[60] = 60; - - test_msg.signature[61] = 61; - - test_msg.signature[62] = 62; - - test_msg.signature[63] = 63; - - test_msg.signature[64] = 64; - - test_msg.signature[65] = 65; - - test_msg.signature[66] = 66; - - test_msg.signature[67] = 67; - - test_msg.signature[68] = 68; - - test_msg.signature[69] = 69; - - test_msg.signature[70] = 70; - - test_msg.signature[71] = 71; - - test_msg.signed_messages[0] = 10; - - test_msg.signed_messages[1] = 21; - - test_msg.signed_messages[2] = 23; - test_msg.stream_counter = 1; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.certificate_id[0], 1) << "incorrect value for last_msg_.certificate_id[0], expected 1, is " << last_msg_.certificate_id[0]; - EXPECT_EQ(last_msg_.certificate_id[1], 2) << "incorrect value for last_msg_.certificate_id[1], expected 2, is " << last_msg_.certificate_id[1]; - EXPECT_EQ(last_msg_.certificate_id[2], 3) << "incorrect value for last_msg_.certificate_id[2], expected 3, is " << last_msg_.certificate_id[2]; - EXPECT_EQ(last_msg_.certificate_id[3], 4) << "incorrect value for last_msg_.certificate_id[3], expected 4, is " << last_msg_.certificate_id[3]; - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_signature_bytes, 72) << "incorrect value for last_msg_.n_signature_bytes, expected 72, is " << last_msg_.n_signature_bytes; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_signed_messages.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_signed_messages.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_signed_messages.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)105,(char)103,(char)110,(char)101,(char)100,(char)95,(char)109,(char)101,(char)115,(char)115,(char)97,(char)103,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_signed_messages.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_signed_messages.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_signed_messages.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_signed_messages.value, 3) << "incorrect value for last_msg_.n_signed_messages.value, expected 3, is " << last_msg_.n_signed_messages.value; - EXPECT_EQ(last_msg_.on_demand_counter, 2) << "incorrect value for last_msg_.on_demand_counter, expected 2, is " << last_msg_.on_demand_counter; - EXPECT_EQ(last_msg_.signature[0], 0) << "incorrect value for last_msg_.signature[0], expected 0, is " << last_msg_.signature[0]; - EXPECT_EQ(last_msg_.signature[1], 1) << "incorrect value for last_msg_.signature[1], expected 1, is " << last_msg_.signature[1]; - EXPECT_EQ(last_msg_.signature[2], 2) << "incorrect value for last_msg_.signature[2], expected 2, is " << last_msg_.signature[2]; - EXPECT_EQ(last_msg_.signature[3], 3) << "incorrect value for last_msg_.signature[3], expected 3, is " << last_msg_.signature[3]; - EXPECT_EQ(last_msg_.signature[4], 4) << "incorrect value for last_msg_.signature[4], expected 4, is " << last_msg_.signature[4]; - EXPECT_EQ(last_msg_.signature[5], 5) << "incorrect value for last_msg_.signature[5], expected 5, is " << last_msg_.signature[5]; - EXPECT_EQ(last_msg_.signature[6], 6) << "incorrect value for last_msg_.signature[6], expected 6, is " << last_msg_.signature[6]; - EXPECT_EQ(last_msg_.signature[7], 7) << "incorrect value for last_msg_.signature[7], expected 7, is " << last_msg_.signature[7]; - EXPECT_EQ(last_msg_.signature[8], 8) << "incorrect value for last_msg_.signature[8], expected 8, is " << last_msg_.signature[8]; - EXPECT_EQ(last_msg_.signature[9], 9) << "incorrect value for last_msg_.signature[9], expected 9, is " << last_msg_.signature[9]; - EXPECT_EQ(last_msg_.signature[10], 10) << "incorrect value for last_msg_.signature[10], expected 10, is " << last_msg_.signature[10]; - EXPECT_EQ(last_msg_.signature[11], 11) << "incorrect value for last_msg_.signature[11], expected 11, is " << last_msg_.signature[11]; - EXPECT_EQ(last_msg_.signature[12], 12) << "incorrect value for last_msg_.signature[12], expected 12, is " << last_msg_.signature[12]; - EXPECT_EQ(last_msg_.signature[13], 13) << "incorrect value for last_msg_.signature[13], expected 13, is " << last_msg_.signature[13]; - EXPECT_EQ(last_msg_.signature[14], 14) << "incorrect value for last_msg_.signature[14], expected 14, is " << last_msg_.signature[14]; - EXPECT_EQ(last_msg_.signature[15], 15) << "incorrect value for last_msg_.signature[15], expected 15, is " << last_msg_.signature[15]; - EXPECT_EQ(last_msg_.signature[16], 16) << "incorrect value for last_msg_.signature[16], expected 16, is " << last_msg_.signature[16]; - EXPECT_EQ(last_msg_.signature[17], 17) << "incorrect value for last_msg_.signature[17], expected 17, is " << last_msg_.signature[17]; - EXPECT_EQ(last_msg_.signature[18], 18) << "incorrect value for last_msg_.signature[18], expected 18, is " << last_msg_.signature[18]; - EXPECT_EQ(last_msg_.signature[19], 19) << "incorrect value for last_msg_.signature[19], expected 19, is " << last_msg_.signature[19]; - EXPECT_EQ(last_msg_.signature[20], 20) << "incorrect value for last_msg_.signature[20], expected 20, is " << last_msg_.signature[20]; - EXPECT_EQ(last_msg_.signature[21], 21) << "incorrect value for last_msg_.signature[21], expected 21, is " << last_msg_.signature[21]; - EXPECT_EQ(last_msg_.signature[22], 22) << "incorrect value for last_msg_.signature[22], expected 22, is " << last_msg_.signature[22]; - EXPECT_EQ(last_msg_.signature[23], 23) << "incorrect value for last_msg_.signature[23], expected 23, is " << last_msg_.signature[23]; - EXPECT_EQ(last_msg_.signature[24], 24) << "incorrect value for last_msg_.signature[24], expected 24, is " << last_msg_.signature[24]; - EXPECT_EQ(last_msg_.signature[25], 25) << "incorrect value for last_msg_.signature[25], expected 25, is " << last_msg_.signature[25]; - EXPECT_EQ(last_msg_.signature[26], 26) << "incorrect value for last_msg_.signature[26], expected 26, is " << last_msg_.signature[26]; - EXPECT_EQ(last_msg_.signature[27], 27) << "incorrect value for last_msg_.signature[27], expected 27, is " << last_msg_.signature[27]; - EXPECT_EQ(last_msg_.signature[28], 28) << "incorrect value for last_msg_.signature[28], expected 28, is " << last_msg_.signature[28]; - EXPECT_EQ(last_msg_.signature[29], 29) << "incorrect value for last_msg_.signature[29], expected 29, is " << last_msg_.signature[29]; - EXPECT_EQ(last_msg_.signature[30], 30) << "incorrect value for last_msg_.signature[30], expected 30, is " << last_msg_.signature[30]; - EXPECT_EQ(last_msg_.signature[31], 31) << "incorrect value for last_msg_.signature[31], expected 31, is " << last_msg_.signature[31]; - EXPECT_EQ(last_msg_.signature[32], 32) << "incorrect value for last_msg_.signature[32], expected 32, is " << last_msg_.signature[32]; - EXPECT_EQ(last_msg_.signature[33], 33) << "incorrect value for last_msg_.signature[33], expected 33, is " << last_msg_.signature[33]; - EXPECT_EQ(last_msg_.signature[34], 34) << "incorrect value for last_msg_.signature[34], expected 34, is " << last_msg_.signature[34]; - EXPECT_EQ(last_msg_.signature[35], 35) << "incorrect value for last_msg_.signature[35], expected 35, is " << last_msg_.signature[35]; - EXPECT_EQ(last_msg_.signature[36], 36) << "incorrect value for last_msg_.signature[36], expected 36, is " << last_msg_.signature[36]; - EXPECT_EQ(last_msg_.signature[37], 37) << "incorrect value for last_msg_.signature[37], expected 37, is " << last_msg_.signature[37]; - EXPECT_EQ(last_msg_.signature[38], 38) << "incorrect value for last_msg_.signature[38], expected 38, is " << last_msg_.signature[38]; - EXPECT_EQ(last_msg_.signature[39], 39) << "incorrect value for last_msg_.signature[39], expected 39, is " << last_msg_.signature[39]; - EXPECT_EQ(last_msg_.signature[40], 40) << "incorrect value for last_msg_.signature[40], expected 40, is " << last_msg_.signature[40]; - EXPECT_EQ(last_msg_.signature[41], 41) << "incorrect value for last_msg_.signature[41], expected 41, is " << last_msg_.signature[41]; - EXPECT_EQ(last_msg_.signature[42], 42) << "incorrect value for last_msg_.signature[42], expected 42, is " << last_msg_.signature[42]; - EXPECT_EQ(last_msg_.signature[43], 43) << "incorrect value for last_msg_.signature[43], expected 43, is " << last_msg_.signature[43]; - EXPECT_EQ(last_msg_.signature[44], 44) << "incorrect value for last_msg_.signature[44], expected 44, is " << last_msg_.signature[44]; - EXPECT_EQ(last_msg_.signature[45], 45) << "incorrect value for last_msg_.signature[45], expected 45, is " << last_msg_.signature[45]; - EXPECT_EQ(last_msg_.signature[46], 46) << "incorrect value for last_msg_.signature[46], expected 46, is " << last_msg_.signature[46]; - EXPECT_EQ(last_msg_.signature[47], 47) << "incorrect value for last_msg_.signature[47], expected 47, is " << last_msg_.signature[47]; - EXPECT_EQ(last_msg_.signature[48], 48) << "incorrect value for last_msg_.signature[48], expected 48, is " << last_msg_.signature[48]; - EXPECT_EQ(last_msg_.signature[49], 49) << "incorrect value for last_msg_.signature[49], expected 49, is " << last_msg_.signature[49]; - EXPECT_EQ(last_msg_.signature[50], 50) << "incorrect value for last_msg_.signature[50], expected 50, is " << last_msg_.signature[50]; - EXPECT_EQ(last_msg_.signature[51], 51) << "incorrect value for last_msg_.signature[51], expected 51, is " << last_msg_.signature[51]; - EXPECT_EQ(last_msg_.signature[52], 52) << "incorrect value for last_msg_.signature[52], expected 52, is " << last_msg_.signature[52]; - EXPECT_EQ(last_msg_.signature[53], 53) << "incorrect value for last_msg_.signature[53], expected 53, is " << last_msg_.signature[53]; - EXPECT_EQ(last_msg_.signature[54], 54) << "incorrect value for last_msg_.signature[54], expected 54, is " << last_msg_.signature[54]; - EXPECT_EQ(last_msg_.signature[55], 55) << "incorrect value for last_msg_.signature[55], expected 55, is " << last_msg_.signature[55]; - EXPECT_EQ(last_msg_.signature[56], 56) << "incorrect value for last_msg_.signature[56], expected 56, is " << last_msg_.signature[56]; - EXPECT_EQ(last_msg_.signature[57], 57) << "incorrect value for last_msg_.signature[57], expected 57, is " << last_msg_.signature[57]; - EXPECT_EQ(last_msg_.signature[58], 58) << "incorrect value for last_msg_.signature[58], expected 58, is " << last_msg_.signature[58]; - EXPECT_EQ(last_msg_.signature[59], 59) << "incorrect value for last_msg_.signature[59], expected 59, is " << last_msg_.signature[59]; - EXPECT_EQ(last_msg_.signature[60], 60) << "incorrect value for last_msg_.signature[60], expected 60, is " << last_msg_.signature[60]; - EXPECT_EQ(last_msg_.signature[61], 61) << "incorrect value for last_msg_.signature[61], expected 61, is " << last_msg_.signature[61]; - EXPECT_EQ(last_msg_.signature[62], 62) << "incorrect value for last_msg_.signature[62], expected 62, is " << last_msg_.signature[62]; - EXPECT_EQ(last_msg_.signature[63], 63) << "incorrect value for last_msg_.signature[63], expected 63, is " << last_msg_.signature[63]; - EXPECT_EQ(last_msg_.signature[64], 64) << "incorrect value for last_msg_.signature[64], expected 64, is " << last_msg_.signature[64]; - EXPECT_EQ(last_msg_.signature[65], 65) << "incorrect value for last_msg_.signature[65], expected 65, is " << last_msg_.signature[65]; - EXPECT_EQ(last_msg_.signature[66], 66) << "incorrect value for last_msg_.signature[66], expected 66, is " << last_msg_.signature[66]; - EXPECT_EQ(last_msg_.signature[67], 67) << "incorrect value for last_msg_.signature[67], expected 67, is " << last_msg_.signature[67]; - EXPECT_EQ(last_msg_.signature[68], 68) << "incorrect value for last_msg_.signature[68], expected 68, is " << last_msg_.signature[68]; - EXPECT_EQ(last_msg_.signature[69], 69) << "incorrect value for last_msg_.signature[69], expected 69, is " << last_msg_.signature[69]; - EXPECT_EQ(last_msg_.signature[70], 70) << "incorrect value for last_msg_.signature[70], expected 70, is " << last_msg_.signature[70]; - EXPECT_EQ(last_msg_.signature[71], 71) << "incorrect value for last_msg_.signature[71], expected 71, is " << last_msg_.signature[71]; - EXPECT_EQ(last_msg_.signed_messages[0], 10) << "incorrect value for last_msg_.signed_messages[0], expected 10, is " << last_msg_.signed_messages[0]; - EXPECT_EQ(last_msg_.signed_messages[1], 21) << "incorrect value for last_msg_.signed_messages[1], expected 21, is " << last_msg_.signed_messages[1]; - EXPECT_EQ(last_msg_.signed_messages[2], 23) << "incorrect value for last_msg_.signed_messages[2], expected 23, is " << last_msg_.signed_messages[2]; - EXPECT_EQ(last_msg_.stream_counter, 1) << "incorrect value for last_msg_.stream_counter, expected 1, is " << last_msg_.stream_counter; +}; + +TEST_F(Test_auto_check_sbp_signing_MsgEcdsaSignatureDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + }; + + sbp_msg_ecdsa_signature_dep_b_t test_msg{}; + + test_msg.certificate_id[0] = 1; + + test_msg.certificate_id[1] = 2; + + test_msg.certificate_id[2] = 3; + + test_msg.certificate_id[3] = 4; + test_msg.flags = 0; + test_msg.n_signature_bytes = 72; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_signed_messages.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)105, (char)103, (char)110, + (char)101, (char)100, (char)95, (char)109, + (char)101, (char)115, (char)115, (char)97, + (char)103, (char)101, (char)115}; + memcpy(test_msg.n_signed_messages.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_signed_messages.value = 3; + test_msg.on_demand_counter = 2; + + test_msg.signature[0] = 0; + + test_msg.signature[1] = 1; + + test_msg.signature[2] = 2; + + test_msg.signature[3] = 3; + + test_msg.signature[4] = 4; + + test_msg.signature[5] = 5; + + test_msg.signature[6] = 6; + + test_msg.signature[7] = 7; + + test_msg.signature[8] = 8; + + test_msg.signature[9] = 9; + + test_msg.signature[10] = 10; + + test_msg.signature[11] = 11; + + test_msg.signature[12] = 12; + + test_msg.signature[13] = 13; + + test_msg.signature[14] = 14; + + test_msg.signature[15] = 15; + + test_msg.signature[16] = 16; + + test_msg.signature[17] = 17; + + test_msg.signature[18] = 18; + + test_msg.signature[19] = 19; + + test_msg.signature[20] = 20; + + test_msg.signature[21] = 21; + + test_msg.signature[22] = 22; + + test_msg.signature[23] = 23; + + test_msg.signature[24] = 24; + + test_msg.signature[25] = 25; + + test_msg.signature[26] = 26; + + test_msg.signature[27] = 27; + + test_msg.signature[28] = 28; + + test_msg.signature[29] = 29; + + test_msg.signature[30] = 30; + + test_msg.signature[31] = 31; + + test_msg.signature[32] = 32; + + test_msg.signature[33] = 33; + + test_msg.signature[34] = 34; + + test_msg.signature[35] = 35; + + test_msg.signature[36] = 36; + + test_msg.signature[37] = 37; + + test_msg.signature[38] = 38; + + test_msg.signature[39] = 39; + + test_msg.signature[40] = 40; + + test_msg.signature[41] = 41; + + test_msg.signature[42] = 42; + + test_msg.signature[43] = 43; + + test_msg.signature[44] = 44; + + test_msg.signature[45] = 45; + + test_msg.signature[46] = 46; + + test_msg.signature[47] = 47; + + test_msg.signature[48] = 48; + + test_msg.signature[49] = 49; + + test_msg.signature[50] = 50; + + test_msg.signature[51] = 51; + + test_msg.signature[52] = 52; + + test_msg.signature[53] = 53; + + test_msg.signature[54] = 54; + + test_msg.signature[55] = 55; + + test_msg.signature[56] = 56; + + test_msg.signature[57] = 57; + + test_msg.signature[58] = 58; + + test_msg.signature[59] = 59; + + test_msg.signature[60] = 60; + + test_msg.signature[61] = 61; + + test_msg.signature[62] = 62; + + test_msg.signature[63] = 63; + + test_msg.signature[64] = 64; + + test_msg.signature[65] = 65; + + test_msg.signature[66] = 66; + + test_msg.signature[67] = 67; + + test_msg.signature[68] = 68; + + test_msg.signature[69] = 69; + + test_msg.signature[70] = 70; + + test_msg.signature[71] = 71; + + test_msg.signed_messages[0] = 10; + + test_msg.signed_messages[1] = 21; + + test_msg.signed_messages[2] = 23; + test_msg.stream_counter = 1; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.certificate_id[0], 1) + << "incorrect value for last_msg_.certificate_id[0], expected 1, is " + << last_msg_.certificate_id[0]; + EXPECT_EQ(last_msg_.certificate_id[1], 2) + << "incorrect value for last_msg_.certificate_id[1], expected 2, is " + << last_msg_.certificate_id[1]; + EXPECT_EQ(last_msg_.certificate_id[2], 3) + << "incorrect value for last_msg_.certificate_id[2], expected 3, is " + << last_msg_.certificate_id[2]; + EXPECT_EQ(last_msg_.certificate_id[3], 4) + << "incorrect value for last_msg_.certificate_id[3], expected 4, is " + << last_msg_.certificate_id[3]; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_signature_bytes, 72) + << "incorrect value for last_msg_.n_signature_bytes, expected 72, is " + << last_msg_.n_signature_bytes; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_signed_messages.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_signed_messages.handle_as, " + "expected string '" + << check_string << "', is '" << last_msg_.n_signed_messages.handle_as + << "'"; + } + { + const char check_string[] = {(char)115, (char)105, (char)103, (char)110, + (char)101, (char)100, (char)95, (char)109, + (char)101, (char)115, (char)115, (char)97, + (char)103, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_signed_messages.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_signed_messages.relates_to, " + "expected string '" + << check_string << "', is '" << last_msg_.n_signed_messages.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_signed_messages.value, 3) + << "incorrect value for last_msg_.n_signed_messages.value, expected 3, " + "is " + << last_msg_.n_signed_messages.value; + EXPECT_EQ(last_msg_.on_demand_counter, 2) + << "incorrect value for last_msg_.on_demand_counter, expected 2, is " + << last_msg_.on_demand_counter; + EXPECT_EQ(last_msg_.signature[0], 0) + << "incorrect value for last_msg_.signature[0], expected 0, is " + << last_msg_.signature[0]; + EXPECT_EQ(last_msg_.signature[1], 1) + << "incorrect value for last_msg_.signature[1], expected 1, is " + << last_msg_.signature[1]; + EXPECT_EQ(last_msg_.signature[2], 2) + << "incorrect value for last_msg_.signature[2], expected 2, is " + << last_msg_.signature[2]; + EXPECT_EQ(last_msg_.signature[3], 3) + << "incorrect value for last_msg_.signature[3], expected 3, is " + << last_msg_.signature[3]; + EXPECT_EQ(last_msg_.signature[4], 4) + << "incorrect value for last_msg_.signature[4], expected 4, is " + << last_msg_.signature[4]; + EXPECT_EQ(last_msg_.signature[5], 5) + << "incorrect value for last_msg_.signature[5], expected 5, is " + << last_msg_.signature[5]; + EXPECT_EQ(last_msg_.signature[6], 6) + << "incorrect value for last_msg_.signature[6], expected 6, is " + << last_msg_.signature[6]; + EXPECT_EQ(last_msg_.signature[7], 7) + << "incorrect value for last_msg_.signature[7], expected 7, is " + << last_msg_.signature[7]; + EXPECT_EQ(last_msg_.signature[8], 8) + << "incorrect value for last_msg_.signature[8], expected 8, is " + << last_msg_.signature[8]; + EXPECT_EQ(last_msg_.signature[9], 9) + << "incorrect value for last_msg_.signature[9], expected 9, is " + << last_msg_.signature[9]; + EXPECT_EQ(last_msg_.signature[10], 10) + << "incorrect value for last_msg_.signature[10], expected 10, is " + << last_msg_.signature[10]; + EXPECT_EQ(last_msg_.signature[11], 11) + << "incorrect value for last_msg_.signature[11], expected 11, is " + << last_msg_.signature[11]; + EXPECT_EQ(last_msg_.signature[12], 12) + << "incorrect value for last_msg_.signature[12], expected 12, is " + << last_msg_.signature[12]; + EXPECT_EQ(last_msg_.signature[13], 13) + << "incorrect value for last_msg_.signature[13], expected 13, is " + << last_msg_.signature[13]; + EXPECT_EQ(last_msg_.signature[14], 14) + << "incorrect value for last_msg_.signature[14], expected 14, is " + << last_msg_.signature[14]; + EXPECT_EQ(last_msg_.signature[15], 15) + << "incorrect value for last_msg_.signature[15], expected 15, is " + << last_msg_.signature[15]; + EXPECT_EQ(last_msg_.signature[16], 16) + << "incorrect value for last_msg_.signature[16], expected 16, is " + << last_msg_.signature[16]; + EXPECT_EQ(last_msg_.signature[17], 17) + << "incorrect value for last_msg_.signature[17], expected 17, is " + << last_msg_.signature[17]; + EXPECT_EQ(last_msg_.signature[18], 18) + << "incorrect value for last_msg_.signature[18], expected 18, is " + << last_msg_.signature[18]; + EXPECT_EQ(last_msg_.signature[19], 19) + << "incorrect value for last_msg_.signature[19], expected 19, is " + << last_msg_.signature[19]; + EXPECT_EQ(last_msg_.signature[20], 20) + << "incorrect value for last_msg_.signature[20], expected 20, is " + << last_msg_.signature[20]; + EXPECT_EQ(last_msg_.signature[21], 21) + << "incorrect value for last_msg_.signature[21], expected 21, is " + << last_msg_.signature[21]; + EXPECT_EQ(last_msg_.signature[22], 22) + << "incorrect value for last_msg_.signature[22], expected 22, is " + << last_msg_.signature[22]; + EXPECT_EQ(last_msg_.signature[23], 23) + << "incorrect value for last_msg_.signature[23], expected 23, is " + << last_msg_.signature[23]; + EXPECT_EQ(last_msg_.signature[24], 24) + << "incorrect value for last_msg_.signature[24], expected 24, is " + << last_msg_.signature[24]; + EXPECT_EQ(last_msg_.signature[25], 25) + << "incorrect value for last_msg_.signature[25], expected 25, is " + << last_msg_.signature[25]; + EXPECT_EQ(last_msg_.signature[26], 26) + << "incorrect value for last_msg_.signature[26], expected 26, is " + << last_msg_.signature[26]; + EXPECT_EQ(last_msg_.signature[27], 27) + << "incorrect value for last_msg_.signature[27], expected 27, is " + << last_msg_.signature[27]; + EXPECT_EQ(last_msg_.signature[28], 28) + << "incorrect value for last_msg_.signature[28], expected 28, is " + << last_msg_.signature[28]; + EXPECT_EQ(last_msg_.signature[29], 29) + << "incorrect value for last_msg_.signature[29], expected 29, is " + << last_msg_.signature[29]; + EXPECT_EQ(last_msg_.signature[30], 30) + << "incorrect value for last_msg_.signature[30], expected 30, is " + << last_msg_.signature[30]; + EXPECT_EQ(last_msg_.signature[31], 31) + << "incorrect value for last_msg_.signature[31], expected 31, is " + << last_msg_.signature[31]; + EXPECT_EQ(last_msg_.signature[32], 32) + << "incorrect value for last_msg_.signature[32], expected 32, is " + << last_msg_.signature[32]; + EXPECT_EQ(last_msg_.signature[33], 33) + << "incorrect value for last_msg_.signature[33], expected 33, is " + << last_msg_.signature[33]; + EXPECT_EQ(last_msg_.signature[34], 34) + << "incorrect value for last_msg_.signature[34], expected 34, is " + << last_msg_.signature[34]; + EXPECT_EQ(last_msg_.signature[35], 35) + << "incorrect value for last_msg_.signature[35], expected 35, is " + << last_msg_.signature[35]; + EXPECT_EQ(last_msg_.signature[36], 36) + << "incorrect value for last_msg_.signature[36], expected 36, is " + << last_msg_.signature[36]; + EXPECT_EQ(last_msg_.signature[37], 37) + << "incorrect value for last_msg_.signature[37], expected 37, is " + << last_msg_.signature[37]; + EXPECT_EQ(last_msg_.signature[38], 38) + << "incorrect value for last_msg_.signature[38], expected 38, is " + << last_msg_.signature[38]; + EXPECT_EQ(last_msg_.signature[39], 39) + << "incorrect value for last_msg_.signature[39], expected 39, is " + << last_msg_.signature[39]; + EXPECT_EQ(last_msg_.signature[40], 40) + << "incorrect value for last_msg_.signature[40], expected 40, is " + << last_msg_.signature[40]; + EXPECT_EQ(last_msg_.signature[41], 41) + << "incorrect value for last_msg_.signature[41], expected 41, is " + << last_msg_.signature[41]; + EXPECT_EQ(last_msg_.signature[42], 42) + << "incorrect value for last_msg_.signature[42], expected 42, is " + << last_msg_.signature[42]; + EXPECT_EQ(last_msg_.signature[43], 43) + << "incorrect value for last_msg_.signature[43], expected 43, is " + << last_msg_.signature[43]; + EXPECT_EQ(last_msg_.signature[44], 44) + << "incorrect value for last_msg_.signature[44], expected 44, is " + << last_msg_.signature[44]; + EXPECT_EQ(last_msg_.signature[45], 45) + << "incorrect value for last_msg_.signature[45], expected 45, is " + << last_msg_.signature[45]; + EXPECT_EQ(last_msg_.signature[46], 46) + << "incorrect value for last_msg_.signature[46], expected 46, is " + << last_msg_.signature[46]; + EXPECT_EQ(last_msg_.signature[47], 47) + << "incorrect value for last_msg_.signature[47], expected 47, is " + << last_msg_.signature[47]; + EXPECT_EQ(last_msg_.signature[48], 48) + << "incorrect value for last_msg_.signature[48], expected 48, is " + << last_msg_.signature[48]; + EXPECT_EQ(last_msg_.signature[49], 49) + << "incorrect value for last_msg_.signature[49], expected 49, is " + << last_msg_.signature[49]; + EXPECT_EQ(last_msg_.signature[50], 50) + << "incorrect value for last_msg_.signature[50], expected 50, is " + << last_msg_.signature[50]; + EXPECT_EQ(last_msg_.signature[51], 51) + << "incorrect value for last_msg_.signature[51], expected 51, is " + << last_msg_.signature[51]; + EXPECT_EQ(last_msg_.signature[52], 52) + << "incorrect value for last_msg_.signature[52], expected 52, is " + << last_msg_.signature[52]; + EXPECT_EQ(last_msg_.signature[53], 53) + << "incorrect value for last_msg_.signature[53], expected 53, is " + << last_msg_.signature[53]; + EXPECT_EQ(last_msg_.signature[54], 54) + << "incorrect value for last_msg_.signature[54], expected 54, is " + << last_msg_.signature[54]; + EXPECT_EQ(last_msg_.signature[55], 55) + << "incorrect value for last_msg_.signature[55], expected 55, is " + << last_msg_.signature[55]; + EXPECT_EQ(last_msg_.signature[56], 56) + << "incorrect value for last_msg_.signature[56], expected 56, is " + << last_msg_.signature[56]; + EXPECT_EQ(last_msg_.signature[57], 57) + << "incorrect value for last_msg_.signature[57], expected 57, is " + << last_msg_.signature[57]; + EXPECT_EQ(last_msg_.signature[58], 58) + << "incorrect value for last_msg_.signature[58], expected 58, is " + << last_msg_.signature[58]; + EXPECT_EQ(last_msg_.signature[59], 59) + << "incorrect value for last_msg_.signature[59], expected 59, is " + << last_msg_.signature[59]; + EXPECT_EQ(last_msg_.signature[60], 60) + << "incorrect value for last_msg_.signature[60], expected 60, is " + << last_msg_.signature[60]; + EXPECT_EQ(last_msg_.signature[61], 61) + << "incorrect value for last_msg_.signature[61], expected 61, is " + << last_msg_.signature[61]; + EXPECT_EQ(last_msg_.signature[62], 62) + << "incorrect value for last_msg_.signature[62], expected 62, is " + << last_msg_.signature[62]; + EXPECT_EQ(last_msg_.signature[63], 63) + << "incorrect value for last_msg_.signature[63], expected 63, is " + << last_msg_.signature[63]; + EXPECT_EQ(last_msg_.signature[64], 64) + << "incorrect value for last_msg_.signature[64], expected 64, is " + << last_msg_.signature[64]; + EXPECT_EQ(last_msg_.signature[65], 65) + << "incorrect value for last_msg_.signature[65], expected 65, is " + << last_msg_.signature[65]; + EXPECT_EQ(last_msg_.signature[66], 66) + << "incorrect value for last_msg_.signature[66], expected 66, is " + << last_msg_.signature[66]; + EXPECT_EQ(last_msg_.signature[67], 67) + << "incorrect value for last_msg_.signature[67], expected 67, is " + << last_msg_.signature[67]; + EXPECT_EQ(last_msg_.signature[68], 68) + << "incorrect value for last_msg_.signature[68], expected 68, is " + << last_msg_.signature[68]; + EXPECT_EQ(last_msg_.signature[69], 69) + << "incorrect value for last_msg_.signature[69], expected 69, is " + << last_msg_.signature[69]; + EXPECT_EQ(last_msg_.signature[70], 70) + << "incorrect value for last_msg_.signature[70], expected 70, is " + << last_msg_.signature[70]; + EXPECT_EQ(last_msg_.signature[71], 71) + << "incorrect value for last_msg_.signature[71], expected 71, is " + << last_msg_.signature[71]; + EXPECT_EQ(last_msg_.signed_messages[0], 10) + << "incorrect value for last_msg_.signed_messages[0], expected 10, is " + << last_msg_.signed_messages[0]; + EXPECT_EQ(last_msg_.signed_messages[1], 21) + << "incorrect value for last_msg_.signed_messages[1], expected 21, is " + << last_msg_.signed_messages[1]; + EXPECT_EQ(last_msg_.signed_messages[2], 23) + << "incorrect value for last_msg_.signed_messages[2], expected 23, is " + << last_msg_.signed_messages[2]; + EXPECT_EQ(last_msg_.stream_counter, 1) + << "incorrect value for last_msg_.stream_counter, expected 1, is " + << last_msg_.stream_counter; } diff --git a/c/test/cpp/auto_check_sbp_signing_MsgEd25519CertificateDep.cc b/c/test/cpp/auto_check_sbp_signing_MsgEd25519CertificateDep.cc index 59be79e86..7e4068ed4 100644 --- a/c/test/cpp/auto_check_sbp_signing_MsgEd25519CertificateDep.cc +++ b/c/test/cpp/auto_check_sbp_signing_MsgEd25519CertificateDep.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519CertificateDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519CertificateDep.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_signing_MsgEd25519CertificateDep0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_signing_MsgEd25519CertificateDep0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_signing_MsgEd25519CertificateDep0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_signing_MsgEd25519CertificateDep0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ed25519_certificate_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ed25519_certificate_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,365 +67,662 @@ class Test_auto_check_sbp_signing_MsgEd25519CertificateDep0 : sbp_msg_ed25519_certificate_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_signing_MsgEd25519CertificateDep0, Test) -{ - - uint8_t encoded_frame[] = {85,2,12,66,0,106,16,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,123,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,177,180,183,186,189,192,195,198,201,204,207,210,213,216,219,222,225,228,231,234,237,240,243,246,249,252,218,148, }; - - sbp_msg_ed25519_certificate_dep_t test_msg{}; - - test_msg.certificate_bytes[0] = 0; - - test_msg.certificate_bytes[1] = 3; - - test_msg.certificate_bytes[2] = 6; - - test_msg.certificate_bytes[3] = 9; - - test_msg.certificate_bytes[4] = 12; - - test_msg.certificate_bytes[5] = 15; - - test_msg.certificate_bytes[6] = 18; - - test_msg.certificate_bytes[7] = 21; - - test_msg.certificate_bytes[8] = 24; - - test_msg.certificate_bytes[9] = 27; - - test_msg.certificate_bytes[10] = 30; - - test_msg.certificate_bytes[11] = 33; - - test_msg.certificate_bytes[12] = 36; - - test_msg.certificate_bytes[13] = 39; - - test_msg.certificate_bytes[14] = 42; - - test_msg.certificate_bytes[15] = 45; - - test_msg.certificate_bytes[16] = 48; - - test_msg.certificate_bytes[17] = 51; - - test_msg.certificate_bytes[18] = 54; - - test_msg.certificate_bytes[19] = 57; - - test_msg.certificate_bytes[20] = 60; - - test_msg.certificate_bytes[21] = 63; - - test_msg.certificate_bytes[22] = 66; - - test_msg.certificate_bytes[23] = 69; - - test_msg.certificate_bytes[24] = 72; - - test_msg.certificate_bytes[25] = 75; - - test_msg.certificate_bytes[26] = 78; - - test_msg.certificate_bytes[27] = 81; - - test_msg.certificate_bytes[28] = 84; - - test_msg.certificate_bytes[29] = 87; - - test_msg.certificate_bytes[30] = 90; - - test_msg.certificate_bytes[31] = 93; - - test_msg.certificate_bytes[32] = 96; - - test_msg.certificate_bytes[33] = 99; - - test_msg.certificate_bytes[34] = 102; - - test_msg.certificate_bytes[35] = 105; - - test_msg.certificate_bytes[36] = 108; - - test_msg.certificate_bytes[37] = 111; - - test_msg.certificate_bytes[38] = 114; - - test_msg.certificate_bytes[39] = 117; - - test_msg.certificate_bytes[40] = 120; - - test_msg.certificate_bytes[41] = 123; - - test_msg.certificate_bytes[42] = 126; - - test_msg.certificate_bytes[43] = 129; - - test_msg.certificate_bytes[44] = 132; - - test_msg.certificate_bytes[45] = 135; - - test_msg.certificate_bytes[46] = 138; - - test_msg.certificate_bytes[47] = 141; - - test_msg.certificate_bytes[48] = 144; - - test_msg.certificate_bytes[49] = 147; - - test_msg.certificate_bytes[50] = 150; - - test_msg.certificate_bytes[51] = 153; - - test_msg.certificate_bytes[52] = 156; - - test_msg.certificate_bytes[53] = 159; - - test_msg.certificate_bytes[54] = 162; - - test_msg.certificate_bytes[55] = 165; - - test_msg.certificate_bytes[56] = 168; - - test_msg.certificate_bytes[57] = 171; - - test_msg.certificate_bytes[58] = 174; - - test_msg.certificate_bytes[59] = 177; - - test_msg.certificate_bytes[60] = 180; - - test_msg.certificate_bytes[61] = 183; - - test_msg.certificate_bytes[62] = 186; - - test_msg.certificate_bytes[63] = 189; - - test_msg.certificate_bytes[64] = 192; - - test_msg.certificate_bytes[65] = 195; - - test_msg.certificate_bytes[66] = 198; - - test_msg.certificate_bytes[67] = 201; - - test_msg.certificate_bytes[68] = 204; - - test_msg.certificate_bytes[69] = 207; - - test_msg.certificate_bytes[70] = 210; - - test_msg.certificate_bytes[71] = 213; - - test_msg.certificate_bytes[72] = 216; - - test_msg.certificate_bytes[73] = 219; - - test_msg.certificate_bytes[74] = 222; - - test_msg.certificate_bytes[75] = 225; - - test_msg.certificate_bytes[76] = 228; - - test_msg.certificate_bytes[77] = 231; - - test_msg.certificate_bytes[78] = 234; - - test_msg.certificate_bytes[79] = 237; - - test_msg.certificate_bytes[80] = 240; - - test_msg.certificate_bytes[81] = 243; - - test_msg.certificate_bytes[82] = 246; - - test_msg.certificate_bytes[83] = 249; - - test_msg.certificate_bytes[84] = 252; - - test_msg.fingerprint[0] = 100; - - test_msg.fingerprint[1] = 101; - - test_msg.fingerprint[2] = 102; - - test_msg.fingerprint[3] = 103; - - test_msg.fingerprint[4] = 104; - - test_msg.fingerprint[5] = 105; - - test_msg.fingerprint[6] = 106; - - test_msg.fingerprint[7] = 107; - - test_msg.fingerprint[8] = 108; - - test_msg.fingerprint[9] = 109; - - test_msg.fingerprint[10] = 110; - - test_msg.fingerprint[11] = 111; - - test_msg.fingerprint[12] = 112; - - test_msg.fingerprint[13] = 113; - - test_msg.fingerprint[14] = 114; - - test_msg.fingerprint[15] = 115; - - test_msg.fingerprint[16] = 116; - - test_msg.fingerprint[17] = 117; - - test_msg.fingerprint[18] = 118; - - test_msg.fingerprint[19] = 119; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_certificate_bytes.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)99,(char)101,(char)114,(char)116,(char)105,(char)102,(char)105,(char)99,(char)97,(char)116,(char)101,(char)95,(char)98,(char)121,(char)116,(char)101,(char)115 }; - memcpy(test_msg.n_certificate_bytes.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_certificate_bytes.value = 85; - test_msg.n_msg = 16; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.certificate_bytes[0], 0) << "incorrect value for last_msg_.certificate_bytes[0], expected 0, is " << last_msg_.certificate_bytes[0]; - EXPECT_EQ(last_msg_.certificate_bytes[1], 3) << "incorrect value for last_msg_.certificate_bytes[1], expected 3, is " << last_msg_.certificate_bytes[1]; - EXPECT_EQ(last_msg_.certificate_bytes[2], 6) << "incorrect value for last_msg_.certificate_bytes[2], expected 6, is " << last_msg_.certificate_bytes[2]; - EXPECT_EQ(last_msg_.certificate_bytes[3], 9) << "incorrect value for last_msg_.certificate_bytes[3], expected 9, is " << last_msg_.certificate_bytes[3]; - EXPECT_EQ(last_msg_.certificate_bytes[4], 12) << "incorrect value for last_msg_.certificate_bytes[4], expected 12, is " << last_msg_.certificate_bytes[4]; - EXPECT_EQ(last_msg_.certificate_bytes[5], 15) << "incorrect value for last_msg_.certificate_bytes[5], expected 15, is " << last_msg_.certificate_bytes[5]; - EXPECT_EQ(last_msg_.certificate_bytes[6], 18) << "incorrect value for last_msg_.certificate_bytes[6], expected 18, is " << last_msg_.certificate_bytes[6]; - EXPECT_EQ(last_msg_.certificate_bytes[7], 21) << "incorrect value for last_msg_.certificate_bytes[7], expected 21, is " << last_msg_.certificate_bytes[7]; - EXPECT_EQ(last_msg_.certificate_bytes[8], 24) << "incorrect value for last_msg_.certificate_bytes[8], expected 24, is " << last_msg_.certificate_bytes[8]; - EXPECT_EQ(last_msg_.certificate_bytes[9], 27) << "incorrect value for last_msg_.certificate_bytes[9], expected 27, is " << last_msg_.certificate_bytes[9]; - EXPECT_EQ(last_msg_.certificate_bytes[10], 30) << "incorrect value for last_msg_.certificate_bytes[10], expected 30, is " << last_msg_.certificate_bytes[10]; - EXPECT_EQ(last_msg_.certificate_bytes[11], 33) << "incorrect value for last_msg_.certificate_bytes[11], expected 33, is " << last_msg_.certificate_bytes[11]; - EXPECT_EQ(last_msg_.certificate_bytes[12], 36) << "incorrect value for last_msg_.certificate_bytes[12], expected 36, is " << last_msg_.certificate_bytes[12]; - EXPECT_EQ(last_msg_.certificate_bytes[13], 39) << "incorrect value for last_msg_.certificate_bytes[13], expected 39, is " << last_msg_.certificate_bytes[13]; - EXPECT_EQ(last_msg_.certificate_bytes[14], 42) << "incorrect value for last_msg_.certificate_bytes[14], expected 42, is " << last_msg_.certificate_bytes[14]; - EXPECT_EQ(last_msg_.certificate_bytes[15], 45) << "incorrect value for last_msg_.certificate_bytes[15], expected 45, is " << last_msg_.certificate_bytes[15]; - EXPECT_EQ(last_msg_.certificate_bytes[16], 48) << "incorrect value for last_msg_.certificate_bytes[16], expected 48, is " << last_msg_.certificate_bytes[16]; - EXPECT_EQ(last_msg_.certificate_bytes[17], 51) << "incorrect value for last_msg_.certificate_bytes[17], expected 51, is " << last_msg_.certificate_bytes[17]; - EXPECT_EQ(last_msg_.certificate_bytes[18], 54) << "incorrect value for last_msg_.certificate_bytes[18], expected 54, is " << last_msg_.certificate_bytes[18]; - EXPECT_EQ(last_msg_.certificate_bytes[19], 57) << "incorrect value for last_msg_.certificate_bytes[19], expected 57, is " << last_msg_.certificate_bytes[19]; - EXPECT_EQ(last_msg_.certificate_bytes[20], 60) << "incorrect value for last_msg_.certificate_bytes[20], expected 60, is " << last_msg_.certificate_bytes[20]; - EXPECT_EQ(last_msg_.certificate_bytes[21], 63) << "incorrect value for last_msg_.certificate_bytes[21], expected 63, is " << last_msg_.certificate_bytes[21]; - EXPECT_EQ(last_msg_.certificate_bytes[22], 66) << "incorrect value for last_msg_.certificate_bytes[22], expected 66, is " << last_msg_.certificate_bytes[22]; - EXPECT_EQ(last_msg_.certificate_bytes[23], 69) << "incorrect value for last_msg_.certificate_bytes[23], expected 69, is " << last_msg_.certificate_bytes[23]; - EXPECT_EQ(last_msg_.certificate_bytes[24], 72) << "incorrect value for last_msg_.certificate_bytes[24], expected 72, is " << last_msg_.certificate_bytes[24]; - EXPECT_EQ(last_msg_.certificate_bytes[25], 75) << "incorrect value for last_msg_.certificate_bytes[25], expected 75, is " << last_msg_.certificate_bytes[25]; - EXPECT_EQ(last_msg_.certificate_bytes[26], 78) << "incorrect value for last_msg_.certificate_bytes[26], expected 78, is " << last_msg_.certificate_bytes[26]; - EXPECT_EQ(last_msg_.certificate_bytes[27], 81) << "incorrect value for last_msg_.certificate_bytes[27], expected 81, is " << last_msg_.certificate_bytes[27]; - EXPECT_EQ(last_msg_.certificate_bytes[28], 84) << "incorrect value for last_msg_.certificate_bytes[28], expected 84, is " << last_msg_.certificate_bytes[28]; - EXPECT_EQ(last_msg_.certificate_bytes[29], 87) << "incorrect value for last_msg_.certificate_bytes[29], expected 87, is " << last_msg_.certificate_bytes[29]; - EXPECT_EQ(last_msg_.certificate_bytes[30], 90) << "incorrect value for last_msg_.certificate_bytes[30], expected 90, is " << last_msg_.certificate_bytes[30]; - EXPECT_EQ(last_msg_.certificate_bytes[31], 93) << "incorrect value for last_msg_.certificate_bytes[31], expected 93, is " << last_msg_.certificate_bytes[31]; - EXPECT_EQ(last_msg_.certificate_bytes[32], 96) << "incorrect value for last_msg_.certificate_bytes[32], expected 96, is " << last_msg_.certificate_bytes[32]; - EXPECT_EQ(last_msg_.certificate_bytes[33], 99) << "incorrect value for last_msg_.certificate_bytes[33], expected 99, is " << last_msg_.certificate_bytes[33]; - EXPECT_EQ(last_msg_.certificate_bytes[34], 102) << "incorrect value for last_msg_.certificate_bytes[34], expected 102, is " << last_msg_.certificate_bytes[34]; - EXPECT_EQ(last_msg_.certificate_bytes[35], 105) << "incorrect value for last_msg_.certificate_bytes[35], expected 105, is " << last_msg_.certificate_bytes[35]; - EXPECT_EQ(last_msg_.certificate_bytes[36], 108) << "incorrect value for last_msg_.certificate_bytes[36], expected 108, is " << last_msg_.certificate_bytes[36]; - EXPECT_EQ(last_msg_.certificate_bytes[37], 111) << "incorrect value for last_msg_.certificate_bytes[37], expected 111, is " << last_msg_.certificate_bytes[37]; - EXPECT_EQ(last_msg_.certificate_bytes[38], 114) << "incorrect value for last_msg_.certificate_bytes[38], expected 114, is " << last_msg_.certificate_bytes[38]; - EXPECT_EQ(last_msg_.certificate_bytes[39], 117) << "incorrect value for last_msg_.certificate_bytes[39], expected 117, is " << last_msg_.certificate_bytes[39]; - EXPECT_EQ(last_msg_.certificate_bytes[40], 120) << "incorrect value for last_msg_.certificate_bytes[40], expected 120, is " << last_msg_.certificate_bytes[40]; - EXPECT_EQ(last_msg_.certificate_bytes[41], 123) << "incorrect value for last_msg_.certificate_bytes[41], expected 123, is " << last_msg_.certificate_bytes[41]; - EXPECT_EQ(last_msg_.certificate_bytes[42], 126) << "incorrect value for last_msg_.certificate_bytes[42], expected 126, is " << last_msg_.certificate_bytes[42]; - EXPECT_EQ(last_msg_.certificate_bytes[43], 129) << "incorrect value for last_msg_.certificate_bytes[43], expected 129, is " << last_msg_.certificate_bytes[43]; - EXPECT_EQ(last_msg_.certificate_bytes[44], 132) << "incorrect value for last_msg_.certificate_bytes[44], expected 132, is " << last_msg_.certificate_bytes[44]; - EXPECT_EQ(last_msg_.certificate_bytes[45], 135) << "incorrect value for last_msg_.certificate_bytes[45], expected 135, is " << last_msg_.certificate_bytes[45]; - EXPECT_EQ(last_msg_.certificate_bytes[46], 138) << "incorrect value for last_msg_.certificate_bytes[46], expected 138, is " << last_msg_.certificate_bytes[46]; - EXPECT_EQ(last_msg_.certificate_bytes[47], 141) << "incorrect value for last_msg_.certificate_bytes[47], expected 141, is " << last_msg_.certificate_bytes[47]; - EXPECT_EQ(last_msg_.certificate_bytes[48], 144) << "incorrect value for last_msg_.certificate_bytes[48], expected 144, is " << last_msg_.certificate_bytes[48]; - EXPECT_EQ(last_msg_.certificate_bytes[49], 147) << "incorrect value for last_msg_.certificate_bytes[49], expected 147, is " << last_msg_.certificate_bytes[49]; - EXPECT_EQ(last_msg_.certificate_bytes[50], 150) << "incorrect value for last_msg_.certificate_bytes[50], expected 150, is " << last_msg_.certificate_bytes[50]; - EXPECT_EQ(last_msg_.certificate_bytes[51], 153) << "incorrect value for last_msg_.certificate_bytes[51], expected 153, is " << last_msg_.certificate_bytes[51]; - EXPECT_EQ(last_msg_.certificate_bytes[52], 156) << "incorrect value for last_msg_.certificate_bytes[52], expected 156, is " << last_msg_.certificate_bytes[52]; - EXPECT_EQ(last_msg_.certificate_bytes[53], 159) << "incorrect value for last_msg_.certificate_bytes[53], expected 159, is " << last_msg_.certificate_bytes[53]; - EXPECT_EQ(last_msg_.certificate_bytes[54], 162) << "incorrect value for last_msg_.certificate_bytes[54], expected 162, is " << last_msg_.certificate_bytes[54]; - EXPECT_EQ(last_msg_.certificate_bytes[55], 165) << "incorrect value for last_msg_.certificate_bytes[55], expected 165, is " << last_msg_.certificate_bytes[55]; - EXPECT_EQ(last_msg_.certificate_bytes[56], 168) << "incorrect value for last_msg_.certificate_bytes[56], expected 168, is " << last_msg_.certificate_bytes[56]; - EXPECT_EQ(last_msg_.certificate_bytes[57], 171) << "incorrect value for last_msg_.certificate_bytes[57], expected 171, is " << last_msg_.certificate_bytes[57]; - EXPECT_EQ(last_msg_.certificate_bytes[58], 174) << "incorrect value for last_msg_.certificate_bytes[58], expected 174, is " << last_msg_.certificate_bytes[58]; - EXPECT_EQ(last_msg_.certificate_bytes[59], 177) << "incorrect value for last_msg_.certificate_bytes[59], expected 177, is " << last_msg_.certificate_bytes[59]; - EXPECT_EQ(last_msg_.certificate_bytes[60], 180) << "incorrect value for last_msg_.certificate_bytes[60], expected 180, is " << last_msg_.certificate_bytes[60]; - EXPECT_EQ(last_msg_.certificate_bytes[61], 183) << "incorrect value for last_msg_.certificate_bytes[61], expected 183, is " << last_msg_.certificate_bytes[61]; - EXPECT_EQ(last_msg_.certificate_bytes[62], 186) << "incorrect value for last_msg_.certificate_bytes[62], expected 186, is " << last_msg_.certificate_bytes[62]; - EXPECT_EQ(last_msg_.certificate_bytes[63], 189) << "incorrect value for last_msg_.certificate_bytes[63], expected 189, is " << last_msg_.certificate_bytes[63]; - EXPECT_EQ(last_msg_.certificate_bytes[64], 192) << "incorrect value for last_msg_.certificate_bytes[64], expected 192, is " << last_msg_.certificate_bytes[64]; - EXPECT_EQ(last_msg_.certificate_bytes[65], 195) << "incorrect value for last_msg_.certificate_bytes[65], expected 195, is " << last_msg_.certificate_bytes[65]; - EXPECT_EQ(last_msg_.certificate_bytes[66], 198) << "incorrect value for last_msg_.certificate_bytes[66], expected 198, is " << last_msg_.certificate_bytes[66]; - EXPECT_EQ(last_msg_.certificate_bytes[67], 201) << "incorrect value for last_msg_.certificate_bytes[67], expected 201, is " << last_msg_.certificate_bytes[67]; - EXPECT_EQ(last_msg_.certificate_bytes[68], 204) << "incorrect value for last_msg_.certificate_bytes[68], expected 204, is " << last_msg_.certificate_bytes[68]; - EXPECT_EQ(last_msg_.certificate_bytes[69], 207) << "incorrect value for last_msg_.certificate_bytes[69], expected 207, is " << last_msg_.certificate_bytes[69]; - EXPECT_EQ(last_msg_.certificate_bytes[70], 210) << "incorrect value for last_msg_.certificate_bytes[70], expected 210, is " << last_msg_.certificate_bytes[70]; - EXPECT_EQ(last_msg_.certificate_bytes[71], 213) << "incorrect value for last_msg_.certificate_bytes[71], expected 213, is " << last_msg_.certificate_bytes[71]; - EXPECT_EQ(last_msg_.certificate_bytes[72], 216) << "incorrect value for last_msg_.certificate_bytes[72], expected 216, is " << last_msg_.certificate_bytes[72]; - EXPECT_EQ(last_msg_.certificate_bytes[73], 219) << "incorrect value for last_msg_.certificate_bytes[73], expected 219, is " << last_msg_.certificate_bytes[73]; - EXPECT_EQ(last_msg_.certificate_bytes[74], 222) << "incorrect value for last_msg_.certificate_bytes[74], expected 222, is " << last_msg_.certificate_bytes[74]; - EXPECT_EQ(last_msg_.certificate_bytes[75], 225) << "incorrect value for last_msg_.certificate_bytes[75], expected 225, is " << last_msg_.certificate_bytes[75]; - EXPECT_EQ(last_msg_.certificate_bytes[76], 228) << "incorrect value for last_msg_.certificate_bytes[76], expected 228, is " << last_msg_.certificate_bytes[76]; - EXPECT_EQ(last_msg_.certificate_bytes[77], 231) << "incorrect value for last_msg_.certificate_bytes[77], expected 231, is " << last_msg_.certificate_bytes[77]; - EXPECT_EQ(last_msg_.certificate_bytes[78], 234) << "incorrect value for last_msg_.certificate_bytes[78], expected 234, is " << last_msg_.certificate_bytes[78]; - EXPECT_EQ(last_msg_.certificate_bytes[79], 237) << "incorrect value for last_msg_.certificate_bytes[79], expected 237, is " << last_msg_.certificate_bytes[79]; - EXPECT_EQ(last_msg_.certificate_bytes[80], 240) << "incorrect value for last_msg_.certificate_bytes[80], expected 240, is " << last_msg_.certificate_bytes[80]; - EXPECT_EQ(last_msg_.certificate_bytes[81], 243) << "incorrect value for last_msg_.certificate_bytes[81], expected 243, is " << last_msg_.certificate_bytes[81]; - EXPECT_EQ(last_msg_.certificate_bytes[82], 246) << "incorrect value for last_msg_.certificate_bytes[82], expected 246, is " << last_msg_.certificate_bytes[82]; - EXPECT_EQ(last_msg_.certificate_bytes[83], 249) << "incorrect value for last_msg_.certificate_bytes[83], expected 249, is " << last_msg_.certificate_bytes[83]; - EXPECT_EQ(last_msg_.certificate_bytes[84], 252) << "incorrect value for last_msg_.certificate_bytes[84], expected 252, is " << last_msg_.certificate_bytes[84]; - EXPECT_EQ(last_msg_.fingerprint[0], 100) << "incorrect value for last_msg_.fingerprint[0], expected 100, is " << last_msg_.fingerprint[0]; - EXPECT_EQ(last_msg_.fingerprint[1], 101) << "incorrect value for last_msg_.fingerprint[1], expected 101, is " << last_msg_.fingerprint[1]; - EXPECT_EQ(last_msg_.fingerprint[2], 102) << "incorrect value for last_msg_.fingerprint[2], expected 102, is " << last_msg_.fingerprint[2]; - EXPECT_EQ(last_msg_.fingerprint[3], 103) << "incorrect value for last_msg_.fingerprint[3], expected 103, is " << last_msg_.fingerprint[3]; - EXPECT_EQ(last_msg_.fingerprint[4], 104) << "incorrect value for last_msg_.fingerprint[4], expected 104, is " << last_msg_.fingerprint[4]; - EXPECT_EQ(last_msg_.fingerprint[5], 105) << "incorrect value for last_msg_.fingerprint[5], expected 105, is " << last_msg_.fingerprint[5]; - EXPECT_EQ(last_msg_.fingerprint[6], 106) << "incorrect value for last_msg_.fingerprint[6], expected 106, is " << last_msg_.fingerprint[6]; - EXPECT_EQ(last_msg_.fingerprint[7], 107) << "incorrect value for last_msg_.fingerprint[7], expected 107, is " << last_msg_.fingerprint[7]; - EXPECT_EQ(last_msg_.fingerprint[8], 108) << "incorrect value for last_msg_.fingerprint[8], expected 108, is " << last_msg_.fingerprint[8]; - EXPECT_EQ(last_msg_.fingerprint[9], 109) << "incorrect value for last_msg_.fingerprint[9], expected 109, is " << last_msg_.fingerprint[9]; - EXPECT_EQ(last_msg_.fingerprint[10], 110) << "incorrect value for last_msg_.fingerprint[10], expected 110, is " << last_msg_.fingerprint[10]; - EXPECT_EQ(last_msg_.fingerprint[11], 111) << "incorrect value for last_msg_.fingerprint[11], expected 111, is " << last_msg_.fingerprint[11]; - EXPECT_EQ(last_msg_.fingerprint[12], 112) << "incorrect value for last_msg_.fingerprint[12], expected 112, is " << last_msg_.fingerprint[12]; - EXPECT_EQ(last_msg_.fingerprint[13], 113) << "incorrect value for last_msg_.fingerprint[13], expected 113, is " << last_msg_.fingerprint[13]; - EXPECT_EQ(last_msg_.fingerprint[14], 114) << "incorrect value for last_msg_.fingerprint[14], expected 114, is " << last_msg_.fingerprint[14]; - EXPECT_EQ(last_msg_.fingerprint[15], 115) << "incorrect value for last_msg_.fingerprint[15], expected 115, is " << last_msg_.fingerprint[15]; - EXPECT_EQ(last_msg_.fingerprint[16], 116) << "incorrect value for last_msg_.fingerprint[16], expected 116, is " << last_msg_.fingerprint[16]; - EXPECT_EQ(last_msg_.fingerprint[17], 117) << "incorrect value for last_msg_.fingerprint[17], expected 117, is " << last_msg_.fingerprint[17]; - EXPECT_EQ(last_msg_.fingerprint[18], 118) << "incorrect value for last_msg_.fingerprint[18], expected 118, is " << last_msg_.fingerprint[18]; - EXPECT_EQ(last_msg_.fingerprint[19], 119) << "incorrect value for last_msg_.fingerprint[19], expected 119, is " << last_msg_.fingerprint[19]; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_certificate_bytes.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_certificate_bytes.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_certificate_bytes.handle_as << "'"; - } - { - const char check_string[] = { (char)99,(char)101,(char)114,(char)116,(char)105,(char)102,(char)105,(char)99,(char)97,(char)116,(char)101,(char)95,(char)98,(char)121,(char)116,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_certificate_bytes.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_certificate_bytes.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_certificate_bytes.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_certificate_bytes.value, 85) << "incorrect value for last_msg_.n_certificate_bytes.value, expected 85, is " << last_msg_.n_certificate_bytes.value; - EXPECT_EQ(last_msg_.n_msg, 16) << "incorrect value for last_msg_.n_msg, expected 16, is " << last_msg_.n_msg; +}; + +TEST_F(Test_auto_check_sbp_signing_MsgEd25519CertificateDep0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 12, 66, 0, 106, 16, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 0, 3, 6, + 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, + 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, + 99, 102, 105, 108, 111, 114, 117, 120, 123, 126, 129, 132, 135, 138, 141, + 144, 147, 150, 153, 156, 159, 162, 165, 168, 171, 174, 177, 180, 183, 186, + 189, 192, 195, 198, 201, 204, 207, 210, 213, 216, 219, 222, 225, 228, 231, + 234, 237, 240, 243, 246, 249, 252, 218, 148, + }; + + sbp_msg_ed25519_certificate_dep_t test_msg{}; + + test_msg.certificate_bytes[0] = 0; + + test_msg.certificate_bytes[1] = 3; + + test_msg.certificate_bytes[2] = 6; + + test_msg.certificate_bytes[3] = 9; + + test_msg.certificate_bytes[4] = 12; + + test_msg.certificate_bytes[5] = 15; + + test_msg.certificate_bytes[6] = 18; + + test_msg.certificate_bytes[7] = 21; + + test_msg.certificate_bytes[8] = 24; + + test_msg.certificate_bytes[9] = 27; + + test_msg.certificate_bytes[10] = 30; + + test_msg.certificate_bytes[11] = 33; + + test_msg.certificate_bytes[12] = 36; + + test_msg.certificate_bytes[13] = 39; + + test_msg.certificate_bytes[14] = 42; + + test_msg.certificate_bytes[15] = 45; + + test_msg.certificate_bytes[16] = 48; + + test_msg.certificate_bytes[17] = 51; + + test_msg.certificate_bytes[18] = 54; + + test_msg.certificate_bytes[19] = 57; + + test_msg.certificate_bytes[20] = 60; + + test_msg.certificate_bytes[21] = 63; + + test_msg.certificate_bytes[22] = 66; + + test_msg.certificate_bytes[23] = 69; + + test_msg.certificate_bytes[24] = 72; + + test_msg.certificate_bytes[25] = 75; + + test_msg.certificate_bytes[26] = 78; + + test_msg.certificate_bytes[27] = 81; + + test_msg.certificate_bytes[28] = 84; + + test_msg.certificate_bytes[29] = 87; + + test_msg.certificate_bytes[30] = 90; + + test_msg.certificate_bytes[31] = 93; + + test_msg.certificate_bytes[32] = 96; + + test_msg.certificate_bytes[33] = 99; + + test_msg.certificate_bytes[34] = 102; + + test_msg.certificate_bytes[35] = 105; + + test_msg.certificate_bytes[36] = 108; + + test_msg.certificate_bytes[37] = 111; + + test_msg.certificate_bytes[38] = 114; + + test_msg.certificate_bytes[39] = 117; + + test_msg.certificate_bytes[40] = 120; + + test_msg.certificate_bytes[41] = 123; + + test_msg.certificate_bytes[42] = 126; + + test_msg.certificate_bytes[43] = 129; + + test_msg.certificate_bytes[44] = 132; + + test_msg.certificate_bytes[45] = 135; + + test_msg.certificate_bytes[46] = 138; + + test_msg.certificate_bytes[47] = 141; + + test_msg.certificate_bytes[48] = 144; + + test_msg.certificate_bytes[49] = 147; + + test_msg.certificate_bytes[50] = 150; + + test_msg.certificate_bytes[51] = 153; + + test_msg.certificate_bytes[52] = 156; + + test_msg.certificate_bytes[53] = 159; + + test_msg.certificate_bytes[54] = 162; + + test_msg.certificate_bytes[55] = 165; + + test_msg.certificate_bytes[56] = 168; + + test_msg.certificate_bytes[57] = 171; + + test_msg.certificate_bytes[58] = 174; + + test_msg.certificate_bytes[59] = 177; + + test_msg.certificate_bytes[60] = 180; + + test_msg.certificate_bytes[61] = 183; + + test_msg.certificate_bytes[62] = 186; + + test_msg.certificate_bytes[63] = 189; + + test_msg.certificate_bytes[64] = 192; + + test_msg.certificate_bytes[65] = 195; + + test_msg.certificate_bytes[66] = 198; + + test_msg.certificate_bytes[67] = 201; + + test_msg.certificate_bytes[68] = 204; + + test_msg.certificate_bytes[69] = 207; + + test_msg.certificate_bytes[70] = 210; + + test_msg.certificate_bytes[71] = 213; + + test_msg.certificate_bytes[72] = 216; + + test_msg.certificate_bytes[73] = 219; + + test_msg.certificate_bytes[74] = 222; + + test_msg.certificate_bytes[75] = 225; + + test_msg.certificate_bytes[76] = 228; + + test_msg.certificate_bytes[77] = 231; + + test_msg.certificate_bytes[78] = 234; + + test_msg.certificate_bytes[79] = 237; + + test_msg.certificate_bytes[80] = 240; + + test_msg.certificate_bytes[81] = 243; + + test_msg.certificate_bytes[82] = 246; + + test_msg.certificate_bytes[83] = 249; + + test_msg.certificate_bytes[84] = 252; + + test_msg.fingerprint[0] = 100; + + test_msg.fingerprint[1] = 101; + + test_msg.fingerprint[2] = 102; + + test_msg.fingerprint[3] = 103; + + test_msg.fingerprint[4] = 104; + + test_msg.fingerprint[5] = 105; + + test_msg.fingerprint[6] = 106; + + test_msg.fingerprint[7] = 107; + + test_msg.fingerprint[8] = 108; + + test_msg.fingerprint[9] = 109; + + test_msg.fingerprint[10] = 110; + + test_msg.fingerprint[11] = 111; + + test_msg.fingerprint[12] = 112; + + test_msg.fingerprint[13] = 113; + + test_msg.fingerprint[14] = 114; + + test_msg.fingerprint[15] = 115; + + test_msg.fingerprint[16] = 116; + + test_msg.fingerprint[17] = 117; + + test_msg.fingerprint[18] = 118; + + test_msg.fingerprint[19] = 119; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_certificate_bytes.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = { + (char)99, (char)101, (char)114, (char)116, (char)105, (char)102, + (char)105, (char)99, (char)97, (char)116, (char)101, (char)95, + (char)98, (char)121, (char)116, (char)101, (char)115}; + memcpy(test_msg.n_certificate_bytes.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_certificate_bytes.value = 85; + test_msg.n_msg = 16; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.certificate_bytes[0], 0) + << "incorrect value for last_msg_.certificate_bytes[0], expected 0, is " + << last_msg_.certificate_bytes[0]; + EXPECT_EQ(last_msg_.certificate_bytes[1], 3) + << "incorrect value for last_msg_.certificate_bytes[1], expected 3, is " + << last_msg_.certificate_bytes[1]; + EXPECT_EQ(last_msg_.certificate_bytes[2], 6) + << "incorrect value for last_msg_.certificate_bytes[2], expected 6, is " + << last_msg_.certificate_bytes[2]; + EXPECT_EQ(last_msg_.certificate_bytes[3], 9) + << "incorrect value for last_msg_.certificate_bytes[3], expected 9, is " + << last_msg_.certificate_bytes[3]; + EXPECT_EQ(last_msg_.certificate_bytes[4], 12) + << "incorrect value for last_msg_.certificate_bytes[4], expected 12, is " + << last_msg_.certificate_bytes[4]; + EXPECT_EQ(last_msg_.certificate_bytes[5], 15) + << "incorrect value for last_msg_.certificate_bytes[5], expected 15, is " + << last_msg_.certificate_bytes[5]; + EXPECT_EQ(last_msg_.certificate_bytes[6], 18) + << "incorrect value for last_msg_.certificate_bytes[6], expected 18, is " + << last_msg_.certificate_bytes[6]; + EXPECT_EQ(last_msg_.certificate_bytes[7], 21) + << "incorrect value for last_msg_.certificate_bytes[7], expected 21, is " + << last_msg_.certificate_bytes[7]; + EXPECT_EQ(last_msg_.certificate_bytes[8], 24) + << "incorrect value for last_msg_.certificate_bytes[8], expected 24, is " + << last_msg_.certificate_bytes[8]; + EXPECT_EQ(last_msg_.certificate_bytes[9], 27) + << "incorrect value for last_msg_.certificate_bytes[9], expected 27, is " + << last_msg_.certificate_bytes[9]; + EXPECT_EQ(last_msg_.certificate_bytes[10], 30) + << "incorrect value for last_msg_.certificate_bytes[10], expected 30, is " + << last_msg_.certificate_bytes[10]; + EXPECT_EQ(last_msg_.certificate_bytes[11], 33) + << "incorrect value for last_msg_.certificate_bytes[11], expected 33, is " + << last_msg_.certificate_bytes[11]; + EXPECT_EQ(last_msg_.certificate_bytes[12], 36) + << "incorrect value for last_msg_.certificate_bytes[12], expected 36, is " + << last_msg_.certificate_bytes[12]; + EXPECT_EQ(last_msg_.certificate_bytes[13], 39) + << "incorrect value for last_msg_.certificate_bytes[13], expected 39, is " + << last_msg_.certificate_bytes[13]; + EXPECT_EQ(last_msg_.certificate_bytes[14], 42) + << "incorrect value for last_msg_.certificate_bytes[14], expected 42, is " + << last_msg_.certificate_bytes[14]; + EXPECT_EQ(last_msg_.certificate_bytes[15], 45) + << "incorrect value for last_msg_.certificate_bytes[15], expected 45, is " + << last_msg_.certificate_bytes[15]; + EXPECT_EQ(last_msg_.certificate_bytes[16], 48) + << "incorrect value for last_msg_.certificate_bytes[16], expected 48, is " + << last_msg_.certificate_bytes[16]; + EXPECT_EQ(last_msg_.certificate_bytes[17], 51) + << "incorrect value for last_msg_.certificate_bytes[17], expected 51, is " + << last_msg_.certificate_bytes[17]; + EXPECT_EQ(last_msg_.certificate_bytes[18], 54) + << "incorrect value for last_msg_.certificate_bytes[18], expected 54, is " + << last_msg_.certificate_bytes[18]; + EXPECT_EQ(last_msg_.certificate_bytes[19], 57) + << "incorrect value for last_msg_.certificate_bytes[19], expected 57, is " + << last_msg_.certificate_bytes[19]; + EXPECT_EQ(last_msg_.certificate_bytes[20], 60) + << "incorrect value for last_msg_.certificate_bytes[20], expected 60, is " + << last_msg_.certificate_bytes[20]; + EXPECT_EQ(last_msg_.certificate_bytes[21], 63) + << "incorrect value for last_msg_.certificate_bytes[21], expected 63, is " + << last_msg_.certificate_bytes[21]; + EXPECT_EQ(last_msg_.certificate_bytes[22], 66) + << "incorrect value for last_msg_.certificate_bytes[22], expected 66, is " + << last_msg_.certificate_bytes[22]; + EXPECT_EQ(last_msg_.certificate_bytes[23], 69) + << "incorrect value for last_msg_.certificate_bytes[23], expected 69, is " + << last_msg_.certificate_bytes[23]; + EXPECT_EQ(last_msg_.certificate_bytes[24], 72) + << "incorrect value for last_msg_.certificate_bytes[24], expected 72, is " + << last_msg_.certificate_bytes[24]; + EXPECT_EQ(last_msg_.certificate_bytes[25], 75) + << "incorrect value for last_msg_.certificate_bytes[25], expected 75, is " + << last_msg_.certificate_bytes[25]; + EXPECT_EQ(last_msg_.certificate_bytes[26], 78) + << "incorrect value for last_msg_.certificate_bytes[26], expected 78, is " + << last_msg_.certificate_bytes[26]; + EXPECT_EQ(last_msg_.certificate_bytes[27], 81) + << "incorrect value for last_msg_.certificate_bytes[27], expected 81, is " + << last_msg_.certificate_bytes[27]; + EXPECT_EQ(last_msg_.certificate_bytes[28], 84) + << "incorrect value for last_msg_.certificate_bytes[28], expected 84, is " + << last_msg_.certificate_bytes[28]; + EXPECT_EQ(last_msg_.certificate_bytes[29], 87) + << "incorrect value for last_msg_.certificate_bytes[29], expected 87, is " + << last_msg_.certificate_bytes[29]; + EXPECT_EQ(last_msg_.certificate_bytes[30], 90) + << "incorrect value for last_msg_.certificate_bytes[30], expected 90, is " + << last_msg_.certificate_bytes[30]; + EXPECT_EQ(last_msg_.certificate_bytes[31], 93) + << "incorrect value for last_msg_.certificate_bytes[31], expected 93, is " + << last_msg_.certificate_bytes[31]; + EXPECT_EQ(last_msg_.certificate_bytes[32], 96) + << "incorrect value for last_msg_.certificate_bytes[32], expected 96, is " + << last_msg_.certificate_bytes[32]; + EXPECT_EQ(last_msg_.certificate_bytes[33], 99) + << "incorrect value for last_msg_.certificate_bytes[33], expected 99, is " + << last_msg_.certificate_bytes[33]; + EXPECT_EQ(last_msg_.certificate_bytes[34], 102) + << "incorrect value for last_msg_.certificate_bytes[34], expected 102, " + "is " + << last_msg_.certificate_bytes[34]; + EXPECT_EQ(last_msg_.certificate_bytes[35], 105) + << "incorrect value for last_msg_.certificate_bytes[35], expected 105, " + "is " + << last_msg_.certificate_bytes[35]; + EXPECT_EQ(last_msg_.certificate_bytes[36], 108) + << "incorrect value for last_msg_.certificate_bytes[36], expected 108, " + "is " + << last_msg_.certificate_bytes[36]; + EXPECT_EQ(last_msg_.certificate_bytes[37], 111) + << "incorrect value for last_msg_.certificate_bytes[37], expected 111, " + "is " + << last_msg_.certificate_bytes[37]; + EXPECT_EQ(last_msg_.certificate_bytes[38], 114) + << "incorrect value for last_msg_.certificate_bytes[38], expected 114, " + "is " + << last_msg_.certificate_bytes[38]; + EXPECT_EQ(last_msg_.certificate_bytes[39], 117) + << "incorrect value for last_msg_.certificate_bytes[39], expected 117, " + "is " + << last_msg_.certificate_bytes[39]; + EXPECT_EQ(last_msg_.certificate_bytes[40], 120) + << "incorrect value for last_msg_.certificate_bytes[40], expected 120, " + "is " + << last_msg_.certificate_bytes[40]; + EXPECT_EQ(last_msg_.certificate_bytes[41], 123) + << "incorrect value for last_msg_.certificate_bytes[41], expected 123, " + "is " + << last_msg_.certificate_bytes[41]; + EXPECT_EQ(last_msg_.certificate_bytes[42], 126) + << "incorrect value for last_msg_.certificate_bytes[42], expected 126, " + "is " + << last_msg_.certificate_bytes[42]; + EXPECT_EQ(last_msg_.certificate_bytes[43], 129) + << "incorrect value for last_msg_.certificate_bytes[43], expected 129, " + "is " + << last_msg_.certificate_bytes[43]; + EXPECT_EQ(last_msg_.certificate_bytes[44], 132) + << "incorrect value for last_msg_.certificate_bytes[44], expected 132, " + "is " + << last_msg_.certificate_bytes[44]; + EXPECT_EQ(last_msg_.certificate_bytes[45], 135) + << "incorrect value for last_msg_.certificate_bytes[45], expected 135, " + "is " + << last_msg_.certificate_bytes[45]; + EXPECT_EQ(last_msg_.certificate_bytes[46], 138) + << "incorrect value for last_msg_.certificate_bytes[46], expected 138, " + "is " + << last_msg_.certificate_bytes[46]; + EXPECT_EQ(last_msg_.certificate_bytes[47], 141) + << "incorrect value for last_msg_.certificate_bytes[47], expected 141, " + "is " + << last_msg_.certificate_bytes[47]; + EXPECT_EQ(last_msg_.certificate_bytes[48], 144) + << "incorrect value for last_msg_.certificate_bytes[48], expected 144, " + "is " + << last_msg_.certificate_bytes[48]; + EXPECT_EQ(last_msg_.certificate_bytes[49], 147) + << "incorrect value for last_msg_.certificate_bytes[49], expected 147, " + "is " + << last_msg_.certificate_bytes[49]; + EXPECT_EQ(last_msg_.certificate_bytes[50], 150) + << "incorrect value for last_msg_.certificate_bytes[50], expected 150, " + "is " + << last_msg_.certificate_bytes[50]; + EXPECT_EQ(last_msg_.certificate_bytes[51], 153) + << "incorrect value for last_msg_.certificate_bytes[51], expected 153, " + "is " + << last_msg_.certificate_bytes[51]; + EXPECT_EQ(last_msg_.certificate_bytes[52], 156) + << "incorrect value for last_msg_.certificate_bytes[52], expected 156, " + "is " + << last_msg_.certificate_bytes[52]; + EXPECT_EQ(last_msg_.certificate_bytes[53], 159) + << "incorrect value for last_msg_.certificate_bytes[53], expected 159, " + "is " + << last_msg_.certificate_bytes[53]; + EXPECT_EQ(last_msg_.certificate_bytes[54], 162) + << "incorrect value for last_msg_.certificate_bytes[54], expected 162, " + "is " + << last_msg_.certificate_bytes[54]; + EXPECT_EQ(last_msg_.certificate_bytes[55], 165) + << "incorrect value for last_msg_.certificate_bytes[55], expected 165, " + "is " + << last_msg_.certificate_bytes[55]; + EXPECT_EQ(last_msg_.certificate_bytes[56], 168) + << "incorrect value for last_msg_.certificate_bytes[56], expected 168, " + "is " + << last_msg_.certificate_bytes[56]; + EXPECT_EQ(last_msg_.certificate_bytes[57], 171) + << "incorrect value for last_msg_.certificate_bytes[57], expected 171, " + "is " + << last_msg_.certificate_bytes[57]; + EXPECT_EQ(last_msg_.certificate_bytes[58], 174) + << "incorrect value for last_msg_.certificate_bytes[58], expected 174, " + "is " + << last_msg_.certificate_bytes[58]; + EXPECT_EQ(last_msg_.certificate_bytes[59], 177) + << "incorrect value for last_msg_.certificate_bytes[59], expected 177, " + "is " + << last_msg_.certificate_bytes[59]; + EXPECT_EQ(last_msg_.certificate_bytes[60], 180) + << "incorrect value for last_msg_.certificate_bytes[60], expected 180, " + "is " + << last_msg_.certificate_bytes[60]; + EXPECT_EQ(last_msg_.certificate_bytes[61], 183) + << "incorrect value for last_msg_.certificate_bytes[61], expected 183, " + "is " + << last_msg_.certificate_bytes[61]; + EXPECT_EQ(last_msg_.certificate_bytes[62], 186) + << "incorrect value for last_msg_.certificate_bytes[62], expected 186, " + "is " + << last_msg_.certificate_bytes[62]; + EXPECT_EQ(last_msg_.certificate_bytes[63], 189) + << "incorrect value for last_msg_.certificate_bytes[63], expected 189, " + "is " + << last_msg_.certificate_bytes[63]; + EXPECT_EQ(last_msg_.certificate_bytes[64], 192) + << "incorrect value for last_msg_.certificate_bytes[64], expected 192, " + "is " + << last_msg_.certificate_bytes[64]; + EXPECT_EQ(last_msg_.certificate_bytes[65], 195) + << "incorrect value for last_msg_.certificate_bytes[65], expected 195, " + "is " + << last_msg_.certificate_bytes[65]; + EXPECT_EQ(last_msg_.certificate_bytes[66], 198) + << "incorrect value for last_msg_.certificate_bytes[66], expected 198, " + "is " + << last_msg_.certificate_bytes[66]; + EXPECT_EQ(last_msg_.certificate_bytes[67], 201) + << "incorrect value for last_msg_.certificate_bytes[67], expected 201, " + "is " + << last_msg_.certificate_bytes[67]; + EXPECT_EQ(last_msg_.certificate_bytes[68], 204) + << "incorrect value for last_msg_.certificate_bytes[68], expected 204, " + "is " + << last_msg_.certificate_bytes[68]; + EXPECT_EQ(last_msg_.certificate_bytes[69], 207) + << "incorrect value for last_msg_.certificate_bytes[69], expected 207, " + "is " + << last_msg_.certificate_bytes[69]; + EXPECT_EQ(last_msg_.certificate_bytes[70], 210) + << "incorrect value for last_msg_.certificate_bytes[70], expected 210, " + "is " + << last_msg_.certificate_bytes[70]; + EXPECT_EQ(last_msg_.certificate_bytes[71], 213) + << "incorrect value for last_msg_.certificate_bytes[71], expected 213, " + "is " + << last_msg_.certificate_bytes[71]; + EXPECT_EQ(last_msg_.certificate_bytes[72], 216) + << "incorrect value for last_msg_.certificate_bytes[72], expected 216, " + "is " + << last_msg_.certificate_bytes[72]; + EXPECT_EQ(last_msg_.certificate_bytes[73], 219) + << "incorrect value for last_msg_.certificate_bytes[73], expected 219, " + "is " + << last_msg_.certificate_bytes[73]; + EXPECT_EQ(last_msg_.certificate_bytes[74], 222) + << "incorrect value for last_msg_.certificate_bytes[74], expected 222, " + "is " + << last_msg_.certificate_bytes[74]; + EXPECT_EQ(last_msg_.certificate_bytes[75], 225) + << "incorrect value for last_msg_.certificate_bytes[75], expected 225, " + "is " + << last_msg_.certificate_bytes[75]; + EXPECT_EQ(last_msg_.certificate_bytes[76], 228) + << "incorrect value for last_msg_.certificate_bytes[76], expected 228, " + "is " + << last_msg_.certificate_bytes[76]; + EXPECT_EQ(last_msg_.certificate_bytes[77], 231) + << "incorrect value for last_msg_.certificate_bytes[77], expected 231, " + "is " + << last_msg_.certificate_bytes[77]; + EXPECT_EQ(last_msg_.certificate_bytes[78], 234) + << "incorrect value for last_msg_.certificate_bytes[78], expected 234, " + "is " + << last_msg_.certificate_bytes[78]; + EXPECT_EQ(last_msg_.certificate_bytes[79], 237) + << "incorrect value for last_msg_.certificate_bytes[79], expected 237, " + "is " + << last_msg_.certificate_bytes[79]; + EXPECT_EQ(last_msg_.certificate_bytes[80], 240) + << "incorrect value for last_msg_.certificate_bytes[80], expected 240, " + "is " + << last_msg_.certificate_bytes[80]; + EXPECT_EQ(last_msg_.certificate_bytes[81], 243) + << "incorrect value for last_msg_.certificate_bytes[81], expected 243, " + "is " + << last_msg_.certificate_bytes[81]; + EXPECT_EQ(last_msg_.certificate_bytes[82], 246) + << "incorrect value for last_msg_.certificate_bytes[82], expected 246, " + "is " + << last_msg_.certificate_bytes[82]; + EXPECT_EQ(last_msg_.certificate_bytes[83], 249) + << "incorrect value for last_msg_.certificate_bytes[83], expected 249, " + "is " + << last_msg_.certificate_bytes[83]; + EXPECT_EQ(last_msg_.certificate_bytes[84], 252) + << "incorrect value for last_msg_.certificate_bytes[84], expected 252, " + "is " + << last_msg_.certificate_bytes[84]; + EXPECT_EQ(last_msg_.fingerprint[0], 100) + << "incorrect value for last_msg_.fingerprint[0], expected 100, is " + << last_msg_.fingerprint[0]; + EXPECT_EQ(last_msg_.fingerprint[1], 101) + << "incorrect value for last_msg_.fingerprint[1], expected 101, is " + << last_msg_.fingerprint[1]; + EXPECT_EQ(last_msg_.fingerprint[2], 102) + << "incorrect value for last_msg_.fingerprint[2], expected 102, is " + << last_msg_.fingerprint[2]; + EXPECT_EQ(last_msg_.fingerprint[3], 103) + << "incorrect value for last_msg_.fingerprint[3], expected 103, is " + << last_msg_.fingerprint[3]; + EXPECT_EQ(last_msg_.fingerprint[4], 104) + << "incorrect value for last_msg_.fingerprint[4], expected 104, is " + << last_msg_.fingerprint[4]; + EXPECT_EQ(last_msg_.fingerprint[5], 105) + << "incorrect value for last_msg_.fingerprint[5], expected 105, is " + << last_msg_.fingerprint[5]; + EXPECT_EQ(last_msg_.fingerprint[6], 106) + << "incorrect value for last_msg_.fingerprint[6], expected 106, is " + << last_msg_.fingerprint[6]; + EXPECT_EQ(last_msg_.fingerprint[7], 107) + << "incorrect value for last_msg_.fingerprint[7], expected 107, is " + << last_msg_.fingerprint[7]; + EXPECT_EQ(last_msg_.fingerprint[8], 108) + << "incorrect value for last_msg_.fingerprint[8], expected 108, is " + << last_msg_.fingerprint[8]; + EXPECT_EQ(last_msg_.fingerprint[9], 109) + << "incorrect value for last_msg_.fingerprint[9], expected 109, is " + << last_msg_.fingerprint[9]; + EXPECT_EQ(last_msg_.fingerprint[10], 110) + << "incorrect value for last_msg_.fingerprint[10], expected 110, is " + << last_msg_.fingerprint[10]; + EXPECT_EQ(last_msg_.fingerprint[11], 111) + << "incorrect value for last_msg_.fingerprint[11], expected 111, is " + << last_msg_.fingerprint[11]; + EXPECT_EQ(last_msg_.fingerprint[12], 112) + << "incorrect value for last_msg_.fingerprint[12], expected 112, is " + << last_msg_.fingerprint[12]; + EXPECT_EQ(last_msg_.fingerprint[13], 113) + << "incorrect value for last_msg_.fingerprint[13], expected 113, is " + << last_msg_.fingerprint[13]; + EXPECT_EQ(last_msg_.fingerprint[14], 114) + << "incorrect value for last_msg_.fingerprint[14], expected 114, is " + << last_msg_.fingerprint[14]; + EXPECT_EQ(last_msg_.fingerprint[15], 115) + << "incorrect value for last_msg_.fingerprint[15], expected 115, is " + << last_msg_.fingerprint[15]; + EXPECT_EQ(last_msg_.fingerprint[16], 116) + << "incorrect value for last_msg_.fingerprint[16], expected 116, is " + << last_msg_.fingerprint[16]; + EXPECT_EQ(last_msg_.fingerprint[17], 117) + << "incorrect value for last_msg_.fingerprint[17], expected 117, is " + << last_msg_.fingerprint[17]; + EXPECT_EQ(last_msg_.fingerprint[18], 118) + << "incorrect value for last_msg_.fingerprint[18], expected 118, is " + << last_msg_.fingerprint[18]; + EXPECT_EQ(last_msg_.fingerprint[19], 119) + << "incorrect value for last_msg_.fingerprint[19], expected 119, is " + << last_msg_.fingerprint[19]; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_certificate_bytes.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_certificate_bytes.handle_as, " + "expected string '" + << check_string << "', is '" << last_msg_.n_certificate_bytes.handle_as + << "'"; + } + { + const char check_string[] = { + (char)99, (char)101, (char)114, (char)116, (char)105, (char)102, + (char)105, (char)99, (char)97, (char)116, (char)101, (char)95, + (char)98, (char)121, (char)116, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_certificate_bytes.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_certificate_bytes.relates_to, " + "expected string '" + << check_string << "', is '" << last_msg_.n_certificate_bytes.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_certificate_bytes.value, 85) + << "incorrect value for last_msg_.n_certificate_bytes.value, expected " + "85, is " + << last_msg_.n_certificate_bytes.value; + EXPECT_EQ(last_msg_.n_msg, 16) + << "incorrect value for last_msg_.n_msg, expected 16, is " + << last_msg_.n_msg; } diff --git a/c/test/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepA.cc b/c/test/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepA.cc index bc2328a4e..0bc388059 100644 --- a/c/test/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepA.cc +++ b/c/test/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_signing_MsgEd25519SignatureDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_signing_MsgEd25519SignatureDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_signing_MsgEd25519SignatureDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_signing_MsgEd25519SignatureDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ed25519_signature_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ed25519_signature_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,375 +67,635 @@ class Test_auto_check_sbp_signing_MsgEd25519SignatureDepA0 : sbp_msg_ed25519_signature_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_signing_MsgEd25519SignatureDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,1,12,66,0,184,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,136,19,0,0,114,20,0,0,92,21,0,0,70,22,0,0,48,23,0,0,26,24,0,0,4,25,0,0,238,25,0,0,216,26,0,0,194,27,0,0,172,28,0,0,150,29,0,0,128,30,0,0,106,31,0,0,84,32,0,0,62,33,0,0,40,34,0,0,18,35,0,0,252,35,0,0,230,36,0,0,208,37,0,0,186,38,0,0,164,39,0,0,142,40,0,0,120,41,0,0,169,111, }; - - sbp_msg_ed25519_signature_dep_a_t test_msg{}; - - test_msg.fingerprint[0] = 100; - - test_msg.fingerprint[1] = 101; - - test_msg.fingerprint[2] = 102; - - test_msg.fingerprint[3] = 103; - - test_msg.fingerprint[4] = 104; - - test_msg.fingerprint[5] = 105; - - test_msg.fingerprint[6] = 106; - - test_msg.fingerprint[7] = 107; - - test_msg.fingerprint[8] = 108; - - test_msg.fingerprint[9] = 109; - - test_msg.fingerprint[10] = 110; - - test_msg.fingerprint[11] = 111; - - test_msg.fingerprint[12] = 112; - - test_msg.fingerprint[13] = 113; - - test_msg.fingerprint[14] = 114; - - test_msg.fingerprint[15] = 115; - - test_msg.fingerprint[16] = 116; - - test_msg.fingerprint[17] = 117; - - test_msg.fingerprint[18] = 118; - - test_msg.fingerprint[19] = 119; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_signed_messages.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)105,(char)103,(char)110,(char)101,(char)100,(char)95,(char)109,(char)101,(char)115,(char)115,(char)97,(char)103,(char)101,(char)115 }; - memcpy(test_msg.n_signed_messages.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_signed_messages.value = 25; - - test_msg.signature[0] = 0; - - test_msg.signature[1] = 1; - - test_msg.signature[2] = 2; - - test_msg.signature[3] = 3; - - test_msg.signature[4] = 4; - - test_msg.signature[5] = 5; - - test_msg.signature[6] = 6; - - test_msg.signature[7] = 7; - - test_msg.signature[8] = 8; - - test_msg.signature[9] = 9; - - test_msg.signature[10] = 10; - - test_msg.signature[11] = 11; - - test_msg.signature[12] = 12; - - test_msg.signature[13] = 13; - - test_msg.signature[14] = 14; - - test_msg.signature[15] = 15; - - test_msg.signature[16] = 16; - - test_msg.signature[17] = 17; - - test_msg.signature[18] = 18; - - test_msg.signature[19] = 19; - - test_msg.signature[20] = 20; - - test_msg.signature[21] = 21; - - test_msg.signature[22] = 22; - - test_msg.signature[23] = 23; - - test_msg.signature[24] = 24; - - test_msg.signature[25] = 25; - - test_msg.signature[26] = 26; - - test_msg.signature[27] = 27; - - test_msg.signature[28] = 28; - - test_msg.signature[29] = 29; - - test_msg.signature[30] = 30; - - test_msg.signature[31] = 31; - - test_msg.signature[32] = 32; - - test_msg.signature[33] = 33; - - test_msg.signature[34] = 34; - - test_msg.signature[35] = 35; - - test_msg.signature[36] = 36; - - test_msg.signature[37] = 37; - - test_msg.signature[38] = 38; - - test_msg.signature[39] = 39; - - test_msg.signature[40] = 40; - - test_msg.signature[41] = 41; - - test_msg.signature[42] = 42; - - test_msg.signature[43] = 43; - - test_msg.signature[44] = 44; - - test_msg.signature[45] = 45; - - test_msg.signature[46] = 46; - - test_msg.signature[47] = 47; - - test_msg.signature[48] = 48; - - test_msg.signature[49] = 49; - - test_msg.signature[50] = 50; - - test_msg.signature[51] = 51; - - test_msg.signature[52] = 52; - - test_msg.signature[53] = 53; - - test_msg.signature[54] = 54; - - test_msg.signature[55] = 55; - - test_msg.signature[56] = 56; - - test_msg.signature[57] = 57; - - test_msg.signature[58] = 58; - - test_msg.signature[59] = 59; - - test_msg.signature[60] = 60; - - test_msg.signature[61] = 61; - - test_msg.signature[62] = 62; - - test_msg.signature[63] = 63; - - test_msg.signed_messages[0] = 5000; - - test_msg.signed_messages[1] = 5234; - - test_msg.signed_messages[2] = 5468; - - test_msg.signed_messages[3] = 5702; - - test_msg.signed_messages[4] = 5936; - - test_msg.signed_messages[5] = 6170; - - test_msg.signed_messages[6] = 6404; - - test_msg.signed_messages[7] = 6638; - - test_msg.signed_messages[8] = 6872; - - test_msg.signed_messages[9] = 7106; - - test_msg.signed_messages[10] = 7340; - - test_msg.signed_messages[11] = 7574; - - test_msg.signed_messages[12] = 7808; - - test_msg.signed_messages[13] = 8042; - - test_msg.signed_messages[14] = 8276; - - test_msg.signed_messages[15] = 8510; - - test_msg.signed_messages[16] = 8744; - - test_msg.signed_messages[17] = 8978; - - test_msg.signed_messages[18] = 9212; - - test_msg.signed_messages[19] = 9446; - - test_msg.signed_messages[20] = 9680; - - test_msg.signed_messages[21] = 9914; - - test_msg.signed_messages[22] = 10148; - - test_msg.signed_messages[23] = 10382; - - test_msg.signed_messages[24] = 10616; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.fingerprint[0], 100) << "incorrect value for last_msg_.fingerprint[0], expected 100, is " << last_msg_.fingerprint[0]; - EXPECT_EQ(last_msg_.fingerprint[1], 101) << "incorrect value for last_msg_.fingerprint[1], expected 101, is " << last_msg_.fingerprint[1]; - EXPECT_EQ(last_msg_.fingerprint[2], 102) << "incorrect value for last_msg_.fingerprint[2], expected 102, is " << last_msg_.fingerprint[2]; - EXPECT_EQ(last_msg_.fingerprint[3], 103) << "incorrect value for last_msg_.fingerprint[3], expected 103, is " << last_msg_.fingerprint[3]; - EXPECT_EQ(last_msg_.fingerprint[4], 104) << "incorrect value for last_msg_.fingerprint[4], expected 104, is " << last_msg_.fingerprint[4]; - EXPECT_EQ(last_msg_.fingerprint[5], 105) << "incorrect value for last_msg_.fingerprint[5], expected 105, is " << last_msg_.fingerprint[5]; - EXPECT_EQ(last_msg_.fingerprint[6], 106) << "incorrect value for last_msg_.fingerprint[6], expected 106, is " << last_msg_.fingerprint[6]; - EXPECT_EQ(last_msg_.fingerprint[7], 107) << "incorrect value for last_msg_.fingerprint[7], expected 107, is " << last_msg_.fingerprint[7]; - EXPECT_EQ(last_msg_.fingerprint[8], 108) << "incorrect value for last_msg_.fingerprint[8], expected 108, is " << last_msg_.fingerprint[8]; - EXPECT_EQ(last_msg_.fingerprint[9], 109) << "incorrect value for last_msg_.fingerprint[9], expected 109, is " << last_msg_.fingerprint[9]; - EXPECT_EQ(last_msg_.fingerprint[10], 110) << "incorrect value for last_msg_.fingerprint[10], expected 110, is " << last_msg_.fingerprint[10]; - EXPECT_EQ(last_msg_.fingerprint[11], 111) << "incorrect value for last_msg_.fingerprint[11], expected 111, is " << last_msg_.fingerprint[11]; - EXPECT_EQ(last_msg_.fingerprint[12], 112) << "incorrect value for last_msg_.fingerprint[12], expected 112, is " << last_msg_.fingerprint[12]; - EXPECT_EQ(last_msg_.fingerprint[13], 113) << "incorrect value for last_msg_.fingerprint[13], expected 113, is " << last_msg_.fingerprint[13]; - EXPECT_EQ(last_msg_.fingerprint[14], 114) << "incorrect value for last_msg_.fingerprint[14], expected 114, is " << last_msg_.fingerprint[14]; - EXPECT_EQ(last_msg_.fingerprint[15], 115) << "incorrect value for last_msg_.fingerprint[15], expected 115, is " << last_msg_.fingerprint[15]; - EXPECT_EQ(last_msg_.fingerprint[16], 116) << "incorrect value for last_msg_.fingerprint[16], expected 116, is " << last_msg_.fingerprint[16]; - EXPECT_EQ(last_msg_.fingerprint[17], 117) << "incorrect value for last_msg_.fingerprint[17], expected 117, is " << last_msg_.fingerprint[17]; - EXPECT_EQ(last_msg_.fingerprint[18], 118) << "incorrect value for last_msg_.fingerprint[18], expected 118, is " << last_msg_.fingerprint[18]; - EXPECT_EQ(last_msg_.fingerprint[19], 119) << "incorrect value for last_msg_.fingerprint[19], expected 119, is " << last_msg_.fingerprint[19]; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_signed_messages.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_signed_messages.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_signed_messages.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)105,(char)103,(char)110,(char)101,(char)100,(char)95,(char)109,(char)101,(char)115,(char)115,(char)97,(char)103,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_signed_messages.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_signed_messages.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_signed_messages.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_signed_messages.value, 25) << "incorrect value for last_msg_.n_signed_messages.value, expected 25, is " << last_msg_.n_signed_messages.value; - EXPECT_EQ(last_msg_.signature[0], 0) << "incorrect value for last_msg_.signature[0], expected 0, is " << last_msg_.signature[0]; - EXPECT_EQ(last_msg_.signature[1], 1) << "incorrect value for last_msg_.signature[1], expected 1, is " << last_msg_.signature[1]; - EXPECT_EQ(last_msg_.signature[2], 2) << "incorrect value for last_msg_.signature[2], expected 2, is " << last_msg_.signature[2]; - EXPECT_EQ(last_msg_.signature[3], 3) << "incorrect value for last_msg_.signature[3], expected 3, is " << last_msg_.signature[3]; - EXPECT_EQ(last_msg_.signature[4], 4) << "incorrect value for last_msg_.signature[4], expected 4, is " << last_msg_.signature[4]; - EXPECT_EQ(last_msg_.signature[5], 5) << "incorrect value for last_msg_.signature[5], expected 5, is " << last_msg_.signature[5]; - EXPECT_EQ(last_msg_.signature[6], 6) << "incorrect value for last_msg_.signature[6], expected 6, is " << last_msg_.signature[6]; - EXPECT_EQ(last_msg_.signature[7], 7) << "incorrect value for last_msg_.signature[7], expected 7, is " << last_msg_.signature[7]; - EXPECT_EQ(last_msg_.signature[8], 8) << "incorrect value for last_msg_.signature[8], expected 8, is " << last_msg_.signature[8]; - EXPECT_EQ(last_msg_.signature[9], 9) << "incorrect value for last_msg_.signature[9], expected 9, is " << last_msg_.signature[9]; - EXPECT_EQ(last_msg_.signature[10], 10) << "incorrect value for last_msg_.signature[10], expected 10, is " << last_msg_.signature[10]; - EXPECT_EQ(last_msg_.signature[11], 11) << "incorrect value for last_msg_.signature[11], expected 11, is " << last_msg_.signature[11]; - EXPECT_EQ(last_msg_.signature[12], 12) << "incorrect value for last_msg_.signature[12], expected 12, is " << last_msg_.signature[12]; - EXPECT_EQ(last_msg_.signature[13], 13) << "incorrect value for last_msg_.signature[13], expected 13, is " << last_msg_.signature[13]; - EXPECT_EQ(last_msg_.signature[14], 14) << "incorrect value for last_msg_.signature[14], expected 14, is " << last_msg_.signature[14]; - EXPECT_EQ(last_msg_.signature[15], 15) << "incorrect value for last_msg_.signature[15], expected 15, is " << last_msg_.signature[15]; - EXPECT_EQ(last_msg_.signature[16], 16) << "incorrect value for last_msg_.signature[16], expected 16, is " << last_msg_.signature[16]; - EXPECT_EQ(last_msg_.signature[17], 17) << "incorrect value for last_msg_.signature[17], expected 17, is " << last_msg_.signature[17]; - EXPECT_EQ(last_msg_.signature[18], 18) << "incorrect value for last_msg_.signature[18], expected 18, is " << last_msg_.signature[18]; - EXPECT_EQ(last_msg_.signature[19], 19) << "incorrect value for last_msg_.signature[19], expected 19, is " << last_msg_.signature[19]; - EXPECT_EQ(last_msg_.signature[20], 20) << "incorrect value for last_msg_.signature[20], expected 20, is " << last_msg_.signature[20]; - EXPECT_EQ(last_msg_.signature[21], 21) << "incorrect value for last_msg_.signature[21], expected 21, is " << last_msg_.signature[21]; - EXPECT_EQ(last_msg_.signature[22], 22) << "incorrect value for last_msg_.signature[22], expected 22, is " << last_msg_.signature[22]; - EXPECT_EQ(last_msg_.signature[23], 23) << "incorrect value for last_msg_.signature[23], expected 23, is " << last_msg_.signature[23]; - EXPECT_EQ(last_msg_.signature[24], 24) << "incorrect value for last_msg_.signature[24], expected 24, is " << last_msg_.signature[24]; - EXPECT_EQ(last_msg_.signature[25], 25) << "incorrect value for last_msg_.signature[25], expected 25, is " << last_msg_.signature[25]; - EXPECT_EQ(last_msg_.signature[26], 26) << "incorrect value for last_msg_.signature[26], expected 26, is " << last_msg_.signature[26]; - EXPECT_EQ(last_msg_.signature[27], 27) << "incorrect value for last_msg_.signature[27], expected 27, is " << last_msg_.signature[27]; - EXPECT_EQ(last_msg_.signature[28], 28) << "incorrect value for last_msg_.signature[28], expected 28, is " << last_msg_.signature[28]; - EXPECT_EQ(last_msg_.signature[29], 29) << "incorrect value for last_msg_.signature[29], expected 29, is " << last_msg_.signature[29]; - EXPECT_EQ(last_msg_.signature[30], 30) << "incorrect value for last_msg_.signature[30], expected 30, is " << last_msg_.signature[30]; - EXPECT_EQ(last_msg_.signature[31], 31) << "incorrect value for last_msg_.signature[31], expected 31, is " << last_msg_.signature[31]; - EXPECT_EQ(last_msg_.signature[32], 32) << "incorrect value for last_msg_.signature[32], expected 32, is " << last_msg_.signature[32]; - EXPECT_EQ(last_msg_.signature[33], 33) << "incorrect value for last_msg_.signature[33], expected 33, is " << last_msg_.signature[33]; - EXPECT_EQ(last_msg_.signature[34], 34) << "incorrect value for last_msg_.signature[34], expected 34, is " << last_msg_.signature[34]; - EXPECT_EQ(last_msg_.signature[35], 35) << "incorrect value for last_msg_.signature[35], expected 35, is " << last_msg_.signature[35]; - EXPECT_EQ(last_msg_.signature[36], 36) << "incorrect value for last_msg_.signature[36], expected 36, is " << last_msg_.signature[36]; - EXPECT_EQ(last_msg_.signature[37], 37) << "incorrect value for last_msg_.signature[37], expected 37, is " << last_msg_.signature[37]; - EXPECT_EQ(last_msg_.signature[38], 38) << "incorrect value for last_msg_.signature[38], expected 38, is " << last_msg_.signature[38]; - EXPECT_EQ(last_msg_.signature[39], 39) << "incorrect value for last_msg_.signature[39], expected 39, is " << last_msg_.signature[39]; - EXPECT_EQ(last_msg_.signature[40], 40) << "incorrect value for last_msg_.signature[40], expected 40, is " << last_msg_.signature[40]; - EXPECT_EQ(last_msg_.signature[41], 41) << "incorrect value for last_msg_.signature[41], expected 41, is " << last_msg_.signature[41]; - EXPECT_EQ(last_msg_.signature[42], 42) << "incorrect value for last_msg_.signature[42], expected 42, is " << last_msg_.signature[42]; - EXPECT_EQ(last_msg_.signature[43], 43) << "incorrect value for last_msg_.signature[43], expected 43, is " << last_msg_.signature[43]; - EXPECT_EQ(last_msg_.signature[44], 44) << "incorrect value for last_msg_.signature[44], expected 44, is " << last_msg_.signature[44]; - EXPECT_EQ(last_msg_.signature[45], 45) << "incorrect value for last_msg_.signature[45], expected 45, is " << last_msg_.signature[45]; - EXPECT_EQ(last_msg_.signature[46], 46) << "incorrect value for last_msg_.signature[46], expected 46, is " << last_msg_.signature[46]; - EXPECT_EQ(last_msg_.signature[47], 47) << "incorrect value for last_msg_.signature[47], expected 47, is " << last_msg_.signature[47]; - EXPECT_EQ(last_msg_.signature[48], 48) << "incorrect value for last_msg_.signature[48], expected 48, is " << last_msg_.signature[48]; - EXPECT_EQ(last_msg_.signature[49], 49) << "incorrect value for last_msg_.signature[49], expected 49, is " << last_msg_.signature[49]; - EXPECT_EQ(last_msg_.signature[50], 50) << "incorrect value for last_msg_.signature[50], expected 50, is " << last_msg_.signature[50]; - EXPECT_EQ(last_msg_.signature[51], 51) << "incorrect value for last_msg_.signature[51], expected 51, is " << last_msg_.signature[51]; - EXPECT_EQ(last_msg_.signature[52], 52) << "incorrect value for last_msg_.signature[52], expected 52, is " << last_msg_.signature[52]; - EXPECT_EQ(last_msg_.signature[53], 53) << "incorrect value for last_msg_.signature[53], expected 53, is " << last_msg_.signature[53]; - EXPECT_EQ(last_msg_.signature[54], 54) << "incorrect value for last_msg_.signature[54], expected 54, is " << last_msg_.signature[54]; - EXPECT_EQ(last_msg_.signature[55], 55) << "incorrect value for last_msg_.signature[55], expected 55, is " << last_msg_.signature[55]; - EXPECT_EQ(last_msg_.signature[56], 56) << "incorrect value for last_msg_.signature[56], expected 56, is " << last_msg_.signature[56]; - EXPECT_EQ(last_msg_.signature[57], 57) << "incorrect value for last_msg_.signature[57], expected 57, is " << last_msg_.signature[57]; - EXPECT_EQ(last_msg_.signature[58], 58) << "incorrect value for last_msg_.signature[58], expected 58, is " << last_msg_.signature[58]; - EXPECT_EQ(last_msg_.signature[59], 59) << "incorrect value for last_msg_.signature[59], expected 59, is " << last_msg_.signature[59]; - EXPECT_EQ(last_msg_.signature[60], 60) << "incorrect value for last_msg_.signature[60], expected 60, is " << last_msg_.signature[60]; - EXPECT_EQ(last_msg_.signature[61], 61) << "incorrect value for last_msg_.signature[61], expected 61, is " << last_msg_.signature[61]; - EXPECT_EQ(last_msg_.signature[62], 62) << "incorrect value for last_msg_.signature[62], expected 62, is " << last_msg_.signature[62]; - EXPECT_EQ(last_msg_.signature[63], 63) << "incorrect value for last_msg_.signature[63], expected 63, is " << last_msg_.signature[63]; - EXPECT_EQ(last_msg_.signed_messages[0], 5000) << "incorrect value for last_msg_.signed_messages[0], expected 5000, is " << last_msg_.signed_messages[0]; - EXPECT_EQ(last_msg_.signed_messages[1], 5234) << "incorrect value for last_msg_.signed_messages[1], expected 5234, is " << last_msg_.signed_messages[1]; - EXPECT_EQ(last_msg_.signed_messages[2], 5468) << "incorrect value for last_msg_.signed_messages[2], expected 5468, is " << last_msg_.signed_messages[2]; - EXPECT_EQ(last_msg_.signed_messages[3], 5702) << "incorrect value for last_msg_.signed_messages[3], expected 5702, is " << last_msg_.signed_messages[3]; - EXPECT_EQ(last_msg_.signed_messages[4], 5936) << "incorrect value for last_msg_.signed_messages[4], expected 5936, is " << last_msg_.signed_messages[4]; - EXPECT_EQ(last_msg_.signed_messages[5], 6170) << "incorrect value for last_msg_.signed_messages[5], expected 6170, is " << last_msg_.signed_messages[5]; - EXPECT_EQ(last_msg_.signed_messages[6], 6404) << "incorrect value for last_msg_.signed_messages[6], expected 6404, is " << last_msg_.signed_messages[6]; - EXPECT_EQ(last_msg_.signed_messages[7], 6638) << "incorrect value for last_msg_.signed_messages[7], expected 6638, is " << last_msg_.signed_messages[7]; - EXPECT_EQ(last_msg_.signed_messages[8], 6872) << "incorrect value for last_msg_.signed_messages[8], expected 6872, is " << last_msg_.signed_messages[8]; - EXPECT_EQ(last_msg_.signed_messages[9], 7106) << "incorrect value for last_msg_.signed_messages[9], expected 7106, is " << last_msg_.signed_messages[9]; - EXPECT_EQ(last_msg_.signed_messages[10], 7340) << "incorrect value for last_msg_.signed_messages[10], expected 7340, is " << last_msg_.signed_messages[10]; - EXPECT_EQ(last_msg_.signed_messages[11], 7574) << "incorrect value for last_msg_.signed_messages[11], expected 7574, is " << last_msg_.signed_messages[11]; - EXPECT_EQ(last_msg_.signed_messages[12], 7808) << "incorrect value for last_msg_.signed_messages[12], expected 7808, is " << last_msg_.signed_messages[12]; - EXPECT_EQ(last_msg_.signed_messages[13], 8042) << "incorrect value for last_msg_.signed_messages[13], expected 8042, is " << last_msg_.signed_messages[13]; - EXPECT_EQ(last_msg_.signed_messages[14], 8276) << "incorrect value for last_msg_.signed_messages[14], expected 8276, is " << last_msg_.signed_messages[14]; - EXPECT_EQ(last_msg_.signed_messages[15], 8510) << "incorrect value for last_msg_.signed_messages[15], expected 8510, is " << last_msg_.signed_messages[15]; - EXPECT_EQ(last_msg_.signed_messages[16], 8744) << "incorrect value for last_msg_.signed_messages[16], expected 8744, is " << last_msg_.signed_messages[16]; - EXPECT_EQ(last_msg_.signed_messages[17], 8978) << "incorrect value for last_msg_.signed_messages[17], expected 8978, is " << last_msg_.signed_messages[17]; - EXPECT_EQ(last_msg_.signed_messages[18], 9212) << "incorrect value for last_msg_.signed_messages[18], expected 9212, is " << last_msg_.signed_messages[18]; - EXPECT_EQ(last_msg_.signed_messages[19], 9446) << "incorrect value for last_msg_.signed_messages[19], expected 9446, is " << last_msg_.signed_messages[19]; - EXPECT_EQ(last_msg_.signed_messages[20], 9680) << "incorrect value for last_msg_.signed_messages[20], expected 9680, is " << last_msg_.signed_messages[20]; - EXPECT_EQ(last_msg_.signed_messages[21], 9914) << "incorrect value for last_msg_.signed_messages[21], expected 9914, is " << last_msg_.signed_messages[21]; - EXPECT_EQ(last_msg_.signed_messages[22], 10148) << "incorrect value for last_msg_.signed_messages[22], expected 10148, is " << last_msg_.signed_messages[22]; - EXPECT_EQ(last_msg_.signed_messages[23], 10382) << "incorrect value for last_msg_.signed_messages[23], expected 10382, is " << last_msg_.signed_messages[23]; - EXPECT_EQ(last_msg_.signed_messages[24], 10616) << "incorrect value for last_msg_.signed_messages[24], expected 10616, is " << last_msg_.signed_messages[24]; +}; + +TEST_F(Test_auto_check_sbp_signing_MsgEd25519SignatureDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 1, 12, 66, 0, 184, 0, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 136, 19, 0, 0, 114, 20, 0, 0, 92, 21, 0, 0, 70, 22, 0, + 0, 48, 23, 0, 0, 26, 24, 0, 0, 4, 25, 0, 0, 238, 25, + 0, 0, 216, 26, 0, 0, 194, 27, 0, 0, 172, 28, 0, 0, 150, + 29, 0, 0, 128, 30, 0, 0, 106, 31, 0, 0, 84, 32, 0, 0, + 62, 33, 0, 0, 40, 34, 0, 0, 18, 35, 0, 0, 252, 35, 0, + 0, 230, 36, 0, 0, 208, 37, 0, 0, 186, 38, 0, 0, 164, 39, + 0, 0, 142, 40, 0, 0, 120, 41, 0, 0, 169, 111, + }; + + sbp_msg_ed25519_signature_dep_a_t test_msg{}; + + test_msg.fingerprint[0] = 100; + + test_msg.fingerprint[1] = 101; + + test_msg.fingerprint[2] = 102; + + test_msg.fingerprint[3] = 103; + + test_msg.fingerprint[4] = 104; + + test_msg.fingerprint[5] = 105; + + test_msg.fingerprint[6] = 106; + + test_msg.fingerprint[7] = 107; + + test_msg.fingerprint[8] = 108; + + test_msg.fingerprint[9] = 109; + + test_msg.fingerprint[10] = 110; + + test_msg.fingerprint[11] = 111; + + test_msg.fingerprint[12] = 112; + + test_msg.fingerprint[13] = 113; + + test_msg.fingerprint[14] = 114; + + test_msg.fingerprint[15] = 115; + + test_msg.fingerprint[16] = 116; + + test_msg.fingerprint[17] = 117; + + test_msg.fingerprint[18] = 118; + + test_msg.fingerprint[19] = 119; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_signed_messages.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)105, (char)103, (char)110, + (char)101, (char)100, (char)95, (char)109, + (char)101, (char)115, (char)115, (char)97, + (char)103, (char)101, (char)115}; + memcpy(test_msg.n_signed_messages.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_signed_messages.value = 25; + + test_msg.signature[0] = 0; + + test_msg.signature[1] = 1; + + test_msg.signature[2] = 2; + + test_msg.signature[3] = 3; + + test_msg.signature[4] = 4; + + test_msg.signature[5] = 5; + + test_msg.signature[6] = 6; + + test_msg.signature[7] = 7; + + test_msg.signature[8] = 8; + + test_msg.signature[9] = 9; + + test_msg.signature[10] = 10; + + test_msg.signature[11] = 11; + + test_msg.signature[12] = 12; + + test_msg.signature[13] = 13; + + test_msg.signature[14] = 14; + + test_msg.signature[15] = 15; + + test_msg.signature[16] = 16; + + test_msg.signature[17] = 17; + + test_msg.signature[18] = 18; + + test_msg.signature[19] = 19; + + test_msg.signature[20] = 20; + + test_msg.signature[21] = 21; + + test_msg.signature[22] = 22; + + test_msg.signature[23] = 23; + + test_msg.signature[24] = 24; + + test_msg.signature[25] = 25; + + test_msg.signature[26] = 26; + + test_msg.signature[27] = 27; + + test_msg.signature[28] = 28; + + test_msg.signature[29] = 29; + + test_msg.signature[30] = 30; + + test_msg.signature[31] = 31; + + test_msg.signature[32] = 32; + + test_msg.signature[33] = 33; + + test_msg.signature[34] = 34; + + test_msg.signature[35] = 35; + + test_msg.signature[36] = 36; + + test_msg.signature[37] = 37; + + test_msg.signature[38] = 38; + + test_msg.signature[39] = 39; + + test_msg.signature[40] = 40; + + test_msg.signature[41] = 41; + + test_msg.signature[42] = 42; + + test_msg.signature[43] = 43; + + test_msg.signature[44] = 44; + + test_msg.signature[45] = 45; + + test_msg.signature[46] = 46; + + test_msg.signature[47] = 47; + + test_msg.signature[48] = 48; + + test_msg.signature[49] = 49; + + test_msg.signature[50] = 50; + + test_msg.signature[51] = 51; + + test_msg.signature[52] = 52; + + test_msg.signature[53] = 53; + + test_msg.signature[54] = 54; + + test_msg.signature[55] = 55; + + test_msg.signature[56] = 56; + + test_msg.signature[57] = 57; + + test_msg.signature[58] = 58; + + test_msg.signature[59] = 59; + + test_msg.signature[60] = 60; + + test_msg.signature[61] = 61; + + test_msg.signature[62] = 62; + + test_msg.signature[63] = 63; + + test_msg.signed_messages[0] = 5000; + + test_msg.signed_messages[1] = 5234; + + test_msg.signed_messages[2] = 5468; + + test_msg.signed_messages[3] = 5702; + + test_msg.signed_messages[4] = 5936; + + test_msg.signed_messages[5] = 6170; + + test_msg.signed_messages[6] = 6404; + + test_msg.signed_messages[7] = 6638; + + test_msg.signed_messages[8] = 6872; + + test_msg.signed_messages[9] = 7106; + + test_msg.signed_messages[10] = 7340; + + test_msg.signed_messages[11] = 7574; + + test_msg.signed_messages[12] = 7808; + + test_msg.signed_messages[13] = 8042; + + test_msg.signed_messages[14] = 8276; + + test_msg.signed_messages[15] = 8510; + + test_msg.signed_messages[16] = 8744; + + test_msg.signed_messages[17] = 8978; + + test_msg.signed_messages[18] = 9212; + + test_msg.signed_messages[19] = 9446; + + test_msg.signed_messages[20] = 9680; + + test_msg.signed_messages[21] = 9914; + + test_msg.signed_messages[22] = 10148; + + test_msg.signed_messages[23] = 10382; + + test_msg.signed_messages[24] = 10616; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.fingerprint[0], 100) + << "incorrect value for last_msg_.fingerprint[0], expected 100, is " + << last_msg_.fingerprint[0]; + EXPECT_EQ(last_msg_.fingerprint[1], 101) + << "incorrect value for last_msg_.fingerprint[1], expected 101, is " + << last_msg_.fingerprint[1]; + EXPECT_EQ(last_msg_.fingerprint[2], 102) + << "incorrect value for last_msg_.fingerprint[2], expected 102, is " + << last_msg_.fingerprint[2]; + EXPECT_EQ(last_msg_.fingerprint[3], 103) + << "incorrect value for last_msg_.fingerprint[3], expected 103, is " + << last_msg_.fingerprint[3]; + EXPECT_EQ(last_msg_.fingerprint[4], 104) + << "incorrect value for last_msg_.fingerprint[4], expected 104, is " + << last_msg_.fingerprint[4]; + EXPECT_EQ(last_msg_.fingerprint[5], 105) + << "incorrect value for last_msg_.fingerprint[5], expected 105, is " + << last_msg_.fingerprint[5]; + EXPECT_EQ(last_msg_.fingerprint[6], 106) + << "incorrect value for last_msg_.fingerprint[6], expected 106, is " + << last_msg_.fingerprint[6]; + EXPECT_EQ(last_msg_.fingerprint[7], 107) + << "incorrect value for last_msg_.fingerprint[7], expected 107, is " + << last_msg_.fingerprint[7]; + EXPECT_EQ(last_msg_.fingerprint[8], 108) + << "incorrect value for last_msg_.fingerprint[8], expected 108, is " + << last_msg_.fingerprint[8]; + EXPECT_EQ(last_msg_.fingerprint[9], 109) + << "incorrect value for last_msg_.fingerprint[9], expected 109, is " + << last_msg_.fingerprint[9]; + EXPECT_EQ(last_msg_.fingerprint[10], 110) + << "incorrect value for last_msg_.fingerprint[10], expected 110, is " + << last_msg_.fingerprint[10]; + EXPECT_EQ(last_msg_.fingerprint[11], 111) + << "incorrect value for last_msg_.fingerprint[11], expected 111, is " + << last_msg_.fingerprint[11]; + EXPECT_EQ(last_msg_.fingerprint[12], 112) + << "incorrect value for last_msg_.fingerprint[12], expected 112, is " + << last_msg_.fingerprint[12]; + EXPECT_EQ(last_msg_.fingerprint[13], 113) + << "incorrect value for last_msg_.fingerprint[13], expected 113, is " + << last_msg_.fingerprint[13]; + EXPECT_EQ(last_msg_.fingerprint[14], 114) + << "incorrect value for last_msg_.fingerprint[14], expected 114, is " + << last_msg_.fingerprint[14]; + EXPECT_EQ(last_msg_.fingerprint[15], 115) + << "incorrect value for last_msg_.fingerprint[15], expected 115, is " + << last_msg_.fingerprint[15]; + EXPECT_EQ(last_msg_.fingerprint[16], 116) + << "incorrect value for last_msg_.fingerprint[16], expected 116, is " + << last_msg_.fingerprint[16]; + EXPECT_EQ(last_msg_.fingerprint[17], 117) + << "incorrect value for last_msg_.fingerprint[17], expected 117, is " + << last_msg_.fingerprint[17]; + EXPECT_EQ(last_msg_.fingerprint[18], 118) + << "incorrect value for last_msg_.fingerprint[18], expected 118, is " + << last_msg_.fingerprint[18]; + EXPECT_EQ(last_msg_.fingerprint[19], 119) + << "incorrect value for last_msg_.fingerprint[19], expected 119, is " + << last_msg_.fingerprint[19]; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_signed_messages.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_signed_messages.handle_as, " + "expected string '" + << check_string << "', is '" << last_msg_.n_signed_messages.handle_as + << "'"; + } + { + const char check_string[] = {(char)115, (char)105, (char)103, (char)110, + (char)101, (char)100, (char)95, (char)109, + (char)101, (char)115, (char)115, (char)97, + (char)103, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_signed_messages.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_signed_messages.relates_to, " + "expected string '" + << check_string << "', is '" << last_msg_.n_signed_messages.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_signed_messages.value, 25) + << "incorrect value for last_msg_.n_signed_messages.value, expected 25, " + "is " + << last_msg_.n_signed_messages.value; + EXPECT_EQ(last_msg_.signature[0], 0) + << "incorrect value for last_msg_.signature[0], expected 0, is " + << last_msg_.signature[0]; + EXPECT_EQ(last_msg_.signature[1], 1) + << "incorrect value for last_msg_.signature[1], expected 1, is " + << last_msg_.signature[1]; + EXPECT_EQ(last_msg_.signature[2], 2) + << "incorrect value for last_msg_.signature[2], expected 2, is " + << last_msg_.signature[2]; + EXPECT_EQ(last_msg_.signature[3], 3) + << "incorrect value for last_msg_.signature[3], expected 3, is " + << last_msg_.signature[3]; + EXPECT_EQ(last_msg_.signature[4], 4) + << "incorrect value for last_msg_.signature[4], expected 4, is " + << last_msg_.signature[4]; + EXPECT_EQ(last_msg_.signature[5], 5) + << "incorrect value for last_msg_.signature[5], expected 5, is " + << last_msg_.signature[5]; + EXPECT_EQ(last_msg_.signature[6], 6) + << "incorrect value for last_msg_.signature[6], expected 6, is " + << last_msg_.signature[6]; + EXPECT_EQ(last_msg_.signature[7], 7) + << "incorrect value for last_msg_.signature[7], expected 7, is " + << last_msg_.signature[7]; + EXPECT_EQ(last_msg_.signature[8], 8) + << "incorrect value for last_msg_.signature[8], expected 8, is " + << last_msg_.signature[8]; + EXPECT_EQ(last_msg_.signature[9], 9) + << "incorrect value for last_msg_.signature[9], expected 9, is " + << last_msg_.signature[9]; + EXPECT_EQ(last_msg_.signature[10], 10) + << "incorrect value for last_msg_.signature[10], expected 10, is " + << last_msg_.signature[10]; + EXPECT_EQ(last_msg_.signature[11], 11) + << "incorrect value for last_msg_.signature[11], expected 11, is " + << last_msg_.signature[11]; + EXPECT_EQ(last_msg_.signature[12], 12) + << "incorrect value for last_msg_.signature[12], expected 12, is " + << last_msg_.signature[12]; + EXPECT_EQ(last_msg_.signature[13], 13) + << "incorrect value for last_msg_.signature[13], expected 13, is " + << last_msg_.signature[13]; + EXPECT_EQ(last_msg_.signature[14], 14) + << "incorrect value for last_msg_.signature[14], expected 14, is " + << last_msg_.signature[14]; + EXPECT_EQ(last_msg_.signature[15], 15) + << "incorrect value for last_msg_.signature[15], expected 15, is " + << last_msg_.signature[15]; + EXPECT_EQ(last_msg_.signature[16], 16) + << "incorrect value for last_msg_.signature[16], expected 16, is " + << last_msg_.signature[16]; + EXPECT_EQ(last_msg_.signature[17], 17) + << "incorrect value for last_msg_.signature[17], expected 17, is " + << last_msg_.signature[17]; + EXPECT_EQ(last_msg_.signature[18], 18) + << "incorrect value for last_msg_.signature[18], expected 18, is " + << last_msg_.signature[18]; + EXPECT_EQ(last_msg_.signature[19], 19) + << "incorrect value for last_msg_.signature[19], expected 19, is " + << last_msg_.signature[19]; + EXPECT_EQ(last_msg_.signature[20], 20) + << "incorrect value for last_msg_.signature[20], expected 20, is " + << last_msg_.signature[20]; + EXPECT_EQ(last_msg_.signature[21], 21) + << "incorrect value for last_msg_.signature[21], expected 21, is " + << last_msg_.signature[21]; + EXPECT_EQ(last_msg_.signature[22], 22) + << "incorrect value for last_msg_.signature[22], expected 22, is " + << last_msg_.signature[22]; + EXPECT_EQ(last_msg_.signature[23], 23) + << "incorrect value for last_msg_.signature[23], expected 23, is " + << last_msg_.signature[23]; + EXPECT_EQ(last_msg_.signature[24], 24) + << "incorrect value for last_msg_.signature[24], expected 24, is " + << last_msg_.signature[24]; + EXPECT_EQ(last_msg_.signature[25], 25) + << "incorrect value for last_msg_.signature[25], expected 25, is " + << last_msg_.signature[25]; + EXPECT_EQ(last_msg_.signature[26], 26) + << "incorrect value for last_msg_.signature[26], expected 26, is " + << last_msg_.signature[26]; + EXPECT_EQ(last_msg_.signature[27], 27) + << "incorrect value for last_msg_.signature[27], expected 27, is " + << last_msg_.signature[27]; + EXPECT_EQ(last_msg_.signature[28], 28) + << "incorrect value for last_msg_.signature[28], expected 28, is " + << last_msg_.signature[28]; + EXPECT_EQ(last_msg_.signature[29], 29) + << "incorrect value for last_msg_.signature[29], expected 29, is " + << last_msg_.signature[29]; + EXPECT_EQ(last_msg_.signature[30], 30) + << "incorrect value for last_msg_.signature[30], expected 30, is " + << last_msg_.signature[30]; + EXPECT_EQ(last_msg_.signature[31], 31) + << "incorrect value for last_msg_.signature[31], expected 31, is " + << last_msg_.signature[31]; + EXPECT_EQ(last_msg_.signature[32], 32) + << "incorrect value for last_msg_.signature[32], expected 32, is " + << last_msg_.signature[32]; + EXPECT_EQ(last_msg_.signature[33], 33) + << "incorrect value for last_msg_.signature[33], expected 33, is " + << last_msg_.signature[33]; + EXPECT_EQ(last_msg_.signature[34], 34) + << "incorrect value for last_msg_.signature[34], expected 34, is " + << last_msg_.signature[34]; + EXPECT_EQ(last_msg_.signature[35], 35) + << "incorrect value for last_msg_.signature[35], expected 35, is " + << last_msg_.signature[35]; + EXPECT_EQ(last_msg_.signature[36], 36) + << "incorrect value for last_msg_.signature[36], expected 36, is " + << last_msg_.signature[36]; + EXPECT_EQ(last_msg_.signature[37], 37) + << "incorrect value for last_msg_.signature[37], expected 37, is " + << last_msg_.signature[37]; + EXPECT_EQ(last_msg_.signature[38], 38) + << "incorrect value for last_msg_.signature[38], expected 38, is " + << last_msg_.signature[38]; + EXPECT_EQ(last_msg_.signature[39], 39) + << "incorrect value for last_msg_.signature[39], expected 39, is " + << last_msg_.signature[39]; + EXPECT_EQ(last_msg_.signature[40], 40) + << "incorrect value for last_msg_.signature[40], expected 40, is " + << last_msg_.signature[40]; + EXPECT_EQ(last_msg_.signature[41], 41) + << "incorrect value for last_msg_.signature[41], expected 41, is " + << last_msg_.signature[41]; + EXPECT_EQ(last_msg_.signature[42], 42) + << "incorrect value for last_msg_.signature[42], expected 42, is " + << last_msg_.signature[42]; + EXPECT_EQ(last_msg_.signature[43], 43) + << "incorrect value for last_msg_.signature[43], expected 43, is " + << last_msg_.signature[43]; + EXPECT_EQ(last_msg_.signature[44], 44) + << "incorrect value for last_msg_.signature[44], expected 44, is " + << last_msg_.signature[44]; + EXPECT_EQ(last_msg_.signature[45], 45) + << "incorrect value for last_msg_.signature[45], expected 45, is " + << last_msg_.signature[45]; + EXPECT_EQ(last_msg_.signature[46], 46) + << "incorrect value for last_msg_.signature[46], expected 46, is " + << last_msg_.signature[46]; + EXPECT_EQ(last_msg_.signature[47], 47) + << "incorrect value for last_msg_.signature[47], expected 47, is " + << last_msg_.signature[47]; + EXPECT_EQ(last_msg_.signature[48], 48) + << "incorrect value for last_msg_.signature[48], expected 48, is " + << last_msg_.signature[48]; + EXPECT_EQ(last_msg_.signature[49], 49) + << "incorrect value for last_msg_.signature[49], expected 49, is " + << last_msg_.signature[49]; + EXPECT_EQ(last_msg_.signature[50], 50) + << "incorrect value for last_msg_.signature[50], expected 50, is " + << last_msg_.signature[50]; + EXPECT_EQ(last_msg_.signature[51], 51) + << "incorrect value for last_msg_.signature[51], expected 51, is " + << last_msg_.signature[51]; + EXPECT_EQ(last_msg_.signature[52], 52) + << "incorrect value for last_msg_.signature[52], expected 52, is " + << last_msg_.signature[52]; + EXPECT_EQ(last_msg_.signature[53], 53) + << "incorrect value for last_msg_.signature[53], expected 53, is " + << last_msg_.signature[53]; + EXPECT_EQ(last_msg_.signature[54], 54) + << "incorrect value for last_msg_.signature[54], expected 54, is " + << last_msg_.signature[54]; + EXPECT_EQ(last_msg_.signature[55], 55) + << "incorrect value for last_msg_.signature[55], expected 55, is " + << last_msg_.signature[55]; + EXPECT_EQ(last_msg_.signature[56], 56) + << "incorrect value for last_msg_.signature[56], expected 56, is " + << last_msg_.signature[56]; + EXPECT_EQ(last_msg_.signature[57], 57) + << "incorrect value for last_msg_.signature[57], expected 57, is " + << last_msg_.signature[57]; + EXPECT_EQ(last_msg_.signature[58], 58) + << "incorrect value for last_msg_.signature[58], expected 58, is " + << last_msg_.signature[58]; + EXPECT_EQ(last_msg_.signature[59], 59) + << "incorrect value for last_msg_.signature[59], expected 59, is " + << last_msg_.signature[59]; + EXPECT_EQ(last_msg_.signature[60], 60) + << "incorrect value for last_msg_.signature[60], expected 60, is " + << last_msg_.signature[60]; + EXPECT_EQ(last_msg_.signature[61], 61) + << "incorrect value for last_msg_.signature[61], expected 61, is " + << last_msg_.signature[61]; + EXPECT_EQ(last_msg_.signature[62], 62) + << "incorrect value for last_msg_.signature[62], expected 62, is " + << last_msg_.signature[62]; + EXPECT_EQ(last_msg_.signature[63], 63) + << "incorrect value for last_msg_.signature[63], expected 63, is " + << last_msg_.signature[63]; + EXPECT_EQ(last_msg_.signed_messages[0], 5000) + << "incorrect value for last_msg_.signed_messages[0], expected 5000, is " + << last_msg_.signed_messages[0]; + EXPECT_EQ(last_msg_.signed_messages[1], 5234) + << "incorrect value for last_msg_.signed_messages[1], expected 5234, is " + << last_msg_.signed_messages[1]; + EXPECT_EQ(last_msg_.signed_messages[2], 5468) + << "incorrect value for last_msg_.signed_messages[2], expected 5468, is " + << last_msg_.signed_messages[2]; + EXPECT_EQ(last_msg_.signed_messages[3], 5702) + << "incorrect value for last_msg_.signed_messages[3], expected 5702, is " + << last_msg_.signed_messages[3]; + EXPECT_EQ(last_msg_.signed_messages[4], 5936) + << "incorrect value for last_msg_.signed_messages[4], expected 5936, is " + << last_msg_.signed_messages[4]; + EXPECT_EQ(last_msg_.signed_messages[5], 6170) + << "incorrect value for last_msg_.signed_messages[5], expected 6170, is " + << last_msg_.signed_messages[5]; + EXPECT_EQ(last_msg_.signed_messages[6], 6404) + << "incorrect value for last_msg_.signed_messages[6], expected 6404, is " + << last_msg_.signed_messages[6]; + EXPECT_EQ(last_msg_.signed_messages[7], 6638) + << "incorrect value for last_msg_.signed_messages[7], expected 6638, is " + << last_msg_.signed_messages[7]; + EXPECT_EQ(last_msg_.signed_messages[8], 6872) + << "incorrect value for last_msg_.signed_messages[8], expected 6872, is " + << last_msg_.signed_messages[8]; + EXPECT_EQ(last_msg_.signed_messages[9], 7106) + << "incorrect value for last_msg_.signed_messages[9], expected 7106, is " + << last_msg_.signed_messages[9]; + EXPECT_EQ(last_msg_.signed_messages[10], 7340) + << "incorrect value for last_msg_.signed_messages[10], expected 7340, is " + << last_msg_.signed_messages[10]; + EXPECT_EQ(last_msg_.signed_messages[11], 7574) + << "incorrect value for last_msg_.signed_messages[11], expected 7574, is " + << last_msg_.signed_messages[11]; + EXPECT_EQ(last_msg_.signed_messages[12], 7808) + << "incorrect value for last_msg_.signed_messages[12], expected 7808, is " + << last_msg_.signed_messages[12]; + EXPECT_EQ(last_msg_.signed_messages[13], 8042) + << "incorrect value for last_msg_.signed_messages[13], expected 8042, is " + << last_msg_.signed_messages[13]; + EXPECT_EQ(last_msg_.signed_messages[14], 8276) + << "incorrect value for last_msg_.signed_messages[14], expected 8276, is " + << last_msg_.signed_messages[14]; + EXPECT_EQ(last_msg_.signed_messages[15], 8510) + << "incorrect value for last_msg_.signed_messages[15], expected 8510, is " + << last_msg_.signed_messages[15]; + EXPECT_EQ(last_msg_.signed_messages[16], 8744) + << "incorrect value for last_msg_.signed_messages[16], expected 8744, is " + << last_msg_.signed_messages[16]; + EXPECT_EQ(last_msg_.signed_messages[17], 8978) + << "incorrect value for last_msg_.signed_messages[17], expected 8978, is " + << last_msg_.signed_messages[17]; + EXPECT_EQ(last_msg_.signed_messages[18], 9212) + << "incorrect value for last_msg_.signed_messages[18], expected 9212, is " + << last_msg_.signed_messages[18]; + EXPECT_EQ(last_msg_.signed_messages[19], 9446) + << "incorrect value for last_msg_.signed_messages[19], expected 9446, is " + << last_msg_.signed_messages[19]; + EXPECT_EQ(last_msg_.signed_messages[20], 9680) + << "incorrect value for last_msg_.signed_messages[20], expected 9680, is " + << last_msg_.signed_messages[20]; + EXPECT_EQ(last_msg_.signed_messages[21], 9914) + << "incorrect value for last_msg_.signed_messages[21], expected 9914, is " + << last_msg_.signed_messages[21]; + EXPECT_EQ(last_msg_.signed_messages[22], 10148) + << "incorrect value for last_msg_.signed_messages[22], expected 10148, " + "is " + << last_msg_.signed_messages[22]; + EXPECT_EQ(last_msg_.signed_messages[23], 10382) + << "incorrect value for last_msg_.signed_messages[23], expected 10382, " + "is " + << last_msg_.signed_messages[23]; + EXPECT_EQ(last_msg_.signed_messages[24], 10616) + << "incorrect value for last_msg_.signed_messages[24], expected 10616, " + "is " + << last_msg_.signed_messages[24]; } diff --git a/c/test/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepB.cc b/c/test/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepB.cc index 78b6d8be4..e50ad28fc 100644 --- a/c/test/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepB.cc +++ b/c/test/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepB.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepB.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_signing_MsgEd25519SignatureDepB0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_signing_MsgEd25519SignatureDepB0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_signing_MsgEd25519SignatureDepB0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_signing_MsgEd25519SignatureDepB0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ed25519_signature_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ed25519_signature_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,379 +67,643 @@ class Test_auto_check_sbp_signing_MsgEd25519SignatureDepB0 : sbp_msg_ed25519_signature_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_signing_MsgEd25519SignatureDepB0, Test) -{ - - uint8_t encoded_frame[] = {85,3,12,66,0,186,1,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,136,19,0,0,114,20,0,0,92,21,0,0,70,22,0,0,48,23,0,0,26,24,0,0,4,25,0,0,238,25,0,0,216,26,0,0,194,27,0,0,172,28,0,0,150,29,0,0,128,30,0,0,106,31,0,0,84,32,0,0,62,33,0,0,40,34,0,0,18,35,0,0,252,35,0,0,230,36,0,0,208,37,0,0,186,38,0,0,164,39,0,0,142,40,0,0,120,41,0,0,238,145, }; - - sbp_msg_ed25519_signature_dep_b_t test_msg{}; - - test_msg.fingerprint[0] = 100; - - test_msg.fingerprint[1] = 101; - - test_msg.fingerprint[2] = 102; - - test_msg.fingerprint[3] = 103; - - test_msg.fingerprint[4] = 104; - - test_msg.fingerprint[5] = 105; - - test_msg.fingerprint[6] = 106; - - test_msg.fingerprint[7] = 107; - - test_msg.fingerprint[8] = 108; - - test_msg.fingerprint[9] = 109; - - test_msg.fingerprint[10] = 110; - - test_msg.fingerprint[11] = 111; - - test_msg.fingerprint[12] = 112; - - test_msg.fingerprint[13] = 113; - - test_msg.fingerprint[14] = 114; - - test_msg.fingerprint[15] = 115; - - test_msg.fingerprint[16] = 116; - - test_msg.fingerprint[17] = 117; - - test_msg.fingerprint[18] = 118; - - test_msg.fingerprint[19] = 119; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_signed_messages.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)105,(char)103,(char)110,(char)101,(char)100,(char)95,(char)109,(char)101,(char)115,(char)115,(char)97,(char)103,(char)101,(char)115 }; - memcpy(test_msg.n_signed_messages.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_signed_messages.value = 25; - test_msg.on_demand_counter = 0; - - test_msg.signature[0] = 0; - - test_msg.signature[1] = 1; - - test_msg.signature[2] = 2; - - test_msg.signature[3] = 3; - - test_msg.signature[4] = 4; - - test_msg.signature[5] = 5; - - test_msg.signature[6] = 6; - - test_msg.signature[7] = 7; - - test_msg.signature[8] = 8; - - test_msg.signature[9] = 9; - - test_msg.signature[10] = 10; - - test_msg.signature[11] = 11; - - test_msg.signature[12] = 12; - - test_msg.signature[13] = 13; - - test_msg.signature[14] = 14; - - test_msg.signature[15] = 15; - - test_msg.signature[16] = 16; - - test_msg.signature[17] = 17; - - test_msg.signature[18] = 18; - - test_msg.signature[19] = 19; - - test_msg.signature[20] = 20; - - test_msg.signature[21] = 21; - - test_msg.signature[22] = 22; - - test_msg.signature[23] = 23; - - test_msg.signature[24] = 24; - - test_msg.signature[25] = 25; - - test_msg.signature[26] = 26; - - test_msg.signature[27] = 27; - - test_msg.signature[28] = 28; - - test_msg.signature[29] = 29; - - test_msg.signature[30] = 30; - - test_msg.signature[31] = 31; - - test_msg.signature[32] = 32; - - test_msg.signature[33] = 33; - - test_msg.signature[34] = 34; - - test_msg.signature[35] = 35; - - test_msg.signature[36] = 36; - - test_msg.signature[37] = 37; - - test_msg.signature[38] = 38; - - test_msg.signature[39] = 39; - - test_msg.signature[40] = 40; - - test_msg.signature[41] = 41; - - test_msg.signature[42] = 42; - - test_msg.signature[43] = 43; - - test_msg.signature[44] = 44; - - test_msg.signature[45] = 45; - - test_msg.signature[46] = 46; - - test_msg.signature[47] = 47; - - test_msg.signature[48] = 48; - - test_msg.signature[49] = 49; - - test_msg.signature[50] = 50; - - test_msg.signature[51] = 51; - - test_msg.signature[52] = 52; - - test_msg.signature[53] = 53; - - test_msg.signature[54] = 54; - - test_msg.signature[55] = 55; - - test_msg.signature[56] = 56; - - test_msg.signature[57] = 57; - - test_msg.signature[58] = 58; - - test_msg.signature[59] = 59; - - test_msg.signature[60] = 60; - - test_msg.signature[61] = 61; - - test_msg.signature[62] = 62; - - test_msg.signature[63] = 63; - - test_msg.signed_messages[0] = 5000; - - test_msg.signed_messages[1] = 5234; - - test_msg.signed_messages[2] = 5468; - - test_msg.signed_messages[3] = 5702; - - test_msg.signed_messages[4] = 5936; - - test_msg.signed_messages[5] = 6170; - - test_msg.signed_messages[6] = 6404; - - test_msg.signed_messages[7] = 6638; - - test_msg.signed_messages[8] = 6872; - - test_msg.signed_messages[9] = 7106; - - test_msg.signed_messages[10] = 7340; - - test_msg.signed_messages[11] = 7574; - - test_msg.signed_messages[12] = 7808; - - test_msg.signed_messages[13] = 8042; - - test_msg.signed_messages[14] = 8276; - - test_msg.signed_messages[15] = 8510; - - test_msg.signed_messages[16] = 8744; - - test_msg.signed_messages[17] = 8978; - - test_msg.signed_messages[18] = 9212; - - test_msg.signed_messages[19] = 9446; - - test_msg.signed_messages[20] = 9680; - - test_msg.signed_messages[21] = 9914; - - test_msg.signed_messages[22] = 10148; - - test_msg.signed_messages[23] = 10382; - - test_msg.signed_messages[24] = 10616; - test_msg.stream_counter = 1; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.fingerprint[0], 100) << "incorrect value for last_msg_.fingerprint[0], expected 100, is " << last_msg_.fingerprint[0]; - EXPECT_EQ(last_msg_.fingerprint[1], 101) << "incorrect value for last_msg_.fingerprint[1], expected 101, is " << last_msg_.fingerprint[1]; - EXPECT_EQ(last_msg_.fingerprint[2], 102) << "incorrect value for last_msg_.fingerprint[2], expected 102, is " << last_msg_.fingerprint[2]; - EXPECT_EQ(last_msg_.fingerprint[3], 103) << "incorrect value for last_msg_.fingerprint[3], expected 103, is " << last_msg_.fingerprint[3]; - EXPECT_EQ(last_msg_.fingerprint[4], 104) << "incorrect value for last_msg_.fingerprint[4], expected 104, is " << last_msg_.fingerprint[4]; - EXPECT_EQ(last_msg_.fingerprint[5], 105) << "incorrect value for last_msg_.fingerprint[5], expected 105, is " << last_msg_.fingerprint[5]; - EXPECT_EQ(last_msg_.fingerprint[6], 106) << "incorrect value for last_msg_.fingerprint[6], expected 106, is " << last_msg_.fingerprint[6]; - EXPECT_EQ(last_msg_.fingerprint[7], 107) << "incorrect value for last_msg_.fingerprint[7], expected 107, is " << last_msg_.fingerprint[7]; - EXPECT_EQ(last_msg_.fingerprint[8], 108) << "incorrect value for last_msg_.fingerprint[8], expected 108, is " << last_msg_.fingerprint[8]; - EXPECT_EQ(last_msg_.fingerprint[9], 109) << "incorrect value for last_msg_.fingerprint[9], expected 109, is " << last_msg_.fingerprint[9]; - EXPECT_EQ(last_msg_.fingerprint[10], 110) << "incorrect value for last_msg_.fingerprint[10], expected 110, is " << last_msg_.fingerprint[10]; - EXPECT_EQ(last_msg_.fingerprint[11], 111) << "incorrect value for last_msg_.fingerprint[11], expected 111, is " << last_msg_.fingerprint[11]; - EXPECT_EQ(last_msg_.fingerprint[12], 112) << "incorrect value for last_msg_.fingerprint[12], expected 112, is " << last_msg_.fingerprint[12]; - EXPECT_EQ(last_msg_.fingerprint[13], 113) << "incorrect value for last_msg_.fingerprint[13], expected 113, is " << last_msg_.fingerprint[13]; - EXPECT_EQ(last_msg_.fingerprint[14], 114) << "incorrect value for last_msg_.fingerprint[14], expected 114, is " << last_msg_.fingerprint[14]; - EXPECT_EQ(last_msg_.fingerprint[15], 115) << "incorrect value for last_msg_.fingerprint[15], expected 115, is " << last_msg_.fingerprint[15]; - EXPECT_EQ(last_msg_.fingerprint[16], 116) << "incorrect value for last_msg_.fingerprint[16], expected 116, is " << last_msg_.fingerprint[16]; - EXPECT_EQ(last_msg_.fingerprint[17], 117) << "incorrect value for last_msg_.fingerprint[17], expected 117, is " << last_msg_.fingerprint[17]; - EXPECT_EQ(last_msg_.fingerprint[18], 118) << "incorrect value for last_msg_.fingerprint[18], expected 118, is " << last_msg_.fingerprint[18]; - EXPECT_EQ(last_msg_.fingerprint[19], 119) << "incorrect value for last_msg_.fingerprint[19], expected 119, is " << last_msg_.fingerprint[19]; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_signed_messages.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_signed_messages.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_signed_messages.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)105,(char)103,(char)110,(char)101,(char)100,(char)95,(char)109,(char)101,(char)115,(char)115,(char)97,(char)103,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_signed_messages.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_signed_messages.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_signed_messages.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_signed_messages.value, 25) << "incorrect value for last_msg_.n_signed_messages.value, expected 25, is " << last_msg_.n_signed_messages.value; - EXPECT_EQ(last_msg_.on_demand_counter, 0) << "incorrect value for last_msg_.on_demand_counter, expected 0, is " << last_msg_.on_demand_counter; - EXPECT_EQ(last_msg_.signature[0], 0) << "incorrect value for last_msg_.signature[0], expected 0, is " << last_msg_.signature[0]; - EXPECT_EQ(last_msg_.signature[1], 1) << "incorrect value for last_msg_.signature[1], expected 1, is " << last_msg_.signature[1]; - EXPECT_EQ(last_msg_.signature[2], 2) << "incorrect value for last_msg_.signature[2], expected 2, is " << last_msg_.signature[2]; - EXPECT_EQ(last_msg_.signature[3], 3) << "incorrect value for last_msg_.signature[3], expected 3, is " << last_msg_.signature[3]; - EXPECT_EQ(last_msg_.signature[4], 4) << "incorrect value for last_msg_.signature[4], expected 4, is " << last_msg_.signature[4]; - EXPECT_EQ(last_msg_.signature[5], 5) << "incorrect value for last_msg_.signature[5], expected 5, is " << last_msg_.signature[5]; - EXPECT_EQ(last_msg_.signature[6], 6) << "incorrect value for last_msg_.signature[6], expected 6, is " << last_msg_.signature[6]; - EXPECT_EQ(last_msg_.signature[7], 7) << "incorrect value for last_msg_.signature[7], expected 7, is " << last_msg_.signature[7]; - EXPECT_EQ(last_msg_.signature[8], 8) << "incorrect value for last_msg_.signature[8], expected 8, is " << last_msg_.signature[8]; - EXPECT_EQ(last_msg_.signature[9], 9) << "incorrect value for last_msg_.signature[9], expected 9, is " << last_msg_.signature[9]; - EXPECT_EQ(last_msg_.signature[10], 10) << "incorrect value for last_msg_.signature[10], expected 10, is " << last_msg_.signature[10]; - EXPECT_EQ(last_msg_.signature[11], 11) << "incorrect value for last_msg_.signature[11], expected 11, is " << last_msg_.signature[11]; - EXPECT_EQ(last_msg_.signature[12], 12) << "incorrect value for last_msg_.signature[12], expected 12, is " << last_msg_.signature[12]; - EXPECT_EQ(last_msg_.signature[13], 13) << "incorrect value for last_msg_.signature[13], expected 13, is " << last_msg_.signature[13]; - EXPECT_EQ(last_msg_.signature[14], 14) << "incorrect value for last_msg_.signature[14], expected 14, is " << last_msg_.signature[14]; - EXPECT_EQ(last_msg_.signature[15], 15) << "incorrect value for last_msg_.signature[15], expected 15, is " << last_msg_.signature[15]; - EXPECT_EQ(last_msg_.signature[16], 16) << "incorrect value for last_msg_.signature[16], expected 16, is " << last_msg_.signature[16]; - EXPECT_EQ(last_msg_.signature[17], 17) << "incorrect value for last_msg_.signature[17], expected 17, is " << last_msg_.signature[17]; - EXPECT_EQ(last_msg_.signature[18], 18) << "incorrect value for last_msg_.signature[18], expected 18, is " << last_msg_.signature[18]; - EXPECT_EQ(last_msg_.signature[19], 19) << "incorrect value for last_msg_.signature[19], expected 19, is " << last_msg_.signature[19]; - EXPECT_EQ(last_msg_.signature[20], 20) << "incorrect value for last_msg_.signature[20], expected 20, is " << last_msg_.signature[20]; - EXPECT_EQ(last_msg_.signature[21], 21) << "incorrect value for last_msg_.signature[21], expected 21, is " << last_msg_.signature[21]; - EXPECT_EQ(last_msg_.signature[22], 22) << "incorrect value for last_msg_.signature[22], expected 22, is " << last_msg_.signature[22]; - EXPECT_EQ(last_msg_.signature[23], 23) << "incorrect value for last_msg_.signature[23], expected 23, is " << last_msg_.signature[23]; - EXPECT_EQ(last_msg_.signature[24], 24) << "incorrect value for last_msg_.signature[24], expected 24, is " << last_msg_.signature[24]; - EXPECT_EQ(last_msg_.signature[25], 25) << "incorrect value for last_msg_.signature[25], expected 25, is " << last_msg_.signature[25]; - EXPECT_EQ(last_msg_.signature[26], 26) << "incorrect value for last_msg_.signature[26], expected 26, is " << last_msg_.signature[26]; - EXPECT_EQ(last_msg_.signature[27], 27) << "incorrect value for last_msg_.signature[27], expected 27, is " << last_msg_.signature[27]; - EXPECT_EQ(last_msg_.signature[28], 28) << "incorrect value for last_msg_.signature[28], expected 28, is " << last_msg_.signature[28]; - EXPECT_EQ(last_msg_.signature[29], 29) << "incorrect value for last_msg_.signature[29], expected 29, is " << last_msg_.signature[29]; - EXPECT_EQ(last_msg_.signature[30], 30) << "incorrect value for last_msg_.signature[30], expected 30, is " << last_msg_.signature[30]; - EXPECT_EQ(last_msg_.signature[31], 31) << "incorrect value for last_msg_.signature[31], expected 31, is " << last_msg_.signature[31]; - EXPECT_EQ(last_msg_.signature[32], 32) << "incorrect value for last_msg_.signature[32], expected 32, is " << last_msg_.signature[32]; - EXPECT_EQ(last_msg_.signature[33], 33) << "incorrect value for last_msg_.signature[33], expected 33, is " << last_msg_.signature[33]; - EXPECT_EQ(last_msg_.signature[34], 34) << "incorrect value for last_msg_.signature[34], expected 34, is " << last_msg_.signature[34]; - EXPECT_EQ(last_msg_.signature[35], 35) << "incorrect value for last_msg_.signature[35], expected 35, is " << last_msg_.signature[35]; - EXPECT_EQ(last_msg_.signature[36], 36) << "incorrect value for last_msg_.signature[36], expected 36, is " << last_msg_.signature[36]; - EXPECT_EQ(last_msg_.signature[37], 37) << "incorrect value for last_msg_.signature[37], expected 37, is " << last_msg_.signature[37]; - EXPECT_EQ(last_msg_.signature[38], 38) << "incorrect value for last_msg_.signature[38], expected 38, is " << last_msg_.signature[38]; - EXPECT_EQ(last_msg_.signature[39], 39) << "incorrect value for last_msg_.signature[39], expected 39, is " << last_msg_.signature[39]; - EXPECT_EQ(last_msg_.signature[40], 40) << "incorrect value for last_msg_.signature[40], expected 40, is " << last_msg_.signature[40]; - EXPECT_EQ(last_msg_.signature[41], 41) << "incorrect value for last_msg_.signature[41], expected 41, is " << last_msg_.signature[41]; - EXPECT_EQ(last_msg_.signature[42], 42) << "incorrect value for last_msg_.signature[42], expected 42, is " << last_msg_.signature[42]; - EXPECT_EQ(last_msg_.signature[43], 43) << "incorrect value for last_msg_.signature[43], expected 43, is " << last_msg_.signature[43]; - EXPECT_EQ(last_msg_.signature[44], 44) << "incorrect value for last_msg_.signature[44], expected 44, is " << last_msg_.signature[44]; - EXPECT_EQ(last_msg_.signature[45], 45) << "incorrect value for last_msg_.signature[45], expected 45, is " << last_msg_.signature[45]; - EXPECT_EQ(last_msg_.signature[46], 46) << "incorrect value for last_msg_.signature[46], expected 46, is " << last_msg_.signature[46]; - EXPECT_EQ(last_msg_.signature[47], 47) << "incorrect value for last_msg_.signature[47], expected 47, is " << last_msg_.signature[47]; - EXPECT_EQ(last_msg_.signature[48], 48) << "incorrect value for last_msg_.signature[48], expected 48, is " << last_msg_.signature[48]; - EXPECT_EQ(last_msg_.signature[49], 49) << "incorrect value for last_msg_.signature[49], expected 49, is " << last_msg_.signature[49]; - EXPECT_EQ(last_msg_.signature[50], 50) << "incorrect value for last_msg_.signature[50], expected 50, is " << last_msg_.signature[50]; - EXPECT_EQ(last_msg_.signature[51], 51) << "incorrect value for last_msg_.signature[51], expected 51, is " << last_msg_.signature[51]; - EXPECT_EQ(last_msg_.signature[52], 52) << "incorrect value for last_msg_.signature[52], expected 52, is " << last_msg_.signature[52]; - EXPECT_EQ(last_msg_.signature[53], 53) << "incorrect value for last_msg_.signature[53], expected 53, is " << last_msg_.signature[53]; - EXPECT_EQ(last_msg_.signature[54], 54) << "incorrect value for last_msg_.signature[54], expected 54, is " << last_msg_.signature[54]; - EXPECT_EQ(last_msg_.signature[55], 55) << "incorrect value for last_msg_.signature[55], expected 55, is " << last_msg_.signature[55]; - EXPECT_EQ(last_msg_.signature[56], 56) << "incorrect value for last_msg_.signature[56], expected 56, is " << last_msg_.signature[56]; - EXPECT_EQ(last_msg_.signature[57], 57) << "incorrect value for last_msg_.signature[57], expected 57, is " << last_msg_.signature[57]; - EXPECT_EQ(last_msg_.signature[58], 58) << "incorrect value for last_msg_.signature[58], expected 58, is " << last_msg_.signature[58]; - EXPECT_EQ(last_msg_.signature[59], 59) << "incorrect value for last_msg_.signature[59], expected 59, is " << last_msg_.signature[59]; - EXPECT_EQ(last_msg_.signature[60], 60) << "incorrect value for last_msg_.signature[60], expected 60, is " << last_msg_.signature[60]; - EXPECT_EQ(last_msg_.signature[61], 61) << "incorrect value for last_msg_.signature[61], expected 61, is " << last_msg_.signature[61]; - EXPECT_EQ(last_msg_.signature[62], 62) << "incorrect value for last_msg_.signature[62], expected 62, is " << last_msg_.signature[62]; - EXPECT_EQ(last_msg_.signature[63], 63) << "incorrect value for last_msg_.signature[63], expected 63, is " << last_msg_.signature[63]; - EXPECT_EQ(last_msg_.signed_messages[0], 5000) << "incorrect value for last_msg_.signed_messages[0], expected 5000, is " << last_msg_.signed_messages[0]; - EXPECT_EQ(last_msg_.signed_messages[1], 5234) << "incorrect value for last_msg_.signed_messages[1], expected 5234, is " << last_msg_.signed_messages[1]; - EXPECT_EQ(last_msg_.signed_messages[2], 5468) << "incorrect value for last_msg_.signed_messages[2], expected 5468, is " << last_msg_.signed_messages[2]; - EXPECT_EQ(last_msg_.signed_messages[3], 5702) << "incorrect value for last_msg_.signed_messages[3], expected 5702, is " << last_msg_.signed_messages[3]; - EXPECT_EQ(last_msg_.signed_messages[4], 5936) << "incorrect value for last_msg_.signed_messages[4], expected 5936, is " << last_msg_.signed_messages[4]; - EXPECT_EQ(last_msg_.signed_messages[5], 6170) << "incorrect value for last_msg_.signed_messages[5], expected 6170, is " << last_msg_.signed_messages[5]; - EXPECT_EQ(last_msg_.signed_messages[6], 6404) << "incorrect value for last_msg_.signed_messages[6], expected 6404, is " << last_msg_.signed_messages[6]; - EXPECT_EQ(last_msg_.signed_messages[7], 6638) << "incorrect value for last_msg_.signed_messages[7], expected 6638, is " << last_msg_.signed_messages[7]; - EXPECT_EQ(last_msg_.signed_messages[8], 6872) << "incorrect value for last_msg_.signed_messages[8], expected 6872, is " << last_msg_.signed_messages[8]; - EXPECT_EQ(last_msg_.signed_messages[9], 7106) << "incorrect value for last_msg_.signed_messages[9], expected 7106, is " << last_msg_.signed_messages[9]; - EXPECT_EQ(last_msg_.signed_messages[10], 7340) << "incorrect value for last_msg_.signed_messages[10], expected 7340, is " << last_msg_.signed_messages[10]; - EXPECT_EQ(last_msg_.signed_messages[11], 7574) << "incorrect value for last_msg_.signed_messages[11], expected 7574, is " << last_msg_.signed_messages[11]; - EXPECT_EQ(last_msg_.signed_messages[12], 7808) << "incorrect value for last_msg_.signed_messages[12], expected 7808, is " << last_msg_.signed_messages[12]; - EXPECT_EQ(last_msg_.signed_messages[13], 8042) << "incorrect value for last_msg_.signed_messages[13], expected 8042, is " << last_msg_.signed_messages[13]; - EXPECT_EQ(last_msg_.signed_messages[14], 8276) << "incorrect value for last_msg_.signed_messages[14], expected 8276, is " << last_msg_.signed_messages[14]; - EXPECT_EQ(last_msg_.signed_messages[15], 8510) << "incorrect value for last_msg_.signed_messages[15], expected 8510, is " << last_msg_.signed_messages[15]; - EXPECT_EQ(last_msg_.signed_messages[16], 8744) << "incorrect value for last_msg_.signed_messages[16], expected 8744, is " << last_msg_.signed_messages[16]; - EXPECT_EQ(last_msg_.signed_messages[17], 8978) << "incorrect value for last_msg_.signed_messages[17], expected 8978, is " << last_msg_.signed_messages[17]; - EXPECT_EQ(last_msg_.signed_messages[18], 9212) << "incorrect value for last_msg_.signed_messages[18], expected 9212, is " << last_msg_.signed_messages[18]; - EXPECT_EQ(last_msg_.signed_messages[19], 9446) << "incorrect value for last_msg_.signed_messages[19], expected 9446, is " << last_msg_.signed_messages[19]; - EXPECT_EQ(last_msg_.signed_messages[20], 9680) << "incorrect value for last_msg_.signed_messages[20], expected 9680, is " << last_msg_.signed_messages[20]; - EXPECT_EQ(last_msg_.signed_messages[21], 9914) << "incorrect value for last_msg_.signed_messages[21], expected 9914, is " << last_msg_.signed_messages[21]; - EXPECT_EQ(last_msg_.signed_messages[22], 10148) << "incorrect value for last_msg_.signed_messages[22], expected 10148, is " << last_msg_.signed_messages[22]; - EXPECT_EQ(last_msg_.signed_messages[23], 10382) << "incorrect value for last_msg_.signed_messages[23], expected 10382, is " << last_msg_.signed_messages[23]; - EXPECT_EQ(last_msg_.signed_messages[24], 10616) << "incorrect value for last_msg_.signed_messages[24], expected 10616, is " << last_msg_.signed_messages[24]; - EXPECT_EQ(last_msg_.stream_counter, 1) << "incorrect value for last_msg_.stream_counter, expected 1, is " << last_msg_.stream_counter; +}; + +TEST_F(Test_auto_check_sbp_signing_MsgEd25519SignatureDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 3, 12, 66, 0, 186, 1, 0, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 136, 19, 0, 0, 114, 20, 0, 0, 92, 21, 0, 0, 70, + 22, 0, 0, 48, 23, 0, 0, 26, 24, 0, 0, 4, 25, 0, 0, + 238, 25, 0, 0, 216, 26, 0, 0, 194, 27, 0, 0, 172, 28, 0, + 0, 150, 29, 0, 0, 128, 30, 0, 0, 106, 31, 0, 0, 84, 32, + 0, 0, 62, 33, 0, 0, 40, 34, 0, 0, 18, 35, 0, 0, 252, + 35, 0, 0, 230, 36, 0, 0, 208, 37, 0, 0, 186, 38, 0, 0, + 164, 39, 0, 0, 142, 40, 0, 0, 120, 41, 0, 0, 238, 145, + }; + + sbp_msg_ed25519_signature_dep_b_t test_msg{}; + + test_msg.fingerprint[0] = 100; + + test_msg.fingerprint[1] = 101; + + test_msg.fingerprint[2] = 102; + + test_msg.fingerprint[3] = 103; + + test_msg.fingerprint[4] = 104; + + test_msg.fingerprint[5] = 105; + + test_msg.fingerprint[6] = 106; + + test_msg.fingerprint[7] = 107; + + test_msg.fingerprint[8] = 108; + + test_msg.fingerprint[9] = 109; + + test_msg.fingerprint[10] = 110; + + test_msg.fingerprint[11] = 111; + + test_msg.fingerprint[12] = 112; + + test_msg.fingerprint[13] = 113; + + test_msg.fingerprint[14] = 114; + + test_msg.fingerprint[15] = 115; + + test_msg.fingerprint[16] = 116; + + test_msg.fingerprint[17] = 117; + + test_msg.fingerprint[18] = 118; + + test_msg.fingerprint[19] = 119; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_signed_messages.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)105, (char)103, (char)110, + (char)101, (char)100, (char)95, (char)109, + (char)101, (char)115, (char)115, (char)97, + (char)103, (char)101, (char)115}; + memcpy(test_msg.n_signed_messages.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_signed_messages.value = 25; + test_msg.on_demand_counter = 0; + + test_msg.signature[0] = 0; + + test_msg.signature[1] = 1; + + test_msg.signature[2] = 2; + + test_msg.signature[3] = 3; + + test_msg.signature[4] = 4; + + test_msg.signature[5] = 5; + + test_msg.signature[6] = 6; + + test_msg.signature[7] = 7; + + test_msg.signature[8] = 8; + + test_msg.signature[9] = 9; + + test_msg.signature[10] = 10; + + test_msg.signature[11] = 11; + + test_msg.signature[12] = 12; + + test_msg.signature[13] = 13; + + test_msg.signature[14] = 14; + + test_msg.signature[15] = 15; + + test_msg.signature[16] = 16; + + test_msg.signature[17] = 17; + + test_msg.signature[18] = 18; + + test_msg.signature[19] = 19; + + test_msg.signature[20] = 20; + + test_msg.signature[21] = 21; + + test_msg.signature[22] = 22; + + test_msg.signature[23] = 23; + + test_msg.signature[24] = 24; + + test_msg.signature[25] = 25; + + test_msg.signature[26] = 26; + + test_msg.signature[27] = 27; + + test_msg.signature[28] = 28; + + test_msg.signature[29] = 29; + + test_msg.signature[30] = 30; + + test_msg.signature[31] = 31; + + test_msg.signature[32] = 32; + + test_msg.signature[33] = 33; + + test_msg.signature[34] = 34; + + test_msg.signature[35] = 35; + + test_msg.signature[36] = 36; + + test_msg.signature[37] = 37; + + test_msg.signature[38] = 38; + + test_msg.signature[39] = 39; + + test_msg.signature[40] = 40; + + test_msg.signature[41] = 41; + + test_msg.signature[42] = 42; + + test_msg.signature[43] = 43; + + test_msg.signature[44] = 44; + + test_msg.signature[45] = 45; + + test_msg.signature[46] = 46; + + test_msg.signature[47] = 47; + + test_msg.signature[48] = 48; + + test_msg.signature[49] = 49; + + test_msg.signature[50] = 50; + + test_msg.signature[51] = 51; + + test_msg.signature[52] = 52; + + test_msg.signature[53] = 53; + + test_msg.signature[54] = 54; + + test_msg.signature[55] = 55; + + test_msg.signature[56] = 56; + + test_msg.signature[57] = 57; + + test_msg.signature[58] = 58; + + test_msg.signature[59] = 59; + + test_msg.signature[60] = 60; + + test_msg.signature[61] = 61; + + test_msg.signature[62] = 62; + + test_msg.signature[63] = 63; + + test_msg.signed_messages[0] = 5000; + + test_msg.signed_messages[1] = 5234; + + test_msg.signed_messages[2] = 5468; + + test_msg.signed_messages[3] = 5702; + + test_msg.signed_messages[4] = 5936; + + test_msg.signed_messages[5] = 6170; + + test_msg.signed_messages[6] = 6404; + + test_msg.signed_messages[7] = 6638; + + test_msg.signed_messages[8] = 6872; + + test_msg.signed_messages[9] = 7106; + + test_msg.signed_messages[10] = 7340; + + test_msg.signed_messages[11] = 7574; + + test_msg.signed_messages[12] = 7808; + + test_msg.signed_messages[13] = 8042; + + test_msg.signed_messages[14] = 8276; + + test_msg.signed_messages[15] = 8510; + + test_msg.signed_messages[16] = 8744; + + test_msg.signed_messages[17] = 8978; + + test_msg.signed_messages[18] = 9212; + + test_msg.signed_messages[19] = 9446; + + test_msg.signed_messages[20] = 9680; + + test_msg.signed_messages[21] = 9914; + + test_msg.signed_messages[22] = 10148; + + test_msg.signed_messages[23] = 10382; + + test_msg.signed_messages[24] = 10616; + test_msg.stream_counter = 1; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.fingerprint[0], 100) + << "incorrect value for last_msg_.fingerprint[0], expected 100, is " + << last_msg_.fingerprint[0]; + EXPECT_EQ(last_msg_.fingerprint[1], 101) + << "incorrect value for last_msg_.fingerprint[1], expected 101, is " + << last_msg_.fingerprint[1]; + EXPECT_EQ(last_msg_.fingerprint[2], 102) + << "incorrect value for last_msg_.fingerprint[2], expected 102, is " + << last_msg_.fingerprint[2]; + EXPECT_EQ(last_msg_.fingerprint[3], 103) + << "incorrect value for last_msg_.fingerprint[3], expected 103, is " + << last_msg_.fingerprint[3]; + EXPECT_EQ(last_msg_.fingerprint[4], 104) + << "incorrect value for last_msg_.fingerprint[4], expected 104, is " + << last_msg_.fingerprint[4]; + EXPECT_EQ(last_msg_.fingerprint[5], 105) + << "incorrect value for last_msg_.fingerprint[5], expected 105, is " + << last_msg_.fingerprint[5]; + EXPECT_EQ(last_msg_.fingerprint[6], 106) + << "incorrect value for last_msg_.fingerprint[6], expected 106, is " + << last_msg_.fingerprint[6]; + EXPECT_EQ(last_msg_.fingerprint[7], 107) + << "incorrect value for last_msg_.fingerprint[7], expected 107, is " + << last_msg_.fingerprint[7]; + EXPECT_EQ(last_msg_.fingerprint[8], 108) + << "incorrect value for last_msg_.fingerprint[8], expected 108, is " + << last_msg_.fingerprint[8]; + EXPECT_EQ(last_msg_.fingerprint[9], 109) + << "incorrect value for last_msg_.fingerprint[9], expected 109, is " + << last_msg_.fingerprint[9]; + EXPECT_EQ(last_msg_.fingerprint[10], 110) + << "incorrect value for last_msg_.fingerprint[10], expected 110, is " + << last_msg_.fingerprint[10]; + EXPECT_EQ(last_msg_.fingerprint[11], 111) + << "incorrect value for last_msg_.fingerprint[11], expected 111, is " + << last_msg_.fingerprint[11]; + EXPECT_EQ(last_msg_.fingerprint[12], 112) + << "incorrect value for last_msg_.fingerprint[12], expected 112, is " + << last_msg_.fingerprint[12]; + EXPECT_EQ(last_msg_.fingerprint[13], 113) + << "incorrect value for last_msg_.fingerprint[13], expected 113, is " + << last_msg_.fingerprint[13]; + EXPECT_EQ(last_msg_.fingerprint[14], 114) + << "incorrect value for last_msg_.fingerprint[14], expected 114, is " + << last_msg_.fingerprint[14]; + EXPECT_EQ(last_msg_.fingerprint[15], 115) + << "incorrect value for last_msg_.fingerprint[15], expected 115, is " + << last_msg_.fingerprint[15]; + EXPECT_EQ(last_msg_.fingerprint[16], 116) + << "incorrect value for last_msg_.fingerprint[16], expected 116, is " + << last_msg_.fingerprint[16]; + EXPECT_EQ(last_msg_.fingerprint[17], 117) + << "incorrect value for last_msg_.fingerprint[17], expected 117, is " + << last_msg_.fingerprint[17]; + EXPECT_EQ(last_msg_.fingerprint[18], 118) + << "incorrect value for last_msg_.fingerprint[18], expected 118, is " + << last_msg_.fingerprint[18]; + EXPECT_EQ(last_msg_.fingerprint[19], 119) + << "incorrect value for last_msg_.fingerprint[19], expected 119, is " + << last_msg_.fingerprint[19]; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_signed_messages.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_signed_messages.handle_as, " + "expected string '" + << check_string << "', is '" << last_msg_.n_signed_messages.handle_as + << "'"; + } + { + const char check_string[] = {(char)115, (char)105, (char)103, (char)110, + (char)101, (char)100, (char)95, (char)109, + (char)101, (char)115, (char)115, (char)97, + (char)103, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_signed_messages.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_signed_messages.relates_to, " + "expected string '" + << check_string << "', is '" << last_msg_.n_signed_messages.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_signed_messages.value, 25) + << "incorrect value for last_msg_.n_signed_messages.value, expected 25, " + "is " + << last_msg_.n_signed_messages.value; + EXPECT_EQ(last_msg_.on_demand_counter, 0) + << "incorrect value for last_msg_.on_demand_counter, expected 0, is " + << last_msg_.on_demand_counter; + EXPECT_EQ(last_msg_.signature[0], 0) + << "incorrect value for last_msg_.signature[0], expected 0, is " + << last_msg_.signature[0]; + EXPECT_EQ(last_msg_.signature[1], 1) + << "incorrect value for last_msg_.signature[1], expected 1, is " + << last_msg_.signature[1]; + EXPECT_EQ(last_msg_.signature[2], 2) + << "incorrect value for last_msg_.signature[2], expected 2, is " + << last_msg_.signature[2]; + EXPECT_EQ(last_msg_.signature[3], 3) + << "incorrect value for last_msg_.signature[3], expected 3, is " + << last_msg_.signature[3]; + EXPECT_EQ(last_msg_.signature[4], 4) + << "incorrect value for last_msg_.signature[4], expected 4, is " + << last_msg_.signature[4]; + EXPECT_EQ(last_msg_.signature[5], 5) + << "incorrect value for last_msg_.signature[5], expected 5, is " + << last_msg_.signature[5]; + EXPECT_EQ(last_msg_.signature[6], 6) + << "incorrect value for last_msg_.signature[6], expected 6, is " + << last_msg_.signature[6]; + EXPECT_EQ(last_msg_.signature[7], 7) + << "incorrect value for last_msg_.signature[7], expected 7, is " + << last_msg_.signature[7]; + EXPECT_EQ(last_msg_.signature[8], 8) + << "incorrect value for last_msg_.signature[8], expected 8, is " + << last_msg_.signature[8]; + EXPECT_EQ(last_msg_.signature[9], 9) + << "incorrect value for last_msg_.signature[9], expected 9, is " + << last_msg_.signature[9]; + EXPECT_EQ(last_msg_.signature[10], 10) + << "incorrect value for last_msg_.signature[10], expected 10, is " + << last_msg_.signature[10]; + EXPECT_EQ(last_msg_.signature[11], 11) + << "incorrect value for last_msg_.signature[11], expected 11, is " + << last_msg_.signature[11]; + EXPECT_EQ(last_msg_.signature[12], 12) + << "incorrect value for last_msg_.signature[12], expected 12, is " + << last_msg_.signature[12]; + EXPECT_EQ(last_msg_.signature[13], 13) + << "incorrect value for last_msg_.signature[13], expected 13, is " + << last_msg_.signature[13]; + EXPECT_EQ(last_msg_.signature[14], 14) + << "incorrect value for last_msg_.signature[14], expected 14, is " + << last_msg_.signature[14]; + EXPECT_EQ(last_msg_.signature[15], 15) + << "incorrect value for last_msg_.signature[15], expected 15, is " + << last_msg_.signature[15]; + EXPECT_EQ(last_msg_.signature[16], 16) + << "incorrect value for last_msg_.signature[16], expected 16, is " + << last_msg_.signature[16]; + EXPECT_EQ(last_msg_.signature[17], 17) + << "incorrect value for last_msg_.signature[17], expected 17, is " + << last_msg_.signature[17]; + EXPECT_EQ(last_msg_.signature[18], 18) + << "incorrect value for last_msg_.signature[18], expected 18, is " + << last_msg_.signature[18]; + EXPECT_EQ(last_msg_.signature[19], 19) + << "incorrect value for last_msg_.signature[19], expected 19, is " + << last_msg_.signature[19]; + EXPECT_EQ(last_msg_.signature[20], 20) + << "incorrect value for last_msg_.signature[20], expected 20, is " + << last_msg_.signature[20]; + EXPECT_EQ(last_msg_.signature[21], 21) + << "incorrect value for last_msg_.signature[21], expected 21, is " + << last_msg_.signature[21]; + EXPECT_EQ(last_msg_.signature[22], 22) + << "incorrect value for last_msg_.signature[22], expected 22, is " + << last_msg_.signature[22]; + EXPECT_EQ(last_msg_.signature[23], 23) + << "incorrect value for last_msg_.signature[23], expected 23, is " + << last_msg_.signature[23]; + EXPECT_EQ(last_msg_.signature[24], 24) + << "incorrect value for last_msg_.signature[24], expected 24, is " + << last_msg_.signature[24]; + EXPECT_EQ(last_msg_.signature[25], 25) + << "incorrect value for last_msg_.signature[25], expected 25, is " + << last_msg_.signature[25]; + EXPECT_EQ(last_msg_.signature[26], 26) + << "incorrect value for last_msg_.signature[26], expected 26, is " + << last_msg_.signature[26]; + EXPECT_EQ(last_msg_.signature[27], 27) + << "incorrect value for last_msg_.signature[27], expected 27, is " + << last_msg_.signature[27]; + EXPECT_EQ(last_msg_.signature[28], 28) + << "incorrect value for last_msg_.signature[28], expected 28, is " + << last_msg_.signature[28]; + EXPECT_EQ(last_msg_.signature[29], 29) + << "incorrect value for last_msg_.signature[29], expected 29, is " + << last_msg_.signature[29]; + EXPECT_EQ(last_msg_.signature[30], 30) + << "incorrect value for last_msg_.signature[30], expected 30, is " + << last_msg_.signature[30]; + EXPECT_EQ(last_msg_.signature[31], 31) + << "incorrect value for last_msg_.signature[31], expected 31, is " + << last_msg_.signature[31]; + EXPECT_EQ(last_msg_.signature[32], 32) + << "incorrect value for last_msg_.signature[32], expected 32, is " + << last_msg_.signature[32]; + EXPECT_EQ(last_msg_.signature[33], 33) + << "incorrect value for last_msg_.signature[33], expected 33, is " + << last_msg_.signature[33]; + EXPECT_EQ(last_msg_.signature[34], 34) + << "incorrect value for last_msg_.signature[34], expected 34, is " + << last_msg_.signature[34]; + EXPECT_EQ(last_msg_.signature[35], 35) + << "incorrect value for last_msg_.signature[35], expected 35, is " + << last_msg_.signature[35]; + EXPECT_EQ(last_msg_.signature[36], 36) + << "incorrect value for last_msg_.signature[36], expected 36, is " + << last_msg_.signature[36]; + EXPECT_EQ(last_msg_.signature[37], 37) + << "incorrect value for last_msg_.signature[37], expected 37, is " + << last_msg_.signature[37]; + EXPECT_EQ(last_msg_.signature[38], 38) + << "incorrect value for last_msg_.signature[38], expected 38, is " + << last_msg_.signature[38]; + EXPECT_EQ(last_msg_.signature[39], 39) + << "incorrect value for last_msg_.signature[39], expected 39, is " + << last_msg_.signature[39]; + EXPECT_EQ(last_msg_.signature[40], 40) + << "incorrect value for last_msg_.signature[40], expected 40, is " + << last_msg_.signature[40]; + EXPECT_EQ(last_msg_.signature[41], 41) + << "incorrect value for last_msg_.signature[41], expected 41, is " + << last_msg_.signature[41]; + EXPECT_EQ(last_msg_.signature[42], 42) + << "incorrect value for last_msg_.signature[42], expected 42, is " + << last_msg_.signature[42]; + EXPECT_EQ(last_msg_.signature[43], 43) + << "incorrect value for last_msg_.signature[43], expected 43, is " + << last_msg_.signature[43]; + EXPECT_EQ(last_msg_.signature[44], 44) + << "incorrect value for last_msg_.signature[44], expected 44, is " + << last_msg_.signature[44]; + EXPECT_EQ(last_msg_.signature[45], 45) + << "incorrect value for last_msg_.signature[45], expected 45, is " + << last_msg_.signature[45]; + EXPECT_EQ(last_msg_.signature[46], 46) + << "incorrect value for last_msg_.signature[46], expected 46, is " + << last_msg_.signature[46]; + EXPECT_EQ(last_msg_.signature[47], 47) + << "incorrect value for last_msg_.signature[47], expected 47, is " + << last_msg_.signature[47]; + EXPECT_EQ(last_msg_.signature[48], 48) + << "incorrect value for last_msg_.signature[48], expected 48, is " + << last_msg_.signature[48]; + EXPECT_EQ(last_msg_.signature[49], 49) + << "incorrect value for last_msg_.signature[49], expected 49, is " + << last_msg_.signature[49]; + EXPECT_EQ(last_msg_.signature[50], 50) + << "incorrect value for last_msg_.signature[50], expected 50, is " + << last_msg_.signature[50]; + EXPECT_EQ(last_msg_.signature[51], 51) + << "incorrect value for last_msg_.signature[51], expected 51, is " + << last_msg_.signature[51]; + EXPECT_EQ(last_msg_.signature[52], 52) + << "incorrect value for last_msg_.signature[52], expected 52, is " + << last_msg_.signature[52]; + EXPECT_EQ(last_msg_.signature[53], 53) + << "incorrect value for last_msg_.signature[53], expected 53, is " + << last_msg_.signature[53]; + EXPECT_EQ(last_msg_.signature[54], 54) + << "incorrect value for last_msg_.signature[54], expected 54, is " + << last_msg_.signature[54]; + EXPECT_EQ(last_msg_.signature[55], 55) + << "incorrect value for last_msg_.signature[55], expected 55, is " + << last_msg_.signature[55]; + EXPECT_EQ(last_msg_.signature[56], 56) + << "incorrect value for last_msg_.signature[56], expected 56, is " + << last_msg_.signature[56]; + EXPECT_EQ(last_msg_.signature[57], 57) + << "incorrect value for last_msg_.signature[57], expected 57, is " + << last_msg_.signature[57]; + EXPECT_EQ(last_msg_.signature[58], 58) + << "incorrect value for last_msg_.signature[58], expected 58, is " + << last_msg_.signature[58]; + EXPECT_EQ(last_msg_.signature[59], 59) + << "incorrect value for last_msg_.signature[59], expected 59, is " + << last_msg_.signature[59]; + EXPECT_EQ(last_msg_.signature[60], 60) + << "incorrect value for last_msg_.signature[60], expected 60, is " + << last_msg_.signature[60]; + EXPECT_EQ(last_msg_.signature[61], 61) + << "incorrect value for last_msg_.signature[61], expected 61, is " + << last_msg_.signature[61]; + EXPECT_EQ(last_msg_.signature[62], 62) + << "incorrect value for last_msg_.signature[62], expected 62, is " + << last_msg_.signature[62]; + EXPECT_EQ(last_msg_.signature[63], 63) + << "incorrect value for last_msg_.signature[63], expected 63, is " + << last_msg_.signature[63]; + EXPECT_EQ(last_msg_.signed_messages[0], 5000) + << "incorrect value for last_msg_.signed_messages[0], expected 5000, is " + << last_msg_.signed_messages[0]; + EXPECT_EQ(last_msg_.signed_messages[1], 5234) + << "incorrect value for last_msg_.signed_messages[1], expected 5234, is " + << last_msg_.signed_messages[1]; + EXPECT_EQ(last_msg_.signed_messages[2], 5468) + << "incorrect value for last_msg_.signed_messages[2], expected 5468, is " + << last_msg_.signed_messages[2]; + EXPECT_EQ(last_msg_.signed_messages[3], 5702) + << "incorrect value for last_msg_.signed_messages[3], expected 5702, is " + << last_msg_.signed_messages[3]; + EXPECT_EQ(last_msg_.signed_messages[4], 5936) + << "incorrect value for last_msg_.signed_messages[4], expected 5936, is " + << last_msg_.signed_messages[4]; + EXPECT_EQ(last_msg_.signed_messages[5], 6170) + << "incorrect value for last_msg_.signed_messages[5], expected 6170, is " + << last_msg_.signed_messages[5]; + EXPECT_EQ(last_msg_.signed_messages[6], 6404) + << "incorrect value for last_msg_.signed_messages[6], expected 6404, is " + << last_msg_.signed_messages[6]; + EXPECT_EQ(last_msg_.signed_messages[7], 6638) + << "incorrect value for last_msg_.signed_messages[7], expected 6638, is " + << last_msg_.signed_messages[7]; + EXPECT_EQ(last_msg_.signed_messages[8], 6872) + << "incorrect value for last_msg_.signed_messages[8], expected 6872, is " + << last_msg_.signed_messages[8]; + EXPECT_EQ(last_msg_.signed_messages[9], 7106) + << "incorrect value for last_msg_.signed_messages[9], expected 7106, is " + << last_msg_.signed_messages[9]; + EXPECT_EQ(last_msg_.signed_messages[10], 7340) + << "incorrect value for last_msg_.signed_messages[10], expected 7340, is " + << last_msg_.signed_messages[10]; + EXPECT_EQ(last_msg_.signed_messages[11], 7574) + << "incorrect value for last_msg_.signed_messages[11], expected 7574, is " + << last_msg_.signed_messages[11]; + EXPECT_EQ(last_msg_.signed_messages[12], 7808) + << "incorrect value for last_msg_.signed_messages[12], expected 7808, is " + << last_msg_.signed_messages[12]; + EXPECT_EQ(last_msg_.signed_messages[13], 8042) + << "incorrect value for last_msg_.signed_messages[13], expected 8042, is " + << last_msg_.signed_messages[13]; + EXPECT_EQ(last_msg_.signed_messages[14], 8276) + << "incorrect value for last_msg_.signed_messages[14], expected 8276, is " + << last_msg_.signed_messages[14]; + EXPECT_EQ(last_msg_.signed_messages[15], 8510) + << "incorrect value for last_msg_.signed_messages[15], expected 8510, is " + << last_msg_.signed_messages[15]; + EXPECT_EQ(last_msg_.signed_messages[16], 8744) + << "incorrect value for last_msg_.signed_messages[16], expected 8744, is " + << last_msg_.signed_messages[16]; + EXPECT_EQ(last_msg_.signed_messages[17], 8978) + << "incorrect value for last_msg_.signed_messages[17], expected 8978, is " + << last_msg_.signed_messages[17]; + EXPECT_EQ(last_msg_.signed_messages[18], 9212) + << "incorrect value for last_msg_.signed_messages[18], expected 9212, is " + << last_msg_.signed_messages[18]; + EXPECT_EQ(last_msg_.signed_messages[19], 9446) + << "incorrect value for last_msg_.signed_messages[19], expected 9446, is " + << last_msg_.signed_messages[19]; + EXPECT_EQ(last_msg_.signed_messages[20], 9680) + << "incorrect value for last_msg_.signed_messages[20], expected 9680, is " + << last_msg_.signed_messages[20]; + EXPECT_EQ(last_msg_.signed_messages[21], 9914) + << "incorrect value for last_msg_.signed_messages[21], expected 9914, is " + << last_msg_.signed_messages[21]; + EXPECT_EQ(last_msg_.signed_messages[22], 10148) + << "incorrect value for last_msg_.signed_messages[22], expected 10148, " + "is " + << last_msg_.signed_messages[22]; + EXPECT_EQ(last_msg_.signed_messages[23], 10382) + << "incorrect value for last_msg_.signed_messages[23], expected 10382, " + "is " + << last_msg_.signed_messages[23]; + EXPECT_EQ(last_msg_.signed_messages[24], 10616) + << "incorrect value for last_msg_.signed_messages[24], expected 10616, " + "is " + << last_msg_.signed_messages[24]; + EXPECT_EQ(last_msg_.stream_counter, 1) + << "incorrect value for last_msg_.stream_counter, expected 1, is " + << last_msg_.stream_counter; } diff --git a/c/test/cpp/auto_check_sbp_solution_meta_MsgSolnMeta.cc b/c/test/cpp/auto_check_sbp_solution_meta_MsgSolnMeta.cc index 9c8d6e6cb..7cff02e04 100644 --- a/c/test/cpp/auto_check_sbp_solution_meta_MsgSolnMeta.cc +++ b/c/test/cpp/auto_check_sbp_solution_meta_MsgSolnMeta.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMeta.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMeta.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_solution_meta_MsgSolnMeta0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_solution_meta_MsgSolnMeta0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_solution_meta_MsgSolnMeta0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_solution_meta_MsgSolnMeta0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_soln_meta_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_soln_meta_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,655 +67,1286 @@ class Test_auto_check_sbp_solution_meta_MsgSolnMeta0 : sbp_msg_soln_meta_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_solution_meta_MsgSolnMeta0, Test) -{ - - uint8_t encoded_frame[] = {85,14,255,0,60,254,48,208,65,216,122,45,196,160,144,228,8,83,89,87,3,213,95,109,86,131,71,70,84,73,131,26,82,247,140,97,115,110,118,253,2,122,186,148,122,148,180,231,68,46,190,102,243,48,192,15,208,89,56,10,245,2,254,201,120,32,126,2,83,161,238,123,102,230,76,190,225,182,207,228,7,218,117,89,29,191,56,248,185,255,46,18,72,142,82,113,26,4,172,254,178,136,113,115,58,193,89,227,182,246,76,77,108,245,41,31,70,124,249,145,15,78,228,38,241,129,8,176,251,72,248,80,115,244,231,145,191,190,178,168,89,233,69,176,174,140,182,141,81,82,92,79,101,223,100,64,184,215,124,37,21,227,135,102,72,36,219,56,146,90,219,104,227,102,83,12,41,122,173,94,1,174,134,130,104,237,116,249,107,230,130,123,25,162,57,223,193,174,146,193,239,44,246,197,214,80,83,100,66,72,133,137,140,82,2,2,96,9,96,158,134,97,43,129,141,25,183,200,214,57,248,103,222,65,195,15,244,21,180,46,140,130,36,17,194,209,65,254,115,103,152,129,234,235,194,234,170,201,210,154,150,247, }; - - sbp_msg_soln_meta_t test_msg{}; - test_msg.age_corrections = 21256; - test_msg.age_gnss = 3573765977; - test_msg.hdop = 41156; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_sol_in.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)111,(char)108,(char)95,(char)105,(char)110 }; - memcpy(test_msg.n_sol_in.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_sol_in.value = 119; - test_msg.pdop = 11642; - - test_msg.sol_in[0].flags = 109; - test_msg.sol_in[0].sensor_type = 95; - - test_msg.sol_in[1].flags = 131; - test_msg.sol_in[1].sensor_type = 86; - - test_msg.sol_in[2].flags = 70; - test_msg.sol_in[2].sensor_type = 71; - - test_msg.sol_in[3].flags = 73; - test_msg.sol_in[3].sensor_type = 84; - - test_msg.sol_in[4].flags = 26; - test_msg.sol_in[4].sensor_type = 131; - - test_msg.sol_in[5].flags = 247; - test_msg.sol_in[5].sensor_type = 82; - - test_msg.sol_in[6].flags = 97; - test_msg.sol_in[6].sensor_type = 140; - - test_msg.sol_in[7].flags = 110; - test_msg.sol_in[7].sensor_type = 115; - - test_msg.sol_in[8].flags = 253; - test_msg.sol_in[8].sensor_type = 118; - - test_msg.sol_in[9].flags = 122; - test_msg.sol_in[9].sensor_type = 2; - - test_msg.sol_in[10].flags = 148; - test_msg.sol_in[10].sensor_type = 186; - - test_msg.sol_in[11].flags = 148; - test_msg.sol_in[11].sensor_type = 122; - - test_msg.sol_in[12].flags = 231; - test_msg.sol_in[12].sensor_type = 180; - - test_msg.sol_in[13].flags = 46; - test_msg.sol_in[13].sensor_type = 68; - - test_msg.sol_in[14].flags = 102; - test_msg.sol_in[14].sensor_type = 190; - - test_msg.sol_in[15].flags = 48; - test_msg.sol_in[15].sensor_type = 243; - - test_msg.sol_in[16].flags = 15; - test_msg.sol_in[16].sensor_type = 192; - - test_msg.sol_in[17].flags = 89; - test_msg.sol_in[17].sensor_type = 208; - - test_msg.sol_in[18].flags = 10; - test_msg.sol_in[18].sensor_type = 56; - - test_msg.sol_in[19].flags = 2; - test_msg.sol_in[19].sensor_type = 245; - - test_msg.sol_in[20].flags = 201; - test_msg.sol_in[20].sensor_type = 254; - - test_msg.sol_in[21].flags = 32; - test_msg.sol_in[21].sensor_type = 120; - - test_msg.sol_in[22].flags = 2; - test_msg.sol_in[22].sensor_type = 126; - - test_msg.sol_in[23].flags = 161; - test_msg.sol_in[23].sensor_type = 83; - - test_msg.sol_in[24].flags = 123; - test_msg.sol_in[24].sensor_type = 238; - - test_msg.sol_in[25].flags = 230; - test_msg.sol_in[25].sensor_type = 102; - - test_msg.sol_in[26].flags = 190; - test_msg.sol_in[26].sensor_type = 76; - - test_msg.sol_in[27].flags = 182; - test_msg.sol_in[27].sensor_type = 225; - - test_msg.sol_in[28].flags = 228; - test_msg.sol_in[28].sensor_type = 207; - - test_msg.sol_in[29].flags = 218; - test_msg.sol_in[29].sensor_type = 7; - - test_msg.sol_in[30].flags = 89; - test_msg.sol_in[30].sensor_type = 117; - - test_msg.sol_in[31].flags = 191; - test_msg.sol_in[31].sensor_type = 29; - - test_msg.sol_in[32].flags = 248; - test_msg.sol_in[32].sensor_type = 56; - - test_msg.sol_in[33].flags = 255; - test_msg.sol_in[33].sensor_type = 185; - - test_msg.sol_in[34].flags = 18; - test_msg.sol_in[34].sensor_type = 46; - - test_msg.sol_in[35].flags = 142; - test_msg.sol_in[35].sensor_type = 72; - - test_msg.sol_in[36].flags = 113; - test_msg.sol_in[36].sensor_type = 82; - - test_msg.sol_in[37].flags = 4; - test_msg.sol_in[37].sensor_type = 26; - - test_msg.sol_in[38].flags = 254; - test_msg.sol_in[38].sensor_type = 172; - - test_msg.sol_in[39].flags = 136; - test_msg.sol_in[39].sensor_type = 178; - - test_msg.sol_in[40].flags = 115; - test_msg.sol_in[40].sensor_type = 113; - - test_msg.sol_in[41].flags = 193; - test_msg.sol_in[41].sensor_type = 58; - - test_msg.sol_in[42].flags = 227; - test_msg.sol_in[42].sensor_type = 89; - - test_msg.sol_in[43].flags = 246; - test_msg.sol_in[43].sensor_type = 182; - - test_msg.sol_in[44].flags = 77; - test_msg.sol_in[44].sensor_type = 76; - - test_msg.sol_in[45].flags = 245; - test_msg.sol_in[45].sensor_type = 108; - - test_msg.sol_in[46].flags = 31; - test_msg.sol_in[46].sensor_type = 41; - - test_msg.sol_in[47].flags = 124; - test_msg.sol_in[47].sensor_type = 70; - - test_msg.sol_in[48].flags = 145; - test_msg.sol_in[48].sensor_type = 249; - - test_msg.sol_in[49].flags = 78; - test_msg.sol_in[49].sensor_type = 15; - - test_msg.sol_in[50].flags = 38; - test_msg.sol_in[50].sensor_type = 228; - - test_msg.sol_in[51].flags = 129; - test_msg.sol_in[51].sensor_type = 241; - - test_msg.sol_in[52].flags = 176; - test_msg.sol_in[52].sensor_type = 8; - - test_msg.sol_in[53].flags = 72; - test_msg.sol_in[53].sensor_type = 251; - - test_msg.sol_in[54].flags = 80; - test_msg.sol_in[54].sensor_type = 248; - - test_msg.sol_in[55].flags = 244; - test_msg.sol_in[55].sensor_type = 115; - - test_msg.sol_in[56].flags = 145; - test_msg.sol_in[56].sensor_type = 231; - - test_msg.sol_in[57].flags = 190; - test_msg.sol_in[57].sensor_type = 191; - - test_msg.sol_in[58].flags = 168; - test_msg.sol_in[58].sensor_type = 178; - - test_msg.sol_in[59].flags = 233; - test_msg.sol_in[59].sensor_type = 89; - - test_msg.sol_in[60].flags = 176; - test_msg.sol_in[60].sensor_type = 69; - - test_msg.sol_in[61].flags = 140; - test_msg.sol_in[61].sensor_type = 174; - - test_msg.sol_in[62].flags = 141; - test_msg.sol_in[62].sensor_type = 182; - - test_msg.sol_in[63].flags = 82; - test_msg.sol_in[63].sensor_type = 81; - - test_msg.sol_in[64].flags = 79; - test_msg.sol_in[64].sensor_type = 92; - - test_msg.sol_in[65].flags = 223; - test_msg.sol_in[65].sensor_type = 101; - - test_msg.sol_in[66].flags = 64; - test_msg.sol_in[66].sensor_type = 100; - - test_msg.sol_in[67].flags = 215; - test_msg.sol_in[67].sensor_type = 184; - - test_msg.sol_in[68].flags = 37; - test_msg.sol_in[68].sensor_type = 124; - - test_msg.sol_in[69].flags = 227; - test_msg.sol_in[69].sensor_type = 21; - - test_msg.sol_in[70].flags = 102; - test_msg.sol_in[70].sensor_type = 135; - - test_msg.sol_in[71].flags = 36; - test_msg.sol_in[71].sensor_type = 72; - - test_msg.sol_in[72].flags = 56; - test_msg.sol_in[72].sensor_type = 219; - - test_msg.sol_in[73].flags = 90; - test_msg.sol_in[73].sensor_type = 146; - - test_msg.sol_in[74].flags = 104; - test_msg.sol_in[74].sensor_type = 219; - - test_msg.sol_in[75].flags = 102; - test_msg.sol_in[75].sensor_type = 227; - - test_msg.sol_in[76].flags = 12; - test_msg.sol_in[76].sensor_type = 83; - - test_msg.sol_in[77].flags = 122; - test_msg.sol_in[77].sensor_type = 41; - - test_msg.sol_in[78].flags = 94; - test_msg.sol_in[78].sensor_type = 173; - - test_msg.sol_in[79].flags = 174; - test_msg.sol_in[79].sensor_type = 1; - - test_msg.sol_in[80].flags = 130; - test_msg.sol_in[80].sensor_type = 134; - - test_msg.sol_in[81].flags = 237; - test_msg.sol_in[81].sensor_type = 104; - - test_msg.sol_in[82].flags = 249; - test_msg.sol_in[82].sensor_type = 116; - - test_msg.sol_in[83].flags = 230; - test_msg.sol_in[83].sensor_type = 107; - - test_msg.sol_in[84].flags = 123; - test_msg.sol_in[84].sensor_type = 130; - - test_msg.sol_in[85].flags = 162; - test_msg.sol_in[85].sensor_type = 25; - - test_msg.sol_in[86].flags = 223; - test_msg.sol_in[86].sensor_type = 57; - - test_msg.sol_in[87].flags = 174; - test_msg.sol_in[87].sensor_type = 193; - - test_msg.sol_in[88].flags = 193; - test_msg.sol_in[88].sensor_type = 146; - - test_msg.sol_in[89].flags = 44; - test_msg.sol_in[89].sensor_type = 239; - - test_msg.sol_in[90].flags = 197; - test_msg.sol_in[90].sensor_type = 246; - - test_msg.sol_in[91].flags = 80; - test_msg.sol_in[91].sensor_type = 214; - - test_msg.sol_in[92].flags = 100; - test_msg.sol_in[92].sensor_type = 83; - - test_msg.sol_in[93].flags = 72; - test_msg.sol_in[93].sensor_type = 66; - - test_msg.sol_in[94].flags = 137; - test_msg.sol_in[94].sensor_type = 133; - - test_msg.sol_in[95].flags = 82; - test_msg.sol_in[95].sensor_type = 140; - - test_msg.sol_in[96].flags = 2; - test_msg.sol_in[96].sensor_type = 2; - - test_msg.sol_in[97].flags = 9; - test_msg.sol_in[97].sensor_type = 96; - - test_msg.sol_in[98].flags = 158; - test_msg.sol_in[98].sensor_type = 96; - - test_msg.sol_in[99].flags = 97; - test_msg.sol_in[99].sensor_type = 134; - - test_msg.sol_in[100].flags = 129; - test_msg.sol_in[100].sensor_type = 43; - - test_msg.sol_in[101].flags = 25; - test_msg.sol_in[101].sensor_type = 141; - - test_msg.sol_in[102].flags = 200; - test_msg.sol_in[102].sensor_type = 183; - - test_msg.sol_in[103].flags = 57; - test_msg.sol_in[103].sensor_type = 214; - - test_msg.sol_in[104].flags = 103; - test_msg.sol_in[104].sensor_type = 248; - - test_msg.sol_in[105].flags = 65; - test_msg.sol_in[105].sensor_type = 222; - - test_msg.sol_in[106].flags = 15; - test_msg.sol_in[106].sensor_type = 195; - - test_msg.sol_in[107].flags = 21; - test_msg.sol_in[107].sensor_type = 244; - - test_msg.sol_in[108].flags = 46; - test_msg.sol_in[108].sensor_type = 180; - - test_msg.sol_in[109].flags = 130; - test_msg.sol_in[109].sensor_type = 140; - - test_msg.sol_in[110].flags = 17; - test_msg.sol_in[110].sensor_type = 36; - - test_msg.sol_in[111].flags = 209; - test_msg.sol_in[111].sensor_type = 194; - - test_msg.sol_in[112].flags = 254; - test_msg.sol_in[112].sensor_type = 65; - - test_msg.sol_in[113].flags = 103; - test_msg.sol_in[113].sensor_type = 115; - - test_msg.sol_in[114].flags = 129; - test_msg.sol_in[114].sensor_type = 152; - - test_msg.sol_in[115].flags = 235; - test_msg.sol_in[115].sensor_type = 234; - - test_msg.sol_in[116].flags = 234; - test_msg.sol_in[116].sensor_type = 194; - - test_msg.sol_in[117].flags = 201; - test_msg.sol_in[117].sensor_type = 170; - - test_msg.sol_in[118].flags = 154; - test_msg.sol_in[118].sensor_type = 210; - test_msg.tow = 3628191792; - test_msg.vdop = 58512; - - EXPECT_EQ(send_message( 15360, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 15360); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.age_corrections, 21256) << "incorrect value for last_msg_.age_corrections, expected 21256, is " << last_msg_.age_corrections; - EXPECT_EQ(last_msg_.age_gnss, 3573765977) << "incorrect value for last_msg_.age_gnss, expected 3573765977, is " << last_msg_.age_gnss; - EXPECT_EQ(last_msg_.hdop, 41156) << "incorrect value for last_msg_.hdop, expected 41156, is " << last_msg_.hdop; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_sol_in.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_sol_in.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_sol_in.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)111,(char)108,(char)95,(char)105,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_sol_in.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_sol_in.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_sol_in.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_sol_in.value, 119) << "incorrect value for last_msg_.n_sol_in.value, expected 119, is " << last_msg_.n_sol_in.value; - EXPECT_EQ(last_msg_.pdop, 11642) << "incorrect value for last_msg_.pdop, expected 11642, is " << last_msg_.pdop; - EXPECT_EQ(last_msg_.sol_in[0].flags, 109) << "incorrect value for last_msg_.sol_in[0].flags, expected 109, is " << last_msg_.sol_in[0].flags; - EXPECT_EQ(last_msg_.sol_in[0].sensor_type, 95) << "incorrect value for last_msg_.sol_in[0].sensor_type, expected 95, is " << last_msg_.sol_in[0].sensor_type; - EXPECT_EQ(last_msg_.sol_in[1].flags, 131) << "incorrect value for last_msg_.sol_in[1].flags, expected 131, is " << last_msg_.sol_in[1].flags; - EXPECT_EQ(last_msg_.sol_in[1].sensor_type, 86) << "incorrect value for last_msg_.sol_in[1].sensor_type, expected 86, is " << last_msg_.sol_in[1].sensor_type; - EXPECT_EQ(last_msg_.sol_in[2].flags, 70) << "incorrect value for last_msg_.sol_in[2].flags, expected 70, is " << last_msg_.sol_in[2].flags; - EXPECT_EQ(last_msg_.sol_in[2].sensor_type, 71) << "incorrect value for last_msg_.sol_in[2].sensor_type, expected 71, is " << last_msg_.sol_in[2].sensor_type; - EXPECT_EQ(last_msg_.sol_in[3].flags, 73) << "incorrect value for last_msg_.sol_in[3].flags, expected 73, is " << last_msg_.sol_in[3].flags; - EXPECT_EQ(last_msg_.sol_in[3].sensor_type, 84) << "incorrect value for last_msg_.sol_in[3].sensor_type, expected 84, is " << last_msg_.sol_in[3].sensor_type; - EXPECT_EQ(last_msg_.sol_in[4].flags, 26) << "incorrect value for last_msg_.sol_in[4].flags, expected 26, is " << last_msg_.sol_in[4].flags; - EXPECT_EQ(last_msg_.sol_in[4].sensor_type, 131) << "incorrect value for last_msg_.sol_in[4].sensor_type, expected 131, is " << last_msg_.sol_in[4].sensor_type; - EXPECT_EQ(last_msg_.sol_in[5].flags, 247) << "incorrect value for last_msg_.sol_in[5].flags, expected 247, is " << last_msg_.sol_in[5].flags; - EXPECT_EQ(last_msg_.sol_in[5].sensor_type, 82) << "incorrect value for last_msg_.sol_in[5].sensor_type, expected 82, is " << last_msg_.sol_in[5].sensor_type; - EXPECT_EQ(last_msg_.sol_in[6].flags, 97) << "incorrect value for last_msg_.sol_in[6].flags, expected 97, is " << last_msg_.sol_in[6].flags; - EXPECT_EQ(last_msg_.sol_in[6].sensor_type, 140) << "incorrect value for last_msg_.sol_in[6].sensor_type, expected 140, is " << last_msg_.sol_in[6].sensor_type; - EXPECT_EQ(last_msg_.sol_in[7].flags, 110) << "incorrect value for last_msg_.sol_in[7].flags, expected 110, is " << last_msg_.sol_in[7].flags; - EXPECT_EQ(last_msg_.sol_in[7].sensor_type, 115) << "incorrect value for last_msg_.sol_in[7].sensor_type, expected 115, is " << last_msg_.sol_in[7].sensor_type; - EXPECT_EQ(last_msg_.sol_in[8].flags, 253) << "incorrect value for last_msg_.sol_in[8].flags, expected 253, is " << last_msg_.sol_in[8].flags; - EXPECT_EQ(last_msg_.sol_in[8].sensor_type, 118) << "incorrect value for last_msg_.sol_in[8].sensor_type, expected 118, is " << last_msg_.sol_in[8].sensor_type; - EXPECT_EQ(last_msg_.sol_in[9].flags, 122) << "incorrect value for last_msg_.sol_in[9].flags, expected 122, is " << last_msg_.sol_in[9].flags; - EXPECT_EQ(last_msg_.sol_in[9].sensor_type, 2) << "incorrect value for last_msg_.sol_in[9].sensor_type, expected 2, is " << last_msg_.sol_in[9].sensor_type; - EXPECT_EQ(last_msg_.sol_in[10].flags, 148) << "incorrect value for last_msg_.sol_in[10].flags, expected 148, is " << last_msg_.sol_in[10].flags; - EXPECT_EQ(last_msg_.sol_in[10].sensor_type, 186) << "incorrect value for last_msg_.sol_in[10].sensor_type, expected 186, is " << last_msg_.sol_in[10].sensor_type; - EXPECT_EQ(last_msg_.sol_in[11].flags, 148) << "incorrect value for last_msg_.sol_in[11].flags, expected 148, is " << last_msg_.sol_in[11].flags; - EXPECT_EQ(last_msg_.sol_in[11].sensor_type, 122) << "incorrect value for last_msg_.sol_in[11].sensor_type, expected 122, is " << last_msg_.sol_in[11].sensor_type; - EXPECT_EQ(last_msg_.sol_in[12].flags, 231) << "incorrect value for last_msg_.sol_in[12].flags, expected 231, is " << last_msg_.sol_in[12].flags; - EXPECT_EQ(last_msg_.sol_in[12].sensor_type, 180) << "incorrect value for last_msg_.sol_in[12].sensor_type, expected 180, is " << last_msg_.sol_in[12].sensor_type; - EXPECT_EQ(last_msg_.sol_in[13].flags, 46) << "incorrect value for last_msg_.sol_in[13].flags, expected 46, is " << last_msg_.sol_in[13].flags; - EXPECT_EQ(last_msg_.sol_in[13].sensor_type, 68) << "incorrect value for last_msg_.sol_in[13].sensor_type, expected 68, is " << last_msg_.sol_in[13].sensor_type; - EXPECT_EQ(last_msg_.sol_in[14].flags, 102) << "incorrect value for last_msg_.sol_in[14].flags, expected 102, is " << last_msg_.sol_in[14].flags; - EXPECT_EQ(last_msg_.sol_in[14].sensor_type, 190) << "incorrect value for last_msg_.sol_in[14].sensor_type, expected 190, is " << last_msg_.sol_in[14].sensor_type; - EXPECT_EQ(last_msg_.sol_in[15].flags, 48) << "incorrect value for last_msg_.sol_in[15].flags, expected 48, is " << last_msg_.sol_in[15].flags; - EXPECT_EQ(last_msg_.sol_in[15].sensor_type, 243) << "incorrect value for last_msg_.sol_in[15].sensor_type, expected 243, is " << last_msg_.sol_in[15].sensor_type; - EXPECT_EQ(last_msg_.sol_in[16].flags, 15) << "incorrect value for last_msg_.sol_in[16].flags, expected 15, is " << last_msg_.sol_in[16].flags; - EXPECT_EQ(last_msg_.sol_in[16].sensor_type, 192) << "incorrect value for last_msg_.sol_in[16].sensor_type, expected 192, is " << last_msg_.sol_in[16].sensor_type; - EXPECT_EQ(last_msg_.sol_in[17].flags, 89) << "incorrect value for last_msg_.sol_in[17].flags, expected 89, is " << last_msg_.sol_in[17].flags; - EXPECT_EQ(last_msg_.sol_in[17].sensor_type, 208) << "incorrect value for last_msg_.sol_in[17].sensor_type, expected 208, is " << last_msg_.sol_in[17].sensor_type; - EXPECT_EQ(last_msg_.sol_in[18].flags, 10) << "incorrect value for last_msg_.sol_in[18].flags, expected 10, is " << last_msg_.sol_in[18].flags; - EXPECT_EQ(last_msg_.sol_in[18].sensor_type, 56) << "incorrect value for last_msg_.sol_in[18].sensor_type, expected 56, is " << last_msg_.sol_in[18].sensor_type; - EXPECT_EQ(last_msg_.sol_in[19].flags, 2) << "incorrect value for last_msg_.sol_in[19].flags, expected 2, is " << last_msg_.sol_in[19].flags; - EXPECT_EQ(last_msg_.sol_in[19].sensor_type, 245) << "incorrect value for last_msg_.sol_in[19].sensor_type, expected 245, is " << last_msg_.sol_in[19].sensor_type; - EXPECT_EQ(last_msg_.sol_in[20].flags, 201) << "incorrect value for last_msg_.sol_in[20].flags, expected 201, is " << last_msg_.sol_in[20].flags; - EXPECT_EQ(last_msg_.sol_in[20].sensor_type, 254) << "incorrect value for last_msg_.sol_in[20].sensor_type, expected 254, is " << last_msg_.sol_in[20].sensor_type; - EXPECT_EQ(last_msg_.sol_in[21].flags, 32) << "incorrect value for last_msg_.sol_in[21].flags, expected 32, is " << last_msg_.sol_in[21].flags; - EXPECT_EQ(last_msg_.sol_in[21].sensor_type, 120) << "incorrect value for last_msg_.sol_in[21].sensor_type, expected 120, is " << last_msg_.sol_in[21].sensor_type; - EXPECT_EQ(last_msg_.sol_in[22].flags, 2) << "incorrect value for last_msg_.sol_in[22].flags, expected 2, is " << last_msg_.sol_in[22].flags; - EXPECT_EQ(last_msg_.sol_in[22].sensor_type, 126) << "incorrect value for last_msg_.sol_in[22].sensor_type, expected 126, is " << last_msg_.sol_in[22].sensor_type; - EXPECT_EQ(last_msg_.sol_in[23].flags, 161) << "incorrect value for last_msg_.sol_in[23].flags, expected 161, is " << last_msg_.sol_in[23].flags; - EXPECT_EQ(last_msg_.sol_in[23].sensor_type, 83) << "incorrect value for last_msg_.sol_in[23].sensor_type, expected 83, is " << last_msg_.sol_in[23].sensor_type; - EXPECT_EQ(last_msg_.sol_in[24].flags, 123) << "incorrect value for last_msg_.sol_in[24].flags, expected 123, is " << last_msg_.sol_in[24].flags; - EXPECT_EQ(last_msg_.sol_in[24].sensor_type, 238) << "incorrect value for last_msg_.sol_in[24].sensor_type, expected 238, is " << last_msg_.sol_in[24].sensor_type; - EXPECT_EQ(last_msg_.sol_in[25].flags, 230) << "incorrect value for last_msg_.sol_in[25].flags, expected 230, is " << last_msg_.sol_in[25].flags; - EXPECT_EQ(last_msg_.sol_in[25].sensor_type, 102) << "incorrect value for last_msg_.sol_in[25].sensor_type, expected 102, is " << last_msg_.sol_in[25].sensor_type; - EXPECT_EQ(last_msg_.sol_in[26].flags, 190) << "incorrect value for last_msg_.sol_in[26].flags, expected 190, is " << last_msg_.sol_in[26].flags; - EXPECT_EQ(last_msg_.sol_in[26].sensor_type, 76) << "incorrect value for last_msg_.sol_in[26].sensor_type, expected 76, is " << last_msg_.sol_in[26].sensor_type; - EXPECT_EQ(last_msg_.sol_in[27].flags, 182) << "incorrect value for last_msg_.sol_in[27].flags, expected 182, is " << last_msg_.sol_in[27].flags; - EXPECT_EQ(last_msg_.sol_in[27].sensor_type, 225) << "incorrect value for last_msg_.sol_in[27].sensor_type, expected 225, is " << last_msg_.sol_in[27].sensor_type; - EXPECT_EQ(last_msg_.sol_in[28].flags, 228) << "incorrect value for last_msg_.sol_in[28].flags, expected 228, is " << last_msg_.sol_in[28].flags; - EXPECT_EQ(last_msg_.sol_in[28].sensor_type, 207) << "incorrect value for last_msg_.sol_in[28].sensor_type, expected 207, is " << last_msg_.sol_in[28].sensor_type; - EXPECT_EQ(last_msg_.sol_in[29].flags, 218) << "incorrect value for last_msg_.sol_in[29].flags, expected 218, is " << last_msg_.sol_in[29].flags; - EXPECT_EQ(last_msg_.sol_in[29].sensor_type, 7) << "incorrect value for last_msg_.sol_in[29].sensor_type, expected 7, is " << last_msg_.sol_in[29].sensor_type; - EXPECT_EQ(last_msg_.sol_in[30].flags, 89) << "incorrect value for last_msg_.sol_in[30].flags, expected 89, is " << last_msg_.sol_in[30].flags; - EXPECT_EQ(last_msg_.sol_in[30].sensor_type, 117) << "incorrect value for last_msg_.sol_in[30].sensor_type, expected 117, is " << last_msg_.sol_in[30].sensor_type; - EXPECT_EQ(last_msg_.sol_in[31].flags, 191) << "incorrect value for last_msg_.sol_in[31].flags, expected 191, is " << last_msg_.sol_in[31].flags; - EXPECT_EQ(last_msg_.sol_in[31].sensor_type, 29) << "incorrect value for last_msg_.sol_in[31].sensor_type, expected 29, is " << last_msg_.sol_in[31].sensor_type; - EXPECT_EQ(last_msg_.sol_in[32].flags, 248) << "incorrect value for last_msg_.sol_in[32].flags, expected 248, is " << last_msg_.sol_in[32].flags; - EXPECT_EQ(last_msg_.sol_in[32].sensor_type, 56) << "incorrect value for last_msg_.sol_in[32].sensor_type, expected 56, is " << last_msg_.sol_in[32].sensor_type; - EXPECT_EQ(last_msg_.sol_in[33].flags, 255) << "incorrect value for last_msg_.sol_in[33].flags, expected 255, is " << last_msg_.sol_in[33].flags; - EXPECT_EQ(last_msg_.sol_in[33].sensor_type, 185) << "incorrect value for last_msg_.sol_in[33].sensor_type, expected 185, is " << last_msg_.sol_in[33].sensor_type; - EXPECT_EQ(last_msg_.sol_in[34].flags, 18) << "incorrect value for last_msg_.sol_in[34].flags, expected 18, is " << last_msg_.sol_in[34].flags; - EXPECT_EQ(last_msg_.sol_in[34].sensor_type, 46) << "incorrect value for last_msg_.sol_in[34].sensor_type, expected 46, is " << last_msg_.sol_in[34].sensor_type; - EXPECT_EQ(last_msg_.sol_in[35].flags, 142) << "incorrect value for last_msg_.sol_in[35].flags, expected 142, is " << last_msg_.sol_in[35].flags; - EXPECT_EQ(last_msg_.sol_in[35].sensor_type, 72) << "incorrect value for last_msg_.sol_in[35].sensor_type, expected 72, is " << last_msg_.sol_in[35].sensor_type; - EXPECT_EQ(last_msg_.sol_in[36].flags, 113) << "incorrect value for last_msg_.sol_in[36].flags, expected 113, is " << last_msg_.sol_in[36].flags; - EXPECT_EQ(last_msg_.sol_in[36].sensor_type, 82) << "incorrect value for last_msg_.sol_in[36].sensor_type, expected 82, is " << last_msg_.sol_in[36].sensor_type; - EXPECT_EQ(last_msg_.sol_in[37].flags, 4) << "incorrect value for last_msg_.sol_in[37].flags, expected 4, is " << last_msg_.sol_in[37].flags; - EXPECT_EQ(last_msg_.sol_in[37].sensor_type, 26) << "incorrect value for last_msg_.sol_in[37].sensor_type, expected 26, is " << last_msg_.sol_in[37].sensor_type; - EXPECT_EQ(last_msg_.sol_in[38].flags, 254) << "incorrect value for last_msg_.sol_in[38].flags, expected 254, is " << last_msg_.sol_in[38].flags; - EXPECT_EQ(last_msg_.sol_in[38].sensor_type, 172) << "incorrect value for last_msg_.sol_in[38].sensor_type, expected 172, is " << last_msg_.sol_in[38].sensor_type; - EXPECT_EQ(last_msg_.sol_in[39].flags, 136) << "incorrect value for last_msg_.sol_in[39].flags, expected 136, is " << last_msg_.sol_in[39].flags; - EXPECT_EQ(last_msg_.sol_in[39].sensor_type, 178) << "incorrect value for last_msg_.sol_in[39].sensor_type, expected 178, is " << last_msg_.sol_in[39].sensor_type; - EXPECT_EQ(last_msg_.sol_in[40].flags, 115) << "incorrect value for last_msg_.sol_in[40].flags, expected 115, is " << last_msg_.sol_in[40].flags; - EXPECT_EQ(last_msg_.sol_in[40].sensor_type, 113) << "incorrect value for last_msg_.sol_in[40].sensor_type, expected 113, is " << last_msg_.sol_in[40].sensor_type; - EXPECT_EQ(last_msg_.sol_in[41].flags, 193) << "incorrect value for last_msg_.sol_in[41].flags, expected 193, is " << last_msg_.sol_in[41].flags; - EXPECT_EQ(last_msg_.sol_in[41].sensor_type, 58) << "incorrect value for last_msg_.sol_in[41].sensor_type, expected 58, is " << last_msg_.sol_in[41].sensor_type; - EXPECT_EQ(last_msg_.sol_in[42].flags, 227) << "incorrect value for last_msg_.sol_in[42].flags, expected 227, is " << last_msg_.sol_in[42].flags; - EXPECT_EQ(last_msg_.sol_in[42].sensor_type, 89) << "incorrect value for last_msg_.sol_in[42].sensor_type, expected 89, is " << last_msg_.sol_in[42].sensor_type; - EXPECT_EQ(last_msg_.sol_in[43].flags, 246) << "incorrect value for last_msg_.sol_in[43].flags, expected 246, is " << last_msg_.sol_in[43].flags; - EXPECT_EQ(last_msg_.sol_in[43].sensor_type, 182) << "incorrect value for last_msg_.sol_in[43].sensor_type, expected 182, is " << last_msg_.sol_in[43].sensor_type; - EXPECT_EQ(last_msg_.sol_in[44].flags, 77) << "incorrect value for last_msg_.sol_in[44].flags, expected 77, is " << last_msg_.sol_in[44].flags; - EXPECT_EQ(last_msg_.sol_in[44].sensor_type, 76) << "incorrect value for last_msg_.sol_in[44].sensor_type, expected 76, is " << last_msg_.sol_in[44].sensor_type; - EXPECT_EQ(last_msg_.sol_in[45].flags, 245) << "incorrect value for last_msg_.sol_in[45].flags, expected 245, is " << last_msg_.sol_in[45].flags; - EXPECT_EQ(last_msg_.sol_in[45].sensor_type, 108) << "incorrect value for last_msg_.sol_in[45].sensor_type, expected 108, is " << last_msg_.sol_in[45].sensor_type; - EXPECT_EQ(last_msg_.sol_in[46].flags, 31) << "incorrect value for last_msg_.sol_in[46].flags, expected 31, is " << last_msg_.sol_in[46].flags; - EXPECT_EQ(last_msg_.sol_in[46].sensor_type, 41) << "incorrect value for last_msg_.sol_in[46].sensor_type, expected 41, is " << last_msg_.sol_in[46].sensor_type; - EXPECT_EQ(last_msg_.sol_in[47].flags, 124) << "incorrect value for last_msg_.sol_in[47].flags, expected 124, is " << last_msg_.sol_in[47].flags; - EXPECT_EQ(last_msg_.sol_in[47].sensor_type, 70) << "incorrect value for last_msg_.sol_in[47].sensor_type, expected 70, is " << last_msg_.sol_in[47].sensor_type; - EXPECT_EQ(last_msg_.sol_in[48].flags, 145) << "incorrect value for last_msg_.sol_in[48].flags, expected 145, is " << last_msg_.sol_in[48].flags; - EXPECT_EQ(last_msg_.sol_in[48].sensor_type, 249) << "incorrect value for last_msg_.sol_in[48].sensor_type, expected 249, is " << last_msg_.sol_in[48].sensor_type; - EXPECT_EQ(last_msg_.sol_in[49].flags, 78) << "incorrect value for last_msg_.sol_in[49].flags, expected 78, is " << last_msg_.sol_in[49].flags; - EXPECT_EQ(last_msg_.sol_in[49].sensor_type, 15) << "incorrect value for last_msg_.sol_in[49].sensor_type, expected 15, is " << last_msg_.sol_in[49].sensor_type; - EXPECT_EQ(last_msg_.sol_in[50].flags, 38) << "incorrect value for last_msg_.sol_in[50].flags, expected 38, is " << last_msg_.sol_in[50].flags; - EXPECT_EQ(last_msg_.sol_in[50].sensor_type, 228) << "incorrect value for last_msg_.sol_in[50].sensor_type, expected 228, is " << last_msg_.sol_in[50].sensor_type; - EXPECT_EQ(last_msg_.sol_in[51].flags, 129) << "incorrect value for last_msg_.sol_in[51].flags, expected 129, is " << last_msg_.sol_in[51].flags; - EXPECT_EQ(last_msg_.sol_in[51].sensor_type, 241) << "incorrect value for last_msg_.sol_in[51].sensor_type, expected 241, is " << last_msg_.sol_in[51].sensor_type; - EXPECT_EQ(last_msg_.sol_in[52].flags, 176) << "incorrect value for last_msg_.sol_in[52].flags, expected 176, is " << last_msg_.sol_in[52].flags; - EXPECT_EQ(last_msg_.sol_in[52].sensor_type, 8) << "incorrect value for last_msg_.sol_in[52].sensor_type, expected 8, is " << last_msg_.sol_in[52].sensor_type; - EXPECT_EQ(last_msg_.sol_in[53].flags, 72) << "incorrect value for last_msg_.sol_in[53].flags, expected 72, is " << last_msg_.sol_in[53].flags; - EXPECT_EQ(last_msg_.sol_in[53].sensor_type, 251) << "incorrect value for last_msg_.sol_in[53].sensor_type, expected 251, is " << last_msg_.sol_in[53].sensor_type; - EXPECT_EQ(last_msg_.sol_in[54].flags, 80) << "incorrect value for last_msg_.sol_in[54].flags, expected 80, is " << last_msg_.sol_in[54].flags; - EXPECT_EQ(last_msg_.sol_in[54].sensor_type, 248) << "incorrect value for last_msg_.sol_in[54].sensor_type, expected 248, is " << last_msg_.sol_in[54].sensor_type; - EXPECT_EQ(last_msg_.sol_in[55].flags, 244) << "incorrect value for last_msg_.sol_in[55].flags, expected 244, is " << last_msg_.sol_in[55].flags; - EXPECT_EQ(last_msg_.sol_in[55].sensor_type, 115) << "incorrect value for last_msg_.sol_in[55].sensor_type, expected 115, is " << last_msg_.sol_in[55].sensor_type; - EXPECT_EQ(last_msg_.sol_in[56].flags, 145) << "incorrect value for last_msg_.sol_in[56].flags, expected 145, is " << last_msg_.sol_in[56].flags; - EXPECT_EQ(last_msg_.sol_in[56].sensor_type, 231) << "incorrect value for last_msg_.sol_in[56].sensor_type, expected 231, is " << last_msg_.sol_in[56].sensor_type; - EXPECT_EQ(last_msg_.sol_in[57].flags, 190) << "incorrect value for last_msg_.sol_in[57].flags, expected 190, is " << last_msg_.sol_in[57].flags; - EXPECT_EQ(last_msg_.sol_in[57].sensor_type, 191) << "incorrect value for last_msg_.sol_in[57].sensor_type, expected 191, is " << last_msg_.sol_in[57].sensor_type; - EXPECT_EQ(last_msg_.sol_in[58].flags, 168) << "incorrect value for last_msg_.sol_in[58].flags, expected 168, is " << last_msg_.sol_in[58].flags; - EXPECT_EQ(last_msg_.sol_in[58].sensor_type, 178) << "incorrect value for last_msg_.sol_in[58].sensor_type, expected 178, is " << last_msg_.sol_in[58].sensor_type; - EXPECT_EQ(last_msg_.sol_in[59].flags, 233) << "incorrect value for last_msg_.sol_in[59].flags, expected 233, is " << last_msg_.sol_in[59].flags; - EXPECT_EQ(last_msg_.sol_in[59].sensor_type, 89) << "incorrect value for last_msg_.sol_in[59].sensor_type, expected 89, is " << last_msg_.sol_in[59].sensor_type; - EXPECT_EQ(last_msg_.sol_in[60].flags, 176) << "incorrect value for last_msg_.sol_in[60].flags, expected 176, is " << last_msg_.sol_in[60].flags; - EXPECT_EQ(last_msg_.sol_in[60].sensor_type, 69) << "incorrect value for last_msg_.sol_in[60].sensor_type, expected 69, is " << last_msg_.sol_in[60].sensor_type; - EXPECT_EQ(last_msg_.sol_in[61].flags, 140) << "incorrect value for last_msg_.sol_in[61].flags, expected 140, is " << last_msg_.sol_in[61].flags; - EXPECT_EQ(last_msg_.sol_in[61].sensor_type, 174) << "incorrect value for last_msg_.sol_in[61].sensor_type, expected 174, is " << last_msg_.sol_in[61].sensor_type; - EXPECT_EQ(last_msg_.sol_in[62].flags, 141) << "incorrect value for last_msg_.sol_in[62].flags, expected 141, is " << last_msg_.sol_in[62].flags; - EXPECT_EQ(last_msg_.sol_in[62].sensor_type, 182) << "incorrect value for last_msg_.sol_in[62].sensor_type, expected 182, is " << last_msg_.sol_in[62].sensor_type; - EXPECT_EQ(last_msg_.sol_in[63].flags, 82) << "incorrect value for last_msg_.sol_in[63].flags, expected 82, is " << last_msg_.sol_in[63].flags; - EXPECT_EQ(last_msg_.sol_in[63].sensor_type, 81) << "incorrect value for last_msg_.sol_in[63].sensor_type, expected 81, is " << last_msg_.sol_in[63].sensor_type; - EXPECT_EQ(last_msg_.sol_in[64].flags, 79) << "incorrect value for last_msg_.sol_in[64].flags, expected 79, is " << last_msg_.sol_in[64].flags; - EXPECT_EQ(last_msg_.sol_in[64].sensor_type, 92) << "incorrect value for last_msg_.sol_in[64].sensor_type, expected 92, is " << last_msg_.sol_in[64].sensor_type; - EXPECT_EQ(last_msg_.sol_in[65].flags, 223) << "incorrect value for last_msg_.sol_in[65].flags, expected 223, is " << last_msg_.sol_in[65].flags; - EXPECT_EQ(last_msg_.sol_in[65].sensor_type, 101) << "incorrect value for last_msg_.sol_in[65].sensor_type, expected 101, is " << last_msg_.sol_in[65].sensor_type; - EXPECT_EQ(last_msg_.sol_in[66].flags, 64) << "incorrect value for last_msg_.sol_in[66].flags, expected 64, is " << last_msg_.sol_in[66].flags; - EXPECT_EQ(last_msg_.sol_in[66].sensor_type, 100) << "incorrect value for last_msg_.sol_in[66].sensor_type, expected 100, is " << last_msg_.sol_in[66].sensor_type; - EXPECT_EQ(last_msg_.sol_in[67].flags, 215) << "incorrect value for last_msg_.sol_in[67].flags, expected 215, is " << last_msg_.sol_in[67].flags; - EXPECT_EQ(last_msg_.sol_in[67].sensor_type, 184) << "incorrect value for last_msg_.sol_in[67].sensor_type, expected 184, is " << last_msg_.sol_in[67].sensor_type; - EXPECT_EQ(last_msg_.sol_in[68].flags, 37) << "incorrect value for last_msg_.sol_in[68].flags, expected 37, is " << last_msg_.sol_in[68].flags; - EXPECT_EQ(last_msg_.sol_in[68].sensor_type, 124) << "incorrect value for last_msg_.sol_in[68].sensor_type, expected 124, is " << last_msg_.sol_in[68].sensor_type; - EXPECT_EQ(last_msg_.sol_in[69].flags, 227) << "incorrect value for last_msg_.sol_in[69].flags, expected 227, is " << last_msg_.sol_in[69].flags; - EXPECT_EQ(last_msg_.sol_in[69].sensor_type, 21) << "incorrect value for last_msg_.sol_in[69].sensor_type, expected 21, is " << last_msg_.sol_in[69].sensor_type; - EXPECT_EQ(last_msg_.sol_in[70].flags, 102) << "incorrect value for last_msg_.sol_in[70].flags, expected 102, is " << last_msg_.sol_in[70].flags; - EXPECT_EQ(last_msg_.sol_in[70].sensor_type, 135) << "incorrect value for last_msg_.sol_in[70].sensor_type, expected 135, is " << last_msg_.sol_in[70].sensor_type; - EXPECT_EQ(last_msg_.sol_in[71].flags, 36) << "incorrect value for last_msg_.sol_in[71].flags, expected 36, is " << last_msg_.sol_in[71].flags; - EXPECT_EQ(last_msg_.sol_in[71].sensor_type, 72) << "incorrect value for last_msg_.sol_in[71].sensor_type, expected 72, is " << last_msg_.sol_in[71].sensor_type; - EXPECT_EQ(last_msg_.sol_in[72].flags, 56) << "incorrect value for last_msg_.sol_in[72].flags, expected 56, is " << last_msg_.sol_in[72].flags; - EXPECT_EQ(last_msg_.sol_in[72].sensor_type, 219) << "incorrect value for last_msg_.sol_in[72].sensor_type, expected 219, is " << last_msg_.sol_in[72].sensor_type; - EXPECT_EQ(last_msg_.sol_in[73].flags, 90) << "incorrect value for last_msg_.sol_in[73].flags, expected 90, is " << last_msg_.sol_in[73].flags; - EXPECT_EQ(last_msg_.sol_in[73].sensor_type, 146) << "incorrect value for last_msg_.sol_in[73].sensor_type, expected 146, is " << last_msg_.sol_in[73].sensor_type; - EXPECT_EQ(last_msg_.sol_in[74].flags, 104) << "incorrect value for last_msg_.sol_in[74].flags, expected 104, is " << last_msg_.sol_in[74].flags; - EXPECT_EQ(last_msg_.sol_in[74].sensor_type, 219) << "incorrect value for last_msg_.sol_in[74].sensor_type, expected 219, is " << last_msg_.sol_in[74].sensor_type; - EXPECT_EQ(last_msg_.sol_in[75].flags, 102) << "incorrect value for last_msg_.sol_in[75].flags, expected 102, is " << last_msg_.sol_in[75].flags; - EXPECT_EQ(last_msg_.sol_in[75].sensor_type, 227) << "incorrect value for last_msg_.sol_in[75].sensor_type, expected 227, is " << last_msg_.sol_in[75].sensor_type; - EXPECT_EQ(last_msg_.sol_in[76].flags, 12) << "incorrect value for last_msg_.sol_in[76].flags, expected 12, is " << last_msg_.sol_in[76].flags; - EXPECT_EQ(last_msg_.sol_in[76].sensor_type, 83) << "incorrect value for last_msg_.sol_in[76].sensor_type, expected 83, is " << last_msg_.sol_in[76].sensor_type; - EXPECT_EQ(last_msg_.sol_in[77].flags, 122) << "incorrect value for last_msg_.sol_in[77].flags, expected 122, is " << last_msg_.sol_in[77].flags; - EXPECT_EQ(last_msg_.sol_in[77].sensor_type, 41) << "incorrect value for last_msg_.sol_in[77].sensor_type, expected 41, is " << last_msg_.sol_in[77].sensor_type; - EXPECT_EQ(last_msg_.sol_in[78].flags, 94) << "incorrect value for last_msg_.sol_in[78].flags, expected 94, is " << last_msg_.sol_in[78].flags; - EXPECT_EQ(last_msg_.sol_in[78].sensor_type, 173) << "incorrect value for last_msg_.sol_in[78].sensor_type, expected 173, is " << last_msg_.sol_in[78].sensor_type; - EXPECT_EQ(last_msg_.sol_in[79].flags, 174) << "incorrect value for last_msg_.sol_in[79].flags, expected 174, is " << last_msg_.sol_in[79].flags; - EXPECT_EQ(last_msg_.sol_in[79].sensor_type, 1) << "incorrect value for last_msg_.sol_in[79].sensor_type, expected 1, is " << last_msg_.sol_in[79].sensor_type; - EXPECT_EQ(last_msg_.sol_in[80].flags, 130) << "incorrect value for last_msg_.sol_in[80].flags, expected 130, is " << last_msg_.sol_in[80].flags; - EXPECT_EQ(last_msg_.sol_in[80].sensor_type, 134) << "incorrect value for last_msg_.sol_in[80].sensor_type, expected 134, is " << last_msg_.sol_in[80].sensor_type; - EXPECT_EQ(last_msg_.sol_in[81].flags, 237) << "incorrect value for last_msg_.sol_in[81].flags, expected 237, is " << last_msg_.sol_in[81].flags; - EXPECT_EQ(last_msg_.sol_in[81].sensor_type, 104) << "incorrect value for last_msg_.sol_in[81].sensor_type, expected 104, is " << last_msg_.sol_in[81].sensor_type; - EXPECT_EQ(last_msg_.sol_in[82].flags, 249) << "incorrect value for last_msg_.sol_in[82].flags, expected 249, is " << last_msg_.sol_in[82].flags; - EXPECT_EQ(last_msg_.sol_in[82].sensor_type, 116) << "incorrect value for last_msg_.sol_in[82].sensor_type, expected 116, is " << last_msg_.sol_in[82].sensor_type; - EXPECT_EQ(last_msg_.sol_in[83].flags, 230) << "incorrect value for last_msg_.sol_in[83].flags, expected 230, is " << last_msg_.sol_in[83].flags; - EXPECT_EQ(last_msg_.sol_in[83].sensor_type, 107) << "incorrect value for last_msg_.sol_in[83].sensor_type, expected 107, is " << last_msg_.sol_in[83].sensor_type; - EXPECT_EQ(last_msg_.sol_in[84].flags, 123) << "incorrect value for last_msg_.sol_in[84].flags, expected 123, is " << last_msg_.sol_in[84].flags; - EXPECT_EQ(last_msg_.sol_in[84].sensor_type, 130) << "incorrect value for last_msg_.sol_in[84].sensor_type, expected 130, is " << last_msg_.sol_in[84].sensor_type; - EXPECT_EQ(last_msg_.sol_in[85].flags, 162) << "incorrect value for last_msg_.sol_in[85].flags, expected 162, is " << last_msg_.sol_in[85].flags; - EXPECT_EQ(last_msg_.sol_in[85].sensor_type, 25) << "incorrect value for last_msg_.sol_in[85].sensor_type, expected 25, is " << last_msg_.sol_in[85].sensor_type; - EXPECT_EQ(last_msg_.sol_in[86].flags, 223) << "incorrect value for last_msg_.sol_in[86].flags, expected 223, is " << last_msg_.sol_in[86].flags; - EXPECT_EQ(last_msg_.sol_in[86].sensor_type, 57) << "incorrect value for last_msg_.sol_in[86].sensor_type, expected 57, is " << last_msg_.sol_in[86].sensor_type; - EXPECT_EQ(last_msg_.sol_in[87].flags, 174) << "incorrect value for last_msg_.sol_in[87].flags, expected 174, is " << last_msg_.sol_in[87].flags; - EXPECT_EQ(last_msg_.sol_in[87].sensor_type, 193) << "incorrect value for last_msg_.sol_in[87].sensor_type, expected 193, is " << last_msg_.sol_in[87].sensor_type; - EXPECT_EQ(last_msg_.sol_in[88].flags, 193) << "incorrect value for last_msg_.sol_in[88].flags, expected 193, is " << last_msg_.sol_in[88].flags; - EXPECT_EQ(last_msg_.sol_in[88].sensor_type, 146) << "incorrect value for last_msg_.sol_in[88].sensor_type, expected 146, is " << last_msg_.sol_in[88].sensor_type; - EXPECT_EQ(last_msg_.sol_in[89].flags, 44) << "incorrect value for last_msg_.sol_in[89].flags, expected 44, is " << last_msg_.sol_in[89].flags; - EXPECT_EQ(last_msg_.sol_in[89].sensor_type, 239) << "incorrect value for last_msg_.sol_in[89].sensor_type, expected 239, is " << last_msg_.sol_in[89].sensor_type; - EXPECT_EQ(last_msg_.sol_in[90].flags, 197) << "incorrect value for last_msg_.sol_in[90].flags, expected 197, is " << last_msg_.sol_in[90].flags; - EXPECT_EQ(last_msg_.sol_in[90].sensor_type, 246) << "incorrect value for last_msg_.sol_in[90].sensor_type, expected 246, is " << last_msg_.sol_in[90].sensor_type; - EXPECT_EQ(last_msg_.sol_in[91].flags, 80) << "incorrect value for last_msg_.sol_in[91].flags, expected 80, is " << last_msg_.sol_in[91].flags; - EXPECT_EQ(last_msg_.sol_in[91].sensor_type, 214) << "incorrect value for last_msg_.sol_in[91].sensor_type, expected 214, is " << last_msg_.sol_in[91].sensor_type; - EXPECT_EQ(last_msg_.sol_in[92].flags, 100) << "incorrect value for last_msg_.sol_in[92].flags, expected 100, is " << last_msg_.sol_in[92].flags; - EXPECT_EQ(last_msg_.sol_in[92].sensor_type, 83) << "incorrect value for last_msg_.sol_in[92].sensor_type, expected 83, is " << last_msg_.sol_in[92].sensor_type; - EXPECT_EQ(last_msg_.sol_in[93].flags, 72) << "incorrect value for last_msg_.sol_in[93].flags, expected 72, is " << last_msg_.sol_in[93].flags; - EXPECT_EQ(last_msg_.sol_in[93].sensor_type, 66) << "incorrect value for last_msg_.sol_in[93].sensor_type, expected 66, is " << last_msg_.sol_in[93].sensor_type; - EXPECT_EQ(last_msg_.sol_in[94].flags, 137) << "incorrect value for last_msg_.sol_in[94].flags, expected 137, is " << last_msg_.sol_in[94].flags; - EXPECT_EQ(last_msg_.sol_in[94].sensor_type, 133) << "incorrect value for last_msg_.sol_in[94].sensor_type, expected 133, is " << last_msg_.sol_in[94].sensor_type; - EXPECT_EQ(last_msg_.sol_in[95].flags, 82) << "incorrect value for last_msg_.sol_in[95].flags, expected 82, is " << last_msg_.sol_in[95].flags; - EXPECT_EQ(last_msg_.sol_in[95].sensor_type, 140) << "incorrect value for last_msg_.sol_in[95].sensor_type, expected 140, is " << last_msg_.sol_in[95].sensor_type; - EXPECT_EQ(last_msg_.sol_in[96].flags, 2) << "incorrect value for last_msg_.sol_in[96].flags, expected 2, is " << last_msg_.sol_in[96].flags; - EXPECT_EQ(last_msg_.sol_in[96].sensor_type, 2) << "incorrect value for last_msg_.sol_in[96].sensor_type, expected 2, is " << last_msg_.sol_in[96].sensor_type; - EXPECT_EQ(last_msg_.sol_in[97].flags, 9) << "incorrect value for last_msg_.sol_in[97].flags, expected 9, is " << last_msg_.sol_in[97].flags; - EXPECT_EQ(last_msg_.sol_in[97].sensor_type, 96) << "incorrect value for last_msg_.sol_in[97].sensor_type, expected 96, is " << last_msg_.sol_in[97].sensor_type; - EXPECT_EQ(last_msg_.sol_in[98].flags, 158) << "incorrect value for last_msg_.sol_in[98].flags, expected 158, is " << last_msg_.sol_in[98].flags; - EXPECT_EQ(last_msg_.sol_in[98].sensor_type, 96) << "incorrect value for last_msg_.sol_in[98].sensor_type, expected 96, is " << last_msg_.sol_in[98].sensor_type; - EXPECT_EQ(last_msg_.sol_in[99].flags, 97) << "incorrect value for last_msg_.sol_in[99].flags, expected 97, is " << last_msg_.sol_in[99].flags; - EXPECT_EQ(last_msg_.sol_in[99].sensor_type, 134) << "incorrect value for last_msg_.sol_in[99].sensor_type, expected 134, is " << last_msg_.sol_in[99].sensor_type; - EXPECT_EQ(last_msg_.sol_in[100].flags, 129) << "incorrect value for last_msg_.sol_in[100].flags, expected 129, is " << last_msg_.sol_in[100].flags; - EXPECT_EQ(last_msg_.sol_in[100].sensor_type, 43) << "incorrect value for last_msg_.sol_in[100].sensor_type, expected 43, is " << last_msg_.sol_in[100].sensor_type; - EXPECT_EQ(last_msg_.sol_in[101].flags, 25) << "incorrect value for last_msg_.sol_in[101].flags, expected 25, is " << last_msg_.sol_in[101].flags; - EXPECT_EQ(last_msg_.sol_in[101].sensor_type, 141) << "incorrect value for last_msg_.sol_in[101].sensor_type, expected 141, is " << last_msg_.sol_in[101].sensor_type; - EXPECT_EQ(last_msg_.sol_in[102].flags, 200) << "incorrect value for last_msg_.sol_in[102].flags, expected 200, is " << last_msg_.sol_in[102].flags; - EXPECT_EQ(last_msg_.sol_in[102].sensor_type, 183) << "incorrect value for last_msg_.sol_in[102].sensor_type, expected 183, is " << last_msg_.sol_in[102].sensor_type; - EXPECT_EQ(last_msg_.sol_in[103].flags, 57) << "incorrect value for last_msg_.sol_in[103].flags, expected 57, is " << last_msg_.sol_in[103].flags; - EXPECT_EQ(last_msg_.sol_in[103].sensor_type, 214) << "incorrect value for last_msg_.sol_in[103].sensor_type, expected 214, is " << last_msg_.sol_in[103].sensor_type; - EXPECT_EQ(last_msg_.sol_in[104].flags, 103) << "incorrect value for last_msg_.sol_in[104].flags, expected 103, is " << last_msg_.sol_in[104].flags; - EXPECT_EQ(last_msg_.sol_in[104].sensor_type, 248) << "incorrect value for last_msg_.sol_in[104].sensor_type, expected 248, is " << last_msg_.sol_in[104].sensor_type; - EXPECT_EQ(last_msg_.sol_in[105].flags, 65) << "incorrect value for last_msg_.sol_in[105].flags, expected 65, is " << last_msg_.sol_in[105].flags; - EXPECT_EQ(last_msg_.sol_in[105].sensor_type, 222) << "incorrect value for last_msg_.sol_in[105].sensor_type, expected 222, is " << last_msg_.sol_in[105].sensor_type; - EXPECT_EQ(last_msg_.sol_in[106].flags, 15) << "incorrect value for last_msg_.sol_in[106].flags, expected 15, is " << last_msg_.sol_in[106].flags; - EXPECT_EQ(last_msg_.sol_in[106].sensor_type, 195) << "incorrect value for last_msg_.sol_in[106].sensor_type, expected 195, is " << last_msg_.sol_in[106].sensor_type; - EXPECT_EQ(last_msg_.sol_in[107].flags, 21) << "incorrect value for last_msg_.sol_in[107].flags, expected 21, is " << last_msg_.sol_in[107].flags; - EXPECT_EQ(last_msg_.sol_in[107].sensor_type, 244) << "incorrect value for last_msg_.sol_in[107].sensor_type, expected 244, is " << last_msg_.sol_in[107].sensor_type; - EXPECT_EQ(last_msg_.sol_in[108].flags, 46) << "incorrect value for last_msg_.sol_in[108].flags, expected 46, is " << last_msg_.sol_in[108].flags; - EXPECT_EQ(last_msg_.sol_in[108].sensor_type, 180) << "incorrect value for last_msg_.sol_in[108].sensor_type, expected 180, is " << last_msg_.sol_in[108].sensor_type; - EXPECT_EQ(last_msg_.sol_in[109].flags, 130) << "incorrect value for last_msg_.sol_in[109].flags, expected 130, is " << last_msg_.sol_in[109].flags; - EXPECT_EQ(last_msg_.sol_in[109].sensor_type, 140) << "incorrect value for last_msg_.sol_in[109].sensor_type, expected 140, is " << last_msg_.sol_in[109].sensor_type; - EXPECT_EQ(last_msg_.sol_in[110].flags, 17) << "incorrect value for last_msg_.sol_in[110].flags, expected 17, is " << last_msg_.sol_in[110].flags; - EXPECT_EQ(last_msg_.sol_in[110].sensor_type, 36) << "incorrect value for last_msg_.sol_in[110].sensor_type, expected 36, is " << last_msg_.sol_in[110].sensor_type; - EXPECT_EQ(last_msg_.sol_in[111].flags, 209) << "incorrect value for last_msg_.sol_in[111].flags, expected 209, is " << last_msg_.sol_in[111].flags; - EXPECT_EQ(last_msg_.sol_in[111].sensor_type, 194) << "incorrect value for last_msg_.sol_in[111].sensor_type, expected 194, is " << last_msg_.sol_in[111].sensor_type; - EXPECT_EQ(last_msg_.sol_in[112].flags, 254) << "incorrect value for last_msg_.sol_in[112].flags, expected 254, is " << last_msg_.sol_in[112].flags; - EXPECT_EQ(last_msg_.sol_in[112].sensor_type, 65) << "incorrect value for last_msg_.sol_in[112].sensor_type, expected 65, is " << last_msg_.sol_in[112].sensor_type; - EXPECT_EQ(last_msg_.sol_in[113].flags, 103) << "incorrect value for last_msg_.sol_in[113].flags, expected 103, is " << last_msg_.sol_in[113].flags; - EXPECT_EQ(last_msg_.sol_in[113].sensor_type, 115) << "incorrect value for last_msg_.sol_in[113].sensor_type, expected 115, is " << last_msg_.sol_in[113].sensor_type; - EXPECT_EQ(last_msg_.sol_in[114].flags, 129) << "incorrect value for last_msg_.sol_in[114].flags, expected 129, is " << last_msg_.sol_in[114].flags; - EXPECT_EQ(last_msg_.sol_in[114].sensor_type, 152) << "incorrect value for last_msg_.sol_in[114].sensor_type, expected 152, is " << last_msg_.sol_in[114].sensor_type; - EXPECT_EQ(last_msg_.sol_in[115].flags, 235) << "incorrect value for last_msg_.sol_in[115].flags, expected 235, is " << last_msg_.sol_in[115].flags; - EXPECT_EQ(last_msg_.sol_in[115].sensor_type, 234) << "incorrect value for last_msg_.sol_in[115].sensor_type, expected 234, is " << last_msg_.sol_in[115].sensor_type; - EXPECT_EQ(last_msg_.sol_in[116].flags, 234) << "incorrect value for last_msg_.sol_in[116].flags, expected 234, is " << last_msg_.sol_in[116].flags; - EXPECT_EQ(last_msg_.sol_in[116].sensor_type, 194) << "incorrect value for last_msg_.sol_in[116].sensor_type, expected 194, is " << last_msg_.sol_in[116].sensor_type; - EXPECT_EQ(last_msg_.sol_in[117].flags, 201) << "incorrect value for last_msg_.sol_in[117].flags, expected 201, is " << last_msg_.sol_in[117].flags; - EXPECT_EQ(last_msg_.sol_in[117].sensor_type, 170) << "incorrect value for last_msg_.sol_in[117].sensor_type, expected 170, is " << last_msg_.sol_in[117].sensor_type; - EXPECT_EQ(last_msg_.sol_in[118].flags, 154) << "incorrect value for last_msg_.sol_in[118].flags, expected 154, is " << last_msg_.sol_in[118].flags; - EXPECT_EQ(last_msg_.sol_in[118].sensor_type, 210) << "incorrect value for last_msg_.sol_in[118].sensor_type, expected 210, is " << last_msg_.sol_in[118].sensor_type; - EXPECT_EQ(last_msg_.tow, 3628191792) << "incorrect value for last_msg_.tow, expected 3628191792, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.vdop, 58512) << "incorrect value for last_msg_.vdop, expected 58512, is " << last_msg_.vdop; +}; + +TEST_F(Test_auto_check_sbp_solution_meta_MsgSolnMeta0, Test) { + uint8_t encoded_frame[] = { + 85, 14, 255, 0, 60, 254, 48, 208, 65, 216, 122, 45, 196, 160, 144, + 228, 8, 83, 89, 87, 3, 213, 95, 109, 86, 131, 71, 70, 84, 73, + 131, 26, 82, 247, 140, 97, 115, 110, 118, 253, 2, 122, 186, 148, 122, + 148, 180, 231, 68, 46, 190, 102, 243, 48, 192, 15, 208, 89, 56, 10, + 245, 2, 254, 201, 120, 32, 126, 2, 83, 161, 238, 123, 102, 230, 76, + 190, 225, 182, 207, 228, 7, 218, 117, 89, 29, 191, 56, 248, 185, 255, + 46, 18, 72, 142, 82, 113, 26, 4, 172, 254, 178, 136, 113, 115, 58, + 193, 89, 227, 182, 246, 76, 77, 108, 245, 41, 31, 70, 124, 249, 145, + 15, 78, 228, 38, 241, 129, 8, 176, 251, 72, 248, 80, 115, 244, 231, + 145, 191, 190, 178, 168, 89, 233, 69, 176, 174, 140, 182, 141, 81, 82, + 92, 79, 101, 223, 100, 64, 184, 215, 124, 37, 21, 227, 135, 102, 72, + 36, 219, 56, 146, 90, 219, 104, 227, 102, 83, 12, 41, 122, 173, 94, + 1, 174, 134, 130, 104, 237, 116, 249, 107, 230, 130, 123, 25, 162, 57, + 223, 193, 174, 146, 193, 239, 44, 246, 197, 214, 80, 83, 100, 66, 72, + 133, 137, 140, 82, 2, 2, 96, 9, 96, 158, 134, 97, 43, 129, 141, + 25, 183, 200, 214, 57, 248, 103, 222, 65, 195, 15, 244, 21, 180, 46, + 140, 130, 36, 17, 194, 209, 65, 254, 115, 103, 152, 129, 234, 235, 194, + 234, 170, 201, 210, 154, 150, 247, + }; + + sbp_msg_soln_meta_t test_msg{}; + test_msg.age_corrections = 21256; + test_msg.age_gnss = 3573765977; + test_msg.hdop = 41156; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_sol_in.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)111, (char)108, + (char)95, (char)105, (char)110}; + memcpy(test_msg.n_sol_in.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_sol_in.value = 119; + test_msg.pdop = 11642; + + test_msg.sol_in[0].flags = 109; + test_msg.sol_in[0].sensor_type = 95; + + test_msg.sol_in[1].flags = 131; + test_msg.sol_in[1].sensor_type = 86; + + test_msg.sol_in[2].flags = 70; + test_msg.sol_in[2].sensor_type = 71; + + test_msg.sol_in[3].flags = 73; + test_msg.sol_in[3].sensor_type = 84; + + test_msg.sol_in[4].flags = 26; + test_msg.sol_in[4].sensor_type = 131; + + test_msg.sol_in[5].flags = 247; + test_msg.sol_in[5].sensor_type = 82; + + test_msg.sol_in[6].flags = 97; + test_msg.sol_in[6].sensor_type = 140; + + test_msg.sol_in[7].flags = 110; + test_msg.sol_in[7].sensor_type = 115; + + test_msg.sol_in[8].flags = 253; + test_msg.sol_in[8].sensor_type = 118; + + test_msg.sol_in[9].flags = 122; + test_msg.sol_in[9].sensor_type = 2; + + test_msg.sol_in[10].flags = 148; + test_msg.sol_in[10].sensor_type = 186; + + test_msg.sol_in[11].flags = 148; + test_msg.sol_in[11].sensor_type = 122; + + test_msg.sol_in[12].flags = 231; + test_msg.sol_in[12].sensor_type = 180; + + test_msg.sol_in[13].flags = 46; + test_msg.sol_in[13].sensor_type = 68; + + test_msg.sol_in[14].flags = 102; + test_msg.sol_in[14].sensor_type = 190; + + test_msg.sol_in[15].flags = 48; + test_msg.sol_in[15].sensor_type = 243; + + test_msg.sol_in[16].flags = 15; + test_msg.sol_in[16].sensor_type = 192; + + test_msg.sol_in[17].flags = 89; + test_msg.sol_in[17].sensor_type = 208; + + test_msg.sol_in[18].flags = 10; + test_msg.sol_in[18].sensor_type = 56; + + test_msg.sol_in[19].flags = 2; + test_msg.sol_in[19].sensor_type = 245; + + test_msg.sol_in[20].flags = 201; + test_msg.sol_in[20].sensor_type = 254; + + test_msg.sol_in[21].flags = 32; + test_msg.sol_in[21].sensor_type = 120; + + test_msg.sol_in[22].flags = 2; + test_msg.sol_in[22].sensor_type = 126; + + test_msg.sol_in[23].flags = 161; + test_msg.sol_in[23].sensor_type = 83; + + test_msg.sol_in[24].flags = 123; + test_msg.sol_in[24].sensor_type = 238; + + test_msg.sol_in[25].flags = 230; + test_msg.sol_in[25].sensor_type = 102; + + test_msg.sol_in[26].flags = 190; + test_msg.sol_in[26].sensor_type = 76; + + test_msg.sol_in[27].flags = 182; + test_msg.sol_in[27].sensor_type = 225; + + test_msg.sol_in[28].flags = 228; + test_msg.sol_in[28].sensor_type = 207; + + test_msg.sol_in[29].flags = 218; + test_msg.sol_in[29].sensor_type = 7; + + test_msg.sol_in[30].flags = 89; + test_msg.sol_in[30].sensor_type = 117; + + test_msg.sol_in[31].flags = 191; + test_msg.sol_in[31].sensor_type = 29; + + test_msg.sol_in[32].flags = 248; + test_msg.sol_in[32].sensor_type = 56; + + test_msg.sol_in[33].flags = 255; + test_msg.sol_in[33].sensor_type = 185; + + test_msg.sol_in[34].flags = 18; + test_msg.sol_in[34].sensor_type = 46; + + test_msg.sol_in[35].flags = 142; + test_msg.sol_in[35].sensor_type = 72; + + test_msg.sol_in[36].flags = 113; + test_msg.sol_in[36].sensor_type = 82; + + test_msg.sol_in[37].flags = 4; + test_msg.sol_in[37].sensor_type = 26; + + test_msg.sol_in[38].flags = 254; + test_msg.sol_in[38].sensor_type = 172; + + test_msg.sol_in[39].flags = 136; + test_msg.sol_in[39].sensor_type = 178; + + test_msg.sol_in[40].flags = 115; + test_msg.sol_in[40].sensor_type = 113; + + test_msg.sol_in[41].flags = 193; + test_msg.sol_in[41].sensor_type = 58; + + test_msg.sol_in[42].flags = 227; + test_msg.sol_in[42].sensor_type = 89; + + test_msg.sol_in[43].flags = 246; + test_msg.sol_in[43].sensor_type = 182; + + test_msg.sol_in[44].flags = 77; + test_msg.sol_in[44].sensor_type = 76; + + test_msg.sol_in[45].flags = 245; + test_msg.sol_in[45].sensor_type = 108; + + test_msg.sol_in[46].flags = 31; + test_msg.sol_in[46].sensor_type = 41; + + test_msg.sol_in[47].flags = 124; + test_msg.sol_in[47].sensor_type = 70; + + test_msg.sol_in[48].flags = 145; + test_msg.sol_in[48].sensor_type = 249; + + test_msg.sol_in[49].flags = 78; + test_msg.sol_in[49].sensor_type = 15; + + test_msg.sol_in[50].flags = 38; + test_msg.sol_in[50].sensor_type = 228; + + test_msg.sol_in[51].flags = 129; + test_msg.sol_in[51].sensor_type = 241; + + test_msg.sol_in[52].flags = 176; + test_msg.sol_in[52].sensor_type = 8; + + test_msg.sol_in[53].flags = 72; + test_msg.sol_in[53].sensor_type = 251; + + test_msg.sol_in[54].flags = 80; + test_msg.sol_in[54].sensor_type = 248; + + test_msg.sol_in[55].flags = 244; + test_msg.sol_in[55].sensor_type = 115; + + test_msg.sol_in[56].flags = 145; + test_msg.sol_in[56].sensor_type = 231; + + test_msg.sol_in[57].flags = 190; + test_msg.sol_in[57].sensor_type = 191; + + test_msg.sol_in[58].flags = 168; + test_msg.sol_in[58].sensor_type = 178; + + test_msg.sol_in[59].flags = 233; + test_msg.sol_in[59].sensor_type = 89; + + test_msg.sol_in[60].flags = 176; + test_msg.sol_in[60].sensor_type = 69; + + test_msg.sol_in[61].flags = 140; + test_msg.sol_in[61].sensor_type = 174; + + test_msg.sol_in[62].flags = 141; + test_msg.sol_in[62].sensor_type = 182; + + test_msg.sol_in[63].flags = 82; + test_msg.sol_in[63].sensor_type = 81; + + test_msg.sol_in[64].flags = 79; + test_msg.sol_in[64].sensor_type = 92; + + test_msg.sol_in[65].flags = 223; + test_msg.sol_in[65].sensor_type = 101; + + test_msg.sol_in[66].flags = 64; + test_msg.sol_in[66].sensor_type = 100; + + test_msg.sol_in[67].flags = 215; + test_msg.sol_in[67].sensor_type = 184; + + test_msg.sol_in[68].flags = 37; + test_msg.sol_in[68].sensor_type = 124; + + test_msg.sol_in[69].flags = 227; + test_msg.sol_in[69].sensor_type = 21; + + test_msg.sol_in[70].flags = 102; + test_msg.sol_in[70].sensor_type = 135; + + test_msg.sol_in[71].flags = 36; + test_msg.sol_in[71].sensor_type = 72; + + test_msg.sol_in[72].flags = 56; + test_msg.sol_in[72].sensor_type = 219; + + test_msg.sol_in[73].flags = 90; + test_msg.sol_in[73].sensor_type = 146; + + test_msg.sol_in[74].flags = 104; + test_msg.sol_in[74].sensor_type = 219; + + test_msg.sol_in[75].flags = 102; + test_msg.sol_in[75].sensor_type = 227; + + test_msg.sol_in[76].flags = 12; + test_msg.sol_in[76].sensor_type = 83; + + test_msg.sol_in[77].flags = 122; + test_msg.sol_in[77].sensor_type = 41; + + test_msg.sol_in[78].flags = 94; + test_msg.sol_in[78].sensor_type = 173; + + test_msg.sol_in[79].flags = 174; + test_msg.sol_in[79].sensor_type = 1; + + test_msg.sol_in[80].flags = 130; + test_msg.sol_in[80].sensor_type = 134; + + test_msg.sol_in[81].flags = 237; + test_msg.sol_in[81].sensor_type = 104; + + test_msg.sol_in[82].flags = 249; + test_msg.sol_in[82].sensor_type = 116; + + test_msg.sol_in[83].flags = 230; + test_msg.sol_in[83].sensor_type = 107; + + test_msg.sol_in[84].flags = 123; + test_msg.sol_in[84].sensor_type = 130; + + test_msg.sol_in[85].flags = 162; + test_msg.sol_in[85].sensor_type = 25; + + test_msg.sol_in[86].flags = 223; + test_msg.sol_in[86].sensor_type = 57; + + test_msg.sol_in[87].flags = 174; + test_msg.sol_in[87].sensor_type = 193; + + test_msg.sol_in[88].flags = 193; + test_msg.sol_in[88].sensor_type = 146; + + test_msg.sol_in[89].flags = 44; + test_msg.sol_in[89].sensor_type = 239; + + test_msg.sol_in[90].flags = 197; + test_msg.sol_in[90].sensor_type = 246; + + test_msg.sol_in[91].flags = 80; + test_msg.sol_in[91].sensor_type = 214; + + test_msg.sol_in[92].flags = 100; + test_msg.sol_in[92].sensor_type = 83; + + test_msg.sol_in[93].flags = 72; + test_msg.sol_in[93].sensor_type = 66; + + test_msg.sol_in[94].flags = 137; + test_msg.sol_in[94].sensor_type = 133; + + test_msg.sol_in[95].flags = 82; + test_msg.sol_in[95].sensor_type = 140; + + test_msg.sol_in[96].flags = 2; + test_msg.sol_in[96].sensor_type = 2; + + test_msg.sol_in[97].flags = 9; + test_msg.sol_in[97].sensor_type = 96; + + test_msg.sol_in[98].flags = 158; + test_msg.sol_in[98].sensor_type = 96; + + test_msg.sol_in[99].flags = 97; + test_msg.sol_in[99].sensor_type = 134; + + test_msg.sol_in[100].flags = 129; + test_msg.sol_in[100].sensor_type = 43; + + test_msg.sol_in[101].flags = 25; + test_msg.sol_in[101].sensor_type = 141; + + test_msg.sol_in[102].flags = 200; + test_msg.sol_in[102].sensor_type = 183; + + test_msg.sol_in[103].flags = 57; + test_msg.sol_in[103].sensor_type = 214; + + test_msg.sol_in[104].flags = 103; + test_msg.sol_in[104].sensor_type = 248; + + test_msg.sol_in[105].flags = 65; + test_msg.sol_in[105].sensor_type = 222; + + test_msg.sol_in[106].flags = 15; + test_msg.sol_in[106].sensor_type = 195; + + test_msg.sol_in[107].flags = 21; + test_msg.sol_in[107].sensor_type = 244; + + test_msg.sol_in[108].flags = 46; + test_msg.sol_in[108].sensor_type = 180; + + test_msg.sol_in[109].flags = 130; + test_msg.sol_in[109].sensor_type = 140; + + test_msg.sol_in[110].flags = 17; + test_msg.sol_in[110].sensor_type = 36; + + test_msg.sol_in[111].flags = 209; + test_msg.sol_in[111].sensor_type = 194; + + test_msg.sol_in[112].flags = 254; + test_msg.sol_in[112].sensor_type = 65; + + test_msg.sol_in[113].flags = 103; + test_msg.sol_in[113].sensor_type = 115; + + test_msg.sol_in[114].flags = 129; + test_msg.sol_in[114].sensor_type = 152; + + test_msg.sol_in[115].flags = 235; + test_msg.sol_in[115].sensor_type = 234; + + test_msg.sol_in[116].flags = 234; + test_msg.sol_in[116].sensor_type = 194; + + test_msg.sol_in[117].flags = 201; + test_msg.sol_in[117].sensor_type = 170; + + test_msg.sol_in[118].flags = 154; + test_msg.sol_in[118].sensor_type = 210; + test_msg.tow = 3628191792; + test_msg.vdop = 58512; + + EXPECT_EQ(send_message(15360, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 15360); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.age_corrections, 21256) + << "incorrect value for last_msg_.age_corrections, expected 21256, is " + << last_msg_.age_corrections; + EXPECT_EQ(last_msg_.age_gnss, 3573765977) + << "incorrect value for last_msg_.age_gnss, expected 3573765977, is " + << last_msg_.age_gnss; + EXPECT_EQ(last_msg_.hdop, 41156) + << "incorrect value for last_msg_.hdop, expected 41156, is " + << last_msg_.hdop; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_sol_in.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_sol_in.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_sol_in.handle_as << "'"; + } + { + const char check_string[] = {(char)115, (char)111, (char)108, + (char)95, (char)105, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_sol_in.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_sol_in.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.n_sol_in.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_sol_in.value, 119) + << "incorrect value for last_msg_.n_sol_in.value, expected 119, is " + << last_msg_.n_sol_in.value; + EXPECT_EQ(last_msg_.pdop, 11642) + << "incorrect value for last_msg_.pdop, expected 11642, is " + << last_msg_.pdop; + EXPECT_EQ(last_msg_.sol_in[0].flags, 109) + << "incorrect value for last_msg_.sol_in[0].flags, expected 109, is " + << last_msg_.sol_in[0].flags; + EXPECT_EQ(last_msg_.sol_in[0].sensor_type, 95) + << "incorrect value for last_msg_.sol_in[0].sensor_type, expected 95, is " + << last_msg_.sol_in[0].sensor_type; + EXPECT_EQ(last_msg_.sol_in[1].flags, 131) + << "incorrect value for last_msg_.sol_in[1].flags, expected 131, is " + << last_msg_.sol_in[1].flags; + EXPECT_EQ(last_msg_.sol_in[1].sensor_type, 86) + << "incorrect value for last_msg_.sol_in[1].sensor_type, expected 86, is " + << last_msg_.sol_in[1].sensor_type; + EXPECT_EQ(last_msg_.sol_in[2].flags, 70) + << "incorrect value for last_msg_.sol_in[2].flags, expected 70, is " + << last_msg_.sol_in[2].flags; + EXPECT_EQ(last_msg_.sol_in[2].sensor_type, 71) + << "incorrect value for last_msg_.sol_in[2].sensor_type, expected 71, is " + << last_msg_.sol_in[2].sensor_type; + EXPECT_EQ(last_msg_.sol_in[3].flags, 73) + << "incorrect value for last_msg_.sol_in[3].flags, expected 73, is " + << last_msg_.sol_in[3].flags; + EXPECT_EQ(last_msg_.sol_in[3].sensor_type, 84) + << "incorrect value for last_msg_.sol_in[3].sensor_type, expected 84, is " + << last_msg_.sol_in[3].sensor_type; + EXPECT_EQ(last_msg_.sol_in[4].flags, 26) + << "incorrect value for last_msg_.sol_in[4].flags, expected 26, is " + << last_msg_.sol_in[4].flags; + EXPECT_EQ(last_msg_.sol_in[4].sensor_type, 131) + << "incorrect value for last_msg_.sol_in[4].sensor_type, expected 131, " + "is " + << last_msg_.sol_in[4].sensor_type; + EXPECT_EQ(last_msg_.sol_in[5].flags, 247) + << "incorrect value for last_msg_.sol_in[5].flags, expected 247, is " + << last_msg_.sol_in[5].flags; + EXPECT_EQ(last_msg_.sol_in[5].sensor_type, 82) + << "incorrect value for last_msg_.sol_in[5].sensor_type, expected 82, is " + << last_msg_.sol_in[5].sensor_type; + EXPECT_EQ(last_msg_.sol_in[6].flags, 97) + << "incorrect value for last_msg_.sol_in[6].flags, expected 97, is " + << last_msg_.sol_in[6].flags; + EXPECT_EQ(last_msg_.sol_in[6].sensor_type, 140) + << "incorrect value for last_msg_.sol_in[6].sensor_type, expected 140, " + "is " + << last_msg_.sol_in[6].sensor_type; + EXPECT_EQ(last_msg_.sol_in[7].flags, 110) + << "incorrect value for last_msg_.sol_in[7].flags, expected 110, is " + << last_msg_.sol_in[7].flags; + EXPECT_EQ(last_msg_.sol_in[7].sensor_type, 115) + << "incorrect value for last_msg_.sol_in[7].sensor_type, expected 115, " + "is " + << last_msg_.sol_in[7].sensor_type; + EXPECT_EQ(last_msg_.sol_in[8].flags, 253) + << "incorrect value for last_msg_.sol_in[8].flags, expected 253, is " + << last_msg_.sol_in[8].flags; + EXPECT_EQ(last_msg_.sol_in[8].sensor_type, 118) + << "incorrect value for last_msg_.sol_in[8].sensor_type, expected 118, " + "is " + << last_msg_.sol_in[8].sensor_type; + EXPECT_EQ(last_msg_.sol_in[9].flags, 122) + << "incorrect value for last_msg_.sol_in[9].flags, expected 122, is " + << last_msg_.sol_in[9].flags; + EXPECT_EQ(last_msg_.sol_in[9].sensor_type, 2) + << "incorrect value for last_msg_.sol_in[9].sensor_type, expected 2, is " + << last_msg_.sol_in[9].sensor_type; + EXPECT_EQ(last_msg_.sol_in[10].flags, 148) + << "incorrect value for last_msg_.sol_in[10].flags, expected 148, is " + << last_msg_.sol_in[10].flags; + EXPECT_EQ(last_msg_.sol_in[10].sensor_type, 186) + << "incorrect value for last_msg_.sol_in[10].sensor_type, expected 186, " + "is " + << last_msg_.sol_in[10].sensor_type; + EXPECT_EQ(last_msg_.sol_in[11].flags, 148) + << "incorrect value for last_msg_.sol_in[11].flags, expected 148, is " + << last_msg_.sol_in[11].flags; + EXPECT_EQ(last_msg_.sol_in[11].sensor_type, 122) + << "incorrect value for last_msg_.sol_in[11].sensor_type, expected 122, " + "is " + << last_msg_.sol_in[11].sensor_type; + EXPECT_EQ(last_msg_.sol_in[12].flags, 231) + << "incorrect value for last_msg_.sol_in[12].flags, expected 231, is " + << last_msg_.sol_in[12].flags; + EXPECT_EQ(last_msg_.sol_in[12].sensor_type, 180) + << "incorrect value for last_msg_.sol_in[12].sensor_type, expected 180, " + "is " + << last_msg_.sol_in[12].sensor_type; + EXPECT_EQ(last_msg_.sol_in[13].flags, 46) + << "incorrect value for last_msg_.sol_in[13].flags, expected 46, is " + << last_msg_.sol_in[13].flags; + EXPECT_EQ(last_msg_.sol_in[13].sensor_type, 68) + << "incorrect value for last_msg_.sol_in[13].sensor_type, expected 68, " + "is " + << last_msg_.sol_in[13].sensor_type; + EXPECT_EQ(last_msg_.sol_in[14].flags, 102) + << "incorrect value for last_msg_.sol_in[14].flags, expected 102, is " + << last_msg_.sol_in[14].flags; + EXPECT_EQ(last_msg_.sol_in[14].sensor_type, 190) + << "incorrect value for last_msg_.sol_in[14].sensor_type, expected 190, " + "is " + << last_msg_.sol_in[14].sensor_type; + EXPECT_EQ(last_msg_.sol_in[15].flags, 48) + << "incorrect value for last_msg_.sol_in[15].flags, expected 48, is " + << last_msg_.sol_in[15].flags; + EXPECT_EQ(last_msg_.sol_in[15].sensor_type, 243) + << "incorrect value for last_msg_.sol_in[15].sensor_type, expected 243, " + "is " + << last_msg_.sol_in[15].sensor_type; + EXPECT_EQ(last_msg_.sol_in[16].flags, 15) + << "incorrect value for last_msg_.sol_in[16].flags, expected 15, is " + << last_msg_.sol_in[16].flags; + EXPECT_EQ(last_msg_.sol_in[16].sensor_type, 192) + << "incorrect value for last_msg_.sol_in[16].sensor_type, expected 192, " + "is " + << last_msg_.sol_in[16].sensor_type; + EXPECT_EQ(last_msg_.sol_in[17].flags, 89) + << "incorrect value for last_msg_.sol_in[17].flags, expected 89, is " + << last_msg_.sol_in[17].flags; + EXPECT_EQ(last_msg_.sol_in[17].sensor_type, 208) + << "incorrect value for last_msg_.sol_in[17].sensor_type, expected 208, " + "is " + << last_msg_.sol_in[17].sensor_type; + EXPECT_EQ(last_msg_.sol_in[18].flags, 10) + << "incorrect value for last_msg_.sol_in[18].flags, expected 10, is " + << last_msg_.sol_in[18].flags; + EXPECT_EQ(last_msg_.sol_in[18].sensor_type, 56) + << "incorrect value for last_msg_.sol_in[18].sensor_type, expected 56, " + "is " + << last_msg_.sol_in[18].sensor_type; + EXPECT_EQ(last_msg_.sol_in[19].flags, 2) + << "incorrect value for last_msg_.sol_in[19].flags, expected 2, is " + << last_msg_.sol_in[19].flags; + EXPECT_EQ(last_msg_.sol_in[19].sensor_type, 245) + << "incorrect value for last_msg_.sol_in[19].sensor_type, expected 245, " + "is " + << last_msg_.sol_in[19].sensor_type; + EXPECT_EQ(last_msg_.sol_in[20].flags, 201) + << "incorrect value for last_msg_.sol_in[20].flags, expected 201, is " + << last_msg_.sol_in[20].flags; + EXPECT_EQ(last_msg_.sol_in[20].sensor_type, 254) + << "incorrect value for last_msg_.sol_in[20].sensor_type, expected 254, " + "is " + << last_msg_.sol_in[20].sensor_type; + EXPECT_EQ(last_msg_.sol_in[21].flags, 32) + << "incorrect value for last_msg_.sol_in[21].flags, expected 32, is " + << last_msg_.sol_in[21].flags; + EXPECT_EQ(last_msg_.sol_in[21].sensor_type, 120) + << "incorrect value for last_msg_.sol_in[21].sensor_type, expected 120, " + "is " + << last_msg_.sol_in[21].sensor_type; + EXPECT_EQ(last_msg_.sol_in[22].flags, 2) + << "incorrect value for last_msg_.sol_in[22].flags, expected 2, is " + << last_msg_.sol_in[22].flags; + EXPECT_EQ(last_msg_.sol_in[22].sensor_type, 126) + << "incorrect value for last_msg_.sol_in[22].sensor_type, expected 126, " + "is " + << last_msg_.sol_in[22].sensor_type; + EXPECT_EQ(last_msg_.sol_in[23].flags, 161) + << "incorrect value for last_msg_.sol_in[23].flags, expected 161, is " + << last_msg_.sol_in[23].flags; + EXPECT_EQ(last_msg_.sol_in[23].sensor_type, 83) + << "incorrect value for last_msg_.sol_in[23].sensor_type, expected 83, " + "is " + << last_msg_.sol_in[23].sensor_type; + EXPECT_EQ(last_msg_.sol_in[24].flags, 123) + << "incorrect value for last_msg_.sol_in[24].flags, expected 123, is " + << last_msg_.sol_in[24].flags; + EXPECT_EQ(last_msg_.sol_in[24].sensor_type, 238) + << "incorrect value for last_msg_.sol_in[24].sensor_type, expected 238, " + "is " + << last_msg_.sol_in[24].sensor_type; + EXPECT_EQ(last_msg_.sol_in[25].flags, 230) + << "incorrect value for last_msg_.sol_in[25].flags, expected 230, is " + << last_msg_.sol_in[25].flags; + EXPECT_EQ(last_msg_.sol_in[25].sensor_type, 102) + << "incorrect value for last_msg_.sol_in[25].sensor_type, expected 102, " + "is " + << last_msg_.sol_in[25].sensor_type; + EXPECT_EQ(last_msg_.sol_in[26].flags, 190) + << "incorrect value for last_msg_.sol_in[26].flags, expected 190, is " + << last_msg_.sol_in[26].flags; + EXPECT_EQ(last_msg_.sol_in[26].sensor_type, 76) + << "incorrect value for last_msg_.sol_in[26].sensor_type, expected 76, " + "is " + << last_msg_.sol_in[26].sensor_type; + EXPECT_EQ(last_msg_.sol_in[27].flags, 182) + << "incorrect value for last_msg_.sol_in[27].flags, expected 182, is " + << last_msg_.sol_in[27].flags; + EXPECT_EQ(last_msg_.sol_in[27].sensor_type, 225) + << "incorrect value for last_msg_.sol_in[27].sensor_type, expected 225, " + "is " + << last_msg_.sol_in[27].sensor_type; + EXPECT_EQ(last_msg_.sol_in[28].flags, 228) + << "incorrect value for last_msg_.sol_in[28].flags, expected 228, is " + << last_msg_.sol_in[28].flags; + EXPECT_EQ(last_msg_.sol_in[28].sensor_type, 207) + << "incorrect value for last_msg_.sol_in[28].sensor_type, expected 207, " + "is " + << last_msg_.sol_in[28].sensor_type; + EXPECT_EQ(last_msg_.sol_in[29].flags, 218) + << "incorrect value for last_msg_.sol_in[29].flags, expected 218, is " + << last_msg_.sol_in[29].flags; + EXPECT_EQ(last_msg_.sol_in[29].sensor_type, 7) + << "incorrect value for last_msg_.sol_in[29].sensor_type, expected 7, is " + << last_msg_.sol_in[29].sensor_type; + EXPECT_EQ(last_msg_.sol_in[30].flags, 89) + << "incorrect value for last_msg_.sol_in[30].flags, expected 89, is " + << last_msg_.sol_in[30].flags; + EXPECT_EQ(last_msg_.sol_in[30].sensor_type, 117) + << "incorrect value for last_msg_.sol_in[30].sensor_type, expected 117, " + "is " + << last_msg_.sol_in[30].sensor_type; + EXPECT_EQ(last_msg_.sol_in[31].flags, 191) + << "incorrect value for last_msg_.sol_in[31].flags, expected 191, is " + << last_msg_.sol_in[31].flags; + EXPECT_EQ(last_msg_.sol_in[31].sensor_type, 29) + << "incorrect value for last_msg_.sol_in[31].sensor_type, expected 29, " + "is " + << last_msg_.sol_in[31].sensor_type; + EXPECT_EQ(last_msg_.sol_in[32].flags, 248) + << "incorrect value for last_msg_.sol_in[32].flags, expected 248, is " + << last_msg_.sol_in[32].flags; + EXPECT_EQ(last_msg_.sol_in[32].sensor_type, 56) + << "incorrect value for last_msg_.sol_in[32].sensor_type, expected 56, " + "is " + << last_msg_.sol_in[32].sensor_type; + EXPECT_EQ(last_msg_.sol_in[33].flags, 255) + << "incorrect value for last_msg_.sol_in[33].flags, expected 255, is " + << last_msg_.sol_in[33].flags; + EXPECT_EQ(last_msg_.sol_in[33].sensor_type, 185) + << "incorrect value for last_msg_.sol_in[33].sensor_type, expected 185, " + "is " + << last_msg_.sol_in[33].sensor_type; + EXPECT_EQ(last_msg_.sol_in[34].flags, 18) + << "incorrect value for last_msg_.sol_in[34].flags, expected 18, is " + << last_msg_.sol_in[34].flags; + EXPECT_EQ(last_msg_.sol_in[34].sensor_type, 46) + << "incorrect value for last_msg_.sol_in[34].sensor_type, expected 46, " + "is " + << last_msg_.sol_in[34].sensor_type; + EXPECT_EQ(last_msg_.sol_in[35].flags, 142) + << "incorrect value for last_msg_.sol_in[35].flags, expected 142, is " + << last_msg_.sol_in[35].flags; + EXPECT_EQ(last_msg_.sol_in[35].sensor_type, 72) + << "incorrect value for last_msg_.sol_in[35].sensor_type, expected 72, " + "is " + << last_msg_.sol_in[35].sensor_type; + EXPECT_EQ(last_msg_.sol_in[36].flags, 113) + << "incorrect value for last_msg_.sol_in[36].flags, expected 113, is " + << last_msg_.sol_in[36].flags; + EXPECT_EQ(last_msg_.sol_in[36].sensor_type, 82) + << "incorrect value for last_msg_.sol_in[36].sensor_type, expected 82, " + "is " + << last_msg_.sol_in[36].sensor_type; + EXPECT_EQ(last_msg_.sol_in[37].flags, 4) + << "incorrect value for last_msg_.sol_in[37].flags, expected 4, is " + << last_msg_.sol_in[37].flags; + EXPECT_EQ(last_msg_.sol_in[37].sensor_type, 26) + << "incorrect value for last_msg_.sol_in[37].sensor_type, expected 26, " + "is " + << last_msg_.sol_in[37].sensor_type; + EXPECT_EQ(last_msg_.sol_in[38].flags, 254) + << "incorrect value for last_msg_.sol_in[38].flags, expected 254, is " + << last_msg_.sol_in[38].flags; + EXPECT_EQ(last_msg_.sol_in[38].sensor_type, 172) + << "incorrect value for last_msg_.sol_in[38].sensor_type, expected 172, " + "is " + << last_msg_.sol_in[38].sensor_type; + EXPECT_EQ(last_msg_.sol_in[39].flags, 136) + << "incorrect value for last_msg_.sol_in[39].flags, expected 136, is " + << last_msg_.sol_in[39].flags; + EXPECT_EQ(last_msg_.sol_in[39].sensor_type, 178) + << "incorrect value for last_msg_.sol_in[39].sensor_type, expected 178, " + "is " + << last_msg_.sol_in[39].sensor_type; + EXPECT_EQ(last_msg_.sol_in[40].flags, 115) + << "incorrect value for last_msg_.sol_in[40].flags, expected 115, is " + << last_msg_.sol_in[40].flags; + EXPECT_EQ(last_msg_.sol_in[40].sensor_type, 113) + << "incorrect value for last_msg_.sol_in[40].sensor_type, expected 113, " + "is " + << last_msg_.sol_in[40].sensor_type; + EXPECT_EQ(last_msg_.sol_in[41].flags, 193) + << "incorrect value for last_msg_.sol_in[41].flags, expected 193, is " + << last_msg_.sol_in[41].flags; + EXPECT_EQ(last_msg_.sol_in[41].sensor_type, 58) + << "incorrect value for last_msg_.sol_in[41].sensor_type, expected 58, " + "is " + << last_msg_.sol_in[41].sensor_type; + EXPECT_EQ(last_msg_.sol_in[42].flags, 227) + << "incorrect value for last_msg_.sol_in[42].flags, expected 227, is " + << last_msg_.sol_in[42].flags; + EXPECT_EQ(last_msg_.sol_in[42].sensor_type, 89) + << "incorrect value for last_msg_.sol_in[42].sensor_type, expected 89, " + "is " + << last_msg_.sol_in[42].sensor_type; + EXPECT_EQ(last_msg_.sol_in[43].flags, 246) + << "incorrect value for last_msg_.sol_in[43].flags, expected 246, is " + << last_msg_.sol_in[43].flags; + EXPECT_EQ(last_msg_.sol_in[43].sensor_type, 182) + << "incorrect value for last_msg_.sol_in[43].sensor_type, expected 182, " + "is " + << last_msg_.sol_in[43].sensor_type; + EXPECT_EQ(last_msg_.sol_in[44].flags, 77) + << "incorrect value for last_msg_.sol_in[44].flags, expected 77, is " + << last_msg_.sol_in[44].flags; + EXPECT_EQ(last_msg_.sol_in[44].sensor_type, 76) + << "incorrect value for last_msg_.sol_in[44].sensor_type, expected 76, " + "is " + << last_msg_.sol_in[44].sensor_type; + EXPECT_EQ(last_msg_.sol_in[45].flags, 245) + << "incorrect value for last_msg_.sol_in[45].flags, expected 245, is " + << last_msg_.sol_in[45].flags; + EXPECT_EQ(last_msg_.sol_in[45].sensor_type, 108) + << "incorrect value for last_msg_.sol_in[45].sensor_type, expected 108, " + "is " + << last_msg_.sol_in[45].sensor_type; + EXPECT_EQ(last_msg_.sol_in[46].flags, 31) + << "incorrect value for last_msg_.sol_in[46].flags, expected 31, is " + << last_msg_.sol_in[46].flags; + EXPECT_EQ(last_msg_.sol_in[46].sensor_type, 41) + << "incorrect value for last_msg_.sol_in[46].sensor_type, expected 41, " + "is " + << last_msg_.sol_in[46].sensor_type; + EXPECT_EQ(last_msg_.sol_in[47].flags, 124) + << "incorrect value for last_msg_.sol_in[47].flags, expected 124, is " + << last_msg_.sol_in[47].flags; + EXPECT_EQ(last_msg_.sol_in[47].sensor_type, 70) + << "incorrect value for last_msg_.sol_in[47].sensor_type, expected 70, " + "is " + << last_msg_.sol_in[47].sensor_type; + EXPECT_EQ(last_msg_.sol_in[48].flags, 145) + << "incorrect value for last_msg_.sol_in[48].flags, expected 145, is " + << last_msg_.sol_in[48].flags; + EXPECT_EQ(last_msg_.sol_in[48].sensor_type, 249) + << "incorrect value for last_msg_.sol_in[48].sensor_type, expected 249, " + "is " + << last_msg_.sol_in[48].sensor_type; + EXPECT_EQ(last_msg_.sol_in[49].flags, 78) + << "incorrect value for last_msg_.sol_in[49].flags, expected 78, is " + << last_msg_.sol_in[49].flags; + EXPECT_EQ(last_msg_.sol_in[49].sensor_type, 15) + << "incorrect value for last_msg_.sol_in[49].sensor_type, expected 15, " + "is " + << last_msg_.sol_in[49].sensor_type; + EXPECT_EQ(last_msg_.sol_in[50].flags, 38) + << "incorrect value for last_msg_.sol_in[50].flags, expected 38, is " + << last_msg_.sol_in[50].flags; + EXPECT_EQ(last_msg_.sol_in[50].sensor_type, 228) + << "incorrect value for last_msg_.sol_in[50].sensor_type, expected 228, " + "is " + << last_msg_.sol_in[50].sensor_type; + EXPECT_EQ(last_msg_.sol_in[51].flags, 129) + << "incorrect value for last_msg_.sol_in[51].flags, expected 129, is " + << last_msg_.sol_in[51].flags; + EXPECT_EQ(last_msg_.sol_in[51].sensor_type, 241) + << "incorrect value for last_msg_.sol_in[51].sensor_type, expected 241, " + "is " + << last_msg_.sol_in[51].sensor_type; + EXPECT_EQ(last_msg_.sol_in[52].flags, 176) + << "incorrect value for last_msg_.sol_in[52].flags, expected 176, is " + << last_msg_.sol_in[52].flags; + EXPECT_EQ(last_msg_.sol_in[52].sensor_type, 8) + << "incorrect value for last_msg_.sol_in[52].sensor_type, expected 8, is " + << last_msg_.sol_in[52].sensor_type; + EXPECT_EQ(last_msg_.sol_in[53].flags, 72) + << "incorrect value for last_msg_.sol_in[53].flags, expected 72, is " + << last_msg_.sol_in[53].flags; + EXPECT_EQ(last_msg_.sol_in[53].sensor_type, 251) + << "incorrect value for last_msg_.sol_in[53].sensor_type, expected 251, " + "is " + << last_msg_.sol_in[53].sensor_type; + EXPECT_EQ(last_msg_.sol_in[54].flags, 80) + << "incorrect value for last_msg_.sol_in[54].flags, expected 80, is " + << last_msg_.sol_in[54].flags; + EXPECT_EQ(last_msg_.sol_in[54].sensor_type, 248) + << "incorrect value for last_msg_.sol_in[54].sensor_type, expected 248, " + "is " + << last_msg_.sol_in[54].sensor_type; + EXPECT_EQ(last_msg_.sol_in[55].flags, 244) + << "incorrect value for last_msg_.sol_in[55].flags, expected 244, is " + << last_msg_.sol_in[55].flags; + EXPECT_EQ(last_msg_.sol_in[55].sensor_type, 115) + << "incorrect value for last_msg_.sol_in[55].sensor_type, expected 115, " + "is " + << last_msg_.sol_in[55].sensor_type; + EXPECT_EQ(last_msg_.sol_in[56].flags, 145) + << "incorrect value for last_msg_.sol_in[56].flags, expected 145, is " + << last_msg_.sol_in[56].flags; + EXPECT_EQ(last_msg_.sol_in[56].sensor_type, 231) + << "incorrect value for last_msg_.sol_in[56].sensor_type, expected 231, " + "is " + << last_msg_.sol_in[56].sensor_type; + EXPECT_EQ(last_msg_.sol_in[57].flags, 190) + << "incorrect value for last_msg_.sol_in[57].flags, expected 190, is " + << last_msg_.sol_in[57].flags; + EXPECT_EQ(last_msg_.sol_in[57].sensor_type, 191) + << "incorrect value for last_msg_.sol_in[57].sensor_type, expected 191, " + "is " + << last_msg_.sol_in[57].sensor_type; + EXPECT_EQ(last_msg_.sol_in[58].flags, 168) + << "incorrect value for last_msg_.sol_in[58].flags, expected 168, is " + << last_msg_.sol_in[58].flags; + EXPECT_EQ(last_msg_.sol_in[58].sensor_type, 178) + << "incorrect value for last_msg_.sol_in[58].sensor_type, expected 178, " + "is " + << last_msg_.sol_in[58].sensor_type; + EXPECT_EQ(last_msg_.sol_in[59].flags, 233) + << "incorrect value for last_msg_.sol_in[59].flags, expected 233, is " + << last_msg_.sol_in[59].flags; + EXPECT_EQ(last_msg_.sol_in[59].sensor_type, 89) + << "incorrect value for last_msg_.sol_in[59].sensor_type, expected 89, " + "is " + << last_msg_.sol_in[59].sensor_type; + EXPECT_EQ(last_msg_.sol_in[60].flags, 176) + << "incorrect value for last_msg_.sol_in[60].flags, expected 176, is " + << last_msg_.sol_in[60].flags; + EXPECT_EQ(last_msg_.sol_in[60].sensor_type, 69) + << "incorrect value for last_msg_.sol_in[60].sensor_type, expected 69, " + "is " + << last_msg_.sol_in[60].sensor_type; + EXPECT_EQ(last_msg_.sol_in[61].flags, 140) + << "incorrect value for last_msg_.sol_in[61].flags, expected 140, is " + << last_msg_.sol_in[61].flags; + EXPECT_EQ(last_msg_.sol_in[61].sensor_type, 174) + << "incorrect value for last_msg_.sol_in[61].sensor_type, expected 174, " + "is " + << last_msg_.sol_in[61].sensor_type; + EXPECT_EQ(last_msg_.sol_in[62].flags, 141) + << "incorrect value for last_msg_.sol_in[62].flags, expected 141, is " + << last_msg_.sol_in[62].flags; + EXPECT_EQ(last_msg_.sol_in[62].sensor_type, 182) + << "incorrect value for last_msg_.sol_in[62].sensor_type, expected 182, " + "is " + << last_msg_.sol_in[62].sensor_type; + EXPECT_EQ(last_msg_.sol_in[63].flags, 82) + << "incorrect value for last_msg_.sol_in[63].flags, expected 82, is " + << last_msg_.sol_in[63].flags; + EXPECT_EQ(last_msg_.sol_in[63].sensor_type, 81) + << "incorrect value for last_msg_.sol_in[63].sensor_type, expected 81, " + "is " + << last_msg_.sol_in[63].sensor_type; + EXPECT_EQ(last_msg_.sol_in[64].flags, 79) + << "incorrect value for last_msg_.sol_in[64].flags, expected 79, is " + << last_msg_.sol_in[64].flags; + EXPECT_EQ(last_msg_.sol_in[64].sensor_type, 92) + << "incorrect value for last_msg_.sol_in[64].sensor_type, expected 92, " + "is " + << last_msg_.sol_in[64].sensor_type; + EXPECT_EQ(last_msg_.sol_in[65].flags, 223) + << "incorrect value for last_msg_.sol_in[65].flags, expected 223, is " + << last_msg_.sol_in[65].flags; + EXPECT_EQ(last_msg_.sol_in[65].sensor_type, 101) + << "incorrect value for last_msg_.sol_in[65].sensor_type, expected 101, " + "is " + << last_msg_.sol_in[65].sensor_type; + EXPECT_EQ(last_msg_.sol_in[66].flags, 64) + << "incorrect value for last_msg_.sol_in[66].flags, expected 64, is " + << last_msg_.sol_in[66].flags; + EXPECT_EQ(last_msg_.sol_in[66].sensor_type, 100) + << "incorrect value for last_msg_.sol_in[66].sensor_type, expected 100, " + "is " + << last_msg_.sol_in[66].sensor_type; + EXPECT_EQ(last_msg_.sol_in[67].flags, 215) + << "incorrect value for last_msg_.sol_in[67].flags, expected 215, is " + << last_msg_.sol_in[67].flags; + EXPECT_EQ(last_msg_.sol_in[67].sensor_type, 184) + << "incorrect value for last_msg_.sol_in[67].sensor_type, expected 184, " + "is " + << last_msg_.sol_in[67].sensor_type; + EXPECT_EQ(last_msg_.sol_in[68].flags, 37) + << "incorrect value for last_msg_.sol_in[68].flags, expected 37, is " + << last_msg_.sol_in[68].flags; + EXPECT_EQ(last_msg_.sol_in[68].sensor_type, 124) + << "incorrect value for last_msg_.sol_in[68].sensor_type, expected 124, " + "is " + << last_msg_.sol_in[68].sensor_type; + EXPECT_EQ(last_msg_.sol_in[69].flags, 227) + << "incorrect value for last_msg_.sol_in[69].flags, expected 227, is " + << last_msg_.sol_in[69].flags; + EXPECT_EQ(last_msg_.sol_in[69].sensor_type, 21) + << "incorrect value for last_msg_.sol_in[69].sensor_type, expected 21, " + "is " + << last_msg_.sol_in[69].sensor_type; + EXPECT_EQ(last_msg_.sol_in[70].flags, 102) + << "incorrect value for last_msg_.sol_in[70].flags, expected 102, is " + << last_msg_.sol_in[70].flags; + EXPECT_EQ(last_msg_.sol_in[70].sensor_type, 135) + << "incorrect value for last_msg_.sol_in[70].sensor_type, expected 135, " + "is " + << last_msg_.sol_in[70].sensor_type; + EXPECT_EQ(last_msg_.sol_in[71].flags, 36) + << "incorrect value for last_msg_.sol_in[71].flags, expected 36, is " + << last_msg_.sol_in[71].flags; + EXPECT_EQ(last_msg_.sol_in[71].sensor_type, 72) + << "incorrect value for last_msg_.sol_in[71].sensor_type, expected 72, " + "is " + << last_msg_.sol_in[71].sensor_type; + EXPECT_EQ(last_msg_.sol_in[72].flags, 56) + << "incorrect value for last_msg_.sol_in[72].flags, expected 56, is " + << last_msg_.sol_in[72].flags; + EXPECT_EQ(last_msg_.sol_in[72].sensor_type, 219) + << "incorrect value for last_msg_.sol_in[72].sensor_type, expected 219, " + "is " + << last_msg_.sol_in[72].sensor_type; + EXPECT_EQ(last_msg_.sol_in[73].flags, 90) + << "incorrect value for last_msg_.sol_in[73].flags, expected 90, is " + << last_msg_.sol_in[73].flags; + EXPECT_EQ(last_msg_.sol_in[73].sensor_type, 146) + << "incorrect value for last_msg_.sol_in[73].sensor_type, expected 146, " + "is " + << last_msg_.sol_in[73].sensor_type; + EXPECT_EQ(last_msg_.sol_in[74].flags, 104) + << "incorrect value for last_msg_.sol_in[74].flags, expected 104, is " + << last_msg_.sol_in[74].flags; + EXPECT_EQ(last_msg_.sol_in[74].sensor_type, 219) + << "incorrect value for last_msg_.sol_in[74].sensor_type, expected 219, " + "is " + << last_msg_.sol_in[74].sensor_type; + EXPECT_EQ(last_msg_.sol_in[75].flags, 102) + << "incorrect value for last_msg_.sol_in[75].flags, expected 102, is " + << last_msg_.sol_in[75].flags; + EXPECT_EQ(last_msg_.sol_in[75].sensor_type, 227) + << "incorrect value for last_msg_.sol_in[75].sensor_type, expected 227, " + "is " + << last_msg_.sol_in[75].sensor_type; + EXPECT_EQ(last_msg_.sol_in[76].flags, 12) + << "incorrect value for last_msg_.sol_in[76].flags, expected 12, is " + << last_msg_.sol_in[76].flags; + EXPECT_EQ(last_msg_.sol_in[76].sensor_type, 83) + << "incorrect value for last_msg_.sol_in[76].sensor_type, expected 83, " + "is " + << last_msg_.sol_in[76].sensor_type; + EXPECT_EQ(last_msg_.sol_in[77].flags, 122) + << "incorrect value for last_msg_.sol_in[77].flags, expected 122, is " + << last_msg_.sol_in[77].flags; + EXPECT_EQ(last_msg_.sol_in[77].sensor_type, 41) + << "incorrect value for last_msg_.sol_in[77].sensor_type, expected 41, " + "is " + << last_msg_.sol_in[77].sensor_type; + EXPECT_EQ(last_msg_.sol_in[78].flags, 94) + << "incorrect value for last_msg_.sol_in[78].flags, expected 94, is " + << last_msg_.sol_in[78].flags; + EXPECT_EQ(last_msg_.sol_in[78].sensor_type, 173) + << "incorrect value for last_msg_.sol_in[78].sensor_type, expected 173, " + "is " + << last_msg_.sol_in[78].sensor_type; + EXPECT_EQ(last_msg_.sol_in[79].flags, 174) + << "incorrect value for last_msg_.sol_in[79].flags, expected 174, is " + << last_msg_.sol_in[79].flags; + EXPECT_EQ(last_msg_.sol_in[79].sensor_type, 1) + << "incorrect value for last_msg_.sol_in[79].sensor_type, expected 1, is " + << last_msg_.sol_in[79].sensor_type; + EXPECT_EQ(last_msg_.sol_in[80].flags, 130) + << "incorrect value for last_msg_.sol_in[80].flags, expected 130, is " + << last_msg_.sol_in[80].flags; + EXPECT_EQ(last_msg_.sol_in[80].sensor_type, 134) + << "incorrect value for last_msg_.sol_in[80].sensor_type, expected 134, " + "is " + << last_msg_.sol_in[80].sensor_type; + EXPECT_EQ(last_msg_.sol_in[81].flags, 237) + << "incorrect value for last_msg_.sol_in[81].flags, expected 237, is " + << last_msg_.sol_in[81].flags; + EXPECT_EQ(last_msg_.sol_in[81].sensor_type, 104) + << "incorrect value for last_msg_.sol_in[81].sensor_type, expected 104, " + "is " + << last_msg_.sol_in[81].sensor_type; + EXPECT_EQ(last_msg_.sol_in[82].flags, 249) + << "incorrect value for last_msg_.sol_in[82].flags, expected 249, is " + << last_msg_.sol_in[82].flags; + EXPECT_EQ(last_msg_.sol_in[82].sensor_type, 116) + << "incorrect value for last_msg_.sol_in[82].sensor_type, expected 116, " + "is " + << last_msg_.sol_in[82].sensor_type; + EXPECT_EQ(last_msg_.sol_in[83].flags, 230) + << "incorrect value for last_msg_.sol_in[83].flags, expected 230, is " + << last_msg_.sol_in[83].flags; + EXPECT_EQ(last_msg_.sol_in[83].sensor_type, 107) + << "incorrect value for last_msg_.sol_in[83].sensor_type, expected 107, " + "is " + << last_msg_.sol_in[83].sensor_type; + EXPECT_EQ(last_msg_.sol_in[84].flags, 123) + << "incorrect value for last_msg_.sol_in[84].flags, expected 123, is " + << last_msg_.sol_in[84].flags; + EXPECT_EQ(last_msg_.sol_in[84].sensor_type, 130) + << "incorrect value for last_msg_.sol_in[84].sensor_type, expected 130, " + "is " + << last_msg_.sol_in[84].sensor_type; + EXPECT_EQ(last_msg_.sol_in[85].flags, 162) + << "incorrect value for last_msg_.sol_in[85].flags, expected 162, is " + << last_msg_.sol_in[85].flags; + EXPECT_EQ(last_msg_.sol_in[85].sensor_type, 25) + << "incorrect value for last_msg_.sol_in[85].sensor_type, expected 25, " + "is " + << last_msg_.sol_in[85].sensor_type; + EXPECT_EQ(last_msg_.sol_in[86].flags, 223) + << "incorrect value for last_msg_.sol_in[86].flags, expected 223, is " + << last_msg_.sol_in[86].flags; + EXPECT_EQ(last_msg_.sol_in[86].sensor_type, 57) + << "incorrect value for last_msg_.sol_in[86].sensor_type, expected 57, " + "is " + << last_msg_.sol_in[86].sensor_type; + EXPECT_EQ(last_msg_.sol_in[87].flags, 174) + << "incorrect value for last_msg_.sol_in[87].flags, expected 174, is " + << last_msg_.sol_in[87].flags; + EXPECT_EQ(last_msg_.sol_in[87].sensor_type, 193) + << "incorrect value for last_msg_.sol_in[87].sensor_type, expected 193, " + "is " + << last_msg_.sol_in[87].sensor_type; + EXPECT_EQ(last_msg_.sol_in[88].flags, 193) + << "incorrect value for last_msg_.sol_in[88].flags, expected 193, is " + << last_msg_.sol_in[88].flags; + EXPECT_EQ(last_msg_.sol_in[88].sensor_type, 146) + << "incorrect value for last_msg_.sol_in[88].sensor_type, expected 146, " + "is " + << last_msg_.sol_in[88].sensor_type; + EXPECT_EQ(last_msg_.sol_in[89].flags, 44) + << "incorrect value for last_msg_.sol_in[89].flags, expected 44, is " + << last_msg_.sol_in[89].flags; + EXPECT_EQ(last_msg_.sol_in[89].sensor_type, 239) + << "incorrect value for last_msg_.sol_in[89].sensor_type, expected 239, " + "is " + << last_msg_.sol_in[89].sensor_type; + EXPECT_EQ(last_msg_.sol_in[90].flags, 197) + << "incorrect value for last_msg_.sol_in[90].flags, expected 197, is " + << last_msg_.sol_in[90].flags; + EXPECT_EQ(last_msg_.sol_in[90].sensor_type, 246) + << "incorrect value for last_msg_.sol_in[90].sensor_type, expected 246, " + "is " + << last_msg_.sol_in[90].sensor_type; + EXPECT_EQ(last_msg_.sol_in[91].flags, 80) + << "incorrect value for last_msg_.sol_in[91].flags, expected 80, is " + << last_msg_.sol_in[91].flags; + EXPECT_EQ(last_msg_.sol_in[91].sensor_type, 214) + << "incorrect value for last_msg_.sol_in[91].sensor_type, expected 214, " + "is " + << last_msg_.sol_in[91].sensor_type; + EXPECT_EQ(last_msg_.sol_in[92].flags, 100) + << "incorrect value for last_msg_.sol_in[92].flags, expected 100, is " + << last_msg_.sol_in[92].flags; + EXPECT_EQ(last_msg_.sol_in[92].sensor_type, 83) + << "incorrect value for last_msg_.sol_in[92].sensor_type, expected 83, " + "is " + << last_msg_.sol_in[92].sensor_type; + EXPECT_EQ(last_msg_.sol_in[93].flags, 72) + << "incorrect value for last_msg_.sol_in[93].flags, expected 72, is " + << last_msg_.sol_in[93].flags; + EXPECT_EQ(last_msg_.sol_in[93].sensor_type, 66) + << "incorrect value for last_msg_.sol_in[93].sensor_type, expected 66, " + "is " + << last_msg_.sol_in[93].sensor_type; + EXPECT_EQ(last_msg_.sol_in[94].flags, 137) + << "incorrect value for last_msg_.sol_in[94].flags, expected 137, is " + << last_msg_.sol_in[94].flags; + EXPECT_EQ(last_msg_.sol_in[94].sensor_type, 133) + << "incorrect value for last_msg_.sol_in[94].sensor_type, expected 133, " + "is " + << last_msg_.sol_in[94].sensor_type; + EXPECT_EQ(last_msg_.sol_in[95].flags, 82) + << "incorrect value for last_msg_.sol_in[95].flags, expected 82, is " + << last_msg_.sol_in[95].flags; + EXPECT_EQ(last_msg_.sol_in[95].sensor_type, 140) + << "incorrect value for last_msg_.sol_in[95].sensor_type, expected 140, " + "is " + << last_msg_.sol_in[95].sensor_type; + EXPECT_EQ(last_msg_.sol_in[96].flags, 2) + << "incorrect value for last_msg_.sol_in[96].flags, expected 2, is " + << last_msg_.sol_in[96].flags; + EXPECT_EQ(last_msg_.sol_in[96].sensor_type, 2) + << "incorrect value for last_msg_.sol_in[96].sensor_type, expected 2, is " + << last_msg_.sol_in[96].sensor_type; + EXPECT_EQ(last_msg_.sol_in[97].flags, 9) + << "incorrect value for last_msg_.sol_in[97].flags, expected 9, is " + << last_msg_.sol_in[97].flags; + EXPECT_EQ(last_msg_.sol_in[97].sensor_type, 96) + << "incorrect value for last_msg_.sol_in[97].sensor_type, expected 96, " + "is " + << last_msg_.sol_in[97].sensor_type; + EXPECT_EQ(last_msg_.sol_in[98].flags, 158) + << "incorrect value for last_msg_.sol_in[98].flags, expected 158, is " + << last_msg_.sol_in[98].flags; + EXPECT_EQ(last_msg_.sol_in[98].sensor_type, 96) + << "incorrect value for last_msg_.sol_in[98].sensor_type, expected 96, " + "is " + << last_msg_.sol_in[98].sensor_type; + EXPECT_EQ(last_msg_.sol_in[99].flags, 97) + << "incorrect value for last_msg_.sol_in[99].flags, expected 97, is " + << last_msg_.sol_in[99].flags; + EXPECT_EQ(last_msg_.sol_in[99].sensor_type, 134) + << "incorrect value for last_msg_.sol_in[99].sensor_type, expected 134, " + "is " + << last_msg_.sol_in[99].sensor_type; + EXPECT_EQ(last_msg_.sol_in[100].flags, 129) + << "incorrect value for last_msg_.sol_in[100].flags, expected 129, is " + << last_msg_.sol_in[100].flags; + EXPECT_EQ(last_msg_.sol_in[100].sensor_type, 43) + << "incorrect value for last_msg_.sol_in[100].sensor_type, expected 43, " + "is " + << last_msg_.sol_in[100].sensor_type; + EXPECT_EQ(last_msg_.sol_in[101].flags, 25) + << "incorrect value for last_msg_.sol_in[101].flags, expected 25, is " + << last_msg_.sol_in[101].flags; + EXPECT_EQ(last_msg_.sol_in[101].sensor_type, 141) + << "incorrect value for last_msg_.sol_in[101].sensor_type, expected 141, " + "is " + << last_msg_.sol_in[101].sensor_type; + EXPECT_EQ(last_msg_.sol_in[102].flags, 200) + << "incorrect value for last_msg_.sol_in[102].flags, expected 200, is " + << last_msg_.sol_in[102].flags; + EXPECT_EQ(last_msg_.sol_in[102].sensor_type, 183) + << "incorrect value for last_msg_.sol_in[102].sensor_type, expected 183, " + "is " + << last_msg_.sol_in[102].sensor_type; + EXPECT_EQ(last_msg_.sol_in[103].flags, 57) + << "incorrect value for last_msg_.sol_in[103].flags, expected 57, is " + << last_msg_.sol_in[103].flags; + EXPECT_EQ(last_msg_.sol_in[103].sensor_type, 214) + << "incorrect value for last_msg_.sol_in[103].sensor_type, expected 214, " + "is " + << last_msg_.sol_in[103].sensor_type; + EXPECT_EQ(last_msg_.sol_in[104].flags, 103) + << "incorrect value for last_msg_.sol_in[104].flags, expected 103, is " + << last_msg_.sol_in[104].flags; + EXPECT_EQ(last_msg_.sol_in[104].sensor_type, 248) + << "incorrect value for last_msg_.sol_in[104].sensor_type, expected 248, " + "is " + << last_msg_.sol_in[104].sensor_type; + EXPECT_EQ(last_msg_.sol_in[105].flags, 65) + << "incorrect value for last_msg_.sol_in[105].flags, expected 65, is " + << last_msg_.sol_in[105].flags; + EXPECT_EQ(last_msg_.sol_in[105].sensor_type, 222) + << "incorrect value for last_msg_.sol_in[105].sensor_type, expected 222, " + "is " + << last_msg_.sol_in[105].sensor_type; + EXPECT_EQ(last_msg_.sol_in[106].flags, 15) + << "incorrect value for last_msg_.sol_in[106].flags, expected 15, is " + << last_msg_.sol_in[106].flags; + EXPECT_EQ(last_msg_.sol_in[106].sensor_type, 195) + << "incorrect value for last_msg_.sol_in[106].sensor_type, expected 195, " + "is " + << last_msg_.sol_in[106].sensor_type; + EXPECT_EQ(last_msg_.sol_in[107].flags, 21) + << "incorrect value for last_msg_.sol_in[107].flags, expected 21, is " + << last_msg_.sol_in[107].flags; + EXPECT_EQ(last_msg_.sol_in[107].sensor_type, 244) + << "incorrect value for last_msg_.sol_in[107].sensor_type, expected 244, " + "is " + << last_msg_.sol_in[107].sensor_type; + EXPECT_EQ(last_msg_.sol_in[108].flags, 46) + << "incorrect value for last_msg_.sol_in[108].flags, expected 46, is " + << last_msg_.sol_in[108].flags; + EXPECT_EQ(last_msg_.sol_in[108].sensor_type, 180) + << "incorrect value for last_msg_.sol_in[108].sensor_type, expected 180, " + "is " + << last_msg_.sol_in[108].sensor_type; + EXPECT_EQ(last_msg_.sol_in[109].flags, 130) + << "incorrect value for last_msg_.sol_in[109].flags, expected 130, is " + << last_msg_.sol_in[109].flags; + EXPECT_EQ(last_msg_.sol_in[109].sensor_type, 140) + << "incorrect value for last_msg_.sol_in[109].sensor_type, expected 140, " + "is " + << last_msg_.sol_in[109].sensor_type; + EXPECT_EQ(last_msg_.sol_in[110].flags, 17) + << "incorrect value for last_msg_.sol_in[110].flags, expected 17, is " + << last_msg_.sol_in[110].flags; + EXPECT_EQ(last_msg_.sol_in[110].sensor_type, 36) + << "incorrect value for last_msg_.sol_in[110].sensor_type, expected 36, " + "is " + << last_msg_.sol_in[110].sensor_type; + EXPECT_EQ(last_msg_.sol_in[111].flags, 209) + << "incorrect value for last_msg_.sol_in[111].flags, expected 209, is " + << last_msg_.sol_in[111].flags; + EXPECT_EQ(last_msg_.sol_in[111].sensor_type, 194) + << "incorrect value for last_msg_.sol_in[111].sensor_type, expected 194, " + "is " + << last_msg_.sol_in[111].sensor_type; + EXPECT_EQ(last_msg_.sol_in[112].flags, 254) + << "incorrect value for last_msg_.sol_in[112].flags, expected 254, is " + << last_msg_.sol_in[112].flags; + EXPECT_EQ(last_msg_.sol_in[112].sensor_type, 65) + << "incorrect value for last_msg_.sol_in[112].sensor_type, expected 65, " + "is " + << last_msg_.sol_in[112].sensor_type; + EXPECT_EQ(last_msg_.sol_in[113].flags, 103) + << "incorrect value for last_msg_.sol_in[113].flags, expected 103, is " + << last_msg_.sol_in[113].flags; + EXPECT_EQ(last_msg_.sol_in[113].sensor_type, 115) + << "incorrect value for last_msg_.sol_in[113].sensor_type, expected 115, " + "is " + << last_msg_.sol_in[113].sensor_type; + EXPECT_EQ(last_msg_.sol_in[114].flags, 129) + << "incorrect value for last_msg_.sol_in[114].flags, expected 129, is " + << last_msg_.sol_in[114].flags; + EXPECT_EQ(last_msg_.sol_in[114].sensor_type, 152) + << "incorrect value for last_msg_.sol_in[114].sensor_type, expected 152, " + "is " + << last_msg_.sol_in[114].sensor_type; + EXPECT_EQ(last_msg_.sol_in[115].flags, 235) + << "incorrect value for last_msg_.sol_in[115].flags, expected 235, is " + << last_msg_.sol_in[115].flags; + EXPECT_EQ(last_msg_.sol_in[115].sensor_type, 234) + << "incorrect value for last_msg_.sol_in[115].sensor_type, expected 234, " + "is " + << last_msg_.sol_in[115].sensor_type; + EXPECT_EQ(last_msg_.sol_in[116].flags, 234) + << "incorrect value for last_msg_.sol_in[116].flags, expected 234, is " + << last_msg_.sol_in[116].flags; + EXPECT_EQ(last_msg_.sol_in[116].sensor_type, 194) + << "incorrect value for last_msg_.sol_in[116].sensor_type, expected 194, " + "is " + << last_msg_.sol_in[116].sensor_type; + EXPECT_EQ(last_msg_.sol_in[117].flags, 201) + << "incorrect value for last_msg_.sol_in[117].flags, expected 201, is " + << last_msg_.sol_in[117].flags; + EXPECT_EQ(last_msg_.sol_in[117].sensor_type, 170) + << "incorrect value for last_msg_.sol_in[117].sensor_type, expected 170, " + "is " + << last_msg_.sol_in[117].sensor_type; + EXPECT_EQ(last_msg_.sol_in[118].flags, 154) + << "incorrect value for last_msg_.sol_in[118].flags, expected 154, is " + << last_msg_.sol_in[118].flags; + EXPECT_EQ(last_msg_.sol_in[118].sensor_type, 210) + << "incorrect value for last_msg_.sol_in[118].sensor_type, expected 210, " + "is " + << last_msg_.sol_in[118].sensor_type; + EXPECT_EQ(last_msg_.tow, 3628191792) + << "incorrect value for last_msg_.tow, expected 3628191792, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.vdop, 58512) + << "incorrect value for last_msg_.vdop, expected 58512, is " + << last_msg_.vdop; } diff --git a/c/test/cpp/auto_check_sbp_solution_meta_MsgSolnMetaDepA.cc b/c/test/cpp/auto_check_sbp_solution_meta_MsgSolnMetaDepA.cc index 1fab85086..afb6d53d2 100644 --- a/c/test/cpp/auto_check_sbp_solution_meta_MsgSolnMetaDepA.cc +++ b/c/test/cpp/auto_check_sbp_solution_meta_MsgSolnMetaDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMetaDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMetaDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_solution_meta_MsgSolnMetaDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_solution_meta_MsgSolnMetaDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_solution_meta_MsgSolnMetaDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_solution_meta_MsgSolnMetaDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_soln_meta_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_soln_meta_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,654 +67,1289 @@ class Test_auto_check_sbp_solution_meta_MsgSolnMetaDepA0 : sbp_msg_soln_meta_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_solution_meta_MsgSolnMetaDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,15,255,84,241,254,183,222,157,121,5,164,238,31,190,115,93,59,103,36,83,161,156,46,253,67,87,200,39,250,245,242,228,72,18,222,11,88,207,218,231,13,226,224,22,196,21,242,12,89,71,219,182,85,145,204,146,40,204,51,21,153,227,44,15,28,255,39,205,216,240,190,93,219,103,42,41,182,76,222,17,23,125,31,18,229,28,47,214,25,100,84,106,72,48,10,222,232,235,73,109,163,51,152,133,235,87,70,2,108,91,101,200,55,24,156,233,73,39,66,97,140,252,227,230,237,135,241,245,205,70,0,219,188,107,136,178,58,1,29,44,213,225,147,190,96,192,108,228,15,203,18,3,222,180,68,101,229,223,203,243,164,92,165,220,159,174,121,112,167,240,40,59,3,230,52,149,148,218,142,212,109,176,71,179,172,77,1,193,70,147,149,23,144,148,239,195,186,86,30,34,143,156,207,63,55,117,255,222,222,219,145,224,191,210,109,86,153,21,32,226,10,60,63,106,236,93,96,30,163,106,238,147,133,132,107,152,214,221,185,202,21,252,51,130,59,166,202,127,170,58,193,215,125,22,58,135,47,88,142,77,211, }; - - sbp_msg_soln_meta_dep_a_t test_msg{}; - test_msg.age_corrections = 48671; - test_msg.alignment_status = 115; - test_msg.hdop = 31133; - test_msg.last_used_gnss_pos_tow = 610745181; - test_msg.last_used_gnss_vel_tow = 782016851; - test_msg.n_sats = 238; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_sol_in.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)111,(char)108,(char)95,(char)105,(char)110 }; - memcpy(test_msg.n_sol_in.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_sol_in.value = 118; - test_msg.pdop = 57015; - - test_msg.sol_in[0].flags = 67; - test_msg.sol_in[0].sensor_type = 253; - - test_msg.sol_in[1].flags = 200; - test_msg.sol_in[1].sensor_type = 87; - - test_msg.sol_in[2].flags = 250; - test_msg.sol_in[2].sensor_type = 39; - - test_msg.sol_in[3].flags = 242; - test_msg.sol_in[3].sensor_type = 245; - - test_msg.sol_in[4].flags = 72; - test_msg.sol_in[4].sensor_type = 228; - - test_msg.sol_in[5].flags = 222; - test_msg.sol_in[5].sensor_type = 18; - - test_msg.sol_in[6].flags = 88; - test_msg.sol_in[6].sensor_type = 11; - - test_msg.sol_in[7].flags = 218; - test_msg.sol_in[7].sensor_type = 207; - - test_msg.sol_in[8].flags = 13; - test_msg.sol_in[8].sensor_type = 231; - - test_msg.sol_in[9].flags = 224; - test_msg.sol_in[9].sensor_type = 226; - - test_msg.sol_in[10].flags = 196; - test_msg.sol_in[10].sensor_type = 22; - - test_msg.sol_in[11].flags = 242; - test_msg.sol_in[11].sensor_type = 21; - - test_msg.sol_in[12].flags = 89; - test_msg.sol_in[12].sensor_type = 12; - - test_msg.sol_in[13].flags = 219; - test_msg.sol_in[13].sensor_type = 71; - - test_msg.sol_in[14].flags = 85; - test_msg.sol_in[14].sensor_type = 182; - - test_msg.sol_in[15].flags = 204; - test_msg.sol_in[15].sensor_type = 145; - - test_msg.sol_in[16].flags = 40; - test_msg.sol_in[16].sensor_type = 146; - - test_msg.sol_in[17].flags = 51; - test_msg.sol_in[17].sensor_type = 204; - - test_msg.sol_in[18].flags = 153; - test_msg.sol_in[18].sensor_type = 21; - - test_msg.sol_in[19].flags = 44; - test_msg.sol_in[19].sensor_type = 227; - - test_msg.sol_in[20].flags = 28; - test_msg.sol_in[20].sensor_type = 15; - - test_msg.sol_in[21].flags = 39; - test_msg.sol_in[21].sensor_type = 255; - - test_msg.sol_in[22].flags = 216; - test_msg.sol_in[22].sensor_type = 205; - - test_msg.sol_in[23].flags = 190; - test_msg.sol_in[23].sensor_type = 240; - - test_msg.sol_in[24].flags = 219; - test_msg.sol_in[24].sensor_type = 93; - - test_msg.sol_in[25].flags = 42; - test_msg.sol_in[25].sensor_type = 103; - - test_msg.sol_in[26].flags = 182; - test_msg.sol_in[26].sensor_type = 41; - - test_msg.sol_in[27].flags = 222; - test_msg.sol_in[27].sensor_type = 76; - - test_msg.sol_in[28].flags = 23; - test_msg.sol_in[28].sensor_type = 17; - - test_msg.sol_in[29].flags = 31; - test_msg.sol_in[29].sensor_type = 125; - - test_msg.sol_in[30].flags = 229; - test_msg.sol_in[30].sensor_type = 18; - - test_msg.sol_in[31].flags = 47; - test_msg.sol_in[31].sensor_type = 28; - - test_msg.sol_in[32].flags = 25; - test_msg.sol_in[32].sensor_type = 214; - - test_msg.sol_in[33].flags = 84; - test_msg.sol_in[33].sensor_type = 100; - - test_msg.sol_in[34].flags = 72; - test_msg.sol_in[34].sensor_type = 106; - - test_msg.sol_in[35].flags = 10; - test_msg.sol_in[35].sensor_type = 48; - - test_msg.sol_in[36].flags = 232; - test_msg.sol_in[36].sensor_type = 222; - - test_msg.sol_in[37].flags = 73; - test_msg.sol_in[37].sensor_type = 235; - - test_msg.sol_in[38].flags = 163; - test_msg.sol_in[38].sensor_type = 109; - - test_msg.sol_in[39].flags = 152; - test_msg.sol_in[39].sensor_type = 51; - - test_msg.sol_in[40].flags = 235; - test_msg.sol_in[40].sensor_type = 133; - - test_msg.sol_in[41].flags = 70; - test_msg.sol_in[41].sensor_type = 87; - - test_msg.sol_in[42].flags = 108; - test_msg.sol_in[42].sensor_type = 2; - - test_msg.sol_in[43].flags = 101; - test_msg.sol_in[43].sensor_type = 91; - - test_msg.sol_in[44].flags = 55; - test_msg.sol_in[44].sensor_type = 200; - - test_msg.sol_in[45].flags = 156; - test_msg.sol_in[45].sensor_type = 24; - - test_msg.sol_in[46].flags = 73; - test_msg.sol_in[46].sensor_type = 233; - - test_msg.sol_in[47].flags = 66; - test_msg.sol_in[47].sensor_type = 39; - - test_msg.sol_in[48].flags = 140; - test_msg.sol_in[48].sensor_type = 97; - - test_msg.sol_in[49].flags = 227; - test_msg.sol_in[49].sensor_type = 252; - - test_msg.sol_in[50].flags = 237; - test_msg.sol_in[50].sensor_type = 230; - - test_msg.sol_in[51].flags = 241; - test_msg.sol_in[51].sensor_type = 135; - - test_msg.sol_in[52].flags = 205; - test_msg.sol_in[52].sensor_type = 245; - - test_msg.sol_in[53].flags = 0; - test_msg.sol_in[53].sensor_type = 70; - - test_msg.sol_in[54].flags = 188; - test_msg.sol_in[54].sensor_type = 219; - - test_msg.sol_in[55].flags = 136; - test_msg.sol_in[55].sensor_type = 107; - - test_msg.sol_in[56].flags = 58; - test_msg.sol_in[56].sensor_type = 178; - - test_msg.sol_in[57].flags = 29; - test_msg.sol_in[57].sensor_type = 1; - - test_msg.sol_in[58].flags = 213; - test_msg.sol_in[58].sensor_type = 44; - - test_msg.sol_in[59].flags = 147; - test_msg.sol_in[59].sensor_type = 225; - - test_msg.sol_in[60].flags = 96; - test_msg.sol_in[60].sensor_type = 190; - - test_msg.sol_in[61].flags = 108; - test_msg.sol_in[61].sensor_type = 192; - - test_msg.sol_in[62].flags = 15; - test_msg.sol_in[62].sensor_type = 228; - - test_msg.sol_in[63].flags = 18; - test_msg.sol_in[63].sensor_type = 203; - - test_msg.sol_in[64].flags = 222; - test_msg.sol_in[64].sensor_type = 3; - - test_msg.sol_in[65].flags = 68; - test_msg.sol_in[65].sensor_type = 180; - - test_msg.sol_in[66].flags = 229; - test_msg.sol_in[66].sensor_type = 101; - - test_msg.sol_in[67].flags = 203; - test_msg.sol_in[67].sensor_type = 223; - - test_msg.sol_in[68].flags = 164; - test_msg.sol_in[68].sensor_type = 243; - - test_msg.sol_in[69].flags = 165; - test_msg.sol_in[69].sensor_type = 92; - - test_msg.sol_in[70].flags = 159; - test_msg.sol_in[70].sensor_type = 220; - - test_msg.sol_in[71].flags = 121; - test_msg.sol_in[71].sensor_type = 174; - - test_msg.sol_in[72].flags = 167; - test_msg.sol_in[72].sensor_type = 112; - - test_msg.sol_in[73].flags = 40; - test_msg.sol_in[73].sensor_type = 240; - - test_msg.sol_in[74].flags = 3; - test_msg.sol_in[74].sensor_type = 59; - - test_msg.sol_in[75].flags = 52; - test_msg.sol_in[75].sensor_type = 230; - - test_msg.sol_in[76].flags = 148; - test_msg.sol_in[76].sensor_type = 149; - - test_msg.sol_in[77].flags = 142; - test_msg.sol_in[77].sensor_type = 218; - - test_msg.sol_in[78].flags = 109; - test_msg.sol_in[78].sensor_type = 212; - - test_msg.sol_in[79].flags = 71; - test_msg.sol_in[79].sensor_type = 176; - - test_msg.sol_in[80].flags = 172; - test_msg.sol_in[80].sensor_type = 179; - - test_msg.sol_in[81].flags = 1; - test_msg.sol_in[81].sensor_type = 77; - - test_msg.sol_in[82].flags = 70; - test_msg.sol_in[82].sensor_type = 193; - - test_msg.sol_in[83].flags = 149; - test_msg.sol_in[83].sensor_type = 147; - - test_msg.sol_in[84].flags = 144; - test_msg.sol_in[84].sensor_type = 23; - - test_msg.sol_in[85].flags = 239; - test_msg.sol_in[85].sensor_type = 148; - - test_msg.sol_in[86].flags = 186; - test_msg.sol_in[86].sensor_type = 195; - - test_msg.sol_in[87].flags = 30; - test_msg.sol_in[87].sensor_type = 86; - - test_msg.sol_in[88].flags = 143; - test_msg.sol_in[88].sensor_type = 34; - - test_msg.sol_in[89].flags = 207; - test_msg.sol_in[89].sensor_type = 156; - - test_msg.sol_in[90].flags = 55; - test_msg.sol_in[90].sensor_type = 63; - - test_msg.sol_in[91].flags = 255; - test_msg.sol_in[91].sensor_type = 117; - - test_msg.sol_in[92].flags = 222; - test_msg.sol_in[92].sensor_type = 222; - - test_msg.sol_in[93].flags = 145; - test_msg.sol_in[93].sensor_type = 219; - - test_msg.sol_in[94].flags = 191; - test_msg.sol_in[94].sensor_type = 224; - - test_msg.sol_in[95].flags = 109; - test_msg.sol_in[95].sensor_type = 210; - - test_msg.sol_in[96].flags = 153; - test_msg.sol_in[96].sensor_type = 86; - - test_msg.sol_in[97].flags = 32; - test_msg.sol_in[97].sensor_type = 21; - - test_msg.sol_in[98].flags = 10; - test_msg.sol_in[98].sensor_type = 226; - - test_msg.sol_in[99].flags = 63; - test_msg.sol_in[99].sensor_type = 60; - - test_msg.sol_in[100].flags = 236; - test_msg.sol_in[100].sensor_type = 106; - - test_msg.sol_in[101].flags = 96; - test_msg.sol_in[101].sensor_type = 93; - - test_msg.sol_in[102].flags = 163; - test_msg.sol_in[102].sensor_type = 30; - - test_msg.sol_in[103].flags = 238; - test_msg.sol_in[103].sensor_type = 106; - - test_msg.sol_in[104].flags = 133; - test_msg.sol_in[104].sensor_type = 147; - - test_msg.sol_in[105].flags = 107; - test_msg.sol_in[105].sensor_type = 132; - - test_msg.sol_in[106].flags = 214; - test_msg.sol_in[106].sensor_type = 152; - - test_msg.sol_in[107].flags = 185; - test_msg.sol_in[107].sensor_type = 221; - - test_msg.sol_in[108].flags = 21; - test_msg.sol_in[108].sensor_type = 202; - - test_msg.sol_in[109].flags = 51; - test_msg.sol_in[109].sensor_type = 252; - - test_msg.sol_in[110].flags = 59; - test_msg.sol_in[110].sensor_type = 130; - - test_msg.sol_in[111].flags = 202; - test_msg.sol_in[111].sensor_type = 166; - - test_msg.sol_in[112].flags = 170; - test_msg.sol_in[112].sensor_type = 127; - - test_msg.sol_in[113].flags = 193; - test_msg.sol_in[113].sensor_type = 58; - - test_msg.sol_in[114].flags = 125; - test_msg.sol_in[114].sensor_type = 215; - - test_msg.sol_in[115].flags = 58; - test_msg.sol_in[115].sensor_type = 22; - - test_msg.sol_in[116].flags = 47; - test_msg.sol_in[116].sensor_type = 135; - - test_msg.sol_in[117].flags = 142; - test_msg.sol_in[117].sensor_type = 88; - test_msg.vdop = 41989; - - EXPECT_EQ(send_message( 61780, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61780); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.age_corrections, 48671) << "incorrect value for last_msg_.age_corrections, expected 48671, is " << last_msg_.age_corrections; - EXPECT_EQ(last_msg_.alignment_status, 115) << "incorrect value for last_msg_.alignment_status, expected 115, is " << last_msg_.alignment_status; - EXPECT_EQ(last_msg_.hdop, 31133) << "incorrect value for last_msg_.hdop, expected 31133, is " << last_msg_.hdop; - EXPECT_EQ(last_msg_.last_used_gnss_pos_tow, 610745181) << "incorrect value for last_msg_.last_used_gnss_pos_tow, expected 610745181, is " << last_msg_.last_used_gnss_pos_tow; - EXPECT_EQ(last_msg_.last_used_gnss_vel_tow, 782016851) << "incorrect value for last_msg_.last_used_gnss_vel_tow, expected 782016851, is " << last_msg_.last_used_gnss_vel_tow; - EXPECT_EQ(last_msg_.n_sats, 238) << "incorrect value for last_msg_.n_sats, expected 238, is " << last_msg_.n_sats; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_sol_in.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_sol_in.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_sol_in.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)111,(char)108,(char)95,(char)105,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_sol_in.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_sol_in.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_sol_in.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_sol_in.value, 118) << "incorrect value for last_msg_.n_sol_in.value, expected 118, is " << last_msg_.n_sol_in.value; - EXPECT_EQ(last_msg_.pdop, 57015) << "incorrect value for last_msg_.pdop, expected 57015, is " << last_msg_.pdop; - EXPECT_EQ(last_msg_.sol_in[0].flags, 67) << "incorrect value for last_msg_.sol_in[0].flags, expected 67, is " << last_msg_.sol_in[0].flags; - EXPECT_EQ(last_msg_.sol_in[0].sensor_type, 253) << "incorrect value for last_msg_.sol_in[0].sensor_type, expected 253, is " << last_msg_.sol_in[0].sensor_type; - EXPECT_EQ(last_msg_.sol_in[1].flags, 200) << "incorrect value for last_msg_.sol_in[1].flags, expected 200, is " << last_msg_.sol_in[1].flags; - EXPECT_EQ(last_msg_.sol_in[1].sensor_type, 87) << "incorrect value for last_msg_.sol_in[1].sensor_type, expected 87, is " << last_msg_.sol_in[1].sensor_type; - EXPECT_EQ(last_msg_.sol_in[2].flags, 250) << "incorrect value for last_msg_.sol_in[2].flags, expected 250, is " << last_msg_.sol_in[2].flags; - EXPECT_EQ(last_msg_.sol_in[2].sensor_type, 39) << "incorrect value for last_msg_.sol_in[2].sensor_type, expected 39, is " << last_msg_.sol_in[2].sensor_type; - EXPECT_EQ(last_msg_.sol_in[3].flags, 242) << "incorrect value for last_msg_.sol_in[3].flags, expected 242, is " << last_msg_.sol_in[3].flags; - EXPECT_EQ(last_msg_.sol_in[3].sensor_type, 245) << "incorrect value for last_msg_.sol_in[3].sensor_type, expected 245, is " << last_msg_.sol_in[3].sensor_type; - EXPECT_EQ(last_msg_.sol_in[4].flags, 72) << "incorrect value for last_msg_.sol_in[4].flags, expected 72, is " << last_msg_.sol_in[4].flags; - EXPECT_EQ(last_msg_.sol_in[4].sensor_type, 228) << "incorrect value for last_msg_.sol_in[4].sensor_type, expected 228, is " << last_msg_.sol_in[4].sensor_type; - EXPECT_EQ(last_msg_.sol_in[5].flags, 222) << "incorrect value for last_msg_.sol_in[5].flags, expected 222, is " << last_msg_.sol_in[5].flags; - EXPECT_EQ(last_msg_.sol_in[5].sensor_type, 18) << "incorrect value for last_msg_.sol_in[5].sensor_type, expected 18, is " << last_msg_.sol_in[5].sensor_type; - EXPECT_EQ(last_msg_.sol_in[6].flags, 88) << "incorrect value for last_msg_.sol_in[6].flags, expected 88, is " << last_msg_.sol_in[6].flags; - EXPECT_EQ(last_msg_.sol_in[6].sensor_type, 11) << "incorrect value for last_msg_.sol_in[6].sensor_type, expected 11, is " << last_msg_.sol_in[6].sensor_type; - EXPECT_EQ(last_msg_.sol_in[7].flags, 218) << "incorrect value for last_msg_.sol_in[7].flags, expected 218, is " << last_msg_.sol_in[7].flags; - EXPECT_EQ(last_msg_.sol_in[7].sensor_type, 207) << "incorrect value for last_msg_.sol_in[7].sensor_type, expected 207, is " << last_msg_.sol_in[7].sensor_type; - EXPECT_EQ(last_msg_.sol_in[8].flags, 13) << "incorrect value for last_msg_.sol_in[8].flags, expected 13, is " << last_msg_.sol_in[8].flags; - EXPECT_EQ(last_msg_.sol_in[8].sensor_type, 231) << "incorrect value for last_msg_.sol_in[8].sensor_type, expected 231, is " << last_msg_.sol_in[8].sensor_type; - EXPECT_EQ(last_msg_.sol_in[9].flags, 224) << "incorrect value for last_msg_.sol_in[9].flags, expected 224, is " << last_msg_.sol_in[9].flags; - EXPECT_EQ(last_msg_.sol_in[9].sensor_type, 226) << "incorrect value for last_msg_.sol_in[9].sensor_type, expected 226, is " << last_msg_.sol_in[9].sensor_type; - EXPECT_EQ(last_msg_.sol_in[10].flags, 196) << "incorrect value for last_msg_.sol_in[10].flags, expected 196, is " << last_msg_.sol_in[10].flags; - EXPECT_EQ(last_msg_.sol_in[10].sensor_type, 22) << "incorrect value for last_msg_.sol_in[10].sensor_type, expected 22, is " << last_msg_.sol_in[10].sensor_type; - EXPECT_EQ(last_msg_.sol_in[11].flags, 242) << "incorrect value for last_msg_.sol_in[11].flags, expected 242, is " << last_msg_.sol_in[11].flags; - EXPECT_EQ(last_msg_.sol_in[11].sensor_type, 21) << "incorrect value for last_msg_.sol_in[11].sensor_type, expected 21, is " << last_msg_.sol_in[11].sensor_type; - EXPECT_EQ(last_msg_.sol_in[12].flags, 89) << "incorrect value for last_msg_.sol_in[12].flags, expected 89, is " << last_msg_.sol_in[12].flags; - EXPECT_EQ(last_msg_.sol_in[12].sensor_type, 12) << "incorrect value for last_msg_.sol_in[12].sensor_type, expected 12, is " << last_msg_.sol_in[12].sensor_type; - EXPECT_EQ(last_msg_.sol_in[13].flags, 219) << "incorrect value for last_msg_.sol_in[13].flags, expected 219, is " << last_msg_.sol_in[13].flags; - EXPECT_EQ(last_msg_.sol_in[13].sensor_type, 71) << "incorrect value for last_msg_.sol_in[13].sensor_type, expected 71, is " << last_msg_.sol_in[13].sensor_type; - EXPECT_EQ(last_msg_.sol_in[14].flags, 85) << "incorrect value for last_msg_.sol_in[14].flags, expected 85, is " << last_msg_.sol_in[14].flags; - EXPECT_EQ(last_msg_.sol_in[14].sensor_type, 182) << "incorrect value for last_msg_.sol_in[14].sensor_type, expected 182, is " << last_msg_.sol_in[14].sensor_type; - EXPECT_EQ(last_msg_.sol_in[15].flags, 204) << "incorrect value for last_msg_.sol_in[15].flags, expected 204, is " << last_msg_.sol_in[15].flags; - EXPECT_EQ(last_msg_.sol_in[15].sensor_type, 145) << "incorrect value for last_msg_.sol_in[15].sensor_type, expected 145, is " << last_msg_.sol_in[15].sensor_type; - EXPECT_EQ(last_msg_.sol_in[16].flags, 40) << "incorrect value for last_msg_.sol_in[16].flags, expected 40, is " << last_msg_.sol_in[16].flags; - EXPECT_EQ(last_msg_.sol_in[16].sensor_type, 146) << "incorrect value for last_msg_.sol_in[16].sensor_type, expected 146, is " << last_msg_.sol_in[16].sensor_type; - EXPECT_EQ(last_msg_.sol_in[17].flags, 51) << "incorrect value for last_msg_.sol_in[17].flags, expected 51, is " << last_msg_.sol_in[17].flags; - EXPECT_EQ(last_msg_.sol_in[17].sensor_type, 204) << "incorrect value for last_msg_.sol_in[17].sensor_type, expected 204, is " << last_msg_.sol_in[17].sensor_type; - EXPECT_EQ(last_msg_.sol_in[18].flags, 153) << "incorrect value for last_msg_.sol_in[18].flags, expected 153, is " << last_msg_.sol_in[18].flags; - EXPECT_EQ(last_msg_.sol_in[18].sensor_type, 21) << "incorrect value for last_msg_.sol_in[18].sensor_type, expected 21, is " << last_msg_.sol_in[18].sensor_type; - EXPECT_EQ(last_msg_.sol_in[19].flags, 44) << "incorrect value for last_msg_.sol_in[19].flags, expected 44, is " << last_msg_.sol_in[19].flags; - EXPECT_EQ(last_msg_.sol_in[19].sensor_type, 227) << "incorrect value for last_msg_.sol_in[19].sensor_type, expected 227, is " << last_msg_.sol_in[19].sensor_type; - EXPECT_EQ(last_msg_.sol_in[20].flags, 28) << "incorrect value for last_msg_.sol_in[20].flags, expected 28, is " << last_msg_.sol_in[20].flags; - EXPECT_EQ(last_msg_.sol_in[20].sensor_type, 15) << "incorrect value for last_msg_.sol_in[20].sensor_type, expected 15, is " << last_msg_.sol_in[20].sensor_type; - EXPECT_EQ(last_msg_.sol_in[21].flags, 39) << "incorrect value for last_msg_.sol_in[21].flags, expected 39, is " << last_msg_.sol_in[21].flags; - EXPECT_EQ(last_msg_.sol_in[21].sensor_type, 255) << "incorrect value for last_msg_.sol_in[21].sensor_type, expected 255, is " << last_msg_.sol_in[21].sensor_type; - EXPECT_EQ(last_msg_.sol_in[22].flags, 216) << "incorrect value for last_msg_.sol_in[22].flags, expected 216, is " << last_msg_.sol_in[22].flags; - EXPECT_EQ(last_msg_.sol_in[22].sensor_type, 205) << "incorrect value for last_msg_.sol_in[22].sensor_type, expected 205, is " << last_msg_.sol_in[22].sensor_type; - EXPECT_EQ(last_msg_.sol_in[23].flags, 190) << "incorrect value for last_msg_.sol_in[23].flags, expected 190, is " << last_msg_.sol_in[23].flags; - EXPECT_EQ(last_msg_.sol_in[23].sensor_type, 240) << "incorrect value for last_msg_.sol_in[23].sensor_type, expected 240, is " << last_msg_.sol_in[23].sensor_type; - EXPECT_EQ(last_msg_.sol_in[24].flags, 219) << "incorrect value for last_msg_.sol_in[24].flags, expected 219, is " << last_msg_.sol_in[24].flags; - EXPECT_EQ(last_msg_.sol_in[24].sensor_type, 93) << "incorrect value for last_msg_.sol_in[24].sensor_type, expected 93, is " << last_msg_.sol_in[24].sensor_type; - EXPECT_EQ(last_msg_.sol_in[25].flags, 42) << "incorrect value for last_msg_.sol_in[25].flags, expected 42, is " << last_msg_.sol_in[25].flags; - EXPECT_EQ(last_msg_.sol_in[25].sensor_type, 103) << "incorrect value for last_msg_.sol_in[25].sensor_type, expected 103, is " << last_msg_.sol_in[25].sensor_type; - EXPECT_EQ(last_msg_.sol_in[26].flags, 182) << "incorrect value for last_msg_.sol_in[26].flags, expected 182, is " << last_msg_.sol_in[26].flags; - EXPECT_EQ(last_msg_.sol_in[26].sensor_type, 41) << "incorrect value for last_msg_.sol_in[26].sensor_type, expected 41, is " << last_msg_.sol_in[26].sensor_type; - EXPECT_EQ(last_msg_.sol_in[27].flags, 222) << "incorrect value for last_msg_.sol_in[27].flags, expected 222, is " << last_msg_.sol_in[27].flags; - EXPECT_EQ(last_msg_.sol_in[27].sensor_type, 76) << "incorrect value for last_msg_.sol_in[27].sensor_type, expected 76, is " << last_msg_.sol_in[27].sensor_type; - EXPECT_EQ(last_msg_.sol_in[28].flags, 23) << "incorrect value for last_msg_.sol_in[28].flags, expected 23, is " << last_msg_.sol_in[28].flags; - EXPECT_EQ(last_msg_.sol_in[28].sensor_type, 17) << "incorrect value for last_msg_.sol_in[28].sensor_type, expected 17, is " << last_msg_.sol_in[28].sensor_type; - EXPECT_EQ(last_msg_.sol_in[29].flags, 31) << "incorrect value for last_msg_.sol_in[29].flags, expected 31, is " << last_msg_.sol_in[29].flags; - EXPECT_EQ(last_msg_.sol_in[29].sensor_type, 125) << "incorrect value for last_msg_.sol_in[29].sensor_type, expected 125, is " << last_msg_.sol_in[29].sensor_type; - EXPECT_EQ(last_msg_.sol_in[30].flags, 229) << "incorrect value for last_msg_.sol_in[30].flags, expected 229, is " << last_msg_.sol_in[30].flags; - EXPECT_EQ(last_msg_.sol_in[30].sensor_type, 18) << "incorrect value for last_msg_.sol_in[30].sensor_type, expected 18, is " << last_msg_.sol_in[30].sensor_type; - EXPECT_EQ(last_msg_.sol_in[31].flags, 47) << "incorrect value for last_msg_.sol_in[31].flags, expected 47, is " << last_msg_.sol_in[31].flags; - EXPECT_EQ(last_msg_.sol_in[31].sensor_type, 28) << "incorrect value for last_msg_.sol_in[31].sensor_type, expected 28, is " << last_msg_.sol_in[31].sensor_type; - EXPECT_EQ(last_msg_.sol_in[32].flags, 25) << "incorrect value for last_msg_.sol_in[32].flags, expected 25, is " << last_msg_.sol_in[32].flags; - EXPECT_EQ(last_msg_.sol_in[32].sensor_type, 214) << "incorrect value for last_msg_.sol_in[32].sensor_type, expected 214, is " << last_msg_.sol_in[32].sensor_type; - EXPECT_EQ(last_msg_.sol_in[33].flags, 84) << "incorrect value for last_msg_.sol_in[33].flags, expected 84, is " << last_msg_.sol_in[33].flags; - EXPECT_EQ(last_msg_.sol_in[33].sensor_type, 100) << "incorrect value for last_msg_.sol_in[33].sensor_type, expected 100, is " << last_msg_.sol_in[33].sensor_type; - EXPECT_EQ(last_msg_.sol_in[34].flags, 72) << "incorrect value for last_msg_.sol_in[34].flags, expected 72, is " << last_msg_.sol_in[34].flags; - EXPECT_EQ(last_msg_.sol_in[34].sensor_type, 106) << "incorrect value for last_msg_.sol_in[34].sensor_type, expected 106, is " << last_msg_.sol_in[34].sensor_type; - EXPECT_EQ(last_msg_.sol_in[35].flags, 10) << "incorrect value for last_msg_.sol_in[35].flags, expected 10, is " << last_msg_.sol_in[35].flags; - EXPECT_EQ(last_msg_.sol_in[35].sensor_type, 48) << "incorrect value for last_msg_.sol_in[35].sensor_type, expected 48, is " << last_msg_.sol_in[35].sensor_type; - EXPECT_EQ(last_msg_.sol_in[36].flags, 232) << "incorrect value for last_msg_.sol_in[36].flags, expected 232, is " << last_msg_.sol_in[36].flags; - EXPECT_EQ(last_msg_.sol_in[36].sensor_type, 222) << "incorrect value for last_msg_.sol_in[36].sensor_type, expected 222, is " << last_msg_.sol_in[36].sensor_type; - EXPECT_EQ(last_msg_.sol_in[37].flags, 73) << "incorrect value for last_msg_.sol_in[37].flags, expected 73, is " << last_msg_.sol_in[37].flags; - EXPECT_EQ(last_msg_.sol_in[37].sensor_type, 235) << "incorrect value for last_msg_.sol_in[37].sensor_type, expected 235, is " << last_msg_.sol_in[37].sensor_type; - EXPECT_EQ(last_msg_.sol_in[38].flags, 163) << "incorrect value for last_msg_.sol_in[38].flags, expected 163, is " << last_msg_.sol_in[38].flags; - EXPECT_EQ(last_msg_.sol_in[38].sensor_type, 109) << "incorrect value for last_msg_.sol_in[38].sensor_type, expected 109, is " << last_msg_.sol_in[38].sensor_type; - EXPECT_EQ(last_msg_.sol_in[39].flags, 152) << "incorrect value for last_msg_.sol_in[39].flags, expected 152, is " << last_msg_.sol_in[39].flags; - EXPECT_EQ(last_msg_.sol_in[39].sensor_type, 51) << "incorrect value for last_msg_.sol_in[39].sensor_type, expected 51, is " << last_msg_.sol_in[39].sensor_type; - EXPECT_EQ(last_msg_.sol_in[40].flags, 235) << "incorrect value for last_msg_.sol_in[40].flags, expected 235, is " << last_msg_.sol_in[40].flags; - EXPECT_EQ(last_msg_.sol_in[40].sensor_type, 133) << "incorrect value for last_msg_.sol_in[40].sensor_type, expected 133, is " << last_msg_.sol_in[40].sensor_type; - EXPECT_EQ(last_msg_.sol_in[41].flags, 70) << "incorrect value for last_msg_.sol_in[41].flags, expected 70, is " << last_msg_.sol_in[41].flags; - EXPECT_EQ(last_msg_.sol_in[41].sensor_type, 87) << "incorrect value for last_msg_.sol_in[41].sensor_type, expected 87, is " << last_msg_.sol_in[41].sensor_type; - EXPECT_EQ(last_msg_.sol_in[42].flags, 108) << "incorrect value for last_msg_.sol_in[42].flags, expected 108, is " << last_msg_.sol_in[42].flags; - EXPECT_EQ(last_msg_.sol_in[42].sensor_type, 2) << "incorrect value for last_msg_.sol_in[42].sensor_type, expected 2, is " << last_msg_.sol_in[42].sensor_type; - EXPECT_EQ(last_msg_.sol_in[43].flags, 101) << "incorrect value for last_msg_.sol_in[43].flags, expected 101, is " << last_msg_.sol_in[43].flags; - EXPECT_EQ(last_msg_.sol_in[43].sensor_type, 91) << "incorrect value for last_msg_.sol_in[43].sensor_type, expected 91, is " << last_msg_.sol_in[43].sensor_type; - EXPECT_EQ(last_msg_.sol_in[44].flags, 55) << "incorrect value for last_msg_.sol_in[44].flags, expected 55, is " << last_msg_.sol_in[44].flags; - EXPECT_EQ(last_msg_.sol_in[44].sensor_type, 200) << "incorrect value for last_msg_.sol_in[44].sensor_type, expected 200, is " << last_msg_.sol_in[44].sensor_type; - EXPECT_EQ(last_msg_.sol_in[45].flags, 156) << "incorrect value for last_msg_.sol_in[45].flags, expected 156, is " << last_msg_.sol_in[45].flags; - EXPECT_EQ(last_msg_.sol_in[45].sensor_type, 24) << "incorrect value for last_msg_.sol_in[45].sensor_type, expected 24, is " << last_msg_.sol_in[45].sensor_type; - EXPECT_EQ(last_msg_.sol_in[46].flags, 73) << "incorrect value for last_msg_.sol_in[46].flags, expected 73, is " << last_msg_.sol_in[46].flags; - EXPECT_EQ(last_msg_.sol_in[46].sensor_type, 233) << "incorrect value for last_msg_.sol_in[46].sensor_type, expected 233, is " << last_msg_.sol_in[46].sensor_type; - EXPECT_EQ(last_msg_.sol_in[47].flags, 66) << "incorrect value for last_msg_.sol_in[47].flags, expected 66, is " << last_msg_.sol_in[47].flags; - EXPECT_EQ(last_msg_.sol_in[47].sensor_type, 39) << "incorrect value for last_msg_.sol_in[47].sensor_type, expected 39, is " << last_msg_.sol_in[47].sensor_type; - EXPECT_EQ(last_msg_.sol_in[48].flags, 140) << "incorrect value for last_msg_.sol_in[48].flags, expected 140, is " << last_msg_.sol_in[48].flags; - EXPECT_EQ(last_msg_.sol_in[48].sensor_type, 97) << "incorrect value for last_msg_.sol_in[48].sensor_type, expected 97, is " << last_msg_.sol_in[48].sensor_type; - EXPECT_EQ(last_msg_.sol_in[49].flags, 227) << "incorrect value for last_msg_.sol_in[49].flags, expected 227, is " << last_msg_.sol_in[49].flags; - EXPECT_EQ(last_msg_.sol_in[49].sensor_type, 252) << "incorrect value for last_msg_.sol_in[49].sensor_type, expected 252, is " << last_msg_.sol_in[49].sensor_type; - EXPECT_EQ(last_msg_.sol_in[50].flags, 237) << "incorrect value for last_msg_.sol_in[50].flags, expected 237, is " << last_msg_.sol_in[50].flags; - EXPECT_EQ(last_msg_.sol_in[50].sensor_type, 230) << "incorrect value for last_msg_.sol_in[50].sensor_type, expected 230, is " << last_msg_.sol_in[50].sensor_type; - EXPECT_EQ(last_msg_.sol_in[51].flags, 241) << "incorrect value for last_msg_.sol_in[51].flags, expected 241, is " << last_msg_.sol_in[51].flags; - EXPECT_EQ(last_msg_.sol_in[51].sensor_type, 135) << "incorrect value for last_msg_.sol_in[51].sensor_type, expected 135, is " << last_msg_.sol_in[51].sensor_type; - EXPECT_EQ(last_msg_.sol_in[52].flags, 205) << "incorrect value for last_msg_.sol_in[52].flags, expected 205, is " << last_msg_.sol_in[52].flags; - EXPECT_EQ(last_msg_.sol_in[52].sensor_type, 245) << "incorrect value for last_msg_.sol_in[52].sensor_type, expected 245, is " << last_msg_.sol_in[52].sensor_type; - EXPECT_EQ(last_msg_.sol_in[53].flags, 0) << "incorrect value for last_msg_.sol_in[53].flags, expected 0, is " << last_msg_.sol_in[53].flags; - EXPECT_EQ(last_msg_.sol_in[53].sensor_type, 70) << "incorrect value for last_msg_.sol_in[53].sensor_type, expected 70, is " << last_msg_.sol_in[53].sensor_type; - EXPECT_EQ(last_msg_.sol_in[54].flags, 188) << "incorrect value for last_msg_.sol_in[54].flags, expected 188, is " << last_msg_.sol_in[54].flags; - EXPECT_EQ(last_msg_.sol_in[54].sensor_type, 219) << "incorrect value for last_msg_.sol_in[54].sensor_type, expected 219, is " << last_msg_.sol_in[54].sensor_type; - EXPECT_EQ(last_msg_.sol_in[55].flags, 136) << "incorrect value for last_msg_.sol_in[55].flags, expected 136, is " << last_msg_.sol_in[55].flags; - EXPECT_EQ(last_msg_.sol_in[55].sensor_type, 107) << "incorrect value for last_msg_.sol_in[55].sensor_type, expected 107, is " << last_msg_.sol_in[55].sensor_type; - EXPECT_EQ(last_msg_.sol_in[56].flags, 58) << "incorrect value for last_msg_.sol_in[56].flags, expected 58, is " << last_msg_.sol_in[56].flags; - EXPECT_EQ(last_msg_.sol_in[56].sensor_type, 178) << "incorrect value for last_msg_.sol_in[56].sensor_type, expected 178, is " << last_msg_.sol_in[56].sensor_type; - EXPECT_EQ(last_msg_.sol_in[57].flags, 29) << "incorrect value for last_msg_.sol_in[57].flags, expected 29, is " << last_msg_.sol_in[57].flags; - EXPECT_EQ(last_msg_.sol_in[57].sensor_type, 1) << "incorrect value for last_msg_.sol_in[57].sensor_type, expected 1, is " << last_msg_.sol_in[57].sensor_type; - EXPECT_EQ(last_msg_.sol_in[58].flags, 213) << "incorrect value for last_msg_.sol_in[58].flags, expected 213, is " << last_msg_.sol_in[58].flags; - EXPECT_EQ(last_msg_.sol_in[58].sensor_type, 44) << "incorrect value for last_msg_.sol_in[58].sensor_type, expected 44, is " << last_msg_.sol_in[58].sensor_type; - EXPECT_EQ(last_msg_.sol_in[59].flags, 147) << "incorrect value for last_msg_.sol_in[59].flags, expected 147, is " << last_msg_.sol_in[59].flags; - EXPECT_EQ(last_msg_.sol_in[59].sensor_type, 225) << "incorrect value for last_msg_.sol_in[59].sensor_type, expected 225, is " << last_msg_.sol_in[59].sensor_type; - EXPECT_EQ(last_msg_.sol_in[60].flags, 96) << "incorrect value for last_msg_.sol_in[60].flags, expected 96, is " << last_msg_.sol_in[60].flags; - EXPECT_EQ(last_msg_.sol_in[60].sensor_type, 190) << "incorrect value for last_msg_.sol_in[60].sensor_type, expected 190, is " << last_msg_.sol_in[60].sensor_type; - EXPECT_EQ(last_msg_.sol_in[61].flags, 108) << "incorrect value for last_msg_.sol_in[61].flags, expected 108, is " << last_msg_.sol_in[61].flags; - EXPECT_EQ(last_msg_.sol_in[61].sensor_type, 192) << "incorrect value for last_msg_.sol_in[61].sensor_type, expected 192, is " << last_msg_.sol_in[61].sensor_type; - EXPECT_EQ(last_msg_.sol_in[62].flags, 15) << "incorrect value for last_msg_.sol_in[62].flags, expected 15, is " << last_msg_.sol_in[62].flags; - EXPECT_EQ(last_msg_.sol_in[62].sensor_type, 228) << "incorrect value for last_msg_.sol_in[62].sensor_type, expected 228, is " << last_msg_.sol_in[62].sensor_type; - EXPECT_EQ(last_msg_.sol_in[63].flags, 18) << "incorrect value for last_msg_.sol_in[63].flags, expected 18, is " << last_msg_.sol_in[63].flags; - EXPECT_EQ(last_msg_.sol_in[63].sensor_type, 203) << "incorrect value for last_msg_.sol_in[63].sensor_type, expected 203, is " << last_msg_.sol_in[63].sensor_type; - EXPECT_EQ(last_msg_.sol_in[64].flags, 222) << "incorrect value for last_msg_.sol_in[64].flags, expected 222, is " << last_msg_.sol_in[64].flags; - EXPECT_EQ(last_msg_.sol_in[64].sensor_type, 3) << "incorrect value for last_msg_.sol_in[64].sensor_type, expected 3, is " << last_msg_.sol_in[64].sensor_type; - EXPECT_EQ(last_msg_.sol_in[65].flags, 68) << "incorrect value for last_msg_.sol_in[65].flags, expected 68, is " << last_msg_.sol_in[65].flags; - EXPECT_EQ(last_msg_.sol_in[65].sensor_type, 180) << "incorrect value for last_msg_.sol_in[65].sensor_type, expected 180, is " << last_msg_.sol_in[65].sensor_type; - EXPECT_EQ(last_msg_.sol_in[66].flags, 229) << "incorrect value for last_msg_.sol_in[66].flags, expected 229, is " << last_msg_.sol_in[66].flags; - EXPECT_EQ(last_msg_.sol_in[66].sensor_type, 101) << "incorrect value for last_msg_.sol_in[66].sensor_type, expected 101, is " << last_msg_.sol_in[66].sensor_type; - EXPECT_EQ(last_msg_.sol_in[67].flags, 203) << "incorrect value for last_msg_.sol_in[67].flags, expected 203, is " << last_msg_.sol_in[67].flags; - EXPECT_EQ(last_msg_.sol_in[67].sensor_type, 223) << "incorrect value for last_msg_.sol_in[67].sensor_type, expected 223, is " << last_msg_.sol_in[67].sensor_type; - EXPECT_EQ(last_msg_.sol_in[68].flags, 164) << "incorrect value for last_msg_.sol_in[68].flags, expected 164, is " << last_msg_.sol_in[68].flags; - EXPECT_EQ(last_msg_.sol_in[68].sensor_type, 243) << "incorrect value for last_msg_.sol_in[68].sensor_type, expected 243, is " << last_msg_.sol_in[68].sensor_type; - EXPECT_EQ(last_msg_.sol_in[69].flags, 165) << "incorrect value for last_msg_.sol_in[69].flags, expected 165, is " << last_msg_.sol_in[69].flags; - EXPECT_EQ(last_msg_.sol_in[69].sensor_type, 92) << "incorrect value for last_msg_.sol_in[69].sensor_type, expected 92, is " << last_msg_.sol_in[69].sensor_type; - EXPECT_EQ(last_msg_.sol_in[70].flags, 159) << "incorrect value for last_msg_.sol_in[70].flags, expected 159, is " << last_msg_.sol_in[70].flags; - EXPECT_EQ(last_msg_.sol_in[70].sensor_type, 220) << "incorrect value for last_msg_.sol_in[70].sensor_type, expected 220, is " << last_msg_.sol_in[70].sensor_type; - EXPECT_EQ(last_msg_.sol_in[71].flags, 121) << "incorrect value for last_msg_.sol_in[71].flags, expected 121, is " << last_msg_.sol_in[71].flags; - EXPECT_EQ(last_msg_.sol_in[71].sensor_type, 174) << "incorrect value for last_msg_.sol_in[71].sensor_type, expected 174, is " << last_msg_.sol_in[71].sensor_type; - EXPECT_EQ(last_msg_.sol_in[72].flags, 167) << "incorrect value for last_msg_.sol_in[72].flags, expected 167, is " << last_msg_.sol_in[72].flags; - EXPECT_EQ(last_msg_.sol_in[72].sensor_type, 112) << "incorrect value for last_msg_.sol_in[72].sensor_type, expected 112, is " << last_msg_.sol_in[72].sensor_type; - EXPECT_EQ(last_msg_.sol_in[73].flags, 40) << "incorrect value for last_msg_.sol_in[73].flags, expected 40, is " << last_msg_.sol_in[73].flags; - EXPECT_EQ(last_msg_.sol_in[73].sensor_type, 240) << "incorrect value for last_msg_.sol_in[73].sensor_type, expected 240, is " << last_msg_.sol_in[73].sensor_type; - EXPECT_EQ(last_msg_.sol_in[74].flags, 3) << "incorrect value for last_msg_.sol_in[74].flags, expected 3, is " << last_msg_.sol_in[74].flags; - EXPECT_EQ(last_msg_.sol_in[74].sensor_type, 59) << "incorrect value for last_msg_.sol_in[74].sensor_type, expected 59, is " << last_msg_.sol_in[74].sensor_type; - EXPECT_EQ(last_msg_.sol_in[75].flags, 52) << "incorrect value for last_msg_.sol_in[75].flags, expected 52, is " << last_msg_.sol_in[75].flags; - EXPECT_EQ(last_msg_.sol_in[75].sensor_type, 230) << "incorrect value for last_msg_.sol_in[75].sensor_type, expected 230, is " << last_msg_.sol_in[75].sensor_type; - EXPECT_EQ(last_msg_.sol_in[76].flags, 148) << "incorrect value for last_msg_.sol_in[76].flags, expected 148, is " << last_msg_.sol_in[76].flags; - EXPECT_EQ(last_msg_.sol_in[76].sensor_type, 149) << "incorrect value for last_msg_.sol_in[76].sensor_type, expected 149, is " << last_msg_.sol_in[76].sensor_type; - EXPECT_EQ(last_msg_.sol_in[77].flags, 142) << "incorrect value for last_msg_.sol_in[77].flags, expected 142, is " << last_msg_.sol_in[77].flags; - EXPECT_EQ(last_msg_.sol_in[77].sensor_type, 218) << "incorrect value for last_msg_.sol_in[77].sensor_type, expected 218, is " << last_msg_.sol_in[77].sensor_type; - EXPECT_EQ(last_msg_.sol_in[78].flags, 109) << "incorrect value for last_msg_.sol_in[78].flags, expected 109, is " << last_msg_.sol_in[78].flags; - EXPECT_EQ(last_msg_.sol_in[78].sensor_type, 212) << "incorrect value for last_msg_.sol_in[78].sensor_type, expected 212, is " << last_msg_.sol_in[78].sensor_type; - EXPECT_EQ(last_msg_.sol_in[79].flags, 71) << "incorrect value for last_msg_.sol_in[79].flags, expected 71, is " << last_msg_.sol_in[79].flags; - EXPECT_EQ(last_msg_.sol_in[79].sensor_type, 176) << "incorrect value for last_msg_.sol_in[79].sensor_type, expected 176, is " << last_msg_.sol_in[79].sensor_type; - EXPECT_EQ(last_msg_.sol_in[80].flags, 172) << "incorrect value for last_msg_.sol_in[80].flags, expected 172, is " << last_msg_.sol_in[80].flags; - EXPECT_EQ(last_msg_.sol_in[80].sensor_type, 179) << "incorrect value for last_msg_.sol_in[80].sensor_type, expected 179, is " << last_msg_.sol_in[80].sensor_type; - EXPECT_EQ(last_msg_.sol_in[81].flags, 1) << "incorrect value for last_msg_.sol_in[81].flags, expected 1, is " << last_msg_.sol_in[81].flags; - EXPECT_EQ(last_msg_.sol_in[81].sensor_type, 77) << "incorrect value for last_msg_.sol_in[81].sensor_type, expected 77, is " << last_msg_.sol_in[81].sensor_type; - EXPECT_EQ(last_msg_.sol_in[82].flags, 70) << "incorrect value for last_msg_.sol_in[82].flags, expected 70, is " << last_msg_.sol_in[82].flags; - EXPECT_EQ(last_msg_.sol_in[82].sensor_type, 193) << "incorrect value for last_msg_.sol_in[82].sensor_type, expected 193, is " << last_msg_.sol_in[82].sensor_type; - EXPECT_EQ(last_msg_.sol_in[83].flags, 149) << "incorrect value for last_msg_.sol_in[83].flags, expected 149, is " << last_msg_.sol_in[83].flags; - EXPECT_EQ(last_msg_.sol_in[83].sensor_type, 147) << "incorrect value for last_msg_.sol_in[83].sensor_type, expected 147, is " << last_msg_.sol_in[83].sensor_type; - EXPECT_EQ(last_msg_.sol_in[84].flags, 144) << "incorrect value for last_msg_.sol_in[84].flags, expected 144, is " << last_msg_.sol_in[84].flags; - EXPECT_EQ(last_msg_.sol_in[84].sensor_type, 23) << "incorrect value for last_msg_.sol_in[84].sensor_type, expected 23, is " << last_msg_.sol_in[84].sensor_type; - EXPECT_EQ(last_msg_.sol_in[85].flags, 239) << "incorrect value for last_msg_.sol_in[85].flags, expected 239, is " << last_msg_.sol_in[85].flags; - EXPECT_EQ(last_msg_.sol_in[85].sensor_type, 148) << "incorrect value for last_msg_.sol_in[85].sensor_type, expected 148, is " << last_msg_.sol_in[85].sensor_type; - EXPECT_EQ(last_msg_.sol_in[86].flags, 186) << "incorrect value for last_msg_.sol_in[86].flags, expected 186, is " << last_msg_.sol_in[86].flags; - EXPECT_EQ(last_msg_.sol_in[86].sensor_type, 195) << "incorrect value for last_msg_.sol_in[86].sensor_type, expected 195, is " << last_msg_.sol_in[86].sensor_type; - EXPECT_EQ(last_msg_.sol_in[87].flags, 30) << "incorrect value for last_msg_.sol_in[87].flags, expected 30, is " << last_msg_.sol_in[87].flags; - EXPECT_EQ(last_msg_.sol_in[87].sensor_type, 86) << "incorrect value for last_msg_.sol_in[87].sensor_type, expected 86, is " << last_msg_.sol_in[87].sensor_type; - EXPECT_EQ(last_msg_.sol_in[88].flags, 143) << "incorrect value for last_msg_.sol_in[88].flags, expected 143, is " << last_msg_.sol_in[88].flags; - EXPECT_EQ(last_msg_.sol_in[88].sensor_type, 34) << "incorrect value for last_msg_.sol_in[88].sensor_type, expected 34, is " << last_msg_.sol_in[88].sensor_type; - EXPECT_EQ(last_msg_.sol_in[89].flags, 207) << "incorrect value for last_msg_.sol_in[89].flags, expected 207, is " << last_msg_.sol_in[89].flags; - EXPECT_EQ(last_msg_.sol_in[89].sensor_type, 156) << "incorrect value for last_msg_.sol_in[89].sensor_type, expected 156, is " << last_msg_.sol_in[89].sensor_type; - EXPECT_EQ(last_msg_.sol_in[90].flags, 55) << "incorrect value for last_msg_.sol_in[90].flags, expected 55, is " << last_msg_.sol_in[90].flags; - EXPECT_EQ(last_msg_.sol_in[90].sensor_type, 63) << "incorrect value for last_msg_.sol_in[90].sensor_type, expected 63, is " << last_msg_.sol_in[90].sensor_type; - EXPECT_EQ(last_msg_.sol_in[91].flags, 255) << "incorrect value for last_msg_.sol_in[91].flags, expected 255, is " << last_msg_.sol_in[91].flags; - EXPECT_EQ(last_msg_.sol_in[91].sensor_type, 117) << "incorrect value for last_msg_.sol_in[91].sensor_type, expected 117, is " << last_msg_.sol_in[91].sensor_type; - EXPECT_EQ(last_msg_.sol_in[92].flags, 222) << "incorrect value for last_msg_.sol_in[92].flags, expected 222, is " << last_msg_.sol_in[92].flags; - EXPECT_EQ(last_msg_.sol_in[92].sensor_type, 222) << "incorrect value for last_msg_.sol_in[92].sensor_type, expected 222, is " << last_msg_.sol_in[92].sensor_type; - EXPECT_EQ(last_msg_.sol_in[93].flags, 145) << "incorrect value for last_msg_.sol_in[93].flags, expected 145, is " << last_msg_.sol_in[93].flags; - EXPECT_EQ(last_msg_.sol_in[93].sensor_type, 219) << "incorrect value for last_msg_.sol_in[93].sensor_type, expected 219, is " << last_msg_.sol_in[93].sensor_type; - EXPECT_EQ(last_msg_.sol_in[94].flags, 191) << "incorrect value for last_msg_.sol_in[94].flags, expected 191, is " << last_msg_.sol_in[94].flags; - EXPECT_EQ(last_msg_.sol_in[94].sensor_type, 224) << "incorrect value for last_msg_.sol_in[94].sensor_type, expected 224, is " << last_msg_.sol_in[94].sensor_type; - EXPECT_EQ(last_msg_.sol_in[95].flags, 109) << "incorrect value for last_msg_.sol_in[95].flags, expected 109, is " << last_msg_.sol_in[95].flags; - EXPECT_EQ(last_msg_.sol_in[95].sensor_type, 210) << "incorrect value for last_msg_.sol_in[95].sensor_type, expected 210, is " << last_msg_.sol_in[95].sensor_type; - EXPECT_EQ(last_msg_.sol_in[96].flags, 153) << "incorrect value for last_msg_.sol_in[96].flags, expected 153, is " << last_msg_.sol_in[96].flags; - EXPECT_EQ(last_msg_.sol_in[96].sensor_type, 86) << "incorrect value for last_msg_.sol_in[96].sensor_type, expected 86, is " << last_msg_.sol_in[96].sensor_type; - EXPECT_EQ(last_msg_.sol_in[97].flags, 32) << "incorrect value for last_msg_.sol_in[97].flags, expected 32, is " << last_msg_.sol_in[97].flags; - EXPECT_EQ(last_msg_.sol_in[97].sensor_type, 21) << "incorrect value for last_msg_.sol_in[97].sensor_type, expected 21, is " << last_msg_.sol_in[97].sensor_type; - EXPECT_EQ(last_msg_.sol_in[98].flags, 10) << "incorrect value for last_msg_.sol_in[98].flags, expected 10, is " << last_msg_.sol_in[98].flags; - EXPECT_EQ(last_msg_.sol_in[98].sensor_type, 226) << "incorrect value for last_msg_.sol_in[98].sensor_type, expected 226, is " << last_msg_.sol_in[98].sensor_type; - EXPECT_EQ(last_msg_.sol_in[99].flags, 63) << "incorrect value for last_msg_.sol_in[99].flags, expected 63, is " << last_msg_.sol_in[99].flags; - EXPECT_EQ(last_msg_.sol_in[99].sensor_type, 60) << "incorrect value for last_msg_.sol_in[99].sensor_type, expected 60, is " << last_msg_.sol_in[99].sensor_type; - EXPECT_EQ(last_msg_.sol_in[100].flags, 236) << "incorrect value for last_msg_.sol_in[100].flags, expected 236, is " << last_msg_.sol_in[100].flags; - EXPECT_EQ(last_msg_.sol_in[100].sensor_type, 106) << "incorrect value for last_msg_.sol_in[100].sensor_type, expected 106, is " << last_msg_.sol_in[100].sensor_type; - EXPECT_EQ(last_msg_.sol_in[101].flags, 96) << "incorrect value for last_msg_.sol_in[101].flags, expected 96, is " << last_msg_.sol_in[101].flags; - EXPECT_EQ(last_msg_.sol_in[101].sensor_type, 93) << "incorrect value for last_msg_.sol_in[101].sensor_type, expected 93, is " << last_msg_.sol_in[101].sensor_type; - EXPECT_EQ(last_msg_.sol_in[102].flags, 163) << "incorrect value for last_msg_.sol_in[102].flags, expected 163, is " << last_msg_.sol_in[102].flags; - EXPECT_EQ(last_msg_.sol_in[102].sensor_type, 30) << "incorrect value for last_msg_.sol_in[102].sensor_type, expected 30, is " << last_msg_.sol_in[102].sensor_type; - EXPECT_EQ(last_msg_.sol_in[103].flags, 238) << "incorrect value for last_msg_.sol_in[103].flags, expected 238, is " << last_msg_.sol_in[103].flags; - EXPECT_EQ(last_msg_.sol_in[103].sensor_type, 106) << "incorrect value for last_msg_.sol_in[103].sensor_type, expected 106, is " << last_msg_.sol_in[103].sensor_type; - EXPECT_EQ(last_msg_.sol_in[104].flags, 133) << "incorrect value for last_msg_.sol_in[104].flags, expected 133, is " << last_msg_.sol_in[104].flags; - EXPECT_EQ(last_msg_.sol_in[104].sensor_type, 147) << "incorrect value for last_msg_.sol_in[104].sensor_type, expected 147, is " << last_msg_.sol_in[104].sensor_type; - EXPECT_EQ(last_msg_.sol_in[105].flags, 107) << "incorrect value for last_msg_.sol_in[105].flags, expected 107, is " << last_msg_.sol_in[105].flags; - EXPECT_EQ(last_msg_.sol_in[105].sensor_type, 132) << "incorrect value for last_msg_.sol_in[105].sensor_type, expected 132, is " << last_msg_.sol_in[105].sensor_type; - EXPECT_EQ(last_msg_.sol_in[106].flags, 214) << "incorrect value for last_msg_.sol_in[106].flags, expected 214, is " << last_msg_.sol_in[106].flags; - EXPECT_EQ(last_msg_.sol_in[106].sensor_type, 152) << "incorrect value for last_msg_.sol_in[106].sensor_type, expected 152, is " << last_msg_.sol_in[106].sensor_type; - EXPECT_EQ(last_msg_.sol_in[107].flags, 185) << "incorrect value for last_msg_.sol_in[107].flags, expected 185, is " << last_msg_.sol_in[107].flags; - EXPECT_EQ(last_msg_.sol_in[107].sensor_type, 221) << "incorrect value for last_msg_.sol_in[107].sensor_type, expected 221, is " << last_msg_.sol_in[107].sensor_type; - EXPECT_EQ(last_msg_.sol_in[108].flags, 21) << "incorrect value for last_msg_.sol_in[108].flags, expected 21, is " << last_msg_.sol_in[108].flags; - EXPECT_EQ(last_msg_.sol_in[108].sensor_type, 202) << "incorrect value for last_msg_.sol_in[108].sensor_type, expected 202, is " << last_msg_.sol_in[108].sensor_type; - EXPECT_EQ(last_msg_.sol_in[109].flags, 51) << "incorrect value for last_msg_.sol_in[109].flags, expected 51, is " << last_msg_.sol_in[109].flags; - EXPECT_EQ(last_msg_.sol_in[109].sensor_type, 252) << "incorrect value for last_msg_.sol_in[109].sensor_type, expected 252, is " << last_msg_.sol_in[109].sensor_type; - EXPECT_EQ(last_msg_.sol_in[110].flags, 59) << "incorrect value for last_msg_.sol_in[110].flags, expected 59, is " << last_msg_.sol_in[110].flags; - EXPECT_EQ(last_msg_.sol_in[110].sensor_type, 130) << "incorrect value for last_msg_.sol_in[110].sensor_type, expected 130, is " << last_msg_.sol_in[110].sensor_type; - EXPECT_EQ(last_msg_.sol_in[111].flags, 202) << "incorrect value for last_msg_.sol_in[111].flags, expected 202, is " << last_msg_.sol_in[111].flags; - EXPECT_EQ(last_msg_.sol_in[111].sensor_type, 166) << "incorrect value for last_msg_.sol_in[111].sensor_type, expected 166, is " << last_msg_.sol_in[111].sensor_type; - EXPECT_EQ(last_msg_.sol_in[112].flags, 170) << "incorrect value for last_msg_.sol_in[112].flags, expected 170, is " << last_msg_.sol_in[112].flags; - EXPECT_EQ(last_msg_.sol_in[112].sensor_type, 127) << "incorrect value for last_msg_.sol_in[112].sensor_type, expected 127, is " << last_msg_.sol_in[112].sensor_type; - EXPECT_EQ(last_msg_.sol_in[113].flags, 193) << "incorrect value for last_msg_.sol_in[113].flags, expected 193, is " << last_msg_.sol_in[113].flags; - EXPECT_EQ(last_msg_.sol_in[113].sensor_type, 58) << "incorrect value for last_msg_.sol_in[113].sensor_type, expected 58, is " << last_msg_.sol_in[113].sensor_type; - EXPECT_EQ(last_msg_.sol_in[114].flags, 125) << "incorrect value for last_msg_.sol_in[114].flags, expected 125, is " << last_msg_.sol_in[114].flags; - EXPECT_EQ(last_msg_.sol_in[114].sensor_type, 215) << "incorrect value for last_msg_.sol_in[114].sensor_type, expected 215, is " << last_msg_.sol_in[114].sensor_type; - EXPECT_EQ(last_msg_.sol_in[115].flags, 58) << "incorrect value for last_msg_.sol_in[115].flags, expected 58, is " << last_msg_.sol_in[115].flags; - EXPECT_EQ(last_msg_.sol_in[115].sensor_type, 22) << "incorrect value for last_msg_.sol_in[115].sensor_type, expected 22, is " << last_msg_.sol_in[115].sensor_type; - EXPECT_EQ(last_msg_.sol_in[116].flags, 47) << "incorrect value for last_msg_.sol_in[116].flags, expected 47, is " << last_msg_.sol_in[116].flags; - EXPECT_EQ(last_msg_.sol_in[116].sensor_type, 135) << "incorrect value for last_msg_.sol_in[116].sensor_type, expected 135, is " << last_msg_.sol_in[116].sensor_type; - EXPECT_EQ(last_msg_.sol_in[117].flags, 142) << "incorrect value for last_msg_.sol_in[117].flags, expected 142, is " << last_msg_.sol_in[117].flags; - EXPECT_EQ(last_msg_.sol_in[117].sensor_type, 88) << "incorrect value for last_msg_.sol_in[117].sensor_type, expected 88, is " << last_msg_.sol_in[117].sensor_type; - EXPECT_EQ(last_msg_.vdop, 41989) << "incorrect value for last_msg_.vdop, expected 41989, is " << last_msg_.vdop; +}; + +TEST_F(Test_auto_check_sbp_solution_meta_MsgSolnMetaDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 15, 255, 84, 241, 254, 183, 222, 157, 121, 5, 164, 238, 31, 190, + 115, 93, 59, 103, 36, 83, 161, 156, 46, 253, 67, 87, 200, 39, 250, + 245, 242, 228, 72, 18, 222, 11, 88, 207, 218, 231, 13, 226, 224, 22, + 196, 21, 242, 12, 89, 71, 219, 182, 85, 145, 204, 146, 40, 204, 51, + 21, 153, 227, 44, 15, 28, 255, 39, 205, 216, 240, 190, 93, 219, 103, + 42, 41, 182, 76, 222, 17, 23, 125, 31, 18, 229, 28, 47, 214, 25, + 100, 84, 106, 72, 48, 10, 222, 232, 235, 73, 109, 163, 51, 152, 133, + 235, 87, 70, 2, 108, 91, 101, 200, 55, 24, 156, 233, 73, 39, 66, + 97, 140, 252, 227, 230, 237, 135, 241, 245, 205, 70, 0, 219, 188, 107, + 136, 178, 58, 1, 29, 44, 213, 225, 147, 190, 96, 192, 108, 228, 15, + 203, 18, 3, 222, 180, 68, 101, 229, 223, 203, 243, 164, 92, 165, 220, + 159, 174, 121, 112, 167, 240, 40, 59, 3, 230, 52, 149, 148, 218, 142, + 212, 109, 176, 71, 179, 172, 77, 1, 193, 70, 147, 149, 23, 144, 148, + 239, 195, 186, 86, 30, 34, 143, 156, 207, 63, 55, 117, 255, 222, 222, + 219, 145, 224, 191, 210, 109, 86, 153, 21, 32, 226, 10, 60, 63, 106, + 236, 93, 96, 30, 163, 106, 238, 147, 133, 132, 107, 152, 214, 221, 185, + 202, 21, 252, 51, 130, 59, 166, 202, 127, 170, 58, 193, 215, 125, 22, + 58, 135, 47, 88, 142, 77, 211, + }; + + sbp_msg_soln_meta_dep_a_t test_msg{}; + test_msg.age_corrections = 48671; + test_msg.alignment_status = 115; + test_msg.hdop = 31133; + test_msg.last_used_gnss_pos_tow = 610745181; + test_msg.last_used_gnss_vel_tow = 782016851; + test_msg.n_sats = 238; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_sol_in.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)111, (char)108, + (char)95, (char)105, (char)110}; + memcpy(test_msg.n_sol_in.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_sol_in.value = 118; + test_msg.pdop = 57015; + + test_msg.sol_in[0].flags = 67; + test_msg.sol_in[0].sensor_type = 253; + + test_msg.sol_in[1].flags = 200; + test_msg.sol_in[1].sensor_type = 87; + + test_msg.sol_in[2].flags = 250; + test_msg.sol_in[2].sensor_type = 39; + + test_msg.sol_in[3].flags = 242; + test_msg.sol_in[3].sensor_type = 245; + + test_msg.sol_in[4].flags = 72; + test_msg.sol_in[4].sensor_type = 228; + + test_msg.sol_in[5].flags = 222; + test_msg.sol_in[5].sensor_type = 18; + + test_msg.sol_in[6].flags = 88; + test_msg.sol_in[6].sensor_type = 11; + + test_msg.sol_in[7].flags = 218; + test_msg.sol_in[7].sensor_type = 207; + + test_msg.sol_in[8].flags = 13; + test_msg.sol_in[8].sensor_type = 231; + + test_msg.sol_in[9].flags = 224; + test_msg.sol_in[9].sensor_type = 226; + + test_msg.sol_in[10].flags = 196; + test_msg.sol_in[10].sensor_type = 22; + + test_msg.sol_in[11].flags = 242; + test_msg.sol_in[11].sensor_type = 21; + + test_msg.sol_in[12].flags = 89; + test_msg.sol_in[12].sensor_type = 12; + + test_msg.sol_in[13].flags = 219; + test_msg.sol_in[13].sensor_type = 71; + + test_msg.sol_in[14].flags = 85; + test_msg.sol_in[14].sensor_type = 182; + + test_msg.sol_in[15].flags = 204; + test_msg.sol_in[15].sensor_type = 145; + + test_msg.sol_in[16].flags = 40; + test_msg.sol_in[16].sensor_type = 146; + + test_msg.sol_in[17].flags = 51; + test_msg.sol_in[17].sensor_type = 204; + + test_msg.sol_in[18].flags = 153; + test_msg.sol_in[18].sensor_type = 21; + + test_msg.sol_in[19].flags = 44; + test_msg.sol_in[19].sensor_type = 227; + + test_msg.sol_in[20].flags = 28; + test_msg.sol_in[20].sensor_type = 15; + + test_msg.sol_in[21].flags = 39; + test_msg.sol_in[21].sensor_type = 255; + + test_msg.sol_in[22].flags = 216; + test_msg.sol_in[22].sensor_type = 205; + + test_msg.sol_in[23].flags = 190; + test_msg.sol_in[23].sensor_type = 240; + + test_msg.sol_in[24].flags = 219; + test_msg.sol_in[24].sensor_type = 93; + + test_msg.sol_in[25].flags = 42; + test_msg.sol_in[25].sensor_type = 103; + + test_msg.sol_in[26].flags = 182; + test_msg.sol_in[26].sensor_type = 41; + + test_msg.sol_in[27].flags = 222; + test_msg.sol_in[27].sensor_type = 76; + + test_msg.sol_in[28].flags = 23; + test_msg.sol_in[28].sensor_type = 17; + + test_msg.sol_in[29].flags = 31; + test_msg.sol_in[29].sensor_type = 125; + + test_msg.sol_in[30].flags = 229; + test_msg.sol_in[30].sensor_type = 18; + + test_msg.sol_in[31].flags = 47; + test_msg.sol_in[31].sensor_type = 28; + + test_msg.sol_in[32].flags = 25; + test_msg.sol_in[32].sensor_type = 214; + + test_msg.sol_in[33].flags = 84; + test_msg.sol_in[33].sensor_type = 100; + + test_msg.sol_in[34].flags = 72; + test_msg.sol_in[34].sensor_type = 106; + + test_msg.sol_in[35].flags = 10; + test_msg.sol_in[35].sensor_type = 48; + + test_msg.sol_in[36].flags = 232; + test_msg.sol_in[36].sensor_type = 222; + + test_msg.sol_in[37].flags = 73; + test_msg.sol_in[37].sensor_type = 235; + + test_msg.sol_in[38].flags = 163; + test_msg.sol_in[38].sensor_type = 109; + + test_msg.sol_in[39].flags = 152; + test_msg.sol_in[39].sensor_type = 51; + + test_msg.sol_in[40].flags = 235; + test_msg.sol_in[40].sensor_type = 133; + + test_msg.sol_in[41].flags = 70; + test_msg.sol_in[41].sensor_type = 87; + + test_msg.sol_in[42].flags = 108; + test_msg.sol_in[42].sensor_type = 2; + + test_msg.sol_in[43].flags = 101; + test_msg.sol_in[43].sensor_type = 91; + + test_msg.sol_in[44].flags = 55; + test_msg.sol_in[44].sensor_type = 200; + + test_msg.sol_in[45].flags = 156; + test_msg.sol_in[45].sensor_type = 24; + + test_msg.sol_in[46].flags = 73; + test_msg.sol_in[46].sensor_type = 233; + + test_msg.sol_in[47].flags = 66; + test_msg.sol_in[47].sensor_type = 39; + + test_msg.sol_in[48].flags = 140; + test_msg.sol_in[48].sensor_type = 97; + + test_msg.sol_in[49].flags = 227; + test_msg.sol_in[49].sensor_type = 252; + + test_msg.sol_in[50].flags = 237; + test_msg.sol_in[50].sensor_type = 230; + + test_msg.sol_in[51].flags = 241; + test_msg.sol_in[51].sensor_type = 135; + + test_msg.sol_in[52].flags = 205; + test_msg.sol_in[52].sensor_type = 245; + + test_msg.sol_in[53].flags = 0; + test_msg.sol_in[53].sensor_type = 70; + + test_msg.sol_in[54].flags = 188; + test_msg.sol_in[54].sensor_type = 219; + + test_msg.sol_in[55].flags = 136; + test_msg.sol_in[55].sensor_type = 107; + + test_msg.sol_in[56].flags = 58; + test_msg.sol_in[56].sensor_type = 178; + + test_msg.sol_in[57].flags = 29; + test_msg.sol_in[57].sensor_type = 1; + + test_msg.sol_in[58].flags = 213; + test_msg.sol_in[58].sensor_type = 44; + + test_msg.sol_in[59].flags = 147; + test_msg.sol_in[59].sensor_type = 225; + + test_msg.sol_in[60].flags = 96; + test_msg.sol_in[60].sensor_type = 190; + + test_msg.sol_in[61].flags = 108; + test_msg.sol_in[61].sensor_type = 192; + + test_msg.sol_in[62].flags = 15; + test_msg.sol_in[62].sensor_type = 228; + + test_msg.sol_in[63].flags = 18; + test_msg.sol_in[63].sensor_type = 203; + + test_msg.sol_in[64].flags = 222; + test_msg.sol_in[64].sensor_type = 3; + + test_msg.sol_in[65].flags = 68; + test_msg.sol_in[65].sensor_type = 180; + + test_msg.sol_in[66].flags = 229; + test_msg.sol_in[66].sensor_type = 101; + + test_msg.sol_in[67].flags = 203; + test_msg.sol_in[67].sensor_type = 223; + + test_msg.sol_in[68].flags = 164; + test_msg.sol_in[68].sensor_type = 243; + + test_msg.sol_in[69].flags = 165; + test_msg.sol_in[69].sensor_type = 92; + + test_msg.sol_in[70].flags = 159; + test_msg.sol_in[70].sensor_type = 220; + + test_msg.sol_in[71].flags = 121; + test_msg.sol_in[71].sensor_type = 174; + + test_msg.sol_in[72].flags = 167; + test_msg.sol_in[72].sensor_type = 112; + + test_msg.sol_in[73].flags = 40; + test_msg.sol_in[73].sensor_type = 240; + + test_msg.sol_in[74].flags = 3; + test_msg.sol_in[74].sensor_type = 59; + + test_msg.sol_in[75].flags = 52; + test_msg.sol_in[75].sensor_type = 230; + + test_msg.sol_in[76].flags = 148; + test_msg.sol_in[76].sensor_type = 149; + + test_msg.sol_in[77].flags = 142; + test_msg.sol_in[77].sensor_type = 218; + + test_msg.sol_in[78].flags = 109; + test_msg.sol_in[78].sensor_type = 212; + + test_msg.sol_in[79].flags = 71; + test_msg.sol_in[79].sensor_type = 176; + + test_msg.sol_in[80].flags = 172; + test_msg.sol_in[80].sensor_type = 179; + + test_msg.sol_in[81].flags = 1; + test_msg.sol_in[81].sensor_type = 77; + + test_msg.sol_in[82].flags = 70; + test_msg.sol_in[82].sensor_type = 193; + + test_msg.sol_in[83].flags = 149; + test_msg.sol_in[83].sensor_type = 147; + + test_msg.sol_in[84].flags = 144; + test_msg.sol_in[84].sensor_type = 23; + + test_msg.sol_in[85].flags = 239; + test_msg.sol_in[85].sensor_type = 148; + + test_msg.sol_in[86].flags = 186; + test_msg.sol_in[86].sensor_type = 195; + + test_msg.sol_in[87].flags = 30; + test_msg.sol_in[87].sensor_type = 86; + + test_msg.sol_in[88].flags = 143; + test_msg.sol_in[88].sensor_type = 34; + + test_msg.sol_in[89].flags = 207; + test_msg.sol_in[89].sensor_type = 156; + + test_msg.sol_in[90].flags = 55; + test_msg.sol_in[90].sensor_type = 63; + + test_msg.sol_in[91].flags = 255; + test_msg.sol_in[91].sensor_type = 117; + + test_msg.sol_in[92].flags = 222; + test_msg.sol_in[92].sensor_type = 222; + + test_msg.sol_in[93].flags = 145; + test_msg.sol_in[93].sensor_type = 219; + + test_msg.sol_in[94].flags = 191; + test_msg.sol_in[94].sensor_type = 224; + + test_msg.sol_in[95].flags = 109; + test_msg.sol_in[95].sensor_type = 210; + + test_msg.sol_in[96].flags = 153; + test_msg.sol_in[96].sensor_type = 86; + + test_msg.sol_in[97].flags = 32; + test_msg.sol_in[97].sensor_type = 21; + + test_msg.sol_in[98].flags = 10; + test_msg.sol_in[98].sensor_type = 226; + + test_msg.sol_in[99].flags = 63; + test_msg.sol_in[99].sensor_type = 60; + + test_msg.sol_in[100].flags = 236; + test_msg.sol_in[100].sensor_type = 106; + + test_msg.sol_in[101].flags = 96; + test_msg.sol_in[101].sensor_type = 93; + + test_msg.sol_in[102].flags = 163; + test_msg.sol_in[102].sensor_type = 30; + + test_msg.sol_in[103].flags = 238; + test_msg.sol_in[103].sensor_type = 106; + + test_msg.sol_in[104].flags = 133; + test_msg.sol_in[104].sensor_type = 147; + + test_msg.sol_in[105].flags = 107; + test_msg.sol_in[105].sensor_type = 132; + + test_msg.sol_in[106].flags = 214; + test_msg.sol_in[106].sensor_type = 152; + + test_msg.sol_in[107].flags = 185; + test_msg.sol_in[107].sensor_type = 221; + + test_msg.sol_in[108].flags = 21; + test_msg.sol_in[108].sensor_type = 202; + + test_msg.sol_in[109].flags = 51; + test_msg.sol_in[109].sensor_type = 252; + + test_msg.sol_in[110].flags = 59; + test_msg.sol_in[110].sensor_type = 130; + + test_msg.sol_in[111].flags = 202; + test_msg.sol_in[111].sensor_type = 166; + + test_msg.sol_in[112].flags = 170; + test_msg.sol_in[112].sensor_type = 127; + + test_msg.sol_in[113].flags = 193; + test_msg.sol_in[113].sensor_type = 58; + + test_msg.sol_in[114].flags = 125; + test_msg.sol_in[114].sensor_type = 215; + + test_msg.sol_in[115].flags = 58; + test_msg.sol_in[115].sensor_type = 22; + + test_msg.sol_in[116].flags = 47; + test_msg.sol_in[116].sensor_type = 135; + + test_msg.sol_in[117].flags = 142; + test_msg.sol_in[117].sensor_type = 88; + test_msg.vdop = 41989; + + EXPECT_EQ(send_message(61780, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61780); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.age_corrections, 48671) + << "incorrect value for last_msg_.age_corrections, expected 48671, is " + << last_msg_.age_corrections; + EXPECT_EQ(last_msg_.alignment_status, 115) + << "incorrect value for last_msg_.alignment_status, expected 115, is " + << last_msg_.alignment_status; + EXPECT_EQ(last_msg_.hdop, 31133) + << "incorrect value for last_msg_.hdop, expected 31133, is " + << last_msg_.hdop; + EXPECT_EQ(last_msg_.last_used_gnss_pos_tow, 610745181) + << "incorrect value for last_msg_.last_used_gnss_pos_tow, expected " + "610745181, is " + << last_msg_.last_used_gnss_pos_tow; + EXPECT_EQ(last_msg_.last_used_gnss_vel_tow, 782016851) + << "incorrect value for last_msg_.last_used_gnss_vel_tow, expected " + "782016851, is " + << last_msg_.last_used_gnss_vel_tow; + EXPECT_EQ(last_msg_.n_sats, 238) + << "incorrect value for last_msg_.n_sats, expected 238, is " + << last_msg_.n_sats; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_sol_in.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_sol_in.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_sol_in.handle_as << "'"; + } + { + const char check_string[] = {(char)115, (char)111, (char)108, + (char)95, (char)105, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_sol_in.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_sol_in.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.n_sol_in.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_sol_in.value, 118) + << "incorrect value for last_msg_.n_sol_in.value, expected 118, is " + << last_msg_.n_sol_in.value; + EXPECT_EQ(last_msg_.pdop, 57015) + << "incorrect value for last_msg_.pdop, expected 57015, is " + << last_msg_.pdop; + EXPECT_EQ(last_msg_.sol_in[0].flags, 67) + << "incorrect value for last_msg_.sol_in[0].flags, expected 67, is " + << last_msg_.sol_in[0].flags; + EXPECT_EQ(last_msg_.sol_in[0].sensor_type, 253) + << "incorrect value for last_msg_.sol_in[0].sensor_type, expected 253, " + "is " + << last_msg_.sol_in[0].sensor_type; + EXPECT_EQ(last_msg_.sol_in[1].flags, 200) + << "incorrect value for last_msg_.sol_in[1].flags, expected 200, is " + << last_msg_.sol_in[1].flags; + EXPECT_EQ(last_msg_.sol_in[1].sensor_type, 87) + << "incorrect value for last_msg_.sol_in[1].sensor_type, expected 87, is " + << last_msg_.sol_in[1].sensor_type; + EXPECT_EQ(last_msg_.sol_in[2].flags, 250) + << "incorrect value for last_msg_.sol_in[2].flags, expected 250, is " + << last_msg_.sol_in[2].flags; + EXPECT_EQ(last_msg_.sol_in[2].sensor_type, 39) + << "incorrect value for last_msg_.sol_in[2].sensor_type, expected 39, is " + << last_msg_.sol_in[2].sensor_type; + EXPECT_EQ(last_msg_.sol_in[3].flags, 242) + << "incorrect value for last_msg_.sol_in[3].flags, expected 242, is " + << last_msg_.sol_in[3].flags; + EXPECT_EQ(last_msg_.sol_in[3].sensor_type, 245) + << "incorrect value for last_msg_.sol_in[3].sensor_type, expected 245, " + "is " + << last_msg_.sol_in[3].sensor_type; + EXPECT_EQ(last_msg_.sol_in[4].flags, 72) + << "incorrect value for last_msg_.sol_in[4].flags, expected 72, is " + << last_msg_.sol_in[4].flags; + EXPECT_EQ(last_msg_.sol_in[4].sensor_type, 228) + << "incorrect value for last_msg_.sol_in[4].sensor_type, expected 228, " + "is " + << last_msg_.sol_in[4].sensor_type; + EXPECT_EQ(last_msg_.sol_in[5].flags, 222) + << "incorrect value for last_msg_.sol_in[5].flags, expected 222, is " + << last_msg_.sol_in[5].flags; + EXPECT_EQ(last_msg_.sol_in[5].sensor_type, 18) + << "incorrect value for last_msg_.sol_in[5].sensor_type, expected 18, is " + << last_msg_.sol_in[5].sensor_type; + EXPECT_EQ(last_msg_.sol_in[6].flags, 88) + << "incorrect value for last_msg_.sol_in[6].flags, expected 88, is " + << last_msg_.sol_in[6].flags; + EXPECT_EQ(last_msg_.sol_in[6].sensor_type, 11) + << "incorrect value for last_msg_.sol_in[6].sensor_type, expected 11, is " + << last_msg_.sol_in[6].sensor_type; + EXPECT_EQ(last_msg_.sol_in[7].flags, 218) + << "incorrect value for last_msg_.sol_in[7].flags, expected 218, is " + << last_msg_.sol_in[7].flags; + EXPECT_EQ(last_msg_.sol_in[7].sensor_type, 207) + << "incorrect value for last_msg_.sol_in[7].sensor_type, expected 207, " + "is " + << last_msg_.sol_in[7].sensor_type; + EXPECT_EQ(last_msg_.sol_in[8].flags, 13) + << "incorrect value for last_msg_.sol_in[8].flags, expected 13, is " + << last_msg_.sol_in[8].flags; + EXPECT_EQ(last_msg_.sol_in[8].sensor_type, 231) + << "incorrect value for last_msg_.sol_in[8].sensor_type, expected 231, " + "is " + << last_msg_.sol_in[8].sensor_type; + EXPECT_EQ(last_msg_.sol_in[9].flags, 224) + << "incorrect value for last_msg_.sol_in[9].flags, expected 224, is " + << last_msg_.sol_in[9].flags; + EXPECT_EQ(last_msg_.sol_in[9].sensor_type, 226) + << "incorrect value for last_msg_.sol_in[9].sensor_type, expected 226, " + "is " + << last_msg_.sol_in[9].sensor_type; + EXPECT_EQ(last_msg_.sol_in[10].flags, 196) + << "incorrect value for last_msg_.sol_in[10].flags, expected 196, is " + << last_msg_.sol_in[10].flags; + EXPECT_EQ(last_msg_.sol_in[10].sensor_type, 22) + << "incorrect value for last_msg_.sol_in[10].sensor_type, expected 22, " + "is " + << last_msg_.sol_in[10].sensor_type; + EXPECT_EQ(last_msg_.sol_in[11].flags, 242) + << "incorrect value for last_msg_.sol_in[11].flags, expected 242, is " + << last_msg_.sol_in[11].flags; + EXPECT_EQ(last_msg_.sol_in[11].sensor_type, 21) + << "incorrect value for last_msg_.sol_in[11].sensor_type, expected 21, " + "is " + << last_msg_.sol_in[11].sensor_type; + EXPECT_EQ(last_msg_.sol_in[12].flags, 89) + << "incorrect value for last_msg_.sol_in[12].flags, expected 89, is " + << last_msg_.sol_in[12].flags; + EXPECT_EQ(last_msg_.sol_in[12].sensor_type, 12) + << "incorrect value for last_msg_.sol_in[12].sensor_type, expected 12, " + "is " + << last_msg_.sol_in[12].sensor_type; + EXPECT_EQ(last_msg_.sol_in[13].flags, 219) + << "incorrect value for last_msg_.sol_in[13].flags, expected 219, is " + << last_msg_.sol_in[13].flags; + EXPECT_EQ(last_msg_.sol_in[13].sensor_type, 71) + << "incorrect value for last_msg_.sol_in[13].sensor_type, expected 71, " + "is " + << last_msg_.sol_in[13].sensor_type; + EXPECT_EQ(last_msg_.sol_in[14].flags, 85) + << "incorrect value for last_msg_.sol_in[14].flags, expected 85, is " + << last_msg_.sol_in[14].flags; + EXPECT_EQ(last_msg_.sol_in[14].sensor_type, 182) + << "incorrect value for last_msg_.sol_in[14].sensor_type, expected 182, " + "is " + << last_msg_.sol_in[14].sensor_type; + EXPECT_EQ(last_msg_.sol_in[15].flags, 204) + << "incorrect value for last_msg_.sol_in[15].flags, expected 204, is " + << last_msg_.sol_in[15].flags; + EXPECT_EQ(last_msg_.sol_in[15].sensor_type, 145) + << "incorrect value for last_msg_.sol_in[15].sensor_type, expected 145, " + "is " + << last_msg_.sol_in[15].sensor_type; + EXPECT_EQ(last_msg_.sol_in[16].flags, 40) + << "incorrect value for last_msg_.sol_in[16].flags, expected 40, is " + << last_msg_.sol_in[16].flags; + EXPECT_EQ(last_msg_.sol_in[16].sensor_type, 146) + << "incorrect value for last_msg_.sol_in[16].sensor_type, expected 146, " + "is " + << last_msg_.sol_in[16].sensor_type; + EXPECT_EQ(last_msg_.sol_in[17].flags, 51) + << "incorrect value for last_msg_.sol_in[17].flags, expected 51, is " + << last_msg_.sol_in[17].flags; + EXPECT_EQ(last_msg_.sol_in[17].sensor_type, 204) + << "incorrect value for last_msg_.sol_in[17].sensor_type, expected 204, " + "is " + << last_msg_.sol_in[17].sensor_type; + EXPECT_EQ(last_msg_.sol_in[18].flags, 153) + << "incorrect value for last_msg_.sol_in[18].flags, expected 153, is " + << last_msg_.sol_in[18].flags; + EXPECT_EQ(last_msg_.sol_in[18].sensor_type, 21) + << "incorrect value for last_msg_.sol_in[18].sensor_type, expected 21, " + "is " + << last_msg_.sol_in[18].sensor_type; + EXPECT_EQ(last_msg_.sol_in[19].flags, 44) + << "incorrect value for last_msg_.sol_in[19].flags, expected 44, is " + << last_msg_.sol_in[19].flags; + EXPECT_EQ(last_msg_.sol_in[19].sensor_type, 227) + << "incorrect value for last_msg_.sol_in[19].sensor_type, expected 227, " + "is " + << last_msg_.sol_in[19].sensor_type; + EXPECT_EQ(last_msg_.sol_in[20].flags, 28) + << "incorrect value for last_msg_.sol_in[20].flags, expected 28, is " + << last_msg_.sol_in[20].flags; + EXPECT_EQ(last_msg_.sol_in[20].sensor_type, 15) + << "incorrect value for last_msg_.sol_in[20].sensor_type, expected 15, " + "is " + << last_msg_.sol_in[20].sensor_type; + EXPECT_EQ(last_msg_.sol_in[21].flags, 39) + << "incorrect value for last_msg_.sol_in[21].flags, expected 39, is " + << last_msg_.sol_in[21].flags; + EXPECT_EQ(last_msg_.sol_in[21].sensor_type, 255) + << "incorrect value for last_msg_.sol_in[21].sensor_type, expected 255, " + "is " + << last_msg_.sol_in[21].sensor_type; + EXPECT_EQ(last_msg_.sol_in[22].flags, 216) + << "incorrect value for last_msg_.sol_in[22].flags, expected 216, is " + << last_msg_.sol_in[22].flags; + EXPECT_EQ(last_msg_.sol_in[22].sensor_type, 205) + << "incorrect value for last_msg_.sol_in[22].sensor_type, expected 205, " + "is " + << last_msg_.sol_in[22].sensor_type; + EXPECT_EQ(last_msg_.sol_in[23].flags, 190) + << "incorrect value for last_msg_.sol_in[23].flags, expected 190, is " + << last_msg_.sol_in[23].flags; + EXPECT_EQ(last_msg_.sol_in[23].sensor_type, 240) + << "incorrect value for last_msg_.sol_in[23].sensor_type, expected 240, " + "is " + << last_msg_.sol_in[23].sensor_type; + EXPECT_EQ(last_msg_.sol_in[24].flags, 219) + << "incorrect value for last_msg_.sol_in[24].flags, expected 219, is " + << last_msg_.sol_in[24].flags; + EXPECT_EQ(last_msg_.sol_in[24].sensor_type, 93) + << "incorrect value for last_msg_.sol_in[24].sensor_type, expected 93, " + "is " + << last_msg_.sol_in[24].sensor_type; + EXPECT_EQ(last_msg_.sol_in[25].flags, 42) + << "incorrect value for last_msg_.sol_in[25].flags, expected 42, is " + << last_msg_.sol_in[25].flags; + EXPECT_EQ(last_msg_.sol_in[25].sensor_type, 103) + << "incorrect value for last_msg_.sol_in[25].sensor_type, expected 103, " + "is " + << last_msg_.sol_in[25].sensor_type; + EXPECT_EQ(last_msg_.sol_in[26].flags, 182) + << "incorrect value for last_msg_.sol_in[26].flags, expected 182, is " + << last_msg_.sol_in[26].flags; + EXPECT_EQ(last_msg_.sol_in[26].sensor_type, 41) + << "incorrect value for last_msg_.sol_in[26].sensor_type, expected 41, " + "is " + << last_msg_.sol_in[26].sensor_type; + EXPECT_EQ(last_msg_.sol_in[27].flags, 222) + << "incorrect value for last_msg_.sol_in[27].flags, expected 222, is " + << last_msg_.sol_in[27].flags; + EXPECT_EQ(last_msg_.sol_in[27].sensor_type, 76) + << "incorrect value for last_msg_.sol_in[27].sensor_type, expected 76, " + "is " + << last_msg_.sol_in[27].sensor_type; + EXPECT_EQ(last_msg_.sol_in[28].flags, 23) + << "incorrect value for last_msg_.sol_in[28].flags, expected 23, is " + << last_msg_.sol_in[28].flags; + EXPECT_EQ(last_msg_.sol_in[28].sensor_type, 17) + << "incorrect value for last_msg_.sol_in[28].sensor_type, expected 17, " + "is " + << last_msg_.sol_in[28].sensor_type; + EXPECT_EQ(last_msg_.sol_in[29].flags, 31) + << "incorrect value for last_msg_.sol_in[29].flags, expected 31, is " + << last_msg_.sol_in[29].flags; + EXPECT_EQ(last_msg_.sol_in[29].sensor_type, 125) + << "incorrect value for last_msg_.sol_in[29].sensor_type, expected 125, " + "is " + << last_msg_.sol_in[29].sensor_type; + EXPECT_EQ(last_msg_.sol_in[30].flags, 229) + << "incorrect value for last_msg_.sol_in[30].flags, expected 229, is " + << last_msg_.sol_in[30].flags; + EXPECT_EQ(last_msg_.sol_in[30].sensor_type, 18) + << "incorrect value for last_msg_.sol_in[30].sensor_type, expected 18, " + "is " + << last_msg_.sol_in[30].sensor_type; + EXPECT_EQ(last_msg_.sol_in[31].flags, 47) + << "incorrect value for last_msg_.sol_in[31].flags, expected 47, is " + << last_msg_.sol_in[31].flags; + EXPECT_EQ(last_msg_.sol_in[31].sensor_type, 28) + << "incorrect value for last_msg_.sol_in[31].sensor_type, expected 28, " + "is " + << last_msg_.sol_in[31].sensor_type; + EXPECT_EQ(last_msg_.sol_in[32].flags, 25) + << "incorrect value for last_msg_.sol_in[32].flags, expected 25, is " + << last_msg_.sol_in[32].flags; + EXPECT_EQ(last_msg_.sol_in[32].sensor_type, 214) + << "incorrect value for last_msg_.sol_in[32].sensor_type, expected 214, " + "is " + << last_msg_.sol_in[32].sensor_type; + EXPECT_EQ(last_msg_.sol_in[33].flags, 84) + << "incorrect value for last_msg_.sol_in[33].flags, expected 84, is " + << last_msg_.sol_in[33].flags; + EXPECT_EQ(last_msg_.sol_in[33].sensor_type, 100) + << "incorrect value for last_msg_.sol_in[33].sensor_type, expected 100, " + "is " + << last_msg_.sol_in[33].sensor_type; + EXPECT_EQ(last_msg_.sol_in[34].flags, 72) + << "incorrect value for last_msg_.sol_in[34].flags, expected 72, is " + << last_msg_.sol_in[34].flags; + EXPECT_EQ(last_msg_.sol_in[34].sensor_type, 106) + << "incorrect value for last_msg_.sol_in[34].sensor_type, expected 106, " + "is " + << last_msg_.sol_in[34].sensor_type; + EXPECT_EQ(last_msg_.sol_in[35].flags, 10) + << "incorrect value for last_msg_.sol_in[35].flags, expected 10, is " + << last_msg_.sol_in[35].flags; + EXPECT_EQ(last_msg_.sol_in[35].sensor_type, 48) + << "incorrect value for last_msg_.sol_in[35].sensor_type, expected 48, " + "is " + << last_msg_.sol_in[35].sensor_type; + EXPECT_EQ(last_msg_.sol_in[36].flags, 232) + << "incorrect value for last_msg_.sol_in[36].flags, expected 232, is " + << last_msg_.sol_in[36].flags; + EXPECT_EQ(last_msg_.sol_in[36].sensor_type, 222) + << "incorrect value for last_msg_.sol_in[36].sensor_type, expected 222, " + "is " + << last_msg_.sol_in[36].sensor_type; + EXPECT_EQ(last_msg_.sol_in[37].flags, 73) + << "incorrect value for last_msg_.sol_in[37].flags, expected 73, is " + << last_msg_.sol_in[37].flags; + EXPECT_EQ(last_msg_.sol_in[37].sensor_type, 235) + << "incorrect value for last_msg_.sol_in[37].sensor_type, expected 235, " + "is " + << last_msg_.sol_in[37].sensor_type; + EXPECT_EQ(last_msg_.sol_in[38].flags, 163) + << "incorrect value for last_msg_.sol_in[38].flags, expected 163, is " + << last_msg_.sol_in[38].flags; + EXPECT_EQ(last_msg_.sol_in[38].sensor_type, 109) + << "incorrect value for last_msg_.sol_in[38].sensor_type, expected 109, " + "is " + << last_msg_.sol_in[38].sensor_type; + EXPECT_EQ(last_msg_.sol_in[39].flags, 152) + << "incorrect value for last_msg_.sol_in[39].flags, expected 152, is " + << last_msg_.sol_in[39].flags; + EXPECT_EQ(last_msg_.sol_in[39].sensor_type, 51) + << "incorrect value for last_msg_.sol_in[39].sensor_type, expected 51, " + "is " + << last_msg_.sol_in[39].sensor_type; + EXPECT_EQ(last_msg_.sol_in[40].flags, 235) + << "incorrect value for last_msg_.sol_in[40].flags, expected 235, is " + << last_msg_.sol_in[40].flags; + EXPECT_EQ(last_msg_.sol_in[40].sensor_type, 133) + << "incorrect value for last_msg_.sol_in[40].sensor_type, expected 133, " + "is " + << last_msg_.sol_in[40].sensor_type; + EXPECT_EQ(last_msg_.sol_in[41].flags, 70) + << "incorrect value for last_msg_.sol_in[41].flags, expected 70, is " + << last_msg_.sol_in[41].flags; + EXPECT_EQ(last_msg_.sol_in[41].sensor_type, 87) + << "incorrect value for last_msg_.sol_in[41].sensor_type, expected 87, " + "is " + << last_msg_.sol_in[41].sensor_type; + EXPECT_EQ(last_msg_.sol_in[42].flags, 108) + << "incorrect value for last_msg_.sol_in[42].flags, expected 108, is " + << last_msg_.sol_in[42].flags; + EXPECT_EQ(last_msg_.sol_in[42].sensor_type, 2) + << "incorrect value for last_msg_.sol_in[42].sensor_type, expected 2, is " + << last_msg_.sol_in[42].sensor_type; + EXPECT_EQ(last_msg_.sol_in[43].flags, 101) + << "incorrect value for last_msg_.sol_in[43].flags, expected 101, is " + << last_msg_.sol_in[43].flags; + EXPECT_EQ(last_msg_.sol_in[43].sensor_type, 91) + << "incorrect value for last_msg_.sol_in[43].sensor_type, expected 91, " + "is " + << last_msg_.sol_in[43].sensor_type; + EXPECT_EQ(last_msg_.sol_in[44].flags, 55) + << "incorrect value for last_msg_.sol_in[44].flags, expected 55, is " + << last_msg_.sol_in[44].flags; + EXPECT_EQ(last_msg_.sol_in[44].sensor_type, 200) + << "incorrect value for last_msg_.sol_in[44].sensor_type, expected 200, " + "is " + << last_msg_.sol_in[44].sensor_type; + EXPECT_EQ(last_msg_.sol_in[45].flags, 156) + << "incorrect value for last_msg_.sol_in[45].flags, expected 156, is " + << last_msg_.sol_in[45].flags; + EXPECT_EQ(last_msg_.sol_in[45].sensor_type, 24) + << "incorrect value for last_msg_.sol_in[45].sensor_type, expected 24, " + "is " + << last_msg_.sol_in[45].sensor_type; + EXPECT_EQ(last_msg_.sol_in[46].flags, 73) + << "incorrect value for last_msg_.sol_in[46].flags, expected 73, is " + << last_msg_.sol_in[46].flags; + EXPECT_EQ(last_msg_.sol_in[46].sensor_type, 233) + << "incorrect value for last_msg_.sol_in[46].sensor_type, expected 233, " + "is " + << last_msg_.sol_in[46].sensor_type; + EXPECT_EQ(last_msg_.sol_in[47].flags, 66) + << "incorrect value for last_msg_.sol_in[47].flags, expected 66, is " + << last_msg_.sol_in[47].flags; + EXPECT_EQ(last_msg_.sol_in[47].sensor_type, 39) + << "incorrect value for last_msg_.sol_in[47].sensor_type, expected 39, " + "is " + << last_msg_.sol_in[47].sensor_type; + EXPECT_EQ(last_msg_.sol_in[48].flags, 140) + << "incorrect value for last_msg_.sol_in[48].flags, expected 140, is " + << last_msg_.sol_in[48].flags; + EXPECT_EQ(last_msg_.sol_in[48].sensor_type, 97) + << "incorrect value for last_msg_.sol_in[48].sensor_type, expected 97, " + "is " + << last_msg_.sol_in[48].sensor_type; + EXPECT_EQ(last_msg_.sol_in[49].flags, 227) + << "incorrect value for last_msg_.sol_in[49].flags, expected 227, is " + << last_msg_.sol_in[49].flags; + EXPECT_EQ(last_msg_.sol_in[49].sensor_type, 252) + << "incorrect value for last_msg_.sol_in[49].sensor_type, expected 252, " + "is " + << last_msg_.sol_in[49].sensor_type; + EXPECT_EQ(last_msg_.sol_in[50].flags, 237) + << "incorrect value for last_msg_.sol_in[50].flags, expected 237, is " + << last_msg_.sol_in[50].flags; + EXPECT_EQ(last_msg_.sol_in[50].sensor_type, 230) + << "incorrect value for last_msg_.sol_in[50].sensor_type, expected 230, " + "is " + << last_msg_.sol_in[50].sensor_type; + EXPECT_EQ(last_msg_.sol_in[51].flags, 241) + << "incorrect value for last_msg_.sol_in[51].flags, expected 241, is " + << last_msg_.sol_in[51].flags; + EXPECT_EQ(last_msg_.sol_in[51].sensor_type, 135) + << "incorrect value for last_msg_.sol_in[51].sensor_type, expected 135, " + "is " + << last_msg_.sol_in[51].sensor_type; + EXPECT_EQ(last_msg_.sol_in[52].flags, 205) + << "incorrect value for last_msg_.sol_in[52].flags, expected 205, is " + << last_msg_.sol_in[52].flags; + EXPECT_EQ(last_msg_.sol_in[52].sensor_type, 245) + << "incorrect value for last_msg_.sol_in[52].sensor_type, expected 245, " + "is " + << last_msg_.sol_in[52].sensor_type; + EXPECT_EQ(last_msg_.sol_in[53].flags, 0) + << "incorrect value for last_msg_.sol_in[53].flags, expected 0, is " + << last_msg_.sol_in[53].flags; + EXPECT_EQ(last_msg_.sol_in[53].sensor_type, 70) + << "incorrect value for last_msg_.sol_in[53].sensor_type, expected 70, " + "is " + << last_msg_.sol_in[53].sensor_type; + EXPECT_EQ(last_msg_.sol_in[54].flags, 188) + << "incorrect value for last_msg_.sol_in[54].flags, expected 188, is " + << last_msg_.sol_in[54].flags; + EXPECT_EQ(last_msg_.sol_in[54].sensor_type, 219) + << "incorrect value for last_msg_.sol_in[54].sensor_type, expected 219, " + "is " + << last_msg_.sol_in[54].sensor_type; + EXPECT_EQ(last_msg_.sol_in[55].flags, 136) + << "incorrect value for last_msg_.sol_in[55].flags, expected 136, is " + << last_msg_.sol_in[55].flags; + EXPECT_EQ(last_msg_.sol_in[55].sensor_type, 107) + << "incorrect value for last_msg_.sol_in[55].sensor_type, expected 107, " + "is " + << last_msg_.sol_in[55].sensor_type; + EXPECT_EQ(last_msg_.sol_in[56].flags, 58) + << "incorrect value for last_msg_.sol_in[56].flags, expected 58, is " + << last_msg_.sol_in[56].flags; + EXPECT_EQ(last_msg_.sol_in[56].sensor_type, 178) + << "incorrect value for last_msg_.sol_in[56].sensor_type, expected 178, " + "is " + << last_msg_.sol_in[56].sensor_type; + EXPECT_EQ(last_msg_.sol_in[57].flags, 29) + << "incorrect value for last_msg_.sol_in[57].flags, expected 29, is " + << last_msg_.sol_in[57].flags; + EXPECT_EQ(last_msg_.sol_in[57].sensor_type, 1) + << "incorrect value for last_msg_.sol_in[57].sensor_type, expected 1, is " + << last_msg_.sol_in[57].sensor_type; + EXPECT_EQ(last_msg_.sol_in[58].flags, 213) + << "incorrect value for last_msg_.sol_in[58].flags, expected 213, is " + << last_msg_.sol_in[58].flags; + EXPECT_EQ(last_msg_.sol_in[58].sensor_type, 44) + << "incorrect value for last_msg_.sol_in[58].sensor_type, expected 44, " + "is " + << last_msg_.sol_in[58].sensor_type; + EXPECT_EQ(last_msg_.sol_in[59].flags, 147) + << "incorrect value for last_msg_.sol_in[59].flags, expected 147, is " + << last_msg_.sol_in[59].flags; + EXPECT_EQ(last_msg_.sol_in[59].sensor_type, 225) + << "incorrect value for last_msg_.sol_in[59].sensor_type, expected 225, " + "is " + << last_msg_.sol_in[59].sensor_type; + EXPECT_EQ(last_msg_.sol_in[60].flags, 96) + << "incorrect value for last_msg_.sol_in[60].flags, expected 96, is " + << last_msg_.sol_in[60].flags; + EXPECT_EQ(last_msg_.sol_in[60].sensor_type, 190) + << "incorrect value for last_msg_.sol_in[60].sensor_type, expected 190, " + "is " + << last_msg_.sol_in[60].sensor_type; + EXPECT_EQ(last_msg_.sol_in[61].flags, 108) + << "incorrect value for last_msg_.sol_in[61].flags, expected 108, is " + << last_msg_.sol_in[61].flags; + EXPECT_EQ(last_msg_.sol_in[61].sensor_type, 192) + << "incorrect value for last_msg_.sol_in[61].sensor_type, expected 192, " + "is " + << last_msg_.sol_in[61].sensor_type; + EXPECT_EQ(last_msg_.sol_in[62].flags, 15) + << "incorrect value for last_msg_.sol_in[62].flags, expected 15, is " + << last_msg_.sol_in[62].flags; + EXPECT_EQ(last_msg_.sol_in[62].sensor_type, 228) + << "incorrect value for last_msg_.sol_in[62].sensor_type, expected 228, " + "is " + << last_msg_.sol_in[62].sensor_type; + EXPECT_EQ(last_msg_.sol_in[63].flags, 18) + << "incorrect value for last_msg_.sol_in[63].flags, expected 18, is " + << last_msg_.sol_in[63].flags; + EXPECT_EQ(last_msg_.sol_in[63].sensor_type, 203) + << "incorrect value for last_msg_.sol_in[63].sensor_type, expected 203, " + "is " + << last_msg_.sol_in[63].sensor_type; + EXPECT_EQ(last_msg_.sol_in[64].flags, 222) + << "incorrect value for last_msg_.sol_in[64].flags, expected 222, is " + << last_msg_.sol_in[64].flags; + EXPECT_EQ(last_msg_.sol_in[64].sensor_type, 3) + << "incorrect value for last_msg_.sol_in[64].sensor_type, expected 3, is " + << last_msg_.sol_in[64].sensor_type; + EXPECT_EQ(last_msg_.sol_in[65].flags, 68) + << "incorrect value for last_msg_.sol_in[65].flags, expected 68, is " + << last_msg_.sol_in[65].flags; + EXPECT_EQ(last_msg_.sol_in[65].sensor_type, 180) + << "incorrect value for last_msg_.sol_in[65].sensor_type, expected 180, " + "is " + << last_msg_.sol_in[65].sensor_type; + EXPECT_EQ(last_msg_.sol_in[66].flags, 229) + << "incorrect value for last_msg_.sol_in[66].flags, expected 229, is " + << last_msg_.sol_in[66].flags; + EXPECT_EQ(last_msg_.sol_in[66].sensor_type, 101) + << "incorrect value for last_msg_.sol_in[66].sensor_type, expected 101, " + "is " + << last_msg_.sol_in[66].sensor_type; + EXPECT_EQ(last_msg_.sol_in[67].flags, 203) + << "incorrect value for last_msg_.sol_in[67].flags, expected 203, is " + << last_msg_.sol_in[67].flags; + EXPECT_EQ(last_msg_.sol_in[67].sensor_type, 223) + << "incorrect value for last_msg_.sol_in[67].sensor_type, expected 223, " + "is " + << last_msg_.sol_in[67].sensor_type; + EXPECT_EQ(last_msg_.sol_in[68].flags, 164) + << "incorrect value for last_msg_.sol_in[68].flags, expected 164, is " + << last_msg_.sol_in[68].flags; + EXPECT_EQ(last_msg_.sol_in[68].sensor_type, 243) + << "incorrect value for last_msg_.sol_in[68].sensor_type, expected 243, " + "is " + << last_msg_.sol_in[68].sensor_type; + EXPECT_EQ(last_msg_.sol_in[69].flags, 165) + << "incorrect value for last_msg_.sol_in[69].flags, expected 165, is " + << last_msg_.sol_in[69].flags; + EXPECT_EQ(last_msg_.sol_in[69].sensor_type, 92) + << "incorrect value for last_msg_.sol_in[69].sensor_type, expected 92, " + "is " + << last_msg_.sol_in[69].sensor_type; + EXPECT_EQ(last_msg_.sol_in[70].flags, 159) + << "incorrect value for last_msg_.sol_in[70].flags, expected 159, is " + << last_msg_.sol_in[70].flags; + EXPECT_EQ(last_msg_.sol_in[70].sensor_type, 220) + << "incorrect value for last_msg_.sol_in[70].sensor_type, expected 220, " + "is " + << last_msg_.sol_in[70].sensor_type; + EXPECT_EQ(last_msg_.sol_in[71].flags, 121) + << "incorrect value for last_msg_.sol_in[71].flags, expected 121, is " + << last_msg_.sol_in[71].flags; + EXPECT_EQ(last_msg_.sol_in[71].sensor_type, 174) + << "incorrect value for last_msg_.sol_in[71].sensor_type, expected 174, " + "is " + << last_msg_.sol_in[71].sensor_type; + EXPECT_EQ(last_msg_.sol_in[72].flags, 167) + << "incorrect value for last_msg_.sol_in[72].flags, expected 167, is " + << last_msg_.sol_in[72].flags; + EXPECT_EQ(last_msg_.sol_in[72].sensor_type, 112) + << "incorrect value for last_msg_.sol_in[72].sensor_type, expected 112, " + "is " + << last_msg_.sol_in[72].sensor_type; + EXPECT_EQ(last_msg_.sol_in[73].flags, 40) + << "incorrect value for last_msg_.sol_in[73].flags, expected 40, is " + << last_msg_.sol_in[73].flags; + EXPECT_EQ(last_msg_.sol_in[73].sensor_type, 240) + << "incorrect value for last_msg_.sol_in[73].sensor_type, expected 240, " + "is " + << last_msg_.sol_in[73].sensor_type; + EXPECT_EQ(last_msg_.sol_in[74].flags, 3) + << "incorrect value for last_msg_.sol_in[74].flags, expected 3, is " + << last_msg_.sol_in[74].flags; + EXPECT_EQ(last_msg_.sol_in[74].sensor_type, 59) + << "incorrect value for last_msg_.sol_in[74].sensor_type, expected 59, " + "is " + << last_msg_.sol_in[74].sensor_type; + EXPECT_EQ(last_msg_.sol_in[75].flags, 52) + << "incorrect value for last_msg_.sol_in[75].flags, expected 52, is " + << last_msg_.sol_in[75].flags; + EXPECT_EQ(last_msg_.sol_in[75].sensor_type, 230) + << "incorrect value for last_msg_.sol_in[75].sensor_type, expected 230, " + "is " + << last_msg_.sol_in[75].sensor_type; + EXPECT_EQ(last_msg_.sol_in[76].flags, 148) + << "incorrect value for last_msg_.sol_in[76].flags, expected 148, is " + << last_msg_.sol_in[76].flags; + EXPECT_EQ(last_msg_.sol_in[76].sensor_type, 149) + << "incorrect value for last_msg_.sol_in[76].sensor_type, expected 149, " + "is " + << last_msg_.sol_in[76].sensor_type; + EXPECT_EQ(last_msg_.sol_in[77].flags, 142) + << "incorrect value for last_msg_.sol_in[77].flags, expected 142, is " + << last_msg_.sol_in[77].flags; + EXPECT_EQ(last_msg_.sol_in[77].sensor_type, 218) + << "incorrect value for last_msg_.sol_in[77].sensor_type, expected 218, " + "is " + << last_msg_.sol_in[77].sensor_type; + EXPECT_EQ(last_msg_.sol_in[78].flags, 109) + << "incorrect value for last_msg_.sol_in[78].flags, expected 109, is " + << last_msg_.sol_in[78].flags; + EXPECT_EQ(last_msg_.sol_in[78].sensor_type, 212) + << "incorrect value for last_msg_.sol_in[78].sensor_type, expected 212, " + "is " + << last_msg_.sol_in[78].sensor_type; + EXPECT_EQ(last_msg_.sol_in[79].flags, 71) + << "incorrect value for last_msg_.sol_in[79].flags, expected 71, is " + << last_msg_.sol_in[79].flags; + EXPECT_EQ(last_msg_.sol_in[79].sensor_type, 176) + << "incorrect value for last_msg_.sol_in[79].sensor_type, expected 176, " + "is " + << last_msg_.sol_in[79].sensor_type; + EXPECT_EQ(last_msg_.sol_in[80].flags, 172) + << "incorrect value for last_msg_.sol_in[80].flags, expected 172, is " + << last_msg_.sol_in[80].flags; + EXPECT_EQ(last_msg_.sol_in[80].sensor_type, 179) + << "incorrect value for last_msg_.sol_in[80].sensor_type, expected 179, " + "is " + << last_msg_.sol_in[80].sensor_type; + EXPECT_EQ(last_msg_.sol_in[81].flags, 1) + << "incorrect value for last_msg_.sol_in[81].flags, expected 1, is " + << last_msg_.sol_in[81].flags; + EXPECT_EQ(last_msg_.sol_in[81].sensor_type, 77) + << "incorrect value for last_msg_.sol_in[81].sensor_type, expected 77, " + "is " + << last_msg_.sol_in[81].sensor_type; + EXPECT_EQ(last_msg_.sol_in[82].flags, 70) + << "incorrect value for last_msg_.sol_in[82].flags, expected 70, is " + << last_msg_.sol_in[82].flags; + EXPECT_EQ(last_msg_.sol_in[82].sensor_type, 193) + << "incorrect value for last_msg_.sol_in[82].sensor_type, expected 193, " + "is " + << last_msg_.sol_in[82].sensor_type; + EXPECT_EQ(last_msg_.sol_in[83].flags, 149) + << "incorrect value for last_msg_.sol_in[83].flags, expected 149, is " + << last_msg_.sol_in[83].flags; + EXPECT_EQ(last_msg_.sol_in[83].sensor_type, 147) + << "incorrect value for last_msg_.sol_in[83].sensor_type, expected 147, " + "is " + << last_msg_.sol_in[83].sensor_type; + EXPECT_EQ(last_msg_.sol_in[84].flags, 144) + << "incorrect value for last_msg_.sol_in[84].flags, expected 144, is " + << last_msg_.sol_in[84].flags; + EXPECT_EQ(last_msg_.sol_in[84].sensor_type, 23) + << "incorrect value for last_msg_.sol_in[84].sensor_type, expected 23, " + "is " + << last_msg_.sol_in[84].sensor_type; + EXPECT_EQ(last_msg_.sol_in[85].flags, 239) + << "incorrect value for last_msg_.sol_in[85].flags, expected 239, is " + << last_msg_.sol_in[85].flags; + EXPECT_EQ(last_msg_.sol_in[85].sensor_type, 148) + << "incorrect value for last_msg_.sol_in[85].sensor_type, expected 148, " + "is " + << last_msg_.sol_in[85].sensor_type; + EXPECT_EQ(last_msg_.sol_in[86].flags, 186) + << "incorrect value for last_msg_.sol_in[86].flags, expected 186, is " + << last_msg_.sol_in[86].flags; + EXPECT_EQ(last_msg_.sol_in[86].sensor_type, 195) + << "incorrect value for last_msg_.sol_in[86].sensor_type, expected 195, " + "is " + << last_msg_.sol_in[86].sensor_type; + EXPECT_EQ(last_msg_.sol_in[87].flags, 30) + << "incorrect value for last_msg_.sol_in[87].flags, expected 30, is " + << last_msg_.sol_in[87].flags; + EXPECT_EQ(last_msg_.sol_in[87].sensor_type, 86) + << "incorrect value for last_msg_.sol_in[87].sensor_type, expected 86, " + "is " + << last_msg_.sol_in[87].sensor_type; + EXPECT_EQ(last_msg_.sol_in[88].flags, 143) + << "incorrect value for last_msg_.sol_in[88].flags, expected 143, is " + << last_msg_.sol_in[88].flags; + EXPECT_EQ(last_msg_.sol_in[88].sensor_type, 34) + << "incorrect value for last_msg_.sol_in[88].sensor_type, expected 34, " + "is " + << last_msg_.sol_in[88].sensor_type; + EXPECT_EQ(last_msg_.sol_in[89].flags, 207) + << "incorrect value for last_msg_.sol_in[89].flags, expected 207, is " + << last_msg_.sol_in[89].flags; + EXPECT_EQ(last_msg_.sol_in[89].sensor_type, 156) + << "incorrect value for last_msg_.sol_in[89].sensor_type, expected 156, " + "is " + << last_msg_.sol_in[89].sensor_type; + EXPECT_EQ(last_msg_.sol_in[90].flags, 55) + << "incorrect value for last_msg_.sol_in[90].flags, expected 55, is " + << last_msg_.sol_in[90].flags; + EXPECT_EQ(last_msg_.sol_in[90].sensor_type, 63) + << "incorrect value for last_msg_.sol_in[90].sensor_type, expected 63, " + "is " + << last_msg_.sol_in[90].sensor_type; + EXPECT_EQ(last_msg_.sol_in[91].flags, 255) + << "incorrect value for last_msg_.sol_in[91].flags, expected 255, is " + << last_msg_.sol_in[91].flags; + EXPECT_EQ(last_msg_.sol_in[91].sensor_type, 117) + << "incorrect value for last_msg_.sol_in[91].sensor_type, expected 117, " + "is " + << last_msg_.sol_in[91].sensor_type; + EXPECT_EQ(last_msg_.sol_in[92].flags, 222) + << "incorrect value for last_msg_.sol_in[92].flags, expected 222, is " + << last_msg_.sol_in[92].flags; + EXPECT_EQ(last_msg_.sol_in[92].sensor_type, 222) + << "incorrect value for last_msg_.sol_in[92].sensor_type, expected 222, " + "is " + << last_msg_.sol_in[92].sensor_type; + EXPECT_EQ(last_msg_.sol_in[93].flags, 145) + << "incorrect value for last_msg_.sol_in[93].flags, expected 145, is " + << last_msg_.sol_in[93].flags; + EXPECT_EQ(last_msg_.sol_in[93].sensor_type, 219) + << "incorrect value for last_msg_.sol_in[93].sensor_type, expected 219, " + "is " + << last_msg_.sol_in[93].sensor_type; + EXPECT_EQ(last_msg_.sol_in[94].flags, 191) + << "incorrect value for last_msg_.sol_in[94].flags, expected 191, is " + << last_msg_.sol_in[94].flags; + EXPECT_EQ(last_msg_.sol_in[94].sensor_type, 224) + << "incorrect value for last_msg_.sol_in[94].sensor_type, expected 224, " + "is " + << last_msg_.sol_in[94].sensor_type; + EXPECT_EQ(last_msg_.sol_in[95].flags, 109) + << "incorrect value for last_msg_.sol_in[95].flags, expected 109, is " + << last_msg_.sol_in[95].flags; + EXPECT_EQ(last_msg_.sol_in[95].sensor_type, 210) + << "incorrect value for last_msg_.sol_in[95].sensor_type, expected 210, " + "is " + << last_msg_.sol_in[95].sensor_type; + EXPECT_EQ(last_msg_.sol_in[96].flags, 153) + << "incorrect value for last_msg_.sol_in[96].flags, expected 153, is " + << last_msg_.sol_in[96].flags; + EXPECT_EQ(last_msg_.sol_in[96].sensor_type, 86) + << "incorrect value for last_msg_.sol_in[96].sensor_type, expected 86, " + "is " + << last_msg_.sol_in[96].sensor_type; + EXPECT_EQ(last_msg_.sol_in[97].flags, 32) + << "incorrect value for last_msg_.sol_in[97].flags, expected 32, is " + << last_msg_.sol_in[97].flags; + EXPECT_EQ(last_msg_.sol_in[97].sensor_type, 21) + << "incorrect value for last_msg_.sol_in[97].sensor_type, expected 21, " + "is " + << last_msg_.sol_in[97].sensor_type; + EXPECT_EQ(last_msg_.sol_in[98].flags, 10) + << "incorrect value for last_msg_.sol_in[98].flags, expected 10, is " + << last_msg_.sol_in[98].flags; + EXPECT_EQ(last_msg_.sol_in[98].sensor_type, 226) + << "incorrect value for last_msg_.sol_in[98].sensor_type, expected 226, " + "is " + << last_msg_.sol_in[98].sensor_type; + EXPECT_EQ(last_msg_.sol_in[99].flags, 63) + << "incorrect value for last_msg_.sol_in[99].flags, expected 63, is " + << last_msg_.sol_in[99].flags; + EXPECT_EQ(last_msg_.sol_in[99].sensor_type, 60) + << "incorrect value for last_msg_.sol_in[99].sensor_type, expected 60, " + "is " + << last_msg_.sol_in[99].sensor_type; + EXPECT_EQ(last_msg_.sol_in[100].flags, 236) + << "incorrect value for last_msg_.sol_in[100].flags, expected 236, is " + << last_msg_.sol_in[100].flags; + EXPECT_EQ(last_msg_.sol_in[100].sensor_type, 106) + << "incorrect value for last_msg_.sol_in[100].sensor_type, expected 106, " + "is " + << last_msg_.sol_in[100].sensor_type; + EXPECT_EQ(last_msg_.sol_in[101].flags, 96) + << "incorrect value for last_msg_.sol_in[101].flags, expected 96, is " + << last_msg_.sol_in[101].flags; + EXPECT_EQ(last_msg_.sol_in[101].sensor_type, 93) + << "incorrect value for last_msg_.sol_in[101].sensor_type, expected 93, " + "is " + << last_msg_.sol_in[101].sensor_type; + EXPECT_EQ(last_msg_.sol_in[102].flags, 163) + << "incorrect value for last_msg_.sol_in[102].flags, expected 163, is " + << last_msg_.sol_in[102].flags; + EXPECT_EQ(last_msg_.sol_in[102].sensor_type, 30) + << "incorrect value for last_msg_.sol_in[102].sensor_type, expected 30, " + "is " + << last_msg_.sol_in[102].sensor_type; + EXPECT_EQ(last_msg_.sol_in[103].flags, 238) + << "incorrect value for last_msg_.sol_in[103].flags, expected 238, is " + << last_msg_.sol_in[103].flags; + EXPECT_EQ(last_msg_.sol_in[103].sensor_type, 106) + << "incorrect value for last_msg_.sol_in[103].sensor_type, expected 106, " + "is " + << last_msg_.sol_in[103].sensor_type; + EXPECT_EQ(last_msg_.sol_in[104].flags, 133) + << "incorrect value for last_msg_.sol_in[104].flags, expected 133, is " + << last_msg_.sol_in[104].flags; + EXPECT_EQ(last_msg_.sol_in[104].sensor_type, 147) + << "incorrect value for last_msg_.sol_in[104].sensor_type, expected 147, " + "is " + << last_msg_.sol_in[104].sensor_type; + EXPECT_EQ(last_msg_.sol_in[105].flags, 107) + << "incorrect value for last_msg_.sol_in[105].flags, expected 107, is " + << last_msg_.sol_in[105].flags; + EXPECT_EQ(last_msg_.sol_in[105].sensor_type, 132) + << "incorrect value for last_msg_.sol_in[105].sensor_type, expected 132, " + "is " + << last_msg_.sol_in[105].sensor_type; + EXPECT_EQ(last_msg_.sol_in[106].flags, 214) + << "incorrect value for last_msg_.sol_in[106].flags, expected 214, is " + << last_msg_.sol_in[106].flags; + EXPECT_EQ(last_msg_.sol_in[106].sensor_type, 152) + << "incorrect value for last_msg_.sol_in[106].sensor_type, expected 152, " + "is " + << last_msg_.sol_in[106].sensor_type; + EXPECT_EQ(last_msg_.sol_in[107].flags, 185) + << "incorrect value for last_msg_.sol_in[107].flags, expected 185, is " + << last_msg_.sol_in[107].flags; + EXPECT_EQ(last_msg_.sol_in[107].sensor_type, 221) + << "incorrect value for last_msg_.sol_in[107].sensor_type, expected 221, " + "is " + << last_msg_.sol_in[107].sensor_type; + EXPECT_EQ(last_msg_.sol_in[108].flags, 21) + << "incorrect value for last_msg_.sol_in[108].flags, expected 21, is " + << last_msg_.sol_in[108].flags; + EXPECT_EQ(last_msg_.sol_in[108].sensor_type, 202) + << "incorrect value for last_msg_.sol_in[108].sensor_type, expected 202, " + "is " + << last_msg_.sol_in[108].sensor_type; + EXPECT_EQ(last_msg_.sol_in[109].flags, 51) + << "incorrect value for last_msg_.sol_in[109].flags, expected 51, is " + << last_msg_.sol_in[109].flags; + EXPECT_EQ(last_msg_.sol_in[109].sensor_type, 252) + << "incorrect value for last_msg_.sol_in[109].sensor_type, expected 252, " + "is " + << last_msg_.sol_in[109].sensor_type; + EXPECT_EQ(last_msg_.sol_in[110].flags, 59) + << "incorrect value for last_msg_.sol_in[110].flags, expected 59, is " + << last_msg_.sol_in[110].flags; + EXPECT_EQ(last_msg_.sol_in[110].sensor_type, 130) + << "incorrect value for last_msg_.sol_in[110].sensor_type, expected 130, " + "is " + << last_msg_.sol_in[110].sensor_type; + EXPECT_EQ(last_msg_.sol_in[111].flags, 202) + << "incorrect value for last_msg_.sol_in[111].flags, expected 202, is " + << last_msg_.sol_in[111].flags; + EXPECT_EQ(last_msg_.sol_in[111].sensor_type, 166) + << "incorrect value for last_msg_.sol_in[111].sensor_type, expected 166, " + "is " + << last_msg_.sol_in[111].sensor_type; + EXPECT_EQ(last_msg_.sol_in[112].flags, 170) + << "incorrect value for last_msg_.sol_in[112].flags, expected 170, is " + << last_msg_.sol_in[112].flags; + EXPECT_EQ(last_msg_.sol_in[112].sensor_type, 127) + << "incorrect value for last_msg_.sol_in[112].sensor_type, expected 127, " + "is " + << last_msg_.sol_in[112].sensor_type; + EXPECT_EQ(last_msg_.sol_in[113].flags, 193) + << "incorrect value for last_msg_.sol_in[113].flags, expected 193, is " + << last_msg_.sol_in[113].flags; + EXPECT_EQ(last_msg_.sol_in[113].sensor_type, 58) + << "incorrect value for last_msg_.sol_in[113].sensor_type, expected 58, " + "is " + << last_msg_.sol_in[113].sensor_type; + EXPECT_EQ(last_msg_.sol_in[114].flags, 125) + << "incorrect value for last_msg_.sol_in[114].flags, expected 125, is " + << last_msg_.sol_in[114].flags; + EXPECT_EQ(last_msg_.sol_in[114].sensor_type, 215) + << "incorrect value for last_msg_.sol_in[114].sensor_type, expected 215, " + "is " + << last_msg_.sol_in[114].sensor_type; + EXPECT_EQ(last_msg_.sol_in[115].flags, 58) + << "incorrect value for last_msg_.sol_in[115].flags, expected 58, is " + << last_msg_.sol_in[115].flags; + EXPECT_EQ(last_msg_.sol_in[115].sensor_type, 22) + << "incorrect value for last_msg_.sol_in[115].sensor_type, expected 22, " + "is " + << last_msg_.sol_in[115].sensor_type; + EXPECT_EQ(last_msg_.sol_in[116].flags, 47) + << "incorrect value for last_msg_.sol_in[116].flags, expected 47, is " + << last_msg_.sol_in[116].flags; + EXPECT_EQ(last_msg_.sol_in[116].sensor_type, 135) + << "incorrect value for last_msg_.sol_in[116].sensor_type, expected 135, " + "is " + << last_msg_.sol_in[116].sensor_type; + EXPECT_EQ(last_msg_.sol_in[117].flags, 142) + << "incorrect value for last_msg_.sol_in[117].flags, expected 142, is " + << last_msg_.sol_in[117].flags; + EXPECT_EQ(last_msg_.sol_in[117].sensor_type, 88) + << "incorrect value for last_msg_.sol_in[117].sensor_type, expected 88, " + "is " + << last_msg_.sol_in[117].sensor_type; + EXPECT_EQ(last_msg_.vdop, 41989) + << "incorrect value for last_msg_.vdop, expected 41989, is " + << last_msg_.vdop; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrCodeBiases.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrCodeBiases.cc index 61957851b..413621f07 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrCodeBiases.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrCodeBiases.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodeBiases.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodeBiases.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrCodeBiases0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrCodeBiases0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrCodeBiases0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrCodeBiases0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_code_biases_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_code_biases_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,465 +67,835 @@ class Test_auto_check_sbp_ssr_MsgSsrCodeBiases0 : sbp_msg_ssr_code_biases_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrCodeBiases0, Test) -{ - - uint8_t encoded_frame[] = {85,225,5,39,87,253,208,90,19,23,9,66,133,241,254,132,51,4,131,240,120,83,148,209,213,62,228,232,71,66,188,210,128,54,131,152,129,111,139,242,177,145,44,9,245,207,241,202,150,141,50,159,220,139,37,187,98,191,23,128,136,167,200,6,211,90,23,244,138,215,209,139,13,101,32,7,18,29,70,250,109,73,202,79,144,9,146,69,241,52,22,99,98,204,3,171,230,180,75,62,145,86,130,31,30,155,37,18,55,210,39,127,242,66,13,237,152,170,212,15,246,59,94,180,195,157,69,100,119,16,68,179,175,144,113,81,82,30,151,21,109,41,225,8,77,164,157,0,73,30,6,78,81,143,116,240,151,55,185,169,254,51,39,74,175,247,34,97,74,97,176,48,236,173,12,174,101,130,30,169,193,190,204,196,123,107,25,225,74,9,10,55,3,131,246,99,133,34,227,203,68,18,97,223,89,192,246,50,69,91,10,151,74,118,110,36,168,247,160,77,179,141,178,99,191,120,77,192,91,224,1,226,50,87,146,148,238,100,179,125,227,215,104,184,31,57,90,79,21,156,245,81,60,93,170,60,200,167,13,125,132, }; - - sbp_msg_ssr_code_biases_t test_msg{}; - - test_msg.biases[0].code = 51; - test_msg.biases[0].value = -31996; - - test_msg.biases[1].code = 240; - test_msg.biases[1].value = 21368; - - test_msg.biases[2].code = 148; - test_msg.biases[2].value = -10799; - - test_msg.biases[3].code = 62; - test_msg.biases[3].value = -5916; - - test_msg.biases[4].code = 71; - test_msg.biases[4].value = -17342; - - test_msg.biases[5].code = 210; - test_msg.biases[5].value = 13952; - - test_msg.biases[6].code = 131; - test_msg.biases[6].value = -32360; - - test_msg.biases[7].code = 111; - test_msg.biases[7].value = -3445; - - test_msg.biases[8].code = 177; - test_msg.biases[8].value = 11409; - - test_msg.biases[9].code = 9; - test_msg.biases[9].value = -12299; - - test_msg.biases[10].code = 241; - test_msg.biases[10].value = -26934; - - test_msg.biases[11].code = 141; - test_msg.biases[11].value = -24782; - - test_msg.biases[12].code = 220; - test_msg.biases[12].value = 9611; - - test_msg.biases[13].code = 187; - test_msg.biases[13].value = -16542; - - test_msg.biases[14].code = 23; - test_msg.biases[14].value = -30592; - - test_msg.biases[15].code = 167; - test_msg.biases[15].value = 1736; - - test_msg.biases[16].code = 211; - test_msg.biases[16].value = 5978; - - test_msg.biases[17].code = 244; - test_msg.biases[17].value = -10358; - - test_msg.biases[18].code = 209; - test_msg.biases[18].value = 3467; - - test_msg.biases[19].code = 101; - test_msg.biases[19].value = 1824; - - test_msg.biases[20].code = 18; - test_msg.biases[20].value = 17949; - - test_msg.biases[21].code = 250; - test_msg.biases[21].value = 18797; - - test_msg.biases[22].code = 202; - test_msg.biases[22].value = -28593; - - test_msg.biases[23].code = 9; - test_msg.biases[23].value = 17810; - - test_msg.biases[24].code = 241; - test_msg.biases[24].value = 5684; - - test_msg.biases[25].code = 99; - test_msg.biases[25].value = -13214; - - test_msg.biases[26].code = 3; - test_msg.biases[26].value = -6485; - - test_msg.biases[27].code = 180; - test_msg.biases[27].value = 15947; - - test_msg.biases[28].code = 145; - test_msg.biases[28].value = -32170; - - test_msg.biases[29].code = 31; - test_msg.biases[29].value = -25826; - - test_msg.biases[30].code = 37; - test_msg.biases[30].value = 14098; - - test_msg.biases[31].code = 210; - test_msg.biases[31].value = 32551; - - test_msg.biases[32].code = 242; - test_msg.biases[32].value = 3394; - - test_msg.biases[33].code = 237; - test_msg.biases[33].value = -21864; - - test_msg.biases[34].code = 212; - test_msg.biases[34].value = -2545; - - test_msg.biases[35].code = 59; - test_msg.biases[35].value = -19362; - - test_msg.biases[36].code = 195; - test_msg.biases[36].value = 17821; - - test_msg.biases[37].code = 100; - test_msg.biases[37].value = 4215; - - test_msg.biases[38].code = 68; - test_msg.biases[38].value = -20557; - - test_msg.biases[39].code = 144; - test_msg.biases[39].value = 20849; - - test_msg.biases[40].code = 82; - test_msg.biases[40].value = -26850; - - test_msg.biases[41].code = 21; - test_msg.biases[41].value = 10605; - - test_msg.biases[42].code = 225; - test_msg.biases[42].value = 19720; - - test_msg.biases[43].code = 164; - test_msg.biases[43].value = 157; - - test_msg.biases[44].code = 73; - test_msg.biases[44].value = 1566; - - test_msg.biases[45].code = 78; - test_msg.biases[45].value = -28847; - - test_msg.biases[46].code = 116; - test_msg.biases[46].value = -26640; - - test_msg.biases[47].code = 55; - test_msg.biases[47].value = -22087; - - test_msg.biases[48].code = 254; - test_msg.biases[48].value = 10035; - - test_msg.biases[49].code = 74; - test_msg.biases[49].value = -2129; - - test_msg.biases[50].code = 34; - test_msg.biases[50].value = 19041; - - test_msg.biases[51].code = 97; - test_msg.biases[51].value = 12464; - - test_msg.biases[52].code = 236; - test_msg.biases[52].value = 3245; - - test_msg.biases[53].code = 174; - test_msg.biases[53].value = -32155; - - test_msg.biases[54].code = 30; - test_msg.biases[54].value = -15959; - - test_msg.biases[55].code = 190; - test_msg.biases[55].value = -15156; - - test_msg.biases[56].code = 123; - test_msg.biases[56].value = 6507; - - test_msg.biases[57].code = 225; - test_msg.biases[57].value = 2378; - - test_msg.biases[58].code = 10; - test_msg.biases[58].value = 823; - - test_msg.biases[59].code = 131; - test_msg.biases[59].value = 25590; - - test_msg.biases[60].code = 133; - test_msg.biases[60].value = -7390; - - test_msg.biases[61].code = 203; - test_msg.biases[61].value = 4676; - - test_msg.biases[62].code = 97; - test_msg.biases[62].value = 23007; - - test_msg.biases[63].code = 192; - test_msg.biases[63].value = 13046; - - test_msg.biases[64].code = 69; - test_msg.biases[64].value = 2651; - - test_msg.biases[65].code = 151; - test_msg.biases[65].value = 30282; - - test_msg.biases[66].code = 110; - test_msg.biases[66].value = -22492; - - test_msg.biases[67].code = 247; - test_msg.biases[67].value = 19872; - - test_msg.biases[68].code = 179; - test_msg.biases[68].value = -19827; - - test_msg.biases[69].code = 99; - test_msg.biases[69].value = 30911; - - test_msg.biases[70].code = 77; - test_msg.biases[70].value = 23488; - - test_msg.biases[71].code = 224; - test_msg.biases[71].value = -7679; - - test_msg.biases[72].code = 50; - test_msg.biases[72].value = -28073; - - test_msg.biases[73].code = 148; - test_msg.biases[73].value = 25838; - - test_msg.biases[74].code = 179; - test_msg.biases[74].value = -7299; - - test_msg.biases[75].code = 215; - test_msg.biases[75].value = -18328; - - test_msg.biases[76].code = 31; - test_msg.biases[76].value = 23097; - - test_msg.biases[77].code = 79; - test_msg.biases[77].value = -25579; - - test_msg.biases[78].code = 245; - test_msg.biases[78].value = 15441; - - test_msg.biases[79].code = 93; - test_msg.biases[79].value = 15530; - - test_msg.biases[80].code = 200; - test_msg.biases[80].value = 3495; - test_msg.iod_ssr = 132; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_biases.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)98,(char)105,(char)97,(char)115,(char)101,(char)115 }; - memcpy(test_msg.n_biases.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_biases.value = 81; - test_msg.sid.code = 241; - test_msg.sid.sat = 133; - test_msg.time.tow = 387144400; - test_msg.time.wn = 16905; - test_msg.update_interval = 254; - - EXPECT_EQ(send_message( 22311, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 22311); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.biases[0].code, 51) << "incorrect value for last_msg_.biases[0].code, expected 51, is " << last_msg_.biases[0].code; - EXPECT_EQ(last_msg_.biases[0].value, -31996) << "incorrect value for last_msg_.biases[0].value, expected -31996, is " << last_msg_.biases[0].value; - EXPECT_EQ(last_msg_.biases[1].code, 240) << "incorrect value for last_msg_.biases[1].code, expected 240, is " << last_msg_.biases[1].code; - EXPECT_EQ(last_msg_.biases[1].value, 21368) << "incorrect value for last_msg_.biases[1].value, expected 21368, is " << last_msg_.biases[1].value; - EXPECT_EQ(last_msg_.biases[2].code, 148) << "incorrect value for last_msg_.biases[2].code, expected 148, is " << last_msg_.biases[2].code; - EXPECT_EQ(last_msg_.biases[2].value, -10799) << "incorrect value for last_msg_.biases[2].value, expected -10799, is " << last_msg_.biases[2].value; - EXPECT_EQ(last_msg_.biases[3].code, 62) << "incorrect value for last_msg_.biases[3].code, expected 62, is " << last_msg_.biases[3].code; - EXPECT_EQ(last_msg_.biases[3].value, -5916) << "incorrect value for last_msg_.biases[3].value, expected -5916, is " << last_msg_.biases[3].value; - EXPECT_EQ(last_msg_.biases[4].code, 71) << "incorrect value for last_msg_.biases[4].code, expected 71, is " << last_msg_.biases[4].code; - EXPECT_EQ(last_msg_.biases[4].value, -17342) << "incorrect value for last_msg_.biases[4].value, expected -17342, is " << last_msg_.biases[4].value; - EXPECT_EQ(last_msg_.biases[5].code, 210) << "incorrect value for last_msg_.biases[5].code, expected 210, is " << last_msg_.biases[5].code; - EXPECT_EQ(last_msg_.biases[5].value, 13952) << "incorrect value for last_msg_.biases[5].value, expected 13952, is " << last_msg_.biases[5].value; - EXPECT_EQ(last_msg_.biases[6].code, 131) << "incorrect value for last_msg_.biases[6].code, expected 131, is " << last_msg_.biases[6].code; - EXPECT_EQ(last_msg_.biases[6].value, -32360) << "incorrect value for last_msg_.biases[6].value, expected -32360, is " << last_msg_.biases[6].value; - EXPECT_EQ(last_msg_.biases[7].code, 111) << "incorrect value for last_msg_.biases[7].code, expected 111, is " << last_msg_.biases[7].code; - EXPECT_EQ(last_msg_.biases[7].value, -3445) << "incorrect value for last_msg_.biases[7].value, expected -3445, is " << last_msg_.biases[7].value; - EXPECT_EQ(last_msg_.biases[8].code, 177) << "incorrect value for last_msg_.biases[8].code, expected 177, is " << last_msg_.biases[8].code; - EXPECT_EQ(last_msg_.biases[8].value, 11409) << "incorrect value for last_msg_.biases[8].value, expected 11409, is " << last_msg_.biases[8].value; - EXPECT_EQ(last_msg_.biases[9].code, 9) << "incorrect value for last_msg_.biases[9].code, expected 9, is " << last_msg_.biases[9].code; - EXPECT_EQ(last_msg_.biases[9].value, -12299) << "incorrect value for last_msg_.biases[9].value, expected -12299, is " << last_msg_.biases[9].value; - EXPECT_EQ(last_msg_.biases[10].code, 241) << "incorrect value for last_msg_.biases[10].code, expected 241, is " << last_msg_.biases[10].code; - EXPECT_EQ(last_msg_.biases[10].value, -26934) << "incorrect value for last_msg_.biases[10].value, expected -26934, is " << last_msg_.biases[10].value; - EXPECT_EQ(last_msg_.biases[11].code, 141) << "incorrect value for last_msg_.biases[11].code, expected 141, is " << last_msg_.biases[11].code; - EXPECT_EQ(last_msg_.biases[11].value, -24782) << "incorrect value for last_msg_.biases[11].value, expected -24782, is " << last_msg_.biases[11].value; - EXPECT_EQ(last_msg_.biases[12].code, 220) << "incorrect value for last_msg_.biases[12].code, expected 220, is " << last_msg_.biases[12].code; - EXPECT_EQ(last_msg_.biases[12].value, 9611) << "incorrect value for last_msg_.biases[12].value, expected 9611, is " << last_msg_.biases[12].value; - EXPECT_EQ(last_msg_.biases[13].code, 187) << "incorrect value for last_msg_.biases[13].code, expected 187, is " << last_msg_.biases[13].code; - EXPECT_EQ(last_msg_.biases[13].value, -16542) << "incorrect value for last_msg_.biases[13].value, expected -16542, is " << last_msg_.biases[13].value; - EXPECT_EQ(last_msg_.biases[14].code, 23) << "incorrect value for last_msg_.biases[14].code, expected 23, is " << last_msg_.biases[14].code; - EXPECT_EQ(last_msg_.biases[14].value, -30592) << "incorrect value for last_msg_.biases[14].value, expected -30592, is " << last_msg_.biases[14].value; - EXPECT_EQ(last_msg_.biases[15].code, 167) << "incorrect value for last_msg_.biases[15].code, expected 167, is " << last_msg_.biases[15].code; - EXPECT_EQ(last_msg_.biases[15].value, 1736) << "incorrect value for last_msg_.biases[15].value, expected 1736, is " << last_msg_.biases[15].value; - EXPECT_EQ(last_msg_.biases[16].code, 211) << "incorrect value for last_msg_.biases[16].code, expected 211, is " << last_msg_.biases[16].code; - EXPECT_EQ(last_msg_.biases[16].value, 5978) << "incorrect value for last_msg_.biases[16].value, expected 5978, is " << last_msg_.biases[16].value; - EXPECT_EQ(last_msg_.biases[17].code, 244) << "incorrect value for last_msg_.biases[17].code, expected 244, is " << last_msg_.biases[17].code; - EXPECT_EQ(last_msg_.biases[17].value, -10358) << "incorrect value for last_msg_.biases[17].value, expected -10358, is " << last_msg_.biases[17].value; - EXPECT_EQ(last_msg_.biases[18].code, 209) << "incorrect value for last_msg_.biases[18].code, expected 209, is " << last_msg_.biases[18].code; - EXPECT_EQ(last_msg_.biases[18].value, 3467) << "incorrect value for last_msg_.biases[18].value, expected 3467, is " << last_msg_.biases[18].value; - EXPECT_EQ(last_msg_.biases[19].code, 101) << "incorrect value for last_msg_.biases[19].code, expected 101, is " << last_msg_.biases[19].code; - EXPECT_EQ(last_msg_.biases[19].value, 1824) << "incorrect value for last_msg_.biases[19].value, expected 1824, is " << last_msg_.biases[19].value; - EXPECT_EQ(last_msg_.biases[20].code, 18) << "incorrect value for last_msg_.biases[20].code, expected 18, is " << last_msg_.biases[20].code; - EXPECT_EQ(last_msg_.biases[20].value, 17949) << "incorrect value for last_msg_.biases[20].value, expected 17949, is " << last_msg_.biases[20].value; - EXPECT_EQ(last_msg_.biases[21].code, 250) << "incorrect value for last_msg_.biases[21].code, expected 250, is " << last_msg_.biases[21].code; - EXPECT_EQ(last_msg_.biases[21].value, 18797) << "incorrect value for last_msg_.biases[21].value, expected 18797, is " << last_msg_.biases[21].value; - EXPECT_EQ(last_msg_.biases[22].code, 202) << "incorrect value for last_msg_.biases[22].code, expected 202, is " << last_msg_.biases[22].code; - EXPECT_EQ(last_msg_.biases[22].value, -28593) << "incorrect value for last_msg_.biases[22].value, expected -28593, is " << last_msg_.biases[22].value; - EXPECT_EQ(last_msg_.biases[23].code, 9) << "incorrect value for last_msg_.biases[23].code, expected 9, is " << last_msg_.biases[23].code; - EXPECT_EQ(last_msg_.biases[23].value, 17810) << "incorrect value for last_msg_.biases[23].value, expected 17810, is " << last_msg_.biases[23].value; - EXPECT_EQ(last_msg_.biases[24].code, 241) << "incorrect value for last_msg_.biases[24].code, expected 241, is " << last_msg_.biases[24].code; - EXPECT_EQ(last_msg_.biases[24].value, 5684) << "incorrect value for last_msg_.biases[24].value, expected 5684, is " << last_msg_.biases[24].value; - EXPECT_EQ(last_msg_.biases[25].code, 99) << "incorrect value for last_msg_.biases[25].code, expected 99, is " << last_msg_.biases[25].code; - EXPECT_EQ(last_msg_.biases[25].value, -13214) << "incorrect value for last_msg_.biases[25].value, expected -13214, is " << last_msg_.biases[25].value; - EXPECT_EQ(last_msg_.biases[26].code, 3) << "incorrect value for last_msg_.biases[26].code, expected 3, is " << last_msg_.biases[26].code; - EXPECT_EQ(last_msg_.biases[26].value, -6485) << "incorrect value for last_msg_.biases[26].value, expected -6485, is " << last_msg_.biases[26].value; - EXPECT_EQ(last_msg_.biases[27].code, 180) << "incorrect value for last_msg_.biases[27].code, expected 180, is " << last_msg_.biases[27].code; - EXPECT_EQ(last_msg_.biases[27].value, 15947) << "incorrect value for last_msg_.biases[27].value, expected 15947, is " << last_msg_.biases[27].value; - EXPECT_EQ(last_msg_.biases[28].code, 145) << "incorrect value for last_msg_.biases[28].code, expected 145, is " << last_msg_.biases[28].code; - EXPECT_EQ(last_msg_.biases[28].value, -32170) << "incorrect value for last_msg_.biases[28].value, expected -32170, is " << last_msg_.biases[28].value; - EXPECT_EQ(last_msg_.biases[29].code, 31) << "incorrect value for last_msg_.biases[29].code, expected 31, is " << last_msg_.biases[29].code; - EXPECT_EQ(last_msg_.biases[29].value, -25826) << "incorrect value for last_msg_.biases[29].value, expected -25826, is " << last_msg_.biases[29].value; - EXPECT_EQ(last_msg_.biases[30].code, 37) << "incorrect value for last_msg_.biases[30].code, expected 37, is " << last_msg_.biases[30].code; - EXPECT_EQ(last_msg_.biases[30].value, 14098) << "incorrect value for last_msg_.biases[30].value, expected 14098, is " << last_msg_.biases[30].value; - EXPECT_EQ(last_msg_.biases[31].code, 210) << "incorrect value for last_msg_.biases[31].code, expected 210, is " << last_msg_.biases[31].code; - EXPECT_EQ(last_msg_.biases[31].value, 32551) << "incorrect value for last_msg_.biases[31].value, expected 32551, is " << last_msg_.biases[31].value; - EXPECT_EQ(last_msg_.biases[32].code, 242) << "incorrect value for last_msg_.biases[32].code, expected 242, is " << last_msg_.biases[32].code; - EXPECT_EQ(last_msg_.biases[32].value, 3394) << "incorrect value for last_msg_.biases[32].value, expected 3394, is " << last_msg_.biases[32].value; - EXPECT_EQ(last_msg_.biases[33].code, 237) << "incorrect value for last_msg_.biases[33].code, expected 237, is " << last_msg_.biases[33].code; - EXPECT_EQ(last_msg_.biases[33].value, -21864) << "incorrect value for last_msg_.biases[33].value, expected -21864, is " << last_msg_.biases[33].value; - EXPECT_EQ(last_msg_.biases[34].code, 212) << "incorrect value for last_msg_.biases[34].code, expected 212, is " << last_msg_.biases[34].code; - EXPECT_EQ(last_msg_.biases[34].value, -2545) << "incorrect value for last_msg_.biases[34].value, expected -2545, is " << last_msg_.biases[34].value; - EXPECT_EQ(last_msg_.biases[35].code, 59) << "incorrect value for last_msg_.biases[35].code, expected 59, is " << last_msg_.biases[35].code; - EXPECT_EQ(last_msg_.biases[35].value, -19362) << "incorrect value for last_msg_.biases[35].value, expected -19362, is " << last_msg_.biases[35].value; - EXPECT_EQ(last_msg_.biases[36].code, 195) << "incorrect value for last_msg_.biases[36].code, expected 195, is " << last_msg_.biases[36].code; - EXPECT_EQ(last_msg_.biases[36].value, 17821) << "incorrect value for last_msg_.biases[36].value, expected 17821, is " << last_msg_.biases[36].value; - EXPECT_EQ(last_msg_.biases[37].code, 100) << "incorrect value for last_msg_.biases[37].code, expected 100, is " << last_msg_.biases[37].code; - EXPECT_EQ(last_msg_.biases[37].value, 4215) << "incorrect value for last_msg_.biases[37].value, expected 4215, is " << last_msg_.biases[37].value; - EXPECT_EQ(last_msg_.biases[38].code, 68) << "incorrect value for last_msg_.biases[38].code, expected 68, is " << last_msg_.biases[38].code; - EXPECT_EQ(last_msg_.biases[38].value, -20557) << "incorrect value for last_msg_.biases[38].value, expected -20557, is " << last_msg_.biases[38].value; - EXPECT_EQ(last_msg_.biases[39].code, 144) << "incorrect value for last_msg_.biases[39].code, expected 144, is " << last_msg_.biases[39].code; - EXPECT_EQ(last_msg_.biases[39].value, 20849) << "incorrect value for last_msg_.biases[39].value, expected 20849, is " << last_msg_.biases[39].value; - EXPECT_EQ(last_msg_.biases[40].code, 82) << "incorrect value for last_msg_.biases[40].code, expected 82, is " << last_msg_.biases[40].code; - EXPECT_EQ(last_msg_.biases[40].value, -26850) << "incorrect value for last_msg_.biases[40].value, expected -26850, is " << last_msg_.biases[40].value; - EXPECT_EQ(last_msg_.biases[41].code, 21) << "incorrect value for last_msg_.biases[41].code, expected 21, is " << last_msg_.biases[41].code; - EXPECT_EQ(last_msg_.biases[41].value, 10605) << "incorrect value for last_msg_.biases[41].value, expected 10605, is " << last_msg_.biases[41].value; - EXPECT_EQ(last_msg_.biases[42].code, 225) << "incorrect value for last_msg_.biases[42].code, expected 225, is " << last_msg_.biases[42].code; - EXPECT_EQ(last_msg_.biases[42].value, 19720) << "incorrect value for last_msg_.biases[42].value, expected 19720, is " << last_msg_.biases[42].value; - EXPECT_EQ(last_msg_.biases[43].code, 164) << "incorrect value for last_msg_.biases[43].code, expected 164, is " << last_msg_.biases[43].code; - EXPECT_EQ(last_msg_.biases[43].value, 157) << "incorrect value for last_msg_.biases[43].value, expected 157, is " << last_msg_.biases[43].value; - EXPECT_EQ(last_msg_.biases[44].code, 73) << "incorrect value for last_msg_.biases[44].code, expected 73, is " << last_msg_.biases[44].code; - EXPECT_EQ(last_msg_.biases[44].value, 1566) << "incorrect value for last_msg_.biases[44].value, expected 1566, is " << last_msg_.biases[44].value; - EXPECT_EQ(last_msg_.biases[45].code, 78) << "incorrect value for last_msg_.biases[45].code, expected 78, is " << last_msg_.biases[45].code; - EXPECT_EQ(last_msg_.biases[45].value, -28847) << "incorrect value for last_msg_.biases[45].value, expected -28847, is " << last_msg_.biases[45].value; - EXPECT_EQ(last_msg_.biases[46].code, 116) << "incorrect value for last_msg_.biases[46].code, expected 116, is " << last_msg_.biases[46].code; - EXPECT_EQ(last_msg_.biases[46].value, -26640) << "incorrect value for last_msg_.biases[46].value, expected -26640, is " << last_msg_.biases[46].value; - EXPECT_EQ(last_msg_.biases[47].code, 55) << "incorrect value for last_msg_.biases[47].code, expected 55, is " << last_msg_.biases[47].code; - EXPECT_EQ(last_msg_.biases[47].value, -22087) << "incorrect value for last_msg_.biases[47].value, expected -22087, is " << last_msg_.biases[47].value; - EXPECT_EQ(last_msg_.biases[48].code, 254) << "incorrect value for last_msg_.biases[48].code, expected 254, is " << last_msg_.biases[48].code; - EXPECT_EQ(last_msg_.biases[48].value, 10035) << "incorrect value for last_msg_.biases[48].value, expected 10035, is " << last_msg_.biases[48].value; - EXPECT_EQ(last_msg_.biases[49].code, 74) << "incorrect value for last_msg_.biases[49].code, expected 74, is " << last_msg_.biases[49].code; - EXPECT_EQ(last_msg_.biases[49].value, -2129) << "incorrect value for last_msg_.biases[49].value, expected -2129, is " << last_msg_.biases[49].value; - EXPECT_EQ(last_msg_.biases[50].code, 34) << "incorrect value for last_msg_.biases[50].code, expected 34, is " << last_msg_.biases[50].code; - EXPECT_EQ(last_msg_.biases[50].value, 19041) << "incorrect value for last_msg_.biases[50].value, expected 19041, is " << last_msg_.biases[50].value; - EXPECT_EQ(last_msg_.biases[51].code, 97) << "incorrect value for last_msg_.biases[51].code, expected 97, is " << last_msg_.biases[51].code; - EXPECT_EQ(last_msg_.biases[51].value, 12464) << "incorrect value for last_msg_.biases[51].value, expected 12464, is " << last_msg_.biases[51].value; - EXPECT_EQ(last_msg_.biases[52].code, 236) << "incorrect value for last_msg_.biases[52].code, expected 236, is " << last_msg_.biases[52].code; - EXPECT_EQ(last_msg_.biases[52].value, 3245) << "incorrect value for last_msg_.biases[52].value, expected 3245, is " << last_msg_.biases[52].value; - EXPECT_EQ(last_msg_.biases[53].code, 174) << "incorrect value for last_msg_.biases[53].code, expected 174, is " << last_msg_.biases[53].code; - EXPECT_EQ(last_msg_.biases[53].value, -32155) << "incorrect value for last_msg_.biases[53].value, expected -32155, is " << last_msg_.biases[53].value; - EXPECT_EQ(last_msg_.biases[54].code, 30) << "incorrect value for last_msg_.biases[54].code, expected 30, is " << last_msg_.biases[54].code; - EXPECT_EQ(last_msg_.biases[54].value, -15959) << "incorrect value for last_msg_.biases[54].value, expected -15959, is " << last_msg_.biases[54].value; - EXPECT_EQ(last_msg_.biases[55].code, 190) << "incorrect value for last_msg_.biases[55].code, expected 190, is " << last_msg_.biases[55].code; - EXPECT_EQ(last_msg_.biases[55].value, -15156) << "incorrect value for last_msg_.biases[55].value, expected -15156, is " << last_msg_.biases[55].value; - EXPECT_EQ(last_msg_.biases[56].code, 123) << "incorrect value for last_msg_.biases[56].code, expected 123, is " << last_msg_.biases[56].code; - EXPECT_EQ(last_msg_.biases[56].value, 6507) << "incorrect value for last_msg_.biases[56].value, expected 6507, is " << last_msg_.biases[56].value; - EXPECT_EQ(last_msg_.biases[57].code, 225) << "incorrect value for last_msg_.biases[57].code, expected 225, is " << last_msg_.biases[57].code; - EXPECT_EQ(last_msg_.biases[57].value, 2378) << "incorrect value for last_msg_.biases[57].value, expected 2378, is " << last_msg_.biases[57].value; - EXPECT_EQ(last_msg_.biases[58].code, 10) << "incorrect value for last_msg_.biases[58].code, expected 10, is " << last_msg_.biases[58].code; - EXPECT_EQ(last_msg_.biases[58].value, 823) << "incorrect value for last_msg_.biases[58].value, expected 823, is " << last_msg_.biases[58].value; - EXPECT_EQ(last_msg_.biases[59].code, 131) << "incorrect value for last_msg_.biases[59].code, expected 131, is " << last_msg_.biases[59].code; - EXPECT_EQ(last_msg_.biases[59].value, 25590) << "incorrect value for last_msg_.biases[59].value, expected 25590, is " << last_msg_.biases[59].value; - EXPECT_EQ(last_msg_.biases[60].code, 133) << "incorrect value for last_msg_.biases[60].code, expected 133, is " << last_msg_.biases[60].code; - EXPECT_EQ(last_msg_.biases[60].value, -7390) << "incorrect value for last_msg_.biases[60].value, expected -7390, is " << last_msg_.biases[60].value; - EXPECT_EQ(last_msg_.biases[61].code, 203) << "incorrect value for last_msg_.biases[61].code, expected 203, is " << last_msg_.biases[61].code; - EXPECT_EQ(last_msg_.biases[61].value, 4676) << "incorrect value for last_msg_.biases[61].value, expected 4676, is " << last_msg_.biases[61].value; - EXPECT_EQ(last_msg_.biases[62].code, 97) << "incorrect value for last_msg_.biases[62].code, expected 97, is " << last_msg_.biases[62].code; - EXPECT_EQ(last_msg_.biases[62].value, 23007) << "incorrect value for last_msg_.biases[62].value, expected 23007, is " << last_msg_.biases[62].value; - EXPECT_EQ(last_msg_.biases[63].code, 192) << "incorrect value for last_msg_.biases[63].code, expected 192, is " << last_msg_.biases[63].code; - EXPECT_EQ(last_msg_.biases[63].value, 13046) << "incorrect value for last_msg_.biases[63].value, expected 13046, is " << last_msg_.biases[63].value; - EXPECT_EQ(last_msg_.biases[64].code, 69) << "incorrect value for last_msg_.biases[64].code, expected 69, is " << last_msg_.biases[64].code; - EXPECT_EQ(last_msg_.biases[64].value, 2651) << "incorrect value for last_msg_.biases[64].value, expected 2651, is " << last_msg_.biases[64].value; - EXPECT_EQ(last_msg_.biases[65].code, 151) << "incorrect value for last_msg_.biases[65].code, expected 151, is " << last_msg_.biases[65].code; - EXPECT_EQ(last_msg_.biases[65].value, 30282) << "incorrect value for last_msg_.biases[65].value, expected 30282, is " << last_msg_.biases[65].value; - EXPECT_EQ(last_msg_.biases[66].code, 110) << "incorrect value for last_msg_.biases[66].code, expected 110, is " << last_msg_.biases[66].code; - EXPECT_EQ(last_msg_.biases[66].value, -22492) << "incorrect value for last_msg_.biases[66].value, expected -22492, is " << last_msg_.biases[66].value; - EXPECT_EQ(last_msg_.biases[67].code, 247) << "incorrect value for last_msg_.biases[67].code, expected 247, is " << last_msg_.biases[67].code; - EXPECT_EQ(last_msg_.biases[67].value, 19872) << "incorrect value for last_msg_.biases[67].value, expected 19872, is " << last_msg_.biases[67].value; - EXPECT_EQ(last_msg_.biases[68].code, 179) << "incorrect value for last_msg_.biases[68].code, expected 179, is " << last_msg_.biases[68].code; - EXPECT_EQ(last_msg_.biases[68].value, -19827) << "incorrect value for last_msg_.biases[68].value, expected -19827, is " << last_msg_.biases[68].value; - EXPECT_EQ(last_msg_.biases[69].code, 99) << "incorrect value for last_msg_.biases[69].code, expected 99, is " << last_msg_.biases[69].code; - EXPECT_EQ(last_msg_.biases[69].value, 30911) << "incorrect value for last_msg_.biases[69].value, expected 30911, is " << last_msg_.biases[69].value; - EXPECT_EQ(last_msg_.biases[70].code, 77) << "incorrect value for last_msg_.biases[70].code, expected 77, is " << last_msg_.biases[70].code; - EXPECT_EQ(last_msg_.biases[70].value, 23488) << "incorrect value for last_msg_.biases[70].value, expected 23488, is " << last_msg_.biases[70].value; - EXPECT_EQ(last_msg_.biases[71].code, 224) << "incorrect value for last_msg_.biases[71].code, expected 224, is " << last_msg_.biases[71].code; - EXPECT_EQ(last_msg_.biases[71].value, -7679) << "incorrect value for last_msg_.biases[71].value, expected -7679, is " << last_msg_.biases[71].value; - EXPECT_EQ(last_msg_.biases[72].code, 50) << "incorrect value for last_msg_.biases[72].code, expected 50, is " << last_msg_.biases[72].code; - EXPECT_EQ(last_msg_.biases[72].value, -28073) << "incorrect value for last_msg_.biases[72].value, expected -28073, is " << last_msg_.biases[72].value; - EXPECT_EQ(last_msg_.biases[73].code, 148) << "incorrect value for last_msg_.biases[73].code, expected 148, is " << last_msg_.biases[73].code; - EXPECT_EQ(last_msg_.biases[73].value, 25838) << "incorrect value for last_msg_.biases[73].value, expected 25838, is " << last_msg_.biases[73].value; - EXPECT_EQ(last_msg_.biases[74].code, 179) << "incorrect value for last_msg_.biases[74].code, expected 179, is " << last_msg_.biases[74].code; - EXPECT_EQ(last_msg_.biases[74].value, -7299) << "incorrect value for last_msg_.biases[74].value, expected -7299, is " << last_msg_.biases[74].value; - EXPECT_EQ(last_msg_.biases[75].code, 215) << "incorrect value for last_msg_.biases[75].code, expected 215, is " << last_msg_.biases[75].code; - EXPECT_EQ(last_msg_.biases[75].value, -18328) << "incorrect value for last_msg_.biases[75].value, expected -18328, is " << last_msg_.biases[75].value; - EXPECT_EQ(last_msg_.biases[76].code, 31) << "incorrect value for last_msg_.biases[76].code, expected 31, is " << last_msg_.biases[76].code; - EXPECT_EQ(last_msg_.biases[76].value, 23097) << "incorrect value for last_msg_.biases[76].value, expected 23097, is " << last_msg_.biases[76].value; - EXPECT_EQ(last_msg_.biases[77].code, 79) << "incorrect value for last_msg_.biases[77].code, expected 79, is " << last_msg_.biases[77].code; - EXPECT_EQ(last_msg_.biases[77].value, -25579) << "incorrect value for last_msg_.biases[77].value, expected -25579, is " << last_msg_.biases[77].value; - EXPECT_EQ(last_msg_.biases[78].code, 245) << "incorrect value for last_msg_.biases[78].code, expected 245, is " << last_msg_.biases[78].code; - EXPECT_EQ(last_msg_.biases[78].value, 15441) << "incorrect value for last_msg_.biases[78].value, expected 15441, is " << last_msg_.biases[78].value; - EXPECT_EQ(last_msg_.biases[79].code, 93) << "incorrect value for last_msg_.biases[79].code, expected 93, is " << last_msg_.biases[79].code; - EXPECT_EQ(last_msg_.biases[79].value, 15530) << "incorrect value for last_msg_.biases[79].value, expected 15530, is " << last_msg_.biases[79].value; - EXPECT_EQ(last_msg_.biases[80].code, 200) << "incorrect value for last_msg_.biases[80].code, expected 200, is " << last_msg_.biases[80].code; - EXPECT_EQ(last_msg_.biases[80].value, 3495) << "incorrect value for last_msg_.biases[80].value, expected 3495, is " << last_msg_.biases[80].value; - EXPECT_EQ(last_msg_.iod_ssr, 132) << "incorrect value for last_msg_.iod_ssr, expected 132, is " << last_msg_.iod_ssr; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_biases.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_biases.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_biases.handle_as << "'"; - } - { - const char check_string[] = { (char)98,(char)105,(char)97,(char)115,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_biases.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_biases.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_biases.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_biases.value, 81) << "incorrect value for last_msg_.n_biases.value, expected 81, is " << last_msg_.n_biases.value; - EXPECT_EQ(last_msg_.sid.code, 241) << "incorrect value for last_msg_.sid.code, expected 241, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.sat, 133) << "incorrect value for last_msg_.sid.sat, expected 133, is " << last_msg_.sid.sat; - EXPECT_EQ(last_msg_.time.tow, 387144400) << "incorrect value for last_msg_.time.tow, expected 387144400, is " << last_msg_.time.tow; - EXPECT_EQ(last_msg_.time.wn, 16905) << "incorrect value for last_msg_.time.wn, expected 16905, is " << last_msg_.time.wn; - EXPECT_EQ(last_msg_.update_interval, 254) << "incorrect value for last_msg_.update_interval, expected 254, is " << last_msg_.update_interval; +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrCodeBiases0, Test) { + uint8_t encoded_frame[] = { + 85, 225, 5, 39, 87, 253, 208, 90, 19, 23, 9, 66, 133, 241, 254, + 132, 51, 4, 131, 240, 120, 83, 148, 209, 213, 62, 228, 232, 71, 66, + 188, 210, 128, 54, 131, 152, 129, 111, 139, 242, 177, 145, 44, 9, 245, + 207, 241, 202, 150, 141, 50, 159, 220, 139, 37, 187, 98, 191, 23, 128, + 136, 167, 200, 6, 211, 90, 23, 244, 138, 215, 209, 139, 13, 101, 32, + 7, 18, 29, 70, 250, 109, 73, 202, 79, 144, 9, 146, 69, 241, 52, + 22, 99, 98, 204, 3, 171, 230, 180, 75, 62, 145, 86, 130, 31, 30, + 155, 37, 18, 55, 210, 39, 127, 242, 66, 13, 237, 152, 170, 212, 15, + 246, 59, 94, 180, 195, 157, 69, 100, 119, 16, 68, 179, 175, 144, 113, + 81, 82, 30, 151, 21, 109, 41, 225, 8, 77, 164, 157, 0, 73, 30, + 6, 78, 81, 143, 116, 240, 151, 55, 185, 169, 254, 51, 39, 74, 175, + 247, 34, 97, 74, 97, 176, 48, 236, 173, 12, 174, 101, 130, 30, 169, + 193, 190, 204, 196, 123, 107, 25, 225, 74, 9, 10, 55, 3, 131, 246, + 99, 133, 34, 227, 203, 68, 18, 97, 223, 89, 192, 246, 50, 69, 91, + 10, 151, 74, 118, 110, 36, 168, 247, 160, 77, 179, 141, 178, 99, 191, + 120, 77, 192, 91, 224, 1, 226, 50, 87, 146, 148, 238, 100, 179, 125, + 227, 215, 104, 184, 31, 57, 90, 79, 21, 156, 245, 81, 60, 93, 170, + 60, 200, 167, 13, 125, 132, + }; + + sbp_msg_ssr_code_biases_t test_msg{}; + + test_msg.biases[0].code = 51; + test_msg.biases[0].value = -31996; + + test_msg.biases[1].code = 240; + test_msg.biases[1].value = 21368; + + test_msg.biases[2].code = 148; + test_msg.biases[2].value = -10799; + + test_msg.biases[3].code = 62; + test_msg.biases[3].value = -5916; + + test_msg.biases[4].code = 71; + test_msg.biases[4].value = -17342; + + test_msg.biases[5].code = 210; + test_msg.biases[5].value = 13952; + + test_msg.biases[6].code = 131; + test_msg.biases[6].value = -32360; + + test_msg.biases[7].code = 111; + test_msg.biases[7].value = -3445; + + test_msg.biases[8].code = 177; + test_msg.biases[8].value = 11409; + + test_msg.biases[9].code = 9; + test_msg.biases[9].value = -12299; + + test_msg.biases[10].code = 241; + test_msg.biases[10].value = -26934; + + test_msg.biases[11].code = 141; + test_msg.biases[11].value = -24782; + + test_msg.biases[12].code = 220; + test_msg.biases[12].value = 9611; + + test_msg.biases[13].code = 187; + test_msg.biases[13].value = -16542; + + test_msg.biases[14].code = 23; + test_msg.biases[14].value = -30592; + + test_msg.biases[15].code = 167; + test_msg.biases[15].value = 1736; + + test_msg.biases[16].code = 211; + test_msg.biases[16].value = 5978; + + test_msg.biases[17].code = 244; + test_msg.biases[17].value = -10358; + + test_msg.biases[18].code = 209; + test_msg.biases[18].value = 3467; + + test_msg.biases[19].code = 101; + test_msg.biases[19].value = 1824; + + test_msg.biases[20].code = 18; + test_msg.biases[20].value = 17949; + + test_msg.biases[21].code = 250; + test_msg.biases[21].value = 18797; + + test_msg.biases[22].code = 202; + test_msg.biases[22].value = -28593; + + test_msg.biases[23].code = 9; + test_msg.biases[23].value = 17810; + + test_msg.biases[24].code = 241; + test_msg.biases[24].value = 5684; + + test_msg.biases[25].code = 99; + test_msg.biases[25].value = -13214; + + test_msg.biases[26].code = 3; + test_msg.biases[26].value = -6485; + + test_msg.biases[27].code = 180; + test_msg.biases[27].value = 15947; + + test_msg.biases[28].code = 145; + test_msg.biases[28].value = -32170; + + test_msg.biases[29].code = 31; + test_msg.biases[29].value = -25826; + + test_msg.biases[30].code = 37; + test_msg.biases[30].value = 14098; + + test_msg.biases[31].code = 210; + test_msg.biases[31].value = 32551; + + test_msg.biases[32].code = 242; + test_msg.biases[32].value = 3394; + + test_msg.biases[33].code = 237; + test_msg.biases[33].value = -21864; + + test_msg.biases[34].code = 212; + test_msg.biases[34].value = -2545; + + test_msg.biases[35].code = 59; + test_msg.biases[35].value = -19362; + + test_msg.biases[36].code = 195; + test_msg.biases[36].value = 17821; + + test_msg.biases[37].code = 100; + test_msg.biases[37].value = 4215; + + test_msg.biases[38].code = 68; + test_msg.biases[38].value = -20557; + + test_msg.biases[39].code = 144; + test_msg.biases[39].value = 20849; + + test_msg.biases[40].code = 82; + test_msg.biases[40].value = -26850; + + test_msg.biases[41].code = 21; + test_msg.biases[41].value = 10605; + + test_msg.biases[42].code = 225; + test_msg.biases[42].value = 19720; + + test_msg.biases[43].code = 164; + test_msg.biases[43].value = 157; + + test_msg.biases[44].code = 73; + test_msg.biases[44].value = 1566; + + test_msg.biases[45].code = 78; + test_msg.biases[45].value = -28847; + + test_msg.biases[46].code = 116; + test_msg.biases[46].value = -26640; + + test_msg.biases[47].code = 55; + test_msg.biases[47].value = -22087; + + test_msg.biases[48].code = 254; + test_msg.biases[48].value = 10035; + + test_msg.biases[49].code = 74; + test_msg.biases[49].value = -2129; + + test_msg.biases[50].code = 34; + test_msg.biases[50].value = 19041; + + test_msg.biases[51].code = 97; + test_msg.biases[51].value = 12464; + + test_msg.biases[52].code = 236; + test_msg.biases[52].value = 3245; + + test_msg.biases[53].code = 174; + test_msg.biases[53].value = -32155; + + test_msg.biases[54].code = 30; + test_msg.biases[54].value = -15959; + + test_msg.biases[55].code = 190; + test_msg.biases[55].value = -15156; + + test_msg.biases[56].code = 123; + test_msg.biases[56].value = 6507; + + test_msg.biases[57].code = 225; + test_msg.biases[57].value = 2378; + + test_msg.biases[58].code = 10; + test_msg.biases[58].value = 823; + + test_msg.biases[59].code = 131; + test_msg.biases[59].value = 25590; + + test_msg.biases[60].code = 133; + test_msg.biases[60].value = -7390; + + test_msg.biases[61].code = 203; + test_msg.biases[61].value = 4676; + + test_msg.biases[62].code = 97; + test_msg.biases[62].value = 23007; + + test_msg.biases[63].code = 192; + test_msg.biases[63].value = 13046; + + test_msg.biases[64].code = 69; + test_msg.biases[64].value = 2651; + + test_msg.biases[65].code = 151; + test_msg.biases[65].value = 30282; + + test_msg.biases[66].code = 110; + test_msg.biases[66].value = -22492; + + test_msg.biases[67].code = 247; + test_msg.biases[67].value = 19872; + + test_msg.biases[68].code = 179; + test_msg.biases[68].value = -19827; + + test_msg.biases[69].code = 99; + test_msg.biases[69].value = 30911; + + test_msg.biases[70].code = 77; + test_msg.biases[70].value = 23488; + + test_msg.biases[71].code = 224; + test_msg.biases[71].value = -7679; + + test_msg.biases[72].code = 50; + test_msg.biases[72].value = -28073; + + test_msg.biases[73].code = 148; + test_msg.biases[73].value = 25838; + + test_msg.biases[74].code = 179; + test_msg.biases[74].value = -7299; + + test_msg.biases[75].code = 215; + test_msg.biases[75].value = -18328; + + test_msg.biases[76].code = 31; + test_msg.biases[76].value = 23097; + + test_msg.biases[77].code = 79; + test_msg.biases[77].value = -25579; + + test_msg.biases[78].code = 245; + test_msg.biases[78].value = 15441; + + test_msg.biases[79].code = 93; + test_msg.biases[79].value = 15530; + + test_msg.biases[80].code = 200; + test_msg.biases[80].value = 3495; + test_msg.iod_ssr = 132; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_biases.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)98, (char)105, (char)97, + (char)115, (char)101, (char)115}; + memcpy(test_msg.n_biases.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_biases.value = 81; + test_msg.sid.code = 241; + test_msg.sid.sat = 133; + test_msg.time.tow = 387144400; + test_msg.time.wn = 16905; + test_msg.update_interval = 254; + + EXPECT_EQ(send_message(22311, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 22311); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.biases[0].code, 51) + << "incorrect value for last_msg_.biases[0].code, expected 51, is " + << last_msg_.biases[0].code; + EXPECT_EQ(last_msg_.biases[0].value, -31996) + << "incorrect value for last_msg_.biases[0].value, expected -31996, is " + << last_msg_.biases[0].value; + EXPECT_EQ(last_msg_.biases[1].code, 240) + << "incorrect value for last_msg_.biases[1].code, expected 240, is " + << last_msg_.biases[1].code; + EXPECT_EQ(last_msg_.biases[1].value, 21368) + << "incorrect value for last_msg_.biases[1].value, expected 21368, is " + << last_msg_.biases[1].value; + EXPECT_EQ(last_msg_.biases[2].code, 148) + << "incorrect value for last_msg_.biases[2].code, expected 148, is " + << last_msg_.biases[2].code; + EXPECT_EQ(last_msg_.biases[2].value, -10799) + << "incorrect value for last_msg_.biases[2].value, expected -10799, is " + << last_msg_.biases[2].value; + EXPECT_EQ(last_msg_.biases[3].code, 62) + << "incorrect value for last_msg_.biases[3].code, expected 62, is " + << last_msg_.biases[3].code; + EXPECT_EQ(last_msg_.biases[3].value, -5916) + << "incorrect value for last_msg_.biases[3].value, expected -5916, is " + << last_msg_.biases[3].value; + EXPECT_EQ(last_msg_.biases[4].code, 71) + << "incorrect value for last_msg_.biases[4].code, expected 71, is " + << last_msg_.biases[4].code; + EXPECT_EQ(last_msg_.biases[4].value, -17342) + << "incorrect value for last_msg_.biases[4].value, expected -17342, is " + << last_msg_.biases[4].value; + EXPECT_EQ(last_msg_.biases[5].code, 210) + << "incorrect value for last_msg_.biases[5].code, expected 210, is " + << last_msg_.biases[5].code; + EXPECT_EQ(last_msg_.biases[5].value, 13952) + << "incorrect value for last_msg_.biases[5].value, expected 13952, is " + << last_msg_.biases[5].value; + EXPECT_EQ(last_msg_.biases[6].code, 131) + << "incorrect value for last_msg_.biases[6].code, expected 131, is " + << last_msg_.biases[6].code; + EXPECT_EQ(last_msg_.biases[6].value, -32360) + << "incorrect value for last_msg_.biases[6].value, expected -32360, is " + << last_msg_.biases[6].value; + EXPECT_EQ(last_msg_.biases[7].code, 111) + << "incorrect value for last_msg_.biases[7].code, expected 111, is " + << last_msg_.biases[7].code; + EXPECT_EQ(last_msg_.biases[7].value, -3445) + << "incorrect value for last_msg_.biases[7].value, expected -3445, is " + << last_msg_.biases[7].value; + EXPECT_EQ(last_msg_.biases[8].code, 177) + << "incorrect value for last_msg_.biases[8].code, expected 177, is " + << last_msg_.biases[8].code; + EXPECT_EQ(last_msg_.biases[8].value, 11409) + << "incorrect value for last_msg_.biases[8].value, expected 11409, is " + << last_msg_.biases[8].value; + EXPECT_EQ(last_msg_.biases[9].code, 9) + << "incorrect value for last_msg_.biases[9].code, expected 9, is " + << last_msg_.biases[9].code; + EXPECT_EQ(last_msg_.biases[9].value, -12299) + << "incorrect value for last_msg_.biases[9].value, expected -12299, is " + << last_msg_.biases[9].value; + EXPECT_EQ(last_msg_.biases[10].code, 241) + << "incorrect value for last_msg_.biases[10].code, expected 241, is " + << last_msg_.biases[10].code; + EXPECT_EQ(last_msg_.biases[10].value, -26934) + << "incorrect value for last_msg_.biases[10].value, expected -26934, is " + << last_msg_.biases[10].value; + EXPECT_EQ(last_msg_.biases[11].code, 141) + << "incorrect value for last_msg_.biases[11].code, expected 141, is " + << last_msg_.biases[11].code; + EXPECT_EQ(last_msg_.biases[11].value, -24782) + << "incorrect value for last_msg_.biases[11].value, expected -24782, is " + << last_msg_.biases[11].value; + EXPECT_EQ(last_msg_.biases[12].code, 220) + << "incorrect value for last_msg_.biases[12].code, expected 220, is " + << last_msg_.biases[12].code; + EXPECT_EQ(last_msg_.biases[12].value, 9611) + << "incorrect value for last_msg_.biases[12].value, expected 9611, is " + << last_msg_.biases[12].value; + EXPECT_EQ(last_msg_.biases[13].code, 187) + << "incorrect value for last_msg_.biases[13].code, expected 187, is " + << last_msg_.biases[13].code; + EXPECT_EQ(last_msg_.biases[13].value, -16542) + << "incorrect value for last_msg_.biases[13].value, expected -16542, is " + << last_msg_.biases[13].value; + EXPECT_EQ(last_msg_.biases[14].code, 23) + << "incorrect value for last_msg_.biases[14].code, expected 23, is " + << last_msg_.biases[14].code; + EXPECT_EQ(last_msg_.biases[14].value, -30592) + << "incorrect value for last_msg_.biases[14].value, expected -30592, is " + << last_msg_.biases[14].value; + EXPECT_EQ(last_msg_.biases[15].code, 167) + << "incorrect value for last_msg_.biases[15].code, expected 167, is " + << last_msg_.biases[15].code; + EXPECT_EQ(last_msg_.biases[15].value, 1736) + << "incorrect value for last_msg_.biases[15].value, expected 1736, is " + << last_msg_.biases[15].value; + EXPECT_EQ(last_msg_.biases[16].code, 211) + << "incorrect value for last_msg_.biases[16].code, expected 211, is " + << last_msg_.biases[16].code; + EXPECT_EQ(last_msg_.biases[16].value, 5978) + << "incorrect value for last_msg_.biases[16].value, expected 5978, is " + << last_msg_.biases[16].value; + EXPECT_EQ(last_msg_.biases[17].code, 244) + << "incorrect value for last_msg_.biases[17].code, expected 244, is " + << last_msg_.biases[17].code; + EXPECT_EQ(last_msg_.biases[17].value, -10358) + << "incorrect value for last_msg_.biases[17].value, expected -10358, is " + << last_msg_.biases[17].value; + EXPECT_EQ(last_msg_.biases[18].code, 209) + << "incorrect value for last_msg_.biases[18].code, expected 209, is " + << last_msg_.biases[18].code; + EXPECT_EQ(last_msg_.biases[18].value, 3467) + << "incorrect value for last_msg_.biases[18].value, expected 3467, is " + << last_msg_.biases[18].value; + EXPECT_EQ(last_msg_.biases[19].code, 101) + << "incorrect value for last_msg_.biases[19].code, expected 101, is " + << last_msg_.biases[19].code; + EXPECT_EQ(last_msg_.biases[19].value, 1824) + << "incorrect value for last_msg_.biases[19].value, expected 1824, is " + << last_msg_.biases[19].value; + EXPECT_EQ(last_msg_.biases[20].code, 18) + << "incorrect value for last_msg_.biases[20].code, expected 18, is " + << last_msg_.biases[20].code; + EXPECT_EQ(last_msg_.biases[20].value, 17949) + << "incorrect value for last_msg_.biases[20].value, expected 17949, is " + << last_msg_.biases[20].value; + EXPECT_EQ(last_msg_.biases[21].code, 250) + << "incorrect value for last_msg_.biases[21].code, expected 250, is " + << last_msg_.biases[21].code; + EXPECT_EQ(last_msg_.biases[21].value, 18797) + << "incorrect value for last_msg_.biases[21].value, expected 18797, is " + << last_msg_.biases[21].value; + EXPECT_EQ(last_msg_.biases[22].code, 202) + << "incorrect value for last_msg_.biases[22].code, expected 202, is " + << last_msg_.biases[22].code; + EXPECT_EQ(last_msg_.biases[22].value, -28593) + << "incorrect value for last_msg_.biases[22].value, expected -28593, is " + << last_msg_.biases[22].value; + EXPECT_EQ(last_msg_.biases[23].code, 9) + << "incorrect value for last_msg_.biases[23].code, expected 9, is " + << last_msg_.biases[23].code; + EXPECT_EQ(last_msg_.biases[23].value, 17810) + << "incorrect value for last_msg_.biases[23].value, expected 17810, is " + << last_msg_.biases[23].value; + EXPECT_EQ(last_msg_.biases[24].code, 241) + << "incorrect value for last_msg_.biases[24].code, expected 241, is " + << last_msg_.biases[24].code; + EXPECT_EQ(last_msg_.biases[24].value, 5684) + << "incorrect value for last_msg_.biases[24].value, expected 5684, is " + << last_msg_.biases[24].value; + EXPECT_EQ(last_msg_.biases[25].code, 99) + << "incorrect value for last_msg_.biases[25].code, expected 99, is " + << last_msg_.biases[25].code; + EXPECT_EQ(last_msg_.biases[25].value, -13214) + << "incorrect value for last_msg_.biases[25].value, expected -13214, is " + << last_msg_.biases[25].value; + EXPECT_EQ(last_msg_.biases[26].code, 3) + << "incorrect value for last_msg_.biases[26].code, expected 3, is " + << last_msg_.biases[26].code; + EXPECT_EQ(last_msg_.biases[26].value, -6485) + << "incorrect value for last_msg_.biases[26].value, expected -6485, is " + << last_msg_.biases[26].value; + EXPECT_EQ(last_msg_.biases[27].code, 180) + << "incorrect value for last_msg_.biases[27].code, expected 180, is " + << last_msg_.biases[27].code; + EXPECT_EQ(last_msg_.biases[27].value, 15947) + << "incorrect value for last_msg_.biases[27].value, expected 15947, is " + << last_msg_.biases[27].value; + EXPECT_EQ(last_msg_.biases[28].code, 145) + << "incorrect value for last_msg_.biases[28].code, expected 145, is " + << last_msg_.biases[28].code; + EXPECT_EQ(last_msg_.biases[28].value, -32170) + << "incorrect value for last_msg_.biases[28].value, expected -32170, is " + << last_msg_.biases[28].value; + EXPECT_EQ(last_msg_.biases[29].code, 31) + << "incorrect value for last_msg_.biases[29].code, expected 31, is " + << last_msg_.biases[29].code; + EXPECT_EQ(last_msg_.biases[29].value, -25826) + << "incorrect value for last_msg_.biases[29].value, expected -25826, is " + << last_msg_.biases[29].value; + EXPECT_EQ(last_msg_.biases[30].code, 37) + << "incorrect value for last_msg_.biases[30].code, expected 37, is " + << last_msg_.biases[30].code; + EXPECT_EQ(last_msg_.biases[30].value, 14098) + << "incorrect value for last_msg_.biases[30].value, expected 14098, is " + << last_msg_.biases[30].value; + EXPECT_EQ(last_msg_.biases[31].code, 210) + << "incorrect value for last_msg_.biases[31].code, expected 210, is " + << last_msg_.biases[31].code; + EXPECT_EQ(last_msg_.biases[31].value, 32551) + << "incorrect value for last_msg_.biases[31].value, expected 32551, is " + << last_msg_.biases[31].value; + EXPECT_EQ(last_msg_.biases[32].code, 242) + << "incorrect value for last_msg_.biases[32].code, expected 242, is " + << last_msg_.biases[32].code; + EXPECT_EQ(last_msg_.biases[32].value, 3394) + << "incorrect value for last_msg_.biases[32].value, expected 3394, is " + << last_msg_.biases[32].value; + EXPECT_EQ(last_msg_.biases[33].code, 237) + << "incorrect value for last_msg_.biases[33].code, expected 237, is " + << last_msg_.biases[33].code; + EXPECT_EQ(last_msg_.biases[33].value, -21864) + << "incorrect value for last_msg_.biases[33].value, expected -21864, is " + << last_msg_.biases[33].value; + EXPECT_EQ(last_msg_.biases[34].code, 212) + << "incorrect value for last_msg_.biases[34].code, expected 212, is " + << last_msg_.biases[34].code; + EXPECT_EQ(last_msg_.biases[34].value, -2545) + << "incorrect value for last_msg_.biases[34].value, expected -2545, is " + << last_msg_.biases[34].value; + EXPECT_EQ(last_msg_.biases[35].code, 59) + << "incorrect value for last_msg_.biases[35].code, expected 59, is " + << last_msg_.biases[35].code; + EXPECT_EQ(last_msg_.biases[35].value, -19362) + << "incorrect value for last_msg_.biases[35].value, expected -19362, is " + << last_msg_.biases[35].value; + EXPECT_EQ(last_msg_.biases[36].code, 195) + << "incorrect value for last_msg_.biases[36].code, expected 195, is " + << last_msg_.biases[36].code; + EXPECT_EQ(last_msg_.biases[36].value, 17821) + << "incorrect value for last_msg_.biases[36].value, expected 17821, is " + << last_msg_.biases[36].value; + EXPECT_EQ(last_msg_.biases[37].code, 100) + << "incorrect value for last_msg_.biases[37].code, expected 100, is " + << last_msg_.biases[37].code; + EXPECT_EQ(last_msg_.biases[37].value, 4215) + << "incorrect value for last_msg_.biases[37].value, expected 4215, is " + << last_msg_.biases[37].value; + EXPECT_EQ(last_msg_.biases[38].code, 68) + << "incorrect value for last_msg_.biases[38].code, expected 68, is " + << last_msg_.biases[38].code; + EXPECT_EQ(last_msg_.biases[38].value, -20557) + << "incorrect value for last_msg_.biases[38].value, expected -20557, is " + << last_msg_.biases[38].value; + EXPECT_EQ(last_msg_.biases[39].code, 144) + << "incorrect value for last_msg_.biases[39].code, expected 144, is " + << last_msg_.biases[39].code; + EXPECT_EQ(last_msg_.biases[39].value, 20849) + << "incorrect value for last_msg_.biases[39].value, expected 20849, is " + << last_msg_.biases[39].value; + EXPECT_EQ(last_msg_.biases[40].code, 82) + << "incorrect value for last_msg_.biases[40].code, expected 82, is " + << last_msg_.biases[40].code; + EXPECT_EQ(last_msg_.biases[40].value, -26850) + << "incorrect value for last_msg_.biases[40].value, expected -26850, is " + << last_msg_.biases[40].value; + EXPECT_EQ(last_msg_.biases[41].code, 21) + << "incorrect value for last_msg_.biases[41].code, expected 21, is " + << last_msg_.biases[41].code; + EXPECT_EQ(last_msg_.biases[41].value, 10605) + << "incorrect value for last_msg_.biases[41].value, expected 10605, is " + << last_msg_.biases[41].value; + EXPECT_EQ(last_msg_.biases[42].code, 225) + << "incorrect value for last_msg_.biases[42].code, expected 225, is " + << last_msg_.biases[42].code; + EXPECT_EQ(last_msg_.biases[42].value, 19720) + << "incorrect value for last_msg_.biases[42].value, expected 19720, is " + << last_msg_.biases[42].value; + EXPECT_EQ(last_msg_.biases[43].code, 164) + << "incorrect value for last_msg_.biases[43].code, expected 164, is " + << last_msg_.biases[43].code; + EXPECT_EQ(last_msg_.biases[43].value, 157) + << "incorrect value for last_msg_.biases[43].value, expected 157, is " + << last_msg_.biases[43].value; + EXPECT_EQ(last_msg_.biases[44].code, 73) + << "incorrect value for last_msg_.biases[44].code, expected 73, is " + << last_msg_.biases[44].code; + EXPECT_EQ(last_msg_.biases[44].value, 1566) + << "incorrect value for last_msg_.biases[44].value, expected 1566, is " + << last_msg_.biases[44].value; + EXPECT_EQ(last_msg_.biases[45].code, 78) + << "incorrect value for last_msg_.biases[45].code, expected 78, is " + << last_msg_.biases[45].code; + EXPECT_EQ(last_msg_.biases[45].value, -28847) + << "incorrect value for last_msg_.biases[45].value, expected -28847, is " + << last_msg_.biases[45].value; + EXPECT_EQ(last_msg_.biases[46].code, 116) + << "incorrect value for last_msg_.biases[46].code, expected 116, is " + << last_msg_.biases[46].code; + EXPECT_EQ(last_msg_.biases[46].value, -26640) + << "incorrect value for last_msg_.biases[46].value, expected -26640, is " + << last_msg_.biases[46].value; + EXPECT_EQ(last_msg_.biases[47].code, 55) + << "incorrect value for last_msg_.biases[47].code, expected 55, is " + << last_msg_.biases[47].code; + EXPECT_EQ(last_msg_.biases[47].value, -22087) + << "incorrect value for last_msg_.biases[47].value, expected -22087, is " + << last_msg_.biases[47].value; + EXPECT_EQ(last_msg_.biases[48].code, 254) + << "incorrect value for last_msg_.biases[48].code, expected 254, is " + << last_msg_.biases[48].code; + EXPECT_EQ(last_msg_.biases[48].value, 10035) + << "incorrect value for last_msg_.biases[48].value, expected 10035, is " + << last_msg_.biases[48].value; + EXPECT_EQ(last_msg_.biases[49].code, 74) + << "incorrect value for last_msg_.biases[49].code, expected 74, is " + << last_msg_.biases[49].code; + EXPECT_EQ(last_msg_.biases[49].value, -2129) + << "incorrect value for last_msg_.biases[49].value, expected -2129, is " + << last_msg_.biases[49].value; + EXPECT_EQ(last_msg_.biases[50].code, 34) + << "incorrect value for last_msg_.biases[50].code, expected 34, is " + << last_msg_.biases[50].code; + EXPECT_EQ(last_msg_.biases[50].value, 19041) + << "incorrect value for last_msg_.biases[50].value, expected 19041, is " + << last_msg_.biases[50].value; + EXPECT_EQ(last_msg_.biases[51].code, 97) + << "incorrect value for last_msg_.biases[51].code, expected 97, is " + << last_msg_.biases[51].code; + EXPECT_EQ(last_msg_.biases[51].value, 12464) + << "incorrect value for last_msg_.biases[51].value, expected 12464, is " + << last_msg_.biases[51].value; + EXPECT_EQ(last_msg_.biases[52].code, 236) + << "incorrect value for last_msg_.biases[52].code, expected 236, is " + << last_msg_.biases[52].code; + EXPECT_EQ(last_msg_.biases[52].value, 3245) + << "incorrect value for last_msg_.biases[52].value, expected 3245, is " + << last_msg_.biases[52].value; + EXPECT_EQ(last_msg_.biases[53].code, 174) + << "incorrect value for last_msg_.biases[53].code, expected 174, is " + << last_msg_.biases[53].code; + EXPECT_EQ(last_msg_.biases[53].value, -32155) + << "incorrect value for last_msg_.biases[53].value, expected -32155, is " + << last_msg_.biases[53].value; + EXPECT_EQ(last_msg_.biases[54].code, 30) + << "incorrect value for last_msg_.biases[54].code, expected 30, is " + << last_msg_.biases[54].code; + EXPECT_EQ(last_msg_.biases[54].value, -15959) + << "incorrect value for last_msg_.biases[54].value, expected -15959, is " + << last_msg_.biases[54].value; + EXPECT_EQ(last_msg_.biases[55].code, 190) + << "incorrect value for last_msg_.biases[55].code, expected 190, is " + << last_msg_.biases[55].code; + EXPECT_EQ(last_msg_.biases[55].value, -15156) + << "incorrect value for last_msg_.biases[55].value, expected -15156, is " + << last_msg_.biases[55].value; + EXPECT_EQ(last_msg_.biases[56].code, 123) + << "incorrect value for last_msg_.biases[56].code, expected 123, is " + << last_msg_.biases[56].code; + EXPECT_EQ(last_msg_.biases[56].value, 6507) + << "incorrect value for last_msg_.biases[56].value, expected 6507, is " + << last_msg_.biases[56].value; + EXPECT_EQ(last_msg_.biases[57].code, 225) + << "incorrect value for last_msg_.biases[57].code, expected 225, is " + << last_msg_.biases[57].code; + EXPECT_EQ(last_msg_.biases[57].value, 2378) + << "incorrect value for last_msg_.biases[57].value, expected 2378, is " + << last_msg_.biases[57].value; + EXPECT_EQ(last_msg_.biases[58].code, 10) + << "incorrect value for last_msg_.biases[58].code, expected 10, is " + << last_msg_.biases[58].code; + EXPECT_EQ(last_msg_.biases[58].value, 823) + << "incorrect value for last_msg_.biases[58].value, expected 823, is " + << last_msg_.biases[58].value; + EXPECT_EQ(last_msg_.biases[59].code, 131) + << "incorrect value for last_msg_.biases[59].code, expected 131, is " + << last_msg_.biases[59].code; + EXPECT_EQ(last_msg_.biases[59].value, 25590) + << "incorrect value for last_msg_.biases[59].value, expected 25590, is " + << last_msg_.biases[59].value; + EXPECT_EQ(last_msg_.biases[60].code, 133) + << "incorrect value for last_msg_.biases[60].code, expected 133, is " + << last_msg_.biases[60].code; + EXPECT_EQ(last_msg_.biases[60].value, -7390) + << "incorrect value for last_msg_.biases[60].value, expected -7390, is " + << last_msg_.biases[60].value; + EXPECT_EQ(last_msg_.biases[61].code, 203) + << "incorrect value for last_msg_.biases[61].code, expected 203, is " + << last_msg_.biases[61].code; + EXPECT_EQ(last_msg_.biases[61].value, 4676) + << "incorrect value for last_msg_.biases[61].value, expected 4676, is " + << last_msg_.biases[61].value; + EXPECT_EQ(last_msg_.biases[62].code, 97) + << "incorrect value for last_msg_.biases[62].code, expected 97, is " + << last_msg_.biases[62].code; + EXPECT_EQ(last_msg_.biases[62].value, 23007) + << "incorrect value for last_msg_.biases[62].value, expected 23007, is " + << last_msg_.biases[62].value; + EXPECT_EQ(last_msg_.biases[63].code, 192) + << "incorrect value for last_msg_.biases[63].code, expected 192, is " + << last_msg_.biases[63].code; + EXPECT_EQ(last_msg_.biases[63].value, 13046) + << "incorrect value for last_msg_.biases[63].value, expected 13046, is " + << last_msg_.biases[63].value; + EXPECT_EQ(last_msg_.biases[64].code, 69) + << "incorrect value for last_msg_.biases[64].code, expected 69, is " + << last_msg_.biases[64].code; + EXPECT_EQ(last_msg_.biases[64].value, 2651) + << "incorrect value for last_msg_.biases[64].value, expected 2651, is " + << last_msg_.biases[64].value; + EXPECT_EQ(last_msg_.biases[65].code, 151) + << "incorrect value for last_msg_.biases[65].code, expected 151, is " + << last_msg_.biases[65].code; + EXPECT_EQ(last_msg_.biases[65].value, 30282) + << "incorrect value for last_msg_.biases[65].value, expected 30282, is " + << last_msg_.biases[65].value; + EXPECT_EQ(last_msg_.biases[66].code, 110) + << "incorrect value for last_msg_.biases[66].code, expected 110, is " + << last_msg_.biases[66].code; + EXPECT_EQ(last_msg_.biases[66].value, -22492) + << "incorrect value for last_msg_.biases[66].value, expected -22492, is " + << last_msg_.biases[66].value; + EXPECT_EQ(last_msg_.biases[67].code, 247) + << "incorrect value for last_msg_.biases[67].code, expected 247, is " + << last_msg_.biases[67].code; + EXPECT_EQ(last_msg_.biases[67].value, 19872) + << "incorrect value for last_msg_.biases[67].value, expected 19872, is " + << last_msg_.biases[67].value; + EXPECT_EQ(last_msg_.biases[68].code, 179) + << "incorrect value for last_msg_.biases[68].code, expected 179, is " + << last_msg_.biases[68].code; + EXPECT_EQ(last_msg_.biases[68].value, -19827) + << "incorrect value for last_msg_.biases[68].value, expected -19827, is " + << last_msg_.biases[68].value; + EXPECT_EQ(last_msg_.biases[69].code, 99) + << "incorrect value for last_msg_.biases[69].code, expected 99, is " + << last_msg_.biases[69].code; + EXPECT_EQ(last_msg_.biases[69].value, 30911) + << "incorrect value for last_msg_.biases[69].value, expected 30911, is " + << last_msg_.biases[69].value; + EXPECT_EQ(last_msg_.biases[70].code, 77) + << "incorrect value for last_msg_.biases[70].code, expected 77, is " + << last_msg_.biases[70].code; + EXPECT_EQ(last_msg_.biases[70].value, 23488) + << "incorrect value for last_msg_.biases[70].value, expected 23488, is " + << last_msg_.biases[70].value; + EXPECT_EQ(last_msg_.biases[71].code, 224) + << "incorrect value for last_msg_.biases[71].code, expected 224, is " + << last_msg_.biases[71].code; + EXPECT_EQ(last_msg_.biases[71].value, -7679) + << "incorrect value for last_msg_.biases[71].value, expected -7679, is " + << last_msg_.biases[71].value; + EXPECT_EQ(last_msg_.biases[72].code, 50) + << "incorrect value for last_msg_.biases[72].code, expected 50, is " + << last_msg_.biases[72].code; + EXPECT_EQ(last_msg_.biases[72].value, -28073) + << "incorrect value for last_msg_.biases[72].value, expected -28073, is " + << last_msg_.biases[72].value; + EXPECT_EQ(last_msg_.biases[73].code, 148) + << "incorrect value for last_msg_.biases[73].code, expected 148, is " + << last_msg_.biases[73].code; + EXPECT_EQ(last_msg_.biases[73].value, 25838) + << "incorrect value for last_msg_.biases[73].value, expected 25838, is " + << last_msg_.biases[73].value; + EXPECT_EQ(last_msg_.biases[74].code, 179) + << "incorrect value for last_msg_.biases[74].code, expected 179, is " + << last_msg_.biases[74].code; + EXPECT_EQ(last_msg_.biases[74].value, -7299) + << "incorrect value for last_msg_.biases[74].value, expected -7299, is " + << last_msg_.biases[74].value; + EXPECT_EQ(last_msg_.biases[75].code, 215) + << "incorrect value for last_msg_.biases[75].code, expected 215, is " + << last_msg_.biases[75].code; + EXPECT_EQ(last_msg_.biases[75].value, -18328) + << "incorrect value for last_msg_.biases[75].value, expected -18328, is " + << last_msg_.biases[75].value; + EXPECT_EQ(last_msg_.biases[76].code, 31) + << "incorrect value for last_msg_.biases[76].code, expected 31, is " + << last_msg_.biases[76].code; + EXPECT_EQ(last_msg_.biases[76].value, 23097) + << "incorrect value for last_msg_.biases[76].value, expected 23097, is " + << last_msg_.biases[76].value; + EXPECT_EQ(last_msg_.biases[77].code, 79) + << "incorrect value for last_msg_.biases[77].code, expected 79, is " + << last_msg_.biases[77].code; + EXPECT_EQ(last_msg_.biases[77].value, -25579) + << "incorrect value for last_msg_.biases[77].value, expected -25579, is " + << last_msg_.biases[77].value; + EXPECT_EQ(last_msg_.biases[78].code, 245) + << "incorrect value for last_msg_.biases[78].code, expected 245, is " + << last_msg_.biases[78].code; + EXPECT_EQ(last_msg_.biases[78].value, 15441) + << "incorrect value for last_msg_.biases[78].value, expected 15441, is " + << last_msg_.biases[78].value; + EXPECT_EQ(last_msg_.biases[79].code, 93) + << "incorrect value for last_msg_.biases[79].code, expected 93, is " + << last_msg_.biases[79].code; + EXPECT_EQ(last_msg_.biases[79].value, 15530) + << "incorrect value for last_msg_.biases[79].value, expected 15530, is " + << last_msg_.biases[79].value; + EXPECT_EQ(last_msg_.biases[80].code, 200) + << "incorrect value for last_msg_.biases[80].code, expected 200, is " + << last_msg_.biases[80].code; + EXPECT_EQ(last_msg_.biases[80].value, 3495) + << "incorrect value for last_msg_.biases[80].value, expected 3495, is " + << last_msg_.biases[80].value; + EXPECT_EQ(last_msg_.iod_ssr, 132) + << "incorrect value for last_msg_.iod_ssr, expected 132, is " + << last_msg_.iod_ssr; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_biases.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_biases.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_biases.handle_as << "'"; + } + { + const char check_string[] = {(char)98, (char)105, (char)97, + (char)115, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_biases.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_biases.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.n_biases.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_biases.value, 81) + << "incorrect value for last_msg_.n_biases.value, expected 81, is " + << last_msg_.n_biases.value; + EXPECT_EQ(last_msg_.sid.code, 241) + << "incorrect value for last_msg_.sid.code, expected 241, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.sat, 133) + << "incorrect value for last_msg_.sid.sat, expected 133, is " + << last_msg_.sid.sat; + EXPECT_EQ(last_msg_.time.tow, 387144400) + << "incorrect value for last_msg_.time.tow, expected 387144400, is " + << last_msg_.time.tow; + EXPECT_EQ(last_msg_.time.wn, 16905) + << "incorrect value for last_msg_.time.wn, expected 16905, is " + << last_msg_.time.wn; + EXPECT_EQ(last_msg_.update_interval, 254) + << "incorrect value for last_msg_.update_interval, expected 254, is " + << last_msg_.update_interval; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.cc index 625c6e1a7..199dfe579 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.cc @@ -10,60 +10,57 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodePhaseBiasesBounds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodePhaseBiasesBounds.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_code_phase_biases_bounds_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_ssr_code_phase_biases_bounds_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,103 +68,200 @@ class Test_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds0 : sbp_msg_ssr_code_phase_biases_bounds_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds0, Test) -{ +}; - uint8_t encoded_frame[] = {85,236,5,66,0,31,180,0,0,0,3,0,1,2,1,14,15,1,3,0,3,39,1,39,1,1,3,39,1,39,1,1,1,39,1,39,1,23,113, }; +TEST_F(Test_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds0, Test) { + uint8_t encoded_frame[] = { + 85, 236, 5, 66, 0, 31, 180, 0, 0, 0, 3, 0, 1, 2, 1, 14, 15, 1, 3, 0, + 3, 39, 1, 39, 1, 1, 3, 39, 1, 39, 1, 1, 1, 39, 1, 39, 1, 23, 113, + }; - sbp_msg_ssr_code_phase_biases_bounds_t test_msg{}; - test_msg.const_id = 1; - test_msg.header.num_msgs = 1; - test_msg.header.seq_num = 2; - test_msg.header.sol_id = 14; - test_msg.header.time.tow = 180; - test_msg.header.time.wn = 3; - test_msg.header.update_interval = 1; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_sats_signals.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)97,(char)116,(char)101,(char)108,(char)108,(char)105,(char)116,(char)101,(char)115,(char)95,(char)115,(char)105,(char)103,(char)110,(char)97,(char)108,(char)115 }; - memcpy(test_msg.n_sats_signals.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_sats_signals.value = 3; - - test_msg.satellites_signals[0].code_bias_bound_mu = 39; - test_msg.satellites_signals[0].code_bias_bound_sig = 1; - test_msg.satellites_signals[0].phase_bias_bound_mu = 39; - test_msg.satellites_signals[0].phase_bias_bound_sig = 1; - test_msg.satellites_signals[0].sat_id = 0; - test_msg.satellites_signals[0].signal_id = 3; - - test_msg.satellites_signals[1].code_bias_bound_mu = 39; - test_msg.satellites_signals[1].code_bias_bound_sig = 1; - test_msg.satellites_signals[1].phase_bias_bound_mu = 39; - test_msg.satellites_signals[1].phase_bias_bound_sig = 1; - test_msg.satellites_signals[1].sat_id = 1; - test_msg.satellites_signals[1].signal_id = 3; - - test_msg.satellites_signals[2].code_bias_bound_mu = 39; - test_msg.satellites_signals[2].code_bias_bound_sig = 1; - test_msg.satellites_signals[2].phase_bias_bound_mu = 39; - test_msg.satellites_signals[2].phase_bias_bound_sig = 1; - test_msg.satellites_signals[2].sat_id = 1; - test_msg.satellites_signals[2].signal_id = 1; - test_msg.ssr_iod = 15; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + sbp_msg_ssr_code_phase_biases_bounds_t test_msg{}; + test_msg.const_id = 1; + test_msg.header.num_msgs = 1; + test_msg.header.seq_num = 2; + test_msg.header.sol_id = 14; + test_msg.header.time.tow = 180; + test_msg.header.time.wn = 3; + test_msg.header.update_interval = 1; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_sats_signals.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = { + (char)115, (char)97, (char)116, (char)101, (char)108, (char)108, + (char)105, (char)116, (char)101, (char)115, (char)95, (char)115, + (char)105, (char)103, (char)110, (char)97, (char)108, (char)115}; + memcpy(test_msg.n_sats_signals.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_sats_signals.value = 3; + + test_msg.satellites_signals[0].code_bias_bound_mu = 39; + test_msg.satellites_signals[0].code_bias_bound_sig = 1; + test_msg.satellites_signals[0].phase_bias_bound_mu = 39; + test_msg.satellites_signals[0].phase_bias_bound_sig = 1; + test_msg.satellites_signals[0].sat_id = 0; + test_msg.satellites_signals[0].signal_id = 3; + + test_msg.satellites_signals[1].code_bias_bound_mu = 39; + test_msg.satellites_signals[1].code_bias_bound_sig = 1; + test_msg.satellites_signals[1].phase_bias_bound_mu = 39; + test_msg.satellites_signals[1].phase_bias_bound_sig = 1; + test_msg.satellites_signals[1].sat_id = 1; + test_msg.satellites_signals[1].signal_id = 3; + + test_msg.satellites_signals[2].code_bias_bound_mu = 39; + test_msg.satellites_signals[2].code_bias_bound_sig = 1; + test_msg.satellites_signals[2].phase_bias_bound_mu = 39; + test_msg.satellites_signals[2].phase_bias_bound_sig = 1; + test_msg.satellites_signals[2].sat_id = 1; + test_msg.satellites_signals[2].signal_id = 1; + test_msg.ssr_iod = 15; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.const_id, 1) << "incorrect value for last_msg_.const_id, expected 1, is " << last_msg_.const_id; - EXPECT_EQ(last_msg_.header.num_msgs, 1) << "incorrect value for last_msg_.header.num_msgs, expected 1, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.seq_num, 2) << "incorrect value for last_msg_.header.seq_num, expected 2, is " << last_msg_.header.seq_num; - EXPECT_EQ(last_msg_.header.sol_id, 14) << "incorrect value for last_msg_.header.sol_id, expected 14, is " << last_msg_.header.sol_id; - EXPECT_EQ(last_msg_.header.time.tow, 180) << "incorrect value for last_msg_.header.time.tow, expected 180, is " << last_msg_.header.time.tow; - EXPECT_EQ(last_msg_.header.time.wn, 3) << "incorrect value for last_msg_.header.time.wn, expected 3, is " << last_msg_.header.time.wn; - EXPECT_EQ(last_msg_.header.update_interval, 1) << "incorrect value for last_msg_.header.update_interval, expected 1, is " << last_msg_.header.update_interval; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_sats_signals.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_sats_signals.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_sats_signals.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)97,(char)116,(char)101,(char)108,(char)108,(char)105,(char)116,(char)101,(char)115,(char)95,(char)115,(char)105,(char)103,(char)110,(char)97,(char)108,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_sats_signals.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_sats_signals.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_sats_signals.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_sats_signals.value, 3) << "incorrect value for last_msg_.n_sats_signals.value, expected 3, is " << last_msg_.n_sats_signals.value; - EXPECT_EQ(last_msg_.satellites_signals[0].code_bias_bound_mu, 39) << "incorrect value for last_msg_.satellites_signals[0].code_bias_bound_mu, expected 39, is " << last_msg_.satellites_signals[0].code_bias_bound_mu; - EXPECT_EQ(last_msg_.satellites_signals[0].code_bias_bound_sig, 1) << "incorrect value for last_msg_.satellites_signals[0].code_bias_bound_sig, expected 1, is " << last_msg_.satellites_signals[0].code_bias_bound_sig; - EXPECT_EQ(last_msg_.satellites_signals[0].phase_bias_bound_mu, 39) << "incorrect value for last_msg_.satellites_signals[0].phase_bias_bound_mu, expected 39, is " << last_msg_.satellites_signals[0].phase_bias_bound_mu; - EXPECT_EQ(last_msg_.satellites_signals[0].phase_bias_bound_sig, 1) << "incorrect value for last_msg_.satellites_signals[0].phase_bias_bound_sig, expected 1, is " << last_msg_.satellites_signals[0].phase_bias_bound_sig; - EXPECT_EQ(last_msg_.satellites_signals[0].sat_id, 0) << "incorrect value for last_msg_.satellites_signals[0].sat_id, expected 0, is " << last_msg_.satellites_signals[0].sat_id; - EXPECT_EQ(last_msg_.satellites_signals[0].signal_id, 3) << "incorrect value for last_msg_.satellites_signals[0].signal_id, expected 3, is " << last_msg_.satellites_signals[0].signal_id; - EXPECT_EQ(last_msg_.satellites_signals[1].code_bias_bound_mu, 39) << "incorrect value for last_msg_.satellites_signals[1].code_bias_bound_mu, expected 39, is " << last_msg_.satellites_signals[1].code_bias_bound_mu; - EXPECT_EQ(last_msg_.satellites_signals[1].code_bias_bound_sig, 1) << "incorrect value for last_msg_.satellites_signals[1].code_bias_bound_sig, expected 1, is " << last_msg_.satellites_signals[1].code_bias_bound_sig; - EXPECT_EQ(last_msg_.satellites_signals[1].phase_bias_bound_mu, 39) << "incorrect value for last_msg_.satellites_signals[1].phase_bias_bound_mu, expected 39, is " << last_msg_.satellites_signals[1].phase_bias_bound_mu; - EXPECT_EQ(last_msg_.satellites_signals[1].phase_bias_bound_sig, 1) << "incorrect value for last_msg_.satellites_signals[1].phase_bias_bound_sig, expected 1, is " << last_msg_.satellites_signals[1].phase_bias_bound_sig; - EXPECT_EQ(last_msg_.satellites_signals[1].sat_id, 1) << "incorrect value for last_msg_.satellites_signals[1].sat_id, expected 1, is " << last_msg_.satellites_signals[1].sat_id; - EXPECT_EQ(last_msg_.satellites_signals[1].signal_id, 3) << "incorrect value for last_msg_.satellites_signals[1].signal_id, expected 3, is " << last_msg_.satellites_signals[1].signal_id; - EXPECT_EQ(last_msg_.satellites_signals[2].code_bias_bound_mu, 39) << "incorrect value for last_msg_.satellites_signals[2].code_bias_bound_mu, expected 39, is " << last_msg_.satellites_signals[2].code_bias_bound_mu; - EXPECT_EQ(last_msg_.satellites_signals[2].code_bias_bound_sig, 1) << "incorrect value for last_msg_.satellites_signals[2].code_bias_bound_sig, expected 1, is " << last_msg_.satellites_signals[2].code_bias_bound_sig; - EXPECT_EQ(last_msg_.satellites_signals[2].phase_bias_bound_mu, 39) << "incorrect value for last_msg_.satellites_signals[2].phase_bias_bound_mu, expected 39, is " << last_msg_.satellites_signals[2].phase_bias_bound_mu; - EXPECT_EQ(last_msg_.satellites_signals[2].phase_bias_bound_sig, 1) << "incorrect value for last_msg_.satellites_signals[2].phase_bias_bound_sig, expected 1, is " << last_msg_.satellites_signals[2].phase_bias_bound_sig; - EXPECT_EQ(last_msg_.satellites_signals[2].sat_id, 1) << "incorrect value for last_msg_.satellites_signals[2].sat_id, expected 1, is " << last_msg_.satellites_signals[2].sat_id; - EXPECT_EQ(last_msg_.satellites_signals[2].signal_id, 1) << "incorrect value for last_msg_.satellites_signals[2].signal_id, expected 1, is " << last_msg_.satellites_signals[2].signal_id; - EXPECT_EQ(last_msg_.ssr_iod, 15) << "incorrect value for last_msg_.ssr_iod, expected 15, is " << last_msg_.ssr_iod; + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.const_id, 1) + << "incorrect value for last_msg_.const_id, expected 1, is " + << last_msg_.const_id; + EXPECT_EQ(last_msg_.header.num_msgs, 1) + << "incorrect value for last_msg_.header.num_msgs, expected 1, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.seq_num, 2) + << "incorrect value for last_msg_.header.seq_num, expected 2, is " + << last_msg_.header.seq_num; + EXPECT_EQ(last_msg_.header.sol_id, 14) + << "incorrect value for last_msg_.header.sol_id, expected 14, is " + << last_msg_.header.sol_id; + EXPECT_EQ(last_msg_.header.time.tow, 180) + << "incorrect value for last_msg_.header.time.tow, expected 180, is " + << last_msg_.header.time.tow; + EXPECT_EQ(last_msg_.header.time.wn, 3) + << "incorrect value for last_msg_.header.time.wn, expected 3, is " + << last_msg_.header.time.wn; + EXPECT_EQ(last_msg_.header.update_interval, 1) + << "incorrect value for last_msg_.header.update_interval, expected 1, is " + << last_msg_.header.update_interval; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_sats_signals.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_sats_signals.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_sats_signals.handle_as + << "'"; + } + { + const char check_string[] = { + (char)115, (char)97, (char)116, (char)101, (char)108, (char)108, + (char)105, (char)116, (char)101, (char)115, (char)95, (char)115, + (char)105, (char)103, (char)110, (char)97, (char)108, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_sats_signals.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_sats_signals.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_sats_signals.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_sats_signals.value, 3) + << "incorrect value for last_msg_.n_sats_signals.value, expected 3, is " + << last_msg_.n_sats_signals.value; + EXPECT_EQ(last_msg_.satellites_signals[0].code_bias_bound_mu, 39) + << "incorrect value for " + "last_msg_.satellites_signals[0].code_bias_bound_mu, expected 39, is " + << last_msg_.satellites_signals[0].code_bias_bound_mu; + EXPECT_EQ(last_msg_.satellites_signals[0].code_bias_bound_sig, 1) + << "incorrect value for " + "last_msg_.satellites_signals[0].code_bias_bound_sig, expected 1, is " + << last_msg_.satellites_signals[0].code_bias_bound_sig; + EXPECT_EQ(last_msg_.satellites_signals[0].phase_bias_bound_mu, 39) + << "incorrect value for " + "last_msg_.satellites_signals[0].phase_bias_bound_mu, expected 39, is " + << last_msg_.satellites_signals[0].phase_bias_bound_mu; + EXPECT_EQ(last_msg_.satellites_signals[0].phase_bias_bound_sig, 1) + << "incorrect value for " + "last_msg_.satellites_signals[0].phase_bias_bound_sig, expected 1, is " + << last_msg_.satellites_signals[0].phase_bias_bound_sig; + EXPECT_EQ(last_msg_.satellites_signals[0].sat_id, 0) + << "incorrect value for last_msg_.satellites_signals[0].sat_id, expected " + "0, is " + << last_msg_.satellites_signals[0].sat_id; + EXPECT_EQ(last_msg_.satellites_signals[0].signal_id, 3) + << "incorrect value for last_msg_.satellites_signals[0].signal_id, " + "expected 3, is " + << last_msg_.satellites_signals[0].signal_id; + EXPECT_EQ(last_msg_.satellites_signals[1].code_bias_bound_mu, 39) + << "incorrect value for " + "last_msg_.satellites_signals[1].code_bias_bound_mu, expected 39, is " + << last_msg_.satellites_signals[1].code_bias_bound_mu; + EXPECT_EQ(last_msg_.satellites_signals[1].code_bias_bound_sig, 1) + << "incorrect value for " + "last_msg_.satellites_signals[1].code_bias_bound_sig, expected 1, is " + << last_msg_.satellites_signals[1].code_bias_bound_sig; + EXPECT_EQ(last_msg_.satellites_signals[1].phase_bias_bound_mu, 39) + << "incorrect value for " + "last_msg_.satellites_signals[1].phase_bias_bound_mu, expected 39, is " + << last_msg_.satellites_signals[1].phase_bias_bound_mu; + EXPECT_EQ(last_msg_.satellites_signals[1].phase_bias_bound_sig, 1) + << "incorrect value for " + "last_msg_.satellites_signals[1].phase_bias_bound_sig, expected 1, is " + << last_msg_.satellites_signals[1].phase_bias_bound_sig; + EXPECT_EQ(last_msg_.satellites_signals[1].sat_id, 1) + << "incorrect value for last_msg_.satellites_signals[1].sat_id, expected " + "1, is " + << last_msg_.satellites_signals[1].sat_id; + EXPECT_EQ(last_msg_.satellites_signals[1].signal_id, 3) + << "incorrect value for last_msg_.satellites_signals[1].signal_id, " + "expected 3, is " + << last_msg_.satellites_signals[1].signal_id; + EXPECT_EQ(last_msg_.satellites_signals[2].code_bias_bound_mu, 39) + << "incorrect value for " + "last_msg_.satellites_signals[2].code_bias_bound_mu, expected 39, is " + << last_msg_.satellites_signals[2].code_bias_bound_mu; + EXPECT_EQ(last_msg_.satellites_signals[2].code_bias_bound_sig, 1) + << "incorrect value for " + "last_msg_.satellites_signals[2].code_bias_bound_sig, expected 1, is " + << last_msg_.satellites_signals[2].code_bias_bound_sig; + EXPECT_EQ(last_msg_.satellites_signals[2].phase_bias_bound_mu, 39) + << "incorrect value for " + "last_msg_.satellites_signals[2].phase_bias_bound_mu, expected 39, is " + << last_msg_.satellites_signals[2].phase_bias_bound_mu; + EXPECT_EQ(last_msg_.satellites_signals[2].phase_bias_bound_sig, 1) + << "incorrect value for " + "last_msg_.satellites_signals[2].phase_bias_bound_sig, expected 1, is " + << last_msg_.satellites_signals[2].phase_bias_bound_sig; + EXPECT_EQ(last_msg_.satellites_signals[2].sat_id, 1) + << "incorrect value for last_msg_.satellites_signals[2].sat_id, expected " + "1, is " + << last_msg_.satellites_signals[2].sat_id; + EXPECT_EQ(last_msg_.satellites_signals[2].signal_id, 1) + << "incorrect value for last_msg_.satellites_signals[2].signal_id, " + "expected 1, is " + << last_msg_.satellites_signals[2].signal_id; + EXPECT_EQ(last_msg_.ssr_iod, 15) + << "incorrect value for last_msg_.ssr_iod, expected 15, is " + << last_msg_.ssr_iod; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.cc index a1e656a34..74d5ac3ee 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGridDefinitionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGridDefinitionDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_grid_definition_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_grid_definition_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,798 +67,1341 @@ class Test_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA0 : sbp_msg_ssr_grid_definition_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,245,5,181,247,255,11,84,171,229,132,143,46,204,52,92,104,25,204,182,22,98,203,123,211,38,13,253,129,173,171,235,253,26,203,3,120,126,42,44,39,87,69,154,13,28,179,32,47,36,195,39,198,134,235,134,57,120,243,151,35,17,201,211,125,117,164,142,101,239,144,158,239,90,56,71,120,67,221,114,10,190,4,230,164,171,78,185,90,46,177,82,228,123,222,227,145,195,219,27,56,227,246,215,144,158,31,214,241,254,200,86,142,89,12,121,29,124,9,19,153,44,35,126,14,217,65,116,26,139,122,114,90,124,81,0,186,246,46,98,179,243,198,217,36,30,202,12,135,61,42,150,221,102,83,179,43,252,81,62,126,204,195,238,18,128,193,53,94,99,63,182,2,186,220,77,186,224,220,13,212,182,88,15,151,5,93,251,164,18,228,168,226,195,44,170,145,36,58,96,107,144,11,228,12,163,238,247,159,189,1,115,65,202,121,47,193,11,96,93,72,81,207,121,19,151,136,233,51,133,195,77,44,147,206,120,252,77,212,68,60,206,106,207,243,158,94,6,3,205,92,84,2,220,50,61,38,141,117,108,101,76,139, }; - - sbp_msg_ssr_grid_definition_dep_a_t test_msg{}; - test_msg.header.area_width = 43860; - test_msg.header.lat_nw_corner_enc = 34021; - test_msg.header.lon_nw_corner_enc = 11919; - test_msg.header.num_msgs = 204; - test_msg.header.region_size_inverse = 11; - test_msg.header.seq_num = 52; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_rle_list.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)114,(char)108,(char)101,(char)95,(char)108,(char)105,(char)115,(char)116 }; - memcpy(test_msg.n_rle_list.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_rle_list.value = 246; - - test_msg.rle_list[0] = 92; - - test_msg.rle_list[1] = 104; - - test_msg.rle_list[2] = 25; - - test_msg.rle_list[3] = 204; - - test_msg.rle_list[4] = 182; - - test_msg.rle_list[5] = 22; - - test_msg.rle_list[6] = 98; - - test_msg.rle_list[7] = 203; - - test_msg.rle_list[8] = 123; - - test_msg.rle_list[9] = 211; - - test_msg.rle_list[10] = 38; - - test_msg.rle_list[11] = 13; - - test_msg.rle_list[12] = 253; - - test_msg.rle_list[13] = 129; - - test_msg.rle_list[14] = 173; - - test_msg.rle_list[15] = 171; - - test_msg.rle_list[16] = 235; - - test_msg.rle_list[17] = 253; - - test_msg.rle_list[18] = 26; - - test_msg.rle_list[19] = 203; - - test_msg.rle_list[20] = 3; - - test_msg.rle_list[21] = 120; - - test_msg.rle_list[22] = 126; - - test_msg.rle_list[23] = 42; - - test_msg.rle_list[24] = 44; - - test_msg.rle_list[25] = 39; - - test_msg.rle_list[26] = 87; - - test_msg.rle_list[27] = 69; - - test_msg.rle_list[28] = 154; - - test_msg.rle_list[29] = 13; - - test_msg.rle_list[30] = 28; - - test_msg.rle_list[31] = 179; - - test_msg.rle_list[32] = 32; - - test_msg.rle_list[33] = 47; - - test_msg.rle_list[34] = 36; - - test_msg.rle_list[35] = 195; - - test_msg.rle_list[36] = 39; - - test_msg.rle_list[37] = 198; - - test_msg.rle_list[38] = 134; - - test_msg.rle_list[39] = 235; - - test_msg.rle_list[40] = 134; - - test_msg.rle_list[41] = 57; - - test_msg.rle_list[42] = 120; - - test_msg.rle_list[43] = 243; - - test_msg.rle_list[44] = 151; - - test_msg.rle_list[45] = 35; - - test_msg.rle_list[46] = 17; - - test_msg.rle_list[47] = 201; - - test_msg.rle_list[48] = 211; - - test_msg.rle_list[49] = 125; - - test_msg.rle_list[50] = 117; - - test_msg.rle_list[51] = 164; - - test_msg.rle_list[52] = 142; - - test_msg.rle_list[53] = 101; - - test_msg.rle_list[54] = 239; - - test_msg.rle_list[55] = 144; - - test_msg.rle_list[56] = 158; - - test_msg.rle_list[57] = 239; - - test_msg.rle_list[58] = 90; - - test_msg.rle_list[59] = 56; - - test_msg.rle_list[60] = 71; - - test_msg.rle_list[61] = 120; - - test_msg.rle_list[62] = 67; - - test_msg.rle_list[63] = 221; - - test_msg.rle_list[64] = 114; - - test_msg.rle_list[65] = 10; - - test_msg.rle_list[66] = 190; - - test_msg.rle_list[67] = 4; - - test_msg.rle_list[68] = 230; - - test_msg.rle_list[69] = 164; - - test_msg.rle_list[70] = 171; - - test_msg.rle_list[71] = 78; - - test_msg.rle_list[72] = 185; - - test_msg.rle_list[73] = 90; - - test_msg.rle_list[74] = 46; - - test_msg.rle_list[75] = 177; - - test_msg.rle_list[76] = 82; - - test_msg.rle_list[77] = 228; - - test_msg.rle_list[78] = 123; - - test_msg.rle_list[79] = 222; - - test_msg.rle_list[80] = 227; - - test_msg.rle_list[81] = 145; - - test_msg.rle_list[82] = 195; - - test_msg.rle_list[83] = 219; - - test_msg.rle_list[84] = 27; - - test_msg.rle_list[85] = 56; - - test_msg.rle_list[86] = 227; - - test_msg.rle_list[87] = 246; - - test_msg.rle_list[88] = 215; - - test_msg.rle_list[89] = 144; - - test_msg.rle_list[90] = 158; - - test_msg.rle_list[91] = 31; - - test_msg.rle_list[92] = 214; - - test_msg.rle_list[93] = 241; - - test_msg.rle_list[94] = 254; - - test_msg.rle_list[95] = 200; - - test_msg.rle_list[96] = 86; - - test_msg.rle_list[97] = 142; - - test_msg.rle_list[98] = 89; - - test_msg.rle_list[99] = 12; - - test_msg.rle_list[100] = 121; - - test_msg.rle_list[101] = 29; - - test_msg.rle_list[102] = 124; - - test_msg.rle_list[103] = 9; - - test_msg.rle_list[104] = 19; - - test_msg.rle_list[105] = 153; - - test_msg.rle_list[106] = 44; - - test_msg.rle_list[107] = 35; - - test_msg.rle_list[108] = 126; - - test_msg.rle_list[109] = 14; - - test_msg.rle_list[110] = 217; - - test_msg.rle_list[111] = 65; - - test_msg.rle_list[112] = 116; - - test_msg.rle_list[113] = 26; - - test_msg.rle_list[114] = 139; - - test_msg.rle_list[115] = 122; - - test_msg.rle_list[116] = 114; - - test_msg.rle_list[117] = 90; - - test_msg.rle_list[118] = 124; - - test_msg.rle_list[119] = 81; - - test_msg.rle_list[120] = 0; - - test_msg.rle_list[121] = 186; - - test_msg.rle_list[122] = 246; - - test_msg.rle_list[123] = 46; - - test_msg.rle_list[124] = 98; - - test_msg.rle_list[125] = 179; - - test_msg.rle_list[126] = 243; - - test_msg.rle_list[127] = 198; - - test_msg.rle_list[128] = 217; - - test_msg.rle_list[129] = 36; - - test_msg.rle_list[130] = 30; - - test_msg.rle_list[131] = 202; - - test_msg.rle_list[132] = 12; - - test_msg.rle_list[133] = 135; - - test_msg.rle_list[134] = 61; - - test_msg.rle_list[135] = 42; - - test_msg.rle_list[136] = 150; - - test_msg.rle_list[137] = 221; - - test_msg.rle_list[138] = 102; - - test_msg.rle_list[139] = 83; - - test_msg.rle_list[140] = 179; - - test_msg.rle_list[141] = 43; - - test_msg.rle_list[142] = 252; - - test_msg.rle_list[143] = 81; - - test_msg.rle_list[144] = 62; - - test_msg.rle_list[145] = 126; - - test_msg.rle_list[146] = 204; - - test_msg.rle_list[147] = 195; - - test_msg.rle_list[148] = 238; - - test_msg.rle_list[149] = 18; - - test_msg.rle_list[150] = 128; - - test_msg.rle_list[151] = 193; - - test_msg.rle_list[152] = 53; - - test_msg.rle_list[153] = 94; - - test_msg.rle_list[154] = 99; - - test_msg.rle_list[155] = 63; - - test_msg.rle_list[156] = 182; - - test_msg.rle_list[157] = 2; - - test_msg.rle_list[158] = 186; - - test_msg.rle_list[159] = 220; - - test_msg.rle_list[160] = 77; - - test_msg.rle_list[161] = 186; - - test_msg.rle_list[162] = 224; - - test_msg.rle_list[163] = 220; - - test_msg.rle_list[164] = 13; - - test_msg.rle_list[165] = 212; - - test_msg.rle_list[166] = 182; - - test_msg.rle_list[167] = 88; - - test_msg.rle_list[168] = 15; - - test_msg.rle_list[169] = 151; - - test_msg.rle_list[170] = 5; - - test_msg.rle_list[171] = 93; - - test_msg.rle_list[172] = 251; - - test_msg.rle_list[173] = 164; - - test_msg.rle_list[174] = 18; - - test_msg.rle_list[175] = 228; - - test_msg.rle_list[176] = 168; - - test_msg.rle_list[177] = 226; - - test_msg.rle_list[178] = 195; - - test_msg.rle_list[179] = 44; - - test_msg.rle_list[180] = 170; - - test_msg.rle_list[181] = 145; - - test_msg.rle_list[182] = 36; - - test_msg.rle_list[183] = 58; - - test_msg.rle_list[184] = 96; - - test_msg.rle_list[185] = 107; - - test_msg.rle_list[186] = 144; - - test_msg.rle_list[187] = 11; - - test_msg.rle_list[188] = 228; - - test_msg.rle_list[189] = 12; - - test_msg.rle_list[190] = 163; - - test_msg.rle_list[191] = 238; - - test_msg.rle_list[192] = 247; - - test_msg.rle_list[193] = 159; - - test_msg.rle_list[194] = 189; - - test_msg.rle_list[195] = 1; - - test_msg.rle_list[196] = 115; - - test_msg.rle_list[197] = 65; - - test_msg.rle_list[198] = 202; - - test_msg.rle_list[199] = 121; - - test_msg.rle_list[200] = 47; - - test_msg.rle_list[201] = 193; - - test_msg.rle_list[202] = 11; - - test_msg.rle_list[203] = 96; - - test_msg.rle_list[204] = 93; - - test_msg.rle_list[205] = 72; - - test_msg.rle_list[206] = 81; - - test_msg.rle_list[207] = 207; - - test_msg.rle_list[208] = 121; - - test_msg.rle_list[209] = 19; - - test_msg.rle_list[210] = 151; - - test_msg.rle_list[211] = 136; - - test_msg.rle_list[212] = 233; - - test_msg.rle_list[213] = 51; - - test_msg.rle_list[214] = 133; - - test_msg.rle_list[215] = 195; - - test_msg.rle_list[216] = 77; - - test_msg.rle_list[217] = 44; - - test_msg.rle_list[218] = 147; - - test_msg.rle_list[219] = 206; - - test_msg.rle_list[220] = 120; - - test_msg.rle_list[221] = 252; - - test_msg.rle_list[222] = 77; - - test_msg.rle_list[223] = 212; - - test_msg.rle_list[224] = 68; - - test_msg.rle_list[225] = 60; - - test_msg.rle_list[226] = 206; - - test_msg.rle_list[227] = 106; - - test_msg.rle_list[228] = 207; - - test_msg.rle_list[229] = 243; - - test_msg.rle_list[230] = 158; - - test_msg.rle_list[231] = 94; - - test_msg.rle_list[232] = 6; - - test_msg.rle_list[233] = 3; - - test_msg.rle_list[234] = 205; - - test_msg.rle_list[235] = 92; - - test_msg.rle_list[236] = 84; - - test_msg.rle_list[237] = 2; - - test_msg.rle_list[238] = 220; - - test_msg.rle_list[239] = 50; - - test_msg.rle_list[240] = 61; - - test_msg.rle_list[241] = 38; - - test_msg.rle_list[242] = 141; - - test_msg.rle_list[243] = 117; - - test_msg.rle_list[244] = 108; - - test_msg.rle_list[245] = 101; - - EXPECT_EQ(send_message( 63413, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 63413); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.area_width, 43860) << "incorrect value for last_msg_.header.area_width, expected 43860, is " << last_msg_.header.area_width; - EXPECT_EQ(last_msg_.header.lat_nw_corner_enc, 34021) << "incorrect value for last_msg_.header.lat_nw_corner_enc, expected 34021, is " << last_msg_.header.lat_nw_corner_enc; - EXPECT_EQ(last_msg_.header.lon_nw_corner_enc, 11919) << "incorrect value for last_msg_.header.lon_nw_corner_enc, expected 11919, is " << last_msg_.header.lon_nw_corner_enc; - EXPECT_EQ(last_msg_.header.num_msgs, 204) << "incorrect value for last_msg_.header.num_msgs, expected 204, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.region_size_inverse, 11) << "incorrect value for last_msg_.header.region_size_inverse, expected 11, is " << last_msg_.header.region_size_inverse; - EXPECT_EQ(last_msg_.header.seq_num, 52) << "incorrect value for last_msg_.header.seq_num, expected 52, is " << last_msg_.header.seq_num; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_rle_list.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_rle_list.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_rle_list.handle_as << "'"; - } - { - const char check_string[] = { (char)114,(char)108,(char)101,(char)95,(char)108,(char)105,(char)115,(char)116 }; - EXPECT_EQ(memcmp(last_msg_.n_rle_list.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_rle_list.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_rle_list.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_rle_list.value, 246) << "incorrect value for last_msg_.n_rle_list.value, expected 246, is " << last_msg_.n_rle_list.value; - EXPECT_EQ(last_msg_.rle_list[0], 92) << "incorrect value for last_msg_.rle_list[0], expected 92, is " << last_msg_.rle_list[0]; - EXPECT_EQ(last_msg_.rle_list[1], 104) << "incorrect value for last_msg_.rle_list[1], expected 104, is " << last_msg_.rle_list[1]; - EXPECT_EQ(last_msg_.rle_list[2], 25) << "incorrect value for last_msg_.rle_list[2], expected 25, is " << last_msg_.rle_list[2]; - EXPECT_EQ(last_msg_.rle_list[3], 204) << "incorrect value for last_msg_.rle_list[3], expected 204, is " << last_msg_.rle_list[3]; - EXPECT_EQ(last_msg_.rle_list[4], 182) << "incorrect value for last_msg_.rle_list[4], expected 182, is " << last_msg_.rle_list[4]; - EXPECT_EQ(last_msg_.rle_list[5], 22) << "incorrect value for last_msg_.rle_list[5], expected 22, is " << last_msg_.rle_list[5]; - EXPECT_EQ(last_msg_.rle_list[6], 98) << "incorrect value for last_msg_.rle_list[6], expected 98, is " << last_msg_.rle_list[6]; - EXPECT_EQ(last_msg_.rle_list[7], 203) << "incorrect value for last_msg_.rle_list[7], expected 203, is " << last_msg_.rle_list[7]; - EXPECT_EQ(last_msg_.rle_list[8], 123) << "incorrect value for last_msg_.rle_list[8], expected 123, is " << last_msg_.rle_list[8]; - EXPECT_EQ(last_msg_.rle_list[9], 211) << "incorrect value for last_msg_.rle_list[9], expected 211, is " << last_msg_.rle_list[9]; - EXPECT_EQ(last_msg_.rle_list[10], 38) << "incorrect value for last_msg_.rle_list[10], expected 38, is " << last_msg_.rle_list[10]; - EXPECT_EQ(last_msg_.rle_list[11], 13) << "incorrect value for last_msg_.rle_list[11], expected 13, is " << last_msg_.rle_list[11]; - EXPECT_EQ(last_msg_.rle_list[12], 253) << "incorrect value for last_msg_.rle_list[12], expected 253, is " << last_msg_.rle_list[12]; - EXPECT_EQ(last_msg_.rle_list[13], 129) << "incorrect value for last_msg_.rle_list[13], expected 129, is " << last_msg_.rle_list[13]; - EXPECT_EQ(last_msg_.rle_list[14], 173) << "incorrect value for last_msg_.rle_list[14], expected 173, is " << last_msg_.rle_list[14]; - EXPECT_EQ(last_msg_.rle_list[15], 171) << "incorrect value for last_msg_.rle_list[15], expected 171, is " << last_msg_.rle_list[15]; - EXPECT_EQ(last_msg_.rle_list[16], 235) << "incorrect value for last_msg_.rle_list[16], expected 235, is " << last_msg_.rle_list[16]; - EXPECT_EQ(last_msg_.rle_list[17], 253) << "incorrect value for last_msg_.rle_list[17], expected 253, is " << last_msg_.rle_list[17]; - EXPECT_EQ(last_msg_.rle_list[18], 26) << "incorrect value for last_msg_.rle_list[18], expected 26, is " << last_msg_.rle_list[18]; - EXPECT_EQ(last_msg_.rle_list[19], 203) << "incorrect value for last_msg_.rle_list[19], expected 203, is " << last_msg_.rle_list[19]; - EXPECT_EQ(last_msg_.rle_list[20], 3) << "incorrect value for last_msg_.rle_list[20], expected 3, is " << last_msg_.rle_list[20]; - EXPECT_EQ(last_msg_.rle_list[21], 120) << "incorrect value for last_msg_.rle_list[21], expected 120, is " << last_msg_.rle_list[21]; - EXPECT_EQ(last_msg_.rle_list[22], 126) << "incorrect value for last_msg_.rle_list[22], expected 126, is " << last_msg_.rle_list[22]; - EXPECT_EQ(last_msg_.rle_list[23], 42) << "incorrect value for last_msg_.rle_list[23], expected 42, is " << last_msg_.rle_list[23]; - EXPECT_EQ(last_msg_.rle_list[24], 44) << "incorrect value for last_msg_.rle_list[24], expected 44, is " << last_msg_.rle_list[24]; - EXPECT_EQ(last_msg_.rle_list[25], 39) << "incorrect value for last_msg_.rle_list[25], expected 39, is " << last_msg_.rle_list[25]; - EXPECT_EQ(last_msg_.rle_list[26], 87) << "incorrect value for last_msg_.rle_list[26], expected 87, is " << last_msg_.rle_list[26]; - EXPECT_EQ(last_msg_.rle_list[27], 69) << "incorrect value for last_msg_.rle_list[27], expected 69, is " << last_msg_.rle_list[27]; - EXPECT_EQ(last_msg_.rle_list[28], 154) << "incorrect value for last_msg_.rle_list[28], expected 154, is " << last_msg_.rle_list[28]; - EXPECT_EQ(last_msg_.rle_list[29], 13) << "incorrect value for last_msg_.rle_list[29], expected 13, is " << last_msg_.rle_list[29]; - EXPECT_EQ(last_msg_.rle_list[30], 28) << "incorrect value for last_msg_.rle_list[30], expected 28, is " << last_msg_.rle_list[30]; - EXPECT_EQ(last_msg_.rle_list[31], 179) << "incorrect value for last_msg_.rle_list[31], expected 179, is " << last_msg_.rle_list[31]; - EXPECT_EQ(last_msg_.rle_list[32], 32) << "incorrect value for last_msg_.rle_list[32], expected 32, is " << last_msg_.rle_list[32]; - EXPECT_EQ(last_msg_.rle_list[33], 47) << "incorrect value for last_msg_.rle_list[33], expected 47, is " << last_msg_.rle_list[33]; - EXPECT_EQ(last_msg_.rle_list[34], 36) << "incorrect value for last_msg_.rle_list[34], expected 36, is " << last_msg_.rle_list[34]; - EXPECT_EQ(last_msg_.rle_list[35], 195) << "incorrect value for last_msg_.rle_list[35], expected 195, is " << last_msg_.rle_list[35]; - EXPECT_EQ(last_msg_.rle_list[36], 39) << "incorrect value for last_msg_.rle_list[36], expected 39, is " << last_msg_.rle_list[36]; - EXPECT_EQ(last_msg_.rle_list[37], 198) << "incorrect value for last_msg_.rle_list[37], expected 198, is " << last_msg_.rle_list[37]; - EXPECT_EQ(last_msg_.rle_list[38], 134) << "incorrect value for last_msg_.rle_list[38], expected 134, is " << last_msg_.rle_list[38]; - EXPECT_EQ(last_msg_.rle_list[39], 235) << "incorrect value for last_msg_.rle_list[39], expected 235, is " << last_msg_.rle_list[39]; - EXPECT_EQ(last_msg_.rle_list[40], 134) << "incorrect value for last_msg_.rle_list[40], expected 134, is " << last_msg_.rle_list[40]; - EXPECT_EQ(last_msg_.rle_list[41], 57) << "incorrect value for last_msg_.rle_list[41], expected 57, is " << last_msg_.rle_list[41]; - EXPECT_EQ(last_msg_.rle_list[42], 120) << "incorrect value for last_msg_.rle_list[42], expected 120, is " << last_msg_.rle_list[42]; - EXPECT_EQ(last_msg_.rle_list[43], 243) << "incorrect value for last_msg_.rle_list[43], expected 243, is " << last_msg_.rle_list[43]; - EXPECT_EQ(last_msg_.rle_list[44], 151) << "incorrect value for last_msg_.rle_list[44], expected 151, is " << last_msg_.rle_list[44]; - EXPECT_EQ(last_msg_.rle_list[45], 35) << "incorrect value for last_msg_.rle_list[45], expected 35, is " << last_msg_.rle_list[45]; - EXPECT_EQ(last_msg_.rle_list[46], 17) << "incorrect value for last_msg_.rle_list[46], expected 17, is " << last_msg_.rle_list[46]; - EXPECT_EQ(last_msg_.rle_list[47], 201) << "incorrect value for last_msg_.rle_list[47], expected 201, is " << last_msg_.rle_list[47]; - EXPECT_EQ(last_msg_.rle_list[48], 211) << "incorrect value for last_msg_.rle_list[48], expected 211, is " << last_msg_.rle_list[48]; - EXPECT_EQ(last_msg_.rle_list[49], 125) << "incorrect value for last_msg_.rle_list[49], expected 125, is " << last_msg_.rle_list[49]; - EXPECT_EQ(last_msg_.rle_list[50], 117) << "incorrect value for last_msg_.rle_list[50], expected 117, is " << last_msg_.rle_list[50]; - EXPECT_EQ(last_msg_.rle_list[51], 164) << "incorrect value for last_msg_.rle_list[51], expected 164, is " << last_msg_.rle_list[51]; - EXPECT_EQ(last_msg_.rle_list[52], 142) << "incorrect value for last_msg_.rle_list[52], expected 142, is " << last_msg_.rle_list[52]; - EXPECT_EQ(last_msg_.rle_list[53], 101) << "incorrect value for last_msg_.rle_list[53], expected 101, is " << last_msg_.rle_list[53]; - EXPECT_EQ(last_msg_.rle_list[54], 239) << "incorrect value for last_msg_.rle_list[54], expected 239, is " << last_msg_.rle_list[54]; - EXPECT_EQ(last_msg_.rle_list[55], 144) << "incorrect value for last_msg_.rle_list[55], expected 144, is " << last_msg_.rle_list[55]; - EXPECT_EQ(last_msg_.rle_list[56], 158) << "incorrect value for last_msg_.rle_list[56], expected 158, is " << last_msg_.rle_list[56]; - EXPECT_EQ(last_msg_.rle_list[57], 239) << "incorrect value for last_msg_.rle_list[57], expected 239, is " << last_msg_.rle_list[57]; - EXPECT_EQ(last_msg_.rle_list[58], 90) << "incorrect value for last_msg_.rle_list[58], expected 90, is " << last_msg_.rle_list[58]; - EXPECT_EQ(last_msg_.rle_list[59], 56) << "incorrect value for last_msg_.rle_list[59], expected 56, is " << last_msg_.rle_list[59]; - EXPECT_EQ(last_msg_.rle_list[60], 71) << "incorrect value for last_msg_.rle_list[60], expected 71, is " << last_msg_.rle_list[60]; - EXPECT_EQ(last_msg_.rle_list[61], 120) << "incorrect value for last_msg_.rle_list[61], expected 120, is " << last_msg_.rle_list[61]; - EXPECT_EQ(last_msg_.rle_list[62], 67) << "incorrect value for last_msg_.rle_list[62], expected 67, is " << last_msg_.rle_list[62]; - EXPECT_EQ(last_msg_.rle_list[63], 221) << "incorrect value for last_msg_.rle_list[63], expected 221, is " << last_msg_.rle_list[63]; - EXPECT_EQ(last_msg_.rle_list[64], 114) << "incorrect value for last_msg_.rle_list[64], expected 114, is " << last_msg_.rle_list[64]; - EXPECT_EQ(last_msg_.rle_list[65], 10) << "incorrect value for last_msg_.rle_list[65], expected 10, is " << last_msg_.rle_list[65]; - EXPECT_EQ(last_msg_.rle_list[66], 190) << "incorrect value for last_msg_.rle_list[66], expected 190, is " << last_msg_.rle_list[66]; - EXPECT_EQ(last_msg_.rle_list[67], 4) << "incorrect value for last_msg_.rle_list[67], expected 4, is " << last_msg_.rle_list[67]; - EXPECT_EQ(last_msg_.rle_list[68], 230) << "incorrect value for last_msg_.rle_list[68], expected 230, is " << last_msg_.rle_list[68]; - EXPECT_EQ(last_msg_.rle_list[69], 164) << "incorrect value for last_msg_.rle_list[69], expected 164, is " << last_msg_.rle_list[69]; - EXPECT_EQ(last_msg_.rle_list[70], 171) << "incorrect value for last_msg_.rle_list[70], expected 171, is " << last_msg_.rle_list[70]; - EXPECT_EQ(last_msg_.rle_list[71], 78) << "incorrect value for last_msg_.rle_list[71], expected 78, is " << last_msg_.rle_list[71]; - EXPECT_EQ(last_msg_.rle_list[72], 185) << "incorrect value for last_msg_.rle_list[72], expected 185, is " << last_msg_.rle_list[72]; - EXPECT_EQ(last_msg_.rle_list[73], 90) << "incorrect value for last_msg_.rle_list[73], expected 90, is " << last_msg_.rle_list[73]; - EXPECT_EQ(last_msg_.rle_list[74], 46) << "incorrect value for last_msg_.rle_list[74], expected 46, is " << last_msg_.rle_list[74]; - EXPECT_EQ(last_msg_.rle_list[75], 177) << "incorrect value for last_msg_.rle_list[75], expected 177, is " << last_msg_.rle_list[75]; - EXPECT_EQ(last_msg_.rle_list[76], 82) << "incorrect value for last_msg_.rle_list[76], expected 82, is " << last_msg_.rle_list[76]; - EXPECT_EQ(last_msg_.rle_list[77], 228) << "incorrect value for last_msg_.rle_list[77], expected 228, is " << last_msg_.rle_list[77]; - EXPECT_EQ(last_msg_.rle_list[78], 123) << "incorrect value for last_msg_.rle_list[78], expected 123, is " << last_msg_.rle_list[78]; - EXPECT_EQ(last_msg_.rle_list[79], 222) << "incorrect value for last_msg_.rle_list[79], expected 222, is " << last_msg_.rle_list[79]; - EXPECT_EQ(last_msg_.rle_list[80], 227) << "incorrect value for last_msg_.rle_list[80], expected 227, is " << last_msg_.rle_list[80]; - EXPECT_EQ(last_msg_.rle_list[81], 145) << "incorrect value for last_msg_.rle_list[81], expected 145, is " << last_msg_.rle_list[81]; - EXPECT_EQ(last_msg_.rle_list[82], 195) << "incorrect value for last_msg_.rle_list[82], expected 195, is " << last_msg_.rle_list[82]; - EXPECT_EQ(last_msg_.rle_list[83], 219) << "incorrect value for last_msg_.rle_list[83], expected 219, is " << last_msg_.rle_list[83]; - EXPECT_EQ(last_msg_.rle_list[84], 27) << "incorrect value for last_msg_.rle_list[84], expected 27, is " << last_msg_.rle_list[84]; - EXPECT_EQ(last_msg_.rle_list[85], 56) << "incorrect value for last_msg_.rle_list[85], expected 56, is " << last_msg_.rle_list[85]; - EXPECT_EQ(last_msg_.rle_list[86], 227) << "incorrect value for last_msg_.rle_list[86], expected 227, is " << last_msg_.rle_list[86]; - EXPECT_EQ(last_msg_.rle_list[87], 246) << "incorrect value for last_msg_.rle_list[87], expected 246, is " << last_msg_.rle_list[87]; - EXPECT_EQ(last_msg_.rle_list[88], 215) << "incorrect value for last_msg_.rle_list[88], expected 215, is " << last_msg_.rle_list[88]; - EXPECT_EQ(last_msg_.rle_list[89], 144) << "incorrect value for last_msg_.rle_list[89], expected 144, is " << last_msg_.rle_list[89]; - EXPECT_EQ(last_msg_.rle_list[90], 158) << "incorrect value for last_msg_.rle_list[90], expected 158, is " << last_msg_.rle_list[90]; - EXPECT_EQ(last_msg_.rle_list[91], 31) << "incorrect value for last_msg_.rle_list[91], expected 31, is " << last_msg_.rle_list[91]; - EXPECT_EQ(last_msg_.rle_list[92], 214) << "incorrect value for last_msg_.rle_list[92], expected 214, is " << last_msg_.rle_list[92]; - EXPECT_EQ(last_msg_.rle_list[93], 241) << "incorrect value for last_msg_.rle_list[93], expected 241, is " << last_msg_.rle_list[93]; - EXPECT_EQ(last_msg_.rle_list[94], 254) << "incorrect value for last_msg_.rle_list[94], expected 254, is " << last_msg_.rle_list[94]; - EXPECT_EQ(last_msg_.rle_list[95], 200) << "incorrect value for last_msg_.rle_list[95], expected 200, is " << last_msg_.rle_list[95]; - EXPECT_EQ(last_msg_.rle_list[96], 86) << "incorrect value for last_msg_.rle_list[96], expected 86, is " << last_msg_.rle_list[96]; - EXPECT_EQ(last_msg_.rle_list[97], 142) << "incorrect value for last_msg_.rle_list[97], expected 142, is " << last_msg_.rle_list[97]; - EXPECT_EQ(last_msg_.rle_list[98], 89) << "incorrect value for last_msg_.rle_list[98], expected 89, is " << last_msg_.rle_list[98]; - EXPECT_EQ(last_msg_.rle_list[99], 12) << "incorrect value for last_msg_.rle_list[99], expected 12, is " << last_msg_.rle_list[99]; - EXPECT_EQ(last_msg_.rle_list[100], 121) << "incorrect value for last_msg_.rle_list[100], expected 121, is " << last_msg_.rle_list[100]; - EXPECT_EQ(last_msg_.rle_list[101], 29) << "incorrect value for last_msg_.rle_list[101], expected 29, is " << last_msg_.rle_list[101]; - EXPECT_EQ(last_msg_.rle_list[102], 124) << "incorrect value for last_msg_.rle_list[102], expected 124, is " << last_msg_.rle_list[102]; - EXPECT_EQ(last_msg_.rle_list[103], 9) << "incorrect value for last_msg_.rle_list[103], expected 9, is " << last_msg_.rle_list[103]; - EXPECT_EQ(last_msg_.rle_list[104], 19) << "incorrect value for last_msg_.rle_list[104], expected 19, is " << last_msg_.rle_list[104]; - EXPECT_EQ(last_msg_.rle_list[105], 153) << "incorrect value for last_msg_.rle_list[105], expected 153, is " << last_msg_.rle_list[105]; - EXPECT_EQ(last_msg_.rle_list[106], 44) << "incorrect value for last_msg_.rle_list[106], expected 44, is " << last_msg_.rle_list[106]; - EXPECT_EQ(last_msg_.rle_list[107], 35) << "incorrect value for last_msg_.rle_list[107], expected 35, is " << last_msg_.rle_list[107]; - EXPECT_EQ(last_msg_.rle_list[108], 126) << "incorrect value for last_msg_.rle_list[108], expected 126, is " << last_msg_.rle_list[108]; - EXPECT_EQ(last_msg_.rle_list[109], 14) << "incorrect value for last_msg_.rle_list[109], expected 14, is " << last_msg_.rle_list[109]; - EXPECT_EQ(last_msg_.rle_list[110], 217) << "incorrect value for last_msg_.rle_list[110], expected 217, is " << last_msg_.rle_list[110]; - EXPECT_EQ(last_msg_.rle_list[111], 65) << "incorrect value for last_msg_.rle_list[111], expected 65, is " << last_msg_.rle_list[111]; - EXPECT_EQ(last_msg_.rle_list[112], 116) << "incorrect value for last_msg_.rle_list[112], expected 116, is " << last_msg_.rle_list[112]; - EXPECT_EQ(last_msg_.rle_list[113], 26) << "incorrect value for last_msg_.rle_list[113], expected 26, is " << last_msg_.rle_list[113]; - EXPECT_EQ(last_msg_.rle_list[114], 139) << "incorrect value for last_msg_.rle_list[114], expected 139, is " << last_msg_.rle_list[114]; - EXPECT_EQ(last_msg_.rle_list[115], 122) << "incorrect value for last_msg_.rle_list[115], expected 122, is " << last_msg_.rle_list[115]; - EXPECT_EQ(last_msg_.rle_list[116], 114) << "incorrect value for last_msg_.rle_list[116], expected 114, is " << last_msg_.rle_list[116]; - EXPECT_EQ(last_msg_.rle_list[117], 90) << "incorrect value for last_msg_.rle_list[117], expected 90, is " << last_msg_.rle_list[117]; - EXPECT_EQ(last_msg_.rle_list[118], 124) << "incorrect value for last_msg_.rle_list[118], expected 124, is " << last_msg_.rle_list[118]; - EXPECT_EQ(last_msg_.rle_list[119], 81) << "incorrect value for last_msg_.rle_list[119], expected 81, is " << last_msg_.rle_list[119]; - EXPECT_EQ(last_msg_.rle_list[120], 0) << "incorrect value for last_msg_.rle_list[120], expected 0, is " << last_msg_.rle_list[120]; - EXPECT_EQ(last_msg_.rle_list[121], 186) << "incorrect value for last_msg_.rle_list[121], expected 186, is " << last_msg_.rle_list[121]; - EXPECT_EQ(last_msg_.rle_list[122], 246) << "incorrect value for last_msg_.rle_list[122], expected 246, is " << last_msg_.rle_list[122]; - EXPECT_EQ(last_msg_.rle_list[123], 46) << "incorrect value for last_msg_.rle_list[123], expected 46, is " << last_msg_.rle_list[123]; - EXPECT_EQ(last_msg_.rle_list[124], 98) << "incorrect value for last_msg_.rle_list[124], expected 98, is " << last_msg_.rle_list[124]; - EXPECT_EQ(last_msg_.rle_list[125], 179) << "incorrect value for last_msg_.rle_list[125], expected 179, is " << last_msg_.rle_list[125]; - EXPECT_EQ(last_msg_.rle_list[126], 243) << "incorrect value for last_msg_.rle_list[126], expected 243, is " << last_msg_.rle_list[126]; - EXPECT_EQ(last_msg_.rle_list[127], 198) << "incorrect value for last_msg_.rle_list[127], expected 198, is " << last_msg_.rle_list[127]; - EXPECT_EQ(last_msg_.rle_list[128], 217) << "incorrect value for last_msg_.rle_list[128], expected 217, is " << last_msg_.rle_list[128]; - EXPECT_EQ(last_msg_.rle_list[129], 36) << "incorrect value for last_msg_.rle_list[129], expected 36, is " << last_msg_.rle_list[129]; - EXPECT_EQ(last_msg_.rle_list[130], 30) << "incorrect value for last_msg_.rle_list[130], expected 30, is " << last_msg_.rle_list[130]; - EXPECT_EQ(last_msg_.rle_list[131], 202) << "incorrect value for last_msg_.rle_list[131], expected 202, is " << last_msg_.rle_list[131]; - EXPECT_EQ(last_msg_.rle_list[132], 12) << "incorrect value for last_msg_.rle_list[132], expected 12, is " << last_msg_.rle_list[132]; - EXPECT_EQ(last_msg_.rle_list[133], 135) << "incorrect value for last_msg_.rle_list[133], expected 135, is " << last_msg_.rle_list[133]; - EXPECT_EQ(last_msg_.rle_list[134], 61) << "incorrect value for last_msg_.rle_list[134], expected 61, is " << last_msg_.rle_list[134]; - EXPECT_EQ(last_msg_.rle_list[135], 42) << "incorrect value for last_msg_.rle_list[135], expected 42, is " << last_msg_.rle_list[135]; - EXPECT_EQ(last_msg_.rle_list[136], 150) << "incorrect value for last_msg_.rle_list[136], expected 150, is " << last_msg_.rle_list[136]; - EXPECT_EQ(last_msg_.rle_list[137], 221) << "incorrect value for last_msg_.rle_list[137], expected 221, is " << last_msg_.rle_list[137]; - EXPECT_EQ(last_msg_.rle_list[138], 102) << "incorrect value for last_msg_.rle_list[138], expected 102, is " << last_msg_.rle_list[138]; - EXPECT_EQ(last_msg_.rle_list[139], 83) << "incorrect value for last_msg_.rle_list[139], expected 83, is " << last_msg_.rle_list[139]; - EXPECT_EQ(last_msg_.rle_list[140], 179) << "incorrect value for last_msg_.rle_list[140], expected 179, is " << last_msg_.rle_list[140]; - EXPECT_EQ(last_msg_.rle_list[141], 43) << "incorrect value for last_msg_.rle_list[141], expected 43, is " << last_msg_.rle_list[141]; - EXPECT_EQ(last_msg_.rle_list[142], 252) << "incorrect value for last_msg_.rle_list[142], expected 252, is " << last_msg_.rle_list[142]; - EXPECT_EQ(last_msg_.rle_list[143], 81) << "incorrect value for last_msg_.rle_list[143], expected 81, is " << last_msg_.rle_list[143]; - EXPECT_EQ(last_msg_.rle_list[144], 62) << "incorrect value for last_msg_.rle_list[144], expected 62, is " << last_msg_.rle_list[144]; - EXPECT_EQ(last_msg_.rle_list[145], 126) << "incorrect value for last_msg_.rle_list[145], expected 126, is " << last_msg_.rle_list[145]; - EXPECT_EQ(last_msg_.rle_list[146], 204) << "incorrect value for last_msg_.rle_list[146], expected 204, is " << last_msg_.rle_list[146]; - EXPECT_EQ(last_msg_.rle_list[147], 195) << "incorrect value for last_msg_.rle_list[147], expected 195, is " << last_msg_.rle_list[147]; - EXPECT_EQ(last_msg_.rle_list[148], 238) << "incorrect value for last_msg_.rle_list[148], expected 238, is " << last_msg_.rle_list[148]; - EXPECT_EQ(last_msg_.rle_list[149], 18) << "incorrect value for last_msg_.rle_list[149], expected 18, is " << last_msg_.rle_list[149]; - EXPECT_EQ(last_msg_.rle_list[150], 128) << "incorrect value for last_msg_.rle_list[150], expected 128, is " << last_msg_.rle_list[150]; - EXPECT_EQ(last_msg_.rle_list[151], 193) << "incorrect value for last_msg_.rle_list[151], expected 193, is " << last_msg_.rle_list[151]; - EXPECT_EQ(last_msg_.rle_list[152], 53) << "incorrect value for last_msg_.rle_list[152], expected 53, is " << last_msg_.rle_list[152]; - EXPECT_EQ(last_msg_.rle_list[153], 94) << "incorrect value for last_msg_.rle_list[153], expected 94, is " << last_msg_.rle_list[153]; - EXPECT_EQ(last_msg_.rle_list[154], 99) << "incorrect value for last_msg_.rle_list[154], expected 99, is " << last_msg_.rle_list[154]; - EXPECT_EQ(last_msg_.rle_list[155], 63) << "incorrect value for last_msg_.rle_list[155], expected 63, is " << last_msg_.rle_list[155]; - EXPECT_EQ(last_msg_.rle_list[156], 182) << "incorrect value for last_msg_.rle_list[156], expected 182, is " << last_msg_.rle_list[156]; - EXPECT_EQ(last_msg_.rle_list[157], 2) << "incorrect value for last_msg_.rle_list[157], expected 2, is " << last_msg_.rle_list[157]; - EXPECT_EQ(last_msg_.rle_list[158], 186) << "incorrect value for last_msg_.rle_list[158], expected 186, is " << last_msg_.rle_list[158]; - EXPECT_EQ(last_msg_.rle_list[159], 220) << "incorrect value for last_msg_.rle_list[159], expected 220, is " << last_msg_.rle_list[159]; - EXPECT_EQ(last_msg_.rle_list[160], 77) << "incorrect value for last_msg_.rle_list[160], expected 77, is " << last_msg_.rle_list[160]; - EXPECT_EQ(last_msg_.rle_list[161], 186) << "incorrect value for last_msg_.rle_list[161], expected 186, is " << last_msg_.rle_list[161]; - EXPECT_EQ(last_msg_.rle_list[162], 224) << "incorrect value for last_msg_.rle_list[162], expected 224, is " << last_msg_.rle_list[162]; - EXPECT_EQ(last_msg_.rle_list[163], 220) << "incorrect value for last_msg_.rle_list[163], expected 220, is " << last_msg_.rle_list[163]; - EXPECT_EQ(last_msg_.rle_list[164], 13) << "incorrect value for last_msg_.rle_list[164], expected 13, is " << last_msg_.rle_list[164]; - EXPECT_EQ(last_msg_.rle_list[165], 212) << "incorrect value for last_msg_.rle_list[165], expected 212, is " << last_msg_.rle_list[165]; - EXPECT_EQ(last_msg_.rle_list[166], 182) << "incorrect value for last_msg_.rle_list[166], expected 182, is " << last_msg_.rle_list[166]; - EXPECT_EQ(last_msg_.rle_list[167], 88) << "incorrect value for last_msg_.rle_list[167], expected 88, is " << last_msg_.rle_list[167]; - EXPECT_EQ(last_msg_.rle_list[168], 15) << "incorrect value for last_msg_.rle_list[168], expected 15, is " << last_msg_.rle_list[168]; - EXPECT_EQ(last_msg_.rle_list[169], 151) << "incorrect value for last_msg_.rle_list[169], expected 151, is " << last_msg_.rle_list[169]; - EXPECT_EQ(last_msg_.rle_list[170], 5) << "incorrect value for last_msg_.rle_list[170], expected 5, is " << last_msg_.rle_list[170]; - EXPECT_EQ(last_msg_.rle_list[171], 93) << "incorrect value for last_msg_.rle_list[171], expected 93, is " << last_msg_.rle_list[171]; - EXPECT_EQ(last_msg_.rle_list[172], 251) << "incorrect value for last_msg_.rle_list[172], expected 251, is " << last_msg_.rle_list[172]; - EXPECT_EQ(last_msg_.rle_list[173], 164) << "incorrect value for last_msg_.rle_list[173], expected 164, is " << last_msg_.rle_list[173]; - EXPECT_EQ(last_msg_.rle_list[174], 18) << "incorrect value for last_msg_.rle_list[174], expected 18, is " << last_msg_.rle_list[174]; - EXPECT_EQ(last_msg_.rle_list[175], 228) << "incorrect value for last_msg_.rle_list[175], expected 228, is " << last_msg_.rle_list[175]; - EXPECT_EQ(last_msg_.rle_list[176], 168) << "incorrect value for last_msg_.rle_list[176], expected 168, is " << last_msg_.rle_list[176]; - EXPECT_EQ(last_msg_.rle_list[177], 226) << "incorrect value for last_msg_.rle_list[177], expected 226, is " << last_msg_.rle_list[177]; - EXPECT_EQ(last_msg_.rle_list[178], 195) << "incorrect value for last_msg_.rle_list[178], expected 195, is " << last_msg_.rle_list[178]; - EXPECT_EQ(last_msg_.rle_list[179], 44) << "incorrect value for last_msg_.rle_list[179], expected 44, is " << last_msg_.rle_list[179]; - EXPECT_EQ(last_msg_.rle_list[180], 170) << "incorrect value for last_msg_.rle_list[180], expected 170, is " << last_msg_.rle_list[180]; - EXPECT_EQ(last_msg_.rle_list[181], 145) << "incorrect value for last_msg_.rle_list[181], expected 145, is " << last_msg_.rle_list[181]; - EXPECT_EQ(last_msg_.rle_list[182], 36) << "incorrect value for last_msg_.rle_list[182], expected 36, is " << last_msg_.rle_list[182]; - EXPECT_EQ(last_msg_.rle_list[183], 58) << "incorrect value for last_msg_.rle_list[183], expected 58, is " << last_msg_.rle_list[183]; - EXPECT_EQ(last_msg_.rle_list[184], 96) << "incorrect value for last_msg_.rle_list[184], expected 96, is " << last_msg_.rle_list[184]; - EXPECT_EQ(last_msg_.rle_list[185], 107) << "incorrect value for last_msg_.rle_list[185], expected 107, is " << last_msg_.rle_list[185]; - EXPECT_EQ(last_msg_.rle_list[186], 144) << "incorrect value for last_msg_.rle_list[186], expected 144, is " << last_msg_.rle_list[186]; - EXPECT_EQ(last_msg_.rle_list[187], 11) << "incorrect value for last_msg_.rle_list[187], expected 11, is " << last_msg_.rle_list[187]; - EXPECT_EQ(last_msg_.rle_list[188], 228) << "incorrect value for last_msg_.rle_list[188], expected 228, is " << last_msg_.rle_list[188]; - EXPECT_EQ(last_msg_.rle_list[189], 12) << "incorrect value for last_msg_.rle_list[189], expected 12, is " << last_msg_.rle_list[189]; - EXPECT_EQ(last_msg_.rle_list[190], 163) << "incorrect value for last_msg_.rle_list[190], expected 163, is " << last_msg_.rle_list[190]; - EXPECT_EQ(last_msg_.rle_list[191], 238) << "incorrect value for last_msg_.rle_list[191], expected 238, is " << last_msg_.rle_list[191]; - EXPECT_EQ(last_msg_.rle_list[192], 247) << "incorrect value for last_msg_.rle_list[192], expected 247, is " << last_msg_.rle_list[192]; - EXPECT_EQ(last_msg_.rle_list[193], 159) << "incorrect value for last_msg_.rle_list[193], expected 159, is " << last_msg_.rle_list[193]; - EXPECT_EQ(last_msg_.rle_list[194], 189) << "incorrect value for last_msg_.rle_list[194], expected 189, is " << last_msg_.rle_list[194]; - EXPECT_EQ(last_msg_.rle_list[195], 1) << "incorrect value for last_msg_.rle_list[195], expected 1, is " << last_msg_.rle_list[195]; - EXPECT_EQ(last_msg_.rle_list[196], 115) << "incorrect value for last_msg_.rle_list[196], expected 115, is " << last_msg_.rle_list[196]; - EXPECT_EQ(last_msg_.rle_list[197], 65) << "incorrect value for last_msg_.rle_list[197], expected 65, is " << last_msg_.rle_list[197]; - EXPECT_EQ(last_msg_.rle_list[198], 202) << "incorrect value for last_msg_.rle_list[198], expected 202, is " << last_msg_.rle_list[198]; - EXPECT_EQ(last_msg_.rle_list[199], 121) << "incorrect value for last_msg_.rle_list[199], expected 121, is " << last_msg_.rle_list[199]; - EXPECT_EQ(last_msg_.rle_list[200], 47) << "incorrect value for last_msg_.rle_list[200], expected 47, is " << last_msg_.rle_list[200]; - EXPECT_EQ(last_msg_.rle_list[201], 193) << "incorrect value for last_msg_.rle_list[201], expected 193, is " << last_msg_.rle_list[201]; - EXPECT_EQ(last_msg_.rle_list[202], 11) << "incorrect value for last_msg_.rle_list[202], expected 11, is " << last_msg_.rle_list[202]; - EXPECT_EQ(last_msg_.rle_list[203], 96) << "incorrect value for last_msg_.rle_list[203], expected 96, is " << last_msg_.rle_list[203]; - EXPECT_EQ(last_msg_.rle_list[204], 93) << "incorrect value for last_msg_.rle_list[204], expected 93, is " << last_msg_.rle_list[204]; - EXPECT_EQ(last_msg_.rle_list[205], 72) << "incorrect value for last_msg_.rle_list[205], expected 72, is " << last_msg_.rle_list[205]; - EXPECT_EQ(last_msg_.rle_list[206], 81) << "incorrect value for last_msg_.rle_list[206], expected 81, is " << last_msg_.rle_list[206]; - EXPECT_EQ(last_msg_.rle_list[207], 207) << "incorrect value for last_msg_.rle_list[207], expected 207, is " << last_msg_.rle_list[207]; - EXPECT_EQ(last_msg_.rle_list[208], 121) << "incorrect value for last_msg_.rle_list[208], expected 121, is " << last_msg_.rle_list[208]; - EXPECT_EQ(last_msg_.rle_list[209], 19) << "incorrect value for last_msg_.rle_list[209], expected 19, is " << last_msg_.rle_list[209]; - EXPECT_EQ(last_msg_.rle_list[210], 151) << "incorrect value for last_msg_.rle_list[210], expected 151, is " << last_msg_.rle_list[210]; - EXPECT_EQ(last_msg_.rle_list[211], 136) << "incorrect value for last_msg_.rle_list[211], expected 136, is " << last_msg_.rle_list[211]; - EXPECT_EQ(last_msg_.rle_list[212], 233) << "incorrect value for last_msg_.rle_list[212], expected 233, is " << last_msg_.rle_list[212]; - EXPECT_EQ(last_msg_.rle_list[213], 51) << "incorrect value for last_msg_.rle_list[213], expected 51, is " << last_msg_.rle_list[213]; - EXPECT_EQ(last_msg_.rle_list[214], 133) << "incorrect value for last_msg_.rle_list[214], expected 133, is " << last_msg_.rle_list[214]; - EXPECT_EQ(last_msg_.rle_list[215], 195) << "incorrect value for last_msg_.rle_list[215], expected 195, is " << last_msg_.rle_list[215]; - EXPECT_EQ(last_msg_.rle_list[216], 77) << "incorrect value for last_msg_.rle_list[216], expected 77, is " << last_msg_.rle_list[216]; - EXPECT_EQ(last_msg_.rle_list[217], 44) << "incorrect value for last_msg_.rle_list[217], expected 44, is " << last_msg_.rle_list[217]; - EXPECT_EQ(last_msg_.rle_list[218], 147) << "incorrect value for last_msg_.rle_list[218], expected 147, is " << last_msg_.rle_list[218]; - EXPECT_EQ(last_msg_.rle_list[219], 206) << "incorrect value for last_msg_.rle_list[219], expected 206, is " << last_msg_.rle_list[219]; - EXPECT_EQ(last_msg_.rle_list[220], 120) << "incorrect value for last_msg_.rle_list[220], expected 120, is " << last_msg_.rle_list[220]; - EXPECT_EQ(last_msg_.rle_list[221], 252) << "incorrect value for last_msg_.rle_list[221], expected 252, is " << last_msg_.rle_list[221]; - EXPECT_EQ(last_msg_.rle_list[222], 77) << "incorrect value for last_msg_.rle_list[222], expected 77, is " << last_msg_.rle_list[222]; - EXPECT_EQ(last_msg_.rle_list[223], 212) << "incorrect value for last_msg_.rle_list[223], expected 212, is " << last_msg_.rle_list[223]; - EXPECT_EQ(last_msg_.rle_list[224], 68) << "incorrect value for last_msg_.rle_list[224], expected 68, is " << last_msg_.rle_list[224]; - EXPECT_EQ(last_msg_.rle_list[225], 60) << "incorrect value for last_msg_.rle_list[225], expected 60, is " << last_msg_.rle_list[225]; - EXPECT_EQ(last_msg_.rle_list[226], 206) << "incorrect value for last_msg_.rle_list[226], expected 206, is " << last_msg_.rle_list[226]; - EXPECT_EQ(last_msg_.rle_list[227], 106) << "incorrect value for last_msg_.rle_list[227], expected 106, is " << last_msg_.rle_list[227]; - EXPECT_EQ(last_msg_.rle_list[228], 207) << "incorrect value for last_msg_.rle_list[228], expected 207, is " << last_msg_.rle_list[228]; - EXPECT_EQ(last_msg_.rle_list[229], 243) << "incorrect value for last_msg_.rle_list[229], expected 243, is " << last_msg_.rle_list[229]; - EXPECT_EQ(last_msg_.rle_list[230], 158) << "incorrect value for last_msg_.rle_list[230], expected 158, is " << last_msg_.rle_list[230]; - EXPECT_EQ(last_msg_.rle_list[231], 94) << "incorrect value for last_msg_.rle_list[231], expected 94, is " << last_msg_.rle_list[231]; - EXPECT_EQ(last_msg_.rle_list[232], 6) << "incorrect value for last_msg_.rle_list[232], expected 6, is " << last_msg_.rle_list[232]; - EXPECT_EQ(last_msg_.rle_list[233], 3) << "incorrect value for last_msg_.rle_list[233], expected 3, is " << last_msg_.rle_list[233]; - EXPECT_EQ(last_msg_.rle_list[234], 205) << "incorrect value for last_msg_.rle_list[234], expected 205, is " << last_msg_.rle_list[234]; - EXPECT_EQ(last_msg_.rle_list[235], 92) << "incorrect value for last_msg_.rle_list[235], expected 92, is " << last_msg_.rle_list[235]; - EXPECT_EQ(last_msg_.rle_list[236], 84) << "incorrect value for last_msg_.rle_list[236], expected 84, is " << last_msg_.rle_list[236]; - EXPECT_EQ(last_msg_.rle_list[237], 2) << "incorrect value for last_msg_.rle_list[237], expected 2, is " << last_msg_.rle_list[237]; - EXPECT_EQ(last_msg_.rle_list[238], 220) << "incorrect value for last_msg_.rle_list[238], expected 220, is " << last_msg_.rle_list[238]; - EXPECT_EQ(last_msg_.rle_list[239], 50) << "incorrect value for last_msg_.rle_list[239], expected 50, is " << last_msg_.rle_list[239]; - EXPECT_EQ(last_msg_.rle_list[240], 61) << "incorrect value for last_msg_.rle_list[240], expected 61, is " << last_msg_.rle_list[240]; - EXPECT_EQ(last_msg_.rle_list[241], 38) << "incorrect value for last_msg_.rle_list[241], expected 38, is " << last_msg_.rle_list[241]; - EXPECT_EQ(last_msg_.rle_list[242], 141) << "incorrect value for last_msg_.rle_list[242], expected 141, is " << last_msg_.rle_list[242]; - EXPECT_EQ(last_msg_.rle_list[243], 117) << "incorrect value for last_msg_.rle_list[243], expected 117, is " << last_msg_.rle_list[243]; - EXPECT_EQ(last_msg_.rle_list[244], 108) << "incorrect value for last_msg_.rle_list[244], expected 108, is " << last_msg_.rle_list[244]; - EXPECT_EQ(last_msg_.rle_list[245], 101) << "incorrect value for last_msg_.rle_list[245], expected 101, is " << last_msg_.rle_list[245]; +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 245, 5, 181, 247, 255, 11, 84, 171, 229, 132, 143, 46, 204, 52, + 92, 104, 25, 204, 182, 22, 98, 203, 123, 211, 38, 13, 253, 129, 173, + 171, 235, 253, 26, 203, 3, 120, 126, 42, 44, 39, 87, 69, 154, 13, + 28, 179, 32, 47, 36, 195, 39, 198, 134, 235, 134, 57, 120, 243, 151, + 35, 17, 201, 211, 125, 117, 164, 142, 101, 239, 144, 158, 239, 90, 56, + 71, 120, 67, 221, 114, 10, 190, 4, 230, 164, 171, 78, 185, 90, 46, + 177, 82, 228, 123, 222, 227, 145, 195, 219, 27, 56, 227, 246, 215, 144, + 158, 31, 214, 241, 254, 200, 86, 142, 89, 12, 121, 29, 124, 9, 19, + 153, 44, 35, 126, 14, 217, 65, 116, 26, 139, 122, 114, 90, 124, 81, + 0, 186, 246, 46, 98, 179, 243, 198, 217, 36, 30, 202, 12, 135, 61, + 42, 150, 221, 102, 83, 179, 43, 252, 81, 62, 126, 204, 195, 238, 18, + 128, 193, 53, 94, 99, 63, 182, 2, 186, 220, 77, 186, 224, 220, 13, + 212, 182, 88, 15, 151, 5, 93, 251, 164, 18, 228, 168, 226, 195, 44, + 170, 145, 36, 58, 96, 107, 144, 11, 228, 12, 163, 238, 247, 159, 189, + 1, 115, 65, 202, 121, 47, 193, 11, 96, 93, 72, 81, 207, 121, 19, + 151, 136, 233, 51, 133, 195, 77, 44, 147, 206, 120, 252, 77, 212, 68, + 60, 206, 106, 207, 243, 158, 94, 6, 3, 205, 92, 84, 2, 220, 50, + 61, 38, 141, 117, 108, 101, 76, 139, + }; + + sbp_msg_ssr_grid_definition_dep_a_t test_msg{}; + test_msg.header.area_width = 43860; + test_msg.header.lat_nw_corner_enc = 34021; + test_msg.header.lon_nw_corner_enc = 11919; + test_msg.header.num_msgs = 204; + test_msg.header.region_size_inverse = 11; + test_msg.header.seq_num = 52; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_rle_list.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)114, (char)108, (char)101, (char)95, + (char)108, (char)105, (char)115, (char)116}; + memcpy(test_msg.n_rle_list.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_rle_list.value = 246; + + test_msg.rle_list[0] = 92; + + test_msg.rle_list[1] = 104; + + test_msg.rle_list[2] = 25; + + test_msg.rle_list[3] = 204; + + test_msg.rle_list[4] = 182; + + test_msg.rle_list[5] = 22; + + test_msg.rle_list[6] = 98; + + test_msg.rle_list[7] = 203; + + test_msg.rle_list[8] = 123; + + test_msg.rle_list[9] = 211; + + test_msg.rle_list[10] = 38; + + test_msg.rle_list[11] = 13; + + test_msg.rle_list[12] = 253; + + test_msg.rle_list[13] = 129; + + test_msg.rle_list[14] = 173; + + test_msg.rle_list[15] = 171; + + test_msg.rle_list[16] = 235; + + test_msg.rle_list[17] = 253; + + test_msg.rle_list[18] = 26; + + test_msg.rle_list[19] = 203; + + test_msg.rle_list[20] = 3; + + test_msg.rle_list[21] = 120; + + test_msg.rle_list[22] = 126; + + test_msg.rle_list[23] = 42; + + test_msg.rle_list[24] = 44; + + test_msg.rle_list[25] = 39; + + test_msg.rle_list[26] = 87; + + test_msg.rle_list[27] = 69; + + test_msg.rle_list[28] = 154; + + test_msg.rle_list[29] = 13; + + test_msg.rle_list[30] = 28; + + test_msg.rle_list[31] = 179; + + test_msg.rle_list[32] = 32; + + test_msg.rle_list[33] = 47; + + test_msg.rle_list[34] = 36; + + test_msg.rle_list[35] = 195; + + test_msg.rle_list[36] = 39; + + test_msg.rle_list[37] = 198; + + test_msg.rle_list[38] = 134; + + test_msg.rle_list[39] = 235; + + test_msg.rle_list[40] = 134; + + test_msg.rle_list[41] = 57; + + test_msg.rle_list[42] = 120; + + test_msg.rle_list[43] = 243; + + test_msg.rle_list[44] = 151; + + test_msg.rle_list[45] = 35; + + test_msg.rle_list[46] = 17; + + test_msg.rle_list[47] = 201; + + test_msg.rle_list[48] = 211; + + test_msg.rle_list[49] = 125; + + test_msg.rle_list[50] = 117; + + test_msg.rle_list[51] = 164; + + test_msg.rle_list[52] = 142; + + test_msg.rle_list[53] = 101; + + test_msg.rle_list[54] = 239; + + test_msg.rle_list[55] = 144; + + test_msg.rle_list[56] = 158; + + test_msg.rle_list[57] = 239; + + test_msg.rle_list[58] = 90; + + test_msg.rle_list[59] = 56; + + test_msg.rle_list[60] = 71; + + test_msg.rle_list[61] = 120; + + test_msg.rle_list[62] = 67; + + test_msg.rle_list[63] = 221; + + test_msg.rle_list[64] = 114; + + test_msg.rle_list[65] = 10; + + test_msg.rle_list[66] = 190; + + test_msg.rle_list[67] = 4; + + test_msg.rle_list[68] = 230; + + test_msg.rle_list[69] = 164; + + test_msg.rle_list[70] = 171; + + test_msg.rle_list[71] = 78; + + test_msg.rle_list[72] = 185; + + test_msg.rle_list[73] = 90; + + test_msg.rle_list[74] = 46; + + test_msg.rle_list[75] = 177; + + test_msg.rle_list[76] = 82; + + test_msg.rle_list[77] = 228; + + test_msg.rle_list[78] = 123; + + test_msg.rle_list[79] = 222; + + test_msg.rle_list[80] = 227; + + test_msg.rle_list[81] = 145; + + test_msg.rle_list[82] = 195; + + test_msg.rle_list[83] = 219; + + test_msg.rle_list[84] = 27; + + test_msg.rle_list[85] = 56; + + test_msg.rle_list[86] = 227; + + test_msg.rle_list[87] = 246; + + test_msg.rle_list[88] = 215; + + test_msg.rle_list[89] = 144; + + test_msg.rle_list[90] = 158; + + test_msg.rle_list[91] = 31; + + test_msg.rle_list[92] = 214; + + test_msg.rle_list[93] = 241; + + test_msg.rle_list[94] = 254; + + test_msg.rle_list[95] = 200; + + test_msg.rle_list[96] = 86; + + test_msg.rle_list[97] = 142; + + test_msg.rle_list[98] = 89; + + test_msg.rle_list[99] = 12; + + test_msg.rle_list[100] = 121; + + test_msg.rle_list[101] = 29; + + test_msg.rle_list[102] = 124; + + test_msg.rle_list[103] = 9; + + test_msg.rle_list[104] = 19; + + test_msg.rle_list[105] = 153; + + test_msg.rle_list[106] = 44; + + test_msg.rle_list[107] = 35; + + test_msg.rle_list[108] = 126; + + test_msg.rle_list[109] = 14; + + test_msg.rle_list[110] = 217; + + test_msg.rle_list[111] = 65; + + test_msg.rle_list[112] = 116; + + test_msg.rle_list[113] = 26; + + test_msg.rle_list[114] = 139; + + test_msg.rle_list[115] = 122; + + test_msg.rle_list[116] = 114; + + test_msg.rle_list[117] = 90; + + test_msg.rle_list[118] = 124; + + test_msg.rle_list[119] = 81; + + test_msg.rle_list[120] = 0; + + test_msg.rle_list[121] = 186; + + test_msg.rle_list[122] = 246; + + test_msg.rle_list[123] = 46; + + test_msg.rle_list[124] = 98; + + test_msg.rle_list[125] = 179; + + test_msg.rle_list[126] = 243; + + test_msg.rle_list[127] = 198; + + test_msg.rle_list[128] = 217; + + test_msg.rle_list[129] = 36; + + test_msg.rle_list[130] = 30; + + test_msg.rle_list[131] = 202; + + test_msg.rle_list[132] = 12; + + test_msg.rle_list[133] = 135; + + test_msg.rle_list[134] = 61; + + test_msg.rle_list[135] = 42; + + test_msg.rle_list[136] = 150; + + test_msg.rle_list[137] = 221; + + test_msg.rle_list[138] = 102; + + test_msg.rle_list[139] = 83; + + test_msg.rle_list[140] = 179; + + test_msg.rle_list[141] = 43; + + test_msg.rle_list[142] = 252; + + test_msg.rle_list[143] = 81; + + test_msg.rle_list[144] = 62; + + test_msg.rle_list[145] = 126; + + test_msg.rle_list[146] = 204; + + test_msg.rle_list[147] = 195; + + test_msg.rle_list[148] = 238; + + test_msg.rle_list[149] = 18; + + test_msg.rle_list[150] = 128; + + test_msg.rle_list[151] = 193; + + test_msg.rle_list[152] = 53; + + test_msg.rle_list[153] = 94; + + test_msg.rle_list[154] = 99; + + test_msg.rle_list[155] = 63; + + test_msg.rle_list[156] = 182; + + test_msg.rle_list[157] = 2; + + test_msg.rle_list[158] = 186; + + test_msg.rle_list[159] = 220; + + test_msg.rle_list[160] = 77; + + test_msg.rle_list[161] = 186; + + test_msg.rle_list[162] = 224; + + test_msg.rle_list[163] = 220; + + test_msg.rle_list[164] = 13; + + test_msg.rle_list[165] = 212; + + test_msg.rle_list[166] = 182; + + test_msg.rle_list[167] = 88; + + test_msg.rle_list[168] = 15; + + test_msg.rle_list[169] = 151; + + test_msg.rle_list[170] = 5; + + test_msg.rle_list[171] = 93; + + test_msg.rle_list[172] = 251; + + test_msg.rle_list[173] = 164; + + test_msg.rle_list[174] = 18; + + test_msg.rle_list[175] = 228; + + test_msg.rle_list[176] = 168; + + test_msg.rle_list[177] = 226; + + test_msg.rle_list[178] = 195; + + test_msg.rle_list[179] = 44; + + test_msg.rle_list[180] = 170; + + test_msg.rle_list[181] = 145; + + test_msg.rle_list[182] = 36; + + test_msg.rle_list[183] = 58; + + test_msg.rle_list[184] = 96; + + test_msg.rle_list[185] = 107; + + test_msg.rle_list[186] = 144; + + test_msg.rle_list[187] = 11; + + test_msg.rle_list[188] = 228; + + test_msg.rle_list[189] = 12; + + test_msg.rle_list[190] = 163; + + test_msg.rle_list[191] = 238; + + test_msg.rle_list[192] = 247; + + test_msg.rle_list[193] = 159; + + test_msg.rle_list[194] = 189; + + test_msg.rle_list[195] = 1; + + test_msg.rle_list[196] = 115; + + test_msg.rle_list[197] = 65; + + test_msg.rle_list[198] = 202; + + test_msg.rle_list[199] = 121; + + test_msg.rle_list[200] = 47; + + test_msg.rle_list[201] = 193; + + test_msg.rle_list[202] = 11; + + test_msg.rle_list[203] = 96; + + test_msg.rle_list[204] = 93; + + test_msg.rle_list[205] = 72; + + test_msg.rle_list[206] = 81; + + test_msg.rle_list[207] = 207; + + test_msg.rle_list[208] = 121; + + test_msg.rle_list[209] = 19; + + test_msg.rle_list[210] = 151; + + test_msg.rle_list[211] = 136; + + test_msg.rle_list[212] = 233; + + test_msg.rle_list[213] = 51; + + test_msg.rle_list[214] = 133; + + test_msg.rle_list[215] = 195; + + test_msg.rle_list[216] = 77; + + test_msg.rle_list[217] = 44; + + test_msg.rle_list[218] = 147; + + test_msg.rle_list[219] = 206; + + test_msg.rle_list[220] = 120; + + test_msg.rle_list[221] = 252; + + test_msg.rle_list[222] = 77; + + test_msg.rle_list[223] = 212; + + test_msg.rle_list[224] = 68; + + test_msg.rle_list[225] = 60; + + test_msg.rle_list[226] = 206; + + test_msg.rle_list[227] = 106; + + test_msg.rle_list[228] = 207; + + test_msg.rle_list[229] = 243; + + test_msg.rle_list[230] = 158; + + test_msg.rle_list[231] = 94; + + test_msg.rle_list[232] = 6; + + test_msg.rle_list[233] = 3; + + test_msg.rle_list[234] = 205; + + test_msg.rle_list[235] = 92; + + test_msg.rle_list[236] = 84; + + test_msg.rle_list[237] = 2; + + test_msg.rle_list[238] = 220; + + test_msg.rle_list[239] = 50; + + test_msg.rle_list[240] = 61; + + test_msg.rle_list[241] = 38; + + test_msg.rle_list[242] = 141; + + test_msg.rle_list[243] = 117; + + test_msg.rle_list[244] = 108; + + test_msg.rle_list[245] = 101; + + EXPECT_EQ(send_message(63413, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 63413); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.area_width, 43860) + << "incorrect value for last_msg_.header.area_width, expected 43860, is " + << last_msg_.header.area_width; + EXPECT_EQ(last_msg_.header.lat_nw_corner_enc, 34021) + << "incorrect value for last_msg_.header.lat_nw_corner_enc, expected " + "34021, is " + << last_msg_.header.lat_nw_corner_enc; + EXPECT_EQ(last_msg_.header.lon_nw_corner_enc, 11919) + << "incorrect value for last_msg_.header.lon_nw_corner_enc, expected " + "11919, is " + << last_msg_.header.lon_nw_corner_enc; + EXPECT_EQ(last_msg_.header.num_msgs, 204) + << "incorrect value for last_msg_.header.num_msgs, expected 204, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.region_size_inverse, 11) + << "incorrect value for last_msg_.header.region_size_inverse, expected " + "11, is " + << last_msg_.header.region_size_inverse; + EXPECT_EQ(last_msg_.header.seq_num, 52) + << "incorrect value for last_msg_.header.seq_num, expected 52, is " + << last_msg_.header.seq_num; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_rle_list.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_rle_list.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_rle_list.handle_as << "'"; + } + { + const char check_string[] = {(char)114, (char)108, (char)101, (char)95, + (char)108, (char)105, (char)115, (char)116}; + EXPECT_EQ(memcmp(last_msg_.n_rle_list.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_rle_list.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_rle_list.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_rle_list.value, 246) + << "incorrect value for last_msg_.n_rle_list.value, expected 246, is " + << last_msg_.n_rle_list.value; + EXPECT_EQ(last_msg_.rle_list[0], 92) + << "incorrect value for last_msg_.rle_list[0], expected 92, is " + << last_msg_.rle_list[0]; + EXPECT_EQ(last_msg_.rle_list[1], 104) + << "incorrect value for last_msg_.rle_list[1], expected 104, is " + << last_msg_.rle_list[1]; + EXPECT_EQ(last_msg_.rle_list[2], 25) + << "incorrect value for last_msg_.rle_list[2], expected 25, is " + << last_msg_.rle_list[2]; + EXPECT_EQ(last_msg_.rle_list[3], 204) + << "incorrect value for last_msg_.rle_list[3], expected 204, is " + << last_msg_.rle_list[3]; + EXPECT_EQ(last_msg_.rle_list[4], 182) + << "incorrect value for last_msg_.rle_list[4], expected 182, is " + << last_msg_.rle_list[4]; + EXPECT_EQ(last_msg_.rle_list[5], 22) + << "incorrect value for last_msg_.rle_list[5], expected 22, is " + << last_msg_.rle_list[5]; + EXPECT_EQ(last_msg_.rle_list[6], 98) + << "incorrect value for last_msg_.rle_list[6], expected 98, is " + << last_msg_.rle_list[6]; + EXPECT_EQ(last_msg_.rle_list[7], 203) + << "incorrect value for last_msg_.rle_list[7], expected 203, is " + << last_msg_.rle_list[7]; + EXPECT_EQ(last_msg_.rle_list[8], 123) + << "incorrect value for last_msg_.rle_list[8], expected 123, is " + << last_msg_.rle_list[8]; + EXPECT_EQ(last_msg_.rle_list[9], 211) + << "incorrect value for last_msg_.rle_list[9], expected 211, is " + << last_msg_.rle_list[9]; + EXPECT_EQ(last_msg_.rle_list[10], 38) + << "incorrect value for last_msg_.rle_list[10], expected 38, is " + << last_msg_.rle_list[10]; + EXPECT_EQ(last_msg_.rle_list[11], 13) + << "incorrect value for last_msg_.rle_list[11], expected 13, is " + << last_msg_.rle_list[11]; + EXPECT_EQ(last_msg_.rle_list[12], 253) + << "incorrect value for last_msg_.rle_list[12], expected 253, is " + << last_msg_.rle_list[12]; + EXPECT_EQ(last_msg_.rle_list[13], 129) + << "incorrect value for last_msg_.rle_list[13], expected 129, is " + << last_msg_.rle_list[13]; + EXPECT_EQ(last_msg_.rle_list[14], 173) + << "incorrect value for last_msg_.rle_list[14], expected 173, is " + << last_msg_.rle_list[14]; + EXPECT_EQ(last_msg_.rle_list[15], 171) + << "incorrect value for last_msg_.rle_list[15], expected 171, is " + << last_msg_.rle_list[15]; + EXPECT_EQ(last_msg_.rle_list[16], 235) + << "incorrect value for last_msg_.rle_list[16], expected 235, is " + << last_msg_.rle_list[16]; + EXPECT_EQ(last_msg_.rle_list[17], 253) + << "incorrect value for last_msg_.rle_list[17], expected 253, is " + << last_msg_.rle_list[17]; + EXPECT_EQ(last_msg_.rle_list[18], 26) + << "incorrect value for last_msg_.rle_list[18], expected 26, is " + << last_msg_.rle_list[18]; + EXPECT_EQ(last_msg_.rle_list[19], 203) + << "incorrect value for last_msg_.rle_list[19], expected 203, is " + << last_msg_.rle_list[19]; + EXPECT_EQ(last_msg_.rle_list[20], 3) + << "incorrect value for last_msg_.rle_list[20], expected 3, is " + << last_msg_.rle_list[20]; + EXPECT_EQ(last_msg_.rle_list[21], 120) + << "incorrect value for last_msg_.rle_list[21], expected 120, is " + << last_msg_.rle_list[21]; + EXPECT_EQ(last_msg_.rle_list[22], 126) + << "incorrect value for last_msg_.rle_list[22], expected 126, is " + << last_msg_.rle_list[22]; + EXPECT_EQ(last_msg_.rle_list[23], 42) + << "incorrect value for last_msg_.rle_list[23], expected 42, is " + << last_msg_.rle_list[23]; + EXPECT_EQ(last_msg_.rle_list[24], 44) + << "incorrect value for last_msg_.rle_list[24], expected 44, is " + << last_msg_.rle_list[24]; + EXPECT_EQ(last_msg_.rle_list[25], 39) + << "incorrect value for last_msg_.rle_list[25], expected 39, is " + << last_msg_.rle_list[25]; + EXPECT_EQ(last_msg_.rle_list[26], 87) + << "incorrect value for last_msg_.rle_list[26], expected 87, is " + << last_msg_.rle_list[26]; + EXPECT_EQ(last_msg_.rle_list[27], 69) + << "incorrect value for last_msg_.rle_list[27], expected 69, is " + << last_msg_.rle_list[27]; + EXPECT_EQ(last_msg_.rle_list[28], 154) + << "incorrect value for last_msg_.rle_list[28], expected 154, is " + << last_msg_.rle_list[28]; + EXPECT_EQ(last_msg_.rle_list[29], 13) + << "incorrect value for last_msg_.rle_list[29], expected 13, is " + << last_msg_.rle_list[29]; + EXPECT_EQ(last_msg_.rle_list[30], 28) + << "incorrect value for last_msg_.rle_list[30], expected 28, is " + << last_msg_.rle_list[30]; + EXPECT_EQ(last_msg_.rle_list[31], 179) + << "incorrect value for last_msg_.rle_list[31], expected 179, is " + << last_msg_.rle_list[31]; + EXPECT_EQ(last_msg_.rle_list[32], 32) + << "incorrect value for last_msg_.rle_list[32], expected 32, is " + << last_msg_.rle_list[32]; + EXPECT_EQ(last_msg_.rle_list[33], 47) + << "incorrect value for last_msg_.rle_list[33], expected 47, is " + << last_msg_.rle_list[33]; + EXPECT_EQ(last_msg_.rle_list[34], 36) + << "incorrect value for last_msg_.rle_list[34], expected 36, is " + << last_msg_.rle_list[34]; + EXPECT_EQ(last_msg_.rle_list[35], 195) + << "incorrect value for last_msg_.rle_list[35], expected 195, is " + << last_msg_.rle_list[35]; + EXPECT_EQ(last_msg_.rle_list[36], 39) + << "incorrect value for last_msg_.rle_list[36], expected 39, is " + << last_msg_.rle_list[36]; + EXPECT_EQ(last_msg_.rle_list[37], 198) + << "incorrect value for last_msg_.rle_list[37], expected 198, is " + << last_msg_.rle_list[37]; + EXPECT_EQ(last_msg_.rle_list[38], 134) + << "incorrect value for last_msg_.rle_list[38], expected 134, is " + << last_msg_.rle_list[38]; + EXPECT_EQ(last_msg_.rle_list[39], 235) + << "incorrect value for last_msg_.rle_list[39], expected 235, is " + << last_msg_.rle_list[39]; + EXPECT_EQ(last_msg_.rle_list[40], 134) + << "incorrect value for last_msg_.rle_list[40], expected 134, is " + << last_msg_.rle_list[40]; + EXPECT_EQ(last_msg_.rle_list[41], 57) + << "incorrect value for last_msg_.rle_list[41], expected 57, is " + << last_msg_.rle_list[41]; + EXPECT_EQ(last_msg_.rle_list[42], 120) + << "incorrect value for last_msg_.rle_list[42], expected 120, is " + << last_msg_.rle_list[42]; + EXPECT_EQ(last_msg_.rle_list[43], 243) + << "incorrect value for last_msg_.rle_list[43], expected 243, is " + << last_msg_.rle_list[43]; + EXPECT_EQ(last_msg_.rle_list[44], 151) + << "incorrect value for last_msg_.rle_list[44], expected 151, is " + << last_msg_.rle_list[44]; + EXPECT_EQ(last_msg_.rle_list[45], 35) + << "incorrect value for last_msg_.rle_list[45], expected 35, is " + << last_msg_.rle_list[45]; + EXPECT_EQ(last_msg_.rle_list[46], 17) + << "incorrect value for last_msg_.rle_list[46], expected 17, is " + << last_msg_.rle_list[46]; + EXPECT_EQ(last_msg_.rle_list[47], 201) + << "incorrect value for last_msg_.rle_list[47], expected 201, is " + << last_msg_.rle_list[47]; + EXPECT_EQ(last_msg_.rle_list[48], 211) + << "incorrect value for last_msg_.rle_list[48], expected 211, is " + << last_msg_.rle_list[48]; + EXPECT_EQ(last_msg_.rle_list[49], 125) + << "incorrect value for last_msg_.rle_list[49], expected 125, is " + << last_msg_.rle_list[49]; + EXPECT_EQ(last_msg_.rle_list[50], 117) + << "incorrect value for last_msg_.rle_list[50], expected 117, is " + << last_msg_.rle_list[50]; + EXPECT_EQ(last_msg_.rle_list[51], 164) + << "incorrect value for last_msg_.rle_list[51], expected 164, is " + << last_msg_.rle_list[51]; + EXPECT_EQ(last_msg_.rle_list[52], 142) + << "incorrect value for last_msg_.rle_list[52], expected 142, is " + << last_msg_.rle_list[52]; + EXPECT_EQ(last_msg_.rle_list[53], 101) + << "incorrect value for last_msg_.rle_list[53], expected 101, is " + << last_msg_.rle_list[53]; + EXPECT_EQ(last_msg_.rle_list[54], 239) + << "incorrect value for last_msg_.rle_list[54], expected 239, is " + << last_msg_.rle_list[54]; + EXPECT_EQ(last_msg_.rle_list[55], 144) + << "incorrect value for last_msg_.rle_list[55], expected 144, is " + << last_msg_.rle_list[55]; + EXPECT_EQ(last_msg_.rle_list[56], 158) + << "incorrect value for last_msg_.rle_list[56], expected 158, is " + << last_msg_.rle_list[56]; + EXPECT_EQ(last_msg_.rle_list[57], 239) + << "incorrect value for last_msg_.rle_list[57], expected 239, is " + << last_msg_.rle_list[57]; + EXPECT_EQ(last_msg_.rle_list[58], 90) + << "incorrect value for last_msg_.rle_list[58], expected 90, is " + << last_msg_.rle_list[58]; + EXPECT_EQ(last_msg_.rle_list[59], 56) + << "incorrect value for last_msg_.rle_list[59], expected 56, is " + << last_msg_.rle_list[59]; + EXPECT_EQ(last_msg_.rle_list[60], 71) + << "incorrect value for last_msg_.rle_list[60], expected 71, is " + << last_msg_.rle_list[60]; + EXPECT_EQ(last_msg_.rle_list[61], 120) + << "incorrect value for last_msg_.rle_list[61], expected 120, is " + << last_msg_.rle_list[61]; + EXPECT_EQ(last_msg_.rle_list[62], 67) + << "incorrect value for last_msg_.rle_list[62], expected 67, is " + << last_msg_.rle_list[62]; + EXPECT_EQ(last_msg_.rle_list[63], 221) + << "incorrect value for last_msg_.rle_list[63], expected 221, is " + << last_msg_.rle_list[63]; + EXPECT_EQ(last_msg_.rle_list[64], 114) + << "incorrect value for last_msg_.rle_list[64], expected 114, is " + << last_msg_.rle_list[64]; + EXPECT_EQ(last_msg_.rle_list[65], 10) + << "incorrect value for last_msg_.rle_list[65], expected 10, is " + << last_msg_.rle_list[65]; + EXPECT_EQ(last_msg_.rle_list[66], 190) + << "incorrect value for last_msg_.rle_list[66], expected 190, is " + << last_msg_.rle_list[66]; + EXPECT_EQ(last_msg_.rle_list[67], 4) + << "incorrect value for last_msg_.rle_list[67], expected 4, is " + << last_msg_.rle_list[67]; + EXPECT_EQ(last_msg_.rle_list[68], 230) + << "incorrect value for last_msg_.rle_list[68], expected 230, is " + << last_msg_.rle_list[68]; + EXPECT_EQ(last_msg_.rle_list[69], 164) + << "incorrect value for last_msg_.rle_list[69], expected 164, is " + << last_msg_.rle_list[69]; + EXPECT_EQ(last_msg_.rle_list[70], 171) + << "incorrect value for last_msg_.rle_list[70], expected 171, is " + << last_msg_.rle_list[70]; + EXPECT_EQ(last_msg_.rle_list[71], 78) + << "incorrect value for last_msg_.rle_list[71], expected 78, is " + << last_msg_.rle_list[71]; + EXPECT_EQ(last_msg_.rle_list[72], 185) + << "incorrect value for last_msg_.rle_list[72], expected 185, is " + << last_msg_.rle_list[72]; + EXPECT_EQ(last_msg_.rle_list[73], 90) + << "incorrect value for last_msg_.rle_list[73], expected 90, is " + << last_msg_.rle_list[73]; + EXPECT_EQ(last_msg_.rle_list[74], 46) + << "incorrect value for last_msg_.rle_list[74], expected 46, is " + << last_msg_.rle_list[74]; + EXPECT_EQ(last_msg_.rle_list[75], 177) + << "incorrect value for last_msg_.rle_list[75], expected 177, is " + << last_msg_.rle_list[75]; + EXPECT_EQ(last_msg_.rle_list[76], 82) + << "incorrect value for last_msg_.rle_list[76], expected 82, is " + << last_msg_.rle_list[76]; + EXPECT_EQ(last_msg_.rle_list[77], 228) + << "incorrect value for last_msg_.rle_list[77], expected 228, is " + << last_msg_.rle_list[77]; + EXPECT_EQ(last_msg_.rle_list[78], 123) + << "incorrect value for last_msg_.rle_list[78], expected 123, is " + << last_msg_.rle_list[78]; + EXPECT_EQ(last_msg_.rle_list[79], 222) + << "incorrect value for last_msg_.rle_list[79], expected 222, is " + << last_msg_.rle_list[79]; + EXPECT_EQ(last_msg_.rle_list[80], 227) + << "incorrect value for last_msg_.rle_list[80], expected 227, is " + << last_msg_.rle_list[80]; + EXPECT_EQ(last_msg_.rle_list[81], 145) + << "incorrect value for last_msg_.rle_list[81], expected 145, is " + << last_msg_.rle_list[81]; + EXPECT_EQ(last_msg_.rle_list[82], 195) + << "incorrect value for last_msg_.rle_list[82], expected 195, is " + << last_msg_.rle_list[82]; + EXPECT_EQ(last_msg_.rle_list[83], 219) + << "incorrect value for last_msg_.rle_list[83], expected 219, is " + << last_msg_.rle_list[83]; + EXPECT_EQ(last_msg_.rle_list[84], 27) + << "incorrect value for last_msg_.rle_list[84], expected 27, is " + << last_msg_.rle_list[84]; + EXPECT_EQ(last_msg_.rle_list[85], 56) + << "incorrect value for last_msg_.rle_list[85], expected 56, is " + << last_msg_.rle_list[85]; + EXPECT_EQ(last_msg_.rle_list[86], 227) + << "incorrect value for last_msg_.rle_list[86], expected 227, is " + << last_msg_.rle_list[86]; + EXPECT_EQ(last_msg_.rle_list[87], 246) + << "incorrect value for last_msg_.rle_list[87], expected 246, is " + << last_msg_.rle_list[87]; + EXPECT_EQ(last_msg_.rle_list[88], 215) + << "incorrect value for last_msg_.rle_list[88], expected 215, is " + << last_msg_.rle_list[88]; + EXPECT_EQ(last_msg_.rle_list[89], 144) + << "incorrect value for last_msg_.rle_list[89], expected 144, is " + << last_msg_.rle_list[89]; + EXPECT_EQ(last_msg_.rle_list[90], 158) + << "incorrect value for last_msg_.rle_list[90], expected 158, is " + << last_msg_.rle_list[90]; + EXPECT_EQ(last_msg_.rle_list[91], 31) + << "incorrect value for last_msg_.rle_list[91], expected 31, is " + << last_msg_.rle_list[91]; + EXPECT_EQ(last_msg_.rle_list[92], 214) + << "incorrect value for last_msg_.rle_list[92], expected 214, is " + << last_msg_.rle_list[92]; + EXPECT_EQ(last_msg_.rle_list[93], 241) + << "incorrect value for last_msg_.rle_list[93], expected 241, is " + << last_msg_.rle_list[93]; + EXPECT_EQ(last_msg_.rle_list[94], 254) + << "incorrect value for last_msg_.rle_list[94], expected 254, is " + << last_msg_.rle_list[94]; + EXPECT_EQ(last_msg_.rle_list[95], 200) + << "incorrect value for last_msg_.rle_list[95], expected 200, is " + << last_msg_.rle_list[95]; + EXPECT_EQ(last_msg_.rle_list[96], 86) + << "incorrect value for last_msg_.rle_list[96], expected 86, is " + << last_msg_.rle_list[96]; + EXPECT_EQ(last_msg_.rle_list[97], 142) + << "incorrect value for last_msg_.rle_list[97], expected 142, is " + << last_msg_.rle_list[97]; + EXPECT_EQ(last_msg_.rle_list[98], 89) + << "incorrect value for last_msg_.rle_list[98], expected 89, is " + << last_msg_.rle_list[98]; + EXPECT_EQ(last_msg_.rle_list[99], 12) + << "incorrect value for last_msg_.rle_list[99], expected 12, is " + << last_msg_.rle_list[99]; + EXPECT_EQ(last_msg_.rle_list[100], 121) + << "incorrect value for last_msg_.rle_list[100], expected 121, is " + << last_msg_.rle_list[100]; + EXPECT_EQ(last_msg_.rle_list[101], 29) + << "incorrect value for last_msg_.rle_list[101], expected 29, is " + << last_msg_.rle_list[101]; + EXPECT_EQ(last_msg_.rle_list[102], 124) + << "incorrect value for last_msg_.rle_list[102], expected 124, is " + << last_msg_.rle_list[102]; + EXPECT_EQ(last_msg_.rle_list[103], 9) + << "incorrect value for last_msg_.rle_list[103], expected 9, is " + << last_msg_.rle_list[103]; + EXPECT_EQ(last_msg_.rle_list[104], 19) + << "incorrect value for last_msg_.rle_list[104], expected 19, is " + << last_msg_.rle_list[104]; + EXPECT_EQ(last_msg_.rle_list[105], 153) + << "incorrect value for last_msg_.rle_list[105], expected 153, is " + << last_msg_.rle_list[105]; + EXPECT_EQ(last_msg_.rle_list[106], 44) + << "incorrect value for last_msg_.rle_list[106], expected 44, is " + << last_msg_.rle_list[106]; + EXPECT_EQ(last_msg_.rle_list[107], 35) + << "incorrect value for last_msg_.rle_list[107], expected 35, is " + << last_msg_.rle_list[107]; + EXPECT_EQ(last_msg_.rle_list[108], 126) + << "incorrect value for last_msg_.rle_list[108], expected 126, is " + << last_msg_.rle_list[108]; + EXPECT_EQ(last_msg_.rle_list[109], 14) + << "incorrect value for last_msg_.rle_list[109], expected 14, is " + << last_msg_.rle_list[109]; + EXPECT_EQ(last_msg_.rle_list[110], 217) + << "incorrect value for last_msg_.rle_list[110], expected 217, is " + << last_msg_.rle_list[110]; + EXPECT_EQ(last_msg_.rle_list[111], 65) + << "incorrect value for last_msg_.rle_list[111], expected 65, is " + << last_msg_.rle_list[111]; + EXPECT_EQ(last_msg_.rle_list[112], 116) + << "incorrect value for last_msg_.rle_list[112], expected 116, is " + << last_msg_.rle_list[112]; + EXPECT_EQ(last_msg_.rle_list[113], 26) + << "incorrect value for last_msg_.rle_list[113], expected 26, is " + << last_msg_.rle_list[113]; + EXPECT_EQ(last_msg_.rle_list[114], 139) + << "incorrect value for last_msg_.rle_list[114], expected 139, is " + << last_msg_.rle_list[114]; + EXPECT_EQ(last_msg_.rle_list[115], 122) + << "incorrect value for last_msg_.rle_list[115], expected 122, is " + << last_msg_.rle_list[115]; + EXPECT_EQ(last_msg_.rle_list[116], 114) + << "incorrect value for last_msg_.rle_list[116], expected 114, is " + << last_msg_.rle_list[116]; + EXPECT_EQ(last_msg_.rle_list[117], 90) + << "incorrect value for last_msg_.rle_list[117], expected 90, is " + << last_msg_.rle_list[117]; + EXPECT_EQ(last_msg_.rle_list[118], 124) + << "incorrect value for last_msg_.rle_list[118], expected 124, is " + << last_msg_.rle_list[118]; + EXPECT_EQ(last_msg_.rle_list[119], 81) + << "incorrect value for last_msg_.rle_list[119], expected 81, is " + << last_msg_.rle_list[119]; + EXPECT_EQ(last_msg_.rle_list[120], 0) + << "incorrect value for last_msg_.rle_list[120], expected 0, is " + << last_msg_.rle_list[120]; + EXPECT_EQ(last_msg_.rle_list[121], 186) + << "incorrect value for last_msg_.rle_list[121], expected 186, is " + << last_msg_.rle_list[121]; + EXPECT_EQ(last_msg_.rle_list[122], 246) + << "incorrect value for last_msg_.rle_list[122], expected 246, is " + << last_msg_.rle_list[122]; + EXPECT_EQ(last_msg_.rle_list[123], 46) + << "incorrect value for last_msg_.rle_list[123], expected 46, is " + << last_msg_.rle_list[123]; + EXPECT_EQ(last_msg_.rle_list[124], 98) + << "incorrect value for last_msg_.rle_list[124], expected 98, is " + << last_msg_.rle_list[124]; + EXPECT_EQ(last_msg_.rle_list[125], 179) + << "incorrect value for last_msg_.rle_list[125], expected 179, is " + << last_msg_.rle_list[125]; + EXPECT_EQ(last_msg_.rle_list[126], 243) + << "incorrect value for last_msg_.rle_list[126], expected 243, is " + << last_msg_.rle_list[126]; + EXPECT_EQ(last_msg_.rle_list[127], 198) + << "incorrect value for last_msg_.rle_list[127], expected 198, is " + << last_msg_.rle_list[127]; + EXPECT_EQ(last_msg_.rle_list[128], 217) + << "incorrect value for last_msg_.rle_list[128], expected 217, is " + << last_msg_.rle_list[128]; + EXPECT_EQ(last_msg_.rle_list[129], 36) + << "incorrect value for last_msg_.rle_list[129], expected 36, is " + << last_msg_.rle_list[129]; + EXPECT_EQ(last_msg_.rle_list[130], 30) + << "incorrect value for last_msg_.rle_list[130], expected 30, is " + << last_msg_.rle_list[130]; + EXPECT_EQ(last_msg_.rle_list[131], 202) + << "incorrect value for last_msg_.rle_list[131], expected 202, is " + << last_msg_.rle_list[131]; + EXPECT_EQ(last_msg_.rle_list[132], 12) + << "incorrect value for last_msg_.rle_list[132], expected 12, is " + << last_msg_.rle_list[132]; + EXPECT_EQ(last_msg_.rle_list[133], 135) + << "incorrect value for last_msg_.rle_list[133], expected 135, is " + << last_msg_.rle_list[133]; + EXPECT_EQ(last_msg_.rle_list[134], 61) + << "incorrect value for last_msg_.rle_list[134], expected 61, is " + << last_msg_.rle_list[134]; + EXPECT_EQ(last_msg_.rle_list[135], 42) + << "incorrect value for last_msg_.rle_list[135], expected 42, is " + << last_msg_.rle_list[135]; + EXPECT_EQ(last_msg_.rle_list[136], 150) + << "incorrect value for last_msg_.rle_list[136], expected 150, is " + << last_msg_.rle_list[136]; + EXPECT_EQ(last_msg_.rle_list[137], 221) + << "incorrect value for last_msg_.rle_list[137], expected 221, is " + << last_msg_.rle_list[137]; + EXPECT_EQ(last_msg_.rle_list[138], 102) + << "incorrect value for last_msg_.rle_list[138], expected 102, is " + << last_msg_.rle_list[138]; + EXPECT_EQ(last_msg_.rle_list[139], 83) + << "incorrect value for last_msg_.rle_list[139], expected 83, is " + << last_msg_.rle_list[139]; + EXPECT_EQ(last_msg_.rle_list[140], 179) + << "incorrect value for last_msg_.rle_list[140], expected 179, is " + << last_msg_.rle_list[140]; + EXPECT_EQ(last_msg_.rle_list[141], 43) + << "incorrect value for last_msg_.rle_list[141], expected 43, is " + << last_msg_.rle_list[141]; + EXPECT_EQ(last_msg_.rle_list[142], 252) + << "incorrect value for last_msg_.rle_list[142], expected 252, is " + << last_msg_.rle_list[142]; + EXPECT_EQ(last_msg_.rle_list[143], 81) + << "incorrect value for last_msg_.rle_list[143], expected 81, is " + << last_msg_.rle_list[143]; + EXPECT_EQ(last_msg_.rle_list[144], 62) + << "incorrect value for last_msg_.rle_list[144], expected 62, is " + << last_msg_.rle_list[144]; + EXPECT_EQ(last_msg_.rle_list[145], 126) + << "incorrect value for last_msg_.rle_list[145], expected 126, is " + << last_msg_.rle_list[145]; + EXPECT_EQ(last_msg_.rle_list[146], 204) + << "incorrect value for last_msg_.rle_list[146], expected 204, is " + << last_msg_.rle_list[146]; + EXPECT_EQ(last_msg_.rle_list[147], 195) + << "incorrect value for last_msg_.rle_list[147], expected 195, is " + << last_msg_.rle_list[147]; + EXPECT_EQ(last_msg_.rle_list[148], 238) + << "incorrect value for last_msg_.rle_list[148], expected 238, is " + << last_msg_.rle_list[148]; + EXPECT_EQ(last_msg_.rle_list[149], 18) + << "incorrect value for last_msg_.rle_list[149], expected 18, is " + << last_msg_.rle_list[149]; + EXPECT_EQ(last_msg_.rle_list[150], 128) + << "incorrect value for last_msg_.rle_list[150], expected 128, is " + << last_msg_.rle_list[150]; + EXPECT_EQ(last_msg_.rle_list[151], 193) + << "incorrect value for last_msg_.rle_list[151], expected 193, is " + << last_msg_.rle_list[151]; + EXPECT_EQ(last_msg_.rle_list[152], 53) + << "incorrect value for last_msg_.rle_list[152], expected 53, is " + << last_msg_.rle_list[152]; + EXPECT_EQ(last_msg_.rle_list[153], 94) + << "incorrect value for last_msg_.rle_list[153], expected 94, is " + << last_msg_.rle_list[153]; + EXPECT_EQ(last_msg_.rle_list[154], 99) + << "incorrect value for last_msg_.rle_list[154], expected 99, is " + << last_msg_.rle_list[154]; + EXPECT_EQ(last_msg_.rle_list[155], 63) + << "incorrect value for last_msg_.rle_list[155], expected 63, is " + << last_msg_.rle_list[155]; + EXPECT_EQ(last_msg_.rle_list[156], 182) + << "incorrect value for last_msg_.rle_list[156], expected 182, is " + << last_msg_.rle_list[156]; + EXPECT_EQ(last_msg_.rle_list[157], 2) + << "incorrect value for last_msg_.rle_list[157], expected 2, is " + << last_msg_.rle_list[157]; + EXPECT_EQ(last_msg_.rle_list[158], 186) + << "incorrect value for last_msg_.rle_list[158], expected 186, is " + << last_msg_.rle_list[158]; + EXPECT_EQ(last_msg_.rle_list[159], 220) + << "incorrect value for last_msg_.rle_list[159], expected 220, is " + << last_msg_.rle_list[159]; + EXPECT_EQ(last_msg_.rle_list[160], 77) + << "incorrect value for last_msg_.rle_list[160], expected 77, is " + << last_msg_.rle_list[160]; + EXPECT_EQ(last_msg_.rle_list[161], 186) + << "incorrect value for last_msg_.rle_list[161], expected 186, is " + << last_msg_.rle_list[161]; + EXPECT_EQ(last_msg_.rle_list[162], 224) + << "incorrect value for last_msg_.rle_list[162], expected 224, is " + << last_msg_.rle_list[162]; + EXPECT_EQ(last_msg_.rle_list[163], 220) + << "incorrect value for last_msg_.rle_list[163], expected 220, is " + << last_msg_.rle_list[163]; + EXPECT_EQ(last_msg_.rle_list[164], 13) + << "incorrect value for last_msg_.rle_list[164], expected 13, is " + << last_msg_.rle_list[164]; + EXPECT_EQ(last_msg_.rle_list[165], 212) + << "incorrect value for last_msg_.rle_list[165], expected 212, is " + << last_msg_.rle_list[165]; + EXPECT_EQ(last_msg_.rle_list[166], 182) + << "incorrect value for last_msg_.rle_list[166], expected 182, is " + << last_msg_.rle_list[166]; + EXPECT_EQ(last_msg_.rle_list[167], 88) + << "incorrect value for last_msg_.rle_list[167], expected 88, is " + << last_msg_.rle_list[167]; + EXPECT_EQ(last_msg_.rle_list[168], 15) + << "incorrect value for last_msg_.rle_list[168], expected 15, is " + << last_msg_.rle_list[168]; + EXPECT_EQ(last_msg_.rle_list[169], 151) + << "incorrect value for last_msg_.rle_list[169], expected 151, is " + << last_msg_.rle_list[169]; + EXPECT_EQ(last_msg_.rle_list[170], 5) + << "incorrect value for last_msg_.rle_list[170], expected 5, is " + << last_msg_.rle_list[170]; + EXPECT_EQ(last_msg_.rle_list[171], 93) + << "incorrect value for last_msg_.rle_list[171], expected 93, is " + << last_msg_.rle_list[171]; + EXPECT_EQ(last_msg_.rle_list[172], 251) + << "incorrect value for last_msg_.rle_list[172], expected 251, is " + << last_msg_.rle_list[172]; + EXPECT_EQ(last_msg_.rle_list[173], 164) + << "incorrect value for last_msg_.rle_list[173], expected 164, is " + << last_msg_.rle_list[173]; + EXPECT_EQ(last_msg_.rle_list[174], 18) + << "incorrect value for last_msg_.rle_list[174], expected 18, is " + << last_msg_.rle_list[174]; + EXPECT_EQ(last_msg_.rle_list[175], 228) + << "incorrect value for last_msg_.rle_list[175], expected 228, is " + << last_msg_.rle_list[175]; + EXPECT_EQ(last_msg_.rle_list[176], 168) + << "incorrect value for last_msg_.rle_list[176], expected 168, is " + << last_msg_.rle_list[176]; + EXPECT_EQ(last_msg_.rle_list[177], 226) + << "incorrect value for last_msg_.rle_list[177], expected 226, is " + << last_msg_.rle_list[177]; + EXPECT_EQ(last_msg_.rle_list[178], 195) + << "incorrect value for last_msg_.rle_list[178], expected 195, is " + << last_msg_.rle_list[178]; + EXPECT_EQ(last_msg_.rle_list[179], 44) + << "incorrect value for last_msg_.rle_list[179], expected 44, is " + << last_msg_.rle_list[179]; + EXPECT_EQ(last_msg_.rle_list[180], 170) + << "incorrect value for last_msg_.rle_list[180], expected 170, is " + << last_msg_.rle_list[180]; + EXPECT_EQ(last_msg_.rle_list[181], 145) + << "incorrect value for last_msg_.rle_list[181], expected 145, is " + << last_msg_.rle_list[181]; + EXPECT_EQ(last_msg_.rle_list[182], 36) + << "incorrect value for last_msg_.rle_list[182], expected 36, is " + << last_msg_.rle_list[182]; + EXPECT_EQ(last_msg_.rle_list[183], 58) + << "incorrect value for last_msg_.rle_list[183], expected 58, is " + << last_msg_.rle_list[183]; + EXPECT_EQ(last_msg_.rle_list[184], 96) + << "incorrect value for last_msg_.rle_list[184], expected 96, is " + << last_msg_.rle_list[184]; + EXPECT_EQ(last_msg_.rle_list[185], 107) + << "incorrect value for last_msg_.rle_list[185], expected 107, is " + << last_msg_.rle_list[185]; + EXPECT_EQ(last_msg_.rle_list[186], 144) + << "incorrect value for last_msg_.rle_list[186], expected 144, is " + << last_msg_.rle_list[186]; + EXPECT_EQ(last_msg_.rle_list[187], 11) + << "incorrect value for last_msg_.rle_list[187], expected 11, is " + << last_msg_.rle_list[187]; + EXPECT_EQ(last_msg_.rle_list[188], 228) + << "incorrect value for last_msg_.rle_list[188], expected 228, is " + << last_msg_.rle_list[188]; + EXPECT_EQ(last_msg_.rle_list[189], 12) + << "incorrect value for last_msg_.rle_list[189], expected 12, is " + << last_msg_.rle_list[189]; + EXPECT_EQ(last_msg_.rle_list[190], 163) + << "incorrect value for last_msg_.rle_list[190], expected 163, is " + << last_msg_.rle_list[190]; + EXPECT_EQ(last_msg_.rle_list[191], 238) + << "incorrect value for last_msg_.rle_list[191], expected 238, is " + << last_msg_.rle_list[191]; + EXPECT_EQ(last_msg_.rle_list[192], 247) + << "incorrect value for last_msg_.rle_list[192], expected 247, is " + << last_msg_.rle_list[192]; + EXPECT_EQ(last_msg_.rle_list[193], 159) + << "incorrect value for last_msg_.rle_list[193], expected 159, is " + << last_msg_.rle_list[193]; + EXPECT_EQ(last_msg_.rle_list[194], 189) + << "incorrect value for last_msg_.rle_list[194], expected 189, is " + << last_msg_.rle_list[194]; + EXPECT_EQ(last_msg_.rle_list[195], 1) + << "incorrect value for last_msg_.rle_list[195], expected 1, is " + << last_msg_.rle_list[195]; + EXPECT_EQ(last_msg_.rle_list[196], 115) + << "incorrect value for last_msg_.rle_list[196], expected 115, is " + << last_msg_.rle_list[196]; + EXPECT_EQ(last_msg_.rle_list[197], 65) + << "incorrect value for last_msg_.rle_list[197], expected 65, is " + << last_msg_.rle_list[197]; + EXPECT_EQ(last_msg_.rle_list[198], 202) + << "incorrect value for last_msg_.rle_list[198], expected 202, is " + << last_msg_.rle_list[198]; + EXPECT_EQ(last_msg_.rle_list[199], 121) + << "incorrect value for last_msg_.rle_list[199], expected 121, is " + << last_msg_.rle_list[199]; + EXPECT_EQ(last_msg_.rle_list[200], 47) + << "incorrect value for last_msg_.rle_list[200], expected 47, is " + << last_msg_.rle_list[200]; + EXPECT_EQ(last_msg_.rle_list[201], 193) + << "incorrect value for last_msg_.rle_list[201], expected 193, is " + << last_msg_.rle_list[201]; + EXPECT_EQ(last_msg_.rle_list[202], 11) + << "incorrect value for last_msg_.rle_list[202], expected 11, is " + << last_msg_.rle_list[202]; + EXPECT_EQ(last_msg_.rle_list[203], 96) + << "incorrect value for last_msg_.rle_list[203], expected 96, is " + << last_msg_.rle_list[203]; + EXPECT_EQ(last_msg_.rle_list[204], 93) + << "incorrect value for last_msg_.rle_list[204], expected 93, is " + << last_msg_.rle_list[204]; + EXPECT_EQ(last_msg_.rle_list[205], 72) + << "incorrect value for last_msg_.rle_list[205], expected 72, is " + << last_msg_.rle_list[205]; + EXPECT_EQ(last_msg_.rle_list[206], 81) + << "incorrect value for last_msg_.rle_list[206], expected 81, is " + << last_msg_.rle_list[206]; + EXPECT_EQ(last_msg_.rle_list[207], 207) + << "incorrect value for last_msg_.rle_list[207], expected 207, is " + << last_msg_.rle_list[207]; + EXPECT_EQ(last_msg_.rle_list[208], 121) + << "incorrect value for last_msg_.rle_list[208], expected 121, is " + << last_msg_.rle_list[208]; + EXPECT_EQ(last_msg_.rle_list[209], 19) + << "incorrect value for last_msg_.rle_list[209], expected 19, is " + << last_msg_.rle_list[209]; + EXPECT_EQ(last_msg_.rle_list[210], 151) + << "incorrect value for last_msg_.rle_list[210], expected 151, is " + << last_msg_.rle_list[210]; + EXPECT_EQ(last_msg_.rle_list[211], 136) + << "incorrect value for last_msg_.rle_list[211], expected 136, is " + << last_msg_.rle_list[211]; + EXPECT_EQ(last_msg_.rle_list[212], 233) + << "incorrect value for last_msg_.rle_list[212], expected 233, is " + << last_msg_.rle_list[212]; + EXPECT_EQ(last_msg_.rle_list[213], 51) + << "incorrect value for last_msg_.rle_list[213], expected 51, is " + << last_msg_.rle_list[213]; + EXPECT_EQ(last_msg_.rle_list[214], 133) + << "incorrect value for last_msg_.rle_list[214], expected 133, is " + << last_msg_.rle_list[214]; + EXPECT_EQ(last_msg_.rle_list[215], 195) + << "incorrect value for last_msg_.rle_list[215], expected 195, is " + << last_msg_.rle_list[215]; + EXPECT_EQ(last_msg_.rle_list[216], 77) + << "incorrect value for last_msg_.rle_list[216], expected 77, is " + << last_msg_.rle_list[216]; + EXPECT_EQ(last_msg_.rle_list[217], 44) + << "incorrect value for last_msg_.rle_list[217], expected 44, is " + << last_msg_.rle_list[217]; + EXPECT_EQ(last_msg_.rle_list[218], 147) + << "incorrect value for last_msg_.rle_list[218], expected 147, is " + << last_msg_.rle_list[218]; + EXPECT_EQ(last_msg_.rle_list[219], 206) + << "incorrect value for last_msg_.rle_list[219], expected 206, is " + << last_msg_.rle_list[219]; + EXPECT_EQ(last_msg_.rle_list[220], 120) + << "incorrect value for last_msg_.rle_list[220], expected 120, is " + << last_msg_.rle_list[220]; + EXPECT_EQ(last_msg_.rle_list[221], 252) + << "incorrect value for last_msg_.rle_list[221], expected 252, is " + << last_msg_.rle_list[221]; + EXPECT_EQ(last_msg_.rle_list[222], 77) + << "incorrect value for last_msg_.rle_list[222], expected 77, is " + << last_msg_.rle_list[222]; + EXPECT_EQ(last_msg_.rle_list[223], 212) + << "incorrect value for last_msg_.rle_list[223], expected 212, is " + << last_msg_.rle_list[223]; + EXPECT_EQ(last_msg_.rle_list[224], 68) + << "incorrect value for last_msg_.rle_list[224], expected 68, is " + << last_msg_.rle_list[224]; + EXPECT_EQ(last_msg_.rle_list[225], 60) + << "incorrect value for last_msg_.rle_list[225], expected 60, is " + << last_msg_.rle_list[225]; + EXPECT_EQ(last_msg_.rle_list[226], 206) + << "incorrect value for last_msg_.rle_list[226], expected 206, is " + << last_msg_.rle_list[226]; + EXPECT_EQ(last_msg_.rle_list[227], 106) + << "incorrect value for last_msg_.rle_list[227], expected 106, is " + << last_msg_.rle_list[227]; + EXPECT_EQ(last_msg_.rle_list[228], 207) + << "incorrect value for last_msg_.rle_list[228], expected 207, is " + << last_msg_.rle_list[228]; + EXPECT_EQ(last_msg_.rle_list[229], 243) + << "incorrect value for last_msg_.rle_list[229], expected 243, is " + << last_msg_.rle_list[229]; + EXPECT_EQ(last_msg_.rle_list[230], 158) + << "incorrect value for last_msg_.rle_list[230], expected 158, is " + << last_msg_.rle_list[230]; + EXPECT_EQ(last_msg_.rle_list[231], 94) + << "incorrect value for last_msg_.rle_list[231], expected 94, is " + << last_msg_.rle_list[231]; + EXPECT_EQ(last_msg_.rle_list[232], 6) + << "incorrect value for last_msg_.rle_list[232], expected 6, is " + << last_msg_.rle_list[232]; + EXPECT_EQ(last_msg_.rle_list[233], 3) + << "incorrect value for last_msg_.rle_list[233], expected 3, is " + << last_msg_.rle_list[233]; + EXPECT_EQ(last_msg_.rle_list[234], 205) + << "incorrect value for last_msg_.rle_list[234], expected 205, is " + << last_msg_.rle_list[234]; + EXPECT_EQ(last_msg_.rle_list[235], 92) + << "incorrect value for last_msg_.rle_list[235], expected 92, is " + << last_msg_.rle_list[235]; + EXPECT_EQ(last_msg_.rle_list[236], 84) + << "incorrect value for last_msg_.rle_list[236], expected 84, is " + << last_msg_.rle_list[236]; + EXPECT_EQ(last_msg_.rle_list[237], 2) + << "incorrect value for last_msg_.rle_list[237], expected 2, is " + << last_msg_.rle_list[237]; + EXPECT_EQ(last_msg_.rle_list[238], 220) + << "incorrect value for last_msg_.rle_list[238], expected 220, is " + << last_msg_.rle_list[238]; + EXPECT_EQ(last_msg_.rle_list[239], 50) + << "incorrect value for last_msg_.rle_list[239], expected 50, is " + << last_msg_.rle_list[239]; + EXPECT_EQ(last_msg_.rle_list[240], 61) + << "incorrect value for last_msg_.rle_list[240], expected 61, is " + << last_msg_.rle_list[240]; + EXPECT_EQ(last_msg_.rle_list[241], 38) + << "incorrect value for last_msg_.rle_list[241], expected 38, is " + << last_msg_.rle_list[241]; + EXPECT_EQ(last_msg_.rle_list[242], 141) + << "incorrect value for last_msg_.rle_list[242], expected 141, is " + << last_msg_.rle_list[242]; + EXPECT_EQ(last_msg_.rle_list[243], 117) + << "incorrect value for last_msg_.rle_list[243], expected 117, is " + << last_msg_.rle_list[243]; + EXPECT_EQ(last_msg_.rle_list[244], 108) + << "incorrect value for last_msg_.rle_list[244], expected 108, is " + << last_msg_.rle_list[244]; + EXPECT_EQ(last_msg_.rle_list[245], 101) + << "incorrect value for last_msg_.rle_list[245], expected 101, is " + << last_msg_.rle_list[245]; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrection.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrection.cc index f1d4eaf10..eb60e8518 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrection.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrection.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrection.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrection.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrGriddedCorrection0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrGriddedCorrection0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrGriddedCorrection0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrGriddedCorrection0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_gridded_correction_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_gridded_correction_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,488 +67,1116 @@ class Test_auto_check_sbp_ssr_MsgSsrGriddedCorrection0 : sbp_msg_ssr_gridded_correction_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrGriddedCorrection0, Test) -{ - - uint8_t encoded_frame[] = {85,252,5,196,249,253,21,14,151,50,120,133,29,151,174,229,151,189,204,196,105,170,120,149,169,37,244,78,72,140,101,2,173,88,70,180,54,152,115,78,201,161,23,135,152,98,61,75,178,120,229,146,55,58,169,234,230,69,172,191,127,146,89,150,91,111,225,41,17,119,52,166,166,120,57,221,12,3,156,70,156,35,127,8,127,58,128,55,115,80,157,122,153,124,27,128,98,103,204,75,238,128,226,148,248,61,216,208,149,167,224,40,144,186,157,227,72,240,100,35,12,212,7,59,176,81,86,27,24,155,67,43,132,45,203,44,6,112,183,231,176,79,194,253,247,103,91,226,116,148,23,62,227,240,29,219,205,18,242,207,72,71,79,37,42,176,201,202,91,105,115,146,59,110,44,109,128,183,185,67,31,165,92,79,189,180,94,7,162,121,156,210,47,7,7,205,174,41,241,129,210,43,101,186,208,195,226,247,187,219,160,120,192,102,166,42,246,173,94,102,156,222,30,35,247,64,189,137,204,220,32,71,222,222,201,246,3,25,45,251,239,115,88,218,10,209,120,65,175,131,194,41,174,137,17,68,28,253,42,178,35, }; - - sbp_msg_ssr_gridded_correction_t test_msg{}; - test_msg.header.iod_atmo = 170; - test_msg.header.num_msgs = 48535; - test_msg.header.seq_num = 50380; - test_msg.header.tile_id = 12951; - test_msg.header.tile_set_id = 3605; - test_msg.header.time.tow = 2535294328; - test_msg.header.time.wn = 58798; - test_msg.header.tropo_quality_indicator = 120; - test_msg.header.update_interval = 105; - test_msg.index = 43413; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_stec_residuals.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)101,(char)99,(char)95,(char)114,(char)101,(char)115,(char)105,(char)100,(char)117,(char)97,(char)108,(char)115 }; - memcpy(test_msg.n_stec_residuals.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_stec_residuals.value = 46; - - test_msg.stec_residuals[0].residual = -21246; - test_msg.stec_residuals[0].stddev = 88; - test_msg.stec_residuals[0].sv_id.constellation = 101; - test_msg.stec_residuals[0].sv_id.satId = 140; - - test_msg.stec_residuals[1].residual = -26570; - test_msg.stec_residuals[1].stddev = 115; - test_msg.stec_residuals[1].sv_id.constellation = 180; - test_msg.stec_residuals[1].sv_id.satId = 70; - - test_msg.stec_residuals[2].residual = 6049; - test_msg.stec_residuals[2].stddev = 135; - test_msg.stec_residuals[2].sv_id.constellation = 201; - test_msg.stec_residuals[2].sv_id.satId = 78; - - test_msg.stec_residuals[3].residual = 19261; - test_msg.stec_residuals[3].stddev = 178; - test_msg.stec_residuals[3].sv_id.constellation = 98; - test_msg.stec_residuals[3].sv_id.satId = 152; - - test_msg.stec_residuals[4].residual = 14226; - test_msg.stec_residuals[4].stddev = 58; - test_msg.stec_residuals[4].sv_id.constellation = 229; - test_msg.stec_residuals[4].sv_id.satId = 120; - - test_msg.stec_residuals[5].residual = 17894; - test_msg.stec_residuals[5].stddev = 172; - test_msg.stec_residuals[5].sv_id.constellation = 234; - test_msg.stec_residuals[5].sv_id.satId = 169; - - test_msg.stec_residuals[6].residual = 22930; - test_msg.stec_residuals[6].stddev = 150; - test_msg.stec_residuals[6].sv_id.constellation = 127; - test_msg.stec_residuals[6].sv_id.satId = 191; - - test_msg.stec_residuals[7].residual = 10721; - test_msg.stec_residuals[7].stddev = 17; - test_msg.stec_residuals[7].sv_id.constellation = 111; - test_msg.stec_residuals[7].sv_id.satId = 91; - - test_msg.stec_residuals[8].residual = -22874; - test_msg.stec_residuals[8].stddev = 120; - test_msg.stec_residuals[8].sv_id.constellation = 52; - test_msg.stec_residuals[8].sv_id.satId = 119; - - test_msg.stec_residuals[9].residual = 780; - test_msg.stec_residuals[9].stddev = 156; - test_msg.stec_residuals[9].sv_id.constellation = 221; - test_msg.stec_residuals[9].sv_id.satId = 57; - - test_msg.stec_residuals[10].residual = 32547; - test_msg.stec_residuals[10].stddev = 8; - test_msg.stec_residuals[10].sv_id.constellation = 156; - test_msg.stec_residuals[10].sv_id.satId = 70; - - test_msg.stec_residuals[11].residual = 14208; - test_msg.stec_residuals[11].stddev = 115; - test_msg.stec_residuals[11].sv_id.constellation = 58; - test_msg.stec_residuals[11].sv_id.satId = 127; - - test_msg.stec_residuals[12].residual = -26246; - test_msg.stec_residuals[12].stddev = 124; - test_msg.stec_residuals[12].sv_id.constellation = 157; - test_msg.stec_residuals[12].sv_id.satId = 80; - - test_msg.stec_residuals[13].residual = 26466; - test_msg.stec_residuals[13].stddev = 204; - test_msg.stec_residuals[13].sv_id.constellation = 128; - test_msg.stec_residuals[13].sv_id.satId = 27; - - test_msg.stec_residuals[14].residual = -7552; - test_msg.stec_residuals[14].stddev = 148; - test_msg.stec_residuals[14].sv_id.constellation = 238; - test_msg.stec_residuals[14].sv_id.satId = 75; - - test_msg.stec_residuals[15].residual = -12072; - test_msg.stec_residuals[15].stddev = 149; - test_msg.stec_residuals[15].sv_id.constellation = 61; - test_msg.stec_residuals[15].sv_id.satId = 248; - - test_msg.stec_residuals[16].residual = -28632; - test_msg.stec_residuals[16].stddev = 186; - test_msg.stec_residuals[16].sv_id.constellation = 224; - test_msg.stec_residuals[16].sv_id.satId = 167; - - test_msg.stec_residuals[17].residual = -4024; - test_msg.stec_residuals[17].stddev = 100; - test_msg.stec_residuals[17].sv_id.constellation = 227; - test_msg.stec_residuals[17].sv_id.satId = 157; - - test_msg.stec_residuals[18].residual = 2004; - test_msg.stec_residuals[18].stddev = 59; - test_msg.stec_residuals[18].sv_id.constellation = 12; - test_msg.stec_residuals[18].sv_id.satId = 35; - - test_msg.stec_residuals[19].residual = 6998; - test_msg.stec_residuals[19].stddev = 24; - test_msg.stec_residuals[19].sv_id.constellation = 81; - test_msg.stec_residuals[19].sv_id.satId = 176; - - test_msg.stec_residuals[20].residual = -31701; - test_msg.stec_residuals[20].stddev = 45; - test_msg.stec_residuals[20].sv_id.constellation = 67; - test_msg.stec_residuals[20].sv_id.satId = 155; - - test_msg.stec_residuals[21].residual = 28678; - test_msg.stec_residuals[21].stddev = 183; - test_msg.stec_residuals[21].sv_id.constellation = 44; - test_msg.stec_residuals[21].sv_id.satId = 203; - - test_msg.stec_residuals[22].residual = -15793; - test_msg.stec_residuals[22].stddev = 253; - test_msg.stec_residuals[22].sv_id.constellation = 176; - test_msg.stec_residuals[22].sv_id.satId = 231; - - test_msg.stec_residuals[23].residual = -7589; - test_msg.stec_residuals[23].stddev = 116; - test_msg.stec_residuals[23].sv_id.constellation = 103; - test_msg.stec_residuals[23].sv_id.satId = 247; - - test_msg.stec_residuals[24].residual = -7362; - test_msg.stec_residuals[24].stddev = 240; - test_msg.stec_residuals[24].sv_id.constellation = 23; - test_msg.stec_residuals[24].sv_id.satId = 148; - - test_msg.stec_residuals[25].residual = 4813; - test_msg.stec_residuals[25].stddev = 242; - test_msg.stec_residuals[25].sv_id.constellation = 219; - test_msg.stec_residuals[25].sv_id.satId = 29; - - test_msg.stec_residuals[26].residual = 20295; - test_msg.stec_residuals[26].stddev = 37; - test_msg.stec_residuals[26].sv_id.constellation = 72; - test_msg.stec_residuals[26].sv_id.satId = 207; - - test_msg.stec_residuals[27].residual = -13623; - test_msg.stec_residuals[27].stddev = 91; - test_msg.stec_residuals[27].sv_id.constellation = 176; - test_msg.stec_residuals[27].sv_id.satId = 42; - - test_msg.stec_residuals[28].residual = 15250; - test_msg.stec_residuals[28].stddev = 110; - test_msg.stec_residuals[28].sv_id.constellation = 115; - test_msg.stec_residuals[28].sv_id.satId = 105; - - test_msg.stec_residuals[29].residual = -18560; - test_msg.stec_residuals[29].stddev = 185; - test_msg.stec_residuals[29].sv_id.constellation = 109; - test_msg.stec_residuals[29].sv_id.satId = 44; - - test_msg.stec_residuals[30].residual = 23717; - test_msg.stec_residuals[30].stddev = 79; - test_msg.stec_residuals[30].sv_id.constellation = 31; - test_msg.stec_residuals[30].sv_id.satId = 67; - - test_msg.stec_residuals[31].residual = 1886; - test_msg.stec_residuals[31].stddev = 162; - test_msg.stec_residuals[31].sv_id.constellation = 180; - test_msg.stec_residuals[31].sv_id.satId = 189; - - test_msg.stec_residuals[32].residual = 12242; - test_msg.stec_residuals[32].stddev = 7; - test_msg.stec_residuals[32].sv_id.constellation = 156; - test_msg.stec_residuals[32].sv_id.satId = 121; - - test_msg.stec_residuals[33].residual = 10670; - test_msg.stec_residuals[33].stddev = 241; - test_msg.stec_residuals[33].sv_id.constellation = 205; - test_msg.stec_residuals[33].sv_id.satId = 7; - - test_msg.stec_residuals[34].residual = 25899; - test_msg.stec_residuals[34].stddev = 186; - test_msg.stec_residuals[34].sv_id.constellation = 210; - test_msg.stec_residuals[34].sv_id.satId = 129; - - test_msg.stec_residuals[35].residual = -2078; - test_msg.stec_residuals[35].stddev = 187; - test_msg.stec_residuals[35].sv_id.constellation = 195; - test_msg.stec_residuals[35].sv_id.satId = 208; - - test_msg.stec_residuals[36].residual = -16264; - test_msg.stec_residuals[36].stddev = 102; - test_msg.stec_residuals[36].sv_id.constellation = 160; - test_msg.stec_residuals[36].sv_id.satId = 219; - - test_msg.stec_residuals[37].residual = -21002; - test_msg.stec_residuals[37].stddev = 94; - test_msg.stec_residuals[37].sv_id.constellation = 42; - test_msg.stec_residuals[37].sv_id.satId = 166; - - test_msg.stec_residuals[38].residual = 7902; - test_msg.stec_residuals[38].stddev = 35; - test_msg.stec_residuals[38].sv_id.constellation = 156; - test_msg.stec_residuals[38].sv_id.satId = 102; - - test_msg.stec_residuals[39].residual = -30275; - test_msg.stec_residuals[39].stddev = 204; - test_msg.stec_residuals[39].sv_id.constellation = 64; - test_msg.stec_residuals[39].sv_id.satId = 247; - - test_msg.stec_residuals[40].residual = -8633; - test_msg.stec_residuals[40].stddev = 222; - test_msg.stec_residuals[40].sv_id.constellation = 32; - test_msg.stec_residuals[40].sv_id.satId = 220; - - test_msg.stec_residuals[41].residual = 6403; - test_msg.stec_residuals[41].stddev = 45; - test_msg.stec_residuals[41].sv_id.constellation = 246; - test_msg.stec_residuals[41].sv_id.satId = 201; - - test_msg.stec_residuals[42].residual = 22643; - test_msg.stec_residuals[42].stddev = 218; - test_msg.stec_residuals[42].sv_id.constellation = 239; - test_msg.stec_residuals[42].sv_id.satId = 251; - - test_msg.stec_residuals[43].residual = 16760; - test_msg.stec_residuals[43].stddev = 175; - test_msg.stec_residuals[43].sv_id.constellation = 209; - test_msg.stec_residuals[43].sv_id.satId = 10; - - test_msg.stec_residuals[44].residual = -20951; - test_msg.stec_residuals[44].stddev = 137; - test_msg.stec_residuals[44].sv_id.constellation = 194; - test_msg.stec_residuals[44].sv_id.satId = 131; - - test_msg.stec_residuals[45].residual = -740; - test_msg.stec_residuals[45].stddev = 42; - test_msg.stec_residuals[45].sv_id.constellation = 68; - test_msg.stec_residuals[45].sv_id.satId = 17; - test_msg.tropo_delay_correction.hydro = -3035; - test_msg.tropo_delay_correction.stddev = 72; - test_msg.tropo_delay_correction.wet = 78; - - EXPECT_EQ(send_message( 63940, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 63940); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.iod_atmo, 170) << "incorrect value for last_msg_.header.iod_atmo, expected 170, is " << last_msg_.header.iod_atmo; - EXPECT_EQ(last_msg_.header.num_msgs, 48535) << "incorrect value for last_msg_.header.num_msgs, expected 48535, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.seq_num, 50380) << "incorrect value for last_msg_.header.seq_num, expected 50380, is " << last_msg_.header.seq_num; - EXPECT_EQ(last_msg_.header.tile_id, 12951) << "incorrect value for last_msg_.header.tile_id, expected 12951, is " << last_msg_.header.tile_id; - EXPECT_EQ(last_msg_.header.tile_set_id, 3605) << "incorrect value for last_msg_.header.tile_set_id, expected 3605, is " << last_msg_.header.tile_set_id; - EXPECT_EQ(last_msg_.header.time.tow, 2535294328) << "incorrect value for last_msg_.header.time.tow, expected 2535294328, is " << last_msg_.header.time.tow; - EXPECT_EQ(last_msg_.header.time.wn, 58798) << "incorrect value for last_msg_.header.time.wn, expected 58798, is " << last_msg_.header.time.wn; - EXPECT_EQ(last_msg_.header.tropo_quality_indicator, 120) << "incorrect value for last_msg_.header.tropo_quality_indicator, expected 120, is " << last_msg_.header.tropo_quality_indicator; - EXPECT_EQ(last_msg_.header.update_interval, 105) << "incorrect value for last_msg_.header.update_interval, expected 105, is " << last_msg_.header.update_interval; - EXPECT_EQ(last_msg_.index, 43413) << "incorrect value for last_msg_.index, expected 43413, is " << last_msg_.index; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_stec_residuals.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_stec_residuals.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_stec_residuals.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)101,(char)99,(char)95,(char)114,(char)101,(char)115,(char)105,(char)100,(char)117,(char)97,(char)108,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_stec_residuals.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_stec_residuals.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_stec_residuals.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_stec_residuals.value, 46) << "incorrect value for last_msg_.n_stec_residuals.value, expected 46, is " << last_msg_.n_stec_residuals.value; - EXPECT_EQ(last_msg_.stec_residuals[0].residual, -21246) << "incorrect value for last_msg_.stec_residuals[0].residual, expected -21246, is " << last_msg_.stec_residuals[0].residual; - EXPECT_EQ(last_msg_.stec_residuals[0].stddev, 88) << "incorrect value for last_msg_.stec_residuals[0].stddev, expected 88, is " << last_msg_.stec_residuals[0].stddev; - EXPECT_EQ(last_msg_.stec_residuals[0].sv_id.constellation, 101) << "incorrect value for last_msg_.stec_residuals[0].sv_id.constellation, expected 101, is " << last_msg_.stec_residuals[0].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[0].sv_id.satId, 140) << "incorrect value for last_msg_.stec_residuals[0].sv_id.satId, expected 140, is " << last_msg_.stec_residuals[0].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[1].residual, -26570) << "incorrect value for last_msg_.stec_residuals[1].residual, expected -26570, is " << last_msg_.stec_residuals[1].residual; - EXPECT_EQ(last_msg_.stec_residuals[1].stddev, 115) << "incorrect value for last_msg_.stec_residuals[1].stddev, expected 115, is " << last_msg_.stec_residuals[1].stddev; - EXPECT_EQ(last_msg_.stec_residuals[1].sv_id.constellation, 180) << "incorrect value for last_msg_.stec_residuals[1].sv_id.constellation, expected 180, is " << last_msg_.stec_residuals[1].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[1].sv_id.satId, 70) << "incorrect value for last_msg_.stec_residuals[1].sv_id.satId, expected 70, is " << last_msg_.stec_residuals[1].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[2].residual, 6049) << "incorrect value for last_msg_.stec_residuals[2].residual, expected 6049, is " << last_msg_.stec_residuals[2].residual; - EXPECT_EQ(last_msg_.stec_residuals[2].stddev, 135) << "incorrect value for last_msg_.stec_residuals[2].stddev, expected 135, is " << last_msg_.stec_residuals[2].stddev; - EXPECT_EQ(last_msg_.stec_residuals[2].sv_id.constellation, 201) << "incorrect value for last_msg_.stec_residuals[2].sv_id.constellation, expected 201, is " << last_msg_.stec_residuals[2].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[2].sv_id.satId, 78) << "incorrect value for last_msg_.stec_residuals[2].sv_id.satId, expected 78, is " << last_msg_.stec_residuals[2].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[3].residual, 19261) << "incorrect value for last_msg_.stec_residuals[3].residual, expected 19261, is " << last_msg_.stec_residuals[3].residual; - EXPECT_EQ(last_msg_.stec_residuals[3].stddev, 178) << "incorrect value for last_msg_.stec_residuals[3].stddev, expected 178, is " << last_msg_.stec_residuals[3].stddev; - EXPECT_EQ(last_msg_.stec_residuals[3].sv_id.constellation, 98) << "incorrect value for last_msg_.stec_residuals[3].sv_id.constellation, expected 98, is " << last_msg_.stec_residuals[3].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[3].sv_id.satId, 152) << "incorrect value for last_msg_.stec_residuals[3].sv_id.satId, expected 152, is " << last_msg_.stec_residuals[3].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[4].residual, 14226) << "incorrect value for last_msg_.stec_residuals[4].residual, expected 14226, is " << last_msg_.stec_residuals[4].residual; - EXPECT_EQ(last_msg_.stec_residuals[4].stddev, 58) << "incorrect value for last_msg_.stec_residuals[4].stddev, expected 58, is " << last_msg_.stec_residuals[4].stddev; - EXPECT_EQ(last_msg_.stec_residuals[4].sv_id.constellation, 229) << "incorrect value for last_msg_.stec_residuals[4].sv_id.constellation, expected 229, is " << last_msg_.stec_residuals[4].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[4].sv_id.satId, 120) << "incorrect value for last_msg_.stec_residuals[4].sv_id.satId, expected 120, is " << last_msg_.stec_residuals[4].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[5].residual, 17894) << "incorrect value for last_msg_.stec_residuals[5].residual, expected 17894, is " << last_msg_.stec_residuals[5].residual; - EXPECT_EQ(last_msg_.stec_residuals[5].stddev, 172) << "incorrect value for last_msg_.stec_residuals[5].stddev, expected 172, is " << last_msg_.stec_residuals[5].stddev; - EXPECT_EQ(last_msg_.stec_residuals[5].sv_id.constellation, 234) << "incorrect value for last_msg_.stec_residuals[5].sv_id.constellation, expected 234, is " << last_msg_.stec_residuals[5].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[5].sv_id.satId, 169) << "incorrect value for last_msg_.stec_residuals[5].sv_id.satId, expected 169, is " << last_msg_.stec_residuals[5].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[6].residual, 22930) << "incorrect value for last_msg_.stec_residuals[6].residual, expected 22930, is " << last_msg_.stec_residuals[6].residual; - EXPECT_EQ(last_msg_.stec_residuals[6].stddev, 150) << "incorrect value for last_msg_.stec_residuals[6].stddev, expected 150, is " << last_msg_.stec_residuals[6].stddev; - EXPECT_EQ(last_msg_.stec_residuals[6].sv_id.constellation, 127) << "incorrect value for last_msg_.stec_residuals[6].sv_id.constellation, expected 127, is " << last_msg_.stec_residuals[6].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[6].sv_id.satId, 191) << "incorrect value for last_msg_.stec_residuals[6].sv_id.satId, expected 191, is " << last_msg_.stec_residuals[6].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[7].residual, 10721) << "incorrect value for last_msg_.stec_residuals[7].residual, expected 10721, is " << last_msg_.stec_residuals[7].residual; - EXPECT_EQ(last_msg_.stec_residuals[7].stddev, 17) << "incorrect value for last_msg_.stec_residuals[7].stddev, expected 17, is " << last_msg_.stec_residuals[7].stddev; - EXPECT_EQ(last_msg_.stec_residuals[7].sv_id.constellation, 111) << "incorrect value for last_msg_.stec_residuals[7].sv_id.constellation, expected 111, is " << last_msg_.stec_residuals[7].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[7].sv_id.satId, 91) << "incorrect value for last_msg_.stec_residuals[7].sv_id.satId, expected 91, is " << last_msg_.stec_residuals[7].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[8].residual, -22874) << "incorrect value for last_msg_.stec_residuals[8].residual, expected -22874, is " << last_msg_.stec_residuals[8].residual; - EXPECT_EQ(last_msg_.stec_residuals[8].stddev, 120) << "incorrect value for last_msg_.stec_residuals[8].stddev, expected 120, is " << last_msg_.stec_residuals[8].stddev; - EXPECT_EQ(last_msg_.stec_residuals[8].sv_id.constellation, 52) << "incorrect value for last_msg_.stec_residuals[8].sv_id.constellation, expected 52, is " << last_msg_.stec_residuals[8].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[8].sv_id.satId, 119) << "incorrect value for last_msg_.stec_residuals[8].sv_id.satId, expected 119, is " << last_msg_.stec_residuals[8].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[9].residual, 780) << "incorrect value for last_msg_.stec_residuals[9].residual, expected 780, is " << last_msg_.stec_residuals[9].residual; - EXPECT_EQ(last_msg_.stec_residuals[9].stddev, 156) << "incorrect value for last_msg_.stec_residuals[9].stddev, expected 156, is " << last_msg_.stec_residuals[9].stddev; - EXPECT_EQ(last_msg_.stec_residuals[9].sv_id.constellation, 221) << "incorrect value for last_msg_.stec_residuals[9].sv_id.constellation, expected 221, is " << last_msg_.stec_residuals[9].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[9].sv_id.satId, 57) << "incorrect value for last_msg_.stec_residuals[9].sv_id.satId, expected 57, is " << last_msg_.stec_residuals[9].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[10].residual, 32547) << "incorrect value for last_msg_.stec_residuals[10].residual, expected 32547, is " << last_msg_.stec_residuals[10].residual; - EXPECT_EQ(last_msg_.stec_residuals[10].stddev, 8) << "incorrect value for last_msg_.stec_residuals[10].stddev, expected 8, is " << last_msg_.stec_residuals[10].stddev; - EXPECT_EQ(last_msg_.stec_residuals[10].sv_id.constellation, 156) << "incorrect value for last_msg_.stec_residuals[10].sv_id.constellation, expected 156, is " << last_msg_.stec_residuals[10].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[10].sv_id.satId, 70) << "incorrect value for last_msg_.stec_residuals[10].sv_id.satId, expected 70, is " << last_msg_.stec_residuals[10].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[11].residual, 14208) << "incorrect value for last_msg_.stec_residuals[11].residual, expected 14208, is " << last_msg_.stec_residuals[11].residual; - EXPECT_EQ(last_msg_.stec_residuals[11].stddev, 115) << "incorrect value for last_msg_.stec_residuals[11].stddev, expected 115, is " << last_msg_.stec_residuals[11].stddev; - EXPECT_EQ(last_msg_.stec_residuals[11].sv_id.constellation, 58) << "incorrect value for last_msg_.stec_residuals[11].sv_id.constellation, expected 58, is " << last_msg_.stec_residuals[11].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[11].sv_id.satId, 127) << "incorrect value for last_msg_.stec_residuals[11].sv_id.satId, expected 127, is " << last_msg_.stec_residuals[11].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[12].residual, -26246) << "incorrect value for last_msg_.stec_residuals[12].residual, expected -26246, is " << last_msg_.stec_residuals[12].residual; - EXPECT_EQ(last_msg_.stec_residuals[12].stddev, 124) << "incorrect value for last_msg_.stec_residuals[12].stddev, expected 124, is " << last_msg_.stec_residuals[12].stddev; - EXPECT_EQ(last_msg_.stec_residuals[12].sv_id.constellation, 157) << "incorrect value for last_msg_.stec_residuals[12].sv_id.constellation, expected 157, is " << last_msg_.stec_residuals[12].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[12].sv_id.satId, 80) << "incorrect value for last_msg_.stec_residuals[12].sv_id.satId, expected 80, is " << last_msg_.stec_residuals[12].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[13].residual, 26466) << "incorrect value for last_msg_.stec_residuals[13].residual, expected 26466, is " << last_msg_.stec_residuals[13].residual; - EXPECT_EQ(last_msg_.stec_residuals[13].stddev, 204) << "incorrect value for last_msg_.stec_residuals[13].stddev, expected 204, is " << last_msg_.stec_residuals[13].stddev; - EXPECT_EQ(last_msg_.stec_residuals[13].sv_id.constellation, 128) << "incorrect value for last_msg_.stec_residuals[13].sv_id.constellation, expected 128, is " << last_msg_.stec_residuals[13].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[13].sv_id.satId, 27) << "incorrect value for last_msg_.stec_residuals[13].sv_id.satId, expected 27, is " << last_msg_.stec_residuals[13].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[14].residual, -7552) << "incorrect value for last_msg_.stec_residuals[14].residual, expected -7552, is " << last_msg_.stec_residuals[14].residual; - EXPECT_EQ(last_msg_.stec_residuals[14].stddev, 148) << "incorrect value for last_msg_.stec_residuals[14].stddev, expected 148, is " << last_msg_.stec_residuals[14].stddev; - EXPECT_EQ(last_msg_.stec_residuals[14].sv_id.constellation, 238) << "incorrect value for last_msg_.stec_residuals[14].sv_id.constellation, expected 238, is " << last_msg_.stec_residuals[14].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[14].sv_id.satId, 75) << "incorrect value for last_msg_.stec_residuals[14].sv_id.satId, expected 75, is " << last_msg_.stec_residuals[14].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[15].residual, -12072) << "incorrect value for last_msg_.stec_residuals[15].residual, expected -12072, is " << last_msg_.stec_residuals[15].residual; - EXPECT_EQ(last_msg_.stec_residuals[15].stddev, 149) << "incorrect value for last_msg_.stec_residuals[15].stddev, expected 149, is " << last_msg_.stec_residuals[15].stddev; - EXPECT_EQ(last_msg_.stec_residuals[15].sv_id.constellation, 61) << "incorrect value for last_msg_.stec_residuals[15].sv_id.constellation, expected 61, is " << last_msg_.stec_residuals[15].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[15].sv_id.satId, 248) << "incorrect value for last_msg_.stec_residuals[15].sv_id.satId, expected 248, is " << last_msg_.stec_residuals[15].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[16].residual, -28632) << "incorrect value for last_msg_.stec_residuals[16].residual, expected -28632, is " << last_msg_.stec_residuals[16].residual; - EXPECT_EQ(last_msg_.stec_residuals[16].stddev, 186) << "incorrect value for last_msg_.stec_residuals[16].stddev, expected 186, is " << last_msg_.stec_residuals[16].stddev; - EXPECT_EQ(last_msg_.stec_residuals[16].sv_id.constellation, 224) << "incorrect value for last_msg_.stec_residuals[16].sv_id.constellation, expected 224, is " << last_msg_.stec_residuals[16].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[16].sv_id.satId, 167) << "incorrect value for last_msg_.stec_residuals[16].sv_id.satId, expected 167, is " << last_msg_.stec_residuals[16].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[17].residual, -4024) << "incorrect value for last_msg_.stec_residuals[17].residual, expected -4024, is " << last_msg_.stec_residuals[17].residual; - EXPECT_EQ(last_msg_.stec_residuals[17].stddev, 100) << "incorrect value for last_msg_.stec_residuals[17].stddev, expected 100, is " << last_msg_.stec_residuals[17].stddev; - EXPECT_EQ(last_msg_.stec_residuals[17].sv_id.constellation, 227) << "incorrect value for last_msg_.stec_residuals[17].sv_id.constellation, expected 227, is " << last_msg_.stec_residuals[17].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[17].sv_id.satId, 157) << "incorrect value for last_msg_.stec_residuals[17].sv_id.satId, expected 157, is " << last_msg_.stec_residuals[17].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[18].residual, 2004) << "incorrect value for last_msg_.stec_residuals[18].residual, expected 2004, is " << last_msg_.stec_residuals[18].residual; - EXPECT_EQ(last_msg_.stec_residuals[18].stddev, 59) << "incorrect value for last_msg_.stec_residuals[18].stddev, expected 59, is " << last_msg_.stec_residuals[18].stddev; - EXPECT_EQ(last_msg_.stec_residuals[18].sv_id.constellation, 12) << "incorrect value for last_msg_.stec_residuals[18].sv_id.constellation, expected 12, is " << last_msg_.stec_residuals[18].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[18].sv_id.satId, 35) << "incorrect value for last_msg_.stec_residuals[18].sv_id.satId, expected 35, is " << last_msg_.stec_residuals[18].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[19].residual, 6998) << "incorrect value for last_msg_.stec_residuals[19].residual, expected 6998, is " << last_msg_.stec_residuals[19].residual; - EXPECT_EQ(last_msg_.stec_residuals[19].stddev, 24) << "incorrect value for last_msg_.stec_residuals[19].stddev, expected 24, is " << last_msg_.stec_residuals[19].stddev; - EXPECT_EQ(last_msg_.stec_residuals[19].sv_id.constellation, 81) << "incorrect value for last_msg_.stec_residuals[19].sv_id.constellation, expected 81, is " << last_msg_.stec_residuals[19].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[19].sv_id.satId, 176) << "incorrect value for last_msg_.stec_residuals[19].sv_id.satId, expected 176, is " << last_msg_.stec_residuals[19].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[20].residual, -31701) << "incorrect value for last_msg_.stec_residuals[20].residual, expected -31701, is " << last_msg_.stec_residuals[20].residual; - EXPECT_EQ(last_msg_.stec_residuals[20].stddev, 45) << "incorrect value for last_msg_.stec_residuals[20].stddev, expected 45, is " << last_msg_.stec_residuals[20].stddev; - EXPECT_EQ(last_msg_.stec_residuals[20].sv_id.constellation, 67) << "incorrect value for last_msg_.stec_residuals[20].sv_id.constellation, expected 67, is " << last_msg_.stec_residuals[20].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[20].sv_id.satId, 155) << "incorrect value for last_msg_.stec_residuals[20].sv_id.satId, expected 155, is " << last_msg_.stec_residuals[20].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[21].residual, 28678) << "incorrect value for last_msg_.stec_residuals[21].residual, expected 28678, is " << last_msg_.stec_residuals[21].residual; - EXPECT_EQ(last_msg_.stec_residuals[21].stddev, 183) << "incorrect value for last_msg_.stec_residuals[21].stddev, expected 183, is " << last_msg_.stec_residuals[21].stddev; - EXPECT_EQ(last_msg_.stec_residuals[21].sv_id.constellation, 44) << "incorrect value for last_msg_.stec_residuals[21].sv_id.constellation, expected 44, is " << last_msg_.stec_residuals[21].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[21].sv_id.satId, 203) << "incorrect value for last_msg_.stec_residuals[21].sv_id.satId, expected 203, is " << last_msg_.stec_residuals[21].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[22].residual, -15793) << "incorrect value for last_msg_.stec_residuals[22].residual, expected -15793, is " << last_msg_.stec_residuals[22].residual; - EXPECT_EQ(last_msg_.stec_residuals[22].stddev, 253) << "incorrect value for last_msg_.stec_residuals[22].stddev, expected 253, is " << last_msg_.stec_residuals[22].stddev; - EXPECT_EQ(last_msg_.stec_residuals[22].sv_id.constellation, 176) << "incorrect value for last_msg_.stec_residuals[22].sv_id.constellation, expected 176, is " << last_msg_.stec_residuals[22].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[22].sv_id.satId, 231) << "incorrect value for last_msg_.stec_residuals[22].sv_id.satId, expected 231, is " << last_msg_.stec_residuals[22].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[23].residual, -7589) << "incorrect value for last_msg_.stec_residuals[23].residual, expected -7589, is " << last_msg_.stec_residuals[23].residual; - EXPECT_EQ(last_msg_.stec_residuals[23].stddev, 116) << "incorrect value for last_msg_.stec_residuals[23].stddev, expected 116, is " << last_msg_.stec_residuals[23].stddev; - EXPECT_EQ(last_msg_.stec_residuals[23].sv_id.constellation, 103) << "incorrect value for last_msg_.stec_residuals[23].sv_id.constellation, expected 103, is " << last_msg_.stec_residuals[23].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[23].sv_id.satId, 247) << "incorrect value for last_msg_.stec_residuals[23].sv_id.satId, expected 247, is " << last_msg_.stec_residuals[23].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[24].residual, -7362) << "incorrect value for last_msg_.stec_residuals[24].residual, expected -7362, is " << last_msg_.stec_residuals[24].residual; - EXPECT_EQ(last_msg_.stec_residuals[24].stddev, 240) << "incorrect value for last_msg_.stec_residuals[24].stddev, expected 240, is " << last_msg_.stec_residuals[24].stddev; - EXPECT_EQ(last_msg_.stec_residuals[24].sv_id.constellation, 23) << "incorrect value for last_msg_.stec_residuals[24].sv_id.constellation, expected 23, is " << last_msg_.stec_residuals[24].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[24].sv_id.satId, 148) << "incorrect value for last_msg_.stec_residuals[24].sv_id.satId, expected 148, is " << last_msg_.stec_residuals[24].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[25].residual, 4813) << "incorrect value for last_msg_.stec_residuals[25].residual, expected 4813, is " << last_msg_.stec_residuals[25].residual; - EXPECT_EQ(last_msg_.stec_residuals[25].stddev, 242) << "incorrect value for last_msg_.stec_residuals[25].stddev, expected 242, is " << last_msg_.stec_residuals[25].stddev; - EXPECT_EQ(last_msg_.stec_residuals[25].sv_id.constellation, 219) << "incorrect value for last_msg_.stec_residuals[25].sv_id.constellation, expected 219, is " << last_msg_.stec_residuals[25].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[25].sv_id.satId, 29) << "incorrect value for last_msg_.stec_residuals[25].sv_id.satId, expected 29, is " << last_msg_.stec_residuals[25].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[26].residual, 20295) << "incorrect value for last_msg_.stec_residuals[26].residual, expected 20295, is " << last_msg_.stec_residuals[26].residual; - EXPECT_EQ(last_msg_.stec_residuals[26].stddev, 37) << "incorrect value for last_msg_.stec_residuals[26].stddev, expected 37, is " << last_msg_.stec_residuals[26].stddev; - EXPECT_EQ(last_msg_.stec_residuals[26].sv_id.constellation, 72) << "incorrect value for last_msg_.stec_residuals[26].sv_id.constellation, expected 72, is " << last_msg_.stec_residuals[26].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[26].sv_id.satId, 207) << "incorrect value for last_msg_.stec_residuals[26].sv_id.satId, expected 207, is " << last_msg_.stec_residuals[26].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[27].residual, -13623) << "incorrect value for last_msg_.stec_residuals[27].residual, expected -13623, is " << last_msg_.stec_residuals[27].residual; - EXPECT_EQ(last_msg_.stec_residuals[27].stddev, 91) << "incorrect value for last_msg_.stec_residuals[27].stddev, expected 91, is " << last_msg_.stec_residuals[27].stddev; - EXPECT_EQ(last_msg_.stec_residuals[27].sv_id.constellation, 176) << "incorrect value for last_msg_.stec_residuals[27].sv_id.constellation, expected 176, is " << last_msg_.stec_residuals[27].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[27].sv_id.satId, 42) << "incorrect value for last_msg_.stec_residuals[27].sv_id.satId, expected 42, is " << last_msg_.stec_residuals[27].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[28].residual, 15250) << "incorrect value for last_msg_.stec_residuals[28].residual, expected 15250, is " << last_msg_.stec_residuals[28].residual; - EXPECT_EQ(last_msg_.stec_residuals[28].stddev, 110) << "incorrect value for last_msg_.stec_residuals[28].stddev, expected 110, is " << last_msg_.stec_residuals[28].stddev; - EXPECT_EQ(last_msg_.stec_residuals[28].sv_id.constellation, 115) << "incorrect value for last_msg_.stec_residuals[28].sv_id.constellation, expected 115, is " << last_msg_.stec_residuals[28].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[28].sv_id.satId, 105) << "incorrect value for last_msg_.stec_residuals[28].sv_id.satId, expected 105, is " << last_msg_.stec_residuals[28].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[29].residual, -18560) << "incorrect value for last_msg_.stec_residuals[29].residual, expected -18560, is " << last_msg_.stec_residuals[29].residual; - EXPECT_EQ(last_msg_.stec_residuals[29].stddev, 185) << "incorrect value for last_msg_.stec_residuals[29].stddev, expected 185, is " << last_msg_.stec_residuals[29].stddev; - EXPECT_EQ(last_msg_.stec_residuals[29].sv_id.constellation, 109) << "incorrect value for last_msg_.stec_residuals[29].sv_id.constellation, expected 109, is " << last_msg_.stec_residuals[29].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[29].sv_id.satId, 44) << "incorrect value for last_msg_.stec_residuals[29].sv_id.satId, expected 44, is " << last_msg_.stec_residuals[29].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[30].residual, 23717) << "incorrect value for last_msg_.stec_residuals[30].residual, expected 23717, is " << last_msg_.stec_residuals[30].residual; - EXPECT_EQ(last_msg_.stec_residuals[30].stddev, 79) << "incorrect value for last_msg_.stec_residuals[30].stddev, expected 79, is " << last_msg_.stec_residuals[30].stddev; - EXPECT_EQ(last_msg_.stec_residuals[30].sv_id.constellation, 31) << "incorrect value for last_msg_.stec_residuals[30].sv_id.constellation, expected 31, is " << last_msg_.stec_residuals[30].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[30].sv_id.satId, 67) << "incorrect value for last_msg_.stec_residuals[30].sv_id.satId, expected 67, is " << last_msg_.stec_residuals[30].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[31].residual, 1886) << "incorrect value for last_msg_.stec_residuals[31].residual, expected 1886, is " << last_msg_.stec_residuals[31].residual; - EXPECT_EQ(last_msg_.stec_residuals[31].stddev, 162) << "incorrect value for last_msg_.stec_residuals[31].stddev, expected 162, is " << last_msg_.stec_residuals[31].stddev; - EXPECT_EQ(last_msg_.stec_residuals[31].sv_id.constellation, 180) << "incorrect value for last_msg_.stec_residuals[31].sv_id.constellation, expected 180, is " << last_msg_.stec_residuals[31].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[31].sv_id.satId, 189) << "incorrect value for last_msg_.stec_residuals[31].sv_id.satId, expected 189, is " << last_msg_.stec_residuals[31].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[32].residual, 12242) << "incorrect value for last_msg_.stec_residuals[32].residual, expected 12242, is " << last_msg_.stec_residuals[32].residual; - EXPECT_EQ(last_msg_.stec_residuals[32].stddev, 7) << "incorrect value for last_msg_.stec_residuals[32].stddev, expected 7, is " << last_msg_.stec_residuals[32].stddev; - EXPECT_EQ(last_msg_.stec_residuals[32].sv_id.constellation, 156) << "incorrect value for last_msg_.stec_residuals[32].sv_id.constellation, expected 156, is " << last_msg_.stec_residuals[32].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[32].sv_id.satId, 121) << "incorrect value for last_msg_.stec_residuals[32].sv_id.satId, expected 121, is " << last_msg_.stec_residuals[32].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[33].residual, 10670) << "incorrect value for last_msg_.stec_residuals[33].residual, expected 10670, is " << last_msg_.stec_residuals[33].residual; - EXPECT_EQ(last_msg_.stec_residuals[33].stddev, 241) << "incorrect value for last_msg_.stec_residuals[33].stddev, expected 241, is " << last_msg_.stec_residuals[33].stddev; - EXPECT_EQ(last_msg_.stec_residuals[33].sv_id.constellation, 205) << "incorrect value for last_msg_.stec_residuals[33].sv_id.constellation, expected 205, is " << last_msg_.stec_residuals[33].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[33].sv_id.satId, 7) << "incorrect value for last_msg_.stec_residuals[33].sv_id.satId, expected 7, is " << last_msg_.stec_residuals[33].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[34].residual, 25899) << "incorrect value for last_msg_.stec_residuals[34].residual, expected 25899, is " << last_msg_.stec_residuals[34].residual; - EXPECT_EQ(last_msg_.stec_residuals[34].stddev, 186) << "incorrect value for last_msg_.stec_residuals[34].stddev, expected 186, is " << last_msg_.stec_residuals[34].stddev; - EXPECT_EQ(last_msg_.stec_residuals[34].sv_id.constellation, 210) << "incorrect value for last_msg_.stec_residuals[34].sv_id.constellation, expected 210, is " << last_msg_.stec_residuals[34].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[34].sv_id.satId, 129) << "incorrect value for last_msg_.stec_residuals[34].sv_id.satId, expected 129, is " << last_msg_.stec_residuals[34].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[35].residual, -2078) << "incorrect value for last_msg_.stec_residuals[35].residual, expected -2078, is " << last_msg_.stec_residuals[35].residual; - EXPECT_EQ(last_msg_.stec_residuals[35].stddev, 187) << "incorrect value for last_msg_.stec_residuals[35].stddev, expected 187, is " << last_msg_.stec_residuals[35].stddev; - EXPECT_EQ(last_msg_.stec_residuals[35].sv_id.constellation, 195) << "incorrect value for last_msg_.stec_residuals[35].sv_id.constellation, expected 195, is " << last_msg_.stec_residuals[35].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[35].sv_id.satId, 208) << "incorrect value for last_msg_.stec_residuals[35].sv_id.satId, expected 208, is " << last_msg_.stec_residuals[35].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[36].residual, -16264) << "incorrect value for last_msg_.stec_residuals[36].residual, expected -16264, is " << last_msg_.stec_residuals[36].residual; - EXPECT_EQ(last_msg_.stec_residuals[36].stddev, 102) << "incorrect value for last_msg_.stec_residuals[36].stddev, expected 102, is " << last_msg_.stec_residuals[36].stddev; - EXPECT_EQ(last_msg_.stec_residuals[36].sv_id.constellation, 160) << "incorrect value for last_msg_.stec_residuals[36].sv_id.constellation, expected 160, is " << last_msg_.stec_residuals[36].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[36].sv_id.satId, 219) << "incorrect value for last_msg_.stec_residuals[36].sv_id.satId, expected 219, is " << last_msg_.stec_residuals[36].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[37].residual, -21002) << "incorrect value for last_msg_.stec_residuals[37].residual, expected -21002, is " << last_msg_.stec_residuals[37].residual; - EXPECT_EQ(last_msg_.stec_residuals[37].stddev, 94) << "incorrect value for last_msg_.stec_residuals[37].stddev, expected 94, is " << last_msg_.stec_residuals[37].stddev; - EXPECT_EQ(last_msg_.stec_residuals[37].sv_id.constellation, 42) << "incorrect value for last_msg_.stec_residuals[37].sv_id.constellation, expected 42, is " << last_msg_.stec_residuals[37].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[37].sv_id.satId, 166) << "incorrect value for last_msg_.stec_residuals[37].sv_id.satId, expected 166, is " << last_msg_.stec_residuals[37].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[38].residual, 7902) << "incorrect value for last_msg_.stec_residuals[38].residual, expected 7902, is " << last_msg_.stec_residuals[38].residual; - EXPECT_EQ(last_msg_.stec_residuals[38].stddev, 35) << "incorrect value for last_msg_.stec_residuals[38].stddev, expected 35, is " << last_msg_.stec_residuals[38].stddev; - EXPECT_EQ(last_msg_.stec_residuals[38].sv_id.constellation, 156) << "incorrect value for last_msg_.stec_residuals[38].sv_id.constellation, expected 156, is " << last_msg_.stec_residuals[38].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[38].sv_id.satId, 102) << "incorrect value for last_msg_.stec_residuals[38].sv_id.satId, expected 102, is " << last_msg_.stec_residuals[38].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[39].residual, -30275) << "incorrect value for last_msg_.stec_residuals[39].residual, expected -30275, is " << last_msg_.stec_residuals[39].residual; - EXPECT_EQ(last_msg_.stec_residuals[39].stddev, 204) << "incorrect value for last_msg_.stec_residuals[39].stddev, expected 204, is " << last_msg_.stec_residuals[39].stddev; - EXPECT_EQ(last_msg_.stec_residuals[39].sv_id.constellation, 64) << "incorrect value for last_msg_.stec_residuals[39].sv_id.constellation, expected 64, is " << last_msg_.stec_residuals[39].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[39].sv_id.satId, 247) << "incorrect value for last_msg_.stec_residuals[39].sv_id.satId, expected 247, is " << last_msg_.stec_residuals[39].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[40].residual, -8633) << "incorrect value for last_msg_.stec_residuals[40].residual, expected -8633, is " << last_msg_.stec_residuals[40].residual; - EXPECT_EQ(last_msg_.stec_residuals[40].stddev, 222) << "incorrect value for last_msg_.stec_residuals[40].stddev, expected 222, is " << last_msg_.stec_residuals[40].stddev; - EXPECT_EQ(last_msg_.stec_residuals[40].sv_id.constellation, 32) << "incorrect value for last_msg_.stec_residuals[40].sv_id.constellation, expected 32, is " << last_msg_.stec_residuals[40].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[40].sv_id.satId, 220) << "incorrect value for last_msg_.stec_residuals[40].sv_id.satId, expected 220, is " << last_msg_.stec_residuals[40].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[41].residual, 6403) << "incorrect value for last_msg_.stec_residuals[41].residual, expected 6403, is " << last_msg_.stec_residuals[41].residual; - EXPECT_EQ(last_msg_.stec_residuals[41].stddev, 45) << "incorrect value for last_msg_.stec_residuals[41].stddev, expected 45, is " << last_msg_.stec_residuals[41].stddev; - EXPECT_EQ(last_msg_.stec_residuals[41].sv_id.constellation, 246) << "incorrect value for last_msg_.stec_residuals[41].sv_id.constellation, expected 246, is " << last_msg_.stec_residuals[41].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[41].sv_id.satId, 201) << "incorrect value for last_msg_.stec_residuals[41].sv_id.satId, expected 201, is " << last_msg_.stec_residuals[41].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[42].residual, 22643) << "incorrect value for last_msg_.stec_residuals[42].residual, expected 22643, is " << last_msg_.stec_residuals[42].residual; - EXPECT_EQ(last_msg_.stec_residuals[42].stddev, 218) << "incorrect value for last_msg_.stec_residuals[42].stddev, expected 218, is " << last_msg_.stec_residuals[42].stddev; - EXPECT_EQ(last_msg_.stec_residuals[42].sv_id.constellation, 239) << "incorrect value for last_msg_.stec_residuals[42].sv_id.constellation, expected 239, is " << last_msg_.stec_residuals[42].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[42].sv_id.satId, 251) << "incorrect value for last_msg_.stec_residuals[42].sv_id.satId, expected 251, is " << last_msg_.stec_residuals[42].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[43].residual, 16760) << "incorrect value for last_msg_.stec_residuals[43].residual, expected 16760, is " << last_msg_.stec_residuals[43].residual; - EXPECT_EQ(last_msg_.stec_residuals[43].stddev, 175) << "incorrect value for last_msg_.stec_residuals[43].stddev, expected 175, is " << last_msg_.stec_residuals[43].stddev; - EXPECT_EQ(last_msg_.stec_residuals[43].sv_id.constellation, 209) << "incorrect value for last_msg_.stec_residuals[43].sv_id.constellation, expected 209, is " << last_msg_.stec_residuals[43].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[43].sv_id.satId, 10) << "incorrect value for last_msg_.stec_residuals[43].sv_id.satId, expected 10, is " << last_msg_.stec_residuals[43].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[44].residual, -20951) << "incorrect value for last_msg_.stec_residuals[44].residual, expected -20951, is " << last_msg_.stec_residuals[44].residual; - EXPECT_EQ(last_msg_.stec_residuals[44].stddev, 137) << "incorrect value for last_msg_.stec_residuals[44].stddev, expected 137, is " << last_msg_.stec_residuals[44].stddev; - EXPECT_EQ(last_msg_.stec_residuals[44].sv_id.constellation, 194) << "incorrect value for last_msg_.stec_residuals[44].sv_id.constellation, expected 194, is " << last_msg_.stec_residuals[44].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[44].sv_id.satId, 131) << "incorrect value for last_msg_.stec_residuals[44].sv_id.satId, expected 131, is " << last_msg_.stec_residuals[44].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[45].residual, -740) << "incorrect value for last_msg_.stec_residuals[45].residual, expected -740, is " << last_msg_.stec_residuals[45].residual; - EXPECT_EQ(last_msg_.stec_residuals[45].stddev, 42) << "incorrect value for last_msg_.stec_residuals[45].stddev, expected 42, is " << last_msg_.stec_residuals[45].stddev; - EXPECT_EQ(last_msg_.stec_residuals[45].sv_id.constellation, 68) << "incorrect value for last_msg_.stec_residuals[45].sv_id.constellation, expected 68, is " << last_msg_.stec_residuals[45].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[45].sv_id.satId, 17) << "incorrect value for last_msg_.stec_residuals[45].sv_id.satId, expected 17, is " << last_msg_.stec_residuals[45].sv_id.satId; - EXPECT_EQ(last_msg_.tropo_delay_correction.hydro, -3035) << "incorrect value for last_msg_.tropo_delay_correction.hydro, expected -3035, is " << last_msg_.tropo_delay_correction.hydro; - EXPECT_EQ(last_msg_.tropo_delay_correction.stddev, 72) << "incorrect value for last_msg_.tropo_delay_correction.stddev, expected 72, is " << last_msg_.tropo_delay_correction.stddev; - EXPECT_EQ(last_msg_.tropo_delay_correction.wet, 78) << "incorrect value for last_msg_.tropo_delay_correction.wet, expected 78, is " << last_msg_.tropo_delay_correction.wet; +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrGriddedCorrection0, Test) { + uint8_t encoded_frame[] = { + 85, 252, 5, 196, 249, 253, 21, 14, 151, 50, 120, 133, 29, 151, 174, + 229, 151, 189, 204, 196, 105, 170, 120, 149, 169, 37, 244, 78, 72, 140, + 101, 2, 173, 88, 70, 180, 54, 152, 115, 78, 201, 161, 23, 135, 152, + 98, 61, 75, 178, 120, 229, 146, 55, 58, 169, 234, 230, 69, 172, 191, + 127, 146, 89, 150, 91, 111, 225, 41, 17, 119, 52, 166, 166, 120, 57, + 221, 12, 3, 156, 70, 156, 35, 127, 8, 127, 58, 128, 55, 115, 80, + 157, 122, 153, 124, 27, 128, 98, 103, 204, 75, 238, 128, 226, 148, 248, + 61, 216, 208, 149, 167, 224, 40, 144, 186, 157, 227, 72, 240, 100, 35, + 12, 212, 7, 59, 176, 81, 86, 27, 24, 155, 67, 43, 132, 45, 203, + 44, 6, 112, 183, 231, 176, 79, 194, 253, 247, 103, 91, 226, 116, 148, + 23, 62, 227, 240, 29, 219, 205, 18, 242, 207, 72, 71, 79, 37, 42, + 176, 201, 202, 91, 105, 115, 146, 59, 110, 44, 109, 128, 183, 185, 67, + 31, 165, 92, 79, 189, 180, 94, 7, 162, 121, 156, 210, 47, 7, 7, + 205, 174, 41, 241, 129, 210, 43, 101, 186, 208, 195, 226, 247, 187, 219, + 160, 120, 192, 102, 166, 42, 246, 173, 94, 102, 156, 222, 30, 35, 247, + 64, 189, 137, 204, 220, 32, 71, 222, 222, 201, 246, 3, 25, 45, 251, + 239, 115, 88, 218, 10, 209, 120, 65, 175, 131, 194, 41, 174, 137, 17, + 68, 28, 253, 42, 178, 35, + }; + + sbp_msg_ssr_gridded_correction_t test_msg{}; + test_msg.header.iod_atmo = 170; + test_msg.header.num_msgs = 48535; + test_msg.header.seq_num = 50380; + test_msg.header.tile_id = 12951; + test_msg.header.tile_set_id = 3605; + test_msg.header.time.tow = 2535294328; + test_msg.header.time.wn = 58798; + test_msg.header.tropo_quality_indicator = 120; + test_msg.header.update_interval = 105; + test_msg.index = 43413; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_stec_residuals.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)101, (char)99, + (char)95, (char)114, (char)101, (char)115, + (char)105, (char)100, (char)117, (char)97, + (char)108, (char)115}; + memcpy(test_msg.n_stec_residuals.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_stec_residuals.value = 46; + + test_msg.stec_residuals[0].residual = -21246; + test_msg.stec_residuals[0].stddev = 88; + test_msg.stec_residuals[0].sv_id.constellation = 101; + test_msg.stec_residuals[0].sv_id.satId = 140; + + test_msg.stec_residuals[1].residual = -26570; + test_msg.stec_residuals[1].stddev = 115; + test_msg.stec_residuals[1].sv_id.constellation = 180; + test_msg.stec_residuals[1].sv_id.satId = 70; + + test_msg.stec_residuals[2].residual = 6049; + test_msg.stec_residuals[2].stddev = 135; + test_msg.stec_residuals[2].sv_id.constellation = 201; + test_msg.stec_residuals[2].sv_id.satId = 78; + + test_msg.stec_residuals[3].residual = 19261; + test_msg.stec_residuals[3].stddev = 178; + test_msg.stec_residuals[3].sv_id.constellation = 98; + test_msg.stec_residuals[3].sv_id.satId = 152; + + test_msg.stec_residuals[4].residual = 14226; + test_msg.stec_residuals[4].stddev = 58; + test_msg.stec_residuals[4].sv_id.constellation = 229; + test_msg.stec_residuals[4].sv_id.satId = 120; + + test_msg.stec_residuals[5].residual = 17894; + test_msg.stec_residuals[5].stddev = 172; + test_msg.stec_residuals[5].sv_id.constellation = 234; + test_msg.stec_residuals[5].sv_id.satId = 169; + + test_msg.stec_residuals[6].residual = 22930; + test_msg.stec_residuals[6].stddev = 150; + test_msg.stec_residuals[6].sv_id.constellation = 127; + test_msg.stec_residuals[6].sv_id.satId = 191; + + test_msg.stec_residuals[7].residual = 10721; + test_msg.stec_residuals[7].stddev = 17; + test_msg.stec_residuals[7].sv_id.constellation = 111; + test_msg.stec_residuals[7].sv_id.satId = 91; + + test_msg.stec_residuals[8].residual = -22874; + test_msg.stec_residuals[8].stddev = 120; + test_msg.stec_residuals[8].sv_id.constellation = 52; + test_msg.stec_residuals[8].sv_id.satId = 119; + + test_msg.stec_residuals[9].residual = 780; + test_msg.stec_residuals[9].stddev = 156; + test_msg.stec_residuals[9].sv_id.constellation = 221; + test_msg.stec_residuals[9].sv_id.satId = 57; + + test_msg.stec_residuals[10].residual = 32547; + test_msg.stec_residuals[10].stddev = 8; + test_msg.stec_residuals[10].sv_id.constellation = 156; + test_msg.stec_residuals[10].sv_id.satId = 70; + + test_msg.stec_residuals[11].residual = 14208; + test_msg.stec_residuals[11].stddev = 115; + test_msg.stec_residuals[11].sv_id.constellation = 58; + test_msg.stec_residuals[11].sv_id.satId = 127; + + test_msg.stec_residuals[12].residual = -26246; + test_msg.stec_residuals[12].stddev = 124; + test_msg.stec_residuals[12].sv_id.constellation = 157; + test_msg.stec_residuals[12].sv_id.satId = 80; + + test_msg.stec_residuals[13].residual = 26466; + test_msg.stec_residuals[13].stddev = 204; + test_msg.stec_residuals[13].sv_id.constellation = 128; + test_msg.stec_residuals[13].sv_id.satId = 27; + + test_msg.stec_residuals[14].residual = -7552; + test_msg.stec_residuals[14].stddev = 148; + test_msg.stec_residuals[14].sv_id.constellation = 238; + test_msg.stec_residuals[14].sv_id.satId = 75; + + test_msg.stec_residuals[15].residual = -12072; + test_msg.stec_residuals[15].stddev = 149; + test_msg.stec_residuals[15].sv_id.constellation = 61; + test_msg.stec_residuals[15].sv_id.satId = 248; + + test_msg.stec_residuals[16].residual = -28632; + test_msg.stec_residuals[16].stddev = 186; + test_msg.stec_residuals[16].sv_id.constellation = 224; + test_msg.stec_residuals[16].sv_id.satId = 167; + + test_msg.stec_residuals[17].residual = -4024; + test_msg.stec_residuals[17].stddev = 100; + test_msg.stec_residuals[17].sv_id.constellation = 227; + test_msg.stec_residuals[17].sv_id.satId = 157; + + test_msg.stec_residuals[18].residual = 2004; + test_msg.stec_residuals[18].stddev = 59; + test_msg.stec_residuals[18].sv_id.constellation = 12; + test_msg.stec_residuals[18].sv_id.satId = 35; + + test_msg.stec_residuals[19].residual = 6998; + test_msg.stec_residuals[19].stddev = 24; + test_msg.stec_residuals[19].sv_id.constellation = 81; + test_msg.stec_residuals[19].sv_id.satId = 176; + + test_msg.stec_residuals[20].residual = -31701; + test_msg.stec_residuals[20].stddev = 45; + test_msg.stec_residuals[20].sv_id.constellation = 67; + test_msg.stec_residuals[20].sv_id.satId = 155; + + test_msg.stec_residuals[21].residual = 28678; + test_msg.stec_residuals[21].stddev = 183; + test_msg.stec_residuals[21].sv_id.constellation = 44; + test_msg.stec_residuals[21].sv_id.satId = 203; + + test_msg.stec_residuals[22].residual = -15793; + test_msg.stec_residuals[22].stddev = 253; + test_msg.stec_residuals[22].sv_id.constellation = 176; + test_msg.stec_residuals[22].sv_id.satId = 231; + + test_msg.stec_residuals[23].residual = -7589; + test_msg.stec_residuals[23].stddev = 116; + test_msg.stec_residuals[23].sv_id.constellation = 103; + test_msg.stec_residuals[23].sv_id.satId = 247; + + test_msg.stec_residuals[24].residual = -7362; + test_msg.stec_residuals[24].stddev = 240; + test_msg.stec_residuals[24].sv_id.constellation = 23; + test_msg.stec_residuals[24].sv_id.satId = 148; + + test_msg.stec_residuals[25].residual = 4813; + test_msg.stec_residuals[25].stddev = 242; + test_msg.stec_residuals[25].sv_id.constellation = 219; + test_msg.stec_residuals[25].sv_id.satId = 29; + + test_msg.stec_residuals[26].residual = 20295; + test_msg.stec_residuals[26].stddev = 37; + test_msg.stec_residuals[26].sv_id.constellation = 72; + test_msg.stec_residuals[26].sv_id.satId = 207; + + test_msg.stec_residuals[27].residual = -13623; + test_msg.stec_residuals[27].stddev = 91; + test_msg.stec_residuals[27].sv_id.constellation = 176; + test_msg.stec_residuals[27].sv_id.satId = 42; + + test_msg.stec_residuals[28].residual = 15250; + test_msg.stec_residuals[28].stddev = 110; + test_msg.stec_residuals[28].sv_id.constellation = 115; + test_msg.stec_residuals[28].sv_id.satId = 105; + + test_msg.stec_residuals[29].residual = -18560; + test_msg.stec_residuals[29].stddev = 185; + test_msg.stec_residuals[29].sv_id.constellation = 109; + test_msg.stec_residuals[29].sv_id.satId = 44; + + test_msg.stec_residuals[30].residual = 23717; + test_msg.stec_residuals[30].stddev = 79; + test_msg.stec_residuals[30].sv_id.constellation = 31; + test_msg.stec_residuals[30].sv_id.satId = 67; + + test_msg.stec_residuals[31].residual = 1886; + test_msg.stec_residuals[31].stddev = 162; + test_msg.stec_residuals[31].sv_id.constellation = 180; + test_msg.stec_residuals[31].sv_id.satId = 189; + + test_msg.stec_residuals[32].residual = 12242; + test_msg.stec_residuals[32].stddev = 7; + test_msg.stec_residuals[32].sv_id.constellation = 156; + test_msg.stec_residuals[32].sv_id.satId = 121; + + test_msg.stec_residuals[33].residual = 10670; + test_msg.stec_residuals[33].stddev = 241; + test_msg.stec_residuals[33].sv_id.constellation = 205; + test_msg.stec_residuals[33].sv_id.satId = 7; + + test_msg.stec_residuals[34].residual = 25899; + test_msg.stec_residuals[34].stddev = 186; + test_msg.stec_residuals[34].sv_id.constellation = 210; + test_msg.stec_residuals[34].sv_id.satId = 129; + + test_msg.stec_residuals[35].residual = -2078; + test_msg.stec_residuals[35].stddev = 187; + test_msg.stec_residuals[35].sv_id.constellation = 195; + test_msg.stec_residuals[35].sv_id.satId = 208; + + test_msg.stec_residuals[36].residual = -16264; + test_msg.stec_residuals[36].stddev = 102; + test_msg.stec_residuals[36].sv_id.constellation = 160; + test_msg.stec_residuals[36].sv_id.satId = 219; + + test_msg.stec_residuals[37].residual = -21002; + test_msg.stec_residuals[37].stddev = 94; + test_msg.stec_residuals[37].sv_id.constellation = 42; + test_msg.stec_residuals[37].sv_id.satId = 166; + + test_msg.stec_residuals[38].residual = 7902; + test_msg.stec_residuals[38].stddev = 35; + test_msg.stec_residuals[38].sv_id.constellation = 156; + test_msg.stec_residuals[38].sv_id.satId = 102; + + test_msg.stec_residuals[39].residual = -30275; + test_msg.stec_residuals[39].stddev = 204; + test_msg.stec_residuals[39].sv_id.constellation = 64; + test_msg.stec_residuals[39].sv_id.satId = 247; + + test_msg.stec_residuals[40].residual = -8633; + test_msg.stec_residuals[40].stddev = 222; + test_msg.stec_residuals[40].sv_id.constellation = 32; + test_msg.stec_residuals[40].sv_id.satId = 220; + + test_msg.stec_residuals[41].residual = 6403; + test_msg.stec_residuals[41].stddev = 45; + test_msg.stec_residuals[41].sv_id.constellation = 246; + test_msg.stec_residuals[41].sv_id.satId = 201; + + test_msg.stec_residuals[42].residual = 22643; + test_msg.stec_residuals[42].stddev = 218; + test_msg.stec_residuals[42].sv_id.constellation = 239; + test_msg.stec_residuals[42].sv_id.satId = 251; + + test_msg.stec_residuals[43].residual = 16760; + test_msg.stec_residuals[43].stddev = 175; + test_msg.stec_residuals[43].sv_id.constellation = 209; + test_msg.stec_residuals[43].sv_id.satId = 10; + + test_msg.stec_residuals[44].residual = -20951; + test_msg.stec_residuals[44].stddev = 137; + test_msg.stec_residuals[44].sv_id.constellation = 194; + test_msg.stec_residuals[44].sv_id.satId = 131; + + test_msg.stec_residuals[45].residual = -740; + test_msg.stec_residuals[45].stddev = 42; + test_msg.stec_residuals[45].sv_id.constellation = 68; + test_msg.stec_residuals[45].sv_id.satId = 17; + test_msg.tropo_delay_correction.hydro = -3035; + test_msg.tropo_delay_correction.stddev = 72; + test_msg.tropo_delay_correction.wet = 78; + + EXPECT_EQ(send_message(63940, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 63940); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.iod_atmo, 170) + << "incorrect value for last_msg_.header.iod_atmo, expected 170, is " + << last_msg_.header.iod_atmo; + EXPECT_EQ(last_msg_.header.num_msgs, 48535) + << "incorrect value for last_msg_.header.num_msgs, expected 48535, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.seq_num, 50380) + << "incorrect value for last_msg_.header.seq_num, expected 50380, is " + << last_msg_.header.seq_num; + EXPECT_EQ(last_msg_.header.tile_id, 12951) + << "incorrect value for last_msg_.header.tile_id, expected 12951, is " + << last_msg_.header.tile_id; + EXPECT_EQ(last_msg_.header.tile_set_id, 3605) + << "incorrect value for last_msg_.header.tile_set_id, expected 3605, is " + << last_msg_.header.tile_set_id; + EXPECT_EQ(last_msg_.header.time.tow, 2535294328) + << "incorrect value for last_msg_.header.time.tow, expected 2535294328, " + "is " + << last_msg_.header.time.tow; + EXPECT_EQ(last_msg_.header.time.wn, 58798) + << "incorrect value for last_msg_.header.time.wn, expected 58798, is " + << last_msg_.header.time.wn; + EXPECT_EQ(last_msg_.header.tropo_quality_indicator, 120) + << "incorrect value for last_msg_.header.tropo_quality_indicator, " + "expected 120, is " + << last_msg_.header.tropo_quality_indicator; + EXPECT_EQ(last_msg_.header.update_interval, 105) + << "incorrect value for last_msg_.header.update_interval, expected 105, " + "is " + << last_msg_.header.update_interval; + EXPECT_EQ(last_msg_.index, 43413) + << "incorrect value for last_msg_.index, expected 43413, is " + << last_msg_.index; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_stec_residuals.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_stec_residuals.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_stec_residuals.handle_as + << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)101, (char)99, + (char)95, (char)114, (char)101, (char)115, + (char)105, (char)100, (char)117, (char)97, + (char)108, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_stec_residuals.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_stec_residuals.relates_to, " + "expected string '" + << check_string << "', is '" << last_msg_.n_stec_residuals.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_stec_residuals.value, 46) + << "incorrect value for last_msg_.n_stec_residuals.value, expected 46, " + "is " + << last_msg_.n_stec_residuals.value; + EXPECT_EQ(last_msg_.stec_residuals[0].residual, -21246) + << "incorrect value for last_msg_.stec_residuals[0].residual, expected " + "-21246, is " + << last_msg_.stec_residuals[0].residual; + EXPECT_EQ(last_msg_.stec_residuals[0].stddev, 88) + << "incorrect value for last_msg_.stec_residuals[0].stddev, expected 88, " + "is " + << last_msg_.stec_residuals[0].stddev; + EXPECT_EQ(last_msg_.stec_residuals[0].sv_id.constellation, 101) + << "incorrect value for last_msg_.stec_residuals[0].sv_id.constellation, " + "expected 101, is " + << last_msg_.stec_residuals[0].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[0].sv_id.satId, 140) + << "incorrect value for last_msg_.stec_residuals[0].sv_id.satId, " + "expected 140, is " + << last_msg_.stec_residuals[0].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[1].residual, -26570) + << "incorrect value for last_msg_.stec_residuals[1].residual, expected " + "-26570, is " + << last_msg_.stec_residuals[1].residual; + EXPECT_EQ(last_msg_.stec_residuals[1].stddev, 115) + << "incorrect value for last_msg_.stec_residuals[1].stddev, expected " + "115, is " + << last_msg_.stec_residuals[1].stddev; + EXPECT_EQ(last_msg_.stec_residuals[1].sv_id.constellation, 180) + << "incorrect value for last_msg_.stec_residuals[1].sv_id.constellation, " + "expected 180, is " + << last_msg_.stec_residuals[1].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[1].sv_id.satId, 70) + << "incorrect value for last_msg_.stec_residuals[1].sv_id.satId, " + "expected 70, is " + << last_msg_.stec_residuals[1].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[2].residual, 6049) + << "incorrect value for last_msg_.stec_residuals[2].residual, expected " + "6049, is " + << last_msg_.stec_residuals[2].residual; + EXPECT_EQ(last_msg_.stec_residuals[2].stddev, 135) + << "incorrect value for last_msg_.stec_residuals[2].stddev, expected " + "135, is " + << last_msg_.stec_residuals[2].stddev; + EXPECT_EQ(last_msg_.stec_residuals[2].sv_id.constellation, 201) + << "incorrect value for last_msg_.stec_residuals[2].sv_id.constellation, " + "expected 201, is " + << last_msg_.stec_residuals[2].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[2].sv_id.satId, 78) + << "incorrect value for last_msg_.stec_residuals[2].sv_id.satId, " + "expected 78, is " + << last_msg_.stec_residuals[2].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[3].residual, 19261) + << "incorrect value for last_msg_.stec_residuals[3].residual, expected " + "19261, is " + << last_msg_.stec_residuals[3].residual; + EXPECT_EQ(last_msg_.stec_residuals[3].stddev, 178) + << "incorrect value for last_msg_.stec_residuals[3].stddev, expected " + "178, is " + << last_msg_.stec_residuals[3].stddev; + EXPECT_EQ(last_msg_.stec_residuals[3].sv_id.constellation, 98) + << "incorrect value for last_msg_.stec_residuals[3].sv_id.constellation, " + "expected 98, is " + << last_msg_.stec_residuals[3].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[3].sv_id.satId, 152) + << "incorrect value for last_msg_.stec_residuals[3].sv_id.satId, " + "expected 152, is " + << last_msg_.stec_residuals[3].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[4].residual, 14226) + << "incorrect value for last_msg_.stec_residuals[4].residual, expected " + "14226, is " + << last_msg_.stec_residuals[4].residual; + EXPECT_EQ(last_msg_.stec_residuals[4].stddev, 58) + << "incorrect value for last_msg_.stec_residuals[4].stddev, expected 58, " + "is " + << last_msg_.stec_residuals[4].stddev; + EXPECT_EQ(last_msg_.stec_residuals[4].sv_id.constellation, 229) + << "incorrect value for last_msg_.stec_residuals[4].sv_id.constellation, " + "expected 229, is " + << last_msg_.stec_residuals[4].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[4].sv_id.satId, 120) + << "incorrect value for last_msg_.stec_residuals[4].sv_id.satId, " + "expected 120, is " + << last_msg_.stec_residuals[4].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[5].residual, 17894) + << "incorrect value for last_msg_.stec_residuals[5].residual, expected " + "17894, is " + << last_msg_.stec_residuals[5].residual; + EXPECT_EQ(last_msg_.stec_residuals[5].stddev, 172) + << "incorrect value for last_msg_.stec_residuals[5].stddev, expected " + "172, is " + << last_msg_.stec_residuals[5].stddev; + EXPECT_EQ(last_msg_.stec_residuals[5].sv_id.constellation, 234) + << "incorrect value for last_msg_.stec_residuals[5].sv_id.constellation, " + "expected 234, is " + << last_msg_.stec_residuals[5].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[5].sv_id.satId, 169) + << "incorrect value for last_msg_.stec_residuals[5].sv_id.satId, " + "expected 169, is " + << last_msg_.stec_residuals[5].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[6].residual, 22930) + << "incorrect value for last_msg_.stec_residuals[6].residual, expected " + "22930, is " + << last_msg_.stec_residuals[6].residual; + EXPECT_EQ(last_msg_.stec_residuals[6].stddev, 150) + << "incorrect value for last_msg_.stec_residuals[6].stddev, expected " + "150, is " + << last_msg_.stec_residuals[6].stddev; + EXPECT_EQ(last_msg_.stec_residuals[6].sv_id.constellation, 127) + << "incorrect value for last_msg_.stec_residuals[6].sv_id.constellation, " + "expected 127, is " + << last_msg_.stec_residuals[6].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[6].sv_id.satId, 191) + << "incorrect value for last_msg_.stec_residuals[6].sv_id.satId, " + "expected 191, is " + << last_msg_.stec_residuals[6].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[7].residual, 10721) + << "incorrect value for last_msg_.stec_residuals[7].residual, expected " + "10721, is " + << last_msg_.stec_residuals[7].residual; + EXPECT_EQ(last_msg_.stec_residuals[7].stddev, 17) + << "incorrect value for last_msg_.stec_residuals[7].stddev, expected 17, " + "is " + << last_msg_.stec_residuals[7].stddev; + EXPECT_EQ(last_msg_.stec_residuals[7].sv_id.constellation, 111) + << "incorrect value for last_msg_.stec_residuals[7].sv_id.constellation, " + "expected 111, is " + << last_msg_.stec_residuals[7].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[7].sv_id.satId, 91) + << "incorrect value for last_msg_.stec_residuals[7].sv_id.satId, " + "expected 91, is " + << last_msg_.stec_residuals[7].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[8].residual, -22874) + << "incorrect value for last_msg_.stec_residuals[8].residual, expected " + "-22874, is " + << last_msg_.stec_residuals[8].residual; + EXPECT_EQ(last_msg_.stec_residuals[8].stddev, 120) + << "incorrect value for last_msg_.stec_residuals[8].stddev, expected " + "120, is " + << last_msg_.stec_residuals[8].stddev; + EXPECT_EQ(last_msg_.stec_residuals[8].sv_id.constellation, 52) + << "incorrect value for last_msg_.stec_residuals[8].sv_id.constellation, " + "expected 52, is " + << last_msg_.stec_residuals[8].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[8].sv_id.satId, 119) + << "incorrect value for last_msg_.stec_residuals[8].sv_id.satId, " + "expected 119, is " + << last_msg_.stec_residuals[8].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[9].residual, 780) + << "incorrect value for last_msg_.stec_residuals[9].residual, expected " + "780, is " + << last_msg_.stec_residuals[9].residual; + EXPECT_EQ(last_msg_.stec_residuals[9].stddev, 156) + << "incorrect value for last_msg_.stec_residuals[9].stddev, expected " + "156, is " + << last_msg_.stec_residuals[9].stddev; + EXPECT_EQ(last_msg_.stec_residuals[9].sv_id.constellation, 221) + << "incorrect value for last_msg_.stec_residuals[9].sv_id.constellation, " + "expected 221, is " + << last_msg_.stec_residuals[9].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[9].sv_id.satId, 57) + << "incorrect value for last_msg_.stec_residuals[9].sv_id.satId, " + "expected 57, is " + << last_msg_.stec_residuals[9].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[10].residual, 32547) + << "incorrect value for last_msg_.stec_residuals[10].residual, expected " + "32547, is " + << last_msg_.stec_residuals[10].residual; + EXPECT_EQ(last_msg_.stec_residuals[10].stddev, 8) + << "incorrect value for last_msg_.stec_residuals[10].stddev, expected 8, " + "is " + << last_msg_.stec_residuals[10].stddev; + EXPECT_EQ(last_msg_.stec_residuals[10].sv_id.constellation, 156) + << "incorrect value for " + "last_msg_.stec_residuals[10].sv_id.constellation, expected 156, is " + << last_msg_.stec_residuals[10].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[10].sv_id.satId, 70) + << "incorrect value for last_msg_.stec_residuals[10].sv_id.satId, " + "expected 70, is " + << last_msg_.stec_residuals[10].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[11].residual, 14208) + << "incorrect value for last_msg_.stec_residuals[11].residual, expected " + "14208, is " + << last_msg_.stec_residuals[11].residual; + EXPECT_EQ(last_msg_.stec_residuals[11].stddev, 115) + << "incorrect value for last_msg_.stec_residuals[11].stddev, expected " + "115, is " + << last_msg_.stec_residuals[11].stddev; + EXPECT_EQ(last_msg_.stec_residuals[11].sv_id.constellation, 58) + << "incorrect value for " + "last_msg_.stec_residuals[11].sv_id.constellation, expected 58, is " + << last_msg_.stec_residuals[11].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[11].sv_id.satId, 127) + << "incorrect value for last_msg_.stec_residuals[11].sv_id.satId, " + "expected 127, is " + << last_msg_.stec_residuals[11].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[12].residual, -26246) + << "incorrect value for last_msg_.stec_residuals[12].residual, expected " + "-26246, is " + << last_msg_.stec_residuals[12].residual; + EXPECT_EQ(last_msg_.stec_residuals[12].stddev, 124) + << "incorrect value for last_msg_.stec_residuals[12].stddev, expected " + "124, is " + << last_msg_.stec_residuals[12].stddev; + EXPECT_EQ(last_msg_.stec_residuals[12].sv_id.constellation, 157) + << "incorrect value for " + "last_msg_.stec_residuals[12].sv_id.constellation, expected 157, is " + << last_msg_.stec_residuals[12].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[12].sv_id.satId, 80) + << "incorrect value for last_msg_.stec_residuals[12].sv_id.satId, " + "expected 80, is " + << last_msg_.stec_residuals[12].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[13].residual, 26466) + << "incorrect value for last_msg_.stec_residuals[13].residual, expected " + "26466, is " + << last_msg_.stec_residuals[13].residual; + EXPECT_EQ(last_msg_.stec_residuals[13].stddev, 204) + << "incorrect value for last_msg_.stec_residuals[13].stddev, expected " + "204, is " + << last_msg_.stec_residuals[13].stddev; + EXPECT_EQ(last_msg_.stec_residuals[13].sv_id.constellation, 128) + << "incorrect value for " + "last_msg_.stec_residuals[13].sv_id.constellation, expected 128, is " + << last_msg_.stec_residuals[13].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[13].sv_id.satId, 27) + << "incorrect value for last_msg_.stec_residuals[13].sv_id.satId, " + "expected 27, is " + << last_msg_.stec_residuals[13].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[14].residual, -7552) + << "incorrect value for last_msg_.stec_residuals[14].residual, expected " + "-7552, is " + << last_msg_.stec_residuals[14].residual; + EXPECT_EQ(last_msg_.stec_residuals[14].stddev, 148) + << "incorrect value for last_msg_.stec_residuals[14].stddev, expected " + "148, is " + << last_msg_.stec_residuals[14].stddev; + EXPECT_EQ(last_msg_.stec_residuals[14].sv_id.constellation, 238) + << "incorrect value for " + "last_msg_.stec_residuals[14].sv_id.constellation, expected 238, is " + << last_msg_.stec_residuals[14].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[14].sv_id.satId, 75) + << "incorrect value for last_msg_.stec_residuals[14].sv_id.satId, " + "expected 75, is " + << last_msg_.stec_residuals[14].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[15].residual, -12072) + << "incorrect value for last_msg_.stec_residuals[15].residual, expected " + "-12072, is " + << last_msg_.stec_residuals[15].residual; + EXPECT_EQ(last_msg_.stec_residuals[15].stddev, 149) + << "incorrect value for last_msg_.stec_residuals[15].stddev, expected " + "149, is " + << last_msg_.stec_residuals[15].stddev; + EXPECT_EQ(last_msg_.stec_residuals[15].sv_id.constellation, 61) + << "incorrect value for " + "last_msg_.stec_residuals[15].sv_id.constellation, expected 61, is " + << last_msg_.stec_residuals[15].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[15].sv_id.satId, 248) + << "incorrect value for last_msg_.stec_residuals[15].sv_id.satId, " + "expected 248, is " + << last_msg_.stec_residuals[15].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[16].residual, -28632) + << "incorrect value for last_msg_.stec_residuals[16].residual, expected " + "-28632, is " + << last_msg_.stec_residuals[16].residual; + EXPECT_EQ(last_msg_.stec_residuals[16].stddev, 186) + << "incorrect value for last_msg_.stec_residuals[16].stddev, expected " + "186, is " + << last_msg_.stec_residuals[16].stddev; + EXPECT_EQ(last_msg_.stec_residuals[16].sv_id.constellation, 224) + << "incorrect value for " + "last_msg_.stec_residuals[16].sv_id.constellation, expected 224, is " + << last_msg_.stec_residuals[16].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[16].sv_id.satId, 167) + << "incorrect value for last_msg_.stec_residuals[16].sv_id.satId, " + "expected 167, is " + << last_msg_.stec_residuals[16].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[17].residual, -4024) + << "incorrect value for last_msg_.stec_residuals[17].residual, expected " + "-4024, is " + << last_msg_.stec_residuals[17].residual; + EXPECT_EQ(last_msg_.stec_residuals[17].stddev, 100) + << "incorrect value for last_msg_.stec_residuals[17].stddev, expected " + "100, is " + << last_msg_.stec_residuals[17].stddev; + EXPECT_EQ(last_msg_.stec_residuals[17].sv_id.constellation, 227) + << "incorrect value for " + "last_msg_.stec_residuals[17].sv_id.constellation, expected 227, is " + << last_msg_.stec_residuals[17].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[17].sv_id.satId, 157) + << "incorrect value for last_msg_.stec_residuals[17].sv_id.satId, " + "expected 157, is " + << last_msg_.stec_residuals[17].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[18].residual, 2004) + << "incorrect value for last_msg_.stec_residuals[18].residual, expected " + "2004, is " + << last_msg_.stec_residuals[18].residual; + EXPECT_EQ(last_msg_.stec_residuals[18].stddev, 59) + << "incorrect value for last_msg_.stec_residuals[18].stddev, expected " + "59, is " + << last_msg_.stec_residuals[18].stddev; + EXPECT_EQ(last_msg_.stec_residuals[18].sv_id.constellation, 12) + << "incorrect value for " + "last_msg_.stec_residuals[18].sv_id.constellation, expected 12, is " + << last_msg_.stec_residuals[18].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[18].sv_id.satId, 35) + << "incorrect value for last_msg_.stec_residuals[18].sv_id.satId, " + "expected 35, is " + << last_msg_.stec_residuals[18].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[19].residual, 6998) + << "incorrect value for last_msg_.stec_residuals[19].residual, expected " + "6998, is " + << last_msg_.stec_residuals[19].residual; + EXPECT_EQ(last_msg_.stec_residuals[19].stddev, 24) + << "incorrect value for last_msg_.stec_residuals[19].stddev, expected " + "24, is " + << last_msg_.stec_residuals[19].stddev; + EXPECT_EQ(last_msg_.stec_residuals[19].sv_id.constellation, 81) + << "incorrect value for " + "last_msg_.stec_residuals[19].sv_id.constellation, expected 81, is " + << last_msg_.stec_residuals[19].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[19].sv_id.satId, 176) + << "incorrect value for last_msg_.stec_residuals[19].sv_id.satId, " + "expected 176, is " + << last_msg_.stec_residuals[19].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[20].residual, -31701) + << "incorrect value for last_msg_.stec_residuals[20].residual, expected " + "-31701, is " + << last_msg_.stec_residuals[20].residual; + EXPECT_EQ(last_msg_.stec_residuals[20].stddev, 45) + << "incorrect value for last_msg_.stec_residuals[20].stddev, expected " + "45, is " + << last_msg_.stec_residuals[20].stddev; + EXPECT_EQ(last_msg_.stec_residuals[20].sv_id.constellation, 67) + << "incorrect value for " + "last_msg_.stec_residuals[20].sv_id.constellation, expected 67, is " + << last_msg_.stec_residuals[20].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[20].sv_id.satId, 155) + << "incorrect value for last_msg_.stec_residuals[20].sv_id.satId, " + "expected 155, is " + << last_msg_.stec_residuals[20].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[21].residual, 28678) + << "incorrect value for last_msg_.stec_residuals[21].residual, expected " + "28678, is " + << last_msg_.stec_residuals[21].residual; + EXPECT_EQ(last_msg_.stec_residuals[21].stddev, 183) + << "incorrect value for last_msg_.stec_residuals[21].stddev, expected " + "183, is " + << last_msg_.stec_residuals[21].stddev; + EXPECT_EQ(last_msg_.stec_residuals[21].sv_id.constellation, 44) + << "incorrect value for " + "last_msg_.stec_residuals[21].sv_id.constellation, expected 44, is " + << last_msg_.stec_residuals[21].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[21].sv_id.satId, 203) + << "incorrect value for last_msg_.stec_residuals[21].sv_id.satId, " + "expected 203, is " + << last_msg_.stec_residuals[21].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[22].residual, -15793) + << "incorrect value for last_msg_.stec_residuals[22].residual, expected " + "-15793, is " + << last_msg_.stec_residuals[22].residual; + EXPECT_EQ(last_msg_.stec_residuals[22].stddev, 253) + << "incorrect value for last_msg_.stec_residuals[22].stddev, expected " + "253, is " + << last_msg_.stec_residuals[22].stddev; + EXPECT_EQ(last_msg_.stec_residuals[22].sv_id.constellation, 176) + << "incorrect value for " + "last_msg_.stec_residuals[22].sv_id.constellation, expected 176, is " + << last_msg_.stec_residuals[22].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[22].sv_id.satId, 231) + << "incorrect value for last_msg_.stec_residuals[22].sv_id.satId, " + "expected 231, is " + << last_msg_.stec_residuals[22].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[23].residual, -7589) + << "incorrect value for last_msg_.stec_residuals[23].residual, expected " + "-7589, is " + << last_msg_.stec_residuals[23].residual; + EXPECT_EQ(last_msg_.stec_residuals[23].stddev, 116) + << "incorrect value for last_msg_.stec_residuals[23].stddev, expected " + "116, is " + << last_msg_.stec_residuals[23].stddev; + EXPECT_EQ(last_msg_.stec_residuals[23].sv_id.constellation, 103) + << "incorrect value for " + "last_msg_.stec_residuals[23].sv_id.constellation, expected 103, is " + << last_msg_.stec_residuals[23].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[23].sv_id.satId, 247) + << "incorrect value for last_msg_.stec_residuals[23].sv_id.satId, " + "expected 247, is " + << last_msg_.stec_residuals[23].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[24].residual, -7362) + << "incorrect value for last_msg_.stec_residuals[24].residual, expected " + "-7362, is " + << last_msg_.stec_residuals[24].residual; + EXPECT_EQ(last_msg_.stec_residuals[24].stddev, 240) + << "incorrect value for last_msg_.stec_residuals[24].stddev, expected " + "240, is " + << last_msg_.stec_residuals[24].stddev; + EXPECT_EQ(last_msg_.stec_residuals[24].sv_id.constellation, 23) + << "incorrect value for " + "last_msg_.stec_residuals[24].sv_id.constellation, expected 23, is " + << last_msg_.stec_residuals[24].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[24].sv_id.satId, 148) + << "incorrect value for last_msg_.stec_residuals[24].sv_id.satId, " + "expected 148, is " + << last_msg_.stec_residuals[24].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[25].residual, 4813) + << "incorrect value for last_msg_.stec_residuals[25].residual, expected " + "4813, is " + << last_msg_.stec_residuals[25].residual; + EXPECT_EQ(last_msg_.stec_residuals[25].stddev, 242) + << "incorrect value for last_msg_.stec_residuals[25].stddev, expected " + "242, is " + << last_msg_.stec_residuals[25].stddev; + EXPECT_EQ(last_msg_.stec_residuals[25].sv_id.constellation, 219) + << "incorrect value for " + "last_msg_.stec_residuals[25].sv_id.constellation, expected 219, is " + << last_msg_.stec_residuals[25].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[25].sv_id.satId, 29) + << "incorrect value for last_msg_.stec_residuals[25].sv_id.satId, " + "expected 29, is " + << last_msg_.stec_residuals[25].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[26].residual, 20295) + << "incorrect value for last_msg_.stec_residuals[26].residual, expected " + "20295, is " + << last_msg_.stec_residuals[26].residual; + EXPECT_EQ(last_msg_.stec_residuals[26].stddev, 37) + << "incorrect value for last_msg_.stec_residuals[26].stddev, expected " + "37, is " + << last_msg_.stec_residuals[26].stddev; + EXPECT_EQ(last_msg_.stec_residuals[26].sv_id.constellation, 72) + << "incorrect value for " + "last_msg_.stec_residuals[26].sv_id.constellation, expected 72, is " + << last_msg_.stec_residuals[26].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[26].sv_id.satId, 207) + << "incorrect value for last_msg_.stec_residuals[26].sv_id.satId, " + "expected 207, is " + << last_msg_.stec_residuals[26].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[27].residual, -13623) + << "incorrect value for last_msg_.stec_residuals[27].residual, expected " + "-13623, is " + << last_msg_.stec_residuals[27].residual; + EXPECT_EQ(last_msg_.stec_residuals[27].stddev, 91) + << "incorrect value for last_msg_.stec_residuals[27].stddev, expected " + "91, is " + << last_msg_.stec_residuals[27].stddev; + EXPECT_EQ(last_msg_.stec_residuals[27].sv_id.constellation, 176) + << "incorrect value for " + "last_msg_.stec_residuals[27].sv_id.constellation, expected 176, is " + << last_msg_.stec_residuals[27].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[27].sv_id.satId, 42) + << "incorrect value for last_msg_.stec_residuals[27].sv_id.satId, " + "expected 42, is " + << last_msg_.stec_residuals[27].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[28].residual, 15250) + << "incorrect value for last_msg_.stec_residuals[28].residual, expected " + "15250, is " + << last_msg_.stec_residuals[28].residual; + EXPECT_EQ(last_msg_.stec_residuals[28].stddev, 110) + << "incorrect value for last_msg_.stec_residuals[28].stddev, expected " + "110, is " + << last_msg_.stec_residuals[28].stddev; + EXPECT_EQ(last_msg_.stec_residuals[28].sv_id.constellation, 115) + << "incorrect value for " + "last_msg_.stec_residuals[28].sv_id.constellation, expected 115, is " + << last_msg_.stec_residuals[28].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[28].sv_id.satId, 105) + << "incorrect value for last_msg_.stec_residuals[28].sv_id.satId, " + "expected 105, is " + << last_msg_.stec_residuals[28].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[29].residual, -18560) + << "incorrect value for last_msg_.stec_residuals[29].residual, expected " + "-18560, is " + << last_msg_.stec_residuals[29].residual; + EXPECT_EQ(last_msg_.stec_residuals[29].stddev, 185) + << "incorrect value for last_msg_.stec_residuals[29].stddev, expected " + "185, is " + << last_msg_.stec_residuals[29].stddev; + EXPECT_EQ(last_msg_.stec_residuals[29].sv_id.constellation, 109) + << "incorrect value for " + "last_msg_.stec_residuals[29].sv_id.constellation, expected 109, is " + << last_msg_.stec_residuals[29].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[29].sv_id.satId, 44) + << "incorrect value for last_msg_.stec_residuals[29].sv_id.satId, " + "expected 44, is " + << last_msg_.stec_residuals[29].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[30].residual, 23717) + << "incorrect value for last_msg_.stec_residuals[30].residual, expected " + "23717, is " + << last_msg_.stec_residuals[30].residual; + EXPECT_EQ(last_msg_.stec_residuals[30].stddev, 79) + << "incorrect value for last_msg_.stec_residuals[30].stddev, expected " + "79, is " + << last_msg_.stec_residuals[30].stddev; + EXPECT_EQ(last_msg_.stec_residuals[30].sv_id.constellation, 31) + << "incorrect value for " + "last_msg_.stec_residuals[30].sv_id.constellation, expected 31, is " + << last_msg_.stec_residuals[30].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[30].sv_id.satId, 67) + << "incorrect value for last_msg_.stec_residuals[30].sv_id.satId, " + "expected 67, is " + << last_msg_.stec_residuals[30].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[31].residual, 1886) + << "incorrect value for last_msg_.stec_residuals[31].residual, expected " + "1886, is " + << last_msg_.stec_residuals[31].residual; + EXPECT_EQ(last_msg_.stec_residuals[31].stddev, 162) + << "incorrect value for last_msg_.stec_residuals[31].stddev, expected " + "162, is " + << last_msg_.stec_residuals[31].stddev; + EXPECT_EQ(last_msg_.stec_residuals[31].sv_id.constellation, 180) + << "incorrect value for " + "last_msg_.stec_residuals[31].sv_id.constellation, expected 180, is " + << last_msg_.stec_residuals[31].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[31].sv_id.satId, 189) + << "incorrect value for last_msg_.stec_residuals[31].sv_id.satId, " + "expected 189, is " + << last_msg_.stec_residuals[31].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[32].residual, 12242) + << "incorrect value for last_msg_.stec_residuals[32].residual, expected " + "12242, is " + << last_msg_.stec_residuals[32].residual; + EXPECT_EQ(last_msg_.stec_residuals[32].stddev, 7) + << "incorrect value for last_msg_.stec_residuals[32].stddev, expected 7, " + "is " + << last_msg_.stec_residuals[32].stddev; + EXPECT_EQ(last_msg_.stec_residuals[32].sv_id.constellation, 156) + << "incorrect value for " + "last_msg_.stec_residuals[32].sv_id.constellation, expected 156, is " + << last_msg_.stec_residuals[32].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[32].sv_id.satId, 121) + << "incorrect value for last_msg_.stec_residuals[32].sv_id.satId, " + "expected 121, is " + << last_msg_.stec_residuals[32].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[33].residual, 10670) + << "incorrect value for last_msg_.stec_residuals[33].residual, expected " + "10670, is " + << last_msg_.stec_residuals[33].residual; + EXPECT_EQ(last_msg_.stec_residuals[33].stddev, 241) + << "incorrect value for last_msg_.stec_residuals[33].stddev, expected " + "241, is " + << last_msg_.stec_residuals[33].stddev; + EXPECT_EQ(last_msg_.stec_residuals[33].sv_id.constellation, 205) + << "incorrect value for " + "last_msg_.stec_residuals[33].sv_id.constellation, expected 205, is " + << last_msg_.stec_residuals[33].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[33].sv_id.satId, 7) + << "incorrect value for last_msg_.stec_residuals[33].sv_id.satId, " + "expected 7, is " + << last_msg_.stec_residuals[33].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[34].residual, 25899) + << "incorrect value for last_msg_.stec_residuals[34].residual, expected " + "25899, is " + << last_msg_.stec_residuals[34].residual; + EXPECT_EQ(last_msg_.stec_residuals[34].stddev, 186) + << "incorrect value for last_msg_.stec_residuals[34].stddev, expected " + "186, is " + << last_msg_.stec_residuals[34].stddev; + EXPECT_EQ(last_msg_.stec_residuals[34].sv_id.constellation, 210) + << "incorrect value for " + "last_msg_.stec_residuals[34].sv_id.constellation, expected 210, is " + << last_msg_.stec_residuals[34].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[34].sv_id.satId, 129) + << "incorrect value for last_msg_.stec_residuals[34].sv_id.satId, " + "expected 129, is " + << last_msg_.stec_residuals[34].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[35].residual, -2078) + << "incorrect value for last_msg_.stec_residuals[35].residual, expected " + "-2078, is " + << last_msg_.stec_residuals[35].residual; + EXPECT_EQ(last_msg_.stec_residuals[35].stddev, 187) + << "incorrect value for last_msg_.stec_residuals[35].stddev, expected " + "187, is " + << last_msg_.stec_residuals[35].stddev; + EXPECT_EQ(last_msg_.stec_residuals[35].sv_id.constellation, 195) + << "incorrect value for " + "last_msg_.stec_residuals[35].sv_id.constellation, expected 195, is " + << last_msg_.stec_residuals[35].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[35].sv_id.satId, 208) + << "incorrect value for last_msg_.stec_residuals[35].sv_id.satId, " + "expected 208, is " + << last_msg_.stec_residuals[35].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[36].residual, -16264) + << "incorrect value for last_msg_.stec_residuals[36].residual, expected " + "-16264, is " + << last_msg_.stec_residuals[36].residual; + EXPECT_EQ(last_msg_.stec_residuals[36].stddev, 102) + << "incorrect value for last_msg_.stec_residuals[36].stddev, expected " + "102, is " + << last_msg_.stec_residuals[36].stddev; + EXPECT_EQ(last_msg_.stec_residuals[36].sv_id.constellation, 160) + << "incorrect value for " + "last_msg_.stec_residuals[36].sv_id.constellation, expected 160, is " + << last_msg_.stec_residuals[36].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[36].sv_id.satId, 219) + << "incorrect value for last_msg_.stec_residuals[36].sv_id.satId, " + "expected 219, is " + << last_msg_.stec_residuals[36].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[37].residual, -21002) + << "incorrect value for last_msg_.stec_residuals[37].residual, expected " + "-21002, is " + << last_msg_.stec_residuals[37].residual; + EXPECT_EQ(last_msg_.stec_residuals[37].stddev, 94) + << "incorrect value for last_msg_.stec_residuals[37].stddev, expected " + "94, is " + << last_msg_.stec_residuals[37].stddev; + EXPECT_EQ(last_msg_.stec_residuals[37].sv_id.constellation, 42) + << "incorrect value for " + "last_msg_.stec_residuals[37].sv_id.constellation, expected 42, is " + << last_msg_.stec_residuals[37].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[37].sv_id.satId, 166) + << "incorrect value for last_msg_.stec_residuals[37].sv_id.satId, " + "expected 166, is " + << last_msg_.stec_residuals[37].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[38].residual, 7902) + << "incorrect value for last_msg_.stec_residuals[38].residual, expected " + "7902, is " + << last_msg_.stec_residuals[38].residual; + EXPECT_EQ(last_msg_.stec_residuals[38].stddev, 35) + << "incorrect value for last_msg_.stec_residuals[38].stddev, expected " + "35, is " + << last_msg_.stec_residuals[38].stddev; + EXPECT_EQ(last_msg_.stec_residuals[38].sv_id.constellation, 156) + << "incorrect value for " + "last_msg_.stec_residuals[38].sv_id.constellation, expected 156, is " + << last_msg_.stec_residuals[38].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[38].sv_id.satId, 102) + << "incorrect value for last_msg_.stec_residuals[38].sv_id.satId, " + "expected 102, is " + << last_msg_.stec_residuals[38].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[39].residual, -30275) + << "incorrect value for last_msg_.stec_residuals[39].residual, expected " + "-30275, is " + << last_msg_.stec_residuals[39].residual; + EXPECT_EQ(last_msg_.stec_residuals[39].stddev, 204) + << "incorrect value for last_msg_.stec_residuals[39].stddev, expected " + "204, is " + << last_msg_.stec_residuals[39].stddev; + EXPECT_EQ(last_msg_.stec_residuals[39].sv_id.constellation, 64) + << "incorrect value for " + "last_msg_.stec_residuals[39].sv_id.constellation, expected 64, is " + << last_msg_.stec_residuals[39].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[39].sv_id.satId, 247) + << "incorrect value for last_msg_.stec_residuals[39].sv_id.satId, " + "expected 247, is " + << last_msg_.stec_residuals[39].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[40].residual, -8633) + << "incorrect value for last_msg_.stec_residuals[40].residual, expected " + "-8633, is " + << last_msg_.stec_residuals[40].residual; + EXPECT_EQ(last_msg_.stec_residuals[40].stddev, 222) + << "incorrect value for last_msg_.stec_residuals[40].stddev, expected " + "222, is " + << last_msg_.stec_residuals[40].stddev; + EXPECT_EQ(last_msg_.stec_residuals[40].sv_id.constellation, 32) + << "incorrect value for " + "last_msg_.stec_residuals[40].sv_id.constellation, expected 32, is " + << last_msg_.stec_residuals[40].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[40].sv_id.satId, 220) + << "incorrect value for last_msg_.stec_residuals[40].sv_id.satId, " + "expected 220, is " + << last_msg_.stec_residuals[40].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[41].residual, 6403) + << "incorrect value for last_msg_.stec_residuals[41].residual, expected " + "6403, is " + << last_msg_.stec_residuals[41].residual; + EXPECT_EQ(last_msg_.stec_residuals[41].stddev, 45) + << "incorrect value for last_msg_.stec_residuals[41].stddev, expected " + "45, is " + << last_msg_.stec_residuals[41].stddev; + EXPECT_EQ(last_msg_.stec_residuals[41].sv_id.constellation, 246) + << "incorrect value for " + "last_msg_.stec_residuals[41].sv_id.constellation, expected 246, is " + << last_msg_.stec_residuals[41].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[41].sv_id.satId, 201) + << "incorrect value for last_msg_.stec_residuals[41].sv_id.satId, " + "expected 201, is " + << last_msg_.stec_residuals[41].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[42].residual, 22643) + << "incorrect value for last_msg_.stec_residuals[42].residual, expected " + "22643, is " + << last_msg_.stec_residuals[42].residual; + EXPECT_EQ(last_msg_.stec_residuals[42].stddev, 218) + << "incorrect value for last_msg_.stec_residuals[42].stddev, expected " + "218, is " + << last_msg_.stec_residuals[42].stddev; + EXPECT_EQ(last_msg_.stec_residuals[42].sv_id.constellation, 239) + << "incorrect value for " + "last_msg_.stec_residuals[42].sv_id.constellation, expected 239, is " + << last_msg_.stec_residuals[42].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[42].sv_id.satId, 251) + << "incorrect value for last_msg_.stec_residuals[42].sv_id.satId, " + "expected 251, is " + << last_msg_.stec_residuals[42].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[43].residual, 16760) + << "incorrect value for last_msg_.stec_residuals[43].residual, expected " + "16760, is " + << last_msg_.stec_residuals[43].residual; + EXPECT_EQ(last_msg_.stec_residuals[43].stddev, 175) + << "incorrect value for last_msg_.stec_residuals[43].stddev, expected " + "175, is " + << last_msg_.stec_residuals[43].stddev; + EXPECT_EQ(last_msg_.stec_residuals[43].sv_id.constellation, 209) + << "incorrect value for " + "last_msg_.stec_residuals[43].sv_id.constellation, expected 209, is " + << last_msg_.stec_residuals[43].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[43].sv_id.satId, 10) + << "incorrect value for last_msg_.stec_residuals[43].sv_id.satId, " + "expected 10, is " + << last_msg_.stec_residuals[43].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[44].residual, -20951) + << "incorrect value for last_msg_.stec_residuals[44].residual, expected " + "-20951, is " + << last_msg_.stec_residuals[44].residual; + EXPECT_EQ(last_msg_.stec_residuals[44].stddev, 137) + << "incorrect value for last_msg_.stec_residuals[44].stddev, expected " + "137, is " + << last_msg_.stec_residuals[44].stddev; + EXPECT_EQ(last_msg_.stec_residuals[44].sv_id.constellation, 194) + << "incorrect value for " + "last_msg_.stec_residuals[44].sv_id.constellation, expected 194, is " + << last_msg_.stec_residuals[44].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[44].sv_id.satId, 131) + << "incorrect value for last_msg_.stec_residuals[44].sv_id.satId, " + "expected 131, is " + << last_msg_.stec_residuals[44].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[45].residual, -740) + << "incorrect value for last_msg_.stec_residuals[45].residual, expected " + "-740, is " + << last_msg_.stec_residuals[45].residual; + EXPECT_EQ(last_msg_.stec_residuals[45].stddev, 42) + << "incorrect value for last_msg_.stec_residuals[45].stddev, expected " + "42, is " + << last_msg_.stec_residuals[45].stddev; + EXPECT_EQ(last_msg_.stec_residuals[45].sv_id.constellation, 68) + << "incorrect value for " + "last_msg_.stec_residuals[45].sv_id.constellation, expected 68, is " + << last_msg_.stec_residuals[45].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[45].sv_id.satId, 17) + << "incorrect value for last_msg_.stec_residuals[45].sv_id.satId, " + "expected 17, is " + << last_msg_.stec_residuals[45].sv_id.satId; + EXPECT_EQ(last_msg_.tropo_delay_correction.hydro, -3035) + << "incorrect value for last_msg_.tropo_delay_correction.hydro, expected " + "-3035, is " + << last_msg_.tropo_delay_correction.hydro; + EXPECT_EQ(last_msg_.tropo_delay_correction.stddev, 72) + << "incorrect value for last_msg_.tropo_delay_correction.stddev, " + "expected 72, is " + << last_msg_.tropo_delay_correction.stddev; + EXPECT_EQ(last_msg_.tropo_delay_correction.wet, 78) + << "incorrect value for last_msg_.tropo_delay_correction.wet, expected " + "78, is " + << last_msg_.tropo_delay_correction.wet; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.cc index 889afc3d3..f4d13b6eb 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.cc @@ -10,60 +10,57 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionBounds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionBounds.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_gridded_correction_bounds_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_ssr_gridded_correction_bounds_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,168 +68,279 @@ class Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds0 : sbp_msg_ssr_gridded_correction_bounds_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds0, Test) { + uint8_t encoded_frame[] = { + 85, 254, 5, 66, 0, 45, 180, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 15, 1, 0, 10, 0, 39, 232, 3, 244, 1, 100, 200, + 150, 100, 150, 100, 2, 5, 10, 16, 0, 17, 18, 19, 20, 21, + 6, 10, 22, 0, 23, 24, 25, 26, 27, 236, 182, + }; + + sbp_msg_ssr_gridded_correction_bounds_t test_msg{}; + test_msg.grid_point_id = 1000; + test_msg.header.num_msgs = 1; + test_msg.header.seq_num = 0; + test_msg.header.sol_id = 0; + test_msg.header.time.tow = 180; + test_msg.header.time.wn = 3; + test_msg.header.update_interval = 10; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_sats.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)101, (char)99, + (char)95, (char)115, (char)97, (char)116, + (char)95, (char)108, (char)105, (char)115, + (char)116}; + memcpy(test_msg.n_sats.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_sats.value = 2; + test_msg.ssr_iod_atmo = 15; - uint8_t encoded_frame[] = {85,254,5,66,0,45,180,0,0,0,3,0,1,0,10,0,15,1,0,10,0,39,232,3,244,1,100,200,150,100,150,100,2,5,10,16,0,17,18,19,20,21,6,10,22,0,23,24,25,26,27,236,182, }; + test_msg.stec_sat_list[0].stec_bound_mu = 18; + test_msg.stec_sat_list[0].stec_bound_mu_dot = 20; + test_msg.stec_sat_list[0].stec_bound_sig = 19; + test_msg.stec_sat_list[0].stec_bound_sig_dot = 21; + test_msg.stec_sat_list[0].stec_residual.residual = 16; + test_msg.stec_sat_list[0].stec_residual.stddev = 17; + test_msg.stec_sat_list[0].stec_residual.sv_id.constellation = 10; + test_msg.stec_sat_list[0].stec_residual.sv_id.satId = 5; - sbp_msg_ssr_gridded_correction_bounds_t test_msg{}; - test_msg.grid_point_id = 1000; - test_msg.header.num_msgs = 1; - test_msg.header.seq_num = 0; - test_msg.header.sol_id = 0; - test_msg.header.time.tow = 180; - test_msg.header.time.wn = 3; - test_msg.header.update_interval = 10; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_sats.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)101,(char)99,(char)95,(char)115,(char)97,(char)116,(char)95,(char)108,(char)105,(char)115,(char)116 }; - memcpy(test_msg.n_sats.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_sats.value = 2; - test_msg.ssr_iod_atmo = 15; - - test_msg.stec_sat_list[0].stec_bound_mu = 18; - test_msg.stec_sat_list[0].stec_bound_mu_dot = 20; - test_msg.stec_sat_list[0].stec_bound_sig = 19; - test_msg.stec_sat_list[0].stec_bound_sig_dot = 21; - test_msg.stec_sat_list[0].stec_residual.residual = 16; - test_msg.stec_sat_list[0].stec_residual.stddev = 17; - test_msg.stec_sat_list[0].stec_residual.sv_id.constellation = 10; - test_msg.stec_sat_list[0].stec_residual.sv_id.satId = 5; - - test_msg.stec_sat_list[1].stec_bound_mu = 24; - test_msg.stec_sat_list[1].stec_bound_mu_dot = 26; - test_msg.stec_sat_list[1].stec_bound_sig = 25; - test_msg.stec_sat_list[1].stec_bound_sig_dot = 27; - test_msg.stec_sat_list[1].stec_residual.residual = 22; - test_msg.stec_sat_list[1].stec_residual.stddev = 23; - test_msg.stec_sat_list[1].stec_residual.sv_id.constellation = 10; - test_msg.stec_sat_list[1].stec_residual.sv_id.satId = 6; - test_msg.tile_id = 10; - test_msg.tile_set_id = 1; - test_msg.tropo_delay_correction.hydro = 500; - test_msg.tropo_delay_correction.stddev = 200; - test_msg.tropo_delay_correction.wet = 100; - test_msg.tropo_qi = 39; - test_msg.tropo_v_hydro_bound_mu = 150; - test_msg.tropo_v_hydro_bound_sig = 100; - test_msg.tropo_v_wet_bound_mu = 150; - test_msg.tropo_v_wet_bound_sig = 100; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + test_msg.stec_sat_list[1].stec_bound_mu = 24; + test_msg.stec_sat_list[1].stec_bound_mu_dot = 26; + test_msg.stec_sat_list[1].stec_bound_sig = 25; + test_msg.stec_sat_list[1].stec_bound_sig_dot = 27; + test_msg.stec_sat_list[1].stec_residual.residual = 22; + test_msg.stec_sat_list[1].stec_residual.stddev = 23; + test_msg.stec_sat_list[1].stec_residual.sv_id.constellation = 10; + test_msg.stec_sat_list[1].stec_residual.sv_id.satId = 6; + test_msg.tile_id = 10; + test_msg.tile_set_id = 1; + test_msg.tropo_delay_correction.hydro = 500; + test_msg.tropo_delay_correction.stddev = 200; + test_msg.tropo_delay_correction.wet = 100; + test_msg.tropo_qi = 39; + test_msg.tropo_v_hydro_bound_mu = 150; + test_msg.tropo_v_hydro_bound_sig = 100; + test_msg.tropo_v_wet_bound_mu = 150; + test_msg.tropo_v_wet_bound_sig = 100; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.grid_point_id, 1000) << "incorrect value for last_msg_.grid_point_id, expected 1000, is " << last_msg_.grid_point_id; - EXPECT_EQ(last_msg_.header.num_msgs, 1) << "incorrect value for last_msg_.header.num_msgs, expected 1, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.seq_num, 0) << "incorrect value for last_msg_.header.seq_num, expected 0, is " << last_msg_.header.seq_num; - EXPECT_EQ(last_msg_.header.sol_id, 0) << "incorrect value for last_msg_.header.sol_id, expected 0, is " << last_msg_.header.sol_id; - EXPECT_EQ(last_msg_.header.time.tow, 180) << "incorrect value for last_msg_.header.time.tow, expected 180, is " << last_msg_.header.time.tow; - EXPECT_EQ(last_msg_.header.time.wn, 3) << "incorrect value for last_msg_.header.time.wn, expected 3, is " << last_msg_.header.time.wn; - EXPECT_EQ(last_msg_.header.update_interval, 10) << "incorrect value for last_msg_.header.update_interval, expected 10, is " << last_msg_.header.update_interval; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_sats.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_sats.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_sats.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)101,(char)99,(char)95,(char)115,(char)97,(char)116,(char)95,(char)108,(char)105,(char)115,(char)116 }; - EXPECT_EQ(memcmp(last_msg_.n_sats.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_sats.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_sats.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_sats.value, 2) << "incorrect value for last_msg_.n_sats.value, expected 2, is " << last_msg_.n_sats.value; - EXPECT_EQ(last_msg_.ssr_iod_atmo, 15) << "incorrect value for last_msg_.ssr_iod_atmo, expected 15, is " << last_msg_.ssr_iod_atmo; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_bound_mu, 18) << "incorrect value for last_msg_.stec_sat_list[0].stec_bound_mu, expected 18, is " << last_msg_.stec_sat_list[0].stec_bound_mu; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_bound_mu_dot, 20) << "incorrect value for last_msg_.stec_sat_list[0].stec_bound_mu_dot, expected 20, is " << last_msg_.stec_sat_list[0].stec_bound_mu_dot; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_bound_sig, 19) << "incorrect value for last_msg_.stec_sat_list[0].stec_bound_sig, expected 19, is " << last_msg_.stec_sat_list[0].stec_bound_sig; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_bound_sig_dot, 21) << "incorrect value for last_msg_.stec_sat_list[0].stec_bound_sig_dot, expected 21, is " << last_msg_.stec_sat_list[0].stec_bound_sig_dot; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_residual.residual, 16) << "incorrect value for last_msg_.stec_sat_list[0].stec_residual.residual, expected 16, is " << last_msg_.stec_sat_list[0].stec_residual.residual; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_residual.stddev, 17) << "incorrect value for last_msg_.stec_sat_list[0].stec_residual.stddev, expected 17, is " << last_msg_.stec_sat_list[0].stec_residual.stddev; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_residual.sv_id.constellation, 10) << "incorrect value for last_msg_.stec_sat_list[0].stec_residual.sv_id.constellation, expected 10, is " << last_msg_.stec_sat_list[0].stec_residual.sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_residual.sv_id.satId, 5) << "incorrect value for last_msg_.stec_sat_list[0].stec_residual.sv_id.satId, expected 5, is " << last_msg_.stec_sat_list[0].stec_residual.sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_bound_mu, 24) << "incorrect value for last_msg_.stec_sat_list[1].stec_bound_mu, expected 24, is " << last_msg_.stec_sat_list[1].stec_bound_mu; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_bound_mu_dot, 26) << "incorrect value for last_msg_.stec_sat_list[1].stec_bound_mu_dot, expected 26, is " << last_msg_.stec_sat_list[1].stec_bound_mu_dot; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_bound_sig, 25) << "incorrect value for last_msg_.stec_sat_list[1].stec_bound_sig, expected 25, is " << last_msg_.stec_sat_list[1].stec_bound_sig; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_bound_sig_dot, 27) << "incorrect value for last_msg_.stec_sat_list[1].stec_bound_sig_dot, expected 27, is " << last_msg_.stec_sat_list[1].stec_bound_sig_dot; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_residual.residual, 22) << "incorrect value for last_msg_.stec_sat_list[1].stec_residual.residual, expected 22, is " << last_msg_.stec_sat_list[1].stec_residual.residual; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_residual.stddev, 23) << "incorrect value for last_msg_.stec_sat_list[1].stec_residual.stddev, expected 23, is " << last_msg_.stec_sat_list[1].stec_residual.stddev; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_residual.sv_id.constellation, 10) << "incorrect value for last_msg_.stec_sat_list[1].stec_residual.sv_id.constellation, expected 10, is " << last_msg_.stec_sat_list[1].stec_residual.sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_residual.sv_id.satId, 6) << "incorrect value for last_msg_.stec_sat_list[1].stec_residual.sv_id.satId, expected 6, is " << last_msg_.stec_sat_list[1].stec_residual.sv_id.satId; - EXPECT_EQ(last_msg_.tile_id, 10) << "incorrect value for last_msg_.tile_id, expected 10, is " << last_msg_.tile_id; - EXPECT_EQ(last_msg_.tile_set_id, 1) << "incorrect value for last_msg_.tile_set_id, expected 1, is " << last_msg_.tile_set_id; - EXPECT_EQ(last_msg_.tropo_delay_correction.hydro, 500) << "incorrect value for last_msg_.tropo_delay_correction.hydro, expected 500, is " << last_msg_.tropo_delay_correction.hydro; - EXPECT_EQ(last_msg_.tropo_delay_correction.stddev, 200) << "incorrect value for last_msg_.tropo_delay_correction.stddev, expected 200, is " << last_msg_.tropo_delay_correction.stddev; - EXPECT_EQ(last_msg_.tropo_delay_correction.wet, 100) << "incorrect value for last_msg_.tropo_delay_correction.wet, expected 100, is " << last_msg_.tropo_delay_correction.wet; - EXPECT_EQ(last_msg_.tropo_qi, 39) << "incorrect value for last_msg_.tropo_qi, expected 39, is " << last_msg_.tropo_qi; - EXPECT_EQ(last_msg_.tropo_v_hydro_bound_mu, 150) << "incorrect value for last_msg_.tropo_v_hydro_bound_mu, expected 150, is " << last_msg_.tropo_v_hydro_bound_mu; - EXPECT_EQ(last_msg_.tropo_v_hydro_bound_sig, 100) << "incorrect value for last_msg_.tropo_v_hydro_bound_sig, expected 100, is " << last_msg_.tropo_v_hydro_bound_sig; - EXPECT_EQ(last_msg_.tropo_v_wet_bound_mu, 150) << "incorrect value for last_msg_.tropo_v_wet_bound_mu, expected 150, is " << last_msg_.tropo_v_wet_bound_mu; - EXPECT_EQ(last_msg_.tropo_v_wet_bound_sig, 100) << "incorrect value for last_msg_.tropo_v_wet_bound_sig, expected 100, is " << last_msg_.tropo_v_wet_bound_sig; + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.grid_point_id, 1000) + << "incorrect value for last_msg_.grid_point_id, expected 1000, is " + << last_msg_.grid_point_id; + EXPECT_EQ(last_msg_.header.num_msgs, 1) + << "incorrect value for last_msg_.header.num_msgs, expected 1, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.seq_num, 0) + << "incorrect value for last_msg_.header.seq_num, expected 0, is " + << last_msg_.header.seq_num; + EXPECT_EQ(last_msg_.header.sol_id, 0) + << "incorrect value for last_msg_.header.sol_id, expected 0, is " + << last_msg_.header.sol_id; + EXPECT_EQ(last_msg_.header.time.tow, 180) + << "incorrect value for last_msg_.header.time.tow, expected 180, is " + << last_msg_.header.time.tow; + EXPECT_EQ(last_msg_.header.time.wn, 3) + << "incorrect value for last_msg_.header.time.wn, expected 3, is " + << last_msg_.header.time.wn; + EXPECT_EQ(last_msg_.header.update_interval, 10) + << "incorrect value for last_msg_.header.update_interval, expected 10, " + "is " + << last_msg_.header.update_interval; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_sats.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_sats.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_sats.handle_as << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)101, (char)99, + (char)95, (char)115, (char)97, (char)116, + (char)95, (char)108, (char)105, (char)115, + (char)116}; + EXPECT_EQ( + memcmp(last_msg_.n_sats.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_sats.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_sats.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_sats.value, 2) + << "incorrect value for last_msg_.n_sats.value, expected 2, is " + << last_msg_.n_sats.value; + EXPECT_EQ(last_msg_.ssr_iod_atmo, 15) + << "incorrect value for last_msg_.ssr_iod_atmo, expected 15, is " + << last_msg_.ssr_iod_atmo; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_bound_mu, 18) + << "incorrect value for last_msg_.stec_sat_list[0].stec_bound_mu, " + "expected 18, is " + << last_msg_.stec_sat_list[0].stec_bound_mu; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_bound_mu_dot, 20) + << "incorrect value for last_msg_.stec_sat_list[0].stec_bound_mu_dot, " + "expected 20, is " + << last_msg_.stec_sat_list[0].stec_bound_mu_dot; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_bound_sig, 19) + << "incorrect value for last_msg_.stec_sat_list[0].stec_bound_sig, " + "expected 19, is " + << last_msg_.stec_sat_list[0].stec_bound_sig; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_bound_sig_dot, 21) + << "incorrect value for last_msg_.stec_sat_list[0].stec_bound_sig_dot, " + "expected 21, is " + << last_msg_.stec_sat_list[0].stec_bound_sig_dot; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_residual.residual, 16) + << "incorrect value for " + "last_msg_.stec_sat_list[0].stec_residual.residual, expected 16, is " + << last_msg_.stec_sat_list[0].stec_residual.residual; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_residual.stddev, 17) + << "incorrect value for last_msg_.stec_sat_list[0].stec_residual.stddev, " + "expected 17, is " + << last_msg_.stec_sat_list[0].stec_residual.stddev; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_residual.sv_id.constellation, 10) + << "incorrect value for " + "last_msg_.stec_sat_list[0].stec_residual.sv_id.constellation, " + "expected 10, is " + << last_msg_.stec_sat_list[0].stec_residual.sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_residual.sv_id.satId, 5) + << "incorrect value for " + "last_msg_.stec_sat_list[0].stec_residual.sv_id.satId, expected 5, is " + << last_msg_.stec_sat_list[0].stec_residual.sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_bound_mu, 24) + << "incorrect value for last_msg_.stec_sat_list[1].stec_bound_mu, " + "expected 24, is " + << last_msg_.stec_sat_list[1].stec_bound_mu; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_bound_mu_dot, 26) + << "incorrect value for last_msg_.stec_sat_list[1].stec_bound_mu_dot, " + "expected 26, is " + << last_msg_.stec_sat_list[1].stec_bound_mu_dot; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_bound_sig, 25) + << "incorrect value for last_msg_.stec_sat_list[1].stec_bound_sig, " + "expected 25, is " + << last_msg_.stec_sat_list[1].stec_bound_sig; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_bound_sig_dot, 27) + << "incorrect value for last_msg_.stec_sat_list[1].stec_bound_sig_dot, " + "expected 27, is " + << last_msg_.stec_sat_list[1].stec_bound_sig_dot; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_residual.residual, 22) + << "incorrect value for " + "last_msg_.stec_sat_list[1].stec_residual.residual, expected 22, is " + << last_msg_.stec_sat_list[1].stec_residual.residual; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_residual.stddev, 23) + << "incorrect value for last_msg_.stec_sat_list[1].stec_residual.stddev, " + "expected 23, is " + << last_msg_.stec_sat_list[1].stec_residual.stddev; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_residual.sv_id.constellation, 10) + << "incorrect value for " + "last_msg_.stec_sat_list[1].stec_residual.sv_id.constellation, " + "expected 10, is " + << last_msg_.stec_sat_list[1].stec_residual.sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_residual.sv_id.satId, 6) + << "incorrect value for " + "last_msg_.stec_sat_list[1].stec_residual.sv_id.satId, expected 6, is " + << last_msg_.stec_sat_list[1].stec_residual.sv_id.satId; + EXPECT_EQ(last_msg_.tile_id, 10) + << "incorrect value for last_msg_.tile_id, expected 10, is " + << last_msg_.tile_id; + EXPECT_EQ(last_msg_.tile_set_id, 1) + << "incorrect value for last_msg_.tile_set_id, expected 1, is " + << last_msg_.tile_set_id; + EXPECT_EQ(last_msg_.tropo_delay_correction.hydro, 500) + << "incorrect value for last_msg_.tropo_delay_correction.hydro, expected " + "500, is " + << last_msg_.tropo_delay_correction.hydro; + EXPECT_EQ(last_msg_.tropo_delay_correction.stddev, 200) + << "incorrect value for last_msg_.tropo_delay_correction.stddev, " + "expected 200, is " + << last_msg_.tropo_delay_correction.stddev; + EXPECT_EQ(last_msg_.tropo_delay_correction.wet, 100) + << "incorrect value for last_msg_.tropo_delay_correction.wet, expected " + "100, is " + << last_msg_.tropo_delay_correction.wet; + EXPECT_EQ(last_msg_.tropo_qi, 39) + << "incorrect value for last_msg_.tropo_qi, expected 39, is " + << last_msg_.tropo_qi; + EXPECT_EQ(last_msg_.tropo_v_hydro_bound_mu, 150) + << "incorrect value for last_msg_.tropo_v_hydro_bound_mu, expected 150, " + "is " + << last_msg_.tropo_v_hydro_bound_mu; + EXPECT_EQ(last_msg_.tropo_v_hydro_bound_sig, 100) + << "incorrect value for last_msg_.tropo_v_hydro_bound_sig, expected 100, " + "is " + << last_msg_.tropo_v_hydro_bound_sig; + EXPECT_EQ(last_msg_.tropo_v_wet_bound_mu, 150) + << "incorrect value for last_msg_.tropo_v_wet_bound_mu, expected 150, is " + << last_msg_.tropo_v_wet_bound_mu; + EXPECT_EQ(last_msg_.tropo_v_wet_bound_sig, 100) + << "incorrect value for last_msg_.tropo_v_wet_bound_sig, expected 100, " + "is " + << last_msg_.tropo_v_wet_bound_sig; } -class Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_gridded_correction_bounds_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_ssr_gridded_correction_bounds_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -240,68 +348,115 @@ class Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds1 : sbp_msg_ssr_gridded_correction_bounds_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds1, Test) -{ +}; - uint8_t encoded_frame[] = {85,254,5,66,0,27,180,0,0,0,3,0,1,0,10,0,15,1,0,10,0,39,232,3,244,1,100,200,150,100,150,100,0,155,36, }; +TEST_F(Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds1, Test) { + uint8_t encoded_frame[] = { + 85, 254, 5, 66, 0, 27, 180, 0, 0, 0, 3, 0, + 1, 0, 10, 0, 15, 1, 0, 10, 0, 39, 232, 3, + 244, 1, 100, 200, 150, 100, 150, 100, 0, 155, 36, + }; - sbp_msg_ssr_gridded_correction_bounds_t test_msg{}; - test_msg.grid_point_id = 1000; - test_msg.header.num_msgs = 1; - test_msg.header.seq_num = 0; - test_msg.header.sol_id = 0; - test_msg.header.time.tow = 180; - test_msg.header.time.wn = 3; - test_msg.header.update_interval = 10; - test_msg.n_sats = 0; - test_msg.ssr_iod_atmo = 15; - test_msg.tile_id = 10; - test_msg.tile_set_id = 1; - test_msg.tropo_delay_correction.hydro = 500; - test_msg.tropo_delay_correction.stddev = 200; - test_msg.tropo_delay_correction.wet = 100; - test_msg.tropo_qi = 39; - test_msg.tropo_v_hydro_bound_mu = 150; - test_msg.tropo_v_hydro_bound_sig = 100; - test_msg.tropo_v_wet_bound_mu = 150; - test_msg.tropo_v_wet_bound_sig = 100; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + sbp_msg_ssr_gridded_correction_bounds_t test_msg{}; + test_msg.grid_point_id = 1000; + test_msg.header.num_msgs = 1; + test_msg.header.seq_num = 0; + test_msg.header.sol_id = 0; + test_msg.header.time.tow = 180; + test_msg.header.time.wn = 3; + test_msg.header.update_interval = 10; + test_msg.n_sats = 0; + test_msg.ssr_iod_atmo = 15; + test_msg.tile_id = 10; + test_msg.tile_set_id = 1; + test_msg.tropo_delay_correction.hydro = 500; + test_msg.tropo_delay_correction.stddev = 200; + test_msg.tropo_delay_correction.wet = 100; + test_msg.tropo_qi = 39; + test_msg.tropo_v_hydro_bound_mu = 150; + test_msg.tropo_v_hydro_bound_sig = 100; + test_msg.tropo_v_wet_bound_mu = 150; + test_msg.tropo_v_wet_bound_sig = 100; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.grid_point_id, 1000) << "incorrect value for last_msg_.grid_point_id, expected 1000, is " << last_msg_.grid_point_id; - EXPECT_EQ(last_msg_.header.num_msgs, 1) << "incorrect value for last_msg_.header.num_msgs, expected 1, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.seq_num, 0) << "incorrect value for last_msg_.header.seq_num, expected 0, is " << last_msg_.header.seq_num; - EXPECT_EQ(last_msg_.header.sol_id, 0) << "incorrect value for last_msg_.header.sol_id, expected 0, is " << last_msg_.header.sol_id; - EXPECT_EQ(last_msg_.header.time.tow, 180) << "incorrect value for last_msg_.header.time.tow, expected 180, is " << last_msg_.header.time.tow; - EXPECT_EQ(last_msg_.header.time.wn, 3) << "incorrect value for last_msg_.header.time.wn, expected 3, is " << last_msg_.header.time.wn; - EXPECT_EQ(last_msg_.header.update_interval, 10) << "incorrect value for last_msg_.header.update_interval, expected 10, is " << last_msg_.header.update_interval; - EXPECT_EQ(last_msg_.n_sats, 0) << "incorrect value for last_msg_.n_sats, expected 0, is " << last_msg_.n_sats; - EXPECT_EQ(last_msg_.ssr_iod_atmo, 15) << "incorrect value for last_msg_.ssr_iod_atmo, expected 15, is " << last_msg_.ssr_iod_atmo; - EXPECT_EQ(last_msg_.tile_id, 10) << "incorrect value for last_msg_.tile_id, expected 10, is " << last_msg_.tile_id; - EXPECT_EQ(last_msg_.tile_set_id, 1) << "incorrect value for last_msg_.tile_set_id, expected 1, is " << last_msg_.tile_set_id; - EXPECT_EQ(last_msg_.tropo_delay_correction.hydro, 500) << "incorrect value for last_msg_.tropo_delay_correction.hydro, expected 500, is " << last_msg_.tropo_delay_correction.hydro; - EXPECT_EQ(last_msg_.tropo_delay_correction.stddev, 200) << "incorrect value for last_msg_.tropo_delay_correction.stddev, expected 200, is " << last_msg_.tropo_delay_correction.stddev; - EXPECT_EQ(last_msg_.tropo_delay_correction.wet, 100) << "incorrect value for last_msg_.tropo_delay_correction.wet, expected 100, is " << last_msg_.tropo_delay_correction.wet; - EXPECT_EQ(last_msg_.tropo_qi, 39) << "incorrect value for last_msg_.tropo_qi, expected 39, is " << last_msg_.tropo_qi; - EXPECT_EQ(last_msg_.tropo_v_hydro_bound_mu, 150) << "incorrect value for last_msg_.tropo_v_hydro_bound_mu, expected 150, is " << last_msg_.tropo_v_hydro_bound_mu; - EXPECT_EQ(last_msg_.tropo_v_hydro_bound_sig, 100) << "incorrect value for last_msg_.tropo_v_hydro_bound_sig, expected 100, is " << last_msg_.tropo_v_hydro_bound_sig; - EXPECT_EQ(last_msg_.tropo_v_wet_bound_mu, 150) << "incorrect value for last_msg_.tropo_v_wet_bound_mu, expected 150, is " << last_msg_.tropo_v_wet_bound_mu; - EXPECT_EQ(last_msg_.tropo_v_wet_bound_sig, 100) << "incorrect value for last_msg_.tropo_v_wet_bound_sig, expected 100, is " << last_msg_.tropo_v_wet_bound_sig; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.grid_point_id, 1000) + << "incorrect value for last_msg_.grid_point_id, expected 1000, is " + << last_msg_.grid_point_id; + EXPECT_EQ(last_msg_.header.num_msgs, 1) + << "incorrect value for last_msg_.header.num_msgs, expected 1, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.seq_num, 0) + << "incorrect value for last_msg_.header.seq_num, expected 0, is " + << last_msg_.header.seq_num; + EXPECT_EQ(last_msg_.header.sol_id, 0) + << "incorrect value for last_msg_.header.sol_id, expected 0, is " + << last_msg_.header.sol_id; + EXPECT_EQ(last_msg_.header.time.tow, 180) + << "incorrect value for last_msg_.header.time.tow, expected 180, is " + << last_msg_.header.time.tow; + EXPECT_EQ(last_msg_.header.time.wn, 3) + << "incorrect value for last_msg_.header.time.wn, expected 3, is " + << last_msg_.header.time.wn; + EXPECT_EQ(last_msg_.header.update_interval, 10) + << "incorrect value for last_msg_.header.update_interval, expected 10, " + "is " + << last_msg_.header.update_interval; + EXPECT_EQ(last_msg_.n_sats, 0) + << "incorrect value for last_msg_.n_sats, expected 0, is " + << last_msg_.n_sats; + EXPECT_EQ(last_msg_.ssr_iod_atmo, 15) + << "incorrect value for last_msg_.ssr_iod_atmo, expected 15, is " + << last_msg_.ssr_iod_atmo; + EXPECT_EQ(last_msg_.tile_id, 10) + << "incorrect value for last_msg_.tile_id, expected 10, is " + << last_msg_.tile_id; + EXPECT_EQ(last_msg_.tile_set_id, 1) + << "incorrect value for last_msg_.tile_set_id, expected 1, is " + << last_msg_.tile_set_id; + EXPECT_EQ(last_msg_.tropo_delay_correction.hydro, 500) + << "incorrect value for last_msg_.tropo_delay_correction.hydro, expected " + "500, is " + << last_msg_.tropo_delay_correction.hydro; + EXPECT_EQ(last_msg_.tropo_delay_correction.stddev, 200) + << "incorrect value for last_msg_.tropo_delay_correction.stddev, " + "expected 200, is " + << last_msg_.tropo_delay_correction.stddev; + EXPECT_EQ(last_msg_.tropo_delay_correction.wet, 100) + << "incorrect value for last_msg_.tropo_delay_correction.wet, expected " + "100, is " + << last_msg_.tropo_delay_correction.wet; + EXPECT_EQ(last_msg_.tropo_qi, 39) + << "incorrect value for last_msg_.tropo_qi, expected 39, is " + << last_msg_.tropo_qi; + EXPECT_EQ(last_msg_.tropo_v_hydro_bound_mu, 150) + << "incorrect value for last_msg_.tropo_v_hydro_bound_mu, expected 150, " + "is " + << last_msg_.tropo_v_hydro_bound_mu; + EXPECT_EQ(last_msg_.tropo_v_hydro_bound_sig, 100) + << "incorrect value for last_msg_.tropo_v_hydro_bound_sig, expected 100, " + "is " + << last_msg_.tropo_v_hydro_bound_sig; + EXPECT_EQ(last_msg_.tropo_v_wet_bound_mu, 150) + << "incorrect value for last_msg_.tropo_v_wet_bound_mu, expected 150, is " + << last_msg_.tropo_v_wet_bound_mu; + EXPECT_EQ(last_msg_.tropo_v_wet_bound_sig, 100) + << "incorrect value for last_msg_.tropo_v_wet_bound_sig, expected 100, " + "is " + << last_msg_.tropo_v_wet_bound_sig; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.cc index 166998e2b..f191c72e8 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.cc @@ -10,60 +10,57 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_gridded_correction_dep_a_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_ssr_gridded_correction_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,493 +68,1129 @@ class Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA0 : sbp_msg_ssr_gridded_correction_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,250,5,108,106,254,164,217,44,53,98,93,63,147,104,252,133,245,28,95,100,147,41,33,92,87,25,142,151,74,151,95,94,7,146,237,45,167,86,42,116,224,169,234,220,23,176,18,13,178,79,160,160,110,15,53,206,151,158,22,117,184,48,170,82,40,53,122,69,180,110,38,65,104,244,19,238,227,88,169,164,146,63,37,183,85,71,235,168,114,211,105,221,156,60,18,230,2,142,172,16,39,33,126,106,99,188,234,41,162,197,138,227,80,12,54,67,238,5,93,1,207,129,13,46,115,49,58,185,127,156,200,96,217,202,15,245,55,198,81,218,132,70,73,82,147,26,255,14,134,96,138,55,214,83,156,170,163,79,173,228,115,51,241,107,245,112,168,210,10,5,117,1,57,108,248,212,145,119,226,165,5,141,202,106,0,60,36,61,243,203,216,215,12,137,16,28,247,115,152,181,119,208,228,203,236,34,167,196,32,109,1,17,101,200,25,94,125,168,137,157,4,164,29,31,48,132,72,229,126,186,68,76,133,21,0,180,139,164,148,119,149,214,120,177,201,80,80,105,10,136,118,77,46,233,233,227,11,158,103,167,216, }; - - sbp_msg_ssr_gridded_correction_dep_a_t test_msg{}; - test_msg.header.iod_atmo = 245; - test_msg.header.num_msgs = 37695; - test_msg.header.seq_num = 64616; - test_msg.header.time.tow = 892131748; - test_msg.header.time.wn = 23906; - test_msg.header.tropo_quality_indicator = 28; - test_msg.header.update_interval = 133; - test_msg.index = 25695; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_stec_residuals.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)101,(char)99,(char)95,(char)114,(char)101,(char)115,(char)105,(char)100,(char)117,(char)97,(char)108,(char)115 }; - memcpy(test_msg.n_stec_residuals.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_stec_residuals.value = 47; - - test_msg.stec_residuals[0].residual = -26738; - test_msg.stec_residuals[0].stddev = 74; - test_msg.stec_residuals[0].sv_id.constellation = 25; - test_msg.stec_residuals[0].sv_id.satId = 87; - - test_msg.stec_residuals[1].residual = 1886; - test_msg.stec_residuals[1].stddev = 146; - test_msg.stec_residuals[1].sv_id.constellation = 95; - test_msg.stec_residuals[1].sv_id.satId = 151; - - test_msg.stec_residuals[2].residual = 22183; - test_msg.stec_residuals[2].stddev = 42; - test_msg.stec_residuals[2].sv_id.constellation = 45; - test_msg.stec_residuals[2].sv_id.satId = 237; - - test_msg.stec_residuals[3].residual = -5463; - test_msg.stec_residuals[3].stddev = 220; - test_msg.stec_residuals[3].sv_id.constellation = 224; - test_msg.stec_residuals[3].sv_id.satId = 116; - - test_msg.stec_residuals[4].residual = 3346; - test_msg.stec_residuals[4].stddev = 178; - test_msg.stec_residuals[4].sv_id.constellation = 176; - test_msg.stec_residuals[4].sv_id.satId = 23; - - test_msg.stec_residuals[5].residual = 28320; - test_msg.stec_residuals[5].stddev = 15; - test_msg.stec_residuals[5].sv_id.constellation = 160; - test_msg.stec_residuals[5].sv_id.satId = 79; - - test_msg.stec_residuals[6].residual = -24937; - test_msg.stec_residuals[6].stddev = 22; - test_msg.stec_residuals[6].sv_id.constellation = 206; - test_msg.stec_residuals[6].sv_id.satId = 53; - - test_msg.stec_residuals[7].residual = -21968; - test_msg.stec_residuals[7].stddev = 82; - test_msg.stec_residuals[7].sv_id.constellation = 184; - test_msg.stec_residuals[7].sv_id.satId = 117; - - test_msg.stec_residuals[8].residual = 17786; - test_msg.stec_residuals[8].stddev = 180; - test_msg.stec_residuals[8].sv_id.constellation = 53; - test_msg.stec_residuals[8].sv_id.satId = 40; - - test_msg.stec_residuals[9].residual = 26689; - test_msg.stec_residuals[9].stddev = 244; - test_msg.stec_residuals[9].sv_id.constellation = 38; - test_msg.stec_residuals[9].sv_id.satId = 110; - - test_msg.stec_residuals[10].residual = 22755; - test_msg.stec_residuals[10].stddev = 169; - test_msg.stec_residuals[10].sv_id.constellation = 238; - test_msg.stec_residuals[10].sv_id.satId = 19; - - test_msg.stec_residuals[11].residual = 9535; - test_msg.stec_residuals[11].stddev = 183; - test_msg.stec_residuals[11].sv_id.constellation = 146; - test_msg.stec_residuals[11].sv_id.satId = 164; - - test_msg.stec_residuals[12].residual = -22293; - test_msg.stec_residuals[12].stddev = 114; - test_msg.stec_residuals[12].sv_id.constellation = 71; - test_msg.stec_residuals[12].sv_id.satId = 85; - - test_msg.stec_residuals[13].residual = -25379; - test_msg.stec_residuals[13].stddev = 60; - test_msg.stec_residuals[13].sv_id.constellation = 105; - test_msg.stec_residuals[13].sv_id.satId = 211; - - test_msg.stec_residuals[14].residual = -29182; - test_msg.stec_residuals[14].stddev = 172; - test_msg.stec_residuals[14].sv_id.constellation = 230; - test_msg.stec_residuals[14].sv_id.satId = 18; - - test_msg.stec_residuals[15].residual = 32289; - test_msg.stec_residuals[15].stddev = 106; - test_msg.stec_residuals[15].sv_id.constellation = 39; - test_msg.stec_residuals[15].sv_id.satId = 16; - - test_msg.stec_residuals[16].residual = 10730; - test_msg.stec_residuals[16].stddev = 162; - test_msg.stec_residuals[16].sv_id.constellation = 188; - test_msg.stec_residuals[16].sv_id.satId = 99; - - test_msg.stec_residuals[17].residual = 20707; - test_msg.stec_residuals[17].stddev = 12; - test_msg.stec_residuals[17].sv_id.constellation = 138; - test_msg.stec_residuals[17].sv_id.satId = 197; - - test_msg.stec_residuals[18].residual = 1518; - test_msg.stec_residuals[18].stddev = 93; - test_msg.stec_residuals[18].sv_id.constellation = 67; - test_msg.stec_residuals[18].sv_id.satId = 54; - - test_msg.stec_residuals[19].residual = 3457; - test_msg.stec_residuals[19].stddev = 46; - test_msg.stec_residuals[19].sv_id.constellation = 207; - test_msg.stec_residuals[19].sv_id.satId = 1; - - test_msg.stec_residuals[20].residual = -18118; - test_msg.stec_residuals[20].stddev = 127; - test_msg.stec_residuals[20].sv_id.constellation = 49; - test_msg.stec_residuals[20].sv_id.satId = 115; - - test_msg.stec_residuals[21].residual = -9888; - test_msg.stec_residuals[21].stddev = 202; - test_msg.stec_residuals[21].sv_id.constellation = 200; - test_msg.stec_residuals[21].sv_id.satId = 156; - - test_msg.stec_residuals[22].residual = -14793; - test_msg.stec_residuals[22].stddev = 81; - test_msg.stec_residuals[22].sv_id.constellation = 245; - test_msg.stec_residuals[22].sv_id.satId = 15; - - test_msg.stec_residuals[23].residual = 18758; - test_msg.stec_residuals[23].stddev = 82; - test_msg.stec_residuals[23].sv_id.constellation = 132; - test_msg.stec_residuals[23].sv_id.satId = 218; - - test_msg.stec_residuals[24].residual = 3839; - test_msg.stec_residuals[24].stddev = 134; - test_msg.stec_residuals[24].sv_id.constellation = 26; - test_msg.stec_residuals[24].sv_id.satId = 147; - - test_msg.stec_residuals[25].residual = -10697; - test_msg.stec_residuals[25].stddev = 83; - test_msg.stec_residuals[25].sv_id.constellation = 138; - test_msg.stec_residuals[25].sv_id.satId = 96; - - test_msg.stec_residuals[26].residual = 20387; - test_msg.stec_residuals[26].stddev = 173; - test_msg.stec_residuals[26].sv_id.constellation = 170; - test_msg.stec_residuals[26].sv_id.satId = 156; - - test_msg.stec_residuals[27].residual = -3789; - test_msg.stec_residuals[27].stddev = 107; - test_msg.stec_residuals[27].sv_id.constellation = 115; - test_msg.stec_residuals[27].sv_id.satId = 228; - - test_msg.stec_residuals[28].residual = -11608; - test_msg.stec_residuals[28].stddev = 10; - test_msg.stec_residuals[28].sv_id.constellation = 112; - test_msg.stec_residuals[28].sv_id.satId = 245; - - test_msg.stec_residuals[29].residual = 14593; - test_msg.stec_residuals[29].stddev = 108; - test_msg.stec_residuals[29].sv_id.constellation = 117; - test_msg.stec_residuals[29].sv_id.satId = 5; - - test_msg.stec_residuals[30].residual = 30609; - test_msg.stec_residuals[30].stddev = 226; - test_msg.stec_residuals[30].sv_id.constellation = 212; - test_msg.stec_residuals[30].sv_id.satId = 248; - - test_msg.stec_residuals[31].residual = -13683; - test_msg.stec_residuals[31].stddev = 106; - test_msg.stec_residuals[31].sv_id.constellation = 5; - test_msg.stec_residuals[31].sv_id.satId = 165; - - test_msg.stec_residuals[32].residual = 15652; - test_msg.stec_residuals[32].stddev = 243; - test_msg.stec_residuals[32].sv_id.constellation = 60; - test_msg.stec_residuals[32].sv_id.satId = 0; - - test_msg.stec_residuals[33].residual = 3287; - test_msg.stec_residuals[33].stddev = 137; - test_msg.stec_residuals[33].sv_id.constellation = 216; - test_msg.stec_residuals[33].sv_id.satId = 203; - - test_msg.stec_residuals[34].residual = 29687; - test_msg.stec_residuals[34].stddev = 152; - test_msg.stec_residuals[34].sv_id.constellation = 28; - test_msg.stec_residuals[34].sv_id.satId = 16; - - test_msg.stec_residuals[35].residual = -6960; - test_msg.stec_residuals[35].stddev = 203; - test_msg.stec_residuals[35].sv_id.constellation = 119; - test_msg.stec_residuals[35].sv_id.satId = 181; - - test_msg.stec_residuals[36].residual = -15193; - test_msg.stec_residuals[36].stddev = 32; - test_msg.stec_residuals[36].sv_id.constellation = 34; - test_msg.stec_residuals[36].sv_id.satId = 236; - - test_msg.stec_residuals[37].residual = 25873; - test_msg.stec_residuals[37].stddev = 200; - test_msg.stec_residuals[37].sv_id.constellation = 1; - test_msg.stec_residuals[37].sv_id.satId = 109; - - test_msg.stec_residuals[38].residual = -22403; - test_msg.stec_residuals[38].stddev = 137; - test_msg.stec_residuals[38].sv_id.constellation = 94; - test_msg.stec_residuals[38].sv_id.satId = 25; - - test_msg.stec_residuals[39].residual = 7588; - test_msg.stec_residuals[39].stddev = 31; - test_msg.stec_residuals[39].sv_id.constellation = 4; - test_msg.stec_residuals[39].sv_id.satId = 157; - - test_msg.stec_residuals[40].residual = -6840; - test_msg.stec_residuals[40].stddev = 126; - test_msg.stec_residuals[40].sv_id.constellation = 132; - test_msg.stec_residuals[40].sv_id.satId = 48; - - test_msg.stec_residuals[41].residual = -31412; - test_msg.stec_residuals[41].stddev = 21; - test_msg.stec_residuals[41].sv_id.constellation = 68; - test_msg.stec_residuals[41].sv_id.satId = 186; - - test_msg.stec_residuals[42].residual = -23413; - test_msg.stec_residuals[42].stddev = 148; - test_msg.stec_residuals[42].sv_id.constellation = 180; - test_msg.stec_residuals[42].sv_id.satId = 0; - - test_msg.stec_residuals[43].residual = 30934; - test_msg.stec_residuals[43].stddev = 177; - test_msg.stec_residuals[43].sv_id.constellation = 149; - test_msg.stec_residuals[43].sv_id.satId = 119; - - test_msg.stec_residuals[44].residual = 26960; - test_msg.stec_residuals[44].stddev = 10; - test_msg.stec_residuals[44].sv_id.constellation = 80; - test_msg.stec_residuals[44].sv_id.satId = 201; - - test_msg.stec_residuals[45].residual = 11853; - test_msg.stec_residuals[45].stddev = 233; - test_msg.stec_residuals[45].sv_id.constellation = 118; - test_msg.stec_residuals[45].sv_id.satId = 136; - - test_msg.stec_residuals[46].residual = -25077; - test_msg.stec_residuals[46].stddev = 103; - test_msg.stec_residuals[46].sv_id.constellation = 227; - test_msg.stec_residuals[46].sv_id.satId = 233; - test_msg.tropo_delay_correction.hydro = 10643; - test_msg.tropo_delay_correction.stddev = 92; - test_msg.tropo_delay_correction.wet = 33; - - EXPECT_EQ(send_message( 27244, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 27244); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.iod_atmo, 245) << "incorrect value for last_msg_.header.iod_atmo, expected 245, is " << last_msg_.header.iod_atmo; - EXPECT_EQ(last_msg_.header.num_msgs, 37695) << "incorrect value for last_msg_.header.num_msgs, expected 37695, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.seq_num, 64616) << "incorrect value for last_msg_.header.seq_num, expected 64616, is " << last_msg_.header.seq_num; - EXPECT_EQ(last_msg_.header.time.tow, 892131748) << "incorrect value for last_msg_.header.time.tow, expected 892131748, is " << last_msg_.header.time.tow; - EXPECT_EQ(last_msg_.header.time.wn, 23906) << "incorrect value for last_msg_.header.time.wn, expected 23906, is " << last_msg_.header.time.wn; - EXPECT_EQ(last_msg_.header.tropo_quality_indicator, 28) << "incorrect value for last_msg_.header.tropo_quality_indicator, expected 28, is " << last_msg_.header.tropo_quality_indicator; - EXPECT_EQ(last_msg_.header.update_interval, 133) << "incorrect value for last_msg_.header.update_interval, expected 133, is " << last_msg_.header.update_interval; - EXPECT_EQ(last_msg_.index, 25695) << "incorrect value for last_msg_.index, expected 25695, is " << last_msg_.index; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_stec_residuals.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_stec_residuals.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_stec_residuals.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)101,(char)99,(char)95,(char)114,(char)101,(char)115,(char)105,(char)100,(char)117,(char)97,(char)108,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_stec_residuals.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_stec_residuals.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_stec_residuals.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_stec_residuals.value, 47) << "incorrect value for last_msg_.n_stec_residuals.value, expected 47, is " << last_msg_.n_stec_residuals.value; - EXPECT_EQ(last_msg_.stec_residuals[0].residual, -26738) << "incorrect value for last_msg_.stec_residuals[0].residual, expected -26738, is " << last_msg_.stec_residuals[0].residual; - EXPECT_EQ(last_msg_.stec_residuals[0].stddev, 74) << "incorrect value for last_msg_.stec_residuals[0].stddev, expected 74, is " << last_msg_.stec_residuals[0].stddev; - EXPECT_EQ(last_msg_.stec_residuals[0].sv_id.constellation, 25) << "incorrect value for last_msg_.stec_residuals[0].sv_id.constellation, expected 25, is " << last_msg_.stec_residuals[0].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[0].sv_id.satId, 87) << "incorrect value for last_msg_.stec_residuals[0].sv_id.satId, expected 87, is " << last_msg_.stec_residuals[0].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[1].residual, 1886) << "incorrect value for last_msg_.stec_residuals[1].residual, expected 1886, is " << last_msg_.stec_residuals[1].residual; - EXPECT_EQ(last_msg_.stec_residuals[1].stddev, 146) << "incorrect value for last_msg_.stec_residuals[1].stddev, expected 146, is " << last_msg_.stec_residuals[1].stddev; - EXPECT_EQ(last_msg_.stec_residuals[1].sv_id.constellation, 95) << "incorrect value for last_msg_.stec_residuals[1].sv_id.constellation, expected 95, is " << last_msg_.stec_residuals[1].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[1].sv_id.satId, 151) << "incorrect value for last_msg_.stec_residuals[1].sv_id.satId, expected 151, is " << last_msg_.stec_residuals[1].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[2].residual, 22183) << "incorrect value for last_msg_.stec_residuals[2].residual, expected 22183, is " << last_msg_.stec_residuals[2].residual; - EXPECT_EQ(last_msg_.stec_residuals[2].stddev, 42) << "incorrect value for last_msg_.stec_residuals[2].stddev, expected 42, is " << last_msg_.stec_residuals[2].stddev; - EXPECT_EQ(last_msg_.stec_residuals[2].sv_id.constellation, 45) << "incorrect value for last_msg_.stec_residuals[2].sv_id.constellation, expected 45, is " << last_msg_.stec_residuals[2].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[2].sv_id.satId, 237) << "incorrect value for last_msg_.stec_residuals[2].sv_id.satId, expected 237, is " << last_msg_.stec_residuals[2].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[3].residual, -5463) << "incorrect value for last_msg_.stec_residuals[3].residual, expected -5463, is " << last_msg_.stec_residuals[3].residual; - EXPECT_EQ(last_msg_.stec_residuals[3].stddev, 220) << "incorrect value for last_msg_.stec_residuals[3].stddev, expected 220, is " << last_msg_.stec_residuals[3].stddev; - EXPECT_EQ(last_msg_.stec_residuals[3].sv_id.constellation, 224) << "incorrect value for last_msg_.stec_residuals[3].sv_id.constellation, expected 224, is " << last_msg_.stec_residuals[3].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[3].sv_id.satId, 116) << "incorrect value for last_msg_.stec_residuals[3].sv_id.satId, expected 116, is " << last_msg_.stec_residuals[3].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[4].residual, 3346) << "incorrect value for last_msg_.stec_residuals[4].residual, expected 3346, is " << last_msg_.stec_residuals[4].residual; - EXPECT_EQ(last_msg_.stec_residuals[4].stddev, 178) << "incorrect value for last_msg_.stec_residuals[4].stddev, expected 178, is " << last_msg_.stec_residuals[4].stddev; - EXPECT_EQ(last_msg_.stec_residuals[4].sv_id.constellation, 176) << "incorrect value for last_msg_.stec_residuals[4].sv_id.constellation, expected 176, is " << last_msg_.stec_residuals[4].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[4].sv_id.satId, 23) << "incorrect value for last_msg_.stec_residuals[4].sv_id.satId, expected 23, is " << last_msg_.stec_residuals[4].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[5].residual, 28320) << "incorrect value for last_msg_.stec_residuals[5].residual, expected 28320, is " << last_msg_.stec_residuals[5].residual; - EXPECT_EQ(last_msg_.stec_residuals[5].stddev, 15) << "incorrect value for last_msg_.stec_residuals[5].stddev, expected 15, is " << last_msg_.stec_residuals[5].stddev; - EXPECT_EQ(last_msg_.stec_residuals[5].sv_id.constellation, 160) << "incorrect value for last_msg_.stec_residuals[5].sv_id.constellation, expected 160, is " << last_msg_.stec_residuals[5].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[5].sv_id.satId, 79) << "incorrect value for last_msg_.stec_residuals[5].sv_id.satId, expected 79, is " << last_msg_.stec_residuals[5].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[6].residual, -24937) << "incorrect value for last_msg_.stec_residuals[6].residual, expected -24937, is " << last_msg_.stec_residuals[6].residual; - EXPECT_EQ(last_msg_.stec_residuals[6].stddev, 22) << "incorrect value for last_msg_.stec_residuals[6].stddev, expected 22, is " << last_msg_.stec_residuals[6].stddev; - EXPECT_EQ(last_msg_.stec_residuals[6].sv_id.constellation, 206) << "incorrect value for last_msg_.stec_residuals[6].sv_id.constellation, expected 206, is " << last_msg_.stec_residuals[6].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[6].sv_id.satId, 53) << "incorrect value for last_msg_.stec_residuals[6].sv_id.satId, expected 53, is " << last_msg_.stec_residuals[6].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[7].residual, -21968) << "incorrect value for last_msg_.stec_residuals[7].residual, expected -21968, is " << last_msg_.stec_residuals[7].residual; - EXPECT_EQ(last_msg_.stec_residuals[7].stddev, 82) << "incorrect value for last_msg_.stec_residuals[7].stddev, expected 82, is " << last_msg_.stec_residuals[7].stddev; - EXPECT_EQ(last_msg_.stec_residuals[7].sv_id.constellation, 184) << "incorrect value for last_msg_.stec_residuals[7].sv_id.constellation, expected 184, is " << last_msg_.stec_residuals[7].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[7].sv_id.satId, 117) << "incorrect value for last_msg_.stec_residuals[7].sv_id.satId, expected 117, is " << last_msg_.stec_residuals[7].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[8].residual, 17786) << "incorrect value for last_msg_.stec_residuals[8].residual, expected 17786, is " << last_msg_.stec_residuals[8].residual; - EXPECT_EQ(last_msg_.stec_residuals[8].stddev, 180) << "incorrect value for last_msg_.stec_residuals[8].stddev, expected 180, is " << last_msg_.stec_residuals[8].stddev; - EXPECT_EQ(last_msg_.stec_residuals[8].sv_id.constellation, 53) << "incorrect value for last_msg_.stec_residuals[8].sv_id.constellation, expected 53, is " << last_msg_.stec_residuals[8].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[8].sv_id.satId, 40) << "incorrect value for last_msg_.stec_residuals[8].sv_id.satId, expected 40, is " << last_msg_.stec_residuals[8].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[9].residual, 26689) << "incorrect value for last_msg_.stec_residuals[9].residual, expected 26689, is " << last_msg_.stec_residuals[9].residual; - EXPECT_EQ(last_msg_.stec_residuals[9].stddev, 244) << "incorrect value for last_msg_.stec_residuals[9].stddev, expected 244, is " << last_msg_.stec_residuals[9].stddev; - EXPECT_EQ(last_msg_.stec_residuals[9].sv_id.constellation, 38) << "incorrect value for last_msg_.stec_residuals[9].sv_id.constellation, expected 38, is " << last_msg_.stec_residuals[9].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[9].sv_id.satId, 110) << "incorrect value for last_msg_.stec_residuals[9].sv_id.satId, expected 110, is " << last_msg_.stec_residuals[9].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[10].residual, 22755) << "incorrect value for last_msg_.stec_residuals[10].residual, expected 22755, is " << last_msg_.stec_residuals[10].residual; - EXPECT_EQ(last_msg_.stec_residuals[10].stddev, 169) << "incorrect value for last_msg_.stec_residuals[10].stddev, expected 169, is " << last_msg_.stec_residuals[10].stddev; - EXPECT_EQ(last_msg_.stec_residuals[10].sv_id.constellation, 238) << "incorrect value for last_msg_.stec_residuals[10].sv_id.constellation, expected 238, is " << last_msg_.stec_residuals[10].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[10].sv_id.satId, 19) << "incorrect value for last_msg_.stec_residuals[10].sv_id.satId, expected 19, is " << last_msg_.stec_residuals[10].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[11].residual, 9535) << "incorrect value for last_msg_.stec_residuals[11].residual, expected 9535, is " << last_msg_.stec_residuals[11].residual; - EXPECT_EQ(last_msg_.stec_residuals[11].stddev, 183) << "incorrect value for last_msg_.stec_residuals[11].stddev, expected 183, is " << last_msg_.stec_residuals[11].stddev; - EXPECT_EQ(last_msg_.stec_residuals[11].sv_id.constellation, 146) << "incorrect value for last_msg_.stec_residuals[11].sv_id.constellation, expected 146, is " << last_msg_.stec_residuals[11].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[11].sv_id.satId, 164) << "incorrect value for last_msg_.stec_residuals[11].sv_id.satId, expected 164, is " << last_msg_.stec_residuals[11].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[12].residual, -22293) << "incorrect value for last_msg_.stec_residuals[12].residual, expected -22293, is " << last_msg_.stec_residuals[12].residual; - EXPECT_EQ(last_msg_.stec_residuals[12].stddev, 114) << "incorrect value for last_msg_.stec_residuals[12].stddev, expected 114, is " << last_msg_.stec_residuals[12].stddev; - EXPECT_EQ(last_msg_.stec_residuals[12].sv_id.constellation, 71) << "incorrect value for last_msg_.stec_residuals[12].sv_id.constellation, expected 71, is " << last_msg_.stec_residuals[12].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[12].sv_id.satId, 85) << "incorrect value for last_msg_.stec_residuals[12].sv_id.satId, expected 85, is " << last_msg_.stec_residuals[12].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[13].residual, -25379) << "incorrect value for last_msg_.stec_residuals[13].residual, expected -25379, is " << last_msg_.stec_residuals[13].residual; - EXPECT_EQ(last_msg_.stec_residuals[13].stddev, 60) << "incorrect value for last_msg_.stec_residuals[13].stddev, expected 60, is " << last_msg_.stec_residuals[13].stddev; - EXPECT_EQ(last_msg_.stec_residuals[13].sv_id.constellation, 105) << "incorrect value for last_msg_.stec_residuals[13].sv_id.constellation, expected 105, is " << last_msg_.stec_residuals[13].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[13].sv_id.satId, 211) << "incorrect value for last_msg_.stec_residuals[13].sv_id.satId, expected 211, is " << last_msg_.stec_residuals[13].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[14].residual, -29182) << "incorrect value for last_msg_.stec_residuals[14].residual, expected -29182, is " << last_msg_.stec_residuals[14].residual; - EXPECT_EQ(last_msg_.stec_residuals[14].stddev, 172) << "incorrect value for last_msg_.stec_residuals[14].stddev, expected 172, is " << last_msg_.stec_residuals[14].stddev; - EXPECT_EQ(last_msg_.stec_residuals[14].sv_id.constellation, 230) << "incorrect value for last_msg_.stec_residuals[14].sv_id.constellation, expected 230, is " << last_msg_.stec_residuals[14].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[14].sv_id.satId, 18) << "incorrect value for last_msg_.stec_residuals[14].sv_id.satId, expected 18, is " << last_msg_.stec_residuals[14].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[15].residual, 32289) << "incorrect value for last_msg_.stec_residuals[15].residual, expected 32289, is " << last_msg_.stec_residuals[15].residual; - EXPECT_EQ(last_msg_.stec_residuals[15].stddev, 106) << "incorrect value for last_msg_.stec_residuals[15].stddev, expected 106, is " << last_msg_.stec_residuals[15].stddev; - EXPECT_EQ(last_msg_.stec_residuals[15].sv_id.constellation, 39) << "incorrect value for last_msg_.stec_residuals[15].sv_id.constellation, expected 39, is " << last_msg_.stec_residuals[15].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[15].sv_id.satId, 16) << "incorrect value for last_msg_.stec_residuals[15].sv_id.satId, expected 16, is " << last_msg_.stec_residuals[15].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[16].residual, 10730) << "incorrect value for last_msg_.stec_residuals[16].residual, expected 10730, is " << last_msg_.stec_residuals[16].residual; - EXPECT_EQ(last_msg_.stec_residuals[16].stddev, 162) << "incorrect value for last_msg_.stec_residuals[16].stddev, expected 162, is " << last_msg_.stec_residuals[16].stddev; - EXPECT_EQ(last_msg_.stec_residuals[16].sv_id.constellation, 188) << "incorrect value for last_msg_.stec_residuals[16].sv_id.constellation, expected 188, is " << last_msg_.stec_residuals[16].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[16].sv_id.satId, 99) << "incorrect value for last_msg_.stec_residuals[16].sv_id.satId, expected 99, is " << last_msg_.stec_residuals[16].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[17].residual, 20707) << "incorrect value for last_msg_.stec_residuals[17].residual, expected 20707, is " << last_msg_.stec_residuals[17].residual; - EXPECT_EQ(last_msg_.stec_residuals[17].stddev, 12) << "incorrect value for last_msg_.stec_residuals[17].stddev, expected 12, is " << last_msg_.stec_residuals[17].stddev; - EXPECT_EQ(last_msg_.stec_residuals[17].sv_id.constellation, 138) << "incorrect value for last_msg_.stec_residuals[17].sv_id.constellation, expected 138, is " << last_msg_.stec_residuals[17].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[17].sv_id.satId, 197) << "incorrect value for last_msg_.stec_residuals[17].sv_id.satId, expected 197, is " << last_msg_.stec_residuals[17].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[18].residual, 1518) << "incorrect value for last_msg_.stec_residuals[18].residual, expected 1518, is " << last_msg_.stec_residuals[18].residual; - EXPECT_EQ(last_msg_.stec_residuals[18].stddev, 93) << "incorrect value for last_msg_.stec_residuals[18].stddev, expected 93, is " << last_msg_.stec_residuals[18].stddev; - EXPECT_EQ(last_msg_.stec_residuals[18].sv_id.constellation, 67) << "incorrect value for last_msg_.stec_residuals[18].sv_id.constellation, expected 67, is " << last_msg_.stec_residuals[18].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[18].sv_id.satId, 54) << "incorrect value for last_msg_.stec_residuals[18].sv_id.satId, expected 54, is " << last_msg_.stec_residuals[18].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[19].residual, 3457) << "incorrect value for last_msg_.stec_residuals[19].residual, expected 3457, is " << last_msg_.stec_residuals[19].residual; - EXPECT_EQ(last_msg_.stec_residuals[19].stddev, 46) << "incorrect value for last_msg_.stec_residuals[19].stddev, expected 46, is " << last_msg_.stec_residuals[19].stddev; - EXPECT_EQ(last_msg_.stec_residuals[19].sv_id.constellation, 207) << "incorrect value for last_msg_.stec_residuals[19].sv_id.constellation, expected 207, is " << last_msg_.stec_residuals[19].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[19].sv_id.satId, 1) << "incorrect value for last_msg_.stec_residuals[19].sv_id.satId, expected 1, is " << last_msg_.stec_residuals[19].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[20].residual, -18118) << "incorrect value for last_msg_.stec_residuals[20].residual, expected -18118, is " << last_msg_.stec_residuals[20].residual; - EXPECT_EQ(last_msg_.stec_residuals[20].stddev, 127) << "incorrect value for last_msg_.stec_residuals[20].stddev, expected 127, is " << last_msg_.stec_residuals[20].stddev; - EXPECT_EQ(last_msg_.stec_residuals[20].sv_id.constellation, 49) << "incorrect value for last_msg_.stec_residuals[20].sv_id.constellation, expected 49, is " << last_msg_.stec_residuals[20].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[20].sv_id.satId, 115) << "incorrect value for last_msg_.stec_residuals[20].sv_id.satId, expected 115, is " << last_msg_.stec_residuals[20].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[21].residual, -9888) << "incorrect value for last_msg_.stec_residuals[21].residual, expected -9888, is " << last_msg_.stec_residuals[21].residual; - EXPECT_EQ(last_msg_.stec_residuals[21].stddev, 202) << "incorrect value for last_msg_.stec_residuals[21].stddev, expected 202, is " << last_msg_.stec_residuals[21].stddev; - EXPECT_EQ(last_msg_.stec_residuals[21].sv_id.constellation, 200) << "incorrect value for last_msg_.stec_residuals[21].sv_id.constellation, expected 200, is " << last_msg_.stec_residuals[21].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[21].sv_id.satId, 156) << "incorrect value for last_msg_.stec_residuals[21].sv_id.satId, expected 156, is " << last_msg_.stec_residuals[21].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[22].residual, -14793) << "incorrect value for last_msg_.stec_residuals[22].residual, expected -14793, is " << last_msg_.stec_residuals[22].residual; - EXPECT_EQ(last_msg_.stec_residuals[22].stddev, 81) << "incorrect value for last_msg_.stec_residuals[22].stddev, expected 81, is " << last_msg_.stec_residuals[22].stddev; - EXPECT_EQ(last_msg_.stec_residuals[22].sv_id.constellation, 245) << "incorrect value for last_msg_.stec_residuals[22].sv_id.constellation, expected 245, is " << last_msg_.stec_residuals[22].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[22].sv_id.satId, 15) << "incorrect value for last_msg_.stec_residuals[22].sv_id.satId, expected 15, is " << last_msg_.stec_residuals[22].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[23].residual, 18758) << "incorrect value for last_msg_.stec_residuals[23].residual, expected 18758, is " << last_msg_.stec_residuals[23].residual; - EXPECT_EQ(last_msg_.stec_residuals[23].stddev, 82) << "incorrect value for last_msg_.stec_residuals[23].stddev, expected 82, is " << last_msg_.stec_residuals[23].stddev; - EXPECT_EQ(last_msg_.stec_residuals[23].sv_id.constellation, 132) << "incorrect value for last_msg_.stec_residuals[23].sv_id.constellation, expected 132, is " << last_msg_.stec_residuals[23].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[23].sv_id.satId, 218) << "incorrect value for last_msg_.stec_residuals[23].sv_id.satId, expected 218, is " << last_msg_.stec_residuals[23].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[24].residual, 3839) << "incorrect value for last_msg_.stec_residuals[24].residual, expected 3839, is " << last_msg_.stec_residuals[24].residual; - EXPECT_EQ(last_msg_.stec_residuals[24].stddev, 134) << "incorrect value for last_msg_.stec_residuals[24].stddev, expected 134, is " << last_msg_.stec_residuals[24].stddev; - EXPECT_EQ(last_msg_.stec_residuals[24].sv_id.constellation, 26) << "incorrect value for last_msg_.stec_residuals[24].sv_id.constellation, expected 26, is " << last_msg_.stec_residuals[24].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[24].sv_id.satId, 147) << "incorrect value for last_msg_.stec_residuals[24].sv_id.satId, expected 147, is " << last_msg_.stec_residuals[24].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[25].residual, -10697) << "incorrect value for last_msg_.stec_residuals[25].residual, expected -10697, is " << last_msg_.stec_residuals[25].residual; - EXPECT_EQ(last_msg_.stec_residuals[25].stddev, 83) << "incorrect value for last_msg_.stec_residuals[25].stddev, expected 83, is " << last_msg_.stec_residuals[25].stddev; - EXPECT_EQ(last_msg_.stec_residuals[25].sv_id.constellation, 138) << "incorrect value for last_msg_.stec_residuals[25].sv_id.constellation, expected 138, is " << last_msg_.stec_residuals[25].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[25].sv_id.satId, 96) << "incorrect value for last_msg_.stec_residuals[25].sv_id.satId, expected 96, is " << last_msg_.stec_residuals[25].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[26].residual, 20387) << "incorrect value for last_msg_.stec_residuals[26].residual, expected 20387, is " << last_msg_.stec_residuals[26].residual; - EXPECT_EQ(last_msg_.stec_residuals[26].stddev, 173) << "incorrect value for last_msg_.stec_residuals[26].stddev, expected 173, is " << last_msg_.stec_residuals[26].stddev; - EXPECT_EQ(last_msg_.stec_residuals[26].sv_id.constellation, 170) << "incorrect value for last_msg_.stec_residuals[26].sv_id.constellation, expected 170, is " << last_msg_.stec_residuals[26].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[26].sv_id.satId, 156) << "incorrect value for last_msg_.stec_residuals[26].sv_id.satId, expected 156, is " << last_msg_.stec_residuals[26].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[27].residual, -3789) << "incorrect value for last_msg_.stec_residuals[27].residual, expected -3789, is " << last_msg_.stec_residuals[27].residual; - EXPECT_EQ(last_msg_.stec_residuals[27].stddev, 107) << "incorrect value for last_msg_.stec_residuals[27].stddev, expected 107, is " << last_msg_.stec_residuals[27].stddev; - EXPECT_EQ(last_msg_.stec_residuals[27].sv_id.constellation, 115) << "incorrect value for last_msg_.stec_residuals[27].sv_id.constellation, expected 115, is " << last_msg_.stec_residuals[27].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[27].sv_id.satId, 228) << "incorrect value for last_msg_.stec_residuals[27].sv_id.satId, expected 228, is " << last_msg_.stec_residuals[27].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[28].residual, -11608) << "incorrect value for last_msg_.stec_residuals[28].residual, expected -11608, is " << last_msg_.stec_residuals[28].residual; - EXPECT_EQ(last_msg_.stec_residuals[28].stddev, 10) << "incorrect value for last_msg_.stec_residuals[28].stddev, expected 10, is " << last_msg_.stec_residuals[28].stddev; - EXPECT_EQ(last_msg_.stec_residuals[28].sv_id.constellation, 112) << "incorrect value for last_msg_.stec_residuals[28].sv_id.constellation, expected 112, is " << last_msg_.stec_residuals[28].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[28].sv_id.satId, 245) << "incorrect value for last_msg_.stec_residuals[28].sv_id.satId, expected 245, is " << last_msg_.stec_residuals[28].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[29].residual, 14593) << "incorrect value for last_msg_.stec_residuals[29].residual, expected 14593, is " << last_msg_.stec_residuals[29].residual; - EXPECT_EQ(last_msg_.stec_residuals[29].stddev, 108) << "incorrect value for last_msg_.stec_residuals[29].stddev, expected 108, is " << last_msg_.stec_residuals[29].stddev; - EXPECT_EQ(last_msg_.stec_residuals[29].sv_id.constellation, 117) << "incorrect value for last_msg_.stec_residuals[29].sv_id.constellation, expected 117, is " << last_msg_.stec_residuals[29].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[29].sv_id.satId, 5) << "incorrect value for last_msg_.stec_residuals[29].sv_id.satId, expected 5, is " << last_msg_.stec_residuals[29].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[30].residual, 30609) << "incorrect value for last_msg_.stec_residuals[30].residual, expected 30609, is " << last_msg_.stec_residuals[30].residual; - EXPECT_EQ(last_msg_.stec_residuals[30].stddev, 226) << "incorrect value for last_msg_.stec_residuals[30].stddev, expected 226, is " << last_msg_.stec_residuals[30].stddev; - EXPECT_EQ(last_msg_.stec_residuals[30].sv_id.constellation, 212) << "incorrect value for last_msg_.stec_residuals[30].sv_id.constellation, expected 212, is " << last_msg_.stec_residuals[30].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[30].sv_id.satId, 248) << "incorrect value for last_msg_.stec_residuals[30].sv_id.satId, expected 248, is " << last_msg_.stec_residuals[30].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[31].residual, -13683) << "incorrect value for last_msg_.stec_residuals[31].residual, expected -13683, is " << last_msg_.stec_residuals[31].residual; - EXPECT_EQ(last_msg_.stec_residuals[31].stddev, 106) << "incorrect value for last_msg_.stec_residuals[31].stddev, expected 106, is " << last_msg_.stec_residuals[31].stddev; - EXPECT_EQ(last_msg_.stec_residuals[31].sv_id.constellation, 5) << "incorrect value for last_msg_.stec_residuals[31].sv_id.constellation, expected 5, is " << last_msg_.stec_residuals[31].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[31].sv_id.satId, 165) << "incorrect value for last_msg_.stec_residuals[31].sv_id.satId, expected 165, is " << last_msg_.stec_residuals[31].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[32].residual, 15652) << "incorrect value for last_msg_.stec_residuals[32].residual, expected 15652, is " << last_msg_.stec_residuals[32].residual; - EXPECT_EQ(last_msg_.stec_residuals[32].stddev, 243) << "incorrect value for last_msg_.stec_residuals[32].stddev, expected 243, is " << last_msg_.stec_residuals[32].stddev; - EXPECT_EQ(last_msg_.stec_residuals[32].sv_id.constellation, 60) << "incorrect value for last_msg_.stec_residuals[32].sv_id.constellation, expected 60, is " << last_msg_.stec_residuals[32].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[32].sv_id.satId, 0) << "incorrect value for last_msg_.stec_residuals[32].sv_id.satId, expected 0, is " << last_msg_.stec_residuals[32].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[33].residual, 3287) << "incorrect value for last_msg_.stec_residuals[33].residual, expected 3287, is " << last_msg_.stec_residuals[33].residual; - EXPECT_EQ(last_msg_.stec_residuals[33].stddev, 137) << "incorrect value for last_msg_.stec_residuals[33].stddev, expected 137, is " << last_msg_.stec_residuals[33].stddev; - EXPECT_EQ(last_msg_.stec_residuals[33].sv_id.constellation, 216) << "incorrect value for last_msg_.stec_residuals[33].sv_id.constellation, expected 216, is " << last_msg_.stec_residuals[33].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[33].sv_id.satId, 203) << "incorrect value for last_msg_.stec_residuals[33].sv_id.satId, expected 203, is " << last_msg_.stec_residuals[33].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[34].residual, 29687) << "incorrect value for last_msg_.stec_residuals[34].residual, expected 29687, is " << last_msg_.stec_residuals[34].residual; - EXPECT_EQ(last_msg_.stec_residuals[34].stddev, 152) << "incorrect value for last_msg_.stec_residuals[34].stddev, expected 152, is " << last_msg_.stec_residuals[34].stddev; - EXPECT_EQ(last_msg_.stec_residuals[34].sv_id.constellation, 28) << "incorrect value for last_msg_.stec_residuals[34].sv_id.constellation, expected 28, is " << last_msg_.stec_residuals[34].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[34].sv_id.satId, 16) << "incorrect value for last_msg_.stec_residuals[34].sv_id.satId, expected 16, is " << last_msg_.stec_residuals[34].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[35].residual, -6960) << "incorrect value for last_msg_.stec_residuals[35].residual, expected -6960, is " << last_msg_.stec_residuals[35].residual; - EXPECT_EQ(last_msg_.stec_residuals[35].stddev, 203) << "incorrect value for last_msg_.stec_residuals[35].stddev, expected 203, is " << last_msg_.stec_residuals[35].stddev; - EXPECT_EQ(last_msg_.stec_residuals[35].sv_id.constellation, 119) << "incorrect value for last_msg_.stec_residuals[35].sv_id.constellation, expected 119, is " << last_msg_.stec_residuals[35].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[35].sv_id.satId, 181) << "incorrect value for last_msg_.stec_residuals[35].sv_id.satId, expected 181, is " << last_msg_.stec_residuals[35].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[36].residual, -15193) << "incorrect value for last_msg_.stec_residuals[36].residual, expected -15193, is " << last_msg_.stec_residuals[36].residual; - EXPECT_EQ(last_msg_.stec_residuals[36].stddev, 32) << "incorrect value for last_msg_.stec_residuals[36].stddev, expected 32, is " << last_msg_.stec_residuals[36].stddev; - EXPECT_EQ(last_msg_.stec_residuals[36].sv_id.constellation, 34) << "incorrect value for last_msg_.stec_residuals[36].sv_id.constellation, expected 34, is " << last_msg_.stec_residuals[36].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[36].sv_id.satId, 236) << "incorrect value for last_msg_.stec_residuals[36].sv_id.satId, expected 236, is " << last_msg_.stec_residuals[36].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[37].residual, 25873) << "incorrect value for last_msg_.stec_residuals[37].residual, expected 25873, is " << last_msg_.stec_residuals[37].residual; - EXPECT_EQ(last_msg_.stec_residuals[37].stddev, 200) << "incorrect value for last_msg_.stec_residuals[37].stddev, expected 200, is " << last_msg_.stec_residuals[37].stddev; - EXPECT_EQ(last_msg_.stec_residuals[37].sv_id.constellation, 1) << "incorrect value for last_msg_.stec_residuals[37].sv_id.constellation, expected 1, is " << last_msg_.stec_residuals[37].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[37].sv_id.satId, 109) << "incorrect value for last_msg_.stec_residuals[37].sv_id.satId, expected 109, is " << last_msg_.stec_residuals[37].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[38].residual, -22403) << "incorrect value for last_msg_.stec_residuals[38].residual, expected -22403, is " << last_msg_.stec_residuals[38].residual; - EXPECT_EQ(last_msg_.stec_residuals[38].stddev, 137) << "incorrect value for last_msg_.stec_residuals[38].stddev, expected 137, is " << last_msg_.stec_residuals[38].stddev; - EXPECT_EQ(last_msg_.stec_residuals[38].sv_id.constellation, 94) << "incorrect value for last_msg_.stec_residuals[38].sv_id.constellation, expected 94, is " << last_msg_.stec_residuals[38].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[38].sv_id.satId, 25) << "incorrect value for last_msg_.stec_residuals[38].sv_id.satId, expected 25, is " << last_msg_.stec_residuals[38].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[39].residual, 7588) << "incorrect value for last_msg_.stec_residuals[39].residual, expected 7588, is " << last_msg_.stec_residuals[39].residual; - EXPECT_EQ(last_msg_.stec_residuals[39].stddev, 31) << "incorrect value for last_msg_.stec_residuals[39].stddev, expected 31, is " << last_msg_.stec_residuals[39].stddev; - EXPECT_EQ(last_msg_.stec_residuals[39].sv_id.constellation, 4) << "incorrect value for last_msg_.stec_residuals[39].sv_id.constellation, expected 4, is " << last_msg_.stec_residuals[39].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[39].sv_id.satId, 157) << "incorrect value for last_msg_.stec_residuals[39].sv_id.satId, expected 157, is " << last_msg_.stec_residuals[39].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[40].residual, -6840) << "incorrect value for last_msg_.stec_residuals[40].residual, expected -6840, is " << last_msg_.stec_residuals[40].residual; - EXPECT_EQ(last_msg_.stec_residuals[40].stddev, 126) << "incorrect value for last_msg_.stec_residuals[40].stddev, expected 126, is " << last_msg_.stec_residuals[40].stddev; - EXPECT_EQ(last_msg_.stec_residuals[40].sv_id.constellation, 132) << "incorrect value for last_msg_.stec_residuals[40].sv_id.constellation, expected 132, is " << last_msg_.stec_residuals[40].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[40].sv_id.satId, 48) << "incorrect value for last_msg_.stec_residuals[40].sv_id.satId, expected 48, is " << last_msg_.stec_residuals[40].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[41].residual, -31412) << "incorrect value for last_msg_.stec_residuals[41].residual, expected -31412, is " << last_msg_.stec_residuals[41].residual; - EXPECT_EQ(last_msg_.stec_residuals[41].stddev, 21) << "incorrect value for last_msg_.stec_residuals[41].stddev, expected 21, is " << last_msg_.stec_residuals[41].stddev; - EXPECT_EQ(last_msg_.stec_residuals[41].sv_id.constellation, 68) << "incorrect value for last_msg_.stec_residuals[41].sv_id.constellation, expected 68, is " << last_msg_.stec_residuals[41].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[41].sv_id.satId, 186) << "incorrect value for last_msg_.stec_residuals[41].sv_id.satId, expected 186, is " << last_msg_.stec_residuals[41].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[42].residual, -23413) << "incorrect value for last_msg_.stec_residuals[42].residual, expected -23413, is " << last_msg_.stec_residuals[42].residual; - EXPECT_EQ(last_msg_.stec_residuals[42].stddev, 148) << "incorrect value for last_msg_.stec_residuals[42].stddev, expected 148, is " << last_msg_.stec_residuals[42].stddev; - EXPECT_EQ(last_msg_.stec_residuals[42].sv_id.constellation, 180) << "incorrect value for last_msg_.stec_residuals[42].sv_id.constellation, expected 180, is " << last_msg_.stec_residuals[42].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[42].sv_id.satId, 0) << "incorrect value for last_msg_.stec_residuals[42].sv_id.satId, expected 0, is " << last_msg_.stec_residuals[42].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[43].residual, 30934) << "incorrect value for last_msg_.stec_residuals[43].residual, expected 30934, is " << last_msg_.stec_residuals[43].residual; - EXPECT_EQ(last_msg_.stec_residuals[43].stddev, 177) << "incorrect value for last_msg_.stec_residuals[43].stddev, expected 177, is " << last_msg_.stec_residuals[43].stddev; - EXPECT_EQ(last_msg_.stec_residuals[43].sv_id.constellation, 149) << "incorrect value for last_msg_.stec_residuals[43].sv_id.constellation, expected 149, is " << last_msg_.stec_residuals[43].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[43].sv_id.satId, 119) << "incorrect value for last_msg_.stec_residuals[43].sv_id.satId, expected 119, is " << last_msg_.stec_residuals[43].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[44].residual, 26960) << "incorrect value for last_msg_.stec_residuals[44].residual, expected 26960, is " << last_msg_.stec_residuals[44].residual; - EXPECT_EQ(last_msg_.stec_residuals[44].stddev, 10) << "incorrect value for last_msg_.stec_residuals[44].stddev, expected 10, is " << last_msg_.stec_residuals[44].stddev; - EXPECT_EQ(last_msg_.stec_residuals[44].sv_id.constellation, 80) << "incorrect value for last_msg_.stec_residuals[44].sv_id.constellation, expected 80, is " << last_msg_.stec_residuals[44].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[44].sv_id.satId, 201) << "incorrect value for last_msg_.stec_residuals[44].sv_id.satId, expected 201, is " << last_msg_.stec_residuals[44].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[45].residual, 11853) << "incorrect value for last_msg_.stec_residuals[45].residual, expected 11853, is " << last_msg_.stec_residuals[45].residual; - EXPECT_EQ(last_msg_.stec_residuals[45].stddev, 233) << "incorrect value for last_msg_.stec_residuals[45].stddev, expected 233, is " << last_msg_.stec_residuals[45].stddev; - EXPECT_EQ(last_msg_.stec_residuals[45].sv_id.constellation, 118) << "incorrect value for last_msg_.stec_residuals[45].sv_id.constellation, expected 118, is " << last_msg_.stec_residuals[45].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[45].sv_id.satId, 136) << "incorrect value for last_msg_.stec_residuals[45].sv_id.satId, expected 136, is " << last_msg_.stec_residuals[45].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[46].residual, -25077) << "incorrect value for last_msg_.stec_residuals[46].residual, expected -25077, is " << last_msg_.stec_residuals[46].residual; - EXPECT_EQ(last_msg_.stec_residuals[46].stddev, 103) << "incorrect value for last_msg_.stec_residuals[46].stddev, expected 103, is " << last_msg_.stec_residuals[46].stddev; - EXPECT_EQ(last_msg_.stec_residuals[46].sv_id.constellation, 227) << "incorrect value for last_msg_.stec_residuals[46].sv_id.constellation, expected 227, is " << last_msg_.stec_residuals[46].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[46].sv_id.satId, 233) << "incorrect value for last_msg_.stec_residuals[46].sv_id.satId, expected 233, is " << last_msg_.stec_residuals[46].sv_id.satId; - EXPECT_EQ(last_msg_.tropo_delay_correction.hydro, 10643) << "incorrect value for last_msg_.tropo_delay_correction.hydro, expected 10643, is " << last_msg_.tropo_delay_correction.hydro; - EXPECT_EQ(last_msg_.tropo_delay_correction.stddev, 92) << "incorrect value for last_msg_.tropo_delay_correction.stddev, expected 92, is " << last_msg_.tropo_delay_correction.stddev; - EXPECT_EQ(last_msg_.tropo_delay_correction.wet, 33) << "incorrect value for last_msg_.tropo_delay_correction.wet, expected 33, is " << last_msg_.tropo_delay_correction.wet; +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 250, 5, 108, 106, 254, 164, 217, 44, 53, 98, 93, 63, 147, 104, + 252, 133, 245, 28, 95, 100, 147, 41, 33, 92, 87, 25, 142, 151, 74, + 151, 95, 94, 7, 146, 237, 45, 167, 86, 42, 116, 224, 169, 234, 220, + 23, 176, 18, 13, 178, 79, 160, 160, 110, 15, 53, 206, 151, 158, 22, + 117, 184, 48, 170, 82, 40, 53, 122, 69, 180, 110, 38, 65, 104, 244, + 19, 238, 227, 88, 169, 164, 146, 63, 37, 183, 85, 71, 235, 168, 114, + 211, 105, 221, 156, 60, 18, 230, 2, 142, 172, 16, 39, 33, 126, 106, + 99, 188, 234, 41, 162, 197, 138, 227, 80, 12, 54, 67, 238, 5, 93, + 1, 207, 129, 13, 46, 115, 49, 58, 185, 127, 156, 200, 96, 217, 202, + 15, 245, 55, 198, 81, 218, 132, 70, 73, 82, 147, 26, 255, 14, 134, + 96, 138, 55, 214, 83, 156, 170, 163, 79, 173, 228, 115, 51, 241, 107, + 245, 112, 168, 210, 10, 5, 117, 1, 57, 108, 248, 212, 145, 119, 226, + 165, 5, 141, 202, 106, 0, 60, 36, 61, 243, 203, 216, 215, 12, 137, + 16, 28, 247, 115, 152, 181, 119, 208, 228, 203, 236, 34, 167, 196, 32, + 109, 1, 17, 101, 200, 25, 94, 125, 168, 137, 157, 4, 164, 29, 31, + 48, 132, 72, 229, 126, 186, 68, 76, 133, 21, 0, 180, 139, 164, 148, + 119, 149, 214, 120, 177, 201, 80, 80, 105, 10, 136, 118, 77, 46, 233, + 233, 227, 11, 158, 103, 167, 216, + }; + + sbp_msg_ssr_gridded_correction_dep_a_t test_msg{}; + test_msg.header.iod_atmo = 245; + test_msg.header.num_msgs = 37695; + test_msg.header.seq_num = 64616; + test_msg.header.time.tow = 892131748; + test_msg.header.time.wn = 23906; + test_msg.header.tropo_quality_indicator = 28; + test_msg.header.update_interval = 133; + test_msg.index = 25695; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_stec_residuals.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)101, (char)99, + (char)95, (char)114, (char)101, (char)115, + (char)105, (char)100, (char)117, (char)97, + (char)108, (char)115}; + memcpy(test_msg.n_stec_residuals.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_stec_residuals.value = 47; + + test_msg.stec_residuals[0].residual = -26738; + test_msg.stec_residuals[0].stddev = 74; + test_msg.stec_residuals[0].sv_id.constellation = 25; + test_msg.stec_residuals[0].sv_id.satId = 87; + + test_msg.stec_residuals[1].residual = 1886; + test_msg.stec_residuals[1].stddev = 146; + test_msg.stec_residuals[1].sv_id.constellation = 95; + test_msg.stec_residuals[1].sv_id.satId = 151; + + test_msg.stec_residuals[2].residual = 22183; + test_msg.stec_residuals[2].stddev = 42; + test_msg.stec_residuals[2].sv_id.constellation = 45; + test_msg.stec_residuals[2].sv_id.satId = 237; + + test_msg.stec_residuals[3].residual = -5463; + test_msg.stec_residuals[3].stddev = 220; + test_msg.stec_residuals[3].sv_id.constellation = 224; + test_msg.stec_residuals[3].sv_id.satId = 116; + + test_msg.stec_residuals[4].residual = 3346; + test_msg.stec_residuals[4].stddev = 178; + test_msg.stec_residuals[4].sv_id.constellation = 176; + test_msg.stec_residuals[4].sv_id.satId = 23; + + test_msg.stec_residuals[5].residual = 28320; + test_msg.stec_residuals[5].stddev = 15; + test_msg.stec_residuals[5].sv_id.constellation = 160; + test_msg.stec_residuals[5].sv_id.satId = 79; + + test_msg.stec_residuals[6].residual = -24937; + test_msg.stec_residuals[6].stddev = 22; + test_msg.stec_residuals[6].sv_id.constellation = 206; + test_msg.stec_residuals[6].sv_id.satId = 53; + + test_msg.stec_residuals[7].residual = -21968; + test_msg.stec_residuals[7].stddev = 82; + test_msg.stec_residuals[7].sv_id.constellation = 184; + test_msg.stec_residuals[7].sv_id.satId = 117; + + test_msg.stec_residuals[8].residual = 17786; + test_msg.stec_residuals[8].stddev = 180; + test_msg.stec_residuals[8].sv_id.constellation = 53; + test_msg.stec_residuals[8].sv_id.satId = 40; + + test_msg.stec_residuals[9].residual = 26689; + test_msg.stec_residuals[9].stddev = 244; + test_msg.stec_residuals[9].sv_id.constellation = 38; + test_msg.stec_residuals[9].sv_id.satId = 110; + + test_msg.stec_residuals[10].residual = 22755; + test_msg.stec_residuals[10].stddev = 169; + test_msg.stec_residuals[10].sv_id.constellation = 238; + test_msg.stec_residuals[10].sv_id.satId = 19; + + test_msg.stec_residuals[11].residual = 9535; + test_msg.stec_residuals[11].stddev = 183; + test_msg.stec_residuals[11].sv_id.constellation = 146; + test_msg.stec_residuals[11].sv_id.satId = 164; + + test_msg.stec_residuals[12].residual = -22293; + test_msg.stec_residuals[12].stddev = 114; + test_msg.stec_residuals[12].sv_id.constellation = 71; + test_msg.stec_residuals[12].sv_id.satId = 85; + + test_msg.stec_residuals[13].residual = -25379; + test_msg.stec_residuals[13].stddev = 60; + test_msg.stec_residuals[13].sv_id.constellation = 105; + test_msg.stec_residuals[13].sv_id.satId = 211; + + test_msg.stec_residuals[14].residual = -29182; + test_msg.stec_residuals[14].stddev = 172; + test_msg.stec_residuals[14].sv_id.constellation = 230; + test_msg.stec_residuals[14].sv_id.satId = 18; + + test_msg.stec_residuals[15].residual = 32289; + test_msg.stec_residuals[15].stddev = 106; + test_msg.stec_residuals[15].sv_id.constellation = 39; + test_msg.stec_residuals[15].sv_id.satId = 16; + + test_msg.stec_residuals[16].residual = 10730; + test_msg.stec_residuals[16].stddev = 162; + test_msg.stec_residuals[16].sv_id.constellation = 188; + test_msg.stec_residuals[16].sv_id.satId = 99; + + test_msg.stec_residuals[17].residual = 20707; + test_msg.stec_residuals[17].stddev = 12; + test_msg.stec_residuals[17].sv_id.constellation = 138; + test_msg.stec_residuals[17].sv_id.satId = 197; + + test_msg.stec_residuals[18].residual = 1518; + test_msg.stec_residuals[18].stddev = 93; + test_msg.stec_residuals[18].sv_id.constellation = 67; + test_msg.stec_residuals[18].sv_id.satId = 54; + + test_msg.stec_residuals[19].residual = 3457; + test_msg.stec_residuals[19].stddev = 46; + test_msg.stec_residuals[19].sv_id.constellation = 207; + test_msg.stec_residuals[19].sv_id.satId = 1; + + test_msg.stec_residuals[20].residual = -18118; + test_msg.stec_residuals[20].stddev = 127; + test_msg.stec_residuals[20].sv_id.constellation = 49; + test_msg.stec_residuals[20].sv_id.satId = 115; + + test_msg.stec_residuals[21].residual = -9888; + test_msg.stec_residuals[21].stddev = 202; + test_msg.stec_residuals[21].sv_id.constellation = 200; + test_msg.stec_residuals[21].sv_id.satId = 156; + + test_msg.stec_residuals[22].residual = -14793; + test_msg.stec_residuals[22].stddev = 81; + test_msg.stec_residuals[22].sv_id.constellation = 245; + test_msg.stec_residuals[22].sv_id.satId = 15; + + test_msg.stec_residuals[23].residual = 18758; + test_msg.stec_residuals[23].stddev = 82; + test_msg.stec_residuals[23].sv_id.constellation = 132; + test_msg.stec_residuals[23].sv_id.satId = 218; + + test_msg.stec_residuals[24].residual = 3839; + test_msg.stec_residuals[24].stddev = 134; + test_msg.stec_residuals[24].sv_id.constellation = 26; + test_msg.stec_residuals[24].sv_id.satId = 147; + + test_msg.stec_residuals[25].residual = -10697; + test_msg.stec_residuals[25].stddev = 83; + test_msg.stec_residuals[25].sv_id.constellation = 138; + test_msg.stec_residuals[25].sv_id.satId = 96; + + test_msg.stec_residuals[26].residual = 20387; + test_msg.stec_residuals[26].stddev = 173; + test_msg.stec_residuals[26].sv_id.constellation = 170; + test_msg.stec_residuals[26].sv_id.satId = 156; + + test_msg.stec_residuals[27].residual = -3789; + test_msg.stec_residuals[27].stddev = 107; + test_msg.stec_residuals[27].sv_id.constellation = 115; + test_msg.stec_residuals[27].sv_id.satId = 228; + + test_msg.stec_residuals[28].residual = -11608; + test_msg.stec_residuals[28].stddev = 10; + test_msg.stec_residuals[28].sv_id.constellation = 112; + test_msg.stec_residuals[28].sv_id.satId = 245; + + test_msg.stec_residuals[29].residual = 14593; + test_msg.stec_residuals[29].stddev = 108; + test_msg.stec_residuals[29].sv_id.constellation = 117; + test_msg.stec_residuals[29].sv_id.satId = 5; + + test_msg.stec_residuals[30].residual = 30609; + test_msg.stec_residuals[30].stddev = 226; + test_msg.stec_residuals[30].sv_id.constellation = 212; + test_msg.stec_residuals[30].sv_id.satId = 248; + + test_msg.stec_residuals[31].residual = -13683; + test_msg.stec_residuals[31].stddev = 106; + test_msg.stec_residuals[31].sv_id.constellation = 5; + test_msg.stec_residuals[31].sv_id.satId = 165; + + test_msg.stec_residuals[32].residual = 15652; + test_msg.stec_residuals[32].stddev = 243; + test_msg.stec_residuals[32].sv_id.constellation = 60; + test_msg.stec_residuals[32].sv_id.satId = 0; + + test_msg.stec_residuals[33].residual = 3287; + test_msg.stec_residuals[33].stddev = 137; + test_msg.stec_residuals[33].sv_id.constellation = 216; + test_msg.stec_residuals[33].sv_id.satId = 203; + + test_msg.stec_residuals[34].residual = 29687; + test_msg.stec_residuals[34].stddev = 152; + test_msg.stec_residuals[34].sv_id.constellation = 28; + test_msg.stec_residuals[34].sv_id.satId = 16; + + test_msg.stec_residuals[35].residual = -6960; + test_msg.stec_residuals[35].stddev = 203; + test_msg.stec_residuals[35].sv_id.constellation = 119; + test_msg.stec_residuals[35].sv_id.satId = 181; + + test_msg.stec_residuals[36].residual = -15193; + test_msg.stec_residuals[36].stddev = 32; + test_msg.stec_residuals[36].sv_id.constellation = 34; + test_msg.stec_residuals[36].sv_id.satId = 236; + + test_msg.stec_residuals[37].residual = 25873; + test_msg.stec_residuals[37].stddev = 200; + test_msg.stec_residuals[37].sv_id.constellation = 1; + test_msg.stec_residuals[37].sv_id.satId = 109; + + test_msg.stec_residuals[38].residual = -22403; + test_msg.stec_residuals[38].stddev = 137; + test_msg.stec_residuals[38].sv_id.constellation = 94; + test_msg.stec_residuals[38].sv_id.satId = 25; + + test_msg.stec_residuals[39].residual = 7588; + test_msg.stec_residuals[39].stddev = 31; + test_msg.stec_residuals[39].sv_id.constellation = 4; + test_msg.stec_residuals[39].sv_id.satId = 157; + + test_msg.stec_residuals[40].residual = -6840; + test_msg.stec_residuals[40].stddev = 126; + test_msg.stec_residuals[40].sv_id.constellation = 132; + test_msg.stec_residuals[40].sv_id.satId = 48; + + test_msg.stec_residuals[41].residual = -31412; + test_msg.stec_residuals[41].stddev = 21; + test_msg.stec_residuals[41].sv_id.constellation = 68; + test_msg.stec_residuals[41].sv_id.satId = 186; + + test_msg.stec_residuals[42].residual = -23413; + test_msg.stec_residuals[42].stddev = 148; + test_msg.stec_residuals[42].sv_id.constellation = 180; + test_msg.stec_residuals[42].sv_id.satId = 0; + + test_msg.stec_residuals[43].residual = 30934; + test_msg.stec_residuals[43].stddev = 177; + test_msg.stec_residuals[43].sv_id.constellation = 149; + test_msg.stec_residuals[43].sv_id.satId = 119; + + test_msg.stec_residuals[44].residual = 26960; + test_msg.stec_residuals[44].stddev = 10; + test_msg.stec_residuals[44].sv_id.constellation = 80; + test_msg.stec_residuals[44].sv_id.satId = 201; + + test_msg.stec_residuals[45].residual = 11853; + test_msg.stec_residuals[45].stddev = 233; + test_msg.stec_residuals[45].sv_id.constellation = 118; + test_msg.stec_residuals[45].sv_id.satId = 136; + + test_msg.stec_residuals[46].residual = -25077; + test_msg.stec_residuals[46].stddev = 103; + test_msg.stec_residuals[46].sv_id.constellation = 227; + test_msg.stec_residuals[46].sv_id.satId = 233; + test_msg.tropo_delay_correction.hydro = 10643; + test_msg.tropo_delay_correction.stddev = 92; + test_msg.tropo_delay_correction.wet = 33; + + EXPECT_EQ(send_message(27244, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 27244); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.iod_atmo, 245) + << "incorrect value for last_msg_.header.iod_atmo, expected 245, is " + << last_msg_.header.iod_atmo; + EXPECT_EQ(last_msg_.header.num_msgs, 37695) + << "incorrect value for last_msg_.header.num_msgs, expected 37695, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.seq_num, 64616) + << "incorrect value for last_msg_.header.seq_num, expected 64616, is " + << last_msg_.header.seq_num; + EXPECT_EQ(last_msg_.header.time.tow, 892131748) + << "incorrect value for last_msg_.header.time.tow, expected 892131748, " + "is " + << last_msg_.header.time.tow; + EXPECT_EQ(last_msg_.header.time.wn, 23906) + << "incorrect value for last_msg_.header.time.wn, expected 23906, is " + << last_msg_.header.time.wn; + EXPECT_EQ(last_msg_.header.tropo_quality_indicator, 28) + << "incorrect value for last_msg_.header.tropo_quality_indicator, " + "expected 28, is " + << last_msg_.header.tropo_quality_indicator; + EXPECT_EQ(last_msg_.header.update_interval, 133) + << "incorrect value for last_msg_.header.update_interval, expected 133, " + "is " + << last_msg_.header.update_interval; + EXPECT_EQ(last_msg_.index, 25695) + << "incorrect value for last_msg_.index, expected 25695, is " + << last_msg_.index; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_stec_residuals.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_stec_residuals.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_stec_residuals.handle_as + << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)101, (char)99, + (char)95, (char)114, (char)101, (char)115, + (char)105, (char)100, (char)117, (char)97, + (char)108, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_stec_residuals.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_stec_residuals.relates_to, " + "expected string '" + << check_string << "', is '" << last_msg_.n_stec_residuals.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_stec_residuals.value, 47) + << "incorrect value for last_msg_.n_stec_residuals.value, expected 47, " + "is " + << last_msg_.n_stec_residuals.value; + EXPECT_EQ(last_msg_.stec_residuals[0].residual, -26738) + << "incorrect value for last_msg_.stec_residuals[0].residual, expected " + "-26738, is " + << last_msg_.stec_residuals[0].residual; + EXPECT_EQ(last_msg_.stec_residuals[0].stddev, 74) + << "incorrect value for last_msg_.stec_residuals[0].stddev, expected 74, " + "is " + << last_msg_.stec_residuals[0].stddev; + EXPECT_EQ(last_msg_.stec_residuals[0].sv_id.constellation, 25) + << "incorrect value for last_msg_.stec_residuals[0].sv_id.constellation, " + "expected 25, is " + << last_msg_.stec_residuals[0].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[0].sv_id.satId, 87) + << "incorrect value for last_msg_.stec_residuals[0].sv_id.satId, " + "expected 87, is " + << last_msg_.stec_residuals[0].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[1].residual, 1886) + << "incorrect value for last_msg_.stec_residuals[1].residual, expected " + "1886, is " + << last_msg_.stec_residuals[1].residual; + EXPECT_EQ(last_msg_.stec_residuals[1].stddev, 146) + << "incorrect value for last_msg_.stec_residuals[1].stddev, expected " + "146, is " + << last_msg_.stec_residuals[1].stddev; + EXPECT_EQ(last_msg_.stec_residuals[1].sv_id.constellation, 95) + << "incorrect value for last_msg_.stec_residuals[1].sv_id.constellation, " + "expected 95, is " + << last_msg_.stec_residuals[1].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[1].sv_id.satId, 151) + << "incorrect value for last_msg_.stec_residuals[1].sv_id.satId, " + "expected 151, is " + << last_msg_.stec_residuals[1].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[2].residual, 22183) + << "incorrect value for last_msg_.stec_residuals[2].residual, expected " + "22183, is " + << last_msg_.stec_residuals[2].residual; + EXPECT_EQ(last_msg_.stec_residuals[2].stddev, 42) + << "incorrect value for last_msg_.stec_residuals[2].stddev, expected 42, " + "is " + << last_msg_.stec_residuals[2].stddev; + EXPECT_EQ(last_msg_.stec_residuals[2].sv_id.constellation, 45) + << "incorrect value for last_msg_.stec_residuals[2].sv_id.constellation, " + "expected 45, is " + << last_msg_.stec_residuals[2].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[2].sv_id.satId, 237) + << "incorrect value for last_msg_.stec_residuals[2].sv_id.satId, " + "expected 237, is " + << last_msg_.stec_residuals[2].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[3].residual, -5463) + << "incorrect value for last_msg_.stec_residuals[3].residual, expected " + "-5463, is " + << last_msg_.stec_residuals[3].residual; + EXPECT_EQ(last_msg_.stec_residuals[3].stddev, 220) + << "incorrect value for last_msg_.stec_residuals[3].stddev, expected " + "220, is " + << last_msg_.stec_residuals[3].stddev; + EXPECT_EQ(last_msg_.stec_residuals[3].sv_id.constellation, 224) + << "incorrect value for last_msg_.stec_residuals[3].sv_id.constellation, " + "expected 224, is " + << last_msg_.stec_residuals[3].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[3].sv_id.satId, 116) + << "incorrect value for last_msg_.stec_residuals[3].sv_id.satId, " + "expected 116, is " + << last_msg_.stec_residuals[3].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[4].residual, 3346) + << "incorrect value for last_msg_.stec_residuals[4].residual, expected " + "3346, is " + << last_msg_.stec_residuals[4].residual; + EXPECT_EQ(last_msg_.stec_residuals[4].stddev, 178) + << "incorrect value for last_msg_.stec_residuals[4].stddev, expected " + "178, is " + << last_msg_.stec_residuals[4].stddev; + EXPECT_EQ(last_msg_.stec_residuals[4].sv_id.constellation, 176) + << "incorrect value for last_msg_.stec_residuals[4].sv_id.constellation, " + "expected 176, is " + << last_msg_.stec_residuals[4].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[4].sv_id.satId, 23) + << "incorrect value for last_msg_.stec_residuals[4].sv_id.satId, " + "expected 23, is " + << last_msg_.stec_residuals[4].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[5].residual, 28320) + << "incorrect value for last_msg_.stec_residuals[5].residual, expected " + "28320, is " + << last_msg_.stec_residuals[5].residual; + EXPECT_EQ(last_msg_.stec_residuals[5].stddev, 15) + << "incorrect value for last_msg_.stec_residuals[5].stddev, expected 15, " + "is " + << last_msg_.stec_residuals[5].stddev; + EXPECT_EQ(last_msg_.stec_residuals[5].sv_id.constellation, 160) + << "incorrect value for last_msg_.stec_residuals[5].sv_id.constellation, " + "expected 160, is " + << last_msg_.stec_residuals[5].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[5].sv_id.satId, 79) + << "incorrect value for last_msg_.stec_residuals[5].sv_id.satId, " + "expected 79, is " + << last_msg_.stec_residuals[5].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[6].residual, -24937) + << "incorrect value for last_msg_.stec_residuals[6].residual, expected " + "-24937, is " + << last_msg_.stec_residuals[6].residual; + EXPECT_EQ(last_msg_.stec_residuals[6].stddev, 22) + << "incorrect value for last_msg_.stec_residuals[6].stddev, expected 22, " + "is " + << last_msg_.stec_residuals[6].stddev; + EXPECT_EQ(last_msg_.stec_residuals[6].sv_id.constellation, 206) + << "incorrect value for last_msg_.stec_residuals[6].sv_id.constellation, " + "expected 206, is " + << last_msg_.stec_residuals[6].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[6].sv_id.satId, 53) + << "incorrect value for last_msg_.stec_residuals[6].sv_id.satId, " + "expected 53, is " + << last_msg_.stec_residuals[6].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[7].residual, -21968) + << "incorrect value for last_msg_.stec_residuals[7].residual, expected " + "-21968, is " + << last_msg_.stec_residuals[7].residual; + EXPECT_EQ(last_msg_.stec_residuals[7].stddev, 82) + << "incorrect value for last_msg_.stec_residuals[7].stddev, expected 82, " + "is " + << last_msg_.stec_residuals[7].stddev; + EXPECT_EQ(last_msg_.stec_residuals[7].sv_id.constellation, 184) + << "incorrect value for last_msg_.stec_residuals[7].sv_id.constellation, " + "expected 184, is " + << last_msg_.stec_residuals[7].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[7].sv_id.satId, 117) + << "incorrect value for last_msg_.stec_residuals[7].sv_id.satId, " + "expected 117, is " + << last_msg_.stec_residuals[7].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[8].residual, 17786) + << "incorrect value for last_msg_.stec_residuals[8].residual, expected " + "17786, is " + << last_msg_.stec_residuals[8].residual; + EXPECT_EQ(last_msg_.stec_residuals[8].stddev, 180) + << "incorrect value for last_msg_.stec_residuals[8].stddev, expected " + "180, is " + << last_msg_.stec_residuals[8].stddev; + EXPECT_EQ(last_msg_.stec_residuals[8].sv_id.constellation, 53) + << "incorrect value for last_msg_.stec_residuals[8].sv_id.constellation, " + "expected 53, is " + << last_msg_.stec_residuals[8].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[8].sv_id.satId, 40) + << "incorrect value for last_msg_.stec_residuals[8].sv_id.satId, " + "expected 40, is " + << last_msg_.stec_residuals[8].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[9].residual, 26689) + << "incorrect value for last_msg_.stec_residuals[9].residual, expected " + "26689, is " + << last_msg_.stec_residuals[9].residual; + EXPECT_EQ(last_msg_.stec_residuals[9].stddev, 244) + << "incorrect value for last_msg_.stec_residuals[9].stddev, expected " + "244, is " + << last_msg_.stec_residuals[9].stddev; + EXPECT_EQ(last_msg_.stec_residuals[9].sv_id.constellation, 38) + << "incorrect value for last_msg_.stec_residuals[9].sv_id.constellation, " + "expected 38, is " + << last_msg_.stec_residuals[9].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[9].sv_id.satId, 110) + << "incorrect value for last_msg_.stec_residuals[9].sv_id.satId, " + "expected 110, is " + << last_msg_.stec_residuals[9].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[10].residual, 22755) + << "incorrect value for last_msg_.stec_residuals[10].residual, expected " + "22755, is " + << last_msg_.stec_residuals[10].residual; + EXPECT_EQ(last_msg_.stec_residuals[10].stddev, 169) + << "incorrect value for last_msg_.stec_residuals[10].stddev, expected " + "169, is " + << last_msg_.stec_residuals[10].stddev; + EXPECT_EQ(last_msg_.stec_residuals[10].sv_id.constellation, 238) + << "incorrect value for " + "last_msg_.stec_residuals[10].sv_id.constellation, expected 238, is " + << last_msg_.stec_residuals[10].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[10].sv_id.satId, 19) + << "incorrect value for last_msg_.stec_residuals[10].sv_id.satId, " + "expected 19, is " + << last_msg_.stec_residuals[10].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[11].residual, 9535) + << "incorrect value for last_msg_.stec_residuals[11].residual, expected " + "9535, is " + << last_msg_.stec_residuals[11].residual; + EXPECT_EQ(last_msg_.stec_residuals[11].stddev, 183) + << "incorrect value for last_msg_.stec_residuals[11].stddev, expected " + "183, is " + << last_msg_.stec_residuals[11].stddev; + EXPECT_EQ(last_msg_.stec_residuals[11].sv_id.constellation, 146) + << "incorrect value for " + "last_msg_.stec_residuals[11].sv_id.constellation, expected 146, is " + << last_msg_.stec_residuals[11].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[11].sv_id.satId, 164) + << "incorrect value for last_msg_.stec_residuals[11].sv_id.satId, " + "expected 164, is " + << last_msg_.stec_residuals[11].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[12].residual, -22293) + << "incorrect value for last_msg_.stec_residuals[12].residual, expected " + "-22293, is " + << last_msg_.stec_residuals[12].residual; + EXPECT_EQ(last_msg_.stec_residuals[12].stddev, 114) + << "incorrect value for last_msg_.stec_residuals[12].stddev, expected " + "114, is " + << last_msg_.stec_residuals[12].stddev; + EXPECT_EQ(last_msg_.stec_residuals[12].sv_id.constellation, 71) + << "incorrect value for " + "last_msg_.stec_residuals[12].sv_id.constellation, expected 71, is " + << last_msg_.stec_residuals[12].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[12].sv_id.satId, 85) + << "incorrect value for last_msg_.stec_residuals[12].sv_id.satId, " + "expected 85, is " + << last_msg_.stec_residuals[12].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[13].residual, -25379) + << "incorrect value for last_msg_.stec_residuals[13].residual, expected " + "-25379, is " + << last_msg_.stec_residuals[13].residual; + EXPECT_EQ(last_msg_.stec_residuals[13].stddev, 60) + << "incorrect value for last_msg_.stec_residuals[13].stddev, expected " + "60, is " + << last_msg_.stec_residuals[13].stddev; + EXPECT_EQ(last_msg_.stec_residuals[13].sv_id.constellation, 105) + << "incorrect value for " + "last_msg_.stec_residuals[13].sv_id.constellation, expected 105, is " + << last_msg_.stec_residuals[13].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[13].sv_id.satId, 211) + << "incorrect value for last_msg_.stec_residuals[13].sv_id.satId, " + "expected 211, is " + << last_msg_.stec_residuals[13].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[14].residual, -29182) + << "incorrect value for last_msg_.stec_residuals[14].residual, expected " + "-29182, is " + << last_msg_.stec_residuals[14].residual; + EXPECT_EQ(last_msg_.stec_residuals[14].stddev, 172) + << "incorrect value for last_msg_.stec_residuals[14].stddev, expected " + "172, is " + << last_msg_.stec_residuals[14].stddev; + EXPECT_EQ(last_msg_.stec_residuals[14].sv_id.constellation, 230) + << "incorrect value for " + "last_msg_.stec_residuals[14].sv_id.constellation, expected 230, is " + << last_msg_.stec_residuals[14].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[14].sv_id.satId, 18) + << "incorrect value for last_msg_.stec_residuals[14].sv_id.satId, " + "expected 18, is " + << last_msg_.stec_residuals[14].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[15].residual, 32289) + << "incorrect value for last_msg_.stec_residuals[15].residual, expected " + "32289, is " + << last_msg_.stec_residuals[15].residual; + EXPECT_EQ(last_msg_.stec_residuals[15].stddev, 106) + << "incorrect value for last_msg_.stec_residuals[15].stddev, expected " + "106, is " + << last_msg_.stec_residuals[15].stddev; + EXPECT_EQ(last_msg_.stec_residuals[15].sv_id.constellation, 39) + << "incorrect value for " + "last_msg_.stec_residuals[15].sv_id.constellation, expected 39, is " + << last_msg_.stec_residuals[15].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[15].sv_id.satId, 16) + << "incorrect value for last_msg_.stec_residuals[15].sv_id.satId, " + "expected 16, is " + << last_msg_.stec_residuals[15].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[16].residual, 10730) + << "incorrect value for last_msg_.stec_residuals[16].residual, expected " + "10730, is " + << last_msg_.stec_residuals[16].residual; + EXPECT_EQ(last_msg_.stec_residuals[16].stddev, 162) + << "incorrect value for last_msg_.stec_residuals[16].stddev, expected " + "162, is " + << last_msg_.stec_residuals[16].stddev; + EXPECT_EQ(last_msg_.stec_residuals[16].sv_id.constellation, 188) + << "incorrect value for " + "last_msg_.stec_residuals[16].sv_id.constellation, expected 188, is " + << last_msg_.stec_residuals[16].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[16].sv_id.satId, 99) + << "incorrect value for last_msg_.stec_residuals[16].sv_id.satId, " + "expected 99, is " + << last_msg_.stec_residuals[16].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[17].residual, 20707) + << "incorrect value for last_msg_.stec_residuals[17].residual, expected " + "20707, is " + << last_msg_.stec_residuals[17].residual; + EXPECT_EQ(last_msg_.stec_residuals[17].stddev, 12) + << "incorrect value for last_msg_.stec_residuals[17].stddev, expected " + "12, is " + << last_msg_.stec_residuals[17].stddev; + EXPECT_EQ(last_msg_.stec_residuals[17].sv_id.constellation, 138) + << "incorrect value for " + "last_msg_.stec_residuals[17].sv_id.constellation, expected 138, is " + << last_msg_.stec_residuals[17].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[17].sv_id.satId, 197) + << "incorrect value for last_msg_.stec_residuals[17].sv_id.satId, " + "expected 197, is " + << last_msg_.stec_residuals[17].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[18].residual, 1518) + << "incorrect value for last_msg_.stec_residuals[18].residual, expected " + "1518, is " + << last_msg_.stec_residuals[18].residual; + EXPECT_EQ(last_msg_.stec_residuals[18].stddev, 93) + << "incorrect value for last_msg_.stec_residuals[18].stddev, expected " + "93, is " + << last_msg_.stec_residuals[18].stddev; + EXPECT_EQ(last_msg_.stec_residuals[18].sv_id.constellation, 67) + << "incorrect value for " + "last_msg_.stec_residuals[18].sv_id.constellation, expected 67, is " + << last_msg_.stec_residuals[18].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[18].sv_id.satId, 54) + << "incorrect value for last_msg_.stec_residuals[18].sv_id.satId, " + "expected 54, is " + << last_msg_.stec_residuals[18].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[19].residual, 3457) + << "incorrect value for last_msg_.stec_residuals[19].residual, expected " + "3457, is " + << last_msg_.stec_residuals[19].residual; + EXPECT_EQ(last_msg_.stec_residuals[19].stddev, 46) + << "incorrect value for last_msg_.stec_residuals[19].stddev, expected " + "46, is " + << last_msg_.stec_residuals[19].stddev; + EXPECT_EQ(last_msg_.stec_residuals[19].sv_id.constellation, 207) + << "incorrect value for " + "last_msg_.stec_residuals[19].sv_id.constellation, expected 207, is " + << last_msg_.stec_residuals[19].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[19].sv_id.satId, 1) + << "incorrect value for last_msg_.stec_residuals[19].sv_id.satId, " + "expected 1, is " + << last_msg_.stec_residuals[19].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[20].residual, -18118) + << "incorrect value for last_msg_.stec_residuals[20].residual, expected " + "-18118, is " + << last_msg_.stec_residuals[20].residual; + EXPECT_EQ(last_msg_.stec_residuals[20].stddev, 127) + << "incorrect value for last_msg_.stec_residuals[20].stddev, expected " + "127, is " + << last_msg_.stec_residuals[20].stddev; + EXPECT_EQ(last_msg_.stec_residuals[20].sv_id.constellation, 49) + << "incorrect value for " + "last_msg_.stec_residuals[20].sv_id.constellation, expected 49, is " + << last_msg_.stec_residuals[20].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[20].sv_id.satId, 115) + << "incorrect value for last_msg_.stec_residuals[20].sv_id.satId, " + "expected 115, is " + << last_msg_.stec_residuals[20].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[21].residual, -9888) + << "incorrect value for last_msg_.stec_residuals[21].residual, expected " + "-9888, is " + << last_msg_.stec_residuals[21].residual; + EXPECT_EQ(last_msg_.stec_residuals[21].stddev, 202) + << "incorrect value for last_msg_.stec_residuals[21].stddev, expected " + "202, is " + << last_msg_.stec_residuals[21].stddev; + EXPECT_EQ(last_msg_.stec_residuals[21].sv_id.constellation, 200) + << "incorrect value for " + "last_msg_.stec_residuals[21].sv_id.constellation, expected 200, is " + << last_msg_.stec_residuals[21].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[21].sv_id.satId, 156) + << "incorrect value for last_msg_.stec_residuals[21].sv_id.satId, " + "expected 156, is " + << last_msg_.stec_residuals[21].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[22].residual, -14793) + << "incorrect value for last_msg_.stec_residuals[22].residual, expected " + "-14793, is " + << last_msg_.stec_residuals[22].residual; + EXPECT_EQ(last_msg_.stec_residuals[22].stddev, 81) + << "incorrect value for last_msg_.stec_residuals[22].stddev, expected " + "81, is " + << last_msg_.stec_residuals[22].stddev; + EXPECT_EQ(last_msg_.stec_residuals[22].sv_id.constellation, 245) + << "incorrect value for " + "last_msg_.stec_residuals[22].sv_id.constellation, expected 245, is " + << last_msg_.stec_residuals[22].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[22].sv_id.satId, 15) + << "incorrect value for last_msg_.stec_residuals[22].sv_id.satId, " + "expected 15, is " + << last_msg_.stec_residuals[22].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[23].residual, 18758) + << "incorrect value for last_msg_.stec_residuals[23].residual, expected " + "18758, is " + << last_msg_.stec_residuals[23].residual; + EXPECT_EQ(last_msg_.stec_residuals[23].stddev, 82) + << "incorrect value for last_msg_.stec_residuals[23].stddev, expected " + "82, is " + << last_msg_.stec_residuals[23].stddev; + EXPECT_EQ(last_msg_.stec_residuals[23].sv_id.constellation, 132) + << "incorrect value for " + "last_msg_.stec_residuals[23].sv_id.constellation, expected 132, is " + << last_msg_.stec_residuals[23].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[23].sv_id.satId, 218) + << "incorrect value for last_msg_.stec_residuals[23].sv_id.satId, " + "expected 218, is " + << last_msg_.stec_residuals[23].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[24].residual, 3839) + << "incorrect value for last_msg_.stec_residuals[24].residual, expected " + "3839, is " + << last_msg_.stec_residuals[24].residual; + EXPECT_EQ(last_msg_.stec_residuals[24].stddev, 134) + << "incorrect value for last_msg_.stec_residuals[24].stddev, expected " + "134, is " + << last_msg_.stec_residuals[24].stddev; + EXPECT_EQ(last_msg_.stec_residuals[24].sv_id.constellation, 26) + << "incorrect value for " + "last_msg_.stec_residuals[24].sv_id.constellation, expected 26, is " + << last_msg_.stec_residuals[24].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[24].sv_id.satId, 147) + << "incorrect value for last_msg_.stec_residuals[24].sv_id.satId, " + "expected 147, is " + << last_msg_.stec_residuals[24].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[25].residual, -10697) + << "incorrect value for last_msg_.stec_residuals[25].residual, expected " + "-10697, is " + << last_msg_.stec_residuals[25].residual; + EXPECT_EQ(last_msg_.stec_residuals[25].stddev, 83) + << "incorrect value for last_msg_.stec_residuals[25].stddev, expected " + "83, is " + << last_msg_.stec_residuals[25].stddev; + EXPECT_EQ(last_msg_.stec_residuals[25].sv_id.constellation, 138) + << "incorrect value for " + "last_msg_.stec_residuals[25].sv_id.constellation, expected 138, is " + << last_msg_.stec_residuals[25].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[25].sv_id.satId, 96) + << "incorrect value for last_msg_.stec_residuals[25].sv_id.satId, " + "expected 96, is " + << last_msg_.stec_residuals[25].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[26].residual, 20387) + << "incorrect value for last_msg_.stec_residuals[26].residual, expected " + "20387, is " + << last_msg_.stec_residuals[26].residual; + EXPECT_EQ(last_msg_.stec_residuals[26].stddev, 173) + << "incorrect value for last_msg_.stec_residuals[26].stddev, expected " + "173, is " + << last_msg_.stec_residuals[26].stddev; + EXPECT_EQ(last_msg_.stec_residuals[26].sv_id.constellation, 170) + << "incorrect value for " + "last_msg_.stec_residuals[26].sv_id.constellation, expected 170, is " + << last_msg_.stec_residuals[26].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[26].sv_id.satId, 156) + << "incorrect value for last_msg_.stec_residuals[26].sv_id.satId, " + "expected 156, is " + << last_msg_.stec_residuals[26].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[27].residual, -3789) + << "incorrect value for last_msg_.stec_residuals[27].residual, expected " + "-3789, is " + << last_msg_.stec_residuals[27].residual; + EXPECT_EQ(last_msg_.stec_residuals[27].stddev, 107) + << "incorrect value for last_msg_.stec_residuals[27].stddev, expected " + "107, is " + << last_msg_.stec_residuals[27].stddev; + EXPECT_EQ(last_msg_.stec_residuals[27].sv_id.constellation, 115) + << "incorrect value for " + "last_msg_.stec_residuals[27].sv_id.constellation, expected 115, is " + << last_msg_.stec_residuals[27].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[27].sv_id.satId, 228) + << "incorrect value for last_msg_.stec_residuals[27].sv_id.satId, " + "expected 228, is " + << last_msg_.stec_residuals[27].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[28].residual, -11608) + << "incorrect value for last_msg_.stec_residuals[28].residual, expected " + "-11608, is " + << last_msg_.stec_residuals[28].residual; + EXPECT_EQ(last_msg_.stec_residuals[28].stddev, 10) + << "incorrect value for last_msg_.stec_residuals[28].stddev, expected " + "10, is " + << last_msg_.stec_residuals[28].stddev; + EXPECT_EQ(last_msg_.stec_residuals[28].sv_id.constellation, 112) + << "incorrect value for " + "last_msg_.stec_residuals[28].sv_id.constellation, expected 112, is " + << last_msg_.stec_residuals[28].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[28].sv_id.satId, 245) + << "incorrect value for last_msg_.stec_residuals[28].sv_id.satId, " + "expected 245, is " + << last_msg_.stec_residuals[28].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[29].residual, 14593) + << "incorrect value for last_msg_.stec_residuals[29].residual, expected " + "14593, is " + << last_msg_.stec_residuals[29].residual; + EXPECT_EQ(last_msg_.stec_residuals[29].stddev, 108) + << "incorrect value for last_msg_.stec_residuals[29].stddev, expected " + "108, is " + << last_msg_.stec_residuals[29].stddev; + EXPECT_EQ(last_msg_.stec_residuals[29].sv_id.constellation, 117) + << "incorrect value for " + "last_msg_.stec_residuals[29].sv_id.constellation, expected 117, is " + << last_msg_.stec_residuals[29].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[29].sv_id.satId, 5) + << "incorrect value for last_msg_.stec_residuals[29].sv_id.satId, " + "expected 5, is " + << last_msg_.stec_residuals[29].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[30].residual, 30609) + << "incorrect value for last_msg_.stec_residuals[30].residual, expected " + "30609, is " + << last_msg_.stec_residuals[30].residual; + EXPECT_EQ(last_msg_.stec_residuals[30].stddev, 226) + << "incorrect value for last_msg_.stec_residuals[30].stddev, expected " + "226, is " + << last_msg_.stec_residuals[30].stddev; + EXPECT_EQ(last_msg_.stec_residuals[30].sv_id.constellation, 212) + << "incorrect value for " + "last_msg_.stec_residuals[30].sv_id.constellation, expected 212, is " + << last_msg_.stec_residuals[30].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[30].sv_id.satId, 248) + << "incorrect value for last_msg_.stec_residuals[30].sv_id.satId, " + "expected 248, is " + << last_msg_.stec_residuals[30].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[31].residual, -13683) + << "incorrect value for last_msg_.stec_residuals[31].residual, expected " + "-13683, is " + << last_msg_.stec_residuals[31].residual; + EXPECT_EQ(last_msg_.stec_residuals[31].stddev, 106) + << "incorrect value for last_msg_.stec_residuals[31].stddev, expected " + "106, is " + << last_msg_.stec_residuals[31].stddev; + EXPECT_EQ(last_msg_.stec_residuals[31].sv_id.constellation, 5) + << "incorrect value for " + "last_msg_.stec_residuals[31].sv_id.constellation, expected 5, is " + << last_msg_.stec_residuals[31].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[31].sv_id.satId, 165) + << "incorrect value for last_msg_.stec_residuals[31].sv_id.satId, " + "expected 165, is " + << last_msg_.stec_residuals[31].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[32].residual, 15652) + << "incorrect value for last_msg_.stec_residuals[32].residual, expected " + "15652, is " + << last_msg_.stec_residuals[32].residual; + EXPECT_EQ(last_msg_.stec_residuals[32].stddev, 243) + << "incorrect value for last_msg_.stec_residuals[32].stddev, expected " + "243, is " + << last_msg_.stec_residuals[32].stddev; + EXPECT_EQ(last_msg_.stec_residuals[32].sv_id.constellation, 60) + << "incorrect value for " + "last_msg_.stec_residuals[32].sv_id.constellation, expected 60, is " + << last_msg_.stec_residuals[32].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[32].sv_id.satId, 0) + << "incorrect value for last_msg_.stec_residuals[32].sv_id.satId, " + "expected 0, is " + << last_msg_.stec_residuals[32].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[33].residual, 3287) + << "incorrect value for last_msg_.stec_residuals[33].residual, expected " + "3287, is " + << last_msg_.stec_residuals[33].residual; + EXPECT_EQ(last_msg_.stec_residuals[33].stddev, 137) + << "incorrect value for last_msg_.stec_residuals[33].stddev, expected " + "137, is " + << last_msg_.stec_residuals[33].stddev; + EXPECT_EQ(last_msg_.stec_residuals[33].sv_id.constellation, 216) + << "incorrect value for " + "last_msg_.stec_residuals[33].sv_id.constellation, expected 216, is " + << last_msg_.stec_residuals[33].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[33].sv_id.satId, 203) + << "incorrect value for last_msg_.stec_residuals[33].sv_id.satId, " + "expected 203, is " + << last_msg_.stec_residuals[33].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[34].residual, 29687) + << "incorrect value for last_msg_.stec_residuals[34].residual, expected " + "29687, is " + << last_msg_.stec_residuals[34].residual; + EXPECT_EQ(last_msg_.stec_residuals[34].stddev, 152) + << "incorrect value for last_msg_.stec_residuals[34].stddev, expected " + "152, is " + << last_msg_.stec_residuals[34].stddev; + EXPECT_EQ(last_msg_.stec_residuals[34].sv_id.constellation, 28) + << "incorrect value for " + "last_msg_.stec_residuals[34].sv_id.constellation, expected 28, is " + << last_msg_.stec_residuals[34].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[34].sv_id.satId, 16) + << "incorrect value for last_msg_.stec_residuals[34].sv_id.satId, " + "expected 16, is " + << last_msg_.stec_residuals[34].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[35].residual, -6960) + << "incorrect value for last_msg_.stec_residuals[35].residual, expected " + "-6960, is " + << last_msg_.stec_residuals[35].residual; + EXPECT_EQ(last_msg_.stec_residuals[35].stddev, 203) + << "incorrect value for last_msg_.stec_residuals[35].stddev, expected " + "203, is " + << last_msg_.stec_residuals[35].stddev; + EXPECT_EQ(last_msg_.stec_residuals[35].sv_id.constellation, 119) + << "incorrect value for " + "last_msg_.stec_residuals[35].sv_id.constellation, expected 119, is " + << last_msg_.stec_residuals[35].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[35].sv_id.satId, 181) + << "incorrect value for last_msg_.stec_residuals[35].sv_id.satId, " + "expected 181, is " + << last_msg_.stec_residuals[35].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[36].residual, -15193) + << "incorrect value for last_msg_.stec_residuals[36].residual, expected " + "-15193, is " + << last_msg_.stec_residuals[36].residual; + EXPECT_EQ(last_msg_.stec_residuals[36].stddev, 32) + << "incorrect value for last_msg_.stec_residuals[36].stddev, expected " + "32, is " + << last_msg_.stec_residuals[36].stddev; + EXPECT_EQ(last_msg_.stec_residuals[36].sv_id.constellation, 34) + << "incorrect value for " + "last_msg_.stec_residuals[36].sv_id.constellation, expected 34, is " + << last_msg_.stec_residuals[36].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[36].sv_id.satId, 236) + << "incorrect value for last_msg_.stec_residuals[36].sv_id.satId, " + "expected 236, is " + << last_msg_.stec_residuals[36].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[37].residual, 25873) + << "incorrect value for last_msg_.stec_residuals[37].residual, expected " + "25873, is " + << last_msg_.stec_residuals[37].residual; + EXPECT_EQ(last_msg_.stec_residuals[37].stddev, 200) + << "incorrect value for last_msg_.stec_residuals[37].stddev, expected " + "200, is " + << last_msg_.stec_residuals[37].stddev; + EXPECT_EQ(last_msg_.stec_residuals[37].sv_id.constellation, 1) + << "incorrect value for " + "last_msg_.stec_residuals[37].sv_id.constellation, expected 1, is " + << last_msg_.stec_residuals[37].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[37].sv_id.satId, 109) + << "incorrect value for last_msg_.stec_residuals[37].sv_id.satId, " + "expected 109, is " + << last_msg_.stec_residuals[37].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[38].residual, -22403) + << "incorrect value for last_msg_.stec_residuals[38].residual, expected " + "-22403, is " + << last_msg_.stec_residuals[38].residual; + EXPECT_EQ(last_msg_.stec_residuals[38].stddev, 137) + << "incorrect value for last_msg_.stec_residuals[38].stddev, expected " + "137, is " + << last_msg_.stec_residuals[38].stddev; + EXPECT_EQ(last_msg_.stec_residuals[38].sv_id.constellation, 94) + << "incorrect value for " + "last_msg_.stec_residuals[38].sv_id.constellation, expected 94, is " + << last_msg_.stec_residuals[38].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[38].sv_id.satId, 25) + << "incorrect value for last_msg_.stec_residuals[38].sv_id.satId, " + "expected 25, is " + << last_msg_.stec_residuals[38].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[39].residual, 7588) + << "incorrect value for last_msg_.stec_residuals[39].residual, expected " + "7588, is " + << last_msg_.stec_residuals[39].residual; + EXPECT_EQ(last_msg_.stec_residuals[39].stddev, 31) + << "incorrect value for last_msg_.stec_residuals[39].stddev, expected " + "31, is " + << last_msg_.stec_residuals[39].stddev; + EXPECT_EQ(last_msg_.stec_residuals[39].sv_id.constellation, 4) + << "incorrect value for " + "last_msg_.stec_residuals[39].sv_id.constellation, expected 4, is " + << last_msg_.stec_residuals[39].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[39].sv_id.satId, 157) + << "incorrect value for last_msg_.stec_residuals[39].sv_id.satId, " + "expected 157, is " + << last_msg_.stec_residuals[39].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[40].residual, -6840) + << "incorrect value for last_msg_.stec_residuals[40].residual, expected " + "-6840, is " + << last_msg_.stec_residuals[40].residual; + EXPECT_EQ(last_msg_.stec_residuals[40].stddev, 126) + << "incorrect value for last_msg_.stec_residuals[40].stddev, expected " + "126, is " + << last_msg_.stec_residuals[40].stddev; + EXPECT_EQ(last_msg_.stec_residuals[40].sv_id.constellation, 132) + << "incorrect value for " + "last_msg_.stec_residuals[40].sv_id.constellation, expected 132, is " + << last_msg_.stec_residuals[40].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[40].sv_id.satId, 48) + << "incorrect value for last_msg_.stec_residuals[40].sv_id.satId, " + "expected 48, is " + << last_msg_.stec_residuals[40].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[41].residual, -31412) + << "incorrect value for last_msg_.stec_residuals[41].residual, expected " + "-31412, is " + << last_msg_.stec_residuals[41].residual; + EXPECT_EQ(last_msg_.stec_residuals[41].stddev, 21) + << "incorrect value for last_msg_.stec_residuals[41].stddev, expected " + "21, is " + << last_msg_.stec_residuals[41].stddev; + EXPECT_EQ(last_msg_.stec_residuals[41].sv_id.constellation, 68) + << "incorrect value for " + "last_msg_.stec_residuals[41].sv_id.constellation, expected 68, is " + << last_msg_.stec_residuals[41].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[41].sv_id.satId, 186) + << "incorrect value for last_msg_.stec_residuals[41].sv_id.satId, " + "expected 186, is " + << last_msg_.stec_residuals[41].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[42].residual, -23413) + << "incorrect value for last_msg_.stec_residuals[42].residual, expected " + "-23413, is " + << last_msg_.stec_residuals[42].residual; + EXPECT_EQ(last_msg_.stec_residuals[42].stddev, 148) + << "incorrect value for last_msg_.stec_residuals[42].stddev, expected " + "148, is " + << last_msg_.stec_residuals[42].stddev; + EXPECT_EQ(last_msg_.stec_residuals[42].sv_id.constellation, 180) + << "incorrect value for " + "last_msg_.stec_residuals[42].sv_id.constellation, expected 180, is " + << last_msg_.stec_residuals[42].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[42].sv_id.satId, 0) + << "incorrect value for last_msg_.stec_residuals[42].sv_id.satId, " + "expected 0, is " + << last_msg_.stec_residuals[42].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[43].residual, 30934) + << "incorrect value for last_msg_.stec_residuals[43].residual, expected " + "30934, is " + << last_msg_.stec_residuals[43].residual; + EXPECT_EQ(last_msg_.stec_residuals[43].stddev, 177) + << "incorrect value for last_msg_.stec_residuals[43].stddev, expected " + "177, is " + << last_msg_.stec_residuals[43].stddev; + EXPECT_EQ(last_msg_.stec_residuals[43].sv_id.constellation, 149) + << "incorrect value for " + "last_msg_.stec_residuals[43].sv_id.constellation, expected 149, is " + << last_msg_.stec_residuals[43].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[43].sv_id.satId, 119) + << "incorrect value for last_msg_.stec_residuals[43].sv_id.satId, " + "expected 119, is " + << last_msg_.stec_residuals[43].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[44].residual, 26960) + << "incorrect value for last_msg_.stec_residuals[44].residual, expected " + "26960, is " + << last_msg_.stec_residuals[44].residual; + EXPECT_EQ(last_msg_.stec_residuals[44].stddev, 10) + << "incorrect value for last_msg_.stec_residuals[44].stddev, expected " + "10, is " + << last_msg_.stec_residuals[44].stddev; + EXPECT_EQ(last_msg_.stec_residuals[44].sv_id.constellation, 80) + << "incorrect value for " + "last_msg_.stec_residuals[44].sv_id.constellation, expected 80, is " + << last_msg_.stec_residuals[44].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[44].sv_id.satId, 201) + << "incorrect value for last_msg_.stec_residuals[44].sv_id.satId, " + "expected 201, is " + << last_msg_.stec_residuals[44].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[45].residual, 11853) + << "incorrect value for last_msg_.stec_residuals[45].residual, expected " + "11853, is " + << last_msg_.stec_residuals[45].residual; + EXPECT_EQ(last_msg_.stec_residuals[45].stddev, 233) + << "incorrect value for last_msg_.stec_residuals[45].stddev, expected " + "233, is " + << last_msg_.stec_residuals[45].stddev; + EXPECT_EQ(last_msg_.stec_residuals[45].sv_id.constellation, 118) + << "incorrect value for " + "last_msg_.stec_residuals[45].sv_id.constellation, expected 118, is " + << last_msg_.stec_residuals[45].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[45].sv_id.satId, 136) + << "incorrect value for last_msg_.stec_residuals[45].sv_id.satId, " + "expected 136, is " + << last_msg_.stec_residuals[45].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[46].residual, -25077) + << "incorrect value for last_msg_.stec_residuals[46].residual, expected " + "-25077, is " + << last_msg_.stec_residuals[46].residual; + EXPECT_EQ(last_msg_.stec_residuals[46].stddev, 103) + << "incorrect value for last_msg_.stec_residuals[46].stddev, expected " + "103, is " + << last_msg_.stec_residuals[46].stddev; + EXPECT_EQ(last_msg_.stec_residuals[46].sv_id.constellation, 227) + << "incorrect value for " + "last_msg_.stec_residuals[46].sv_id.constellation, expected 227, is " + << last_msg_.stec_residuals[46].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[46].sv_id.satId, 233) + << "incorrect value for last_msg_.stec_residuals[46].sv_id.satId, " + "expected 233, is " + << last_msg_.stec_residuals[46].sv_id.satId; + EXPECT_EQ(last_msg_.tropo_delay_correction.hydro, 10643) + << "incorrect value for last_msg_.tropo_delay_correction.hydro, expected " + "10643, is " + << last_msg_.tropo_delay_correction.hydro; + EXPECT_EQ(last_msg_.tropo_delay_correction.stddev, 92) + << "incorrect value for last_msg_.tropo_delay_correction.stddev, " + "expected 92, is " + << last_msg_.tropo_delay_correction.stddev; + EXPECT_EQ(last_msg_.tropo_delay_correction.wet, 33) + << "incorrect value for last_msg_.tropo_delay_correction.wet, expected " + "33, is " + << last_msg_.tropo_delay_correction.wet; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.cc index f6b3c0d61..bd4e44758 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.cc @@ -10,60 +10,58 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionNoStdDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionNoStdDepA.yaml +// by generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler( + this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_ssr_gridded_correction_no_std_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,481 +69,1081 @@ class Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA0 : sbp_msg_ssr_gridded_correction_no_std_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,240,5,102,28,254,179,240,33,169,236,34,117,245,67,248,233,236,230,230,103,122,63,101,231,157,115,162,197,146,35,107,222,109,52,41,86,12,237,184,65,204,137,148,171,183,11,0,180,203,172,53,196,85,186,115,203,92,166,30,42,13,200,71,98,137,219,160,95,216,95,250,99,196,92,214,159,253,195,222,233,146,233,63,76,24,106,40,253,65,9,183,40,215,188,59,117,69,97,115,60,56,0,141,207,171,54,161,23,61,0,87,230,123,87,36,184,255,14,163,187,224,43,151,151,104,39,57,5,54,48,224,181,129,60,92,171,114,109,109,12,23,118,8,64,159,54,216,33,20,24,68,160,36,38,222,145,190,92,99,108,159,232,240,227,221,253,15,62,23,121,185,168,116,4,147,123,72,223,119,226,242,161,204,180,202,137,166,58,24,124,19,181,188,16,107,66,231,63,1,64,252,115,62,233,97,250,86,156,221,49,178,32,73,198,67,249,253,74,56,38,165,119,92,99,44,95,131,89,192,225,55,95,171,88,205,21,116,231,83,71,71,100,110,217,254,152,212,18,8,40,157,244,54,72,240,231,189,111,195,205,81, }; - - sbp_msg_ssr_gridded_correction_no_std_dep_a_t test_msg{}; - test_msg.header.iod_atmo = 236; - test_msg.header.num_msgs = 62837; - test_msg.header.seq_num = 63555; - test_msg.header.time.tow = 2837573811; - test_msg.header.time.wn = 8940; - test_msg.header.tropo_quality_indicator = 230; - test_msg.header.update_interval = 233; - test_msg.index = 26598; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_stec_residuals.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)101,(char)99,(char)95,(char)114,(char)101,(char)115,(char)105,(char)100,(char)117,(char)97,(char)108,(char)115 }; - memcpy(test_msg.n_stec_residuals.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_stec_residuals.value = 59; - - test_msg.stec_residuals[0].residual = -23949; - test_msg.stec_residuals[0].sv_id.constellation = 157; - test_msg.stec_residuals[0].sv_id.satId = 231; - - test_msg.stec_residuals[1].residual = 27427; - test_msg.stec_residuals[1].sv_id.constellation = 146; - test_msg.stec_residuals[1].sv_id.satId = 197; - - test_msg.stec_residuals[2].residual = 10548; - test_msg.stec_residuals[2].sv_id.constellation = 109; - test_msg.stec_residuals[2].sv_id.satId = 222; - - test_msg.stec_residuals[3].residual = -18195; - test_msg.stec_residuals[3].sv_id.constellation = 12; - test_msg.stec_residuals[3].sv_id.satId = 86; - - test_msg.stec_residuals[4].residual = -27511; - test_msg.stec_residuals[4].sv_id.constellation = 204; - test_msg.stec_residuals[4].sv_id.satId = 65; - - test_msg.stec_residuals[5].residual = 11; - test_msg.stec_residuals[5].sv_id.constellation = 183; - test_msg.stec_residuals[5].sv_id.satId = 171; - - test_msg.stec_residuals[6].residual = 13740; - test_msg.stec_residuals[6].sv_id.constellation = 203; - test_msg.stec_residuals[6].sv_id.satId = 180; - - test_msg.stec_residuals[7].residual = 29626; - test_msg.stec_residuals[7].sv_id.constellation = 85; - test_msg.stec_residuals[7].sv_id.satId = 196; - - test_msg.stec_residuals[8].residual = 7846; - test_msg.stec_residuals[8].sv_id.constellation = 92; - test_msg.stec_residuals[8].sv_id.satId = 203; - - test_msg.stec_residuals[9].residual = 18376; - test_msg.stec_residuals[9].sv_id.constellation = 13; - test_msg.stec_residuals[9].sv_id.satId = 42; - - test_msg.stec_residuals[10].residual = -24357; - test_msg.stec_residuals[10].sv_id.constellation = 137; - test_msg.stec_residuals[10].sv_id.satId = 98; - - test_msg.stec_residuals[11].residual = -1441; - test_msg.stec_residuals[11].sv_id.constellation = 216; - test_msg.stec_residuals[11].sv_id.satId = 95; - - test_msg.stec_residuals[12].residual = -10660; - test_msg.stec_residuals[12].sv_id.constellation = 196; - test_msg.stec_residuals[12].sv_id.satId = 99; - - test_msg.stec_residuals[13].residual = -8509; - test_msg.stec_residuals[13].sv_id.constellation = 253; - test_msg.stec_residuals[13].sv_id.satId = 159; - - test_msg.stec_residuals[14].residual = 16361; - test_msg.stec_residuals[14].sv_id.constellation = 146; - test_msg.stec_residuals[14].sv_id.satId = 233; - - test_msg.stec_residuals[15].residual = 10346; - test_msg.stec_residuals[15].sv_id.constellation = 24; - test_msg.stec_residuals[15].sv_id.satId = 76; - - test_msg.stec_residuals[16].residual = -18679; - test_msg.stec_residuals[16].sv_id.constellation = 65; - test_msg.stec_residuals[16].sv_id.satId = 253; - - test_msg.stec_residuals[17].residual = 15292; - test_msg.stec_residuals[17].sv_id.constellation = 215; - test_msg.stec_residuals[17].sv_id.satId = 40; - - test_msg.stec_residuals[18].residual = 29537; - test_msg.stec_residuals[18].sv_id.constellation = 69; - test_msg.stec_residuals[18].sv_id.satId = 117; - - test_msg.stec_residuals[19].residual = -29440; - test_msg.stec_residuals[19].sv_id.constellation = 56; - test_msg.stec_residuals[19].sv_id.satId = 60; - - test_msg.stec_residuals[20].residual = -24266; - test_msg.stec_residuals[20].sv_id.constellation = 171; - test_msg.stec_residuals[20].sv_id.satId = 207; - - test_msg.stec_residuals[21].residual = 22272; - test_msg.stec_residuals[21].sv_id.constellation = 61; - test_msg.stec_residuals[21].sv_id.satId = 23; - - test_msg.stec_residuals[22].residual = 9303; - test_msg.stec_residuals[22].sv_id.constellation = 123; - test_msg.stec_residuals[22].sv_id.satId = 230; - - test_msg.stec_residuals[23].residual = -23794; - test_msg.stec_residuals[23].sv_id.constellation = 255; - test_msg.stec_residuals[23].sv_id.satId = 184; - - test_msg.stec_residuals[24].residual = -26837; - test_msg.stec_residuals[24].sv_id.constellation = 224; - test_msg.stec_residuals[24].sv_id.satId = 187; - - test_msg.stec_residuals[25].residual = 14631; - test_msg.stec_residuals[25].sv_id.constellation = 104; - test_msg.stec_residuals[25].sv_id.satId = 151; - - test_msg.stec_residuals[26].residual = -8144; - test_msg.stec_residuals[26].sv_id.constellation = 54; - test_msg.stec_residuals[26].sv_id.satId = 5; - - test_msg.stec_residuals[27].residual = 23612; - test_msg.stec_residuals[27].sv_id.constellation = 129; - test_msg.stec_residuals[27].sv_id.satId = 181; - - test_msg.stec_residuals[28].residual = 28013; - test_msg.stec_residuals[28].sv_id.constellation = 114; - test_msg.stec_residuals[28].sv_id.satId = 171; - - test_msg.stec_residuals[29].residual = 2166; - test_msg.stec_residuals[29].sv_id.constellation = 23; - test_msg.stec_residuals[29].sv_id.satId = 12; - - test_msg.stec_residuals[30].residual = -10186; - test_msg.stec_residuals[30].sv_id.constellation = 159; - test_msg.stec_residuals[30].sv_id.satId = 64; - - test_msg.stec_residuals[31].residual = 17432; - test_msg.stec_residuals[31].sv_id.constellation = 20; - test_msg.stec_residuals[31].sv_id.satId = 33; - - test_msg.stec_residuals[32].residual = -8666; - test_msg.stec_residuals[32].sv_id.constellation = 36; - test_msg.stec_residuals[32].sv_id.satId = 160; - - test_msg.stec_residuals[33].residual = 25436; - test_msg.stec_residuals[33].sv_id.constellation = 190; - test_msg.stec_residuals[33].sv_id.satId = 145; - - test_msg.stec_residuals[34].residual = -3864; - test_msg.stec_residuals[34].sv_id.constellation = 159; - test_msg.stec_residuals[34].sv_id.satId = 108; - - test_msg.stec_residuals[35].residual = 4093; - test_msg.stec_residuals[35].sv_id.constellation = 221; - test_msg.stec_residuals[35].sv_id.satId = 227; - - test_msg.stec_residuals[36].residual = -18055; - test_msg.stec_residuals[36].sv_id.constellation = 23; - test_msg.stec_residuals[36].sv_id.satId = 62; - - test_msg.stec_residuals[37].residual = -27900; - test_msg.stec_residuals[37].sv_id.constellation = 116; - test_msg.stec_residuals[37].sv_id.satId = 168; - - test_msg.stec_residuals[38].residual = 30687; - test_msg.stec_residuals[38].sv_id.constellation = 72; - test_msg.stec_residuals[38].sv_id.satId = 123; - - test_msg.stec_residuals[39].residual = -13151; - test_msg.stec_residuals[39].sv_id.constellation = 242; - test_msg.stec_residuals[39].sv_id.satId = 226; - - test_msg.stec_residuals[40].residual = -22903; - test_msg.stec_residuals[40].sv_id.constellation = 202; - test_msg.stec_residuals[40].sv_id.satId = 180; - - test_msg.stec_residuals[41].residual = 4988; - test_msg.stec_residuals[41].sv_id.constellation = 24; - test_msg.stec_residuals[41].sv_id.satId = 58; - - test_msg.stec_residuals[42].residual = 27408; - test_msg.stec_residuals[42].sv_id.constellation = 188; - test_msg.stec_residuals[42].sv_id.satId = 181; - - test_msg.stec_residuals[43].residual = 319; - test_msg.stec_residuals[43].sv_id.constellation = 231; - test_msg.stec_residuals[43].sv_id.satId = 66; - - test_msg.stec_residuals[44].residual = 15987; - test_msg.stec_residuals[44].sv_id.constellation = 252; - test_msg.stec_residuals[44].sv_id.satId = 64; - - test_msg.stec_residuals[45].residual = 22266; - test_msg.stec_residuals[45].sv_id.constellation = 97; - test_msg.stec_residuals[45].sv_id.satId = 233; - - test_msg.stec_residuals[46].residual = -19919; - test_msg.stec_residuals[46].sv_id.constellation = 221; - test_msg.stec_residuals[46].sv_id.satId = 156; - - test_msg.stec_residuals[47].residual = 17350; - test_msg.stec_residuals[47].sv_id.constellation = 73; - test_msg.stec_residuals[47].sv_id.satId = 32; - - test_msg.stec_residuals[48].residual = 14410; - test_msg.stec_residuals[48].sv_id.constellation = 253; - test_msg.stec_residuals[48].sv_id.satId = 249; - - test_msg.stec_residuals[49].residual = 23671; - test_msg.stec_residuals[49].sv_id.constellation = 165; - test_msg.stec_residuals[49].sv_id.satId = 38; - - test_msg.stec_residuals[50].residual = -31905; - test_msg.stec_residuals[50].sv_id.constellation = 44; - test_msg.stec_residuals[50].sv_id.satId = 99; - - test_msg.stec_residuals[51].residual = 14305; - test_msg.stec_residuals[51].sv_id.constellation = 192; - test_msg.stec_residuals[51].sv_id.satId = 89; - - test_msg.stec_residuals[52].residual = -12968; - test_msg.stec_residuals[52].sv_id.constellation = 171; - test_msg.stec_residuals[52].sv_id.satId = 95; - - test_msg.stec_residuals[53].residual = 21479; - test_msg.stec_residuals[53].sv_id.constellation = 116; - test_msg.stec_residuals[53].sv_id.satId = 21; - - test_msg.stec_residuals[54].residual = 28260; - test_msg.stec_residuals[54].sv_id.constellation = 71; - test_msg.stec_residuals[54].sv_id.satId = 71; - - test_msg.stec_residuals[55].residual = -11112; - test_msg.stec_residuals[55].sv_id.constellation = 254; - test_msg.stec_residuals[55].sv_id.satId = 217; - - test_msg.stec_residuals[56].residual = -25304; - test_msg.stec_residuals[56].sv_id.constellation = 8; - test_msg.stec_residuals[56].sv_id.satId = 18; - - test_msg.stec_residuals[57].residual = -4024; - test_msg.stec_residuals[57].sv_id.constellation = 54; - test_msg.stec_residuals[57].sv_id.satId = 244; - - test_msg.stec_residuals[58].residual = -15505; - test_msg.stec_residuals[58].sv_id.constellation = 189; - test_msg.stec_residuals[58].sv_id.satId = 231; - test_msg.tropo_delay_correction.hydro = 16250; - test_msg.tropo_delay_correction.wet = 101; - - EXPECT_EQ(send_message( 7270, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 7270); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.iod_atmo, 236) << "incorrect value for last_msg_.header.iod_atmo, expected 236, is " << last_msg_.header.iod_atmo; - EXPECT_EQ(last_msg_.header.num_msgs, 62837) << "incorrect value for last_msg_.header.num_msgs, expected 62837, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.seq_num, 63555) << "incorrect value for last_msg_.header.seq_num, expected 63555, is " << last_msg_.header.seq_num; - EXPECT_EQ(last_msg_.header.time.tow, 2837573811) << "incorrect value for last_msg_.header.time.tow, expected 2837573811, is " << last_msg_.header.time.tow; - EXPECT_EQ(last_msg_.header.time.wn, 8940) << "incorrect value for last_msg_.header.time.wn, expected 8940, is " << last_msg_.header.time.wn; - EXPECT_EQ(last_msg_.header.tropo_quality_indicator, 230) << "incorrect value for last_msg_.header.tropo_quality_indicator, expected 230, is " << last_msg_.header.tropo_quality_indicator; - EXPECT_EQ(last_msg_.header.update_interval, 233) << "incorrect value for last_msg_.header.update_interval, expected 233, is " << last_msg_.header.update_interval; - EXPECT_EQ(last_msg_.index, 26598) << "incorrect value for last_msg_.index, expected 26598, is " << last_msg_.index; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_stec_residuals.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_stec_residuals.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_stec_residuals.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)101,(char)99,(char)95,(char)114,(char)101,(char)115,(char)105,(char)100,(char)117,(char)97,(char)108,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_stec_residuals.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_stec_residuals.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_stec_residuals.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_stec_residuals.value, 59) << "incorrect value for last_msg_.n_stec_residuals.value, expected 59, is " << last_msg_.n_stec_residuals.value; - EXPECT_EQ(last_msg_.stec_residuals[0].residual, -23949) << "incorrect value for last_msg_.stec_residuals[0].residual, expected -23949, is " << last_msg_.stec_residuals[0].residual; - EXPECT_EQ(last_msg_.stec_residuals[0].sv_id.constellation, 157) << "incorrect value for last_msg_.stec_residuals[0].sv_id.constellation, expected 157, is " << last_msg_.stec_residuals[0].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[0].sv_id.satId, 231) << "incorrect value for last_msg_.stec_residuals[0].sv_id.satId, expected 231, is " << last_msg_.stec_residuals[0].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[1].residual, 27427) << "incorrect value for last_msg_.stec_residuals[1].residual, expected 27427, is " << last_msg_.stec_residuals[1].residual; - EXPECT_EQ(last_msg_.stec_residuals[1].sv_id.constellation, 146) << "incorrect value for last_msg_.stec_residuals[1].sv_id.constellation, expected 146, is " << last_msg_.stec_residuals[1].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[1].sv_id.satId, 197) << "incorrect value for last_msg_.stec_residuals[1].sv_id.satId, expected 197, is " << last_msg_.stec_residuals[1].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[2].residual, 10548) << "incorrect value for last_msg_.stec_residuals[2].residual, expected 10548, is " << last_msg_.stec_residuals[2].residual; - EXPECT_EQ(last_msg_.stec_residuals[2].sv_id.constellation, 109) << "incorrect value for last_msg_.stec_residuals[2].sv_id.constellation, expected 109, is " << last_msg_.stec_residuals[2].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[2].sv_id.satId, 222) << "incorrect value for last_msg_.stec_residuals[2].sv_id.satId, expected 222, is " << last_msg_.stec_residuals[2].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[3].residual, -18195) << "incorrect value for last_msg_.stec_residuals[3].residual, expected -18195, is " << last_msg_.stec_residuals[3].residual; - EXPECT_EQ(last_msg_.stec_residuals[3].sv_id.constellation, 12) << "incorrect value for last_msg_.stec_residuals[3].sv_id.constellation, expected 12, is " << last_msg_.stec_residuals[3].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[3].sv_id.satId, 86) << "incorrect value for last_msg_.stec_residuals[3].sv_id.satId, expected 86, is " << last_msg_.stec_residuals[3].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[4].residual, -27511) << "incorrect value for last_msg_.stec_residuals[4].residual, expected -27511, is " << last_msg_.stec_residuals[4].residual; - EXPECT_EQ(last_msg_.stec_residuals[4].sv_id.constellation, 204) << "incorrect value for last_msg_.stec_residuals[4].sv_id.constellation, expected 204, is " << last_msg_.stec_residuals[4].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[4].sv_id.satId, 65) << "incorrect value for last_msg_.stec_residuals[4].sv_id.satId, expected 65, is " << last_msg_.stec_residuals[4].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[5].residual, 11) << "incorrect value for last_msg_.stec_residuals[5].residual, expected 11, is " << last_msg_.stec_residuals[5].residual; - EXPECT_EQ(last_msg_.stec_residuals[5].sv_id.constellation, 183) << "incorrect value for last_msg_.stec_residuals[5].sv_id.constellation, expected 183, is " << last_msg_.stec_residuals[5].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[5].sv_id.satId, 171) << "incorrect value for last_msg_.stec_residuals[5].sv_id.satId, expected 171, is " << last_msg_.stec_residuals[5].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[6].residual, 13740) << "incorrect value for last_msg_.stec_residuals[6].residual, expected 13740, is " << last_msg_.stec_residuals[6].residual; - EXPECT_EQ(last_msg_.stec_residuals[6].sv_id.constellation, 203) << "incorrect value for last_msg_.stec_residuals[6].sv_id.constellation, expected 203, is " << last_msg_.stec_residuals[6].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[6].sv_id.satId, 180) << "incorrect value for last_msg_.stec_residuals[6].sv_id.satId, expected 180, is " << last_msg_.stec_residuals[6].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[7].residual, 29626) << "incorrect value for last_msg_.stec_residuals[7].residual, expected 29626, is " << last_msg_.stec_residuals[7].residual; - EXPECT_EQ(last_msg_.stec_residuals[7].sv_id.constellation, 85) << "incorrect value for last_msg_.stec_residuals[7].sv_id.constellation, expected 85, is " << last_msg_.stec_residuals[7].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[7].sv_id.satId, 196) << "incorrect value for last_msg_.stec_residuals[7].sv_id.satId, expected 196, is " << last_msg_.stec_residuals[7].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[8].residual, 7846) << "incorrect value for last_msg_.stec_residuals[8].residual, expected 7846, is " << last_msg_.stec_residuals[8].residual; - EXPECT_EQ(last_msg_.stec_residuals[8].sv_id.constellation, 92) << "incorrect value for last_msg_.stec_residuals[8].sv_id.constellation, expected 92, is " << last_msg_.stec_residuals[8].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[8].sv_id.satId, 203) << "incorrect value for last_msg_.stec_residuals[8].sv_id.satId, expected 203, is " << last_msg_.stec_residuals[8].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[9].residual, 18376) << "incorrect value for last_msg_.stec_residuals[9].residual, expected 18376, is " << last_msg_.stec_residuals[9].residual; - EXPECT_EQ(last_msg_.stec_residuals[9].sv_id.constellation, 13) << "incorrect value for last_msg_.stec_residuals[9].sv_id.constellation, expected 13, is " << last_msg_.stec_residuals[9].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[9].sv_id.satId, 42) << "incorrect value for last_msg_.stec_residuals[9].sv_id.satId, expected 42, is " << last_msg_.stec_residuals[9].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[10].residual, -24357) << "incorrect value for last_msg_.stec_residuals[10].residual, expected -24357, is " << last_msg_.stec_residuals[10].residual; - EXPECT_EQ(last_msg_.stec_residuals[10].sv_id.constellation, 137) << "incorrect value for last_msg_.stec_residuals[10].sv_id.constellation, expected 137, is " << last_msg_.stec_residuals[10].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[10].sv_id.satId, 98) << "incorrect value for last_msg_.stec_residuals[10].sv_id.satId, expected 98, is " << last_msg_.stec_residuals[10].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[11].residual, -1441) << "incorrect value for last_msg_.stec_residuals[11].residual, expected -1441, is " << last_msg_.stec_residuals[11].residual; - EXPECT_EQ(last_msg_.stec_residuals[11].sv_id.constellation, 216) << "incorrect value for last_msg_.stec_residuals[11].sv_id.constellation, expected 216, is " << last_msg_.stec_residuals[11].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[11].sv_id.satId, 95) << "incorrect value for last_msg_.stec_residuals[11].sv_id.satId, expected 95, is " << last_msg_.stec_residuals[11].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[12].residual, -10660) << "incorrect value for last_msg_.stec_residuals[12].residual, expected -10660, is " << last_msg_.stec_residuals[12].residual; - EXPECT_EQ(last_msg_.stec_residuals[12].sv_id.constellation, 196) << "incorrect value for last_msg_.stec_residuals[12].sv_id.constellation, expected 196, is " << last_msg_.stec_residuals[12].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[12].sv_id.satId, 99) << "incorrect value for last_msg_.stec_residuals[12].sv_id.satId, expected 99, is " << last_msg_.stec_residuals[12].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[13].residual, -8509) << "incorrect value for last_msg_.stec_residuals[13].residual, expected -8509, is " << last_msg_.stec_residuals[13].residual; - EXPECT_EQ(last_msg_.stec_residuals[13].sv_id.constellation, 253) << "incorrect value for last_msg_.stec_residuals[13].sv_id.constellation, expected 253, is " << last_msg_.stec_residuals[13].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[13].sv_id.satId, 159) << "incorrect value for last_msg_.stec_residuals[13].sv_id.satId, expected 159, is " << last_msg_.stec_residuals[13].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[14].residual, 16361) << "incorrect value for last_msg_.stec_residuals[14].residual, expected 16361, is " << last_msg_.stec_residuals[14].residual; - EXPECT_EQ(last_msg_.stec_residuals[14].sv_id.constellation, 146) << "incorrect value for last_msg_.stec_residuals[14].sv_id.constellation, expected 146, is " << last_msg_.stec_residuals[14].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[14].sv_id.satId, 233) << "incorrect value for last_msg_.stec_residuals[14].sv_id.satId, expected 233, is " << last_msg_.stec_residuals[14].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[15].residual, 10346) << "incorrect value for last_msg_.stec_residuals[15].residual, expected 10346, is " << last_msg_.stec_residuals[15].residual; - EXPECT_EQ(last_msg_.stec_residuals[15].sv_id.constellation, 24) << "incorrect value for last_msg_.stec_residuals[15].sv_id.constellation, expected 24, is " << last_msg_.stec_residuals[15].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[15].sv_id.satId, 76) << "incorrect value for last_msg_.stec_residuals[15].sv_id.satId, expected 76, is " << last_msg_.stec_residuals[15].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[16].residual, -18679) << "incorrect value for last_msg_.stec_residuals[16].residual, expected -18679, is " << last_msg_.stec_residuals[16].residual; - EXPECT_EQ(last_msg_.stec_residuals[16].sv_id.constellation, 65) << "incorrect value for last_msg_.stec_residuals[16].sv_id.constellation, expected 65, is " << last_msg_.stec_residuals[16].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[16].sv_id.satId, 253) << "incorrect value for last_msg_.stec_residuals[16].sv_id.satId, expected 253, is " << last_msg_.stec_residuals[16].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[17].residual, 15292) << "incorrect value for last_msg_.stec_residuals[17].residual, expected 15292, is " << last_msg_.stec_residuals[17].residual; - EXPECT_EQ(last_msg_.stec_residuals[17].sv_id.constellation, 215) << "incorrect value for last_msg_.stec_residuals[17].sv_id.constellation, expected 215, is " << last_msg_.stec_residuals[17].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[17].sv_id.satId, 40) << "incorrect value for last_msg_.stec_residuals[17].sv_id.satId, expected 40, is " << last_msg_.stec_residuals[17].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[18].residual, 29537) << "incorrect value for last_msg_.stec_residuals[18].residual, expected 29537, is " << last_msg_.stec_residuals[18].residual; - EXPECT_EQ(last_msg_.stec_residuals[18].sv_id.constellation, 69) << "incorrect value for last_msg_.stec_residuals[18].sv_id.constellation, expected 69, is " << last_msg_.stec_residuals[18].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[18].sv_id.satId, 117) << "incorrect value for last_msg_.stec_residuals[18].sv_id.satId, expected 117, is " << last_msg_.stec_residuals[18].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[19].residual, -29440) << "incorrect value for last_msg_.stec_residuals[19].residual, expected -29440, is " << last_msg_.stec_residuals[19].residual; - EXPECT_EQ(last_msg_.stec_residuals[19].sv_id.constellation, 56) << "incorrect value for last_msg_.stec_residuals[19].sv_id.constellation, expected 56, is " << last_msg_.stec_residuals[19].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[19].sv_id.satId, 60) << "incorrect value for last_msg_.stec_residuals[19].sv_id.satId, expected 60, is " << last_msg_.stec_residuals[19].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[20].residual, -24266) << "incorrect value for last_msg_.stec_residuals[20].residual, expected -24266, is " << last_msg_.stec_residuals[20].residual; - EXPECT_EQ(last_msg_.stec_residuals[20].sv_id.constellation, 171) << "incorrect value for last_msg_.stec_residuals[20].sv_id.constellation, expected 171, is " << last_msg_.stec_residuals[20].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[20].sv_id.satId, 207) << "incorrect value for last_msg_.stec_residuals[20].sv_id.satId, expected 207, is " << last_msg_.stec_residuals[20].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[21].residual, 22272) << "incorrect value for last_msg_.stec_residuals[21].residual, expected 22272, is " << last_msg_.stec_residuals[21].residual; - EXPECT_EQ(last_msg_.stec_residuals[21].sv_id.constellation, 61) << "incorrect value for last_msg_.stec_residuals[21].sv_id.constellation, expected 61, is " << last_msg_.stec_residuals[21].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[21].sv_id.satId, 23) << "incorrect value for last_msg_.stec_residuals[21].sv_id.satId, expected 23, is " << last_msg_.stec_residuals[21].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[22].residual, 9303) << "incorrect value for last_msg_.stec_residuals[22].residual, expected 9303, is " << last_msg_.stec_residuals[22].residual; - EXPECT_EQ(last_msg_.stec_residuals[22].sv_id.constellation, 123) << "incorrect value for last_msg_.stec_residuals[22].sv_id.constellation, expected 123, is " << last_msg_.stec_residuals[22].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[22].sv_id.satId, 230) << "incorrect value for last_msg_.stec_residuals[22].sv_id.satId, expected 230, is " << last_msg_.stec_residuals[22].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[23].residual, -23794) << "incorrect value for last_msg_.stec_residuals[23].residual, expected -23794, is " << last_msg_.stec_residuals[23].residual; - EXPECT_EQ(last_msg_.stec_residuals[23].sv_id.constellation, 255) << "incorrect value for last_msg_.stec_residuals[23].sv_id.constellation, expected 255, is " << last_msg_.stec_residuals[23].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[23].sv_id.satId, 184) << "incorrect value for last_msg_.stec_residuals[23].sv_id.satId, expected 184, is " << last_msg_.stec_residuals[23].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[24].residual, -26837) << "incorrect value for last_msg_.stec_residuals[24].residual, expected -26837, is " << last_msg_.stec_residuals[24].residual; - EXPECT_EQ(last_msg_.stec_residuals[24].sv_id.constellation, 224) << "incorrect value for last_msg_.stec_residuals[24].sv_id.constellation, expected 224, is " << last_msg_.stec_residuals[24].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[24].sv_id.satId, 187) << "incorrect value for last_msg_.stec_residuals[24].sv_id.satId, expected 187, is " << last_msg_.stec_residuals[24].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[25].residual, 14631) << "incorrect value for last_msg_.stec_residuals[25].residual, expected 14631, is " << last_msg_.stec_residuals[25].residual; - EXPECT_EQ(last_msg_.stec_residuals[25].sv_id.constellation, 104) << "incorrect value for last_msg_.stec_residuals[25].sv_id.constellation, expected 104, is " << last_msg_.stec_residuals[25].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[25].sv_id.satId, 151) << "incorrect value for last_msg_.stec_residuals[25].sv_id.satId, expected 151, is " << last_msg_.stec_residuals[25].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[26].residual, -8144) << "incorrect value for last_msg_.stec_residuals[26].residual, expected -8144, is " << last_msg_.stec_residuals[26].residual; - EXPECT_EQ(last_msg_.stec_residuals[26].sv_id.constellation, 54) << "incorrect value for last_msg_.stec_residuals[26].sv_id.constellation, expected 54, is " << last_msg_.stec_residuals[26].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[26].sv_id.satId, 5) << "incorrect value for last_msg_.stec_residuals[26].sv_id.satId, expected 5, is " << last_msg_.stec_residuals[26].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[27].residual, 23612) << "incorrect value for last_msg_.stec_residuals[27].residual, expected 23612, is " << last_msg_.stec_residuals[27].residual; - EXPECT_EQ(last_msg_.stec_residuals[27].sv_id.constellation, 129) << "incorrect value for last_msg_.stec_residuals[27].sv_id.constellation, expected 129, is " << last_msg_.stec_residuals[27].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[27].sv_id.satId, 181) << "incorrect value for last_msg_.stec_residuals[27].sv_id.satId, expected 181, is " << last_msg_.stec_residuals[27].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[28].residual, 28013) << "incorrect value for last_msg_.stec_residuals[28].residual, expected 28013, is " << last_msg_.stec_residuals[28].residual; - EXPECT_EQ(last_msg_.stec_residuals[28].sv_id.constellation, 114) << "incorrect value for last_msg_.stec_residuals[28].sv_id.constellation, expected 114, is " << last_msg_.stec_residuals[28].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[28].sv_id.satId, 171) << "incorrect value for last_msg_.stec_residuals[28].sv_id.satId, expected 171, is " << last_msg_.stec_residuals[28].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[29].residual, 2166) << "incorrect value for last_msg_.stec_residuals[29].residual, expected 2166, is " << last_msg_.stec_residuals[29].residual; - EXPECT_EQ(last_msg_.stec_residuals[29].sv_id.constellation, 23) << "incorrect value for last_msg_.stec_residuals[29].sv_id.constellation, expected 23, is " << last_msg_.stec_residuals[29].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[29].sv_id.satId, 12) << "incorrect value for last_msg_.stec_residuals[29].sv_id.satId, expected 12, is " << last_msg_.stec_residuals[29].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[30].residual, -10186) << "incorrect value for last_msg_.stec_residuals[30].residual, expected -10186, is " << last_msg_.stec_residuals[30].residual; - EXPECT_EQ(last_msg_.stec_residuals[30].sv_id.constellation, 159) << "incorrect value for last_msg_.stec_residuals[30].sv_id.constellation, expected 159, is " << last_msg_.stec_residuals[30].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[30].sv_id.satId, 64) << "incorrect value for last_msg_.stec_residuals[30].sv_id.satId, expected 64, is " << last_msg_.stec_residuals[30].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[31].residual, 17432) << "incorrect value for last_msg_.stec_residuals[31].residual, expected 17432, is " << last_msg_.stec_residuals[31].residual; - EXPECT_EQ(last_msg_.stec_residuals[31].sv_id.constellation, 20) << "incorrect value for last_msg_.stec_residuals[31].sv_id.constellation, expected 20, is " << last_msg_.stec_residuals[31].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[31].sv_id.satId, 33) << "incorrect value for last_msg_.stec_residuals[31].sv_id.satId, expected 33, is " << last_msg_.stec_residuals[31].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[32].residual, -8666) << "incorrect value for last_msg_.stec_residuals[32].residual, expected -8666, is " << last_msg_.stec_residuals[32].residual; - EXPECT_EQ(last_msg_.stec_residuals[32].sv_id.constellation, 36) << "incorrect value for last_msg_.stec_residuals[32].sv_id.constellation, expected 36, is " << last_msg_.stec_residuals[32].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[32].sv_id.satId, 160) << "incorrect value for last_msg_.stec_residuals[32].sv_id.satId, expected 160, is " << last_msg_.stec_residuals[32].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[33].residual, 25436) << "incorrect value for last_msg_.stec_residuals[33].residual, expected 25436, is " << last_msg_.stec_residuals[33].residual; - EXPECT_EQ(last_msg_.stec_residuals[33].sv_id.constellation, 190) << "incorrect value for last_msg_.stec_residuals[33].sv_id.constellation, expected 190, is " << last_msg_.stec_residuals[33].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[33].sv_id.satId, 145) << "incorrect value for last_msg_.stec_residuals[33].sv_id.satId, expected 145, is " << last_msg_.stec_residuals[33].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[34].residual, -3864) << "incorrect value for last_msg_.stec_residuals[34].residual, expected -3864, is " << last_msg_.stec_residuals[34].residual; - EXPECT_EQ(last_msg_.stec_residuals[34].sv_id.constellation, 159) << "incorrect value for last_msg_.stec_residuals[34].sv_id.constellation, expected 159, is " << last_msg_.stec_residuals[34].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[34].sv_id.satId, 108) << "incorrect value for last_msg_.stec_residuals[34].sv_id.satId, expected 108, is " << last_msg_.stec_residuals[34].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[35].residual, 4093) << "incorrect value for last_msg_.stec_residuals[35].residual, expected 4093, is " << last_msg_.stec_residuals[35].residual; - EXPECT_EQ(last_msg_.stec_residuals[35].sv_id.constellation, 221) << "incorrect value for last_msg_.stec_residuals[35].sv_id.constellation, expected 221, is " << last_msg_.stec_residuals[35].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[35].sv_id.satId, 227) << "incorrect value for last_msg_.stec_residuals[35].sv_id.satId, expected 227, is " << last_msg_.stec_residuals[35].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[36].residual, -18055) << "incorrect value for last_msg_.stec_residuals[36].residual, expected -18055, is " << last_msg_.stec_residuals[36].residual; - EXPECT_EQ(last_msg_.stec_residuals[36].sv_id.constellation, 23) << "incorrect value for last_msg_.stec_residuals[36].sv_id.constellation, expected 23, is " << last_msg_.stec_residuals[36].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[36].sv_id.satId, 62) << "incorrect value for last_msg_.stec_residuals[36].sv_id.satId, expected 62, is " << last_msg_.stec_residuals[36].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[37].residual, -27900) << "incorrect value for last_msg_.stec_residuals[37].residual, expected -27900, is " << last_msg_.stec_residuals[37].residual; - EXPECT_EQ(last_msg_.stec_residuals[37].sv_id.constellation, 116) << "incorrect value for last_msg_.stec_residuals[37].sv_id.constellation, expected 116, is " << last_msg_.stec_residuals[37].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[37].sv_id.satId, 168) << "incorrect value for last_msg_.stec_residuals[37].sv_id.satId, expected 168, is " << last_msg_.stec_residuals[37].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[38].residual, 30687) << "incorrect value for last_msg_.stec_residuals[38].residual, expected 30687, is " << last_msg_.stec_residuals[38].residual; - EXPECT_EQ(last_msg_.stec_residuals[38].sv_id.constellation, 72) << "incorrect value for last_msg_.stec_residuals[38].sv_id.constellation, expected 72, is " << last_msg_.stec_residuals[38].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[38].sv_id.satId, 123) << "incorrect value for last_msg_.stec_residuals[38].sv_id.satId, expected 123, is " << last_msg_.stec_residuals[38].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[39].residual, -13151) << "incorrect value for last_msg_.stec_residuals[39].residual, expected -13151, is " << last_msg_.stec_residuals[39].residual; - EXPECT_EQ(last_msg_.stec_residuals[39].sv_id.constellation, 242) << "incorrect value for last_msg_.stec_residuals[39].sv_id.constellation, expected 242, is " << last_msg_.stec_residuals[39].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[39].sv_id.satId, 226) << "incorrect value for last_msg_.stec_residuals[39].sv_id.satId, expected 226, is " << last_msg_.stec_residuals[39].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[40].residual, -22903) << "incorrect value for last_msg_.stec_residuals[40].residual, expected -22903, is " << last_msg_.stec_residuals[40].residual; - EXPECT_EQ(last_msg_.stec_residuals[40].sv_id.constellation, 202) << "incorrect value for last_msg_.stec_residuals[40].sv_id.constellation, expected 202, is " << last_msg_.stec_residuals[40].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[40].sv_id.satId, 180) << "incorrect value for last_msg_.stec_residuals[40].sv_id.satId, expected 180, is " << last_msg_.stec_residuals[40].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[41].residual, 4988) << "incorrect value for last_msg_.stec_residuals[41].residual, expected 4988, is " << last_msg_.stec_residuals[41].residual; - EXPECT_EQ(last_msg_.stec_residuals[41].sv_id.constellation, 24) << "incorrect value for last_msg_.stec_residuals[41].sv_id.constellation, expected 24, is " << last_msg_.stec_residuals[41].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[41].sv_id.satId, 58) << "incorrect value for last_msg_.stec_residuals[41].sv_id.satId, expected 58, is " << last_msg_.stec_residuals[41].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[42].residual, 27408) << "incorrect value for last_msg_.stec_residuals[42].residual, expected 27408, is " << last_msg_.stec_residuals[42].residual; - EXPECT_EQ(last_msg_.stec_residuals[42].sv_id.constellation, 188) << "incorrect value for last_msg_.stec_residuals[42].sv_id.constellation, expected 188, is " << last_msg_.stec_residuals[42].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[42].sv_id.satId, 181) << "incorrect value for last_msg_.stec_residuals[42].sv_id.satId, expected 181, is " << last_msg_.stec_residuals[42].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[43].residual, 319) << "incorrect value for last_msg_.stec_residuals[43].residual, expected 319, is " << last_msg_.stec_residuals[43].residual; - EXPECT_EQ(last_msg_.stec_residuals[43].sv_id.constellation, 231) << "incorrect value for last_msg_.stec_residuals[43].sv_id.constellation, expected 231, is " << last_msg_.stec_residuals[43].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[43].sv_id.satId, 66) << "incorrect value for last_msg_.stec_residuals[43].sv_id.satId, expected 66, is " << last_msg_.stec_residuals[43].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[44].residual, 15987) << "incorrect value for last_msg_.stec_residuals[44].residual, expected 15987, is " << last_msg_.stec_residuals[44].residual; - EXPECT_EQ(last_msg_.stec_residuals[44].sv_id.constellation, 252) << "incorrect value for last_msg_.stec_residuals[44].sv_id.constellation, expected 252, is " << last_msg_.stec_residuals[44].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[44].sv_id.satId, 64) << "incorrect value for last_msg_.stec_residuals[44].sv_id.satId, expected 64, is " << last_msg_.stec_residuals[44].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[45].residual, 22266) << "incorrect value for last_msg_.stec_residuals[45].residual, expected 22266, is " << last_msg_.stec_residuals[45].residual; - EXPECT_EQ(last_msg_.stec_residuals[45].sv_id.constellation, 97) << "incorrect value for last_msg_.stec_residuals[45].sv_id.constellation, expected 97, is " << last_msg_.stec_residuals[45].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[45].sv_id.satId, 233) << "incorrect value for last_msg_.stec_residuals[45].sv_id.satId, expected 233, is " << last_msg_.stec_residuals[45].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[46].residual, -19919) << "incorrect value for last_msg_.stec_residuals[46].residual, expected -19919, is " << last_msg_.stec_residuals[46].residual; - EXPECT_EQ(last_msg_.stec_residuals[46].sv_id.constellation, 221) << "incorrect value for last_msg_.stec_residuals[46].sv_id.constellation, expected 221, is " << last_msg_.stec_residuals[46].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[46].sv_id.satId, 156) << "incorrect value for last_msg_.stec_residuals[46].sv_id.satId, expected 156, is " << last_msg_.stec_residuals[46].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[47].residual, 17350) << "incorrect value for last_msg_.stec_residuals[47].residual, expected 17350, is " << last_msg_.stec_residuals[47].residual; - EXPECT_EQ(last_msg_.stec_residuals[47].sv_id.constellation, 73) << "incorrect value for last_msg_.stec_residuals[47].sv_id.constellation, expected 73, is " << last_msg_.stec_residuals[47].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[47].sv_id.satId, 32) << "incorrect value for last_msg_.stec_residuals[47].sv_id.satId, expected 32, is " << last_msg_.stec_residuals[47].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[48].residual, 14410) << "incorrect value for last_msg_.stec_residuals[48].residual, expected 14410, is " << last_msg_.stec_residuals[48].residual; - EXPECT_EQ(last_msg_.stec_residuals[48].sv_id.constellation, 253) << "incorrect value for last_msg_.stec_residuals[48].sv_id.constellation, expected 253, is " << last_msg_.stec_residuals[48].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[48].sv_id.satId, 249) << "incorrect value for last_msg_.stec_residuals[48].sv_id.satId, expected 249, is " << last_msg_.stec_residuals[48].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[49].residual, 23671) << "incorrect value for last_msg_.stec_residuals[49].residual, expected 23671, is " << last_msg_.stec_residuals[49].residual; - EXPECT_EQ(last_msg_.stec_residuals[49].sv_id.constellation, 165) << "incorrect value for last_msg_.stec_residuals[49].sv_id.constellation, expected 165, is " << last_msg_.stec_residuals[49].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[49].sv_id.satId, 38) << "incorrect value for last_msg_.stec_residuals[49].sv_id.satId, expected 38, is " << last_msg_.stec_residuals[49].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[50].residual, -31905) << "incorrect value for last_msg_.stec_residuals[50].residual, expected -31905, is " << last_msg_.stec_residuals[50].residual; - EXPECT_EQ(last_msg_.stec_residuals[50].sv_id.constellation, 44) << "incorrect value for last_msg_.stec_residuals[50].sv_id.constellation, expected 44, is " << last_msg_.stec_residuals[50].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[50].sv_id.satId, 99) << "incorrect value for last_msg_.stec_residuals[50].sv_id.satId, expected 99, is " << last_msg_.stec_residuals[50].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[51].residual, 14305) << "incorrect value for last_msg_.stec_residuals[51].residual, expected 14305, is " << last_msg_.stec_residuals[51].residual; - EXPECT_EQ(last_msg_.stec_residuals[51].sv_id.constellation, 192) << "incorrect value for last_msg_.stec_residuals[51].sv_id.constellation, expected 192, is " << last_msg_.stec_residuals[51].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[51].sv_id.satId, 89) << "incorrect value for last_msg_.stec_residuals[51].sv_id.satId, expected 89, is " << last_msg_.stec_residuals[51].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[52].residual, -12968) << "incorrect value for last_msg_.stec_residuals[52].residual, expected -12968, is " << last_msg_.stec_residuals[52].residual; - EXPECT_EQ(last_msg_.stec_residuals[52].sv_id.constellation, 171) << "incorrect value for last_msg_.stec_residuals[52].sv_id.constellation, expected 171, is " << last_msg_.stec_residuals[52].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[52].sv_id.satId, 95) << "incorrect value for last_msg_.stec_residuals[52].sv_id.satId, expected 95, is " << last_msg_.stec_residuals[52].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[53].residual, 21479) << "incorrect value for last_msg_.stec_residuals[53].residual, expected 21479, is " << last_msg_.stec_residuals[53].residual; - EXPECT_EQ(last_msg_.stec_residuals[53].sv_id.constellation, 116) << "incorrect value for last_msg_.stec_residuals[53].sv_id.constellation, expected 116, is " << last_msg_.stec_residuals[53].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[53].sv_id.satId, 21) << "incorrect value for last_msg_.stec_residuals[53].sv_id.satId, expected 21, is " << last_msg_.stec_residuals[53].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[54].residual, 28260) << "incorrect value for last_msg_.stec_residuals[54].residual, expected 28260, is " << last_msg_.stec_residuals[54].residual; - EXPECT_EQ(last_msg_.stec_residuals[54].sv_id.constellation, 71) << "incorrect value for last_msg_.stec_residuals[54].sv_id.constellation, expected 71, is " << last_msg_.stec_residuals[54].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[54].sv_id.satId, 71) << "incorrect value for last_msg_.stec_residuals[54].sv_id.satId, expected 71, is " << last_msg_.stec_residuals[54].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[55].residual, -11112) << "incorrect value for last_msg_.stec_residuals[55].residual, expected -11112, is " << last_msg_.stec_residuals[55].residual; - EXPECT_EQ(last_msg_.stec_residuals[55].sv_id.constellation, 254) << "incorrect value for last_msg_.stec_residuals[55].sv_id.constellation, expected 254, is " << last_msg_.stec_residuals[55].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[55].sv_id.satId, 217) << "incorrect value for last_msg_.stec_residuals[55].sv_id.satId, expected 217, is " << last_msg_.stec_residuals[55].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[56].residual, -25304) << "incorrect value for last_msg_.stec_residuals[56].residual, expected -25304, is " << last_msg_.stec_residuals[56].residual; - EXPECT_EQ(last_msg_.stec_residuals[56].sv_id.constellation, 8) << "incorrect value for last_msg_.stec_residuals[56].sv_id.constellation, expected 8, is " << last_msg_.stec_residuals[56].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[56].sv_id.satId, 18) << "incorrect value for last_msg_.stec_residuals[56].sv_id.satId, expected 18, is " << last_msg_.stec_residuals[56].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[57].residual, -4024) << "incorrect value for last_msg_.stec_residuals[57].residual, expected -4024, is " << last_msg_.stec_residuals[57].residual; - EXPECT_EQ(last_msg_.stec_residuals[57].sv_id.constellation, 54) << "incorrect value for last_msg_.stec_residuals[57].sv_id.constellation, expected 54, is " << last_msg_.stec_residuals[57].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[57].sv_id.satId, 244) << "incorrect value for last_msg_.stec_residuals[57].sv_id.satId, expected 244, is " << last_msg_.stec_residuals[57].sv_id.satId; - EXPECT_EQ(last_msg_.stec_residuals[58].residual, -15505) << "incorrect value for last_msg_.stec_residuals[58].residual, expected -15505, is " << last_msg_.stec_residuals[58].residual; - EXPECT_EQ(last_msg_.stec_residuals[58].sv_id.constellation, 189) << "incorrect value for last_msg_.stec_residuals[58].sv_id.constellation, expected 189, is " << last_msg_.stec_residuals[58].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_residuals[58].sv_id.satId, 231) << "incorrect value for last_msg_.stec_residuals[58].sv_id.satId, expected 231, is " << last_msg_.stec_residuals[58].sv_id.satId; - EXPECT_EQ(last_msg_.tropo_delay_correction.hydro, 16250) << "incorrect value for last_msg_.tropo_delay_correction.hydro, expected 16250, is " << last_msg_.tropo_delay_correction.hydro; - EXPECT_EQ(last_msg_.tropo_delay_correction.wet, 101) << "incorrect value for last_msg_.tropo_delay_correction.wet, expected 101, is " << last_msg_.tropo_delay_correction.wet; +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 240, 5, 102, 28, 254, 179, 240, 33, 169, 236, 34, 117, 245, 67, + 248, 233, 236, 230, 230, 103, 122, 63, 101, 231, 157, 115, 162, 197, 146, + 35, 107, 222, 109, 52, 41, 86, 12, 237, 184, 65, 204, 137, 148, 171, + 183, 11, 0, 180, 203, 172, 53, 196, 85, 186, 115, 203, 92, 166, 30, + 42, 13, 200, 71, 98, 137, 219, 160, 95, 216, 95, 250, 99, 196, 92, + 214, 159, 253, 195, 222, 233, 146, 233, 63, 76, 24, 106, 40, 253, 65, + 9, 183, 40, 215, 188, 59, 117, 69, 97, 115, 60, 56, 0, 141, 207, + 171, 54, 161, 23, 61, 0, 87, 230, 123, 87, 36, 184, 255, 14, 163, + 187, 224, 43, 151, 151, 104, 39, 57, 5, 54, 48, 224, 181, 129, 60, + 92, 171, 114, 109, 109, 12, 23, 118, 8, 64, 159, 54, 216, 33, 20, + 24, 68, 160, 36, 38, 222, 145, 190, 92, 99, 108, 159, 232, 240, 227, + 221, 253, 15, 62, 23, 121, 185, 168, 116, 4, 147, 123, 72, 223, 119, + 226, 242, 161, 204, 180, 202, 137, 166, 58, 24, 124, 19, 181, 188, 16, + 107, 66, 231, 63, 1, 64, 252, 115, 62, 233, 97, 250, 86, 156, 221, + 49, 178, 32, 73, 198, 67, 249, 253, 74, 56, 38, 165, 119, 92, 99, + 44, 95, 131, 89, 192, 225, 55, 95, 171, 88, 205, 21, 116, 231, 83, + 71, 71, 100, 110, 217, 254, 152, 212, 18, 8, 40, 157, 244, 54, 72, + 240, 231, 189, 111, 195, 205, 81, + }; + + sbp_msg_ssr_gridded_correction_no_std_dep_a_t test_msg{}; + test_msg.header.iod_atmo = 236; + test_msg.header.num_msgs = 62837; + test_msg.header.seq_num = 63555; + test_msg.header.time.tow = 2837573811; + test_msg.header.time.wn = 8940; + test_msg.header.tropo_quality_indicator = 230; + test_msg.header.update_interval = 233; + test_msg.index = 26598; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_stec_residuals.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)101, (char)99, + (char)95, (char)114, (char)101, (char)115, + (char)105, (char)100, (char)117, (char)97, + (char)108, (char)115}; + memcpy(test_msg.n_stec_residuals.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_stec_residuals.value = 59; + + test_msg.stec_residuals[0].residual = -23949; + test_msg.stec_residuals[0].sv_id.constellation = 157; + test_msg.stec_residuals[0].sv_id.satId = 231; + + test_msg.stec_residuals[1].residual = 27427; + test_msg.stec_residuals[1].sv_id.constellation = 146; + test_msg.stec_residuals[1].sv_id.satId = 197; + + test_msg.stec_residuals[2].residual = 10548; + test_msg.stec_residuals[2].sv_id.constellation = 109; + test_msg.stec_residuals[2].sv_id.satId = 222; + + test_msg.stec_residuals[3].residual = -18195; + test_msg.stec_residuals[3].sv_id.constellation = 12; + test_msg.stec_residuals[3].sv_id.satId = 86; + + test_msg.stec_residuals[4].residual = -27511; + test_msg.stec_residuals[4].sv_id.constellation = 204; + test_msg.stec_residuals[4].sv_id.satId = 65; + + test_msg.stec_residuals[5].residual = 11; + test_msg.stec_residuals[5].sv_id.constellation = 183; + test_msg.stec_residuals[5].sv_id.satId = 171; + + test_msg.stec_residuals[6].residual = 13740; + test_msg.stec_residuals[6].sv_id.constellation = 203; + test_msg.stec_residuals[6].sv_id.satId = 180; + + test_msg.stec_residuals[7].residual = 29626; + test_msg.stec_residuals[7].sv_id.constellation = 85; + test_msg.stec_residuals[7].sv_id.satId = 196; + + test_msg.stec_residuals[8].residual = 7846; + test_msg.stec_residuals[8].sv_id.constellation = 92; + test_msg.stec_residuals[8].sv_id.satId = 203; + + test_msg.stec_residuals[9].residual = 18376; + test_msg.stec_residuals[9].sv_id.constellation = 13; + test_msg.stec_residuals[9].sv_id.satId = 42; + + test_msg.stec_residuals[10].residual = -24357; + test_msg.stec_residuals[10].sv_id.constellation = 137; + test_msg.stec_residuals[10].sv_id.satId = 98; + + test_msg.stec_residuals[11].residual = -1441; + test_msg.stec_residuals[11].sv_id.constellation = 216; + test_msg.stec_residuals[11].sv_id.satId = 95; + + test_msg.stec_residuals[12].residual = -10660; + test_msg.stec_residuals[12].sv_id.constellation = 196; + test_msg.stec_residuals[12].sv_id.satId = 99; + + test_msg.stec_residuals[13].residual = -8509; + test_msg.stec_residuals[13].sv_id.constellation = 253; + test_msg.stec_residuals[13].sv_id.satId = 159; + + test_msg.stec_residuals[14].residual = 16361; + test_msg.stec_residuals[14].sv_id.constellation = 146; + test_msg.stec_residuals[14].sv_id.satId = 233; + + test_msg.stec_residuals[15].residual = 10346; + test_msg.stec_residuals[15].sv_id.constellation = 24; + test_msg.stec_residuals[15].sv_id.satId = 76; + + test_msg.stec_residuals[16].residual = -18679; + test_msg.stec_residuals[16].sv_id.constellation = 65; + test_msg.stec_residuals[16].sv_id.satId = 253; + + test_msg.stec_residuals[17].residual = 15292; + test_msg.stec_residuals[17].sv_id.constellation = 215; + test_msg.stec_residuals[17].sv_id.satId = 40; + + test_msg.stec_residuals[18].residual = 29537; + test_msg.stec_residuals[18].sv_id.constellation = 69; + test_msg.stec_residuals[18].sv_id.satId = 117; + + test_msg.stec_residuals[19].residual = -29440; + test_msg.stec_residuals[19].sv_id.constellation = 56; + test_msg.stec_residuals[19].sv_id.satId = 60; + + test_msg.stec_residuals[20].residual = -24266; + test_msg.stec_residuals[20].sv_id.constellation = 171; + test_msg.stec_residuals[20].sv_id.satId = 207; + + test_msg.stec_residuals[21].residual = 22272; + test_msg.stec_residuals[21].sv_id.constellation = 61; + test_msg.stec_residuals[21].sv_id.satId = 23; + + test_msg.stec_residuals[22].residual = 9303; + test_msg.stec_residuals[22].sv_id.constellation = 123; + test_msg.stec_residuals[22].sv_id.satId = 230; + + test_msg.stec_residuals[23].residual = -23794; + test_msg.stec_residuals[23].sv_id.constellation = 255; + test_msg.stec_residuals[23].sv_id.satId = 184; + + test_msg.stec_residuals[24].residual = -26837; + test_msg.stec_residuals[24].sv_id.constellation = 224; + test_msg.stec_residuals[24].sv_id.satId = 187; + + test_msg.stec_residuals[25].residual = 14631; + test_msg.stec_residuals[25].sv_id.constellation = 104; + test_msg.stec_residuals[25].sv_id.satId = 151; + + test_msg.stec_residuals[26].residual = -8144; + test_msg.stec_residuals[26].sv_id.constellation = 54; + test_msg.stec_residuals[26].sv_id.satId = 5; + + test_msg.stec_residuals[27].residual = 23612; + test_msg.stec_residuals[27].sv_id.constellation = 129; + test_msg.stec_residuals[27].sv_id.satId = 181; + + test_msg.stec_residuals[28].residual = 28013; + test_msg.stec_residuals[28].sv_id.constellation = 114; + test_msg.stec_residuals[28].sv_id.satId = 171; + + test_msg.stec_residuals[29].residual = 2166; + test_msg.stec_residuals[29].sv_id.constellation = 23; + test_msg.stec_residuals[29].sv_id.satId = 12; + + test_msg.stec_residuals[30].residual = -10186; + test_msg.stec_residuals[30].sv_id.constellation = 159; + test_msg.stec_residuals[30].sv_id.satId = 64; + + test_msg.stec_residuals[31].residual = 17432; + test_msg.stec_residuals[31].sv_id.constellation = 20; + test_msg.stec_residuals[31].sv_id.satId = 33; + + test_msg.stec_residuals[32].residual = -8666; + test_msg.stec_residuals[32].sv_id.constellation = 36; + test_msg.stec_residuals[32].sv_id.satId = 160; + + test_msg.stec_residuals[33].residual = 25436; + test_msg.stec_residuals[33].sv_id.constellation = 190; + test_msg.stec_residuals[33].sv_id.satId = 145; + + test_msg.stec_residuals[34].residual = -3864; + test_msg.stec_residuals[34].sv_id.constellation = 159; + test_msg.stec_residuals[34].sv_id.satId = 108; + + test_msg.stec_residuals[35].residual = 4093; + test_msg.stec_residuals[35].sv_id.constellation = 221; + test_msg.stec_residuals[35].sv_id.satId = 227; + + test_msg.stec_residuals[36].residual = -18055; + test_msg.stec_residuals[36].sv_id.constellation = 23; + test_msg.stec_residuals[36].sv_id.satId = 62; + + test_msg.stec_residuals[37].residual = -27900; + test_msg.stec_residuals[37].sv_id.constellation = 116; + test_msg.stec_residuals[37].sv_id.satId = 168; + + test_msg.stec_residuals[38].residual = 30687; + test_msg.stec_residuals[38].sv_id.constellation = 72; + test_msg.stec_residuals[38].sv_id.satId = 123; + + test_msg.stec_residuals[39].residual = -13151; + test_msg.stec_residuals[39].sv_id.constellation = 242; + test_msg.stec_residuals[39].sv_id.satId = 226; + + test_msg.stec_residuals[40].residual = -22903; + test_msg.stec_residuals[40].sv_id.constellation = 202; + test_msg.stec_residuals[40].sv_id.satId = 180; + + test_msg.stec_residuals[41].residual = 4988; + test_msg.stec_residuals[41].sv_id.constellation = 24; + test_msg.stec_residuals[41].sv_id.satId = 58; + + test_msg.stec_residuals[42].residual = 27408; + test_msg.stec_residuals[42].sv_id.constellation = 188; + test_msg.stec_residuals[42].sv_id.satId = 181; + + test_msg.stec_residuals[43].residual = 319; + test_msg.stec_residuals[43].sv_id.constellation = 231; + test_msg.stec_residuals[43].sv_id.satId = 66; + + test_msg.stec_residuals[44].residual = 15987; + test_msg.stec_residuals[44].sv_id.constellation = 252; + test_msg.stec_residuals[44].sv_id.satId = 64; + + test_msg.stec_residuals[45].residual = 22266; + test_msg.stec_residuals[45].sv_id.constellation = 97; + test_msg.stec_residuals[45].sv_id.satId = 233; + + test_msg.stec_residuals[46].residual = -19919; + test_msg.stec_residuals[46].sv_id.constellation = 221; + test_msg.stec_residuals[46].sv_id.satId = 156; + + test_msg.stec_residuals[47].residual = 17350; + test_msg.stec_residuals[47].sv_id.constellation = 73; + test_msg.stec_residuals[47].sv_id.satId = 32; + + test_msg.stec_residuals[48].residual = 14410; + test_msg.stec_residuals[48].sv_id.constellation = 253; + test_msg.stec_residuals[48].sv_id.satId = 249; + + test_msg.stec_residuals[49].residual = 23671; + test_msg.stec_residuals[49].sv_id.constellation = 165; + test_msg.stec_residuals[49].sv_id.satId = 38; + + test_msg.stec_residuals[50].residual = -31905; + test_msg.stec_residuals[50].sv_id.constellation = 44; + test_msg.stec_residuals[50].sv_id.satId = 99; + + test_msg.stec_residuals[51].residual = 14305; + test_msg.stec_residuals[51].sv_id.constellation = 192; + test_msg.stec_residuals[51].sv_id.satId = 89; + + test_msg.stec_residuals[52].residual = -12968; + test_msg.stec_residuals[52].sv_id.constellation = 171; + test_msg.stec_residuals[52].sv_id.satId = 95; + + test_msg.stec_residuals[53].residual = 21479; + test_msg.stec_residuals[53].sv_id.constellation = 116; + test_msg.stec_residuals[53].sv_id.satId = 21; + + test_msg.stec_residuals[54].residual = 28260; + test_msg.stec_residuals[54].sv_id.constellation = 71; + test_msg.stec_residuals[54].sv_id.satId = 71; + + test_msg.stec_residuals[55].residual = -11112; + test_msg.stec_residuals[55].sv_id.constellation = 254; + test_msg.stec_residuals[55].sv_id.satId = 217; + + test_msg.stec_residuals[56].residual = -25304; + test_msg.stec_residuals[56].sv_id.constellation = 8; + test_msg.stec_residuals[56].sv_id.satId = 18; + + test_msg.stec_residuals[57].residual = -4024; + test_msg.stec_residuals[57].sv_id.constellation = 54; + test_msg.stec_residuals[57].sv_id.satId = 244; + + test_msg.stec_residuals[58].residual = -15505; + test_msg.stec_residuals[58].sv_id.constellation = 189; + test_msg.stec_residuals[58].sv_id.satId = 231; + test_msg.tropo_delay_correction.hydro = 16250; + test_msg.tropo_delay_correction.wet = 101; + + EXPECT_EQ(send_message(7270, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 7270); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.iod_atmo, 236) + << "incorrect value for last_msg_.header.iod_atmo, expected 236, is " + << last_msg_.header.iod_atmo; + EXPECT_EQ(last_msg_.header.num_msgs, 62837) + << "incorrect value for last_msg_.header.num_msgs, expected 62837, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.seq_num, 63555) + << "incorrect value for last_msg_.header.seq_num, expected 63555, is " + << last_msg_.header.seq_num; + EXPECT_EQ(last_msg_.header.time.tow, 2837573811) + << "incorrect value for last_msg_.header.time.tow, expected 2837573811, " + "is " + << last_msg_.header.time.tow; + EXPECT_EQ(last_msg_.header.time.wn, 8940) + << "incorrect value for last_msg_.header.time.wn, expected 8940, is " + << last_msg_.header.time.wn; + EXPECT_EQ(last_msg_.header.tropo_quality_indicator, 230) + << "incorrect value for last_msg_.header.tropo_quality_indicator, " + "expected 230, is " + << last_msg_.header.tropo_quality_indicator; + EXPECT_EQ(last_msg_.header.update_interval, 233) + << "incorrect value for last_msg_.header.update_interval, expected 233, " + "is " + << last_msg_.header.update_interval; + EXPECT_EQ(last_msg_.index, 26598) + << "incorrect value for last_msg_.index, expected 26598, is " + << last_msg_.index; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_stec_residuals.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_stec_residuals.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_stec_residuals.handle_as + << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)101, (char)99, + (char)95, (char)114, (char)101, (char)115, + (char)105, (char)100, (char)117, (char)97, + (char)108, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_stec_residuals.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_stec_residuals.relates_to, " + "expected string '" + << check_string << "', is '" << last_msg_.n_stec_residuals.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_stec_residuals.value, 59) + << "incorrect value for last_msg_.n_stec_residuals.value, expected 59, " + "is " + << last_msg_.n_stec_residuals.value; + EXPECT_EQ(last_msg_.stec_residuals[0].residual, -23949) + << "incorrect value for last_msg_.stec_residuals[0].residual, expected " + "-23949, is " + << last_msg_.stec_residuals[0].residual; + EXPECT_EQ(last_msg_.stec_residuals[0].sv_id.constellation, 157) + << "incorrect value for last_msg_.stec_residuals[0].sv_id.constellation, " + "expected 157, is " + << last_msg_.stec_residuals[0].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[0].sv_id.satId, 231) + << "incorrect value for last_msg_.stec_residuals[0].sv_id.satId, " + "expected 231, is " + << last_msg_.stec_residuals[0].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[1].residual, 27427) + << "incorrect value for last_msg_.stec_residuals[1].residual, expected " + "27427, is " + << last_msg_.stec_residuals[1].residual; + EXPECT_EQ(last_msg_.stec_residuals[1].sv_id.constellation, 146) + << "incorrect value for last_msg_.stec_residuals[1].sv_id.constellation, " + "expected 146, is " + << last_msg_.stec_residuals[1].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[1].sv_id.satId, 197) + << "incorrect value for last_msg_.stec_residuals[1].sv_id.satId, " + "expected 197, is " + << last_msg_.stec_residuals[1].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[2].residual, 10548) + << "incorrect value for last_msg_.stec_residuals[2].residual, expected " + "10548, is " + << last_msg_.stec_residuals[2].residual; + EXPECT_EQ(last_msg_.stec_residuals[2].sv_id.constellation, 109) + << "incorrect value for last_msg_.stec_residuals[2].sv_id.constellation, " + "expected 109, is " + << last_msg_.stec_residuals[2].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[2].sv_id.satId, 222) + << "incorrect value for last_msg_.stec_residuals[2].sv_id.satId, " + "expected 222, is " + << last_msg_.stec_residuals[2].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[3].residual, -18195) + << "incorrect value for last_msg_.stec_residuals[3].residual, expected " + "-18195, is " + << last_msg_.stec_residuals[3].residual; + EXPECT_EQ(last_msg_.stec_residuals[3].sv_id.constellation, 12) + << "incorrect value for last_msg_.stec_residuals[3].sv_id.constellation, " + "expected 12, is " + << last_msg_.stec_residuals[3].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[3].sv_id.satId, 86) + << "incorrect value for last_msg_.stec_residuals[3].sv_id.satId, " + "expected 86, is " + << last_msg_.stec_residuals[3].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[4].residual, -27511) + << "incorrect value for last_msg_.stec_residuals[4].residual, expected " + "-27511, is " + << last_msg_.stec_residuals[4].residual; + EXPECT_EQ(last_msg_.stec_residuals[4].sv_id.constellation, 204) + << "incorrect value for last_msg_.stec_residuals[4].sv_id.constellation, " + "expected 204, is " + << last_msg_.stec_residuals[4].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[4].sv_id.satId, 65) + << "incorrect value for last_msg_.stec_residuals[4].sv_id.satId, " + "expected 65, is " + << last_msg_.stec_residuals[4].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[5].residual, 11) + << "incorrect value for last_msg_.stec_residuals[5].residual, expected " + "11, is " + << last_msg_.stec_residuals[5].residual; + EXPECT_EQ(last_msg_.stec_residuals[5].sv_id.constellation, 183) + << "incorrect value for last_msg_.stec_residuals[5].sv_id.constellation, " + "expected 183, is " + << last_msg_.stec_residuals[5].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[5].sv_id.satId, 171) + << "incorrect value for last_msg_.stec_residuals[5].sv_id.satId, " + "expected 171, is " + << last_msg_.stec_residuals[5].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[6].residual, 13740) + << "incorrect value for last_msg_.stec_residuals[6].residual, expected " + "13740, is " + << last_msg_.stec_residuals[6].residual; + EXPECT_EQ(last_msg_.stec_residuals[6].sv_id.constellation, 203) + << "incorrect value for last_msg_.stec_residuals[6].sv_id.constellation, " + "expected 203, is " + << last_msg_.stec_residuals[6].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[6].sv_id.satId, 180) + << "incorrect value for last_msg_.stec_residuals[6].sv_id.satId, " + "expected 180, is " + << last_msg_.stec_residuals[6].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[7].residual, 29626) + << "incorrect value for last_msg_.stec_residuals[7].residual, expected " + "29626, is " + << last_msg_.stec_residuals[7].residual; + EXPECT_EQ(last_msg_.stec_residuals[7].sv_id.constellation, 85) + << "incorrect value for last_msg_.stec_residuals[7].sv_id.constellation, " + "expected 85, is " + << last_msg_.stec_residuals[7].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[7].sv_id.satId, 196) + << "incorrect value for last_msg_.stec_residuals[7].sv_id.satId, " + "expected 196, is " + << last_msg_.stec_residuals[7].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[8].residual, 7846) + << "incorrect value for last_msg_.stec_residuals[8].residual, expected " + "7846, is " + << last_msg_.stec_residuals[8].residual; + EXPECT_EQ(last_msg_.stec_residuals[8].sv_id.constellation, 92) + << "incorrect value for last_msg_.stec_residuals[8].sv_id.constellation, " + "expected 92, is " + << last_msg_.stec_residuals[8].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[8].sv_id.satId, 203) + << "incorrect value for last_msg_.stec_residuals[8].sv_id.satId, " + "expected 203, is " + << last_msg_.stec_residuals[8].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[9].residual, 18376) + << "incorrect value for last_msg_.stec_residuals[9].residual, expected " + "18376, is " + << last_msg_.stec_residuals[9].residual; + EXPECT_EQ(last_msg_.stec_residuals[9].sv_id.constellation, 13) + << "incorrect value for last_msg_.stec_residuals[9].sv_id.constellation, " + "expected 13, is " + << last_msg_.stec_residuals[9].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[9].sv_id.satId, 42) + << "incorrect value for last_msg_.stec_residuals[9].sv_id.satId, " + "expected 42, is " + << last_msg_.stec_residuals[9].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[10].residual, -24357) + << "incorrect value for last_msg_.stec_residuals[10].residual, expected " + "-24357, is " + << last_msg_.stec_residuals[10].residual; + EXPECT_EQ(last_msg_.stec_residuals[10].sv_id.constellation, 137) + << "incorrect value for " + "last_msg_.stec_residuals[10].sv_id.constellation, expected 137, is " + << last_msg_.stec_residuals[10].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[10].sv_id.satId, 98) + << "incorrect value for last_msg_.stec_residuals[10].sv_id.satId, " + "expected 98, is " + << last_msg_.stec_residuals[10].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[11].residual, -1441) + << "incorrect value for last_msg_.stec_residuals[11].residual, expected " + "-1441, is " + << last_msg_.stec_residuals[11].residual; + EXPECT_EQ(last_msg_.stec_residuals[11].sv_id.constellation, 216) + << "incorrect value for " + "last_msg_.stec_residuals[11].sv_id.constellation, expected 216, is " + << last_msg_.stec_residuals[11].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[11].sv_id.satId, 95) + << "incorrect value for last_msg_.stec_residuals[11].sv_id.satId, " + "expected 95, is " + << last_msg_.stec_residuals[11].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[12].residual, -10660) + << "incorrect value for last_msg_.stec_residuals[12].residual, expected " + "-10660, is " + << last_msg_.stec_residuals[12].residual; + EXPECT_EQ(last_msg_.stec_residuals[12].sv_id.constellation, 196) + << "incorrect value for " + "last_msg_.stec_residuals[12].sv_id.constellation, expected 196, is " + << last_msg_.stec_residuals[12].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[12].sv_id.satId, 99) + << "incorrect value for last_msg_.stec_residuals[12].sv_id.satId, " + "expected 99, is " + << last_msg_.stec_residuals[12].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[13].residual, -8509) + << "incorrect value for last_msg_.stec_residuals[13].residual, expected " + "-8509, is " + << last_msg_.stec_residuals[13].residual; + EXPECT_EQ(last_msg_.stec_residuals[13].sv_id.constellation, 253) + << "incorrect value for " + "last_msg_.stec_residuals[13].sv_id.constellation, expected 253, is " + << last_msg_.stec_residuals[13].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[13].sv_id.satId, 159) + << "incorrect value for last_msg_.stec_residuals[13].sv_id.satId, " + "expected 159, is " + << last_msg_.stec_residuals[13].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[14].residual, 16361) + << "incorrect value for last_msg_.stec_residuals[14].residual, expected " + "16361, is " + << last_msg_.stec_residuals[14].residual; + EXPECT_EQ(last_msg_.stec_residuals[14].sv_id.constellation, 146) + << "incorrect value for " + "last_msg_.stec_residuals[14].sv_id.constellation, expected 146, is " + << last_msg_.stec_residuals[14].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[14].sv_id.satId, 233) + << "incorrect value for last_msg_.stec_residuals[14].sv_id.satId, " + "expected 233, is " + << last_msg_.stec_residuals[14].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[15].residual, 10346) + << "incorrect value for last_msg_.stec_residuals[15].residual, expected " + "10346, is " + << last_msg_.stec_residuals[15].residual; + EXPECT_EQ(last_msg_.stec_residuals[15].sv_id.constellation, 24) + << "incorrect value for " + "last_msg_.stec_residuals[15].sv_id.constellation, expected 24, is " + << last_msg_.stec_residuals[15].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[15].sv_id.satId, 76) + << "incorrect value for last_msg_.stec_residuals[15].sv_id.satId, " + "expected 76, is " + << last_msg_.stec_residuals[15].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[16].residual, -18679) + << "incorrect value for last_msg_.stec_residuals[16].residual, expected " + "-18679, is " + << last_msg_.stec_residuals[16].residual; + EXPECT_EQ(last_msg_.stec_residuals[16].sv_id.constellation, 65) + << "incorrect value for " + "last_msg_.stec_residuals[16].sv_id.constellation, expected 65, is " + << last_msg_.stec_residuals[16].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[16].sv_id.satId, 253) + << "incorrect value for last_msg_.stec_residuals[16].sv_id.satId, " + "expected 253, is " + << last_msg_.stec_residuals[16].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[17].residual, 15292) + << "incorrect value for last_msg_.stec_residuals[17].residual, expected " + "15292, is " + << last_msg_.stec_residuals[17].residual; + EXPECT_EQ(last_msg_.stec_residuals[17].sv_id.constellation, 215) + << "incorrect value for " + "last_msg_.stec_residuals[17].sv_id.constellation, expected 215, is " + << last_msg_.stec_residuals[17].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[17].sv_id.satId, 40) + << "incorrect value for last_msg_.stec_residuals[17].sv_id.satId, " + "expected 40, is " + << last_msg_.stec_residuals[17].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[18].residual, 29537) + << "incorrect value for last_msg_.stec_residuals[18].residual, expected " + "29537, is " + << last_msg_.stec_residuals[18].residual; + EXPECT_EQ(last_msg_.stec_residuals[18].sv_id.constellation, 69) + << "incorrect value for " + "last_msg_.stec_residuals[18].sv_id.constellation, expected 69, is " + << last_msg_.stec_residuals[18].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[18].sv_id.satId, 117) + << "incorrect value for last_msg_.stec_residuals[18].sv_id.satId, " + "expected 117, is " + << last_msg_.stec_residuals[18].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[19].residual, -29440) + << "incorrect value for last_msg_.stec_residuals[19].residual, expected " + "-29440, is " + << last_msg_.stec_residuals[19].residual; + EXPECT_EQ(last_msg_.stec_residuals[19].sv_id.constellation, 56) + << "incorrect value for " + "last_msg_.stec_residuals[19].sv_id.constellation, expected 56, is " + << last_msg_.stec_residuals[19].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[19].sv_id.satId, 60) + << "incorrect value for last_msg_.stec_residuals[19].sv_id.satId, " + "expected 60, is " + << last_msg_.stec_residuals[19].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[20].residual, -24266) + << "incorrect value for last_msg_.stec_residuals[20].residual, expected " + "-24266, is " + << last_msg_.stec_residuals[20].residual; + EXPECT_EQ(last_msg_.stec_residuals[20].sv_id.constellation, 171) + << "incorrect value for " + "last_msg_.stec_residuals[20].sv_id.constellation, expected 171, is " + << last_msg_.stec_residuals[20].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[20].sv_id.satId, 207) + << "incorrect value for last_msg_.stec_residuals[20].sv_id.satId, " + "expected 207, is " + << last_msg_.stec_residuals[20].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[21].residual, 22272) + << "incorrect value for last_msg_.stec_residuals[21].residual, expected " + "22272, is " + << last_msg_.stec_residuals[21].residual; + EXPECT_EQ(last_msg_.stec_residuals[21].sv_id.constellation, 61) + << "incorrect value for " + "last_msg_.stec_residuals[21].sv_id.constellation, expected 61, is " + << last_msg_.stec_residuals[21].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[21].sv_id.satId, 23) + << "incorrect value for last_msg_.stec_residuals[21].sv_id.satId, " + "expected 23, is " + << last_msg_.stec_residuals[21].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[22].residual, 9303) + << "incorrect value for last_msg_.stec_residuals[22].residual, expected " + "9303, is " + << last_msg_.stec_residuals[22].residual; + EXPECT_EQ(last_msg_.stec_residuals[22].sv_id.constellation, 123) + << "incorrect value for " + "last_msg_.stec_residuals[22].sv_id.constellation, expected 123, is " + << last_msg_.stec_residuals[22].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[22].sv_id.satId, 230) + << "incorrect value for last_msg_.stec_residuals[22].sv_id.satId, " + "expected 230, is " + << last_msg_.stec_residuals[22].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[23].residual, -23794) + << "incorrect value for last_msg_.stec_residuals[23].residual, expected " + "-23794, is " + << last_msg_.stec_residuals[23].residual; + EXPECT_EQ(last_msg_.stec_residuals[23].sv_id.constellation, 255) + << "incorrect value for " + "last_msg_.stec_residuals[23].sv_id.constellation, expected 255, is " + << last_msg_.stec_residuals[23].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[23].sv_id.satId, 184) + << "incorrect value for last_msg_.stec_residuals[23].sv_id.satId, " + "expected 184, is " + << last_msg_.stec_residuals[23].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[24].residual, -26837) + << "incorrect value for last_msg_.stec_residuals[24].residual, expected " + "-26837, is " + << last_msg_.stec_residuals[24].residual; + EXPECT_EQ(last_msg_.stec_residuals[24].sv_id.constellation, 224) + << "incorrect value for " + "last_msg_.stec_residuals[24].sv_id.constellation, expected 224, is " + << last_msg_.stec_residuals[24].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[24].sv_id.satId, 187) + << "incorrect value for last_msg_.stec_residuals[24].sv_id.satId, " + "expected 187, is " + << last_msg_.stec_residuals[24].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[25].residual, 14631) + << "incorrect value for last_msg_.stec_residuals[25].residual, expected " + "14631, is " + << last_msg_.stec_residuals[25].residual; + EXPECT_EQ(last_msg_.stec_residuals[25].sv_id.constellation, 104) + << "incorrect value for " + "last_msg_.stec_residuals[25].sv_id.constellation, expected 104, is " + << last_msg_.stec_residuals[25].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[25].sv_id.satId, 151) + << "incorrect value for last_msg_.stec_residuals[25].sv_id.satId, " + "expected 151, is " + << last_msg_.stec_residuals[25].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[26].residual, -8144) + << "incorrect value for last_msg_.stec_residuals[26].residual, expected " + "-8144, is " + << last_msg_.stec_residuals[26].residual; + EXPECT_EQ(last_msg_.stec_residuals[26].sv_id.constellation, 54) + << "incorrect value for " + "last_msg_.stec_residuals[26].sv_id.constellation, expected 54, is " + << last_msg_.stec_residuals[26].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[26].sv_id.satId, 5) + << "incorrect value for last_msg_.stec_residuals[26].sv_id.satId, " + "expected 5, is " + << last_msg_.stec_residuals[26].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[27].residual, 23612) + << "incorrect value for last_msg_.stec_residuals[27].residual, expected " + "23612, is " + << last_msg_.stec_residuals[27].residual; + EXPECT_EQ(last_msg_.stec_residuals[27].sv_id.constellation, 129) + << "incorrect value for " + "last_msg_.stec_residuals[27].sv_id.constellation, expected 129, is " + << last_msg_.stec_residuals[27].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[27].sv_id.satId, 181) + << "incorrect value for last_msg_.stec_residuals[27].sv_id.satId, " + "expected 181, is " + << last_msg_.stec_residuals[27].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[28].residual, 28013) + << "incorrect value for last_msg_.stec_residuals[28].residual, expected " + "28013, is " + << last_msg_.stec_residuals[28].residual; + EXPECT_EQ(last_msg_.stec_residuals[28].sv_id.constellation, 114) + << "incorrect value for " + "last_msg_.stec_residuals[28].sv_id.constellation, expected 114, is " + << last_msg_.stec_residuals[28].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[28].sv_id.satId, 171) + << "incorrect value for last_msg_.stec_residuals[28].sv_id.satId, " + "expected 171, is " + << last_msg_.stec_residuals[28].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[29].residual, 2166) + << "incorrect value for last_msg_.stec_residuals[29].residual, expected " + "2166, is " + << last_msg_.stec_residuals[29].residual; + EXPECT_EQ(last_msg_.stec_residuals[29].sv_id.constellation, 23) + << "incorrect value for " + "last_msg_.stec_residuals[29].sv_id.constellation, expected 23, is " + << last_msg_.stec_residuals[29].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[29].sv_id.satId, 12) + << "incorrect value for last_msg_.stec_residuals[29].sv_id.satId, " + "expected 12, is " + << last_msg_.stec_residuals[29].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[30].residual, -10186) + << "incorrect value for last_msg_.stec_residuals[30].residual, expected " + "-10186, is " + << last_msg_.stec_residuals[30].residual; + EXPECT_EQ(last_msg_.stec_residuals[30].sv_id.constellation, 159) + << "incorrect value for " + "last_msg_.stec_residuals[30].sv_id.constellation, expected 159, is " + << last_msg_.stec_residuals[30].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[30].sv_id.satId, 64) + << "incorrect value for last_msg_.stec_residuals[30].sv_id.satId, " + "expected 64, is " + << last_msg_.stec_residuals[30].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[31].residual, 17432) + << "incorrect value for last_msg_.stec_residuals[31].residual, expected " + "17432, is " + << last_msg_.stec_residuals[31].residual; + EXPECT_EQ(last_msg_.stec_residuals[31].sv_id.constellation, 20) + << "incorrect value for " + "last_msg_.stec_residuals[31].sv_id.constellation, expected 20, is " + << last_msg_.stec_residuals[31].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[31].sv_id.satId, 33) + << "incorrect value for last_msg_.stec_residuals[31].sv_id.satId, " + "expected 33, is " + << last_msg_.stec_residuals[31].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[32].residual, -8666) + << "incorrect value for last_msg_.stec_residuals[32].residual, expected " + "-8666, is " + << last_msg_.stec_residuals[32].residual; + EXPECT_EQ(last_msg_.stec_residuals[32].sv_id.constellation, 36) + << "incorrect value for " + "last_msg_.stec_residuals[32].sv_id.constellation, expected 36, is " + << last_msg_.stec_residuals[32].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[32].sv_id.satId, 160) + << "incorrect value for last_msg_.stec_residuals[32].sv_id.satId, " + "expected 160, is " + << last_msg_.stec_residuals[32].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[33].residual, 25436) + << "incorrect value for last_msg_.stec_residuals[33].residual, expected " + "25436, is " + << last_msg_.stec_residuals[33].residual; + EXPECT_EQ(last_msg_.stec_residuals[33].sv_id.constellation, 190) + << "incorrect value for " + "last_msg_.stec_residuals[33].sv_id.constellation, expected 190, is " + << last_msg_.stec_residuals[33].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[33].sv_id.satId, 145) + << "incorrect value for last_msg_.stec_residuals[33].sv_id.satId, " + "expected 145, is " + << last_msg_.stec_residuals[33].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[34].residual, -3864) + << "incorrect value for last_msg_.stec_residuals[34].residual, expected " + "-3864, is " + << last_msg_.stec_residuals[34].residual; + EXPECT_EQ(last_msg_.stec_residuals[34].sv_id.constellation, 159) + << "incorrect value for " + "last_msg_.stec_residuals[34].sv_id.constellation, expected 159, is " + << last_msg_.stec_residuals[34].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[34].sv_id.satId, 108) + << "incorrect value for last_msg_.stec_residuals[34].sv_id.satId, " + "expected 108, is " + << last_msg_.stec_residuals[34].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[35].residual, 4093) + << "incorrect value for last_msg_.stec_residuals[35].residual, expected " + "4093, is " + << last_msg_.stec_residuals[35].residual; + EXPECT_EQ(last_msg_.stec_residuals[35].sv_id.constellation, 221) + << "incorrect value for " + "last_msg_.stec_residuals[35].sv_id.constellation, expected 221, is " + << last_msg_.stec_residuals[35].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[35].sv_id.satId, 227) + << "incorrect value for last_msg_.stec_residuals[35].sv_id.satId, " + "expected 227, is " + << last_msg_.stec_residuals[35].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[36].residual, -18055) + << "incorrect value for last_msg_.stec_residuals[36].residual, expected " + "-18055, is " + << last_msg_.stec_residuals[36].residual; + EXPECT_EQ(last_msg_.stec_residuals[36].sv_id.constellation, 23) + << "incorrect value for " + "last_msg_.stec_residuals[36].sv_id.constellation, expected 23, is " + << last_msg_.stec_residuals[36].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[36].sv_id.satId, 62) + << "incorrect value for last_msg_.stec_residuals[36].sv_id.satId, " + "expected 62, is " + << last_msg_.stec_residuals[36].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[37].residual, -27900) + << "incorrect value for last_msg_.stec_residuals[37].residual, expected " + "-27900, is " + << last_msg_.stec_residuals[37].residual; + EXPECT_EQ(last_msg_.stec_residuals[37].sv_id.constellation, 116) + << "incorrect value for " + "last_msg_.stec_residuals[37].sv_id.constellation, expected 116, is " + << last_msg_.stec_residuals[37].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[37].sv_id.satId, 168) + << "incorrect value for last_msg_.stec_residuals[37].sv_id.satId, " + "expected 168, is " + << last_msg_.stec_residuals[37].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[38].residual, 30687) + << "incorrect value for last_msg_.stec_residuals[38].residual, expected " + "30687, is " + << last_msg_.stec_residuals[38].residual; + EXPECT_EQ(last_msg_.stec_residuals[38].sv_id.constellation, 72) + << "incorrect value for " + "last_msg_.stec_residuals[38].sv_id.constellation, expected 72, is " + << last_msg_.stec_residuals[38].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[38].sv_id.satId, 123) + << "incorrect value for last_msg_.stec_residuals[38].sv_id.satId, " + "expected 123, is " + << last_msg_.stec_residuals[38].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[39].residual, -13151) + << "incorrect value for last_msg_.stec_residuals[39].residual, expected " + "-13151, is " + << last_msg_.stec_residuals[39].residual; + EXPECT_EQ(last_msg_.stec_residuals[39].sv_id.constellation, 242) + << "incorrect value for " + "last_msg_.stec_residuals[39].sv_id.constellation, expected 242, is " + << last_msg_.stec_residuals[39].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[39].sv_id.satId, 226) + << "incorrect value for last_msg_.stec_residuals[39].sv_id.satId, " + "expected 226, is " + << last_msg_.stec_residuals[39].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[40].residual, -22903) + << "incorrect value for last_msg_.stec_residuals[40].residual, expected " + "-22903, is " + << last_msg_.stec_residuals[40].residual; + EXPECT_EQ(last_msg_.stec_residuals[40].sv_id.constellation, 202) + << "incorrect value for " + "last_msg_.stec_residuals[40].sv_id.constellation, expected 202, is " + << last_msg_.stec_residuals[40].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[40].sv_id.satId, 180) + << "incorrect value for last_msg_.stec_residuals[40].sv_id.satId, " + "expected 180, is " + << last_msg_.stec_residuals[40].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[41].residual, 4988) + << "incorrect value for last_msg_.stec_residuals[41].residual, expected " + "4988, is " + << last_msg_.stec_residuals[41].residual; + EXPECT_EQ(last_msg_.stec_residuals[41].sv_id.constellation, 24) + << "incorrect value for " + "last_msg_.stec_residuals[41].sv_id.constellation, expected 24, is " + << last_msg_.stec_residuals[41].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[41].sv_id.satId, 58) + << "incorrect value for last_msg_.stec_residuals[41].sv_id.satId, " + "expected 58, is " + << last_msg_.stec_residuals[41].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[42].residual, 27408) + << "incorrect value for last_msg_.stec_residuals[42].residual, expected " + "27408, is " + << last_msg_.stec_residuals[42].residual; + EXPECT_EQ(last_msg_.stec_residuals[42].sv_id.constellation, 188) + << "incorrect value for " + "last_msg_.stec_residuals[42].sv_id.constellation, expected 188, is " + << last_msg_.stec_residuals[42].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[42].sv_id.satId, 181) + << "incorrect value for last_msg_.stec_residuals[42].sv_id.satId, " + "expected 181, is " + << last_msg_.stec_residuals[42].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[43].residual, 319) + << "incorrect value for last_msg_.stec_residuals[43].residual, expected " + "319, is " + << last_msg_.stec_residuals[43].residual; + EXPECT_EQ(last_msg_.stec_residuals[43].sv_id.constellation, 231) + << "incorrect value for " + "last_msg_.stec_residuals[43].sv_id.constellation, expected 231, is " + << last_msg_.stec_residuals[43].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[43].sv_id.satId, 66) + << "incorrect value for last_msg_.stec_residuals[43].sv_id.satId, " + "expected 66, is " + << last_msg_.stec_residuals[43].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[44].residual, 15987) + << "incorrect value for last_msg_.stec_residuals[44].residual, expected " + "15987, is " + << last_msg_.stec_residuals[44].residual; + EXPECT_EQ(last_msg_.stec_residuals[44].sv_id.constellation, 252) + << "incorrect value for " + "last_msg_.stec_residuals[44].sv_id.constellation, expected 252, is " + << last_msg_.stec_residuals[44].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[44].sv_id.satId, 64) + << "incorrect value for last_msg_.stec_residuals[44].sv_id.satId, " + "expected 64, is " + << last_msg_.stec_residuals[44].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[45].residual, 22266) + << "incorrect value for last_msg_.stec_residuals[45].residual, expected " + "22266, is " + << last_msg_.stec_residuals[45].residual; + EXPECT_EQ(last_msg_.stec_residuals[45].sv_id.constellation, 97) + << "incorrect value for " + "last_msg_.stec_residuals[45].sv_id.constellation, expected 97, is " + << last_msg_.stec_residuals[45].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[45].sv_id.satId, 233) + << "incorrect value for last_msg_.stec_residuals[45].sv_id.satId, " + "expected 233, is " + << last_msg_.stec_residuals[45].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[46].residual, -19919) + << "incorrect value for last_msg_.stec_residuals[46].residual, expected " + "-19919, is " + << last_msg_.stec_residuals[46].residual; + EXPECT_EQ(last_msg_.stec_residuals[46].sv_id.constellation, 221) + << "incorrect value for " + "last_msg_.stec_residuals[46].sv_id.constellation, expected 221, is " + << last_msg_.stec_residuals[46].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[46].sv_id.satId, 156) + << "incorrect value for last_msg_.stec_residuals[46].sv_id.satId, " + "expected 156, is " + << last_msg_.stec_residuals[46].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[47].residual, 17350) + << "incorrect value for last_msg_.stec_residuals[47].residual, expected " + "17350, is " + << last_msg_.stec_residuals[47].residual; + EXPECT_EQ(last_msg_.stec_residuals[47].sv_id.constellation, 73) + << "incorrect value for " + "last_msg_.stec_residuals[47].sv_id.constellation, expected 73, is " + << last_msg_.stec_residuals[47].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[47].sv_id.satId, 32) + << "incorrect value for last_msg_.stec_residuals[47].sv_id.satId, " + "expected 32, is " + << last_msg_.stec_residuals[47].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[48].residual, 14410) + << "incorrect value for last_msg_.stec_residuals[48].residual, expected " + "14410, is " + << last_msg_.stec_residuals[48].residual; + EXPECT_EQ(last_msg_.stec_residuals[48].sv_id.constellation, 253) + << "incorrect value for " + "last_msg_.stec_residuals[48].sv_id.constellation, expected 253, is " + << last_msg_.stec_residuals[48].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[48].sv_id.satId, 249) + << "incorrect value for last_msg_.stec_residuals[48].sv_id.satId, " + "expected 249, is " + << last_msg_.stec_residuals[48].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[49].residual, 23671) + << "incorrect value for last_msg_.stec_residuals[49].residual, expected " + "23671, is " + << last_msg_.stec_residuals[49].residual; + EXPECT_EQ(last_msg_.stec_residuals[49].sv_id.constellation, 165) + << "incorrect value for " + "last_msg_.stec_residuals[49].sv_id.constellation, expected 165, is " + << last_msg_.stec_residuals[49].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[49].sv_id.satId, 38) + << "incorrect value for last_msg_.stec_residuals[49].sv_id.satId, " + "expected 38, is " + << last_msg_.stec_residuals[49].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[50].residual, -31905) + << "incorrect value for last_msg_.stec_residuals[50].residual, expected " + "-31905, is " + << last_msg_.stec_residuals[50].residual; + EXPECT_EQ(last_msg_.stec_residuals[50].sv_id.constellation, 44) + << "incorrect value for " + "last_msg_.stec_residuals[50].sv_id.constellation, expected 44, is " + << last_msg_.stec_residuals[50].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[50].sv_id.satId, 99) + << "incorrect value for last_msg_.stec_residuals[50].sv_id.satId, " + "expected 99, is " + << last_msg_.stec_residuals[50].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[51].residual, 14305) + << "incorrect value for last_msg_.stec_residuals[51].residual, expected " + "14305, is " + << last_msg_.stec_residuals[51].residual; + EXPECT_EQ(last_msg_.stec_residuals[51].sv_id.constellation, 192) + << "incorrect value for " + "last_msg_.stec_residuals[51].sv_id.constellation, expected 192, is " + << last_msg_.stec_residuals[51].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[51].sv_id.satId, 89) + << "incorrect value for last_msg_.stec_residuals[51].sv_id.satId, " + "expected 89, is " + << last_msg_.stec_residuals[51].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[52].residual, -12968) + << "incorrect value for last_msg_.stec_residuals[52].residual, expected " + "-12968, is " + << last_msg_.stec_residuals[52].residual; + EXPECT_EQ(last_msg_.stec_residuals[52].sv_id.constellation, 171) + << "incorrect value for " + "last_msg_.stec_residuals[52].sv_id.constellation, expected 171, is " + << last_msg_.stec_residuals[52].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[52].sv_id.satId, 95) + << "incorrect value for last_msg_.stec_residuals[52].sv_id.satId, " + "expected 95, is " + << last_msg_.stec_residuals[52].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[53].residual, 21479) + << "incorrect value for last_msg_.stec_residuals[53].residual, expected " + "21479, is " + << last_msg_.stec_residuals[53].residual; + EXPECT_EQ(last_msg_.stec_residuals[53].sv_id.constellation, 116) + << "incorrect value for " + "last_msg_.stec_residuals[53].sv_id.constellation, expected 116, is " + << last_msg_.stec_residuals[53].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[53].sv_id.satId, 21) + << "incorrect value for last_msg_.stec_residuals[53].sv_id.satId, " + "expected 21, is " + << last_msg_.stec_residuals[53].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[54].residual, 28260) + << "incorrect value for last_msg_.stec_residuals[54].residual, expected " + "28260, is " + << last_msg_.stec_residuals[54].residual; + EXPECT_EQ(last_msg_.stec_residuals[54].sv_id.constellation, 71) + << "incorrect value for " + "last_msg_.stec_residuals[54].sv_id.constellation, expected 71, is " + << last_msg_.stec_residuals[54].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[54].sv_id.satId, 71) + << "incorrect value for last_msg_.stec_residuals[54].sv_id.satId, " + "expected 71, is " + << last_msg_.stec_residuals[54].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[55].residual, -11112) + << "incorrect value for last_msg_.stec_residuals[55].residual, expected " + "-11112, is " + << last_msg_.stec_residuals[55].residual; + EXPECT_EQ(last_msg_.stec_residuals[55].sv_id.constellation, 254) + << "incorrect value for " + "last_msg_.stec_residuals[55].sv_id.constellation, expected 254, is " + << last_msg_.stec_residuals[55].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[55].sv_id.satId, 217) + << "incorrect value for last_msg_.stec_residuals[55].sv_id.satId, " + "expected 217, is " + << last_msg_.stec_residuals[55].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[56].residual, -25304) + << "incorrect value for last_msg_.stec_residuals[56].residual, expected " + "-25304, is " + << last_msg_.stec_residuals[56].residual; + EXPECT_EQ(last_msg_.stec_residuals[56].sv_id.constellation, 8) + << "incorrect value for " + "last_msg_.stec_residuals[56].sv_id.constellation, expected 8, is " + << last_msg_.stec_residuals[56].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[56].sv_id.satId, 18) + << "incorrect value for last_msg_.stec_residuals[56].sv_id.satId, " + "expected 18, is " + << last_msg_.stec_residuals[56].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[57].residual, -4024) + << "incorrect value for last_msg_.stec_residuals[57].residual, expected " + "-4024, is " + << last_msg_.stec_residuals[57].residual; + EXPECT_EQ(last_msg_.stec_residuals[57].sv_id.constellation, 54) + << "incorrect value for " + "last_msg_.stec_residuals[57].sv_id.constellation, expected 54, is " + << last_msg_.stec_residuals[57].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[57].sv_id.satId, 244) + << "incorrect value for last_msg_.stec_residuals[57].sv_id.satId, " + "expected 244, is " + << last_msg_.stec_residuals[57].sv_id.satId; + EXPECT_EQ(last_msg_.stec_residuals[58].residual, -15505) + << "incorrect value for last_msg_.stec_residuals[58].residual, expected " + "-15505, is " + << last_msg_.stec_residuals[58].residual; + EXPECT_EQ(last_msg_.stec_residuals[58].sv_id.constellation, 189) + << "incorrect value for " + "last_msg_.stec_residuals[58].sv_id.constellation, expected 189, is " + << last_msg_.stec_residuals[58].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_residuals[58].sv_id.satId, 231) + << "incorrect value for last_msg_.stec_residuals[58].sv_id.satId, " + "expected 231, is " + << last_msg_.stec_residuals[58].sv_id.satId; + EXPECT_EQ(last_msg_.tropo_delay_correction.hydro, 16250) + << "incorrect value for last_msg_.tropo_delay_correction.hydro, expected " + "16250, is " + << last_msg_.tropo_delay_correction.hydro; + EXPECT_EQ(last_msg_.tropo_delay_correction.wet, 101) + << "incorrect value for last_msg_.tropo_delay_correction.wet, expected " + "101, is " + << last_msg_.tropo_delay_correction.wet; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClock.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClock.cc index 514fe26fc..2058ec44c 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClock.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClock.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClock.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClock.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrOrbitClock0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrOrbitClock0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrOrbitClock0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrOrbitClock0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_orbit_clock_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_orbit_clock_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,62 +67,97 @@ class Test_auto_check_sbp_ssr_MsgSsrOrbitClock0 : sbp_msg_ssr_orbit_clock_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrOrbitClock0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrOrbitClock0, Test) { + uint8_t encoded_frame[] = { + 85, 221, 5, 53, 229, 50, 83, 208, 102, 207, 164, 29, 203, 212, 236, + 255, 152, 233, 207, 55, 94, 54, 58, 128, 68, 27, 117, 176, 110, 251, + 61, 244, 122, 50, 95, 52, 144, 232, 24, 10, 37, 127, 163, 66, 177, + 105, 156, 245, 10, 249, 107, 218, 17, 186, 56, 72, 14, 22, + }; - uint8_t encoded_frame[] = {85,221,5,53,229,50,83,208,102,207,164,29,203,212,236,255,152,233,207,55,94,54,58,128,68,27,117,176,110,251,61,244,122,50,95,52,144,232,24,10,37,127,163,66,177,105,156,245,10,249,107,218,17,186,56,72,14,22, }; + sbp_msg_ssr_orbit_clock_t test_msg{}; + test_msg.along = -1334502588; + test_msg.c0 = -174298703; + test_msg.c1 = -630458102; + test_msg.c2 = 1211677201; + test_msg.cross = -197264530; + test_msg.dot_along = 169404560; + test_msg.dot_cross = 1118011173; + test_msg.dot_radial = 878654074; + test_msg.iod = 936372632; + test_msg.iod_ssr = 255; + test_msg.radial = -2143668642; + test_msg.sid.code = 212; + test_msg.sid.sat = 203; + test_msg.time.tow = 3479621715; + test_msg.time.wn = 7588; + test_msg.update_interval = 236; - sbp_msg_ssr_orbit_clock_t test_msg{}; - test_msg.along = -1334502588; - test_msg.c0 = -174298703; - test_msg.c1 = -630458102; - test_msg.c2 = 1211677201; - test_msg.cross = -197264530; - test_msg.dot_along = 169404560; - test_msg.dot_cross = 1118011173; - test_msg.dot_radial = 878654074; - test_msg.iod = 936372632; - test_msg.iod_ssr = 255; - test_msg.radial = -2143668642; - test_msg.sid.code = 212; - test_msg.sid.sat = 203; - test_msg.time.tow = 3479621715; - test_msg.time.wn = 7588; - test_msg.update_interval = 236; - - EXPECT_EQ(send_message( 58677, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(58677, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 58677); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.along, -1334502588) << "incorrect value for last_msg_.along, expected -1334502588, is " << last_msg_.along; - EXPECT_EQ(last_msg_.c0, -174298703) << "incorrect value for last_msg_.c0, expected -174298703, is " << last_msg_.c0; - EXPECT_EQ(last_msg_.c1, -630458102) << "incorrect value for last_msg_.c1, expected -630458102, is " << last_msg_.c1; - EXPECT_EQ(last_msg_.c2, 1211677201) << "incorrect value for last_msg_.c2, expected 1211677201, is " << last_msg_.c2; - EXPECT_EQ(last_msg_.cross, -197264530) << "incorrect value for last_msg_.cross, expected -197264530, is " << last_msg_.cross; - EXPECT_EQ(last_msg_.dot_along, 169404560) << "incorrect value for last_msg_.dot_along, expected 169404560, is " << last_msg_.dot_along; - EXPECT_EQ(last_msg_.dot_cross, 1118011173) << "incorrect value for last_msg_.dot_cross, expected 1118011173, is " << last_msg_.dot_cross; - EXPECT_EQ(last_msg_.dot_radial, 878654074) << "incorrect value for last_msg_.dot_radial, expected 878654074, is " << last_msg_.dot_radial; - EXPECT_EQ(last_msg_.iod, 936372632) << "incorrect value for last_msg_.iod, expected 936372632, is " << last_msg_.iod; - EXPECT_EQ(last_msg_.iod_ssr, 255) << "incorrect value for last_msg_.iod_ssr, expected 255, is " << last_msg_.iod_ssr; - EXPECT_EQ(last_msg_.radial, -2143668642) << "incorrect value for last_msg_.radial, expected -2143668642, is " << last_msg_.radial; - EXPECT_EQ(last_msg_.sid.code, 212) << "incorrect value for last_msg_.sid.code, expected 212, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.sat, 203) << "incorrect value for last_msg_.sid.sat, expected 203, is " << last_msg_.sid.sat; - EXPECT_EQ(last_msg_.time.tow, 3479621715) << "incorrect value for last_msg_.time.tow, expected 3479621715, is " << last_msg_.time.tow; - EXPECT_EQ(last_msg_.time.wn, 7588) << "incorrect value for last_msg_.time.wn, expected 7588, is " << last_msg_.time.wn; - EXPECT_EQ(last_msg_.update_interval, 236) << "incorrect value for last_msg_.update_interval, expected 236, is " << last_msg_.update_interval; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 58677); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.along, -1334502588) + << "incorrect value for last_msg_.along, expected -1334502588, is " + << last_msg_.along; + EXPECT_EQ(last_msg_.c0, -174298703) + << "incorrect value for last_msg_.c0, expected -174298703, is " + << last_msg_.c0; + EXPECT_EQ(last_msg_.c1, -630458102) + << "incorrect value for last_msg_.c1, expected -630458102, is " + << last_msg_.c1; + EXPECT_EQ(last_msg_.c2, 1211677201) + << "incorrect value for last_msg_.c2, expected 1211677201, is " + << last_msg_.c2; + EXPECT_EQ(last_msg_.cross, -197264530) + << "incorrect value for last_msg_.cross, expected -197264530, is " + << last_msg_.cross; + EXPECT_EQ(last_msg_.dot_along, 169404560) + << "incorrect value for last_msg_.dot_along, expected 169404560, is " + << last_msg_.dot_along; + EXPECT_EQ(last_msg_.dot_cross, 1118011173) + << "incorrect value for last_msg_.dot_cross, expected 1118011173, is " + << last_msg_.dot_cross; + EXPECT_EQ(last_msg_.dot_radial, 878654074) + << "incorrect value for last_msg_.dot_radial, expected 878654074, is " + << last_msg_.dot_radial; + EXPECT_EQ(last_msg_.iod, 936372632) + << "incorrect value for last_msg_.iod, expected 936372632, is " + << last_msg_.iod; + EXPECT_EQ(last_msg_.iod_ssr, 255) + << "incorrect value for last_msg_.iod_ssr, expected 255, is " + << last_msg_.iod_ssr; + EXPECT_EQ(last_msg_.radial, -2143668642) + << "incorrect value for last_msg_.radial, expected -2143668642, is " + << last_msg_.radial; + EXPECT_EQ(last_msg_.sid.code, 212) + << "incorrect value for last_msg_.sid.code, expected 212, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.sat, 203) + << "incorrect value for last_msg_.sid.sat, expected 203, is " + << last_msg_.sid.sat; + EXPECT_EQ(last_msg_.time.tow, 3479621715) + << "incorrect value for last_msg_.time.tow, expected 3479621715, is " + << last_msg_.time.tow; + EXPECT_EQ(last_msg_.time.wn, 7588) + << "incorrect value for last_msg_.time.wn, expected 7588, is " + << last_msg_.time.wn; + EXPECT_EQ(last_msg_.update_interval, 236) + << "incorrect value for last_msg_.update_interval, expected 236, is " + << last_msg_.update_interval; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.cc index 44ad89008..43ad84fa5 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBounds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBounds.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrOrbitClockBounds0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrOrbitClockBounds0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrOrbitClockBounds0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrOrbitClockBounds0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_orbit_clock_bounds_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_orbit_clock_bounds_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,102 +67,194 @@ class Test_auto_check_sbp_ssr_MsgSsrOrbitClockBounds0 : sbp_msg_ssr_orbit_clock_bounds_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrOrbitClockBounds0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrOrbitClockBounds0, Test) { + uint8_t encoded_frame[] = { + 85, 222, 5, 66, 0, 31, 180, 0, 0, 0, 3, 0, 1, + 2, 3, 48, 15, 1, 2, 24, 39, 38, 37, 1, 2, 3, + 39, 1, 3, 39, 38, 37, 1, 2, 3, 39, 1, 21, 85, + }; - uint8_t encoded_frame[] = {85,222,5,66,0,31,180,0,0,0,3,0,1,2,3,48,15,1,2,24,39,38,37,1,2,3,39,1,3,39,38,37,1,2,3,39,1,21,85, }; + sbp_msg_ssr_orbit_clock_bounds_t test_msg{}; + test_msg.const_id = 1; + test_msg.header.num_msgs = 1; + test_msg.header.seq_num = 2; + test_msg.header.sol_id = 48; + test_msg.header.time.tow = 180; + test_msg.header.time.wn = 3; + test_msg.header.update_interval = 3; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_sats.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = { + (char)111, (char)114, (char)98, (char)105, (char)116, (char)95, + (char)99, (char)108, (char)111, (char)99, (char)107, (char)95, + (char)98, (char)111, (char)117, (char)110, (char)100, (char)115}; + memcpy(test_msg.n_sats.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_sats.value = 2; + + test_msg.orbit_clock_bounds[0].clock_bound_mu = 39; + test_msg.orbit_clock_bounds[0].clock_bound_sig = 1; + test_msg.orbit_clock_bounds[0].orb_along_bound_mu = 38; + test_msg.orbit_clock_bounds[0].orb_along_bound_sig = 2; + test_msg.orbit_clock_bounds[0].orb_cross_bound_mu = 37; + test_msg.orbit_clock_bounds[0].orb_cross_bound_sig = 3; + test_msg.orbit_clock_bounds[0].orb_radial_bound_mu = 39; + test_msg.orbit_clock_bounds[0].orb_radial_bound_sig = 1; + test_msg.orbit_clock_bounds[0].sat_id = 24; + + test_msg.orbit_clock_bounds[1].clock_bound_mu = 39; + test_msg.orbit_clock_bounds[1].clock_bound_sig = 1; + test_msg.orbit_clock_bounds[1].orb_along_bound_mu = 38; + test_msg.orbit_clock_bounds[1].orb_along_bound_sig = 2; + test_msg.orbit_clock_bounds[1].orb_cross_bound_mu = 37; + test_msg.orbit_clock_bounds[1].orb_cross_bound_sig = 3; + test_msg.orbit_clock_bounds[1].orb_radial_bound_mu = 39; + test_msg.orbit_clock_bounds[1].orb_radial_bound_sig = 1; + test_msg.orbit_clock_bounds[1].sat_id = 3; + test_msg.ssr_iod = 15; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); - sbp_msg_ssr_orbit_clock_bounds_t test_msg{}; - test_msg.const_id = 1; - test_msg.header.num_msgs = 1; - test_msg.header.seq_num = 2; - test_msg.header.sol_id = 48; - test_msg.header.time.tow = 180; - test_msg.header.time.wn = 3; - test_msg.header.update_interval = 3; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_sats.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)111,(char)114,(char)98,(char)105,(char)116,(char)95,(char)99,(char)108,(char)111,(char)99,(char)107,(char)95,(char)98,(char)111,(char)117,(char)110,(char)100,(char)115 }; - memcpy(test_msg.n_sats.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_sats.value = 2; - - test_msg.orbit_clock_bounds[0].clock_bound_mu = 39; - test_msg.orbit_clock_bounds[0].clock_bound_sig = 1; - test_msg.orbit_clock_bounds[0].orb_along_bound_mu = 38; - test_msg.orbit_clock_bounds[0].orb_along_bound_sig = 2; - test_msg.orbit_clock_bounds[0].orb_cross_bound_mu = 37; - test_msg.orbit_clock_bounds[0].orb_cross_bound_sig = 3; - test_msg.orbit_clock_bounds[0].orb_radial_bound_mu = 39; - test_msg.orbit_clock_bounds[0].orb_radial_bound_sig = 1; - test_msg.orbit_clock_bounds[0].sat_id = 24; - - test_msg.orbit_clock_bounds[1].clock_bound_mu = 39; - test_msg.orbit_clock_bounds[1].clock_bound_sig = 1; - test_msg.orbit_clock_bounds[1].orb_along_bound_mu = 38; - test_msg.orbit_clock_bounds[1].orb_along_bound_sig = 2; - test_msg.orbit_clock_bounds[1].orb_cross_bound_mu = 37; - test_msg.orbit_clock_bounds[1].orb_cross_bound_sig = 3; - test_msg.orbit_clock_bounds[1].orb_radial_bound_mu = 39; - test_msg.orbit_clock_bounds[1].orb_radial_bound_sig = 1; - test_msg.orbit_clock_bounds[1].sat_id = 3; - test_msg.ssr_iod = 15; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.const_id, 1) << "incorrect value for last_msg_.const_id, expected 1, is " << last_msg_.const_id; - EXPECT_EQ(last_msg_.header.num_msgs, 1) << "incorrect value for last_msg_.header.num_msgs, expected 1, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.seq_num, 2) << "incorrect value for last_msg_.header.seq_num, expected 2, is " << last_msg_.header.seq_num; - EXPECT_EQ(last_msg_.header.sol_id, 48) << "incorrect value for last_msg_.header.sol_id, expected 48, is " << last_msg_.header.sol_id; - EXPECT_EQ(last_msg_.header.time.tow, 180) << "incorrect value for last_msg_.header.time.tow, expected 180, is " << last_msg_.header.time.tow; - EXPECT_EQ(last_msg_.header.time.wn, 3) << "incorrect value for last_msg_.header.time.wn, expected 3, is " << last_msg_.header.time.wn; - EXPECT_EQ(last_msg_.header.update_interval, 3) << "incorrect value for last_msg_.header.update_interval, expected 3, is " << last_msg_.header.update_interval; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_sats.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_sats.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_sats.handle_as << "'"; - } - { - const char check_string[] = { (char)111,(char)114,(char)98,(char)105,(char)116,(char)95,(char)99,(char)108,(char)111,(char)99,(char)107,(char)95,(char)98,(char)111,(char)117,(char)110,(char)100,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_sats.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_sats.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_sats.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_sats.value, 2) << "incorrect value for last_msg_.n_sats.value, expected 2, is " << last_msg_.n_sats.value; - EXPECT_EQ(last_msg_.orbit_clock_bounds[0].clock_bound_mu, 39) << "incorrect value for last_msg_.orbit_clock_bounds[0].clock_bound_mu, expected 39, is " << last_msg_.orbit_clock_bounds[0].clock_bound_mu; - EXPECT_EQ(last_msg_.orbit_clock_bounds[0].clock_bound_sig, 1) << "incorrect value for last_msg_.orbit_clock_bounds[0].clock_bound_sig, expected 1, is " << last_msg_.orbit_clock_bounds[0].clock_bound_sig; - EXPECT_EQ(last_msg_.orbit_clock_bounds[0].orb_along_bound_mu, 38) << "incorrect value for last_msg_.orbit_clock_bounds[0].orb_along_bound_mu, expected 38, is " << last_msg_.orbit_clock_bounds[0].orb_along_bound_mu; - EXPECT_EQ(last_msg_.orbit_clock_bounds[0].orb_along_bound_sig, 2) << "incorrect value for last_msg_.orbit_clock_bounds[0].orb_along_bound_sig, expected 2, is " << last_msg_.orbit_clock_bounds[0].orb_along_bound_sig; - EXPECT_EQ(last_msg_.orbit_clock_bounds[0].orb_cross_bound_mu, 37) << "incorrect value for last_msg_.orbit_clock_bounds[0].orb_cross_bound_mu, expected 37, is " << last_msg_.orbit_clock_bounds[0].orb_cross_bound_mu; - EXPECT_EQ(last_msg_.orbit_clock_bounds[0].orb_cross_bound_sig, 3) << "incorrect value for last_msg_.orbit_clock_bounds[0].orb_cross_bound_sig, expected 3, is " << last_msg_.orbit_clock_bounds[0].orb_cross_bound_sig; - EXPECT_EQ(last_msg_.orbit_clock_bounds[0].orb_radial_bound_mu, 39) << "incorrect value for last_msg_.orbit_clock_bounds[0].orb_radial_bound_mu, expected 39, is " << last_msg_.orbit_clock_bounds[0].orb_radial_bound_mu; - EXPECT_EQ(last_msg_.orbit_clock_bounds[0].orb_radial_bound_sig, 1) << "incorrect value for last_msg_.orbit_clock_bounds[0].orb_radial_bound_sig, expected 1, is " << last_msg_.orbit_clock_bounds[0].orb_radial_bound_sig; - EXPECT_EQ(last_msg_.orbit_clock_bounds[0].sat_id, 24) << "incorrect value for last_msg_.orbit_clock_bounds[0].sat_id, expected 24, is " << last_msg_.orbit_clock_bounds[0].sat_id; - EXPECT_EQ(last_msg_.orbit_clock_bounds[1].clock_bound_mu, 39) << "incorrect value for last_msg_.orbit_clock_bounds[1].clock_bound_mu, expected 39, is " << last_msg_.orbit_clock_bounds[1].clock_bound_mu; - EXPECT_EQ(last_msg_.orbit_clock_bounds[1].clock_bound_sig, 1) << "incorrect value for last_msg_.orbit_clock_bounds[1].clock_bound_sig, expected 1, is " << last_msg_.orbit_clock_bounds[1].clock_bound_sig; - EXPECT_EQ(last_msg_.orbit_clock_bounds[1].orb_along_bound_mu, 38) << "incorrect value for last_msg_.orbit_clock_bounds[1].orb_along_bound_mu, expected 38, is " << last_msg_.orbit_clock_bounds[1].orb_along_bound_mu; - EXPECT_EQ(last_msg_.orbit_clock_bounds[1].orb_along_bound_sig, 2) << "incorrect value for last_msg_.orbit_clock_bounds[1].orb_along_bound_sig, expected 2, is " << last_msg_.orbit_clock_bounds[1].orb_along_bound_sig; - EXPECT_EQ(last_msg_.orbit_clock_bounds[1].orb_cross_bound_mu, 37) << "incorrect value for last_msg_.orbit_clock_bounds[1].orb_cross_bound_mu, expected 37, is " << last_msg_.orbit_clock_bounds[1].orb_cross_bound_mu; - EXPECT_EQ(last_msg_.orbit_clock_bounds[1].orb_cross_bound_sig, 3) << "incorrect value for last_msg_.orbit_clock_bounds[1].orb_cross_bound_sig, expected 3, is " << last_msg_.orbit_clock_bounds[1].orb_cross_bound_sig; - EXPECT_EQ(last_msg_.orbit_clock_bounds[1].orb_radial_bound_mu, 39) << "incorrect value for last_msg_.orbit_clock_bounds[1].orb_radial_bound_mu, expected 39, is " << last_msg_.orbit_clock_bounds[1].orb_radial_bound_mu; - EXPECT_EQ(last_msg_.orbit_clock_bounds[1].orb_radial_bound_sig, 1) << "incorrect value for last_msg_.orbit_clock_bounds[1].orb_radial_bound_sig, expected 1, is " << last_msg_.orbit_clock_bounds[1].orb_radial_bound_sig; - EXPECT_EQ(last_msg_.orbit_clock_bounds[1].sat_id, 3) << "incorrect value for last_msg_.orbit_clock_bounds[1].sat_id, expected 3, is " << last_msg_.orbit_clock_bounds[1].sat_id; - EXPECT_EQ(last_msg_.ssr_iod, 15) << "incorrect value for last_msg_.ssr_iod, expected 15, is " << last_msg_.ssr_iod; + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.const_id, 1) + << "incorrect value for last_msg_.const_id, expected 1, is " + << last_msg_.const_id; + EXPECT_EQ(last_msg_.header.num_msgs, 1) + << "incorrect value for last_msg_.header.num_msgs, expected 1, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.seq_num, 2) + << "incorrect value for last_msg_.header.seq_num, expected 2, is " + << last_msg_.header.seq_num; + EXPECT_EQ(last_msg_.header.sol_id, 48) + << "incorrect value for last_msg_.header.sol_id, expected 48, is " + << last_msg_.header.sol_id; + EXPECT_EQ(last_msg_.header.time.tow, 180) + << "incorrect value for last_msg_.header.time.tow, expected 180, is " + << last_msg_.header.time.tow; + EXPECT_EQ(last_msg_.header.time.wn, 3) + << "incorrect value for last_msg_.header.time.wn, expected 3, is " + << last_msg_.header.time.wn; + EXPECT_EQ(last_msg_.header.update_interval, 3) + << "incorrect value for last_msg_.header.update_interval, expected 3, is " + << last_msg_.header.update_interval; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_sats.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_sats.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_sats.handle_as << "'"; + } + { + const char check_string[] = { + (char)111, (char)114, (char)98, (char)105, (char)116, (char)95, + (char)99, (char)108, (char)111, (char)99, (char)107, (char)95, + (char)98, (char)111, (char)117, (char)110, (char)100, (char)115}; + EXPECT_EQ( + memcmp(last_msg_.n_sats.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_sats.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_sats.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_sats.value, 2) + << "incorrect value for last_msg_.n_sats.value, expected 2, is " + << last_msg_.n_sats.value; + EXPECT_EQ(last_msg_.orbit_clock_bounds[0].clock_bound_mu, 39) + << "incorrect value for last_msg_.orbit_clock_bounds[0].clock_bound_mu, " + "expected 39, is " + << last_msg_.orbit_clock_bounds[0].clock_bound_mu; + EXPECT_EQ(last_msg_.orbit_clock_bounds[0].clock_bound_sig, 1) + << "incorrect value for last_msg_.orbit_clock_bounds[0].clock_bound_sig, " + "expected 1, is " + << last_msg_.orbit_clock_bounds[0].clock_bound_sig; + EXPECT_EQ(last_msg_.orbit_clock_bounds[0].orb_along_bound_mu, 38) + << "incorrect value for " + "last_msg_.orbit_clock_bounds[0].orb_along_bound_mu, expected 38, is " + << last_msg_.orbit_clock_bounds[0].orb_along_bound_mu; + EXPECT_EQ(last_msg_.orbit_clock_bounds[0].orb_along_bound_sig, 2) + << "incorrect value for " + "last_msg_.orbit_clock_bounds[0].orb_along_bound_sig, expected 2, is " + << last_msg_.orbit_clock_bounds[0].orb_along_bound_sig; + EXPECT_EQ(last_msg_.orbit_clock_bounds[0].orb_cross_bound_mu, 37) + << "incorrect value for " + "last_msg_.orbit_clock_bounds[0].orb_cross_bound_mu, expected 37, is " + << last_msg_.orbit_clock_bounds[0].orb_cross_bound_mu; + EXPECT_EQ(last_msg_.orbit_clock_bounds[0].orb_cross_bound_sig, 3) + << "incorrect value for " + "last_msg_.orbit_clock_bounds[0].orb_cross_bound_sig, expected 3, is " + << last_msg_.orbit_clock_bounds[0].orb_cross_bound_sig; + EXPECT_EQ(last_msg_.orbit_clock_bounds[0].orb_radial_bound_mu, 39) + << "incorrect value for " + "last_msg_.orbit_clock_bounds[0].orb_radial_bound_mu, expected 39, is " + << last_msg_.orbit_clock_bounds[0].orb_radial_bound_mu; + EXPECT_EQ(last_msg_.orbit_clock_bounds[0].orb_radial_bound_sig, 1) + << "incorrect value for " + "last_msg_.orbit_clock_bounds[0].orb_radial_bound_sig, expected 1, is " + << last_msg_.orbit_clock_bounds[0].orb_radial_bound_sig; + EXPECT_EQ(last_msg_.orbit_clock_bounds[0].sat_id, 24) + << "incorrect value for last_msg_.orbit_clock_bounds[0].sat_id, expected " + "24, is " + << last_msg_.orbit_clock_bounds[0].sat_id; + EXPECT_EQ(last_msg_.orbit_clock_bounds[1].clock_bound_mu, 39) + << "incorrect value for last_msg_.orbit_clock_bounds[1].clock_bound_mu, " + "expected 39, is " + << last_msg_.orbit_clock_bounds[1].clock_bound_mu; + EXPECT_EQ(last_msg_.orbit_clock_bounds[1].clock_bound_sig, 1) + << "incorrect value for last_msg_.orbit_clock_bounds[1].clock_bound_sig, " + "expected 1, is " + << last_msg_.orbit_clock_bounds[1].clock_bound_sig; + EXPECT_EQ(last_msg_.orbit_clock_bounds[1].orb_along_bound_mu, 38) + << "incorrect value for " + "last_msg_.orbit_clock_bounds[1].orb_along_bound_mu, expected 38, is " + << last_msg_.orbit_clock_bounds[1].orb_along_bound_mu; + EXPECT_EQ(last_msg_.orbit_clock_bounds[1].orb_along_bound_sig, 2) + << "incorrect value for " + "last_msg_.orbit_clock_bounds[1].orb_along_bound_sig, expected 2, is " + << last_msg_.orbit_clock_bounds[1].orb_along_bound_sig; + EXPECT_EQ(last_msg_.orbit_clock_bounds[1].orb_cross_bound_mu, 37) + << "incorrect value for " + "last_msg_.orbit_clock_bounds[1].orb_cross_bound_mu, expected 37, is " + << last_msg_.orbit_clock_bounds[1].orb_cross_bound_mu; + EXPECT_EQ(last_msg_.orbit_clock_bounds[1].orb_cross_bound_sig, 3) + << "incorrect value for " + "last_msg_.orbit_clock_bounds[1].orb_cross_bound_sig, expected 3, is " + << last_msg_.orbit_clock_bounds[1].orb_cross_bound_sig; + EXPECT_EQ(last_msg_.orbit_clock_bounds[1].orb_radial_bound_mu, 39) + << "incorrect value for " + "last_msg_.orbit_clock_bounds[1].orb_radial_bound_mu, expected 39, is " + << last_msg_.orbit_clock_bounds[1].orb_radial_bound_mu; + EXPECT_EQ(last_msg_.orbit_clock_bounds[1].orb_radial_bound_sig, 1) + << "incorrect value for " + "last_msg_.orbit_clock_bounds[1].orb_radial_bound_sig, expected 1, is " + << last_msg_.orbit_clock_bounds[1].orb_radial_bound_sig; + EXPECT_EQ(last_msg_.orbit_clock_bounds[1].sat_id, 3) + << "incorrect value for last_msg_.orbit_clock_bounds[1].sat_id, expected " + "3, is " + << last_msg_.orbit_clock_bounds[1].sat_id; + EXPECT_EQ(last_msg_.ssr_iod, 15) + << "incorrect value for last_msg_.ssr_iod, expected 15, is " + << last_msg_.ssr_iod; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.cc index 7adf99798..eaeb52f6e 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.cc @@ -10,60 +10,57 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBoundsDegradation.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBoundsDegradation.yaml +// by generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_orbit_clock_bounds_degradation_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_ssr_orbit_clock_bounds_degradation_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,64 +68,122 @@ class Test_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation0 : sbp_msg_ssr_orbit_clock_bounds_degradation_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation0, Test) { + uint8_t encoded_frame[] = { + 85, 223, 5, 66, 0, 28, 180, 0, 0, 0, 3, 0, + 1, 2, 3, 48, 15, 1, 10, 0, 0, 0, 0, 0, + 0, 0, 200, 199, 198, 197, 196, 195, 194, 193, 200, 117, + }; - uint8_t encoded_frame[] = {85,223,5,66,0,28,180,0,0,0,3,0,1,2,3,48,15,1,10,0,0,0,0,0,0,0,200,199,198,197,196,195,194,193,200,117, }; + sbp_msg_ssr_orbit_clock_bounds_degradation_t test_msg{}; + test_msg.const_id = 1; + test_msg.header.num_msgs = 1; + test_msg.header.seq_num = 2; + test_msg.header.sol_id = 48; + test_msg.header.time.tow = 180; + test_msg.header.time.wn = 3; + test_msg.header.update_interval = 3; + test_msg.orbit_clock_bounds_degradation.clock_bound_mu_dot = 194; + test_msg.orbit_clock_bounds_degradation.clock_bound_sig_dot = 193; + test_msg.orbit_clock_bounds_degradation.orb_along_bound_mu_dot = 199; + test_msg.orbit_clock_bounds_degradation.orb_along_bound_sig_dot = 196; + test_msg.orbit_clock_bounds_degradation.orb_cross_bound_mu_dot = 198; + test_msg.orbit_clock_bounds_degradation.orb_cross_bound_sig_dot = 195; + test_msg.orbit_clock_bounds_degradation.orb_radial_bound_mu_dot = 200; + test_msg.orbit_clock_bounds_degradation.orb_radial_bound_sig_dot = 197; + test_msg.sat_bitmask = 10; + test_msg.ssr_iod = 15; - sbp_msg_ssr_orbit_clock_bounds_degradation_t test_msg{}; - test_msg.const_id = 1; - test_msg.header.num_msgs = 1; - test_msg.header.seq_num = 2; - test_msg.header.sol_id = 48; - test_msg.header.time.tow = 180; - test_msg.header.time.wn = 3; - test_msg.header.update_interval = 3; - test_msg.orbit_clock_bounds_degradation.clock_bound_mu_dot = 194; - test_msg.orbit_clock_bounds_degradation.clock_bound_sig_dot = 193; - test_msg.orbit_clock_bounds_degradation.orb_along_bound_mu_dot = 199; - test_msg.orbit_clock_bounds_degradation.orb_along_bound_sig_dot = 196; - test_msg.orbit_clock_bounds_degradation.orb_cross_bound_mu_dot = 198; - test_msg.orbit_clock_bounds_degradation.orb_cross_bound_sig_dot = 195; - test_msg.orbit_clock_bounds_degradation.orb_radial_bound_mu_dot = 200; - test_msg.orbit_clock_bounds_degradation.orb_radial_bound_sig_dot = 197; - test_msg.sat_bitmask = 10; - test_msg.ssr_iod = 15; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.const_id, 1) << "incorrect value for last_msg_.const_id, expected 1, is " << last_msg_.const_id; - EXPECT_EQ(last_msg_.header.num_msgs, 1) << "incorrect value for last_msg_.header.num_msgs, expected 1, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.seq_num, 2) << "incorrect value for last_msg_.header.seq_num, expected 2, is " << last_msg_.header.seq_num; - EXPECT_EQ(last_msg_.header.sol_id, 48) << "incorrect value for last_msg_.header.sol_id, expected 48, is " << last_msg_.header.sol_id; - EXPECT_EQ(last_msg_.header.time.tow, 180) << "incorrect value for last_msg_.header.time.tow, expected 180, is " << last_msg_.header.time.tow; - EXPECT_EQ(last_msg_.header.time.wn, 3) << "incorrect value for last_msg_.header.time.wn, expected 3, is " << last_msg_.header.time.wn; - EXPECT_EQ(last_msg_.header.update_interval, 3) << "incorrect value for last_msg_.header.update_interval, expected 3, is " << last_msg_.header.update_interval; - EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.clock_bound_mu_dot, 194) << "incorrect value for last_msg_.orbit_clock_bounds_degradation.clock_bound_mu_dot, expected 194, is " << last_msg_.orbit_clock_bounds_degradation.clock_bound_mu_dot; - EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.clock_bound_sig_dot, 193) << "incorrect value for last_msg_.orbit_clock_bounds_degradation.clock_bound_sig_dot, expected 193, is " << last_msg_.orbit_clock_bounds_degradation.clock_bound_sig_dot; - EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.orb_along_bound_mu_dot, 199) << "incorrect value for last_msg_.orbit_clock_bounds_degradation.orb_along_bound_mu_dot, expected 199, is " << last_msg_.orbit_clock_bounds_degradation.orb_along_bound_mu_dot; - EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.orb_along_bound_sig_dot, 196) << "incorrect value for last_msg_.orbit_clock_bounds_degradation.orb_along_bound_sig_dot, expected 196, is " << last_msg_.orbit_clock_bounds_degradation.orb_along_bound_sig_dot; - EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.orb_cross_bound_mu_dot, 198) << "incorrect value for last_msg_.orbit_clock_bounds_degradation.orb_cross_bound_mu_dot, expected 198, is " << last_msg_.orbit_clock_bounds_degradation.orb_cross_bound_mu_dot; - EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.orb_cross_bound_sig_dot, 195) << "incorrect value for last_msg_.orbit_clock_bounds_degradation.orb_cross_bound_sig_dot, expected 195, is " << last_msg_.orbit_clock_bounds_degradation.orb_cross_bound_sig_dot; - EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.orb_radial_bound_mu_dot, 200) << "incorrect value for last_msg_.orbit_clock_bounds_degradation.orb_radial_bound_mu_dot, expected 200, is " << last_msg_.orbit_clock_bounds_degradation.orb_radial_bound_mu_dot; - EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.orb_radial_bound_sig_dot, 197) << "incorrect value for last_msg_.orbit_clock_bounds_degradation.orb_radial_bound_sig_dot, expected 197, is " << last_msg_.orbit_clock_bounds_degradation.orb_radial_bound_sig_dot; - EXPECT_EQ(last_msg_.sat_bitmask, 10) << "incorrect value for last_msg_.sat_bitmask, expected 10, is " << last_msg_.sat_bitmask; - EXPECT_EQ(last_msg_.ssr_iod, 15) << "incorrect value for last_msg_.ssr_iod, expected 15, is " << last_msg_.ssr_iod; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.const_id, 1) + << "incorrect value for last_msg_.const_id, expected 1, is " + << last_msg_.const_id; + EXPECT_EQ(last_msg_.header.num_msgs, 1) + << "incorrect value for last_msg_.header.num_msgs, expected 1, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.seq_num, 2) + << "incorrect value for last_msg_.header.seq_num, expected 2, is " + << last_msg_.header.seq_num; + EXPECT_EQ(last_msg_.header.sol_id, 48) + << "incorrect value for last_msg_.header.sol_id, expected 48, is " + << last_msg_.header.sol_id; + EXPECT_EQ(last_msg_.header.time.tow, 180) + << "incorrect value for last_msg_.header.time.tow, expected 180, is " + << last_msg_.header.time.tow; + EXPECT_EQ(last_msg_.header.time.wn, 3) + << "incorrect value for last_msg_.header.time.wn, expected 3, is " + << last_msg_.header.time.wn; + EXPECT_EQ(last_msg_.header.update_interval, 3) + << "incorrect value for last_msg_.header.update_interval, expected 3, is " + << last_msg_.header.update_interval; + EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.clock_bound_mu_dot, 194) + << "incorrect value for " + "last_msg_.orbit_clock_bounds_degradation.clock_bound_mu_dot, " + "expected 194, is " + << last_msg_.orbit_clock_bounds_degradation.clock_bound_mu_dot; + EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.clock_bound_sig_dot, 193) + << "incorrect value for " + "last_msg_.orbit_clock_bounds_degradation.clock_bound_sig_dot, " + "expected 193, is " + << last_msg_.orbit_clock_bounds_degradation.clock_bound_sig_dot; + EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.orb_along_bound_mu_dot, + 199) + << "incorrect value for " + "last_msg_.orbit_clock_bounds_degradation.orb_along_bound_mu_dot, " + "expected 199, is " + << last_msg_.orbit_clock_bounds_degradation.orb_along_bound_mu_dot; + EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.orb_along_bound_sig_dot, + 196) + << "incorrect value for " + "last_msg_.orbit_clock_bounds_degradation.orb_along_bound_sig_dot, " + "expected 196, is " + << last_msg_.orbit_clock_bounds_degradation.orb_along_bound_sig_dot; + EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.orb_cross_bound_mu_dot, + 198) + << "incorrect value for " + "last_msg_.orbit_clock_bounds_degradation.orb_cross_bound_mu_dot, " + "expected 198, is " + << last_msg_.orbit_clock_bounds_degradation.orb_cross_bound_mu_dot; + EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.orb_cross_bound_sig_dot, + 195) + << "incorrect value for " + "last_msg_.orbit_clock_bounds_degradation.orb_cross_bound_sig_dot, " + "expected 195, is " + << last_msg_.orbit_clock_bounds_degradation.orb_cross_bound_sig_dot; + EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.orb_radial_bound_mu_dot, + 200) + << "incorrect value for " + "last_msg_.orbit_clock_bounds_degradation.orb_radial_bound_mu_dot, " + "expected 200, is " + << last_msg_.orbit_clock_bounds_degradation.orb_radial_bound_mu_dot; + EXPECT_EQ(last_msg_.orbit_clock_bounds_degradation.orb_radial_bound_sig_dot, + 197) + << "incorrect value for " + "last_msg_.orbit_clock_bounds_degradation.orb_radial_bound_sig_dot, " + "expected 197, is " + << last_msg_.orbit_clock_bounds_degradation.orb_radial_bound_sig_dot; + EXPECT_EQ(last_msg_.sat_bitmask, 10) + << "incorrect value for last_msg_.sat_bitmask, expected 10, is " + << last_msg_.sat_bitmask; + EXPECT_EQ(last_msg_.ssr_iod, 15) + << "incorrect value for last_msg_.ssr_iod, expected 15, is " + << last_msg_.ssr_iod; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.cc index 1f2fb43f5..2009e7aea 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrOrbitClockDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrOrbitClockDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrOrbitClockDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrOrbitClockDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_orbit_clock_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_orbit_clock_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,62 +67,97 @@ class Test_auto_check_sbp_ssr_MsgSsrOrbitClockDepA0 : sbp_msg_ssr_orbit_clock_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrOrbitClockDepA0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrOrbitClockDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 220, 5, 33, 166, 47, 225, 114, 31, 189, 43, 30, 1, 30, + 194, 211, 193, 175, 161, 143, 254, 56, 63, 232, 7, 216, 69, 1, + 110, 165, 124, 196, 189, 27, 116, 88, 4, 61, 3, 151, 18, 171, + 147, 46, 198, 85, 243, 245, 225, 235, 123, 181, 210, 157, 252, + }; - uint8_t encoded_frame[] = {85,220,5,33,166,47,225,114,31,189,43,30,1,30,194,211,193,175,161,143,254,56,63,232,7,216,69,1,110,165,124,196,189,27,116,88,4,61,3,151,18,171,147,46,198,85,243,245,225,235,123,181,210,157,252, }; + sbp_msg_ssr_orbit_clock_dep_a_t test_msg{}; + test_msg.along = 132661048; + test_msg.c0 = -970026069; + test_msg.c1 = -503975083; + test_msg.c2 = -759858197; + test_msg.cross = 1845577176; + test_msg.dot_along = 72905755; + test_msg.dot_cross = 311886653; + test_msg.dot_radial = -1111196507; + test_msg.iod = 193; + test_msg.iod_ssr = 211; + test_msg.radial = -24141393; + test_msg.sid.code = 30; + test_msg.sid.sat = 1; + test_msg.time.tow = 3172954849; + test_msg.time.wn = 7723; + test_msg.update_interval = 194; - sbp_msg_ssr_orbit_clock_dep_a_t test_msg{}; - test_msg.along = 132661048; - test_msg.c0 = -970026069; - test_msg.c1 = -503975083; - test_msg.c2 = -759858197; - test_msg.cross = 1845577176; - test_msg.dot_along = 72905755; - test_msg.dot_cross = 311886653; - test_msg.dot_radial = -1111196507; - test_msg.iod = 193; - test_msg.iod_ssr = 211; - test_msg.radial = -24141393; - test_msg.sid.code = 30; - test_msg.sid.sat = 1; - test_msg.time.tow = 3172954849; - test_msg.time.wn = 7723; - test_msg.update_interval = 194; - - EXPECT_EQ(send_message( 42529, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(42529, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 42529); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.along, 132661048) << "incorrect value for last_msg_.along, expected 132661048, is " << last_msg_.along; - EXPECT_EQ(last_msg_.c0, -970026069) << "incorrect value for last_msg_.c0, expected -970026069, is " << last_msg_.c0; - EXPECT_EQ(last_msg_.c1, -503975083) << "incorrect value for last_msg_.c1, expected -503975083, is " << last_msg_.c1; - EXPECT_EQ(last_msg_.c2, -759858197) << "incorrect value for last_msg_.c2, expected -759858197, is " << last_msg_.c2; - EXPECT_EQ(last_msg_.cross, 1845577176) << "incorrect value for last_msg_.cross, expected 1845577176, is " << last_msg_.cross; - EXPECT_EQ(last_msg_.dot_along, 72905755) << "incorrect value for last_msg_.dot_along, expected 72905755, is " << last_msg_.dot_along; - EXPECT_EQ(last_msg_.dot_cross, 311886653) << "incorrect value for last_msg_.dot_cross, expected 311886653, is " << last_msg_.dot_cross; - EXPECT_EQ(last_msg_.dot_radial, -1111196507) << "incorrect value for last_msg_.dot_radial, expected -1111196507, is " << last_msg_.dot_radial; - EXPECT_EQ(last_msg_.iod, 193) << "incorrect value for last_msg_.iod, expected 193, is " << last_msg_.iod; - EXPECT_EQ(last_msg_.iod_ssr, 211) << "incorrect value for last_msg_.iod_ssr, expected 211, is " << last_msg_.iod_ssr; - EXPECT_EQ(last_msg_.radial, -24141393) << "incorrect value for last_msg_.radial, expected -24141393, is " << last_msg_.radial; - EXPECT_EQ(last_msg_.sid.code, 30) << "incorrect value for last_msg_.sid.code, expected 30, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.sat, 1) << "incorrect value for last_msg_.sid.sat, expected 1, is " << last_msg_.sid.sat; - EXPECT_EQ(last_msg_.time.tow, 3172954849) << "incorrect value for last_msg_.time.tow, expected 3172954849, is " << last_msg_.time.tow; - EXPECT_EQ(last_msg_.time.wn, 7723) << "incorrect value for last_msg_.time.wn, expected 7723, is " << last_msg_.time.wn; - EXPECT_EQ(last_msg_.update_interval, 194) << "incorrect value for last_msg_.update_interval, expected 194, is " << last_msg_.update_interval; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 42529); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.along, 132661048) + << "incorrect value for last_msg_.along, expected 132661048, is " + << last_msg_.along; + EXPECT_EQ(last_msg_.c0, -970026069) + << "incorrect value for last_msg_.c0, expected -970026069, is " + << last_msg_.c0; + EXPECT_EQ(last_msg_.c1, -503975083) + << "incorrect value for last_msg_.c1, expected -503975083, is " + << last_msg_.c1; + EXPECT_EQ(last_msg_.c2, -759858197) + << "incorrect value for last_msg_.c2, expected -759858197, is " + << last_msg_.c2; + EXPECT_EQ(last_msg_.cross, 1845577176) + << "incorrect value for last_msg_.cross, expected 1845577176, is " + << last_msg_.cross; + EXPECT_EQ(last_msg_.dot_along, 72905755) + << "incorrect value for last_msg_.dot_along, expected 72905755, is " + << last_msg_.dot_along; + EXPECT_EQ(last_msg_.dot_cross, 311886653) + << "incorrect value for last_msg_.dot_cross, expected 311886653, is " + << last_msg_.dot_cross; + EXPECT_EQ(last_msg_.dot_radial, -1111196507) + << "incorrect value for last_msg_.dot_radial, expected -1111196507, is " + << last_msg_.dot_radial; + EXPECT_EQ(last_msg_.iod, 193) + << "incorrect value for last_msg_.iod, expected 193, is " + << last_msg_.iod; + EXPECT_EQ(last_msg_.iod_ssr, 211) + << "incorrect value for last_msg_.iod_ssr, expected 211, is " + << last_msg_.iod_ssr; + EXPECT_EQ(last_msg_.radial, -24141393) + << "incorrect value for last_msg_.radial, expected -24141393, is " + << last_msg_.radial; + EXPECT_EQ(last_msg_.sid.code, 30) + << "incorrect value for last_msg_.sid.code, expected 30, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.sat, 1) + << "incorrect value for last_msg_.sid.sat, expected 1, is " + << last_msg_.sid.sat; + EXPECT_EQ(last_msg_.time.tow, 3172954849) + << "incorrect value for last_msg_.time.tow, expected 3172954849, is " + << last_msg_.time.tow; + EXPECT_EQ(last_msg_.time.wn, 7723) + << "incorrect value for last_msg_.time.wn, expected 7723, is " + << last_msg_.time.wn; + EXPECT_EQ(last_msg_.update_interval, 194) + << "incorrect value for last_msg_.update_interval, expected 194, is " + << last_msg_.update_interval; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrPhaseBiases.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrPhaseBiases.cc index ff8bfa23e..5ea0a70b2 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrPhaseBiases.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrPhaseBiases.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrPhaseBiases.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrPhaseBiases.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrPhaseBiases0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrPhaseBiases0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrPhaseBiases0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrPhaseBiases0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_phase_biases_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_phase_biases_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,398 +67,867 @@ class Test_auto_check_sbp_ssr_MsgSsrPhaseBiases0 : sbp_msg_ssr_phase_biases_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrPhaseBiases0, Test) -{ - - uint8_t encoded_frame[] = {85,230,5,219,206,255,209,154,144,12,213,164,169,82,177,230,98,209,249,22,17,29,250,245,193,219,30,212,177,207,187,33,146,58,204,164,65,114,49,248,52,8,161,44,252,166,168,232,124,134,86,173,241,174,44,142,155,129,143,184,161,211,15,36,189,208,194,221,152,16,203,87,34,188,141,104,189,102,156,252,22,251,136,49,188,157,222,245,49,132,16,34,142,228,85,139,221,197,235,98,74,107,70,36,38,239,251,112,188,124,246,141,164,150,104,7,213,44,21,244,192,4,143,24,42,21,84,136,7,42,118,45,23,174,175,129,54,169,14,213,2,197,98,60,13,207,105,100,129,72,136,240,140,129,9,114,172,151,150,17,210,127,115,151,3,242,254,215,14,5,34,126,2,215,65,38,176,23,210,201,97,36,207,92,224,26,116,155,211,165,47,102,38,67,199,55,117,36,169,33,1,230,201,183,21,42,62,147,173,173,155,98,146,231,167,138,82,167,127,229,1,2,127,237,207,116,90,115,159,3,42,66,145,250,201,7,251,2,75,230,26,213,181,56,64,97,88,255,6,147,16,89,203,27,68,243,230,55,242,167,169,219,240, }; - - sbp_msg_ssr_phase_biases_t test_msg{}; - - test_msg.biases[0].bias = -1311498533; - test_msg.biases[0].code = 29; - test_msg.biases[0].discontinuity_counter = 193; - test_msg.biases[0].integer_indicator = 250; - test_msg.biases[0].widelane_integer_indicator = 245; - - test_msg.biases[1].bias = 1101319226; - test_msg.biases[1].code = 207; - test_msg.biases[1].discontinuity_counter = 146; - test_msg.biases[1].integer_indicator = 187; - test_msg.biases[1].widelane_integer_indicator = 33; - - test_msg.biases[2].bias = -64184056; - test_msg.biases[2].code = 114; - test_msg.biases[2].discontinuity_counter = 52; - test_msg.biases[2].integer_indicator = 49; - test_msg.biases[2].widelane_integer_indicator = 248; - - test_msg.biases[3].bias = -240298362; - test_msg.biases[3].code = 166; - test_msg.biases[3].discontinuity_counter = 124; - test_msg.biases[3].integer_indicator = 168; - test_msg.biases[3].widelane_integer_indicator = 232; - - test_msg.biases[4].bias = -1581740159; - test_msg.biases[4].code = 174; - test_msg.biases[4].discontinuity_counter = 155; - test_msg.biases[4].integer_indicator = 44; - test_msg.biases[4].widelane_integer_indicator = 142; - - test_msg.biases[5].bias = -1730297136; - test_msg.biases[5].code = 211; - test_msg.biases[5].discontinuity_counter = 189; - test_msg.biases[5].integer_indicator = 15; - test_msg.biases[5].widelane_integer_indicator = 36; - - test_msg.biases[6].bias = -1117221444; - test_msg.biases[6].code = 16; - test_msg.biases[6].discontinuity_counter = 34; - test_msg.biases[6].integer_indicator = 203; - test_msg.biases[6].widelane_integer_indicator = 87; - - test_msg.biases[7].bias = -1137604357; - test_msg.biases[7].code = 102; - test_msg.biases[7].discontinuity_counter = 22; - test_msg.biases[7].integer_indicator = 156; - test_msg.biases[7].widelane_integer_indicator = 252; - - test_msg.biases[8].bias = -1910370172; - test_msg.biases[8].code = 157; - test_msg.biases[8].discontinuity_counter = 49; - test_msg.biases[8].integer_indicator = 222; - test_msg.biases[8].widelane_integer_indicator = 245; - - test_msg.biases[9].bias = 1247996869; - test_msg.biases[9].code = 228; - test_msg.biases[9].discontinuity_counter = 221; - test_msg.biases[9].integer_indicator = 85; - test_msg.biases[9].widelane_integer_indicator = 139; - - test_msg.biases[10].bias = -1133446161; - test_msg.biases[10].code = 107; - test_msg.biases[10].discontinuity_counter = 38; - test_msg.biases[10].integer_indicator = 70; - test_msg.biases[10].widelane_integer_indicator = 36; - - test_msg.biases[11].bias = -720934762; - test_msg.biases[11].code = 124; - test_msg.biases[11].discontinuity_counter = 164; - test_msg.biases[11].integer_indicator = 246; - test_msg.biases[11].widelane_integer_indicator = 141; - - test_msg.biases[12].bias = 706252548; - test_msg.biases[12].code = 44; - test_msg.biases[12].discontinuity_counter = 192; - test_msg.biases[12].integer_indicator = 21; - test_msg.biases[12].widelane_integer_indicator = 244; - - test_msg.biases[13].bias = 388855338; - test_msg.biases[13].code = 21; - test_msg.biases[13].discontinuity_counter = 7; - test_msg.biases[13].integer_indicator = 84; - test_msg.biases[13].widelane_integer_indicator = 136; - - test_msg.biases[14].bias = 47517353; - test_msg.biases[14].code = 174; - test_msg.biases[14].discontinuity_counter = 54; - test_msg.biases[14].integer_indicator = 175; - test_msg.biases[14].widelane_integer_indicator = 129; - - test_msg.biases[15].bias = -2124125745; - test_msg.biases[15].code = 197; - test_msg.biases[15].discontinuity_counter = 13; - test_msg.biases[15].integer_indicator = 98; - test_msg.biases[15].widelane_integer_indicator = 60; - - test_msg.biases[16].bias = -1401812607; - test_msg.biases[16].code = 72; - test_msg.biases[16].discontinuity_counter = 140; - test_msg.biases[16].integer_indicator = 136; - test_msg.biases[16].widelane_integer_indicator = 240; - - test_msg.biases[17].bias = 60257151; - test_msg.biases[17].code = 151; - test_msg.biases[17].discontinuity_counter = 210; - test_msg.biases[17].integer_indicator = 150; - test_msg.biases[17].widelane_integer_indicator = 17; - - test_msg.biases[18].bias = 41820677; - test_msg.biases[18].code = 242; - test_msg.biases[18].discontinuity_counter = 14; - test_msg.biases[18].integer_indicator = 254; - test_msg.biases[18].widelane_integer_indicator = 215; - - test_msg.biases[19].bias = 1640616471; - test_msg.biases[19].code = 215; - test_msg.biases[19].discontinuity_counter = 176; - test_msg.biases[19].integer_indicator = 65; - test_msg.biases[19].widelane_integer_indicator = 38; - - test_msg.biases[20].bias = -744786918; - test_msg.biases[20].code = 36; - test_msg.biases[20].discontinuity_counter = 224; - test_msg.biases[20].integer_indicator = 207; - test_msg.biases[20].widelane_integer_indicator = 92; - - test_msg.biases[21].bias = 1966589763; - test_msg.biases[21].code = 165; - test_msg.biases[21].discontinuity_counter = 38; - test_msg.biases[21].integer_indicator = 47; - test_msg.biases[21].widelane_integer_indicator = 102; - - test_msg.biases[22].bias = 364366310; - test_msg.biases[22].code = 36; - test_msg.biases[22].discontinuity_counter = 1; - test_msg.biases[22].integer_indicator = 169; - test_msg.biases[22].widelane_integer_indicator = 33; - - test_msg.biases[23].bias = -1839031379; - test_msg.biases[23].code = 42; - test_msg.biases[23].discontinuity_counter = 173; - test_msg.biases[23].integer_indicator = 62; - test_msg.biases[23].widelane_integer_indicator = 147; - - test_msg.biases[24].bias = 31817639; - test_msg.biases[24].code = 231; - test_msg.biases[24].discontinuity_counter = 82; - test_msg.biases[24].integer_indicator = 167; - test_msg.biases[24].widelane_integer_indicator = 138; - - test_msg.biases[25].bias = -1619830156; - test_msg.biases[25].code = 2; - test_msg.biases[25].discontinuity_counter = 207; - test_msg.biases[25].integer_indicator = 127; - test_msg.biases[25].widelane_integer_indicator = 237; - - test_msg.biases[26].bias = -83375622; - test_msg.biases[26].code = 3; - test_msg.biases[26].discontinuity_counter = 145; - test_msg.biases[26].integer_indicator = 42; - test_msg.biases[26].widelane_integer_indicator = 66; - - test_msg.biases[27].bias = 1077458389; - test_msg.biases[27].code = 2; - test_msg.biases[27].discontinuity_counter = 26; - test_msg.biases[27].integer_indicator = 75; - test_msg.biases[27].widelane_integer_indicator = 230; - - test_msg.biases[28].bias = -883355501; - test_msg.biases[28].code = 97; - test_msg.biases[28].discontinuity_counter = 6; - test_msg.biases[28].integer_indicator = 88; - test_msg.biases[28].widelane_integer_indicator = 255; - - test_msg.biases[29].bias = -1448611273; - test_msg.biases[29].code = 27; - test_msg.biases[29].discontinuity_counter = 230; - test_msg.biases[29].integer_indicator = 68; - test_msg.biases[29].widelane_integer_indicator = 243; - test_msg.dispersive_bias = 98; - test_msg.iod_ssr = 230; - test_msg.mw_consistency = 209; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_biases.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)98,(char)105,(char)97,(char)115,(char)101,(char)115 }; - memcpy(test_msg.n_biases.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_biases.value = 30; - test_msg.sid.code = 82; - test_msg.sid.sat = 169; - test_msg.time.tow = 210803409; - test_msg.time.wn = 42197; - test_msg.update_interval = 177; - test_msg.yaw = 5881; - test_msg.yaw_rate = 17; - - EXPECT_EQ(send_message( 52955, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 52955); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.biases[0].bias, -1311498533) << "incorrect value for last_msg_.biases[0].bias, expected -1311498533, is " << last_msg_.biases[0].bias; - EXPECT_EQ(last_msg_.biases[0].code, 29) << "incorrect value for last_msg_.biases[0].code, expected 29, is " << last_msg_.biases[0].code; - EXPECT_EQ(last_msg_.biases[0].discontinuity_counter, 193) << "incorrect value for last_msg_.biases[0].discontinuity_counter, expected 193, is " << last_msg_.biases[0].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[0].integer_indicator, 250) << "incorrect value for last_msg_.biases[0].integer_indicator, expected 250, is " << last_msg_.biases[0].integer_indicator; - EXPECT_EQ(last_msg_.biases[0].widelane_integer_indicator, 245) << "incorrect value for last_msg_.biases[0].widelane_integer_indicator, expected 245, is " << last_msg_.biases[0].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[1].bias, 1101319226) << "incorrect value for last_msg_.biases[1].bias, expected 1101319226, is " << last_msg_.biases[1].bias; - EXPECT_EQ(last_msg_.biases[1].code, 207) << "incorrect value for last_msg_.biases[1].code, expected 207, is " << last_msg_.biases[1].code; - EXPECT_EQ(last_msg_.biases[1].discontinuity_counter, 146) << "incorrect value for last_msg_.biases[1].discontinuity_counter, expected 146, is " << last_msg_.biases[1].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[1].integer_indicator, 187) << "incorrect value for last_msg_.biases[1].integer_indicator, expected 187, is " << last_msg_.biases[1].integer_indicator; - EXPECT_EQ(last_msg_.biases[1].widelane_integer_indicator, 33) << "incorrect value for last_msg_.biases[1].widelane_integer_indicator, expected 33, is " << last_msg_.biases[1].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[2].bias, -64184056) << "incorrect value for last_msg_.biases[2].bias, expected -64184056, is " << last_msg_.biases[2].bias; - EXPECT_EQ(last_msg_.biases[2].code, 114) << "incorrect value for last_msg_.biases[2].code, expected 114, is " << last_msg_.biases[2].code; - EXPECT_EQ(last_msg_.biases[2].discontinuity_counter, 52) << "incorrect value for last_msg_.biases[2].discontinuity_counter, expected 52, is " << last_msg_.biases[2].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[2].integer_indicator, 49) << "incorrect value for last_msg_.biases[2].integer_indicator, expected 49, is " << last_msg_.biases[2].integer_indicator; - EXPECT_EQ(last_msg_.biases[2].widelane_integer_indicator, 248) << "incorrect value for last_msg_.biases[2].widelane_integer_indicator, expected 248, is " << last_msg_.biases[2].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[3].bias, -240298362) << "incorrect value for last_msg_.biases[3].bias, expected -240298362, is " << last_msg_.biases[3].bias; - EXPECT_EQ(last_msg_.biases[3].code, 166) << "incorrect value for last_msg_.biases[3].code, expected 166, is " << last_msg_.biases[3].code; - EXPECT_EQ(last_msg_.biases[3].discontinuity_counter, 124) << "incorrect value for last_msg_.biases[3].discontinuity_counter, expected 124, is " << last_msg_.biases[3].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[3].integer_indicator, 168) << "incorrect value for last_msg_.biases[3].integer_indicator, expected 168, is " << last_msg_.biases[3].integer_indicator; - EXPECT_EQ(last_msg_.biases[3].widelane_integer_indicator, 232) << "incorrect value for last_msg_.biases[3].widelane_integer_indicator, expected 232, is " << last_msg_.biases[3].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[4].bias, -1581740159) << "incorrect value for last_msg_.biases[4].bias, expected -1581740159, is " << last_msg_.biases[4].bias; - EXPECT_EQ(last_msg_.biases[4].code, 174) << "incorrect value for last_msg_.biases[4].code, expected 174, is " << last_msg_.biases[4].code; - EXPECT_EQ(last_msg_.biases[4].discontinuity_counter, 155) << "incorrect value for last_msg_.biases[4].discontinuity_counter, expected 155, is " << last_msg_.biases[4].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[4].integer_indicator, 44) << "incorrect value for last_msg_.biases[4].integer_indicator, expected 44, is " << last_msg_.biases[4].integer_indicator; - EXPECT_EQ(last_msg_.biases[4].widelane_integer_indicator, 142) << "incorrect value for last_msg_.biases[4].widelane_integer_indicator, expected 142, is " << last_msg_.biases[4].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[5].bias, -1730297136) << "incorrect value for last_msg_.biases[5].bias, expected -1730297136, is " << last_msg_.biases[5].bias; - EXPECT_EQ(last_msg_.biases[5].code, 211) << "incorrect value for last_msg_.biases[5].code, expected 211, is " << last_msg_.biases[5].code; - EXPECT_EQ(last_msg_.biases[5].discontinuity_counter, 189) << "incorrect value for last_msg_.biases[5].discontinuity_counter, expected 189, is " << last_msg_.biases[5].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[5].integer_indicator, 15) << "incorrect value for last_msg_.biases[5].integer_indicator, expected 15, is " << last_msg_.biases[5].integer_indicator; - EXPECT_EQ(last_msg_.biases[5].widelane_integer_indicator, 36) << "incorrect value for last_msg_.biases[5].widelane_integer_indicator, expected 36, is " << last_msg_.biases[5].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[6].bias, -1117221444) << "incorrect value for last_msg_.biases[6].bias, expected -1117221444, is " << last_msg_.biases[6].bias; - EXPECT_EQ(last_msg_.biases[6].code, 16) << "incorrect value for last_msg_.biases[6].code, expected 16, is " << last_msg_.biases[6].code; - EXPECT_EQ(last_msg_.biases[6].discontinuity_counter, 34) << "incorrect value for last_msg_.biases[6].discontinuity_counter, expected 34, is " << last_msg_.biases[6].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[6].integer_indicator, 203) << "incorrect value for last_msg_.biases[6].integer_indicator, expected 203, is " << last_msg_.biases[6].integer_indicator; - EXPECT_EQ(last_msg_.biases[6].widelane_integer_indicator, 87) << "incorrect value for last_msg_.biases[6].widelane_integer_indicator, expected 87, is " << last_msg_.biases[6].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[7].bias, -1137604357) << "incorrect value for last_msg_.biases[7].bias, expected -1137604357, is " << last_msg_.biases[7].bias; - EXPECT_EQ(last_msg_.biases[7].code, 102) << "incorrect value for last_msg_.biases[7].code, expected 102, is " << last_msg_.biases[7].code; - EXPECT_EQ(last_msg_.biases[7].discontinuity_counter, 22) << "incorrect value for last_msg_.biases[7].discontinuity_counter, expected 22, is " << last_msg_.biases[7].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[7].integer_indicator, 156) << "incorrect value for last_msg_.biases[7].integer_indicator, expected 156, is " << last_msg_.biases[7].integer_indicator; - EXPECT_EQ(last_msg_.biases[7].widelane_integer_indicator, 252) << "incorrect value for last_msg_.biases[7].widelane_integer_indicator, expected 252, is " << last_msg_.biases[7].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[8].bias, -1910370172) << "incorrect value for last_msg_.biases[8].bias, expected -1910370172, is " << last_msg_.biases[8].bias; - EXPECT_EQ(last_msg_.biases[8].code, 157) << "incorrect value for last_msg_.biases[8].code, expected 157, is " << last_msg_.biases[8].code; - EXPECT_EQ(last_msg_.biases[8].discontinuity_counter, 49) << "incorrect value for last_msg_.biases[8].discontinuity_counter, expected 49, is " << last_msg_.biases[8].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[8].integer_indicator, 222) << "incorrect value for last_msg_.biases[8].integer_indicator, expected 222, is " << last_msg_.biases[8].integer_indicator; - EXPECT_EQ(last_msg_.biases[8].widelane_integer_indicator, 245) << "incorrect value for last_msg_.biases[8].widelane_integer_indicator, expected 245, is " << last_msg_.biases[8].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[9].bias, 1247996869) << "incorrect value for last_msg_.biases[9].bias, expected 1247996869, is " << last_msg_.biases[9].bias; - EXPECT_EQ(last_msg_.biases[9].code, 228) << "incorrect value for last_msg_.biases[9].code, expected 228, is " << last_msg_.biases[9].code; - EXPECT_EQ(last_msg_.biases[9].discontinuity_counter, 221) << "incorrect value for last_msg_.biases[9].discontinuity_counter, expected 221, is " << last_msg_.biases[9].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[9].integer_indicator, 85) << "incorrect value for last_msg_.biases[9].integer_indicator, expected 85, is " << last_msg_.biases[9].integer_indicator; - EXPECT_EQ(last_msg_.biases[9].widelane_integer_indicator, 139) << "incorrect value for last_msg_.biases[9].widelane_integer_indicator, expected 139, is " << last_msg_.biases[9].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[10].bias, -1133446161) << "incorrect value for last_msg_.biases[10].bias, expected -1133446161, is " << last_msg_.biases[10].bias; - EXPECT_EQ(last_msg_.biases[10].code, 107) << "incorrect value for last_msg_.biases[10].code, expected 107, is " << last_msg_.biases[10].code; - EXPECT_EQ(last_msg_.biases[10].discontinuity_counter, 38) << "incorrect value for last_msg_.biases[10].discontinuity_counter, expected 38, is " << last_msg_.biases[10].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[10].integer_indicator, 70) << "incorrect value for last_msg_.biases[10].integer_indicator, expected 70, is " << last_msg_.biases[10].integer_indicator; - EXPECT_EQ(last_msg_.biases[10].widelane_integer_indicator, 36) << "incorrect value for last_msg_.biases[10].widelane_integer_indicator, expected 36, is " << last_msg_.biases[10].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[11].bias, -720934762) << "incorrect value for last_msg_.biases[11].bias, expected -720934762, is " << last_msg_.biases[11].bias; - EXPECT_EQ(last_msg_.biases[11].code, 124) << "incorrect value for last_msg_.biases[11].code, expected 124, is " << last_msg_.biases[11].code; - EXPECT_EQ(last_msg_.biases[11].discontinuity_counter, 164) << "incorrect value for last_msg_.biases[11].discontinuity_counter, expected 164, is " << last_msg_.biases[11].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[11].integer_indicator, 246) << "incorrect value for last_msg_.biases[11].integer_indicator, expected 246, is " << last_msg_.biases[11].integer_indicator; - EXPECT_EQ(last_msg_.biases[11].widelane_integer_indicator, 141) << "incorrect value for last_msg_.biases[11].widelane_integer_indicator, expected 141, is " << last_msg_.biases[11].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[12].bias, 706252548) << "incorrect value for last_msg_.biases[12].bias, expected 706252548, is " << last_msg_.biases[12].bias; - EXPECT_EQ(last_msg_.biases[12].code, 44) << "incorrect value for last_msg_.biases[12].code, expected 44, is " << last_msg_.biases[12].code; - EXPECT_EQ(last_msg_.biases[12].discontinuity_counter, 192) << "incorrect value for last_msg_.biases[12].discontinuity_counter, expected 192, is " << last_msg_.biases[12].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[12].integer_indicator, 21) << "incorrect value for last_msg_.biases[12].integer_indicator, expected 21, is " << last_msg_.biases[12].integer_indicator; - EXPECT_EQ(last_msg_.biases[12].widelane_integer_indicator, 244) << "incorrect value for last_msg_.biases[12].widelane_integer_indicator, expected 244, is " << last_msg_.biases[12].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[13].bias, 388855338) << "incorrect value for last_msg_.biases[13].bias, expected 388855338, is " << last_msg_.biases[13].bias; - EXPECT_EQ(last_msg_.biases[13].code, 21) << "incorrect value for last_msg_.biases[13].code, expected 21, is " << last_msg_.biases[13].code; - EXPECT_EQ(last_msg_.biases[13].discontinuity_counter, 7) << "incorrect value for last_msg_.biases[13].discontinuity_counter, expected 7, is " << last_msg_.biases[13].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[13].integer_indicator, 84) << "incorrect value for last_msg_.biases[13].integer_indicator, expected 84, is " << last_msg_.biases[13].integer_indicator; - EXPECT_EQ(last_msg_.biases[13].widelane_integer_indicator, 136) << "incorrect value for last_msg_.biases[13].widelane_integer_indicator, expected 136, is " << last_msg_.biases[13].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[14].bias, 47517353) << "incorrect value for last_msg_.biases[14].bias, expected 47517353, is " << last_msg_.biases[14].bias; - EXPECT_EQ(last_msg_.biases[14].code, 174) << "incorrect value for last_msg_.biases[14].code, expected 174, is " << last_msg_.biases[14].code; - EXPECT_EQ(last_msg_.biases[14].discontinuity_counter, 54) << "incorrect value for last_msg_.biases[14].discontinuity_counter, expected 54, is " << last_msg_.biases[14].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[14].integer_indicator, 175) << "incorrect value for last_msg_.biases[14].integer_indicator, expected 175, is " << last_msg_.biases[14].integer_indicator; - EXPECT_EQ(last_msg_.biases[14].widelane_integer_indicator, 129) << "incorrect value for last_msg_.biases[14].widelane_integer_indicator, expected 129, is " << last_msg_.biases[14].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[15].bias, -2124125745) << "incorrect value for last_msg_.biases[15].bias, expected -2124125745, is " << last_msg_.biases[15].bias; - EXPECT_EQ(last_msg_.biases[15].code, 197) << "incorrect value for last_msg_.biases[15].code, expected 197, is " << last_msg_.biases[15].code; - EXPECT_EQ(last_msg_.biases[15].discontinuity_counter, 13) << "incorrect value for last_msg_.biases[15].discontinuity_counter, expected 13, is " << last_msg_.biases[15].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[15].integer_indicator, 98) << "incorrect value for last_msg_.biases[15].integer_indicator, expected 98, is " << last_msg_.biases[15].integer_indicator; - EXPECT_EQ(last_msg_.biases[15].widelane_integer_indicator, 60) << "incorrect value for last_msg_.biases[15].widelane_integer_indicator, expected 60, is " << last_msg_.biases[15].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[16].bias, -1401812607) << "incorrect value for last_msg_.biases[16].bias, expected -1401812607, is " << last_msg_.biases[16].bias; - EXPECT_EQ(last_msg_.biases[16].code, 72) << "incorrect value for last_msg_.biases[16].code, expected 72, is " << last_msg_.biases[16].code; - EXPECT_EQ(last_msg_.biases[16].discontinuity_counter, 140) << "incorrect value for last_msg_.biases[16].discontinuity_counter, expected 140, is " << last_msg_.biases[16].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[16].integer_indicator, 136) << "incorrect value for last_msg_.biases[16].integer_indicator, expected 136, is " << last_msg_.biases[16].integer_indicator; - EXPECT_EQ(last_msg_.biases[16].widelane_integer_indicator, 240) << "incorrect value for last_msg_.biases[16].widelane_integer_indicator, expected 240, is " << last_msg_.biases[16].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[17].bias, 60257151) << "incorrect value for last_msg_.biases[17].bias, expected 60257151, is " << last_msg_.biases[17].bias; - EXPECT_EQ(last_msg_.biases[17].code, 151) << "incorrect value for last_msg_.biases[17].code, expected 151, is " << last_msg_.biases[17].code; - EXPECT_EQ(last_msg_.biases[17].discontinuity_counter, 210) << "incorrect value for last_msg_.biases[17].discontinuity_counter, expected 210, is " << last_msg_.biases[17].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[17].integer_indicator, 150) << "incorrect value for last_msg_.biases[17].integer_indicator, expected 150, is " << last_msg_.biases[17].integer_indicator; - EXPECT_EQ(last_msg_.biases[17].widelane_integer_indicator, 17) << "incorrect value for last_msg_.biases[17].widelane_integer_indicator, expected 17, is " << last_msg_.biases[17].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[18].bias, 41820677) << "incorrect value for last_msg_.biases[18].bias, expected 41820677, is " << last_msg_.biases[18].bias; - EXPECT_EQ(last_msg_.biases[18].code, 242) << "incorrect value for last_msg_.biases[18].code, expected 242, is " << last_msg_.biases[18].code; - EXPECT_EQ(last_msg_.biases[18].discontinuity_counter, 14) << "incorrect value for last_msg_.biases[18].discontinuity_counter, expected 14, is " << last_msg_.biases[18].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[18].integer_indicator, 254) << "incorrect value for last_msg_.biases[18].integer_indicator, expected 254, is " << last_msg_.biases[18].integer_indicator; - EXPECT_EQ(last_msg_.biases[18].widelane_integer_indicator, 215) << "incorrect value for last_msg_.biases[18].widelane_integer_indicator, expected 215, is " << last_msg_.biases[18].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[19].bias, 1640616471) << "incorrect value for last_msg_.biases[19].bias, expected 1640616471, is " << last_msg_.biases[19].bias; - EXPECT_EQ(last_msg_.biases[19].code, 215) << "incorrect value for last_msg_.biases[19].code, expected 215, is " << last_msg_.biases[19].code; - EXPECT_EQ(last_msg_.biases[19].discontinuity_counter, 176) << "incorrect value for last_msg_.biases[19].discontinuity_counter, expected 176, is " << last_msg_.biases[19].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[19].integer_indicator, 65) << "incorrect value for last_msg_.biases[19].integer_indicator, expected 65, is " << last_msg_.biases[19].integer_indicator; - EXPECT_EQ(last_msg_.biases[19].widelane_integer_indicator, 38) << "incorrect value for last_msg_.biases[19].widelane_integer_indicator, expected 38, is " << last_msg_.biases[19].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[20].bias, -744786918) << "incorrect value for last_msg_.biases[20].bias, expected -744786918, is " << last_msg_.biases[20].bias; - EXPECT_EQ(last_msg_.biases[20].code, 36) << "incorrect value for last_msg_.biases[20].code, expected 36, is " << last_msg_.biases[20].code; - EXPECT_EQ(last_msg_.biases[20].discontinuity_counter, 224) << "incorrect value for last_msg_.biases[20].discontinuity_counter, expected 224, is " << last_msg_.biases[20].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[20].integer_indicator, 207) << "incorrect value for last_msg_.biases[20].integer_indicator, expected 207, is " << last_msg_.biases[20].integer_indicator; - EXPECT_EQ(last_msg_.biases[20].widelane_integer_indicator, 92) << "incorrect value for last_msg_.biases[20].widelane_integer_indicator, expected 92, is " << last_msg_.biases[20].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[21].bias, 1966589763) << "incorrect value for last_msg_.biases[21].bias, expected 1966589763, is " << last_msg_.biases[21].bias; - EXPECT_EQ(last_msg_.biases[21].code, 165) << "incorrect value for last_msg_.biases[21].code, expected 165, is " << last_msg_.biases[21].code; - EXPECT_EQ(last_msg_.biases[21].discontinuity_counter, 38) << "incorrect value for last_msg_.biases[21].discontinuity_counter, expected 38, is " << last_msg_.biases[21].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[21].integer_indicator, 47) << "incorrect value for last_msg_.biases[21].integer_indicator, expected 47, is " << last_msg_.biases[21].integer_indicator; - EXPECT_EQ(last_msg_.biases[21].widelane_integer_indicator, 102) << "incorrect value for last_msg_.biases[21].widelane_integer_indicator, expected 102, is " << last_msg_.biases[21].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[22].bias, 364366310) << "incorrect value for last_msg_.biases[22].bias, expected 364366310, is " << last_msg_.biases[22].bias; - EXPECT_EQ(last_msg_.biases[22].code, 36) << "incorrect value for last_msg_.biases[22].code, expected 36, is " << last_msg_.biases[22].code; - EXPECT_EQ(last_msg_.biases[22].discontinuity_counter, 1) << "incorrect value for last_msg_.biases[22].discontinuity_counter, expected 1, is " << last_msg_.biases[22].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[22].integer_indicator, 169) << "incorrect value for last_msg_.biases[22].integer_indicator, expected 169, is " << last_msg_.biases[22].integer_indicator; - EXPECT_EQ(last_msg_.biases[22].widelane_integer_indicator, 33) << "incorrect value for last_msg_.biases[22].widelane_integer_indicator, expected 33, is " << last_msg_.biases[22].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[23].bias, -1839031379) << "incorrect value for last_msg_.biases[23].bias, expected -1839031379, is " << last_msg_.biases[23].bias; - EXPECT_EQ(last_msg_.biases[23].code, 42) << "incorrect value for last_msg_.biases[23].code, expected 42, is " << last_msg_.biases[23].code; - EXPECT_EQ(last_msg_.biases[23].discontinuity_counter, 173) << "incorrect value for last_msg_.biases[23].discontinuity_counter, expected 173, is " << last_msg_.biases[23].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[23].integer_indicator, 62) << "incorrect value for last_msg_.biases[23].integer_indicator, expected 62, is " << last_msg_.biases[23].integer_indicator; - EXPECT_EQ(last_msg_.biases[23].widelane_integer_indicator, 147) << "incorrect value for last_msg_.biases[23].widelane_integer_indicator, expected 147, is " << last_msg_.biases[23].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[24].bias, 31817639) << "incorrect value for last_msg_.biases[24].bias, expected 31817639, is " << last_msg_.biases[24].bias; - EXPECT_EQ(last_msg_.biases[24].code, 231) << "incorrect value for last_msg_.biases[24].code, expected 231, is " << last_msg_.biases[24].code; - EXPECT_EQ(last_msg_.biases[24].discontinuity_counter, 82) << "incorrect value for last_msg_.biases[24].discontinuity_counter, expected 82, is " << last_msg_.biases[24].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[24].integer_indicator, 167) << "incorrect value for last_msg_.biases[24].integer_indicator, expected 167, is " << last_msg_.biases[24].integer_indicator; - EXPECT_EQ(last_msg_.biases[24].widelane_integer_indicator, 138) << "incorrect value for last_msg_.biases[24].widelane_integer_indicator, expected 138, is " << last_msg_.biases[24].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[25].bias, -1619830156) << "incorrect value for last_msg_.biases[25].bias, expected -1619830156, is " << last_msg_.biases[25].bias; - EXPECT_EQ(last_msg_.biases[25].code, 2) << "incorrect value for last_msg_.biases[25].code, expected 2, is " << last_msg_.biases[25].code; - EXPECT_EQ(last_msg_.biases[25].discontinuity_counter, 207) << "incorrect value for last_msg_.biases[25].discontinuity_counter, expected 207, is " << last_msg_.biases[25].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[25].integer_indicator, 127) << "incorrect value for last_msg_.biases[25].integer_indicator, expected 127, is " << last_msg_.biases[25].integer_indicator; - EXPECT_EQ(last_msg_.biases[25].widelane_integer_indicator, 237) << "incorrect value for last_msg_.biases[25].widelane_integer_indicator, expected 237, is " << last_msg_.biases[25].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[26].bias, -83375622) << "incorrect value for last_msg_.biases[26].bias, expected -83375622, is " << last_msg_.biases[26].bias; - EXPECT_EQ(last_msg_.biases[26].code, 3) << "incorrect value for last_msg_.biases[26].code, expected 3, is " << last_msg_.biases[26].code; - EXPECT_EQ(last_msg_.biases[26].discontinuity_counter, 145) << "incorrect value for last_msg_.biases[26].discontinuity_counter, expected 145, is " << last_msg_.biases[26].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[26].integer_indicator, 42) << "incorrect value for last_msg_.biases[26].integer_indicator, expected 42, is " << last_msg_.biases[26].integer_indicator; - EXPECT_EQ(last_msg_.biases[26].widelane_integer_indicator, 66) << "incorrect value for last_msg_.biases[26].widelane_integer_indicator, expected 66, is " << last_msg_.biases[26].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[27].bias, 1077458389) << "incorrect value for last_msg_.biases[27].bias, expected 1077458389, is " << last_msg_.biases[27].bias; - EXPECT_EQ(last_msg_.biases[27].code, 2) << "incorrect value for last_msg_.biases[27].code, expected 2, is " << last_msg_.biases[27].code; - EXPECT_EQ(last_msg_.biases[27].discontinuity_counter, 26) << "incorrect value for last_msg_.biases[27].discontinuity_counter, expected 26, is " << last_msg_.biases[27].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[27].integer_indicator, 75) << "incorrect value for last_msg_.biases[27].integer_indicator, expected 75, is " << last_msg_.biases[27].integer_indicator; - EXPECT_EQ(last_msg_.biases[27].widelane_integer_indicator, 230) << "incorrect value for last_msg_.biases[27].widelane_integer_indicator, expected 230, is " << last_msg_.biases[27].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[28].bias, -883355501) << "incorrect value for last_msg_.biases[28].bias, expected -883355501, is " << last_msg_.biases[28].bias; - EXPECT_EQ(last_msg_.biases[28].code, 97) << "incorrect value for last_msg_.biases[28].code, expected 97, is " << last_msg_.biases[28].code; - EXPECT_EQ(last_msg_.biases[28].discontinuity_counter, 6) << "incorrect value for last_msg_.biases[28].discontinuity_counter, expected 6, is " << last_msg_.biases[28].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[28].integer_indicator, 88) << "incorrect value for last_msg_.biases[28].integer_indicator, expected 88, is " << last_msg_.biases[28].integer_indicator; - EXPECT_EQ(last_msg_.biases[28].widelane_integer_indicator, 255) << "incorrect value for last_msg_.biases[28].widelane_integer_indicator, expected 255, is " << last_msg_.biases[28].widelane_integer_indicator; - EXPECT_EQ(last_msg_.biases[29].bias, -1448611273) << "incorrect value for last_msg_.biases[29].bias, expected -1448611273, is " << last_msg_.biases[29].bias; - EXPECT_EQ(last_msg_.biases[29].code, 27) << "incorrect value for last_msg_.biases[29].code, expected 27, is " << last_msg_.biases[29].code; - EXPECT_EQ(last_msg_.biases[29].discontinuity_counter, 230) << "incorrect value for last_msg_.biases[29].discontinuity_counter, expected 230, is " << last_msg_.biases[29].discontinuity_counter; - EXPECT_EQ(last_msg_.biases[29].integer_indicator, 68) << "incorrect value for last_msg_.biases[29].integer_indicator, expected 68, is " << last_msg_.biases[29].integer_indicator; - EXPECT_EQ(last_msg_.biases[29].widelane_integer_indicator, 243) << "incorrect value for last_msg_.biases[29].widelane_integer_indicator, expected 243, is " << last_msg_.biases[29].widelane_integer_indicator; - EXPECT_EQ(last_msg_.dispersive_bias, 98) << "incorrect value for last_msg_.dispersive_bias, expected 98, is " << last_msg_.dispersive_bias; - EXPECT_EQ(last_msg_.iod_ssr, 230) << "incorrect value for last_msg_.iod_ssr, expected 230, is " << last_msg_.iod_ssr; - EXPECT_EQ(last_msg_.mw_consistency, 209) << "incorrect value for last_msg_.mw_consistency, expected 209, is " << last_msg_.mw_consistency; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_biases.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_biases.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_biases.handle_as << "'"; - } - { - const char check_string[] = { (char)98,(char)105,(char)97,(char)115,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_biases.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_biases.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_biases.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_biases.value, 30) << "incorrect value for last_msg_.n_biases.value, expected 30, is " << last_msg_.n_biases.value; - EXPECT_EQ(last_msg_.sid.code, 82) << "incorrect value for last_msg_.sid.code, expected 82, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.sat, 169) << "incorrect value for last_msg_.sid.sat, expected 169, is " << last_msg_.sid.sat; - EXPECT_EQ(last_msg_.time.tow, 210803409) << "incorrect value for last_msg_.time.tow, expected 210803409, is " << last_msg_.time.tow; - EXPECT_EQ(last_msg_.time.wn, 42197) << "incorrect value for last_msg_.time.wn, expected 42197, is " << last_msg_.time.wn; - EXPECT_EQ(last_msg_.update_interval, 177) << "incorrect value for last_msg_.update_interval, expected 177, is " << last_msg_.update_interval; - EXPECT_EQ(last_msg_.yaw, 5881) << "incorrect value for last_msg_.yaw, expected 5881, is " << last_msg_.yaw; - EXPECT_EQ(last_msg_.yaw_rate, 17) << "incorrect value for last_msg_.yaw_rate, expected 17, is " << last_msg_.yaw_rate; +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrPhaseBiases0, Test) { + uint8_t encoded_frame[] = { + 85, 230, 5, 219, 206, 255, 209, 154, 144, 12, 213, 164, 169, 82, 177, + 230, 98, 209, 249, 22, 17, 29, 250, 245, 193, 219, 30, 212, 177, 207, + 187, 33, 146, 58, 204, 164, 65, 114, 49, 248, 52, 8, 161, 44, 252, + 166, 168, 232, 124, 134, 86, 173, 241, 174, 44, 142, 155, 129, 143, 184, + 161, 211, 15, 36, 189, 208, 194, 221, 152, 16, 203, 87, 34, 188, 141, + 104, 189, 102, 156, 252, 22, 251, 136, 49, 188, 157, 222, 245, 49, 132, + 16, 34, 142, 228, 85, 139, 221, 197, 235, 98, 74, 107, 70, 36, 38, + 239, 251, 112, 188, 124, 246, 141, 164, 150, 104, 7, 213, 44, 21, 244, + 192, 4, 143, 24, 42, 21, 84, 136, 7, 42, 118, 45, 23, 174, 175, + 129, 54, 169, 14, 213, 2, 197, 98, 60, 13, 207, 105, 100, 129, 72, + 136, 240, 140, 129, 9, 114, 172, 151, 150, 17, 210, 127, 115, 151, 3, + 242, 254, 215, 14, 5, 34, 126, 2, 215, 65, 38, 176, 23, 210, 201, + 97, 36, 207, 92, 224, 26, 116, 155, 211, 165, 47, 102, 38, 67, 199, + 55, 117, 36, 169, 33, 1, 230, 201, 183, 21, 42, 62, 147, 173, 173, + 155, 98, 146, 231, 167, 138, 82, 167, 127, 229, 1, 2, 127, 237, 207, + 116, 90, 115, 159, 3, 42, 66, 145, 250, 201, 7, 251, 2, 75, 230, + 26, 213, 181, 56, 64, 97, 88, 255, 6, 147, 16, 89, 203, 27, 68, + 243, 230, 55, 242, 167, 169, 219, 240, + }; + + sbp_msg_ssr_phase_biases_t test_msg{}; + + test_msg.biases[0].bias = -1311498533; + test_msg.biases[0].code = 29; + test_msg.biases[0].discontinuity_counter = 193; + test_msg.biases[0].integer_indicator = 250; + test_msg.biases[0].widelane_integer_indicator = 245; + + test_msg.biases[1].bias = 1101319226; + test_msg.biases[1].code = 207; + test_msg.biases[1].discontinuity_counter = 146; + test_msg.biases[1].integer_indicator = 187; + test_msg.biases[1].widelane_integer_indicator = 33; + + test_msg.biases[2].bias = -64184056; + test_msg.biases[2].code = 114; + test_msg.biases[2].discontinuity_counter = 52; + test_msg.biases[2].integer_indicator = 49; + test_msg.biases[2].widelane_integer_indicator = 248; + + test_msg.biases[3].bias = -240298362; + test_msg.biases[3].code = 166; + test_msg.biases[3].discontinuity_counter = 124; + test_msg.biases[3].integer_indicator = 168; + test_msg.biases[3].widelane_integer_indicator = 232; + + test_msg.biases[4].bias = -1581740159; + test_msg.biases[4].code = 174; + test_msg.biases[4].discontinuity_counter = 155; + test_msg.biases[4].integer_indicator = 44; + test_msg.biases[4].widelane_integer_indicator = 142; + + test_msg.biases[5].bias = -1730297136; + test_msg.biases[5].code = 211; + test_msg.biases[5].discontinuity_counter = 189; + test_msg.biases[5].integer_indicator = 15; + test_msg.biases[5].widelane_integer_indicator = 36; + + test_msg.biases[6].bias = -1117221444; + test_msg.biases[6].code = 16; + test_msg.biases[6].discontinuity_counter = 34; + test_msg.biases[6].integer_indicator = 203; + test_msg.biases[6].widelane_integer_indicator = 87; + + test_msg.biases[7].bias = -1137604357; + test_msg.biases[7].code = 102; + test_msg.biases[7].discontinuity_counter = 22; + test_msg.biases[7].integer_indicator = 156; + test_msg.biases[7].widelane_integer_indicator = 252; + + test_msg.biases[8].bias = -1910370172; + test_msg.biases[8].code = 157; + test_msg.biases[8].discontinuity_counter = 49; + test_msg.biases[8].integer_indicator = 222; + test_msg.biases[8].widelane_integer_indicator = 245; + + test_msg.biases[9].bias = 1247996869; + test_msg.biases[9].code = 228; + test_msg.biases[9].discontinuity_counter = 221; + test_msg.biases[9].integer_indicator = 85; + test_msg.biases[9].widelane_integer_indicator = 139; + + test_msg.biases[10].bias = -1133446161; + test_msg.biases[10].code = 107; + test_msg.biases[10].discontinuity_counter = 38; + test_msg.biases[10].integer_indicator = 70; + test_msg.biases[10].widelane_integer_indicator = 36; + + test_msg.biases[11].bias = -720934762; + test_msg.biases[11].code = 124; + test_msg.biases[11].discontinuity_counter = 164; + test_msg.biases[11].integer_indicator = 246; + test_msg.biases[11].widelane_integer_indicator = 141; + + test_msg.biases[12].bias = 706252548; + test_msg.biases[12].code = 44; + test_msg.biases[12].discontinuity_counter = 192; + test_msg.biases[12].integer_indicator = 21; + test_msg.biases[12].widelane_integer_indicator = 244; + + test_msg.biases[13].bias = 388855338; + test_msg.biases[13].code = 21; + test_msg.biases[13].discontinuity_counter = 7; + test_msg.biases[13].integer_indicator = 84; + test_msg.biases[13].widelane_integer_indicator = 136; + + test_msg.biases[14].bias = 47517353; + test_msg.biases[14].code = 174; + test_msg.biases[14].discontinuity_counter = 54; + test_msg.biases[14].integer_indicator = 175; + test_msg.biases[14].widelane_integer_indicator = 129; + + test_msg.biases[15].bias = -2124125745; + test_msg.biases[15].code = 197; + test_msg.biases[15].discontinuity_counter = 13; + test_msg.biases[15].integer_indicator = 98; + test_msg.biases[15].widelane_integer_indicator = 60; + + test_msg.biases[16].bias = -1401812607; + test_msg.biases[16].code = 72; + test_msg.biases[16].discontinuity_counter = 140; + test_msg.biases[16].integer_indicator = 136; + test_msg.biases[16].widelane_integer_indicator = 240; + + test_msg.biases[17].bias = 60257151; + test_msg.biases[17].code = 151; + test_msg.biases[17].discontinuity_counter = 210; + test_msg.biases[17].integer_indicator = 150; + test_msg.biases[17].widelane_integer_indicator = 17; + + test_msg.biases[18].bias = 41820677; + test_msg.biases[18].code = 242; + test_msg.biases[18].discontinuity_counter = 14; + test_msg.biases[18].integer_indicator = 254; + test_msg.biases[18].widelane_integer_indicator = 215; + + test_msg.biases[19].bias = 1640616471; + test_msg.biases[19].code = 215; + test_msg.biases[19].discontinuity_counter = 176; + test_msg.biases[19].integer_indicator = 65; + test_msg.biases[19].widelane_integer_indicator = 38; + + test_msg.biases[20].bias = -744786918; + test_msg.biases[20].code = 36; + test_msg.biases[20].discontinuity_counter = 224; + test_msg.biases[20].integer_indicator = 207; + test_msg.biases[20].widelane_integer_indicator = 92; + + test_msg.biases[21].bias = 1966589763; + test_msg.biases[21].code = 165; + test_msg.biases[21].discontinuity_counter = 38; + test_msg.biases[21].integer_indicator = 47; + test_msg.biases[21].widelane_integer_indicator = 102; + + test_msg.biases[22].bias = 364366310; + test_msg.biases[22].code = 36; + test_msg.biases[22].discontinuity_counter = 1; + test_msg.biases[22].integer_indicator = 169; + test_msg.biases[22].widelane_integer_indicator = 33; + + test_msg.biases[23].bias = -1839031379; + test_msg.biases[23].code = 42; + test_msg.biases[23].discontinuity_counter = 173; + test_msg.biases[23].integer_indicator = 62; + test_msg.biases[23].widelane_integer_indicator = 147; + + test_msg.biases[24].bias = 31817639; + test_msg.biases[24].code = 231; + test_msg.biases[24].discontinuity_counter = 82; + test_msg.biases[24].integer_indicator = 167; + test_msg.biases[24].widelane_integer_indicator = 138; + + test_msg.biases[25].bias = -1619830156; + test_msg.biases[25].code = 2; + test_msg.biases[25].discontinuity_counter = 207; + test_msg.biases[25].integer_indicator = 127; + test_msg.biases[25].widelane_integer_indicator = 237; + + test_msg.biases[26].bias = -83375622; + test_msg.biases[26].code = 3; + test_msg.biases[26].discontinuity_counter = 145; + test_msg.biases[26].integer_indicator = 42; + test_msg.biases[26].widelane_integer_indicator = 66; + + test_msg.biases[27].bias = 1077458389; + test_msg.biases[27].code = 2; + test_msg.biases[27].discontinuity_counter = 26; + test_msg.biases[27].integer_indicator = 75; + test_msg.biases[27].widelane_integer_indicator = 230; + + test_msg.biases[28].bias = -883355501; + test_msg.biases[28].code = 97; + test_msg.biases[28].discontinuity_counter = 6; + test_msg.biases[28].integer_indicator = 88; + test_msg.biases[28].widelane_integer_indicator = 255; + + test_msg.biases[29].bias = -1448611273; + test_msg.biases[29].code = 27; + test_msg.biases[29].discontinuity_counter = 230; + test_msg.biases[29].integer_indicator = 68; + test_msg.biases[29].widelane_integer_indicator = 243; + test_msg.dispersive_bias = 98; + test_msg.iod_ssr = 230; + test_msg.mw_consistency = 209; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_biases.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)98, (char)105, (char)97, + (char)115, (char)101, (char)115}; + memcpy(test_msg.n_biases.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_biases.value = 30; + test_msg.sid.code = 82; + test_msg.sid.sat = 169; + test_msg.time.tow = 210803409; + test_msg.time.wn = 42197; + test_msg.update_interval = 177; + test_msg.yaw = 5881; + test_msg.yaw_rate = 17; + + EXPECT_EQ(send_message(52955, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 52955); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.biases[0].bias, -1311498533) + << "incorrect value for last_msg_.biases[0].bias, expected -1311498533, " + "is " + << last_msg_.biases[0].bias; + EXPECT_EQ(last_msg_.biases[0].code, 29) + << "incorrect value for last_msg_.biases[0].code, expected 29, is " + << last_msg_.biases[0].code; + EXPECT_EQ(last_msg_.biases[0].discontinuity_counter, 193) + << "incorrect value for last_msg_.biases[0].discontinuity_counter, " + "expected 193, is " + << last_msg_.biases[0].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[0].integer_indicator, 250) + << "incorrect value for last_msg_.biases[0].integer_indicator, expected " + "250, is " + << last_msg_.biases[0].integer_indicator; + EXPECT_EQ(last_msg_.biases[0].widelane_integer_indicator, 245) + << "incorrect value for last_msg_.biases[0].widelane_integer_indicator, " + "expected 245, is " + << last_msg_.biases[0].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[1].bias, 1101319226) + << "incorrect value for last_msg_.biases[1].bias, expected 1101319226, " + "is " + << last_msg_.biases[1].bias; + EXPECT_EQ(last_msg_.biases[1].code, 207) + << "incorrect value for last_msg_.biases[1].code, expected 207, is " + << last_msg_.biases[1].code; + EXPECT_EQ(last_msg_.biases[1].discontinuity_counter, 146) + << "incorrect value for last_msg_.biases[1].discontinuity_counter, " + "expected 146, is " + << last_msg_.biases[1].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[1].integer_indicator, 187) + << "incorrect value for last_msg_.biases[1].integer_indicator, expected " + "187, is " + << last_msg_.biases[1].integer_indicator; + EXPECT_EQ(last_msg_.biases[1].widelane_integer_indicator, 33) + << "incorrect value for last_msg_.biases[1].widelane_integer_indicator, " + "expected 33, is " + << last_msg_.biases[1].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[2].bias, -64184056) + << "incorrect value for last_msg_.biases[2].bias, expected -64184056, is " + << last_msg_.biases[2].bias; + EXPECT_EQ(last_msg_.biases[2].code, 114) + << "incorrect value for last_msg_.biases[2].code, expected 114, is " + << last_msg_.biases[2].code; + EXPECT_EQ(last_msg_.biases[2].discontinuity_counter, 52) + << "incorrect value for last_msg_.biases[2].discontinuity_counter, " + "expected 52, is " + << last_msg_.biases[2].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[2].integer_indicator, 49) + << "incorrect value for last_msg_.biases[2].integer_indicator, expected " + "49, is " + << last_msg_.biases[2].integer_indicator; + EXPECT_EQ(last_msg_.biases[2].widelane_integer_indicator, 248) + << "incorrect value for last_msg_.biases[2].widelane_integer_indicator, " + "expected 248, is " + << last_msg_.biases[2].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[3].bias, -240298362) + << "incorrect value for last_msg_.biases[3].bias, expected -240298362, " + "is " + << last_msg_.biases[3].bias; + EXPECT_EQ(last_msg_.biases[3].code, 166) + << "incorrect value for last_msg_.biases[3].code, expected 166, is " + << last_msg_.biases[3].code; + EXPECT_EQ(last_msg_.biases[3].discontinuity_counter, 124) + << "incorrect value for last_msg_.biases[3].discontinuity_counter, " + "expected 124, is " + << last_msg_.biases[3].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[3].integer_indicator, 168) + << "incorrect value for last_msg_.biases[3].integer_indicator, expected " + "168, is " + << last_msg_.biases[3].integer_indicator; + EXPECT_EQ(last_msg_.biases[3].widelane_integer_indicator, 232) + << "incorrect value for last_msg_.biases[3].widelane_integer_indicator, " + "expected 232, is " + << last_msg_.biases[3].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[4].bias, -1581740159) + << "incorrect value for last_msg_.biases[4].bias, expected -1581740159, " + "is " + << last_msg_.biases[4].bias; + EXPECT_EQ(last_msg_.biases[4].code, 174) + << "incorrect value for last_msg_.biases[4].code, expected 174, is " + << last_msg_.biases[4].code; + EXPECT_EQ(last_msg_.biases[4].discontinuity_counter, 155) + << "incorrect value for last_msg_.biases[4].discontinuity_counter, " + "expected 155, is " + << last_msg_.biases[4].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[4].integer_indicator, 44) + << "incorrect value for last_msg_.biases[4].integer_indicator, expected " + "44, is " + << last_msg_.biases[4].integer_indicator; + EXPECT_EQ(last_msg_.biases[4].widelane_integer_indicator, 142) + << "incorrect value for last_msg_.biases[4].widelane_integer_indicator, " + "expected 142, is " + << last_msg_.biases[4].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[5].bias, -1730297136) + << "incorrect value for last_msg_.biases[5].bias, expected -1730297136, " + "is " + << last_msg_.biases[5].bias; + EXPECT_EQ(last_msg_.biases[5].code, 211) + << "incorrect value for last_msg_.biases[5].code, expected 211, is " + << last_msg_.biases[5].code; + EXPECT_EQ(last_msg_.biases[5].discontinuity_counter, 189) + << "incorrect value for last_msg_.biases[5].discontinuity_counter, " + "expected 189, is " + << last_msg_.biases[5].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[5].integer_indicator, 15) + << "incorrect value for last_msg_.biases[5].integer_indicator, expected " + "15, is " + << last_msg_.biases[5].integer_indicator; + EXPECT_EQ(last_msg_.biases[5].widelane_integer_indicator, 36) + << "incorrect value for last_msg_.biases[5].widelane_integer_indicator, " + "expected 36, is " + << last_msg_.biases[5].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[6].bias, -1117221444) + << "incorrect value for last_msg_.biases[6].bias, expected -1117221444, " + "is " + << last_msg_.biases[6].bias; + EXPECT_EQ(last_msg_.biases[6].code, 16) + << "incorrect value for last_msg_.biases[6].code, expected 16, is " + << last_msg_.biases[6].code; + EXPECT_EQ(last_msg_.biases[6].discontinuity_counter, 34) + << "incorrect value for last_msg_.biases[6].discontinuity_counter, " + "expected 34, is " + << last_msg_.biases[6].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[6].integer_indicator, 203) + << "incorrect value for last_msg_.biases[6].integer_indicator, expected " + "203, is " + << last_msg_.biases[6].integer_indicator; + EXPECT_EQ(last_msg_.biases[6].widelane_integer_indicator, 87) + << "incorrect value for last_msg_.biases[6].widelane_integer_indicator, " + "expected 87, is " + << last_msg_.biases[6].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[7].bias, -1137604357) + << "incorrect value for last_msg_.biases[7].bias, expected -1137604357, " + "is " + << last_msg_.biases[7].bias; + EXPECT_EQ(last_msg_.biases[7].code, 102) + << "incorrect value for last_msg_.biases[7].code, expected 102, is " + << last_msg_.biases[7].code; + EXPECT_EQ(last_msg_.biases[7].discontinuity_counter, 22) + << "incorrect value for last_msg_.biases[7].discontinuity_counter, " + "expected 22, is " + << last_msg_.biases[7].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[7].integer_indicator, 156) + << "incorrect value for last_msg_.biases[7].integer_indicator, expected " + "156, is " + << last_msg_.biases[7].integer_indicator; + EXPECT_EQ(last_msg_.biases[7].widelane_integer_indicator, 252) + << "incorrect value for last_msg_.biases[7].widelane_integer_indicator, " + "expected 252, is " + << last_msg_.biases[7].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[8].bias, -1910370172) + << "incorrect value for last_msg_.biases[8].bias, expected -1910370172, " + "is " + << last_msg_.biases[8].bias; + EXPECT_EQ(last_msg_.biases[8].code, 157) + << "incorrect value for last_msg_.biases[8].code, expected 157, is " + << last_msg_.biases[8].code; + EXPECT_EQ(last_msg_.biases[8].discontinuity_counter, 49) + << "incorrect value for last_msg_.biases[8].discontinuity_counter, " + "expected 49, is " + << last_msg_.biases[8].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[8].integer_indicator, 222) + << "incorrect value for last_msg_.biases[8].integer_indicator, expected " + "222, is " + << last_msg_.biases[8].integer_indicator; + EXPECT_EQ(last_msg_.biases[8].widelane_integer_indicator, 245) + << "incorrect value for last_msg_.biases[8].widelane_integer_indicator, " + "expected 245, is " + << last_msg_.biases[8].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[9].bias, 1247996869) + << "incorrect value for last_msg_.biases[9].bias, expected 1247996869, " + "is " + << last_msg_.biases[9].bias; + EXPECT_EQ(last_msg_.biases[9].code, 228) + << "incorrect value for last_msg_.biases[9].code, expected 228, is " + << last_msg_.biases[9].code; + EXPECT_EQ(last_msg_.biases[9].discontinuity_counter, 221) + << "incorrect value for last_msg_.biases[9].discontinuity_counter, " + "expected 221, is " + << last_msg_.biases[9].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[9].integer_indicator, 85) + << "incorrect value for last_msg_.biases[9].integer_indicator, expected " + "85, is " + << last_msg_.biases[9].integer_indicator; + EXPECT_EQ(last_msg_.biases[9].widelane_integer_indicator, 139) + << "incorrect value for last_msg_.biases[9].widelane_integer_indicator, " + "expected 139, is " + << last_msg_.biases[9].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[10].bias, -1133446161) + << "incorrect value for last_msg_.biases[10].bias, expected -1133446161, " + "is " + << last_msg_.biases[10].bias; + EXPECT_EQ(last_msg_.biases[10].code, 107) + << "incorrect value for last_msg_.biases[10].code, expected 107, is " + << last_msg_.biases[10].code; + EXPECT_EQ(last_msg_.biases[10].discontinuity_counter, 38) + << "incorrect value for last_msg_.biases[10].discontinuity_counter, " + "expected 38, is " + << last_msg_.biases[10].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[10].integer_indicator, 70) + << "incorrect value for last_msg_.biases[10].integer_indicator, expected " + "70, is " + << last_msg_.biases[10].integer_indicator; + EXPECT_EQ(last_msg_.biases[10].widelane_integer_indicator, 36) + << "incorrect value for last_msg_.biases[10].widelane_integer_indicator, " + "expected 36, is " + << last_msg_.biases[10].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[11].bias, -720934762) + << "incorrect value for last_msg_.biases[11].bias, expected -720934762, " + "is " + << last_msg_.biases[11].bias; + EXPECT_EQ(last_msg_.biases[11].code, 124) + << "incorrect value for last_msg_.biases[11].code, expected 124, is " + << last_msg_.biases[11].code; + EXPECT_EQ(last_msg_.biases[11].discontinuity_counter, 164) + << "incorrect value for last_msg_.biases[11].discontinuity_counter, " + "expected 164, is " + << last_msg_.biases[11].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[11].integer_indicator, 246) + << "incorrect value for last_msg_.biases[11].integer_indicator, expected " + "246, is " + << last_msg_.biases[11].integer_indicator; + EXPECT_EQ(last_msg_.biases[11].widelane_integer_indicator, 141) + << "incorrect value for last_msg_.biases[11].widelane_integer_indicator, " + "expected 141, is " + << last_msg_.biases[11].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[12].bias, 706252548) + << "incorrect value for last_msg_.biases[12].bias, expected 706252548, " + "is " + << last_msg_.biases[12].bias; + EXPECT_EQ(last_msg_.biases[12].code, 44) + << "incorrect value for last_msg_.biases[12].code, expected 44, is " + << last_msg_.biases[12].code; + EXPECT_EQ(last_msg_.biases[12].discontinuity_counter, 192) + << "incorrect value for last_msg_.biases[12].discontinuity_counter, " + "expected 192, is " + << last_msg_.biases[12].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[12].integer_indicator, 21) + << "incorrect value for last_msg_.biases[12].integer_indicator, expected " + "21, is " + << last_msg_.biases[12].integer_indicator; + EXPECT_EQ(last_msg_.biases[12].widelane_integer_indicator, 244) + << "incorrect value for last_msg_.biases[12].widelane_integer_indicator, " + "expected 244, is " + << last_msg_.biases[12].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[13].bias, 388855338) + << "incorrect value for last_msg_.biases[13].bias, expected 388855338, " + "is " + << last_msg_.biases[13].bias; + EXPECT_EQ(last_msg_.biases[13].code, 21) + << "incorrect value for last_msg_.biases[13].code, expected 21, is " + << last_msg_.biases[13].code; + EXPECT_EQ(last_msg_.biases[13].discontinuity_counter, 7) + << "incorrect value for last_msg_.biases[13].discontinuity_counter, " + "expected 7, is " + << last_msg_.biases[13].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[13].integer_indicator, 84) + << "incorrect value for last_msg_.biases[13].integer_indicator, expected " + "84, is " + << last_msg_.biases[13].integer_indicator; + EXPECT_EQ(last_msg_.biases[13].widelane_integer_indicator, 136) + << "incorrect value for last_msg_.biases[13].widelane_integer_indicator, " + "expected 136, is " + << last_msg_.biases[13].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[14].bias, 47517353) + << "incorrect value for last_msg_.biases[14].bias, expected 47517353, is " + << last_msg_.biases[14].bias; + EXPECT_EQ(last_msg_.biases[14].code, 174) + << "incorrect value for last_msg_.biases[14].code, expected 174, is " + << last_msg_.biases[14].code; + EXPECT_EQ(last_msg_.biases[14].discontinuity_counter, 54) + << "incorrect value for last_msg_.biases[14].discontinuity_counter, " + "expected 54, is " + << last_msg_.biases[14].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[14].integer_indicator, 175) + << "incorrect value for last_msg_.biases[14].integer_indicator, expected " + "175, is " + << last_msg_.biases[14].integer_indicator; + EXPECT_EQ(last_msg_.biases[14].widelane_integer_indicator, 129) + << "incorrect value for last_msg_.biases[14].widelane_integer_indicator, " + "expected 129, is " + << last_msg_.biases[14].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[15].bias, -2124125745) + << "incorrect value for last_msg_.biases[15].bias, expected -2124125745, " + "is " + << last_msg_.biases[15].bias; + EXPECT_EQ(last_msg_.biases[15].code, 197) + << "incorrect value for last_msg_.biases[15].code, expected 197, is " + << last_msg_.biases[15].code; + EXPECT_EQ(last_msg_.biases[15].discontinuity_counter, 13) + << "incorrect value for last_msg_.biases[15].discontinuity_counter, " + "expected 13, is " + << last_msg_.biases[15].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[15].integer_indicator, 98) + << "incorrect value for last_msg_.biases[15].integer_indicator, expected " + "98, is " + << last_msg_.biases[15].integer_indicator; + EXPECT_EQ(last_msg_.biases[15].widelane_integer_indicator, 60) + << "incorrect value for last_msg_.biases[15].widelane_integer_indicator, " + "expected 60, is " + << last_msg_.biases[15].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[16].bias, -1401812607) + << "incorrect value for last_msg_.biases[16].bias, expected -1401812607, " + "is " + << last_msg_.biases[16].bias; + EXPECT_EQ(last_msg_.biases[16].code, 72) + << "incorrect value for last_msg_.biases[16].code, expected 72, is " + << last_msg_.biases[16].code; + EXPECT_EQ(last_msg_.biases[16].discontinuity_counter, 140) + << "incorrect value for last_msg_.biases[16].discontinuity_counter, " + "expected 140, is " + << last_msg_.biases[16].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[16].integer_indicator, 136) + << "incorrect value for last_msg_.biases[16].integer_indicator, expected " + "136, is " + << last_msg_.biases[16].integer_indicator; + EXPECT_EQ(last_msg_.biases[16].widelane_integer_indicator, 240) + << "incorrect value for last_msg_.biases[16].widelane_integer_indicator, " + "expected 240, is " + << last_msg_.biases[16].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[17].bias, 60257151) + << "incorrect value for last_msg_.biases[17].bias, expected 60257151, is " + << last_msg_.biases[17].bias; + EXPECT_EQ(last_msg_.biases[17].code, 151) + << "incorrect value for last_msg_.biases[17].code, expected 151, is " + << last_msg_.biases[17].code; + EXPECT_EQ(last_msg_.biases[17].discontinuity_counter, 210) + << "incorrect value for last_msg_.biases[17].discontinuity_counter, " + "expected 210, is " + << last_msg_.biases[17].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[17].integer_indicator, 150) + << "incorrect value for last_msg_.biases[17].integer_indicator, expected " + "150, is " + << last_msg_.biases[17].integer_indicator; + EXPECT_EQ(last_msg_.biases[17].widelane_integer_indicator, 17) + << "incorrect value for last_msg_.biases[17].widelane_integer_indicator, " + "expected 17, is " + << last_msg_.biases[17].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[18].bias, 41820677) + << "incorrect value for last_msg_.biases[18].bias, expected 41820677, is " + << last_msg_.biases[18].bias; + EXPECT_EQ(last_msg_.biases[18].code, 242) + << "incorrect value for last_msg_.biases[18].code, expected 242, is " + << last_msg_.biases[18].code; + EXPECT_EQ(last_msg_.biases[18].discontinuity_counter, 14) + << "incorrect value for last_msg_.biases[18].discontinuity_counter, " + "expected 14, is " + << last_msg_.biases[18].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[18].integer_indicator, 254) + << "incorrect value for last_msg_.biases[18].integer_indicator, expected " + "254, is " + << last_msg_.biases[18].integer_indicator; + EXPECT_EQ(last_msg_.biases[18].widelane_integer_indicator, 215) + << "incorrect value for last_msg_.biases[18].widelane_integer_indicator, " + "expected 215, is " + << last_msg_.biases[18].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[19].bias, 1640616471) + << "incorrect value for last_msg_.biases[19].bias, expected 1640616471, " + "is " + << last_msg_.biases[19].bias; + EXPECT_EQ(last_msg_.biases[19].code, 215) + << "incorrect value for last_msg_.biases[19].code, expected 215, is " + << last_msg_.biases[19].code; + EXPECT_EQ(last_msg_.biases[19].discontinuity_counter, 176) + << "incorrect value for last_msg_.biases[19].discontinuity_counter, " + "expected 176, is " + << last_msg_.biases[19].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[19].integer_indicator, 65) + << "incorrect value for last_msg_.biases[19].integer_indicator, expected " + "65, is " + << last_msg_.biases[19].integer_indicator; + EXPECT_EQ(last_msg_.biases[19].widelane_integer_indicator, 38) + << "incorrect value for last_msg_.biases[19].widelane_integer_indicator, " + "expected 38, is " + << last_msg_.biases[19].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[20].bias, -744786918) + << "incorrect value for last_msg_.biases[20].bias, expected -744786918, " + "is " + << last_msg_.biases[20].bias; + EXPECT_EQ(last_msg_.biases[20].code, 36) + << "incorrect value for last_msg_.biases[20].code, expected 36, is " + << last_msg_.biases[20].code; + EXPECT_EQ(last_msg_.biases[20].discontinuity_counter, 224) + << "incorrect value for last_msg_.biases[20].discontinuity_counter, " + "expected 224, is " + << last_msg_.biases[20].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[20].integer_indicator, 207) + << "incorrect value for last_msg_.biases[20].integer_indicator, expected " + "207, is " + << last_msg_.biases[20].integer_indicator; + EXPECT_EQ(last_msg_.biases[20].widelane_integer_indicator, 92) + << "incorrect value for last_msg_.biases[20].widelane_integer_indicator, " + "expected 92, is " + << last_msg_.biases[20].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[21].bias, 1966589763) + << "incorrect value for last_msg_.biases[21].bias, expected 1966589763, " + "is " + << last_msg_.biases[21].bias; + EXPECT_EQ(last_msg_.biases[21].code, 165) + << "incorrect value for last_msg_.biases[21].code, expected 165, is " + << last_msg_.biases[21].code; + EXPECT_EQ(last_msg_.biases[21].discontinuity_counter, 38) + << "incorrect value for last_msg_.biases[21].discontinuity_counter, " + "expected 38, is " + << last_msg_.biases[21].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[21].integer_indicator, 47) + << "incorrect value for last_msg_.biases[21].integer_indicator, expected " + "47, is " + << last_msg_.biases[21].integer_indicator; + EXPECT_EQ(last_msg_.biases[21].widelane_integer_indicator, 102) + << "incorrect value for last_msg_.biases[21].widelane_integer_indicator, " + "expected 102, is " + << last_msg_.biases[21].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[22].bias, 364366310) + << "incorrect value for last_msg_.biases[22].bias, expected 364366310, " + "is " + << last_msg_.biases[22].bias; + EXPECT_EQ(last_msg_.biases[22].code, 36) + << "incorrect value for last_msg_.biases[22].code, expected 36, is " + << last_msg_.biases[22].code; + EXPECT_EQ(last_msg_.biases[22].discontinuity_counter, 1) + << "incorrect value for last_msg_.biases[22].discontinuity_counter, " + "expected 1, is " + << last_msg_.biases[22].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[22].integer_indicator, 169) + << "incorrect value for last_msg_.biases[22].integer_indicator, expected " + "169, is " + << last_msg_.biases[22].integer_indicator; + EXPECT_EQ(last_msg_.biases[22].widelane_integer_indicator, 33) + << "incorrect value for last_msg_.biases[22].widelane_integer_indicator, " + "expected 33, is " + << last_msg_.biases[22].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[23].bias, -1839031379) + << "incorrect value for last_msg_.biases[23].bias, expected -1839031379, " + "is " + << last_msg_.biases[23].bias; + EXPECT_EQ(last_msg_.biases[23].code, 42) + << "incorrect value for last_msg_.biases[23].code, expected 42, is " + << last_msg_.biases[23].code; + EXPECT_EQ(last_msg_.biases[23].discontinuity_counter, 173) + << "incorrect value for last_msg_.biases[23].discontinuity_counter, " + "expected 173, is " + << last_msg_.biases[23].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[23].integer_indicator, 62) + << "incorrect value for last_msg_.biases[23].integer_indicator, expected " + "62, is " + << last_msg_.biases[23].integer_indicator; + EXPECT_EQ(last_msg_.biases[23].widelane_integer_indicator, 147) + << "incorrect value for last_msg_.biases[23].widelane_integer_indicator, " + "expected 147, is " + << last_msg_.biases[23].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[24].bias, 31817639) + << "incorrect value for last_msg_.biases[24].bias, expected 31817639, is " + << last_msg_.biases[24].bias; + EXPECT_EQ(last_msg_.biases[24].code, 231) + << "incorrect value for last_msg_.biases[24].code, expected 231, is " + << last_msg_.biases[24].code; + EXPECT_EQ(last_msg_.biases[24].discontinuity_counter, 82) + << "incorrect value for last_msg_.biases[24].discontinuity_counter, " + "expected 82, is " + << last_msg_.biases[24].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[24].integer_indicator, 167) + << "incorrect value for last_msg_.biases[24].integer_indicator, expected " + "167, is " + << last_msg_.biases[24].integer_indicator; + EXPECT_EQ(last_msg_.biases[24].widelane_integer_indicator, 138) + << "incorrect value for last_msg_.biases[24].widelane_integer_indicator, " + "expected 138, is " + << last_msg_.biases[24].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[25].bias, -1619830156) + << "incorrect value for last_msg_.biases[25].bias, expected -1619830156, " + "is " + << last_msg_.biases[25].bias; + EXPECT_EQ(last_msg_.biases[25].code, 2) + << "incorrect value for last_msg_.biases[25].code, expected 2, is " + << last_msg_.biases[25].code; + EXPECT_EQ(last_msg_.biases[25].discontinuity_counter, 207) + << "incorrect value for last_msg_.biases[25].discontinuity_counter, " + "expected 207, is " + << last_msg_.biases[25].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[25].integer_indicator, 127) + << "incorrect value for last_msg_.biases[25].integer_indicator, expected " + "127, is " + << last_msg_.biases[25].integer_indicator; + EXPECT_EQ(last_msg_.biases[25].widelane_integer_indicator, 237) + << "incorrect value for last_msg_.biases[25].widelane_integer_indicator, " + "expected 237, is " + << last_msg_.biases[25].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[26].bias, -83375622) + << "incorrect value for last_msg_.biases[26].bias, expected -83375622, " + "is " + << last_msg_.biases[26].bias; + EXPECT_EQ(last_msg_.biases[26].code, 3) + << "incorrect value for last_msg_.biases[26].code, expected 3, is " + << last_msg_.biases[26].code; + EXPECT_EQ(last_msg_.biases[26].discontinuity_counter, 145) + << "incorrect value for last_msg_.biases[26].discontinuity_counter, " + "expected 145, is " + << last_msg_.biases[26].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[26].integer_indicator, 42) + << "incorrect value for last_msg_.biases[26].integer_indicator, expected " + "42, is " + << last_msg_.biases[26].integer_indicator; + EXPECT_EQ(last_msg_.biases[26].widelane_integer_indicator, 66) + << "incorrect value for last_msg_.biases[26].widelane_integer_indicator, " + "expected 66, is " + << last_msg_.biases[26].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[27].bias, 1077458389) + << "incorrect value for last_msg_.biases[27].bias, expected 1077458389, " + "is " + << last_msg_.biases[27].bias; + EXPECT_EQ(last_msg_.biases[27].code, 2) + << "incorrect value for last_msg_.biases[27].code, expected 2, is " + << last_msg_.biases[27].code; + EXPECT_EQ(last_msg_.biases[27].discontinuity_counter, 26) + << "incorrect value for last_msg_.biases[27].discontinuity_counter, " + "expected 26, is " + << last_msg_.biases[27].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[27].integer_indicator, 75) + << "incorrect value for last_msg_.biases[27].integer_indicator, expected " + "75, is " + << last_msg_.biases[27].integer_indicator; + EXPECT_EQ(last_msg_.biases[27].widelane_integer_indicator, 230) + << "incorrect value for last_msg_.biases[27].widelane_integer_indicator, " + "expected 230, is " + << last_msg_.biases[27].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[28].bias, -883355501) + << "incorrect value for last_msg_.biases[28].bias, expected -883355501, " + "is " + << last_msg_.biases[28].bias; + EXPECT_EQ(last_msg_.biases[28].code, 97) + << "incorrect value for last_msg_.biases[28].code, expected 97, is " + << last_msg_.biases[28].code; + EXPECT_EQ(last_msg_.biases[28].discontinuity_counter, 6) + << "incorrect value for last_msg_.biases[28].discontinuity_counter, " + "expected 6, is " + << last_msg_.biases[28].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[28].integer_indicator, 88) + << "incorrect value for last_msg_.biases[28].integer_indicator, expected " + "88, is " + << last_msg_.biases[28].integer_indicator; + EXPECT_EQ(last_msg_.biases[28].widelane_integer_indicator, 255) + << "incorrect value for last_msg_.biases[28].widelane_integer_indicator, " + "expected 255, is " + << last_msg_.biases[28].widelane_integer_indicator; + EXPECT_EQ(last_msg_.biases[29].bias, -1448611273) + << "incorrect value for last_msg_.biases[29].bias, expected -1448611273, " + "is " + << last_msg_.biases[29].bias; + EXPECT_EQ(last_msg_.biases[29].code, 27) + << "incorrect value for last_msg_.biases[29].code, expected 27, is " + << last_msg_.biases[29].code; + EXPECT_EQ(last_msg_.biases[29].discontinuity_counter, 230) + << "incorrect value for last_msg_.biases[29].discontinuity_counter, " + "expected 230, is " + << last_msg_.biases[29].discontinuity_counter; + EXPECT_EQ(last_msg_.biases[29].integer_indicator, 68) + << "incorrect value for last_msg_.biases[29].integer_indicator, expected " + "68, is " + << last_msg_.biases[29].integer_indicator; + EXPECT_EQ(last_msg_.biases[29].widelane_integer_indicator, 243) + << "incorrect value for last_msg_.biases[29].widelane_integer_indicator, " + "expected 243, is " + << last_msg_.biases[29].widelane_integer_indicator; + EXPECT_EQ(last_msg_.dispersive_bias, 98) + << "incorrect value for last_msg_.dispersive_bias, expected 98, is " + << last_msg_.dispersive_bias; + EXPECT_EQ(last_msg_.iod_ssr, 230) + << "incorrect value for last_msg_.iod_ssr, expected 230, is " + << last_msg_.iod_ssr; + EXPECT_EQ(last_msg_.mw_consistency, 209) + << "incorrect value for last_msg_.mw_consistency, expected 209, is " + << last_msg_.mw_consistency; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_biases.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_biases.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_biases.handle_as << "'"; + } + { + const char check_string[] = {(char)98, (char)105, (char)97, + (char)115, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_biases.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_biases.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.n_biases.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_biases.value, 30) + << "incorrect value for last_msg_.n_biases.value, expected 30, is " + << last_msg_.n_biases.value; + EXPECT_EQ(last_msg_.sid.code, 82) + << "incorrect value for last_msg_.sid.code, expected 82, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.sat, 169) + << "incorrect value for last_msg_.sid.sat, expected 169, is " + << last_msg_.sid.sat; + EXPECT_EQ(last_msg_.time.tow, 210803409) + << "incorrect value for last_msg_.time.tow, expected 210803409, is " + << last_msg_.time.tow; + EXPECT_EQ(last_msg_.time.wn, 42197) + << "incorrect value for last_msg_.time.wn, expected 42197, is " + << last_msg_.time.wn; + EXPECT_EQ(last_msg_.update_interval, 177) + << "incorrect value for last_msg_.update_interval, expected 177, is " + << last_msg_.update_interval; + EXPECT_EQ(last_msg_.yaw, 5881) + << "incorrect value for last_msg_.yaw, expected 5881, is " + << last_msg_.yaw; + EXPECT_EQ(last_msg_.yaw_rate, 17) + << "incorrect value for last_msg_.yaw_rate, expected 17, is " + << last_msg_.yaw_rate; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApc.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApc.cc index 4fb33ed66..368d38c2d 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApc.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApc.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApc.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApc.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrSatelliteApc0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrSatelliteApc0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrSatelliteApc0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrSatelliteApc0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_satellite_apc_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_satellite_apc_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,139 +67,221 @@ class Test_auto_check_sbp_ssr_MsgSsrSatelliteApc0 : sbp_msg_ssr_satellite_apc_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrSatelliteApc0, Test) -{ - - uint8_t encoded_frame[] = {85,5,6,0,0,41,127,58,9,0,174,8,1,2,3,2,0,4,61,0,1,0,255,255,217,2,11,10,8,5,1,252,248,246,246,246,249,252,0,6,12,22,30,41,41,41,41,144,161, }; - - sbp_msg_ssr_satellite_apc_t test_msg{}; - - - test_msg.apc[0].pco[0] = 1; - - test_msg.apc[0].pco[1] = -1; - - test_msg.apc[0].pco[2] = 729; - - test_msg.apc[0].pcv[0] = 11; - - test_msg.apc[0].pcv[1] = 10; - - test_msg.apc[0].pcv[2] = 8; - - test_msg.apc[0].pcv[3] = 5; - - test_msg.apc[0].pcv[4] = 1; - - test_msg.apc[0].pcv[5] = -4; - - test_msg.apc[0].pcv[6] = -8; - - test_msg.apc[0].pcv[7] = -10; - - test_msg.apc[0].pcv[8] = -10; - - test_msg.apc[0].pcv[9] = -10; - - test_msg.apc[0].pcv[10] = -7; - - test_msg.apc[0].pcv[11] = -4; - - test_msg.apc[0].pcv[12] = 0; - - test_msg.apc[0].pcv[13] = 6; - - test_msg.apc[0].pcv[14] = 12; - - test_msg.apc[0].pcv[15] = 22; - - test_msg.apc[0].pcv[16] = 30; - - test_msg.apc[0].pcv[17] = 41; - - test_msg.apc[0].pcv[18] = 41; - - test_msg.apc[0].pcv[19] = 41; - - test_msg.apc[0].pcv[20] = 41; - test_msg.apc[0].sat_info = 4; - test_msg.apc[0].sid.code = 0; - test_msg.apc[0].sid.sat = 2; - test_msg.apc[0].svn = 61; - test_msg.iod_ssr = 3; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_apc.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)97,(char)112,(char)99 }; - memcpy(test_msg.n_apc.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_apc.value = 1; - test_msg.sol_id = 2; - test_msg.time.tow = 604799; - test_msg.time.wn = 2222; - test_msg.update_interval = 1; - - EXPECT_EQ(send_message( 0, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.apc[0].pco[0], 1) << "incorrect value for last_msg_.apc[0].pco[0], expected 1, is " << last_msg_.apc[0].pco[0]; - EXPECT_EQ(last_msg_.apc[0].pco[1], -1) << "incorrect value for last_msg_.apc[0].pco[1], expected -1, is " << last_msg_.apc[0].pco[1]; - EXPECT_EQ(last_msg_.apc[0].pco[2], 729) << "incorrect value for last_msg_.apc[0].pco[2], expected 729, is " << last_msg_.apc[0].pco[2]; - EXPECT_EQ(last_msg_.apc[0].pcv[0], 11) << "incorrect value for last_msg_.apc[0].pcv[0], expected 11, is " << last_msg_.apc[0].pcv[0]; - EXPECT_EQ(last_msg_.apc[0].pcv[1], 10) << "incorrect value for last_msg_.apc[0].pcv[1], expected 10, is " << last_msg_.apc[0].pcv[1]; - EXPECT_EQ(last_msg_.apc[0].pcv[2], 8) << "incorrect value for last_msg_.apc[0].pcv[2], expected 8, is " << last_msg_.apc[0].pcv[2]; - EXPECT_EQ(last_msg_.apc[0].pcv[3], 5) << "incorrect value for last_msg_.apc[0].pcv[3], expected 5, is " << last_msg_.apc[0].pcv[3]; - EXPECT_EQ(last_msg_.apc[0].pcv[4], 1) << "incorrect value for last_msg_.apc[0].pcv[4], expected 1, is " << last_msg_.apc[0].pcv[4]; - EXPECT_EQ(last_msg_.apc[0].pcv[5], -4) << "incorrect value for last_msg_.apc[0].pcv[5], expected -4, is " << last_msg_.apc[0].pcv[5]; - EXPECT_EQ(last_msg_.apc[0].pcv[6], -8) << "incorrect value for last_msg_.apc[0].pcv[6], expected -8, is " << last_msg_.apc[0].pcv[6]; - EXPECT_EQ(last_msg_.apc[0].pcv[7], -10) << "incorrect value for last_msg_.apc[0].pcv[7], expected -10, is " << last_msg_.apc[0].pcv[7]; - EXPECT_EQ(last_msg_.apc[0].pcv[8], -10) << "incorrect value for last_msg_.apc[0].pcv[8], expected -10, is " << last_msg_.apc[0].pcv[8]; - EXPECT_EQ(last_msg_.apc[0].pcv[9], -10) << "incorrect value for last_msg_.apc[0].pcv[9], expected -10, is " << last_msg_.apc[0].pcv[9]; - EXPECT_EQ(last_msg_.apc[0].pcv[10], -7) << "incorrect value for last_msg_.apc[0].pcv[10], expected -7, is " << last_msg_.apc[0].pcv[10]; - EXPECT_EQ(last_msg_.apc[0].pcv[11], -4) << "incorrect value for last_msg_.apc[0].pcv[11], expected -4, is " << last_msg_.apc[0].pcv[11]; - EXPECT_EQ(last_msg_.apc[0].pcv[12], 0) << "incorrect value for last_msg_.apc[0].pcv[12], expected 0, is " << last_msg_.apc[0].pcv[12]; - EXPECT_EQ(last_msg_.apc[0].pcv[13], 6) << "incorrect value for last_msg_.apc[0].pcv[13], expected 6, is " << last_msg_.apc[0].pcv[13]; - EXPECT_EQ(last_msg_.apc[0].pcv[14], 12) << "incorrect value for last_msg_.apc[0].pcv[14], expected 12, is " << last_msg_.apc[0].pcv[14]; - EXPECT_EQ(last_msg_.apc[0].pcv[15], 22) << "incorrect value for last_msg_.apc[0].pcv[15], expected 22, is " << last_msg_.apc[0].pcv[15]; - EXPECT_EQ(last_msg_.apc[0].pcv[16], 30) << "incorrect value for last_msg_.apc[0].pcv[16], expected 30, is " << last_msg_.apc[0].pcv[16]; - EXPECT_EQ(last_msg_.apc[0].pcv[17], 41) << "incorrect value for last_msg_.apc[0].pcv[17], expected 41, is " << last_msg_.apc[0].pcv[17]; - EXPECT_EQ(last_msg_.apc[0].pcv[18], 41) << "incorrect value for last_msg_.apc[0].pcv[18], expected 41, is " << last_msg_.apc[0].pcv[18]; - EXPECT_EQ(last_msg_.apc[0].pcv[19], 41) << "incorrect value for last_msg_.apc[0].pcv[19], expected 41, is " << last_msg_.apc[0].pcv[19]; - EXPECT_EQ(last_msg_.apc[0].pcv[20], 41) << "incorrect value for last_msg_.apc[0].pcv[20], expected 41, is " << last_msg_.apc[0].pcv[20]; - EXPECT_EQ(last_msg_.apc[0].sat_info, 4) << "incorrect value for last_msg_.apc[0].sat_info, expected 4, is " << last_msg_.apc[0].sat_info; - EXPECT_EQ(last_msg_.apc[0].sid.code, 0) << "incorrect value for last_msg_.apc[0].sid.code, expected 0, is " << last_msg_.apc[0].sid.code; - EXPECT_EQ(last_msg_.apc[0].sid.sat, 2) << "incorrect value for last_msg_.apc[0].sid.sat, expected 2, is " << last_msg_.apc[0].sid.sat; - EXPECT_EQ(last_msg_.apc[0].svn, 61) << "incorrect value for last_msg_.apc[0].svn, expected 61, is " << last_msg_.apc[0].svn; - EXPECT_EQ(last_msg_.iod_ssr, 3) << "incorrect value for last_msg_.iod_ssr, expected 3, is " << last_msg_.iod_ssr; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_apc.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_apc.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_apc.handle_as << "'"; - } - { - const char check_string[] = { (char)97,(char)112,(char)99 }; - EXPECT_EQ(memcmp(last_msg_.n_apc.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_apc.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_apc.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_apc.value, 1) << "incorrect value for last_msg_.n_apc.value, expected 1, is " << last_msg_.n_apc.value; - EXPECT_EQ(last_msg_.sol_id, 2) << "incorrect value for last_msg_.sol_id, expected 2, is " << last_msg_.sol_id; - EXPECT_EQ(last_msg_.time.tow, 604799) << "incorrect value for last_msg_.time.tow, expected 604799, is " << last_msg_.time.tow; - EXPECT_EQ(last_msg_.time.wn, 2222) << "incorrect value for last_msg_.time.wn, expected 2222, is " << last_msg_.time.wn; - EXPECT_EQ(last_msg_.update_interval, 1) << "incorrect value for last_msg_.update_interval, expected 1, is " << last_msg_.update_interval; +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrSatelliteApc0, Test) { + uint8_t encoded_frame[] = { + 85, 5, 6, 0, 0, 41, 127, 58, 9, 0, 174, 8, 1, + 2, 3, 2, 0, 4, 61, 0, 1, 0, 255, 255, 217, 2, + 11, 10, 8, 5, 1, 252, 248, 246, 246, 246, 249, 252, 0, + 6, 12, 22, 30, 41, 41, 41, 41, 144, 161, + }; + + sbp_msg_ssr_satellite_apc_t test_msg{}; + + test_msg.apc[0].pco[0] = 1; + + test_msg.apc[0].pco[1] = -1; + + test_msg.apc[0].pco[2] = 729; + + test_msg.apc[0].pcv[0] = 11; + + test_msg.apc[0].pcv[1] = 10; + + test_msg.apc[0].pcv[2] = 8; + + test_msg.apc[0].pcv[3] = 5; + + test_msg.apc[0].pcv[4] = 1; + + test_msg.apc[0].pcv[5] = -4; + + test_msg.apc[0].pcv[6] = -8; + + test_msg.apc[0].pcv[7] = -10; + + test_msg.apc[0].pcv[8] = -10; + + test_msg.apc[0].pcv[9] = -10; + + test_msg.apc[0].pcv[10] = -7; + + test_msg.apc[0].pcv[11] = -4; + + test_msg.apc[0].pcv[12] = 0; + + test_msg.apc[0].pcv[13] = 6; + + test_msg.apc[0].pcv[14] = 12; + + test_msg.apc[0].pcv[15] = 22; + + test_msg.apc[0].pcv[16] = 30; + + test_msg.apc[0].pcv[17] = 41; + + test_msg.apc[0].pcv[18] = 41; + + test_msg.apc[0].pcv[19] = 41; + + test_msg.apc[0].pcv[20] = 41; + test_msg.apc[0].sat_info = 4; + test_msg.apc[0].sid.code = 0; + test_msg.apc[0].sid.sat = 2; + test_msg.apc[0].svn = 61; + test_msg.iod_ssr = 3; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_apc.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)97, (char)112, (char)99}; + memcpy(test_msg.n_apc.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_apc.value = 1; + test_msg.sol_id = 2; + test_msg.time.tow = 604799; + test_msg.time.wn = 2222; + test_msg.update_interval = 1; + + EXPECT_EQ(send_message(0, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.apc[0].pco[0], 1) + << "incorrect value for last_msg_.apc[0].pco[0], expected 1, is " + << last_msg_.apc[0].pco[0]; + EXPECT_EQ(last_msg_.apc[0].pco[1], -1) + << "incorrect value for last_msg_.apc[0].pco[1], expected -1, is " + << last_msg_.apc[0].pco[1]; + EXPECT_EQ(last_msg_.apc[0].pco[2], 729) + << "incorrect value for last_msg_.apc[0].pco[2], expected 729, is " + << last_msg_.apc[0].pco[2]; + EXPECT_EQ(last_msg_.apc[0].pcv[0], 11) + << "incorrect value for last_msg_.apc[0].pcv[0], expected 11, is " + << last_msg_.apc[0].pcv[0]; + EXPECT_EQ(last_msg_.apc[0].pcv[1], 10) + << "incorrect value for last_msg_.apc[0].pcv[1], expected 10, is " + << last_msg_.apc[0].pcv[1]; + EXPECT_EQ(last_msg_.apc[0].pcv[2], 8) + << "incorrect value for last_msg_.apc[0].pcv[2], expected 8, is " + << last_msg_.apc[0].pcv[2]; + EXPECT_EQ(last_msg_.apc[0].pcv[3], 5) + << "incorrect value for last_msg_.apc[0].pcv[3], expected 5, is " + << last_msg_.apc[0].pcv[3]; + EXPECT_EQ(last_msg_.apc[0].pcv[4], 1) + << "incorrect value for last_msg_.apc[0].pcv[4], expected 1, is " + << last_msg_.apc[0].pcv[4]; + EXPECT_EQ(last_msg_.apc[0].pcv[5], -4) + << "incorrect value for last_msg_.apc[0].pcv[5], expected -4, is " + << last_msg_.apc[0].pcv[5]; + EXPECT_EQ(last_msg_.apc[0].pcv[6], -8) + << "incorrect value for last_msg_.apc[0].pcv[6], expected -8, is " + << last_msg_.apc[0].pcv[6]; + EXPECT_EQ(last_msg_.apc[0].pcv[7], -10) + << "incorrect value for last_msg_.apc[0].pcv[7], expected -10, is " + << last_msg_.apc[0].pcv[7]; + EXPECT_EQ(last_msg_.apc[0].pcv[8], -10) + << "incorrect value for last_msg_.apc[0].pcv[8], expected -10, is " + << last_msg_.apc[0].pcv[8]; + EXPECT_EQ(last_msg_.apc[0].pcv[9], -10) + << "incorrect value for last_msg_.apc[0].pcv[9], expected -10, is " + << last_msg_.apc[0].pcv[9]; + EXPECT_EQ(last_msg_.apc[0].pcv[10], -7) + << "incorrect value for last_msg_.apc[0].pcv[10], expected -7, is " + << last_msg_.apc[0].pcv[10]; + EXPECT_EQ(last_msg_.apc[0].pcv[11], -4) + << "incorrect value for last_msg_.apc[0].pcv[11], expected -4, is " + << last_msg_.apc[0].pcv[11]; + EXPECT_EQ(last_msg_.apc[0].pcv[12], 0) + << "incorrect value for last_msg_.apc[0].pcv[12], expected 0, is " + << last_msg_.apc[0].pcv[12]; + EXPECT_EQ(last_msg_.apc[0].pcv[13], 6) + << "incorrect value for last_msg_.apc[0].pcv[13], expected 6, is " + << last_msg_.apc[0].pcv[13]; + EXPECT_EQ(last_msg_.apc[0].pcv[14], 12) + << "incorrect value for last_msg_.apc[0].pcv[14], expected 12, is " + << last_msg_.apc[0].pcv[14]; + EXPECT_EQ(last_msg_.apc[0].pcv[15], 22) + << "incorrect value for last_msg_.apc[0].pcv[15], expected 22, is " + << last_msg_.apc[0].pcv[15]; + EXPECT_EQ(last_msg_.apc[0].pcv[16], 30) + << "incorrect value for last_msg_.apc[0].pcv[16], expected 30, is " + << last_msg_.apc[0].pcv[16]; + EXPECT_EQ(last_msg_.apc[0].pcv[17], 41) + << "incorrect value for last_msg_.apc[0].pcv[17], expected 41, is " + << last_msg_.apc[0].pcv[17]; + EXPECT_EQ(last_msg_.apc[0].pcv[18], 41) + << "incorrect value for last_msg_.apc[0].pcv[18], expected 41, is " + << last_msg_.apc[0].pcv[18]; + EXPECT_EQ(last_msg_.apc[0].pcv[19], 41) + << "incorrect value for last_msg_.apc[0].pcv[19], expected 41, is " + << last_msg_.apc[0].pcv[19]; + EXPECT_EQ(last_msg_.apc[0].pcv[20], 41) + << "incorrect value for last_msg_.apc[0].pcv[20], expected 41, is " + << last_msg_.apc[0].pcv[20]; + EXPECT_EQ(last_msg_.apc[0].sat_info, 4) + << "incorrect value for last_msg_.apc[0].sat_info, expected 4, is " + << last_msg_.apc[0].sat_info; + EXPECT_EQ(last_msg_.apc[0].sid.code, 0) + << "incorrect value for last_msg_.apc[0].sid.code, expected 0, is " + << last_msg_.apc[0].sid.code; + EXPECT_EQ(last_msg_.apc[0].sid.sat, 2) + << "incorrect value for last_msg_.apc[0].sid.sat, expected 2, is " + << last_msg_.apc[0].sid.sat; + EXPECT_EQ(last_msg_.apc[0].svn, 61) + << "incorrect value for last_msg_.apc[0].svn, expected 61, is " + << last_msg_.apc[0].svn; + EXPECT_EQ(last_msg_.iod_ssr, 3) + << "incorrect value for last_msg_.iod_ssr, expected 3, is " + << last_msg_.iod_ssr; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_apc.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_apc.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_apc.handle_as << "'"; + } + { + const char check_string[] = {(char)97, (char)112, (char)99}; + EXPECT_EQ( + memcmp(last_msg_.n_apc.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_apc.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_apc.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_apc.value, 1) + << "incorrect value for last_msg_.n_apc.value, expected 1, is " + << last_msg_.n_apc.value; + EXPECT_EQ(last_msg_.sol_id, 2) + << "incorrect value for last_msg_.sol_id, expected 2, is " + << last_msg_.sol_id; + EXPECT_EQ(last_msg_.time.tow, 604799) + << "incorrect value for last_msg_.time.tow, expected 604799, is " + << last_msg_.time.tow; + EXPECT_EQ(last_msg_.time.wn, 2222) + << "incorrect value for last_msg_.time.wn, expected 2222, is " + << last_msg_.time.wn; + EXPECT_EQ(last_msg_.update_interval, 1) + << "incorrect value for last_msg_.update_interval, expected 1, is " + << last_msg_.update_interval; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.cc index 81da89f06..4984ce986 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApcDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApcDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_satellite_apc_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_satellite_apc_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,615 +67,1029 @@ class Test_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA0 : sbp_msg_ssr_satellite_apc_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,4,6,56,19,224,203,169,240,78,4,213,171,254,214,212,4,8,33,31,80,21,4,105,225,39,139,124,149,48,15,214,197,141,32,33,135,150,148,123,49,135,97,39,90,20,169,239,47,153,175,35,145,145,123,194,2,102,74,149,95,171,238,249,7,237,170,125,106,158,83,188,181,194,27,84,226,142,123,77,217,248,67,215,129,114,138,25,240,10,56,76,61,161,216,22,181,174,33,13,252,236,230,196,128,215,239,234,179,220,44,212,57,44,173,49,36,137,248,235,97,112,157,139,26,115,192,31,85,127,228,81,252,219,249,110,147,8,161,215,212,180,25,83,144,247,12,27,199,173,74,23,4,239,103,223,220,139,91,127,214,86,48,203,228,99,45,83,159,11,250,135,170,42,217,199,233,42,170,78,206,41,43,81,247,99,198,144,2,132,2,224,220,148,58,85,138,210,200,158,7,158,67,46,200,132,118,241,13,37,62,107,253,190,136,66,9,84,155,86,180,41,196,40,119,101,252,223,144,153,50,13, }; - - sbp_msg_ssr_satellite_apc_dep_t test_msg{}; - - - test_msg.apc[0].pco[0] = -21547; - - test_msg.apc[0].pco[1] = -10498; - - test_msg.apc[0].pco[2] = 1236; - - test_msg.apc[0].pcv[0] = 8; - - test_msg.apc[0].pcv[1] = 33; - - test_msg.apc[0].pcv[2] = 31; - - test_msg.apc[0].pcv[3] = 80; - - test_msg.apc[0].pcv[4] = 21; - - test_msg.apc[0].pcv[5] = 4; - - test_msg.apc[0].pcv[6] = 105; - - test_msg.apc[0].pcv[7] = -31; - - test_msg.apc[0].pcv[8] = 39; - - test_msg.apc[0].pcv[9] = -117; - - test_msg.apc[0].pcv[10] = 124; - - test_msg.apc[0].pcv[11] = -107; - - test_msg.apc[0].pcv[12] = 48; - - test_msg.apc[0].pcv[13] = 15; - - test_msg.apc[0].pcv[14] = -42; - - test_msg.apc[0].pcv[15] = -59; - - test_msg.apc[0].pcv[16] = -115; - - test_msg.apc[0].pcv[17] = 32; - - test_msg.apc[0].pcv[18] = 33; - - test_msg.apc[0].pcv[19] = -121; - - test_msg.apc[0].pcv[20] = -106; - test_msg.apc[0].sat_info = 240; - test_msg.apc[0].sid.code = 169; - test_msg.apc[0].sid.sat = 203; - test_msg.apc[0].svn = 1102; - - - test_msg.apc[1].pco[0] = 23079; - - test_msg.apc[1].pco[1] = -22252; - - test_msg.apc[1].pco[2] = 12271; - - test_msg.apc[1].pcv[0] = -103; - - test_msg.apc[1].pcv[1] = -81; - - test_msg.apc[1].pcv[2] = 35; - - test_msg.apc[1].pcv[3] = -111; - - test_msg.apc[1].pcv[4] = -111; - - test_msg.apc[1].pcv[5] = 123; - - test_msg.apc[1].pcv[6] = -62; - - test_msg.apc[1].pcv[7] = 2; - - test_msg.apc[1].pcv[8] = 102; - - test_msg.apc[1].pcv[9] = 74; - - test_msg.apc[1].pcv[10] = -107; - - test_msg.apc[1].pcv[11] = 95; - - test_msg.apc[1].pcv[12] = -85; - - test_msg.apc[1].pcv[13] = -18; - - test_msg.apc[1].pcv[14] = -7; - - test_msg.apc[1].pcv[15] = 7; - - test_msg.apc[1].pcv[16] = -19; - - test_msg.apc[1].pcv[17] = -86; - - test_msg.apc[1].pcv[18] = 125; - - test_msg.apc[1].pcv[19] = 106; - - test_msg.apc[1].pcv[20] = -98; - test_msg.apc[1].sat_info = 49; - test_msg.apc[1].sid.code = 123; - test_msg.apc[1].sid.sat = 148; - test_msg.apc[1].svn = 24967; - - - test_msg.apc[2].pco[0] = -7596; - - test_msg.apc[2].pco[1] = 31630; - - test_msg.apc[2].pco[2] = -9907; - - test_msg.apc[2].pcv[0] = -8; - - test_msg.apc[2].pcv[1] = 67; - - test_msg.apc[2].pcv[2] = -41; - - test_msg.apc[2].pcv[3] = -127; - - test_msg.apc[2].pcv[4] = 114; - - test_msg.apc[2].pcv[5] = -118; - - test_msg.apc[2].pcv[6] = 25; - - test_msg.apc[2].pcv[7] = -16; - - test_msg.apc[2].pcv[8] = 10; - - test_msg.apc[2].pcv[9] = 56; - - test_msg.apc[2].pcv[10] = 76; - - test_msg.apc[2].pcv[11] = 61; - - test_msg.apc[2].pcv[12] = -95; - - test_msg.apc[2].pcv[13] = -40; - - test_msg.apc[2].pcv[14] = 22; - - test_msg.apc[2].pcv[15] = -75; - - test_msg.apc[2].pcv[16] = -82; - - test_msg.apc[2].pcv[17] = 33; - - test_msg.apc[2].pcv[18] = 13; - - test_msg.apc[2].pcv[19] = -4; - - test_msg.apc[2].pcv[20] = -20; - test_msg.apc[2].sat_info = 181; - test_msg.apc[2].sid.code = 188; - test_msg.apc[2].sid.sat = 83; - test_msg.apc[2].svn = 7106; - - - test_msg.apc[3].pco[0] = -19478; - - test_msg.apc[3].pco[1] = 11484; - - test_msg.apc[3].pco[2] = 14804; - - test_msg.apc[3].pcv[0] = 44; - - test_msg.apc[3].pcv[1] = -83; - - test_msg.apc[3].pcv[2] = 49; - - test_msg.apc[3].pcv[3] = 36; - - test_msg.apc[3].pcv[4] = -119; - - test_msg.apc[3].pcv[5] = -8; - - test_msg.apc[3].pcv[6] = -21; - - test_msg.apc[3].pcv[7] = 97; - - test_msg.apc[3].pcv[8] = 112; - - test_msg.apc[3].pcv[9] = -99; - - test_msg.apc[3].pcv[10] = -117; - - test_msg.apc[3].pcv[11] = 26; - - test_msg.apc[3].pcv[12] = 115; - - test_msg.apc[3].pcv[13] = -64; - - test_msg.apc[3].pcv[14] = 31; - - test_msg.apc[3].pcv[15] = 85; - - test_msg.apc[3].pcv[16] = 127; - - test_msg.apc[3].pcv[17] = -28; - - test_msg.apc[3].pcv[18] = 81; - - test_msg.apc[3].pcv[19] = -4; - - test_msg.apc[3].pcv[20] = -37; - test_msg.apc[3].sat_info = 128; - test_msg.apc[3].sid.code = 196; - test_msg.apc[3].sid.sat = 230; - test_msg.apc[3].svn = 61399; - - - test_msg.apc[4].pco[0] = -11049; - - test_msg.apc[4].pco[1] = 6580; - - test_msg.apc[4].pco[2] = -28589; - - test_msg.apc[4].pcv[0] = -9; - - test_msg.apc[4].pcv[1] = 12; - - test_msg.apc[4].pcv[2] = 27; - - test_msg.apc[4].pcv[3] = -57; - - test_msg.apc[4].pcv[4] = -83; - - test_msg.apc[4].pcv[5] = 74; - - test_msg.apc[4].pcv[6] = 23; - - test_msg.apc[4].pcv[7] = 4; - - test_msg.apc[4].pcv[8] = -17; - - test_msg.apc[4].pcv[9] = 103; - - test_msg.apc[4].pcv[10] = -33; - - test_msg.apc[4].pcv[11] = -36; - - test_msg.apc[4].pcv[12] = -117; - - test_msg.apc[4].pcv[13] = 91; - - test_msg.apc[4].pcv[14] = 127; - - test_msg.apc[4].pcv[15] = -42; - - test_msg.apc[4].pcv[16] = 86; - - test_msg.apc[4].pcv[17] = 48; - - test_msg.apc[4].pcv[18] = -53; - - test_msg.apc[4].pcv[19] = -28; - - test_msg.apc[4].pcv[20] = 99; - test_msg.apc[4].sat_info = 147; - test_msg.apc[4].sid.code = 110; - test_msg.apc[4].sid.sat = 249; - test_msg.apc[4].svn = 41224; - - - test_msg.apc[5].pco[0] = -21881; - - test_msg.apc[5].pco[1] = -9942; - - test_msg.apc[5].pco[2] = -5689; - - test_msg.apc[5].pcv[0] = 42; - - test_msg.apc[5].pcv[1] = -86; - - test_msg.apc[5].pcv[2] = 78; - - test_msg.apc[5].pcv[3] = -50; - - test_msg.apc[5].pcv[4] = 41; - - test_msg.apc[5].pcv[5] = 43; - - test_msg.apc[5].pcv[6] = 81; - - test_msg.apc[5].pcv[7] = -9; - - test_msg.apc[5].pcv[8] = 99; - - test_msg.apc[5].pcv[9] = -58; - - test_msg.apc[5].pcv[10] = -112; - - test_msg.apc[5].pcv[11] = 2; - - test_msg.apc[5].pcv[12] = -124; - - test_msg.apc[5].pcv[13] = 2; - - test_msg.apc[5].pcv[14] = -32; - - test_msg.apc[5].pcv[15] = -36; - - test_msg.apc[5].pcv[16] = -108; - - test_msg.apc[5].pcv[17] = 58; - - test_msg.apc[5].pcv[18] = 85; - - test_msg.apc[5].pcv[19] = -118; - - test_msg.apc[5].pcv[20] = -46; - test_msg.apc[5].sat_info = 159; - test_msg.apc[5].sid.code = 83; - test_msg.apc[5].sid.sat = 45; - test_msg.apc[5].svn = 64011; - - - test_msg.apc[6].pco[0] = -14290; - - test_msg.apc[6].pco[1] = 30340; - - test_msg.apc[6].pco[2] = 3569; - - test_msg.apc[6].pcv[0] = 37; - - test_msg.apc[6].pcv[1] = 62; - - test_msg.apc[6].pcv[2] = 107; - - test_msg.apc[6].pcv[3] = -3; - - test_msg.apc[6].pcv[4] = -66; - - test_msg.apc[6].pcv[5] = -120; - - test_msg.apc[6].pcv[6] = 66; - - test_msg.apc[6].pcv[7] = 9; - - test_msg.apc[6].pcv[8] = 84; - - test_msg.apc[6].pcv[9] = -101; - - test_msg.apc[6].pcv[10] = 86; - - test_msg.apc[6].pcv[11] = -76; - - test_msg.apc[6].pcv[12] = 41; - - test_msg.apc[6].pcv[13] = -60; - - test_msg.apc[6].pcv[14] = 40; - - test_msg.apc[6].pcv[15] = 119; - - test_msg.apc[6].pcv[16] = 101; - - test_msg.apc[6].pcv[17] = -4; - - test_msg.apc[6].pcv[18] = -33; - - test_msg.apc[6].pcv[19] = -112; - - test_msg.apc[6].pcv[20] = -103; - test_msg.apc[6].sat_info = 7; - test_msg.apc[6].sid.code = 158; - test_msg.apc[6].sid.sat = 200; - test_msg.apc[6].svn = 17310; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_apc.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)97,(char)112,(char)99 }; - memcpy(test_msg.n_apc.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_apc.value = 7; - - EXPECT_EQ(send_message( 4920, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4920); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.apc[0].pco[0], -21547) << "incorrect value for last_msg_.apc[0].pco[0], expected -21547, is " << last_msg_.apc[0].pco[0]; - EXPECT_EQ(last_msg_.apc[0].pco[1], -10498) << "incorrect value for last_msg_.apc[0].pco[1], expected -10498, is " << last_msg_.apc[0].pco[1]; - EXPECT_EQ(last_msg_.apc[0].pco[2], 1236) << "incorrect value for last_msg_.apc[0].pco[2], expected 1236, is " << last_msg_.apc[0].pco[2]; - EXPECT_EQ(last_msg_.apc[0].pcv[0], 8) << "incorrect value for last_msg_.apc[0].pcv[0], expected 8, is " << last_msg_.apc[0].pcv[0]; - EXPECT_EQ(last_msg_.apc[0].pcv[1], 33) << "incorrect value for last_msg_.apc[0].pcv[1], expected 33, is " << last_msg_.apc[0].pcv[1]; - EXPECT_EQ(last_msg_.apc[0].pcv[2], 31) << "incorrect value for last_msg_.apc[0].pcv[2], expected 31, is " << last_msg_.apc[0].pcv[2]; - EXPECT_EQ(last_msg_.apc[0].pcv[3], 80) << "incorrect value for last_msg_.apc[0].pcv[3], expected 80, is " << last_msg_.apc[0].pcv[3]; - EXPECT_EQ(last_msg_.apc[0].pcv[4], 21) << "incorrect value for last_msg_.apc[0].pcv[4], expected 21, is " << last_msg_.apc[0].pcv[4]; - EXPECT_EQ(last_msg_.apc[0].pcv[5], 4) << "incorrect value for last_msg_.apc[0].pcv[5], expected 4, is " << last_msg_.apc[0].pcv[5]; - EXPECT_EQ(last_msg_.apc[0].pcv[6], 105) << "incorrect value for last_msg_.apc[0].pcv[6], expected 105, is " << last_msg_.apc[0].pcv[6]; - EXPECT_EQ(last_msg_.apc[0].pcv[7], -31) << "incorrect value for last_msg_.apc[0].pcv[7], expected -31, is " << last_msg_.apc[0].pcv[7]; - EXPECT_EQ(last_msg_.apc[0].pcv[8], 39) << "incorrect value for last_msg_.apc[0].pcv[8], expected 39, is " << last_msg_.apc[0].pcv[8]; - EXPECT_EQ(last_msg_.apc[0].pcv[9], -117) << "incorrect value for last_msg_.apc[0].pcv[9], expected -117, is " << last_msg_.apc[0].pcv[9]; - EXPECT_EQ(last_msg_.apc[0].pcv[10], 124) << "incorrect value for last_msg_.apc[0].pcv[10], expected 124, is " << last_msg_.apc[0].pcv[10]; - EXPECT_EQ(last_msg_.apc[0].pcv[11], -107) << "incorrect value for last_msg_.apc[0].pcv[11], expected -107, is " << last_msg_.apc[0].pcv[11]; - EXPECT_EQ(last_msg_.apc[0].pcv[12], 48) << "incorrect value for last_msg_.apc[0].pcv[12], expected 48, is " << last_msg_.apc[0].pcv[12]; - EXPECT_EQ(last_msg_.apc[0].pcv[13], 15) << "incorrect value for last_msg_.apc[0].pcv[13], expected 15, is " << last_msg_.apc[0].pcv[13]; - EXPECT_EQ(last_msg_.apc[0].pcv[14], -42) << "incorrect value for last_msg_.apc[0].pcv[14], expected -42, is " << last_msg_.apc[0].pcv[14]; - EXPECT_EQ(last_msg_.apc[0].pcv[15], -59) << "incorrect value for last_msg_.apc[0].pcv[15], expected -59, is " << last_msg_.apc[0].pcv[15]; - EXPECT_EQ(last_msg_.apc[0].pcv[16], -115) << "incorrect value for last_msg_.apc[0].pcv[16], expected -115, is " << last_msg_.apc[0].pcv[16]; - EXPECT_EQ(last_msg_.apc[0].pcv[17], 32) << "incorrect value for last_msg_.apc[0].pcv[17], expected 32, is " << last_msg_.apc[0].pcv[17]; - EXPECT_EQ(last_msg_.apc[0].pcv[18], 33) << "incorrect value for last_msg_.apc[0].pcv[18], expected 33, is " << last_msg_.apc[0].pcv[18]; - EXPECT_EQ(last_msg_.apc[0].pcv[19], -121) << "incorrect value for last_msg_.apc[0].pcv[19], expected -121, is " << last_msg_.apc[0].pcv[19]; - EXPECT_EQ(last_msg_.apc[0].pcv[20], -106) << "incorrect value for last_msg_.apc[0].pcv[20], expected -106, is " << last_msg_.apc[0].pcv[20]; - EXPECT_EQ(last_msg_.apc[0].sat_info, 240) << "incorrect value for last_msg_.apc[0].sat_info, expected 240, is " << last_msg_.apc[0].sat_info; - EXPECT_EQ(last_msg_.apc[0].sid.code, 169) << "incorrect value for last_msg_.apc[0].sid.code, expected 169, is " << last_msg_.apc[0].sid.code; - EXPECT_EQ(last_msg_.apc[0].sid.sat, 203) << "incorrect value for last_msg_.apc[0].sid.sat, expected 203, is " << last_msg_.apc[0].sid.sat; - EXPECT_EQ(last_msg_.apc[0].svn, 1102) << "incorrect value for last_msg_.apc[0].svn, expected 1102, is " << last_msg_.apc[0].svn; - EXPECT_EQ(last_msg_.apc[1].pco[0], 23079) << "incorrect value for last_msg_.apc[1].pco[0], expected 23079, is " << last_msg_.apc[1].pco[0]; - EXPECT_EQ(last_msg_.apc[1].pco[1], -22252) << "incorrect value for last_msg_.apc[1].pco[1], expected -22252, is " << last_msg_.apc[1].pco[1]; - EXPECT_EQ(last_msg_.apc[1].pco[2], 12271) << "incorrect value for last_msg_.apc[1].pco[2], expected 12271, is " << last_msg_.apc[1].pco[2]; - EXPECT_EQ(last_msg_.apc[1].pcv[0], -103) << "incorrect value for last_msg_.apc[1].pcv[0], expected -103, is " << last_msg_.apc[1].pcv[0]; - EXPECT_EQ(last_msg_.apc[1].pcv[1], -81) << "incorrect value for last_msg_.apc[1].pcv[1], expected -81, is " << last_msg_.apc[1].pcv[1]; - EXPECT_EQ(last_msg_.apc[1].pcv[2], 35) << "incorrect value for last_msg_.apc[1].pcv[2], expected 35, is " << last_msg_.apc[1].pcv[2]; - EXPECT_EQ(last_msg_.apc[1].pcv[3], -111) << "incorrect value for last_msg_.apc[1].pcv[3], expected -111, is " << last_msg_.apc[1].pcv[3]; - EXPECT_EQ(last_msg_.apc[1].pcv[4], -111) << "incorrect value for last_msg_.apc[1].pcv[4], expected -111, is " << last_msg_.apc[1].pcv[4]; - EXPECT_EQ(last_msg_.apc[1].pcv[5], 123) << "incorrect value for last_msg_.apc[1].pcv[5], expected 123, is " << last_msg_.apc[1].pcv[5]; - EXPECT_EQ(last_msg_.apc[1].pcv[6], -62) << "incorrect value for last_msg_.apc[1].pcv[6], expected -62, is " << last_msg_.apc[1].pcv[6]; - EXPECT_EQ(last_msg_.apc[1].pcv[7], 2) << "incorrect value for last_msg_.apc[1].pcv[7], expected 2, is " << last_msg_.apc[1].pcv[7]; - EXPECT_EQ(last_msg_.apc[1].pcv[8], 102) << "incorrect value for last_msg_.apc[1].pcv[8], expected 102, is " << last_msg_.apc[1].pcv[8]; - EXPECT_EQ(last_msg_.apc[1].pcv[9], 74) << "incorrect value for last_msg_.apc[1].pcv[9], expected 74, is " << last_msg_.apc[1].pcv[9]; - EXPECT_EQ(last_msg_.apc[1].pcv[10], -107) << "incorrect value for last_msg_.apc[1].pcv[10], expected -107, is " << last_msg_.apc[1].pcv[10]; - EXPECT_EQ(last_msg_.apc[1].pcv[11], 95) << "incorrect value for last_msg_.apc[1].pcv[11], expected 95, is " << last_msg_.apc[1].pcv[11]; - EXPECT_EQ(last_msg_.apc[1].pcv[12], -85) << "incorrect value for last_msg_.apc[1].pcv[12], expected -85, is " << last_msg_.apc[1].pcv[12]; - EXPECT_EQ(last_msg_.apc[1].pcv[13], -18) << "incorrect value for last_msg_.apc[1].pcv[13], expected -18, is " << last_msg_.apc[1].pcv[13]; - EXPECT_EQ(last_msg_.apc[1].pcv[14], -7) << "incorrect value for last_msg_.apc[1].pcv[14], expected -7, is " << last_msg_.apc[1].pcv[14]; - EXPECT_EQ(last_msg_.apc[1].pcv[15], 7) << "incorrect value for last_msg_.apc[1].pcv[15], expected 7, is " << last_msg_.apc[1].pcv[15]; - EXPECT_EQ(last_msg_.apc[1].pcv[16], -19) << "incorrect value for last_msg_.apc[1].pcv[16], expected -19, is " << last_msg_.apc[1].pcv[16]; - EXPECT_EQ(last_msg_.apc[1].pcv[17], -86) << "incorrect value for last_msg_.apc[1].pcv[17], expected -86, is " << last_msg_.apc[1].pcv[17]; - EXPECT_EQ(last_msg_.apc[1].pcv[18], 125) << "incorrect value for last_msg_.apc[1].pcv[18], expected 125, is " << last_msg_.apc[1].pcv[18]; - EXPECT_EQ(last_msg_.apc[1].pcv[19], 106) << "incorrect value for last_msg_.apc[1].pcv[19], expected 106, is " << last_msg_.apc[1].pcv[19]; - EXPECT_EQ(last_msg_.apc[1].pcv[20], -98) << "incorrect value for last_msg_.apc[1].pcv[20], expected -98, is " << last_msg_.apc[1].pcv[20]; - EXPECT_EQ(last_msg_.apc[1].sat_info, 49) << "incorrect value for last_msg_.apc[1].sat_info, expected 49, is " << last_msg_.apc[1].sat_info; - EXPECT_EQ(last_msg_.apc[1].sid.code, 123) << "incorrect value for last_msg_.apc[1].sid.code, expected 123, is " << last_msg_.apc[1].sid.code; - EXPECT_EQ(last_msg_.apc[1].sid.sat, 148) << "incorrect value for last_msg_.apc[1].sid.sat, expected 148, is " << last_msg_.apc[1].sid.sat; - EXPECT_EQ(last_msg_.apc[1].svn, 24967) << "incorrect value for last_msg_.apc[1].svn, expected 24967, is " << last_msg_.apc[1].svn; - EXPECT_EQ(last_msg_.apc[2].pco[0], -7596) << "incorrect value for last_msg_.apc[2].pco[0], expected -7596, is " << last_msg_.apc[2].pco[0]; - EXPECT_EQ(last_msg_.apc[2].pco[1], 31630) << "incorrect value for last_msg_.apc[2].pco[1], expected 31630, is " << last_msg_.apc[2].pco[1]; - EXPECT_EQ(last_msg_.apc[2].pco[2], -9907) << "incorrect value for last_msg_.apc[2].pco[2], expected -9907, is " << last_msg_.apc[2].pco[2]; - EXPECT_EQ(last_msg_.apc[2].pcv[0], -8) << "incorrect value for last_msg_.apc[2].pcv[0], expected -8, is " << last_msg_.apc[2].pcv[0]; - EXPECT_EQ(last_msg_.apc[2].pcv[1], 67) << "incorrect value for last_msg_.apc[2].pcv[1], expected 67, is " << last_msg_.apc[2].pcv[1]; - EXPECT_EQ(last_msg_.apc[2].pcv[2], -41) << "incorrect value for last_msg_.apc[2].pcv[2], expected -41, is " << last_msg_.apc[2].pcv[2]; - EXPECT_EQ(last_msg_.apc[2].pcv[3], -127) << "incorrect value for last_msg_.apc[2].pcv[3], expected -127, is " << last_msg_.apc[2].pcv[3]; - EXPECT_EQ(last_msg_.apc[2].pcv[4], 114) << "incorrect value for last_msg_.apc[2].pcv[4], expected 114, is " << last_msg_.apc[2].pcv[4]; - EXPECT_EQ(last_msg_.apc[2].pcv[5], -118) << "incorrect value for last_msg_.apc[2].pcv[5], expected -118, is " << last_msg_.apc[2].pcv[5]; - EXPECT_EQ(last_msg_.apc[2].pcv[6], 25) << "incorrect value for last_msg_.apc[2].pcv[6], expected 25, is " << last_msg_.apc[2].pcv[6]; - EXPECT_EQ(last_msg_.apc[2].pcv[7], -16) << "incorrect value for last_msg_.apc[2].pcv[7], expected -16, is " << last_msg_.apc[2].pcv[7]; - EXPECT_EQ(last_msg_.apc[2].pcv[8], 10) << "incorrect value for last_msg_.apc[2].pcv[8], expected 10, is " << last_msg_.apc[2].pcv[8]; - EXPECT_EQ(last_msg_.apc[2].pcv[9], 56) << "incorrect value for last_msg_.apc[2].pcv[9], expected 56, is " << last_msg_.apc[2].pcv[9]; - EXPECT_EQ(last_msg_.apc[2].pcv[10], 76) << "incorrect value for last_msg_.apc[2].pcv[10], expected 76, is " << last_msg_.apc[2].pcv[10]; - EXPECT_EQ(last_msg_.apc[2].pcv[11], 61) << "incorrect value for last_msg_.apc[2].pcv[11], expected 61, is " << last_msg_.apc[2].pcv[11]; - EXPECT_EQ(last_msg_.apc[2].pcv[12], -95) << "incorrect value for last_msg_.apc[2].pcv[12], expected -95, is " << last_msg_.apc[2].pcv[12]; - EXPECT_EQ(last_msg_.apc[2].pcv[13], -40) << "incorrect value for last_msg_.apc[2].pcv[13], expected -40, is " << last_msg_.apc[2].pcv[13]; - EXPECT_EQ(last_msg_.apc[2].pcv[14], 22) << "incorrect value for last_msg_.apc[2].pcv[14], expected 22, is " << last_msg_.apc[2].pcv[14]; - EXPECT_EQ(last_msg_.apc[2].pcv[15], -75) << "incorrect value for last_msg_.apc[2].pcv[15], expected -75, is " << last_msg_.apc[2].pcv[15]; - EXPECT_EQ(last_msg_.apc[2].pcv[16], -82) << "incorrect value for last_msg_.apc[2].pcv[16], expected -82, is " << last_msg_.apc[2].pcv[16]; - EXPECT_EQ(last_msg_.apc[2].pcv[17], 33) << "incorrect value for last_msg_.apc[2].pcv[17], expected 33, is " << last_msg_.apc[2].pcv[17]; - EXPECT_EQ(last_msg_.apc[2].pcv[18], 13) << "incorrect value for last_msg_.apc[2].pcv[18], expected 13, is " << last_msg_.apc[2].pcv[18]; - EXPECT_EQ(last_msg_.apc[2].pcv[19], -4) << "incorrect value for last_msg_.apc[2].pcv[19], expected -4, is " << last_msg_.apc[2].pcv[19]; - EXPECT_EQ(last_msg_.apc[2].pcv[20], -20) << "incorrect value for last_msg_.apc[2].pcv[20], expected -20, is " << last_msg_.apc[2].pcv[20]; - EXPECT_EQ(last_msg_.apc[2].sat_info, 181) << "incorrect value for last_msg_.apc[2].sat_info, expected 181, is " << last_msg_.apc[2].sat_info; - EXPECT_EQ(last_msg_.apc[2].sid.code, 188) << "incorrect value for last_msg_.apc[2].sid.code, expected 188, is " << last_msg_.apc[2].sid.code; - EXPECT_EQ(last_msg_.apc[2].sid.sat, 83) << "incorrect value for last_msg_.apc[2].sid.sat, expected 83, is " << last_msg_.apc[2].sid.sat; - EXPECT_EQ(last_msg_.apc[2].svn, 7106) << "incorrect value for last_msg_.apc[2].svn, expected 7106, is " << last_msg_.apc[2].svn; - EXPECT_EQ(last_msg_.apc[3].pco[0], -19478) << "incorrect value for last_msg_.apc[3].pco[0], expected -19478, is " << last_msg_.apc[3].pco[0]; - EXPECT_EQ(last_msg_.apc[3].pco[1], 11484) << "incorrect value for last_msg_.apc[3].pco[1], expected 11484, is " << last_msg_.apc[3].pco[1]; - EXPECT_EQ(last_msg_.apc[3].pco[2], 14804) << "incorrect value for last_msg_.apc[3].pco[2], expected 14804, is " << last_msg_.apc[3].pco[2]; - EXPECT_EQ(last_msg_.apc[3].pcv[0], 44) << "incorrect value for last_msg_.apc[3].pcv[0], expected 44, is " << last_msg_.apc[3].pcv[0]; - EXPECT_EQ(last_msg_.apc[3].pcv[1], -83) << "incorrect value for last_msg_.apc[3].pcv[1], expected -83, is " << last_msg_.apc[3].pcv[1]; - EXPECT_EQ(last_msg_.apc[3].pcv[2], 49) << "incorrect value for last_msg_.apc[3].pcv[2], expected 49, is " << last_msg_.apc[3].pcv[2]; - EXPECT_EQ(last_msg_.apc[3].pcv[3], 36) << "incorrect value for last_msg_.apc[3].pcv[3], expected 36, is " << last_msg_.apc[3].pcv[3]; - EXPECT_EQ(last_msg_.apc[3].pcv[4], -119) << "incorrect value for last_msg_.apc[3].pcv[4], expected -119, is " << last_msg_.apc[3].pcv[4]; - EXPECT_EQ(last_msg_.apc[3].pcv[5], -8) << "incorrect value for last_msg_.apc[3].pcv[5], expected -8, is " << last_msg_.apc[3].pcv[5]; - EXPECT_EQ(last_msg_.apc[3].pcv[6], -21) << "incorrect value for last_msg_.apc[3].pcv[6], expected -21, is " << last_msg_.apc[3].pcv[6]; - EXPECT_EQ(last_msg_.apc[3].pcv[7], 97) << "incorrect value for last_msg_.apc[3].pcv[7], expected 97, is " << last_msg_.apc[3].pcv[7]; - EXPECT_EQ(last_msg_.apc[3].pcv[8], 112) << "incorrect value for last_msg_.apc[3].pcv[8], expected 112, is " << last_msg_.apc[3].pcv[8]; - EXPECT_EQ(last_msg_.apc[3].pcv[9], -99) << "incorrect value for last_msg_.apc[3].pcv[9], expected -99, is " << last_msg_.apc[3].pcv[9]; - EXPECT_EQ(last_msg_.apc[3].pcv[10], -117) << "incorrect value for last_msg_.apc[3].pcv[10], expected -117, is " << last_msg_.apc[3].pcv[10]; - EXPECT_EQ(last_msg_.apc[3].pcv[11], 26) << "incorrect value for last_msg_.apc[3].pcv[11], expected 26, is " << last_msg_.apc[3].pcv[11]; - EXPECT_EQ(last_msg_.apc[3].pcv[12], 115) << "incorrect value for last_msg_.apc[3].pcv[12], expected 115, is " << last_msg_.apc[3].pcv[12]; - EXPECT_EQ(last_msg_.apc[3].pcv[13], -64) << "incorrect value for last_msg_.apc[3].pcv[13], expected -64, is " << last_msg_.apc[3].pcv[13]; - EXPECT_EQ(last_msg_.apc[3].pcv[14], 31) << "incorrect value for last_msg_.apc[3].pcv[14], expected 31, is " << last_msg_.apc[3].pcv[14]; - EXPECT_EQ(last_msg_.apc[3].pcv[15], 85) << "incorrect value for last_msg_.apc[3].pcv[15], expected 85, is " << last_msg_.apc[3].pcv[15]; - EXPECT_EQ(last_msg_.apc[3].pcv[16], 127) << "incorrect value for last_msg_.apc[3].pcv[16], expected 127, is " << last_msg_.apc[3].pcv[16]; - EXPECT_EQ(last_msg_.apc[3].pcv[17], -28) << "incorrect value for last_msg_.apc[3].pcv[17], expected -28, is " << last_msg_.apc[3].pcv[17]; - EXPECT_EQ(last_msg_.apc[3].pcv[18], 81) << "incorrect value for last_msg_.apc[3].pcv[18], expected 81, is " << last_msg_.apc[3].pcv[18]; - EXPECT_EQ(last_msg_.apc[3].pcv[19], -4) << "incorrect value for last_msg_.apc[3].pcv[19], expected -4, is " << last_msg_.apc[3].pcv[19]; - EXPECT_EQ(last_msg_.apc[3].pcv[20], -37) << "incorrect value for last_msg_.apc[3].pcv[20], expected -37, is " << last_msg_.apc[3].pcv[20]; - EXPECT_EQ(last_msg_.apc[3].sat_info, 128) << "incorrect value for last_msg_.apc[3].sat_info, expected 128, is " << last_msg_.apc[3].sat_info; - EXPECT_EQ(last_msg_.apc[3].sid.code, 196) << "incorrect value for last_msg_.apc[3].sid.code, expected 196, is " << last_msg_.apc[3].sid.code; - EXPECT_EQ(last_msg_.apc[3].sid.sat, 230) << "incorrect value for last_msg_.apc[3].sid.sat, expected 230, is " << last_msg_.apc[3].sid.sat; - EXPECT_EQ(last_msg_.apc[3].svn, 61399) << "incorrect value for last_msg_.apc[3].svn, expected 61399, is " << last_msg_.apc[3].svn; - EXPECT_EQ(last_msg_.apc[4].pco[0], -11049) << "incorrect value for last_msg_.apc[4].pco[0], expected -11049, is " << last_msg_.apc[4].pco[0]; - EXPECT_EQ(last_msg_.apc[4].pco[1], 6580) << "incorrect value for last_msg_.apc[4].pco[1], expected 6580, is " << last_msg_.apc[4].pco[1]; - EXPECT_EQ(last_msg_.apc[4].pco[2], -28589) << "incorrect value for last_msg_.apc[4].pco[2], expected -28589, is " << last_msg_.apc[4].pco[2]; - EXPECT_EQ(last_msg_.apc[4].pcv[0], -9) << "incorrect value for last_msg_.apc[4].pcv[0], expected -9, is " << last_msg_.apc[4].pcv[0]; - EXPECT_EQ(last_msg_.apc[4].pcv[1], 12) << "incorrect value for last_msg_.apc[4].pcv[1], expected 12, is " << last_msg_.apc[4].pcv[1]; - EXPECT_EQ(last_msg_.apc[4].pcv[2], 27) << "incorrect value for last_msg_.apc[4].pcv[2], expected 27, is " << last_msg_.apc[4].pcv[2]; - EXPECT_EQ(last_msg_.apc[4].pcv[3], -57) << "incorrect value for last_msg_.apc[4].pcv[3], expected -57, is " << last_msg_.apc[4].pcv[3]; - EXPECT_EQ(last_msg_.apc[4].pcv[4], -83) << "incorrect value for last_msg_.apc[4].pcv[4], expected -83, is " << last_msg_.apc[4].pcv[4]; - EXPECT_EQ(last_msg_.apc[4].pcv[5], 74) << "incorrect value for last_msg_.apc[4].pcv[5], expected 74, is " << last_msg_.apc[4].pcv[5]; - EXPECT_EQ(last_msg_.apc[4].pcv[6], 23) << "incorrect value for last_msg_.apc[4].pcv[6], expected 23, is " << last_msg_.apc[4].pcv[6]; - EXPECT_EQ(last_msg_.apc[4].pcv[7], 4) << "incorrect value for last_msg_.apc[4].pcv[7], expected 4, is " << last_msg_.apc[4].pcv[7]; - EXPECT_EQ(last_msg_.apc[4].pcv[8], -17) << "incorrect value for last_msg_.apc[4].pcv[8], expected -17, is " << last_msg_.apc[4].pcv[8]; - EXPECT_EQ(last_msg_.apc[4].pcv[9], 103) << "incorrect value for last_msg_.apc[4].pcv[9], expected 103, is " << last_msg_.apc[4].pcv[9]; - EXPECT_EQ(last_msg_.apc[4].pcv[10], -33) << "incorrect value for last_msg_.apc[4].pcv[10], expected -33, is " << last_msg_.apc[4].pcv[10]; - EXPECT_EQ(last_msg_.apc[4].pcv[11], -36) << "incorrect value for last_msg_.apc[4].pcv[11], expected -36, is " << last_msg_.apc[4].pcv[11]; - EXPECT_EQ(last_msg_.apc[4].pcv[12], -117) << "incorrect value for last_msg_.apc[4].pcv[12], expected -117, is " << last_msg_.apc[4].pcv[12]; - EXPECT_EQ(last_msg_.apc[4].pcv[13], 91) << "incorrect value for last_msg_.apc[4].pcv[13], expected 91, is " << last_msg_.apc[4].pcv[13]; - EXPECT_EQ(last_msg_.apc[4].pcv[14], 127) << "incorrect value for last_msg_.apc[4].pcv[14], expected 127, is " << last_msg_.apc[4].pcv[14]; - EXPECT_EQ(last_msg_.apc[4].pcv[15], -42) << "incorrect value for last_msg_.apc[4].pcv[15], expected -42, is " << last_msg_.apc[4].pcv[15]; - EXPECT_EQ(last_msg_.apc[4].pcv[16], 86) << "incorrect value for last_msg_.apc[4].pcv[16], expected 86, is " << last_msg_.apc[4].pcv[16]; - EXPECT_EQ(last_msg_.apc[4].pcv[17], 48) << "incorrect value for last_msg_.apc[4].pcv[17], expected 48, is " << last_msg_.apc[4].pcv[17]; - EXPECT_EQ(last_msg_.apc[4].pcv[18], -53) << "incorrect value for last_msg_.apc[4].pcv[18], expected -53, is " << last_msg_.apc[4].pcv[18]; - EXPECT_EQ(last_msg_.apc[4].pcv[19], -28) << "incorrect value for last_msg_.apc[4].pcv[19], expected -28, is " << last_msg_.apc[4].pcv[19]; - EXPECT_EQ(last_msg_.apc[4].pcv[20], 99) << "incorrect value for last_msg_.apc[4].pcv[20], expected 99, is " << last_msg_.apc[4].pcv[20]; - EXPECT_EQ(last_msg_.apc[4].sat_info, 147) << "incorrect value for last_msg_.apc[4].sat_info, expected 147, is " << last_msg_.apc[4].sat_info; - EXPECT_EQ(last_msg_.apc[4].sid.code, 110) << "incorrect value for last_msg_.apc[4].sid.code, expected 110, is " << last_msg_.apc[4].sid.code; - EXPECT_EQ(last_msg_.apc[4].sid.sat, 249) << "incorrect value for last_msg_.apc[4].sid.sat, expected 249, is " << last_msg_.apc[4].sid.sat; - EXPECT_EQ(last_msg_.apc[4].svn, 41224) << "incorrect value for last_msg_.apc[4].svn, expected 41224, is " << last_msg_.apc[4].svn; - EXPECT_EQ(last_msg_.apc[5].pco[0], -21881) << "incorrect value for last_msg_.apc[5].pco[0], expected -21881, is " << last_msg_.apc[5].pco[0]; - EXPECT_EQ(last_msg_.apc[5].pco[1], -9942) << "incorrect value for last_msg_.apc[5].pco[1], expected -9942, is " << last_msg_.apc[5].pco[1]; - EXPECT_EQ(last_msg_.apc[5].pco[2], -5689) << "incorrect value for last_msg_.apc[5].pco[2], expected -5689, is " << last_msg_.apc[5].pco[2]; - EXPECT_EQ(last_msg_.apc[5].pcv[0], 42) << "incorrect value for last_msg_.apc[5].pcv[0], expected 42, is " << last_msg_.apc[5].pcv[0]; - EXPECT_EQ(last_msg_.apc[5].pcv[1], -86) << "incorrect value for last_msg_.apc[5].pcv[1], expected -86, is " << last_msg_.apc[5].pcv[1]; - EXPECT_EQ(last_msg_.apc[5].pcv[2], 78) << "incorrect value for last_msg_.apc[5].pcv[2], expected 78, is " << last_msg_.apc[5].pcv[2]; - EXPECT_EQ(last_msg_.apc[5].pcv[3], -50) << "incorrect value for last_msg_.apc[5].pcv[3], expected -50, is " << last_msg_.apc[5].pcv[3]; - EXPECT_EQ(last_msg_.apc[5].pcv[4], 41) << "incorrect value for last_msg_.apc[5].pcv[4], expected 41, is " << last_msg_.apc[5].pcv[4]; - EXPECT_EQ(last_msg_.apc[5].pcv[5], 43) << "incorrect value for last_msg_.apc[5].pcv[5], expected 43, is " << last_msg_.apc[5].pcv[5]; - EXPECT_EQ(last_msg_.apc[5].pcv[6], 81) << "incorrect value for last_msg_.apc[5].pcv[6], expected 81, is " << last_msg_.apc[5].pcv[6]; - EXPECT_EQ(last_msg_.apc[5].pcv[7], -9) << "incorrect value for last_msg_.apc[5].pcv[7], expected -9, is " << last_msg_.apc[5].pcv[7]; - EXPECT_EQ(last_msg_.apc[5].pcv[8], 99) << "incorrect value for last_msg_.apc[5].pcv[8], expected 99, is " << last_msg_.apc[5].pcv[8]; - EXPECT_EQ(last_msg_.apc[5].pcv[9], -58) << "incorrect value for last_msg_.apc[5].pcv[9], expected -58, is " << last_msg_.apc[5].pcv[9]; - EXPECT_EQ(last_msg_.apc[5].pcv[10], -112) << "incorrect value for last_msg_.apc[5].pcv[10], expected -112, is " << last_msg_.apc[5].pcv[10]; - EXPECT_EQ(last_msg_.apc[5].pcv[11], 2) << "incorrect value for last_msg_.apc[5].pcv[11], expected 2, is " << last_msg_.apc[5].pcv[11]; - EXPECT_EQ(last_msg_.apc[5].pcv[12], -124) << "incorrect value for last_msg_.apc[5].pcv[12], expected -124, is " << last_msg_.apc[5].pcv[12]; - EXPECT_EQ(last_msg_.apc[5].pcv[13], 2) << "incorrect value for last_msg_.apc[5].pcv[13], expected 2, is " << last_msg_.apc[5].pcv[13]; - EXPECT_EQ(last_msg_.apc[5].pcv[14], -32) << "incorrect value for last_msg_.apc[5].pcv[14], expected -32, is " << last_msg_.apc[5].pcv[14]; - EXPECT_EQ(last_msg_.apc[5].pcv[15], -36) << "incorrect value for last_msg_.apc[5].pcv[15], expected -36, is " << last_msg_.apc[5].pcv[15]; - EXPECT_EQ(last_msg_.apc[5].pcv[16], -108) << "incorrect value for last_msg_.apc[5].pcv[16], expected -108, is " << last_msg_.apc[5].pcv[16]; - EXPECT_EQ(last_msg_.apc[5].pcv[17], 58) << "incorrect value for last_msg_.apc[5].pcv[17], expected 58, is " << last_msg_.apc[5].pcv[17]; - EXPECT_EQ(last_msg_.apc[5].pcv[18], 85) << "incorrect value for last_msg_.apc[5].pcv[18], expected 85, is " << last_msg_.apc[5].pcv[18]; - EXPECT_EQ(last_msg_.apc[5].pcv[19], -118) << "incorrect value for last_msg_.apc[5].pcv[19], expected -118, is " << last_msg_.apc[5].pcv[19]; - EXPECT_EQ(last_msg_.apc[5].pcv[20], -46) << "incorrect value for last_msg_.apc[5].pcv[20], expected -46, is " << last_msg_.apc[5].pcv[20]; - EXPECT_EQ(last_msg_.apc[5].sat_info, 159) << "incorrect value for last_msg_.apc[5].sat_info, expected 159, is " << last_msg_.apc[5].sat_info; - EXPECT_EQ(last_msg_.apc[5].sid.code, 83) << "incorrect value for last_msg_.apc[5].sid.code, expected 83, is " << last_msg_.apc[5].sid.code; - EXPECT_EQ(last_msg_.apc[5].sid.sat, 45) << "incorrect value for last_msg_.apc[5].sid.sat, expected 45, is " << last_msg_.apc[5].sid.sat; - EXPECT_EQ(last_msg_.apc[5].svn, 64011) << "incorrect value for last_msg_.apc[5].svn, expected 64011, is " << last_msg_.apc[5].svn; - EXPECT_EQ(last_msg_.apc[6].pco[0], -14290) << "incorrect value for last_msg_.apc[6].pco[0], expected -14290, is " << last_msg_.apc[6].pco[0]; - EXPECT_EQ(last_msg_.apc[6].pco[1], 30340) << "incorrect value for last_msg_.apc[6].pco[1], expected 30340, is " << last_msg_.apc[6].pco[1]; - EXPECT_EQ(last_msg_.apc[6].pco[2], 3569) << "incorrect value for last_msg_.apc[6].pco[2], expected 3569, is " << last_msg_.apc[6].pco[2]; - EXPECT_EQ(last_msg_.apc[6].pcv[0], 37) << "incorrect value for last_msg_.apc[6].pcv[0], expected 37, is " << last_msg_.apc[6].pcv[0]; - EXPECT_EQ(last_msg_.apc[6].pcv[1], 62) << "incorrect value for last_msg_.apc[6].pcv[1], expected 62, is " << last_msg_.apc[6].pcv[1]; - EXPECT_EQ(last_msg_.apc[6].pcv[2], 107) << "incorrect value for last_msg_.apc[6].pcv[2], expected 107, is " << last_msg_.apc[6].pcv[2]; - EXPECT_EQ(last_msg_.apc[6].pcv[3], -3) << "incorrect value for last_msg_.apc[6].pcv[3], expected -3, is " << last_msg_.apc[6].pcv[3]; - EXPECT_EQ(last_msg_.apc[6].pcv[4], -66) << "incorrect value for last_msg_.apc[6].pcv[4], expected -66, is " << last_msg_.apc[6].pcv[4]; - EXPECT_EQ(last_msg_.apc[6].pcv[5], -120) << "incorrect value for last_msg_.apc[6].pcv[5], expected -120, is " << last_msg_.apc[6].pcv[5]; - EXPECT_EQ(last_msg_.apc[6].pcv[6], 66) << "incorrect value for last_msg_.apc[6].pcv[6], expected 66, is " << last_msg_.apc[6].pcv[6]; - EXPECT_EQ(last_msg_.apc[6].pcv[7], 9) << "incorrect value for last_msg_.apc[6].pcv[7], expected 9, is " << last_msg_.apc[6].pcv[7]; - EXPECT_EQ(last_msg_.apc[6].pcv[8], 84) << "incorrect value for last_msg_.apc[6].pcv[8], expected 84, is " << last_msg_.apc[6].pcv[8]; - EXPECT_EQ(last_msg_.apc[6].pcv[9], -101) << "incorrect value for last_msg_.apc[6].pcv[9], expected -101, is " << last_msg_.apc[6].pcv[9]; - EXPECT_EQ(last_msg_.apc[6].pcv[10], 86) << "incorrect value for last_msg_.apc[6].pcv[10], expected 86, is " << last_msg_.apc[6].pcv[10]; - EXPECT_EQ(last_msg_.apc[6].pcv[11], -76) << "incorrect value for last_msg_.apc[6].pcv[11], expected -76, is " << last_msg_.apc[6].pcv[11]; - EXPECT_EQ(last_msg_.apc[6].pcv[12], 41) << "incorrect value for last_msg_.apc[6].pcv[12], expected 41, is " << last_msg_.apc[6].pcv[12]; - EXPECT_EQ(last_msg_.apc[6].pcv[13], -60) << "incorrect value for last_msg_.apc[6].pcv[13], expected -60, is " << last_msg_.apc[6].pcv[13]; - EXPECT_EQ(last_msg_.apc[6].pcv[14], 40) << "incorrect value for last_msg_.apc[6].pcv[14], expected 40, is " << last_msg_.apc[6].pcv[14]; - EXPECT_EQ(last_msg_.apc[6].pcv[15], 119) << "incorrect value for last_msg_.apc[6].pcv[15], expected 119, is " << last_msg_.apc[6].pcv[15]; - EXPECT_EQ(last_msg_.apc[6].pcv[16], 101) << "incorrect value for last_msg_.apc[6].pcv[16], expected 101, is " << last_msg_.apc[6].pcv[16]; - EXPECT_EQ(last_msg_.apc[6].pcv[17], -4) << "incorrect value for last_msg_.apc[6].pcv[17], expected -4, is " << last_msg_.apc[6].pcv[17]; - EXPECT_EQ(last_msg_.apc[6].pcv[18], -33) << "incorrect value for last_msg_.apc[6].pcv[18], expected -33, is " << last_msg_.apc[6].pcv[18]; - EXPECT_EQ(last_msg_.apc[6].pcv[19], -112) << "incorrect value for last_msg_.apc[6].pcv[19], expected -112, is " << last_msg_.apc[6].pcv[19]; - EXPECT_EQ(last_msg_.apc[6].pcv[20], -103) << "incorrect value for last_msg_.apc[6].pcv[20], expected -103, is " << last_msg_.apc[6].pcv[20]; - EXPECT_EQ(last_msg_.apc[6].sat_info, 7) << "incorrect value for last_msg_.apc[6].sat_info, expected 7, is " << last_msg_.apc[6].sat_info; - EXPECT_EQ(last_msg_.apc[6].sid.code, 158) << "incorrect value for last_msg_.apc[6].sid.code, expected 158, is " << last_msg_.apc[6].sid.code; - EXPECT_EQ(last_msg_.apc[6].sid.sat, 200) << "incorrect value for last_msg_.apc[6].sid.sat, expected 200, is " << last_msg_.apc[6].sid.sat; - EXPECT_EQ(last_msg_.apc[6].svn, 17310) << "incorrect value for last_msg_.apc[6].svn, expected 17310, is " << last_msg_.apc[6].svn; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_apc.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_apc.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_apc.handle_as << "'"; - } - { - const char check_string[] = { (char)97,(char)112,(char)99 }; - EXPECT_EQ(memcmp(last_msg_.n_apc.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_apc.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_apc.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_apc.value, 7) << "incorrect value for last_msg_.n_apc.value, expected 7, is " << last_msg_.n_apc.value; +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 4, 6, 56, 19, 224, 203, 169, 240, 78, 4, 213, 171, 254, 214, + 212, 4, 8, 33, 31, 80, 21, 4, 105, 225, 39, 139, 124, 149, 48, + 15, 214, 197, 141, 32, 33, 135, 150, 148, 123, 49, 135, 97, 39, 90, + 20, 169, 239, 47, 153, 175, 35, 145, 145, 123, 194, 2, 102, 74, 149, + 95, 171, 238, 249, 7, 237, 170, 125, 106, 158, 83, 188, 181, 194, 27, + 84, 226, 142, 123, 77, 217, 248, 67, 215, 129, 114, 138, 25, 240, 10, + 56, 76, 61, 161, 216, 22, 181, 174, 33, 13, 252, 236, 230, 196, 128, + 215, 239, 234, 179, 220, 44, 212, 57, 44, 173, 49, 36, 137, 248, 235, + 97, 112, 157, 139, 26, 115, 192, 31, 85, 127, 228, 81, 252, 219, 249, + 110, 147, 8, 161, 215, 212, 180, 25, 83, 144, 247, 12, 27, 199, 173, + 74, 23, 4, 239, 103, 223, 220, 139, 91, 127, 214, 86, 48, 203, 228, + 99, 45, 83, 159, 11, 250, 135, 170, 42, 217, 199, 233, 42, 170, 78, + 206, 41, 43, 81, 247, 99, 198, 144, 2, 132, 2, 224, 220, 148, 58, + 85, 138, 210, 200, 158, 7, 158, 67, 46, 200, 132, 118, 241, 13, 37, + 62, 107, 253, 190, 136, 66, 9, 84, 155, 86, 180, 41, 196, 40, 119, + 101, 252, 223, 144, 153, 50, 13, + }; + + sbp_msg_ssr_satellite_apc_dep_t test_msg{}; + + test_msg.apc[0].pco[0] = -21547; + + test_msg.apc[0].pco[1] = -10498; + + test_msg.apc[0].pco[2] = 1236; + + test_msg.apc[0].pcv[0] = 8; + + test_msg.apc[0].pcv[1] = 33; + + test_msg.apc[0].pcv[2] = 31; + + test_msg.apc[0].pcv[3] = 80; + + test_msg.apc[0].pcv[4] = 21; + + test_msg.apc[0].pcv[5] = 4; + + test_msg.apc[0].pcv[6] = 105; + + test_msg.apc[0].pcv[7] = -31; + + test_msg.apc[0].pcv[8] = 39; + + test_msg.apc[0].pcv[9] = -117; + + test_msg.apc[0].pcv[10] = 124; + + test_msg.apc[0].pcv[11] = -107; + + test_msg.apc[0].pcv[12] = 48; + + test_msg.apc[0].pcv[13] = 15; + + test_msg.apc[0].pcv[14] = -42; + + test_msg.apc[0].pcv[15] = -59; + + test_msg.apc[0].pcv[16] = -115; + + test_msg.apc[0].pcv[17] = 32; + + test_msg.apc[0].pcv[18] = 33; + + test_msg.apc[0].pcv[19] = -121; + + test_msg.apc[0].pcv[20] = -106; + test_msg.apc[0].sat_info = 240; + test_msg.apc[0].sid.code = 169; + test_msg.apc[0].sid.sat = 203; + test_msg.apc[0].svn = 1102; + + test_msg.apc[1].pco[0] = 23079; + + test_msg.apc[1].pco[1] = -22252; + + test_msg.apc[1].pco[2] = 12271; + + test_msg.apc[1].pcv[0] = -103; + + test_msg.apc[1].pcv[1] = -81; + + test_msg.apc[1].pcv[2] = 35; + + test_msg.apc[1].pcv[3] = -111; + + test_msg.apc[1].pcv[4] = -111; + + test_msg.apc[1].pcv[5] = 123; + + test_msg.apc[1].pcv[6] = -62; + + test_msg.apc[1].pcv[7] = 2; + + test_msg.apc[1].pcv[8] = 102; + + test_msg.apc[1].pcv[9] = 74; + + test_msg.apc[1].pcv[10] = -107; + + test_msg.apc[1].pcv[11] = 95; + + test_msg.apc[1].pcv[12] = -85; + + test_msg.apc[1].pcv[13] = -18; + + test_msg.apc[1].pcv[14] = -7; + + test_msg.apc[1].pcv[15] = 7; + + test_msg.apc[1].pcv[16] = -19; + + test_msg.apc[1].pcv[17] = -86; + + test_msg.apc[1].pcv[18] = 125; + + test_msg.apc[1].pcv[19] = 106; + + test_msg.apc[1].pcv[20] = -98; + test_msg.apc[1].sat_info = 49; + test_msg.apc[1].sid.code = 123; + test_msg.apc[1].sid.sat = 148; + test_msg.apc[1].svn = 24967; + + test_msg.apc[2].pco[0] = -7596; + + test_msg.apc[2].pco[1] = 31630; + + test_msg.apc[2].pco[2] = -9907; + + test_msg.apc[2].pcv[0] = -8; + + test_msg.apc[2].pcv[1] = 67; + + test_msg.apc[2].pcv[2] = -41; + + test_msg.apc[2].pcv[3] = -127; + + test_msg.apc[2].pcv[4] = 114; + + test_msg.apc[2].pcv[5] = -118; + + test_msg.apc[2].pcv[6] = 25; + + test_msg.apc[2].pcv[7] = -16; + + test_msg.apc[2].pcv[8] = 10; + + test_msg.apc[2].pcv[9] = 56; + + test_msg.apc[2].pcv[10] = 76; + + test_msg.apc[2].pcv[11] = 61; + + test_msg.apc[2].pcv[12] = -95; + + test_msg.apc[2].pcv[13] = -40; + + test_msg.apc[2].pcv[14] = 22; + + test_msg.apc[2].pcv[15] = -75; + + test_msg.apc[2].pcv[16] = -82; + + test_msg.apc[2].pcv[17] = 33; + + test_msg.apc[2].pcv[18] = 13; + + test_msg.apc[2].pcv[19] = -4; + + test_msg.apc[2].pcv[20] = -20; + test_msg.apc[2].sat_info = 181; + test_msg.apc[2].sid.code = 188; + test_msg.apc[2].sid.sat = 83; + test_msg.apc[2].svn = 7106; + + test_msg.apc[3].pco[0] = -19478; + + test_msg.apc[3].pco[1] = 11484; + + test_msg.apc[3].pco[2] = 14804; + + test_msg.apc[3].pcv[0] = 44; + + test_msg.apc[3].pcv[1] = -83; + + test_msg.apc[3].pcv[2] = 49; + + test_msg.apc[3].pcv[3] = 36; + + test_msg.apc[3].pcv[4] = -119; + + test_msg.apc[3].pcv[5] = -8; + + test_msg.apc[3].pcv[6] = -21; + + test_msg.apc[3].pcv[7] = 97; + + test_msg.apc[3].pcv[8] = 112; + + test_msg.apc[3].pcv[9] = -99; + + test_msg.apc[3].pcv[10] = -117; + + test_msg.apc[3].pcv[11] = 26; + + test_msg.apc[3].pcv[12] = 115; + + test_msg.apc[3].pcv[13] = -64; + + test_msg.apc[3].pcv[14] = 31; + + test_msg.apc[3].pcv[15] = 85; + + test_msg.apc[3].pcv[16] = 127; + + test_msg.apc[3].pcv[17] = -28; + + test_msg.apc[3].pcv[18] = 81; + + test_msg.apc[3].pcv[19] = -4; + + test_msg.apc[3].pcv[20] = -37; + test_msg.apc[3].sat_info = 128; + test_msg.apc[3].sid.code = 196; + test_msg.apc[3].sid.sat = 230; + test_msg.apc[3].svn = 61399; + + test_msg.apc[4].pco[0] = -11049; + + test_msg.apc[4].pco[1] = 6580; + + test_msg.apc[4].pco[2] = -28589; + + test_msg.apc[4].pcv[0] = -9; + + test_msg.apc[4].pcv[1] = 12; + + test_msg.apc[4].pcv[2] = 27; + + test_msg.apc[4].pcv[3] = -57; + + test_msg.apc[4].pcv[4] = -83; + + test_msg.apc[4].pcv[5] = 74; + + test_msg.apc[4].pcv[6] = 23; + + test_msg.apc[4].pcv[7] = 4; + + test_msg.apc[4].pcv[8] = -17; + + test_msg.apc[4].pcv[9] = 103; + + test_msg.apc[4].pcv[10] = -33; + + test_msg.apc[4].pcv[11] = -36; + + test_msg.apc[4].pcv[12] = -117; + + test_msg.apc[4].pcv[13] = 91; + + test_msg.apc[4].pcv[14] = 127; + + test_msg.apc[4].pcv[15] = -42; + + test_msg.apc[4].pcv[16] = 86; + + test_msg.apc[4].pcv[17] = 48; + + test_msg.apc[4].pcv[18] = -53; + + test_msg.apc[4].pcv[19] = -28; + + test_msg.apc[4].pcv[20] = 99; + test_msg.apc[4].sat_info = 147; + test_msg.apc[4].sid.code = 110; + test_msg.apc[4].sid.sat = 249; + test_msg.apc[4].svn = 41224; + + test_msg.apc[5].pco[0] = -21881; + + test_msg.apc[5].pco[1] = -9942; + + test_msg.apc[5].pco[2] = -5689; + + test_msg.apc[5].pcv[0] = 42; + + test_msg.apc[5].pcv[1] = -86; + + test_msg.apc[5].pcv[2] = 78; + + test_msg.apc[5].pcv[3] = -50; + + test_msg.apc[5].pcv[4] = 41; + + test_msg.apc[5].pcv[5] = 43; + + test_msg.apc[5].pcv[6] = 81; + + test_msg.apc[5].pcv[7] = -9; + + test_msg.apc[5].pcv[8] = 99; + + test_msg.apc[5].pcv[9] = -58; + + test_msg.apc[5].pcv[10] = -112; + + test_msg.apc[5].pcv[11] = 2; + + test_msg.apc[5].pcv[12] = -124; + + test_msg.apc[5].pcv[13] = 2; + + test_msg.apc[5].pcv[14] = -32; + + test_msg.apc[5].pcv[15] = -36; + + test_msg.apc[5].pcv[16] = -108; + + test_msg.apc[5].pcv[17] = 58; + + test_msg.apc[5].pcv[18] = 85; + + test_msg.apc[5].pcv[19] = -118; + + test_msg.apc[5].pcv[20] = -46; + test_msg.apc[5].sat_info = 159; + test_msg.apc[5].sid.code = 83; + test_msg.apc[5].sid.sat = 45; + test_msg.apc[5].svn = 64011; + + test_msg.apc[6].pco[0] = -14290; + + test_msg.apc[6].pco[1] = 30340; + + test_msg.apc[6].pco[2] = 3569; + + test_msg.apc[6].pcv[0] = 37; + + test_msg.apc[6].pcv[1] = 62; + + test_msg.apc[6].pcv[2] = 107; + + test_msg.apc[6].pcv[3] = -3; + + test_msg.apc[6].pcv[4] = -66; + + test_msg.apc[6].pcv[5] = -120; + + test_msg.apc[6].pcv[6] = 66; + + test_msg.apc[6].pcv[7] = 9; + + test_msg.apc[6].pcv[8] = 84; + + test_msg.apc[6].pcv[9] = -101; + + test_msg.apc[6].pcv[10] = 86; + + test_msg.apc[6].pcv[11] = -76; + + test_msg.apc[6].pcv[12] = 41; + + test_msg.apc[6].pcv[13] = -60; + + test_msg.apc[6].pcv[14] = 40; + + test_msg.apc[6].pcv[15] = 119; + + test_msg.apc[6].pcv[16] = 101; + + test_msg.apc[6].pcv[17] = -4; + + test_msg.apc[6].pcv[18] = -33; + + test_msg.apc[6].pcv[19] = -112; + + test_msg.apc[6].pcv[20] = -103; + test_msg.apc[6].sat_info = 7; + test_msg.apc[6].sid.code = 158; + test_msg.apc[6].sid.sat = 200; + test_msg.apc[6].svn = 17310; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_apc.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)97, (char)112, (char)99}; + memcpy(test_msg.n_apc.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_apc.value = 7; + + EXPECT_EQ(send_message(4920, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4920); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.apc[0].pco[0], -21547) + << "incorrect value for last_msg_.apc[0].pco[0], expected -21547, is " + << last_msg_.apc[0].pco[0]; + EXPECT_EQ(last_msg_.apc[0].pco[1], -10498) + << "incorrect value for last_msg_.apc[0].pco[1], expected -10498, is " + << last_msg_.apc[0].pco[1]; + EXPECT_EQ(last_msg_.apc[0].pco[2], 1236) + << "incorrect value for last_msg_.apc[0].pco[2], expected 1236, is " + << last_msg_.apc[0].pco[2]; + EXPECT_EQ(last_msg_.apc[0].pcv[0], 8) + << "incorrect value for last_msg_.apc[0].pcv[0], expected 8, is " + << last_msg_.apc[0].pcv[0]; + EXPECT_EQ(last_msg_.apc[0].pcv[1], 33) + << "incorrect value for last_msg_.apc[0].pcv[1], expected 33, is " + << last_msg_.apc[0].pcv[1]; + EXPECT_EQ(last_msg_.apc[0].pcv[2], 31) + << "incorrect value for last_msg_.apc[0].pcv[2], expected 31, is " + << last_msg_.apc[0].pcv[2]; + EXPECT_EQ(last_msg_.apc[0].pcv[3], 80) + << "incorrect value for last_msg_.apc[0].pcv[3], expected 80, is " + << last_msg_.apc[0].pcv[3]; + EXPECT_EQ(last_msg_.apc[0].pcv[4], 21) + << "incorrect value for last_msg_.apc[0].pcv[4], expected 21, is " + << last_msg_.apc[0].pcv[4]; + EXPECT_EQ(last_msg_.apc[0].pcv[5], 4) + << "incorrect value for last_msg_.apc[0].pcv[5], expected 4, is " + << last_msg_.apc[0].pcv[5]; + EXPECT_EQ(last_msg_.apc[0].pcv[6], 105) + << "incorrect value for last_msg_.apc[0].pcv[6], expected 105, is " + << last_msg_.apc[0].pcv[6]; + EXPECT_EQ(last_msg_.apc[0].pcv[7], -31) + << "incorrect value for last_msg_.apc[0].pcv[7], expected -31, is " + << last_msg_.apc[0].pcv[7]; + EXPECT_EQ(last_msg_.apc[0].pcv[8], 39) + << "incorrect value for last_msg_.apc[0].pcv[8], expected 39, is " + << last_msg_.apc[0].pcv[8]; + EXPECT_EQ(last_msg_.apc[0].pcv[9], -117) + << "incorrect value for last_msg_.apc[0].pcv[9], expected -117, is " + << last_msg_.apc[0].pcv[9]; + EXPECT_EQ(last_msg_.apc[0].pcv[10], 124) + << "incorrect value for last_msg_.apc[0].pcv[10], expected 124, is " + << last_msg_.apc[0].pcv[10]; + EXPECT_EQ(last_msg_.apc[0].pcv[11], -107) + << "incorrect value for last_msg_.apc[0].pcv[11], expected -107, is " + << last_msg_.apc[0].pcv[11]; + EXPECT_EQ(last_msg_.apc[0].pcv[12], 48) + << "incorrect value for last_msg_.apc[0].pcv[12], expected 48, is " + << last_msg_.apc[0].pcv[12]; + EXPECT_EQ(last_msg_.apc[0].pcv[13], 15) + << "incorrect value for last_msg_.apc[0].pcv[13], expected 15, is " + << last_msg_.apc[0].pcv[13]; + EXPECT_EQ(last_msg_.apc[0].pcv[14], -42) + << "incorrect value for last_msg_.apc[0].pcv[14], expected -42, is " + << last_msg_.apc[0].pcv[14]; + EXPECT_EQ(last_msg_.apc[0].pcv[15], -59) + << "incorrect value for last_msg_.apc[0].pcv[15], expected -59, is " + << last_msg_.apc[0].pcv[15]; + EXPECT_EQ(last_msg_.apc[0].pcv[16], -115) + << "incorrect value for last_msg_.apc[0].pcv[16], expected -115, is " + << last_msg_.apc[0].pcv[16]; + EXPECT_EQ(last_msg_.apc[0].pcv[17], 32) + << "incorrect value for last_msg_.apc[0].pcv[17], expected 32, is " + << last_msg_.apc[0].pcv[17]; + EXPECT_EQ(last_msg_.apc[0].pcv[18], 33) + << "incorrect value for last_msg_.apc[0].pcv[18], expected 33, is " + << last_msg_.apc[0].pcv[18]; + EXPECT_EQ(last_msg_.apc[0].pcv[19], -121) + << "incorrect value for last_msg_.apc[0].pcv[19], expected -121, is " + << last_msg_.apc[0].pcv[19]; + EXPECT_EQ(last_msg_.apc[0].pcv[20], -106) + << "incorrect value for last_msg_.apc[0].pcv[20], expected -106, is " + << last_msg_.apc[0].pcv[20]; + EXPECT_EQ(last_msg_.apc[0].sat_info, 240) + << "incorrect value for last_msg_.apc[0].sat_info, expected 240, is " + << last_msg_.apc[0].sat_info; + EXPECT_EQ(last_msg_.apc[0].sid.code, 169) + << "incorrect value for last_msg_.apc[0].sid.code, expected 169, is " + << last_msg_.apc[0].sid.code; + EXPECT_EQ(last_msg_.apc[0].sid.sat, 203) + << "incorrect value for last_msg_.apc[0].sid.sat, expected 203, is " + << last_msg_.apc[0].sid.sat; + EXPECT_EQ(last_msg_.apc[0].svn, 1102) + << "incorrect value for last_msg_.apc[0].svn, expected 1102, is " + << last_msg_.apc[0].svn; + EXPECT_EQ(last_msg_.apc[1].pco[0], 23079) + << "incorrect value for last_msg_.apc[1].pco[0], expected 23079, is " + << last_msg_.apc[1].pco[0]; + EXPECT_EQ(last_msg_.apc[1].pco[1], -22252) + << "incorrect value for last_msg_.apc[1].pco[1], expected -22252, is " + << last_msg_.apc[1].pco[1]; + EXPECT_EQ(last_msg_.apc[1].pco[2], 12271) + << "incorrect value for last_msg_.apc[1].pco[2], expected 12271, is " + << last_msg_.apc[1].pco[2]; + EXPECT_EQ(last_msg_.apc[1].pcv[0], -103) + << "incorrect value for last_msg_.apc[1].pcv[0], expected -103, is " + << last_msg_.apc[1].pcv[0]; + EXPECT_EQ(last_msg_.apc[1].pcv[1], -81) + << "incorrect value for last_msg_.apc[1].pcv[1], expected -81, is " + << last_msg_.apc[1].pcv[1]; + EXPECT_EQ(last_msg_.apc[1].pcv[2], 35) + << "incorrect value for last_msg_.apc[1].pcv[2], expected 35, is " + << last_msg_.apc[1].pcv[2]; + EXPECT_EQ(last_msg_.apc[1].pcv[3], -111) + << "incorrect value for last_msg_.apc[1].pcv[3], expected -111, is " + << last_msg_.apc[1].pcv[3]; + EXPECT_EQ(last_msg_.apc[1].pcv[4], -111) + << "incorrect value for last_msg_.apc[1].pcv[4], expected -111, is " + << last_msg_.apc[1].pcv[4]; + EXPECT_EQ(last_msg_.apc[1].pcv[5], 123) + << "incorrect value for last_msg_.apc[1].pcv[5], expected 123, is " + << last_msg_.apc[1].pcv[5]; + EXPECT_EQ(last_msg_.apc[1].pcv[6], -62) + << "incorrect value for last_msg_.apc[1].pcv[6], expected -62, is " + << last_msg_.apc[1].pcv[6]; + EXPECT_EQ(last_msg_.apc[1].pcv[7], 2) + << "incorrect value for last_msg_.apc[1].pcv[7], expected 2, is " + << last_msg_.apc[1].pcv[7]; + EXPECT_EQ(last_msg_.apc[1].pcv[8], 102) + << "incorrect value for last_msg_.apc[1].pcv[8], expected 102, is " + << last_msg_.apc[1].pcv[8]; + EXPECT_EQ(last_msg_.apc[1].pcv[9], 74) + << "incorrect value for last_msg_.apc[1].pcv[9], expected 74, is " + << last_msg_.apc[1].pcv[9]; + EXPECT_EQ(last_msg_.apc[1].pcv[10], -107) + << "incorrect value for last_msg_.apc[1].pcv[10], expected -107, is " + << last_msg_.apc[1].pcv[10]; + EXPECT_EQ(last_msg_.apc[1].pcv[11], 95) + << "incorrect value for last_msg_.apc[1].pcv[11], expected 95, is " + << last_msg_.apc[1].pcv[11]; + EXPECT_EQ(last_msg_.apc[1].pcv[12], -85) + << "incorrect value for last_msg_.apc[1].pcv[12], expected -85, is " + << last_msg_.apc[1].pcv[12]; + EXPECT_EQ(last_msg_.apc[1].pcv[13], -18) + << "incorrect value for last_msg_.apc[1].pcv[13], expected -18, is " + << last_msg_.apc[1].pcv[13]; + EXPECT_EQ(last_msg_.apc[1].pcv[14], -7) + << "incorrect value for last_msg_.apc[1].pcv[14], expected -7, is " + << last_msg_.apc[1].pcv[14]; + EXPECT_EQ(last_msg_.apc[1].pcv[15], 7) + << "incorrect value for last_msg_.apc[1].pcv[15], expected 7, is " + << last_msg_.apc[1].pcv[15]; + EXPECT_EQ(last_msg_.apc[1].pcv[16], -19) + << "incorrect value for last_msg_.apc[1].pcv[16], expected -19, is " + << last_msg_.apc[1].pcv[16]; + EXPECT_EQ(last_msg_.apc[1].pcv[17], -86) + << "incorrect value for last_msg_.apc[1].pcv[17], expected -86, is " + << last_msg_.apc[1].pcv[17]; + EXPECT_EQ(last_msg_.apc[1].pcv[18], 125) + << "incorrect value for last_msg_.apc[1].pcv[18], expected 125, is " + << last_msg_.apc[1].pcv[18]; + EXPECT_EQ(last_msg_.apc[1].pcv[19], 106) + << "incorrect value for last_msg_.apc[1].pcv[19], expected 106, is " + << last_msg_.apc[1].pcv[19]; + EXPECT_EQ(last_msg_.apc[1].pcv[20], -98) + << "incorrect value for last_msg_.apc[1].pcv[20], expected -98, is " + << last_msg_.apc[1].pcv[20]; + EXPECT_EQ(last_msg_.apc[1].sat_info, 49) + << "incorrect value for last_msg_.apc[1].sat_info, expected 49, is " + << last_msg_.apc[1].sat_info; + EXPECT_EQ(last_msg_.apc[1].sid.code, 123) + << "incorrect value for last_msg_.apc[1].sid.code, expected 123, is " + << last_msg_.apc[1].sid.code; + EXPECT_EQ(last_msg_.apc[1].sid.sat, 148) + << "incorrect value for last_msg_.apc[1].sid.sat, expected 148, is " + << last_msg_.apc[1].sid.sat; + EXPECT_EQ(last_msg_.apc[1].svn, 24967) + << "incorrect value for last_msg_.apc[1].svn, expected 24967, is " + << last_msg_.apc[1].svn; + EXPECT_EQ(last_msg_.apc[2].pco[0], -7596) + << "incorrect value for last_msg_.apc[2].pco[0], expected -7596, is " + << last_msg_.apc[2].pco[0]; + EXPECT_EQ(last_msg_.apc[2].pco[1], 31630) + << "incorrect value for last_msg_.apc[2].pco[1], expected 31630, is " + << last_msg_.apc[2].pco[1]; + EXPECT_EQ(last_msg_.apc[2].pco[2], -9907) + << "incorrect value for last_msg_.apc[2].pco[2], expected -9907, is " + << last_msg_.apc[2].pco[2]; + EXPECT_EQ(last_msg_.apc[2].pcv[0], -8) + << "incorrect value for last_msg_.apc[2].pcv[0], expected -8, is " + << last_msg_.apc[2].pcv[0]; + EXPECT_EQ(last_msg_.apc[2].pcv[1], 67) + << "incorrect value for last_msg_.apc[2].pcv[1], expected 67, is " + << last_msg_.apc[2].pcv[1]; + EXPECT_EQ(last_msg_.apc[2].pcv[2], -41) + << "incorrect value for last_msg_.apc[2].pcv[2], expected -41, is " + << last_msg_.apc[2].pcv[2]; + EXPECT_EQ(last_msg_.apc[2].pcv[3], -127) + << "incorrect value for last_msg_.apc[2].pcv[3], expected -127, is " + << last_msg_.apc[2].pcv[3]; + EXPECT_EQ(last_msg_.apc[2].pcv[4], 114) + << "incorrect value for last_msg_.apc[2].pcv[4], expected 114, is " + << last_msg_.apc[2].pcv[4]; + EXPECT_EQ(last_msg_.apc[2].pcv[5], -118) + << "incorrect value for last_msg_.apc[2].pcv[5], expected -118, is " + << last_msg_.apc[2].pcv[5]; + EXPECT_EQ(last_msg_.apc[2].pcv[6], 25) + << "incorrect value for last_msg_.apc[2].pcv[6], expected 25, is " + << last_msg_.apc[2].pcv[6]; + EXPECT_EQ(last_msg_.apc[2].pcv[7], -16) + << "incorrect value for last_msg_.apc[2].pcv[7], expected -16, is " + << last_msg_.apc[2].pcv[7]; + EXPECT_EQ(last_msg_.apc[2].pcv[8], 10) + << "incorrect value for last_msg_.apc[2].pcv[8], expected 10, is " + << last_msg_.apc[2].pcv[8]; + EXPECT_EQ(last_msg_.apc[2].pcv[9], 56) + << "incorrect value for last_msg_.apc[2].pcv[9], expected 56, is " + << last_msg_.apc[2].pcv[9]; + EXPECT_EQ(last_msg_.apc[2].pcv[10], 76) + << "incorrect value for last_msg_.apc[2].pcv[10], expected 76, is " + << last_msg_.apc[2].pcv[10]; + EXPECT_EQ(last_msg_.apc[2].pcv[11], 61) + << "incorrect value for last_msg_.apc[2].pcv[11], expected 61, is " + << last_msg_.apc[2].pcv[11]; + EXPECT_EQ(last_msg_.apc[2].pcv[12], -95) + << "incorrect value for last_msg_.apc[2].pcv[12], expected -95, is " + << last_msg_.apc[2].pcv[12]; + EXPECT_EQ(last_msg_.apc[2].pcv[13], -40) + << "incorrect value for last_msg_.apc[2].pcv[13], expected -40, is " + << last_msg_.apc[2].pcv[13]; + EXPECT_EQ(last_msg_.apc[2].pcv[14], 22) + << "incorrect value for last_msg_.apc[2].pcv[14], expected 22, is " + << last_msg_.apc[2].pcv[14]; + EXPECT_EQ(last_msg_.apc[2].pcv[15], -75) + << "incorrect value for last_msg_.apc[2].pcv[15], expected -75, is " + << last_msg_.apc[2].pcv[15]; + EXPECT_EQ(last_msg_.apc[2].pcv[16], -82) + << "incorrect value for last_msg_.apc[2].pcv[16], expected -82, is " + << last_msg_.apc[2].pcv[16]; + EXPECT_EQ(last_msg_.apc[2].pcv[17], 33) + << "incorrect value for last_msg_.apc[2].pcv[17], expected 33, is " + << last_msg_.apc[2].pcv[17]; + EXPECT_EQ(last_msg_.apc[2].pcv[18], 13) + << "incorrect value for last_msg_.apc[2].pcv[18], expected 13, is " + << last_msg_.apc[2].pcv[18]; + EXPECT_EQ(last_msg_.apc[2].pcv[19], -4) + << "incorrect value for last_msg_.apc[2].pcv[19], expected -4, is " + << last_msg_.apc[2].pcv[19]; + EXPECT_EQ(last_msg_.apc[2].pcv[20], -20) + << "incorrect value for last_msg_.apc[2].pcv[20], expected -20, is " + << last_msg_.apc[2].pcv[20]; + EXPECT_EQ(last_msg_.apc[2].sat_info, 181) + << "incorrect value for last_msg_.apc[2].sat_info, expected 181, is " + << last_msg_.apc[2].sat_info; + EXPECT_EQ(last_msg_.apc[2].sid.code, 188) + << "incorrect value for last_msg_.apc[2].sid.code, expected 188, is " + << last_msg_.apc[2].sid.code; + EXPECT_EQ(last_msg_.apc[2].sid.sat, 83) + << "incorrect value for last_msg_.apc[2].sid.sat, expected 83, is " + << last_msg_.apc[2].sid.sat; + EXPECT_EQ(last_msg_.apc[2].svn, 7106) + << "incorrect value for last_msg_.apc[2].svn, expected 7106, is " + << last_msg_.apc[2].svn; + EXPECT_EQ(last_msg_.apc[3].pco[0], -19478) + << "incorrect value for last_msg_.apc[3].pco[0], expected -19478, is " + << last_msg_.apc[3].pco[0]; + EXPECT_EQ(last_msg_.apc[3].pco[1], 11484) + << "incorrect value for last_msg_.apc[3].pco[1], expected 11484, is " + << last_msg_.apc[3].pco[1]; + EXPECT_EQ(last_msg_.apc[3].pco[2], 14804) + << "incorrect value for last_msg_.apc[3].pco[2], expected 14804, is " + << last_msg_.apc[3].pco[2]; + EXPECT_EQ(last_msg_.apc[3].pcv[0], 44) + << "incorrect value for last_msg_.apc[3].pcv[0], expected 44, is " + << last_msg_.apc[3].pcv[0]; + EXPECT_EQ(last_msg_.apc[3].pcv[1], -83) + << "incorrect value for last_msg_.apc[3].pcv[1], expected -83, is " + << last_msg_.apc[3].pcv[1]; + EXPECT_EQ(last_msg_.apc[3].pcv[2], 49) + << "incorrect value for last_msg_.apc[3].pcv[2], expected 49, is " + << last_msg_.apc[3].pcv[2]; + EXPECT_EQ(last_msg_.apc[3].pcv[3], 36) + << "incorrect value for last_msg_.apc[3].pcv[3], expected 36, is " + << last_msg_.apc[3].pcv[3]; + EXPECT_EQ(last_msg_.apc[3].pcv[4], -119) + << "incorrect value for last_msg_.apc[3].pcv[4], expected -119, is " + << last_msg_.apc[3].pcv[4]; + EXPECT_EQ(last_msg_.apc[3].pcv[5], -8) + << "incorrect value for last_msg_.apc[3].pcv[5], expected -8, is " + << last_msg_.apc[3].pcv[5]; + EXPECT_EQ(last_msg_.apc[3].pcv[6], -21) + << "incorrect value for last_msg_.apc[3].pcv[6], expected -21, is " + << last_msg_.apc[3].pcv[6]; + EXPECT_EQ(last_msg_.apc[3].pcv[7], 97) + << "incorrect value for last_msg_.apc[3].pcv[7], expected 97, is " + << last_msg_.apc[3].pcv[7]; + EXPECT_EQ(last_msg_.apc[3].pcv[8], 112) + << "incorrect value for last_msg_.apc[3].pcv[8], expected 112, is " + << last_msg_.apc[3].pcv[8]; + EXPECT_EQ(last_msg_.apc[3].pcv[9], -99) + << "incorrect value for last_msg_.apc[3].pcv[9], expected -99, is " + << last_msg_.apc[3].pcv[9]; + EXPECT_EQ(last_msg_.apc[3].pcv[10], -117) + << "incorrect value for last_msg_.apc[3].pcv[10], expected -117, is " + << last_msg_.apc[3].pcv[10]; + EXPECT_EQ(last_msg_.apc[3].pcv[11], 26) + << "incorrect value for last_msg_.apc[3].pcv[11], expected 26, is " + << last_msg_.apc[3].pcv[11]; + EXPECT_EQ(last_msg_.apc[3].pcv[12], 115) + << "incorrect value for last_msg_.apc[3].pcv[12], expected 115, is " + << last_msg_.apc[3].pcv[12]; + EXPECT_EQ(last_msg_.apc[3].pcv[13], -64) + << "incorrect value for last_msg_.apc[3].pcv[13], expected -64, is " + << last_msg_.apc[3].pcv[13]; + EXPECT_EQ(last_msg_.apc[3].pcv[14], 31) + << "incorrect value for last_msg_.apc[3].pcv[14], expected 31, is " + << last_msg_.apc[3].pcv[14]; + EXPECT_EQ(last_msg_.apc[3].pcv[15], 85) + << "incorrect value for last_msg_.apc[3].pcv[15], expected 85, is " + << last_msg_.apc[3].pcv[15]; + EXPECT_EQ(last_msg_.apc[3].pcv[16], 127) + << "incorrect value for last_msg_.apc[3].pcv[16], expected 127, is " + << last_msg_.apc[3].pcv[16]; + EXPECT_EQ(last_msg_.apc[3].pcv[17], -28) + << "incorrect value for last_msg_.apc[3].pcv[17], expected -28, is " + << last_msg_.apc[3].pcv[17]; + EXPECT_EQ(last_msg_.apc[3].pcv[18], 81) + << "incorrect value for last_msg_.apc[3].pcv[18], expected 81, is " + << last_msg_.apc[3].pcv[18]; + EXPECT_EQ(last_msg_.apc[3].pcv[19], -4) + << "incorrect value for last_msg_.apc[3].pcv[19], expected -4, is " + << last_msg_.apc[3].pcv[19]; + EXPECT_EQ(last_msg_.apc[3].pcv[20], -37) + << "incorrect value for last_msg_.apc[3].pcv[20], expected -37, is " + << last_msg_.apc[3].pcv[20]; + EXPECT_EQ(last_msg_.apc[3].sat_info, 128) + << "incorrect value for last_msg_.apc[3].sat_info, expected 128, is " + << last_msg_.apc[3].sat_info; + EXPECT_EQ(last_msg_.apc[3].sid.code, 196) + << "incorrect value for last_msg_.apc[3].sid.code, expected 196, is " + << last_msg_.apc[3].sid.code; + EXPECT_EQ(last_msg_.apc[3].sid.sat, 230) + << "incorrect value for last_msg_.apc[3].sid.sat, expected 230, is " + << last_msg_.apc[3].sid.sat; + EXPECT_EQ(last_msg_.apc[3].svn, 61399) + << "incorrect value for last_msg_.apc[3].svn, expected 61399, is " + << last_msg_.apc[3].svn; + EXPECT_EQ(last_msg_.apc[4].pco[0], -11049) + << "incorrect value for last_msg_.apc[4].pco[0], expected -11049, is " + << last_msg_.apc[4].pco[0]; + EXPECT_EQ(last_msg_.apc[4].pco[1], 6580) + << "incorrect value for last_msg_.apc[4].pco[1], expected 6580, is " + << last_msg_.apc[4].pco[1]; + EXPECT_EQ(last_msg_.apc[4].pco[2], -28589) + << "incorrect value for last_msg_.apc[4].pco[2], expected -28589, is " + << last_msg_.apc[4].pco[2]; + EXPECT_EQ(last_msg_.apc[4].pcv[0], -9) + << "incorrect value for last_msg_.apc[4].pcv[0], expected -9, is " + << last_msg_.apc[4].pcv[0]; + EXPECT_EQ(last_msg_.apc[4].pcv[1], 12) + << "incorrect value for last_msg_.apc[4].pcv[1], expected 12, is " + << last_msg_.apc[4].pcv[1]; + EXPECT_EQ(last_msg_.apc[4].pcv[2], 27) + << "incorrect value for last_msg_.apc[4].pcv[2], expected 27, is " + << last_msg_.apc[4].pcv[2]; + EXPECT_EQ(last_msg_.apc[4].pcv[3], -57) + << "incorrect value for last_msg_.apc[4].pcv[3], expected -57, is " + << last_msg_.apc[4].pcv[3]; + EXPECT_EQ(last_msg_.apc[4].pcv[4], -83) + << "incorrect value for last_msg_.apc[4].pcv[4], expected -83, is " + << last_msg_.apc[4].pcv[4]; + EXPECT_EQ(last_msg_.apc[4].pcv[5], 74) + << "incorrect value for last_msg_.apc[4].pcv[5], expected 74, is " + << last_msg_.apc[4].pcv[5]; + EXPECT_EQ(last_msg_.apc[4].pcv[6], 23) + << "incorrect value for last_msg_.apc[4].pcv[6], expected 23, is " + << last_msg_.apc[4].pcv[6]; + EXPECT_EQ(last_msg_.apc[4].pcv[7], 4) + << "incorrect value for last_msg_.apc[4].pcv[7], expected 4, is " + << last_msg_.apc[4].pcv[7]; + EXPECT_EQ(last_msg_.apc[4].pcv[8], -17) + << "incorrect value for last_msg_.apc[4].pcv[8], expected -17, is " + << last_msg_.apc[4].pcv[8]; + EXPECT_EQ(last_msg_.apc[4].pcv[9], 103) + << "incorrect value for last_msg_.apc[4].pcv[9], expected 103, is " + << last_msg_.apc[4].pcv[9]; + EXPECT_EQ(last_msg_.apc[4].pcv[10], -33) + << "incorrect value for last_msg_.apc[4].pcv[10], expected -33, is " + << last_msg_.apc[4].pcv[10]; + EXPECT_EQ(last_msg_.apc[4].pcv[11], -36) + << "incorrect value for last_msg_.apc[4].pcv[11], expected -36, is " + << last_msg_.apc[4].pcv[11]; + EXPECT_EQ(last_msg_.apc[4].pcv[12], -117) + << "incorrect value for last_msg_.apc[4].pcv[12], expected -117, is " + << last_msg_.apc[4].pcv[12]; + EXPECT_EQ(last_msg_.apc[4].pcv[13], 91) + << "incorrect value for last_msg_.apc[4].pcv[13], expected 91, is " + << last_msg_.apc[4].pcv[13]; + EXPECT_EQ(last_msg_.apc[4].pcv[14], 127) + << "incorrect value for last_msg_.apc[4].pcv[14], expected 127, is " + << last_msg_.apc[4].pcv[14]; + EXPECT_EQ(last_msg_.apc[4].pcv[15], -42) + << "incorrect value for last_msg_.apc[4].pcv[15], expected -42, is " + << last_msg_.apc[4].pcv[15]; + EXPECT_EQ(last_msg_.apc[4].pcv[16], 86) + << "incorrect value for last_msg_.apc[4].pcv[16], expected 86, is " + << last_msg_.apc[4].pcv[16]; + EXPECT_EQ(last_msg_.apc[4].pcv[17], 48) + << "incorrect value for last_msg_.apc[4].pcv[17], expected 48, is " + << last_msg_.apc[4].pcv[17]; + EXPECT_EQ(last_msg_.apc[4].pcv[18], -53) + << "incorrect value for last_msg_.apc[4].pcv[18], expected -53, is " + << last_msg_.apc[4].pcv[18]; + EXPECT_EQ(last_msg_.apc[4].pcv[19], -28) + << "incorrect value for last_msg_.apc[4].pcv[19], expected -28, is " + << last_msg_.apc[4].pcv[19]; + EXPECT_EQ(last_msg_.apc[4].pcv[20], 99) + << "incorrect value for last_msg_.apc[4].pcv[20], expected 99, is " + << last_msg_.apc[4].pcv[20]; + EXPECT_EQ(last_msg_.apc[4].sat_info, 147) + << "incorrect value for last_msg_.apc[4].sat_info, expected 147, is " + << last_msg_.apc[4].sat_info; + EXPECT_EQ(last_msg_.apc[4].sid.code, 110) + << "incorrect value for last_msg_.apc[4].sid.code, expected 110, is " + << last_msg_.apc[4].sid.code; + EXPECT_EQ(last_msg_.apc[4].sid.sat, 249) + << "incorrect value for last_msg_.apc[4].sid.sat, expected 249, is " + << last_msg_.apc[4].sid.sat; + EXPECT_EQ(last_msg_.apc[4].svn, 41224) + << "incorrect value for last_msg_.apc[4].svn, expected 41224, is " + << last_msg_.apc[4].svn; + EXPECT_EQ(last_msg_.apc[5].pco[0], -21881) + << "incorrect value for last_msg_.apc[5].pco[0], expected -21881, is " + << last_msg_.apc[5].pco[0]; + EXPECT_EQ(last_msg_.apc[5].pco[1], -9942) + << "incorrect value for last_msg_.apc[5].pco[1], expected -9942, is " + << last_msg_.apc[5].pco[1]; + EXPECT_EQ(last_msg_.apc[5].pco[2], -5689) + << "incorrect value for last_msg_.apc[5].pco[2], expected -5689, is " + << last_msg_.apc[5].pco[2]; + EXPECT_EQ(last_msg_.apc[5].pcv[0], 42) + << "incorrect value for last_msg_.apc[5].pcv[0], expected 42, is " + << last_msg_.apc[5].pcv[0]; + EXPECT_EQ(last_msg_.apc[5].pcv[1], -86) + << "incorrect value for last_msg_.apc[5].pcv[1], expected -86, is " + << last_msg_.apc[5].pcv[1]; + EXPECT_EQ(last_msg_.apc[5].pcv[2], 78) + << "incorrect value for last_msg_.apc[5].pcv[2], expected 78, is " + << last_msg_.apc[5].pcv[2]; + EXPECT_EQ(last_msg_.apc[5].pcv[3], -50) + << "incorrect value for last_msg_.apc[5].pcv[3], expected -50, is " + << last_msg_.apc[5].pcv[3]; + EXPECT_EQ(last_msg_.apc[5].pcv[4], 41) + << "incorrect value for last_msg_.apc[5].pcv[4], expected 41, is " + << last_msg_.apc[5].pcv[4]; + EXPECT_EQ(last_msg_.apc[5].pcv[5], 43) + << "incorrect value for last_msg_.apc[5].pcv[5], expected 43, is " + << last_msg_.apc[5].pcv[5]; + EXPECT_EQ(last_msg_.apc[5].pcv[6], 81) + << "incorrect value for last_msg_.apc[5].pcv[6], expected 81, is " + << last_msg_.apc[5].pcv[6]; + EXPECT_EQ(last_msg_.apc[5].pcv[7], -9) + << "incorrect value for last_msg_.apc[5].pcv[7], expected -9, is " + << last_msg_.apc[5].pcv[7]; + EXPECT_EQ(last_msg_.apc[5].pcv[8], 99) + << "incorrect value for last_msg_.apc[5].pcv[8], expected 99, is " + << last_msg_.apc[5].pcv[8]; + EXPECT_EQ(last_msg_.apc[5].pcv[9], -58) + << "incorrect value for last_msg_.apc[5].pcv[9], expected -58, is " + << last_msg_.apc[5].pcv[9]; + EXPECT_EQ(last_msg_.apc[5].pcv[10], -112) + << "incorrect value for last_msg_.apc[5].pcv[10], expected -112, is " + << last_msg_.apc[5].pcv[10]; + EXPECT_EQ(last_msg_.apc[5].pcv[11], 2) + << "incorrect value for last_msg_.apc[5].pcv[11], expected 2, is " + << last_msg_.apc[5].pcv[11]; + EXPECT_EQ(last_msg_.apc[5].pcv[12], -124) + << "incorrect value for last_msg_.apc[5].pcv[12], expected -124, is " + << last_msg_.apc[5].pcv[12]; + EXPECT_EQ(last_msg_.apc[5].pcv[13], 2) + << "incorrect value for last_msg_.apc[5].pcv[13], expected 2, is " + << last_msg_.apc[5].pcv[13]; + EXPECT_EQ(last_msg_.apc[5].pcv[14], -32) + << "incorrect value for last_msg_.apc[5].pcv[14], expected -32, is " + << last_msg_.apc[5].pcv[14]; + EXPECT_EQ(last_msg_.apc[5].pcv[15], -36) + << "incorrect value for last_msg_.apc[5].pcv[15], expected -36, is " + << last_msg_.apc[5].pcv[15]; + EXPECT_EQ(last_msg_.apc[5].pcv[16], -108) + << "incorrect value for last_msg_.apc[5].pcv[16], expected -108, is " + << last_msg_.apc[5].pcv[16]; + EXPECT_EQ(last_msg_.apc[5].pcv[17], 58) + << "incorrect value for last_msg_.apc[5].pcv[17], expected 58, is " + << last_msg_.apc[5].pcv[17]; + EXPECT_EQ(last_msg_.apc[5].pcv[18], 85) + << "incorrect value for last_msg_.apc[5].pcv[18], expected 85, is " + << last_msg_.apc[5].pcv[18]; + EXPECT_EQ(last_msg_.apc[5].pcv[19], -118) + << "incorrect value for last_msg_.apc[5].pcv[19], expected -118, is " + << last_msg_.apc[5].pcv[19]; + EXPECT_EQ(last_msg_.apc[5].pcv[20], -46) + << "incorrect value for last_msg_.apc[5].pcv[20], expected -46, is " + << last_msg_.apc[5].pcv[20]; + EXPECT_EQ(last_msg_.apc[5].sat_info, 159) + << "incorrect value for last_msg_.apc[5].sat_info, expected 159, is " + << last_msg_.apc[5].sat_info; + EXPECT_EQ(last_msg_.apc[5].sid.code, 83) + << "incorrect value for last_msg_.apc[5].sid.code, expected 83, is " + << last_msg_.apc[5].sid.code; + EXPECT_EQ(last_msg_.apc[5].sid.sat, 45) + << "incorrect value for last_msg_.apc[5].sid.sat, expected 45, is " + << last_msg_.apc[5].sid.sat; + EXPECT_EQ(last_msg_.apc[5].svn, 64011) + << "incorrect value for last_msg_.apc[5].svn, expected 64011, is " + << last_msg_.apc[5].svn; + EXPECT_EQ(last_msg_.apc[6].pco[0], -14290) + << "incorrect value for last_msg_.apc[6].pco[0], expected -14290, is " + << last_msg_.apc[6].pco[0]; + EXPECT_EQ(last_msg_.apc[6].pco[1], 30340) + << "incorrect value for last_msg_.apc[6].pco[1], expected 30340, is " + << last_msg_.apc[6].pco[1]; + EXPECT_EQ(last_msg_.apc[6].pco[2], 3569) + << "incorrect value for last_msg_.apc[6].pco[2], expected 3569, is " + << last_msg_.apc[6].pco[2]; + EXPECT_EQ(last_msg_.apc[6].pcv[0], 37) + << "incorrect value for last_msg_.apc[6].pcv[0], expected 37, is " + << last_msg_.apc[6].pcv[0]; + EXPECT_EQ(last_msg_.apc[6].pcv[1], 62) + << "incorrect value for last_msg_.apc[6].pcv[1], expected 62, is " + << last_msg_.apc[6].pcv[1]; + EXPECT_EQ(last_msg_.apc[6].pcv[2], 107) + << "incorrect value for last_msg_.apc[6].pcv[2], expected 107, is " + << last_msg_.apc[6].pcv[2]; + EXPECT_EQ(last_msg_.apc[6].pcv[3], -3) + << "incorrect value for last_msg_.apc[6].pcv[3], expected -3, is " + << last_msg_.apc[6].pcv[3]; + EXPECT_EQ(last_msg_.apc[6].pcv[4], -66) + << "incorrect value for last_msg_.apc[6].pcv[4], expected -66, is " + << last_msg_.apc[6].pcv[4]; + EXPECT_EQ(last_msg_.apc[6].pcv[5], -120) + << "incorrect value for last_msg_.apc[6].pcv[5], expected -120, is " + << last_msg_.apc[6].pcv[5]; + EXPECT_EQ(last_msg_.apc[6].pcv[6], 66) + << "incorrect value for last_msg_.apc[6].pcv[6], expected 66, is " + << last_msg_.apc[6].pcv[6]; + EXPECT_EQ(last_msg_.apc[6].pcv[7], 9) + << "incorrect value for last_msg_.apc[6].pcv[7], expected 9, is " + << last_msg_.apc[6].pcv[7]; + EXPECT_EQ(last_msg_.apc[6].pcv[8], 84) + << "incorrect value for last_msg_.apc[6].pcv[8], expected 84, is " + << last_msg_.apc[6].pcv[8]; + EXPECT_EQ(last_msg_.apc[6].pcv[9], -101) + << "incorrect value for last_msg_.apc[6].pcv[9], expected -101, is " + << last_msg_.apc[6].pcv[9]; + EXPECT_EQ(last_msg_.apc[6].pcv[10], 86) + << "incorrect value for last_msg_.apc[6].pcv[10], expected 86, is " + << last_msg_.apc[6].pcv[10]; + EXPECT_EQ(last_msg_.apc[6].pcv[11], -76) + << "incorrect value for last_msg_.apc[6].pcv[11], expected -76, is " + << last_msg_.apc[6].pcv[11]; + EXPECT_EQ(last_msg_.apc[6].pcv[12], 41) + << "incorrect value for last_msg_.apc[6].pcv[12], expected 41, is " + << last_msg_.apc[6].pcv[12]; + EXPECT_EQ(last_msg_.apc[6].pcv[13], -60) + << "incorrect value for last_msg_.apc[6].pcv[13], expected -60, is " + << last_msg_.apc[6].pcv[13]; + EXPECT_EQ(last_msg_.apc[6].pcv[14], 40) + << "incorrect value for last_msg_.apc[6].pcv[14], expected 40, is " + << last_msg_.apc[6].pcv[14]; + EXPECT_EQ(last_msg_.apc[6].pcv[15], 119) + << "incorrect value for last_msg_.apc[6].pcv[15], expected 119, is " + << last_msg_.apc[6].pcv[15]; + EXPECT_EQ(last_msg_.apc[6].pcv[16], 101) + << "incorrect value for last_msg_.apc[6].pcv[16], expected 101, is " + << last_msg_.apc[6].pcv[16]; + EXPECT_EQ(last_msg_.apc[6].pcv[17], -4) + << "incorrect value for last_msg_.apc[6].pcv[17], expected -4, is " + << last_msg_.apc[6].pcv[17]; + EXPECT_EQ(last_msg_.apc[6].pcv[18], -33) + << "incorrect value for last_msg_.apc[6].pcv[18], expected -33, is " + << last_msg_.apc[6].pcv[18]; + EXPECT_EQ(last_msg_.apc[6].pcv[19], -112) + << "incorrect value for last_msg_.apc[6].pcv[19], expected -112, is " + << last_msg_.apc[6].pcv[19]; + EXPECT_EQ(last_msg_.apc[6].pcv[20], -103) + << "incorrect value for last_msg_.apc[6].pcv[20], expected -103, is " + << last_msg_.apc[6].pcv[20]; + EXPECT_EQ(last_msg_.apc[6].sat_info, 7) + << "incorrect value for last_msg_.apc[6].sat_info, expected 7, is " + << last_msg_.apc[6].sat_info; + EXPECT_EQ(last_msg_.apc[6].sid.code, 158) + << "incorrect value for last_msg_.apc[6].sid.code, expected 158, is " + << last_msg_.apc[6].sid.code; + EXPECT_EQ(last_msg_.apc[6].sid.sat, 200) + << "incorrect value for last_msg_.apc[6].sid.sat, expected 200, is " + << last_msg_.apc[6].sid.sat; + EXPECT_EQ(last_msg_.apc[6].svn, 17310) + << "incorrect value for last_msg_.apc[6].svn, expected 17310, is " + << last_msg_.apc[6].svn; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_apc.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_apc.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_apc.handle_as << "'"; + } + { + const char check_string[] = {(char)97, (char)112, (char)99}; + EXPECT_EQ( + memcmp(last_msg_.n_apc.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_apc.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_apc.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_apc.value, 7) + << "incorrect value for last_msg_.n_apc.value, expected 7, is " + << last_msg_.n_apc.value; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrStecCorrection.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrStecCorrection.cc index fba88bfe8..426d9a11f 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrStecCorrection.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrStecCorrection.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrection.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrection.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrStecCorrection0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrStecCorrection0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrStecCorrection0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrStecCorrection0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_stec_correction_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_stec_correction_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,104 +67,185 @@ class Test_auto_check_sbp_ssr_MsgSsrStecCorrection0 : sbp_msg_ssr_stec_correction_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrStecCorrection0, Test) -{ - - uint8_t encoded_frame[] = {85,253,5,66,0,38,180,0,0,0,3,0,1,1,10,0,15,1,0,10,0,2,1,1,1,63,0,62,0,61,0,60,0,31,15,5,63,0,64,0,65,0,66,0,119,50, }; - - sbp_msg_ssr_stec_correction_t test_msg{}; - test_msg.header.num_msgs = 1; - test_msg.header.seq_num = 1; - test_msg.header.sol_id = 0; - test_msg.header.time.tow = 180; - test_msg.header.time.wn = 3; - test_msg.header.update_interval = 10; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_sats.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)101,(char)99,(char)95,(char)115,(char)97,(char)116,(char)95,(char)108,(char)105,(char)115,(char)116 }; - memcpy(test_msg.n_sats.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_sats.value = 2; - test_msg.ssr_iod_atmo = 15; - - - test_msg.stec_sat_list[0].stec_coeff[0] = 63; - - test_msg.stec_sat_list[0].stec_coeff[1] = 62; - - test_msg.stec_sat_list[0].stec_coeff[2] = 61; - - test_msg.stec_sat_list[0].stec_coeff[3] = 60; - test_msg.stec_sat_list[0].stec_quality_indicator = 1; - test_msg.stec_sat_list[0].sv_id.constellation = 1; - test_msg.stec_sat_list[0].sv_id.satId = 1; - - - test_msg.stec_sat_list[1].stec_coeff[0] = 63; - - test_msg.stec_sat_list[1].stec_coeff[1] = 64; - - test_msg.stec_sat_list[1].stec_coeff[2] = 65; - - test_msg.stec_sat_list[1].stec_coeff[3] = 66; - test_msg.stec_sat_list[1].stec_quality_indicator = 5; - test_msg.stec_sat_list[1].sv_id.constellation = 15; - test_msg.stec_sat_list[1].sv_id.satId = 31; - test_msg.tile_id = 10; - test_msg.tile_set_id = 1; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.num_msgs, 1) << "incorrect value for last_msg_.header.num_msgs, expected 1, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.seq_num, 1) << "incorrect value for last_msg_.header.seq_num, expected 1, is " << last_msg_.header.seq_num; - EXPECT_EQ(last_msg_.header.sol_id, 0) << "incorrect value for last_msg_.header.sol_id, expected 0, is " << last_msg_.header.sol_id; - EXPECT_EQ(last_msg_.header.time.tow, 180) << "incorrect value for last_msg_.header.time.tow, expected 180, is " << last_msg_.header.time.tow; - EXPECT_EQ(last_msg_.header.time.wn, 3) << "incorrect value for last_msg_.header.time.wn, expected 3, is " << last_msg_.header.time.wn; - EXPECT_EQ(last_msg_.header.update_interval, 10) << "incorrect value for last_msg_.header.update_interval, expected 10, is " << last_msg_.header.update_interval; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_sats.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_sats.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_sats.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)101,(char)99,(char)95,(char)115,(char)97,(char)116,(char)95,(char)108,(char)105,(char)115,(char)116 }; - EXPECT_EQ(memcmp(last_msg_.n_sats.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_sats.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_sats.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_sats.value, 2) << "incorrect value for last_msg_.n_sats.value, expected 2, is " << last_msg_.n_sats.value; - EXPECT_EQ(last_msg_.ssr_iod_atmo, 15) << "incorrect value for last_msg_.ssr_iod_atmo, expected 15, is " << last_msg_.ssr_iod_atmo; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[0], 63) << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[0], expected 63, is " << last_msg_.stec_sat_list[0].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[1], 62) << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[1], expected 62, is " << last_msg_.stec_sat_list[0].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[2], 61) << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[2], expected 61, is " << last_msg_.stec_sat_list[0].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[3], 60) << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[3], expected 60, is " << last_msg_.stec_sat_list[0].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_quality_indicator, 1) << "incorrect value for last_msg_.stec_sat_list[0].stec_quality_indicator, expected 1, is " << last_msg_.stec_sat_list[0].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[0].sv_id.constellation, 1) << "incorrect value for last_msg_.stec_sat_list[0].sv_id.constellation, expected 1, is " << last_msg_.stec_sat_list[0].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[0].sv_id.satId, 1) << "incorrect value for last_msg_.stec_sat_list[0].sv_id.satId, expected 1, is " << last_msg_.stec_sat_list[0].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[0], 63) << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[0], expected 63, is " << last_msg_.stec_sat_list[1].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[1], 64) << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[1], expected 64, is " << last_msg_.stec_sat_list[1].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[2], 65) << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[2], expected 65, is " << last_msg_.stec_sat_list[1].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[3], 66) << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[3], expected 66, is " << last_msg_.stec_sat_list[1].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_quality_indicator, 5) << "incorrect value for last_msg_.stec_sat_list[1].stec_quality_indicator, expected 5, is " << last_msg_.stec_sat_list[1].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[1].sv_id.constellation, 15) << "incorrect value for last_msg_.stec_sat_list[1].sv_id.constellation, expected 15, is " << last_msg_.stec_sat_list[1].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[1].sv_id.satId, 31) << "incorrect value for last_msg_.stec_sat_list[1].sv_id.satId, expected 31, is " << last_msg_.stec_sat_list[1].sv_id.satId; - EXPECT_EQ(last_msg_.tile_id, 10) << "incorrect value for last_msg_.tile_id, expected 10, is " << last_msg_.tile_id; - EXPECT_EQ(last_msg_.tile_set_id, 1) << "incorrect value for last_msg_.tile_set_id, expected 1, is " << last_msg_.tile_set_id; +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrStecCorrection0, Test) { + uint8_t encoded_frame[] = { + 85, 253, 5, 66, 0, 38, 180, 0, 0, 0, 3, 0, 1, 1, 10, 0, + 15, 1, 0, 10, 0, 2, 1, 1, 1, 63, 0, 62, 0, 61, 0, 60, + 0, 31, 15, 5, 63, 0, 64, 0, 65, 0, 66, 0, 119, 50, + }; + + sbp_msg_ssr_stec_correction_t test_msg{}; + test_msg.header.num_msgs = 1; + test_msg.header.seq_num = 1; + test_msg.header.sol_id = 0; + test_msg.header.time.tow = 180; + test_msg.header.time.wn = 3; + test_msg.header.update_interval = 10; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_sats.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)101, (char)99, + (char)95, (char)115, (char)97, (char)116, + (char)95, (char)108, (char)105, (char)115, + (char)116}; + memcpy(test_msg.n_sats.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_sats.value = 2; + test_msg.ssr_iod_atmo = 15; + + test_msg.stec_sat_list[0].stec_coeff[0] = 63; + + test_msg.stec_sat_list[0].stec_coeff[1] = 62; + + test_msg.stec_sat_list[0].stec_coeff[2] = 61; + + test_msg.stec_sat_list[0].stec_coeff[3] = 60; + test_msg.stec_sat_list[0].stec_quality_indicator = 1; + test_msg.stec_sat_list[0].sv_id.constellation = 1; + test_msg.stec_sat_list[0].sv_id.satId = 1; + + test_msg.stec_sat_list[1].stec_coeff[0] = 63; + + test_msg.stec_sat_list[1].stec_coeff[1] = 64; + + test_msg.stec_sat_list[1].stec_coeff[2] = 65; + + test_msg.stec_sat_list[1].stec_coeff[3] = 66; + test_msg.stec_sat_list[1].stec_quality_indicator = 5; + test_msg.stec_sat_list[1].sv_id.constellation = 15; + test_msg.stec_sat_list[1].sv_id.satId = 31; + test_msg.tile_id = 10; + test_msg.tile_set_id = 1; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.num_msgs, 1) + << "incorrect value for last_msg_.header.num_msgs, expected 1, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.seq_num, 1) + << "incorrect value for last_msg_.header.seq_num, expected 1, is " + << last_msg_.header.seq_num; + EXPECT_EQ(last_msg_.header.sol_id, 0) + << "incorrect value for last_msg_.header.sol_id, expected 0, is " + << last_msg_.header.sol_id; + EXPECT_EQ(last_msg_.header.time.tow, 180) + << "incorrect value for last_msg_.header.time.tow, expected 180, is " + << last_msg_.header.time.tow; + EXPECT_EQ(last_msg_.header.time.wn, 3) + << "incorrect value for last_msg_.header.time.wn, expected 3, is " + << last_msg_.header.time.wn; + EXPECT_EQ(last_msg_.header.update_interval, 10) + << "incorrect value for last_msg_.header.update_interval, expected 10, " + "is " + << last_msg_.header.update_interval; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ( + memcmp(last_msg_.n_sats.handle_as, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_sats.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_sats.handle_as << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)101, (char)99, + (char)95, (char)115, (char)97, (char)116, + (char)95, (char)108, (char)105, (char)115, + (char)116}; + EXPECT_EQ( + memcmp(last_msg_.n_sats.relates_to, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_sats.relates_to, expected string '" + << check_string << "', is '" << last_msg_.n_sats.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_sats.value, 2) + << "incorrect value for last_msg_.n_sats.value, expected 2, is " + << last_msg_.n_sats.value; + EXPECT_EQ(last_msg_.ssr_iod_atmo, 15) + << "incorrect value for last_msg_.ssr_iod_atmo, expected 15, is " + << last_msg_.ssr_iod_atmo; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[0], 63) + << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[0], " + "expected 63, is " + << last_msg_.stec_sat_list[0].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[1], 62) + << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[1], " + "expected 62, is " + << last_msg_.stec_sat_list[0].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[2], 61) + << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[2], " + "expected 61, is " + << last_msg_.stec_sat_list[0].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[3], 60) + << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[3], " + "expected 60, is " + << last_msg_.stec_sat_list[0].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_quality_indicator, 1) + << "incorrect value for " + "last_msg_.stec_sat_list[0].stec_quality_indicator, expected 1, is " + << last_msg_.stec_sat_list[0].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[0].sv_id.constellation, 1) + << "incorrect value for last_msg_.stec_sat_list[0].sv_id.constellation, " + "expected 1, is " + << last_msg_.stec_sat_list[0].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[0].sv_id.satId, 1) + << "incorrect value for last_msg_.stec_sat_list[0].sv_id.satId, expected " + "1, is " + << last_msg_.stec_sat_list[0].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[0], 63) + << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[0], " + "expected 63, is " + << last_msg_.stec_sat_list[1].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[1], 64) + << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[1], " + "expected 64, is " + << last_msg_.stec_sat_list[1].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[2], 65) + << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[2], " + "expected 65, is " + << last_msg_.stec_sat_list[1].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[3], 66) + << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[3], " + "expected 66, is " + << last_msg_.stec_sat_list[1].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_quality_indicator, 5) + << "incorrect value for " + "last_msg_.stec_sat_list[1].stec_quality_indicator, expected 5, is " + << last_msg_.stec_sat_list[1].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[1].sv_id.constellation, 15) + << "incorrect value for last_msg_.stec_sat_list[1].sv_id.constellation, " + "expected 15, is " + << last_msg_.stec_sat_list[1].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[1].sv_id.satId, 31) + << "incorrect value for last_msg_.stec_sat_list[1].sv_id.satId, expected " + "31, is " + << last_msg_.stec_sat_list[1].sv_id.satId; + EXPECT_EQ(last_msg_.tile_id, 10) + << "incorrect value for last_msg_.tile_id, expected 10, is " + << last_msg_.tile_id; + EXPECT_EQ(last_msg_.tile_set_id, 1) + << "incorrect value for last_msg_.tile_set_id, expected 1, is " + << last_msg_.tile_set_id; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.cc index 9921e702f..3963a6952 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDep.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrStecCorrectionDep0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrStecCorrectionDep0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrStecCorrectionDep0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrStecCorrectionDep0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_stec_correction_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_stec_correction_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,463 +67,943 @@ class Test_auto_check_sbp_ssr_MsgSsrStecCorrectionDep0 : sbp_msg_ssr_stec_correction_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrStecCorrectionDep0, Test) -{ - - uint8_t encoded_frame[] = {85,251,5,204,151,245,158,228,114,117,50,158,156,42,119,156,157,112,47,60,132,40,70,87,235,83,177,198,3,14,8,70,12,44,53,181,90,174,247,150,58,172,247,179,119,176,125,4,177,229,113,14,77,153,185,23,53,222,187,146,250,91,212,215,14,107,250,94,107,33,91,234,0,213,139,95,179,50,21,74,174,169,61,86,91,142,51,108,9,38,225,146,101,73,139,56,117,82,37,213,108,205,93,18,19,195,33,202,87,206,178,125,188,119,56,69,150,150,76,3,131,18,73,208,72,232,8,250,203,178,170,163,252,86,49,247,178,166,56,31,10,119,213,241,212,164,1,162,42,18,124,169,121,158,26,56,23,142,125,40,120,67,45,126,235,110,23,12,241,88,69,239,252,57,93,44,201,216,173,242,178,17,5,223,169,192,3,77,107,2,144,233,14,88,32,209,1,17,123,155,41,183,244,158,82,53,103,14,202,185,35,181,21,118,254,250,50,184,50,31,45,56,163,177,126,217,79,171,239,237,188,238,112,201,118,141,18,163,103,35,63,21,82,129,18,117,85,190,79,210,215,227,177, }; - - sbp_msg_ssr_stec_correction_dep_t test_msg{}; - test_msg.header.iod_atmo = 60; - test_msg.header.num_msgs = 157; - test_msg.header.seq_num = 112; - test_msg.header.tile_id = 30066; - test_msg.header.tile_set_id = 58526; - test_msg.header.time.tow = 714907186; - test_msg.header.time.wn = 40055; - test_msg.header.update_interval = 47; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_stec_sat_list.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)101,(char)99,(char)95,(char)115,(char)97,(char)116,(char)95,(char)108,(char)105,(char)115,(char)116 }; - memcpy(test_msg.n_stec_sat_list.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_stec_sat_list.value = 21; - - - test_msg.stec_sat_list[0].stec_coeff[0] = -5289; - - test_msg.stec_sat_list[0].stec_coeff[1] = -20141; - - test_msg.stec_sat_list[0].stec_coeff[2] = 966; - - test_msg.stec_sat_list[0].stec_coeff[3] = 2062; - test_msg.stec_sat_list[0].stec_quality_indicator = 70; - test_msg.stec_sat_list[0].sv_id.constellation = 40; - test_msg.stec_sat_list[0].sv_id.satId = 132; - - - test_msg.stec_sat_list[1].stec_coeff[0] = -19147; - - test_msg.stec_sat_list[1].stec_coeff[1] = -20902; - - test_msg.stec_sat_list[1].stec_coeff[2] = -26889; - - test_msg.stec_sat_list[1].stec_coeff[3] = -21446; - test_msg.stec_sat_list[1].stec_quality_indicator = 44; - test_msg.stec_sat_list[1].sv_id.constellation = 12; - test_msg.stec_sat_list[1].sv_id.satId = 70; - - - test_msg.stec_sat_list[2].stec_coeff[0] = 32176; - - test_msg.stec_sat_list[2].stec_coeff[1] = -20220; - - test_msg.stec_sat_list[2].stec_coeff[2] = 29157; - - test_msg.stec_sat_list[2].stec_coeff[3] = 19726; - test_msg.stec_sat_list[2].stec_quality_indicator = 119; - test_msg.stec_sat_list[2].sv_id.constellation = 179; - test_msg.stec_sat_list[2].sv_id.satId = 247; - - - test_msg.stec_sat_list[3].stec_coeff[0] = -8651; - - test_msg.stec_sat_list[3].stec_coeff[1] = -27973; - - test_msg.stec_sat_list[3].stec_coeff[2] = 23546; - - test_msg.stec_sat_list[3].stec_coeff[3] = -10284; - test_msg.stec_sat_list[3].stec_quality_indicator = 23; - test_msg.stec_sat_list[3].sv_id.constellation = 185; - test_msg.stec_sat_list[3].sv_id.satId = 153; - - - test_msg.stec_sat_list[4].stec_coeff[0] = 27486; - - test_msg.stec_sat_list[4].stec_coeff[1] = 23329; - - test_msg.stec_sat_list[4].stec_coeff[2] = 234; - - test_msg.stec_sat_list[4].stec_coeff[3] = -29739; - test_msg.stec_sat_list[4].stec_quality_indicator = 250; - test_msg.stec_sat_list[4].sv_id.constellation = 107; - test_msg.stec_sat_list[4].sv_id.satId = 14; - - - test_msg.stec_sat_list[5].stec_coeff[0] = 18965; - - test_msg.stec_sat_list[5].stec_coeff[1] = -22098; - - test_msg.stec_sat_list[5].stec_coeff[2] = 22077; - - test_msg.stec_sat_list[5].stec_coeff[3] = -29093; - test_msg.stec_sat_list[5].stec_quality_indicator = 50; - test_msg.stec_sat_list[5].sv_id.constellation = 179; - test_msg.stec_sat_list[5].sv_id.satId = 95; - - - test_msg.stec_sat_list[6].stec_coeff[0] = -7898; - - test_msg.stec_sat_list[6].stec_coeff[1] = 26002; - - test_msg.stec_sat_list[6].stec_coeff[2] = -29879; - - test_msg.stec_sat_list[6].stec_coeff[3] = 30008; - test_msg.stec_sat_list[6].stec_quality_indicator = 9; - test_msg.stec_sat_list[6].sv_id.constellation = 108; - test_msg.stec_sat_list[6].sv_id.satId = 51; - - - test_msg.stec_sat_list[7].stec_coeff[0] = -12948; - - test_msg.stec_sat_list[7].stec_coeff[1] = 4701; - - test_msg.stec_sat_list[7].stec_coeff[2] = -15597; - - test_msg.stec_sat_list[7].stec_coeff[3] = -13791; - test_msg.stec_sat_list[7].stec_quality_indicator = 213; - test_msg.stec_sat_list[7].sv_id.constellation = 37; - test_msg.stec_sat_list[7].sv_id.satId = 82; - - - test_msg.stec_sat_list[8].stec_coeff[0] = -17283; - - test_msg.stec_sat_list[8].stec_coeff[1] = 14455; - - test_msg.stec_sat_list[8].stec_coeff[2] = -27067; - - test_msg.stec_sat_list[8].stec_coeff[3] = 19606; - test_msg.stec_sat_list[8].stec_quality_indicator = 178; - test_msg.stec_sat_list[8].sv_id.constellation = 206; - test_msg.stec_sat_list[8].sv_id.satId = 87; - - - test_msg.stec_sat_list[9].stec_coeff[0] = -12215; - - test_msg.stec_sat_list[9].stec_coeff[1] = -6072; - - test_msg.stec_sat_list[9].stec_coeff[2] = -1528; - - test_msg.stec_sat_list[9].stec_coeff[3] = -19765; - test_msg.stec_sat_list[9].stec_quality_indicator = 18; - test_msg.stec_sat_list[9].sv_id.constellation = 131; - test_msg.stec_sat_list[9].sv_id.satId = 3; - - - test_msg.stec_sat_list[10].stec_coeff[0] = 12630; - - test_msg.stec_sat_list[10].stec_coeff[1] = -19721; - - test_msg.stec_sat_list[10].stec_coeff[2] = 14502; - - test_msg.stec_sat_list[10].stec_coeff[3] = 2591; - test_msg.stec_sat_list[10].stec_quality_indicator = 252; - test_msg.stec_sat_list[10].sv_id.constellation = 163; - test_msg.stec_sat_list[10].sv_id.satId = 170; - - - test_msg.stec_sat_list[11].stec_coeff[0] = -23340; - - test_msg.stec_sat_list[11].stec_coeff[1] = -24063; - - test_msg.stec_sat_list[11].stec_coeff[2] = 4650; - - test_msg.stec_sat_list[11].stec_coeff[3] = -22148; - test_msg.stec_sat_list[11].stec_quality_indicator = 241; - test_msg.stec_sat_list[11].sv_id.constellation = 213; - test_msg.stec_sat_list[11].sv_id.satId = 119; - - - test_msg.stec_sat_list[12].stec_coeff[0] = 5944; - - test_msg.stec_sat_list[12].stec_coeff[1] = 32142; - - test_msg.stec_sat_list[12].stec_coeff[2] = 30760; - - test_msg.stec_sat_list[12].stec_coeff[3] = 11587; - test_msg.stec_sat_list[12].stec_quality_indicator = 26; - test_msg.stec_sat_list[12].sv_id.constellation = 158; - test_msg.stec_sat_list[12].sv_id.satId = 121; - - - test_msg.stec_sat_list[13].stec_coeff[0] = 3095; - - test_msg.stec_sat_list[13].stec_coeff[1] = 22769; - - test_msg.stec_sat_list[13].stec_coeff[2] = -4283; - - test_msg.stec_sat_list[13].stec_coeff[3] = 14844; - test_msg.stec_sat_list[13].stec_quality_indicator = 110; - test_msg.stec_sat_list[13].sv_id.constellation = 235; - test_msg.stec_sat_list[13].sv_id.satId = 126; - - - test_msg.stec_sat_list[14].stec_coeff[0] = -21032; - - test_msg.stec_sat_list[14].stec_coeff[1] = -19726; - - test_msg.stec_sat_list[14].stec_coeff[2] = 1297; - - test_msg.stec_sat_list[14].stec_coeff[3] = -22049; - test_msg.stec_sat_list[14].stec_quality_indicator = 201; - test_msg.stec_sat_list[14].sv_id.constellation = 44; - test_msg.stec_sat_list[14].sv_id.satId = 93; - - - test_msg.stec_sat_list[15].stec_coeff[0] = 619; - - test_msg.stec_sat_list[15].stec_coeff[1] = -5744; - - test_msg.stec_sat_list[15].stec_coeff[2] = 22542; - - test_msg.stec_sat_list[15].stec_coeff[3] = -12000; - test_msg.stec_sat_list[15].stec_quality_indicator = 77; - test_msg.stec_sat_list[15].sv_id.constellation = 3; - test_msg.stec_sat_list[15].sv_id.satId = 192; - - - test_msg.stec_sat_list[16].stec_coeff[0] = 10651; - - test_msg.stec_sat_list[16].stec_coeff[1] = -2889; - - test_msg.stec_sat_list[16].stec_coeff[2] = 21150; - - test_msg.stec_sat_list[16].stec_coeff[3] = 26421; - test_msg.stec_sat_list[16].stec_quality_indicator = 123; - test_msg.stec_sat_list[16].sv_id.constellation = 17; - test_msg.stec_sat_list[16].sv_id.satId = 1; - - - test_msg.stec_sat_list[17].stec_coeff[0] = -19165; - - test_msg.stec_sat_list[17].stec_coeff[1] = 30229; - - test_msg.stec_sat_list[17].stec_coeff[2] = -1282; - - test_msg.stec_sat_list[17].stec_coeff[3] = -18382; - test_msg.stec_sat_list[17].stec_quality_indicator = 185; - test_msg.stec_sat_list[17].sv_id.constellation = 202; - test_msg.stec_sat_list[17].sv_id.satId = 14; - - - test_msg.stec_sat_list[18].stec_coeff[0] = -23752; - - test_msg.stec_sat_list[18].stec_coeff[1] = 32433; - - test_msg.stec_sat_list[18].stec_coeff[2] = 20441; - - test_msg.stec_sat_list[18].stec_coeff[3] = -4181; - test_msg.stec_sat_list[18].stec_quality_indicator = 45; - test_msg.stec_sat_list[18].sv_id.constellation = 31; - test_msg.stec_sat_list[18].sv_id.satId = 50; - - - test_msg.stec_sat_list[19].stec_coeff[0] = -13968; - - test_msg.stec_sat_list[19].stec_coeff[1] = -29322; - - test_msg.stec_sat_list[19].stec_coeff[2] = -23790; - - test_msg.stec_sat_list[19].stec_coeff[3] = 9063; - test_msg.stec_sat_list[19].stec_quality_indicator = 238; - test_msg.stec_sat_list[19].sv_id.constellation = 188; - test_msg.stec_sat_list[19].sv_id.satId = 237; - - - test_msg.stec_sat_list[20].stec_coeff[0] = 4737; - - test_msg.stec_sat_list[20].stec_coeff[1] = 21877; - - test_msg.stec_sat_list[20].stec_coeff[2] = 20414; - - test_msg.stec_sat_list[20].stec_coeff[3] = -10286; - test_msg.stec_sat_list[20].stec_quality_indicator = 82; - test_msg.stec_sat_list[20].sv_id.constellation = 21; - test_msg.stec_sat_list[20].sv_id.satId = 63; - - EXPECT_EQ(send_message( 38860, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 38860); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.iod_atmo, 60) << "incorrect value for last_msg_.header.iod_atmo, expected 60, is " << last_msg_.header.iod_atmo; - EXPECT_EQ(last_msg_.header.num_msgs, 157) << "incorrect value for last_msg_.header.num_msgs, expected 157, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.seq_num, 112) << "incorrect value for last_msg_.header.seq_num, expected 112, is " << last_msg_.header.seq_num; - EXPECT_EQ(last_msg_.header.tile_id, 30066) << "incorrect value for last_msg_.header.tile_id, expected 30066, is " << last_msg_.header.tile_id; - EXPECT_EQ(last_msg_.header.tile_set_id, 58526) << "incorrect value for last_msg_.header.tile_set_id, expected 58526, is " << last_msg_.header.tile_set_id; - EXPECT_EQ(last_msg_.header.time.tow, 714907186) << "incorrect value for last_msg_.header.time.tow, expected 714907186, is " << last_msg_.header.time.tow; - EXPECT_EQ(last_msg_.header.time.wn, 40055) << "incorrect value for last_msg_.header.time.wn, expected 40055, is " << last_msg_.header.time.wn; - EXPECT_EQ(last_msg_.header.update_interval, 47) << "incorrect value for last_msg_.header.update_interval, expected 47, is " << last_msg_.header.update_interval; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_stec_sat_list.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_stec_sat_list.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_stec_sat_list.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)101,(char)99,(char)95,(char)115,(char)97,(char)116,(char)95,(char)108,(char)105,(char)115,(char)116 }; - EXPECT_EQ(memcmp(last_msg_.n_stec_sat_list.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_stec_sat_list.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_stec_sat_list.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_stec_sat_list.value, 21) << "incorrect value for last_msg_.n_stec_sat_list.value, expected 21, is " << last_msg_.n_stec_sat_list.value; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[0], -5289) << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[0], expected -5289, is " << last_msg_.stec_sat_list[0].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[1], -20141) << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[1], expected -20141, is " << last_msg_.stec_sat_list[0].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[2], 966) << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[2], expected 966, is " << last_msg_.stec_sat_list[0].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[3], 2062) << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[3], expected 2062, is " << last_msg_.stec_sat_list[0].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_quality_indicator, 70) << "incorrect value for last_msg_.stec_sat_list[0].stec_quality_indicator, expected 70, is " << last_msg_.stec_sat_list[0].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[0].sv_id.constellation, 40) << "incorrect value for last_msg_.stec_sat_list[0].sv_id.constellation, expected 40, is " << last_msg_.stec_sat_list[0].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[0].sv_id.satId, 132) << "incorrect value for last_msg_.stec_sat_list[0].sv_id.satId, expected 132, is " << last_msg_.stec_sat_list[0].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[0], -19147) << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[0], expected -19147, is " << last_msg_.stec_sat_list[1].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[1], -20902) << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[1], expected -20902, is " << last_msg_.stec_sat_list[1].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[2], -26889) << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[2], expected -26889, is " << last_msg_.stec_sat_list[1].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[3], -21446) << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[3], expected -21446, is " << last_msg_.stec_sat_list[1].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_quality_indicator, 44) << "incorrect value for last_msg_.stec_sat_list[1].stec_quality_indicator, expected 44, is " << last_msg_.stec_sat_list[1].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[1].sv_id.constellation, 12) << "incorrect value for last_msg_.stec_sat_list[1].sv_id.constellation, expected 12, is " << last_msg_.stec_sat_list[1].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[1].sv_id.satId, 70) << "incorrect value for last_msg_.stec_sat_list[1].sv_id.satId, expected 70, is " << last_msg_.stec_sat_list[1].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[0], 32176) << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[0], expected 32176, is " << last_msg_.stec_sat_list[2].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[1], -20220) << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[1], expected -20220, is " << last_msg_.stec_sat_list[2].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[2], 29157) << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[2], expected 29157, is " << last_msg_.stec_sat_list[2].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[3], 19726) << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[3], expected 19726, is " << last_msg_.stec_sat_list[2].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[2].stec_quality_indicator, 119) << "incorrect value for last_msg_.stec_sat_list[2].stec_quality_indicator, expected 119, is " << last_msg_.stec_sat_list[2].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[2].sv_id.constellation, 179) << "incorrect value for last_msg_.stec_sat_list[2].sv_id.constellation, expected 179, is " << last_msg_.stec_sat_list[2].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[2].sv_id.satId, 247) << "incorrect value for last_msg_.stec_sat_list[2].sv_id.satId, expected 247, is " << last_msg_.stec_sat_list[2].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[0], -8651) << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[0], expected -8651, is " << last_msg_.stec_sat_list[3].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[1], -27973) << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[1], expected -27973, is " << last_msg_.stec_sat_list[3].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[2], 23546) << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[2], expected 23546, is " << last_msg_.stec_sat_list[3].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[3], -10284) << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[3], expected -10284, is " << last_msg_.stec_sat_list[3].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[3].stec_quality_indicator, 23) << "incorrect value for last_msg_.stec_sat_list[3].stec_quality_indicator, expected 23, is " << last_msg_.stec_sat_list[3].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[3].sv_id.constellation, 185) << "incorrect value for last_msg_.stec_sat_list[3].sv_id.constellation, expected 185, is " << last_msg_.stec_sat_list[3].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[3].sv_id.satId, 153) << "incorrect value for last_msg_.stec_sat_list[3].sv_id.satId, expected 153, is " << last_msg_.stec_sat_list[3].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[0], 27486) << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[0], expected 27486, is " << last_msg_.stec_sat_list[4].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[1], 23329) << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[1], expected 23329, is " << last_msg_.stec_sat_list[4].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[2], 234) << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[2], expected 234, is " << last_msg_.stec_sat_list[4].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[3], -29739) << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[3], expected -29739, is " << last_msg_.stec_sat_list[4].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[4].stec_quality_indicator, 250) << "incorrect value for last_msg_.stec_sat_list[4].stec_quality_indicator, expected 250, is " << last_msg_.stec_sat_list[4].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[4].sv_id.constellation, 107) << "incorrect value for last_msg_.stec_sat_list[4].sv_id.constellation, expected 107, is " << last_msg_.stec_sat_list[4].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[4].sv_id.satId, 14) << "incorrect value for last_msg_.stec_sat_list[4].sv_id.satId, expected 14, is " << last_msg_.stec_sat_list[4].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[0], 18965) << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[0], expected 18965, is " << last_msg_.stec_sat_list[5].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[1], -22098) << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[1], expected -22098, is " << last_msg_.stec_sat_list[5].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[2], 22077) << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[2], expected 22077, is " << last_msg_.stec_sat_list[5].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[3], -29093) << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[3], expected -29093, is " << last_msg_.stec_sat_list[5].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[5].stec_quality_indicator, 50) << "incorrect value for last_msg_.stec_sat_list[5].stec_quality_indicator, expected 50, is " << last_msg_.stec_sat_list[5].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[5].sv_id.constellation, 179) << "incorrect value for last_msg_.stec_sat_list[5].sv_id.constellation, expected 179, is " << last_msg_.stec_sat_list[5].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[5].sv_id.satId, 95) << "incorrect value for last_msg_.stec_sat_list[5].sv_id.satId, expected 95, is " << last_msg_.stec_sat_list[5].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[0], -7898) << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[0], expected -7898, is " << last_msg_.stec_sat_list[6].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[1], 26002) << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[1], expected 26002, is " << last_msg_.stec_sat_list[6].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[2], -29879) << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[2], expected -29879, is " << last_msg_.stec_sat_list[6].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[3], 30008) << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[3], expected 30008, is " << last_msg_.stec_sat_list[6].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[6].stec_quality_indicator, 9) << "incorrect value for last_msg_.stec_sat_list[6].stec_quality_indicator, expected 9, is " << last_msg_.stec_sat_list[6].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[6].sv_id.constellation, 108) << "incorrect value for last_msg_.stec_sat_list[6].sv_id.constellation, expected 108, is " << last_msg_.stec_sat_list[6].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[6].sv_id.satId, 51) << "incorrect value for last_msg_.stec_sat_list[6].sv_id.satId, expected 51, is " << last_msg_.stec_sat_list[6].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[0], -12948) << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[0], expected -12948, is " << last_msg_.stec_sat_list[7].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[1], 4701) << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[1], expected 4701, is " << last_msg_.stec_sat_list[7].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[2], -15597) << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[2], expected -15597, is " << last_msg_.stec_sat_list[7].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[3], -13791) << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[3], expected -13791, is " << last_msg_.stec_sat_list[7].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[7].stec_quality_indicator, 213) << "incorrect value for last_msg_.stec_sat_list[7].stec_quality_indicator, expected 213, is " << last_msg_.stec_sat_list[7].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[7].sv_id.constellation, 37) << "incorrect value for last_msg_.stec_sat_list[7].sv_id.constellation, expected 37, is " << last_msg_.stec_sat_list[7].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[7].sv_id.satId, 82) << "incorrect value for last_msg_.stec_sat_list[7].sv_id.satId, expected 82, is " << last_msg_.stec_sat_list[7].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[0], -17283) << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[0], expected -17283, is " << last_msg_.stec_sat_list[8].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[1], 14455) << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[1], expected 14455, is " << last_msg_.stec_sat_list[8].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[2], -27067) << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[2], expected -27067, is " << last_msg_.stec_sat_list[8].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[3], 19606) << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[3], expected 19606, is " << last_msg_.stec_sat_list[8].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[8].stec_quality_indicator, 178) << "incorrect value for last_msg_.stec_sat_list[8].stec_quality_indicator, expected 178, is " << last_msg_.stec_sat_list[8].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[8].sv_id.constellation, 206) << "incorrect value for last_msg_.stec_sat_list[8].sv_id.constellation, expected 206, is " << last_msg_.stec_sat_list[8].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[8].sv_id.satId, 87) << "incorrect value for last_msg_.stec_sat_list[8].sv_id.satId, expected 87, is " << last_msg_.stec_sat_list[8].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[0], -12215) << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[0], expected -12215, is " << last_msg_.stec_sat_list[9].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[1], -6072) << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[1], expected -6072, is " << last_msg_.stec_sat_list[9].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[2], -1528) << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[2], expected -1528, is " << last_msg_.stec_sat_list[9].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[3], -19765) << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[3], expected -19765, is " << last_msg_.stec_sat_list[9].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[9].stec_quality_indicator, 18) << "incorrect value for last_msg_.stec_sat_list[9].stec_quality_indicator, expected 18, is " << last_msg_.stec_sat_list[9].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[9].sv_id.constellation, 131) << "incorrect value for last_msg_.stec_sat_list[9].sv_id.constellation, expected 131, is " << last_msg_.stec_sat_list[9].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[9].sv_id.satId, 3) << "incorrect value for last_msg_.stec_sat_list[9].sv_id.satId, expected 3, is " << last_msg_.stec_sat_list[9].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[0], 12630) << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[0], expected 12630, is " << last_msg_.stec_sat_list[10].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[1], -19721) << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[1], expected -19721, is " << last_msg_.stec_sat_list[10].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[2], 14502) << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[2], expected 14502, is " << last_msg_.stec_sat_list[10].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[3], 2591) << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[3], expected 2591, is " << last_msg_.stec_sat_list[10].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[10].stec_quality_indicator, 252) << "incorrect value for last_msg_.stec_sat_list[10].stec_quality_indicator, expected 252, is " << last_msg_.stec_sat_list[10].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[10].sv_id.constellation, 163) << "incorrect value for last_msg_.stec_sat_list[10].sv_id.constellation, expected 163, is " << last_msg_.stec_sat_list[10].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[10].sv_id.satId, 170) << "incorrect value for last_msg_.stec_sat_list[10].sv_id.satId, expected 170, is " << last_msg_.stec_sat_list[10].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[0], -23340) << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[0], expected -23340, is " << last_msg_.stec_sat_list[11].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[1], -24063) << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[1], expected -24063, is " << last_msg_.stec_sat_list[11].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[2], 4650) << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[2], expected 4650, is " << last_msg_.stec_sat_list[11].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[3], -22148) << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[3], expected -22148, is " << last_msg_.stec_sat_list[11].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[11].stec_quality_indicator, 241) << "incorrect value for last_msg_.stec_sat_list[11].stec_quality_indicator, expected 241, is " << last_msg_.stec_sat_list[11].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[11].sv_id.constellation, 213) << "incorrect value for last_msg_.stec_sat_list[11].sv_id.constellation, expected 213, is " << last_msg_.stec_sat_list[11].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[11].sv_id.satId, 119) << "incorrect value for last_msg_.stec_sat_list[11].sv_id.satId, expected 119, is " << last_msg_.stec_sat_list[11].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[0], 5944) << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[0], expected 5944, is " << last_msg_.stec_sat_list[12].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[1], 32142) << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[1], expected 32142, is " << last_msg_.stec_sat_list[12].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[2], 30760) << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[2], expected 30760, is " << last_msg_.stec_sat_list[12].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[3], 11587) << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[3], expected 11587, is " << last_msg_.stec_sat_list[12].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[12].stec_quality_indicator, 26) << "incorrect value for last_msg_.stec_sat_list[12].stec_quality_indicator, expected 26, is " << last_msg_.stec_sat_list[12].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[12].sv_id.constellation, 158) << "incorrect value for last_msg_.stec_sat_list[12].sv_id.constellation, expected 158, is " << last_msg_.stec_sat_list[12].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[12].sv_id.satId, 121) << "incorrect value for last_msg_.stec_sat_list[12].sv_id.satId, expected 121, is " << last_msg_.stec_sat_list[12].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[0], 3095) << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[0], expected 3095, is " << last_msg_.stec_sat_list[13].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[1], 22769) << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[1], expected 22769, is " << last_msg_.stec_sat_list[13].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[2], -4283) << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[2], expected -4283, is " << last_msg_.stec_sat_list[13].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[3], 14844) << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[3], expected 14844, is " << last_msg_.stec_sat_list[13].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[13].stec_quality_indicator, 110) << "incorrect value for last_msg_.stec_sat_list[13].stec_quality_indicator, expected 110, is " << last_msg_.stec_sat_list[13].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[13].sv_id.constellation, 235) << "incorrect value for last_msg_.stec_sat_list[13].sv_id.constellation, expected 235, is " << last_msg_.stec_sat_list[13].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[13].sv_id.satId, 126) << "incorrect value for last_msg_.stec_sat_list[13].sv_id.satId, expected 126, is " << last_msg_.stec_sat_list[13].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[0], -21032) << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[0], expected -21032, is " << last_msg_.stec_sat_list[14].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[1], -19726) << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[1], expected -19726, is " << last_msg_.stec_sat_list[14].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[2], 1297) << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[2], expected 1297, is " << last_msg_.stec_sat_list[14].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[3], -22049) << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[3], expected -22049, is " << last_msg_.stec_sat_list[14].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[14].stec_quality_indicator, 201) << "incorrect value for last_msg_.stec_sat_list[14].stec_quality_indicator, expected 201, is " << last_msg_.stec_sat_list[14].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[14].sv_id.constellation, 44) << "incorrect value for last_msg_.stec_sat_list[14].sv_id.constellation, expected 44, is " << last_msg_.stec_sat_list[14].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[14].sv_id.satId, 93) << "incorrect value for last_msg_.stec_sat_list[14].sv_id.satId, expected 93, is " << last_msg_.stec_sat_list[14].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[0], 619) << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[0], expected 619, is " << last_msg_.stec_sat_list[15].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[1], -5744) << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[1], expected -5744, is " << last_msg_.stec_sat_list[15].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[2], 22542) << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[2], expected 22542, is " << last_msg_.stec_sat_list[15].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[3], -12000) << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[3], expected -12000, is " << last_msg_.stec_sat_list[15].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[15].stec_quality_indicator, 77) << "incorrect value for last_msg_.stec_sat_list[15].stec_quality_indicator, expected 77, is " << last_msg_.stec_sat_list[15].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[15].sv_id.constellation, 3) << "incorrect value for last_msg_.stec_sat_list[15].sv_id.constellation, expected 3, is " << last_msg_.stec_sat_list[15].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[15].sv_id.satId, 192) << "incorrect value for last_msg_.stec_sat_list[15].sv_id.satId, expected 192, is " << last_msg_.stec_sat_list[15].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[0], 10651) << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[0], expected 10651, is " << last_msg_.stec_sat_list[16].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[1], -2889) << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[1], expected -2889, is " << last_msg_.stec_sat_list[16].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[2], 21150) << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[2], expected 21150, is " << last_msg_.stec_sat_list[16].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[3], 26421) << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[3], expected 26421, is " << last_msg_.stec_sat_list[16].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[16].stec_quality_indicator, 123) << "incorrect value for last_msg_.stec_sat_list[16].stec_quality_indicator, expected 123, is " << last_msg_.stec_sat_list[16].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[16].sv_id.constellation, 17) << "incorrect value for last_msg_.stec_sat_list[16].sv_id.constellation, expected 17, is " << last_msg_.stec_sat_list[16].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[16].sv_id.satId, 1) << "incorrect value for last_msg_.stec_sat_list[16].sv_id.satId, expected 1, is " << last_msg_.stec_sat_list[16].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[0], -19165) << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[0], expected -19165, is " << last_msg_.stec_sat_list[17].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[1], 30229) << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[1], expected 30229, is " << last_msg_.stec_sat_list[17].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[2], -1282) << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[2], expected -1282, is " << last_msg_.stec_sat_list[17].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[3], -18382) << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[3], expected -18382, is " << last_msg_.stec_sat_list[17].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[17].stec_quality_indicator, 185) << "incorrect value for last_msg_.stec_sat_list[17].stec_quality_indicator, expected 185, is " << last_msg_.stec_sat_list[17].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[17].sv_id.constellation, 202) << "incorrect value for last_msg_.stec_sat_list[17].sv_id.constellation, expected 202, is " << last_msg_.stec_sat_list[17].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[17].sv_id.satId, 14) << "incorrect value for last_msg_.stec_sat_list[17].sv_id.satId, expected 14, is " << last_msg_.stec_sat_list[17].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[0], -23752) << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[0], expected -23752, is " << last_msg_.stec_sat_list[18].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[1], 32433) << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[1], expected 32433, is " << last_msg_.stec_sat_list[18].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[2], 20441) << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[2], expected 20441, is " << last_msg_.stec_sat_list[18].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[3], -4181) << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[3], expected -4181, is " << last_msg_.stec_sat_list[18].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[18].stec_quality_indicator, 45) << "incorrect value for last_msg_.stec_sat_list[18].stec_quality_indicator, expected 45, is " << last_msg_.stec_sat_list[18].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[18].sv_id.constellation, 31) << "incorrect value for last_msg_.stec_sat_list[18].sv_id.constellation, expected 31, is " << last_msg_.stec_sat_list[18].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[18].sv_id.satId, 50) << "incorrect value for last_msg_.stec_sat_list[18].sv_id.satId, expected 50, is " << last_msg_.stec_sat_list[18].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[0], -13968) << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[0], expected -13968, is " << last_msg_.stec_sat_list[19].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[1], -29322) << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[1], expected -29322, is " << last_msg_.stec_sat_list[19].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[2], -23790) << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[2], expected -23790, is " << last_msg_.stec_sat_list[19].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[3], 9063) << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[3], expected 9063, is " << last_msg_.stec_sat_list[19].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[19].stec_quality_indicator, 238) << "incorrect value for last_msg_.stec_sat_list[19].stec_quality_indicator, expected 238, is " << last_msg_.stec_sat_list[19].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[19].sv_id.constellation, 188) << "incorrect value for last_msg_.stec_sat_list[19].sv_id.constellation, expected 188, is " << last_msg_.stec_sat_list[19].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[19].sv_id.satId, 237) << "incorrect value for last_msg_.stec_sat_list[19].sv_id.satId, expected 237, is " << last_msg_.stec_sat_list[19].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[0], 4737) << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[0], expected 4737, is " << last_msg_.stec_sat_list[20].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[1], 21877) << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[1], expected 21877, is " << last_msg_.stec_sat_list[20].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[2], 20414) << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[2], expected 20414, is " << last_msg_.stec_sat_list[20].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[3], -10286) << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[3], expected -10286, is " << last_msg_.stec_sat_list[20].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[20].stec_quality_indicator, 82) << "incorrect value for last_msg_.stec_sat_list[20].stec_quality_indicator, expected 82, is " << last_msg_.stec_sat_list[20].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[20].sv_id.constellation, 21) << "incorrect value for last_msg_.stec_sat_list[20].sv_id.constellation, expected 21, is " << last_msg_.stec_sat_list[20].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[20].sv_id.satId, 63) << "incorrect value for last_msg_.stec_sat_list[20].sv_id.satId, expected 63, is " << last_msg_.stec_sat_list[20].sv_id.satId; +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrStecCorrectionDep0, Test) { + uint8_t encoded_frame[] = { + 85, 251, 5, 204, 151, 245, 158, 228, 114, 117, 50, 158, 156, 42, 119, + 156, 157, 112, 47, 60, 132, 40, 70, 87, 235, 83, 177, 198, 3, 14, + 8, 70, 12, 44, 53, 181, 90, 174, 247, 150, 58, 172, 247, 179, 119, + 176, 125, 4, 177, 229, 113, 14, 77, 153, 185, 23, 53, 222, 187, 146, + 250, 91, 212, 215, 14, 107, 250, 94, 107, 33, 91, 234, 0, 213, 139, + 95, 179, 50, 21, 74, 174, 169, 61, 86, 91, 142, 51, 108, 9, 38, + 225, 146, 101, 73, 139, 56, 117, 82, 37, 213, 108, 205, 93, 18, 19, + 195, 33, 202, 87, 206, 178, 125, 188, 119, 56, 69, 150, 150, 76, 3, + 131, 18, 73, 208, 72, 232, 8, 250, 203, 178, 170, 163, 252, 86, 49, + 247, 178, 166, 56, 31, 10, 119, 213, 241, 212, 164, 1, 162, 42, 18, + 124, 169, 121, 158, 26, 56, 23, 142, 125, 40, 120, 67, 45, 126, 235, + 110, 23, 12, 241, 88, 69, 239, 252, 57, 93, 44, 201, 216, 173, 242, + 178, 17, 5, 223, 169, 192, 3, 77, 107, 2, 144, 233, 14, 88, 32, + 209, 1, 17, 123, 155, 41, 183, 244, 158, 82, 53, 103, 14, 202, 185, + 35, 181, 21, 118, 254, 250, 50, 184, 50, 31, 45, 56, 163, 177, 126, + 217, 79, 171, 239, 237, 188, 238, 112, 201, 118, 141, 18, 163, 103, 35, + 63, 21, 82, 129, 18, 117, 85, 190, 79, 210, 215, 227, 177, + }; + + sbp_msg_ssr_stec_correction_dep_t test_msg{}; + test_msg.header.iod_atmo = 60; + test_msg.header.num_msgs = 157; + test_msg.header.seq_num = 112; + test_msg.header.tile_id = 30066; + test_msg.header.tile_set_id = 58526; + test_msg.header.time.tow = 714907186; + test_msg.header.time.wn = 40055; + test_msg.header.update_interval = 47; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_stec_sat_list.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)101, (char)99, + (char)95, (char)115, (char)97, (char)116, + (char)95, (char)108, (char)105, (char)115, + (char)116}; + memcpy(test_msg.n_stec_sat_list.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_stec_sat_list.value = 21; + + test_msg.stec_sat_list[0].stec_coeff[0] = -5289; + + test_msg.stec_sat_list[0].stec_coeff[1] = -20141; + + test_msg.stec_sat_list[0].stec_coeff[2] = 966; + + test_msg.stec_sat_list[0].stec_coeff[3] = 2062; + test_msg.stec_sat_list[0].stec_quality_indicator = 70; + test_msg.stec_sat_list[0].sv_id.constellation = 40; + test_msg.stec_sat_list[0].sv_id.satId = 132; + + test_msg.stec_sat_list[1].stec_coeff[0] = -19147; + + test_msg.stec_sat_list[1].stec_coeff[1] = -20902; + + test_msg.stec_sat_list[1].stec_coeff[2] = -26889; + + test_msg.stec_sat_list[1].stec_coeff[3] = -21446; + test_msg.stec_sat_list[1].stec_quality_indicator = 44; + test_msg.stec_sat_list[1].sv_id.constellation = 12; + test_msg.stec_sat_list[1].sv_id.satId = 70; + + test_msg.stec_sat_list[2].stec_coeff[0] = 32176; + + test_msg.stec_sat_list[2].stec_coeff[1] = -20220; + + test_msg.stec_sat_list[2].stec_coeff[2] = 29157; + + test_msg.stec_sat_list[2].stec_coeff[3] = 19726; + test_msg.stec_sat_list[2].stec_quality_indicator = 119; + test_msg.stec_sat_list[2].sv_id.constellation = 179; + test_msg.stec_sat_list[2].sv_id.satId = 247; + + test_msg.stec_sat_list[3].stec_coeff[0] = -8651; + + test_msg.stec_sat_list[3].stec_coeff[1] = -27973; + + test_msg.stec_sat_list[3].stec_coeff[2] = 23546; + + test_msg.stec_sat_list[3].stec_coeff[3] = -10284; + test_msg.stec_sat_list[3].stec_quality_indicator = 23; + test_msg.stec_sat_list[3].sv_id.constellation = 185; + test_msg.stec_sat_list[3].sv_id.satId = 153; + + test_msg.stec_sat_list[4].stec_coeff[0] = 27486; + + test_msg.stec_sat_list[4].stec_coeff[1] = 23329; + + test_msg.stec_sat_list[4].stec_coeff[2] = 234; + + test_msg.stec_sat_list[4].stec_coeff[3] = -29739; + test_msg.stec_sat_list[4].stec_quality_indicator = 250; + test_msg.stec_sat_list[4].sv_id.constellation = 107; + test_msg.stec_sat_list[4].sv_id.satId = 14; + + test_msg.stec_sat_list[5].stec_coeff[0] = 18965; + + test_msg.stec_sat_list[5].stec_coeff[1] = -22098; + + test_msg.stec_sat_list[5].stec_coeff[2] = 22077; + + test_msg.stec_sat_list[5].stec_coeff[3] = -29093; + test_msg.stec_sat_list[5].stec_quality_indicator = 50; + test_msg.stec_sat_list[5].sv_id.constellation = 179; + test_msg.stec_sat_list[5].sv_id.satId = 95; + + test_msg.stec_sat_list[6].stec_coeff[0] = -7898; + + test_msg.stec_sat_list[6].stec_coeff[1] = 26002; + + test_msg.stec_sat_list[6].stec_coeff[2] = -29879; + + test_msg.stec_sat_list[6].stec_coeff[3] = 30008; + test_msg.stec_sat_list[6].stec_quality_indicator = 9; + test_msg.stec_sat_list[6].sv_id.constellation = 108; + test_msg.stec_sat_list[6].sv_id.satId = 51; + + test_msg.stec_sat_list[7].stec_coeff[0] = -12948; + + test_msg.stec_sat_list[7].stec_coeff[1] = 4701; + + test_msg.stec_sat_list[7].stec_coeff[2] = -15597; + + test_msg.stec_sat_list[7].stec_coeff[3] = -13791; + test_msg.stec_sat_list[7].stec_quality_indicator = 213; + test_msg.stec_sat_list[7].sv_id.constellation = 37; + test_msg.stec_sat_list[7].sv_id.satId = 82; + + test_msg.stec_sat_list[8].stec_coeff[0] = -17283; + + test_msg.stec_sat_list[8].stec_coeff[1] = 14455; + + test_msg.stec_sat_list[8].stec_coeff[2] = -27067; + + test_msg.stec_sat_list[8].stec_coeff[3] = 19606; + test_msg.stec_sat_list[8].stec_quality_indicator = 178; + test_msg.stec_sat_list[8].sv_id.constellation = 206; + test_msg.stec_sat_list[8].sv_id.satId = 87; + + test_msg.stec_sat_list[9].stec_coeff[0] = -12215; + + test_msg.stec_sat_list[9].stec_coeff[1] = -6072; + + test_msg.stec_sat_list[9].stec_coeff[2] = -1528; + + test_msg.stec_sat_list[9].stec_coeff[3] = -19765; + test_msg.stec_sat_list[9].stec_quality_indicator = 18; + test_msg.stec_sat_list[9].sv_id.constellation = 131; + test_msg.stec_sat_list[9].sv_id.satId = 3; + + test_msg.stec_sat_list[10].stec_coeff[0] = 12630; + + test_msg.stec_sat_list[10].stec_coeff[1] = -19721; + + test_msg.stec_sat_list[10].stec_coeff[2] = 14502; + + test_msg.stec_sat_list[10].stec_coeff[3] = 2591; + test_msg.stec_sat_list[10].stec_quality_indicator = 252; + test_msg.stec_sat_list[10].sv_id.constellation = 163; + test_msg.stec_sat_list[10].sv_id.satId = 170; + + test_msg.stec_sat_list[11].stec_coeff[0] = -23340; + + test_msg.stec_sat_list[11].stec_coeff[1] = -24063; + + test_msg.stec_sat_list[11].stec_coeff[2] = 4650; + + test_msg.stec_sat_list[11].stec_coeff[3] = -22148; + test_msg.stec_sat_list[11].stec_quality_indicator = 241; + test_msg.stec_sat_list[11].sv_id.constellation = 213; + test_msg.stec_sat_list[11].sv_id.satId = 119; + + test_msg.stec_sat_list[12].stec_coeff[0] = 5944; + + test_msg.stec_sat_list[12].stec_coeff[1] = 32142; + + test_msg.stec_sat_list[12].stec_coeff[2] = 30760; + + test_msg.stec_sat_list[12].stec_coeff[3] = 11587; + test_msg.stec_sat_list[12].stec_quality_indicator = 26; + test_msg.stec_sat_list[12].sv_id.constellation = 158; + test_msg.stec_sat_list[12].sv_id.satId = 121; + + test_msg.stec_sat_list[13].stec_coeff[0] = 3095; + + test_msg.stec_sat_list[13].stec_coeff[1] = 22769; + + test_msg.stec_sat_list[13].stec_coeff[2] = -4283; + + test_msg.stec_sat_list[13].stec_coeff[3] = 14844; + test_msg.stec_sat_list[13].stec_quality_indicator = 110; + test_msg.stec_sat_list[13].sv_id.constellation = 235; + test_msg.stec_sat_list[13].sv_id.satId = 126; + + test_msg.stec_sat_list[14].stec_coeff[0] = -21032; + + test_msg.stec_sat_list[14].stec_coeff[1] = -19726; + + test_msg.stec_sat_list[14].stec_coeff[2] = 1297; + + test_msg.stec_sat_list[14].stec_coeff[3] = -22049; + test_msg.stec_sat_list[14].stec_quality_indicator = 201; + test_msg.stec_sat_list[14].sv_id.constellation = 44; + test_msg.stec_sat_list[14].sv_id.satId = 93; + + test_msg.stec_sat_list[15].stec_coeff[0] = 619; + + test_msg.stec_sat_list[15].stec_coeff[1] = -5744; + + test_msg.stec_sat_list[15].stec_coeff[2] = 22542; + + test_msg.stec_sat_list[15].stec_coeff[3] = -12000; + test_msg.stec_sat_list[15].stec_quality_indicator = 77; + test_msg.stec_sat_list[15].sv_id.constellation = 3; + test_msg.stec_sat_list[15].sv_id.satId = 192; + + test_msg.stec_sat_list[16].stec_coeff[0] = 10651; + + test_msg.stec_sat_list[16].stec_coeff[1] = -2889; + + test_msg.stec_sat_list[16].stec_coeff[2] = 21150; + + test_msg.stec_sat_list[16].stec_coeff[3] = 26421; + test_msg.stec_sat_list[16].stec_quality_indicator = 123; + test_msg.stec_sat_list[16].sv_id.constellation = 17; + test_msg.stec_sat_list[16].sv_id.satId = 1; + + test_msg.stec_sat_list[17].stec_coeff[0] = -19165; + + test_msg.stec_sat_list[17].stec_coeff[1] = 30229; + + test_msg.stec_sat_list[17].stec_coeff[2] = -1282; + + test_msg.stec_sat_list[17].stec_coeff[3] = -18382; + test_msg.stec_sat_list[17].stec_quality_indicator = 185; + test_msg.stec_sat_list[17].sv_id.constellation = 202; + test_msg.stec_sat_list[17].sv_id.satId = 14; + + test_msg.stec_sat_list[18].stec_coeff[0] = -23752; + + test_msg.stec_sat_list[18].stec_coeff[1] = 32433; + + test_msg.stec_sat_list[18].stec_coeff[2] = 20441; + + test_msg.stec_sat_list[18].stec_coeff[3] = -4181; + test_msg.stec_sat_list[18].stec_quality_indicator = 45; + test_msg.stec_sat_list[18].sv_id.constellation = 31; + test_msg.stec_sat_list[18].sv_id.satId = 50; + + test_msg.stec_sat_list[19].stec_coeff[0] = -13968; + + test_msg.stec_sat_list[19].stec_coeff[1] = -29322; + + test_msg.stec_sat_list[19].stec_coeff[2] = -23790; + + test_msg.stec_sat_list[19].stec_coeff[3] = 9063; + test_msg.stec_sat_list[19].stec_quality_indicator = 238; + test_msg.stec_sat_list[19].sv_id.constellation = 188; + test_msg.stec_sat_list[19].sv_id.satId = 237; + + test_msg.stec_sat_list[20].stec_coeff[0] = 4737; + + test_msg.stec_sat_list[20].stec_coeff[1] = 21877; + + test_msg.stec_sat_list[20].stec_coeff[2] = 20414; + + test_msg.stec_sat_list[20].stec_coeff[3] = -10286; + test_msg.stec_sat_list[20].stec_quality_indicator = 82; + test_msg.stec_sat_list[20].sv_id.constellation = 21; + test_msg.stec_sat_list[20].sv_id.satId = 63; + + EXPECT_EQ(send_message(38860, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 38860); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.iod_atmo, 60) + << "incorrect value for last_msg_.header.iod_atmo, expected 60, is " + << last_msg_.header.iod_atmo; + EXPECT_EQ(last_msg_.header.num_msgs, 157) + << "incorrect value for last_msg_.header.num_msgs, expected 157, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.seq_num, 112) + << "incorrect value for last_msg_.header.seq_num, expected 112, is " + << last_msg_.header.seq_num; + EXPECT_EQ(last_msg_.header.tile_id, 30066) + << "incorrect value for last_msg_.header.tile_id, expected 30066, is " + << last_msg_.header.tile_id; + EXPECT_EQ(last_msg_.header.tile_set_id, 58526) + << "incorrect value for last_msg_.header.tile_set_id, expected 58526, is " + << last_msg_.header.tile_set_id; + EXPECT_EQ(last_msg_.header.time.tow, 714907186) + << "incorrect value for last_msg_.header.time.tow, expected 714907186, " + "is " + << last_msg_.header.time.tow; + EXPECT_EQ(last_msg_.header.time.wn, 40055) + << "incorrect value for last_msg_.header.time.wn, expected 40055, is " + << last_msg_.header.time.wn; + EXPECT_EQ(last_msg_.header.update_interval, 47) + << "incorrect value for last_msg_.header.update_interval, expected 47, " + "is " + << last_msg_.header.update_interval; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_stec_sat_list.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_stec_sat_list.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_stec_sat_list.handle_as + << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)101, (char)99, + (char)95, (char)115, (char)97, (char)116, + (char)95, (char)108, (char)105, (char)115, + (char)116}; + EXPECT_EQ(memcmp(last_msg_.n_stec_sat_list.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_stec_sat_list.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_stec_sat_list.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_stec_sat_list.value, 21) + << "incorrect value for last_msg_.n_stec_sat_list.value, expected 21, is " + << last_msg_.n_stec_sat_list.value; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[0], -5289) + << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[0], " + "expected -5289, is " + << last_msg_.stec_sat_list[0].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[1], -20141) + << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[1], " + "expected -20141, is " + << last_msg_.stec_sat_list[0].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[2], 966) + << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[2], " + "expected 966, is " + << last_msg_.stec_sat_list[0].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[3], 2062) + << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[3], " + "expected 2062, is " + << last_msg_.stec_sat_list[0].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_quality_indicator, 70) + << "incorrect value for " + "last_msg_.stec_sat_list[0].stec_quality_indicator, expected 70, is " + << last_msg_.stec_sat_list[0].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[0].sv_id.constellation, 40) + << "incorrect value for last_msg_.stec_sat_list[0].sv_id.constellation, " + "expected 40, is " + << last_msg_.stec_sat_list[0].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[0].sv_id.satId, 132) + << "incorrect value for last_msg_.stec_sat_list[0].sv_id.satId, expected " + "132, is " + << last_msg_.stec_sat_list[0].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[0], -19147) + << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[0], " + "expected -19147, is " + << last_msg_.stec_sat_list[1].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[1], -20902) + << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[1], " + "expected -20902, is " + << last_msg_.stec_sat_list[1].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[2], -26889) + << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[2], " + "expected -26889, is " + << last_msg_.stec_sat_list[1].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[3], -21446) + << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[3], " + "expected -21446, is " + << last_msg_.stec_sat_list[1].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_quality_indicator, 44) + << "incorrect value for " + "last_msg_.stec_sat_list[1].stec_quality_indicator, expected 44, is " + << last_msg_.stec_sat_list[1].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[1].sv_id.constellation, 12) + << "incorrect value for last_msg_.stec_sat_list[1].sv_id.constellation, " + "expected 12, is " + << last_msg_.stec_sat_list[1].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[1].sv_id.satId, 70) + << "incorrect value for last_msg_.stec_sat_list[1].sv_id.satId, expected " + "70, is " + << last_msg_.stec_sat_list[1].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[0], 32176) + << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[0], " + "expected 32176, is " + << last_msg_.stec_sat_list[2].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[1], -20220) + << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[1], " + "expected -20220, is " + << last_msg_.stec_sat_list[2].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[2], 29157) + << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[2], " + "expected 29157, is " + << last_msg_.stec_sat_list[2].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[3], 19726) + << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[3], " + "expected 19726, is " + << last_msg_.stec_sat_list[2].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[2].stec_quality_indicator, 119) + << "incorrect value for " + "last_msg_.stec_sat_list[2].stec_quality_indicator, expected 119, is " + << last_msg_.stec_sat_list[2].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[2].sv_id.constellation, 179) + << "incorrect value for last_msg_.stec_sat_list[2].sv_id.constellation, " + "expected 179, is " + << last_msg_.stec_sat_list[2].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[2].sv_id.satId, 247) + << "incorrect value for last_msg_.stec_sat_list[2].sv_id.satId, expected " + "247, is " + << last_msg_.stec_sat_list[2].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[0], -8651) + << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[0], " + "expected -8651, is " + << last_msg_.stec_sat_list[3].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[1], -27973) + << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[1], " + "expected -27973, is " + << last_msg_.stec_sat_list[3].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[2], 23546) + << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[2], " + "expected 23546, is " + << last_msg_.stec_sat_list[3].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[3], -10284) + << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[3], " + "expected -10284, is " + << last_msg_.stec_sat_list[3].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[3].stec_quality_indicator, 23) + << "incorrect value for " + "last_msg_.stec_sat_list[3].stec_quality_indicator, expected 23, is " + << last_msg_.stec_sat_list[3].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[3].sv_id.constellation, 185) + << "incorrect value for last_msg_.stec_sat_list[3].sv_id.constellation, " + "expected 185, is " + << last_msg_.stec_sat_list[3].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[3].sv_id.satId, 153) + << "incorrect value for last_msg_.stec_sat_list[3].sv_id.satId, expected " + "153, is " + << last_msg_.stec_sat_list[3].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[0], 27486) + << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[0], " + "expected 27486, is " + << last_msg_.stec_sat_list[4].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[1], 23329) + << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[1], " + "expected 23329, is " + << last_msg_.stec_sat_list[4].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[2], 234) + << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[2], " + "expected 234, is " + << last_msg_.stec_sat_list[4].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[3], -29739) + << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[3], " + "expected -29739, is " + << last_msg_.stec_sat_list[4].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[4].stec_quality_indicator, 250) + << "incorrect value for " + "last_msg_.stec_sat_list[4].stec_quality_indicator, expected 250, is " + << last_msg_.stec_sat_list[4].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[4].sv_id.constellation, 107) + << "incorrect value for last_msg_.stec_sat_list[4].sv_id.constellation, " + "expected 107, is " + << last_msg_.stec_sat_list[4].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[4].sv_id.satId, 14) + << "incorrect value for last_msg_.stec_sat_list[4].sv_id.satId, expected " + "14, is " + << last_msg_.stec_sat_list[4].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[0], 18965) + << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[0], " + "expected 18965, is " + << last_msg_.stec_sat_list[5].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[1], -22098) + << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[1], " + "expected -22098, is " + << last_msg_.stec_sat_list[5].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[2], 22077) + << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[2], " + "expected 22077, is " + << last_msg_.stec_sat_list[5].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[3], -29093) + << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[3], " + "expected -29093, is " + << last_msg_.stec_sat_list[5].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[5].stec_quality_indicator, 50) + << "incorrect value for " + "last_msg_.stec_sat_list[5].stec_quality_indicator, expected 50, is " + << last_msg_.stec_sat_list[5].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[5].sv_id.constellation, 179) + << "incorrect value for last_msg_.stec_sat_list[5].sv_id.constellation, " + "expected 179, is " + << last_msg_.stec_sat_list[5].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[5].sv_id.satId, 95) + << "incorrect value for last_msg_.stec_sat_list[5].sv_id.satId, expected " + "95, is " + << last_msg_.stec_sat_list[5].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[0], -7898) + << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[0], " + "expected -7898, is " + << last_msg_.stec_sat_list[6].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[1], 26002) + << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[1], " + "expected 26002, is " + << last_msg_.stec_sat_list[6].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[2], -29879) + << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[2], " + "expected -29879, is " + << last_msg_.stec_sat_list[6].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[3], 30008) + << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[3], " + "expected 30008, is " + << last_msg_.stec_sat_list[6].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[6].stec_quality_indicator, 9) + << "incorrect value for " + "last_msg_.stec_sat_list[6].stec_quality_indicator, expected 9, is " + << last_msg_.stec_sat_list[6].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[6].sv_id.constellation, 108) + << "incorrect value for last_msg_.stec_sat_list[6].sv_id.constellation, " + "expected 108, is " + << last_msg_.stec_sat_list[6].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[6].sv_id.satId, 51) + << "incorrect value for last_msg_.stec_sat_list[6].sv_id.satId, expected " + "51, is " + << last_msg_.stec_sat_list[6].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[0], -12948) + << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[0], " + "expected -12948, is " + << last_msg_.stec_sat_list[7].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[1], 4701) + << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[1], " + "expected 4701, is " + << last_msg_.stec_sat_list[7].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[2], -15597) + << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[2], " + "expected -15597, is " + << last_msg_.stec_sat_list[7].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[3], -13791) + << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[3], " + "expected -13791, is " + << last_msg_.stec_sat_list[7].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[7].stec_quality_indicator, 213) + << "incorrect value for " + "last_msg_.stec_sat_list[7].stec_quality_indicator, expected 213, is " + << last_msg_.stec_sat_list[7].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[7].sv_id.constellation, 37) + << "incorrect value for last_msg_.stec_sat_list[7].sv_id.constellation, " + "expected 37, is " + << last_msg_.stec_sat_list[7].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[7].sv_id.satId, 82) + << "incorrect value for last_msg_.stec_sat_list[7].sv_id.satId, expected " + "82, is " + << last_msg_.stec_sat_list[7].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[0], -17283) + << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[0], " + "expected -17283, is " + << last_msg_.stec_sat_list[8].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[1], 14455) + << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[1], " + "expected 14455, is " + << last_msg_.stec_sat_list[8].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[2], -27067) + << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[2], " + "expected -27067, is " + << last_msg_.stec_sat_list[8].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[3], 19606) + << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[3], " + "expected 19606, is " + << last_msg_.stec_sat_list[8].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[8].stec_quality_indicator, 178) + << "incorrect value for " + "last_msg_.stec_sat_list[8].stec_quality_indicator, expected 178, is " + << last_msg_.stec_sat_list[8].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[8].sv_id.constellation, 206) + << "incorrect value for last_msg_.stec_sat_list[8].sv_id.constellation, " + "expected 206, is " + << last_msg_.stec_sat_list[8].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[8].sv_id.satId, 87) + << "incorrect value for last_msg_.stec_sat_list[8].sv_id.satId, expected " + "87, is " + << last_msg_.stec_sat_list[8].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[0], -12215) + << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[0], " + "expected -12215, is " + << last_msg_.stec_sat_list[9].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[1], -6072) + << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[1], " + "expected -6072, is " + << last_msg_.stec_sat_list[9].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[2], -1528) + << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[2], " + "expected -1528, is " + << last_msg_.stec_sat_list[9].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[3], -19765) + << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[3], " + "expected -19765, is " + << last_msg_.stec_sat_list[9].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[9].stec_quality_indicator, 18) + << "incorrect value for " + "last_msg_.stec_sat_list[9].stec_quality_indicator, expected 18, is " + << last_msg_.stec_sat_list[9].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[9].sv_id.constellation, 131) + << "incorrect value for last_msg_.stec_sat_list[9].sv_id.constellation, " + "expected 131, is " + << last_msg_.stec_sat_list[9].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[9].sv_id.satId, 3) + << "incorrect value for last_msg_.stec_sat_list[9].sv_id.satId, expected " + "3, is " + << last_msg_.stec_sat_list[9].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[0], 12630) + << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[0], " + "expected 12630, is " + << last_msg_.stec_sat_list[10].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[1], -19721) + << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[1], " + "expected -19721, is " + << last_msg_.stec_sat_list[10].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[2], 14502) + << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[2], " + "expected 14502, is " + << last_msg_.stec_sat_list[10].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[3], 2591) + << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[3], " + "expected 2591, is " + << last_msg_.stec_sat_list[10].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[10].stec_quality_indicator, 252) + << "incorrect value for " + "last_msg_.stec_sat_list[10].stec_quality_indicator, expected 252, is " + << last_msg_.stec_sat_list[10].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[10].sv_id.constellation, 163) + << "incorrect value for last_msg_.stec_sat_list[10].sv_id.constellation, " + "expected 163, is " + << last_msg_.stec_sat_list[10].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[10].sv_id.satId, 170) + << "incorrect value for last_msg_.stec_sat_list[10].sv_id.satId, " + "expected 170, is " + << last_msg_.stec_sat_list[10].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[0], -23340) + << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[0], " + "expected -23340, is " + << last_msg_.stec_sat_list[11].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[1], -24063) + << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[1], " + "expected -24063, is " + << last_msg_.stec_sat_list[11].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[2], 4650) + << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[2], " + "expected 4650, is " + << last_msg_.stec_sat_list[11].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[3], -22148) + << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[3], " + "expected -22148, is " + << last_msg_.stec_sat_list[11].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[11].stec_quality_indicator, 241) + << "incorrect value for " + "last_msg_.stec_sat_list[11].stec_quality_indicator, expected 241, is " + << last_msg_.stec_sat_list[11].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[11].sv_id.constellation, 213) + << "incorrect value for last_msg_.stec_sat_list[11].sv_id.constellation, " + "expected 213, is " + << last_msg_.stec_sat_list[11].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[11].sv_id.satId, 119) + << "incorrect value for last_msg_.stec_sat_list[11].sv_id.satId, " + "expected 119, is " + << last_msg_.stec_sat_list[11].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[0], 5944) + << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[0], " + "expected 5944, is " + << last_msg_.stec_sat_list[12].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[1], 32142) + << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[1], " + "expected 32142, is " + << last_msg_.stec_sat_list[12].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[2], 30760) + << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[2], " + "expected 30760, is " + << last_msg_.stec_sat_list[12].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[3], 11587) + << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[3], " + "expected 11587, is " + << last_msg_.stec_sat_list[12].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[12].stec_quality_indicator, 26) + << "incorrect value for " + "last_msg_.stec_sat_list[12].stec_quality_indicator, expected 26, is " + << last_msg_.stec_sat_list[12].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[12].sv_id.constellation, 158) + << "incorrect value for last_msg_.stec_sat_list[12].sv_id.constellation, " + "expected 158, is " + << last_msg_.stec_sat_list[12].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[12].sv_id.satId, 121) + << "incorrect value for last_msg_.stec_sat_list[12].sv_id.satId, " + "expected 121, is " + << last_msg_.stec_sat_list[12].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[0], 3095) + << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[0], " + "expected 3095, is " + << last_msg_.stec_sat_list[13].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[1], 22769) + << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[1], " + "expected 22769, is " + << last_msg_.stec_sat_list[13].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[2], -4283) + << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[2], " + "expected -4283, is " + << last_msg_.stec_sat_list[13].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[3], 14844) + << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[3], " + "expected 14844, is " + << last_msg_.stec_sat_list[13].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[13].stec_quality_indicator, 110) + << "incorrect value for " + "last_msg_.stec_sat_list[13].stec_quality_indicator, expected 110, is " + << last_msg_.stec_sat_list[13].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[13].sv_id.constellation, 235) + << "incorrect value for last_msg_.stec_sat_list[13].sv_id.constellation, " + "expected 235, is " + << last_msg_.stec_sat_list[13].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[13].sv_id.satId, 126) + << "incorrect value for last_msg_.stec_sat_list[13].sv_id.satId, " + "expected 126, is " + << last_msg_.stec_sat_list[13].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[0], -21032) + << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[0], " + "expected -21032, is " + << last_msg_.stec_sat_list[14].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[1], -19726) + << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[1], " + "expected -19726, is " + << last_msg_.stec_sat_list[14].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[2], 1297) + << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[2], " + "expected 1297, is " + << last_msg_.stec_sat_list[14].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[3], -22049) + << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[3], " + "expected -22049, is " + << last_msg_.stec_sat_list[14].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[14].stec_quality_indicator, 201) + << "incorrect value for " + "last_msg_.stec_sat_list[14].stec_quality_indicator, expected 201, is " + << last_msg_.stec_sat_list[14].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[14].sv_id.constellation, 44) + << "incorrect value for last_msg_.stec_sat_list[14].sv_id.constellation, " + "expected 44, is " + << last_msg_.stec_sat_list[14].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[14].sv_id.satId, 93) + << "incorrect value for last_msg_.stec_sat_list[14].sv_id.satId, " + "expected 93, is " + << last_msg_.stec_sat_list[14].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[0], 619) + << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[0], " + "expected 619, is " + << last_msg_.stec_sat_list[15].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[1], -5744) + << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[1], " + "expected -5744, is " + << last_msg_.stec_sat_list[15].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[2], 22542) + << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[2], " + "expected 22542, is " + << last_msg_.stec_sat_list[15].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[3], -12000) + << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[3], " + "expected -12000, is " + << last_msg_.stec_sat_list[15].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[15].stec_quality_indicator, 77) + << "incorrect value for " + "last_msg_.stec_sat_list[15].stec_quality_indicator, expected 77, is " + << last_msg_.stec_sat_list[15].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[15].sv_id.constellation, 3) + << "incorrect value for last_msg_.stec_sat_list[15].sv_id.constellation, " + "expected 3, is " + << last_msg_.stec_sat_list[15].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[15].sv_id.satId, 192) + << "incorrect value for last_msg_.stec_sat_list[15].sv_id.satId, " + "expected 192, is " + << last_msg_.stec_sat_list[15].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[0], 10651) + << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[0], " + "expected 10651, is " + << last_msg_.stec_sat_list[16].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[1], -2889) + << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[1], " + "expected -2889, is " + << last_msg_.stec_sat_list[16].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[2], 21150) + << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[2], " + "expected 21150, is " + << last_msg_.stec_sat_list[16].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[3], 26421) + << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[3], " + "expected 26421, is " + << last_msg_.stec_sat_list[16].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[16].stec_quality_indicator, 123) + << "incorrect value for " + "last_msg_.stec_sat_list[16].stec_quality_indicator, expected 123, is " + << last_msg_.stec_sat_list[16].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[16].sv_id.constellation, 17) + << "incorrect value for last_msg_.stec_sat_list[16].sv_id.constellation, " + "expected 17, is " + << last_msg_.stec_sat_list[16].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[16].sv_id.satId, 1) + << "incorrect value for last_msg_.stec_sat_list[16].sv_id.satId, " + "expected 1, is " + << last_msg_.stec_sat_list[16].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[0], -19165) + << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[0], " + "expected -19165, is " + << last_msg_.stec_sat_list[17].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[1], 30229) + << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[1], " + "expected 30229, is " + << last_msg_.stec_sat_list[17].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[2], -1282) + << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[2], " + "expected -1282, is " + << last_msg_.stec_sat_list[17].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[3], -18382) + << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[3], " + "expected -18382, is " + << last_msg_.stec_sat_list[17].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[17].stec_quality_indicator, 185) + << "incorrect value for " + "last_msg_.stec_sat_list[17].stec_quality_indicator, expected 185, is " + << last_msg_.stec_sat_list[17].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[17].sv_id.constellation, 202) + << "incorrect value for last_msg_.stec_sat_list[17].sv_id.constellation, " + "expected 202, is " + << last_msg_.stec_sat_list[17].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[17].sv_id.satId, 14) + << "incorrect value for last_msg_.stec_sat_list[17].sv_id.satId, " + "expected 14, is " + << last_msg_.stec_sat_list[17].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[0], -23752) + << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[0], " + "expected -23752, is " + << last_msg_.stec_sat_list[18].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[1], 32433) + << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[1], " + "expected 32433, is " + << last_msg_.stec_sat_list[18].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[2], 20441) + << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[2], " + "expected 20441, is " + << last_msg_.stec_sat_list[18].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[3], -4181) + << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[3], " + "expected -4181, is " + << last_msg_.stec_sat_list[18].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[18].stec_quality_indicator, 45) + << "incorrect value for " + "last_msg_.stec_sat_list[18].stec_quality_indicator, expected 45, is " + << last_msg_.stec_sat_list[18].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[18].sv_id.constellation, 31) + << "incorrect value for last_msg_.stec_sat_list[18].sv_id.constellation, " + "expected 31, is " + << last_msg_.stec_sat_list[18].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[18].sv_id.satId, 50) + << "incorrect value for last_msg_.stec_sat_list[18].sv_id.satId, " + "expected 50, is " + << last_msg_.stec_sat_list[18].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[0], -13968) + << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[0], " + "expected -13968, is " + << last_msg_.stec_sat_list[19].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[1], -29322) + << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[1], " + "expected -29322, is " + << last_msg_.stec_sat_list[19].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[2], -23790) + << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[2], " + "expected -23790, is " + << last_msg_.stec_sat_list[19].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[3], 9063) + << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[3], " + "expected 9063, is " + << last_msg_.stec_sat_list[19].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[19].stec_quality_indicator, 238) + << "incorrect value for " + "last_msg_.stec_sat_list[19].stec_quality_indicator, expected 238, is " + << last_msg_.stec_sat_list[19].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[19].sv_id.constellation, 188) + << "incorrect value for last_msg_.stec_sat_list[19].sv_id.constellation, " + "expected 188, is " + << last_msg_.stec_sat_list[19].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[19].sv_id.satId, 237) + << "incorrect value for last_msg_.stec_sat_list[19].sv_id.satId, " + "expected 237, is " + << last_msg_.stec_sat_list[19].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[0], 4737) + << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[0], " + "expected 4737, is " + << last_msg_.stec_sat_list[20].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[1], 21877) + << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[1], " + "expected 21877, is " + << last_msg_.stec_sat_list[20].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[2], 20414) + << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[2], " + "expected 20414, is " + << last_msg_.stec_sat_list[20].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[3], -10286) + << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[3], " + "expected -10286, is " + << last_msg_.stec_sat_list[20].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[20].stec_quality_indicator, 82) + << "incorrect value for " + "last_msg_.stec_sat_list[20].stec_quality_indicator, expected 82, is " + << last_msg_.stec_sat_list[20].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[20].sv_id.constellation, 21) + << "incorrect value for last_msg_.stec_sat_list[20].sv_id.constellation, " + "expected 21, is " + << last_msg_.stec_sat_list[20].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[20].sv_id.satId, 63) + << "incorrect value for last_msg_.stec_sat_list[20].sv_id.satId, " + "expected 63, is " + << last_msg_.stec_sat_list[20].sv_id.satId; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.cc index a9936f576..f36bc4d6c 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_stec_correction_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_stec_correction_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,478 +67,975 @@ class Test_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA0 : sbp_msg_ssr_stec_correction_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,235,5,39,7,252,70,81,196,232,185,43,147,123,39,4,126,19,111,97,248,130,217,217,106,58,12,65,230,171,81,95,86,16,39,84,228,208,201,81,219,99,203,61,182,66,125,203,3,193,44,100,220,125,60,21,93,218,247,158,207,93,129,134,14,209,48,14,215,153,148,147,72,225,180,236,205,201,33,3,246,204,19,3,98,4,194,191,246,76,219,31,191,113,79,177,15,251,33,19,96,54,58,146,210,100,249,72,21,161,211,198,21,238,111,107,36,227,225,213,3,71,243,63,65,236,92,77,0,169,15,182,5,240,180,9,122,86,232,6,103,104,254,189,81,110,2,49,202,84,216,55,50,181,5,123,80,49,244,224,188,125,164,230,56,66,124,168,59,139,106,118,51,187,216,191,158,77,92,58,253,132,150,165,9,154,189,218,61,209,1,82,181,196,23,53,182,112,192,206,167,157,244,35,1,189,217,61,88,97,201,201,74,251,217,14,104,184,54,52,74,238,10,129,22,178,226,109,88,157,30,196,175,26,76,34,116,220,154,232,12,179,244,15,155,196,202,72,70,115,10,214,114,39,245,28,237,68,136,155, }; - - sbp_msg_ssr_stec_correction_dep_a_t test_msg{}; - test_msg.header.iod_atmo = 4; - test_msg.header.num_msgs = 147; - test_msg.header.seq_num = 123; - test_msg.header.time.tow = 3905179974; - test_msg.header.time.wn = 11193; - test_msg.header.update_interval = 39; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_stec_sat_list.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)101,(char)99,(char)95,(char)115,(char)97,(char)116,(char)95,(char)108,(char)105,(char)115,(char)116 }; - memcpy(test_msg.n_stec_sat_list.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_stec_sat_list.value = 22; - - - test_msg.stec_sat_list[0].stec_coeff[0] = -1951; - - test_msg.stec_sat_list[0].stec_coeff[1] = -9854; - - test_msg.stec_sat_list[0].stec_coeff[2] = 27353; - - test_msg.stec_sat_list[0].stec_coeff[3] = 3130; - test_msg.stec_sat_list[0].stec_quality_indicator = 111; - test_msg.stec_sat_list[0].sv_id.constellation = 19; - test_msg.stec_sat_list[0].sv_id.satId = 126; - - - test_msg.stec_sat_list[1].stec_coeff[0] = 24401; - - test_msg.stec_sat_list[1].stec_coeff[1] = 4182; - - test_msg.stec_sat_list[1].stec_coeff[2] = 21543; - - test_msg.stec_sat_list[1].stec_coeff[3] = -12060; - test_msg.stec_sat_list[1].stec_quality_indicator = 171; - test_msg.stec_sat_list[1].sv_id.constellation = 230; - test_msg.stec_sat_list[1].sv_id.satId = 65; - - - test_msg.stec_sat_list[2].stec_coeff[0] = -13469; - - test_msg.stec_sat_list[2].stec_coeff[1] = -18883; - - test_msg.stec_sat_list[2].stec_coeff[2] = 32066; - - test_msg.stec_sat_list[2].stec_coeff[3] = 971; - test_msg.stec_sat_list[2].stec_quality_indicator = 219; - test_msg.stec_sat_list[2].sv_id.constellation = 81; - test_msg.stec_sat_list[2].sv_id.satId = 201; - - - test_msg.stec_sat_list[3].stec_coeff[0] = 32220; - - test_msg.stec_sat_list[3].stec_coeff[1] = 5436; - - test_msg.stec_sat_list[3].stec_coeff[2] = -9635; - - test_msg.stec_sat_list[3].stec_coeff[3] = -24841; - test_msg.stec_sat_list[3].stec_quality_indicator = 100; - test_msg.stec_sat_list[3].sv_id.constellation = 44; - test_msg.stec_sat_list[3].sv_id.satId = 193; - - - test_msg.stec_sat_list[4].stec_coeff[0] = 3718; - - test_msg.stec_sat_list[4].stec_coeff[1] = 12497; - - test_msg.stec_sat_list[4].stec_coeff[2] = -10482; - - test_msg.stec_sat_list[4].stec_coeff[3] = -27495; - test_msg.stec_sat_list[4].stec_quality_indicator = 129; - test_msg.stec_sat_list[4].sv_id.constellation = 93; - test_msg.stec_sat_list[4].sv_id.satId = 207; - - - test_msg.stec_sat_list[5].stec_coeff[0] = -4940; - - test_msg.stec_sat_list[5].stec_coeff[1] = -13875; - - test_msg.stec_sat_list[5].stec_coeff[2] = 801; - - test_msg.stec_sat_list[5].stec_coeff[3] = -13066; - test_msg.stec_sat_list[5].stec_quality_indicator = 225; - test_msg.stec_sat_list[5].sv_id.constellation = 72; - test_msg.stec_sat_list[5].sv_id.satId = 147; - - - test_msg.stec_sat_list[6].stec_coeff[0] = -15868; - - test_msg.stec_sat_list[6].stec_coeff[1] = -2369; - - test_msg.stec_sat_list[6].stec_coeff[2] = -9396; - - test_msg.stec_sat_list[6].stec_coeff[3] = -16609; - test_msg.stec_sat_list[6].stec_quality_indicator = 98; - test_msg.stec_sat_list[6].sv_id.constellation = 3; - test_msg.stec_sat_list[6].sv_id.satId = 19; - - - test_msg.stec_sat_list[7].stec_coeff[0] = -1265; - - test_msg.stec_sat_list[7].stec_coeff[1] = 4897; - - test_msg.stec_sat_list[7].stec_coeff[2] = 13920; - - test_msg.stec_sat_list[7].stec_coeff[3] = -28102; - test_msg.stec_sat_list[7].stec_quality_indicator = 177; - test_msg.stec_sat_list[7].sv_id.constellation = 79; - test_msg.stec_sat_list[7].sv_id.satId = 113; - - - test_msg.stec_sat_list[8].stec_coeff[0] = 5448; - - test_msg.stec_sat_list[8].stec_coeff[1] = -11359; - - test_msg.stec_sat_list[8].stec_coeff[2] = 5574; - - test_msg.stec_sat_list[8].stec_coeff[3] = 28654; - test_msg.stec_sat_list[8].stec_quality_indicator = 249; - test_msg.stec_sat_list[8].sv_id.constellation = 100; - test_msg.stec_sat_list[8].sv_id.satId = 210; - - - test_msg.stec_sat_list[9].stec_coeff[0] = -10783; - - test_msg.stec_sat_list[9].stec_coeff[1] = 18179; - - test_msg.stec_sat_list[9].stec_coeff[2] = 16371; - - test_msg.stec_sat_list[9].stec_coeff[3] = -5055; - test_msg.stec_sat_list[9].stec_quality_indicator = 227; - test_msg.stec_sat_list[9].sv_id.constellation = 36; - test_msg.stec_sat_list[9].sv_id.satId = 107; - - - test_msg.stec_sat_list[10].stec_coeff[0] = 4009; - - test_msg.stec_sat_list[10].stec_coeff[1] = 1462; - - test_msg.stec_sat_list[10].stec_coeff[2] = -19216; - - test_msg.stec_sat_list[10].stec_coeff[3] = 31241; - test_msg.stec_sat_list[10].stec_quality_indicator = 0; - test_msg.stec_sat_list[10].sv_id.constellation = 77; - test_msg.stec_sat_list[10].sv_id.satId = 92; - - - test_msg.stec_sat_list[11].stec_coeff[0] = 26727; - - test_msg.stec_sat_list[11].stec_coeff[1] = -16898; - - test_msg.stec_sat_list[11].stec_coeff[2] = 28241; - - test_msg.stec_sat_list[11].stec_coeff[3] = 12546; - test_msg.stec_sat_list[11].stec_quality_indicator = 6; - test_msg.stec_sat_list[11].sv_id.constellation = 232; - test_msg.stec_sat_list[11].sv_id.satId = 86; - - - test_msg.stec_sat_list[12].stec_coeff[0] = 12855; - - test_msg.stec_sat_list[12].stec_coeff[1] = 1461; - - test_msg.stec_sat_list[12].stec_coeff[2] = 20603; - - test_msg.stec_sat_list[12].stec_coeff[3] = -3023; - test_msg.stec_sat_list[12].stec_quality_indicator = 216; - test_msg.stec_sat_list[12].sv_id.constellation = 84; - test_msg.stec_sat_list[12].sv_id.satId = 202; - - - test_msg.stec_sat_list[13].stec_coeff[0] = -6492; - - test_msg.stec_sat_list[13].stec_coeff[1] = 16952; - - test_msg.stec_sat_list[13].stec_coeff[2] = -22404; - - test_msg.stec_sat_list[13].stec_coeff[3] = -29893; - test_msg.stec_sat_list[13].stec_quality_indicator = 125; - test_msg.stec_sat_list[13].sv_id.constellation = 188; - test_msg.stec_sat_list[13].sv_id.satId = 224; - - - test_msg.stec_sat_list[14].stec_coeff[0] = -10053; - - test_msg.stec_sat_list[14].stec_coeff[1] = -24897; - - test_msg.stec_sat_list[14].stec_coeff[2] = 23629; - - test_msg.stec_sat_list[14].stec_coeff[3] = -710; - test_msg.stec_sat_list[14].stec_quality_indicator = 51; - test_msg.stec_sat_list[14].sv_id.constellation = 118; - test_msg.stec_sat_list[14].sv_id.satId = 106; - - - test_msg.stec_sat_list[15].stec_coeff[0] = -26103; - - test_msg.stec_sat_list[15].stec_coeff[1] = -9539; - - test_msg.stec_sat_list[15].stec_coeff[2] = -11971; - - test_msg.stec_sat_list[15].stec_coeff[3] = 20993; - test_msg.stec_sat_list[15].stec_quality_indicator = 165; - test_msg.stec_sat_list[15].sv_id.constellation = 150; - test_msg.stec_sat_list[15].sv_id.satId = 132; - - - test_msg.stec_sat_list[16].stec_coeff[0] = -18891; - - test_msg.stec_sat_list[16].stec_coeff[1] = -16272; - - test_msg.stec_sat_list[16].stec_coeff[2] = -22578; - - test_msg.stec_sat_list[16].stec_coeff[3] = -2915; - test_msg.stec_sat_list[16].stec_quality_indicator = 23; - test_msg.stec_sat_list[16].sv_id.constellation = 196; - test_msg.stec_sat_list[16].sv_id.satId = 181; - - - test_msg.stec_sat_list[17].stec_coeff[0] = 15833; - - test_msg.stec_sat_list[17].stec_coeff[1] = 24920; - - test_msg.stec_sat_list[17].stec_coeff[2] = -13879; - - test_msg.stec_sat_list[17].stec_coeff[3] = -1206; - test_msg.stec_sat_list[17].stec_quality_indicator = 189; - test_msg.stec_sat_list[17].sv_id.constellation = 1; - test_msg.stec_sat_list[17].sv_id.satId = 35; - - - test_msg.stec_sat_list[18].stec_coeff[0] = 14008; - - test_msg.stec_sat_list[18].stec_coeff[1] = 18996; - - test_msg.stec_sat_list[18].stec_coeff[2] = 2798; - - test_msg.stec_sat_list[18].stec_coeff[3] = 5761; - test_msg.stec_sat_list[18].stec_quality_indicator = 104; - test_msg.stec_sat_list[18].sv_id.constellation = 14; - test_msg.stec_sat_list[18].sv_id.satId = 217; - - - test_msg.stec_sat_list[19].stec_coeff[0] = -25256; - - test_msg.stec_sat_list[19].stec_coeff[1] = -15330; - - test_msg.stec_sat_list[19].stec_coeff[2] = 6831; - - test_msg.stec_sat_list[19].stec_coeff[3] = 8780; - test_msg.stec_sat_list[19].stec_quality_indicator = 109; - test_msg.stec_sat_list[19].sv_id.constellation = 226; - test_msg.stec_sat_list[19].sv_id.satId = 178; - - - test_msg.stec_sat_list[20].stec_coeff[0] = 3304; - - test_msg.stec_sat_list[20].stec_coeff[1] = -2893; - - test_msg.stec_sat_list[20].stec_coeff[2] = -25841; - - test_msg.stec_sat_list[20].stec_coeff[3] = -13628; - test_msg.stec_sat_list[20].stec_quality_indicator = 154; - test_msg.stec_sat_list[20].sv_id.constellation = 220; - test_msg.stec_sat_list[20].sv_id.satId = 116; - - - test_msg.stec_sat_list[21].stec_coeff[0] = -10742; - - test_msg.stec_sat_list[21].stec_coeff[1] = 10098; - - test_msg.stec_sat_list[21].stec_coeff[2] = 7413; - - test_msg.stec_sat_list[21].stec_coeff[3] = 17645; - test_msg.stec_sat_list[21].stec_quality_indicator = 115; - test_msg.stec_sat_list[21].sv_id.constellation = 70; - test_msg.stec_sat_list[21].sv_id.satId = 72; - - EXPECT_EQ(send_message( 1831, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1831); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.header.iod_atmo, 4) << "incorrect value for last_msg_.header.iod_atmo, expected 4, is " << last_msg_.header.iod_atmo; - EXPECT_EQ(last_msg_.header.num_msgs, 147) << "incorrect value for last_msg_.header.num_msgs, expected 147, is " << last_msg_.header.num_msgs; - EXPECT_EQ(last_msg_.header.seq_num, 123) << "incorrect value for last_msg_.header.seq_num, expected 123, is " << last_msg_.header.seq_num; - EXPECT_EQ(last_msg_.header.time.tow, 3905179974) << "incorrect value for last_msg_.header.time.tow, expected 3905179974, is " << last_msg_.header.time.tow; - EXPECT_EQ(last_msg_.header.time.wn, 11193) << "incorrect value for last_msg_.header.time.wn, expected 11193, is " << last_msg_.header.time.wn; - EXPECT_EQ(last_msg_.header.update_interval, 39) << "incorrect value for last_msg_.header.update_interval, expected 39, is " << last_msg_.header.update_interval; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_stec_sat_list.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_stec_sat_list.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_stec_sat_list.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)101,(char)99,(char)95,(char)115,(char)97,(char)116,(char)95,(char)108,(char)105,(char)115,(char)116 }; - EXPECT_EQ(memcmp(last_msg_.n_stec_sat_list.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_stec_sat_list.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_stec_sat_list.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_stec_sat_list.value, 22) << "incorrect value for last_msg_.n_stec_sat_list.value, expected 22, is " << last_msg_.n_stec_sat_list.value; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[0], -1951) << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[0], expected -1951, is " << last_msg_.stec_sat_list[0].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[1], -9854) << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[1], expected -9854, is " << last_msg_.stec_sat_list[0].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[2], 27353) << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[2], expected 27353, is " << last_msg_.stec_sat_list[0].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[3], 3130) << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[3], expected 3130, is " << last_msg_.stec_sat_list[0].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[0].stec_quality_indicator, 111) << "incorrect value for last_msg_.stec_sat_list[0].stec_quality_indicator, expected 111, is " << last_msg_.stec_sat_list[0].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[0].sv_id.constellation, 19) << "incorrect value for last_msg_.stec_sat_list[0].sv_id.constellation, expected 19, is " << last_msg_.stec_sat_list[0].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[0].sv_id.satId, 126) << "incorrect value for last_msg_.stec_sat_list[0].sv_id.satId, expected 126, is " << last_msg_.stec_sat_list[0].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[0], 24401) << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[0], expected 24401, is " << last_msg_.stec_sat_list[1].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[1], 4182) << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[1], expected 4182, is " << last_msg_.stec_sat_list[1].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[2], 21543) << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[2], expected 21543, is " << last_msg_.stec_sat_list[1].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[3], -12060) << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[3], expected -12060, is " << last_msg_.stec_sat_list[1].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[1].stec_quality_indicator, 171) << "incorrect value for last_msg_.stec_sat_list[1].stec_quality_indicator, expected 171, is " << last_msg_.stec_sat_list[1].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[1].sv_id.constellation, 230) << "incorrect value for last_msg_.stec_sat_list[1].sv_id.constellation, expected 230, is " << last_msg_.stec_sat_list[1].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[1].sv_id.satId, 65) << "incorrect value for last_msg_.stec_sat_list[1].sv_id.satId, expected 65, is " << last_msg_.stec_sat_list[1].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[0], -13469) << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[0], expected -13469, is " << last_msg_.stec_sat_list[2].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[1], -18883) << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[1], expected -18883, is " << last_msg_.stec_sat_list[2].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[2], 32066) << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[2], expected 32066, is " << last_msg_.stec_sat_list[2].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[3], 971) << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[3], expected 971, is " << last_msg_.stec_sat_list[2].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[2].stec_quality_indicator, 219) << "incorrect value for last_msg_.stec_sat_list[2].stec_quality_indicator, expected 219, is " << last_msg_.stec_sat_list[2].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[2].sv_id.constellation, 81) << "incorrect value for last_msg_.stec_sat_list[2].sv_id.constellation, expected 81, is " << last_msg_.stec_sat_list[2].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[2].sv_id.satId, 201) << "incorrect value for last_msg_.stec_sat_list[2].sv_id.satId, expected 201, is " << last_msg_.stec_sat_list[2].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[0], 32220) << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[0], expected 32220, is " << last_msg_.stec_sat_list[3].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[1], 5436) << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[1], expected 5436, is " << last_msg_.stec_sat_list[3].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[2], -9635) << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[2], expected -9635, is " << last_msg_.stec_sat_list[3].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[3], -24841) << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[3], expected -24841, is " << last_msg_.stec_sat_list[3].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[3].stec_quality_indicator, 100) << "incorrect value for last_msg_.stec_sat_list[3].stec_quality_indicator, expected 100, is " << last_msg_.stec_sat_list[3].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[3].sv_id.constellation, 44) << "incorrect value for last_msg_.stec_sat_list[3].sv_id.constellation, expected 44, is " << last_msg_.stec_sat_list[3].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[3].sv_id.satId, 193) << "incorrect value for last_msg_.stec_sat_list[3].sv_id.satId, expected 193, is " << last_msg_.stec_sat_list[3].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[0], 3718) << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[0], expected 3718, is " << last_msg_.stec_sat_list[4].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[1], 12497) << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[1], expected 12497, is " << last_msg_.stec_sat_list[4].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[2], -10482) << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[2], expected -10482, is " << last_msg_.stec_sat_list[4].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[3], -27495) << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[3], expected -27495, is " << last_msg_.stec_sat_list[4].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[4].stec_quality_indicator, 129) << "incorrect value for last_msg_.stec_sat_list[4].stec_quality_indicator, expected 129, is " << last_msg_.stec_sat_list[4].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[4].sv_id.constellation, 93) << "incorrect value for last_msg_.stec_sat_list[4].sv_id.constellation, expected 93, is " << last_msg_.stec_sat_list[4].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[4].sv_id.satId, 207) << "incorrect value for last_msg_.stec_sat_list[4].sv_id.satId, expected 207, is " << last_msg_.stec_sat_list[4].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[0], -4940) << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[0], expected -4940, is " << last_msg_.stec_sat_list[5].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[1], -13875) << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[1], expected -13875, is " << last_msg_.stec_sat_list[5].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[2], 801) << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[2], expected 801, is " << last_msg_.stec_sat_list[5].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[3], -13066) << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[3], expected -13066, is " << last_msg_.stec_sat_list[5].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[5].stec_quality_indicator, 225) << "incorrect value for last_msg_.stec_sat_list[5].stec_quality_indicator, expected 225, is " << last_msg_.stec_sat_list[5].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[5].sv_id.constellation, 72) << "incorrect value for last_msg_.stec_sat_list[5].sv_id.constellation, expected 72, is " << last_msg_.stec_sat_list[5].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[5].sv_id.satId, 147) << "incorrect value for last_msg_.stec_sat_list[5].sv_id.satId, expected 147, is " << last_msg_.stec_sat_list[5].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[0], -15868) << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[0], expected -15868, is " << last_msg_.stec_sat_list[6].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[1], -2369) << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[1], expected -2369, is " << last_msg_.stec_sat_list[6].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[2], -9396) << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[2], expected -9396, is " << last_msg_.stec_sat_list[6].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[3], -16609) << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[3], expected -16609, is " << last_msg_.stec_sat_list[6].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[6].stec_quality_indicator, 98) << "incorrect value for last_msg_.stec_sat_list[6].stec_quality_indicator, expected 98, is " << last_msg_.stec_sat_list[6].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[6].sv_id.constellation, 3) << "incorrect value for last_msg_.stec_sat_list[6].sv_id.constellation, expected 3, is " << last_msg_.stec_sat_list[6].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[6].sv_id.satId, 19) << "incorrect value for last_msg_.stec_sat_list[6].sv_id.satId, expected 19, is " << last_msg_.stec_sat_list[6].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[0], -1265) << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[0], expected -1265, is " << last_msg_.stec_sat_list[7].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[1], 4897) << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[1], expected 4897, is " << last_msg_.stec_sat_list[7].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[2], 13920) << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[2], expected 13920, is " << last_msg_.stec_sat_list[7].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[3], -28102) << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[3], expected -28102, is " << last_msg_.stec_sat_list[7].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[7].stec_quality_indicator, 177) << "incorrect value for last_msg_.stec_sat_list[7].stec_quality_indicator, expected 177, is " << last_msg_.stec_sat_list[7].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[7].sv_id.constellation, 79) << "incorrect value for last_msg_.stec_sat_list[7].sv_id.constellation, expected 79, is " << last_msg_.stec_sat_list[7].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[7].sv_id.satId, 113) << "incorrect value for last_msg_.stec_sat_list[7].sv_id.satId, expected 113, is " << last_msg_.stec_sat_list[7].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[0], 5448) << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[0], expected 5448, is " << last_msg_.stec_sat_list[8].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[1], -11359) << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[1], expected -11359, is " << last_msg_.stec_sat_list[8].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[2], 5574) << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[2], expected 5574, is " << last_msg_.stec_sat_list[8].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[3], 28654) << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[3], expected 28654, is " << last_msg_.stec_sat_list[8].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[8].stec_quality_indicator, 249) << "incorrect value for last_msg_.stec_sat_list[8].stec_quality_indicator, expected 249, is " << last_msg_.stec_sat_list[8].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[8].sv_id.constellation, 100) << "incorrect value for last_msg_.stec_sat_list[8].sv_id.constellation, expected 100, is " << last_msg_.stec_sat_list[8].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[8].sv_id.satId, 210) << "incorrect value for last_msg_.stec_sat_list[8].sv_id.satId, expected 210, is " << last_msg_.stec_sat_list[8].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[0], -10783) << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[0], expected -10783, is " << last_msg_.stec_sat_list[9].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[1], 18179) << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[1], expected 18179, is " << last_msg_.stec_sat_list[9].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[2], 16371) << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[2], expected 16371, is " << last_msg_.stec_sat_list[9].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[3], -5055) << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[3], expected -5055, is " << last_msg_.stec_sat_list[9].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[9].stec_quality_indicator, 227) << "incorrect value for last_msg_.stec_sat_list[9].stec_quality_indicator, expected 227, is " << last_msg_.stec_sat_list[9].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[9].sv_id.constellation, 36) << "incorrect value for last_msg_.stec_sat_list[9].sv_id.constellation, expected 36, is " << last_msg_.stec_sat_list[9].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[9].sv_id.satId, 107) << "incorrect value for last_msg_.stec_sat_list[9].sv_id.satId, expected 107, is " << last_msg_.stec_sat_list[9].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[0], 4009) << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[0], expected 4009, is " << last_msg_.stec_sat_list[10].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[1], 1462) << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[1], expected 1462, is " << last_msg_.stec_sat_list[10].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[2], -19216) << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[2], expected -19216, is " << last_msg_.stec_sat_list[10].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[3], 31241) << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[3], expected 31241, is " << last_msg_.stec_sat_list[10].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[10].stec_quality_indicator, 0) << "incorrect value for last_msg_.stec_sat_list[10].stec_quality_indicator, expected 0, is " << last_msg_.stec_sat_list[10].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[10].sv_id.constellation, 77) << "incorrect value for last_msg_.stec_sat_list[10].sv_id.constellation, expected 77, is " << last_msg_.stec_sat_list[10].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[10].sv_id.satId, 92) << "incorrect value for last_msg_.stec_sat_list[10].sv_id.satId, expected 92, is " << last_msg_.stec_sat_list[10].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[0], 26727) << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[0], expected 26727, is " << last_msg_.stec_sat_list[11].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[1], -16898) << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[1], expected -16898, is " << last_msg_.stec_sat_list[11].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[2], 28241) << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[2], expected 28241, is " << last_msg_.stec_sat_list[11].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[3], 12546) << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[3], expected 12546, is " << last_msg_.stec_sat_list[11].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[11].stec_quality_indicator, 6) << "incorrect value for last_msg_.stec_sat_list[11].stec_quality_indicator, expected 6, is " << last_msg_.stec_sat_list[11].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[11].sv_id.constellation, 232) << "incorrect value for last_msg_.stec_sat_list[11].sv_id.constellation, expected 232, is " << last_msg_.stec_sat_list[11].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[11].sv_id.satId, 86) << "incorrect value for last_msg_.stec_sat_list[11].sv_id.satId, expected 86, is " << last_msg_.stec_sat_list[11].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[0], 12855) << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[0], expected 12855, is " << last_msg_.stec_sat_list[12].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[1], 1461) << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[1], expected 1461, is " << last_msg_.stec_sat_list[12].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[2], 20603) << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[2], expected 20603, is " << last_msg_.stec_sat_list[12].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[3], -3023) << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[3], expected -3023, is " << last_msg_.stec_sat_list[12].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[12].stec_quality_indicator, 216) << "incorrect value for last_msg_.stec_sat_list[12].stec_quality_indicator, expected 216, is " << last_msg_.stec_sat_list[12].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[12].sv_id.constellation, 84) << "incorrect value for last_msg_.stec_sat_list[12].sv_id.constellation, expected 84, is " << last_msg_.stec_sat_list[12].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[12].sv_id.satId, 202) << "incorrect value for last_msg_.stec_sat_list[12].sv_id.satId, expected 202, is " << last_msg_.stec_sat_list[12].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[0], -6492) << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[0], expected -6492, is " << last_msg_.stec_sat_list[13].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[1], 16952) << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[1], expected 16952, is " << last_msg_.stec_sat_list[13].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[2], -22404) << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[2], expected -22404, is " << last_msg_.stec_sat_list[13].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[3], -29893) << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[3], expected -29893, is " << last_msg_.stec_sat_list[13].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[13].stec_quality_indicator, 125) << "incorrect value for last_msg_.stec_sat_list[13].stec_quality_indicator, expected 125, is " << last_msg_.stec_sat_list[13].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[13].sv_id.constellation, 188) << "incorrect value for last_msg_.stec_sat_list[13].sv_id.constellation, expected 188, is " << last_msg_.stec_sat_list[13].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[13].sv_id.satId, 224) << "incorrect value for last_msg_.stec_sat_list[13].sv_id.satId, expected 224, is " << last_msg_.stec_sat_list[13].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[0], -10053) << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[0], expected -10053, is " << last_msg_.stec_sat_list[14].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[1], -24897) << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[1], expected -24897, is " << last_msg_.stec_sat_list[14].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[2], 23629) << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[2], expected 23629, is " << last_msg_.stec_sat_list[14].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[3], -710) << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[3], expected -710, is " << last_msg_.stec_sat_list[14].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[14].stec_quality_indicator, 51) << "incorrect value for last_msg_.stec_sat_list[14].stec_quality_indicator, expected 51, is " << last_msg_.stec_sat_list[14].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[14].sv_id.constellation, 118) << "incorrect value for last_msg_.stec_sat_list[14].sv_id.constellation, expected 118, is " << last_msg_.stec_sat_list[14].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[14].sv_id.satId, 106) << "incorrect value for last_msg_.stec_sat_list[14].sv_id.satId, expected 106, is " << last_msg_.stec_sat_list[14].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[0], -26103) << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[0], expected -26103, is " << last_msg_.stec_sat_list[15].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[1], -9539) << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[1], expected -9539, is " << last_msg_.stec_sat_list[15].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[2], -11971) << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[2], expected -11971, is " << last_msg_.stec_sat_list[15].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[3], 20993) << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[3], expected 20993, is " << last_msg_.stec_sat_list[15].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[15].stec_quality_indicator, 165) << "incorrect value for last_msg_.stec_sat_list[15].stec_quality_indicator, expected 165, is " << last_msg_.stec_sat_list[15].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[15].sv_id.constellation, 150) << "incorrect value for last_msg_.stec_sat_list[15].sv_id.constellation, expected 150, is " << last_msg_.stec_sat_list[15].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[15].sv_id.satId, 132) << "incorrect value for last_msg_.stec_sat_list[15].sv_id.satId, expected 132, is " << last_msg_.stec_sat_list[15].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[0], -18891) << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[0], expected -18891, is " << last_msg_.stec_sat_list[16].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[1], -16272) << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[1], expected -16272, is " << last_msg_.stec_sat_list[16].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[2], -22578) << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[2], expected -22578, is " << last_msg_.stec_sat_list[16].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[3], -2915) << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[3], expected -2915, is " << last_msg_.stec_sat_list[16].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[16].stec_quality_indicator, 23) << "incorrect value for last_msg_.stec_sat_list[16].stec_quality_indicator, expected 23, is " << last_msg_.stec_sat_list[16].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[16].sv_id.constellation, 196) << "incorrect value for last_msg_.stec_sat_list[16].sv_id.constellation, expected 196, is " << last_msg_.stec_sat_list[16].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[16].sv_id.satId, 181) << "incorrect value for last_msg_.stec_sat_list[16].sv_id.satId, expected 181, is " << last_msg_.stec_sat_list[16].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[0], 15833) << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[0], expected 15833, is " << last_msg_.stec_sat_list[17].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[1], 24920) << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[1], expected 24920, is " << last_msg_.stec_sat_list[17].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[2], -13879) << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[2], expected -13879, is " << last_msg_.stec_sat_list[17].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[3], -1206) << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[3], expected -1206, is " << last_msg_.stec_sat_list[17].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[17].stec_quality_indicator, 189) << "incorrect value for last_msg_.stec_sat_list[17].stec_quality_indicator, expected 189, is " << last_msg_.stec_sat_list[17].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[17].sv_id.constellation, 1) << "incorrect value for last_msg_.stec_sat_list[17].sv_id.constellation, expected 1, is " << last_msg_.stec_sat_list[17].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[17].sv_id.satId, 35) << "incorrect value for last_msg_.stec_sat_list[17].sv_id.satId, expected 35, is " << last_msg_.stec_sat_list[17].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[0], 14008) << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[0], expected 14008, is " << last_msg_.stec_sat_list[18].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[1], 18996) << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[1], expected 18996, is " << last_msg_.stec_sat_list[18].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[2], 2798) << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[2], expected 2798, is " << last_msg_.stec_sat_list[18].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[3], 5761) << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[3], expected 5761, is " << last_msg_.stec_sat_list[18].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[18].stec_quality_indicator, 104) << "incorrect value for last_msg_.stec_sat_list[18].stec_quality_indicator, expected 104, is " << last_msg_.stec_sat_list[18].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[18].sv_id.constellation, 14) << "incorrect value for last_msg_.stec_sat_list[18].sv_id.constellation, expected 14, is " << last_msg_.stec_sat_list[18].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[18].sv_id.satId, 217) << "incorrect value for last_msg_.stec_sat_list[18].sv_id.satId, expected 217, is " << last_msg_.stec_sat_list[18].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[0], -25256) << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[0], expected -25256, is " << last_msg_.stec_sat_list[19].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[1], -15330) << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[1], expected -15330, is " << last_msg_.stec_sat_list[19].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[2], 6831) << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[2], expected 6831, is " << last_msg_.stec_sat_list[19].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[3], 8780) << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[3], expected 8780, is " << last_msg_.stec_sat_list[19].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[19].stec_quality_indicator, 109) << "incorrect value for last_msg_.stec_sat_list[19].stec_quality_indicator, expected 109, is " << last_msg_.stec_sat_list[19].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[19].sv_id.constellation, 226) << "incorrect value for last_msg_.stec_sat_list[19].sv_id.constellation, expected 226, is " << last_msg_.stec_sat_list[19].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[19].sv_id.satId, 178) << "incorrect value for last_msg_.stec_sat_list[19].sv_id.satId, expected 178, is " << last_msg_.stec_sat_list[19].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[0], 3304) << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[0], expected 3304, is " << last_msg_.stec_sat_list[20].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[1], -2893) << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[1], expected -2893, is " << last_msg_.stec_sat_list[20].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[2], -25841) << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[2], expected -25841, is " << last_msg_.stec_sat_list[20].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[3], -13628) << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[3], expected -13628, is " << last_msg_.stec_sat_list[20].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[20].stec_quality_indicator, 154) << "incorrect value for last_msg_.stec_sat_list[20].stec_quality_indicator, expected 154, is " << last_msg_.stec_sat_list[20].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[20].sv_id.constellation, 220) << "incorrect value for last_msg_.stec_sat_list[20].sv_id.constellation, expected 220, is " << last_msg_.stec_sat_list[20].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[20].sv_id.satId, 116) << "incorrect value for last_msg_.stec_sat_list[20].sv_id.satId, expected 116, is " << last_msg_.stec_sat_list[20].sv_id.satId; - EXPECT_EQ(last_msg_.stec_sat_list[21].stec_coeff[0], -10742) << "incorrect value for last_msg_.stec_sat_list[21].stec_coeff[0], expected -10742, is " << last_msg_.stec_sat_list[21].stec_coeff[0]; - EXPECT_EQ(last_msg_.stec_sat_list[21].stec_coeff[1], 10098) << "incorrect value for last_msg_.stec_sat_list[21].stec_coeff[1], expected 10098, is " << last_msg_.stec_sat_list[21].stec_coeff[1]; - EXPECT_EQ(last_msg_.stec_sat_list[21].stec_coeff[2], 7413) << "incorrect value for last_msg_.stec_sat_list[21].stec_coeff[2], expected 7413, is " << last_msg_.stec_sat_list[21].stec_coeff[2]; - EXPECT_EQ(last_msg_.stec_sat_list[21].stec_coeff[3], 17645) << "incorrect value for last_msg_.stec_sat_list[21].stec_coeff[3], expected 17645, is " << last_msg_.stec_sat_list[21].stec_coeff[3]; - EXPECT_EQ(last_msg_.stec_sat_list[21].stec_quality_indicator, 115) << "incorrect value for last_msg_.stec_sat_list[21].stec_quality_indicator, expected 115, is " << last_msg_.stec_sat_list[21].stec_quality_indicator; - EXPECT_EQ(last_msg_.stec_sat_list[21].sv_id.constellation, 70) << "incorrect value for last_msg_.stec_sat_list[21].sv_id.constellation, expected 70, is " << last_msg_.stec_sat_list[21].sv_id.constellation; - EXPECT_EQ(last_msg_.stec_sat_list[21].sv_id.satId, 72) << "incorrect value for last_msg_.stec_sat_list[21].sv_id.satId, expected 72, is " << last_msg_.stec_sat_list[21].sv_id.satId; +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 235, 5, 39, 7, 252, 70, 81, 196, 232, 185, 43, 147, 123, 39, + 4, 126, 19, 111, 97, 248, 130, 217, 217, 106, 58, 12, 65, 230, 171, + 81, 95, 86, 16, 39, 84, 228, 208, 201, 81, 219, 99, 203, 61, 182, + 66, 125, 203, 3, 193, 44, 100, 220, 125, 60, 21, 93, 218, 247, 158, + 207, 93, 129, 134, 14, 209, 48, 14, 215, 153, 148, 147, 72, 225, 180, + 236, 205, 201, 33, 3, 246, 204, 19, 3, 98, 4, 194, 191, 246, 76, + 219, 31, 191, 113, 79, 177, 15, 251, 33, 19, 96, 54, 58, 146, 210, + 100, 249, 72, 21, 161, 211, 198, 21, 238, 111, 107, 36, 227, 225, 213, + 3, 71, 243, 63, 65, 236, 92, 77, 0, 169, 15, 182, 5, 240, 180, + 9, 122, 86, 232, 6, 103, 104, 254, 189, 81, 110, 2, 49, 202, 84, + 216, 55, 50, 181, 5, 123, 80, 49, 244, 224, 188, 125, 164, 230, 56, + 66, 124, 168, 59, 139, 106, 118, 51, 187, 216, 191, 158, 77, 92, 58, + 253, 132, 150, 165, 9, 154, 189, 218, 61, 209, 1, 82, 181, 196, 23, + 53, 182, 112, 192, 206, 167, 157, 244, 35, 1, 189, 217, 61, 88, 97, + 201, 201, 74, 251, 217, 14, 104, 184, 54, 52, 74, 238, 10, 129, 22, + 178, 226, 109, 88, 157, 30, 196, 175, 26, 76, 34, 116, 220, 154, 232, + 12, 179, 244, 15, 155, 196, 202, 72, 70, 115, 10, 214, 114, 39, 245, + 28, 237, 68, 136, 155, + }; + + sbp_msg_ssr_stec_correction_dep_a_t test_msg{}; + test_msg.header.iod_atmo = 4; + test_msg.header.num_msgs = 147; + test_msg.header.seq_num = 123; + test_msg.header.time.tow = 3905179974; + test_msg.header.time.wn = 11193; + test_msg.header.update_interval = 39; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_stec_sat_list.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)101, (char)99, + (char)95, (char)115, (char)97, (char)116, + (char)95, (char)108, (char)105, (char)115, + (char)116}; + memcpy(test_msg.n_stec_sat_list.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_stec_sat_list.value = 22; + + test_msg.stec_sat_list[0].stec_coeff[0] = -1951; + + test_msg.stec_sat_list[0].stec_coeff[1] = -9854; + + test_msg.stec_sat_list[0].stec_coeff[2] = 27353; + + test_msg.stec_sat_list[0].stec_coeff[3] = 3130; + test_msg.stec_sat_list[0].stec_quality_indicator = 111; + test_msg.stec_sat_list[0].sv_id.constellation = 19; + test_msg.stec_sat_list[0].sv_id.satId = 126; + + test_msg.stec_sat_list[1].stec_coeff[0] = 24401; + + test_msg.stec_sat_list[1].stec_coeff[1] = 4182; + + test_msg.stec_sat_list[1].stec_coeff[2] = 21543; + + test_msg.stec_sat_list[1].stec_coeff[3] = -12060; + test_msg.stec_sat_list[1].stec_quality_indicator = 171; + test_msg.stec_sat_list[1].sv_id.constellation = 230; + test_msg.stec_sat_list[1].sv_id.satId = 65; + + test_msg.stec_sat_list[2].stec_coeff[0] = -13469; + + test_msg.stec_sat_list[2].stec_coeff[1] = -18883; + + test_msg.stec_sat_list[2].stec_coeff[2] = 32066; + + test_msg.stec_sat_list[2].stec_coeff[3] = 971; + test_msg.stec_sat_list[2].stec_quality_indicator = 219; + test_msg.stec_sat_list[2].sv_id.constellation = 81; + test_msg.stec_sat_list[2].sv_id.satId = 201; + + test_msg.stec_sat_list[3].stec_coeff[0] = 32220; + + test_msg.stec_sat_list[3].stec_coeff[1] = 5436; + + test_msg.stec_sat_list[3].stec_coeff[2] = -9635; + + test_msg.stec_sat_list[3].stec_coeff[3] = -24841; + test_msg.stec_sat_list[3].stec_quality_indicator = 100; + test_msg.stec_sat_list[3].sv_id.constellation = 44; + test_msg.stec_sat_list[3].sv_id.satId = 193; + + test_msg.stec_sat_list[4].stec_coeff[0] = 3718; + + test_msg.stec_sat_list[4].stec_coeff[1] = 12497; + + test_msg.stec_sat_list[4].stec_coeff[2] = -10482; + + test_msg.stec_sat_list[4].stec_coeff[3] = -27495; + test_msg.stec_sat_list[4].stec_quality_indicator = 129; + test_msg.stec_sat_list[4].sv_id.constellation = 93; + test_msg.stec_sat_list[4].sv_id.satId = 207; + + test_msg.stec_sat_list[5].stec_coeff[0] = -4940; + + test_msg.stec_sat_list[5].stec_coeff[1] = -13875; + + test_msg.stec_sat_list[5].stec_coeff[2] = 801; + + test_msg.stec_sat_list[5].stec_coeff[3] = -13066; + test_msg.stec_sat_list[5].stec_quality_indicator = 225; + test_msg.stec_sat_list[5].sv_id.constellation = 72; + test_msg.stec_sat_list[5].sv_id.satId = 147; + + test_msg.stec_sat_list[6].stec_coeff[0] = -15868; + + test_msg.stec_sat_list[6].stec_coeff[1] = -2369; + + test_msg.stec_sat_list[6].stec_coeff[2] = -9396; + + test_msg.stec_sat_list[6].stec_coeff[3] = -16609; + test_msg.stec_sat_list[6].stec_quality_indicator = 98; + test_msg.stec_sat_list[6].sv_id.constellation = 3; + test_msg.stec_sat_list[6].sv_id.satId = 19; + + test_msg.stec_sat_list[7].stec_coeff[0] = -1265; + + test_msg.stec_sat_list[7].stec_coeff[1] = 4897; + + test_msg.stec_sat_list[7].stec_coeff[2] = 13920; + + test_msg.stec_sat_list[7].stec_coeff[3] = -28102; + test_msg.stec_sat_list[7].stec_quality_indicator = 177; + test_msg.stec_sat_list[7].sv_id.constellation = 79; + test_msg.stec_sat_list[7].sv_id.satId = 113; + + test_msg.stec_sat_list[8].stec_coeff[0] = 5448; + + test_msg.stec_sat_list[8].stec_coeff[1] = -11359; + + test_msg.stec_sat_list[8].stec_coeff[2] = 5574; + + test_msg.stec_sat_list[8].stec_coeff[3] = 28654; + test_msg.stec_sat_list[8].stec_quality_indicator = 249; + test_msg.stec_sat_list[8].sv_id.constellation = 100; + test_msg.stec_sat_list[8].sv_id.satId = 210; + + test_msg.stec_sat_list[9].stec_coeff[0] = -10783; + + test_msg.stec_sat_list[9].stec_coeff[1] = 18179; + + test_msg.stec_sat_list[9].stec_coeff[2] = 16371; + + test_msg.stec_sat_list[9].stec_coeff[3] = -5055; + test_msg.stec_sat_list[9].stec_quality_indicator = 227; + test_msg.stec_sat_list[9].sv_id.constellation = 36; + test_msg.stec_sat_list[9].sv_id.satId = 107; + + test_msg.stec_sat_list[10].stec_coeff[0] = 4009; + + test_msg.stec_sat_list[10].stec_coeff[1] = 1462; + + test_msg.stec_sat_list[10].stec_coeff[2] = -19216; + + test_msg.stec_sat_list[10].stec_coeff[3] = 31241; + test_msg.stec_sat_list[10].stec_quality_indicator = 0; + test_msg.stec_sat_list[10].sv_id.constellation = 77; + test_msg.stec_sat_list[10].sv_id.satId = 92; + + test_msg.stec_sat_list[11].stec_coeff[0] = 26727; + + test_msg.stec_sat_list[11].stec_coeff[1] = -16898; + + test_msg.stec_sat_list[11].stec_coeff[2] = 28241; + + test_msg.stec_sat_list[11].stec_coeff[3] = 12546; + test_msg.stec_sat_list[11].stec_quality_indicator = 6; + test_msg.stec_sat_list[11].sv_id.constellation = 232; + test_msg.stec_sat_list[11].sv_id.satId = 86; + + test_msg.stec_sat_list[12].stec_coeff[0] = 12855; + + test_msg.stec_sat_list[12].stec_coeff[1] = 1461; + + test_msg.stec_sat_list[12].stec_coeff[2] = 20603; + + test_msg.stec_sat_list[12].stec_coeff[3] = -3023; + test_msg.stec_sat_list[12].stec_quality_indicator = 216; + test_msg.stec_sat_list[12].sv_id.constellation = 84; + test_msg.stec_sat_list[12].sv_id.satId = 202; + + test_msg.stec_sat_list[13].stec_coeff[0] = -6492; + + test_msg.stec_sat_list[13].stec_coeff[1] = 16952; + + test_msg.stec_sat_list[13].stec_coeff[2] = -22404; + + test_msg.stec_sat_list[13].stec_coeff[3] = -29893; + test_msg.stec_sat_list[13].stec_quality_indicator = 125; + test_msg.stec_sat_list[13].sv_id.constellation = 188; + test_msg.stec_sat_list[13].sv_id.satId = 224; + + test_msg.stec_sat_list[14].stec_coeff[0] = -10053; + + test_msg.stec_sat_list[14].stec_coeff[1] = -24897; + + test_msg.stec_sat_list[14].stec_coeff[2] = 23629; + + test_msg.stec_sat_list[14].stec_coeff[3] = -710; + test_msg.stec_sat_list[14].stec_quality_indicator = 51; + test_msg.stec_sat_list[14].sv_id.constellation = 118; + test_msg.stec_sat_list[14].sv_id.satId = 106; + + test_msg.stec_sat_list[15].stec_coeff[0] = -26103; + + test_msg.stec_sat_list[15].stec_coeff[1] = -9539; + + test_msg.stec_sat_list[15].stec_coeff[2] = -11971; + + test_msg.stec_sat_list[15].stec_coeff[3] = 20993; + test_msg.stec_sat_list[15].stec_quality_indicator = 165; + test_msg.stec_sat_list[15].sv_id.constellation = 150; + test_msg.stec_sat_list[15].sv_id.satId = 132; + + test_msg.stec_sat_list[16].stec_coeff[0] = -18891; + + test_msg.stec_sat_list[16].stec_coeff[1] = -16272; + + test_msg.stec_sat_list[16].stec_coeff[2] = -22578; + + test_msg.stec_sat_list[16].stec_coeff[3] = -2915; + test_msg.stec_sat_list[16].stec_quality_indicator = 23; + test_msg.stec_sat_list[16].sv_id.constellation = 196; + test_msg.stec_sat_list[16].sv_id.satId = 181; + + test_msg.stec_sat_list[17].stec_coeff[0] = 15833; + + test_msg.stec_sat_list[17].stec_coeff[1] = 24920; + + test_msg.stec_sat_list[17].stec_coeff[2] = -13879; + + test_msg.stec_sat_list[17].stec_coeff[3] = -1206; + test_msg.stec_sat_list[17].stec_quality_indicator = 189; + test_msg.stec_sat_list[17].sv_id.constellation = 1; + test_msg.stec_sat_list[17].sv_id.satId = 35; + + test_msg.stec_sat_list[18].stec_coeff[0] = 14008; + + test_msg.stec_sat_list[18].stec_coeff[1] = 18996; + + test_msg.stec_sat_list[18].stec_coeff[2] = 2798; + + test_msg.stec_sat_list[18].stec_coeff[3] = 5761; + test_msg.stec_sat_list[18].stec_quality_indicator = 104; + test_msg.stec_sat_list[18].sv_id.constellation = 14; + test_msg.stec_sat_list[18].sv_id.satId = 217; + + test_msg.stec_sat_list[19].stec_coeff[0] = -25256; + + test_msg.stec_sat_list[19].stec_coeff[1] = -15330; + + test_msg.stec_sat_list[19].stec_coeff[2] = 6831; + + test_msg.stec_sat_list[19].stec_coeff[3] = 8780; + test_msg.stec_sat_list[19].stec_quality_indicator = 109; + test_msg.stec_sat_list[19].sv_id.constellation = 226; + test_msg.stec_sat_list[19].sv_id.satId = 178; + + test_msg.stec_sat_list[20].stec_coeff[0] = 3304; + + test_msg.stec_sat_list[20].stec_coeff[1] = -2893; + + test_msg.stec_sat_list[20].stec_coeff[2] = -25841; + + test_msg.stec_sat_list[20].stec_coeff[3] = -13628; + test_msg.stec_sat_list[20].stec_quality_indicator = 154; + test_msg.stec_sat_list[20].sv_id.constellation = 220; + test_msg.stec_sat_list[20].sv_id.satId = 116; + + test_msg.stec_sat_list[21].stec_coeff[0] = -10742; + + test_msg.stec_sat_list[21].stec_coeff[1] = 10098; + + test_msg.stec_sat_list[21].stec_coeff[2] = 7413; + + test_msg.stec_sat_list[21].stec_coeff[3] = 17645; + test_msg.stec_sat_list[21].stec_quality_indicator = 115; + test_msg.stec_sat_list[21].sv_id.constellation = 70; + test_msg.stec_sat_list[21].sv_id.satId = 72; + + EXPECT_EQ(send_message(1831, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1831); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.header.iod_atmo, 4) + << "incorrect value for last_msg_.header.iod_atmo, expected 4, is " + << last_msg_.header.iod_atmo; + EXPECT_EQ(last_msg_.header.num_msgs, 147) + << "incorrect value for last_msg_.header.num_msgs, expected 147, is " + << last_msg_.header.num_msgs; + EXPECT_EQ(last_msg_.header.seq_num, 123) + << "incorrect value for last_msg_.header.seq_num, expected 123, is " + << last_msg_.header.seq_num; + EXPECT_EQ(last_msg_.header.time.tow, 3905179974) + << "incorrect value for last_msg_.header.time.tow, expected 3905179974, " + "is " + << last_msg_.header.time.tow; + EXPECT_EQ(last_msg_.header.time.wn, 11193) + << "incorrect value for last_msg_.header.time.wn, expected 11193, is " + << last_msg_.header.time.wn; + EXPECT_EQ(last_msg_.header.update_interval, 39) + << "incorrect value for last_msg_.header.update_interval, expected 39, " + "is " + << last_msg_.header.update_interval; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_stec_sat_list.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_stec_sat_list.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_stec_sat_list.handle_as + << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)101, (char)99, + (char)95, (char)115, (char)97, (char)116, + (char)95, (char)108, (char)105, (char)115, + (char)116}; + EXPECT_EQ(memcmp(last_msg_.n_stec_sat_list.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_stec_sat_list.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_stec_sat_list.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_stec_sat_list.value, 22) + << "incorrect value for last_msg_.n_stec_sat_list.value, expected 22, is " + << last_msg_.n_stec_sat_list.value; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[0], -1951) + << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[0], " + "expected -1951, is " + << last_msg_.stec_sat_list[0].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[1], -9854) + << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[1], " + "expected -9854, is " + << last_msg_.stec_sat_list[0].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[2], 27353) + << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[2], " + "expected 27353, is " + << last_msg_.stec_sat_list[0].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_coeff[3], 3130) + << "incorrect value for last_msg_.stec_sat_list[0].stec_coeff[3], " + "expected 3130, is " + << last_msg_.stec_sat_list[0].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[0].stec_quality_indicator, 111) + << "incorrect value for " + "last_msg_.stec_sat_list[0].stec_quality_indicator, expected 111, is " + << last_msg_.stec_sat_list[0].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[0].sv_id.constellation, 19) + << "incorrect value for last_msg_.stec_sat_list[0].sv_id.constellation, " + "expected 19, is " + << last_msg_.stec_sat_list[0].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[0].sv_id.satId, 126) + << "incorrect value for last_msg_.stec_sat_list[0].sv_id.satId, expected " + "126, is " + << last_msg_.stec_sat_list[0].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[0], 24401) + << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[0], " + "expected 24401, is " + << last_msg_.stec_sat_list[1].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[1], 4182) + << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[1], " + "expected 4182, is " + << last_msg_.stec_sat_list[1].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[2], 21543) + << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[2], " + "expected 21543, is " + << last_msg_.stec_sat_list[1].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_coeff[3], -12060) + << "incorrect value for last_msg_.stec_sat_list[1].stec_coeff[3], " + "expected -12060, is " + << last_msg_.stec_sat_list[1].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[1].stec_quality_indicator, 171) + << "incorrect value for " + "last_msg_.stec_sat_list[1].stec_quality_indicator, expected 171, is " + << last_msg_.stec_sat_list[1].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[1].sv_id.constellation, 230) + << "incorrect value for last_msg_.stec_sat_list[1].sv_id.constellation, " + "expected 230, is " + << last_msg_.stec_sat_list[1].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[1].sv_id.satId, 65) + << "incorrect value for last_msg_.stec_sat_list[1].sv_id.satId, expected " + "65, is " + << last_msg_.stec_sat_list[1].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[0], -13469) + << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[0], " + "expected -13469, is " + << last_msg_.stec_sat_list[2].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[1], -18883) + << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[1], " + "expected -18883, is " + << last_msg_.stec_sat_list[2].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[2], 32066) + << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[2], " + "expected 32066, is " + << last_msg_.stec_sat_list[2].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[2].stec_coeff[3], 971) + << "incorrect value for last_msg_.stec_sat_list[2].stec_coeff[3], " + "expected 971, is " + << last_msg_.stec_sat_list[2].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[2].stec_quality_indicator, 219) + << "incorrect value for " + "last_msg_.stec_sat_list[2].stec_quality_indicator, expected 219, is " + << last_msg_.stec_sat_list[2].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[2].sv_id.constellation, 81) + << "incorrect value for last_msg_.stec_sat_list[2].sv_id.constellation, " + "expected 81, is " + << last_msg_.stec_sat_list[2].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[2].sv_id.satId, 201) + << "incorrect value for last_msg_.stec_sat_list[2].sv_id.satId, expected " + "201, is " + << last_msg_.stec_sat_list[2].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[0], 32220) + << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[0], " + "expected 32220, is " + << last_msg_.stec_sat_list[3].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[1], 5436) + << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[1], " + "expected 5436, is " + << last_msg_.stec_sat_list[3].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[2], -9635) + << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[2], " + "expected -9635, is " + << last_msg_.stec_sat_list[3].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[3].stec_coeff[3], -24841) + << "incorrect value for last_msg_.stec_sat_list[3].stec_coeff[3], " + "expected -24841, is " + << last_msg_.stec_sat_list[3].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[3].stec_quality_indicator, 100) + << "incorrect value for " + "last_msg_.stec_sat_list[3].stec_quality_indicator, expected 100, is " + << last_msg_.stec_sat_list[3].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[3].sv_id.constellation, 44) + << "incorrect value for last_msg_.stec_sat_list[3].sv_id.constellation, " + "expected 44, is " + << last_msg_.stec_sat_list[3].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[3].sv_id.satId, 193) + << "incorrect value for last_msg_.stec_sat_list[3].sv_id.satId, expected " + "193, is " + << last_msg_.stec_sat_list[3].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[0], 3718) + << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[0], " + "expected 3718, is " + << last_msg_.stec_sat_list[4].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[1], 12497) + << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[1], " + "expected 12497, is " + << last_msg_.stec_sat_list[4].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[2], -10482) + << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[2], " + "expected -10482, is " + << last_msg_.stec_sat_list[4].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[4].stec_coeff[3], -27495) + << "incorrect value for last_msg_.stec_sat_list[4].stec_coeff[3], " + "expected -27495, is " + << last_msg_.stec_sat_list[4].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[4].stec_quality_indicator, 129) + << "incorrect value for " + "last_msg_.stec_sat_list[4].stec_quality_indicator, expected 129, is " + << last_msg_.stec_sat_list[4].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[4].sv_id.constellation, 93) + << "incorrect value for last_msg_.stec_sat_list[4].sv_id.constellation, " + "expected 93, is " + << last_msg_.stec_sat_list[4].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[4].sv_id.satId, 207) + << "incorrect value for last_msg_.stec_sat_list[4].sv_id.satId, expected " + "207, is " + << last_msg_.stec_sat_list[4].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[0], -4940) + << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[0], " + "expected -4940, is " + << last_msg_.stec_sat_list[5].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[1], -13875) + << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[1], " + "expected -13875, is " + << last_msg_.stec_sat_list[5].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[2], 801) + << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[2], " + "expected 801, is " + << last_msg_.stec_sat_list[5].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[5].stec_coeff[3], -13066) + << "incorrect value for last_msg_.stec_sat_list[5].stec_coeff[3], " + "expected -13066, is " + << last_msg_.stec_sat_list[5].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[5].stec_quality_indicator, 225) + << "incorrect value for " + "last_msg_.stec_sat_list[5].stec_quality_indicator, expected 225, is " + << last_msg_.stec_sat_list[5].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[5].sv_id.constellation, 72) + << "incorrect value for last_msg_.stec_sat_list[5].sv_id.constellation, " + "expected 72, is " + << last_msg_.stec_sat_list[5].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[5].sv_id.satId, 147) + << "incorrect value for last_msg_.stec_sat_list[5].sv_id.satId, expected " + "147, is " + << last_msg_.stec_sat_list[5].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[0], -15868) + << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[0], " + "expected -15868, is " + << last_msg_.stec_sat_list[6].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[1], -2369) + << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[1], " + "expected -2369, is " + << last_msg_.stec_sat_list[6].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[2], -9396) + << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[2], " + "expected -9396, is " + << last_msg_.stec_sat_list[6].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[6].stec_coeff[3], -16609) + << "incorrect value for last_msg_.stec_sat_list[6].stec_coeff[3], " + "expected -16609, is " + << last_msg_.stec_sat_list[6].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[6].stec_quality_indicator, 98) + << "incorrect value for " + "last_msg_.stec_sat_list[6].stec_quality_indicator, expected 98, is " + << last_msg_.stec_sat_list[6].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[6].sv_id.constellation, 3) + << "incorrect value for last_msg_.stec_sat_list[6].sv_id.constellation, " + "expected 3, is " + << last_msg_.stec_sat_list[6].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[6].sv_id.satId, 19) + << "incorrect value for last_msg_.stec_sat_list[6].sv_id.satId, expected " + "19, is " + << last_msg_.stec_sat_list[6].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[0], -1265) + << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[0], " + "expected -1265, is " + << last_msg_.stec_sat_list[7].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[1], 4897) + << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[1], " + "expected 4897, is " + << last_msg_.stec_sat_list[7].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[2], 13920) + << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[2], " + "expected 13920, is " + << last_msg_.stec_sat_list[7].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[7].stec_coeff[3], -28102) + << "incorrect value for last_msg_.stec_sat_list[7].stec_coeff[3], " + "expected -28102, is " + << last_msg_.stec_sat_list[7].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[7].stec_quality_indicator, 177) + << "incorrect value for " + "last_msg_.stec_sat_list[7].stec_quality_indicator, expected 177, is " + << last_msg_.stec_sat_list[7].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[7].sv_id.constellation, 79) + << "incorrect value for last_msg_.stec_sat_list[7].sv_id.constellation, " + "expected 79, is " + << last_msg_.stec_sat_list[7].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[7].sv_id.satId, 113) + << "incorrect value for last_msg_.stec_sat_list[7].sv_id.satId, expected " + "113, is " + << last_msg_.stec_sat_list[7].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[0], 5448) + << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[0], " + "expected 5448, is " + << last_msg_.stec_sat_list[8].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[1], -11359) + << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[1], " + "expected -11359, is " + << last_msg_.stec_sat_list[8].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[2], 5574) + << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[2], " + "expected 5574, is " + << last_msg_.stec_sat_list[8].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[8].stec_coeff[3], 28654) + << "incorrect value for last_msg_.stec_sat_list[8].stec_coeff[3], " + "expected 28654, is " + << last_msg_.stec_sat_list[8].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[8].stec_quality_indicator, 249) + << "incorrect value for " + "last_msg_.stec_sat_list[8].stec_quality_indicator, expected 249, is " + << last_msg_.stec_sat_list[8].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[8].sv_id.constellation, 100) + << "incorrect value for last_msg_.stec_sat_list[8].sv_id.constellation, " + "expected 100, is " + << last_msg_.stec_sat_list[8].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[8].sv_id.satId, 210) + << "incorrect value for last_msg_.stec_sat_list[8].sv_id.satId, expected " + "210, is " + << last_msg_.stec_sat_list[8].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[0], -10783) + << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[0], " + "expected -10783, is " + << last_msg_.stec_sat_list[9].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[1], 18179) + << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[1], " + "expected 18179, is " + << last_msg_.stec_sat_list[9].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[2], 16371) + << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[2], " + "expected 16371, is " + << last_msg_.stec_sat_list[9].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[9].stec_coeff[3], -5055) + << "incorrect value for last_msg_.stec_sat_list[9].stec_coeff[3], " + "expected -5055, is " + << last_msg_.stec_sat_list[9].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[9].stec_quality_indicator, 227) + << "incorrect value for " + "last_msg_.stec_sat_list[9].stec_quality_indicator, expected 227, is " + << last_msg_.stec_sat_list[9].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[9].sv_id.constellation, 36) + << "incorrect value for last_msg_.stec_sat_list[9].sv_id.constellation, " + "expected 36, is " + << last_msg_.stec_sat_list[9].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[9].sv_id.satId, 107) + << "incorrect value for last_msg_.stec_sat_list[9].sv_id.satId, expected " + "107, is " + << last_msg_.stec_sat_list[9].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[0], 4009) + << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[0], " + "expected 4009, is " + << last_msg_.stec_sat_list[10].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[1], 1462) + << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[1], " + "expected 1462, is " + << last_msg_.stec_sat_list[10].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[2], -19216) + << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[2], " + "expected -19216, is " + << last_msg_.stec_sat_list[10].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[10].stec_coeff[3], 31241) + << "incorrect value for last_msg_.stec_sat_list[10].stec_coeff[3], " + "expected 31241, is " + << last_msg_.stec_sat_list[10].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[10].stec_quality_indicator, 0) + << "incorrect value for " + "last_msg_.stec_sat_list[10].stec_quality_indicator, expected 0, is " + << last_msg_.stec_sat_list[10].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[10].sv_id.constellation, 77) + << "incorrect value for last_msg_.stec_sat_list[10].sv_id.constellation, " + "expected 77, is " + << last_msg_.stec_sat_list[10].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[10].sv_id.satId, 92) + << "incorrect value for last_msg_.stec_sat_list[10].sv_id.satId, " + "expected 92, is " + << last_msg_.stec_sat_list[10].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[0], 26727) + << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[0], " + "expected 26727, is " + << last_msg_.stec_sat_list[11].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[1], -16898) + << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[1], " + "expected -16898, is " + << last_msg_.stec_sat_list[11].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[2], 28241) + << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[2], " + "expected 28241, is " + << last_msg_.stec_sat_list[11].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[11].stec_coeff[3], 12546) + << "incorrect value for last_msg_.stec_sat_list[11].stec_coeff[3], " + "expected 12546, is " + << last_msg_.stec_sat_list[11].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[11].stec_quality_indicator, 6) + << "incorrect value for " + "last_msg_.stec_sat_list[11].stec_quality_indicator, expected 6, is " + << last_msg_.stec_sat_list[11].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[11].sv_id.constellation, 232) + << "incorrect value for last_msg_.stec_sat_list[11].sv_id.constellation, " + "expected 232, is " + << last_msg_.stec_sat_list[11].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[11].sv_id.satId, 86) + << "incorrect value for last_msg_.stec_sat_list[11].sv_id.satId, " + "expected 86, is " + << last_msg_.stec_sat_list[11].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[0], 12855) + << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[0], " + "expected 12855, is " + << last_msg_.stec_sat_list[12].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[1], 1461) + << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[1], " + "expected 1461, is " + << last_msg_.stec_sat_list[12].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[2], 20603) + << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[2], " + "expected 20603, is " + << last_msg_.stec_sat_list[12].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[12].stec_coeff[3], -3023) + << "incorrect value for last_msg_.stec_sat_list[12].stec_coeff[3], " + "expected -3023, is " + << last_msg_.stec_sat_list[12].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[12].stec_quality_indicator, 216) + << "incorrect value for " + "last_msg_.stec_sat_list[12].stec_quality_indicator, expected 216, is " + << last_msg_.stec_sat_list[12].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[12].sv_id.constellation, 84) + << "incorrect value for last_msg_.stec_sat_list[12].sv_id.constellation, " + "expected 84, is " + << last_msg_.stec_sat_list[12].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[12].sv_id.satId, 202) + << "incorrect value for last_msg_.stec_sat_list[12].sv_id.satId, " + "expected 202, is " + << last_msg_.stec_sat_list[12].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[0], -6492) + << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[0], " + "expected -6492, is " + << last_msg_.stec_sat_list[13].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[1], 16952) + << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[1], " + "expected 16952, is " + << last_msg_.stec_sat_list[13].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[2], -22404) + << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[2], " + "expected -22404, is " + << last_msg_.stec_sat_list[13].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[13].stec_coeff[3], -29893) + << "incorrect value for last_msg_.stec_sat_list[13].stec_coeff[3], " + "expected -29893, is " + << last_msg_.stec_sat_list[13].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[13].stec_quality_indicator, 125) + << "incorrect value for " + "last_msg_.stec_sat_list[13].stec_quality_indicator, expected 125, is " + << last_msg_.stec_sat_list[13].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[13].sv_id.constellation, 188) + << "incorrect value for last_msg_.stec_sat_list[13].sv_id.constellation, " + "expected 188, is " + << last_msg_.stec_sat_list[13].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[13].sv_id.satId, 224) + << "incorrect value for last_msg_.stec_sat_list[13].sv_id.satId, " + "expected 224, is " + << last_msg_.stec_sat_list[13].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[0], -10053) + << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[0], " + "expected -10053, is " + << last_msg_.stec_sat_list[14].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[1], -24897) + << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[1], " + "expected -24897, is " + << last_msg_.stec_sat_list[14].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[2], 23629) + << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[2], " + "expected 23629, is " + << last_msg_.stec_sat_list[14].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[14].stec_coeff[3], -710) + << "incorrect value for last_msg_.stec_sat_list[14].stec_coeff[3], " + "expected -710, is " + << last_msg_.stec_sat_list[14].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[14].stec_quality_indicator, 51) + << "incorrect value for " + "last_msg_.stec_sat_list[14].stec_quality_indicator, expected 51, is " + << last_msg_.stec_sat_list[14].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[14].sv_id.constellation, 118) + << "incorrect value for last_msg_.stec_sat_list[14].sv_id.constellation, " + "expected 118, is " + << last_msg_.stec_sat_list[14].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[14].sv_id.satId, 106) + << "incorrect value for last_msg_.stec_sat_list[14].sv_id.satId, " + "expected 106, is " + << last_msg_.stec_sat_list[14].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[0], -26103) + << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[0], " + "expected -26103, is " + << last_msg_.stec_sat_list[15].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[1], -9539) + << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[1], " + "expected -9539, is " + << last_msg_.stec_sat_list[15].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[2], -11971) + << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[2], " + "expected -11971, is " + << last_msg_.stec_sat_list[15].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[15].stec_coeff[3], 20993) + << "incorrect value for last_msg_.stec_sat_list[15].stec_coeff[3], " + "expected 20993, is " + << last_msg_.stec_sat_list[15].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[15].stec_quality_indicator, 165) + << "incorrect value for " + "last_msg_.stec_sat_list[15].stec_quality_indicator, expected 165, is " + << last_msg_.stec_sat_list[15].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[15].sv_id.constellation, 150) + << "incorrect value for last_msg_.stec_sat_list[15].sv_id.constellation, " + "expected 150, is " + << last_msg_.stec_sat_list[15].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[15].sv_id.satId, 132) + << "incorrect value for last_msg_.stec_sat_list[15].sv_id.satId, " + "expected 132, is " + << last_msg_.stec_sat_list[15].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[0], -18891) + << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[0], " + "expected -18891, is " + << last_msg_.stec_sat_list[16].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[1], -16272) + << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[1], " + "expected -16272, is " + << last_msg_.stec_sat_list[16].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[2], -22578) + << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[2], " + "expected -22578, is " + << last_msg_.stec_sat_list[16].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[16].stec_coeff[3], -2915) + << "incorrect value for last_msg_.stec_sat_list[16].stec_coeff[3], " + "expected -2915, is " + << last_msg_.stec_sat_list[16].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[16].stec_quality_indicator, 23) + << "incorrect value for " + "last_msg_.stec_sat_list[16].stec_quality_indicator, expected 23, is " + << last_msg_.stec_sat_list[16].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[16].sv_id.constellation, 196) + << "incorrect value for last_msg_.stec_sat_list[16].sv_id.constellation, " + "expected 196, is " + << last_msg_.stec_sat_list[16].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[16].sv_id.satId, 181) + << "incorrect value for last_msg_.stec_sat_list[16].sv_id.satId, " + "expected 181, is " + << last_msg_.stec_sat_list[16].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[0], 15833) + << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[0], " + "expected 15833, is " + << last_msg_.stec_sat_list[17].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[1], 24920) + << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[1], " + "expected 24920, is " + << last_msg_.stec_sat_list[17].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[2], -13879) + << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[2], " + "expected -13879, is " + << last_msg_.stec_sat_list[17].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[17].stec_coeff[3], -1206) + << "incorrect value for last_msg_.stec_sat_list[17].stec_coeff[3], " + "expected -1206, is " + << last_msg_.stec_sat_list[17].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[17].stec_quality_indicator, 189) + << "incorrect value for " + "last_msg_.stec_sat_list[17].stec_quality_indicator, expected 189, is " + << last_msg_.stec_sat_list[17].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[17].sv_id.constellation, 1) + << "incorrect value for last_msg_.stec_sat_list[17].sv_id.constellation, " + "expected 1, is " + << last_msg_.stec_sat_list[17].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[17].sv_id.satId, 35) + << "incorrect value for last_msg_.stec_sat_list[17].sv_id.satId, " + "expected 35, is " + << last_msg_.stec_sat_list[17].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[0], 14008) + << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[0], " + "expected 14008, is " + << last_msg_.stec_sat_list[18].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[1], 18996) + << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[1], " + "expected 18996, is " + << last_msg_.stec_sat_list[18].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[2], 2798) + << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[2], " + "expected 2798, is " + << last_msg_.stec_sat_list[18].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[18].stec_coeff[3], 5761) + << "incorrect value for last_msg_.stec_sat_list[18].stec_coeff[3], " + "expected 5761, is " + << last_msg_.stec_sat_list[18].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[18].stec_quality_indicator, 104) + << "incorrect value for " + "last_msg_.stec_sat_list[18].stec_quality_indicator, expected 104, is " + << last_msg_.stec_sat_list[18].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[18].sv_id.constellation, 14) + << "incorrect value for last_msg_.stec_sat_list[18].sv_id.constellation, " + "expected 14, is " + << last_msg_.stec_sat_list[18].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[18].sv_id.satId, 217) + << "incorrect value for last_msg_.stec_sat_list[18].sv_id.satId, " + "expected 217, is " + << last_msg_.stec_sat_list[18].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[0], -25256) + << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[0], " + "expected -25256, is " + << last_msg_.stec_sat_list[19].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[1], -15330) + << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[1], " + "expected -15330, is " + << last_msg_.stec_sat_list[19].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[2], 6831) + << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[2], " + "expected 6831, is " + << last_msg_.stec_sat_list[19].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[19].stec_coeff[3], 8780) + << "incorrect value for last_msg_.stec_sat_list[19].stec_coeff[3], " + "expected 8780, is " + << last_msg_.stec_sat_list[19].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[19].stec_quality_indicator, 109) + << "incorrect value for " + "last_msg_.stec_sat_list[19].stec_quality_indicator, expected 109, is " + << last_msg_.stec_sat_list[19].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[19].sv_id.constellation, 226) + << "incorrect value for last_msg_.stec_sat_list[19].sv_id.constellation, " + "expected 226, is " + << last_msg_.stec_sat_list[19].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[19].sv_id.satId, 178) + << "incorrect value for last_msg_.stec_sat_list[19].sv_id.satId, " + "expected 178, is " + << last_msg_.stec_sat_list[19].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[0], 3304) + << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[0], " + "expected 3304, is " + << last_msg_.stec_sat_list[20].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[1], -2893) + << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[1], " + "expected -2893, is " + << last_msg_.stec_sat_list[20].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[2], -25841) + << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[2], " + "expected -25841, is " + << last_msg_.stec_sat_list[20].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[20].stec_coeff[3], -13628) + << "incorrect value for last_msg_.stec_sat_list[20].stec_coeff[3], " + "expected -13628, is " + << last_msg_.stec_sat_list[20].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[20].stec_quality_indicator, 154) + << "incorrect value for " + "last_msg_.stec_sat_list[20].stec_quality_indicator, expected 154, is " + << last_msg_.stec_sat_list[20].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[20].sv_id.constellation, 220) + << "incorrect value for last_msg_.stec_sat_list[20].sv_id.constellation, " + "expected 220, is " + << last_msg_.stec_sat_list[20].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[20].sv_id.satId, 116) + << "incorrect value for last_msg_.stec_sat_list[20].sv_id.satId, " + "expected 116, is " + << last_msg_.stec_sat_list[20].sv_id.satId; + EXPECT_EQ(last_msg_.stec_sat_list[21].stec_coeff[0], -10742) + << "incorrect value for last_msg_.stec_sat_list[21].stec_coeff[0], " + "expected -10742, is " + << last_msg_.stec_sat_list[21].stec_coeff[0]; + EXPECT_EQ(last_msg_.stec_sat_list[21].stec_coeff[1], 10098) + << "incorrect value for last_msg_.stec_sat_list[21].stec_coeff[1], " + "expected 10098, is " + << last_msg_.stec_sat_list[21].stec_coeff[1]; + EXPECT_EQ(last_msg_.stec_sat_list[21].stec_coeff[2], 7413) + << "incorrect value for last_msg_.stec_sat_list[21].stec_coeff[2], " + "expected 7413, is " + << last_msg_.stec_sat_list[21].stec_coeff[2]; + EXPECT_EQ(last_msg_.stec_sat_list[21].stec_coeff[3], 17645) + << "incorrect value for last_msg_.stec_sat_list[21].stec_coeff[3], " + "expected 17645, is " + << last_msg_.stec_sat_list[21].stec_coeff[3]; + EXPECT_EQ(last_msg_.stec_sat_list[21].stec_quality_indicator, 115) + << "incorrect value for " + "last_msg_.stec_sat_list[21].stec_quality_indicator, expected 115, is " + << last_msg_.stec_sat_list[21].stec_quality_indicator; + EXPECT_EQ(last_msg_.stec_sat_list[21].sv_id.constellation, 70) + << "incorrect value for last_msg_.stec_sat_list[21].sv_id.constellation, " + "expected 70, is " + << last_msg_.stec_sat_list[21].sv_id.constellation; + EXPECT_EQ(last_msg_.stec_sat_list[21].sv_id.satId, 72) + << "incorrect value for last_msg_.stec_sat_list[21].sv_id.satId, " + "expected 72, is " + << last_msg_.stec_sat_list[21].sv_id.satId; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrTileDefinition.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrTileDefinition.cc index 145ce9221..62178c44a 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrTileDefinition.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrTileDefinition.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinition.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinition.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrTileDefinition0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrTileDefinition0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrTileDefinition0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrTileDefinition0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_tile_definition_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_tile_definition_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,58 +67,88 @@ class Test_auto_check_sbp_ssr_MsgSsrTileDefinition0 : sbp_msg_ssr_tile_definition_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrTileDefinition0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrTileDefinition0, Test) { + uint8_t encoded_frame[] = { + 85, 248, 5, 0, 0, 33, 127, 58, 9, 0, 174, 8, 1, 2, + 3, 4, 0, 5, 0, 186, 28, 59, 167, 100, 0, 100, 0, 6, + 0, 6, 0, 210, 2, 150, 73, 0, 0, 0, 0, 204, 94, + }; - uint8_t encoded_frame[] = {85,248,5,0,0,33,127,58,9,0,174,8,1,2,3,4,0,5,0,186,28,59,167,100,0,100,0,6,0,6,0,210,2,150,73,0,0,0,0,204,94, }; + sbp_msg_ssr_tile_definition_t test_msg{}; + test_msg.bitmask = 1234567890; + test_msg.cols = 6; + test_msg.corner_nw_lat = 7354; + test_msg.corner_nw_lon = -22725; + test_msg.iod_atmo = 3; + test_msg.rows = 6; + test_msg.sol_id = 2; + test_msg.spacing_lat = 100; + test_msg.spacing_lon = 100; + test_msg.tile_id = 5; + test_msg.tile_set_id = 4; + test_msg.time.tow = 604799; + test_msg.time.wn = 2222; + test_msg.update_interval = 1; - sbp_msg_ssr_tile_definition_t test_msg{}; - test_msg.bitmask = 1234567890; - test_msg.cols = 6; - test_msg.corner_nw_lat = 7354; - test_msg.corner_nw_lon = -22725; - test_msg.iod_atmo = 3; - test_msg.rows = 6; - test_msg.sol_id = 2; - test_msg.spacing_lat = 100; - test_msg.spacing_lon = 100; - test_msg.tile_id = 5; - test_msg.tile_set_id = 4; - test_msg.time.tow = 604799; - test_msg.time.wn = 2222; - test_msg.update_interval = 1; - - EXPECT_EQ(send_message( 0, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(0, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.bitmask, 1234567890) << "incorrect value for last_msg_.bitmask, expected 1234567890, is " << last_msg_.bitmask; - EXPECT_EQ(last_msg_.cols, 6) << "incorrect value for last_msg_.cols, expected 6, is " << last_msg_.cols; - EXPECT_EQ(last_msg_.corner_nw_lat, 7354) << "incorrect value for last_msg_.corner_nw_lat, expected 7354, is " << last_msg_.corner_nw_lat; - EXPECT_EQ(last_msg_.corner_nw_lon, -22725) << "incorrect value for last_msg_.corner_nw_lon, expected -22725, is " << last_msg_.corner_nw_lon; - EXPECT_EQ(last_msg_.iod_atmo, 3) << "incorrect value for last_msg_.iod_atmo, expected 3, is " << last_msg_.iod_atmo; - EXPECT_EQ(last_msg_.rows, 6) << "incorrect value for last_msg_.rows, expected 6, is " << last_msg_.rows; - EXPECT_EQ(last_msg_.sol_id, 2) << "incorrect value for last_msg_.sol_id, expected 2, is " << last_msg_.sol_id; - EXPECT_EQ(last_msg_.spacing_lat, 100) << "incorrect value for last_msg_.spacing_lat, expected 100, is " << last_msg_.spacing_lat; - EXPECT_EQ(last_msg_.spacing_lon, 100) << "incorrect value for last_msg_.spacing_lon, expected 100, is " << last_msg_.spacing_lon; - EXPECT_EQ(last_msg_.tile_id, 5) << "incorrect value for last_msg_.tile_id, expected 5, is " << last_msg_.tile_id; - EXPECT_EQ(last_msg_.tile_set_id, 4) << "incorrect value for last_msg_.tile_set_id, expected 4, is " << last_msg_.tile_set_id; - EXPECT_EQ(last_msg_.time.tow, 604799) << "incorrect value for last_msg_.time.tow, expected 604799, is " << last_msg_.time.tow; - EXPECT_EQ(last_msg_.time.wn, 2222) << "incorrect value for last_msg_.time.wn, expected 2222, is " << last_msg_.time.wn; - EXPECT_EQ(last_msg_.update_interval, 1) << "incorrect value for last_msg_.update_interval, expected 1, is " << last_msg_.update_interval; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.bitmask, 1234567890) + << "incorrect value for last_msg_.bitmask, expected 1234567890, is " + << last_msg_.bitmask; + EXPECT_EQ(last_msg_.cols, 6) + << "incorrect value for last_msg_.cols, expected 6, is " + << last_msg_.cols; + EXPECT_EQ(last_msg_.corner_nw_lat, 7354) + << "incorrect value for last_msg_.corner_nw_lat, expected 7354, is " + << last_msg_.corner_nw_lat; + EXPECT_EQ(last_msg_.corner_nw_lon, -22725) + << "incorrect value for last_msg_.corner_nw_lon, expected -22725, is " + << last_msg_.corner_nw_lon; + EXPECT_EQ(last_msg_.iod_atmo, 3) + << "incorrect value for last_msg_.iod_atmo, expected 3, is " + << last_msg_.iod_atmo; + EXPECT_EQ(last_msg_.rows, 6) + << "incorrect value for last_msg_.rows, expected 6, is " + << last_msg_.rows; + EXPECT_EQ(last_msg_.sol_id, 2) + << "incorrect value for last_msg_.sol_id, expected 2, is " + << last_msg_.sol_id; + EXPECT_EQ(last_msg_.spacing_lat, 100) + << "incorrect value for last_msg_.spacing_lat, expected 100, is " + << last_msg_.spacing_lat; + EXPECT_EQ(last_msg_.spacing_lon, 100) + << "incorrect value for last_msg_.spacing_lon, expected 100, is " + << last_msg_.spacing_lon; + EXPECT_EQ(last_msg_.tile_id, 5) + << "incorrect value for last_msg_.tile_id, expected 5, is " + << last_msg_.tile_id; + EXPECT_EQ(last_msg_.tile_set_id, 4) + << "incorrect value for last_msg_.tile_set_id, expected 4, is " + << last_msg_.tile_set_id; + EXPECT_EQ(last_msg_.time.tow, 604799) + << "incorrect value for last_msg_.time.tow, expected 604799, is " + << last_msg_.time.tow; + EXPECT_EQ(last_msg_.time.wn, 2222) + << "incorrect value for last_msg_.time.wn, expected 2222, is " + << last_msg_.time.wn; + EXPECT_EQ(last_msg_.update_interval, 1) + << "incorrect value for last_msg_.update_interval, expected 1, is " + << last_msg_.update_interval; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.cc index f07ec34f6..bd515090e 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_tile_definition_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_tile_definition_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,48 +67,67 @@ class Test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA0 : sbp_msg_ssr_tile_definition_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 246, 5, 200, 133, 24, 57, 190, 178, 247, 8, 185, 9, 181, 162, 240, + 65, 19, 255, 143, 21, 191, 239, 205, 171, 0, 0, 0, 0, 0, 65, 154, + }; - uint8_t encoded_frame[] = {85,246,5,200,133,24,57,190,178,247,8,185,9,181,162,240,65,19,255,143,21,191,239,205,171,0,0,0,0,0,65,154, }; + sbp_msg_ssr_tile_definition_dep_a_t test_msg{}; + test_msg.bitmask = 11259375; + test_msg.cols = 48917; + test_msg.corner_nw_lat = -18168; + test_msg.corner_nw_lon = -19191; + test_msg.rows = 36863; + test_msg.spacing_lat = 61602; + test_msg.spacing_lon = 4929; + test_msg.tile_id = 63410; + test_msg.tile_set_id = 48697; - sbp_msg_ssr_tile_definition_dep_a_t test_msg{}; - test_msg.bitmask = 11259375; - test_msg.cols = 48917; - test_msg.corner_nw_lat = -18168; - test_msg.corner_nw_lon = -19191; - test_msg.rows = 36863; - test_msg.spacing_lat = 61602; - test_msg.spacing_lon = 4929; - test_msg.tile_id = 63410; - test_msg.tile_set_id = 48697; - - EXPECT_EQ(send_message( 34248, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(34248, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 34248); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.bitmask, 11259375) << "incorrect value for last_msg_.bitmask, expected 11259375, is " << last_msg_.bitmask; - EXPECT_EQ(last_msg_.cols, 48917) << "incorrect value for last_msg_.cols, expected 48917, is " << last_msg_.cols; - EXPECT_EQ(last_msg_.corner_nw_lat, -18168) << "incorrect value for last_msg_.corner_nw_lat, expected -18168, is " << last_msg_.corner_nw_lat; - EXPECT_EQ(last_msg_.corner_nw_lon, -19191) << "incorrect value for last_msg_.corner_nw_lon, expected -19191, is " << last_msg_.corner_nw_lon; - EXPECT_EQ(last_msg_.rows, 36863) << "incorrect value for last_msg_.rows, expected 36863, is " << last_msg_.rows; - EXPECT_EQ(last_msg_.spacing_lat, 61602) << "incorrect value for last_msg_.spacing_lat, expected 61602, is " << last_msg_.spacing_lat; - EXPECT_EQ(last_msg_.spacing_lon, 4929) << "incorrect value for last_msg_.spacing_lon, expected 4929, is " << last_msg_.spacing_lon; - EXPECT_EQ(last_msg_.tile_id, 63410) << "incorrect value for last_msg_.tile_id, expected 63410, is " << last_msg_.tile_id; - EXPECT_EQ(last_msg_.tile_set_id, 48697) << "incorrect value for last_msg_.tile_set_id, expected 48697, is " << last_msg_.tile_set_id; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 34248); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.bitmask, 11259375) + << "incorrect value for last_msg_.bitmask, expected 11259375, is " + << last_msg_.bitmask; + EXPECT_EQ(last_msg_.cols, 48917) + << "incorrect value for last_msg_.cols, expected 48917, is " + << last_msg_.cols; + EXPECT_EQ(last_msg_.corner_nw_lat, -18168) + << "incorrect value for last_msg_.corner_nw_lat, expected -18168, is " + << last_msg_.corner_nw_lat; + EXPECT_EQ(last_msg_.corner_nw_lon, -19191) + << "incorrect value for last_msg_.corner_nw_lon, expected -19191, is " + << last_msg_.corner_nw_lon; + EXPECT_EQ(last_msg_.rows, 36863) + << "incorrect value for last_msg_.rows, expected 36863, is " + << last_msg_.rows; + EXPECT_EQ(last_msg_.spacing_lat, 61602) + << "incorrect value for last_msg_.spacing_lat, expected 61602, is " + << last_msg_.spacing_lat; + EXPECT_EQ(last_msg_.spacing_lon, 4929) + << "incorrect value for last_msg_.spacing_lon, expected 4929, is " + << last_msg_.spacing_lon; + EXPECT_EQ(last_msg_.tile_id, 63410) + << "incorrect value for last_msg_.tile_id, expected 63410, is " + << last_msg_.tile_id; + EXPECT_EQ(last_msg_.tile_set_id, 48697) + << "incorrect value for last_msg_.tile_set_id, expected 48697, is " + << last_msg_.tile_set_id; } diff --git a/c/test/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.cc b/c/test/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.cc index e21750d8d..9207819ac 100644 --- a/c/test/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.cc +++ b/c/test/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepB.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ssr_tile_definition_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ssr_tile_definition_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,50 +67,71 @@ class Test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB0 : sbp_msg_ssr_tile_definition_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 247, 5, 66, 0, 25, 31, 0, 1, 0, 2, 0, 4, 0, 8, 0, 16, + 0, 32, 0, 64, 0, 128, 210, 2, 150, 73, 0, 0, 0, 0, 214, 71, + }; - uint8_t encoded_frame[] = {85,247,5,66,0,25,31,0,1,0,2,0,4,0,8,0,16,0,32,0,64,0,128,210,2,150,73,0,0,0,0,214,71, }; + sbp_msg_ssr_tile_definition_dep_b_t test_msg{}; + test_msg.bitmask = 1234567890; + test_msg.cols = 32768; + test_msg.corner_nw_lat = 1024; + test_msg.corner_nw_lon = 2048; + test_msg.rows = 16384; + test_msg.spacing_lat = 4096; + test_msg.spacing_lon = 8192; + test_msg.ssr_sol_id = 31; + test_msg.tile_id = 512; + test_msg.tile_set_id = 256; - sbp_msg_ssr_tile_definition_dep_b_t test_msg{}; - test_msg.bitmask = 1234567890; - test_msg.cols = 32768; - test_msg.corner_nw_lat = 1024; - test_msg.corner_nw_lon = 2048; - test_msg.rows = 16384; - test_msg.spacing_lat = 4096; - test_msg.spacing_lon = 8192; - test_msg.ssr_sol_id = 31; - test_msg.tile_id = 512; - test_msg.tile_set_id = 256; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.bitmask, 1234567890) << "incorrect value for last_msg_.bitmask, expected 1234567890, is " << last_msg_.bitmask; - EXPECT_EQ(last_msg_.cols, 32768) << "incorrect value for last_msg_.cols, expected 32768, is " << last_msg_.cols; - EXPECT_EQ(last_msg_.corner_nw_lat, 1024) << "incorrect value for last_msg_.corner_nw_lat, expected 1024, is " << last_msg_.corner_nw_lat; - EXPECT_EQ(last_msg_.corner_nw_lon, 2048) << "incorrect value for last_msg_.corner_nw_lon, expected 2048, is " << last_msg_.corner_nw_lon; - EXPECT_EQ(last_msg_.rows, 16384) << "incorrect value for last_msg_.rows, expected 16384, is " << last_msg_.rows; - EXPECT_EQ(last_msg_.spacing_lat, 4096) << "incorrect value for last_msg_.spacing_lat, expected 4096, is " << last_msg_.spacing_lat; - EXPECT_EQ(last_msg_.spacing_lon, 8192) << "incorrect value for last_msg_.spacing_lon, expected 8192, is " << last_msg_.spacing_lon; - EXPECT_EQ(last_msg_.ssr_sol_id, 31) << "incorrect value for last_msg_.ssr_sol_id, expected 31, is " << last_msg_.ssr_sol_id; - EXPECT_EQ(last_msg_.tile_id, 512) << "incorrect value for last_msg_.tile_id, expected 512, is " << last_msg_.tile_id; - EXPECT_EQ(last_msg_.tile_set_id, 256) << "incorrect value for last_msg_.tile_set_id, expected 256, is " << last_msg_.tile_set_id; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.bitmask, 1234567890) + << "incorrect value for last_msg_.bitmask, expected 1234567890, is " + << last_msg_.bitmask; + EXPECT_EQ(last_msg_.cols, 32768) + << "incorrect value for last_msg_.cols, expected 32768, is " + << last_msg_.cols; + EXPECT_EQ(last_msg_.corner_nw_lat, 1024) + << "incorrect value for last_msg_.corner_nw_lat, expected 1024, is " + << last_msg_.corner_nw_lat; + EXPECT_EQ(last_msg_.corner_nw_lon, 2048) + << "incorrect value for last_msg_.corner_nw_lon, expected 2048, is " + << last_msg_.corner_nw_lon; + EXPECT_EQ(last_msg_.rows, 16384) + << "incorrect value for last_msg_.rows, expected 16384, is " + << last_msg_.rows; + EXPECT_EQ(last_msg_.spacing_lat, 4096) + << "incorrect value for last_msg_.spacing_lat, expected 4096, is " + << last_msg_.spacing_lat; + EXPECT_EQ(last_msg_.spacing_lon, 8192) + << "incorrect value for last_msg_.spacing_lon, expected 8192, is " + << last_msg_.spacing_lon; + EXPECT_EQ(last_msg_.ssr_sol_id, 31) + << "incorrect value for last_msg_.ssr_sol_id, expected 31, is " + << last_msg_.ssr_sol_id; + EXPECT_EQ(last_msg_.tile_id, 512) + << "incorrect value for last_msg_.tile_id, expected 512, is " + << last_msg_.tile_id; + EXPECT_EQ(last_msg_.tile_set_id, 256) + << "incorrect value for last_msg_.tile_set_id, expected 256, is " + << last_msg_.tile_set_id; } diff --git a/c/test/cpp/auto_check_sbp_system_MsgCsacTelemetry.cc b/c/test/cpp/auto_check_sbp_system_MsgCsacTelemetry.cc index fab15acf2..fc054a664 100644 --- a/c/test/cpp/auto_check_sbp_system_MsgCsacTelemetry.cc +++ b/c/test/cpp/auto_check_sbp_system_MsgCsacTelemetry.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetry.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetry.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_system_MsgCsacTelemetry0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgCsacTelemetry0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_system_MsgCsacTelemetry0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgCsacTelemetry0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_csac_telemetry_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_csac_telemetry_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,40 +67,43 @@ class Test_auto_check_sbp_system_MsgCsacTelemetry0 : sbp_msg_csac_telemetry_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgCsacTelemetry0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_system_MsgCsacTelemetry0, Test) { + uint8_t encoded_frame[] = { + 85, 4, 255, 244, 169, 10, 105, 115, 111, + 109, 101, 32, 100, 97, 116, 97, 229, 94, + }; + + sbp_msg_csac_telemetry_t test_msg{}; + test_msg.id = 105; + + size_t written; + EXPECT_TRUE(sbp_msg_csac_telemetry_telemetry_set(&test_msg, "some data", + false, &written)); + EXPECT_EQ(written, strlen("some data")); + EXPECT_EQ(sbp_msg_csac_telemetry_telemetry_encoded_len(&test_msg), 9); - uint8_t encoded_frame[] = {85,4,255,244,169,10,105,115,111,109,101,32,100,97,116,97,229,94, }; + EXPECT_EQ(send_message(43508, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_csac_telemetry_t test_msg{}; - test_msg.id = 105; - - size_t written; - EXPECT_TRUE(sbp_msg_csac_telemetry_telemetry_set(&test_msg, "some data", false, &written)); - EXPECT_EQ( written, strlen("some data")); - EXPECT_EQ(sbp_msg_csac_telemetry_telemetry_encoded_len(&test_msg), 9); - - EXPECT_EQ(send_message( 43508, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 43508); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.id, 105) + << "incorrect value for last_msg_.id, expected 105, is " << last_msg_.id; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 43508); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.id, 105) << "incorrect value for last_msg_.id, expected 105, is " << last_msg_.id; - - EXPECT_EQ(sbp_msg_csac_telemetry_telemetry_encoded_len(&last_msg_), 9); - EXPECT_STREQ(sbp_msg_csac_telemetry_telemetry_get(&last_msg_), "some data"); + EXPECT_EQ(sbp_msg_csac_telemetry_telemetry_encoded_len(&last_msg_), 9); + EXPECT_STREQ(sbp_msg_csac_telemetry_telemetry_get(&last_msg_), "some data"); } diff --git a/c/test/cpp/auto_check_sbp_system_MsgCsacTelemetryLabels.cc b/c/test/cpp/auto_check_sbp_system_MsgCsacTelemetryLabels.cc index c52cdf3e4..e6ccc88ef 100644 --- a/c/test/cpp/auto_check_sbp_system_MsgCsacTelemetryLabels.cc +++ b/c/test/cpp/auto_check_sbp_system_MsgCsacTelemetryLabels.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetryLabels.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetryLabels.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_system_MsgCsacTelemetryLabels0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgCsacTelemetryLabels0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_system_MsgCsacTelemetryLabels0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgCsacTelemetryLabels0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_csac_telemetry_labels_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_csac_telemetry_labels_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,40 +67,48 @@ class Test_auto_check_sbp_system_MsgCsacTelemetryLabels0 : sbp_msg_csac_telemetry_labels_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgCsacTelemetryLabels0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_system_MsgCsacTelemetryLabels0, Test) { + uint8_t encoded_frame[] = { + 85, 5, 255, 91, 200, 12, 186, 115, 111, 109, + 101, 32, 108, 97, 98, 101, 108, 115, 86, 236, + }; + + sbp_msg_csac_telemetry_labels_t test_msg{}; + test_msg.id = 186; + + size_t written; + EXPECT_TRUE(sbp_msg_csac_telemetry_labels_telemetry_labels_set( + &test_msg, "some labels", false, &written)); + EXPECT_EQ(written, strlen("some labels")); + EXPECT_EQ( + sbp_msg_csac_telemetry_labels_telemetry_labels_encoded_len(&test_msg), + 11); - uint8_t encoded_frame[] = {85,5,255,91,200,12,186,115,111,109,101,32,108,97,98,101,108,115,86,236, }; + EXPECT_EQ(send_message(51291, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_csac_telemetry_labels_t test_msg{}; - test_msg.id = 186; - - size_t written; - EXPECT_TRUE(sbp_msg_csac_telemetry_labels_telemetry_labels_set(&test_msg, "some labels", false, &written)); - EXPECT_EQ( written, strlen("some labels")); - EXPECT_EQ(sbp_msg_csac_telemetry_labels_telemetry_labels_encoded_len(&test_msg), 11); - - EXPECT_EQ(send_message( 51291, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 51291); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.id, 186) + << "incorrect value for last_msg_.id, expected 186, is " << last_msg_.id; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 51291); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.id, 186) << "incorrect value for last_msg_.id, expected 186, is " << last_msg_.id; - - EXPECT_EQ(sbp_msg_csac_telemetry_labels_telemetry_labels_encoded_len(&last_msg_), 11); - EXPECT_STREQ(sbp_msg_csac_telemetry_labels_telemetry_labels_get(&last_msg_), "some labels"); + EXPECT_EQ( + sbp_msg_csac_telemetry_labels_telemetry_labels_encoded_len(&last_msg_), + 11); + EXPECT_STREQ(sbp_msg_csac_telemetry_labels_telemetry_labels_get(&last_msg_), + "some labels"); } diff --git a/c/test/cpp/auto_check_sbp_system_MsgDgnssStatus.cc b/c/test/cpp/auto_check_sbp_system_MsgDgnssStatus.cc index 18d353e6c..240211544 100644 --- a/c/test/cpp/auto_check_sbp_system_MsgDgnssStatus.cc +++ b/c/test/cpp/auto_check_sbp_system_MsgDgnssStatus.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgDgnssStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgDgnssStatus.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_system_MsgDgnssStatus0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgDgnssStatus0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_system_MsgDgnssStatus0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgDgnssStatus0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_dgnss_status_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_dgnss_status_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,44 +67,52 @@ class Test_auto_check_sbp_system_MsgDgnssStatus0 : sbp_msg_dgnss_status_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgDgnssStatus0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_system_MsgDgnssStatus0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 255, 66, 0, 11, 0, 50, 0, 12, + 83, 107, 121, 108, 97, 114, 107, 202, 1, + }; + + sbp_msg_dgnss_status_t test_msg{}; + test_msg.flags = 0; + test_msg.latency = 50; + test_msg.num_signals = 12; + + size_t written; + EXPECT_TRUE( + sbp_msg_dgnss_status_source_set(&test_msg, "Skylark", false, &written)); + EXPECT_EQ(written, strlen("Skylark")); + EXPECT_EQ(sbp_msg_dgnss_status_source_encoded_len(&test_msg), 7); - uint8_t encoded_frame[] = {85,2,255,66,0,11,0,50,0,12,83,107,121,108,97,114,107,202,1, }; + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - sbp_msg_dgnss_status_t test_msg{}; - test_msg.flags = 0; - test_msg.latency = 50; - test_msg.num_signals = 12; - - size_t written; - EXPECT_TRUE(sbp_msg_dgnss_status_source_set(&test_msg, "Skylark", false, &written)); - EXPECT_EQ( written, strlen("Skylark")); - EXPECT_EQ(sbp_msg_dgnss_status_source_encoded_len(&test_msg), 7); - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.latency, 50) + << "incorrect value for last_msg_.latency, expected 50, is " + << last_msg_.latency; + EXPECT_EQ(last_msg_.num_signals, 12) + << "incorrect value for last_msg_.num_signals, expected 12, is " + << last_msg_.num_signals; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.latency, 50) << "incorrect value for last_msg_.latency, expected 50, is " << last_msg_.latency; - EXPECT_EQ(last_msg_.num_signals, 12) << "incorrect value for last_msg_.num_signals, expected 12, is " << last_msg_.num_signals; - - EXPECT_EQ(sbp_msg_dgnss_status_source_encoded_len(&last_msg_), 7); - EXPECT_STREQ(sbp_msg_dgnss_status_source_get(&last_msg_), "Skylark"); + EXPECT_EQ(sbp_msg_dgnss_status_source_encoded_len(&last_msg_), 7); + EXPECT_STREQ(sbp_msg_dgnss_status_source_get(&last_msg_), "Skylark"); } diff --git a/c/test/cpp/auto_check_sbp_system_MsgGnssTimeOffset.cc b/c/test/cpp/auto_check_sbp_system_MsgGnssTimeOffset.cc index 4e10b7f7f..9bccbb5cc 100644 --- a/c/test/cpp/auto_check_sbp_system_MsgGnssTimeOffset.cc +++ b/c/test/cpp/auto_check_sbp_system_MsgGnssTimeOffset.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgGnssTimeOffset.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgGnssTimeOffset.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_system_MsgGnssTimeOffset0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgGnssTimeOffset0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_system_MsgGnssTimeOffset0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgGnssTimeOffset0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_gnss_time_offset_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_gnss_time_offset_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,38 +67,46 @@ class Test_auto_check_sbp_system_MsgGnssTimeOffset0 : sbp_msg_gnss_time_offset_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgGnssTimeOffset0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_system_MsgGnssTimeOffset0, Test) { + uint8_t encoded_frame[] = { + 85, 7, 255, 22, 15, 9, 9, 58, 82, 83, 9, 103, 22, 37, 221, 84, 100, + }; - uint8_t encoded_frame[] = {85,7,255,22,15,9,9,58,82,83,9,103,22,37,221,84,100, }; + sbp_msg_gnss_time_offset_t test_msg{}; + test_msg.flags = 221; + test_msg.microseconds = 9494; + test_msg.milliseconds = 1728664402; + test_msg.weeks = 14857; - sbp_msg_gnss_time_offset_t test_msg{}; - test_msg.flags = 221; - test_msg.microseconds = 9494; - test_msg.milliseconds = 1728664402; - test_msg.weeks = 14857; - - EXPECT_EQ(send_message( 3862, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(3862, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 3862); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 221) << "incorrect value for last_msg_.flags, expected 221, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.microseconds, 9494) << "incorrect value for last_msg_.microseconds, expected 9494, is " << last_msg_.microseconds; - EXPECT_EQ(last_msg_.milliseconds, 1728664402) << "incorrect value for last_msg_.milliseconds, expected 1728664402, is " << last_msg_.milliseconds; - EXPECT_EQ(last_msg_.weeks, 14857) << "incorrect value for last_msg_.weeks, expected 14857, is " << last_msg_.weeks; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 3862); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 221) + << "incorrect value for last_msg_.flags, expected 221, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.microseconds, 9494) + << "incorrect value for last_msg_.microseconds, expected 9494, is " + << last_msg_.microseconds; + EXPECT_EQ(last_msg_.milliseconds, 1728664402) + << "incorrect value for last_msg_.milliseconds, expected 1728664402, is " + << last_msg_.milliseconds; + EXPECT_EQ(last_msg_.weeks, 14857) + << "incorrect value for last_msg_.weeks, expected 14857, is " + << last_msg_.weeks; } diff --git a/c/test/cpp/auto_check_sbp_system_MsgGroupMeta.cc b/c/test/cpp/auto_check_sbp_system_MsgGroupMeta.cc index 70eed7dc3..43d2fd200 100644 --- a/c/test/cpp/auto_check_sbp_system_MsgGroupMeta.cc +++ b/c/test/cpp/auto_check_sbp_system_MsgGroupMeta.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgGroupMeta.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgGroupMeta.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_system_MsgGroupMeta0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgGroupMeta0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_system_MsgGroupMeta0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgGroupMeta0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_group_meta_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_group_meta_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,111 +67,138 @@ class Test_auto_check_sbp_system_MsgGroupMeta0 : sbp_msg_group_meta_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgGroupMeta0, Test) -{ - - uint8_t encoded_frame[] = {85,10,255,238,238,9,1,2,3,10,255,10,2,2,255,2,14, }; - - sbp_msg_group_meta_t test_msg{}; - test_msg.flags = 2; - test_msg.group_id = 1; - - test_msg.group_msgs[0] = 65290; - - test_msg.group_msgs[1] = 522; - - test_msg.group_msgs[2] = 65282; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_group_msgs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)103,(char)114,(char)111,(char)117,(char)112,(char)95,(char)109,(char)115,(char)103,(char)115 }; - memcpy(test_msg.n_group_msgs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_group_msgs.value = 3; - - EXPECT_EQ(send_message( 61166, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61166); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 2) << "incorrect value for last_msg_.flags, expected 2, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.group_id, 1) << "incorrect value for last_msg_.group_id, expected 1, is " << last_msg_.group_id; - EXPECT_EQ(last_msg_.group_msgs[0], 65290) << "incorrect value for last_msg_.group_msgs[0], expected 65290, is " << last_msg_.group_msgs[0]; - EXPECT_EQ(last_msg_.group_msgs[1], 522) << "incorrect value for last_msg_.group_msgs[1], expected 522, is " << last_msg_.group_msgs[1]; - EXPECT_EQ(last_msg_.group_msgs[2], 65282) << "incorrect value for last_msg_.group_msgs[2], expected 65282, is " << last_msg_.group_msgs[2]; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_group_msgs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_group_msgs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_group_msgs.handle_as << "'"; - } - { - const char check_string[] = { (char)103,(char)114,(char)111,(char)117,(char)112,(char)95,(char)109,(char)115,(char)103,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_group_msgs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_group_msgs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_group_msgs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_group_msgs.value, 3) << "incorrect value for last_msg_.n_group_msgs.value, expected 3, is " << last_msg_.n_group_msgs.value; +}; + +TEST_F(Test_auto_check_sbp_system_MsgGroupMeta0, Test) { + uint8_t encoded_frame[] = { + 85, 10, 255, 238, 238, 9, 1, 2, 3, 10, 255, 10, 2, 2, 255, 2, 14, + }; + + sbp_msg_group_meta_t test_msg{}; + test_msg.flags = 2; + test_msg.group_id = 1; + + test_msg.group_msgs[0] = 65290; + + test_msg.group_msgs[1] = 522; + + test_msg.group_msgs[2] = 65282; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_group_msgs.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)103, (char)114, (char)111, (char)117, + (char)112, (char)95, (char)109, (char)115, + (char)103, (char)115}; + memcpy(test_msg.n_group_msgs.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_group_msgs.value = 3; + + EXPECT_EQ(send_message(61166, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61166); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 2) + << "incorrect value for last_msg_.flags, expected 2, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.group_id, 1) + << "incorrect value for last_msg_.group_id, expected 1, is " + << last_msg_.group_id; + EXPECT_EQ(last_msg_.group_msgs[0], 65290) + << "incorrect value for last_msg_.group_msgs[0], expected 65290, is " + << last_msg_.group_msgs[0]; + EXPECT_EQ(last_msg_.group_msgs[1], 522) + << "incorrect value for last_msg_.group_msgs[1], expected 522, is " + << last_msg_.group_msgs[1]; + EXPECT_EQ(last_msg_.group_msgs[2], 65282) + << "incorrect value for last_msg_.group_msgs[2], expected 65282, is " + << last_msg_.group_msgs[2]; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_group_msgs.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_group_msgs.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_group_msgs.handle_as << "'"; + } + { + const char check_string[] = {(char)103, (char)114, (char)111, (char)117, + (char)112, (char)95, (char)109, (char)115, + (char)103, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_group_msgs.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_group_msgs.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_group_msgs.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_group_msgs.value, 3) + << "incorrect value for last_msg_.n_group_msgs.value, expected 3, is " + << last_msg_.n_group_msgs.value; } -class Test_auto_check_sbp_system_MsgGroupMeta1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgGroupMeta1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_system_MsgGroupMeta1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgGroupMeta1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_group_meta_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_group_meta_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -183,94 +206,151 @@ class Test_auto_check_sbp_system_MsgGroupMeta1 : sbp_msg_group_meta_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgGroupMeta1, Test) -{ - - uint8_t encoded_frame[] = {85,10,255,21,3,31,1,1,14,2,1,3,1,10,2,17,2,9,2,20,2,14,2,18,2,13,2,21,2,33,2,3,255,6,255,14,255,82,154, }; - - sbp_msg_group_meta_t test_msg{}; - test_msg.flags = 1; - test_msg.group_id = 1; - - test_msg.group_msgs[0] = 258; - - test_msg.group_msgs[1] = 259; - - test_msg.group_msgs[2] = 522; - - test_msg.group_msgs[3] = 529; - - test_msg.group_msgs[4] = 521; - - test_msg.group_msgs[5] = 532; - - test_msg.group_msgs[6] = 526; - - test_msg.group_msgs[7] = 530; - - test_msg.group_msgs[8] = 525; - - test_msg.group_msgs[9] = 533; - - test_msg.group_msgs[10] = 545; - - test_msg.group_msgs[11] = 65283; - - test_msg.group_msgs[12] = 65286; - - test_msg.group_msgs[13] = 65294; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_group_msgs.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)103,(char)114,(char)111,(char)117,(char)112,(char)95,(char)109,(char)115,(char)103,(char)115 }; - memcpy(test_msg.n_group_msgs.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_group_msgs.value = 14; - - EXPECT_EQ(send_message( 789, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 789); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.group_id, 1) << "incorrect value for last_msg_.group_id, expected 1, is " << last_msg_.group_id; - EXPECT_EQ(last_msg_.group_msgs[0], 258) << "incorrect value for last_msg_.group_msgs[0], expected 258, is " << last_msg_.group_msgs[0]; - EXPECT_EQ(last_msg_.group_msgs[1], 259) << "incorrect value for last_msg_.group_msgs[1], expected 259, is " << last_msg_.group_msgs[1]; - EXPECT_EQ(last_msg_.group_msgs[2], 522) << "incorrect value for last_msg_.group_msgs[2], expected 522, is " << last_msg_.group_msgs[2]; - EXPECT_EQ(last_msg_.group_msgs[3], 529) << "incorrect value for last_msg_.group_msgs[3], expected 529, is " << last_msg_.group_msgs[3]; - EXPECT_EQ(last_msg_.group_msgs[4], 521) << "incorrect value for last_msg_.group_msgs[4], expected 521, is " << last_msg_.group_msgs[4]; - EXPECT_EQ(last_msg_.group_msgs[5], 532) << "incorrect value for last_msg_.group_msgs[5], expected 532, is " << last_msg_.group_msgs[5]; - EXPECT_EQ(last_msg_.group_msgs[6], 526) << "incorrect value for last_msg_.group_msgs[6], expected 526, is " << last_msg_.group_msgs[6]; - EXPECT_EQ(last_msg_.group_msgs[7], 530) << "incorrect value for last_msg_.group_msgs[7], expected 530, is " << last_msg_.group_msgs[7]; - EXPECT_EQ(last_msg_.group_msgs[8], 525) << "incorrect value for last_msg_.group_msgs[8], expected 525, is " << last_msg_.group_msgs[8]; - EXPECT_EQ(last_msg_.group_msgs[9], 533) << "incorrect value for last_msg_.group_msgs[9], expected 533, is " << last_msg_.group_msgs[9]; - EXPECT_EQ(last_msg_.group_msgs[10], 545) << "incorrect value for last_msg_.group_msgs[10], expected 545, is " << last_msg_.group_msgs[10]; - EXPECT_EQ(last_msg_.group_msgs[11], 65283) << "incorrect value for last_msg_.group_msgs[11], expected 65283, is " << last_msg_.group_msgs[11]; - EXPECT_EQ(last_msg_.group_msgs[12], 65286) << "incorrect value for last_msg_.group_msgs[12], expected 65286, is " << last_msg_.group_msgs[12]; - EXPECT_EQ(last_msg_.group_msgs[13], 65294) << "incorrect value for last_msg_.group_msgs[13], expected 65294, is " << last_msg_.group_msgs[13]; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_group_msgs.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_group_msgs.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_group_msgs.handle_as << "'"; - } - { - const char check_string[] = { (char)103,(char)114,(char)111,(char)117,(char)112,(char)95,(char)109,(char)115,(char)103,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_group_msgs.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_group_msgs.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_group_msgs.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_group_msgs.value, 14) << "incorrect value for last_msg_.n_group_msgs.value, expected 14, is " << last_msg_.n_group_msgs.value; +}; + +TEST_F(Test_auto_check_sbp_system_MsgGroupMeta1, Test) { + uint8_t encoded_frame[] = { + 85, 10, 255, 21, 3, 31, 1, 1, 14, 2, 1, 3, 1, + 10, 2, 17, 2, 9, 2, 20, 2, 14, 2, 18, 2, 13, + 2, 21, 2, 33, 2, 3, 255, 6, 255, 14, 255, 82, 154, + }; + + sbp_msg_group_meta_t test_msg{}; + test_msg.flags = 1; + test_msg.group_id = 1; + + test_msg.group_msgs[0] = 258; + + test_msg.group_msgs[1] = 259; + + test_msg.group_msgs[2] = 522; + + test_msg.group_msgs[3] = 529; + + test_msg.group_msgs[4] = 521; + + test_msg.group_msgs[5] = 532; + + test_msg.group_msgs[6] = 526; + + test_msg.group_msgs[7] = 530; + + test_msg.group_msgs[8] = 525; + + test_msg.group_msgs[9] = 533; + + test_msg.group_msgs[10] = 545; + + test_msg.group_msgs[11] = 65283; + + test_msg.group_msgs[12] = 65286; + + test_msg.group_msgs[13] = 65294; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_group_msgs.handle_as, assign_string, + sizeof(assign_string)); + } + { + const char assign_string[] = {(char)103, (char)114, (char)111, (char)117, + (char)112, (char)95, (char)109, (char)115, + (char)103, (char)115}; + memcpy(test_msg.n_group_msgs.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_group_msgs.value = 14; + + EXPECT_EQ(send_message(789, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 789); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.group_id, 1) + << "incorrect value for last_msg_.group_id, expected 1, is " + << last_msg_.group_id; + EXPECT_EQ(last_msg_.group_msgs[0], 258) + << "incorrect value for last_msg_.group_msgs[0], expected 258, is " + << last_msg_.group_msgs[0]; + EXPECT_EQ(last_msg_.group_msgs[1], 259) + << "incorrect value for last_msg_.group_msgs[1], expected 259, is " + << last_msg_.group_msgs[1]; + EXPECT_EQ(last_msg_.group_msgs[2], 522) + << "incorrect value for last_msg_.group_msgs[2], expected 522, is " + << last_msg_.group_msgs[2]; + EXPECT_EQ(last_msg_.group_msgs[3], 529) + << "incorrect value for last_msg_.group_msgs[3], expected 529, is " + << last_msg_.group_msgs[3]; + EXPECT_EQ(last_msg_.group_msgs[4], 521) + << "incorrect value for last_msg_.group_msgs[4], expected 521, is " + << last_msg_.group_msgs[4]; + EXPECT_EQ(last_msg_.group_msgs[5], 532) + << "incorrect value for last_msg_.group_msgs[5], expected 532, is " + << last_msg_.group_msgs[5]; + EXPECT_EQ(last_msg_.group_msgs[6], 526) + << "incorrect value for last_msg_.group_msgs[6], expected 526, is " + << last_msg_.group_msgs[6]; + EXPECT_EQ(last_msg_.group_msgs[7], 530) + << "incorrect value for last_msg_.group_msgs[7], expected 530, is " + << last_msg_.group_msgs[7]; + EXPECT_EQ(last_msg_.group_msgs[8], 525) + << "incorrect value for last_msg_.group_msgs[8], expected 525, is " + << last_msg_.group_msgs[8]; + EXPECT_EQ(last_msg_.group_msgs[9], 533) + << "incorrect value for last_msg_.group_msgs[9], expected 533, is " + << last_msg_.group_msgs[9]; + EXPECT_EQ(last_msg_.group_msgs[10], 545) + << "incorrect value for last_msg_.group_msgs[10], expected 545, is " + << last_msg_.group_msgs[10]; + EXPECT_EQ(last_msg_.group_msgs[11], 65283) + << "incorrect value for last_msg_.group_msgs[11], expected 65283, is " + << last_msg_.group_msgs[11]; + EXPECT_EQ(last_msg_.group_msgs[12], 65286) + << "incorrect value for last_msg_.group_msgs[12], expected 65286, is " + << last_msg_.group_msgs[12]; + EXPECT_EQ(last_msg_.group_msgs[13], 65294) + << "incorrect value for last_msg_.group_msgs[13], expected 65294, is " + << last_msg_.group_msgs[13]; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_group_msgs.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_group_msgs.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_group_msgs.handle_as << "'"; + } + { + const char check_string[] = {(char)103, (char)114, (char)111, (char)117, + (char)112, (char)95, (char)109, (char)115, + (char)103, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_group_msgs.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_group_msgs.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_group_msgs.relates_to + << "'"; + } + EXPECT_EQ(last_msg_.n_group_msgs.value, 14) + << "incorrect value for last_msg_.n_group_msgs.value, expected 14, is " + << last_msg_.n_group_msgs.value; } diff --git a/c/test/cpp/auto_check_sbp_system_MsgHeartbeat.cc b/c/test/cpp/auto_check_sbp_system_MsgHeartbeat.cc index 06015e533..ff8cfc339 100644 --- a/c/test/cpp/auto_check_sbp_system_MsgHeartbeat.cc +++ b/c/test/cpp/auto_check_sbp_system_MsgHeartbeat.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgHeartbeat.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgHeartbeat.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_system_MsgHeartbeat0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgHeartbeat0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_system_MsgHeartbeat0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgHeartbeat0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_heartbeat_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_heartbeat_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,82 +67,78 @@ class Test_auto_check_sbp_system_MsgHeartbeat0 : sbp_msg_heartbeat_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgHeartbeat0, Test) -{ - - uint8_t encoded_frame[] = {85,255,255,246,215,4,0,50,0,0,249,216, }; - - sbp_msg_heartbeat_t test_msg{}; - test_msg.flags = 12800; - - EXPECT_EQ(send_message( 55286, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 12800) << "incorrect value for last_msg_.flags, expected 12800, is " << last_msg_.flags; +}; + +TEST_F(Test_auto_check_sbp_system_MsgHeartbeat0, Test) { + uint8_t encoded_frame[] = { + 85, 255, 255, 246, 215, 4, 0, 50, 0, 0, 249, 216, + }; + + sbp_msg_heartbeat_t test_msg{}; + test_msg.flags = 12800; + + EXPECT_EQ(send_message(55286, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 12800) + << "incorrect value for last_msg_.flags, expected 12800, is " + << last_msg_.flags; } -class Test_auto_check_sbp_system_MsgHeartbeat1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgHeartbeat1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_system_MsgHeartbeat1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgHeartbeat1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_heartbeat_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_heartbeat_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -154,32 +146,34 @@ class Test_auto_check_sbp_system_MsgHeartbeat1 : sbp_msg_heartbeat_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgHeartbeat1, Test) -{ - - uint8_t encoded_frame[] = {85,255,255,195,4,4,0,0,0,0,66,57, }; - - sbp_msg_heartbeat_t test_msg{}; - test_msg.flags = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; +}; + +TEST_F(Test_auto_check_sbp_system_MsgHeartbeat1, Test) { + uint8_t encoded_frame[] = { + 85, 255, 255, 195, 4, 4, 0, 0, 0, 0, 66, 57, + }; + + sbp_msg_heartbeat_t test_msg{}; + test_msg.flags = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; } diff --git a/c/test/cpp/auto_check_sbp_system_MsgInsStatus.cc b/c/test/cpp/auto_check_sbp_system_MsgInsStatus.cc index 541246501..c18285413 100644 --- a/c/test/cpp/auto_check_sbp_system_MsgInsStatus.cc +++ b/c/test/cpp/auto_check_sbp_system_MsgInsStatus.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgInsStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgInsStatus.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_system_MsgInsStatus0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgInsStatus0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_system_MsgInsStatus0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgInsStatus0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ins_status_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ins_status_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,32 +67,34 @@ class Test_auto_check_sbp_system_MsgInsStatus0 : sbp_msg_ins_status_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgInsStatus0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_system_MsgInsStatus0, Test) { + uint8_t encoded_frame[] = { + 85, 3, 255, 21, 3, 4, 9, 0, 0, 32, 36, 103, + }; - uint8_t encoded_frame[] = {85,3,255,21,3,4,9,0,0,32,36,103, }; + sbp_msg_ins_status_t test_msg{}; + test_msg.flags = 536870921; - sbp_msg_ins_status_t test_msg{}; - test_msg.flags = 536870921; - - EXPECT_EQ(send_message( 789, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(789, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 789); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 536870921) << "incorrect value for last_msg_.flags, expected 536870921, is " << last_msg_.flags; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 789); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 536870921) + << "incorrect value for last_msg_.flags, expected 536870921, is " + << last_msg_.flags; } diff --git a/c/test/cpp/auto_check_sbp_system_MsgInsUpdates.cc b/c/test/cpp/auto_check_sbp_system_MsgInsUpdates.cc index 60a79ffaa..52745133b 100644 --- a/c/test/cpp/auto_check_sbp_system_MsgInsUpdates.cc +++ b/c/test/cpp/auto_check_sbp_system_MsgInsUpdates.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgInsUpdates.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgInsUpdates.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_system_MsgInsUpdates0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgInsUpdates0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_system_MsgInsUpdates0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgInsUpdates0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_ins_updates_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ins_updates_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,44 +67,57 @@ class Test_auto_check_sbp_system_MsgInsUpdates0 : sbp_msg_ins_updates_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgInsUpdates0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_system_MsgInsUpdates0, Test) { + uint8_t encoded_frame[] = { + 85, 6, 255, 21, 3, 10, 84, 229, 17, 30, 0, 0, 0, 0, 0, 0, 81, 63, + }; - uint8_t encoded_frame[] = {85,6,255,21,3,10,84,229,17,30,0,0,0,0,0,0,81,63, }; + sbp_msg_ins_updates_t test_msg{}; + test_msg.gnsspos = 0; + test_msg.gnssvel = 0; + test_msg.nhc = 0; + test_msg.speed = 0; + test_msg.tow = 504489300; + test_msg.wheelticks = 0; + test_msg.zerovel = 0; - sbp_msg_ins_updates_t test_msg{}; - test_msg.gnsspos = 0; - test_msg.gnssvel = 0; - test_msg.nhc = 0; - test_msg.speed = 0; - test_msg.tow = 504489300; - test_msg.wheelticks = 0; - test_msg.zerovel = 0; - - EXPECT_EQ(send_message( 789, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(789, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 789); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.gnsspos, 0) << "incorrect value for last_msg_.gnsspos, expected 0, is " << last_msg_.gnsspos; - EXPECT_EQ(last_msg_.gnssvel, 0) << "incorrect value for last_msg_.gnssvel, expected 0, is " << last_msg_.gnssvel; - EXPECT_EQ(last_msg_.nhc, 0) << "incorrect value for last_msg_.nhc, expected 0, is " << last_msg_.nhc; - EXPECT_EQ(last_msg_.speed, 0) << "incorrect value for last_msg_.speed, expected 0, is " << last_msg_.speed; - EXPECT_EQ(last_msg_.tow, 504489300) << "incorrect value for last_msg_.tow, expected 504489300, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wheelticks, 0) << "incorrect value for last_msg_.wheelticks, expected 0, is " << last_msg_.wheelticks; - EXPECT_EQ(last_msg_.zerovel, 0) << "incorrect value for last_msg_.zerovel, expected 0, is " << last_msg_.zerovel; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 789); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.gnsspos, 0) + << "incorrect value for last_msg_.gnsspos, expected 0, is " + << last_msg_.gnsspos; + EXPECT_EQ(last_msg_.gnssvel, 0) + << "incorrect value for last_msg_.gnssvel, expected 0, is " + << last_msg_.gnssvel; + EXPECT_EQ(last_msg_.nhc, 0) + << "incorrect value for last_msg_.nhc, expected 0, is " << last_msg_.nhc; + EXPECT_EQ(last_msg_.speed, 0) + << "incorrect value for last_msg_.speed, expected 0, is " + << last_msg_.speed; + EXPECT_EQ(last_msg_.tow, 504489300) + << "incorrect value for last_msg_.tow, expected 504489300, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wheelticks, 0) + << "incorrect value for last_msg_.wheelticks, expected 0, is " + << last_msg_.wheelticks; + EXPECT_EQ(last_msg_.zerovel, 0) + << "incorrect value for last_msg_.zerovel, expected 0, is " + << last_msg_.zerovel; } diff --git a/c/test/cpp/auto_check_sbp_system_MsgPpsTime.cc b/c/test/cpp/auto_check_sbp_system_MsgPpsTime.cc index 22cf22c61..544a46e47 100644 --- a/c/test/cpp/auto_check_sbp_system_MsgPpsTime.cc +++ b/c/test/cpp/auto_check_sbp_system_MsgPpsTime.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgPpsTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgPpsTime.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_system_MsgPpsTime0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgPpsTime0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_system_MsgPpsTime0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgPpsTime0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_pps_time_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_pps_time_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,34 +67,38 @@ class Test_auto_check_sbp_system_MsgPpsTime0 : sbp_msg_pps_time_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgPpsTime0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_system_MsgPpsTime0, Test) { + uint8_t encoded_frame[] = { + 85, 8, 255, 222, 209, 9, 140, 146, 133, 197, 160, 0, 0, 0, 255, 125, 149, + }; - uint8_t encoded_frame[] = {85,8,255,222,209,9,140,146,133,197,160,0,0,0,255,125,149, }; + sbp_msg_pps_time_t test_msg{}; + test_msg.flags = 255; + test_msg.time = 690508632716; - sbp_msg_pps_time_t test_msg{}; - test_msg.flags = 255; - test_msg.time = 690508632716; - - EXPECT_EQ(send_message( 53726, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(53726, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 53726); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 255) << "incorrect value for last_msg_.flags, expected 255, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.time, 690508632716) << "incorrect value for last_msg_.time, expected 690508632716, is " << last_msg_.time; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 53726); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 255) + << "incorrect value for last_msg_.flags, expected 255, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.time, 690508632716) + << "incorrect value for last_msg_.time, expected 690508632716, is " + << last_msg_.time; } diff --git a/c/test/cpp/auto_check_sbp_system_MsgSensorAidEvent.cc b/c/test/cpp/auto_check_sbp_system_MsgSensorAidEvent.cc index 6b84c3e96..f68cae220 100644 --- a/c/test/cpp/auto_check_sbp_system_MsgSensorAidEvent.cc +++ b/c/test/cpp/auto_check_sbp_system_MsgSensorAidEvent.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgSensorAidEvent.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgSensorAidEvent.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_system_MsgSensorAidEvent0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgSensorAidEvent0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_system_MsgSensorAidEvent0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgSensorAidEvent0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_sensor_aid_event_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_sensor_aid_event_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,46 +67,63 @@ class Test_auto_check_sbp_system_MsgSensorAidEvent0 : sbp_msg_sensor_aid_event_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgSensorAidEvent0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_system_MsgSensorAidEvent0, Test) { + uint8_t encoded_frame[] = { + 85, 9, 255, 211, 136, 15, 48, 246, 122, 19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 236, + }; - uint8_t encoded_frame[] = {85,9,255,211,136,15,48,246,122,19,0,0,0,0,0,0,0,0,0,0,0,33,236, }; + sbp_msg_sensor_aid_event_t test_msg{}; + test_msg.flags = 0; + test_msg.n_accepted_meas = 0; + test_msg.n_attempted_meas = 0; + test_msg.n_available_meas = 0; + test_msg.sensor_id = 0; + test_msg.sensor_state = 0; + test_msg.sensor_type = 0; + test_msg.time = 326825520; - sbp_msg_sensor_aid_event_t test_msg{}; - test_msg.flags = 0; - test_msg.n_accepted_meas = 0; - test_msg.n_attempted_meas = 0; - test_msg.n_available_meas = 0; - test_msg.sensor_id = 0; - test_msg.sensor_state = 0; - test_msg.sensor_type = 0; - test_msg.time = 326825520; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_accepted_meas, 0) << "incorrect value for last_msg_.n_accepted_meas, expected 0, is " << last_msg_.n_accepted_meas; - EXPECT_EQ(last_msg_.n_attempted_meas, 0) << "incorrect value for last_msg_.n_attempted_meas, expected 0, is " << last_msg_.n_attempted_meas; - EXPECT_EQ(last_msg_.n_available_meas, 0) << "incorrect value for last_msg_.n_available_meas, expected 0, is " << last_msg_.n_available_meas; - EXPECT_EQ(last_msg_.sensor_id, 0) << "incorrect value for last_msg_.sensor_id, expected 0, is " << last_msg_.sensor_id; - EXPECT_EQ(last_msg_.sensor_state, 0) << "incorrect value for last_msg_.sensor_state, expected 0, is " << last_msg_.sensor_state; - EXPECT_EQ(last_msg_.sensor_type, 0) << "incorrect value for last_msg_.sensor_type, expected 0, is " << last_msg_.sensor_type; - EXPECT_EQ(last_msg_.time, 326825520) << "incorrect value for last_msg_.time, expected 326825520, is " << last_msg_.time; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_accepted_meas, 0) + << "incorrect value for last_msg_.n_accepted_meas, expected 0, is " + << last_msg_.n_accepted_meas; + EXPECT_EQ(last_msg_.n_attempted_meas, 0) + << "incorrect value for last_msg_.n_attempted_meas, expected 0, is " + << last_msg_.n_attempted_meas; + EXPECT_EQ(last_msg_.n_available_meas, 0) + << "incorrect value for last_msg_.n_available_meas, expected 0, is " + << last_msg_.n_available_meas; + EXPECT_EQ(last_msg_.sensor_id, 0) + << "incorrect value for last_msg_.sensor_id, expected 0, is " + << last_msg_.sensor_id; + EXPECT_EQ(last_msg_.sensor_state, 0) + << "incorrect value for last_msg_.sensor_state, expected 0, is " + << last_msg_.sensor_state; + EXPECT_EQ(last_msg_.sensor_type, 0) + << "incorrect value for last_msg_.sensor_type, expected 0, is " + << last_msg_.sensor_type; + EXPECT_EQ(last_msg_.time, 326825520) + << "incorrect value for last_msg_.time, expected 326825520, is " + << last_msg_.time; } diff --git a/c/test/cpp/auto_check_sbp_system_MsgStartup.cc b/c/test/cpp/auto_check_sbp_system_MsgStartup.cc index 8e44f4dc9..866140940 100644 --- a/c/test/cpp/auto_check_sbp_system_MsgStartup.cc +++ b/c/test/cpp/auto_check_sbp_system_MsgStartup.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgStartup.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgStartup.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_system_MsgStartup0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgStartup0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_system_MsgStartup0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgStartup0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_startup_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_startup_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,86 +67,86 @@ class Test_auto_check_sbp_system_MsgStartup0 : sbp_msg_startup_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgStartup0, Test) -{ - - uint8_t encoded_frame[] = {85,0,255,66,0,4,0,0,0,0,70,160, }; - - sbp_msg_startup_t test_msg{}; - test_msg.cause = 0; - test_msg.reserved = 0; - test_msg.startup_type = 0; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cause, 0) << "incorrect value for last_msg_.cause, expected 0, is " << last_msg_.cause; - EXPECT_EQ(last_msg_.reserved, 0) << "incorrect value for last_msg_.reserved, expected 0, is " << last_msg_.reserved; - EXPECT_EQ(last_msg_.startup_type, 0) << "incorrect value for last_msg_.startup_type, expected 0, is " << last_msg_.startup_type; +}; + +TEST_F(Test_auto_check_sbp_system_MsgStartup0, Test) { + uint8_t encoded_frame[] = { + 85, 0, 255, 66, 0, 4, 0, 0, 0, 0, 70, 160, + }; + + sbp_msg_startup_t test_msg{}; + test_msg.cause = 0; + test_msg.reserved = 0; + test_msg.startup_type = 0; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cause, 0) + << "incorrect value for last_msg_.cause, expected 0, is " + << last_msg_.cause; + EXPECT_EQ(last_msg_.reserved, 0) + << "incorrect value for last_msg_.reserved, expected 0, is " + << last_msg_.reserved; + EXPECT_EQ(last_msg_.startup_type, 0) + << "incorrect value for last_msg_.startup_type, expected 0, is " + << last_msg_.startup_type; } -class Test_auto_check_sbp_system_MsgStartup1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgStartup1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_system_MsgStartup1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgStartup1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_startup_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_startup_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -158,36 +154,42 @@ class Test_auto_check_sbp_system_MsgStartup1 : sbp_msg_startup_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgStartup1, Test) -{ - - uint8_t encoded_frame[] = {85,0,255,195,4,4,0,0,0,0,127,181, }; - - sbp_msg_startup_t test_msg{}; - test_msg.cause = 0; - test_msg.reserved = 0; - test_msg.startup_type = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.cause, 0) << "incorrect value for last_msg_.cause, expected 0, is " << last_msg_.cause; - EXPECT_EQ(last_msg_.reserved, 0) << "incorrect value for last_msg_.reserved, expected 0, is " << last_msg_.reserved; - EXPECT_EQ(last_msg_.startup_type, 0) << "incorrect value for last_msg_.startup_type, expected 0, is " << last_msg_.startup_type; +}; + +TEST_F(Test_auto_check_sbp_system_MsgStartup1, Test) { + uint8_t encoded_frame[] = { + 85, 0, 255, 195, 4, 4, 0, 0, 0, 0, 127, 181, + }; + + sbp_msg_startup_t test_msg{}; + test_msg.cause = 0; + test_msg.reserved = 0; + test_msg.startup_type = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.cause, 0) + << "incorrect value for last_msg_.cause, expected 0, is " + << last_msg_.cause; + EXPECT_EQ(last_msg_.reserved, 0) + << "incorrect value for last_msg_.reserved, expected 0, is " + << last_msg_.reserved; + EXPECT_EQ(last_msg_.startup_type, 0) + << "incorrect value for last_msg_.startup_type, expected 0, is " + << last_msg_.startup_type; } diff --git a/c/test/cpp/auto_check_sbp_system_MsgStatusJournal.cc b/c/test/cpp/auto_check_sbp_system_MsgStatusJournal.cc index c76961269..3b1e20ad2 100644 --- a/c/test/cpp/auto_check_sbp_system_MsgStatusJournal.cc +++ b/c/test/cpp/auto_check_sbp_system_MsgStatusJournal.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusJournal.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusJournal.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_system_MsgStatusJournal0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgStatusJournal0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_system_MsgStatusJournal0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgStatusJournal0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_status_journal_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_status_journal_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,133 +67,188 @@ class Test_auto_check_sbp_system_MsgStatusJournal0 : sbp_msg_status_journal_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgStatusJournal0, Test) -{ +}; - uint8_t encoded_frame[] = {85,253,255,211,136,33,1,0,1,4,100,0,0,0,16,146,16,0,0,6,0,1,13,186,19,0,0,6,0,1,14,184,34,0,0,6,0,1,15,113,119, }; +TEST_F(Test_auto_check_sbp_system_MsgStatusJournal0, Test) { + uint8_t encoded_frame[] = { + 85, 253, 255, 211, 136, 33, 1, 0, 1, 4, 100, 0, 0, 0, + 16, 146, 16, 0, 0, 6, 0, 1, 13, 186, 19, 0, 0, 6, + 0, 1, 14, 184, 34, 0, 0, 6, 0, 1, 15, 113, 119, + }; - sbp_msg_status_journal_t test_msg{}; - - test_msg.journal[0].report.component = 6; - test_msg.journal[0].report.generic = 1; - test_msg.journal[0].report.specific = 13; - test_msg.journal[0].uptime = 4242; - - test_msg.journal[1].report.component = 6; - test_msg.journal[1].report.generic = 1; - test_msg.journal[1].report.specific = 14; - test_msg.journal[1].uptime = 5050; - - test_msg.journal[2].report.component = 6; - test_msg.journal[2].report.generic = 1; - test_msg.journal[2].report.specific = 15; - test_msg.journal[2].uptime = 8888; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_journal.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)106,(char)111,(char)117,(char)114,(char)110,(char)97,(char)108 }; - memcpy(test_msg.n_journal.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_journal.value = 3; - test_msg.reporting_system = 1; - test_msg.sbp_version = 1025; - test_msg.sequence_descriptor = 16; - test_msg.total_status_reports = 100; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + sbp_msg_status_journal_t test_msg{}; + + test_msg.journal[0].report.component = 6; + test_msg.journal[0].report.generic = 1; + test_msg.journal[0].report.specific = 13; + test_msg.journal[0].uptime = 4242; + + test_msg.journal[1].report.component = 6; + test_msg.journal[1].report.generic = 1; + test_msg.journal[1].report.specific = 14; + test_msg.journal[1].uptime = 5050; + + test_msg.journal[2].report.component = 6; + test_msg.journal[2].report.generic = 1; + test_msg.journal[2].report.specific = 15; + test_msg.journal[2].uptime = 8888; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_journal.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)106, (char)111, (char)117, (char)114, + (char)110, (char)97, (char)108}; + memcpy(test_msg.n_journal.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_journal.value = 3; + test_msg.reporting_system = 1; + test_msg.sbp_version = 1025; + test_msg.sequence_descriptor = 16; + test_msg.total_status_reports = 100; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.journal[0].report.component, 6) << "incorrect value for last_msg_.journal[0].report.component, expected 6, is " << last_msg_.journal[0].report.component; - EXPECT_EQ(last_msg_.journal[0].report.generic, 1) << "incorrect value for last_msg_.journal[0].report.generic, expected 1, is " << last_msg_.journal[0].report.generic; - EXPECT_EQ(last_msg_.journal[0].report.specific, 13) << "incorrect value for last_msg_.journal[0].report.specific, expected 13, is " << last_msg_.journal[0].report.specific; - EXPECT_EQ(last_msg_.journal[0].uptime, 4242) << "incorrect value for last_msg_.journal[0].uptime, expected 4242, is " << last_msg_.journal[0].uptime; - EXPECT_EQ(last_msg_.journal[1].report.component, 6) << "incorrect value for last_msg_.journal[1].report.component, expected 6, is " << last_msg_.journal[1].report.component; - EXPECT_EQ(last_msg_.journal[1].report.generic, 1) << "incorrect value for last_msg_.journal[1].report.generic, expected 1, is " << last_msg_.journal[1].report.generic; - EXPECT_EQ(last_msg_.journal[1].report.specific, 14) << "incorrect value for last_msg_.journal[1].report.specific, expected 14, is " << last_msg_.journal[1].report.specific; - EXPECT_EQ(last_msg_.journal[1].uptime, 5050) << "incorrect value for last_msg_.journal[1].uptime, expected 5050, is " << last_msg_.journal[1].uptime; - EXPECT_EQ(last_msg_.journal[2].report.component, 6) << "incorrect value for last_msg_.journal[2].report.component, expected 6, is " << last_msg_.journal[2].report.component; - EXPECT_EQ(last_msg_.journal[2].report.generic, 1) << "incorrect value for last_msg_.journal[2].report.generic, expected 1, is " << last_msg_.journal[2].report.generic; - EXPECT_EQ(last_msg_.journal[2].report.specific, 15) << "incorrect value for last_msg_.journal[2].report.specific, expected 15, is " << last_msg_.journal[2].report.specific; - EXPECT_EQ(last_msg_.journal[2].uptime, 8888) << "incorrect value for last_msg_.journal[2].uptime, expected 8888, is " << last_msg_.journal[2].uptime; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_journal.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_journal.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_journal.handle_as << "'"; - } - { - const char check_string[] = { (char)106,(char)111,(char)117,(char)114,(char)110,(char)97,(char)108 }; - EXPECT_EQ(memcmp(last_msg_.n_journal.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_journal.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_journal.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_journal.value, 3) << "incorrect value for last_msg_.n_journal.value, expected 3, is " << last_msg_.n_journal.value; - EXPECT_EQ(last_msg_.reporting_system, 1) << "incorrect value for last_msg_.reporting_system, expected 1, is " << last_msg_.reporting_system; - EXPECT_EQ(last_msg_.sbp_version, 1025) << "incorrect value for last_msg_.sbp_version, expected 1025, is " << last_msg_.sbp_version; - EXPECT_EQ(last_msg_.sequence_descriptor, 16) << "incorrect value for last_msg_.sequence_descriptor, expected 16, is " << last_msg_.sequence_descriptor; - EXPECT_EQ(last_msg_.total_status_reports, 100) << "incorrect value for last_msg_.total_status_reports, expected 100, is " << last_msg_.total_status_reports; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.journal[0].report.component, 6) + << "incorrect value for last_msg_.journal[0].report.component, expected " + "6, is " + << last_msg_.journal[0].report.component; + EXPECT_EQ(last_msg_.journal[0].report.generic, 1) + << "incorrect value for last_msg_.journal[0].report.generic, expected 1, " + "is " + << last_msg_.journal[0].report.generic; + EXPECT_EQ(last_msg_.journal[0].report.specific, 13) + << "incorrect value for last_msg_.journal[0].report.specific, expected " + "13, is " + << last_msg_.journal[0].report.specific; + EXPECT_EQ(last_msg_.journal[0].uptime, 4242) + << "incorrect value for last_msg_.journal[0].uptime, expected 4242, is " + << last_msg_.journal[0].uptime; + EXPECT_EQ(last_msg_.journal[1].report.component, 6) + << "incorrect value for last_msg_.journal[1].report.component, expected " + "6, is " + << last_msg_.journal[1].report.component; + EXPECT_EQ(last_msg_.journal[1].report.generic, 1) + << "incorrect value for last_msg_.journal[1].report.generic, expected 1, " + "is " + << last_msg_.journal[1].report.generic; + EXPECT_EQ(last_msg_.journal[1].report.specific, 14) + << "incorrect value for last_msg_.journal[1].report.specific, expected " + "14, is " + << last_msg_.journal[1].report.specific; + EXPECT_EQ(last_msg_.journal[1].uptime, 5050) + << "incorrect value for last_msg_.journal[1].uptime, expected 5050, is " + << last_msg_.journal[1].uptime; + EXPECT_EQ(last_msg_.journal[2].report.component, 6) + << "incorrect value for last_msg_.journal[2].report.component, expected " + "6, is " + << last_msg_.journal[2].report.component; + EXPECT_EQ(last_msg_.journal[2].report.generic, 1) + << "incorrect value for last_msg_.journal[2].report.generic, expected 1, " + "is " + << last_msg_.journal[2].report.generic; + EXPECT_EQ(last_msg_.journal[2].report.specific, 15) + << "incorrect value for last_msg_.journal[2].report.specific, expected " + "15, is " + << last_msg_.journal[2].report.specific; + EXPECT_EQ(last_msg_.journal[2].uptime, 8888) + << "incorrect value for last_msg_.journal[2].uptime, expected 8888, is " + << last_msg_.journal[2].uptime; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_journal.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_journal.handle_as, expected string " + "'" + << check_string << "', is '" << last_msg_.n_journal.handle_as << "'"; + } + { + const char check_string[] = {(char)106, (char)111, (char)117, (char)114, + (char)110, (char)97, (char)108}; + EXPECT_EQ(memcmp(last_msg_.n_journal.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_journal.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_journal.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_journal.value, 3) + << "incorrect value for last_msg_.n_journal.value, expected 3, is " + << last_msg_.n_journal.value; + EXPECT_EQ(last_msg_.reporting_system, 1) + << "incorrect value for last_msg_.reporting_system, expected 1, is " + << last_msg_.reporting_system; + EXPECT_EQ(last_msg_.sbp_version, 1025) + << "incorrect value for last_msg_.sbp_version, expected 1025, is " + << last_msg_.sbp_version; + EXPECT_EQ(last_msg_.sequence_descriptor, 16) + << "incorrect value for last_msg_.sequence_descriptor, expected 16, is " + << last_msg_.sequence_descriptor; + EXPECT_EQ(last_msg_.total_status_reports, 100) + << "incorrect value for last_msg_.total_status_reports, expected 100, is " + << last_msg_.total_status_reports; } -class Test_auto_check_sbp_system_MsgStatusJournal1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgStatusJournal1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_system_MsgStatusJournal1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgStatusJournal1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_status_journal_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_status_journal_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -205,65 +256,103 @@ class Test_auto_check_sbp_system_MsgStatusJournal1 : sbp_msg_status_journal_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgStatusJournal1, Test) -{ +}; - uint8_t encoded_frame[] = {85,253,255,211,136,17,1,0,1,4,100,0,0,0,16,146,16,0,0,6,0,1,13,144,121, }; +TEST_F(Test_auto_check_sbp_system_MsgStatusJournal1, Test) { + uint8_t encoded_frame[] = { + 85, 253, 255, 211, 136, 17, 1, 0, 1, 4, 100, 0, 0, + 0, 16, 146, 16, 0, 0, 6, 0, 1, 13, 144, 121, + }; - sbp_msg_status_journal_t test_msg{}; - - test_msg.journal[0].report.component = 6; - test_msg.journal[0].report.generic = 1; - test_msg.journal[0].report.specific = 13; - test_msg.journal[0].uptime = 4242; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_journal.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)106,(char)111,(char)117,(char)114,(char)110,(char)97,(char)108 }; - memcpy(test_msg.n_journal.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_journal.value = 1; - test_msg.reporting_system = 1; - test_msg.sbp_version = 1025; - test_msg.sequence_descriptor = 16; - test_msg.total_status_reports = 100; - - EXPECT_EQ(send_message( 35027, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + sbp_msg_status_journal_t test_msg{}; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.journal[0].report.component, 6) << "incorrect value for last_msg_.journal[0].report.component, expected 6, is " << last_msg_.journal[0].report.component; - EXPECT_EQ(last_msg_.journal[0].report.generic, 1) << "incorrect value for last_msg_.journal[0].report.generic, expected 1, is " << last_msg_.journal[0].report.generic; - EXPECT_EQ(last_msg_.journal[0].report.specific, 13) << "incorrect value for last_msg_.journal[0].report.specific, expected 13, is " << last_msg_.journal[0].report.specific; - EXPECT_EQ(last_msg_.journal[0].uptime, 4242) << "incorrect value for last_msg_.journal[0].uptime, expected 4242, is " << last_msg_.journal[0].uptime; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_journal.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_journal.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_journal.handle_as << "'"; - } - { - const char check_string[] = { (char)106,(char)111,(char)117,(char)114,(char)110,(char)97,(char)108 }; - EXPECT_EQ(memcmp(last_msg_.n_journal.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_journal.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_journal.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_journal.value, 1) << "incorrect value for last_msg_.n_journal.value, expected 1, is " << last_msg_.n_journal.value; - EXPECT_EQ(last_msg_.reporting_system, 1) << "incorrect value for last_msg_.reporting_system, expected 1, is " << last_msg_.reporting_system; - EXPECT_EQ(last_msg_.sbp_version, 1025) << "incorrect value for last_msg_.sbp_version, expected 1025, is " << last_msg_.sbp_version; - EXPECT_EQ(last_msg_.sequence_descriptor, 16) << "incorrect value for last_msg_.sequence_descriptor, expected 16, is " << last_msg_.sequence_descriptor; - EXPECT_EQ(last_msg_.total_status_reports, 100) << "incorrect value for last_msg_.total_status_reports, expected 100, is " << last_msg_.total_status_reports; + test_msg.journal[0].report.component = 6; + test_msg.journal[0].report.generic = 1; + test_msg.journal[0].report.specific = 13; + test_msg.journal[0].uptime = 4242; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_journal.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)106, (char)111, (char)117, (char)114, + (char)110, (char)97, (char)108}; + memcpy(test_msg.n_journal.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_journal.value = 1; + test_msg.reporting_system = 1; + test_msg.sbp_version = 1025; + test_msg.sequence_descriptor = 16; + test_msg.total_status_reports = 100; + + EXPECT_EQ(send_message(35027, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.journal[0].report.component, 6) + << "incorrect value for last_msg_.journal[0].report.component, expected " + "6, is " + << last_msg_.journal[0].report.component; + EXPECT_EQ(last_msg_.journal[0].report.generic, 1) + << "incorrect value for last_msg_.journal[0].report.generic, expected 1, " + "is " + << last_msg_.journal[0].report.generic; + EXPECT_EQ(last_msg_.journal[0].report.specific, 13) + << "incorrect value for last_msg_.journal[0].report.specific, expected " + "13, is " + << last_msg_.journal[0].report.specific; + EXPECT_EQ(last_msg_.journal[0].uptime, 4242) + << "incorrect value for last_msg_.journal[0].uptime, expected 4242, is " + << last_msg_.journal[0].uptime; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_journal.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_journal.handle_as, expected string " + "'" + << check_string << "', is '" << last_msg_.n_journal.handle_as << "'"; + } + { + const char check_string[] = {(char)106, (char)111, (char)117, (char)114, + (char)110, (char)97, (char)108}; + EXPECT_EQ(memcmp(last_msg_.n_journal.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_journal.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_journal.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_journal.value, 1) + << "incorrect value for last_msg_.n_journal.value, expected 1, is " + << last_msg_.n_journal.value; + EXPECT_EQ(last_msg_.reporting_system, 1) + << "incorrect value for last_msg_.reporting_system, expected 1, is " + << last_msg_.reporting_system; + EXPECT_EQ(last_msg_.sbp_version, 1025) + << "incorrect value for last_msg_.sbp_version, expected 1025, is " + << last_msg_.sbp_version; + EXPECT_EQ(last_msg_.sequence_descriptor, 16) + << "incorrect value for last_msg_.sequence_descriptor, expected 16, is " + << last_msg_.sequence_descriptor; + EXPECT_EQ(last_msg_.total_status_reports, 100) + << "incorrect value for last_msg_.total_status_reports, expected 100, is " + << last_msg_.total_status_reports; } diff --git a/c/test/cpp/auto_check_sbp_system_MsgStatusReport.cc b/c/test/cpp/auto_check_sbp_system_MsgStatusReport.cc index c010a69ef..d37654b58 100644 --- a/c/test/cpp/auto_check_sbp_system_MsgStatusReport.cc +++ b/c/test/cpp/auto_check_sbp_system_MsgStatusReport.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusReport.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusReport.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_system_MsgStatusReport0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_system_MsgStatusReport0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_system_MsgStatusReport0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_system_MsgStatusReport0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_status_report_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_status_report_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,476 +67,936 @@ class Test_auto_check_sbp_system_MsgStatusReport0 : sbp_msg_status_report_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_system_MsgStatusReport0, Test) -{ - - uint8_t encoded_frame[] = {85,254,255,6,84,252,82,253,177,95,3,60,143,90,233,21,208,98,247,203,221,198,156,207,217,238,162,136,154,11,114,236,134,235,12,133,9,30,175,145,26,114,215,20,146,249,54,54,133,193,106,186,210,183,0,129,5,248,225,149,135,127,2,26,88,92,10,103,73,3,103,68,76,184,33,206,194,163,123,30,151,176,149,172,184,231,118,230,200,168,100,109,10,233,4,60,247,82,215,166,28,138,110,45,98,218,244,179,126,107,92,124,94,157,42,187,124,6,97,247,160,188,110,120,254,214,110,51,240,164,147,18,74,178,67,4,27,73,190,64,179,146,125,153,192,46,202,66,248,46,40,161,173,242,214,3,11,1,118,70,162,61,178,27,156,40,191,113,230,200,72,8,215,245,78,59,222,250,115,32,33,30,211,170,145,92,157,75,24,169,6,55,62,8,107,82,140,49,179,122,90,71,28,88,103,51,177,72,93,39,148,11,202,42,34,92,204,102,29,98,249,91,134,95,23,248,192,20,83,195,95,180,54,36,186,75,64,20,157,133,12,149,28,14,185,129,101,239,74,248,245,30,228,88,142,212,53,224,158,166, }; - - sbp_msg_status_report_t test_msg{}; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_status.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)97,(char)116,(char)117,(char)115 }; - memcpy(test_msg.n_status.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_status.value = 60; - test_msg.reporting_system = 64850; - test_msg.sbp_version = 24497; - test_msg.sequence = 1519336451; - - test_msg.status[0].component = 52215; - test_msg.status[0].generic = 221; - test_msg.status[0].specific = 198; - - test_msg.status[1].component = 53148; - test_msg.status[1].generic = 217; - test_msg.status[1].specific = 238; - - test_msg.status[2].component = 34978; - test_msg.status[2].generic = 154; - test_msg.status[2].specific = 11; - - test_msg.status[3].component = 60530; - test_msg.status[3].generic = 134; - test_msg.status[3].specific = 235; - - test_msg.status[4].component = 34060; - test_msg.status[4].generic = 9; - test_msg.status[4].specific = 30; - - test_msg.status[5].component = 37295; - test_msg.status[5].generic = 26; - test_msg.status[5].specific = 114; - - test_msg.status[6].component = 5335; - test_msg.status[6].generic = 146; - test_msg.status[6].specific = 249; - - test_msg.status[7].component = 13878; - test_msg.status[7].generic = 133; - test_msg.status[7].specific = 193; - - test_msg.status[8].component = 47722; - test_msg.status[8].generic = 210; - test_msg.status[8].specific = 183; - - test_msg.status[9].component = 33024; - test_msg.status[9].generic = 5; - test_msg.status[9].specific = 248; - - test_msg.status[10].component = 38369; - test_msg.status[10].generic = 135; - test_msg.status[10].specific = 127; - - test_msg.status[11].component = 6658; - test_msg.status[11].generic = 88; - test_msg.status[11].specific = 92; - - test_msg.status[12].component = 26378; - test_msg.status[12].generic = 73; - test_msg.status[12].specific = 3; - - test_msg.status[13].component = 17511; - test_msg.status[13].generic = 76; - test_msg.status[13].specific = 184; - - test_msg.status[14].component = 52769; - test_msg.status[14].generic = 194; - test_msg.status[14].specific = 163; - - test_msg.status[15].component = 7803; - test_msg.status[15].generic = 151; - test_msg.status[15].specific = 176; - - test_msg.status[16].component = 44181; - test_msg.status[16].generic = 184; - test_msg.status[16].specific = 231; - - test_msg.status[17].component = 58998; - test_msg.status[17].generic = 200; - test_msg.status[17].specific = 168; - - test_msg.status[18].component = 28004; - test_msg.status[18].generic = 10; - test_msg.status[18].specific = 233; - - test_msg.status[19].component = 15364; - test_msg.status[19].generic = 247; - test_msg.status[19].specific = 82; - - test_msg.status[20].component = 42711; - test_msg.status[20].generic = 28; - test_msg.status[20].specific = 138; - - test_msg.status[21].component = 11630; - test_msg.status[21].generic = 98; - test_msg.status[21].specific = 218; - - test_msg.status[22].component = 46068; - test_msg.status[22].generic = 126; - test_msg.status[22].specific = 107; - - test_msg.status[23].component = 31836; - test_msg.status[23].generic = 94; - test_msg.status[23].specific = 157; - - test_msg.status[24].component = 47914; - test_msg.status[24].generic = 124; - test_msg.status[24].specific = 6; - - test_msg.status[25].component = 63329; - test_msg.status[25].generic = 160; - test_msg.status[25].specific = 188; - - test_msg.status[26].component = 30830; - test_msg.status[26].generic = 254; - test_msg.status[26].specific = 214; - - test_msg.status[27].component = 13166; - test_msg.status[27].generic = 240; - test_msg.status[27].specific = 164; - - test_msg.status[28].component = 4755; - test_msg.status[28].generic = 74; - test_msg.status[28].specific = 178; - - test_msg.status[29].component = 1091; - test_msg.status[29].generic = 27; - test_msg.status[29].specific = 73; - - test_msg.status[30].component = 16574; - test_msg.status[30].generic = 179; - test_msg.status[30].specific = 146; - - test_msg.status[31].component = 39293; - test_msg.status[31].generic = 192; - test_msg.status[31].specific = 46; - - test_msg.status[32].component = 17098; - test_msg.status[32].generic = 248; - test_msg.status[32].specific = 46; - - test_msg.status[33].component = 41256; - test_msg.status[33].generic = 173; - test_msg.status[33].specific = 242; - - test_msg.status[34].component = 982; - test_msg.status[34].generic = 11; - test_msg.status[34].specific = 1; - - test_msg.status[35].component = 18038; - test_msg.status[35].generic = 162; - test_msg.status[35].specific = 61; - - test_msg.status[36].component = 7090; - test_msg.status[36].generic = 156; - test_msg.status[36].specific = 40; - - test_msg.status[37].component = 29119; - test_msg.status[37].generic = 230; - test_msg.status[37].specific = 200; - - test_msg.status[38].component = 2120; - test_msg.status[38].generic = 215; - test_msg.status[38].specific = 245; - - test_msg.status[39].component = 15182; - test_msg.status[39].generic = 222; - test_msg.status[39].specific = 250; - - test_msg.status[40].component = 8307; - test_msg.status[40].generic = 33; - test_msg.status[40].specific = 30; - - test_msg.status[41].component = 43731; - test_msg.status[41].generic = 145; - test_msg.status[41].specific = 92; - - test_msg.status[42].component = 19357; - test_msg.status[42].generic = 24; - test_msg.status[42].specific = 169; - - test_msg.status[43].component = 14086; - test_msg.status[43].generic = 62; - test_msg.status[43].specific = 8; - - test_msg.status[44].component = 21099; - test_msg.status[44].generic = 140; - test_msg.status[44].specific = 49; - - test_msg.status[45].component = 31411; - test_msg.status[45].generic = 90; - test_msg.status[45].specific = 71; - - test_msg.status[46].component = 22556; - test_msg.status[46].generic = 103; - test_msg.status[46].specific = 51; - - test_msg.status[47].component = 18609; - test_msg.status[47].generic = 93; - test_msg.status[47].specific = 39; - - test_msg.status[48].component = 2964; - test_msg.status[48].generic = 202; - test_msg.status[48].specific = 42; - - test_msg.status[49].component = 23586; - test_msg.status[49].generic = 204; - test_msg.status[49].specific = 102; - - test_msg.status[50].component = 25117; - test_msg.status[50].generic = 249; - test_msg.status[50].specific = 91; - - test_msg.status[51].component = 24454; - test_msg.status[51].generic = 23; - test_msg.status[51].specific = 248; - - test_msg.status[52].component = 5312; - test_msg.status[52].generic = 83; - test_msg.status[52].specific = 195; - - test_msg.status[53].component = 46175; - test_msg.status[53].generic = 54; - test_msg.status[53].specific = 36; - - test_msg.status[54].component = 19386; - test_msg.status[54].generic = 64; - test_msg.status[54].specific = 20; - - test_msg.status[55].component = 34205; - test_msg.status[55].generic = 12; - test_msg.status[55].specific = 149; - - test_msg.status[56].component = 3612; - test_msg.status[56].generic = 185; - test_msg.status[56].specific = 129; - - test_msg.status[57].component = 61285; - test_msg.status[57].generic = 74; - test_msg.status[57].specific = 248; - - test_msg.status[58].component = 7925; - test_msg.status[58].generic = 228; - test_msg.status[58].specific = 88; - - test_msg.status[59].component = 54414; - test_msg.status[59].generic = 53; - test_msg.status[59].specific = 224; - test_msg.uptime = 1657804265; - - EXPECT_EQ(send_message( 21510, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 21510); - EXPECT_EQ(last_msg_, test_msg); - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_status.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_status.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_status.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)97,(char)116,(char)117,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_status.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_status.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_status.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_status.value, 60) << "incorrect value for last_msg_.n_status.value, expected 60, is " << last_msg_.n_status.value; - EXPECT_EQ(last_msg_.reporting_system, 64850) << "incorrect value for last_msg_.reporting_system, expected 64850, is " << last_msg_.reporting_system; - EXPECT_EQ(last_msg_.sbp_version, 24497) << "incorrect value for last_msg_.sbp_version, expected 24497, is " << last_msg_.sbp_version; - EXPECT_EQ(last_msg_.sequence, 1519336451) << "incorrect value for last_msg_.sequence, expected 1519336451, is " << last_msg_.sequence; - EXPECT_EQ(last_msg_.status[0].component, 52215) << "incorrect value for last_msg_.status[0].component, expected 52215, is " << last_msg_.status[0].component; - EXPECT_EQ(last_msg_.status[0].generic, 221) << "incorrect value for last_msg_.status[0].generic, expected 221, is " << last_msg_.status[0].generic; - EXPECT_EQ(last_msg_.status[0].specific, 198) << "incorrect value for last_msg_.status[0].specific, expected 198, is " << last_msg_.status[0].specific; - EXPECT_EQ(last_msg_.status[1].component, 53148) << "incorrect value for last_msg_.status[1].component, expected 53148, is " << last_msg_.status[1].component; - EXPECT_EQ(last_msg_.status[1].generic, 217) << "incorrect value for last_msg_.status[1].generic, expected 217, is " << last_msg_.status[1].generic; - EXPECT_EQ(last_msg_.status[1].specific, 238) << "incorrect value for last_msg_.status[1].specific, expected 238, is " << last_msg_.status[1].specific; - EXPECT_EQ(last_msg_.status[2].component, 34978) << "incorrect value for last_msg_.status[2].component, expected 34978, is " << last_msg_.status[2].component; - EXPECT_EQ(last_msg_.status[2].generic, 154) << "incorrect value for last_msg_.status[2].generic, expected 154, is " << last_msg_.status[2].generic; - EXPECT_EQ(last_msg_.status[2].specific, 11) << "incorrect value for last_msg_.status[2].specific, expected 11, is " << last_msg_.status[2].specific; - EXPECT_EQ(last_msg_.status[3].component, 60530) << "incorrect value for last_msg_.status[3].component, expected 60530, is " << last_msg_.status[3].component; - EXPECT_EQ(last_msg_.status[3].generic, 134) << "incorrect value for last_msg_.status[3].generic, expected 134, is " << last_msg_.status[3].generic; - EXPECT_EQ(last_msg_.status[3].specific, 235) << "incorrect value for last_msg_.status[3].specific, expected 235, is " << last_msg_.status[3].specific; - EXPECT_EQ(last_msg_.status[4].component, 34060) << "incorrect value for last_msg_.status[4].component, expected 34060, is " << last_msg_.status[4].component; - EXPECT_EQ(last_msg_.status[4].generic, 9) << "incorrect value for last_msg_.status[4].generic, expected 9, is " << last_msg_.status[4].generic; - EXPECT_EQ(last_msg_.status[4].specific, 30) << "incorrect value for last_msg_.status[4].specific, expected 30, is " << last_msg_.status[4].specific; - EXPECT_EQ(last_msg_.status[5].component, 37295) << "incorrect value for last_msg_.status[5].component, expected 37295, is " << last_msg_.status[5].component; - EXPECT_EQ(last_msg_.status[5].generic, 26) << "incorrect value for last_msg_.status[5].generic, expected 26, is " << last_msg_.status[5].generic; - EXPECT_EQ(last_msg_.status[5].specific, 114) << "incorrect value for last_msg_.status[5].specific, expected 114, is " << last_msg_.status[5].specific; - EXPECT_EQ(last_msg_.status[6].component, 5335) << "incorrect value for last_msg_.status[6].component, expected 5335, is " << last_msg_.status[6].component; - EXPECT_EQ(last_msg_.status[6].generic, 146) << "incorrect value for last_msg_.status[6].generic, expected 146, is " << last_msg_.status[6].generic; - EXPECT_EQ(last_msg_.status[6].specific, 249) << "incorrect value for last_msg_.status[6].specific, expected 249, is " << last_msg_.status[6].specific; - EXPECT_EQ(last_msg_.status[7].component, 13878) << "incorrect value for last_msg_.status[7].component, expected 13878, is " << last_msg_.status[7].component; - EXPECT_EQ(last_msg_.status[7].generic, 133) << "incorrect value for last_msg_.status[7].generic, expected 133, is " << last_msg_.status[7].generic; - EXPECT_EQ(last_msg_.status[7].specific, 193) << "incorrect value for last_msg_.status[7].specific, expected 193, is " << last_msg_.status[7].specific; - EXPECT_EQ(last_msg_.status[8].component, 47722) << "incorrect value for last_msg_.status[8].component, expected 47722, is " << last_msg_.status[8].component; - EXPECT_EQ(last_msg_.status[8].generic, 210) << "incorrect value for last_msg_.status[8].generic, expected 210, is " << last_msg_.status[8].generic; - EXPECT_EQ(last_msg_.status[8].specific, 183) << "incorrect value for last_msg_.status[8].specific, expected 183, is " << last_msg_.status[8].specific; - EXPECT_EQ(last_msg_.status[9].component, 33024) << "incorrect value for last_msg_.status[9].component, expected 33024, is " << last_msg_.status[9].component; - EXPECT_EQ(last_msg_.status[9].generic, 5) << "incorrect value for last_msg_.status[9].generic, expected 5, is " << last_msg_.status[9].generic; - EXPECT_EQ(last_msg_.status[9].specific, 248) << "incorrect value for last_msg_.status[9].specific, expected 248, is " << last_msg_.status[9].specific; - EXPECT_EQ(last_msg_.status[10].component, 38369) << "incorrect value for last_msg_.status[10].component, expected 38369, is " << last_msg_.status[10].component; - EXPECT_EQ(last_msg_.status[10].generic, 135) << "incorrect value for last_msg_.status[10].generic, expected 135, is " << last_msg_.status[10].generic; - EXPECT_EQ(last_msg_.status[10].specific, 127) << "incorrect value for last_msg_.status[10].specific, expected 127, is " << last_msg_.status[10].specific; - EXPECT_EQ(last_msg_.status[11].component, 6658) << "incorrect value for last_msg_.status[11].component, expected 6658, is " << last_msg_.status[11].component; - EXPECT_EQ(last_msg_.status[11].generic, 88) << "incorrect value for last_msg_.status[11].generic, expected 88, is " << last_msg_.status[11].generic; - EXPECT_EQ(last_msg_.status[11].specific, 92) << "incorrect value for last_msg_.status[11].specific, expected 92, is " << last_msg_.status[11].specific; - EXPECT_EQ(last_msg_.status[12].component, 26378) << "incorrect value for last_msg_.status[12].component, expected 26378, is " << last_msg_.status[12].component; - EXPECT_EQ(last_msg_.status[12].generic, 73) << "incorrect value for last_msg_.status[12].generic, expected 73, is " << last_msg_.status[12].generic; - EXPECT_EQ(last_msg_.status[12].specific, 3) << "incorrect value for last_msg_.status[12].specific, expected 3, is " << last_msg_.status[12].specific; - EXPECT_EQ(last_msg_.status[13].component, 17511) << "incorrect value for last_msg_.status[13].component, expected 17511, is " << last_msg_.status[13].component; - EXPECT_EQ(last_msg_.status[13].generic, 76) << "incorrect value for last_msg_.status[13].generic, expected 76, is " << last_msg_.status[13].generic; - EXPECT_EQ(last_msg_.status[13].specific, 184) << "incorrect value for last_msg_.status[13].specific, expected 184, is " << last_msg_.status[13].specific; - EXPECT_EQ(last_msg_.status[14].component, 52769) << "incorrect value for last_msg_.status[14].component, expected 52769, is " << last_msg_.status[14].component; - EXPECT_EQ(last_msg_.status[14].generic, 194) << "incorrect value for last_msg_.status[14].generic, expected 194, is " << last_msg_.status[14].generic; - EXPECT_EQ(last_msg_.status[14].specific, 163) << "incorrect value for last_msg_.status[14].specific, expected 163, is " << last_msg_.status[14].specific; - EXPECT_EQ(last_msg_.status[15].component, 7803) << "incorrect value for last_msg_.status[15].component, expected 7803, is " << last_msg_.status[15].component; - EXPECT_EQ(last_msg_.status[15].generic, 151) << "incorrect value for last_msg_.status[15].generic, expected 151, is " << last_msg_.status[15].generic; - EXPECT_EQ(last_msg_.status[15].specific, 176) << "incorrect value for last_msg_.status[15].specific, expected 176, is " << last_msg_.status[15].specific; - EXPECT_EQ(last_msg_.status[16].component, 44181) << "incorrect value for last_msg_.status[16].component, expected 44181, is " << last_msg_.status[16].component; - EXPECT_EQ(last_msg_.status[16].generic, 184) << "incorrect value for last_msg_.status[16].generic, expected 184, is " << last_msg_.status[16].generic; - EXPECT_EQ(last_msg_.status[16].specific, 231) << "incorrect value for last_msg_.status[16].specific, expected 231, is " << last_msg_.status[16].specific; - EXPECT_EQ(last_msg_.status[17].component, 58998) << "incorrect value for last_msg_.status[17].component, expected 58998, is " << last_msg_.status[17].component; - EXPECT_EQ(last_msg_.status[17].generic, 200) << "incorrect value for last_msg_.status[17].generic, expected 200, is " << last_msg_.status[17].generic; - EXPECT_EQ(last_msg_.status[17].specific, 168) << "incorrect value for last_msg_.status[17].specific, expected 168, is " << last_msg_.status[17].specific; - EXPECT_EQ(last_msg_.status[18].component, 28004) << "incorrect value for last_msg_.status[18].component, expected 28004, is " << last_msg_.status[18].component; - EXPECT_EQ(last_msg_.status[18].generic, 10) << "incorrect value for last_msg_.status[18].generic, expected 10, is " << last_msg_.status[18].generic; - EXPECT_EQ(last_msg_.status[18].specific, 233) << "incorrect value for last_msg_.status[18].specific, expected 233, is " << last_msg_.status[18].specific; - EXPECT_EQ(last_msg_.status[19].component, 15364) << "incorrect value for last_msg_.status[19].component, expected 15364, is " << last_msg_.status[19].component; - EXPECT_EQ(last_msg_.status[19].generic, 247) << "incorrect value for last_msg_.status[19].generic, expected 247, is " << last_msg_.status[19].generic; - EXPECT_EQ(last_msg_.status[19].specific, 82) << "incorrect value for last_msg_.status[19].specific, expected 82, is " << last_msg_.status[19].specific; - EXPECT_EQ(last_msg_.status[20].component, 42711) << "incorrect value for last_msg_.status[20].component, expected 42711, is " << last_msg_.status[20].component; - EXPECT_EQ(last_msg_.status[20].generic, 28) << "incorrect value for last_msg_.status[20].generic, expected 28, is " << last_msg_.status[20].generic; - EXPECT_EQ(last_msg_.status[20].specific, 138) << "incorrect value for last_msg_.status[20].specific, expected 138, is " << last_msg_.status[20].specific; - EXPECT_EQ(last_msg_.status[21].component, 11630) << "incorrect value for last_msg_.status[21].component, expected 11630, is " << last_msg_.status[21].component; - EXPECT_EQ(last_msg_.status[21].generic, 98) << "incorrect value for last_msg_.status[21].generic, expected 98, is " << last_msg_.status[21].generic; - EXPECT_EQ(last_msg_.status[21].specific, 218) << "incorrect value for last_msg_.status[21].specific, expected 218, is " << last_msg_.status[21].specific; - EXPECT_EQ(last_msg_.status[22].component, 46068) << "incorrect value for last_msg_.status[22].component, expected 46068, is " << last_msg_.status[22].component; - EXPECT_EQ(last_msg_.status[22].generic, 126) << "incorrect value for last_msg_.status[22].generic, expected 126, is " << last_msg_.status[22].generic; - EXPECT_EQ(last_msg_.status[22].specific, 107) << "incorrect value for last_msg_.status[22].specific, expected 107, is " << last_msg_.status[22].specific; - EXPECT_EQ(last_msg_.status[23].component, 31836) << "incorrect value for last_msg_.status[23].component, expected 31836, is " << last_msg_.status[23].component; - EXPECT_EQ(last_msg_.status[23].generic, 94) << "incorrect value for last_msg_.status[23].generic, expected 94, is " << last_msg_.status[23].generic; - EXPECT_EQ(last_msg_.status[23].specific, 157) << "incorrect value for last_msg_.status[23].specific, expected 157, is " << last_msg_.status[23].specific; - EXPECT_EQ(last_msg_.status[24].component, 47914) << "incorrect value for last_msg_.status[24].component, expected 47914, is " << last_msg_.status[24].component; - EXPECT_EQ(last_msg_.status[24].generic, 124) << "incorrect value for last_msg_.status[24].generic, expected 124, is " << last_msg_.status[24].generic; - EXPECT_EQ(last_msg_.status[24].specific, 6) << "incorrect value for last_msg_.status[24].specific, expected 6, is " << last_msg_.status[24].specific; - EXPECT_EQ(last_msg_.status[25].component, 63329) << "incorrect value for last_msg_.status[25].component, expected 63329, is " << last_msg_.status[25].component; - EXPECT_EQ(last_msg_.status[25].generic, 160) << "incorrect value for last_msg_.status[25].generic, expected 160, is " << last_msg_.status[25].generic; - EXPECT_EQ(last_msg_.status[25].specific, 188) << "incorrect value for last_msg_.status[25].specific, expected 188, is " << last_msg_.status[25].specific; - EXPECT_EQ(last_msg_.status[26].component, 30830) << "incorrect value for last_msg_.status[26].component, expected 30830, is " << last_msg_.status[26].component; - EXPECT_EQ(last_msg_.status[26].generic, 254) << "incorrect value for last_msg_.status[26].generic, expected 254, is " << last_msg_.status[26].generic; - EXPECT_EQ(last_msg_.status[26].specific, 214) << "incorrect value for last_msg_.status[26].specific, expected 214, is " << last_msg_.status[26].specific; - EXPECT_EQ(last_msg_.status[27].component, 13166) << "incorrect value for last_msg_.status[27].component, expected 13166, is " << last_msg_.status[27].component; - EXPECT_EQ(last_msg_.status[27].generic, 240) << "incorrect value for last_msg_.status[27].generic, expected 240, is " << last_msg_.status[27].generic; - EXPECT_EQ(last_msg_.status[27].specific, 164) << "incorrect value for last_msg_.status[27].specific, expected 164, is " << last_msg_.status[27].specific; - EXPECT_EQ(last_msg_.status[28].component, 4755) << "incorrect value for last_msg_.status[28].component, expected 4755, is " << last_msg_.status[28].component; - EXPECT_EQ(last_msg_.status[28].generic, 74) << "incorrect value for last_msg_.status[28].generic, expected 74, is " << last_msg_.status[28].generic; - EXPECT_EQ(last_msg_.status[28].specific, 178) << "incorrect value for last_msg_.status[28].specific, expected 178, is " << last_msg_.status[28].specific; - EXPECT_EQ(last_msg_.status[29].component, 1091) << "incorrect value for last_msg_.status[29].component, expected 1091, is " << last_msg_.status[29].component; - EXPECT_EQ(last_msg_.status[29].generic, 27) << "incorrect value for last_msg_.status[29].generic, expected 27, is " << last_msg_.status[29].generic; - EXPECT_EQ(last_msg_.status[29].specific, 73) << "incorrect value for last_msg_.status[29].specific, expected 73, is " << last_msg_.status[29].specific; - EXPECT_EQ(last_msg_.status[30].component, 16574) << "incorrect value for last_msg_.status[30].component, expected 16574, is " << last_msg_.status[30].component; - EXPECT_EQ(last_msg_.status[30].generic, 179) << "incorrect value for last_msg_.status[30].generic, expected 179, is " << last_msg_.status[30].generic; - EXPECT_EQ(last_msg_.status[30].specific, 146) << "incorrect value for last_msg_.status[30].specific, expected 146, is " << last_msg_.status[30].specific; - EXPECT_EQ(last_msg_.status[31].component, 39293) << "incorrect value for last_msg_.status[31].component, expected 39293, is " << last_msg_.status[31].component; - EXPECT_EQ(last_msg_.status[31].generic, 192) << "incorrect value for last_msg_.status[31].generic, expected 192, is " << last_msg_.status[31].generic; - EXPECT_EQ(last_msg_.status[31].specific, 46) << "incorrect value for last_msg_.status[31].specific, expected 46, is " << last_msg_.status[31].specific; - EXPECT_EQ(last_msg_.status[32].component, 17098) << "incorrect value for last_msg_.status[32].component, expected 17098, is " << last_msg_.status[32].component; - EXPECT_EQ(last_msg_.status[32].generic, 248) << "incorrect value for last_msg_.status[32].generic, expected 248, is " << last_msg_.status[32].generic; - EXPECT_EQ(last_msg_.status[32].specific, 46) << "incorrect value for last_msg_.status[32].specific, expected 46, is " << last_msg_.status[32].specific; - EXPECT_EQ(last_msg_.status[33].component, 41256) << "incorrect value for last_msg_.status[33].component, expected 41256, is " << last_msg_.status[33].component; - EXPECT_EQ(last_msg_.status[33].generic, 173) << "incorrect value for last_msg_.status[33].generic, expected 173, is " << last_msg_.status[33].generic; - EXPECT_EQ(last_msg_.status[33].specific, 242) << "incorrect value for last_msg_.status[33].specific, expected 242, is " << last_msg_.status[33].specific; - EXPECT_EQ(last_msg_.status[34].component, 982) << "incorrect value for last_msg_.status[34].component, expected 982, is " << last_msg_.status[34].component; - EXPECT_EQ(last_msg_.status[34].generic, 11) << "incorrect value for last_msg_.status[34].generic, expected 11, is " << last_msg_.status[34].generic; - EXPECT_EQ(last_msg_.status[34].specific, 1) << "incorrect value for last_msg_.status[34].specific, expected 1, is " << last_msg_.status[34].specific; - EXPECT_EQ(last_msg_.status[35].component, 18038) << "incorrect value for last_msg_.status[35].component, expected 18038, is " << last_msg_.status[35].component; - EXPECT_EQ(last_msg_.status[35].generic, 162) << "incorrect value for last_msg_.status[35].generic, expected 162, is " << last_msg_.status[35].generic; - EXPECT_EQ(last_msg_.status[35].specific, 61) << "incorrect value for last_msg_.status[35].specific, expected 61, is " << last_msg_.status[35].specific; - EXPECT_EQ(last_msg_.status[36].component, 7090) << "incorrect value for last_msg_.status[36].component, expected 7090, is " << last_msg_.status[36].component; - EXPECT_EQ(last_msg_.status[36].generic, 156) << "incorrect value for last_msg_.status[36].generic, expected 156, is " << last_msg_.status[36].generic; - EXPECT_EQ(last_msg_.status[36].specific, 40) << "incorrect value for last_msg_.status[36].specific, expected 40, is " << last_msg_.status[36].specific; - EXPECT_EQ(last_msg_.status[37].component, 29119) << "incorrect value for last_msg_.status[37].component, expected 29119, is " << last_msg_.status[37].component; - EXPECT_EQ(last_msg_.status[37].generic, 230) << "incorrect value for last_msg_.status[37].generic, expected 230, is " << last_msg_.status[37].generic; - EXPECT_EQ(last_msg_.status[37].specific, 200) << "incorrect value for last_msg_.status[37].specific, expected 200, is " << last_msg_.status[37].specific; - EXPECT_EQ(last_msg_.status[38].component, 2120) << "incorrect value for last_msg_.status[38].component, expected 2120, is " << last_msg_.status[38].component; - EXPECT_EQ(last_msg_.status[38].generic, 215) << "incorrect value for last_msg_.status[38].generic, expected 215, is " << last_msg_.status[38].generic; - EXPECT_EQ(last_msg_.status[38].specific, 245) << "incorrect value for last_msg_.status[38].specific, expected 245, is " << last_msg_.status[38].specific; - EXPECT_EQ(last_msg_.status[39].component, 15182) << "incorrect value for last_msg_.status[39].component, expected 15182, is " << last_msg_.status[39].component; - EXPECT_EQ(last_msg_.status[39].generic, 222) << "incorrect value for last_msg_.status[39].generic, expected 222, is " << last_msg_.status[39].generic; - EXPECT_EQ(last_msg_.status[39].specific, 250) << "incorrect value for last_msg_.status[39].specific, expected 250, is " << last_msg_.status[39].specific; - EXPECT_EQ(last_msg_.status[40].component, 8307) << "incorrect value for last_msg_.status[40].component, expected 8307, is " << last_msg_.status[40].component; - EXPECT_EQ(last_msg_.status[40].generic, 33) << "incorrect value for last_msg_.status[40].generic, expected 33, is " << last_msg_.status[40].generic; - EXPECT_EQ(last_msg_.status[40].specific, 30) << "incorrect value for last_msg_.status[40].specific, expected 30, is " << last_msg_.status[40].specific; - EXPECT_EQ(last_msg_.status[41].component, 43731) << "incorrect value for last_msg_.status[41].component, expected 43731, is " << last_msg_.status[41].component; - EXPECT_EQ(last_msg_.status[41].generic, 145) << "incorrect value for last_msg_.status[41].generic, expected 145, is " << last_msg_.status[41].generic; - EXPECT_EQ(last_msg_.status[41].specific, 92) << "incorrect value for last_msg_.status[41].specific, expected 92, is " << last_msg_.status[41].specific; - EXPECT_EQ(last_msg_.status[42].component, 19357) << "incorrect value for last_msg_.status[42].component, expected 19357, is " << last_msg_.status[42].component; - EXPECT_EQ(last_msg_.status[42].generic, 24) << "incorrect value for last_msg_.status[42].generic, expected 24, is " << last_msg_.status[42].generic; - EXPECT_EQ(last_msg_.status[42].specific, 169) << "incorrect value for last_msg_.status[42].specific, expected 169, is " << last_msg_.status[42].specific; - EXPECT_EQ(last_msg_.status[43].component, 14086) << "incorrect value for last_msg_.status[43].component, expected 14086, is " << last_msg_.status[43].component; - EXPECT_EQ(last_msg_.status[43].generic, 62) << "incorrect value for last_msg_.status[43].generic, expected 62, is " << last_msg_.status[43].generic; - EXPECT_EQ(last_msg_.status[43].specific, 8) << "incorrect value for last_msg_.status[43].specific, expected 8, is " << last_msg_.status[43].specific; - EXPECT_EQ(last_msg_.status[44].component, 21099) << "incorrect value for last_msg_.status[44].component, expected 21099, is " << last_msg_.status[44].component; - EXPECT_EQ(last_msg_.status[44].generic, 140) << "incorrect value for last_msg_.status[44].generic, expected 140, is " << last_msg_.status[44].generic; - EXPECT_EQ(last_msg_.status[44].specific, 49) << "incorrect value for last_msg_.status[44].specific, expected 49, is " << last_msg_.status[44].specific; - EXPECT_EQ(last_msg_.status[45].component, 31411) << "incorrect value for last_msg_.status[45].component, expected 31411, is " << last_msg_.status[45].component; - EXPECT_EQ(last_msg_.status[45].generic, 90) << "incorrect value for last_msg_.status[45].generic, expected 90, is " << last_msg_.status[45].generic; - EXPECT_EQ(last_msg_.status[45].specific, 71) << "incorrect value for last_msg_.status[45].specific, expected 71, is " << last_msg_.status[45].specific; - EXPECT_EQ(last_msg_.status[46].component, 22556) << "incorrect value for last_msg_.status[46].component, expected 22556, is " << last_msg_.status[46].component; - EXPECT_EQ(last_msg_.status[46].generic, 103) << "incorrect value for last_msg_.status[46].generic, expected 103, is " << last_msg_.status[46].generic; - EXPECT_EQ(last_msg_.status[46].specific, 51) << "incorrect value for last_msg_.status[46].specific, expected 51, is " << last_msg_.status[46].specific; - EXPECT_EQ(last_msg_.status[47].component, 18609) << "incorrect value for last_msg_.status[47].component, expected 18609, is " << last_msg_.status[47].component; - EXPECT_EQ(last_msg_.status[47].generic, 93) << "incorrect value for last_msg_.status[47].generic, expected 93, is " << last_msg_.status[47].generic; - EXPECT_EQ(last_msg_.status[47].specific, 39) << "incorrect value for last_msg_.status[47].specific, expected 39, is " << last_msg_.status[47].specific; - EXPECT_EQ(last_msg_.status[48].component, 2964) << "incorrect value for last_msg_.status[48].component, expected 2964, is " << last_msg_.status[48].component; - EXPECT_EQ(last_msg_.status[48].generic, 202) << "incorrect value for last_msg_.status[48].generic, expected 202, is " << last_msg_.status[48].generic; - EXPECT_EQ(last_msg_.status[48].specific, 42) << "incorrect value for last_msg_.status[48].specific, expected 42, is " << last_msg_.status[48].specific; - EXPECT_EQ(last_msg_.status[49].component, 23586) << "incorrect value for last_msg_.status[49].component, expected 23586, is " << last_msg_.status[49].component; - EXPECT_EQ(last_msg_.status[49].generic, 204) << "incorrect value for last_msg_.status[49].generic, expected 204, is " << last_msg_.status[49].generic; - EXPECT_EQ(last_msg_.status[49].specific, 102) << "incorrect value for last_msg_.status[49].specific, expected 102, is " << last_msg_.status[49].specific; - EXPECT_EQ(last_msg_.status[50].component, 25117) << "incorrect value for last_msg_.status[50].component, expected 25117, is " << last_msg_.status[50].component; - EXPECT_EQ(last_msg_.status[50].generic, 249) << "incorrect value for last_msg_.status[50].generic, expected 249, is " << last_msg_.status[50].generic; - EXPECT_EQ(last_msg_.status[50].specific, 91) << "incorrect value for last_msg_.status[50].specific, expected 91, is " << last_msg_.status[50].specific; - EXPECT_EQ(last_msg_.status[51].component, 24454) << "incorrect value for last_msg_.status[51].component, expected 24454, is " << last_msg_.status[51].component; - EXPECT_EQ(last_msg_.status[51].generic, 23) << "incorrect value for last_msg_.status[51].generic, expected 23, is " << last_msg_.status[51].generic; - EXPECT_EQ(last_msg_.status[51].specific, 248) << "incorrect value for last_msg_.status[51].specific, expected 248, is " << last_msg_.status[51].specific; - EXPECT_EQ(last_msg_.status[52].component, 5312) << "incorrect value for last_msg_.status[52].component, expected 5312, is " << last_msg_.status[52].component; - EXPECT_EQ(last_msg_.status[52].generic, 83) << "incorrect value for last_msg_.status[52].generic, expected 83, is " << last_msg_.status[52].generic; - EXPECT_EQ(last_msg_.status[52].specific, 195) << "incorrect value for last_msg_.status[52].specific, expected 195, is " << last_msg_.status[52].specific; - EXPECT_EQ(last_msg_.status[53].component, 46175) << "incorrect value for last_msg_.status[53].component, expected 46175, is " << last_msg_.status[53].component; - EXPECT_EQ(last_msg_.status[53].generic, 54) << "incorrect value for last_msg_.status[53].generic, expected 54, is " << last_msg_.status[53].generic; - EXPECT_EQ(last_msg_.status[53].specific, 36) << "incorrect value for last_msg_.status[53].specific, expected 36, is " << last_msg_.status[53].specific; - EXPECT_EQ(last_msg_.status[54].component, 19386) << "incorrect value for last_msg_.status[54].component, expected 19386, is " << last_msg_.status[54].component; - EXPECT_EQ(last_msg_.status[54].generic, 64) << "incorrect value for last_msg_.status[54].generic, expected 64, is " << last_msg_.status[54].generic; - EXPECT_EQ(last_msg_.status[54].specific, 20) << "incorrect value for last_msg_.status[54].specific, expected 20, is " << last_msg_.status[54].specific; - EXPECT_EQ(last_msg_.status[55].component, 34205) << "incorrect value for last_msg_.status[55].component, expected 34205, is " << last_msg_.status[55].component; - EXPECT_EQ(last_msg_.status[55].generic, 12) << "incorrect value for last_msg_.status[55].generic, expected 12, is " << last_msg_.status[55].generic; - EXPECT_EQ(last_msg_.status[55].specific, 149) << "incorrect value for last_msg_.status[55].specific, expected 149, is " << last_msg_.status[55].specific; - EXPECT_EQ(last_msg_.status[56].component, 3612) << "incorrect value for last_msg_.status[56].component, expected 3612, is " << last_msg_.status[56].component; - EXPECT_EQ(last_msg_.status[56].generic, 185) << "incorrect value for last_msg_.status[56].generic, expected 185, is " << last_msg_.status[56].generic; - EXPECT_EQ(last_msg_.status[56].specific, 129) << "incorrect value for last_msg_.status[56].specific, expected 129, is " << last_msg_.status[56].specific; - EXPECT_EQ(last_msg_.status[57].component, 61285) << "incorrect value for last_msg_.status[57].component, expected 61285, is " << last_msg_.status[57].component; - EXPECT_EQ(last_msg_.status[57].generic, 74) << "incorrect value for last_msg_.status[57].generic, expected 74, is " << last_msg_.status[57].generic; - EXPECT_EQ(last_msg_.status[57].specific, 248) << "incorrect value for last_msg_.status[57].specific, expected 248, is " << last_msg_.status[57].specific; - EXPECT_EQ(last_msg_.status[58].component, 7925) << "incorrect value for last_msg_.status[58].component, expected 7925, is " << last_msg_.status[58].component; - EXPECT_EQ(last_msg_.status[58].generic, 228) << "incorrect value for last_msg_.status[58].generic, expected 228, is " << last_msg_.status[58].generic; - EXPECT_EQ(last_msg_.status[58].specific, 88) << "incorrect value for last_msg_.status[58].specific, expected 88, is " << last_msg_.status[58].specific; - EXPECT_EQ(last_msg_.status[59].component, 54414) << "incorrect value for last_msg_.status[59].component, expected 54414, is " << last_msg_.status[59].component; - EXPECT_EQ(last_msg_.status[59].generic, 53) << "incorrect value for last_msg_.status[59].generic, expected 53, is " << last_msg_.status[59].generic; - EXPECT_EQ(last_msg_.status[59].specific, 224) << "incorrect value for last_msg_.status[59].specific, expected 224, is " << last_msg_.status[59].specific; - EXPECT_EQ(last_msg_.uptime, 1657804265) << "incorrect value for last_msg_.uptime, expected 1657804265, is " << last_msg_.uptime; +}; + +TEST_F(Test_auto_check_sbp_system_MsgStatusReport0, Test) { + uint8_t encoded_frame[] = { + 85, 254, 255, 6, 84, 252, 82, 253, 177, 95, 3, 60, 143, 90, 233, + 21, 208, 98, 247, 203, 221, 198, 156, 207, 217, 238, 162, 136, 154, 11, + 114, 236, 134, 235, 12, 133, 9, 30, 175, 145, 26, 114, 215, 20, 146, + 249, 54, 54, 133, 193, 106, 186, 210, 183, 0, 129, 5, 248, 225, 149, + 135, 127, 2, 26, 88, 92, 10, 103, 73, 3, 103, 68, 76, 184, 33, + 206, 194, 163, 123, 30, 151, 176, 149, 172, 184, 231, 118, 230, 200, 168, + 100, 109, 10, 233, 4, 60, 247, 82, 215, 166, 28, 138, 110, 45, 98, + 218, 244, 179, 126, 107, 92, 124, 94, 157, 42, 187, 124, 6, 97, 247, + 160, 188, 110, 120, 254, 214, 110, 51, 240, 164, 147, 18, 74, 178, 67, + 4, 27, 73, 190, 64, 179, 146, 125, 153, 192, 46, 202, 66, 248, 46, + 40, 161, 173, 242, 214, 3, 11, 1, 118, 70, 162, 61, 178, 27, 156, + 40, 191, 113, 230, 200, 72, 8, 215, 245, 78, 59, 222, 250, 115, 32, + 33, 30, 211, 170, 145, 92, 157, 75, 24, 169, 6, 55, 62, 8, 107, + 82, 140, 49, 179, 122, 90, 71, 28, 88, 103, 51, 177, 72, 93, 39, + 148, 11, 202, 42, 34, 92, 204, 102, 29, 98, 249, 91, 134, 95, 23, + 248, 192, 20, 83, 195, 95, 180, 54, 36, 186, 75, 64, 20, 157, 133, + 12, 149, 28, 14, 185, 129, 101, 239, 74, 248, 245, 30, 228, 88, 142, + 212, 53, 224, 158, 166, + }; + + sbp_msg_status_report_t test_msg{}; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_status.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)117, (char)115}; + memcpy(test_msg.n_status.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_status.value = 60; + test_msg.reporting_system = 64850; + test_msg.sbp_version = 24497; + test_msg.sequence = 1519336451; + + test_msg.status[0].component = 52215; + test_msg.status[0].generic = 221; + test_msg.status[0].specific = 198; + + test_msg.status[1].component = 53148; + test_msg.status[1].generic = 217; + test_msg.status[1].specific = 238; + + test_msg.status[2].component = 34978; + test_msg.status[2].generic = 154; + test_msg.status[2].specific = 11; + + test_msg.status[3].component = 60530; + test_msg.status[3].generic = 134; + test_msg.status[3].specific = 235; + + test_msg.status[4].component = 34060; + test_msg.status[4].generic = 9; + test_msg.status[4].specific = 30; + + test_msg.status[5].component = 37295; + test_msg.status[5].generic = 26; + test_msg.status[5].specific = 114; + + test_msg.status[6].component = 5335; + test_msg.status[6].generic = 146; + test_msg.status[6].specific = 249; + + test_msg.status[7].component = 13878; + test_msg.status[7].generic = 133; + test_msg.status[7].specific = 193; + + test_msg.status[8].component = 47722; + test_msg.status[8].generic = 210; + test_msg.status[8].specific = 183; + + test_msg.status[9].component = 33024; + test_msg.status[9].generic = 5; + test_msg.status[9].specific = 248; + + test_msg.status[10].component = 38369; + test_msg.status[10].generic = 135; + test_msg.status[10].specific = 127; + + test_msg.status[11].component = 6658; + test_msg.status[11].generic = 88; + test_msg.status[11].specific = 92; + + test_msg.status[12].component = 26378; + test_msg.status[12].generic = 73; + test_msg.status[12].specific = 3; + + test_msg.status[13].component = 17511; + test_msg.status[13].generic = 76; + test_msg.status[13].specific = 184; + + test_msg.status[14].component = 52769; + test_msg.status[14].generic = 194; + test_msg.status[14].specific = 163; + + test_msg.status[15].component = 7803; + test_msg.status[15].generic = 151; + test_msg.status[15].specific = 176; + + test_msg.status[16].component = 44181; + test_msg.status[16].generic = 184; + test_msg.status[16].specific = 231; + + test_msg.status[17].component = 58998; + test_msg.status[17].generic = 200; + test_msg.status[17].specific = 168; + + test_msg.status[18].component = 28004; + test_msg.status[18].generic = 10; + test_msg.status[18].specific = 233; + + test_msg.status[19].component = 15364; + test_msg.status[19].generic = 247; + test_msg.status[19].specific = 82; + + test_msg.status[20].component = 42711; + test_msg.status[20].generic = 28; + test_msg.status[20].specific = 138; + + test_msg.status[21].component = 11630; + test_msg.status[21].generic = 98; + test_msg.status[21].specific = 218; + + test_msg.status[22].component = 46068; + test_msg.status[22].generic = 126; + test_msg.status[22].specific = 107; + + test_msg.status[23].component = 31836; + test_msg.status[23].generic = 94; + test_msg.status[23].specific = 157; + + test_msg.status[24].component = 47914; + test_msg.status[24].generic = 124; + test_msg.status[24].specific = 6; + + test_msg.status[25].component = 63329; + test_msg.status[25].generic = 160; + test_msg.status[25].specific = 188; + + test_msg.status[26].component = 30830; + test_msg.status[26].generic = 254; + test_msg.status[26].specific = 214; + + test_msg.status[27].component = 13166; + test_msg.status[27].generic = 240; + test_msg.status[27].specific = 164; + + test_msg.status[28].component = 4755; + test_msg.status[28].generic = 74; + test_msg.status[28].specific = 178; + + test_msg.status[29].component = 1091; + test_msg.status[29].generic = 27; + test_msg.status[29].specific = 73; + + test_msg.status[30].component = 16574; + test_msg.status[30].generic = 179; + test_msg.status[30].specific = 146; + + test_msg.status[31].component = 39293; + test_msg.status[31].generic = 192; + test_msg.status[31].specific = 46; + + test_msg.status[32].component = 17098; + test_msg.status[32].generic = 248; + test_msg.status[32].specific = 46; + + test_msg.status[33].component = 41256; + test_msg.status[33].generic = 173; + test_msg.status[33].specific = 242; + + test_msg.status[34].component = 982; + test_msg.status[34].generic = 11; + test_msg.status[34].specific = 1; + + test_msg.status[35].component = 18038; + test_msg.status[35].generic = 162; + test_msg.status[35].specific = 61; + + test_msg.status[36].component = 7090; + test_msg.status[36].generic = 156; + test_msg.status[36].specific = 40; + + test_msg.status[37].component = 29119; + test_msg.status[37].generic = 230; + test_msg.status[37].specific = 200; + + test_msg.status[38].component = 2120; + test_msg.status[38].generic = 215; + test_msg.status[38].specific = 245; + + test_msg.status[39].component = 15182; + test_msg.status[39].generic = 222; + test_msg.status[39].specific = 250; + + test_msg.status[40].component = 8307; + test_msg.status[40].generic = 33; + test_msg.status[40].specific = 30; + + test_msg.status[41].component = 43731; + test_msg.status[41].generic = 145; + test_msg.status[41].specific = 92; + + test_msg.status[42].component = 19357; + test_msg.status[42].generic = 24; + test_msg.status[42].specific = 169; + + test_msg.status[43].component = 14086; + test_msg.status[43].generic = 62; + test_msg.status[43].specific = 8; + + test_msg.status[44].component = 21099; + test_msg.status[44].generic = 140; + test_msg.status[44].specific = 49; + + test_msg.status[45].component = 31411; + test_msg.status[45].generic = 90; + test_msg.status[45].specific = 71; + + test_msg.status[46].component = 22556; + test_msg.status[46].generic = 103; + test_msg.status[46].specific = 51; + + test_msg.status[47].component = 18609; + test_msg.status[47].generic = 93; + test_msg.status[47].specific = 39; + + test_msg.status[48].component = 2964; + test_msg.status[48].generic = 202; + test_msg.status[48].specific = 42; + + test_msg.status[49].component = 23586; + test_msg.status[49].generic = 204; + test_msg.status[49].specific = 102; + + test_msg.status[50].component = 25117; + test_msg.status[50].generic = 249; + test_msg.status[50].specific = 91; + + test_msg.status[51].component = 24454; + test_msg.status[51].generic = 23; + test_msg.status[51].specific = 248; + + test_msg.status[52].component = 5312; + test_msg.status[52].generic = 83; + test_msg.status[52].specific = 195; + + test_msg.status[53].component = 46175; + test_msg.status[53].generic = 54; + test_msg.status[53].specific = 36; + + test_msg.status[54].component = 19386; + test_msg.status[54].generic = 64; + test_msg.status[54].specific = 20; + + test_msg.status[55].component = 34205; + test_msg.status[55].generic = 12; + test_msg.status[55].specific = 149; + + test_msg.status[56].component = 3612; + test_msg.status[56].generic = 185; + test_msg.status[56].specific = 129; + + test_msg.status[57].component = 61285; + test_msg.status[57].generic = 74; + test_msg.status[57].specific = 248; + + test_msg.status[58].component = 7925; + test_msg.status[58].generic = 228; + test_msg.status[58].specific = 88; + + test_msg.status[59].component = 54414; + test_msg.status[59].generic = 53; + test_msg.status[59].specific = 224; + test_msg.uptime = 1657804265; + + EXPECT_EQ(send_message(21510, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 21510); + EXPECT_EQ(last_msg_, test_msg); + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_status.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_status.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_status.handle_as << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)117, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_status.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_status.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.n_status.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_status.value, 60) + << "incorrect value for last_msg_.n_status.value, expected 60, is " + << last_msg_.n_status.value; + EXPECT_EQ(last_msg_.reporting_system, 64850) + << "incorrect value for last_msg_.reporting_system, expected 64850, is " + << last_msg_.reporting_system; + EXPECT_EQ(last_msg_.sbp_version, 24497) + << "incorrect value for last_msg_.sbp_version, expected 24497, is " + << last_msg_.sbp_version; + EXPECT_EQ(last_msg_.sequence, 1519336451) + << "incorrect value for last_msg_.sequence, expected 1519336451, is " + << last_msg_.sequence; + EXPECT_EQ(last_msg_.status[0].component, 52215) + << "incorrect value for last_msg_.status[0].component, expected 52215, " + "is " + << last_msg_.status[0].component; + EXPECT_EQ(last_msg_.status[0].generic, 221) + << "incorrect value for last_msg_.status[0].generic, expected 221, is " + << last_msg_.status[0].generic; + EXPECT_EQ(last_msg_.status[0].specific, 198) + << "incorrect value for last_msg_.status[0].specific, expected 198, is " + << last_msg_.status[0].specific; + EXPECT_EQ(last_msg_.status[1].component, 53148) + << "incorrect value for last_msg_.status[1].component, expected 53148, " + "is " + << last_msg_.status[1].component; + EXPECT_EQ(last_msg_.status[1].generic, 217) + << "incorrect value for last_msg_.status[1].generic, expected 217, is " + << last_msg_.status[1].generic; + EXPECT_EQ(last_msg_.status[1].specific, 238) + << "incorrect value for last_msg_.status[1].specific, expected 238, is " + << last_msg_.status[1].specific; + EXPECT_EQ(last_msg_.status[2].component, 34978) + << "incorrect value for last_msg_.status[2].component, expected 34978, " + "is " + << last_msg_.status[2].component; + EXPECT_EQ(last_msg_.status[2].generic, 154) + << "incorrect value for last_msg_.status[2].generic, expected 154, is " + << last_msg_.status[2].generic; + EXPECT_EQ(last_msg_.status[2].specific, 11) + << "incorrect value for last_msg_.status[2].specific, expected 11, is " + << last_msg_.status[2].specific; + EXPECT_EQ(last_msg_.status[3].component, 60530) + << "incorrect value for last_msg_.status[3].component, expected 60530, " + "is " + << last_msg_.status[3].component; + EXPECT_EQ(last_msg_.status[3].generic, 134) + << "incorrect value for last_msg_.status[3].generic, expected 134, is " + << last_msg_.status[3].generic; + EXPECT_EQ(last_msg_.status[3].specific, 235) + << "incorrect value for last_msg_.status[3].specific, expected 235, is " + << last_msg_.status[3].specific; + EXPECT_EQ(last_msg_.status[4].component, 34060) + << "incorrect value for last_msg_.status[4].component, expected 34060, " + "is " + << last_msg_.status[4].component; + EXPECT_EQ(last_msg_.status[4].generic, 9) + << "incorrect value for last_msg_.status[4].generic, expected 9, is " + << last_msg_.status[4].generic; + EXPECT_EQ(last_msg_.status[4].specific, 30) + << "incorrect value for last_msg_.status[4].specific, expected 30, is " + << last_msg_.status[4].specific; + EXPECT_EQ(last_msg_.status[5].component, 37295) + << "incorrect value for last_msg_.status[5].component, expected 37295, " + "is " + << last_msg_.status[5].component; + EXPECT_EQ(last_msg_.status[5].generic, 26) + << "incorrect value for last_msg_.status[5].generic, expected 26, is " + << last_msg_.status[5].generic; + EXPECT_EQ(last_msg_.status[5].specific, 114) + << "incorrect value for last_msg_.status[5].specific, expected 114, is " + << last_msg_.status[5].specific; + EXPECT_EQ(last_msg_.status[6].component, 5335) + << "incorrect value for last_msg_.status[6].component, expected 5335, is " + << last_msg_.status[6].component; + EXPECT_EQ(last_msg_.status[6].generic, 146) + << "incorrect value for last_msg_.status[6].generic, expected 146, is " + << last_msg_.status[6].generic; + EXPECT_EQ(last_msg_.status[6].specific, 249) + << "incorrect value for last_msg_.status[6].specific, expected 249, is " + << last_msg_.status[6].specific; + EXPECT_EQ(last_msg_.status[7].component, 13878) + << "incorrect value for last_msg_.status[7].component, expected 13878, " + "is " + << last_msg_.status[7].component; + EXPECT_EQ(last_msg_.status[7].generic, 133) + << "incorrect value for last_msg_.status[7].generic, expected 133, is " + << last_msg_.status[7].generic; + EXPECT_EQ(last_msg_.status[7].specific, 193) + << "incorrect value for last_msg_.status[7].specific, expected 193, is " + << last_msg_.status[7].specific; + EXPECT_EQ(last_msg_.status[8].component, 47722) + << "incorrect value for last_msg_.status[8].component, expected 47722, " + "is " + << last_msg_.status[8].component; + EXPECT_EQ(last_msg_.status[8].generic, 210) + << "incorrect value for last_msg_.status[8].generic, expected 210, is " + << last_msg_.status[8].generic; + EXPECT_EQ(last_msg_.status[8].specific, 183) + << "incorrect value for last_msg_.status[8].specific, expected 183, is " + << last_msg_.status[8].specific; + EXPECT_EQ(last_msg_.status[9].component, 33024) + << "incorrect value for last_msg_.status[9].component, expected 33024, " + "is " + << last_msg_.status[9].component; + EXPECT_EQ(last_msg_.status[9].generic, 5) + << "incorrect value for last_msg_.status[9].generic, expected 5, is " + << last_msg_.status[9].generic; + EXPECT_EQ(last_msg_.status[9].specific, 248) + << "incorrect value for last_msg_.status[9].specific, expected 248, is " + << last_msg_.status[9].specific; + EXPECT_EQ(last_msg_.status[10].component, 38369) + << "incorrect value for last_msg_.status[10].component, expected 38369, " + "is " + << last_msg_.status[10].component; + EXPECT_EQ(last_msg_.status[10].generic, 135) + << "incorrect value for last_msg_.status[10].generic, expected 135, is " + << last_msg_.status[10].generic; + EXPECT_EQ(last_msg_.status[10].specific, 127) + << "incorrect value for last_msg_.status[10].specific, expected 127, is " + << last_msg_.status[10].specific; + EXPECT_EQ(last_msg_.status[11].component, 6658) + << "incorrect value for last_msg_.status[11].component, expected 6658, " + "is " + << last_msg_.status[11].component; + EXPECT_EQ(last_msg_.status[11].generic, 88) + << "incorrect value for last_msg_.status[11].generic, expected 88, is " + << last_msg_.status[11].generic; + EXPECT_EQ(last_msg_.status[11].specific, 92) + << "incorrect value for last_msg_.status[11].specific, expected 92, is " + << last_msg_.status[11].specific; + EXPECT_EQ(last_msg_.status[12].component, 26378) + << "incorrect value for last_msg_.status[12].component, expected 26378, " + "is " + << last_msg_.status[12].component; + EXPECT_EQ(last_msg_.status[12].generic, 73) + << "incorrect value for last_msg_.status[12].generic, expected 73, is " + << last_msg_.status[12].generic; + EXPECT_EQ(last_msg_.status[12].specific, 3) + << "incorrect value for last_msg_.status[12].specific, expected 3, is " + << last_msg_.status[12].specific; + EXPECT_EQ(last_msg_.status[13].component, 17511) + << "incorrect value for last_msg_.status[13].component, expected 17511, " + "is " + << last_msg_.status[13].component; + EXPECT_EQ(last_msg_.status[13].generic, 76) + << "incorrect value for last_msg_.status[13].generic, expected 76, is " + << last_msg_.status[13].generic; + EXPECT_EQ(last_msg_.status[13].specific, 184) + << "incorrect value for last_msg_.status[13].specific, expected 184, is " + << last_msg_.status[13].specific; + EXPECT_EQ(last_msg_.status[14].component, 52769) + << "incorrect value for last_msg_.status[14].component, expected 52769, " + "is " + << last_msg_.status[14].component; + EXPECT_EQ(last_msg_.status[14].generic, 194) + << "incorrect value for last_msg_.status[14].generic, expected 194, is " + << last_msg_.status[14].generic; + EXPECT_EQ(last_msg_.status[14].specific, 163) + << "incorrect value for last_msg_.status[14].specific, expected 163, is " + << last_msg_.status[14].specific; + EXPECT_EQ(last_msg_.status[15].component, 7803) + << "incorrect value for last_msg_.status[15].component, expected 7803, " + "is " + << last_msg_.status[15].component; + EXPECT_EQ(last_msg_.status[15].generic, 151) + << "incorrect value for last_msg_.status[15].generic, expected 151, is " + << last_msg_.status[15].generic; + EXPECT_EQ(last_msg_.status[15].specific, 176) + << "incorrect value for last_msg_.status[15].specific, expected 176, is " + << last_msg_.status[15].specific; + EXPECT_EQ(last_msg_.status[16].component, 44181) + << "incorrect value for last_msg_.status[16].component, expected 44181, " + "is " + << last_msg_.status[16].component; + EXPECT_EQ(last_msg_.status[16].generic, 184) + << "incorrect value for last_msg_.status[16].generic, expected 184, is " + << last_msg_.status[16].generic; + EXPECT_EQ(last_msg_.status[16].specific, 231) + << "incorrect value for last_msg_.status[16].specific, expected 231, is " + << last_msg_.status[16].specific; + EXPECT_EQ(last_msg_.status[17].component, 58998) + << "incorrect value for last_msg_.status[17].component, expected 58998, " + "is " + << last_msg_.status[17].component; + EXPECT_EQ(last_msg_.status[17].generic, 200) + << "incorrect value for last_msg_.status[17].generic, expected 200, is " + << last_msg_.status[17].generic; + EXPECT_EQ(last_msg_.status[17].specific, 168) + << "incorrect value for last_msg_.status[17].specific, expected 168, is " + << last_msg_.status[17].specific; + EXPECT_EQ(last_msg_.status[18].component, 28004) + << "incorrect value for last_msg_.status[18].component, expected 28004, " + "is " + << last_msg_.status[18].component; + EXPECT_EQ(last_msg_.status[18].generic, 10) + << "incorrect value for last_msg_.status[18].generic, expected 10, is " + << last_msg_.status[18].generic; + EXPECT_EQ(last_msg_.status[18].specific, 233) + << "incorrect value for last_msg_.status[18].specific, expected 233, is " + << last_msg_.status[18].specific; + EXPECT_EQ(last_msg_.status[19].component, 15364) + << "incorrect value for last_msg_.status[19].component, expected 15364, " + "is " + << last_msg_.status[19].component; + EXPECT_EQ(last_msg_.status[19].generic, 247) + << "incorrect value for last_msg_.status[19].generic, expected 247, is " + << last_msg_.status[19].generic; + EXPECT_EQ(last_msg_.status[19].specific, 82) + << "incorrect value for last_msg_.status[19].specific, expected 82, is " + << last_msg_.status[19].specific; + EXPECT_EQ(last_msg_.status[20].component, 42711) + << "incorrect value for last_msg_.status[20].component, expected 42711, " + "is " + << last_msg_.status[20].component; + EXPECT_EQ(last_msg_.status[20].generic, 28) + << "incorrect value for last_msg_.status[20].generic, expected 28, is " + << last_msg_.status[20].generic; + EXPECT_EQ(last_msg_.status[20].specific, 138) + << "incorrect value for last_msg_.status[20].specific, expected 138, is " + << last_msg_.status[20].specific; + EXPECT_EQ(last_msg_.status[21].component, 11630) + << "incorrect value for last_msg_.status[21].component, expected 11630, " + "is " + << last_msg_.status[21].component; + EXPECT_EQ(last_msg_.status[21].generic, 98) + << "incorrect value for last_msg_.status[21].generic, expected 98, is " + << last_msg_.status[21].generic; + EXPECT_EQ(last_msg_.status[21].specific, 218) + << "incorrect value for last_msg_.status[21].specific, expected 218, is " + << last_msg_.status[21].specific; + EXPECT_EQ(last_msg_.status[22].component, 46068) + << "incorrect value for last_msg_.status[22].component, expected 46068, " + "is " + << last_msg_.status[22].component; + EXPECT_EQ(last_msg_.status[22].generic, 126) + << "incorrect value for last_msg_.status[22].generic, expected 126, is " + << last_msg_.status[22].generic; + EXPECT_EQ(last_msg_.status[22].specific, 107) + << "incorrect value for last_msg_.status[22].specific, expected 107, is " + << last_msg_.status[22].specific; + EXPECT_EQ(last_msg_.status[23].component, 31836) + << "incorrect value for last_msg_.status[23].component, expected 31836, " + "is " + << last_msg_.status[23].component; + EXPECT_EQ(last_msg_.status[23].generic, 94) + << "incorrect value for last_msg_.status[23].generic, expected 94, is " + << last_msg_.status[23].generic; + EXPECT_EQ(last_msg_.status[23].specific, 157) + << "incorrect value for last_msg_.status[23].specific, expected 157, is " + << last_msg_.status[23].specific; + EXPECT_EQ(last_msg_.status[24].component, 47914) + << "incorrect value for last_msg_.status[24].component, expected 47914, " + "is " + << last_msg_.status[24].component; + EXPECT_EQ(last_msg_.status[24].generic, 124) + << "incorrect value for last_msg_.status[24].generic, expected 124, is " + << last_msg_.status[24].generic; + EXPECT_EQ(last_msg_.status[24].specific, 6) + << "incorrect value for last_msg_.status[24].specific, expected 6, is " + << last_msg_.status[24].specific; + EXPECT_EQ(last_msg_.status[25].component, 63329) + << "incorrect value for last_msg_.status[25].component, expected 63329, " + "is " + << last_msg_.status[25].component; + EXPECT_EQ(last_msg_.status[25].generic, 160) + << "incorrect value for last_msg_.status[25].generic, expected 160, is " + << last_msg_.status[25].generic; + EXPECT_EQ(last_msg_.status[25].specific, 188) + << "incorrect value for last_msg_.status[25].specific, expected 188, is " + << last_msg_.status[25].specific; + EXPECT_EQ(last_msg_.status[26].component, 30830) + << "incorrect value for last_msg_.status[26].component, expected 30830, " + "is " + << last_msg_.status[26].component; + EXPECT_EQ(last_msg_.status[26].generic, 254) + << "incorrect value for last_msg_.status[26].generic, expected 254, is " + << last_msg_.status[26].generic; + EXPECT_EQ(last_msg_.status[26].specific, 214) + << "incorrect value for last_msg_.status[26].specific, expected 214, is " + << last_msg_.status[26].specific; + EXPECT_EQ(last_msg_.status[27].component, 13166) + << "incorrect value for last_msg_.status[27].component, expected 13166, " + "is " + << last_msg_.status[27].component; + EXPECT_EQ(last_msg_.status[27].generic, 240) + << "incorrect value for last_msg_.status[27].generic, expected 240, is " + << last_msg_.status[27].generic; + EXPECT_EQ(last_msg_.status[27].specific, 164) + << "incorrect value for last_msg_.status[27].specific, expected 164, is " + << last_msg_.status[27].specific; + EXPECT_EQ(last_msg_.status[28].component, 4755) + << "incorrect value for last_msg_.status[28].component, expected 4755, " + "is " + << last_msg_.status[28].component; + EXPECT_EQ(last_msg_.status[28].generic, 74) + << "incorrect value for last_msg_.status[28].generic, expected 74, is " + << last_msg_.status[28].generic; + EXPECT_EQ(last_msg_.status[28].specific, 178) + << "incorrect value for last_msg_.status[28].specific, expected 178, is " + << last_msg_.status[28].specific; + EXPECT_EQ(last_msg_.status[29].component, 1091) + << "incorrect value for last_msg_.status[29].component, expected 1091, " + "is " + << last_msg_.status[29].component; + EXPECT_EQ(last_msg_.status[29].generic, 27) + << "incorrect value for last_msg_.status[29].generic, expected 27, is " + << last_msg_.status[29].generic; + EXPECT_EQ(last_msg_.status[29].specific, 73) + << "incorrect value for last_msg_.status[29].specific, expected 73, is " + << last_msg_.status[29].specific; + EXPECT_EQ(last_msg_.status[30].component, 16574) + << "incorrect value for last_msg_.status[30].component, expected 16574, " + "is " + << last_msg_.status[30].component; + EXPECT_EQ(last_msg_.status[30].generic, 179) + << "incorrect value for last_msg_.status[30].generic, expected 179, is " + << last_msg_.status[30].generic; + EXPECT_EQ(last_msg_.status[30].specific, 146) + << "incorrect value for last_msg_.status[30].specific, expected 146, is " + << last_msg_.status[30].specific; + EXPECT_EQ(last_msg_.status[31].component, 39293) + << "incorrect value for last_msg_.status[31].component, expected 39293, " + "is " + << last_msg_.status[31].component; + EXPECT_EQ(last_msg_.status[31].generic, 192) + << "incorrect value for last_msg_.status[31].generic, expected 192, is " + << last_msg_.status[31].generic; + EXPECT_EQ(last_msg_.status[31].specific, 46) + << "incorrect value for last_msg_.status[31].specific, expected 46, is " + << last_msg_.status[31].specific; + EXPECT_EQ(last_msg_.status[32].component, 17098) + << "incorrect value for last_msg_.status[32].component, expected 17098, " + "is " + << last_msg_.status[32].component; + EXPECT_EQ(last_msg_.status[32].generic, 248) + << "incorrect value for last_msg_.status[32].generic, expected 248, is " + << last_msg_.status[32].generic; + EXPECT_EQ(last_msg_.status[32].specific, 46) + << "incorrect value for last_msg_.status[32].specific, expected 46, is " + << last_msg_.status[32].specific; + EXPECT_EQ(last_msg_.status[33].component, 41256) + << "incorrect value for last_msg_.status[33].component, expected 41256, " + "is " + << last_msg_.status[33].component; + EXPECT_EQ(last_msg_.status[33].generic, 173) + << "incorrect value for last_msg_.status[33].generic, expected 173, is " + << last_msg_.status[33].generic; + EXPECT_EQ(last_msg_.status[33].specific, 242) + << "incorrect value for last_msg_.status[33].specific, expected 242, is " + << last_msg_.status[33].specific; + EXPECT_EQ(last_msg_.status[34].component, 982) + << "incorrect value for last_msg_.status[34].component, expected 982, is " + << last_msg_.status[34].component; + EXPECT_EQ(last_msg_.status[34].generic, 11) + << "incorrect value for last_msg_.status[34].generic, expected 11, is " + << last_msg_.status[34].generic; + EXPECT_EQ(last_msg_.status[34].specific, 1) + << "incorrect value for last_msg_.status[34].specific, expected 1, is " + << last_msg_.status[34].specific; + EXPECT_EQ(last_msg_.status[35].component, 18038) + << "incorrect value for last_msg_.status[35].component, expected 18038, " + "is " + << last_msg_.status[35].component; + EXPECT_EQ(last_msg_.status[35].generic, 162) + << "incorrect value for last_msg_.status[35].generic, expected 162, is " + << last_msg_.status[35].generic; + EXPECT_EQ(last_msg_.status[35].specific, 61) + << "incorrect value for last_msg_.status[35].specific, expected 61, is " + << last_msg_.status[35].specific; + EXPECT_EQ(last_msg_.status[36].component, 7090) + << "incorrect value for last_msg_.status[36].component, expected 7090, " + "is " + << last_msg_.status[36].component; + EXPECT_EQ(last_msg_.status[36].generic, 156) + << "incorrect value for last_msg_.status[36].generic, expected 156, is " + << last_msg_.status[36].generic; + EXPECT_EQ(last_msg_.status[36].specific, 40) + << "incorrect value for last_msg_.status[36].specific, expected 40, is " + << last_msg_.status[36].specific; + EXPECT_EQ(last_msg_.status[37].component, 29119) + << "incorrect value for last_msg_.status[37].component, expected 29119, " + "is " + << last_msg_.status[37].component; + EXPECT_EQ(last_msg_.status[37].generic, 230) + << "incorrect value for last_msg_.status[37].generic, expected 230, is " + << last_msg_.status[37].generic; + EXPECT_EQ(last_msg_.status[37].specific, 200) + << "incorrect value for last_msg_.status[37].specific, expected 200, is " + << last_msg_.status[37].specific; + EXPECT_EQ(last_msg_.status[38].component, 2120) + << "incorrect value for last_msg_.status[38].component, expected 2120, " + "is " + << last_msg_.status[38].component; + EXPECT_EQ(last_msg_.status[38].generic, 215) + << "incorrect value for last_msg_.status[38].generic, expected 215, is " + << last_msg_.status[38].generic; + EXPECT_EQ(last_msg_.status[38].specific, 245) + << "incorrect value for last_msg_.status[38].specific, expected 245, is " + << last_msg_.status[38].specific; + EXPECT_EQ(last_msg_.status[39].component, 15182) + << "incorrect value for last_msg_.status[39].component, expected 15182, " + "is " + << last_msg_.status[39].component; + EXPECT_EQ(last_msg_.status[39].generic, 222) + << "incorrect value for last_msg_.status[39].generic, expected 222, is " + << last_msg_.status[39].generic; + EXPECT_EQ(last_msg_.status[39].specific, 250) + << "incorrect value for last_msg_.status[39].specific, expected 250, is " + << last_msg_.status[39].specific; + EXPECT_EQ(last_msg_.status[40].component, 8307) + << "incorrect value for last_msg_.status[40].component, expected 8307, " + "is " + << last_msg_.status[40].component; + EXPECT_EQ(last_msg_.status[40].generic, 33) + << "incorrect value for last_msg_.status[40].generic, expected 33, is " + << last_msg_.status[40].generic; + EXPECT_EQ(last_msg_.status[40].specific, 30) + << "incorrect value for last_msg_.status[40].specific, expected 30, is " + << last_msg_.status[40].specific; + EXPECT_EQ(last_msg_.status[41].component, 43731) + << "incorrect value for last_msg_.status[41].component, expected 43731, " + "is " + << last_msg_.status[41].component; + EXPECT_EQ(last_msg_.status[41].generic, 145) + << "incorrect value for last_msg_.status[41].generic, expected 145, is " + << last_msg_.status[41].generic; + EXPECT_EQ(last_msg_.status[41].specific, 92) + << "incorrect value for last_msg_.status[41].specific, expected 92, is " + << last_msg_.status[41].specific; + EXPECT_EQ(last_msg_.status[42].component, 19357) + << "incorrect value for last_msg_.status[42].component, expected 19357, " + "is " + << last_msg_.status[42].component; + EXPECT_EQ(last_msg_.status[42].generic, 24) + << "incorrect value for last_msg_.status[42].generic, expected 24, is " + << last_msg_.status[42].generic; + EXPECT_EQ(last_msg_.status[42].specific, 169) + << "incorrect value for last_msg_.status[42].specific, expected 169, is " + << last_msg_.status[42].specific; + EXPECT_EQ(last_msg_.status[43].component, 14086) + << "incorrect value for last_msg_.status[43].component, expected 14086, " + "is " + << last_msg_.status[43].component; + EXPECT_EQ(last_msg_.status[43].generic, 62) + << "incorrect value for last_msg_.status[43].generic, expected 62, is " + << last_msg_.status[43].generic; + EXPECT_EQ(last_msg_.status[43].specific, 8) + << "incorrect value for last_msg_.status[43].specific, expected 8, is " + << last_msg_.status[43].specific; + EXPECT_EQ(last_msg_.status[44].component, 21099) + << "incorrect value for last_msg_.status[44].component, expected 21099, " + "is " + << last_msg_.status[44].component; + EXPECT_EQ(last_msg_.status[44].generic, 140) + << "incorrect value for last_msg_.status[44].generic, expected 140, is " + << last_msg_.status[44].generic; + EXPECT_EQ(last_msg_.status[44].specific, 49) + << "incorrect value for last_msg_.status[44].specific, expected 49, is " + << last_msg_.status[44].specific; + EXPECT_EQ(last_msg_.status[45].component, 31411) + << "incorrect value for last_msg_.status[45].component, expected 31411, " + "is " + << last_msg_.status[45].component; + EXPECT_EQ(last_msg_.status[45].generic, 90) + << "incorrect value for last_msg_.status[45].generic, expected 90, is " + << last_msg_.status[45].generic; + EXPECT_EQ(last_msg_.status[45].specific, 71) + << "incorrect value for last_msg_.status[45].specific, expected 71, is " + << last_msg_.status[45].specific; + EXPECT_EQ(last_msg_.status[46].component, 22556) + << "incorrect value for last_msg_.status[46].component, expected 22556, " + "is " + << last_msg_.status[46].component; + EXPECT_EQ(last_msg_.status[46].generic, 103) + << "incorrect value for last_msg_.status[46].generic, expected 103, is " + << last_msg_.status[46].generic; + EXPECT_EQ(last_msg_.status[46].specific, 51) + << "incorrect value for last_msg_.status[46].specific, expected 51, is " + << last_msg_.status[46].specific; + EXPECT_EQ(last_msg_.status[47].component, 18609) + << "incorrect value for last_msg_.status[47].component, expected 18609, " + "is " + << last_msg_.status[47].component; + EXPECT_EQ(last_msg_.status[47].generic, 93) + << "incorrect value for last_msg_.status[47].generic, expected 93, is " + << last_msg_.status[47].generic; + EXPECT_EQ(last_msg_.status[47].specific, 39) + << "incorrect value for last_msg_.status[47].specific, expected 39, is " + << last_msg_.status[47].specific; + EXPECT_EQ(last_msg_.status[48].component, 2964) + << "incorrect value for last_msg_.status[48].component, expected 2964, " + "is " + << last_msg_.status[48].component; + EXPECT_EQ(last_msg_.status[48].generic, 202) + << "incorrect value for last_msg_.status[48].generic, expected 202, is " + << last_msg_.status[48].generic; + EXPECT_EQ(last_msg_.status[48].specific, 42) + << "incorrect value for last_msg_.status[48].specific, expected 42, is " + << last_msg_.status[48].specific; + EXPECT_EQ(last_msg_.status[49].component, 23586) + << "incorrect value for last_msg_.status[49].component, expected 23586, " + "is " + << last_msg_.status[49].component; + EXPECT_EQ(last_msg_.status[49].generic, 204) + << "incorrect value for last_msg_.status[49].generic, expected 204, is " + << last_msg_.status[49].generic; + EXPECT_EQ(last_msg_.status[49].specific, 102) + << "incorrect value for last_msg_.status[49].specific, expected 102, is " + << last_msg_.status[49].specific; + EXPECT_EQ(last_msg_.status[50].component, 25117) + << "incorrect value for last_msg_.status[50].component, expected 25117, " + "is " + << last_msg_.status[50].component; + EXPECT_EQ(last_msg_.status[50].generic, 249) + << "incorrect value for last_msg_.status[50].generic, expected 249, is " + << last_msg_.status[50].generic; + EXPECT_EQ(last_msg_.status[50].specific, 91) + << "incorrect value for last_msg_.status[50].specific, expected 91, is " + << last_msg_.status[50].specific; + EXPECT_EQ(last_msg_.status[51].component, 24454) + << "incorrect value for last_msg_.status[51].component, expected 24454, " + "is " + << last_msg_.status[51].component; + EXPECT_EQ(last_msg_.status[51].generic, 23) + << "incorrect value for last_msg_.status[51].generic, expected 23, is " + << last_msg_.status[51].generic; + EXPECT_EQ(last_msg_.status[51].specific, 248) + << "incorrect value for last_msg_.status[51].specific, expected 248, is " + << last_msg_.status[51].specific; + EXPECT_EQ(last_msg_.status[52].component, 5312) + << "incorrect value for last_msg_.status[52].component, expected 5312, " + "is " + << last_msg_.status[52].component; + EXPECT_EQ(last_msg_.status[52].generic, 83) + << "incorrect value for last_msg_.status[52].generic, expected 83, is " + << last_msg_.status[52].generic; + EXPECT_EQ(last_msg_.status[52].specific, 195) + << "incorrect value for last_msg_.status[52].specific, expected 195, is " + << last_msg_.status[52].specific; + EXPECT_EQ(last_msg_.status[53].component, 46175) + << "incorrect value for last_msg_.status[53].component, expected 46175, " + "is " + << last_msg_.status[53].component; + EXPECT_EQ(last_msg_.status[53].generic, 54) + << "incorrect value for last_msg_.status[53].generic, expected 54, is " + << last_msg_.status[53].generic; + EXPECT_EQ(last_msg_.status[53].specific, 36) + << "incorrect value for last_msg_.status[53].specific, expected 36, is " + << last_msg_.status[53].specific; + EXPECT_EQ(last_msg_.status[54].component, 19386) + << "incorrect value for last_msg_.status[54].component, expected 19386, " + "is " + << last_msg_.status[54].component; + EXPECT_EQ(last_msg_.status[54].generic, 64) + << "incorrect value for last_msg_.status[54].generic, expected 64, is " + << last_msg_.status[54].generic; + EXPECT_EQ(last_msg_.status[54].specific, 20) + << "incorrect value for last_msg_.status[54].specific, expected 20, is " + << last_msg_.status[54].specific; + EXPECT_EQ(last_msg_.status[55].component, 34205) + << "incorrect value for last_msg_.status[55].component, expected 34205, " + "is " + << last_msg_.status[55].component; + EXPECT_EQ(last_msg_.status[55].generic, 12) + << "incorrect value for last_msg_.status[55].generic, expected 12, is " + << last_msg_.status[55].generic; + EXPECT_EQ(last_msg_.status[55].specific, 149) + << "incorrect value for last_msg_.status[55].specific, expected 149, is " + << last_msg_.status[55].specific; + EXPECT_EQ(last_msg_.status[56].component, 3612) + << "incorrect value for last_msg_.status[56].component, expected 3612, " + "is " + << last_msg_.status[56].component; + EXPECT_EQ(last_msg_.status[56].generic, 185) + << "incorrect value for last_msg_.status[56].generic, expected 185, is " + << last_msg_.status[56].generic; + EXPECT_EQ(last_msg_.status[56].specific, 129) + << "incorrect value for last_msg_.status[56].specific, expected 129, is " + << last_msg_.status[56].specific; + EXPECT_EQ(last_msg_.status[57].component, 61285) + << "incorrect value for last_msg_.status[57].component, expected 61285, " + "is " + << last_msg_.status[57].component; + EXPECT_EQ(last_msg_.status[57].generic, 74) + << "incorrect value for last_msg_.status[57].generic, expected 74, is " + << last_msg_.status[57].generic; + EXPECT_EQ(last_msg_.status[57].specific, 248) + << "incorrect value for last_msg_.status[57].specific, expected 248, is " + << last_msg_.status[57].specific; + EXPECT_EQ(last_msg_.status[58].component, 7925) + << "incorrect value for last_msg_.status[58].component, expected 7925, " + "is " + << last_msg_.status[58].component; + EXPECT_EQ(last_msg_.status[58].generic, 228) + << "incorrect value for last_msg_.status[58].generic, expected 228, is " + << last_msg_.status[58].generic; + EXPECT_EQ(last_msg_.status[58].specific, 88) + << "incorrect value for last_msg_.status[58].specific, expected 88, is " + << last_msg_.status[58].specific; + EXPECT_EQ(last_msg_.status[59].component, 54414) + << "incorrect value for last_msg_.status[59].component, expected 54414, " + "is " + << last_msg_.status[59].component; + EXPECT_EQ(last_msg_.status[59].generic, 53) + << "incorrect value for last_msg_.status[59].generic, expected 53, is " + << last_msg_.status[59].generic; + EXPECT_EQ(last_msg_.status[59].specific, 224) + << "incorrect value for last_msg_.status[59].specific, expected 224, is " + << last_msg_.status[59].specific; + EXPECT_EQ(last_msg_.uptime, 1657804265) + << "incorrect value for last_msg_.uptime, expected 1657804265, is " + << last_msg_.uptime; } diff --git a/c/test/cpp/auto_check_sbp_telemetry_MsgTelSv.cc b/c/test/cpp/auto_check_sbp_telemetry_MsgTelSv.cc index f3dd66a44..5142b3b42 100644 --- a/c/test/cpp/auto_check_sbp_telemetry_MsgTelSv.cc +++ b/c/test/cpp/auto_check_sbp_telemetry_MsgTelSv.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/telemetry/test_MsgTelSv.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/telemetry/test_MsgTelSv.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_telemetry_MsgTelSv0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_telemetry_MsgTelSv0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_telemetry_MsgTelSv0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_telemetry_MsgTelSv0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tel_sv_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_tel_sv_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,77 +67,128 @@ class Test_auto_check_sbp_telemetry_MsgTelSv0 : sbp_msg_tel_sv_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_telemetry_MsgTelSv0, Test) -{ +}; - uint8_t encoded_frame[] = {85,32,1,148,38,20,175,8,208,221,62,24,16,1,40,50,5,226,255,1,0,1,1,1,33,12,39,105, }; +TEST_F(Test_auto_check_sbp_telemetry_MsgTelSv0, Test) { + uint8_t encoded_frame[] = { + 85, 32, 1, 148, 38, 20, 175, 8, 208, 221, 62, 24, 16, 1, + 40, 50, 5, 226, 255, 1, 0, 1, 1, 1, 33, 12, 39, 105, + }; - sbp_msg_tel_sv_t test_msg{}; - test_msg.n_obs = 16; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_sv_tel.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)118,(char)95,(char)116,(char)101,(char)108 }; - memcpy(test_msg.n_sv_tel.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_sv_tel.value = 1; - test_msg.origin_flags = 1; - - test_msg.sv_tel[0].availability_flags = 5; - test_msg.sv_tel[0].az = 40; - test_msg.sv_tel[0].correction_flags = 1; - test_msg.sv_tel[0].el = 50; - test_msg.sv_tel[0].ephemeris_flags = 1; - test_msg.sv_tel[0].outlier_flags = 1; - test_msg.sv_tel[0].phase_residual = 1; - test_msg.sv_tel[0].pseudorange_residual = -30; - test_msg.sv_tel[0].sid.code = 12; - test_msg.sv_tel[0].sid.sat = 33; - test_msg.tow = 406773200; - test_msg.wn = 2223; - - EXPECT_EQ(send_message( 9876, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + sbp_msg_tel_sv_t test_msg{}; + test_msg.n_obs = 16; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_sv_tel.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)118, (char)95, + (char)116, (char)101, (char)108}; + memcpy(test_msg.n_sv_tel.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_sv_tel.value = 1; + test_msg.origin_flags = 1; + + test_msg.sv_tel[0].availability_flags = 5; + test_msg.sv_tel[0].az = 40; + test_msg.sv_tel[0].correction_flags = 1; + test_msg.sv_tel[0].el = 50; + test_msg.sv_tel[0].ephemeris_flags = 1; + test_msg.sv_tel[0].outlier_flags = 1; + test_msg.sv_tel[0].phase_residual = 1; + test_msg.sv_tel[0].pseudorange_residual = -30; + test_msg.sv_tel[0].sid.code = 12; + test_msg.sv_tel[0].sid.sat = 33; + test_msg.tow = 406773200; + test_msg.wn = 2223; + + EXPECT_EQ(send_message(9876, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 9876); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.n_obs, 16) << "incorrect value for last_msg_.n_obs, expected 16, is " << last_msg_.n_obs; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_sv_tel.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_sv_tel.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_sv_tel.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)118,(char)95,(char)116,(char)101,(char)108 }; - EXPECT_EQ(memcmp(last_msg_.n_sv_tel.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_sv_tel.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_sv_tel.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_sv_tel.value, 1) << "incorrect value for last_msg_.n_sv_tel.value, expected 1, is " << last_msg_.n_sv_tel.value; - EXPECT_EQ(last_msg_.origin_flags, 1) << "incorrect value for last_msg_.origin_flags, expected 1, is " << last_msg_.origin_flags; - EXPECT_EQ(last_msg_.sv_tel[0].availability_flags, 5) << "incorrect value for last_msg_.sv_tel[0].availability_flags, expected 5, is " << last_msg_.sv_tel[0].availability_flags; - EXPECT_EQ(last_msg_.sv_tel[0].az, 40) << "incorrect value for last_msg_.sv_tel[0].az, expected 40, is " << last_msg_.sv_tel[0].az; - EXPECT_EQ(last_msg_.sv_tel[0].correction_flags, 1) << "incorrect value for last_msg_.sv_tel[0].correction_flags, expected 1, is " << last_msg_.sv_tel[0].correction_flags; - EXPECT_EQ(last_msg_.sv_tel[0].el, 50) << "incorrect value for last_msg_.sv_tel[0].el, expected 50, is " << last_msg_.sv_tel[0].el; - EXPECT_EQ(last_msg_.sv_tel[0].ephemeris_flags, 1) << "incorrect value for last_msg_.sv_tel[0].ephemeris_flags, expected 1, is " << last_msg_.sv_tel[0].ephemeris_flags; - EXPECT_EQ(last_msg_.sv_tel[0].outlier_flags, 1) << "incorrect value for last_msg_.sv_tel[0].outlier_flags, expected 1, is " << last_msg_.sv_tel[0].outlier_flags; - EXPECT_EQ(last_msg_.sv_tel[0].phase_residual, 1) << "incorrect value for last_msg_.sv_tel[0].phase_residual, expected 1, is " << last_msg_.sv_tel[0].phase_residual; - EXPECT_EQ(last_msg_.sv_tel[0].pseudorange_residual, -30) << "incorrect value for last_msg_.sv_tel[0].pseudorange_residual, expected -30, is " << last_msg_.sv_tel[0].pseudorange_residual; - EXPECT_EQ(last_msg_.sv_tel[0].sid.code, 12) << "incorrect value for last_msg_.sv_tel[0].sid.code, expected 12, is " << last_msg_.sv_tel[0].sid.code; - EXPECT_EQ(last_msg_.sv_tel[0].sid.sat, 33) << "incorrect value for last_msg_.sv_tel[0].sid.sat, expected 33, is " << last_msg_.sv_tel[0].sid.sat; - EXPECT_EQ(last_msg_.tow, 406773200) << "incorrect value for last_msg_.tow, expected 406773200, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.wn, 2223) << "incorrect value for last_msg_.wn, expected 2223, is " << last_msg_.wn; + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 9876); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.n_obs, 16) + << "incorrect value for last_msg_.n_obs, expected 16, is " + << last_msg_.n_obs; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_sv_tel.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_sv_tel.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_sv_tel.handle_as << "'"; + } + { + const char check_string[] = {(char)115, (char)118, (char)95, + (char)116, (char)101, (char)108}; + EXPECT_EQ(memcmp(last_msg_.n_sv_tel.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_sv_tel.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.n_sv_tel.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_sv_tel.value, 1) + << "incorrect value for last_msg_.n_sv_tel.value, expected 1, is " + << last_msg_.n_sv_tel.value; + EXPECT_EQ(last_msg_.origin_flags, 1) + << "incorrect value for last_msg_.origin_flags, expected 1, is " + << last_msg_.origin_flags; + EXPECT_EQ(last_msg_.sv_tel[0].availability_flags, 5) + << "incorrect value for last_msg_.sv_tel[0].availability_flags, expected " + "5, is " + << last_msg_.sv_tel[0].availability_flags; + EXPECT_EQ(last_msg_.sv_tel[0].az, 40) + << "incorrect value for last_msg_.sv_tel[0].az, expected 40, is " + << last_msg_.sv_tel[0].az; + EXPECT_EQ(last_msg_.sv_tel[0].correction_flags, 1) + << "incorrect value for last_msg_.sv_tel[0].correction_flags, expected " + "1, is " + << last_msg_.sv_tel[0].correction_flags; + EXPECT_EQ(last_msg_.sv_tel[0].el, 50) + << "incorrect value for last_msg_.sv_tel[0].el, expected 50, is " + << last_msg_.sv_tel[0].el; + EXPECT_EQ(last_msg_.sv_tel[0].ephemeris_flags, 1) + << "incorrect value for last_msg_.sv_tel[0].ephemeris_flags, expected 1, " + "is " + << last_msg_.sv_tel[0].ephemeris_flags; + EXPECT_EQ(last_msg_.sv_tel[0].outlier_flags, 1) + << "incorrect value for last_msg_.sv_tel[0].outlier_flags, expected 1, " + "is " + << last_msg_.sv_tel[0].outlier_flags; + EXPECT_EQ(last_msg_.sv_tel[0].phase_residual, 1) + << "incorrect value for last_msg_.sv_tel[0].phase_residual, expected 1, " + "is " + << last_msg_.sv_tel[0].phase_residual; + EXPECT_EQ(last_msg_.sv_tel[0].pseudorange_residual, -30) + << "incorrect value for last_msg_.sv_tel[0].pseudorange_residual, " + "expected -30, is " + << last_msg_.sv_tel[0].pseudorange_residual; + EXPECT_EQ(last_msg_.sv_tel[0].sid.code, 12) + << "incorrect value for last_msg_.sv_tel[0].sid.code, expected 12, is " + << last_msg_.sv_tel[0].sid.code; + EXPECT_EQ(last_msg_.sv_tel[0].sid.sat, 33) + << "incorrect value for last_msg_.sv_tel[0].sid.sat, expected 33, is " + << last_msg_.sv_tel[0].sid.sat; + EXPECT_EQ(last_msg_.tow, 406773200) + << "incorrect value for last_msg_.tow, expected 406773200, is " + << last_msg_.tow; + EXPECT_EQ(last_msg_.wn, 2223) + << "incorrect value for last_msg_.wn, expected 2223, is " << last_msg_.wn; } diff --git a/c/test/cpp/auto_check_sbp_tracking_MsgMeasurementState.cc b/c/test/cpp/auto_check_sbp_tracking_MsgMeasurementState.cc index b734b29f4..201fa0dce 100644 --- a/c/test/cpp/auto_check_sbp_tracking_MsgMeasurementState.cc +++ b/c/test/cpp/auto_check_sbp_tracking_MsgMeasurementState.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgMeasurementState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgMeasurementState.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_tracking_MsgMeasurementState0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgMeasurementState0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_tracking_MsgMeasurementState0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgMeasurementState0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_measurement_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_measurement_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,601 +67,1108 @@ class Test_auto_check_sbp_tracking_MsgMeasurementState0 : sbp_msg_measurement_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgMeasurementState0, Test) -{ - - uint8_t encoded_frame[] = {85,97,0,207,121,237,29,0,162,0,0,0,0,0,0,27,0,201,20,0,168,32,0,184,15,0,187,0,0,0,18,0,210,16,0,167,0,0,0,23,0,213,10,0,223,0,0,0,0,0,0,0,0,0,0,0,0,131,2,202,27,1,192,15,1,165,29,1,146,32,1,170,18,1,201,0,0,0,0,0,0,0,0,0,23,1,212,10,1,205,0,0,0,96,3,230,0,0,0,101,3,214,103,3,212,104,3,209,106,3,157,102,3,230,0,0,0,0,0,0,101,4,189,96,4,207,106,4,164,104,4,193,0,0,0,102,4,208,0,0,0,27,12,212,29,12,161,32,12,216,30,12,216,20,12,178,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,14,203,0,0,0,5,14,158,4,14,194,11,14,192,9,14,207,0,0,0,0,0,0,0,0,0,9,20,218,5,20,176,36,20,217,11,20,200,4,20,205,0,0,0,0,0,0,35,54, }; - - sbp_msg_measurement_state_t test_msg{}; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_states.value = 79; - - test_msg.states[0].cn0 = 162; - test_msg.states[0].mesid.code = 0; - test_msg.states[0].mesid.sat = 29; - - test_msg.states[1].cn0 = 0; - test_msg.states[1].mesid.code = 0; - test_msg.states[1].mesid.sat = 0; - - test_msg.states[2].cn0 = 0; - test_msg.states[2].mesid.code = 0; - test_msg.states[2].mesid.sat = 0; - - test_msg.states[3].cn0 = 201; - test_msg.states[3].mesid.code = 0; - test_msg.states[3].mesid.sat = 27; - - test_msg.states[4].cn0 = 168; - test_msg.states[4].mesid.code = 0; - test_msg.states[4].mesid.sat = 20; - - test_msg.states[5].cn0 = 184; - test_msg.states[5].mesid.code = 0; - test_msg.states[5].mesid.sat = 32; - - test_msg.states[6].cn0 = 187; - test_msg.states[6].mesid.code = 0; - test_msg.states[6].mesid.sat = 15; - - test_msg.states[7].cn0 = 0; - test_msg.states[7].mesid.code = 0; - test_msg.states[7].mesid.sat = 0; - - test_msg.states[8].cn0 = 210; - test_msg.states[8].mesid.code = 0; - test_msg.states[8].mesid.sat = 18; - - test_msg.states[9].cn0 = 167; - test_msg.states[9].mesid.code = 0; - test_msg.states[9].mesid.sat = 16; - - test_msg.states[10].cn0 = 0; - test_msg.states[10].mesid.code = 0; - test_msg.states[10].mesid.sat = 0; - - test_msg.states[11].cn0 = 213; - test_msg.states[11].mesid.code = 0; - test_msg.states[11].mesid.sat = 23; - - test_msg.states[12].cn0 = 223; - test_msg.states[12].mesid.code = 0; - test_msg.states[12].mesid.sat = 10; - - test_msg.states[13].cn0 = 0; - test_msg.states[13].mesid.code = 0; - test_msg.states[13].mesid.sat = 0; - - test_msg.states[14].cn0 = 0; - test_msg.states[14].mesid.code = 0; - test_msg.states[14].mesid.sat = 0; - - test_msg.states[15].cn0 = 0; - test_msg.states[15].mesid.code = 0; - test_msg.states[15].mesid.sat = 0; - - test_msg.states[16].cn0 = 0; - test_msg.states[16].mesid.code = 0; - test_msg.states[16].mesid.sat = 0; - - test_msg.states[17].cn0 = 202; - test_msg.states[17].mesid.code = 2; - test_msg.states[17].mesid.sat = 131; - - test_msg.states[18].cn0 = 192; - test_msg.states[18].mesid.code = 1; - test_msg.states[18].mesid.sat = 27; - - test_msg.states[19].cn0 = 165; - test_msg.states[19].mesid.code = 1; - test_msg.states[19].mesid.sat = 15; - - test_msg.states[20].cn0 = 146; - test_msg.states[20].mesid.code = 1; - test_msg.states[20].mesid.sat = 29; - - test_msg.states[21].cn0 = 170; - test_msg.states[21].mesid.code = 1; - test_msg.states[21].mesid.sat = 32; - - test_msg.states[22].cn0 = 201; - test_msg.states[22].mesid.code = 1; - test_msg.states[22].mesid.sat = 18; - - test_msg.states[23].cn0 = 0; - test_msg.states[23].mesid.code = 0; - test_msg.states[23].mesid.sat = 0; - - test_msg.states[24].cn0 = 0; - test_msg.states[24].mesid.code = 0; - test_msg.states[24].mesid.sat = 0; - - test_msg.states[25].cn0 = 0; - test_msg.states[25].mesid.code = 0; - test_msg.states[25].mesid.sat = 0; - - test_msg.states[26].cn0 = 212; - test_msg.states[26].mesid.code = 1; - test_msg.states[26].mesid.sat = 23; - - test_msg.states[27].cn0 = 205; - test_msg.states[27].mesid.code = 1; - test_msg.states[27].mesid.sat = 10; - - test_msg.states[28].cn0 = 0; - test_msg.states[28].mesid.code = 0; - test_msg.states[28].mesid.sat = 0; - - test_msg.states[29].cn0 = 230; - test_msg.states[29].mesid.code = 3; - test_msg.states[29].mesid.sat = 96; - - test_msg.states[30].cn0 = 0; - test_msg.states[30].mesid.code = 0; - test_msg.states[30].mesid.sat = 0; - - test_msg.states[31].cn0 = 214; - test_msg.states[31].mesid.code = 3; - test_msg.states[31].mesid.sat = 101; - - test_msg.states[32].cn0 = 212; - test_msg.states[32].mesid.code = 3; - test_msg.states[32].mesid.sat = 103; - - test_msg.states[33].cn0 = 209; - test_msg.states[33].mesid.code = 3; - test_msg.states[33].mesid.sat = 104; - - test_msg.states[34].cn0 = 157; - test_msg.states[34].mesid.code = 3; - test_msg.states[34].mesid.sat = 106; - - test_msg.states[35].cn0 = 230; - test_msg.states[35].mesid.code = 3; - test_msg.states[35].mesid.sat = 102; - - test_msg.states[36].cn0 = 0; - test_msg.states[36].mesid.code = 0; - test_msg.states[36].mesid.sat = 0; - - test_msg.states[37].cn0 = 0; - test_msg.states[37].mesid.code = 0; - test_msg.states[37].mesid.sat = 0; - - test_msg.states[38].cn0 = 189; - test_msg.states[38].mesid.code = 4; - test_msg.states[38].mesid.sat = 101; - - test_msg.states[39].cn0 = 207; - test_msg.states[39].mesid.code = 4; - test_msg.states[39].mesid.sat = 96; - - test_msg.states[40].cn0 = 164; - test_msg.states[40].mesid.code = 4; - test_msg.states[40].mesid.sat = 106; - - test_msg.states[41].cn0 = 193; - test_msg.states[41].mesid.code = 4; - test_msg.states[41].mesid.sat = 104; - - test_msg.states[42].cn0 = 0; - test_msg.states[42].mesid.code = 0; - test_msg.states[42].mesid.sat = 0; - - test_msg.states[43].cn0 = 208; - test_msg.states[43].mesid.code = 4; - test_msg.states[43].mesid.sat = 102; - - test_msg.states[44].cn0 = 0; - test_msg.states[44].mesid.code = 0; - test_msg.states[44].mesid.sat = 0; - - test_msg.states[45].cn0 = 212; - test_msg.states[45].mesid.code = 12; - test_msg.states[45].mesid.sat = 27; - - test_msg.states[46].cn0 = 161; - test_msg.states[46].mesid.code = 12; - test_msg.states[46].mesid.sat = 29; - - test_msg.states[47].cn0 = 216; - test_msg.states[47].mesid.code = 12; - test_msg.states[47].mesid.sat = 32; - - test_msg.states[48].cn0 = 216; - test_msg.states[48].mesid.code = 12; - test_msg.states[48].mesid.sat = 30; - - test_msg.states[49].cn0 = 178; - test_msg.states[49].mesid.code = 12; - test_msg.states[49].mesid.sat = 20; - - test_msg.states[50].cn0 = 0; - test_msg.states[50].mesid.code = 0; - test_msg.states[50].mesid.sat = 0; - - test_msg.states[51].cn0 = 0; - test_msg.states[51].mesid.code = 0; - test_msg.states[51].mesid.sat = 0; - - test_msg.states[52].cn0 = 0; - test_msg.states[52].mesid.code = 0; - test_msg.states[52].mesid.sat = 0; - - test_msg.states[53].cn0 = 0; - test_msg.states[53].mesid.code = 0; - test_msg.states[53].mesid.sat = 0; - - test_msg.states[54].cn0 = 0; - test_msg.states[54].mesid.code = 0; - test_msg.states[54].mesid.sat = 0; - - test_msg.states[55].cn0 = 0; - test_msg.states[55].mesid.code = 0; - test_msg.states[55].mesid.sat = 0; - - test_msg.states[56].cn0 = 0; - test_msg.states[56].mesid.code = 0; - test_msg.states[56].mesid.sat = 0; - - test_msg.states[57].cn0 = 0; - test_msg.states[57].mesid.code = 0; - test_msg.states[57].mesid.sat = 0; - - test_msg.states[58].cn0 = 0; - test_msg.states[58].mesid.code = 0; - test_msg.states[58].mesid.sat = 0; - - test_msg.states[59].cn0 = 0; - test_msg.states[59].mesid.code = 0; - test_msg.states[59].mesid.sat = 0; - - test_msg.states[60].cn0 = 0; - test_msg.states[60].mesid.code = 0; - test_msg.states[60].mesid.sat = 0; - - test_msg.states[61].cn0 = 0; - test_msg.states[61].mesid.code = 0; - test_msg.states[61].mesid.sat = 0; - - test_msg.states[62].cn0 = 0; - test_msg.states[62].mesid.code = 0; - test_msg.states[62].mesid.sat = 0; - - test_msg.states[63].cn0 = 203; - test_msg.states[63].mesid.code = 14; - test_msg.states[63].mesid.sat = 36; - - test_msg.states[64].cn0 = 0; - test_msg.states[64].mesid.code = 0; - test_msg.states[64].mesid.sat = 0; - - test_msg.states[65].cn0 = 158; - test_msg.states[65].mesid.code = 14; - test_msg.states[65].mesid.sat = 5; - - test_msg.states[66].cn0 = 194; - test_msg.states[66].mesid.code = 14; - test_msg.states[66].mesid.sat = 4; - - test_msg.states[67].cn0 = 192; - test_msg.states[67].mesid.code = 14; - test_msg.states[67].mesid.sat = 11; - - test_msg.states[68].cn0 = 207; - test_msg.states[68].mesid.code = 14; - test_msg.states[68].mesid.sat = 9; - - test_msg.states[69].cn0 = 0; - test_msg.states[69].mesid.code = 0; - test_msg.states[69].mesid.sat = 0; - - test_msg.states[70].cn0 = 0; - test_msg.states[70].mesid.code = 0; - test_msg.states[70].mesid.sat = 0; - - test_msg.states[71].cn0 = 0; - test_msg.states[71].mesid.code = 0; - test_msg.states[71].mesid.sat = 0; - - test_msg.states[72].cn0 = 218; - test_msg.states[72].mesid.code = 20; - test_msg.states[72].mesid.sat = 9; - - test_msg.states[73].cn0 = 176; - test_msg.states[73].mesid.code = 20; - test_msg.states[73].mesid.sat = 5; - - test_msg.states[74].cn0 = 217; - test_msg.states[74].mesid.code = 20; - test_msg.states[74].mesid.sat = 36; - - test_msg.states[75].cn0 = 200; - test_msg.states[75].mesid.code = 20; - test_msg.states[75].mesid.sat = 11; - - test_msg.states[76].cn0 = 205; - test_msg.states[76].mesid.code = 20; - test_msg.states[76].mesid.sat = 4; - - test_msg.states[77].cn0 = 0; - test_msg.states[77].mesid.code = 0; - test_msg.states[77].mesid.sat = 0; - - test_msg.states[78].cn0 = 0; - test_msg.states[78].mesid.code = 0; - test_msg.states[78].mesid.sat = 0; - - EXPECT_EQ(send_message( 31183, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 31183); - EXPECT_EQ(last_msg_, test_msg); - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_states.value, 79) << "incorrect value for last_msg_.n_states.value, expected 79, is " << last_msg_.n_states.value; - EXPECT_EQ(last_msg_.states[0].cn0, 162) << "incorrect value for last_msg_.states[0].cn0, expected 162, is " << last_msg_.states[0].cn0; - EXPECT_EQ(last_msg_.states[0].mesid.code, 0) << "incorrect value for last_msg_.states[0].mesid.code, expected 0, is " << last_msg_.states[0].mesid.code; - EXPECT_EQ(last_msg_.states[0].mesid.sat, 29) << "incorrect value for last_msg_.states[0].mesid.sat, expected 29, is " << last_msg_.states[0].mesid.sat; - EXPECT_EQ(last_msg_.states[1].cn0, 0) << "incorrect value for last_msg_.states[1].cn0, expected 0, is " << last_msg_.states[1].cn0; - EXPECT_EQ(last_msg_.states[1].mesid.code, 0) << "incorrect value for last_msg_.states[1].mesid.code, expected 0, is " << last_msg_.states[1].mesid.code; - EXPECT_EQ(last_msg_.states[1].mesid.sat, 0) << "incorrect value for last_msg_.states[1].mesid.sat, expected 0, is " << last_msg_.states[1].mesid.sat; - EXPECT_EQ(last_msg_.states[2].cn0, 0) << "incorrect value for last_msg_.states[2].cn0, expected 0, is " << last_msg_.states[2].cn0; - EXPECT_EQ(last_msg_.states[2].mesid.code, 0) << "incorrect value for last_msg_.states[2].mesid.code, expected 0, is " << last_msg_.states[2].mesid.code; - EXPECT_EQ(last_msg_.states[2].mesid.sat, 0) << "incorrect value for last_msg_.states[2].mesid.sat, expected 0, is " << last_msg_.states[2].mesid.sat; - EXPECT_EQ(last_msg_.states[3].cn0, 201) << "incorrect value for last_msg_.states[3].cn0, expected 201, is " << last_msg_.states[3].cn0; - EXPECT_EQ(last_msg_.states[3].mesid.code, 0) << "incorrect value for last_msg_.states[3].mesid.code, expected 0, is " << last_msg_.states[3].mesid.code; - EXPECT_EQ(last_msg_.states[3].mesid.sat, 27) << "incorrect value for last_msg_.states[3].mesid.sat, expected 27, is " << last_msg_.states[3].mesid.sat; - EXPECT_EQ(last_msg_.states[4].cn0, 168) << "incorrect value for last_msg_.states[4].cn0, expected 168, is " << last_msg_.states[4].cn0; - EXPECT_EQ(last_msg_.states[4].mesid.code, 0) << "incorrect value for last_msg_.states[4].mesid.code, expected 0, is " << last_msg_.states[4].mesid.code; - EXPECT_EQ(last_msg_.states[4].mesid.sat, 20) << "incorrect value for last_msg_.states[4].mesid.sat, expected 20, is " << last_msg_.states[4].mesid.sat; - EXPECT_EQ(last_msg_.states[5].cn0, 184) << "incorrect value for last_msg_.states[5].cn0, expected 184, is " << last_msg_.states[5].cn0; - EXPECT_EQ(last_msg_.states[5].mesid.code, 0) << "incorrect value for last_msg_.states[5].mesid.code, expected 0, is " << last_msg_.states[5].mesid.code; - EXPECT_EQ(last_msg_.states[5].mesid.sat, 32) << "incorrect value for last_msg_.states[5].mesid.sat, expected 32, is " << last_msg_.states[5].mesid.sat; - EXPECT_EQ(last_msg_.states[6].cn0, 187) << "incorrect value for last_msg_.states[6].cn0, expected 187, is " << last_msg_.states[6].cn0; - EXPECT_EQ(last_msg_.states[6].mesid.code, 0) << "incorrect value for last_msg_.states[6].mesid.code, expected 0, is " << last_msg_.states[6].mesid.code; - EXPECT_EQ(last_msg_.states[6].mesid.sat, 15) << "incorrect value for last_msg_.states[6].mesid.sat, expected 15, is " << last_msg_.states[6].mesid.sat; - EXPECT_EQ(last_msg_.states[7].cn0, 0) << "incorrect value for last_msg_.states[7].cn0, expected 0, is " << last_msg_.states[7].cn0; - EXPECT_EQ(last_msg_.states[7].mesid.code, 0) << "incorrect value for last_msg_.states[7].mesid.code, expected 0, is " << last_msg_.states[7].mesid.code; - EXPECT_EQ(last_msg_.states[7].mesid.sat, 0) << "incorrect value for last_msg_.states[7].mesid.sat, expected 0, is " << last_msg_.states[7].mesid.sat; - EXPECT_EQ(last_msg_.states[8].cn0, 210) << "incorrect value for last_msg_.states[8].cn0, expected 210, is " << last_msg_.states[8].cn0; - EXPECT_EQ(last_msg_.states[8].mesid.code, 0) << "incorrect value for last_msg_.states[8].mesid.code, expected 0, is " << last_msg_.states[8].mesid.code; - EXPECT_EQ(last_msg_.states[8].mesid.sat, 18) << "incorrect value for last_msg_.states[8].mesid.sat, expected 18, is " << last_msg_.states[8].mesid.sat; - EXPECT_EQ(last_msg_.states[9].cn0, 167) << "incorrect value for last_msg_.states[9].cn0, expected 167, is " << last_msg_.states[9].cn0; - EXPECT_EQ(last_msg_.states[9].mesid.code, 0) << "incorrect value for last_msg_.states[9].mesid.code, expected 0, is " << last_msg_.states[9].mesid.code; - EXPECT_EQ(last_msg_.states[9].mesid.sat, 16) << "incorrect value for last_msg_.states[9].mesid.sat, expected 16, is " << last_msg_.states[9].mesid.sat; - EXPECT_EQ(last_msg_.states[10].cn0, 0) << "incorrect value for last_msg_.states[10].cn0, expected 0, is " << last_msg_.states[10].cn0; - EXPECT_EQ(last_msg_.states[10].mesid.code, 0) << "incorrect value for last_msg_.states[10].mesid.code, expected 0, is " << last_msg_.states[10].mesid.code; - EXPECT_EQ(last_msg_.states[10].mesid.sat, 0) << "incorrect value for last_msg_.states[10].mesid.sat, expected 0, is " << last_msg_.states[10].mesid.sat; - EXPECT_EQ(last_msg_.states[11].cn0, 213) << "incorrect value for last_msg_.states[11].cn0, expected 213, is " << last_msg_.states[11].cn0; - EXPECT_EQ(last_msg_.states[11].mesid.code, 0) << "incorrect value for last_msg_.states[11].mesid.code, expected 0, is " << last_msg_.states[11].mesid.code; - EXPECT_EQ(last_msg_.states[11].mesid.sat, 23) << "incorrect value for last_msg_.states[11].mesid.sat, expected 23, is " << last_msg_.states[11].mesid.sat; - EXPECT_EQ(last_msg_.states[12].cn0, 223) << "incorrect value for last_msg_.states[12].cn0, expected 223, is " << last_msg_.states[12].cn0; - EXPECT_EQ(last_msg_.states[12].mesid.code, 0) << "incorrect value for last_msg_.states[12].mesid.code, expected 0, is " << last_msg_.states[12].mesid.code; - EXPECT_EQ(last_msg_.states[12].mesid.sat, 10) << "incorrect value for last_msg_.states[12].mesid.sat, expected 10, is " << last_msg_.states[12].mesid.sat; - EXPECT_EQ(last_msg_.states[13].cn0, 0) << "incorrect value for last_msg_.states[13].cn0, expected 0, is " << last_msg_.states[13].cn0; - EXPECT_EQ(last_msg_.states[13].mesid.code, 0) << "incorrect value for last_msg_.states[13].mesid.code, expected 0, is " << last_msg_.states[13].mesid.code; - EXPECT_EQ(last_msg_.states[13].mesid.sat, 0) << "incorrect value for last_msg_.states[13].mesid.sat, expected 0, is " << last_msg_.states[13].mesid.sat; - EXPECT_EQ(last_msg_.states[14].cn0, 0) << "incorrect value for last_msg_.states[14].cn0, expected 0, is " << last_msg_.states[14].cn0; - EXPECT_EQ(last_msg_.states[14].mesid.code, 0) << "incorrect value for last_msg_.states[14].mesid.code, expected 0, is " << last_msg_.states[14].mesid.code; - EXPECT_EQ(last_msg_.states[14].mesid.sat, 0) << "incorrect value for last_msg_.states[14].mesid.sat, expected 0, is " << last_msg_.states[14].mesid.sat; - EXPECT_EQ(last_msg_.states[15].cn0, 0) << "incorrect value for last_msg_.states[15].cn0, expected 0, is " << last_msg_.states[15].cn0; - EXPECT_EQ(last_msg_.states[15].mesid.code, 0) << "incorrect value for last_msg_.states[15].mesid.code, expected 0, is " << last_msg_.states[15].mesid.code; - EXPECT_EQ(last_msg_.states[15].mesid.sat, 0) << "incorrect value for last_msg_.states[15].mesid.sat, expected 0, is " << last_msg_.states[15].mesid.sat; - EXPECT_EQ(last_msg_.states[16].cn0, 0) << "incorrect value for last_msg_.states[16].cn0, expected 0, is " << last_msg_.states[16].cn0; - EXPECT_EQ(last_msg_.states[16].mesid.code, 0) << "incorrect value for last_msg_.states[16].mesid.code, expected 0, is " << last_msg_.states[16].mesid.code; - EXPECT_EQ(last_msg_.states[16].mesid.sat, 0) << "incorrect value for last_msg_.states[16].mesid.sat, expected 0, is " << last_msg_.states[16].mesid.sat; - EXPECT_EQ(last_msg_.states[17].cn0, 202) << "incorrect value for last_msg_.states[17].cn0, expected 202, is " << last_msg_.states[17].cn0; - EXPECT_EQ(last_msg_.states[17].mesid.code, 2) << "incorrect value for last_msg_.states[17].mesid.code, expected 2, is " << last_msg_.states[17].mesid.code; - EXPECT_EQ(last_msg_.states[17].mesid.sat, 131) << "incorrect value for last_msg_.states[17].mesid.sat, expected 131, is " << last_msg_.states[17].mesid.sat; - EXPECT_EQ(last_msg_.states[18].cn0, 192) << "incorrect value for last_msg_.states[18].cn0, expected 192, is " << last_msg_.states[18].cn0; - EXPECT_EQ(last_msg_.states[18].mesid.code, 1) << "incorrect value for last_msg_.states[18].mesid.code, expected 1, is " << last_msg_.states[18].mesid.code; - EXPECT_EQ(last_msg_.states[18].mesid.sat, 27) << "incorrect value for last_msg_.states[18].mesid.sat, expected 27, is " << last_msg_.states[18].mesid.sat; - EXPECT_EQ(last_msg_.states[19].cn0, 165) << "incorrect value for last_msg_.states[19].cn0, expected 165, is " << last_msg_.states[19].cn0; - EXPECT_EQ(last_msg_.states[19].mesid.code, 1) << "incorrect value for last_msg_.states[19].mesid.code, expected 1, is " << last_msg_.states[19].mesid.code; - EXPECT_EQ(last_msg_.states[19].mesid.sat, 15) << "incorrect value for last_msg_.states[19].mesid.sat, expected 15, is " << last_msg_.states[19].mesid.sat; - EXPECT_EQ(last_msg_.states[20].cn0, 146) << "incorrect value for last_msg_.states[20].cn0, expected 146, is " << last_msg_.states[20].cn0; - EXPECT_EQ(last_msg_.states[20].mesid.code, 1) << "incorrect value for last_msg_.states[20].mesid.code, expected 1, is " << last_msg_.states[20].mesid.code; - EXPECT_EQ(last_msg_.states[20].mesid.sat, 29) << "incorrect value for last_msg_.states[20].mesid.sat, expected 29, is " << last_msg_.states[20].mesid.sat; - EXPECT_EQ(last_msg_.states[21].cn0, 170) << "incorrect value for last_msg_.states[21].cn0, expected 170, is " << last_msg_.states[21].cn0; - EXPECT_EQ(last_msg_.states[21].mesid.code, 1) << "incorrect value for last_msg_.states[21].mesid.code, expected 1, is " << last_msg_.states[21].mesid.code; - EXPECT_EQ(last_msg_.states[21].mesid.sat, 32) << "incorrect value for last_msg_.states[21].mesid.sat, expected 32, is " << last_msg_.states[21].mesid.sat; - EXPECT_EQ(last_msg_.states[22].cn0, 201) << "incorrect value for last_msg_.states[22].cn0, expected 201, is " << last_msg_.states[22].cn0; - EXPECT_EQ(last_msg_.states[22].mesid.code, 1) << "incorrect value for last_msg_.states[22].mesid.code, expected 1, is " << last_msg_.states[22].mesid.code; - EXPECT_EQ(last_msg_.states[22].mesid.sat, 18) << "incorrect value for last_msg_.states[22].mesid.sat, expected 18, is " << last_msg_.states[22].mesid.sat; - EXPECT_EQ(last_msg_.states[23].cn0, 0) << "incorrect value for last_msg_.states[23].cn0, expected 0, is " << last_msg_.states[23].cn0; - EXPECT_EQ(last_msg_.states[23].mesid.code, 0) << "incorrect value for last_msg_.states[23].mesid.code, expected 0, is " << last_msg_.states[23].mesid.code; - EXPECT_EQ(last_msg_.states[23].mesid.sat, 0) << "incorrect value for last_msg_.states[23].mesid.sat, expected 0, is " << last_msg_.states[23].mesid.sat; - EXPECT_EQ(last_msg_.states[24].cn0, 0) << "incorrect value for last_msg_.states[24].cn0, expected 0, is " << last_msg_.states[24].cn0; - EXPECT_EQ(last_msg_.states[24].mesid.code, 0) << "incorrect value for last_msg_.states[24].mesid.code, expected 0, is " << last_msg_.states[24].mesid.code; - EXPECT_EQ(last_msg_.states[24].mesid.sat, 0) << "incorrect value for last_msg_.states[24].mesid.sat, expected 0, is " << last_msg_.states[24].mesid.sat; - EXPECT_EQ(last_msg_.states[25].cn0, 0) << "incorrect value for last_msg_.states[25].cn0, expected 0, is " << last_msg_.states[25].cn0; - EXPECT_EQ(last_msg_.states[25].mesid.code, 0) << "incorrect value for last_msg_.states[25].mesid.code, expected 0, is " << last_msg_.states[25].mesid.code; - EXPECT_EQ(last_msg_.states[25].mesid.sat, 0) << "incorrect value for last_msg_.states[25].mesid.sat, expected 0, is " << last_msg_.states[25].mesid.sat; - EXPECT_EQ(last_msg_.states[26].cn0, 212) << "incorrect value for last_msg_.states[26].cn0, expected 212, is " << last_msg_.states[26].cn0; - EXPECT_EQ(last_msg_.states[26].mesid.code, 1) << "incorrect value for last_msg_.states[26].mesid.code, expected 1, is " << last_msg_.states[26].mesid.code; - EXPECT_EQ(last_msg_.states[26].mesid.sat, 23) << "incorrect value for last_msg_.states[26].mesid.sat, expected 23, is " << last_msg_.states[26].mesid.sat; - EXPECT_EQ(last_msg_.states[27].cn0, 205) << "incorrect value for last_msg_.states[27].cn0, expected 205, is " << last_msg_.states[27].cn0; - EXPECT_EQ(last_msg_.states[27].mesid.code, 1) << "incorrect value for last_msg_.states[27].mesid.code, expected 1, is " << last_msg_.states[27].mesid.code; - EXPECT_EQ(last_msg_.states[27].mesid.sat, 10) << "incorrect value for last_msg_.states[27].mesid.sat, expected 10, is " << last_msg_.states[27].mesid.sat; - EXPECT_EQ(last_msg_.states[28].cn0, 0) << "incorrect value for last_msg_.states[28].cn0, expected 0, is " << last_msg_.states[28].cn0; - EXPECT_EQ(last_msg_.states[28].mesid.code, 0) << "incorrect value for last_msg_.states[28].mesid.code, expected 0, is " << last_msg_.states[28].mesid.code; - EXPECT_EQ(last_msg_.states[28].mesid.sat, 0) << "incorrect value for last_msg_.states[28].mesid.sat, expected 0, is " << last_msg_.states[28].mesid.sat; - EXPECT_EQ(last_msg_.states[29].cn0, 230) << "incorrect value for last_msg_.states[29].cn0, expected 230, is " << last_msg_.states[29].cn0; - EXPECT_EQ(last_msg_.states[29].mesid.code, 3) << "incorrect value for last_msg_.states[29].mesid.code, expected 3, is " << last_msg_.states[29].mesid.code; - EXPECT_EQ(last_msg_.states[29].mesid.sat, 96) << "incorrect value for last_msg_.states[29].mesid.sat, expected 96, is " << last_msg_.states[29].mesid.sat; - EXPECT_EQ(last_msg_.states[30].cn0, 0) << "incorrect value for last_msg_.states[30].cn0, expected 0, is " << last_msg_.states[30].cn0; - EXPECT_EQ(last_msg_.states[30].mesid.code, 0) << "incorrect value for last_msg_.states[30].mesid.code, expected 0, is " << last_msg_.states[30].mesid.code; - EXPECT_EQ(last_msg_.states[30].mesid.sat, 0) << "incorrect value for last_msg_.states[30].mesid.sat, expected 0, is " << last_msg_.states[30].mesid.sat; - EXPECT_EQ(last_msg_.states[31].cn0, 214) << "incorrect value for last_msg_.states[31].cn0, expected 214, is " << last_msg_.states[31].cn0; - EXPECT_EQ(last_msg_.states[31].mesid.code, 3) << "incorrect value for last_msg_.states[31].mesid.code, expected 3, is " << last_msg_.states[31].mesid.code; - EXPECT_EQ(last_msg_.states[31].mesid.sat, 101) << "incorrect value for last_msg_.states[31].mesid.sat, expected 101, is " << last_msg_.states[31].mesid.sat; - EXPECT_EQ(last_msg_.states[32].cn0, 212) << "incorrect value for last_msg_.states[32].cn0, expected 212, is " << last_msg_.states[32].cn0; - EXPECT_EQ(last_msg_.states[32].mesid.code, 3) << "incorrect value for last_msg_.states[32].mesid.code, expected 3, is " << last_msg_.states[32].mesid.code; - EXPECT_EQ(last_msg_.states[32].mesid.sat, 103) << "incorrect value for last_msg_.states[32].mesid.sat, expected 103, is " << last_msg_.states[32].mesid.sat; - EXPECT_EQ(last_msg_.states[33].cn0, 209) << "incorrect value for last_msg_.states[33].cn0, expected 209, is " << last_msg_.states[33].cn0; - EXPECT_EQ(last_msg_.states[33].mesid.code, 3) << "incorrect value for last_msg_.states[33].mesid.code, expected 3, is " << last_msg_.states[33].mesid.code; - EXPECT_EQ(last_msg_.states[33].mesid.sat, 104) << "incorrect value for last_msg_.states[33].mesid.sat, expected 104, is " << last_msg_.states[33].mesid.sat; - EXPECT_EQ(last_msg_.states[34].cn0, 157) << "incorrect value for last_msg_.states[34].cn0, expected 157, is " << last_msg_.states[34].cn0; - EXPECT_EQ(last_msg_.states[34].mesid.code, 3) << "incorrect value for last_msg_.states[34].mesid.code, expected 3, is " << last_msg_.states[34].mesid.code; - EXPECT_EQ(last_msg_.states[34].mesid.sat, 106) << "incorrect value for last_msg_.states[34].mesid.sat, expected 106, is " << last_msg_.states[34].mesid.sat; - EXPECT_EQ(last_msg_.states[35].cn0, 230) << "incorrect value for last_msg_.states[35].cn0, expected 230, is " << last_msg_.states[35].cn0; - EXPECT_EQ(last_msg_.states[35].mesid.code, 3) << "incorrect value for last_msg_.states[35].mesid.code, expected 3, is " << last_msg_.states[35].mesid.code; - EXPECT_EQ(last_msg_.states[35].mesid.sat, 102) << "incorrect value for last_msg_.states[35].mesid.sat, expected 102, is " << last_msg_.states[35].mesid.sat; - EXPECT_EQ(last_msg_.states[36].cn0, 0) << "incorrect value for last_msg_.states[36].cn0, expected 0, is " << last_msg_.states[36].cn0; - EXPECT_EQ(last_msg_.states[36].mesid.code, 0) << "incorrect value for last_msg_.states[36].mesid.code, expected 0, is " << last_msg_.states[36].mesid.code; - EXPECT_EQ(last_msg_.states[36].mesid.sat, 0) << "incorrect value for last_msg_.states[36].mesid.sat, expected 0, is " << last_msg_.states[36].mesid.sat; - EXPECT_EQ(last_msg_.states[37].cn0, 0) << "incorrect value for last_msg_.states[37].cn0, expected 0, is " << last_msg_.states[37].cn0; - EXPECT_EQ(last_msg_.states[37].mesid.code, 0) << "incorrect value for last_msg_.states[37].mesid.code, expected 0, is " << last_msg_.states[37].mesid.code; - EXPECT_EQ(last_msg_.states[37].mesid.sat, 0) << "incorrect value for last_msg_.states[37].mesid.sat, expected 0, is " << last_msg_.states[37].mesid.sat; - EXPECT_EQ(last_msg_.states[38].cn0, 189) << "incorrect value for last_msg_.states[38].cn0, expected 189, is " << last_msg_.states[38].cn0; - EXPECT_EQ(last_msg_.states[38].mesid.code, 4) << "incorrect value for last_msg_.states[38].mesid.code, expected 4, is " << last_msg_.states[38].mesid.code; - EXPECT_EQ(last_msg_.states[38].mesid.sat, 101) << "incorrect value for last_msg_.states[38].mesid.sat, expected 101, is " << last_msg_.states[38].mesid.sat; - EXPECT_EQ(last_msg_.states[39].cn0, 207) << "incorrect value for last_msg_.states[39].cn0, expected 207, is " << last_msg_.states[39].cn0; - EXPECT_EQ(last_msg_.states[39].mesid.code, 4) << "incorrect value for last_msg_.states[39].mesid.code, expected 4, is " << last_msg_.states[39].mesid.code; - EXPECT_EQ(last_msg_.states[39].mesid.sat, 96) << "incorrect value for last_msg_.states[39].mesid.sat, expected 96, is " << last_msg_.states[39].mesid.sat; - EXPECT_EQ(last_msg_.states[40].cn0, 164) << "incorrect value for last_msg_.states[40].cn0, expected 164, is " << last_msg_.states[40].cn0; - EXPECT_EQ(last_msg_.states[40].mesid.code, 4) << "incorrect value for last_msg_.states[40].mesid.code, expected 4, is " << last_msg_.states[40].mesid.code; - EXPECT_EQ(last_msg_.states[40].mesid.sat, 106) << "incorrect value for last_msg_.states[40].mesid.sat, expected 106, is " << last_msg_.states[40].mesid.sat; - EXPECT_EQ(last_msg_.states[41].cn0, 193) << "incorrect value for last_msg_.states[41].cn0, expected 193, is " << last_msg_.states[41].cn0; - EXPECT_EQ(last_msg_.states[41].mesid.code, 4) << "incorrect value for last_msg_.states[41].mesid.code, expected 4, is " << last_msg_.states[41].mesid.code; - EXPECT_EQ(last_msg_.states[41].mesid.sat, 104) << "incorrect value for last_msg_.states[41].mesid.sat, expected 104, is " << last_msg_.states[41].mesid.sat; - EXPECT_EQ(last_msg_.states[42].cn0, 0) << "incorrect value for last_msg_.states[42].cn0, expected 0, is " << last_msg_.states[42].cn0; - EXPECT_EQ(last_msg_.states[42].mesid.code, 0) << "incorrect value for last_msg_.states[42].mesid.code, expected 0, is " << last_msg_.states[42].mesid.code; - EXPECT_EQ(last_msg_.states[42].mesid.sat, 0) << "incorrect value for last_msg_.states[42].mesid.sat, expected 0, is " << last_msg_.states[42].mesid.sat; - EXPECT_EQ(last_msg_.states[43].cn0, 208) << "incorrect value for last_msg_.states[43].cn0, expected 208, is " << last_msg_.states[43].cn0; - EXPECT_EQ(last_msg_.states[43].mesid.code, 4) << "incorrect value for last_msg_.states[43].mesid.code, expected 4, is " << last_msg_.states[43].mesid.code; - EXPECT_EQ(last_msg_.states[43].mesid.sat, 102) << "incorrect value for last_msg_.states[43].mesid.sat, expected 102, is " << last_msg_.states[43].mesid.sat; - EXPECT_EQ(last_msg_.states[44].cn0, 0) << "incorrect value for last_msg_.states[44].cn0, expected 0, is " << last_msg_.states[44].cn0; - EXPECT_EQ(last_msg_.states[44].mesid.code, 0) << "incorrect value for last_msg_.states[44].mesid.code, expected 0, is " << last_msg_.states[44].mesid.code; - EXPECT_EQ(last_msg_.states[44].mesid.sat, 0) << "incorrect value for last_msg_.states[44].mesid.sat, expected 0, is " << last_msg_.states[44].mesid.sat; - EXPECT_EQ(last_msg_.states[45].cn0, 212) << "incorrect value for last_msg_.states[45].cn0, expected 212, is " << last_msg_.states[45].cn0; - EXPECT_EQ(last_msg_.states[45].mesid.code, 12) << "incorrect value for last_msg_.states[45].mesid.code, expected 12, is " << last_msg_.states[45].mesid.code; - EXPECT_EQ(last_msg_.states[45].mesid.sat, 27) << "incorrect value for last_msg_.states[45].mesid.sat, expected 27, is " << last_msg_.states[45].mesid.sat; - EXPECT_EQ(last_msg_.states[46].cn0, 161) << "incorrect value for last_msg_.states[46].cn0, expected 161, is " << last_msg_.states[46].cn0; - EXPECT_EQ(last_msg_.states[46].mesid.code, 12) << "incorrect value for last_msg_.states[46].mesid.code, expected 12, is " << last_msg_.states[46].mesid.code; - EXPECT_EQ(last_msg_.states[46].mesid.sat, 29) << "incorrect value for last_msg_.states[46].mesid.sat, expected 29, is " << last_msg_.states[46].mesid.sat; - EXPECT_EQ(last_msg_.states[47].cn0, 216) << "incorrect value for last_msg_.states[47].cn0, expected 216, is " << last_msg_.states[47].cn0; - EXPECT_EQ(last_msg_.states[47].mesid.code, 12) << "incorrect value for last_msg_.states[47].mesid.code, expected 12, is " << last_msg_.states[47].mesid.code; - EXPECT_EQ(last_msg_.states[47].mesid.sat, 32) << "incorrect value for last_msg_.states[47].mesid.sat, expected 32, is " << last_msg_.states[47].mesid.sat; - EXPECT_EQ(last_msg_.states[48].cn0, 216) << "incorrect value for last_msg_.states[48].cn0, expected 216, is " << last_msg_.states[48].cn0; - EXPECT_EQ(last_msg_.states[48].mesid.code, 12) << "incorrect value for last_msg_.states[48].mesid.code, expected 12, is " << last_msg_.states[48].mesid.code; - EXPECT_EQ(last_msg_.states[48].mesid.sat, 30) << "incorrect value for last_msg_.states[48].mesid.sat, expected 30, is " << last_msg_.states[48].mesid.sat; - EXPECT_EQ(last_msg_.states[49].cn0, 178) << "incorrect value for last_msg_.states[49].cn0, expected 178, is " << last_msg_.states[49].cn0; - EXPECT_EQ(last_msg_.states[49].mesid.code, 12) << "incorrect value for last_msg_.states[49].mesid.code, expected 12, is " << last_msg_.states[49].mesid.code; - EXPECT_EQ(last_msg_.states[49].mesid.sat, 20) << "incorrect value for last_msg_.states[49].mesid.sat, expected 20, is " << last_msg_.states[49].mesid.sat; - EXPECT_EQ(last_msg_.states[50].cn0, 0) << "incorrect value for last_msg_.states[50].cn0, expected 0, is " << last_msg_.states[50].cn0; - EXPECT_EQ(last_msg_.states[50].mesid.code, 0) << "incorrect value for last_msg_.states[50].mesid.code, expected 0, is " << last_msg_.states[50].mesid.code; - EXPECT_EQ(last_msg_.states[50].mesid.sat, 0) << "incorrect value for last_msg_.states[50].mesid.sat, expected 0, is " << last_msg_.states[50].mesid.sat; - EXPECT_EQ(last_msg_.states[51].cn0, 0) << "incorrect value for last_msg_.states[51].cn0, expected 0, is " << last_msg_.states[51].cn0; - EXPECT_EQ(last_msg_.states[51].mesid.code, 0) << "incorrect value for last_msg_.states[51].mesid.code, expected 0, is " << last_msg_.states[51].mesid.code; - EXPECT_EQ(last_msg_.states[51].mesid.sat, 0) << "incorrect value for last_msg_.states[51].mesid.sat, expected 0, is " << last_msg_.states[51].mesid.sat; - EXPECT_EQ(last_msg_.states[52].cn0, 0) << "incorrect value for last_msg_.states[52].cn0, expected 0, is " << last_msg_.states[52].cn0; - EXPECT_EQ(last_msg_.states[52].mesid.code, 0) << "incorrect value for last_msg_.states[52].mesid.code, expected 0, is " << last_msg_.states[52].mesid.code; - EXPECT_EQ(last_msg_.states[52].mesid.sat, 0) << "incorrect value for last_msg_.states[52].mesid.sat, expected 0, is " << last_msg_.states[52].mesid.sat; - EXPECT_EQ(last_msg_.states[53].cn0, 0) << "incorrect value for last_msg_.states[53].cn0, expected 0, is " << last_msg_.states[53].cn0; - EXPECT_EQ(last_msg_.states[53].mesid.code, 0) << "incorrect value for last_msg_.states[53].mesid.code, expected 0, is " << last_msg_.states[53].mesid.code; - EXPECT_EQ(last_msg_.states[53].mesid.sat, 0) << "incorrect value for last_msg_.states[53].mesid.sat, expected 0, is " << last_msg_.states[53].mesid.sat; - EXPECT_EQ(last_msg_.states[54].cn0, 0) << "incorrect value for last_msg_.states[54].cn0, expected 0, is " << last_msg_.states[54].cn0; - EXPECT_EQ(last_msg_.states[54].mesid.code, 0) << "incorrect value for last_msg_.states[54].mesid.code, expected 0, is " << last_msg_.states[54].mesid.code; - EXPECT_EQ(last_msg_.states[54].mesid.sat, 0) << "incorrect value for last_msg_.states[54].mesid.sat, expected 0, is " << last_msg_.states[54].mesid.sat; - EXPECT_EQ(last_msg_.states[55].cn0, 0) << "incorrect value for last_msg_.states[55].cn0, expected 0, is " << last_msg_.states[55].cn0; - EXPECT_EQ(last_msg_.states[55].mesid.code, 0) << "incorrect value for last_msg_.states[55].mesid.code, expected 0, is " << last_msg_.states[55].mesid.code; - EXPECT_EQ(last_msg_.states[55].mesid.sat, 0) << "incorrect value for last_msg_.states[55].mesid.sat, expected 0, is " << last_msg_.states[55].mesid.sat; - EXPECT_EQ(last_msg_.states[56].cn0, 0) << "incorrect value for last_msg_.states[56].cn0, expected 0, is " << last_msg_.states[56].cn0; - EXPECT_EQ(last_msg_.states[56].mesid.code, 0) << "incorrect value for last_msg_.states[56].mesid.code, expected 0, is " << last_msg_.states[56].mesid.code; - EXPECT_EQ(last_msg_.states[56].mesid.sat, 0) << "incorrect value for last_msg_.states[56].mesid.sat, expected 0, is " << last_msg_.states[56].mesid.sat; - EXPECT_EQ(last_msg_.states[57].cn0, 0) << "incorrect value for last_msg_.states[57].cn0, expected 0, is " << last_msg_.states[57].cn0; - EXPECT_EQ(last_msg_.states[57].mesid.code, 0) << "incorrect value for last_msg_.states[57].mesid.code, expected 0, is " << last_msg_.states[57].mesid.code; - EXPECT_EQ(last_msg_.states[57].mesid.sat, 0) << "incorrect value for last_msg_.states[57].mesid.sat, expected 0, is " << last_msg_.states[57].mesid.sat; - EXPECT_EQ(last_msg_.states[58].cn0, 0) << "incorrect value for last_msg_.states[58].cn0, expected 0, is " << last_msg_.states[58].cn0; - EXPECT_EQ(last_msg_.states[58].mesid.code, 0) << "incorrect value for last_msg_.states[58].mesid.code, expected 0, is " << last_msg_.states[58].mesid.code; - EXPECT_EQ(last_msg_.states[58].mesid.sat, 0) << "incorrect value for last_msg_.states[58].mesid.sat, expected 0, is " << last_msg_.states[58].mesid.sat; - EXPECT_EQ(last_msg_.states[59].cn0, 0) << "incorrect value for last_msg_.states[59].cn0, expected 0, is " << last_msg_.states[59].cn0; - EXPECT_EQ(last_msg_.states[59].mesid.code, 0) << "incorrect value for last_msg_.states[59].mesid.code, expected 0, is " << last_msg_.states[59].mesid.code; - EXPECT_EQ(last_msg_.states[59].mesid.sat, 0) << "incorrect value for last_msg_.states[59].mesid.sat, expected 0, is " << last_msg_.states[59].mesid.sat; - EXPECT_EQ(last_msg_.states[60].cn0, 0) << "incorrect value for last_msg_.states[60].cn0, expected 0, is " << last_msg_.states[60].cn0; - EXPECT_EQ(last_msg_.states[60].mesid.code, 0) << "incorrect value for last_msg_.states[60].mesid.code, expected 0, is " << last_msg_.states[60].mesid.code; - EXPECT_EQ(last_msg_.states[60].mesid.sat, 0) << "incorrect value for last_msg_.states[60].mesid.sat, expected 0, is " << last_msg_.states[60].mesid.sat; - EXPECT_EQ(last_msg_.states[61].cn0, 0) << "incorrect value for last_msg_.states[61].cn0, expected 0, is " << last_msg_.states[61].cn0; - EXPECT_EQ(last_msg_.states[61].mesid.code, 0) << "incorrect value for last_msg_.states[61].mesid.code, expected 0, is " << last_msg_.states[61].mesid.code; - EXPECT_EQ(last_msg_.states[61].mesid.sat, 0) << "incorrect value for last_msg_.states[61].mesid.sat, expected 0, is " << last_msg_.states[61].mesid.sat; - EXPECT_EQ(last_msg_.states[62].cn0, 0) << "incorrect value for last_msg_.states[62].cn0, expected 0, is " << last_msg_.states[62].cn0; - EXPECT_EQ(last_msg_.states[62].mesid.code, 0) << "incorrect value for last_msg_.states[62].mesid.code, expected 0, is " << last_msg_.states[62].mesid.code; - EXPECT_EQ(last_msg_.states[62].mesid.sat, 0) << "incorrect value for last_msg_.states[62].mesid.sat, expected 0, is " << last_msg_.states[62].mesid.sat; - EXPECT_EQ(last_msg_.states[63].cn0, 203) << "incorrect value for last_msg_.states[63].cn0, expected 203, is " << last_msg_.states[63].cn0; - EXPECT_EQ(last_msg_.states[63].mesid.code, 14) << "incorrect value for last_msg_.states[63].mesid.code, expected 14, is " << last_msg_.states[63].mesid.code; - EXPECT_EQ(last_msg_.states[63].mesid.sat, 36) << "incorrect value for last_msg_.states[63].mesid.sat, expected 36, is " << last_msg_.states[63].mesid.sat; - EXPECT_EQ(last_msg_.states[64].cn0, 0) << "incorrect value for last_msg_.states[64].cn0, expected 0, is " << last_msg_.states[64].cn0; - EXPECT_EQ(last_msg_.states[64].mesid.code, 0) << "incorrect value for last_msg_.states[64].mesid.code, expected 0, is " << last_msg_.states[64].mesid.code; - EXPECT_EQ(last_msg_.states[64].mesid.sat, 0) << "incorrect value for last_msg_.states[64].mesid.sat, expected 0, is " << last_msg_.states[64].mesid.sat; - EXPECT_EQ(last_msg_.states[65].cn0, 158) << "incorrect value for last_msg_.states[65].cn0, expected 158, is " << last_msg_.states[65].cn0; - EXPECT_EQ(last_msg_.states[65].mesid.code, 14) << "incorrect value for last_msg_.states[65].mesid.code, expected 14, is " << last_msg_.states[65].mesid.code; - EXPECT_EQ(last_msg_.states[65].mesid.sat, 5) << "incorrect value for last_msg_.states[65].mesid.sat, expected 5, is " << last_msg_.states[65].mesid.sat; - EXPECT_EQ(last_msg_.states[66].cn0, 194) << "incorrect value for last_msg_.states[66].cn0, expected 194, is " << last_msg_.states[66].cn0; - EXPECT_EQ(last_msg_.states[66].mesid.code, 14) << "incorrect value for last_msg_.states[66].mesid.code, expected 14, is " << last_msg_.states[66].mesid.code; - EXPECT_EQ(last_msg_.states[66].mesid.sat, 4) << "incorrect value for last_msg_.states[66].mesid.sat, expected 4, is " << last_msg_.states[66].mesid.sat; - EXPECT_EQ(last_msg_.states[67].cn0, 192) << "incorrect value for last_msg_.states[67].cn0, expected 192, is " << last_msg_.states[67].cn0; - EXPECT_EQ(last_msg_.states[67].mesid.code, 14) << "incorrect value for last_msg_.states[67].mesid.code, expected 14, is " << last_msg_.states[67].mesid.code; - EXPECT_EQ(last_msg_.states[67].mesid.sat, 11) << "incorrect value for last_msg_.states[67].mesid.sat, expected 11, is " << last_msg_.states[67].mesid.sat; - EXPECT_EQ(last_msg_.states[68].cn0, 207) << "incorrect value for last_msg_.states[68].cn0, expected 207, is " << last_msg_.states[68].cn0; - EXPECT_EQ(last_msg_.states[68].mesid.code, 14) << "incorrect value for last_msg_.states[68].mesid.code, expected 14, is " << last_msg_.states[68].mesid.code; - EXPECT_EQ(last_msg_.states[68].mesid.sat, 9) << "incorrect value for last_msg_.states[68].mesid.sat, expected 9, is " << last_msg_.states[68].mesid.sat; - EXPECT_EQ(last_msg_.states[69].cn0, 0) << "incorrect value for last_msg_.states[69].cn0, expected 0, is " << last_msg_.states[69].cn0; - EXPECT_EQ(last_msg_.states[69].mesid.code, 0) << "incorrect value for last_msg_.states[69].mesid.code, expected 0, is " << last_msg_.states[69].mesid.code; - EXPECT_EQ(last_msg_.states[69].mesid.sat, 0) << "incorrect value for last_msg_.states[69].mesid.sat, expected 0, is " << last_msg_.states[69].mesid.sat; - EXPECT_EQ(last_msg_.states[70].cn0, 0) << "incorrect value for last_msg_.states[70].cn0, expected 0, is " << last_msg_.states[70].cn0; - EXPECT_EQ(last_msg_.states[70].mesid.code, 0) << "incorrect value for last_msg_.states[70].mesid.code, expected 0, is " << last_msg_.states[70].mesid.code; - EXPECT_EQ(last_msg_.states[70].mesid.sat, 0) << "incorrect value for last_msg_.states[70].mesid.sat, expected 0, is " << last_msg_.states[70].mesid.sat; - EXPECT_EQ(last_msg_.states[71].cn0, 0) << "incorrect value for last_msg_.states[71].cn0, expected 0, is " << last_msg_.states[71].cn0; - EXPECT_EQ(last_msg_.states[71].mesid.code, 0) << "incorrect value for last_msg_.states[71].mesid.code, expected 0, is " << last_msg_.states[71].mesid.code; - EXPECT_EQ(last_msg_.states[71].mesid.sat, 0) << "incorrect value for last_msg_.states[71].mesid.sat, expected 0, is " << last_msg_.states[71].mesid.sat; - EXPECT_EQ(last_msg_.states[72].cn0, 218) << "incorrect value for last_msg_.states[72].cn0, expected 218, is " << last_msg_.states[72].cn0; - EXPECT_EQ(last_msg_.states[72].mesid.code, 20) << "incorrect value for last_msg_.states[72].mesid.code, expected 20, is " << last_msg_.states[72].mesid.code; - EXPECT_EQ(last_msg_.states[72].mesid.sat, 9) << "incorrect value for last_msg_.states[72].mesid.sat, expected 9, is " << last_msg_.states[72].mesid.sat; - EXPECT_EQ(last_msg_.states[73].cn0, 176) << "incorrect value for last_msg_.states[73].cn0, expected 176, is " << last_msg_.states[73].cn0; - EXPECT_EQ(last_msg_.states[73].mesid.code, 20) << "incorrect value for last_msg_.states[73].mesid.code, expected 20, is " << last_msg_.states[73].mesid.code; - EXPECT_EQ(last_msg_.states[73].mesid.sat, 5) << "incorrect value for last_msg_.states[73].mesid.sat, expected 5, is " << last_msg_.states[73].mesid.sat; - EXPECT_EQ(last_msg_.states[74].cn0, 217) << "incorrect value for last_msg_.states[74].cn0, expected 217, is " << last_msg_.states[74].cn0; - EXPECT_EQ(last_msg_.states[74].mesid.code, 20) << "incorrect value for last_msg_.states[74].mesid.code, expected 20, is " << last_msg_.states[74].mesid.code; - EXPECT_EQ(last_msg_.states[74].mesid.sat, 36) << "incorrect value for last_msg_.states[74].mesid.sat, expected 36, is " << last_msg_.states[74].mesid.sat; - EXPECT_EQ(last_msg_.states[75].cn0, 200) << "incorrect value for last_msg_.states[75].cn0, expected 200, is " << last_msg_.states[75].cn0; - EXPECT_EQ(last_msg_.states[75].mesid.code, 20) << "incorrect value for last_msg_.states[75].mesid.code, expected 20, is " << last_msg_.states[75].mesid.code; - EXPECT_EQ(last_msg_.states[75].mesid.sat, 11) << "incorrect value for last_msg_.states[75].mesid.sat, expected 11, is " << last_msg_.states[75].mesid.sat; - EXPECT_EQ(last_msg_.states[76].cn0, 205) << "incorrect value for last_msg_.states[76].cn0, expected 205, is " << last_msg_.states[76].cn0; - EXPECT_EQ(last_msg_.states[76].mesid.code, 20) << "incorrect value for last_msg_.states[76].mesid.code, expected 20, is " << last_msg_.states[76].mesid.code; - EXPECT_EQ(last_msg_.states[76].mesid.sat, 4) << "incorrect value for last_msg_.states[76].mesid.sat, expected 4, is " << last_msg_.states[76].mesid.sat; - EXPECT_EQ(last_msg_.states[77].cn0, 0) << "incorrect value for last_msg_.states[77].cn0, expected 0, is " << last_msg_.states[77].cn0; - EXPECT_EQ(last_msg_.states[77].mesid.code, 0) << "incorrect value for last_msg_.states[77].mesid.code, expected 0, is " << last_msg_.states[77].mesid.code; - EXPECT_EQ(last_msg_.states[77].mesid.sat, 0) << "incorrect value for last_msg_.states[77].mesid.sat, expected 0, is " << last_msg_.states[77].mesid.sat; - EXPECT_EQ(last_msg_.states[78].cn0, 0) << "incorrect value for last_msg_.states[78].cn0, expected 0, is " << last_msg_.states[78].cn0; - EXPECT_EQ(last_msg_.states[78].mesid.code, 0) << "incorrect value for last_msg_.states[78].mesid.code, expected 0, is " << last_msg_.states[78].mesid.code; - EXPECT_EQ(last_msg_.states[78].mesid.sat, 0) << "incorrect value for last_msg_.states[78].mesid.sat, expected 0, is " << last_msg_.states[78].mesid.sat; +}; + +TEST_F(Test_auto_check_sbp_tracking_MsgMeasurementState0, Test) { + uint8_t encoded_frame[] = { + 85, 97, 0, 207, 121, 237, 29, 0, 162, 0, 0, 0, 0, 0, 0, + 27, 0, 201, 20, 0, 168, 32, 0, 184, 15, 0, 187, 0, 0, 0, + 18, 0, 210, 16, 0, 167, 0, 0, 0, 23, 0, 213, 10, 0, 223, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 2, 202, + 27, 1, 192, 15, 1, 165, 29, 1, 146, 32, 1, 170, 18, 1, 201, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 1, 212, 10, 1, 205, + 0, 0, 0, 96, 3, 230, 0, 0, 0, 101, 3, 214, 103, 3, 212, + 104, 3, 209, 106, 3, 157, 102, 3, 230, 0, 0, 0, 0, 0, 0, + 101, 4, 189, 96, 4, 207, 106, 4, 164, 104, 4, 193, 0, 0, 0, + 102, 4, 208, 0, 0, 0, 27, 12, 212, 29, 12, 161, 32, 12, 216, + 30, 12, 216, 20, 12, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 36, 14, 203, 0, 0, 0, 5, 14, 158, 4, 14, 194, 11, 14, 192, + 9, 14, 207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 20, 218, + 5, 20, 176, 36, 20, 217, 11, 20, 200, 4, 20, 205, 0, 0, 0, + 0, 0, 0, 35, 54, + }; + + sbp_msg_measurement_state_t test_msg{}; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_states.value = 79; + + test_msg.states[0].cn0 = 162; + test_msg.states[0].mesid.code = 0; + test_msg.states[0].mesid.sat = 29; + + test_msg.states[1].cn0 = 0; + test_msg.states[1].mesid.code = 0; + test_msg.states[1].mesid.sat = 0; + + test_msg.states[2].cn0 = 0; + test_msg.states[2].mesid.code = 0; + test_msg.states[2].mesid.sat = 0; + + test_msg.states[3].cn0 = 201; + test_msg.states[3].mesid.code = 0; + test_msg.states[3].mesid.sat = 27; + + test_msg.states[4].cn0 = 168; + test_msg.states[4].mesid.code = 0; + test_msg.states[4].mesid.sat = 20; + + test_msg.states[5].cn0 = 184; + test_msg.states[5].mesid.code = 0; + test_msg.states[5].mesid.sat = 32; + + test_msg.states[6].cn0 = 187; + test_msg.states[6].mesid.code = 0; + test_msg.states[6].mesid.sat = 15; + + test_msg.states[7].cn0 = 0; + test_msg.states[7].mesid.code = 0; + test_msg.states[7].mesid.sat = 0; + + test_msg.states[8].cn0 = 210; + test_msg.states[8].mesid.code = 0; + test_msg.states[8].mesid.sat = 18; + + test_msg.states[9].cn0 = 167; + test_msg.states[9].mesid.code = 0; + test_msg.states[9].mesid.sat = 16; + + test_msg.states[10].cn0 = 0; + test_msg.states[10].mesid.code = 0; + test_msg.states[10].mesid.sat = 0; + + test_msg.states[11].cn0 = 213; + test_msg.states[11].mesid.code = 0; + test_msg.states[11].mesid.sat = 23; + + test_msg.states[12].cn0 = 223; + test_msg.states[12].mesid.code = 0; + test_msg.states[12].mesid.sat = 10; + + test_msg.states[13].cn0 = 0; + test_msg.states[13].mesid.code = 0; + test_msg.states[13].mesid.sat = 0; + + test_msg.states[14].cn0 = 0; + test_msg.states[14].mesid.code = 0; + test_msg.states[14].mesid.sat = 0; + + test_msg.states[15].cn0 = 0; + test_msg.states[15].mesid.code = 0; + test_msg.states[15].mesid.sat = 0; + + test_msg.states[16].cn0 = 0; + test_msg.states[16].mesid.code = 0; + test_msg.states[16].mesid.sat = 0; + + test_msg.states[17].cn0 = 202; + test_msg.states[17].mesid.code = 2; + test_msg.states[17].mesid.sat = 131; + + test_msg.states[18].cn0 = 192; + test_msg.states[18].mesid.code = 1; + test_msg.states[18].mesid.sat = 27; + + test_msg.states[19].cn0 = 165; + test_msg.states[19].mesid.code = 1; + test_msg.states[19].mesid.sat = 15; + + test_msg.states[20].cn0 = 146; + test_msg.states[20].mesid.code = 1; + test_msg.states[20].mesid.sat = 29; + + test_msg.states[21].cn0 = 170; + test_msg.states[21].mesid.code = 1; + test_msg.states[21].mesid.sat = 32; + + test_msg.states[22].cn0 = 201; + test_msg.states[22].mesid.code = 1; + test_msg.states[22].mesid.sat = 18; + + test_msg.states[23].cn0 = 0; + test_msg.states[23].mesid.code = 0; + test_msg.states[23].mesid.sat = 0; + + test_msg.states[24].cn0 = 0; + test_msg.states[24].mesid.code = 0; + test_msg.states[24].mesid.sat = 0; + + test_msg.states[25].cn0 = 0; + test_msg.states[25].mesid.code = 0; + test_msg.states[25].mesid.sat = 0; + + test_msg.states[26].cn0 = 212; + test_msg.states[26].mesid.code = 1; + test_msg.states[26].mesid.sat = 23; + + test_msg.states[27].cn0 = 205; + test_msg.states[27].mesid.code = 1; + test_msg.states[27].mesid.sat = 10; + + test_msg.states[28].cn0 = 0; + test_msg.states[28].mesid.code = 0; + test_msg.states[28].mesid.sat = 0; + + test_msg.states[29].cn0 = 230; + test_msg.states[29].mesid.code = 3; + test_msg.states[29].mesid.sat = 96; + + test_msg.states[30].cn0 = 0; + test_msg.states[30].mesid.code = 0; + test_msg.states[30].mesid.sat = 0; + + test_msg.states[31].cn0 = 214; + test_msg.states[31].mesid.code = 3; + test_msg.states[31].mesid.sat = 101; + + test_msg.states[32].cn0 = 212; + test_msg.states[32].mesid.code = 3; + test_msg.states[32].mesid.sat = 103; + + test_msg.states[33].cn0 = 209; + test_msg.states[33].mesid.code = 3; + test_msg.states[33].mesid.sat = 104; + + test_msg.states[34].cn0 = 157; + test_msg.states[34].mesid.code = 3; + test_msg.states[34].mesid.sat = 106; + + test_msg.states[35].cn0 = 230; + test_msg.states[35].mesid.code = 3; + test_msg.states[35].mesid.sat = 102; + + test_msg.states[36].cn0 = 0; + test_msg.states[36].mesid.code = 0; + test_msg.states[36].mesid.sat = 0; + + test_msg.states[37].cn0 = 0; + test_msg.states[37].mesid.code = 0; + test_msg.states[37].mesid.sat = 0; + + test_msg.states[38].cn0 = 189; + test_msg.states[38].mesid.code = 4; + test_msg.states[38].mesid.sat = 101; + + test_msg.states[39].cn0 = 207; + test_msg.states[39].mesid.code = 4; + test_msg.states[39].mesid.sat = 96; + + test_msg.states[40].cn0 = 164; + test_msg.states[40].mesid.code = 4; + test_msg.states[40].mesid.sat = 106; + + test_msg.states[41].cn0 = 193; + test_msg.states[41].mesid.code = 4; + test_msg.states[41].mesid.sat = 104; + + test_msg.states[42].cn0 = 0; + test_msg.states[42].mesid.code = 0; + test_msg.states[42].mesid.sat = 0; + + test_msg.states[43].cn0 = 208; + test_msg.states[43].mesid.code = 4; + test_msg.states[43].mesid.sat = 102; + + test_msg.states[44].cn0 = 0; + test_msg.states[44].mesid.code = 0; + test_msg.states[44].mesid.sat = 0; + + test_msg.states[45].cn0 = 212; + test_msg.states[45].mesid.code = 12; + test_msg.states[45].mesid.sat = 27; + + test_msg.states[46].cn0 = 161; + test_msg.states[46].mesid.code = 12; + test_msg.states[46].mesid.sat = 29; + + test_msg.states[47].cn0 = 216; + test_msg.states[47].mesid.code = 12; + test_msg.states[47].mesid.sat = 32; + + test_msg.states[48].cn0 = 216; + test_msg.states[48].mesid.code = 12; + test_msg.states[48].mesid.sat = 30; + + test_msg.states[49].cn0 = 178; + test_msg.states[49].mesid.code = 12; + test_msg.states[49].mesid.sat = 20; + + test_msg.states[50].cn0 = 0; + test_msg.states[50].mesid.code = 0; + test_msg.states[50].mesid.sat = 0; + + test_msg.states[51].cn0 = 0; + test_msg.states[51].mesid.code = 0; + test_msg.states[51].mesid.sat = 0; + + test_msg.states[52].cn0 = 0; + test_msg.states[52].mesid.code = 0; + test_msg.states[52].mesid.sat = 0; + + test_msg.states[53].cn0 = 0; + test_msg.states[53].mesid.code = 0; + test_msg.states[53].mesid.sat = 0; + + test_msg.states[54].cn0 = 0; + test_msg.states[54].mesid.code = 0; + test_msg.states[54].mesid.sat = 0; + + test_msg.states[55].cn0 = 0; + test_msg.states[55].mesid.code = 0; + test_msg.states[55].mesid.sat = 0; + + test_msg.states[56].cn0 = 0; + test_msg.states[56].mesid.code = 0; + test_msg.states[56].mesid.sat = 0; + + test_msg.states[57].cn0 = 0; + test_msg.states[57].mesid.code = 0; + test_msg.states[57].mesid.sat = 0; + + test_msg.states[58].cn0 = 0; + test_msg.states[58].mesid.code = 0; + test_msg.states[58].mesid.sat = 0; + + test_msg.states[59].cn0 = 0; + test_msg.states[59].mesid.code = 0; + test_msg.states[59].mesid.sat = 0; + + test_msg.states[60].cn0 = 0; + test_msg.states[60].mesid.code = 0; + test_msg.states[60].mesid.sat = 0; + + test_msg.states[61].cn0 = 0; + test_msg.states[61].mesid.code = 0; + test_msg.states[61].mesid.sat = 0; + + test_msg.states[62].cn0 = 0; + test_msg.states[62].mesid.code = 0; + test_msg.states[62].mesid.sat = 0; + + test_msg.states[63].cn0 = 203; + test_msg.states[63].mesid.code = 14; + test_msg.states[63].mesid.sat = 36; + + test_msg.states[64].cn0 = 0; + test_msg.states[64].mesid.code = 0; + test_msg.states[64].mesid.sat = 0; + + test_msg.states[65].cn0 = 158; + test_msg.states[65].mesid.code = 14; + test_msg.states[65].mesid.sat = 5; + + test_msg.states[66].cn0 = 194; + test_msg.states[66].mesid.code = 14; + test_msg.states[66].mesid.sat = 4; + + test_msg.states[67].cn0 = 192; + test_msg.states[67].mesid.code = 14; + test_msg.states[67].mesid.sat = 11; + + test_msg.states[68].cn0 = 207; + test_msg.states[68].mesid.code = 14; + test_msg.states[68].mesid.sat = 9; + + test_msg.states[69].cn0 = 0; + test_msg.states[69].mesid.code = 0; + test_msg.states[69].mesid.sat = 0; + + test_msg.states[70].cn0 = 0; + test_msg.states[70].mesid.code = 0; + test_msg.states[70].mesid.sat = 0; + + test_msg.states[71].cn0 = 0; + test_msg.states[71].mesid.code = 0; + test_msg.states[71].mesid.sat = 0; + + test_msg.states[72].cn0 = 218; + test_msg.states[72].mesid.code = 20; + test_msg.states[72].mesid.sat = 9; + + test_msg.states[73].cn0 = 176; + test_msg.states[73].mesid.code = 20; + test_msg.states[73].mesid.sat = 5; + + test_msg.states[74].cn0 = 217; + test_msg.states[74].mesid.code = 20; + test_msg.states[74].mesid.sat = 36; + + test_msg.states[75].cn0 = 200; + test_msg.states[75].mesid.code = 20; + test_msg.states[75].mesid.sat = 11; + + test_msg.states[76].cn0 = 205; + test_msg.states[76].mesid.code = 20; + test_msg.states[76].mesid.sat = 4; + + test_msg.states[77].cn0 = 0; + test_msg.states[77].mesid.code = 0; + test_msg.states[77].mesid.sat = 0; + + test_msg.states[78].cn0 = 0; + test_msg.states[78].mesid.code = 0; + test_msg.states[78].mesid.sat = 0; + + EXPECT_EQ(send_message(31183, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 31183); + EXPECT_EQ(last_msg_, test_msg); + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_states.value, 79) + << "incorrect value for last_msg_.n_states.value, expected 79, is " + << last_msg_.n_states.value; + EXPECT_EQ(last_msg_.states[0].cn0, 162) + << "incorrect value for last_msg_.states[0].cn0, expected 162, is " + << last_msg_.states[0].cn0; + EXPECT_EQ(last_msg_.states[0].mesid.code, 0) + << "incorrect value for last_msg_.states[0].mesid.code, expected 0, is " + << last_msg_.states[0].mesid.code; + EXPECT_EQ(last_msg_.states[0].mesid.sat, 29) + << "incorrect value for last_msg_.states[0].mesid.sat, expected 29, is " + << last_msg_.states[0].mesid.sat; + EXPECT_EQ(last_msg_.states[1].cn0, 0) + << "incorrect value for last_msg_.states[1].cn0, expected 0, is " + << last_msg_.states[1].cn0; + EXPECT_EQ(last_msg_.states[1].mesid.code, 0) + << "incorrect value for last_msg_.states[1].mesid.code, expected 0, is " + << last_msg_.states[1].mesid.code; + EXPECT_EQ(last_msg_.states[1].mesid.sat, 0) + << "incorrect value for last_msg_.states[1].mesid.sat, expected 0, is " + << last_msg_.states[1].mesid.sat; + EXPECT_EQ(last_msg_.states[2].cn0, 0) + << "incorrect value for last_msg_.states[2].cn0, expected 0, is " + << last_msg_.states[2].cn0; + EXPECT_EQ(last_msg_.states[2].mesid.code, 0) + << "incorrect value for last_msg_.states[2].mesid.code, expected 0, is " + << last_msg_.states[2].mesid.code; + EXPECT_EQ(last_msg_.states[2].mesid.sat, 0) + << "incorrect value for last_msg_.states[2].mesid.sat, expected 0, is " + << last_msg_.states[2].mesid.sat; + EXPECT_EQ(last_msg_.states[3].cn0, 201) + << "incorrect value for last_msg_.states[3].cn0, expected 201, is " + << last_msg_.states[3].cn0; + EXPECT_EQ(last_msg_.states[3].mesid.code, 0) + << "incorrect value for last_msg_.states[3].mesid.code, expected 0, is " + << last_msg_.states[3].mesid.code; + EXPECT_EQ(last_msg_.states[3].mesid.sat, 27) + << "incorrect value for last_msg_.states[3].mesid.sat, expected 27, is " + << last_msg_.states[3].mesid.sat; + EXPECT_EQ(last_msg_.states[4].cn0, 168) + << "incorrect value for last_msg_.states[4].cn0, expected 168, is " + << last_msg_.states[4].cn0; + EXPECT_EQ(last_msg_.states[4].mesid.code, 0) + << "incorrect value for last_msg_.states[4].mesid.code, expected 0, is " + << last_msg_.states[4].mesid.code; + EXPECT_EQ(last_msg_.states[4].mesid.sat, 20) + << "incorrect value for last_msg_.states[4].mesid.sat, expected 20, is " + << last_msg_.states[4].mesid.sat; + EXPECT_EQ(last_msg_.states[5].cn0, 184) + << "incorrect value for last_msg_.states[5].cn0, expected 184, is " + << last_msg_.states[5].cn0; + EXPECT_EQ(last_msg_.states[5].mesid.code, 0) + << "incorrect value for last_msg_.states[5].mesid.code, expected 0, is " + << last_msg_.states[5].mesid.code; + EXPECT_EQ(last_msg_.states[5].mesid.sat, 32) + << "incorrect value for last_msg_.states[5].mesid.sat, expected 32, is " + << last_msg_.states[5].mesid.sat; + EXPECT_EQ(last_msg_.states[6].cn0, 187) + << "incorrect value for last_msg_.states[6].cn0, expected 187, is " + << last_msg_.states[6].cn0; + EXPECT_EQ(last_msg_.states[6].mesid.code, 0) + << "incorrect value for last_msg_.states[6].mesid.code, expected 0, is " + << last_msg_.states[6].mesid.code; + EXPECT_EQ(last_msg_.states[6].mesid.sat, 15) + << "incorrect value for last_msg_.states[6].mesid.sat, expected 15, is " + << last_msg_.states[6].mesid.sat; + EXPECT_EQ(last_msg_.states[7].cn0, 0) + << "incorrect value for last_msg_.states[7].cn0, expected 0, is " + << last_msg_.states[7].cn0; + EXPECT_EQ(last_msg_.states[7].mesid.code, 0) + << "incorrect value for last_msg_.states[7].mesid.code, expected 0, is " + << last_msg_.states[7].mesid.code; + EXPECT_EQ(last_msg_.states[7].mesid.sat, 0) + << "incorrect value for last_msg_.states[7].mesid.sat, expected 0, is " + << last_msg_.states[7].mesid.sat; + EXPECT_EQ(last_msg_.states[8].cn0, 210) + << "incorrect value for last_msg_.states[8].cn0, expected 210, is " + << last_msg_.states[8].cn0; + EXPECT_EQ(last_msg_.states[8].mesid.code, 0) + << "incorrect value for last_msg_.states[8].mesid.code, expected 0, is " + << last_msg_.states[8].mesid.code; + EXPECT_EQ(last_msg_.states[8].mesid.sat, 18) + << "incorrect value for last_msg_.states[8].mesid.sat, expected 18, is " + << last_msg_.states[8].mesid.sat; + EXPECT_EQ(last_msg_.states[9].cn0, 167) + << "incorrect value for last_msg_.states[9].cn0, expected 167, is " + << last_msg_.states[9].cn0; + EXPECT_EQ(last_msg_.states[9].mesid.code, 0) + << "incorrect value for last_msg_.states[9].mesid.code, expected 0, is " + << last_msg_.states[9].mesid.code; + EXPECT_EQ(last_msg_.states[9].mesid.sat, 16) + << "incorrect value for last_msg_.states[9].mesid.sat, expected 16, is " + << last_msg_.states[9].mesid.sat; + EXPECT_EQ(last_msg_.states[10].cn0, 0) + << "incorrect value for last_msg_.states[10].cn0, expected 0, is " + << last_msg_.states[10].cn0; + EXPECT_EQ(last_msg_.states[10].mesid.code, 0) + << "incorrect value for last_msg_.states[10].mesid.code, expected 0, is " + << last_msg_.states[10].mesid.code; + EXPECT_EQ(last_msg_.states[10].mesid.sat, 0) + << "incorrect value for last_msg_.states[10].mesid.sat, expected 0, is " + << last_msg_.states[10].mesid.sat; + EXPECT_EQ(last_msg_.states[11].cn0, 213) + << "incorrect value for last_msg_.states[11].cn0, expected 213, is " + << last_msg_.states[11].cn0; + EXPECT_EQ(last_msg_.states[11].mesid.code, 0) + << "incorrect value for last_msg_.states[11].mesid.code, expected 0, is " + << last_msg_.states[11].mesid.code; + EXPECT_EQ(last_msg_.states[11].mesid.sat, 23) + << "incorrect value for last_msg_.states[11].mesid.sat, expected 23, is " + << last_msg_.states[11].mesid.sat; + EXPECT_EQ(last_msg_.states[12].cn0, 223) + << "incorrect value for last_msg_.states[12].cn0, expected 223, is " + << last_msg_.states[12].cn0; + EXPECT_EQ(last_msg_.states[12].mesid.code, 0) + << "incorrect value for last_msg_.states[12].mesid.code, expected 0, is " + << last_msg_.states[12].mesid.code; + EXPECT_EQ(last_msg_.states[12].mesid.sat, 10) + << "incorrect value for last_msg_.states[12].mesid.sat, expected 10, is " + << last_msg_.states[12].mesid.sat; + EXPECT_EQ(last_msg_.states[13].cn0, 0) + << "incorrect value for last_msg_.states[13].cn0, expected 0, is " + << last_msg_.states[13].cn0; + EXPECT_EQ(last_msg_.states[13].mesid.code, 0) + << "incorrect value for last_msg_.states[13].mesid.code, expected 0, is " + << last_msg_.states[13].mesid.code; + EXPECT_EQ(last_msg_.states[13].mesid.sat, 0) + << "incorrect value for last_msg_.states[13].mesid.sat, expected 0, is " + << last_msg_.states[13].mesid.sat; + EXPECT_EQ(last_msg_.states[14].cn0, 0) + << "incorrect value for last_msg_.states[14].cn0, expected 0, is " + << last_msg_.states[14].cn0; + EXPECT_EQ(last_msg_.states[14].mesid.code, 0) + << "incorrect value for last_msg_.states[14].mesid.code, expected 0, is " + << last_msg_.states[14].mesid.code; + EXPECT_EQ(last_msg_.states[14].mesid.sat, 0) + << "incorrect value for last_msg_.states[14].mesid.sat, expected 0, is " + << last_msg_.states[14].mesid.sat; + EXPECT_EQ(last_msg_.states[15].cn0, 0) + << "incorrect value for last_msg_.states[15].cn0, expected 0, is " + << last_msg_.states[15].cn0; + EXPECT_EQ(last_msg_.states[15].mesid.code, 0) + << "incorrect value for last_msg_.states[15].mesid.code, expected 0, is " + << last_msg_.states[15].mesid.code; + EXPECT_EQ(last_msg_.states[15].mesid.sat, 0) + << "incorrect value for last_msg_.states[15].mesid.sat, expected 0, is " + << last_msg_.states[15].mesid.sat; + EXPECT_EQ(last_msg_.states[16].cn0, 0) + << "incorrect value for last_msg_.states[16].cn0, expected 0, is " + << last_msg_.states[16].cn0; + EXPECT_EQ(last_msg_.states[16].mesid.code, 0) + << "incorrect value for last_msg_.states[16].mesid.code, expected 0, is " + << last_msg_.states[16].mesid.code; + EXPECT_EQ(last_msg_.states[16].mesid.sat, 0) + << "incorrect value for last_msg_.states[16].mesid.sat, expected 0, is " + << last_msg_.states[16].mesid.sat; + EXPECT_EQ(last_msg_.states[17].cn0, 202) + << "incorrect value for last_msg_.states[17].cn0, expected 202, is " + << last_msg_.states[17].cn0; + EXPECT_EQ(last_msg_.states[17].mesid.code, 2) + << "incorrect value for last_msg_.states[17].mesid.code, expected 2, is " + << last_msg_.states[17].mesid.code; + EXPECT_EQ(last_msg_.states[17].mesid.sat, 131) + << "incorrect value for last_msg_.states[17].mesid.sat, expected 131, is " + << last_msg_.states[17].mesid.sat; + EXPECT_EQ(last_msg_.states[18].cn0, 192) + << "incorrect value for last_msg_.states[18].cn0, expected 192, is " + << last_msg_.states[18].cn0; + EXPECT_EQ(last_msg_.states[18].mesid.code, 1) + << "incorrect value for last_msg_.states[18].mesid.code, expected 1, is " + << last_msg_.states[18].mesid.code; + EXPECT_EQ(last_msg_.states[18].mesid.sat, 27) + << "incorrect value for last_msg_.states[18].mesid.sat, expected 27, is " + << last_msg_.states[18].mesid.sat; + EXPECT_EQ(last_msg_.states[19].cn0, 165) + << "incorrect value for last_msg_.states[19].cn0, expected 165, is " + << last_msg_.states[19].cn0; + EXPECT_EQ(last_msg_.states[19].mesid.code, 1) + << "incorrect value for last_msg_.states[19].mesid.code, expected 1, is " + << last_msg_.states[19].mesid.code; + EXPECT_EQ(last_msg_.states[19].mesid.sat, 15) + << "incorrect value for last_msg_.states[19].mesid.sat, expected 15, is " + << last_msg_.states[19].mesid.sat; + EXPECT_EQ(last_msg_.states[20].cn0, 146) + << "incorrect value for last_msg_.states[20].cn0, expected 146, is " + << last_msg_.states[20].cn0; + EXPECT_EQ(last_msg_.states[20].mesid.code, 1) + << "incorrect value for last_msg_.states[20].mesid.code, expected 1, is " + << last_msg_.states[20].mesid.code; + EXPECT_EQ(last_msg_.states[20].mesid.sat, 29) + << "incorrect value for last_msg_.states[20].mesid.sat, expected 29, is " + << last_msg_.states[20].mesid.sat; + EXPECT_EQ(last_msg_.states[21].cn0, 170) + << "incorrect value for last_msg_.states[21].cn0, expected 170, is " + << last_msg_.states[21].cn0; + EXPECT_EQ(last_msg_.states[21].mesid.code, 1) + << "incorrect value for last_msg_.states[21].mesid.code, expected 1, is " + << last_msg_.states[21].mesid.code; + EXPECT_EQ(last_msg_.states[21].mesid.sat, 32) + << "incorrect value for last_msg_.states[21].mesid.sat, expected 32, is " + << last_msg_.states[21].mesid.sat; + EXPECT_EQ(last_msg_.states[22].cn0, 201) + << "incorrect value for last_msg_.states[22].cn0, expected 201, is " + << last_msg_.states[22].cn0; + EXPECT_EQ(last_msg_.states[22].mesid.code, 1) + << "incorrect value for last_msg_.states[22].mesid.code, expected 1, is " + << last_msg_.states[22].mesid.code; + EXPECT_EQ(last_msg_.states[22].mesid.sat, 18) + << "incorrect value for last_msg_.states[22].mesid.sat, expected 18, is " + << last_msg_.states[22].mesid.sat; + EXPECT_EQ(last_msg_.states[23].cn0, 0) + << "incorrect value for last_msg_.states[23].cn0, expected 0, is " + << last_msg_.states[23].cn0; + EXPECT_EQ(last_msg_.states[23].mesid.code, 0) + << "incorrect value for last_msg_.states[23].mesid.code, expected 0, is " + << last_msg_.states[23].mesid.code; + EXPECT_EQ(last_msg_.states[23].mesid.sat, 0) + << "incorrect value for last_msg_.states[23].mesid.sat, expected 0, is " + << last_msg_.states[23].mesid.sat; + EXPECT_EQ(last_msg_.states[24].cn0, 0) + << "incorrect value for last_msg_.states[24].cn0, expected 0, is " + << last_msg_.states[24].cn0; + EXPECT_EQ(last_msg_.states[24].mesid.code, 0) + << "incorrect value for last_msg_.states[24].mesid.code, expected 0, is " + << last_msg_.states[24].mesid.code; + EXPECT_EQ(last_msg_.states[24].mesid.sat, 0) + << "incorrect value for last_msg_.states[24].mesid.sat, expected 0, is " + << last_msg_.states[24].mesid.sat; + EXPECT_EQ(last_msg_.states[25].cn0, 0) + << "incorrect value for last_msg_.states[25].cn0, expected 0, is " + << last_msg_.states[25].cn0; + EXPECT_EQ(last_msg_.states[25].mesid.code, 0) + << "incorrect value for last_msg_.states[25].mesid.code, expected 0, is " + << last_msg_.states[25].mesid.code; + EXPECT_EQ(last_msg_.states[25].mesid.sat, 0) + << "incorrect value for last_msg_.states[25].mesid.sat, expected 0, is " + << last_msg_.states[25].mesid.sat; + EXPECT_EQ(last_msg_.states[26].cn0, 212) + << "incorrect value for last_msg_.states[26].cn0, expected 212, is " + << last_msg_.states[26].cn0; + EXPECT_EQ(last_msg_.states[26].mesid.code, 1) + << "incorrect value for last_msg_.states[26].mesid.code, expected 1, is " + << last_msg_.states[26].mesid.code; + EXPECT_EQ(last_msg_.states[26].mesid.sat, 23) + << "incorrect value for last_msg_.states[26].mesid.sat, expected 23, is " + << last_msg_.states[26].mesid.sat; + EXPECT_EQ(last_msg_.states[27].cn0, 205) + << "incorrect value for last_msg_.states[27].cn0, expected 205, is " + << last_msg_.states[27].cn0; + EXPECT_EQ(last_msg_.states[27].mesid.code, 1) + << "incorrect value for last_msg_.states[27].mesid.code, expected 1, is " + << last_msg_.states[27].mesid.code; + EXPECT_EQ(last_msg_.states[27].mesid.sat, 10) + << "incorrect value for last_msg_.states[27].mesid.sat, expected 10, is " + << last_msg_.states[27].mesid.sat; + EXPECT_EQ(last_msg_.states[28].cn0, 0) + << "incorrect value for last_msg_.states[28].cn0, expected 0, is " + << last_msg_.states[28].cn0; + EXPECT_EQ(last_msg_.states[28].mesid.code, 0) + << "incorrect value for last_msg_.states[28].mesid.code, expected 0, is " + << last_msg_.states[28].mesid.code; + EXPECT_EQ(last_msg_.states[28].mesid.sat, 0) + << "incorrect value for last_msg_.states[28].mesid.sat, expected 0, is " + << last_msg_.states[28].mesid.sat; + EXPECT_EQ(last_msg_.states[29].cn0, 230) + << "incorrect value for last_msg_.states[29].cn0, expected 230, is " + << last_msg_.states[29].cn0; + EXPECT_EQ(last_msg_.states[29].mesid.code, 3) + << "incorrect value for last_msg_.states[29].mesid.code, expected 3, is " + << last_msg_.states[29].mesid.code; + EXPECT_EQ(last_msg_.states[29].mesid.sat, 96) + << "incorrect value for last_msg_.states[29].mesid.sat, expected 96, is " + << last_msg_.states[29].mesid.sat; + EXPECT_EQ(last_msg_.states[30].cn0, 0) + << "incorrect value for last_msg_.states[30].cn0, expected 0, is " + << last_msg_.states[30].cn0; + EXPECT_EQ(last_msg_.states[30].mesid.code, 0) + << "incorrect value for last_msg_.states[30].mesid.code, expected 0, is " + << last_msg_.states[30].mesid.code; + EXPECT_EQ(last_msg_.states[30].mesid.sat, 0) + << "incorrect value for last_msg_.states[30].mesid.sat, expected 0, is " + << last_msg_.states[30].mesid.sat; + EXPECT_EQ(last_msg_.states[31].cn0, 214) + << "incorrect value for last_msg_.states[31].cn0, expected 214, is " + << last_msg_.states[31].cn0; + EXPECT_EQ(last_msg_.states[31].mesid.code, 3) + << "incorrect value for last_msg_.states[31].mesid.code, expected 3, is " + << last_msg_.states[31].mesid.code; + EXPECT_EQ(last_msg_.states[31].mesid.sat, 101) + << "incorrect value for last_msg_.states[31].mesid.sat, expected 101, is " + << last_msg_.states[31].mesid.sat; + EXPECT_EQ(last_msg_.states[32].cn0, 212) + << "incorrect value for last_msg_.states[32].cn0, expected 212, is " + << last_msg_.states[32].cn0; + EXPECT_EQ(last_msg_.states[32].mesid.code, 3) + << "incorrect value for last_msg_.states[32].mesid.code, expected 3, is " + << last_msg_.states[32].mesid.code; + EXPECT_EQ(last_msg_.states[32].mesid.sat, 103) + << "incorrect value for last_msg_.states[32].mesid.sat, expected 103, is " + << last_msg_.states[32].mesid.sat; + EXPECT_EQ(last_msg_.states[33].cn0, 209) + << "incorrect value for last_msg_.states[33].cn0, expected 209, is " + << last_msg_.states[33].cn0; + EXPECT_EQ(last_msg_.states[33].mesid.code, 3) + << "incorrect value for last_msg_.states[33].mesid.code, expected 3, is " + << last_msg_.states[33].mesid.code; + EXPECT_EQ(last_msg_.states[33].mesid.sat, 104) + << "incorrect value for last_msg_.states[33].mesid.sat, expected 104, is " + << last_msg_.states[33].mesid.sat; + EXPECT_EQ(last_msg_.states[34].cn0, 157) + << "incorrect value for last_msg_.states[34].cn0, expected 157, is " + << last_msg_.states[34].cn0; + EXPECT_EQ(last_msg_.states[34].mesid.code, 3) + << "incorrect value for last_msg_.states[34].mesid.code, expected 3, is " + << last_msg_.states[34].mesid.code; + EXPECT_EQ(last_msg_.states[34].mesid.sat, 106) + << "incorrect value for last_msg_.states[34].mesid.sat, expected 106, is " + << last_msg_.states[34].mesid.sat; + EXPECT_EQ(last_msg_.states[35].cn0, 230) + << "incorrect value for last_msg_.states[35].cn0, expected 230, is " + << last_msg_.states[35].cn0; + EXPECT_EQ(last_msg_.states[35].mesid.code, 3) + << "incorrect value for last_msg_.states[35].mesid.code, expected 3, is " + << last_msg_.states[35].mesid.code; + EXPECT_EQ(last_msg_.states[35].mesid.sat, 102) + << "incorrect value for last_msg_.states[35].mesid.sat, expected 102, is " + << last_msg_.states[35].mesid.sat; + EXPECT_EQ(last_msg_.states[36].cn0, 0) + << "incorrect value for last_msg_.states[36].cn0, expected 0, is " + << last_msg_.states[36].cn0; + EXPECT_EQ(last_msg_.states[36].mesid.code, 0) + << "incorrect value for last_msg_.states[36].mesid.code, expected 0, is " + << last_msg_.states[36].mesid.code; + EXPECT_EQ(last_msg_.states[36].mesid.sat, 0) + << "incorrect value for last_msg_.states[36].mesid.sat, expected 0, is " + << last_msg_.states[36].mesid.sat; + EXPECT_EQ(last_msg_.states[37].cn0, 0) + << "incorrect value for last_msg_.states[37].cn0, expected 0, is " + << last_msg_.states[37].cn0; + EXPECT_EQ(last_msg_.states[37].mesid.code, 0) + << "incorrect value for last_msg_.states[37].mesid.code, expected 0, is " + << last_msg_.states[37].mesid.code; + EXPECT_EQ(last_msg_.states[37].mesid.sat, 0) + << "incorrect value for last_msg_.states[37].mesid.sat, expected 0, is " + << last_msg_.states[37].mesid.sat; + EXPECT_EQ(last_msg_.states[38].cn0, 189) + << "incorrect value for last_msg_.states[38].cn0, expected 189, is " + << last_msg_.states[38].cn0; + EXPECT_EQ(last_msg_.states[38].mesid.code, 4) + << "incorrect value for last_msg_.states[38].mesid.code, expected 4, is " + << last_msg_.states[38].mesid.code; + EXPECT_EQ(last_msg_.states[38].mesid.sat, 101) + << "incorrect value for last_msg_.states[38].mesid.sat, expected 101, is " + << last_msg_.states[38].mesid.sat; + EXPECT_EQ(last_msg_.states[39].cn0, 207) + << "incorrect value for last_msg_.states[39].cn0, expected 207, is " + << last_msg_.states[39].cn0; + EXPECT_EQ(last_msg_.states[39].mesid.code, 4) + << "incorrect value for last_msg_.states[39].mesid.code, expected 4, is " + << last_msg_.states[39].mesid.code; + EXPECT_EQ(last_msg_.states[39].mesid.sat, 96) + << "incorrect value for last_msg_.states[39].mesid.sat, expected 96, is " + << last_msg_.states[39].mesid.sat; + EXPECT_EQ(last_msg_.states[40].cn0, 164) + << "incorrect value for last_msg_.states[40].cn0, expected 164, is " + << last_msg_.states[40].cn0; + EXPECT_EQ(last_msg_.states[40].mesid.code, 4) + << "incorrect value for last_msg_.states[40].mesid.code, expected 4, is " + << last_msg_.states[40].mesid.code; + EXPECT_EQ(last_msg_.states[40].mesid.sat, 106) + << "incorrect value for last_msg_.states[40].mesid.sat, expected 106, is " + << last_msg_.states[40].mesid.sat; + EXPECT_EQ(last_msg_.states[41].cn0, 193) + << "incorrect value for last_msg_.states[41].cn0, expected 193, is " + << last_msg_.states[41].cn0; + EXPECT_EQ(last_msg_.states[41].mesid.code, 4) + << "incorrect value for last_msg_.states[41].mesid.code, expected 4, is " + << last_msg_.states[41].mesid.code; + EXPECT_EQ(last_msg_.states[41].mesid.sat, 104) + << "incorrect value for last_msg_.states[41].mesid.sat, expected 104, is " + << last_msg_.states[41].mesid.sat; + EXPECT_EQ(last_msg_.states[42].cn0, 0) + << "incorrect value for last_msg_.states[42].cn0, expected 0, is " + << last_msg_.states[42].cn0; + EXPECT_EQ(last_msg_.states[42].mesid.code, 0) + << "incorrect value for last_msg_.states[42].mesid.code, expected 0, is " + << last_msg_.states[42].mesid.code; + EXPECT_EQ(last_msg_.states[42].mesid.sat, 0) + << "incorrect value for last_msg_.states[42].mesid.sat, expected 0, is " + << last_msg_.states[42].mesid.sat; + EXPECT_EQ(last_msg_.states[43].cn0, 208) + << "incorrect value for last_msg_.states[43].cn0, expected 208, is " + << last_msg_.states[43].cn0; + EXPECT_EQ(last_msg_.states[43].mesid.code, 4) + << "incorrect value for last_msg_.states[43].mesid.code, expected 4, is " + << last_msg_.states[43].mesid.code; + EXPECT_EQ(last_msg_.states[43].mesid.sat, 102) + << "incorrect value for last_msg_.states[43].mesid.sat, expected 102, is " + << last_msg_.states[43].mesid.sat; + EXPECT_EQ(last_msg_.states[44].cn0, 0) + << "incorrect value for last_msg_.states[44].cn0, expected 0, is " + << last_msg_.states[44].cn0; + EXPECT_EQ(last_msg_.states[44].mesid.code, 0) + << "incorrect value for last_msg_.states[44].mesid.code, expected 0, is " + << last_msg_.states[44].mesid.code; + EXPECT_EQ(last_msg_.states[44].mesid.sat, 0) + << "incorrect value for last_msg_.states[44].mesid.sat, expected 0, is " + << last_msg_.states[44].mesid.sat; + EXPECT_EQ(last_msg_.states[45].cn0, 212) + << "incorrect value for last_msg_.states[45].cn0, expected 212, is " + << last_msg_.states[45].cn0; + EXPECT_EQ(last_msg_.states[45].mesid.code, 12) + << "incorrect value for last_msg_.states[45].mesid.code, expected 12, is " + << last_msg_.states[45].mesid.code; + EXPECT_EQ(last_msg_.states[45].mesid.sat, 27) + << "incorrect value for last_msg_.states[45].mesid.sat, expected 27, is " + << last_msg_.states[45].mesid.sat; + EXPECT_EQ(last_msg_.states[46].cn0, 161) + << "incorrect value for last_msg_.states[46].cn0, expected 161, is " + << last_msg_.states[46].cn0; + EXPECT_EQ(last_msg_.states[46].mesid.code, 12) + << "incorrect value for last_msg_.states[46].mesid.code, expected 12, is " + << last_msg_.states[46].mesid.code; + EXPECT_EQ(last_msg_.states[46].mesid.sat, 29) + << "incorrect value for last_msg_.states[46].mesid.sat, expected 29, is " + << last_msg_.states[46].mesid.sat; + EXPECT_EQ(last_msg_.states[47].cn0, 216) + << "incorrect value for last_msg_.states[47].cn0, expected 216, is " + << last_msg_.states[47].cn0; + EXPECT_EQ(last_msg_.states[47].mesid.code, 12) + << "incorrect value for last_msg_.states[47].mesid.code, expected 12, is " + << last_msg_.states[47].mesid.code; + EXPECT_EQ(last_msg_.states[47].mesid.sat, 32) + << "incorrect value for last_msg_.states[47].mesid.sat, expected 32, is " + << last_msg_.states[47].mesid.sat; + EXPECT_EQ(last_msg_.states[48].cn0, 216) + << "incorrect value for last_msg_.states[48].cn0, expected 216, is " + << last_msg_.states[48].cn0; + EXPECT_EQ(last_msg_.states[48].mesid.code, 12) + << "incorrect value for last_msg_.states[48].mesid.code, expected 12, is " + << last_msg_.states[48].mesid.code; + EXPECT_EQ(last_msg_.states[48].mesid.sat, 30) + << "incorrect value for last_msg_.states[48].mesid.sat, expected 30, is " + << last_msg_.states[48].mesid.sat; + EXPECT_EQ(last_msg_.states[49].cn0, 178) + << "incorrect value for last_msg_.states[49].cn0, expected 178, is " + << last_msg_.states[49].cn0; + EXPECT_EQ(last_msg_.states[49].mesid.code, 12) + << "incorrect value for last_msg_.states[49].mesid.code, expected 12, is " + << last_msg_.states[49].mesid.code; + EXPECT_EQ(last_msg_.states[49].mesid.sat, 20) + << "incorrect value for last_msg_.states[49].mesid.sat, expected 20, is " + << last_msg_.states[49].mesid.sat; + EXPECT_EQ(last_msg_.states[50].cn0, 0) + << "incorrect value for last_msg_.states[50].cn0, expected 0, is " + << last_msg_.states[50].cn0; + EXPECT_EQ(last_msg_.states[50].mesid.code, 0) + << "incorrect value for last_msg_.states[50].mesid.code, expected 0, is " + << last_msg_.states[50].mesid.code; + EXPECT_EQ(last_msg_.states[50].mesid.sat, 0) + << "incorrect value for last_msg_.states[50].mesid.sat, expected 0, is " + << last_msg_.states[50].mesid.sat; + EXPECT_EQ(last_msg_.states[51].cn0, 0) + << "incorrect value for last_msg_.states[51].cn0, expected 0, is " + << last_msg_.states[51].cn0; + EXPECT_EQ(last_msg_.states[51].mesid.code, 0) + << "incorrect value for last_msg_.states[51].mesid.code, expected 0, is " + << last_msg_.states[51].mesid.code; + EXPECT_EQ(last_msg_.states[51].mesid.sat, 0) + << "incorrect value for last_msg_.states[51].mesid.sat, expected 0, is " + << last_msg_.states[51].mesid.sat; + EXPECT_EQ(last_msg_.states[52].cn0, 0) + << "incorrect value for last_msg_.states[52].cn0, expected 0, is " + << last_msg_.states[52].cn0; + EXPECT_EQ(last_msg_.states[52].mesid.code, 0) + << "incorrect value for last_msg_.states[52].mesid.code, expected 0, is " + << last_msg_.states[52].mesid.code; + EXPECT_EQ(last_msg_.states[52].mesid.sat, 0) + << "incorrect value for last_msg_.states[52].mesid.sat, expected 0, is " + << last_msg_.states[52].mesid.sat; + EXPECT_EQ(last_msg_.states[53].cn0, 0) + << "incorrect value for last_msg_.states[53].cn0, expected 0, is " + << last_msg_.states[53].cn0; + EXPECT_EQ(last_msg_.states[53].mesid.code, 0) + << "incorrect value for last_msg_.states[53].mesid.code, expected 0, is " + << last_msg_.states[53].mesid.code; + EXPECT_EQ(last_msg_.states[53].mesid.sat, 0) + << "incorrect value for last_msg_.states[53].mesid.sat, expected 0, is " + << last_msg_.states[53].mesid.sat; + EXPECT_EQ(last_msg_.states[54].cn0, 0) + << "incorrect value for last_msg_.states[54].cn0, expected 0, is " + << last_msg_.states[54].cn0; + EXPECT_EQ(last_msg_.states[54].mesid.code, 0) + << "incorrect value for last_msg_.states[54].mesid.code, expected 0, is " + << last_msg_.states[54].mesid.code; + EXPECT_EQ(last_msg_.states[54].mesid.sat, 0) + << "incorrect value for last_msg_.states[54].mesid.sat, expected 0, is " + << last_msg_.states[54].mesid.sat; + EXPECT_EQ(last_msg_.states[55].cn0, 0) + << "incorrect value for last_msg_.states[55].cn0, expected 0, is " + << last_msg_.states[55].cn0; + EXPECT_EQ(last_msg_.states[55].mesid.code, 0) + << "incorrect value for last_msg_.states[55].mesid.code, expected 0, is " + << last_msg_.states[55].mesid.code; + EXPECT_EQ(last_msg_.states[55].mesid.sat, 0) + << "incorrect value for last_msg_.states[55].mesid.sat, expected 0, is " + << last_msg_.states[55].mesid.sat; + EXPECT_EQ(last_msg_.states[56].cn0, 0) + << "incorrect value for last_msg_.states[56].cn0, expected 0, is " + << last_msg_.states[56].cn0; + EXPECT_EQ(last_msg_.states[56].mesid.code, 0) + << "incorrect value for last_msg_.states[56].mesid.code, expected 0, is " + << last_msg_.states[56].mesid.code; + EXPECT_EQ(last_msg_.states[56].mesid.sat, 0) + << "incorrect value for last_msg_.states[56].mesid.sat, expected 0, is " + << last_msg_.states[56].mesid.sat; + EXPECT_EQ(last_msg_.states[57].cn0, 0) + << "incorrect value for last_msg_.states[57].cn0, expected 0, is " + << last_msg_.states[57].cn0; + EXPECT_EQ(last_msg_.states[57].mesid.code, 0) + << "incorrect value for last_msg_.states[57].mesid.code, expected 0, is " + << last_msg_.states[57].mesid.code; + EXPECT_EQ(last_msg_.states[57].mesid.sat, 0) + << "incorrect value for last_msg_.states[57].mesid.sat, expected 0, is " + << last_msg_.states[57].mesid.sat; + EXPECT_EQ(last_msg_.states[58].cn0, 0) + << "incorrect value for last_msg_.states[58].cn0, expected 0, is " + << last_msg_.states[58].cn0; + EXPECT_EQ(last_msg_.states[58].mesid.code, 0) + << "incorrect value for last_msg_.states[58].mesid.code, expected 0, is " + << last_msg_.states[58].mesid.code; + EXPECT_EQ(last_msg_.states[58].mesid.sat, 0) + << "incorrect value for last_msg_.states[58].mesid.sat, expected 0, is " + << last_msg_.states[58].mesid.sat; + EXPECT_EQ(last_msg_.states[59].cn0, 0) + << "incorrect value for last_msg_.states[59].cn0, expected 0, is " + << last_msg_.states[59].cn0; + EXPECT_EQ(last_msg_.states[59].mesid.code, 0) + << "incorrect value for last_msg_.states[59].mesid.code, expected 0, is " + << last_msg_.states[59].mesid.code; + EXPECT_EQ(last_msg_.states[59].mesid.sat, 0) + << "incorrect value for last_msg_.states[59].mesid.sat, expected 0, is " + << last_msg_.states[59].mesid.sat; + EXPECT_EQ(last_msg_.states[60].cn0, 0) + << "incorrect value for last_msg_.states[60].cn0, expected 0, is " + << last_msg_.states[60].cn0; + EXPECT_EQ(last_msg_.states[60].mesid.code, 0) + << "incorrect value for last_msg_.states[60].mesid.code, expected 0, is " + << last_msg_.states[60].mesid.code; + EXPECT_EQ(last_msg_.states[60].mesid.sat, 0) + << "incorrect value for last_msg_.states[60].mesid.sat, expected 0, is " + << last_msg_.states[60].mesid.sat; + EXPECT_EQ(last_msg_.states[61].cn0, 0) + << "incorrect value for last_msg_.states[61].cn0, expected 0, is " + << last_msg_.states[61].cn0; + EXPECT_EQ(last_msg_.states[61].mesid.code, 0) + << "incorrect value for last_msg_.states[61].mesid.code, expected 0, is " + << last_msg_.states[61].mesid.code; + EXPECT_EQ(last_msg_.states[61].mesid.sat, 0) + << "incorrect value for last_msg_.states[61].mesid.sat, expected 0, is " + << last_msg_.states[61].mesid.sat; + EXPECT_EQ(last_msg_.states[62].cn0, 0) + << "incorrect value for last_msg_.states[62].cn0, expected 0, is " + << last_msg_.states[62].cn0; + EXPECT_EQ(last_msg_.states[62].mesid.code, 0) + << "incorrect value for last_msg_.states[62].mesid.code, expected 0, is " + << last_msg_.states[62].mesid.code; + EXPECT_EQ(last_msg_.states[62].mesid.sat, 0) + << "incorrect value for last_msg_.states[62].mesid.sat, expected 0, is " + << last_msg_.states[62].mesid.sat; + EXPECT_EQ(last_msg_.states[63].cn0, 203) + << "incorrect value for last_msg_.states[63].cn0, expected 203, is " + << last_msg_.states[63].cn0; + EXPECT_EQ(last_msg_.states[63].mesid.code, 14) + << "incorrect value for last_msg_.states[63].mesid.code, expected 14, is " + << last_msg_.states[63].mesid.code; + EXPECT_EQ(last_msg_.states[63].mesid.sat, 36) + << "incorrect value for last_msg_.states[63].mesid.sat, expected 36, is " + << last_msg_.states[63].mesid.sat; + EXPECT_EQ(last_msg_.states[64].cn0, 0) + << "incorrect value for last_msg_.states[64].cn0, expected 0, is " + << last_msg_.states[64].cn0; + EXPECT_EQ(last_msg_.states[64].mesid.code, 0) + << "incorrect value for last_msg_.states[64].mesid.code, expected 0, is " + << last_msg_.states[64].mesid.code; + EXPECT_EQ(last_msg_.states[64].mesid.sat, 0) + << "incorrect value for last_msg_.states[64].mesid.sat, expected 0, is " + << last_msg_.states[64].mesid.sat; + EXPECT_EQ(last_msg_.states[65].cn0, 158) + << "incorrect value for last_msg_.states[65].cn0, expected 158, is " + << last_msg_.states[65].cn0; + EXPECT_EQ(last_msg_.states[65].mesid.code, 14) + << "incorrect value for last_msg_.states[65].mesid.code, expected 14, is " + << last_msg_.states[65].mesid.code; + EXPECT_EQ(last_msg_.states[65].mesid.sat, 5) + << "incorrect value for last_msg_.states[65].mesid.sat, expected 5, is " + << last_msg_.states[65].mesid.sat; + EXPECT_EQ(last_msg_.states[66].cn0, 194) + << "incorrect value for last_msg_.states[66].cn0, expected 194, is " + << last_msg_.states[66].cn0; + EXPECT_EQ(last_msg_.states[66].mesid.code, 14) + << "incorrect value for last_msg_.states[66].mesid.code, expected 14, is " + << last_msg_.states[66].mesid.code; + EXPECT_EQ(last_msg_.states[66].mesid.sat, 4) + << "incorrect value for last_msg_.states[66].mesid.sat, expected 4, is " + << last_msg_.states[66].mesid.sat; + EXPECT_EQ(last_msg_.states[67].cn0, 192) + << "incorrect value for last_msg_.states[67].cn0, expected 192, is " + << last_msg_.states[67].cn0; + EXPECT_EQ(last_msg_.states[67].mesid.code, 14) + << "incorrect value for last_msg_.states[67].mesid.code, expected 14, is " + << last_msg_.states[67].mesid.code; + EXPECT_EQ(last_msg_.states[67].mesid.sat, 11) + << "incorrect value for last_msg_.states[67].mesid.sat, expected 11, is " + << last_msg_.states[67].mesid.sat; + EXPECT_EQ(last_msg_.states[68].cn0, 207) + << "incorrect value for last_msg_.states[68].cn0, expected 207, is " + << last_msg_.states[68].cn0; + EXPECT_EQ(last_msg_.states[68].mesid.code, 14) + << "incorrect value for last_msg_.states[68].mesid.code, expected 14, is " + << last_msg_.states[68].mesid.code; + EXPECT_EQ(last_msg_.states[68].mesid.sat, 9) + << "incorrect value for last_msg_.states[68].mesid.sat, expected 9, is " + << last_msg_.states[68].mesid.sat; + EXPECT_EQ(last_msg_.states[69].cn0, 0) + << "incorrect value for last_msg_.states[69].cn0, expected 0, is " + << last_msg_.states[69].cn0; + EXPECT_EQ(last_msg_.states[69].mesid.code, 0) + << "incorrect value for last_msg_.states[69].mesid.code, expected 0, is " + << last_msg_.states[69].mesid.code; + EXPECT_EQ(last_msg_.states[69].mesid.sat, 0) + << "incorrect value for last_msg_.states[69].mesid.sat, expected 0, is " + << last_msg_.states[69].mesid.sat; + EXPECT_EQ(last_msg_.states[70].cn0, 0) + << "incorrect value for last_msg_.states[70].cn0, expected 0, is " + << last_msg_.states[70].cn0; + EXPECT_EQ(last_msg_.states[70].mesid.code, 0) + << "incorrect value for last_msg_.states[70].mesid.code, expected 0, is " + << last_msg_.states[70].mesid.code; + EXPECT_EQ(last_msg_.states[70].mesid.sat, 0) + << "incorrect value for last_msg_.states[70].mesid.sat, expected 0, is " + << last_msg_.states[70].mesid.sat; + EXPECT_EQ(last_msg_.states[71].cn0, 0) + << "incorrect value for last_msg_.states[71].cn0, expected 0, is " + << last_msg_.states[71].cn0; + EXPECT_EQ(last_msg_.states[71].mesid.code, 0) + << "incorrect value for last_msg_.states[71].mesid.code, expected 0, is " + << last_msg_.states[71].mesid.code; + EXPECT_EQ(last_msg_.states[71].mesid.sat, 0) + << "incorrect value for last_msg_.states[71].mesid.sat, expected 0, is " + << last_msg_.states[71].mesid.sat; + EXPECT_EQ(last_msg_.states[72].cn0, 218) + << "incorrect value for last_msg_.states[72].cn0, expected 218, is " + << last_msg_.states[72].cn0; + EXPECT_EQ(last_msg_.states[72].mesid.code, 20) + << "incorrect value for last_msg_.states[72].mesid.code, expected 20, is " + << last_msg_.states[72].mesid.code; + EXPECT_EQ(last_msg_.states[72].mesid.sat, 9) + << "incorrect value for last_msg_.states[72].mesid.sat, expected 9, is " + << last_msg_.states[72].mesid.sat; + EXPECT_EQ(last_msg_.states[73].cn0, 176) + << "incorrect value for last_msg_.states[73].cn0, expected 176, is " + << last_msg_.states[73].cn0; + EXPECT_EQ(last_msg_.states[73].mesid.code, 20) + << "incorrect value for last_msg_.states[73].mesid.code, expected 20, is " + << last_msg_.states[73].mesid.code; + EXPECT_EQ(last_msg_.states[73].mesid.sat, 5) + << "incorrect value for last_msg_.states[73].mesid.sat, expected 5, is " + << last_msg_.states[73].mesid.sat; + EXPECT_EQ(last_msg_.states[74].cn0, 217) + << "incorrect value for last_msg_.states[74].cn0, expected 217, is " + << last_msg_.states[74].cn0; + EXPECT_EQ(last_msg_.states[74].mesid.code, 20) + << "incorrect value for last_msg_.states[74].mesid.code, expected 20, is " + << last_msg_.states[74].mesid.code; + EXPECT_EQ(last_msg_.states[74].mesid.sat, 36) + << "incorrect value for last_msg_.states[74].mesid.sat, expected 36, is " + << last_msg_.states[74].mesid.sat; + EXPECT_EQ(last_msg_.states[75].cn0, 200) + << "incorrect value for last_msg_.states[75].cn0, expected 200, is " + << last_msg_.states[75].cn0; + EXPECT_EQ(last_msg_.states[75].mesid.code, 20) + << "incorrect value for last_msg_.states[75].mesid.code, expected 20, is " + << last_msg_.states[75].mesid.code; + EXPECT_EQ(last_msg_.states[75].mesid.sat, 11) + << "incorrect value for last_msg_.states[75].mesid.sat, expected 11, is " + << last_msg_.states[75].mesid.sat; + EXPECT_EQ(last_msg_.states[76].cn0, 205) + << "incorrect value for last_msg_.states[76].cn0, expected 205, is " + << last_msg_.states[76].cn0; + EXPECT_EQ(last_msg_.states[76].mesid.code, 20) + << "incorrect value for last_msg_.states[76].mesid.code, expected 20, is " + << last_msg_.states[76].mesid.code; + EXPECT_EQ(last_msg_.states[76].mesid.sat, 4) + << "incorrect value for last_msg_.states[76].mesid.sat, expected 4, is " + << last_msg_.states[76].mesid.sat; + EXPECT_EQ(last_msg_.states[77].cn0, 0) + << "incorrect value for last_msg_.states[77].cn0, expected 0, is " + << last_msg_.states[77].cn0; + EXPECT_EQ(last_msg_.states[77].mesid.code, 0) + << "incorrect value for last_msg_.states[77].mesid.code, expected 0, is " + << last_msg_.states[77].mesid.code; + EXPECT_EQ(last_msg_.states[77].mesid.sat, 0) + << "incorrect value for last_msg_.states[77].mesid.sat, expected 0, is " + << last_msg_.states[77].mesid.sat; + EXPECT_EQ(last_msg_.states[78].cn0, 0) + << "incorrect value for last_msg_.states[78].cn0, expected 0, is " + << last_msg_.states[78].cn0; + EXPECT_EQ(last_msg_.states[78].mesid.code, 0) + << "incorrect value for last_msg_.states[78].mesid.code, expected 0, is " + << last_msg_.states[78].mesid.code; + EXPECT_EQ(last_msg_.states[78].mesid.sat, 0) + << "incorrect value for last_msg_.states[78].mesid.sat, expected 0, is " + << last_msg_.states[78].mesid.sat; } diff --git a/c/test/cpp/auto_check_sbp_tracking_MsgTrackingIq.cc b/c/test/cpp/auto_check_sbp_tracking_MsgTrackingIq.cc index ca004cf88..3acddae5d 100644 --- a/c/test/cpp/auto_check_sbp_tracking_MsgTrackingIq.cc +++ b/c/test/cpp/auto_check_sbp_tracking_MsgTrackingIq.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIq.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_tracking_MsgTrackingIq0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgTrackingIq0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_tracking_MsgTrackingIq0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgTrackingIq0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_iq_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_tracking_iq_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,51 +67,70 @@ class Test_auto_check_sbp_tracking_MsgTrackingIq0 : sbp_msg_tracking_iq_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgTrackingIq0, Test) -{ +}; - uint8_t encoded_frame[] = {85,45,0,2,80,15,145,121,203,47,217,239,55,45,38,189,88,159,19,208,12,97,167, }; +TEST_F(Test_auto_check_sbp_tracking_MsgTrackingIq0, Test) { + uint8_t encoded_frame[] = { + 85, 45, 0, 2, 80, 15, 145, 121, 203, 47, 217, 239, + 55, 45, 38, 189, 88, 159, 19, 208, 12, 97, 167, + }; - sbp_msg_tracking_iq_t test_msg{}; - test_msg.channel = 145; - - test_msg.corrs[0].I = -9937; - test_msg.corrs[0].Q = 14319; - - test_msg.corrs[1].I = 9773; - test_msg.corrs[1].Q = 22717; - - test_msg.corrs[2].I = 5023; - test_msg.corrs[2].Q = 3280; - test_msg.sid.code = 203; - test_msg.sid.sat = 121; - - EXPECT_EQ(send_message( 20482, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + sbp_msg_tracking_iq_t test_msg{}; + test_msg.channel = 145; + + test_msg.corrs[0].I = -9937; + test_msg.corrs[0].Q = 14319; + + test_msg.corrs[1].I = 9773; + test_msg.corrs[1].Q = 22717; + + test_msg.corrs[2].I = 5023; + test_msg.corrs[2].Q = 3280; + test_msg.sid.code = 203; + test_msg.sid.sat = 121; + + EXPECT_EQ(send_message(20482, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 20482); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.channel, 145) << "incorrect value for last_msg_.channel, expected 145, is " << last_msg_.channel; - EXPECT_EQ(last_msg_.corrs[0].I, -9937) << "incorrect value for last_msg_.corrs[0].I, expected -9937, is " << last_msg_.corrs[0].I; - EXPECT_EQ(last_msg_.corrs[0].Q, 14319) << "incorrect value for last_msg_.corrs[0].Q, expected 14319, is " << last_msg_.corrs[0].Q; - EXPECT_EQ(last_msg_.corrs[1].I, 9773) << "incorrect value for last_msg_.corrs[1].I, expected 9773, is " << last_msg_.corrs[1].I; - EXPECT_EQ(last_msg_.corrs[1].Q, 22717) << "incorrect value for last_msg_.corrs[1].Q, expected 22717, is " << last_msg_.corrs[1].Q; - EXPECT_EQ(last_msg_.corrs[2].I, 5023) << "incorrect value for last_msg_.corrs[2].I, expected 5023, is " << last_msg_.corrs[2].I; - EXPECT_EQ(last_msg_.corrs[2].Q, 3280) << "incorrect value for last_msg_.corrs[2].Q, expected 3280, is " << last_msg_.corrs[2].Q; - EXPECT_EQ(last_msg_.sid.code, 203) << "incorrect value for last_msg_.sid.code, expected 203, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.sat, 121) << "incorrect value for last_msg_.sid.sat, expected 121, is " << last_msg_.sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 20482); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.channel, 145) + << "incorrect value for last_msg_.channel, expected 145, is " + << last_msg_.channel; + EXPECT_EQ(last_msg_.corrs[0].I, -9937) + << "incorrect value for last_msg_.corrs[0].I, expected -9937, is " + << last_msg_.corrs[0].I; + EXPECT_EQ(last_msg_.corrs[0].Q, 14319) + << "incorrect value for last_msg_.corrs[0].Q, expected 14319, is " + << last_msg_.corrs[0].Q; + EXPECT_EQ(last_msg_.corrs[1].I, 9773) + << "incorrect value for last_msg_.corrs[1].I, expected 9773, is " + << last_msg_.corrs[1].I; + EXPECT_EQ(last_msg_.corrs[1].Q, 22717) + << "incorrect value for last_msg_.corrs[1].Q, expected 22717, is " + << last_msg_.corrs[1].Q; + EXPECT_EQ(last_msg_.corrs[2].I, 5023) + << "incorrect value for last_msg_.corrs[2].I, expected 5023, is " + << last_msg_.corrs[2].I; + EXPECT_EQ(last_msg_.corrs[2].Q, 3280) + << "incorrect value for last_msg_.corrs[2].Q, expected 3280, is " + << last_msg_.corrs[2].Q; + EXPECT_EQ(last_msg_.sid.code, 203) + << "incorrect value for last_msg_.sid.code, expected 203, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.sat, 121) + << "incorrect value for last_msg_.sid.sat, expected 121, is " + << last_msg_.sid.sat; } diff --git a/c/test/cpp/auto_check_sbp_tracking_MsgTrackingIqDepA.cc b/c/test/cpp/auto_check_sbp_tracking_MsgTrackingIqDepA.cc index bfbf5d5b6..a555c50a3 100644 --- a/c/test/cpp/auto_check_sbp_tracking_MsgTrackingIqDepA.cc +++ b/c/test/cpp/auto_check_sbp_tracking_MsgTrackingIqDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_tracking_MsgTrackingIqDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgTrackingIqDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_tracking_MsgTrackingIqDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgTrackingIqDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_iq_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_tracking_iq_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,53 +67,75 @@ class Test_auto_check_sbp_tracking_MsgTrackingIqDepA0 : sbp_msg_tracking_iq_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgTrackingIqDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,28,0,184,67,29,139,28,250,15,0,99,90,170,96,71,121,33,161,52,211,162,101,41,36,226,99,71,75,14,240,134,82,175,83,17,34, }; +TEST_F(Test_auto_check_sbp_tracking_MsgTrackingIqDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 28, 0, 184, 67, 29, 139, 28, 250, 15, 0, 99, 90, + 170, 96, 71, 121, 33, 161, 52, 211, 162, 101, 41, 36, 226, + 99, 71, 75, 14, 240, 134, 82, 175, 83, 17, 34, + }; - sbp_msg_tracking_iq_dep_a_t test_msg{}; - test_msg.channel = 139; - - test_msg.corrs[0].I = 1621776995; - test_msg.corrs[0].Q = -1591641785; - - test_msg.corrs[1].I = 1705169716; - test_msg.corrs[1].Q = 1675764777; - - test_msg.corrs[2].I = -267498681; - test_msg.corrs[2].Q = 1403998854; - test_msg.sid.code = 15; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 64028; - - EXPECT_EQ(send_message( 17336, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + sbp_msg_tracking_iq_dep_a_t test_msg{}; + test_msg.channel = 139; + + test_msg.corrs[0].I = 1621776995; + test_msg.corrs[0].Q = -1591641785; + + test_msg.corrs[1].I = 1705169716; + test_msg.corrs[1].Q = 1675764777; + + test_msg.corrs[2].I = -267498681; + test_msg.corrs[2].Q = 1403998854; + test_msg.sid.code = 15; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 64028; + + EXPECT_EQ(send_message(17336, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 17336); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.channel, 139) << "incorrect value for last_msg_.channel, expected 139, is " << last_msg_.channel; - EXPECT_EQ(last_msg_.corrs[0].I, 1621776995) << "incorrect value for last_msg_.corrs[0].I, expected 1621776995, is " << last_msg_.corrs[0].I; - EXPECT_EQ(last_msg_.corrs[0].Q, -1591641785) << "incorrect value for last_msg_.corrs[0].Q, expected -1591641785, is " << last_msg_.corrs[0].Q; - EXPECT_EQ(last_msg_.corrs[1].I, 1705169716) << "incorrect value for last_msg_.corrs[1].I, expected 1705169716, is " << last_msg_.corrs[1].I; - EXPECT_EQ(last_msg_.corrs[1].Q, 1675764777) << "incorrect value for last_msg_.corrs[1].Q, expected 1675764777, is " << last_msg_.corrs[1].Q; - EXPECT_EQ(last_msg_.corrs[2].I, -267498681) << "incorrect value for last_msg_.corrs[2].I, expected -267498681, is " << last_msg_.corrs[2].I; - EXPECT_EQ(last_msg_.corrs[2].Q, 1403998854) << "incorrect value for last_msg_.corrs[2].Q, expected 1403998854, is " << last_msg_.corrs[2].Q; - EXPECT_EQ(last_msg_.sid.code, 15) << "incorrect value for last_msg_.sid.code, expected 15, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 64028) << "incorrect value for last_msg_.sid.sat, expected 64028, is " << last_msg_.sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 17336); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.channel, 139) + << "incorrect value for last_msg_.channel, expected 139, is " + << last_msg_.channel; + EXPECT_EQ(last_msg_.corrs[0].I, 1621776995) + << "incorrect value for last_msg_.corrs[0].I, expected 1621776995, is " + << last_msg_.corrs[0].I; + EXPECT_EQ(last_msg_.corrs[0].Q, -1591641785) + << "incorrect value for last_msg_.corrs[0].Q, expected -1591641785, is " + << last_msg_.corrs[0].Q; + EXPECT_EQ(last_msg_.corrs[1].I, 1705169716) + << "incorrect value for last_msg_.corrs[1].I, expected 1705169716, is " + << last_msg_.corrs[1].I; + EXPECT_EQ(last_msg_.corrs[1].Q, 1675764777) + << "incorrect value for last_msg_.corrs[1].Q, expected 1675764777, is " + << last_msg_.corrs[1].Q; + EXPECT_EQ(last_msg_.corrs[2].I, -267498681) + << "incorrect value for last_msg_.corrs[2].I, expected -267498681, is " + << last_msg_.corrs[2].I; + EXPECT_EQ(last_msg_.corrs[2].Q, 1403998854) + << "incorrect value for last_msg_.corrs[2].Q, expected 1403998854, is " + << last_msg_.corrs[2].Q; + EXPECT_EQ(last_msg_.sid.code, 15) + << "incorrect value for last_msg_.sid.code, expected 15, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 64028) + << "incorrect value for last_msg_.sid.sat, expected 64028, is " + << last_msg_.sid.sat; } diff --git a/c/test/cpp/auto_check_sbp_tracking_MsgTrackingIqDepB.cc b/c/test/cpp/auto_check_sbp_tracking_MsgTrackingIqDepB.cc index c7abbfc12..08b3522eb 100644 --- a/c/test/cpp/auto_check_sbp_tracking_MsgTrackingIqDepB.cc +++ b/c/test/cpp/auto_check_sbp_tracking_MsgTrackingIqDepB.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepB.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_tracking_MsgTrackingIqDepB0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgTrackingIqDepB0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_tracking_MsgTrackingIqDepB0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgTrackingIqDepB0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_iq_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_tracking_iq_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,51 +67,71 @@ class Test_auto_check_sbp_tracking_MsgTrackingIqDepB0 : sbp_msg_tracking_iq_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgTrackingIqDepB0, Test) -{ +}; - uint8_t encoded_frame[] = {85,44,0,39,101,27,45,188,183,72,185,157,15,187,249,101,24,135,146,180,224,123,235,142,208,102,112,25,21,177,96,116,68,246,153, }; +TEST_F(Test_auto_check_sbp_tracking_MsgTrackingIqDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 44, 0, 39, 101, 27, 45, 188, 183, 72, 185, 157, + 15, 187, 249, 101, 24, 135, 146, 180, 224, 123, 235, 142, + 208, 102, 112, 25, 21, 177, 96, 116, 68, 246, 153, + }; - sbp_msg_tracking_iq_dep_b_t test_msg{}; - test_msg.channel = 45; - - test_msg.corrs[0].I = 261994824; - test_msg.corrs[0].Q = 409336251; - - test_msg.corrs[1].I = -525036921; - test_msg.corrs[1].Q = -795939973; - - test_msg.corrs[2].I = 353988710; - test_msg.corrs[2].Q = 1148477617; - test_msg.sid.code = 183; - test_msg.sid.sat = 188; - - EXPECT_EQ(send_message( 25895, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + sbp_msg_tracking_iq_dep_b_t test_msg{}; + test_msg.channel = 45; + + test_msg.corrs[0].I = 261994824; + test_msg.corrs[0].Q = 409336251; + + test_msg.corrs[1].I = -525036921; + test_msg.corrs[1].Q = -795939973; + + test_msg.corrs[2].I = 353988710; + test_msg.corrs[2].Q = 1148477617; + test_msg.sid.code = 183; + test_msg.sid.sat = 188; + + EXPECT_EQ(send_message(25895, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 25895); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.channel, 45) << "incorrect value for last_msg_.channel, expected 45, is " << last_msg_.channel; - EXPECT_EQ(last_msg_.corrs[0].I, 261994824) << "incorrect value for last_msg_.corrs[0].I, expected 261994824, is " << last_msg_.corrs[0].I; - EXPECT_EQ(last_msg_.corrs[0].Q, 409336251) << "incorrect value for last_msg_.corrs[0].Q, expected 409336251, is " << last_msg_.corrs[0].Q; - EXPECT_EQ(last_msg_.corrs[1].I, -525036921) << "incorrect value for last_msg_.corrs[1].I, expected -525036921, is " << last_msg_.corrs[1].I; - EXPECT_EQ(last_msg_.corrs[1].Q, -795939973) << "incorrect value for last_msg_.corrs[1].Q, expected -795939973, is " << last_msg_.corrs[1].Q; - EXPECT_EQ(last_msg_.corrs[2].I, 353988710) << "incorrect value for last_msg_.corrs[2].I, expected 353988710, is " << last_msg_.corrs[2].I; - EXPECT_EQ(last_msg_.corrs[2].Q, 1148477617) << "incorrect value for last_msg_.corrs[2].Q, expected 1148477617, is " << last_msg_.corrs[2].Q; - EXPECT_EQ(last_msg_.sid.code, 183) << "incorrect value for last_msg_.sid.code, expected 183, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.sat, 188) << "incorrect value for last_msg_.sid.sat, expected 188, is " << last_msg_.sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 25895); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.channel, 45) + << "incorrect value for last_msg_.channel, expected 45, is " + << last_msg_.channel; + EXPECT_EQ(last_msg_.corrs[0].I, 261994824) + << "incorrect value for last_msg_.corrs[0].I, expected 261994824, is " + << last_msg_.corrs[0].I; + EXPECT_EQ(last_msg_.corrs[0].Q, 409336251) + << "incorrect value for last_msg_.corrs[0].Q, expected 409336251, is " + << last_msg_.corrs[0].Q; + EXPECT_EQ(last_msg_.corrs[1].I, -525036921) + << "incorrect value for last_msg_.corrs[1].I, expected -525036921, is " + << last_msg_.corrs[1].I; + EXPECT_EQ(last_msg_.corrs[1].Q, -795939973) + << "incorrect value for last_msg_.corrs[1].Q, expected -795939973, is " + << last_msg_.corrs[1].Q; + EXPECT_EQ(last_msg_.corrs[2].I, 353988710) + << "incorrect value for last_msg_.corrs[2].I, expected 353988710, is " + << last_msg_.corrs[2].I; + EXPECT_EQ(last_msg_.corrs[2].Q, 1148477617) + << "incorrect value for last_msg_.corrs[2].Q, expected 1148477617, is " + << last_msg_.corrs[2].Q; + EXPECT_EQ(last_msg_.sid.code, 183) + << "incorrect value for last_msg_.sid.code, expected 183, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.sat, 188) + << "incorrect value for last_msg_.sid.sat, expected 188, is " + << last_msg_.sid.sat; } diff --git a/c/test/cpp/auto_check_sbp_tracking_MsgTrackingState.cc b/c/test/cpp/auto_check_sbp_tracking_MsgTrackingState.cc index 5e6ecb6fe..64e26a8a2 100644 --- a/c/test/cpp/auto_check_sbp_tracking_MsgTrackingState.cc +++ b/c/test/cpp/auto_check_sbp_tracking_MsgTrackingState.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingState.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_tracking_MsgTrackingState0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgTrackingState0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_tracking_MsgTrackingState0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgTrackingState0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_tracking_state_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,615 +67,1153 @@ class Test_auto_check_sbp_tracking_MsgTrackingState0 : sbp_msg_tracking_state_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgTrackingState0, Test) -{ - - uint8_t encoded_frame[] = {85,65,0,55,129,252,117,184,3,102,38,106,140,141,25,4,90,195,246,108,75,82,137,127,45,163,32,46,187,93,153,60,201,147,23,29,5,208,181,30,219,69,254,136,3,121,33,98,144,215,133,182,14,56,169,77,218,62,242,84,171,249,152,137,131,130,193,21,42,68,253,227,216,227,24,26,210,179,19,15,227,255,122,75,187,200,217,48,218,122,187,238,142,149,238,55,251,212,128,160,194,104,113,255,141,62,43,69,245,39,100,230,108,56,247,68,149,143,137,101,233,70,49,165,38,110,218,230,80,213,196,179,139,128,15,178,196,171,8,212,97,194,83,233,79,99,55,90,31,180,5,25,105,186,22,224,80,111,8,48,106,166,4,48,156,49,86,19,142,146,91,124,115,64,28,230,115,178,190,131,16,242,105,59,182,113,192,180,48,179,166,31,172,211,77,228,140,49,128,77,240,194,134,194,41,58,18,53,129,55,91,72,134,92,33,224,157,56,186,54,224,174,82,84,148,190,236,54,62,67,52,215,57,254,16,133,36,174,219,172,145,17,192,179,111,97,207,56,208,134,180,17,43,226,255,182,140,113,141,111, }; - - sbp_msg_tracking_state_t test_msg{}; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_states.value = 63; - - test_msg.states[0].cn0 = 102; - test_msg.states[0].fcn = 3; - test_msg.states[0].sid.code = 184; - test_msg.states[0].sid.sat = 117; - - test_msg.states[1].cn0 = 141; - test_msg.states[1].fcn = 140; - test_msg.states[1].sid.code = 106; - test_msg.states[1].sid.sat = 38; - - test_msg.states[2].cn0 = 195; - test_msg.states[2].fcn = 90; - test_msg.states[2].sid.code = 4; - test_msg.states[2].sid.sat = 25; - - test_msg.states[3].cn0 = 82; - test_msg.states[3].fcn = 75; - test_msg.states[3].sid.code = 108; - test_msg.states[3].sid.sat = 246; - - test_msg.states[4].cn0 = 163; - test_msg.states[4].fcn = 45; - test_msg.states[4].sid.code = 127; - test_msg.states[4].sid.sat = 137; - - test_msg.states[5].cn0 = 93; - test_msg.states[5].fcn = 187; - test_msg.states[5].sid.code = 46; - test_msg.states[5].sid.sat = 32; - - test_msg.states[6].cn0 = 147; - test_msg.states[6].fcn = 201; - test_msg.states[6].sid.code = 60; - test_msg.states[6].sid.sat = 153; - - test_msg.states[7].cn0 = 208; - test_msg.states[7].fcn = 5; - test_msg.states[7].sid.code = 29; - test_msg.states[7].sid.sat = 23; - - test_msg.states[8].cn0 = 69; - test_msg.states[8].fcn = 219; - test_msg.states[8].sid.code = 30; - test_msg.states[8].sid.sat = 181; - - test_msg.states[9].cn0 = 121; - test_msg.states[9].fcn = 3; - test_msg.states[9].sid.code = 136; - test_msg.states[9].sid.sat = 254; - - test_msg.states[10].cn0 = 215; - test_msg.states[10].fcn = 144; - test_msg.states[10].sid.code = 98; - test_msg.states[10].sid.sat = 33; - - test_msg.states[11].cn0 = 56; - test_msg.states[11].fcn = 14; - test_msg.states[11].sid.code = 182; - test_msg.states[11].sid.sat = 133; - - test_msg.states[12].cn0 = 62; - test_msg.states[12].fcn = 218; - test_msg.states[12].sid.code = 77; - test_msg.states[12].sid.sat = 169; - - test_msg.states[13].cn0 = 249; - test_msg.states[13].fcn = 171; - test_msg.states[13].sid.code = 84; - test_msg.states[13].sid.sat = 242; - - test_msg.states[14].cn0 = 130; - test_msg.states[14].fcn = 131; - test_msg.states[14].sid.code = 137; - test_msg.states[14].sid.sat = 152; - - test_msg.states[15].cn0 = 68; - test_msg.states[15].fcn = 42; - test_msg.states[15].sid.code = 21; - test_msg.states[15].sid.sat = 193; - - test_msg.states[16].cn0 = 227; - test_msg.states[16].fcn = 216; - test_msg.states[16].sid.code = 227; - test_msg.states[16].sid.sat = 253; - - test_msg.states[17].cn0 = 179; - test_msg.states[17].fcn = 210; - test_msg.states[17].sid.code = 26; - test_msg.states[17].sid.sat = 24; - - test_msg.states[18].cn0 = 255; - test_msg.states[18].fcn = 227; - test_msg.states[18].sid.code = 15; - test_msg.states[18].sid.sat = 19; - - test_msg.states[19].cn0 = 200; - test_msg.states[19].fcn = 187; - test_msg.states[19].sid.code = 75; - test_msg.states[19].sid.sat = 122; - - test_msg.states[20].cn0 = 122; - test_msg.states[20].fcn = 218; - test_msg.states[20].sid.code = 48; - test_msg.states[20].sid.sat = 217; - - test_msg.states[21].cn0 = 149; - test_msg.states[21].fcn = 142; - test_msg.states[21].sid.code = 238; - test_msg.states[21].sid.sat = 187; - - test_msg.states[22].cn0 = 212; - test_msg.states[22].fcn = 251; - test_msg.states[22].sid.code = 55; - test_msg.states[22].sid.sat = 238; - - test_msg.states[23].cn0 = 104; - test_msg.states[23].fcn = 194; - test_msg.states[23].sid.code = 160; - test_msg.states[23].sid.sat = 128; - - test_msg.states[24].cn0 = 62; - test_msg.states[24].fcn = 141; - test_msg.states[24].sid.code = 255; - test_msg.states[24].sid.sat = 113; - - test_msg.states[25].cn0 = 39; - test_msg.states[25].fcn = 245; - test_msg.states[25].sid.code = 69; - test_msg.states[25].sid.sat = 43; - - test_msg.states[26].cn0 = 56; - test_msg.states[26].fcn = 108; - test_msg.states[26].sid.code = 230; - test_msg.states[26].sid.sat = 100; - - test_msg.states[27].cn0 = 143; - test_msg.states[27].fcn = 149; - test_msg.states[27].sid.code = 68; - test_msg.states[27].sid.sat = 247; - - test_msg.states[28].cn0 = 70; - test_msg.states[28].fcn = 233; - test_msg.states[28].sid.code = 101; - test_msg.states[28].sid.sat = 137; - - test_msg.states[29].cn0 = 110; - test_msg.states[29].fcn = 38; - test_msg.states[29].sid.code = 165; - test_msg.states[29].sid.sat = 49; - - test_msg.states[30].cn0 = 213; - test_msg.states[30].fcn = 80; - test_msg.states[30].sid.code = 230; - test_msg.states[30].sid.sat = 218; - - test_msg.states[31].cn0 = 128; - test_msg.states[31].fcn = 139; - test_msg.states[31].sid.code = 179; - test_msg.states[31].sid.sat = 196; - - test_msg.states[32].cn0 = 171; - test_msg.states[32].fcn = 196; - test_msg.states[32].sid.code = 178; - test_msg.states[32].sid.sat = 15; - - test_msg.states[33].cn0 = 194; - test_msg.states[33].fcn = 97; - test_msg.states[33].sid.code = 212; - test_msg.states[33].sid.sat = 8; - - test_msg.states[34].cn0 = 99; - test_msg.states[34].fcn = 79; - test_msg.states[34].sid.code = 233; - test_msg.states[34].sid.sat = 83; - - test_msg.states[35].cn0 = 180; - test_msg.states[35].fcn = 31; - test_msg.states[35].sid.code = 90; - test_msg.states[35].sid.sat = 55; - - test_msg.states[36].cn0 = 186; - test_msg.states[36].fcn = 105; - test_msg.states[36].sid.code = 25; - test_msg.states[36].sid.sat = 5; - - test_msg.states[37].cn0 = 111; - test_msg.states[37].fcn = 80; - test_msg.states[37].sid.code = 224; - test_msg.states[37].sid.sat = 22; - - test_msg.states[38].cn0 = 166; - test_msg.states[38].fcn = 106; - test_msg.states[38].sid.code = 48; - test_msg.states[38].sid.sat = 8; - - test_msg.states[39].cn0 = 49; - test_msg.states[39].fcn = 156; - test_msg.states[39].sid.code = 48; - test_msg.states[39].sid.sat = 4; - - test_msg.states[40].cn0 = 146; - test_msg.states[40].fcn = 142; - test_msg.states[40].sid.code = 19; - test_msg.states[40].sid.sat = 86; - - test_msg.states[41].cn0 = 64; - test_msg.states[41].fcn = 115; - test_msg.states[41].sid.code = 124; - test_msg.states[41].sid.sat = 91; - - test_msg.states[42].cn0 = 178; - test_msg.states[42].fcn = 115; - test_msg.states[42].sid.code = 230; - test_msg.states[42].sid.sat = 28; - - test_msg.states[43].cn0 = 242; - test_msg.states[43].fcn = 16; - test_msg.states[43].sid.code = 131; - test_msg.states[43].sid.sat = 190; - - test_msg.states[44].cn0 = 113; - test_msg.states[44].fcn = 182; - test_msg.states[44].sid.code = 59; - test_msg.states[44].sid.sat = 105; - - test_msg.states[45].cn0 = 179; - test_msg.states[45].fcn = 48; - test_msg.states[45].sid.code = 180; - test_msg.states[45].sid.sat = 192; - - test_msg.states[46].cn0 = 211; - test_msg.states[46].fcn = 172; - test_msg.states[46].sid.code = 31; - test_msg.states[46].sid.sat = 166; - - test_msg.states[47].cn0 = 49; - test_msg.states[47].fcn = 140; - test_msg.states[47].sid.code = 228; - test_msg.states[47].sid.sat = 77; - - test_msg.states[48].cn0 = 194; - test_msg.states[48].fcn = 240; - test_msg.states[48].sid.code = 77; - test_msg.states[48].sid.sat = 128; - - test_msg.states[49].cn0 = 58; - test_msg.states[49].fcn = 41; - test_msg.states[49].sid.code = 194; - test_msg.states[49].sid.sat = 134; - - test_msg.states[50].cn0 = 55; - test_msg.states[50].fcn = 129; - test_msg.states[50].sid.code = 53; - test_msg.states[50].sid.sat = 18; - - test_msg.states[51].cn0 = 92; - test_msg.states[51].fcn = 134; - test_msg.states[51].sid.code = 72; - test_msg.states[51].sid.sat = 91; - - test_msg.states[52].cn0 = 56; - test_msg.states[52].fcn = 157; - test_msg.states[52].sid.code = 224; - test_msg.states[52].sid.sat = 33; - - test_msg.states[53].cn0 = 174; - test_msg.states[53].fcn = 224; - test_msg.states[53].sid.code = 54; - test_msg.states[53].sid.sat = 186; - - test_msg.states[54].cn0 = 190; - test_msg.states[54].fcn = 148; - test_msg.states[54].sid.code = 84; - test_msg.states[54].sid.sat = 82; - - test_msg.states[55].cn0 = 67; - test_msg.states[55].fcn = 62; - test_msg.states[55].sid.code = 54; - test_msg.states[55].sid.sat = 236; - - test_msg.states[56].cn0 = 254; - test_msg.states[56].fcn = 57; - test_msg.states[56].sid.code = 215; - test_msg.states[56].sid.sat = 52; - - test_msg.states[57].cn0 = 174; - test_msg.states[57].fcn = 36; - test_msg.states[57].sid.code = 133; - test_msg.states[57].sid.sat = 16; - - test_msg.states[58].cn0 = 17; - test_msg.states[58].fcn = 145; - test_msg.states[58].sid.code = 172; - test_msg.states[58].sid.sat = 219; - - test_msg.states[59].cn0 = 97; - test_msg.states[59].fcn = 111; - test_msg.states[59].sid.code = 179; - test_msg.states[59].sid.sat = 192; - - test_msg.states[60].cn0 = 134; - test_msg.states[60].fcn = 208; - test_msg.states[60].sid.code = 56; - test_msg.states[60].sid.sat = 207; - - test_msg.states[61].cn0 = 226; - test_msg.states[61].fcn = 43; - test_msg.states[61].sid.code = 17; - test_msg.states[61].sid.sat = 180; - - test_msg.states[62].cn0 = 113; - test_msg.states[62].fcn = 140; - test_msg.states[62].sid.code = 182; - test_msg.states[62].sid.sat = 255; - - EXPECT_EQ(send_message( 33079, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 33079); - EXPECT_EQ(last_msg_, test_msg); - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_states.value, 63) << "incorrect value for last_msg_.n_states.value, expected 63, is " << last_msg_.n_states.value; - EXPECT_EQ(last_msg_.states[0].cn0, 102) << "incorrect value for last_msg_.states[0].cn0, expected 102, is " << last_msg_.states[0].cn0; - EXPECT_EQ(last_msg_.states[0].fcn, 3) << "incorrect value for last_msg_.states[0].fcn, expected 3, is " << last_msg_.states[0].fcn; - EXPECT_EQ(last_msg_.states[0].sid.code, 184) << "incorrect value for last_msg_.states[0].sid.code, expected 184, is " << last_msg_.states[0].sid.code; - EXPECT_EQ(last_msg_.states[0].sid.sat, 117) << "incorrect value for last_msg_.states[0].sid.sat, expected 117, is " << last_msg_.states[0].sid.sat; - EXPECT_EQ(last_msg_.states[1].cn0, 141) << "incorrect value for last_msg_.states[1].cn0, expected 141, is " << last_msg_.states[1].cn0; - EXPECT_EQ(last_msg_.states[1].fcn, 140) << "incorrect value for last_msg_.states[1].fcn, expected 140, is " << last_msg_.states[1].fcn; - EXPECT_EQ(last_msg_.states[1].sid.code, 106) << "incorrect value for last_msg_.states[1].sid.code, expected 106, is " << last_msg_.states[1].sid.code; - EXPECT_EQ(last_msg_.states[1].sid.sat, 38) << "incorrect value for last_msg_.states[1].sid.sat, expected 38, is " << last_msg_.states[1].sid.sat; - EXPECT_EQ(last_msg_.states[2].cn0, 195) << "incorrect value for last_msg_.states[2].cn0, expected 195, is " << last_msg_.states[2].cn0; - EXPECT_EQ(last_msg_.states[2].fcn, 90) << "incorrect value for last_msg_.states[2].fcn, expected 90, is " << last_msg_.states[2].fcn; - EXPECT_EQ(last_msg_.states[2].sid.code, 4) << "incorrect value for last_msg_.states[2].sid.code, expected 4, is " << last_msg_.states[2].sid.code; - EXPECT_EQ(last_msg_.states[2].sid.sat, 25) << "incorrect value for last_msg_.states[2].sid.sat, expected 25, is " << last_msg_.states[2].sid.sat; - EXPECT_EQ(last_msg_.states[3].cn0, 82) << "incorrect value for last_msg_.states[3].cn0, expected 82, is " << last_msg_.states[3].cn0; - EXPECT_EQ(last_msg_.states[3].fcn, 75) << "incorrect value for last_msg_.states[3].fcn, expected 75, is " << last_msg_.states[3].fcn; - EXPECT_EQ(last_msg_.states[3].sid.code, 108) << "incorrect value for last_msg_.states[3].sid.code, expected 108, is " << last_msg_.states[3].sid.code; - EXPECT_EQ(last_msg_.states[3].sid.sat, 246) << "incorrect value for last_msg_.states[3].sid.sat, expected 246, is " << last_msg_.states[3].sid.sat; - EXPECT_EQ(last_msg_.states[4].cn0, 163) << "incorrect value for last_msg_.states[4].cn0, expected 163, is " << last_msg_.states[4].cn0; - EXPECT_EQ(last_msg_.states[4].fcn, 45) << "incorrect value for last_msg_.states[4].fcn, expected 45, is " << last_msg_.states[4].fcn; - EXPECT_EQ(last_msg_.states[4].sid.code, 127) << "incorrect value for last_msg_.states[4].sid.code, expected 127, is " << last_msg_.states[4].sid.code; - EXPECT_EQ(last_msg_.states[4].sid.sat, 137) << "incorrect value for last_msg_.states[4].sid.sat, expected 137, is " << last_msg_.states[4].sid.sat; - EXPECT_EQ(last_msg_.states[5].cn0, 93) << "incorrect value for last_msg_.states[5].cn0, expected 93, is " << last_msg_.states[5].cn0; - EXPECT_EQ(last_msg_.states[5].fcn, 187) << "incorrect value for last_msg_.states[5].fcn, expected 187, is " << last_msg_.states[5].fcn; - EXPECT_EQ(last_msg_.states[5].sid.code, 46) << "incorrect value for last_msg_.states[5].sid.code, expected 46, is " << last_msg_.states[5].sid.code; - EXPECT_EQ(last_msg_.states[5].sid.sat, 32) << "incorrect value for last_msg_.states[5].sid.sat, expected 32, is " << last_msg_.states[5].sid.sat; - EXPECT_EQ(last_msg_.states[6].cn0, 147) << "incorrect value for last_msg_.states[6].cn0, expected 147, is " << last_msg_.states[6].cn0; - EXPECT_EQ(last_msg_.states[6].fcn, 201) << "incorrect value for last_msg_.states[6].fcn, expected 201, is " << last_msg_.states[6].fcn; - EXPECT_EQ(last_msg_.states[6].sid.code, 60) << "incorrect value for last_msg_.states[6].sid.code, expected 60, is " << last_msg_.states[6].sid.code; - EXPECT_EQ(last_msg_.states[6].sid.sat, 153) << "incorrect value for last_msg_.states[6].sid.sat, expected 153, is " << last_msg_.states[6].sid.sat; - EXPECT_EQ(last_msg_.states[7].cn0, 208) << "incorrect value for last_msg_.states[7].cn0, expected 208, is " << last_msg_.states[7].cn0; - EXPECT_EQ(last_msg_.states[7].fcn, 5) << "incorrect value for last_msg_.states[7].fcn, expected 5, is " << last_msg_.states[7].fcn; - EXPECT_EQ(last_msg_.states[7].sid.code, 29) << "incorrect value for last_msg_.states[7].sid.code, expected 29, is " << last_msg_.states[7].sid.code; - EXPECT_EQ(last_msg_.states[7].sid.sat, 23) << "incorrect value for last_msg_.states[7].sid.sat, expected 23, is " << last_msg_.states[7].sid.sat; - EXPECT_EQ(last_msg_.states[8].cn0, 69) << "incorrect value for last_msg_.states[8].cn0, expected 69, is " << last_msg_.states[8].cn0; - EXPECT_EQ(last_msg_.states[8].fcn, 219) << "incorrect value for last_msg_.states[8].fcn, expected 219, is " << last_msg_.states[8].fcn; - EXPECT_EQ(last_msg_.states[8].sid.code, 30) << "incorrect value for last_msg_.states[8].sid.code, expected 30, is " << last_msg_.states[8].sid.code; - EXPECT_EQ(last_msg_.states[8].sid.sat, 181) << "incorrect value for last_msg_.states[8].sid.sat, expected 181, is " << last_msg_.states[8].sid.sat; - EXPECT_EQ(last_msg_.states[9].cn0, 121) << "incorrect value for last_msg_.states[9].cn0, expected 121, is " << last_msg_.states[9].cn0; - EXPECT_EQ(last_msg_.states[9].fcn, 3) << "incorrect value for last_msg_.states[9].fcn, expected 3, is " << last_msg_.states[9].fcn; - EXPECT_EQ(last_msg_.states[9].sid.code, 136) << "incorrect value for last_msg_.states[9].sid.code, expected 136, is " << last_msg_.states[9].sid.code; - EXPECT_EQ(last_msg_.states[9].sid.sat, 254) << "incorrect value for last_msg_.states[9].sid.sat, expected 254, is " << last_msg_.states[9].sid.sat; - EXPECT_EQ(last_msg_.states[10].cn0, 215) << "incorrect value for last_msg_.states[10].cn0, expected 215, is " << last_msg_.states[10].cn0; - EXPECT_EQ(last_msg_.states[10].fcn, 144) << "incorrect value for last_msg_.states[10].fcn, expected 144, is " << last_msg_.states[10].fcn; - EXPECT_EQ(last_msg_.states[10].sid.code, 98) << "incorrect value for last_msg_.states[10].sid.code, expected 98, is " << last_msg_.states[10].sid.code; - EXPECT_EQ(last_msg_.states[10].sid.sat, 33) << "incorrect value for last_msg_.states[10].sid.sat, expected 33, is " << last_msg_.states[10].sid.sat; - EXPECT_EQ(last_msg_.states[11].cn0, 56) << "incorrect value for last_msg_.states[11].cn0, expected 56, is " << last_msg_.states[11].cn0; - EXPECT_EQ(last_msg_.states[11].fcn, 14) << "incorrect value for last_msg_.states[11].fcn, expected 14, is " << last_msg_.states[11].fcn; - EXPECT_EQ(last_msg_.states[11].sid.code, 182) << "incorrect value for last_msg_.states[11].sid.code, expected 182, is " << last_msg_.states[11].sid.code; - EXPECT_EQ(last_msg_.states[11].sid.sat, 133) << "incorrect value for last_msg_.states[11].sid.sat, expected 133, is " << last_msg_.states[11].sid.sat; - EXPECT_EQ(last_msg_.states[12].cn0, 62) << "incorrect value for last_msg_.states[12].cn0, expected 62, is " << last_msg_.states[12].cn0; - EXPECT_EQ(last_msg_.states[12].fcn, 218) << "incorrect value for last_msg_.states[12].fcn, expected 218, is " << last_msg_.states[12].fcn; - EXPECT_EQ(last_msg_.states[12].sid.code, 77) << "incorrect value for last_msg_.states[12].sid.code, expected 77, is " << last_msg_.states[12].sid.code; - EXPECT_EQ(last_msg_.states[12].sid.sat, 169) << "incorrect value for last_msg_.states[12].sid.sat, expected 169, is " << last_msg_.states[12].sid.sat; - EXPECT_EQ(last_msg_.states[13].cn0, 249) << "incorrect value for last_msg_.states[13].cn0, expected 249, is " << last_msg_.states[13].cn0; - EXPECT_EQ(last_msg_.states[13].fcn, 171) << "incorrect value for last_msg_.states[13].fcn, expected 171, is " << last_msg_.states[13].fcn; - EXPECT_EQ(last_msg_.states[13].sid.code, 84) << "incorrect value for last_msg_.states[13].sid.code, expected 84, is " << last_msg_.states[13].sid.code; - EXPECT_EQ(last_msg_.states[13].sid.sat, 242) << "incorrect value for last_msg_.states[13].sid.sat, expected 242, is " << last_msg_.states[13].sid.sat; - EXPECT_EQ(last_msg_.states[14].cn0, 130) << "incorrect value for last_msg_.states[14].cn0, expected 130, is " << last_msg_.states[14].cn0; - EXPECT_EQ(last_msg_.states[14].fcn, 131) << "incorrect value for last_msg_.states[14].fcn, expected 131, is " << last_msg_.states[14].fcn; - EXPECT_EQ(last_msg_.states[14].sid.code, 137) << "incorrect value for last_msg_.states[14].sid.code, expected 137, is " << last_msg_.states[14].sid.code; - EXPECT_EQ(last_msg_.states[14].sid.sat, 152) << "incorrect value for last_msg_.states[14].sid.sat, expected 152, is " << last_msg_.states[14].sid.sat; - EXPECT_EQ(last_msg_.states[15].cn0, 68) << "incorrect value for last_msg_.states[15].cn0, expected 68, is " << last_msg_.states[15].cn0; - EXPECT_EQ(last_msg_.states[15].fcn, 42) << "incorrect value for last_msg_.states[15].fcn, expected 42, is " << last_msg_.states[15].fcn; - EXPECT_EQ(last_msg_.states[15].sid.code, 21) << "incorrect value for last_msg_.states[15].sid.code, expected 21, is " << last_msg_.states[15].sid.code; - EXPECT_EQ(last_msg_.states[15].sid.sat, 193) << "incorrect value for last_msg_.states[15].sid.sat, expected 193, is " << last_msg_.states[15].sid.sat; - EXPECT_EQ(last_msg_.states[16].cn0, 227) << "incorrect value for last_msg_.states[16].cn0, expected 227, is " << last_msg_.states[16].cn0; - EXPECT_EQ(last_msg_.states[16].fcn, 216) << "incorrect value for last_msg_.states[16].fcn, expected 216, is " << last_msg_.states[16].fcn; - EXPECT_EQ(last_msg_.states[16].sid.code, 227) << "incorrect value for last_msg_.states[16].sid.code, expected 227, is " << last_msg_.states[16].sid.code; - EXPECT_EQ(last_msg_.states[16].sid.sat, 253) << "incorrect value for last_msg_.states[16].sid.sat, expected 253, is " << last_msg_.states[16].sid.sat; - EXPECT_EQ(last_msg_.states[17].cn0, 179) << "incorrect value for last_msg_.states[17].cn0, expected 179, is " << last_msg_.states[17].cn0; - EXPECT_EQ(last_msg_.states[17].fcn, 210) << "incorrect value for last_msg_.states[17].fcn, expected 210, is " << last_msg_.states[17].fcn; - EXPECT_EQ(last_msg_.states[17].sid.code, 26) << "incorrect value for last_msg_.states[17].sid.code, expected 26, is " << last_msg_.states[17].sid.code; - EXPECT_EQ(last_msg_.states[17].sid.sat, 24) << "incorrect value for last_msg_.states[17].sid.sat, expected 24, is " << last_msg_.states[17].sid.sat; - EXPECT_EQ(last_msg_.states[18].cn0, 255) << "incorrect value for last_msg_.states[18].cn0, expected 255, is " << last_msg_.states[18].cn0; - EXPECT_EQ(last_msg_.states[18].fcn, 227) << "incorrect value for last_msg_.states[18].fcn, expected 227, is " << last_msg_.states[18].fcn; - EXPECT_EQ(last_msg_.states[18].sid.code, 15) << "incorrect value for last_msg_.states[18].sid.code, expected 15, is " << last_msg_.states[18].sid.code; - EXPECT_EQ(last_msg_.states[18].sid.sat, 19) << "incorrect value for last_msg_.states[18].sid.sat, expected 19, is " << last_msg_.states[18].sid.sat; - EXPECT_EQ(last_msg_.states[19].cn0, 200) << "incorrect value for last_msg_.states[19].cn0, expected 200, is " << last_msg_.states[19].cn0; - EXPECT_EQ(last_msg_.states[19].fcn, 187) << "incorrect value for last_msg_.states[19].fcn, expected 187, is " << last_msg_.states[19].fcn; - EXPECT_EQ(last_msg_.states[19].sid.code, 75) << "incorrect value for last_msg_.states[19].sid.code, expected 75, is " << last_msg_.states[19].sid.code; - EXPECT_EQ(last_msg_.states[19].sid.sat, 122) << "incorrect value for last_msg_.states[19].sid.sat, expected 122, is " << last_msg_.states[19].sid.sat; - EXPECT_EQ(last_msg_.states[20].cn0, 122) << "incorrect value for last_msg_.states[20].cn0, expected 122, is " << last_msg_.states[20].cn0; - EXPECT_EQ(last_msg_.states[20].fcn, 218) << "incorrect value for last_msg_.states[20].fcn, expected 218, is " << last_msg_.states[20].fcn; - EXPECT_EQ(last_msg_.states[20].sid.code, 48) << "incorrect value for last_msg_.states[20].sid.code, expected 48, is " << last_msg_.states[20].sid.code; - EXPECT_EQ(last_msg_.states[20].sid.sat, 217) << "incorrect value for last_msg_.states[20].sid.sat, expected 217, is " << last_msg_.states[20].sid.sat; - EXPECT_EQ(last_msg_.states[21].cn0, 149) << "incorrect value for last_msg_.states[21].cn0, expected 149, is " << last_msg_.states[21].cn0; - EXPECT_EQ(last_msg_.states[21].fcn, 142) << "incorrect value for last_msg_.states[21].fcn, expected 142, is " << last_msg_.states[21].fcn; - EXPECT_EQ(last_msg_.states[21].sid.code, 238) << "incorrect value for last_msg_.states[21].sid.code, expected 238, is " << last_msg_.states[21].sid.code; - EXPECT_EQ(last_msg_.states[21].sid.sat, 187) << "incorrect value for last_msg_.states[21].sid.sat, expected 187, is " << last_msg_.states[21].sid.sat; - EXPECT_EQ(last_msg_.states[22].cn0, 212) << "incorrect value for last_msg_.states[22].cn0, expected 212, is " << last_msg_.states[22].cn0; - EXPECT_EQ(last_msg_.states[22].fcn, 251) << "incorrect value for last_msg_.states[22].fcn, expected 251, is " << last_msg_.states[22].fcn; - EXPECT_EQ(last_msg_.states[22].sid.code, 55) << "incorrect value for last_msg_.states[22].sid.code, expected 55, is " << last_msg_.states[22].sid.code; - EXPECT_EQ(last_msg_.states[22].sid.sat, 238) << "incorrect value for last_msg_.states[22].sid.sat, expected 238, is " << last_msg_.states[22].sid.sat; - EXPECT_EQ(last_msg_.states[23].cn0, 104) << "incorrect value for last_msg_.states[23].cn0, expected 104, is " << last_msg_.states[23].cn0; - EXPECT_EQ(last_msg_.states[23].fcn, 194) << "incorrect value for last_msg_.states[23].fcn, expected 194, is " << last_msg_.states[23].fcn; - EXPECT_EQ(last_msg_.states[23].sid.code, 160) << "incorrect value for last_msg_.states[23].sid.code, expected 160, is " << last_msg_.states[23].sid.code; - EXPECT_EQ(last_msg_.states[23].sid.sat, 128) << "incorrect value for last_msg_.states[23].sid.sat, expected 128, is " << last_msg_.states[23].sid.sat; - EXPECT_EQ(last_msg_.states[24].cn0, 62) << "incorrect value for last_msg_.states[24].cn0, expected 62, is " << last_msg_.states[24].cn0; - EXPECT_EQ(last_msg_.states[24].fcn, 141) << "incorrect value for last_msg_.states[24].fcn, expected 141, is " << last_msg_.states[24].fcn; - EXPECT_EQ(last_msg_.states[24].sid.code, 255) << "incorrect value for last_msg_.states[24].sid.code, expected 255, is " << last_msg_.states[24].sid.code; - EXPECT_EQ(last_msg_.states[24].sid.sat, 113) << "incorrect value for last_msg_.states[24].sid.sat, expected 113, is " << last_msg_.states[24].sid.sat; - EXPECT_EQ(last_msg_.states[25].cn0, 39) << "incorrect value for last_msg_.states[25].cn0, expected 39, is " << last_msg_.states[25].cn0; - EXPECT_EQ(last_msg_.states[25].fcn, 245) << "incorrect value for last_msg_.states[25].fcn, expected 245, is " << last_msg_.states[25].fcn; - EXPECT_EQ(last_msg_.states[25].sid.code, 69) << "incorrect value for last_msg_.states[25].sid.code, expected 69, is " << last_msg_.states[25].sid.code; - EXPECT_EQ(last_msg_.states[25].sid.sat, 43) << "incorrect value for last_msg_.states[25].sid.sat, expected 43, is " << last_msg_.states[25].sid.sat; - EXPECT_EQ(last_msg_.states[26].cn0, 56) << "incorrect value for last_msg_.states[26].cn0, expected 56, is " << last_msg_.states[26].cn0; - EXPECT_EQ(last_msg_.states[26].fcn, 108) << "incorrect value for last_msg_.states[26].fcn, expected 108, is " << last_msg_.states[26].fcn; - EXPECT_EQ(last_msg_.states[26].sid.code, 230) << "incorrect value for last_msg_.states[26].sid.code, expected 230, is " << last_msg_.states[26].sid.code; - EXPECT_EQ(last_msg_.states[26].sid.sat, 100) << "incorrect value for last_msg_.states[26].sid.sat, expected 100, is " << last_msg_.states[26].sid.sat; - EXPECT_EQ(last_msg_.states[27].cn0, 143) << "incorrect value for last_msg_.states[27].cn0, expected 143, is " << last_msg_.states[27].cn0; - EXPECT_EQ(last_msg_.states[27].fcn, 149) << "incorrect value for last_msg_.states[27].fcn, expected 149, is " << last_msg_.states[27].fcn; - EXPECT_EQ(last_msg_.states[27].sid.code, 68) << "incorrect value for last_msg_.states[27].sid.code, expected 68, is " << last_msg_.states[27].sid.code; - EXPECT_EQ(last_msg_.states[27].sid.sat, 247) << "incorrect value for last_msg_.states[27].sid.sat, expected 247, is " << last_msg_.states[27].sid.sat; - EXPECT_EQ(last_msg_.states[28].cn0, 70) << "incorrect value for last_msg_.states[28].cn0, expected 70, is " << last_msg_.states[28].cn0; - EXPECT_EQ(last_msg_.states[28].fcn, 233) << "incorrect value for last_msg_.states[28].fcn, expected 233, is " << last_msg_.states[28].fcn; - EXPECT_EQ(last_msg_.states[28].sid.code, 101) << "incorrect value for last_msg_.states[28].sid.code, expected 101, is " << last_msg_.states[28].sid.code; - EXPECT_EQ(last_msg_.states[28].sid.sat, 137) << "incorrect value for last_msg_.states[28].sid.sat, expected 137, is " << last_msg_.states[28].sid.sat; - EXPECT_EQ(last_msg_.states[29].cn0, 110) << "incorrect value for last_msg_.states[29].cn0, expected 110, is " << last_msg_.states[29].cn0; - EXPECT_EQ(last_msg_.states[29].fcn, 38) << "incorrect value for last_msg_.states[29].fcn, expected 38, is " << last_msg_.states[29].fcn; - EXPECT_EQ(last_msg_.states[29].sid.code, 165) << "incorrect value for last_msg_.states[29].sid.code, expected 165, is " << last_msg_.states[29].sid.code; - EXPECT_EQ(last_msg_.states[29].sid.sat, 49) << "incorrect value for last_msg_.states[29].sid.sat, expected 49, is " << last_msg_.states[29].sid.sat; - EXPECT_EQ(last_msg_.states[30].cn0, 213) << "incorrect value for last_msg_.states[30].cn0, expected 213, is " << last_msg_.states[30].cn0; - EXPECT_EQ(last_msg_.states[30].fcn, 80) << "incorrect value for last_msg_.states[30].fcn, expected 80, is " << last_msg_.states[30].fcn; - EXPECT_EQ(last_msg_.states[30].sid.code, 230) << "incorrect value for last_msg_.states[30].sid.code, expected 230, is " << last_msg_.states[30].sid.code; - EXPECT_EQ(last_msg_.states[30].sid.sat, 218) << "incorrect value for last_msg_.states[30].sid.sat, expected 218, is " << last_msg_.states[30].sid.sat; - EXPECT_EQ(last_msg_.states[31].cn0, 128) << "incorrect value for last_msg_.states[31].cn0, expected 128, is " << last_msg_.states[31].cn0; - EXPECT_EQ(last_msg_.states[31].fcn, 139) << "incorrect value for last_msg_.states[31].fcn, expected 139, is " << last_msg_.states[31].fcn; - EXPECT_EQ(last_msg_.states[31].sid.code, 179) << "incorrect value for last_msg_.states[31].sid.code, expected 179, is " << last_msg_.states[31].sid.code; - EXPECT_EQ(last_msg_.states[31].sid.sat, 196) << "incorrect value for last_msg_.states[31].sid.sat, expected 196, is " << last_msg_.states[31].sid.sat; - EXPECT_EQ(last_msg_.states[32].cn0, 171) << "incorrect value for last_msg_.states[32].cn0, expected 171, is " << last_msg_.states[32].cn0; - EXPECT_EQ(last_msg_.states[32].fcn, 196) << "incorrect value for last_msg_.states[32].fcn, expected 196, is " << last_msg_.states[32].fcn; - EXPECT_EQ(last_msg_.states[32].sid.code, 178) << "incorrect value for last_msg_.states[32].sid.code, expected 178, is " << last_msg_.states[32].sid.code; - EXPECT_EQ(last_msg_.states[32].sid.sat, 15) << "incorrect value for last_msg_.states[32].sid.sat, expected 15, is " << last_msg_.states[32].sid.sat; - EXPECT_EQ(last_msg_.states[33].cn0, 194) << "incorrect value for last_msg_.states[33].cn0, expected 194, is " << last_msg_.states[33].cn0; - EXPECT_EQ(last_msg_.states[33].fcn, 97) << "incorrect value for last_msg_.states[33].fcn, expected 97, is " << last_msg_.states[33].fcn; - EXPECT_EQ(last_msg_.states[33].sid.code, 212) << "incorrect value for last_msg_.states[33].sid.code, expected 212, is " << last_msg_.states[33].sid.code; - EXPECT_EQ(last_msg_.states[33].sid.sat, 8) << "incorrect value for last_msg_.states[33].sid.sat, expected 8, is " << last_msg_.states[33].sid.sat; - EXPECT_EQ(last_msg_.states[34].cn0, 99) << "incorrect value for last_msg_.states[34].cn0, expected 99, is " << last_msg_.states[34].cn0; - EXPECT_EQ(last_msg_.states[34].fcn, 79) << "incorrect value for last_msg_.states[34].fcn, expected 79, is " << last_msg_.states[34].fcn; - EXPECT_EQ(last_msg_.states[34].sid.code, 233) << "incorrect value for last_msg_.states[34].sid.code, expected 233, is " << last_msg_.states[34].sid.code; - EXPECT_EQ(last_msg_.states[34].sid.sat, 83) << "incorrect value for last_msg_.states[34].sid.sat, expected 83, is " << last_msg_.states[34].sid.sat; - EXPECT_EQ(last_msg_.states[35].cn0, 180) << "incorrect value for last_msg_.states[35].cn0, expected 180, is " << last_msg_.states[35].cn0; - EXPECT_EQ(last_msg_.states[35].fcn, 31) << "incorrect value for last_msg_.states[35].fcn, expected 31, is " << last_msg_.states[35].fcn; - EXPECT_EQ(last_msg_.states[35].sid.code, 90) << "incorrect value for last_msg_.states[35].sid.code, expected 90, is " << last_msg_.states[35].sid.code; - EXPECT_EQ(last_msg_.states[35].sid.sat, 55) << "incorrect value for last_msg_.states[35].sid.sat, expected 55, is " << last_msg_.states[35].sid.sat; - EXPECT_EQ(last_msg_.states[36].cn0, 186) << "incorrect value for last_msg_.states[36].cn0, expected 186, is " << last_msg_.states[36].cn0; - EXPECT_EQ(last_msg_.states[36].fcn, 105) << "incorrect value for last_msg_.states[36].fcn, expected 105, is " << last_msg_.states[36].fcn; - EXPECT_EQ(last_msg_.states[36].sid.code, 25) << "incorrect value for last_msg_.states[36].sid.code, expected 25, is " << last_msg_.states[36].sid.code; - EXPECT_EQ(last_msg_.states[36].sid.sat, 5) << "incorrect value for last_msg_.states[36].sid.sat, expected 5, is " << last_msg_.states[36].sid.sat; - EXPECT_EQ(last_msg_.states[37].cn0, 111) << "incorrect value for last_msg_.states[37].cn0, expected 111, is " << last_msg_.states[37].cn0; - EXPECT_EQ(last_msg_.states[37].fcn, 80) << "incorrect value for last_msg_.states[37].fcn, expected 80, is " << last_msg_.states[37].fcn; - EXPECT_EQ(last_msg_.states[37].sid.code, 224) << "incorrect value for last_msg_.states[37].sid.code, expected 224, is " << last_msg_.states[37].sid.code; - EXPECT_EQ(last_msg_.states[37].sid.sat, 22) << "incorrect value for last_msg_.states[37].sid.sat, expected 22, is " << last_msg_.states[37].sid.sat; - EXPECT_EQ(last_msg_.states[38].cn0, 166) << "incorrect value for last_msg_.states[38].cn0, expected 166, is " << last_msg_.states[38].cn0; - EXPECT_EQ(last_msg_.states[38].fcn, 106) << "incorrect value for last_msg_.states[38].fcn, expected 106, is " << last_msg_.states[38].fcn; - EXPECT_EQ(last_msg_.states[38].sid.code, 48) << "incorrect value for last_msg_.states[38].sid.code, expected 48, is " << last_msg_.states[38].sid.code; - EXPECT_EQ(last_msg_.states[38].sid.sat, 8) << "incorrect value for last_msg_.states[38].sid.sat, expected 8, is " << last_msg_.states[38].sid.sat; - EXPECT_EQ(last_msg_.states[39].cn0, 49) << "incorrect value for last_msg_.states[39].cn0, expected 49, is " << last_msg_.states[39].cn0; - EXPECT_EQ(last_msg_.states[39].fcn, 156) << "incorrect value for last_msg_.states[39].fcn, expected 156, is " << last_msg_.states[39].fcn; - EXPECT_EQ(last_msg_.states[39].sid.code, 48) << "incorrect value for last_msg_.states[39].sid.code, expected 48, is " << last_msg_.states[39].sid.code; - EXPECT_EQ(last_msg_.states[39].sid.sat, 4) << "incorrect value for last_msg_.states[39].sid.sat, expected 4, is " << last_msg_.states[39].sid.sat; - EXPECT_EQ(last_msg_.states[40].cn0, 146) << "incorrect value for last_msg_.states[40].cn0, expected 146, is " << last_msg_.states[40].cn0; - EXPECT_EQ(last_msg_.states[40].fcn, 142) << "incorrect value for last_msg_.states[40].fcn, expected 142, is " << last_msg_.states[40].fcn; - EXPECT_EQ(last_msg_.states[40].sid.code, 19) << "incorrect value for last_msg_.states[40].sid.code, expected 19, is " << last_msg_.states[40].sid.code; - EXPECT_EQ(last_msg_.states[40].sid.sat, 86) << "incorrect value for last_msg_.states[40].sid.sat, expected 86, is " << last_msg_.states[40].sid.sat; - EXPECT_EQ(last_msg_.states[41].cn0, 64) << "incorrect value for last_msg_.states[41].cn0, expected 64, is " << last_msg_.states[41].cn0; - EXPECT_EQ(last_msg_.states[41].fcn, 115) << "incorrect value for last_msg_.states[41].fcn, expected 115, is " << last_msg_.states[41].fcn; - EXPECT_EQ(last_msg_.states[41].sid.code, 124) << "incorrect value for last_msg_.states[41].sid.code, expected 124, is " << last_msg_.states[41].sid.code; - EXPECT_EQ(last_msg_.states[41].sid.sat, 91) << "incorrect value for last_msg_.states[41].sid.sat, expected 91, is " << last_msg_.states[41].sid.sat; - EXPECT_EQ(last_msg_.states[42].cn0, 178) << "incorrect value for last_msg_.states[42].cn0, expected 178, is " << last_msg_.states[42].cn0; - EXPECT_EQ(last_msg_.states[42].fcn, 115) << "incorrect value for last_msg_.states[42].fcn, expected 115, is " << last_msg_.states[42].fcn; - EXPECT_EQ(last_msg_.states[42].sid.code, 230) << "incorrect value for last_msg_.states[42].sid.code, expected 230, is " << last_msg_.states[42].sid.code; - EXPECT_EQ(last_msg_.states[42].sid.sat, 28) << "incorrect value for last_msg_.states[42].sid.sat, expected 28, is " << last_msg_.states[42].sid.sat; - EXPECT_EQ(last_msg_.states[43].cn0, 242) << "incorrect value for last_msg_.states[43].cn0, expected 242, is " << last_msg_.states[43].cn0; - EXPECT_EQ(last_msg_.states[43].fcn, 16) << "incorrect value for last_msg_.states[43].fcn, expected 16, is " << last_msg_.states[43].fcn; - EXPECT_EQ(last_msg_.states[43].sid.code, 131) << "incorrect value for last_msg_.states[43].sid.code, expected 131, is " << last_msg_.states[43].sid.code; - EXPECT_EQ(last_msg_.states[43].sid.sat, 190) << "incorrect value for last_msg_.states[43].sid.sat, expected 190, is " << last_msg_.states[43].sid.sat; - EXPECT_EQ(last_msg_.states[44].cn0, 113) << "incorrect value for last_msg_.states[44].cn0, expected 113, is " << last_msg_.states[44].cn0; - EXPECT_EQ(last_msg_.states[44].fcn, 182) << "incorrect value for last_msg_.states[44].fcn, expected 182, is " << last_msg_.states[44].fcn; - EXPECT_EQ(last_msg_.states[44].sid.code, 59) << "incorrect value for last_msg_.states[44].sid.code, expected 59, is " << last_msg_.states[44].sid.code; - EXPECT_EQ(last_msg_.states[44].sid.sat, 105) << "incorrect value for last_msg_.states[44].sid.sat, expected 105, is " << last_msg_.states[44].sid.sat; - EXPECT_EQ(last_msg_.states[45].cn0, 179) << "incorrect value for last_msg_.states[45].cn0, expected 179, is " << last_msg_.states[45].cn0; - EXPECT_EQ(last_msg_.states[45].fcn, 48) << "incorrect value for last_msg_.states[45].fcn, expected 48, is " << last_msg_.states[45].fcn; - EXPECT_EQ(last_msg_.states[45].sid.code, 180) << "incorrect value for last_msg_.states[45].sid.code, expected 180, is " << last_msg_.states[45].sid.code; - EXPECT_EQ(last_msg_.states[45].sid.sat, 192) << "incorrect value for last_msg_.states[45].sid.sat, expected 192, is " << last_msg_.states[45].sid.sat; - EXPECT_EQ(last_msg_.states[46].cn0, 211) << "incorrect value for last_msg_.states[46].cn0, expected 211, is " << last_msg_.states[46].cn0; - EXPECT_EQ(last_msg_.states[46].fcn, 172) << "incorrect value for last_msg_.states[46].fcn, expected 172, is " << last_msg_.states[46].fcn; - EXPECT_EQ(last_msg_.states[46].sid.code, 31) << "incorrect value for last_msg_.states[46].sid.code, expected 31, is " << last_msg_.states[46].sid.code; - EXPECT_EQ(last_msg_.states[46].sid.sat, 166) << "incorrect value for last_msg_.states[46].sid.sat, expected 166, is " << last_msg_.states[46].sid.sat; - EXPECT_EQ(last_msg_.states[47].cn0, 49) << "incorrect value for last_msg_.states[47].cn0, expected 49, is " << last_msg_.states[47].cn0; - EXPECT_EQ(last_msg_.states[47].fcn, 140) << "incorrect value for last_msg_.states[47].fcn, expected 140, is " << last_msg_.states[47].fcn; - EXPECT_EQ(last_msg_.states[47].sid.code, 228) << "incorrect value for last_msg_.states[47].sid.code, expected 228, is " << last_msg_.states[47].sid.code; - EXPECT_EQ(last_msg_.states[47].sid.sat, 77) << "incorrect value for last_msg_.states[47].sid.sat, expected 77, is " << last_msg_.states[47].sid.sat; - EXPECT_EQ(last_msg_.states[48].cn0, 194) << "incorrect value for last_msg_.states[48].cn0, expected 194, is " << last_msg_.states[48].cn0; - EXPECT_EQ(last_msg_.states[48].fcn, 240) << "incorrect value for last_msg_.states[48].fcn, expected 240, is " << last_msg_.states[48].fcn; - EXPECT_EQ(last_msg_.states[48].sid.code, 77) << "incorrect value for last_msg_.states[48].sid.code, expected 77, is " << last_msg_.states[48].sid.code; - EXPECT_EQ(last_msg_.states[48].sid.sat, 128) << "incorrect value for last_msg_.states[48].sid.sat, expected 128, is " << last_msg_.states[48].sid.sat; - EXPECT_EQ(last_msg_.states[49].cn0, 58) << "incorrect value for last_msg_.states[49].cn0, expected 58, is " << last_msg_.states[49].cn0; - EXPECT_EQ(last_msg_.states[49].fcn, 41) << "incorrect value for last_msg_.states[49].fcn, expected 41, is " << last_msg_.states[49].fcn; - EXPECT_EQ(last_msg_.states[49].sid.code, 194) << "incorrect value for last_msg_.states[49].sid.code, expected 194, is " << last_msg_.states[49].sid.code; - EXPECT_EQ(last_msg_.states[49].sid.sat, 134) << "incorrect value for last_msg_.states[49].sid.sat, expected 134, is " << last_msg_.states[49].sid.sat; - EXPECT_EQ(last_msg_.states[50].cn0, 55) << "incorrect value for last_msg_.states[50].cn0, expected 55, is " << last_msg_.states[50].cn0; - EXPECT_EQ(last_msg_.states[50].fcn, 129) << "incorrect value for last_msg_.states[50].fcn, expected 129, is " << last_msg_.states[50].fcn; - EXPECT_EQ(last_msg_.states[50].sid.code, 53) << "incorrect value for last_msg_.states[50].sid.code, expected 53, is " << last_msg_.states[50].sid.code; - EXPECT_EQ(last_msg_.states[50].sid.sat, 18) << "incorrect value for last_msg_.states[50].sid.sat, expected 18, is " << last_msg_.states[50].sid.sat; - EXPECT_EQ(last_msg_.states[51].cn0, 92) << "incorrect value for last_msg_.states[51].cn0, expected 92, is " << last_msg_.states[51].cn0; - EXPECT_EQ(last_msg_.states[51].fcn, 134) << "incorrect value for last_msg_.states[51].fcn, expected 134, is " << last_msg_.states[51].fcn; - EXPECT_EQ(last_msg_.states[51].sid.code, 72) << "incorrect value for last_msg_.states[51].sid.code, expected 72, is " << last_msg_.states[51].sid.code; - EXPECT_EQ(last_msg_.states[51].sid.sat, 91) << "incorrect value for last_msg_.states[51].sid.sat, expected 91, is " << last_msg_.states[51].sid.sat; - EXPECT_EQ(last_msg_.states[52].cn0, 56) << "incorrect value for last_msg_.states[52].cn0, expected 56, is " << last_msg_.states[52].cn0; - EXPECT_EQ(last_msg_.states[52].fcn, 157) << "incorrect value for last_msg_.states[52].fcn, expected 157, is " << last_msg_.states[52].fcn; - EXPECT_EQ(last_msg_.states[52].sid.code, 224) << "incorrect value for last_msg_.states[52].sid.code, expected 224, is " << last_msg_.states[52].sid.code; - EXPECT_EQ(last_msg_.states[52].sid.sat, 33) << "incorrect value for last_msg_.states[52].sid.sat, expected 33, is " << last_msg_.states[52].sid.sat; - EXPECT_EQ(last_msg_.states[53].cn0, 174) << "incorrect value for last_msg_.states[53].cn0, expected 174, is " << last_msg_.states[53].cn0; - EXPECT_EQ(last_msg_.states[53].fcn, 224) << "incorrect value for last_msg_.states[53].fcn, expected 224, is " << last_msg_.states[53].fcn; - EXPECT_EQ(last_msg_.states[53].sid.code, 54) << "incorrect value for last_msg_.states[53].sid.code, expected 54, is " << last_msg_.states[53].sid.code; - EXPECT_EQ(last_msg_.states[53].sid.sat, 186) << "incorrect value for last_msg_.states[53].sid.sat, expected 186, is " << last_msg_.states[53].sid.sat; - EXPECT_EQ(last_msg_.states[54].cn0, 190) << "incorrect value for last_msg_.states[54].cn0, expected 190, is " << last_msg_.states[54].cn0; - EXPECT_EQ(last_msg_.states[54].fcn, 148) << "incorrect value for last_msg_.states[54].fcn, expected 148, is " << last_msg_.states[54].fcn; - EXPECT_EQ(last_msg_.states[54].sid.code, 84) << "incorrect value for last_msg_.states[54].sid.code, expected 84, is " << last_msg_.states[54].sid.code; - EXPECT_EQ(last_msg_.states[54].sid.sat, 82) << "incorrect value for last_msg_.states[54].sid.sat, expected 82, is " << last_msg_.states[54].sid.sat; - EXPECT_EQ(last_msg_.states[55].cn0, 67) << "incorrect value for last_msg_.states[55].cn0, expected 67, is " << last_msg_.states[55].cn0; - EXPECT_EQ(last_msg_.states[55].fcn, 62) << "incorrect value for last_msg_.states[55].fcn, expected 62, is " << last_msg_.states[55].fcn; - EXPECT_EQ(last_msg_.states[55].sid.code, 54) << "incorrect value for last_msg_.states[55].sid.code, expected 54, is " << last_msg_.states[55].sid.code; - EXPECT_EQ(last_msg_.states[55].sid.sat, 236) << "incorrect value for last_msg_.states[55].sid.sat, expected 236, is " << last_msg_.states[55].sid.sat; - EXPECT_EQ(last_msg_.states[56].cn0, 254) << "incorrect value for last_msg_.states[56].cn0, expected 254, is " << last_msg_.states[56].cn0; - EXPECT_EQ(last_msg_.states[56].fcn, 57) << "incorrect value for last_msg_.states[56].fcn, expected 57, is " << last_msg_.states[56].fcn; - EXPECT_EQ(last_msg_.states[56].sid.code, 215) << "incorrect value for last_msg_.states[56].sid.code, expected 215, is " << last_msg_.states[56].sid.code; - EXPECT_EQ(last_msg_.states[56].sid.sat, 52) << "incorrect value for last_msg_.states[56].sid.sat, expected 52, is " << last_msg_.states[56].sid.sat; - EXPECT_EQ(last_msg_.states[57].cn0, 174) << "incorrect value for last_msg_.states[57].cn0, expected 174, is " << last_msg_.states[57].cn0; - EXPECT_EQ(last_msg_.states[57].fcn, 36) << "incorrect value for last_msg_.states[57].fcn, expected 36, is " << last_msg_.states[57].fcn; - EXPECT_EQ(last_msg_.states[57].sid.code, 133) << "incorrect value for last_msg_.states[57].sid.code, expected 133, is " << last_msg_.states[57].sid.code; - EXPECT_EQ(last_msg_.states[57].sid.sat, 16) << "incorrect value for last_msg_.states[57].sid.sat, expected 16, is " << last_msg_.states[57].sid.sat; - EXPECT_EQ(last_msg_.states[58].cn0, 17) << "incorrect value for last_msg_.states[58].cn0, expected 17, is " << last_msg_.states[58].cn0; - EXPECT_EQ(last_msg_.states[58].fcn, 145) << "incorrect value for last_msg_.states[58].fcn, expected 145, is " << last_msg_.states[58].fcn; - EXPECT_EQ(last_msg_.states[58].sid.code, 172) << "incorrect value for last_msg_.states[58].sid.code, expected 172, is " << last_msg_.states[58].sid.code; - EXPECT_EQ(last_msg_.states[58].sid.sat, 219) << "incorrect value for last_msg_.states[58].sid.sat, expected 219, is " << last_msg_.states[58].sid.sat; - EXPECT_EQ(last_msg_.states[59].cn0, 97) << "incorrect value for last_msg_.states[59].cn0, expected 97, is " << last_msg_.states[59].cn0; - EXPECT_EQ(last_msg_.states[59].fcn, 111) << "incorrect value for last_msg_.states[59].fcn, expected 111, is " << last_msg_.states[59].fcn; - EXPECT_EQ(last_msg_.states[59].sid.code, 179) << "incorrect value for last_msg_.states[59].sid.code, expected 179, is " << last_msg_.states[59].sid.code; - EXPECT_EQ(last_msg_.states[59].sid.sat, 192) << "incorrect value for last_msg_.states[59].sid.sat, expected 192, is " << last_msg_.states[59].sid.sat; - EXPECT_EQ(last_msg_.states[60].cn0, 134) << "incorrect value for last_msg_.states[60].cn0, expected 134, is " << last_msg_.states[60].cn0; - EXPECT_EQ(last_msg_.states[60].fcn, 208) << "incorrect value for last_msg_.states[60].fcn, expected 208, is " << last_msg_.states[60].fcn; - EXPECT_EQ(last_msg_.states[60].sid.code, 56) << "incorrect value for last_msg_.states[60].sid.code, expected 56, is " << last_msg_.states[60].sid.code; - EXPECT_EQ(last_msg_.states[60].sid.sat, 207) << "incorrect value for last_msg_.states[60].sid.sat, expected 207, is " << last_msg_.states[60].sid.sat; - EXPECT_EQ(last_msg_.states[61].cn0, 226) << "incorrect value for last_msg_.states[61].cn0, expected 226, is " << last_msg_.states[61].cn0; - EXPECT_EQ(last_msg_.states[61].fcn, 43) << "incorrect value for last_msg_.states[61].fcn, expected 43, is " << last_msg_.states[61].fcn; - EXPECT_EQ(last_msg_.states[61].sid.code, 17) << "incorrect value for last_msg_.states[61].sid.code, expected 17, is " << last_msg_.states[61].sid.code; - EXPECT_EQ(last_msg_.states[61].sid.sat, 180) << "incorrect value for last_msg_.states[61].sid.sat, expected 180, is " << last_msg_.states[61].sid.sat; - EXPECT_EQ(last_msg_.states[62].cn0, 113) << "incorrect value for last_msg_.states[62].cn0, expected 113, is " << last_msg_.states[62].cn0; - EXPECT_EQ(last_msg_.states[62].fcn, 140) << "incorrect value for last_msg_.states[62].fcn, expected 140, is " << last_msg_.states[62].fcn; - EXPECT_EQ(last_msg_.states[62].sid.code, 182) << "incorrect value for last_msg_.states[62].sid.code, expected 182, is " << last_msg_.states[62].sid.code; - EXPECT_EQ(last_msg_.states[62].sid.sat, 255) << "incorrect value for last_msg_.states[62].sid.sat, expected 255, is " << last_msg_.states[62].sid.sat; +}; + +TEST_F(Test_auto_check_sbp_tracking_MsgTrackingState0, Test) { + uint8_t encoded_frame[] = { + 85, 65, 0, 55, 129, 252, 117, 184, 3, 102, 38, 106, 140, 141, 25, + 4, 90, 195, 246, 108, 75, 82, 137, 127, 45, 163, 32, 46, 187, 93, + 153, 60, 201, 147, 23, 29, 5, 208, 181, 30, 219, 69, 254, 136, 3, + 121, 33, 98, 144, 215, 133, 182, 14, 56, 169, 77, 218, 62, 242, 84, + 171, 249, 152, 137, 131, 130, 193, 21, 42, 68, 253, 227, 216, 227, 24, + 26, 210, 179, 19, 15, 227, 255, 122, 75, 187, 200, 217, 48, 218, 122, + 187, 238, 142, 149, 238, 55, 251, 212, 128, 160, 194, 104, 113, 255, 141, + 62, 43, 69, 245, 39, 100, 230, 108, 56, 247, 68, 149, 143, 137, 101, + 233, 70, 49, 165, 38, 110, 218, 230, 80, 213, 196, 179, 139, 128, 15, + 178, 196, 171, 8, 212, 97, 194, 83, 233, 79, 99, 55, 90, 31, 180, + 5, 25, 105, 186, 22, 224, 80, 111, 8, 48, 106, 166, 4, 48, 156, + 49, 86, 19, 142, 146, 91, 124, 115, 64, 28, 230, 115, 178, 190, 131, + 16, 242, 105, 59, 182, 113, 192, 180, 48, 179, 166, 31, 172, 211, 77, + 228, 140, 49, 128, 77, 240, 194, 134, 194, 41, 58, 18, 53, 129, 55, + 91, 72, 134, 92, 33, 224, 157, 56, 186, 54, 224, 174, 82, 84, 148, + 190, 236, 54, 62, 67, 52, 215, 57, 254, 16, 133, 36, 174, 219, 172, + 145, 17, 192, 179, 111, 97, 207, 56, 208, 134, 180, 17, 43, 226, 255, + 182, 140, 113, 141, 111, + }; + + sbp_msg_tracking_state_t test_msg{}; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_states.value = 63; + + test_msg.states[0].cn0 = 102; + test_msg.states[0].fcn = 3; + test_msg.states[0].sid.code = 184; + test_msg.states[0].sid.sat = 117; + + test_msg.states[1].cn0 = 141; + test_msg.states[1].fcn = 140; + test_msg.states[1].sid.code = 106; + test_msg.states[1].sid.sat = 38; + + test_msg.states[2].cn0 = 195; + test_msg.states[2].fcn = 90; + test_msg.states[2].sid.code = 4; + test_msg.states[2].sid.sat = 25; + + test_msg.states[3].cn0 = 82; + test_msg.states[3].fcn = 75; + test_msg.states[3].sid.code = 108; + test_msg.states[3].sid.sat = 246; + + test_msg.states[4].cn0 = 163; + test_msg.states[4].fcn = 45; + test_msg.states[4].sid.code = 127; + test_msg.states[4].sid.sat = 137; + + test_msg.states[5].cn0 = 93; + test_msg.states[5].fcn = 187; + test_msg.states[5].sid.code = 46; + test_msg.states[5].sid.sat = 32; + + test_msg.states[6].cn0 = 147; + test_msg.states[6].fcn = 201; + test_msg.states[6].sid.code = 60; + test_msg.states[6].sid.sat = 153; + + test_msg.states[7].cn0 = 208; + test_msg.states[7].fcn = 5; + test_msg.states[7].sid.code = 29; + test_msg.states[7].sid.sat = 23; + + test_msg.states[8].cn0 = 69; + test_msg.states[8].fcn = 219; + test_msg.states[8].sid.code = 30; + test_msg.states[8].sid.sat = 181; + + test_msg.states[9].cn0 = 121; + test_msg.states[9].fcn = 3; + test_msg.states[9].sid.code = 136; + test_msg.states[9].sid.sat = 254; + + test_msg.states[10].cn0 = 215; + test_msg.states[10].fcn = 144; + test_msg.states[10].sid.code = 98; + test_msg.states[10].sid.sat = 33; + + test_msg.states[11].cn0 = 56; + test_msg.states[11].fcn = 14; + test_msg.states[11].sid.code = 182; + test_msg.states[11].sid.sat = 133; + + test_msg.states[12].cn0 = 62; + test_msg.states[12].fcn = 218; + test_msg.states[12].sid.code = 77; + test_msg.states[12].sid.sat = 169; + + test_msg.states[13].cn0 = 249; + test_msg.states[13].fcn = 171; + test_msg.states[13].sid.code = 84; + test_msg.states[13].sid.sat = 242; + + test_msg.states[14].cn0 = 130; + test_msg.states[14].fcn = 131; + test_msg.states[14].sid.code = 137; + test_msg.states[14].sid.sat = 152; + + test_msg.states[15].cn0 = 68; + test_msg.states[15].fcn = 42; + test_msg.states[15].sid.code = 21; + test_msg.states[15].sid.sat = 193; + + test_msg.states[16].cn0 = 227; + test_msg.states[16].fcn = 216; + test_msg.states[16].sid.code = 227; + test_msg.states[16].sid.sat = 253; + + test_msg.states[17].cn0 = 179; + test_msg.states[17].fcn = 210; + test_msg.states[17].sid.code = 26; + test_msg.states[17].sid.sat = 24; + + test_msg.states[18].cn0 = 255; + test_msg.states[18].fcn = 227; + test_msg.states[18].sid.code = 15; + test_msg.states[18].sid.sat = 19; + + test_msg.states[19].cn0 = 200; + test_msg.states[19].fcn = 187; + test_msg.states[19].sid.code = 75; + test_msg.states[19].sid.sat = 122; + + test_msg.states[20].cn0 = 122; + test_msg.states[20].fcn = 218; + test_msg.states[20].sid.code = 48; + test_msg.states[20].sid.sat = 217; + + test_msg.states[21].cn0 = 149; + test_msg.states[21].fcn = 142; + test_msg.states[21].sid.code = 238; + test_msg.states[21].sid.sat = 187; + + test_msg.states[22].cn0 = 212; + test_msg.states[22].fcn = 251; + test_msg.states[22].sid.code = 55; + test_msg.states[22].sid.sat = 238; + + test_msg.states[23].cn0 = 104; + test_msg.states[23].fcn = 194; + test_msg.states[23].sid.code = 160; + test_msg.states[23].sid.sat = 128; + + test_msg.states[24].cn0 = 62; + test_msg.states[24].fcn = 141; + test_msg.states[24].sid.code = 255; + test_msg.states[24].sid.sat = 113; + + test_msg.states[25].cn0 = 39; + test_msg.states[25].fcn = 245; + test_msg.states[25].sid.code = 69; + test_msg.states[25].sid.sat = 43; + + test_msg.states[26].cn0 = 56; + test_msg.states[26].fcn = 108; + test_msg.states[26].sid.code = 230; + test_msg.states[26].sid.sat = 100; + + test_msg.states[27].cn0 = 143; + test_msg.states[27].fcn = 149; + test_msg.states[27].sid.code = 68; + test_msg.states[27].sid.sat = 247; + + test_msg.states[28].cn0 = 70; + test_msg.states[28].fcn = 233; + test_msg.states[28].sid.code = 101; + test_msg.states[28].sid.sat = 137; + + test_msg.states[29].cn0 = 110; + test_msg.states[29].fcn = 38; + test_msg.states[29].sid.code = 165; + test_msg.states[29].sid.sat = 49; + + test_msg.states[30].cn0 = 213; + test_msg.states[30].fcn = 80; + test_msg.states[30].sid.code = 230; + test_msg.states[30].sid.sat = 218; + + test_msg.states[31].cn0 = 128; + test_msg.states[31].fcn = 139; + test_msg.states[31].sid.code = 179; + test_msg.states[31].sid.sat = 196; + + test_msg.states[32].cn0 = 171; + test_msg.states[32].fcn = 196; + test_msg.states[32].sid.code = 178; + test_msg.states[32].sid.sat = 15; + + test_msg.states[33].cn0 = 194; + test_msg.states[33].fcn = 97; + test_msg.states[33].sid.code = 212; + test_msg.states[33].sid.sat = 8; + + test_msg.states[34].cn0 = 99; + test_msg.states[34].fcn = 79; + test_msg.states[34].sid.code = 233; + test_msg.states[34].sid.sat = 83; + + test_msg.states[35].cn0 = 180; + test_msg.states[35].fcn = 31; + test_msg.states[35].sid.code = 90; + test_msg.states[35].sid.sat = 55; + + test_msg.states[36].cn0 = 186; + test_msg.states[36].fcn = 105; + test_msg.states[36].sid.code = 25; + test_msg.states[36].sid.sat = 5; + + test_msg.states[37].cn0 = 111; + test_msg.states[37].fcn = 80; + test_msg.states[37].sid.code = 224; + test_msg.states[37].sid.sat = 22; + + test_msg.states[38].cn0 = 166; + test_msg.states[38].fcn = 106; + test_msg.states[38].sid.code = 48; + test_msg.states[38].sid.sat = 8; + + test_msg.states[39].cn0 = 49; + test_msg.states[39].fcn = 156; + test_msg.states[39].sid.code = 48; + test_msg.states[39].sid.sat = 4; + + test_msg.states[40].cn0 = 146; + test_msg.states[40].fcn = 142; + test_msg.states[40].sid.code = 19; + test_msg.states[40].sid.sat = 86; + + test_msg.states[41].cn0 = 64; + test_msg.states[41].fcn = 115; + test_msg.states[41].sid.code = 124; + test_msg.states[41].sid.sat = 91; + + test_msg.states[42].cn0 = 178; + test_msg.states[42].fcn = 115; + test_msg.states[42].sid.code = 230; + test_msg.states[42].sid.sat = 28; + + test_msg.states[43].cn0 = 242; + test_msg.states[43].fcn = 16; + test_msg.states[43].sid.code = 131; + test_msg.states[43].sid.sat = 190; + + test_msg.states[44].cn0 = 113; + test_msg.states[44].fcn = 182; + test_msg.states[44].sid.code = 59; + test_msg.states[44].sid.sat = 105; + + test_msg.states[45].cn0 = 179; + test_msg.states[45].fcn = 48; + test_msg.states[45].sid.code = 180; + test_msg.states[45].sid.sat = 192; + + test_msg.states[46].cn0 = 211; + test_msg.states[46].fcn = 172; + test_msg.states[46].sid.code = 31; + test_msg.states[46].sid.sat = 166; + + test_msg.states[47].cn0 = 49; + test_msg.states[47].fcn = 140; + test_msg.states[47].sid.code = 228; + test_msg.states[47].sid.sat = 77; + + test_msg.states[48].cn0 = 194; + test_msg.states[48].fcn = 240; + test_msg.states[48].sid.code = 77; + test_msg.states[48].sid.sat = 128; + + test_msg.states[49].cn0 = 58; + test_msg.states[49].fcn = 41; + test_msg.states[49].sid.code = 194; + test_msg.states[49].sid.sat = 134; + + test_msg.states[50].cn0 = 55; + test_msg.states[50].fcn = 129; + test_msg.states[50].sid.code = 53; + test_msg.states[50].sid.sat = 18; + + test_msg.states[51].cn0 = 92; + test_msg.states[51].fcn = 134; + test_msg.states[51].sid.code = 72; + test_msg.states[51].sid.sat = 91; + + test_msg.states[52].cn0 = 56; + test_msg.states[52].fcn = 157; + test_msg.states[52].sid.code = 224; + test_msg.states[52].sid.sat = 33; + + test_msg.states[53].cn0 = 174; + test_msg.states[53].fcn = 224; + test_msg.states[53].sid.code = 54; + test_msg.states[53].sid.sat = 186; + + test_msg.states[54].cn0 = 190; + test_msg.states[54].fcn = 148; + test_msg.states[54].sid.code = 84; + test_msg.states[54].sid.sat = 82; + + test_msg.states[55].cn0 = 67; + test_msg.states[55].fcn = 62; + test_msg.states[55].sid.code = 54; + test_msg.states[55].sid.sat = 236; + + test_msg.states[56].cn0 = 254; + test_msg.states[56].fcn = 57; + test_msg.states[56].sid.code = 215; + test_msg.states[56].sid.sat = 52; + + test_msg.states[57].cn0 = 174; + test_msg.states[57].fcn = 36; + test_msg.states[57].sid.code = 133; + test_msg.states[57].sid.sat = 16; + + test_msg.states[58].cn0 = 17; + test_msg.states[58].fcn = 145; + test_msg.states[58].sid.code = 172; + test_msg.states[58].sid.sat = 219; + + test_msg.states[59].cn0 = 97; + test_msg.states[59].fcn = 111; + test_msg.states[59].sid.code = 179; + test_msg.states[59].sid.sat = 192; + + test_msg.states[60].cn0 = 134; + test_msg.states[60].fcn = 208; + test_msg.states[60].sid.code = 56; + test_msg.states[60].sid.sat = 207; + + test_msg.states[61].cn0 = 226; + test_msg.states[61].fcn = 43; + test_msg.states[61].sid.code = 17; + test_msg.states[61].sid.sat = 180; + + test_msg.states[62].cn0 = 113; + test_msg.states[62].fcn = 140; + test_msg.states[62].sid.code = 182; + test_msg.states[62].sid.sat = 255; + + EXPECT_EQ(send_message(33079, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 33079); + EXPECT_EQ(last_msg_, test_msg); + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_states.value, 63) + << "incorrect value for last_msg_.n_states.value, expected 63, is " + << last_msg_.n_states.value; + EXPECT_EQ(last_msg_.states[0].cn0, 102) + << "incorrect value for last_msg_.states[0].cn0, expected 102, is " + << last_msg_.states[0].cn0; + EXPECT_EQ(last_msg_.states[0].fcn, 3) + << "incorrect value for last_msg_.states[0].fcn, expected 3, is " + << last_msg_.states[0].fcn; + EXPECT_EQ(last_msg_.states[0].sid.code, 184) + << "incorrect value for last_msg_.states[0].sid.code, expected 184, is " + << last_msg_.states[0].sid.code; + EXPECT_EQ(last_msg_.states[0].sid.sat, 117) + << "incorrect value for last_msg_.states[0].sid.sat, expected 117, is " + << last_msg_.states[0].sid.sat; + EXPECT_EQ(last_msg_.states[1].cn0, 141) + << "incorrect value for last_msg_.states[1].cn0, expected 141, is " + << last_msg_.states[1].cn0; + EXPECT_EQ(last_msg_.states[1].fcn, 140) + << "incorrect value for last_msg_.states[1].fcn, expected 140, is " + << last_msg_.states[1].fcn; + EXPECT_EQ(last_msg_.states[1].sid.code, 106) + << "incorrect value for last_msg_.states[1].sid.code, expected 106, is " + << last_msg_.states[1].sid.code; + EXPECT_EQ(last_msg_.states[1].sid.sat, 38) + << "incorrect value for last_msg_.states[1].sid.sat, expected 38, is " + << last_msg_.states[1].sid.sat; + EXPECT_EQ(last_msg_.states[2].cn0, 195) + << "incorrect value for last_msg_.states[2].cn0, expected 195, is " + << last_msg_.states[2].cn0; + EXPECT_EQ(last_msg_.states[2].fcn, 90) + << "incorrect value for last_msg_.states[2].fcn, expected 90, is " + << last_msg_.states[2].fcn; + EXPECT_EQ(last_msg_.states[2].sid.code, 4) + << "incorrect value for last_msg_.states[2].sid.code, expected 4, is " + << last_msg_.states[2].sid.code; + EXPECT_EQ(last_msg_.states[2].sid.sat, 25) + << "incorrect value for last_msg_.states[2].sid.sat, expected 25, is " + << last_msg_.states[2].sid.sat; + EXPECT_EQ(last_msg_.states[3].cn0, 82) + << "incorrect value for last_msg_.states[3].cn0, expected 82, is " + << last_msg_.states[3].cn0; + EXPECT_EQ(last_msg_.states[3].fcn, 75) + << "incorrect value for last_msg_.states[3].fcn, expected 75, is " + << last_msg_.states[3].fcn; + EXPECT_EQ(last_msg_.states[3].sid.code, 108) + << "incorrect value for last_msg_.states[3].sid.code, expected 108, is " + << last_msg_.states[3].sid.code; + EXPECT_EQ(last_msg_.states[3].sid.sat, 246) + << "incorrect value for last_msg_.states[3].sid.sat, expected 246, is " + << last_msg_.states[3].sid.sat; + EXPECT_EQ(last_msg_.states[4].cn0, 163) + << "incorrect value for last_msg_.states[4].cn0, expected 163, is " + << last_msg_.states[4].cn0; + EXPECT_EQ(last_msg_.states[4].fcn, 45) + << "incorrect value for last_msg_.states[4].fcn, expected 45, is " + << last_msg_.states[4].fcn; + EXPECT_EQ(last_msg_.states[4].sid.code, 127) + << "incorrect value for last_msg_.states[4].sid.code, expected 127, is " + << last_msg_.states[4].sid.code; + EXPECT_EQ(last_msg_.states[4].sid.sat, 137) + << "incorrect value for last_msg_.states[4].sid.sat, expected 137, is " + << last_msg_.states[4].sid.sat; + EXPECT_EQ(last_msg_.states[5].cn0, 93) + << "incorrect value for last_msg_.states[5].cn0, expected 93, is " + << last_msg_.states[5].cn0; + EXPECT_EQ(last_msg_.states[5].fcn, 187) + << "incorrect value for last_msg_.states[5].fcn, expected 187, is " + << last_msg_.states[5].fcn; + EXPECT_EQ(last_msg_.states[5].sid.code, 46) + << "incorrect value for last_msg_.states[5].sid.code, expected 46, is " + << last_msg_.states[5].sid.code; + EXPECT_EQ(last_msg_.states[5].sid.sat, 32) + << "incorrect value for last_msg_.states[5].sid.sat, expected 32, is " + << last_msg_.states[5].sid.sat; + EXPECT_EQ(last_msg_.states[6].cn0, 147) + << "incorrect value for last_msg_.states[6].cn0, expected 147, is " + << last_msg_.states[6].cn0; + EXPECT_EQ(last_msg_.states[6].fcn, 201) + << "incorrect value for last_msg_.states[6].fcn, expected 201, is " + << last_msg_.states[6].fcn; + EXPECT_EQ(last_msg_.states[6].sid.code, 60) + << "incorrect value for last_msg_.states[6].sid.code, expected 60, is " + << last_msg_.states[6].sid.code; + EXPECT_EQ(last_msg_.states[6].sid.sat, 153) + << "incorrect value for last_msg_.states[6].sid.sat, expected 153, is " + << last_msg_.states[6].sid.sat; + EXPECT_EQ(last_msg_.states[7].cn0, 208) + << "incorrect value for last_msg_.states[7].cn0, expected 208, is " + << last_msg_.states[7].cn0; + EXPECT_EQ(last_msg_.states[7].fcn, 5) + << "incorrect value for last_msg_.states[7].fcn, expected 5, is " + << last_msg_.states[7].fcn; + EXPECT_EQ(last_msg_.states[7].sid.code, 29) + << "incorrect value for last_msg_.states[7].sid.code, expected 29, is " + << last_msg_.states[7].sid.code; + EXPECT_EQ(last_msg_.states[7].sid.sat, 23) + << "incorrect value for last_msg_.states[7].sid.sat, expected 23, is " + << last_msg_.states[7].sid.sat; + EXPECT_EQ(last_msg_.states[8].cn0, 69) + << "incorrect value for last_msg_.states[8].cn0, expected 69, is " + << last_msg_.states[8].cn0; + EXPECT_EQ(last_msg_.states[8].fcn, 219) + << "incorrect value for last_msg_.states[8].fcn, expected 219, is " + << last_msg_.states[8].fcn; + EXPECT_EQ(last_msg_.states[8].sid.code, 30) + << "incorrect value for last_msg_.states[8].sid.code, expected 30, is " + << last_msg_.states[8].sid.code; + EXPECT_EQ(last_msg_.states[8].sid.sat, 181) + << "incorrect value for last_msg_.states[8].sid.sat, expected 181, is " + << last_msg_.states[8].sid.sat; + EXPECT_EQ(last_msg_.states[9].cn0, 121) + << "incorrect value for last_msg_.states[9].cn0, expected 121, is " + << last_msg_.states[9].cn0; + EXPECT_EQ(last_msg_.states[9].fcn, 3) + << "incorrect value for last_msg_.states[9].fcn, expected 3, is " + << last_msg_.states[9].fcn; + EXPECT_EQ(last_msg_.states[9].sid.code, 136) + << "incorrect value for last_msg_.states[9].sid.code, expected 136, is " + << last_msg_.states[9].sid.code; + EXPECT_EQ(last_msg_.states[9].sid.sat, 254) + << "incorrect value for last_msg_.states[9].sid.sat, expected 254, is " + << last_msg_.states[9].sid.sat; + EXPECT_EQ(last_msg_.states[10].cn0, 215) + << "incorrect value for last_msg_.states[10].cn0, expected 215, is " + << last_msg_.states[10].cn0; + EXPECT_EQ(last_msg_.states[10].fcn, 144) + << "incorrect value for last_msg_.states[10].fcn, expected 144, is " + << last_msg_.states[10].fcn; + EXPECT_EQ(last_msg_.states[10].sid.code, 98) + << "incorrect value for last_msg_.states[10].sid.code, expected 98, is " + << last_msg_.states[10].sid.code; + EXPECT_EQ(last_msg_.states[10].sid.sat, 33) + << "incorrect value for last_msg_.states[10].sid.sat, expected 33, is " + << last_msg_.states[10].sid.sat; + EXPECT_EQ(last_msg_.states[11].cn0, 56) + << "incorrect value for last_msg_.states[11].cn0, expected 56, is " + << last_msg_.states[11].cn0; + EXPECT_EQ(last_msg_.states[11].fcn, 14) + << "incorrect value for last_msg_.states[11].fcn, expected 14, is " + << last_msg_.states[11].fcn; + EXPECT_EQ(last_msg_.states[11].sid.code, 182) + << "incorrect value for last_msg_.states[11].sid.code, expected 182, is " + << last_msg_.states[11].sid.code; + EXPECT_EQ(last_msg_.states[11].sid.sat, 133) + << "incorrect value for last_msg_.states[11].sid.sat, expected 133, is " + << last_msg_.states[11].sid.sat; + EXPECT_EQ(last_msg_.states[12].cn0, 62) + << "incorrect value for last_msg_.states[12].cn0, expected 62, is " + << last_msg_.states[12].cn0; + EXPECT_EQ(last_msg_.states[12].fcn, 218) + << "incorrect value for last_msg_.states[12].fcn, expected 218, is " + << last_msg_.states[12].fcn; + EXPECT_EQ(last_msg_.states[12].sid.code, 77) + << "incorrect value for last_msg_.states[12].sid.code, expected 77, is " + << last_msg_.states[12].sid.code; + EXPECT_EQ(last_msg_.states[12].sid.sat, 169) + << "incorrect value for last_msg_.states[12].sid.sat, expected 169, is " + << last_msg_.states[12].sid.sat; + EXPECT_EQ(last_msg_.states[13].cn0, 249) + << "incorrect value for last_msg_.states[13].cn0, expected 249, is " + << last_msg_.states[13].cn0; + EXPECT_EQ(last_msg_.states[13].fcn, 171) + << "incorrect value for last_msg_.states[13].fcn, expected 171, is " + << last_msg_.states[13].fcn; + EXPECT_EQ(last_msg_.states[13].sid.code, 84) + << "incorrect value for last_msg_.states[13].sid.code, expected 84, is " + << last_msg_.states[13].sid.code; + EXPECT_EQ(last_msg_.states[13].sid.sat, 242) + << "incorrect value for last_msg_.states[13].sid.sat, expected 242, is " + << last_msg_.states[13].sid.sat; + EXPECT_EQ(last_msg_.states[14].cn0, 130) + << "incorrect value for last_msg_.states[14].cn0, expected 130, is " + << last_msg_.states[14].cn0; + EXPECT_EQ(last_msg_.states[14].fcn, 131) + << "incorrect value for last_msg_.states[14].fcn, expected 131, is " + << last_msg_.states[14].fcn; + EXPECT_EQ(last_msg_.states[14].sid.code, 137) + << "incorrect value for last_msg_.states[14].sid.code, expected 137, is " + << last_msg_.states[14].sid.code; + EXPECT_EQ(last_msg_.states[14].sid.sat, 152) + << "incorrect value for last_msg_.states[14].sid.sat, expected 152, is " + << last_msg_.states[14].sid.sat; + EXPECT_EQ(last_msg_.states[15].cn0, 68) + << "incorrect value for last_msg_.states[15].cn0, expected 68, is " + << last_msg_.states[15].cn0; + EXPECT_EQ(last_msg_.states[15].fcn, 42) + << "incorrect value for last_msg_.states[15].fcn, expected 42, is " + << last_msg_.states[15].fcn; + EXPECT_EQ(last_msg_.states[15].sid.code, 21) + << "incorrect value for last_msg_.states[15].sid.code, expected 21, is " + << last_msg_.states[15].sid.code; + EXPECT_EQ(last_msg_.states[15].sid.sat, 193) + << "incorrect value for last_msg_.states[15].sid.sat, expected 193, is " + << last_msg_.states[15].sid.sat; + EXPECT_EQ(last_msg_.states[16].cn0, 227) + << "incorrect value for last_msg_.states[16].cn0, expected 227, is " + << last_msg_.states[16].cn0; + EXPECT_EQ(last_msg_.states[16].fcn, 216) + << "incorrect value for last_msg_.states[16].fcn, expected 216, is " + << last_msg_.states[16].fcn; + EXPECT_EQ(last_msg_.states[16].sid.code, 227) + << "incorrect value for last_msg_.states[16].sid.code, expected 227, is " + << last_msg_.states[16].sid.code; + EXPECT_EQ(last_msg_.states[16].sid.sat, 253) + << "incorrect value for last_msg_.states[16].sid.sat, expected 253, is " + << last_msg_.states[16].sid.sat; + EXPECT_EQ(last_msg_.states[17].cn0, 179) + << "incorrect value for last_msg_.states[17].cn0, expected 179, is " + << last_msg_.states[17].cn0; + EXPECT_EQ(last_msg_.states[17].fcn, 210) + << "incorrect value for last_msg_.states[17].fcn, expected 210, is " + << last_msg_.states[17].fcn; + EXPECT_EQ(last_msg_.states[17].sid.code, 26) + << "incorrect value for last_msg_.states[17].sid.code, expected 26, is " + << last_msg_.states[17].sid.code; + EXPECT_EQ(last_msg_.states[17].sid.sat, 24) + << "incorrect value for last_msg_.states[17].sid.sat, expected 24, is " + << last_msg_.states[17].sid.sat; + EXPECT_EQ(last_msg_.states[18].cn0, 255) + << "incorrect value for last_msg_.states[18].cn0, expected 255, is " + << last_msg_.states[18].cn0; + EXPECT_EQ(last_msg_.states[18].fcn, 227) + << "incorrect value for last_msg_.states[18].fcn, expected 227, is " + << last_msg_.states[18].fcn; + EXPECT_EQ(last_msg_.states[18].sid.code, 15) + << "incorrect value for last_msg_.states[18].sid.code, expected 15, is " + << last_msg_.states[18].sid.code; + EXPECT_EQ(last_msg_.states[18].sid.sat, 19) + << "incorrect value for last_msg_.states[18].sid.sat, expected 19, is " + << last_msg_.states[18].sid.sat; + EXPECT_EQ(last_msg_.states[19].cn0, 200) + << "incorrect value for last_msg_.states[19].cn0, expected 200, is " + << last_msg_.states[19].cn0; + EXPECT_EQ(last_msg_.states[19].fcn, 187) + << "incorrect value for last_msg_.states[19].fcn, expected 187, is " + << last_msg_.states[19].fcn; + EXPECT_EQ(last_msg_.states[19].sid.code, 75) + << "incorrect value for last_msg_.states[19].sid.code, expected 75, is " + << last_msg_.states[19].sid.code; + EXPECT_EQ(last_msg_.states[19].sid.sat, 122) + << "incorrect value for last_msg_.states[19].sid.sat, expected 122, is " + << last_msg_.states[19].sid.sat; + EXPECT_EQ(last_msg_.states[20].cn0, 122) + << "incorrect value for last_msg_.states[20].cn0, expected 122, is " + << last_msg_.states[20].cn0; + EXPECT_EQ(last_msg_.states[20].fcn, 218) + << "incorrect value for last_msg_.states[20].fcn, expected 218, is " + << last_msg_.states[20].fcn; + EXPECT_EQ(last_msg_.states[20].sid.code, 48) + << "incorrect value for last_msg_.states[20].sid.code, expected 48, is " + << last_msg_.states[20].sid.code; + EXPECT_EQ(last_msg_.states[20].sid.sat, 217) + << "incorrect value for last_msg_.states[20].sid.sat, expected 217, is " + << last_msg_.states[20].sid.sat; + EXPECT_EQ(last_msg_.states[21].cn0, 149) + << "incorrect value for last_msg_.states[21].cn0, expected 149, is " + << last_msg_.states[21].cn0; + EXPECT_EQ(last_msg_.states[21].fcn, 142) + << "incorrect value for last_msg_.states[21].fcn, expected 142, is " + << last_msg_.states[21].fcn; + EXPECT_EQ(last_msg_.states[21].sid.code, 238) + << "incorrect value for last_msg_.states[21].sid.code, expected 238, is " + << last_msg_.states[21].sid.code; + EXPECT_EQ(last_msg_.states[21].sid.sat, 187) + << "incorrect value for last_msg_.states[21].sid.sat, expected 187, is " + << last_msg_.states[21].sid.sat; + EXPECT_EQ(last_msg_.states[22].cn0, 212) + << "incorrect value for last_msg_.states[22].cn0, expected 212, is " + << last_msg_.states[22].cn0; + EXPECT_EQ(last_msg_.states[22].fcn, 251) + << "incorrect value for last_msg_.states[22].fcn, expected 251, is " + << last_msg_.states[22].fcn; + EXPECT_EQ(last_msg_.states[22].sid.code, 55) + << "incorrect value for last_msg_.states[22].sid.code, expected 55, is " + << last_msg_.states[22].sid.code; + EXPECT_EQ(last_msg_.states[22].sid.sat, 238) + << "incorrect value for last_msg_.states[22].sid.sat, expected 238, is " + << last_msg_.states[22].sid.sat; + EXPECT_EQ(last_msg_.states[23].cn0, 104) + << "incorrect value for last_msg_.states[23].cn0, expected 104, is " + << last_msg_.states[23].cn0; + EXPECT_EQ(last_msg_.states[23].fcn, 194) + << "incorrect value for last_msg_.states[23].fcn, expected 194, is " + << last_msg_.states[23].fcn; + EXPECT_EQ(last_msg_.states[23].sid.code, 160) + << "incorrect value for last_msg_.states[23].sid.code, expected 160, is " + << last_msg_.states[23].sid.code; + EXPECT_EQ(last_msg_.states[23].sid.sat, 128) + << "incorrect value for last_msg_.states[23].sid.sat, expected 128, is " + << last_msg_.states[23].sid.sat; + EXPECT_EQ(last_msg_.states[24].cn0, 62) + << "incorrect value for last_msg_.states[24].cn0, expected 62, is " + << last_msg_.states[24].cn0; + EXPECT_EQ(last_msg_.states[24].fcn, 141) + << "incorrect value for last_msg_.states[24].fcn, expected 141, is " + << last_msg_.states[24].fcn; + EXPECT_EQ(last_msg_.states[24].sid.code, 255) + << "incorrect value for last_msg_.states[24].sid.code, expected 255, is " + << last_msg_.states[24].sid.code; + EXPECT_EQ(last_msg_.states[24].sid.sat, 113) + << "incorrect value for last_msg_.states[24].sid.sat, expected 113, is " + << last_msg_.states[24].sid.sat; + EXPECT_EQ(last_msg_.states[25].cn0, 39) + << "incorrect value for last_msg_.states[25].cn0, expected 39, is " + << last_msg_.states[25].cn0; + EXPECT_EQ(last_msg_.states[25].fcn, 245) + << "incorrect value for last_msg_.states[25].fcn, expected 245, is " + << last_msg_.states[25].fcn; + EXPECT_EQ(last_msg_.states[25].sid.code, 69) + << "incorrect value for last_msg_.states[25].sid.code, expected 69, is " + << last_msg_.states[25].sid.code; + EXPECT_EQ(last_msg_.states[25].sid.sat, 43) + << "incorrect value for last_msg_.states[25].sid.sat, expected 43, is " + << last_msg_.states[25].sid.sat; + EXPECT_EQ(last_msg_.states[26].cn0, 56) + << "incorrect value for last_msg_.states[26].cn0, expected 56, is " + << last_msg_.states[26].cn0; + EXPECT_EQ(last_msg_.states[26].fcn, 108) + << "incorrect value for last_msg_.states[26].fcn, expected 108, is " + << last_msg_.states[26].fcn; + EXPECT_EQ(last_msg_.states[26].sid.code, 230) + << "incorrect value for last_msg_.states[26].sid.code, expected 230, is " + << last_msg_.states[26].sid.code; + EXPECT_EQ(last_msg_.states[26].sid.sat, 100) + << "incorrect value for last_msg_.states[26].sid.sat, expected 100, is " + << last_msg_.states[26].sid.sat; + EXPECT_EQ(last_msg_.states[27].cn0, 143) + << "incorrect value for last_msg_.states[27].cn0, expected 143, is " + << last_msg_.states[27].cn0; + EXPECT_EQ(last_msg_.states[27].fcn, 149) + << "incorrect value for last_msg_.states[27].fcn, expected 149, is " + << last_msg_.states[27].fcn; + EXPECT_EQ(last_msg_.states[27].sid.code, 68) + << "incorrect value for last_msg_.states[27].sid.code, expected 68, is " + << last_msg_.states[27].sid.code; + EXPECT_EQ(last_msg_.states[27].sid.sat, 247) + << "incorrect value for last_msg_.states[27].sid.sat, expected 247, is " + << last_msg_.states[27].sid.sat; + EXPECT_EQ(last_msg_.states[28].cn0, 70) + << "incorrect value for last_msg_.states[28].cn0, expected 70, is " + << last_msg_.states[28].cn0; + EXPECT_EQ(last_msg_.states[28].fcn, 233) + << "incorrect value for last_msg_.states[28].fcn, expected 233, is " + << last_msg_.states[28].fcn; + EXPECT_EQ(last_msg_.states[28].sid.code, 101) + << "incorrect value for last_msg_.states[28].sid.code, expected 101, is " + << last_msg_.states[28].sid.code; + EXPECT_EQ(last_msg_.states[28].sid.sat, 137) + << "incorrect value for last_msg_.states[28].sid.sat, expected 137, is " + << last_msg_.states[28].sid.sat; + EXPECT_EQ(last_msg_.states[29].cn0, 110) + << "incorrect value for last_msg_.states[29].cn0, expected 110, is " + << last_msg_.states[29].cn0; + EXPECT_EQ(last_msg_.states[29].fcn, 38) + << "incorrect value for last_msg_.states[29].fcn, expected 38, is " + << last_msg_.states[29].fcn; + EXPECT_EQ(last_msg_.states[29].sid.code, 165) + << "incorrect value for last_msg_.states[29].sid.code, expected 165, is " + << last_msg_.states[29].sid.code; + EXPECT_EQ(last_msg_.states[29].sid.sat, 49) + << "incorrect value for last_msg_.states[29].sid.sat, expected 49, is " + << last_msg_.states[29].sid.sat; + EXPECT_EQ(last_msg_.states[30].cn0, 213) + << "incorrect value for last_msg_.states[30].cn0, expected 213, is " + << last_msg_.states[30].cn0; + EXPECT_EQ(last_msg_.states[30].fcn, 80) + << "incorrect value for last_msg_.states[30].fcn, expected 80, is " + << last_msg_.states[30].fcn; + EXPECT_EQ(last_msg_.states[30].sid.code, 230) + << "incorrect value for last_msg_.states[30].sid.code, expected 230, is " + << last_msg_.states[30].sid.code; + EXPECT_EQ(last_msg_.states[30].sid.sat, 218) + << "incorrect value for last_msg_.states[30].sid.sat, expected 218, is " + << last_msg_.states[30].sid.sat; + EXPECT_EQ(last_msg_.states[31].cn0, 128) + << "incorrect value for last_msg_.states[31].cn0, expected 128, is " + << last_msg_.states[31].cn0; + EXPECT_EQ(last_msg_.states[31].fcn, 139) + << "incorrect value for last_msg_.states[31].fcn, expected 139, is " + << last_msg_.states[31].fcn; + EXPECT_EQ(last_msg_.states[31].sid.code, 179) + << "incorrect value for last_msg_.states[31].sid.code, expected 179, is " + << last_msg_.states[31].sid.code; + EXPECT_EQ(last_msg_.states[31].sid.sat, 196) + << "incorrect value for last_msg_.states[31].sid.sat, expected 196, is " + << last_msg_.states[31].sid.sat; + EXPECT_EQ(last_msg_.states[32].cn0, 171) + << "incorrect value for last_msg_.states[32].cn0, expected 171, is " + << last_msg_.states[32].cn0; + EXPECT_EQ(last_msg_.states[32].fcn, 196) + << "incorrect value for last_msg_.states[32].fcn, expected 196, is " + << last_msg_.states[32].fcn; + EXPECT_EQ(last_msg_.states[32].sid.code, 178) + << "incorrect value for last_msg_.states[32].sid.code, expected 178, is " + << last_msg_.states[32].sid.code; + EXPECT_EQ(last_msg_.states[32].sid.sat, 15) + << "incorrect value for last_msg_.states[32].sid.sat, expected 15, is " + << last_msg_.states[32].sid.sat; + EXPECT_EQ(last_msg_.states[33].cn0, 194) + << "incorrect value for last_msg_.states[33].cn0, expected 194, is " + << last_msg_.states[33].cn0; + EXPECT_EQ(last_msg_.states[33].fcn, 97) + << "incorrect value for last_msg_.states[33].fcn, expected 97, is " + << last_msg_.states[33].fcn; + EXPECT_EQ(last_msg_.states[33].sid.code, 212) + << "incorrect value for last_msg_.states[33].sid.code, expected 212, is " + << last_msg_.states[33].sid.code; + EXPECT_EQ(last_msg_.states[33].sid.sat, 8) + << "incorrect value for last_msg_.states[33].sid.sat, expected 8, is " + << last_msg_.states[33].sid.sat; + EXPECT_EQ(last_msg_.states[34].cn0, 99) + << "incorrect value for last_msg_.states[34].cn0, expected 99, is " + << last_msg_.states[34].cn0; + EXPECT_EQ(last_msg_.states[34].fcn, 79) + << "incorrect value for last_msg_.states[34].fcn, expected 79, is " + << last_msg_.states[34].fcn; + EXPECT_EQ(last_msg_.states[34].sid.code, 233) + << "incorrect value for last_msg_.states[34].sid.code, expected 233, is " + << last_msg_.states[34].sid.code; + EXPECT_EQ(last_msg_.states[34].sid.sat, 83) + << "incorrect value for last_msg_.states[34].sid.sat, expected 83, is " + << last_msg_.states[34].sid.sat; + EXPECT_EQ(last_msg_.states[35].cn0, 180) + << "incorrect value for last_msg_.states[35].cn0, expected 180, is " + << last_msg_.states[35].cn0; + EXPECT_EQ(last_msg_.states[35].fcn, 31) + << "incorrect value for last_msg_.states[35].fcn, expected 31, is " + << last_msg_.states[35].fcn; + EXPECT_EQ(last_msg_.states[35].sid.code, 90) + << "incorrect value for last_msg_.states[35].sid.code, expected 90, is " + << last_msg_.states[35].sid.code; + EXPECT_EQ(last_msg_.states[35].sid.sat, 55) + << "incorrect value for last_msg_.states[35].sid.sat, expected 55, is " + << last_msg_.states[35].sid.sat; + EXPECT_EQ(last_msg_.states[36].cn0, 186) + << "incorrect value for last_msg_.states[36].cn0, expected 186, is " + << last_msg_.states[36].cn0; + EXPECT_EQ(last_msg_.states[36].fcn, 105) + << "incorrect value for last_msg_.states[36].fcn, expected 105, is " + << last_msg_.states[36].fcn; + EXPECT_EQ(last_msg_.states[36].sid.code, 25) + << "incorrect value for last_msg_.states[36].sid.code, expected 25, is " + << last_msg_.states[36].sid.code; + EXPECT_EQ(last_msg_.states[36].sid.sat, 5) + << "incorrect value for last_msg_.states[36].sid.sat, expected 5, is " + << last_msg_.states[36].sid.sat; + EXPECT_EQ(last_msg_.states[37].cn0, 111) + << "incorrect value for last_msg_.states[37].cn0, expected 111, is " + << last_msg_.states[37].cn0; + EXPECT_EQ(last_msg_.states[37].fcn, 80) + << "incorrect value for last_msg_.states[37].fcn, expected 80, is " + << last_msg_.states[37].fcn; + EXPECT_EQ(last_msg_.states[37].sid.code, 224) + << "incorrect value for last_msg_.states[37].sid.code, expected 224, is " + << last_msg_.states[37].sid.code; + EXPECT_EQ(last_msg_.states[37].sid.sat, 22) + << "incorrect value for last_msg_.states[37].sid.sat, expected 22, is " + << last_msg_.states[37].sid.sat; + EXPECT_EQ(last_msg_.states[38].cn0, 166) + << "incorrect value for last_msg_.states[38].cn0, expected 166, is " + << last_msg_.states[38].cn0; + EXPECT_EQ(last_msg_.states[38].fcn, 106) + << "incorrect value for last_msg_.states[38].fcn, expected 106, is " + << last_msg_.states[38].fcn; + EXPECT_EQ(last_msg_.states[38].sid.code, 48) + << "incorrect value for last_msg_.states[38].sid.code, expected 48, is " + << last_msg_.states[38].sid.code; + EXPECT_EQ(last_msg_.states[38].sid.sat, 8) + << "incorrect value for last_msg_.states[38].sid.sat, expected 8, is " + << last_msg_.states[38].sid.sat; + EXPECT_EQ(last_msg_.states[39].cn0, 49) + << "incorrect value for last_msg_.states[39].cn0, expected 49, is " + << last_msg_.states[39].cn0; + EXPECT_EQ(last_msg_.states[39].fcn, 156) + << "incorrect value for last_msg_.states[39].fcn, expected 156, is " + << last_msg_.states[39].fcn; + EXPECT_EQ(last_msg_.states[39].sid.code, 48) + << "incorrect value for last_msg_.states[39].sid.code, expected 48, is " + << last_msg_.states[39].sid.code; + EXPECT_EQ(last_msg_.states[39].sid.sat, 4) + << "incorrect value for last_msg_.states[39].sid.sat, expected 4, is " + << last_msg_.states[39].sid.sat; + EXPECT_EQ(last_msg_.states[40].cn0, 146) + << "incorrect value for last_msg_.states[40].cn0, expected 146, is " + << last_msg_.states[40].cn0; + EXPECT_EQ(last_msg_.states[40].fcn, 142) + << "incorrect value for last_msg_.states[40].fcn, expected 142, is " + << last_msg_.states[40].fcn; + EXPECT_EQ(last_msg_.states[40].sid.code, 19) + << "incorrect value for last_msg_.states[40].sid.code, expected 19, is " + << last_msg_.states[40].sid.code; + EXPECT_EQ(last_msg_.states[40].sid.sat, 86) + << "incorrect value for last_msg_.states[40].sid.sat, expected 86, is " + << last_msg_.states[40].sid.sat; + EXPECT_EQ(last_msg_.states[41].cn0, 64) + << "incorrect value for last_msg_.states[41].cn0, expected 64, is " + << last_msg_.states[41].cn0; + EXPECT_EQ(last_msg_.states[41].fcn, 115) + << "incorrect value for last_msg_.states[41].fcn, expected 115, is " + << last_msg_.states[41].fcn; + EXPECT_EQ(last_msg_.states[41].sid.code, 124) + << "incorrect value for last_msg_.states[41].sid.code, expected 124, is " + << last_msg_.states[41].sid.code; + EXPECT_EQ(last_msg_.states[41].sid.sat, 91) + << "incorrect value for last_msg_.states[41].sid.sat, expected 91, is " + << last_msg_.states[41].sid.sat; + EXPECT_EQ(last_msg_.states[42].cn0, 178) + << "incorrect value for last_msg_.states[42].cn0, expected 178, is " + << last_msg_.states[42].cn0; + EXPECT_EQ(last_msg_.states[42].fcn, 115) + << "incorrect value for last_msg_.states[42].fcn, expected 115, is " + << last_msg_.states[42].fcn; + EXPECT_EQ(last_msg_.states[42].sid.code, 230) + << "incorrect value for last_msg_.states[42].sid.code, expected 230, is " + << last_msg_.states[42].sid.code; + EXPECT_EQ(last_msg_.states[42].sid.sat, 28) + << "incorrect value for last_msg_.states[42].sid.sat, expected 28, is " + << last_msg_.states[42].sid.sat; + EXPECT_EQ(last_msg_.states[43].cn0, 242) + << "incorrect value for last_msg_.states[43].cn0, expected 242, is " + << last_msg_.states[43].cn0; + EXPECT_EQ(last_msg_.states[43].fcn, 16) + << "incorrect value for last_msg_.states[43].fcn, expected 16, is " + << last_msg_.states[43].fcn; + EXPECT_EQ(last_msg_.states[43].sid.code, 131) + << "incorrect value for last_msg_.states[43].sid.code, expected 131, is " + << last_msg_.states[43].sid.code; + EXPECT_EQ(last_msg_.states[43].sid.sat, 190) + << "incorrect value for last_msg_.states[43].sid.sat, expected 190, is " + << last_msg_.states[43].sid.sat; + EXPECT_EQ(last_msg_.states[44].cn0, 113) + << "incorrect value for last_msg_.states[44].cn0, expected 113, is " + << last_msg_.states[44].cn0; + EXPECT_EQ(last_msg_.states[44].fcn, 182) + << "incorrect value for last_msg_.states[44].fcn, expected 182, is " + << last_msg_.states[44].fcn; + EXPECT_EQ(last_msg_.states[44].sid.code, 59) + << "incorrect value for last_msg_.states[44].sid.code, expected 59, is " + << last_msg_.states[44].sid.code; + EXPECT_EQ(last_msg_.states[44].sid.sat, 105) + << "incorrect value for last_msg_.states[44].sid.sat, expected 105, is " + << last_msg_.states[44].sid.sat; + EXPECT_EQ(last_msg_.states[45].cn0, 179) + << "incorrect value for last_msg_.states[45].cn0, expected 179, is " + << last_msg_.states[45].cn0; + EXPECT_EQ(last_msg_.states[45].fcn, 48) + << "incorrect value for last_msg_.states[45].fcn, expected 48, is " + << last_msg_.states[45].fcn; + EXPECT_EQ(last_msg_.states[45].sid.code, 180) + << "incorrect value for last_msg_.states[45].sid.code, expected 180, is " + << last_msg_.states[45].sid.code; + EXPECT_EQ(last_msg_.states[45].sid.sat, 192) + << "incorrect value for last_msg_.states[45].sid.sat, expected 192, is " + << last_msg_.states[45].sid.sat; + EXPECT_EQ(last_msg_.states[46].cn0, 211) + << "incorrect value for last_msg_.states[46].cn0, expected 211, is " + << last_msg_.states[46].cn0; + EXPECT_EQ(last_msg_.states[46].fcn, 172) + << "incorrect value for last_msg_.states[46].fcn, expected 172, is " + << last_msg_.states[46].fcn; + EXPECT_EQ(last_msg_.states[46].sid.code, 31) + << "incorrect value for last_msg_.states[46].sid.code, expected 31, is " + << last_msg_.states[46].sid.code; + EXPECT_EQ(last_msg_.states[46].sid.sat, 166) + << "incorrect value for last_msg_.states[46].sid.sat, expected 166, is " + << last_msg_.states[46].sid.sat; + EXPECT_EQ(last_msg_.states[47].cn0, 49) + << "incorrect value for last_msg_.states[47].cn0, expected 49, is " + << last_msg_.states[47].cn0; + EXPECT_EQ(last_msg_.states[47].fcn, 140) + << "incorrect value for last_msg_.states[47].fcn, expected 140, is " + << last_msg_.states[47].fcn; + EXPECT_EQ(last_msg_.states[47].sid.code, 228) + << "incorrect value for last_msg_.states[47].sid.code, expected 228, is " + << last_msg_.states[47].sid.code; + EXPECT_EQ(last_msg_.states[47].sid.sat, 77) + << "incorrect value for last_msg_.states[47].sid.sat, expected 77, is " + << last_msg_.states[47].sid.sat; + EXPECT_EQ(last_msg_.states[48].cn0, 194) + << "incorrect value for last_msg_.states[48].cn0, expected 194, is " + << last_msg_.states[48].cn0; + EXPECT_EQ(last_msg_.states[48].fcn, 240) + << "incorrect value for last_msg_.states[48].fcn, expected 240, is " + << last_msg_.states[48].fcn; + EXPECT_EQ(last_msg_.states[48].sid.code, 77) + << "incorrect value for last_msg_.states[48].sid.code, expected 77, is " + << last_msg_.states[48].sid.code; + EXPECT_EQ(last_msg_.states[48].sid.sat, 128) + << "incorrect value for last_msg_.states[48].sid.sat, expected 128, is " + << last_msg_.states[48].sid.sat; + EXPECT_EQ(last_msg_.states[49].cn0, 58) + << "incorrect value for last_msg_.states[49].cn0, expected 58, is " + << last_msg_.states[49].cn0; + EXPECT_EQ(last_msg_.states[49].fcn, 41) + << "incorrect value for last_msg_.states[49].fcn, expected 41, is " + << last_msg_.states[49].fcn; + EXPECT_EQ(last_msg_.states[49].sid.code, 194) + << "incorrect value for last_msg_.states[49].sid.code, expected 194, is " + << last_msg_.states[49].sid.code; + EXPECT_EQ(last_msg_.states[49].sid.sat, 134) + << "incorrect value for last_msg_.states[49].sid.sat, expected 134, is " + << last_msg_.states[49].sid.sat; + EXPECT_EQ(last_msg_.states[50].cn0, 55) + << "incorrect value for last_msg_.states[50].cn0, expected 55, is " + << last_msg_.states[50].cn0; + EXPECT_EQ(last_msg_.states[50].fcn, 129) + << "incorrect value for last_msg_.states[50].fcn, expected 129, is " + << last_msg_.states[50].fcn; + EXPECT_EQ(last_msg_.states[50].sid.code, 53) + << "incorrect value for last_msg_.states[50].sid.code, expected 53, is " + << last_msg_.states[50].sid.code; + EXPECT_EQ(last_msg_.states[50].sid.sat, 18) + << "incorrect value for last_msg_.states[50].sid.sat, expected 18, is " + << last_msg_.states[50].sid.sat; + EXPECT_EQ(last_msg_.states[51].cn0, 92) + << "incorrect value for last_msg_.states[51].cn0, expected 92, is " + << last_msg_.states[51].cn0; + EXPECT_EQ(last_msg_.states[51].fcn, 134) + << "incorrect value for last_msg_.states[51].fcn, expected 134, is " + << last_msg_.states[51].fcn; + EXPECT_EQ(last_msg_.states[51].sid.code, 72) + << "incorrect value for last_msg_.states[51].sid.code, expected 72, is " + << last_msg_.states[51].sid.code; + EXPECT_EQ(last_msg_.states[51].sid.sat, 91) + << "incorrect value for last_msg_.states[51].sid.sat, expected 91, is " + << last_msg_.states[51].sid.sat; + EXPECT_EQ(last_msg_.states[52].cn0, 56) + << "incorrect value for last_msg_.states[52].cn0, expected 56, is " + << last_msg_.states[52].cn0; + EXPECT_EQ(last_msg_.states[52].fcn, 157) + << "incorrect value for last_msg_.states[52].fcn, expected 157, is " + << last_msg_.states[52].fcn; + EXPECT_EQ(last_msg_.states[52].sid.code, 224) + << "incorrect value for last_msg_.states[52].sid.code, expected 224, is " + << last_msg_.states[52].sid.code; + EXPECT_EQ(last_msg_.states[52].sid.sat, 33) + << "incorrect value for last_msg_.states[52].sid.sat, expected 33, is " + << last_msg_.states[52].sid.sat; + EXPECT_EQ(last_msg_.states[53].cn0, 174) + << "incorrect value for last_msg_.states[53].cn0, expected 174, is " + << last_msg_.states[53].cn0; + EXPECT_EQ(last_msg_.states[53].fcn, 224) + << "incorrect value for last_msg_.states[53].fcn, expected 224, is " + << last_msg_.states[53].fcn; + EXPECT_EQ(last_msg_.states[53].sid.code, 54) + << "incorrect value for last_msg_.states[53].sid.code, expected 54, is " + << last_msg_.states[53].sid.code; + EXPECT_EQ(last_msg_.states[53].sid.sat, 186) + << "incorrect value for last_msg_.states[53].sid.sat, expected 186, is " + << last_msg_.states[53].sid.sat; + EXPECT_EQ(last_msg_.states[54].cn0, 190) + << "incorrect value for last_msg_.states[54].cn0, expected 190, is " + << last_msg_.states[54].cn0; + EXPECT_EQ(last_msg_.states[54].fcn, 148) + << "incorrect value for last_msg_.states[54].fcn, expected 148, is " + << last_msg_.states[54].fcn; + EXPECT_EQ(last_msg_.states[54].sid.code, 84) + << "incorrect value for last_msg_.states[54].sid.code, expected 84, is " + << last_msg_.states[54].sid.code; + EXPECT_EQ(last_msg_.states[54].sid.sat, 82) + << "incorrect value for last_msg_.states[54].sid.sat, expected 82, is " + << last_msg_.states[54].sid.sat; + EXPECT_EQ(last_msg_.states[55].cn0, 67) + << "incorrect value for last_msg_.states[55].cn0, expected 67, is " + << last_msg_.states[55].cn0; + EXPECT_EQ(last_msg_.states[55].fcn, 62) + << "incorrect value for last_msg_.states[55].fcn, expected 62, is " + << last_msg_.states[55].fcn; + EXPECT_EQ(last_msg_.states[55].sid.code, 54) + << "incorrect value for last_msg_.states[55].sid.code, expected 54, is " + << last_msg_.states[55].sid.code; + EXPECT_EQ(last_msg_.states[55].sid.sat, 236) + << "incorrect value for last_msg_.states[55].sid.sat, expected 236, is " + << last_msg_.states[55].sid.sat; + EXPECT_EQ(last_msg_.states[56].cn0, 254) + << "incorrect value for last_msg_.states[56].cn0, expected 254, is " + << last_msg_.states[56].cn0; + EXPECT_EQ(last_msg_.states[56].fcn, 57) + << "incorrect value for last_msg_.states[56].fcn, expected 57, is " + << last_msg_.states[56].fcn; + EXPECT_EQ(last_msg_.states[56].sid.code, 215) + << "incorrect value for last_msg_.states[56].sid.code, expected 215, is " + << last_msg_.states[56].sid.code; + EXPECT_EQ(last_msg_.states[56].sid.sat, 52) + << "incorrect value for last_msg_.states[56].sid.sat, expected 52, is " + << last_msg_.states[56].sid.sat; + EXPECT_EQ(last_msg_.states[57].cn0, 174) + << "incorrect value for last_msg_.states[57].cn0, expected 174, is " + << last_msg_.states[57].cn0; + EXPECT_EQ(last_msg_.states[57].fcn, 36) + << "incorrect value for last_msg_.states[57].fcn, expected 36, is " + << last_msg_.states[57].fcn; + EXPECT_EQ(last_msg_.states[57].sid.code, 133) + << "incorrect value for last_msg_.states[57].sid.code, expected 133, is " + << last_msg_.states[57].sid.code; + EXPECT_EQ(last_msg_.states[57].sid.sat, 16) + << "incorrect value for last_msg_.states[57].sid.sat, expected 16, is " + << last_msg_.states[57].sid.sat; + EXPECT_EQ(last_msg_.states[58].cn0, 17) + << "incorrect value for last_msg_.states[58].cn0, expected 17, is " + << last_msg_.states[58].cn0; + EXPECT_EQ(last_msg_.states[58].fcn, 145) + << "incorrect value for last_msg_.states[58].fcn, expected 145, is " + << last_msg_.states[58].fcn; + EXPECT_EQ(last_msg_.states[58].sid.code, 172) + << "incorrect value for last_msg_.states[58].sid.code, expected 172, is " + << last_msg_.states[58].sid.code; + EXPECT_EQ(last_msg_.states[58].sid.sat, 219) + << "incorrect value for last_msg_.states[58].sid.sat, expected 219, is " + << last_msg_.states[58].sid.sat; + EXPECT_EQ(last_msg_.states[59].cn0, 97) + << "incorrect value for last_msg_.states[59].cn0, expected 97, is " + << last_msg_.states[59].cn0; + EXPECT_EQ(last_msg_.states[59].fcn, 111) + << "incorrect value for last_msg_.states[59].fcn, expected 111, is " + << last_msg_.states[59].fcn; + EXPECT_EQ(last_msg_.states[59].sid.code, 179) + << "incorrect value for last_msg_.states[59].sid.code, expected 179, is " + << last_msg_.states[59].sid.code; + EXPECT_EQ(last_msg_.states[59].sid.sat, 192) + << "incorrect value for last_msg_.states[59].sid.sat, expected 192, is " + << last_msg_.states[59].sid.sat; + EXPECT_EQ(last_msg_.states[60].cn0, 134) + << "incorrect value for last_msg_.states[60].cn0, expected 134, is " + << last_msg_.states[60].cn0; + EXPECT_EQ(last_msg_.states[60].fcn, 208) + << "incorrect value for last_msg_.states[60].fcn, expected 208, is " + << last_msg_.states[60].fcn; + EXPECT_EQ(last_msg_.states[60].sid.code, 56) + << "incorrect value for last_msg_.states[60].sid.code, expected 56, is " + << last_msg_.states[60].sid.code; + EXPECT_EQ(last_msg_.states[60].sid.sat, 207) + << "incorrect value for last_msg_.states[60].sid.sat, expected 207, is " + << last_msg_.states[60].sid.sat; + EXPECT_EQ(last_msg_.states[61].cn0, 226) + << "incorrect value for last_msg_.states[61].cn0, expected 226, is " + << last_msg_.states[61].cn0; + EXPECT_EQ(last_msg_.states[61].fcn, 43) + << "incorrect value for last_msg_.states[61].fcn, expected 43, is " + << last_msg_.states[61].fcn; + EXPECT_EQ(last_msg_.states[61].sid.code, 17) + << "incorrect value for last_msg_.states[61].sid.code, expected 17, is " + << last_msg_.states[61].sid.code; + EXPECT_EQ(last_msg_.states[61].sid.sat, 180) + << "incorrect value for last_msg_.states[61].sid.sat, expected 180, is " + << last_msg_.states[61].sid.sat; + EXPECT_EQ(last_msg_.states[62].cn0, 113) + << "incorrect value for last_msg_.states[62].cn0, expected 113, is " + << last_msg_.states[62].cn0; + EXPECT_EQ(last_msg_.states[62].fcn, 140) + << "incorrect value for last_msg_.states[62].fcn, expected 140, is " + << last_msg_.states[62].fcn; + EXPECT_EQ(last_msg_.states[62].sid.code, 182) + << "incorrect value for last_msg_.states[62].sid.code, expected 182, is " + << last_msg_.states[62].sid.code; + EXPECT_EQ(last_msg_.states[62].sid.sat, 255) + << "incorrect value for last_msg_.states[62].sid.sat, expected 255, is " + << last_msg_.states[62].sid.sat; } diff --git a/c/test/cpp/auto_check_sbp_tracking_MsgTrackingStateDepB.cc b/c/test/cpp/auto_check_sbp_tracking_MsgTrackingStateDepB.cc index a0893d265..c9924177f 100644 --- a/c/test/cpp/auto_check_sbp_tracking_MsgTrackingStateDepB.cc +++ b/c/test/cpp/auto_check_sbp_tracking_MsgTrackingStateDepB.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDepB.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_tracking_MsgTrackingStateDepB0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgTrackingStateDepB0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_tracking_MsgTrackingStateDepB0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgTrackingStateDepB0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_state_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_tracking_state_dep_b_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,356 +67,726 @@ class Test_auto_check_sbp_tracking_MsgTrackingStateDepB0 : sbp_msg_tracking_state_dep_b_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgTrackingStateDepB0, Test) -{ - - uint8_t encoded_frame[] = {85,19,0,242,241,252,115,183,227,63,68,154,1,183,69,255,175,121,43,222,51,67,35,69,78,240,5,53,20,51,211,54,69,153,130,237,66,155,51,227,71,69,53,242,136,161,190,205,188,6,70,153,125,255,142,149,154,217,184,69,248,102,95,31,76,154,33,169,69,131,115,141,27,12,154,225,200,69,208,44,147,39,23,51,3,66,69,237,159,251,49,203,51,99,102,69,70,214,87,128,206,154,121,186,69,14,206,111,218,19,154,121,169,69,216,98,209,54,2,154,25,219,67,200,133,99,7,34,102,198,232,68,155,43,85,135,46,154,177,170,69,155,3,83,171,201,154,241,232,69,121,43,197,16,19,154,241,222,69,128,245,53,63,176,51,115,66,69,36,20,61,153,51,154,73,134,69,46,82,116,140,22,51,147,37,69,177,67,146,96,143,205,76,107,68,220,51,160,201,251,102,102,192,68,168,194,2,161,220,102,102,180,68,69,8,9,125,178,102,70,134,68,185,20,135,186,171,51,163,4,69,18,124,155,85,170,205,208,13,70,57,244,206,255,186,154,105,149,69,165,199,93,181,175,51,67,64,69,6,28, }; - - sbp_msg_tracking_state_dep_b_t test_msg{}; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_states.value = 28; - - test_msg.states[0].cn0 = 5856.2001953125; - test_msg.states[0].sid.code = 63; - test_msg.states[0].sid.reserved = 68; - test_msg.states[0].sid.sat = 58295; - test_msg.states[0].state = 115; - - test_msg.states[1].cn0 = 2612.199951171875; - test_msg.states[1].sid.code = 43; - test_msg.states[1].sid.reserved = 222; - test_msg.states[1].sid.sat = 31151; - test_msg.states[1].state = 255; - - test_msg.states[2].cn0 = 2925.199951171875; - test_msg.states[2].sid.code = 53; - test_msg.states[2].sid.reserved = 20; - test_msg.states[2].sid.sat = 1520; - test_msg.states[2].state = 78; - - test_msg.states[3].cn0 = 3198.199951171875; - test_msg.states[3].sid.code = 66; - test_msg.states[3].sid.reserved = 155; - test_msg.states[3].sid.sat = 60802; - test_msg.states[3].state = 153; - - test_msg.states[4].cn0 = 8623.2001953125; - test_msg.states[4].sid.code = 161; - test_msg.states[4].sid.reserved = 190; - test_msg.states[4].sid.sat = 35058; - test_msg.states[4].state = 53; - - test_msg.states[5].cn0 = 5915.2001953125; - test_msg.states[5].sid.code = 142; - test_msg.states[5].sid.reserved = 149; - test_msg.states[5].sid.sat = 65405; - test_msg.states[5].state = 153; - - test_msg.states[6].cn0 = 5412.2001953125; - test_msg.states[6].sid.code = 31; - test_msg.states[6].sid.reserved = 76; - test_msg.states[6].sid.sat = 24422; - test_msg.states[6].state = 248; - - test_msg.states[7].cn0 = 6428.2001953125; - test_msg.states[7].sid.code = 27; - test_msg.states[7].sid.reserved = 12; - test_msg.states[7].sid.sat = 36211; - test_msg.states[7].state = 131; - - test_msg.states[8].cn0 = 3104.199951171875; - test_msg.states[8].sid.code = 39; - test_msg.states[8].sid.reserved = 23; - test_msg.states[8].sid.sat = 37676; - test_msg.states[8].state = 208; - - test_msg.states[9].cn0 = 3686.199951171875; - test_msg.states[9].sid.code = 49; - test_msg.states[9].sid.reserved = 203; - test_msg.states[9].sid.sat = 64415; - test_msg.states[9].state = 237; - - test_msg.states[10].cn0 = 5967.2001953125; - test_msg.states[10].sid.code = 128; - test_msg.states[10].sid.reserved = 206; - test_msg.states[10].sid.sat = 22486; - test_msg.states[10].state = 70; - - test_msg.states[11].cn0 = 5423.2001953125; - test_msg.states[11].sid.code = 218; - test_msg.states[11].sid.reserved = 19; - test_msg.states[11].sid.sat = 28622; - test_msg.states[11].state = 14; - - test_msg.states[12].cn0 = 438.20001220703125; - test_msg.states[12].sid.code = 54; - test_msg.states[12].sid.reserved = 2; - test_msg.states[12].sid.sat = 53602; - test_msg.states[12].state = 216; - - test_msg.states[13].cn0 = 1862.199951171875; - test_msg.states[13].sid.code = 7; - test_msg.states[13].sid.reserved = 34; - test_msg.states[13].sid.sat = 25477; - test_msg.states[13].state = 200; - - test_msg.states[14].cn0 = 5462.2001953125; - test_msg.states[14].sid.code = 135; - test_msg.states[14].sid.reserved = 46; - test_msg.states[14].sid.sat = 21803; - test_msg.states[14].state = 155; - - test_msg.states[15].cn0 = 7454.2001953125; - test_msg.states[15].sid.code = 171; - test_msg.states[15].sid.reserved = 201; - test_msg.states[15].sid.sat = 21251; - test_msg.states[15].state = 155; - - test_msg.states[16].cn0 = 7134.2001953125; - test_msg.states[16].sid.code = 16; - test_msg.states[16].sid.reserved = 19; - test_msg.states[16].sid.sat = 50475; - test_msg.states[16].state = 121; - - test_msg.states[17].cn0 = 3111.199951171875; - test_msg.states[17].sid.code = 63; - test_msg.states[17].sid.reserved = 176; - test_msg.states[17].sid.sat = 13813; - test_msg.states[17].state = 128; - - test_msg.states[18].cn0 = 4297.2001953125; - test_msg.states[18].sid.code = 153; - test_msg.states[18].sid.reserved = 51; - test_msg.states[18].sid.sat = 15636; - test_msg.states[18].state = 36; - - test_msg.states[19].cn0 = 2649.199951171875; - test_msg.states[19].sid.code = 140; - test_msg.states[19].sid.reserved = 22; - test_msg.states[19].sid.sat = 29778; - test_msg.states[19].state = 46; - - test_msg.states[20].cn0 = 941.2000122070312; - test_msg.states[20].sid.code = 96; - test_msg.states[20].sid.reserved = 143; - test_msg.states[20].sid.sat = 37443; - test_msg.states[20].state = 177; - - test_msg.states[21].cn0 = 1539.199951171875; - test_msg.states[21].sid.code = 201; - test_msg.states[21].sid.reserved = 251; - test_msg.states[21].sid.sat = 41011; - test_msg.states[21].state = 220; - - test_msg.states[22].cn0 = 1443.199951171875; - test_msg.states[22].sid.code = 161; - test_msg.states[22].sid.reserved = 220; - test_msg.states[22].sid.sat = 706; - test_msg.states[22].state = 168; - - test_msg.states[23].cn0 = 1074.199951171875; - test_msg.states[23].sid.code = 125; - test_msg.states[23].sid.reserved = 178; - test_msg.states[23].sid.sat = 2312; - test_msg.states[23].state = 69; - - test_msg.states[24].cn0 = 2122.199951171875; - test_msg.states[24].sid.code = 186; - test_msg.states[24].sid.reserved = 171; - test_msg.states[24].sid.sat = 34580; - test_msg.states[24].state = 185; - - test_msg.states[25].cn0 = 9076.2001953125; - test_msg.states[25].sid.code = 85; - test_msg.states[25].sid.reserved = 170; - test_msg.states[25].sid.sat = 39804; - test_msg.states[25].state = 18; - - test_msg.states[26].cn0 = 4781.2001953125; - test_msg.states[26].sid.code = 255; - test_msg.states[26].sid.reserved = 186; - test_msg.states[26].sid.sat = 52980; - test_msg.states[26].state = 57; - - test_msg.states[27].cn0 = 3076.199951171875; - test_msg.states[27].sid.code = 181; - test_msg.states[27].sid.reserved = 175; - test_msg.states[27].sid.sat = 24007; - test_msg.states[27].state = 165; - - EXPECT_EQ(send_message( 61938, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61938); - EXPECT_EQ(last_msg_, test_msg); - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_states.value, 28) << "incorrect value for last_msg_.n_states.value, expected 28, is " << last_msg_.n_states.value; - EXPECT_LT((last_msg_.states[0].cn0 * 100 - 5856.20019531 * 100), 0.05) << "incorrect value for last_msg_.states[0].cn0, expected 5856.20019531, is " << last_msg_.states[0].cn0; - EXPECT_EQ(last_msg_.states[0].sid.code, 63) << "incorrect value for last_msg_.states[0].sid.code, expected 63, is " << last_msg_.states[0].sid.code; - EXPECT_EQ(last_msg_.states[0].sid.reserved, 68) << "incorrect value for last_msg_.states[0].sid.reserved, expected 68, is " << last_msg_.states[0].sid.reserved; - EXPECT_EQ(last_msg_.states[0].sid.sat, 58295) << "incorrect value for last_msg_.states[0].sid.sat, expected 58295, is " << last_msg_.states[0].sid.sat; - EXPECT_EQ(last_msg_.states[0].state, 115) << "incorrect value for last_msg_.states[0].state, expected 115, is " << last_msg_.states[0].state; - EXPECT_LT((last_msg_.states[1].cn0 * 100 - 2612.19995117 * 100), 0.05) << "incorrect value for last_msg_.states[1].cn0, expected 2612.19995117, is " << last_msg_.states[1].cn0; - EXPECT_EQ(last_msg_.states[1].sid.code, 43) << "incorrect value for last_msg_.states[1].sid.code, expected 43, is " << last_msg_.states[1].sid.code; - EXPECT_EQ(last_msg_.states[1].sid.reserved, 222) << "incorrect value for last_msg_.states[1].sid.reserved, expected 222, is " << last_msg_.states[1].sid.reserved; - EXPECT_EQ(last_msg_.states[1].sid.sat, 31151) << "incorrect value for last_msg_.states[1].sid.sat, expected 31151, is " << last_msg_.states[1].sid.sat; - EXPECT_EQ(last_msg_.states[1].state, 255) << "incorrect value for last_msg_.states[1].state, expected 255, is " << last_msg_.states[1].state; - EXPECT_LT((last_msg_.states[2].cn0 * 100 - 2925.19995117 * 100), 0.05) << "incorrect value for last_msg_.states[2].cn0, expected 2925.19995117, is " << last_msg_.states[2].cn0; - EXPECT_EQ(last_msg_.states[2].sid.code, 53) << "incorrect value for last_msg_.states[2].sid.code, expected 53, is " << last_msg_.states[2].sid.code; - EXPECT_EQ(last_msg_.states[2].sid.reserved, 20) << "incorrect value for last_msg_.states[2].sid.reserved, expected 20, is " << last_msg_.states[2].sid.reserved; - EXPECT_EQ(last_msg_.states[2].sid.sat, 1520) << "incorrect value for last_msg_.states[2].sid.sat, expected 1520, is " << last_msg_.states[2].sid.sat; - EXPECT_EQ(last_msg_.states[2].state, 78) << "incorrect value for last_msg_.states[2].state, expected 78, is " << last_msg_.states[2].state; - EXPECT_LT((last_msg_.states[3].cn0 * 100 - 3198.19995117 * 100), 0.05) << "incorrect value for last_msg_.states[3].cn0, expected 3198.19995117, is " << last_msg_.states[3].cn0; - EXPECT_EQ(last_msg_.states[3].sid.code, 66) << "incorrect value for last_msg_.states[3].sid.code, expected 66, is " << last_msg_.states[3].sid.code; - EXPECT_EQ(last_msg_.states[3].sid.reserved, 155) << "incorrect value for last_msg_.states[3].sid.reserved, expected 155, is " << last_msg_.states[3].sid.reserved; - EXPECT_EQ(last_msg_.states[3].sid.sat, 60802) << "incorrect value for last_msg_.states[3].sid.sat, expected 60802, is " << last_msg_.states[3].sid.sat; - EXPECT_EQ(last_msg_.states[3].state, 153) << "incorrect value for last_msg_.states[3].state, expected 153, is " << last_msg_.states[3].state; - EXPECT_LT((last_msg_.states[4].cn0 * 100 - 8623.20019531 * 100), 0.05) << "incorrect value for last_msg_.states[4].cn0, expected 8623.20019531, is " << last_msg_.states[4].cn0; - EXPECT_EQ(last_msg_.states[4].sid.code, 161) << "incorrect value for last_msg_.states[4].sid.code, expected 161, is " << last_msg_.states[4].sid.code; - EXPECT_EQ(last_msg_.states[4].sid.reserved, 190) << "incorrect value for last_msg_.states[4].sid.reserved, expected 190, is " << last_msg_.states[4].sid.reserved; - EXPECT_EQ(last_msg_.states[4].sid.sat, 35058) << "incorrect value for last_msg_.states[4].sid.sat, expected 35058, is " << last_msg_.states[4].sid.sat; - EXPECT_EQ(last_msg_.states[4].state, 53) << "incorrect value for last_msg_.states[4].state, expected 53, is " << last_msg_.states[4].state; - EXPECT_LT((last_msg_.states[5].cn0 * 100 - 5915.20019531 * 100), 0.05) << "incorrect value for last_msg_.states[5].cn0, expected 5915.20019531, is " << last_msg_.states[5].cn0; - EXPECT_EQ(last_msg_.states[5].sid.code, 142) << "incorrect value for last_msg_.states[5].sid.code, expected 142, is " << last_msg_.states[5].sid.code; - EXPECT_EQ(last_msg_.states[5].sid.reserved, 149) << "incorrect value for last_msg_.states[5].sid.reserved, expected 149, is " << last_msg_.states[5].sid.reserved; - EXPECT_EQ(last_msg_.states[5].sid.sat, 65405) << "incorrect value for last_msg_.states[5].sid.sat, expected 65405, is " << last_msg_.states[5].sid.sat; - EXPECT_EQ(last_msg_.states[5].state, 153) << "incorrect value for last_msg_.states[5].state, expected 153, is " << last_msg_.states[5].state; - EXPECT_LT((last_msg_.states[6].cn0 * 100 - 5412.20019531 * 100), 0.05) << "incorrect value for last_msg_.states[6].cn0, expected 5412.20019531, is " << last_msg_.states[6].cn0; - EXPECT_EQ(last_msg_.states[6].sid.code, 31) << "incorrect value for last_msg_.states[6].sid.code, expected 31, is " << last_msg_.states[6].sid.code; - EXPECT_EQ(last_msg_.states[6].sid.reserved, 76) << "incorrect value for last_msg_.states[6].sid.reserved, expected 76, is " << last_msg_.states[6].sid.reserved; - EXPECT_EQ(last_msg_.states[6].sid.sat, 24422) << "incorrect value for last_msg_.states[6].sid.sat, expected 24422, is " << last_msg_.states[6].sid.sat; - EXPECT_EQ(last_msg_.states[6].state, 248) << "incorrect value for last_msg_.states[6].state, expected 248, is " << last_msg_.states[6].state; - EXPECT_LT((last_msg_.states[7].cn0 * 100 - 6428.20019531 * 100), 0.05) << "incorrect value for last_msg_.states[7].cn0, expected 6428.20019531, is " << last_msg_.states[7].cn0; - EXPECT_EQ(last_msg_.states[7].sid.code, 27) << "incorrect value for last_msg_.states[7].sid.code, expected 27, is " << last_msg_.states[7].sid.code; - EXPECT_EQ(last_msg_.states[7].sid.reserved, 12) << "incorrect value for last_msg_.states[7].sid.reserved, expected 12, is " << last_msg_.states[7].sid.reserved; - EXPECT_EQ(last_msg_.states[7].sid.sat, 36211) << "incorrect value for last_msg_.states[7].sid.sat, expected 36211, is " << last_msg_.states[7].sid.sat; - EXPECT_EQ(last_msg_.states[7].state, 131) << "incorrect value for last_msg_.states[7].state, expected 131, is " << last_msg_.states[7].state; - EXPECT_LT((last_msg_.states[8].cn0 * 100 - 3104.19995117 * 100), 0.05) << "incorrect value for last_msg_.states[8].cn0, expected 3104.19995117, is " << last_msg_.states[8].cn0; - EXPECT_EQ(last_msg_.states[8].sid.code, 39) << "incorrect value for last_msg_.states[8].sid.code, expected 39, is " << last_msg_.states[8].sid.code; - EXPECT_EQ(last_msg_.states[8].sid.reserved, 23) << "incorrect value for last_msg_.states[8].sid.reserved, expected 23, is " << last_msg_.states[8].sid.reserved; - EXPECT_EQ(last_msg_.states[8].sid.sat, 37676) << "incorrect value for last_msg_.states[8].sid.sat, expected 37676, is " << last_msg_.states[8].sid.sat; - EXPECT_EQ(last_msg_.states[8].state, 208) << "incorrect value for last_msg_.states[8].state, expected 208, is " << last_msg_.states[8].state; - EXPECT_LT((last_msg_.states[9].cn0 * 100 - 3686.19995117 * 100), 0.05) << "incorrect value for last_msg_.states[9].cn0, expected 3686.19995117, is " << last_msg_.states[9].cn0; - EXPECT_EQ(last_msg_.states[9].sid.code, 49) << "incorrect value for last_msg_.states[9].sid.code, expected 49, is " << last_msg_.states[9].sid.code; - EXPECT_EQ(last_msg_.states[9].sid.reserved, 203) << "incorrect value for last_msg_.states[9].sid.reserved, expected 203, is " << last_msg_.states[9].sid.reserved; - EXPECT_EQ(last_msg_.states[9].sid.sat, 64415) << "incorrect value for last_msg_.states[9].sid.sat, expected 64415, is " << last_msg_.states[9].sid.sat; - EXPECT_EQ(last_msg_.states[9].state, 237) << "incorrect value for last_msg_.states[9].state, expected 237, is " << last_msg_.states[9].state; - EXPECT_LT((last_msg_.states[10].cn0 * 100 - 5967.20019531 * 100), 0.05) << "incorrect value for last_msg_.states[10].cn0, expected 5967.20019531, is " << last_msg_.states[10].cn0; - EXPECT_EQ(last_msg_.states[10].sid.code, 128) << "incorrect value for last_msg_.states[10].sid.code, expected 128, is " << last_msg_.states[10].sid.code; - EXPECT_EQ(last_msg_.states[10].sid.reserved, 206) << "incorrect value for last_msg_.states[10].sid.reserved, expected 206, is " << last_msg_.states[10].sid.reserved; - EXPECT_EQ(last_msg_.states[10].sid.sat, 22486) << "incorrect value for last_msg_.states[10].sid.sat, expected 22486, is " << last_msg_.states[10].sid.sat; - EXPECT_EQ(last_msg_.states[10].state, 70) << "incorrect value for last_msg_.states[10].state, expected 70, is " << last_msg_.states[10].state; - EXPECT_LT((last_msg_.states[11].cn0 * 100 - 5423.20019531 * 100), 0.05) << "incorrect value for last_msg_.states[11].cn0, expected 5423.20019531, is " << last_msg_.states[11].cn0; - EXPECT_EQ(last_msg_.states[11].sid.code, 218) << "incorrect value for last_msg_.states[11].sid.code, expected 218, is " << last_msg_.states[11].sid.code; - EXPECT_EQ(last_msg_.states[11].sid.reserved, 19) << "incorrect value for last_msg_.states[11].sid.reserved, expected 19, is " << last_msg_.states[11].sid.reserved; - EXPECT_EQ(last_msg_.states[11].sid.sat, 28622) << "incorrect value for last_msg_.states[11].sid.sat, expected 28622, is " << last_msg_.states[11].sid.sat; - EXPECT_EQ(last_msg_.states[11].state, 14) << "incorrect value for last_msg_.states[11].state, expected 14, is " << last_msg_.states[11].state; - EXPECT_LT((last_msg_.states[12].cn0 * 100 - 438.200012207 * 100), 0.05) << "incorrect value for last_msg_.states[12].cn0, expected 438.200012207, is " << last_msg_.states[12].cn0; - EXPECT_EQ(last_msg_.states[12].sid.code, 54) << "incorrect value for last_msg_.states[12].sid.code, expected 54, is " << last_msg_.states[12].sid.code; - EXPECT_EQ(last_msg_.states[12].sid.reserved, 2) << "incorrect value for last_msg_.states[12].sid.reserved, expected 2, is " << last_msg_.states[12].sid.reserved; - EXPECT_EQ(last_msg_.states[12].sid.sat, 53602) << "incorrect value for last_msg_.states[12].sid.sat, expected 53602, is " << last_msg_.states[12].sid.sat; - EXPECT_EQ(last_msg_.states[12].state, 216) << "incorrect value for last_msg_.states[12].state, expected 216, is " << last_msg_.states[12].state; - EXPECT_LT((last_msg_.states[13].cn0 * 100 - 1862.19995117 * 100), 0.05) << "incorrect value for last_msg_.states[13].cn0, expected 1862.19995117, is " << last_msg_.states[13].cn0; - EXPECT_EQ(last_msg_.states[13].sid.code, 7) << "incorrect value for last_msg_.states[13].sid.code, expected 7, is " << last_msg_.states[13].sid.code; - EXPECT_EQ(last_msg_.states[13].sid.reserved, 34) << "incorrect value for last_msg_.states[13].sid.reserved, expected 34, is " << last_msg_.states[13].sid.reserved; - EXPECT_EQ(last_msg_.states[13].sid.sat, 25477) << "incorrect value for last_msg_.states[13].sid.sat, expected 25477, is " << last_msg_.states[13].sid.sat; - EXPECT_EQ(last_msg_.states[13].state, 200) << "incorrect value for last_msg_.states[13].state, expected 200, is " << last_msg_.states[13].state; - EXPECT_LT((last_msg_.states[14].cn0 * 100 - 5462.20019531 * 100), 0.05) << "incorrect value for last_msg_.states[14].cn0, expected 5462.20019531, is " << last_msg_.states[14].cn0; - EXPECT_EQ(last_msg_.states[14].sid.code, 135) << "incorrect value for last_msg_.states[14].sid.code, expected 135, is " << last_msg_.states[14].sid.code; - EXPECT_EQ(last_msg_.states[14].sid.reserved, 46) << "incorrect value for last_msg_.states[14].sid.reserved, expected 46, is " << last_msg_.states[14].sid.reserved; - EXPECT_EQ(last_msg_.states[14].sid.sat, 21803) << "incorrect value for last_msg_.states[14].sid.sat, expected 21803, is " << last_msg_.states[14].sid.sat; - EXPECT_EQ(last_msg_.states[14].state, 155) << "incorrect value for last_msg_.states[14].state, expected 155, is " << last_msg_.states[14].state; - EXPECT_LT((last_msg_.states[15].cn0 * 100 - 7454.20019531 * 100), 0.05) << "incorrect value for last_msg_.states[15].cn0, expected 7454.20019531, is " << last_msg_.states[15].cn0; - EXPECT_EQ(last_msg_.states[15].sid.code, 171) << "incorrect value for last_msg_.states[15].sid.code, expected 171, is " << last_msg_.states[15].sid.code; - EXPECT_EQ(last_msg_.states[15].sid.reserved, 201) << "incorrect value for last_msg_.states[15].sid.reserved, expected 201, is " << last_msg_.states[15].sid.reserved; - EXPECT_EQ(last_msg_.states[15].sid.sat, 21251) << "incorrect value for last_msg_.states[15].sid.sat, expected 21251, is " << last_msg_.states[15].sid.sat; - EXPECT_EQ(last_msg_.states[15].state, 155) << "incorrect value for last_msg_.states[15].state, expected 155, is " << last_msg_.states[15].state; - EXPECT_LT((last_msg_.states[16].cn0 * 100 - 7134.20019531 * 100), 0.05) << "incorrect value for last_msg_.states[16].cn0, expected 7134.20019531, is " << last_msg_.states[16].cn0; - EXPECT_EQ(last_msg_.states[16].sid.code, 16) << "incorrect value for last_msg_.states[16].sid.code, expected 16, is " << last_msg_.states[16].sid.code; - EXPECT_EQ(last_msg_.states[16].sid.reserved, 19) << "incorrect value for last_msg_.states[16].sid.reserved, expected 19, is " << last_msg_.states[16].sid.reserved; - EXPECT_EQ(last_msg_.states[16].sid.sat, 50475) << "incorrect value for last_msg_.states[16].sid.sat, expected 50475, is " << last_msg_.states[16].sid.sat; - EXPECT_EQ(last_msg_.states[16].state, 121) << "incorrect value for last_msg_.states[16].state, expected 121, is " << last_msg_.states[16].state; - EXPECT_LT((last_msg_.states[17].cn0 * 100 - 3111.19995117 * 100), 0.05) << "incorrect value for last_msg_.states[17].cn0, expected 3111.19995117, is " << last_msg_.states[17].cn0; - EXPECT_EQ(last_msg_.states[17].sid.code, 63) << "incorrect value for last_msg_.states[17].sid.code, expected 63, is " << last_msg_.states[17].sid.code; - EXPECT_EQ(last_msg_.states[17].sid.reserved, 176) << "incorrect value for last_msg_.states[17].sid.reserved, expected 176, is " << last_msg_.states[17].sid.reserved; - EXPECT_EQ(last_msg_.states[17].sid.sat, 13813) << "incorrect value for last_msg_.states[17].sid.sat, expected 13813, is " << last_msg_.states[17].sid.sat; - EXPECT_EQ(last_msg_.states[17].state, 128) << "incorrect value for last_msg_.states[17].state, expected 128, is " << last_msg_.states[17].state; - EXPECT_LT((last_msg_.states[18].cn0 * 100 - 4297.20019531 * 100), 0.05) << "incorrect value for last_msg_.states[18].cn0, expected 4297.20019531, is " << last_msg_.states[18].cn0; - EXPECT_EQ(last_msg_.states[18].sid.code, 153) << "incorrect value for last_msg_.states[18].sid.code, expected 153, is " << last_msg_.states[18].sid.code; - EXPECT_EQ(last_msg_.states[18].sid.reserved, 51) << "incorrect value for last_msg_.states[18].sid.reserved, expected 51, is " << last_msg_.states[18].sid.reserved; - EXPECT_EQ(last_msg_.states[18].sid.sat, 15636) << "incorrect value for last_msg_.states[18].sid.sat, expected 15636, is " << last_msg_.states[18].sid.sat; - EXPECT_EQ(last_msg_.states[18].state, 36) << "incorrect value for last_msg_.states[18].state, expected 36, is " << last_msg_.states[18].state; - EXPECT_LT((last_msg_.states[19].cn0 * 100 - 2649.19995117 * 100), 0.05) << "incorrect value for last_msg_.states[19].cn0, expected 2649.19995117, is " << last_msg_.states[19].cn0; - EXPECT_EQ(last_msg_.states[19].sid.code, 140) << "incorrect value for last_msg_.states[19].sid.code, expected 140, is " << last_msg_.states[19].sid.code; - EXPECT_EQ(last_msg_.states[19].sid.reserved, 22) << "incorrect value for last_msg_.states[19].sid.reserved, expected 22, is " << last_msg_.states[19].sid.reserved; - EXPECT_EQ(last_msg_.states[19].sid.sat, 29778) << "incorrect value for last_msg_.states[19].sid.sat, expected 29778, is " << last_msg_.states[19].sid.sat; - EXPECT_EQ(last_msg_.states[19].state, 46) << "incorrect value for last_msg_.states[19].state, expected 46, is " << last_msg_.states[19].state; - EXPECT_LT((last_msg_.states[20].cn0 * 100 - 941.200012207 * 100), 0.05) << "incorrect value for last_msg_.states[20].cn0, expected 941.200012207, is " << last_msg_.states[20].cn0; - EXPECT_EQ(last_msg_.states[20].sid.code, 96) << "incorrect value for last_msg_.states[20].sid.code, expected 96, is " << last_msg_.states[20].sid.code; - EXPECT_EQ(last_msg_.states[20].sid.reserved, 143) << "incorrect value for last_msg_.states[20].sid.reserved, expected 143, is " << last_msg_.states[20].sid.reserved; - EXPECT_EQ(last_msg_.states[20].sid.sat, 37443) << "incorrect value for last_msg_.states[20].sid.sat, expected 37443, is " << last_msg_.states[20].sid.sat; - EXPECT_EQ(last_msg_.states[20].state, 177) << "incorrect value for last_msg_.states[20].state, expected 177, is " << last_msg_.states[20].state; - EXPECT_LT((last_msg_.states[21].cn0 * 100 - 1539.19995117 * 100), 0.05) << "incorrect value for last_msg_.states[21].cn0, expected 1539.19995117, is " << last_msg_.states[21].cn0; - EXPECT_EQ(last_msg_.states[21].sid.code, 201) << "incorrect value for last_msg_.states[21].sid.code, expected 201, is " << last_msg_.states[21].sid.code; - EXPECT_EQ(last_msg_.states[21].sid.reserved, 251) << "incorrect value for last_msg_.states[21].sid.reserved, expected 251, is " << last_msg_.states[21].sid.reserved; - EXPECT_EQ(last_msg_.states[21].sid.sat, 41011) << "incorrect value for last_msg_.states[21].sid.sat, expected 41011, is " << last_msg_.states[21].sid.sat; - EXPECT_EQ(last_msg_.states[21].state, 220) << "incorrect value for last_msg_.states[21].state, expected 220, is " << last_msg_.states[21].state; - EXPECT_LT((last_msg_.states[22].cn0 * 100 - 1443.19995117 * 100), 0.05) << "incorrect value for last_msg_.states[22].cn0, expected 1443.19995117, is " << last_msg_.states[22].cn0; - EXPECT_EQ(last_msg_.states[22].sid.code, 161) << "incorrect value for last_msg_.states[22].sid.code, expected 161, is " << last_msg_.states[22].sid.code; - EXPECT_EQ(last_msg_.states[22].sid.reserved, 220) << "incorrect value for last_msg_.states[22].sid.reserved, expected 220, is " << last_msg_.states[22].sid.reserved; - EXPECT_EQ(last_msg_.states[22].sid.sat, 706) << "incorrect value for last_msg_.states[22].sid.sat, expected 706, is " << last_msg_.states[22].sid.sat; - EXPECT_EQ(last_msg_.states[22].state, 168) << "incorrect value for last_msg_.states[22].state, expected 168, is " << last_msg_.states[22].state; - EXPECT_LT((last_msg_.states[23].cn0 * 100 - 1074.19995117 * 100), 0.05) << "incorrect value for last_msg_.states[23].cn0, expected 1074.19995117, is " << last_msg_.states[23].cn0; - EXPECT_EQ(last_msg_.states[23].sid.code, 125) << "incorrect value for last_msg_.states[23].sid.code, expected 125, is " << last_msg_.states[23].sid.code; - EXPECT_EQ(last_msg_.states[23].sid.reserved, 178) << "incorrect value for last_msg_.states[23].sid.reserved, expected 178, is " << last_msg_.states[23].sid.reserved; - EXPECT_EQ(last_msg_.states[23].sid.sat, 2312) << "incorrect value for last_msg_.states[23].sid.sat, expected 2312, is " << last_msg_.states[23].sid.sat; - EXPECT_EQ(last_msg_.states[23].state, 69) << "incorrect value for last_msg_.states[23].state, expected 69, is " << last_msg_.states[23].state; - EXPECT_LT((last_msg_.states[24].cn0 * 100 - 2122.19995117 * 100), 0.05) << "incorrect value for last_msg_.states[24].cn0, expected 2122.19995117, is " << last_msg_.states[24].cn0; - EXPECT_EQ(last_msg_.states[24].sid.code, 186) << "incorrect value for last_msg_.states[24].sid.code, expected 186, is " << last_msg_.states[24].sid.code; - EXPECT_EQ(last_msg_.states[24].sid.reserved, 171) << "incorrect value for last_msg_.states[24].sid.reserved, expected 171, is " << last_msg_.states[24].sid.reserved; - EXPECT_EQ(last_msg_.states[24].sid.sat, 34580) << "incorrect value for last_msg_.states[24].sid.sat, expected 34580, is " << last_msg_.states[24].sid.sat; - EXPECT_EQ(last_msg_.states[24].state, 185) << "incorrect value for last_msg_.states[24].state, expected 185, is " << last_msg_.states[24].state; - EXPECT_LT((last_msg_.states[25].cn0 * 100 - 9076.20019531 * 100), 0.05) << "incorrect value for last_msg_.states[25].cn0, expected 9076.20019531, is " << last_msg_.states[25].cn0; - EXPECT_EQ(last_msg_.states[25].sid.code, 85) << "incorrect value for last_msg_.states[25].sid.code, expected 85, is " << last_msg_.states[25].sid.code; - EXPECT_EQ(last_msg_.states[25].sid.reserved, 170) << "incorrect value for last_msg_.states[25].sid.reserved, expected 170, is " << last_msg_.states[25].sid.reserved; - EXPECT_EQ(last_msg_.states[25].sid.sat, 39804) << "incorrect value for last_msg_.states[25].sid.sat, expected 39804, is " << last_msg_.states[25].sid.sat; - EXPECT_EQ(last_msg_.states[25].state, 18) << "incorrect value for last_msg_.states[25].state, expected 18, is " << last_msg_.states[25].state; - EXPECT_LT((last_msg_.states[26].cn0 * 100 - 4781.20019531 * 100), 0.05) << "incorrect value for last_msg_.states[26].cn0, expected 4781.20019531, is " << last_msg_.states[26].cn0; - EXPECT_EQ(last_msg_.states[26].sid.code, 255) << "incorrect value for last_msg_.states[26].sid.code, expected 255, is " << last_msg_.states[26].sid.code; - EXPECT_EQ(last_msg_.states[26].sid.reserved, 186) << "incorrect value for last_msg_.states[26].sid.reserved, expected 186, is " << last_msg_.states[26].sid.reserved; - EXPECT_EQ(last_msg_.states[26].sid.sat, 52980) << "incorrect value for last_msg_.states[26].sid.sat, expected 52980, is " << last_msg_.states[26].sid.sat; - EXPECT_EQ(last_msg_.states[26].state, 57) << "incorrect value for last_msg_.states[26].state, expected 57, is " << last_msg_.states[26].state; - EXPECT_LT((last_msg_.states[27].cn0 * 100 - 3076.19995117 * 100), 0.05) << "incorrect value for last_msg_.states[27].cn0, expected 3076.19995117, is " << last_msg_.states[27].cn0; - EXPECT_EQ(last_msg_.states[27].sid.code, 181) << "incorrect value for last_msg_.states[27].sid.code, expected 181, is " << last_msg_.states[27].sid.code; - EXPECT_EQ(last_msg_.states[27].sid.reserved, 175) << "incorrect value for last_msg_.states[27].sid.reserved, expected 175, is " << last_msg_.states[27].sid.reserved; - EXPECT_EQ(last_msg_.states[27].sid.sat, 24007) << "incorrect value for last_msg_.states[27].sid.sat, expected 24007, is " << last_msg_.states[27].sid.sat; - EXPECT_EQ(last_msg_.states[27].state, 165) << "incorrect value for last_msg_.states[27].state, expected 165, is " << last_msg_.states[27].state; +}; + +TEST_F(Test_auto_check_sbp_tracking_MsgTrackingStateDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 19, 0, 242, 241, 252, 115, 183, 227, 63, 68, 154, 1, 183, 69, + 255, 175, 121, 43, 222, 51, 67, 35, 69, 78, 240, 5, 53, 20, 51, + 211, 54, 69, 153, 130, 237, 66, 155, 51, 227, 71, 69, 53, 242, 136, + 161, 190, 205, 188, 6, 70, 153, 125, 255, 142, 149, 154, 217, 184, 69, + 248, 102, 95, 31, 76, 154, 33, 169, 69, 131, 115, 141, 27, 12, 154, + 225, 200, 69, 208, 44, 147, 39, 23, 51, 3, 66, 69, 237, 159, 251, + 49, 203, 51, 99, 102, 69, 70, 214, 87, 128, 206, 154, 121, 186, 69, + 14, 206, 111, 218, 19, 154, 121, 169, 69, 216, 98, 209, 54, 2, 154, + 25, 219, 67, 200, 133, 99, 7, 34, 102, 198, 232, 68, 155, 43, 85, + 135, 46, 154, 177, 170, 69, 155, 3, 83, 171, 201, 154, 241, 232, 69, + 121, 43, 197, 16, 19, 154, 241, 222, 69, 128, 245, 53, 63, 176, 51, + 115, 66, 69, 36, 20, 61, 153, 51, 154, 73, 134, 69, 46, 82, 116, + 140, 22, 51, 147, 37, 69, 177, 67, 146, 96, 143, 205, 76, 107, 68, + 220, 51, 160, 201, 251, 102, 102, 192, 68, 168, 194, 2, 161, 220, 102, + 102, 180, 68, 69, 8, 9, 125, 178, 102, 70, 134, 68, 185, 20, 135, + 186, 171, 51, 163, 4, 69, 18, 124, 155, 85, 170, 205, 208, 13, 70, + 57, 244, 206, 255, 186, 154, 105, 149, 69, 165, 199, 93, 181, 175, 51, + 67, 64, 69, 6, 28, + }; + + sbp_msg_tracking_state_dep_b_t test_msg{}; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_states.value = 28; + + test_msg.states[0].cn0 = 5856.2001953125; + test_msg.states[0].sid.code = 63; + test_msg.states[0].sid.reserved = 68; + test_msg.states[0].sid.sat = 58295; + test_msg.states[0].state = 115; + + test_msg.states[1].cn0 = 2612.199951171875; + test_msg.states[1].sid.code = 43; + test_msg.states[1].sid.reserved = 222; + test_msg.states[1].sid.sat = 31151; + test_msg.states[1].state = 255; + + test_msg.states[2].cn0 = 2925.199951171875; + test_msg.states[2].sid.code = 53; + test_msg.states[2].sid.reserved = 20; + test_msg.states[2].sid.sat = 1520; + test_msg.states[2].state = 78; + + test_msg.states[3].cn0 = 3198.199951171875; + test_msg.states[3].sid.code = 66; + test_msg.states[3].sid.reserved = 155; + test_msg.states[3].sid.sat = 60802; + test_msg.states[3].state = 153; + + test_msg.states[4].cn0 = 8623.2001953125; + test_msg.states[4].sid.code = 161; + test_msg.states[4].sid.reserved = 190; + test_msg.states[4].sid.sat = 35058; + test_msg.states[4].state = 53; + + test_msg.states[5].cn0 = 5915.2001953125; + test_msg.states[5].sid.code = 142; + test_msg.states[5].sid.reserved = 149; + test_msg.states[5].sid.sat = 65405; + test_msg.states[5].state = 153; + + test_msg.states[6].cn0 = 5412.2001953125; + test_msg.states[6].sid.code = 31; + test_msg.states[6].sid.reserved = 76; + test_msg.states[6].sid.sat = 24422; + test_msg.states[6].state = 248; + + test_msg.states[7].cn0 = 6428.2001953125; + test_msg.states[7].sid.code = 27; + test_msg.states[7].sid.reserved = 12; + test_msg.states[7].sid.sat = 36211; + test_msg.states[7].state = 131; + + test_msg.states[8].cn0 = 3104.199951171875; + test_msg.states[8].sid.code = 39; + test_msg.states[8].sid.reserved = 23; + test_msg.states[8].sid.sat = 37676; + test_msg.states[8].state = 208; + + test_msg.states[9].cn0 = 3686.199951171875; + test_msg.states[9].sid.code = 49; + test_msg.states[9].sid.reserved = 203; + test_msg.states[9].sid.sat = 64415; + test_msg.states[9].state = 237; + + test_msg.states[10].cn0 = 5967.2001953125; + test_msg.states[10].sid.code = 128; + test_msg.states[10].sid.reserved = 206; + test_msg.states[10].sid.sat = 22486; + test_msg.states[10].state = 70; + + test_msg.states[11].cn0 = 5423.2001953125; + test_msg.states[11].sid.code = 218; + test_msg.states[11].sid.reserved = 19; + test_msg.states[11].sid.sat = 28622; + test_msg.states[11].state = 14; + + test_msg.states[12].cn0 = 438.20001220703125; + test_msg.states[12].sid.code = 54; + test_msg.states[12].sid.reserved = 2; + test_msg.states[12].sid.sat = 53602; + test_msg.states[12].state = 216; + + test_msg.states[13].cn0 = 1862.199951171875; + test_msg.states[13].sid.code = 7; + test_msg.states[13].sid.reserved = 34; + test_msg.states[13].sid.sat = 25477; + test_msg.states[13].state = 200; + + test_msg.states[14].cn0 = 5462.2001953125; + test_msg.states[14].sid.code = 135; + test_msg.states[14].sid.reserved = 46; + test_msg.states[14].sid.sat = 21803; + test_msg.states[14].state = 155; + + test_msg.states[15].cn0 = 7454.2001953125; + test_msg.states[15].sid.code = 171; + test_msg.states[15].sid.reserved = 201; + test_msg.states[15].sid.sat = 21251; + test_msg.states[15].state = 155; + + test_msg.states[16].cn0 = 7134.2001953125; + test_msg.states[16].sid.code = 16; + test_msg.states[16].sid.reserved = 19; + test_msg.states[16].sid.sat = 50475; + test_msg.states[16].state = 121; + + test_msg.states[17].cn0 = 3111.199951171875; + test_msg.states[17].sid.code = 63; + test_msg.states[17].sid.reserved = 176; + test_msg.states[17].sid.sat = 13813; + test_msg.states[17].state = 128; + + test_msg.states[18].cn0 = 4297.2001953125; + test_msg.states[18].sid.code = 153; + test_msg.states[18].sid.reserved = 51; + test_msg.states[18].sid.sat = 15636; + test_msg.states[18].state = 36; + + test_msg.states[19].cn0 = 2649.199951171875; + test_msg.states[19].sid.code = 140; + test_msg.states[19].sid.reserved = 22; + test_msg.states[19].sid.sat = 29778; + test_msg.states[19].state = 46; + + test_msg.states[20].cn0 = 941.2000122070312; + test_msg.states[20].sid.code = 96; + test_msg.states[20].sid.reserved = 143; + test_msg.states[20].sid.sat = 37443; + test_msg.states[20].state = 177; + + test_msg.states[21].cn0 = 1539.199951171875; + test_msg.states[21].sid.code = 201; + test_msg.states[21].sid.reserved = 251; + test_msg.states[21].sid.sat = 41011; + test_msg.states[21].state = 220; + + test_msg.states[22].cn0 = 1443.199951171875; + test_msg.states[22].sid.code = 161; + test_msg.states[22].sid.reserved = 220; + test_msg.states[22].sid.sat = 706; + test_msg.states[22].state = 168; + + test_msg.states[23].cn0 = 1074.199951171875; + test_msg.states[23].sid.code = 125; + test_msg.states[23].sid.reserved = 178; + test_msg.states[23].sid.sat = 2312; + test_msg.states[23].state = 69; + + test_msg.states[24].cn0 = 2122.199951171875; + test_msg.states[24].sid.code = 186; + test_msg.states[24].sid.reserved = 171; + test_msg.states[24].sid.sat = 34580; + test_msg.states[24].state = 185; + + test_msg.states[25].cn0 = 9076.2001953125; + test_msg.states[25].sid.code = 85; + test_msg.states[25].sid.reserved = 170; + test_msg.states[25].sid.sat = 39804; + test_msg.states[25].state = 18; + + test_msg.states[26].cn0 = 4781.2001953125; + test_msg.states[26].sid.code = 255; + test_msg.states[26].sid.reserved = 186; + test_msg.states[26].sid.sat = 52980; + test_msg.states[26].state = 57; + + test_msg.states[27].cn0 = 3076.199951171875; + test_msg.states[27].sid.code = 181; + test_msg.states[27].sid.reserved = 175; + test_msg.states[27].sid.sat = 24007; + test_msg.states[27].state = 165; + + EXPECT_EQ(send_message(61938, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61938); + EXPECT_EQ(last_msg_, test_msg); + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_states.value, 28) + << "incorrect value for last_msg_.n_states.value, expected 28, is " + << last_msg_.n_states.value; + EXPECT_LT((last_msg_.states[0].cn0 * 100 - 5856.20019531 * 100), 0.05) + << "incorrect value for last_msg_.states[0].cn0, expected 5856.20019531, " + "is " + << last_msg_.states[0].cn0; + EXPECT_EQ(last_msg_.states[0].sid.code, 63) + << "incorrect value for last_msg_.states[0].sid.code, expected 63, is " + << last_msg_.states[0].sid.code; + EXPECT_EQ(last_msg_.states[0].sid.reserved, 68) + << "incorrect value for last_msg_.states[0].sid.reserved, expected 68, " + "is " + << last_msg_.states[0].sid.reserved; + EXPECT_EQ(last_msg_.states[0].sid.sat, 58295) + << "incorrect value for last_msg_.states[0].sid.sat, expected 58295, is " + << last_msg_.states[0].sid.sat; + EXPECT_EQ(last_msg_.states[0].state, 115) + << "incorrect value for last_msg_.states[0].state, expected 115, is " + << last_msg_.states[0].state; + EXPECT_LT((last_msg_.states[1].cn0 * 100 - 2612.19995117 * 100), 0.05) + << "incorrect value for last_msg_.states[1].cn0, expected 2612.19995117, " + "is " + << last_msg_.states[1].cn0; + EXPECT_EQ(last_msg_.states[1].sid.code, 43) + << "incorrect value for last_msg_.states[1].sid.code, expected 43, is " + << last_msg_.states[1].sid.code; + EXPECT_EQ(last_msg_.states[1].sid.reserved, 222) + << "incorrect value for last_msg_.states[1].sid.reserved, expected 222, " + "is " + << last_msg_.states[1].sid.reserved; + EXPECT_EQ(last_msg_.states[1].sid.sat, 31151) + << "incorrect value for last_msg_.states[1].sid.sat, expected 31151, is " + << last_msg_.states[1].sid.sat; + EXPECT_EQ(last_msg_.states[1].state, 255) + << "incorrect value for last_msg_.states[1].state, expected 255, is " + << last_msg_.states[1].state; + EXPECT_LT((last_msg_.states[2].cn0 * 100 - 2925.19995117 * 100), 0.05) + << "incorrect value for last_msg_.states[2].cn0, expected 2925.19995117, " + "is " + << last_msg_.states[2].cn0; + EXPECT_EQ(last_msg_.states[2].sid.code, 53) + << "incorrect value for last_msg_.states[2].sid.code, expected 53, is " + << last_msg_.states[2].sid.code; + EXPECT_EQ(last_msg_.states[2].sid.reserved, 20) + << "incorrect value for last_msg_.states[2].sid.reserved, expected 20, " + "is " + << last_msg_.states[2].sid.reserved; + EXPECT_EQ(last_msg_.states[2].sid.sat, 1520) + << "incorrect value for last_msg_.states[2].sid.sat, expected 1520, is " + << last_msg_.states[2].sid.sat; + EXPECT_EQ(last_msg_.states[2].state, 78) + << "incorrect value for last_msg_.states[2].state, expected 78, is " + << last_msg_.states[2].state; + EXPECT_LT((last_msg_.states[3].cn0 * 100 - 3198.19995117 * 100), 0.05) + << "incorrect value for last_msg_.states[3].cn0, expected 3198.19995117, " + "is " + << last_msg_.states[3].cn0; + EXPECT_EQ(last_msg_.states[3].sid.code, 66) + << "incorrect value for last_msg_.states[3].sid.code, expected 66, is " + << last_msg_.states[3].sid.code; + EXPECT_EQ(last_msg_.states[3].sid.reserved, 155) + << "incorrect value for last_msg_.states[3].sid.reserved, expected 155, " + "is " + << last_msg_.states[3].sid.reserved; + EXPECT_EQ(last_msg_.states[3].sid.sat, 60802) + << "incorrect value for last_msg_.states[3].sid.sat, expected 60802, is " + << last_msg_.states[3].sid.sat; + EXPECT_EQ(last_msg_.states[3].state, 153) + << "incorrect value for last_msg_.states[3].state, expected 153, is " + << last_msg_.states[3].state; + EXPECT_LT((last_msg_.states[4].cn0 * 100 - 8623.20019531 * 100), 0.05) + << "incorrect value for last_msg_.states[4].cn0, expected 8623.20019531, " + "is " + << last_msg_.states[4].cn0; + EXPECT_EQ(last_msg_.states[4].sid.code, 161) + << "incorrect value for last_msg_.states[4].sid.code, expected 161, is " + << last_msg_.states[4].sid.code; + EXPECT_EQ(last_msg_.states[4].sid.reserved, 190) + << "incorrect value for last_msg_.states[4].sid.reserved, expected 190, " + "is " + << last_msg_.states[4].sid.reserved; + EXPECT_EQ(last_msg_.states[4].sid.sat, 35058) + << "incorrect value for last_msg_.states[4].sid.sat, expected 35058, is " + << last_msg_.states[4].sid.sat; + EXPECT_EQ(last_msg_.states[4].state, 53) + << "incorrect value for last_msg_.states[4].state, expected 53, is " + << last_msg_.states[4].state; + EXPECT_LT((last_msg_.states[5].cn0 * 100 - 5915.20019531 * 100), 0.05) + << "incorrect value for last_msg_.states[5].cn0, expected 5915.20019531, " + "is " + << last_msg_.states[5].cn0; + EXPECT_EQ(last_msg_.states[5].sid.code, 142) + << "incorrect value for last_msg_.states[5].sid.code, expected 142, is " + << last_msg_.states[5].sid.code; + EXPECT_EQ(last_msg_.states[5].sid.reserved, 149) + << "incorrect value for last_msg_.states[5].sid.reserved, expected 149, " + "is " + << last_msg_.states[5].sid.reserved; + EXPECT_EQ(last_msg_.states[5].sid.sat, 65405) + << "incorrect value for last_msg_.states[5].sid.sat, expected 65405, is " + << last_msg_.states[5].sid.sat; + EXPECT_EQ(last_msg_.states[5].state, 153) + << "incorrect value for last_msg_.states[5].state, expected 153, is " + << last_msg_.states[5].state; + EXPECT_LT((last_msg_.states[6].cn0 * 100 - 5412.20019531 * 100), 0.05) + << "incorrect value for last_msg_.states[6].cn0, expected 5412.20019531, " + "is " + << last_msg_.states[6].cn0; + EXPECT_EQ(last_msg_.states[6].sid.code, 31) + << "incorrect value for last_msg_.states[6].sid.code, expected 31, is " + << last_msg_.states[6].sid.code; + EXPECT_EQ(last_msg_.states[6].sid.reserved, 76) + << "incorrect value for last_msg_.states[6].sid.reserved, expected 76, " + "is " + << last_msg_.states[6].sid.reserved; + EXPECT_EQ(last_msg_.states[6].sid.sat, 24422) + << "incorrect value for last_msg_.states[6].sid.sat, expected 24422, is " + << last_msg_.states[6].sid.sat; + EXPECT_EQ(last_msg_.states[6].state, 248) + << "incorrect value for last_msg_.states[6].state, expected 248, is " + << last_msg_.states[6].state; + EXPECT_LT((last_msg_.states[7].cn0 * 100 - 6428.20019531 * 100), 0.05) + << "incorrect value for last_msg_.states[7].cn0, expected 6428.20019531, " + "is " + << last_msg_.states[7].cn0; + EXPECT_EQ(last_msg_.states[7].sid.code, 27) + << "incorrect value for last_msg_.states[7].sid.code, expected 27, is " + << last_msg_.states[7].sid.code; + EXPECT_EQ(last_msg_.states[7].sid.reserved, 12) + << "incorrect value for last_msg_.states[7].sid.reserved, expected 12, " + "is " + << last_msg_.states[7].sid.reserved; + EXPECT_EQ(last_msg_.states[7].sid.sat, 36211) + << "incorrect value for last_msg_.states[7].sid.sat, expected 36211, is " + << last_msg_.states[7].sid.sat; + EXPECT_EQ(last_msg_.states[7].state, 131) + << "incorrect value for last_msg_.states[7].state, expected 131, is " + << last_msg_.states[7].state; + EXPECT_LT((last_msg_.states[8].cn0 * 100 - 3104.19995117 * 100), 0.05) + << "incorrect value for last_msg_.states[8].cn0, expected 3104.19995117, " + "is " + << last_msg_.states[8].cn0; + EXPECT_EQ(last_msg_.states[8].sid.code, 39) + << "incorrect value for last_msg_.states[8].sid.code, expected 39, is " + << last_msg_.states[8].sid.code; + EXPECT_EQ(last_msg_.states[8].sid.reserved, 23) + << "incorrect value for last_msg_.states[8].sid.reserved, expected 23, " + "is " + << last_msg_.states[8].sid.reserved; + EXPECT_EQ(last_msg_.states[8].sid.sat, 37676) + << "incorrect value for last_msg_.states[8].sid.sat, expected 37676, is " + << last_msg_.states[8].sid.sat; + EXPECT_EQ(last_msg_.states[8].state, 208) + << "incorrect value for last_msg_.states[8].state, expected 208, is " + << last_msg_.states[8].state; + EXPECT_LT((last_msg_.states[9].cn0 * 100 - 3686.19995117 * 100), 0.05) + << "incorrect value for last_msg_.states[9].cn0, expected 3686.19995117, " + "is " + << last_msg_.states[9].cn0; + EXPECT_EQ(last_msg_.states[9].sid.code, 49) + << "incorrect value for last_msg_.states[9].sid.code, expected 49, is " + << last_msg_.states[9].sid.code; + EXPECT_EQ(last_msg_.states[9].sid.reserved, 203) + << "incorrect value for last_msg_.states[9].sid.reserved, expected 203, " + "is " + << last_msg_.states[9].sid.reserved; + EXPECT_EQ(last_msg_.states[9].sid.sat, 64415) + << "incorrect value for last_msg_.states[9].sid.sat, expected 64415, is " + << last_msg_.states[9].sid.sat; + EXPECT_EQ(last_msg_.states[9].state, 237) + << "incorrect value for last_msg_.states[9].state, expected 237, is " + << last_msg_.states[9].state; + EXPECT_LT((last_msg_.states[10].cn0 * 100 - 5967.20019531 * 100), 0.05) + << "incorrect value for last_msg_.states[10].cn0, expected " + "5967.20019531, is " + << last_msg_.states[10].cn0; + EXPECT_EQ(last_msg_.states[10].sid.code, 128) + << "incorrect value for last_msg_.states[10].sid.code, expected 128, is " + << last_msg_.states[10].sid.code; + EXPECT_EQ(last_msg_.states[10].sid.reserved, 206) + << "incorrect value for last_msg_.states[10].sid.reserved, expected 206, " + "is " + << last_msg_.states[10].sid.reserved; + EXPECT_EQ(last_msg_.states[10].sid.sat, 22486) + << "incorrect value for last_msg_.states[10].sid.sat, expected 22486, is " + << last_msg_.states[10].sid.sat; + EXPECT_EQ(last_msg_.states[10].state, 70) + << "incorrect value for last_msg_.states[10].state, expected 70, is " + << last_msg_.states[10].state; + EXPECT_LT((last_msg_.states[11].cn0 * 100 - 5423.20019531 * 100), 0.05) + << "incorrect value for last_msg_.states[11].cn0, expected " + "5423.20019531, is " + << last_msg_.states[11].cn0; + EXPECT_EQ(last_msg_.states[11].sid.code, 218) + << "incorrect value for last_msg_.states[11].sid.code, expected 218, is " + << last_msg_.states[11].sid.code; + EXPECT_EQ(last_msg_.states[11].sid.reserved, 19) + << "incorrect value for last_msg_.states[11].sid.reserved, expected 19, " + "is " + << last_msg_.states[11].sid.reserved; + EXPECT_EQ(last_msg_.states[11].sid.sat, 28622) + << "incorrect value for last_msg_.states[11].sid.sat, expected 28622, is " + << last_msg_.states[11].sid.sat; + EXPECT_EQ(last_msg_.states[11].state, 14) + << "incorrect value for last_msg_.states[11].state, expected 14, is " + << last_msg_.states[11].state; + EXPECT_LT((last_msg_.states[12].cn0 * 100 - 438.200012207 * 100), 0.05) + << "incorrect value for last_msg_.states[12].cn0, expected " + "438.200012207, is " + << last_msg_.states[12].cn0; + EXPECT_EQ(last_msg_.states[12].sid.code, 54) + << "incorrect value for last_msg_.states[12].sid.code, expected 54, is " + << last_msg_.states[12].sid.code; + EXPECT_EQ(last_msg_.states[12].sid.reserved, 2) + << "incorrect value for last_msg_.states[12].sid.reserved, expected 2, " + "is " + << last_msg_.states[12].sid.reserved; + EXPECT_EQ(last_msg_.states[12].sid.sat, 53602) + << "incorrect value for last_msg_.states[12].sid.sat, expected 53602, is " + << last_msg_.states[12].sid.sat; + EXPECT_EQ(last_msg_.states[12].state, 216) + << "incorrect value for last_msg_.states[12].state, expected 216, is " + << last_msg_.states[12].state; + EXPECT_LT((last_msg_.states[13].cn0 * 100 - 1862.19995117 * 100), 0.05) + << "incorrect value for last_msg_.states[13].cn0, expected " + "1862.19995117, is " + << last_msg_.states[13].cn0; + EXPECT_EQ(last_msg_.states[13].sid.code, 7) + << "incorrect value for last_msg_.states[13].sid.code, expected 7, is " + << last_msg_.states[13].sid.code; + EXPECT_EQ(last_msg_.states[13].sid.reserved, 34) + << "incorrect value for last_msg_.states[13].sid.reserved, expected 34, " + "is " + << last_msg_.states[13].sid.reserved; + EXPECT_EQ(last_msg_.states[13].sid.sat, 25477) + << "incorrect value for last_msg_.states[13].sid.sat, expected 25477, is " + << last_msg_.states[13].sid.sat; + EXPECT_EQ(last_msg_.states[13].state, 200) + << "incorrect value for last_msg_.states[13].state, expected 200, is " + << last_msg_.states[13].state; + EXPECT_LT((last_msg_.states[14].cn0 * 100 - 5462.20019531 * 100), 0.05) + << "incorrect value for last_msg_.states[14].cn0, expected " + "5462.20019531, is " + << last_msg_.states[14].cn0; + EXPECT_EQ(last_msg_.states[14].sid.code, 135) + << "incorrect value for last_msg_.states[14].sid.code, expected 135, is " + << last_msg_.states[14].sid.code; + EXPECT_EQ(last_msg_.states[14].sid.reserved, 46) + << "incorrect value for last_msg_.states[14].sid.reserved, expected 46, " + "is " + << last_msg_.states[14].sid.reserved; + EXPECT_EQ(last_msg_.states[14].sid.sat, 21803) + << "incorrect value for last_msg_.states[14].sid.sat, expected 21803, is " + << last_msg_.states[14].sid.sat; + EXPECT_EQ(last_msg_.states[14].state, 155) + << "incorrect value for last_msg_.states[14].state, expected 155, is " + << last_msg_.states[14].state; + EXPECT_LT((last_msg_.states[15].cn0 * 100 - 7454.20019531 * 100), 0.05) + << "incorrect value for last_msg_.states[15].cn0, expected " + "7454.20019531, is " + << last_msg_.states[15].cn0; + EXPECT_EQ(last_msg_.states[15].sid.code, 171) + << "incorrect value for last_msg_.states[15].sid.code, expected 171, is " + << last_msg_.states[15].sid.code; + EXPECT_EQ(last_msg_.states[15].sid.reserved, 201) + << "incorrect value for last_msg_.states[15].sid.reserved, expected 201, " + "is " + << last_msg_.states[15].sid.reserved; + EXPECT_EQ(last_msg_.states[15].sid.sat, 21251) + << "incorrect value for last_msg_.states[15].sid.sat, expected 21251, is " + << last_msg_.states[15].sid.sat; + EXPECT_EQ(last_msg_.states[15].state, 155) + << "incorrect value for last_msg_.states[15].state, expected 155, is " + << last_msg_.states[15].state; + EXPECT_LT((last_msg_.states[16].cn0 * 100 - 7134.20019531 * 100), 0.05) + << "incorrect value for last_msg_.states[16].cn0, expected " + "7134.20019531, is " + << last_msg_.states[16].cn0; + EXPECT_EQ(last_msg_.states[16].sid.code, 16) + << "incorrect value for last_msg_.states[16].sid.code, expected 16, is " + << last_msg_.states[16].sid.code; + EXPECT_EQ(last_msg_.states[16].sid.reserved, 19) + << "incorrect value for last_msg_.states[16].sid.reserved, expected 19, " + "is " + << last_msg_.states[16].sid.reserved; + EXPECT_EQ(last_msg_.states[16].sid.sat, 50475) + << "incorrect value for last_msg_.states[16].sid.sat, expected 50475, is " + << last_msg_.states[16].sid.sat; + EXPECT_EQ(last_msg_.states[16].state, 121) + << "incorrect value for last_msg_.states[16].state, expected 121, is " + << last_msg_.states[16].state; + EXPECT_LT((last_msg_.states[17].cn0 * 100 - 3111.19995117 * 100), 0.05) + << "incorrect value for last_msg_.states[17].cn0, expected " + "3111.19995117, is " + << last_msg_.states[17].cn0; + EXPECT_EQ(last_msg_.states[17].sid.code, 63) + << "incorrect value for last_msg_.states[17].sid.code, expected 63, is " + << last_msg_.states[17].sid.code; + EXPECT_EQ(last_msg_.states[17].sid.reserved, 176) + << "incorrect value for last_msg_.states[17].sid.reserved, expected 176, " + "is " + << last_msg_.states[17].sid.reserved; + EXPECT_EQ(last_msg_.states[17].sid.sat, 13813) + << "incorrect value for last_msg_.states[17].sid.sat, expected 13813, is " + << last_msg_.states[17].sid.sat; + EXPECT_EQ(last_msg_.states[17].state, 128) + << "incorrect value for last_msg_.states[17].state, expected 128, is " + << last_msg_.states[17].state; + EXPECT_LT((last_msg_.states[18].cn0 * 100 - 4297.20019531 * 100), 0.05) + << "incorrect value for last_msg_.states[18].cn0, expected " + "4297.20019531, is " + << last_msg_.states[18].cn0; + EXPECT_EQ(last_msg_.states[18].sid.code, 153) + << "incorrect value for last_msg_.states[18].sid.code, expected 153, is " + << last_msg_.states[18].sid.code; + EXPECT_EQ(last_msg_.states[18].sid.reserved, 51) + << "incorrect value for last_msg_.states[18].sid.reserved, expected 51, " + "is " + << last_msg_.states[18].sid.reserved; + EXPECT_EQ(last_msg_.states[18].sid.sat, 15636) + << "incorrect value for last_msg_.states[18].sid.sat, expected 15636, is " + << last_msg_.states[18].sid.sat; + EXPECT_EQ(last_msg_.states[18].state, 36) + << "incorrect value for last_msg_.states[18].state, expected 36, is " + << last_msg_.states[18].state; + EXPECT_LT((last_msg_.states[19].cn0 * 100 - 2649.19995117 * 100), 0.05) + << "incorrect value for last_msg_.states[19].cn0, expected " + "2649.19995117, is " + << last_msg_.states[19].cn0; + EXPECT_EQ(last_msg_.states[19].sid.code, 140) + << "incorrect value for last_msg_.states[19].sid.code, expected 140, is " + << last_msg_.states[19].sid.code; + EXPECT_EQ(last_msg_.states[19].sid.reserved, 22) + << "incorrect value for last_msg_.states[19].sid.reserved, expected 22, " + "is " + << last_msg_.states[19].sid.reserved; + EXPECT_EQ(last_msg_.states[19].sid.sat, 29778) + << "incorrect value for last_msg_.states[19].sid.sat, expected 29778, is " + << last_msg_.states[19].sid.sat; + EXPECT_EQ(last_msg_.states[19].state, 46) + << "incorrect value for last_msg_.states[19].state, expected 46, is " + << last_msg_.states[19].state; + EXPECT_LT((last_msg_.states[20].cn0 * 100 - 941.200012207 * 100), 0.05) + << "incorrect value for last_msg_.states[20].cn0, expected " + "941.200012207, is " + << last_msg_.states[20].cn0; + EXPECT_EQ(last_msg_.states[20].sid.code, 96) + << "incorrect value for last_msg_.states[20].sid.code, expected 96, is " + << last_msg_.states[20].sid.code; + EXPECT_EQ(last_msg_.states[20].sid.reserved, 143) + << "incorrect value for last_msg_.states[20].sid.reserved, expected 143, " + "is " + << last_msg_.states[20].sid.reserved; + EXPECT_EQ(last_msg_.states[20].sid.sat, 37443) + << "incorrect value for last_msg_.states[20].sid.sat, expected 37443, is " + << last_msg_.states[20].sid.sat; + EXPECT_EQ(last_msg_.states[20].state, 177) + << "incorrect value for last_msg_.states[20].state, expected 177, is " + << last_msg_.states[20].state; + EXPECT_LT((last_msg_.states[21].cn0 * 100 - 1539.19995117 * 100), 0.05) + << "incorrect value for last_msg_.states[21].cn0, expected " + "1539.19995117, is " + << last_msg_.states[21].cn0; + EXPECT_EQ(last_msg_.states[21].sid.code, 201) + << "incorrect value for last_msg_.states[21].sid.code, expected 201, is " + << last_msg_.states[21].sid.code; + EXPECT_EQ(last_msg_.states[21].sid.reserved, 251) + << "incorrect value for last_msg_.states[21].sid.reserved, expected 251, " + "is " + << last_msg_.states[21].sid.reserved; + EXPECT_EQ(last_msg_.states[21].sid.sat, 41011) + << "incorrect value for last_msg_.states[21].sid.sat, expected 41011, is " + << last_msg_.states[21].sid.sat; + EXPECT_EQ(last_msg_.states[21].state, 220) + << "incorrect value for last_msg_.states[21].state, expected 220, is " + << last_msg_.states[21].state; + EXPECT_LT((last_msg_.states[22].cn0 * 100 - 1443.19995117 * 100), 0.05) + << "incorrect value for last_msg_.states[22].cn0, expected " + "1443.19995117, is " + << last_msg_.states[22].cn0; + EXPECT_EQ(last_msg_.states[22].sid.code, 161) + << "incorrect value for last_msg_.states[22].sid.code, expected 161, is " + << last_msg_.states[22].sid.code; + EXPECT_EQ(last_msg_.states[22].sid.reserved, 220) + << "incorrect value for last_msg_.states[22].sid.reserved, expected 220, " + "is " + << last_msg_.states[22].sid.reserved; + EXPECT_EQ(last_msg_.states[22].sid.sat, 706) + << "incorrect value for last_msg_.states[22].sid.sat, expected 706, is " + << last_msg_.states[22].sid.sat; + EXPECT_EQ(last_msg_.states[22].state, 168) + << "incorrect value for last_msg_.states[22].state, expected 168, is " + << last_msg_.states[22].state; + EXPECT_LT((last_msg_.states[23].cn0 * 100 - 1074.19995117 * 100), 0.05) + << "incorrect value for last_msg_.states[23].cn0, expected " + "1074.19995117, is " + << last_msg_.states[23].cn0; + EXPECT_EQ(last_msg_.states[23].sid.code, 125) + << "incorrect value for last_msg_.states[23].sid.code, expected 125, is " + << last_msg_.states[23].sid.code; + EXPECT_EQ(last_msg_.states[23].sid.reserved, 178) + << "incorrect value for last_msg_.states[23].sid.reserved, expected 178, " + "is " + << last_msg_.states[23].sid.reserved; + EXPECT_EQ(last_msg_.states[23].sid.sat, 2312) + << "incorrect value for last_msg_.states[23].sid.sat, expected 2312, is " + << last_msg_.states[23].sid.sat; + EXPECT_EQ(last_msg_.states[23].state, 69) + << "incorrect value for last_msg_.states[23].state, expected 69, is " + << last_msg_.states[23].state; + EXPECT_LT((last_msg_.states[24].cn0 * 100 - 2122.19995117 * 100), 0.05) + << "incorrect value for last_msg_.states[24].cn0, expected " + "2122.19995117, is " + << last_msg_.states[24].cn0; + EXPECT_EQ(last_msg_.states[24].sid.code, 186) + << "incorrect value for last_msg_.states[24].sid.code, expected 186, is " + << last_msg_.states[24].sid.code; + EXPECT_EQ(last_msg_.states[24].sid.reserved, 171) + << "incorrect value for last_msg_.states[24].sid.reserved, expected 171, " + "is " + << last_msg_.states[24].sid.reserved; + EXPECT_EQ(last_msg_.states[24].sid.sat, 34580) + << "incorrect value for last_msg_.states[24].sid.sat, expected 34580, is " + << last_msg_.states[24].sid.sat; + EXPECT_EQ(last_msg_.states[24].state, 185) + << "incorrect value for last_msg_.states[24].state, expected 185, is " + << last_msg_.states[24].state; + EXPECT_LT((last_msg_.states[25].cn0 * 100 - 9076.20019531 * 100), 0.05) + << "incorrect value for last_msg_.states[25].cn0, expected " + "9076.20019531, is " + << last_msg_.states[25].cn0; + EXPECT_EQ(last_msg_.states[25].sid.code, 85) + << "incorrect value for last_msg_.states[25].sid.code, expected 85, is " + << last_msg_.states[25].sid.code; + EXPECT_EQ(last_msg_.states[25].sid.reserved, 170) + << "incorrect value for last_msg_.states[25].sid.reserved, expected 170, " + "is " + << last_msg_.states[25].sid.reserved; + EXPECT_EQ(last_msg_.states[25].sid.sat, 39804) + << "incorrect value for last_msg_.states[25].sid.sat, expected 39804, is " + << last_msg_.states[25].sid.sat; + EXPECT_EQ(last_msg_.states[25].state, 18) + << "incorrect value for last_msg_.states[25].state, expected 18, is " + << last_msg_.states[25].state; + EXPECT_LT((last_msg_.states[26].cn0 * 100 - 4781.20019531 * 100), 0.05) + << "incorrect value for last_msg_.states[26].cn0, expected " + "4781.20019531, is " + << last_msg_.states[26].cn0; + EXPECT_EQ(last_msg_.states[26].sid.code, 255) + << "incorrect value for last_msg_.states[26].sid.code, expected 255, is " + << last_msg_.states[26].sid.code; + EXPECT_EQ(last_msg_.states[26].sid.reserved, 186) + << "incorrect value for last_msg_.states[26].sid.reserved, expected 186, " + "is " + << last_msg_.states[26].sid.reserved; + EXPECT_EQ(last_msg_.states[26].sid.sat, 52980) + << "incorrect value for last_msg_.states[26].sid.sat, expected 52980, is " + << last_msg_.states[26].sid.sat; + EXPECT_EQ(last_msg_.states[26].state, 57) + << "incorrect value for last_msg_.states[26].state, expected 57, is " + << last_msg_.states[26].state; + EXPECT_LT((last_msg_.states[27].cn0 * 100 - 3076.19995117 * 100), 0.05) + << "incorrect value for last_msg_.states[27].cn0, expected " + "3076.19995117, is " + << last_msg_.states[27].cn0; + EXPECT_EQ(last_msg_.states[27].sid.code, 181) + << "incorrect value for last_msg_.states[27].sid.code, expected 181, is " + << last_msg_.states[27].sid.code; + EXPECT_EQ(last_msg_.states[27].sid.reserved, 175) + << "incorrect value for last_msg_.states[27].sid.reserved, expected 175, " + "is " + << last_msg_.states[27].sid.reserved; + EXPECT_EQ(last_msg_.states[27].sid.sat, 24007) + << "incorrect value for last_msg_.states[27].sid.sat, expected 24007, is " + << last_msg_.states[27].sid.sat; + EXPECT_EQ(last_msg_.states[27].state, 165) + << "incorrect value for last_msg_.states[27].state, expected 165, is " + << last_msg_.states[27].state; } diff --git a/c/test/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.cc b/c/test/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.cc index 4c3b23f98..a0c3ffd96 100644 --- a/c/test/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.cc +++ b/c/test/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.cc @@ -10,60 +10,57 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDep.yaml +// by generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_state_detailed_dep_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_tracking_state_detailed_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,130 +68,177 @@ class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep0 : sbp_msg_tracking_state_detailed_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep0, Test) -{ - - uint8_t encoded_frame[] = {85,17,0,59,103,55,163,151,112,215,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,5,0,0,169,177,208,54,15,0,0,0,85,61,0,0,39,0,1,0,0,0,0,0,0,0,40,0,108,1,0,11,0,0,9,166,214, }; - - sbp_msg_tracking_state_detailed_dep_t test_msg{}; - test_msg.L.f = 169; - test_msg.L.i = 1319; - test_msg.P = 0; - test_msg.P_std = 0; - test_msg.acceleration = 108; - test_msg.clock_drift = 0; - test_msg.clock_offset = 0; - test_msg.cn0 = 177; - test_msg.corr_spacing = 40; - test_msg.doppler = 15701; - test_msg.doppler_std = 39; - test_msg.lock = 14032; - test_msg.misc_flags = 9; - test_msg.nav_flags = 0; - test_msg.pset_flags = 0; - test_msg.recv_time = 7909447587; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 15; - test_msg.sync_flags = 1; - test_msg.tot.tow = 0; - test_msg.tot.wn = 0; - test_msg.tow_flags = 0; - test_msg.track_flags = 11; - test_msg.uptime = 1; - - EXPECT_EQ(send_message( 26427, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 26427); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.L.f, 169) << "incorrect value for last_msg_.L.f, expected 169, is " << last_msg_.L.f; - EXPECT_EQ(last_msg_.L.i, 1319) << "incorrect value for last_msg_.L.i, expected 1319, is " << last_msg_.L.i; - EXPECT_EQ(last_msg_.P, 0) << "incorrect value for last_msg_.P, expected 0, is " << last_msg_.P; - EXPECT_EQ(last_msg_.P_std, 0) << "incorrect value for last_msg_.P_std, expected 0, is " << last_msg_.P_std; - EXPECT_EQ(last_msg_.acceleration, 108) << "incorrect value for last_msg_.acceleration, expected 108, is " << last_msg_.acceleration; - EXPECT_EQ(last_msg_.clock_drift, 0) << "incorrect value for last_msg_.clock_drift, expected 0, is " << last_msg_.clock_drift; - EXPECT_EQ(last_msg_.clock_offset, 0) << "incorrect value for last_msg_.clock_offset, expected 0, is " << last_msg_.clock_offset; - EXPECT_EQ(last_msg_.cn0, 177) << "incorrect value for last_msg_.cn0, expected 177, is " << last_msg_.cn0; - EXPECT_EQ(last_msg_.corr_spacing, 40) << "incorrect value for last_msg_.corr_spacing, expected 40, is " << last_msg_.corr_spacing; - EXPECT_EQ(last_msg_.doppler, 15701) << "incorrect value for last_msg_.doppler, expected 15701, is " << last_msg_.doppler; - EXPECT_EQ(last_msg_.doppler_std, 39) << "incorrect value for last_msg_.doppler_std, expected 39, is " << last_msg_.doppler_std; - EXPECT_EQ(last_msg_.lock, 14032) << "incorrect value for last_msg_.lock, expected 14032, is " << last_msg_.lock; - EXPECT_EQ(last_msg_.misc_flags, 9) << "incorrect value for last_msg_.misc_flags, expected 9, is " << last_msg_.misc_flags; - EXPECT_EQ(last_msg_.nav_flags, 0) << "incorrect value for last_msg_.nav_flags, expected 0, is " << last_msg_.nav_flags; - EXPECT_EQ(last_msg_.pset_flags, 0) << "incorrect value for last_msg_.pset_flags, expected 0, is " << last_msg_.pset_flags; - EXPECT_EQ(last_msg_.recv_time, 7909447587) << "incorrect value for last_msg_.recv_time, expected 7909447587, is " << last_msg_.recv_time; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 15) << "incorrect value for last_msg_.sid.sat, expected 15, is " << last_msg_.sid.sat; - EXPECT_EQ(last_msg_.sync_flags, 1) << "incorrect value for last_msg_.sync_flags, expected 1, is " << last_msg_.sync_flags; - EXPECT_EQ(last_msg_.tot.tow, 0) << "incorrect value for last_msg_.tot.tow, expected 0, is " << last_msg_.tot.tow; - EXPECT_EQ(last_msg_.tot.wn, 0) << "incorrect value for last_msg_.tot.wn, expected 0, is " << last_msg_.tot.wn; - EXPECT_EQ(last_msg_.tow_flags, 0) << "incorrect value for last_msg_.tow_flags, expected 0, is " << last_msg_.tow_flags; - EXPECT_EQ(last_msg_.track_flags, 11) << "incorrect value for last_msg_.track_flags, expected 11, is " << last_msg_.track_flags; - EXPECT_EQ(last_msg_.uptime, 1) << "incorrect value for last_msg_.uptime, expected 1, is " << last_msg_.uptime; +}; + +TEST_F(Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep0, Test) { + uint8_t encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 163, 151, 112, 215, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 5, 0, 0, 169, 177, + 208, 54, 15, 0, 0, 0, 85, 61, 0, 0, 39, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 108, 1, 0, 11, 0, 0, 9, 166, 214, + }; + + sbp_msg_tracking_state_detailed_dep_t test_msg{}; + test_msg.L.f = 169; + test_msg.L.i = 1319; + test_msg.P = 0; + test_msg.P_std = 0; + test_msg.acceleration = 108; + test_msg.clock_drift = 0; + test_msg.clock_offset = 0; + test_msg.cn0 = 177; + test_msg.corr_spacing = 40; + test_msg.doppler = 15701; + test_msg.doppler_std = 39; + test_msg.lock = 14032; + test_msg.misc_flags = 9; + test_msg.nav_flags = 0; + test_msg.pset_flags = 0; + test_msg.recv_time = 7909447587; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 15; + test_msg.sync_flags = 1; + test_msg.tot.tow = 0; + test_msg.tot.wn = 0; + test_msg.tow_flags = 0; + test_msg.track_flags = 11; + test_msg.uptime = 1; + + EXPECT_EQ(send_message(26427, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 26427); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.L.f, 169) + << "incorrect value for last_msg_.L.f, expected 169, is " + << last_msg_.L.f; + EXPECT_EQ(last_msg_.L.i, 1319) + << "incorrect value for last_msg_.L.i, expected 1319, is " + << last_msg_.L.i; + EXPECT_EQ(last_msg_.P, 0) + << "incorrect value for last_msg_.P, expected 0, is " << last_msg_.P; + EXPECT_EQ(last_msg_.P_std, 0) + << "incorrect value for last_msg_.P_std, expected 0, is " + << last_msg_.P_std; + EXPECT_EQ(last_msg_.acceleration, 108) + << "incorrect value for last_msg_.acceleration, expected 108, is " + << last_msg_.acceleration; + EXPECT_EQ(last_msg_.clock_drift, 0) + << "incorrect value for last_msg_.clock_drift, expected 0, is " + << last_msg_.clock_drift; + EXPECT_EQ(last_msg_.clock_offset, 0) + << "incorrect value for last_msg_.clock_offset, expected 0, is " + << last_msg_.clock_offset; + EXPECT_EQ(last_msg_.cn0, 177) + << "incorrect value for last_msg_.cn0, expected 177, is " + << last_msg_.cn0; + EXPECT_EQ(last_msg_.corr_spacing, 40) + << "incorrect value for last_msg_.corr_spacing, expected 40, is " + << last_msg_.corr_spacing; + EXPECT_EQ(last_msg_.doppler, 15701) + << "incorrect value for last_msg_.doppler, expected 15701, is " + << last_msg_.doppler; + EXPECT_EQ(last_msg_.doppler_std, 39) + << "incorrect value for last_msg_.doppler_std, expected 39, is " + << last_msg_.doppler_std; + EXPECT_EQ(last_msg_.lock, 14032) + << "incorrect value for last_msg_.lock, expected 14032, is " + << last_msg_.lock; + EXPECT_EQ(last_msg_.misc_flags, 9) + << "incorrect value for last_msg_.misc_flags, expected 9, is " + << last_msg_.misc_flags; + EXPECT_EQ(last_msg_.nav_flags, 0) + << "incorrect value for last_msg_.nav_flags, expected 0, is " + << last_msg_.nav_flags; + EXPECT_EQ(last_msg_.pset_flags, 0) + << "incorrect value for last_msg_.pset_flags, expected 0, is " + << last_msg_.pset_flags; + EXPECT_EQ(last_msg_.recv_time, 7909447587) + << "incorrect value for last_msg_.recv_time, expected 7909447587, is " + << last_msg_.recv_time; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 15) + << "incorrect value for last_msg_.sid.sat, expected 15, is " + << last_msg_.sid.sat; + EXPECT_EQ(last_msg_.sync_flags, 1) + << "incorrect value for last_msg_.sync_flags, expected 1, is " + << last_msg_.sync_flags; + EXPECT_EQ(last_msg_.tot.tow, 0) + << "incorrect value for last_msg_.tot.tow, expected 0, is " + << last_msg_.tot.tow; + EXPECT_EQ(last_msg_.tot.wn, 0) + << "incorrect value for last_msg_.tot.wn, expected 0, is " + << last_msg_.tot.wn; + EXPECT_EQ(last_msg_.tow_flags, 0) + << "incorrect value for last_msg_.tow_flags, expected 0, is " + << last_msg_.tow_flags; + EXPECT_EQ(last_msg_.track_flags, 11) + << "incorrect value for last_msg_.track_flags, expected 11, is " + << last_msg_.track_flags; + EXPECT_EQ(last_msg_.uptime, 1) + << "incorrect value for last_msg_.uptime, expected 1, is " + << last_msg_.uptime; } -class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_state_detailed_dep_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_tracking_state_detailed_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -202,130 +246,176 @@ class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep1 : sbp_msg_tracking_state_detailed_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep1, Test) -{ - - uint8_t encoded_frame[] = {85,17,0,59,103,55,97,251,61,245,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,7,0,0,14,175,208,54,15,0,0,0,51,61,0,0,30,0,1,0,0,0,0,0,0,0,40,0,224,1,0,11,0,0,9,136,179, }; - - sbp_msg_tracking_state_detailed_dep_t test_msg{}; - test_msg.L.f = 14; - test_msg.L.i = 1810; - test_msg.P = 0; - test_msg.P_std = 0; - test_msg.acceleration = -32; - test_msg.clock_drift = 0; - test_msg.clock_offset = 0; - test_msg.cn0 = 175; - test_msg.corr_spacing = 40; - test_msg.doppler = 15667; - test_msg.doppler_std = 30; - test_msg.lock = 14032; - test_msg.misc_flags = 9; - test_msg.nav_flags = 0; - test_msg.pset_flags = 0; - test_msg.recv_time = 8409447265; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 15; - test_msg.sync_flags = 1; - test_msg.tot.tow = 0; - test_msg.tot.wn = 0; - test_msg.tow_flags = 0; - test_msg.track_flags = 11; - test_msg.uptime = 1; - - EXPECT_EQ(send_message( 26427, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 26427); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.L.f, 14) << "incorrect value for last_msg_.L.f, expected 14, is " << last_msg_.L.f; - EXPECT_EQ(last_msg_.L.i, 1810) << "incorrect value for last_msg_.L.i, expected 1810, is " << last_msg_.L.i; - EXPECT_EQ(last_msg_.P, 0) << "incorrect value for last_msg_.P, expected 0, is " << last_msg_.P; - EXPECT_EQ(last_msg_.P_std, 0) << "incorrect value for last_msg_.P_std, expected 0, is " << last_msg_.P_std; - EXPECT_EQ(last_msg_.acceleration, -32) << "incorrect value for last_msg_.acceleration, expected -32, is " << last_msg_.acceleration; - EXPECT_EQ(last_msg_.clock_drift, 0) << "incorrect value for last_msg_.clock_drift, expected 0, is " << last_msg_.clock_drift; - EXPECT_EQ(last_msg_.clock_offset, 0) << "incorrect value for last_msg_.clock_offset, expected 0, is " << last_msg_.clock_offset; - EXPECT_EQ(last_msg_.cn0, 175) << "incorrect value for last_msg_.cn0, expected 175, is " << last_msg_.cn0; - EXPECT_EQ(last_msg_.corr_spacing, 40) << "incorrect value for last_msg_.corr_spacing, expected 40, is " << last_msg_.corr_spacing; - EXPECT_EQ(last_msg_.doppler, 15667) << "incorrect value for last_msg_.doppler, expected 15667, is " << last_msg_.doppler; - EXPECT_EQ(last_msg_.doppler_std, 30) << "incorrect value for last_msg_.doppler_std, expected 30, is " << last_msg_.doppler_std; - EXPECT_EQ(last_msg_.lock, 14032) << "incorrect value for last_msg_.lock, expected 14032, is " << last_msg_.lock; - EXPECT_EQ(last_msg_.misc_flags, 9) << "incorrect value for last_msg_.misc_flags, expected 9, is " << last_msg_.misc_flags; - EXPECT_EQ(last_msg_.nav_flags, 0) << "incorrect value for last_msg_.nav_flags, expected 0, is " << last_msg_.nav_flags; - EXPECT_EQ(last_msg_.pset_flags, 0) << "incorrect value for last_msg_.pset_flags, expected 0, is " << last_msg_.pset_flags; - EXPECT_EQ(last_msg_.recv_time, 8409447265) << "incorrect value for last_msg_.recv_time, expected 8409447265, is " << last_msg_.recv_time; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 15) << "incorrect value for last_msg_.sid.sat, expected 15, is " << last_msg_.sid.sat; - EXPECT_EQ(last_msg_.sync_flags, 1) << "incorrect value for last_msg_.sync_flags, expected 1, is " << last_msg_.sync_flags; - EXPECT_EQ(last_msg_.tot.tow, 0) << "incorrect value for last_msg_.tot.tow, expected 0, is " << last_msg_.tot.tow; - EXPECT_EQ(last_msg_.tot.wn, 0) << "incorrect value for last_msg_.tot.wn, expected 0, is " << last_msg_.tot.wn; - EXPECT_EQ(last_msg_.tow_flags, 0) << "incorrect value for last_msg_.tow_flags, expected 0, is " << last_msg_.tow_flags; - EXPECT_EQ(last_msg_.track_flags, 11) << "incorrect value for last_msg_.track_flags, expected 11, is " << last_msg_.track_flags; - EXPECT_EQ(last_msg_.uptime, 1) << "incorrect value for last_msg_.uptime, expected 1, is " << last_msg_.uptime; +}; + +TEST_F(Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep1, Test) { + uint8_t encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 97, 251, 61, 245, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 7, 0, 0, 14, 175, + 208, 54, 15, 0, 0, 0, 51, 61, 0, 0, 30, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 224, 1, 0, 11, 0, 0, 9, 136, 179, + }; + + sbp_msg_tracking_state_detailed_dep_t test_msg{}; + test_msg.L.f = 14; + test_msg.L.i = 1810; + test_msg.P = 0; + test_msg.P_std = 0; + test_msg.acceleration = -32; + test_msg.clock_drift = 0; + test_msg.clock_offset = 0; + test_msg.cn0 = 175; + test_msg.corr_spacing = 40; + test_msg.doppler = 15667; + test_msg.doppler_std = 30; + test_msg.lock = 14032; + test_msg.misc_flags = 9; + test_msg.nav_flags = 0; + test_msg.pset_flags = 0; + test_msg.recv_time = 8409447265; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 15; + test_msg.sync_flags = 1; + test_msg.tot.tow = 0; + test_msg.tot.wn = 0; + test_msg.tow_flags = 0; + test_msg.track_flags = 11; + test_msg.uptime = 1; + + EXPECT_EQ(send_message(26427, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 26427); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.L.f, 14) + << "incorrect value for last_msg_.L.f, expected 14, is " << last_msg_.L.f; + EXPECT_EQ(last_msg_.L.i, 1810) + << "incorrect value for last_msg_.L.i, expected 1810, is " + << last_msg_.L.i; + EXPECT_EQ(last_msg_.P, 0) + << "incorrect value for last_msg_.P, expected 0, is " << last_msg_.P; + EXPECT_EQ(last_msg_.P_std, 0) + << "incorrect value for last_msg_.P_std, expected 0, is " + << last_msg_.P_std; + EXPECT_EQ(last_msg_.acceleration, -32) + << "incorrect value for last_msg_.acceleration, expected -32, is " + << last_msg_.acceleration; + EXPECT_EQ(last_msg_.clock_drift, 0) + << "incorrect value for last_msg_.clock_drift, expected 0, is " + << last_msg_.clock_drift; + EXPECT_EQ(last_msg_.clock_offset, 0) + << "incorrect value for last_msg_.clock_offset, expected 0, is " + << last_msg_.clock_offset; + EXPECT_EQ(last_msg_.cn0, 175) + << "incorrect value for last_msg_.cn0, expected 175, is " + << last_msg_.cn0; + EXPECT_EQ(last_msg_.corr_spacing, 40) + << "incorrect value for last_msg_.corr_spacing, expected 40, is " + << last_msg_.corr_spacing; + EXPECT_EQ(last_msg_.doppler, 15667) + << "incorrect value for last_msg_.doppler, expected 15667, is " + << last_msg_.doppler; + EXPECT_EQ(last_msg_.doppler_std, 30) + << "incorrect value for last_msg_.doppler_std, expected 30, is " + << last_msg_.doppler_std; + EXPECT_EQ(last_msg_.lock, 14032) + << "incorrect value for last_msg_.lock, expected 14032, is " + << last_msg_.lock; + EXPECT_EQ(last_msg_.misc_flags, 9) + << "incorrect value for last_msg_.misc_flags, expected 9, is " + << last_msg_.misc_flags; + EXPECT_EQ(last_msg_.nav_flags, 0) + << "incorrect value for last_msg_.nav_flags, expected 0, is " + << last_msg_.nav_flags; + EXPECT_EQ(last_msg_.pset_flags, 0) + << "incorrect value for last_msg_.pset_flags, expected 0, is " + << last_msg_.pset_flags; + EXPECT_EQ(last_msg_.recv_time, 8409447265) + << "incorrect value for last_msg_.recv_time, expected 8409447265, is " + << last_msg_.recv_time; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 15) + << "incorrect value for last_msg_.sid.sat, expected 15, is " + << last_msg_.sid.sat; + EXPECT_EQ(last_msg_.sync_flags, 1) + << "incorrect value for last_msg_.sync_flags, expected 1, is " + << last_msg_.sync_flags; + EXPECT_EQ(last_msg_.tot.tow, 0) + << "incorrect value for last_msg_.tot.tow, expected 0, is " + << last_msg_.tot.tow; + EXPECT_EQ(last_msg_.tot.wn, 0) + << "incorrect value for last_msg_.tot.wn, expected 0, is " + << last_msg_.tot.wn; + EXPECT_EQ(last_msg_.tow_flags, 0) + << "incorrect value for last_msg_.tow_flags, expected 0, is " + << last_msg_.tow_flags; + EXPECT_EQ(last_msg_.track_flags, 11) + << "incorrect value for last_msg_.track_flags, expected 11, is " + << last_msg_.track_flags; + EXPECT_EQ(last_msg_.uptime, 1) + << "incorrect value for last_msg_.uptime, expected 1, is " + << last_msg_.uptime; } -class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_state_detailed_dep_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_tracking_state_detailed_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -333,130 +423,176 @@ class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep2 : sbp_msg_tracking_state_detailed_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep2, Test) -{ - - uint8_t encoded_frame[] = {85,17,0,59,103,55,139,218,236,18,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,8,0,0,8,179,208,54,15,0,0,0,67,61,0,0,22,0,2,0,0,0,0,0,0,0,40,0,27,1,0,11,0,2,9,217,159, }; - - sbp_msg_tracking_state_detailed_dep_t test_msg{}; - test_msg.L.f = 8; - test_msg.L.i = 2298; - test_msg.P = 0; - test_msg.P_std = 0; - test_msg.acceleration = 27; - test_msg.clock_drift = 0; - test_msg.clock_offset = 0; - test_msg.cn0 = 179; - test_msg.corr_spacing = 40; - test_msg.doppler = 15683; - test_msg.doppler_std = 22; - test_msg.lock = 14032; - test_msg.misc_flags = 9; - test_msg.nav_flags = 0; - test_msg.pset_flags = 2; - test_msg.recv_time = 8907446923; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 15; - test_msg.sync_flags = 1; - test_msg.tot.tow = 0; - test_msg.tot.wn = 0; - test_msg.tow_flags = 0; - test_msg.track_flags = 11; - test_msg.uptime = 2; - - EXPECT_EQ(send_message( 26427, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 26427); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.L.f, 8) << "incorrect value for last_msg_.L.f, expected 8, is " << last_msg_.L.f; - EXPECT_EQ(last_msg_.L.i, 2298) << "incorrect value for last_msg_.L.i, expected 2298, is " << last_msg_.L.i; - EXPECT_EQ(last_msg_.P, 0) << "incorrect value for last_msg_.P, expected 0, is " << last_msg_.P; - EXPECT_EQ(last_msg_.P_std, 0) << "incorrect value for last_msg_.P_std, expected 0, is " << last_msg_.P_std; - EXPECT_EQ(last_msg_.acceleration, 27) << "incorrect value for last_msg_.acceleration, expected 27, is " << last_msg_.acceleration; - EXPECT_EQ(last_msg_.clock_drift, 0) << "incorrect value for last_msg_.clock_drift, expected 0, is " << last_msg_.clock_drift; - EXPECT_EQ(last_msg_.clock_offset, 0) << "incorrect value for last_msg_.clock_offset, expected 0, is " << last_msg_.clock_offset; - EXPECT_EQ(last_msg_.cn0, 179) << "incorrect value for last_msg_.cn0, expected 179, is " << last_msg_.cn0; - EXPECT_EQ(last_msg_.corr_spacing, 40) << "incorrect value for last_msg_.corr_spacing, expected 40, is " << last_msg_.corr_spacing; - EXPECT_EQ(last_msg_.doppler, 15683) << "incorrect value for last_msg_.doppler, expected 15683, is " << last_msg_.doppler; - EXPECT_EQ(last_msg_.doppler_std, 22) << "incorrect value for last_msg_.doppler_std, expected 22, is " << last_msg_.doppler_std; - EXPECT_EQ(last_msg_.lock, 14032) << "incorrect value for last_msg_.lock, expected 14032, is " << last_msg_.lock; - EXPECT_EQ(last_msg_.misc_flags, 9) << "incorrect value for last_msg_.misc_flags, expected 9, is " << last_msg_.misc_flags; - EXPECT_EQ(last_msg_.nav_flags, 0) << "incorrect value for last_msg_.nav_flags, expected 0, is " << last_msg_.nav_flags; - EXPECT_EQ(last_msg_.pset_flags, 2) << "incorrect value for last_msg_.pset_flags, expected 2, is " << last_msg_.pset_flags; - EXPECT_EQ(last_msg_.recv_time, 8907446923) << "incorrect value for last_msg_.recv_time, expected 8907446923, is " << last_msg_.recv_time; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 15) << "incorrect value for last_msg_.sid.sat, expected 15, is " << last_msg_.sid.sat; - EXPECT_EQ(last_msg_.sync_flags, 1) << "incorrect value for last_msg_.sync_flags, expected 1, is " << last_msg_.sync_flags; - EXPECT_EQ(last_msg_.tot.tow, 0) << "incorrect value for last_msg_.tot.tow, expected 0, is " << last_msg_.tot.tow; - EXPECT_EQ(last_msg_.tot.wn, 0) << "incorrect value for last_msg_.tot.wn, expected 0, is " << last_msg_.tot.wn; - EXPECT_EQ(last_msg_.tow_flags, 0) << "incorrect value for last_msg_.tow_flags, expected 0, is " << last_msg_.tow_flags; - EXPECT_EQ(last_msg_.track_flags, 11) << "incorrect value for last_msg_.track_flags, expected 11, is " << last_msg_.track_flags; - EXPECT_EQ(last_msg_.uptime, 2) << "incorrect value for last_msg_.uptime, expected 2, is " << last_msg_.uptime; +}; + +TEST_F(Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep2, Test) { + uint8_t encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 139, 218, 236, 18, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 8, 0, 0, 8, 179, + 208, 54, 15, 0, 0, 0, 67, 61, 0, 0, 22, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 27, 1, 0, 11, 0, 2, 9, 217, 159, + }; + + sbp_msg_tracking_state_detailed_dep_t test_msg{}; + test_msg.L.f = 8; + test_msg.L.i = 2298; + test_msg.P = 0; + test_msg.P_std = 0; + test_msg.acceleration = 27; + test_msg.clock_drift = 0; + test_msg.clock_offset = 0; + test_msg.cn0 = 179; + test_msg.corr_spacing = 40; + test_msg.doppler = 15683; + test_msg.doppler_std = 22; + test_msg.lock = 14032; + test_msg.misc_flags = 9; + test_msg.nav_flags = 0; + test_msg.pset_flags = 2; + test_msg.recv_time = 8907446923; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 15; + test_msg.sync_flags = 1; + test_msg.tot.tow = 0; + test_msg.tot.wn = 0; + test_msg.tow_flags = 0; + test_msg.track_flags = 11; + test_msg.uptime = 2; + + EXPECT_EQ(send_message(26427, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 26427); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.L.f, 8) + << "incorrect value for last_msg_.L.f, expected 8, is " << last_msg_.L.f; + EXPECT_EQ(last_msg_.L.i, 2298) + << "incorrect value for last_msg_.L.i, expected 2298, is " + << last_msg_.L.i; + EXPECT_EQ(last_msg_.P, 0) + << "incorrect value for last_msg_.P, expected 0, is " << last_msg_.P; + EXPECT_EQ(last_msg_.P_std, 0) + << "incorrect value for last_msg_.P_std, expected 0, is " + << last_msg_.P_std; + EXPECT_EQ(last_msg_.acceleration, 27) + << "incorrect value for last_msg_.acceleration, expected 27, is " + << last_msg_.acceleration; + EXPECT_EQ(last_msg_.clock_drift, 0) + << "incorrect value for last_msg_.clock_drift, expected 0, is " + << last_msg_.clock_drift; + EXPECT_EQ(last_msg_.clock_offset, 0) + << "incorrect value for last_msg_.clock_offset, expected 0, is " + << last_msg_.clock_offset; + EXPECT_EQ(last_msg_.cn0, 179) + << "incorrect value for last_msg_.cn0, expected 179, is " + << last_msg_.cn0; + EXPECT_EQ(last_msg_.corr_spacing, 40) + << "incorrect value for last_msg_.corr_spacing, expected 40, is " + << last_msg_.corr_spacing; + EXPECT_EQ(last_msg_.doppler, 15683) + << "incorrect value for last_msg_.doppler, expected 15683, is " + << last_msg_.doppler; + EXPECT_EQ(last_msg_.doppler_std, 22) + << "incorrect value for last_msg_.doppler_std, expected 22, is " + << last_msg_.doppler_std; + EXPECT_EQ(last_msg_.lock, 14032) + << "incorrect value for last_msg_.lock, expected 14032, is " + << last_msg_.lock; + EXPECT_EQ(last_msg_.misc_flags, 9) + << "incorrect value for last_msg_.misc_flags, expected 9, is " + << last_msg_.misc_flags; + EXPECT_EQ(last_msg_.nav_flags, 0) + << "incorrect value for last_msg_.nav_flags, expected 0, is " + << last_msg_.nav_flags; + EXPECT_EQ(last_msg_.pset_flags, 2) + << "incorrect value for last_msg_.pset_flags, expected 2, is " + << last_msg_.pset_flags; + EXPECT_EQ(last_msg_.recv_time, 8907446923) + << "incorrect value for last_msg_.recv_time, expected 8907446923, is " + << last_msg_.recv_time; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 15) + << "incorrect value for last_msg_.sid.sat, expected 15, is " + << last_msg_.sid.sat; + EXPECT_EQ(last_msg_.sync_flags, 1) + << "incorrect value for last_msg_.sync_flags, expected 1, is " + << last_msg_.sync_flags; + EXPECT_EQ(last_msg_.tot.tow, 0) + << "incorrect value for last_msg_.tot.tow, expected 0, is " + << last_msg_.tot.tow; + EXPECT_EQ(last_msg_.tot.wn, 0) + << "incorrect value for last_msg_.tot.wn, expected 0, is " + << last_msg_.tot.wn; + EXPECT_EQ(last_msg_.tow_flags, 0) + << "incorrect value for last_msg_.tow_flags, expected 0, is " + << last_msg_.tow_flags; + EXPECT_EQ(last_msg_.track_flags, 11) + << "incorrect value for last_msg_.track_flags, expected 11, is " + << last_msg_.track_flags; + EXPECT_EQ(last_msg_.uptime, 2) + << "incorrect value for last_msg_.uptime, expected 2, is " + << last_msg_.uptime; } -class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_state_detailed_dep_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_tracking_state_detailed_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -464,130 +600,177 @@ class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep3 : sbp_msg_tracking_state_detailed_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep3, Test) -{ - - uint8_t encoded_frame[] = {85,17,0,59,103,55,255,251,170,48,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,226,10,0,0,125,181,208,54,15,0,0,0,29,61,0,0,10,0,2,0,0,0,0,0,0,0,40,0,220,1,0,11,0,3,9,66,95, }; - - sbp_msg_tracking_state_detailed_dep_t test_msg{}; - test_msg.L.f = 125; - test_msg.L.i = 2786; - test_msg.P = 0; - test_msg.P_std = 0; - test_msg.acceleration = -36; - test_msg.clock_drift = 0; - test_msg.clock_offset = 0; - test_msg.cn0 = 181; - test_msg.corr_spacing = 40; - test_msg.doppler = 15645; - test_msg.doppler_std = 10; - test_msg.lock = 14032; - test_msg.misc_flags = 9; - test_msg.nav_flags = 0; - test_msg.pset_flags = 3; - test_msg.recv_time = 9406446591; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 15; - test_msg.sync_flags = 1; - test_msg.tot.tow = 0; - test_msg.tot.wn = 0; - test_msg.tow_flags = 0; - test_msg.track_flags = 11; - test_msg.uptime = 2; - - EXPECT_EQ(send_message( 26427, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 26427); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.L.f, 125) << "incorrect value for last_msg_.L.f, expected 125, is " << last_msg_.L.f; - EXPECT_EQ(last_msg_.L.i, 2786) << "incorrect value for last_msg_.L.i, expected 2786, is " << last_msg_.L.i; - EXPECT_EQ(last_msg_.P, 0) << "incorrect value for last_msg_.P, expected 0, is " << last_msg_.P; - EXPECT_EQ(last_msg_.P_std, 0) << "incorrect value for last_msg_.P_std, expected 0, is " << last_msg_.P_std; - EXPECT_EQ(last_msg_.acceleration, -36) << "incorrect value for last_msg_.acceleration, expected -36, is " << last_msg_.acceleration; - EXPECT_EQ(last_msg_.clock_drift, 0) << "incorrect value for last_msg_.clock_drift, expected 0, is " << last_msg_.clock_drift; - EXPECT_EQ(last_msg_.clock_offset, 0) << "incorrect value for last_msg_.clock_offset, expected 0, is " << last_msg_.clock_offset; - EXPECT_EQ(last_msg_.cn0, 181) << "incorrect value for last_msg_.cn0, expected 181, is " << last_msg_.cn0; - EXPECT_EQ(last_msg_.corr_spacing, 40) << "incorrect value for last_msg_.corr_spacing, expected 40, is " << last_msg_.corr_spacing; - EXPECT_EQ(last_msg_.doppler, 15645) << "incorrect value for last_msg_.doppler, expected 15645, is " << last_msg_.doppler; - EXPECT_EQ(last_msg_.doppler_std, 10) << "incorrect value for last_msg_.doppler_std, expected 10, is " << last_msg_.doppler_std; - EXPECT_EQ(last_msg_.lock, 14032) << "incorrect value for last_msg_.lock, expected 14032, is " << last_msg_.lock; - EXPECT_EQ(last_msg_.misc_flags, 9) << "incorrect value for last_msg_.misc_flags, expected 9, is " << last_msg_.misc_flags; - EXPECT_EQ(last_msg_.nav_flags, 0) << "incorrect value for last_msg_.nav_flags, expected 0, is " << last_msg_.nav_flags; - EXPECT_EQ(last_msg_.pset_flags, 3) << "incorrect value for last_msg_.pset_flags, expected 3, is " << last_msg_.pset_flags; - EXPECT_EQ(last_msg_.recv_time, 9406446591) << "incorrect value for last_msg_.recv_time, expected 9406446591, is " << last_msg_.recv_time; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 15) << "incorrect value for last_msg_.sid.sat, expected 15, is " << last_msg_.sid.sat; - EXPECT_EQ(last_msg_.sync_flags, 1) << "incorrect value for last_msg_.sync_flags, expected 1, is " << last_msg_.sync_flags; - EXPECT_EQ(last_msg_.tot.tow, 0) << "incorrect value for last_msg_.tot.tow, expected 0, is " << last_msg_.tot.tow; - EXPECT_EQ(last_msg_.tot.wn, 0) << "incorrect value for last_msg_.tot.wn, expected 0, is " << last_msg_.tot.wn; - EXPECT_EQ(last_msg_.tow_flags, 0) << "incorrect value for last_msg_.tow_flags, expected 0, is " << last_msg_.tow_flags; - EXPECT_EQ(last_msg_.track_flags, 11) << "incorrect value for last_msg_.track_flags, expected 11, is " << last_msg_.track_flags; - EXPECT_EQ(last_msg_.uptime, 2) << "incorrect value for last_msg_.uptime, expected 2, is " << last_msg_.uptime; +}; + +TEST_F(Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep3, Test) { + uint8_t encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 255, 251, 170, 48, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 226, 10, 0, 0, 125, 181, + 208, 54, 15, 0, 0, 0, 29, 61, 0, 0, 10, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 220, 1, 0, 11, 0, 3, 9, 66, 95, + }; + + sbp_msg_tracking_state_detailed_dep_t test_msg{}; + test_msg.L.f = 125; + test_msg.L.i = 2786; + test_msg.P = 0; + test_msg.P_std = 0; + test_msg.acceleration = -36; + test_msg.clock_drift = 0; + test_msg.clock_offset = 0; + test_msg.cn0 = 181; + test_msg.corr_spacing = 40; + test_msg.doppler = 15645; + test_msg.doppler_std = 10; + test_msg.lock = 14032; + test_msg.misc_flags = 9; + test_msg.nav_flags = 0; + test_msg.pset_flags = 3; + test_msg.recv_time = 9406446591; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 15; + test_msg.sync_flags = 1; + test_msg.tot.tow = 0; + test_msg.tot.wn = 0; + test_msg.tow_flags = 0; + test_msg.track_flags = 11; + test_msg.uptime = 2; + + EXPECT_EQ(send_message(26427, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 26427); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.L.f, 125) + << "incorrect value for last_msg_.L.f, expected 125, is " + << last_msg_.L.f; + EXPECT_EQ(last_msg_.L.i, 2786) + << "incorrect value for last_msg_.L.i, expected 2786, is " + << last_msg_.L.i; + EXPECT_EQ(last_msg_.P, 0) + << "incorrect value for last_msg_.P, expected 0, is " << last_msg_.P; + EXPECT_EQ(last_msg_.P_std, 0) + << "incorrect value for last_msg_.P_std, expected 0, is " + << last_msg_.P_std; + EXPECT_EQ(last_msg_.acceleration, -36) + << "incorrect value for last_msg_.acceleration, expected -36, is " + << last_msg_.acceleration; + EXPECT_EQ(last_msg_.clock_drift, 0) + << "incorrect value for last_msg_.clock_drift, expected 0, is " + << last_msg_.clock_drift; + EXPECT_EQ(last_msg_.clock_offset, 0) + << "incorrect value for last_msg_.clock_offset, expected 0, is " + << last_msg_.clock_offset; + EXPECT_EQ(last_msg_.cn0, 181) + << "incorrect value for last_msg_.cn0, expected 181, is " + << last_msg_.cn0; + EXPECT_EQ(last_msg_.corr_spacing, 40) + << "incorrect value for last_msg_.corr_spacing, expected 40, is " + << last_msg_.corr_spacing; + EXPECT_EQ(last_msg_.doppler, 15645) + << "incorrect value for last_msg_.doppler, expected 15645, is " + << last_msg_.doppler; + EXPECT_EQ(last_msg_.doppler_std, 10) + << "incorrect value for last_msg_.doppler_std, expected 10, is " + << last_msg_.doppler_std; + EXPECT_EQ(last_msg_.lock, 14032) + << "incorrect value for last_msg_.lock, expected 14032, is " + << last_msg_.lock; + EXPECT_EQ(last_msg_.misc_flags, 9) + << "incorrect value for last_msg_.misc_flags, expected 9, is " + << last_msg_.misc_flags; + EXPECT_EQ(last_msg_.nav_flags, 0) + << "incorrect value for last_msg_.nav_flags, expected 0, is " + << last_msg_.nav_flags; + EXPECT_EQ(last_msg_.pset_flags, 3) + << "incorrect value for last_msg_.pset_flags, expected 3, is " + << last_msg_.pset_flags; + EXPECT_EQ(last_msg_.recv_time, 9406446591) + << "incorrect value for last_msg_.recv_time, expected 9406446591, is " + << last_msg_.recv_time; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 15) + << "incorrect value for last_msg_.sid.sat, expected 15, is " + << last_msg_.sid.sat; + EXPECT_EQ(last_msg_.sync_flags, 1) + << "incorrect value for last_msg_.sync_flags, expected 1, is " + << last_msg_.sync_flags; + EXPECT_EQ(last_msg_.tot.tow, 0) + << "incorrect value for last_msg_.tot.tow, expected 0, is " + << last_msg_.tot.tow; + EXPECT_EQ(last_msg_.tot.wn, 0) + << "incorrect value for last_msg_.tot.wn, expected 0, is " + << last_msg_.tot.wn; + EXPECT_EQ(last_msg_.tow_flags, 0) + << "incorrect value for last_msg_.tow_flags, expected 0, is " + << last_msg_.tow_flags; + EXPECT_EQ(last_msg_.track_flags, 11) + << "incorrect value for last_msg_.track_flags, expected 11, is " + << last_msg_.track_flags; + EXPECT_EQ(last_msg_.uptime, 2) + << "incorrect value for last_msg_.uptime, expected 2, is " + << last_msg_.uptime; } -class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_state_detailed_dep_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_tracking_state_detailed_dep_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -595,80 +778,131 @@ class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep4 : sbp_msg_tracking_state_detailed_dep_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep4, Test) -{ - - uint8_t encoded_frame[] = {85,17,0,59,103,55,189,95,120,78,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,12,0,0,64,184,208,54,15,0,0,0,24,61,0,0,4,0,3,0,0,0,0,0,0,0,40,0,2,1,0,11,0,3,9,194,206, }; - - sbp_msg_tracking_state_detailed_dep_t test_msg{}; - test_msg.L.f = 64; - test_msg.L.i = 3275; - test_msg.P = 0; - test_msg.P_std = 0; - test_msg.acceleration = 2; - test_msg.clock_drift = 0; - test_msg.clock_offset = 0; - test_msg.cn0 = 184; - test_msg.corr_spacing = 40; - test_msg.doppler = 15640; - test_msg.doppler_std = 4; - test_msg.lock = 14032; - test_msg.misc_flags = 9; - test_msg.nav_flags = 0; - test_msg.pset_flags = 3; - test_msg.recv_time = 9906446269; - test_msg.sid.code = 0; - test_msg.sid.reserved = 0; - test_msg.sid.sat = 15; - test_msg.sync_flags = 1; - test_msg.tot.tow = 0; - test_msg.tot.wn = 0; - test_msg.tow_flags = 0; - test_msg.track_flags = 11; - test_msg.uptime = 3; - - EXPECT_EQ(send_message( 26427, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 26427); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.L.f, 64) << "incorrect value for last_msg_.L.f, expected 64, is " << last_msg_.L.f; - EXPECT_EQ(last_msg_.L.i, 3275) << "incorrect value for last_msg_.L.i, expected 3275, is " << last_msg_.L.i; - EXPECT_EQ(last_msg_.P, 0) << "incorrect value for last_msg_.P, expected 0, is " << last_msg_.P; - EXPECT_EQ(last_msg_.P_std, 0) << "incorrect value for last_msg_.P_std, expected 0, is " << last_msg_.P_std; - EXPECT_EQ(last_msg_.acceleration, 2) << "incorrect value for last_msg_.acceleration, expected 2, is " << last_msg_.acceleration; - EXPECT_EQ(last_msg_.clock_drift, 0) << "incorrect value for last_msg_.clock_drift, expected 0, is " << last_msg_.clock_drift; - EXPECT_EQ(last_msg_.clock_offset, 0) << "incorrect value for last_msg_.clock_offset, expected 0, is " << last_msg_.clock_offset; - EXPECT_EQ(last_msg_.cn0, 184) << "incorrect value for last_msg_.cn0, expected 184, is " << last_msg_.cn0; - EXPECT_EQ(last_msg_.corr_spacing, 40) << "incorrect value for last_msg_.corr_spacing, expected 40, is " << last_msg_.corr_spacing; - EXPECT_EQ(last_msg_.doppler, 15640) << "incorrect value for last_msg_.doppler, expected 15640, is " << last_msg_.doppler; - EXPECT_EQ(last_msg_.doppler_std, 4) << "incorrect value for last_msg_.doppler_std, expected 4, is " << last_msg_.doppler_std; - EXPECT_EQ(last_msg_.lock, 14032) << "incorrect value for last_msg_.lock, expected 14032, is " << last_msg_.lock; - EXPECT_EQ(last_msg_.misc_flags, 9) << "incorrect value for last_msg_.misc_flags, expected 9, is " << last_msg_.misc_flags; - EXPECT_EQ(last_msg_.nav_flags, 0) << "incorrect value for last_msg_.nav_flags, expected 0, is " << last_msg_.nav_flags; - EXPECT_EQ(last_msg_.pset_flags, 3) << "incorrect value for last_msg_.pset_flags, expected 3, is " << last_msg_.pset_flags; - EXPECT_EQ(last_msg_.recv_time, 9906446269) << "incorrect value for last_msg_.recv_time, expected 9906446269, is " << last_msg_.recv_time; - EXPECT_EQ(last_msg_.sid.code, 0) << "incorrect value for last_msg_.sid.code, expected 0, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.reserved, 0) << "incorrect value for last_msg_.sid.reserved, expected 0, is " << last_msg_.sid.reserved; - EXPECT_EQ(last_msg_.sid.sat, 15) << "incorrect value for last_msg_.sid.sat, expected 15, is " << last_msg_.sid.sat; - EXPECT_EQ(last_msg_.sync_flags, 1) << "incorrect value for last_msg_.sync_flags, expected 1, is " << last_msg_.sync_flags; - EXPECT_EQ(last_msg_.tot.tow, 0) << "incorrect value for last_msg_.tot.tow, expected 0, is " << last_msg_.tot.tow; - EXPECT_EQ(last_msg_.tot.wn, 0) << "incorrect value for last_msg_.tot.wn, expected 0, is " << last_msg_.tot.wn; - EXPECT_EQ(last_msg_.tow_flags, 0) << "incorrect value for last_msg_.tow_flags, expected 0, is " << last_msg_.tow_flags; - EXPECT_EQ(last_msg_.track_flags, 11) << "incorrect value for last_msg_.track_flags, expected 11, is " << last_msg_.track_flags; - EXPECT_EQ(last_msg_.uptime, 3) << "incorrect value for last_msg_.uptime, expected 3, is " << last_msg_.uptime; +}; + +TEST_F(Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDep4, Test) { + uint8_t encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 189, 95, 120, 78, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 203, 12, 0, 0, 64, 184, + 208, 54, 15, 0, 0, 0, 24, 61, 0, 0, 4, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 2, 1, 0, 11, 0, 3, 9, 194, 206, + }; + + sbp_msg_tracking_state_detailed_dep_t test_msg{}; + test_msg.L.f = 64; + test_msg.L.i = 3275; + test_msg.P = 0; + test_msg.P_std = 0; + test_msg.acceleration = 2; + test_msg.clock_drift = 0; + test_msg.clock_offset = 0; + test_msg.cn0 = 184; + test_msg.corr_spacing = 40; + test_msg.doppler = 15640; + test_msg.doppler_std = 4; + test_msg.lock = 14032; + test_msg.misc_flags = 9; + test_msg.nav_flags = 0; + test_msg.pset_flags = 3; + test_msg.recv_time = 9906446269; + test_msg.sid.code = 0; + test_msg.sid.reserved = 0; + test_msg.sid.sat = 15; + test_msg.sync_flags = 1; + test_msg.tot.tow = 0; + test_msg.tot.wn = 0; + test_msg.tow_flags = 0; + test_msg.track_flags = 11; + test_msg.uptime = 3; + + EXPECT_EQ(send_message(26427, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 26427); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.L.f, 64) + << "incorrect value for last_msg_.L.f, expected 64, is " << last_msg_.L.f; + EXPECT_EQ(last_msg_.L.i, 3275) + << "incorrect value for last_msg_.L.i, expected 3275, is " + << last_msg_.L.i; + EXPECT_EQ(last_msg_.P, 0) + << "incorrect value for last_msg_.P, expected 0, is " << last_msg_.P; + EXPECT_EQ(last_msg_.P_std, 0) + << "incorrect value for last_msg_.P_std, expected 0, is " + << last_msg_.P_std; + EXPECT_EQ(last_msg_.acceleration, 2) + << "incorrect value for last_msg_.acceleration, expected 2, is " + << last_msg_.acceleration; + EXPECT_EQ(last_msg_.clock_drift, 0) + << "incorrect value for last_msg_.clock_drift, expected 0, is " + << last_msg_.clock_drift; + EXPECT_EQ(last_msg_.clock_offset, 0) + << "incorrect value for last_msg_.clock_offset, expected 0, is " + << last_msg_.clock_offset; + EXPECT_EQ(last_msg_.cn0, 184) + << "incorrect value for last_msg_.cn0, expected 184, is " + << last_msg_.cn0; + EXPECT_EQ(last_msg_.corr_spacing, 40) + << "incorrect value for last_msg_.corr_spacing, expected 40, is " + << last_msg_.corr_spacing; + EXPECT_EQ(last_msg_.doppler, 15640) + << "incorrect value for last_msg_.doppler, expected 15640, is " + << last_msg_.doppler; + EXPECT_EQ(last_msg_.doppler_std, 4) + << "incorrect value for last_msg_.doppler_std, expected 4, is " + << last_msg_.doppler_std; + EXPECT_EQ(last_msg_.lock, 14032) + << "incorrect value for last_msg_.lock, expected 14032, is " + << last_msg_.lock; + EXPECT_EQ(last_msg_.misc_flags, 9) + << "incorrect value for last_msg_.misc_flags, expected 9, is " + << last_msg_.misc_flags; + EXPECT_EQ(last_msg_.nav_flags, 0) + << "incorrect value for last_msg_.nav_flags, expected 0, is " + << last_msg_.nav_flags; + EXPECT_EQ(last_msg_.pset_flags, 3) + << "incorrect value for last_msg_.pset_flags, expected 3, is " + << last_msg_.pset_flags; + EXPECT_EQ(last_msg_.recv_time, 9906446269) + << "incorrect value for last_msg_.recv_time, expected 9906446269, is " + << last_msg_.recv_time; + EXPECT_EQ(last_msg_.sid.code, 0) + << "incorrect value for last_msg_.sid.code, expected 0, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.reserved, 0) + << "incorrect value for last_msg_.sid.reserved, expected 0, is " + << last_msg_.sid.reserved; + EXPECT_EQ(last_msg_.sid.sat, 15) + << "incorrect value for last_msg_.sid.sat, expected 15, is " + << last_msg_.sid.sat; + EXPECT_EQ(last_msg_.sync_flags, 1) + << "incorrect value for last_msg_.sync_flags, expected 1, is " + << last_msg_.sync_flags; + EXPECT_EQ(last_msg_.tot.tow, 0) + << "incorrect value for last_msg_.tot.tow, expected 0, is " + << last_msg_.tot.tow; + EXPECT_EQ(last_msg_.tot.wn, 0) + << "incorrect value for last_msg_.tot.wn, expected 0, is " + << last_msg_.tot.wn; + EXPECT_EQ(last_msg_.tow_flags, 0) + << "incorrect value for last_msg_.tow_flags, expected 0, is " + << last_msg_.tow_flags; + EXPECT_EQ(last_msg_.track_flags, 11) + << "incorrect value for last_msg_.track_flags, expected 11, is " + << last_msg_.track_flags; + EXPECT_EQ(last_msg_.uptime, 3) + << "incorrect value for last_msg_.uptime, expected 3, is " + << last_msg_.uptime; } diff --git a/c/test/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.cc b/c/test/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.cc index 5d8e52ebd..6e77f34a4 100644 --- a/c/test/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.cc +++ b/c/test/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.cc @@ -10,60 +10,57 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDepA.yaml +// by generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_state_detailed_dep_a_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, + const sbp_msg_tracking_state_detailed_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,80 +68,134 @@ class Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA0 : sbp_msg_tracking_state_detailed_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 33, 0, 155, 110, 57, 46, 31, 180, 38, 219, 0, 0, + 0, 133, 100, 71, 94, 192, 2, 160, 207, 212, 255, 135, 139, + 62, 62, 179, 83, 227, 245, 134, 160, 204, 78, 95, 255, 38, + 59, 161, 15, 255, 86, 189, 248, 31, 191, 136, 194, 124, 23, + 15, 91, 249, 117, 142, 90, 219, 67, 25, 83, 62, 122, 100, + }; - uint8_t encoded_frame[] = {85,33,0,155,110,57,46,31,180,38,219,0,0,0,133,100,71,94,192,2,160,207,212,255,135,139,62,62,179,83,227,245,134,160,204,78,95,255,38,59,161,15,255,86,189,248,31,191,136,194,124,23,15,91,249,117,142,90,219,67,25,83,62,122,100, }; + sbp_msg_tracking_state_detailed_dep_a_t test_msg{}; + test_msg.L.f = 204; + test_msg.L.i = -1601767965; + test_msg.P = 1044286343; + test_msg.P_std = 21427; + test_msg.acceleration = -114; + test_msg.clock_drift = 23311; + test_msg.clock_offset = 6012; + test_msg.cn0 = 78; + test_msg.corr_spacing = 30201; + test_msg.doppler = 1459556257; + test_msg.doppler_std = 63677; + test_msg.lock = 65375; + test_msg.misc_flags = 62; + test_msg.nav_flags = 25; + test_msg.pset_flags = 83; + test_msg.recv_time = 941247176494; + test_msg.sid.code = 59; + test_msg.sid.sat = 38; + test_msg.sync_flags = 90; + test_msg.tot.ns_residual = -811597120; + test_msg.tot.tow = 1581737093; + test_msg.tot.wn = 65492; + test_msg.tow_flags = 219; + test_msg.track_flags = 67; + test_msg.uptime = 3263741727; - sbp_msg_tracking_state_detailed_dep_a_t test_msg{}; - test_msg.L.f = 204; - test_msg.L.i = -1601767965; - test_msg.P = 1044286343; - test_msg.P_std = 21427; - test_msg.acceleration = -114; - test_msg.clock_drift = 23311; - test_msg.clock_offset = 6012; - test_msg.cn0 = 78; - test_msg.corr_spacing = 30201; - test_msg.doppler = 1459556257; - test_msg.doppler_std = 63677; - test_msg.lock = 65375; - test_msg.misc_flags = 62; - test_msg.nav_flags = 25; - test_msg.pset_flags = 83; - test_msg.recv_time = 941247176494; - test_msg.sid.code = 59; - test_msg.sid.sat = 38; - test_msg.sync_flags = 90; - test_msg.tot.ns_residual = -811597120; - test_msg.tot.tow = 1581737093; - test_msg.tot.wn = 65492; - test_msg.tow_flags = 219; - test_msg.track_flags = 67; - test_msg.uptime = 3263741727; - - EXPECT_EQ(send_message( 28315, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(28315, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 28315); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.L.f, 204) << "incorrect value for last_msg_.L.f, expected 204, is " << last_msg_.L.f; - EXPECT_EQ(last_msg_.L.i, -1601767965) << "incorrect value for last_msg_.L.i, expected -1601767965, is " << last_msg_.L.i; - EXPECT_EQ(last_msg_.P, 1044286343) << "incorrect value for last_msg_.P, expected 1044286343, is " << last_msg_.P; - EXPECT_EQ(last_msg_.P_std, 21427) << "incorrect value for last_msg_.P_std, expected 21427, is " << last_msg_.P_std; - EXPECT_EQ(last_msg_.acceleration, -114) << "incorrect value for last_msg_.acceleration, expected -114, is " << last_msg_.acceleration; - EXPECT_EQ(last_msg_.clock_drift, 23311) << "incorrect value for last_msg_.clock_drift, expected 23311, is " << last_msg_.clock_drift; - EXPECT_EQ(last_msg_.clock_offset, 6012) << "incorrect value for last_msg_.clock_offset, expected 6012, is " << last_msg_.clock_offset; - EXPECT_EQ(last_msg_.cn0, 78) << "incorrect value for last_msg_.cn0, expected 78, is " << last_msg_.cn0; - EXPECT_EQ(last_msg_.corr_spacing, 30201) << "incorrect value for last_msg_.corr_spacing, expected 30201, is " << last_msg_.corr_spacing; - EXPECT_EQ(last_msg_.doppler, 1459556257) << "incorrect value for last_msg_.doppler, expected 1459556257, is " << last_msg_.doppler; - EXPECT_EQ(last_msg_.doppler_std, 63677) << "incorrect value for last_msg_.doppler_std, expected 63677, is " << last_msg_.doppler_std; - EXPECT_EQ(last_msg_.lock, 65375) << "incorrect value for last_msg_.lock, expected 65375, is " << last_msg_.lock; - EXPECT_EQ(last_msg_.misc_flags, 62) << "incorrect value for last_msg_.misc_flags, expected 62, is " << last_msg_.misc_flags; - EXPECT_EQ(last_msg_.nav_flags, 25) << "incorrect value for last_msg_.nav_flags, expected 25, is " << last_msg_.nav_flags; - EXPECT_EQ(last_msg_.pset_flags, 83) << "incorrect value for last_msg_.pset_flags, expected 83, is " << last_msg_.pset_flags; - EXPECT_EQ(last_msg_.recv_time, 941247176494) << "incorrect value for last_msg_.recv_time, expected 941247176494, is " << last_msg_.recv_time; - EXPECT_EQ(last_msg_.sid.code, 59) << "incorrect value for last_msg_.sid.code, expected 59, is " << last_msg_.sid.code; - EXPECT_EQ(last_msg_.sid.sat, 38) << "incorrect value for last_msg_.sid.sat, expected 38, is " << last_msg_.sid.sat; - EXPECT_EQ(last_msg_.sync_flags, 90) << "incorrect value for last_msg_.sync_flags, expected 90, is " << last_msg_.sync_flags; - EXPECT_EQ(last_msg_.tot.ns_residual, -811597120) << "incorrect value for last_msg_.tot.ns_residual, expected -811597120, is " << last_msg_.tot.ns_residual; - EXPECT_EQ(last_msg_.tot.tow, 1581737093) << "incorrect value for last_msg_.tot.tow, expected 1581737093, is " << last_msg_.tot.tow; - EXPECT_EQ(last_msg_.tot.wn, 65492) << "incorrect value for last_msg_.tot.wn, expected 65492, is " << last_msg_.tot.wn; - EXPECT_EQ(last_msg_.tow_flags, 219) << "incorrect value for last_msg_.tow_flags, expected 219, is " << last_msg_.tow_flags; - EXPECT_EQ(last_msg_.track_flags, 67) << "incorrect value for last_msg_.track_flags, expected 67, is " << last_msg_.track_flags; - EXPECT_EQ(last_msg_.uptime, 3263741727) << "incorrect value for last_msg_.uptime, expected 3263741727, is " << last_msg_.uptime; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 28315); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.L.f, 204) + << "incorrect value for last_msg_.L.f, expected 204, is " + << last_msg_.L.f; + EXPECT_EQ(last_msg_.L.i, -1601767965) + << "incorrect value for last_msg_.L.i, expected -1601767965, is " + << last_msg_.L.i; + EXPECT_EQ(last_msg_.P, 1044286343) + << "incorrect value for last_msg_.P, expected 1044286343, is " + << last_msg_.P; + EXPECT_EQ(last_msg_.P_std, 21427) + << "incorrect value for last_msg_.P_std, expected 21427, is " + << last_msg_.P_std; + EXPECT_EQ(last_msg_.acceleration, -114) + << "incorrect value for last_msg_.acceleration, expected -114, is " + << last_msg_.acceleration; + EXPECT_EQ(last_msg_.clock_drift, 23311) + << "incorrect value for last_msg_.clock_drift, expected 23311, is " + << last_msg_.clock_drift; + EXPECT_EQ(last_msg_.clock_offset, 6012) + << "incorrect value for last_msg_.clock_offset, expected 6012, is " + << last_msg_.clock_offset; + EXPECT_EQ(last_msg_.cn0, 78) + << "incorrect value for last_msg_.cn0, expected 78, is " << last_msg_.cn0; + EXPECT_EQ(last_msg_.corr_spacing, 30201) + << "incorrect value for last_msg_.corr_spacing, expected 30201, is " + << last_msg_.corr_spacing; + EXPECT_EQ(last_msg_.doppler, 1459556257) + << "incorrect value for last_msg_.doppler, expected 1459556257, is " + << last_msg_.doppler; + EXPECT_EQ(last_msg_.doppler_std, 63677) + << "incorrect value for last_msg_.doppler_std, expected 63677, is " + << last_msg_.doppler_std; + EXPECT_EQ(last_msg_.lock, 65375) + << "incorrect value for last_msg_.lock, expected 65375, is " + << last_msg_.lock; + EXPECT_EQ(last_msg_.misc_flags, 62) + << "incorrect value for last_msg_.misc_flags, expected 62, is " + << last_msg_.misc_flags; + EXPECT_EQ(last_msg_.nav_flags, 25) + << "incorrect value for last_msg_.nav_flags, expected 25, is " + << last_msg_.nav_flags; + EXPECT_EQ(last_msg_.pset_flags, 83) + << "incorrect value for last_msg_.pset_flags, expected 83, is " + << last_msg_.pset_flags; + EXPECT_EQ(last_msg_.recv_time, 941247176494) + << "incorrect value for last_msg_.recv_time, expected 941247176494, is " + << last_msg_.recv_time; + EXPECT_EQ(last_msg_.sid.code, 59) + << "incorrect value for last_msg_.sid.code, expected 59, is " + << last_msg_.sid.code; + EXPECT_EQ(last_msg_.sid.sat, 38) + << "incorrect value for last_msg_.sid.sat, expected 38, is " + << last_msg_.sid.sat; + EXPECT_EQ(last_msg_.sync_flags, 90) + << "incorrect value for last_msg_.sync_flags, expected 90, is " + << last_msg_.sync_flags; + EXPECT_EQ(last_msg_.tot.ns_residual, -811597120) + << "incorrect value for last_msg_.tot.ns_residual, expected -811597120, " + "is " + << last_msg_.tot.ns_residual; + EXPECT_EQ(last_msg_.tot.tow, 1581737093) + << "incorrect value for last_msg_.tot.tow, expected 1581737093, is " + << last_msg_.tot.tow; + EXPECT_EQ(last_msg_.tot.wn, 65492) + << "incorrect value for last_msg_.tot.wn, expected 65492, is " + << last_msg_.tot.wn; + EXPECT_EQ(last_msg_.tow_flags, 219) + << "incorrect value for last_msg_.tow_flags, expected 219, is " + << last_msg_.tow_flags; + EXPECT_EQ(last_msg_.track_flags, 67) + << "incorrect value for last_msg_.track_flags, expected 67, is " + << last_msg_.track_flags; + EXPECT_EQ(last_msg_.uptime, 3263741727) + << "incorrect value for last_msg_.uptime, expected 3263741727, is " + << last_msg_.uptime; } diff --git a/c/test/cpp/auto_check_sbp_tracking_MsgtrackingStateDepA.cc b/c/test/cpp/auto_check_sbp_tracking_MsgtrackingStateDepA.cc index 9b537f749..94419ac3d 100644 --- a/c/test/cpp/auto_check_sbp_tracking_MsgtrackingStateDepA.cc +++ b/c/test/cpp/auto_check_sbp_tracking_MsgtrackingStateDepA.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgtrackingStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgtrackingStateDepA.yaml by +// generate.py. Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_tracking_MsgtrackingStateDepA0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgtrackingStateDepA0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_tracking_MsgtrackingStateDepA0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgtrackingStateDepA0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_tracking_state_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,175 +67,267 @@ class Test_auto_check_sbp_tracking_MsgtrackingStateDepA0 : sbp_msg_tracking_state_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgtrackingStateDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,22,0,195,4,66,1,0,204,177,51,65,1,2,198,4,39,65,1,3,219,182,27,65,1,7,132,120,101,65,1,10,91,91,251,64,1,13,42,37,163,64,1,22,130,184,215,64,1,30,115,53,75,65,1,31,16,74,126,65,1,25,132,196,135,64,1,6,100,59,223,64,17,225, }; - - sbp_msg_tracking_state_dep_a_t test_msg{}; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_states.value = 11; - - test_msg.states[0].cn0 = 11.230907440185547; - test_msg.states[0].prn = 0; - test_msg.states[0].state = 1; - - test_msg.states[1].cn0 = 10.438665390014648; - test_msg.states[1].prn = 2; - test_msg.states[1].state = 1; - - test_msg.states[2].cn0 = 9.732142448425293; - test_msg.states[2].prn = 3; - test_msg.states[2].state = 1; - - test_msg.states[3].cn0 = 14.341922760009766; - test_msg.states[3].prn = 7; - test_msg.states[3].state = 1; - - test_msg.states[4].cn0 = 7.8549017906188965; - test_msg.states[4].prn = 10; - test_msg.states[4].state = 1; - - test_msg.states[5].cn0 = 5.0982866287231445; - test_msg.states[5].prn = 13; - test_msg.states[5].state = 1; - - test_msg.states[6].cn0 = 6.741272926330566; - test_msg.states[6].prn = 22; - test_msg.states[6].state = 1; - - test_msg.states[7].cn0 = 12.700549125671387; - test_msg.states[7].prn = 30; - test_msg.states[7].state = 1; - - test_msg.states[8].cn0 = 15.893081665039062; - test_msg.states[8].prn = 31; - test_msg.states[8].state = 1; - - test_msg.states[9].cn0 = 4.242738723754883; - test_msg.states[9].prn = 25; - test_msg.states[9].state = 1; - - test_msg.states[10].cn0 = 6.97599983215332; - test_msg.states[10].prn = 6; - test_msg.states[10].state = 1; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_states.value, 11) << "incorrect value for last_msg_.n_states.value, expected 11, is " << last_msg_.n_states.value; - EXPECT_LT((last_msg_.states[0].cn0 * 100 - 11.2309074402 * 100), 0.05) << "incorrect value for last_msg_.states[0].cn0, expected 11.2309074402, is " << last_msg_.states[0].cn0; - EXPECT_EQ(last_msg_.states[0].prn, 0) << "incorrect value for last_msg_.states[0].prn, expected 0, is " << last_msg_.states[0].prn; - EXPECT_EQ(last_msg_.states[0].state, 1) << "incorrect value for last_msg_.states[0].state, expected 1, is " << last_msg_.states[0].state; - EXPECT_LT((last_msg_.states[1].cn0 * 100 - 10.43866539 * 100), 0.05) << "incorrect value for last_msg_.states[1].cn0, expected 10.43866539, is " << last_msg_.states[1].cn0; - EXPECT_EQ(last_msg_.states[1].prn, 2) << "incorrect value for last_msg_.states[1].prn, expected 2, is " << last_msg_.states[1].prn; - EXPECT_EQ(last_msg_.states[1].state, 1) << "incorrect value for last_msg_.states[1].state, expected 1, is " << last_msg_.states[1].state; - EXPECT_LT((last_msg_.states[2].cn0 * 100 - 9.73214244843 * 100), 0.05) << "incorrect value for last_msg_.states[2].cn0, expected 9.73214244843, is " << last_msg_.states[2].cn0; - EXPECT_EQ(last_msg_.states[2].prn, 3) << "incorrect value for last_msg_.states[2].prn, expected 3, is " << last_msg_.states[2].prn; - EXPECT_EQ(last_msg_.states[2].state, 1) << "incorrect value for last_msg_.states[2].state, expected 1, is " << last_msg_.states[2].state; - EXPECT_LT((last_msg_.states[3].cn0 * 100 - 14.34192276 * 100), 0.05) << "incorrect value for last_msg_.states[3].cn0, expected 14.34192276, is " << last_msg_.states[3].cn0; - EXPECT_EQ(last_msg_.states[3].prn, 7) << "incorrect value for last_msg_.states[3].prn, expected 7, is " << last_msg_.states[3].prn; - EXPECT_EQ(last_msg_.states[3].state, 1) << "incorrect value for last_msg_.states[3].state, expected 1, is " << last_msg_.states[3].state; - EXPECT_LT((last_msg_.states[4].cn0 * 100 - 7.85490179062 * 100), 0.05) << "incorrect value for last_msg_.states[4].cn0, expected 7.85490179062, is " << last_msg_.states[4].cn0; - EXPECT_EQ(last_msg_.states[4].prn, 10) << "incorrect value for last_msg_.states[4].prn, expected 10, is " << last_msg_.states[4].prn; - EXPECT_EQ(last_msg_.states[4].state, 1) << "incorrect value for last_msg_.states[4].state, expected 1, is " << last_msg_.states[4].state; - EXPECT_LT((last_msg_.states[5].cn0 * 100 - 5.09828662872 * 100), 0.05) << "incorrect value for last_msg_.states[5].cn0, expected 5.09828662872, is " << last_msg_.states[5].cn0; - EXPECT_EQ(last_msg_.states[5].prn, 13) << "incorrect value for last_msg_.states[5].prn, expected 13, is " << last_msg_.states[5].prn; - EXPECT_EQ(last_msg_.states[5].state, 1) << "incorrect value for last_msg_.states[5].state, expected 1, is " << last_msg_.states[5].state; - EXPECT_LT((last_msg_.states[6].cn0 * 100 - 6.74127292633 * 100), 0.05) << "incorrect value for last_msg_.states[6].cn0, expected 6.74127292633, is " << last_msg_.states[6].cn0; - EXPECT_EQ(last_msg_.states[6].prn, 22) << "incorrect value for last_msg_.states[6].prn, expected 22, is " << last_msg_.states[6].prn; - EXPECT_EQ(last_msg_.states[6].state, 1) << "incorrect value for last_msg_.states[6].state, expected 1, is " << last_msg_.states[6].state; - EXPECT_LT((last_msg_.states[7].cn0 * 100 - 12.7005491257 * 100), 0.05) << "incorrect value for last_msg_.states[7].cn0, expected 12.7005491257, is " << last_msg_.states[7].cn0; - EXPECT_EQ(last_msg_.states[7].prn, 30) << "incorrect value for last_msg_.states[7].prn, expected 30, is " << last_msg_.states[7].prn; - EXPECT_EQ(last_msg_.states[7].state, 1) << "incorrect value for last_msg_.states[7].state, expected 1, is " << last_msg_.states[7].state; - EXPECT_LT((last_msg_.states[8].cn0 * 100 - 15.893081665 * 100), 0.05) << "incorrect value for last_msg_.states[8].cn0, expected 15.893081665, is " << last_msg_.states[8].cn0; - EXPECT_EQ(last_msg_.states[8].prn, 31) << "incorrect value for last_msg_.states[8].prn, expected 31, is " << last_msg_.states[8].prn; - EXPECT_EQ(last_msg_.states[8].state, 1) << "incorrect value for last_msg_.states[8].state, expected 1, is " << last_msg_.states[8].state; - EXPECT_LT((last_msg_.states[9].cn0 * 100 - 4.24273872375 * 100), 0.05) << "incorrect value for last_msg_.states[9].cn0, expected 4.24273872375, is " << last_msg_.states[9].cn0; - EXPECT_EQ(last_msg_.states[9].prn, 25) << "incorrect value for last_msg_.states[9].prn, expected 25, is " << last_msg_.states[9].prn; - EXPECT_EQ(last_msg_.states[9].state, 1) << "incorrect value for last_msg_.states[9].state, expected 1, is " << last_msg_.states[9].state; - EXPECT_LT((last_msg_.states[10].cn0 * 100 - 6.97599983215 * 100), 0.05) << "incorrect value for last_msg_.states[10].cn0, expected 6.97599983215, is " << last_msg_.states[10].cn0; - EXPECT_EQ(last_msg_.states[10].prn, 6) << "incorrect value for last_msg_.states[10].prn, expected 6, is " << last_msg_.states[10].prn; - EXPECT_EQ(last_msg_.states[10].state, 1) << "incorrect value for last_msg_.states[10].state, expected 1, is " << last_msg_.states[10].state; +}; + +TEST_F(Test_auto_check_sbp_tracking_MsgtrackingStateDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 204, 177, 51, 65, 1, 2, 198, + 4, 39, 65, 1, 3, 219, 182, 27, 65, 1, 7, 132, 120, 101, 65, + 1, 10, 91, 91, 251, 64, 1, 13, 42, 37, 163, 64, 1, 22, 130, + 184, 215, 64, 1, 30, 115, 53, 75, 65, 1, 31, 16, 74, 126, 65, + 1, 25, 132, 196, 135, 64, 1, 6, 100, 59, 223, 64, 17, 225, + }; + + sbp_msg_tracking_state_dep_a_t test_msg{}; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_states.value = 11; + + test_msg.states[0].cn0 = 11.230907440185547; + test_msg.states[0].prn = 0; + test_msg.states[0].state = 1; + + test_msg.states[1].cn0 = 10.438665390014648; + test_msg.states[1].prn = 2; + test_msg.states[1].state = 1; + + test_msg.states[2].cn0 = 9.732142448425293; + test_msg.states[2].prn = 3; + test_msg.states[2].state = 1; + + test_msg.states[3].cn0 = 14.341922760009766; + test_msg.states[3].prn = 7; + test_msg.states[3].state = 1; + + test_msg.states[4].cn0 = 7.8549017906188965; + test_msg.states[4].prn = 10; + test_msg.states[4].state = 1; + + test_msg.states[5].cn0 = 5.0982866287231445; + test_msg.states[5].prn = 13; + test_msg.states[5].state = 1; + + test_msg.states[6].cn0 = 6.741272926330566; + test_msg.states[6].prn = 22; + test_msg.states[6].state = 1; + + test_msg.states[7].cn0 = 12.700549125671387; + test_msg.states[7].prn = 30; + test_msg.states[7].state = 1; + + test_msg.states[8].cn0 = 15.893081665039062; + test_msg.states[8].prn = 31; + test_msg.states[8].state = 1; + + test_msg.states[9].cn0 = 4.242738723754883; + test_msg.states[9].prn = 25; + test_msg.states[9].state = 1; + + test_msg.states[10].cn0 = 6.97599983215332; + test_msg.states[10].prn = 6; + test_msg.states[10].state = 1; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_states.value, 11) + << "incorrect value for last_msg_.n_states.value, expected 11, is " + << last_msg_.n_states.value; + EXPECT_LT((last_msg_.states[0].cn0 * 100 - 11.2309074402 * 100), 0.05) + << "incorrect value for last_msg_.states[0].cn0, expected 11.2309074402, " + "is " + << last_msg_.states[0].cn0; + EXPECT_EQ(last_msg_.states[0].prn, 0) + << "incorrect value for last_msg_.states[0].prn, expected 0, is " + << last_msg_.states[0].prn; + EXPECT_EQ(last_msg_.states[0].state, 1) + << "incorrect value for last_msg_.states[0].state, expected 1, is " + << last_msg_.states[0].state; + EXPECT_LT((last_msg_.states[1].cn0 * 100 - 10.43866539 * 100), 0.05) + << "incorrect value for last_msg_.states[1].cn0, expected 10.43866539, " + "is " + << last_msg_.states[1].cn0; + EXPECT_EQ(last_msg_.states[1].prn, 2) + << "incorrect value for last_msg_.states[1].prn, expected 2, is " + << last_msg_.states[1].prn; + EXPECT_EQ(last_msg_.states[1].state, 1) + << "incorrect value for last_msg_.states[1].state, expected 1, is " + << last_msg_.states[1].state; + EXPECT_LT((last_msg_.states[2].cn0 * 100 - 9.73214244843 * 100), 0.05) + << "incorrect value for last_msg_.states[2].cn0, expected 9.73214244843, " + "is " + << last_msg_.states[2].cn0; + EXPECT_EQ(last_msg_.states[2].prn, 3) + << "incorrect value for last_msg_.states[2].prn, expected 3, is " + << last_msg_.states[2].prn; + EXPECT_EQ(last_msg_.states[2].state, 1) + << "incorrect value for last_msg_.states[2].state, expected 1, is " + << last_msg_.states[2].state; + EXPECT_LT((last_msg_.states[3].cn0 * 100 - 14.34192276 * 100), 0.05) + << "incorrect value for last_msg_.states[3].cn0, expected 14.34192276, " + "is " + << last_msg_.states[3].cn0; + EXPECT_EQ(last_msg_.states[3].prn, 7) + << "incorrect value for last_msg_.states[3].prn, expected 7, is " + << last_msg_.states[3].prn; + EXPECT_EQ(last_msg_.states[3].state, 1) + << "incorrect value for last_msg_.states[3].state, expected 1, is " + << last_msg_.states[3].state; + EXPECT_LT((last_msg_.states[4].cn0 * 100 - 7.85490179062 * 100), 0.05) + << "incorrect value for last_msg_.states[4].cn0, expected 7.85490179062, " + "is " + << last_msg_.states[4].cn0; + EXPECT_EQ(last_msg_.states[4].prn, 10) + << "incorrect value for last_msg_.states[4].prn, expected 10, is " + << last_msg_.states[4].prn; + EXPECT_EQ(last_msg_.states[4].state, 1) + << "incorrect value for last_msg_.states[4].state, expected 1, is " + << last_msg_.states[4].state; + EXPECT_LT((last_msg_.states[5].cn0 * 100 - 5.09828662872 * 100), 0.05) + << "incorrect value for last_msg_.states[5].cn0, expected 5.09828662872, " + "is " + << last_msg_.states[5].cn0; + EXPECT_EQ(last_msg_.states[5].prn, 13) + << "incorrect value for last_msg_.states[5].prn, expected 13, is " + << last_msg_.states[5].prn; + EXPECT_EQ(last_msg_.states[5].state, 1) + << "incorrect value for last_msg_.states[5].state, expected 1, is " + << last_msg_.states[5].state; + EXPECT_LT((last_msg_.states[6].cn0 * 100 - 6.74127292633 * 100), 0.05) + << "incorrect value for last_msg_.states[6].cn0, expected 6.74127292633, " + "is " + << last_msg_.states[6].cn0; + EXPECT_EQ(last_msg_.states[6].prn, 22) + << "incorrect value for last_msg_.states[6].prn, expected 22, is " + << last_msg_.states[6].prn; + EXPECT_EQ(last_msg_.states[6].state, 1) + << "incorrect value for last_msg_.states[6].state, expected 1, is " + << last_msg_.states[6].state; + EXPECT_LT((last_msg_.states[7].cn0 * 100 - 12.7005491257 * 100), 0.05) + << "incorrect value for last_msg_.states[7].cn0, expected 12.7005491257, " + "is " + << last_msg_.states[7].cn0; + EXPECT_EQ(last_msg_.states[7].prn, 30) + << "incorrect value for last_msg_.states[7].prn, expected 30, is " + << last_msg_.states[7].prn; + EXPECT_EQ(last_msg_.states[7].state, 1) + << "incorrect value for last_msg_.states[7].state, expected 1, is " + << last_msg_.states[7].state; + EXPECT_LT((last_msg_.states[8].cn0 * 100 - 15.893081665 * 100), 0.05) + << "incorrect value for last_msg_.states[8].cn0, expected 15.893081665, " + "is " + << last_msg_.states[8].cn0; + EXPECT_EQ(last_msg_.states[8].prn, 31) + << "incorrect value for last_msg_.states[8].prn, expected 31, is " + << last_msg_.states[8].prn; + EXPECT_EQ(last_msg_.states[8].state, 1) + << "incorrect value for last_msg_.states[8].state, expected 1, is " + << last_msg_.states[8].state; + EXPECT_LT((last_msg_.states[9].cn0 * 100 - 4.24273872375 * 100), 0.05) + << "incorrect value for last_msg_.states[9].cn0, expected 4.24273872375, " + "is " + << last_msg_.states[9].cn0; + EXPECT_EQ(last_msg_.states[9].prn, 25) + << "incorrect value for last_msg_.states[9].prn, expected 25, is " + << last_msg_.states[9].prn; + EXPECT_EQ(last_msg_.states[9].state, 1) + << "incorrect value for last_msg_.states[9].state, expected 1, is " + << last_msg_.states[9].state; + EXPECT_LT((last_msg_.states[10].cn0 * 100 - 6.97599983215 * 100), 0.05) + << "incorrect value for last_msg_.states[10].cn0, expected " + "6.97599983215, is " + << last_msg_.states[10].cn0; + EXPECT_EQ(last_msg_.states[10].prn, 6) + << "incorrect value for last_msg_.states[10].prn, expected 6, is " + << last_msg_.states[10].prn; + EXPECT_EQ(last_msg_.states[10].state, 1) + << "incorrect value for last_msg_.states[10].state, expected 1, is " + << last_msg_.states[10].state; } -class Test_auto_check_sbp_tracking_MsgtrackingStateDepA1 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgtrackingStateDepA1() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_tracking_MsgtrackingStateDepA1 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgtrackingStateDepA1() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_tracking_state_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -247,175 +335,267 @@ class Test_auto_check_sbp_tracking_MsgtrackingStateDepA1 : sbp_msg_tracking_state_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgtrackingStateDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,22,0,195,4,66,1,0,216,57,48,65,1,2,145,41,46,65,1,3,4,26,34,65,1,7,177,67,109,65,1,10,61,80,249,64,1,13,250,199,155,64,1,22,55,19,215,64,1,30,138,138,79,65,1,31,214,179,119,65,1,25,53,138,120,64,1,6,183,247,129,64,168,173, }; - - sbp_msg_tracking_state_dep_a_t test_msg{}; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_states.value = 11; - - test_msg.states[0].cn0 = 11.014122009277344; - test_msg.states[0].prn = 0; - test_msg.states[0].state = 1; - - test_msg.states[1].cn0 = 10.885148048400879; - test_msg.states[1].prn = 2; - test_msg.states[1].state = 1; - - test_msg.states[2].cn0 = 10.131351470947266; - test_msg.states[2].prn = 3; - test_msg.states[2].state = 1; - - test_msg.states[3].cn0 = 14.829026222229004; - test_msg.states[3].prn = 7; - test_msg.states[3].state = 1; - - test_msg.states[4].cn0 = 7.79104471206665; - test_msg.states[4].prn = 10; - test_msg.states[4].state = 1; - - test_msg.states[5].cn0 = 4.868161201477051; - test_msg.states[5].prn = 13; - test_msg.states[5].state = 1; - - test_msg.states[6].cn0 = 6.721095561981201; - test_msg.states[6].prn = 22; - test_msg.states[6].state = 1; - - test_msg.states[7].cn0 = 12.971323013305664; - test_msg.states[7].prn = 30; - test_msg.states[7].state = 1; - - test_msg.states[8].cn0 = 15.481405258178711; - test_msg.states[8].prn = 31; - test_msg.states[8].state = 1; - - test_msg.states[9].cn0 = 3.8834354877471924; - test_msg.states[9].prn = 25; - test_msg.states[9].state = 1; - - test_msg.states[10].cn0 = 4.061488628387451; - test_msg.states[10].prn = 6; - test_msg.states[10].state = 1; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_states.value, 11) << "incorrect value for last_msg_.n_states.value, expected 11, is " << last_msg_.n_states.value; - EXPECT_LT((last_msg_.states[0].cn0 * 100 - 11.0141220093 * 100), 0.05) << "incorrect value for last_msg_.states[0].cn0, expected 11.0141220093, is " << last_msg_.states[0].cn0; - EXPECT_EQ(last_msg_.states[0].prn, 0) << "incorrect value for last_msg_.states[0].prn, expected 0, is " << last_msg_.states[0].prn; - EXPECT_EQ(last_msg_.states[0].state, 1) << "incorrect value for last_msg_.states[0].state, expected 1, is " << last_msg_.states[0].state; - EXPECT_LT((last_msg_.states[1].cn0 * 100 - 10.8851480484 * 100), 0.05) << "incorrect value for last_msg_.states[1].cn0, expected 10.8851480484, is " << last_msg_.states[1].cn0; - EXPECT_EQ(last_msg_.states[1].prn, 2) << "incorrect value for last_msg_.states[1].prn, expected 2, is " << last_msg_.states[1].prn; - EXPECT_EQ(last_msg_.states[1].state, 1) << "incorrect value for last_msg_.states[1].state, expected 1, is " << last_msg_.states[1].state; - EXPECT_LT((last_msg_.states[2].cn0 * 100 - 10.1313514709 * 100), 0.05) << "incorrect value for last_msg_.states[2].cn0, expected 10.1313514709, is " << last_msg_.states[2].cn0; - EXPECT_EQ(last_msg_.states[2].prn, 3) << "incorrect value for last_msg_.states[2].prn, expected 3, is " << last_msg_.states[2].prn; - EXPECT_EQ(last_msg_.states[2].state, 1) << "incorrect value for last_msg_.states[2].state, expected 1, is " << last_msg_.states[2].state; - EXPECT_LT((last_msg_.states[3].cn0 * 100 - 14.8290262222 * 100), 0.05) << "incorrect value for last_msg_.states[3].cn0, expected 14.8290262222, is " << last_msg_.states[3].cn0; - EXPECT_EQ(last_msg_.states[3].prn, 7) << "incorrect value for last_msg_.states[3].prn, expected 7, is " << last_msg_.states[3].prn; - EXPECT_EQ(last_msg_.states[3].state, 1) << "incorrect value for last_msg_.states[3].state, expected 1, is " << last_msg_.states[3].state; - EXPECT_LT((last_msg_.states[4].cn0 * 100 - 7.79104471207 * 100), 0.05) << "incorrect value for last_msg_.states[4].cn0, expected 7.79104471207, is " << last_msg_.states[4].cn0; - EXPECT_EQ(last_msg_.states[4].prn, 10) << "incorrect value for last_msg_.states[4].prn, expected 10, is " << last_msg_.states[4].prn; - EXPECT_EQ(last_msg_.states[4].state, 1) << "incorrect value for last_msg_.states[4].state, expected 1, is " << last_msg_.states[4].state; - EXPECT_LT((last_msg_.states[5].cn0 * 100 - 4.86816120148 * 100), 0.05) << "incorrect value for last_msg_.states[5].cn0, expected 4.86816120148, is " << last_msg_.states[5].cn0; - EXPECT_EQ(last_msg_.states[5].prn, 13) << "incorrect value for last_msg_.states[5].prn, expected 13, is " << last_msg_.states[5].prn; - EXPECT_EQ(last_msg_.states[5].state, 1) << "incorrect value for last_msg_.states[5].state, expected 1, is " << last_msg_.states[5].state; - EXPECT_LT((last_msg_.states[6].cn0 * 100 - 6.72109556198 * 100), 0.05) << "incorrect value for last_msg_.states[6].cn0, expected 6.72109556198, is " << last_msg_.states[6].cn0; - EXPECT_EQ(last_msg_.states[6].prn, 22) << "incorrect value for last_msg_.states[6].prn, expected 22, is " << last_msg_.states[6].prn; - EXPECT_EQ(last_msg_.states[6].state, 1) << "incorrect value for last_msg_.states[6].state, expected 1, is " << last_msg_.states[6].state; - EXPECT_LT((last_msg_.states[7].cn0 * 100 - 12.9713230133 * 100), 0.05) << "incorrect value for last_msg_.states[7].cn0, expected 12.9713230133, is " << last_msg_.states[7].cn0; - EXPECT_EQ(last_msg_.states[7].prn, 30) << "incorrect value for last_msg_.states[7].prn, expected 30, is " << last_msg_.states[7].prn; - EXPECT_EQ(last_msg_.states[7].state, 1) << "incorrect value for last_msg_.states[7].state, expected 1, is " << last_msg_.states[7].state; - EXPECT_LT((last_msg_.states[8].cn0 * 100 - 15.4814052582 * 100), 0.05) << "incorrect value for last_msg_.states[8].cn0, expected 15.4814052582, is " << last_msg_.states[8].cn0; - EXPECT_EQ(last_msg_.states[8].prn, 31) << "incorrect value for last_msg_.states[8].prn, expected 31, is " << last_msg_.states[8].prn; - EXPECT_EQ(last_msg_.states[8].state, 1) << "incorrect value for last_msg_.states[8].state, expected 1, is " << last_msg_.states[8].state; - EXPECT_LT((last_msg_.states[9].cn0 * 100 - 3.88343548775 * 100), 0.05) << "incorrect value for last_msg_.states[9].cn0, expected 3.88343548775, is " << last_msg_.states[9].cn0; - EXPECT_EQ(last_msg_.states[9].prn, 25) << "incorrect value for last_msg_.states[9].prn, expected 25, is " << last_msg_.states[9].prn; - EXPECT_EQ(last_msg_.states[9].state, 1) << "incorrect value for last_msg_.states[9].state, expected 1, is " << last_msg_.states[9].state; - EXPECT_LT((last_msg_.states[10].cn0 * 100 - 4.06148862839 * 100), 0.05) << "incorrect value for last_msg_.states[10].cn0, expected 4.06148862839, is " << last_msg_.states[10].cn0; - EXPECT_EQ(last_msg_.states[10].prn, 6) << "incorrect value for last_msg_.states[10].prn, expected 6, is " << last_msg_.states[10].prn; - EXPECT_EQ(last_msg_.states[10].state, 1) << "incorrect value for last_msg_.states[10].state, expected 1, is " << last_msg_.states[10].state; +}; + +TEST_F(Test_auto_check_sbp_tracking_MsgtrackingStateDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 216, 57, 48, 65, 1, 2, 145, + 41, 46, 65, 1, 3, 4, 26, 34, 65, 1, 7, 177, 67, 109, 65, + 1, 10, 61, 80, 249, 64, 1, 13, 250, 199, 155, 64, 1, 22, 55, + 19, 215, 64, 1, 30, 138, 138, 79, 65, 1, 31, 214, 179, 119, 65, + 1, 25, 53, 138, 120, 64, 1, 6, 183, 247, 129, 64, 168, 173, + }; + + sbp_msg_tracking_state_dep_a_t test_msg{}; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_states.value = 11; + + test_msg.states[0].cn0 = 11.014122009277344; + test_msg.states[0].prn = 0; + test_msg.states[0].state = 1; + + test_msg.states[1].cn0 = 10.885148048400879; + test_msg.states[1].prn = 2; + test_msg.states[1].state = 1; + + test_msg.states[2].cn0 = 10.131351470947266; + test_msg.states[2].prn = 3; + test_msg.states[2].state = 1; + + test_msg.states[3].cn0 = 14.829026222229004; + test_msg.states[3].prn = 7; + test_msg.states[3].state = 1; + + test_msg.states[4].cn0 = 7.79104471206665; + test_msg.states[4].prn = 10; + test_msg.states[4].state = 1; + + test_msg.states[5].cn0 = 4.868161201477051; + test_msg.states[5].prn = 13; + test_msg.states[5].state = 1; + + test_msg.states[6].cn0 = 6.721095561981201; + test_msg.states[6].prn = 22; + test_msg.states[6].state = 1; + + test_msg.states[7].cn0 = 12.971323013305664; + test_msg.states[7].prn = 30; + test_msg.states[7].state = 1; + + test_msg.states[8].cn0 = 15.481405258178711; + test_msg.states[8].prn = 31; + test_msg.states[8].state = 1; + + test_msg.states[9].cn0 = 3.8834354877471924; + test_msg.states[9].prn = 25; + test_msg.states[9].state = 1; + + test_msg.states[10].cn0 = 4.061488628387451; + test_msg.states[10].prn = 6; + test_msg.states[10].state = 1; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_states.value, 11) + << "incorrect value for last_msg_.n_states.value, expected 11, is " + << last_msg_.n_states.value; + EXPECT_LT((last_msg_.states[0].cn0 * 100 - 11.0141220093 * 100), 0.05) + << "incorrect value for last_msg_.states[0].cn0, expected 11.0141220093, " + "is " + << last_msg_.states[0].cn0; + EXPECT_EQ(last_msg_.states[0].prn, 0) + << "incorrect value for last_msg_.states[0].prn, expected 0, is " + << last_msg_.states[0].prn; + EXPECT_EQ(last_msg_.states[0].state, 1) + << "incorrect value for last_msg_.states[0].state, expected 1, is " + << last_msg_.states[0].state; + EXPECT_LT((last_msg_.states[1].cn0 * 100 - 10.8851480484 * 100), 0.05) + << "incorrect value for last_msg_.states[1].cn0, expected 10.8851480484, " + "is " + << last_msg_.states[1].cn0; + EXPECT_EQ(last_msg_.states[1].prn, 2) + << "incorrect value for last_msg_.states[1].prn, expected 2, is " + << last_msg_.states[1].prn; + EXPECT_EQ(last_msg_.states[1].state, 1) + << "incorrect value for last_msg_.states[1].state, expected 1, is " + << last_msg_.states[1].state; + EXPECT_LT((last_msg_.states[2].cn0 * 100 - 10.1313514709 * 100), 0.05) + << "incorrect value for last_msg_.states[2].cn0, expected 10.1313514709, " + "is " + << last_msg_.states[2].cn0; + EXPECT_EQ(last_msg_.states[2].prn, 3) + << "incorrect value for last_msg_.states[2].prn, expected 3, is " + << last_msg_.states[2].prn; + EXPECT_EQ(last_msg_.states[2].state, 1) + << "incorrect value for last_msg_.states[2].state, expected 1, is " + << last_msg_.states[2].state; + EXPECT_LT((last_msg_.states[3].cn0 * 100 - 14.8290262222 * 100), 0.05) + << "incorrect value for last_msg_.states[3].cn0, expected 14.8290262222, " + "is " + << last_msg_.states[3].cn0; + EXPECT_EQ(last_msg_.states[3].prn, 7) + << "incorrect value for last_msg_.states[3].prn, expected 7, is " + << last_msg_.states[3].prn; + EXPECT_EQ(last_msg_.states[3].state, 1) + << "incorrect value for last_msg_.states[3].state, expected 1, is " + << last_msg_.states[3].state; + EXPECT_LT((last_msg_.states[4].cn0 * 100 - 7.79104471207 * 100), 0.05) + << "incorrect value for last_msg_.states[4].cn0, expected 7.79104471207, " + "is " + << last_msg_.states[4].cn0; + EXPECT_EQ(last_msg_.states[4].prn, 10) + << "incorrect value for last_msg_.states[4].prn, expected 10, is " + << last_msg_.states[4].prn; + EXPECT_EQ(last_msg_.states[4].state, 1) + << "incorrect value for last_msg_.states[4].state, expected 1, is " + << last_msg_.states[4].state; + EXPECT_LT((last_msg_.states[5].cn0 * 100 - 4.86816120148 * 100), 0.05) + << "incorrect value for last_msg_.states[5].cn0, expected 4.86816120148, " + "is " + << last_msg_.states[5].cn0; + EXPECT_EQ(last_msg_.states[5].prn, 13) + << "incorrect value for last_msg_.states[5].prn, expected 13, is " + << last_msg_.states[5].prn; + EXPECT_EQ(last_msg_.states[5].state, 1) + << "incorrect value for last_msg_.states[5].state, expected 1, is " + << last_msg_.states[5].state; + EXPECT_LT((last_msg_.states[6].cn0 * 100 - 6.72109556198 * 100), 0.05) + << "incorrect value for last_msg_.states[6].cn0, expected 6.72109556198, " + "is " + << last_msg_.states[6].cn0; + EXPECT_EQ(last_msg_.states[6].prn, 22) + << "incorrect value for last_msg_.states[6].prn, expected 22, is " + << last_msg_.states[6].prn; + EXPECT_EQ(last_msg_.states[6].state, 1) + << "incorrect value for last_msg_.states[6].state, expected 1, is " + << last_msg_.states[6].state; + EXPECT_LT((last_msg_.states[7].cn0 * 100 - 12.9713230133 * 100), 0.05) + << "incorrect value for last_msg_.states[7].cn0, expected 12.9713230133, " + "is " + << last_msg_.states[7].cn0; + EXPECT_EQ(last_msg_.states[7].prn, 30) + << "incorrect value for last_msg_.states[7].prn, expected 30, is " + << last_msg_.states[7].prn; + EXPECT_EQ(last_msg_.states[7].state, 1) + << "incorrect value for last_msg_.states[7].state, expected 1, is " + << last_msg_.states[7].state; + EXPECT_LT((last_msg_.states[8].cn0 * 100 - 15.4814052582 * 100), 0.05) + << "incorrect value for last_msg_.states[8].cn0, expected 15.4814052582, " + "is " + << last_msg_.states[8].cn0; + EXPECT_EQ(last_msg_.states[8].prn, 31) + << "incorrect value for last_msg_.states[8].prn, expected 31, is " + << last_msg_.states[8].prn; + EXPECT_EQ(last_msg_.states[8].state, 1) + << "incorrect value for last_msg_.states[8].state, expected 1, is " + << last_msg_.states[8].state; + EXPECT_LT((last_msg_.states[9].cn0 * 100 - 3.88343548775 * 100), 0.05) + << "incorrect value for last_msg_.states[9].cn0, expected 3.88343548775, " + "is " + << last_msg_.states[9].cn0; + EXPECT_EQ(last_msg_.states[9].prn, 25) + << "incorrect value for last_msg_.states[9].prn, expected 25, is " + << last_msg_.states[9].prn; + EXPECT_EQ(last_msg_.states[9].state, 1) + << "incorrect value for last_msg_.states[9].state, expected 1, is " + << last_msg_.states[9].state; + EXPECT_LT((last_msg_.states[10].cn0 * 100 - 4.06148862839 * 100), 0.05) + << "incorrect value for last_msg_.states[10].cn0, expected " + "4.06148862839, is " + << last_msg_.states[10].cn0; + EXPECT_EQ(last_msg_.states[10].prn, 6) + << "incorrect value for last_msg_.states[10].prn, expected 6, is " + << last_msg_.states[10].prn; + EXPECT_EQ(last_msg_.states[10].state, 1) + << "incorrect value for last_msg_.states[10].state, expected 1, is " + << last_msg_.states[10].state; } -class Test_auto_check_sbp_tracking_MsgtrackingStateDepA2 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgtrackingStateDepA2() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_tracking_MsgtrackingStateDepA2 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgtrackingStateDepA2() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_tracking_state_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -423,175 +603,267 @@ class Test_auto_check_sbp_tracking_MsgtrackingStateDepA2 : sbp_msg_tracking_state_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgtrackingStateDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,22,0,195,4,66,1,0,141,76,60,65,1,2,69,139,46,65,1,3,146,27,30,65,1,7,235,56,97,65,1,10,141,213,243,64,1,13,250,170,166,64,1,22,17,101,201,64,1,30,172,183,83,65,1,31,238,193,120,65,1,25,220,48,132,64,1,6,49,214,54,64,110,179, }; - - sbp_msg_tracking_state_dep_a_t test_msg{}; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_states.value = 11; - - test_msg.states[0].cn0 = 11.768689155578613; - test_msg.states[0].prn = 0; - test_msg.states[0].state = 1; - - test_msg.states[1].cn0 = 10.909001350402832; - test_msg.states[1].prn = 2; - test_msg.states[1].state = 1; - - test_msg.states[2].cn0 = 9.881731033325195; - test_msg.states[2].prn = 3; - test_msg.states[2].state = 1; - - test_msg.states[3].cn0 = 14.076395988464355; - test_msg.states[3].prn = 7; - test_msg.states[3].state = 1; - - test_msg.states[4].cn0 = 7.619818210601807; - test_msg.states[4].prn = 10; - test_msg.states[4].state = 1; - - test_msg.states[5].cn0 = 5.208371162414551; - test_msg.states[5].prn = 13; - test_msg.states[5].state = 1; - - test_msg.states[6].cn0 = 6.2935872077941895; - test_msg.states[6].prn = 22; - test_msg.states[6].state = 1; - - test_msg.states[7].cn0 = 13.232341766357422; - test_msg.states[7].prn = 30; - test_msg.states[7].state = 1; - - test_msg.states[8].cn0 = 15.547346115112305; - test_msg.states[8].prn = 31; - test_msg.states[8].state = 1; - - test_msg.states[9].cn0 = 4.130964279174805; - test_msg.states[9].prn = 25; - test_msg.states[9].state = 1; - - test_msg.states[10].cn0 = 2.856823205947876; - test_msg.states[10].prn = 6; - test_msg.states[10].state = 1; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_states.value, 11) << "incorrect value for last_msg_.n_states.value, expected 11, is " << last_msg_.n_states.value; - EXPECT_LT((last_msg_.states[0].cn0 * 100 - 11.7686891556 * 100), 0.05) << "incorrect value for last_msg_.states[0].cn0, expected 11.7686891556, is " << last_msg_.states[0].cn0; - EXPECT_EQ(last_msg_.states[0].prn, 0) << "incorrect value for last_msg_.states[0].prn, expected 0, is " << last_msg_.states[0].prn; - EXPECT_EQ(last_msg_.states[0].state, 1) << "incorrect value for last_msg_.states[0].state, expected 1, is " << last_msg_.states[0].state; - EXPECT_LT((last_msg_.states[1].cn0 * 100 - 10.9090013504 * 100), 0.05) << "incorrect value for last_msg_.states[1].cn0, expected 10.9090013504, is " << last_msg_.states[1].cn0; - EXPECT_EQ(last_msg_.states[1].prn, 2) << "incorrect value for last_msg_.states[1].prn, expected 2, is " << last_msg_.states[1].prn; - EXPECT_EQ(last_msg_.states[1].state, 1) << "incorrect value for last_msg_.states[1].state, expected 1, is " << last_msg_.states[1].state; - EXPECT_LT((last_msg_.states[2].cn0 * 100 - 9.88173103333 * 100), 0.05) << "incorrect value for last_msg_.states[2].cn0, expected 9.88173103333, is " << last_msg_.states[2].cn0; - EXPECT_EQ(last_msg_.states[2].prn, 3) << "incorrect value for last_msg_.states[2].prn, expected 3, is " << last_msg_.states[2].prn; - EXPECT_EQ(last_msg_.states[2].state, 1) << "incorrect value for last_msg_.states[2].state, expected 1, is " << last_msg_.states[2].state; - EXPECT_LT((last_msg_.states[3].cn0 * 100 - 14.0763959885 * 100), 0.05) << "incorrect value for last_msg_.states[3].cn0, expected 14.0763959885, is " << last_msg_.states[3].cn0; - EXPECT_EQ(last_msg_.states[3].prn, 7) << "incorrect value for last_msg_.states[3].prn, expected 7, is " << last_msg_.states[3].prn; - EXPECT_EQ(last_msg_.states[3].state, 1) << "incorrect value for last_msg_.states[3].state, expected 1, is " << last_msg_.states[3].state; - EXPECT_LT((last_msg_.states[4].cn0 * 100 - 7.6198182106 * 100), 0.05) << "incorrect value for last_msg_.states[4].cn0, expected 7.6198182106, is " << last_msg_.states[4].cn0; - EXPECT_EQ(last_msg_.states[4].prn, 10) << "incorrect value for last_msg_.states[4].prn, expected 10, is " << last_msg_.states[4].prn; - EXPECT_EQ(last_msg_.states[4].state, 1) << "incorrect value for last_msg_.states[4].state, expected 1, is " << last_msg_.states[4].state; - EXPECT_LT((last_msg_.states[5].cn0 * 100 - 5.20837116241 * 100), 0.05) << "incorrect value for last_msg_.states[5].cn0, expected 5.20837116241, is " << last_msg_.states[5].cn0; - EXPECT_EQ(last_msg_.states[5].prn, 13) << "incorrect value for last_msg_.states[5].prn, expected 13, is " << last_msg_.states[5].prn; - EXPECT_EQ(last_msg_.states[5].state, 1) << "incorrect value for last_msg_.states[5].state, expected 1, is " << last_msg_.states[5].state; - EXPECT_LT((last_msg_.states[6].cn0 * 100 - 6.29358720779 * 100), 0.05) << "incorrect value for last_msg_.states[6].cn0, expected 6.29358720779, is " << last_msg_.states[6].cn0; - EXPECT_EQ(last_msg_.states[6].prn, 22) << "incorrect value for last_msg_.states[6].prn, expected 22, is " << last_msg_.states[6].prn; - EXPECT_EQ(last_msg_.states[6].state, 1) << "incorrect value for last_msg_.states[6].state, expected 1, is " << last_msg_.states[6].state; - EXPECT_LT((last_msg_.states[7].cn0 * 100 - 13.2323417664 * 100), 0.05) << "incorrect value for last_msg_.states[7].cn0, expected 13.2323417664, is " << last_msg_.states[7].cn0; - EXPECT_EQ(last_msg_.states[7].prn, 30) << "incorrect value for last_msg_.states[7].prn, expected 30, is " << last_msg_.states[7].prn; - EXPECT_EQ(last_msg_.states[7].state, 1) << "incorrect value for last_msg_.states[7].state, expected 1, is " << last_msg_.states[7].state; - EXPECT_LT((last_msg_.states[8].cn0 * 100 - 15.5473461151 * 100), 0.05) << "incorrect value for last_msg_.states[8].cn0, expected 15.5473461151, is " << last_msg_.states[8].cn0; - EXPECT_EQ(last_msg_.states[8].prn, 31) << "incorrect value for last_msg_.states[8].prn, expected 31, is " << last_msg_.states[8].prn; - EXPECT_EQ(last_msg_.states[8].state, 1) << "incorrect value for last_msg_.states[8].state, expected 1, is " << last_msg_.states[8].state; - EXPECT_LT((last_msg_.states[9].cn0 * 100 - 4.13096427917 * 100), 0.05) << "incorrect value for last_msg_.states[9].cn0, expected 4.13096427917, is " << last_msg_.states[9].cn0; - EXPECT_EQ(last_msg_.states[9].prn, 25) << "incorrect value for last_msg_.states[9].prn, expected 25, is " << last_msg_.states[9].prn; - EXPECT_EQ(last_msg_.states[9].state, 1) << "incorrect value for last_msg_.states[9].state, expected 1, is " << last_msg_.states[9].state; - EXPECT_LT((last_msg_.states[10].cn0 * 100 - 2.85682320595 * 100), 0.05) << "incorrect value for last_msg_.states[10].cn0, expected 2.85682320595, is " << last_msg_.states[10].cn0; - EXPECT_EQ(last_msg_.states[10].prn, 6) << "incorrect value for last_msg_.states[10].prn, expected 6, is " << last_msg_.states[10].prn; - EXPECT_EQ(last_msg_.states[10].state, 1) << "incorrect value for last_msg_.states[10].state, expected 1, is " << last_msg_.states[10].state; +}; + +TEST_F(Test_auto_check_sbp_tracking_MsgtrackingStateDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 141, 76, 60, 65, 1, 2, 69, + 139, 46, 65, 1, 3, 146, 27, 30, 65, 1, 7, 235, 56, 97, 65, + 1, 10, 141, 213, 243, 64, 1, 13, 250, 170, 166, 64, 1, 22, 17, + 101, 201, 64, 1, 30, 172, 183, 83, 65, 1, 31, 238, 193, 120, 65, + 1, 25, 220, 48, 132, 64, 1, 6, 49, 214, 54, 64, 110, 179, + }; + + sbp_msg_tracking_state_dep_a_t test_msg{}; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_states.value = 11; + + test_msg.states[0].cn0 = 11.768689155578613; + test_msg.states[0].prn = 0; + test_msg.states[0].state = 1; + + test_msg.states[1].cn0 = 10.909001350402832; + test_msg.states[1].prn = 2; + test_msg.states[1].state = 1; + + test_msg.states[2].cn0 = 9.881731033325195; + test_msg.states[2].prn = 3; + test_msg.states[2].state = 1; + + test_msg.states[3].cn0 = 14.076395988464355; + test_msg.states[3].prn = 7; + test_msg.states[3].state = 1; + + test_msg.states[4].cn0 = 7.619818210601807; + test_msg.states[4].prn = 10; + test_msg.states[4].state = 1; + + test_msg.states[5].cn0 = 5.208371162414551; + test_msg.states[5].prn = 13; + test_msg.states[5].state = 1; + + test_msg.states[6].cn0 = 6.2935872077941895; + test_msg.states[6].prn = 22; + test_msg.states[6].state = 1; + + test_msg.states[7].cn0 = 13.232341766357422; + test_msg.states[7].prn = 30; + test_msg.states[7].state = 1; + + test_msg.states[8].cn0 = 15.547346115112305; + test_msg.states[8].prn = 31; + test_msg.states[8].state = 1; + + test_msg.states[9].cn0 = 4.130964279174805; + test_msg.states[9].prn = 25; + test_msg.states[9].state = 1; + + test_msg.states[10].cn0 = 2.856823205947876; + test_msg.states[10].prn = 6; + test_msg.states[10].state = 1; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_states.value, 11) + << "incorrect value for last_msg_.n_states.value, expected 11, is " + << last_msg_.n_states.value; + EXPECT_LT((last_msg_.states[0].cn0 * 100 - 11.7686891556 * 100), 0.05) + << "incorrect value for last_msg_.states[0].cn0, expected 11.7686891556, " + "is " + << last_msg_.states[0].cn0; + EXPECT_EQ(last_msg_.states[0].prn, 0) + << "incorrect value for last_msg_.states[0].prn, expected 0, is " + << last_msg_.states[0].prn; + EXPECT_EQ(last_msg_.states[0].state, 1) + << "incorrect value for last_msg_.states[0].state, expected 1, is " + << last_msg_.states[0].state; + EXPECT_LT((last_msg_.states[1].cn0 * 100 - 10.9090013504 * 100), 0.05) + << "incorrect value for last_msg_.states[1].cn0, expected 10.9090013504, " + "is " + << last_msg_.states[1].cn0; + EXPECT_EQ(last_msg_.states[1].prn, 2) + << "incorrect value for last_msg_.states[1].prn, expected 2, is " + << last_msg_.states[1].prn; + EXPECT_EQ(last_msg_.states[1].state, 1) + << "incorrect value for last_msg_.states[1].state, expected 1, is " + << last_msg_.states[1].state; + EXPECT_LT((last_msg_.states[2].cn0 * 100 - 9.88173103333 * 100), 0.05) + << "incorrect value for last_msg_.states[2].cn0, expected 9.88173103333, " + "is " + << last_msg_.states[2].cn0; + EXPECT_EQ(last_msg_.states[2].prn, 3) + << "incorrect value for last_msg_.states[2].prn, expected 3, is " + << last_msg_.states[2].prn; + EXPECT_EQ(last_msg_.states[2].state, 1) + << "incorrect value for last_msg_.states[2].state, expected 1, is " + << last_msg_.states[2].state; + EXPECT_LT((last_msg_.states[3].cn0 * 100 - 14.0763959885 * 100), 0.05) + << "incorrect value for last_msg_.states[3].cn0, expected 14.0763959885, " + "is " + << last_msg_.states[3].cn0; + EXPECT_EQ(last_msg_.states[3].prn, 7) + << "incorrect value for last_msg_.states[3].prn, expected 7, is " + << last_msg_.states[3].prn; + EXPECT_EQ(last_msg_.states[3].state, 1) + << "incorrect value for last_msg_.states[3].state, expected 1, is " + << last_msg_.states[3].state; + EXPECT_LT((last_msg_.states[4].cn0 * 100 - 7.6198182106 * 100), 0.05) + << "incorrect value for last_msg_.states[4].cn0, expected 7.6198182106, " + "is " + << last_msg_.states[4].cn0; + EXPECT_EQ(last_msg_.states[4].prn, 10) + << "incorrect value for last_msg_.states[4].prn, expected 10, is " + << last_msg_.states[4].prn; + EXPECT_EQ(last_msg_.states[4].state, 1) + << "incorrect value for last_msg_.states[4].state, expected 1, is " + << last_msg_.states[4].state; + EXPECT_LT((last_msg_.states[5].cn0 * 100 - 5.20837116241 * 100), 0.05) + << "incorrect value for last_msg_.states[5].cn0, expected 5.20837116241, " + "is " + << last_msg_.states[5].cn0; + EXPECT_EQ(last_msg_.states[5].prn, 13) + << "incorrect value for last_msg_.states[5].prn, expected 13, is " + << last_msg_.states[5].prn; + EXPECT_EQ(last_msg_.states[5].state, 1) + << "incorrect value for last_msg_.states[5].state, expected 1, is " + << last_msg_.states[5].state; + EXPECT_LT((last_msg_.states[6].cn0 * 100 - 6.29358720779 * 100), 0.05) + << "incorrect value for last_msg_.states[6].cn0, expected 6.29358720779, " + "is " + << last_msg_.states[6].cn0; + EXPECT_EQ(last_msg_.states[6].prn, 22) + << "incorrect value for last_msg_.states[6].prn, expected 22, is " + << last_msg_.states[6].prn; + EXPECT_EQ(last_msg_.states[6].state, 1) + << "incorrect value for last_msg_.states[6].state, expected 1, is " + << last_msg_.states[6].state; + EXPECT_LT((last_msg_.states[7].cn0 * 100 - 13.2323417664 * 100), 0.05) + << "incorrect value for last_msg_.states[7].cn0, expected 13.2323417664, " + "is " + << last_msg_.states[7].cn0; + EXPECT_EQ(last_msg_.states[7].prn, 30) + << "incorrect value for last_msg_.states[7].prn, expected 30, is " + << last_msg_.states[7].prn; + EXPECT_EQ(last_msg_.states[7].state, 1) + << "incorrect value for last_msg_.states[7].state, expected 1, is " + << last_msg_.states[7].state; + EXPECT_LT((last_msg_.states[8].cn0 * 100 - 15.5473461151 * 100), 0.05) + << "incorrect value for last_msg_.states[8].cn0, expected 15.5473461151, " + "is " + << last_msg_.states[8].cn0; + EXPECT_EQ(last_msg_.states[8].prn, 31) + << "incorrect value for last_msg_.states[8].prn, expected 31, is " + << last_msg_.states[8].prn; + EXPECT_EQ(last_msg_.states[8].state, 1) + << "incorrect value for last_msg_.states[8].state, expected 1, is " + << last_msg_.states[8].state; + EXPECT_LT((last_msg_.states[9].cn0 * 100 - 4.13096427917 * 100), 0.05) + << "incorrect value for last_msg_.states[9].cn0, expected 4.13096427917, " + "is " + << last_msg_.states[9].cn0; + EXPECT_EQ(last_msg_.states[9].prn, 25) + << "incorrect value for last_msg_.states[9].prn, expected 25, is " + << last_msg_.states[9].prn; + EXPECT_EQ(last_msg_.states[9].state, 1) + << "incorrect value for last_msg_.states[9].state, expected 1, is " + << last_msg_.states[9].state; + EXPECT_LT((last_msg_.states[10].cn0 * 100 - 2.85682320595 * 100), 0.05) + << "incorrect value for last_msg_.states[10].cn0, expected " + "2.85682320595, is " + << last_msg_.states[10].cn0; + EXPECT_EQ(last_msg_.states[10].prn, 6) + << "incorrect value for last_msg_.states[10].prn, expected 6, is " + << last_msg_.states[10].prn; + EXPECT_EQ(last_msg_.states[10].state, 1) + << "incorrect value for last_msg_.states[10].state, expected 1, is " + << last_msg_.states[10].state; } -class Test_auto_check_sbp_tracking_MsgtrackingStateDepA3 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgtrackingStateDepA3() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_tracking_MsgtrackingStateDepA3 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgtrackingStateDepA3() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_tracking_state_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -599,175 +871,257 @@ class Test_auto_check_sbp_tracking_MsgtrackingStateDepA3 : sbp_msg_tracking_state_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgtrackingStateDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,22,0,195,4,66,1,0,55,143,120,66,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,248,89, }; - - sbp_msg_tracking_state_dep_a_t test_msg{}; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_states.value = 11; - - test_msg.states[0].cn0 = 62.13985824584961; - test_msg.states[0].prn = 0; - test_msg.states[0].state = 1; - - test_msg.states[1].cn0 = -1.0; - test_msg.states[1].prn = 0; - test_msg.states[1].state = 0; - - test_msg.states[2].cn0 = -1.0; - test_msg.states[2].prn = 0; - test_msg.states[2].state = 0; - - test_msg.states[3].cn0 = -1.0; - test_msg.states[3].prn = 0; - test_msg.states[3].state = 0; - - test_msg.states[4].cn0 = -1.0; - test_msg.states[4].prn = 0; - test_msg.states[4].state = 0; - - test_msg.states[5].cn0 = -1.0; - test_msg.states[5].prn = 0; - test_msg.states[5].state = 0; - - test_msg.states[6].cn0 = -1.0; - test_msg.states[6].prn = 0; - test_msg.states[6].state = 0; - - test_msg.states[7].cn0 = -1.0; - test_msg.states[7].prn = 0; - test_msg.states[7].state = 0; - - test_msg.states[8].cn0 = -1.0; - test_msg.states[8].prn = 0; - test_msg.states[8].state = 0; - - test_msg.states[9].cn0 = -1.0; - test_msg.states[9].prn = 0; - test_msg.states[9].state = 0; - - test_msg.states[10].cn0 = -1.0; - test_msg.states[10].prn = 0; - test_msg.states[10].state = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_states.value, 11) << "incorrect value for last_msg_.n_states.value, expected 11, is " << last_msg_.n_states.value; - EXPECT_LT((last_msg_.states[0].cn0 * 100 - 62.1398582458 * 100), 0.05) << "incorrect value for last_msg_.states[0].cn0, expected 62.1398582458, is " << last_msg_.states[0].cn0; - EXPECT_EQ(last_msg_.states[0].prn, 0) << "incorrect value for last_msg_.states[0].prn, expected 0, is " << last_msg_.states[0].prn; - EXPECT_EQ(last_msg_.states[0].state, 1) << "incorrect value for last_msg_.states[0].state, expected 1, is " << last_msg_.states[0].state; - EXPECT_LT((last_msg_.states[1].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[1].cn0, expected -1.0, is " << last_msg_.states[1].cn0; - EXPECT_EQ(last_msg_.states[1].prn, 0) << "incorrect value for last_msg_.states[1].prn, expected 0, is " << last_msg_.states[1].prn; - EXPECT_EQ(last_msg_.states[1].state, 0) << "incorrect value for last_msg_.states[1].state, expected 0, is " << last_msg_.states[1].state; - EXPECT_LT((last_msg_.states[2].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[2].cn0, expected -1.0, is " << last_msg_.states[2].cn0; - EXPECT_EQ(last_msg_.states[2].prn, 0) << "incorrect value for last_msg_.states[2].prn, expected 0, is " << last_msg_.states[2].prn; - EXPECT_EQ(last_msg_.states[2].state, 0) << "incorrect value for last_msg_.states[2].state, expected 0, is " << last_msg_.states[2].state; - EXPECT_LT((last_msg_.states[3].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[3].cn0, expected -1.0, is " << last_msg_.states[3].cn0; - EXPECT_EQ(last_msg_.states[3].prn, 0) << "incorrect value for last_msg_.states[3].prn, expected 0, is " << last_msg_.states[3].prn; - EXPECT_EQ(last_msg_.states[3].state, 0) << "incorrect value for last_msg_.states[3].state, expected 0, is " << last_msg_.states[3].state; - EXPECT_LT((last_msg_.states[4].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[4].cn0, expected -1.0, is " << last_msg_.states[4].cn0; - EXPECT_EQ(last_msg_.states[4].prn, 0) << "incorrect value for last_msg_.states[4].prn, expected 0, is " << last_msg_.states[4].prn; - EXPECT_EQ(last_msg_.states[4].state, 0) << "incorrect value for last_msg_.states[4].state, expected 0, is " << last_msg_.states[4].state; - EXPECT_LT((last_msg_.states[5].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[5].cn0, expected -1.0, is " << last_msg_.states[5].cn0; - EXPECT_EQ(last_msg_.states[5].prn, 0) << "incorrect value for last_msg_.states[5].prn, expected 0, is " << last_msg_.states[5].prn; - EXPECT_EQ(last_msg_.states[5].state, 0) << "incorrect value for last_msg_.states[5].state, expected 0, is " << last_msg_.states[5].state; - EXPECT_LT((last_msg_.states[6].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[6].cn0, expected -1.0, is " << last_msg_.states[6].cn0; - EXPECT_EQ(last_msg_.states[6].prn, 0) << "incorrect value for last_msg_.states[6].prn, expected 0, is " << last_msg_.states[6].prn; - EXPECT_EQ(last_msg_.states[6].state, 0) << "incorrect value for last_msg_.states[6].state, expected 0, is " << last_msg_.states[6].state; - EXPECT_LT((last_msg_.states[7].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[7].cn0, expected -1.0, is " << last_msg_.states[7].cn0; - EXPECT_EQ(last_msg_.states[7].prn, 0) << "incorrect value for last_msg_.states[7].prn, expected 0, is " << last_msg_.states[7].prn; - EXPECT_EQ(last_msg_.states[7].state, 0) << "incorrect value for last_msg_.states[7].state, expected 0, is " << last_msg_.states[7].state; - EXPECT_LT((last_msg_.states[8].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[8].cn0, expected -1.0, is " << last_msg_.states[8].cn0; - EXPECT_EQ(last_msg_.states[8].prn, 0) << "incorrect value for last_msg_.states[8].prn, expected 0, is " << last_msg_.states[8].prn; - EXPECT_EQ(last_msg_.states[8].state, 0) << "incorrect value for last_msg_.states[8].state, expected 0, is " << last_msg_.states[8].state; - EXPECT_LT((last_msg_.states[9].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[9].cn0, expected -1.0, is " << last_msg_.states[9].cn0; - EXPECT_EQ(last_msg_.states[9].prn, 0) << "incorrect value for last_msg_.states[9].prn, expected 0, is " << last_msg_.states[9].prn; - EXPECT_EQ(last_msg_.states[9].state, 0) << "incorrect value for last_msg_.states[9].state, expected 0, is " << last_msg_.states[9].state; - EXPECT_LT((last_msg_.states[10].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[10].cn0, expected -1.0, is " << last_msg_.states[10].cn0; - EXPECT_EQ(last_msg_.states[10].prn, 0) << "incorrect value for last_msg_.states[10].prn, expected 0, is " << last_msg_.states[10].prn; - EXPECT_EQ(last_msg_.states[10].state, 0) << "incorrect value for last_msg_.states[10].state, expected 0, is " << last_msg_.states[10].state; +}; + +TEST_F(Test_auto_check_sbp_tracking_MsgtrackingStateDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 55, 143, 120, 66, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 248, 89, + }; + + sbp_msg_tracking_state_dep_a_t test_msg{}; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_states.value = 11; + + test_msg.states[0].cn0 = 62.13985824584961; + test_msg.states[0].prn = 0; + test_msg.states[0].state = 1; + + test_msg.states[1].cn0 = -1.0; + test_msg.states[1].prn = 0; + test_msg.states[1].state = 0; + + test_msg.states[2].cn0 = -1.0; + test_msg.states[2].prn = 0; + test_msg.states[2].state = 0; + + test_msg.states[3].cn0 = -1.0; + test_msg.states[3].prn = 0; + test_msg.states[3].state = 0; + + test_msg.states[4].cn0 = -1.0; + test_msg.states[4].prn = 0; + test_msg.states[4].state = 0; + + test_msg.states[5].cn0 = -1.0; + test_msg.states[5].prn = 0; + test_msg.states[5].state = 0; + + test_msg.states[6].cn0 = -1.0; + test_msg.states[6].prn = 0; + test_msg.states[6].state = 0; + + test_msg.states[7].cn0 = -1.0; + test_msg.states[7].prn = 0; + test_msg.states[7].state = 0; + + test_msg.states[8].cn0 = -1.0; + test_msg.states[8].prn = 0; + test_msg.states[8].state = 0; + + test_msg.states[9].cn0 = -1.0; + test_msg.states[9].prn = 0; + test_msg.states[9].state = 0; + + test_msg.states[10].cn0 = -1.0; + test_msg.states[10].prn = 0; + test_msg.states[10].state = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_states.value, 11) + << "incorrect value for last_msg_.n_states.value, expected 11, is " + << last_msg_.n_states.value; + EXPECT_LT((last_msg_.states[0].cn0 * 100 - 62.1398582458 * 100), 0.05) + << "incorrect value for last_msg_.states[0].cn0, expected 62.1398582458, " + "is " + << last_msg_.states[0].cn0; + EXPECT_EQ(last_msg_.states[0].prn, 0) + << "incorrect value for last_msg_.states[0].prn, expected 0, is " + << last_msg_.states[0].prn; + EXPECT_EQ(last_msg_.states[0].state, 1) + << "incorrect value for last_msg_.states[0].state, expected 1, is " + << last_msg_.states[0].state; + EXPECT_LT((last_msg_.states[1].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[1].cn0, expected -1.0, is " + << last_msg_.states[1].cn0; + EXPECT_EQ(last_msg_.states[1].prn, 0) + << "incorrect value for last_msg_.states[1].prn, expected 0, is " + << last_msg_.states[1].prn; + EXPECT_EQ(last_msg_.states[1].state, 0) + << "incorrect value for last_msg_.states[1].state, expected 0, is " + << last_msg_.states[1].state; + EXPECT_LT((last_msg_.states[2].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[2].cn0, expected -1.0, is " + << last_msg_.states[2].cn0; + EXPECT_EQ(last_msg_.states[2].prn, 0) + << "incorrect value for last_msg_.states[2].prn, expected 0, is " + << last_msg_.states[2].prn; + EXPECT_EQ(last_msg_.states[2].state, 0) + << "incorrect value for last_msg_.states[2].state, expected 0, is " + << last_msg_.states[2].state; + EXPECT_LT((last_msg_.states[3].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[3].cn0, expected -1.0, is " + << last_msg_.states[3].cn0; + EXPECT_EQ(last_msg_.states[3].prn, 0) + << "incorrect value for last_msg_.states[3].prn, expected 0, is " + << last_msg_.states[3].prn; + EXPECT_EQ(last_msg_.states[3].state, 0) + << "incorrect value for last_msg_.states[3].state, expected 0, is " + << last_msg_.states[3].state; + EXPECT_LT((last_msg_.states[4].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[4].cn0, expected -1.0, is " + << last_msg_.states[4].cn0; + EXPECT_EQ(last_msg_.states[4].prn, 0) + << "incorrect value for last_msg_.states[4].prn, expected 0, is " + << last_msg_.states[4].prn; + EXPECT_EQ(last_msg_.states[4].state, 0) + << "incorrect value for last_msg_.states[4].state, expected 0, is " + << last_msg_.states[4].state; + EXPECT_LT((last_msg_.states[5].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[5].cn0, expected -1.0, is " + << last_msg_.states[5].cn0; + EXPECT_EQ(last_msg_.states[5].prn, 0) + << "incorrect value for last_msg_.states[5].prn, expected 0, is " + << last_msg_.states[5].prn; + EXPECT_EQ(last_msg_.states[5].state, 0) + << "incorrect value for last_msg_.states[5].state, expected 0, is " + << last_msg_.states[5].state; + EXPECT_LT((last_msg_.states[6].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[6].cn0, expected -1.0, is " + << last_msg_.states[6].cn0; + EXPECT_EQ(last_msg_.states[6].prn, 0) + << "incorrect value for last_msg_.states[6].prn, expected 0, is " + << last_msg_.states[6].prn; + EXPECT_EQ(last_msg_.states[6].state, 0) + << "incorrect value for last_msg_.states[6].state, expected 0, is " + << last_msg_.states[6].state; + EXPECT_LT((last_msg_.states[7].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[7].cn0, expected -1.0, is " + << last_msg_.states[7].cn0; + EXPECT_EQ(last_msg_.states[7].prn, 0) + << "incorrect value for last_msg_.states[7].prn, expected 0, is " + << last_msg_.states[7].prn; + EXPECT_EQ(last_msg_.states[7].state, 0) + << "incorrect value for last_msg_.states[7].state, expected 0, is " + << last_msg_.states[7].state; + EXPECT_LT((last_msg_.states[8].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[8].cn0, expected -1.0, is " + << last_msg_.states[8].cn0; + EXPECT_EQ(last_msg_.states[8].prn, 0) + << "incorrect value for last_msg_.states[8].prn, expected 0, is " + << last_msg_.states[8].prn; + EXPECT_EQ(last_msg_.states[8].state, 0) + << "incorrect value for last_msg_.states[8].state, expected 0, is " + << last_msg_.states[8].state; + EXPECT_LT((last_msg_.states[9].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[9].cn0, expected -1.0, is " + << last_msg_.states[9].cn0; + EXPECT_EQ(last_msg_.states[9].prn, 0) + << "incorrect value for last_msg_.states[9].prn, expected 0, is " + << last_msg_.states[9].prn; + EXPECT_EQ(last_msg_.states[9].state, 0) + << "incorrect value for last_msg_.states[9].state, expected 0, is " + << last_msg_.states[9].state; + EXPECT_LT((last_msg_.states[10].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[10].cn0, expected -1.0, is " + << last_msg_.states[10].cn0; + EXPECT_EQ(last_msg_.states[10].prn, 0) + << "incorrect value for last_msg_.states[10].prn, expected 0, is " + << last_msg_.states[10].prn; + EXPECT_EQ(last_msg_.states[10].state, 0) + << "incorrect value for last_msg_.states[10].state, expected 0, is " + << last_msg_.states[10].state; } -class Test_auto_check_sbp_tracking_MsgtrackingStateDepA4 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgtrackingStateDepA4() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_tracking_MsgtrackingStateDepA4 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgtrackingStateDepA4() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_tracking_state_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -775,175 +1129,259 @@ class Test_auto_check_sbp_tracking_MsgtrackingStateDepA4 : sbp_msg_tracking_state_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgtrackingStateDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,22,0,195,4,66,1,0,218,14,19,66,1,2,210,3,21,65,1,3,234,214,134,65,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,84,101, }; - - sbp_msg_tracking_state_dep_a_t test_msg{}; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_states.value = 11; - - test_msg.states[0].cn0 = 36.764503479003906; - test_msg.states[0].prn = 0; - test_msg.states[0].state = 1; - - test_msg.states[1].cn0 = 9.313432693481445; - test_msg.states[1].prn = 2; - test_msg.states[1].state = 1; - - test_msg.states[2].cn0 = 16.854938507080078; - test_msg.states[2].prn = 3; - test_msg.states[2].state = 1; - - test_msg.states[3].cn0 = -1.0; - test_msg.states[3].prn = 0; - test_msg.states[3].state = 0; - - test_msg.states[4].cn0 = -1.0; - test_msg.states[4].prn = 0; - test_msg.states[4].state = 0; - - test_msg.states[5].cn0 = -1.0; - test_msg.states[5].prn = 0; - test_msg.states[5].state = 0; - - test_msg.states[6].cn0 = -1.0; - test_msg.states[6].prn = 0; - test_msg.states[6].state = 0; - - test_msg.states[7].cn0 = -1.0; - test_msg.states[7].prn = 0; - test_msg.states[7].state = 0; - - test_msg.states[8].cn0 = -1.0; - test_msg.states[8].prn = 0; - test_msg.states[8].state = 0; - - test_msg.states[9].cn0 = -1.0; - test_msg.states[9].prn = 0; - test_msg.states[9].state = 0; - - test_msg.states[10].cn0 = -1.0; - test_msg.states[10].prn = 0; - test_msg.states[10].state = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_states.value, 11) << "incorrect value for last_msg_.n_states.value, expected 11, is " << last_msg_.n_states.value; - EXPECT_LT((last_msg_.states[0].cn0 * 100 - 36.764503479 * 100), 0.05) << "incorrect value for last_msg_.states[0].cn0, expected 36.764503479, is " << last_msg_.states[0].cn0; - EXPECT_EQ(last_msg_.states[0].prn, 0) << "incorrect value for last_msg_.states[0].prn, expected 0, is " << last_msg_.states[0].prn; - EXPECT_EQ(last_msg_.states[0].state, 1) << "incorrect value for last_msg_.states[0].state, expected 1, is " << last_msg_.states[0].state; - EXPECT_LT((last_msg_.states[1].cn0 * 100 - 9.31343269348 * 100), 0.05) << "incorrect value for last_msg_.states[1].cn0, expected 9.31343269348, is " << last_msg_.states[1].cn0; - EXPECT_EQ(last_msg_.states[1].prn, 2) << "incorrect value for last_msg_.states[1].prn, expected 2, is " << last_msg_.states[1].prn; - EXPECT_EQ(last_msg_.states[1].state, 1) << "incorrect value for last_msg_.states[1].state, expected 1, is " << last_msg_.states[1].state; - EXPECT_LT((last_msg_.states[2].cn0 * 100 - 16.8549385071 * 100), 0.05) << "incorrect value for last_msg_.states[2].cn0, expected 16.8549385071, is " << last_msg_.states[2].cn0; - EXPECT_EQ(last_msg_.states[2].prn, 3) << "incorrect value for last_msg_.states[2].prn, expected 3, is " << last_msg_.states[2].prn; - EXPECT_EQ(last_msg_.states[2].state, 1) << "incorrect value for last_msg_.states[2].state, expected 1, is " << last_msg_.states[2].state; - EXPECT_LT((last_msg_.states[3].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[3].cn0, expected -1.0, is " << last_msg_.states[3].cn0; - EXPECT_EQ(last_msg_.states[3].prn, 0) << "incorrect value for last_msg_.states[3].prn, expected 0, is " << last_msg_.states[3].prn; - EXPECT_EQ(last_msg_.states[3].state, 0) << "incorrect value for last_msg_.states[3].state, expected 0, is " << last_msg_.states[3].state; - EXPECT_LT((last_msg_.states[4].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[4].cn0, expected -1.0, is " << last_msg_.states[4].cn0; - EXPECT_EQ(last_msg_.states[4].prn, 0) << "incorrect value for last_msg_.states[4].prn, expected 0, is " << last_msg_.states[4].prn; - EXPECT_EQ(last_msg_.states[4].state, 0) << "incorrect value for last_msg_.states[4].state, expected 0, is " << last_msg_.states[4].state; - EXPECT_LT((last_msg_.states[5].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[5].cn0, expected -1.0, is " << last_msg_.states[5].cn0; - EXPECT_EQ(last_msg_.states[5].prn, 0) << "incorrect value for last_msg_.states[5].prn, expected 0, is " << last_msg_.states[5].prn; - EXPECT_EQ(last_msg_.states[5].state, 0) << "incorrect value for last_msg_.states[5].state, expected 0, is " << last_msg_.states[5].state; - EXPECT_LT((last_msg_.states[6].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[6].cn0, expected -1.0, is " << last_msg_.states[6].cn0; - EXPECT_EQ(last_msg_.states[6].prn, 0) << "incorrect value for last_msg_.states[6].prn, expected 0, is " << last_msg_.states[6].prn; - EXPECT_EQ(last_msg_.states[6].state, 0) << "incorrect value for last_msg_.states[6].state, expected 0, is " << last_msg_.states[6].state; - EXPECT_LT((last_msg_.states[7].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[7].cn0, expected -1.0, is " << last_msg_.states[7].cn0; - EXPECT_EQ(last_msg_.states[7].prn, 0) << "incorrect value for last_msg_.states[7].prn, expected 0, is " << last_msg_.states[7].prn; - EXPECT_EQ(last_msg_.states[7].state, 0) << "incorrect value for last_msg_.states[7].state, expected 0, is " << last_msg_.states[7].state; - EXPECT_LT((last_msg_.states[8].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[8].cn0, expected -1.0, is " << last_msg_.states[8].cn0; - EXPECT_EQ(last_msg_.states[8].prn, 0) << "incorrect value for last_msg_.states[8].prn, expected 0, is " << last_msg_.states[8].prn; - EXPECT_EQ(last_msg_.states[8].state, 0) << "incorrect value for last_msg_.states[8].state, expected 0, is " << last_msg_.states[8].state; - EXPECT_LT((last_msg_.states[9].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[9].cn0, expected -1.0, is " << last_msg_.states[9].cn0; - EXPECT_EQ(last_msg_.states[9].prn, 0) << "incorrect value for last_msg_.states[9].prn, expected 0, is " << last_msg_.states[9].prn; - EXPECT_EQ(last_msg_.states[9].state, 0) << "incorrect value for last_msg_.states[9].state, expected 0, is " << last_msg_.states[9].state; - EXPECT_LT((last_msg_.states[10].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[10].cn0, expected -1.0, is " << last_msg_.states[10].cn0; - EXPECT_EQ(last_msg_.states[10].prn, 0) << "incorrect value for last_msg_.states[10].prn, expected 0, is " << last_msg_.states[10].prn; - EXPECT_EQ(last_msg_.states[10].state, 0) << "incorrect value for last_msg_.states[10].state, expected 0, is " << last_msg_.states[10].state; +}; + +TEST_F(Test_auto_check_sbp_tracking_MsgtrackingStateDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 218, 14, 19, 66, 1, 2, 210, + 3, 21, 65, 1, 3, 234, 214, 134, 65, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 84, 101, + }; + + sbp_msg_tracking_state_dep_a_t test_msg{}; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_states.value = 11; + + test_msg.states[0].cn0 = 36.764503479003906; + test_msg.states[0].prn = 0; + test_msg.states[0].state = 1; + + test_msg.states[1].cn0 = 9.313432693481445; + test_msg.states[1].prn = 2; + test_msg.states[1].state = 1; + + test_msg.states[2].cn0 = 16.854938507080078; + test_msg.states[2].prn = 3; + test_msg.states[2].state = 1; + + test_msg.states[3].cn0 = -1.0; + test_msg.states[3].prn = 0; + test_msg.states[3].state = 0; + + test_msg.states[4].cn0 = -1.0; + test_msg.states[4].prn = 0; + test_msg.states[4].state = 0; + + test_msg.states[5].cn0 = -1.0; + test_msg.states[5].prn = 0; + test_msg.states[5].state = 0; + + test_msg.states[6].cn0 = -1.0; + test_msg.states[6].prn = 0; + test_msg.states[6].state = 0; + + test_msg.states[7].cn0 = -1.0; + test_msg.states[7].prn = 0; + test_msg.states[7].state = 0; + + test_msg.states[8].cn0 = -1.0; + test_msg.states[8].prn = 0; + test_msg.states[8].state = 0; + + test_msg.states[9].cn0 = -1.0; + test_msg.states[9].prn = 0; + test_msg.states[9].state = 0; + + test_msg.states[10].cn0 = -1.0; + test_msg.states[10].prn = 0; + test_msg.states[10].state = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_states.value, 11) + << "incorrect value for last_msg_.n_states.value, expected 11, is " + << last_msg_.n_states.value; + EXPECT_LT((last_msg_.states[0].cn0 * 100 - 36.764503479 * 100), 0.05) + << "incorrect value for last_msg_.states[0].cn0, expected 36.764503479, " + "is " + << last_msg_.states[0].cn0; + EXPECT_EQ(last_msg_.states[0].prn, 0) + << "incorrect value for last_msg_.states[0].prn, expected 0, is " + << last_msg_.states[0].prn; + EXPECT_EQ(last_msg_.states[0].state, 1) + << "incorrect value for last_msg_.states[0].state, expected 1, is " + << last_msg_.states[0].state; + EXPECT_LT((last_msg_.states[1].cn0 * 100 - 9.31343269348 * 100), 0.05) + << "incorrect value for last_msg_.states[1].cn0, expected 9.31343269348, " + "is " + << last_msg_.states[1].cn0; + EXPECT_EQ(last_msg_.states[1].prn, 2) + << "incorrect value for last_msg_.states[1].prn, expected 2, is " + << last_msg_.states[1].prn; + EXPECT_EQ(last_msg_.states[1].state, 1) + << "incorrect value for last_msg_.states[1].state, expected 1, is " + << last_msg_.states[1].state; + EXPECT_LT((last_msg_.states[2].cn0 * 100 - 16.8549385071 * 100), 0.05) + << "incorrect value for last_msg_.states[2].cn0, expected 16.8549385071, " + "is " + << last_msg_.states[2].cn0; + EXPECT_EQ(last_msg_.states[2].prn, 3) + << "incorrect value for last_msg_.states[2].prn, expected 3, is " + << last_msg_.states[2].prn; + EXPECT_EQ(last_msg_.states[2].state, 1) + << "incorrect value for last_msg_.states[2].state, expected 1, is " + << last_msg_.states[2].state; + EXPECT_LT((last_msg_.states[3].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[3].cn0, expected -1.0, is " + << last_msg_.states[3].cn0; + EXPECT_EQ(last_msg_.states[3].prn, 0) + << "incorrect value for last_msg_.states[3].prn, expected 0, is " + << last_msg_.states[3].prn; + EXPECT_EQ(last_msg_.states[3].state, 0) + << "incorrect value for last_msg_.states[3].state, expected 0, is " + << last_msg_.states[3].state; + EXPECT_LT((last_msg_.states[4].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[4].cn0, expected -1.0, is " + << last_msg_.states[4].cn0; + EXPECT_EQ(last_msg_.states[4].prn, 0) + << "incorrect value for last_msg_.states[4].prn, expected 0, is " + << last_msg_.states[4].prn; + EXPECT_EQ(last_msg_.states[4].state, 0) + << "incorrect value for last_msg_.states[4].state, expected 0, is " + << last_msg_.states[4].state; + EXPECT_LT((last_msg_.states[5].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[5].cn0, expected -1.0, is " + << last_msg_.states[5].cn0; + EXPECT_EQ(last_msg_.states[5].prn, 0) + << "incorrect value for last_msg_.states[5].prn, expected 0, is " + << last_msg_.states[5].prn; + EXPECT_EQ(last_msg_.states[5].state, 0) + << "incorrect value for last_msg_.states[5].state, expected 0, is " + << last_msg_.states[5].state; + EXPECT_LT((last_msg_.states[6].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[6].cn0, expected -1.0, is " + << last_msg_.states[6].cn0; + EXPECT_EQ(last_msg_.states[6].prn, 0) + << "incorrect value for last_msg_.states[6].prn, expected 0, is " + << last_msg_.states[6].prn; + EXPECT_EQ(last_msg_.states[6].state, 0) + << "incorrect value for last_msg_.states[6].state, expected 0, is " + << last_msg_.states[6].state; + EXPECT_LT((last_msg_.states[7].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[7].cn0, expected -1.0, is " + << last_msg_.states[7].cn0; + EXPECT_EQ(last_msg_.states[7].prn, 0) + << "incorrect value for last_msg_.states[7].prn, expected 0, is " + << last_msg_.states[7].prn; + EXPECT_EQ(last_msg_.states[7].state, 0) + << "incorrect value for last_msg_.states[7].state, expected 0, is " + << last_msg_.states[7].state; + EXPECT_LT((last_msg_.states[8].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[8].cn0, expected -1.0, is " + << last_msg_.states[8].cn0; + EXPECT_EQ(last_msg_.states[8].prn, 0) + << "incorrect value for last_msg_.states[8].prn, expected 0, is " + << last_msg_.states[8].prn; + EXPECT_EQ(last_msg_.states[8].state, 0) + << "incorrect value for last_msg_.states[8].state, expected 0, is " + << last_msg_.states[8].state; + EXPECT_LT((last_msg_.states[9].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[9].cn0, expected -1.0, is " + << last_msg_.states[9].cn0; + EXPECT_EQ(last_msg_.states[9].prn, 0) + << "incorrect value for last_msg_.states[9].prn, expected 0, is " + << last_msg_.states[9].prn; + EXPECT_EQ(last_msg_.states[9].state, 0) + << "incorrect value for last_msg_.states[9].state, expected 0, is " + << last_msg_.states[9].state; + EXPECT_LT((last_msg_.states[10].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[10].cn0, expected -1.0, is " + << last_msg_.states[10].cn0; + EXPECT_EQ(last_msg_.states[10].prn, 0) + << "incorrect value for last_msg_.states[10].prn, expected 0, is " + << last_msg_.states[10].prn; + EXPECT_EQ(last_msg_.states[10].state, 0) + << "incorrect value for last_msg_.states[10].state, expected 0, is " + << last_msg_.states[10].state; } -class Test_auto_check_sbp_tracking_MsgtrackingStateDepA5 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_tracking_MsgtrackingStateDepA5() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +class Test_auto_check_sbp_tracking_MsgtrackingStateDepA5 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_tracking_MsgtrackingStateDepA5() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_tracking_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_tracking_state_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -951,125 +1389,214 @@ class Test_auto_check_sbp_tracking_MsgtrackingStateDepA5 : sbp_msg_tracking_state_dep_a_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_tracking_MsgtrackingStateDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,22,0,195,4,66,1,0,98,39,219,65,1,2,0,0,56,64,1,3,121,123,7,65,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,37,123, }; - - sbp_msg_tracking_state_dep_a_t test_msg{}; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_states.value = 11; - - test_msg.states[0].cn0 = 27.394229888916016; - test_msg.states[0].prn = 0; - test_msg.states[0].state = 1; - - test_msg.states[1].cn0 = 2.875; - test_msg.states[1].prn = 2; - test_msg.states[1].state = 1; - - test_msg.states[2].cn0 = 8.467644691467285; - test_msg.states[2].prn = 3; - test_msg.states[2].state = 1; - - test_msg.states[3].cn0 = -1.0; - test_msg.states[3].prn = 0; - test_msg.states[3].state = 0; - - test_msg.states[4].cn0 = -1.0; - test_msg.states[4].prn = 0; - test_msg.states[4].state = 0; - - test_msg.states[5].cn0 = -1.0; - test_msg.states[5].prn = 0; - test_msg.states[5].state = 0; - - test_msg.states[6].cn0 = -1.0; - test_msg.states[6].prn = 0; - test_msg.states[6].state = 0; - - test_msg.states[7].cn0 = -1.0; - test_msg.states[7].prn = 0; - test_msg.states[7].state = 0; - - test_msg.states[8].cn0 = -1.0; - test_msg.states[8].prn = 0; - test_msg.states[8].state = 0; - - test_msg.states[9].cn0 = -1.0; - test_msg.states[9].prn = 0; - test_msg.states[9].state = 0; - - test_msg.states[10].cn0 = -1.0; - test_msg.states[10].prn = 0; - test_msg.states[10].state = 0; - - EXPECT_EQ(send_message( 1219, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_, test_msg); - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; - } - { - const char check_string[] = { (char)115,(char)116,(char)97,(char)116,(char)101,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_states.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_states.value, 11) << "incorrect value for last_msg_.n_states.value, expected 11, is " << last_msg_.n_states.value; - EXPECT_LT((last_msg_.states[0].cn0 * 100 - 27.3942298889 * 100), 0.05) << "incorrect value for last_msg_.states[0].cn0, expected 27.3942298889, is " << last_msg_.states[0].cn0; - EXPECT_EQ(last_msg_.states[0].prn, 0) << "incorrect value for last_msg_.states[0].prn, expected 0, is " << last_msg_.states[0].prn; - EXPECT_EQ(last_msg_.states[0].state, 1) << "incorrect value for last_msg_.states[0].state, expected 1, is " << last_msg_.states[0].state; - EXPECT_LT((last_msg_.states[1].cn0 * 100 - 2.875 * 100), 0.05) << "incorrect value for last_msg_.states[1].cn0, expected 2.875, is " << last_msg_.states[1].cn0; - EXPECT_EQ(last_msg_.states[1].prn, 2) << "incorrect value for last_msg_.states[1].prn, expected 2, is " << last_msg_.states[1].prn; - EXPECT_EQ(last_msg_.states[1].state, 1) << "incorrect value for last_msg_.states[1].state, expected 1, is " << last_msg_.states[1].state; - EXPECT_LT((last_msg_.states[2].cn0 * 100 - 8.46764469147 * 100), 0.05) << "incorrect value for last_msg_.states[2].cn0, expected 8.46764469147, is " << last_msg_.states[2].cn0; - EXPECT_EQ(last_msg_.states[2].prn, 3) << "incorrect value for last_msg_.states[2].prn, expected 3, is " << last_msg_.states[2].prn; - EXPECT_EQ(last_msg_.states[2].state, 1) << "incorrect value for last_msg_.states[2].state, expected 1, is " << last_msg_.states[2].state; - EXPECT_LT((last_msg_.states[3].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[3].cn0, expected -1.0, is " << last_msg_.states[3].cn0; - EXPECT_EQ(last_msg_.states[3].prn, 0) << "incorrect value for last_msg_.states[3].prn, expected 0, is " << last_msg_.states[3].prn; - EXPECT_EQ(last_msg_.states[3].state, 0) << "incorrect value for last_msg_.states[3].state, expected 0, is " << last_msg_.states[3].state; - EXPECT_LT((last_msg_.states[4].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[4].cn0, expected -1.0, is " << last_msg_.states[4].cn0; - EXPECT_EQ(last_msg_.states[4].prn, 0) << "incorrect value for last_msg_.states[4].prn, expected 0, is " << last_msg_.states[4].prn; - EXPECT_EQ(last_msg_.states[4].state, 0) << "incorrect value for last_msg_.states[4].state, expected 0, is " << last_msg_.states[4].state; - EXPECT_LT((last_msg_.states[5].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[5].cn0, expected -1.0, is " << last_msg_.states[5].cn0; - EXPECT_EQ(last_msg_.states[5].prn, 0) << "incorrect value for last_msg_.states[5].prn, expected 0, is " << last_msg_.states[5].prn; - EXPECT_EQ(last_msg_.states[5].state, 0) << "incorrect value for last_msg_.states[5].state, expected 0, is " << last_msg_.states[5].state; - EXPECT_LT((last_msg_.states[6].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[6].cn0, expected -1.0, is " << last_msg_.states[6].cn0; - EXPECT_EQ(last_msg_.states[6].prn, 0) << "incorrect value for last_msg_.states[6].prn, expected 0, is " << last_msg_.states[6].prn; - EXPECT_EQ(last_msg_.states[6].state, 0) << "incorrect value for last_msg_.states[6].state, expected 0, is " << last_msg_.states[6].state; - EXPECT_LT((last_msg_.states[7].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[7].cn0, expected -1.0, is " << last_msg_.states[7].cn0; - EXPECT_EQ(last_msg_.states[7].prn, 0) << "incorrect value for last_msg_.states[7].prn, expected 0, is " << last_msg_.states[7].prn; - EXPECT_EQ(last_msg_.states[7].state, 0) << "incorrect value for last_msg_.states[7].state, expected 0, is " << last_msg_.states[7].state; - EXPECT_LT((last_msg_.states[8].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[8].cn0, expected -1.0, is " << last_msg_.states[8].cn0; - EXPECT_EQ(last_msg_.states[8].prn, 0) << "incorrect value for last_msg_.states[8].prn, expected 0, is " << last_msg_.states[8].prn; - EXPECT_EQ(last_msg_.states[8].state, 0) << "incorrect value for last_msg_.states[8].state, expected 0, is " << last_msg_.states[8].state; - EXPECT_LT((last_msg_.states[9].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[9].cn0, expected -1.0, is " << last_msg_.states[9].cn0; - EXPECT_EQ(last_msg_.states[9].prn, 0) << "incorrect value for last_msg_.states[9].prn, expected 0, is " << last_msg_.states[9].prn; - EXPECT_EQ(last_msg_.states[9].state, 0) << "incorrect value for last_msg_.states[9].state, expected 0, is " << last_msg_.states[9].state; - EXPECT_LT((last_msg_.states[10].cn0 * 100 - -1.0 * 100), 0.05) << "incorrect value for last_msg_.states[10].cn0, expected -1.0, is " << last_msg_.states[10].cn0; - EXPECT_EQ(last_msg_.states[10].prn, 0) << "incorrect value for last_msg_.states[10].prn, expected 0, is " << last_msg_.states[10].prn; - EXPECT_EQ(last_msg_.states[10].state, 0) << "incorrect value for last_msg_.states[10].state, expected 0, is " << last_msg_.states[10].state; +}; + +TEST_F(Test_auto_check_sbp_tracking_MsgtrackingStateDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 98, 39, 219, 65, 1, 2, 0, + 0, 56, 64, 1, 3, 121, 123, 7, 65, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 37, 123, + }; + + sbp_msg_tracking_state_dep_a_t test_msg{}; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_states.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + memcpy(test_msg.n_states.relates_to, assign_string, sizeof(assign_string)); + } + test_msg.n_states.value = 11; + + test_msg.states[0].cn0 = 27.394229888916016; + test_msg.states[0].prn = 0; + test_msg.states[0].state = 1; + + test_msg.states[1].cn0 = 2.875; + test_msg.states[1].prn = 2; + test_msg.states[1].state = 1; + + test_msg.states[2].cn0 = 8.467644691467285; + test_msg.states[2].prn = 3; + test_msg.states[2].state = 1; + + test_msg.states[3].cn0 = -1.0; + test_msg.states[3].prn = 0; + test_msg.states[3].state = 0; + + test_msg.states[4].cn0 = -1.0; + test_msg.states[4].prn = 0; + test_msg.states[4].state = 0; + + test_msg.states[5].cn0 = -1.0; + test_msg.states[5].prn = 0; + test_msg.states[5].state = 0; + + test_msg.states[6].cn0 = -1.0; + test_msg.states[6].prn = 0; + test_msg.states[6].state = 0; + + test_msg.states[7].cn0 = -1.0; + test_msg.states[7].prn = 0; + test_msg.states[7].state = 0; + + test_msg.states[8].cn0 = -1.0; + test_msg.states[8].prn = 0; + test_msg.states[8].state = 0; + + test_msg.states[9].cn0 = -1.0; + test_msg.states[9].prn = 0; + test_msg.states[9].state = 0; + + test_msg.states[10].cn0 = -1.0; + test_msg.states[10].prn = 0; + test_msg.states[10].state = 0; + + EXPECT_EQ(send_message(1219, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_, test_msg); + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_states.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.handle_as, expected string '" + << check_string << "', is '" << last_msg_.n_states.handle_as << "'"; + } + { + const char check_string[] = {(char)115, (char)116, (char)97, + (char)116, (char)101, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_states.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_states.relates_to, expected string " + "'" + << check_string << "', is '" << last_msg_.n_states.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_states.value, 11) + << "incorrect value for last_msg_.n_states.value, expected 11, is " + << last_msg_.n_states.value; + EXPECT_LT((last_msg_.states[0].cn0 * 100 - 27.3942298889 * 100), 0.05) + << "incorrect value for last_msg_.states[0].cn0, expected 27.3942298889, " + "is " + << last_msg_.states[0].cn0; + EXPECT_EQ(last_msg_.states[0].prn, 0) + << "incorrect value for last_msg_.states[0].prn, expected 0, is " + << last_msg_.states[0].prn; + EXPECT_EQ(last_msg_.states[0].state, 1) + << "incorrect value for last_msg_.states[0].state, expected 1, is " + << last_msg_.states[0].state; + EXPECT_LT((last_msg_.states[1].cn0 * 100 - 2.875 * 100), 0.05) + << "incorrect value for last_msg_.states[1].cn0, expected 2.875, is " + << last_msg_.states[1].cn0; + EXPECT_EQ(last_msg_.states[1].prn, 2) + << "incorrect value for last_msg_.states[1].prn, expected 2, is " + << last_msg_.states[1].prn; + EXPECT_EQ(last_msg_.states[1].state, 1) + << "incorrect value for last_msg_.states[1].state, expected 1, is " + << last_msg_.states[1].state; + EXPECT_LT((last_msg_.states[2].cn0 * 100 - 8.46764469147 * 100), 0.05) + << "incorrect value for last_msg_.states[2].cn0, expected 8.46764469147, " + "is " + << last_msg_.states[2].cn0; + EXPECT_EQ(last_msg_.states[2].prn, 3) + << "incorrect value for last_msg_.states[2].prn, expected 3, is " + << last_msg_.states[2].prn; + EXPECT_EQ(last_msg_.states[2].state, 1) + << "incorrect value for last_msg_.states[2].state, expected 1, is " + << last_msg_.states[2].state; + EXPECT_LT((last_msg_.states[3].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[3].cn0, expected -1.0, is " + << last_msg_.states[3].cn0; + EXPECT_EQ(last_msg_.states[3].prn, 0) + << "incorrect value for last_msg_.states[3].prn, expected 0, is " + << last_msg_.states[3].prn; + EXPECT_EQ(last_msg_.states[3].state, 0) + << "incorrect value for last_msg_.states[3].state, expected 0, is " + << last_msg_.states[3].state; + EXPECT_LT((last_msg_.states[4].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[4].cn0, expected -1.0, is " + << last_msg_.states[4].cn0; + EXPECT_EQ(last_msg_.states[4].prn, 0) + << "incorrect value for last_msg_.states[4].prn, expected 0, is " + << last_msg_.states[4].prn; + EXPECT_EQ(last_msg_.states[4].state, 0) + << "incorrect value for last_msg_.states[4].state, expected 0, is " + << last_msg_.states[4].state; + EXPECT_LT((last_msg_.states[5].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[5].cn0, expected -1.0, is " + << last_msg_.states[5].cn0; + EXPECT_EQ(last_msg_.states[5].prn, 0) + << "incorrect value for last_msg_.states[5].prn, expected 0, is " + << last_msg_.states[5].prn; + EXPECT_EQ(last_msg_.states[5].state, 0) + << "incorrect value for last_msg_.states[5].state, expected 0, is " + << last_msg_.states[5].state; + EXPECT_LT((last_msg_.states[6].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[6].cn0, expected -1.0, is " + << last_msg_.states[6].cn0; + EXPECT_EQ(last_msg_.states[6].prn, 0) + << "incorrect value for last_msg_.states[6].prn, expected 0, is " + << last_msg_.states[6].prn; + EXPECT_EQ(last_msg_.states[6].state, 0) + << "incorrect value for last_msg_.states[6].state, expected 0, is " + << last_msg_.states[6].state; + EXPECT_LT((last_msg_.states[7].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[7].cn0, expected -1.0, is " + << last_msg_.states[7].cn0; + EXPECT_EQ(last_msg_.states[7].prn, 0) + << "incorrect value for last_msg_.states[7].prn, expected 0, is " + << last_msg_.states[7].prn; + EXPECT_EQ(last_msg_.states[7].state, 0) + << "incorrect value for last_msg_.states[7].state, expected 0, is " + << last_msg_.states[7].state; + EXPECT_LT((last_msg_.states[8].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[8].cn0, expected -1.0, is " + << last_msg_.states[8].cn0; + EXPECT_EQ(last_msg_.states[8].prn, 0) + << "incorrect value for last_msg_.states[8].prn, expected 0, is " + << last_msg_.states[8].prn; + EXPECT_EQ(last_msg_.states[8].state, 0) + << "incorrect value for last_msg_.states[8].state, expected 0, is " + << last_msg_.states[8].state; + EXPECT_LT((last_msg_.states[9].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[9].cn0, expected -1.0, is " + << last_msg_.states[9].cn0; + EXPECT_EQ(last_msg_.states[9].prn, 0) + << "incorrect value for last_msg_.states[9].prn, expected 0, is " + << last_msg_.states[9].prn; + EXPECT_EQ(last_msg_.states[9].state, 0) + << "incorrect value for last_msg_.states[9].state, expected 0, is " + << last_msg_.states[9].state; + EXPECT_LT((last_msg_.states[10].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for last_msg_.states[10].cn0, expected -1.0, is " + << last_msg_.states[10].cn0; + EXPECT_EQ(last_msg_.states[10].prn, 0) + << "incorrect value for last_msg_.states[10].prn, expected 0, is " + << last_msg_.states[10].prn; + EXPECT_EQ(last_msg_.states[10].state, 0) + << "incorrect value for last_msg_.states[10].state, expected 0, is " + << last_msg_.states[10].state; } diff --git a/c/test/cpp/auto_check_sbp_user_MsgUserData.cc b/c/test/cpp/auto_check_sbp_user_MsgUserData.cc index 2a846e094..a81b1b861 100644 --- a/c/test/cpp/auto_check_sbp_user_MsgUserData.cc +++ b/c/test/cpp/auto_check_sbp_user_MsgUserData.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/user/test_MsgUserData.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/user/test_MsgUserData.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_user_MsgUserData0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_user_MsgUserData0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_user_MsgUserData0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_user_MsgUserData0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_user_data_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_user_data_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,813 +67,1359 @@ class Test_auto_check_sbp_user_MsgUserData0 : sbp_msg_user_data_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_user_MsgUserData0, Test) -{ - - uint8_t encoded_frame[] = {85,0,8,126,33,255,53,5,172,138,50,49,206,234,149,204,113,31,108,188,179,154,156,167,145,139,42,207,126,242,193,9,58,75,8,135,11,92,131,245,24,90,255,30,58,31,109,148,56,178,140,30,159,70,17,170,50,148,1,99,112,88,217,36,84,34,234,82,144,144,97,96,75,174,58,219,180,148,247,59,2,116,214,114,55,134,54,119,108,128,73,181,20,233,23,23,73,119,136,231,189,26,174,128,93,30,76,45,109,134,81,0,116,158,127,40,133,208,134,127,140,232,183,184,108,6,228,54,238,59,220,30,228,212,50,182,97,20,41,76,227,88,12,95,112,209,183,127,4,165,189,44,239,232,132,9,114,184,249,208,246,194,250,2,97,173,157,202,172,180,150,213,193,177,209,156,20,174,18,73,132,215,115,128,175,169,116,132,100,72,45,25,14,205,213,145,68,137,249,54,40,174,215,148,166,190,63,118,6,165,212,74,68,200,38,139,212,112,45,167,236,255,106,92,132,59,61,233,3,246,158,83,134,246,154,17,0,6,56,216,19,216,70,71,161,184,5,177,45,37,98,56,149,0,73,221,105,239,168,205,85,81,245, }; - - sbp_msg_user_data_t test_msg{}; - - test_msg.contents[0] = 53; - - test_msg.contents[1] = 5; - - test_msg.contents[2] = 172; - - test_msg.contents[3] = 138; - - test_msg.contents[4] = 50; - - test_msg.contents[5] = 49; - - test_msg.contents[6] = 206; - - test_msg.contents[7] = 234; - - test_msg.contents[8] = 149; - - test_msg.contents[9] = 204; - - test_msg.contents[10] = 113; - - test_msg.contents[11] = 31; - - test_msg.contents[12] = 108; - - test_msg.contents[13] = 188; - - test_msg.contents[14] = 179; - - test_msg.contents[15] = 154; - - test_msg.contents[16] = 156; - - test_msg.contents[17] = 167; - - test_msg.contents[18] = 145; - - test_msg.contents[19] = 139; - - test_msg.contents[20] = 42; - - test_msg.contents[21] = 207; - - test_msg.contents[22] = 126; - - test_msg.contents[23] = 242; - - test_msg.contents[24] = 193; - - test_msg.contents[25] = 9; - - test_msg.contents[26] = 58; - - test_msg.contents[27] = 75; - - test_msg.contents[28] = 8; - - test_msg.contents[29] = 135; - - test_msg.contents[30] = 11; - - test_msg.contents[31] = 92; - - test_msg.contents[32] = 131; - - test_msg.contents[33] = 245; - - test_msg.contents[34] = 24; - - test_msg.contents[35] = 90; - - test_msg.contents[36] = 255; - - test_msg.contents[37] = 30; - - test_msg.contents[38] = 58; - - test_msg.contents[39] = 31; - - test_msg.contents[40] = 109; - - test_msg.contents[41] = 148; - - test_msg.contents[42] = 56; - - test_msg.contents[43] = 178; - - test_msg.contents[44] = 140; - - test_msg.contents[45] = 30; - - test_msg.contents[46] = 159; - - test_msg.contents[47] = 70; - - test_msg.contents[48] = 17; - - test_msg.contents[49] = 170; - - test_msg.contents[50] = 50; - - test_msg.contents[51] = 148; - - test_msg.contents[52] = 1; - - test_msg.contents[53] = 99; - - test_msg.contents[54] = 112; - - test_msg.contents[55] = 88; - - test_msg.contents[56] = 217; - - test_msg.contents[57] = 36; - - test_msg.contents[58] = 84; - - test_msg.contents[59] = 34; - - test_msg.contents[60] = 234; - - test_msg.contents[61] = 82; - - test_msg.contents[62] = 144; - - test_msg.contents[63] = 144; - - test_msg.contents[64] = 97; - - test_msg.contents[65] = 96; - - test_msg.contents[66] = 75; - - test_msg.contents[67] = 174; - - test_msg.contents[68] = 58; - - test_msg.contents[69] = 219; - - test_msg.contents[70] = 180; - - test_msg.contents[71] = 148; - - test_msg.contents[72] = 247; - - test_msg.contents[73] = 59; - - test_msg.contents[74] = 2; - - test_msg.contents[75] = 116; - - test_msg.contents[76] = 214; - - test_msg.contents[77] = 114; - - test_msg.contents[78] = 55; - - test_msg.contents[79] = 134; - - test_msg.contents[80] = 54; - - test_msg.contents[81] = 119; - - test_msg.contents[82] = 108; - - test_msg.contents[83] = 128; - - test_msg.contents[84] = 73; - - test_msg.contents[85] = 181; - - test_msg.contents[86] = 20; - - test_msg.contents[87] = 233; - - test_msg.contents[88] = 23; - - test_msg.contents[89] = 23; - - test_msg.contents[90] = 73; - - test_msg.contents[91] = 119; - - test_msg.contents[92] = 136; - - test_msg.contents[93] = 231; - - test_msg.contents[94] = 189; - - test_msg.contents[95] = 26; - - test_msg.contents[96] = 174; - - test_msg.contents[97] = 128; - - test_msg.contents[98] = 93; - - test_msg.contents[99] = 30; - - test_msg.contents[100] = 76; - - test_msg.contents[101] = 45; - - test_msg.contents[102] = 109; - - test_msg.contents[103] = 134; - - test_msg.contents[104] = 81; - - test_msg.contents[105] = 0; - - test_msg.contents[106] = 116; - - test_msg.contents[107] = 158; - - test_msg.contents[108] = 127; - - test_msg.contents[109] = 40; - - test_msg.contents[110] = 133; - - test_msg.contents[111] = 208; - - test_msg.contents[112] = 134; - - test_msg.contents[113] = 127; - - test_msg.contents[114] = 140; - - test_msg.contents[115] = 232; - - test_msg.contents[116] = 183; - - test_msg.contents[117] = 184; - - test_msg.contents[118] = 108; - - test_msg.contents[119] = 6; - - test_msg.contents[120] = 228; - - test_msg.contents[121] = 54; - - test_msg.contents[122] = 238; - - test_msg.contents[123] = 59; - - test_msg.contents[124] = 220; - - test_msg.contents[125] = 30; - - test_msg.contents[126] = 228; - - test_msg.contents[127] = 212; - - test_msg.contents[128] = 50; - - test_msg.contents[129] = 182; - - test_msg.contents[130] = 97; - - test_msg.contents[131] = 20; - - test_msg.contents[132] = 41; - - test_msg.contents[133] = 76; - - test_msg.contents[134] = 227; - - test_msg.contents[135] = 88; - - test_msg.contents[136] = 12; - - test_msg.contents[137] = 95; - - test_msg.contents[138] = 112; - - test_msg.contents[139] = 209; - - test_msg.contents[140] = 183; - - test_msg.contents[141] = 127; - - test_msg.contents[142] = 4; - - test_msg.contents[143] = 165; - - test_msg.contents[144] = 189; - - test_msg.contents[145] = 44; - - test_msg.contents[146] = 239; - - test_msg.contents[147] = 232; - - test_msg.contents[148] = 132; - - test_msg.contents[149] = 9; - - test_msg.contents[150] = 114; - - test_msg.contents[151] = 184; - - test_msg.contents[152] = 249; - - test_msg.contents[153] = 208; - - test_msg.contents[154] = 246; - - test_msg.contents[155] = 194; - - test_msg.contents[156] = 250; - - test_msg.contents[157] = 2; - - test_msg.contents[158] = 97; - - test_msg.contents[159] = 173; - - test_msg.contents[160] = 157; - - test_msg.contents[161] = 202; - - test_msg.contents[162] = 172; - - test_msg.contents[163] = 180; - - test_msg.contents[164] = 150; - - test_msg.contents[165] = 213; - - test_msg.contents[166] = 193; - - test_msg.contents[167] = 177; - - test_msg.contents[168] = 209; - - test_msg.contents[169] = 156; - - test_msg.contents[170] = 20; - - test_msg.contents[171] = 174; - - test_msg.contents[172] = 18; - - test_msg.contents[173] = 73; - - test_msg.contents[174] = 132; - - test_msg.contents[175] = 215; - - test_msg.contents[176] = 115; - - test_msg.contents[177] = 128; - - test_msg.contents[178] = 175; - - test_msg.contents[179] = 169; - - test_msg.contents[180] = 116; - - test_msg.contents[181] = 132; - - test_msg.contents[182] = 100; - - test_msg.contents[183] = 72; - - test_msg.contents[184] = 45; - - test_msg.contents[185] = 25; - - test_msg.contents[186] = 14; - - test_msg.contents[187] = 205; - - test_msg.contents[188] = 213; - - test_msg.contents[189] = 145; - - test_msg.contents[190] = 68; - - test_msg.contents[191] = 137; - - test_msg.contents[192] = 249; - - test_msg.contents[193] = 54; - - test_msg.contents[194] = 40; - - test_msg.contents[195] = 174; - - test_msg.contents[196] = 215; - - test_msg.contents[197] = 148; - - test_msg.contents[198] = 166; - - test_msg.contents[199] = 190; - - test_msg.contents[200] = 63; - - test_msg.contents[201] = 118; - - test_msg.contents[202] = 6; - - test_msg.contents[203] = 165; - - test_msg.contents[204] = 212; - - test_msg.contents[205] = 74; - - test_msg.contents[206] = 68; - - test_msg.contents[207] = 200; - - test_msg.contents[208] = 38; - - test_msg.contents[209] = 139; - - test_msg.contents[210] = 212; - - test_msg.contents[211] = 112; - - test_msg.contents[212] = 45; - - test_msg.contents[213] = 167; - - test_msg.contents[214] = 236; - - test_msg.contents[215] = 255; - - test_msg.contents[216] = 106; - - test_msg.contents[217] = 92; - - test_msg.contents[218] = 132; - - test_msg.contents[219] = 59; - - test_msg.contents[220] = 61; - - test_msg.contents[221] = 233; - - test_msg.contents[222] = 3; - - test_msg.contents[223] = 246; - - test_msg.contents[224] = 158; - - test_msg.contents[225] = 83; - - test_msg.contents[226] = 134; - - test_msg.contents[227] = 246; - - test_msg.contents[228] = 154; - - test_msg.contents[229] = 17; - - test_msg.contents[230] = 0; - - test_msg.contents[231] = 6; - - test_msg.contents[232] = 56; - - test_msg.contents[233] = 216; - - test_msg.contents[234] = 19; - - test_msg.contents[235] = 216; - - test_msg.contents[236] = 70; - - test_msg.contents[237] = 71; - - test_msg.contents[238] = 161; - - test_msg.contents[239] = 184; - - test_msg.contents[240] = 5; - - test_msg.contents[241] = 177; - - test_msg.contents[242] = 45; - - test_msg.contents[243] = 37; - - test_msg.contents[244] = 98; - - test_msg.contents[245] = 56; - - test_msg.contents[246] = 149; - - test_msg.contents[247] = 0; - - test_msg.contents[248] = 73; - - test_msg.contents[249] = 221; - - test_msg.contents[250] = 105; - - test_msg.contents[251] = 239; - - test_msg.contents[252] = 168; - - test_msg.contents[253] = 205; - - test_msg.contents[254] = 85; - { - const char assign_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - memcpy(test_msg.n_contents.handle_as, assign_string, sizeof(assign_string)); - } - { - const char assign_string[] = { (char)99,(char)111,(char)110,(char)116,(char)101,(char)110,(char)116,(char)115 }; - memcpy(test_msg.n_contents.relates_to, assign_string, sizeof(assign_string)); - } - test_msg.n_contents.value = 255; - - EXPECT_EQ(send_message( 8574, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 8574); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.contents[0], 53) << "incorrect value for last_msg_.contents[0], expected 53, is " << last_msg_.contents[0]; - EXPECT_EQ(last_msg_.contents[1], 5) << "incorrect value for last_msg_.contents[1], expected 5, is " << last_msg_.contents[1]; - EXPECT_EQ(last_msg_.contents[2], 172) << "incorrect value for last_msg_.contents[2], expected 172, is " << last_msg_.contents[2]; - EXPECT_EQ(last_msg_.contents[3], 138) << "incorrect value for last_msg_.contents[3], expected 138, is " << last_msg_.contents[3]; - EXPECT_EQ(last_msg_.contents[4], 50) << "incorrect value for last_msg_.contents[4], expected 50, is " << last_msg_.contents[4]; - EXPECT_EQ(last_msg_.contents[5], 49) << "incorrect value for last_msg_.contents[5], expected 49, is " << last_msg_.contents[5]; - EXPECT_EQ(last_msg_.contents[6], 206) << "incorrect value for last_msg_.contents[6], expected 206, is " << last_msg_.contents[6]; - EXPECT_EQ(last_msg_.contents[7], 234) << "incorrect value for last_msg_.contents[7], expected 234, is " << last_msg_.contents[7]; - EXPECT_EQ(last_msg_.contents[8], 149) << "incorrect value for last_msg_.contents[8], expected 149, is " << last_msg_.contents[8]; - EXPECT_EQ(last_msg_.contents[9], 204) << "incorrect value for last_msg_.contents[9], expected 204, is " << last_msg_.contents[9]; - EXPECT_EQ(last_msg_.contents[10], 113) << "incorrect value for last_msg_.contents[10], expected 113, is " << last_msg_.contents[10]; - EXPECT_EQ(last_msg_.contents[11], 31) << "incorrect value for last_msg_.contents[11], expected 31, is " << last_msg_.contents[11]; - EXPECT_EQ(last_msg_.contents[12], 108) << "incorrect value for last_msg_.contents[12], expected 108, is " << last_msg_.contents[12]; - EXPECT_EQ(last_msg_.contents[13], 188) << "incorrect value for last_msg_.contents[13], expected 188, is " << last_msg_.contents[13]; - EXPECT_EQ(last_msg_.contents[14], 179) << "incorrect value for last_msg_.contents[14], expected 179, is " << last_msg_.contents[14]; - EXPECT_EQ(last_msg_.contents[15], 154) << "incorrect value for last_msg_.contents[15], expected 154, is " << last_msg_.contents[15]; - EXPECT_EQ(last_msg_.contents[16], 156) << "incorrect value for last_msg_.contents[16], expected 156, is " << last_msg_.contents[16]; - EXPECT_EQ(last_msg_.contents[17], 167) << "incorrect value for last_msg_.contents[17], expected 167, is " << last_msg_.contents[17]; - EXPECT_EQ(last_msg_.contents[18], 145) << "incorrect value for last_msg_.contents[18], expected 145, is " << last_msg_.contents[18]; - EXPECT_EQ(last_msg_.contents[19], 139) << "incorrect value for last_msg_.contents[19], expected 139, is " << last_msg_.contents[19]; - EXPECT_EQ(last_msg_.contents[20], 42) << "incorrect value for last_msg_.contents[20], expected 42, is " << last_msg_.contents[20]; - EXPECT_EQ(last_msg_.contents[21], 207) << "incorrect value for last_msg_.contents[21], expected 207, is " << last_msg_.contents[21]; - EXPECT_EQ(last_msg_.contents[22], 126) << "incorrect value for last_msg_.contents[22], expected 126, is " << last_msg_.contents[22]; - EXPECT_EQ(last_msg_.contents[23], 242) << "incorrect value for last_msg_.contents[23], expected 242, is " << last_msg_.contents[23]; - EXPECT_EQ(last_msg_.contents[24], 193) << "incorrect value for last_msg_.contents[24], expected 193, is " << last_msg_.contents[24]; - EXPECT_EQ(last_msg_.contents[25], 9) << "incorrect value for last_msg_.contents[25], expected 9, is " << last_msg_.contents[25]; - EXPECT_EQ(last_msg_.contents[26], 58) << "incorrect value for last_msg_.contents[26], expected 58, is " << last_msg_.contents[26]; - EXPECT_EQ(last_msg_.contents[27], 75) << "incorrect value for last_msg_.contents[27], expected 75, is " << last_msg_.contents[27]; - EXPECT_EQ(last_msg_.contents[28], 8) << "incorrect value for last_msg_.contents[28], expected 8, is " << last_msg_.contents[28]; - EXPECT_EQ(last_msg_.contents[29], 135) << "incorrect value for last_msg_.contents[29], expected 135, is " << last_msg_.contents[29]; - EXPECT_EQ(last_msg_.contents[30], 11) << "incorrect value for last_msg_.contents[30], expected 11, is " << last_msg_.contents[30]; - EXPECT_EQ(last_msg_.contents[31], 92) << "incorrect value for last_msg_.contents[31], expected 92, is " << last_msg_.contents[31]; - EXPECT_EQ(last_msg_.contents[32], 131) << "incorrect value for last_msg_.contents[32], expected 131, is " << last_msg_.contents[32]; - EXPECT_EQ(last_msg_.contents[33], 245) << "incorrect value for last_msg_.contents[33], expected 245, is " << last_msg_.contents[33]; - EXPECT_EQ(last_msg_.contents[34], 24) << "incorrect value for last_msg_.contents[34], expected 24, is " << last_msg_.contents[34]; - EXPECT_EQ(last_msg_.contents[35], 90) << "incorrect value for last_msg_.contents[35], expected 90, is " << last_msg_.contents[35]; - EXPECT_EQ(last_msg_.contents[36], 255) << "incorrect value for last_msg_.contents[36], expected 255, is " << last_msg_.contents[36]; - EXPECT_EQ(last_msg_.contents[37], 30) << "incorrect value for last_msg_.contents[37], expected 30, is " << last_msg_.contents[37]; - EXPECT_EQ(last_msg_.contents[38], 58) << "incorrect value for last_msg_.contents[38], expected 58, is " << last_msg_.contents[38]; - EXPECT_EQ(last_msg_.contents[39], 31) << "incorrect value for last_msg_.contents[39], expected 31, is " << last_msg_.contents[39]; - EXPECT_EQ(last_msg_.contents[40], 109) << "incorrect value for last_msg_.contents[40], expected 109, is " << last_msg_.contents[40]; - EXPECT_EQ(last_msg_.contents[41], 148) << "incorrect value for last_msg_.contents[41], expected 148, is " << last_msg_.contents[41]; - EXPECT_EQ(last_msg_.contents[42], 56) << "incorrect value for last_msg_.contents[42], expected 56, is " << last_msg_.contents[42]; - EXPECT_EQ(last_msg_.contents[43], 178) << "incorrect value for last_msg_.contents[43], expected 178, is " << last_msg_.contents[43]; - EXPECT_EQ(last_msg_.contents[44], 140) << "incorrect value for last_msg_.contents[44], expected 140, is " << last_msg_.contents[44]; - EXPECT_EQ(last_msg_.contents[45], 30) << "incorrect value for last_msg_.contents[45], expected 30, is " << last_msg_.contents[45]; - EXPECT_EQ(last_msg_.contents[46], 159) << "incorrect value for last_msg_.contents[46], expected 159, is " << last_msg_.contents[46]; - EXPECT_EQ(last_msg_.contents[47], 70) << "incorrect value for last_msg_.contents[47], expected 70, is " << last_msg_.contents[47]; - EXPECT_EQ(last_msg_.contents[48], 17) << "incorrect value for last_msg_.contents[48], expected 17, is " << last_msg_.contents[48]; - EXPECT_EQ(last_msg_.contents[49], 170) << "incorrect value for last_msg_.contents[49], expected 170, is " << last_msg_.contents[49]; - EXPECT_EQ(last_msg_.contents[50], 50) << "incorrect value for last_msg_.contents[50], expected 50, is " << last_msg_.contents[50]; - EXPECT_EQ(last_msg_.contents[51], 148) << "incorrect value for last_msg_.contents[51], expected 148, is " << last_msg_.contents[51]; - EXPECT_EQ(last_msg_.contents[52], 1) << "incorrect value for last_msg_.contents[52], expected 1, is " << last_msg_.contents[52]; - EXPECT_EQ(last_msg_.contents[53], 99) << "incorrect value for last_msg_.contents[53], expected 99, is " << last_msg_.contents[53]; - EXPECT_EQ(last_msg_.contents[54], 112) << "incorrect value for last_msg_.contents[54], expected 112, is " << last_msg_.contents[54]; - EXPECT_EQ(last_msg_.contents[55], 88) << "incorrect value for last_msg_.contents[55], expected 88, is " << last_msg_.contents[55]; - EXPECT_EQ(last_msg_.contents[56], 217) << "incorrect value for last_msg_.contents[56], expected 217, is " << last_msg_.contents[56]; - EXPECT_EQ(last_msg_.contents[57], 36) << "incorrect value for last_msg_.contents[57], expected 36, is " << last_msg_.contents[57]; - EXPECT_EQ(last_msg_.contents[58], 84) << "incorrect value for last_msg_.contents[58], expected 84, is " << last_msg_.contents[58]; - EXPECT_EQ(last_msg_.contents[59], 34) << "incorrect value for last_msg_.contents[59], expected 34, is " << last_msg_.contents[59]; - EXPECT_EQ(last_msg_.contents[60], 234) << "incorrect value for last_msg_.contents[60], expected 234, is " << last_msg_.contents[60]; - EXPECT_EQ(last_msg_.contents[61], 82) << "incorrect value for last_msg_.contents[61], expected 82, is " << last_msg_.contents[61]; - EXPECT_EQ(last_msg_.contents[62], 144) << "incorrect value for last_msg_.contents[62], expected 144, is " << last_msg_.contents[62]; - EXPECT_EQ(last_msg_.contents[63], 144) << "incorrect value for last_msg_.contents[63], expected 144, is " << last_msg_.contents[63]; - EXPECT_EQ(last_msg_.contents[64], 97) << "incorrect value for last_msg_.contents[64], expected 97, is " << last_msg_.contents[64]; - EXPECT_EQ(last_msg_.contents[65], 96) << "incorrect value for last_msg_.contents[65], expected 96, is " << last_msg_.contents[65]; - EXPECT_EQ(last_msg_.contents[66], 75) << "incorrect value for last_msg_.contents[66], expected 75, is " << last_msg_.contents[66]; - EXPECT_EQ(last_msg_.contents[67], 174) << "incorrect value for last_msg_.contents[67], expected 174, is " << last_msg_.contents[67]; - EXPECT_EQ(last_msg_.contents[68], 58) << "incorrect value for last_msg_.contents[68], expected 58, is " << last_msg_.contents[68]; - EXPECT_EQ(last_msg_.contents[69], 219) << "incorrect value for last_msg_.contents[69], expected 219, is " << last_msg_.contents[69]; - EXPECT_EQ(last_msg_.contents[70], 180) << "incorrect value for last_msg_.contents[70], expected 180, is " << last_msg_.contents[70]; - EXPECT_EQ(last_msg_.contents[71], 148) << "incorrect value for last_msg_.contents[71], expected 148, is " << last_msg_.contents[71]; - EXPECT_EQ(last_msg_.contents[72], 247) << "incorrect value for last_msg_.contents[72], expected 247, is " << last_msg_.contents[72]; - EXPECT_EQ(last_msg_.contents[73], 59) << "incorrect value for last_msg_.contents[73], expected 59, is " << last_msg_.contents[73]; - EXPECT_EQ(last_msg_.contents[74], 2) << "incorrect value for last_msg_.contents[74], expected 2, is " << last_msg_.contents[74]; - EXPECT_EQ(last_msg_.contents[75], 116) << "incorrect value for last_msg_.contents[75], expected 116, is " << last_msg_.contents[75]; - EXPECT_EQ(last_msg_.contents[76], 214) << "incorrect value for last_msg_.contents[76], expected 214, is " << last_msg_.contents[76]; - EXPECT_EQ(last_msg_.contents[77], 114) << "incorrect value for last_msg_.contents[77], expected 114, is " << last_msg_.contents[77]; - EXPECT_EQ(last_msg_.contents[78], 55) << "incorrect value for last_msg_.contents[78], expected 55, is " << last_msg_.contents[78]; - EXPECT_EQ(last_msg_.contents[79], 134) << "incorrect value for last_msg_.contents[79], expected 134, is " << last_msg_.contents[79]; - EXPECT_EQ(last_msg_.contents[80], 54) << "incorrect value for last_msg_.contents[80], expected 54, is " << last_msg_.contents[80]; - EXPECT_EQ(last_msg_.contents[81], 119) << "incorrect value for last_msg_.contents[81], expected 119, is " << last_msg_.contents[81]; - EXPECT_EQ(last_msg_.contents[82], 108) << "incorrect value for last_msg_.contents[82], expected 108, is " << last_msg_.contents[82]; - EXPECT_EQ(last_msg_.contents[83], 128) << "incorrect value for last_msg_.contents[83], expected 128, is " << last_msg_.contents[83]; - EXPECT_EQ(last_msg_.contents[84], 73) << "incorrect value for last_msg_.contents[84], expected 73, is " << last_msg_.contents[84]; - EXPECT_EQ(last_msg_.contents[85], 181) << "incorrect value for last_msg_.contents[85], expected 181, is " << last_msg_.contents[85]; - EXPECT_EQ(last_msg_.contents[86], 20) << "incorrect value for last_msg_.contents[86], expected 20, is " << last_msg_.contents[86]; - EXPECT_EQ(last_msg_.contents[87], 233) << "incorrect value for last_msg_.contents[87], expected 233, is " << last_msg_.contents[87]; - EXPECT_EQ(last_msg_.contents[88], 23) << "incorrect value for last_msg_.contents[88], expected 23, is " << last_msg_.contents[88]; - EXPECT_EQ(last_msg_.contents[89], 23) << "incorrect value for last_msg_.contents[89], expected 23, is " << last_msg_.contents[89]; - EXPECT_EQ(last_msg_.contents[90], 73) << "incorrect value for last_msg_.contents[90], expected 73, is " << last_msg_.contents[90]; - EXPECT_EQ(last_msg_.contents[91], 119) << "incorrect value for last_msg_.contents[91], expected 119, is " << last_msg_.contents[91]; - EXPECT_EQ(last_msg_.contents[92], 136) << "incorrect value for last_msg_.contents[92], expected 136, is " << last_msg_.contents[92]; - EXPECT_EQ(last_msg_.contents[93], 231) << "incorrect value for last_msg_.contents[93], expected 231, is " << last_msg_.contents[93]; - EXPECT_EQ(last_msg_.contents[94], 189) << "incorrect value for last_msg_.contents[94], expected 189, is " << last_msg_.contents[94]; - EXPECT_EQ(last_msg_.contents[95], 26) << "incorrect value for last_msg_.contents[95], expected 26, is " << last_msg_.contents[95]; - EXPECT_EQ(last_msg_.contents[96], 174) << "incorrect value for last_msg_.contents[96], expected 174, is " << last_msg_.contents[96]; - EXPECT_EQ(last_msg_.contents[97], 128) << "incorrect value for last_msg_.contents[97], expected 128, is " << last_msg_.contents[97]; - EXPECT_EQ(last_msg_.contents[98], 93) << "incorrect value for last_msg_.contents[98], expected 93, is " << last_msg_.contents[98]; - EXPECT_EQ(last_msg_.contents[99], 30) << "incorrect value for last_msg_.contents[99], expected 30, is " << last_msg_.contents[99]; - EXPECT_EQ(last_msg_.contents[100], 76) << "incorrect value for last_msg_.contents[100], expected 76, is " << last_msg_.contents[100]; - EXPECT_EQ(last_msg_.contents[101], 45) << "incorrect value for last_msg_.contents[101], expected 45, is " << last_msg_.contents[101]; - EXPECT_EQ(last_msg_.contents[102], 109) << "incorrect value for last_msg_.contents[102], expected 109, is " << last_msg_.contents[102]; - EXPECT_EQ(last_msg_.contents[103], 134) << "incorrect value for last_msg_.contents[103], expected 134, is " << last_msg_.contents[103]; - EXPECT_EQ(last_msg_.contents[104], 81) << "incorrect value for last_msg_.contents[104], expected 81, is " << last_msg_.contents[104]; - EXPECT_EQ(last_msg_.contents[105], 0) << "incorrect value for last_msg_.contents[105], expected 0, is " << last_msg_.contents[105]; - EXPECT_EQ(last_msg_.contents[106], 116) << "incorrect value for last_msg_.contents[106], expected 116, is " << last_msg_.contents[106]; - EXPECT_EQ(last_msg_.contents[107], 158) << "incorrect value for last_msg_.contents[107], expected 158, is " << last_msg_.contents[107]; - EXPECT_EQ(last_msg_.contents[108], 127) << "incorrect value for last_msg_.contents[108], expected 127, is " << last_msg_.contents[108]; - EXPECT_EQ(last_msg_.contents[109], 40) << "incorrect value for last_msg_.contents[109], expected 40, is " << last_msg_.contents[109]; - EXPECT_EQ(last_msg_.contents[110], 133) << "incorrect value for last_msg_.contents[110], expected 133, is " << last_msg_.contents[110]; - EXPECT_EQ(last_msg_.contents[111], 208) << "incorrect value for last_msg_.contents[111], expected 208, is " << last_msg_.contents[111]; - EXPECT_EQ(last_msg_.contents[112], 134) << "incorrect value for last_msg_.contents[112], expected 134, is " << last_msg_.contents[112]; - EXPECT_EQ(last_msg_.contents[113], 127) << "incorrect value for last_msg_.contents[113], expected 127, is " << last_msg_.contents[113]; - EXPECT_EQ(last_msg_.contents[114], 140) << "incorrect value for last_msg_.contents[114], expected 140, is " << last_msg_.contents[114]; - EXPECT_EQ(last_msg_.contents[115], 232) << "incorrect value for last_msg_.contents[115], expected 232, is " << last_msg_.contents[115]; - EXPECT_EQ(last_msg_.contents[116], 183) << "incorrect value for last_msg_.contents[116], expected 183, is " << last_msg_.contents[116]; - EXPECT_EQ(last_msg_.contents[117], 184) << "incorrect value for last_msg_.contents[117], expected 184, is " << last_msg_.contents[117]; - EXPECT_EQ(last_msg_.contents[118], 108) << "incorrect value for last_msg_.contents[118], expected 108, is " << last_msg_.contents[118]; - EXPECT_EQ(last_msg_.contents[119], 6) << "incorrect value for last_msg_.contents[119], expected 6, is " << last_msg_.contents[119]; - EXPECT_EQ(last_msg_.contents[120], 228) << "incorrect value for last_msg_.contents[120], expected 228, is " << last_msg_.contents[120]; - EXPECT_EQ(last_msg_.contents[121], 54) << "incorrect value for last_msg_.contents[121], expected 54, is " << last_msg_.contents[121]; - EXPECT_EQ(last_msg_.contents[122], 238) << "incorrect value for last_msg_.contents[122], expected 238, is " << last_msg_.contents[122]; - EXPECT_EQ(last_msg_.contents[123], 59) << "incorrect value for last_msg_.contents[123], expected 59, is " << last_msg_.contents[123]; - EXPECT_EQ(last_msg_.contents[124], 220) << "incorrect value for last_msg_.contents[124], expected 220, is " << last_msg_.contents[124]; - EXPECT_EQ(last_msg_.contents[125], 30) << "incorrect value for last_msg_.contents[125], expected 30, is " << last_msg_.contents[125]; - EXPECT_EQ(last_msg_.contents[126], 228) << "incorrect value for last_msg_.contents[126], expected 228, is " << last_msg_.contents[126]; - EXPECT_EQ(last_msg_.contents[127], 212) << "incorrect value for last_msg_.contents[127], expected 212, is " << last_msg_.contents[127]; - EXPECT_EQ(last_msg_.contents[128], 50) << "incorrect value for last_msg_.contents[128], expected 50, is " << last_msg_.contents[128]; - EXPECT_EQ(last_msg_.contents[129], 182) << "incorrect value for last_msg_.contents[129], expected 182, is " << last_msg_.contents[129]; - EXPECT_EQ(last_msg_.contents[130], 97) << "incorrect value for last_msg_.contents[130], expected 97, is " << last_msg_.contents[130]; - EXPECT_EQ(last_msg_.contents[131], 20) << "incorrect value for last_msg_.contents[131], expected 20, is " << last_msg_.contents[131]; - EXPECT_EQ(last_msg_.contents[132], 41) << "incorrect value for last_msg_.contents[132], expected 41, is " << last_msg_.contents[132]; - EXPECT_EQ(last_msg_.contents[133], 76) << "incorrect value for last_msg_.contents[133], expected 76, is " << last_msg_.contents[133]; - EXPECT_EQ(last_msg_.contents[134], 227) << "incorrect value for last_msg_.contents[134], expected 227, is " << last_msg_.contents[134]; - EXPECT_EQ(last_msg_.contents[135], 88) << "incorrect value for last_msg_.contents[135], expected 88, is " << last_msg_.contents[135]; - EXPECT_EQ(last_msg_.contents[136], 12) << "incorrect value for last_msg_.contents[136], expected 12, is " << last_msg_.contents[136]; - EXPECT_EQ(last_msg_.contents[137], 95) << "incorrect value for last_msg_.contents[137], expected 95, is " << last_msg_.contents[137]; - EXPECT_EQ(last_msg_.contents[138], 112) << "incorrect value for last_msg_.contents[138], expected 112, is " << last_msg_.contents[138]; - EXPECT_EQ(last_msg_.contents[139], 209) << "incorrect value for last_msg_.contents[139], expected 209, is " << last_msg_.contents[139]; - EXPECT_EQ(last_msg_.contents[140], 183) << "incorrect value for last_msg_.contents[140], expected 183, is " << last_msg_.contents[140]; - EXPECT_EQ(last_msg_.contents[141], 127) << "incorrect value for last_msg_.contents[141], expected 127, is " << last_msg_.contents[141]; - EXPECT_EQ(last_msg_.contents[142], 4) << "incorrect value for last_msg_.contents[142], expected 4, is " << last_msg_.contents[142]; - EXPECT_EQ(last_msg_.contents[143], 165) << "incorrect value for last_msg_.contents[143], expected 165, is " << last_msg_.contents[143]; - EXPECT_EQ(last_msg_.contents[144], 189) << "incorrect value for last_msg_.contents[144], expected 189, is " << last_msg_.contents[144]; - EXPECT_EQ(last_msg_.contents[145], 44) << "incorrect value for last_msg_.contents[145], expected 44, is " << last_msg_.contents[145]; - EXPECT_EQ(last_msg_.contents[146], 239) << "incorrect value for last_msg_.contents[146], expected 239, is " << last_msg_.contents[146]; - EXPECT_EQ(last_msg_.contents[147], 232) << "incorrect value for last_msg_.contents[147], expected 232, is " << last_msg_.contents[147]; - EXPECT_EQ(last_msg_.contents[148], 132) << "incorrect value for last_msg_.contents[148], expected 132, is " << last_msg_.contents[148]; - EXPECT_EQ(last_msg_.contents[149], 9) << "incorrect value for last_msg_.contents[149], expected 9, is " << last_msg_.contents[149]; - EXPECT_EQ(last_msg_.contents[150], 114) << "incorrect value for last_msg_.contents[150], expected 114, is " << last_msg_.contents[150]; - EXPECT_EQ(last_msg_.contents[151], 184) << "incorrect value for last_msg_.contents[151], expected 184, is " << last_msg_.contents[151]; - EXPECT_EQ(last_msg_.contents[152], 249) << "incorrect value for last_msg_.contents[152], expected 249, is " << last_msg_.contents[152]; - EXPECT_EQ(last_msg_.contents[153], 208) << "incorrect value for last_msg_.contents[153], expected 208, is " << last_msg_.contents[153]; - EXPECT_EQ(last_msg_.contents[154], 246) << "incorrect value for last_msg_.contents[154], expected 246, is " << last_msg_.contents[154]; - EXPECT_EQ(last_msg_.contents[155], 194) << "incorrect value for last_msg_.contents[155], expected 194, is " << last_msg_.contents[155]; - EXPECT_EQ(last_msg_.contents[156], 250) << "incorrect value for last_msg_.contents[156], expected 250, is " << last_msg_.contents[156]; - EXPECT_EQ(last_msg_.contents[157], 2) << "incorrect value for last_msg_.contents[157], expected 2, is " << last_msg_.contents[157]; - EXPECT_EQ(last_msg_.contents[158], 97) << "incorrect value for last_msg_.contents[158], expected 97, is " << last_msg_.contents[158]; - EXPECT_EQ(last_msg_.contents[159], 173) << "incorrect value for last_msg_.contents[159], expected 173, is " << last_msg_.contents[159]; - EXPECT_EQ(last_msg_.contents[160], 157) << "incorrect value for last_msg_.contents[160], expected 157, is " << last_msg_.contents[160]; - EXPECT_EQ(last_msg_.contents[161], 202) << "incorrect value for last_msg_.contents[161], expected 202, is " << last_msg_.contents[161]; - EXPECT_EQ(last_msg_.contents[162], 172) << "incorrect value for last_msg_.contents[162], expected 172, is " << last_msg_.contents[162]; - EXPECT_EQ(last_msg_.contents[163], 180) << "incorrect value for last_msg_.contents[163], expected 180, is " << last_msg_.contents[163]; - EXPECT_EQ(last_msg_.contents[164], 150) << "incorrect value for last_msg_.contents[164], expected 150, is " << last_msg_.contents[164]; - EXPECT_EQ(last_msg_.contents[165], 213) << "incorrect value for last_msg_.contents[165], expected 213, is " << last_msg_.contents[165]; - EXPECT_EQ(last_msg_.contents[166], 193) << "incorrect value for last_msg_.contents[166], expected 193, is " << last_msg_.contents[166]; - EXPECT_EQ(last_msg_.contents[167], 177) << "incorrect value for last_msg_.contents[167], expected 177, is " << last_msg_.contents[167]; - EXPECT_EQ(last_msg_.contents[168], 209) << "incorrect value for last_msg_.contents[168], expected 209, is " << last_msg_.contents[168]; - EXPECT_EQ(last_msg_.contents[169], 156) << "incorrect value for last_msg_.contents[169], expected 156, is " << last_msg_.contents[169]; - EXPECT_EQ(last_msg_.contents[170], 20) << "incorrect value for last_msg_.contents[170], expected 20, is " << last_msg_.contents[170]; - EXPECT_EQ(last_msg_.contents[171], 174) << "incorrect value for last_msg_.contents[171], expected 174, is " << last_msg_.contents[171]; - EXPECT_EQ(last_msg_.contents[172], 18) << "incorrect value for last_msg_.contents[172], expected 18, is " << last_msg_.contents[172]; - EXPECT_EQ(last_msg_.contents[173], 73) << "incorrect value for last_msg_.contents[173], expected 73, is " << last_msg_.contents[173]; - EXPECT_EQ(last_msg_.contents[174], 132) << "incorrect value for last_msg_.contents[174], expected 132, is " << last_msg_.contents[174]; - EXPECT_EQ(last_msg_.contents[175], 215) << "incorrect value for last_msg_.contents[175], expected 215, is " << last_msg_.contents[175]; - EXPECT_EQ(last_msg_.contents[176], 115) << "incorrect value for last_msg_.contents[176], expected 115, is " << last_msg_.contents[176]; - EXPECT_EQ(last_msg_.contents[177], 128) << "incorrect value for last_msg_.contents[177], expected 128, is " << last_msg_.contents[177]; - EXPECT_EQ(last_msg_.contents[178], 175) << "incorrect value for last_msg_.contents[178], expected 175, is " << last_msg_.contents[178]; - EXPECT_EQ(last_msg_.contents[179], 169) << "incorrect value for last_msg_.contents[179], expected 169, is " << last_msg_.contents[179]; - EXPECT_EQ(last_msg_.contents[180], 116) << "incorrect value for last_msg_.contents[180], expected 116, is " << last_msg_.contents[180]; - EXPECT_EQ(last_msg_.contents[181], 132) << "incorrect value for last_msg_.contents[181], expected 132, is " << last_msg_.contents[181]; - EXPECT_EQ(last_msg_.contents[182], 100) << "incorrect value for last_msg_.contents[182], expected 100, is " << last_msg_.contents[182]; - EXPECT_EQ(last_msg_.contents[183], 72) << "incorrect value for last_msg_.contents[183], expected 72, is " << last_msg_.contents[183]; - EXPECT_EQ(last_msg_.contents[184], 45) << "incorrect value for last_msg_.contents[184], expected 45, is " << last_msg_.contents[184]; - EXPECT_EQ(last_msg_.contents[185], 25) << "incorrect value for last_msg_.contents[185], expected 25, is " << last_msg_.contents[185]; - EXPECT_EQ(last_msg_.contents[186], 14) << "incorrect value for last_msg_.contents[186], expected 14, is " << last_msg_.contents[186]; - EXPECT_EQ(last_msg_.contents[187], 205) << "incorrect value for last_msg_.contents[187], expected 205, is " << last_msg_.contents[187]; - EXPECT_EQ(last_msg_.contents[188], 213) << "incorrect value for last_msg_.contents[188], expected 213, is " << last_msg_.contents[188]; - EXPECT_EQ(last_msg_.contents[189], 145) << "incorrect value for last_msg_.contents[189], expected 145, is " << last_msg_.contents[189]; - EXPECT_EQ(last_msg_.contents[190], 68) << "incorrect value for last_msg_.contents[190], expected 68, is " << last_msg_.contents[190]; - EXPECT_EQ(last_msg_.contents[191], 137) << "incorrect value for last_msg_.contents[191], expected 137, is " << last_msg_.contents[191]; - EXPECT_EQ(last_msg_.contents[192], 249) << "incorrect value for last_msg_.contents[192], expected 249, is " << last_msg_.contents[192]; - EXPECT_EQ(last_msg_.contents[193], 54) << "incorrect value for last_msg_.contents[193], expected 54, is " << last_msg_.contents[193]; - EXPECT_EQ(last_msg_.contents[194], 40) << "incorrect value for last_msg_.contents[194], expected 40, is " << last_msg_.contents[194]; - EXPECT_EQ(last_msg_.contents[195], 174) << "incorrect value for last_msg_.contents[195], expected 174, is " << last_msg_.contents[195]; - EXPECT_EQ(last_msg_.contents[196], 215) << "incorrect value for last_msg_.contents[196], expected 215, is " << last_msg_.contents[196]; - EXPECT_EQ(last_msg_.contents[197], 148) << "incorrect value for last_msg_.contents[197], expected 148, is " << last_msg_.contents[197]; - EXPECT_EQ(last_msg_.contents[198], 166) << "incorrect value for last_msg_.contents[198], expected 166, is " << last_msg_.contents[198]; - EXPECT_EQ(last_msg_.contents[199], 190) << "incorrect value for last_msg_.contents[199], expected 190, is " << last_msg_.contents[199]; - EXPECT_EQ(last_msg_.contents[200], 63) << "incorrect value for last_msg_.contents[200], expected 63, is " << last_msg_.contents[200]; - EXPECT_EQ(last_msg_.contents[201], 118) << "incorrect value for last_msg_.contents[201], expected 118, is " << last_msg_.contents[201]; - EXPECT_EQ(last_msg_.contents[202], 6) << "incorrect value for last_msg_.contents[202], expected 6, is " << last_msg_.contents[202]; - EXPECT_EQ(last_msg_.contents[203], 165) << "incorrect value for last_msg_.contents[203], expected 165, is " << last_msg_.contents[203]; - EXPECT_EQ(last_msg_.contents[204], 212) << "incorrect value for last_msg_.contents[204], expected 212, is " << last_msg_.contents[204]; - EXPECT_EQ(last_msg_.contents[205], 74) << "incorrect value for last_msg_.contents[205], expected 74, is " << last_msg_.contents[205]; - EXPECT_EQ(last_msg_.contents[206], 68) << "incorrect value for last_msg_.contents[206], expected 68, is " << last_msg_.contents[206]; - EXPECT_EQ(last_msg_.contents[207], 200) << "incorrect value for last_msg_.contents[207], expected 200, is " << last_msg_.contents[207]; - EXPECT_EQ(last_msg_.contents[208], 38) << "incorrect value for last_msg_.contents[208], expected 38, is " << last_msg_.contents[208]; - EXPECT_EQ(last_msg_.contents[209], 139) << "incorrect value for last_msg_.contents[209], expected 139, is " << last_msg_.contents[209]; - EXPECT_EQ(last_msg_.contents[210], 212) << "incorrect value for last_msg_.contents[210], expected 212, is " << last_msg_.contents[210]; - EXPECT_EQ(last_msg_.contents[211], 112) << "incorrect value for last_msg_.contents[211], expected 112, is " << last_msg_.contents[211]; - EXPECT_EQ(last_msg_.contents[212], 45) << "incorrect value for last_msg_.contents[212], expected 45, is " << last_msg_.contents[212]; - EXPECT_EQ(last_msg_.contents[213], 167) << "incorrect value for last_msg_.contents[213], expected 167, is " << last_msg_.contents[213]; - EXPECT_EQ(last_msg_.contents[214], 236) << "incorrect value for last_msg_.contents[214], expected 236, is " << last_msg_.contents[214]; - EXPECT_EQ(last_msg_.contents[215], 255) << "incorrect value for last_msg_.contents[215], expected 255, is " << last_msg_.contents[215]; - EXPECT_EQ(last_msg_.contents[216], 106) << "incorrect value for last_msg_.contents[216], expected 106, is " << last_msg_.contents[216]; - EXPECT_EQ(last_msg_.contents[217], 92) << "incorrect value for last_msg_.contents[217], expected 92, is " << last_msg_.contents[217]; - EXPECT_EQ(last_msg_.contents[218], 132) << "incorrect value for last_msg_.contents[218], expected 132, is " << last_msg_.contents[218]; - EXPECT_EQ(last_msg_.contents[219], 59) << "incorrect value for last_msg_.contents[219], expected 59, is " << last_msg_.contents[219]; - EXPECT_EQ(last_msg_.contents[220], 61) << "incorrect value for last_msg_.contents[220], expected 61, is " << last_msg_.contents[220]; - EXPECT_EQ(last_msg_.contents[221], 233) << "incorrect value for last_msg_.contents[221], expected 233, is " << last_msg_.contents[221]; - EXPECT_EQ(last_msg_.contents[222], 3) << "incorrect value for last_msg_.contents[222], expected 3, is " << last_msg_.contents[222]; - EXPECT_EQ(last_msg_.contents[223], 246) << "incorrect value for last_msg_.contents[223], expected 246, is " << last_msg_.contents[223]; - EXPECT_EQ(last_msg_.contents[224], 158) << "incorrect value for last_msg_.contents[224], expected 158, is " << last_msg_.contents[224]; - EXPECT_EQ(last_msg_.contents[225], 83) << "incorrect value for last_msg_.contents[225], expected 83, is " << last_msg_.contents[225]; - EXPECT_EQ(last_msg_.contents[226], 134) << "incorrect value for last_msg_.contents[226], expected 134, is " << last_msg_.contents[226]; - EXPECT_EQ(last_msg_.contents[227], 246) << "incorrect value for last_msg_.contents[227], expected 246, is " << last_msg_.contents[227]; - EXPECT_EQ(last_msg_.contents[228], 154) << "incorrect value for last_msg_.contents[228], expected 154, is " << last_msg_.contents[228]; - EXPECT_EQ(last_msg_.contents[229], 17) << "incorrect value for last_msg_.contents[229], expected 17, is " << last_msg_.contents[229]; - EXPECT_EQ(last_msg_.contents[230], 0) << "incorrect value for last_msg_.contents[230], expected 0, is " << last_msg_.contents[230]; - EXPECT_EQ(last_msg_.contents[231], 6) << "incorrect value for last_msg_.contents[231], expected 6, is " << last_msg_.contents[231]; - EXPECT_EQ(last_msg_.contents[232], 56) << "incorrect value for last_msg_.contents[232], expected 56, is " << last_msg_.contents[232]; - EXPECT_EQ(last_msg_.contents[233], 216) << "incorrect value for last_msg_.contents[233], expected 216, is " << last_msg_.contents[233]; - EXPECT_EQ(last_msg_.contents[234], 19) << "incorrect value for last_msg_.contents[234], expected 19, is " << last_msg_.contents[234]; - EXPECT_EQ(last_msg_.contents[235], 216) << "incorrect value for last_msg_.contents[235], expected 216, is " << last_msg_.contents[235]; - EXPECT_EQ(last_msg_.contents[236], 70) << "incorrect value for last_msg_.contents[236], expected 70, is " << last_msg_.contents[236]; - EXPECT_EQ(last_msg_.contents[237], 71) << "incorrect value for last_msg_.contents[237], expected 71, is " << last_msg_.contents[237]; - EXPECT_EQ(last_msg_.contents[238], 161) << "incorrect value for last_msg_.contents[238], expected 161, is " << last_msg_.contents[238]; - EXPECT_EQ(last_msg_.contents[239], 184) << "incorrect value for last_msg_.contents[239], expected 184, is " << last_msg_.contents[239]; - EXPECT_EQ(last_msg_.contents[240], 5) << "incorrect value for last_msg_.contents[240], expected 5, is " << last_msg_.contents[240]; - EXPECT_EQ(last_msg_.contents[241], 177) << "incorrect value for last_msg_.contents[241], expected 177, is " << last_msg_.contents[241]; - EXPECT_EQ(last_msg_.contents[242], 45) << "incorrect value for last_msg_.contents[242], expected 45, is " << last_msg_.contents[242]; - EXPECT_EQ(last_msg_.contents[243], 37) << "incorrect value for last_msg_.contents[243], expected 37, is " << last_msg_.contents[243]; - EXPECT_EQ(last_msg_.contents[244], 98) << "incorrect value for last_msg_.contents[244], expected 98, is " << last_msg_.contents[244]; - EXPECT_EQ(last_msg_.contents[245], 56) << "incorrect value for last_msg_.contents[245], expected 56, is " << last_msg_.contents[245]; - EXPECT_EQ(last_msg_.contents[246], 149) << "incorrect value for last_msg_.contents[246], expected 149, is " << last_msg_.contents[246]; - EXPECT_EQ(last_msg_.contents[247], 0) << "incorrect value for last_msg_.contents[247], expected 0, is " << last_msg_.contents[247]; - EXPECT_EQ(last_msg_.contents[248], 73) << "incorrect value for last_msg_.contents[248], expected 73, is " << last_msg_.contents[248]; - EXPECT_EQ(last_msg_.contents[249], 221) << "incorrect value for last_msg_.contents[249], expected 221, is " << last_msg_.contents[249]; - EXPECT_EQ(last_msg_.contents[250], 105) << "incorrect value for last_msg_.contents[250], expected 105, is " << last_msg_.contents[250]; - EXPECT_EQ(last_msg_.contents[251], 239) << "incorrect value for last_msg_.contents[251], expected 239, is " << last_msg_.contents[251]; - EXPECT_EQ(last_msg_.contents[252], 168) << "incorrect value for last_msg_.contents[252], expected 168, is " << last_msg_.contents[252]; - EXPECT_EQ(last_msg_.contents[253], 205) << "incorrect value for last_msg_.contents[253], expected 205, is " << last_msg_.contents[253]; - EXPECT_EQ(last_msg_.contents[254], 85) << "incorrect value for last_msg_.contents[254], expected 85, is " << last_msg_.contents[254]; - { - const char check_string[] = { (char)118,(char)97,(char)114,(char)97,(char)114,(char)114,(char)97,(char)121,(char)45,(char)108,(char)101,(char)110 }; - EXPECT_EQ(memcmp(last_msg_.n_contents.handle_as, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_contents.handle_as, expected string '" << check_string << "', is '" << last_msg_.n_contents.handle_as << "'"; - } - { - const char check_string[] = { (char)99,(char)111,(char)110,(char)116,(char)101,(char)110,(char)116,(char)115 }; - EXPECT_EQ(memcmp(last_msg_.n_contents.relates_to, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_.n_contents.relates_to, expected string '" << check_string << "', is '" << last_msg_.n_contents.relates_to << "'"; - } - EXPECT_EQ(last_msg_.n_contents.value, 255) << "incorrect value for last_msg_.n_contents.value, expected 255, is " << last_msg_.n_contents.value; +}; + +TEST_F(Test_auto_check_sbp_user_MsgUserData0, Test) { + uint8_t encoded_frame[] = { + 85, 0, 8, 126, 33, 255, 53, 5, 172, 138, 50, 49, 206, 234, 149, + 204, 113, 31, 108, 188, 179, 154, 156, 167, 145, 139, 42, 207, 126, 242, + 193, 9, 58, 75, 8, 135, 11, 92, 131, 245, 24, 90, 255, 30, 58, + 31, 109, 148, 56, 178, 140, 30, 159, 70, 17, 170, 50, 148, 1, 99, + 112, 88, 217, 36, 84, 34, 234, 82, 144, 144, 97, 96, 75, 174, 58, + 219, 180, 148, 247, 59, 2, 116, 214, 114, 55, 134, 54, 119, 108, 128, + 73, 181, 20, 233, 23, 23, 73, 119, 136, 231, 189, 26, 174, 128, 93, + 30, 76, 45, 109, 134, 81, 0, 116, 158, 127, 40, 133, 208, 134, 127, + 140, 232, 183, 184, 108, 6, 228, 54, 238, 59, 220, 30, 228, 212, 50, + 182, 97, 20, 41, 76, 227, 88, 12, 95, 112, 209, 183, 127, 4, 165, + 189, 44, 239, 232, 132, 9, 114, 184, 249, 208, 246, 194, 250, 2, 97, + 173, 157, 202, 172, 180, 150, 213, 193, 177, 209, 156, 20, 174, 18, 73, + 132, 215, 115, 128, 175, 169, 116, 132, 100, 72, 45, 25, 14, 205, 213, + 145, 68, 137, 249, 54, 40, 174, 215, 148, 166, 190, 63, 118, 6, 165, + 212, 74, 68, 200, 38, 139, 212, 112, 45, 167, 236, 255, 106, 92, 132, + 59, 61, 233, 3, 246, 158, 83, 134, 246, 154, 17, 0, 6, 56, 216, + 19, 216, 70, 71, 161, 184, 5, 177, 45, 37, 98, 56, 149, 0, 73, + 221, 105, 239, 168, 205, 85, 81, 245, + }; + + sbp_msg_user_data_t test_msg{}; + + test_msg.contents[0] = 53; + + test_msg.contents[1] = 5; + + test_msg.contents[2] = 172; + + test_msg.contents[3] = 138; + + test_msg.contents[4] = 50; + + test_msg.contents[5] = 49; + + test_msg.contents[6] = 206; + + test_msg.contents[7] = 234; + + test_msg.contents[8] = 149; + + test_msg.contents[9] = 204; + + test_msg.contents[10] = 113; + + test_msg.contents[11] = 31; + + test_msg.contents[12] = 108; + + test_msg.contents[13] = 188; + + test_msg.contents[14] = 179; + + test_msg.contents[15] = 154; + + test_msg.contents[16] = 156; + + test_msg.contents[17] = 167; + + test_msg.contents[18] = 145; + + test_msg.contents[19] = 139; + + test_msg.contents[20] = 42; + + test_msg.contents[21] = 207; + + test_msg.contents[22] = 126; + + test_msg.contents[23] = 242; + + test_msg.contents[24] = 193; + + test_msg.contents[25] = 9; + + test_msg.contents[26] = 58; + + test_msg.contents[27] = 75; + + test_msg.contents[28] = 8; + + test_msg.contents[29] = 135; + + test_msg.contents[30] = 11; + + test_msg.contents[31] = 92; + + test_msg.contents[32] = 131; + + test_msg.contents[33] = 245; + + test_msg.contents[34] = 24; + + test_msg.contents[35] = 90; + + test_msg.contents[36] = 255; + + test_msg.contents[37] = 30; + + test_msg.contents[38] = 58; + + test_msg.contents[39] = 31; + + test_msg.contents[40] = 109; + + test_msg.contents[41] = 148; + + test_msg.contents[42] = 56; + + test_msg.contents[43] = 178; + + test_msg.contents[44] = 140; + + test_msg.contents[45] = 30; + + test_msg.contents[46] = 159; + + test_msg.contents[47] = 70; + + test_msg.contents[48] = 17; + + test_msg.contents[49] = 170; + + test_msg.contents[50] = 50; + + test_msg.contents[51] = 148; + + test_msg.contents[52] = 1; + + test_msg.contents[53] = 99; + + test_msg.contents[54] = 112; + + test_msg.contents[55] = 88; + + test_msg.contents[56] = 217; + + test_msg.contents[57] = 36; + + test_msg.contents[58] = 84; + + test_msg.contents[59] = 34; + + test_msg.contents[60] = 234; + + test_msg.contents[61] = 82; + + test_msg.contents[62] = 144; + + test_msg.contents[63] = 144; + + test_msg.contents[64] = 97; + + test_msg.contents[65] = 96; + + test_msg.contents[66] = 75; + + test_msg.contents[67] = 174; + + test_msg.contents[68] = 58; + + test_msg.contents[69] = 219; + + test_msg.contents[70] = 180; + + test_msg.contents[71] = 148; + + test_msg.contents[72] = 247; + + test_msg.contents[73] = 59; + + test_msg.contents[74] = 2; + + test_msg.contents[75] = 116; + + test_msg.contents[76] = 214; + + test_msg.contents[77] = 114; + + test_msg.contents[78] = 55; + + test_msg.contents[79] = 134; + + test_msg.contents[80] = 54; + + test_msg.contents[81] = 119; + + test_msg.contents[82] = 108; + + test_msg.contents[83] = 128; + + test_msg.contents[84] = 73; + + test_msg.contents[85] = 181; + + test_msg.contents[86] = 20; + + test_msg.contents[87] = 233; + + test_msg.contents[88] = 23; + + test_msg.contents[89] = 23; + + test_msg.contents[90] = 73; + + test_msg.contents[91] = 119; + + test_msg.contents[92] = 136; + + test_msg.contents[93] = 231; + + test_msg.contents[94] = 189; + + test_msg.contents[95] = 26; + + test_msg.contents[96] = 174; + + test_msg.contents[97] = 128; + + test_msg.contents[98] = 93; + + test_msg.contents[99] = 30; + + test_msg.contents[100] = 76; + + test_msg.contents[101] = 45; + + test_msg.contents[102] = 109; + + test_msg.contents[103] = 134; + + test_msg.contents[104] = 81; + + test_msg.contents[105] = 0; + + test_msg.contents[106] = 116; + + test_msg.contents[107] = 158; + + test_msg.contents[108] = 127; + + test_msg.contents[109] = 40; + + test_msg.contents[110] = 133; + + test_msg.contents[111] = 208; + + test_msg.contents[112] = 134; + + test_msg.contents[113] = 127; + + test_msg.contents[114] = 140; + + test_msg.contents[115] = 232; + + test_msg.contents[116] = 183; + + test_msg.contents[117] = 184; + + test_msg.contents[118] = 108; + + test_msg.contents[119] = 6; + + test_msg.contents[120] = 228; + + test_msg.contents[121] = 54; + + test_msg.contents[122] = 238; + + test_msg.contents[123] = 59; + + test_msg.contents[124] = 220; + + test_msg.contents[125] = 30; + + test_msg.contents[126] = 228; + + test_msg.contents[127] = 212; + + test_msg.contents[128] = 50; + + test_msg.contents[129] = 182; + + test_msg.contents[130] = 97; + + test_msg.contents[131] = 20; + + test_msg.contents[132] = 41; + + test_msg.contents[133] = 76; + + test_msg.contents[134] = 227; + + test_msg.contents[135] = 88; + + test_msg.contents[136] = 12; + + test_msg.contents[137] = 95; + + test_msg.contents[138] = 112; + + test_msg.contents[139] = 209; + + test_msg.contents[140] = 183; + + test_msg.contents[141] = 127; + + test_msg.contents[142] = 4; + + test_msg.contents[143] = 165; + + test_msg.contents[144] = 189; + + test_msg.contents[145] = 44; + + test_msg.contents[146] = 239; + + test_msg.contents[147] = 232; + + test_msg.contents[148] = 132; + + test_msg.contents[149] = 9; + + test_msg.contents[150] = 114; + + test_msg.contents[151] = 184; + + test_msg.contents[152] = 249; + + test_msg.contents[153] = 208; + + test_msg.contents[154] = 246; + + test_msg.contents[155] = 194; + + test_msg.contents[156] = 250; + + test_msg.contents[157] = 2; + + test_msg.contents[158] = 97; + + test_msg.contents[159] = 173; + + test_msg.contents[160] = 157; + + test_msg.contents[161] = 202; + + test_msg.contents[162] = 172; + + test_msg.contents[163] = 180; + + test_msg.contents[164] = 150; + + test_msg.contents[165] = 213; + + test_msg.contents[166] = 193; + + test_msg.contents[167] = 177; + + test_msg.contents[168] = 209; + + test_msg.contents[169] = 156; + + test_msg.contents[170] = 20; + + test_msg.contents[171] = 174; + + test_msg.contents[172] = 18; + + test_msg.contents[173] = 73; + + test_msg.contents[174] = 132; + + test_msg.contents[175] = 215; + + test_msg.contents[176] = 115; + + test_msg.contents[177] = 128; + + test_msg.contents[178] = 175; + + test_msg.contents[179] = 169; + + test_msg.contents[180] = 116; + + test_msg.contents[181] = 132; + + test_msg.contents[182] = 100; + + test_msg.contents[183] = 72; + + test_msg.contents[184] = 45; + + test_msg.contents[185] = 25; + + test_msg.contents[186] = 14; + + test_msg.contents[187] = 205; + + test_msg.contents[188] = 213; + + test_msg.contents[189] = 145; + + test_msg.contents[190] = 68; + + test_msg.contents[191] = 137; + + test_msg.contents[192] = 249; + + test_msg.contents[193] = 54; + + test_msg.contents[194] = 40; + + test_msg.contents[195] = 174; + + test_msg.contents[196] = 215; + + test_msg.contents[197] = 148; + + test_msg.contents[198] = 166; + + test_msg.contents[199] = 190; + + test_msg.contents[200] = 63; + + test_msg.contents[201] = 118; + + test_msg.contents[202] = 6; + + test_msg.contents[203] = 165; + + test_msg.contents[204] = 212; + + test_msg.contents[205] = 74; + + test_msg.contents[206] = 68; + + test_msg.contents[207] = 200; + + test_msg.contents[208] = 38; + + test_msg.contents[209] = 139; + + test_msg.contents[210] = 212; + + test_msg.contents[211] = 112; + + test_msg.contents[212] = 45; + + test_msg.contents[213] = 167; + + test_msg.contents[214] = 236; + + test_msg.contents[215] = 255; + + test_msg.contents[216] = 106; + + test_msg.contents[217] = 92; + + test_msg.contents[218] = 132; + + test_msg.contents[219] = 59; + + test_msg.contents[220] = 61; + + test_msg.contents[221] = 233; + + test_msg.contents[222] = 3; + + test_msg.contents[223] = 246; + + test_msg.contents[224] = 158; + + test_msg.contents[225] = 83; + + test_msg.contents[226] = 134; + + test_msg.contents[227] = 246; + + test_msg.contents[228] = 154; + + test_msg.contents[229] = 17; + + test_msg.contents[230] = 0; + + test_msg.contents[231] = 6; + + test_msg.contents[232] = 56; + + test_msg.contents[233] = 216; + + test_msg.contents[234] = 19; + + test_msg.contents[235] = 216; + + test_msg.contents[236] = 70; + + test_msg.contents[237] = 71; + + test_msg.contents[238] = 161; + + test_msg.contents[239] = 184; + + test_msg.contents[240] = 5; + + test_msg.contents[241] = 177; + + test_msg.contents[242] = 45; + + test_msg.contents[243] = 37; + + test_msg.contents[244] = 98; + + test_msg.contents[245] = 56; + + test_msg.contents[246] = 149; + + test_msg.contents[247] = 0; + + test_msg.contents[248] = 73; + + test_msg.contents[249] = 221; + + test_msg.contents[250] = 105; + + test_msg.contents[251] = 239; + + test_msg.contents[252] = 168; + + test_msg.contents[253] = 205; + + test_msg.contents[254] = 85; + { + const char assign_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + memcpy(test_msg.n_contents.handle_as, assign_string, sizeof(assign_string)); + } + { + const char assign_string[] = {(char)99, (char)111, (char)110, (char)116, + (char)101, (char)110, (char)116, (char)115}; + memcpy(test_msg.n_contents.relates_to, assign_string, + sizeof(assign_string)); + } + test_msg.n_contents.value = 255; + + EXPECT_EQ(send_message(8574, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 8574); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.contents[0], 53) + << "incorrect value for last_msg_.contents[0], expected 53, is " + << last_msg_.contents[0]; + EXPECT_EQ(last_msg_.contents[1], 5) + << "incorrect value for last_msg_.contents[1], expected 5, is " + << last_msg_.contents[1]; + EXPECT_EQ(last_msg_.contents[2], 172) + << "incorrect value for last_msg_.contents[2], expected 172, is " + << last_msg_.contents[2]; + EXPECT_EQ(last_msg_.contents[3], 138) + << "incorrect value for last_msg_.contents[3], expected 138, is " + << last_msg_.contents[3]; + EXPECT_EQ(last_msg_.contents[4], 50) + << "incorrect value for last_msg_.contents[4], expected 50, is " + << last_msg_.contents[4]; + EXPECT_EQ(last_msg_.contents[5], 49) + << "incorrect value for last_msg_.contents[5], expected 49, is " + << last_msg_.contents[5]; + EXPECT_EQ(last_msg_.contents[6], 206) + << "incorrect value for last_msg_.contents[6], expected 206, is " + << last_msg_.contents[6]; + EXPECT_EQ(last_msg_.contents[7], 234) + << "incorrect value for last_msg_.contents[7], expected 234, is " + << last_msg_.contents[7]; + EXPECT_EQ(last_msg_.contents[8], 149) + << "incorrect value for last_msg_.contents[8], expected 149, is " + << last_msg_.contents[8]; + EXPECT_EQ(last_msg_.contents[9], 204) + << "incorrect value for last_msg_.contents[9], expected 204, is " + << last_msg_.contents[9]; + EXPECT_EQ(last_msg_.contents[10], 113) + << "incorrect value for last_msg_.contents[10], expected 113, is " + << last_msg_.contents[10]; + EXPECT_EQ(last_msg_.contents[11], 31) + << "incorrect value for last_msg_.contents[11], expected 31, is " + << last_msg_.contents[11]; + EXPECT_EQ(last_msg_.contents[12], 108) + << "incorrect value for last_msg_.contents[12], expected 108, is " + << last_msg_.contents[12]; + EXPECT_EQ(last_msg_.contents[13], 188) + << "incorrect value for last_msg_.contents[13], expected 188, is " + << last_msg_.contents[13]; + EXPECT_EQ(last_msg_.contents[14], 179) + << "incorrect value for last_msg_.contents[14], expected 179, is " + << last_msg_.contents[14]; + EXPECT_EQ(last_msg_.contents[15], 154) + << "incorrect value for last_msg_.contents[15], expected 154, is " + << last_msg_.contents[15]; + EXPECT_EQ(last_msg_.contents[16], 156) + << "incorrect value for last_msg_.contents[16], expected 156, is " + << last_msg_.contents[16]; + EXPECT_EQ(last_msg_.contents[17], 167) + << "incorrect value for last_msg_.contents[17], expected 167, is " + << last_msg_.contents[17]; + EXPECT_EQ(last_msg_.contents[18], 145) + << "incorrect value for last_msg_.contents[18], expected 145, is " + << last_msg_.contents[18]; + EXPECT_EQ(last_msg_.contents[19], 139) + << "incorrect value for last_msg_.contents[19], expected 139, is " + << last_msg_.contents[19]; + EXPECT_EQ(last_msg_.contents[20], 42) + << "incorrect value for last_msg_.contents[20], expected 42, is " + << last_msg_.contents[20]; + EXPECT_EQ(last_msg_.contents[21], 207) + << "incorrect value for last_msg_.contents[21], expected 207, is " + << last_msg_.contents[21]; + EXPECT_EQ(last_msg_.contents[22], 126) + << "incorrect value for last_msg_.contents[22], expected 126, is " + << last_msg_.contents[22]; + EXPECT_EQ(last_msg_.contents[23], 242) + << "incorrect value for last_msg_.contents[23], expected 242, is " + << last_msg_.contents[23]; + EXPECT_EQ(last_msg_.contents[24], 193) + << "incorrect value for last_msg_.contents[24], expected 193, is " + << last_msg_.contents[24]; + EXPECT_EQ(last_msg_.contents[25], 9) + << "incorrect value for last_msg_.contents[25], expected 9, is " + << last_msg_.contents[25]; + EXPECT_EQ(last_msg_.contents[26], 58) + << "incorrect value for last_msg_.contents[26], expected 58, is " + << last_msg_.contents[26]; + EXPECT_EQ(last_msg_.contents[27], 75) + << "incorrect value for last_msg_.contents[27], expected 75, is " + << last_msg_.contents[27]; + EXPECT_EQ(last_msg_.contents[28], 8) + << "incorrect value for last_msg_.contents[28], expected 8, is " + << last_msg_.contents[28]; + EXPECT_EQ(last_msg_.contents[29], 135) + << "incorrect value for last_msg_.contents[29], expected 135, is " + << last_msg_.contents[29]; + EXPECT_EQ(last_msg_.contents[30], 11) + << "incorrect value for last_msg_.contents[30], expected 11, is " + << last_msg_.contents[30]; + EXPECT_EQ(last_msg_.contents[31], 92) + << "incorrect value for last_msg_.contents[31], expected 92, is " + << last_msg_.contents[31]; + EXPECT_EQ(last_msg_.contents[32], 131) + << "incorrect value for last_msg_.contents[32], expected 131, is " + << last_msg_.contents[32]; + EXPECT_EQ(last_msg_.contents[33], 245) + << "incorrect value for last_msg_.contents[33], expected 245, is " + << last_msg_.contents[33]; + EXPECT_EQ(last_msg_.contents[34], 24) + << "incorrect value for last_msg_.contents[34], expected 24, is " + << last_msg_.contents[34]; + EXPECT_EQ(last_msg_.contents[35], 90) + << "incorrect value for last_msg_.contents[35], expected 90, is " + << last_msg_.contents[35]; + EXPECT_EQ(last_msg_.contents[36], 255) + << "incorrect value for last_msg_.contents[36], expected 255, is " + << last_msg_.contents[36]; + EXPECT_EQ(last_msg_.contents[37], 30) + << "incorrect value for last_msg_.contents[37], expected 30, is " + << last_msg_.contents[37]; + EXPECT_EQ(last_msg_.contents[38], 58) + << "incorrect value for last_msg_.contents[38], expected 58, is " + << last_msg_.contents[38]; + EXPECT_EQ(last_msg_.contents[39], 31) + << "incorrect value for last_msg_.contents[39], expected 31, is " + << last_msg_.contents[39]; + EXPECT_EQ(last_msg_.contents[40], 109) + << "incorrect value for last_msg_.contents[40], expected 109, is " + << last_msg_.contents[40]; + EXPECT_EQ(last_msg_.contents[41], 148) + << "incorrect value for last_msg_.contents[41], expected 148, is " + << last_msg_.contents[41]; + EXPECT_EQ(last_msg_.contents[42], 56) + << "incorrect value for last_msg_.contents[42], expected 56, is " + << last_msg_.contents[42]; + EXPECT_EQ(last_msg_.contents[43], 178) + << "incorrect value for last_msg_.contents[43], expected 178, is " + << last_msg_.contents[43]; + EXPECT_EQ(last_msg_.contents[44], 140) + << "incorrect value for last_msg_.contents[44], expected 140, is " + << last_msg_.contents[44]; + EXPECT_EQ(last_msg_.contents[45], 30) + << "incorrect value for last_msg_.contents[45], expected 30, is " + << last_msg_.contents[45]; + EXPECT_EQ(last_msg_.contents[46], 159) + << "incorrect value for last_msg_.contents[46], expected 159, is " + << last_msg_.contents[46]; + EXPECT_EQ(last_msg_.contents[47], 70) + << "incorrect value for last_msg_.contents[47], expected 70, is " + << last_msg_.contents[47]; + EXPECT_EQ(last_msg_.contents[48], 17) + << "incorrect value for last_msg_.contents[48], expected 17, is " + << last_msg_.contents[48]; + EXPECT_EQ(last_msg_.contents[49], 170) + << "incorrect value for last_msg_.contents[49], expected 170, is " + << last_msg_.contents[49]; + EXPECT_EQ(last_msg_.contents[50], 50) + << "incorrect value for last_msg_.contents[50], expected 50, is " + << last_msg_.contents[50]; + EXPECT_EQ(last_msg_.contents[51], 148) + << "incorrect value for last_msg_.contents[51], expected 148, is " + << last_msg_.contents[51]; + EXPECT_EQ(last_msg_.contents[52], 1) + << "incorrect value for last_msg_.contents[52], expected 1, is " + << last_msg_.contents[52]; + EXPECT_EQ(last_msg_.contents[53], 99) + << "incorrect value for last_msg_.contents[53], expected 99, is " + << last_msg_.contents[53]; + EXPECT_EQ(last_msg_.contents[54], 112) + << "incorrect value for last_msg_.contents[54], expected 112, is " + << last_msg_.contents[54]; + EXPECT_EQ(last_msg_.contents[55], 88) + << "incorrect value for last_msg_.contents[55], expected 88, is " + << last_msg_.contents[55]; + EXPECT_EQ(last_msg_.contents[56], 217) + << "incorrect value for last_msg_.contents[56], expected 217, is " + << last_msg_.contents[56]; + EXPECT_EQ(last_msg_.contents[57], 36) + << "incorrect value for last_msg_.contents[57], expected 36, is " + << last_msg_.contents[57]; + EXPECT_EQ(last_msg_.contents[58], 84) + << "incorrect value for last_msg_.contents[58], expected 84, is " + << last_msg_.contents[58]; + EXPECT_EQ(last_msg_.contents[59], 34) + << "incorrect value for last_msg_.contents[59], expected 34, is " + << last_msg_.contents[59]; + EXPECT_EQ(last_msg_.contents[60], 234) + << "incorrect value for last_msg_.contents[60], expected 234, is " + << last_msg_.contents[60]; + EXPECT_EQ(last_msg_.contents[61], 82) + << "incorrect value for last_msg_.contents[61], expected 82, is " + << last_msg_.contents[61]; + EXPECT_EQ(last_msg_.contents[62], 144) + << "incorrect value for last_msg_.contents[62], expected 144, is " + << last_msg_.contents[62]; + EXPECT_EQ(last_msg_.contents[63], 144) + << "incorrect value for last_msg_.contents[63], expected 144, is " + << last_msg_.contents[63]; + EXPECT_EQ(last_msg_.contents[64], 97) + << "incorrect value for last_msg_.contents[64], expected 97, is " + << last_msg_.contents[64]; + EXPECT_EQ(last_msg_.contents[65], 96) + << "incorrect value for last_msg_.contents[65], expected 96, is " + << last_msg_.contents[65]; + EXPECT_EQ(last_msg_.contents[66], 75) + << "incorrect value for last_msg_.contents[66], expected 75, is " + << last_msg_.contents[66]; + EXPECT_EQ(last_msg_.contents[67], 174) + << "incorrect value for last_msg_.contents[67], expected 174, is " + << last_msg_.contents[67]; + EXPECT_EQ(last_msg_.contents[68], 58) + << "incorrect value for last_msg_.contents[68], expected 58, is " + << last_msg_.contents[68]; + EXPECT_EQ(last_msg_.contents[69], 219) + << "incorrect value for last_msg_.contents[69], expected 219, is " + << last_msg_.contents[69]; + EXPECT_EQ(last_msg_.contents[70], 180) + << "incorrect value for last_msg_.contents[70], expected 180, is " + << last_msg_.contents[70]; + EXPECT_EQ(last_msg_.contents[71], 148) + << "incorrect value for last_msg_.contents[71], expected 148, is " + << last_msg_.contents[71]; + EXPECT_EQ(last_msg_.contents[72], 247) + << "incorrect value for last_msg_.contents[72], expected 247, is " + << last_msg_.contents[72]; + EXPECT_EQ(last_msg_.contents[73], 59) + << "incorrect value for last_msg_.contents[73], expected 59, is " + << last_msg_.contents[73]; + EXPECT_EQ(last_msg_.contents[74], 2) + << "incorrect value for last_msg_.contents[74], expected 2, is " + << last_msg_.contents[74]; + EXPECT_EQ(last_msg_.contents[75], 116) + << "incorrect value for last_msg_.contents[75], expected 116, is " + << last_msg_.contents[75]; + EXPECT_EQ(last_msg_.contents[76], 214) + << "incorrect value for last_msg_.contents[76], expected 214, is " + << last_msg_.contents[76]; + EXPECT_EQ(last_msg_.contents[77], 114) + << "incorrect value for last_msg_.contents[77], expected 114, is " + << last_msg_.contents[77]; + EXPECT_EQ(last_msg_.contents[78], 55) + << "incorrect value for last_msg_.contents[78], expected 55, is " + << last_msg_.contents[78]; + EXPECT_EQ(last_msg_.contents[79], 134) + << "incorrect value for last_msg_.contents[79], expected 134, is " + << last_msg_.contents[79]; + EXPECT_EQ(last_msg_.contents[80], 54) + << "incorrect value for last_msg_.contents[80], expected 54, is " + << last_msg_.contents[80]; + EXPECT_EQ(last_msg_.contents[81], 119) + << "incorrect value for last_msg_.contents[81], expected 119, is " + << last_msg_.contents[81]; + EXPECT_EQ(last_msg_.contents[82], 108) + << "incorrect value for last_msg_.contents[82], expected 108, is " + << last_msg_.contents[82]; + EXPECT_EQ(last_msg_.contents[83], 128) + << "incorrect value for last_msg_.contents[83], expected 128, is " + << last_msg_.contents[83]; + EXPECT_EQ(last_msg_.contents[84], 73) + << "incorrect value for last_msg_.contents[84], expected 73, is " + << last_msg_.contents[84]; + EXPECT_EQ(last_msg_.contents[85], 181) + << "incorrect value for last_msg_.contents[85], expected 181, is " + << last_msg_.contents[85]; + EXPECT_EQ(last_msg_.contents[86], 20) + << "incorrect value for last_msg_.contents[86], expected 20, is " + << last_msg_.contents[86]; + EXPECT_EQ(last_msg_.contents[87], 233) + << "incorrect value for last_msg_.contents[87], expected 233, is " + << last_msg_.contents[87]; + EXPECT_EQ(last_msg_.contents[88], 23) + << "incorrect value for last_msg_.contents[88], expected 23, is " + << last_msg_.contents[88]; + EXPECT_EQ(last_msg_.contents[89], 23) + << "incorrect value for last_msg_.contents[89], expected 23, is " + << last_msg_.contents[89]; + EXPECT_EQ(last_msg_.contents[90], 73) + << "incorrect value for last_msg_.contents[90], expected 73, is " + << last_msg_.contents[90]; + EXPECT_EQ(last_msg_.contents[91], 119) + << "incorrect value for last_msg_.contents[91], expected 119, is " + << last_msg_.contents[91]; + EXPECT_EQ(last_msg_.contents[92], 136) + << "incorrect value for last_msg_.contents[92], expected 136, is " + << last_msg_.contents[92]; + EXPECT_EQ(last_msg_.contents[93], 231) + << "incorrect value for last_msg_.contents[93], expected 231, is " + << last_msg_.contents[93]; + EXPECT_EQ(last_msg_.contents[94], 189) + << "incorrect value for last_msg_.contents[94], expected 189, is " + << last_msg_.contents[94]; + EXPECT_EQ(last_msg_.contents[95], 26) + << "incorrect value for last_msg_.contents[95], expected 26, is " + << last_msg_.contents[95]; + EXPECT_EQ(last_msg_.contents[96], 174) + << "incorrect value for last_msg_.contents[96], expected 174, is " + << last_msg_.contents[96]; + EXPECT_EQ(last_msg_.contents[97], 128) + << "incorrect value for last_msg_.contents[97], expected 128, is " + << last_msg_.contents[97]; + EXPECT_EQ(last_msg_.contents[98], 93) + << "incorrect value for last_msg_.contents[98], expected 93, is " + << last_msg_.contents[98]; + EXPECT_EQ(last_msg_.contents[99], 30) + << "incorrect value for last_msg_.contents[99], expected 30, is " + << last_msg_.contents[99]; + EXPECT_EQ(last_msg_.contents[100], 76) + << "incorrect value for last_msg_.contents[100], expected 76, is " + << last_msg_.contents[100]; + EXPECT_EQ(last_msg_.contents[101], 45) + << "incorrect value for last_msg_.contents[101], expected 45, is " + << last_msg_.contents[101]; + EXPECT_EQ(last_msg_.contents[102], 109) + << "incorrect value for last_msg_.contents[102], expected 109, is " + << last_msg_.contents[102]; + EXPECT_EQ(last_msg_.contents[103], 134) + << "incorrect value for last_msg_.contents[103], expected 134, is " + << last_msg_.contents[103]; + EXPECT_EQ(last_msg_.contents[104], 81) + << "incorrect value for last_msg_.contents[104], expected 81, is " + << last_msg_.contents[104]; + EXPECT_EQ(last_msg_.contents[105], 0) + << "incorrect value for last_msg_.contents[105], expected 0, is " + << last_msg_.contents[105]; + EXPECT_EQ(last_msg_.contents[106], 116) + << "incorrect value for last_msg_.contents[106], expected 116, is " + << last_msg_.contents[106]; + EXPECT_EQ(last_msg_.contents[107], 158) + << "incorrect value for last_msg_.contents[107], expected 158, is " + << last_msg_.contents[107]; + EXPECT_EQ(last_msg_.contents[108], 127) + << "incorrect value for last_msg_.contents[108], expected 127, is " + << last_msg_.contents[108]; + EXPECT_EQ(last_msg_.contents[109], 40) + << "incorrect value for last_msg_.contents[109], expected 40, is " + << last_msg_.contents[109]; + EXPECT_EQ(last_msg_.contents[110], 133) + << "incorrect value for last_msg_.contents[110], expected 133, is " + << last_msg_.contents[110]; + EXPECT_EQ(last_msg_.contents[111], 208) + << "incorrect value for last_msg_.contents[111], expected 208, is " + << last_msg_.contents[111]; + EXPECT_EQ(last_msg_.contents[112], 134) + << "incorrect value for last_msg_.contents[112], expected 134, is " + << last_msg_.contents[112]; + EXPECT_EQ(last_msg_.contents[113], 127) + << "incorrect value for last_msg_.contents[113], expected 127, is " + << last_msg_.contents[113]; + EXPECT_EQ(last_msg_.contents[114], 140) + << "incorrect value for last_msg_.contents[114], expected 140, is " + << last_msg_.contents[114]; + EXPECT_EQ(last_msg_.contents[115], 232) + << "incorrect value for last_msg_.contents[115], expected 232, is " + << last_msg_.contents[115]; + EXPECT_EQ(last_msg_.contents[116], 183) + << "incorrect value for last_msg_.contents[116], expected 183, is " + << last_msg_.contents[116]; + EXPECT_EQ(last_msg_.contents[117], 184) + << "incorrect value for last_msg_.contents[117], expected 184, is " + << last_msg_.contents[117]; + EXPECT_EQ(last_msg_.contents[118], 108) + << "incorrect value for last_msg_.contents[118], expected 108, is " + << last_msg_.contents[118]; + EXPECT_EQ(last_msg_.contents[119], 6) + << "incorrect value for last_msg_.contents[119], expected 6, is " + << last_msg_.contents[119]; + EXPECT_EQ(last_msg_.contents[120], 228) + << "incorrect value for last_msg_.contents[120], expected 228, is " + << last_msg_.contents[120]; + EXPECT_EQ(last_msg_.contents[121], 54) + << "incorrect value for last_msg_.contents[121], expected 54, is " + << last_msg_.contents[121]; + EXPECT_EQ(last_msg_.contents[122], 238) + << "incorrect value for last_msg_.contents[122], expected 238, is " + << last_msg_.contents[122]; + EXPECT_EQ(last_msg_.contents[123], 59) + << "incorrect value for last_msg_.contents[123], expected 59, is " + << last_msg_.contents[123]; + EXPECT_EQ(last_msg_.contents[124], 220) + << "incorrect value for last_msg_.contents[124], expected 220, is " + << last_msg_.contents[124]; + EXPECT_EQ(last_msg_.contents[125], 30) + << "incorrect value for last_msg_.contents[125], expected 30, is " + << last_msg_.contents[125]; + EXPECT_EQ(last_msg_.contents[126], 228) + << "incorrect value for last_msg_.contents[126], expected 228, is " + << last_msg_.contents[126]; + EXPECT_EQ(last_msg_.contents[127], 212) + << "incorrect value for last_msg_.contents[127], expected 212, is " + << last_msg_.contents[127]; + EXPECT_EQ(last_msg_.contents[128], 50) + << "incorrect value for last_msg_.contents[128], expected 50, is " + << last_msg_.contents[128]; + EXPECT_EQ(last_msg_.contents[129], 182) + << "incorrect value for last_msg_.contents[129], expected 182, is " + << last_msg_.contents[129]; + EXPECT_EQ(last_msg_.contents[130], 97) + << "incorrect value for last_msg_.contents[130], expected 97, is " + << last_msg_.contents[130]; + EXPECT_EQ(last_msg_.contents[131], 20) + << "incorrect value for last_msg_.contents[131], expected 20, is " + << last_msg_.contents[131]; + EXPECT_EQ(last_msg_.contents[132], 41) + << "incorrect value for last_msg_.contents[132], expected 41, is " + << last_msg_.contents[132]; + EXPECT_EQ(last_msg_.contents[133], 76) + << "incorrect value for last_msg_.contents[133], expected 76, is " + << last_msg_.contents[133]; + EXPECT_EQ(last_msg_.contents[134], 227) + << "incorrect value for last_msg_.contents[134], expected 227, is " + << last_msg_.contents[134]; + EXPECT_EQ(last_msg_.contents[135], 88) + << "incorrect value for last_msg_.contents[135], expected 88, is " + << last_msg_.contents[135]; + EXPECT_EQ(last_msg_.contents[136], 12) + << "incorrect value for last_msg_.contents[136], expected 12, is " + << last_msg_.contents[136]; + EXPECT_EQ(last_msg_.contents[137], 95) + << "incorrect value for last_msg_.contents[137], expected 95, is " + << last_msg_.contents[137]; + EXPECT_EQ(last_msg_.contents[138], 112) + << "incorrect value for last_msg_.contents[138], expected 112, is " + << last_msg_.contents[138]; + EXPECT_EQ(last_msg_.contents[139], 209) + << "incorrect value for last_msg_.contents[139], expected 209, is " + << last_msg_.contents[139]; + EXPECT_EQ(last_msg_.contents[140], 183) + << "incorrect value for last_msg_.contents[140], expected 183, is " + << last_msg_.contents[140]; + EXPECT_EQ(last_msg_.contents[141], 127) + << "incorrect value for last_msg_.contents[141], expected 127, is " + << last_msg_.contents[141]; + EXPECT_EQ(last_msg_.contents[142], 4) + << "incorrect value for last_msg_.contents[142], expected 4, is " + << last_msg_.contents[142]; + EXPECT_EQ(last_msg_.contents[143], 165) + << "incorrect value for last_msg_.contents[143], expected 165, is " + << last_msg_.contents[143]; + EXPECT_EQ(last_msg_.contents[144], 189) + << "incorrect value for last_msg_.contents[144], expected 189, is " + << last_msg_.contents[144]; + EXPECT_EQ(last_msg_.contents[145], 44) + << "incorrect value for last_msg_.contents[145], expected 44, is " + << last_msg_.contents[145]; + EXPECT_EQ(last_msg_.contents[146], 239) + << "incorrect value for last_msg_.contents[146], expected 239, is " + << last_msg_.contents[146]; + EXPECT_EQ(last_msg_.contents[147], 232) + << "incorrect value for last_msg_.contents[147], expected 232, is " + << last_msg_.contents[147]; + EXPECT_EQ(last_msg_.contents[148], 132) + << "incorrect value for last_msg_.contents[148], expected 132, is " + << last_msg_.contents[148]; + EXPECT_EQ(last_msg_.contents[149], 9) + << "incorrect value for last_msg_.contents[149], expected 9, is " + << last_msg_.contents[149]; + EXPECT_EQ(last_msg_.contents[150], 114) + << "incorrect value for last_msg_.contents[150], expected 114, is " + << last_msg_.contents[150]; + EXPECT_EQ(last_msg_.contents[151], 184) + << "incorrect value for last_msg_.contents[151], expected 184, is " + << last_msg_.contents[151]; + EXPECT_EQ(last_msg_.contents[152], 249) + << "incorrect value for last_msg_.contents[152], expected 249, is " + << last_msg_.contents[152]; + EXPECT_EQ(last_msg_.contents[153], 208) + << "incorrect value for last_msg_.contents[153], expected 208, is " + << last_msg_.contents[153]; + EXPECT_EQ(last_msg_.contents[154], 246) + << "incorrect value for last_msg_.contents[154], expected 246, is " + << last_msg_.contents[154]; + EXPECT_EQ(last_msg_.contents[155], 194) + << "incorrect value for last_msg_.contents[155], expected 194, is " + << last_msg_.contents[155]; + EXPECT_EQ(last_msg_.contents[156], 250) + << "incorrect value for last_msg_.contents[156], expected 250, is " + << last_msg_.contents[156]; + EXPECT_EQ(last_msg_.contents[157], 2) + << "incorrect value for last_msg_.contents[157], expected 2, is " + << last_msg_.contents[157]; + EXPECT_EQ(last_msg_.contents[158], 97) + << "incorrect value for last_msg_.contents[158], expected 97, is " + << last_msg_.contents[158]; + EXPECT_EQ(last_msg_.contents[159], 173) + << "incorrect value for last_msg_.contents[159], expected 173, is " + << last_msg_.contents[159]; + EXPECT_EQ(last_msg_.contents[160], 157) + << "incorrect value for last_msg_.contents[160], expected 157, is " + << last_msg_.contents[160]; + EXPECT_EQ(last_msg_.contents[161], 202) + << "incorrect value for last_msg_.contents[161], expected 202, is " + << last_msg_.contents[161]; + EXPECT_EQ(last_msg_.contents[162], 172) + << "incorrect value for last_msg_.contents[162], expected 172, is " + << last_msg_.contents[162]; + EXPECT_EQ(last_msg_.contents[163], 180) + << "incorrect value for last_msg_.contents[163], expected 180, is " + << last_msg_.contents[163]; + EXPECT_EQ(last_msg_.contents[164], 150) + << "incorrect value for last_msg_.contents[164], expected 150, is " + << last_msg_.contents[164]; + EXPECT_EQ(last_msg_.contents[165], 213) + << "incorrect value for last_msg_.contents[165], expected 213, is " + << last_msg_.contents[165]; + EXPECT_EQ(last_msg_.contents[166], 193) + << "incorrect value for last_msg_.contents[166], expected 193, is " + << last_msg_.contents[166]; + EXPECT_EQ(last_msg_.contents[167], 177) + << "incorrect value for last_msg_.contents[167], expected 177, is " + << last_msg_.contents[167]; + EXPECT_EQ(last_msg_.contents[168], 209) + << "incorrect value for last_msg_.contents[168], expected 209, is " + << last_msg_.contents[168]; + EXPECT_EQ(last_msg_.contents[169], 156) + << "incorrect value for last_msg_.contents[169], expected 156, is " + << last_msg_.contents[169]; + EXPECT_EQ(last_msg_.contents[170], 20) + << "incorrect value for last_msg_.contents[170], expected 20, is " + << last_msg_.contents[170]; + EXPECT_EQ(last_msg_.contents[171], 174) + << "incorrect value for last_msg_.contents[171], expected 174, is " + << last_msg_.contents[171]; + EXPECT_EQ(last_msg_.contents[172], 18) + << "incorrect value for last_msg_.contents[172], expected 18, is " + << last_msg_.contents[172]; + EXPECT_EQ(last_msg_.contents[173], 73) + << "incorrect value for last_msg_.contents[173], expected 73, is " + << last_msg_.contents[173]; + EXPECT_EQ(last_msg_.contents[174], 132) + << "incorrect value for last_msg_.contents[174], expected 132, is " + << last_msg_.contents[174]; + EXPECT_EQ(last_msg_.contents[175], 215) + << "incorrect value for last_msg_.contents[175], expected 215, is " + << last_msg_.contents[175]; + EXPECT_EQ(last_msg_.contents[176], 115) + << "incorrect value for last_msg_.contents[176], expected 115, is " + << last_msg_.contents[176]; + EXPECT_EQ(last_msg_.contents[177], 128) + << "incorrect value for last_msg_.contents[177], expected 128, is " + << last_msg_.contents[177]; + EXPECT_EQ(last_msg_.contents[178], 175) + << "incorrect value for last_msg_.contents[178], expected 175, is " + << last_msg_.contents[178]; + EXPECT_EQ(last_msg_.contents[179], 169) + << "incorrect value for last_msg_.contents[179], expected 169, is " + << last_msg_.contents[179]; + EXPECT_EQ(last_msg_.contents[180], 116) + << "incorrect value for last_msg_.contents[180], expected 116, is " + << last_msg_.contents[180]; + EXPECT_EQ(last_msg_.contents[181], 132) + << "incorrect value for last_msg_.contents[181], expected 132, is " + << last_msg_.contents[181]; + EXPECT_EQ(last_msg_.contents[182], 100) + << "incorrect value for last_msg_.contents[182], expected 100, is " + << last_msg_.contents[182]; + EXPECT_EQ(last_msg_.contents[183], 72) + << "incorrect value for last_msg_.contents[183], expected 72, is " + << last_msg_.contents[183]; + EXPECT_EQ(last_msg_.contents[184], 45) + << "incorrect value for last_msg_.contents[184], expected 45, is " + << last_msg_.contents[184]; + EXPECT_EQ(last_msg_.contents[185], 25) + << "incorrect value for last_msg_.contents[185], expected 25, is " + << last_msg_.contents[185]; + EXPECT_EQ(last_msg_.contents[186], 14) + << "incorrect value for last_msg_.contents[186], expected 14, is " + << last_msg_.contents[186]; + EXPECT_EQ(last_msg_.contents[187], 205) + << "incorrect value for last_msg_.contents[187], expected 205, is " + << last_msg_.contents[187]; + EXPECT_EQ(last_msg_.contents[188], 213) + << "incorrect value for last_msg_.contents[188], expected 213, is " + << last_msg_.contents[188]; + EXPECT_EQ(last_msg_.contents[189], 145) + << "incorrect value for last_msg_.contents[189], expected 145, is " + << last_msg_.contents[189]; + EXPECT_EQ(last_msg_.contents[190], 68) + << "incorrect value for last_msg_.contents[190], expected 68, is " + << last_msg_.contents[190]; + EXPECT_EQ(last_msg_.contents[191], 137) + << "incorrect value for last_msg_.contents[191], expected 137, is " + << last_msg_.contents[191]; + EXPECT_EQ(last_msg_.contents[192], 249) + << "incorrect value for last_msg_.contents[192], expected 249, is " + << last_msg_.contents[192]; + EXPECT_EQ(last_msg_.contents[193], 54) + << "incorrect value for last_msg_.contents[193], expected 54, is " + << last_msg_.contents[193]; + EXPECT_EQ(last_msg_.contents[194], 40) + << "incorrect value for last_msg_.contents[194], expected 40, is " + << last_msg_.contents[194]; + EXPECT_EQ(last_msg_.contents[195], 174) + << "incorrect value for last_msg_.contents[195], expected 174, is " + << last_msg_.contents[195]; + EXPECT_EQ(last_msg_.contents[196], 215) + << "incorrect value for last_msg_.contents[196], expected 215, is " + << last_msg_.contents[196]; + EXPECT_EQ(last_msg_.contents[197], 148) + << "incorrect value for last_msg_.contents[197], expected 148, is " + << last_msg_.contents[197]; + EXPECT_EQ(last_msg_.contents[198], 166) + << "incorrect value for last_msg_.contents[198], expected 166, is " + << last_msg_.contents[198]; + EXPECT_EQ(last_msg_.contents[199], 190) + << "incorrect value for last_msg_.contents[199], expected 190, is " + << last_msg_.contents[199]; + EXPECT_EQ(last_msg_.contents[200], 63) + << "incorrect value for last_msg_.contents[200], expected 63, is " + << last_msg_.contents[200]; + EXPECT_EQ(last_msg_.contents[201], 118) + << "incorrect value for last_msg_.contents[201], expected 118, is " + << last_msg_.contents[201]; + EXPECT_EQ(last_msg_.contents[202], 6) + << "incorrect value for last_msg_.contents[202], expected 6, is " + << last_msg_.contents[202]; + EXPECT_EQ(last_msg_.contents[203], 165) + << "incorrect value for last_msg_.contents[203], expected 165, is " + << last_msg_.contents[203]; + EXPECT_EQ(last_msg_.contents[204], 212) + << "incorrect value for last_msg_.contents[204], expected 212, is " + << last_msg_.contents[204]; + EXPECT_EQ(last_msg_.contents[205], 74) + << "incorrect value for last_msg_.contents[205], expected 74, is " + << last_msg_.contents[205]; + EXPECT_EQ(last_msg_.contents[206], 68) + << "incorrect value for last_msg_.contents[206], expected 68, is " + << last_msg_.contents[206]; + EXPECT_EQ(last_msg_.contents[207], 200) + << "incorrect value for last_msg_.contents[207], expected 200, is " + << last_msg_.contents[207]; + EXPECT_EQ(last_msg_.contents[208], 38) + << "incorrect value for last_msg_.contents[208], expected 38, is " + << last_msg_.contents[208]; + EXPECT_EQ(last_msg_.contents[209], 139) + << "incorrect value for last_msg_.contents[209], expected 139, is " + << last_msg_.contents[209]; + EXPECT_EQ(last_msg_.contents[210], 212) + << "incorrect value for last_msg_.contents[210], expected 212, is " + << last_msg_.contents[210]; + EXPECT_EQ(last_msg_.contents[211], 112) + << "incorrect value for last_msg_.contents[211], expected 112, is " + << last_msg_.contents[211]; + EXPECT_EQ(last_msg_.contents[212], 45) + << "incorrect value for last_msg_.contents[212], expected 45, is " + << last_msg_.contents[212]; + EXPECT_EQ(last_msg_.contents[213], 167) + << "incorrect value for last_msg_.contents[213], expected 167, is " + << last_msg_.contents[213]; + EXPECT_EQ(last_msg_.contents[214], 236) + << "incorrect value for last_msg_.contents[214], expected 236, is " + << last_msg_.contents[214]; + EXPECT_EQ(last_msg_.contents[215], 255) + << "incorrect value for last_msg_.contents[215], expected 255, is " + << last_msg_.contents[215]; + EXPECT_EQ(last_msg_.contents[216], 106) + << "incorrect value for last_msg_.contents[216], expected 106, is " + << last_msg_.contents[216]; + EXPECT_EQ(last_msg_.contents[217], 92) + << "incorrect value for last_msg_.contents[217], expected 92, is " + << last_msg_.contents[217]; + EXPECT_EQ(last_msg_.contents[218], 132) + << "incorrect value for last_msg_.contents[218], expected 132, is " + << last_msg_.contents[218]; + EXPECT_EQ(last_msg_.contents[219], 59) + << "incorrect value for last_msg_.contents[219], expected 59, is " + << last_msg_.contents[219]; + EXPECT_EQ(last_msg_.contents[220], 61) + << "incorrect value for last_msg_.contents[220], expected 61, is " + << last_msg_.contents[220]; + EXPECT_EQ(last_msg_.contents[221], 233) + << "incorrect value for last_msg_.contents[221], expected 233, is " + << last_msg_.contents[221]; + EXPECT_EQ(last_msg_.contents[222], 3) + << "incorrect value for last_msg_.contents[222], expected 3, is " + << last_msg_.contents[222]; + EXPECT_EQ(last_msg_.contents[223], 246) + << "incorrect value for last_msg_.contents[223], expected 246, is " + << last_msg_.contents[223]; + EXPECT_EQ(last_msg_.contents[224], 158) + << "incorrect value for last_msg_.contents[224], expected 158, is " + << last_msg_.contents[224]; + EXPECT_EQ(last_msg_.contents[225], 83) + << "incorrect value for last_msg_.contents[225], expected 83, is " + << last_msg_.contents[225]; + EXPECT_EQ(last_msg_.contents[226], 134) + << "incorrect value for last_msg_.contents[226], expected 134, is " + << last_msg_.contents[226]; + EXPECT_EQ(last_msg_.contents[227], 246) + << "incorrect value for last_msg_.contents[227], expected 246, is " + << last_msg_.contents[227]; + EXPECT_EQ(last_msg_.contents[228], 154) + << "incorrect value for last_msg_.contents[228], expected 154, is " + << last_msg_.contents[228]; + EXPECT_EQ(last_msg_.contents[229], 17) + << "incorrect value for last_msg_.contents[229], expected 17, is " + << last_msg_.contents[229]; + EXPECT_EQ(last_msg_.contents[230], 0) + << "incorrect value for last_msg_.contents[230], expected 0, is " + << last_msg_.contents[230]; + EXPECT_EQ(last_msg_.contents[231], 6) + << "incorrect value for last_msg_.contents[231], expected 6, is " + << last_msg_.contents[231]; + EXPECT_EQ(last_msg_.contents[232], 56) + << "incorrect value for last_msg_.contents[232], expected 56, is " + << last_msg_.contents[232]; + EXPECT_EQ(last_msg_.contents[233], 216) + << "incorrect value for last_msg_.contents[233], expected 216, is " + << last_msg_.contents[233]; + EXPECT_EQ(last_msg_.contents[234], 19) + << "incorrect value for last_msg_.contents[234], expected 19, is " + << last_msg_.contents[234]; + EXPECT_EQ(last_msg_.contents[235], 216) + << "incorrect value for last_msg_.contents[235], expected 216, is " + << last_msg_.contents[235]; + EXPECT_EQ(last_msg_.contents[236], 70) + << "incorrect value for last_msg_.contents[236], expected 70, is " + << last_msg_.contents[236]; + EXPECT_EQ(last_msg_.contents[237], 71) + << "incorrect value for last_msg_.contents[237], expected 71, is " + << last_msg_.contents[237]; + EXPECT_EQ(last_msg_.contents[238], 161) + << "incorrect value for last_msg_.contents[238], expected 161, is " + << last_msg_.contents[238]; + EXPECT_EQ(last_msg_.contents[239], 184) + << "incorrect value for last_msg_.contents[239], expected 184, is " + << last_msg_.contents[239]; + EXPECT_EQ(last_msg_.contents[240], 5) + << "incorrect value for last_msg_.contents[240], expected 5, is " + << last_msg_.contents[240]; + EXPECT_EQ(last_msg_.contents[241], 177) + << "incorrect value for last_msg_.contents[241], expected 177, is " + << last_msg_.contents[241]; + EXPECT_EQ(last_msg_.contents[242], 45) + << "incorrect value for last_msg_.contents[242], expected 45, is " + << last_msg_.contents[242]; + EXPECT_EQ(last_msg_.contents[243], 37) + << "incorrect value for last_msg_.contents[243], expected 37, is " + << last_msg_.contents[243]; + EXPECT_EQ(last_msg_.contents[244], 98) + << "incorrect value for last_msg_.contents[244], expected 98, is " + << last_msg_.contents[244]; + EXPECT_EQ(last_msg_.contents[245], 56) + << "incorrect value for last_msg_.contents[245], expected 56, is " + << last_msg_.contents[245]; + EXPECT_EQ(last_msg_.contents[246], 149) + << "incorrect value for last_msg_.contents[246], expected 149, is " + << last_msg_.contents[246]; + EXPECT_EQ(last_msg_.contents[247], 0) + << "incorrect value for last_msg_.contents[247], expected 0, is " + << last_msg_.contents[247]; + EXPECT_EQ(last_msg_.contents[248], 73) + << "incorrect value for last_msg_.contents[248], expected 73, is " + << last_msg_.contents[248]; + EXPECT_EQ(last_msg_.contents[249], 221) + << "incorrect value for last_msg_.contents[249], expected 221, is " + << last_msg_.contents[249]; + EXPECT_EQ(last_msg_.contents[250], 105) + << "incorrect value for last_msg_.contents[250], expected 105, is " + << last_msg_.contents[250]; + EXPECT_EQ(last_msg_.contents[251], 239) + << "incorrect value for last_msg_.contents[251], expected 239, is " + << last_msg_.contents[251]; + EXPECT_EQ(last_msg_.contents[252], 168) + << "incorrect value for last_msg_.contents[252], expected 168, is " + << last_msg_.contents[252]; + EXPECT_EQ(last_msg_.contents[253], 205) + << "incorrect value for last_msg_.contents[253], expected 205, is " + << last_msg_.contents[253]; + EXPECT_EQ(last_msg_.contents[254], 85) + << "incorrect value for last_msg_.contents[254], expected 85, is " + << last_msg_.contents[254]; + { + const char check_string[] = {(char)118, (char)97, (char)114, (char)97, + (char)114, (char)114, (char)97, (char)121, + (char)45, (char)108, (char)101, (char)110}; + EXPECT_EQ(memcmp(last_msg_.n_contents.handle_as, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_contents.handle_as, expected " + "string '" + << check_string << "', is '" << last_msg_.n_contents.handle_as << "'"; + } + { + const char check_string[] = {(char)99, (char)111, (char)110, (char)116, + (char)101, (char)110, (char)116, (char)115}; + EXPECT_EQ(memcmp(last_msg_.n_contents.relates_to, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_.n_contents.relates_to, expected " + "string '" + << check_string << "', is '" << last_msg_.n_contents.relates_to << "'"; + } + EXPECT_EQ(last_msg_.n_contents.value, 255) + << "incorrect value for last_msg_.n_contents.value, expected 255, is " + << last_msg_.n_contents.value; } diff --git a/c/test/cpp/auto_check_sbp_vehicle_MsgOdometry.cc b/c/test/cpp/auto_check_sbp_vehicle_MsgOdometry.cc index 3a84991f4..43d07685f 100644 --- a/c/test/cpp/auto_check_sbp_vehicle_MsgOdometry.cc +++ b/c/test/cpp/auto_check_sbp_vehicle_MsgOdometry.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgOdometry.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgOdometry.yaml by generate.py. Do +// not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_vehicle_MsgOdometry0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_vehicle_MsgOdometry0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_vehicle_MsgOdometry0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_vehicle_MsgOdometry0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_odometry_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_odometry_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,36 +67,41 @@ class Test_auto_check_sbp_vehicle_MsgOdometry0 : sbp_msg_odometry_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_vehicle_MsgOdometry0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_vehicle_MsgOdometry0, Test) { + uint8_t encoded_frame[] = { + 85, 3, 9, 66, 0, 9, 8, 0, 0, 0, 7, 0, 0, 0, 1, 52, 99, + }; - uint8_t encoded_frame[] = {85,3,9,66,0,9,8,0,0,0,7,0,0,0,1,52,99, }; + sbp_msg_odometry_t test_msg{}; + test_msg.flags = 1; + test_msg.tow = 8; + test_msg.velocity = 7; - sbp_msg_odometry_t test_msg{}; - test_msg.flags = 1; - test_msg.tow = 8; - test_msg.velocity = 7; - - EXPECT_EQ(send_message( 66, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.tow, 8) << "incorrect value for last_msg_.tow, expected 8, is " << last_msg_.tow; - EXPECT_EQ(last_msg_.velocity, 7) << "incorrect value for last_msg_.velocity, expected 7, is " << last_msg_.velocity; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.tow, 8) + << "incorrect value for last_msg_.tow, expected 8, is " << last_msg_.tow; + EXPECT_EQ(last_msg_.velocity, 7) + << "incorrect value for last_msg_.velocity, expected 7, is " + << last_msg_.velocity; } diff --git a/c/test/cpp/auto_check_sbp_vehicle_MsgWheeltick.cc b/c/test/cpp/auto_check_sbp_vehicle_MsgWheeltick.cc index 39f72ff43..6428f0519 100644 --- a/c/test/cpp/auto_check_sbp_vehicle_MsgWheeltick.cc +++ b/c/test/cpp/auto_check_sbp_vehicle_MsgWheeltick.cc @@ -10,60 +10,56 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgWheeltick.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgWheeltick.yaml by generate.py. +// Do not modify by hand! -#include #include -#include -#include #include -class Test_auto_check_sbp_vehicle_MsgWheeltick0 : - public ::testing::Test, - public sbp::State, - public sbp::IReader, - public sbp::IWriter, - sbp::MessageHandler -{ -public: - Test_auto_check_sbp_vehicle_MsgWheeltick0() : - ::testing::Test(), - sbp::State(), - sbp::IReader(), - sbp::IWriter(), - sbp::MessageHandler(this), +#include +#include +#include +class Test_auto_check_sbp_vehicle_MsgWheeltick0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_vehicle_MsgWheeltick0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, const sbp_msg_wheeltick_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_wheeltick_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; @@ -71,38 +67,47 @@ class Test_auto_check_sbp_vehicle_MsgWheeltick0 : sbp_msg_wheeltick_t last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_auto_check_sbp_vehicle_MsgWheeltick0, Test) -{ +}; + +TEST_F(Test_auto_check_sbp_vehicle_MsgWheeltick0, Test) { + uint8_t encoded_frame[] = { + 85, 4, 9, 107, 69, 14, 254, 27, 114, 44, 26, + 0, 0, 0, 1, 146, 225, 51, 9, 210, 36, 56, + }; - uint8_t encoded_frame[] = {85,4,9,107,69,14,254,27,114,44,26,0,0,0,1,146,225,51,9,210,36,56, }; + sbp_msg_wheeltick_t test_msg{}; + test_msg.flags = 1; + test_msg.source = 146; + test_msg.ticks = -771148831; + test_msg.time = 112414825470; - sbp_msg_wheeltick_t test_msg{}; - test_msg.flags = 1; - test_msg.source = 146; - test_msg.ticks = -771148831; - test_msg.time = 112414825470; - - EXPECT_EQ(send_message( 17771, test_msg), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(17771, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 17771); - EXPECT_EQ(last_msg_, test_msg); - EXPECT_EQ(last_msg_.flags, 1) << "incorrect value for last_msg_.flags, expected 1, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.source, 146) << "incorrect value for last_msg_.source, expected 146, is " << last_msg_.source; - EXPECT_EQ(last_msg_.ticks, -771148831) << "incorrect value for last_msg_.ticks, expected -771148831, is " << last_msg_.ticks; - EXPECT_EQ(last_msg_.time, 112414825470) << "incorrect value for last_msg_.time, expected 112414825470, is " << last_msg_.time; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 17771); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.flags, 1) + << "incorrect value for last_msg_.flags, expected 1, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.source, 146) + << "incorrect value for last_msg_.source, expected 146, is " + << last_msg_.source; + EXPECT_EQ(last_msg_.ticks, -771148831) + << "incorrect value for last_msg_.ticks, expected -771148831, is " + << last_msg_.ticks; + EXPECT_EQ(last_msg_.time, 112414825470) + << "incorrect value for last_msg_.time, expected 112414825470, is " + << last_msg_.time; } diff --git a/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResult.c b/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResult.c index 0ce16d540..0de865ded 100644 --- a/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResult.c +++ b/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResult.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResult.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResult.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include #include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResult ) -{ +START_TEST(test_legacy_auto_check_sbp_acquisition_MsgAcqResult) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResult ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,84 +128,107 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResult ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x2f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x2f, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x2f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x2f, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,47,0,195,4,14,0,0,104,65,102,102,144,66,205,196,0,70,8,0,207,189, }; + u8 encoded_frame[] = { + 85, 47, 0, 195, 4, 14, 0, 0, 104, 65, 102, + 102, 144, 66, 205, 196, 0, 70, 8, 0, 207, 189, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_t* test_msg = ( msg_acq_result_t* )test_msg_storage; + msg_acq_result_t *test_msg = (msg_acq_result_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = 8241.2001953125; test_msg->cn0 = 14.5; test_msg->cp = 72.19999694824219; test_msg->sid.code = 0; test_msg->sid.sat = 8; - sbp_payload_send(&sbp_state, 0x2f, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x2f, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x2f, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_t* check_msg = ( msg_acq_result_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_t *check_msg = (msg_acq_result_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - 8241.20019531*100) < 0.05, "incorrect value for cf, expected 8241.20019531, is %f", check_msg->cf); - ck_assert_msg((check_msg->cn0*100 - 14.5*100) < 0.05, "incorrect value for cn0, expected 14.5, is %f", check_msg->cn0); - ck_assert_msg((check_msg->cp*100 - 72.1999969482*100) < 0.05, "incorrect value for cp, expected 72.1999969482, is %f", check_msg->cp); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.sat == 8, "incorrect value for sid.sat, expected 8, is %d", check_msg->sid.sat); + ck_assert_msg((check_msg->cf * 100 - 8241.20019531 * 100) < 0.05, + "incorrect value for cf, expected 8241.20019531, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cn0 * 100 - 14.5 * 100) < 0.05, + "incorrect value for cn0, expected 14.5, is %f", + check_msg->cn0); + ck_assert_msg((check_msg->cp * 100 - 72.1999969482 * 100) < 0.05, + "incorrect value for cp, expected 72.1999969482, is %f", + check_msg->cp); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.sat == 8, + "incorrect value for sid.sat, expected 8, is %d", + check_msg->sid.sat); } } END_TEST -Suite* legacy_auto_check_sbp_acquisition_MsgAcqResult_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_acquisition_MsgAcqResult"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_acquisition_MsgAcqResult"); +Suite *legacy_auto_check_sbp_acquisition_MsgAcqResult_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_acquisition_MsgAcqResult"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_acquisition_MsgAcqResult"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_acquisition_MsgAcqResult); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResultDepA.c b/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResultDepA.c index efbcf9ee8..5f239bd34 100644 --- a/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResultDepA.c +++ b/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResultDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include #include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,79 +128,100 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x15, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x15, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x15, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x15, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,21,0,195,4,13,0,0,104,65,0,192,53,68,198,199,0,70,8,2,68, }; + u8 encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 0, 0, 104, 65, 0, + 192, 53, 68, 198, 199, 0, 70, 8, 2, 68, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_a_t* test_msg = ( msg_acq_result_dep_a_t* )test_msg_storage; + msg_acq_result_dep_a_t* test_msg = + (msg_acq_result_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = 8241.943359375; test_msg->cp = 727.0; test_msg->prn = 8; test_msg->snr = 14.5; - sbp_payload_send(&sbp_state, 0x15, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x15, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x15, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_a_t* check_msg = ( msg_acq_result_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_a_t* check_msg = + (msg_acq_result_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - 8241.94335938*100) < 0.05, "incorrect value for cf, expected 8241.94335938, is %f", check_msg->cf); - ck_assert_msg((check_msg->cp*100 - 727.0*100) < 0.05, "incorrect value for cp, expected 727.0, is %f", check_msg->cp); - ck_assert_msg(check_msg->prn == 8, "incorrect value for prn, expected 8, is %d", check_msg->prn); - ck_assert_msg((check_msg->snr*100 - 14.5*100) < 0.05, "incorrect value for snr, expected 14.5, is %f", check_msg->snr); + ck_assert_msg((check_msg->cf * 100 - 8241.94335938 * 100) < 0.05, + "incorrect value for cf, expected 8241.94335938, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cp * 100 - 727.0 * 100) < 0.05, + "incorrect value for cp, expected 727.0, is %f", + check_msg->cp); + ck_assert_msg(check_msg->prn == 8, + "incorrect value for prn, expected 8, is %d", check_msg->prn); + ck_assert_msg((check_msg->snr * 100 - 14.5 * 100) < 0.05, + "incorrect value for snr, expected 14.5, is %f", + check_msg->snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -211,79 +229,100 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x15, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x15, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x15, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x15, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,21,0,195,4,13,205,204,116,65,0,192,179,67,33,81,59,68,9,219,27, }; + u8 encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 116, 65, 0, + 192, 179, 67, 33, 81, 59, 68, 9, 219, 27, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_a_t* test_msg = ( msg_acq_result_dep_a_t* )test_msg_storage; + msg_acq_result_dep_a_t* test_msg = + (msg_acq_result_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = 749.2676391601562; test_msg->cp = 359.5; test_msg->prn = 9; test_msg->snr = 15.300000190734863; - sbp_payload_send(&sbp_state, 0x15, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x15, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x15, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_a_t* check_msg = ( msg_acq_result_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_a_t* check_msg = + (msg_acq_result_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - 749.26763916*100) < 0.05, "incorrect value for cf, expected 749.26763916, is %f", check_msg->cf); - ck_assert_msg((check_msg->cp*100 - 359.5*100) < 0.05, "incorrect value for cp, expected 359.5, is %f", check_msg->cp); - ck_assert_msg(check_msg->prn == 9, "incorrect value for prn, expected 9, is %d", check_msg->prn); - ck_assert_msg((check_msg->snr*100 - 15.3000001907*100) < 0.05, "incorrect value for snr, expected 15.3000001907, is %f", check_msg->snr); + ck_assert_msg((check_msg->cf * 100 - 749.26763916 * 100) < 0.05, + "incorrect value for cf, expected 749.26763916, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cp * 100 - 359.5 * 100) < 0.05, + "incorrect value for cp, expected 359.5, is %f", + check_msg->cp); + ck_assert_msg(check_msg->prn == 9, + "incorrect value for prn, expected 9, is %d", check_msg->prn); + ck_assert_msg((check_msg->snr * 100 - 15.3000001907 * 100) < 0.05, + "incorrect value for snr, expected 15.3000001907, is %f", + check_msg->snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -291,79 +330,101 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x15, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x15, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x15, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x15, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,21,0,195,4,13,205,204,144,65,0,0,34,66,57,237,202,197,11,150,35, }; + u8 encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 144, 65, 0, + 0, 34, 66, 57, 237, 202, 197, 11, 150, 35, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_a_t* test_msg = ( msg_acq_result_dep_a_t* )test_msg_storage; + msg_acq_result_dep_a_t* test_msg = + (msg_acq_result_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = -6493.65283203125; test_msg->cp = 40.5; test_msg->prn = 11; test_msg->snr = 18.100000381469727; - sbp_payload_send(&sbp_state, 0x15, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x15, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x15, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_a_t* check_msg = ( msg_acq_result_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_a_t* check_msg = + (msg_acq_result_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - -6493.65283203*100) < 0.05, "incorrect value for cf, expected -6493.65283203, is %f", check_msg->cf); - ck_assert_msg((check_msg->cp*100 - 40.5*100) < 0.05, "incorrect value for cp, expected 40.5, is %f", check_msg->cp); - ck_assert_msg(check_msg->prn == 11, "incorrect value for prn, expected 11, is %d", check_msg->prn); - ck_assert_msg((check_msg->snr*100 - 18.1000003815*100) < 0.05, "incorrect value for snr, expected 18.1000003815, is %f", check_msg->snr); + ck_assert_msg((check_msg->cf * 100 - -6493.65283203 * 100) < 0.05, + "incorrect value for cf, expected -6493.65283203, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cp * 100 - 40.5 * 100) < 0.05, + "incorrect value for cp, expected 40.5, is %f", + check_msg->cp); + ck_assert_msg(check_msg->prn == 11, + "incorrect value for prn, expected 11, is %d", + check_msg->prn); + ck_assert_msg((check_msg->snr * 100 - 18.1000003815 * 100) < 0.05, + "incorrect value for snr, expected 18.1000003815, is %f", + check_msg->snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -371,79 +432,101 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x15, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x15, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x15, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x15, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,21,0,195,4,13,205,204,116,65,0,32,9,68,129,193,121,196,12,146,118, }; + u8 encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 116, 65, 0, + 32, 9, 68, 129, 193, 121, 196, 12, 146, 118, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_a_t* test_msg = ( msg_acq_result_dep_a_t* )test_msg_storage; + msg_acq_result_dep_a_t* test_msg = + (msg_acq_result_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = -999.0234985351562; test_msg->cp = 548.5; test_msg->prn = 12; test_msg->snr = 15.300000190734863; - sbp_payload_send(&sbp_state, 0x15, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x15, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x15, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_a_t* check_msg = ( msg_acq_result_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_a_t* check_msg = + (msg_acq_result_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - -999.023498535*100) < 0.05, "incorrect value for cf, expected -999.023498535, is %f", check_msg->cf); - ck_assert_msg((check_msg->cp*100 - 548.5*100) < 0.05, "incorrect value for cp, expected 548.5, is %f", check_msg->cp); - ck_assert_msg(check_msg->prn == 12, "incorrect value for prn, expected 12, is %d", check_msg->prn); - ck_assert_msg((check_msg->snr*100 - 15.3000001907*100) < 0.05, "incorrect value for snr, expected 15.3000001907, is %f", check_msg->snr); + ck_assert_msg((check_msg->cf * 100 - -999.023498535 * 100) < 0.05, + "incorrect value for cf, expected -999.023498535, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cp * 100 - 548.5 * 100) < 0.05, + "incorrect value for cp, expected 548.5, is %f", + check_msg->cp); + ck_assert_msg(check_msg->prn == 12, + "incorrect value for prn, expected 12, is %d", + check_msg->prn); + ck_assert_msg((check_msg->snr * 100 - 15.3000001907 * 100) < 0.05, + "incorrect value for snr, expected 15.3000001907, is %f", + check_msg->snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -451,79 +534,101 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x15, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x15, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x15, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x15, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,21,0,195,4,13,205,204,116,65,0,32,67,68,228,74,148,69,14,23,75, }; + u8 encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 116, 65, 0, + 32, 67, 68, 228, 74, 148, 69, 14, 23, 75, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_a_t* test_msg = ( msg_acq_result_dep_a_t* )test_msg_storage; + msg_acq_result_dep_a_t* test_msg = + (msg_acq_result_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = 4745.361328125; test_msg->cp = 780.5; test_msg->prn = 14; test_msg->snr = 15.300000190734863; - sbp_payload_send(&sbp_state, 0x15, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x15, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x15, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_a_t* check_msg = ( msg_acq_result_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_a_t* check_msg = + (msg_acq_result_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - 4745.36132812*100) < 0.05, "incorrect value for cf, expected 4745.36132812, is %f", check_msg->cf); - ck_assert_msg((check_msg->cp*100 - 780.5*100) < 0.05, "incorrect value for cp, expected 780.5, is %f", check_msg->cp); - ck_assert_msg(check_msg->prn == 14, "incorrect value for prn, expected 14, is %d", check_msg->prn); - ck_assert_msg((check_msg->snr*100 - 15.3000001907*100) < 0.05, "incorrect value for snr, expected 15.3000001907, is %f", check_msg->snr); + ck_assert_msg((check_msg->cf * 100 - 4745.36132812 * 100) < 0.05, + "incorrect value for cf, expected 4745.36132812, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cp * 100 - 780.5 * 100) < 0.05, + "incorrect value for cp, expected 780.5, is %f", + check_msg->cp); + ck_assert_msg(check_msg->prn == 14, + "incorrect value for prn, expected 14, is %d", + check_msg->prn); + ck_assert_msg((check_msg->snr * 100 - 15.3000001907 * 100) < 0.05, + "incorrect value for snr, expected 15.3000001907, is %f", + check_msg->snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -531,83 +636,106 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x15, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x15, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x15, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x15, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,21,0,195,4,13,228,56,35,67,0,32,18,68,129,193,249,195,0,204,207, }; + u8 encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 228, 56, 35, 67, 0, + 32, 18, 68, 129, 193, 249, 195, 0, 204, 207, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_a_t* test_msg = ( msg_acq_result_dep_a_t* )test_msg_storage; + msg_acq_result_dep_a_t* test_msg = + (msg_acq_result_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = -499.5117492675781; test_msg->cp = 584.5; test_msg->prn = 0; test_msg->snr = 163.22222900390625; - sbp_payload_send(&sbp_state, 0x15, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x15, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x15, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_a_t* check_msg = ( msg_acq_result_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_a_t* check_msg = + (msg_acq_result_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - -499.511749268*100) < 0.05, "incorrect value for cf, expected -499.511749268, is %f", check_msg->cf); - ck_assert_msg((check_msg->cp*100 - 584.5*100) < 0.05, "incorrect value for cp, expected 584.5, is %f", check_msg->cp); - ck_assert_msg(check_msg->prn == 0, "incorrect value for prn, expected 0, is %d", check_msg->prn); - ck_assert_msg((check_msg->snr*100 - 163.222229004*100) < 0.05, "incorrect value for snr, expected 163.222229004, is %f", check_msg->snr); + ck_assert_msg((check_msg->cf * 100 - -499.511749268 * 100) < 0.05, + "incorrect value for cf, expected -499.511749268, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cp * 100 - 584.5 * 100) < 0.05, + "incorrect value for cp, expected 584.5, is %f", + check_msg->cp); + ck_assert_msg(check_msg->prn == 0, + "incorrect value for prn, expected 0, is %d", check_msg->prn); + ck_assert_msg((check_msg->snr * 100 - 163.222229004 * 100) < 0.05, + "incorrect value for snr, expected 163.222229004, is %f", + check_msg->snr); } } END_TEST -Suite* legacy_auto_check_sbp_acquisition_MsgAcqResultDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_acquisition_MsgAcqResultDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA); +Suite* legacy_auto_check_sbp_acquisition_MsgAcqResultDepA_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_acquisition_MsgAcqResultDepA"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResultDepB.c b/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResultDepB.c index 657a43567..caf97e892 100644 --- a/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResultDepB.c +++ b/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResultDepB.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include #include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB ) -{ +START_TEST(test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x14, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x14, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x14, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x14, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,20,0,246,215,16,137,167,18,66,0,0,161,67,240,24,156,69,9,0,0,0,80,195, }; + u8 encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 137, 167, 18, 66, 0, 0, + 161, 67, 240, 24, 156, 69, 9, 0, 0, 0, 80, 195, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_b_t* test_msg = ( msg_acq_result_dep_b_t* )test_msg_storage; + msg_acq_result_dep_b_t* test_msg = + (msg_acq_result_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = 4995.1171875; test_msg->cp = 322.0; @@ -149,65 +152,85 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB ) test_msg->sid.reserved = 0; test_msg->sid.sat = 9; test_msg->snr = 36.66360855102539; - sbp_payload_send(&sbp_state, 0x14, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x14, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x14, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_b_t* check_msg = ( msg_acq_result_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_b_t* check_msg = + (msg_acq_result_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - 4995.1171875*100) < 0.05, "incorrect value for cf, expected 4995.1171875, is %f", check_msg->cf); - ck_assert_msg((check_msg->cp*100 - 322.0*100) < 0.05, "incorrect value for cp, expected 322.0, is %f", check_msg->cp); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 9, "incorrect value for sid.sat, expected 9, is %d", check_msg->sid.sat); - ck_assert_msg((check_msg->snr*100 - 36.663608551*100) < 0.05, "incorrect value for snr, expected 36.663608551, is %f", check_msg->snr); + ck_assert_msg((check_msg->cf * 100 - 4995.1171875 * 100) < 0.05, + "incorrect value for cf, expected 4995.1171875, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cp * 100 - 322.0 * 100) < 0.05, + "incorrect value for cp, expected 322.0, is %f", + check_msg->cp); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 9, + "incorrect value for sid.sat, expected 9, is %d", + check_msg->sid.sat); + ck_assert_msg((check_msg->snr * 100 - 36.663608551 * 100) < 0.05, + "incorrect value for snr, expected 36.663608551, is %f", + check_msg->snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -215,17 +238,23 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x14, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x14, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x14, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x14, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,20,0,246,215,16,206,172,16,66,0,192,82,68,198,199,0,198,3,0,0,0,149,143, }; + u8 encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 206, 172, 16, 66, 0, 192, + 82, 68, 198, 199, 0, 198, 3, 0, 0, 0, 149, 143, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_b_t* test_msg = ( msg_acq_result_dep_b_t* )test_msg_storage; + msg_acq_result_dep_b_t* test_msg = + (msg_acq_result_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = -8241.943359375; test_msg->cp = 843.0; @@ -233,65 +262,85 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB ) test_msg->sid.reserved = 0; test_msg->sid.sat = 3; test_msg->snr = 36.16875457763672; - sbp_payload_send(&sbp_state, 0x14, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x14, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x14, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_b_t* check_msg = ( msg_acq_result_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_b_t* check_msg = + (msg_acq_result_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - -8241.94335938*100) < 0.05, "incorrect value for cf, expected -8241.94335938, is %f", check_msg->cf); - ck_assert_msg((check_msg->cp*100 - 843.0*100) < 0.05, "incorrect value for cp, expected 843.0, is %f", check_msg->cp); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 3, "incorrect value for sid.sat, expected 3, is %d", check_msg->sid.sat); - ck_assert_msg((check_msg->snr*100 - 36.1687545776*100) < 0.05, "incorrect value for snr, expected 36.1687545776, is %f", check_msg->snr); + ck_assert_msg((check_msg->cf * 100 - -8241.94335938 * 100) < 0.05, + "incorrect value for cf, expected -8241.94335938, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cp * 100 - 843.0 * 100) < 0.05, + "incorrect value for cp, expected 843.0, is %f", + check_msg->cp); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 3, + "incorrect value for sid.sat, expected 3, is %d", + check_msg->sid.sat); + ck_assert_msg((check_msg->snr * 100 - 36.1687545776 * 100) < 0.05, + "incorrect value for snr, expected 36.1687545776, is %f", + check_msg->snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -299,17 +348,23 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x14, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x14, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x14, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x14, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,20,0,246,215,16,228,27,15,66,0,128,70,68,228,74,148,69,18,0,0,0,179,155, }; + u8 encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 228, 27, 15, 66, 0, 128, + 70, 68, 228, 74, 148, 69, 18, 0, 0, 0, 179, 155, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_b_t* test_msg = ( msg_acq_result_dep_b_t* )test_msg_storage; + msg_acq_result_dep_b_t* test_msg = + (msg_acq_result_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = 4745.361328125; test_msg->cp = 794.0; @@ -317,65 +372,85 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB ) test_msg->sid.reserved = 0; test_msg->sid.sat = 18; test_msg->snr = 35.77723693847656; - sbp_payload_send(&sbp_state, 0x14, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x14, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x14, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_b_t* check_msg = ( msg_acq_result_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_b_t* check_msg = + (msg_acq_result_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - 4745.36132812*100) < 0.05, "incorrect value for cf, expected 4745.36132812, is %f", check_msg->cf); - ck_assert_msg((check_msg->cp*100 - 794.0*100) < 0.05, "incorrect value for cp, expected 794.0, is %f", check_msg->cp); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 18, "incorrect value for sid.sat, expected 18, is %d", check_msg->sid.sat); - ck_assert_msg((check_msg->snr*100 - 35.7772369385*100) < 0.05, "incorrect value for snr, expected 35.7772369385, is %f", check_msg->snr); + ck_assert_msg((check_msg->cf * 100 - 4745.36132812 * 100) < 0.05, + "incorrect value for cf, expected 4745.36132812, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cp * 100 - 794.0 * 100) < 0.05, + "incorrect value for cp, expected 794.0, is %f", + check_msg->cp); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 18, + "incorrect value for sid.sat, expected 18, is %d", + check_msg->sid.sat); + ck_assert_msg((check_msg->snr * 100 - 35.7772369385 * 100) < 0.05, + "incorrect value for snr, expected 35.7772369385, is %f", + check_msg->snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -383,17 +458,23 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x14, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x14, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x14, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x14, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,20,0,246,215,16,46,199,14,66,0,64,129,67,240,24,28,69,17,0,0,0,18,181, }; + u8 encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 46, 199, 14, 66, 0, 64, + 129, 67, 240, 24, 28, 69, 17, 0, 0, 0, 18, 181, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_b_t* test_msg = ( msg_acq_result_dep_b_t* )test_msg_storage; + msg_acq_result_dep_b_t* test_msg = + (msg_acq_result_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = 2497.55859375; test_msg->cp = 258.5; @@ -401,65 +482,85 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB ) test_msg->sid.reserved = 0; test_msg->sid.sat = 17; test_msg->snr = 35.69451141357422; - sbp_payload_send(&sbp_state, 0x14, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x14, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x14, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_b_t* check_msg = ( msg_acq_result_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_b_t* check_msg = + (msg_acq_result_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - 2497.55859375*100) < 0.05, "incorrect value for cf, expected 2497.55859375, is %f", check_msg->cf); - ck_assert_msg((check_msg->cp*100 - 258.5*100) < 0.05, "incorrect value for cp, expected 258.5, is %f", check_msg->cp); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 17, "incorrect value for sid.sat, expected 17, is %d", check_msg->sid.sat); - ck_assert_msg((check_msg->snr*100 - 35.6945114136*100) < 0.05, "incorrect value for snr, expected 35.6945114136, is %f", check_msg->snr); + ck_assert_msg((check_msg->cf * 100 - 2497.55859375 * 100) < 0.05, + "incorrect value for cf, expected 2497.55859375, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cp * 100 - 258.5 * 100) < 0.05, + "incorrect value for cp, expected 258.5, is %f", + check_msg->cp); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 17, + "incorrect value for sid.sat, expected 17, is %d", + check_msg->sid.sat); + ck_assert_msg((check_msg->snr * 100 - 35.6945114136 * 100) < 0.05, + "incorrect value for snr, expected 35.6945114136, is %f", + check_msg->snr); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -467,17 +568,23 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x14, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x14, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x14, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x14, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,20,0,246,215,16,194,24,14,66,0,128,2,68,129,193,249,195,5,0,0,0,35,203, }; + u8 encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 194, 24, 14, 66, 0, 128, + 2, 68, 129, 193, 249, 195, 5, 0, 0, 0, 35, 203, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_b_t* test_msg = ( msg_acq_result_dep_b_t* )test_msg_storage; + msg_acq_result_dep_b_t* test_msg = + (msg_acq_result_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = -499.5117492675781; test_msg->cp = 522.0; @@ -485,69 +592,91 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB ) test_msg->sid.reserved = 0; test_msg->sid.sat = 5; test_msg->snr = 35.52417755126953; - sbp_payload_send(&sbp_state, 0x14, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x14, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x14, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_b_t* check_msg = ( msg_acq_result_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_b_t* check_msg = + (msg_acq_result_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - -499.511749268*100) < 0.05, "incorrect value for cf, expected -499.511749268, is %f", check_msg->cf); - ck_assert_msg((check_msg->cp*100 - 522.0*100) < 0.05, "incorrect value for cp, expected 522.0, is %f", check_msg->cp); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 5, "incorrect value for sid.sat, expected 5, is %d", check_msg->sid.sat); - ck_assert_msg((check_msg->snr*100 - 35.5241775513*100) < 0.05, "incorrect value for snr, expected 35.5241775513, is %f", check_msg->snr); + ck_assert_msg((check_msg->cf * 100 - -499.511749268 * 100) < 0.05, + "incorrect value for cf, expected -499.511749268, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cp * 100 - 522.0 * 100) < 0.05, + "incorrect value for cp, expected 522.0, is %f", + check_msg->cp); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 5, + "incorrect value for sid.sat, expected 5, is %d", + check_msg->sid.sat); + ck_assert_msg((check_msg->snr * 100 - 35.5241775513 * 100) < 0.05, + "incorrect value for snr, expected 35.5241775513, is %f", + check_msg->snr); } } END_TEST -Suite* legacy_auto_check_sbp_acquisition_MsgAcqResultDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_acquisition_MsgAcqResultDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB); +Suite* legacy_auto_check_sbp_acquisition_MsgAcqResultDepB_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_acquisition_MsgAcqResultDepB"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResultDepC.c b/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResultDepC.c index 46af86dbe..58d07b1f9 100644 --- a/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResultDepC.c +++ b/c/test/legacy/auto_check_sbp_acquisition_MsgAcqResultDepC.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepC.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include #include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC ) -{ +START_TEST(test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x1f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x1f, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x1f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x1f, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,31,0,40,12,16,72,9,34,66,155,152,228,67,28,34,221,68,10,0,0,0,9,189, }; + u8 encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 72, 9, 34, 66, 155, 152, + 228, 67, 28, 34, 221, 68, 10, 0, 0, 0, 9, 189, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_c_t* test_msg = ( msg_acq_result_dep_c_t* )test_msg_storage; + msg_acq_result_dep_c_t* test_msg = + (msg_acq_result_dep_c_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = 1769.06591796875; test_msg->cn0 = 40.509063720703125; @@ -149,65 +152,85 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC ) test_msg->sid.code = 0; test_msg->sid.reserved = 0; test_msg->sid.sat = 10; - sbp_payload_send(&sbp_state, 0x1f, 3112, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x1f, 3112, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 3112, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 3112, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x1f, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_c_t* check_msg = ( msg_acq_result_dep_c_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_c_t* check_msg = + (msg_acq_result_dep_c_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - 1769.06591797*100) < 0.05, "incorrect value for cf, expected 1769.06591797, is %f", check_msg->cf); - ck_assert_msg((check_msg->cn0*100 - 40.5090637207*100) < 0.05, "incorrect value for cn0, expected 40.5090637207, is %f", check_msg->cn0); - ck_assert_msg((check_msg->cp*100 - 457.192230225*100) < 0.05, "incorrect value for cp, expected 457.192230225, is %f", check_msg->cp); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 10, "incorrect value for sid.sat, expected 10, is %d", check_msg->sid.sat); + ck_assert_msg((check_msg->cf * 100 - 1769.06591797 * 100) < 0.05, + "incorrect value for cf, expected 1769.06591797, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cn0 * 100 - 40.5090637207 * 100) < 0.05, + "incorrect value for cn0, expected 40.5090637207, is %f", + check_msg->cn0); + ck_assert_msg((check_msg->cp * 100 - 457.192230225 * 100) < 0.05, + "incorrect value for cp, expected 457.192230225, is %f", + check_msg->cp); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 10, + "incorrect value for sid.sat, expected 10, is %d", + check_msg->sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -215,17 +238,23 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x1f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x1f, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x1f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x1f, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,31,0,40,12,16,132,250,45,66,207,93,88,68,68,185,252,195,6,0,0,0,136,185, }; + u8 encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 132, 250, 45, 66, 207, 93, + 88, 68, 68, 185, 252, 195, 6, 0, 0, 0, 136, 185, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_c_t* test_msg = ( msg_acq_result_dep_c_t* )test_msg_storage; + msg_acq_result_dep_c_t* test_msg = + (msg_acq_result_dep_c_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = -505.4473876953125; test_msg->cn0 = 43.49464416503906; @@ -233,65 +262,85 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC ) test_msg->sid.code = 0; test_msg->sid.reserved = 0; test_msg->sid.sat = 6; - sbp_payload_send(&sbp_state, 0x1f, 3112, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x1f, 3112, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 3112, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 3112, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x1f, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_c_t* check_msg = ( msg_acq_result_dep_c_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_c_t* check_msg = + (msg_acq_result_dep_c_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - -505.447387695*100) < 0.05, "incorrect value for cf, expected -505.447387695, is %f", check_msg->cf); - ck_assert_msg((check_msg->cn0*100 - 43.494644165*100) < 0.05, "incorrect value for cn0, expected 43.494644165, is %f", check_msg->cn0); - ck_assert_msg((check_msg->cp*100 - 865.465759277*100) < 0.05, "incorrect value for cp, expected 865.465759277, is %f", check_msg->cp); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 6, "incorrect value for sid.sat, expected 6, is %d", check_msg->sid.sat); + ck_assert_msg((check_msg->cf * 100 - -505.447387695 * 100) < 0.05, + "incorrect value for cf, expected -505.447387695, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cn0 * 100 - 43.494644165 * 100) < 0.05, + "incorrect value for cn0, expected 43.494644165, is %f", + check_msg->cn0); + ck_assert_msg((check_msg->cp * 100 - 865.465759277 * 100) < 0.05, + "incorrect value for cp, expected 865.465759277, is %f", + check_msg->cp); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 6, + "incorrect value for sid.sat, expected 6, is %d", + check_msg->sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -299,17 +348,23 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x1f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x1f, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x1f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x1f, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,31,0,40,12,16,163,223,24,66,64,91,102,67,202,243,157,196,13,0,0,0,150,161, }; + u8 encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 163, 223, 24, 66, 64, 91, + 102, 67, 202, 243, 157, 196, 13, 0, 0, 0, 150, 161, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_c_t* test_msg = ( msg_acq_result_dep_c_t* )test_msg_storage; + msg_acq_result_dep_c_t* test_msg = + (msg_acq_result_dep_c_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = -1263.618408203125; test_msg->cn0 = 38.2183952331543; @@ -317,65 +372,85 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC ) test_msg->sid.code = 0; test_msg->sid.reserved = 0; test_msg->sid.sat = 13; - sbp_payload_send(&sbp_state, 0x1f, 3112, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x1f, 3112, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 3112, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 3112, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x1f, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_c_t* check_msg = ( msg_acq_result_dep_c_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_c_t* check_msg = + (msg_acq_result_dep_c_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - -1263.6184082*100) < 0.05, "incorrect value for cf, expected -1263.6184082, is %f", check_msg->cf); - ck_assert_msg((check_msg->cn0*100 - 38.2183952332*100) < 0.05, "incorrect value for cn0, expected 38.2183952332, is %f", check_msg->cn0); - ck_assert_msg((check_msg->cp*100 - 230.356445312*100) < 0.05, "incorrect value for cp, expected 230.356445312, is %f", check_msg->cp); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 13, "incorrect value for sid.sat, expected 13, is %d", check_msg->sid.sat); + ck_assert_msg((check_msg->cf * 100 - -1263.6184082 * 100) < 0.05, + "incorrect value for cf, expected -1263.6184082, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cn0 * 100 - 38.2183952332 * 100) < 0.05, + "incorrect value for cn0, expected 38.2183952332, is %f", + check_msg->cn0); + ck_assert_msg((check_msg->cp * 100 - 230.356445312 * 100) < 0.05, + "incorrect value for cp, expected 230.356445312, is %f", + check_msg->cp); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 13, + "incorrect value for sid.sat, expected 13, is %d", + check_msg->sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -383,17 +458,23 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x1f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x1f, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x1f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x1f, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,31,0,40,12,16,129,65,21,66,224,214,124,67,243,138,61,69,1,0,0,0,109,209, }; + u8 encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 129, 65, 21, 66, 224, 214, + 124, 67, 243, 138, 61, 69, 1, 0, 0, 0, 109, 209, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_c_t* test_msg = ( msg_acq_result_dep_c_t* )test_msg_storage; + msg_acq_result_dep_c_t* test_msg = + (msg_acq_result_dep_c_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = 3032.684326171875; test_msg->cn0 = 37.313968658447266; @@ -401,65 +482,85 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC ) test_msg->sid.code = 0; test_msg->sid.reserved = 0; test_msg->sid.sat = 1; - sbp_payload_send(&sbp_state, 0x1f, 3112, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x1f, 3112, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 3112, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 3112, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x1f, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_c_t* check_msg = ( msg_acq_result_dep_c_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_c_t* check_msg = + (msg_acq_result_dep_c_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - 3032.68432617*100) < 0.05, "incorrect value for cf, expected 3032.68432617, is %f", check_msg->cf); - ck_assert_msg((check_msg->cn0*100 - 37.3139686584*100) < 0.05, "incorrect value for cn0, expected 37.3139686584, is %f", check_msg->cn0); - ck_assert_msg((check_msg->cp*100 - 252.839355469*100) < 0.05, "incorrect value for cp, expected 252.839355469, is %f", check_msg->cp); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 1, "incorrect value for sid.sat, expected 1, is %d", check_msg->sid.sat); + ck_assert_msg((check_msg->cf * 100 - 3032.68432617 * 100) < 0.05, + "incorrect value for cf, expected 3032.68432617, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cn0 * 100 - 37.3139686584 * 100) < 0.05, + "incorrect value for cn0, expected 37.3139686584, is %f", + check_msg->cn0); + ck_assert_msg((check_msg->cp * 100 - 252.839355469 * 100) < 0.05, + "incorrect value for cp, expected 252.839355469, is %f", + check_msg->cp); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 1, + "incorrect value for sid.sat, expected 1, is %d", + check_msg->sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -467,17 +568,23 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x1f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x1f, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x1f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x1f, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,31,0,40,12,16,126,35,62,66,226,37,102,68,202,243,29,69,27,0,0,0,91,67, }; + u8 encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 126, 35, 62, 66, 226, 37, + 102, 68, 202, 243, 29, 69, 27, 0, 0, 0, 91, 67, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_result_dep_c_t* test_msg = ( msg_acq_result_dep_c_t* )test_msg_storage; + msg_acq_result_dep_c_t* test_msg = + (msg_acq_result_dep_c_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cf = 2527.23681640625; test_msg->cn0 = 47.53466033935547; @@ -485,69 +592,91 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC ) test_msg->sid.code = 0; test_msg->sid.reserved = 0; test_msg->sid.sat = 27; - sbp_payload_send(&sbp_state, 0x1f, 3112, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x1f, 3112, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 3112, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 3112, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x1f, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_result_dep_c_t* check_msg = ( msg_acq_result_dep_c_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_result_dep_c_t* check_msg = + (msg_acq_result_dep_c_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cf*100 - 2527.23681641*100) < 0.05, "incorrect value for cf, expected 2527.23681641, is %f", check_msg->cf); - ck_assert_msg((check_msg->cn0*100 - 47.5346603394*100) < 0.05, "incorrect value for cn0, expected 47.5346603394, is %f", check_msg->cn0); - ck_assert_msg((check_msg->cp*100 - 920.591918945*100) < 0.05, "incorrect value for cp, expected 920.591918945, is %f", check_msg->cp); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 27, "incorrect value for sid.sat, expected 27, is %d", check_msg->sid.sat); + ck_assert_msg((check_msg->cf * 100 - 2527.23681641 * 100) < 0.05, + "incorrect value for cf, expected 2527.23681641, is %f", + check_msg->cf); + ck_assert_msg((check_msg->cn0 * 100 - 47.5346603394 * 100) < 0.05, + "incorrect value for cn0, expected 47.5346603394, is %f", + check_msg->cn0); + ck_assert_msg((check_msg->cp * 100 - 920.591918945 * 100) < 0.05, + "incorrect value for cp, expected 920.591918945, is %f", + check_msg->cp); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 27, + "incorrect value for sid.sat, expected 27, is %d", + check_msg->sid.sat); } } END_TEST -Suite* legacy_auto_check_sbp_acquisition_MsgAcqResultDepC_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_acquisition_MsgAcqResultDepC"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC); +Suite* legacy_auto_check_sbp_acquisition_MsgAcqResultDepC_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_acquisition_MsgAcqResultDepC"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_acquisition_MsgAcqSvProfile.c b/c/test/legacy/auto_check_sbp_acquisition_MsgAcqSvProfile.c index 256b3d628..612359a9e 100644 --- a/c/test/legacy/auto_check_sbp_acquisition_MsgAcqSvProfile.c +++ b/c/test/legacy/auto_check_sbp_acquisition_MsgAcqSvProfile.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfile.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfile.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include #include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile ) -{ +START_TEST(test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,28 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x2e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x2e, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x2e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x2e, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,46,0,195,4,99,7,13,38,0,97,22,0,174,0,52,0,0,0,49,0,0,0,61,0,0,0,147,0,0,0,47,0,0,0,140,0,0,0,166,210,59,0,253,23,1,121,0,190,0,0,0,175,0,0,0,175,0,0,0,142,0,0,0,237,0,0,0,12,0,0,0,126,88,21,0,153,24,0,8,0,130,0,0,0,172,0,0,0,91,0,0,0,191,0,0,0,84,0,0,0,82,0,0,0,168,177, }; + u8 encoded_frame[] = { + 85, 46, 0, 195, 4, 99, 7, 13, 38, 0, 97, 22, 0, 174, + 0, 52, 0, 0, 0, 49, 0, 0, 0, 61, 0, 0, 0, 147, + 0, 0, 0, 47, 0, 0, 0, 140, 0, 0, 0, 166, 210, 59, + 0, 253, 23, 1, 121, 0, 190, 0, 0, 0, 175, 0, 0, 0, + 175, 0, 0, 0, 142, 0, 0, 0, 237, 0, 0, 0, 12, 0, + 0, 0, 126, 88, 21, 0, 153, 24, 0, 8, 0, 130, 0, 0, + 0, 172, 0, 0, 0, 91, 0, 0, 0, 191, 0, 0, 0, 84, + 0, 0, 0, 82, 0, 0, 0, 168, 177, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_sv_profile_t* test_msg = ( msg_acq_sv_profile_t* )test_msg_storage; + msg_acq_sv_profile_t *test_msg = (msg_acq_sv_profile_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->acq_sv_profile) == 0) { // Cope with variable length arrays @@ -194,102 +202,229 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile ) test_msg->acq_sv_profile[2].status = 88; test_msg->acq_sv_profile[2].time_spent = 172; test_msg->acq_sv_profile[2].timestamp = 130; - sbp_payload_send(&sbp_state, 0x2e, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x2e, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x2e, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_sv_profile_t* check_msg = ( msg_acq_sv_profile_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_sv_profile_t *check_msg = + (msg_acq_sv_profile_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->acq_sv_profile[0].bin_width == 174, "incorrect value for acq_sv_profile[0].bin_width, expected 174, is %d", check_msg->acq_sv_profile[0].bin_width); - ck_assert_msg(check_msg->acq_sv_profile[0].cf == 47, "incorrect value for acq_sv_profile[0].cf, expected 47, is %d", check_msg->acq_sv_profile[0].cf); - ck_assert_msg(check_msg->acq_sv_profile[0].cf_max == 147, "incorrect value for acq_sv_profile[0].cf_max, expected 147, is %d", check_msg->acq_sv_profile[0].cf_max); - ck_assert_msg(check_msg->acq_sv_profile[0].cf_min == 61, "incorrect value for acq_sv_profile[0].cf_min, expected 61, is %d", check_msg->acq_sv_profile[0].cf_min); - ck_assert_msg(check_msg->acq_sv_profile[0].cn0 == 38, "incorrect value for acq_sv_profile[0].cn0, expected 38, is %d", check_msg->acq_sv_profile[0].cn0); - ck_assert_msg(check_msg->acq_sv_profile[0].cp == 140, "incorrect value for acq_sv_profile[0].cp, expected 140, is %d", check_msg->acq_sv_profile[0].cp); - ck_assert_msg(check_msg->acq_sv_profile[0].int_time == 97, "incorrect value for acq_sv_profile[0].int_time, expected 97, is %d", check_msg->acq_sv_profile[0].int_time); - ck_assert_msg(check_msg->acq_sv_profile[0].job_type == 7, "incorrect value for acq_sv_profile[0].job_type, expected 7, is %d", check_msg->acq_sv_profile[0].job_type); - ck_assert_msg(check_msg->acq_sv_profile[0].sid.code == 0, "incorrect value for acq_sv_profile[0].sid.code, expected 0, is %d", check_msg->acq_sv_profile[0].sid.code); - ck_assert_msg(check_msg->acq_sv_profile[0].sid.sat == 22, "incorrect value for acq_sv_profile[0].sid.sat, expected 22, is %d", check_msg->acq_sv_profile[0].sid.sat); - ck_assert_msg(check_msg->acq_sv_profile[0].status == 13, "incorrect value for acq_sv_profile[0].status, expected 13, is %d", check_msg->acq_sv_profile[0].status); - ck_assert_msg(check_msg->acq_sv_profile[0].time_spent == 49, "incorrect value for acq_sv_profile[0].time_spent, expected 49, is %d", check_msg->acq_sv_profile[0].time_spent); - ck_assert_msg(check_msg->acq_sv_profile[0].timestamp == 52, "incorrect value for acq_sv_profile[0].timestamp, expected 52, is %d", check_msg->acq_sv_profile[0].timestamp); - ck_assert_msg(check_msg->acq_sv_profile[1].bin_width == 121, "incorrect value for acq_sv_profile[1].bin_width, expected 121, is %d", check_msg->acq_sv_profile[1].bin_width); - ck_assert_msg(check_msg->acq_sv_profile[1].cf == 237, "incorrect value for acq_sv_profile[1].cf, expected 237, is %d", check_msg->acq_sv_profile[1].cf); - ck_assert_msg(check_msg->acq_sv_profile[1].cf_max == 142, "incorrect value for acq_sv_profile[1].cf_max, expected 142, is %d", check_msg->acq_sv_profile[1].cf_max); - ck_assert_msg(check_msg->acq_sv_profile[1].cf_min == 175, "incorrect value for acq_sv_profile[1].cf_min, expected 175, is %d", check_msg->acq_sv_profile[1].cf_min); - ck_assert_msg(check_msg->acq_sv_profile[1].cn0 == 59, "incorrect value for acq_sv_profile[1].cn0, expected 59, is %d", check_msg->acq_sv_profile[1].cn0); - ck_assert_msg(check_msg->acq_sv_profile[1].cp == 12, "incorrect value for acq_sv_profile[1].cp, expected 12, is %d", check_msg->acq_sv_profile[1].cp); - ck_assert_msg(check_msg->acq_sv_profile[1].int_time == 253, "incorrect value for acq_sv_profile[1].int_time, expected 253, is %d", check_msg->acq_sv_profile[1].int_time); - ck_assert_msg(check_msg->acq_sv_profile[1].job_type == 166, "incorrect value for acq_sv_profile[1].job_type, expected 166, is %d", check_msg->acq_sv_profile[1].job_type); - ck_assert_msg(check_msg->acq_sv_profile[1].sid.code == 1, "incorrect value for acq_sv_profile[1].sid.code, expected 1, is %d", check_msg->acq_sv_profile[1].sid.code); - ck_assert_msg(check_msg->acq_sv_profile[1].sid.sat == 23, "incorrect value for acq_sv_profile[1].sid.sat, expected 23, is %d", check_msg->acq_sv_profile[1].sid.sat); - ck_assert_msg(check_msg->acq_sv_profile[1].status == 210, "incorrect value for acq_sv_profile[1].status, expected 210, is %d", check_msg->acq_sv_profile[1].status); - ck_assert_msg(check_msg->acq_sv_profile[1].time_spent == 175, "incorrect value for acq_sv_profile[1].time_spent, expected 175, is %d", check_msg->acq_sv_profile[1].time_spent); - ck_assert_msg(check_msg->acq_sv_profile[1].timestamp == 190, "incorrect value for acq_sv_profile[1].timestamp, expected 190, is %d", check_msg->acq_sv_profile[1].timestamp); - ck_assert_msg(check_msg->acq_sv_profile[2].bin_width == 8, "incorrect value for acq_sv_profile[2].bin_width, expected 8, is %d", check_msg->acq_sv_profile[2].bin_width); - ck_assert_msg(check_msg->acq_sv_profile[2].cf == 84, "incorrect value for acq_sv_profile[2].cf, expected 84, is %d", check_msg->acq_sv_profile[2].cf); - ck_assert_msg(check_msg->acq_sv_profile[2].cf_max == 191, "incorrect value for acq_sv_profile[2].cf_max, expected 191, is %d", check_msg->acq_sv_profile[2].cf_max); - ck_assert_msg(check_msg->acq_sv_profile[2].cf_min == 91, "incorrect value for acq_sv_profile[2].cf_min, expected 91, is %d", check_msg->acq_sv_profile[2].cf_min); - ck_assert_msg(check_msg->acq_sv_profile[2].cn0 == 21, "incorrect value for acq_sv_profile[2].cn0, expected 21, is %d", check_msg->acq_sv_profile[2].cn0); - ck_assert_msg(check_msg->acq_sv_profile[2].cp == 82, "incorrect value for acq_sv_profile[2].cp, expected 82, is %d", check_msg->acq_sv_profile[2].cp); - ck_assert_msg(check_msg->acq_sv_profile[2].int_time == 153, "incorrect value for acq_sv_profile[2].int_time, expected 153, is %d", check_msg->acq_sv_profile[2].int_time); - ck_assert_msg(check_msg->acq_sv_profile[2].job_type == 126, "incorrect value for acq_sv_profile[2].job_type, expected 126, is %d", check_msg->acq_sv_profile[2].job_type); - ck_assert_msg(check_msg->acq_sv_profile[2].sid.code == 0, "incorrect value for acq_sv_profile[2].sid.code, expected 0, is %d", check_msg->acq_sv_profile[2].sid.code); - ck_assert_msg(check_msg->acq_sv_profile[2].sid.sat == 24, "incorrect value for acq_sv_profile[2].sid.sat, expected 24, is %d", check_msg->acq_sv_profile[2].sid.sat); - ck_assert_msg(check_msg->acq_sv_profile[2].status == 88, "incorrect value for acq_sv_profile[2].status, expected 88, is %d", check_msg->acq_sv_profile[2].status); - ck_assert_msg(check_msg->acq_sv_profile[2].time_spent == 172, "incorrect value for acq_sv_profile[2].time_spent, expected 172, is %d", check_msg->acq_sv_profile[2].time_spent); - ck_assert_msg(check_msg->acq_sv_profile[2].timestamp == 130, "incorrect value for acq_sv_profile[2].timestamp, expected 130, is %d", check_msg->acq_sv_profile[2].timestamp); + ck_assert_msg( + check_msg->acq_sv_profile[0].bin_width == 174, + "incorrect value for acq_sv_profile[0].bin_width, expected 174, is %d", + check_msg->acq_sv_profile[0].bin_width); + ck_assert_msg( + check_msg->acq_sv_profile[0].cf == 47, + "incorrect value for acq_sv_profile[0].cf, expected 47, is %d", + check_msg->acq_sv_profile[0].cf); + ck_assert_msg( + check_msg->acq_sv_profile[0].cf_max == 147, + "incorrect value for acq_sv_profile[0].cf_max, expected 147, is %d", + check_msg->acq_sv_profile[0].cf_max); + ck_assert_msg( + check_msg->acq_sv_profile[0].cf_min == 61, + "incorrect value for acq_sv_profile[0].cf_min, expected 61, is %d", + check_msg->acq_sv_profile[0].cf_min); + ck_assert_msg( + check_msg->acq_sv_profile[0].cn0 == 38, + "incorrect value for acq_sv_profile[0].cn0, expected 38, is %d", + check_msg->acq_sv_profile[0].cn0); + ck_assert_msg( + check_msg->acq_sv_profile[0].cp == 140, + "incorrect value for acq_sv_profile[0].cp, expected 140, is %d", + check_msg->acq_sv_profile[0].cp); + ck_assert_msg( + check_msg->acq_sv_profile[0].int_time == 97, + "incorrect value for acq_sv_profile[0].int_time, expected 97, is %d", + check_msg->acq_sv_profile[0].int_time); + ck_assert_msg( + check_msg->acq_sv_profile[0].job_type == 7, + "incorrect value for acq_sv_profile[0].job_type, expected 7, is %d", + check_msg->acq_sv_profile[0].job_type); + ck_assert_msg( + check_msg->acq_sv_profile[0].sid.code == 0, + "incorrect value for acq_sv_profile[0].sid.code, expected 0, is %d", + check_msg->acq_sv_profile[0].sid.code); + ck_assert_msg( + check_msg->acq_sv_profile[0].sid.sat == 22, + "incorrect value for acq_sv_profile[0].sid.sat, expected 22, is %d", + check_msg->acq_sv_profile[0].sid.sat); + ck_assert_msg( + check_msg->acq_sv_profile[0].status == 13, + "incorrect value for acq_sv_profile[0].status, expected 13, is %d", + check_msg->acq_sv_profile[0].status); + ck_assert_msg( + check_msg->acq_sv_profile[0].time_spent == 49, + "incorrect value for acq_sv_profile[0].time_spent, expected 49, is %d", + check_msg->acq_sv_profile[0].time_spent); + ck_assert_msg( + check_msg->acq_sv_profile[0].timestamp == 52, + "incorrect value for acq_sv_profile[0].timestamp, expected 52, is %d", + check_msg->acq_sv_profile[0].timestamp); + ck_assert_msg( + check_msg->acq_sv_profile[1].bin_width == 121, + "incorrect value for acq_sv_profile[1].bin_width, expected 121, is %d", + check_msg->acq_sv_profile[1].bin_width); + ck_assert_msg( + check_msg->acq_sv_profile[1].cf == 237, + "incorrect value for acq_sv_profile[1].cf, expected 237, is %d", + check_msg->acq_sv_profile[1].cf); + ck_assert_msg( + check_msg->acq_sv_profile[1].cf_max == 142, + "incorrect value for acq_sv_profile[1].cf_max, expected 142, is %d", + check_msg->acq_sv_profile[1].cf_max); + ck_assert_msg( + check_msg->acq_sv_profile[1].cf_min == 175, + "incorrect value for acq_sv_profile[1].cf_min, expected 175, is %d", + check_msg->acq_sv_profile[1].cf_min); + ck_assert_msg( + check_msg->acq_sv_profile[1].cn0 == 59, + "incorrect value for acq_sv_profile[1].cn0, expected 59, is %d", + check_msg->acq_sv_profile[1].cn0); + ck_assert_msg( + check_msg->acq_sv_profile[1].cp == 12, + "incorrect value for acq_sv_profile[1].cp, expected 12, is %d", + check_msg->acq_sv_profile[1].cp); + ck_assert_msg( + check_msg->acq_sv_profile[1].int_time == 253, + "incorrect value for acq_sv_profile[1].int_time, expected 253, is %d", + check_msg->acq_sv_profile[1].int_time); + ck_assert_msg( + check_msg->acq_sv_profile[1].job_type == 166, + "incorrect value for acq_sv_profile[1].job_type, expected 166, is %d", + check_msg->acq_sv_profile[1].job_type); + ck_assert_msg( + check_msg->acq_sv_profile[1].sid.code == 1, + "incorrect value for acq_sv_profile[1].sid.code, expected 1, is %d", + check_msg->acq_sv_profile[1].sid.code); + ck_assert_msg( + check_msg->acq_sv_profile[1].sid.sat == 23, + "incorrect value for acq_sv_profile[1].sid.sat, expected 23, is %d", + check_msg->acq_sv_profile[1].sid.sat); + ck_assert_msg( + check_msg->acq_sv_profile[1].status == 210, + "incorrect value for acq_sv_profile[1].status, expected 210, is %d", + check_msg->acq_sv_profile[1].status); + ck_assert_msg( + check_msg->acq_sv_profile[1].time_spent == 175, + "incorrect value for acq_sv_profile[1].time_spent, expected 175, is %d", + check_msg->acq_sv_profile[1].time_spent); + ck_assert_msg( + check_msg->acq_sv_profile[1].timestamp == 190, + "incorrect value for acq_sv_profile[1].timestamp, expected 190, is %d", + check_msg->acq_sv_profile[1].timestamp); + ck_assert_msg( + check_msg->acq_sv_profile[2].bin_width == 8, + "incorrect value for acq_sv_profile[2].bin_width, expected 8, is %d", + check_msg->acq_sv_profile[2].bin_width); + ck_assert_msg( + check_msg->acq_sv_profile[2].cf == 84, + "incorrect value for acq_sv_profile[2].cf, expected 84, is %d", + check_msg->acq_sv_profile[2].cf); + ck_assert_msg( + check_msg->acq_sv_profile[2].cf_max == 191, + "incorrect value for acq_sv_profile[2].cf_max, expected 191, is %d", + check_msg->acq_sv_profile[2].cf_max); + ck_assert_msg( + check_msg->acq_sv_profile[2].cf_min == 91, + "incorrect value for acq_sv_profile[2].cf_min, expected 91, is %d", + check_msg->acq_sv_profile[2].cf_min); + ck_assert_msg( + check_msg->acq_sv_profile[2].cn0 == 21, + "incorrect value for acq_sv_profile[2].cn0, expected 21, is %d", + check_msg->acq_sv_profile[2].cn0); + ck_assert_msg( + check_msg->acq_sv_profile[2].cp == 82, + "incorrect value for acq_sv_profile[2].cp, expected 82, is %d", + check_msg->acq_sv_profile[2].cp); + ck_assert_msg( + check_msg->acq_sv_profile[2].int_time == 153, + "incorrect value for acq_sv_profile[2].int_time, expected 153, is %d", + check_msg->acq_sv_profile[2].int_time); + ck_assert_msg( + check_msg->acq_sv_profile[2].job_type == 126, + "incorrect value for acq_sv_profile[2].job_type, expected 126, is %d", + check_msg->acq_sv_profile[2].job_type); + ck_assert_msg( + check_msg->acq_sv_profile[2].sid.code == 0, + "incorrect value for acq_sv_profile[2].sid.code, expected 0, is %d", + check_msg->acq_sv_profile[2].sid.code); + ck_assert_msg( + check_msg->acq_sv_profile[2].sid.sat == 24, + "incorrect value for acq_sv_profile[2].sid.sat, expected 24, is %d", + check_msg->acq_sv_profile[2].sid.sat); + ck_assert_msg( + check_msg->acq_sv_profile[2].status == 88, + "incorrect value for acq_sv_profile[2].status, expected 88, is %d", + check_msg->acq_sv_profile[2].status); + ck_assert_msg( + check_msg->acq_sv_profile[2].time_spent == 172, + "incorrect value for acq_sv_profile[2].time_spent, expected 172, is %d", + check_msg->acq_sv_profile[2].time_spent); + ck_assert_msg( + check_msg->acq_sv_profile[2].timestamp == 130, + "incorrect value for acq_sv_profile[2].timestamp, expected 130, is %d", + check_msg->acq_sv_profile[2].timestamp); } } END_TEST -Suite* legacy_auto_check_sbp_acquisition_MsgAcqSvProfile_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_acquisition_MsgAcqSvProfile"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile); +Suite *legacy_auto_check_sbp_acquisition_MsgAcqSvProfile_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_acquisition_MsgAcqSvProfile"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_acquisition_MsgAcqSvProfileDep.c b/c/test/legacy/auto_check_sbp_acquisition_MsgAcqSvProfileDep.c index ab36b1ffe..5861f8725 100644 --- a/c/test/legacy/auto_check_sbp_acquisition_MsgAcqSvProfileDep.c +++ b/c/test/legacy/auto_check_sbp_acquisition_MsgAcqSvProfileDep.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfileDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfileDep.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include #include #include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep ) -{ +START_TEST(test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,29 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x1e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x1e, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x1e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x1e, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,30,0,195,4,105,67,103,151,0,12,22,0,0,0,187,0,91,0,0,0,75,0,0,0,132,0,0,0,36,0,0,0,60,0,0,0,241,0,0,0,238,38,111,0,179,23,0,1,0,176,0,166,0,0,0,234,0,0,0,155,0,0,0,24,0,0,0,212,0,0,0,247,0,0,0,142,213,68,0,53,24,0,0,0,52,0,49,0,0,0,245,0,0,0,76,0,0,0,248,0,0,0,212,0,0,0,101,0,0,0,67,132, }; + u8 encoded_frame[] = { + 85, 30, 0, 195, 4, 105, 67, 103, 151, 0, 12, 22, 0, 0, 0, + 187, 0, 91, 0, 0, 0, 75, 0, 0, 0, 132, 0, 0, 0, 36, + 0, 0, 0, 60, 0, 0, 0, 241, 0, 0, 0, 238, 38, 111, 0, + 179, 23, 0, 1, 0, 176, 0, 166, 0, 0, 0, 234, 0, 0, 0, + 155, 0, 0, 0, 24, 0, 0, 0, 212, 0, 0, 0, 247, 0, 0, + 0, 142, 213, 68, 0, 53, 24, 0, 0, 0, 52, 0, 49, 0, 0, + 0, 245, 0, 0, 0, 76, 0, 0, 0, 248, 0, 0, 0, 212, 0, + 0, 0, 101, 0, 0, 0, 67, 132, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acq_sv_profile_dep_t* test_msg = ( msg_acq_sv_profile_dep_t* )test_msg_storage; + msg_acq_sv_profile_dep_t *test_msg = + (msg_acq_sv_profile_dep_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->acq_sv_profile) == 0) { // Cope with variable length arrays @@ -197,105 +206,241 @@ START_TEST( test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep ) test_msg->acq_sv_profile[2].status = 213; test_msg->acq_sv_profile[2].time_spent = 245; test_msg->acq_sv_profile[2].timestamp = 49; - sbp_payload_send(&sbp_state, 0x1e, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x1e, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x1e, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acq_sv_profile_dep_t* check_msg = ( msg_acq_sv_profile_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acq_sv_profile_dep_t *check_msg = + (msg_acq_sv_profile_dep_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->acq_sv_profile[0].bin_width == 187, "incorrect value for acq_sv_profile[0].bin_width, expected 187, is %d", check_msg->acq_sv_profile[0].bin_width); - ck_assert_msg(check_msg->acq_sv_profile[0].cf == 60, "incorrect value for acq_sv_profile[0].cf, expected 60, is %d", check_msg->acq_sv_profile[0].cf); - ck_assert_msg(check_msg->acq_sv_profile[0].cf_max == 36, "incorrect value for acq_sv_profile[0].cf_max, expected 36, is %d", check_msg->acq_sv_profile[0].cf_max); - ck_assert_msg(check_msg->acq_sv_profile[0].cf_min == 132, "incorrect value for acq_sv_profile[0].cf_min, expected 132, is %d", check_msg->acq_sv_profile[0].cf_min); - ck_assert_msg(check_msg->acq_sv_profile[0].cn0 == 151, "incorrect value for acq_sv_profile[0].cn0, expected 151, is %d", check_msg->acq_sv_profile[0].cn0); - ck_assert_msg(check_msg->acq_sv_profile[0].cp == 241, "incorrect value for acq_sv_profile[0].cp, expected 241, is %d", check_msg->acq_sv_profile[0].cp); - ck_assert_msg(check_msg->acq_sv_profile[0].int_time == 12, "incorrect value for acq_sv_profile[0].int_time, expected 12, is %d", check_msg->acq_sv_profile[0].int_time); - ck_assert_msg(check_msg->acq_sv_profile[0].job_type == 67, "incorrect value for acq_sv_profile[0].job_type, expected 67, is %d", check_msg->acq_sv_profile[0].job_type); - ck_assert_msg(check_msg->acq_sv_profile[0].sid.code == 0, "incorrect value for acq_sv_profile[0].sid.code, expected 0, is %d", check_msg->acq_sv_profile[0].sid.code); - ck_assert_msg(check_msg->acq_sv_profile[0].sid.reserved == 0, "incorrect value for acq_sv_profile[0].sid.reserved, expected 0, is %d", check_msg->acq_sv_profile[0].sid.reserved); - ck_assert_msg(check_msg->acq_sv_profile[0].sid.sat == 22, "incorrect value for acq_sv_profile[0].sid.sat, expected 22, is %d", check_msg->acq_sv_profile[0].sid.sat); - ck_assert_msg(check_msg->acq_sv_profile[0].status == 103, "incorrect value for acq_sv_profile[0].status, expected 103, is %d", check_msg->acq_sv_profile[0].status); - ck_assert_msg(check_msg->acq_sv_profile[0].time_spent == 75, "incorrect value for acq_sv_profile[0].time_spent, expected 75, is %d", check_msg->acq_sv_profile[0].time_spent); - ck_assert_msg(check_msg->acq_sv_profile[0].timestamp == 91, "incorrect value for acq_sv_profile[0].timestamp, expected 91, is %d", check_msg->acq_sv_profile[0].timestamp); - ck_assert_msg(check_msg->acq_sv_profile[1].bin_width == 176, "incorrect value for acq_sv_profile[1].bin_width, expected 176, is %d", check_msg->acq_sv_profile[1].bin_width); - ck_assert_msg(check_msg->acq_sv_profile[1].cf == 212, "incorrect value for acq_sv_profile[1].cf, expected 212, is %d", check_msg->acq_sv_profile[1].cf); - ck_assert_msg(check_msg->acq_sv_profile[1].cf_max == 24, "incorrect value for acq_sv_profile[1].cf_max, expected 24, is %d", check_msg->acq_sv_profile[1].cf_max); - ck_assert_msg(check_msg->acq_sv_profile[1].cf_min == 155, "incorrect value for acq_sv_profile[1].cf_min, expected 155, is %d", check_msg->acq_sv_profile[1].cf_min); - ck_assert_msg(check_msg->acq_sv_profile[1].cn0 == 111, "incorrect value for acq_sv_profile[1].cn0, expected 111, is %d", check_msg->acq_sv_profile[1].cn0); - ck_assert_msg(check_msg->acq_sv_profile[1].cp == 247, "incorrect value for acq_sv_profile[1].cp, expected 247, is %d", check_msg->acq_sv_profile[1].cp); - ck_assert_msg(check_msg->acq_sv_profile[1].int_time == 179, "incorrect value for acq_sv_profile[1].int_time, expected 179, is %d", check_msg->acq_sv_profile[1].int_time); - ck_assert_msg(check_msg->acq_sv_profile[1].job_type == 238, "incorrect value for acq_sv_profile[1].job_type, expected 238, is %d", check_msg->acq_sv_profile[1].job_type); - ck_assert_msg(check_msg->acq_sv_profile[1].sid.code == 1, "incorrect value for acq_sv_profile[1].sid.code, expected 1, is %d", check_msg->acq_sv_profile[1].sid.code); - ck_assert_msg(check_msg->acq_sv_profile[1].sid.reserved == 0, "incorrect value for acq_sv_profile[1].sid.reserved, expected 0, is %d", check_msg->acq_sv_profile[1].sid.reserved); - ck_assert_msg(check_msg->acq_sv_profile[1].sid.sat == 23, "incorrect value for acq_sv_profile[1].sid.sat, expected 23, is %d", check_msg->acq_sv_profile[1].sid.sat); - ck_assert_msg(check_msg->acq_sv_profile[1].status == 38, "incorrect value for acq_sv_profile[1].status, expected 38, is %d", check_msg->acq_sv_profile[1].status); - ck_assert_msg(check_msg->acq_sv_profile[1].time_spent == 234, "incorrect value for acq_sv_profile[1].time_spent, expected 234, is %d", check_msg->acq_sv_profile[1].time_spent); - ck_assert_msg(check_msg->acq_sv_profile[1].timestamp == 166, "incorrect value for acq_sv_profile[1].timestamp, expected 166, is %d", check_msg->acq_sv_profile[1].timestamp); - ck_assert_msg(check_msg->acq_sv_profile[2].bin_width == 52, "incorrect value for acq_sv_profile[2].bin_width, expected 52, is %d", check_msg->acq_sv_profile[2].bin_width); - ck_assert_msg(check_msg->acq_sv_profile[2].cf == 212, "incorrect value for acq_sv_profile[2].cf, expected 212, is %d", check_msg->acq_sv_profile[2].cf); - ck_assert_msg(check_msg->acq_sv_profile[2].cf_max == 248, "incorrect value for acq_sv_profile[2].cf_max, expected 248, is %d", check_msg->acq_sv_profile[2].cf_max); - ck_assert_msg(check_msg->acq_sv_profile[2].cf_min == 76, "incorrect value for acq_sv_profile[2].cf_min, expected 76, is %d", check_msg->acq_sv_profile[2].cf_min); - ck_assert_msg(check_msg->acq_sv_profile[2].cn0 == 68, "incorrect value for acq_sv_profile[2].cn0, expected 68, is %d", check_msg->acq_sv_profile[2].cn0); - ck_assert_msg(check_msg->acq_sv_profile[2].cp == 101, "incorrect value for acq_sv_profile[2].cp, expected 101, is %d", check_msg->acq_sv_profile[2].cp); - ck_assert_msg(check_msg->acq_sv_profile[2].int_time == 53, "incorrect value for acq_sv_profile[2].int_time, expected 53, is %d", check_msg->acq_sv_profile[2].int_time); - ck_assert_msg(check_msg->acq_sv_profile[2].job_type == 142, "incorrect value for acq_sv_profile[2].job_type, expected 142, is %d", check_msg->acq_sv_profile[2].job_type); - ck_assert_msg(check_msg->acq_sv_profile[2].sid.code == 0, "incorrect value for acq_sv_profile[2].sid.code, expected 0, is %d", check_msg->acq_sv_profile[2].sid.code); - ck_assert_msg(check_msg->acq_sv_profile[2].sid.reserved == 0, "incorrect value for acq_sv_profile[2].sid.reserved, expected 0, is %d", check_msg->acq_sv_profile[2].sid.reserved); - ck_assert_msg(check_msg->acq_sv_profile[2].sid.sat == 24, "incorrect value for acq_sv_profile[2].sid.sat, expected 24, is %d", check_msg->acq_sv_profile[2].sid.sat); - ck_assert_msg(check_msg->acq_sv_profile[2].status == 213, "incorrect value for acq_sv_profile[2].status, expected 213, is %d", check_msg->acq_sv_profile[2].status); - ck_assert_msg(check_msg->acq_sv_profile[2].time_spent == 245, "incorrect value for acq_sv_profile[2].time_spent, expected 245, is %d", check_msg->acq_sv_profile[2].time_spent); - ck_assert_msg(check_msg->acq_sv_profile[2].timestamp == 49, "incorrect value for acq_sv_profile[2].timestamp, expected 49, is %d", check_msg->acq_sv_profile[2].timestamp); + ck_assert_msg( + check_msg->acq_sv_profile[0].bin_width == 187, + "incorrect value for acq_sv_profile[0].bin_width, expected 187, is %d", + check_msg->acq_sv_profile[0].bin_width); + ck_assert_msg( + check_msg->acq_sv_profile[0].cf == 60, + "incorrect value for acq_sv_profile[0].cf, expected 60, is %d", + check_msg->acq_sv_profile[0].cf); + ck_assert_msg( + check_msg->acq_sv_profile[0].cf_max == 36, + "incorrect value for acq_sv_profile[0].cf_max, expected 36, is %d", + check_msg->acq_sv_profile[0].cf_max); + ck_assert_msg( + check_msg->acq_sv_profile[0].cf_min == 132, + "incorrect value for acq_sv_profile[0].cf_min, expected 132, is %d", + check_msg->acq_sv_profile[0].cf_min); + ck_assert_msg( + check_msg->acq_sv_profile[0].cn0 == 151, + "incorrect value for acq_sv_profile[0].cn0, expected 151, is %d", + check_msg->acq_sv_profile[0].cn0); + ck_assert_msg( + check_msg->acq_sv_profile[0].cp == 241, + "incorrect value for acq_sv_profile[0].cp, expected 241, is %d", + check_msg->acq_sv_profile[0].cp); + ck_assert_msg( + check_msg->acq_sv_profile[0].int_time == 12, + "incorrect value for acq_sv_profile[0].int_time, expected 12, is %d", + check_msg->acq_sv_profile[0].int_time); + ck_assert_msg( + check_msg->acq_sv_profile[0].job_type == 67, + "incorrect value for acq_sv_profile[0].job_type, expected 67, is %d", + check_msg->acq_sv_profile[0].job_type); + ck_assert_msg( + check_msg->acq_sv_profile[0].sid.code == 0, + "incorrect value for acq_sv_profile[0].sid.code, expected 0, is %d", + check_msg->acq_sv_profile[0].sid.code); + ck_assert_msg( + check_msg->acq_sv_profile[0].sid.reserved == 0, + "incorrect value for acq_sv_profile[0].sid.reserved, expected 0, is %d", + check_msg->acq_sv_profile[0].sid.reserved); + ck_assert_msg( + check_msg->acq_sv_profile[0].sid.sat == 22, + "incorrect value for acq_sv_profile[0].sid.sat, expected 22, is %d", + check_msg->acq_sv_profile[0].sid.sat); + ck_assert_msg( + check_msg->acq_sv_profile[0].status == 103, + "incorrect value for acq_sv_profile[0].status, expected 103, is %d", + check_msg->acq_sv_profile[0].status); + ck_assert_msg( + check_msg->acq_sv_profile[0].time_spent == 75, + "incorrect value for acq_sv_profile[0].time_spent, expected 75, is %d", + check_msg->acq_sv_profile[0].time_spent); + ck_assert_msg( + check_msg->acq_sv_profile[0].timestamp == 91, + "incorrect value for acq_sv_profile[0].timestamp, expected 91, is %d", + check_msg->acq_sv_profile[0].timestamp); + ck_assert_msg( + check_msg->acq_sv_profile[1].bin_width == 176, + "incorrect value for acq_sv_profile[1].bin_width, expected 176, is %d", + check_msg->acq_sv_profile[1].bin_width); + ck_assert_msg( + check_msg->acq_sv_profile[1].cf == 212, + "incorrect value for acq_sv_profile[1].cf, expected 212, is %d", + check_msg->acq_sv_profile[1].cf); + ck_assert_msg( + check_msg->acq_sv_profile[1].cf_max == 24, + "incorrect value for acq_sv_profile[1].cf_max, expected 24, is %d", + check_msg->acq_sv_profile[1].cf_max); + ck_assert_msg( + check_msg->acq_sv_profile[1].cf_min == 155, + "incorrect value for acq_sv_profile[1].cf_min, expected 155, is %d", + check_msg->acq_sv_profile[1].cf_min); + ck_assert_msg( + check_msg->acq_sv_profile[1].cn0 == 111, + "incorrect value for acq_sv_profile[1].cn0, expected 111, is %d", + check_msg->acq_sv_profile[1].cn0); + ck_assert_msg( + check_msg->acq_sv_profile[1].cp == 247, + "incorrect value for acq_sv_profile[1].cp, expected 247, is %d", + check_msg->acq_sv_profile[1].cp); + ck_assert_msg( + check_msg->acq_sv_profile[1].int_time == 179, + "incorrect value for acq_sv_profile[1].int_time, expected 179, is %d", + check_msg->acq_sv_profile[1].int_time); + ck_assert_msg( + check_msg->acq_sv_profile[1].job_type == 238, + "incorrect value for acq_sv_profile[1].job_type, expected 238, is %d", + check_msg->acq_sv_profile[1].job_type); + ck_assert_msg( + check_msg->acq_sv_profile[1].sid.code == 1, + "incorrect value for acq_sv_profile[1].sid.code, expected 1, is %d", + check_msg->acq_sv_profile[1].sid.code); + ck_assert_msg( + check_msg->acq_sv_profile[1].sid.reserved == 0, + "incorrect value for acq_sv_profile[1].sid.reserved, expected 0, is %d", + check_msg->acq_sv_profile[1].sid.reserved); + ck_assert_msg( + check_msg->acq_sv_profile[1].sid.sat == 23, + "incorrect value for acq_sv_profile[1].sid.sat, expected 23, is %d", + check_msg->acq_sv_profile[1].sid.sat); + ck_assert_msg( + check_msg->acq_sv_profile[1].status == 38, + "incorrect value for acq_sv_profile[1].status, expected 38, is %d", + check_msg->acq_sv_profile[1].status); + ck_assert_msg( + check_msg->acq_sv_profile[1].time_spent == 234, + "incorrect value for acq_sv_profile[1].time_spent, expected 234, is %d", + check_msg->acq_sv_profile[1].time_spent); + ck_assert_msg( + check_msg->acq_sv_profile[1].timestamp == 166, + "incorrect value for acq_sv_profile[1].timestamp, expected 166, is %d", + check_msg->acq_sv_profile[1].timestamp); + ck_assert_msg( + check_msg->acq_sv_profile[2].bin_width == 52, + "incorrect value for acq_sv_profile[2].bin_width, expected 52, is %d", + check_msg->acq_sv_profile[2].bin_width); + ck_assert_msg( + check_msg->acq_sv_profile[2].cf == 212, + "incorrect value for acq_sv_profile[2].cf, expected 212, is %d", + check_msg->acq_sv_profile[2].cf); + ck_assert_msg( + check_msg->acq_sv_profile[2].cf_max == 248, + "incorrect value for acq_sv_profile[2].cf_max, expected 248, is %d", + check_msg->acq_sv_profile[2].cf_max); + ck_assert_msg( + check_msg->acq_sv_profile[2].cf_min == 76, + "incorrect value for acq_sv_profile[2].cf_min, expected 76, is %d", + check_msg->acq_sv_profile[2].cf_min); + ck_assert_msg( + check_msg->acq_sv_profile[2].cn0 == 68, + "incorrect value for acq_sv_profile[2].cn0, expected 68, is %d", + check_msg->acq_sv_profile[2].cn0); + ck_assert_msg( + check_msg->acq_sv_profile[2].cp == 101, + "incorrect value for acq_sv_profile[2].cp, expected 101, is %d", + check_msg->acq_sv_profile[2].cp); + ck_assert_msg( + check_msg->acq_sv_profile[2].int_time == 53, + "incorrect value for acq_sv_profile[2].int_time, expected 53, is %d", + check_msg->acq_sv_profile[2].int_time); + ck_assert_msg( + check_msg->acq_sv_profile[2].job_type == 142, + "incorrect value for acq_sv_profile[2].job_type, expected 142, is %d", + check_msg->acq_sv_profile[2].job_type); + ck_assert_msg( + check_msg->acq_sv_profile[2].sid.code == 0, + "incorrect value for acq_sv_profile[2].sid.code, expected 0, is %d", + check_msg->acq_sv_profile[2].sid.code); + ck_assert_msg( + check_msg->acq_sv_profile[2].sid.reserved == 0, + "incorrect value for acq_sv_profile[2].sid.reserved, expected 0, is %d", + check_msg->acq_sv_profile[2].sid.reserved); + ck_assert_msg( + check_msg->acq_sv_profile[2].sid.sat == 24, + "incorrect value for acq_sv_profile[2].sid.sat, expected 24, is %d", + check_msg->acq_sv_profile[2].sid.sat); + ck_assert_msg( + check_msg->acq_sv_profile[2].status == 213, + "incorrect value for acq_sv_profile[2].status, expected 213, is %d", + check_msg->acq_sv_profile[2].status); + ck_assert_msg( + check_msg->acq_sv_profile[2].time_spent == 245, + "incorrect value for acq_sv_profile[2].time_spent, expected 245, is %d", + check_msg->acq_sv_profile[2].time_spent); + ck_assert_msg( + check_msg->acq_sv_profile[2].timestamp == 49, + "incorrect value for acq_sv_profile[2].timestamp, expected 49, is %d", + check_msg->acq_sv_profile[2].timestamp); } } END_TEST -Suite* legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep); +Suite *legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.c b/c/test/legacy/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.c index 7df69b319..22db8b27d 100644 --- a/c/test/legacy/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.c +++ b/c/test/legacy/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeReq ) -{ +START_TEST(test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeReq) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,70 +128,84 @@ START_TEST( test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeReq ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xb3, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xb3, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xb3, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xb3, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,179,0,136,247,0,65,216, }; + u8 encoded_frame[] = { + 85, 179, 0, 136, 247, 0, 65, 216, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - sbp_payload_send(&sbp_state, 0xb3, 63368, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xb3, 63368, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 63368, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 63368, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xb3, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts + // Cast to expected message type - the +6 byte offset is where the payload + // starts } } END_TEST -Suite* legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeReq"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeReq"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeReq); +Suite *legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeReq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_bootload_" + "MsgBootloaderHandshakeReq"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeReq); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.c b/c/test/legacy/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.c index 6f7245be7..2148f4c6e 100644 --- a/c/test/legacy/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.c +++ b/c/test/legacy/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp ) -{ +START_TEST(test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,84 +128,105 @@ START_TEST( test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xb4, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xb4, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xb4, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xb4, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,180,0,0,0,9,0,0,0,0,118,49,46,50,10,201,1, }; + u8 encoded_frame[] = { + 85, 180, 0, 0, 0, 9, 0, 0, 0, 0, 118, 49, 46, 50, 10, 201, 1, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_bootloader_handshake_resp_t* test_msg = ( msg_bootloader_handshake_resp_t* )test_msg_storage; + msg_bootloader_handshake_resp_t* test_msg = + (msg_bootloader_handshake_resp_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; { - const char assign_string[] = { (char)118,(char)49,(char)46,(char)50,(char)10 }; + const char assign_string[] = {(char)118, (char)49, (char)46, (char)50, + (char)10}; memcpy(test_msg->version, assign_string, sizeof(assign_string)); if (sizeof(test_msg->version) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0xb4, 0, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xb4, 0, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 0, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xb4, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_bootloader_handshake_resp_t* check_msg = ( msg_bootloader_handshake_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_bootloader_handshake_resp_t* check_msg = + (msg_bootloader_handshake_resp_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); { - const char check_string[] = { (char)118,(char)49,(char)46,(char)50,(char)10 }; - ck_assert_msg(memcmp(check_msg->version, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->version, expected string '%s', is '%s'", check_string, check_msg->version); + const char check_string[] = {(char)118, (char)49, (char)46, (char)50, + (char)10}; + ck_assert_msg( + memcmp(check_msg->version, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->version, expected string '%s', is " + "'%s'", + check_string, check_msg->version); } } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -216,17 +234,22 @@ START_TEST( test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xb0, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xb0, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xb0, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xb0, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,176,0,195,4,4,118,49,46,50,1,206, }; + u8 encoded_frame[] = { + 85, 176, 0, 195, 4, 4, 118, 49, 46, 50, 1, 206, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_bootloader_handshake_dep_a_t* test_msg = ( msg_bootloader_handshake_dep_a_t* )test_msg_storage; + msg_bootloader_handshake_dep_a_t* test_msg = + (msg_bootloader_handshake_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->handshake) == 0) { // Cope with variable length arrays @@ -248,67 +271,86 @@ START_TEST( test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp ) test_msg_len += sizeof(test_msg->handshake[0]); } test_msg->handshake[3] = 50; - sbp_payload_send(&sbp_state, 0xb0, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xb0, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xb0, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_bootloader_handshake_dep_a_t* check_msg = ( msg_bootloader_handshake_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_bootloader_handshake_dep_a_t* check_msg = + (msg_bootloader_handshake_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->handshake[0] == 118, "incorrect value for handshake[0], expected 118, is %d", check_msg->handshake[0]); - ck_assert_msg(check_msg->handshake[1] == 49, "incorrect value for handshake[1], expected 49, is %d", check_msg->handshake[1]); - ck_assert_msg(check_msg->handshake[2] == 46, "incorrect value for handshake[2], expected 46, is %d", check_msg->handshake[2]); - ck_assert_msg(check_msg->handshake[3] == 50, "incorrect value for handshake[3], expected 50, is %d", check_msg->handshake[3]); + ck_assert_msg(check_msg->handshake[0] == 118, + "incorrect value for handshake[0], expected 118, is %d", + check_msg->handshake[0]); + ck_assert_msg(check_msg->handshake[1] == 49, + "incorrect value for handshake[1], expected 49, is %d", + check_msg->handshake[1]); + ck_assert_msg(check_msg->handshake[2] == 46, + "incorrect value for handshake[2], expected 46, is %d", + check_msg->handshake[2]); + ck_assert_msg(check_msg->handshake[3] == 50, + "incorrect value for handshake[3], expected 50, is %d", + check_msg->handshake[3]); } } END_TEST -Suite* legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp); +Suite* legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_bootload_" + "MsgBootloaderHandshakeResp"); + tcase_add_test( + tc_acq, test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_bootload_MsgBootloaderJumptoApp.c b/c/test/legacy/auto_check_sbp_bootload_MsgBootloaderJumptoApp.c index 2614f2683..5e823fde8 100644 --- a/c/test/legacy/auto_check_sbp_bootload_MsgBootloaderJumptoApp.c +++ b/c/test/legacy/auto_check_sbp_bootload_MsgBootloaderJumptoApp.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderJumptoApp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderJumptoApp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp ) -{ +START_TEST(test_legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,77 +128,94 @@ START_TEST( test_legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xb1, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xb1, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xb1, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xb1, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,177,0,205,18,1,216,105,96, }; + u8 encoded_frame[] = { + 85, 177, 0, 205, 18, 1, 216, 105, 96, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_bootloader_jump_to_app_t* test_msg = ( msg_bootloader_jump_to_app_t* )test_msg_storage; + msg_bootloader_jump_to_app_t *test_msg = + (msg_bootloader_jump_to_app_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->jump = 216; - sbp_payload_send(&sbp_state, 0xb1, 4813, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xb1, 4813, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4813, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 4813, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xb1, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_bootloader_jump_to_app_t* check_msg = ( msg_bootloader_jump_to_app_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_bootloader_jump_to_app_t *check_msg = + (msg_bootloader_jump_to_app_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->jump == 216, "incorrect value for jump, expected 216, is %d", check_msg->jump); + ck_assert_msg(check_msg->jump == 216, + "incorrect value for jump, expected 216, is %d", + check_msg->jump); } } END_TEST -Suite* legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp); +Suite *legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_bootload_MsgNapDeviceDnaReq.c b/c/test/legacy/auto_check_sbp_bootload_MsgNapDeviceDnaReq.c index fa74e0477..e3c10a340 100644 --- a/c/test/legacy/auto_check_sbp_bootload_MsgNapDeviceDnaReq.c +++ b/c/test/legacy/auto_check_sbp_bootload_MsgNapDeviceDnaReq.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaReq ) -{ +START_TEST(test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaReq) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,70 +128,83 @@ START_TEST( test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaReq ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xde, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xde, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xde, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xde, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,222,0,128,50,0,231,160, }; + u8 encoded_frame[] = { + 85, 222, 0, 128, 50, 0, 231, 160, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - sbp_payload_send(&sbp_state, 0xde, 12928, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xde, 12928, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 12928, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 12928, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xde, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts + // Cast to expected message type - the +6 byte offset is where the payload + // starts } } END_TEST -Suite* legacy_auto_check_sbp_bootload_MsgNapDeviceDnaReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_bootload_MsgNapDeviceDnaReq"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaReq"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaReq); +Suite *legacy_auto_check_sbp_bootload_MsgNapDeviceDnaReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_bootload_MsgNapDeviceDnaReq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaReq"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaReq); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_bootload_MsgNapDeviceDnaResp.c b/c/test/legacy/auto_check_sbp_bootload_MsgNapDeviceDnaResp.c index 269daf34c..8ad76ae60 100644 --- a/c/test/legacy/auto_check_sbp_bootload_MsgNapDeviceDnaResp.c +++ b/c/test/legacy/auto_check_sbp_bootload_MsgNapDeviceDnaResp.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp ) -{ +START_TEST(test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xdd, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xdd, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xdd, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xdd, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,221,0,169,56,8,2,187,1,130,173,244,67,122,70,91, }; + u8 encoded_frame[] = { + 85, 221, 0, 169, 56, 8, 2, 187, 1, 130, 173, 244, 67, 122, 70, 91, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_nap_device_dna_resp_t* test_msg = ( msg_nap_device_dna_resp_t* )test_msg_storage; + msg_nap_device_dna_resp_t *test_msg = + (msg_nap_device_dna_resp_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->dna) == 0) { // Cope with variable length arrays @@ -183,71 +185,97 @@ START_TEST( test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp ) test_msg_len += sizeof(test_msg->dna[0]); } test_msg->dna[7] = 122; - sbp_payload_send(&sbp_state, 0xdd, 14505, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xdd, 14505, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 14505, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 14505, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xdd, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_nap_device_dna_resp_t* check_msg = ( msg_nap_device_dna_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_nap_device_dna_resp_t *check_msg = + (msg_nap_device_dna_resp_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->dna[0] == 2, "incorrect value for dna[0], expected 2, is %d", check_msg->dna[0]); - ck_assert_msg(check_msg->dna[1] == 187, "incorrect value for dna[1], expected 187, is %d", check_msg->dna[1]); - ck_assert_msg(check_msg->dna[2] == 1, "incorrect value for dna[2], expected 1, is %d", check_msg->dna[2]); - ck_assert_msg(check_msg->dna[3] == 130, "incorrect value for dna[3], expected 130, is %d", check_msg->dna[3]); - ck_assert_msg(check_msg->dna[4] == 173, "incorrect value for dna[4], expected 173, is %d", check_msg->dna[4]); - ck_assert_msg(check_msg->dna[5] == 244, "incorrect value for dna[5], expected 244, is %d", check_msg->dna[5]); - ck_assert_msg(check_msg->dna[6] == 67, "incorrect value for dna[6], expected 67, is %d", check_msg->dna[6]); - ck_assert_msg(check_msg->dna[7] == 122, "incorrect value for dna[7], expected 122, is %d", check_msg->dna[7]); + ck_assert_msg(check_msg->dna[0] == 2, + "incorrect value for dna[0], expected 2, is %d", + check_msg->dna[0]); + ck_assert_msg(check_msg->dna[1] == 187, + "incorrect value for dna[1], expected 187, is %d", + check_msg->dna[1]); + ck_assert_msg(check_msg->dna[2] == 1, + "incorrect value for dna[2], expected 1, is %d", + check_msg->dna[2]); + ck_assert_msg(check_msg->dna[3] == 130, + "incorrect value for dna[3], expected 130, is %d", + check_msg->dna[3]); + ck_assert_msg(check_msg->dna[4] == 173, + "incorrect value for dna[4], expected 173, is %d", + check_msg->dna[4]); + ck_assert_msg(check_msg->dna[5] == 244, + "incorrect value for dna[5], expected 244, is %d", + check_msg->dna[5]); + ck_assert_msg(check_msg->dna[6] == 67, + "incorrect value for dna[6], expected 67, is %d", + check_msg->dna[6]); + ck_assert_msg(check_msg->dna[7] == 122, + "incorrect value for dna[7], expected 122, is %d", + check_msg->dna[7]); } } END_TEST -Suite* legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp); +Suite *legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_ext_events_MsgExtEvent.c b/c/test/legacy/auto_check_sbp_ext_events_MsgExtEvent.c index 8b5f231b2..351886500 100644 --- a/c/test/legacy/auto_check_sbp_ext_events_MsgExtEvent.c +++ b/c/test/legacy/auto_check_sbp_ext_events_MsgExtEvent.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ext_events/test_MsgExtEvent.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ext_events/test_MsgExtEvent.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ext_events_MsgExtEvent ) -{ +START_TEST(test_legacy_auto_check_sbp_ext_events_MsgExtEvent) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ext_events_MsgExtEvent ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,84 +128,105 @@ START_TEST( test_legacy_auto_check_sbp_ext_events_MsgExtEvent ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x101, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x101, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x101, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x101, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,1,245,6,12,48,7,199,216,49,15,202,65,15,0,3,0,62,204, }; + u8 encoded_frame[] = { + 85, 1, 1, 245, 6, 12, 48, 7, 199, 216, + 49, 15, 202, 65, 15, 0, 3, 0, 62, 204, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ext_event_t* test_msg = ( msg_ext_event_t* )test_msg_storage; + msg_ext_event_t *test_msg = (msg_ext_event_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 3; test_msg->ns_residual = 999882; test_msg->pin = 0; test_msg->tow = 254924999; test_msg->wn = 1840; - sbp_payload_send(&sbp_state, 0x101, 1781, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x101, 1781, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1781, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1781, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x101, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ext_event_t* check_msg = ( msg_ext_event_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ext_event_t *check_msg = (msg_ext_event_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 3, "incorrect value for flags, expected 3, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 999882, "incorrect value for ns_residual, expected 999882, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->pin == 0, "incorrect value for pin, expected 0, is %d", check_msg->pin); - ck_assert_msg(check_msg->tow == 254924999, "incorrect value for tow, expected 254924999, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1840, "incorrect value for wn, expected 1840, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 3, + "incorrect value for flags, expected 3, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 999882, + "incorrect value for ns_residual, expected 999882, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->pin == 0, + "incorrect value for pin, expected 0, is %d", check_msg->pin); + ck_assert_msg(check_msg->tow == 254924999, + "incorrect value for tow, expected 254924999, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1840, + "incorrect value for wn, expected 1840, is %d", + check_msg->wn); } } END_TEST -Suite* legacy_auto_check_sbp_ext_events_MsgExtEvent_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ext_events_MsgExtEvent"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ext_events_MsgExtEvent"); +Suite *legacy_auto_check_sbp_ext_events_MsgExtEvent_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_ext_events_MsgExtEvent"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ext_events_MsgExtEvent"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ext_events_MsgExtEvent); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_file_io_MsgFileioConfigReq.c b/c/test/legacy/auto_check_sbp_file_io_MsgFileioConfigReq.c index 9f34dd6c4..598cfb9d7 100644 --- a/c/test/legacy/auto_check_sbp_file_io_MsgFileioConfigReq.c +++ b/c/test/legacy/auto_check_sbp_file_io_MsgFileioConfigReq.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioConfigReq ) -{ +START_TEST(test_legacy_auto_check_sbp_file_io_MsgFileioConfigReq) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioConfigReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,76 +128,92 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioConfigReq ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x1001, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x1001, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x1001, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x1001, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,16,195,4,4,107,218,69,90,185,27, }; + u8 encoded_frame[] = { + 85, 1, 16, 195, 4, 4, 107, 218, 69, 90, 185, 27, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_fileio_config_req_t* test_msg = ( msg_fileio_config_req_t* )test_msg_storage; + msg_fileio_config_req_t *test_msg = + (msg_fileio_config_req_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->sequence = 1514527339; - sbp_payload_send(&sbp_state, 0x1001, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x1001, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x1001, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_fileio_config_req_t* check_msg = ( msg_fileio_config_req_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_fileio_config_req_t *check_msg = + (msg_fileio_config_req_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->sequence == 1514527339, "incorrect value for sequence, expected 1514527339, is %d", check_msg->sequence); + ck_assert_msg(check_msg->sequence == 1514527339, + "incorrect value for sequence, expected 1514527339, is %d", + check_msg->sequence); } } END_TEST -Suite* legacy_auto_check_sbp_file_io_MsgFileioConfigReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_file_io_MsgFileioConfigReq"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioConfigReq"); +Suite *legacy_auto_check_sbp_file_io_MsgFileioConfigReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_file_io_MsgFileioConfigReq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioConfigReq"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_file_io_MsgFileioConfigReq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_file_io_MsgFileioConfigResp.c b/c/test/legacy/auto_check_sbp_file_io_MsgFileioConfigResp.c index c16162cd3..32a45d4e6 100644 --- a/c/test/legacy/auto_check_sbp_file_io_MsgFileioConfigResp.c +++ b/c/test/legacy/auto_check_sbp_file_io_MsgFileioConfigResp.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioConfigResp ) -{ +START_TEST(test_legacy_auto_check_sbp_file_io_MsgFileioConfigResp) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioConfigResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,83 +128,108 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioConfigResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x1002, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x1002, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x1002, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x1002, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,16,195,4,16,170,76,52,91,149,186,44,3,216,151,255,61,12,97,66,144,239,115, }; + u8 encoded_frame[] = { + 85, 2, 16, 195, 4, 16, 170, 76, 52, 91, 149, 186, + 44, 3, 216, 151, 255, 61, 12, 97, 66, 144, 239, 115, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_fileio_config_resp_t* test_msg = ( msg_fileio_config_resp_t* )test_msg_storage; + msg_fileio_config_resp_t *test_msg = + (msg_fileio_config_resp_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->batch_size = 1040160728; test_msg->fileio_version = 2420269324; test_msg->sequence = 1530154154; test_msg->window_size = 53262997; - sbp_payload_send(&sbp_state, 0x1002, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x1002, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x1002, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_fileio_config_resp_t* check_msg = ( msg_fileio_config_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_fileio_config_resp_t *check_msg = + (msg_fileio_config_resp_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->batch_size == 1040160728, "incorrect value for batch_size, expected 1040160728, is %d", check_msg->batch_size); - ck_assert_msg(check_msg->fileio_version == 2420269324, "incorrect value for fileio_version, expected 2420269324, is %d", check_msg->fileio_version); - ck_assert_msg(check_msg->sequence == 1530154154, "incorrect value for sequence, expected 1530154154, is %d", check_msg->sequence); - ck_assert_msg(check_msg->window_size == 53262997, "incorrect value for window_size, expected 53262997, is %d", check_msg->window_size); + ck_assert_msg(check_msg->batch_size == 1040160728, + "incorrect value for batch_size, expected 1040160728, is %d", + check_msg->batch_size); + ck_assert_msg( + check_msg->fileio_version == 2420269324, + "incorrect value for fileio_version, expected 2420269324, is %d", + check_msg->fileio_version); + ck_assert_msg(check_msg->sequence == 1530154154, + "incorrect value for sequence, expected 1530154154, is %d", + check_msg->sequence); + ck_assert_msg(check_msg->window_size == 53262997, + "incorrect value for window_size, expected 53262997, is %d", + check_msg->window_size); } } END_TEST -Suite* legacy_auto_check_sbp_file_io_MsgFileioConfigResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_file_io_MsgFileioConfigResp"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioConfigResp"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_file_io_MsgFileioConfigResp); +Suite *legacy_auto_check_sbp_file_io_MsgFileioConfigResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_file_io_MsgFileioConfigResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioConfigResp"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_file_io_MsgFileioConfigResp); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadDirReq.c b/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadDirReq.c index 03689887d..d2fdb6b78 100644 --- a/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadDirReq.c +++ b/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadDirReq.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq ) -{ +START_TEST(test_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,20 +128,30 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xa9, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xa9, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xa9, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xa9, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,169,0,195,4,26,130,231,255,90,196,134,47,134,47,115,111,109,101,47,114,97,110,100,111,109,47,112,97,116,104,0,26,186, }; + u8 encoded_frame[] = { + 85, 169, 0, 195, 4, 26, 130, 231, 255, 90, 196, 134, + 47, 134, 47, 115, 111, 109, 101, 47, 114, 97, 110, 100, + 111, 109, 47, 112, 97, 116, 104, 0, 26, 186, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_fileio_read_dir_req_t* test_msg = ( msg_fileio_read_dir_req_t* )test_msg_storage; + msg_fileio_read_dir_req_t *test_msg = + (msg_fileio_read_dir_req_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)47,(char)115,(char)111,(char)109,(char)101,(char)47,(char)114,(char)97,(char)110,(char)100,(char)111,(char)109,(char)47,(char)112,(char)97,(char)116,(char)104,(char)0 }; + const char assign_string[] = { + (char)47, (char)115, (char)111, (char)109, (char)101, (char)47, + (char)114, (char)97, (char)110, (char)100, (char)111, (char)109, + (char)47, (char)112, (char)97, (char)116, (char)104, (char)0}; memcpy(test_msg->dirname, assign_string, sizeof(assign_string)); if (sizeof(test_msg->dirname) == 0) { test_msg_len += sizeof(assign_string); @@ -152,69 +159,90 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq ) } test_msg->offset = 2251261636; test_msg->sequence = 1526720386; - sbp_payload_send(&sbp_state, 0xa9, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xa9, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xa9, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_fileio_read_dir_req_t* check_msg = ( msg_fileio_read_dir_req_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_fileio_read_dir_req_t *check_msg = + (msg_fileio_read_dir_req_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)47,(char)115,(char)111,(char)109,(char)101,(char)47,(char)114,(char)97,(char)110,(char)100,(char)111,(char)109,(char)47,(char)112,(char)97,(char)116,(char)104,(char)0 }; - ck_assert_msg(memcmp(check_msg->dirname, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->dirname, expected string '%s', is '%s'", check_string, check_msg->dirname); + const char check_string[] = { + (char)47, (char)115, (char)111, (char)109, (char)101, (char)47, + (char)114, (char)97, (char)110, (char)100, (char)111, (char)109, + (char)47, (char)112, (char)97, (char)116, (char)104, (char)0}; + ck_assert_msg( + memcmp(check_msg->dirname, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->dirname, expected string '%s', is " + "'%s'", + check_string, check_msg->dirname); } - ck_assert_msg(check_msg->offset == 2251261636, "incorrect value for offset, expected 2251261636, is %d", check_msg->offset); - ck_assert_msg(check_msg->sequence == 1526720386, "incorrect value for sequence, expected 1526720386, is %d", check_msg->sequence); + ck_assert_msg(check_msg->offset == 2251261636, + "incorrect value for offset, expected 2251261636, is %d", + check_msg->offset); + ck_assert_msg(check_msg->sequence == 1526720386, + "incorrect value for sequence, expected 1526720386, is %d", + check_msg->sequence); } } END_TEST -Suite* legacy_auto_check_sbp_file_io_MsgFileioReadDirReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_file_io_MsgFileioReadDirReq"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq); +Suite *legacy_auto_check_sbp_file_io_MsgFileioReadDirReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_file_io_MsgFileioReadDirReq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadDirResp.c b/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadDirResp.c index 69934105b..326ea2c32 100644 --- a/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadDirResp.c +++ b/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadDirResp.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioReadDirResp ) -{ +START_TEST(test_legacy_auto_check_sbp_file_io_MsgFileioReadDirResp) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioReadDirResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,88 +128,126 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioReadDirResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xaa, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xaa, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xaa, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xaa, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,170,0,195,4,45,78,253,224,235,102,105,108,101,49,0,97,110,111,116,104,101,114,32,102,105,108,101,0,100,101,102,105,110,105,116,101,108,121,32,110,111,116,32,97,32,102,105,108,101,0,186,137, }; + u8 encoded_frame[] = { + 85, 170, 0, 195, 4, 45, 78, 253, 224, 235, 102, 105, 108, 101, + 49, 0, 97, 110, 111, 116, 104, 101, 114, 32, 102, 105, 108, 101, + 0, 100, 101, 102, 105, 110, 105, 116, 101, 108, 121, 32, 110, 111, + 116, 32, 97, 32, 102, 105, 108, 101, 0, 186, 137, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_fileio_read_dir_resp_t* test_msg = ( msg_fileio_read_dir_resp_t* )test_msg_storage; + msg_fileio_read_dir_resp_t *test_msg = + (msg_fileio_read_dir_resp_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)102,(char)105,(char)108,(char)101,(char)49,(char)0,(char)97,(char)110,(char)111,(char)116,(char)104,(char)101,(char)114,(char)32,(char)102,(char)105,(char)108,(char)101,(char)0,(char)100,(char)101,(char)102,(char)105,(char)110,(char)105,(char)116,(char)101,(char)108,(char)121,(char)32,(char)110,(char)111,(char)116,(char)32,(char)97,(char)32,(char)102,(char)105,(char)108,(char)101,(char)0 }; + const char assign_string[] = { + (char)102, (char)105, (char)108, (char)101, (char)49, (char)0, + (char)97, (char)110, (char)111, (char)116, (char)104, (char)101, + (char)114, (char)32, (char)102, (char)105, (char)108, (char)101, + (char)0, (char)100, (char)101, (char)102, (char)105, (char)110, + (char)105, (char)116, (char)101, (char)108, (char)121, (char)32, + (char)110, (char)111, (char)116, (char)32, (char)97, (char)32, + (char)102, (char)105, (char)108, (char)101, (char)0}; memcpy(test_msg->contents, assign_string, sizeof(assign_string)); if (sizeof(test_msg->contents) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->sequence = 3957390670; - sbp_payload_send(&sbp_state, 0xaa, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xaa, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xaa, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_fileio_read_dir_resp_t* check_msg = ( msg_fileio_read_dir_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_fileio_read_dir_resp_t *check_msg = + (msg_fileio_read_dir_resp_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)102,(char)105,(char)108,(char)101,(char)49,(char)0,(char)97,(char)110,(char)111,(char)116,(char)104,(char)101,(char)114,(char)32,(char)102,(char)105,(char)108,(char)101,(char)0,(char)100,(char)101,(char)102,(char)105,(char)110,(char)105,(char)116,(char)101,(char)108,(char)121,(char)32,(char)110,(char)111,(char)116,(char)32,(char)97,(char)32,(char)102,(char)105,(char)108,(char)101,(char)0 }; - ck_assert_msg(memcmp(check_msg->contents, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->contents, expected string '%s', is '%s'", check_string, check_msg->contents); + const char check_string[] = { + (char)102, (char)105, (char)108, (char)101, (char)49, (char)0, + (char)97, (char)110, (char)111, (char)116, (char)104, (char)101, + (char)114, (char)32, (char)102, (char)105, (char)108, (char)101, + (char)0, (char)100, (char)101, (char)102, (char)105, (char)110, + (char)105, (char)116, (char)101, (char)108, (char)121, (char)32, + (char)110, (char)111, (char)116, (char)32, (char)97, (char)32, + (char)102, (char)105, (char)108, (char)101, (char)0}; + ck_assert_msg( + memcmp(check_msg->contents, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->contents, expected string '%s', is " + "'%s'", + check_string, check_msg->contents); } - ck_assert_msg(check_msg->sequence == 3957390670, "incorrect value for sequence, expected 3957390670, is %d", check_msg->sequence); + ck_assert_msg(check_msg->sequence == 3957390670, + "incorrect value for sequence, expected 3957390670, is %d", + check_msg->sequence); } } END_TEST -Suite* legacy_auto_check_sbp_file_io_MsgFileioReadDirResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_file_io_MsgFileioReadDirResp"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioReadDirResp"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_file_io_MsgFileioReadDirResp); +Suite *legacy_auto_check_sbp_file_io_MsgFileioReadDirResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_file_io_MsgFileioReadDirResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioReadDirResp"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_file_io_MsgFileioReadDirResp); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadReq.c b/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadReq.c index f70f190da..22ac4b22f 100644 --- a/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadReq.c +++ b/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadReq.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioReadReq ) -{ +START_TEST(test_legacy_auto_check_sbp_file_io_MsgFileioReadReq) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioReadReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,21 +128,31 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioReadReq ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xa8, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xa8, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xa8, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xa8, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,168,0,195,4,28,34,156,130,40,98,178,190,23,53,47,112,97,116,104,47,116,111,47,115,111,109,101,47,102,105,108,101,0,86,100, }; + u8 encoded_frame[] = { + 85, 168, 0, 195, 4, 28, 34, 156, 130, 40, 98, 178, + 190, 23, 53, 47, 112, 97, 116, 104, 47, 116, 111, 47, + 115, 111, 109, 101, 47, 102, 105, 108, 101, 0, 86, 100, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_fileio_read_req_t* test_msg = ( msg_fileio_read_req_t* )test_msg_storage; + msg_fileio_read_req_t *test_msg = (msg_fileio_read_req_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->chunk_size = 53; { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)115,(char)111,(char)109,(char)101,(char)47,(char)102,(char)105,(char)108,(char)101,(char)0 }; + const char assign_string[] = {(char)47, (char)112, (char)97, (char)116, + (char)104, (char)47, (char)116, (char)111, + (char)47, (char)115, (char)111, (char)109, + (char)101, (char)47, (char)102, (char)105, + (char)108, (char)101, (char)0}; memcpy(test_msg->filename, assign_string, sizeof(assign_string)); if (sizeof(test_msg->filename) == 0) { test_msg_len += sizeof(assign_string); @@ -153,69 +160,92 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioReadReq ) } test_msg->offset = 398373474; test_msg->sequence = 679648290; - sbp_payload_send(&sbp_state, 0xa8, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xa8, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xa8, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_fileio_read_req_t* check_msg = ( msg_fileio_read_req_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_fileio_read_req_t *check_msg = + (msg_fileio_read_req_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->chunk_size == 53, "incorrect value for chunk_size, expected 53, is %d", check_msg->chunk_size); + ck_assert_msg(check_msg->chunk_size == 53, + "incorrect value for chunk_size, expected 53, is %d", + check_msg->chunk_size); { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)115,(char)111,(char)109,(char)101,(char)47,(char)102,(char)105,(char)108,(char)101,(char)0 }; - ck_assert_msg(memcmp(check_msg->filename, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->filename, expected string '%s', is '%s'", check_string, check_msg->filename); + const char check_string[] = {(char)47, (char)112, (char)97, (char)116, + (char)104, (char)47, (char)116, (char)111, + (char)47, (char)115, (char)111, (char)109, + (char)101, (char)47, (char)102, (char)105, + (char)108, (char)101, (char)0}; + ck_assert_msg( + memcmp(check_msg->filename, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->filename, expected string '%s', is " + "'%s'", + check_string, check_msg->filename); } - ck_assert_msg(check_msg->offset == 398373474, "incorrect value for offset, expected 398373474, is %d", check_msg->offset); - ck_assert_msg(check_msg->sequence == 679648290, "incorrect value for sequence, expected 679648290, is %d", check_msg->sequence); + ck_assert_msg(check_msg->offset == 398373474, + "incorrect value for offset, expected 398373474, is %d", + check_msg->offset); + ck_assert_msg(check_msg->sequence == 679648290, + "incorrect value for sequence, expected 679648290, is %d", + check_msg->sequence); } } END_TEST -Suite* legacy_auto_check_sbp_file_io_MsgFileioReadReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_file_io_MsgFileioReadReq"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioReadReq"); +Suite *legacy_auto_check_sbp_file_io_MsgFileioReadReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_file_io_MsgFileioReadReq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioReadReq"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_file_io_MsgFileioReadReq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadResp.c b/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadResp.c index e1b39c740..b8143ef74 100644 --- a/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadResp.c +++ b/c/test/legacy/auto_check_sbp_file_io_MsgFileioReadResp.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioReadResp ) -{ +START_TEST(test_legacy_auto_check_sbp_file_io_MsgFileioReadResp) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioReadResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,40 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioReadResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xa3, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xa3, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xa3, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xa3, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,163,0,195,4,255,67,183,115,15,73,231,227,179,18,76,68,229,216,21,98,183,69,190,5,252,176,55,32,78,8,52,127,50,71,106,61,79,191,106,46,79,118,248,118,207,206,210,91,73,251,81,131,205,193,146,206,185,140,249,163,231,65,67,94,250,109,152,95,123,77,224,124,238,205,65,103,35,104,209,5,191,47,249,176,166,213,46,192,86,32,103,146,252,4,16,54,161,60,6,13,191,116,182,42,191,213,20,217,8,142,187,238,120,184,250,31,151,37,51,177,130,190,155,71,68,56,238,92,130,37,137,146,246,114,116,138,165,217,79,10,189,128,189,2,240,92,28,126,105,236,228,194,0,51,61,74,41,10,239,133,106,190,30,27,3,240,205,253,113,25,28,187,81,101,216,121,41,179,120,152,18,116,53,212,100,2,114,198,200,10,147,25,33,115,208,113,60,179,183,0,41,217,206,255,211,225,142,191,133,81,15,248,193,66,191,244,221,248,199,241,112,51,1,180,180,125,97,145,25,72,210,215,208,15,126,56,38,65,4,64,19,74,223,111,109,52,43,167,186,202,111,11,91,21,236,234,196,36,171,147,10,240, }; + u8 encoded_frame[] = { + 85, 163, 0, 195, 4, 255, 67, 183, 115, 15, 73, 231, 227, 179, + 18, 76, 68, 229, 216, 21, 98, 183, 69, 190, 5, 252, 176, 55, + 32, 78, 8, 52, 127, 50, 71, 106, 61, 79, 191, 106, 46, 79, + 118, 248, 118, 207, 206, 210, 91, 73, 251, 81, 131, 205, 193, 146, + 206, 185, 140, 249, 163, 231, 65, 67, 94, 250, 109, 152, 95, 123, + 77, 224, 124, 238, 205, 65, 103, 35, 104, 209, 5, 191, 47, 249, + 176, 166, 213, 46, 192, 86, 32, 103, 146, 252, 4, 16, 54, 161, + 60, 6, 13, 191, 116, 182, 42, 191, 213, 20, 217, 8, 142, 187, + 238, 120, 184, 250, 31, 151, 37, 51, 177, 130, 190, 155, 71, 68, + 56, 238, 92, 130, 37, 137, 146, 246, 114, 116, 138, 165, 217, 79, + 10, 189, 128, 189, 2, 240, 92, 28, 126, 105, 236, 228, 194, 0, + 51, 61, 74, 41, 10, 239, 133, 106, 190, 30, 27, 3, 240, 205, + 253, 113, 25, 28, 187, 81, 101, 216, 121, 41, 179, 120, 152, 18, + 116, 53, 212, 100, 2, 114, 198, 200, 10, 147, 25, 33, 115, 208, + 113, 60, 179, 183, 0, 41, 217, 206, 255, 211, 225, 142, 191, 133, + 81, 15, 248, 193, 66, 191, 244, 221, 248, 199, 241, 112, 51, 1, + 180, 180, 125, 97, 145, 25, 72, 210, 215, 208, 15, 126, 56, 38, + 65, 4, 64, 19, 74, 223, 111, 109, 52, 43, 167, 186, 202, 111, + 11, 91, 21, 236, 234, 196, 36, 171, 147, 10, 240, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_fileio_read_resp_t* test_msg = ( msg_fileio_read_resp_t* )test_msg_storage; + msg_fileio_read_resp_t *test_msg = + (msg_fileio_read_resp_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->contents) == 0) { // Cope with variable length arrays @@ -1399,314 +1419,827 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioReadResp ) } test_msg->contents[250] = 147; test_msg->sequence = 259241795; - sbp_payload_send(&sbp_state, 0xa3, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xa3, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xa3, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_fileio_read_resp_t* check_msg = ( msg_fileio_read_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_fileio_read_resp_t *check_msg = + (msg_fileio_read_resp_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->contents[0] == 73, "incorrect value for contents[0], expected 73, is %d", check_msg->contents[0]); - ck_assert_msg(check_msg->contents[1] == 231, "incorrect value for contents[1], expected 231, is %d", check_msg->contents[1]); - ck_assert_msg(check_msg->contents[2] == 227, "incorrect value for contents[2], expected 227, is %d", check_msg->contents[2]); - ck_assert_msg(check_msg->contents[3] == 179, "incorrect value for contents[3], expected 179, is %d", check_msg->contents[3]); - ck_assert_msg(check_msg->contents[4] == 18, "incorrect value for contents[4], expected 18, is %d", check_msg->contents[4]); - ck_assert_msg(check_msg->contents[5] == 76, "incorrect value for contents[5], expected 76, is %d", check_msg->contents[5]); - ck_assert_msg(check_msg->contents[6] == 68, "incorrect value for contents[6], expected 68, is %d", check_msg->contents[6]); - ck_assert_msg(check_msg->contents[7] == 229, "incorrect value for contents[7], expected 229, is %d", check_msg->contents[7]); - ck_assert_msg(check_msg->contents[8] == 216, "incorrect value for contents[8], expected 216, is %d", check_msg->contents[8]); - ck_assert_msg(check_msg->contents[9] == 21, "incorrect value for contents[9], expected 21, is %d", check_msg->contents[9]); - ck_assert_msg(check_msg->contents[10] == 98, "incorrect value for contents[10], expected 98, is %d", check_msg->contents[10]); - ck_assert_msg(check_msg->contents[11] == 183, "incorrect value for contents[11], expected 183, is %d", check_msg->contents[11]); - ck_assert_msg(check_msg->contents[12] == 69, "incorrect value for contents[12], expected 69, is %d", check_msg->contents[12]); - ck_assert_msg(check_msg->contents[13] == 190, "incorrect value for contents[13], expected 190, is %d", check_msg->contents[13]); - ck_assert_msg(check_msg->contents[14] == 5, "incorrect value for contents[14], expected 5, is %d", check_msg->contents[14]); - ck_assert_msg(check_msg->contents[15] == 252, "incorrect value for contents[15], expected 252, is %d", check_msg->contents[15]); - ck_assert_msg(check_msg->contents[16] == 176, "incorrect value for contents[16], expected 176, is %d", check_msg->contents[16]); - ck_assert_msg(check_msg->contents[17] == 55, "incorrect value for contents[17], expected 55, is %d", check_msg->contents[17]); - ck_assert_msg(check_msg->contents[18] == 32, "incorrect value for contents[18], expected 32, is %d", check_msg->contents[18]); - ck_assert_msg(check_msg->contents[19] == 78, "incorrect value for contents[19], expected 78, is %d", check_msg->contents[19]); - ck_assert_msg(check_msg->contents[20] == 8, "incorrect value for contents[20], expected 8, is %d", check_msg->contents[20]); - ck_assert_msg(check_msg->contents[21] == 52, "incorrect value for contents[21], expected 52, is %d", check_msg->contents[21]); - ck_assert_msg(check_msg->contents[22] == 127, "incorrect value for contents[22], expected 127, is %d", check_msg->contents[22]); - ck_assert_msg(check_msg->contents[23] == 50, "incorrect value for contents[23], expected 50, is %d", check_msg->contents[23]); - ck_assert_msg(check_msg->contents[24] == 71, "incorrect value for contents[24], expected 71, is %d", check_msg->contents[24]); - ck_assert_msg(check_msg->contents[25] == 106, "incorrect value for contents[25], expected 106, is %d", check_msg->contents[25]); - ck_assert_msg(check_msg->contents[26] == 61, "incorrect value for contents[26], expected 61, is %d", check_msg->contents[26]); - ck_assert_msg(check_msg->contents[27] == 79, "incorrect value for contents[27], expected 79, is %d", check_msg->contents[27]); - ck_assert_msg(check_msg->contents[28] == 191, "incorrect value for contents[28], expected 191, is %d", check_msg->contents[28]); - ck_assert_msg(check_msg->contents[29] == 106, "incorrect value for contents[29], expected 106, is %d", check_msg->contents[29]); - ck_assert_msg(check_msg->contents[30] == 46, "incorrect value for contents[30], expected 46, is %d", check_msg->contents[30]); - ck_assert_msg(check_msg->contents[31] == 79, "incorrect value for contents[31], expected 79, is %d", check_msg->contents[31]); - ck_assert_msg(check_msg->contents[32] == 118, "incorrect value for contents[32], expected 118, is %d", check_msg->contents[32]); - ck_assert_msg(check_msg->contents[33] == 248, "incorrect value for contents[33], expected 248, is %d", check_msg->contents[33]); - ck_assert_msg(check_msg->contents[34] == 118, "incorrect value for contents[34], expected 118, is %d", check_msg->contents[34]); - ck_assert_msg(check_msg->contents[35] == 207, "incorrect value for contents[35], expected 207, is %d", check_msg->contents[35]); - ck_assert_msg(check_msg->contents[36] == 206, "incorrect value for contents[36], expected 206, is %d", check_msg->contents[36]); - ck_assert_msg(check_msg->contents[37] == 210, "incorrect value for contents[37], expected 210, is %d", check_msg->contents[37]); - ck_assert_msg(check_msg->contents[38] == 91, "incorrect value for contents[38], expected 91, is %d", check_msg->contents[38]); - ck_assert_msg(check_msg->contents[39] == 73, "incorrect value for contents[39], expected 73, is %d", check_msg->contents[39]); - ck_assert_msg(check_msg->contents[40] == 251, "incorrect value for contents[40], expected 251, is %d", check_msg->contents[40]); - ck_assert_msg(check_msg->contents[41] == 81, "incorrect value for contents[41], expected 81, is %d", check_msg->contents[41]); - ck_assert_msg(check_msg->contents[42] == 131, "incorrect value for contents[42], expected 131, is %d", check_msg->contents[42]); - ck_assert_msg(check_msg->contents[43] == 205, "incorrect value for contents[43], expected 205, is %d", check_msg->contents[43]); - ck_assert_msg(check_msg->contents[44] == 193, "incorrect value for contents[44], expected 193, is %d", check_msg->contents[44]); - ck_assert_msg(check_msg->contents[45] == 146, "incorrect value for contents[45], expected 146, is %d", check_msg->contents[45]); - ck_assert_msg(check_msg->contents[46] == 206, "incorrect value for contents[46], expected 206, is %d", check_msg->contents[46]); - ck_assert_msg(check_msg->contents[47] == 185, "incorrect value for contents[47], expected 185, is %d", check_msg->contents[47]); - ck_assert_msg(check_msg->contents[48] == 140, "incorrect value for contents[48], expected 140, is %d", check_msg->contents[48]); - ck_assert_msg(check_msg->contents[49] == 249, "incorrect value for contents[49], expected 249, is %d", check_msg->contents[49]); - ck_assert_msg(check_msg->contents[50] == 163, "incorrect value for contents[50], expected 163, is %d", check_msg->contents[50]); - ck_assert_msg(check_msg->contents[51] == 231, "incorrect value for contents[51], expected 231, is %d", check_msg->contents[51]); - ck_assert_msg(check_msg->contents[52] == 65, "incorrect value for contents[52], expected 65, is %d", check_msg->contents[52]); - ck_assert_msg(check_msg->contents[53] == 67, "incorrect value for contents[53], expected 67, is %d", check_msg->contents[53]); - ck_assert_msg(check_msg->contents[54] == 94, "incorrect value for contents[54], expected 94, is %d", check_msg->contents[54]); - ck_assert_msg(check_msg->contents[55] == 250, "incorrect value for contents[55], expected 250, is %d", check_msg->contents[55]); - ck_assert_msg(check_msg->contents[56] == 109, "incorrect value for contents[56], expected 109, is %d", check_msg->contents[56]); - ck_assert_msg(check_msg->contents[57] == 152, "incorrect value for contents[57], expected 152, is %d", check_msg->contents[57]); - ck_assert_msg(check_msg->contents[58] == 95, "incorrect value for contents[58], expected 95, is %d", check_msg->contents[58]); - ck_assert_msg(check_msg->contents[59] == 123, "incorrect value for contents[59], expected 123, is %d", check_msg->contents[59]); - ck_assert_msg(check_msg->contents[60] == 77, "incorrect value for contents[60], expected 77, is %d", check_msg->contents[60]); - ck_assert_msg(check_msg->contents[61] == 224, "incorrect value for contents[61], expected 224, is %d", check_msg->contents[61]); - ck_assert_msg(check_msg->contents[62] == 124, "incorrect value for contents[62], expected 124, is %d", check_msg->contents[62]); - ck_assert_msg(check_msg->contents[63] == 238, "incorrect value for contents[63], expected 238, is %d", check_msg->contents[63]); - ck_assert_msg(check_msg->contents[64] == 205, "incorrect value for contents[64], expected 205, is %d", check_msg->contents[64]); - ck_assert_msg(check_msg->contents[65] == 65, "incorrect value for contents[65], expected 65, is %d", check_msg->contents[65]); - ck_assert_msg(check_msg->contents[66] == 103, "incorrect value for contents[66], expected 103, is %d", check_msg->contents[66]); - ck_assert_msg(check_msg->contents[67] == 35, "incorrect value for contents[67], expected 35, is %d", check_msg->contents[67]); - ck_assert_msg(check_msg->contents[68] == 104, "incorrect value for contents[68], expected 104, is %d", check_msg->contents[68]); - ck_assert_msg(check_msg->contents[69] == 209, "incorrect value for contents[69], expected 209, is %d", check_msg->contents[69]); - ck_assert_msg(check_msg->contents[70] == 5, "incorrect value for contents[70], expected 5, is %d", check_msg->contents[70]); - ck_assert_msg(check_msg->contents[71] == 191, "incorrect value for contents[71], expected 191, is %d", check_msg->contents[71]); - ck_assert_msg(check_msg->contents[72] == 47, "incorrect value for contents[72], expected 47, is %d", check_msg->contents[72]); - ck_assert_msg(check_msg->contents[73] == 249, "incorrect value for contents[73], expected 249, is %d", check_msg->contents[73]); - ck_assert_msg(check_msg->contents[74] == 176, "incorrect value for contents[74], expected 176, is %d", check_msg->contents[74]); - ck_assert_msg(check_msg->contents[75] == 166, "incorrect value for contents[75], expected 166, is %d", check_msg->contents[75]); - ck_assert_msg(check_msg->contents[76] == 213, "incorrect value for contents[76], expected 213, is %d", check_msg->contents[76]); - ck_assert_msg(check_msg->contents[77] == 46, "incorrect value for contents[77], expected 46, is %d", check_msg->contents[77]); - ck_assert_msg(check_msg->contents[78] == 192, "incorrect value for contents[78], expected 192, is %d", check_msg->contents[78]); - ck_assert_msg(check_msg->contents[79] == 86, "incorrect value for contents[79], expected 86, is %d", check_msg->contents[79]); - ck_assert_msg(check_msg->contents[80] == 32, "incorrect value for contents[80], expected 32, is %d", check_msg->contents[80]); - ck_assert_msg(check_msg->contents[81] == 103, "incorrect value for contents[81], expected 103, is %d", check_msg->contents[81]); - ck_assert_msg(check_msg->contents[82] == 146, "incorrect value for contents[82], expected 146, is %d", check_msg->contents[82]); - ck_assert_msg(check_msg->contents[83] == 252, "incorrect value for contents[83], expected 252, is %d", check_msg->contents[83]); - ck_assert_msg(check_msg->contents[84] == 4, "incorrect value for contents[84], expected 4, is %d", check_msg->contents[84]); - ck_assert_msg(check_msg->contents[85] == 16, "incorrect value for contents[85], expected 16, is %d", check_msg->contents[85]); - ck_assert_msg(check_msg->contents[86] == 54, "incorrect value for contents[86], expected 54, is %d", check_msg->contents[86]); - ck_assert_msg(check_msg->contents[87] == 161, "incorrect value for contents[87], expected 161, is %d", check_msg->contents[87]); - ck_assert_msg(check_msg->contents[88] == 60, "incorrect value for contents[88], expected 60, is %d", check_msg->contents[88]); - ck_assert_msg(check_msg->contents[89] == 6, "incorrect value for contents[89], expected 6, is %d", check_msg->contents[89]); - ck_assert_msg(check_msg->contents[90] == 13, "incorrect value for contents[90], expected 13, is %d", check_msg->contents[90]); - ck_assert_msg(check_msg->contents[91] == 191, "incorrect value for contents[91], expected 191, is %d", check_msg->contents[91]); - ck_assert_msg(check_msg->contents[92] == 116, "incorrect value for contents[92], expected 116, is %d", check_msg->contents[92]); - ck_assert_msg(check_msg->contents[93] == 182, "incorrect value for contents[93], expected 182, is %d", check_msg->contents[93]); - ck_assert_msg(check_msg->contents[94] == 42, "incorrect value for contents[94], expected 42, is %d", check_msg->contents[94]); - ck_assert_msg(check_msg->contents[95] == 191, "incorrect value for contents[95], expected 191, is %d", check_msg->contents[95]); - ck_assert_msg(check_msg->contents[96] == 213, "incorrect value for contents[96], expected 213, is %d", check_msg->contents[96]); - ck_assert_msg(check_msg->contents[97] == 20, "incorrect value for contents[97], expected 20, is %d", check_msg->contents[97]); - ck_assert_msg(check_msg->contents[98] == 217, "incorrect value for contents[98], expected 217, is %d", check_msg->contents[98]); - ck_assert_msg(check_msg->contents[99] == 8, "incorrect value for contents[99], expected 8, is %d", check_msg->contents[99]); - ck_assert_msg(check_msg->contents[100] == 142, "incorrect value for contents[100], expected 142, is %d", check_msg->contents[100]); - ck_assert_msg(check_msg->contents[101] == 187, "incorrect value for contents[101], expected 187, is %d", check_msg->contents[101]); - ck_assert_msg(check_msg->contents[102] == 238, "incorrect value for contents[102], expected 238, is %d", check_msg->contents[102]); - ck_assert_msg(check_msg->contents[103] == 120, "incorrect value for contents[103], expected 120, is %d", check_msg->contents[103]); - ck_assert_msg(check_msg->contents[104] == 184, "incorrect value for contents[104], expected 184, is %d", check_msg->contents[104]); - ck_assert_msg(check_msg->contents[105] == 250, "incorrect value for contents[105], expected 250, is %d", check_msg->contents[105]); - ck_assert_msg(check_msg->contents[106] == 31, "incorrect value for contents[106], expected 31, is %d", check_msg->contents[106]); - ck_assert_msg(check_msg->contents[107] == 151, "incorrect value for contents[107], expected 151, is %d", check_msg->contents[107]); - ck_assert_msg(check_msg->contents[108] == 37, "incorrect value for contents[108], expected 37, is %d", check_msg->contents[108]); - ck_assert_msg(check_msg->contents[109] == 51, "incorrect value for contents[109], expected 51, is %d", check_msg->contents[109]); - ck_assert_msg(check_msg->contents[110] == 177, "incorrect value for contents[110], expected 177, is %d", check_msg->contents[110]); - ck_assert_msg(check_msg->contents[111] == 130, "incorrect value for contents[111], expected 130, is %d", check_msg->contents[111]); - ck_assert_msg(check_msg->contents[112] == 190, "incorrect value for contents[112], expected 190, is %d", check_msg->contents[112]); - ck_assert_msg(check_msg->contents[113] == 155, "incorrect value for contents[113], expected 155, is %d", check_msg->contents[113]); - ck_assert_msg(check_msg->contents[114] == 71, "incorrect value for contents[114], expected 71, is %d", check_msg->contents[114]); - ck_assert_msg(check_msg->contents[115] == 68, "incorrect value for contents[115], expected 68, is %d", check_msg->contents[115]); - ck_assert_msg(check_msg->contents[116] == 56, "incorrect value for contents[116], expected 56, is %d", check_msg->contents[116]); - ck_assert_msg(check_msg->contents[117] == 238, "incorrect value for contents[117], expected 238, is %d", check_msg->contents[117]); - ck_assert_msg(check_msg->contents[118] == 92, "incorrect value for contents[118], expected 92, is %d", check_msg->contents[118]); - ck_assert_msg(check_msg->contents[119] == 130, "incorrect value for contents[119], expected 130, is %d", check_msg->contents[119]); - ck_assert_msg(check_msg->contents[120] == 37, "incorrect value for contents[120], expected 37, is %d", check_msg->contents[120]); - ck_assert_msg(check_msg->contents[121] == 137, "incorrect value for contents[121], expected 137, is %d", check_msg->contents[121]); - ck_assert_msg(check_msg->contents[122] == 146, "incorrect value for contents[122], expected 146, is %d", check_msg->contents[122]); - ck_assert_msg(check_msg->contents[123] == 246, "incorrect value for contents[123], expected 246, is %d", check_msg->contents[123]); - ck_assert_msg(check_msg->contents[124] == 114, "incorrect value for contents[124], expected 114, is %d", check_msg->contents[124]); - ck_assert_msg(check_msg->contents[125] == 116, "incorrect value for contents[125], expected 116, is %d", check_msg->contents[125]); - ck_assert_msg(check_msg->contents[126] == 138, "incorrect value for contents[126], expected 138, is %d", check_msg->contents[126]); - ck_assert_msg(check_msg->contents[127] == 165, "incorrect value for contents[127], expected 165, is %d", check_msg->contents[127]); - ck_assert_msg(check_msg->contents[128] == 217, "incorrect value for contents[128], expected 217, is %d", check_msg->contents[128]); - ck_assert_msg(check_msg->contents[129] == 79, "incorrect value for contents[129], expected 79, is %d", check_msg->contents[129]); - ck_assert_msg(check_msg->contents[130] == 10, "incorrect value for contents[130], expected 10, is %d", check_msg->contents[130]); - ck_assert_msg(check_msg->contents[131] == 189, "incorrect value for contents[131], expected 189, is %d", check_msg->contents[131]); - ck_assert_msg(check_msg->contents[132] == 128, "incorrect value for contents[132], expected 128, is %d", check_msg->contents[132]); - ck_assert_msg(check_msg->contents[133] == 189, "incorrect value for contents[133], expected 189, is %d", check_msg->contents[133]); - ck_assert_msg(check_msg->contents[134] == 2, "incorrect value for contents[134], expected 2, is %d", check_msg->contents[134]); - ck_assert_msg(check_msg->contents[135] == 240, "incorrect value for contents[135], expected 240, is %d", check_msg->contents[135]); - ck_assert_msg(check_msg->contents[136] == 92, "incorrect value for contents[136], expected 92, is %d", check_msg->contents[136]); - ck_assert_msg(check_msg->contents[137] == 28, "incorrect value for contents[137], expected 28, is %d", check_msg->contents[137]); - ck_assert_msg(check_msg->contents[138] == 126, "incorrect value for contents[138], expected 126, is %d", check_msg->contents[138]); - ck_assert_msg(check_msg->contents[139] == 105, "incorrect value for contents[139], expected 105, is %d", check_msg->contents[139]); - ck_assert_msg(check_msg->contents[140] == 236, "incorrect value for contents[140], expected 236, is %d", check_msg->contents[140]); - ck_assert_msg(check_msg->contents[141] == 228, "incorrect value for contents[141], expected 228, is %d", check_msg->contents[141]); - ck_assert_msg(check_msg->contents[142] == 194, "incorrect value for contents[142], expected 194, is %d", check_msg->contents[142]); - ck_assert_msg(check_msg->contents[143] == 0, "incorrect value for contents[143], expected 0, is %d", check_msg->contents[143]); - ck_assert_msg(check_msg->contents[144] == 51, "incorrect value for contents[144], expected 51, is %d", check_msg->contents[144]); - ck_assert_msg(check_msg->contents[145] == 61, "incorrect value for contents[145], expected 61, is %d", check_msg->contents[145]); - ck_assert_msg(check_msg->contents[146] == 74, "incorrect value for contents[146], expected 74, is %d", check_msg->contents[146]); - ck_assert_msg(check_msg->contents[147] == 41, "incorrect value for contents[147], expected 41, is %d", check_msg->contents[147]); - ck_assert_msg(check_msg->contents[148] == 10, "incorrect value for contents[148], expected 10, is %d", check_msg->contents[148]); - ck_assert_msg(check_msg->contents[149] == 239, "incorrect value for contents[149], expected 239, is %d", check_msg->contents[149]); - ck_assert_msg(check_msg->contents[150] == 133, "incorrect value for contents[150], expected 133, is %d", check_msg->contents[150]); - ck_assert_msg(check_msg->contents[151] == 106, "incorrect value for contents[151], expected 106, is %d", check_msg->contents[151]); - ck_assert_msg(check_msg->contents[152] == 190, "incorrect value for contents[152], expected 190, is %d", check_msg->contents[152]); - ck_assert_msg(check_msg->contents[153] == 30, "incorrect value for contents[153], expected 30, is %d", check_msg->contents[153]); - ck_assert_msg(check_msg->contents[154] == 27, "incorrect value for contents[154], expected 27, is %d", check_msg->contents[154]); - ck_assert_msg(check_msg->contents[155] == 3, "incorrect value for contents[155], expected 3, is %d", check_msg->contents[155]); - ck_assert_msg(check_msg->contents[156] == 240, "incorrect value for contents[156], expected 240, is %d", check_msg->contents[156]); - ck_assert_msg(check_msg->contents[157] == 205, "incorrect value for contents[157], expected 205, is %d", check_msg->contents[157]); - ck_assert_msg(check_msg->contents[158] == 253, "incorrect value for contents[158], expected 253, is %d", check_msg->contents[158]); - ck_assert_msg(check_msg->contents[159] == 113, "incorrect value for contents[159], expected 113, is %d", check_msg->contents[159]); - ck_assert_msg(check_msg->contents[160] == 25, "incorrect value for contents[160], expected 25, is %d", check_msg->contents[160]); - ck_assert_msg(check_msg->contents[161] == 28, "incorrect value for contents[161], expected 28, is %d", check_msg->contents[161]); - ck_assert_msg(check_msg->contents[162] == 187, "incorrect value for contents[162], expected 187, is %d", check_msg->contents[162]); - ck_assert_msg(check_msg->contents[163] == 81, "incorrect value for contents[163], expected 81, is %d", check_msg->contents[163]); - ck_assert_msg(check_msg->contents[164] == 101, "incorrect value for contents[164], expected 101, is %d", check_msg->contents[164]); - ck_assert_msg(check_msg->contents[165] == 216, "incorrect value for contents[165], expected 216, is %d", check_msg->contents[165]); - ck_assert_msg(check_msg->contents[166] == 121, "incorrect value for contents[166], expected 121, is %d", check_msg->contents[166]); - ck_assert_msg(check_msg->contents[167] == 41, "incorrect value for contents[167], expected 41, is %d", check_msg->contents[167]); - ck_assert_msg(check_msg->contents[168] == 179, "incorrect value for contents[168], expected 179, is %d", check_msg->contents[168]); - ck_assert_msg(check_msg->contents[169] == 120, "incorrect value for contents[169], expected 120, is %d", check_msg->contents[169]); - ck_assert_msg(check_msg->contents[170] == 152, "incorrect value for contents[170], expected 152, is %d", check_msg->contents[170]); - ck_assert_msg(check_msg->contents[171] == 18, "incorrect value for contents[171], expected 18, is %d", check_msg->contents[171]); - ck_assert_msg(check_msg->contents[172] == 116, "incorrect value for contents[172], expected 116, is %d", check_msg->contents[172]); - ck_assert_msg(check_msg->contents[173] == 53, "incorrect value for contents[173], expected 53, is %d", check_msg->contents[173]); - ck_assert_msg(check_msg->contents[174] == 212, "incorrect value for contents[174], expected 212, is %d", check_msg->contents[174]); - ck_assert_msg(check_msg->contents[175] == 100, "incorrect value for contents[175], expected 100, is %d", check_msg->contents[175]); - ck_assert_msg(check_msg->contents[176] == 2, "incorrect value for contents[176], expected 2, is %d", check_msg->contents[176]); - ck_assert_msg(check_msg->contents[177] == 114, "incorrect value for contents[177], expected 114, is %d", check_msg->contents[177]); - ck_assert_msg(check_msg->contents[178] == 198, "incorrect value for contents[178], expected 198, is %d", check_msg->contents[178]); - ck_assert_msg(check_msg->contents[179] == 200, "incorrect value for contents[179], expected 200, is %d", check_msg->contents[179]); - ck_assert_msg(check_msg->contents[180] == 10, "incorrect value for contents[180], expected 10, is %d", check_msg->contents[180]); - ck_assert_msg(check_msg->contents[181] == 147, "incorrect value for contents[181], expected 147, is %d", check_msg->contents[181]); - ck_assert_msg(check_msg->contents[182] == 25, "incorrect value for contents[182], expected 25, is %d", check_msg->contents[182]); - ck_assert_msg(check_msg->contents[183] == 33, "incorrect value for contents[183], expected 33, is %d", check_msg->contents[183]); - ck_assert_msg(check_msg->contents[184] == 115, "incorrect value for contents[184], expected 115, is %d", check_msg->contents[184]); - ck_assert_msg(check_msg->contents[185] == 208, "incorrect value for contents[185], expected 208, is %d", check_msg->contents[185]); - ck_assert_msg(check_msg->contents[186] == 113, "incorrect value for contents[186], expected 113, is %d", check_msg->contents[186]); - ck_assert_msg(check_msg->contents[187] == 60, "incorrect value for contents[187], expected 60, is %d", check_msg->contents[187]); - ck_assert_msg(check_msg->contents[188] == 179, "incorrect value for contents[188], expected 179, is %d", check_msg->contents[188]); - ck_assert_msg(check_msg->contents[189] == 183, "incorrect value for contents[189], expected 183, is %d", check_msg->contents[189]); - ck_assert_msg(check_msg->contents[190] == 0, "incorrect value for contents[190], expected 0, is %d", check_msg->contents[190]); - ck_assert_msg(check_msg->contents[191] == 41, "incorrect value for contents[191], expected 41, is %d", check_msg->contents[191]); - ck_assert_msg(check_msg->contents[192] == 217, "incorrect value for contents[192], expected 217, is %d", check_msg->contents[192]); - ck_assert_msg(check_msg->contents[193] == 206, "incorrect value for contents[193], expected 206, is %d", check_msg->contents[193]); - ck_assert_msg(check_msg->contents[194] == 255, "incorrect value for contents[194], expected 255, is %d", check_msg->contents[194]); - ck_assert_msg(check_msg->contents[195] == 211, "incorrect value for contents[195], expected 211, is %d", check_msg->contents[195]); - ck_assert_msg(check_msg->contents[196] == 225, "incorrect value for contents[196], expected 225, is %d", check_msg->contents[196]); - ck_assert_msg(check_msg->contents[197] == 142, "incorrect value for contents[197], expected 142, is %d", check_msg->contents[197]); - ck_assert_msg(check_msg->contents[198] == 191, "incorrect value for contents[198], expected 191, is %d", check_msg->contents[198]); - ck_assert_msg(check_msg->contents[199] == 133, "incorrect value for contents[199], expected 133, is %d", check_msg->contents[199]); - ck_assert_msg(check_msg->contents[200] == 81, "incorrect value for contents[200], expected 81, is %d", check_msg->contents[200]); - ck_assert_msg(check_msg->contents[201] == 15, "incorrect value for contents[201], expected 15, is %d", check_msg->contents[201]); - ck_assert_msg(check_msg->contents[202] == 248, "incorrect value for contents[202], expected 248, is %d", check_msg->contents[202]); - ck_assert_msg(check_msg->contents[203] == 193, "incorrect value for contents[203], expected 193, is %d", check_msg->contents[203]); - ck_assert_msg(check_msg->contents[204] == 66, "incorrect value for contents[204], expected 66, is %d", check_msg->contents[204]); - ck_assert_msg(check_msg->contents[205] == 191, "incorrect value for contents[205], expected 191, is %d", check_msg->contents[205]); - ck_assert_msg(check_msg->contents[206] == 244, "incorrect value for contents[206], expected 244, is %d", check_msg->contents[206]); - ck_assert_msg(check_msg->contents[207] == 221, "incorrect value for contents[207], expected 221, is %d", check_msg->contents[207]); - ck_assert_msg(check_msg->contents[208] == 248, "incorrect value for contents[208], expected 248, is %d", check_msg->contents[208]); - ck_assert_msg(check_msg->contents[209] == 199, "incorrect value for contents[209], expected 199, is %d", check_msg->contents[209]); - ck_assert_msg(check_msg->contents[210] == 241, "incorrect value for contents[210], expected 241, is %d", check_msg->contents[210]); - ck_assert_msg(check_msg->contents[211] == 112, "incorrect value for contents[211], expected 112, is %d", check_msg->contents[211]); - ck_assert_msg(check_msg->contents[212] == 51, "incorrect value for contents[212], expected 51, is %d", check_msg->contents[212]); - ck_assert_msg(check_msg->contents[213] == 1, "incorrect value for contents[213], expected 1, is %d", check_msg->contents[213]); - ck_assert_msg(check_msg->contents[214] == 180, "incorrect value for contents[214], expected 180, is %d", check_msg->contents[214]); - ck_assert_msg(check_msg->contents[215] == 180, "incorrect value for contents[215], expected 180, is %d", check_msg->contents[215]); - ck_assert_msg(check_msg->contents[216] == 125, "incorrect value for contents[216], expected 125, is %d", check_msg->contents[216]); - ck_assert_msg(check_msg->contents[217] == 97, "incorrect value for contents[217], expected 97, is %d", check_msg->contents[217]); - ck_assert_msg(check_msg->contents[218] == 145, "incorrect value for contents[218], expected 145, is %d", check_msg->contents[218]); - ck_assert_msg(check_msg->contents[219] == 25, "incorrect value for contents[219], expected 25, is %d", check_msg->contents[219]); - ck_assert_msg(check_msg->contents[220] == 72, "incorrect value for contents[220], expected 72, is %d", check_msg->contents[220]); - ck_assert_msg(check_msg->contents[221] == 210, "incorrect value for contents[221], expected 210, is %d", check_msg->contents[221]); - ck_assert_msg(check_msg->contents[222] == 215, "incorrect value for contents[222], expected 215, is %d", check_msg->contents[222]); - ck_assert_msg(check_msg->contents[223] == 208, "incorrect value for contents[223], expected 208, is %d", check_msg->contents[223]); - ck_assert_msg(check_msg->contents[224] == 15, "incorrect value for contents[224], expected 15, is %d", check_msg->contents[224]); - ck_assert_msg(check_msg->contents[225] == 126, "incorrect value for contents[225], expected 126, is %d", check_msg->contents[225]); - ck_assert_msg(check_msg->contents[226] == 56, "incorrect value for contents[226], expected 56, is %d", check_msg->contents[226]); - ck_assert_msg(check_msg->contents[227] == 38, "incorrect value for contents[227], expected 38, is %d", check_msg->contents[227]); - ck_assert_msg(check_msg->contents[228] == 65, "incorrect value for contents[228], expected 65, is %d", check_msg->contents[228]); - ck_assert_msg(check_msg->contents[229] == 4, "incorrect value for contents[229], expected 4, is %d", check_msg->contents[229]); - ck_assert_msg(check_msg->contents[230] == 64, "incorrect value for contents[230], expected 64, is %d", check_msg->contents[230]); - ck_assert_msg(check_msg->contents[231] == 19, "incorrect value for contents[231], expected 19, is %d", check_msg->contents[231]); - ck_assert_msg(check_msg->contents[232] == 74, "incorrect value for contents[232], expected 74, is %d", check_msg->contents[232]); - ck_assert_msg(check_msg->contents[233] == 223, "incorrect value for contents[233], expected 223, is %d", check_msg->contents[233]); - ck_assert_msg(check_msg->contents[234] == 111, "incorrect value for contents[234], expected 111, is %d", check_msg->contents[234]); - ck_assert_msg(check_msg->contents[235] == 109, "incorrect value for contents[235], expected 109, is %d", check_msg->contents[235]); - ck_assert_msg(check_msg->contents[236] == 52, "incorrect value for contents[236], expected 52, is %d", check_msg->contents[236]); - ck_assert_msg(check_msg->contents[237] == 43, "incorrect value for contents[237], expected 43, is %d", check_msg->contents[237]); - ck_assert_msg(check_msg->contents[238] == 167, "incorrect value for contents[238], expected 167, is %d", check_msg->contents[238]); - ck_assert_msg(check_msg->contents[239] == 186, "incorrect value for contents[239], expected 186, is %d", check_msg->contents[239]); - ck_assert_msg(check_msg->contents[240] == 202, "incorrect value for contents[240], expected 202, is %d", check_msg->contents[240]); - ck_assert_msg(check_msg->contents[241] == 111, "incorrect value for contents[241], expected 111, is %d", check_msg->contents[241]); - ck_assert_msg(check_msg->contents[242] == 11, "incorrect value for contents[242], expected 11, is %d", check_msg->contents[242]); - ck_assert_msg(check_msg->contents[243] == 91, "incorrect value for contents[243], expected 91, is %d", check_msg->contents[243]); - ck_assert_msg(check_msg->contents[244] == 21, "incorrect value for contents[244], expected 21, is %d", check_msg->contents[244]); - ck_assert_msg(check_msg->contents[245] == 236, "incorrect value for contents[245], expected 236, is %d", check_msg->contents[245]); - ck_assert_msg(check_msg->contents[246] == 234, "incorrect value for contents[246], expected 234, is %d", check_msg->contents[246]); - ck_assert_msg(check_msg->contents[247] == 196, "incorrect value for contents[247], expected 196, is %d", check_msg->contents[247]); - ck_assert_msg(check_msg->contents[248] == 36, "incorrect value for contents[248], expected 36, is %d", check_msg->contents[248]); - ck_assert_msg(check_msg->contents[249] == 171, "incorrect value for contents[249], expected 171, is %d", check_msg->contents[249]); - ck_assert_msg(check_msg->contents[250] == 147, "incorrect value for contents[250], expected 147, is %d", check_msg->contents[250]); - ck_assert_msg(check_msg->sequence == 259241795, "incorrect value for sequence, expected 259241795, is %d", check_msg->sequence); + ck_assert_msg(check_msg->contents[0] == 73, + "incorrect value for contents[0], expected 73, is %d", + check_msg->contents[0]); + ck_assert_msg(check_msg->contents[1] == 231, + "incorrect value for contents[1], expected 231, is %d", + check_msg->contents[1]); + ck_assert_msg(check_msg->contents[2] == 227, + "incorrect value for contents[2], expected 227, is %d", + check_msg->contents[2]); + ck_assert_msg(check_msg->contents[3] == 179, + "incorrect value for contents[3], expected 179, is %d", + check_msg->contents[3]); + ck_assert_msg(check_msg->contents[4] == 18, + "incorrect value for contents[4], expected 18, is %d", + check_msg->contents[4]); + ck_assert_msg(check_msg->contents[5] == 76, + "incorrect value for contents[5], expected 76, is %d", + check_msg->contents[5]); + ck_assert_msg(check_msg->contents[6] == 68, + "incorrect value for contents[6], expected 68, is %d", + check_msg->contents[6]); + ck_assert_msg(check_msg->contents[7] == 229, + "incorrect value for contents[7], expected 229, is %d", + check_msg->contents[7]); + ck_assert_msg(check_msg->contents[8] == 216, + "incorrect value for contents[8], expected 216, is %d", + check_msg->contents[8]); + ck_assert_msg(check_msg->contents[9] == 21, + "incorrect value for contents[9], expected 21, is %d", + check_msg->contents[9]); + ck_assert_msg(check_msg->contents[10] == 98, + "incorrect value for contents[10], expected 98, is %d", + check_msg->contents[10]); + ck_assert_msg(check_msg->contents[11] == 183, + "incorrect value for contents[11], expected 183, is %d", + check_msg->contents[11]); + ck_assert_msg(check_msg->contents[12] == 69, + "incorrect value for contents[12], expected 69, is %d", + check_msg->contents[12]); + ck_assert_msg(check_msg->contents[13] == 190, + "incorrect value for contents[13], expected 190, is %d", + check_msg->contents[13]); + ck_assert_msg(check_msg->contents[14] == 5, + "incorrect value for contents[14], expected 5, is %d", + check_msg->contents[14]); + ck_assert_msg(check_msg->contents[15] == 252, + "incorrect value for contents[15], expected 252, is %d", + check_msg->contents[15]); + ck_assert_msg(check_msg->contents[16] == 176, + "incorrect value for contents[16], expected 176, is %d", + check_msg->contents[16]); + ck_assert_msg(check_msg->contents[17] == 55, + "incorrect value for contents[17], expected 55, is %d", + check_msg->contents[17]); + ck_assert_msg(check_msg->contents[18] == 32, + "incorrect value for contents[18], expected 32, is %d", + check_msg->contents[18]); + ck_assert_msg(check_msg->contents[19] == 78, + "incorrect value for contents[19], expected 78, is %d", + check_msg->contents[19]); + ck_assert_msg(check_msg->contents[20] == 8, + "incorrect value for contents[20], expected 8, is %d", + check_msg->contents[20]); + ck_assert_msg(check_msg->contents[21] == 52, + "incorrect value for contents[21], expected 52, is %d", + check_msg->contents[21]); + ck_assert_msg(check_msg->contents[22] == 127, + "incorrect value for contents[22], expected 127, is %d", + check_msg->contents[22]); + ck_assert_msg(check_msg->contents[23] == 50, + "incorrect value for contents[23], expected 50, is %d", + check_msg->contents[23]); + ck_assert_msg(check_msg->contents[24] == 71, + "incorrect value for contents[24], expected 71, is %d", + check_msg->contents[24]); + ck_assert_msg(check_msg->contents[25] == 106, + "incorrect value for contents[25], expected 106, is %d", + check_msg->contents[25]); + ck_assert_msg(check_msg->contents[26] == 61, + "incorrect value for contents[26], expected 61, is %d", + check_msg->contents[26]); + ck_assert_msg(check_msg->contents[27] == 79, + "incorrect value for contents[27], expected 79, is %d", + check_msg->contents[27]); + ck_assert_msg(check_msg->contents[28] == 191, + "incorrect value for contents[28], expected 191, is %d", + check_msg->contents[28]); + ck_assert_msg(check_msg->contents[29] == 106, + "incorrect value for contents[29], expected 106, is %d", + check_msg->contents[29]); + ck_assert_msg(check_msg->contents[30] == 46, + "incorrect value for contents[30], expected 46, is %d", + check_msg->contents[30]); + ck_assert_msg(check_msg->contents[31] == 79, + "incorrect value for contents[31], expected 79, is %d", + check_msg->contents[31]); + ck_assert_msg(check_msg->contents[32] == 118, + "incorrect value for contents[32], expected 118, is %d", + check_msg->contents[32]); + ck_assert_msg(check_msg->contents[33] == 248, + "incorrect value for contents[33], expected 248, is %d", + check_msg->contents[33]); + ck_assert_msg(check_msg->contents[34] == 118, + "incorrect value for contents[34], expected 118, is %d", + check_msg->contents[34]); + ck_assert_msg(check_msg->contents[35] == 207, + "incorrect value for contents[35], expected 207, is %d", + check_msg->contents[35]); + ck_assert_msg(check_msg->contents[36] == 206, + "incorrect value for contents[36], expected 206, is %d", + check_msg->contents[36]); + ck_assert_msg(check_msg->contents[37] == 210, + "incorrect value for contents[37], expected 210, is %d", + check_msg->contents[37]); + ck_assert_msg(check_msg->contents[38] == 91, + "incorrect value for contents[38], expected 91, is %d", + check_msg->contents[38]); + ck_assert_msg(check_msg->contents[39] == 73, + "incorrect value for contents[39], expected 73, is %d", + check_msg->contents[39]); + ck_assert_msg(check_msg->contents[40] == 251, + "incorrect value for contents[40], expected 251, is %d", + check_msg->contents[40]); + ck_assert_msg(check_msg->contents[41] == 81, + "incorrect value for contents[41], expected 81, is %d", + check_msg->contents[41]); + ck_assert_msg(check_msg->contents[42] == 131, + "incorrect value for contents[42], expected 131, is %d", + check_msg->contents[42]); + ck_assert_msg(check_msg->contents[43] == 205, + "incorrect value for contents[43], expected 205, is %d", + check_msg->contents[43]); + ck_assert_msg(check_msg->contents[44] == 193, + "incorrect value for contents[44], expected 193, is %d", + check_msg->contents[44]); + ck_assert_msg(check_msg->contents[45] == 146, + "incorrect value for contents[45], expected 146, is %d", + check_msg->contents[45]); + ck_assert_msg(check_msg->contents[46] == 206, + "incorrect value for contents[46], expected 206, is %d", + check_msg->contents[46]); + ck_assert_msg(check_msg->contents[47] == 185, + "incorrect value for contents[47], expected 185, is %d", + check_msg->contents[47]); + ck_assert_msg(check_msg->contents[48] == 140, + "incorrect value for contents[48], expected 140, is %d", + check_msg->contents[48]); + ck_assert_msg(check_msg->contents[49] == 249, + "incorrect value for contents[49], expected 249, is %d", + check_msg->contents[49]); + ck_assert_msg(check_msg->contents[50] == 163, + "incorrect value for contents[50], expected 163, is %d", + check_msg->contents[50]); + ck_assert_msg(check_msg->contents[51] == 231, + "incorrect value for contents[51], expected 231, is %d", + check_msg->contents[51]); + ck_assert_msg(check_msg->contents[52] == 65, + "incorrect value for contents[52], expected 65, is %d", + check_msg->contents[52]); + ck_assert_msg(check_msg->contents[53] == 67, + "incorrect value for contents[53], expected 67, is %d", + check_msg->contents[53]); + ck_assert_msg(check_msg->contents[54] == 94, + "incorrect value for contents[54], expected 94, is %d", + check_msg->contents[54]); + ck_assert_msg(check_msg->contents[55] == 250, + "incorrect value for contents[55], expected 250, is %d", + check_msg->contents[55]); + ck_assert_msg(check_msg->contents[56] == 109, + "incorrect value for contents[56], expected 109, is %d", + check_msg->contents[56]); + ck_assert_msg(check_msg->contents[57] == 152, + "incorrect value for contents[57], expected 152, is %d", + check_msg->contents[57]); + ck_assert_msg(check_msg->contents[58] == 95, + "incorrect value for contents[58], expected 95, is %d", + check_msg->contents[58]); + ck_assert_msg(check_msg->contents[59] == 123, + "incorrect value for contents[59], expected 123, is %d", + check_msg->contents[59]); + ck_assert_msg(check_msg->contents[60] == 77, + "incorrect value for contents[60], expected 77, is %d", + check_msg->contents[60]); + ck_assert_msg(check_msg->contents[61] == 224, + "incorrect value for contents[61], expected 224, is %d", + check_msg->contents[61]); + ck_assert_msg(check_msg->contents[62] == 124, + "incorrect value for contents[62], expected 124, is %d", + check_msg->contents[62]); + ck_assert_msg(check_msg->contents[63] == 238, + "incorrect value for contents[63], expected 238, is %d", + check_msg->contents[63]); + ck_assert_msg(check_msg->contents[64] == 205, + "incorrect value for contents[64], expected 205, is %d", + check_msg->contents[64]); + ck_assert_msg(check_msg->contents[65] == 65, + "incorrect value for contents[65], expected 65, is %d", + check_msg->contents[65]); + ck_assert_msg(check_msg->contents[66] == 103, + "incorrect value for contents[66], expected 103, is %d", + check_msg->contents[66]); + ck_assert_msg(check_msg->contents[67] == 35, + "incorrect value for contents[67], expected 35, is %d", + check_msg->contents[67]); + ck_assert_msg(check_msg->contents[68] == 104, + "incorrect value for contents[68], expected 104, is %d", + check_msg->contents[68]); + ck_assert_msg(check_msg->contents[69] == 209, + "incorrect value for contents[69], expected 209, is %d", + check_msg->contents[69]); + ck_assert_msg(check_msg->contents[70] == 5, + "incorrect value for contents[70], expected 5, is %d", + check_msg->contents[70]); + ck_assert_msg(check_msg->contents[71] == 191, + "incorrect value for contents[71], expected 191, is %d", + check_msg->contents[71]); + ck_assert_msg(check_msg->contents[72] == 47, + "incorrect value for contents[72], expected 47, is %d", + check_msg->contents[72]); + ck_assert_msg(check_msg->contents[73] == 249, + "incorrect value for contents[73], expected 249, is %d", + check_msg->contents[73]); + ck_assert_msg(check_msg->contents[74] == 176, + "incorrect value for contents[74], expected 176, is %d", + check_msg->contents[74]); + ck_assert_msg(check_msg->contents[75] == 166, + "incorrect value for contents[75], expected 166, is %d", + check_msg->contents[75]); + ck_assert_msg(check_msg->contents[76] == 213, + "incorrect value for contents[76], expected 213, is %d", + check_msg->contents[76]); + ck_assert_msg(check_msg->contents[77] == 46, + "incorrect value for contents[77], expected 46, is %d", + check_msg->contents[77]); + ck_assert_msg(check_msg->contents[78] == 192, + "incorrect value for contents[78], expected 192, is %d", + check_msg->contents[78]); + ck_assert_msg(check_msg->contents[79] == 86, + "incorrect value for contents[79], expected 86, is %d", + check_msg->contents[79]); + ck_assert_msg(check_msg->contents[80] == 32, + "incorrect value for contents[80], expected 32, is %d", + check_msg->contents[80]); + ck_assert_msg(check_msg->contents[81] == 103, + "incorrect value for contents[81], expected 103, is %d", + check_msg->contents[81]); + ck_assert_msg(check_msg->contents[82] == 146, + "incorrect value for contents[82], expected 146, is %d", + check_msg->contents[82]); + ck_assert_msg(check_msg->contents[83] == 252, + "incorrect value for contents[83], expected 252, is %d", + check_msg->contents[83]); + ck_assert_msg(check_msg->contents[84] == 4, + "incorrect value for contents[84], expected 4, is %d", + check_msg->contents[84]); + ck_assert_msg(check_msg->contents[85] == 16, + "incorrect value for contents[85], expected 16, is %d", + check_msg->contents[85]); + ck_assert_msg(check_msg->contents[86] == 54, + "incorrect value for contents[86], expected 54, is %d", + check_msg->contents[86]); + ck_assert_msg(check_msg->contents[87] == 161, + "incorrect value for contents[87], expected 161, is %d", + check_msg->contents[87]); + ck_assert_msg(check_msg->contents[88] == 60, + "incorrect value for contents[88], expected 60, is %d", + check_msg->contents[88]); + ck_assert_msg(check_msg->contents[89] == 6, + "incorrect value for contents[89], expected 6, is %d", + check_msg->contents[89]); + ck_assert_msg(check_msg->contents[90] == 13, + "incorrect value for contents[90], expected 13, is %d", + check_msg->contents[90]); + ck_assert_msg(check_msg->contents[91] == 191, + "incorrect value for contents[91], expected 191, is %d", + check_msg->contents[91]); + ck_assert_msg(check_msg->contents[92] == 116, + "incorrect value for contents[92], expected 116, is %d", + check_msg->contents[92]); + ck_assert_msg(check_msg->contents[93] == 182, + "incorrect value for contents[93], expected 182, is %d", + check_msg->contents[93]); + ck_assert_msg(check_msg->contents[94] == 42, + "incorrect value for contents[94], expected 42, is %d", + check_msg->contents[94]); + ck_assert_msg(check_msg->contents[95] == 191, + "incorrect value for contents[95], expected 191, is %d", + check_msg->contents[95]); + ck_assert_msg(check_msg->contents[96] == 213, + "incorrect value for contents[96], expected 213, is %d", + check_msg->contents[96]); + ck_assert_msg(check_msg->contents[97] == 20, + "incorrect value for contents[97], expected 20, is %d", + check_msg->contents[97]); + ck_assert_msg(check_msg->contents[98] == 217, + "incorrect value for contents[98], expected 217, is %d", + check_msg->contents[98]); + ck_assert_msg(check_msg->contents[99] == 8, + "incorrect value for contents[99], expected 8, is %d", + check_msg->contents[99]); + ck_assert_msg(check_msg->contents[100] == 142, + "incorrect value for contents[100], expected 142, is %d", + check_msg->contents[100]); + ck_assert_msg(check_msg->contents[101] == 187, + "incorrect value for contents[101], expected 187, is %d", + check_msg->contents[101]); + ck_assert_msg(check_msg->contents[102] == 238, + "incorrect value for contents[102], expected 238, is %d", + check_msg->contents[102]); + ck_assert_msg(check_msg->contents[103] == 120, + "incorrect value for contents[103], expected 120, is %d", + check_msg->contents[103]); + ck_assert_msg(check_msg->contents[104] == 184, + "incorrect value for contents[104], expected 184, is %d", + check_msg->contents[104]); + ck_assert_msg(check_msg->contents[105] == 250, + "incorrect value for contents[105], expected 250, is %d", + check_msg->contents[105]); + ck_assert_msg(check_msg->contents[106] == 31, + "incorrect value for contents[106], expected 31, is %d", + check_msg->contents[106]); + ck_assert_msg(check_msg->contents[107] == 151, + "incorrect value for contents[107], expected 151, is %d", + check_msg->contents[107]); + ck_assert_msg(check_msg->contents[108] == 37, + "incorrect value for contents[108], expected 37, is %d", + check_msg->contents[108]); + ck_assert_msg(check_msg->contents[109] == 51, + "incorrect value for contents[109], expected 51, is %d", + check_msg->contents[109]); + ck_assert_msg(check_msg->contents[110] == 177, + "incorrect value for contents[110], expected 177, is %d", + check_msg->contents[110]); + ck_assert_msg(check_msg->contents[111] == 130, + "incorrect value for contents[111], expected 130, is %d", + check_msg->contents[111]); + ck_assert_msg(check_msg->contents[112] == 190, + "incorrect value for contents[112], expected 190, is %d", + check_msg->contents[112]); + ck_assert_msg(check_msg->contents[113] == 155, + "incorrect value for contents[113], expected 155, is %d", + check_msg->contents[113]); + ck_assert_msg(check_msg->contents[114] == 71, + "incorrect value for contents[114], expected 71, is %d", + check_msg->contents[114]); + ck_assert_msg(check_msg->contents[115] == 68, + "incorrect value for contents[115], expected 68, is %d", + check_msg->contents[115]); + ck_assert_msg(check_msg->contents[116] == 56, + "incorrect value for contents[116], expected 56, is %d", + check_msg->contents[116]); + ck_assert_msg(check_msg->contents[117] == 238, + "incorrect value for contents[117], expected 238, is %d", + check_msg->contents[117]); + ck_assert_msg(check_msg->contents[118] == 92, + "incorrect value for contents[118], expected 92, is %d", + check_msg->contents[118]); + ck_assert_msg(check_msg->contents[119] == 130, + "incorrect value for contents[119], expected 130, is %d", + check_msg->contents[119]); + ck_assert_msg(check_msg->contents[120] == 37, + "incorrect value for contents[120], expected 37, is %d", + check_msg->contents[120]); + ck_assert_msg(check_msg->contents[121] == 137, + "incorrect value for contents[121], expected 137, is %d", + check_msg->contents[121]); + ck_assert_msg(check_msg->contents[122] == 146, + "incorrect value for contents[122], expected 146, is %d", + check_msg->contents[122]); + ck_assert_msg(check_msg->contents[123] == 246, + "incorrect value for contents[123], expected 246, is %d", + check_msg->contents[123]); + ck_assert_msg(check_msg->contents[124] == 114, + "incorrect value for contents[124], expected 114, is %d", + check_msg->contents[124]); + ck_assert_msg(check_msg->contents[125] == 116, + "incorrect value for contents[125], expected 116, is %d", + check_msg->contents[125]); + ck_assert_msg(check_msg->contents[126] == 138, + "incorrect value for contents[126], expected 138, is %d", + check_msg->contents[126]); + ck_assert_msg(check_msg->contents[127] == 165, + "incorrect value for contents[127], expected 165, is %d", + check_msg->contents[127]); + ck_assert_msg(check_msg->contents[128] == 217, + "incorrect value for contents[128], expected 217, is %d", + check_msg->contents[128]); + ck_assert_msg(check_msg->contents[129] == 79, + "incorrect value for contents[129], expected 79, is %d", + check_msg->contents[129]); + ck_assert_msg(check_msg->contents[130] == 10, + "incorrect value for contents[130], expected 10, is %d", + check_msg->contents[130]); + ck_assert_msg(check_msg->contents[131] == 189, + "incorrect value for contents[131], expected 189, is %d", + check_msg->contents[131]); + ck_assert_msg(check_msg->contents[132] == 128, + "incorrect value for contents[132], expected 128, is %d", + check_msg->contents[132]); + ck_assert_msg(check_msg->contents[133] == 189, + "incorrect value for contents[133], expected 189, is %d", + check_msg->contents[133]); + ck_assert_msg(check_msg->contents[134] == 2, + "incorrect value for contents[134], expected 2, is %d", + check_msg->contents[134]); + ck_assert_msg(check_msg->contents[135] == 240, + "incorrect value for contents[135], expected 240, is %d", + check_msg->contents[135]); + ck_assert_msg(check_msg->contents[136] == 92, + "incorrect value for contents[136], expected 92, is %d", + check_msg->contents[136]); + ck_assert_msg(check_msg->contents[137] == 28, + "incorrect value for contents[137], expected 28, is %d", + check_msg->contents[137]); + ck_assert_msg(check_msg->contents[138] == 126, + "incorrect value for contents[138], expected 126, is %d", + check_msg->contents[138]); + ck_assert_msg(check_msg->contents[139] == 105, + "incorrect value for contents[139], expected 105, is %d", + check_msg->contents[139]); + ck_assert_msg(check_msg->contents[140] == 236, + "incorrect value for contents[140], expected 236, is %d", + check_msg->contents[140]); + ck_assert_msg(check_msg->contents[141] == 228, + "incorrect value for contents[141], expected 228, is %d", + check_msg->contents[141]); + ck_assert_msg(check_msg->contents[142] == 194, + "incorrect value for contents[142], expected 194, is %d", + check_msg->contents[142]); + ck_assert_msg(check_msg->contents[143] == 0, + "incorrect value for contents[143], expected 0, is %d", + check_msg->contents[143]); + ck_assert_msg(check_msg->contents[144] == 51, + "incorrect value for contents[144], expected 51, is %d", + check_msg->contents[144]); + ck_assert_msg(check_msg->contents[145] == 61, + "incorrect value for contents[145], expected 61, is %d", + check_msg->contents[145]); + ck_assert_msg(check_msg->contents[146] == 74, + "incorrect value for contents[146], expected 74, is %d", + check_msg->contents[146]); + ck_assert_msg(check_msg->contents[147] == 41, + "incorrect value for contents[147], expected 41, is %d", + check_msg->contents[147]); + ck_assert_msg(check_msg->contents[148] == 10, + "incorrect value for contents[148], expected 10, is %d", + check_msg->contents[148]); + ck_assert_msg(check_msg->contents[149] == 239, + "incorrect value for contents[149], expected 239, is %d", + check_msg->contents[149]); + ck_assert_msg(check_msg->contents[150] == 133, + "incorrect value for contents[150], expected 133, is %d", + check_msg->contents[150]); + ck_assert_msg(check_msg->contents[151] == 106, + "incorrect value for contents[151], expected 106, is %d", + check_msg->contents[151]); + ck_assert_msg(check_msg->contents[152] == 190, + "incorrect value for contents[152], expected 190, is %d", + check_msg->contents[152]); + ck_assert_msg(check_msg->contents[153] == 30, + "incorrect value for contents[153], expected 30, is %d", + check_msg->contents[153]); + ck_assert_msg(check_msg->contents[154] == 27, + "incorrect value for contents[154], expected 27, is %d", + check_msg->contents[154]); + ck_assert_msg(check_msg->contents[155] == 3, + "incorrect value for contents[155], expected 3, is %d", + check_msg->contents[155]); + ck_assert_msg(check_msg->contents[156] == 240, + "incorrect value for contents[156], expected 240, is %d", + check_msg->contents[156]); + ck_assert_msg(check_msg->contents[157] == 205, + "incorrect value for contents[157], expected 205, is %d", + check_msg->contents[157]); + ck_assert_msg(check_msg->contents[158] == 253, + "incorrect value for contents[158], expected 253, is %d", + check_msg->contents[158]); + ck_assert_msg(check_msg->contents[159] == 113, + "incorrect value for contents[159], expected 113, is %d", + check_msg->contents[159]); + ck_assert_msg(check_msg->contents[160] == 25, + "incorrect value for contents[160], expected 25, is %d", + check_msg->contents[160]); + ck_assert_msg(check_msg->contents[161] == 28, + "incorrect value for contents[161], expected 28, is %d", + check_msg->contents[161]); + ck_assert_msg(check_msg->contents[162] == 187, + "incorrect value for contents[162], expected 187, is %d", + check_msg->contents[162]); + ck_assert_msg(check_msg->contents[163] == 81, + "incorrect value for contents[163], expected 81, is %d", + check_msg->contents[163]); + ck_assert_msg(check_msg->contents[164] == 101, + "incorrect value for contents[164], expected 101, is %d", + check_msg->contents[164]); + ck_assert_msg(check_msg->contents[165] == 216, + "incorrect value for contents[165], expected 216, is %d", + check_msg->contents[165]); + ck_assert_msg(check_msg->contents[166] == 121, + "incorrect value for contents[166], expected 121, is %d", + check_msg->contents[166]); + ck_assert_msg(check_msg->contents[167] == 41, + "incorrect value for contents[167], expected 41, is %d", + check_msg->contents[167]); + ck_assert_msg(check_msg->contents[168] == 179, + "incorrect value for contents[168], expected 179, is %d", + check_msg->contents[168]); + ck_assert_msg(check_msg->contents[169] == 120, + "incorrect value for contents[169], expected 120, is %d", + check_msg->contents[169]); + ck_assert_msg(check_msg->contents[170] == 152, + "incorrect value for contents[170], expected 152, is %d", + check_msg->contents[170]); + ck_assert_msg(check_msg->contents[171] == 18, + "incorrect value for contents[171], expected 18, is %d", + check_msg->contents[171]); + ck_assert_msg(check_msg->contents[172] == 116, + "incorrect value for contents[172], expected 116, is %d", + check_msg->contents[172]); + ck_assert_msg(check_msg->contents[173] == 53, + "incorrect value for contents[173], expected 53, is %d", + check_msg->contents[173]); + ck_assert_msg(check_msg->contents[174] == 212, + "incorrect value for contents[174], expected 212, is %d", + check_msg->contents[174]); + ck_assert_msg(check_msg->contents[175] == 100, + "incorrect value for contents[175], expected 100, is %d", + check_msg->contents[175]); + ck_assert_msg(check_msg->contents[176] == 2, + "incorrect value for contents[176], expected 2, is %d", + check_msg->contents[176]); + ck_assert_msg(check_msg->contents[177] == 114, + "incorrect value for contents[177], expected 114, is %d", + check_msg->contents[177]); + ck_assert_msg(check_msg->contents[178] == 198, + "incorrect value for contents[178], expected 198, is %d", + check_msg->contents[178]); + ck_assert_msg(check_msg->contents[179] == 200, + "incorrect value for contents[179], expected 200, is %d", + check_msg->contents[179]); + ck_assert_msg(check_msg->contents[180] == 10, + "incorrect value for contents[180], expected 10, is %d", + check_msg->contents[180]); + ck_assert_msg(check_msg->contents[181] == 147, + "incorrect value for contents[181], expected 147, is %d", + check_msg->contents[181]); + ck_assert_msg(check_msg->contents[182] == 25, + "incorrect value for contents[182], expected 25, is %d", + check_msg->contents[182]); + ck_assert_msg(check_msg->contents[183] == 33, + "incorrect value for contents[183], expected 33, is %d", + check_msg->contents[183]); + ck_assert_msg(check_msg->contents[184] == 115, + "incorrect value for contents[184], expected 115, is %d", + check_msg->contents[184]); + ck_assert_msg(check_msg->contents[185] == 208, + "incorrect value for contents[185], expected 208, is %d", + check_msg->contents[185]); + ck_assert_msg(check_msg->contents[186] == 113, + "incorrect value for contents[186], expected 113, is %d", + check_msg->contents[186]); + ck_assert_msg(check_msg->contents[187] == 60, + "incorrect value for contents[187], expected 60, is %d", + check_msg->contents[187]); + ck_assert_msg(check_msg->contents[188] == 179, + "incorrect value for contents[188], expected 179, is %d", + check_msg->contents[188]); + ck_assert_msg(check_msg->contents[189] == 183, + "incorrect value for contents[189], expected 183, is %d", + check_msg->contents[189]); + ck_assert_msg(check_msg->contents[190] == 0, + "incorrect value for contents[190], expected 0, is %d", + check_msg->contents[190]); + ck_assert_msg(check_msg->contents[191] == 41, + "incorrect value for contents[191], expected 41, is %d", + check_msg->contents[191]); + ck_assert_msg(check_msg->contents[192] == 217, + "incorrect value for contents[192], expected 217, is %d", + check_msg->contents[192]); + ck_assert_msg(check_msg->contents[193] == 206, + "incorrect value for contents[193], expected 206, is %d", + check_msg->contents[193]); + ck_assert_msg(check_msg->contents[194] == 255, + "incorrect value for contents[194], expected 255, is %d", + check_msg->contents[194]); + ck_assert_msg(check_msg->contents[195] == 211, + "incorrect value for contents[195], expected 211, is %d", + check_msg->contents[195]); + ck_assert_msg(check_msg->contents[196] == 225, + "incorrect value for contents[196], expected 225, is %d", + check_msg->contents[196]); + ck_assert_msg(check_msg->contents[197] == 142, + "incorrect value for contents[197], expected 142, is %d", + check_msg->contents[197]); + ck_assert_msg(check_msg->contents[198] == 191, + "incorrect value for contents[198], expected 191, is %d", + check_msg->contents[198]); + ck_assert_msg(check_msg->contents[199] == 133, + "incorrect value for contents[199], expected 133, is %d", + check_msg->contents[199]); + ck_assert_msg(check_msg->contents[200] == 81, + "incorrect value for contents[200], expected 81, is %d", + check_msg->contents[200]); + ck_assert_msg(check_msg->contents[201] == 15, + "incorrect value for contents[201], expected 15, is %d", + check_msg->contents[201]); + ck_assert_msg(check_msg->contents[202] == 248, + "incorrect value for contents[202], expected 248, is %d", + check_msg->contents[202]); + ck_assert_msg(check_msg->contents[203] == 193, + "incorrect value for contents[203], expected 193, is %d", + check_msg->contents[203]); + ck_assert_msg(check_msg->contents[204] == 66, + "incorrect value for contents[204], expected 66, is %d", + check_msg->contents[204]); + ck_assert_msg(check_msg->contents[205] == 191, + "incorrect value for contents[205], expected 191, is %d", + check_msg->contents[205]); + ck_assert_msg(check_msg->contents[206] == 244, + "incorrect value for contents[206], expected 244, is %d", + check_msg->contents[206]); + ck_assert_msg(check_msg->contents[207] == 221, + "incorrect value for contents[207], expected 221, is %d", + check_msg->contents[207]); + ck_assert_msg(check_msg->contents[208] == 248, + "incorrect value for contents[208], expected 248, is %d", + check_msg->contents[208]); + ck_assert_msg(check_msg->contents[209] == 199, + "incorrect value for contents[209], expected 199, is %d", + check_msg->contents[209]); + ck_assert_msg(check_msg->contents[210] == 241, + "incorrect value for contents[210], expected 241, is %d", + check_msg->contents[210]); + ck_assert_msg(check_msg->contents[211] == 112, + "incorrect value for contents[211], expected 112, is %d", + check_msg->contents[211]); + ck_assert_msg(check_msg->contents[212] == 51, + "incorrect value for contents[212], expected 51, is %d", + check_msg->contents[212]); + ck_assert_msg(check_msg->contents[213] == 1, + "incorrect value for contents[213], expected 1, is %d", + check_msg->contents[213]); + ck_assert_msg(check_msg->contents[214] == 180, + "incorrect value for contents[214], expected 180, is %d", + check_msg->contents[214]); + ck_assert_msg(check_msg->contents[215] == 180, + "incorrect value for contents[215], expected 180, is %d", + check_msg->contents[215]); + ck_assert_msg(check_msg->contents[216] == 125, + "incorrect value for contents[216], expected 125, is %d", + check_msg->contents[216]); + ck_assert_msg(check_msg->contents[217] == 97, + "incorrect value for contents[217], expected 97, is %d", + check_msg->contents[217]); + ck_assert_msg(check_msg->contents[218] == 145, + "incorrect value for contents[218], expected 145, is %d", + check_msg->contents[218]); + ck_assert_msg(check_msg->contents[219] == 25, + "incorrect value for contents[219], expected 25, is %d", + check_msg->contents[219]); + ck_assert_msg(check_msg->contents[220] == 72, + "incorrect value for contents[220], expected 72, is %d", + check_msg->contents[220]); + ck_assert_msg(check_msg->contents[221] == 210, + "incorrect value for contents[221], expected 210, is %d", + check_msg->contents[221]); + ck_assert_msg(check_msg->contents[222] == 215, + "incorrect value for contents[222], expected 215, is %d", + check_msg->contents[222]); + ck_assert_msg(check_msg->contents[223] == 208, + "incorrect value for contents[223], expected 208, is %d", + check_msg->contents[223]); + ck_assert_msg(check_msg->contents[224] == 15, + "incorrect value for contents[224], expected 15, is %d", + check_msg->contents[224]); + ck_assert_msg(check_msg->contents[225] == 126, + "incorrect value for contents[225], expected 126, is %d", + check_msg->contents[225]); + ck_assert_msg(check_msg->contents[226] == 56, + "incorrect value for contents[226], expected 56, is %d", + check_msg->contents[226]); + ck_assert_msg(check_msg->contents[227] == 38, + "incorrect value for contents[227], expected 38, is %d", + check_msg->contents[227]); + ck_assert_msg(check_msg->contents[228] == 65, + "incorrect value for contents[228], expected 65, is %d", + check_msg->contents[228]); + ck_assert_msg(check_msg->contents[229] == 4, + "incorrect value for contents[229], expected 4, is %d", + check_msg->contents[229]); + ck_assert_msg(check_msg->contents[230] == 64, + "incorrect value for contents[230], expected 64, is %d", + check_msg->contents[230]); + ck_assert_msg(check_msg->contents[231] == 19, + "incorrect value for contents[231], expected 19, is %d", + check_msg->contents[231]); + ck_assert_msg(check_msg->contents[232] == 74, + "incorrect value for contents[232], expected 74, is %d", + check_msg->contents[232]); + ck_assert_msg(check_msg->contents[233] == 223, + "incorrect value for contents[233], expected 223, is %d", + check_msg->contents[233]); + ck_assert_msg(check_msg->contents[234] == 111, + "incorrect value for contents[234], expected 111, is %d", + check_msg->contents[234]); + ck_assert_msg(check_msg->contents[235] == 109, + "incorrect value for contents[235], expected 109, is %d", + check_msg->contents[235]); + ck_assert_msg(check_msg->contents[236] == 52, + "incorrect value for contents[236], expected 52, is %d", + check_msg->contents[236]); + ck_assert_msg(check_msg->contents[237] == 43, + "incorrect value for contents[237], expected 43, is %d", + check_msg->contents[237]); + ck_assert_msg(check_msg->contents[238] == 167, + "incorrect value for contents[238], expected 167, is %d", + check_msg->contents[238]); + ck_assert_msg(check_msg->contents[239] == 186, + "incorrect value for contents[239], expected 186, is %d", + check_msg->contents[239]); + ck_assert_msg(check_msg->contents[240] == 202, + "incorrect value for contents[240], expected 202, is %d", + check_msg->contents[240]); + ck_assert_msg(check_msg->contents[241] == 111, + "incorrect value for contents[241], expected 111, is %d", + check_msg->contents[241]); + ck_assert_msg(check_msg->contents[242] == 11, + "incorrect value for contents[242], expected 11, is %d", + check_msg->contents[242]); + ck_assert_msg(check_msg->contents[243] == 91, + "incorrect value for contents[243], expected 91, is %d", + check_msg->contents[243]); + ck_assert_msg(check_msg->contents[244] == 21, + "incorrect value for contents[244], expected 21, is %d", + check_msg->contents[244]); + ck_assert_msg(check_msg->contents[245] == 236, + "incorrect value for contents[245], expected 236, is %d", + check_msg->contents[245]); + ck_assert_msg(check_msg->contents[246] == 234, + "incorrect value for contents[246], expected 234, is %d", + check_msg->contents[246]); + ck_assert_msg(check_msg->contents[247] == 196, + "incorrect value for contents[247], expected 196, is %d", + check_msg->contents[247]); + ck_assert_msg(check_msg->contents[248] == 36, + "incorrect value for contents[248], expected 36, is %d", + check_msg->contents[248]); + ck_assert_msg(check_msg->contents[249] == 171, + "incorrect value for contents[249], expected 171, is %d", + check_msg->contents[249]); + ck_assert_msg(check_msg->contents[250] == 147, + "incorrect value for contents[250], expected 147, is %d", + check_msg->contents[250]); + ck_assert_msg(check_msg->sequence == 259241795, + "incorrect value for sequence, expected 259241795, is %d", + check_msg->sequence); } } END_TEST -Suite* legacy_auto_check_sbp_file_io_MsgFileioReadResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_file_io_MsgFileioReadResp"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioReadResp"); +Suite *legacy_auto_check_sbp_file_io_MsgFileioReadResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_file_io_MsgFileioReadResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioReadResp"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_file_io_MsgFileioReadResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_file_io_MsgFileioRemove.c b/c/test/legacy/auto_check_sbp_file_io_MsgFileioRemove.c index e27cfd024..70ed07a3a 100644 --- a/c/test/legacy/auto_check_sbp_file_io_MsgFileioRemove.c +++ b/c/test/legacy/auto_check_sbp_file_io_MsgFileioRemove.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioRemove.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioRemove.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioRemove ) -{ +START_TEST(test_legacy_auto_check_sbp_file_io_MsgFileioRemove) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioRemove ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,85 +128,109 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioRemove ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xac, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xac, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xac, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xac, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,172,0,195,4,14,47,112,97,116,104,47,116,111,47,102,105,108,101,0,46,243, }; + u8 encoded_frame[] = { + 85, 172, 0, 195, 4, 14, 47, 112, 97, 116, 104, + 47, 116, 111, 47, 102, 105, 108, 101, 0, 46, 243, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_fileio_remove_t* test_msg = ( msg_fileio_remove_t* )test_msg_storage; + msg_fileio_remove_t *test_msg = (msg_fileio_remove_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)102,(char)105,(char)108,(char)101,(char)0 }; + const char assign_string[] = {(char)47, (char)112, (char)97, (char)116, + (char)104, (char)47, (char)116, (char)111, + (char)47, (char)102, (char)105, (char)108, + (char)101, (char)0}; memcpy(test_msg->filename, assign_string, sizeof(assign_string)); if (sizeof(test_msg->filename) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0xac, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xac, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xac, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_fileio_remove_t* check_msg = ( msg_fileio_remove_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_fileio_remove_t *check_msg = + (msg_fileio_remove_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)102,(char)105,(char)108,(char)101,(char)0 }; - ck_assert_msg(memcmp(check_msg->filename, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->filename, expected string '%s', is '%s'", check_string, check_msg->filename); + const char check_string[] = {(char)47, (char)112, (char)97, (char)116, + (char)104, (char)47, (char)116, (char)111, + (char)47, (char)102, (char)105, (char)108, + (char)101, (char)0}; + ck_assert_msg( + memcmp(check_msg->filename, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->filename, expected string '%s', is " + "'%s'", + check_string, check_msg->filename); } } } END_TEST -Suite* legacy_auto_check_sbp_file_io_MsgFileioRemove_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_file_io_MsgFileioRemove"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioRemove"); +Suite *legacy_auto_check_sbp_file_io_MsgFileioRemove_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_file_io_MsgFileioRemove"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioRemove"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_file_io_MsgFileioRemove); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_file_io_MsgFileioWriteResp.c b/c/test/legacy/auto_check_sbp_file_io_MsgFileioWriteResp.c index 4556af960..64837ce22 100644 --- a/c/test/legacy/auto_check_sbp_file_io_MsgFileioWriteResp.c +++ b/c/test/legacy/auto_check_sbp_file_io_MsgFileioWriteResp.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioWriteResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioWriteResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioWriteResp ) -{ +START_TEST(test_legacy_auto_check_sbp_file_io_MsgFileioWriteResp) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioWriteResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,76 +128,92 @@ START_TEST( test_legacy_auto_check_sbp_file_io_MsgFileioWriteResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xab, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xab, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xab, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xab, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,171,0,66,0,4,202,0,0,0,243,243, }; + u8 encoded_frame[] = { + 85, 171, 0, 66, 0, 4, 202, 0, 0, 0, 243, 243, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_fileio_write_resp_t* test_msg = ( msg_fileio_write_resp_t* )test_msg_storage; + msg_fileio_write_resp_t *test_msg = + (msg_fileio_write_resp_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->sequence = 202; - sbp_payload_send(&sbp_state, 0xab, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xab, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xab, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_fileio_write_resp_t* check_msg = ( msg_fileio_write_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_fileio_write_resp_t *check_msg = + (msg_fileio_write_resp_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->sequence == 202, "incorrect value for sequence, expected 202, is %d", check_msg->sequence); + ck_assert_msg(check_msg->sequence == 202, + "incorrect value for sequence, expected 202, is %d", + check_msg->sequence); } } END_TEST -Suite* legacy_auto_check_sbp_file_io_MsgFileioWriteResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_file_io_MsgFileioWriteResp"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioWriteResp"); +Suite *legacy_auto_check_sbp_file_io_MsgFileioWriteResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_file_io_MsgFileioWriteResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_file_io_MsgFileioWriteResp"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_file_io_MsgFileioWriteResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_flash_MsgFlashDone.c b/c/test/legacy/auto_check_sbp_flash_MsgFlashDone.c index 9e582feae..49fee95d5 100644 --- a/c/test/legacy/auto_check_sbp_flash_MsgFlashDone.c +++ b/c/test/legacy/auto_check_sbp_flash_MsgFlashDone.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashDone.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashDone.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashDone ) -{ +START_TEST(test_legacy_auto_check_sbp_flash_MsgFlashDone) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashDone ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,76 +128,89 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashDone ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xe0, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xe0, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xe0, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xe0, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,224,0,195,4,1,82,6,54, }; + u8 encoded_frame[] = { + 85, 224, 0, 195, 4, 1, 82, 6, 54, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_flash_done_t* test_msg = ( msg_flash_done_t* )test_msg_storage; + msg_flash_done_t *test_msg = (msg_flash_done_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->response = 82; - sbp_payload_send(&sbp_state, 0xe0, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xe0, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xe0, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_flash_done_t* check_msg = ( msg_flash_done_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_flash_done_t *check_msg = (msg_flash_done_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->response == 82, "incorrect value for response, expected 82, is %d", check_msg->response); + ck_assert_msg(check_msg->response == 82, + "incorrect value for response, expected 82, is %d", + check_msg->response); } } END_TEST -Suite* legacy_auto_check_sbp_flash_MsgFlashDone_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_flash_MsgFlashDone"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_flash_MsgFlashDone"); +Suite *legacy_auto_check_sbp_flash_MsgFlashDone_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_flash_MsgFlashDone"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_flash_MsgFlashDone"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_flash_MsgFlashDone); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_flash_MsgFlashErase.c b/c/test/legacy/auto_check_sbp_flash_MsgFlashErase.c index e66309de8..1bcd94fee 100644 --- a/c/test/legacy/auto_check_sbp_flash_MsgFlashErase.c +++ b/c/test/legacy/auto_check_sbp_flash_MsgFlashErase.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashErase.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashErase.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashErase ) -{ +START_TEST(test_legacy_auto_check_sbp_flash_MsgFlashErase) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashErase ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,78 +128,93 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashErase ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xe2, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xe2, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xe2, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xe2, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,226,0,195,4,5,74,238,177,118,132,0,251, }; + u8 encoded_frame[] = { + 85, 226, 0, 195, 4, 5, 74, 238, 177, 118, 132, 0, 251, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_flash_erase_t* test_msg = ( msg_flash_erase_t* )test_msg_storage; + msg_flash_erase_t *test_msg = (msg_flash_erase_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->sector_num = 2222371310; test_msg->target = 74; - sbp_payload_send(&sbp_state, 0xe2, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xe2, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xe2, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_flash_erase_t* check_msg = ( msg_flash_erase_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_flash_erase_t *check_msg = (msg_flash_erase_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->sector_num == 2222371310, "incorrect value for sector_num, expected 2222371310, is %d", check_msg->sector_num); - ck_assert_msg(check_msg->target == 74, "incorrect value for target, expected 74, is %d", check_msg->target); + ck_assert_msg(check_msg->sector_num == 2222371310, + "incorrect value for sector_num, expected 2222371310, is %d", + check_msg->sector_num); + ck_assert_msg(check_msg->target == 74, + "incorrect value for target, expected 74, is %d", + check_msg->target); } } END_TEST -Suite* legacy_auto_check_sbp_flash_MsgFlashErase_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_flash_MsgFlashErase"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_flash_MsgFlashErase"); +Suite *legacy_auto_check_sbp_flash_MsgFlashErase_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_flash_MsgFlashErase"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_flash_MsgFlashErase"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_flash_MsgFlashErase); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_flash_MsgFlashProgram.c b/c/test/legacy/auto_check_sbp_flash_MsgFlashProgram.c index 9c2240742..ad012c26f 100644 --- a/c/test/legacy/auto_check_sbp_flash_MsgFlashProgram.c +++ b/c/test/legacy/auto_check_sbp_flash_MsgFlashProgram.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashProgram.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashProgram.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashProgram ) -{ +START_TEST(test_legacy_auto_check_sbp_flash_MsgFlashProgram) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashProgram ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,39 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashProgram ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xe6, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xe6, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xe6, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xe6, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,230,0,195,4,255,212,87,52,244,250,176,222,235,106,144,29,141,255,3,16,192,237,172,254,213,4,220,98,34,222,230,214,6,217,172,122,46,13,38,240,236,60,121,47,252,163,141,222,29,168,214,118,55,201,233,21,214,57,245,246,19,3,121,49,231,37,186,58,238,98,39,70,232,133,25,10,134,129,69,228,134,9,88,183,133,171,255,166,100,152,231,92,9,196,106,246,29,145,156,151,32,67,188,63,233,142,174,139,154,127,35,60,56,187,121,103,135,152,182,88,160,255,227,240,54,100,91,31,141,102,130,254,54,227,229,62,53,225,143,88,139,126,235,235,35,54,134,163,92,57,87,130,178,22,158,18,237,209,187,226,1,46,64,226,235,213,186,159,221,186,25,115,84,131,167,201,104,1,200,13,50,71,73,193,201,250,172,193,13,20,238,130,243,68,4,72,46,194,113,255,238,15,230,64,178,127,217,92,160,201,118,163,144,58,28,174,65,73,45,123,118,83,107,239,168,32,212,191,81,93,186,223,32,19,58,137,72,217,151,251,83,20,113,37,151,34,37,71,95,105,235,144,164,83,197,254,183,223,91,19,45,227, }; + u8 encoded_frame[] = { + 85, 230, 0, 195, 4, 255, 212, 87, 52, 244, 250, 176, 222, 235, + 106, 144, 29, 141, 255, 3, 16, 192, 237, 172, 254, 213, 4, 220, + 98, 34, 222, 230, 214, 6, 217, 172, 122, 46, 13, 38, 240, 236, + 60, 121, 47, 252, 163, 141, 222, 29, 168, 214, 118, 55, 201, 233, + 21, 214, 57, 245, 246, 19, 3, 121, 49, 231, 37, 186, 58, 238, + 98, 39, 70, 232, 133, 25, 10, 134, 129, 69, 228, 134, 9, 88, + 183, 133, 171, 255, 166, 100, 152, 231, 92, 9, 196, 106, 246, 29, + 145, 156, 151, 32, 67, 188, 63, 233, 142, 174, 139, 154, 127, 35, + 60, 56, 187, 121, 103, 135, 152, 182, 88, 160, 255, 227, 240, 54, + 100, 91, 31, 141, 102, 130, 254, 54, 227, 229, 62, 53, 225, 143, + 88, 139, 126, 235, 235, 35, 54, 134, 163, 92, 57, 87, 130, 178, + 22, 158, 18, 237, 209, 187, 226, 1, 46, 64, 226, 235, 213, 186, + 159, 221, 186, 25, 115, 84, 131, 167, 201, 104, 1, 200, 13, 50, + 71, 73, 193, 201, 250, 172, 193, 13, 20, 238, 130, 243, 68, 4, + 72, 46, 194, 113, 255, 238, 15, 230, 64, 178, 127, 217, 92, 160, + 201, 118, 163, 144, 58, 28, 174, 65, 73, 45, 123, 118, 83, 107, + 239, 168, 32, 212, 191, 81, 93, 186, 223, 32, 19, 58, 137, 72, + 217, 151, 251, 83, 20, 113, 37, 151, 34, 37, 71, 95, 105, 235, + 144, 164, 83, 197, 254, 183, 223, 91, 19, 45, 227, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_flash_program_t* test_msg = ( msg_flash_program_t* )test_msg_storage; + msg_flash_program_t *test_msg = (msg_flash_program_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->addr_len = 250; if (sizeof(test_msg->addr_start) == 0) { @@ -1410,317 +1429,835 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashProgram ) } test_msg->data[249] = 19; test_msg->target = 212; - sbp_payload_send(&sbp_state, 0xe6, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xe6, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xe6, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_flash_program_t* check_msg = ( msg_flash_program_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_flash_program_t *check_msg = + (msg_flash_program_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->addr_len == 250, "incorrect value for addr_len, expected 250, is %d", check_msg->addr_len); - ck_assert_msg(check_msg->addr_start[0] == 87, "incorrect value for addr_start[0], expected 87, is %d", check_msg->addr_start[0]); - ck_assert_msg(check_msg->addr_start[1] == 52, "incorrect value for addr_start[1], expected 52, is %d", check_msg->addr_start[1]); - ck_assert_msg(check_msg->addr_start[2] == 244, "incorrect value for addr_start[2], expected 244, is %d", check_msg->addr_start[2]); - ck_assert_msg(check_msg->data[0] == 176, "incorrect value for data[0], expected 176, is %d", check_msg->data[0]); - ck_assert_msg(check_msg->data[1] == 222, "incorrect value for data[1], expected 222, is %d", check_msg->data[1]); - ck_assert_msg(check_msg->data[2] == 235, "incorrect value for data[2], expected 235, is %d", check_msg->data[2]); - ck_assert_msg(check_msg->data[3] == 106, "incorrect value for data[3], expected 106, is %d", check_msg->data[3]); - ck_assert_msg(check_msg->data[4] == 144, "incorrect value for data[4], expected 144, is %d", check_msg->data[4]); - ck_assert_msg(check_msg->data[5] == 29, "incorrect value for data[5], expected 29, is %d", check_msg->data[5]); - ck_assert_msg(check_msg->data[6] == 141, "incorrect value for data[6], expected 141, is %d", check_msg->data[6]); - ck_assert_msg(check_msg->data[7] == 255, "incorrect value for data[7], expected 255, is %d", check_msg->data[7]); - ck_assert_msg(check_msg->data[8] == 3, "incorrect value for data[8], expected 3, is %d", check_msg->data[8]); - ck_assert_msg(check_msg->data[9] == 16, "incorrect value for data[9], expected 16, is %d", check_msg->data[9]); - ck_assert_msg(check_msg->data[10] == 192, "incorrect value for data[10], expected 192, is %d", check_msg->data[10]); - ck_assert_msg(check_msg->data[11] == 237, "incorrect value for data[11], expected 237, is %d", check_msg->data[11]); - ck_assert_msg(check_msg->data[12] == 172, "incorrect value for data[12], expected 172, is %d", check_msg->data[12]); - ck_assert_msg(check_msg->data[13] == 254, "incorrect value for data[13], expected 254, is %d", check_msg->data[13]); - ck_assert_msg(check_msg->data[14] == 213, "incorrect value for data[14], expected 213, is %d", check_msg->data[14]); - ck_assert_msg(check_msg->data[15] == 4, "incorrect value for data[15], expected 4, is %d", check_msg->data[15]); - ck_assert_msg(check_msg->data[16] == 220, "incorrect value for data[16], expected 220, is %d", check_msg->data[16]); - ck_assert_msg(check_msg->data[17] == 98, "incorrect value for data[17], expected 98, is %d", check_msg->data[17]); - ck_assert_msg(check_msg->data[18] == 34, "incorrect value for data[18], expected 34, is %d", check_msg->data[18]); - ck_assert_msg(check_msg->data[19] == 222, "incorrect value for data[19], expected 222, is %d", check_msg->data[19]); - ck_assert_msg(check_msg->data[20] == 230, "incorrect value for data[20], expected 230, is %d", check_msg->data[20]); - ck_assert_msg(check_msg->data[21] == 214, "incorrect value for data[21], expected 214, is %d", check_msg->data[21]); - ck_assert_msg(check_msg->data[22] == 6, "incorrect value for data[22], expected 6, is %d", check_msg->data[22]); - ck_assert_msg(check_msg->data[23] == 217, "incorrect value for data[23], expected 217, is %d", check_msg->data[23]); - ck_assert_msg(check_msg->data[24] == 172, "incorrect value for data[24], expected 172, is %d", check_msg->data[24]); - ck_assert_msg(check_msg->data[25] == 122, "incorrect value for data[25], expected 122, is %d", check_msg->data[25]); - ck_assert_msg(check_msg->data[26] == 46, "incorrect value for data[26], expected 46, is %d", check_msg->data[26]); - ck_assert_msg(check_msg->data[27] == 13, "incorrect value for data[27], expected 13, is %d", check_msg->data[27]); - ck_assert_msg(check_msg->data[28] == 38, "incorrect value for data[28], expected 38, is %d", check_msg->data[28]); - ck_assert_msg(check_msg->data[29] == 240, "incorrect value for data[29], expected 240, is %d", check_msg->data[29]); - ck_assert_msg(check_msg->data[30] == 236, "incorrect value for data[30], expected 236, is %d", check_msg->data[30]); - ck_assert_msg(check_msg->data[31] == 60, "incorrect value for data[31], expected 60, is %d", check_msg->data[31]); - ck_assert_msg(check_msg->data[32] == 121, "incorrect value for data[32], expected 121, is %d", check_msg->data[32]); - ck_assert_msg(check_msg->data[33] == 47, "incorrect value for data[33], expected 47, is %d", check_msg->data[33]); - ck_assert_msg(check_msg->data[34] == 252, "incorrect value for data[34], expected 252, is %d", check_msg->data[34]); - ck_assert_msg(check_msg->data[35] == 163, "incorrect value for data[35], expected 163, is %d", check_msg->data[35]); - ck_assert_msg(check_msg->data[36] == 141, "incorrect value for data[36], expected 141, is %d", check_msg->data[36]); - ck_assert_msg(check_msg->data[37] == 222, "incorrect value for data[37], expected 222, is %d", check_msg->data[37]); - ck_assert_msg(check_msg->data[38] == 29, "incorrect value for data[38], expected 29, is %d", check_msg->data[38]); - ck_assert_msg(check_msg->data[39] == 168, "incorrect value for data[39], expected 168, is %d", check_msg->data[39]); - ck_assert_msg(check_msg->data[40] == 214, "incorrect value for data[40], expected 214, is %d", check_msg->data[40]); - ck_assert_msg(check_msg->data[41] == 118, "incorrect value for data[41], expected 118, is %d", check_msg->data[41]); - ck_assert_msg(check_msg->data[42] == 55, "incorrect value for data[42], expected 55, is %d", check_msg->data[42]); - ck_assert_msg(check_msg->data[43] == 201, "incorrect value for data[43], expected 201, is %d", check_msg->data[43]); - ck_assert_msg(check_msg->data[44] == 233, "incorrect value for data[44], expected 233, is %d", check_msg->data[44]); - ck_assert_msg(check_msg->data[45] == 21, "incorrect value for data[45], expected 21, is %d", check_msg->data[45]); - ck_assert_msg(check_msg->data[46] == 214, "incorrect value for data[46], expected 214, is %d", check_msg->data[46]); - ck_assert_msg(check_msg->data[47] == 57, "incorrect value for data[47], expected 57, is %d", check_msg->data[47]); - ck_assert_msg(check_msg->data[48] == 245, "incorrect value for data[48], expected 245, is %d", check_msg->data[48]); - ck_assert_msg(check_msg->data[49] == 246, "incorrect value for data[49], expected 246, is %d", check_msg->data[49]); - ck_assert_msg(check_msg->data[50] == 19, "incorrect value for data[50], expected 19, is %d", check_msg->data[50]); - ck_assert_msg(check_msg->data[51] == 3, "incorrect value for data[51], expected 3, is %d", check_msg->data[51]); - ck_assert_msg(check_msg->data[52] == 121, "incorrect value for data[52], expected 121, is %d", check_msg->data[52]); - ck_assert_msg(check_msg->data[53] == 49, "incorrect value for data[53], expected 49, is %d", check_msg->data[53]); - ck_assert_msg(check_msg->data[54] == 231, "incorrect value for data[54], expected 231, is %d", check_msg->data[54]); - ck_assert_msg(check_msg->data[55] == 37, "incorrect value for data[55], expected 37, is %d", check_msg->data[55]); - ck_assert_msg(check_msg->data[56] == 186, "incorrect value for data[56], expected 186, is %d", check_msg->data[56]); - ck_assert_msg(check_msg->data[57] == 58, "incorrect value for data[57], expected 58, is %d", check_msg->data[57]); - ck_assert_msg(check_msg->data[58] == 238, "incorrect value for data[58], expected 238, is %d", check_msg->data[58]); - ck_assert_msg(check_msg->data[59] == 98, "incorrect value for data[59], expected 98, is %d", check_msg->data[59]); - ck_assert_msg(check_msg->data[60] == 39, "incorrect value for data[60], expected 39, is %d", check_msg->data[60]); - ck_assert_msg(check_msg->data[61] == 70, "incorrect value for data[61], expected 70, is %d", check_msg->data[61]); - ck_assert_msg(check_msg->data[62] == 232, "incorrect value for data[62], expected 232, is %d", check_msg->data[62]); - ck_assert_msg(check_msg->data[63] == 133, "incorrect value for data[63], expected 133, is %d", check_msg->data[63]); - ck_assert_msg(check_msg->data[64] == 25, "incorrect value for data[64], expected 25, is %d", check_msg->data[64]); - ck_assert_msg(check_msg->data[65] == 10, "incorrect value for data[65], expected 10, is %d", check_msg->data[65]); - ck_assert_msg(check_msg->data[66] == 134, "incorrect value for data[66], expected 134, is %d", check_msg->data[66]); - ck_assert_msg(check_msg->data[67] == 129, "incorrect value for data[67], expected 129, is %d", check_msg->data[67]); - ck_assert_msg(check_msg->data[68] == 69, "incorrect value for data[68], expected 69, is %d", check_msg->data[68]); - ck_assert_msg(check_msg->data[69] == 228, "incorrect value for data[69], expected 228, is %d", check_msg->data[69]); - ck_assert_msg(check_msg->data[70] == 134, "incorrect value for data[70], expected 134, is %d", check_msg->data[70]); - ck_assert_msg(check_msg->data[71] == 9, "incorrect value for data[71], expected 9, is %d", check_msg->data[71]); - ck_assert_msg(check_msg->data[72] == 88, "incorrect value for data[72], expected 88, is %d", check_msg->data[72]); - ck_assert_msg(check_msg->data[73] == 183, "incorrect value for data[73], expected 183, is %d", check_msg->data[73]); - ck_assert_msg(check_msg->data[74] == 133, "incorrect value for data[74], expected 133, is %d", check_msg->data[74]); - ck_assert_msg(check_msg->data[75] == 171, "incorrect value for data[75], expected 171, is %d", check_msg->data[75]); - ck_assert_msg(check_msg->data[76] == 255, "incorrect value for data[76], expected 255, is %d", check_msg->data[76]); - ck_assert_msg(check_msg->data[77] == 166, "incorrect value for data[77], expected 166, is %d", check_msg->data[77]); - ck_assert_msg(check_msg->data[78] == 100, "incorrect value for data[78], expected 100, is %d", check_msg->data[78]); - ck_assert_msg(check_msg->data[79] == 152, "incorrect value for data[79], expected 152, is %d", check_msg->data[79]); - ck_assert_msg(check_msg->data[80] == 231, "incorrect value for data[80], expected 231, is %d", check_msg->data[80]); - ck_assert_msg(check_msg->data[81] == 92, "incorrect value for data[81], expected 92, is %d", check_msg->data[81]); - ck_assert_msg(check_msg->data[82] == 9, "incorrect value for data[82], expected 9, is %d", check_msg->data[82]); - ck_assert_msg(check_msg->data[83] == 196, "incorrect value for data[83], expected 196, is %d", check_msg->data[83]); - ck_assert_msg(check_msg->data[84] == 106, "incorrect value for data[84], expected 106, is %d", check_msg->data[84]); - ck_assert_msg(check_msg->data[85] == 246, "incorrect value for data[85], expected 246, is %d", check_msg->data[85]); - ck_assert_msg(check_msg->data[86] == 29, "incorrect value for data[86], expected 29, is %d", check_msg->data[86]); - ck_assert_msg(check_msg->data[87] == 145, "incorrect value for data[87], expected 145, is %d", check_msg->data[87]); - ck_assert_msg(check_msg->data[88] == 156, "incorrect value for data[88], expected 156, is %d", check_msg->data[88]); - ck_assert_msg(check_msg->data[89] == 151, "incorrect value for data[89], expected 151, is %d", check_msg->data[89]); - ck_assert_msg(check_msg->data[90] == 32, "incorrect value for data[90], expected 32, is %d", check_msg->data[90]); - ck_assert_msg(check_msg->data[91] == 67, "incorrect value for data[91], expected 67, is %d", check_msg->data[91]); - ck_assert_msg(check_msg->data[92] == 188, "incorrect value for data[92], expected 188, is %d", check_msg->data[92]); - ck_assert_msg(check_msg->data[93] == 63, "incorrect value for data[93], expected 63, is %d", check_msg->data[93]); - ck_assert_msg(check_msg->data[94] == 233, "incorrect value for data[94], expected 233, is %d", check_msg->data[94]); - ck_assert_msg(check_msg->data[95] == 142, "incorrect value for data[95], expected 142, is %d", check_msg->data[95]); - ck_assert_msg(check_msg->data[96] == 174, "incorrect value for data[96], expected 174, is %d", check_msg->data[96]); - ck_assert_msg(check_msg->data[97] == 139, "incorrect value for data[97], expected 139, is %d", check_msg->data[97]); - ck_assert_msg(check_msg->data[98] == 154, "incorrect value for data[98], expected 154, is %d", check_msg->data[98]); - ck_assert_msg(check_msg->data[99] == 127, "incorrect value for data[99], expected 127, is %d", check_msg->data[99]); - ck_assert_msg(check_msg->data[100] == 35, "incorrect value for data[100], expected 35, is %d", check_msg->data[100]); - ck_assert_msg(check_msg->data[101] == 60, "incorrect value for data[101], expected 60, is %d", check_msg->data[101]); - ck_assert_msg(check_msg->data[102] == 56, "incorrect value for data[102], expected 56, is %d", check_msg->data[102]); - ck_assert_msg(check_msg->data[103] == 187, "incorrect value for data[103], expected 187, is %d", check_msg->data[103]); - ck_assert_msg(check_msg->data[104] == 121, "incorrect value for data[104], expected 121, is %d", check_msg->data[104]); - ck_assert_msg(check_msg->data[105] == 103, "incorrect value for data[105], expected 103, is %d", check_msg->data[105]); - ck_assert_msg(check_msg->data[106] == 135, "incorrect value for data[106], expected 135, is %d", check_msg->data[106]); - ck_assert_msg(check_msg->data[107] == 152, "incorrect value for data[107], expected 152, is %d", check_msg->data[107]); - ck_assert_msg(check_msg->data[108] == 182, "incorrect value for data[108], expected 182, is %d", check_msg->data[108]); - ck_assert_msg(check_msg->data[109] == 88, "incorrect value for data[109], expected 88, is %d", check_msg->data[109]); - ck_assert_msg(check_msg->data[110] == 160, "incorrect value for data[110], expected 160, is %d", check_msg->data[110]); - ck_assert_msg(check_msg->data[111] == 255, "incorrect value for data[111], expected 255, is %d", check_msg->data[111]); - ck_assert_msg(check_msg->data[112] == 227, "incorrect value for data[112], expected 227, is %d", check_msg->data[112]); - ck_assert_msg(check_msg->data[113] == 240, "incorrect value for data[113], expected 240, is %d", check_msg->data[113]); - ck_assert_msg(check_msg->data[114] == 54, "incorrect value for data[114], expected 54, is %d", check_msg->data[114]); - ck_assert_msg(check_msg->data[115] == 100, "incorrect value for data[115], expected 100, is %d", check_msg->data[115]); - ck_assert_msg(check_msg->data[116] == 91, "incorrect value for data[116], expected 91, is %d", check_msg->data[116]); - ck_assert_msg(check_msg->data[117] == 31, "incorrect value for data[117], expected 31, is %d", check_msg->data[117]); - ck_assert_msg(check_msg->data[118] == 141, "incorrect value for data[118], expected 141, is %d", check_msg->data[118]); - ck_assert_msg(check_msg->data[119] == 102, "incorrect value for data[119], expected 102, is %d", check_msg->data[119]); - ck_assert_msg(check_msg->data[120] == 130, "incorrect value for data[120], expected 130, is %d", check_msg->data[120]); - ck_assert_msg(check_msg->data[121] == 254, "incorrect value for data[121], expected 254, is %d", check_msg->data[121]); - ck_assert_msg(check_msg->data[122] == 54, "incorrect value for data[122], expected 54, is %d", check_msg->data[122]); - ck_assert_msg(check_msg->data[123] == 227, "incorrect value for data[123], expected 227, is %d", check_msg->data[123]); - ck_assert_msg(check_msg->data[124] == 229, "incorrect value for data[124], expected 229, is %d", check_msg->data[124]); - ck_assert_msg(check_msg->data[125] == 62, "incorrect value for data[125], expected 62, is %d", check_msg->data[125]); - ck_assert_msg(check_msg->data[126] == 53, "incorrect value for data[126], expected 53, is %d", check_msg->data[126]); - ck_assert_msg(check_msg->data[127] == 225, "incorrect value for data[127], expected 225, is %d", check_msg->data[127]); - ck_assert_msg(check_msg->data[128] == 143, "incorrect value for data[128], expected 143, is %d", check_msg->data[128]); - ck_assert_msg(check_msg->data[129] == 88, "incorrect value for data[129], expected 88, is %d", check_msg->data[129]); - ck_assert_msg(check_msg->data[130] == 139, "incorrect value for data[130], expected 139, is %d", check_msg->data[130]); - ck_assert_msg(check_msg->data[131] == 126, "incorrect value for data[131], expected 126, is %d", check_msg->data[131]); - ck_assert_msg(check_msg->data[132] == 235, "incorrect value for data[132], expected 235, is %d", check_msg->data[132]); - ck_assert_msg(check_msg->data[133] == 235, "incorrect value for data[133], expected 235, is %d", check_msg->data[133]); - ck_assert_msg(check_msg->data[134] == 35, "incorrect value for data[134], expected 35, is %d", check_msg->data[134]); - ck_assert_msg(check_msg->data[135] == 54, "incorrect value for data[135], expected 54, is %d", check_msg->data[135]); - ck_assert_msg(check_msg->data[136] == 134, "incorrect value for data[136], expected 134, is %d", check_msg->data[136]); - ck_assert_msg(check_msg->data[137] == 163, "incorrect value for data[137], expected 163, is %d", check_msg->data[137]); - ck_assert_msg(check_msg->data[138] == 92, "incorrect value for data[138], expected 92, is %d", check_msg->data[138]); - ck_assert_msg(check_msg->data[139] == 57, "incorrect value for data[139], expected 57, is %d", check_msg->data[139]); - ck_assert_msg(check_msg->data[140] == 87, "incorrect value for data[140], expected 87, is %d", check_msg->data[140]); - ck_assert_msg(check_msg->data[141] == 130, "incorrect value for data[141], expected 130, is %d", check_msg->data[141]); - ck_assert_msg(check_msg->data[142] == 178, "incorrect value for data[142], expected 178, is %d", check_msg->data[142]); - ck_assert_msg(check_msg->data[143] == 22, "incorrect value for data[143], expected 22, is %d", check_msg->data[143]); - ck_assert_msg(check_msg->data[144] == 158, "incorrect value for data[144], expected 158, is %d", check_msg->data[144]); - ck_assert_msg(check_msg->data[145] == 18, "incorrect value for data[145], expected 18, is %d", check_msg->data[145]); - ck_assert_msg(check_msg->data[146] == 237, "incorrect value for data[146], expected 237, is %d", check_msg->data[146]); - ck_assert_msg(check_msg->data[147] == 209, "incorrect value for data[147], expected 209, is %d", check_msg->data[147]); - ck_assert_msg(check_msg->data[148] == 187, "incorrect value for data[148], expected 187, is %d", check_msg->data[148]); - ck_assert_msg(check_msg->data[149] == 226, "incorrect value for data[149], expected 226, is %d", check_msg->data[149]); - ck_assert_msg(check_msg->data[150] == 1, "incorrect value for data[150], expected 1, is %d", check_msg->data[150]); - ck_assert_msg(check_msg->data[151] == 46, "incorrect value for data[151], expected 46, is %d", check_msg->data[151]); - ck_assert_msg(check_msg->data[152] == 64, "incorrect value for data[152], expected 64, is %d", check_msg->data[152]); - ck_assert_msg(check_msg->data[153] == 226, "incorrect value for data[153], expected 226, is %d", check_msg->data[153]); - ck_assert_msg(check_msg->data[154] == 235, "incorrect value for data[154], expected 235, is %d", check_msg->data[154]); - ck_assert_msg(check_msg->data[155] == 213, "incorrect value for data[155], expected 213, is %d", check_msg->data[155]); - ck_assert_msg(check_msg->data[156] == 186, "incorrect value for data[156], expected 186, is %d", check_msg->data[156]); - ck_assert_msg(check_msg->data[157] == 159, "incorrect value for data[157], expected 159, is %d", check_msg->data[157]); - ck_assert_msg(check_msg->data[158] == 221, "incorrect value for data[158], expected 221, is %d", check_msg->data[158]); - ck_assert_msg(check_msg->data[159] == 186, "incorrect value for data[159], expected 186, is %d", check_msg->data[159]); - ck_assert_msg(check_msg->data[160] == 25, "incorrect value for data[160], expected 25, is %d", check_msg->data[160]); - ck_assert_msg(check_msg->data[161] == 115, "incorrect value for data[161], expected 115, is %d", check_msg->data[161]); - ck_assert_msg(check_msg->data[162] == 84, "incorrect value for data[162], expected 84, is %d", check_msg->data[162]); - ck_assert_msg(check_msg->data[163] == 131, "incorrect value for data[163], expected 131, is %d", check_msg->data[163]); - ck_assert_msg(check_msg->data[164] == 167, "incorrect value for data[164], expected 167, is %d", check_msg->data[164]); - ck_assert_msg(check_msg->data[165] == 201, "incorrect value for data[165], expected 201, is %d", check_msg->data[165]); - ck_assert_msg(check_msg->data[166] == 104, "incorrect value for data[166], expected 104, is %d", check_msg->data[166]); - ck_assert_msg(check_msg->data[167] == 1, "incorrect value for data[167], expected 1, is %d", check_msg->data[167]); - ck_assert_msg(check_msg->data[168] == 200, "incorrect value for data[168], expected 200, is %d", check_msg->data[168]); - ck_assert_msg(check_msg->data[169] == 13, "incorrect value for data[169], expected 13, is %d", check_msg->data[169]); - ck_assert_msg(check_msg->data[170] == 50, "incorrect value for data[170], expected 50, is %d", check_msg->data[170]); - ck_assert_msg(check_msg->data[171] == 71, "incorrect value for data[171], expected 71, is %d", check_msg->data[171]); - ck_assert_msg(check_msg->data[172] == 73, "incorrect value for data[172], expected 73, is %d", check_msg->data[172]); - ck_assert_msg(check_msg->data[173] == 193, "incorrect value for data[173], expected 193, is %d", check_msg->data[173]); - ck_assert_msg(check_msg->data[174] == 201, "incorrect value for data[174], expected 201, is %d", check_msg->data[174]); - ck_assert_msg(check_msg->data[175] == 250, "incorrect value for data[175], expected 250, is %d", check_msg->data[175]); - ck_assert_msg(check_msg->data[176] == 172, "incorrect value for data[176], expected 172, is %d", check_msg->data[176]); - ck_assert_msg(check_msg->data[177] == 193, "incorrect value for data[177], expected 193, is %d", check_msg->data[177]); - ck_assert_msg(check_msg->data[178] == 13, "incorrect value for data[178], expected 13, is %d", check_msg->data[178]); - ck_assert_msg(check_msg->data[179] == 20, "incorrect value for data[179], expected 20, is %d", check_msg->data[179]); - ck_assert_msg(check_msg->data[180] == 238, "incorrect value for data[180], expected 238, is %d", check_msg->data[180]); - ck_assert_msg(check_msg->data[181] == 130, "incorrect value for data[181], expected 130, is %d", check_msg->data[181]); - ck_assert_msg(check_msg->data[182] == 243, "incorrect value for data[182], expected 243, is %d", check_msg->data[182]); - ck_assert_msg(check_msg->data[183] == 68, "incorrect value for data[183], expected 68, is %d", check_msg->data[183]); - ck_assert_msg(check_msg->data[184] == 4, "incorrect value for data[184], expected 4, is %d", check_msg->data[184]); - ck_assert_msg(check_msg->data[185] == 72, "incorrect value for data[185], expected 72, is %d", check_msg->data[185]); - ck_assert_msg(check_msg->data[186] == 46, "incorrect value for data[186], expected 46, is %d", check_msg->data[186]); - ck_assert_msg(check_msg->data[187] == 194, "incorrect value for data[187], expected 194, is %d", check_msg->data[187]); - ck_assert_msg(check_msg->data[188] == 113, "incorrect value for data[188], expected 113, is %d", check_msg->data[188]); - ck_assert_msg(check_msg->data[189] == 255, "incorrect value for data[189], expected 255, is %d", check_msg->data[189]); - ck_assert_msg(check_msg->data[190] == 238, "incorrect value for data[190], expected 238, is %d", check_msg->data[190]); - ck_assert_msg(check_msg->data[191] == 15, "incorrect value for data[191], expected 15, is %d", check_msg->data[191]); - ck_assert_msg(check_msg->data[192] == 230, "incorrect value for data[192], expected 230, is %d", check_msg->data[192]); - ck_assert_msg(check_msg->data[193] == 64, "incorrect value for data[193], expected 64, is %d", check_msg->data[193]); - ck_assert_msg(check_msg->data[194] == 178, "incorrect value for data[194], expected 178, is %d", check_msg->data[194]); - ck_assert_msg(check_msg->data[195] == 127, "incorrect value for data[195], expected 127, is %d", check_msg->data[195]); - ck_assert_msg(check_msg->data[196] == 217, "incorrect value for data[196], expected 217, is %d", check_msg->data[196]); - ck_assert_msg(check_msg->data[197] == 92, "incorrect value for data[197], expected 92, is %d", check_msg->data[197]); - ck_assert_msg(check_msg->data[198] == 160, "incorrect value for data[198], expected 160, is %d", check_msg->data[198]); - ck_assert_msg(check_msg->data[199] == 201, "incorrect value for data[199], expected 201, is %d", check_msg->data[199]); - ck_assert_msg(check_msg->data[200] == 118, "incorrect value for data[200], expected 118, is %d", check_msg->data[200]); - ck_assert_msg(check_msg->data[201] == 163, "incorrect value for data[201], expected 163, is %d", check_msg->data[201]); - ck_assert_msg(check_msg->data[202] == 144, "incorrect value for data[202], expected 144, is %d", check_msg->data[202]); - ck_assert_msg(check_msg->data[203] == 58, "incorrect value for data[203], expected 58, is %d", check_msg->data[203]); - ck_assert_msg(check_msg->data[204] == 28, "incorrect value for data[204], expected 28, is %d", check_msg->data[204]); - ck_assert_msg(check_msg->data[205] == 174, "incorrect value for data[205], expected 174, is %d", check_msg->data[205]); - ck_assert_msg(check_msg->data[206] == 65, "incorrect value for data[206], expected 65, is %d", check_msg->data[206]); - ck_assert_msg(check_msg->data[207] == 73, "incorrect value for data[207], expected 73, is %d", check_msg->data[207]); - ck_assert_msg(check_msg->data[208] == 45, "incorrect value for data[208], expected 45, is %d", check_msg->data[208]); - ck_assert_msg(check_msg->data[209] == 123, "incorrect value for data[209], expected 123, is %d", check_msg->data[209]); - ck_assert_msg(check_msg->data[210] == 118, "incorrect value for data[210], expected 118, is %d", check_msg->data[210]); - ck_assert_msg(check_msg->data[211] == 83, "incorrect value for data[211], expected 83, is %d", check_msg->data[211]); - ck_assert_msg(check_msg->data[212] == 107, "incorrect value for data[212], expected 107, is %d", check_msg->data[212]); - ck_assert_msg(check_msg->data[213] == 239, "incorrect value for data[213], expected 239, is %d", check_msg->data[213]); - ck_assert_msg(check_msg->data[214] == 168, "incorrect value for data[214], expected 168, is %d", check_msg->data[214]); - ck_assert_msg(check_msg->data[215] == 32, "incorrect value for data[215], expected 32, is %d", check_msg->data[215]); - ck_assert_msg(check_msg->data[216] == 212, "incorrect value for data[216], expected 212, is %d", check_msg->data[216]); - ck_assert_msg(check_msg->data[217] == 191, "incorrect value for data[217], expected 191, is %d", check_msg->data[217]); - ck_assert_msg(check_msg->data[218] == 81, "incorrect value for data[218], expected 81, is %d", check_msg->data[218]); - ck_assert_msg(check_msg->data[219] == 93, "incorrect value for data[219], expected 93, is %d", check_msg->data[219]); - ck_assert_msg(check_msg->data[220] == 186, "incorrect value for data[220], expected 186, is %d", check_msg->data[220]); - ck_assert_msg(check_msg->data[221] == 223, "incorrect value for data[221], expected 223, is %d", check_msg->data[221]); - ck_assert_msg(check_msg->data[222] == 32, "incorrect value for data[222], expected 32, is %d", check_msg->data[222]); - ck_assert_msg(check_msg->data[223] == 19, "incorrect value for data[223], expected 19, is %d", check_msg->data[223]); - ck_assert_msg(check_msg->data[224] == 58, "incorrect value for data[224], expected 58, is %d", check_msg->data[224]); - ck_assert_msg(check_msg->data[225] == 137, "incorrect value for data[225], expected 137, is %d", check_msg->data[225]); - ck_assert_msg(check_msg->data[226] == 72, "incorrect value for data[226], expected 72, is %d", check_msg->data[226]); - ck_assert_msg(check_msg->data[227] == 217, "incorrect value for data[227], expected 217, is %d", check_msg->data[227]); - ck_assert_msg(check_msg->data[228] == 151, "incorrect value for data[228], expected 151, is %d", check_msg->data[228]); - ck_assert_msg(check_msg->data[229] == 251, "incorrect value for data[229], expected 251, is %d", check_msg->data[229]); - ck_assert_msg(check_msg->data[230] == 83, "incorrect value for data[230], expected 83, is %d", check_msg->data[230]); - ck_assert_msg(check_msg->data[231] == 20, "incorrect value for data[231], expected 20, is %d", check_msg->data[231]); - ck_assert_msg(check_msg->data[232] == 113, "incorrect value for data[232], expected 113, is %d", check_msg->data[232]); - ck_assert_msg(check_msg->data[233] == 37, "incorrect value for data[233], expected 37, is %d", check_msg->data[233]); - ck_assert_msg(check_msg->data[234] == 151, "incorrect value for data[234], expected 151, is %d", check_msg->data[234]); - ck_assert_msg(check_msg->data[235] == 34, "incorrect value for data[235], expected 34, is %d", check_msg->data[235]); - ck_assert_msg(check_msg->data[236] == 37, "incorrect value for data[236], expected 37, is %d", check_msg->data[236]); - ck_assert_msg(check_msg->data[237] == 71, "incorrect value for data[237], expected 71, is %d", check_msg->data[237]); - ck_assert_msg(check_msg->data[238] == 95, "incorrect value for data[238], expected 95, is %d", check_msg->data[238]); - ck_assert_msg(check_msg->data[239] == 105, "incorrect value for data[239], expected 105, is %d", check_msg->data[239]); - ck_assert_msg(check_msg->data[240] == 235, "incorrect value for data[240], expected 235, is %d", check_msg->data[240]); - ck_assert_msg(check_msg->data[241] == 144, "incorrect value for data[241], expected 144, is %d", check_msg->data[241]); - ck_assert_msg(check_msg->data[242] == 164, "incorrect value for data[242], expected 164, is %d", check_msg->data[242]); - ck_assert_msg(check_msg->data[243] == 83, "incorrect value for data[243], expected 83, is %d", check_msg->data[243]); - ck_assert_msg(check_msg->data[244] == 197, "incorrect value for data[244], expected 197, is %d", check_msg->data[244]); - ck_assert_msg(check_msg->data[245] == 254, "incorrect value for data[245], expected 254, is %d", check_msg->data[245]); - ck_assert_msg(check_msg->data[246] == 183, "incorrect value for data[246], expected 183, is %d", check_msg->data[246]); - ck_assert_msg(check_msg->data[247] == 223, "incorrect value for data[247], expected 223, is %d", check_msg->data[247]); - ck_assert_msg(check_msg->data[248] == 91, "incorrect value for data[248], expected 91, is %d", check_msg->data[248]); - ck_assert_msg(check_msg->data[249] == 19, "incorrect value for data[249], expected 19, is %d", check_msg->data[249]); - ck_assert_msg(check_msg->target == 212, "incorrect value for target, expected 212, is %d", check_msg->target); + ck_assert_msg(check_msg->addr_len == 250, + "incorrect value for addr_len, expected 250, is %d", + check_msg->addr_len); + ck_assert_msg(check_msg->addr_start[0] == 87, + "incorrect value for addr_start[0], expected 87, is %d", + check_msg->addr_start[0]); + ck_assert_msg(check_msg->addr_start[1] == 52, + "incorrect value for addr_start[1], expected 52, is %d", + check_msg->addr_start[1]); + ck_assert_msg(check_msg->addr_start[2] == 244, + "incorrect value for addr_start[2], expected 244, is %d", + check_msg->addr_start[2]); + ck_assert_msg(check_msg->data[0] == 176, + "incorrect value for data[0], expected 176, is %d", + check_msg->data[0]); + ck_assert_msg(check_msg->data[1] == 222, + "incorrect value for data[1], expected 222, is %d", + check_msg->data[1]); + ck_assert_msg(check_msg->data[2] == 235, + "incorrect value for data[2], expected 235, is %d", + check_msg->data[2]); + ck_assert_msg(check_msg->data[3] == 106, + "incorrect value for data[3], expected 106, is %d", + check_msg->data[3]); + ck_assert_msg(check_msg->data[4] == 144, + "incorrect value for data[4], expected 144, is %d", + check_msg->data[4]); + ck_assert_msg(check_msg->data[5] == 29, + "incorrect value for data[5], expected 29, is %d", + check_msg->data[5]); + ck_assert_msg(check_msg->data[6] == 141, + "incorrect value for data[6], expected 141, is %d", + check_msg->data[6]); + ck_assert_msg(check_msg->data[7] == 255, + "incorrect value for data[7], expected 255, is %d", + check_msg->data[7]); + ck_assert_msg(check_msg->data[8] == 3, + "incorrect value for data[8], expected 3, is %d", + check_msg->data[8]); + ck_assert_msg(check_msg->data[9] == 16, + "incorrect value for data[9], expected 16, is %d", + check_msg->data[9]); + ck_assert_msg(check_msg->data[10] == 192, + "incorrect value for data[10], expected 192, is %d", + check_msg->data[10]); + ck_assert_msg(check_msg->data[11] == 237, + "incorrect value for data[11], expected 237, is %d", + check_msg->data[11]); + ck_assert_msg(check_msg->data[12] == 172, + "incorrect value for data[12], expected 172, is %d", + check_msg->data[12]); + ck_assert_msg(check_msg->data[13] == 254, + "incorrect value for data[13], expected 254, is %d", + check_msg->data[13]); + ck_assert_msg(check_msg->data[14] == 213, + "incorrect value for data[14], expected 213, is %d", + check_msg->data[14]); + ck_assert_msg(check_msg->data[15] == 4, + "incorrect value for data[15], expected 4, is %d", + check_msg->data[15]); + ck_assert_msg(check_msg->data[16] == 220, + "incorrect value for data[16], expected 220, is %d", + check_msg->data[16]); + ck_assert_msg(check_msg->data[17] == 98, + "incorrect value for data[17], expected 98, is %d", + check_msg->data[17]); + ck_assert_msg(check_msg->data[18] == 34, + "incorrect value for data[18], expected 34, is %d", + check_msg->data[18]); + ck_assert_msg(check_msg->data[19] == 222, + "incorrect value for data[19], expected 222, is %d", + check_msg->data[19]); + ck_assert_msg(check_msg->data[20] == 230, + "incorrect value for data[20], expected 230, is %d", + check_msg->data[20]); + ck_assert_msg(check_msg->data[21] == 214, + "incorrect value for data[21], expected 214, is %d", + check_msg->data[21]); + ck_assert_msg(check_msg->data[22] == 6, + "incorrect value for data[22], expected 6, is %d", + check_msg->data[22]); + ck_assert_msg(check_msg->data[23] == 217, + "incorrect value for data[23], expected 217, is %d", + check_msg->data[23]); + ck_assert_msg(check_msg->data[24] == 172, + "incorrect value for data[24], expected 172, is %d", + check_msg->data[24]); + ck_assert_msg(check_msg->data[25] == 122, + "incorrect value for data[25], expected 122, is %d", + check_msg->data[25]); + ck_assert_msg(check_msg->data[26] == 46, + "incorrect value for data[26], expected 46, is %d", + check_msg->data[26]); + ck_assert_msg(check_msg->data[27] == 13, + "incorrect value for data[27], expected 13, is %d", + check_msg->data[27]); + ck_assert_msg(check_msg->data[28] == 38, + "incorrect value for data[28], expected 38, is %d", + check_msg->data[28]); + ck_assert_msg(check_msg->data[29] == 240, + "incorrect value for data[29], expected 240, is %d", + check_msg->data[29]); + ck_assert_msg(check_msg->data[30] == 236, + "incorrect value for data[30], expected 236, is %d", + check_msg->data[30]); + ck_assert_msg(check_msg->data[31] == 60, + "incorrect value for data[31], expected 60, is %d", + check_msg->data[31]); + ck_assert_msg(check_msg->data[32] == 121, + "incorrect value for data[32], expected 121, is %d", + check_msg->data[32]); + ck_assert_msg(check_msg->data[33] == 47, + "incorrect value for data[33], expected 47, is %d", + check_msg->data[33]); + ck_assert_msg(check_msg->data[34] == 252, + "incorrect value for data[34], expected 252, is %d", + check_msg->data[34]); + ck_assert_msg(check_msg->data[35] == 163, + "incorrect value for data[35], expected 163, is %d", + check_msg->data[35]); + ck_assert_msg(check_msg->data[36] == 141, + "incorrect value for data[36], expected 141, is %d", + check_msg->data[36]); + ck_assert_msg(check_msg->data[37] == 222, + "incorrect value for data[37], expected 222, is %d", + check_msg->data[37]); + ck_assert_msg(check_msg->data[38] == 29, + "incorrect value for data[38], expected 29, is %d", + check_msg->data[38]); + ck_assert_msg(check_msg->data[39] == 168, + "incorrect value for data[39], expected 168, is %d", + check_msg->data[39]); + ck_assert_msg(check_msg->data[40] == 214, + "incorrect value for data[40], expected 214, is %d", + check_msg->data[40]); + ck_assert_msg(check_msg->data[41] == 118, + "incorrect value for data[41], expected 118, is %d", + check_msg->data[41]); + ck_assert_msg(check_msg->data[42] == 55, + "incorrect value for data[42], expected 55, is %d", + check_msg->data[42]); + ck_assert_msg(check_msg->data[43] == 201, + "incorrect value for data[43], expected 201, is %d", + check_msg->data[43]); + ck_assert_msg(check_msg->data[44] == 233, + "incorrect value for data[44], expected 233, is %d", + check_msg->data[44]); + ck_assert_msg(check_msg->data[45] == 21, + "incorrect value for data[45], expected 21, is %d", + check_msg->data[45]); + ck_assert_msg(check_msg->data[46] == 214, + "incorrect value for data[46], expected 214, is %d", + check_msg->data[46]); + ck_assert_msg(check_msg->data[47] == 57, + "incorrect value for data[47], expected 57, is %d", + check_msg->data[47]); + ck_assert_msg(check_msg->data[48] == 245, + "incorrect value for data[48], expected 245, is %d", + check_msg->data[48]); + ck_assert_msg(check_msg->data[49] == 246, + "incorrect value for data[49], expected 246, is %d", + check_msg->data[49]); + ck_assert_msg(check_msg->data[50] == 19, + "incorrect value for data[50], expected 19, is %d", + check_msg->data[50]); + ck_assert_msg(check_msg->data[51] == 3, + "incorrect value for data[51], expected 3, is %d", + check_msg->data[51]); + ck_assert_msg(check_msg->data[52] == 121, + "incorrect value for data[52], expected 121, is %d", + check_msg->data[52]); + ck_assert_msg(check_msg->data[53] == 49, + "incorrect value for data[53], expected 49, is %d", + check_msg->data[53]); + ck_assert_msg(check_msg->data[54] == 231, + "incorrect value for data[54], expected 231, is %d", + check_msg->data[54]); + ck_assert_msg(check_msg->data[55] == 37, + "incorrect value for data[55], expected 37, is %d", + check_msg->data[55]); + ck_assert_msg(check_msg->data[56] == 186, + "incorrect value for data[56], expected 186, is %d", + check_msg->data[56]); + ck_assert_msg(check_msg->data[57] == 58, + "incorrect value for data[57], expected 58, is %d", + check_msg->data[57]); + ck_assert_msg(check_msg->data[58] == 238, + "incorrect value for data[58], expected 238, is %d", + check_msg->data[58]); + ck_assert_msg(check_msg->data[59] == 98, + "incorrect value for data[59], expected 98, is %d", + check_msg->data[59]); + ck_assert_msg(check_msg->data[60] == 39, + "incorrect value for data[60], expected 39, is %d", + check_msg->data[60]); + ck_assert_msg(check_msg->data[61] == 70, + "incorrect value for data[61], expected 70, is %d", + check_msg->data[61]); + ck_assert_msg(check_msg->data[62] == 232, + "incorrect value for data[62], expected 232, is %d", + check_msg->data[62]); + ck_assert_msg(check_msg->data[63] == 133, + "incorrect value for data[63], expected 133, is %d", + check_msg->data[63]); + ck_assert_msg(check_msg->data[64] == 25, + "incorrect value for data[64], expected 25, is %d", + check_msg->data[64]); + ck_assert_msg(check_msg->data[65] == 10, + "incorrect value for data[65], expected 10, is %d", + check_msg->data[65]); + ck_assert_msg(check_msg->data[66] == 134, + "incorrect value for data[66], expected 134, is %d", + check_msg->data[66]); + ck_assert_msg(check_msg->data[67] == 129, + "incorrect value for data[67], expected 129, is %d", + check_msg->data[67]); + ck_assert_msg(check_msg->data[68] == 69, + "incorrect value for data[68], expected 69, is %d", + check_msg->data[68]); + ck_assert_msg(check_msg->data[69] == 228, + "incorrect value for data[69], expected 228, is %d", + check_msg->data[69]); + ck_assert_msg(check_msg->data[70] == 134, + "incorrect value for data[70], expected 134, is %d", + check_msg->data[70]); + ck_assert_msg(check_msg->data[71] == 9, + "incorrect value for data[71], expected 9, is %d", + check_msg->data[71]); + ck_assert_msg(check_msg->data[72] == 88, + "incorrect value for data[72], expected 88, is %d", + check_msg->data[72]); + ck_assert_msg(check_msg->data[73] == 183, + "incorrect value for data[73], expected 183, is %d", + check_msg->data[73]); + ck_assert_msg(check_msg->data[74] == 133, + "incorrect value for data[74], expected 133, is %d", + check_msg->data[74]); + ck_assert_msg(check_msg->data[75] == 171, + "incorrect value for data[75], expected 171, is %d", + check_msg->data[75]); + ck_assert_msg(check_msg->data[76] == 255, + "incorrect value for data[76], expected 255, is %d", + check_msg->data[76]); + ck_assert_msg(check_msg->data[77] == 166, + "incorrect value for data[77], expected 166, is %d", + check_msg->data[77]); + ck_assert_msg(check_msg->data[78] == 100, + "incorrect value for data[78], expected 100, is %d", + check_msg->data[78]); + ck_assert_msg(check_msg->data[79] == 152, + "incorrect value for data[79], expected 152, is %d", + check_msg->data[79]); + ck_assert_msg(check_msg->data[80] == 231, + "incorrect value for data[80], expected 231, is %d", + check_msg->data[80]); + ck_assert_msg(check_msg->data[81] == 92, + "incorrect value for data[81], expected 92, is %d", + check_msg->data[81]); + ck_assert_msg(check_msg->data[82] == 9, + "incorrect value for data[82], expected 9, is %d", + check_msg->data[82]); + ck_assert_msg(check_msg->data[83] == 196, + "incorrect value for data[83], expected 196, is %d", + check_msg->data[83]); + ck_assert_msg(check_msg->data[84] == 106, + "incorrect value for data[84], expected 106, is %d", + check_msg->data[84]); + ck_assert_msg(check_msg->data[85] == 246, + "incorrect value for data[85], expected 246, is %d", + check_msg->data[85]); + ck_assert_msg(check_msg->data[86] == 29, + "incorrect value for data[86], expected 29, is %d", + check_msg->data[86]); + ck_assert_msg(check_msg->data[87] == 145, + "incorrect value for data[87], expected 145, is %d", + check_msg->data[87]); + ck_assert_msg(check_msg->data[88] == 156, + "incorrect value for data[88], expected 156, is %d", + check_msg->data[88]); + ck_assert_msg(check_msg->data[89] == 151, + "incorrect value for data[89], expected 151, is %d", + check_msg->data[89]); + ck_assert_msg(check_msg->data[90] == 32, + "incorrect value for data[90], expected 32, is %d", + check_msg->data[90]); + ck_assert_msg(check_msg->data[91] == 67, + "incorrect value for data[91], expected 67, is %d", + check_msg->data[91]); + ck_assert_msg(check_msg->data[92] == 188, + "incorrect value for data[92], expected 188, is %d", + check_msg->data[92]); + ck_assert_msg(check_msg->data[93] == 63, + "incorrect value for data[93], expected 63, is %d", + check_msg->data[93]); + ck_assert_msg(check_msg->data[94] == 233, + "incorrect value for data[94], expected 233, is %d", + check_msg->data[94]); + ck_assert_msg(check_msg->data[95] == 142, + "incorrect value for data[95], expected 142, is %d", + check_msg->data[95]); + ck_assert_msg(check_msg->data[96] == 174, + "incorrect value for data[96], expected 174, is %d", + check_msg->data[96]); + ck_assert_msg(check_msg->data[97] == 139, + "incorrect value for data[97], expected 139, is %d", + check_msg->data[97]); + ck_assert_msg(check_msg->data[98] == 154, + "incorrect value for data[98], expected 154, is %d", + check_msg->data[98]); + ck_assert_msg(check_msg->data[99] == 127, + "incorrect value for data[99], expected 127, is %d", + check_msg->data[99]); + ck_assert_msg(check_msg->data[100] == 35, + "incorrect value for data[100], expected 35, is %d", + check_msg->data[100]); + ck_assert_msg(check_msg->data[101] == 60, + "incorrect value for data[101], expected 60, is %d", + check_msg->data[101]); + ck_assert_msg(check_msg->data[102] == 56, + "incorrect value for data[102], expected 56, is %d", + check_msg->data[102]); + ck_assert_msg(check_msg->data[103] == 187, + "incorrect value for data[103], expected 187, is %d", + check_msg->data[103]); + ck_assert_msg(check_msg->data[104] == 121, + "incorrect value for data[104], expected 121, is %d", + check_msg->data[104]); + ck_assert_msg(check_msg->data[105] == 103, + "incorrect value for data[105], expected 103, is %d", + check_msg->data[105]); + ck_assert_msg(check_msg->data[106] == 135, + "incorrect value for data[106], expected 135, is %d", + check_msg->data[106]); + ck_assert_msg(check_msg->data[107] == 152, + "incorrect value for data[107], expected 152, is %d", + check_msg->data[107]); + ck_assert_msg(check_msg->data[108] == 182, + "incorrect value for data[108], expected 182, is %d", + check_msg->data[108]); + ck_assert_msg(check_msg->data[109] == 88, + "incorrect value for data[109], expected 88, is %d", + check_msg->data[109]); + ck_assert_msg(check_msg->data[110] == 160, + "incorrect value for data[110], expected 160, is %d", + check_msg->data[110]); + ck_assert_msg(check_msg->data[111] == 255, + "incorrect value for data[111], expected 255, is %d", + check_msg->data[111]); + ck_assert_msg(check_msg->data[112] == 227, + "incorrect value for data[112], expected 227, is %d", + check_msg->data[112]); + ck_assert_msg(check_msg->data[113] == 240, + "incorrect value for data[113], expected 240, is %d", + check_msg->data[113]); + ck_assert_msg(check_msg->data[114] == 54, + "incorrect value for data[114], expected 54, is %d", + check_msg->data[114]); + ck_assert_msg(check_msg->data[115] == 100, + "incorrect value for data[115], expected 100, is %d", + check_msg->data[115]); + ck_assert_msg(check_msg->data[116] == 91, + "incorrect value for data[116], expected 91, is %d", + check_msg->data[116]); + ck_assert_msg(check_msg->data[117] == 31, + "incorrect value for data[117], expected 31, is %d", + check_msg->data[117]); + ck_assert_msg(check_msg->data[118] == 141, + "incorrect value for data[118], expected 141, is %d", + check_msg->data[118]); + ck_assert_msg(check_msg->data[119] == 102, + "incorrect value for data[119], expected 102, is %d", + check_msg->data[119]); + ck_assert_msg(check_msg->data[120] == 130, + "incorrect value for data[120], expected 130, is %d", + check_msg->data[120]); + ck_assert_msg(check_msg->data[121] == 254, + "incorrect value for data[121], expected 254, is %d", + check_msg->data[121]); + ck_assert_msg(check_msg->data[122] == 54, + "incorrect value for data[122], expected 54, is %d", + check_msg->data[122]); + ck_assert_msg(check_msg->data[123] == 227, + "incorrect value for data[123], expected 227, is %d", + check_msg->data[123]); + ck_assert_msg(check_msg->data[124] == 229, + "incorrect value for data[124], expected 229, is %d", + check_msg->data[124]); + ck_assert_msg(check_msg->data[125] == 62, + "incorrect value for data[125], expected 62, is %d", + check_msg->data[125]); + ck_assert_msg(check_msg->data[126] == 53, + "incorrect value for data[126], expected 53, is %d", + check_msg->data[126]); + ck_assert_msg(check_msg->data[127] == 225, + "incorrect value for data[127], expected 225, is %d", + check_msg->data[127]); + ck_assert_msg(check_msg->data[128] == 143, + "incorrect value for data[128], expected 143, is %d", + check_msg->data[128]); + ck_assert_msg(check_msg->data[129] == 88, + "incorrect value for data[129], expected 88, is %d", + check_msg->data[129]); + ck_assert_msg(check_msg->data[130] == 139, + "incorrect value for data[130], expected 139, is %d", + check_msg->data[130]); + ck_assert_msg(check_msg->data[131] == 126, + "incorrect value for data[131], expected 126, is %d", + check_msg->data[131]); + ck_assert_msg(check_msg->data[132] == 235, + "incorrect value for data[132], expected 235, is %d", + check_msg->data[132]); + ck_assert_msg(check_msg->data[133] == 235, + "incorrect value for data[133], expected 235, is %d", + check_msg->data[133]); + ck_assert_msg(check_msg->data[134] == 35, + "incorrect value for data[134], expected 35, is %d", + check_msg->data[134]); + ck_assert_msg(check_msg->data[135] == 54, + "incorrect value for data[135], expected 54, is %d", + check_msg->data[135]); + ck_assert_msg(check_msg->data[136] == 134, + "incorrect value for data[136], expected 134, is %d", + check_msg->data[136]); + ck_assert_msg(check_msg->data[137] == 163, + "incorrect value for data[137], expected 163, is %d", + check_msg->data[137]); + ck_assert_msg(check_msg->data[138] == 92, + "incorrect value for data[138], expected 92, is %d", + check_msg->data[138]); + ck_assert_msg(check_msg->data[139] == 57, + "incorrect value for data[139], expected 57, is %d", + check_msg->data[139]); + ck_assert_msg(check_msg->data[140] == 87, + "incorrect value for data[140], expected 87, is %d", + check_msg->data[140]); + ck_assert_msg(check_msg->data[141] == 130, + "incorrect value for data[141], expected 130, is %d", + check_msg->data[141]); + ck_assert_msg(check_msg->data[142] == 178, + "incorrect value for data[142], expected 178, is %d", + check_msg->data[142]); + ck_assert_msg(check_msg->data[143] == 22, + "incorrect value for data[143], expected 22, is %d", + check_msg->data[143]); + ck_assert_msg(check_msg->data[144] == 158, + "incorrect value for data[144], expected 158, is %d", + check_msg->data[144]); + ck_assert_msg(check_msg->data[145] == 18, + "incorrect value for data[145], expected 18, is %d", + check_msg->data[145]); + ck_assert_msg(check_msg->data[146] == 237, + "incorrect value for data[146], expected 237, is %d", + check_msg->data[146]); + ck_assert_msg(check_msg->data[147] == 209, + "incorrect value for data[147], expected 209, is %d", + check_msg->data[147]); + ck_assert_msg(check_msg->data[148] == 187, + "incorrect value for data[148], expected 187, is %d", + check_msg->data[148]); + ck_assert_msg(check_msg->data[149] == 226, + "incorrect value for data[149], expected 226, is %d", + check_msg->data[149]); + ck_assert_msg(check_msg->data[150] == 1, + "incorrect value for data[150], expected 1, is %d", + check_msg->data[150]); + ck_assert_msg(check_msg->data[151] == 46, + "incorrect value for data[151], expected 46, is %d", + check_msg->data[151]); + ck_assert_msg(check_msg->data[152] == 64, + "incorrect value for data[152], expected 64, is %d", + check_msg->data[152]); + ck_assert_msg(check_msg->data[153] == 226, + "incorrect value for data[153], expected 226, is %d", + check_msg->data[153]); + ck_assert_msg(check_msg->data[154] == 235, + "incorrect value for data[154], expected 235, is %d", + check_msg->data[154]); + ck_assert_msg(check_msg->data[155] == 213, + "incorrect value for data[155], expected 213, is %d", + check_msg->data[155]); + ck_assert_msg(check_msg->data[156] == 186, + "incorrect value for data[156], expected 186, is %d", + check_msg->data[156]); + ck_assert_msg(check_msg->data[157] == 159, + "incorrect value for data[157], expected 159, is %d", + check_msg->data[157]); + ck_assert_msg(check_msg->data[158] == 221, + "incorrect value for data[158], expected 221, is %d", + check_msg->data[158]); + ck_assert_msg(check_msg->data[159] == 186, + "incorrect value for data[159], expected 186, is %d", + check_msg->data[159]); + ck_assert_msg(check_msg->data[160] == 25, + "incorrect value for data[160], expected 25, is %d", + check_msg->data[160]); + ck_assert_msg(check_msg->data[161] == 115, + "incorrect value for data[161], expected 115, is %d", + check_msg->data[161]); + ck_assert_msg(check_msg->data[162] == 84, + "incorrect value for data[162], expected 84, is %d", + check_msg->data[162]); + ck_assert_msg(check_msg->data[163] == 131, + "incorrect value for data[163], expected 131, is %d", + check_msg->data[163]); + ck_assert_msg(check_msg->data[164] == 167, + "incorrect value for data[164], expected 167, is %d", + check_msg->data[164]); + ck_assert_msg(check_msg->data[165] == 201, + "incorrect value for data[165], expected 201, is %d", + check_msg->data[165]); + ck_assert_msg(check_msg->data[166] == 104, + "incorrect value for data[166], expected 104, is %d", + check_msg->data[166]); + ck_assert_msg(check_msg->data[167] == 1, + "incorrect value for data[167], expected 1, is %d", + check_msg->data[167]); + ck_assert_msg(check_msg->data[168] == 200, + "incorrect value for data[168], expected 200, is %d", + check_msg->data[168]); + ck_assert_msg(check_msg->data[169] == 13, + "incorrect value for data[169], expected 13, is %d", + check_msg->data[169]); + ck_assert_msg(check_msg->data[170] == 50, + "incorrect value for data[170], expected 50, is %d", + check_msg->data[170]); + ck_assert_msg(check_msg->data[171] == 71, + "incorrect value for data[171], expected 71, is %d", + check_msg->data[171]); + ck_assert_msg(check_msg->data[172] == 73, + "incorrect value for data[172], expected 73, is %d", + check_msg->data[172]); + ck_assert_msg(check_msg->data[173] == 193, + "incorrect value for data[173], expected 193, is %d", + check_msg->data[173]); + ck_assert_msg(check_msg->data[174] == 201, + "incorrect value for data[174], expected 201, is %d", + check_msg->data[174]); + ck_assert_msg(check_msg->data[175] == 250, + "incorrect value for data[175], expected 250, is %d", + check_msg->data[175]); + ck_assert_msg(check_msg->data[176] == 172, + "incorrect value for data[176], expected 172, is %d", + check_msg->data[176]); + ck_assert_msg(check_msg->data[177] == 193, + "incorrect value for data[177], expected 193, is %d", + check_msg->data[177]); + ck_assert_msg(check_msg->data[178] == 13, + "incorrect value for data[178], expected 13, is %d", + check_msg->data[178]); + ck_assert_msg(check_msg->data[179] == 20, + "incorrect value for data[179], expected 20, is %d", + check_msg->data[179]); + ck_assert_msg(check_msg->data[180] == 238, + "incorrect value for data[180], expected 238, is %d", + check_msg->data[180]); + ck_assert_msg(check_msg->data[181] == 130, + "incorrect value for data[181], expected 130, is %d", + check_msg->data[181]); + ck_assert_msg(check_msg->data[182] == 243, + "incorrect value for data[182], expected 243, is %d", + check_msg->data[182]); + ck_assert_msg(check_msg->data[183] == 68, + "incorrect value for data[183], expected 68, is %d", + check_msg->data[183]); + ck_assert_msg(check_msg->data[184] == 4, + "incorrect value for data[184], expected 4, is %d", + check_msg->data[184]); + ck_assert_msg(check_msg->data[185] == 72, + "incorrect value for data[185], expected 72, is %d", + check_msg->data[185]); + ck_assert_msg(check_msg->data[186] == 46, + "incorrect value for data[186], expected 46, is %d", + check_msg->data[186]); + ck_assert_msg(check_msg->data[187] == 194, + "incorrect value for data[187], expected 194, is %d", + check_msg->data[187]); + ck_assert_msg(check_msg->data[188] == 113, + "incorrect value for data[188], expected 113, is %d", + check_msg->data[188]); + ck_assert_msg(check_msg->data[189] == 255, + "incorrect value for data[189], expected 255, is %d", + check_msg->data[189]); + ck_assert_msg(check_msg->data[190] == 238, + "incorrect value for data[190], expected 238, is %d", + check_msg->data[190]); + ck_assert_msg(check_msg->data[191] == 15, + "incorrect value for data[191], expected 15, is %d", + check_msg->data[191]); + ck_assert_msg(check_msg->data[192] == 230, + "incorrect value for data[192], expected 230, is %d", + check_msg->data[192]); + ck_assert_msg(check_msg->data[193] == 64, + "incorrect value for data[193], expected 64, is %d", + check_msg->data[193]); + ck_assert_msg(check_msg->data[194] == 178, + "incorrect value for data[194], expected 178, is %d", + check_msg->data[194]); + ck_assert_msg(check_msg->data[195] == 127, + "incorrect value for data[195], expected 127, is %d", + check_msg->data[195]); + ck_assert_msg(check_msg->data[196] == 217, + "incorrect value for data[196], expected 217, is %d", + check_msg->data[196]); + ck_assert_msg(check_msg->data[197] == 92, + "incorrect value for data[197], expected 92, is %d", + check_msg->data[197]); + ck_assert_msg(check_msg->data[198] == 160, + "incorrect value for data[198], expected 160, is %d", + check_msg->data[198]); + ck_assert_msg(check_msg->data[199] == 201, + "incorrect value for data[199], expected 201, is %d", + check_msg->data[199]); + ck_assert_msg(check_msg->data[200] == 118, + "incorrect value for data[200], expected 118, is %d", + check_msg->data[200]); + ck_assert_msg(check_msg->data[201] == 163, + "incorrect value for data[201], expected 163, is %d", + check_msg->data[201]); + ck_assert_msg(check_msg->data[202] == 144, + "incorrect value for data[202], expected 144, is %d", + check_msg->data[202]); + ck_assert_msg(check_msg->data[203] == 58, + "incorrect value for data[203], expected 58, is %d", + check_msg->data[203]); + ck_assert_msg(check_msg->data[204] == 28, + "incorrect value for data[204], expected 28, is %d", + check_msg->data[204]); + ck_assert_msg(check_msg->data[205] == 174, + "incorrect value for data[205], expected 174, is %d", + check_msg->data[205]); + ck_assert_msg(check_msg->data[206] == 65, + "incorrect value for data[206], expected 65, is %d", + check_msg->data[206]); + ck_assert_msg(check_msg->data[207] == 73, + "incorrect value for data[207], expected 73, is %d", + check_msg->data[207]); + ck_assert_msg(check_msg->data[208] == 45, + "incorrect value for data[208], expected 45, is %d", + check_msg->data[208]); + ck_assert_msg(check_msg->data[209] == 123, + "incorrect value for data[209], expected 123, is %d", + check_msg->data[209]); + ck_assert_msg(check_msg->data[210] == 118, + "incorrect value for data[210], expected 118, is %d", + check_msg->data[210]); + ck_assert_msg(check_msg->data[211] == 83, + "incorrect value for data[211], expected 83, is %d", + check_msg->data[211]); + ck_assert_msg(check_msg->data[212] == 107, + "incorrect value for data[212], expected 107, is %d", + check_msg->data[212]); + ck_assert_msg(check_msg->data[213] == 239, + "incorrect value for data[213], expected 239, is %d", + check_msg->data[213]); + ck_assert_msg(check_msg->data[214] == 168, + "incorrect value for data[214], expected 168, is %d", + check_msg->data[214]); + ck_assert_msg(check_msg->data[215] == 32, + "incorrect value for data[215], expected 32, is %d", + check_msg->data[215]); + ck_assert_msg(check_msg->data[216] == 212, + "incorrect value for data[216], expected 212, is %d", + check_msg->data[216]); + ck_assert_msg(check_msg->data[217] == 191, + "incorrect value for data[217], expected 191, is %d", + check_msg->data[217]); + ck_assert_msg(check_msg->data[218] == 81, + "incorrect value for data[218], expected 81, is %d", + check_msg->data[218]); + ck_assert_msg(check_msg->data[219] == 93, + "incorrect value for data[219], expected 93, is %d", + check_msg->data[219]); + ck_assert_msg(check_msg->data[220] == 186, + "incorrect value for data[220], expected 186, is %d", + check_msg->data[220]); + ck_assert_msg(check_msg->data[221] == 223, + "incorrect value for data[221], expected 223, is %d", + check_msg->data[221]); + ck_assert_msg(check_msg->data[222] == 32, + "incorrect value for data[222], expected 32, is %d", + check_msg->data[222]); + ck_assert_msg(check_msg->data[223] == 19, + "incorrect value for data[223], expected 19, is %d", + check_msg->data[223]); + ck_assert_msg(check_msg->data[224] == 58, + "incorrect value for data[224], expected 58, is %d", + check_msg->data[224]); + ck_assert_msg(check_msg->data[225] == 137, + "incorrect value for data[225], expected 137, is %d", + check_msg->data[225]); + ck_assert_msg(check_msg->data[226] == 72, + "incorrect value for data[226], expected 72, is %d", + check_msg->data[226]); + ck_assert_msg(check_msg->data[227] == 217, + "incorrect value for data[227], expected 217, is %d", + check_msg->data[227]); + ck_assert_msg(check_msg->data[228] == 151, + "incorrect value for data[228], expected 151, is %d", + check_msg->data[228]); + ck_assert_msg(check_msg->data[229] == 251, + "incorrect value for data[229], expected 251, is %d", + check_msg->data[229]); + ck_assert_msg(check_msg->data[230] == 83, + "incorrect value for data[230], expected 83, is %d", + check_msg->data[230]); + ck_assert_msg(check_msg->data[231] == 20, + "incorrect value for data[231], expected 20, is %d", + check_msg->data[231]); + ck_assert_msg(check_msg->data[232] == 113, + "incorrect value for data[232], expected 113, is %d", + check_msg->data[232]); + ck_assert_msg(check_msg->data[233] == 37, + "incorrect value for data[233], expected 37, is %d", + check_msg->data[233]); + ck_assert_msg(check_msg->data[234] == 151, + "incorrect value for data[234], expected 151, is %d", + check_msg->data[234]); + ck_assert_msg(check_msg->data[235] == 34, + "incorrect value for data[235], expected 34, is %d", + check_msg->data[235]); + ck_assert_msg(check_msg->data[236] == 37, + "incorrect value for data[236], expected 37, is %d", + check_msg->data[236]); + ck_assert_msg(check_msg->data[237] == 71, + "incorrect value for data[237], expected 71, is %d", + check_msg->data[237]); + ck_assert_msg(check_msg->data[238] == 95, + "incorrect value for data[238], expected 95, is %d", + check_msg->data[238]); + ck_assert_msg(check_msg->data[239] == 105, + "incorrect value for data[239], expected 105, is %d", + check_msg->data[239]); + ck_assert_msg(check_msg->data[240] == 235, + "incorrect value for data[240], expected 235, is %d", + check_msg->data[240]); + ck_assert_msg(check_msg->data[241] == 144, + "incorrect value for data[241], expected 144, is %d", + check_msg->data[241]); + ck_assert_msg(check_msg->data[242] == 164, + "incorrect value for data[242], expected 164, is %d", + check_msg->data[242]); + ck_assert_msg(check_msg->data[243] == 83, + "incorrect value for data[243], expected 83, is %d", + check_msg->data[243]); + ck_assert_msg(check_msg->data[244] == 197, + "incorrect value for data[244], expected 197, is %d", + check_msg->data[244]); + ck_assert_msg(check_msg->data[245] == 254, + "incorrect value for data[245], expected 254, is %d", + check_msg->data[245]); + ck_assert_msg(check_msg->data[246] == 183, + "incorrect value for data[246], expected 183, is %d", + check_msg->data[246]); + ck_assert_msg(check_msg->data[247] == 223, + "incorrect value for data[247], expected 223, is %d", + check_msg->data[247]); + ck_assert_msg(check_msg->data[248] == 91, + "incorrect value for data[248], expected 91, is %d", + check_msg->data[248]); + ck_assert_msg(check_msg->data[249] == 19, + "incorrect value for data[249], expected 19, is %d", + check_msg->data[249]); + ck_assert_msg(check_msg->target == 212, + "incorrect value for target, expected 212, is %d", + check_msg->target); } } END_TEST -Suite* legacy_auto_check_sbp_flash_MsgFlashProgram_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_flash_MsgFlashProgram"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_flash_MsgFlashProgram"); +Suite *legacy_auto_check_sbp_flash_MsgFlashProgram_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_flash_MsgFlashProgram"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_flash_MsgFlashProgram"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_flash_MsgFlashProgram); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_flash_MsgFlashReadReq.c b/c/test/legacy/auto_check_sbp_flash_MsgFlashReadReq.c index 38f716977..e3de300af 100644 --- a/c/test/legacy/auto_check_sbp_flash_MsgFlashReadReq.c +++ b/c/test/legacy/auto_check_sbp_flash_MsgFlashReadReq.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadReq.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashReadReq ) -{ +START_TEST(test_legacy_auto_check_sbp_flash_MsgFlashReadReq) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashReadReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,21 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashReadReq ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xe7, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xe7, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xe7, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xe7, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,231,0,195,4,5,241,28,75,244,71,210,57, }; + u8 encoded_frame[] = { + 85, 231, 0, 195, 4, 5, 241, 28, 75, 244, 71, 210, 57, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_flash_read_req_t* test_msg = ( msg_flash_read_req_t* )test_msg_storage; + msg_flash_read_req_t *test_msg = (msg_flash_read_req_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->addr_len = 71; if (sizeof(test_msg->addr_start) == 0) { @@ -160,67 +161,85 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashReadReq ) } test_msg->addr_start[2] = 244; test_msg->target = 241; - sbp_payload_send(&sbp_state, 0xe7, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xe7, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xe7, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_flash_read_req_t* check_msg = ( msg_flash_read_req_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_flash_read_req_t *check_msg = + (msg_flash_read_req_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->addr_len == 71, "incorrect value for addr_len, expected 71, is %d", check_msg->addr_len); - ck_assert_msg(check_msg->addr_start[0] == 28, "incorrect value for addr_start[0], expected 28, is %d", check_msg->addr_start[0]); - ck_assert_msg(check_msg->addr_start[1] == 75, "incorrect value for addr_start[1], expected 75, is %d", check_msg->addr_start[1]); - ck_assert_msg(check_msg->addr_start[2] == 244, "incorrect value for addr_start[2], expected 244, is %d", check_msg->addr_start[2]); - ck_assert_msg(check_msg->target == 241, "incorrect value for target, expected 241, is %d", check_msg->target); + ck_assert_msg(check_msg->addr_len == 71, + "incorrect value for addr_len, expected 71, is %d", + check_msg->addr_len); + ck_assert_msg(check_msg->addr_start[0] == 28, + "incorrect value for addr_start[0], expected 28, is %d", + check_msg->addr_start[0]); + ck_assert_msg(check_msg->addr_start[1] == 75, + "incorrect value for addr_start[1], expected 75, is %d", + check_msg->addr_start[1]); + ck_assert_msg(check_msg->addr_start[2] == 244, + "incorrect value for addr_start[2], expected 244, is %d", + check_msg->addr_start[2]); + ck_assert_msg(check_msg->target == 241, + "incorrect value for target, expected 241, is %d", + check_msg->target); } } END_TEST -Suite* legacy_auto_check_sbp_flash_MsgFlashReadReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_flash_MsgFlashReadReq"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_flash_MsgFlashReadReq"); +Suite *legacy_auto_check_sbp_flash_MsgFlashReadReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_flash_MsgFlashReadReq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_flash_MsgFlashReadReq"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_flash_MsgFlashReadReq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_flash_MsgFlashReadResp.c b/c/test/legacy/auto_check_sbp_flash_MsgFlashReadResp.c index 430aee721..aad9bbdf8 100644 --- a/c/test/legacy/auto_check_sbp_flash_MsgFlashReadResp.c +++ b/c/test/legacy/auto_check_sbp_flash_MsgFlashReadResp.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadResp.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashReadResp ) -{ +START_TEST(test_legacy_auto_check_sbp_flash_MsgFlashReadResp) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashReadResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,21 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashReadResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xe1, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xe1, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xe1, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xe1, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,225,0,195,4,5,136,155,52,172,124,149,135, }; + u8 encoded_frame[] = { + 85, 225, 0, 195, 4, 5, 136, 155, 52, 172, 124, 149, 135, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_flash_read_resp_t* test_msg = ( msg_flash_read_resp_t* )test_msg_storage; + msg_flash_read_resp_t *test_msg = (msg_flash_read_resp_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->addr_len = 124; if (sizeof(test_msg->addr_start) == 0) { @@ -160,67 +161,85 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgFlashReadResp ) } test_msg->addr_start[2] = 172; test_msg->target = 136; - sbp_payload_send(&sbp_state, 0xe1, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xe1, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xe1, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_flash_read_resp_t* check_msg = ( msg_flash_read_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_flash_read_resp_t *check_msg = + (msg_flash_read_resp_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->addr_len == 124, "incorrect value for addr_len, expected 124, is %d", check_msg->addr_len); - ck_assert_msg(check_msg->addr_start[0] == 155, "incorrect value for addr_start[0], expected 155, is %d", check_msg->addr_start[0]); - ck_assert_msg(check_msg->addr_start[1] == 52, "incorrect value for addr_start[1], expected 52, is %d", check_msg->addr_start[1]); - ck_assert_msg(check_msg->addr_start[2] == 172, "incorrect value for addr_start[2], expected 172, is %d", check_msg->addr_start[2]); - ck_assert_msg(check_msg->target == 136, "incorrect value for target, expected 136, is %d", check_msg->target); + ck_assert_msg(check_msg->addr_len == 124, + "incorrect value for addr_len, expected 124, is %d", + check_msg->addr_len); + ck_assert_msg(check_msg->addr_start[0] == 155, + "incorrect value for addr_start[0], expected 155, is %d", + check_msg->addr_start[0]); + ck_assert_msg(check_msg->addr_start[1] == 52, + "incorrect value for addr_start[1], expected 52, is %d", + check_msg->addr_start[1]); + ck_assert_msg(check_msg->addr_start[2] == 172, + "incorrect value for addr_start[2], expected 172, is %d", + check_msg->addr_start[2]); + ck_assert_msg(check_msg->target == 136, + "incorrect value for target, expected 136, is %d", + check_msg->target); } } END_TEST -Suite* legacy_auto_check_sbp_flash_MsgFlashReadResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_flash_MsgFlashReadResp"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_flash_MsgFlashReadResp"); +Suite *legacy_auto_check_sbp_flash_MsgFlashReadResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_flash_MsgFlashReadResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_flash_MsgFlashReadResp"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_flash_MsgFlashReadResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_flash_MsgM25FlashWriteStatus.c b/c/test/legacy/auto_check_sbp_flash_MsgM25FlashWriteStatus.c index 8b0aaab71..409382235 100644 --- a/c/test/legacy/auto_check_sbp_flash_MsgM25FlashWriteStatus.c +++ b/c/test/legacy/auto_check_sbp_flash_MsgM25FlashWriteStatus.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgM25FlashWriteStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgM25FlashWriteStatus.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus ) -{ +START_TEST(test_legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,81 +128,98 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xf3, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xf3, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xf3, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xf3, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,243,0,195,4,1,5,112,200, }; + u8 encoded_frame[] = { + 85, 243, 0, 195, 4, 1, 5, 112, 200, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_m25_flash_write_status_t* test_msg = ( msg_m25_flash_write_status_t* )test_msg_storage; + msg_m25_flash_write_status_t *test_msg = + (msg_m25_flash_write_status_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->status) == 0) { // Cope with variable length arrays test_msg_len += sizeof(test_msg->status[0]); } test_msg->status[0] = 5; - sbp_payload_send(&sbp_state, 0xf3, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xf3, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xf3, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_m25_flash_write_status_t* check_msg = ( msg_m25_flash_write_status_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_m25_flash_write_status_t *check_msg = + (msg_m25_flash_write_status_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->status[0] == 5, "incorrect value for status[0], expected 5, is %d", check_msg->status[0]); + ck_assert_msg(check_msg->status[0] == 5, + "incorrect value for status[0], expected 5, is %d", + check_msg->status[0]); } } END_TEST -Suite* legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus); +Suite *legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_flash_MsgStmFlashLockSector.c b/c/test/legacy/auto_check_sbp_flash_MsgStmFlashLockSector.c index c3249f872..ac0046d12 100644 --- a/c/test/legacy/auto_check_sbp_flash_MsgStmFlashLockSector.c +++ b/c/test/legacy/auto_check_sbp_flash_MsgStmFlashLockSector.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashLockSector.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashLockSector.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_flash_MsgStmFlashLockSector ) -{ +START_TEST(test_legacy_auto_check_sbp_flash_MsgStmFlashLockSector) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgStmFlashLockSector ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,77 +128,94 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgStmFlashLockSector ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xe3, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xe3, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xe3, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xe3, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,227,0,195,4,4,161,247,197,67,229,32, }; + u8 encoded_frame[] = { + 85, 227, 0, 195, 4, 4, 161, 247, 197, 67, 229, 32, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_stm_flash_lock_sector_t* test_msg = ( msg_stm_flash_lock_sector_t* )test_msg_storage; + msg_stm_flash_lock_sector_t *test_msg = + (msg_stm_flash_lock_sector_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->sector = 1137047457; - sbp_payload_send(&sbp_state, 0xe3, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xe3, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xe3, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_stm_flash_lock_sector_t* check_msg = ( msg_stm_flash_lock_sector_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_stm_flash_lock_sector_t *check_msg = + (msg_stm_flash_lock_sector_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->sector == 1137047457, "incorrect value for sector, expected 1137047457, is %d", check_msg->sector); + ck_assert_msg(check_msg->sector == 1137047457, + "incorrect value for sector, expected 1137047457, is %d", + check_msg->sector); } } END_TEST -Suite* legacy_auto_check_sbp_flash_MsgStmFlashLockSector_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_flash_MsgStmFlashLockSector"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_flash_MsgStmFlashLockSector"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_flash_MsgStmFlashLockSector); +Suite *legacy_auto_check_sbp_flash_MsgStmFlashLockSector_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_flash_MsgStmFlashLockSector"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_flash_MsgStmFlashLockSector"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_flash_MsgStmFlashLockSector); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_flash_MsgStmFlashUnlockSector.c b/c/test/legacy/auto_check_sbp_flash_MsgStmFlashUnlockSector.c index aed66061f..348d01512 100644 --- a/c/test/legacy/auto_check_sbp_flash_MsgStmFlashUnlockSector.c +++ b/c/test/legacy/auto_check_sbp_flash_MsgStmFlashUnlockSector.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashUnlockSector.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashUnlockSector.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector ) -{ +START_TEST(test_legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,77 +128,94 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xe4, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xe4, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xe4, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xe4, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,228,0,195,4,4,31,16,231,49,53,217, }; + u8 encoded_frame[] = { + 85, 228, 0, 195, 4, 4, 31, 16, 231, 49, 53, 217, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_stm_flash_unlock_sector_t* test_msg = ( msg_stm_flash_unlock_sector_t* )test_msg_storage; + msg_stm_flash_unlock_sector_t *test_msg = + (msg_stm_flash_unlock_sector_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->sector = 837226527; - sbp_payload_send(&sbp_state, 0xe4, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xe4, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xe4, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_stm_flash_unlock_sector_t* check_msg = ( msg_stm_flash_unlock_sector_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_stm_flash_unlock_sector_t *check_msg = + (msg_stm_flash_unlock_sector_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->sector == 837226527, "incorrect value for sector, expected 837226527, is %d", check_msg->sector); + ck_assert_msg(check_msg->sector == 837226527, + "incorrect value for sector, expected 837226527, is %d", + check_msg->sector); } } END_TEST -Suite* legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector); +Suite *legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_flash_MsgStmUniqueIdReq.c b/c/test/legacy/auto_check_sbp_flash_MsgStmUniqueIdReq.c index 68cbad6de..4684343b0 100644 --- a/c/test/legacy/auto_check_sbp_flash_MsgStmUniqueIdReq.c +++ b/c/test/legacy/auto_check_sbp_flash_MsgStmUniqueIdReq.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_flash_MsgStmUniqueIdReq ) -{ +START_TEST(test_legacy_auto_check_sbp_flash_MsgStmUniqueIdReq) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgStmUniqueIdReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,69 +128,81 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgStmUniqueIdReq ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xe8, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xe8, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xe8, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xe8, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,232,0,195,4,0,66,138, }; + u8 encoded_frame[] = { + 85, 232, 0, 195, 4, 0, 66, 138, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - sbp_payload_send(&sbp_state, 0xe8, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xe8, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xe8, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts + // Cast to expected message type - the +6 byte offset is where the payload + // starts } } END_TEST -Suite* legacy_auto_check_sbp_flash_MsgStmUniqueIdReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_flash_MsgStmUniqueIdReq"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_flash_MsgStmUniqueIdReq"); +Suite *legacy_auto_check_sbp_flash_MsgStmUniqueIdReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_flash_MsgStmUniqueIdReq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_flash_MsgStmUniqueIdReq"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_flash_MsgStmUniqueIdReq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_flash_MsgStmUniqueIdResp.c b/c/test/legacy/auto_check_sbp_flash_MsgStmUniqueIdResp.c index 456287273..4460395eb 100644 --- a/c/test/legacy/auto_check_sbp_flash_MsgStmUniqueIdResp.c +++ b/c/test/legacy/auto_check_sbp_flash_MsgStmUniqueIdResp.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_flash_MsgStmUniqueIdResp ) -{ +START_TEST(test_legacy_auto_check_sbp_flash_MsgStmUniqueIdResp) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgStmUniqueIdResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgStmUniqueIdResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xe5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xe5, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xe5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xe5, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,229,0,195,4,12,196,16,15,163,85,221,119,102,32,194,56,144,221,196, }; + u8 encoded_frame[] = { + 85, 229, 0, 195, 4, 12, 196, 16, 15, 163, + 85, 221, 119, 102, 32, 194, 56, 144, 221, 196, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_stm_unique_id_resp_t* test_msg = ( msg_stm_unique_id_resp_t* )test_msg_storage; + msg_stm_unique_id_resp_t *test_msg = + (msg_stm_unique_id_resp_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->stm_id) == 0) { // Cope with variable length arrays @@ -203,74 +206,107 @@ START_TEST( test_legacy_auto_check_sbp_flash_MsgStmUniqueIdResp ) test_msg_len += sizeof(test_msg->stm_id[0]); } test_msg->stm_id[11] = 144; - sbp_payload_send(&sbp_state, 0xe5, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xe5, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xe5, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_stm_unique_id_resp_t* check_msg = ( msg_stm_unique_id_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_stm_unique_id_resp_t *check_msg = + (msg_stm_unique_id_resp_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->stm_id[0] == 196, "incorrect value for stm_id[0], expected 196, is %d", check_msg->stm_id[0]); - ck_assert_msg(check_msg->stm_id[1] == 16, "incorrect value for stm_id[1], expected 16, is %d", check_msg->stm_id[1]); - ck_assert_msg(check_msg->stm_id[2] == 15, "incorrect value for stm_id[2], expected 15, is %d", check_msg->stm_id[2]); - ck_assert_msg(check_msg->stm_id[3] == 163, "incorrect value for stm_id[3], expected 163, is %d", check_msg->stm_id[3]); - ck_assert_msg(check_msg->stm_id[4] == 85, "incorrect value for stm_id[4], expected 85, is %d", check_msg->stm_id[4]); - ck_assert_msg(check_msg->stm_id[5] == 221, "incorrect value for stm_id[5], expected 221, is %d", check_msg->stm_id[5]); - ck_assert_msg(check_msg->stm_id[6] == 119, "incorrect value for stm_id[6], expected 119, is %d", check_msg->stm_id[6]); - ck_assert_msg(check_msg->stm_id[7] == 102, "incorrect value for stm_id[7], expected 102, is %d", check_msg->stm_id[7]); - ck_assert_msg(check_msg->stm_id[8] == 32, "incorrect value for stm_id[8], expected 32, is %d", check_msg->stm_id[8]); - ck_assert_msg(check_msg->stm_id[9] == 194, "incorrect value for stm_id[9], expected 194, is %d", check_msg->stm_id[9]); - ck_assert_msg(check_msg->stm_id[10] == 56, "incorrect value for stm_id[10], expected 56, is %d", check_msg->stm_id[10]); - ck_assert_msg(check_msg->stm_id[11] == 144, "incorrect value for stm_id[11], expected 144, is %d", check_msg->stm_id[11]); + ck_assert_msg(check_msg->stm_id[0] == 196, + "incorrect value for stm_id[0], expected 196, is %d", + check_msg->stm_id[0]); + ck_assert_msg(check_msg->stm_id[1] == 16, + "incorrect value for stm_id[1], expected 16, is %d", + check_msg->stm_id[1]); + ck_assert_msg(check_msg->stm_id[2] == 15, + "incorrect value for stm_id[2], expected 15, is %d", + check_msg->stm_id[2]); + ck_assert_msg(check_msg->stm_id[3] == 163, + "incorrect value for stm_id[3], expected 163, is %d", + check_msg->stm_id[3]); + ck_assert_msg(check_msg->stm_id[4] == 85, + "incorrect value for stm_id[4], expected 85, is %d", + check_msg->stm_id[4]); + ck_assert_msg(check_msg->stm_id[5] == 221, + "incorrect value for stm_id[5], expected 221, is %d", + check_msg->stm_id[5]); + ck_assert_msg(check_msg->stm_id[6] == 119, + "incorrect value for stm_id[6], expected 119, is %d", + check_msg->stm_id[6]); + ck_assert_msg(check_msg->stm_id[7] == 102, + "incorrect value for stm_id[7], expected 102, is %d", + check_msg->stm_id[7]); + ck_assert_msg(check_msg->stm_id[8] == 32, + "incorrect value for stm_id[8], expected 32, is %d", + check_msg->stm_id[8]); + ck_assert_msg(check_msg->stm_id[9] == 194, + "incorrect value for stm_id[9], expected 194, is %d", + check_msg->stm_id[9]); + ck_assert_msg(check_msg->stm_id[10] == 56, + "incorrect value for stm_id[10], expected 56, is %d", + check_msg->stm_id[10]); + ck_assert_msg(check_msg->stm_id[11] == 144, + "incorrect value for stm_id[11], expected 144, is %d", + check_msg->stm_id[11]); } } END_TEST -Suite* legacy_auto_check_sbp_flash_MsgStmUniqueIdResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_flash_MsgStmUniqueIdResp"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_flash_MsgStmUniqueIdResp"); +Suite *legacy_auto_check_sbp_flash_MsgStmUniqueIdResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_flash_MsgStmUniqueIdResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_flash_MsgStmUniqueIdResp"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_flash_MsgStmUniqueIdResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_imu_MsgImuAux.c b/c/test/legacy/auto_check_sbp_imu_MsgImuAux.c index dce9ee867..2d83bc508 100644 --- a/c/test/legacy/auto_check_sbp_imu_MsgImuAux.c +++ b/c/test/legacy/auto_check_sbp_imu_MsgImuAux.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuAux.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuAux.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_imu_MsgImuAux ) -{ +START_TEST(test_legacy_auto_check_sbp_imu_MsgImuAux) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_imu_MsgImuAux ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,80 +128,97 @@ START_TEST( test_legacy_auto_check_sbp_imu_MsgImuAux ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x901, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x901, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x901, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x901, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,9,52,18,4,1,244,10,66,200,252, }; + u8 encoded_frame[] = { + 85, 1, 9, 52, 18, 4, 1, 244, 10, 66, 200, 252, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_imu_aux_t* test_msg = ( msg_imu_aux_t* )test_msg_storage; + msg_imu_aux_t *test_msg = (msg_imu_aux_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->imu_conf = 66; test_msg->imu_type = 1; test_msg->temp = 2804; - sbp_payload_send(&sbp_state, 0x901, 4660, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x901, 4660, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4660, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 4660, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x901, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_imu_aux_t* check_msg = ( msg_imu_aux_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_imu_aux_t *check_msg = (msg_imu_aux_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->imu_conf == 66, "incorrect value for imu_conf, expected 66, is %d", check_msg->imu_conf); - ck_assert_msg(check_msg->imu_type == 1, "incorrect value for imu_type, expected 1, is %d", check_msg->imu_type); - ck_assert_msg(check_msg->temp == 2804, "incorrect value for temp, expected 2804, is %d", check_msg->temp); + ck_assert_msg(check_msg->imu_conf == 66, + "incorrect value for imu_conf, expected 66, is %d", + check_msg->imu_conf); + ck_assert_msg(check_msg->imu_type == 1, + "incorrect value for imu_type, expected 1, is %d", + check_msg->imu_type); + ck_assert_msg(check_msg->temp == 2804, + "incorrect value for temp, expected 2804, is %d", + check_msg->temp); } } END_TEST -Suite* legacy_auto_check_sbp_imu_MsgImuAux_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_imu_MsgImuAux"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_imu_MsgImuAux"); +Suite *legacy_auto_check_sbp_imu_MsgImuAux_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_imu_MsgImuAux"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_imu_MsgImuAux"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_imu_MsgImuAux); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_imu_MsgImuRaw.c b/c/test/legacy/auto_check_sbp_imu_MsgImuRaw.c index bf25996fe..97c3da7d9 100644 --- a/c/test/legacy/auto_check_sbp_imu_MsgImuRaw.c +++ b/c/test/legacy/auto_check_sbp_imu_MsgImuRaw.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuRaw.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuRaw.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_imu_MsgImuRaw ) -{ +START_TEST(test_legacy_auto_check_sbp_imu_MsgImuRaw) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_imu_MsgImuRaw ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_imu_MsgImuRaw ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x900, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x900, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x900, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x900, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,9,52,18,17,26,1,0,192,206,96,0,223,255,44,16,60,0,208,254,238,255,70,135, }; + u8 encoded_frame[] = { + 85, 0, 9, 52, 18, 17, 26, 1, 0, 192, 206, 96, 0, + 223, 255, 44, 16, 60, 0, 208, 254, 238, 255, 70, 135, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_imu_raw_t* test_msg = ( msg_imu_raw_t* )test_msg_storage; + msg_imu_raw_t *test_msg = (msg_imu_raw_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->acc_x = 96; test_msg->acc_y = -33; @@ -151,70 +153,93 @@ START_TEST( test_legacy_auto_check_sbp_imu_MsgImuRaw ) test_msg->gyr_z = -18; test_msg->tow = 3221225754; test_msg->tow_f = 206; - sbp_payload_send(&sbp_state, 0x900, 4660, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x900, 4660, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4660, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 4660, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x900, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_imu_raw_t* check_msg = ( msg_imu_raw_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_imu_raw_t *check_msg = (msg_imu_raw_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->acc_x == 96, "incorrect value for acc_x, expected 96, is %d", check_msg->acc_x); - ck_assert_msg(check_msg->acc_y == -33, "incorrect value for acc_y, expected -33, is %d", check_msg->acc_y); - ck_assert_msg(check_msg->acc_z == 4140, "incorrect value for acc_z, expected 4140, is %d", check_msg->acc_z); - ck_assert_msg(check_msg->gyr_x == 60, "incorrect value for gyr_x, expected 60, is %d", check_msg->gyr_x); - ck_assert_msg(check_msg->gyr_y == -304, "incorrect value for gyr_y, expected -304, is %d", check_msg->gyr_y); - ck_assert_msg(check_msg->gyr_z == -18, "incorrect value for gyr_z, expected -18, is %d", check_msg->gyr_z); - ck_assert_msg(check_msg->tow == 3221225754, "incorrect value for tow, expected 3221225754, is %d", check_msg->tow); - ck_assert_msg(check_msg->tow_f == 206, "incorrect value for tow_f, expected 206, is %d", check_msg->tow_f); + ck_assert_msg(check_msg->acc_x == 96, + "incorrect value for acc_x, expected 96, is %d", + check_msg->acc_x); + ck_assert_msg(check_msg->acc_y == -33, + "incorrect value for acc_y, expected -33, is %d", + check_msg->acc_y); + ck_assert_msg(check_msg->acc_z == 4140, + "incorrect value for acc_z, expected 4140, is %d", + check_msg->acc_z); + ck_assert_msg(check_msg->gyr_x == 60, + "incorrect value for gyr_x, expected 60, is %d", + check_msg->gyr_x); + ck_assert_msg(check_msg->gyr_y == -304, + "incorrect value for gyr_y, expected -304, is %d", + check_msg->gyr_y); + ck_assert_msg(check_msg->gyr_z == -18, + "incorrect value for gyr_z, expected -18, is %d", + check_msg->gyr_z); + ck_assert_msg(check_msg->tow == 3221225754, + "incorrect value for tow, expected 3221225754, is %d", + check_msg->tow); + ck_assert_msg(check_msg->tow_f == 206, + "incorrect value for tow_f, expected 206, is %d", + check_msg->tow_f); } } END_TEST -Suite* legacy_auto_check_sbp_imu_MsgImuRaw_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_imu_MsgImuRaw"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_imu_MsgImuRaw"); +Suite *legacy_auto_check_sbp_imu_MsgImuRaw_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_imu_MsgImuRaw"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_imu_MsgImuRaw"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_imu_MsgImuRaw); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_integrity_MsgAcknowledge.c b/c/test/legacy/auto_check_sbp_integrity_MsgAcknowledge.c index 370b4321a..c466d15cd 100644 --- a/c/test/legacy/auto_check_sbp_integrity_MsgAcknowledge.c +++ b/c/test/legacy/auto_check_sbp_integrity_MsgAcknowledge.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgAcknowledge.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgAcknowledge.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_integrity_MsgAcknowledge ) -{ +START_TEST(test_legacy_auto_check_sbp_integrity_MsgAcknowledge) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgAcknowledge ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,21 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgAcknowledge ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xBD2, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xBD2, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xBD2, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xBD2, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,210,11,42,0,11,30,64,226,1,0,0,1,0,1,0,2,86,178, }; + u8 encoded_frame[] = { + 85, 210, 11, 42, 0, 11, 30, 64, 226, 1, 0, 0, 1, 0, 1, 0, 2, 86, 178, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_acknowledge_t* test_msg = ( msg_acknowledge_t* )test_msg_storage; + msg_acknowledge_t *test_msg = (msg_acknowledge_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->area_id = 123456; test_msg->correction_mask_on_demand = 1; @@ -149,68 +150,90 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgAcknowledge ) test_msg->request_id = 30; test_msg->response_code = 0; test_msg->solution_id = 2; - sbp_payload_send(&sbp_state, 0xBD2, 42, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xBD2, 42, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 42, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 42, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xBD2, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_acknowledge_t* check_msg = ( msg_acknowledge_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_acknowledge_t *check_msg = (msg_acknowledge_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->area_id == 123456, "incorrect value for area_id, expected 123456, is %d", check_msg->area_id); - ck_assert_msg(check_msg->correction_mask_on_demand == 1, "incorrect value for correction_mask_on_demand, expected 1, is %d", check_msg->correction_mask_on_demand); - ck_assert_msg(check_msg->correction_mask_stream == 1, "incorrect value for correction_mask_stream, expected 1, is %d", check_msg->correction_mask_stream); - ck_assert_msg(check_msg->request_id == 30, "incorrect value for request_id, expected 30, is %d", check_msg->request_id); - ck_assert_msg(check_msg->response_code == 0, "incorrect value for response_code, expected 0, is %d", check_msg->response_code); - ck_assert_msg(check_msg->solution_id == 2, "incorrect value for solution_id, expected 2, is %d", check_msg->solution_id); + ck_assert_msg(check_msg->area_id == 123456, + "incorrect value for area_id, expected 123456, is %d", + check_msg->area_id); + ck_assert_msg( + check_msg->correction_mask_on_demand == 1, + "incorrect value for correction_mask_on_demand, expected 1, is %d", + check_msg->correction_mask_on_demand); + ck_assert_msg( + check_msg->correction_mask_stream == 1, + "incorrect value for correction_mask_stream, expected 1, is %d", + check_msg->correction_mask_stream); + ck_assert_msg(check_msg->request_id == 30, + "incorrect value for request_id, expected 30, is %d", + check_msg->request_id); + ck_assert_msg(check_msg->response_code == 0, + "incorrect value for response_code, expected 0, is %d", + check_msg->response_code); + ck_assert_msg(check_msg->solution_id == 2, + "incorrect value for solution_id, expected 2, is %d", + check_msg->solution_id); } } END_TEST -Suite* legacy_auto_check_sbp_integrity_MsgAcknowledge_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_integrity_MsgAcknowledge"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_integrity_MsgAcknowledge"); +Suite *legacy_auto_check_sbp_integrity_MsgAcknowledge_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_integrity_MsgAcknowledge"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_integrity_MsgAcknowledge"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_integrity_MsgAcknowledge); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagHighLevel.c b/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagHighLevel.c index 4816d8e5b..53a67e250 100644 --- a/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagHighLevel.c +++ b/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagHighLevel.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagHighLevel.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagHighLevel.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel ) -{ +START_TEST(test_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,24 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 3001, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 3001, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 3001, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 3001, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,185,11,66,0,31,180,0,0,0,3,0,104,1,0,0,6,0,10,20,0,30,0,40,1,2,3,0,0,0,0,0,0,4,5,6,7,102,67, }; + u8 encoded_frame[] = { + 85, 185, 11, 66, 0, 31, 180, 0, 0, 0, 3, 0, 104, + 1, 0, 0, 6, 0, 10, 20, 0, 30, 0, 40, 1, 2, + 3, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7, 102, 67, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_flag_high_level_t* test_msg = ( msg_ssr_flag_high_level_t* )test_msg_storage; + msg_ssr_flag_high_level_t *test_msg = + (msg_ssr_flag_high_level_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->chain_id = 40; test_msg->corr_time.tow = 360; @@ -188,84 +192,139 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel ) test_msg->use_iono_grid_points = 5; test_msg->use_iono_tile_sat_los = 6; test_msg->use_tropo_grid_points = 4; - sbp_payload_send(&sbp_state, 3001, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 3001, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 3001, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_flag_high_level_t* check_msg = ( msg_ssr_flag_high_level_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_flag_high_level_t *check_msg = + (msg_ssr_flag_high_level_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->chain_id == 40, "incorrect value for chain_id, expected 40, is %d", check_msg->chain_id); - ck_assert_msg(check_msg->corr_time.tow == 360, "incorrect value for corr_time.tow, expected 360, is %d", check_msg->corr_time.tow); - ck_assert_msg(check_msg->corr_time.wn == 6, "incorrect value for corr_time.wn, expected 6, is %d", check_msg->corr_time.wn); - ck_assert_msg(check_msg->obs_time.tow == 180, "incorrect value for obs_time.tow, expected 180, is %d", check_msg->obs_time.tow); - ck_assert_msg(check_msg->obs_time.wn == 3, "incorrect value for obs_time.wn, expected 3, is %d", check_msg->obs_time.wn); - ck_assert_msg(check_msg->reserved[0] == 0, "incorrect value for reserved[0], expected 0, is %d", check_msg->reserved[0]); - ck_assert_msg(check_msg->reserved[1] == 0, "incorrect value for reserved[1], expected 0, is %d", check_msg->reserved[1]); - ck_assert_msg(check_msg->reserved[2] == 0, "incorrect value for reserved[2], expected 0, is %d", check_msg->reserved[2]); - ck_assert_msg(check_msg->reserved[3] == 0, "incorrect value for reserved[3], expected 0, is %d", check_msg->reserved[3]); - ck_assert_msg(check_msg->reserved[4] == 0, "incorrect value for reserved[4], expected 0, is %d", check_msg->reserved[4]); - ck_assert_msg(check_msg->reserved[5] == 0, "incorrect value for reserved[5], expected 0, is %d", check_msg->reserved[5]); - ck_assert_msg(check_msg->ssr_sol_id == 10, "incorrect value for ssr_sol_id, expected 10, is %d", check_msg->ssr_sol_id); - ck_assert_msg(check_msg->tile_id == 30, "incorrect value for tile_id, expected 30, is %d", check_msg->tile_id); - ck_assert_msg(check_msg->tile_set_id == 20, "incorrect value for tile_set_id, expected 20, is %d", check_msg->tile_set_id); - ck_assert_msg(check_msg->use_bds_sat == 3, "incorrect value for use_bds_sat, expected 3, is %d", check_msg->use_bds_sat); - ck_assert_msg(check_msg->use_gal_sat == 2, "incorrect value for use_gal_sat, expected 2, is %d", check_msg->use_gal_sat); - ck_assert_msg(check_msg->use_gps_sat == 1, "incorrect value for use_gps_sat, expected 1, is %d", check_msg->use_gps_sat); - ck_assert_msg(check_msg->use_iono_grid_point_sat_los == 7, "incorrect value for use_iono_grid_point_sat_los, expected 7, is %d", check_msg->use_iono_grid_point_sat_los); - ck_assert_msg(check_msg->use_iono_grid_points == 5, "incorrect value for use_iono_grid_points, expected 5, is %d", check_msg->use_iono_grid_points); - ck_assert_msg(check_msg->use_iono_tile_sat_los == 6, "incorrect value for use_iono_tile_sat_los, expected 6, is %d", check_msg->use_iono_tile_sat_los); - ck_assert_msg(check_msg->use_tropo_grid_points == 4, "incorrect value for use_tropo_grid_points, expected 4, is %d", check_msg->use_tropo_grid_points); + ck_assert_msg(check_msg->chain_id == 40, + "incorrect value for chain_id, expected 40, is %d", + check_msg->chain_id); + ck_assert_msg(check_msg->corr_time.tow == 360, + "incorrect value for corr_time.tow, expected 360, is %d", + check_msg->corr_time.tow); + ck_assert_msg(check_msg->corr_time.wn == 6, + "incorrect value for corr_time.wn, expected 6, is %d", + check_msg->corr_time.wn); + ck_assert_msg(check_msg->obs_time.tow == 180, + "incorrect value for obs_time.tow, expected 180, is %d", + check_msg->obs_time.tow); + ck_assert_msg(check_msg->obs_time.wn == 3, + "incorrect value for obs_time.wn, expected 3, is %d", + check_msg->obs_time.wn); + ck_assert_msg(check_msg->reserved[0] == 0, + "incorrect value for reserved[0], expected 0, is %d", + check_msg->reserved[0]); + ck_assert_msg(check_msg->reserved[1] == 0, + "incorrect value for reserved[1], expected 0, is %d", + check_msg->reserved[1]); + ck_assert_msg(check_msg->reserved[2] == 0, + "incorrect value for reserved[2], expected 0, is %d", + check_msg->reserved[2]); + ck_assert_msg(check_msg->reserved[3] == 0, + "incorrect value for reserved[3], expected 0, is %d", + check_msg->reserved[3]); + ck_assert_msg(check_msg->reserved[4] == 0, + "incorrect value for reserved[4], expected 0, is %d", + check_msg->reserved[4]); + ck_assert_msg(check_msg->reserved[5] == 0, + "incorrect value for reserved[5], expected 0, is %d", + check_msg->reserved[5]); + ck_assert_msg(check_msg->ssr_sol_id == 10, + "incorrect value for ssr_sol_id, expected 10, is %d", + check_msg->ssr_sol_id); + ck_assert_msg(check_msg->tile_id == 30, + "incorrect value for tile_id, expected 30, is %d", + check_msg->tile_id); + ck_assert_msg(check_msg->tile_set_id == 20, + "incorrect value for tile_set_id, expected 20, is %d", + check_msg->tile_set_id); + ck_assert_msg(check_msg->use_bds_sat == 3, + "incorrect value for use_bds_sat, expected 3, is %d", + check_msg->use_bds_sat); + ck_assert_msg(check_msg->use_gal_sat == 2, + "incorrect value for use_gal_sat, expected 2, is %d", + check_msg->use_gal_sat); + ck_assert_msg(check_msg->use_gps_sat == 1, + "incorrect value for use_gps_sat, expected 1, is %d", + check_msg->use_gps_sat); + ck_assert_msg( + check_msg->use_iono_grid_point_sat_los == 7, + "incorrect value for use_iono_grid_point_sat_los, expected 7, is %d", + check_msg->use_iono_grid_point_sat_los); + ck_assert_msg(check_msg->use_iono_grid_points == 5, + "incorrect value for use_iono_grid_points, expected 5, is %d", + check_msg->use_iono_grid_points); + ck_assert_msg( + check_msg->use_iono_tile_sat_los == 6, + "incorrect value for use_iono_tile_sat_los, expected 6, is %d", + check_msg->use_iono_tile_sat_los); + ck_assert_msg( + check_msg->use_tropo_grid_points == 4, + "incorrect value for use_tropo_grid_points, expected 4, is %d", + check_msg->use_tropo_grid_points); } } END_TEST -Suite* legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel); +Suite *legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.c b/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.c index 3804ebca5..a12c5cdaf 100644 --- a/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.c +++ b/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPointSatLos.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPointSatLos.yaml +// by generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos ) -{ +START_TEST(test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 3025, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 3025, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 3025, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 3025, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,209,11,66,0,21,180,0,0,0,3,0,1,2,3,4,0,5,0,6,30,0,2,10,11,15,14,98,148, }; + u8 encoded_frame[] = { + 85, 209, 11, 66, 0, 21, 180, 0, 0, 0, 3, 0, 1, 2, 3, + 4, 0, 5, 0, 6, 30, 0, 2, 10, 11, 15, 14, 98, 148, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_flag_iono_grid_point_sat_los_t* test_msg = ( msg_ssr_flag_iono_grid_point_sat_los_t* )test_msg_storage; + msg_ssr_flag_iono_grid_point_sat_los_t *test_msg = + (msg_ssr_flag_iono_grid_point_sat_los_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->faulty_los) == 0) { // Cope with variable length arrays @@ -165,77 +168,121 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos ) test_msg->header.tile_id = 5; test_msg->header.tile_set_id = 4; test_msg->n_faulty_los = 2; - sbp_payload_send(&sbp_state, 3025, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 3025, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 3025, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_flag_iono_grid_point_sat_los_t* check_msg = ( msg_ssr_flag_iono_grid_point_sat_los_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_flag_iono_grid_point_sat_los_t *check_msg = + (msg_ssr_flag_iono_grid_point_sat_los_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->faulty_los[0].constellation == 11, "incorrect value for faulty_los[0].constellation, expected 11, is %d", check_msg->faulty_los[0].constellation); - ck_assert_msg(check_msg->faulty_los[0].satId == 10, "incorrect value for faulty_los[0].satId, expected 10, is %d", check_msg->faulty_los[0].satId); - ck_assert_msg(check_msg->faulty_los[1].constellation == 14, "incorrect value for faulty_los[1].constellation, expected 14, is %d", check_msg->faulty_los[1].constellation); - ck_assert_msg(check_msg->faulty_los[1].satId == 15, "incorrect value for faulty_los[1].satId, expected 15, is %d", check_msg->faulty_los[1].satId); - ck_assert_msg(check_msg->grid_point_id == 30, "incorrect value for grid_point_id, expected 30, is %d", check_msg->grid_point_id); - ck_assert_msg(check_msg->header.chain_id == 6, "incorrect value for header.chain_id, expected 6, is %d", check_msg->header.chain_id); - ck_assert_msg(check_msg->header.num_msgs == 1, "incorrect value for header.num_msgs, expected 1, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.obs_time.tow == 180, "incorrect value for header.obs_time.tow, expected 180, is %d", check_msg->header.obs_time.tow); - ck_assert_msg(check_msg->header.obs_time.wn == 3, "incorrect value for header.obs_time.wn, expected 3, is %d", check_msg->header.obs_time.wn); - ck_assert_msg(check_msg->header.seq_num == 2, "incorrect value for header.seq_num, expected 2, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->header.ssr_sol_id == 3, "incorrect value for header.ssr_sol_id, expected 3, is %d", check_msg->header.ssr_sol_id); - ck_assert_msg(check_msg->header.tile_id == 5, "incorrect value for header.tile_id, expected 5, is %d", check_msg->header.tile_id); - ck_assert_msg(check_msg->header.tile_set_id == 4, "incorrect value for header.tile_set_id, expected 4, is %d", check_msg->header.tile_set_id); - ck_assert_msg(check_msg->n_faulty_los == 2, "incorrect value for n_faulty_los, expected 2, is %d", check_msg->n_faulty_los); + ck_assert_msg( + check_msg->faulty_los[0].constellation == 11, + "incorrect value for faulty_los[0].constellation, expected 11, is %d", + check_msg->faulty_los[0].constellation); + ck_assert_msg(check_msg->faulty_los[0].satId == 10, + "incorrect value for faulty_los[0].satId, expected 10, is %d", + check_msg->faulty_los[0].satId); + ck_assert_msg( + check_msg->faulty_los[1].constellation == 14, + "incorrect value for faulty_los[1].constellation, expected 14, is %d", + check_msg->faulty_los[1].constellation); + ck_assert_msg(check_msg->faulty_los[1].satId == 15, + "incorrect value for faulty_los[1].satId, expected 15, is %d", + check_msg->faulty_los[1].satId); + ck_assert_msg(check_msg->grid_point_id == 30, + "incorrect value for grid_point_id, expected 30, is %d", + check_msg->grid_point_id); + ck_assert_msg(check_msg->header.chain_id == 6, + "incorrect value for header.chain_id, expected 6, is %d", + check_msg->header.chain_id); + ck_assert_msg(check_msg->header.num_msgs == 1, + "incorrect value for header.num_msgs, expected 1, is %d", + check_msg->header.num_msgs); + ck_assert_msg( + check_msg->header.obs_time.tow == 180, + "incorrect value for header.obs_time.tow, expected 180, is %d", + check_msg->header.obs_time.tow); + ck_assert_msg(check_msg->header.obs_time.wn == 3, + "incorrect value for header.obs_time.wn, expected 3, is %d", + check_msg->header.obs_time.wn); + ck_assert_msg(check_msg->header.seq_num == 2, + "incorrect value for header.seq_num, expected 2, is %d", + check_msg->header.seq_num); + ck_assert_msg(check_msg->header.ssr_sol_id == 3, + "incorrect value for header.ssr_sol_id, expected 3, is %d", + check_msg->header.ssr_sol_id); + ck_assert_msg(check_msg->header.tile_id == 5, + "incorrect value for header.tile_id, expected 5, is %d", + check_msg->header.tile_id); + ck_assert_msg(check_msg->header.tile_set_id == 4, + "incorrect value for header.tile_set_id, expected 4, is %d", + check_msg->header.tile_set_id); + ck_assert_msg(check_msg->n_faulty_los == 2, + "incorrect value for n_faulty_los, expected 2, is %d", + check_msg->n_faulty_los); } } END_TEST -Suite* legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos); +Suite *legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos_suite( + void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_integrity_" + "MsgSsrFlagIonoGridPointSatLos"); + tcase_add_test( + tc_acq, + test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.c b/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.c index a72f14c75..3373806a0 100644 --- a/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.c +++ b/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPoints.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPoints.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints ) -{ +START_TEST(test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 3015, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 3015, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 3015, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 3015, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,199,11,66,0,21,180,0,0,0,3,0,1,2,3,4,0,5,0,6,3,10,0,11,0,12,0,53,7, }; + u8 encoded_frame[] = { + 85, 199, 11, 66, 0, 21, 180, 0, 0, 0, 3, 0, 1, 2, 3, + 4, 0, 5, 0, 6, 3, 10, 0, 11, 0, 12, 0, 53, 7, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_flag_iono_grid_points_t* test_msg = ( msg_ssr_flag_iono_grid_points_t* )test_msg_storage; + msg_ssr_flag_iono_grid_points_t *test_msg = + (msg_ssr_flag_iono_grid_points_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->faulty_points) == 0) { // Cope with variable length arrays @@ -167,75 +170,111 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints ) test_msg->header.tile_id = 5; test_msg->header.tile_set_id = 4; test_msg->n_faulty_points = 3; - sbp_payload_send(&sbp_state, 3015, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 3015, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 3015, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_flag_iono_grid_points_t* check_msg = ( msg_ssr_flag_iono_grid_points_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_flag_iono_grid_points_t *check_msg = + (msg_ssr_flag_iono_grid_points_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->faulty_points[0] == 10, "incorrect value for faulty_points[0], expected 10, is %d", check_msg->faulty_points[0]); - ck_assert_msg(check_msg->faulty_points[1] == 11, "incorrect value for faulty_points[1], expected 11, is %d", check_msg->faulty_points[1]); - ck_assert_msg(check_msg->faulty_points[2] == 12, "incorrect value for faulty_points[2], expected 12, is %d", check_msg->faulty_points[2]); - ck_assert_msg(check_msg->header.chain_id == 6, "incorrect value for header.chain_id, expected 6, is %d", check_msg->header.chain_id); - ck_assert_msg(check_msg->header.num_msgs == 1, "incorrect value for header.num_msgs, expected 1, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.obs_time.tow == 180, "incorrect value for header.obs_time.tow, expected 180, is %d", check_msg->header.obs_time.tow); - ck_assert_msg(check_msg->header.obs_time.wn == 3, "incorrect value for header.obs_time.wn, expected 3, is %d", check_msg->header.obs_time.wn); - ck_assert_msg(check_msg->header.seq_num == 2, "incorrect value for header.seq_num, expected 2, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->header.ssr_sol_id == 3, "incorrect value for header.ssr_sol_id, expected 3, is %d", check_msg->header.ssr_sol_id); - ck_assert_msg(check_msg->header.tile_id == 5, "incorrect value for header.tile_id, expected 5, is %d", check_msg->header.tile_id); - ck_assert_msg(check_msg->header.tile_set_id == 4, "incorrect value for header.tile_set_id, expected 4, is %d", check_msg->header.tile_set_id); - ck_assert_msg(check_msg->n_faulty_points == 3, "incorrect value for n_faulty_points, expected 3, is %d", check_msg->n_faulty_points); + ck_assert_msg(check_msg->faulty_points[0] == 10, + "incorrect value for faulty_points[0], expected 10, is %d", + check_msg->faulty_points[0]); + ck_assert_msg(check_msg->faulty_points[1] == 11, + "incorrect value for faulty_points[1], expected 11, is %d", + check_msg->faulty_points[1]); + ck_assert_msg(check_msg->faulty_points[2] == 12, + "incorrect value for faulty_points[2], expected 12, is %d", + check_msg->faulty_points[2]); + ck_assert_msg(check_msg->header.chain_id == 6, + "incorrect value for header.chain_id, expected 6, is %d", + check_msg->header.chain_id); + ck_assert_msg(check_msg->header.num_msgs == 1, + "incorrect value for header.num_msgs, expected 1, is %d", + check_msg->header.num_msgs); + ck_assert_msg( + check_msg->header.obs_time.tow == 180, + "incorrect value for header.obs_time.tow, expected 180, is %d", + check_msg->header.obs_time.tow); + ck_assert_msg(check_msg->header.obs_time.wn == 3, + "incorrect value for header.obs_time.wn, expected 3, is %d", + check_msg->header.obs_time.wn); + ck_assert_msg(check_msg->header.seq_num == 2, + "incorrect value for header.seq_num, expected 2, is %d", + check_msg->header.seq_num); + ck_assert_msg(check_msg->header.ssr_sol_id == 3, + "incorrect value for header.ssr_sol_id, expected 3, is %d", + check_msg->header.ssr_sol_id); + ck_assert_msg(check_msg->header.tile_id == 5, + "incorrect value for header.tile_id, expected 5, is %d", + check_msg->header.tile_id); + ck_assert_msg(check_msg->header.tile_set_id == 4, + "incorrect value for header.tile_set_id, expected 4, is %d", + check_msg->header.tile_set_id); + ck_assert_msg(check_msg->n_faulty_points == 3, + "incorrect value for n_faulty_points, expected 3, is %d", + check_msg->n_faulty_points); } } END_TEST -Suite* legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints); +Suite *legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_integrity_" + "MsgSsrFlagIonoGridPoints"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.c b/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.c index c84e12551..4cf85e700 100644 --- a/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.c +++ b/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoTileSatLos.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoTileSatLos.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos ) -{ +START_TEST(test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 3021, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 3021, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 3021, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 3021, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,205,11,66,0,19,180,0,0,0,3,0,1,2,3,4,0,5,0,6,2,10,11,15,14,239,235, }; + u8 encoded_frame[] = { + 85, 205, 11, 66, 0, 19, 180, 0, 0, 0, 3, 0, 1, 2, + 3, 4, 0, 5, 0, 6, 2, 10, 11, 15, 14, 239, 235, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_flag_iono_tile_sat_los_t* test_msg = ( msg_ssr_flag_iono_tile_sat_los_t* )test_msg_storage; + msg_ssr_flag_iono_tile_sat_los_t *test_msg = + (msg_ssr_flag_iono_tile_sat_los_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->faulty_los) == 0) { // Cope with variable length arrays @@ -164,76 +167,116 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos ) test_msg->header.tile_id = 5; test_msg->header.tile_set_id = 4; test_msg->n_faulty_los = 2; - sbp_payload_send(&sbp_state, 3021, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 3021, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 3021, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_flag_iono_tile_sat_los_t* check_msg = ( msg_ssr_flag_iono_tile_sat_los_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_flag_iono_tile_sat_los_t *check_msg = + (msg_ssr_flag_iono_tile_sat_los_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->faulty_los[0].constellation == 11, "incorrect value for faulty_los[0].constellation, expected 11, is %d", check_msg->faulty_los[0].constellation); - ck_assert_msg(check_msg->faulty_los[0].satId == 10, "incorrect value for faulty_los[0].satId, expected 10, is %d", check_msg->faulty_los[0].satId); - ck_assert_msg(check_msg->faulty_los[1].constellation == 14, "incorrect value for faulty_los[1].constellation, expected 14, is %d", check_msg->faulty_los[1].constellation); - ck_assert_msg(check_msg->faulty_los[1].satId == 15, "incorrect value for faulty_los[1].satId, expected 15, is %d", check_msg->faulty_los[1].satId); - ck_assert_msg(check_msg->header.chain_id == 6, "incorrect value for header.chain_id, expected 6, is %d", check_msg->header.chain_id); - ck_assert_msg(check_msg->header.num_msgs == 1, "incorrect value for header.num_msgs, expected 1, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.obs_time.tow == 180, "incorrect value for header.obs_time.tow, expected 180, is %d", check_msg->header.obs_time.tow); - ck_assert_msg(check_msg->header.obs_time.wn == 3, "incorrect value for header.obs_time.wn, expected 3, is %d", check_msg->header.obs_time.wn); - ck_assert_msg(check_msg->header.seq_num == 2, "incorrect value for header.seq_num, expected 2, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->header.ssr_sol_id == 3, "incorrect value for header.ssr_sol_id, expected 3, is %d", check_msg->header.ssr_sol_id); - ck_assert_msg(check_msg->header.tile_id == 5, "incorrect value for header.tile_id, expected 5, is %d", check_msg->header.tile_id); - ck_assert_msg(check_msg->header.tile_set_id == 4, "incorrect value for header.tile_set_id, expected 4, is %d", check_msg->header.tile_set_id); - ck_assert_msg(check_msg->n_faulty_los == 2, "incorrect value for n_faulty_los, expected 2, is %d", check_msg->n_faulty_los); + ck_assert_msg( + check_msg->faulty_los[0].constellation == 11, + "incorrect value for faulty_los[0].constellation, expected 11, is %d", + check_msg->faulty_los[0].constellation); + ck_assert_msg(check_msg->faulty_los[0].satId == 10, + "incorrect value for faulty_los[0].satId, expected 10, is %d", + check_msg->faulty_los[0].satId); + ck_assert_msg( + check_msg->faulty_los[1].constellation == 14, + "incorrect value for faulty_los[1].constellation, expected 14, is %d", + check_msg->faulty_los[1].constellation); + ck_assert_msg(check_msg->faulty_los[1].satId == 15, + "incorrect value for faulty_los[1].satId, expected 15, is %d", + check_msg->faulty_los[1].satId); + ck_assert_msg(check_msg->header.chain_id == 6, + "incorrect value for header.chain_id, expected 6, is %d", + check_msg->header.chain_id); + ck_assert_msg(check_msg->header.num_msgs == 1, + "incorrect value for header.num_msgs, expected 1, is %d", + check_msg->header.num_msgs); + ck_assert_msg( + check_msg->header.obs_time.tow == 180, + "incorrect value for header.obs_time.tow, expected 180, is %d", + check_msg->header.obs_time.tow); + ck_assert_msg(check_msg->header.obs_time.wn == 3, + "incorrect value for header.obs_time.wn, expected 3, is %d", + check_msg->header.obs_time.wn); + ck_assert_msg(check_msg->header.seq_num == 2, + "incorrect value for header.seq_num, expected 2, is %d", + check_msg->header.seq_num); + ck_assert_msg(check_msg->header.ssr_sol_id == 3, + "incorrect value for header.ssr_sol_id, expected 3, is %d", + check_msg->header.ssr_sol_id); + ck_assert_msg(check_msg->header.tile_id == 5, + "incorrect value for header.tile_id, expected 5, is %d", + check_msg->header.tile_id); + ck_assert_msg(check_msg->header.tile_set_id == 4, + "incorrect value for header.tile_set_id, expected 4, is %d", + check_msg->header.tile_set_id); + ck_assert_msg(check_msg->n_faulty_los == 2, + "incorrect value for n_faulty_los, expected 2, is %d", + check_msg->n_faulty_los); } } END_TEST -Suite* legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos); +Suite *legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_integrity_" + "MsgSsrFlagIonoTileSatLos"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagSatellites.c b/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagSatellites.c index 2e84094c4..7b9e9de9d 100644 --- a/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagSatellites.c +++ b/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagSatellites.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagSatellites.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagSatellites.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites ) -{ +START_TEST(test_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 3005, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 3005, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 3005, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 3005, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,189,11,66,0,15,180,0,0,0,3,0,1,2,3,4,5,3,10,11,12,110,165, }; + u8 encoded_frame[] = { + 85, 189, 11, 66, 0, 15, 180, 0, 0, 0, 3, 0, + 1, 2, 3, 4, 5, 3, 10, 11, 12, 110, 165, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_flag_satellites_t* test_msg = ( msg_ssr_flag_satellites_t* )test_msg_storage; + msg_ssr_flag_satellites_t *test_msg = + (msg_ssr_flag_satellites_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->chain_id = 4; test_msg->const_id = 5; @@ -166,74 +169,106 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites ) test_msg->obs_time.wn = 3; test_msg->seq_num = 2; test_msg->ssr_sol_id = 3; - sbp_payload_send(&sbp_state, 3005, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 3005, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 3005, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_flag_satellites_t* check_msg = ( msg_ssr_flag_satellites_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_flag_satellites_t *check_msg = + (msg_ssr_flag_satellites_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->chain_id == 4, "incorrect value for chain_id, expected 4, is %d", check_msg->chain_id); - ck_assert_msg(check_msg->const_id == 5, "incorrect value for const_id, expected 5, is %d", check_msg->const_id); - ck_assert_msg(check_msg->faulty_sats[0] == 10, "incorrect value for faulty_sats[0], expected 10, is %d", check_msg->faulty_sats[0]); - ck_assert_msg(check_msg->faulty_sats[1] == 11, "incorrect value for faulty_sats[1], expected 11, is %d", check_msg->faulty_sats[1]); - ck_assert_msg(check_msg->faulty_sats[2] == 12, "incorrect value for faulty_sats[2], expected 12, is %d", check_msg->faulty_sats[2]); - ck_assert_msg(check_msg->n_faulty_sats == 3, "incorrect value for n_faulty_sats, expected 3, is %d", check_msg->n_faulty_sats); - ck_assert_msg(check_msg->num_msgs == 1, "incorrect value for num_msgs, expected 1, is %d", check_msg->num_msgs); - ck_assert_msg(check_msg->obs_time.tow == 180, "incorrect value for obs_time.tow, expected 180, is %d", check_msg->obs_time.tow); - ck_assert_msg(check_msg->obs_time.wn == 3, "incorrect value for obs_time.wn, expected 3, is %d", check_msg->obs_time.wn); - ck_assert_msg(check_msg->seq_num == 2, "incorrect value for seq_num, expected 2, is %d", check_msg->seq_num); - ck_assert_msg(check_msg->ssr_sol_id == 3, "incorrect value for ssr_sol_id, expected 3, is %d", check_msg->ssr_sol_id); + ck_assert_msg(check_msg->chain_id == 4, + "incorrect value for chain_id, expected 4, is %d", + check_msg->chain_id); + ck_assert_msg(check_msg->const_id == 5, + "incorrect value for const_id, expected 5, is %d", + check_msg->const_id); + ck_assert_msg(check_msg->faulty_sats[0] == 10, + "incorrect value for faulty_sats[0], expected 10, is %d", + check_msg->faulty_sats[0]); + ck_assert_msg(check_msg->faulty_sats[1] == 11, + "incorrect value for faulty_sats[1], expected 11, is %d", + check_msg->faulty_sats[1]); + ck_assert_msg(check_msg->faulty_sats[2] == 12, + "incorrect value for faulty_sats[2], expected 12, is %d", + check_msg->faulty_sats[2]); + ck_assert_msg(check_msg->n_faulty_sats == 3, + "incorrect value for n_faulty_sats, expected 3, is %d", + check_msg->n_faulty_sats); + ck_assert_msg(check_msg->num_msgs == 1, + "incorrect value for num_msgs, expected 1, is %d", + check_msg->num_msgs); + ck_assert_msg(check_msg->obs_time.tow == 180, + "incorrect value for obs_time.tow, expected 180, is %d", + check_msg->obs_time.tow); + ck_assert_msg(check_msg->obs_time.wn == 3, + "incorrect value for obs_time.wn, expected 3, is %d", + check_msg->obs_time.wn); + ck_assert_msg(check_msg->seq_num == 2, + "incorrect value for seq_num, expected 2, is %d", + check_msg->seq_num); + ck_assert_msg(check_msg->ssr_sol_id == 3, + "incorrect value for ssr_sol_id, expected 3, is %d", + check_msg->ssr_sol_id); } } END_TEST -Suite* legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites); +Suite *legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.c b/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.c index 0a3f4ac99..22a384390 100644 --- a/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.c +++ b/c/test/legacy/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagTropoGridPoints.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagTropoGridPoints.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints ) -{ +START_TEST(test_legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 3011, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 3011, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 3011, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 3011, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,195,11,66,0,21,180,0,0,0,3,0,1,2,3,4,0,5,0,6,3,10,0,11,0,12,0,243,150, }; + u8 encoded_frame[] = { + 85, 195, 11, 66, 0, 21, 180, 0, 0, 0, 3, 0, 1, 2, 3, + 4, 0, 5, 0, 6, 3, 10, 0, 11, 0, 12, 0, 243, 150, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_flag_tropo_grid_points_t* test_msg = ( msg_ssr_flag_tropo_grid_points_t* )test_msg_storage; + msg_ssr_flag_tropo_grid_points_t *test_msg = + (msg_ssr_flag_tropo_grid_points_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->faulty_points) == 0) { // Cope with variable length arrays @@ -167,75 +170,111 @@ START_TEST( test_legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints ) test_msg->header.tile_id = 5; test_msg->header.tile_set_id = 4; test_msg->n_faulty_points = 3; - sbp_payload_send(&sbp_state, 3011, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 3011, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 3011, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_flag_tropo_grid_points_t* check_msg = ( msg_ssr_flag_tropo_grid_points_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_flag_tropo_grid_points_t *check_msg = + (msg_ssr_flag_tropo_grid_points_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->faulty_points[0] == 10, "incorrect value for faulty_points[0], expected 10, is %d", check_msg->faulty_points[0]); - ck_assert_msg(check_msg->faulty_points[1] == 11, "incorrect value for faulty_points[1], expected 11, is %d", check_msg->faulty_points[1]); - ck_assert_msg(check_msg->faulty_points[2] == 12, "incorrect value for faulty_points[2], expected 12, is %d", check_msg->faulty_points[2]); - ck_assert_msg(check_msg->header.chain_id == 6, "incorrect value for header.chain_id, expected 6, is %d", check_msg->header.chain_id); - ck_assert_msg(check_msg->header.num_msgs == 1, "incorrect value for header.num_msgs, expected 1, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.obs_time.tow == 180, "incorrect value for header.obs_time.tow, expected 180, is %d", check_msg->header.obs_time.tow); - ck_assert_msg(check_msg->header.obs_time.wn == 3, "incorrect value for header.obs_time.wn, expected 3, is %d", check_msg->header.obs_time.wn); - ck_assert_msg(check_msg->header.seq_num == 2, "incorrect value for header.seq_num, expected 2, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->header.ssr_sol_id == 3, "incorrect value for header.ssr_sol_id, expected 3, is %d", check_msg->header.ssr_sol_id); - ck_assert_msg(check_msg->header.tile_id == 5, "incorrect value for header.tile_id, expected 5, is %d", check_msg->header.tile_id); - ck_assert_msg(check_msg->header.tile_set_id == 4, "incorrect value for header.tile_set_id, expected 4, is %d", check_msg->header.tile_set_id); - ck_assert_msg(check_msg->n_faulty_points == 3, "incorrect value for n_faulty_points, expected 3, is %d", check_msg->n_faulty_points); + ck_assert_msg(check_msg->faulty_points[0] == 10, + "incorrect value for faulty_points[0], expected 10, is %d", + check_msg->faulty_points[0]); + ck_assert_msg(check_msg->faulty_points[1] == 11, + "incorrect value for faulty_points[1], expected 11, is %d", + check_msg->faulty_points[1]); + ck_assert_msg(check_msg->faulty_points[2] == 12, + "incorrect value for faulty_points[2], expected 12, is %d", + check_msg->faulty_points[2]); + ck_assert_msg(check_msg->header.chain_id == 6, + "incorrect value for header.chain_id, expected 6, is %d", + check_msg->header.chain_id); + ck_assert_msg(check_msg->header.num_msgs == 1, + "incorrect value for header.num_msgs, expected 1, is %d", + check_msg->header.num_msgs); + ck_assert_msg( + check_msg->header.obs_time.tow == 180, + "incorrect value for header.obs_time.tow, expected 180, is %d", + check_msg->header.obs_time.tow); + ck_assert_msg(check_msg->header.obs_time.wn == 3, + "incorrect value for header.obs_time.wn, expected 3, is %d", + check_msg->header.obs_time.wn); + ck_assert_msg(check_msg->header.seq_num == 2, + "incorrect value for header.seq_num, expected 2, is %d", + check_msg->header.seq_num); + ck_assert_msg(check_msg->header.ssr_sol_id == 3, + "incorrect value for header.ssr_sol_id, expected 3, is %d", + check_msg->header.ssr_sol_id); + ck_assert_msg(check_msg->header.tile_id == 5, + "incorrect value for header.tile_id, expected 5, is %d", + check_msg->header.tile_id); + ck_assert_msg(check_msg->header.tile_set_id == 4, + "incorrect value for header.tile_set_id, expected 4, is %d", + check_msg->header.tile_set_id); + ck_assert_msg(check_msg->n_faulty_points == 3, + "incorrect value for n_faulty_points, expected 3, is %d", + check_msg->n_faulty_points); } } END_TEST -Suite* legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints); +Suite *legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_integrity_" + "MsgSsrFlagTropoGridPoints"); + tcase_add_test( + tc_acq, test_legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_linux_MsgLinuxCpuState.c b/c/test/legacy/auto_check_sbp_linux_MsgLinuxCpuState.c index 118e882a0..dd843927a 100644 --- a/c/test/legacy/auto_check_sbp_linux_MsgLinuxCpuState.c +++ b/c/test/legacy/auto_check_sbp_linux_MsgLinuxCpuState.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuState.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxCpuState ) -{ +START_TEST(test_legacy_auto_check_sbp_linux_MsgLinuxCpuState) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxCpuState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,20 +128,37 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxCpuState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x7f08, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x7f08, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x7f08, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x7f08, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,8,127,148,133,70,101,122,195,98,215,35,94,235,20,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,68,229, }; + u8 encoded_frame[] = { + 85, 8, 127, 148, 133, 70, 101, 122, 195, 98, 215, 35, 94, + 235, 20, 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, + 101, 0, 0, 0, 47, 112, 97, 116, 104, 47, 116, 111, 47, + 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, + 97, 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, + 50, 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 68, 229, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_linux_cpu_state_t* test_msg = ( msg_linux_cpu_state_t* )test_msg_storage; + msg_linux_cpu_state_t *test_msg = (msg_linux_cpu_state_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); if (sizeof(test_msg->cmdline) == 0) { test_msg_len += sizeof(assign_string); @@ -156,81 +170,120 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxCpuState ) test_msg->pid = 50042; test_msg->time = 3948815319; { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; memcpy(test_msg->tname, assign_string, sizeof(assign_string)); if (sizeof(test_msg->tname) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0x7f08, 34196, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x7f08, 34196, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 34196, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 34196, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x7f08, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_linux_cpu_state_t* check_msg = ( msg_linux_cpu_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_linux_cpu_state_t *check_msg = + (msg_linux_cpu_state_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - ck_assert_msg(memcmp(check_msg->cmdline, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->cmdline, expected string '%s', is '%s'", check_string, check_msg->cmdline); + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + ck_assert_msg( + memcmp(check_msg->cmdline, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->cmdline, expected string '%s', is " + "'%s'", + check_string, check_msg->cmdline); } - ck_assert_msg(check_msg->flags == 20, "incorrect value for flags, expected 20, is %d", check_msg->flags); - ck_assert_msg(check_msg->index == 101, "incorrect value for index, expected 101, is %d", check_msg->index); - ck_assert_msg(check_msg->pcpu == 98, "incorrect value for pcpu, expected 98, is %d", check_msg->pcpu); - ck_assert_msg(check_msg->pid == 50042, "incorrect value for pid, expected 50042, is %d", check_msg->pid); - ck_assert_msg(check_msg->time == 3948815319, "incorrect value for time, expected 3948815319, is %d", check_msg->time); + ck_assert_msg(check_msg->flags == 20, + "incorrect value for flags, expected 20, is %d", + check_msg->flags); + ck_assert_msg(check_msg->index == 101, + "incorrect value for index, expected 101, is %d", + check_msg->index); + ck_assert_msg(check_msg->pcpu == 98, + "incorrect value for pcpu, expected 98, is %d", + check_msg->pcpu); + ck_assert_msg(check_msg->pid == 50042, + "incorrect value for pid, expected 50042, is %d", + check_msg->pid); + ck_assert_msg(check_msg->time == 3948815319, + "incorrect value for time, expected 3948815319, is %d", + check_msg->time); { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->tname, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->tname, expected string '%s', is '%s'", check_string, check_msg->tname); + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->tname, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->tname, expected string '%s', is '%s'", + check_string, check_msg->tname); } } } END_TEST -Suite* legacy_auto_check_sbp_linux_MsgLinuxCpuState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_linux_MsgLinuxCpuState"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxCpuState"); +Suite *legacy_auto_check_sbp_linux_MsgLinuxCpuState_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_linux_MsgLinuxCpuState"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxCpuState"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_linux_MsgLinuxCpuState); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_linux_MsgLinuxCpuStateDepA.c b/c/test/legacy/auto_check_sbp_linux_MsgLinuxCpuStateDepA.c index e35d28ce1..3e97cafc6 100644 --- a/c/test/legacy/auto_check_sbp_linux_MsgLinuxCpuStateDepA.c +++ b/c/test/legacy/auto_check_sbp_linux_MsgLinuxCpuStateDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuStateDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,20 +128,38 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x7f00, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x7f00, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x7f00, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x7f00, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,127,12,91,65,51,240,250,178,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,80,48, }; + u8 encoded_frame[] = { + 85, 0, 127, 12, 91, 65, 51, 240, 250, 178, 112, 114, 111, + 99, 101, 115, 115, 45, 110, 97, 109, 101, 0, 0, 0, 47, + 112, 97, 116, 104, 47, 116, 111, 47, 112, 114, 111, 99, 101, + 115, 115, 45, 110, 97, 109, 101, 32, 97, 114, 103, 48, 32, + 97, 114, 103, 49, 32, 97, 114, 103, 50, 32, 97, 114, 103, + 51, 32, 97, 114, 103, 52, 80, 48, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_linux_cpu_state_dep_a_t* test_msg = ( msg_linux_cpu_state_dep_a_t* )test_msg_storage; + msg_linux_cpu_state_dep_a_t *test_msg = + (msg_linux_cpu_state_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); if (sizeof(test_msg->cmdline) == 0) { test_msg_len += sizeof(assign_string); @@ -154,79 +169,115 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA ) test_msg->pcpu = 178; test_msg->pid = 64240; { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; memcpy(test_msg->tname, assign_string, sizeof(assign_string)); if (sizeof(test_msg->tname) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0x7f00, 23308, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x7f00, 23308, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 23308, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 23308, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x7f00, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_linux_cpu_state_dep_a_t* check_msg = ( msg_linux_cpu_state_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_linux_cpu_state_dep_a_t *check_msg = + (msg_linux_cpu_state_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - ck_assert_msg(memcmp(check_msg->cmdline, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->cmdline, expected string '%s', is '%s'", check_string, check_msg->cmdline); + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + ck_assert_msg( + memcmp(check_msg->cmdline, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->cmdline, expected string '%s', is " + "'%s'", + check_string, check_msg->cmdline); } - ck_assert_msg(check_msg->index == 51, "incorrect value for index, expected 51, is %d", check_msg->index); - ck_assert_msg(check_msg->pcpu == 178, "incorrect value for pcpu, expected 178, is %d", check_msg->pcpu); - ck_assert_msg(check_msg->pid == 64240, "incorrect value for pid, expected 64240, is %d", check_msg->pid); + ck_assert_msg(check_msg->index == 51, + "incorrect value for index, expected 51, is %d", + check_msg->index); + ck_assert_msg(check_msg->pcpu == 178, + "incorrect value for pcpu, expected 178, is %d", + check_msg->pcpu); + ck_assert_msg(check_msg->pid == 64240, + "incorrect value for pid, expected 64240, is %d", + check_msg->pid); { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->tname, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->tname, expected string '%s', is '%s'", check_string, check_msg->tname); + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->tname, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->tname, expected string '%s', is '%s'", + check_string, check_msg->tname); } } } END_TEST -Suite* legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA"); +Suite *legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_linux_MsgLinuxMemState.c b/c/test/legacy/auto_check_sbp_linux_MsgLinuxMemState.c index d059fa46a..fb2413aba 100644 --- a/c/test/legacy/auto_check_sbp_linux_MsgLinuxMemState.c +++ b/c/test/legacy/auto_check_sbp_linux_MsgLinuxMemState.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemState.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxMemState ) -{ +START_TEST(test_legacy_auto_check_sbp_linux_MsgLinuxMemState) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxMemState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,20 +128,37 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxMemState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x7f09, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x7f09, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x7f09, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x7f09, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,9,127,95,253,70,154,191,223,19,247,53,26,187,76,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,3,181, }; + u8 encoded_frame[] = { + 85, 9, 127, 95, 253, 70, 154, 191, 223, 19, 247, 53, 26, + 187, 76, 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, + 101, 0, 0, 0, 47, 112, 97, 116, 104, 47, 116, 111, 47, + 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, + 97, 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, + 50, 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 3, 181, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_linux_mem_state_t* test_msg = ( msg_linux_mem_state_t* )test_msg_storage; + msg_linux_mem_state_t *test_msg = (msg_linux_mem_state_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); if (sizeof(test_msg->cmdline) == 0) { test_msg_len += sizeof(assign_string); @@ -156,81 +170,120 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxMemState ) test_msg->pmem = 19; test_msg->time = 3139057143; { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; memcpy(test_msg->tname, assign_string, sizeof(assign_string)); if (sizeof(test_msg->tname) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0x7f09, 64863, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x7f09, 64863, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 64863, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 64863, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x7f09, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_linux_mem_state_t* check_msg = ( msg_linux_mem_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_linux_mem_state_t *check_msg = + (msg_linux_mem_state_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - ck_assert_msg(memcmp(check_msg->cmdline, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->cmdline, expected string '%s', is '%s'", check_string, check_msg->cmdline); + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + ck_assert_msg( + memcmp(check_msg->cmdline, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->cmdline, expected string '%s', is " + "'%s'", + check_string, check_msg->cmdline); } - ck_assert_msg(check_msg->flags == 76, "incorrect value for flags, expected 76, is %d", check_msg->flags); - ck_assert_msg(check_msg->index == 154, "incorrect value for index, expected 154, is %d", check_msg->index); - ck_assert_msg(check_msg->pid == 57279, "incorrect value for pid, expected 57279, is %d", check_msg->pid); - ck_assert_msg(check_msg->pmem == 19, "incorrect value for pmem, expected 19, is %d", check_msg->pmem); - ck_assert_msg(check_msg->time == 3139057143, "incorrect value for time, expected 3139057143, is %d", check_msg->time); + ck_assert_msg(check_msg->flags == 76, + "incorrect value for flags, expected 76, is %d", + check_msg->flags); + ck_assert_msg(check_msg->index == 154, + "incorrect value for index, expected 154, is %d", + check_msg->index); + ck_assert_msg(check_msg->pid == 57279, + "incorrect value for pid, expected 57279, is %d", + check_msg->pid); + ck_assert_msg(check_msg->pmem == 19, + "incorrect value for pmem, expected 19, is %d", + check_msg->pmem); + ck_assert_msg(check_msg->time == 3139057143, + "incorrect value for time, expected 3139057143, is %d", + check_msg->time); { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->tname, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->tname, expected string '%s', is '%s'", check_string, check_msg->tname); + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->tname, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->tname, expected string '%s', is '%s'", + check_string, check_msg->tname); } } } END_TEST -Suite* legacy_auto_check_sbp_linux_MsgLinuxMemState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_linux_MsgLinuxMemState"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxMemState"); +Suite *legacy_auto_check_sbp_linux_MsgLinuxMemState_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_linux_MsgLinuxMemState"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxMemState"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_linux_MsgLinuxMemState); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_linux_MsgLinuxMemStateDepA.c b/c/test/legacy/auto_check_sbp_linux_MsgLinuxMemStateDepA.c index 0209ac2f3..5a539f460 100644 --- a/c/test/legacy/auto_check_sbp_linux_MsgLinuxMemStateDepA.c +++ b/c/test/legacy/auto_check_sbp_linux_MsgLinuxMemStateDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemStateDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,20 +128,38 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x7f01, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x7f01, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x7f01, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x7f01, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,127,185,109,65,247,93,48,193,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,17,137, }; + u8 encoded_frame[] = { + 85, 1, 127, 185, 109, 65, 247, 93, 48, 193, 112, 114, 111, + 99, 101, 115, 115, 45, 110, 97, 109, 101, 0, 0, 0, 47, + 112, 97, 116, 104, 47, 116, 111, 47, 112, 114, 111, 99, 101, + 115, 115, 45, 110, 97, 109, 101, 32, 97, 114, 103, 48, 32, + 97, 114, 103, 49, 32, 97, 114, 103, 50, 32, 97, 114, 103, + 51, 32, 97, 114, 103, 52, 17, 137, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_linux_mem_state_dep_a_t* test_msg = ( msg_linux_mem_state_dep_a_t* )test_msg_storage; + msg_linux_mem_state_dep_a_t *test_msg = + (msg_linux_mem_state_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); if (sizeof(test_msg->cmdline) == 0) { test_msg_len += sizeof(assign_string); @@ -154,79 +169,115 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA ) test_msg->pid = 12381; test_msg->pmem = 193; { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; memcpy(test_msg->tname, assign_string, sizeof(assign_string)); if (sizeof(test_msg->tname) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0x7f01, 28089, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x7f01, 28089, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 28089, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 28089, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x7f01, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_linux_mem_state_dep_a_t* check_msg = ( msg_linux_mem_state_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_linux_mem_state_dep_a_t *check_msg = + (msg_linux_mem_state_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - ck_assert_msg(memcmp(check_msg->cmdline, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->cmdline, expected string '%s', is '%s'", check_string, check_msg->cmdline); + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + ck_assert_msg( + memcmp(check_msg->cmdline, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->cmdline, expected string '%s', is " + "'%s'", + check_string, check_msg->cmdline); } - ck_assert_msg(check_msg->index == 247, "incorrect value for index, expected 247, is %d", check_msg->index); - ck_assert_msg(check_msg->pid == 12381, "incorrect value for pid, expected 12381, is %d", check_msg->pid); - ck_assert_msg(check_msg->pmem == 193, "incorrect value for pmem, expected 193, is %d", check_msg->pmem); + ck_assert_msg(check_msg->index == 247, + "incorrect value for index, expected 247, is %d", + check_msg->index); + ck_assert_msg(check_msg->pid == 12381, + "incorrect value for pid, expected 12381, is %d", + check_msg->pid); + ck_assert_msg(check_msg->pmem == 193, + "incorrect value for pmem, expected 193, is %d", + check_msg->pmem); { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->tname, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->tname, expected string '%s', is '%s'", check_string, check_msg->tname); + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->tname, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->tname, expected string '%s', is '%s'", + check_string, check_msg->tname); } } } END_TEST -Suite* legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA"); +Suite *legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessFdCount.c b/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessFdCount.c index 742aee086..a5ef92365 100644 --- a/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessFdCount.c +++ b/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessFdCount.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdCount.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdCount.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount ) -{ +START_TEST(test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,20 +128,37 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x7f06, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x7f06, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x7f06, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x7f06, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,6,127,30,195,51,164,189,165,5,139,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,2,94, }; + u8 encoded_frame[] = { + 85, 6, 127, 30, 195, 51, 164, 189, 165, 5, 139, 47, + 112, 97, 116, 104, 47, 116, 111, 47, 112, 114, 111, 99, + 101, 115, 115, 45, 110, 97, 109, 101, 32, 97, 114, 103, + 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, 50, 32, + 97, 114, 103, 51, 32, 97, 114, 103, 52, 2, 94, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_linux_process_fd_count_t* test_msg = ( msg_linux_process_fd_count_t* )test_msg_storage; + msg_linux_process_fd_count_t *test_msg = + (msg_linux_process_fd_count_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); if (sizeof(test_msg->cmdline) == 0) { test_msg_len += sizeof(assign_string); @@ -153,70 +167,98 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount ) test_msg->fd_count = 35589; test_msg->index = 164; test_msg->pid = 42429; - sbp_payload_send(&sbp_state, 0x7f06, 49950, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x7f06, 49950, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 49950, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 49950, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x7f06, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_linux_process_fd_count_t* check_msg = ( msg_linux_process_fd_count_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_linux_process_fd_count_t *check_msg = + (msg_linux_process_fd_count_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - ck_assert_msg(memcmp(check_msg->cmdline, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->cmdline, expected string '%s', is '%s'", check_string, check_msg->cmdline); + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + ck_assert_msg( + memcmp(check_msg->cmdline, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->cmdline, expected string '%s', is " + "'%s'", + check_string, check_msg->cmdline); } - ck_assert_msg(check_msg->fd_count == 35589, "incorrect value for fd_count, expected 35589, is %d", check_msg->fd_count); - ck_assert_msg(check_msg->index == 164, "incorrect value for index, expected 164, is %d", check_msg->index); - ck_assert_msg(check_msg->pid == 42429, "incorrect value for pid, expected 42429, is %d", check_msg->pid); + ck_assert_msg(check_msg->fd_count == 35589, + "incorrect value for fd_count, expected 35589, is %d", + check_msg->fd_count); + ck_assert_msg(check_msg->index == 164, + "incorrect value for index, expected 164, is %d", + check_msg->index); + ck_assert_msg(check_msg->pid == 42429, + "incorrect value for pid, expected 42429, is %d", + check_msg->pid); } } END_TEST -Suite* legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount); +Suite *legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessFdSummary.c b/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessFdSummary.c index f80a1b147..9eb8a7fb4 100644 --- a/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessFdSummary.c +++ b/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessFdSummary.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdSummary.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdSummary.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary ) -{ +START_TEST(test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,88 +128,122 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x7f07, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x7f07, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x7f07, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x7f07, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,7,127,103,248,29,19,131,200,77,102,100,49,0,102,100,50,0,102,100,51,0,102,100,52,0,102,100,53,0,102,100,54,0,0,129,80, }; + u8 encoded_frame[] = { + 85, 7, 127, 103, 248, 29, 19, 131, 200, 77, 102, 100, 49, + 0, 102, 100, 50, 0, 102, 100, 51, 0, 102, 100, 52, 0, + 102, 100, 53, 0, 102, 100, 54, 0, 0, 129, 80, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_linux_process_fd_summary_t* test_msg = ( msg_linux_process_fd_summary_t* )test_msg_storage; + msg_linux_process_fd_summary_t *test_msg = + (msg_linux_process_fd_summary_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)102,(char)100,(char)49,(char)0,(char)102,(char)100,(char)50,(char)0,(char)102,(char)100,(char)51,(char)0,(char)102,(char)100,(char)52,(char)0,(char)102,(char)100,(char)53,(char)0,(char)102,(char)100,(char)54,(char)0,(char)0 }; + const char assign_string[] = { + (char)102, (char)100, (char)49, (char)0, (char)102, + (char)100, (char)50, (char)0, (char)102, (char)100, + (char)51, (char)0, (char)102, (char)100, (char)52, + (char)0, (char)102, (char)100, (char)53, (char)0, + (char)102, (char)100, (char)54, (char)0, (char)0}; memcpy(test_msg->most_opened, assign_string, sizeof(assign_string)); if (sizeof(test_msg->most_opened) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->sys_fd_count = 1304986387; - sbp_payload_send(&sbp_state, 0x7f07, 63591, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x7f07, 63591, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 63591, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 63591, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x7f07, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_linux_process_fd_summary_t* check_msg = ( msg_linux_process_fd_summary_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_linux_process_fd_summary_t *check_msg = + (msg_linux_process_fd_summary_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)102,(char)100,(char)49,(char)0,(char)102,(char)100,(char)50,(char)0,(char)102,(char)100,(char)51,(char)0,(char)102,(char)100,(char)52,(char)0,(char)102,(char)100,(char)53,(char)0,(char)102,(char)100,(char)54,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->most_opened, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->most_opened, expected string '%s', is '%s'", check_string, check_msg->most_opened); + const char check_string[] = { + (char)102, (char)100, (char)49, (char)0, (char)102, + (char)100, (char)50, (char)0, (char)102, (char)100, + (char)51, (char)0, (char)102, (char)100, (char)52, + (char)0, (char)102, (char)100, (char)53, (char)0, + (char)102, (char)100, (char)54, (char)0, (char)0}; + ck_assert_msg(memcmp(check_msg->most_opened, check_string, + sizeof(check_string)) == 0, + "incorrect value for check_msg->most_opened, expected " + "string '%s', is '%s'", + check_string, check_msg->most_opened); } - ck_assert_msg(check_msg->sys_fd_count == 1304986387, "incorrect value for sys_fd_count, expected 1304986387, is %d", check_msg->sys_fd_count); + ck_assert_msg( + check_msg->sys_fd_count == 1304986387, + "incorrect value for sys_fd_count, expected 1304986387, is %d", + check_msg->sys_fd_count); } } END_TEST -Suite* legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary); +Suite *legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.c b/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.c index b3ab46238..fd9669b27 100644 --- a/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.c +++ b/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketCounts.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketCounts.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts ) -{ +START_TEST(test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,20 +128,37 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x7f03, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x7f03, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x7f03, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x7f03, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,127,108,9,55,51,137,111,79,118,3,140,114,115,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,180,131, }; + u8 encoded_frame[] = { + 85, 3, 127, 108, 9, 55, 51, 137, 111, 79, 118, 3, 140, + 114, 115, 47, 112, 97, 116, 104, 47, 116, 111, 47, 112, 114, + 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, 97, 114, + 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, 50, 32, + 97, 114, 103, 51, 32, 97, 114, 103, 52, 180, 131, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_linux_process_socket_counts_t* test_msg = ( msg_linux_process_socket_counts_t* )test_msg_storage; + msg_linux_process_socket_counts_t *test_msg = + (msg_linux_process_socket_counts_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); if (sizeof(test_msg->cmdline) == 0) { test_msg_len += sizeof(assign_string); @@ -155,72 +169,105 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts ) test_msg->socket_count = 30287; test_msg->socket_states = 29554; test_msg->socket_types = 35843; - sbp_payload_send(&sbp_state, 0x7f03, 2412, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x7f03, 2412, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 2412, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 2412, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x7f03, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_linux_process_socket_counts_t* check_msg = ( msg_linux_process_socket_counts_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_linux_process_socket_counts_t *check_msg = + (msg_linux_process_socket_counts_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - ck_assert_msg(memcmp(check_msg->cmdline, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->cmdline, expected string '%s', is '%s'", check_string, check_msg->cmdline); + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + ck_assert_msg( + memcmp(check_msg->cmdline, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->cmdline, expected string '%s', is " + "'%s'", + check_string, check_msg->cmdline); } - ck_assert_msg(check_msg->index == 51, "incorrect value for index, expected 51, is %d", check_msg->index); - ck_assert_msg(check_msg->pid == 28553, "incorrect value for pid, expected 28553, is %d", check_msg->pid); - ck_assert_msg(check_msg->socket_count == 30287, "incorrect value for socket_count, expected 30287, is %d", check_msg->socket_count); - ck_assert_msg(check_msg->socket_states == 29554, "incorrect value for socket_states, expected 29554, is %d", check_msg->socket_states); - ck_assert_msg(check_msg->socket_types == 35843, "incorrect value for socket_types, expected 35843, is %d", check_msg->socket_types); + ck_assert_msg(check_msg->index == 51, + "incorrect value for index, expected 51, is %d", + check_msg->index); + ck_assert_msg(check_msg->pid == 28553, + "incorrect value for pid, expected 28553, is %d", + check_msg->pid); + ck_assert_msg(check_msg->socket_count == 30287, + "incorrect value for socket_count, expected 30287, is %d", + check_msg->socket_count); + ck_assert_msg(check_msg->socket_states == 29554, + "incorrect value for socket_states, expected 29554, is %d", + check_msg->socket_states); + ck_assert_msg(check_msg->socket_types == 35843, + "incorrect value for socket_types, expected 35843, is %d", + check_msg->socket_types); } } END_TEST -Suite* legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts); +Suite *legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_linux_" + "MsgLinuxProcessSocketCounts"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.c b/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.c index 7c63dbf80..c58b0d904 100644 --- a/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.c +++ b/c/test/legacy/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketQueues.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketQueues.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues ) -{ +START_TEST(test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,27 +128,61 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x7f04, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x7f04, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x7f04, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x7f04, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,127,187,232,121,181,135,75,249,211,35,252,80,109,15,223,97,100,100,114,101,115,115,32,111,102,32,108,97,114,103,101,115,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,2,247, }; + u8 encoded_frame[] = { + 85, 4, 127, 187, 232, 121, 181, 135, 75, 249, 211, 35, 252, + 80, 109, 15, 223, 97, 100, 100, 114, 101, 115, 115, 32, 111, + 102, 32, 108, 97, 114, 103, 101, 115, 116, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 47, 112, 97, 116, 104, 47, 116, 111, 47, 112, + 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, 97, + 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, 50, + 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 2, 247, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_linux_process_socket_queues_t* test_msg = ( msg_linux_process_socket_queues_t* )test_msg_storage; + msg_linux_process_socket_queues_t *test_msg = + (msg_linux_process_socket_queues_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)97,(char)100,(char)100,(char)114,(char)101,(char)115,(char)115,(char)32,(char)111,(char)102,(char)32,(char)108,(char)97,(char)114,(char)103,(char)101,(char)115,(char)116,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->address_of_largest, assign_string, sizeof(assign_string)); + const char assign_string[] = { + (char)97, (char)100, (char)100, (char)114, (char)101, (char)115, + (char)115, (char)32, (char)111, (char)102, (char)32, (char)108, + (char)97, (char)114, (char)103, (char)101, (char)115, (char)116, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->address_of_largest, assign_string, + sizeof(assign_string)); if (sizeof(test_msg->address_of_largest) == 0) { test_msg_len += sizeof(assign_string); } } { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); if (sizeof(test_msg->cmdline) == 0) { test_msg_len += sizeof(assign_string); @@ -163,77 +194,127 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues ) test_msg->send_queued = 64547; test_msg->socket_states = 57103; test_msg->socket_types = 27984; - sbp_payload_send(&sbp_state, 0x7f04, 59579, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x7f04, 59579, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 59579, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 59579, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x7f04, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_linux_process_socket_queues_t* check_msg = ( msg_linux_process_socket_queues_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_linux_process_socket_queues_t *check_msg = + (msg_linux_process_socket_queues_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)97,(char)100,(char)100,(char)114,(char)101,(char)115,(char)115,(char)32,(char)111,(char)102,(char)32,(char)108,(char)97,(char)114,(char)103,(char)101,(char)115,(char)116,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->address_of_largest, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->address_of_largest, expected string '%s', is '%s'", check_string, check_msg->address_of_largest); + const char check_string[] = { + (char)97, (char)100, (char)100, (char)114, (char)101, (char)115, + (char)115, (char)32, (char)111, (char)102, (char)32, (char)108, + (char)97, (char)114, (char)103, (char)101, (char)115, (char)116, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg(memcmp(check_msg->address_of_largest, check_string, + sizeof(check_string)) == 0, + "incorrect value for check_msg->address_of_largest, " + "expected string '%s', is '%s'", + check_string, check_msg->address_of_largest); } { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - ck_assert_msg(memcmp(check_msg->cmdline, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->cmdline, expected string '%s', is '%s'", check_string, check_msg->cmdline); + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + ck_assert_msg( + memcmp(check_msg->cmdline, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->cmdline, expected string '%s', is " + "'%s'", + check_string, check_msg->cmdline); } - ck_assert_msg(check_msg->index == 181, "incorrect value for index, expected 181, is %d", check_msg->index); - ck_assert_msg(check_msg->pid == 19335, "incorrect value for pid, expected 19335, is %d", check_msg->pid); - ck_assert_msg(check_msg->recv_queued == 54265, "incorrect value for recv_queued, expected 54265, is %d", check_msg->recv_queued); - ck_assert_msg(check_msg->send_queued == 64547, "incorrect value for send_queued, expected 64547, is %d", check_msg->send_queued); - ck_assert_msg(check_msg->socket_states == 57103, "incorrect value for socket_states, expected 57103, is %d", check_msg->socket_states); - ck_assert_msg(check_msg->socket_types == 27984, "incorrect value for socket_types, expected 27984, is %d", check_msg->socket_types); + ck_assert_msg(check_msg->index == 181, + "incorrect value for index, expected 181, is %d", + check_msg->index); + ck_assert_msg(check_msg->pid == 19335, + "incorrect value for pid, expected 19335, is %d", + check_msg->pid); + ck_assert_msg(check_msg->recv_queued == 54265, + "incorrect value for recv_queued, expected 54265, is %d", + check_msg->recv_queued); + ck_assert_msg(check_msg->send_queued == 64547, + "incorrect value for send_queued, expected 64547, is %d", + check_msg->send_queued); + ck_assert_msg(check_msg->socket_states == 57103, + "incorrect value for socket_states, expected 57103, is %d", + check_msg->socket_states); + ck_assert_msg(check_msg->socket_types == 27984, + "incorrect value for socket_types, expected 27984, is %d", + check_msg->socket_types); } } END_TEST -Suite* legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues); +Suite *legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_linux_" + "MsgLinuxProcessSocketQueues"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_linux_MsgLinuxSocketUsage.c b/c/test/legacy/auto_check_sbp_linux_MsgLinuxSocketUsage.c index f34706867..426204293 100644 --- a/c/test/legacy/auto_check_sbp_linux_MsgLinuxSocketUsage.c +++ b/c/test/legacy/auto_check_sbp_linux_MsgLinuxSocketUsage.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSocketUsage.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSocketUsage.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxSocketUsage ) -{ +START_TEST(test_legacy_auto_check_sbp_linux_MsgLinuxSocketUsage) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxSocketUsage ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,27 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxSocketUsage ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x7f05, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x7f05, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x7f05, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x7f05, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,127,114,138,72,13,196,69,173,67,222,186,181,246,154,251,17,224,179,26,169,177,90,149,213,214,6,126,64,120,185,84,131,200,111,32,141,217,209,52,14,190,147,159,246,141,122,212,119,131,30,120,47,25,109,154,65,132,164,39,30,30,175,8,44,28,111,236,240,176,74,159,129,154,153,162,229,130,154, }; + u8 encoded_frame[] = { + 85, 5, 127, 114, 138, 72, 13, 196, 69, 173, 67, 222, 186, 181, + 246, 154, 251, 17, 224, 179, 26, 169, 177, 90, 149, 213, 214, 6, + 126, 64, 120, 185, 84, 131, 200, 111, 32, 141, 217, 209, 52, 14, + 190, 147, 159, 246, 141, 122, 212, 119, 131, 30, 120, 47, 25, 109, + 154, 65, 132, 164, 39, 30, 30, 175, 8, 44, 28, 111, 236, 240, + 176, 74, 159, 129, 154, 153, 162, 229, 130, 154, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_linux_socket_usage_t* test_msg = ( msg_linux_socket_usage_t* )test_msg_storage; + msg_linux_socket_usage_t *test_msg = + (msg_linux_socket_usage_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->avg_queue_depth = 2907030541; test_msg->max_queue_depth = 3048922691; @@ -305,96 +312,207 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxSocketUsage ) test_msg_len += sizeof(test_msg->socket_type_counts[0]); } test_msg->socket_type_counts[15] = 58786; - sbp_payload_send(&sbp_state, 0x7f05, 35442, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x7f05, 35442, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35442, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35442, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x7f05, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_linux_socket_usage_t* check_msg = ( msg_linux_socket_usage_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_linux_socket_usage_t *check_msg = + (msg_linux_socket_usage_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->avg_queue_depth == 2907030541, "incorrect value for avg_queue_depth, expected 2907030541, is %d", check_msg->avg_queue_depth); - ck_assert_msg(check_msg->max_queue_depth == 3048922691, "incorrect value for max_queue_depth, expected 3048922691, is %d", check_msg->max_queue_depth); - ck_assert_msg(check_msg->socket_state_counts[0] == 39670, "incorrect value for socket_state_counts[0], expected 39670, is %d", check_msg->socket_state_counts[0]); - ck_assert_msg(check_msg->socket_state_counts[1] == 4603, "incorrect value for socket_state_counts[1], expected 4603, is %d", check_msg->socket_state_counts[1]); - ck_assert_msg(check_msg->socket_state_counts[2] == 46048, "incorrect value for socket_state_counts[2], expected 46048, is %d", check_msg->socket_state_counts[2]); - ck_assert_msg(check_msg->socket_state_counts[3] == 43290, "incorrect value for socket_state_counts[3], expected 43290, is %d", check_msg->socket_state_counts[3]); - ck_assert_msg(check_msg->socket_state_counts[4] == 23217, "incorrect value for socket_state_counts[4], expected 23217, is %d", check_msg->socket_state_counts[4]); - ck_assert_msg(check_msg->socket_state_counts[5] == 54677, "incorrect value for socket_state_counts[5], expected 54677, is %d", check_msg->socket_state_counts[5]); - ck_assert_msg(check_msg->socket_state_counts[6] == 1750, "incorrect value for socket_state_counts[6], expected 1750, is %d", check_msg->socket_state_counts[6]); - ck_assert_msg(check_msg->socket_state_counts[7] == 16510, "incorrect value for socket_state_counts[7], expected 16510, is %d", check_msg->socket_state_counts[7]); - ck_assert_msg(check_msg->socket_state_counts[8] == 47480, "incorrect value for socket_state_counts[8], expected 47480, is %d", check_msg->socket_state_counts[8]); - ck_assert_msg(check_msg->socket_state_counts[9] == 33620, "incorrect value for socket_state_counts[9], expected 33620, is %d", check_msg->socket_state_counts[9]); - ck_assert_msg(check_msg->socket_state_counts[10] == 28616, "incorrect value for socket_state_counts[10], expected 28616, is %d", check_msg->socket_state_counts[10]); - ck_assert_msg(check_msg->socket_state_counts[11] == 36128, "incorrect value for socket_state_counts[11], expected 36128, is %d", check_msg->socket_state_counts[11]); - ck_assert_msg(check_msg->socket_state_counts[12] == 53721, "incorrect value for socket_state_counts[12], expected 53721, is %d", check_msg->socket_state_counts[12]); - ck_assert_msg(check_msg->socket_state_counts[13] == 3636, "incorrect value for socket_state_counts[13], expected 3636, is %d", check_msg->socket_state_counts[13]); - ck_assert_msg(check_msg->socket_state_counts[14] == 37822, "incorrect value for socket_state_counts[14], expected 37822, is %d", check_msg->socket_state_counts[14]); - ck_assert_msg(check_msg->socket_state_counts[15] == 63135, "incorrect value for socket_state_counts[15], expected 63135, is %d", check_msg->socket_state_counts[15]); - ck_assert_msg(check_msg->socket_type_counts[0] == 31373, "incorrect value for socket_type_counts[0], expected 31373, is %d", check_msg->socket_type_counts[0]); - ck_assert_msg(check_msg->socket_type_counts[1] == 30676, "incorrect value for socket_type_counts[1], expected 30676, is %d", check_msg->socket_type_counts[1]); - ck_assert_msg(check_msg->socket_type_counts[2] == 7811, "incorrect value for socket_type_counts[2], expected 7811, is %d", check_msg->socket_type_counts[2]); - ck_assert_msg(check_msg->socket_type_counts[3] == 12152, "incorrect value for socket_type_counts[3], expected 12152, is %d", check_msg->socket_type_counts[3]); - ck_assert_msg(check_msg->socket_type_counts[4] == 27929, "incorrect value for socket_type_counts[4], expected 27929, is %d", check_msg->socket_type_counts[4]); - ck_assert_msg(check_msg->socket_type_counts[5] == 16794, "incorrect value for socket_type_counts[5], expected 16794, is %d", check_msg->socket_type_counts[5]); - ck_assert_msg(check_msg->socket_type_counts[6] == 42116, "incorrect value for socket_type_counts[6], expected 42116, is %d", check_msg->socket_type_counts[6]); - ck_assert_msg(check_msg->socket_type_counts[7] == 7719, "incorrect value for socket_type_counts[7], expected 7719, is %d", check_msg->socket_type_counts[7]); - ck_assert_msg(check_msg->socket_type_counts[8] == 44830, "incorrect value for socket_type_counts[8], expected 44830, is %d", check_msg->socket_type_counts[8]); - ck_assert_msg(check_msg->socket_type_counts[9] == 11272, "incorrect value for socket_type_counts[9], expected 11272, is %d", check_msg->socket_type_counts[9]); - ck_assert_msg(check_msg->socket_type_counts[10] == 28444, "incorrect value for socket_type_counts[10], expected 28444, is %d", check_msg->socket_type_counts[10]); - ck_assert_msg(check_msg->socket_type_counts[11] == 61676, "incorrect value for socket_type_counts[11], expected 61676, is %d", check_msg->socket_type_counts[11]); - ck_assert_msg(check_msg->socket_type_counts[12] == 19120, "incorrect value for socket_type_counts[12], expected 19120, is %d", check_msg->socket_type_counts[12]); - ck_assert_msg(check_msg->socket_type_counts[13] == 33183, "incorrect value for socket_type_counts[13], expected 33183, is %d", check_msg->socket_type_counts[13]); - ck_assert_msg(check_msg->socket_type_counts[14] == 39322, "incorrect value for socket_type_counts[14], expected 39322, is %d", check_msg->socket_type_counts[14]); - ck_assert_msg(check_msg->socket_type_counts[15] == 58786, "incorrect value for socket_type_counts[15], expected 58786, is %d", check_msg->socket_type_counts[15]); + ck_assert_msg( + check_msg->avg_queue_depth == 2907030541, + "incorrect value for avg_queue_depth, expected 2907030541, is %d", + check_msg->avg_queue_depth); + ck_assert_msg( + check_msg->max_queue_depth == 3048922691, + "incorrect value for max_queue_depth, expected 3048922691, is %d", + check_msg->max_queue_depth); + ck_assert_msg( + check_msg->socket_state_counts[0] == 39670, + "incorrect value for socket_state_counts[0], expected 39670, is %d", + check_msg->socket_state_counts[0]); + ck_assert_msg( + check_msg->socket_state_counts[1] == 4603, + "incorrect value for socket_state_counts[1], expected 4603, is %d", + check_msg->socket_state_counts[1]); + ck_assert_msg( + check_msg->socket_state_counts[2] == 46048, + "incorrect value for socket_state_counts[2], expected 46048, is %d", + check_msg->socket_state_counts[2]); + ck_assert_msg( + check_msg->socket_state_counts[3] == 43290, + "incorrect value for socket_state_counts[3], expected 43290, is %d", + check_msg->socket_state_counts[3]); + ck_assert_msg( + check_msg->socket_state_counts[4] == 23217, + "incorrect value for socket_state_counts[4], expected 23217, is %d", + check_msg->socket_state_counts[4]); + ck_assert_msg( + check_msg->socket_state_counts[5] == 54677, + "incorrect value for socket_state_counts[5], expected 54677, is %d", + check_msg->socket_state_counts[5]); + ck_assert_msg( + check_msg->socket_state_counts[6] == 1750, + "incorrect value for socket_state_counts[6], expected 1750, is %d", + check_msg->socket_state_counts[6]); + ck_assert_msg( + check_msg->socket_state_counts[7] == 16510, + "incorrect value for socket_state_counts[7], expected 16510, is %d", + check_msg->socket_state_counts[7]); + ck_assert_msg( + check_msg->socket_state_counts[8] == 47480, + "incorrect value for socket_state_counts[8], expected 47480, is %d", + check_msg->socket_state_counts[8]); + ck_assert_msg( + check_msg->socket_state_counts[9] == 33620, + "incorrect value for socket_state_counts[9], expected 33620, is %d", + check_msg->socket_state_counts[9]); + ck_assert_msg( + check_msg->socket_state_counts[10] == 28616, + "incorrect value for socket_state_counts[10], expected 28616, is %d", + check_msg->socket_state_counts[10]); + ck_assert_msg( + check_msg->socket_state_counts[11] == 36128, + "incorrect value for socket_state_counts[11], expected 36128, is %d", + check_msg->socket_state_counts[11]); + ck_assert_msg( + check_msg->socket_state_counts[12] == 53721, + "incorrect value for socket_state_counts[12], expected 53721, is %d", + check_msg->socket_state_counts[12]); + ck_assert_msg( + check_msg->socket_state_counts[13] == 3636, + "incorrect value for socket_state_counts[13], expected 3636, is %d", + check_msg->socket_state_counts[13]); + ck_assert_msg( + check_msg->socket_state_counts[14] == 37822, + "incorrect value for socket_state_counts[14], expected 37822, is %d", + check_msg->socket_state_counts[14]); + ck_assert_msg( + check_msg->socket_state_counts[15] == 63135, + "incorrect value for socket_state_counts[15], expected 63135, is %d", + check_msg->socket_state_counts[15]); + ck_assert_msg( + check_msg->socket_type_counts[0] == 31373, + "incorrect value for socket_type_counts[0], expected 31373, is %d", + check_msg->socket_type_counts[0]); + ck_assert_msg( + check_msg->socket_type_counts[1] == 30676, + "incorrect value for socket_type_counts[1], expected 30676, is %d", + check_msg->socket_type_counts[1]); + ck_assert_msg( + check_msg->socket_type_counts[2] == 7811, + "incorrect value for socket_type_counts[2], expected 7811, is %d", + check_msg->socket_type_counts[2]); + ck_assert_msg( + check_msg->socket_type_counts[3] == 12152, + "incorrect value for socket_type_counts[3], expected 12152, is %d", + check_msg->socket_type_counts[3]); + ck_assert_msg( + check_msg->socket_type_counts[4] == 27929, + "incorrect value for socket_type_counts[4], expected 27929, is %d", + check_msg->socket_type_counts[4]); + ck_assert_msg( + check_msg->socket_type_counts[5] == 16794, + "incorrect value for socket_type_counts[5], expected 16794, is %d", + check_msg->socket_type_counts[5]); + ck_assert_msg( + check_msg->socket_type_counts[6] == 42116, + "incorrect value for socket_type_counts[6], expected 42116, is %d", + check_msg->socket_type_counts[6]); + ck_assert_msg( + check_msg->socket_type_counts[7] == 7719, + "incorrect value for socket_type_counts[7], expected 7719, is %d", + check_msg->socket_type_counts[7]); + ck_assert_msg( + check_msg->socket_type_counts[8] == 44830, + "incorrect value for socket_type_counts[8], expected 44830, is %d", + check_msg->socket_type_counts[8]); + ck_assert_msg( + check_msg->socket_type_counts[9] == 11272, + "incorrect value for socket_type_counts[9], expected 11272, is %d", + check_msg->socket_type_counts[9]); + ck_assert_msg( + check_msg->socket_type_counts[10] == 28444, + "incorrect value for socket_type_counts[10], expected 28444, is %d", + check_msg->socket_type_counts[10]); + ck_assert_msg( + check_msg->socket_type_counts[11] == 61676, + "incorrect value for socket_type_counts[11], expected 61676, is %d", + check_msg->socket_type_counts[11]); + ck_assert_msg( + check_msg->socket_type_counts[12] == 19120, + "incorrect value for socket_type_counts[12], expected 19120, is %d", + check_msg->socket_type_counts[12]); + ck_assert_msg( + check_msg->socket_type_counts[13] == 33183, + "incorrect value for socket_type_counts[13], expected 33183, is %d", + check_msg->socket_type_counts[13]); + ck_assert_msg( + check_msg->socket_type_counts[14] == 39322, + "incorrect value for socket_type_counts[14], expected 39322, is %d", + check_msg->socket_type_counts[14]); + ck_assert_msg( + check_msg->socket_type_counts[15] == 58786, + "incorrect value for socket_type_counts[15], expected 58786, is %d", + check_msg->socket_type_counts[15]); } } END_TEST -Suite* legacy_auto_check_sbp_linux_MsgLinuxSocketUsage_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_linux_MsgLinuxSocketUsage"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxSocketUsage"); +Suite *legacy_auto_check_sbp_linux_MsgLinuxSocketUsage_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_linux_MsgLinuxSocketUsage"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxSocketUsage"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_linux_MsgLinuxSocketUsage); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_linux_MsgLinuxSysState.c b/c/test/legacy/auto_check_sbp_linux_MsgLinuxSysState.c index 4ffee870c..1ac34edca 100644 --- a/c/test/legacy/auto_check_sbp_linux_MsgLinuxSysState.c +++ b/c/test/legacy/auto_check_sbp_linux_MsgLinuxSysState.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysState.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxSysState ) -{ +START_TEST(test_legacy_auto_check_sbp_linux_MsgLinuxSysState) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxSysState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxSysState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x7f0a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x7f0a, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x7f0a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x7f0a, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,10,127,85,167,15,20,207,125,215,196,71,161,229,250,186,108,30,106,5,9,229,242, }; + u8 encoded_frame[] = { + 85, 10, 127, 85, 167, 15, 20, 207, 125, 215, 196, 71, + 161, 229, 250, 186, 108, 30, 106, 5, 9, 229, 242, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_linux_sys_state_t* test_msg = ( msg_linux_sys_state_t* )test_msg_storage; + msg_linux_sys_state_t *test_msg = (msg_linux_sys_state_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 9; test_msg->mem_total = 53012; @@ -151,70 +153,94 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxSysState ) test_msg->procs_starting = 18372; test_msg->procs_stopping = 58785; test_msg->time = 90840684; - sbp_payload_send(&sbp_state, 0x7f0a, 42837, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x7f0a, 42837, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 42837, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 42837, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x7f0a, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_linux_sys_state_t* check_msg = ( msg_linux_sys_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_linux_sys_state_t *check_msg = + (msg_linux_sys_state_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 9, "incorrect value for flags, expected 9, is %d", check_msg->flags); - ck_assert_msg(check_msg->mem_total == 53012, "incorrect value for mem_total, expected 53012, is %d", check_msg->mem_total); - ck_assert_msg(check_msg->pcpu == 125, "incorrect value for pcpu, expected 125, is %d", check_msg->pcpu); - ck_assert_msg(check_msg->pid_count == 47866, "incorrect value for pid_count, expected 47866, is %d", check_msg->pid_count); - ck_assert_msg(check_msg->pmem == 215, "incorrect value for pmem, expected 215, is %d", check_msg->pmem); - ck_assert_msg(check_msg->procs_starting == 18372, "incorrect value for procs_starting, expected 18372, is %d", check_msg->procs_starting); - ck_assert_msg(check_msg->procs_stopping == 58785, "incorrect value for procs_stopping, expected 58785, is %d", check_msg->procs_stopping); - ck_assert_msg(check_msg->time == 90840684, "incorrect value for time, expected 90840684, is %d", check_msg->time); + ck_assert_msg(check_msg->flags == 9, + "incorrect value for flags, expected 9, is %d", + check_msg->flags); + ck_assert_msg(check_msg->mem_total == 53012, + "incorrect value for mem_total, expected 53012, is %d", + check_msg->mem_total); + ck_assert_msg(check_msg->pcpu == 125, + "incorrect value for pcpu, expected 125, is %d", + check_msg->pcpu); + ck_assert_msg(check_msg->pid_count == 47866, + "incorrect value for pid_count, expected 47866, is %d", + check_msg->pid_count); + ck_assert_msg(check_msg->pmem == 215, + "incorrect value for pmem, expected 215, is %d", + check_msg->pmem); + ck_assert_msg(check_msg->procs_starting == 18372, + "incorrect value for procs_starting, expected 18372, is %d", + check_msg->procs_starting); + ck_assert_msg(check_msg->procs_stopping == 58785, + "incorrect value for procs_stopping, expected 58785, is %d", + check_msg->procs_stopping); + ck_assert_msg(check_msg->time == 90840684, + "incorrect value for time, expected 90840684, is %d", + check_msg->time); } } END_TEST -Suite* legacy_auto_check_sbp_linux_MsgLinuxSysState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_linux_MsgLinuxSysState"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxSysState"); +Suite *legacy_auto_check_sbp_linux_MsgLinuxSysState_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_linux_MsgLinuxSysState"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxSysState"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_linux_MsgLinuxSysState); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_linux_MsgLinuxSysStateDepA.c b/c/test/legacy/auto_check_sbp_linux_MsgLinuxSysStateDepA.c index 849ded92f..ddc1f0b64 100644 --- a/c/test/legacy/auto_check_sbp_linux_MsgLinuxSysStateDepA.c +++ b/c/test/legacy/auto_check_sbp_linux_MsgLinuxSysStateDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysStateDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x7f02, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x7f02, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x7f02, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x7f02, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,127,84,56,10,188,163,211,194,115,71,101,103,124,201,223,223, }; + u8 encoded_frame[] = { + 85, 2, 127, 84, 56, 10, 188, 163, 211, + 194, 115, 71, 101, 103, 124, 201, 223, 223, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_linux_sys_state_dep_a_t* test_msg = ( msg_linux_sys_state_dep_a_t* )test_msg_storage; + msg_linux_sys_state_dep_a_t *test_msg = + (msg_linux_sys_state_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->mem_total = 41916; test_msg->pcpu = 211; @@ -149,68 +152,89 @@ START_TEST( test_legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA ) test_msg->pmem = 194; test_msg->procs_starting = 18291; test_msg->procs_stopping = 26469; - sbp_payload_send(&sbp_state, 0x7f02, 14420, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x7f02, 14420, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 14420, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 14420, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x7f02, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_linux_sys_state_dep_a_t* check_msg = ( msg_linux_sys_state_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_linux_sys_state_dep_a_t *check_msg = + (msg_linux_sys_state_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->mem_total == 41916, "incorrect value for mem_total, expected 41916, is %d", check_msg->mem_total); - ck_assert_msg(check_msg->pcpu == 211, "incorrect value for pcpu, expected 211, is %d", check_msg->pcpu); - ck_assert_msg(check_msg->pid_count == 51580, "incorrect value for pid_count, expected 51580, is %d", check_msg->pid_count); - ck_assert_msg(check_msg->pmem == 194, "incorrect value for pmem, expected 194, is %d", check_msg->pmem); - ck_assert_msg(check_msg->procs_starting == 18291, "incorrect value for procs_starting, expected 18291, is %d", check_msg->procs_starting); - ck_assert_msg(check_msg->procs_stopping == 26469, "incorrect value for procs_stopping, expected 26469, is %d", check_msg->procs_stopping); + ck_assert_msg(check_msg->mem_total == 41916, + "incorrect value for mem_total, expected 41916, is %d", + check_msg->mem_total); + ck_assert_msg(check_msg->pcpu == 211, + "incorrect value for pcpu, expected 211, is %d", + check_msg->pcpu); + ck_assert_msg(check_msg->pid_count == 51580, + "incorrect value for pid_count, expected 51580, is %d", + check_msg->pid_count); + ck_assert_msg(check_msg->pmem == 194, + "incorrect value for pmem, expected 194, is %d", + check_msg->pmem); + ck_assert_msg(check_msg->procs_starting == 18291, + "incorrect value for procs_starting, expected 18291, is %d", + check_msg->procs_starting); + ck_assert_msg(check_msg->procs_stopping == 26469, + "incorrect value for procs_stopping, expected 26469, is %d", + check_msg->procs_stopping); } } END_TEST -Suite* legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA"); +Suite *legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_logging_MsgFwd.c b/c/test/legacy/auto_check_sbp_logging_MsgFwd.c index 778f6142e..6b00070d2 100644 --- a/c/test/legacy/auto_check_sbp_logging_MsgFwd.c +++ b/c/test/legacy/auto_check_sbp_logging_MsgFwd.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/logging/test_MsgFwd.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/logging/test_MsgFwd.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_logging_MsgFwd ) -{ +START_TEST(test_legacy_auto_check_sbp_logging_MsgFwd) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_logging_MsgFwd ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_logging_MsgFwd ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x402, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x402, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x402, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x402, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,4,66,0,18,0,0,86,81,68,47,81,103,65,69,65,65,65,65,65,69,97,103,125,95, }; + u8 encoded_frame[] = { + 85, 2, 4, 66, 0, 18, 0, 0, 86, 81, 68, 47, 81, + 103, 65, 69, 65, 65, 65, 65, 65, 69, 97, 103, 125, 95, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_fwd_t* test_msg = ( msg_fwd_t* )test_msg_storage; + msg_fwd_t *test_msg = (msg_fwd_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->fwd_payload) == 0) { // Cope with variable length arrays @@ -225,80 +227,123 @@ START_TEST( test_legacy_auto_check_sbp_logging_MsgFwd ) test_msg->fwd_payload[15] = 103; test_msg->protocol = 0; test_msg->source = 0; - sbp_payload_send(&sbp_state, 0x402, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x402, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x402, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_fwd_t* check_msg = ( msg_fwd_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_fwd_t *check_msg = (msg_fwd_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->fwd_payload[0] == 86, "incorrect value for fwd_payload[0], expected 86, is %d", check_msg->fwd_payload[0]); - ck_assert_msg(check_msg->fwd_payload[1] == 81, "incorrect value for fwd_payload[1], expected 81, is %d", check_msg->fwd_payload[1]); - ck_assert_msg(check_msg->fwd_payload[2] == 68, "incorrect value for fwd_payload[2], expected 68, is %d", check_msg->fwd_payload[2]); - ck_assert_msg(check_msg->fwd_payload[3] == 47, "incorrect value for fwd_payload[3], expected 47, is %d", check_msg->fwd_payload[3]); - ck_assert_msg(check_msg->fwd_payload[4] == 81, "incorrect value for fwd_payload[4], expected 81, is %d", check_msg->fwd_payload[4]); - ck_assert_msg(check_msg->fwd_payload[5] == 103, "incorrect value for fwd_payload[5], expected 103, is %d", check_msg->fwd_payload[5]); - ck_assert_msg(check_msg->fwd_payload[6] == 65, "incorrect value for fwd_payload[6], expected 65, is %d", check_msg->fwd_payload[6]); - ck_assert_msg(check_msg->fwd_payload[7] == 69, "incorrect value for fwd_payload[7], expected 69, is %d", check_msg->fwd_payload[7]); - ck_assert_msg(check_msg->fwd_payload[8] == 65, "incorrect value for fwd_payload[8], expected 65, is %d", check_msg->fwd_payload[8]); - ck_assert_msg(check_msg->fwd_payload[9] == 65, "incorrect value for fwd_payload[9], expected 65, is %d", check_msg->fwd_payload[9]); - ck_assert_msg(check_msg->fwd_payload[10] == 65, "incorrect value for fwd_payload[10], expected 65, is %d", check_msg->fwd_payload[10]); - ck_assert_msg(check_msg->fwd_payload[11] == 65, "incorrect value for fwd_payload[11], expected 65, is %d", check_msg->fwd_payload[11]); - ck_assert_msg(check_msg->fwd_payload[12] == 65, "incorrect value for fwd_payload[12], expected 65, is %d", check_msg->fwd_payload[12]); - ck_assert_msg(check_msg->fwd_payload[13] == 69, "incorrect value for fwd_payload[13], expected 69, is %d", check_msg->fwd_payload[13]); - ck_assert_msg(check_msg->fwd_payload[14] == 97, "incorrect value for fwd_payload[14], expected 97, is %d", check_msg->fwd_payload[14]); - ck_assert_msg(check_msg->fwd_payload[15] == 103, "incorrect value for fwd_payload[15], expected 103, is %d", check_msg->fwd_payload[15]); - ck_assert_msg(check_msg->protocol == 0, "incorrect value for protocol, expected 0, is %d", check_msg->protocol); - ck_assert_msg(check_msg->source == 0, "incorrect value for source, expected 0, is %d", check_msg->source); + ck_assert_msg(check_msg->fwd_payload[0] == 86, + "incorrect value for fwd_payload[0], expected 86, is %d", + check_msg->fwd_payload[0]); + ck_assert_msg(check_msg->fwd_payload[1] == 81, + "incorrect value for fwd_payload[1], expected 81, is %d", + check_msg->fwd_payload[1]); + ck_assert_msg(check_msg->fwd_payload[2] == 68, + "incorrect value for fwd_payload[2], expected 68, is %d", + check_msg->fwd_payload[2]); + ck_assert_msg(check_msg->fwd_payload[3] == 47, + "incorrect value for fwd_payload[3], expected 47, is %d", + check_msg->fwd_payload[3]); + ck_assert_msg(check_msg->fwd_payload[4] == 81, + "incorrect value for fwd_payload[4], expected 81, is %d", + check_msg->fwd_payload[4]); + ck_assert_msg(check_msg->fwd_payload[5] == 103, + "incorrect value for fwd_payload[5], expected 103, is %d", + check_msg->fwd_payload[5]); + ck_assert_msg(check_msg->fwd_payload[6] == 65, + "incorrect value for fwd_payload[6], expected 65, is %d", + check_msg->fwd_payload[6]); + ck_assert_msg(check_msg->fwd_payload[7] == 69, + "incorrect value for fwd_payload[7], expected 69, is %d", + check_msg->fwd_payload[7]); + ck_assert_msg(check_msg->fwd_payload[8] == 65, + "incorrect value for fwd_payload[8], expected 65, is %d", + check_msg->fwd_payload[8]); + ck_assert_msg(check_msg->fwd_payload[9] == 65, + "incorrect value for fwd_payload[9], expected 65, is %d", + check_msg->fwd_payload[9]); + ck_assert_msg(check_msg->fwd_payload[10] == 65, + "incorrect value for fwd_payload[10], expected 65, is %d", + check_msg->fwd_payload[10]); + ck_assert_msg(check_msg->fwd_payload[11] == 65, + "incorrect value for fwd_payload[11], expected 65, is %d", + check_msg->fwd_payload[11]); + ck_assert_msg(check_msg->fwd_payload[12] == 65, + "incorrect value for fwd_payload[12], expected 65, is %d", + check_msg->fwd_payload[12]); + ck_assert_msg(check_msg->fwd_payload[13] == 69, + "incorrect value for fwd_payload[13], expected 69, is %d", + check_msg->fwd_payload[13]); + ck_assert_msg(check_msg->fwd_payload[14] == 97, + "incorrect value for fwd_payload[14], expected 97, is %d", + check_msg->fwd_payload[14]); + ck_assert_msg(check_msg->fwd_payload[15] == 103, + "incorrect value for fwd_payload[15], expected 103, is %d", + check_msg->fwd_payload[15]); + ck_assert_msg(check_msg->protocol == 0, + "incorrect value for protocol, expected 0, is %d", + check_msg->protocol); + ck_assert_msg(check_msg->source == 0, + "incorrect value for source, expected 0, is %d", + check_msg->source); } } END_TEST -Suite* legacy_auto_check_sbp_logging_MsgFwd_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_logging_MsgFwd"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_logging_MsgFwd"); +Suite *legacy_auto_check_sbp_logging_MsgFwd_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_logging_MsgFwd"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_logging_MsgFwd"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_logging_MsgFwd); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_logging_MsgLog.c b/c/test/legacy/auto_check_sbp_logging_MsgLog.c index afeb2bf8b..be2a97c94 100644 --- a/c/test/legacy/auto_check_sbp_logging_MsgLog.c +++ b/c/test/legacy/auto_check_sbp_logging_MsgLog.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/logging/test_MsgLog.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/logging/test_MsgLog.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_logging_MsgLog ) -{ +START_TEST(test_legacy_auto_check_sbp_logging_MsgLog) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_logging_MsgLog ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,87 +128,122 @@ START_TEST( test_legacy_auto_check_sbp_logging_MsgLog ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x0401, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x0401, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x0401, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x0401, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,4,10,9,44,6,70,105,108,116,101,114,101,100,32,97,108,108,32,111,98,115,32,102,114,111,109,32,50,51,49,52,32,97,116,32,116,111,119,32,56,51,46,53,51,57,48,49,57,177,163, }; + u8 encoded_frame[] = { + 85, 1, 4, 10, 9, 44, 6, 70, 105, 108, 116, 101, 114, + 101, 100, 32, 97, 108, 108, 32, 111, 98, 115, 32, 102, 114, + 111, 109, 32, 50, 51, 49, 52, 32, 97, 116, 32, 116, 111, + 119, 32, 56, 51, 46, 53, 51, 57, 48, 49, 57, 177, 163, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_log_t* test_msg = ( msg_log_t* )test_msg_storage; + msg_log_t *test_msg = (msg_log_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->level = 6; { - const char assign_string[] = { (char)70,(char)105,(char)108,(char)116,(char)101,(char)114,(char)101,(char)100,(char)32,(char)97,(char)108,(char)108,(char)32,(char)111,(char)98,(char)115,(char)32,(char)102,(char)114,(char)111,(char)109,(char)32,(char)50,(char)51,(char)49,(char)52,(char)32,(char)97,(char)116,(char)32,(char)116,(char)111,(char)119,(char)32,(char)56,(char)51,(char)46,(char)53,(char)51,(char)57,(char)48,(char)49,(char)57 }; + const char assign_string[] = { + (char)70, (char)105, (char)108, (char)116, (char)101, (char)114, + (char)101, (char)100, (char)32, (char)97, (char)108, (char)108, + (char)32, (char)111, (char)98, (char)115, (char)32, (char)102, + (char)114, (char)111, (char)109, (char)32, (char)50, (char)51, + (char)49, (char)52, (char)32, (char)97, (char)116, (char)32, + (char)116, (char)111, (char)119, (char)32, (char)56, (char)51, + (char)46, (char)53, (char)51, (char)57, (char)48, (char)49, + (char)57}; memcpy(test_msg->text, assign_string, sizeof(assign_string)); if (sizeof(test_msg->text) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0x0401, 2314, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x0401, 2314, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 2314, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 2314, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x0401, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_log_t* check_msg = ( msg_log_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_log_t *check_msg = (msg_log_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->level == 6, "incorrect value for level, expected 6, is %d", check_msg->level); + ck_assert_msg(check_msg->level == 6, + "incorrect value for level, expected 6, is %d", + check_msg->level); { - const char check_string[] = { (char)70,(char)105,(char)108,(char)116,(char)101,(char)114,(char)101,(char)100,(char)32,(char)97,(char)108,(char)108,(char)32,(char)111,(char)98,(char)115,(char)32,(char)102,(char)114,(char)111,(char)109,(char)32,(char)50,(char)51,(char)49,(char)52,(char)32,(char)97,(char)116,(char)32,(char)116,(char)111,(char)119,(char)32,(char)56,(char)51,(char)46,(char)53,(char)51,(char)57,(char)48,(char)49,(char)57 }; - ck_assert_msg(memcmp(check_msg->text, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->text, expected string '%s', is '%s'", check_string, check_msg->text); + const char check_string[] = { + (char)70, (char)105, (char)108, (char)116, (char)101, (char)114, + (char)101, (char)100, (char)32, (char)97, (char)108, (char)108, + (char)32, (char)111, (char)98, (char)115, (char)32, (char)102, + (char)114, (char)111, (char)109, (char)32, (char)50, (char)51, + (char)49, (char)52, (char)32, (char)97, (char)116, (char)32, + (char)116, (char)111, (char)119, (char)32, (char)56, (char)51, + (char)46, (char)53, (char)51, (char)57, (char)48, (char)49, + (char)57}; + ck_assert_msg( + memcmp(check_msg->text, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->text, expected string '%s', is '%s'", + check_string, check_msg->text); } } } END_TEST -Suite* legacy_auto_check_sbp_logging_MsgLog_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_logging_MsgLog"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_logging_MsgLog"); +Suite *legacy_auto_check_sbp_logging_MsgLog_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_logging_MsgLog"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_logging_MsgLog"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_logging_MsgLog); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_logging_MsgPrintDep.c b/c/test/legacy/auto_check_sbp_logging_MsgPrintDep.c index 20fee11e8..2cfdaf411 100644 --- a/c/test/legacy/auto_check_sbp_logging_MsgPrintDep.c +++ b/c/test/legacy/auto_check_sbp_logging_MsgPrintDep.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/logging/test_MsgPrintDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/logging/test_MsgPrintDep.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_logging_MsgPrintDep ) -{ +START_TEST(test_legacy_auto_check_sbp_logging_MsgPrintDep) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_logging_MsgPrintDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,82 +128,115 @@ START_TEST( test_legacy_auto_check_sbp_logging_MsgPrintDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x10, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x10, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x10, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x10, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,16,0,34,34,43,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,49,53,32,102,111,117,110,100,32,64,32,45,50,52,57,55,32,72,122,44,32,50,48,32,83,78,82,10,116,103, }; + u8 encoded_frame[] = { + 85, 16, 0, 34, 34, 43, 73, 78, 70, 79, 58, 32, 97, + 99, 113, 58, 32, 80, 82, 78, 32, 49, 53, 32, 102, 111, + 117, 110, 100, 32, 64, 32, 45, 50, 52, 57, 55, 32, 72, + 122, 44, 32, 50, 48, 32, 83, 78, 82, 10, 116, 103, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_print_dep_t* test_msg = ( msg_print_dep_t* )test_msg_storage; + msg_print_dep_t* test_msg = (msg_print_dep_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)49,(char)53,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)45,(char)50,(char)52,(char)57,(char)55,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)48,(char)32,(char)83,(char)78,(char)82,(char)10 }; + const char assign_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)49, (char)53, (char)32, + (char)102, (char)111, (char)117, (char)110, (char)100, (char)32, + (char)64, (char)32, (char)45, (char)50, (char)52, (char)57, + (char)55, (char)32, (char)72, (char)122, (char)44, (char)32, + (char)50, (char)48, (char)32, (char)83, (char)78, (char)82, + (char)10}; memcpy(test_msg->text, assign_string, sizeof(assign_string)); if (sizeof(test_msg->text) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0x10, 8738, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x10, 8738, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 8738, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 8738, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x10, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_print_dep_t* check_msg = ( msg_print_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_print_dep_t* check_msg = (msg_print_dep_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)49,(char)53,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)45,(char)50,(char)52,(char)57,(char)55,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)48,(char)32,(char)83,(char)78,(char)82,(char)10 }; - ck_assert_msg(memcmp(check_msg->text, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->text, expected string '%s', is '%s'", check_string, check_msg->text); + const char check_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)49, (char)53, (char)32, + (char)102, (char)111, (char)117, (char)110, (char)100, (char)32, + (char)64, (char)32, (char)45, (char)50, (char)52, (char)57, + (char)55, (char)32, (char)72, (char)122, (char)44, (char)32, + (char)50, (char)48, (char)32, (char)83, (char)78, (char)82, + (char)10}; + ck_assert_msg( + memcmp(check_msg->text, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->text, expected string '%s', is '%s'", + check_string, check_msg->text); } } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -214,82 +244,113 @@ START_TEST( test_legacy_auto_check_sbp_logging_MsgPrintDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x10, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x10, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x10, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x10, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,16,0,34,34,42,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,51,49,32,102,111,117,110,100,32,64,32,52,50,52,53,32,72,122,44,32,50,49,32,83,78,82,10,140,43, }; + u8 encoded_frame[] = { + 85, 16, 0, 34, 34, 42, 73, 78, 70, 79, 58, 32, 97, + 99, 113, 58, 32, 80, 82, 78, 32, 51, 49, 32, 102, 111, + 117, 110, 100, 32, 64, 32, 52, 50, 52, 53, 32, 72, 122, + 44, 32, 50, 49, 32, 83, 78, 82, 10, 140, 43, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_print_dep_t* test_msg = ( msg_print_dep_t* )test_msg_storage; + msg_print_dep_t* test_msg = (msg_print_dep_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)51,(char)49,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)52,(char)50,(char)52,(char)53,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)49,(char)32,(char)83,(char)78,(char)82,(char)10 }; + const char assign_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)51, (char)49, (char)32, + (char)102, (char)111, (char)117, (char)110, (char)100, (char)32, + (char)64, (char)32, (char)52, (char)50, (char)52, (char)53, + (char)32, (char)72, (char)122, (char)44, (char)32, (char)50, + (char)49, (char)32, (char)83, (char)78, (char)82, (char)10}; memcpy(test_msg->text, assign_string, sizeof(assign_string)); if (sizeof(test_msg->text) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0x10, 8738, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x10, 8738, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 8738, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 8738, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x10, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_print_dep_t* check_msg = ( msg_print_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_print_dep_t* check_msg = (msg_print_dep_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)51,(char)49,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)52,(char)50,(char)52,(char)53,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)49,(char)32,(char)83,(char)78,(char)82,(char)10 }; - ck_assert_msg(memcmp(check_msg->text, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->text, expected string '%s', is '%s'", check_string, check_msg->text); + const char check_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)51, (char)49, (char)32, + (char)102, (char)111, (char)117, (char)110, (char)100, (char)32, + (char)64, (char)32, (char)52, (char)50, (char)52, (char)53, + (char)32, (char)72, (char)122, (char)44, (char)32, (char)50, + (char)49, (char)32, (char)83, (char)78, (char)82, (char)10}; + ck_assert_msg( + memcmp(check_msg->text, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->text, expected string '%s', is '%s'", + check_string, check_msg->text); } } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -297,82 +358,110 @@ START_TEST( test_legacy_auto_check_sbp_logging_MsgPrintDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x10, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x10, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x10, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x10, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,16,0,34,34,35,73,78,70,79,58,32,68,105,115,97,98,108,105,110,103,32,99,104,97,110,110,101,108,32,48,32,40,80,82,78,32,49,49,41,10,23,143, }; + u8 encoded_frame[] = { + 85, 16, 0, 34, 34, 35, 73, 78, 70, 79, 58, 32, 68, 105, 115, + 97, 98, 108, 105, 110, 103, 32, 99, 104, 97, 110, 110, 101, 108, 32, + 48, 32, 40, 80, 82, 78, 32, 49, 49, 41, 10, 23, 143, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_print_dep_t* test_msg = ( msg_print_dep_t* )test_msg_storage; + msg_print_dep_t* test_msg = (msg_print_dep_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)68,(char)105,(char)115,(char)97,(char)98,(char)108,(char)105,(char)110,(char)103,(char)32,(char)99,(char)104,(char)97,(char)110,(char)110,(char)101,(char)108,(char)32,(char)48,(char)32,(char)40,(char)80,(char)82,(char)78,(char)32,(char)49,(char)49,(char)41,(char)10 }; + const char assign_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)68, (char)105, (char)115, (char)97, (char)98, (char)108, + (char)105, (char)110, (char)103, (char)32, (char)99, (char)104, + (char)97, (char)110, (char)110, (char)101, (char)108, (char)32, + (char)48, (char)32, (char)40, (char)80, (char)82, (char)78, + (char)32, (char)49, (char)49, (char)41, (char)10}; memcpy(test_msg->text, assign_string, sizeof(assign_string)); if (sizeof(test_msg->text) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0x10, 8738, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x10, 8738, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 8738, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 8738, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x10, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_print_dep_t* check_msg = ( msg_print_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_print_dep_t* check_msg = (msg_print_dep_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)68,(char)105,(char)115,(char)97,(char)98,(char)108,(char)105,(char)110,(char)103,(char)32,(char)99,(char)104,(char)97,(char)110,(char)110,(char)101,(char)108,(char)32,(char)48,(char)32,(char)40,(char)80,(char)82,(char)78,(char)32,(char)49,(char)49,(char)41,(char)10 }; - ck_assert_msg(memcmp(check_msg->text, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->text, expected string '%s', is '%s'", check_string, check_msg->text); + const char check_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)68, (char)105, (char)115, (char)97, (char)98, (char)108, + (char)105, (char)110, (char)103, (char)32, (char)99, (char)104, + (char)97, (char)110, (char)110, (char)101, (char)108, (char)32, + (char)48, (char)32, (char)40, (char)80, (char)82, (char)78, + (char)32, (char)49, (char)49, (char)41, (char)10}; + ck_assert_msg( + memcmp(check_msg->text, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->text, expected string '%s', is '%s'", + check_string, check_msg->text); } } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -380,82 +469,113 @@ START_TEST( test_legacy_auto_check_sbp_logging_MsgPrintDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x10, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x10, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x10, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x10, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,16,0,34,34,41,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,50,32,102,111,117,110,100,32,64,32,51,57,57,54,32,72,122,44,32,50,48,32,83,78,82,10,239,48, }; + u8 encoded_frame[] = { + 85, 16, 0, 34, 34, 41, 73, 78, 70, 79, 58, 32, 97, + 99, 113, 58, 32, 80, 82, 78, 32, 50, 32, 102, 111, 117, + 110, 100, 32, 64, 32, 51, 57, 57, 54, 32, 72, 122, 44, + 32, 50, 48, 32, 83, 78, 82, 10, 239, 48, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_print_dep_t* test_msg = ( msg_print_dep_t* )test_msg_storage; + msg_print_dep_t* test_msg = (msg_print_dep_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)50,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)51,(char)57,(char)57,(char)54,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)48,(char)32,(char)83,(char)78,(char)82,(char)10 }; + const char assign_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)50, (char)32, (char)102, + (char)111, (char)117, (char)110, (char)100, (char)32, (char)64, + (char)32, (char)51, (char)57, (char)57, (char)54, (char)32, + (char)72, (char)122, (char)44, (char)32, (char)50, (char)48, + (char)32, (char)83, (char)78, (char)82, (char)10}; memcpy(test_msg->text, assign_string, sizeof(assign_string)); if (sizeof(test_msg->text) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0x10, 8738, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x10, 8738, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 8738, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 8738, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x10, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_print_dep_t* check_msg = ( msg_print_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_print_dep_t* check_msg = (msg_print_dep_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)50,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)51,(char)57,(char)57,(char)54,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)48,(char)32,(char)83,(char)78,(char)82,(char)10 }; - ck_assert_msg(memcmp(check_msg->text, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->text, expected string '%s', is '%s'", check_string, check_msg->text); + const char check_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)50, (char)32, (char)102, + (char)111, (char)117, (char)110, (char)100, (char)32, (char)64, + (char)32, (char)51, (char)57, (char)57, (char)54, (char)32, + (char)72, (char)122, (char)44, (char)32, (char)50, (char)48, + (char)32, (char)83, (char)78, (char)82, (char)10}; + ck_assert_msg( + memcmp(check_msg->text, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->text, expected string '%s', is '%s'", + check_string, check_msg->text); } } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -463,82 +583,113 @@ START_TEST( test_legacy_auto_check_sbp_logging_MsgPrintDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x10, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x10, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x10, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x10, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,16,0,34,34,42,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,52,32,102,111,117,110,100,32,64,32,45,55,52,57,50,32,72,122,44,32,50,48,32,83,78,82,10,47,248, }; + u8 encoded_frame[] = { + 85, 16, 0, 34, 34, 42, 73, 78, 70, 79, 58, 32, 97, + 99, 113, 58, 32, 80, 82, 78, 32, 52, 32, 102, 111, 117, + 110, 100, 32, 64, 32, 45, 55, 52, 57, 50, 32, 72, 122, + 44, 32, 50, 48, 32, 83, 78, 82, 10, 47, 248, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_print_dep_t* test_msg = ( msg_print_dep_t* )test_msg_storage; + msg_print_dep_t* test_msg = (msg_print_dep_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)52,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)45,(char)55,(char)52,(char)57,(char)50,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)48,(char)32,(char)83,(char)78,(char)82,(char)10 }; + const char assign_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)52, (char)32, (char)102, + (char)111, (char)117, (char)110, (char)100, (char)32, (char)64, + (char)32, (char)45, (char)55, (char)52, (char)57, (char)50, + (char)32, (char)72, (char)122, (char)44, (char)32, (char)50, + (char)48, (char)32, (char)83, (char)78, (char)82, (char)10}; memcpy(test_msg->text, assign_string, sizeof(assign_string)); if (sizeof(test_msg->text) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0x10, 8738, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x10, 8738, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 8738, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 8738, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x10, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_print_dep_t* check_msg = ( msg_print_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_print_dep_t* check_msg = (msg_print_dep_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)52,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)45,(char)55,(char)52,(char)57,(char)50,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)48,(char)32,(char)83,(char)78,(char)82,(char)10 }; - ck_assert_msg(memcmp(check_msg->text, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->text, expected string '%s', is '%s'", check_string, check_msg->text); + const char check_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)52, (char)32, (char)102, + (char)111, (char)117, (char)110, (char)100, (char)32, (char)64, + (char)32, (char)45, (char)55, (char)52, (char)57, (char)50, + (char)32, (char)72, (char)122, (char)44, (char)32, (char)50, + (char)48, (char)32, (char)83, (char)78, (char)82, (char)10}; + ck_assert_msg( + memcmp(check_msg->text, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->text, expected string '%s', is '%s'", + check_string, check_msg->text); } } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -546,85 +697,113 @@ START_TEST( test_legacy_auto_check_sbp_logging_MsgPrintDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x10, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x10, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x10, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x10, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,16,0,34,34,35,73,78,70,79,58,32,68,105,115,97,98,108,105,110,103,32,99,104,97,110,110,101,108,32,49,32,40,80,82,78,32,49,53,41,10,158,139, }; + u8 encoded_frame[] = { + 85, 16, 0, 34, 34, 35, 73, 78, 70, 79, 58, 32, 68, 105, 115, + 97, 98, 108, 105, 110, 103, 32, 99, 104, 97, 110, 110, 101, 108, 32, + 49, 32, 40, 80, 82, 78, 32, 49, 53, 41, 10, 158, 139, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_print_dep_t* test_msg = ( msg_print_dep_t* )test_msg_storage; + msg_print_dep_t* test_msg = (msg_print_dep_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)68,(char)105,(char)115,(char)97,(char)98,(char)108,(char)105,(char)110,(char)103,(char)32,(char)99,(char)104,(char)97,(char)110,(char)110,(char)101,(char)108,(char)32,(char)49,(char)32,(char)40,(char)80,(char)82,(char)78,(char)32,(char)49,(char)53,(char)41,(char)10 }; + const char assign_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)68, (char)105, (char)115, (char)97, (char)98, (char)108, + (char)105, (char)110, (char)103, (char)32, (char)99, (char)104, + (char)97, (char)110, (char)110, (char)101, (char)108, (char)32, + (char)49, (char)32, (char)40, (char)80, (char)82, (char)78, + (char)32, (char)49, (char)53, (char)41, (char)10}; memcpy(test_msg->text, assign_string, sizeof(assign_string)); if (sizeof(test_msg->text) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0x10, 8738, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x10, 8738, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 8738, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 8738, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x10, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_print_dep_t* check_msg = ( msg_print_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_print_dep_t* check_msg = (msg_print_dep_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)68,(char)105,(char)115,(char)97,(char)98,(char)108,(char)105,(char)110,(char)103,(char)32,(char)99,(char)104,(char)97,(char)110,(char)110,(char)101,(char)108,(char)32,(char)49,(char)32,(char)40,(char)80,(char)82,(char)78,(char)32,(char)49,(char)53,(char)41,(char)10 }; - ck_assert_msg(memcmp(check_msg->text, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->text, expected string '%s', is '%s'", check_string, check_msg->text); + const char check_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)68, (char)105, (char)115, (char)97, (char)98, (char)108, + (char)105, (char)110, (char)103, (char)32, (char)99, (char)104, + (char)97, (char)110, (char)110, (char)101, (char)108, (char)32, + (char)49, (char)32, (char)40, (char)80, (char)82, (char)78, + (char)32, (char)49, (char)53, (char)41, (char)10}; + ck_assert_msg( + memcmp(check_msg->text, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->text, expected string '%s', is '%s'", + check_string, check_msg->text); } } } END_TEST -Suite* legacy_auto_check_sbp_logging_MsgPrintDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_logging_MsgPrintDep"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_logging_MsgPrintDep"); +Suite* legacy_auto_check_sbp_logging_MsgPrintDep_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_logging_MsgPrintDep"); + TCase* tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_logging_MsgPrintDep"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_logging_MsgPrintDep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_mag_MsgMagRaw.c b/c/test/legacy/auto_check_sbp_mag_MsgMagRaw.c index 93eaed355..9eadfbbfa 100644 --- a/c/test/legacy/auto_check_sbp_mag_MsgMagRaw.c +++ b/c/test/legacy/auto_check_sbp_mag_MsgMagRaw.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/mag/test_MsgMagRaw.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/mag/test_MsgMagRaw.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_mag_MsgMagRaw ) -{ +START_TEST(test_legacy_auto_check_sbp_mag_MsgMagRaw) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_mag_MsgMagRaw ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,84 +128,106 @@ START_TEST( test_legacy_auto_check_sbp_mag_MsgMagRaw ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x902, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x902, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x902, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x902, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,9,195,4,11,173,227,158,198,206,98,3,230,2,110,229,159,23, }; + u8 encoded_frame[] = { + 85, 2, 9, 195, 4, 11, 173, 227, 158, 198, + 206, 98, 3, 230, 2, 110, 229, 159, 23, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_mag_raw_t* test_msg = ( msg_mag_raw_t* )test_msg_storage; + msg_mag_raw_t *test_msg = (msg_mag_raw_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->mag_x = 866; test_msg->mag_y = 742; test_msg->mag_z = -6802; test_msg->tow = 3332301741; test_msg->tow_f = 206; - sbp_payload_send(&sbp_state, 0x902, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x902, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x902, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_mag_raw_t* check_msg = ( msg_mag_raw_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_mag_raw_t *check_msg = (msg_mag_raw_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->mag_x == 866, "incorrect value for mag_x, expected 866, is %d", check_msg->mag_x); - ck_assert_msg(check_msg->mag_y == 742, "incorrect value for mag_y, expected 742, is %d", check_msg->mag_y); - ck_assert_msg(check_msg->mag_z == -6802, "incorrect value for mag_z, expected -6802, is %d", check_msg->mag_z); - ck_assert_msg(check_msg->tow == 3332301741, "incorrect value for tow, expected 3332301741, is %d", check_msg->tow); - ck_assert_msg(check_msg->tow_f == 206, "incorrect value for tow_f, expected 206, is %d", check_msg->tow_f); + ck_assert_msg(check_msg->mag_x == 866, + "incorrect value for mag_x, expected 866, is %d", + check_msg->mag_x); + ck_assert_msg(check_msg->mag_y == 742, + "incorrect value for mag_y, expected 742, is %d", + check_msg->mag_y); + ck_assert_msg(check_msg->mag_z == -6802, + "incorrect value for mag_z, expected -6802, is %d", + check_msg->mag_z); + ck_assert_msg(check_msg->tow == 3332301741, + "incorrect value for tow, expected 3332301741, is %d", + check_msg->tow); + ck_assert_msg(check_msg->tow_f == 206, + "incorrect value for tow_f, expected 206, is %d", + check_msg->tow_f); } } END_TEST -Suite* legacy_auto_check_sbp_mag_MsgMagRaw_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_mag_MsgMagRaw"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_mag_MsgMagRaw"); +Suite *legacy_auto_check_sbp_mag_MsgMagRaw_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_mag_MsgMagRaw"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_mag_MsgMagRaw"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_mag_MsgMagRaw); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgAgeCorrections.c b/c/test/legacy/auto_check_sbp_navigation_MsgAgeCorrections.c index f3f668602..5bfecd61b 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgAgeCorrections.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgAgeCorrections.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgAgeCorrections.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgAgeCorrections.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgAgeCorrections ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgAgeCorrections) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgAgeCorrections ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,79 +128,97 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgAgeCorrections ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x210, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x210, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x210, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x210, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,16,2,66,0,6,100,0,0,0,30,0,233,202, }; + u8 encoded_frame[] = { + 85, 16, 2, 66, 0, 6, 100, 0, 0, 0, 30, 0, 233, 202, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_age_corrections_t* test_msg = ( msg_age_corrections_t* )test_msg_storage; + msg_age_corrections_t *test_msg = (msg_age_corrections_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->age = 30; test_msg->tow = 100; - sbp_payload_send(&sbp_state, 0x210, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x210, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x210, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_age_corrections_t* check_msg = ( msg_age_corrections_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_age_corrections_t *check_msg = + (msg_age_corrections_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->age == 30, "incorrect value for age, expected 30, is %d", check_msg->age); - ck_assert_msg(check_msg->tow == 100, "incorrect value for tow, expected 100, is %d", check_msg->tow); + ck_assert_msg(check_msg->age == 30, + "incorrect value for age, expected 30, is %d", + check_msg->age); + ck_assert_msg(check_msg->tow == 100, + "incorrect value for tow, expected 100, is %d", + check_msg->tow); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgAgeCorrections_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgAgeCorrections"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgAgeCorrections"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgAgeCorrections); +Suite *legacy_auto_check_sbp_navigation_MsgAgeCorrections_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgAgeCorrections"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgAgeCorrections"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_navigation_MsgAgeCorrections); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgBaselineECEF.c b/c/test/legacy/auto_check_sbp_navigation_MsgBaselineECEF.c index 1ea4515ab..13dabdd51 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgBaselineECEF.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgBaselineECEF.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEF.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEF ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgBaselineECEF) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEF ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEF ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20b, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20b, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,11,2,211,136,20,40,244,122,19,150,98,238,255,190,64,20,0,246,163,9,0,0,0,14,0,219,191, }; + u8 encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 40, 244, 122, 19, 150, 98, 238, 255, + 190, 64, 20, 0, 246, 163, 9, 0, 0, 0, 14, 0, 219, 191, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_t* test_msg = ( msg_baseline_ecef_t* )test_msg_storage; + msg_baseline_ecef_t* test_msg = (msg_baseline_ecef_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -150,66 +152,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEF ) test_msg->x = -1154410; test_msg->y = 1327294; test_msg->z = 631798; - sbp_payload_send(&sbp_state, 0x20b, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20b, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20b, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_t* check_msg = ( msg_baseline_ecef_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_t* check_msg = + (msg_baseline_ecef_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 14, "incorrect value for n_sats, expected 14, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326825000, "incorrect value for tow, expected 326825000, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -1154410, "incorrect value for x, expected -1154410, is %d", check_msg->x); - ck_assert_msg(check_msg->y == 1327294, "incorrect value for y, expected 1327294, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 631798, "incorrect value for z, expected 631798, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 14, + "incorrect value for n_sats, expected 14, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326825000, + "incorrect value for tow, expected 326825000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -1154410, + "incorrect value for x, expected -1154410, is %d", + check_msg->x); + ck_assert_msg(check_msg->y == 1327294, + "incorrect value for y, expected 1327294, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 631798, + "incorrect value for z, expected 631798, is %d", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -217,17 +241,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEF ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20b, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20b, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,11,2,211,136,20,16,248,122,19,72,99,238,255,191,65,20,0,138,162,9,0,0,0,15,0,240,78, }; + u8 encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 16, 248, 122, 19, 72, 99, 238, 255, + 191, 65, 20, 0, 138, 162, 9, 0, 0, 0, 15, 0, 240, 78, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_t* test_msg = ( msg_baseline_ecef_t* )test_msg_storage; + msg_baseline_ecef_t* test_msg = (msg_baseline_ecef_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -236,66 +265,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEF ) test_msg->x = -1154232; test_msg->y = 1327551; test_msg->z = 631434; - sbp_payload_send(&sbp_state, 0x20b, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20b, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20b, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_t* check_msg = ( msg_baseline_ecef_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_t* check_msg = + (msg_baseline_ecef_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326826000, "incorrect value for tow, expected 326826000, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -1154232, "incorrect value for x, expected -1154232, is %d", check_msg->x); - ck_assert_msg(check_msg->y == 1327551, "incorrect value for y, expected 1327551, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 631434, "incorrect value for z, expected 631434, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326826000, + "incorrect value for tow, expected 326826000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -1154232, + "incorrect value for x, expected -1154232, is %d", + check_msg->x); + ck_assert_msg(check_msg->y == 1327551, + "incorrect value for y, expected 1327551, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 631434, + "incorrect value for z, expected 631434, is %d", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -303,17 +354,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEF ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20b, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20b, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,11,2,211,136,20,248,251,122,19,41,99,238,255,181,65,20,0,148,161,9,0,0,0,15,0,4,132, }; + u8 encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 248, 251, 122, 19, 41, 99, 238, 255, + 181, 65, 20, 0, 148, 161, 9, 0, 0, 0, 15, 0, 4, 132, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_t* test_msg = ( msg_baseline_ecef_t* )test_msg_storage; + msg_baseline_ecef_t* test_msg = (msg_baseline_ecef_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -322,66 +378,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEF ) test_msg->x = -1154263; test_msg->y = 1327541; test_msg->z = 631188; - sbp_payload_send(&sbp_state, 0x20b, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20b, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20b, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_t* check_msg = ( msg_baseline_ecef_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_t* check_msg = + (msg_baseline_ecef_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326827000, "incorrect value for tow, expected 326827000, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -1154263, "incorrect value for x, expected -1154263, is %d", check_msg->x); - ck_assert_msg(check_msg->y == 1327541, "incorrect value for y, expected 1327541, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 631188, "incorrect value for z, expected 631188, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326827000, + "incorrect value for tow, expected 326827000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -1154263, + "incorrect value for x, expected -1154263, is %d", + check_msg->x); + ck_assert_msg(check_msg->y == 1327541, + "incorrect value for y, expected 1327541, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 631188, + "incorrect value for z, expected 631188, is %d", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -389,17 +467,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEF ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20b, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20b, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,11,2,211,136,20,224,255,122,19,188,97,238,255,81,64,20,0,65,160,9,0,0,0,15,0,67,94, }; + u8 encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 224, 255, 122, 19, 188, 97, 238, 255, + 81, 64, 20, 0, 65, 160, 9, 0, 0, 0, 15, 0, 67, 94, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_t* test_msg = ( msg_baseline_ecef_t* )test_msg_storage; + msg_baseline_ecef_t* test_msg = (msg_baseline_ecef_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -408,66 +491,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEF ) test_msg->x = -1154628; test_msg->y = 1327185; test_msg->z = 630849; - sbp_payload_send(&sbp_state, 0x20b, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20b, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20b, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_t* check_msg = ( msg_baseline_ecef_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_t* check_msg = + (msg_baseline_ecef_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326828000, "incorrect value for tow, expected 326828000, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -1154628, "incorrect value for x, expected -1154628, is %d", check_msg->x); - ck_assert_msg(check_msg->y == 1327185, "incorrect value for y, expected 1327185, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 630849, "incorrect value for z, expected 630849, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326828000, + "incorrect value for tow, expected 326828000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -1154628, + "incorrect value for x, expected -1154628, is %d", + check_msg->x); + ck_assert_msg(check_msg->y == 1327185, + "incorrect value for y, expected 1327185, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 630849, + "incorrect value for z, expected 630849, is %d", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -475,17 +580,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEF ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20b, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20b, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,11,2,211,136,20,200,3,123,19,189,96,238,255,93,63,20,0,98,159,9,0,0,0,15,0,106,94, }; + u8 encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 200, 3, 123, 19, 189, 96, 238, 255, + 93, 63, 20, 0, 98, 159, 9, 0, 0, 0, 15, 0, 106, 94, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_t* test_msg = ( msg_baseline_ecef_t* )test_msg_storage; + msg_baseline_ecef_t* test_msg = (msg_baseline_ecef_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -494,69 +604,92 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEF ) test_msg->x = -1154883; test_msg->y = 1326941; test_msg->z = 630626; - sbp_payload_send(&sbp_state, 0x20b, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20b, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20b, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_t* check_msg = ( msg_baseline_ecef_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_t* check_msg = + (msg_baseline_ecef_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326829000, "incorrect value for tow, expected 326829000, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -1154883, "incorrect value for x, expected -1154883, is %d", check_msg->x); - ck_assert_msg(check_msg->y == 1326941, "incorrect value for y, expected 1326941, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 630626, "incorrect value for z, expected 630626, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326829000, + "incorrect value for tow, expected 326829000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -1154883, + "incorrect value for x, expected -1154883, is %d", + check_msg->x); + ck_assert_msg(check_msg->y == 1326941, + "incorrect value for y, expected 1326941, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 630626, + "incorrect value for z, expected 630626, is %d", + check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgBaselineECEF_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgBaselineECEF"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgBaselineECEF"); +Suite* legacy_auto_check_sbp_navigation_MsgBaselineECEF_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgBaselineECEF"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgBaselineECEF"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgBaselineECEF); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgBaselineECEFDepA.c b/c/test/legacy/auto_check_sbp_navigation_MsgBaselineECEFDepA.c index ba66e9571..ad62b1b1f 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgBaselineECEFDepA.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgBaselineECEFDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEFDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEFDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,2,246,215,20,20,46,39,0,21,48,255,255,52,117,255,255,216,211,254,255,0,0,9,1,50,137, }; + u8 encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 20, 46, 39, 0, 21, 48, 255, 255, + 52, 117, 255, 255, 216, 211, 254, 255, 0, 0, 9, 1, 50, 137, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; + msg_baseline_ecef_dep_a_t* test_msg = + (msg_baseline_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 1; @@ -150,66 +153,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) test_msg->x = -53227; test_msg->y = -35532; test_msg->z = -76840; - sbp_payload_send(&sbp_state, 0x202, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x202, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x202, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_dep_a_t* check_msg = ( msg_baseline_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_dep_a_t* check_msg = + (msg_baseline_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567700, "incorrect value for tow, expected 2567700, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -53227, "incorrect value for x, expected -53227, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -35532, "incorrect value for y, expected -35532, is %d", check_msg->y); - ck_assert_msg(check_msg->z == -76840, "incorrect value for z, expected -76840, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567700, + "incorrect value for tow, expected 2567700, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -53227, + "incorrect value for x, expected -53227, is %d", + check_msg->x); + ck_assert_msg(check_msg->y == -35532, + "incorrect value for y, expected -35532, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == -76840, + "incorrect value for z, expected -76840, is %d", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -217,17 +242,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,2,246,215,20,120,46,39,0,58,49,255,255,49,116,255,255,134,211,254,255,0,0,9,1,227,155, }; + u8 encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 120, 46, 39, 0, 58, 49, 255, 255, + 49, 116, 255, 255, 134, 211, 254, 255, 0, 0, 9, 1, 227, 155, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; + msg_baseline_ecef_dep_a_t* test_msg = + (msg_baseline_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 1; @@ -236,66 +267,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) test_msg->x = -52934; test_msg->y = -35791; test_msg->z = -76922; - sbp_payload_send(&sbp_state, 0x202, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x202, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x202, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_dep_a_t* check_msg = ( msg_baseline_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_dep_a_t* check_msg = + (msg_baseline_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567800, "incorrect value for tow, expected 2567800, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -52934, "incorrect value for x, expected -52934, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -35791, "incorrect value for y, expected -35791, is %d", check_msg->y); - ck_assert_msg(check_msg->z == -76922, "incorrect value for z, expected -76922, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567800, + "incorrect value for tow, expected 2567800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -52934, + "incorrect value for x, expected -52934, is %d", + check_msg->x); + ck_assert_msg(check_msg->y == -35791, + "incorrect value for y, expected -35791, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == -76922, + "incorrect value for z, expected -76922, is %d", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -303,17 +356,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,2,246,215,20,220,46,39,0,97,50,255,255,47,115,255,255,52,211,254,255,0,0,9,1,61,126, }; + u8 encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 220, 46, 39, 0, 97, 50, 255, 255, + 47, 115, 255, 255, 52, 211, 254, 255, 0, 0, 9, 1, 61, 126, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; + msg_baseline_ecef_dep_a_t* test_msg = + (msg_baseline_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 1; @@ -322,66 +381,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) test_msg->x = -52639; test_msg->y = -36049; test_msg->z = -77004; - sbp_payload_send(&sbp_state, 0x202, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x202, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x202, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_dep_a_t* check_msg = ( msg_baseline_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_dep_a_t* check_msg = + (msg_baseline_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567900, "incorrect value for tow, expected 2567900, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -52639, "incorrect value for x, expected -52639, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -36049, "incorrect value for y, expected -36049, is %d", check_msg->y); - ck_assert_msg(check_msg->z == -77004, "incorrect value for z, expected -77004, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567900, + "incorrect value for tow, expected 2567900, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -52639, + "incorrect value for x, expected -52639, is %d", + check_msg->x); + ck_assert_msg(check_msg->y == -36049, + "incorrect value for y, expected -36049, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == -77004, + "incorrect value for z, expected -77004, is %d", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -389,17 +470,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,2,246,215,20,64,47,39,0,136,51,255,255,45,114,255,255,228,210,254,255,0,0,9,1,200,79, }; + u8 encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 64, 47, 39, 0, 136, 51, 255, 255, + 45, 114, 255, 255, 228, 210, 254, 255, 0, 0, 9, 1, 200, 79, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; + msg_baseline_ecef_dep_a_t* test_msg = + (msg_baseline_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 1; @@ -408,66 +495,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) test_msg->x = -52344; test_msg->y = -36307; test_msg->z = -77084; - sbp_payload_send(&sbp_state, 0x202, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x202, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x202, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_dep_a_t* check_msg = ( msg_baseline_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_dep_a_t* check_msg = + (msg_baseline_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2568000, "incorrect value for tow, expected 2568000, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -52344, "incorrect value for x, expected -52344, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -36307, "incorrect value for y, expected -36307, is %d", check_msg->y); - ck_assert_msg(check_msg->z == -77084, "incorrect value for z, expected -77084, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2568000, + "incorrect value for tow, expected 2568000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -52344, + "incorrect value for x, expected -52344, is %d", + check_msg->x); + ck_assert_msg(check_msg->y == -36307, + "incorrect value for y, expected -36307, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == -77084, + "incorrect value for z, expected -77084, is %d", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -475,17 +584,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,2,246,215,20,164,47,39,0,176,52,255,255,44,113,255,255,149,210,254,255,0,0,9,1,104,24, }; + u8 encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 164, 47, 39, 0, 176, 52, 255, 255, + 44, 113, 255, 255, 149, 210, 254, 255, 0, 0, 9, 1, 104, 24, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; + msg_baseline_ecef_dep_a_t* test_msg = + (msg_baseline_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 1; @@ -494,66 +609,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) test_msg->x = -52048; test_msg->y = -36564; test_msg->z = -77163; - sbp_payload_send(&sbp_state, 0x202, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x202, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x202, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_dep_a_t* check_msg = ( msg_baseline_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_dep_a_t* check_msg = + (msg_baseline_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2568100, "incorrect value for tow, expected 2568100, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -52048, "incorrect value for x, expected -52048, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -36564, "incorrect value for y, expected -36564, is %d", check_msg->y); - ck_assert_msg(check_msg->z == -77163, "incorrect value for z, expected -77163, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2568100, + "incorrect value for tow, expected 2568100, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -52048, + "incorrect value for x, expected -52048, is %d", + check_msg->x); + ck_assert_msg(check_msg->y == -36564, + "incorrect value for y, expected -36564, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == -77163, + "incorrect value for z, expected -77163, is %d", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -561,17 +698,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,2,195,4,20,156,21,69,24,169,231,255,255,102,208,255,255,251,28,0,0,0,0,6,0,146,168, }; + u8 encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 156, 21, 69, 24, 169, 231, 255, 255, + 102, 208, 255, 255, 251, 28, 0, 0, 0, 0, 6, 0, 146, 168, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; + msg_baseline_ecef_dep_a_t* test_msg = + (msg_baseline_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -580,66 +723,86 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) test_msg->x = -6231; test_msg->y = -12186; test_msg->z = 7419; - sbp_payload_send(&sbp_state, 0x202, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x202, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x202, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_dep_a_t* check_msg = ( msg_baseline_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_dep_a_t* check_msg = + (msg_baseline_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 6, "incorrect value for n_sats, expected 6, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407180700, "incorrect value for tow, expected 407180700, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -6231, "incorrect value for x, expected -6231, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -12186, "incorrect value for y, expected -12186, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 7419, "incorrect value for z, expected 7419, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 6, + "incorrect value for n_sats, expected 6, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407180700, + "incorrect value for tow, expected 407180700, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -6231, + "incorrect value for x, expected -6231, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -12186, + "incorrect value for y, expected -12186, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 7419, + "incorrect value for z, expected 7419, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -647,17 +810,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,2,195,4,20,0,22,69,24,169,231,255,255,103,208,255,255,252,28,0,0,0,0,6,0,34,116, }; + u8 encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 0, 22, 69, 24, 169, 231, 255, 255, + 103, 208, 255, 255, 252, 28, 0, 0, 0, 0, 6, 0, 34, 116, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; + msg_baseline_ecef_dep_a_t* test_msg = + (msg_baseline_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -666,66 +835,86 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) test_msg->x = -6231; test_msg->y = -12185; test_msg->z = 7420; - sbp_payload_send(&sbp_state, 0x202, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x202, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x202, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_dep_a_t* check_msg = ( msg_baseline_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_dep_a_t* check_msg = + (msg_baseline_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 6, "incorrect value for n_sats, expected 6, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407180800, "incorrect value for tow, expected 407180800, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -6231, "incorrect value for x, expected -6231, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -12185, "incorrect value for y, expected -12185, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 7420, "incorrect value for z, expected 7420, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 6, + "incorrect value for n_sats, expected 6, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407180800, + "incorrect value for tow, expected 407180800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -6231, + "incorrect value for x, expected -6231, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -12185, + "incorrect value for y, expected -12185, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 7420, + "incorrect value for z, expected 7420, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -733,17 +922,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,2,195,4,20,100,22,69,24,30,224,255,255,192,183,255,255,239,53,0,0,0,0,6,0,225,15, }; + u8 encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 100, 22, 69, 24, 30, 224, 255, 255, + 192, 183, 255, 255, 239, 53, 0, 0, 0, 0, 6, 0, 225, 15, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; + msg_baseline_ecef_dep_a_t* test_msg = + (msg_baseline_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -752,66 +947,86 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) test_msg->x = -8162; test_msg->y = -18496; test_msg->z = 13807; - sbp_payload_send(&sbp_state, 0x202, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x202, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x202, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_dep_a_t* check_msg = ( msg_baseline_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_dep_a_t* check_msg = + (msg_baseline_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 6, "incorrect value for n_sats, expected 6, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407180900, "incorrect value for tow, expected 407180900, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -8162, "incorrect value for x, expected -8162, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -18496, "incorrect value for y, expected -18496, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 13807, "incorrect value for z, expected 13807, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 6, + "incorrect value for n_sats, expected 6, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407180900, + "incorrect value for tow, expected 407180900, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -8162, + "incorrect value for x, expected -8162, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -18496, + "incorrect value for y, expected -18496, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 13807, + "incorrect value for z, expected 13807, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -819,17 +1034,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,2,195,4,20,200,22,69,24,28,224,255,255,191,183,255,255,242,53,0,0,0,0,6,0,35,100, }; + u8 encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 200, 22, 69, 24, 28, 224, 255, 255, + 191, 183, 255, 255, 242, 53, 0, 0, 0, 0, 6, 0, 35, 100, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; + msg_baseline_ecef_dep_a_t* test_msg = + (msg_baseline_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -838,66 +1059,86 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) test_msg->x = -8164; test_msg->y = -18497; test_msg->z = 13810; - sbp_payload_send(&sbp_state, 0x202, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x202, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x202, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_dep_a_t* check_msg = ( msg_baseline_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_dep_a_t* check_msg = + (msg_baseline_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 6, "incorrect value for n_sats, expected 6, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407181000, "incorrect value for tow, expected 407181000, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -8164, "incorrect value for x, expected -8164, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -18497, "incorrect value for y, expected -18497, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 13810, "incorrect value for z, expected 13810, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 6, + "incorrect value for n_sats, expected 6, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407181000, + "incorrect value for tow, expected 407181000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -8164, + "incorrect value for x, expected -8164, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -18497, + "incorrect value for y, expected -18497, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 13810, + "incorrect value for z, expected 13810, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -905,17 +1146,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,2,195,4,20,44,23,69,24,24,227,255,255,25,195,255,255,153,59,0,0,0,0,6,0,66,66, }; + u8 encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 44, 23, 69, 24, 24, 227, 255, 255, + 25, 195, 255, 255, 153, 59, 0, 0, 0, 0, 6, 0, 66, 66, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; + msg_baseline_ecef_dep_a_t* test_msg = + (msg_baseline_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -924,66 +1171,86 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) test_msg->x = -7400; test_msg->y = -15591; test_msg->z = 15257; - sbp_payload_send(&sbp_state, 0x202, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x202, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x202, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_dep_a_t* check_msg = ( msg_baseline_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_dep_a_t* check_msg = + (msg_baseline_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 6, "incorrect value for n_sats, expected 6, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407181100, "incorrect value for tow, expected 407181100, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -7400, "incorrect value for x, expected -7400, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -15591, "incorrect value for y, expected -15591, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 15257, "incorrect value for z, expected 15257, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 6, + "incorrect value for n_sats, expected 6, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407181100, + "incorrect value for tow, expected 407181100, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -7400, + "incorrect value for x, expected -7400, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -15591, + "incorrect value for y, expected -15591, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 15257, + "incorrect value for z, expected 15257, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -991,17 +1258,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x202, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x202, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,2,195,4,20,144,23,69,24,23,227,255,255,25,195,255,255,153,59,0,0,0,0,6,0,35,135, }; + u8 encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 144, 23, 69, 24, 23, 227, 255, 255, + 25, 195, 255, 255, 153, 59, 0, 0, 0, 0, 6, 0, 35, 135, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; + msg_baseline_ecef_dep_a_t* test_msg = + (msg_baseline_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -1010,70 +1283,92 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA ) test_msg->x = -7401; test_msg->y = -15591; test_msg->z = 15257; - sbp_payload_send(&sbp_state, 0x202, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x202, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x202, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ecef_dep_a_t* check_msg = ( msg_baseline_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ecef_dep_a_t* check_msg = + (msg_baseline_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 6, "incorrect value for n_sats, expected 6, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407181200, "incorrect value for tow, expected 407181200, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -7401, "incorrect value for x, expected -7401, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -15591, "incorrect value for y, expected -15591, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 15257, "incorrect value for z, expected 15257, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 6, + "incorrect value for n_sats, expected 6, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407181200, + "incorrect value for tow, expected 407181200, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -7401, + "incorrect value for x, expected -7401, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -15591, + "incorrect value for y, expected -15591, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 15257, + "incorrect value for z, expected 15257, is %d", check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA); +Suite* legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgBaselineHeadingDepA.c b/c/test/legacy/auto_check_sbp_navigation_MsgBaselineHeadingDepA.c index 7f7f2d031..1bba09b3b 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgBaselineHeadingDepA.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgBaselineHeadingDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineHeadingDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineHeadingDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,83 +128,108 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x207, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x207, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x207, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x207, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,7,2,124,206,10,82,109,88,176,68,14,82,203,186,58,173,182, }; + u8 encoded_frame[] = { + 85, 7, 2, 124, 206, 10, 82, 109, 88, + 176, 68, 14, 82, 203, 186, 58, 173, 182, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_heading_dep_a_t* test_msg = ( msg_baseline_heading_dep_a_t* )test_msg_storage; + msg_baseline_heading_dep_a_t *test_msg = + (msg_baseline_heading_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 58; test_msg->heading = 3411152452; test_msg->n_sats = 186; test_msg->tow = 2958585170; - sbp_payload_send(&sbp_state, 0x207, 52860, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x207, 52860, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 52860, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 52860, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x207, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_heading_dep_a_t* check_msg = ( msg_baseline_heading_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_heading_dep_a_t *check_msg = + (msg_baseline_heading_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 58, "incorrect value for flags, expected 58, is %d", check_msg->flags); - ck_assert_msg(check_msg->heading == 3411152452, "incorrect value for heading, expected 3411152452, is %d", check_msg->heading); - ck_assert_msg(check_msg->n_sats == 186, "incorrect value for n_sats, expected 186, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2958585170, "incorrect value for tow, expected 2958585170, is %d", check_msg->tow); + ck_assert_msg(check_msg->flags == 58, + "incorrect value for flags, expected 58, is %d", + check_msg->flags); + ck_assert_msg(check_msg->heading == 3411152452, + "incorrect value for heading, expected 3411152452, is %d", + check_msg->heading); + ck_assert_msg(check_msg->n_sats == 186, + "incorrect value for n_sats, expected 186, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2958585170, + "incorrect value for tow, expected 2958585170, is %d", + check_msg->tow); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA); +Suite *legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_" + "MsgBaselineHeadingDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgBaselineNED.c b/c/test/legacy/auto_check_sbp_navigation_MsgBaselineNED.c index cc9a99b16..eb3cc48e1 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgBaselineNED.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgBaselineNED.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNED.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNED.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNED ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgBaselineNED) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNED ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNED ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20c, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20c, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,12,2,211,136,22,40,244,122,19,201,115,12,0,179,88,230,255,153,125,0,0,0,0,0,0,14,0,226,70, }; + u8 encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 40, 244, 122, 19, 201, 115, 12, 0, 179, + 88, 230, 255, 153, 125, 0, 0, 0, 0, 0, 0, 14, 0, 226, 70, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_t* test_msg = ( msg_baseline_ned_t* )test_msg_storage; + msg_baseline_ned_t* test_msg = (msg_baseline_ned_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 32153; test_msg->e = -1681229; @@ -151,67 +153,89 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNED ) test_msg->n_sats = 14; test_msg->tow = 326825000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x20c, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20c, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20c, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_t* check_msg = ( msg_baseline_ned_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_t* check_msg = (msg_baseline_ned_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 32153, "incorrect value for d, expected 32153, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -1681229, "incorrect value for e, expected -1681229, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == 816073, "incorrect value for n, expected 816073, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 14, "incorrect value for n_sats, expected 14, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326825000, "incorrect value for tow, expected 326825000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 32153, + "incorrect value for d, expected 32153, is %d", check_msg->d); + ck_assert_msg(check_msg->e == -1681229, + "incorrect value for e, expected -1681229, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == 816073, + "incorrect value for n, expected 816073, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 14, + "incorrect value for n_sats, expected 14, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326825000, + "incorrect value for tow, expected 326825000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -219,17 +243,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNED ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20c, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20c, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,12,2,211,136,22,16,248,122,19,98,115,12,0,194,88,230,255,110,127,0,0,0,0,0,0,15,0,69,93, }; + u8 encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 16, 248, 122, 19, 98, 115, 12, 0, 194, + 88, 230, 255, 110, 127, 0, 0, 0, 0, 0, 0, 15, 0, 69, 93, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_t* test_msg = ( msg_baseline_ned_t* )test_msg_storage; + msg_baseline_ned_t* test_msg = (msg_baseline_ned_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 32622; test_msg->e = -1681214; @@ -239,67 +268,89 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNED ) test_msg->n_sats = 15; test_msg->tow = 326826000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x20c, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20c, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20c, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_t* check_msg = ( msg_baseline_ned_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_t* check_msg = (msg_baseline_ned_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 32622, "incorrect value for d, expected 32622, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -1681214, "incorrect value for e, expected -1681214, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == 815970, "incorrect value for n, expected 815970, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326826000, "incorrect value for tow, expected 326826000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 32622, + "incorrect value for d, expected 32622, is %d", check_msg->d); + ck_assert_msg(check_msg->e == -1681214, + "incorrect value for e, expected -1681214, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == 815970, + "incorrect value for n, expected 815970, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326826000, + "incorrect value for tow, expected 326826000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -307,17 +358,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNED ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20c, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20c, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,12,2,211,136,22,248,251,122,19,143,114,12,0,173,88,230,255,238,127,0,0,0,0,0,0,15,0,210,169, }; + u8 encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 248, 251, 122, 19, 143, 114, 12, 0, 173, + 88, 230, 255, 238, 127, 0, 0, 0, 0, 0, 0, 15, 0, 210, 169, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_t* test_msg = ( msg_baseline_ned_t* )test_msg_storage; + msg_baseline_ned_t* test_msg = (msg_baseline_ned_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 32750; test_msg->e = -1681235; @@ -327,67 +383,89 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNED ) test_msg->n_sats = 15; test_msg->tow = 326827000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x20c, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20c, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20c, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_t* check_msg = ( msg_baseline_ned_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_t* check_msg = (msg_baseline_ned_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 32750, "incorrect value for d, expected 32750, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -1681235, "incorrect value for e, expected -1681235, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == 815759, "incorrect value for n, expected 815759, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326827000, "incorrect value for tow, expected 326827000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 32750, + "incorrect value for d, expected 32750, is %d", check_msg->d); + ck_assert_msg(check_msg->e == -1681235, + "incorrect value for e, expected -1681235, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == 815759, + "incorrect value for n, expected 815759, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326827000, + "incorrect value for tow, expected 326827000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -395,17 +473,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNED ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20c, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20c, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,12,2,211,136,22,224,255,122,19,86,112,12,0,51,88,230,255,47,127,0,0,0,0,0,0,15,0,135,107, }; + u8 encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 224, 255, 122, 19, 86, 112, 12, 0, 51, + 88, 230, 255, 47, 127, 0, 0, 0, 0, 0, 0, 15, 0, 135, 107, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_t* test_msg = ( msg_baseline_ned_t* )test_msg_storage; + msg_baseline_ned_t* test_msg = (msg_baseline_ned_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 32559; test_msg->e = -1681357; @@ -415,67 +498,89 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNED ) test_msg->n_sats = 15; test_msg->tow = 326828000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x20c, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20c, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20c, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_t* check_msg = ( msg_baseline_ned_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_t* check_msg = (msg_baseline_ned_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 32559, "incorrect value for d, expected 32559, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -1681357, "incorrect value for e, expected -1681357, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == 815190, "incorrect value for n, expected 815190, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326828000, "incorrect value for tow, expected 326828000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 32559, + "incorrect value for d, expected 32559, is %d", check_msg->d); + ck_assert_msg(check_msg->e == -1681357, + "incorrect value for e, expected -1681357, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == 815190, + "incorrect value for n, expected 815190, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326828000, + "incorrect value for tow, expected 326828000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -483,17 +588,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNED ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20c, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20c, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,12,2,211,136,22,200,3,123,19,214,110,12,0,220,87,230,255,165,126,0,0,0,0,0,0,15,0,190,80, }; + u8 encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 200, 3, 123, 19, 214, 110, 12, 0, 220, + 87, 230, 255, 165, 126, 0, 0, 0, 0, 0, 0, 15, 0, 190, 80, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_t* test_msg = ( msg_baseline_ned_t* )test_msg_storage; + msg_baseline_ned_t* test_msg = (msg_baseline_ned_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 32421; test_msg->e = -1681444; @@ -503,70 +613,93 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNED ) test_msg->n_sats = 15; test_msg->tow = 326829000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x20c, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20c, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20c, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_t* check_msg = ( msg_baseline_ned_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_t* check_msg = (msg_baseline_ned_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 32421, "incorrect value for d, expected 32421, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -1681444, "incorrect value for e, expected -1681444, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == 814806, "incorrect value for n, expected 814806, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326829000, "incorrect value for tow, expected 326829000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 32421, + "incorrect value for d, expected 32421, is %d", check_msg->d); + ck_assert_msg(check_msg->e == -1681444, + "incorrect value for e, expected -1681444, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == 814806, + "incorrect value for n, expected 814806, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326829000, + "incorrect value for tow, expected 326829000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgBaselineNED_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgBaselineNED"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgBaselineNED"); +Suite* legacy_auto_check_sbp_navigation_MsgBaselineNED_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgBaselineNED"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgBaselineNED"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgBaselineNED); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgBaselineNEDDepA.c b/c/test/legacy/auto_check_sbp_navigation_MsgBaselineNEDDepA.c index dabc86767..7c478b798 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgBaselineNEDDepA.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgBaselineNEDDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNEDDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNEDDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,2,246,215,22,20,46,39,0,243,134,254,255,234,153,255,255,0,0,0,0,0,0,0,0,9,1,93,193, }; + u8 encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 20, 46, 39, 0, 243, 134, 254, 255, 234, + 153, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 93, 193, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; + msg_baseline_ned_dep_a_t* test_msg = + (msg_baseline_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 0; test_msg->e = -26134; @@ -151,67 +154,90 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) test_msg->n_sats = 9; test_msg->tow = 2567700; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x203, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x203, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x203, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_dep_a_t* check_msg = ( msg_baseline_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_dep_a_t* check_msg = + (msg_baseline_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -26134, "incorrect value for e, expected -26134, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -96525, "incorrect value for n, expected -96525, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567700, "incorrect value for tow, expected 2567700, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == -26134, + "incorrect value for e, expected -26134, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -96525, + "incorrect value for n, expected -96525, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567700, + "incorrect value for tow, expected 2567700, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -219,17 +245,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,2,246,215,22,120,46,39,0,139,134,254,255,109,155,255,255,0,0,0,0,0,0,0,0,9,1,38,39, }; + u8 encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 120, 46, 39, 0, 139, 134, 254, 255, 109, + 155, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 38, 39, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; + msg_baseline_ned_dep_a_t* test_msg = + (msg_baseline_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 0; test_msg->e = -25747; @@ -239,67 +271,90 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) test_msg->n_sats = 9; test_msg->tow = 2567800; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x203, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x203, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x203, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_dep_a_t* check_msg = ( msg_baseline_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_dep_a_t* check_msg = + (msg_baseline_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -25747, "incorrect value for e, expected -25747, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -96629, "incorrect value for n, expected -96629, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567800, "incorrect value for tow, expected 2567800, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == -25747, + "incorrect value for e, expected -25747, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -96629, + "incorrect value for n, expected -96629, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567800, + "incorrect value for tow, expected 2567800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -307,17 +362,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,2,246,215,22,220,46,39,0,37,134,254,255,240,156,255,255,0,0,0,0,0,0,0,0,9,1,58,133, }; + u8 encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 220, 46, 39, 0, 37, 134, 254, 255, 240, + 156, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 58, 133, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; + msg_baseline_ned_dep_a_t* test_msg = + (msg_baseline_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 0; test_msg->e = -25360; @@ -327,67 +388,90 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) test_msg->n_sats = 9; test_msg->tow = 2567900; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x203, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x203, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x203, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_dep_a_t* check_msg = ( msg_baseline_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_dep_a_t* check_msg = + (msg_baseline_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -25360, "incorrect value for e, expected -25360, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -96731, "incorrect value for n, expected -96731, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567900, "incorrect value for tow, expected 2567900, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == -25360, + "incorrect value for e, expected -25360, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -96731, + "incorrect value for n, expected -96731, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567900, + "incorrect value for tow, expected 2567900, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -395,17 +479,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,2,246,215,22,64,47,39,0,193,133,254,255,115,158,255,255,0,0,0,0,0,0,0,0,9,1,56,214, }; + u8 encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 64, 47, 39, 0, 193, 133, 254, 255, 115, + 158, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 56, 214, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; + msg_baseline_ned_dep_a_t* test_msg = + (msg_baseline_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 0; test_msg->e = -24973; @@ -415,67 +505,90 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) test_msg->n_sats = 9; test_msg->tow = 2568000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x203, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x203, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x203, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_dep_a_t* check_msg = ( msg_baseline_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_dep_a_t* check_msg = + (msg_baseline_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -24973, "incorrect value for e, expected -24973, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -96831, "incorrect value for n, expected -96831, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2568000, "incorrect value for tow, expected 2568000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == -24973, + "incorrect value for e, expected -24973, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -96831, + "incorrect value for n, expected -96831, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2568000, + "incorrect value for tow, expected 2568000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -483,17 +596,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,2,246,215,22,164,47,39,0,93,133,254,255,246,159,255,255,0,0,0,0,0,0,0,0,9,1,234,244, }; + u8 encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 164, 47, 39, 0, 93, 133, 254, 255, 246, + 159, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 234, 244, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; + msg_baseline_ned_dep_a_t* test_msg = + (msg_baseline_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 0; test_msg->e = -24586; @@ -503,67 +622,90 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) test_msg->n_sats = 9; test_msg->tow = 2568100; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x203, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x203, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x203, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_dep_a_t* check_msg = ( msg_baseline_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_dep_a_t* check_msg = + (msg_baseline_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -24586, "incorrect value for e, expected -24586, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -96931, "incorrect value for n, expected -96931, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2568100, "incorrect value for tow, expected 2568100, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == -24586, + "incorrect value for e, expected -24586, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -96931, + "incorrect value for n, expected -96931, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2568100, + "incorrect value for tow, expected 2568100, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -571,17 +713,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,2,195,4,22,156,21,69,24,130,246,255,255,241,4,0,0,35,196,255,255,0,0,0,0,6,0,250,21, }; + u8 encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 156, 21, 69, 24, 130, 246, 255, 255, 241, + 4, 0, 0, 35, 196, 255, 255, 0, 0, 0, 0, 6, 0, 250, 21, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; + msg_baseline_ned_dep_a_t* test_msg = + (msg_baseline_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -15325; test_msg->e = 1265; @@ -591,67 +739,89 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) test_msg->n_sats = 6; test_msg->tow = 407180700; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x203, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x203, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x203, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_dep_a_t* check_msg = ( msg_baseline_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_dep_a_t* check_msg = + (msg_baseline_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -15325, "incorrect value for d, expected -15325, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 1265, "incorrect value for e, expected 1265, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -2430, "incorrect value for n, expected -2430, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 6, "incorrect value for n_sats, expected 6, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407180700, "incorrect value for tow, expected 407180700, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -15325, + "incorrect value for d, expected -15325, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == 1265, + "incorrect value for e, expected 1265, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -2430, + "incorrect value for n, expected -2430, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 6, + "incorrect value for n_sats, expected 6, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407180700, + "incorrect value for tow, expected 407180700, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -659,17 +829,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,2,195,4,22,0,22,69,24,130,246,255,255,241,4,0,0,35,196,255,255,0,0,0,0,6,0,240,133, }; + u8 encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 0, 22, 69, 24, 130, 246, 255, 255, 241, + 4, 0, 0, 35, 196, 255, 255, 0, 0, 0, 0, 6, 0, 240, 133, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; + msg_baseline_ned_dep_a_t* test_msg = + (msg_baseline_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -15325; test_msg->e = 1265; @@ -679,67 +855,89 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) test_msg->n_sats = 6; test_msg->tow = 407180800; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x203, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x203, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x203, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_dep_a_t* check_msg = ( msg_baseline_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_dep_a_t* check_msg = + (msg_baseline_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -15325, "incorrect value for d, expected -15325, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 1265, "incorrect value for e, expected 1265, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -2430, "incorrect value for n, expected -2430, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 6, "incorrect value for n_sats, expected 6, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407180800, "incorrect value for tow, expected 407180800, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -15325, + "incorrect value for d, expected -15325, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == 1265, + "incorrect value for e, expected 1265, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -2430, + "incorrect value for n, expected -2430, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 6, + "incorrect value for n_sats, expected 6, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407180800, + "incorrect value for tow, expected 407180800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -747,17 +945,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,2,195,4,22,100,22,69,24,32,251,255,255,199,11,0,0,57,161,255,255,0,0,0,0,6,0,12,181, }; + u8 encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 100, 22, 69, 24, 32, 251, 255, 255, 199, + 11, 0, 0, 57, 161, 255, 255, 0, 0, 0, 0, 6, 0, 12, 181, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; + msg_baseline_ned_dep_a_t* test_msg = + (msg_baseline_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -24263; test_msg->e = 3015; @@ -767,67 +971,89 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) test_msg->n_sats = 6; test_msg->tow = 407180900; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x203, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x203, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x203, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_dep_a_t* check_msg = ( msg_baseline_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_dep_a_t* check_msg = + (msg_baseline_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -24263, "incorrect value for d, expected -24263, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 3015, "incorrect value for e, expected 3015, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -1248, "incorrect value for n, expected -1248, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 6, "incorrect value for n_sats, expected 6, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407180900, "incorrect value for tow, expected 407180900, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -24263, + "incorrect value for d, expected -24263, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == 3015, + "incorrect value for e, expected 3015, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -1248, + "incorrect value for n, expected -1248, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 6, + "incorrect value for n_sats, expected 6, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407180900, + "incorrect value for tow, expected 407180900, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -835,17 +1061,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,2,195,4,22,200,22,69,24,33,251,255,255,199,11,0,0,54,161,255,255,0,0,0,0,6,0,86,58, }; + u8 encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 200, 22, 69, 24, 33, 251, 255, 255, 199, + 11, 0, 0, 54, 161, 255, 255, 0, 0, 0, 0, 6, 0, 86, 58, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; + msg_baseline_ned_dep_a_t* test_msg = + (msg_baseline_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -24266; test_msg->e = 3015; @@ -855,67 +1087,89 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) test_msg->n_sats = 6; test_msg->tow = 407181000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x203, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x203, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x203, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_dep_a_t* check_msg = ( msg_baseline_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_dep_a_t* check_msg = + (msg_baseline_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -24266, "incorrect value for d, expected -24266, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 3015, "incorrect value for e, expected 3015, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -1247, "incorrect value for n, expected -1247, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 6, "incorrect value for n_sats, expected 6, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407181000, "incorrect value for tow, expected 407181000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -24266, + "incorrect value for d, expected -24266, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == 3015, + "incorrect value for e, expected 3015, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -1247, + "incorrect value for n, expected -1247, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 6, + "incorrect value for n_sats, expected 6, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407181000, + "incorrect value for tow, expected 407181000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -923,17 +1177,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,2,195,4,22,44,23,69,24,110,6,0,0,55,8,0,0,160,166,255,255,0,0,0,0,6,0,51,249, }; + u8 encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 44, 23, 69, 24, 110, 6, 0, 0, 55, + 8, 0, 0, 160, 166, 255, 255, 0, 0, 0, 0, 6, 0, 51, 249, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; + msg_baseline_ned_dep_a_t* test_msg = + (msg_baseline_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -22880; test_msg->e = 2103; @@ -943,67 +1203,89 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) test_msg->n_sats = 6; test_msg->tow = 407181100; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x203, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x203, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x203, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_dep_a_t* check_msg = ( msg_baseline_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_dep_a_t* check_msg = + (msg_baseline_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -22880, "incorrect value for d, expected -22880, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 2103, "incorrect value for e, expected 2103, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == 1646, "incorrect value for n, expected 1646, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 6, "incorrect value for n_sats, expected 6, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407181100, "incorrect value for tow, expected 407181100, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -22880, + "incorrect value for d, expected -22880, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == 2103, + "incorrect value for e, expected 2103, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == 1646, + "incorrect value for n, expected 1646, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 6, + "incorrect value for n_sats, expected 6, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407181100, + "incorrect value for tow, expected 407181100, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -1011,17 +1293,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x203, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x203, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,2,195,4,22,144,23,69,24,110,6,0,0,54,8,0,0,160,166,255,255,0,0,0,0,6,0,206,22, }; + u8 encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 144, 23, 69, 24, 110, 6, 0, 0, 54, + 8, 0, 0, 160, 166, 255, 255, 0, 0, 0, 0, 6, 0, 206, 22, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; + msg_baseline_ned_dep_a_t* test_msg = + (msg_baseline_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -22880; test_msg->e = 2102; @@ -1031,71 +1319,95 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA ) test_msg->n_sats = 6; test_msg->tow = 407181200; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x203, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x203, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x203, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_ned_dep_a_t* check_msg = ( msg_baseline_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_ned_dep_a_t* check_msg = + (msg_baseline_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -22880, "incorrect value for d, expected -22880, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 2102, "incorrect value for e, expected 2102, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == 1646, "incorrect value for n, expected 1646, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 6, "incorrect value for n_sats, expected 6, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407181200, "incorrect value for tow, expected 407181200, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -22880, + "incorrect value for d, expected -22880, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == 2102, + "incorrect value for e, expected 2102, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == 1646, + "incorrect value for n, expected 1646, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 6, + "incorrect value for n_sats, expected 6, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407181200, + "incorrect value for tow, expected 407181200, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA); +Suite* legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgDops.c b/c/test/legacy/auto_check_sbp_navigation_MsgDops.c index b195b21c8..b4dbddcd7 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgDops.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgDops.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDops.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDops.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgDops ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgDops) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDops ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDops ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x208, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x208, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x208, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x208, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,8,2,66,0,15,100,0,0,0,2,0,6,0,5,0,5,0,5,0,0,244,4, }; + u8 encoded_frame[] = { + 85, 8, 2, 66, 0, 15, 100, 0, 0, 0, 2, 0, + 6, 0, 5, 0, 5, 0, 5, 0, 0, 244, 4, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_dops_t* test_msg = ( msg_dops_t* )test_msg_storage; + msg_dops_t *test_msg = (msg_dops_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->gdop = 2; @@ -150,69 +152,90 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDops ) test_msg->tdop = 5; test_msg->tow = 100; test_msg->vdop = 5; - sbp_payload_send(&sbp_state, 0x208, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x208, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x208, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_dops_t* check_msg = ( msg_dops_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_dops_t *check_msg = (msg_dops_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->gdop == 2, "incorrect value for gdop, expected 2, is %d", check_msg->gdop); - ck_assert_msg(check_msg->hdop == 5, "incorrect value for hdop, expected 5, is %d", check_msg->hdop); - ck_assert_msg(check_msg->pdop == 6, "incorrect value for pdop, expected 6, is %d", check_msg->pdop); - ck_assert_msg(check_msg->tdop == 5, "incorrect value for tdop, expected 5, is %d", check_msg->tdop); - ck_assert_msg(check_msg->tow == 100, "incorrect value for tow, expected 100, is %d", check_msg->tow); - ck_assert_msg(check_msg->vdop == 5, "incorrect value for vdop, expected 5, is %d", check_msg->vdop); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->gdop == 2, + "incorrect value for gdop, expected 2, is %d", + check_msg->gdop); + ck_assert_msg(check_msg->hdop == 5, + "incorrect value for hdop, expected 5, is %d", + check_msg->hdop); + ck_assert_msg(check_msg->pdop == 6, + "incorrect value for pdop, expected 6, is %d", + check_msg->pdop); + ck_assert_msg(check_msg->tdop == 5, + "incorrect value for tdop, expected 5, is %d", + check_msg->tdop); + ck_assert_msg(check_msg->tow == 100, + "incorrect value for tow, expected 100, is %d", + check_msg->tow); + ck_assert_msg(check_msg->vdop == 5, + "incorrect value for vdop, expected 5, is %d", + check_msg->vdop); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgDops_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgDops"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgDops"); +Suite *legacy_auto_check_sbp_navigation_MsgDops_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_navigation_MsgDops"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgDops"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgDops); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgDopsDepA.c b/c/test/legacy/auto_check_sbp_navigation_MsgDopsDepA.c index 8e96e8d18..ba966a4d5 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgDopsDepA.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgDopsDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDopsDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDopsDepA.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgDopsDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,6,2,246,215,14,8,48,39,0,180,0,190,0,170,0,160,0,150,0,121,170, }; + u8 encoded_frame[] = { + 85, 6, 2, 246, 215, 14, 8, 48, 39, 0, 180, + 0, 190, 0, 170, 0, 160, 0, 150, 0, 121, 170, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; + msg_dops_dep_a_t* test_msg = (msg_dops_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->gdop = 180; test_msg->hdop = 160; @@ -149,65 +151,84 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) test_msg->tdop = 170; test_msg->tow = 2568200; test_msg->vdop = 150; - sbp_payload_send(&sbp_state, 0x206, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x206, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x206, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_dops_dep_a_t* check_msg = ( msg_dops_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_dops_dep_a_t* check_msg = (msg_dops_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->gdop == 180, "incorrect value for gdop, expected 180, is %d", check_msg->gdop); - ck_assert_msg(check_msg->hdop == 160, "incorrect value for hdop, expected 160, is %d", check_msg->hdop); - ck_assert_msg(check_msg->pdop == 190, "incorrect value for pdop, expected 190, is %d", check_msg->pdop); - ck_assert_msg(check_msg->tdop == 170, "incorrect value for tdop, expected 170, is %d", check_msg->tdop); - ck_assert_msg(check_msg->tow == 2568200, "incorrect value for tow, expected 2568200, is %d", check_msg->tow); - ck_assert_msg(check_msg->vdop == 150, "incorrect value for vdop, expected 150, is %d", check_msg->vdop); + ck_assert_msg(check_msg->gdop == 180, + "incorrect value for gdop, expected 180, is %d", + check_msg->gdop); + ck_assert_msg(check_msg->hdop == 160, + "incorrect value for hdop, expected 160, is %d", + check_msg->hdop); + ck_assert_msg(check_msg->pdop == 190, + "incorrect value for pdop, expected 190, is %d", + check_msg->pdop); + ck_assert_msg(check_msg->tdop == 170, + "incorrect value for tdop, expected 170, is %d", + check_msg->tdop); + ck_assert_msg(check_msg->tow == 2568200, + "incorrect value for tow, expected 2568200, is %d", + check_msg->tow); + ck_assert_msg(check_msg->vdop == 150, + "incorrect value for vdop, expected 150, is %d", + check_msg->vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -215,17 +236,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,6,2,246,215,14,240,51,39,0,180,0,190,0,170,0,160,0,150,0,78,169, }; + u8 encoded_frame[] = { + 85, 6, 2, 246, 215, 14, 240, 51, 39, 0, 180, + 0, 190, 0, 170, 0, 160, 0, 150, 0, 78, 169, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; + msg_dops_dep_a_t* test_msg = (msg_dops_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->gdop = 180; test_msg->hdop = 160; @@ -233,65 +259,84 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) test_msg->tdop = 170; test_msg->tow = 2569200; test_msg->vdop = 150; - sbp_payload_send(&sbp_state, 0x206, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x206, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x206, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_dops_dep_a_t* check_msg = ( msg_dops_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_dops_dep_a_t* check_msg = (msg_dops_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->gdop == 180, "incorrect value for gdop, expected 180, is %d", check_msg->gdop); - ck_assert_msg(check_msg->hdop == 160, "incorrect value for hdop, expected 160, is %d", check_msg->hdop); - ck_assert_msg(check_msg->pdop == 190, "incorrect value for pdop, expected 190, is %d", check_msg->pdop); - ck_assert_msg(check_msg->tdop == 170, "incorrect value for tdop, expected 170, is %d", check_msg->tdop); - ck_assert_msg(check_msg->tow == 2569200, "incorrect value for tow, expected 2569200, is %d", check_msg->tow); - ck_assert_msg(check_msg->vdop == 150, "incorrect value for vdop, expected 150, is %d", check_msg->vdop); + ck_assert_msg(check_msg->gdop == 180, + "incorrect value for gdop, expected 180, is %d", + check_msg->gdop); + ck_assert_msg(check_msg->hdop == 160, + "incorrect value for hdop, expected 160, is %d", + check_msg->hdop); + ck_assert_msg(check_msg->pdop == 190, + "incorrect value for pdop, expected 190, is %d", + check_msg->pdop); + ck_assert_msg(check_msg->tdop == 170, + "incorrect value for tdop, expected 170, is %d", + check_msg->tdop); + ck_assert_msg(check_msg->tow == 2569200, + "incorrect value for tow, expected 2569200, is %d", + check_msg->tow); + ck_assert_msg(check_msg->vdop == 150, + "incorrect value for vdop, expected 150, is %d", + check_msg->vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -299,17 +344,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,6,2,246,215,14,216,55,39,0,180,0,190,0,170,0,160,0,150,0,71,218, }; + u8 encoded_frame[] = { + 85, 6, 2, 246, 215, 14, 216, 55, 39, 0, 180, + 0, 190, 0, 170, 0, 160, 0, 150, 0, 71, 218, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; + msg_dops_dep_a_t* test_msg = (msg_dops_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->gdop = 180; test_msg->hdop = 160; @@ -317,65 +367,84 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) test_msg->tdop = 170; test_msg->tow = 2570200; test_msg->vdop = 150; - sbp_payload_send(&sbp_state, 0x206, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x206, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x206, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_dops_dep_a_t* check_msg = ( msg_dops_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_dops_dep_a_t* check_msg = (msg_dops_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->gdop == 180, "incorrect value for gdop, expected 180, is %d", check_msg->gdop); - ck_assert_msg(check_msg->hdop == 160, "incorrect value for hdop, expected 160, is %d", check_msg->hdop); - ck_assert_msg(check_msg->pdop == 190, "incorrect value for pdop, expected 190, is %d", check_msg->pdop); - ck_assert_msg(check_msg->tdop == 170, "incorrect value for tdop, expected 170, is %d", check_msg->tdop); - ck_assert_msg(check_msg->tow == 2570200, "incorrect value for tow, expected 2570200, is %d", check_msg->tow); - ck_assert_msg(check_msg->vdop == 150, "incorrect value for vdop, expected 150, is %d", check_msg->vdop); + ck_assert_msg(check_msg->gdop == 180, + "incorrect value for gdop, expected 180, is %d", + check_msg->gdop); + ck_assert_msg(check_msg->hdop == 160, + "incorrect value for hdop, expected 160, is %d", + check_msg->hdop); + ck_assert_msg(check_msg->pdop == 190, + "incorrect value for pdop, expected 190, is %d", + check_msg->pdop); + ck_assert_msg(check_msg->tdop == 170, + "incorrect value for tdop, expected 170, is %d", + check_msg->tdop); + ck_assert_msg(check_msg->tow == 2570200, + "incorrect value for tow, expected 2570200, is %d", + check_msg->tow); + ck_assert_msg(check_msg->vdop == 150, + "incorrect value for vdop, expected 150, is %d", + check_msg->vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -383,17 +452,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,6,2,195,4,14,212,157,67,24,247,0,215,0,123,0,17,1,44,0,206,21, }; + u8 encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 212, 157, 67, 24, 247, + 0, 215, 0, 123, 0, 17, 1, 44, 0, 206, 21, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; + msg_dops_dep_a_t* test_msg = (msg_dops_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->gdop = 247; test_msg->hdop = 273; @@ -401,65 +475,84 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) test_msg->tdop = 123; test_msg->tow = 407084500; test_msg->vdop = 44; - sbp_payload_send(&sbp_state, 0x206, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x206, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x206, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_dops_dep_a_t* check_msg = ( msg_dops_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_dops_dep_a_t* check_msg = (msg_dops_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->gdop == 247, "incorrect value for gdop, expected 247, is %d", check_msg->gdop); - ck_assert_msg(check_msg->hdop == 273, "incorrect value for hdop, expected 273, is %d", check_msg->hdop); - ck_assert_msg(check_msg->pdop == 215, "incorrect value for pdop, expected 215, is %d", check_msg->pdop); - ck_assert_msg(check_msg->tdop == 123, "incorrect value for tdop, expected 123, is %d", check_msg->tdop); - ck_assert_msg(check_msg->tow == 407084500, "incorrect value for tow, expected 407084500, is %d", check_msg->tow); - ck_assert_msg(check_msg->vdop == 44, "incorrect value for vdop, expected 44, is %d", check_msg->vdop); + ck_assert_msg(check_msg->gdop == 247, + "incorrect value for gdop, expected 247, is %d", + check_msg->gdop); + ck_assert_msg(check_msg->hdop == 273, + "incorrect value for hdop, expected 273, is %d", + check_msg->hdop); + ck_assert_msg(check_msg->pdop == 215, + "incorrect value for pdop, expected 215, is %d", + check_msg->pdop); + ck_assert_msg(check_msg->tdop == 123, + "incorrect value for tdop, expected 123, is %d", + check_msg->tdop); + ck_assert_msg(check_msg->tow == 407084500, + "incorrect value for tow, expected 407084500, is %d", + check_msg->tow); + ck_assert_msg(check_msg->vdop == 44, + "incorrect value for vdop, expected 44, is %d", + check_msg->vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -467,17 +560,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,6,2,195,4,14,0,0,0,0,255,255,255,255,0,0,0,0,0,0,146,12, }; + u8 encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 0, 0, 0, 0, 255, + 255, 255, 255, 0, 0, 0, 0, 0, 0, 146, 12, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; + msg_dops_dep_a_t* test_msg = (msg_dops_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->gdop = 65535; test_msg->hdop = 0; @@ -485,65 +583,83 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) test_msg->tdop = 0; test_msg->tow = 0; test_msg->vdop = 0; - sbp_payload_send(&sbp_state, 0x206, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x206, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x206, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_dops_dep_a_t* check_msg = ( msg_dops_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_dops_dep_a_t* check_msg = (msg_dops_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->gdop == 65535, "incorrect value for gdop, expected 65535, is %d", check_msg->gdop); - ck_assert_msg(check_msg->hdop == 0, "incorrect value for hdop, expected 0, is %d", check_msg->hdop); - ck_assert_msg(check_msg->pdop == 65535, "incorrect value for pdop, expected 65535, is %d", check_msg->pdop); - ck_assert_msg(check_msg->tdop == 0, "incorrect value for tdop, expected 0, is %d", check_msg->tdop); - ck_assert_msg(check_msg->tow == 0, "incorrect value for tow, expected 0, is %d", check_msg->tow); - ck_assert_msg(check_msg->vdop == 0, "incorrect value for vdop, expected 0, is %d", check_msg->vdop); + ck_assert_msg(check_msg->gdop == 65535, + "incorrect value for gdop, expected 65535, is %d", + check_msg->gdop); + ck_assert_msg(check_msg->hdop == 0, + "incorrect value for hdop, expected 0, is %d", + check_msg->hdop); + ck_assert_msg(check_msg->pdop == 65535, + "incorrect value for pdop, expected 65535, is %d", + check_msg->pdop); + ck_assert_msg(check_msg->tdop == 0, + "incorrect value for tdop, expected 0, is %d", + check_msg->tdop); + ck_assert_msg(check_msg->tow == 0, + "incorrect value for tow, expected 0, is %d", check_msg->tow); + ck_assert_msg(check_msg->vdop == 0, + "incorrect value for vdop, expected 0, is %d", + check_msg->vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -551,17 +667,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,6,2,195,4,14,128,165,68,24,92,1,56,1,155,0,125,2,113,0,129,93, }; + u8 encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 128, 165, 68, 24, 92, + 1, 56, 1, 155, 0, 125, 2, 113, 0, 129, 93, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; + msg_dops_dep_a_t* test_msg = (msg_dops_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->gdop = 348; test_msg->hdop = 637; @@ -569,65 +690,84 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) test_msg->tdop = 155; test_msg->tow = 407152000; test_msg->vdop = 113; - sbp_payload_send(&sbp_state, 0x206, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x206, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x206, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_dops_dep_a_t* check_msg = ( msg_dops_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_dops_dep_a_t* check_msg = (msg_dops_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->gdop == 348, "incorrect value for gdop, expected 348, is %d", check_msg->gdop); - ck_assert_msg(check_msg->hdop == 637, "incorrect value for hdop, expected 637, is %d", check_msg->hdop); - ck_assert_msg(check_msg->pdop == 312, "incorrect value for pdop, expected 312, is %d", check_msg->pdop); - ck_assert_msg(check_msg->tdop == 155, "incorrect value for tdop, expected 155, is %d", check_msg->tdop); - ck_assert_msg(check_msg->tow == 407152000, "incorrect value for tow, expected 407152000, is %d", check_msg->tow); - ck_assert_msg(check_msg->vdop == 113, "incorrect value for vdop, expected 113, is %d", check_msg->vdop); + ck_assert_msg(check_msg->gdop == 348, + "incorrect value for gdop, expected 348, is %d", + check_msg->gdop); + ck_assert_msg(check_msg->hdop == 637, + "incorrect value for hdop, expected 637, is %d", + check_msg->hdop); + ck_assert_msg(check_msg->pdop == 312, + "incorrect value for pdop, expected 312, is %d", + check_msg->pdop); + ck_assert_msg(check_msg->tdop == 155, + "incorrect value for tdop, expected 155, is %d", + check_msg->tdop); + ck_assert_msg(check_msg->tow == 407152000, + "incorrect value for tow, expected 407152000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->vdop == 113, + "incorrect value for vdop, expected 113, is %d", + check_msg->vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -635,17 +775,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,6,2,195,4,14,104,169,68,24,92,1,55,1,155,0,125,2,113,0,209,128, }; + u8 encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 104, 169, 68, 24, 92, + 1, 55, 1, 155, 0, 125, 2, 113, 0, 209, 128, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; + msg_dops_dep_a_t* test_msg = (msg_dops_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->gdop = 348; test_msg->hdop = 637; @@ -653,65 +798,84 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) test_msg->tdop = 155; test_msg->tow = 407153000; test_msg->vdop = 113; - sbp_payload_send(&sbp_state, 0x206, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x206, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x206, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_dops_dep_a_t* check_msg = ( msg_dops_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_dops_dep_a_t* check_msg = (msg_dops_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->gdop == 348, "incorrect value for gdop, expected 348, is %d", check_msg->gdop); - ck_assert_msg(check_msg->hdop == 637, "incorrect value for hdop, expected 637, is %d", check_msg->hdop); - ck_assert_msg(check_msg->pdop == 311, "incorrect value for pdop, expected 311, is %d", check_msg->pdop); - ck_assert_msg(check_msg->tdop == 155, "incorrect value for tdop, expected 155, is %d", check_msg->tdop); - ck_assert_msg(check_msg->tow == 407153000, "incorrect value for tow, expected 407153000, is %d", check_msg->tow); - ck_assert_msg(check_msg->vdop == 113, "incorrect value for vdop, expected 113, is %d", check_msg->vdop); + ck_assert_msg(check_msg->gdop == 348, + "incorrect value for gdop, expected 348, is %d", + check_msg->gdop); + ck_assert_msg(check_msg->hdop == 637, + "incorrect value for hdop, expected 637, is %d", + check_msg->hdop); + ck_assert_msg(check_msg->pdop == 311, + "incorrect value for pdop, expected 311, is %d", + check_msg->pdop); + ck_assert_msg(check_msg->tdop == 155, + "incorrect value for tdop, expected 155, is %d", + check_msg->tdop); + ck_assert_msg(check_msg->tow == 407153000, + "incorrect value for tow, expected 407153000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->vdop == 113, + "incorrect value for vdop, expected 113, is %d", + check_msg->vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -719,17 +883,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,6,2,195,4,14,80,173,68,24,92,1,55,1,155,0,125,2,112,0,30,6, }; + u8 encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 80, 173, 68, 24, 92, + 1, 55, 1, 155, 0, 125, 2, 112, 0, 30, 6, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; + msg_dops_dep_a_t* test_msg = (msg_dops_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->gdop = 348; test_msg->hdop = 637; @@ -737,65 +906,84 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) test_msg->tdop = 155; test_msg->tow = 407154000; test_msg->vdop = 112; - sbp_payload_send(&sbp_state, 0x206, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x206, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x206, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_dops_dep_a_t* check_msg = ( msg_dops_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_dops_dep_a_t* check_msg = (msg_dops_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->gdop == 348, "incorrect value for gdop, expected 348, is %d", check_msg->gdop); - ck_assert_msg(check_msg->hdop == 637, "incorrect value for hdop, expected 637, is %d", check_msg->hdop); - ck_assert_msg(check_msg->pdop == 311, "incorrect value for pdop, expected 311, is %d", check_msg->pdop); - ck_assert_msg(check_msg->tdop == 155, "incorrect value for tdop, expected 155, is %d", check_msg->tdop); - ck_assert_msg(check_msg->tow == 407154000, "incorrect value for tow, expected 407154000, is %d", check_msg->tow); - ck_assert_msg(check_msg->vdop == 112, "incorrect value for vdop, expected 112, is %d", check_msg->vdop); + ck_assert_msg(check_msg->gdop == 348, + "incorrect value for gdop, expected 348, is %d", + check_msg->gdop); + ck_assert_msg(check_msg->hdop == 637, + "incorrect value for hdop, expected 637, is %d", + check_msg->hdop); + ck_assert_msg(check_msg->pdop == 311, + "incorrect value for pdop, expected 311, is %d", + check_msg->pdop); + ck_assert_msg(check_msg->tdop == 155, + "incorrect value for tdop, expected 155, is %d", + check_msg->tdop); + ck_assert_msg(check_msg->tow == 407154000, + "incorrect value for tow, expected 407154000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->vdop == 112, + "incorrect value for vdop, expected 112, is %d", + check_msg->vdop); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -803,17 +991,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x206, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x206, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,6,2,195,4,14,56,177,68,24,92,1,55,1,155,0,125,2,112,0,70,67, }; + u8 encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 56, 177, 68, 24, 92, + 1, 55, 1, 155, 0, 125, 2, 112, 0, 70, 67, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; + msg_dops_dep_a_t* test_msg = (msg_dops_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->gdop = 348; test_msg->hdop = 637; @@ -821,68 +1014,87 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgDopsDepA ) test_msg->tdop = 155; test_msg->tow = 407155000; test_msg->vdop = 112; - sbp_payload_send(&sbp_state, 0x206, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x206, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x206, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_dops_dep_a_t* check_msg = ( msg_dops_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_dops_dep_a_t* check_msg = (msg_dops_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->gdop == 348, "incorrect value for gdop, expected 348, is %d", check_msg->gdop); - ck_assert_msg(check_msg->hdop == 637, "incorrect value for hdop, expected 637, is %d", check_msg->hdop); - ck_assert_msg(check_msg->pdop == 311, "incorrect value for pdop, expected 311, is %d", check_msg->pdop); - ck_assert_msg(check_msg->tdop == 155, "incorrect value for tdop, expected 155, is %d", check_msg->tdop); - ck_assert_msg(check_msg->tow == 407155000, "incorrect value for tow, expected 407155000, is %d", check_msg->tow); - ck_assert_msg(check_msg->vdop == 112, "incorrect value for vdop, expected 112, is %d", check_msg->vdop); + ck_assert_msg(check_msg->gdop == 348, + "incorrect value for gdop, expected 348, is %d", + check_msg->gdop); + ck_assert_msg(check_msg->hdop == 637, + "incorrect value for hdop, expected 637, is %d", + check_msg->hdop); + ck_assert_msg(check_msg->pdop == 311, + "incorrect value for pdop, expected 311, is %d", + check_msg->pdop); + ck_assert_msg(check_msg->tdop == 155, + "incorrect value for tdop, expected 155, is %d", + check_msg->tdop); + ck_assert_msg(check_msg->tow == 407155000, + "incorrect value for tow, expected 407155000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->vdop == 112, + "incorrect value for vdop, expected 112, is %d", + check_msg->vdop); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgDopsDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgDopsDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgDopsDepA"); +Suite* legacy_auto_check_sbp_navigation_MsgDopsDepA_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_navigation_MsgDopsDepA"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgDopsDepA"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgDopsDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgGPSTime.c b/c/test/legacy/auto_check_sbp_navigation_MsgGPSTime.c index 0b1d32d51..866c38347 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgGPSTime.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgGPSTime.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTime.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTime ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgGPSTime) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTime ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,79 +128,99 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTime ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x102, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x102, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x102, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x102, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,1,211,136,11,128,7,40,244,122,19,244,139,2,0,0,34,152, }; + u8 encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 40, 244, + 122, 19, 244, 139, 2, 0, 0, 34, 152, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_t* test_msg = ( msg_gps_time_t* )test_msg_storage; + msg_gps_time_t* test_msg = (msg_gps_time_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 166900; test_msg->tow = 326825000; test_msg->wn = 1920; - sbp_payload_send(&sbp_state, 0x102, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x102, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x102, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_t* check_msg = ( msg_gps_time_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_t* check_msg = (msg_gps_time_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 166900, "incorrect value for ns_residual, expected 166900, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 326825000, "incorrect value for tow, expected 326825000, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1920, "incorrect value for wn, expected 1920, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 166900, + "incorrect value for ns_residual, expected 166900, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 326825000, + "incorrect value for tow, expected 326825000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1920, + "incorrect value for wn, expected 1920, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -211,79 +228,99 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTime ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x102, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x102, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x102, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x102, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,1,211,136,11,128,7,28,246,122,19,126,234,3,0,0,65,3, }; + u8 encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 28, 246, + 122, 19, 126, 234, 3, 0, 0, 65, 3, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_t* test_msg = ( msg_gps_time_t* )test_msg_storage; + msg_gps_time_t* test_msg = (msg_gps_time_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 256638; test_msg->tow = 326825500; test_msg->wn = 1920; - sbp_payload_send(&sbp_state, 0x102, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x102, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x102, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_t* check_msg = ( msg_gps_time_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_t* check_msg = (msg_gps_time_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 256638, "incorrect value for ns_residual, expected 256638, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 326825500, "incorrect value for tow, expected 326825500, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1920, "incorrect value for wn, expected 1920, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 256638, + "incorrect value for ns_residual, expected 256638, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 326825500, + "incorrect value for tow, expected 326825500, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1920, + "incorrect value for wn, expected 1920, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -291,79 +328,99 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTime ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x102, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x102, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x102, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x102, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,1,211,136,11,128,7,16,248,122,19,129,12,4,0,0,12,84, }; + u8 encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 16, 248, + 122, 19, 129, 12, 4, 0, 0, 12, 84, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_t* test_msg = ( msg_gps_time_t* )test_msg_storage; + msg_gps_time_t* test_msg = (msg_gps_time_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 265345; test_msg->tow = 326826000; test_msg->wn = 1920; - sbp_payload_send(&sbp_state, 0x102, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x102, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x102, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_t* check_msg = ( msg_gps_time_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_t* check_msg = (msg_gps_time_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 265345, "incorrect value for ns_residual, expected 265345, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 326826000, "incorrect value for tow, expected 326826000, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1920, "incorrect value for wn, expected 1920, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 265345, + "incorrect value for ns_residual, expected 265345, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 326826000, + "incorrect value for tow, expected 326826000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1920, + "incorrect value for wn, expected 1920, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -371,79 +428,99 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTime ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x102, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x102, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x102, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x102, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,1,211,136,11,128,7,4,250,122,19,137,204,4,0,0,50,165, }; + u8 encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 4, 250, + 122, 19, 137, 204, 4, 0, 0, 50, 165, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_t* test_msg = ( msg_gps_time_t* )test_msg_storage; + msg_gps_time_t* test_msg = (msg_gps_time_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 314505; test_msg->tow = 326826500; test_msg->wn = 1920; - sbp_payload_send(&sbp_state, 0x102, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x102, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x102, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_t* check_msg = ( msg_gps_time_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_t* check_msg = (msg_gps_time_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 314505, "incorrect value for ns_residual, expected 314505, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 326826500, "incorrect value for tow, expected 326826500, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1920, "incorrect value for wn, expected 1920, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 314505, + "incorrect value for ns_residual, expected 314505, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 326826500, + "incorrect value for tow, expected 326826500, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1920, + "incorrect value for wn, expected 1920, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -451,82 +528,102 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTime ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x102, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x102, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x102, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x102, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,1,211,136,11,128,7,248,251,122,19,181,137,5,0,0,180,33, }; + u8 encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 248, 251, + 122, 19, 181, 137, 5, 0, 0, 180, 33, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_t* test_msg = ( msg_gps_time_t* )test_msg_storage; + msg_gps_time_t* test_msg = (msg_gps_time_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 362933; test_msg->tow = 326827000; test_msg->wn = 1920; - sbp_payload_send(&sbp_state, 0x102, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x102, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x102, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_t* check_msg = ( msg_gps_time_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_t* check_msg = (msg_gps_time_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 362933, "incorrect value for ns_residual, expected 362933, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 326827000, "incorrect value for tow, expected 326827000, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1920, "incorrect value for wn, expected 1920, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 362933, + "incorrect value for ns_residual, expected 362933, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 326827000, + "incorrect value for tow, expected 326827000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1920, + "incorrect value for wn, expected 1920, is %d", + check_msg->wn); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgGPSTime_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgGPSTime"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgGPSTime"); +Suite* legacy_auto_check_sbp_navigation_MsgGPSTime_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_navigation_MsgGPSTime"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgGPSTime"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgGPSTime); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgGPSTimeDepA.c b/c/test/legacy/auto_check_sbp_navigation_MsgGPSTimeDepA.c index cf5f25b4c..fb804a7c7 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgGPSTimeDepA.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgGPSTimeDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,79 +128,99 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,1,246,215,11,251,6,120,46,39,0,0,0,0,0,0,133,36, }; + u8 encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 120, 46, 39, 0, 0, 0, 0, 0, 0, 133, 36, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; + msg_gps_time_dep_a_t* test_msg = (msg_gps_time_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 0; test_msg->tow = 2567800; test_msg->wn = 1787; - sbp_payload_send(&sbp_state, 0x100, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x100, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x100, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_dep_a_t* check_msg = ( msg_gps_time_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_dep_a_t* check_msg = + (msg_gps_time_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 0, "incorrect value for ns_residual, expected 0, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 2567800, "incorrect value for tow, expected 2567800, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1787, "incorrect value for wn, expected 1787, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 0, + "incorrect value for ns_residual, expected 0, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 2567800, + "incorrect value for tow, expected 2567800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1787, + "incorrect value for wn, expected 1787, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -211,79 +228,99 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,1,246,215,11,251,6,220,46,39,0,0,0,0,0,0,36,160, }; + u8 encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 220, 46, 39, 0, 0, 0, 0, 0, 0, 36, 160, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; + msg_gps_time_dep_a_t* test_msg = (msg_gps_time_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 0; test_msg->tow = 2567900; test_msg->wn = 1787; - sbp_payload_send(&sbp_state, 0x100, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x100, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x100, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_dep_a_t* check_msg = ( msg_gps_time_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_dep_a_t* check_msg = + (msg_gps_time_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 0, "incorrect value for ns_residual, expected 0, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 2567900, "incorrect value for tow, expected 2567900, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1787, "incorrect value for wn, expected 1787, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 0, + "incorrect value for ns_residual, expected 0, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 2567900, + "incorrect value for tow, expected 2567900, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1787, + "incorrect value for wn, expected 1787, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -291,79 +328,99 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,1,246,215,11,251,6,64,47,39,0,0,0,0,0,0,171,190, }; + u8 encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 64, 47, 39, 0, 0, 0, 0, 0, 0, 171, 190, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; + msg_gps_time_dep_a_t* test_msg = (msg_gps_time_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 0; test_msg->tow = 2568000; test_msg->wn = 1787; - sbp_payload_send(&sbp_state, 0x100, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x100, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x100, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_dep_a_t* check_msg = ( msg_gps_time_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_dep_a_t* check_msg = + (msg_gps_time_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 0, "incorrect value for ns_residual, expected 0, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 2568000, "incorrect value for tow, expected 2568000, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1787, "incorrect value for wn, expected 1787, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 0, + "incorrect value for ns_residual, expected 0, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 2568000, + "incorrect value for tow, expected 2568000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1787, + "incorrect value for wn, expected 1787, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -371,79 +428,99 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,1,246,215,11,251,6,164,47,39,0,0,0,0,0,0,211,101, }; + u8 encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 164, 47, 39, 0, 0, 0, 0, 0, 0, 211, 101, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; + msg_gps_time_dep_a_t* test_msg = (msg_gps_time_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 0; test_msg->tow = 2568100; test_msg->wn = 1787; - sbp_payload_send(&sbp_state, 0x100, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x100, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x100, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_dep_a_t* check_msg = ( msg_gps_time_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_dep_a_t* check_msg = + (msg_gps_time_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 0, "incorrect value for ns_residual, expected 0, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 2568100, "incorrect value for tow, expected 2568100, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1787, "incorrect value for wn, expected 1787, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 0, + "incorrect value for ns_residual, expected 0, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 2568100, + "incorrect value for tow, expected 2568100, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1787, + "incorrect value for wn, expected 1787, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -451,79 +528,99 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,1,246,215,11,251,6,8,48,39,0,0,0,0,0,0,251,44, }; + u8 encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 8, 48, 39, 0, 0, 0, 0, 0, 0, 251, 44, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; + msg_gps_time_dep_a_t* test_msg = (msg_gps_time_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 0; test_msg->tow = 2568200; test_msg->wn = 1787; - sbp_payload_send(&sbp_state, 0x100, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x100, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x100, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_dep_a_t* check_msg = ( msg_gps_time_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_dep_a_t* check_msg = + (msg_gps_time_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 0, "incorrect value for ns_residual, expected 0, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 2568200, "incorrect value for tow, expected 2568200, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1787, "incorrect value for wn, expected 1787, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 0, + "incorrect value for ns_residual, expected 0, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 2568200, + "incorrect value for tow, expected 2568200, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1787, + "incorrect value for wn, expected 1787, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -531,79 +628,100 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,1,195,4,11,46,7,212,157,67,24,111,147,252,255,0,215,190, }; + u8 encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 212, 157, + 67, 24, 111, 147, 252, 255, 0, 215, 190, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; + msg_gps_time_dep_a_t* test_msg = (msg_gps_time_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = -224401; test_msg->tow = 407084500; test_msg->wn = 1838; - sbp_payload_send(&sbp_state, 0x100, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x100, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x100, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_dep_a_t* check_msg = ( msg_gps_time_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_dep_a_t* check_msg = + (msg_gps_time_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == -224401, "incorrect value for ns_residual, expected -224401, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 407084500, "incorrect value for tow, expected 407084500, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1838, "incorrect value for wn, expected 1838, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == -224401, + "incorrect value for ns_residual, expected -224401, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 407084500, + "incorrect value for tow, expected 407084500, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1838, + "incorrect value for wn, expected 1838, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -611,79 +729,100 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,1,195,4,11,46,7,56,158,67,24,109,103,3,0,0,134,89, }; + u8 encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 56, 158, + 67, 24, 109, 103, 3, 0, 0, 134, 89, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; + msg_gps_time_dep_a_t* test_msg = (msg_gps_time_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 223085; test_msg->tow = 407084600; test_msg->wn = 1838; - sbp_payload_send(&sbp_state, 0x100, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x100, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x100, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_dep_a_t* check_msg = ( msg_gps_time_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_dep_a_t* check_msg = + (msg_gps_time_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 223085, "incorrect value for ns_residual, expected 223085, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 407084600, "incorrect value for tow, expected 407084600, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1838, "incorrect value for wn, expected 1838, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 223085, + "incorrect value for ns_residual, expected 223085, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 407084600, + "incorrect value for tow, expected 407084600, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1838, + "incorrect value for wn, expected 1838, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -691,79 +830,100 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,1,195,4,11,46,7,156,158,67,24,233,152,252,255,0,206,241, }; + u8 encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 156, 158, + 67, 24, 233, 152, 252, 255, 0, 206, 241, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; + msg_gps_time_dep_a_t* test_msg = (msg_gps_time_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = -222999; test_msg->tow = 407084700; test_msg->wn = 1838; - sbp_payload_send(&sbp_state, 0x100, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x100, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x100, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_dep_a_t* check_msg = ( msg_gps_time_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_dep_a_t* check_msg = + (msg_gps_time_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == -222999, "incorrect value for ns_residual, expected -222999, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 407084700, "incorrect value for tow, expected 407084700, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1838, "incorrect value for wn, expected 1838, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == -222999, + "incorrect value for ns_residual, expected -222999, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 407084700, + "incorrect value for tow, expected 407084700, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1838, + "incorrect value for wn, expected 1838, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -771,79 +931,99 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,1,195,4,11,46,7,0,159,67,24,240,154,3,0,0,147,98, }; + u8 encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 0, 159, 67, 24, 240, 154, 3, 0, 0, 147, 98, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; + msg_gps_time_dep_a_t* test_msg = (msg_gps_time_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 236272; test_msg->tow = 407084800; test_msg->wn = 1838; - sbp_payload_send(&sbp_state, 0x100, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x100, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x100, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_dep_a_t* check_msg = ( msg_gps_time_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_dep_a_t* check_msg = + (msg_gps_time_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 236272, "incorrect value for ns_residual, expected 236272, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 407084800, "incorrect value for tow, expected 407084800, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1838, "incorrect value for wn, expected 1838, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 236272, + "incorrect value for ns_residual, expected 236272, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 407084800, + "incorrect value for tow, expected 407084800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1838, + "incorrect value for wn, expected 1838, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -851,79 +1031,100 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,1,195,4,11,46,7,100,159,67,24,144,101,252,255,0,186,152, }; + u8 encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 100, 159, + 67, 24, 144, 101, 252, 255, 0, 186, 152, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; + msg_gps_time_dep_a_t* test_msg = (msg_gps_time_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = -236144; test_msg->tow = 407084900; test_msg->wn = 1838; - sbp_payload_send(&sbp_state, 0x100, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x100, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x100, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_dep_a_t* check_msg = ( msg_gps_time_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_dep_a_t* check_msg = + (msg_gps_time_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == -236144, "incorrect value for ns_residual, expected -236144, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 407084900, "incorrect value for tow, expected 407084900, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1838, "incorrect value for wn, expected 1838, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == -236144, + "incorrect value for ns_residual, expected -236144, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 407084900, + "incorrect value for tow, expected 407084900, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1838, + "incorrect value for wn, expected 1838, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -931,82 +1132,104 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x100, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x100, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,1,195,4,11,46,7,46,162,68,24,205,230,250,255,0,11,225, }; + u8 encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 46, 162, + 68, 24, 205, 230, 250, 255, 0, 11, 225, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; + msg_gps_time_dep_a_t* test_msg = (msg_gps_time_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = -334131; test_msg->tow = 407151150; test_msg->wn = 1838; - sbp_payload_send(&sbp_state, 0x100, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x100, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x100, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_dep_a_t* check_msg = ( msg_gps_time_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_dep_a_t* check_msg = + (msg_gps_time_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == -334131, "incorrect value for ns_residual, expected -334131, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 407151150, "incorrect value for tow, expected 407151150, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1838, "incorrect value for wn, expected 1838, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == -334131, + "incorrect value for ns_residual, expected -334131, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 407151150, + "incorrect value for tow, expected 407151150, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1838, + "incorrect value for wn, expected 1838, is %d", + check_msg->wn); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgGPSTimeDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgGPSTimeDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA"); +Suite* legacy_auto_check_sbp_navigation_MsgGPSTimeDepA_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgGPSTimeDepA"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgGPSTimeGNSS.c b/c/test/legacy/auto_check_sbp_navigation_MsgGPSTimeGNSS.c index 0b8bc5e03..c155e7180 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgGPSTimeGNSS.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgGPSTimeGNSS.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeGNSS.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,79 +128,100 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x104, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x104, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x104, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x104, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,1,211,136,11,128,7,40,244,122,19,244,139,2,0,0,153,88, }; + u8 encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 40, 244, + 122, 19, 244, 139, 2, 0, 0, 153, 88, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_gnss_t* test_msg = ( msg_gps_time_gnss_t* )test_msg_storage; + msg_gps_time_gnss_t* test_msg = (msg_gps_time_gnss_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 166900; test_msg->tow = 326825000; test_msg->wn = 1920; - sbp_payload_send(&sbp_state, 0x104, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x104, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x104, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_gnss_t* check_msg = ( msg_gps_time_gnss_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_gnss_t* check_msg = + (msg_gps_time_gnss_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 166900, "incorrect value for ns_residual, expected 166900, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 326825000, "incorrect value for tow, expected 326825000, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1920, "incorrect value for wn, expected 1920, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 166900, + "incorrect value for ns_residual, expected 166900, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 326825000, + "incorrect value for tow, expected 326825000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1920, + "incorrect value for wn, expected 1920, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -211,79 +229,100 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x104, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x104, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x104, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x104, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,1,211,136,11,128,7,28,246,122,19,126,234,3,0,0,250,195, }; + u8 encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 28, 246, + 122, 19, 126, 234, 3, 0, 0, 250, 195, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_gnss_t* test_msg = ( msg_gps_time_gnss_t* )test_msg_storage; + msg_gps_time_gnss_t* test_msg = (msg_gps_time_gnss_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 256638; test_msg->tow = 326825500; test_msg->wn = 1920; - sbp_payload_send(&sbp_state, 0x104, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x104, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x104, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_gnss_t* check_msg = ( msg_gps_time_gnss_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_gnss_t* check_msg = + (msg_gps_time_gnss_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 256638, "incorrect value for ns_residual, expected 256638, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 326825500, "incorrect value for tow, expected 326825500, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1920, "incorrect value for wn, expected 1920, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 256638, + "incorrect value for ns_residual, expected 256638, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 326825500, + "incorrect value for tow, expected 326825500, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1920, + "incorrect value for wn, expected 1920, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -291,79 +330,100 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x104, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x104, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x104, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x104, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,1,211,136,11,128,7,16,248,122,19,129,12,4,0,0,183,148, }; + u8 encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 16, 248, + 122, 19, 129, 12, 4, 0, 0, 183, 148, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_gnss_t* test_msg = ( msg_gps_time_gnss_t* )test_msg_storage; + msg_gps_time_gnss_t* test_msg = (msg_gps_time_gnss_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 265345; test_msg->tow = 326826000; test_msg->wn = 1920; - sbp_payload_send(&sbp_state, 0x104, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x104, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x104, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_gnss_t* check_msg = ( msg_gps_time_gnss_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_gnss_t* check_msg = + (msg_gps_time_gnss_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 265345, "incorrect value for ns_residual, expected 265345, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 326826000, "incorrect value for tow, expected 326826000, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1920, "incorrect value for wn, expected 1920, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 265345, + "incorrect value for ns_residual, expected 265345, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 326826000, + "incorrect value for tow, expected 326826000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1920, + "incorrect value for wn, expected 1920, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -371,79 +431,100 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x104, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x104, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x104, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x104, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,1,211,136,11,128,7,4,250,122,19,137,204,4,0,0,137,101, }; + u8 encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 4, 250, + 122, 19, 137, 204, 4, 0, 0, 137, 101, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_gnss_t* test_msg = ( msg_gps_time_gnss_t* )test_msg_storage; + msg_gps_time_gnss_t* test_msg = (msg_gps_time_gnss_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 314505; test_msg->tow = 326826500; test_msg->wn = 1920; - sbp_payload_send(&sbp_state, 0x104, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x104, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x104, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_gnss_t* check_msg = ( msg_gps_time_gnss_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_gnss_t* check_msg = + (msg_gps_time_gnss_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 314505, "incorrect value for ns_residual, expected 314505, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 326826500, "incorrect value for tow, expected 326826500, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1920, "incorrect value for wn, expected 1920, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 314505, + "incorrect value for ns_residual, expected 314505, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 326826500, + "incorrect value for tow, expected 326826500, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1920, + "incorrect value for wn, expected 1920, is %d", + check_msg->wn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -451,82 +532,104 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x104, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x104, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x104, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x104, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,1,211,136,11,128,7,248,251,122,19,181,137,5,0,0,15,225, }; + u8 encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 248, 251, + 122, 19, 181, 137, 5, 0, 0, 15, 225, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gps_time_gnss_t* test_msg = ( msg_gps_time_gnss_t* )test_msg_storage; + msg_gps_time_gnss_t* test_msg = (msg_gps_time_gnss_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->ns_residual = 362933; test_msg->tow = 326827000; test_msg->wn = 1920; - sbp_payload_send(&sbp_state, 0x104, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x104, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x104, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gps_time_gnss_t* check_msg = ( msg_gps_time_gnss_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gps_time_gnss_t* check_msg = + (msg_gps_time_gnss_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->ns_residual == 362933, "incorrect value for ns_residual, expected 362933, is %d", check_msg->ns_residual); - ck_assert_msg(check_msg->tow == 326827000, "incorrect value for tow, expected 326827000, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 1920, "incorrect value for wn, expected 1920, is %d", check_msg->wn); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->ns_residual == 362933, + "incorrect value for ns_residual, expected 362933, is %d", + check_msg->ns_residual); + ck_assert_msg(check_msg->tow == 326827000, + "incorrect value for tow, expected 326827000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 1920, + "incorrect value for wn, expected 1920, is %d", + check_msg->wn); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS"); +Suite* legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgPosECEF.c b/c/test/legacy/auto_check_sbp_navigation_MsgPosECEF.c index 1d56e21a6..bdb986baa 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgPosECEF.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgPosECEF.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEF.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEF ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgPosECEF) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEF ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEF ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x209, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x209, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x209, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x209, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,9,2,211,136,32,16,248,122,19,73,29,46,132,182,122,68,193,219,192,29,176,121,119,80,193,83,11,210,90,79,75,77,65,0,0,15,2,84,6, }; + u8 encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 16, 248, 122, 19, 73, 29, 46, 132, + 182, 122, 68, 193, 219, 192, 29, 176, 121, 119, 80, 193, 83, 11, + 210, 90, 79, 75, 77, 65, 0, 0, 15, 2, 84, 6, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_t* test_msg = ( msg_pos_ecef_t* )test_msg_storage; + msg_pos_ecef_t* test_msg = (msg_pos_ecef_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 2; @@ -150,66 +153,87 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEF ) test_msg->x = -2684269.0326572997; test_msg->y = -4316646.751816; test_msg->z = 3839646.7095350414; - sbp_payload_send(&sbp_state, 0x209, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x209, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x209, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_t* check_msg = ( msg_pos_ecef_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_t* check_msg = (msg_pos_ecef_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 2, "incorrect value for flags, expected 2, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326826000, "incorrect value for tow, expected 326826000, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2684269.03266*100) < 0.05, "incorrect value for x, expected -2684269.03266, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4316646.75182*100) < 0.05, "incorrect value for y, expected -4316646.75182, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3839646.70954*100) < 0.05, "incorrect value for z, expected 3839646.70954, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 2, + "incorrect value for flags, expected 2, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326826000, + "incorrect value for tow, expected 326826000, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2684269.03266 * 100) < 0.05, + "incorrect value for x, expected -2684269.03266, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4316646.75182 * 100) < 0.05, + "incorrect value for y, expected -4316646.75182, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3839646.70954 * 100) < 0.05, + "incorrect value for z, expected 3839646.70954, is %f", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -217,17 +241,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEF ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x209, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x209, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x209, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x209, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,9,2,211,136,32,248,251,122,19,103,106,57,136,182,122,68,193,176,242,200,176,121,119,80,193,244,135,97,59,79,75,77,65,0,0,15,2,147,216, }; + u8 encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 248, 251, 122, 19, 103, 106, 57, 136, + 182, 122, 68, 193, 176, 242, 200, 176, 121, 119, 80, 193, 244, 135, + 97, 59, 79, 75, 77, 65, 0, 0, 15, 2, 147, 216, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_t* test_msg = ( msg_pos_ecef_t* )test_msg_storage; + msg_pos_ecef_t* test_msg = (msg_pos_ecef_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 2; @@ -236,66 +266,87 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEF ) test_msg->x = -2684269.064252186; test_msg->y = -4316646.762264892; test_msg->z = 3839646.463913912; - sbp_payload_send(&sbp_state, 0x209, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x209, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x209, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_t* check_msg = ( msg_pos_ecef_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_t* check_msg = (msg_pos_ecef_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 2, "incorrect value for flags, expected 2, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326827000, "incorrect value for tow, expected 326827000, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2684269.06425*100) < 0.05, "incorrect value for x, expected -2684269.06425, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4316646.76226*100) < 0.05, "incorrect value for y, expected -4316646.76226, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3839646.46391*100) < 0.05, "incorrect value for z, expected 3839646.46391, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 2, + "incorrect value for flags, expected 2, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326827000, + "incorrect value for tow, expected 326827000, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2684269.06425 * 100) < 0.05, + "incorrect value for x, expected -2684269.06425, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4316646.76226 * 100) < 0.05, + "incorrect value for y, expected -4316646.76226, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3839646.46391 * 100) < 0.05, + "incorrect value for z, expected 3839646.46391, is %f", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -303,17 +354,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEF ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x209, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x209, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x209, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x209, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,9,2,211,136,32,224,255,122,19,101,179,242,182,182,122,68,193,130,196,145,199,121,119,80,193,212,10,253,15,79,75,77,65,0,0,15,2,40,201, }; + u8 encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 224, 255, 122, 19, 101, 179, 242, 182, + 182, 122, 68, 193, 130, 196, 145, 199, 121, 119, 80, 193, 212, 10, + 253, 15, 79, 75, 77, 65, 0, 0, 15, 2, 40, 201, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_t* test_msg = ( msg_pos_ecef_t* )test_msg_storage; + msg_pos_ecef_t* test_msg = (msg_pos_ecef_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 2; @@ -322,66 +379,87 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEF ) test_msg->x = -2684269.4292816394; test_msg->y = -4316647.118271949; test_msg->z = 3839646.124909738; - sbp_payload_send(&sbp_state, 0x209, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x209, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x209, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_t* check_msg = ( msg_pos_ecef_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_t* check_msg = (msg_pos_ecef_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 2, "incorrect value for flags, expected 2, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326828000, "incorrect value for tow, expected 326828000, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2684269.42928*100) < 0.05, "incorrect value for x, expected -2684269.42928, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4316647.11827*100) < 0.05, "incorrect value for y, expected -4316647.11827, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3839646.12491*100) < 0.05, "incorrect value for z, expected 3839646.12491, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 2, + "incorrect value for flags, expected 2, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326828000, + "incorrect value for tow, expected 326828000, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2684269.42928 * 100) < 0.05, + "incorrect value for x, expected -2684269.42928, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4316647.11827 * 100) < 0.05, + "incorrect value for y, expected -4316647.11827, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3839646.12491 * 100) < 0.05, + "incorrect value for z, expected 3839646.12491, is %f", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -389,17 +467,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEF ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x209, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x209, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x209, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x209, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,9,2,211,136,32,200,3,123,19,146,214,132,215,182,122,68,193,213,68,49,215,121,119,80,193,71,34,110,243,78,75,77,65,0,0,15,2,187,86, }; + u8 encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 200, 3, 123, 19, 146, 214, 132, 215, + 182, 122, 68, 193, 213, 68, 49, 215, 121, 119, 80, 193, 71, 34, + 110, 243, 78, 75, 77, 65, 0, 0, 15, 2, 187, 86, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_t* test_msg = ( msg_pos_ecef_t* )test_msg_storage; + msg_pos_ecef_t* test_msg = (msg_pos_ecef_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 2; @@ -408,69 +492,90 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEF ) test_msg->x = -2684269.683741399; test_msg->y = -4316647.3623821335; test_msg->z = 3839645.90179852; - sbp_payload_send(&sbp_state, 0x209, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x209, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x209, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_t* check_msg = ( msg_pos_ecef_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_t* check_msg = (msg_pos_ecef_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 2, "incorrect value for flags, expected 2, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326829000, "incorrect value for tow, expected 326829000, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2684269.68374*100) < 0.05, "incorrect value for x, expected -2684269.68374, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4316647.36238*100) < 0.05, "incorrect value for y, expected -4316647.36238, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3839645.9018*100) < 0.05, "incorrect value for z, expected 3839645.9018, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 2, + "incorrect value for flags, expected 2, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326829000, + "incorrect value for tow, expected 326829000, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2684269.68374 * 100) < 0.05, + "incorrect value for x, expected -2684269.68374, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4316647.36238 * 100) < 0.05, + "incorrect value for y, expected -4316647.36238, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3839645.9018 * 100) < 0.05, + "incorrect value for z, expected 3839645.9018, is %f", + check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgPosECEF_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgPosECEF"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosECEF"); +Suite* legacy_auto_check_sbp_navigation_MsgPosECEF_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_navigation_MsgPosECEF"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosECEF"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgPosECEF); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFCov.c b/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFCov.c index 193bc3b3f..a0308137d 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFCov.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFCov.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCov.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCov.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFCov ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgPosECEFCov) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFCov ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,24 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFCov ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x214, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x214, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x214, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x214, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,20,2,66,0,54,7,0,0,0,0,0,0,0,0,0,24,64,0,0,0,0,0,0,240,63,0,0,0,0,0,0,16,64,0,0,0,65,0,0,224,64,0,0,0,64,0,0,192,64,0,0,0,65,0,0,160,64,4,5,249,167, }; + u8 encoded_frame[] = { + 85, 20, 2, 66, 0, 54, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 24, 64, 0, 0, 0, 0, 0, 0, 240, 63, 0, 0, 0, 0, 0, 0, + 16, 64, 0, 0, 0, 65, 0, 0, 224, 64, 0, 0, 0, 64, 0, 0, + 192, 64, 0, 0, 0, 65, 0, 0, 160, 64, 4, 5, 249, 167, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_cov_t* test_msg = ( msg_pos_ecef_cov_t* )test_msg_storage; + msg_pos_ecef_cov_t *test_msg = (msg_pos_ecef_cov_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cov_x_x = 8.0; test_msg->cov_x_y = 7.0; @@ -155,74 +159,103 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFCov ) test_msg->x = 6.0; test_msg->y = 1.0; test_msg->z = 4.0; - sbp_payload_send(&sbp_state, 0x214, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x214, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x214, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_cov_t* check_msg = ( msg_pos_ecef_cov_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_cov_t *check_msg = + (msg_pos_ecef_cov_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cov_x_x*100 - 8.0*100) < 0.05, "incorrect value for cov_x_x, expected 8.0, is %f", check_msg->cov_x_x); - ck_assert_msg((check_msg->cov_x_y*100 - 7.0*100) < 0.05, "incorrect value for cov_x_y, expected 7.0, is %f", check_msg->cov_x_y); - ck_assert_msg((check_msg->cov_x_z*100 - 2.0*100) < 0.05, "incorrect value for cov_x_z, expected 2.0, is %f", check_msg->cov_x_z); - ck_assert_msg((check_msg->cov_y_y*100 - 6.0*100) < 0.05, "incorrect value for cov_y_y, expected 6.0, is %f", check_msg->cov_y_y); - ck_assert_msg((check_msg->cov_y_z*100 - 8.0*100) < 0.05, "incorrect value for cov_y_z, expected 8.0, is %f", check_msg->cov_y_z); - ck_assert_msg((check_msg->cov_z_z*100 - 5.0*100) < 0.05, "incorrect value for cov_z_z, expected 5.0, is %f", check_msg->cov_z_z); - ck_assert_msg(check_msg->flags == 5, "incorrect value for flags, expected 5, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 4, "incorrect value for n_sats, expected 4, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 7, "incorrect value for tow, expected 7, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - 6.0*100) < 0.05, "incorrect value for x, expected 6.0, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - 1.0*100) < 0.05, "incorrect value for y, expected 1.0, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 4.0*100) < 0.05, "incorrect value for z, expected 4.0, is %f", check_msg->z); + ck_assert_msg((check_msg->cov_x_x * 100 - 8.0 * 100) < 0.05, + "incorrect value for cov_x_x, expected 8.0, is %f", + check_msg->cov_x_x); + ck_assert_msg((check_msg->cov_x_y * 100 - 7.0 * 100) < 0.05, + "incorrect value for cov_x_y, expected 7.0, is %f", + check_msg->cov_x_y); + ck_assert_msg((check_msg->cov_x_z * 100 - 2.0 * 100) < 0.05, + "incorrect value for cov_x_z, expected 2.0, is %f", + check_msg->cov_x_z); + ck_assert_msg((check_msg->cov_y_y * 100 - 6.0 * 100) < 0.05, + "incorrect value for cov_y_y, expected 6.0, is %f", + check_msg->cov_y_y); + ck_assert_msg((check_msg->cov_y_z * 100 - 8.0 * 100) < 0.05, + "incorrect value for cov_y_z, expected 8.0, is %f", + check_msg->cov_y_z); + ck_assert_msg((check_msg->cov_z_z * 100 - 5.0 * 100) < 0.05, + "incorrect value for cov_z_z, expected 5.0, is %f", + check_msg->cov_z_z); + ck_assert_msg(check_msg->flags == 5, + "incorrect value for flags, expected 5, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 4, + "incorrect value for n_sats, expected 4, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 7, + "incorrect value for tow, expected 7, is %d", check_msg->tow); + ck_assert_msg((check_msg->x * 100 - 6.0 * 100) < 0.05, + "incorrect value for x, expected 6.0, is %f", check_msg->x); + ck_assert_msg((check_msg->y * 100 - 1.0 * 100) < 0.05, + "incorrect value for y, expected 1.0, is %f", check_msg->y); + ck_assert_msg((check_msg->z * 100 - 4.0 * 100) < 0.05, + "incorrect value for z, expected 4.0, is %f", check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgPosECEFCov_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgPosECEFCov"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosECEFCov"); +Suite *legacy_auto_check_sbp_navigation_MsgPosECEFCov_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgPosECEFCov"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosECEFCov"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgPosECEFCov); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFCovGNSS.c b/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFCovGNSS.c index 02e4c7715..07d3c8561 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFCovGNSS.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFCovGNSS.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCovGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCovGNSS.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,26 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x234, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x234, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x234, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x234, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,52,2,0,16,54,24,229,233,29,52,254,158,218,42,142,68,193,69,162,89,91,34,68,80,193,131,21,176,129,239,174,77,65,158,232,30,60,218,221,20,60,129,136,198,187,205,120,166,60,5,166,35,188,122,177,115,60,18,4,159,102, }; + u8 encoded_frame[] = { + 85, 52, 2, 0, 16, 54, 24, 229, 233, 29, 52, 254, 158, + 218, 42, 142, 68, 193, 69, 162, 89, 91, 34, 68, 80, 193, + 131, 21, 176, 129, 239, 174, 77, 65, 158, 232, 30, 60, 218, + 221, 20, 60, 129, 136, 198, 187, 205, 120, 166, 60, 5, 166, + 35, 188, 122, 177, 115, 60, 18, 4, 159, 102, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_cov_gnss_t* test_msg = ( msg_pos_ecef_cov_gnss_t* )test_msg_storage; + msg_pos_ecef_cov_gnss_t *test_msg = + (msg_pos_ecef_cov_gnss_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cov_x_x = 0.009699014946818352; test_msg->cov_x_y = 0.009086096659302711; @@ -155,75 +161,115 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS ) test_msg->x = -2694229.7079770807; test_msg->y = -4264073.427345817; test_msg->z = 3890655.013186158; - sbp_payload_send(&sbp_state, 0x234, 4096, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x234, 4096, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 4096, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x234, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_cov_gnss_t* check_msg = ( msg_pos_ecef_cov_gnss_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_cov_gnss_t *check_msg = + (msg_pos_ecef_cov_gnss_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cov_x_x*100 - 0.00969901494682*100) < 0.05, "incorrect value for cov_x_x, expected 0.00969901494682, is %f", check_msg->cov_x_x); - ck_assert_msg((check_msg->cov_x_y*100 - 0.0090860966593*100) < 0.05, "incorrect value for cov_x_y, expected 0.0090860966593, is %f", check_msg->cov_x_y); - ck_assert_msg((check_msg->cov_x_z*100 - -0.00605875300243*100) < 0.05, "incorrect value for cov_x_z, expected -0.00605875300243, is %f", check_msg->cov_x_z); - ck_assert_msg((check_msg->cov_y_y*100 - 0.0203212741762*100) < 0.05, "incorrect value for cov_y_y, expected 0.0203212741762, is %f", check_msg->cov_y_y); - ck_assert_msg((check_msg->cov_y_z*100 - -0.00998831260949*100) < 0.05, "incorrect value for cov_y_z, expected -0.00998831260949, is %f", check_msg->cov_y_z); - ck_assert_msg((check_msg->cov_z_z*100 - 0.0148738566786*100) < 0.05, "incorrect value for cov_z_z, expected 0.0148738566786, is %f", check_msg->cov_z_z); - ck_assert_msg(check_msg->flags == 4, "incorrect value for flags, expected 4, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 18, "incorrect value for n_sats, expected 18, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 501867800, "incorrect value for tow, expected 501867800, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2694229.70798*100) < 0.05, "incorrect value for x, expected -2694229.70798, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4264073.42735*100) < 0.05, "incorrect value for y, expected -4264073.42735, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3890655.01319*100) < 0.05, "incorrect value for z, expected 3890655.01319, is %f", check_msg->z); + ck_assert_msg( + (check_msg->cov_x_x * 100 - 0.00969901494682 * 100) < 0.05, + "incorrect value for cov_x_x, expected 0.00969901494682, is %f", + check_msg->cov_x_x); + ck_assert_msg( + (check_msg->cov_x_y * 100 - 0.0090860966593 * 100) < 0.05, + "incorrect value for cov_x_y, expected 0.0090860966593, is %f", + check_msg->cov_x_y); + ck_assert_msg( + (check_msg->cov_x_z * 100 - -0.00605875300243 * 100) < 0.05, + "incorrect value for cov_x_z, expected -0.00605875300243, is %f", + check_msg->cov_x_z); + ck_assert_msg( + (check_msg->cov_y_y * 100 - 0.0203212741762 * 100) < 0.05, + "incorrect value for cov_y_y, expected 0.0203212741762, is %f", + check_msg->cov_y_y); + ck_assert_msg( + (check_msg->cov_y_z * 100 - -0.00998831260949 * 100) < 0.05, + "incorrect value for cov_y_z, expected -0.00998831260949, is %f", + check_msg->cov_y_z); + ck_assert_msg( + (check_msg->cov_z_z * 100 - 0.0148738566786 * 100) < 0.05, + "incorrect value for cov_z_z, expected 0.0148738566786, is %f", + check_msg->cov_z_z); + ck_assert_msg(check_msg->flags == 4, + "incorrect value for flags, expected 4, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 18, + "incorrect value for n_sats, expected 18, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 501867800, + "incorrect value for tow, expected 501867800, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2694229.70798 * 100) < 0.05, + "incorrect value for x, expected -2694229.70798, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4264073.42735 * 100) < 0.05, + "incorrect value for y, expected -4264073.42735, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3890655.01319 * 100) < 0.05, + "incorrect value for z, expected 3890655.01319, is %f", + check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS); +Suite *legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFDepA.c b/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFDepA.c index 6e2bc5a10..dbf8f577f 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFDepA.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,2,246,215,32,20,46,39,0,195,122,175,75,33,154,68,193,164,14,230,176,231,95,80,193,78,220,22,253,254,105,77,65,0,0,9,0,13,86, }; + u8 encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 20, 46, 39, 0, 195, 122, 175, 75, + 33, 154, 68, 193, 164, 14, 230, 176, 231, 95, 80, 193, 78, 220, + 22, 253, 254, 105, 77, 65, 0, 0, 9, 0, 13, 86, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; + msg_pos_ecef_dep_a_t* test_msg = (msg_pos_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -150,66 +153,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) test_msg->x = -2700354.5912927105; test_msg->y = -4292510.764041577; test_msg->z = 3855357.977260149; - sbp_payload_send(&sbp_state, 0x200, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x200, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x200, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_dep_a_t* check_msg = ( msg_pos_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_dep_a_t* check_msg = + (msg_pos_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567700, "incorrect value for tow, expected 2567700, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2700354.59129*100) < 0.05, "incorrect value for x, expected -2700354.59129, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4292510.76404*100) < 0.05, "incorrect value for y, expected -4292510.76404, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3855357.97726*100) < 0.05, "incorrect value for z, expected 3855357.97726, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567700, + "incorrect value for tow, expected 2567700, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2700354.59129 * 100) < 0.05, + "incorrect value for x, expected -2700354.59129, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4292510.76404 * 100) < 0.05, + "incorrect value for y, expected -4292510.76404, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3855357.97726 * 100) < 0.05, + "incorrect value for z, expected 3855357.97726, is %f", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -217,17 +242,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,2,246,215,32,20,46,39,0,212,196,12,42,34,154,68,193,9,113,112,123,231,95,80,193,54,97,38,192,254,105,77,65,0,0,9,1,75,143, }; + u8 encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 20, 46, 39, 0, 212, 196, 12, 42, + 34, 154, 68, 193, 9, 113, 112, 123, 231, 95, 80, 193, 54, 97, + 38, 192, 254, 105, 77, 65, 0, 0, 9, 1, 75, 143, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; + msg_pos_ecef_dep_a_t* test_msg = (msg_pos_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 1; @@ -236,66 +267,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) test_msg->x = -2700356.3285146747; test_msg->y = -4292509.928737887; test_msg->z = 3855357.5011712564; - sbp_payload_send(&sbp_state, 0x200, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x200, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x200, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_dep_a_t* check_msg = ( msg_pos_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_dep_a_t* check_msg = + (msg_pos_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567700, "incorrect value for tow, expected 2567700, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2700356.32851*100) < 0.05, "incorrect value for x, expected -2700356.32851, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4292509.92874*100) < 0.05, "incorrect value for y, expected -4292509.92874, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3855357.50117*100) < 0.05, "incorrect value for z, expected 3855357.50117, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567700, + "incorrect value for tow, expected 2567700, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2700356.32851 * 100) < 0.05, + "incorrect value for x, expected -2700356.32851, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4292509.92874 * 100) < 0.05, + "incorrect value for y, expected -4292509.92874, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3855357.50117 * 100) < 0.05, + "incorrect value for z, expected 3855357.50117, is %f", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -303,17 +356,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,2,246,215,32,120,46,39,0,112,97,39,190,34,154,68,193,230,43,119,115,231,95,80,193,50,199,76,66,254,105,77,65,0,0,9,0,204,113, }; + u8 encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 120, 46, 39, 0, 112, 97, 39, 190, + 34, 154, 68, 193, 230, 43, 119, 115, 231, 95, 80, 193, 50, 199, + 76, 66, 254, 105, 77, 65, 0, 0, 9, 0, 204, 113, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; + msg_pos_ecef_dep_a_t* test_msg = (msg_pos_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -322,66 +381,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) test_msg->x = -2700357.485576801; test_msg->y = -4292509.80414865; test_msg->z = 3855356.517968082; - sbp_payload_send(&sbp_state, 0x200, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x200, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x200, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_dep_a_t* check_msg = ( msg_pos_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_dep_a_t* check_msg = + (msg_pos_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567800, "incorrect value for tow, expected 2567800, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2700357.48558*100) < 0.05, "incorrect value for x, expected -2700357.48558, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4292509.80415*100) < 0.05, "incorrect value for y, expected -4292509.80415, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3855356.51797*100) < 0.05, "incorrect value for z, expected 3855356.51797, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567800, + "incorrect value for tow, expected 2567800, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2700357.48558 * 100) < 0.05, + "incorrect value for x, expected -2700357.48558, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4292509.80415 * 100) < 0.05, + "incorrect value for y, expected -4292509.80415, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3855356.51797 * 100) < 0.05, + "incorrect value for z, expected 3855356.51797, is %f", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -389,17 +470,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,2,246,215,32,120,46,39,0,194,82,121,4,34,154,68,193,223,186,1,140,231,95,80,193,176,152,147,181,254,105,77,65,0,0,9,1,97,71, }; + u8 encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 120, 46, 39, 0, 194, 82, 121, 4, + 34, 154, 68, 193, 223, 186, 1, 140, 231, 95, 80, 193, 176, 152, + 147, 181, 254, 105, 77, 65, 0, 0, 9, 1, 97, 71, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; + msg_pos_ecef_dep_a_t* test_msg = (msg_pos_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 1; @@ -408,66 +495,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) test_msg->x = -2700356.0349524925; test_msg->y = -4292510.187605589; test_msg->z = 3855357.4185667858; - sbp_payload_send(&sbp_state, 0x200, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x200, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x200, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_dep_a_t* check_msg = ( msg_pos_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_dep_a_t* check_msg = + (msg_pos_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567800, "incorrect value for tow, expected 2567800, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2700356.03495*100) < 0.05, "incorrect value for x, expected -2700356.03495, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4292510.18761*100) < 0.05, "incorrect value for y, expected -4292510.18761, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3855357.41857*100) < 0.05, "incorrect value for z, expected 3855357.41857, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567800, + "incorrect value for tow, expected 2567800, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2700356.03495 * 100) < 0.05, + "incorrect value for x, expected -2700356.03495, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4292510.18761 * 100) < 0.05, + "incorrect value for y, expected -4292510.18761, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3855357.41857 * 100) < 0.05, + "incorrect value for z, expected 3855357.41857, is %f", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -475,17 +584,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,2,246,215,32,220,46,39,0,216,41,227,254,33,154,68,193,9,151,154,124,231,95,80,193,1,183,214,139,255,105,77,65,0,0,9,0,7,98, }; + u8 encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 220, 46, 39, 0, 216, 41, 227, 254, + 33, 154, 68, 193, 9, 151, 154, 124, 231, 95, 80, 193, 1, 183, + 214, 139, 255, 105, 77, 65, 0, 0, 9, 0, 7, 98, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; + msg_pos_ecef_dep_a_t* test_msg = (msg_pos_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -494,66 +609,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) test_msg->x = -2700355.9913074784; test_msg->y = -4292509.946935424; test_msg->z = 3855359.0924900775; - sbp_payload_send(&sbp_state, 0x200, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x200, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x200, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_dep_a_t* check_msg = ( msg_pos_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_dep_a_t* check_msg = + (msg_pos_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567900, "incorrect value for tow, expected 2567900, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2700355.99131*100) < 0.05, "incorrect value for x, expected -2700355.99131, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4292509.94694*100) < 0.05, "incorrect value for y, expected -4292509.94694, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3855359.09249*100) < 0.05, "incorrect value for z, expected 3855359.09249, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567900, + "incorrect value for tow, expected 2567900, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2700355.99131 * 100) < 0.05, + "incorrect value for x, expected -2700355.99131, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4292509.94694 * 100) < 0.05, + "incorrect value for y, expected -4292509.94694, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3855359.09249 * 100) < 0.05, + "incorrect value for z, expected 3855359.09249, is %f", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -561,17 +698,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,2,195,4,32,212,157,67,24,153,222,105,1,252,161,68,193,254,247,52,112,74,67,80,193,164,207,47,146,44,163,77,65,0,0,8,0,145,4, }; + u8 encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 212, 157, 67, 24, 153, 222, 105, 1, + 252, 161, 68, 193, 254, 247, 52, 112, 74, 67, 80, 193, 164, 207, + 47, 146, 44, 163, 77, 65, 0, 0, 8, 0, 145, 4, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; + msg_pos_ecef_dep_a_t* test_msg = (msg_pos_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -580,66 +723,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) test_msg->x = -2704376.0110433814; test_msg->y = -4263209.753232954; test_msg->z = 3884633.142084079; - sbp_payload_send(&sbp_state, 0x200, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x200, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x200, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_dep_a_t* check_msg = ( msg_pos_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_dep_a_t* check_msg = + (msg_pos_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084500, "incorrect value for tow, expected 407084500, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2704376.01104*100) < 0.05, "incorrect value for x, expected -2704376.01104, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4263209.75323*100) < 0.05, "incorrect value for y, expected -4263209.75323, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3884633.14208*100) < 0.05, "incorrect value for z, expected 3884633.14208, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084500, + "incorrect value for tow, expected 407084500, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2704376.01104 * 100) < 0.05, + "incorrect value for x, expected -2704376.01104, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4263209.75323 * 100) < 0.05, + "incorrect value for y, expected -4263209.75323, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3884633.14208 * 100) < 0.05, + "incorrect value for z, expected 3884633.14208, is %f", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -647,17 +812,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,2,195,4,32,56,158,67,24,215,184,223,246,251,161,68,193,36,126,17,39,74,67,80,193,19,179,70,80,44,163,77,65,0,0,8,0,245,66, }; + u8 encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 56, 158, 67, 24, 215, 184, 223, 246, + 251, 161, 68, 193, 36, 126, 17, 39, 74, 67, 80, 193, 19, 179, + 70, 80, 44, 163, 77, 65, 0, 0, 8, 0, 245, 66, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; + msg_pos_ecef_dep_a_t* test_msg = (msg_pos_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -666,66 +837,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) test_msg->x = -2704375.9287024545; test_msg->y = -4263208.610442672; test_msg->z = 3884632.627157578; - sbp_payload_send(&sbp_state, 0x200, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x200, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x200, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_dep_a_t* check_msg = ( msg_pos_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_dep_a_t* check_msg = + (msg_pos_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084600, "incorrect value for tow, expected 407084600, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2704375.9287*100) < 0.05, "incorrect value for x, expected -2704375.9287, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4263208.61044*100) < 0.05, "incorrect value for y, expected -4263208.61044, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3884632.62716*100) < 0.05, "incorrect value for z, expected 3884632.62716, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084600, + "incorrect value for tow, expected 407084600, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2704375.9287 * 100) < 0.05, + "incorrect value for x, expected -2704375.9287, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4263208.61044 * 100) < 0.05, + "incorrect value for y, expected -4263208.61044, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3884632.62716 * 100) < 0.05, + "incorrect value for z, expected 3884632.62716, is %f", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -733,17 +926,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,2,195,4,32,156,158,67,24,73,74,214,148,251,161,68,193,213,151,184,215,73,67,80,193,110,99,38,164,43,163,77,65,0,0,8,0,5,223, }; + u8 encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 156, 158, 67, 24, 73, 74, 214, 148, + 251, 161, 68, 193, 213, 151, 184, 215, 73, 67, 80, 193, 110, 99, + 38, 164, 43, 163, 77, 65, 0, 0, 8, 0, 5, 223, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; + msg_pos_ecef_dep_a_t* test_msg = (msg_pos_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -752,66 +951,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) test_msg->x = -2704375.162789617; test_msg->y = -4263207.370641668; test_msg->z = 3884631.282421521; - sbp_payload_send(&sbp_state, 0x200, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x200, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x200, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_dep_a_t* check_msg = ( msg_pos_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_dep_a_t* check_msg = + (msg_pos_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084700, "incorrect value for tow, expected 407084700, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2704375.16279*100) < 0.05, "incorrect value for x, expected -2704375.16279, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4263207.37064*100) < 0.05, "incorrect value for y, expected -4263207.37064, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3884631.28242*100) < 0.05, "incorrect value for z, expected 3884631.28242, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084700, + "incorrect value for tow, expected 407084700, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2704375.16279 * 100) < 0.05, + "incorrect value for x, expected -2704375.16279, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4263207.37064 * 100) < 0.05, + "incorrect value for y, expected -4263207.37064, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3884631.28242 * 100) < 0.05, + "incorrect value for z, expected 3884631.28242, is %f", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -819,17 +1040,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,2,195,4,32,0,159,67,24,177,111,112,45,252,161,68,193,213,168,198,253,73,67,80,193,245,12,228,12,44,163,77,65,0,0,8,0,143,212, }; + u8 encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 0, 159, 67, 24, 177, 111, 112, 45, + 252, 161, 68, 193, 213, 168, 198, 253, 73, 67, 80, 193, 245, 12, + 228, 12, 44, 163, 77, 65, 0, 0, 8, 0, 143, 212, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; + msg_pos_ecef_dep_a_t* test_msg = (msg_pos_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -838,66 +1065,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) test_msg->x = -2704376.3549937834; test_msg->y = -4263207.965250214; test_msg->z = 3884632.1007095524; - sbp_payload_send(&sbp_state, 0x200, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x200, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x200, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_dep_a_t* check_msg = ( msg_pos_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_dep_a_t* check_msg = + (msg_pos_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084800, "incorrect value for tow, expected 407084800, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2704376.35499*100) < 0.05, "incorrect value for x, expected -2704376.35499, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4263207.96525*100) < 0.05, "incorrect value for y, expected -4263207.96525, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3884632.10071*100) < 0.05, "incorrect value for z, expected 3884632.10071, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084800, + "incorrect value for tow, expected 407084800, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2704376.35499 * 100) < 0.05, + "incorrect value for x, expected -2704376.35499, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4263207.96525 * 100) < 0.05, + "incorrect value for y, expected -4263207.96525, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3884632.10071 * 100) < 0.05, + "incorrect value for z, expected 3884632.10071, is %f", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -905,17 +1154,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,2,195,4,32,100,159,67,24,67,231,72,165,251,161,68,193,150,210,36,212,73,67,80,193,234,33,25,189,43,163,77,65,0,0,8,0,70,221, }; + u8 encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 100, 159, 67, 24, 67, 231, 72, 165, + 251, 161, 68, 193, 150, 210, 36, 212, 73, 67, 80, 193, 234, 33, + 25, 189, 43, 163, 77, 65, 0, 0, 8, 0, 70, 221, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; + msg_pos_ecef_dep_a_t* test_msg = (msg_pos_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -924,66 +1179,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) test_msg->x = -2704375.291287334; test_msg->y = -4263207.314747473; test_msg->z = 3884631.4773294823; - sbp_payload_send(&sbp_state, 0x200, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x200, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x200, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_dep_a_t* check_msg = ( msg_pos_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_dep_a_t* check_msg = + (msg_pos_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084900, "incorrect value for tow, expected 407084900, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2704375.29129*100) < 0.05, "incorrect value for x, expected -2704375.29129, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4263207.31475*100) < 0.05, "incorrect value for y, expected -4263207.31475, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3884631.47733*100) < 0.05, "incorrect value for z, expected 3884631.47733, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084900, + "incorrect value for tow, expected 407084900, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2704375.29129 * 100) < 0.05, + "incorrect value for x, expected -2704375.29129, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4263207.31475 * 100) < 0.05, + "incorrect value for y, expected -4263207.31475, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3884631.47733 * 100) < 0.05, + "incorrect value for z, expected 3884631.47733, is %f", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -991,17 +1268,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x200, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x200, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,2,195,4,32,46,162,68,24,224,72,131,215,251,161,68,193,180,123,222,94,74,67,80,193,191,3,131,193,45,163,77,65,0,0,5,0,17,221, }; + u8 encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 46, 162, 68, 24, 224, 72, 131, 215, + 251, 161, 68, 193, 180, 123, 222, 94, 74, 67, 80, 193, 191, 3, + 131, 193, 45, 163, 77, 65, 0, 0, 5, 0, 17, 221, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; + msg_pos_ecef_dep_a_t* test_msg = (msg_pos_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -1010,69 +1293,92 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA ) test_msg->x = -2704375.68369399; test_msg->y = -4263209.482329298; test_msg->z = 3884635.5118107493; - sbp_payload_send(&sbp_state, 0x200, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x200, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x200, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_dep_a_t* check_msg = ( msg_pos_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_dep_a_t* check_msg = + (msg_pos_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 5, "incorrect value for n_sats, expected 5, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407151150, "incorrect value for tow, expected 407151150, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2704375.68369*100) < 0.05, "incorrect value for x, expected -2704375.68369, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4263209.48233*100) < 0.05, "incorrect value for y, expected -4263209.48233, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3884635.51181*100) < 0.05, "incorrect value for z, expected 3884635.51181, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 5, + "incorrect value for n_sats, expected 5, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407151150, + "incorrect value for tow, expected 407151150, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2704375.68369 * 100) < 0.05, + "incorrect value for x, expected -2704375.68369, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4263209.48233 * 100) < 0.05, + "incorrect value for y, expected -4263209.48233, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3884635.51181 * 100) < 0.05, + "incorrect value for z, expected 3884635.51181, is %f", + check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgPosECEFDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgPosECEFDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosECEFDepA"); +Suite* legacy_auto_check_sbp_navigation_MsgPosECEFDepA_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgPosECEFDepA"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosECEFDepA"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFGNSS.c b/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFGNSS.c index 444eb4a0e..15c9f80f9 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFGNSS.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgPosECEFGNSS.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFGNSS.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFGNSS ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgPosECEFGNSS) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFGNSS ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFGNSS ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x229, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x229, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x229, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x229, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,41,2,0,16,32,24,229,233,29,52,254,158,218,42,142,68,193,69,162,89,91,34,68,80,193,131,21,176,129,239,174,77,65,182,0,18,4,135,2, }; + u8 encoded_frame[] = { + 85, 41, 2, 0, 16, 32, 24, 229, 233, 29, 52, 254, 158, 218, + 42, 142, 68, 193, 69, 162, 89, 91, 34, 68, 80, 193, 131, 21, + 176, 129, 239, 174, 77, 65, 182, 0, 18, 4, 135, 2, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_ecef_gnss_t* test_msg = ( msg_pos_ecef_gnss_t* )test_msg_storage; + msg_pos_ecef_gnss_t *test_msg = (msg_pos_ecef_gnss_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 182; test_msg->flags = 4; @@ -150,69 +153,92 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosECEFGNSS ) test_msg->x = -2694229.7079770807; test_msg->y = -4264073.427345817; test_msg->z = 3890655.013186158; - sbp_payload_send(&sbp_state, 0x229, 4096, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x229, 4096, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 4096, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x229, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_ecef_gnss_t* check_msg = ( msg_pos_ecef_gnss_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_ecef_gnss_t *check_msg = + (msg_pos_ecef_gnss_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 182, "incorrect value for accuracy, expected 182, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 4, "incorrect value for flags, expected 4, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 18, "incorrect value for n_sats, expected 18, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 501867800, "incorrect value for tow, expected 501867800, is %d", check_msg->tow); - ck_assert_msg((check_msg->x*100 - -2694229.70798*100) < 0.05, "incorrect value for x, expected -2694229.70798, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4264073.42735*100) < 0.05, "incorrect value for y, expected -4264073.42735, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3890655.01319*100) < 0.05, "incorrect value for z, expected 3890655.01319, is %f", check_msg->z); + ck_assert_msg(check_msg->accuracy == 182, + "incorrect value for accuracy, expected 182, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 4, + "incorrect value for flags, expected 4, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 18, + "incorrect value for n_sats, expected 18, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 501867800, + "incorrect value for tow, expected 501867800, is %d", + check_msg->tow); + ck_assert_msg((check_msg->x * 100 - -2694229.70798 * 100) < 0.05, + "incorrect value for x, expected -2694229.70798, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4264073.42735 * 100) < 0.05, + "incorrect value for y, expected -4264073.42735, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3890655.01319 * 100) < 0.05, + "incorrect value for z, expected 3890655.01319, is %f", + check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgPosECEFGNSS_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgPosECEFGNSS"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosECEFGNSS"); +Suite *legacy_auto_check_sbp_navigation_MsgPosECEFGNSS_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgPosECEFGNSS"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosECEFGNSS"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgPosECEFGNSS); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgPosLLH.c b/c/test/legacy/auto_check_sbp_navigation_MsgPosLLH.c index 19e729fa7..789deeddf 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgPosLLH.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgPosLLH.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLH.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLH.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLH ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgPosLLH) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLH ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLH ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20a, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20a, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,10,2,211,136,34,40,244,122,19,201,106,155,186,42,160,66,64,168,109,26,225,0,120,94,192,130,102,237,230,43,54,60,64,0,0,0,0,14,2,175,162, }; + u8 encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 40, 244, 122, 19, 201, 106, 155, 186, + 42, 160, 66, 64, 168, 109, 26, 225, 0, 120, 94, 192, 130, 102, + 237, 230, 43, 54, 60, 64, 0, 0, 0, 0, 14, 2, 175, 162, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_t* test_msg = ( msg_pos_llh_t* )test_msg_storage; + msg_pos_llh_t* test_msg = (msg_pos_llh_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 2; test_msg->h_accuracy = 0; @@ -151,67 +154,90 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLH ) test_msg->n_sats = 14; test_msg->tow = 326825000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x20a, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20a, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20a, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_t* check_msg = ( msg_pos_llh_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_t* check_msg = (msg_pos_llh_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 2, "incorrect value for flags, expected 2, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 28.2116073923*100) < 0.05, "incorrect value for height, expected 28.2116073923, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.2513039836*100) < 0.05, "incorrect value for lat, expected 37.2513039836, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -121.875053669*100) < 0.05, "incorrect value for lon, expected -121.875053669, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 14, "incorrect value for n_sats, expected 14, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326825000, "incorrect value for tow, expected 326825000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 2, + "incorrect value for flags, expected 2, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 28.2116073923 * 100) < 0.05, + "incorrect value for height, expected 28.2116073923, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.2513039836 * 100) < 0.05, + "incorrect value for lat, expected 37.2513039836, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -121.875053669 * 100) < 0.05, + "incorrect value for lon, expected -121.875053669, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 14, + "incorrect value for n_sats, expected 14, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326825000, + "incorrect value for tow, expected 326825000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -219,17 +245,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLH ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20a, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20a, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,10,2,211,136,34,16,248,122,19,52,177,251,178,42,160,66,64,237,22,97,224,0,120,94,192,107,188,109,90,247,189,59,64,0,0,0,0,15,2,38,177, }; + u8 encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 16, 248, 122, 19, 52, 177, 251, 178, + 42, 160, 66, 64, 237, 22, 97, 224, 0, 120, 94, 192, 107, 188, + 109, 90, 247, 189, 59, 64, 0, 0, 0, 0, 15, 2, 38, 177, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_t* test_msg = ( msg_pos_llh_t* )test_msg_storage; + msg_pos_llh_t* test_msg = (msg_pos_llh_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 2; test_msg->h_accuracy = 0; @@ -239,67 +271,90 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLH ) test_msg->n_sats = 15; test_msg->tow = 326826000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x20a, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20a, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20a, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_t* check_msg = ( msg_pos_llh_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_t* check_msg = (msg_pos_llh_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 2, "incorrect value for flags, expected 2, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 27.7420555609*100) < 0.05, "incorrect value for height, expected 27.7420555609, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.2513030747*100) < 0.05, "incorrect value for lat, expected 37.2513030747, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -121.875053496*100) < 0.05, "incorrect value for lon, expected -121.875053496, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326826000, "incorrect value for tow, expected 326826000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 2, + "incorrect value for flags, expected 2, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 27.7420555609 * 100) < 0.05, + "incorrect value for height, expected 27.7420555609, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.2513030747 * 100) < 0.05, + "incorrect value for lat, expected 37.2513030747, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -121.875053496 * 100) < 0.05, + "incorrect value for lon, expected -121.875053496, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326826000, + "incorrect value for tow, expected 326826000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -307,17 +362,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLH ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20a, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20a, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,10,2,211,136,34,248,251,122,19,135,66,9,163,42,160,66,64,146,8,99,225,0,120,94,192,45,181,143,219,28,157,59,64,0,0,0,0,15,2,51,40, }; + u8 encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 248, 251, 122, 19, 135, 66, 9, 163, + 42, 160, 66, 64, 146, 8, 99, 225, 0, 120, 94, 192, 45, 181, + 143, 219, 28, 157, 59, 64, 0, 0, 0, 0, 15, 2, 51, 40, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_t* test_msg = ( msg_pos_llh_t* )test_msg_storage; + msg_pos_llh_t* test_msg = (msg_pos_llh_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 2; test_msg->h_accuracy = 0; @@ -327,67 +388,90 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLH ) test_msg->n_sats = 15; test_msg->tow = 326827000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x20a, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20a, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20a, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_t* check_msg = ( msg_pos_llh_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_t* check_msg = (msg_pos_llh_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 2, "incorrect value for flags, expected 2, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 27.613721583*100) < 0.05, "incorrect value for height, expected 27.613721583, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.2513011737*100) < 0.05, "incorrect value for lat, expected 37.2513011737, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -121.875053736*100) < 0.05, "incorrect value for lon, expected -121.875053736, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326827000, "incorrect value for tow, expected 326827000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 2, + "incorrect value for flags, expected 2, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 27.613721583 * 100) < 0.05, + "incorrect value for height, expected 27.613721583, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.2513011737 * 100) < 0.05, + "incorrect value for lat, expected 37.2513011737, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -121.875053736 * 100) < 0.05, + "incorrect value for lon, expected -121.875053736, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326827000, + "incorrect value for tow, expected 326827000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -395,17 +479,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLH ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20a, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20a, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,10,2,211,136,34,224,255,122,19,18,44,253,119,42,160,66,64,48,109,39,231,0,120,94,192,185,76,48,17,119,205,59,64,0,0,0,0,15,2,12,194, }; + u8 encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 224, 255, 122, 19, 18, 44, 253, 119, + 42, 160, 66, 64, 48, 109, 39, 231, 0, 120, 94, 192, 185, 76, + 48, 17, 119, 205, 59, 64, 0, 0, 0, 0, 15, 2, 12, 194, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_t* test_msg = ( msg_pos_llh_t* )test_msg_storage; + msg_pos_llh_t* test_msg = (msg_pos_llh_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 2; test_msg->h_accuracy = 0; @@ -415,67 +505,90 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLH ) test_msg->n_sats = 15; test_msg->tow = 326828000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x20a, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20a, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20a, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_t* check_msg = ( msg_pos_llh_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_t* check_msg = (msg_pos_llh_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 2, "incorrect value for flags, expected 2, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 27.8025980704*100) < 0.05, "incorrect value for height, expected 27.8025980704, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.2512960421*100) < 0.05, "incorrect value for lat, expected 37.2512960421, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -121.875055111*100) < 0.05, "incorrect value for lon, expected -121.875055111, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326828000, "incorrect value for tow, expected 326828000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 2, + "incorrect value for flags, expected 2, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 27.8025980704 * 100) < 0.05, + "incorrect value for height, expected 27.8025980704, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.2512960421 * 100) < 0.05, + "incorrect value for lat, expected 37.2512960421, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -121.875055111 * 100) < 0.05, + "incorrect value for lon, expected -121.875055111, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326828000, + "incorrect value for tow, expected 326828000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -483,17 +596,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLH ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20a, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20a, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,10,2,211,136,34,200,3,123,19,225,237,238,90,42,160,66,64,59,143,70,235,0,120,94,192,101,106,249,224,131,240,59,64,0,0,0,0,15,2,34,103, }; + u8 encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 200, 3, 123, 19, 225, 237, 238, 90, + 42, 160, 66, 64, 59, 143, 70, 235, 0, 120, 94, 192, 101, 106, + 249, 224, 131, 240, 59, 64, 0, 0, 0, 0, 15, 2, 34, 103, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_t* test_msg = ( msg_pos_llh_t* )test_msg_storage; + msg_pos_llh_t* test_msg = (msg_pos_llh_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 2; test_msg->h_accuracy = 0; @@ -503,70 +622,93 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLH ) test_msg->n_sats = 15; test_msg->tow = 326829000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x20a, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20a, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20a, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_t* check_msg = ( msg_pos_llh_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_t* check_msg = (msg_pos_llh_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 2, "incorrect value for flags, expected 2, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 27.9395123109*100) < 0.05, "incorrect value for height, expected 27.9395123109, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.2512925784*100) < 0.05, "incorrect value for lat, expected 37.2512925784, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -121.875056094*100) < 0.05, "incorrect value for lon, expected -121.875056094, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326829000, "incorrect value for tow, expected 326829000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 2, + "incorrect value for flags, expected 2, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 27.9395123109 * 100) < 0.05, + "incorrect value for height, expected 27.9395123109, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.2512925784 * 100) < 0.05, + "incorrect value for lat, expected 37.2512925784, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -121.875056094 * 100) < 0.05, + "incorrect value for lon, expected -121.875056094, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326829000, + "incorrect value for tow, expected 326829000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgPosLLH_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgPosLLH"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosLLH"); +Suite* legacy_auto_check_sbp_navigation_MsgPosLLH_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_navigation_MsgPosLLH"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosLLH"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgPosLLH); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgPosLLHCov.c b/c/test/legacy/auto_check_sbp_navigation_MsgPosLLHCov.c index 20bd3433f..3fdc0a3ba 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgPosLLHCov.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgPosLLHCov.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHCov.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHCov.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHCov ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgPosLLHCov) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHCov ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,24 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHCov ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x211, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x211, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x211, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x211, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,17,2,66,0,54,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,64,0,0,0,0,0,0,0,0,0,0,224,64,0,0,160,64,0,0,0,65,0,0,192,64,0,0,128,63,0,0,0,64,5,5,151,98, }; + u8 encoded_frame[] = { + 85, 17, 2, 66, 0, 54, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 28, 64, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 224, 64, 0, 0, 160, 64, 0, 0, 0, 65, 0, 0, + 192, 64, 0, 0, 128, 63, 0, 0, 0, 64, 5, 5, 151, 98, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_cov_t* test_msg = ( msg_pos_llh_cov_t* )test_msg_storage; + msg_pos_llh_cov_t *test_msg = (msg_pos_llh_cov_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cov_d_d = 2.0; test_msg->cov_e_d = 1.0; @@ -155,74 +159,105 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHCov ) test_msg->lon = 7.0; test_msg->n_sats = 5; test_msg->tow = 7; - sbp_payload_send(&sbp_state, 0x211, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x211, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x211, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_cov_t* check_msg = ( msg_pos_llh_cov_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_cov_t *check_msg = (msg_pos_llh_cov_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cov_d_d*100 - 2.0*100) < 0.05, "incorrect value for cov_d_d, expected 2.0, is %f", check_msg->cov_d_d); - ck_assert_msg((check_msg->cov_e_d*100 - 1.0*100) < 0.05, "incorrect value for cov_e_d, expected 1.0, is %f", check_msg->cov_e_d); - ck_assert_msg((check_msg->cov_e_e*100 - 6.0*100) < 0.05, "incorrect value for cov_e_e, expected 6.0, is %f", check_msg->cov_e_e); - ck_assert_msg((check_msg->cov_n_d*100 - 8.0*100) < 0.05, "incorrect value for cov_n_d, expected 8.0, is %f", check_msg->cov_n_d); - ck_assert_msg((check_msg->cov_n_e*100 - 5.0*100) < 0.05, "incorrect value for cov_n_e, expected 5.0, is %f", check_msg->cov_n_e); - ck_assert_msg((check_msg->cov_n_n*100 - 7.0*100) < 0.05, "incorrect value for cov_n_n, expected 7.0, is %f", check_msg->cov_n_n); - ck_assert_msg(check_msg->flags == 5, "incorrect value for flags, expected 5, is %d", check_msg->flags); - ck_assert_msg((check_msg->height*100 - 0.0*100) < 0.05, "incorrect value for height, expected 0.0, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 0.0*100) < 0.05, "incorrect value for lat, expected 0.0, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - 7.0*100) < 0.05, "incorrect value for lon, expected 7.0, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 5, "incorrect value for n_sats, expected 5, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 7, "incorrect value for tow, expected 7, is %d", check_msg->tow); + ck_assert_msg((check_msg->cov_d_d * 100 - 2.0 * 100) < 0.05, + "incorrect value for cov_d_d, expected 2.0, is %f", + check_msg->cov_d_d); + ck_assert_msg((check_msg->cov_e_d * 100 - 1.0 * 100) < 0.05, + "incorrect value for cov_e_d, expected 1.0, is %f", + check_msg->cov_e_d); + ck_assert_msg((check_msg->cov_e_e * 100 - 6.0 * 100) < 0.05, + "incorrect value for cov_e_e, expected 6.0, is %f", + check_msg->cov_e_e); + ck_assert_msg((check_msg->cov_n_d * 100 - 8.0 * 100) < 0.05, + "incorrect value for cov_n_d, expected 8.0, is %f", + check_msg->cov_n_d); + ck_assert_msg((check_msg->cov_n_e * 100 - 5.0 * 100) < 0.05, + "incorrect value for cov_n_e, expected 5.0, is %f", + check_msg->cov_n_e); + ck_assert_msg((check_msg->cov_n_n * 100 - 7.0 * 100) < 0.05, + "incorrect value for cov_n_n, expected 7.0, is %f", + check_msg->cov_n_n); + ck_assert_msg(check_msg->flags == 5, + "incorrect value for flags, expected 5, is %d", + check_msg->flags); + ck_assert_msg((check_msg->height * 100 - 0.0 * 100) < 0.05, + "incorrect value for height, expected 0.0, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 0.0 * 100) < 0.05, + "incorrect value for lat, expected 0.0, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - 7.0 * 100) < 0.05, + "incorrect value for lon, expected 7.0, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 5, + "incorrect value for n_sats, expected 5, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 7, + "incorrect value for tow, expected 7, is %d", check_msg->tow); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgPosLLHCov_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgPosLLHCov"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosLLHCov"); +Suite *legacy_auto_check_sbp_navigation_MsgPosLLHCov_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgPosLLHCov"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosLLHCov"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgPosLLHCov); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgPosLLHDepA.c b/c/test/legacy/auto_check_sbp_navigation_MsgPosLLHDepA.c index 5f7b70380..a8df2cefc 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgPosLLHDepA.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgPosLLHDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,2,246,215,34,20,46,39,0,250,29,226,186,235,182,66,64,19,203,51,196,24,139,94,192,31,157,160,232,122,115,81,64,0,0,0,0,9,0,236,139, }; + u8 encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 20, 46, 39, 0, 250, 29, 226, 186, + 235, 182, 66, 64, 19, 203, 51, 196, 24, 139, 94, 192, 31, 157, + 160, 232, 122, 115, 81, 64, 0, 0, 0, 0, 9, 0, 236, 139, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; + msg_pos_llh_dep_a_t* test_msg = (msg_pos_llh_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->h_accuracy = 0; @@ -151,67 +154,91 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) test_msg->n_sats = 9; test_msg->tow = 2567700; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x201, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x201, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x201, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_dep_a_t* check_msg = ( msg_pos_llh_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_dep_a_t* check_msg = + (msg_pos_llh_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 69.8043767518*100) < 0.05, "incorrect value for height, expected 69.8043767518, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.4290689091*100) < 0.05, "incorrect value for lat, expected 37.4290689091, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -122.173386622*100) < 0.05, "incorrect value for lon, expected -122.173386622, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567700, "incorrect value for tow, expected 2567700, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 69.8043767518 * 100) < 0.05, + "incorrect value for height, expected 69.8043767518, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.4290689091 * 100) < 0.05, + "incorrect value for lat, expected 37.4290689091, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -122.173386622 * 100) < 0.05, + "incorrect value for lon, expected -122.173386622, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567700, + "incorrect value for tow, expected 2567700, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -219,17 +246,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,2,246,215,34,20,46,39,0,161,51,75,148,235,182,66,64,36,41,246,30,25,139,94,192,254,218,49,127,10,108,81,64,0,0,0,0,9,1,25,117, }; + u8 encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 20, 46, 39, 0, 161, 51, 75, 148, + 235, 182, 66, 64, 36, 41, 246, 30, 25, 139, 94, 192, 254, 218, + 49, 127, 10, 108, 81, 64, 0, 0, 0, 0, 9, 1, 25, 117, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; + msg_pos_llh_dep_a_t* test_msg = (msg_pos_llh_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 1; test_msg->h_accuracy = 0; @@ -239,67 +272,91 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) test_msg->n_sats = 9; test_msg->tow = 2567700; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x201, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x201, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x201, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_dep_a_t* check_msg = ( msg_pos_llh_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_dep_a_t* check_msg = + (msg_pos_llh_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 69.6881406772*100) < 0.05, "incorrect value for height, expected 69.6881406772, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.4290643089*100) < 0.05, "incorrect value for lat, expected 37.4290643089, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -122.173408261*100) < 0.05, "incorrect value for lon, expected -122.173408261, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567700, "incorrect value for tow, expected 2567700, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 69.6881406772 * 100) < 0.05, + "incorrect value for height, expected 69.6881406772, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.4290643089 * 100) < 0.05, + "incorrect value for lat, expected 37.4290643089, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -122.173408261 * 100) < 0.05, + "incorrect value for lon, expected -122.173408261, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567700, + "incorrect value for tow, expected 2567700, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -307,17 +364,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,2,246,215,34,120,46,39,0,56,214,210,65,235,182,66,64,13,46,132,80,25,139,94,192,22,143,46,234,191,95,81,64,0,0,0,0,9,0,174,105, }; + u8 encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 120, 46, 39, 0, 56, 214, 210, 65, + 235, 182, 66, 64, 13, 46, 132, 80, 25, 139, 94, 192, 22, 143, + 46, 234, 191, 95, 81, 64, 0, 0, 0, 0, 9, 0, 174, 105, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; + msg_pos_llh_dep_a_t* test_msg = (msg_pos_llh_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->h_accuracy = 0; @@ -327,67 +390,91 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) test_msg->n_sats = 9; test_msg->tow = 2567800; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x201, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x201, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x201, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_dep_a_t* check_msg = ( msg_pos_llh_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_dep_a_t* check_msg = + (msg_pos_llh_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 69.4960885482*100) < 0.05, "incorrect value for height, expected 69.4960885482, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.4290544776*100) < 0.05, "incorrect value for lat, expected 37.4290544776, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -122.173420075*100) < 0.05, "incorrect value for lon, expected -122.173420075, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567800, "incorrect value for tow, expected 2567800, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 69.4960885482 * 100) < 0.05, + "incorrect value for height, expected 69.4960885482, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.4290544776 * 100) < 0.05, + "incorrect value for lat, expected 37.4290544776, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -122.173420075 * 100) < 0.05, + "incorrect value for lon, expected -122.173420075, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567800, + "incorrect value for tow, expected 2567800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -395,17 +482,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,2,246,215,34,120,46,39,0,251,117,115,140,235,182,66,64,152,134,167,12,25,139,94,192,160,22,137,253,4,108,81,64,0,0,0,0,9,1,122,127, }; + u8 encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 120, 46, 39, 0, 251, 117, 115, 140, + 235, 182, 66, 64, 152, 134, 167, 12, 25, 139, 94, 192, 160, 22, + 137, 253, 4, 108, 81, 64, 0, 0, 0, 0, 9, 1, 122, 127, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; + msg_pos_llh_dep_a_t* test_msg = (msg_pos_llh_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 1; test_msg->h_accuracy = 0; @@ -415,67 +508,91 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) test_msg->n_sats = 9; test_msg->tow = 2567800; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x201, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x201, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x201, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_dep_a_t* check_msg = ( msg_pos_llh_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_dep_a_t* check_msg = + (msg_pos_llh_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 69.6878045882*100) < 0.05, "incorrect value for height, expected 69.6878045882, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.4290633739*100) < 0.05, "incorrect value for lat, expected 37.4290633739, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -122.173403896*100) < 0.05, "incorrect value for lon, expected -122.173403896, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567800, "incorrect value for tow, expected 2567800, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 69.6878045882 * 100) < 0.05, + "incorrect value for height, expected 69.6878045882, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.4290633739 * 100) < 0.05, + "incorrect value for lat, expected 37.4290633739, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -122.173403896 * 100) < 0.05, + "incorrect value for lon, expected -122.173403896, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567800, + "incorrect value for tow, expected 2567800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -483,17 +600,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,2,246,215,34,220,46,39,0,51,124,88,251,235,182,66,64,153,5,250,16,25,139,94,192,146,60,187,219,152,161,81,64,0,0,0,0,9,0,194,158, }; + u8 encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 220, 46, 39, 0, 51, 124, 88, 251, + 235, 182, 66, 64, 153, 5, 250, 16, 25, 139, 94, 192, 146, 60, + 187, 219, 152, 161, 81, 64, 0, 0, 0, 0, 9, 0, 194, 158, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; + msg_pos_llh_dep_a_t* test_msg = (msg_pos_llh_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->h_accuracy = 0; @@ -503,67 +626,91 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) test_msg->n_sats = 9; test_msg->tow = 2567900; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x201, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x201, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x201, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_dep_a_t* check_msg = ( msg_pos_llh_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_dep_a_t* check_msg = + (msg_pos_llh_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 70.5249547318*100) < 0.05, "incorrect value for height, expected 70.5249547318, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.4290765936*100) < 0.05, "incorrect value for lat, expected 37.4290765936, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -122.173404926*100) < 0.05, "incorrect value for lon, expected -122.173404926, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567900, "incorrect value for tow, expected 2567900, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 70.5249547318 * 100) < 0.05, + "incorrect value for height, expected 70.5249547318, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.4290765936 * 100) < 0.05, + "incorrect value for lat, expected 37.4290765936, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -122.173404926 * 100) < 0.05, + "incorrect value for lon, expected -122.173404926, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567900, + "incorrect value for tow, expected 2567900, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -571,17 +718,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,2,195,4,34,212,157,67,24,8,23,228,8,151,225,66,64,156,174,42,194,230,152,94,192,153,23,72,47,196,40,16,64,0,0,0,0,8,0,237,169, }; + u8 encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 212, 157, 67, 24, 8, 23, 228, 8, + 151, 225, 66, 64, 156, 174, 42, 194, 230, 152, 94, 192, 153, 23, + 72, 47, 196, 40, 16, 64, 0, 0, 0, 0, 8, 0, 237, 169, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; + msg_pos_llh_dep_a_t* test_msg = (msg_pos_llh_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->h_accuracy = 0; @@ -591,67 +744,91 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) test_msg->n_sats = 8; test_msg->tow = 407084500; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x201, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x201, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x201, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_dep_a_t* check_msg = ( msg_pos_llh_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_dep_a_t* check_msg = + (msg_pos_llh_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 4.03981088521*100) < 0.05, "incorrect value for height, expected 4.03981088521, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.7624217142*100) < 0.05, "incorrect value for lat, expected 37.7624217142, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -122.389084379*100) < 0.05, "incorrect value for lon, expected -122.389084379, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084500, "incorrect value for tow, expected 407084500, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 4.03981088521 * 100) < 0.05, + "incorrect value for height, expected 4.03981088521, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.7624217142 * 100) < 0.05, + "incorrect value for lat, expected 37.7624217142, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -122.389084379 * 100) < 0.05, + "incorrect value for lon, expected -122.389084379, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084500, + "incorrect value for tow, expected 407084500, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -659,17 +836,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,2,195,4,34,56,158,67,24,220,109,212,24,151,225,66,64,159,231,254,219,230,152,94,192,128,151,67,19,233,105,7,64,0,0,0,0,8,0,152,11, }; + u8 encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 56, 158, 67, 24, 220, 109, 212, 24, + 151, 225, 66, 64, 159, 231, 254, 219, 230, 152, 94, 192, 128, 151, + 67, 19, 233, 105, 7, 64, 0, 0, 0, 0, 8, 0, 152, 11, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; + msg_pos_llh_dep_a_t* test_msg = (msg_pos_llh_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->h_accuracy = 0; @@ -679,67 +862,91 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) test_msg->n_sats = 8; test_msg->tow = 407084600; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x201, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x201, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x201, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_dep_a_t* check_msg = ( msg_pos_llh_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_dep_a_t* check_msg = + (msg_pos_llh_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 2.92671408701*100) < 0.05, "incorrect value for height, expected 2.92671408701, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.7624236142*100) < 0.05, "incorrect value for lat, expected 37.7624236142, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -122.389090537*100) < 0.05, "incorrect value for lon, expected -122.389090537, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084600, "incorrect value for tow, expected 407084600, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 2.92671408701 * 100) < 0.05, + "incorrect value for height, expected 2.92671408701, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.7624236142 * 100) < 0.05, + "incorrect value for lat, expected 37.7624236142, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -122.389090537 * 100) < 0.05, + "incorrect value for lon, expected -122.389090537, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084600, + "incorrect value for tow, expected 407084600, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -747,17 +954,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,2,195,4,34,156,158,67,24,13,91,237,11,151,225,66,64,75,113,210,220,230,152,94,192,37,6,145,188,89,112,238,63,0,0,0,0,8,0,221,155, }; + u8 encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 156, 158, 67, 24, 13, 91, 237, 11, + 151, 225, 66, 64, 75, 113, 210, 220, 230, 152, 94, 192, 37, 6, + 145, 188, 89, 112, 238, 63, 0, 0, 0, 0, 8, 0, 221, 155, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; + msg_pos_llh_dep_a_t* test_msg = (msg_pos_llh_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->h_accuracy = 0; @@ -767,67 +980,91 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) test_msg->n_sats = 8; test_msg->tow = 407084700; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x201, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x201, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x201, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_dep_a_t* check_msg = ( msg_pos_llh_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_dep_a_t* check_msg = + (msg_pos_llh_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 0.95121466474*100) < 0.05, "incorrect value for height, expected 0.95121466474, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.7624220761*100) < 0.05, "incorrect value for lat, expected 37.7624220761, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -122.389090734*100) < 0.05, "incorrect value for lon, expected -122.389090734, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084700, "incorrect value for tow, expected 407084700, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 0.95121466474 * 100) < 0.05, + "incorrect value for height, expected 0.95121466474, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.7624220761 * 100) < 0.05, + "incorrect value for lat, expected 37.7624220761, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -122.389090734 * 100) < 0.05, + "incorrect value for lon, expected -122.389090734, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084700, + "incorrect value for tow, expected 407084700, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -835,17 +1072,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,2,195,4,34,0,159,67,24,51,183,5,8,151,225,66,64,13,226,148,253,230,152,94,192,187,27,11,32,69,213,2,64,0,0,0,0,8,0,82,94, }; + u8 encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 0, 159, 67, 24, 51, 183, 5, 8, + 151, 225, 66, 64, 13, 226, 148, 253, 230, 152, 94, 192, 187, 27, + 11, 32, 69, 213, 2, 64, 0, 0, 0, 0, 8, 0, 82, 94, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; + msg_pos_llh_dep_a_t* test_msg = (msg_pos_llh_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->h_accuracy = 0; @@ -855,67 +1098,91 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) test_msg->n_sats = 8; test_msg->tow = 407084800; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x201, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x201, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x201, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_dep_a_t* check_msg = ( msg_pos_llh_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_dep_a_t* check_msg = + (msg_pos_llh_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 2.35413575205*100) < 0.05, "incorrect value for height, expected 2.35413575205, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.7624216106*100) < 0.05, "incorrect value for lat, expected 37.7624216106, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -122.389098544*100) < 0.05, "incorrect value for lon, expected -122.389098544, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084800, "incorrect value for tow, expected 407084800, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 2.35413575205 * 100) < 0.05, + "incorrect value for height, expected 2.35413575205, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.7624216106 * 100) < 0.05, + "incorrect value for lat, expected 37.7624216106, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -122.389098544 * 100) < 0.05, + "incorrect value for lon, expected -122.389098544, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084800, + "incorrect value for tow, expected 407084800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -923,17 +1190,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,2,195,4,34,100,159,67,24,22,77,146,22,151,225,66,64,64,134,105,227,230,152,94,192,37,99,114,72,31,103,241,63,0,0,0,0,8,0,70,60, }; + u8 encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 100, 159, 67, 24, 22, 77, 146, 22, + 151, 225, 66, 64, 64, 134, 105, 227, 230, 152, 94, 192, 37, 99, + 114, 72, 31, 103, 241, 63, 0, 0, 0, 0, 8, 0, 70, 60, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; + msg_pos_llh_dep_a_t* test_msg = (msg_pos_llh_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->h_accuracy = 0; @@ -943,67 +1216,91 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) test_msg->n_sats = 8; test_msg->tow = 407084900; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x201, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x201, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x201, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_dep_a_t* check_msg = ( msg_pos_llh_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_dep_a_t* check_msg = + (msg_pos_llh_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 1.08767631816*100) < 0.05, "incorrect value for height, expected 1.08767631816, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.762423345*100) < 0.05, "incorrect value for lat, expected 37.762423345, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -122.389092305*100) < 0.05, "incorrect value for lon, expected -122.389092305, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084900, "incorrect value for tow, expected 407084900, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 1.08767631816 * 100) < 0.05, + "incorrect value for height, expected 1.08767631816, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.762423345 * 100) < 0.05, + "incorrect value for lat, expected 37.762423345, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -122.389092305 * 100) < 0.05, + "incorrect value for lon, expected -122.389092305, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084900, + "incorrect value for tow, expected 407084900, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -1011,17 +1308,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x201, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x201, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,2,195,4,34,46,162,68,24,124,245,46,169,151,225,66,64,135,149,234,187,230,152,94,192,194,201,115,145,166,175,20,64,0,0,0,0,5,0,212,121, }; + u8 encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 46, 162, 68, 24, 124, 245, 46, 169, + 151, 225, 66, 64, 135, 149, 234, 187, 230, 152, 94, 192, 194, 201, + 115, 145, 166, 175, 20, 64, 0, 0, 0, 0, 5, 0, 212, 121, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; + msg_pos_llh_dep_a_t* test_msg = (msg_pos_llh_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->h_accuracy = 0; @@ -1031,70 +1334,95 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA ) test_msg->n_sats = 5; test_msg->tow = 407151150; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x201, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x201, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x201, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_dep_a_t* check_msg = ( msg_pos_llh_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_dep_a_t* check_msg = + (msg_pos_llh_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - 5.17153384465*100) < 0.05, "incorrect value for height, expected 5.17153384465, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.7624408225*100) < 0.05, "incorrect value for lat, expected 37.7624408225, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -122.389082889*100) < 0.05, "incorrect value for lon, expected -122.389082889, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 5, "incorrect value for n_sats, expected 5, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407151150, "incorrect value for tow, expected 407151150, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - 5.17153384465 * 100) < 0.05, + "incorrect value for height, expected 5.17153384465, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.7624408225 * 100) < 0.05, + "incorrect value for lat, expected 37.7624408225, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -122.389082889 * 100) < 0.05, + "incorrect value for lon, expected -122.389082889, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 5, + "incorrect value for n_sats, expected 5, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407151150, + "incorrect value for tow, expected 407151150, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgPosLLHDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgPosLLHDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosLLHDepA"); +Suite* legacy_auto_check_sbp_navigation_MsgPosLLHDepA_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgPosLLHDepA"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosLLHDepA"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgPosLlhAcc.c b/c/test/legacy/auto_check_sbp_navigation_MsgPosLlhAcc.c index e8464aab8..90621d187 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgPosLlhAcc.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgPosLlhAcc.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhAcc.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhAcc.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLlhAcc ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgPosLlhAcc) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLlhAcc ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,26 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLlhAcc ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x218, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x218, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x218, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x218, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,24,2,2,28,67,39,120,110,18,51,51,51,51,51,139,189,64,154,153,153,153,25,151,192,64,51,51,51,51,51,161,176,64,51,51,51,51,51,101,179,64,51,163,22,69,154,25,173,69,102,134,243,68,154,201,196,69,205,224,0,70,51,35,72,69,51,99,31,69,95,27,72,220,177, }; + u8 encoded_frame[] = { + 85, 24, 2, 2, 28, 67, 39, 120, 110, 18, 51, 51, 51, + 51, 51, 139, 189, 64, 154, 153, 153, 153, 25, 151, 192, 64, + 51, 51, 51, 51, 51, 161, 176, 64, 51, 51, 51, 51, 51, + 101, 179, 64, 51, 163, 22, 69, 154, 25, 173, 69, 102, 134, + 243, 68, 154, 201, 196, 69, 205, 224, 0, 70, 51, 35, 72, + 69, 51, 99, 31, 69, 95, 27, 72, 220, 177, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_acc_t* test_msg = ( msg_pos_llh_acc_t* )test_msg_storage; + msg_pos_llh_acc_t *test_msg = (msg_pos_llh_acc_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->at_accuracy = 6297.2001953125; test_msg->confidence_and_geoid = 95; @@ -158,77 +164,127 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLlhAcc ) test_msg->orthometric_height = 4965.2; test_msg->tow = 309229607; test_msg->v_accuracy = 5539.2001953125; - sbp_payload_send(&sbp_state, 0x218, 7170, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x218, 7170, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 7170, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 7170, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x218, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_acc_t* check_msg = ( msg_pos_llh_acc_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_acc_t *check_msg = (msg_pos_llh_acc_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->at_accuracy*100 - 6297.20019531*100) < 0.05, "incorrect value for at_accuracy, expected 6297.20019531, is %f", check_msg->at_accuracy); - ck_assert_msg(check_msg->confidence_and_geoid == 95, "incorrect value for confidence_and_geoid, expected 95, is %d", check_msg->confidence_and_geoid); - ck_assert_msg((check_msg->ct_accuracy*100 - 1948.19995117*100) < 0.05, "incorrect value for ct_accuracy, expected 1948.19995117, is %f", check_msg->ct_accuracy); - ck_assert_msg(check_msg->flags == 72, "incorrect value for flags, expected 72, is %d", check_msg->flags); - ck_assert_msg((check_msg->h_accuracy*100 - 2410.19995117*100) < 0.05, "incorrect value for h_accuracy, expected 2410.19995117, is %f", check_msg->h_accuracy); - ck_assert_msg((check_msg->h_ellipse.orientation*100 - 2550.19995117*100) < 0.05, "incorrect value for h_ellipse.orientation, expected 2550.19995117, is %f", check_msg->h_ellipse.orientation); - ck_assert_msg((check_msg->h_ellipse.semi_major*100 - 8248.20019531*100) < 0.05, "incorrect value for h_ellipse.semi_major, expected 8248.20019531, is %f", check_msg->h_ellipse.semi_major); - ck_assert_msg((check_msg->h_ellipse.semi_minor*100 - 3202.19995117*100) < 0.05, "incorrect value for h_ellipse.semi_minor, expected 3202.19995117, is %f", check_msg->h_ellipse.semi_minor); - ck_assert_msg((check_msg->height*100 - 4257.2*100) < 0.05, "incorrect value for height, expected 4257.2, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 7563.2*100) < 0.05, "incorrect value for lat, expected 7563.2, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - 8494.2*100) < 0.05, "incorrect value for lon, expected 8494.2, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 27, "incorrect value for n_sats, expected 27, is %d", check_msg->n_sats); - ck_assert_msg((check_msg->orthometric_height*100 - 4965.2*100) < 0.05, "incorrect value for orthometric_height, expected 4965.2, is %f", check_msg->orthometric_height); - ck_assert_msg(check_msg->tow == 309229607, "incorrect value for tow, expected 309229607, is %d", check_msg->tow); - ck_assert_msg((check_msg->v_accuracy*100 - 5539.20019531*100) < 0.05, "incorrect value for v_accuracy, expected 5539.20019531, is %f", check_msg->v_accuracy); + ck_assert_msg( + (check_msg->at_accuracy * 100 - 6297.20019531 * 100) < 0.05, + "incorrect value for at_accuracy, expected 6297.20019531, is %f", + check_msg->at_accuracy); + ck_assert_msg( + check_msg->confidence_and_geoid == 95, + "incorrect value for confidence_and_geoid, expected 95, is %d", + check_msg->confidence_and_geoid); + ck_assert_msg( + (check_msg->ct_accuracy * 100 - 1948.19995117 * 100) < 0.05, + "incorrect value for ct_accuracy, expected 1948.19995117, is %f", + check_msg->ct_accuracy); + ck_assert_msg(check_msg->flags == 72, + "incorrect value for flags, expected 72, is %d", + check_msg->flags); + ck_assert_msg( + (check_msg->h_accuracy * 100 - 2410.19995117 * 100) < 0.05, + "incorrect value for h_accuracy, expected 2410.19995117, is %f", + check_msg->h_accuracy); + ck_assert_msg( + (check_msg->h_ellipse.orientation * 100 - 2550.19995117 * 100) < 0.05, + "incorrect value for h_ellipse.orientation, expected 2550.19995117, is " + "%f", + check_msg->h_ellipse.orientation); + ck_assert_msg( + (check_msg->h_ellipse.semi_major * 100 - 8248.20019531 * 100) < 0.05, + "incorrect value for h_ellipse.semi_major, expected 8248.20019531, is " + "%f", + check_msg->h_ellipse.semi_major); + ck_assert_msg( + (check_msg->h_ellipse.semi_minor * 100 - 3202.19995117 * 100) < 0.05, + "incorrect value for h_ellipse.semi_minor, expected 3202.19995117, is " + "%f", + check_msg->h_ellipse.semi_minor); + ck_assert_msg((check_msg->height * 100 - 4257.2 * 100) < 0.05, + "incorrect value for height, expected 4257.2, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 7563.2 * 100) < 0.05, + "incorrect value for lat, expected 7563.2, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - 8494.2 * 100) < 0.05, + "incorrect value for lon, expected 8494.2, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 27, + "incorrect value for n_sats, expected 27, is %d", + check_msg->n_sats); + ck_assert_msg( + (check_msg->orthometric_height * 100 - 4965.2 * 100) < 0.05, + "incorrect value for orthometric_height, expected 4965.2, is %f", + check_msg->orthometric_height); + ck_assert_msg(check_msg->tow == 309229607, + "incorrect value for tow, expected 309229607, is %d", + check_msg->tow); + ck_assert_msg( + (check_msg->v_accuracy * 100 - 5539.20019531 * 100) < 0.05, + "incorrect value for v_accuracy, expected 5539.20019531, is %f", + check_msg->v_accuracy); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgPosLlhAcc_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgPosLlhAcc"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosLlhAcc"); +Suite *legacy_auto_check_sbp_navigation_MsgPosLlhAcc_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgPosLlhAcc"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosLlhAcc"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgPosLlhAcc); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgPosLlhCovGnss.c b/c/test/legacy/auto_check_sbp_navigation_MsgPosLlhCovGnss.c index 4fcab1b59..f79588844 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgPosLlhCovGnss.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgPosLlhCovGnss.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhCovGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhCovGnss.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,26 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x231, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x231, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x231, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x231, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,49,2,0,16,54,24,229,233,29,73,123,28,207,101,234,66,64,100,168,19,20,86,146,94,192,214,198,35,120,209,100,49,192,12,102,245,59,6,181,192,185,168,79,243,58,96,60,148,59,253,58,93,186,159,174,6,61,18,4,10,196, }; + u8 encoded_frame[] = { + 85, 49, 2, 0, 16, 54, 24, 229, 233, 29, 73, 123, 28, + 207, 101, 234, 66, 64, 100, 168, 19, 20, 86, 146, 94, 192, + 214, 198, 35, 120, 209, 100, 49, 192, 12, 102, 245, 59, 6, + 181, 192, 185, 168, 79, 243, 58, 96, 60, 148, 59, 253, 58, + 93, 186, 159, 174, 6, 61, 18, 4, 10, 196, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_cov_gnss_t* test_msg = ( msg_pos_llh_cov_gnss_t* )test_msg_storage; + msg_pos_llh_cov_gnss_t *test_msg = + (msg_pos_llh_cov_gnss_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cov_d_d = 0.03288137540221214; test_msg->cov_e_d = -0.0008439270895905793; @@ -155,75 +161,115 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss ) test_msg->lon = -122.28650381011681; test_msg->n_sats = 18; test_msg->tow = 501867800; - sbp_payload_send(&sbp_state, 0x231, 4096, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x231, 4096, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 4096, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x231, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_cov_gnss_t* check_msg = ( msg_pos_llh_cov_gnss_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_cov_gnss_t *check_msg = + (msg_pos_llh_cov_gnss_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cov_d_d*100 - 0.0328813754022*100) < 0.05, "incorrect value for cov_d_d, expected 0.0328813754022, is %f", check_msg->cov_d_d); - ck_assert_msg((check_msg->cov_e_d*100 - -0.000843927089591*100) < 0.05, "incorrect value for cov_e_d, expected -0.000843927089591, is %f", check_msg->cov_e_d); - ck_assert_msg((check_msg->cov_e_e*100 - 0.00452379882336*100) < 0.05, "incorrect value for cov_e_e, expected 0.00452379882336, is %f", check_msg->cov_e_e); - ck_assert_msg((check_msg->cov_n_d*100 - 0.00185631681234*100) < 0.05, "incorrect value for cov_n_d, expected 0.00185631681234, is %f", check_msg->cov_n_d); - ck_assert_msg((check_msg->cov_n_e*100 - -0.000367559667211*100) < 0.05, "incorrect value for cov_n_e, expected -0.000367559667211, is %f", check_msg->cov_n_e); - ck_assert_msg((check_msg->cov_n_n*100 - 0.00748897157609*100) < 0.05, "incorrect value for cov_n_n, expected 0.00748897157609, is %f", check_msg->cov_n_n); - ck_assert_msg(check_msg->flags == 4, "incorrect value for flags, expected 4, is %d", check_msg->flags); - ck_assert_msg((check_msg->height*100 - -17.3938212478*100) < 0.05, "incorrect value for height, expected -17.3938212478, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.831231965*100) < 0.05, "incorrect value for lat, expected 37.831231965, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -122.28650381*100) < 0.05, "incorrect value for lon, expected -122.28650381, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 18, "incorrect value for n_sats, expected 18, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 501867800, "incorrect value for tow, expected 501867800, is %d", check_msg->tow); + ck_assert_msg( + (check_msg->cov_d_d * 100 - 0.0328813754022 * 100) < 0.05, + "incorrect value for cov_d_d, expected 0.0328813754022, is %f", + check_msg->cov_d_d); + ck_assert_msg( + (check_msg->cov_e_d * 100 - -0.000843927089591 * 100) < 0.05, + "incorrect value for cov_e_d, expected -0.000843927089591, is %f", + check_msg->cov_e_d); + ck_assert_msg( + (check_msg->cov_e_e * 100 - 0.00452379882336 * 100) < 0.05, + "incorrect value for cov_e_e, expected 0.00452379882336, is %f", + check_msg->cov_e_e); + ck_assert_msg( + (check_msg->cov_n_d * 100 - 0.00185631681234 * 100) < 0.05, + "incorrect value for cov_n_d, expected 0.00185631681234, is %f", + check_msg->cov_n_d); + ck_assert_msg( + (check_msg->cov_n_e * 100 - -0.000367559667211 * 100) < 0.05, + "incorrect value for cov_n_e, expected -0.000367559667211, is %f", + check_msg->cov_n_e); + ck_assert_msg( + (check_msg->cov_n_n * 100 - 0.00748897157609 * 100) < 0.05, + "incorrect value for cov_n_n, expected 0.00748897157609, is %f", + check_msg->cov_n_n); + ck_assert_msg(check_msg->flags == 4, + "incorrect value for flags, expected 4, is %d", + check_msg->flags); + ck_assert_msg((check_msg->height * 100 - -17.3938212478 * 100) < 0.05, + "incorrect value for height, expected -17.3938212478, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.831231965 * 100) < 0.05, + "incorrect value for lat, expected 37.831231965, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -122.28650381 * 100) < 0.05, + "incorrect value for lon, expected -122.28650381, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 18, + "incorrect value for n_sats, expected 18, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 501867800, + "incorrect value for tow, expected 501867800, is %d", + check_msg->tow); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss); +Suite *legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgPosLlhGnss.c b/c/test/legacy/auto_check_sbp_navigation_MsgPosLlhGnss.c index f2ba92b38..e909cdccd 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgPosLlhGnss.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgPosLlhGnss.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhGnss.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLlhGnss ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgPosLlhGnss) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLlhGnss ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLlhGnss ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x22a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x22a, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x22a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x22a, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,42,2,0,16,34,24,229,233,29,73,123,28,207,101,234,66,64,100,168,19,20,86,146,94,192,214,198,35,120,209,100,49,192,87,0,181,0,18,4,105,55, }; + u8 encoded_frame[] = { + 85, 42, 2, 0, 16, 34, 24, 229, 233, 29, 73, 123, 28, 207, + 101, 234, 66, 64, 100, 168, 19, 20, 86, 146, 94, 192, 214, 198, + 35, 120, 209, 100, 49, 192, 87, 0, 181, 0, 18, 4, 105, 55, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pos_llh_gnss_t* test_msg = ( msg_pos_llh_gnss_t* )test_msg_storage; + msg_pos_llh_gnss_t *test_msg = (msg_pos_llh_gnss_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 4; test_msg->h_accuracy = 87; @@ -151,70 +154,95 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPosLlhGnss ) test_msg->n_sats = 18; test_msg->tow = 501867800; test_msg->v_accuracy = 181; - sbp_payload_send(&sbp_state, 0x22a, 4096, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x22a, 4096, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 4096, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x22a, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pos_llh_gnss_t* check_msg = ( msg_pos_llh_gnss_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pos_llh_gnss_t *check_msg = + (msg_pos_llh_gnss_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 4, "incorrect value for flags, expected 4, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 87, "incorrect value for h_accuracy, expected 87, is %d", check_msg->h_accuracy); - ck_assert_msg((check_msg->height*100 - -17.3938212478*100) < 0.05, "incorrect value for height, expected -17.3938212478, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.831231965*100) < 0.05, "incorrect value for lat, expected 37.831231965, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -122.28650381*100) < 0.05, "incorrect value for lon, expected -122.28650381, is %f", check_msg->lon); - ck_assert_msg(check_msg->n_sats == 18, "incorrect value for n_sats, expected 18, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 501867800, "incorrect value for tow, expected 501867800, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 181, "incorrect value for v_accuracy, expected 181, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->flags == 4, + "incorrect value for flags, expected 4, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 87, + "incorrect value for h_accuracy, expected 87, is %d", + check_msg->h_accuracy); + ck_assert_msg((check_msg->height * 100 - -17.3938212478 * 100) < 0.05, + "incorrect value for height, expected -17.3938212478, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.831231965 * 100) < 0.05, + "incorrect value for lat, expected 37.831231965, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -122.28650381 * 100) < 0.05, + "incorrect value for lon, expected -122.28650381, is %f", + check_msg->lon); + ck_assert_msg(check_msg->n_sats == 18, + "incorrect value for n_sats, expected 18, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 501867800, + "incorrect value for tow, expected 501867800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 181, + "incorrect value for v_accuracy, expected 181, is %d", + check_msg->v_accuracy); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgPosLlhGnss_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgPosLlhGnss"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosLlhGnss"); +Suite *legacy_auto_check_sbp_navigation_MsgPosLlhGnss_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgPosLlhGnss"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgPosLlhGnss"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgPosLlhGnss); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgPoseRelative.c b/c/test/legacy/auto_check_sbp_navigation_MsgPoseRelative.c index f9ae2ad36..82b00618c 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgPoseRelative.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgPoseRelative.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPoseRelative.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPoseRelative.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgPoseRelative ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgPoseRelative) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPoseRelative ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,27 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPoseRelative ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x245, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x245, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x245, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x245, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,69,2,66,0,90,86,4,0,0,0,86,4,0,0,172,8,0,0,76,4,0,0,38,2,0,0,100,0,0,0,100,3,200,204,252,168,157,255,115,53,186,144,190,48,34,37,0,0,128,63,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,128,63,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,5,171,187, }; + u8 encoded_frame[] = { + 85, 69, 2, 66, 0, 90, 86, 4, 0, 0, 0, 86, 4, 0, + 0, 172, 8, 0, 0, 76, 4, 0, 0, 38, 2, 0, 0, 100, + 0, 0, 0, 100, 3, 200, 204, 252, 168, 157, 255, 115, 53, 186, + 144, 190, 48, 34, 37, 0, 0, 128, 63, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 128, + 63, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 64, 5, 171, 187, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pose_relative_t* test_msg = ( msg_pose_relative_t* )test_msg_storage; + msg_pose_relative_t *test_msg = (msg_pose_relative_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cov_c_x_x = 2.0; test_msg->cov_c_x_y = 0.0; @@ -179,86 +186,143 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgPoseRelative ) test_msg->x = -6444804; test_msg->y = -1866844813; test_msg->z = 622997694; - sbp_payload_send(&sbp_state, 0x245, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x245, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x245, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pose_relative_t* check_msg = ( msg_pose_relative_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pose_relative_t *check_msg = + (msg_pose_relative_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cov_c_x_x*100 - 2.0*100) < 0.05, "incorrect value for cov_c_x_x, expected 2.0, is %f", check_msg->cov_c_x_x); - ck_assert_msg((check_msg->cov_c_x_y*100 - 0.0*100) < 0.05, "incorrect value for cov_c_x_y, expected 0.0, is %f", check_msg->cov_c_x_y); - ck_assert_msg((check_msg->cov_c_x_z*100 - 0.0*100) < 0.05, "incorrect value for cov_c_x_z, expected 0.0, is %f", check_msg->cov_c_x_z); - ck_assert_msg((check_msg->cov_c_y_y*100 - 2.0*100) < 0.05, "incorrect value for cov_c_y_y, expected 2.0, is %f", check_msg->cov_c_y_y); - ck_assert_msg((check_msg->cov_c_y_z*100 - 0.0*100) < 0.05, "incorrect value for cov_c_y_z, expected 0.0, is %f", check_msg->cov_c_y_z); - ck_assert_msg((check_msg->cov_c_z_z*100 - 2.0*100) < 0.05, "incorrect value for cov_c_z_z, expected 2.0, is %f", check_msg->cov_c_z_z); - ck_assert_msg((check_msg->cov_r_x_x*100 - 1.0*100) < 0.05, "incorrect value for cov_r_x_x, expected 1.0, is %f", check_msg->cov_r_x_x); - ck_assert_msg((check_msg->cov_r_x_y*100 - 0.0*100) < 0.05, "incorrect value for cov_r_x_y, expected 0.0, is %f", check_msg->cov_r_x_y); - ck_assert_msg((check_msg->cov_r_x_z*100 - 0.0*100) < 0.05, "incorrect value for cov_r_x_z, expected 0.0, is %f", check_msg->cov_r_x_z); - ck_assert_msg((check_msg->cov_r_y_y*100 - 1.0*100) < 0.05, "incorrect value for cov_r_y_y, expected 1.0, is %f", check_msg->cov_r_y_y); - ck_assert_msg((check_msg->cov_r_y_z*100 - 0.0*100) < 0.05, "incorrect value for cov_r_y_z, expected 0.0, is %f", check_msg->cov_r_y_z); - ck_assert_msg((check_msg->cov_r_z_z*100 - 1.0*100) < 0.05, "incorrect value for cov_r_z_z, expected 1.0, is %f", check_msg->cov_r_z_z); - ck_assert_msg(check_msg->flags == 5, "incorrect value for flags, expected 5, is %d", check_msg->flags); - ck_assert_msg(check_msg->sensor_id == 0, "incorrect value for sensor_id, expected 0, is %d", check_msg->sensor_id); - ck_assert_msg(check_msg->timestamp_1 == 1110, "incorrect value for timestamp_1, expected 1110, is %d", check_msg->timestamp_1); - ck_assert_msg(check_msg->timestamp_2 == 2220, "incorrect value for timestamp_2, expected 2220, is %d", check_msg->timestamp_2); - ck_assert_msg(check_msg->tow == 1110, "incorrect value for tow, expected 1110, is %d", check_msg->tow); - ck_assert_msg(check_msg->trans[0] == 1100, "incorrect value for trans[0], expected 1100, is %d", check_msg->trans[0]); - ck_assert_msg(check_msg->trans[1] == 550, "incorrect value for trans[1], expected 550, is %d", check_msg->trans[1]); - ck_assert_msg(check_msg->trans[2] == 100, "incorrect value for trans[2], expected 100, is %d", check_msg->trans[2]); - ck_assert_msg(check_msg->w == -859307164, "incorrect value for w, expected -859307164, is %d", check_msg->w); - ck_assert_msg(check_msg->x == -6444804, "incorrect value for x, expected -6444804, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -1866844813, "incorrect value for y, expected -1866844813, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 622997694, "incorrect value for z, expected 622997694, is %d", check_msg->z); + ck_assert_msg((check_msg->cov_c_x_x * 100 - 2.0 * 100) < 0.05, + "incorrect value for cov_c_x_x, expected 2.0, is %f", + check_msg->cov_c_x_x); + ck_assert_msg((check_msg->cov_c_x_y * 100 - 0.0 * 100) < 0.05, + "incorrect value for cov_c_x_y, expected 0.0, is %f", + check_msg->cov_c_x_y); + ck_assert_msg((check_msg->cov_c_x_z * 100 - 0.0 * 100) < 0.05, + "incorrect value for cov_c_x_z, expected 0.0, is %f", + check_msg->cov_c_x_z); + ck_assert_msg((check_msg->cov_c_y_y * 100 - 2.0 * 100) < 0.05, + "incorrect value for cov_c_y_y, expected 2.0, is %f", + check_msg->cov_c_y_y); + ck_assert_msg((check_msg->cov_c_y_z * 100 - 0.0 * 100) < 0.05, + "incorrect value for cov_c_y_z, expected 0.0, is %f", + check_msg->cov_c_y_z); + ck_assert_msg((check_msg->cov_c_z_z * 100 - 2.0 * 100) < 0.05, + "incorrect value for cov_c_z_z, expected 2.0, is %f", + check_msg->cov_c_z_z); + ck_assert_msg((check_msg->cov_r_x_x * 100 - 1.0 * 100) < 0.05, + "incorrect value for cov_r_x_x, expected 1.0, is %f", + check_msg->cov_r_x_x); + ck_assert_msg((check_msg->cov_r_x_y * 100 - 0.0 * 100) < 0.05, + "incorrect value for cov_r_x_y, expected 0.0, is %f", + check_msg->cov_r_x_y); + ck_assert_msg((check_msg->cov_r_x_z * 100 - 0.0 * 100) < 0.05, + "incorrect value for cov_r_x_z, expected 0.0, is %f", + check_msg->cov_r_x_z); + ck_assert_msg((check_msg->cov_r_y_y * 100 - 1.0 * 100) < 0.05, + "incorrect value for cov_r_y_y, expected 1.0, is %f", + check_msg->cov_r_y_y); + ck_assert_msg((check_msg->cov_r_y_z * 100 - 0.0 * 100) < 0.05, + "incorrect value for cov_r_y_z, expected 0.0, is %f", + check_msg->cov_r_y_z); + ck_assert_msg((check_msg->cov_r_z_z * 100 - 1.0 * 100) < 0.05, + "incorrect value for cov_r_z_z, expected 1.0, is %f", + check_msg->cov_r_z_z); + ck_assert_msg(check_msg->flags == 5, + "incorrect value for flags, expected 5, is %d", + check_msg->flags); + ck_assert_msg(check_msg->sensor_id == 0, + "incorrect value for sensor_id, expected 0, is %d", + check_msg->sensor_id); + ck_assert_msg(check_msg->timestamp_1 == 1110, + "incorrect value for timestamp_1, expected 1110, is %d", + check_msg->timestamp_1); + ck_assert_msg(check_msg->timestamp_2 == 2220, + "incorrect value for timestamp_2, expected 2220, is %d", + check_msg->timestamp_2); + ck_assert_msg(check_msg->tow == 1110, + "incorrect value for tow, expected 1110, is %d", + check_msg->tow); + ck_assert_msg(check_msg->trans[0] == 1100, + "incorrect value for trans[0], expected 1100, is %d", + check_msg->trans[0]); + ck_assert_msg(check_msg->trans[1] == 550, + "incorrect value for trans[1], expected 550, is %d", + check_msg->trans[1]); + ck_assert_msg(check_msg->trans[2] == 100, + "incorrect value for trans[2], expected 100, is %d", + check_msg->trans[2]); + ck_assert_msg(check_msg->w == -859307164, + "incorrect value for w, expected -859307164, is %d", + check_msg->w); + ck_assert_msg(check_msg->x == -6444804, + "incorrect value for x, expected -6444804, is %d", + check_msg->x); + ck_assert_msg(check_msg->y == -1866844813, + "incorrect value for y, expected -1866844813, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 622997694, + "incorrect value for z, expected 622997694, is %d", + check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgPoseRelative_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgPoseRelative"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgPoseRelative"); +Suite *legacy_auto_check_sbp_navigation_MsgPoseRelative_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgPoseRelative"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgPoseRelative"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgPoseRelative); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgProtectionLevel.c b/c/test/legacy/auto_check_sbp_navigation_MsgProtectionLevel.c index c58ca500d..a436a6613 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgProtectionLevel.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgProtectionLevel.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevel.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevel.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgProtectionLevel ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgProtectionLevel) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgProtectionLevel ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,27 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgProtectionLevel ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x217, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x217, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x217, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x217, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,23,2,45,3,76,110,84,4,242,46,51,53,160,89,84,167,41,57,21,217,244,61,161,83,104,140,137,90,246,51,51,51,51,51,170,180,64,154,153,153,153,25,88,195,64,51,51,51,51,51,195,121,64,231,251,38,221,208,183,167,80,223,26,97,164,45,46,186,60,235,227,183,160,187,93,116,224,105,40,32,33,133,188, }; + u8 encoded_frame[] = { + 85, 23, 2, 45, 3, 76, 110, 84, 4, 242, 46, 51, 53, 160, + 89, 84, 167, 41, 57, 21, 217, 244, 61, 161, 83, 104, 140, 137, + 90, 246, 51, 51, 51, 51, 51, 170, 180, 64, 154, 153, 153, 153, + 25, 88, 195, 64, 51, 51, 51, 51, 51, 195, 121, 64, 231, 251, + 38, 221, 208, 183, 167, 80, 223, 26, 97, 164, 45, 46, 186, 60, + 235, 227, 183, 160, 187, 93, 116, 224, 105, 40, 32, 33, 133, 188, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_protection_level_t* test_msg = ( msg_protection_level_t* )test_msg_storage; + msg_protection_level_t *test_msg = + (msg_protection_level_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->atpl = 10663; test_msg->ctpl = 5433; @@ -164,84 +171,136 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgProtectionLevel ) test_msg->vpl = 21593; test_msg->vvpl = 41277; test_msg->wn = 13102; - sbp_payload_send(&sbp_state, 0x217, 813, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x217, 813, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 813, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 813, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x217, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_protection_level_t* check_msg = ( msg_protection_level_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_protection_level_t *check_msg = + (msg_protection_level_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->atpl == 10663, "incorrect value for atpl, expected 10663, is %d", check_msg->atpl); - ck_assert_msg(check_msg->ctpl == 5433, "incorrect value for ctpl, expected 5433, is %d", check_msg->ctpl); - ck_assert_msg(check_msg->flags == 555755625, "incorrect value for flags, expected 555755625, is %d", check_msg->flags); - ck_assert_msg(check_msg->heading == -529244741, "incorrect value for heading, expected -529244741, is %d", check_msg->heading); - ck_assert_msg((check_msg->height*100 - 412.2*100) < 0.05, "incorrect value for height, expected 412.2, is %f", check_msg->height); - ck_assert_msg(check_msg->hopl == 26707, "incorrect value for hopl, expected 26707, is %d", check_msg->hopl); - ck_assert_msg(check_msg->hpl == 41013, "incorrect value for hpl, expected 41013, is %d", check_msg->hpl); - ck_assert_msg(check_msg->hvpl == 62681, "incorrect value for hvpl, expected 62681, is %d", check_msg->hvpl); - ck_assert_msg((check_msg->lat*100 - 5290.2*100) < 0.05, "incorrect value for lat, expected 5290.2, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - 9904.2*100) < 0.05, "incorrect value for lon, expected 9904.2, is %f", check_msg->lon); - ck_assert_msg(check_msg->pitch == -1598561301, "incorrect value for pitch, expected -1598561301, is %d", check_msg->pitch); - ck_assert_msg(check_msg->popl == 35212, "incorrect value for popl, expected 35212, is %d", check_msg->popl); - ck_assert_msg(check_msg->roll == 1018834477, "incorrect value for roll, expected 1018834477, is %d", check_msg->roll); - ck_assert_msg(check_msg->ropl == 63066, "incorrect value for ropl, expected 63066, is %d", check_msg->ropl); - ck_assert_msg(check_msg->tow == 4060370030, "incorrect value for tow, expected 4060370030, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_x == -584647705, "incorrect value for v_x, expected -584647705, is %d", check_msg->v_x); - ck_assert_msg(check_msg->v_y == 1353168848, "incorrect value for v_y, expected 1353168848, is %d", check_msg->v_y); - ck_assert_msg(check_msg->v_z == -1537140001, "incorrect value for v_z, expected -1537140001, is %d", check_msg->v_z); - ck_assert_msg(check_msg->vpl == 21593, "incorrect value for vpl, expected 21593, is %d", check_msg->vpl); - ck_assert_msg(check_msg->vvpl == 41277, "incorrect value for vvpl, expected 41277, is %d", check_msg->vvpl); - ck_assert_msg(check_msg->wn == 13102, "incorrect value for wn, expected 13102, is %d", check_msg->wn); + ck_assert_msg(check_msg->atpl == 10663, + "incorrect value for atpl, expected 10663, is %d", + check_msg->atpl); + ck_assert_msg(check_msg->ctpl == 5433, + "incorrect value for ctpl, expected 5433, is %d", + check_msg->ctpl); + ck_assert_msg(check_msg->flags == 555755625, + "incorrect value for flags, expected 555755625, is %d", + check_msg->flags); + ck_assert_msg(check_msg->heading == -529244741, + "incorrect value for heading, expected -529244741, is %d", + check_msg->heading); + ck_assert_msg((check_msg->height * 100 - 412.2 * 100) < 0.05, + "incorrect value for height, expected 412.2, is %f", + check_msg->height); + ck_assert_msg(check_msg->hopl == 26707, + "incorrect value for hopl, expected 26707, is %d", + check_msg->hopl); + ck_assert_msg(check_msg->hpl == 41013, + "incorrect value for hpl, expected 41013, is %d", + check_msg->hpl); + ck_assert_msg(check_msg->hvpl == 62681, + "incorrect value for hvpl, expected 62681, is %d", + check_msg->hvpl); + ck_assert_msg((check_msg->lat * 100 - 5290.2 * 100) < 0.05, + "incorrect value for lat, expected 5290.2, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - 9904.2 * 100) < 0.05, + "incorrect value for lon, expected 9904.2, is %f", + check_msg->lon); + ck_assert_msg(check_msg->pitch == -1598561301, + "incorrect value for pitch, expected -1598561301, is %d", + check_msg->pitch); + ck_assert_msg(check_msg->popl == 35212, + "incorrect value for popl, expected 35212, is %d", + check_msg->popl); + ck_assert_msg(check_msg->roll == 1018834477, + "incorrect value for roll, expected 1018834477, is %d", + check_msg->roll); + ck_assert_msg(check_msg->ropl == 63066, + "incorrect value for ropl, expected 63066, is %d", + check_msg->ropl); + ck_assert_msg(check_msg->tow == 4060370030, + "incorrect value for tow, expected 4060370030, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_x == -584647705, + "incorrect value for v_x, expected -584647705, is %d", + check_msg->v_x); + ck_assert_msg(check_msg->v_y == 1353168848, + "incorrect value for v_y, expected 1353168848, is %d", + check_msg->v_y); + ck_assert_msg(check_msg->v_z == -1537140001, + "incorrect value for v_z, expected -1537140001, is %d", + check_msg->v_z); + ck_assert_msg(check_msg->vpl == 21593, + "incorrect value for vpl, expected 21593, is %d", + check_msg->vpl); + ck_assert_msg(check_msg->vvpl == 41277, + "incorrect value for vvpl, expected 41277, is %d", + check_msg->vvpl); + ck_assert_msg(check_msg->wn == 13102, + "incorrect value for wn, expected 13102, is %d", + check_msg->wn); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgProtectionLevel_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgProtectionLevel"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgProtectionLevel"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgProtectionLevel); +Suite *legacy_auto_check_sbp_navigation_MsgProtectionLevel_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgProtectionLevel"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgProtectionLevel"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_navigation_MsgProtectionLevel); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgProtectionLevelDepA.c b/c/test/legacy/auto_check_sbp_navigation_MsgProtectionLevelDepA.c index fb6234550..cf0acec85 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgProtectionLevelDepA.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgProtectionLevelDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevelDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevelDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,24 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x216, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x216, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x216, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x216, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,22,2,148,22,33,52,126,69,185,47,85,4,139,51,51,51,51,51,244,190,64,102,102,102,102,102,204,168,64,154,153,153,153,25,39,192,64,248,81,104, }; + u8 encoded_frame[] = { + 85, 22, 2, 148, 22, 33, 52, 126, 69, 185, 47, 85, 4, 139, + 51, 51, 51, 51, 51, 244, 190, 64, 102, 102, 102, 102, 102, 204, + 168, 64, 154, 153, 153, 153, 25, 39, 192, 64, 248, 81, 104, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_protection_level_dep_a_t* test_msg = ( msg_protection_level_dep_a_t* )test_msg_storage; + msg_protection_level_dep_a_t *test_msg = + (msg_protection_level_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 248; test_msg->height = 8270.2; @@ -150,70 +154,95 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA ) test_msg->lon = 3174.2; test_msg->tow = 3108339252; test_msg->vpl = 21807; - sbp_payload_send(&sbp_state, 0x216, 5780, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x216, 5780, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 5780, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 5780, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x216, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_protection_level_dep_a_t* check_msg = ( msg_protection_level_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_protection_level_dep_a_t *check_msg = + (msg_protection_level_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 248, "incorrect value for flags, expected 248, is %d", check_msg->flags); - ck_assert_msg((check_msg->height*100 - 8270.2*100) < 0.05, "incorrect value for height, expected 8270.2, is %f", check_msg->height); - ck_assert_msg(check_msg->hpl == 35588, "incorrect value for hpl, expected 35588, is %d", check_msg->hpl); - ck_assert_msg((check_msg->lat*100 - 7924.2*100) < 0.05, "incorrect value for lat, expected 7924.2, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - 3174.2*100) < 0.05, "incorrect value for lon, expected 3174.2, is %f", check_msg->lon); - ck_assert_msg(check_msg->tow == 3108339252, "incorrect value for tow, expected 3108339252, is %d", check_msg->tow); - ck_assert_msg(check_msg->vpl == 21807, "incorrect value for vpl, expected 21807, is %d", check_msg->vpl); + ck_assert_msg(check_msg->flags == 248, + "incorrect value for flags, expected 248, is %d", + check_msg->flags); + ck_assert_msg((check_msg->height * 100 - 8270.2 * 100) < 0.05, + "incorrect value for height, expected 8270.2, is %f", + check_msg->height); + ck_assert_msg(check_msg->hpl == 35588, + "incorrect value for hpl, expected 35588, is %d", + check_msg->hpl); + ck_assert_msg((check_msg->lat * 100 - 7924.2 * 100) < 0.05, + "incorrect value for lat, expected 7924.2, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - 3174.2 * 100) < 0.05, + "incorrect value for lon, expected 3174.2, is %f", + check_msg->lon); + ck_assert_msg(check_msg->tow == 3108339252, + "incorrect value for tow, expected 3108339252, is %d", + check_msg->tow); + ck_assert_msg(check_msg->vpl == 21807, + "incorrect value for vpl, expected 21807, is %d", + check_msg->vpl); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA); +Suite *legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_" + "MsgProtectionLevelDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgReferenceFrameParam.c b/c/test/legacy/auto_check_sbp_navigation_MsgReferenceFrameParam.c index ba779acf2..3463d76ce 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgReferenceFrameParam.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgReferenceFrameParam.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgReferenceFrameParam.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgReferenceFrameParam.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,29 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 580, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 580, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 580, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 580, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,68,2,66,0,124,1,102,111,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,98,97,114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,0,6,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,6,161, }; + u8 encoded_frame[] = { + 85, 68, 2, 66, 0, 124, 1, 102, 111, 111, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 98, 97, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 4, 5, 0, 6, 0, 7, 0, 0, 0, 8, 0, 0, 0, 9, + 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 12, 0, 0, 0, 13, 0, + 0, 0, 14, 0, 0, 0, 15, 0, 0, 0, 16, 0, 0, 0, 17, 0, 0, + 0, 18, 0, 0, 0, 19, 0, 0, 0, 20, 0, 6, 161, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_reference_frame_param_t* test_msg = ( msg_reference_frame_param_t* )test_msg_storage; + msg_reference_frame_param_t *test_msg = + (msg_reference_frame_param_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->delta_X0 = 7; test_msg->delta_Y0 = 8; @@ -157,7 +166,12 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam ) test_msg->scale = 13; test_msg->sin = 4; { - const char assign_string[] = { (char)102,(char)111,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)102, (char)111, (char)111, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg->sn, assign_string, sizeof(assign_string)); if (sizeof(test_msg->sn) == 0) { test_msg_len += sizeof(assign_string); @@ -168,96 +182,162 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam ) test_msg->theta_02 = 11; test_msg->theta_03 = 12; { - const char assign_string[] = { (char)98,(char)97,(char)114,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)98, (char)97, (char)114, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg->tn, assign_string, sizeof(assign_string)); if (sizeof(test_msg->tn) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->utn = 5; - sbp_payload_send(&sbp_state, 580, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 580, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 580, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_reference_frame_param_t* check_msg = ( msg_reference_frame_param_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_reference_frame_param_t *check_msg = + (msg_reference_frame_param_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->delta_X0 == 7, "incorrect value for delta_X0, expected 7, is %d", check_msg->delta_X0); - ck_assert_msg(check_msg->delta_Y0 == 8, "incorrect value for delta_Y0, expected 8, is %d", check_msg->delta_Y0); - ck_assert_msg(check_msg->delta_Z0 == 9, "incorrect value for delta_Z0, expected 9, is %d", check_msg->delta_Z0); - ck_assert_msg(check_msg->dot_delta_X0 == 14, "incorrect value for dot_delta_X0, expected 14, is %d", check_msg->dot_delta_X0); - ck_assert_msg(check_msg->dot_delta_Y0 == 15, "incorrect value for dot_delta_Y0, expected 15, is %d", check_msg->dot_delta_Y0); - ck_assert_msg(check_msg->dot_delta_Z0 == 16, "incorrect value for dot_delta_Z0, expected 16, is %d", check_msg->dot_delta_Z0); - ck_assert_msg(check_msg->dot_scale == 20, "incorrect value for dot_scale, expected 20, is %d", check_msg->dot_scale); - ck_assert_msg(check_msg->dot_theta_01 == 17, "incorrect value for dot_theta_01, expected 17, is %d", check_msg->dot_theta_01); - ck_assert_msg(check_msg->dot_theta_02 == 18, "incorrect value for dot_theta_02, expected 18, is %d", check_msg->dot_theta_02); - ck_assert_msg(check_msg->dot_theta_03 == 19, "incorrect value for dot_theta_03, expected 19, is %d", check_msg->dot_theta_03); - ck_assert_msg(check_msg->re_t0 == 6, "incorrect value for re_t0, expected 6, is %d", check_msg->re_t0); - ck_assert_msg(check_msg->scale == 13, "incorrect value for scale, expected 13, is %d", check_msg->scale); - ck_assert_msg(check_msg->sin == 4, "incorrect value for sin, expected 4, is %d", check_msg->sin); + ck_assert_msg(check_msg->delta_X0 == 7, + "incorrect value for delta_X0, expected 7, is %d", + check_msg->delta_X0); + ck_assert_msg(check_msg->delta_Y0 == 8, + "incorrect value for delta_Y0, expected 8, is %d", + check_msg->delta_Y0); + ck_assert_msg(check_msg->delta_Z0 == 9, + "incorrect value for delta_Z0, expected 9, is %d", + check_msg->delta_Z0); + ck_assert_msg(check_msg->dot_delta_X0 == 14, + "incorrect value for dot_delta_X0, expected 14, is %d", + check_msg->dot_delta_X0); + ck_assert_msg(check_msg->dot_delta_Y0 == 15, + "incorrect value for dot_delta_Y0, expected 15, is %d", + check_msg->dot_delta_Y0); + ck_assert_msg(check_msg->dot_delta_Z0 == 16, + "incorrect value for dot_delta_Z0, expected 16, is %d", + check_msg->dot_delta_Z0); + ck_assert_msg(check_msg->dot_scale == 20, + "incorrect value for dot_scale, expected 20, is %d", + check_msg->dot_scale); + ck_assert_msg(check_msg->dot_theta_01 == 17, + "incorrect value for dot_theta_01, expected 17, is %d", + check_msg->dot_theta_01); + ck_assert_msg(check_msg->dot_theta_02 == 18, + "incorrect value for dot_theta_02, expected 18, is %d", + check_msg->dot_theta_02); + ck_assert_msg(check_msg->dot_theta_03 == 19, + "incorrect value for dot_theta_03, expected 19, is %d", + check_msg->dot_theta_03); + ck_assert_msg(check_msg->re_t0 == 6, + "incorrect value for re_t0, expected 6, is %d", + check_msg->re_t0); + ck_assert_msg(check_msg->scale == 13, + "incorrect value for scale, expected 13, is %d", + check_msg->scale); + ck_assert_msg(check_msg->sin == 4, + "incorrect value for sin, expected 4, is %d", check_msg->sin); { - const char check_string[] = { (char)102,(char)111,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->sn, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->sn, expected string '%s', is '%s'", check_string, check_msg->sn); + const char check_string[] = { + (char)102, (char)111, (char)111, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->sn, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->sn, expected string '%s', is '%s'", + check_string, check_msg->sn); } - ck_assert_msg(check_msg->ssr_iod == 1, "incorrect value for ssr_iod, expected 1, is %d", check_msg->ssr_iod); - ck_assert_msg(check_msg->theta_01 == 10, "incorrect value for theta_01, expected 10, is %d", check_msg->theta_01); - ck_assert_msg(check_msg->theta_02 == 11, "incorrect value for theta_02, expected 11, is %d", check_msg->theta_02); - ck_assert_msg(check_msg->theta_03 == 12, "incorrect value for theta_03, expected 12, is %d", check_msg->theta_03); + ck_assert_msg(check_msg->ssr_iod == 1, + "incorrect value for ssr_iod, expected 1, is %d", + check_msg->ssr_iod); + ck_assert_msg(check_msg->theta_01 == 10, + "incorrect value for theta_01, expected 10, is %d", + check_msg->theta_01); + ck_assert_msg(check_msg->theta_02 == 11, + "incorrect value for theta_02, expected 11, is %d", + check_msg->theta_02); + ck_assert_msg(check_msg->theta_03 == 12, + "incorrect value for theta_03, expected 12, is %d", + check_msg->theta_03); { - const char check_string[] = { (char)98,(char)97,(char)114,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->tn, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->tn, expected string '%s', is '%s'", check_string, check_msg->tn); + const char check_string[] = { + (char)98, (char)97, (char)114, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->tn, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->tn, expected string '%s', is '%s'", + check_string, check_msg->tn); } - ck_assert_msg(check_msg->utn == 5, "incorrect value for utn, expected 5, is %d", check_msg->utn); + ck_assert_msg(check_msg->utn == 5, + "incorrect value for utn, expected 5, is %d", check_msg->utn); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgReferenceFrameParam_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgReferenceFrameParam"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam); +Suite *legacy_auto_check_sbp_navigation_MsgReferenceFrameParam_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgReferenceFrameParam"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_" + "MsgReferenceFrameParam"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgUTCLeapSecond.c b/c/test/legacy/auto_check_sbp_navigation_MsgUTCLeapSecond.c index 8132abfd7..ab567c0a0 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgUTCLeapSecond.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgUTCLeapSecond.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCLeapSecond.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCLeapSecond.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,21 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 570, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 570, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 570, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 570, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,58,2,66,0,14,1,0,2,0,3,4,5,0,6,0,7,0,8,9,50,232, }; + u8 encoded_frame[] = { + 85, 58, 2, 66, 0, 14, 1, 0, 2, 0, 3, 4, 5, 0, 6, 0, 7, 0, 8, 9, 50, 232, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_utc_leap_second_t* test_msg = ( msg_utc_leap_second_t* )test_msg_storage; + msg_utc_leap_second_t *test_msg = (msg_utc_leap_second_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->count_after = 9; test_msg->count_before = 4; @@ -152,72 +153,100 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond ) test_msg->reserved_2 = 3; test_msg->reserved_3 = 5; test_msg->reserved_4 = 6; - sbp_payload_send(&sbp_state, 570, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 570, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 570, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_utc_leap_second_t* check_msg = ( msg_utc_leap_second_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_utc_leap_second_t *check_msg = + (msg_utc_leap_second_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->count_after == 9, "incorrect value for count_after, expected 9, is %d", check_msg->count_after); - ck_assert_msg(check_msg->count_before == 4, "incorrect value for count_before, expected 4, is %d", check_msg->count_before); - ck_assert_msg(check_msg->ref_dn == 8, "incorrect value for ref_dn, expected 8, is %d", check_msg->ref_dn); - ck_assert_msg(check_msg->ref_wn == 7, "incorrect value for ref_wn, expected 7, is %d", check_msg->ref_wn); - ck_assert_msg(check_msg->reserved_0 == 1, "incorrect value for reserved_0, expected 1, is %d", check_msg->reserved_0); - ck_assert_msg(check_msg->reserved_1 == 2, "incorrect value for reserved_1, expected 2, is %d", check_msg->reserved_1); - ck_assert_msg(check_msg->reserved_2 == 3, "incorrect value for reserved_2, expected 3, is %d", check_msg->reserved_2); - ck_assert_msg(check_msg->reserved_3 == 5, "incorrect value for reserved_3, expected 5, is %d", check_msg->reserved_3); - ck_assert_msg(check_msg->reserved_4 == 6, "incorrect value for reserved_4, expected 6, is %d", check_msg->reserved_4); + ck_assert_msg(check_msg->count_after == 9, + "incorrect value for count_after, expected 9, is %d", + check_msg->count_after); + ck_assert_msg(check_msg->count_before == 4, + "incorrect value for count_before, expected 4, is %d", + check_msg->count_before); + ck_assert_msg(check_msg->ref_dn == 8, + "incorrect value for ref_dn, expected 8, is %d", + check_msg->ref_dn); + ck_assert_msg(check_msg->ref_wn == 7, + "incorrect value for ref_wn, expected 7, is %d", + check_msg->ref_wn); + ck_assert_msg(check_msg->reserved_0 == 1, + "incorrect value for reserved_0, expected 1, is %d", + check_msg->reserved_0); + ck_assert_msg(check_msg->reserved_1 == 2, + "incorrect value for reserved_1, expected 2, is %d", + check_msg->reserved_1); + ck_assert_msg(check_msg->reserved_2 == 3, + "incorrect value for reserved_2, expected 3, is %d", + check_msg->reserved_2); + ck_assert_msg(check_msg->reserved_3 == 5, + "incorrect value for reserved_3, expected 5, is %d", + check_msg->reserved_3); + ck_assert_msg(check_msg->reserved_4 == 6, + "incorrect value for reserved_4, expected 6, is %d", + check_msg->reserved_4); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgUTCLeapSecond_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgUTCLeapSecond"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond); +Suite *legacy_auto_check_sbp_navigation_MsgUTCLeapSecond_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgUTCLeapSecond"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgUTCTime.c b/c/test/legacy/auto_check_sbp_navigation_MsgUTCTime.c index f4f1f3b58..7da4eb32d 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgUTCTime.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgUTCTime.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTime.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgUTCTime ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgUTCTime) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgUTCTime ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgUTCTime ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x103, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x103, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x103, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x103, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,1,21,3,16,1,24,229,233,29,229,7,4,9,19,24,9,0,8,175,47,199,253, }; + u8 encoded_frame[] = { + 85, 3, 1, 21, 3, 16, 1, 24, 229, 233, 29, 229, + 7, 4, 9, 19, 24, 9, 0, 8, 175, 47, 199, 253, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_utc_time_t* test_msg = ( msg_utc_time_t* )test_msg_storage; + msg_utc_time_t *test_msg = (msg_utc_time_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->day = 9; test_msg->flags = 1; @@ -152,71 +154,95 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgUTCTime ) test_msg->seconds = 9; test_msg->tow = 501867800; test_msg->year = 2021; - sbp_payload_send(&sbp_state, 0x103, 789, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x103, 789, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 789, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 789, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x103, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_utc_time_t* check_msg = ( msg_utc_time_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_utc_time_t *check_msg = (msg_utc_time_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->day == 9, "incorrect value for day, expected 9, is %d", check_msg->day); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->hours == 19, "incorrect value for hours, expected 19, is %d", check_msg->hours); - ck_assert_msg(check_msg->minutes == 24, "incorrect value for minutes, expected 24, is %d", check_msg->minutes); - ck_assert_msg(check_msg->month == 4, "incorrect value for month, expected 4, is %d", check_msg->month); - ck_assert_msg(check_msg->ns == 800000000, "incorrect value for ns, expected 800000000, is %d", check_msg->ns); - ck_assert_msg(check_msg->seconds == 9, "incorrect value for seconds, expected 9, is %d", check_msg->seconds); - ck_assert_msg(check_msg->tow == 501867800, "incorrect value for tow, expected 501867800, is %d", check_msg->tow); - ck_assert_msg(check_msg->year == 2021, "incorrect value for year, expected 2021, is %d", check_msg->year); + ck_assert_msg(check_msg->day == 9, + "incorrect value for day, expected 9, is %d", check_msg->day); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->hours == 19, + "incorrect value for hours, expected 19, is %d", + check_msg->hours); + ck_assert_msg(check_msg->minutes == 24, + "incorrect value for minutes, expected 24, is %d", + check_msg->minutes); + ck_assert_msg(check_msg->month == 4, + "incorrect value for month, expected 4, is %d", + check_msg->month); + ck_assert_msg(check_msg->ns == 800000000, + "incorrect value for ns, expected 800000000, is %d", + check_msg->ns); + ck_assert_msg(check_msg->seconds == 9, + "incorrect value for seconds, expected 9, is %d", + check_msg->seconds); + ck_assert_msg(check_msg->tow == 501867800, + "incorrect value for tow, expected 501867800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->year == 2021, + "incorrect value for year, expected 2021, is %d", + check_msg->year); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgUTCTime_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgUTCTime"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgUTCTime"); +Suite *legacy_auto_check_sbp_navigation_MsgUTCTime_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_navigation_MsgUTCTime"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgUTCTime"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgUTCTime); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgUTCTimeGNSS.c b/c/test/legacy/auto_check_sbp_navigation_MsgUTCTimeGNSS.c index 821e59b31..cb614b0e5 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgUTCTimeGNSS.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgUTCTimeGNSS.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTimeGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTimeGNSS.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x105, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x105, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x105, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x105, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,1,21,3,16,1,24,229,233,29,229,7,4,9,19,24,9,0,8,175,47,177,33, }; + u8 encoded_frame[] = { + 85, 5, 1, 21, 3, 16, 1, 24, 229, 233, 29, 229, + 7, 4, 9, 19, 24, 9, 0, 8, 175, 47, 177, 33, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_utc_time_gnss_t* test_msg = ( msg_utc_time_gnss_t* )test_msg_storage; + msg_utc_time_gnss_t *test_msg = (msg_utc_time_gnss_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->day = 9; test_msg->flags = 1; @@ -152,71 +154,97 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS ) test_msg->seconds = 9; test_msg->tow = 501867800; test_msg->year = 2021; - sbp_payload_send(&sbp_state, 0x105, 789, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x105, 789, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 789, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 789, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x105, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_utc_time_gnss_t* check_msg = ( msg_utc_time_gnss_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_utc_time_gnss_t *check_msg = + (msg_utc_time_gnss_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->day == 9, "incorrect value for day, expected 9, is %d", check_msg->day); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->hours == 19, "incorrect value for hours, expected 19, is %d", check_msg->hours); - ck_assert_msg(check_msg->minutes == 24, "incorrect value for minutes, expected 24, is %d", check_msg->minutes); - ck_assert_msg(check_msg->month == 4, "incorrect value for month, expected 4, is %d", check_msg->month); - ck_assert_msg(check_msg->ns == 800000000, "incorrect value for ns, expected 800000000, is %d", check_msg->ns); - ck_assert_msg(check_msg->seconds == 9, "incorrect value for seconds, expected 9, is %d", check_msg->seconds); - ck_assert_msg(check_msg->tow == 501867800, "incorrect value for tow, expected 501867800, is %d", check_msg->tow); - ck_assert_msg(check_msg->year == 2021, "incorrect value for year, expected 2021, is %d", check_msg->year); + ck_assert_msg(check_msg->day == 9, + "incorrect value for day, expected 9, is %d", check_msg->day); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->hours == 19, + "incorrect value for hours, expected 19, is %d", + check_msg->hours); + ck_assert_msg(check_msg->minutes == 24, + "incorrect value for minutes, expected 24, is %d", + check_msg->minutes); + ck_assert_msg(check_msg->month == 4, + "incorrect value for month, expected 4, is %d", + check_msg->month); + ck_assert_msg(check_msg->ns == 800000000, + "incorrect value for ns, expected 800000000, is %d", + check_msg->ns); + ck_assert_msg(check_msg->seconds == 9, + "incorrect value for seconds, expected 9, is %d", + check_msg->seconds); + ck_assert_msg(check_msg->tow == 501867800, + "incorrect value for tow, expected 501867800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->year == 2021, + "incorrect value for year, expected 2021, is %d", + check_msg->year); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS"); +Suite *legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgVelBody.c b/c/test/legacy/auto_check_sbp_navigation_MsgVelBody.c index 2ab83eb4b..034ff6a5c 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgVelBody.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgVelBody.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelBody.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelBody.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelBody ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgVelBody) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelBody ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelBody ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x213, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x213, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x213, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x213, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,19,2,66,0,42,1,0,0,0,4,0,0,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,160,64,0,0,224,64,0,0,224,64,0,0,64,64,0,0,0,64,3,8,120,144, }; + u8 encoded_frame[] = { + 85, 19, 2, 66, 0, 42, 1, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 224, 64, + 0, 0, 224, 64, 0, 0, 64, 64, 0, 0, 0, 64, 3, 8, 120, 144, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_body_t* test_msg = ( msg_vel_body_t* )test_msg_storage; + msg_vel_body_t *test_msg = (msg_vel_body_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cov_x_x = 0.0; test_msg->cov_x_y = 5.0; @@ -155,74 +158,101 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelBody ) test_msg->x = 4; test_msg->y = 2; test_msg->z = 1; - sbp_payload_send(&sbp_state, 0x213, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x213, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x213, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_body_t* check_msg = ( msg_vel_body_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_body_t *check_msg = (msg_vel_body_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cov_x_x*100 - 0.0*100) < 0.05, "incorrect value for cov_x_x, expected 0.0, is %f", check_msg->cov_x_x); - ck_assert_msg((check_msg->cov_x_y*100 - 5.0*100) < 0.05, "incorrect value for cov_x_y, expected 5.0, is %f", check_msg->cov_x_y); - ck_assert_msg((check_msg->cov_x_z*100 - 7.0*100) < 0.05, "incorrect value for cov_x_z, expected 7.0, is %f", check_msg->cov_x_z); - ck_assert_msg((check_msg->cov_y_y*100 - 7.0*100) < 0.05, "incorrect value for cov_y_y, expected 7.0, is %f", check_msg->cov_y_y); - ck_assert_msg((check_msg->cov_y_z*100 - 3.0*100) < 0.05, "incorrect value for cov_y_z, expected 3.0, is %f", check_msg->cov_y_z); - ck_assert_msg((check_msg->cov_z_z*100 - 2.0*100) < 0.05, "incorrect value for cov_z_z, expected 2.0, is %f", check_msg->cov_z_z); - ck_assert_msg(check_msg->flags == 8, "incorrect value for flags, expected 8, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 3, "incorrect value for n_sats, expected 3, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 1, "incorrect value for tow, expected 1, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == 4, "incorrect value for x, expected 4, is %d", check_msg->x); - ck_assert_msg(check_msg->y == 2, "incorrect value for y, expected 2, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 1, "incorrect value for z, expected 1, is %d", check_msg->z); + ck_assert_msg((check_msg->cov_x_x * 100 - 0.0 * 100) < 0.05, + "incorrect value for cov_x_x, expected 0.0, is %f", + check_msg->cov_x_x); + ck_assert_msg((check_msg->cov_x_y * 100 - 5.0 * 100) < 0.05, + "incorrect value for cov_x_y, expected 5.0, is %f", + check_msg->cov_x_y); + ck_assert_msg((check_msg->cov_x_z * 100 - 7.0 * 100) < 0.05, + "incorrect value for cov_x_z, expected 7.0, is %f", + check_msg->cov_x_z); + ck_assert_msg((check_msg->cov_y_y * 100 - 7.0 * 100) < 0.05, + "incorrect value for cov_y_y, expected 7.0, is %f", + check_msg->cov_y_y); + ck_assert_msg((check_msg->cov_y_z * 100 - 3.0 * 100) < 0.05, + "incorrect value for cov_y_z, expected 3.0, is %f", + check_msg->cov_y_z); + ck_assert_msg((check_msg->cov_z_z * 100 - 2.0 * 100) < 0.05, + "incorrect value for cov_z_z, expected 2.0, is %f", + check_msg->cov_z_z); + ck_assert_msg(check_msg->flags == 8, + "incorrect value for flags, expected 8, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 3, + "incorrect value for n_sats, expected 3, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 1, + "incorrect value for tow, expected 1, is %d", check_msg->tow); + ck_assert_msg(check_msg->x == 4, "incorrect value for x, expected 4, is %d", + check_msg->x); + ck_assert_msg(check_msg->y == 2, "incorrect value for y, expected 2, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 1, "incorrect value for z, expected 1, is %d", + check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgVelBody_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelBody"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelBody"); +Suite *legacy_auto_check_sbp_navigation_MsgVelBody_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelBody"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelBody"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgVelBody); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgVelCog.c b/c/test/legacy/auto_check_sbp_navigation_MsgVelCog.c index b939e3e4d..bbcc4ccdf 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgVelCog.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgVelCog.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelCog.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelCog.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelCog ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgVelCog) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelCog ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelCog ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x21C, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x21C, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x21C, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x21C, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,28,2,211,136,30,48,246,122,19,232,3,0,0,208,7,0,0,184,11,0,0,160,15,0,0,136,19,0,0,112,23,0,0,62,0,212,193, }; + u8 encoded_frame[] = { + 85, 28, 2, 211, 136, 30, 48, 246, 122, 19, 232, 3, 0, + 0, 208, 7, 0, 0, 184, 11, 0, 0, 160, 15, 0, 0, + 136, 19, 0, 0, 112, 23, 0, 0, 62, 0, 212, 193, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_cog_t* test_msg = ( msg_vel_cog_t* )test_msg_storage; + msg_vel_cog_t* test_msg = (msg_vel_cog_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cog = 1000; test_msg->cog_accuracy = 4000; @@ -151,67 +154,90 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelCog ) test_msg->tow = 326825520; test_msg->v_up = 3000; test_msg->v_up_accuracy = 6000; - sbp_payload_send(&sbp_state, 0x21C, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x21C, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x21C, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_cog_t* check_msg = ( msg_vel_cog_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_cog_t* check_msg = (msg_vel_cog_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cog == 1000, "incorrect value for cog, expected 1000, is %d", check_msg->cog); - ck_assert_msg(check_msg->cog_accuracy == 4000, "incorrect value for cog_accuracy, expected 4000, is %d", check_msg->cog_accuracy); - ck_assert_msg(check_msg->flags == 62, "incorrect value for flags, expected 62, is %d", check_msg->flags); - ck_assert_msg(check_msg->sog == 2000, "incorrect value for sog, expected 2000, is %d", check_msg->sog); - ck_assert_msg(check_msg->sog_accuracy == 5000, "incorrect value for sog_accuracy, expected 5000, is %d", check_msg->sog_accuracy); - ck_assert_msg(check_msg->tow == 326825520, "incorrect value for tow, expected 326825520, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_up == 3000, "incorrect value for v_up, expected 3000, is %d", check_msg->v_up); - ck_assert_msg(check_msg->v_up_accuracy == 6000, "incorrect value for v_up_accuracy, expected 6000, is %d", check_msg->v_up_accuracy); + ck_assert_msg(check_msg->cog == 1000, + "incorrect value for cog, expected 1000, is %d", + check_msg->cog); + ck_assert_msg(check_msg->cog_accuracy == 4000, + "incorrect value for cog_accuracy, expected 4000, is %d", + check_msg->cog_accuracy); + ck_assert_msg(check_msg->flags == 62, + "incorrect value for flags, expected 62, is %d", + check_msg->flags); + ck_assert_msg(check_msg->sog == 2000, + "incorrect value for sog, expected 2000, is %d", + check_msg->sog); + ck_assert_msg(check_msg->sog_accuracy == 5000, + "incorrect value for sog_accuracy, expected 5000, is %d", + check_msg->sog_accuracy); + ck_assert_msg(check_msg->tow == 326825520, + "incorrect value for tow, expected 326825520, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_up == 3000, + "incorrect value for v_up, expected 3000, is %d", + check_msg->v_up); + ck_assert_msg(check_msg->v_up_accuracy == 6000, + "incorrect value for v_up_accuracy, expected 6000, is %d", + check_msg->v_up_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -219,17 +245,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelCog ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x21C, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x21C, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x21C, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x21C, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,28,2,211,136,30,48,246,122,19,123,0,0,0,200,1,0,0,24,252,255,255,0,149,186,10,100,0,0,0,100,0,0,0,0,0,90,114, }; + u8 encoded_frame[] = { + 85, 28, 2, 211, 136, 30, 48, 246, 122, 19, 123, 0, 0, + 0, 200, 1, 0, 0, 24, 252, 255, 255, 0, 149, 186, 10, + 100, 0, 0, 0, 100, 0, 0, 0, 0, 0, 90, 114, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_cog_t* test_msg = ( msg_vel_cog_t* )test_msg_storage; + msg_vel_cog_t* test_msg = (msg_vel_cog_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cog = 123; test_msg->cog_accuracy = 180000000; @@ -239,67 +271,90 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelCog ) test_msg->tow = 326825520; test_msg->v_up = -1000; test_msg->v_up_accuracy = 100; - sbp_payload_send(&sbp_state, 0x21C, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x21C, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x21C, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_cog_t* check_msg = ( msg_vel_cog_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_cog_t* check_msg = (msg_vel_cog_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cog == 123, "incorrect value for cog, expected 123, is %d", check_msg->cog); - ck_assert_msg(check_msg->cog_accuracy == 180000000, "incorrect value for cog_accuracy, expected 180000000, is %d", check_msg->cog_accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->sog == 456, "incorrect value for sog, expected 456, is %d", check_msg->sog); - ck_assert_msg(check_msg->sog_accuracy == 100, "incorrect value for sog_accuracy, expected 100, is %d", check_msg->sog_accuracy); - ck_assert_msg(check_msg->tow == 326825520, "incorrect value for tow, expected 326825520, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_up == -1000, "incorrect value for v_up, expected -1000, is %d", check_msg->v_up); - ck_assert_msg(check_msg->v_up_accuracy == 100, "incorrect value for v_up_accuracy, expected 100, is %d", check_msg->v_up_accuracy); + ck_assert_msg(check_msg->cog == 123, + "incorrect value for cog, expected 123, is %d", + check_msg->cog); + ck_assert_msg(check_msg->cog_accuracy == 180000000, + "incorrect value for cog_accuracy, expected 180000000, is %d", + check_msg->cog_accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->sog == 456, + "incorrect value for sog, expected 456, is %d", + check_msg->sog); + ck_assert_msg(check_msg->sog_accuracy == 100, + "incorrect value for sog_accuracy, expected 100, is %d", + check_msg->sog_accuracy); + ck_assert_msg(check_msg->tow == 326825520, + "incorrect value for tow, expected 326825520, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_up == -1000, + "incorrect value for v_up, expected -1000, is %d", + check_msg->v_up); + ck_assert_msg(check_msg->v_up_accuracy == 100, + "incorrect value for v_up_accuracy, expected 100, is %d", + check_msg->v_up_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -307,17 +362,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelCog ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x21C, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x21C, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x21C, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x21C, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,28,2,211,136,30,48,246,122,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,210, }; + u8 encoded_frame[] = { + 85, 28, 2, 211, 136, 30, 48, 246, 122, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 210, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_cog_t* test_msg = ( msg_vel_cog_t* )test_msg_storage; + msg_vel_cog_t* test_msg = (msg_vel_cog_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cog = 0; test_msg->cog_accuracy = 0; @@ -327,70 +387,91 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelCog ) test_msg->tow = 326825520; test_msg->v_up = 0; test_msg->v_up_accuracy = 0; - sbp_payload_send(&sbp_state, 0x21C, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x21C, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x21C, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_cog_t* check_msg = ( msg_vel_cog_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_cog_t* check_msg = (msg_vel_cog_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cog == 0, "incorrect value for cog, expected 0, is %d", check_msg->cog); - ck_assert_msg(check_msg->cog_accuracy == 0, "incorrect value for cog_accuracy, expected 0, is %d", check_msg->cog_accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->sog == 0, "incorrect value for sog, expected 0, is %d", check_msg->sog); - ck_assert_msg(check_msg->sog_accuracy == 0, "incorrect value for sog_accuracy, expected 0, is %d", check_msg->sog_accuracy); - ck_assert_msg(check_msg->tow == 326825520, "incorrect value for tow, expected 326825520, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_up == 0, "incorrect value for v_up, expected 0, is %d", check_msg->v_up); - ck_assert_msg(check_msg->v_up_accuracy == 0, "incorrect value for v_up_accuracy, expected 0, is %d", check_msg->v_up_accuracy); + ck_assert_msg(check_msg->cog == 0, + "incorrect value for cog, expected 0, is %d", check_msg->cog); + ck_assert_msg(check_msg->cog_accuracy == 0, + "incorrect value for cog_accuracy, expected 0, is %d", + check_msg->cog_accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->sog == 0, + "incorrect value for sog, expected 0, is %d", check_msg->sog); + ck_assert_msg(check_msg->sog_accuracy == 0, + "incorrect value for sog_accuracy, expected 0, is %d", + check_msg->sog_accuracy); + ck_assert_msg(check_msg->tow == 326825520, + "incorrect value for tow, expected 326825520, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_up == 0, + "incorrect value for v_up, expected 0, is %d", + check_msg->v_up); + ck_assert_msg(check_msg->v_up_accuracy == 0, + "incorrect value for v_up_accuracy, expected 0, is %d", + check_msg->v_up_accuracy); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgVelCog_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelCog"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelCog"); +Suite* legacy_auto_check_sbp_navigation_MsgVelCog_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelCog"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelCog"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgVelCog); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgVelECEF.c b/c/test/legacy/auto_check_sbp_navigation_MsgVelECEF.c index 23e8dd69f..5c6e532d9 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgVelECEF.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgVelECEF.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEF.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEF ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgVelECEF) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEF ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEF ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20d, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20d, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,13,2,211,136,20,40,244,122,19,248,255,255,255,251,255,255,255,10,0,0,0,0,0,14,0,181,99, }; + u8 encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 40, 244, 122, 19, 248, 255, 255, 255, + 251, 255, 255, 255, 10, 0, 0, 0, 0, 0, 14, 0, 181, 99, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_t* test_msg = ( msg_vel_ecef_t* )test_msg_storage; + msg_vel_ecef_t* test_msg = (msg_vel_ecef_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -150,66 +152,84 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEF ) test_msg->x = -8; test_msg->y = -5; test_msg->z = 10; - sbp_payload_send(&sbp_state, 0x20d, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20d, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20d, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_t* check_msg = ( msg_vel_ecef_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_t* check_msg = (msg_vel_ecef_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 14, "incorrect value for n_sats, expected 14, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326825000, "incorrect value for tow, expected 326825000, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -8, "incorrect value for x, expected -8, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -5, "incorrect value for y, expected -5, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 10, "incorrect value for z, expected 10, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 14, + "incorrect value for n_sats, expected 14, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326825000, + "incorrect value for tow, expected 326825000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -8, + "incorrect value for x, expected -8, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -5, + "incorrect value for y, expected -5, is %d", check_msg->y); + ck_assert_msg(check_msg->z == 10, + "incorrect value for z, expected 10, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -217,17 +237,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEF ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20d, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20d, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,13,2,211,136,20,28,246,122,19,244,255,255,255,238,255,255,255,11,0,0,0,0,0,15,0,215,120, }; + u8 encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 28, 246, 122, 19, 244, 255, 255, 255, + 238, 255, 255, 255, 11, 0, 0, 0, 0, 0, 15, 0, 215, 120, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_t* test_msg = ( msg_vel_ecef_t* )test_msg_storage; + msg_vel_ecef_t* test_msg = (msg_vel_ecef_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -236,66 +261,84 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEF ) test_msg->x = -12; test_msg->y = -18; test_msg->z = 11; - sbp_payload_send(&sbp_state, 0x20d, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20d, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20d, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_t* check_msg = ( msg_vel_ecef_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_t* check_msg = (msg_vel_ecef_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326825500, "incorrect value for tow, expected 326825500, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -12, "incorrect value for x, expected -12, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -18, "incorrect value for y, expected -18, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 11, "incorrect value for z, expected 11, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326825500, + "incorrect value for tow, expected 326825500, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -12, + "incorrect value for x, expected -12, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -18, + "incorrect value for y, expected -18, is %d", check_msg->y); + ck_assert_msg(check_msg->z == 11, + "incorrect value for z, expected 11, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -303,17 +346,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEF ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20d, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20d, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,13,2,211,136,20,16,248,122,19,248,255,255,255,250,255,255,255,7,0,0,0,0,0,15,0,248,221, }; + u8 encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 16, 248, 122, 19, 248, 255, 255, 255, + 250, 255, 255, 255, 7, 0, 0, 0, 0, 0, 15, 0, 248, 221, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_t* test_msg = ( msg_vel_ecef_t* )test_msg_storage; + msg_vel_ecef_t* test_msg = (msg_vel_ecef_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -322,66 +370,84 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEF ) test_msg->x = -8; test_msg->y = -6; test_msg->z = 7; - sbp_payload_send(&sbp_state, 0x20d, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20d, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20d, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_t* check_msg = ( msg_vel_ecef_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_t* check_msg = (msg_vel_ecef_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326826000, "incorrect value for tow, expected 326826000, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -8, "incorrect value for x, expected -8, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -6, "incorrect value for y, expected -6, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 7, "incorrect value for z, expected 7, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326826000, + "incorrect value for tow, expected 326826000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -8, + "incorrect value for x, expected -8, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -6, + "incorrect value for y, expected -6, is %d", check_msg->y); + ck_assert_msg(check_msg->z == 7, "incorrect value for z, expected 7, is %d", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -389,17 +455,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEF ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20d, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20d, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,13,2,211,136,20,4,250,122,19,249,255,255,255,239,255,255,255,16,0,0,0,0,0,15,0,1,167, }; + u8 encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 4, 250, 122, 19, 249, 255, 255, 255, + 239, 255, 255, 255, 16, 0, 0, 0, 0, 0, 15, 0, 1, 167, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_t* test_msg = ( msg_vel_ecef_t* )test_msg_storage; + msg_vel_ecef_t* test_msg = (msg_vel_ecef_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -408,66 +479,84 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEF ) test_msg->x = -7; test_msg->y = -17; test_msg->z = 16; - sbp_payload_send(&sbp_state, 0x20d, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20d, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20d, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_t* check_msg = ( msg_vel_ecef_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_t* check_msg = (msg_vel_ecef_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326826500, "incorrect value for tow, expected 326826500, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -7, "incorrect value for x, expected -7, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -17, "incorrect value for y, expected -17, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 16, "incorrect value for z, expected 16, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326826500, + "incorrect value for tow, expected 326826500, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -7, + "incorrect value for x, expected -7, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -17, + "incorrect value for y, expected -17, is %d", check_msg->y); + ck_assert_msg(check_msg->z == 16, + "incorrect value for z, expected 16, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -475,17 +564,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEF ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20d, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20d, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,13,2,211,136,20,248,251,122,19,247,255,255,255,243,255,255,255,14,0,0,0,0,0,15,0,191,43, }; + u8 encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 248, 251, 122, 19, 247, 255, 255, 255, + 243, 255, 255, 255, 14, 0, 0, 0, 0, 0, 15, 0, 191, 43, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_t* test_msg = ( msg_vel_ecef_t* )test_msg_storage; + msg_vel_ecef_t* test_msg = (msg_vel_ecef_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -494,69 +588,87 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEF ) test_msg->x = -9; test_msg->y = -13; test_msg->z = 14; - sbp_payload_send(&sbp_state, 0x20d, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20d, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20d, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_t* check_msg = ( msg_vel_ecef_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_t* check_msg = (msg_vel_ecef_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326827000, "incorrect value for tow, expected 326827000, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -9, "incorrect value for x, expected -9, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -13, "incorrect value for y, expected -13, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 14, "incorrect value for z, expected 14, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326827000, + "incorrect value for tow, expected 326827000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -9, + "incorrect value for x, expected -9, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -13, + "incorrect value for y, expected -13, is %d", check_msg->y); + ck_assert_msg(check_msg->z == 14, + "incorrect value for z, expected 14, is %d", check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgVelECEF_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelECEF"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelECEF"); +Suite* legacy_auto_check_sbp_navigation_MsgVelECEF_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelECEF"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelECEF"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgVelECEF); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgVelECEFCov.c b/c/test/legacy/auto_check_sbp_navigation_MsgVelECEFCov.c index e34a94dc9..7cf2ce8b6 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgVelECEFCov.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgVelECEFCov.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFCov.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFCov.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFCov ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgVelECEFCov) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFCov ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFCov ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x215, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x215, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x215, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x215, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,21,2,66,0,42,2,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,64,0,0,0,64,0,0,0,64,0,0,0,64,0,0,128,63,0,0,64,64,3,4,91,254, }; + u8 encoded_frame[] = { + 85, 21, 2, 66, 0, 42, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0, 64, + 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 64, 64, 3, 4, 91, 254, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_cov_t* test_msg = ( msg_vel_ecef_cov_t* )test_msg_storage; + msg_vel_ecef_cov_t *test_msg = (msg_vel_ecef_cov_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cov_x_x = 2.0; test_msg->cov_x_y = 2.0; @@ -155,74 +158,103 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFCov ) test_msg->x = 0; test_msg->y = 0; test_msg->z = 6; - sbp_payload_send(&sbp_state, 0x215, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x215, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x215, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_cov_t* check_msg = ( msg_vel_ecef_cov_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_cov_t *check_msg = + (msg_vel_ecef_cov_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cov_x_x*100 - 2.0*100) < 0.05, "incorrect value for cov_x_x, expected 2.0, is %f", check_msg->cov_x_x); - ck_assert_msg((check_msg->cov_x_y*100 - 2.0*100) < 0.05, "incorrect value for cov_x_y, expected 2.0, is %f", check_msg->cov_x_y); - ck_assert_msg((check_msg->cov_x_z*100 - 2.0*100) < 0.05, "incorrect value for cov_x_z, expected 2.0, is %f", check_msg->cov_x_z); - ck_assert_msg((check_msg->cov_y_y*100 - 2.0*100) < 0.05, "incorrect value for cov_y_y, expected 2.0, is %f", check_msg->cov_y_y); - ck_assert_msg((check_msg->cov_y_z*100 - 1.0*100) < 0.05, "incorrect value for cov_y_z, expected 1.0, is %f", check_msg->cov_y_z); - ck_assert_msg((check_msg->cov_z_z*100 - 3.0*100) < 0.05, "incorrect value for cov_z_z, expected 3.0, is %f", check_msg->cov_z_z); - ck_assert_msg(check_msg->flags == 4, "incorrect value for flags, expected 4, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 3, "incorrect value for n_sats, expected 3, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2, "incorrect value for tow, expected 2, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == 0, "incorrect value for x, expected 0, is %d", check_msg->x); - ck_assert_msg(check_msg->y == 0, "incorrect value for y, expected 0, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 6, "incorrect value for z, expected 6, is %d", check_msg->z); + ck_assert_msg((check_msg->cov_x_x * 100 - 2.0 * 100) < 0.05, + "incorrect value for cov_x_x, expected 2.0, is %f", + check_msg->cov_x_x); + ck_assert_msg((check_msg->cov_x_y * 100 - 2.0 * 100) < 0.05, + "incorrect value for cov_x_y, expected 2.0, is %f", + check_msg->cov_x_y); + ck_assert_msg((check_msg->cov_x_z * 100 - 2.0 * 100) < 0.05, + "incorrect value for cov_x_z, expected 2.0, is %f", + check_msg->cov_x_z); + ck_assert_msg((check_msg->cov_y_y * 100 - 2.0 * 100) < 0.05, + "incorrect value for cov_y_y, expected 2.0, is %f", + check_msg->cov_y_y); + ck_assert_msg((check_msg->cov_y_z * 100 - 1.0 * 100) < 0.05, + "incorrect value for cov_y_z, expected 1.0, is %f", + check_msg->cov_y_z); + ck_assert_msg((check_msg->cov_z_z * 100 - 3.0 * 100) < 0.05, + "incorrect value for cov_z_z, expected 3.0, is %f", + check_msg->cov_z_z); + ck_assert_msg(check_msg->flags == 4, + "incorrect value for flags, expected 4, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 3, + "incorrect value for n_sats, expected 3, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2, + "incorrect value for tow, expected 2, is %d", check_msg->tow); + ck_assert_msg(check_msg->x == 0, "incorrect value for x, expected 0, is %d", + check_msg->x); + ck_assert_msg(check_msg->y == 0, "incorrect value for y, expected 0, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 6, "incorrect value for z, expected 6, is %d", + check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgVelECEFCov_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelECEFCov"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelECEFCov"); +Suite *legacy_auto_check_sbp_navigation_MsgVelECEFCov_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgVelECEFCov"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelECEFCov"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgVelECEFCov); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgVelECEFDepA.c b/c/test/legacy/auto_check_sbp_navigation_MsgVelECEFDepA.c index bde09b9d5..7af987ed9 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgVelECEFDepA.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgVelECEFDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,2,246,215,20,20,46,39,0,218,11,0,0,134,245,255,255,163,252,255,255,0,0,9,0,80,236, }; + u8 encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 20, 46, 39, 0, 218, 11, 0, 0, + 134, 245, 255, 255, 163, 252, 255, 255, 0, 0, 9, 0, 80, 236, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; + msg_vel_ecef_dep_a_t* test_msg = (msg_vel_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -150,66 +152,85 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) test_msg->x = 3034; test_msg->y = -2682; test_msg->z = -861; - sbp_payload_send(&sbp_state, 0x204, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x204, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x204, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_dep_a_t* check_msg = ( msg_vel_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_dep_a_t* check_msg = + (msg_vel_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567700, "incorrect value for tow, expected 2567700, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == 3034, "incorrect value for x, expected 3034, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -2682, "incorrect value for y, expected -2682, is %d", check_msg->y); - ck_assert_msg(check_msg->z == -861, "incorrect value for z, expected -861, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567700, + "incorrect value for tow, expected 2567700, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == 3034, + "incorrect value for x, expected 3034, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -2682, + "incorrect value for y, expected -2682, is %d", check_msg->y); + ck_assert_msg(check_msg->z == -861, + "incorrect value for z, expected -861, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -217,17 +238,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,2,246,215,20,120,46,39,0,68,11,0,0,24,246,255,255,220,252,255,255,0,0,9,0,248,138, }; + u8 encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 120, 46, 39, 0, 68, 11, 0, 0, + 24, 246, 255, 255, 220, 252, 255, 255, 0, 0, 9, 0, 248, 138, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; + msg_vel_ecef_dep_a_t* test_msg = (msg_vel_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -236,66 +262,85 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) test_msg->x = 2884; test_msg->y = -2536; test_msg->z = -804; - sbp_payload_send(&sbp_state, 0x204, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x204, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x204, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_dep_a_t* check_msg = ( msg_vel_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_dep_a_t* check_msg = + (msg_vel_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567800, "incorrect value for tow, expected 2567800, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == 2884, "incorrect value for x, expected 2884, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -2536, "incorrect value for y, expected -2536, is %d", check_msg->y); - ck_assert_msg(check_msg->z == -804, "incorrect value for z, expected -804, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567800, + "incorrect value for tow, expected 2567800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == 2884, + "incorrect value for x, expected 2884, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -2536, + "incorrect value for y, expected -2536, is %d", check_msg->y); + ck_assert_msg(check_msg->z == -804, + "incorrect value for z, expected -804, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -303,17 +348,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,2,246,215,20,220,46,39,0,21,11,0,0,77,246,255,255,247,252,255,255,0,0,9,0,25,174, }; + u8 encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 220, 46, 39, 0, 21, 11, 0, 0, + 77, 246, 255, 255, 247, 252, 255, 255, 0, 0, 9, 0, 25, 174, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; + msg_vel_ecef_dep_a_t* test_msg = (msg_vel_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -322,66 +372,85 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) test_msg->x = 2837; test_msg->y = -2483; test_msg->z = -777; - sbp_payload_send(&sbp_state, 0x204, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x204, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x204, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_dep_a_t* check_msg = ( msg_vel_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_dep_a_t* check_msg = + (msg_vel_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567900, "incorrect value for tow, expected 2567900, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == 2837, "incorrect value for x, expected 2837, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -2483, "incorrect value for y, expected -2483, is %d", check_msg->y); - ck_assert_msg(check_msg->z == -777, "incorrect value for z, expected -777, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567900, + "incorrect value for tow, expected 2567900, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == 2837, + "incorrect value for x, expected 2837, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -2483, + "incorrect value for y, expected -2483, is %d", check_msg->y); + ck_assert_msg(check_msg->z == -777, + "incorrect value for z, expected -777, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -389,17 +458,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,2,246,215,20,64,47,39,0,121,11,0,0,2,246,255,255,234,252,255,255,0,0,9,0,195,228, }; + u8 encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 64, 47, 39, 0, 121, 11, 0, 0, + 2, 246, 255, 255, 234, 252, 255, 255, 0, 0, 9, 0, 195, 228, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; + msg_vel_ecef_dep_a_t* test_msg = (msg_vel_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -408,66 +482,85 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) test_msg->x = 2937; test_msg->y = -2558; test_msg->z = -790; - sbp_payload_send(&sbp_state, 0x204, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x204, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x204, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_dep_a_t* check_msg = ( msg_vel_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_dep_a_t* check_msg = + (msg_vel_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2568000, "incorrect value for tow, expected 2568000, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == 2937, "incorrect value for x, expected 2937, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -2558, "incorrect value for y, expected -2558, is %d", check_msg->y); - ck_assert_msg(check_msg->z == -790, "incorrect value for z, expected -790, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2568000, + "incorrect value for tow, expected 2568000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == 2937, + "incorrect value for x, expected 2937, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -2558, + "incorrect value for y, expected -2558, is %d", check_msg->y); + ck_assert_msg(check_msg->z == -790, + "incorrect value for z, expected -790, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -475,17 +568,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,2,246,215,20,164,47,39,0,31,11,0,0,93,246,255,255,16,253,255,255,0,0,9,0,219,164, }; + u8 encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 164, 47, 39, 0, 31, 11, 0, 0, + 93, 246, 255, 255, 16, 253, 255, 255, 0, 0, 9, 0, 219, 164, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; + msg_vel_ecef_dep_a_t* test_msg = (msg_vel_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -494,66 +592,85 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) test_msg->x = 2847; test_msg->y = -2467; test_msg->z = -752; - sbp_payload_send(&sbp_state, 0x204, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x204, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x204, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_dep_a_t* check_msg = ( msg_vel_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_dep_a_t* check_msg = + (msg_vel_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2568100, "incorrect value for tow, expected 2568100, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == 2847, "incorrect value for x, expected 2847, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -2467, "incorrect value for y, expected -2467, is %d", check_msg->y); - ck_assert_msg(check_msg->z == -752, "incorrect value for z, expected -752, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2568100, + "incorrect value for tow, expected 2568100, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == 2847, + "incorrect value for x, expected 2847, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -2467, + "incorrect value for y, expected -2467, is %d", check_msg->y); + ck_assert_msg(check_msg->z == -752, + "incorrect value for z, expected -752, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -561,17 +678,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,2,195,4,20,212,157,67,24,24,0,0,0,245,255,255,255,219,255,255,255,0,0,8,0,68,255, }; + u8 encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 212, 157, 67, 24, 24, 0, 0, 0, + 245, 255, 255, 255, 219, 255, 255, 255, 0, 0, 8, 0, 68, 255, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; + msg_vel_ecef_dep_a_t* test_msg = (msg_vel_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -580,66 +702,85 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) test_msg->x = 24; test_msg->y = -11; test_msg->z = -37; - sbp_payload_send(&sbp_state, 0x204, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x204, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x204, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_dep_a_t* check_msg = ( msg_vel_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_dep_a_t* check_msg = + (msg_vel_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084500, "incorrect value for tow, expected 407084500, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == 24, "incorrect value for x, expected 24, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -11, "incorrect value for y, expected -11, is %d", check_msg->y); - ck_assert_msg(check_msg->z == -37, "incorrect value for z, expected -37, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084500, + "incorrect value for tow, expected 407084500, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == 24, + "incorrect value for x, expected 24, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -11, + "incorrect value for y, expected -11, is %d", check_msg->y); + ck_assert_msg(check_msg->z == -37, + "incorrect value for z, expected -37, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -647,17 +788,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,2,195,4,20,56,158,67,24,4,0,0,0,234,255,255,255,18,0,0,0,0,0,8,0,214,136, }; + u8 encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 56, 158, 67, 24, 4, 0, 0, 0, + 234, 255, 255, 255, 18, 0, 0, 0, 0, 0, 8, 0, 214, 136, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; + msg_vel_ecef_dep_a_t* test_msg = (msg_vel_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -666,66 +812,85 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) test_msg->x = 4; test_msg->y = -22; test_msg->z = 18; - sbp_payload_send(&sbp_state, 0x204, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x204, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x204, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_dep_a_t* check_msg = ( msg_vel_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_dep_a_t* check_msg = + (msg_vel_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084600, "incorrect value for tow, expected 407084600, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == 4, "incorrect value for x, expected 4, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -22, "incorrect value for y, expected -22, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 18, "incorrect value for z, expected 18, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084600, + "incorrect value for tow, expected 407084600, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == 4, "incorrect value for x, expected 4, is %d", + check_msg->x); + ck_assert_msg(check_msg->y == -22, + "incorrect value for y, expected -22, is %d", check_msg->y); + ck_assert_msg(check_msg->z == 18, + "incorrect value for z, expected 18, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -733,17 +898,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,2,195,4,20,156,158,67,24,230,255,255,255,4,0,0,0,1,0,0,0,0,0,8,0,122,159, }; + u8 encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 156, 158, 67, 24, 230, 255, 255, 255, + 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8, 0, 122, 159, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; + msg_vel_ecef_dep_a_t* test_msg = (msg_vel_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -752,66 +922,85 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) test_msg->x = -26; test_msg->y = 4; test_msg->z = 1; - sbp_payload_send(&sbp_state, 0x204, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x204, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x204, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_dep_a_t* check_msg = ( msg_vel_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_dep_a_t* check_msg = + (msg_vel_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084700, "incorrect value for tow, expected 407084700, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -26, "incorrect value for x, expected -26, is %d", check_msg->x); - ck_assert_msg(check_msg->y == 4, "incorrect value for y, expected 4, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 1, "incorrect value for z, expected 1, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084700, + "incorrect value for tow, expected 407084700, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -26, + "incorrect value for x, expected -26, is %d", check_msg->x); + ck_assert_msg(check_msg->y == 4, "incorrect value for y, expected 4, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 1, "incorrect value for z, expected 1, is %d", + check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -819,17 +1008,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,2,195,4,20,0,159,67,24,247,255,255,255,237,255,255,255,28,0,0,0,0,0,8,0,232,146, }; + u8 encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 0, 159, 67, 24, 247, 255, 255, 255, + 237, 255, 255, 255, 28, 0, 0, 0, 0, 0, 8, 0, 232, 146, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; + msg_vel_ecef_dep_a_t* test_msg = (msg_vel_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -838,66 +1032,85 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) test_msg->x = -9; test_msg->y = -19; test_msg->z = 28; - sbp_payload_send(&sbp_state, 0x204, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x204, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x204, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_dep_a_t* check_msg = ( msg_vel_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_dep_a_t* check_msg = + (msg_vel_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084800, "incorrect value for tow, expected 407084800, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -9, "incorrect value for x, expected -9, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -19, "incorrect value for y, expected -19, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 28, "incorrect value for z, expected 28, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084800, + "incorrect value for tow, expected 407084800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -9, + "incorrect value for x, expected -9, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -19, + "incorrect value for y, expected -19, is %d", check_msg->y); + ck_assert_msg(check_msg->z == 28, + "incorrect value for z, expected 28, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -905,17 +1118,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,2,195,4,20,100,159,67,24,255,255,255,255,2,0,0,0,245,255,255,255,0,0,8,0,171,238, }; + u8 encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 100, 159, 67, 24, 255, 255, 255, 255, + 2, 0, 0, 0, 245, 255, 255, 255, 0, 0, 8, 0, 171, 238, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; + msg_vel_ecef_dep_a_t* test_msg = (msg_vel_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -924,66 +1142,85 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) test_msg->x = -1; test_msg->y = 2; test_msg->z = -11; - sbp_payload_send(&sbp_state, 0x204, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x204, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x204, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_dep_a_t* check_msg = ( msg_vel_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_dep_a_t* check_msg = + (msg_vel_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084900, "incorrect value for tow, expected 407084900, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -1, "incorrect value for x, expected -1, is %d", check_msg->x); - ck_assert_msg(check_msg->y == 2, "incorrect value for y, expected 2, is %d", check_msg->y); - ck_assert_msg(check_msg->z == -11, "incorrect value for z, expected -11, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084900, + "incorrect value for tow, expected 407084900, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -1, + "incorrect value for x, expected -1, is %d", check_msg->x); + ck_assert_msg(check_msg->y == 2, "incorrect value for y, expected 2, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == -11, + "incorrect value for z, expected -11, is %d", check_msg->z); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -991,17 +1228,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x204, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x204, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,2,195,4,20,46,162,68,24,207,255,255,255,185,255,255,255,65,0,0,0,0,0,5,0,82,154, }; + u8 encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 46, 162, 68, 24, 207, 255, 255, 255, + 185, 255, 255, 255, 65, 0, 0, 0, 0, 0, 5, 0, 82, 154, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; + msg_vel_ecef_dep_a_t* test_msg = (msg_vel_ecef_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 0; test_msg->flags = 0; @@ -1010,69 +1252,89 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA ) test_msg->x = -49; test_msg->y = -71; test_msg->z = 65; - sbp_payload_send(&sbp_state, 0x204, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x204, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x204, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_dep_a_t* check_msg = ( msg_vel_ecef_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_dep_a_t* check_msg = + (msg_vel_ecef_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 0, "incorrect value for accuracy, expected 0, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 5, "incorrect value for n_sats, expected 5, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407151150, "incorrect value for tow, expected 407151150, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -49, "incorrect value for x, expected -49, is %d", check_msg->x); - ck_assert_msg(check_msg->y == -71, "incorrect value for y, expected -71, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 65, "incorrect value for z, expected 65, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 0, + "incorrect value for accuracy, expected 0, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 5, + "incorrect value for n_sats, expected 5, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407151150, + "incorrect value for tow, expected 407151150, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -49, + "incorrect value for x, expected -49, is %d", check_msg->x); + ck_assert_msg(check_msg->y == -71, + "incorrect value for y, expected -71, is %d", check_msg->y); + ck_assert_msg(check_msg->z == 65, + "incorrect value for z, expected 65, is %d", check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgVelECEFDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelECEFDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelECEFDepA"); +Suite* legacy_auto_check_sbp_navigation_MsgVelECEFDepA_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgVelECEFDepA"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelECEFDepA"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgVelEcefCovGnss.c b/c/test/legacy/auto_check_sbp_navigation_MsgVelEcefCovGnss.c index 3af54415b..139dc628d 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgVelEcefCovGnss.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgVelEcefCovGnss.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefCovGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefCovGnss.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,25 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x235, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x235, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x235, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x235, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,53,2,0,16,42,224,229,233,29,253,255,255,255,1,0,0,0,4,0,0,0,46,224,32,59,32,214,14,59,150,147,220,186,19,63,138,59,26,150,35,187,11,193,119,59,21,2,22,230, }; + u8 encoded_frame[] = { + 85, 53, 2, 0, 16, 42, 224, 229, 233, 29, 253, 255, 255, + 255, 1, 0, 0, 0, 4, 0, 0, 0, 46, 224, 32, 59, + 32, 214, 14, 59, 150, 147, 220, 186, 19, 63, 138, 59, 26, + 150, 35, 187, 11, 193, 119, 59, 21, 2, 22, 230, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_cov_gnss_t* test_msg = ( msg_vel_ecef_cov_gnss_t* )test_msg_storage; + msg_vel_ecef_cov_gnss_t *test_msg = + (msg_vel_ecef_cov_gnss_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cov_x_x = 0.0024547684006392956; test_msg->cov_x_y = 0.0021795108914375305; @@ -155,75 +160,112 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss ) test_msg->x = -3; test_msg->y = 1; test_msg->z = 4; - sbp_payload_send(&sbp_state, 0x235, 4096, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x235, 4096, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 4096, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x235, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_cov_gnss_t* check_msg = ( msg_vel_ecef_cov_gnss_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_cov_gnss_t *check_msg = + (msg_vel_ecef_cov_gnss_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cov_x_x*100 - 0.00245476840064*100) < 0.05, "incorrect value for cov_x_x, expected 0.00245476840064, is %f", check_msg->cov_x_x); - ck_assert_msg((check_msg->cov_x_y*100 - 0.00217951089144*100) < 0.05, "incorrect value for cov_x_y, expected 0.00217951089144, is %f", check_msg->cov_x_y); - ck_assert_msg((check_msg->cov_x_z*100 - -0.00168286520056*100) < 0.05, "incorrect value for cov_x_z, expected -0.00168286520056, is %f", check_msg->cov_x_z); - ck_assert_msg((check_msg->cov_y_y*100 - 0.00421894481406*100) < 0.05, "incorrect value for cov_y_y, expected 0.00421894481406, is %f", check_msg->cov_y_y); - ck_assert_msg((check_msg->cov_y_z*100 - -0.0024961293675*100) < 0.05, "incorrect value for cov_y_z, expected -0.0024961293675, is %f", check_msg->cov_y_z); - ck_assert_msg((check_msg->cov_z_z*100 - 0.00378042715602*100) < 0.05, "incorrect value for cov_z_z, expected 0.00378042715602, is %f", check_msg->cov_z_z); - ck_assert_msg(check_msg->flags == 2, "incorrect value for flags, expected 2, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 21, "incorrect value for n_sats, expected 21, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 501868000, "incorrect value for tow, expected 501868000, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -3, "incorrect value for x, expected -3, is %d", check_msg->x); - ck_assert_msg(check_msg->y == 1, "incorrect value for y, expected 1, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 4, "incorrect value for z, expected 4, is %d", check_msg->z); + ck_assert_msg( + (check_msg->cov_x_x * 100 - 0.00245476840064 * 100) < 0.05, + "incorrect value for cov_x_x, expected 0.00245476840064, is %f", + check_msg->cov_x_x); + ck_assert_msg( + (check_msg->cov_x_y * 100 - 0.00217951089144 * 100) < 0.05, + "incorrect value for cov_x_y, expected 0.00217951089144, is %f", + check_msg->cov_x_y); + ck_assert_msg( + (check_msg->cov_x_z * 100 - -0.00168286520056 * 100) < 0.05, + "incorrect value for cov_x_z, expected -0.00168286520056, is %f", + check_msg->cov_x_z); + ck_assert_msg( + (check_msg->cov_y_y * 100 - 0.00421894481406 * 100) < 0.05, + "incorrect value for cov_y_y, expected 0.00421894481406, is %f", + check_msg->cov_y_y); + ck_assert_msg( + (check_msg->cov_y_z * 100 - -0.0024961293675 * 100) < 0.05, + "incorrect value for cov_y_z, expected -0.0024961293675, is %f", + check_msg->cov_y_z); + ck_assert_msg( + (check_msg->cov_z_z * 100 - 0.00378042715602 * 100) < 0.05, + "incorrect value for cov_z_z, expected 0.00378042715602, is %f", + check_msg->cov_z_z); + ck_assert_msg(check_msg->flags == 2, + "incorrect value for flags, expected 2, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 21, + "incorrect value for n_sats, expected 21, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 501868000, + "incorrect value for tow, expected 501868000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -3, + "incorrect value for x, expected -3, is %d", check_msg->x); + ck_assert_msg(check_msg->y == 1, "incorrect value for y, expected 1, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 4, "incorrect value for z, expected 4, is %d", + check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss); +Suite *legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgVelEcefGnss.c b/c/test/legacy/auto_check_sbp_navigation_MsgVelEcefGnss.c index d9b05b5e9..45d743b64 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgVelEcefGnss.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgVelEcefGnss.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefGnss.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelEcefGnss ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgVelEcefGnss) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelEcefGnss ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelEcefGnss ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x22d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x22d, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x22d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x22d, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,45,2,0,16,20,224,229,233,29,253,255,255,255,1,0,0,0,4,0,0,0,89,0,21,2,205,16, }; + u8 encoded_frame[] = { + 85, 45, 2, 0, 16, 20, 224, 229, 233, 29, 253, 255, 255, 255, + 1, 0, 0, 0, 4, 0, 0, 0, 89, 0, 21, 2, 205, 16, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ecef_gnss_t* test_msg = ( msg_vel_ecef_gnss_t* )test_msg_storage; + msg_vel_ecef_gnss_t *test_msg = (msg_vel_ecef_gnss_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->accuracy = 89; test_msg->flags = 2; @@ -150,69 +152,89 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelEcefGnss ) test_msg->x = -3; test_msg->y = 1; test_msg->z = 4; - sbp_payload_send(&sbp_state, 0x22d, 4096, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x22d, 4096, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 4096, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x22d, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ecef_gnss_t* check_msg = ( msg_vel_ecef_gnss_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ecef_gnss_t *check_msg = + (msg_vel_ecef_gnss_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->accuracy == 89, "incorrect value for accuracy, expected 89, is %d", check_msg->accuracy); - ck_assert_msg(check_msg->flags == 2, "incorrect value for flags, expected 2, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_sats == 21, "incorrect value for n_sats, expected 21, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 501868000, "incorrect value for tow, expected 501868000, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == -3, "incorrect value for x, expected -3, is %d", check_msg->x); - ck_assert_msg(check_msg->y == 1, "incorrect value for y, expected 1, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 4, "incorrect value for z, expected 4, is %d", check_msg->z); + ck_assert_msg(check_msg->accuracy == 89, + "incorrect value for accuracy, expected 89, is %d", + check_msg->accuracy); + ck_assert_msg(check_msg->flags == 2, + "incorrect value for flags, expected 2, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_sats == 21, + "incorrect value for n_sats, expected 21, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 501868000, + "incorrect value for tow, expected 501868000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->x == -3, + "incorrect value for x, expected -3, is %d", check_msg->x); + ck_assert_msg(check_msg->y == 1, "incorrect value for y, expected 1, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 4, "incorrect value for z, expected 4, is %d", + check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgVelEcefGnss_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelEcefGnss"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelEcefGnss"); +Suite *legacy_auto_check_sbp_navigation_MsgVelEcefGnss_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgVelEcefGnss"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelEcefGnss"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgVelEcefGnss); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgVelNED.c b/c/test/legacy/auto_check_sbp_navigation_MsgVelNED.c index aa6bc7550..123861c99 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgVelNED.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgVelNED.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNED.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNED.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNED ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgVelNED) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNED ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNED ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20e, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20e, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,14,2,211,136,22,40,244,122,19,3,0,0,0,252,255,255,255,243,255,255,255,0,0,0,0,14,0,86,209, }; + u8 encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 40, 244, 122, 19, 3, 0, 0, 0, 252, + 255, 255, 255, 243, 255, 255, 255, 0, 0, 0, 0, 14, 0, 86, 209, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_t* test_msg = ( msg_vel_ned_t* )test_msg_storage; + msg_vel_ned_t* test_msg = (msg_vel_ned_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -13; test_msg->e = -4; @@ -151,67 +153,87 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNED ) test_msg->n_sats = 14; test_msg->tow = 326825000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x20e, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20e, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20e, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_t* check_msg = ( msg_vel_ned_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_t* check_msg = (msg_vel_ned_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -13, "incorrect value for d, expected -13, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -4, "incorrect value for e, expected -4, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == 3, "incorrect value for n, expected 3, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 14, "incorrect value for n_sats, expected 14, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326825000, "incorrect value for tow, expected 326825000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -13, + "incorrect value for d, expected -13, is %d", check_msg->d); + ck_assert_msg(check_msg->e == -4, + "incorrect value for e, expected -4, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == 3, "incorrect value for n, expected 3, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 14, + "incorrect value for n_sats, expected 14, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326825000, + "incorrect value for tow, expected 326825000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -219,17 +241,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNED ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20e, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20e, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,14,2,211,136,22,28,246,122,19,252,255,255,255,255,255,255,255,232,255,255,255,0,0,0,0,15,0,16,228, }; + u8 encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 28, 246, 122, 19, + 252, 255, 255, 255, 255, 255, 255, 255, 232, 255, + 255, 255, 0, 0, 0, 0, 15, 0, 16, 228, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_t* test_msg = ( msg_vel_ned_t* )test_msg_storage; + msg_vel_ned_t* test_msg = (msg_vel_ned_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -24; test_msg->e = -1; @@ -239,67 +267,87 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNED ) test_msg->n_sats = 15; test_msg->tow = 326825500; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x20e, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20e, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20e, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_t* check_msg = ( msg_vel_ned_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_t* check_msg = (msg_vel_ned_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -24, "incorrect value for d, expected -24, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -1, "incorrect value for e, expected -1, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -4, "incorrect value for n, expected -4, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326825500, "incorrect value for tow, expected 326825500, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -24, + "incorrect value for d, expected -24, is %d", check_msg->d); + ck_assert_msg(check_msg->e == -1, + "incorrect value for e, expected -1, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -4, + "incorrect value for n, expected -4, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326825500, + "incorrect value for tow, expected 326825500, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -307,17 +355,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNED ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20e, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20e, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,14,2,211,136,22,16,248,122,19,0,0,0,0,253,255,255,255,244,255,255,255,0,0,0,0,15,0,11,164, }; + u8 encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 16, 248, 122, 19, 0, 0, 0, 0, 253, + 255, 255, 255, 244, 255, 255, 255, 0, 0, 0, 0, 15, 0, 11, 164, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_t* test_msg = ( msg_vel_ned_t* )test_msg_storage; + msg_vel_ned_t* test_msg = (msg_vel_ned_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -12; test_msg->e = -3; @@ -327,67 +380,87 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNED ) test_msg->n_sats = 15; test_msg->tow = 326826000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x20e, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20e, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20e, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_t* check_msg = ( msg_vel_ned_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_t* check_msg = (msg_vel_ned_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -12, "incorrect value for d, expected -12, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -3, "incorrect value for e, expected -3, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == 0, "incorrect value for n, expected 0, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326826000, "incorrect value for tow, expected 326826000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -12, + "incorrect value for d, expected -12, is %d", check_msg->d); + ck_assert_msg(check_msg->e == -3, + "incorrect value for e, expected -3, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == 0, "incorrect value for n, expected 0, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326826000, + "incorrect value for tow, expected 326826000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -395,17 +468,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNED ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20e, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20e, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,14,2,211,136,22,4,250,122,19,2,0,0,0,3,0,0,0,232,255,255,255,0,0,0,0,15,0,152,208, }; + u8 encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 4, 250, 122, 19, 2, 0, 0, 0, 3, + 0, 0, 0, 232, 255, 255, 255, 0, 0, 0, 0, 15, 0, 152, 208, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_t* test_msg = ( msg_vel_ned_t* )test_msg_storage; + msg_vel_ned_t* test_msg = (msg_vel_ned_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -24; test_msg->e = 3; @@ -415,67 +493,87 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNED ) test_msg->n_sats = 15; test_msg->tow = 326826500; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x20e, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20e, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20e, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_t* check_msg = ( msg_vel_ned_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_t* check_msg = (msg_vel_ned_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -24, "incorrect value for d, expected -24, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 3, "incorrect value for e, expected 3, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == 2, "incorrect value for n, expected 2, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326826500, "incorrect value for tow, expected 326826500, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -24, + "incorrect value for d, expected -24, is %d", check_msg->d); + ck_assert_msg(check_msg->e == 3, "incorrect value for e, expected 3, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == 2, "incorrect value for n, expected 2, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326826500, + "incorrect value for tow, expected 326826500, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -483,17 +581,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNED ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20e, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20e, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,14,2,211,136,22,248,251,122,19,1,0,0,0,0,0,0,0,235,255,255,255,0,0,0,0,15,0,182,120, }; + u8 encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 248, 251, 122, 19, 1, 0, 0, 0, 0, + 0, 0, 0, 235, 255, 255, 255, 0, 0, 0, 0, 15, 0, 182, 120, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_t* test_msg = ( msg_vel_ned_t* )test_msg_storage; + msg_vel_ned_t* test_msg = (msg_vel_ned_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -21; test_msg->e = 0; @@ -503,70 +606,90 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNED ) test_msg->n_sats = 15; test_msg->tow = 326827000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x20e, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20e, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20e, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_t* check_msg = ( msg_vel_ned_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_t* check_msg = (msg_vel_ned_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -21, "incorrect value for d, expected -21, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 0, "incorrect value for e, expected 0, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == 1, "incorrect value for n, expected 1, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 15, "incorrect value for n_sats, expected 15, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 326827000, "incorrect value for tow, expected 326827000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -21, + "incorrect value for d, expected -21, is %d", check_msg->d); + ck_assert_msg(check_msg->e == 0, "incorrect value for e, expected 0, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == 1, "incorrect value for n, expected 1, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 15, + "incorrect value for n_sats, expected 15, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 326827000, + "incorrect value for tow, expected 326827000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgVelNED_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelNED"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelNED"); +Suite* legacy_auto_check_sbp_navigation_MsgVelNED_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelNED"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelNED"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgVelNED); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgVelNEDCOV.c b/c/test/legacy/auto_check_sbp_navigation_MsgVelNEDCOV.c index daa6dabc4..57507ed1a 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgVelNEDCOV.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgVelNEDCOV.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDCOV.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDCOV.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDCOV ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgVelNEDCOV) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDCOV ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDCOV ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x212, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x212, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x212, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x212, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,18,2,66,0,42,100,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,10,0,88,205, }; + u8 encoded_frame[] = { + 85, 18, 2, 66, 0, 42, 100, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, 10, 0, 88, 205, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_cov_t* test_msg = ( msg_vel_ned_cov_t* )test_msg_storage; + msg_vel_ned_cov_t *test_msg = (msg_vel_ned_cov_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cov_d_d = 1.0; test_msg->cov_e_d = 1.0; @@ -155,74 +158,103 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDCOV ) test_msg->n = 1; test_msg->n_sats = 10; test_msg->tow = 100; - sbp_payload_send(&sbp_state, 0x212, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x212, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x212, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_cov_t* check_msg = ( msg_vel_ned_cov_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_cov_t *check_msg = (msg_vel_ned_cov_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cov_d_d*100 - 1.0*100) < 0.05, "incorrect value for cov_d_d, expected 1.0, is %f", check_msg->cov_d_d); - ck_assert_msg((check_msg->cov_e_d*100 - 1.0*100) < 0.05, "incorrect value for cov_e_d, expected 1.0, is %f", check_msg->cov_e_d); - ck_assert_msg((check_msg->cov_e_e*100 - 1.0*100) < 0.05, "incorrect value for cov_e_e, expected 1.0, is %f", check_msg->cov_e_e); - ck_assert_msg((check_msg->cov_n_d*100 - 1.0*100) < 0.05, "incorrect value for cov_n_d, expected 1.0, is %f", check_msg->cov_n_d); - ck_assert_msg((check_msg->cov_n_e*100 - 1.0*100) < 0.05, "incorrect value for cov_n_e, expected 1.0, is %f", check_msg->cov_n_e); - ck_assert_msg((check_msg->cov_n_n*100 - 1.0*100) < 0.05, "incorrect value for cov_n_n, expected 1.0, is %f", check_msg->cov_n_n); - ck_assert_msg(check_msg->d == 1, "incorrect value for d, expected 1, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 1, "incorrect value for e, expected 1, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n == 1, "incorrect value for n, expected 1, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 10, "incorrect value for n_sats, expected 10, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 100, "incorrect value for tow, expected 100, is %d", check_msg->tow); + ck_assert_msg((check_msg->cov_d_d * 100 - 1.0 * 100) < 0.05, + "incorrect value for cov_d_d, expected 1.0, is %f", + check_msg->cov_d_d); + ck_assert_msg((check_msg->cov_e_d * 100 - 1.0 * 100) < 0.05, + "incorrect value for cov_e_d, expected 1.0, is %f", + check_msg->cov_e_d); + ck_assert_msg((check_msg->cov_e_e * 100 - 1.0 * 100) < 0.05, + "incorrect value for cov_e_e, expected 1.0, is %f", + check_msg->cov_e_e); + ck_assert_msg((check_msg->cov_n_d * 100 - 1.0 * 100) < 0.05, + "incorrect value for cov_n_d, expected 1.0, is %f", + check_msg->cov_n_d); + ck_assert_msg((check_msg->cov_n_e * 100 - 1.0 * 100) < 0.05, + "incorrect value for cov_n_e, expected 1.0, is %f", + check_msg->cov_n_e); + ck_assert_msg((check_msg->cov_n_n * 100 - 1.0 * 100) < 0.05, + "incorrect value for cov_n_n, expected 1.0, is %f", + check_msg->cov_n_n); + ck_assert_msg(check_msg->d == 1, "incorrect value for d, expected 1, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == 1, "incorrect value for e, expected 1, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n == 1, "incorrect value for n, expected 1, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 10, + "incorrect value for n_sats, expected 10, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 100, + "incorrect value for tow, expected 100, is %d", + check_msg->tow); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgVelNEDCOV_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelNEDCOV"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelNEDCOV"); +Suite *legacy_auto_check_sbp_navigation_MsgVelNEDCOV_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgVelNEDCOV"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelNEDCOV"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgVelNEDCOV); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgVelNEDDepA.c b/c/test/legacy/auto_check_sbp_navigation_MsgVelNEDDepA.c index 1873181d0..6d0fa3679 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgVelNEDDepA.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgVelNEDDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,2,246,215,22,20,46,39,0,198,251,255,255,156,15,0,0,0,0,0,0,0,0,0,0,9,0,161,92, }; + u8 encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 20, 46, 39, 0, 198, 251, 255, 255, 156, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 161, 92, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; + msg_vel_ned_dep_a_t* test_msg = (msg_vel_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 0; test_msg->e = 3996; @@ -151,67 +153,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) test_msg->n_sats = 9; test_msg->tow = 2567700; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x205, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x205, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x205, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_dep_a_t* check_msg = ( msg_vel_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_dep_a_t* check_msg = + (msg_vel_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 3996, "incorrect value for e, expected 3996, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -1082, "incorrect value for n, expected -1082, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567700, "incorrect value for tow, expected 2567700, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == 3996, + "incorrect value for e, expected 3996, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -1082, + "incorrect value for n, expected -1082, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567700, + "incorrect value for tow, expected 2567700, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -219,17 +242,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,2,246,215,22,120,46,39,0,14,252,255,255,207,14,0,0,0,0,0,0,0,0,0,0,9,0,125,160, }; + u8 encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 120, 46, 39, 0, 14, 252, 255, 255, 207, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 125, 160, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; + msg_vel_ned_dep_a_t* test_msg = (msg_vel_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 0; test_msg->e = 3791; @@ -239,67 +267,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) test_msg->n_sats = 9; test_msg->tow = 2567800; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x205, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x205, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x205, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_dep_a_t* check_msg = ( msg_vel_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_dep_a_t* check_msg = + (msg_vel_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 3791, "incorrect value for e, expected 3791, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -1010, "incorrect value for n, expected -1010, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567800, "incorrect value for tow, expected 2567800, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == 3791, + "incorrect value for e, expected 3791, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -1010, + "incorrect value for n, expected -1010, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567800, + "incorrect value for tow, expected 2567800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -307,17 +356,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,2,246,215,22,220,46,39,0,48,252,255,255,140,14,0,0,0,0,0,0,0,0,0,0,9,0,179,135, }; + u8 encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 220, 46, 39, 0, 48, 252, 255, 255, 140, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 179, 135, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; + msg_vel_ned_dep_a_t* test_msg = (msg_vel_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 0; test_msg->e = 3724; @@ -327,67 +381,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) test_msg->n_sats = 9; test_msg->tow = 2567900; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x205, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x205, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x205, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_dep_a_t* check_msg = ( msg_vel_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_dep_a_t* check_msg = + (msg_vel_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 3724, "incorrect value for e, expected 3724, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -976, "incorrect value for n, expected -976, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2567900, "incorrect value for tow, expected 2567900, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == 3724, + "incorrect value for e, expected 3724, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -976, + "incorrect value for n, expected -976, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2567900, + "incorrect value for tow, expected 2567900, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -395,17 +470,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,2,246,215,22,64,47,39,0,32,252,255,255,8,15,0,0,0,0,0,0,0,0,0,0,9,0,51,177, }; + u8 encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 64, 47, 39, 0, 32, 252, 255, 255, 8, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 51, 177, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; + msg_vel_ned_dep_a_t* test_msg = (msg_vel_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 0; test_msg->e = 3848; @@ -415,67 +495,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) test_msg->n_sats = 9; test_msg->tow = 2568000; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x205, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x205, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x205, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_dep_a_t* check_msg = ( msg_vel_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_dep_a_t* check_msg = + (msg_vel_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 3848, "incorrect value for e, expected 3848, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -992, "incorrect value for n, expected -992, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2568000, "incorrect value for tow, expected 2568000, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == 3848, + "incorrect value for e, expected 3848, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -992, + "incorrect value for n, expected -992, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2568000, + "incorrect value for tow, expected 2568000, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -483,17 +584,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,2,246,215,22,164,47,39,0,80,252,255,255,140,14,0,0,0,0,0,0,0,0,0,0,9,0,23,0, }; + u8 encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 164, 47, 39, 0, 80, 252, 255, 255, 140, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 23, 0, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; + msg_vel_ned_dep_a_t* test_msg = (msg_vel_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 0; test_msg->e = 3724; @@ -503,67 +609,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) test_msg->n_sats = 9; test_msg->tow = 2568100; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x205, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x205, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x205, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_dep_a_t* check_msg = ( msg_vel_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_dep_a_t* check_msg = + (msg_vel_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 3724, "incorrect value for e, expected 3724, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -944, "incorrect value for n, expected -944, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 9, "incorrect value for n_sats, expected 9, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 2568100, "incorrect value for tow, expected 2568100, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 0, "incorrect value for d, expected 0, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == 3724, + "incorrect value for e, expected 3724, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -944, + "incorrect value for n, expected -944, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 9, + "incorrect value for n_sats, expected 9, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 2568100, + "incorrect value for tow, expected 2568100, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -571,17 +698,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,2,195,4,22,212,157,67,24,229,255,255,255,26,0,0,0,25,0,0,0,0,0,0,0,8,0,132,25, }; + u8 encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 212, 157, 67, 24, 229, 255, 255, 255, 26, + 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 8, 0, 132, 25, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; + msg_vel_ned_dep_a_t* test_msg = (msg_vel_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 25; test_msg->e = 26; @@ -591,67 +723,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) test_msg->n_sats = 8; test_msg->tow = 407084500; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x205, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x205, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x205, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_dep_a_t* check_msg = ( msg_vel_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_dep_a_t* check_msg = + (msg_vel_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 25, "incorrect value for d, expected 25, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 26, "incorrect value for e, expected 26, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -27, "incorrect value for n, expected -27, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084500, "incorrect value for tow, expected 407084500, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 25, + "incorrect value for d, expected 25, is %d", check_msg->d); + ck_assert_msg(check_msg->e == 26, + "incorrect value for e, expected 26, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -27, + "incorrect value for n, expected -27, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084500, + "incorrect value for tow, expected 407084500, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -659,17 +812,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,2,195,4,22,56,158,67,24,4,0,0,0,15,0,0,0,232,255,255,255,0,0,0,0,8,0,42,14, }; + u8 encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 56, 158, 67, 24, 4, 0, 0, 0, 15, + 0, 0, 0, 232, 255, 255, 255, 0, 0, 0, 0, 8, 0, 42, 14, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; + msg_vel_ned_dep_a_t* test_msg = (msg_vel_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -24; test_msg->e = 15; @@ -679,67 +837,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) test_msg->n_sats = 8; test_msg->tow = 407084600; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x205, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x205, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x205, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_dep_a_t* check_msg = ( msg_vel_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_dep_a_t* check_msg = + (msg_vel_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -24, "incorrect value for d, expected -24, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 15, "incorrect value for e, expected 15, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == 4, "incorrect value for n, expected 4, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084600, "incorrect value for tow, expected 407084600, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -24, + "incorrect value for d, expected -24, is %d", check_msg->d); + ck_assert_msg(check_msg->e == 15, + "incorrect value for e, expected 15, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == 4, "incorrect value for n, expected 4, is %d", + check_msg->n); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084600, + "incorrect value for tow, expected 407084600, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -747,17 +926,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,2,195,4,22,156,158,67,24,251,255,255,255,232,255,255,255,247,255,255,255,0,0,0,0,8,0,218,148, }; + u8 encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 156, 158, 67, 24, 251, 255, 255, 255, 232, + 255, 255, 255, 247, 255, 255, 255, 0, 0, 0, 0, 8, 0, 218, 148, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; + msg_vel_ned_dep_a_t* test_msg = (msg_vel_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -9; test_msg->e = -24; @@ -767,67 +951,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) test_msg->n_sats = 8; test_msg->tow = 407084700; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x205, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x205, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x205, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_dep_a_t* check_msg = ( msg_vel_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_dep_a_t* check_msg = + (msg_vel_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -9, "incorrect value for d, expected -9, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -24, "incorrect value for e, expected -24, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -5, "incorrect value for n, expected -5, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084700, "incorrect value for tow, expected 407084700, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -9, + "incorrect value for d, expected -9, is %d", check_msg->d); + ck_assert_msg(check_msg->e == -24, + "incorrect value for e, expected -24, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -5, + "incorrect value for n, expected -5, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084700, + "incorrect value for tow, expected 407084700, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -835,17 +1040,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,2,195,4,22,0,159,67,24,10,0,0,0,2,0,0,0,222,255,255,255,0,0,0,0,8,0,148,16, }; + u8 encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 0, 159, 67, 24, 10, 0, 0, 0, 2, + 0, 0, 0, 222, 255, 255, 255, 0, 0, 0, 0, 8, 0, 148, 16, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; + msg_vel_ned_dep_a_t* test_msg = (msg_vel_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -34; test_msg->e = 2; @@ -855,67 +1065,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) test_msg->n_sats = 8; test_msg->tow = 407084800; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x205, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x205, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x205, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_dep_a_t* check_msg = ( msg_vel_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_dep_a_t* check_msg = + (msg_vel_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -34, "incorrect value for d, expected -34, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 2, "incorrect value for e, expected 2, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == 10, "incorrect value for n, expected 10, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084800, "incorrect value for tow, expected 407084800, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -34, + "incorrect value for d, expected -34, is %d", check_msg->d); + ck_assert_msg(check_msg->e == 2, "incorrect value for e, expected 2, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == 10, + "incorrect value for n, expected 10, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084800, + "incorrect value for tow, expected 407084800, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -923,17 +1154,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,2,195,4,22,100,159,67,24,248,255,255,255,254,255,255,255,7,0,0,0,0,0,0,0,8,0,255,236, }; + u8 encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 100, 159, 67, 24, 248, 255, 255, 255, 254, + 255, 255, 255, 7, 0, 0, 0, 0, 0, 0, 0, 8, 0, 255, 236, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; + msg_vel_ned_dep_a_t* test_msg = (msg_vel_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = 7; test_msg->e = -2; @@ -943,67 +1179,88 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) test_msg->n_sats = 8; test_msg->tow = 407084900; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x205, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x205, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x205, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_dep_a_t* check_msg = ( msg_vel_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_dep_a_t* check_msg = + (msg_vel_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == 7, "incorrect value for d, expected 7, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -2, "incorrect value for e, expected -2, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -8, "incorrect value for n, expected -8, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 8, "incorrect value for n_sats, expected 8, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407084900, "incorrect value for tow, expected 407084900, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == 7, "incorrect value for d, expected 7, is %d", + check_msg->d); + ck_assert_msg(check_msg->e == -2, + "incorrect value for e, expected -2, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -8, + "incorrect value for n, expected -8, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 8, + "incorrect value for n_sats, expected 8, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407084900, + "incorrect value for tow, expected 407084900, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -1011,17 +1268,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x205, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x205, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,2,195,4,22,46,162,68,24,255,255,255,255,253,255,255,255,148,255,255,255,0,0,0,0,5,0,166,189, }; + u8 encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 46, 162, 68, 24, 255, 255, 255, 255, 253, + 255, 255, 255, 148, 255, 255, 255, 0, 0, 0, 0, 5, 0, 166, 189, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; + msg_vel_ned_dep_a_t* test_msg = (msg_vel_ned_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -108; test_msg->e = -3; @@ -1031,70 +1293,92 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA ) test_msg->n_sats = 5; test_msg->tow = 407151150; test_msg->v_accuracy = 0; - sbp_payload_send(&sbp_state, 0x205, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x205, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x205, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_dep_a_t* check_msg = ( msg_vel_ned_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_dep_a_t* check_msg = + (msg_vel_ned_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -108, "incorrect value for d, expected -108, is %d", check_msg->d); - ck_assert_msg(check_msg->e == -3, "incorrect value for e, expected -3, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 0, "incorrect value for h_accuracy, expected 0, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -1, "incorrect value for n, expected -1, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 5, "incorrect value for n_sats, expected 5, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 407151150, "incorrect value for tow, expected 407151150, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 0, "incorrect value for v_accuracy, expected 0, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -108, + "incorrect value for d, expected -108, is %d", check_msg->d); + ck_assert_msg(check_msg->e == -3, + "incorrect value for e, expected -3, is %d", check_msg->e); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 0, + "incorrect value for h_accuracy, expected 0, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -1, + "incorrect value for n, expected -1, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 5, + "incorrect value for n_sats, expected 5, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 407151150, + "incorrect value for tow, expected 407151150, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 0, + "incorrect value for v_accuracy, expected 0, is %d", + check_msg->v_accuracy); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgVelNEDDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelNEDDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelNEDDepA"); +Suite* legacy_auto_check_sbp_navigation_MsgVelNEDDepA_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgVelNEDDepA"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelNEDDepA"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgVelNedCovGnss.c b/c/test/legacy/auto_check_sbp_navigation_MsgVelNedCovGnss.c index 881bc6aa0..40d41e4a6 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgVelNedCovGnss.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgVelNedCovGnss.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedCovGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedCovGnss.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,25 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x232, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x232, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x232, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x232, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,50,2,0,16,42,168,230,233,29,251,255,255,255,0,0,0,0,246,255,255,255,15,58,207,58,248,139,116,55,103,197,57,57,203,186,129,58,109,171,44,57,135,39,1,60,21,2,155,3, }; + u8 encoded_frame[] = { + 85, 50, 2, 0, 16, 42, 168, 230, 233, 29, 251, 255, 255, + 255, 0, 0, 0, 0, 246, 255, 255, 255, 15, 58, 207, 58, + 248, 139, 116, 55, 103, 197, 57, 57, 203, 186, 129, 58, 109, + 171, 44, 57, 135, 39, 1, 60, 21, 2, 155, 3, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_cov_gnss_t* test_msg = ( msg_vel_ned_cov_gnss_t* )test_msg_storage; + msg_vel_ned_cov_gnss_t *test_msg = + (msg_vel_ned_cov_gnss_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cov_d_d = 0.007882959209382534; test_msg->cov_e_d = 0.00016467059322167188; @@ -155,75 +160,112 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss ) test_msg->n = -5; test_msg->n_sats = 21; test_msg->tow = 501868200; - sbp_payload_send(&sbp_state, 0x232, 4096, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x232, 4096, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 4096, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x232, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_cov_gnss_t* check_msg = ( msg_vel_ned_cov_gnss_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_cov_gnss_t *check_msg = + (msg_vel_ned_cov_gnss_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->cov_d_d*100 - 0.00788295920938*100) < 0.05, "incorrect value for cov_d_d, expected 0.00788295920938, is %f", check_msg->cov_d_d); - ck_assert_msg((check_msg->cov_e_d*100 - 0.000164670593222*100) < 0.05, "incorrect value for cov_e_d, expected 0.000164670593222, is %f", check_msg->cov_e_d); - ck_assert_msg((check_msg->cov_e_e*100 - 0.000989758758806*100) < 0.05, "incorrect value for cov_e_e, expected 0.000989758758806, is %f", check_msg->cov_e_e); - ck_assert_msg((check_msg->cov_n_d*100 - 0.000177165129571*100) < 0.05, "incorrect value for cov_n_d, expected 0.000177165129571, is %f", check_msg->cov_n_d); - ck_assert_msg((check_msg->cov_n_e*100 - 1.45761223393e-05*100) < 0.05, "incorrect value for cov_n_e, expected 1.45761223393e-05, is %f", check_msg->cov_n_e); - ck_assert_msg((check_msg->cov_n_n*100 - 0.0015810149489*100) < 0.05, "incorrect value for cov_n_n, expected 0.0015810149489, is %f", check_msg->cov_n_n); - ck_assert_msg(check_msg->d == -10, "incorrect value for d, expected -10, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 0, "incorrect value for e, expected 0, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 2, "incorrect value for flags, expected 2, is %d", check_msg->flags); - ck_assert_msg(check_msg->n == -5, "incorrect value for n, expected -5, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 21, "incorrect value for n_sats, expected 21, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 501868200, "incorrect value for tow, expected 501868200, is %d", check_msg->tow); + ck_assert_msg( + (check_msg->cov_d_d * 100 - 0.00788295920938 * 100) < 0.05, + "incorrect value for cov_d_d, expected 0.00788295920938, is %f", + check_msg->cov_d_d); + ck_assert_msg( + (check_msg->cov_e_d * 100 - 0.000164670593222 * 100) < 0.05, + "incorrect value for cov_e_d, expected 0.000164670593222, is %f", + check_msg->cov_e_d); + ck_assert_msg( + (check_msg->cov_e_e * 100 - 0.000989758758806 * 100) < 0.05, + "incorrect value for cov_e_e, expected 0.000989758758806, is %f", + check_msg->cov_e_e); + ck_assert_msg( + (check_msg->cov_n_d * 100 - 0.000177165129571 * 100) < 0.05, + "incorrect value for cov_n_d, expected 0.000177165129571, is %f", + check_msg->cov_n_d); + ck_assert_msg( + (check_msg->cov_n_e * 100 - 1.45761223393e-05 * 100) < 0.05, + "incorrect value for cov_n_e, expected 1.45761223393e-05, is %f", + check_msg->cov_n_e); + ck_assert_msg( + (check_msg->cov_n_n * 100 - 0.0015810149489 * 100) < 0.05, + "incorrect value for cov_n_n, expected 0.0015810149489, is %f", + check_msg->cov_n_n); + ck_assert_msg(check_msg->d == -10, + "incorrect value for d, expected -10, is %d", check_msg->d); + ck_assert_msg(check_msg->e == 0, "incorrect value for e, expected 0, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 2, + "incorrect value for flags, expected 2, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n == -5, + "incorrect value for n, expected -5, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 21, + "incorrect value for n_sats, expected 21, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 501868200, + "incorrect value for tow, expected 501868200, is %d", + check_msg->tow); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgVelNedCovGnss_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelNedCovGnss"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss); +Suite *legacy_auto_check_sbp_navigation_MsgVelNedCovGnss_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgVelNedCovGnss"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_navigation_MsgVelNedGnss.c b/c/test/legacy/auto_check_sbp_navigation_MsgVelNedGnss.c index 3187da67c..c3e799fb0 100644 --- a/c/test/legacy/auto_check_sbp_navigation_MsgVelNedGnss.c +++ b/c/test/legacy/auto_check_sbp_navigation_MsgVelNedGnss.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedGnss.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNedGnss ) -{ +START_TEST(test_legacy_auto_check_sbp_navigation_MsgVelNedGnss) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNedGnss ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNedGnss ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x22e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x22e, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x22e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x22e, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,46,2,0,16,22,168,230,233,29,251,255,255,255,0,0,0,0,246,255,255,255,40,0,89,0,21,2,99,171, }; + u8 encoded_frame[] = { + 85, 46, 2, 0, 16, 22, 168, 230, 233, 29, 251, 255, 255, 255, 0, + 0, 0, 0, 246, 255, 255, 255, 40, 0, 89, 0, 21, 2, 99, 171, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_vel_ned_gnss_t* test_msg = ( msg_vel_ned_gnss_t* )test_msg_storage; + msg_vel_ned_gnss_t *test_msg = (msg_vel_ned_gnss_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->d = -10; test_msg->e = 0; @@ -151,70 +153,92 @@ START_TEST( test_legacy_auto_check_sbp_navigation_MsgVelNedGnss ) test_msg->n_sats = 21; test_msg->tow = 501868200; test_msg->v_accuracy = 89; - sbp_payload_send(&sbp_state, 0x22e, 4096, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x22e, 4096, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4096, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 4096, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x22e, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_vel_ned_gnss_t* check_msg = ( msg_vel_ned_gnss_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_vel_ned_gnss_t *check_msg = + (msg_vel_ned_gnss_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->d == -10, "incorrect value for d, expected -10, is %d", check_msg->d); - ck_assert_msg(check_msg->e == 0, "incorrect value for e, expected 0, is %d", check_msg->e); - ck_assert_msg(check_msg->flags == 2, "incorrect value for flags, expected 2, is %d", check_msg->flags); - ck_assert_msg(check_msg->h_accuracy == 40, "incorrect value for h_accuracy, expected 40, is %d", check_msg->h_accuracy); - ck_assert_msg(check_msg->n == -5, "incorrect value for n, expected -5, is %d", check_msg->n); - ck_assert_msg(check_msg->n_sats == 21, "incorrect value for n_sats, expected 21, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 501868200, "incorrect value for tow, expected 501868200, is %d", check_msg->tow); - ck_assert_msg(check_msg->v_accuracy == 89, "incorrect value for v_accuracy, expected 89, is %d", check_msg->v_accuracy); + ck_assert_msg(check_msg->d == -10, + "incorrect value for d, expected -10, is %d", check_msg->d); + ck_assert_msg(check_msg->e == 0, "incorrect value for e, expected 0, is %d", + check_msg->e); + ck_assert_msg(check_msg->flags == 2, + "incorrect value for flags, expected 2, is %d", + check_msg->flags); + ck_assert_msg(check_msg->h_accuracy == 40, + "incorrect value for h_accuracy, expected 40, is %d", + check_msg->h_accuracy); + ck_assert_msg(check_msg->n == -5, + "incorrect value for n, expected -5, is %d", check_msg->n); + ck_assert_msg(check_msg->n_sats == 21, + "incorrect value for n_sats, expected 21, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 501868200, + "incorrect value for tow, expected 501868200, is %d", + check_msg->tow); + ck_assert_msg(check_msg->v_accuracy == 89, + "incorrect value for v_accuracy, expected 89, is %d", + check_msg->v_accuracy); } } END_TEST -Suite* legacy_auto_check_sbp_navigation_MsgVelNedGnss_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_navigation_MsgVelNedGnss"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelNedGnss"); +Suite *legacy_auto_check_sbp_navigation_MsgVelNedGnss_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_navigation_MsgVelNedGnss"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_navigation_MsgVelNedGnss"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_navigation_MsgVelNedGnss); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_ndb_MsgNdbEvent.c b/c/test/legacy/auto_check_sbp_ndb_MsgNdbEvent.c index d58b2507c..b0076ae3f 100644 --- a/c/test/legacy/auto_check_sbp_ndb_MsgNdbEvent.c +++ b/c/test/legacy/auto_check_sbp_ndb_MsgNdbEvent.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ndb/test_MsgNdbEvent.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ndb/test_MsgNdbEvent.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ndb_MsgNdbEvent ) -{ +START_TEST(test_legacy_auto_check_sbp_ndb_MsgNdbEvent) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ndb_MsgNdbEvent ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_ndb_MsgNdbEvent ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x400, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x400, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x400, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x400, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,4,164,174,18,254,188,70,185,69,0,0,0,249,73,205,115,238,74,98,66,182,148,16,166, }; + u8 encoded_frame[] = { + 85, 0, 4, 164, 174, 18, 254, 188, 70, 185, 69, 0, 0, + 0, 249, 73, 205, 115, 238, 74, 98, 66, 182, 148, 16, 166, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ndb_event_t* test_msg = ( msg_ndb_event_t* )test_msg_storage; + msg_ndb_event_t *test_msg = (msg_ndb_event_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->data_source = 115; test_msg->event = 249; @@ -153,72 +155,99 @@ START_TEST( test_legacy_auto_check_sbp_ndb_MsgNdbEvent ) test_msg->result = 205; test_msg->src_sid.code = 66; test_msg->src_sid.sat = 98; - sbp_payload_send(&sbp_state, 0x400, 44708, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x400, 44708, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 44708, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 44708, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x400, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ndb_event_t* check_msg = ( msg_ndb_event_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ndb_event_t *check_msg = (msg_ndb_event_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->data_source == 115, "incorrect value for data_source, expected 115, is %d", check_msg->data_source); - ck_assert_msg(check_msg->event == 249, "incorrect value for event, expected 249, is %d", check_msg->event); - ck_assert_msg(check_msg->object_sid.code == 74, "incorrect value for object_sid.code, expected 74, is %d", check_msg->object_sid.code); - ck_assert_msg(check_msg->object_sid.sat == 238, "incorrect value for object_sid.sat, expected 238, is %d", check_msg->object_sid.sat); - ck_assert_msg(check_msg->object_type == 73, "incorrect value for object_type, expected 73, is %d", check_msg->object_type); - ck_assert_msg(check_msg->original_sender == 38070, "incorrect value for original_sender, expected 38070, is %d", check_msg->original_sender); - ck_assert_msg(check_msg->recv_time == 299461164286, "incorrect value for recv_time, expected 299461164286, is %d", check_msg->recv_time); - ck_assert_msg(check_msg->result == 205, "incorrect value for result, expected 205, is %d", check_msg->result); - ck_assert_msg(check_msg->src_sid.code == 66, "incorrect value for src_sid.code, expected 66, is %d", check_msg->src_sid.code); - ck_assert_msg(check_msg->src_sid.sat == 98, "incorrect value for src_sid.sat, expected 98, is %d", check_msg->src_sid.sat); + ck_assert_msg(check_msg->data_source == 115, + "incorrect value for data_source, expected 115, is %d", + check_msg->data_source); + ck_assert_msg(check_msg->event == 249, + "incorrect value for event, expected 249, is %d", + check_msg->event); + ck_assert_msg(check_msg->object_sid.code == 74, + "incorrect value for object_sid.code, expected 74, is %d", + check_msg->object_sid.code); + ck_assert_msg(check_msg->object_sid.sat == 238, + "incorrect value for object_sid.sat, expected 238, is %d", + check_msg->object_sid.sat); + ck_assert_msg(check_msg->object_type == 73, + "incorrect value for object_type, expected 73, is %d", + check_msg->object_type); + ck_assert_msg(check_msg->original_sender == 38070, + "incorrect value for original_sender, expected 38070, is %d", + check_msg->original_sender); + ck_assert_msg(check_msg->recv_time == 299461164286, + "incorrect value for recv_time, expected 299461164286, is %d", + check_msg->recv_time); + ck_assert_msg(check_msg->result == 205, + "incorrect value for result, expected 205, is %d", + check_msg->result); + ck_assert_msg(check_msg->src_sid.code == 66, + "incorrect value for src_sid.code, expected 66, is %d", + check_msg->src_sid.code); + ck_assert_msg(check_msg->src_sid.sat == 98, + "incorrect value for src_sid.sat, expected 98, is %d", + check_msg->src_sid.sat); } } END_TEST -Suite* legacy_auto_check_sbp_ndb_MsgNdbEvent_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ndb_MsgNdbEvent"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ndb_MsgNdbEvent"); +Suite *legacy_auto_check_sbp_ndb_MsgNdbEvent_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_ndb_MsgNdbEvent"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_ndb_MsgNdbEvent"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ndb_MsgNdbEvent); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGLO.c b/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGLO.c index 2e07afa14..7113de645 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGLO.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGLO.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLO.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLO.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGLO ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgAlmanacGLO) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGLO ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,27 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGLO ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x73, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x73, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x73, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x73, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,115,0,195,4,78,22,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,155,87, }; + u8 encoded_frame[] = { + 85, 115, 0, 195, 4, 78, 22, 0, 176, 207, 6, 0, 106, + 8, 154, 153, 153, 153, 153, 153, 1, 64, 64, 56, 0, 0, + 1, 0, 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, + 32, 191, 247, 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, + 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, 54, 204, + 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, 71, 11, + 217, 147, 145, 228, 237, 63, 155, 87, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_almanac_glo_t* test_msg = ( msg_almanac_glo_t* )test_msg_storage; + msg_almanac_glo_t *test_msg = (msg_almanac_glo_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->common.fit_interval = 14400; test_msg->common.health_bits = 0; @@ -158,77 +165,119 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGLO ) test_msg->t = -1.8731818448797617; test_msg->t_dot = -8.903585155774196e-09; test_msg->t_lambda_na = 0.007072207052260637; - sbp_payload_send(&sbp_state, 0x73, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x73, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x73, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_almanac_glo_t* check_msg = ( msg_almanac_glo_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_almanac_glo_t *check_msg = (msg_almanac_glo_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->common.fit_interval == 14400, "incorrect value for common.fit_interval, expected 14400, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 0, "incorrect value for common.sid.code, expected 0, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.sat == 22, "incorrect value for common.sid.sat, expected 22, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toa.tow == 446384, "incorrect value for common.toa.tow, expected 446384, is %d", check_msg->common.toa.tow); - ck_assert_msg(check_msg->common.toa.wn == 2154, "incorrect value for common.toa.wn, expected 2154, is %d", check_msg->common.toa.wn); - ck_assert_msg((check_msg->common.ura*100 - 2.2*100) < 0.05, "incorrect value for common.ura, expected 2.2, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->epsilon*100 - -0.98930366296*100) < 0.05, "incorrect value for epsilon, expected -0.98930366296, is %f", check_msg->epsilon); - ck_assert_msg((check_msg->i*100 - 5153.55002975*100) < 0.05, "incorrect value for i, expected 5153.55002975, is %f", check_msg->i); - ck_assert_msg((check_msg->lambda_na*100 - -0.0220007884211*100) < 0.05, "incorrect value for lambda_na, expected -0.0220007884211, is %f", check_msg->lambda_na); - ck_assert_msg((check_msg->omega*100 - 0.934151448026*100) < 0.05, "incorrect value for omega, expected 0.934151448026, is %f", check_msg->omega); - ck_assert_msg((check_msg->t*100 - -1.87318184488*100) < 0.05, "incorrect value for t, expected -1.87318184488, is %f", check_msg->t); - ck_assert_msg((check_msg->t_dot*100 - -8.90358515577e-09*100) < 0.05, "incorrect value for t_dot, expected -8.90358515577e-09, is %f", check_msg->t_dot); - ck_assert_msg((check_msg->t_lambda_na*100 - 0.00707220705226*100) < 0.05, "incorrect value for t_lambda_na, expected 0.00707220705226, is %f", check_msg->t_lambda_na); + ck_assert_msg( + check_msg->common.fit_interval == 14400, + "incorrect value for common.fit_interval, expected 14400, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 0, + "incorrect value for common.sid.code, expected 0, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.sat == 22, + "incorrect value for common.sid.sat, expected 22, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toa.tow == 446384, + "incorrect value for common.toa.tow, expected 446384, is %d", + check_msg->common.toa.tow); + ck_assert_msg(check_msg->common.toa.wn == 2154, + "incorrect value for common.toa.wn, expected 2154, is %d", + check_msg->common.toa.wn); + ck_assert_msg((check_msg->common.ura * 100 - 2.2 * 100) < 0.05, + "incorrect value for common.ura, expected 2.2, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg((check_msg->epsilon * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for epsilon, expected -0.98930366296, is %f", + check_msg->epsilon); + ck_assert_msg((check_msg->i * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for i, expected 5153.55002975, is %f", + check_msg->i); + ck_assert_msg( + (check_msg->lambda_na * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for lambda_na, expected -0.0220007884211, is %f", + check_msg->lambda_na); + ck_assert_msg((check_msg->omega * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for omega, expected 0.934151448026, is %f", + check_msg->omega); + ck_assert_msg((check_msg->t * 100 - -1.87318184488 * 100) < 0.05, + "incorrect value for t, expected -1.87318184488, is %f", + check_msg->t); + ck_assert_msg( + (check_msg->t_dot * 100 - -8.90358515577e-09 * 100) < 0.05, + "incorrect value for t_dot, expected -8.90358515577e-09, is %f", + check_msg->t_dot); + ck_assert_msg( + (check_msg->t_lambda_na * 100 - 0.00707220705226 * 100) < 0.05, + "incorrect value for t_lambda_na, expected 0.00707220705226, is %f", + check_msg->t_lambda_na); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgAlmanacGLO_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgAlmanacGLO"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgAlmanacGLO"); +Suite *legacy_auto_check_sbp_observation_MsgAlmanacGLO_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgAlmanacGLO"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgAlmanacGLO"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgAlmanacGLO); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGLODep.c b/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGLODep.c index 7d58b149e..f92487741 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGLODep.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGLODep.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLODep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLODep.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGLODep ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgAlmanacGLODep) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGLODep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,27 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGLODep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x71, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x71, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x71, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x71, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,113,0,195,4,80,22,0,0,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,203,178, }; + u8 encoded_frame[] = { + 85, 113, 0, 195, 4, 80, 22, 0, 0, 0, 176, 207, 6, + 0, 106, 8, 154, 153, 153, 153, 153, 153, 1, 64, 64, 56, + 0, 0, 1, 0, 142, 41, 5, 235, 95, 135, 150, 191, 0, + 0, 0, 32, 191, 247, 124, 63, 0, 0, 192, 206, 140, 33, + 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, + 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, + 71, 11, 217, 147, 145, 228, 237, 63, 203, 178, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_almanac_glo_dep_t* test_msg = ( msg_almanac_glo_dep_t* )test_msg_storage; + msg_almanac_glo_dep_t *test_msg = (msg_almanac_glo_dep_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->common.fit_interval = 14400; test_msg->common.health_bits = 0; @@ -159,79 +166,125 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGLODep ) test_msg->t = -1.8731818448797617; test_msg->t_dot = -8.903585155774196e-09; test_msg->t_lambda_na = 0.007072207052260637; - sbp_payload_send(&sbp_state, 0x71, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x71, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x71, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_almanac_glo_dep_t* check_msg = ( msg_almanac_glo_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_almanac_glo_dep_t *check_msg = + (msg_almanac_glo_dep_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->common.fit_interval == 14400, "incorrect value for common.fit_interval, expected 14400, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 0, "incorrect value for common.sid.code, expected 0, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.reserved == 0, "incorrect value for common.sid.reserved, expected 0, is %d", check_msg->common.sid.reserved); - ck_assert_msg(check_msg->common.sid.sat == 22, "incorrect value for common.sid.sat, expected 22, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toa.tow == 446384, "incorrect value for common.toa.tow, expected 446384, is %d", check_msg->common.toa.tow); - ck_assert_msg(check_msg->common.toa.wn == 2154, "incorrect value for common.toa.wn, expected 2154, is %d", check_msg->common.toa.wn); - ck_assert_msg((check_msg->common.ura*100 - 2.2*100) < 0.05, "incorrect value for common.ura, expected 2.2, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->epsilon*100 - -0.98930366296*100) < 0.05, "incorrect value for epsilon, expected -0.98930366296, is %f", check_msg->epsilon); - ck_assert_msg((check_msg->i*100 - 5153.55002975*100) < 0.05, "incorrect value for i, expected 5153.55002975, is %f", check_msg->i); - ck_assert_msg((check_msg->lambda_na*100 - -0.0220007884211*100) < 0.05, "incorrect value for lambda_na, expected -0.0220007884211, is %f", check_msg->lambda_na); - ck_assert_msg((check_msg->omega*100 - 0.934151448026*100) < 0.05, "incorrect value for omega, expected 0.934151448026, is %f", check_msg->omega); - ck_assert_msg((check_msg->t*100 - -1.87318184488*100) < 0.05, "incorrect value for t, expected -1.87318184488, is %f", check_msg->t); - ck_assert_msg((check_msg->t_dot*100 - -8.90358515577e-09*100) < 0.05, "incorrect value for t_dot, expected -8.90358515577e-09, is %f", check_msg->t_dot); - ck_assert_msg((check_msg->t_lambda_na*100 - 0.00707220705226*100) < 0.05, "incorrect value for t_lambda_na, expected 0.00707220705226, is %f", check_msg->t_lambda_na); + ck_assert_msg( + check_msg->common.fit_interval == 14400, + "incorrect value for common.fit_interval, expected 14400, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 0, + "incorrect value for common.sid.code, expected 0, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.reserved == 0, + "incorrect value for common.sid.reserved, expected 0, is %d", + check_msg->common.sid.reserved); + ck_assert_msg(check_msg->common.sid.sat == 22, + "incorrect value for common.sid.sat, expected 22, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toa.tow == 446384, + "incorrect value for common.toa.tow, expected 446384, is %d", + check_msg->common.toa.tow); + ck_assert_msg(check_msg->common.toa.wn == 2154, + "incorrect value for common.toa.wn, expected 2154, is %d", + check_msg->common.toa.wn); + ck_assert_msg((check_msg->common.ura * 100 - 2.2 * 100) < 0.05, + "incorrect value for common.ura, expected 2.2, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg((check_msg->epsilon * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for epsilon, expected -0.98930366296, is %f", + check_msg->epsilon); + ck_assert_msg((check_msg->i * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for i, expected 5153.55002975, is %f", + check_msg->i); + ck_assert_msg( + (check_msg->lambda_na * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for lambda_na, expected -0.0220007884211, is %f", + check_msg->lambda_na); + ck_assert_msg((check_msg->omega * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for omega, expected 0.934151448026, is %f", + check_msg->omega); + ck_assert_msg((check_msg->t * 100 - -1.87318184488 * 100) < 0.05, + "incorrect value for t, expected -1.87318184488, is %f", + check_msg->t); + ck_assert_msg( + (check_msg->t_dot * 100 - -8.90358515577e-09 * 100) < 0.05, + "incorrect value for t_dot, expected -8.90358515577e-09, is %f", + check_msg->t_dot); + ck_assert_msg( + (check_msg->t_lambda_na * 100 - 0.00707220705226 * 100) < 0.05, + "incorrect value for t_lambda_na, expected 0.00707220705226, is %f", + check_msg->t_lambda_na); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgAlmanacGLODep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgAlmanacGLODep"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgAlmanacGLODep"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgAlmanacGLODep); +Suite *legacy_auto_check_sbp_observation_MsgAlmanacGLODep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgAlmanacGLODep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgAlmanacGLODep"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgAlmanacGLODep); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGPS.c b/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGPS.c index 0f5e589a3..b12082577 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGPS.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGPS.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPS.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGPS ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgAlmanacGPS) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGPS ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,28 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGPS ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x72, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x72, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x72, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x72, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,114,0,195,4,94,22,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,190,45, }; + u8 encoded_frame[] = { + 85, 114, 0, 195, 4, 94, 22, 0, 176, 207, 6, 0, 106, + 8, 154, 153, 153, 153, 153, 153, 1, 64, 64, 56, 0, 0, + 1, 0, 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, + 32, 191, 247, 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, + 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, 54, 204, + 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, 71, 11, + 217, 147, 145, 228, 237, 63, 0, 0, 0, 0, 108, 177, 68, + 191, 0, 0, 0, 0, 0, 192, 163, 61, 190, 45, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_almanac_gps_t* test_msg = ( msg_almanac_gps_t* )test_msg_storage; + msg_almanac_gps_t *test_msg = (msg_almanac_gps_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = -0.0006315018981695175; test_msg->af1 = 8.981260180007666e-12; @@ -160,79 +168,123 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGPS ) test_msg->omegadot = -8.903585155774196e-09; test_msg->sqrta = 5153.550029754639; test_msg->w = -0.9893036629599647; - sbp_payload_send(&sbp_state, 0x72, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x72, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x72, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_almanac_gps_t* check_msg = ( msg_almanac_gps_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_almanac_gps_t *check_msg = (msg_almanac_gps_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - -0.00063150189817*100) < 0.05, "incorrect value for af0, expected -0.00063150189817, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - 8.98126018001e-12*100) < 0.05, "incorrect value for af1, expected 8.98126018001e-12, is %f", check_msg->af1); - ck_assert_msg(check_msg->common.fit_interval == 14400, "incorrect value for common.fit_interval, expected 14400, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 0, "incorrect value for common.sid.code, expected 0, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.sat == 22, "incorrect value for common.sid.sat, expected 22, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toa.tow == 446384, "incorrect value for common.toa.tow, expected 446384, is %d", check_msg->common.toa.tow); - ck_assert_msg(check_msg->common.toa.wn == 2154, "incorrect value for common.toa.wn, expected 2154, is %d", check_msg->common.toa.wn); - ck_assert_msg((check_msg->common.ura*100 - 2.2*100) < 0.05, "incorrect value for common.ura, expected 2.2, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->ecc*100 - 0.00707220705226*100) < 0.05, "incorrect value for ecc, expected 0.00707220705226, is %f", check_msg->ecc); - ck_assert_msg((check_msg->inc*100 - 0.934151448026*100) < 0.05, "incorrect value for inc, expected 0.934151448026, is %f", check_msg->inc); - ck_assert_msg((check_msg->m0*100 - -0.0220007884211*100) < 0.05, "incorrect value for m0, expected -0.0220007884211, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - -1.87318184488*100) < 0.05, "incorrect value for omega0, expected -1.87318184488, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -8.90358515577e-09*100) < 0.05, "incorrect value for omegadot, expected -8.90358515577e-09, is %f", check_msg->omegadot); - ck_assert_msg((check_msg->sqrta*100 - 5153.55002975*100) < 0.05, "incorrect value for sqrta, expected 5153.55002975, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->w*100 - -0.98930366296*100) < 0.05, "incorrect value for w, expected -0.98930366296, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - -0.00063150189817 * 100) < 0.05, + "incorrect value for af0, expected -0.00063150189817, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - 8.98126018001e-12 * 100) < 0.05, + "incorrect value for af1, expected 8.98126018001e-12, is %f", + check_msg->af1); + ck_assert_msg( + check_msg->common.fit_interval == 14400, + "incorrect value for common.fit_interval, expected 14400, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 0, + "incorrect value for common.sid.code, expected 0, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.sat == 22, + "incorrect value for common.sid.sat, expected 22, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toa.tow == 446384, + "incorrect value for common.toa.tow, expected 446384, is %d", + check_msg->common.toa.tow); + ck_assert_msg(check_msg->common.toa.wn == 2154, + "incorrect value for common.toa.wn, expected 2154, is %d", + check_msg->common.toa.wn); + ck_assert_msg((check_msg->common.ura * 100 - 2.2 * 100) < 0.05, + "incorrect value for common.ura, expected 2.2, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg((check_msg->ecc * 100 - 0.00707220705226 * 100) < 0.05, + "incorrect value for ecc, expected 0.00707220705226, is %f", + check_msg->ecc); + ck_assert_msg((check_msg->inc * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for inc, expected 0.934151448026, is %f", + check_msg->inc); + ck_assert_msg((check_msg->m0 * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for m0, expected -0.0220007884211, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - -1.87318184488 * 100) < 0.05, + "incorrect value for omega0, expected -1.87318184488, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -8.90358515577e-09, is %f", + check_msg->omegadot); + ck_assert_msg((check_msg->sqrta * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for sqrta, expected 5153.55002975, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->w * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for w, expected -0.98930366296, is %f", + check_msg->w); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgAlmanacGPS_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgAlmanacGPS"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgAlmanacGPS"); +Suite *legacy_auto_check_sbp_observation_MsgAlmanacGPS_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgAlmanacGPS"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgAlmanacGPS"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgAlmanacGPS); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGPSDep.c b/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGPSDep.c index 5d1c9b76e..21be5290c 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGPSDep.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgAlmanacGPSDep.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPSDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPSDep.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,28 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x70, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x70, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x70, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x70, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,112,0,195,4,96,22,0,0,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,144,232, }; + u8 encoded_frame[] = { + 85, 112, 0, 195, 4, 96, 22, 0, 0, 0, 176, 207, 6, + 0, 106, 8, 154, 153, 153, 153, 153, 153, 1, 64, 64, 56, + 0, 0, 1, 0, 142, 41, 5, 235, 95, 135, 150, 191, 0, + 0, 0, 32, 191, 247, 124, 63, 0, 0, 192, 206, 140, 33, + 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, + 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, + 71, 11, 217, 147, 145, 228, 237, 63, 0, 0, 0, 0, 108, + 177, 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 144, 232, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_almanac_gps_dep_t* test_msg = ( msg_almanac_gps_dep_t* )test_msg_storage; + msg_almanac_gps_dep_t *test_msg = (msg_almanac_gps_dep_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = -0.0006315018981695175; test_msg->af1 = 8.981260180007666e-12; @@ -161,81 +169,129 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep ) test_msg->omegadot = -8.903585155774196e-09; test_msg->sqrta = 5153.550029754639; test_msg->w = -0.9893036629599647; - sbp_payload_send(&sbp_state, 0x70, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x70, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x70, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_almanac_gps_dep_t* check_msg = ( msg_almanac_gps_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_almanac_gps_dep_t *check_msg = + (msg_almanac_gps_dep_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - -0.00063150189817*100) < 0.05, "incorrect value for af0, expected -0.00063150189817, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - 8.98126018001e-12*100) < 0.05, "incorrect value for af1, expected 8.98126018001e-12, is %f", check_msg->af1); - ck_assert_msg(check_msg->common.fit_interval == 14400, "incorrect value for common.fit_interval, expected 14400, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 0, "incorrect value for common.sid.code, expected 0, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.reserved == 0, "incorrect value for common.sid.reserved, expected 0, is %d", check_msg->common.sid.reserved); - ck_assert_msg(check_msg->common.sid.sat == 22, "incorrect value for common.sid.sat, expected 22, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toa.tow == 446384, "incorrect value for common.toa.tow, expected 446384, is %d", check_msg->common.toa.tow); - ck_assert_msg(check_msg->common.toa.wn == 2154, "incorrect value for common.toa.wn, expected 2154, is %d", check_msg->common.toa.wn); - ck_assert_msg((check_msg->common.ura*100 - 2.2*100) < 0.05, "incorrect value for common.ura, expected 2.2, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->ecc*100 - 0.00707220705226*100) < 0.05, "incorrect value for ecc, expected 0.00707220705226, is %f", check_msg->ecc); - ck_assert_msg((check_msg->inc*100 - 0.934151448026*100) < 0.05, "incorrect value for inc, expected 0.934151448026, is %f", check_msg->inc); - ck_assert_msg((check_msg->m0*100 - -0.0220007884211*100) < 0.05, "incorrect value for m0, expected -0.0220007884211, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - -1.87318184488*100) < 0.05, "incorrect value for omega0, expected -1.87318184488, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -8.90358515577e-09*100) < 0.05, "incorrect value for omegadot, expected -8.90358515577e-09, is %f", check_msg->omegadot); - ck_assert_msg((check_msg->sqrta*100 - 5153.55002975*100) < 0.05, "incorrect value for sqrta, expected 5153.55002975, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->w*100 - -0.98930366296*100) < 0.05, "incorrect value for w, expected -0.98930366296, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - -0.00063150189817 * 100) < 0.05, + "incorrect value for af0, expected -0.00063150189817, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - 8.98126018001e-12 * 100) < 0.05, + "incorrect value for af1, expected 8.98126018001e-12, is %f", + check_msg->af1); + ck_assert_msg( + check_msg->common.fit_interval == 14400, + "incorrect value for common.fit_interval, expected 14400, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 0, + "incorrect value for common.sid.code, expected 0, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.reserved == 0, + "incorrect value for common.sid.reserved, expected 0, is %d", + check_msg->common.sid.reserved); + ck_assert_msg(check_msg->common.sid.sat == 22, + "incorrect value for common.sid.sat, expected 22, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toa.tow == 446384, + "incorrect value for common.toa.tow, expected 446384, is %d", + check_msg->common.toa.tow); + ck_assert_msg(check_msg->common.toa.wn == 2154, + "incorrect value for common.toa.wn, expected 2154, is %d", + check_msg->common.toa.wn); + ck_assert_msg((check_msg->common.ura * 100 - 2.2 * 100) < 0.05, + "incorrect value for common.ura, expected 2.2, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg((check_msg->ecc * 100 - 0.00707220705226 * 100) < 0.05, + "incorrect value for ecc, expected 0.00707220705226, is %f", + check_msg->ecc); + ck_assert_msg((check_msg->inc * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for inc, expected 0.934151448026, is %f", + check_msg->inc); + ck_assert_msg((check_msg->m0 * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for m0, expected -0.0220007884211, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - -1.87318184488 * 100) < 0.05, + "incorrect value for omega0, expected -1.87318184488, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -8.90358515577e-09, is %f", + check_msg->omegadot); + ck_assert_msg((check_msg->sqrta * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for sqrta, expected 5153.55002975, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->w * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for w, expected -0.98930366296, is %f", + check_msg->w); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgAlmanacGPSDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgAlmanacGPSDep"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep); +Suite *legacy_auto_check_sbp_observation_MsgAlmanacGPSDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgAlmanacGPSDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgBasePosEcef.c b/c/test/legacy/auto_check_sbp_observation_MsgBasePosEcef.c index 9acc670ec..c733f8b34 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgBasePosEcef.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgBasePosEcef.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosEcef.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosEcef.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgBasePosEcef ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgBasePosEcef) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgBasePosEcef ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,80 +128,101 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgBasePosEcef ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x48, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x48, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x48, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x48, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,72,0,0,0,24,228,131,158,245,87,205,68,193,66,62,232,209,32,118,80,193,213,231,106,251,63,20,77,65,194,125, }; + u8 encoded_frame[] = { + 85, 72, 0, 0, 0, 24, 228, 131, 158, 245, 87, + 205, 68, 193, 66, 62, 232, 209, 32, 118, 80, 193, + 213, 231, 106, 251, 63, 20, 77, 65, 194, 125, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_base_pos_ecef_t* test_msg = ( msg_base_pos_ecef_t* )test_msg_storage; + msg_base_pos_ecef_t *test_msg = (msg_base_pos_ecef_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->x = -2726575.9189; test_msg->y = -4315267.2798; test_msg->z = 3811455.9642; - sbp_payload_send(&sbp_state, 0x48, 0, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x48, 0, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 0, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x48, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_base_pos_ecef_t* check_msg = ( msg_base_pos_ecef_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_base_pos_ecef_t *check_msg = + (msg_base_pos_ecef_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->x*100 - -2726575.9189*100) < 0.05, "incorrect value for x, expected -2726575.9189, is %f", check_msg->x); - ck_assert_msg((check_msg->y*100 - -4315267.2798*100) < 0.05, "incorrect value for y, expected -4315267.2798, is %f", check_msg->y); - ck_assert_msg((check_msg->z*100 - 3811455.9642*100) < 0.05, "incorrect value for z, expected 3811455.9642, is %f", check_msg->z); + ck_assert_msg((check_msg->x * 100 - -2726575.9189 * 100) < 0.05, + "incorrect value for x, expected -2726575.9189, is %f", + check_msg->x); + ck_assert_msg((check_msg->y * 100 - -4315267.2798 * 100) < 0.05, + "incorrect value for y, expected -4315267.2798, is %f", + check_msg->y); + ck_assert_msg((check_msg->z * 100 - 3811455.9642 * 100) < 0.05, + "incorrect value for z, expected 3811455.9642, is %f", + check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgBasePosEcef_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgBasePosEcef"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgBasePosEcef"); +Suite *legacy_auto_check_sbp_observation_MsgBasePosEcef_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgBasePosEcef"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgBasePosEcef"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgBasePosEcef); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_observation_MsgBasePosLLH.c b/c/test/legacy/auto_check_sbp_observation_MsgBasePosLLH.c index dda959a22..15503dccb 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgBasePosLLH.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgBasePosLLH.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosLLH.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosLLH.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgBasePosLLH ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgBasePosLLH) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgBasePosLLH ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,80 +128,100 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgBasePosLLH ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x44, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x44, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x44, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x44, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,68,0,123,0,24,225,237,238,90,42,160,66,64,59,143,70,235,0,120,94,192,51,181,124,240,65,248,66,64,82,230, }; + u8 encoded_frame[] = { + 85, 68, 0, 123, 0, 24, 225, 237, 238, 90, 42, 160, 66, 64, 59, 143, + 70, 235, 0, 120, 94, 192, 51, 181, 124, 240, 65, 248, 66, 64, 82, 230, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_base_pos_llh_t* test_msg = ( msg_base_pos_llh_t* )test_msg_storage; + msg_base_pos_llh_t *test_msg = (msg_base_pos_llh_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->height = 37.939512310879216; test_msg->lat = 37.251292578377395; test_msg->lon = -121.87505609407974; - sbp_payload_send(&sbp_state, 0x44, 123, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x44, 123, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 123, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x44, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_base_pos_llh_t* check_msg = ( msg_base_pos_llh_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_base_pos_llh_t *check_msg = + (msg_base_pos_llh_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->height*100 - 37.9395123109*100) < 0.05, "incorrect value for height, expected 37.9395123109, is %f", check_msg->height); - ck_assert_msg((check_msg->lat*100 - 37.2512925784*100) < 0.05, "incorrect value for lat, expected 37.2512925784, is %f", check_msg->lat); - ck_assert_msg((check_msg->lon*100 - -121.875056094*100) < 0.05, "incorrect value for lon, expected -121.875056094, is %f", check_msg->lon); + ck_assert_msg((check_msg->height * 100 - 37.9395123109 * 100) < 0.05, + "incorrect value for height, expected 37.9395123109, is %f", + check_msg->height); + ck_assert_msg((check_msg->lat * 100 - 37.2512925784 * 100) < 0.05, + "incorrect value for lat, expected 37.2512925784, is %f", + check_msg->lat); + ck_assert_msg((check_msg->lon * 100 - -121.875056094 * 100) < 0.05, + "incorrect value for lon, expected -121.875056094, is %f", + check_msg->lon); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgBasePosLLH_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgBasePosLLH"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgBasePosLLH"); +Suite *legacy_auto_check_sbp_observation_MsgBasePosLLH_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgBasePosLLH"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgBasePosLLH"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgBasePosLLH); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisBds.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisBds.c index 9c522a7ee..9ea27e5ba 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisBds.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisBds.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisBds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisBds.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisBds ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisBds) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisBds ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,32 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisBds ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x89, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x89, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x89, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x89, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,137,0,128,240,147,8,12,174,179,6,0,106,8,0,0,0,64,48,42,0,0,1,0,125,99,52,50,207,46,151,176,0,112,96,67,0,164,106,67,0,60,255,54,0,224,47,53,0,0,143,179,0,192,190,52,146,101,162,196,109,104,19,62,253,87,86,202,62,28,251,63,0,0,0,96,151,60,117,63,0,0,128,154,127,93,185,64,151,193,64,0,10,166,4,192,160,75,174,98,8,201,35,190,205,29,12,71,189,150,5,192,176,72,249,189,193,172,240,63,72,249,188,180,160,203,9,62,0,0,0,0,92,51,77,191,0,128,174,43,0,0,88,161,174,179,6,0,106,8,6,5,0,157,249, }; + u8 encoded_frame[] = { + 85, 137, 0, 128, 240, 147, 8, 12, 174, 179, 6, 0, 106, + 8, 0, 0, 0, 64, 48, 42, 0, 0, 1, 0, 125, 99, + 52, 50, 207, 46, 151, 176, 0, 112, 96, 67, 0, 164, 106, + 67, 0, 60, 255, 54, 0, 224, 47, 53, 0, 0, 143, 179, + 0, 192, 190, 52, 146, 101, 162, 196, 109, 104, 19, 62, 253, + 87, 86, 202, 62, 28, 251, 63, 0, 0, 0, 96, 151, 60, + 117, 63, 0, 0, 128, 154, 127, 93, 185, 64, 151, 193, 64, + 0, 10, 166, 4, 192, 160, 75, 174, 98, 8, 201, 35, 190, + 205, 29, 12, 71, 189, 150, 5, 192, 176, 72, 249, 189, 193, + 172, 240, 63, 72, 249, 188, 180, 160, 203, 9, 62, 0, 0, + 0, 0, 92, 51, 77, 191, 0, 128, 174, 43, 0, 0, 88, + 161, 174, 179, 6, 0, 106, 8, 6, 5, 0, 157, 249, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_bds_t* test_msg = ( msg_ephemeris_bds_t* )test_msg_storage; + msg_ephemeris_bds_t *test_msg = (msg_ephemeris_bds_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = -0.0008911322802305222; test_msg->af1 = 1.2398970739013748e-12; @@ -175,95 +187,173 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisBds ) test_msg->toc.tow = 439214; test_msg->toc.wn = 2154; test_msg->w = -2.698603205735458; - sbp_payload_send(&sbp_state, 0x89, 61568, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x89, 61568, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61568, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 61568, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x89, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_bds_t* check_msg = ( msg_ephemeris_bds_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_bds_t *check_msg = + (msg_ephemeris_bds_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - -0.000891132280231*100) < 0.05, "incorrect value for af0, expected -0.000891132280231, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - 1.2398970739e-12*100) < 0.05, "incorrect value for af1, expected 1.2398970739e-12, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - -7.31836466428e-19*100) < 0.05, "incorrect value for af2, expected -7.31836466428e-19, is %f", check_msg->af2); - ck_assert_msg((check_msg->c_ic*100 - -6.6589564085e-08*100) < 0.05, "incorrect value for c_ic, expected -6.6589564085e-08, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - 3.55299562216e-07*100) < 0.05, "incorrect value for c_is, expected 3.55299562216e-07, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - 234.640625*100) < 0.05, "incorrect value for c_rc, expected 234.640625, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - 224.4375*100) < 0.05, "incorrect value for c_rs, expected 224.4375, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - 7.60657712817e-06*100) < 0.05, "incorrect value for c_uc, expected 7.60657712817e-06, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 6.55185431242e-07*100) < 0.05, "incorrect value for c_us, expected 6.55185431242e-07, is %f", check_msg->c_us); - ck_assert_msg(check_msg->common.fit_interval == 10800, "incorrect value for common.fit_interval, expected 10800, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 12, "incorrect value for common.sid.code, expected 12, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.sat == 8, "incorrect value for common.sid.sat, expected 8, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toe.tow == 439214, "incorrect value for common.toe.tow, expected 439214, is %d", check_msg->common.toe.tow); - ck_assert_msg(check_msg->common.toe.wn == 2154, "incorrect value for common.toe.wn, expected 2154, is %d", check_msg->common.toe.wn); - ck_assert_msg((check_msg->common.ura*100 - 2.0*100) < 0.05, "incorrect value for common.ura, expected 2.0, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->dn*100 - 1.12968991326e-09*100) < 0.05, "incorrect value for dn, expected 1.12968991326e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.0051847374998*100) < 0.05, "incorrect value for ecc, expected 0.0051847374998, is %f", check_msg->ecc); - ck_assert_msg((check_msg->inc*100 - 1.04217695435*100) < 0.05, "incorrect value for inc, expected 1.04217695435, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - 7.5074555728e-10*100) < 0.05, "incorrect value for inc_dot, expected 7.5074555728e-10, is %f", check_msg->inc_dot); - ck_assert_msg(check_msg->iodc == 5, "incorrect value for iodc, expected 5, is %d", check_msg->iodc); - ck_assert_msg(check_msg->iode == 6, "incorrect value for iode, expected 6, is %d", check_msg->iode); - ck_assert_msg((check_msg->m0*100 - 1.69439581907*100) < 0.05, "incorrect value for m0, expected 1.69439581907, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - -2.58107376287*100) < 0.05, "incorrect value for omega0, expected -2.58107376287, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -2.30331022783e-09*100) < 0.05, "incorrect value for omegadot, expected -2.30331022783e-09, is %f", check_msg->omegadot); - ck_assert_msg((check_msg->sqrta*100 - 6493.49845123*100) < 0.05, "incorrect value for sqrta, expected 6493.49845123, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->tgd1*100 - 1.04999999806e-08*100) < 0.05, "incorrect value for tgd1, expected 1.04999999806e-08, is %f", check_msg->tgd1); - ck_assert_msg((check_msg->tgd2*100 - -1.09999997999e-09*100) < 0.05, "incorrect value for tgd2, expected -1.09999997999e-09, is %f", check_msg->tgd2); - ck_assert_msg(check_msg->toc.tow == 439214, "incorrect value for toc.tow, expected 439214, is %d", check_msg->toc.tow); - ck_assert_msg(check_msg->toc.wn == 2154, "incorrect value for toc.wn, expected 2154, is %d", check_msg->toc.wn); - ck_assert_msg((check_msg->w*100 - -2.69860320574*100) < 0.05, "incorrect value for w, expected -2.69860320574, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - -0.000891132280231 * 100) < 0.05, + "incorrect value for af0, expected -0.000891132280231, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - 1.2398970739e-12 * 100) < 0.05, + "incorrect value for af1, expected 1.2398970739e-12, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - -7.31836466428e-19 * 100) < 0.05, + "incorrect value for af2, expected -7.31836466428e-19, is %f", + check_msg->af2); + ck_assert_msg((check_msg->c_ic * 100 - -6.6589564085e-08 * 100) < 0.05, + "incorrect value for c_ic, expected -6.6589564085e-08, is %f", + check_msg->c_ic); + ck_assert_msg((check_msg->c_is * 100 - 3.55299562216e-07 * 100) < 0.05, + "incorrect value for c_is, expected 3.55299562216e-07, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - 234.640625 * 100) < 0.05, + "incorrect value for c_rc, expected 234.640625, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - 224.4375 * 100) < 0.05, + "incorrect value for c_rs, expected 224.4375, is %f", + check_msg->c_rs); + ck_assert_msg((check_msg->c_uc * 100 - 7.60657712817e-06 * 100) < 0.05, + "incorrect value for c_uc, expected 7.60657712817e-06, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 6.55185431242e-07 * 100) < 0.05, + "incorrect value for c_us, expected 6.55185431242e-07, is %f", + check_msg->c_us); + ck_assert_msg( + check_msg->common.fit_interval == 10800, + "incorrect value for common.fit_interval, expected 10800, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 12, + "incorrect value for common.sid.code, expected 12, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.sat == 8, + "incorrect value for common.sid.sat, expected 8, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toe.tow == 439214, + "incorrect value for common.toe.tow, expected 439214, is %d", + check_msg->common.toe.tow); + ck_assert_msg(check_msg->common.toe.wn == 2154, + "incorrect value for common.toe.wn, expected 2154, is %d", + check_msg->common.toe.wn); + ck_assert_msg((check_msg->common.ura * 100 - 2.0 * 100) < 0.05, + "incorrect value for common.ura, expected 2.0, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg((check_msg->dn * 100 - 1.12968991326e-09 * 100) < 0.05, + "incorrect value for dn, expected 1.12968991326e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.0051847374998 * 100) < 0.05, + "incorrect value for ecc, expected 0.0051847374998, is %f", + check_msg->ecc); + ck_assert_msg((check_msg->inc * 100 - 1.04217695435 * 100) < 0.05, + "incorrect value for inc, expected 1.04217695435, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - 7.5074555728e-10 * 100) < 0.05, + "incorrect value for inc_dot, expected 7.5074555728e-10, is %f", + check_msg->inc_dot); + ck_assert_msg(check_msg->iodc == 5, + "incorrect value for iodc, expected 5, is %d", + check_msg->iodc); + ck_assert_msg(check_msg->iode == 6, + "incorrect value for iode, expected 6, is %d", + check_msg->iode); + ck_assert_msg((check_msg->m0 * 100 - 1.69439581907 * 100) < 0.05, + "incorrect value for m0, expected 1.69439581907, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - -2.58107376287 * 100) < 0.05, + "incorrect value for omega0, expected -2.58107376287, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -2.30331022783e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -2.30331022783e-09, is %f", + check_msg->omegadot); + ck_assert_msg((check_msg->sqrta * 100 - 6493.49845123 * 100) < 0.05, + "incorrect value for sqrta, expected 6493.49845123, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->tgd1 * 100 - 1.04999999806e-08 * 100) < 0.05, + "incorrect value for tgd1, expected 1.04999999806e-08, is %f", + check_msg->tgd1); + ck_assert_msg( + (check_msg->tgd2 * 100 - -1.09999997999e-09 * 100) < 0.05, + "incorrect value for tgd2, expected -1.09999997999e-09, is %f", + check_msg->tgd2); + ck_assert_msg(check_msg->toc.tow == 439214, + "incorrect value for toc.tow, expected 439214, is %d", + check_msg->toc.tow); + ck_assert_msg(check_msg->toc.wn == 2154, + "incorrect value for toc.wn, expected 2154, is %d", + check_msg->toc.wn); + ck_assert_msg((check_msg->w * 100 - -2.69860320574 * 100) < 0.05, + "incorrect value for w, expected -2.69860320574, is %f", + check_msg->w); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisBds_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisBds"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisBds"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisBds); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisBds_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisBds"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisBds"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisBds); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisDepA.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisDepA.c index 3b60130d6..f8125445d 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisDepA.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,34 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x1a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x1a, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x1a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x1a, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,26,0,195,4,175,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,154,153,153,153,153,153,201,63,205,204,204,204,192,62,27,65,106,8,205,204,204,204,192,62,27,65,106,8,1,0,22,242,84, }; + u8 encoded_frame[] = { + 85, 26, 0, 195, 4, 175, 0, 0, 0, 0, 0, 0, 83, 190, + 0, 0, 0, 0, 0, 40, 74, 192, 0, 0, 0, 0, 0, 74, + 115, 64, 0, 0, 0, 0, 0, 4, 199, 190, 0, 0, 0, 0, + 0, 80, 202, 62, 0, 0, 0, 0, 0, 0, 64, 62, 0, 0, + 0, 0, 0, 0, 127, 190, 114, 216, 96, 180, 49, 117, 56, 62, + 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, + 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, + 141, 248, 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, + 199, 39, 96, 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, + 221, 47, 100, 224, 255, 47, 198, 189, 0, 0, 0, 0, 108, 177, + 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 154, 153, 153, 153, + 153, 153, 201, 63, 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, + 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, 1, 0, 22, 242, + 84, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_dep_a_t* test_msg = ( msg_ephemeris_dep_a_t* )test_msg_storage; + msg_ephemeris_dep_a_t *test_msg = (msg_ephemeris_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = -0.0006315018981695175; test_msg->af1 = 8.981260180007666e-12; @@ -169,89 +183,155 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisDepA ) test_msg->toe_wn = 2154; test_msg->valid = 1; test_msg->w = -0.9893036629599647; - sbp_payload_send(&sbp_state, 0x1a, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x1a, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x1a, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_dep_a_t* check_msg = ( msg_ephemeris_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_dep_a_t *check_msg = + (msg_ephemeris_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - -0.00063150189817*100) < 0.05, "incorrect value for af0, expected -0.00063150189817, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - 8.98126018001e-12*100) < 0.05, "incorrect value for af1, expected 8.98126018001e-12, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - 0.2*100) < 0.05, "incorrect value for af2, expected 0.2, is %f", check_msg->af2); - ck_assert_msg((check_msg->c_ic*100 - 7.45058059692e-09*100) < 0.05, "incorrect value for c_ic, expected 7.45058059692e-09, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - -1.15483999252e-07*100) < 0.05, "incorrect value for c_is, expected -1.15483999252e-07, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - 308.625*100) < 0.05, "incorrect value for c_rc, expected 308.625, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - -52.3125*100) < 0.05, "incorrect value for c_rs, expected -52.3125, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - -2.74367630482e-06*100) < 0.05, "incorrect value for c_uc, expected -2.74367630482e-06, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 3.1366944313e-06*100) < 0.05, "incorrect value for c_us, expected 3.1366944313e-06, is %f", check_msg->c_us); - ck_assert_msg((check_msg->dn*100 - 5.69452291402e-09*100) < 0.05, "incorrect value for dn, expected 5.69452291402e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.00707220705226*100) < 0.05, "incorrect value for ecc, expected 0.00707220705226, is %f", check_msg->ecc); - ck_assert_msg(check_msg->healthy == 0, "incorrect value for healthy, expected 0, is %d", check_msg->healthy); - ck_assert_msg((check_msg->inc*100 - 0.934151448026*100) < 0.05, "incorrect value for inc, expected 0.934151448026, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - -4.03588239642e-11*100) < 0.05, "incorrect value for inc_dot, expected -4.03588239642e-11, is %f", check_msg->inc_dot); - ck_assert_msg((check_msg->m0*100 - -0.0220007884211*100) < 0.05, "incorrect value for m0, expected -0.0220007884211, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - -1.87318184488*100) < 0.05, "incorrect value for omega0, expected -1.87318184488, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -8.90358515577e-09*100) < 0.05, "incorrect value for omegadot, expected -8.90358515577e-09, is %f", check_msg->omegadot); - ck_assert_msg(check_msg->prn == 22, "incorrect value for prn, expected 22, is %d", check_msg->prn); - ck_assert_msg((check_msg->sqrta*100 - 5153.55002975*100) < 0.05, "incorrect value for sqrta, expected 5153.55002975, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->tgd*100 - -1.76951289177e-08*100) < 0.05, "incorrect value for tgd, expected -1.76951289177e-08, is %f", check_msg->tgd); - ck_assert_msg((check_msg->toc_tow*100 - 446384.2*100) < 0.05, "incorrect value for toc_tow, expected 446384.2, is %f", check_msg->toc_tow); - ck_assert_msg(check_msg->toc_wn == 2154, "incorrect value for toc_wn, expected 2154, is %d", check_msg->toc_wn); - ck_assert_msg((check_msg->toe_tow*100 - 446384.2*100) < 0.05, "incorrect value for toe_tow, expected 446384.2, is %f", check_msg->toe_tow); - ck_assert_msg(check_msg->toe_wn == 2154, "incorrect value for toe_wn, expected 2154, is %d", check_msg->toe_wn); - ck_assert_msg(check_msg->valid == 1, "incorrect value for valid, expected 1, is %d", check_msg->valid); - ck_assert_msg((check_msg->w*100 - -0.98930366296*100) < 0.05, "incorrect value for w, expected -0.98930366296, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - -0.00063150189817 * 100) < 0.05, + "incorrect value for af0, expected -0.00063150189817, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - 8.98126018001e-12 * 100) < 0.05, + "incorrect value for af1, expected 8.98126018001e-12, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - 0.2 * 100) < 0.05, + "incorrect value for af2, expected 0.2, is %f", + check_msg->af2); + ck_assert_msg((check_msg->c_ic * 100 - 7.45058059692e-09 * 100) < 0.05, + "incorrect value for c_ic, expected 7.45058059692e-09, is %f", + check_msg->c_ic); + ck_assert_msg( + (check_msg->c_is * 100 - -1.15483999252e-07 * 100) < 0.05, + "incorrect value for c_is, expected -1.15483999252e-07, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - 308.625 * 100) < 0.05, + "incorrect value for c_rc, expected 308.625, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - -52.3125 * 100) < 0.05, + "incorrect value for c_rs, expected -52.3125, is %f", + check_msg->c_rs); + ck_assert_msg( + (check_msg->c_uc * 100 - -2.74367630482e-06 * 100) < 0.05, + "incorrect value for c_uc, expected -2.74367630482e-06, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 3.1366944313e-06 * 100) < 0.05, + "incorrect value for c_us, expected 3.1366944313e-06, is %f", + check_msg->c_us); + ck_assert_msg((check_msg->dn * 100 - 5.69452291402e-09 * 100) < 0.05, + "incorrect value for dn, expected 5.69452291402e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.00707220705226 * 100) < 0.05, + "incorrect value for ecc, expected 0.00707220705226, is %f", + check_msg->ecc); + ck_assert_msg(check_msg->healthy == 0, + "incorrect value for healthy, expected 0, is %d", + check_msg->healthy); + ck_assert_msg((check_msg->inc * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for inc, expected 0.934151448026, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - -4.03588239642e-11 * 100) < 0.05, + "incorrect value for inc_dot, expected -4.03588239642e-11, is %f", + check_msg->inc_dot); + ck_assert_msg((check_msg->m0 * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for m0, expected -0.0220007884211, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - -1.87318184488 * 100) < 0.05, + "incorrect value for omega0, expected -1.87318184488, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -8.90358515577e-09, is %f", + check_msg->omegadot); + ck_assert_msg(check_msg->prn == 22, + "incorrect value for prn, expected 22, is %d", + check_msg->prn); + ck_assert_msg((check_msg->sqrta * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for sqrta, expected 5153.55002975, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->tgd * 100 - -1.76951289177e-08 * 100) < 0.05, + "incorrect value for tgd, expected -1.76951289177e-08, is %f", + check_msg->tgd); + ck_assert_msg((check_msg->toc_tow * 100 - 446384.2 * 100) < 0.05, + "incorrect value for toc_tow, expected 446384.2, is %f", + check_msg->toc_tow); + ck_assert_msg(check_msg->toc_wn == 2154, + "incorrect value for toc_wn, expected 2154, is %d", + check_msg->toc_wn); + ck_assert_msg((check_msg->toe_tow * 100 - 446384.2 * 100) < 0.05, + "incorrect value for toe_tow, expected 446384.2, is %f", + check_msg->toe_tow); + ck_assert_msg(check_msg->toe_wn == 2154, + "incorrect value for toe_wn, expected 2154, is %d", + check_msg->toe_wn); + ck_assert_msg(check_msg->valid == 1, + "incorrect value for valid, expected 1, is %d", + check_msg->valid); + ck_assert_msg((check_msg->w * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for w, expected -0.98930366296, is %f", + check_msg->w); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisDepA); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisDepC.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisDepC.c index f84974563..ea1d3bb91 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisDepC.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisDepC.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepC.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisDepC ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisDepC) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisDepC ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,34 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisDepC ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x47, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x47, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x47, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x47, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,71,0,195,4,185,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,154,153,153,153,153,153,201,63,205,204,204,204,192,62,27,65,106,8,205,204,204,204,192,62,27,65,106,8,1,0,22,0,0,0,45,45,0,0,0,0,0,23,170, }; + u8 encoded_frame[] = { + 85, 71, 0, 195, 4, 185, 0, 0, 0, 0, 0, 0, 83, 190, + 0, 0, 0, 0, 0, 40, 74, 192, 0, 0, 0, 0, 0, 74, + 115, 64, 0, 0, 0, 0, 0, 4, 199, 190, 0, 0, 0, 0, + 0, 80, 202, 62, 0, 0, 0, 0, 0, 0, 64, 62, 0, 0, + 0, 0, 0, 0, 127, 190, 114, 216, 96, 180, 49, 117, 56, 62, + 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, + 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, + 141, 248, 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, + 199, 39, 96, 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, + 221, 47, 100, 224, 255, 47, 198, 189, 0, 0, 0, 0, 108, 177, + 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 154, 153, 153, 153, + 153, 153, 201, 63, 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, + 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, 1, 0, 22, 0, + 0, 0, 45, 45, 0, 0, 0, 0, 0, 23, 170, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_dep_c_t* test_msg = ( msg_ephemeris_dep_c_t* )test_msg_storage; + msg_ephemeris_dep_c_t *test_msg = (msg_ephemeris_dep_c_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = -0.0006315018981695175; test_msg->af1 = 8.981260180007666e-12; @@ -174,94 +188,170 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisDepC ) test_msg->toe_wn = 2154; test_msg->valid = 1; test_msg->w = -0.9893036629599647; - sbp_payload_send(&sbp_state, 0x47, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x47, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x47, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_dep_c_t* check_msg = ( msg_ephemeris_dep_c_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_dep_c_t *check_msg = + (msg_ephemeris_dep_c_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - -0.00063150189817*100) < 0.05, "incorrect value for af0, expected -0.00063150189817, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - 8.98126018001e-12*100) < 0.05, "incorrect value for af1, expected 8.98126018001e-12, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - 0.2*100) < 0.05, "incorrect value for af2, expected 0.2, is %f", check_msg->af2); - ck_assert_msg((check_msg->c_ic*100 - 7.45058059692e-09*100) < 0.05, "incorrect value for c_ic, expected 7.45058059692e-09, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - -1.15483999252e-07*100) < 0.05, "incorrect value for c_is, expected -1.15483999252e-07, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - 308.625*100) < 0.05, "incorrect value for c_rc, expected 308.625, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - -52.3125*100) < 0.05, "incorrect value for c_rs, expected -52.3125, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - -2.74367630482e-06*100) < 0.05, "incorrect value for c_uc, expected -2.74367630482e-06, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 3.1366944313e-06*100) < 0.05, "incorrect value for c_us, expected 3.1366944313e-06, is %f", check_msg->c_us); - ck_assert_msg((check_msg->dn*100 - 5.69452291402e-09*100) < 0.05, "incorrect value for dn, expected 5.69452291402e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.00707220705226*100) < 0.05, "incorrect value for ecc, expected 0.00707220705226, is %f", check_msg->ecc); - ck_assert_msg(check_msg->healthy == 0, "incorrect value for healthy, expected 0, is %d", check_msg->healthy); - ck_assert_msg((check_msg->inc*100 - 0.934151448026*100) < 0.05, "incorrect value for inc, expected 0.934151448026, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - -4.03588239642e-11*100) < 0.05, "incorrect value for inc_dot, expected -4.03588239642e-11, is %f", check_msg->inc_dot); - ck_assert_msg(check_msg->iodc == 45, "incorrect value for iodc, expected 45, is %d", check_msg->iodc); - ck_assert_msg(check_msg->iode == 45, "incorrect value for iode, expected 45, is %d", check_msg->iode); - ck_assert_msg((check_msg->m0*100 - -0.0220007884211*100) < 0.05, "incorrect value for m0, expected -0.0220007884211, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - -1.87318184488*100) < 0.05, "incorrect value for omega0, expected -1.87318184488, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -8.90358515577e-09*100) < 0.05, "incorrect value for omegadot, expected -8.90358515577e-09, is %f", check_msg->omegadot); - ck_assert_msg(check_msg->reserved == 0, "incorrect value for reserved, expected 0, is %d", check_msg->reserved); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 22, "incorrect value for sid.sat, expected 22, is %d", check_msg->sid.sat); - ck_assert_msg((check_msg->sqrta*100 - 5153.55002975*100) < 0.05, "incorrect value for sqrta, expected 5153.55002975, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->tgd*100 - -1.76951289177e-08*100) < 0.05, "incorrect value for tgd, expected -1.76951289177e-08, is %f", check_msg->tgd); - ck_assert_msg((check_msg->toc_tow*100 - 446384.2*100) < 0.05, "incorrect value for toc_tow, expected 446384.2, is %f", check_msg->toc_tow); - ck_assert_msg(check_msg->toc_wn == 2154, "incorrect value for toc_wn, expected 2154, is %d", check_msg->toc_wn); - ck_assert_msg((check_msg->toe_tow*100 - 446384.2*100) < 0.05, "incorrect value for toe_tow, expected 446384.2, is %f", check_msg->toe_tow); - ck_assert_msg(check_msg->toe_wn == 2154, "incorrect value for toe_wn, expected 2154, is %d", check_msg->toe_wn); - ck_assert_msg(check_msg->valid == 1, "incorrect value for valid, expected 1, is %d", check_msg->valid); - ck_assert_msg((check_msg->w*100 - -0.98930366296*100) < 0.05, "incorrect value for w, expected -0.98930366296, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - -0.00063150189817 * 100) < 0.05, + "incorrect value for af0, expected -0.00063150189817, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - 8.98126018001e-12 * 100) < 0.05, + "incorrect value for af1, expected 8.98126018001e-12, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - 0.2 * 100) < 0.05, + "incorrect value for af2, expected 0.2, is %f", + check_msg->af2); + ck_assert_msg((check_msg->c_ic * 100 - 7.45058059692e-09 * 100) < 0.05, + "incorrect value for c_ic, expected 7.45058059692e-09, is %f", + check_msg->c_ic); + ck_assert_msg( + (check_msg->c_is * 100 - -1.15483999252e-07 * 100) < 0.05, + "incorrect value for c_is, expected -1.15483999252e-07, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - 308.625 * 100) < 0.05, + "incorrect value for c_rc, expected 308.625, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - -52.3125 * 100) < 0.05, + "incorrect value for c_rs, expected -52.3125, is %f", + check_msg->c_rs); + ck_assert_msg( + (check_msg->c_uc * 100 - -2.74367630482e-06 * 100) < 0.05, + "incorrect value for c_uc, expected -2.74367630482e-06, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 3.1366944313e-06 * 100) < 0.05, + "incorrect value for c_us, expected 3.1366944313e-06, is %f", + check_msg->c_us); + ck_assert_msg((check_msg->dn * 100 - 5.69452291402e-09 * 100) < 0.05, + "incorrect value for dn, expected 5.69452291402e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.00707220705226 * 100) < 0.05, + "incorrect value for ecc, expected 0.00707220705226, is %f", + check_msg->ecc); + ck_assert_msg(check_msg->healthy == 0, + "incorrect value for healthy, expected 0, is %d", + check_msg->healthy); + ck_assert_msg((check_msg->inc * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for inc, expected 0.934151448026, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - -4.03588239642e-11 * 100) < 0.05, + "incorrect value for inc_dot, expected -4.03588239642e-11, is %f", + check_msg->inc_dot); + ck_assert_msg(check_msg->iodc == 45, + "incorrect value for iodc, expected 45, is %d", + check_msg->iodc); + ck_assert_msg(check_msg->iode == 45, + "incorrect value for iode, expected 45, is %d", + check_msg->iode); + ck_assert_msg((check_msg->m0 * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for m0, expected -0.0220007884211, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - -1.87318184488 * 100) < 0.05, + "incorrect value for omega0, expected -1.87318184488, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -8.90358515577e-09, is %f", + check_msg->omegadot); + ck_assert_msg(check_msg->reserved == 0, + "incorrect value for reserved, expected 0, is %d", + check_msg->reserved); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 22, + "incorrect value for sid.sat, expected 22, is %d", + check_msg->sid.sat); + ck_assert_msg((check_msg->sqrta * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for sqrta, expected 5153.55002975, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->tgd * 100 - -1.76951289177e-08 * 100) < 0.05, + "incorrect value for tgd, expected -1.76951289177e-08, is %f", + check_msg->tgd); + ck_assert_msg((check_msg->toc_tow * 100 - 446384.2 * 100) < 0.05, + "incorrect value for toc_tow, expected 446384.2, is %f", + check_msg->toc_tow); + ck_assert_msg(check_msg->toc_wn == 2154, + "incorrect value for toc_wn, expected 2154, is %d", + check_msg->toc_wn); + ck_assert_msg((check_msg->toe_tow * 100 - 446384.2 * 100) < 0.05, + "incorrect value for toe_tow, expected 446384.2, is %f", + check_msg->toe_tow); + ck_assert_msg(check_msg->toe_wn == 2154, + "incorrect value for toe_wn, expected 2154, is %d", + check_msg->toe_wn); + ck_assert_msg(check_msg->valid == 1, + "incorrect value for valid, expected 1, is %d", + check_msg->valid); + ck_assert_msg((check_msg->w * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for w, expected -0.98930366296, is %f", + check_msg->w); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisDepC_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisDepC"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisDepC"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisDepC); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisDepC_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisDepC"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisDepC"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisDepC); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisDepD.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisDepD.c index d8877f652..c0f7169d0 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisDepD.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisDepD.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepD.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepD.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisDepD ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisDepD) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisDepD ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,34 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisDepD ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x80, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x80, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x80, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x80, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,128,0,195,4,185,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,154,153,153,153,153,153,201,63,205,204,204,204,192,62,27,65,106,8,205,204,204,204,192,62,27,65,106,8,1,0,22,0,0,0,45,45,0,0,0,0,0,95,7, }; + u8 encoded_frame[] = { + 85, 128, 0, 195, 4, 185, 0, 0, 0, 0, 0, 0, 83, 190, + 0, 0, 0, 0, 0, 40, 74, 192, 0, 0, 0, 0, 0, 74, + 115, 64, 0, 0, 0, 0, 0, 4, 199, 190, 0, 0, 0, 0, + 0, 80, 202, 62, 0, 0, 0, 0, 0, 0, 64, 62, 0, 0, + 0, 0, 0, 0, 127, 190, 114, 216, 96, 180, 49, 117, 56, 62, + 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, + 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, + 141, 248, 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, + 199, 39, 96, 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, + 221, 47, 100, 224, 255, 47, 198, 189, 0, 0, 0, 0, 108, 177, + 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 154, 153, 153, 153, + 153, 153, 201, 63, 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, + 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, 1, 0, 22, 0, + 0, 0, 45, 45, 0, 0, 0, 0, 0, 95, 7, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_dep_d_t* test_msg = ( msg_ephemeris_dep_d_t* )test_msg_storage; + msg_ephemeris_dep_d_t *test_msg = (msg_ephemeris_dep_d_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = -0.0006315018981695175; test_msg->af1 = 8.981260180007666e-12; @@ -174,94 +188,170 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisDepD ) test_msg->toe_wn = 2154; test_msg->valid = 1; test_msg->w = -0.9893036629599647; - sbp_payload_send(&sbp_state, 0x80, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x80, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x80, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_dep_d_t* check_msg = ( msg_ephemeris_dep_d_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_dep_d_t *check_msg = + (msg_ephemeris_dep_d_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - -0.00063150189817*100) < 0.05, "incorrect value for af0, expected -0.00063150189817, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - 8.98126018001e-12*100) < 0.05, "incorrect value for af1, expected 8.98126018001e-12, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - 0.2*100) < 0.05, "incorrect value for af2, expected 0.2, is %f", check_msg->af2); - ck_assert_msg((check_msg->c_ic*100 - 7.45058059692e-09*100) < 0.05, "incorrect value for c_ic, expected 7.45058059692e-09, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - -1.15483999252e-07*100) < 0.05, "incorrect value for c_is, expected -1.15483999252e-07, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - 308.625*100) < 0.05, "incorrect value for c_rc, expected 308.625, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - -52.3125*100) < 0.05, "incorrect value for c_rs, expected -52.3125, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - -2.74367630482e-06*100) < 0.05, "incorrect value for c_uc, expected -2.74367630482e-06, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 3.1366944313e-06*100) < 0.05, "incorrect value for c_us, expected 3.1366944313e-06, is %f", check_msg->c_us); - ck_assert_msg((check_msg->dn*100 - 5.69452291402e-09*100) < 0.05, "incorrect value for dn, expected 5.69452291402e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.00707220705226*100) < 0.05, "incorrect value for ecc, expected 0.00707220705226, is %f", check_msg->ecc); - ck_assert_msg(check_msg->healthy == 0, "incorrect value for healthy, expected 0, is %d", check_msg->healthy); - ck_assert_msg((check_msg->inc*100 - 0.934151448026*100) < 0.05, "incorrect value for inc, expected 0.934151448026, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - -4.03588239642e-11*100) < 0.05, "incorrect value for inc_dot, expected -4.03588239642e-11, is %f", check_msg->inc_dot); - ck_assert_msg(check_msg->iodc == 45, "incorrect value for iodc, expected 45, is %d", check_msg->iodc); - ck_assert_msg(check_msg->iode == 45, "incorrect value for iode, expected 45, is %d", check_msg->iode); - ck_assert_msg((check_msg->m0*100 - -0.0220007884211*100) < 0.05, "incorrect value for m0, expected -0.0220007884211, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - -1.87318184488*100) < 0.05, "incorrect value for omega0, expected -1.87318184488, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -8.90358515577e-09*100) < 0.05, "incorrect value for omegadot, expected -8.90358515577e-09, is %f", check_msg->omegadot); - ck_assert_msg(check_msg->reserved == 0, "incorrect value for reserved, expected 0, is %d", check_msg->reserved); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 22, "incorrect value for sid.sat, expected 22, is %d", check_msg->sid.sat); - ck_assert_msg((check_msg->sqrta*100 - 5153.55002975*100) < 0.05, "incorrect value for sqrta, expected 5153.55002975, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->tgd*100 - -1.76951289177e-08*100) < 0.05, "incorrect value for tgd, expected -1.76951289177e-08, is %f", check_msg->tgd); - ck_assert_msg((check_msg->toc_tow*100 - 446384.2*100) < 0.05, "incorrect value for toc_tow, expected 446384.2, is %f", check_msg->toc_tow); - ck_assert_msg(check_msg->toc_wn == 2154, "incorrect value for toc_wn, expected 2154, is %d", check_msg->toc_wn); - ck_assert_msg((check_msg->toe_tow*100 - 446384.2*100) < 0.05, "incorrect value for toe_tow, expected 446384.2, is %f", check_msg->toe_tow); - ck_assert_msg(check_msg->toe_wn == 2154, "incorrect value for toe_wn, expected 2154, is %d", check_msg->toe_wn); - ck_assert_msg(check_msg->valid == 1, "incorrect value for valid, expected 1, is %d", check_msg->valid); - ck_assert_msg((check_msg->w*100 - -0.98930366296*100) < 0.05, "incorrect value for w, expected -0.98930366296, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - -0.00063150189817 * 100) < 0.05, + "incorrect value for af0, expected -0.00063150189817, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - 8.98126018001e-12 * 100) < 0.05, + "incorrect value for af1, expected 8.98126018001e-12, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - 0.2 * 100) < 0.05, + "incorrect value for af2, expected 0.2, is %f", + check_msg->af2); + ck_assert_msg((check_msg->c_ic * 100 - 7.45058059692e-09 * 100) < 0.05, + "incorrect value for c_ic, expected 7.45058059692e-09, is %f", + check_msg->c_ic); + ck_assert_msg( + (check_msg->c_is * 100 - -1.15483999252e-07 * 100) < 0.05, + "incorrect value for c_is, expected -1.15483999252e-07, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - 308.625 * 100) < 0.05, + "incorrect value for c_rc, expected 308.625, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - -52.3125 * 100) < 0.05, + "incorrect value for c_rs, expected -52.3125, is %f", + check_msg->c_rs); + ck_assert_msg( + (check_msg->c_uc * 100 - -2.74367630482e-06 * 100) < 0.05, + "incorrect value for c_uc, expected -2.74367630482e-06, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 3.1366944313e-06 * 100) < 0.05, + "incorrect value for c_us, expected 3.1366944313e-06, is %f", + check_msg->c_us); + ck_assert_msg((check_msg->dn * 100 - 5.69452291402e-09 * 100) < 0.05, + "incorrect value for dn, expected 5.69452291402e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.00707220705226 * 100) < 0.05, + "incorrect value for ecc, expected 0.00707220705226, is %f", + check_msg->ecc); + ck_assert_msg(check_msg->healthy == 0, + "incorrect value for healthy, expected 0, is %d", + check_msg->healthy); + ck_assert_msg((check_msg->inc * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for inc, expected 0.934151448026, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - -4.03588239642e-11 * 100) < 0.05, + "incorrect value for inc_dot, expected -4.03588239642e-11, is %f", + check_msg->inc_dot); + ck_assert_msg(check_msg->iodc == 45, + "incorrect value for iodc, expected 45, is %d", + check_msg->iodc); + ck_assert_msg(check_msg->iode == 45, + "incorrect value for iode, expected 45, is %d", + check_msg->iode); + ck_assert_msg((check_msg->m0 * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for m0, expected -0.0220007884211, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - -1.87318184488 * 100) < 0.05, + "incorrect value for omega0, expected -1.87318184488, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -8.90358515577e-09, is %f", + check_msg->omegadot); + ck_assert_msg(check_msg->reserved == 0, + "incorrect value for reserved, expected 0, is %d", + check_msg->reserved); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 22, + "incorrect value for sid.sat, expected 22, is %d", + check_msg->sid.sat); + ck_assert_msg((check_msg->sqrta * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for sqrta, expected 5153.55002975, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->tgd * 100 - -1.76951289177e-08 * 100) < 0.05, + "incorrect value for tgd, expected -1.76951289177e-08, is %f", + check_msg->tgd); + ck_assert_msg((check_msg->toc_tow * 100 - 446384.2 * 100) < 0.05, + "incorrect value for toc_tow, expected 446384.2, is %f", + check_msg->toc_tow); + ck_assert_msg(check_msg->toc_wn == 2154, + "incorrect value for toc_wn, expected 2154, is %d", + check_msg->toc_wn); + ck_assert_msg((check_msg->toe_tow * 100 - 446384.2 * 100) < 0.05, + "incorrect value for toe_tow, expected 446384.2, is %f", + check_msg->toe_tow); + ck_assert_msg(check_msg->toe_wn == 2154, + "incorrect value for toe_wn, expected 2154, is %d", + check_msg->toe_wn); + ck_assert_msg(check_msg->valid == 1, + "incorrect value for valid, expected 1, is %d", + check_msg->valid); + ck_assert_msg((check_msg->w * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for w, expected -0.98930366296, is %f", + check_msg->w); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisDepD_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisDepD"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisDepD"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisDepD); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisDepD_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisDepD"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisDepD"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisDepD); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLO.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLO.c index d047981c5..a6982790e 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLO.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLO.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLO.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLO.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLO ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisGLO) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLO ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,28 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLO ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x8b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x8b, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x8b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x8b, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,139,0,10,9,92,4,3,70,197,6,0,106,8,0,0,160,64,96,9,0,0,1,0,0,0,128,43,128,97,175,184,0,0,64,177,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,122,53,0,0,122,53,0,128,59,54,14,100,89,149, }; + u8 encoded_frame[] = { + 85, 139, 0, 10, 9, 92, 4, 3, 70, 197, 6, 0, 106, + 8, 0, 0, 160, 64, 96, 9, 0, 0, 1, 0, 0, 0, + 128, 43, 128, 97, 175, 184, 0, 0, 64, 177, 0, 0, 128, + 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, 34, 65, + 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, 0, 98, 6, + 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, 192, 0, 0, + 0, 184, 138, 46, 139, 64, 0, 0, 122, 53, 0, 0, 122, + 53, 0, 128, 59, 54, 14, 100, 89, 149, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_glo_t* test_msg = ( msg_ephemeris_glo_t* )test_msg_storage; + msg_ephemeris_glo_t *test_msg = (msg_ephemeris_glo_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->acc) == 0) { // Cope with variable length arrays @@ -201,85 +209,145 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLO ) test_msg_len += sizeof(test_msg->vel[0]); } test_msg->vel[2] = 869.8177337646484; - sbp_payload_send(&sbp_state, 0x8b, 2314, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x8b, 2314, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 2314, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 2314, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x8b, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_glo_t* check_msg = ( msg_ephemeris_glo_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_glo_t *check_msg = + (msg_ephemeris_glo_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->acc[0]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[0], expected 9.31322574615e-07, is %f", check_msg->acc[0]); - ck_assert_msg((check_msg->acc[1]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[1], expected 9.31322574615e-07, is %f", check_msg->acc[1]); - ck_assert_msg((check_msg->acc[2]*100 - 2.79396772385e-06*100) < 0.05, "incorrect value for acc[2], expected 2.79396772385e-06, is %f", check_msg->acc[2]); - ck_assert_msg(check_msg->common.fit_interval == 2400, "incorrect value for common.fit_interval, expected 2400, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 3, "incorrect value for common.sid.code, expected 3, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.sat == 4, "incorrect value for common.sid.sat, expected 4, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toe.tow == 443718, "incorrect value for common.toe.tow, expected 443718, is %d", check_msg->common.toe.tow); - ck_assert_msg(check_msg->common.toe.wn == 2154, "incorrect value for common.toe.wn, expected 2154, is %d", check_msg->common.toe.wn); - ck_assert_msg((check_msg->common.ura*100 - 5.0*100) < 0.05, "incorrect value for common.ura, expected 5.0, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->d_tau*100 - -2.79396772385e-09*100) < 0.05, "incorrect value for d_tau, expected -2.79396772385e-09, is %f", check_msg->d_tau); - ck_assert_msg(check_msg->fcn == 14, "incorrect value for fcn, expected 14, is %d", check_msg->fcn); - ck_assert_msg((check_msg->gamma*100 - 9.09494701773e-13*100) < 0.05, "incorrect value for gamma, expected 9.09494701773e-13, is %f", check_msg->gamma); - ck_assert_msg(check_msg->iod == 100, "incorrect value for iod, expected 100, is %d", check_msg->iod); - ck_assert_msg((check_msg->pos[0]*100 - -12177330.0781*100) < 0.05, "incorrect value for pos[0], expected -12177330.0781, is %f", check_msg->pos[0]); - ck_assert_msg((check_msg->pos[1]*100 - 599893.066406*100) < 0.05, "incorrect value for pos[1], expected 599893.066406, is %f", check_msg->pos[1]); - ck_assert_msg((check_msg->pos[2]*100 - -22373708.4961*100) < 0.05, "incorrect value for pos[2], expected -22373708.4961, is %f", check_msg->pos[2]); - ck_assert_msg((check_msg->tau*100 - -8.36281105876e-05*100) < 0.05, "incorrect value for tau, expected -8.36281105876e-05, is %f", check_msg->tau); - ck_assert_msg((check_msg->vel[0]*100 - -1726.50623322*100) < 0.05, "incorrect value for vel[0], expected -1726.50623322, is %f", check_msg->vel[0]); - ck_assert_msg((check_msg->vel[1]*100 - -2542.61493683*100) < 0.05, "incorrect value for vel[1], expected -2542.61493683, is %f", check_msg->vel[1]); - ck_assert_msg((check_msg->vel[2]*100 - 869.817733765*100) < 0.05, "incorrect value for vel[2], expected 869.817733765, is %f", check_msg->vel[2]); + ck_assert_msg( + (check_msg->acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[0], expected 9.31322574615e-07, is %f", + check_msg->acc[0]); + ck_assert_msg( + (check_msg->acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[1], expected 9.31322574615e-07, is %f", + check_msg->acc[1]); + ck_assert_msg( + (check_msg->acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, + "incorrect value for acc[2], expected 2.79396772385e-06, is %f", + check_msg->acc[2]); + ck_assert_msg( + check_msg->common.fit_interval == 2400, + "incorrect value for common.fit_interval, expected 2400, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 3, + "incorrect value for common.sid.code, expected 3, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.sat == 4, + "incorrect value for common.sid.sat, expected 4, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toe.tow == 443718, + "incorrect value for common.toe.tow, expected 443718, is %d", + check_msg->common.toe.tow); + ck_assert_msg(check_msg->common.toe.wn == 2154, + "incorrect value for common.toe.wn, expected 2154, is %d", + check_msg->common.toe.wn); + ck_assert_msg((check_msg->common.ura * 100 - 5.0 * 100) < 0.05, + "incorrect value for common.ura, expected 5.0, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg( + (check_msg->d_tau * 100 - -2.79396772385e-09 * 100) < 0.05, + "incorrect value for d_tau, expected -2.79396772385e-09, is %f", + check_msg->d_tau); + ck_assert_msg(check_msg->fcn == 14, + "incorrect value for fcn, expected 14, is %d", + check_msg->fcn); + ck_assert_msg( + (check_msg->gamma * 100 - 9.09494701773e-13 * 100) < 0.05, + "incorrect value for gamma, expected 9.09494701773e-13, is %f", + check_msg->gamma); + ck_assert_msg(check_msg->iod == 100, + "incorrect value for iod, expected 100, is %d", + check_msg->iod); + ck_assert_msg((check_msg->pos[0] * 100 - -12177330.0781 * 100) < 0.05, + "incorrect value for pos[0], expected -12177330.0781, is %f", + check_msg->pos[0]); + ck_assert_msg((check_msg->pos[1] * 100 - 599893.066406 * 100) < 0.05, + "incorrect value for pos[1], expected 599893.066406, is %f", + check_msg->pos[1]); + ck_assert_msg((check_msg->pos[2] * 100 - -22373708.4961 * 100) < 0.05, + "incorrect value for pos[2], expected -22373708.4961, is %f", + check_msg->pos[2]); + ck_assert_msg((check_msg->tau * 100 - -8.36281105876e-05 * 100) < 0.05, + "incorrect value for tau, expected -8.36281105876e-05, is %f", + check_msg->tau); + ck_assert_msg((check_msg->vel[0] * 100 - -1726.50623322 * 100) < 0.05, + "incorrect value for vel[0], expected -1726.50623322, is %f", + check_msg->vel[0]); + ck_assert_msg((check_msg->vel[1] * 100 - -2542.61493683 * 100) < 0.05, + "incorrect value for vel[1], expected -2542.61493683, is %f", + check_msg->vel[1]); + ck_assert_msg((check_msg->vel[2] * 100 - 869.817733765 * 100) < 0.05, + "incorrect value for vel[2], expected 869.817733765, is %f", + check_msg->vel[2]); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisGLO_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisGLO"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGLO"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisGLO); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisGLO_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisGLO"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGLO"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisGLO); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepA.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepA.c index f7099d56e..47ee4baf5 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepA.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,30 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x83, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x83, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x83, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x83, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,131,0,195,4,112,4,0,3,0,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,202,238, }; + u8 encoded_frame[] = { + 85, 131, 0, 195, 4, 112, 4, 0, 3, 0, 70, 197, 6, 0, + 106, 8, 205, 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 112, 61, 0, 0, 0, 0, + 48, 236, 21, 191, 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, + 0, 34, 170, 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, + 0, 0, 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, + 163, 192, 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, + 0, 64, 175, 62, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, + 0, 0, 0, 112, 199, 62, 202, 238, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_glo_dep_a_t* test_msg = ( msg_ephemeris_glo_dep_a_t* )test_msg_storage; + msg_ephemeris_glo_dep_a_t *test_msg = + (msg_ephemeris_glo_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->acc) == 0) { // Cope with variable length arrays @@ -199,83 +209,138 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA ) test_msg_len += sizeof(test_msg->vel[0]); } test_msg->vel[2] = 869.8177337646484; - sbp_payload_send(&sbp_state, 0x83, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x83, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x83, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_glo_dep_a_t* check_msg = ( msg_ephemeris_glo_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_glo_dep_a_t *check_msg = + (msg_ephemeris_glo_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->acc[0]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[0], expected 9.31322574615e-07, is %f", check_msg->acc[0]); - ck_assert_msg((check_msg->acc[1]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[1], expected 9.31322574615e-07, is %f", check_msg->acc[1]); - ck_assert_msg((check_msg->acc[2]*100 - 2.79396772385e-06*100) < 0.05, "incorrect value for acc[2], expected 2.79396772385e-06, is %f", check_msg->acc[2]); - ck_assert_msg(check_msg->common.fit_interval == 2400, "incorrect value for common.fit_interval, expected 2400, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 3, "incorrect value for common.sid.code, expected 3, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.reserved == 0, "incorrect value for common.sid.reserved, expected 0, is %d", check_msg->common.sid.reserved); - ck_assert_msg(check_msg->common.sid.sat == 4, "incorrect value for common.sid.sat, expected 4, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toe.tow == 443718, "incorrect value for common.toe.tow, expected 443718, is %d", check_msg->common.toe.tow); - ck_assert_msg(check_msg->common.toe.wn == 2154, "incorrect value for common.toe.wn, expected 2154, is %d", check_msg->common.toe.wn); - ck_assert_msg((check_msg->common.ura*100 - 5.2*100) < 0.05, "incorrect value for common.ura, expected 5.2, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->gamma*100 - 9.09494701773e-13*100) < 0.05, "incorrect value for gamma, expected 9.09494701773e-13, is %f", check_msg->gamma); - ck_assert_msg((check_msg->pos[0]*100 - -12177330.0781*100) < 0.05, "incorrect value for pos[0], expected -12177330.0781, is %f", check_msg->pos[0]); - ck_assert_msg((check_msg->pos[1]*100 - 599893.066406*100) < 0.05, "incorrect value for pos[1], expected 599893.066406, is %f", check_msg->pos[1]); - ck_assert_msg((check_msg->pos[2]*100 - -22373708.4961*100) < 0.05, "incorrect value for pos[2], expected -22373708.4961, is %f", check_msg->pos[2]); - ck_assert_msg((check_msg->tau*100 - -8.36281105876e-05*100) < 0.05, "incorrect value for tau, expected -8.36281105876e-05, is %f", check_msg->tau); - ck_assert_msg((check_msg->vel[0]*100 - -1726.50623322*100) < 0.05, "incorrect value for vel[0], expected -1726.50623322, is %f", check_msg->vel[0]); - ck_assert_msg((check_msg->vel[1]*100 - -2542.61493683*100) < 0.05, "incorrect value for vel[1], expected -2542.61493683, is %f", check_msg->vel[1]); - ck_assert_msg((check_msg->vel[2]*100 - 869.817733765*100) < 0.05, "incorrect value for vel[2], expected 869.817733765, is %f", check_msg->vel[2]); + ck_assert_msg( + (check_msg->acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[0], expected 9.31322574615e-07, is %f", + check_msg->acc[0]); + ck_assert_msg( + (check_msg->acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[1], expected 9.31322574615e-07, is %f", + check_msg->acc[1]); + ck_assert_msg( + (check_msg->acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, + "incorrect value for acc[2], expected 2.79396772385e-06, is %f", + check_msg->acc[2]); + ck_assert_msg( + check_msg->common.fit_interval == 2400, + "incorrect value for common.fit_interval, expected 2400, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 3, + "incorrect value for common.sid.code, expected 3, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.reserved == 0, + "incorrect value for common.sid.reserved, expected 0, is %d", + check_msg->common.sid.reserved); + ck_assert_msg(check_msg->common.sid.sat == 4, + "incorrect value for common.sid.sat, expected 4, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toe.tow == 443718, + "incorrect value for common.toe.tow, expected 443718, is %d", + check_msg->common.toe.tow); + ck_assert_msg(check_msg->common.toe.wn == 2154, + "incorrect value for common.toe.wn, expected 2154, is %d", + check_msg->common.toe.wn); + ck_assert_msg((check_msg->common.ura * 100 - 5.2 * 100) < 0.05, + "incorrect value for common.ura, expected 5.2, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg( + (check_msg->gamma * 100 - 9.09494701773e-13 * 100) < 0.05, + "incorrect value for gamma, expected 9.09494701773e-13, is %f", + check_msg->gamma); + ck_assert_msg((check_msg->pos[0] * 100 - -12177330.0781 * 100) < 0.05, + "incorrect value for pos[0], expected -12177330.0781, is %f", + check_msg->pos[0]); + ck_assert_msg((check_msg->pos[1] * 100 - 599893.066406 * 100) < 0.05, + "incorrect value for pos[1], expected 599893.066406, is %f", + check_msg->pos[1]); + ck_assert_msg((check_msg->pos[2] * 100 - -22373708.4961 * 100) < 0.05, + "incorrect value for pos[2], expected -22373708.4961, is %f", + check_msg->pos[2]); + ck_assert_msg((check_msg->tau * 100 - -8.36281105876e-05 * 100) < 0.05, + "incorrect value for tau, expected -8.36281105876e-05, is %f", + check_msg->tau); + ck_assert_msg((check_msg->vel[0] * 100 - -1726.50623322 * 100) < 0.05, + "incorrect value for vel[0], expected -1726.50623322, is %f", + check_msg->vel[0]); + ck_assert_msg((check_msg->vel[1] * 100 - -2542.61493683 * 100) < 0.05, + "incorrect value for vel[1], expected -2542.61493683, is %f", + check_msg->vel[1]); + ck_assert_msg((check_msg->vel[2] * 100 - 869.817733765 * 100) < 0.05, + "incorrect value for vel[2], expected 869.817733765, is %f", + check_msg->vel[2]); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisGLODepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisGLODepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisGLODepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisGLODepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepB.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepB.c index 4bf4ef9c0..69d78d780 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepB.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepB.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,30 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x85, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x85, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x85, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x85, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,133,0,195,4,110,4,3,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,122,127, }; + u8 encoded_frame[] = { + 85, 133, 0, 195, 4, 110, 4, 3, 70, 197, 6, 0, 106, 8, + 205, 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 112, 61, 0, 0, 0, 0, 48, 236, + 21, 191, 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, + 170, 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, + 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, 192, + 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, 0, 64, + 175, 62, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, + 0, 112, 199, 62, 122, 127, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_glo_dep_b_t* test_msg = ( msg_ephemeris_glo_dep_b_t* )test_msg_storage; + msg_ephemeris_glo_dep_b_t *test_msg = + (msg_ephemeris_glo_dep_b_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->acc) == 0) { // Cope with variable length arrays @@ -198,82 +208,135 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB ) test_msg_len += sizeof(test_msg->vel[0]); } test_msg->vel[2] = 869.8177337646484; - sbp_payload_send(&sbp_state, 0x85, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x85, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x85, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_glo_dep_b_t* check_msg = ( msg_ephemeris_glo_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_glo_dep_b_t *check_msg = + (msg_ephemeris_glo_dep_b_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->acc[0]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[0], expected 9.31322574615e-07, is %f", check_msg->acc[0]); - ck_assert_msg((check_msg->acc[1]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[1], expected 9.31322574615e-07, is %f", check_msg->acc[1]); - ck_assert_msg((check_msg->acc[2]*100 - 2.79396772385e-06*100) < 0.05, "incorrect value for acc[2], expected 2.79396772385e-06, is %f", check_msg->acc[2]); - ck_assert_msg(check_msg->common.fit_interval == 2400, "incorrect value for common.fit_interval, expected 2400, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 3, "incorrect value for common.sid.code, expected 3, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.sat == 4, "incorrect value for common.sid.sat, expected 4, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toe.tow == 443718, "incorrect value for common.toe.tow, expected 443718, is %d", check_msg->common.toe.tow); - ck_assert_msg(check_msg->common.toe.wn == 2154, "incorrect value for common.toe.wn, expected 2154, is %d", check_msg->common.toe.wn); - ck_assert_msg((check_msg->common.ura*100 - 5.2*100) < 0.05, "incorrect value for common.ura, expected 5.2, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->gamma*100 - 9.09494701773e-13*100) < 0.05, "incorrect value for gamma, expected 9.09494701773e-13, is %f", check_msg->gamma); - ck_assert_msg((check_msg->pos[0]*100 - -12177330.0781*100) < 0.05, "incorrect value for pos[0], expected -12177330.0781, is %f", check_msg->pos[0]); - ck_assert_msg((check_msg->pos[1]*100 - 599893.066406*100) < 0.05, "incorrect value for pos[1], expected 599893.066406, is %f", check_msg->pos[1]); - ck_assert_msg((check_msg->pos[2]*100 - -22373708.4961*100) < 0.05, "incorrect value for pos[2], expected -22373708.4961, is %f", check_msg->pos[2]); - ck_assert_msg((check_msg->tau*100 - -8.36281105876e-05*100) < 0.05, "incorrect value for tau, expected -8.36281105876e-05, is %f", check_msg->tau); - ck_assert_msg((check_msg->vel[0]*100 - -1726.50623322*100) < 0.05, "incorrect value for vel[0], expected -1726.50623322, is %f", check_msg->vel[0]); - ck_assert_msg((check_msg->vel[1]*100 - -2542.61493683*100) < 0.05, "incorrect value for vel[1], expected -2542.61493683, is %f", check_msg->vel[1]); - ck_assert_msg((check_msg->vel[2]*100 - 869.817733765*100) < 0.05, "incorrect value for vel[2], expected 869.817733765, is %f", check_msg->vel[2]); + ck_assert_msg( + (check_msg->acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[0], expected 9.31322574615e-07, is %f", + check_msg->acc[0]); + ck_assert_msg( + (check_msg->acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[1], expected 9.31322574615e-07, is %f", + check_msg->acc[1]); + ck_assert_msg( + (check_msg->acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, + "incorrect value for acc[2], expected 2.79396772385e-06, is %f", + check_msg->acc[2]); + ck_assert_msg( + check_msg->common.fit_interval == 2400, + "incorrect value for common.fit_interval, expected 2400, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 3, + "incorrect value for common.sid.code, expected 3, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.sat == 4, + "incorrect value for common.sid.sat, expected 4, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toe.tow == 443718, + "incorrect value for common.toe.tow, expected 443718, is %d", + check_msg->common.toe.tow); + ck_assert_msg(check_msg->common.toe.wn == 2154, + "incorrect value for common.toe.wn, expected 2154, is %d", + check_msg->common.toe.wn); + ck_assert_msg((check_msg->common.ura * 100 - 5.2 * 100) < 0.05, + "incorrect value for common.ura, expected 5.2, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg( + (check_msg->gamma * 100 - 9.09494701773e-13 * 100) < 0.05, + "incorrect value for gamma, expected 9.09494701773e-13, is %f", + check_msg->gamma); + ck_assert_msg((check_msg->pos[0] * 100 - -12177330.0781 * 100) < 0.05, + "incorrect value for pos[0], expected -12177330.0781, is %f", + check_msg->pos[0]); + ck_assert_msg((check_msg->pos[1] * 100 - 599893.066406 * 100) < 0.05, + "incorrect value for pos[1], expected 599893.066406, is %f", + check_msg->pos[1]); + ck_assert_msg((check_msg->pos[2] * 100 - -22373708.4961 * 100) < 0.05, + "incorrect value for pos[2], expected -22373708.4961, is %f", + check_msg->pos[2]); + ck_assert_msg((check_msg->tau * 100 - -8.36281105876e-05 * 100) < 0.05, + "incorrect value for tau, expected -8.36281105876e-05, is %f", + check_msg->tau); + ck_assert_msg((check_msg->vel[0] * 100 - -1726.50623322 * 100) < 0.05, + "incorrect value for vel[0], expected -1726.50623322, is %f", + check_msg->vel[0]); + ck_assert_msg((check_msg->vel[1] * 100 - -2542.61493683 * 100) < 0.05, + "incorrect value for vel[1], expected -2542.61493683, is %f", + check_msg->vel[1]); + ck_assert_msg((check_msg->vel[2] * 100 - 869.817733765 * 100) < 0.05, + "incorrect value for vel[2], expected 869.817733765, is %f", + check_msg->vel[2]); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisGLODepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisGLODepB"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisGLODepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisGLODepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepC.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepC.c index 7ff2c3635..f2c4149ad 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepC.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepC.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepC.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,31 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x87, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x87, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x87, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x87, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,135,0,195,4,119,4,3,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,0,0,0,0,40,190,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,14,151,65, }; + u8 encoded_frame[] = { + 85, 135, 0, 195, 4, 119, 4, 3, 70, 197, 6, 0, 106, + 8, 205, 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 112, 61, 0, 0, 0, + 0, 48, 236, 21, 191, 0, 0, 0, 0, 0, 0, 40, 190, + 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, + 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, + 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, + 192, 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, + 0, 64, 175, 62, 0, 0, 0, 0, 0, 64, 175, 62, 0, + 0, 0, 0, 0, 112, 199, 62, 14, 151, 65, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_glo_dep_c_t* test_msg = ( msg_ephemeris_glo_dep_c_t* )test_msg_storage; + msg_ephemeris_glo_dep_c_t *test_msg = + (msg_ephemeris_glo_dep_c_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->acc) == 0) { // Cope with variable length arrays @@ -200,84 +211,142 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC ) test_msg_len += sizeof(test_msg->vel[0]); } test_msg->vel[2] = 869.8177337646484; - sbp_payload_send(&sbp_state, 0x87, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x87, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x87, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_glo_dep_c_t* check_msg = ( msg_ephemeris_glo_dep_c_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_glo_dep_c_t *check_msg = + (msg_ephemeris_glo_dep_c_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->acc[0]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[0], expected 9.31322574615e-07, is %f", check_msg->acc[0]); - ck_assert_msg((check_msg->acc[1]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[1], expected 9.31322574615e-07, is %f", check_msg->acc[1]); - ck_assert_msg((check_msg->acc[2]*100 - 2.79396772385e-06*100) < 0.05, "incorrect value for acc[2], expected 2.79396772385e-06, is %f", check_msg->acc[2]); - ck_assert_msg(check_msg->common.fit_interval == 2400, "incorrect value for common.fit_interval, expected 2400, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 3, "incorrect value for common.sid.code, expected 3, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.sat == 4, "incorrect value for common.sid.sat, expected 4, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toe.tow == 443718, "incorrect value for common.toe.tow, expected 443718, is %d", check_msg->common.toe.tow); - ck_assert_msg(check_msg->common.toe.wn == 2154, "incorrect value for common.toe.wn, expected 2154, is %d", check_msg->common.toe.wn); - ck_assert_msg((check_msg->common.ura*100 - 5.2*100) < 0.05, "incorrect value for common.ura, expected 5.2, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->d_tau*100 - -2.79396772385e-09*100) < 0.05, "incorrect value for d_tau, expected -2.79396772385e-09, is %f", check_msg->d_tau); - ck_assert_msg(check_msg->fcn == 14, "incorrect value for fcn, expected 14, is %d", check_msg->fcn); - ck_assert_msg((check_msg->gamma*100 - 9.09494701773e-13*100) < 0.05, "incorrect value for gamma, expected 9.09494701773e-13, is %f", check_msg->gamma); - ck_assert_msg((check_msg->pos[0]*100 - -12177330.0781*100) < 0.05, "incorrect value for pos[0], expected -12177330.0781, is %f", check_msg->pos[0]); - ck_assert_msg((check_msg->pos[1]*100 - 599893.066406*100) < 0.05, "incorrect value for pos[1], expected 599893.066406, is %f", check_msg->pos[1]); - ck_assert_msg((check_msg->pos[2]*100 - -22373708.4961*100) < 0.05, "incorrect value for pos[2], expected -22373708.4961, is %f", check_msg->pos[2]); - ck_assert_msg((check_msg->tau*100 - -8.36281105876e-05*100) < 0.05, "incorrect value for tau, expected -8.36281105876e-05, is %f", check_msg->tau); - ck_assert_msg((check_msg->vel[0]*100 - -1726.50623322*100) < 0.05, "incorrect value for vel[0], expected -1726.50623322, is %f", check_msg->vel[0]); - ck_assert_msg((check_msg->vel[1]*100 - -2542.61493683*100) < 0.05, "incorrect value for vel[1], expected -2542.61493683, is %f", check_msg->vel[1]); - ck_assert_msg((check_msg->vel[2]*100 - 869.817733765*100) < 0.05, "incorrect value for vel[2], expected 869.817733765, is %f", check_msg->vel[2]); + ck_assert_msg( + (check_msg->acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[0], expected 9.31322574615e-07, is %f", + check_msg->acc[0]); + ck_assert_msg( + (check_msg->acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[1], expected 9.31322574615e-07, is %f", + check_msg->acc[1]); + ck_assert_msg( + (check_msg->acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, + "incorrect value for acc[2], expected 2.79396772385e-06, is %f", + check_msg->acc[2]); + ck_assert_msg( + check_msg->common.fit_interval == 2400, + "incorrect value for common.fit_interval, expected 2400, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 3, + "incorrect value for common.sid.code, expected 3, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.sat == 4, + "incorrect value for common.sid.sat, expected 4, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toe.tow == 443718, + "incorrect value for common.toe.tow, expected 443718, is %d", + check_msg->common.toe.tow); + ck_assert_msg(check_msg->common.toe.wn == 2154, + "incorrect value for common.toe.wn, expected 2154, is %d", + check_msg->common.toe.wn); + ck_assert_msg((check_msg->common.ura * 100 - 5.2 * 100) < 0.05, + "incorrect value for common.ura, expected 5.2, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg( + (check_msg->d_tau * 100 - -2.79396772385e-09 * 100) < 0.05, + "incorrect value for d_tau, expected -2.79396772385e-09, is %f", + check_msg->d_tau); + ck_assert_msg(check_msg->fcn == 14, + "incorrect value for fcn, expected 14, is %d", + check_msg->fcn); + ck_assert_msg( + (check_msg->gamma * 100 - 9.09494701773e-13 * 100) < 0.05, + "incorrect value for gamma, expected 9.09494701773e-13, is %f", + check_msg->gamma); + ck_assert_msg((check_msg->pos[0] * 100 - -12177330.0781 * 100) < 0.05, + "incorrect value for pos[0], expected -12177330.0781, is %f", + check_msg->pos[0]); + ck_assert_msg((check_msg->pos[1] * 100 - 599893.066406 * 100) < 0.05, + "incorrect value for pos[1], expected 599893.066406, is %f", + check_msg->pos[1]); + ck_assert_msg((check_msg->pos[2] * 100 - -22373708.4961 * 100) < 0.05, + "incorrect value for pos[2], expected -22373708.4961, is %f", + check_msg->pos[2]); + ck_assert_msg((check_msg->tau * 100 - -8.36281105876e-05 * 100) < 0.05, + "incorrect value for tau, expected -8.36281105876e-05, is %f", + check_msg->tau); + ck_assert_msg((check_msg->vel[0] * 100 - -1726.50623322 * 100) < 0.05, + "incorrect value for vel[0], expected -1726.50623322, is %f", + check_msg->vel[0]); + ck_assert_msg((check_msg->vel[1] * 100 - -2542.61493683 * 100) < 0.05, + "incorrect value for vel[1], expected -2542.61493683, is %f", + check_msg->vel[1]); + ck_assert_msg((check_msg->vel[2] * 100 - 869.817733765 * 100) < 0.05, + "incorrect value for vel[2], expected 869.817733765, is %f", + check_msg->vel[2]); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisGLODepC_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisGLODepC"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisGLODepC_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisGLODepC"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepD.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepD.c index 3333128b1..45e5b6e36 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepD.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGLODepD.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepD.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepD.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,31 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x88, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x88, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x88, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x88, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,136,0,195,4,120,4,3,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,0,0,0,0,40,190,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,14,100,82,64, }; + u8 encoded_frame[] = { + 85, 136, 0, 195, 4, 120, 4, 3, 70, 197, 6, 0, 106, + 8, 205, 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 112, 61, 0, 0, 0, + 0, 48, 236, 21, 191, 0, 0, 0, 0, 0, 0, 40, 190, + 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, + 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, + 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, + 192, 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, + 0, 64, 175, 62, 0, 0, 0, 0, 0, 64, 175, 62, 0, + 0, 0, 0, 0, 112, 199, 62, 14, 100, 82, 64, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_glo_dep_d_t* test_msg = ( msg_ephemeris_glo_dep_d_t* )test_msg_storage; + msg_ephemeris_glo_dep_d_t *test_msg = + (msg_ephemeris_glo_dep_d_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->acc) == 0) { // Cope with variable length arrays @@ -201,85 +212,145 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD ) test_msg_len += sizeof(test_msg->vel[0]); } test_msg->vel[2] = 869.8177337646484; - sbp_payload_send(&sbp_state, 0x88, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x88, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x88, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_glo_dep_d_t* check_msg = ( msg_ephemeris_glo_dep_d_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_glo_dep_d_t *check_msg = + (msg_ephemeris_glo_dep_d_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->acc[0]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[0], expected 9.31322574615e-07, is %f", check_msg->acc[0]); - ck_assert_msg((check_msg->acc[1]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[1], expected 9.31322574615e-07, is %f", check_msg->acc[1]); - ck_assert_msg((check_msg->acc[2]*100 - 2.79396772385e-06*100) < 0.05, "incorrect value for acc[2], expected 2.79396772385e-06, is %f", check_msg->acc[2]); - ck_assert_msg(check_msg->common.fit_interval == 2400, "incorrect value for common.fit_interval, expected 2400, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 3, "incorrect value for common.sid.code, expected 3, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.sat == 4, "incorrect value for common.sid.sat, expected 4, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toe.tow == 443718, "incorrect value for common.toe.tow, expected 443718, is %d", check_msg->common.toe.tow); - ck_assert_msg(check_msg->common.toe.wn == 2154, "incorrect value for common.toe.wn, expected 2154, is %d", check_msg->common.toe.wn); - ck_assert_msg((check_msg->common.ura*100 - 5.2*100) < 0.05, "incorrect value for common.ura, expected 5.2, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->d_tau*100 - -2.79396772385e-09*100) < 0.05, "incorrect value for d_tau, expected -2.79396772385e-09, is %f", check_msg->d_tau); - ck_assert_msg(check_msg->fcn == 14, "incorrect value for fcn, expected 14, is %d", check_msg->fcn); - ck_assert_msg((check_msg->gamma*100 - 9.09494701773e-13*100) < 0.05, "incorrect value for gamma, expected 9.09494701773e-13, is %f", check_msg->gamma); - ck_assert_msg(check_msg->iod == 100, "incorrect value for iod, expected 100, is %d", check_msg->iod); - ck_assert_msg((check_msg->pos[0]*100 - -12177330.0781*100) < 0.05, "incorrect value for pos[0], expected -12177330.0781, is %f", check_msg->pos[0]); - ck_assert_msg((check_msg->pos[1]*100 - 599893.066406*100) < 0.05, "incorrect value for pos[1], expected 599893.066406, is %f", check_msg->pos[1]); - ck_assert_msg((check_msg->pos[2]*100 - -22373708.4961*100) < 0.05, "incorrect value for pos[2], expected -22373708.4961, is %f", check_msg->pos[2]); - ck_assert_msg((check_msg->tau*100 - -8.36281105876e-05*100) < 0.05, "incorrect value for tau, expected -8.36281105876e-05, is %f", check_msg->tau); - ck_assert_msg((check_msg->vel[0]*100 - -1726.50623322*100) < 0.05, "incorrect value for vel[0], expected -1726.50623322, is %f", check_msg->vel[0]); - ck_assert_msg((check_msg->vel[1]*100 - -2542.61493683*100) < 0.05, "incorrect value for vel[1], expected -2542.61493683, is %f", check_msg->vel[1]); - ck_assert_msg((check_msg->vel[2]*100 - 869.817733765*100) < 0.05, "incorrect value for vel[2], expected 869.817733765, is %f", check_msg->vel[2]); + ck_assert_msg( + (check_msg->acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[0], expected 9.31322574615e-07, is %f", + check_msg->acc[0]); + ck_assert_msg( + (check_msg->acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[1], expected 9.31322574615e-07, is %f", + check_msg->acc[1]); + ck_assert_msg( + (check_msg->acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, + "incorrect value for acc[2], expected 2.79396772385e-06, is %f", + check_msg->acc[2]); + ck_assert_msg( + check_msg->common.fit_interval == 2400, + "incorrect value for common.fit_interval, expected 2400, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 3, + "incorrect value for common.sid.code, expected 3, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.sat == 4, + "incorrect value for common.sid.sat, expected 4, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toe.tow == 443718, + "incorrect value for common.toe.tow, expected 443718, is %d", + check_msg->common.toe.tow); + ck_assert_msg(check_msg->common.toe.wn == 2154, + "incorrect value for common.toe.wn, expected 2154, is %d", + check_msg->common.toe.wn); + ck_assert_msg((check_msg->common.ura * 100 - 5.2 * 100) < 0.05, + "incorrect value for common.ura, expected 5.2, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg( + (check_msg->d_tau * 100 - -2.79396772385e-09 * 100) < 0.05, + "incorrect value for d_tau, expected -2.79396772385e-09, is %f", + check_msg->d_tau); + ck_assert_msg(check_msg->fcn == 14, + "incorrect value for fcn, expected 14, is %d", + check_msg->fcn); + ck_assert_msg( + (check_msg->gamma * 100 - 9.09494701773e-13 * 100) < 0.05, + "incorrect value for gamma, expected 9.09494701773e-13, is %f", + check_msg->gamma); + ck_assert_msg(check_msg->iod == 100, + "incorrect value for iod, expected 100, is %d", + check_msg->iod); + ck_assert_msg((check_msg->pos[0] * 100 - -12177330.0781 * 100) < 0.05, + "incorrect value for pos[0], expected -12177330.0781, is %f", + check_msg->pos[0]); + ck_assert_msg((check_msg->pos[1] * 100 - 599893.066406 * 100) < 0.05, + "incorrect value for pos[1], expected 599893.066406, is %f", + check_msg->pos[1]); + ck_assert_msg((check_msg->pos[2] * 100 - -22373708.4961 * 100) < 0.05, + "incorrect value for pos[2], expected -22373708.4961, is %f", + check_msg->pos[2]); + ck_assert_msg((check_msg->tau * 100 - -8.36281105876e-05 * 100) < 0.05, + "incorrect value for tau, expected -8.36281105876e-05, is %f", + check_msg->tau); + ck_assert_msg((check_msg->vel[0] * 100 - -1726.50623322 * 100) < 0.05, + "incorrect value for vel[0], expected -1726.50623322, is %f", + check_msg->vel[0]); + ck_assert_msg((check_msg->vel[1] * 100 - -2542.61493683 * 100) < 0.05, + "incorrect value for vel[1], expected -2542.61493683, is %f", + check_msg->vel[1]); + ck_assert_msg((check_msg->vel[2] * 100 - 869.817733765 * 100) < 0.05, + "incorrect value for vel[2], expected 869.817733765, is %f", + check_msg->vel[2]); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisGLODepD_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisGLODepD"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisGLODepD_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisGLODepD"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGPS.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGPS.c index e83f92303..020dc2ec8 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGPS.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGPS.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPS.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGPS ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisGPS) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGPS ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,31 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGPS ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x8a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x8a, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x8a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x8a, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,138,0,10,9,139,22,0,176,207,6,0,106,8,0,0,0,64,64,56,0,0,1,0,0,0,152,178,0,64,81,194,0,80,154,67,0,32,56,182,0,128,82,54,0,0,0,50,0,0,248,179,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,96,139,37,186,0,0,30,45,0,0,0,0,176,207,6,0,106,8,45,45,0,170,4, }; + u8 encoded_frame[] = { + 85, 138, 0, 10, 9, 139, 22, 0, 176, 207, 6, 0, 106, 8, + 0, 0, 0, 64, 64, 56, 0, 0, 1, 0, 0, 0, 152, 178, + 0, 64, 81, 194, 0, 80, 154, 67, 0, 32, 56, 182, 0, 128, + 82, 54, 0, 0, 0, 50, 0, 0, 248, 179, 114, 216, 96, 180, + 49, 117, 56, 62, 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, + 0, 32, 191, 247, 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, + 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, 54, 204, 30, + 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, 71, 11, 217, 147, + 145, 228, 237, 63, 221, 47, 100, 224, 255, 47, 198, 189, 96, 139, + 37, 186, 0, 0, 30, 45, 0, 0, 0, 0, 176, 207, 6, 0, + 106, 8, 45, 45, 0, 170, 4, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_gps_t* test_msg = ( msg_ephemeris_gps_t* )test_msg_storage; + msg_ephemeris_gps_t *test_msg = (msg_ephemeris_gps_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = -0.0006315018981695175; test_msg->af1 = 8.981260180007666e-12; @@ -174,94 +185,171 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGPS ) test_msg->toc.tow = 446384; test_msg->toc.wn = 2154; test_msg->w = -0.9893036629599647; - sbp_payload_send(&sbp_state, 0x8a, 2314, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x8a, 2314, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 2314, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 2314, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x8a, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_gps_t* check_msg = ( msg_ephemeris_gps_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_gps_t *check_msg = + (msg_ephemeris_gps_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - -0.00063150189817*100) < 0.05, "incorrect value for af0, expected -0.00063150189817, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - 8.98126018001e-12*100) < 0.05, "incorrect value for af1, expected 8.98126018001e-12, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - 0.0*100) < 0.05, "incorrect value for af2, expected 0.0, is %f", check_msg->af2); - ck_assert_msg((check_msg->c_ic*100 - 7.45058059692e-09*100) < 0.05, "incorrect value for c_ic, expected 7.45058059692e-09, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - -1.15483999252e-07*100) < 0.05, "incorrect value for c_is, expected -1.15483999252e-07, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - 308.625*100) < 0.05, "incorrect value for c_rc, expected 308.625, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - -52.3125*100) < 0.05, "incorrect value for c_rs, expected -52.3125, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - -2.74367630482e-06*100) < 0.05, "incorrect value for c_uc, expected -2.74367630482e-06, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 3.1366944313e-06*100) < 0.05, "incorrect value for c_us, expected 3.1366944313e-06, is %f", check_msg->c_us); - ck_assert_msg(check_msg->common.fit_interval == 14400, "incorrect value for common.fit_interval, expected 14400, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 0, "incorrect value for common.sid.code, expected 0, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.sat == 22, "incorrect value for common.sid.sat, expected 22, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toe.tow == 446384, "incorrect value for common.toe.tow, expected 446384, is %d", check_msg->common.toe.tow); - ck_assert_msg(check_msg->common.toe.wn == 2154, "incorrect value for common.toe.wn, expected 2154, is %d", check_msg->common.toe.wn); - ck_assert_msg((check_msg->common.ura*100 - 2.0*100) < 0.05, "incorrect value for common.ura, expected 2.0, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->dn*100 - 5.69452291402e-09*100) < 0.05, "incorrect value for dn, expected 5.69452291402e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.00707220705226*100) < 0.05, "incorrect value for ecc, expected 0.00707220705226, is %f", check_msg->ecc); - ck_assert_msg((check_msg->inc*100 - 0.934151448026*100) < 0.05, "incorrect value for inc, expected 0.934151448026, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - -4.03588239642e-11*100) < 0.05, "incorrect value for inc_dot, expected -4.03588239642e-11, is %f", check_msg->inc_dot); - ck_assert_msg(check_msg->iodc == 45, "incorrect value for iodc, expected 45, is %d", check_msg->iodc); - ck_assert_msg(check_msg->iode == 45, "incorrect value for iode, expected 45, is %d", check_msg->iode); - ck_assert_msg((check_msg->m0*100 - -0.0220007884211*100) < 0.05, "incorrect value for m0, expected -0.0220007884211, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - -1.87318184488*100) < 0.05, "incorrect value for omega0, expected -1.87318184488, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -8.90358515577e-09*100) < 0.05, "incorrect value for omegadot, expected -8.90358515577e-09, is %f", check_msg->omegadot); - ck_assert_msg((check_msg->sqrta*100 - 5153.55002975*100) < 0.05, "incorrect value for sqrta, expected 5153.55002975, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->tgd*100 - -1.76951289177e-08*100) < 0.05, "incorrect value for tgd, expected -1.76951289177e-08, is %f", check_msg->tgd); - ck_assert_msg(check_msg->toc.tow == 446384, "incorrect value for toc.tow, expected 446384, is %d", check_msg->toc.tow); - ck_assert_msg(check_msg->toc.wn == 2154, "incorrect value for toc.wn, expected 2154, is %d", check_msg->toc.wn); - ck_assert_msg((check_msg->w*100 - -0.98930366296*100) < 0.05, "incorrect value for w, expected -0.98930366296, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - -0.00063150189817 * 100) < 0.05, + "incorrect value for af0, expected -0.00063150189817, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - 8.98126018001e-12 * 100) < 0.05, + "incorrect value for af1, expected 8.98126018001e-12, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for af2, expected 0.0, is %f", + check_msg->af2); + ck_assert_msg((check_msg->c_ic * 100 - 7.45058059692e-09 * 100) < 0.05, + "incorrect value for c_ic, expected 7.45058059692e-09, is %f", + check_msg->c_ic); + ck_assert_msg( + (check_msg->c_is * 100 - -1.15483999252e-07 * 100) < 0.05, + "incorrect value for c_is, expected -1.15483999252e-07, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - 308.625 * 100) < 0.05, + "incorrect value for c_rc, expected 308.625, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - -52.3125 * 100) < 0.05, + "incorrect value for c_rs, expected -52.3125, is %f", + check_msg->c_rs); + ck_assert_msg( + (check_msg->c_uc * 100 - -2.74367630482e-06 * 100) < 0.05, + "incorrect value for c_uc, expected -2.74367630482e-06, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 3.1366944313e-06 * 100) < 0.05, + "incorrect value for c_us, expected 3.1366944313e-06, is %f", + check_msg->c_us); + ck_assert_msg( + check_msg->common.fit_interval == 14400, + "incorrect value for common.fit_interval, expected 14400, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 0, + "incorrect value for common.sid.code, expected 0, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.sat == 22, + "incorrect value for common.sid.sat, expected 22, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toe.tow == 446384, + "incorrect value for common.toe.tow, expected 446384, is %d", + check_msg->common.toe.tow); + ck_assert_msg(check_msg->common.toe.wn == 2154, + "incorrect value for common.toe.wn, expected 2154, is %d", + check_msg->common.toe.wn); + ck_assert_msg((check_msg->common.ura * 100 - 2.0 * 100) < 0.05, + "incorrect value for common.ura, expected 2.0, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg((check_msg->dn * 100 - 5.69452291402e-09 * 100) < 0.05, + "incorrect value for dn, expected 5.69452291402e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.00707220705226 * 100) < 0.05, + "incorrect value for ecc, expected 0.00707220705226, is %f", + check_msg->ecc); + ck_assert_msg((check_msg->inc * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for inc, expected 0.934151448026, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - -4.03588239642e-11 * 100) < 0.05, + "incorrect value for inc_dot, expected -4.03588239642e-11, is %f", + check_msg->inc_dot); + ck_assert_msg(check_msg->iodc == 45, + "incorrect value for iodc, expected 45, is %d", + check_msg->iodc); + ck_assert_msg(check_msg->iode == 45, + "incorrect value for iode, expected 45, is %d", + check_msg->iode); + ck_assert_msg((check_msg->m0 * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for m0, expected -0.0220007884211, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - -1.87318184488 * 100) < 0.05, + "incorrect value for omega0, expected -1.87318184488, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -8.90358515577e-09, is %f", + check_msg->omegadot); + ck_assert_msg((check_msg->sqrta * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for sqrta, expected 5153.55002975, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->tgd * 100 - -1.76951289177e-08 * 100) < 0.05, + "incorrect value for tgd, expected -1.76951289177e-08, is %f", + check_msg->tgd); + ck_assert_msg(check_msg->toc.tow == 446384, + "incorrect value for toc.tow, expected 446384, is %d", + check_msg->toc.tow); + ck_assert_msg(check_msg->toc.wn == 2154, + "incorrect value for toc.wn, expected 2154, is %d", + check_msg->toc.wn); + ck_assert_msg((check_msg->w * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for w, expected -0.98930366296, is %f", + check_msg->w); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisGPS_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisGPS"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGPS"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisGPS); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisGPS_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisGPS"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGPS"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisGPS); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGPSDepE.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGPSDepE.c index 8817b84fb..82814bab3 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGPSDepE.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGPSDepE.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepE.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepE.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,35 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x81, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x81, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x81, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x81, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,129,0,123,0,185,22,0,0,0,176,207,6,0,106,8,0,0,0,0,0,0,0,64,64,56,0,0,1,0,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,0,0,0,0,0,0,0,0,176,207,6,0,106,8,45,45,0,6,238, }; + u8 encoded_frame[] = { + 85, 129, 0, 123, 0, 185, 22, 0, 0, 0, 176, 207, 6, 0, + 106, 8, 0, 0, 0, 0, 0, 0, 0, 64, 64, 56, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 83, 190, 0, 0, 0, 0, + 0, 40, 74, 192, 0, 0, 0, 0, 0, 74, 115, 64, 0, 0, + 0, 0, 0, 4, 199, 190, 0, 0, 0, 0, 0, 80, 202, 62, + 0, 0, 0, 0, 0, 0, 64, 62, 0, 0, 0, 0, 0, 0, + 127, 190, 114, 216, 96, 180, 49, 117, 56, 62, 142, 41, 5, 235, + 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, 63, 0, 0, + 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, + 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, + 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, 221, 47, 100, 224, + 255, 47, 198, 189, 0, 0, 0, 0, 108, 177, 68, 191, 0, 0, + 0, 0, 0, 192, 163, 61, 0, 0, 0, 0, 0, 0, 0, 0, + 176, 207, 6, 0, 106, 8, 45, 45, 0, 6, 238, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_gps_dep_e_t* test_msg = ( msg_ephemeris_gps_dep_e_t* )test_msg_storage; + msg_ephemeris_gps_dep_e_t *test_msg = + (msg_ephemeris_gps_dep_e_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = -0.0006315018981695175; test_msg->af1 = 8.981260180007666e-12; @@ -175,95 +190,174 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE ) test_msg->toc.tow = 446384; test_msg->toc.wn = 2154; test_msg->w = -0.9893036629599647; - sbp_payload_send(&sbp_state, 0x81, 123, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x81, 123, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 123, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x81, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_gps_dep_e_t* check_msg = ( msg_ephemeris_gps_dep_e_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_gps_dep_e_t *check_msg = + (msg_ephemeris_gps_dep_e_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - -0.00063150189817*100) < 0.05, "incorrect value for af0, expected -0.00063150189817, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - 8.98126018001e-12*100) < 0.05, "incorrect value for af1, expected 8.98126018001e-12, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - 0.0*100) < 0.05, "incorrect value for af2, expected 0.0, is %f", check_msg->af2); - ck_assert_msg((check_msg->c_ic*100 - 7.45058059692e-09*100) < 0.05, "incorrect value for c_ic, expected 7.45058059692e-09, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - -1.15483999252e-07*100) < 0.05, "incorrect value for c_is, expected -1.15483999252e-07, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - 308.625*100) < 0.05, "incorrect value for c_rc, expected 308.625, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - -52.3125*100) < 0.05, "incorrect value for c_rs, expected -52.3125, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - -2.74367630482e-06*100) < 0.05, "incorrect value for c_uc, expected -2.74367630482e-06, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 3.1366944313e-06*100) < 0.05, "incorrect value for c_us, expected 3.1366944313e-06, is %f", check_msg->c_us); - ck_assert_msg(check_msg->common.fit_interval == 14400, "incorrect value for common.fit_interval, expected 14400, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 0, "incorrect value for common.sid.code, expected 0, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.reserved == 0, "incorrect value for common.sid.reserved, expected 0, is %d", check_msg->common.sid.reserved); - ck_assert_msg(check_msg->common.sid.sat == 22, "incorrect value for common.sid.sat, expected 22, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toe.tow == 446384, "incorrect value for common.toe.tow, expected 446384, is %d", check_msg->common.toe.tow); - ck_assert_msg(check_msg->common.toe.wn == 2154, "incorrect value for common.toe.wn, expected 2154, is %d", check_msg->common.toe.wn); - ck_assert_msg((check_msg->common.ura*100 - 2.0*100) < 0.05, "incorrect value for common.ura, expected 2.0, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->dn*100 - 5.69452291402e-09*100) < 0.05, "incorrect value for dn, expected 5.69452291402e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.00707220705226*100) < 0.05, "incorrect value for ecc, expected 0.00707220705226, is %f", check_msg->ecc); - ck_assert_msg((check_msg->inc*100 - 0.934151448026*100) < 0.05, "incorrect value for inc, expected 0.934151448026, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - -4.03588239642e-11*100) < 0.05, "incorrect value for inc_dot, expected -4.03588239642e-11, is %f", check_msg->inc_dot); - ck_assert_msg(check_msg->iodc == 45, "incorrect value for iodc, expected 45, is %d", check_msg->iodc); - ck_assert_msg(check_msg->iode == 45, "incorrect value for iode, expected 45, is %d", check_msg->iode); - ck_assert_msg((check_msg->m0*100 - -0.0220007884211*100) < 0.05, "incorrect value for m0, expected -0.0220007884211, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - -1.87318184488*100) < 0.05, "incorrect value for omega0, expected -1.87318184488, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -8.90358515577e-09*100) < 0.05, "incorrect value for omegadot, expected -8.90358515577e-09, is %f", check_msg->omegadot); - ck_assert_msg((check_msg->sqrta*100 - 5153.55002975*100) < 0.05, "incorrect value for sqrta, expected 5153.55002975, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->tgd*100 - -1.76951289177e-08*100) < 0.05, "incorrect value for tgd, expected -1.76951289177e-08, is %f", check_msg->tgd); - ck_assert_msg(check_msg->toc.tow == 446384, "incorrect value for toc.tow, expected 446384, is %d", check_msg->toc.tow); - ck_assert_msg(check_msg->toc.wn == 2154, "incorrect value for toc.wn, expected 2154, is %d", check_msg->toc.wn); - ck_assert_msg((check_msg->w*100 - -0.98930366296*100) < 0.05, "incorrect value for w, expected -0.98930366296, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - -0.00063150189817 * 100) < 0.05, + "incorrect value for af0, expected -0.00063150189817, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - 8.98126018001e-12 * 100) < 0.05, + "incorrect value for af1, expected 8.98126018001e-12, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for af2, expected 0.0, is %f", + check_msg->af2); + ck_assert_msg((check_msg->c_ic * 100 - 7.45058059692e-09 * 100) < 0.05, + "incorrect value for c_ic, expected 7.45058059692e-09, is %f", + check_msg->c_ic); + ck_assert_msg( + (check_msg->c_is * 100 - -1.15483999252e-07 * 100) < 0.05, + "incorrect value for c_is, expected -1.15483999252e-07, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - 308.625 * 100) < 0.05, + "incorrect value for c_rc, expected 308.625, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - -52.3125 * 100) < 0.05, + "incorrect value for c_rs, expected -52.3125, is %f", + check_msg->c_rs); + ck_assert_msg( + (check_msg->c_uc * 100 - -2.74367630482e-06 * 100) < 0.05, + "incorrect value for c_uc, expected -2.74367630482e-06, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 3.1366944313e-06 * 100) < 0.05, + "incorrect value for c_us, expected 3.1366944313e-06, is %f", + check_msg->c_us); + ck_assert_msg( + check_msg->common.fit_interval == 14400, + "incorrect value for common.fit_interval, expected 14400, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 0, + "incorrect value for common.sid.code, expected 0, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.reserved == 0, + "incorrect value for common.sid.reserved, expected 0, is %d", + check_msg->common.sid.reserved); + ck_assert_msg(check_msg->common.sid.sat == 22, + "incorrect value for common.sid.sat, expected 22, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toe.tow == 446384, + "incorrect value for common.toe.tow, expected 446384, is %d", + check_msg->common.toe.tow); + ck_assert_msg(check_msg->common.toe.wn == 2154, + "incorrect value for common.toe.wn, expected 2154, is %d", + check_msg->common.toe.wn); + ck_assert_msg((check_msg->common.ura * 100 - 2.0 * 100) < 0.05, + "incorrect value for common.ura, expected 2.0, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg((check_msg->dn * 100 - 5.69452291402e-09 * 100) < 0.05, + "incorrect value for dn, expected 5.69452291402e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.00707220705226 * 100) < 0.05, + "incorrect value for ecc, expected 0.00707220705226, is %f", + check_msg->ecc); + ck_assert_msg((check_msg->inc * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for inc, expected 0.934151448026, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - -4.03588239642e-11 * 100) < 0.05, + "incorrect value for inc_dot, expected -4.03588239642e-11, is %f", + check_msg->inc_dot); + ck_assert_msg(check_msg->iodc == 45, + "incorrect value for iodc, expected 45, is %d", + check_msg->iodc); + ck_assert_msg(check_msg->iode == 45, + "incorrect value for iode, expected 45, is %d", + check_msg->iode); + ck_assert_msg((check_msg->m0 * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for m0, expected -0.0220007884211, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - -1.87318184488 * 100) < 0.05, + "incorrect value for omega0, expected -1.87318184488, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -8.90358515577e-09, is %f", + check_msg->omegadot); + ck_assert_msg((check_msg->sqrta * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for sqrta, expected 5153.55002975, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->tgd * 100 - -1.76951289177e-08 * 100) < 0.05, + "incorrect value for tgd, expected -1.76951289177e-08, is %f", + check_msg->tgd); + ck_assert_msg(check_msg->toc.tow == 446384, + "incorrect value for toc.tow, expected 446384, is %d", + check_msg->toc.tow); + ck_assert_msg(check_msg->toc.wn == 2154, + "incorrect value for toc.wn, expected 2154, is %d", + check_msg->toc.wn); + ck_assert_msg((check_msg->w * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for w, expected -0.98930366296, is %f", + check_msg->w); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGPSDepF.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGPSDepF.c index 067872202..ad7c42ca8 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGPSDepF.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGPSDepF.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepF.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,35 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x86, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x86, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x86, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x86, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,134,0,123,0,183,22,0,176,207,6,0,106,8,0,0,0,0,0,0,0,64,64,56,0,0,1,0,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,0,0,0,0,0,0,0,0,176,207,6,0,106,8,45,45,0,115,254, }; + u8 encoded_frame[] = { + 85, 134, 0, 123, 0, 183, 22, 0, 176, 207, 6, 0, 106, 8, + 0, 0, 0, 0, 0, 0, 0, 64, 64, 56, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 83, 190, 0, 0, 0, 0, 0, 40, + 74, 192, 0, 0, 0, 0, 0, 74, 115, 64, 0, 0, 0, 0, + 0, 4, 199, 190, 0, 0, 0, 0, 0, 80, 202, 62, 0, 0, + 0, 0, 0, 0, 64, 62, 0, 0, 0, 0, 0, 0, 127, 190, + 114, 216, 96, 180, 49, 117, 56, 62, 142, 41, 5, 235, 95, 135, + 150, 191, 0, 0, 0, 32, 191, 247, 124, 63, 0, 0, 192, 206, + 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, + 81, 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, + 71, 11, 217, 147, 145, 228, 237, 63, 221, 47, 100, 224, 255, 47, + 198, 189, 0, 0, 0, 0, 108, 177, 68, 191, 0, 0, 0, 0, + 0, 192, 163, 61, 0, 0, 0, 0, 0, 0, 0, 0, 176, 207, + 6, 0, 106, 8, 45, 45, 0, 115, 254, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_gps_dep_f_t* test_msg = ( msg_ephemeris_gps_dep_f_t* )test_msg_storage; + msg_ephemeris_gps_dep_f_t *test_msg = + (msg_ephemeris_gps_dep_f_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = -0.0006315018981695175; test_msg->af1 = 8.981260180007666e-12; @@ -174,94 +189,171 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF ) test_msg->toc.tow = 446384; test_msg->toc.wn = 2154; test_msg->w = -0.9893036629599647; - sbp_payload_send(&sbp_state, 0x86, 123, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x86, 123, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 123, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x86, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_gps_dep_f_t* check_msg = ( msg_ephemeris_gps_dep_f_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_gps_dep_f_t *check_msg = + (msg_ephemeris_gps_dep_f_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - -0.00063150189817*100) < 0.05, "incorrect value for af0, expected -0.00063150189817, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - 8.98126018001e-12*100) < 0.05, "incorrect value for af1, expected 8.98126018001e-12, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - 0.0*100) < 0.05, "incorrect value for af2, expected 0.0, is %f", check_msg->af2); - ck_assert_msg((check_msg->c_ic*100 - 7.45058059692e-09*100) < 0.05, "incorrect value for c_ic, expected 7.45058059692e-09, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - -1.15483999252e-07*100) < 0.05, "incorrect value for c_is, expected -1.15483999252e-07, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - 308.625*100) < 0.05, "incorrect value for c_rc, expected 308.625, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - -52.3125*100) < 0.05, "incorrect value for c_rs, expected -52.3125, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - -2.74367630482e-06*100) < 0.05, "incorrect value for c_uc, expected -2.74367630482e-06, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 3.1366944313e-06*100) < 0.05, "incorrect value for c_us, expected 3.1366944313e-06, is %f", check_msg->c_us); - ck_assert_msg(check_msg->common.fit_interval == 14400, "incorrect value for common.fit_interval, expected 14400, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 0, "incorrect value for common.sid.code, expected 0, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.sat == 22, "incorrect value for common.sid.sat, expected 22, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toe.tow == 446384, "incorrect value for common.toe.tow, expected 446384, is %d", check_msg->common.toe.tow); - ck_assert_msg(check_msg->common.toe.wn == 2154, "incorrect value for common.toe.wn, expected 2154, is %d", check_msg->common.toe.wn); - ck_assert_msg((check_msg->common.ura*100 - 2.0*100) < 0.05, "incorrect value for common.ura, expected 2.0, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->dn*100 - 5.69452291402e-09*100) < 0.05, "incorrect value for dn, expected 5.69452291402e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.00707220705226*100) < 0.05, "incorrect value for ecc, expected 0.00707220705226, is %f", check_msg->ecc); - ck_assert_msg((check_msg->inc*100 - 0.934151448026*100) < 0.05, "incorrect value for inc, expected 0.934151448026, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - -4.03588239642e-11*100) < 0.05, "incorrect value for inc_dot, expected -4.03588239642e-11, is %f", check_msg->inc_dot); - ck_assert_msg(check_msg->iodc == 45, "incorrect value for iodc, expected 45, is %d", check_msg->iodc); - ck_assert_msg(check_msg->iode == 45, "incorrect value for iode, expected 45, is %d", check_msg->iode); - ck_assert_msg((check_msg->m0*100 - -0.0220007884211*100) < 0.05, "incorrect value for m0, expected -0.0220007884211, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - -1.87318184488*100) < 0.05, "incorrect value for omega0, expected -1.87318184488, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -8.90358515577e-09*100) < 0.05, "incorrect value for omegadot, expected -8.90358515577e-09, is %f", check_msg->omegadot); - ck_assert_msg((check_msg->sqrta*100 - 5153.55002975*100) < 0.05, "incorrect value for sqrta, expected 5153.55002975, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->tgd*100 - -1.76951289177e-08*100) < 0.05, "incorrect value for tgd, expected -1.76951289177e-08, is %f", check_msg->tgd); - ck_assert_msg(check_msg->toc.tow == 446384, "incorrect value for toc.tow, expected 446384, is %d", check_msg->toc.tow); - ck_assert_msg(check_msg->toc.wn == 2154, "incorrect value for toc.wn, expected 2154, is %d", check_msg->toc.wn); - ck_assert_msg((check_msg->w*100 - -0.98930366296*100) < 0.05, "incorrect value for w, expected -0.98930366296, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - -0.00063150189817 * 100) < 0.05, + "incorrect value for af0, expected -0.00063150189817, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - 8.98126018001e-12 * 100) < 0.05, + "incorrect value for af1, expected 8.98126018001e-12, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for af2, expected 0.0, is %f", + check_msg->af2); + ck_assert_msg((check_msg->c_ic * 100 - 7.45058059692e-09 * 100) < 0.05, + "incorrect value for c_ic, expected 7.45058059692e-09, is %f", + check_msg->c_ic); + ck_assert_msg( + (check_msg->c_is * 100 - -1.15483999252e-07 * 100) < 0.05, + "incorrect value for c_is, expected -1.15483999252e-07, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - 308.625 * 100) < 0.05, + "incorrect value for c_rc, expected 308.625, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - -52.3125 * 100) < 0.05, + "incorrect value for c_rs, expected -52.3125, is %f", + check_msg->c_rs); + ck_assert_msg( + (check_msg->c_uc * 100 - -2.74367630482e-06 * 100) < 0.05, + "incorrect value for c_uc, expected -2.74367630482e-06, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 3.1366944313e-06 * 100) < 0.05, + "incorrect value for c_us, expected 3.1366944313e-06, is %f", + check_msg->c_us); + ck_assert_msg( + check_msg->common.fit_interval == 14400, + "incorrect value for common.fit_interval, expected 14400, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 0, + "incorrect value for common.sid.code, expected 0, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.sat == 22, + "incorrect value for common.sid.sat, expected 22, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toe.tow == 446384, + "incorrect value for common.toe.tow, expected 446384, is %d", + check_msg->common.toe.tow); + ck_assert_msg(check_msg->common.toe.wn == 2154, + "incorrect value for common.toe.wn, expected 2154, is %d", + check_msg->common.toe.wn); + ck_assert_msg((check_msg->common.ura * 100 - 2.0 * 100) < 0.05, + "incorrect value for common.ura, expected 2.0, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg((check_msg->dn * 100 - 5.69452291402e-09 * 100) < 0.05, + "incorrect value for dn, expected 5.69452291402e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.00707220705226 * 100) < 0.05, + "incorrect value for ecc, expected 0.00707220705226, is %f", + check_msg->ecc); + ck_assert_msg((check_msg->inc * 100 - 0.934151448026 * 100) < 0.05, + "incorrect value for inc, expected 0.934151448026, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - -4.03588239642e-11 * 100) < 0.05, + "incorrect value for inc_dot, expected -4.03588239642e-11, is %f", + check_msg->inc_dot); + ck_assert_msg(check_msg->iodc == 45, + "incorrect value for iodc, expected 45, is %d", + check_msg->iodc); + ck_assert_msg(check_msg->iode == 45, + "incorrect value for iode, expected 45, is %d", + check_msg->iode); + ck_assert_msg((check_msg->m0 * 100 - -0.0220007884211 * 100) < 0.05, + "incorrect value for m0, expected -0.0220007884211, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - -1.87318184488 * 100) < 0.05, + "incorrect value for omega0, expected -1.87318184488, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -8.90358515577e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -8.90358515577e-09, is %f", + check_msg->omegadot); + ck_assert_msg((check_msg->sqrta * 100 - 5153.55002975 * 100) < 0.05, + "incorrect value for sqrta, expected 5153.55002975, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->tgd * 100 - -1.76951289177e-08 * 100) < 0.05, + "incorrect value for tgd, expected -1.76951289177e-08, is %f", + check_msg->tgd); + ck_assert_msg(check_msg->toc.tow == 446384, + "incorrect value for toc.tow, expected 446384, is %d", + check_msg->toc.tow); + ck_assert_msg(check_msg->toc.wn == 2154, + "incorrect value for toc.wn, expected 2154, is %d", + check_msg->toc.wn); + ck_assert_msg((check_msg->w * 100 - -0.98930366296 * 100) < 0.05, + "incorrect value for w, expected -0.98930366296, is %f", + check_msg->w); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGal.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGal.c index 1865452a8..77db9e34e 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGal.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGal.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGal.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGal.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGal ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisGal) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGal ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,32 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGal ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x8d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x8d, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x8d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x8d, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,141,0,128,240,153,27,14,32,217,6,0,106,8,20,174,71,64,64,56,0,0,1,0,0,0,16,49,0,0,16,49,0,0,34,65,0,184,132,67,0,0,16,53,0,0,134,54,0,0,8,179,0,0,8,179,217,204,130,105,128,182,43,62,248,106,31,220,8,136,253,191,0,0,0,0,151,92,38,63,0,0,0,55,154,64,181,64,56,38,1,141,255,182,242,63,222,147,136,39,79,186,56,190,80,114,204,251,193,92,191,63,237,55,19,41,177,73,239,63,49,65,189,240,8,216,245,189,255,255,255,255,67,235,241,190,255,255,255,255,255,255,161,189,0,0,0,0,32,217,6,0,106,8,108,0,108,0,0,71,208, }; + u8 encoded_frame[] = { + 85, 141, 0, 128, 240, 153, 27, 14, 32, 217, 6, 0, 106, 8, + 20, 174, 71, 64, 64, 56, 0, 0, 1, 0, 0, 0, 16, 49, + 0, 0, 16, 49, 0, 0, 34, 65, 0, 184, 132, 67, 0, 0, + 16, 53, 0, 0, 134, 54, 0, 0, 8, 179, 0, 0, 8, 179, + 217, 204, 130, 105, 128, 182, 43, 62, 248, 106, 31, 220, 8, 136, + 253, 191, 0, 0, 0, 0, 151, 92, 38, 63, 0, 0, 0, 55, + 154, 64, 181, 64, 56, 38, 1, 141, 255, 182, 242, 63, 222, 147, + 136, 39, 79, 186, 56, 190, 80, 114, 204, 251, 193, 92, 191, 63, + 237, 55, 19, 41, 177, 73, 239, 63, 49, 65, 189, 240, 8, 216, + 245, 189, 255, 255, 255, 255, 67, 235, 241, 190, 255, 255, 255, 255, + 255, 255, 161, 189, 0, 0, 0, 0, 32, 217, 6, 0, 106, 8, + 108, 0, 108, 0, 0, 71, 208, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_gal_t* test_msg = ( msg_ephemeris_gal_t* )test_msg_storage; + msg_ephemeris_gal_t *test_msg = (msg_ephemeris_gal_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = -1.7088896129280325e-05; test_msg->af1 = -8.185452315956353e-12; @@ -176,96 +188,180 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGal ) test_msg->toc.tow = 448800; test_msg->toc.wn = 2154; test_msg->w = 0.12250912091662625; - sbp_payload_send(&sbp_state, 0x8d, 61568, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x8d, 61568, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61568, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 61568, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x8d, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_gal_t* check_msg = ( msg_ephemeris_gal_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_gal_t *check_msg = + (msg_ephemeris_gal_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - -1.70888961293e-05*100) < 0.05, "incorrect value for af0, expected -1.70888961293e-05, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - -8.18545231596e-12*100) < 0.05, "incorrect value for af1, expected -8.18545231596e-12, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - 0.0*100) < 0.05, "incorrect value for af2, expected 0.0, is %f", check_msg->af2); - ck_assert_msg((check_msg->bgd_e1e5a*100 - 2.09547579288e-09*100) < 0.05, "incorrect value for bgd_e1e5a, expected 2.09547579288e-09, is %f", check_msg->bgd_e1e5a); - ck_assert_msg((check_msg->bgd_e1e5b*100 - 2.09547579288e-09*100) < 0.05, "incorrect value for bgd_e1e5b, expected 2.09547579288e-09, is %f", check_msg->bgd_e1e5b); - ck_assert_msg((check_msg->c_ic*100 - -3.16649675369e-08*100) < 0.05, "incorrect value for c_ic, expected -3.16649675369e-08, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - -3.16649675369e-08*100) < 0.05, "incorrect value for c_is, expected -3.16649675369e-08, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - 265.4375*100) < 0.05, "incorrect value for c_rc, expected 265.4375, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - 10.125*100) < 0.05, "incorrect value for c_rs, expected 10.125, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - 5.36441802979e-07*100) < 0.05, "incorrect value for c_uc, expected 5.36441802979e-07, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 3.99351119995e-06*100) < 0.05, "incorrect value for c_us, expected 3.99351119995e-06, is %f", check_msg->c_us); - ck_assert_msg(check_msg->common.fit_interval == 14400, "incorrect value for common.fit_interval, expected 14400, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 14, "incorrect value for common.sid.code, expected 14, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.sat == 27, "incorrect value for common.sid.sat, expected 27, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toe.tow == 448800, "incorrect value for common.toe.tow, expected 448800, is %d", check_msg->common.toe.tow); - ck_assert_msg(check_msg->common.toe.wn == 2154, "incorrect value for common.toe.wn, expected 2154, is %d", check_msg->common.toe.wn); - ck_assert_msg((check_msg->common.ura*100 - 3.11999988556*100) < 0.05, "incorrect value for common.ura, expected 3.11999988556, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->dn*100 - 3.22620581299e-09*100) < 0.05, "incorrect value for dn, expected 3.22620581299e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.000170606072061*100) < 0.05, "incorrect value for ecc, expected 0.000170606072061, is %f", check_msg->ecc); - ck_assert_msg((check_msg->inc*100 - 0.977745609498*100) < 0.05, "incorrect value for inc, expected 0.977745609498, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - -3.17870383435e-10*100) < 0.05, "incorrect value for inc_dot, expected -3.17870383435e-10, is %f", check_msg->inc_dot); - ck_assert_msg(check_msg->iodc == 108, "incorrect value for iodc, expected 108, is %d", check_msg->iodc); - ck_assert_msg(check_msg->iode == 108, "incorrect value for iode, expected 108, is %d", check_msg->iode); - ck_assert_msg((check_msg->m0*100 - -1.84571157442*100) < 0.05, "incorrect value for m0, expected -1.84571157442, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - 1.16967730598*100) < 0.05, "incorrect value for omega0, expected 1.16967730598, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -5.75738267524e-09*100) < 0.05, "incorrect value for omegadot, expected -5.75738267524e-09, is %f", check_msg->omegadot); - ck_assert_msg(check_msg->source == 0, "incorrect value for source, expected 0, is %d", check_msg->source); - ck_assert_msg((check_msg->sqrta*100 - 5440.60240173*100) < 0.05, "incorrect value for sqrta, expected 5440.60240173, is %f", check_msg->sqrta); - ck_assert_msg(check_msg->toc.tow == 448800, "incorrect value for toc.tow, expected 448800, is %d", check_msg->toc.tow); - ck_assert_msg(check_msg->toc.wn == 2154, "incorrect value for toc.wn, expected 2154, is %d", check_msg->toc.wn); - ck_assert_msg((check_msg->w*100 - 0.122509120917*100) < 0.05, "incorrect value for w, expected 0.122509120917, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - -1.70888961293e-05 * 100) < 0.05, + "incorrect value for af0, expected -1.70888961293e-05, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - -8.18545231596e-12 * 100) < 0.05, + "incorrect value for af1, expected -8.18545231596e-12, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for af2, expected 0.0, is %f", + check_msg->af2); + ck_assert_msg( + (check_msg->bgd_e1e5a * 100 - 2.09547579288e-09 * 100) < 0.05, + "incorrect value for bgd_e1e5a, expected 2.09547579288e-09, is %f", + check_msg->bgd_e1e5a); + ck_assert_msg( + (check_msg->bgd_e1e5b * 100 - 2.09547579288e-09 * 100) < 0.05, + "incorrect value for bgd_e1e5b, expected 2.09547579288e-09, is %f", + check_msg->bgd_e1e5b); + ck_assert_msg( + (check_msg->c_ic * 100 - -3.16649675369e-08 * 100) < 0.05, + "incorrect value for c_ic, expected -3.16649675369e-08, is %f", + check_msg->c_ic); + ck_assert_msg( + (check_msg->c_is * 100 - -3.16649675369e-08 * 100) < 0.05, + "incorrect value for c_is, expected -3.16649675369e-08, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - 265.4375 * 100) < 0.05, + "incorrect value for c_rc, expected 265.4375, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - 10.125 * 100) < 0.05, + "incorrect value for c_rs, expected 10.125, is %f", + check_msg->c_rs); + ck_assert_msg((check_msg->c_uc * 100 - 5.36441802979e-07 * 100) < 0.05, + "incorrect value for c_uc, expected 5.36441802979e-07, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 3.99351119995e-06 * 100) < 0.05, + "incorrect value for c_us, expected 3.99351119995e-06, is %f", + check_msg->c_us); + ck_assert_msg( + check_msg->common.fit_interval == 14400, + "incorrect value for common.fit_interval, expected 14400, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 14, + "incorrect value for common.sid.code, expected 14, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.sat == 27, + "incorrect value for common.sid.sat, expected 27, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toe.tow == 448800, + "incorrect value for common.toe.tow, expected 448800, is %d", + check_msg->common.toe.tow); + ck_assert_msg(check_msg->common.toe.wn == 2154, + "incorrect value for common.toe.wn, expected 2154, is %d", + check_msg->common.toe.wn); + ck_assert_msg( + (check_msg->common.ura * 100 - 3.11999988556 * 100) < 0.05, + "incorrect value for common.ura, expected 3.11999988556, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg((check_msg->dn * 100 - 3.22620581299e-09 * 100) < 0.05, + "incorrect value for dn, expected 3.22620581299e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.000170606072061 * 100) < 0.05, + "incorrect value for ecc, expected 0.000170606072061, is %f", + check_msg->ecc); + ck_assert_msg((check_msg->inc * 100 - 0.977745609498 * 100) < 0.05, + "incorrect value for inc, expected 0.977745609498, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - -3.17870383435e-10 * 100) < 0.05, + "incorrect value for inc_dot, expected -3.17870383435e-10, is %f", + check_msg->inc_dot); + ck_assert_msg(check_msg->iodc == 108, + "incorrect value for iodc, expected 108, is %d", + check_msg->iodc); + ck_assert_msg(check_msg->iode == 108, + "incorrect value for iode, expected 108, is %d", + check_msg->iode); + ck_assert_msg((check_msg->m0 * 100 - -1.84571157442 * 100) < 0.05, + "incorrect value for m0, expected -1.84571157442, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - 1.16967730598 * 100) < 0.05, + "incorrect value for omega0, expected 1.16967730598, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -5.75738267524e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -5.75738267524e-09, is %f", + check_msg->omegadot); + ck_assert_msg(check_msg->source == 0, + "incorrect value for source, expected 0, is %d", + check_msg->source); + ck_assert_msg((check_msg->sqrta * 100 - 5440.60240173 * 100) < 0.05, + "incorrect value for sqrta, expected 5440.60240173, is %f", + check_msg->sqrta); + ck_assert_msg(check_msg->toc.tow == 448800, + "incorrect value for toc.tow, expected 448800, is %d", + check_msg->toc.tow); + ck_assert_msg(check_msg->toc.wn == 2154, + "incorrect value for toc.wn, expected 2154, is %d", + check_msg->toc.wn); + ck_assert_msg((check_msg->w * 100 - 0.122509120917 * 100) < 0.05, + "incorrect value for w, expected 0.122509120917, is %f", + check_msg->w); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisGal_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisGal"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGal"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisGal); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisGal_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisGal"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGal"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisGal); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGalDepA.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGalDepA.c index f970cf3f4..b8766df1d 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGalDepA.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisGalDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGalDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGalDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,33 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x95, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x95, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x95, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x95, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,149,0,195,4,152,27,14,32,217,6,0,106,8,102,102,230,64,64,56,0,0,1,0,154,153,153,63,205,204,12,64,0,0,34,65,0,184,132,67,102,102,166,64,102,102,198,64,205,204,76,64,102,102,134,64,217,204,130,105,128,182,43,62,248,106,31,220,8,136,253,191,0,0,0,0,151,92,38,63,0,0,0,55,154,64,181,64,56,38,1,141,255,182,242,63,222,147,136,39,79,186,56,190,80,114,204,251,193,92,191,63,237,55,19,41,177,73,239,63,49,65,189,240,8,216,245,189,255,255,255,255,67,235,241,190,255,255,255,255,255,255,161,189,205,204,76,62,32,217,6,0,106,8,108,0,108,0,168,49, }; + u8 encoded_frame[] = { + 85, 149, 0, 195, 4, 152, 27, 14, 32, 217, 6, 0, 106, 8, + 102, 102, 230, 64, 64, 56, 0, 0, 1, 0, 154, 153, 153, 63, + 205, 204, 12, 64, 0, 0, 34, 65, 0, 184, 132, 67, 102, 102, + 166, 64, 102, 102, 198, 64, 205, 204, 76, 64, 102, 102, 134, 64, + 217, 204, 130, 105, 128, 182, 43, 62, 248, 106, 31, 220, 8, 136, + 253, 191, 0, 0, 0, 0, 151, 92, 38, 63, 0, 0, 0, 55, + 154, 64, 181, 64, 56, 38, 1, 141, 255, 182, 242, 63, 222, 147, + 136, 39, 79, 186, 56, 190, 80, 114, 204, 251, 193, 92, 191, 63, + 237, 55, 19, 41, 177, 73, 239, 63, 49, 65, 189, 240, 8, 216, + 245, 189, 255, 255, 255, 255, 67, 235, 241, 190, 255, 255, 255, 255, + 255, 255, 161, 189, 205, 204, 76, 62, 32, 217, 6, 0, 106, 8, + 108, 0, 108, 0, 168, 49, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_gal_dep_a_t* test_msg = ( msg_ephemeris_gal_dep_a_t* )test_msg_storage; + msg_ephemeris_gal_dep_a_t *test_msg = + (msg_ephemeris_gal_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = -1.7088896129280325e-05; test_msg->af1 = -8.185452315956353e-12; @@ -175,95 +188,175 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA ) test_msg->toc.tow = 448800; test_msg->toc.wn = 2154; test_msg->w = 0.12250912091662625; - sbp_payload_send(&sbp_state, 0x95, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x95, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x95, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_gal_dep_a_t* check_msg = ( msg_ephemeris_gal_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_gal_dep_a_t *check_msg = + (msg_ephemeris_gal_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - -1.70888961293e-05*100) < 0.05, "incorrect value for af0, expected -1.70888961293e-05, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - -8.18545231596e-12*100) < 0.05, "incorrect value for af1, expected -8.18545231596e-12, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - 0.20000000298*100) < 0.05, "incorrect value for af2, expected 0.20000000298, is %f", check_msg->af2); - ck_assert_msg((check_msg->bgd_e1e5a*100 - 1.20000004768*100) < 0.05, "incorrect value for bgd_e1e5a, expected 1.20000004768, is %f", check_msg->bgd_e1e5a); - ck_assert_msg((check_msg->bgd_e1e5b*100 - 2.20000004768*100) < 0.05, "incorrect value for bgd_e1e5b, expected 2.20000004768, is %f", check_msg->bgd_e1e5b); - ck_assert_msg((check_msg->c_ic*100 - 3.20000004768*100) < 0.05, "incorrect value for c_ic, expected 3.20000004768, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - 4.19999980927*100) < 0.05, "incorrect value for c_is, expected 4.19999980927, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - 265.4375*100) < 0.05, "incorrect value for c_rc, expected 265.4375, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - 10.125*100) < 0.05, "incorrect value for c_rs, expected 10.125, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - 5.19999980927*100) < 0.05, "incorrect value for c_uc, expected 5.19999980927, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 6.19999980927*100) < 0.05, "incorrect value for c_us, expected 6.19999980927, is %f", check_msg->c_us); - ck_assert_msg(check_msg->common.fit_interval == 14400, "incorrect value for common.fit_interval, expected 14400, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 14, "incorrect value for common.sid.code, expected 14, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.sat == 27, "incorrect value for common.sid.sat, expected 27, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toe.tow == 448800, "incorrect value for common.toe.tow, expected 448800, is %d", check_msg->common.toe.tow); - ck_assert_msg(check_msg->common.toe.wn == 2154, "incorrect value for common.toe.wn, expected 2154, is %d", check_msg->common.toe.wn); - ck_assert_msg((check_msg->common.ura*100 - 7.19999980927*100) < 0.05, "incorrect value for common.ura, expected 7.19999980927, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->dn*100 - 3.22620581299e-09*100) < 0.05, "incorrect value for dn, expected 3.22620581299e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.000170606072061*100) < 0.05, "incorrect value for ecc, expected 0.000170606072061, is %f", check_msg->ecc); - ck_assert_msg((check_msg->inc*100 - 0.977745609498*100) < 0.05, "incorrect value for inc, expected 0.977745609498, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - -3.17870383435e-10*100) < 0.05, "incorrect value for inc_dot, expected -3.17870383435e-10, is %f", check_msg->inc_dot); - ck_assert_msg(check_msg->iodc == 108, "incorrect value for iodc, expected 108, is %d", check_msg->iodc); - ck_assert_msg(check_msg->iode == 108, "incorrect value for iode, expected 108, is %d", check_msg->iode); - ck_assert_msg((check_msg->m0*100 - -1.84571157442*100) < 0.05, "incorrect value for m0, expected -1.84571157442, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - 1.16967730598*100) < 0.05, "incorrect value for omega0, expected 1.16967730598, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -5.75738267524e-09*100) < 0.05, "incorrect value for omegadot, expected -5.75738267524e-09, is %f", check_msg->omegadot); - ck_assert_msg((check_msg->sqrta*100 - 5440.60240173*100) < 0.05, "incorrect value for sqrta, expected 5440.60240173, is %f", check_msg->sqrta); - ck_assert_msg(check_msg->toc.tow == 448800, "incorrect value for toc.tow, expected 448800, is %d", check_msg->toc.tow); - ck_assert_msg(check_msg->toc.wn == 2154, "incorrect value for toc.wn, expected 2154, is %d", check_msg->toc.wn); - ck_assert_msg((check_msg->w*100 - 0.122509120917*100) < 0.05, "incorrect value for w, expected 0.122509120917, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - -1.70888961293e-05 * 100) < 0.05, + "incorrect value for af0, expected -1.70888961293e-05, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - -8.18545231596e-12 * 100) < 0.05, + "incorrect value for af1, expected -8.18545231596e-12, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - 0.20000000298 * 100) < 0.05, + "incorrect value for af2, expected 0.20000000298, is %f", + check_msg->af2); + ck_assert_msg( + (check_msg->bgd_e1e5a * 100 - 1.20000004768 * 100) < 0.05, + "incorrect value for bgd_e1e5a, expected 1.20000004768, is %f", + check_msg->bgd_e1e5a); + ck_assert_msg( + (check_msg->bgd_e1e5b * 100 - 2.20000004768 * 100) < 0.05, + "incorrect value for bgd_e1e5b, expected 2.20000004768, is %f", + check_msg->bgd_e1e5b); + ck_assert_msg((check_msg->c_ic * 100 - 3.20000004768 * 100) < 0.05, + "incorrect value for c_ic, expected 3.20000004768, is %f", + check_msg->c_ic); + ck_assert_msg((check_msg->c_is * 100 - 4.19999980927 * 100) < 0.05, + "incorrect value for c_is, expected 4.19999980927, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - 265.4375 * 100) < 0.05, + "incorrect value for c_rc, expected 265.4375, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - 10.125 * 100) < 0.05, + "incorrect value for c_rs, expected 10.125, is %f", + check_msg->c_rs); + ck_assert_msg((check_msg->c_uc * 100 - 5.19999980927 * 100) < 0.05, + "incorrect value for c_uc, expected 5.19999980927, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 6.19999980927 * 100) < 0.05, + "incorrect value for c_us, expected 6.19999980927, is %f", + check_msg->c_us); + ck_assert_msg( + check_msg->common.fit_interval == 14400, + "incorrect value for common.fit_interval, expected 14400, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 14, + "incorrect value for common.sid.code, expected 14, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.sat == 27, + "incorrect value for common.sid.sat, expected 27, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toe.tow == 448800, + "incorrect value for common.toe.tow, expected 448800, is %d", + check_msg->common.toe.tow); + ck_assert_msg(check_msg->common.toe.wn == 2154, + "incorrect value for common.toe.wn, expected 2154, is %d", + check_msg->common.toe.wn); + ck_assert_msg( + (check_msg->common.ura * 100 - 7.19999980927 * 100) < 0.05, + "incorrect value for common.ura, expected 7.19999980927, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg((check_msg->dn * 100 - 3.22620581299e-09 * 100) < 0.05, + "incorrect value for dn, expected 3.22620581299e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.000170606072061 * 100) < 0.05, + "incorrect value for ecc, expected 0.000170606072061, is %f", + check_msg->ecc); + ck_assert_msg((check_msg->inc * 100 - 0.977745609498 * 100) < 0.05, + "incorrect value for inc, expected 0.977745609498, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - -3.17870383435e-10 * 100) < 0.05, + "incorrect value for inc_dot, expected -3.17870383435e-10, is %f", + check_msg->inc_dot); + ck_assert_msg(check_msg->iodc == 108, + "incorrect value for iodc, expected 108, is %d", + check_msg->iodc); + ck_assert_msg(check_msg->iode == 108, + "incorrect value for iode, expected 108, is %d", + check_msg->iode); + ck_assert_msg((check_msg->m0 * 100 - -1.84571157442 * 100) < 0.05, + "incorrect value for m0, expected -1.84571157442, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - 1.16967730598 * 100) < 0.05, + "incorrect value for omega0, expected 1.16967730598, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -5.75738267524e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -5.75738267524e-09, is %f", + check_msg->omegadot); + ck_assert_msg((check_msg->sqrta * 100 - 5440.60240173 * 100) < 0.05, + "incorrect value for sqrta, expected 5440.60240173, is %f", + check_msg->sqrta); + ck_assert_msg(check_msg->toc.tow == 448800, + "incorrect value for toc.tow, expected 448800, is %d", + check_msg->toc.tow); + ck_assert_msg(check_msg->toc.wn == 2154, + "incorrect value for toc.wn, expected 2154, is %d", + check_msg->toc.wn); + ck_assert_msg((check_msg->w * 100 - 0.122509120917 * 100) < 0.05, + "incorrect value for w, expected 0.122509120917, is %f", + check_msg->w); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisGalDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisGalDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisGalDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisGalDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisSbas.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisSbas.c index 4775514fa..d9e9f998b 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisSbas.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisSbas.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbas.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbas.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisSbas ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisSbas) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisSbas ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,26 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisSbas ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x8c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x8c, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x8c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x8c, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,140,0,195,4,74,22,6,176,207,6,0,106,8,0,0,64,177,0,0,0,0,1,0,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,51,208,215,196,215,233,30,197,86,116,89,68,0,0,122,53,0,0,122,53,0,128,59,54,96,139,37,186,0,0,30,45,192,147, }; + u8 encoded_frame[] = { + 85, 140, 0, 195, 4, 74, 22, 6, 176, 207, 6, 0, 106, 8, + 0, 0, 64, 177, 0, 0, 0, 0, 1, 0, 0, 0, 128, 66, + 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, 34, 65, 0, 0, + 240, 199, 84, 86, 117, 193, 51, 208, 215, 196, 215, 233, 30, 197, + 86, 116, 89, 68, 0, 0, 122, 53, 0, 0, 122, 53, 0, 128, + 59, 54, 96, 139, 37, 186, 0, 0, 30, 45, 192, 147, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_sbas_t* test_msg = ( msg_ephemeris_sbas_t* )test_msg_storage; + msg_ephemeris_sbas_t *test_msg = (msg_ephemeris_sbas_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->a_gf0 = -0.0006315018981695175; test_msg->a_gf1 = 8.981260180007666e-12; @@ -198,82 +204,136 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisSbas ) test_msg_len += sizeof(test_msg->vel[0]); } test_msg->vel[2] = 869.8177490234375; - sbp_payload_send(&sbp_state, 0x8c, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x8c, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x8c, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_sbas_t* check_msg = ( msg_ephemeris_sbas_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_sbas_t *check_msg = + (msg_ephemeris_sbas_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->a_gf0*100 - -0.00063150189817*100) < 0.05, "incorrect value for a_gf0, expected -0.00063150189817, is %f", check_msg->a_gf0); - ck_assert_msg((check_msg->a_gf1*100 - 8.98126018001e-12*100) < 0.05, "incorrect value for a_gf1, expected 8.98126018001e-12, is %f", check_msg->a_gf1); - ck_assert_msg((check_msg->acc[0]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[0], expected 9.31322574615e-07, is %f", check_msg->acc[0]); - ck_assert_msg((check_msg->acc[1]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[1], expected 9.31322574615e-07, is %f", check_msg->acc[1]); - ck_assert_msg((check_msg->acc[2]*100 - 2.79396772385e-06*100) < 0.05, "incorrect value for acc[2], expected 2.79396772385e-06, is %f", check_msg->acc[2]); - ck_assert_msg(check_msg->common.fit_interval == 0, "incorrect value for common.fit_interval, expected 0, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 6, "incorrect value for common.sid.code, expected 6, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.sat == 22, "incorrect value for common.sid.sat, expected 22, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toe.tow == 446384, "incorrect value for common.toe.tow, expected 446384, is %d", check_msg->common.toe.tow); - ck_assert_msg(check_msg->common.toe.wn == 2154, "incorrect value for common.toe.wn, expected 2154, is %d", check_msg->common.toe.wn); - ck_assert_msg((check_msg->common.ura*100 - -2.79396772385e-09*100) < 0.05, "incorrect value for common.ura, expected -2.79396772385e-09, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->pos[0]*100 - -12177330.0781*100) < 0.05, "incorrect value for pos[0], expected -12177330.0781, is %f", check_msg->pos[0]); - ck_assert_msg((check_msg->pos[1]*100 - 599893.066406*100) < 0.05, "incorrect value for pos[1], expected 599893.066406, is %f", check_msg->pos[1]); - ck_assert_msg((check_msg->pos[2]*100 - -22373708.4961*100) < 0.05, "incorrect value for pos[2], expected -22373708.4961, is %f", check_msg->pos[2]); - ck_assert_msg((check_msg->vel[0]*100 - -1726.50622559*100) < 0.05, "incorrect value for vel[0], expected -1726.50622559, is %f", check_msg->vel[0]); - ck_assert_msg((check_msg->vel[1]*100 - -2542.61499023*100) < 0.05, "incorrect value for vel[1], expected -2542.61499023, is %f", check_msg->vel[1]); - ck_assert_msg((check_msg->vel[2]*100 - 869.817749023*100) < 0.05, "incorrect value for vel[2], expected 869.817749023, is %f", check_msg->vel[2]); + ck_assert_msg( + (check_msg->a_gf0 * 100 - -0.00063150189817 * 100) < 0.05, + "incorrect value for a_gf0, expected -0.00063150189817, is %f", + check_msg->a_gf0); + ck_assert_msg( + (check_msg->a_gf1 * 100 - 8.98126018001e-12 * 100) < 0.05, + "incorrect value for a_gf1, expected 8.98126018001e-12, is %f", + check_msg->a_gf1); + ck_assert_msg( + (check_msg->acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[0], expected 9.31322574615e-07, is %f", + check_msg->acc[0]); + ck_assert_msg( + (check_msg->acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[1], expected 9.31322574615e-07, is %f", + check_msg->acc[1]); + ck_assert_msg( + (check_msg->acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, + "incorrect value for acc[2], expected 2.79396772385e-06, is %f", + check_msg->acc[2]); + ck_assert_msg(check_msg->common.fit_interval == 0, + "incorrect value for common.fit_interval, expected 0, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 6, + "incorrect value for common.sid.code, expected 6, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.sat == 22, + "incorrect value for common.sid.sat, expected 22, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toe.tow == 446384, + "incorrect value for common.toe.tow, expected 446384, is %d", + check_msg->common.toe.tow); + ck_assert_msg(check_msg->common.toe.wn == 2154, + "incorrect value for common.toe.wn, expected 2154, is %d", + check_msg->common.toe.wn); + ck_assert_msg( + (check_msg->common.ura * 100 - -2.79396772385e-09 * 100) < 0.05, + "incorrect value for common.ura, expected -2.79396772385e-09, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg((check_msg->pos[0] * 100 - -12177330.0781 * 100) < 0.05, + "incorrect value for pos[0], expected -12177330.0781, is %f", + check_msg->pos[0]); + ck_assert_msg((check_msg->pos[1] * 100 - 599893.066406 * 100) < 0.05, + "incorrect value for pos[1], expected 599893.066406, is %f", + check_msg->pos[1]); + ck_assert_msg((check_msg->pos[2] * 100 - -22373708.4961 * 100) < 0.05, + "incorrect value for pos[2], expected -22373708.4961, is %f", + check_msg->pos[2]); + ck_assert_msg((check_msg->vel[0] * 100 - -1726.50622559 * 100) < 0.05, + "incorrect value for vel[0], expected -1726.50622559, is %f", + check_msg->vel[0]); + ck_assert_msg((check_msg->vel[1] * 100 - -2542.61499023 * 100) < 0.05, + "incorrect value for vel[1], expected -2542.61499023, is %f", + check_msg->vel[1]); + ck_assert_msg((check_msg->vel[2] * 100 - 869.817749023 * 100) < 0.05, + "incorrect value for vel[2], expected 869.817749023, is %f", + check_msg->vel[2]); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisSbas_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisSbas"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisSbas"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisSbas); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisSbas_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisSbas"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisSbas"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisSbas); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisSbasDepA.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisSbasDepA.c index cce1fe9ee..abb5eb18f 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisSbasDepA.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisSbasDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,30 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x82, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x82, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x82, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x82, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,130,0,123,0,112,22,0,6,0,176,207,6,0,106,8,0,0,0,0,0,0,0,64,0,0,0,0,1,0,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,178,180, }; + u8 encoded_frame[] = { + 85, 130, 0, 123, 0, 112, 22, 0, 6, 0, 176, 207, 6, 0, + 106, 8, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, + 1, 0, 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, + 170, 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, + 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, 192, + 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, 0, 64, + 175, 62, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, + 0, 112, 199, 62, 0, 0, 0, 0, 108, 177, 68, 191, 0, 0, + 0, 0, 0, 192, 163, 61, 178, 180, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_sbas_dep_a_t* test_msg = ( msg_ephemeris_sbas_dep_a_t* )test_msg_storage; + msg_ephemeris_sbas_dep_a_t *test_msg = + (msg_ephemeris_sbas_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->a_gf0 = -0.0006315018981695175; test_msg->a_gf1 = 8.981260180007666e-12; @@ -199,83 +209,138 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA ) test_msg_len += sizeof(test_msg->vel[0]); } test_msg->vel[2] = 869.8177337646484; - sbp_payload_send(&sbp_state, 0x82, 123, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x82, 123, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 123, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x82, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_sbas_dep_a_t* check_msg = ( msg_ephemeris_sbas_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_sbas_dep_a_t *check_msg = + (msg_ephemeris_sbas_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->a_gf0*100 - -0.00063150189817*100) < 0.05, "incorrect value for a_gf0, expected -0.00063150189817, is %f", check_msg->a_gf0); - ck_assert_msg((check_msg->a_gf1*100 - 8.98126018001e-12*100) < 0.05, "incorrect value for a_gf1, expected 8.98126018001e-12, is %f", check_msg->a_gf1); - ck_assert_msg((check_msg->acc[0]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[0], expected 9.31322574615e-07, is %f", check_msg->acc[0]); - ck_assert_msg((check_msg->acc[1]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[1], expected 9.31322574615e-07, is %f", check_msg->acc[1]); - ck_assert_msg((check_msg->acc[2]*100 - 2.79396772385e-06*100) < 0.05, "incorrect value for acc[2], expected 2.79396772385e-06, is %f", check_msg->acc[2]); - ck_assert_msg(check_msg->common.fit_interval == 0, "incorrect value for common.fit_interval, expected 0, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 6, "incorrect value for common.sid.code, expected 6, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.reserved == 0, "incorrect value for common.sid.reserved, expected 0, is %d", check_msg->common.sid.reserved); - ck_assert_msg(check_msg->common.sid.sat == 22, "incorrect value for common.sid.sat, expected 22, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toe.tow == 446384, "incorrect value for common.toe.tow, expected 446384, is %d", check_msg->common.toe.tow); - ck_assert_msg(check_msg->common.toe.wn == 2154, "incorrect value for common.toe.wn, expected 2154, is %d", check_msg->common.toe.wn); - ck_assert_msg((check_msg->common.ura*100 - 2.0*100) < 0.05, "incorrect value for common.ura, expected 2.0, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->pos[0]*100 - -12177330.0781*100) < 0.05, "incorrect value for pos[0], expected -12177330.0781, is %f", check_msg->pos[0]); - ck_assert_msg((check_msg->pos[1]*100 - 599893.066406*100) < 0.05, "incorrect value for pos[1], expected 599893.066406, is %f", check_msg->pos[1]); - ck_assert_msg((check_msg->pos[2]*100 - -22373708.4961*100) < 0.05, "incorrect value for pos[2], expected -22373708.4961, is %f", check_msg->pos[2]); - ck_assert_msg((check_msg->vel[0]*100 - -1726.50623322*100) < 0.05, "incorrect value for vel[0], expected -1726.50623322, is %f", check_msg->vel[0]); - ck_assert_msg((check_msg->vel[1]*100 - -2542.61493683*100) < 0.05, "incorrect value for vel[1], expected -2542.61493683, is %f", check_msg->vel[1]); - ck_assert_msg((check_msg->vel[2]*100 - 869.817733765*100) < 0.05, "incorrect value for vel[2], expected 869.817733765, is %f", check_msg->vel[2]); + ck_assert_msg( + (check_msg->a_gf0 * 100 - -0.00063150189817 * 100) < 0.05, + "incorrect value for a_gf0, expected -0.00063150189817, is %f", + check_msg->a_gf0); + ck_assert_msg( + (check_msg->a_gf1 * 100 - 8.98126018001e-12 * 100) < 0.05, + "incorrect value for a_gf1, expected 8.98126018001e-12, is %f", + check_msg->a_gf1); + ck_assert_msg( + (check_msg->acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[0], expected 9.31322574615e-07, is %f", + check_msg->acc[0]); + ck_assert_msg( + (check_msg->acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[1], expected 9.31322574615e-07, is %f", + check_msg->acc[1]); + ck_assert_msg( + (check_msg->acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, + "incorrect value for acc[2], expected 2.79396772385e-06, is %f", + check_msg->acc[2]); + ck_assert_msg(check_msg->common.fit_interval == 0, + "incorrect value for common.fit_interval, expected 0, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 6, + "incorrect value for common.sid.code, expected 6, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.reserved == 0, + "incorrect value for common.sid.reserved, expected 0, is %d", + check_msg->common.sid.reserved); + ck_assert_msg(check_msg->common.sid.sat == 22, + "incorrect value for common.sid.sat, expected 22, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toe.tow == 446384, + "incorrect value for common.toe.tow, expected 446384, is %d", + check_msg->common.toe.tow); + ck_assert_msg(check_msg->common.toe.wn == 2154, + "incorrect value for common.toe.wn, expected 2154, is %d", + check_msg->common.toe.wn); + ck_assert_msg((check_msg->common.ura * 100 - 2.0 * 100) < 0.05, + "incorrect value for common.ura, expected 2.0, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg((check_msg->pos[0] * 100 - -12177330.0781 * 100) < 0.05, + "incorrect value for pos[0], expected -12177330.0781, is %f", + check_msg->pos[0]); + ck_assert_msg((check_msg->pos[1] * 100 - 599893.066406 * 100) < 0.05, + "incorrect value for pos[1], expected 599893.066406, is %f", + check_msg->pos[1]); + ck_assert_msg((check_msg->pos[2] * 100 - -22373708.4961 * 100) < 0.05, + "incorrect value for pos[2], expected -22373708.4961, is %f", + check_msg->pos[2]); + ck_assert_msg((check_msg->vel[0] * 100 - -1726.50623322 * 100) < 0.05, + "incorrect value for vel[0], expected -1726.50623322, is %f", + check_msg->vel[0]); + ck_assert_msg((check_msg->vel[1] * 100 - -2542.61493683 * 100) < 0.05, + "incorrect value for vel[1], expected -2542.61493683, is %f", + check_msg->vel[1]); + ck_assert_msg((check_msg->vel[2] * 100 - 869.817733765 * 100) < 0.05, + "incorrect value for vel[2], expected 869.817733765, is %f", + check_msg->vel[2]); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisSbasDepB.c b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisSbasDepB.c index ffeb06c3d..f171a2351 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgEphemerisSbasDepB.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgEphemerisSbasDepB.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,30 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x84, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x84, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x84, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x84, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,132,0,123,0,110,22,6,176,207,6,0,106,8,0,0,0,0,0,0,0,64,0,0,0,0,1,0,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,145,104, }; + u8 encoded_frame[] = { + 85, 132, 0, 123, 0, 110, 22, 6, 176, 207, 6, 0, 106, 8, + 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 1, 0, + 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, + 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, 0, 98, + 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, 192, 0, 0, + 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, 0, 64, 175, 62, + 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, 0, 112, + 199, 62, 0, 0, 0, 0, 108, 177, 68, 191, 0, 0, 0, 0, + 0, 192, 163, 61, 145, 104, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_sbas_dep_b_t* test_msg = ( msg_ephemeris_sbas_dep_b_t* )test_msg_storage; + msg_ephemeris_sbas_dep_b_t *test_msg = + (msg_ephemeris_sbas_dep_b_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->a_gf0 = -0.0006315018981695175; test_msg->a_gf1 = 8.981260180007666e-12; @@ -198,82 +208,135 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB ) test_msg_len += sizeof(test_msg->vel[0]); } test_msg->vel[2] = 869.8177337646484; - sbp_payload_send(&sbp_state, 0x84, 123, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x84, 123, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 123, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x84, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_sbas_dep_b_t* check_msg = ( msg_ephemeris_sbas_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_sbas_dep_b_t *check_msg = + (msg_ephemeris_sbas_dep_b_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->a_gf0*100 - -0.00063150189817*100) < 0.05, "incorrect value for a_gf0, expected -0.00063150189817, is %f", check_msg->a_gf0); - ck_assert_msg((check_msg->a_gf1*100 - 8.98126018001e-12*100) < 0.05, "incorrect value for a_gf1, expected 8.98126018001e-12, is %f", check_msg->a_gf1); - ck_assert_msg((check_msg->acc[0]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[0], expected 9.31322574615e-07, is %f", check_msg->acc[0]); - ck_assert_msg((check_msg->acc[1]*100 - 9.31322574615e-07*100) < 0.05, "incorrect value for acc[1], expected 9.31322574615e-07, is %f", check_msg->acc[1]); - ck_assert_msg((check_msg->acc[2]*100 - 2.79396772385e-06*100) < 0.05, "incorrect value for acc[2], expected 2.79396772385e-06, is %f", check_msg->acc[2]); - ck_assert_msg(check_msg->common.fit_interval == 0, "incorrect value for common.fit_interval, expected 0, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 6, "incorrect value for common.sid.code, expected 6, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.sat == 22, "incorrect value for common.sid.sat, expected 22, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toe.tow == 446384, "incorrect value for common.toe.tow, expected 446384, is %d", check_msg->common.toe.tow); - ck_assert_msg(check_msg->common.toe.wn == 2154, "incorrect value for common.toe.wn, expected 2154, is %d", check_msg->common.toe.wn); - ck_assert_msg((check_msg->common.ura*100 - 2.0*100) < 0.05, "incorrect value for common.ura, expected 2.0, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 1, "incorrect value for common.valid, expected 1, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->pos[0]*100 - -12177330.0781*100) < 0.05, "incorrect value for pos[0], expected -12177330.0781, is %f", check_msg->pos[0]); - ck_assert_msg((check_msg->pos[1]*100 - 599893.066406*100) < 0.05, "incorrect value for pos[1], expected 599893.066406, is %f", check_msg->pos[1]); - ck_assert_msg((check_msg->pos[2]*100 - -22373708.4961*100) < 0.05, "incorrect value for pos[2], expected -22373708.4961, is %f", check_msg->pos[2]); - ck_assert_msg((check_msg->vel[0]*100 - -1726.50623322*100) < 0.05, "incorrect value for vel[0], expected -1726.50623322, is %f", check_msg->vel[0]); - ck_assert_msg((check_msg->vel[1]*100 - -2542.61493683*100) < 0.05, "incorrect value for vel[1], expected -2542.61493683, is %f", check_msg->vel[1]); - ck_assert_msg((check_msg->vel[2]*100 - 869.817733765*100) < 0.05, "incorrect value for vel[2], expected 869.817733765, is %f", check_msg->vel[2]); + ck_assert_msg( + (check_msg->a_gf0 * 100 - -0.00063150189817 * 100) < 0.05, + "incorrect value for a_gf0, expected -0.00063150189817, is %f", + check_msg->a_gf0); + ck_assert_msg( + (check_msg->a_gf1 * 100 - 8.98126018001e-12 * 100) < 0.05, + "incorrect value for a_gf1, expected 8.98126018001e-12, is %f", + check_msg->a_gf1); + ck_assert_msg( + (check_msg->acc[0] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[0], expected 9.31322574615e-07, is %f", + check_msg->acc[0]); + ck_assert_msg( + (check_msg->acc[1] * 100 - 9.31322574615e-07 * 100) < 0.05, + "incorrect value for acc[1], expected 9.31322574615e-07, is %f", + check_msg->acc[1]); + ck_assert_msg( + (check_msg->acc[2] * 100 - 2.79396772385e-06 * 100) < 0.05, + "incorrect value for acc[2], expected 2.79396772385e-06, is %f", + check_msg->acc[2]); + ck_assert_msg(check_msg->common.fit_interval == 0, + "incorrect value for common.fit_interval, expected 0, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 6, + "incorrect value for common.sid.code, expected 6, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.sat == 22, + "incorrect value for common.sid.sat, expected 22, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toe.tow == 446384, + "incorrect value for common.toe.tow, expected 446384, is %d", + check_msg->common.toe.tow); + ck_assert_msg(check_msg->common.toe.wn == 2154, + "incorrect value for common.toe.wn, expected 2154, is %d", + check_msg->common.toe.wn); + ck_assert_msg((check_msg->common.ura * 100 - 2.0 * 100) < 0.05, + "incorrect value for common.ura, expected 2.0, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 1, + "incorrect value for common.valid, expected 1, is %d", + check_msg->common.valid); + ck_assert_msg((check_msg->pos[0] * 100 - -12177330.0781 * 100) < 0.05, + "incorrect value for pos[0], expected -12177330.0781, is %f", + check_msg->pos[0]); + ck_assert_msg((check_msg->pos[1] * 100 - 599893.066406 * 100) < 0.05, + "incorrect value for pos[1], expected 599893.066406, is %f", + check_msg->pos[1]); + ck_assert_msg((check_msg->pos[2] * 100 - -22373708.4961 * 100) < 0.05, + "incorrect value for pos[2], expected -22373708.4961, is %f", + check_msg->pos[2]); + ck_assert_msg((check_msg->vel[0] * 100 - -1726.50623322 * 100) < 0.05, + "incorrect value for vel[0], expected -1726.50623322, is %f", + check_msg->vel[0]); + ck_assert_msg((check_msg->vel[1] * 100 - -2542.61493683 * 100) < 0.05, + "incorrect value for vel[1], expected -2542.61493683, is %f", + check_msg->vel[1]); + ck_assert_msg((check_msg->vel[2] * 100 - 869.817733765 * 100) < 0.05, + "incorrect value for vel[2], expected 869.817733765, is %f", + check_msg->vel[2]); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB); +Suite *legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgGloBiases.c b/c/test/legacy/auto_check_sbp_observation_MsgGloBiases.c index 6cf7932c7..433007023 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgGloBiases.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgGloBiases.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGloBiases.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGloBiases.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgGloBiases ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgGloBiases) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgGloBiases ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,84 +128,106 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgGloBiases ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x75, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x75, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x75, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x75, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,117,0,0,0,9,0,0,0,0,0,0,0,0,0,77,211, }; + u8 encoded_frame[] = { + 85, 117, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 211, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_glo_biases_t* test_msg = ( msg_glo_biases_t* )test_msg_storage; + msg_glo_biases_t *test_msg = (msg_glo_biases_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->l1ca_bias = 0; test_msg->l1p_bias = 0; test_msg->l2ca_bias = 0; test_msg->l2p_bias = 0; test_msg->mask = 0; - sbp_payload_send(&sbp_state, 0x75, 0, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x75, 0, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 0, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x75, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_glo_biases_t* check_msg = ( msg_glo_biases_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_glo_biases_t *check_msg = (msg_glo_biases_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->l1ca_bias == 0, "incorrect value for l1ca_bias, expected 0, is %d", check_msg->l1ca_bias); - ck_assert_msg(check_msg->l1p_bias == 0, "incorrect value for l1p_bias, expected 0, is %d", check_msg->l1p_bias); - ck_assert_msg(check_msg->l2ca_bias == 0, "incorrect value for l2ca_bias, expected 0, is %d", check_msg->l2ca_bias); - ck_assert_msg(check_msg->l2p_bias == 0, "incorrect value for l2p_bias, expected 0, is %d", check_msg->l2p_bias); - ck_assert_msg(check_msg->mask == 0, "incorrect value for mask, expected 0, is %d", check_msg->mask); + ck_assert_msg(check_msg->l1ca_bias == 0, + "incorrect value for l1ca_bias, expected 0, is %d", + check_msg->l1ca_bias); + ck_assert_msg(check_msg->l1p_bias == 0, + "incorrect value for l1p_bias, expected 0, is %d", + check_msg->l1p_bias); + ck_assert_msg(check_msg->l2ca_bias == 0, + "incorrect value for l2ca_bias, expected 0, is %d", + check_msg->l2ca_bias); + ck_assert_msg(check_msg->l2p_bias == 0, + "incorrect value for l2p_bias, expected 0, is %d", + check_msg->l2p_bias); + ck_assert_msg(check_msg->mask == 0, + "incorrect value for mask, expected 0, is %d", + check_msg->mask); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgGloBiases_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgGloBiases"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgGloBiases"); +Suite *legacy_auto_check_sbp_observation_MsgGloBiases_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgGloBiases"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgGloBiases"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgGloBiases); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_observation_MsgGnssCapb.c b/c/test/legacy/auto_check_sbp_observation_MsgGnssCapb.c index 05bf019aa..dc79f8639 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgGnssCapb.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgGnssCapb.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGnssCapb.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGnssCapb.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgGnssCapb ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgGnssCapb) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgGnssCapb ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,28 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgGnssCapb ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x96, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x96, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x96, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x96, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,150,0,123,0,110,176,207,6,0,106,8,26,171,80,64,0,0,0,0,81,173,144,46,0,0,0,0,209,139,93,108,0,0,0,0,252,204,200,0,205,92,30,49,240,203,21,24,212,93,182,32,0,0,0,0,105,32,192,27,0,0,0,0,40,75,250,114,0,0,0,0,119,147,123,81,0,0,0,0,85,89,4,2,0,0,0,0,233,116,137,22,0,0,0,0,199,109,219,11,221,171,248,82,0,0,0,0,252,62,221,28,0,0,0,0,163,90, }; + u8 encoded_frame[] = { + 85, 150, 0, 123, 0, 110, 176, 207, 6, 0, 106, 8, 26, 171, 80, + 64, 0, 0, 0, 0, 81, 173, 144, 46, 0, 0, 0, 0, 209, 139, + 93, 108, 0, 0, 0, 0, 252, 204, 200, 0, 205, 92, 30, 49, 240, + 203, 21, 24, 212, 93, 182, 32, 0, 0, 0, 0, 105, 32, 192, 27, + 0, 0, 0, 0, 40, 75, 250, 114, 0, 0, 0, 0, 119, 147, 123, + 81, 0, 0, 0, 0, 85, 89, 4, 2, 0, 0, 0, 0, 233, 116, + 137, 22, 0, 0, 0, 0, 199, 109, 219, 11, 221, 171, 248, 82, 0, + 0, 0, 0, 252, 62, 221, 28, 0, 0, 0, 0, 163, 90, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gnss_capb_t* test_msg = ( msg_gnss_capb_t* )test_msg_storage; + msg_gnss_capb_t *test_msg = (msg_gnss_capb_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->gc.bds_active = 1929005864; test_msg->gc.bds_b2 = 33839445; @@ -160,79 +168,127 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgGnssCapb ) test_msg->gc.sbas_l5 = 465576041; test_msg->t_nmct.tow = 446384; test_msg->t_nmct.wn = 2154; - sbp_payload_send(&sbp_state, 0x96, 123, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x96, 123, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 123, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x96, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gnss_capb_t* check_msg = ( msg_gnss_capb_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gnss_capb_t *check_msg = (msg_gnss_capb_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->gc.bds_active == 1929005864, "incorrect value for gc.bds_active, expected 1929005864, is %d", check_msg->gc.bds_active); - ck_assert_msg(check_msg->gc.bds_b2 == 33839445, "incorrect value for gc.bds_b2, expected 33839445, is %d", check_msg->gc.bds_b2); - ck_assert_msg(check_msg->gc.bds_b2a == 378107113, "incorrect value for gc.bds_b2a, expected 378107113, is %d", check_msg->gc.bds_b2a); - ck_assert_msg(check_msg->gc.bds_d2nav == 1367053175, "incorrect value for gc.bds_d2nav, expected 1367053175, is %d", check_msg->gc.bds_d2nav); - ck_assert_msg(check_msg->gc.gal_active == 1392028637, "incorrect value for gc.gal_active, expected 1392028637, is %d", check_msg->gc.gal_active); - ck_assert_msg(check_msg->gc.gal_e5 == 484261628, "incorrect value for gc.gal_e5, expected 484261628, is %d", check_msg->gc.gal_e5); - ck_assert_msg(check_msg->gc.glo_active == 13159676, "incorrect value for gc.glo_active, expected 13159676, is %d", check_msg->gc.glo_active); - ck_assert_msg(check_msg->gc.glo_l2of == 824073421, "incorrect value for gc.glo_l2of, expected 824073421, is %d", check_msg->gc.glo_l2of); - ck_assert_msg(check_msg->gc.glo_l3 == 404081648, "incorrect value for gc.glo_l3, expected 404081648, is %d", check_msg->gc.glo_l3); - ck_assert_msg(check_msg->gc.gps_active == 1079028506, "incorrect value for gc.gps_active, expected 1079028506, is %d", check_msg->gc.gps_active); - ck_assert_msg(check_msg->gc.gps_l2c == 781233489, "incorrect value for gc.gps_l2c, expected 781233489, is %d", check_msg->gc.gps_l2c); - ck_assert_msg(check_msg->gc.gps_l5 == 1818069969, "incorrect value for gc.gps_l5, expected 1818069969, is %d", check_msg->gc.gps_l5); - ck_assert_msg(check_msg->gc.qzss_active == 198929863, "incorrect value for gc.qzss_active, expected 198929863, is %d", check_msg->gc.qzss_active); - ck_assert_msg(check_msg->gc.sbas_active == 548822484, "incorrect value for gc.sbas_active, expected 548822484, is %d", check_msg->gc.sbas_active); - ck_assert_msg(check_msg->gc.sbas_l5 == 465576041, "incorrect value for gc.sbas_l5, expected 465576041, is %d", check_msg->gc.sbas_l5); - ck_assert_msg(check_msg->t_nmct.tow == 446384, "incorrect value for t_nmct.tow, expected 446384, is %d", check_msg->t_nmct.tow); - ck_assert_msg(check_msg->t_nmct.wn == 2154, "incorrect value for t_nmct.wn, expected 2154, is %d", check_msg->t_nmct.wn); + ck_assert_msg( + check_msg->gc.bds_active == 1929005864, + "incorrect value for gc.bds_active, expected 1929005864, is %d", + check_msg->gc.bds_active); + ck_assert_msg(check_msg->gc.bds_b2 == 33839445, + "incorrect value for gc.bds_b2, expected 33839445, is %d", + check_msg->gc.bds_b2); + ck_assert_msg(check_msg->gc.bds_b2a == 378107113, + "incorrect value for gc.bds_b2a, expected 378107113, is %d", + check_msg->gc.bds_b2a); + ck_assert_msg( + check_msg->gc.bds_d2nav == 1367053175, + "incorrect value for gc.bds_d2nav, expected 1367053175, is %d", + check_msg->gc.bds_d2nav); + ck_assert_msg( + check_msg->gc.gal_active == 1392028637, + "incorrect value for gc.gal_active, expected 1392028637, is %d", + check_msg->gc.gal_active); + ck_assert_msg(check_msg->gc.gal_e5 == 484261628, + "incorrect value for gc.gal_e5, expected 484261628, is %d", + check_msg->gc.gal_e5); + ck_assert_msg(check_msg->gc.glo_active == 13159676, + "incorrect value for gc.glo_active, expected 13159676, is %d", + check_msg->gc.glo_active); + ck_assert_msg(check_msg->gc.glo_l2of == 824073421, + "incorrect value for gc.glo_l2of, expected 824073421, is %d", + check_msg->gc.glo_l2of); + ck_assert_msg(check_msg->gc.glo_l3 == 404081648, + "incorrect value for gc.glo_l3, expected 404081648, is %d", + check_msg->gc.glo_l3); + ck_assert_msg( + check_msg->gc.gps_active == 1079028506, + "incorrect value for gc.gps_active, expected 1079028506, is %d", + check_msg->gc.gps_active); + ck_assert_msg(check_msg->gc.gps_l2c == 781233489, + "incorrect value for gc.gps_l2c, expected 781233489, is %d", + check_msg->gc.gps_l2c); + ck_assert_msg(check_msg->gc.gps_l5 == 1818069969, + "incorrect value for gc.gps_l5, expected 1818069969, is %d", + check_msg->gc.gps_l5); + ck_assert_msg( + check_msg->gc.qzss_active == 198929863, + "incorrect value for gc.qzss_active, expected 198929863, is %d", + check_msg->gc.qzss_active); + ck_assert_msg( + check_msg->gc.sbas_active == 548822484, + "incorrect value for gc.sbas_active, expected 548822484, is %d", + check_msg->gc.sbas_active); + ck_assert_msg(check_msg->gc.sbas_l5 == 465576041, + "incorrect value for gc.sbas_l5, expected 465576041, is %d", + check_msg->gc.sbas_l5); + ck_assert_msg(check_msg->t_nmct.tow == 446384, + "incorrect value for t_nmct.tow, expected 446384, is %d", + check_msg->t_nmct.tow); + ck_assert_msg(check_msg->t_nmct.wn == 2154, + "incorrect value for t_nmct.wn, expected 2154, is %d", + check_msg->t_nmct.wn); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgGnssCapb_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgGnssCapb"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgGnssCapb"); +Suite *legacy_auto_check_sbp_observation_MsgGnssCapb_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgGnssCapb"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgGnssCapb"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgGnssCapb); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_observation_MsgGroupDelay.c b/c/test/legacy/auto_check_sbp_observation_MsgGroupDelay.c index 37f2b42ca..f6c58a23b 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgGroupDelay.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgGroupDelay.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelay.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelay.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgGroupDelay ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgGroupDelay) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgGroupDelay ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgGroupDelay ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x94, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x94, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x94, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x94, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,148,0,123,0,15,176,207,6,0,106,8,22,0,1,254,253,165,255,237,23,2,201, }; + u8 encoded_frame[] = { + 85, 148, 0, 123, 0, 15, 176, 207, 6, 0, 106, 8, + 22, 0, 1, 254, 253, 165, 255, 237, 23, 2, 201, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_group_delay_t* test_msg = ( msg_group_delay_t* )test_msg_storage; + msg_group_delay_t *test_msg = (msg_group_delay_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->isc_l1ca = -91; test_msg->isc_l2c = 6125; @@ -151,70 +153,94 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgGroupDelay ) test_msg->t_op.wn = 2154; test_msg->tgd = -514; test_msg->valid = 1; - sbp_payload_send(&sbp_state, 0x94, 123, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x94, 123, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 123, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x94, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_group_delay_t* check_msg = ( msg_group_delay_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_group_delay_t *check_msg = (msg_group_delay_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->isc_l1ca == -91, "incorrect value for isc_l1ca, expected -91, is %d", check_msg->isc_l1ca); - ck_assert_msg(check_msg->isc_l2c == 6125, "incorrect value for isc_l2c, expected 6125, is %d", check_msg->isc_l2c); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.sat == 22, "incorrect value for sid.sat, expected 22, is %d", check_msg->sid.sat); - ck_assert_msg(check_msg->t_op.tow == 446384, "incorrect value for t_op.tow, expected 446384, is %d", check_msg->t_op.tow); - ck_assert_msg(check_msg->t_op.wn == 2154, "incorrect value for t_op.wn, expected 2154, is %d", check_msg->t_op.wn); - ck_assert_msg(check_msg->tgd == -514, "incorrect value for tgd, expected -514, is %d", check_msg->tgd); - ck_assert_msg(check_msg->valid == 1, "incorrect value for valid, expected 1, is %d", check_msg->valid); + ck_assert_msg(check_msg->isc_l1ca == -91, + "incorrect value for isc_l1ca, expected -91, is %d", + check_msg->isc_l1ca); + ck_assert_msg(check_msg->isc_l2c == 6125, + "incorrect value for isc_l2c, expected 6125, is %d", + check_msg->isc_l2c); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.sat == 22, + "incorrect value for sid.sat, expected 22, is %d", + check_msg->sid.sat); + ck_assert_msg(check_msg->t_op.tow == 446384, + "incorrect value for t_op.tow, expected 446384, is %d", + check_msg->t_op.tow); + ck_assert_msg(check_msg->t_op.wn == 2154, + "incorrect value for t_op.wn, expected 2154, is %d", + check_msg->t_op.wn); + ck_assert_msg(check_msg->tgd == -514, + "incorrect value for tgd, expected -514, is %d", + check_msg->tgd); + ck_assert_msg(check_msg->valid == 1, + "incorrect value for valid, expected 1, is %d", + check_msg->valid); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgGroupDelay_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgGroupDelay"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgGroupDelay"); +Suite *legacy_auto_check_sbp_observation_MsgGroupDelay_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgGroupDelay"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgGroupDelay"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgGroupDelay); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_observation_MsgGroupDelayDepA.c b/c/test/legacy/auto_check_sbp_observation_MsgGroupDelayDepA.c index d216f54d1..beadc3993 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgGroupDelayDepA.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgGroupDelayDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgGroupDelayDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgGroupDelayDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgGroupDelayDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgGroupDelayDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x92, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x92, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x92, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x92, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,146,0,123,0,14,176,207,6,0,106,8,22,1,254,253,165,255,237,23,162,91, }; + u8 encoded_frame[] = { + 85, 146, 0, 123, 0, 14, 176, 207, 6, 0, 106, + 8, 22, 1, 254, 253, 165, 255, 237, 23, 162, 91, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_group_delay_dep_a_t* test_msg = ( msg_group_delay_dep_a_t* )test_msg_storage; + msg_group_delay_dep_a_t *test_msg = + (msg_group_delay_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->isc_l1ca = -91; test_msg->isc_l2c = 6125; @@ -150,70 +153,94 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgGroupDelayDepA ) test_msg->t_op.wn = 2154; test_msg->tgd = -514; test_msg->valid = 1; - sbp_payload_send(&sbp_state, 0x92, 123, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x92, 123, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 123, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x92, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_group_delay_dep_a_t* check_msg = ( msg_group_delay_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_group_delay_dep_a_t *check_msg = + (msg_group_delay_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->isc_l1ca == -91, "incorrect value for isc_l1ca, expected -91, is %d", check_msg->isc_l1ca); - ck_assert_msg(check_msg->isc_l2c == 6125, "incorrect value for isc_l2c, expected 6125, is %d", check_msg->isc_l2c); - ck_assert_msg(check_msg->prn == 22, "incorrect value for prn, expected 22, is %d", check_msg->prn); - ck_assert_msg(check_msg->t_op.tow == 446384, "incorrect value for t_op.tow, expected 446384, is %d", check_msg->t_op.tow); - ck_assert_msg(check_msg->t_op.wn == 2154, "incorrect value for t_op.wn, expected 2154, is %d", check_msg->t_op.wn); - ck_assert_msg(check_msg->tgd == -514, "incorrect value for tgd, expected -514, is %d", check_msg->tgd); - ck_assert_msg(check_msg->valid == 1, "incorrect value for valid, expected 1, is %d", check_msg->valid); + ck_assert_msg(check_msg->isc_l1ca == -91, + "incorrect value for isc_l1ca, expected -91, is %d", + check_msg->isc_l1ca); + ck_assert_msg(check_msg->isc_l2c == 6125, + "incorrect value for isc_l2c, expected 6125, is %d", + check_msg->isc_l2c); + ck_assert_msg(check_msg->prn == 22, + "incorrect value for prn, expected 22, is %d", + check_msg->prn); + ck_assert_msg(check_msg->t_op.tow == 446384, + "incorrect value for t_op.tow, expected 446384, is %d", + check_msg->t_op.tow); + ck_assert_msg(check_msg->t_op.wn == 2154, + "incorrect value for t_op.wn, expected 2154, is %d", + check_msg->t_op.wn); + ck_assert_msg(check_msg->tgd == -514, + "incorrect value for tgd, expected -514, is %d", + check_msg->tgd); + ck_assert_msg(check_msg->valid == 1, + "incorrect value for valid, expected 1, is %d", + check_msg->valid); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgGroupDelayDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgGroupDelayDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgGroupDelayDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgGroupDelayDepA); +Suite *legacy_auto_check_sbp_observation_MsgGroupDelayDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgGroupDelayDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgGroupDelayDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgGroupDelayDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgGroupDelayDepB.c b/c/test/legacy/auto_check_sbp_observation_MsgGroupDelayDepB.c index 2c4c71a0d..2b202994c 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgGroupDelayDepB.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgGroupDelayDepB.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgGroupDelayDepB ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgGroupDelayDepB) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgGroupDelayDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgGroupDelayDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x93, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x93, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x93, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x93, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,147,0,123,0,17,176,207,6,0,106,8,22,0,0,0,1,254,253,165,255,237,23,221,202, }; + u8 encoded_frame[] = { + 85, 147, 0, 123, 0, 17, 176, 207, 6, 0, 106, 8, 22, + 0, 0, 0, 1, 254, 253, 165, 255, 237, 23, 221, 202, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_group_delay_dep_b_t* test_msg = ( msg_group_delay_dep_b_t* )test_msg_storage; + msg_group_delay_dep_b_t *test_msg = + (msg_group_delay_dep_b_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->isc_l1ca = -91; test_msg->isc_l2c = 6125; @@ -152,72 +155,100 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgGroupDelayDepB ) test_msg->t_op.wn = 2154; test_msg->tgd = -514; test_msg->valid = 1; - sbp_payload_send(&sbp_state, 0x93, 123, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x93, 123, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 123, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x93, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_group_delay_dep_b_t* check_msg = ( msg_group_delay_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_group_delay_dep_b_t *check_msg = + (msg_group_delay_dep_b_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->isc_l1ca == -91, "incorrect value for isc_l1ca, expected -91, is %d", check_msg->isc_l1ca); - ck_assert_msg(check_msg->isc_l2c == 6125, "incorrect value for isc_l2c, expected 6125, is %d", check_msg->isc_l2c); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 22, "incorrect value for sid.sat, expected 22, is %d", check_msg->sid.sat); - ck_assert_msg(check_msg->t_op.tow == 446384, "incorrect value for t_op.tow, expected 446384, is %d", check_msg->t_op.tow); - ck_assert_msg(check_msg->t_op.wn == 2154, "incorrect value for t_op.wn, expected 2154, is %d", check_msg->t_op.wn); - ck_assert_msg(check_msg->tgd == -514, "incorrect value for tgd, expected -514, is %d", check_msg->tgd); - ck_assert_msg(check_msg->valid == 1, "incorrect value for valid, expected 1, is %d", check_msg->valid); + ck_assert_msg(check_msg->isc_l1ca == -91, + "incorrect value for isc_l1ca, expected -91, is %d", + check_msg->isc_l1ca); + ck_assert_msg(check_msg->isc_l2c == 6125, + "incorrect value for isc_l2c, expected 6125, is %d", + check_msg->isc_l2c); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 22, + "incorrect value for sid.sat, expected 22, is %d", + check_msg->sid.sat); + ck_assert_msg(check_msg->t_op.tow == 446384, + "incorrect value for t_op.tow, expected 446384, is %d", + check_msg->t_op.tow); + ck_assert_msg(check_msg->t_op.wn == 2154, + "incorrect value for t_op.wn, expected 2154, is %d", + check_msg->t_op.wn); + ck_assert_msg(check_msg->tgd == -514, + "incorrect value for tgd, expected -514, is %d", + check_msg->tgd); + ck_assert_msg(check_msg->valid == 1, + "incorrect value for valid, expected 1, is %d", + check_msg->valid); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgGroupDelayDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgGroupDelayDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgGroupDelayDepB"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgGroupDelayDepB); +Suite *legacy_auto_check_sbp_observation_MsgGroupDelayDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgGroupDelayDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgGroupDelayDepB"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_MsgGroupDelayDepB); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_MsgIono.c b/c/test/legacy/auto_check_sbp_observation_MsgIono.c index 83b46931f..10e03a3cf 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgIono.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgIono.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgIono.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgIono.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgIono ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgIono) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgIono ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,25 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgIono ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x90, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x90, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x90, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x90, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,144,0,123,0,70,0,0,0,0,0,0,0,0,0,0,0,0,52,62,0,0,0,0,0,0,80,62,0,0,0,0,0,0,112,190,0,0,0,0,0,0,112,190,0,0,0,0,0,0,243,64,0,0,0,0,0,0,232,64,0,0,0,0,0,0,240,192,0,0,0,0,0,0,20,193,101,31, }; + u8 encoded_frame[] = { + 85, 144, 0, 123, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 62, 0, 0, 0, 0, 0, 0, 80, 62, 0, 0, 0, 0, + 0, 0, 112, 190, 0, 0, 0, 0, 0, 0, 112, 190, 0, 0, 0, 0, + 0, 0, 243, 64, 0, 0, 0, 0, 0, 0, 232, 64, 0, 0, 0, 0, + 0, 0, 240, 192, 0, 0, 0, 0, 0, 0, 20, 193, 101, 31, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_iono_t* test_msg = ( msg_iono_t* )test_msg_storage; + msg_iono_t *test_msg = (msg_iono_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->a0 = 4.6566128730773926e-09; test_msg->a1 = 1.4901161193847656e-08; @@ -153,72 +158,99 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgIono ) test_msg->b3 = -327680.0; test_msg->t_nmct.tow = 0; test_msg->t_nmct.wn = 0; - sbp_payload_send(&sbp_state, 0x90, 123, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x90, 123, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 123, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x90, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_iono_t* check_msg = ( msg_iono_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_iono_t *check_msg = (msg_iono_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->a0*100 - 4.65661287308e-09*100) < 0.05, "incorrect value for a0, expected 4.65661287308e-09, is %f", check_msg->a0); - ck_assert_msg((check_msg->a1*100 - 1.49011611938e-08*100) < 0.05, "incorrect value for a1, expected 1.49011611938e-08, is %f", check_msg->a1); - ck_assert_msg((check_msg->a2*100 - -5.96046447754e-08*100) < 0.05, "incorrect value for a2, expected -5.96046447754e-08, is %f", check_msg->a2); - ck_assert_msg((check_msg->a3*100 - -5.96046447754e-08*100) < 0.05, "incorrect value for a3, expected -5.96046447754e-08, is %f", check_msg->a3); - ck_assert_msg((check_msg->b0*100 - 77824.0*100) < 0.05, "incorrect value for b0, expected 77824.0, is %f", check_msg->b0); - ck_assert_msg((check_msg->b1*100 - 49152.0*100) < 0.05, "incorrect value for b1, expected 49152.0, is %f", check_msg->b1); - ck_assert_msg((check_msg->b2*100 - -65536.0*100) < 0.05, "incorrect value for b2, expected -65536.0, is %f", check_msg->b2); - ck_assert_msg((check_msg->b3*100 - -327680.0*100) < 0.05, "incorrect value for b3, expected -327680.0, is %f", check_msg->b3); - ck_assert_msg(check_msg->t_nmct.tow == 0, "incorrect value for t_nmct.tow, expected 0, is %d", check_msg->t_nmct.tow); - ck_assert_msg(check_msg->t_nmct.wn == 0, "incorrect value for t_nmct.wn, expected 0, is %d", check_msg->t_nmct.wn); + ck_assert_msg((check_msg->a0 * 100 - 4.65661287308e-09 * 100) < 0.05, + "incorrect value for a0, expected 4.65661287308e-09, is %f", + check_msg->a0); + ck_assert_msg((check_msg->a1 * 100 - 1.49011611938e-08 * 100) < 0.05, + "incorrect value for a1, expected 1.49011611938e-08, is %f", + check_msg->a1); + ck_assert_msg((check_msg->a2 * 100 - -5.96046447754e-08 * 100) < 0.05, + "incorrect value for a2, expected -5.96046447754e-08, is %f", + check_msg->a2); + ck_assert_msg((check_msg->a3 * 100 - -5.96046447754e-08 * 100) < 0.05, + "incorrect value for a3, expected -5.96046447754e-08, is %f", + check_msg->a3); + ck_assert_msg((check_msg->b0 * 100 - 77824.0 * 100) < 0.05, + "incorrect value for b0, expected 77824.0, is %f", + check_msg->b0); + ck_assert_msg((check_msg->b1 * 100 - 49152.0 * 100) < 0.05, + "incorrect value for b1, expected 49152.0, is %f", + check_msg->b1); + ck_assert_msg((check_msg->b2 * 100 - -65536.0 * 100) < 0.05, + "incorrect value for b2, expected -65536.0, is %f", + check_msg->b2); + ck_assert_msg((check_msg->b3 * 100 - -327680.0 * 100) < 0.05, + "incorrect value for b3, expected -327680.0, is %f", + check_msg->b3); + ck_assert_msg(check_msg->t_nmct.tow == 0, + "incorrect value for t_nmct.tow, expected 0, is %d", + check_msg->t_nmct.tow); + ck_assert_msg(check_msg->t_nmct.wn == 0, + "incorrect value for t_nmct.wn, expected 0, is %d", + check_msg->t_nmct.wn); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgIono_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgIono"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgIono"); +Suite *legacy_auto_check_sbp_observation_MsgIono_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_observation_MsgIono"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgIono"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgIono); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_observation_MsgObs.c b/c/test/legacy/auto_check_sbp_observation_MsgObs.c index db8552016..d4d26c11b 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgObs.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgObs.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgObs.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgObs.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgObs ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgObs) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObs ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,39 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObs ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x4a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x4a, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,74,0,129,240,249,152,202,226,25,0,0,0,0,106,8,32,49,227,254,62,121,242,158,6,146,0,250,172,182,10,15,10,0,30,228,254,62,12,189,40,5,59,83,251,172,178,10,15,10,1,215,205,144,72,106,111,160,7,243,109,243,119,158,10,15,18,0,25,207,144,72,223,96,241,5,12,52,246,27,125,9,11,18,1,34,184,223,74,150,138,222,7,53,13,11,245,114,9,15,22,0,113,80,6,69,162,41,65,7,70,127,246,246,189,9,15,23,0,247,80,6,69,213,35,167,5,221,152,248,231,158,9,11,23,1,8,146,166,64,12,122,203,6,114,51,248,67,93,3,11,27,0,221,172,173,75,217,47,244,7,232,225,11,237,123,5,15,31,0,250,174,173,75,216,163,50,6,40,70,9,62,120,3,11,31,1,135,16,6,66,99,218,11,7,7,138,242,96,176,10,15,2,3,148,130,6,58,217,88,54,6,203,21,252,96,170,10,15,3,3,186,108,197,63,127,54,211,6,80,4,241,219,200,10,15,17,3,167,195,8,57,19,204,22,6,105,51,254,182,152,10,15,18,3,237,248, }; + sbp_payload_callback_register(&sbp_state, 0x4a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x4a, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 74, 0, 129, 240, 249, 152, 202, 226, 25, 0, 0, 0, 0, + 106, 8, 32, 49, 227, 254, 62, 121, 242, 158, 6, 146, 0, 250, + 172, 182, 10, 15, 10, 0, 30, 228, 254, 62, 12, 189, 40, 5, + 59, 83, 251, 172, 178, 10, 15, 10, 1, 215, 205, 144, 72, 106, + 111, 160, 7, 243, 109, 243, 119, 158, 10, 15, 18, 0, 25, 207, + 144, 72, 223, 96, 241, 5, 12, 52, 246, 27, 125, 9, 11, 18, + 1, 34, 184, 223, 74, 150, 138, 222, 7, 53, 13, 11, 245, 114, + 9, 15, 22, 0, 113, 80, 6, 69, 162, 41, 65, 7, 70, 127, + 246, 246, 189, 9, 15, 23, 0, 247, 80, 6, 69, 213, 35, 167, + 5, 221, 152, 248, 231, 158, 9, 11, 23, 1, 8, 146, 166, 64, + 12, 122, 203, 6, 114, 51, 248, 67, 93, 3, 11, 27, 0, 221, + 172, 173, 75, 217, 47, 244, 7, 232, 225, 11, 237, 123, 5, 15, + 31, 0, 250, 174, 173, 75, 216, 163, 50, 6, 40, 70, 9, 62, + 120, 3, 11, 31, 1, 135, 16, 6, 66, 99, 218, 11, 7, 7, + 138, 242, 96, 176, 10, 15, 2, 3, 148, 130, 6, 58, 217, 88, + 54, 6, 203, 21, 252, 96, 170, 10, 15, 3, 3, 186, 108, 197, + 63, 127, 54, 211, 6, 80, 4, 241, 219, 200, 10, 15, 17, 3, + 167, 195, 8, 57, 19, 204, 22, 6, 105, 51, 254, 182, 152, 10, + 15, 18, 3, 237, 248, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_t* test_msg = ( msg_obs_t* )test_msg_storage; + msg_obs_t* test_msg = (msg_obs_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 32; test_msg->header.t.ns_residual = 0; @@ -343,203 +362,498 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObs ) test_msg->obs[13].lock = 10; test_msg->obs[13].sid.code = 3; test_msg->obs[13].sid.sat = 18; - sbp_payload_send(&sbp_state, 0x4a, 61569, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x4a, 61569, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61569, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 61569, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x4a, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_t* check_msg = ( msg_obs_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_t* check_msg = (msg_obs_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 32, "incorrect value for header.n_obs, expected 32, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.ns_residual == 0, "incorrect value for header.t.ns_residual, expected 0, is %d", check_msg->header.t.ns_residual); - ck_assert_msg(check_msg->header.t.tow == 434293400, "incorrect value for header.t.tow, expected 434293400, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 2154, "incorrect value for header.t.wn, expected 2154, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].D.f == 172, "incorrect value for obs[0].D.f, expected 172, is %d", check_msg->obs[0].D.f); - ck_assert_msg(check_msg->obs[0].D.i == -1536, "incorrect value for obs[0].D.i, expected -1536, is %d", check_msg->obs[0].D.i); - ck_assert_msg(check_msg->obs[0].L.f == 146, "incorrect value for obs[0].L.f, expected 146, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == 111080057, "incorrect value for obs[0].L.i, expected 111080057, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 1056891697, "incorrect value for obs[0].P, expected 1056891697, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 182, "incorrect value for obs[0].cn0, expected 182, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].flags == 15, "incorrect value for obs[0].flags, expected 15, is %d", check_msg->obs[0].flags); - ck_assert_msg(check_msg->obs[0].lock == 10, "incorrect value for obs[0].lock, expected 10, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].sid.code == 0, "incorrect value for obs[0].sid.code, expected 0, is %d", check_msg->obs[0].sid.code); - ck_assert_msg(check_msg->obs[0].sid.sat == 10, "incorrect value for obs[0].sid.sat, expected 10, is %d", check_msg->obs[0].sid.sat); - ck_assert_msg(check_msg->obs[1].D.f == 172, "incorrect value for obs[1].D.f, expected 172, is %d", check_msg->obs[1].D.f); - ck_assert_msg(check_msg->obs[1].D.i == -1197, "incorrect value for obs[1].D.i, expected -1197, is %d", check_msg->obs[1].D.i); - ck_assert_msg(check_msg->obs[1].L.f == 59, "incorrect value for obs[1].L.f, expected 59, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == 86555916, "incorrect value for obs[1].L.i, expected 86555916, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 1056891934, "incorrect value for obs[1].P, expected 1056891934, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].cn0 == 178, "incorrect value for obs[1].cn0, expected 178, is %d", check_msg->obs[1].cn0); - ck_assert_msg(check_msg->obs[1].flags == 15, "incorrect value for obs[1].flags, expected 15, is %d", check_msg->obs[1].flags); - ck_assert_msg(check_msg->obs[1].lock == 10, "incorrect value for obs[1].lock, expected 10, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].sid.code == 1, "incorrect value for obs[1].sid.code, expected 1, is %d", check_msg->obs[1].sid.code); - ck_assert_msg(check_msg->obs[1].sid.sat == 10, "incorrect value for obs[1].sid.sat, expected 10, is %d", check_msg->obs[1].sid.sat); - ck_assert_msg(check_msg->obs[2].D.f == 119, "incorrect value for obs[2].D.f, expected 119, is %d", check_msg->obs[2].D.f); - ck_assert_msg(check_msg->obs[2].D.i == -3219, "incorrect value for obs[2].D.i, expected -3219, is %d", check_msg->obs[2].D.i); - ck_assert_msg(check_msg->obs[2].L.f == 243, "incorrect value for obs[2].L.f, expected 243, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == 127954794, "incorrect value for obs[2].L.i, expected 127954794, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 1217449431, "incorrect value for obs[2].P, expected 1217449431, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].cn0 == 158, "incorrect value for obs[2].cn0, expected 158, is %d", check_msg->obs[2].cn0); - ck_assert_msg(check_msg->obs[2].flags == 15, "incorrect value for obs[2].flags, expected 15, is %d", check_msg->obs[2].flags); - ck_assert_msg(check_msg->obs[2].lock == 10, "incorrect value for obs[2].lock, expected 10, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].sid.code == 0, "incorrect value for obs[2].sid.code, expected 0, is %d", check_msg->obs[2].sid.code); - ck_assert_msg(check_msg->obs[2].sid.sat == 18, "incorrect value for obs[2].sid.sat, expected 18, is %d", check_msg->obs[2].sid.sat); - ck_assert_msg(check_msg->obs[3].D.f == 27, "incorrect value for obs[3].D.f, expected 27, is %d", check_msg->obs[3].D.f); - ck_assert_msg(check_msg->obs[3].D.i == -2508, "incorrect value for obs[3].D.i, expected -2508, is %d", check_msg->obs[3].D.i); - ck_assert_msg(check_msg->obs[3].L.f == 12, "incorrect value for obs[3].L.f, expected 12, is %d", check_msg->obs[3].L.f); - ck_assert_msg(check_msg->obs[3].L.i == 99705055, "incorrect value for obs[3].L.i, expected 99705055, is %d", check_msg->obs[3].L.i); - ck_assert_msg(check_msg->obs[3].P == 1217449753, "incorrect value for obs[3].P, expected 1217449753, is %d", check_msg->obs[3].P); - ck_assert_msg(check_msg->obs[3].cn0 == 125, "incorrect value for obs[3].cn0, expected 125, is %d", check_msg->obs[3].cn0); - ck_assert_msg(check_msg->obs[3].flags == 11, "incorrect value for obs[3].flags, expected 11, is %d", check_msg->obs[3].flags); - ck_assert_msg(check_msg->obs[3].lock == 9, "incorrect value for obs[3].lock, expected 9, is %d", check_msg->obs[3].lock); - ck_assert_msg(check_msg->obs[3].sid.code == 1, "incorrect value for obs[3].sid.code, expected 1, is %d", check_msg->obs[3].sid.code); - ck_assert_msg(check_msg->obs[3].sid.sat == 18, "incorrect value for obs[3].sid.sat, expected 18, is %d", check_msg->obs[3].sid.sat); - ck_assert_msg(check_msg->obs[4].D.f == 245, "incorrect value for obs[4].D.f, expected 245, is %d", check_msg->obs[4].D.f); - ck_assert_msg(check_msg->obs[4].D.i == 2829, "incorrect value for obs[4].D.i, expected 2829, is %d", check_msg->obs[4].D.i); - ck_assert_msg(check_msg->obs[4].L.f == 53, "incorrect value for obs[4].L.f, expected 53, is %d", check_msg->obs[4].L.f); - ck_assert_msg(check_msg->obs[4].L.i == 132024982, "incorrect value for obs[4].L.i, expected 132024982, is %d", check_msg->obs[4].L.i); - ck_assert_msg(check_msg->obs[4].P == 1256175650, "incorrect value for obs[4].P, expected 1256175650, is %d", check_msg->obs[4].P); - ck_assert_msg(check_msg->obs[4].cn0 == 114, "incorrect value for obs[4].cn0, expected 114, is %d", check_msg->obs[4].cn0); - ck_assert_msg(check_msg->obs[4].flags == 15, "incorrect value for obs[4].flags, expected 15, is %d", check_msg->obs[4].flags); - ck_assert_msg(check_msg->obs[4].lock == 9, "incorrect value for obs[4].lock, expected 9, is %d", check_msg->obs[4].lock); - ck_assert_msg(check_msg->obs[4].sid.code == 0, "incorrect value for obs[4].sid.code, expected 0, is %d", check_msg->obs[4].sid.code); - ck_assert_msg(check_msg->obs[4].sid.sat == 22, "incorrect value for obs[4].sid.sat, expected 22, is %d", check_msg->obs[4].sid.sat); - ck_assert_msg(check_msg->obs[5].D.f == 246, "incorrect value for obs[5].D.f, expected 246, is %d", check_msg->obs[5].D.f); - ck_assert_msg(check_msg->obs[5].D.i == -2433, "incorrect value for obs[5].D.i, expected -2433, is %d", check_msg->obs[5].D.i); - ck_assert_msg(check_msg->obs[5].L.f == 70, "incorrect value for obs[5].L.f, expected 70, is %d", check_msg->obs[5].L.f); - ck_assert_msg(check_msg->obs[5].L.i == 121711010, "incorrect value for obs[5].L.i, expected 121711010, is %d", check_msg->obs[5].L.i); - ck_assert_msg(check_msg->obs[5].P == 1158041713, "incorrect value for obs[5].P, expected 1158041713, is %d", check_msg->obs[5].P); - ck_assert_msg(check_msg->obs[5].cn0 == 189, "incorrect value for obs[5].cn0, expected 189, is %d", check_msg->obs[5].cn0); - ck_assert_msg(check_msg->obs[5].flags == 15, "incorrect value for obs[5].flags, expected 15, is %d", check_msg->obs[5].flags); - ck_assert_msg(check_msg->obs[5].lock == 9, "incorrect value for obs[5].lock, expected 9, is %d", check_msg->obs[5].lock); - ck_assert_msg(check_msg->obs[5].sid.code == 0, "incorrect value for obs[5].sid.code, expected 0, is %d", check_msg->obs[5].sid.code); - ck_assert_msg(check_msg->obs[5].sid.sat == 23, "incorrect value for obs[5].sid.sat, expected 23, is %d", check_msg->obs[5].sid.sat); - ck_assert_msg(check_msg->obs[6].D.f == 231, "incorrect value for obs[6].D.f, expected 231, is %d", check_msg->obs[6].D.f); - ck_assert_msg(check_msg->obs[6].D.i == -1896, "incorrect value for obs[6].D.i, expected -1896, is %d", check_msg->obs[6].D.i); - ck_assert_msg(check_msg->obs[6].L.f == 221, "incorrect value for obs[6].L.f, expected 221, is %d", check_msg->obs[6].L.f); - ck_assert_msg(check_msg->obs[6].L.i == 94839765, "incorrect value for obs[6].L.i, expected 94839765, is %d", check_msg->obs[6].L.i); - ck_assert_msg(check_msg->obs[6].P == 1158041847, "incorrect value for obs[6].P, expected 1158041847, is %d", check_msg->obs[6].P); - ck_assert_msg(check_msg->obs[6].cn0 == 158, "incorrect value for obs[6].cn0, expected 158, is %d", check_msg->obs[6].cn0); - ck_assert_msg(check_msg->obs[6].flags == 11, "incorrect value for obs[6].flags, expected 11, is %d", check_msg->obs[6].flags); - ck_assert_msg(check_msg->obs[6].lock == 9, "incorrect value for obs[6].lock, expected 9, is %d", check_msg->obs[6].lock); - ck_assert_msg(check_msg->obs[6].sid.code == 1, "incorrect value for obs[6].sid.code, expected 1, is %d", check_msg->obs[6].sid.code); - ck_assert_msg(check_msg->obs[6].sid.sat == 23, "incorrect value for obs[6].sid.sat, expected 23, is %d", check_msg->obs[6].sid.sat); - ck_assert_msg(check_msg->obs[7].D.f == 67, "incorrect value for obs[7].D.f, expected 67, is %d", check_msg->obs[7].D.f); - ck_assert_msg(check_msg->obs[7].D.i == -1997, "incorrect value for obs[7].D.i, expected -1997, is %d", check_msg->obs[7].D.i); - ck_assert_msg(check_msg->obs[7].L.f == 114, "incorrect value for obs[7].L.f, expected 114, is %d", check_msg->obs[7].L.f); - ck_assert_msg(check_msg->obs[7].L.i == 113998348, "incorrect value for obs[7].L.i, expected 113998348, is %d", check_msg->obs[7].L.i); - ck_assert_msg(check_msg->obs[7].P == 1084658184, "incorrect value for obs[7].P, expected 1084658184, is %d", check_msg->obs[7].P); - ck_assert_msg(check_msg->obs[7].cn0 == 93, "incorrect value for obs[7].cn0, expected 93, is %d", check_msg->obs[7].cn0); - ck_assert_msg(check_msg->obs[7].flags == 11, "incorrect value for obs[7].flags, expected 11, is %d", check_msg->obs[7].flags); - ck_assert_msg(check_msg->obs[7].lock == 3, "incorrect value for obs[7].lock, expected 3, is %d", check_msg->obs[7].lock); - ck_assert_msg(check_msg->obs[7].sid.code == 0, "incorrect value for obs[7].sid.code, expected 0, is %d", check_msg->obs[7].sid.code); - ck_assert_msg(check_msg->obs[7].sid.sat == 27, "incorrect value for obs[7].sid.sat, expected 27, is %d", check_msg->obs[7].sid.sat); - ck_assert_msg(check_msg->obs[8].D.f == 237, "incorrect value for obs[8].D.f, expected 237, is %d", check_msg->obs[8].D.f); - ck_assert_msg(check_msg->obs[8].D.i == 3041, "incorrect value for obs[8].D.i, expected 3041, is %d", check_msg->obs[8].D.i); - ck_assert_msg(check_msg->obs[8].L.f == 232, "incorrect value for obs[8].L.f, expected 232, is %d", check_msg->obs[8].L.f); - ck_assert_msg(check_msg->obs[8].L.i == 133443545, "incorrect value for obs[8].L.i, expected 133443545, is %d", check_msg->obs[8].L.i); - ck_assert_msg(check_msg->obs[8].P == 1269673181, "incorrect value for obs[8].P, expected 1269673181, is %d", check_msg->obs[8].P); - ck_assert_msg(check_msg->obs[8].cn0 == 123, "incorrect value for obs[8].cn0, expected 123, is %d", check_msg->obs[8].cn0); - ck_assert_msg(check_msg->obs[8].flags == 15, "incorrect value for obs[8].flags, expected 15, is %d", check_msg->obs[8].flags); - ck_assert_msg(check_msg->obs[8].lock == 5, "incorrect value for obs[8].lock, expected 5, is %d", check_msg->obs[8].lock); - ck_assert_msg(check_msg->obs[8].sid.code == 0, "incorrect value for obs[8].sid.code, expected 0, is %d", check_msg->obs[8].sid.code); - ck_assert_msg(check_msg->obs[8].sid.sat == 31, "incorrect value for obs[8].sid.sat, expected 31, is %d", check_msg->obs[8].sid.sat); - ck_assert_msg(check_msg->obs[9].D.f == 62, "incorrect value for obs[9].D.f, expected 62, is %d", check_msg->obs[9].D.f); - ck_assert_msg(check_msg->obs[9].D.i == 2374, "incorrect value for obs[9].D.i, expected 2374, is %d", check_msg->obs[9].D.i); - ck_assert_msg(check_msg->obs[9].L.f == 40, "incorrect value for obs[9].L.f, expected 40, is %d", check_msg->obs[9].L.f); - ck_assert_msg(check_msg->obs[9].L.i == 103982040, "incorrect value for obs[9].L.i, expected 103982040, is %d", check_msg->obs[9].L.i); - ck_assert_msg(check_msg->obs[9].P == 1269673722, "incorrect value for obs[9].P, expected 1269673722, is %d", check_msg->obs[9].P); - ck_assert_msg(check_msg->obs[9].cn0 == 120, "incorrect value for obs[9].cn0, expected 120, is %d", check_msg->obs[9].cn0); - ck_assert_msg(check_msg->obs[9].flags == 11, "incorrect value for obs[9].flags, expected 11, is %d", check_msg->obs[9].flags); - ck_assert_msg(check_msg->obs[9].lock == 3, "incorrect value for obs[9].lock, expected 3, is %d", check_msg->obs[9].lock); - ck_assert_msg(check_msg->obs[9].sid.code == 1, "incorrect value for obs[9].sid.code, expected 1, is %d", check_msg->obs[9].sid.code); - ck_assert_msg(check_msg->obs[9].sid.sat == 31, "incorrect value for obs[9].sid.sat, expected 31, is %d", check_msg->obs[9].sid.sat); - ck_assert_msg(check_msg->obs[10].D.f == 96, "incorrect value for obs[10].D.f, expected 96, is %d", check_msg->obs[10].D.f); - ck_assert_msg(check_msg->obs[10].D.i == -3446, "incorrect value for obs[10].D.i, expected -3446, is %d", check_msg->obs[10].D.i); - ck_assert_msg(check_msg->obs[10].L.f == 7, "incorrect value for obs[10].L.f, expected 7, is %d", check_msg->obs[10].L.f); - ck_assert_msg(check_msg->obs[10].L.i == 118217315, "incorrect value for obs[10].L.i, expected 118217315, is %d", check_msg->obs[10].L.i); - ck_assert_msg(check_msg->obs[10].P == 1107693703, "incorrect value for obs[10].P, expected 1107693703, is %d", check_msg->obs[10].P); - ck_assert_msg(check_msg->obs[10].cn0 == 176, "incorrect value for obs[10].cn0, expected 176, is %d", check_msg->obs[10].cn0); - ck_assert_msg(check_msg->obs[10].flags == 15, "incorrect value for obs[10].flags, expected 15, is %d", check_msg->obs[10].flags); - ck_assert_msg(check_msg->obs[10].lock == 10, "incorrect value for obs[10].lock, expected 10, is %d", check_msg->obs[10].lock); - ck_assert_msg(check_msg->obs[10].sid.code == 3, "incorrect value for obs[10].sid.code, expected 3, is %d", check_msg->obs[10].sid.code); - ck_assert_msg(check_msg->obs[10].sid.sat == 2, "incorrect value for obs[10].sid.sat, expected 2, is %d", check_msg->obs[10].sid.sat); - ck_assert_msg(check_msg->obs[11].D.f == 96, "incorrect value for obs[11].D.f, expected 96, is %d", check_msg->obs[11].D.f); - ck_assert_msg(check_msg->obs[11].D.i == -1003, "incorrect value for obs[11].D.i, expected -1003, is %d", check_msg->obs[11].D.i); - ck_assert_msg(check_msg->obs[11].L.f == 203, "incorrect value for obs[11].L.f, expected 203, is %d", check_msg->obs[11].L.f); - ck_assert_msg(check_msg->obs[11].L.i == 104224985, "incorrect value for obs[11].L.i, expected 104224985, is %d", check_msg->obs[11].L.i); - ck_assert_msg(check_msg->obs[11].P == 973505172, "incorrect value for obs[11].P, expected 973505172, is %d", check_msg->obs[11].P); - ck_assert_msg(check_msg->obs[11].cn0 == 170, "incorrect value for obs[11].cn0, expected 170, is %d", check_msg->obs[11].cn0); - ck_assert_msg(check_msg->obs[11].flags == 15, "incorrect value for obs[11].flags, expected 15, is %d", check_msg->obs[11].flags); - ck_assert_msg(check_msg->obs[11].lock == 10, "incorrect value for obs[11].lock, expected 10, is %d", check_msg->obs[11].lock); - ck_assert_msg(check_msg->obs[11].sid.code == 3, "incorrect value for obs[11].sid.code, expected 3, is %d", check_msg->obs[11].sid.code); - ck_assert_msg(check_msg->obs[11].sid.sat == 3, "incorrect value for obs[11].sid.sat, expected 3, is %d", check_msg->obs[11].sid.sat); - ck_assert_msg(check_msg->obs[12].D.f == 219, "incorrect value for obs[12].D.f, expected 219, is %d", check_msg->obs[12].D.f); - ck_assert_msg(check_msg->obs[12].D.i == -3836, "incorrect value for obs[12].D.i, expected -3836, is %d", check_msg->obs[12].D.i); - ck_assert_msg(check_msg->obs[12].L.f == 80, "incorrect value for obs[12].L.f, expected 80, is %d", check_msg->obs[12].L.f); - ck_assert_msg(check_msg->obs[12].L.i == 114505343, "incorrect value for obs[12].L.i, expected 114505343, is %d", check_msg->obs[12].L.i); - ck_assert_msg(check_msg->obs[12].P == 1069903034, "incorrect value for obs[12].P, expected 1069903034, is %d", check_msg->obs[12].P); - ck_assert_msg(check_msg->obs[12].cn0 == 200, "incorrect value for obs[12].cn0, expected 200, is %d", check_msg->obs[12].cn0); - ck_assert_msg(check_msg->obs[12].flags == 15, "incorrect value for obs[12].flags, expected 15, is %d", check_msg->obs[12].flags); - ck_assert_msg(check_msg->obs[12].lock == 10, "incorrect value for obs[12].lock, expected 10, is %d", check_msg->obs[12].lock); - ck_assert_msg(check_msg->obs[12].sid.code == 3, "incorrect value for obs[12].sid.code, expected 3, is %d", check_msg->obs[12].sid.code); - ck_assert_msg(check_msg->obs[12].sid.sat == 17, "incorrect value for obs[12].sid.sat, expected 17, is %d", check_msg->obs[12].sid.sat); - ck_assert_msg(check_msg->obs[13].D.f == 182, "incorrect value for obs[13].D.f, expected 182, is %d", check_msg->obs[13].D.f); - ck_assert_msg(check_msg->obs[13].D.i == -461, "incorrect value for obs[13].D.i, expected -461, is %d", check_msg->obs[13].D.i); - ck_assert_msg(check_msg->obs[13].L.f == 105, "incorrect value for obs[13].L.f, expected 105, is %d", check_msg->obs[13].L.f); - ck_assert_msg(check_msg->obs[13].L.i == 102157331, "incorrect value for obs[13].L.i, expected 102157331, is %d", check_msg->obs[13].L.i); - ck_assert_msg(check_msg->obs[13].P == 956875687, "incorrect value for obs[13].P, expected 956875687, is %d", check_msg->obs[13].P); - ck_assert_msg(check_msg->obs[13].cn0 == 152, "incorrect value for obs[13].cn0, expected 152, is %d", check_msg->obs[13].cn0); - ck_assert_msg(check_msg->obs[13].flags == 15, "incorrect value for obs[13].flags, expected 15, is %d", check_msg->obs[13].flags); - ck_assert_msg(check_msg->obs[13].lock == 10, "incorrect value for obs[13].lock, expected 10, is %d", check_msg->obs[13].lock); - ck_assert_msg(check_msg->obs[13].sid.code == 3, "incorrect value for obs[13].sid.code, expected 3, is %d", check_msg->obs[13].sid.code); - ck_assert_msg(check_msg->obs[13].sid.sat == 18, "incorrect value for obs[13].sid.sat, expected 18, is %d", check_msg->obs[13].sid.sat); + ck_assert_msg(check_msg->header.n_obs == 32, + "incorrect value for header.n_obs, expected 32, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.ns_residual == 0, + "incorrect value for header.t.ns_residual, expected 0, is %d", + check_msg->header.t.ns_residual); + ck_assert_msg(check_msg->header.t.tow == 434293400, + "incorrect value for header.t.tow, expected 434293400, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 2154, + "incorrect value for header.t.wn, expected 2154, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].D.f == 172, + "incorrect value for obs[0].D.f, expected 172, is %d", + check_msg->obs[0].D.f); + ck_assert_msg(check_msg->obs[0].D.i == -1536, + "incorrect value for obs[0].D.i, expected -1536, is %d", + check_msg->obs[0].D.i); + ck_assert_msg(check_msg->obs[0].L.f == 146, + "incorrect value for obs[0].L.f, expected 146, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == 111080057, + "incorrect value for obs[0].L.i, expected 111080057, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 1056891697, + "incorrect value for obs[0].P, expected 1056891697, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 182, + "incorrect value for obs[0].cn0, expected 182, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].flags == 15, + "incorrect value for obs[0].flags, expected 15, is %d", + check_msg->obs[0].flags); + ck_assert_msg(check_msg->obs[0].lock == 10, + "incorrect value for obs[0].lock, expected 10, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].sid.code == 0, + "incorrect value for obs[0].sid.code, expected 0, is %d", + check_msg->obs[0].sid.code); + ck_assert_msg(check_msg->obs[0].sid.sat == 10, + "incorrect value for obs[0].sid.sat, expected 10, is %d", + check_msg->obs[0].sid.sat); + ck_assert_msg(check_msg->obs[1].D.f == 172, + "incorrect value for obs[1].D.f, expected 172, is %d", + check_msg->obs[1].D.f); + ck_assert_msg(check_msg->obs[1].D.i == -1197, + "incorrect value for obs[1].D.i, expected -1197, is %d", + check_msg->obs[1].D.i); + ck_assert_msg(check_msg->obs[1].L.f == 59, + "incorrect value for obs[1].L.f, expected 59, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == 86555916, + "incorrect value for obs[1].L.i, expected 86555916, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 1056891934, + "incorrect value for obs[1].P, expected 1056891934, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].cn0 == 178, + "incorrect value for obs[1].cn0, expected 178, is %d", + check_msg->obs[1].cn0); + ck_assert_msg(check_msg->obs[1].flags == 15, + "incorrect value for obs[1].flags, expected 15, is %d", + check_msg->obs[1].flags); + ck_assert_msg(check_msg->obs[1].lock == 10, + "incorrect value for obs[1].lock, expected 10, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].sid.code == 1, + "incorrect value for obs[1].sid.code, expected 1, is %d", + check_msg->obs[1].sid.code); + ck_assert_msg(check_msg->obs[1].sid.sat == 10, + "incorrect value for obs[1].sid.sat, expected 10, is %d", + check_msg->obs[1].sid.sat); + ck_assert_msg(check_msg->obs[2].D.f == 119, + "incorrect value for obs[2].D.f, expected 119, is %d", + check_msg->obs[2].D.f); + ck_assert_msg(check_msg->obs[2].D.i == -3219, + "incorrect value for obs[2].D.i, expected -3219, is %d", + check_msg->obs[2].D.i); + ck_assert_msg(check_msg->obs[2].L.f == 243, + "incorrect value for obs[2].L.f, expected 243, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == 127954794, + "incorrect value for obs[2].L.i, expected 127954794, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 1217449431, + "incorrect value for obs[2].P, expected 1217449431, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].cn0 == 158, + "incorrect value for obs[2].cn0, expected 158, is %d", + check_msg->obs[2].cn0); + ck_assert_msg(check_msg->obs[2].flags == 15, + "incorrect value for obs[2].flags, expected 15, is %d", + check_msg->obs[2].flags); + ck_assert_msg(check_msg->obs[2].lock == 10, + "incorrect value for obs[2].lock, expected 10, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].sid.code == 0, + "incorrect value for obs[2].sid.code, expected 0, is %d", + check_msg->obs[2].sid.code); + ck_assert_msg(check_msg->obs[2].sid.sat == 18, + "incorrect value for obs[2].sid.sat, expected 18, is %d", + check_msg->obs[2].sid.sat); + ck_assert_msg(check_msg->obs[3].D.f == 27, + "incorrect value for obs[3].D.f, expected 27, is %d", + check_msg->obs[3].D.f); + ck_assert_msg(check_msg->obs[3].D.i == -2508, + "incorrect value for obs[3].D.i, expected -2508, is %d", + check_msg->obs[3].D.i); + ck_assert_msg(check_msg->obs[3].L.f == 12, + "incorrect value for obs[3].L.f, expected 12, is %d", + check_msg->obs[3].L.f); + ck_assert_msg(check_msg->obs[3].L.i == 99705055, + "incorrect value for obs[3].L.i, expected 99705055, is %d", + check_msg->obs[3].L.i); + ck_assert_msg(check_msg->obs[3].P == 1217449753, + "incorrect value for obs[3].P, expected 1217449753, is %d", + check_msg->obs[3].P); + ck_assert_msg(check_msg->obs[3].cn0 == 125, + "incorrect value for obs[3].cn0, expected 125, is %d", + check_msg->obs[3].cn0); + ck_assert_msg(check_msg->obs[3].flags == 11, + "incorrect value for obs[3].flags, expected 11, is %d", + check_msg->obs[3].flags); + ck_assert_msg(check_msg->obs[3].lock == 9, + "incorrect value for obs[3].lock, expected 9, is %d", + check_msg->obs[3].lock); + ck_assert_msg(check_msg->obs[3].sid.code == 1, + "incorrect value for obs[3].sid.code, expected 1, is %d", + check_msg->obs[3].sid.code); + ck_assert_msg(check_msg->obs[3].sid.sat == 18, + "incorrect value for obs[3].sid.sat, expected 18, is %d", + check_msg->obs[3].sid.sat); + ck_assert_msg(check_msg->obs[4].D.f == 245, + "incorrect value for obs[4].D.f, expected 245, is %d", + check_msg->obs[4].D.f); + ck_assert_msg(check_msg->obs[4].D.i == 2829, + "incorrect value for obs[4].D.i, expected 2829, is %d", + check_msg->obs[4].D.i); + ck_assert_msg(check_msg->obs[4].L.f == 53, + "incorrect value for obs[4].L.f, expected 53, is %d", + check_msg->obs[4].L.f); + ck_assert_msg(check_msg->obs[4].L.i == 132024982, + "incorrect value for obs[4].L.i, expected 132024982, is %d", + check_msg->obs[4].L.i); + ck_assert_msg(check_msg->obs[4].P == 1256175650, + "incorrect value for obs[4].P, expected 1256175650, is %d", + check_msg->obs[4].P); + ck_assert_msg(check_msg->obs[4].cn0 == 114, + "incorrect value for obs[4].cn0, expected 114, is %d", + check_msg->obs[4].cn0); + ck_assert_msg(check_msg->obs[4].flags == 15, + "incorrect value for obs[4].flags, expected 15, is %d", + check_msg->obs[4].flags); + ck_assert_msg(check_msg->obs[4].lock == 9, + "incorrect value for obs[4].lock, expected 9, is %d", + check_msg->obs[4].lock); + ck_assert_msg(check_msg->obs[4].sid.code == 0, + "incorrect value for obs[4].sid.code, expected 0, is %d", + check_msg->obs[4].sid.code); + ck_assert_msg(check_msg->obs[4].sid.sat == 22, + "incorrect value for obs[4].sid.sat, expected 22, is %d", + check_msg->obs[4].sid.sat); + ck_assert_msg(check_msg->obs[5].D.f == 246, + "incorrect value for obs[5].D.f, expected 246, is %d", + check_msg->obs[5].D.f); + ck_assert_msg(check_msg->obs[5].D.i == -2433, + "incorrect value for obs[5].D.i, expected -2433, is %d", + check_msg->obs[5].D.i); + ck_assert_msg(check_msg->obs[5].L.f == 70, + "incorrect value for obs[5].L.f, expected 70, is %d", + check_msg->obs[5].L.f); + ck_assert_msg(check_msg->obs[5].L.i == 121711010, + "incorrect value for obs[5].L.i, expected 121711010, is %d", + check_msg->obs[5].L.i); + ck_assert_msg(check_msg->obs[5].P == 1158041713, + "incorrect value for obs[5].P, expected 1158041713, is %d", + check_msg->obs[5].P); + ck_assert_msg(check_msg->obs[5].cn0 == 189, + "incorrect value for obs[5].cn0, expected 189, is %d", + check_msg->obs[5].cn0); + ck_assert_msg(check_msg->obs[5].flags == 15, + "incorrect value for obs[5].flags, expected 15, is %d", + check_msg->obs[5].flags); + ck_assert_msg(check_msg->obs[5].lock == 9, + "incorrect value for obs[5].lock, expected 9, is %d", + check_msg->obs[5].lock); + ck_assert_msg(check_msg->obs[5].sid.code == 0, + "incorrect value for obs[5].sid.code, expected 0, is %d", + check_msg->obs[5].sid.code); + ck_assert_msg(check_msg->obs[5].sid.sat == 23, + "incorrect value for obs[5].sid.sat, expected 23, is %d", + check_msg->obs[5].sid.sat); + ck_assert_msg(check_msg->obs[6].D.f == 231, + "incorrect value for obs[6].D.f, expected 231, is %d", + check_msg->obs[6].D.f); + ck_assert_msg(check_msg->obs[6].D.i == -1896, + "incorrect value for obs[6].D.i, expected -1896, is %d", + check_msg->obs[6].D.i); + ck_assert_msg(check_msg->obs[6].L.f == 221, + "incorrect value for obs[6].L.f, expected 221, is %d", + check_msg->obs[6].L.f); + ck_assert_msg(check_msg->obs[6].L.i == 94839765, + "incorrect value for obs[6].L.i, expected 94839765, is %d", + check_msg->obs[6].L.i); + ck_assert_msg(check_msg->obs[6].P == 1158041847, + "incorrect value for obs[6].P, expected 1158041847, is %d", + check_msg->obs[6].P); + ck_assert_msg(check_msg->obs[6].cn0 == 158, + "incorrect value for obs[6].cn0, expected 158, is %d", + check_msg->obs[6].cn0); + ck_assert_msg(check_msg->obs[6].flags == 11, + "incorrect value for obs[6].flags, expected 11, is %d", + check_msg->obs[6].flags); + ck_assert_msg(check_msg->obs[6].lock == 9, + "incorrect value for obs[6].lock, expected 9, is %d", + check_msg->obs[6].lock); + ck_assert_msg(check_msg->obs[6].sid.code == 1, + "incorrect value for obs[6].sid.code, expected 1, is %d", + check_msg->obs[6].sid.code); + ck_assert_msg(check_msg->obs[6].sid.sat == 23, + "incorrect value for obs[6].sid.sat, expected 23, is %d", + check_msg->obs[6].sid.sat); + ck_assert_msg(check_msg->obs[7].D.f == 67, + "incorrect value for obs[7].D.f, expected 67, is %d", + check_msg->obs[7].D.f); + ck_assert_msg(check_msg->obs[7].D.i == -1997, + "incorrect value for obs[7].D.i, expected -1997, is %d", + check_msg->obs[7].D.i); + ck_assert_msg(check_msg->obs[7].L.f == 114, + "incorrect value for obs[7].L.f, expected 114, is %d", + check_msg->obs[7].L.f); + ck_assert_msg(check_msg->obs[7].L.i == 113998348, + "incorrect value for obs[7].L.i, expected 113998348, is %d", + check_msg->obs[7].L.i); + ck_assert_msg(check_msg->obs[7].P == 1084658184, + "incorrect value for obs[7].P, expected 1084658184, is %d", + check_msg->obs[7].P); + ck_assert_msg(check_msg->obs[7].cn0 == 93, + "incorrect value for obs[7].cn0, expected 93, is %d", + check_msg->obs[7].cn0); + ck_assert_msg(check_msg->obs[7].flags == 11, + "incorrect value for obs[7].flags, expected 11, is %d", + check_msg->obs[7].flags); + ck_assert_msg(check_msg->obs[7].lock == 3, + "incorrect value for obs[7].lock, expected 3, is %d", + check_msg->obs[7].lock); + ck_assert_msg(check_msg->obs[7].sid.code == 0, + "incorrect value for obs[7].sid.code, expected 0, is %d", + check_msg->obs[7].sid.code); + ck_assert_msg(check_msg->obs[7].sid.sat == 27, + "incorrect value for obs[7].sid.sat, expected 27, is %d", + check_msg->obs[7].sid.sat); + ck_assert_msg(check_msg->obs[8].D.f == 237, + "incorrect value for obs[8].D.f, expected 237, is %d", + check_msg->obs[8].D.f); + ck_assert_msg(check_msg->obs[8].D.i == 3041, + "incorrect value for obs[8].D.i, expected 3041, is %d", + check_msg->obs[8].D.i); + ck_assert_msg(check_msg->obs[8].L.f == 232, + "incorrect value for obs[8].L.f, expected 232, is %d", + check_msg->obs[8].L.f); + ck_assert_msg(check_msg->obs[8].L.i == 133443545, + "incorrect value for obs[8].L.i, expected 133443545, is %d", + check_msg->obs[8].L.i); + ck_assert_msg(check_msg->obs[8].P == 1269673181, + "incorrect value for obs[8].P, expected 1269673181, is %d", + check_msg->obs[8].P); + ck_assert_msg(check_msg->obs[8].cn0 == 123, + "incorrect value for obs[8].cn0, expected 123, is %d", + check_msg->obs[8].cn0); + ck_assert_msg(check_msg->obs[8].flags == 15, + "incorrect value for obs[8].flags, expected 15, is %d", + check_msg->obs[8].flags); + ck_assert_msg(check_msg->obs[8].lock == 5, + "incorrect value for obs[8].lock, expected 5, is %d", + check_msg->obs[8].lock); + ck_assert_msg(check_msg->obs[8].sid.code == 0, + "incorrect value for obs[8].sid.code, expected 0, is %d", + check_msg->obs[8].sid.code); + ck_assert_msg(check_msg->obs[8].sid.sat == 31, + "incorrect value for obs[8].sid.sat, expected 31, is %d", + check_msg->obs[8].sid.sat); + ck_assert_msg(check_msg->obs[9].D.f == 62, + "incorrect value for obs[9].D.f, expected 62, is %d", + check_msg->obs[9].D.f); + ck_assert_msg(check_msg->obs[9].D.i == 2374, + "incorrect value for obs[9].D.i, expected 2374, is %d", + check_msg->obs[9].D.i); + ck_assert_msg(check_msg->obs[9].L.f == 40, + "incorrect value for obs[9].L.f, expected 40, is %d", + check_msg->obs[9].L.f); + ck_assert_msg(check_msg->obs[9].L.i == 103982040, + "incorrect value for obs[9].L.i, expected 103982040, is %d", + check_msg->obs[9].L.i); + ck_assert_msg(check_msg->obs[9].P == 1269673722, + "incorrect value for obs[9].P, expected 1269673722, is %d", + check_msg->obs[9].P); + ck_assert_msg(check_msg->obs[9].cn0 == 120, + "incorrect value for obs[9].cn0, expected 120, is %d", + check_msg->obs[9].cn0); + ck_assert_msg(check_msg->obs[9].flags == 11, + "incorrect value for obs[9].flags, expected 11, is %d", + check_msg->obs[9].flags); + ck_assert_msg(check_msg->obs[9].lock == 3, + "incorrect value for obs[9].lock, expected 3, is %d", + check_msg->obs[9].lock); + ck_assert_msg(check_msg->obs[9].sid.code == 1, + "incorrect value for obs[9].sid.code, expected 1, is %d", + check_msg->obs[9].sid.code); + ck_assert_msg(check_msg->obs[9].sid.sat == 31, + "incorrect value for obs[9].sid.sat, expected 31, is %d", + check_msg->obs[9].sid.sat); + ck_assert_msg(check_msg->obs[10].D.f == 96, + "incorrect value for obs[10].D.f, expected 96, is %d", + check_msg->obs[10].D.f); + ck_assert_msg(check_msg->obs[10].D.i == -3446, + "incorrect value for obs[10].D.i, expected -3446, is %d", + check_msg->obs[10].D.i); + ck_assert_msg(check_msg->obs[10].L.f == 7, + "incorrect value for obs[10].L.f, expected 7, is %d", + check_msg->obs[10].L.f); + ck_assert_msg(check_msg->obs[10].L.i == 118217315, + "incorrect value for obs[10].L.i, expected 118217315, is %d", + check_msg->obs[10].L.i); + ck_assert_msg(check_msg->obs[10].P == 1107693703, + "incorrect value for obs[10].P, expected 1107693703, is %d", + check_msg->obs[10].P); + ck_assert_msg(check_msg->obs[10].cn0 == 176, + "incorrect value for obs[10].cn0, expected 176, is %d", + check_msg->obs[10].cn0); + ck_assert_msg(check_msg->obs[10].flags == 15, + "incorrect value for obs[10].flags, expected 15, is %d", + check_msg->obs[10].flags); + ck_assert_msg(check_msg->obs[10].lock == 10, + "incorrect value for obs[10].lock, expected 10, is %d", + check_msg->obs[10].lock); + ck_assert_msg(check_msg->obs[10].sid.code == 3, + "incorrect value for obs[10].sid.code, expected 3, is %d", + check_msg->obs[10].sid.code); + ck_assert_msg(check_msg->obs[10].sid.sat == 2, + "incorrect value for obs[10].sid.sat, expected 2, is %d", + check_msg->obs[10].sid.sat); + ck_assert_msg(check_msg->obs[11].D.f == 96, + "incorrect value for obs[11].D.f, expected 96, is %d", + check_msg->obs[11].D.f); + ck_assert_msg(check_msg->obs[11].D.i == -1003, + "incorrect value for obs[11].D.i, expected -1003, is %d", + check_msg->obs[11].D.i); + ck_assert_msg(check_msg->obs[11].L.f == 203, + "incorrect value for obs[11].L.f, expected 203, is %d", + check_msg->obs[11].L.f); + ck_assert_msg(check_msg->obs[11].L.i == 104224985, + "incorrect value for obs[11].L.i, expected 104224985, is %d", + check_msg->obs[11].L.i); + ck_assert_msg(check_msg->obs[11].P == 973505172, + "incorrect value for obs[11].P, expected 973505172, is %d", + check_msg->obs[11].P); + ck_assert_msg(check_msg->obs[11].cn0 == 170, + "incorrect value for obs[11].cn0, expected 170, is %d", + check_msg->obs[11].cn0); + ck_assert_msg(check_msg->obs[11].flags == 15, + "incorrect value for obs[11].flags, expected 15, is %d", + check_msg->obs[11].flags); + ck_assert_msg(check_msg->obs[11].lock == 10, + "incorrect value for obs[11].lock, expected 10, is %d", + check_msg->obs[11].lock); + ck_assert_msg(check_msg->obs[11].sid.code == 3, + "incorrect value for obs[11].sid.code, expected 3, is %d", + check_msg->obs[11].sid.code); + ck_assert_msg(check_msg->obs[11].sid.sat == 3, + "incorrect value for obs[11].sid.sat, expected 3, is %d", + check_msg->obs[11].sid.sat); + ck_assert_msg(check_msg->obs[12].D.f == 219, + "incorrect value for obs[12].D.f, expected 219, is %d", + check_msg->obs[12].D.f); + ck_assert_msg(check_msg->obs[12].D.i == -3836, + "incorrect value for obs[12].D.i, expected -3836, is %d", + check_msg->obs[12].D.i); + ck_assert_msg(check_msg->obs[12].L.f == 80, + "incorrect value for obs[12].L.f, expected 80, is %d", + check_msg->obs[12].L.f); + ck_assert_msg(check_msg->obs[12].L.i == 114505343, + "incorrect value for obs[12].L.i, expected 114505343, is %d", + check_msg->obs[12].L.i); + ck_assert_msg(check_msg->obs[12].P == 1069903034, + "incorrect value for obs[12].P, expected 1069903034, is %d", + check_msg->obs[12].P); + ck_assert_msg(check_msg->obs[12].cn0 == 200, + "incorrect value for obs[12].cn0, expected 200, is %d", + check_msg->obs[12].cn0); + ck_assert_msg(check_msg->obs[12].flags == 15, + "incorrect value for obs[12].flags, expected 15, is %d", + check_msg->obs[12].flags); + ck_assert_msg(check_msg->obs[12].lock == 10, + "incorrect value for obs[12].lock, expected 10, is %d", + check_msg->obs[12].lock); + ck_assert_msg(check_msg->obs[12].sid.code == 3, + "incorrect value for obs[12].sid.code, expected 3, is %d", + check_msg->obs[12].sid.code); + ck_assert_msg(check_msg->obs[12].sid.sat == 17, + "incorrect value for obs[12].sid.sat, expected 17, is %d", + check_msg->obs[12].sid.sat); + ck_assert_msg(check_msg->obs[13].D.f == 182, + "incorrect value for obs[13].D.f, expected 182, is %d", + check_msg->obs[13].D.f); + ck_assert_msg(check_msg->obs[13].D.i == -461, + "incorrect value for obs[13].D.i, expected -461, is %d", + check_msg->obs[13].D.i); + ck_assert_msg(check_msg->obs[13].L.f == 105, + "incorrect value for obs[13].L.f, expected 105, is %d", + check_msg->obs[13].L.f); + ck_assert_msg(check_msg->obs[13].L.i == 102157331, + "incorrect value for obs[13].L.i, expected 102157331, is %d", + check_msg->obs[13].L.i); + ck_assert_msg(check_msg->obs[13].P == 956875687, + "incorrect value for obs[13].P, expected 956875687, is %d", + check_msg->obs[13].P); + ck_assert_msg(check_msg->obs[13].cn0 == 152, + "incorrect value for obs[13].cn0, expected 152, is %d", + check_msg->obs[13].cn0); + ck_assert_msg(check_msg->obs[13].flags == 15, + "incorrect value for obs[13].flags, expected 15, is %d", + check_msg->obs[13].flags); + ck_assert_msg(check_msg->obs[13].lock == 10, + "incorrect value for obs[13].lock, expected 10, is %d", + check_msg->obs[13].lock); + ck_assert_msg(check_msg->obs[13].sid.code == 3, + "incorrect value for obs[13].sid.code, expected 3, is %d", + check_msg->obs[13].sid.code); + ck_assert_msg(check_msg->obs[13].sid.sat == 18, + "incorrect value for obs[13].sid.sat, expected 18, is %d", + check_msg->obs[13].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -547,82 +861,102 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObs ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x4a, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x4a, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x4a, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x4a, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,74,0,129,240,11,152,202,226,25,0,0,0,0,106,8,16,201,101, }; + u8 encoded_frame[] = { + 85, 74, 0, 129, 240, 11, 152, 202, 226, 25, + 0, 0, 0, 0, 106, 8, 16, 201, 101, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_t* test_msg = ( msg_obs_t* )test_msg_storage; + msg_obs_t* test_msg = (msg_obs_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 16; test_msg->header.t.ns_residual = 0; test_msg->header.t.tow = 434293400; test_msg->header.t.wn = 2154; - sbp_payload_send(&sbp_state, 0x4a, 61569, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x4a, 61569, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61569, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 61569, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x4a, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_t* check_msg = ( msg_obs_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_t* check_msg = (msg_obs_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 16, "incorrect value for header.n_obs, expected 16, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.ns_residual == 0, "incorrect value for header.t.ns_residual, expected 0, is %d", check_msg->header.t.ns_residual); - ck_assert_msg(check_msg->header.t.tow == 434293400, "incorrect value for header.t.tow, expected 434293400, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 2154, "incorrect value for header.t.wn, expected 2154, is %d", check_msg->header.t.wn); + ck_assert_msg(check_msg->header.n_obs == 16, + "incorrect value for header.n_obs, expected 16, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.ns_residual == 0, + "incorrect value for header.t.ns_residual, expected 0, is %d", + check_msg->header.t.ns_residual); + ck_assert_msg(check_msg->header.t.tow == 434293400, + "incorrect value for header.t.tow, expected 434293400, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 2154, + "incorrect value for header.t.wn, expected 2154, is %d", + check_msg->header.t.wn); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgObs_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgObs"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgObs"); +Suite* legacy_auto_check_sbp_observation_MsgObs_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_observation_MsgObs"); + TCase* tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgObs"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgObs); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_observation_MsgObsDepB.c b/c/test/legacy/auto_check_sbp_observation_MsgObsDepB.c index 6e657e700..b1cf1284a 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgObsDepB.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgObsDepB.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepB.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepB ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgObsDepB) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,28 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x43, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x43, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,67,0,246,215,103,120,46,39,0,251,6,32,180,175,187,133,223,53,7,7,27,157,0,0,202,0,0,0,58,140,85,147,88,28,190,7,175,144,0,0,203,0,0,0,220,140,248,138,208,172,77,7,135,151,0,0,208,0,0,0,173,194,72,135,115,18,28,7,242,156,0,0,212,0,0,0,164,144,105,124,18,196,137,6,120,168,0,0,217,0,0,0,30,232,228,139,210,7,90,7,87,150,0,0,218,0,0,0,169,85, }; + sbp_payload_callback_register(&sbp_state, 0x43, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x43, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 67, 0, 246, 215, 103, 120, 46, 39, 0, 251, 6, 32, 180, + 175, 187, 133, 223, 53, 7, 7, 27, 157, 0, 0, 202, 0, 0, + 0, 58, 140, 85, 147, 88, 28, 190, 7, 175, 144, 0, 0, 203, + 0, 0, 0, 220, 140, 248, 138, 208, 172, 77, 7, 135, 151, 0, + 0, 208, 0, 0, 0, 173, 194, 72, 135, 115, 18, 28, 7, 242, + 156, 0, 0, 212, 0, 0, 0, 164, 144, 105, 124, 18, 196, 137, + 6, 120, 168, 0, 0, 217, 0, 0, 0, 30, 232, 228, 139, 210, + 7, 90, 7, 87, 150, 0, 0, 218, 0, 0, 0, 169, 85, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_b_t* test_msg = ( msg_obs_dep_b_t* )test_msg_storage; + msg_obs_dep_b_t* test_msg = (msg_obs_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 32; test_msg->header.t.tow = 2567800; @@ -218,110 +226,219 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepB ) test_msg->obs[5].sid.code = 0; test_msg->obs[5].sid.reserved = 0; test_msg->obs[5].sid.sat = 218; - sbp_payload_send(&sbp_state, 0x43, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x43, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x43, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_b_t* check_msg = ( msg_obs_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_b_t* check_msg = (msg_obs_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 32, "incorrect value for header.n_obs, expected 32, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 2567800, "incorrect value for header.t.tow, expected 2567800, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1787, "incorrect value for header.t.wn, expected 1787, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 27, "incorrect value for obs[0].L.f, expected 27, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == 117913055, "incorrect value for obs[0].L.i, expected 117913055, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 2243669940, "incorrect value for obs[0].P, expected 2243669940, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 157, "incorrect value for obs[0].cn0, expected 157, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 0, "incorrect value for obs[0].lock, expected 0, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].sid.code == 0, "incorrect value for obs[0].sid.code, expected 0, is %d", check_msg->obs[0].sid.code); - ck_assert_msg(check_msg->obs[0].sid.reserved == 0, "incorrect value for obs[0].sid.reserved, expected 0, is %d", check_msg->obs[0].sid.reserved); - ck_assert_msg(check_msg->obs[0].sid.sat == 202, "incorrect value for obs[0].sid.sat, expected 202, is %d", check_msg->obs[0].sid.sat); - ck_assert_msg(check_msg->obs[1].L.f == 175, "incorrect value for obs[1].L.f, expected 175, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == 129899608, "incorrect value for obs[1].L.i, expected 129899608, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 2471857210, "incorrect value for obs[1].P, expected 2471857210, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].cn0 == 144, "incorrect value for obs[1].cn0, expected 144, is %d", check_msg->obs[1].cn0); - ck_assert_msg(check_msg->obs[1].lock == 0, "incorrect value for obs[1].lock, expected 0, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].sid.code == 0, "incorrect value for obs[1].sid.code, expected 0, is %d", check_msg->obs[1].sid.code); - ck_assert_msg(check_msg->obs[1].sid.reserved == 0, "incorrect value for obs[1].sid.reserved, expected 0, is %d", check_msg->obs[1].sid.reserved); - ck_assert_msg(check_msg->obs[1].sid.sat == 203, "incorrect value for obs[1].sid.sat, expected 203, is %d", check_msg->obs[1].sid.sat); - ck_assert_msg(check_msg->obs[2].L.f == 135, "incorrect value for obs[2].L.f, expected 135, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == 122531024, "incorrect value for obs[2].L.i, expected 122531024, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 2331544796, "incorrect value for obs[2].P, expected 2331544796, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].cn0 == 151, "incorrect value for obs[2].cn0, expected 151, is %d", check_msg->obs[2].cn0); - ck_assert_msg(check_msg->obs[2].lock == 0, "incorrect value for obs[2].lock, expected 0, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].sid.code == 0, "incorrect value for obs[2].sid.code, expected 0, is %d", check_msg->obs[2].sid.code); - ck_assert_msg(check_msg->obs[2].sid.reserved == 0, "incorrect value for obs[2].sid.reserved, expected 0, is %d", check_msg->obs[2].sid.reserved); - ck_assert_msg(check_msg->obs[2].sid.sat == 208, "incorrect value for obs[2].sid.sat, expected 208, is %d", check_msg->obs[2].sid.sat); - ck_assert_msg(check_msg->obs[3].L.f == 242, "incorrect value for obs[3].L.f, expected 242, is %d", check_msg->obs[3].L.f); - ck_assert_msg(check_msg->obs[3].L.i == 119280243, "incorrect value for obs[3].L.i, expected 119280243, is %d", check_msg->obs[3].L.i); - ck_assert_msg(check_msg->obs[3].P == 2269692589, "incorrect value for obs[3].P, expected 2269692589, is %d", check_msg->obs[3].P); - ck_assert_msg(check_msg->obs[3].cn0 == 156, "incorrect value for obs[3].cn0, expected 156, is %d", check_msg->obs[3].cn0); - ck_assert_msg(check_msg->obs[3].lock == 0, "incorrect value for obs[3].lock, expected 0, is %d", check_msg->obs[3].lock); - ck_assert_msg(check_msg->obs[3].sid.code == 0, "incorrect value for obs[3].sid.code, expected 0, is %d", check_msg->obs[3].sid.code); - ck_assert_msg(check_msg->obs[3].sid.reserved == 0, "incorrect value for obs[3].sid.reserved, expected 0, is %d", check_msg->obs[3].sid.reserved); - ck_assert_msg(check_msg->obs[3].sid.sat == 212, "incorrect value for obs[3].sid.sat, expected 212, is %d", check_msg->obs[3].sid.sat); - ck_assert_msg(check_msg->obs[4].L.f == 120, "incorrect value for obs[4].L.f, expected 120, is %d", check_msg->obs[4].L.f); - ck_assert_msg(check_msg->obs[4].L.i == 109691922, "incorrect value for obs[4].L.i, expected 109691922, is %d", check_msg->obs[4].L.i); - ck_assert_msg(check_msg->obs[4].P == 2087293092, "incorrect value for obs[4].P, expected 2087293092, is %d", check_msg->obs[4].P); - ck_assert_msg(check_msg->obs[4].cn0 == 168, "incorrect value for obs[4].cn0, expected 168, is %d", check_msg->obs[4].cn0); - ck_assert_msg(check_msg->obs[4].lock == 0, "incorrect value for obs[4].lock, expected 0, is %d", check_msg->obs[4].lock); - ck_assert_msg(check_msg->obs[4].sid.code == 0, "incorrect value for obs[4].sid.code, expected 0, is %d", check_msg->obs[4].sid.code); - ck_assert_msg(check_msg->obs[4].sid.reserved == 0, "incorrect value for obs[4].sid.reserved, expected 0, is %d", check_msg->obs[4].sid.reserved); - ck_assert_msg(check_msg->obs[4].sid.sat == 217, "incorrect value for obs[4].sid.sat, expected 217, is %d", check_msg->obs[4].sid.sat); - ck_assert_msg(check_msg->obs[5].L.f == 87, "incorrect value for obs[5].L.f, expected 87, is %d", check_msg->obs[5].L.f); - ck_assert_msg(check_msg->obs[5].L.i == 123340754, "incorrect value for obs[5].L.i, expected 123340754, is %d", check_msg->obs[5].L.i); - ck_assert_msg(check_msg->obs[5].P == 2347034654, "incorrect value for obs[5].P, expected 2347034654, is %d", check_msg->obs[5].P); - ck_assert_msg(check_msg->obs[5].cn0 == 150, "incorrect value for obs[5].cn0, expected 150, is %d", check_msg->obs[5].cn0); - ck_assert_msg(check_msg->obs[5].lock == 0, "incorrect value for obs[5].lock, expected 0, is %d", check_msg->obs[5].lock); - ck_assert_msg(check_msg->obs[5].sid.code == 0, "incorrect value for obs[5].sid.code, expected 0, is %d", check_msg->obs[5].sid.code); - ck_assert_msg(check_msg->obs[5].sid.reserved == 0, "incorrect value for obs[5].sid.reserved, expected 0, is %d", check_msg->obs[5].sid.reserved); - ck_assert_msg(check_msg->obs[5].sid.sat == 218, "incorrect value for obs[5].sid.sat, expected 218, is %d", check_msg->obs[5].sid.sat); + ck_assert_msg(check_msg->header.n_obs == 32, + "incorrect value for header.n_obs, expected 32, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 2567800, + "incorrect value for header.t.tow, expected 2567800, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1787, + "incorrect value for header.t.wn, expected 1787, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 27, + "incorrect value for obs[0].L.f, expected 27, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == 117913055, + "incorrect value for obs[0].L.i, expected 117913055, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 2243669940, + "incorrect value for obs[0].P, expected 2243669940, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 157, + "incorrect value for obs[0].cn0, expected 157, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 0, + "incorrect value for obs[0].lock, expected 0, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].sid.code == 0, + "incorrect value for obs[0].sid.code, expected 0, is %d", + check_msg->obs[0].sid.code); + ck_assert_msg(check_msg->obs[0].sid.reserved == 0, + "incorrect value for obs[0].sid.reserved, expected 0, is %d", + check_msg->obs[0].sid.reserved); + ck_assert_msg(check_msg->obs[0].sid.sat == 202, + "incorrect value for obs[0].sid.sat, expected 202, is %d", + check_msg->obs[0].sid.sat); + ck_assert_msg(check_msg->obs[1].L.f == 175, + "incorrect value for obs[1].L.f, expected 175, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == 129899608, + "incorrect value for obs[1].L.i, expected 129899608, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 2471857210, + "incorrect value for obs[1].P, expected 2471857210, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].cn0 == 144, + "incorrect value for obs[1].cn0, expected 144, is %d", + check_msg->obs[1].cn0); + ck_assert_msg(check_msg->obs[1].lock == 0, + "incorrect value for obs[1].lock, expected 0, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].sid.code == 0, + "incorrect value for obs[1].sid.code, expected 0, is %d", + check_msg->obs[1].sid.code); + ck_assert_msg(check_msg->obs[1].sid.reserved == 0, + "incorrect value for obs[1].sid.reserved, expected 0, is %d", + check_msg->obs[1].sid.reserved); + ck_assert_msg(check_msg->obs[1].sid.sat == 203, + "incorrect value for obs[1].sid.sat, expected 203, is %d", + check_msg->obs[1].sid.sat); + ck_assert_msg(check_msg->obs[2].L.f == 135, + "incorrect value for obs[2].L.f, expected 135, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == 122531024, + "incorrect value for obs[2].L.i, expected 122531024, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 2331544796, + "incorrect value for obs[2].P, expected 2331544796, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].cn0 == 151, + "incorrect value for obs[2].cn0, expected 151, is %d", + check_msg->obs[2].cn0); + ck_assert_msg(check_msg->obs[2].lock == 0, + "incorrect value for obs[2].lock, expected 0, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].sid.code == 0, + "incorrect value for obs[2].sid.code, expected 0, is %d", + check_msg->obs[2].sid.code); + ck_assert_msg(check_msg->obs[2].sid.reserved == 0, + "incorrect value for obs[2].sid.reserved, expected 0, is %d", + check_msg->obs[2].sid.reserved); + ck_assert_msg(check_msg->obs[2].sid.sat == 208, + "incorrect value for obs[2].sid.sat, expected 208, is %d", + check_msg->obs[2].sid.sat); + ck_assert_msg(check_msg->obs[3].L.f == 242, + "incorrect value for obs[3].L.f, expected 242, is %d", + check_msg->obs[3].L.f); + ck_assert_msg(check_msg->obs[3].L.i == 119280243, + "incorrect value for obs[3].L.i, expected 119280243, is %d", + check_msg->obs[3].L.i); + ck_assert_msg(check_msg->obs[3].P == 2269692589, + "incorrect value for obs[3].P, expected 2269692589, is %d", + check_msg->obs[3].P); + ck_assert_msg(check_msg->obs[3].cn0 == 156, + "incorrect value for obs[3].cn0, expected 156, is %d", + check_msg->obs[3].cn0); + ck_assert_msg(check_msg->obs[3].lock == 0, + "incorrect value for obs[3].lock, expected 0, is %d", + check_msg->obs[3].lock); + ck_assert_msg(check_msg->obs[3].sid.code == 0, + "incorrect value for obs[3].sid.code, expected 0, is %d", + check_msg->obs[3].sid.code); + ck_assert_msg(check_msg->obs[3].sid.reserved == 0, + "incorrect value for obs[3].sid.reserved, expected 0, is %d", + check_msg->obs[3].sid.reserved); + ck_assert_msg(check_msg->obs[3].sid.sat == 212, + "incorrect value for obs[3].sid.sat, expected 212, is %d", + check_msg->obs[3].sid.sat); + ck_assert_msg(check_msg->obs[4].L.f == 120, + "incorrect value for obs[4].L.f, expected 120, is %d", + check_msg->obs[4].L.f); + ck_assert_msg(check_msg->obs[4].L.i == 109691922, + "incorrect value for obs[4].L.i, expected 109691922, is %d", + check_msg->obs[4].L.i); + ck_assert_msg(check_msg->obs[4].P == 2087293092, + "incorrect value for obs[4].P, expected 2087293092, is %d", + check_msg->obs[4].P); + ck_assert_msg(check_msg->obs[4].cn0 == 168, + "incorrect value for obs[4].cn0, expected 168, is %d", + check_msg->obs[4].cn0); + ck_assert_msg(check_msg->obs[4].lock == 0, + "incorrect value for obs[4].lock, expected 0, is %d", + check_msg->obs[4].lock); + ck_assert_msg(check_msg->obs[4].sid.code == 0, + "incorrect value for obs[4].sid.code, expected 0, is %d", + check_msg->obs[4].sid.code); + ck_assert_msg(check_msg->obs[4].sid.reserved == 0, + "incorrect value for obs[4].sid.reserved, expected 0, is %d", + check_msg->obs[4].sid.reserved); + ck_assert_msg(check_msg->obs[4].sid.sat == 217, + "incorrect value for obs[4].sid.sat, expected 217, is %d", + check_msg->obs[4].sid.sat); + ck_assert_msg(check_msg->obs[5].L.f == 87, + "incorrect value for obs[5].L.f, expected 87, is %d", + check_msg->obs[5].L.f); + ck_assert_msg(check_msg->obs[5].L.i == 123340754, + "incorrect value for obs[5].L.i, expected 123340754, is %d", + check_msg->obs[5].L.i); + ck_assert_msg(check_msg->obs[5].P == 2347034654, + "incorrect value for obs[5].P, expected 2347034654, is %d", + check_msg->obs[5].P); + ck_assert_msg(check_msg->obs[5].cn0 == 150, + "incorrect value for obs[5].cn0, expected 150, is %d", + check_msg->obs[5].cn0); + ck_assert_msg(check_msg->obs[5].lock == 0, + "incorrect value for obs[5].lock, expected 0, is %d", + check_msg->obs[5].lock); + ck_assert_msg(check_msg->obs[5].sid.code == 0, + "incorrect value for obs[5].sid.code, expected 0, is %d", + check_msg->obs[5].sid.code); + ck_assert_msg(check_msg->obs[5].sid.reserved == 0, + "incorrect value for obs[5].sid.reserved, expected 0, is %d", + check_msg->obs[5].sid.reserved); + ck_assert_msg(check_msg->obs[5].sid.sat == 218, + "incorrect value for obs[5].sid.sat, expected 218, is %d", + check_msg->obs[5].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -329,17 +446,25 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x43, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x43, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x43, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x43, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,67,0,246,215,55,120,46,39,0,251,6,33,68,199,101,136,133,247,42,7,219,154,0,0,220,0,0,0,219,14,123,133,96,215,3,7,235,156,0,0,222,0,0,0,87,166,81,122,5,173,109,6,174,170,0,0,225,0,0,0,11,233, }; + u8 encoded_frame[] = { + 85, 67, 0, 246, 215, 55, 120, 46, 39, 0, 251, 6, 33, + 68, 199, 101, 136, 133, 247, 42, 7, 219, 154, 0, 0, 220, + 0, 0, 0, 219, 14, 123, 133, 96, 215, 3, 7, 235, 156, + 0, 0, 222, 0, 0, 0, 87, 166, 81, 122, 5, 173, 109, + 6, 174, 170, 0, 0, 225, 0, 0, 0, 11, 233, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_b_t* test_msg = ( msg_obs_dep_b_t* )test_msg_storage; + msg_obs_dep_b_t* test_msg = (msg_obs_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 33; test_msg->header.t.tow = 2567800; @@ -380,86 +505,147 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepB ) test_msg->obs[2].sid.code = 0; test_msg->obs[2].sid.reserved = 0; test_msg->obs[2].sid.sat = 225; - sbp_payload_send(&sbp_state, 0x43, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x43, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x43, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_b_t* check_msg = ( msg_obs_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_b_t* check_msg = (msg_obs_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 33, "incorrect value for header.n_obs, expected 33, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 2567800, "incorrect value for header.t.tow, expected 2567800, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1787, "incorrect value for header.t.wn, expected 1787, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 219, "incorrect value for obs[0].L.f, expected 219, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == 120256389, "incorrect value for obs[0].L.i, expected 120256389, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 2288371524, "incorrect value for obs[0].P, expected 2288371524, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 154, "incorrect value for obs[0].cn0, expected 154, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 0, "incorrect value for obs[0].lock, expected 0, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].sid.code == 0, "incorrect value for obs[0].sid.code, expected 0, is %d", check_msg->obs[0].sid.code); - ck_assert_msg(check_msg->obs[0].sid.reserved == 0, "incorrect value for obs[0].sid.reserved, expected 0, is %d", check_msg->obs[0].sid.reserved); - ck_assert_msg(check_msg->obs[0].sid.sat == 220, "incorrect value for obs[0].sid.sat, expected 220, is %d", check_msg->obs[0].sid.sat); - ck_assert_msg(check_msg->obs[1].L.f == 235, "incorrect value for obs[1].L.f, expected 235, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == 117692256, "incorrect value for obs[1].L.i, expected 117692256, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 2239434459, "incorrect value for obs[1].P, expected 2239434459, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].cn0 == 156, "incorrect value for obs[1].cn0, expected 156, is %d", check_msg->obs[1].cn0); - ck_assert_msg(check_msg->obs[1].lock == 0, "incorrect value for obs[1].lock, expected 0, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].sid.code == 0, "incorrect value for obs[1].sid.code, expected 0, is %d", check_msg->obs[1].sid.code); - ck_assert_msg(check_msg->obs[1].sid.reserved == 0, "incorrect value for obs[1].sid.reserved, expected 0, is %d", check_msg->obs[1].sid.reserved); - ck_assert_msg(check_msg->obs[1].sid.sat == 222, "incorrect value for obs[1].sid.sat, expected 222, is %d", check_msg->obs[1].sid.sat); - ck_assert_msg(check_msg->obs[2].L.f == 174, "incorrect value for obs[2].L.f, expected 174, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == 107851013, "incorrect value for obs[2].L.i, expected 107851013, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 2052171351, "incorrect value for obs[2].P, expected 2052171351, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].cn0 == 170, "incorrect value for obs[2].cn0, expected 170, is %d", check_msg->obs[2].cn0); - ck_assert_msg(check_msg->obs[2].lock == 0, "incorrect value for obs[2].lock, expected 0, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].sid.code == 0, "incorrect value for obs[2].sid.code, expected 0, is %d", check_msg->obs[2].sid.code); - ck_assert_msg(check_msg->obs[2].sid.reserved == 0, "incorrect value for obs[2].sid.reserved, expected 0, is %d", check_msg->obs[2].sid.reserved); - ck_assert_msg(check_msg->obs[2].sid.sat == 225, "incorrect value for obs[2].sid.sat, expected 225, is %d", check_msg->obs[2].sid.sat); + ck_assert_msg(check_msg->header.n_obs == 33, + "incorrect value for header.n_obs, expected 33, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 2567800, + "incorrect value for header.t.tow, expected 2567800, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1787, + "incorrect value for header.t.wn, expected 1787, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 219, + "incorrect value for obs[0].L.f, expected 219, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == 120256389, + "incorrect value for obs[0].L.i, expected 120256389, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 2288371524, + "incorrect value for obs[0].P, expected 2288371524, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 154, + "incorrect value for obs[0].cn0, expected 154, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 0, + "incorrect value for obs[0].lock, expected 0, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].sid.code == 0, + "incorrect value for obs[0].sid.code, expected 0, is %d", + check_msg->obs[0].sid.code); + ck_assert_msg(check_msg->obs[0].sid.reserved == 0, + "incorrect value for obs[0].sid.reserved, expected 0, is %d", + check_msg->obs[0].sid.reserved); + ck_assert_msg(check_msg->obs[0].sid.sat == 220, + "incorrect value for obs[0].sid.sat, expected 220, is %d", + check_msg->obs[0].sid.sat); + ck_assert_msg(check_msg->obs[1].L.f == 235, + "incorrect value for obs[1].L.f, expected 235, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == 117692256, + "incorrect value for obs[1].L.i, expected 117692256, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 2239434459, + "incorrect value for obs[1].P, expected 2239434459, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].cn0 == 156, + "incorrect value for obs[1].cn0, expected 156, is %d", + check_msg->obs[1].cn0); + ck_assert_msg(check_msg->obs[1].lock == 0, + "incorrect value for obs[1].lock, expected 0, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].sid.code == 0, + "incorrect value for obs[1].sid.code, expected 0, is %d", + check_msg->obs[1].sid.code); + ck_assert_msg(check_msg->obs[1].sid.reserved == 0, + "incorrect value for obs[1].sid.reserved, expected 0, is %d", + check_msg->obs[1].sid.reserved); + ck_assert_msg(check_msg->obs[1].sid.sat == 222, + "incorrect value for obs[1].sid.sat, expected 222, is %d", + check_msg->obs[1].sid.sat); + ck_assert_msg(check_msg->obs[2].L.f == 174, + "incorrect value for obs[2].L.f, expected 174, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == 107851013, + "incorrect value for obs[2].L.i, expected 107851013, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 2052171351, + "incorrect value for obs[2].P, expected 2052171351, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].cn0 == 170, + "incorrect value for obs[2].cn0, expected 170, is %d", + check_msg->obs[2].cn0); + ck_assert_msg(check_msg->obs[2].lock == 0, + "incorrect value for obs[2].lock, expected 0, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].sid.code == 0, + "incorrect value for obs[2].sid.code, expected 0, is %d", + check_msg->obs[2].sid.code); + ck_assert_msg(check_msg->obs[2].sid.reserved == 0, + "incorrect value for obs[2].sid.reserved, expected 0, is %d", + check_msg->obs[2].sid.reserved); + ck_assert_msg(check_msg->obs[2].sid.sat == 225, + "incorrect value for obs[2].sid.sat, expected 225, is %d", + check_msg->obs[2].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -467,17 +653,28 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x43, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x43, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,67,0,246,215,103,64,47,39,0,251,6,32,100,132,187,133,236,51,7,7,94,156,0,0,202,0,0,0,97,184,85,147,178,30,190,7,40,140,0,0,203,0,0,0,135,111,248,138,90,171,77,7,2,150,0,0,208,0,0,0,180,238,72,135,190,20,28,7,241,155,0,0,212,0,0,0,15,153,105,124,92,196,137,6,153,168,0,0,217,0,0,0,49,185,228,139,144,5,90,7,41,150,0,0,218,0,0,0,241,98, }; + sbp_payload_callback_register(&sbp_state, 0x43, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x43, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 67, 0, 246, 215, 103, 64, 47, 39, 0, 251, 6, 32, 100, + 132, 187, 133, 236, 51, 7, 7, 94, 156, 0, 0, 202, 0, 0, + 0, 97, 184, 85, 147, 178, 30, 190, 7, 40, 140, 0, 0, 203, + 0, 0, 0, 135, 111, 248, 138, 90, 171, 77, 7, 2, 150, 0, + 0, 208, 0, 0, 0, 180, 238, 72, 135, 190, 20, 28, 7, 241, + 155, 0, 0, 212, 0, 0, 0, 15, 153, 105, 124, 92, 196, 137, + 6, 153, 168, 0, 0, 217, 0, 0, 0, 49, 185, 228, 139, 144, + 5, 90, 7, 41, 150, 0, 0, 218, 0, 0, 0, 241, 98, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_b_t* test_msg = ( msg_obs_dep_b_t* )test_msg_storage; + msg_obs_dep_b_t* test_msg = (msg_obs_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 32; test_msg->header.t.tow = 2568000; @@ -554,110 +751,219 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepB ) test_msg->obs[5].sid.code = 0; test_msg->obs[5].sid.reserved = 0; test_msg->obs[5].sid.sat = 218; - sbp_payload_send(&sbp_state, 0x43, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x43, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x43, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_b_t* check_msg = ( msg_obs_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_b_t* check_msg = (msg_obs_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 32, "incorrect value for header.n_obs, expected 32, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 2568000, "incorrect value for header.t.tow, expected 2568000, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1787, "incorrect value for header.t.wn, expected 1787, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 94, "incorrect value for obs[0].L.f, expected 94, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == 117912556, "incorrect value for obs[0].L.i, expected 117912556, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 2243658852, "incorrect value for obs[0].P, expected 2243658852, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 156, "incorrect value for obs[0].cn0, expected 156, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 0, "incorrect value for obs[0].lock, expected 0, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].sid.code == 0, "incorrect value for obs[0].sid.code, expected 0, is %d", check_msg->obs[0].sid.code); - ck_assert_msg(check_msg->obs[0].sid.reserved == 0, "incorrect value for obs[0].sid.reserved, expected 0, is %d", check_msg->obs[0].sid.reserved); - ck_assert_msg(check_msg->obs[0].sid.sat == 202, "incorrect value for obs[0].sid.sat, expected 202, is %d", check_msg->obs[0].sid.sat); - ck_assert_msg(check_msg->obs[1].L.f == 40, "incorrect value for obs[1].L.f, expected 40, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == 129900210, "incorrect value for obs[1].L.i, expected 129900210, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 2471868513, "incorrect value for obs[1].P, expected 2471868513, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].cn0 == 140, "incorrect value for obs[1].cn0, expected 140, is %d", check_msg->obs[1].cn0); - ck_assert_msg(check_msg->obs[1].lock == 0, "incorrect value for obs[1].lock, expected 0, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].sid.code == 0, "incorrect value for obs[1].sid.code, expected 0, is %d", check_msg->obs[1].sid.code); - ck_assert_msg(check_msg->obs[1].sid.reserved == 0, "incorrect value for obs[1].sid.reserved, expected 0, is %d", check_msg->obs[1].sid.reserved); - ck_assert_msg(check_msg->obs[1].sid.sat == 203, "incorrect value for obs[1].sid.sat, expected 203, is %d", check_msg->obs[1].sid.sat); - ck_assert_msg(check_msg->obs[2].L.f == 2, "incorrect value for obs[2].L.f, expected 2, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == 122530650, "incorrect value for obs[2].L.i, expected 122530650, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 2331537287, "incorrect value for obs[2].P, expected 2331537287, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].cn0 == 150, "incorrect value for obs[2].cn0, expected 150, is %d", check_msg->obs[2].cn0); - ck_assert_msg(check_msg->obs[2].lock == 0, "incorrect value for obs[2].lock, expected 0, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].sid.code == 0, "incorrect value for obs[2].sid.code, expected 0, is %d", check_msg->obs[2].sid.code); - ck_assert_msg(check_msg->obs[2].sid.reserved == 0, "incorrect value for obs[2].sid.reserved, expected 0, is %d", check_msg->obs[2].sid.reserved); - ck_assert_msg(check_msg->obs[2].sid.sat == 208, "incorrect value for obs[2].sid.sat, expected 208, is %d", check_msg->obs[2].sid.sat); - ck_assert_msg(check_msg->obs[3].L.f == 241, "incorrect value for obs[3].L.f, expected 241, is %d", check_msg->obs[3].L.f); - ck_assert_msg(check_msg->obs[3].L.i == 119280830, "incorrect value for obs[3].L.i, expected 119280830, is %d", check_msg->obs[3].L.i); - ck_assert_msg(check_msg->obs[3].P == 2269703860, "incorrect value for obs[3].P, expected 2269703860, is %d", check_msg->obs[3].P); - ck_assert_msg(check_msg->obs[3].cn0 == 155, "incorrect value for obs[3].cn0, expected 155, is %d", check_msg->obs[3].cn0); - ck_assert_msg(check_msg->obs[3].lock == 0, "incorrect value for obs[3].lock, expected 0, is %d", check_msg->obs[3].lock); - ck_assert_msg(check_msg->obs[3].sid.code == 0, "incorrect value for obs[3].sid.code, expected 0, is %d", check_msg->obs[3].sid.code); - ck_assert_msg(check_msg->obs[3].sid.reserved == 0, "incorrect value for obs[3].sid.reserved, expected 0, is %d", check_msg->obs[3].sid.reserved); - ck_assert_msg(check_msg->obs[3].sid.sat == 212, "incorrect value for obs[3].sid.sat, expected 212, is %d", check_msg->obs[3].sid.sat); - ck_assert_msg(check_msg->obs[4].L.f == 153, "incorrect value for obs[4].L.f, expected 153, is %d", check_msg->obs[4].L.f); - ck_assert_msg(check_msg->obs[4].L.i == 109691996, "incorrect value for obs[4].L.i, expected 109691996, is %d", check_msg->obs[4].L.i); - ck_assert_msg(check_msg->obs[4].P == 2087295247, "incorrect value for obs[4].P, expected 2087295247, is %d", check_msg->obs[4].P); - ck_assert_msg(check_msg->obs[4].cn0 == 168, "incorrect value for obs[4].cn0, expected 168, is %d", check_msg->obs[4].cn0); - ck_assert_msg(check_msg->obs[4].lock == 0, "incorrect value for obs[4].lock, expected 0, is %d", check_msg->obs[4].lock); - ck_assert_msg(check_msg->obs[4].sid.code == 0, "incorrect value for obs[4].sid.code, expected 0, is %d", check_msg->obs[4].sid.code); - ck_assert_msg(check_msg->obs[4].sid.reserved == 0, "incorrect value for obs[4].sid.reserved, expected 0, is %d", check_msg->obs[4].sid.reserved); - ck_assert_msg(check_msg->obs[4].sid.sat == 217, "incorrect value for obs[4].sid.sat, expected 217, is %d", check_msg->obs[4].sid.sat); - ck_assert_msg(check_msg->obs[5].L.f == 41, "incorrect value for obs[5].L.f, expected 41, is %d", check_msg->obs[5].L.f); - ck_assert_msg(check_msg->obs[5].L.i == 123340176, "incorrect value for obs[5].L.i, expected 123340176, is %d", check_msg->obs[5].L.i); - ck_assert_msg(check_msg->obs[5].P == 2347022641, "incorrect value for obs[5].P, expected 2347022641, is %d", check_msg->obs[5].P); - ck_assert_msg(check_msg->obs[5].cn0 == 150, "incorrect value for obs[5].cn0, expected 150, is %d", check_msg->obs[5].cn0); - ck_assert_msg(check_msg->obs[5].lock == 0, "incorrect value for obs[5].lock, expected 0, is %d", check_msg->obs[5].lock); - ck_assert_msg(check_msg->obs[5].sid.code == 0, "incorrect value for obs[5].sid.code, expected 0, is %d", check_msg->obs[5].sid.code); - ck_assert_msg(check_msg->obs[5].sid.reserved == 0, "incorrect value for obs[5].sid.reserved, expected 0, is %d", check_msg->obs[5].sid.reserved); - ck_assert_msg(check_msg->obs[5].sid.sat == 218, "incorrect value for obs[5].sid.sat, expected 218, is %d", check_msg->obs[5].sid.sat); + ck_assert_msg(check_msg->header.n_obs == 32, + "incorrect value for header.n_obs, expected 32, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 2568000, + "incorrect value for header.t.tow, expected 2568000, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1787, + "incorrect value for header.t.wn, expected 1787, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 94, + "incorrect value for obs[0].L.f, expected 94, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == 117912556, + "incorrect value for obs[0].L.i, expected 117912556, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 2243658852, + "incorrect value for obs[0].P, expected 2243658852, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 156, + "incorrect value for obs[0].cn0, expected 156, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 0, + "incorrect value for obs[0].lock, expected 0, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].sid.code == 0, + "incorrect value for obs[0].sid.code, expected 0, is %d", + check_msg->obs[0].sid.code); + ck_assert_msg(check_msg->obs[0].sid.reserved == 0, + "incorrect value for obs[0].sid.reserved, expected 0, is %d", + check_msg->obs[0].sid.reserved); + ck_assert_msg(check_msg->obs[0].sid.sat == 202, + "incorrect value for obs[0].sid.sat, expected 202, is %d", + check_msg->obs[0].sid.sat); + ck_assert_msg(check_msg->obs[1].L.f == 40, + "incorrect value for obs[1].L.f, expected 40, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == 129900210, + "incorrect value for obs[1].L.i, expected 129900210, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 2471868513, + "incorrect value for obs[1].P, expected 2471868513, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].cn0 == 140, + "incorrect value for obs[1].cn0, expected 140, is %d", + check_msg->obs[1].cn0); + ck_assert_msg(check_msg->obs[1].lock == 0, + "incorrect value for obs[1].lock, expected 0, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].sid.code == 0, + "incorrect value for obs[1].sid.code, expected 0, is %d", + check_msg->obs[1].sid.code); + ck_assert_msg(check_msg->obs[1].sid.reserved == 0, + "incorrect value for obs[1].sid.reserved, expected 0, is %d", + check_msg->obs[1].sid.reserved); + ck_assert_msg(check_msg->obs[1].sid.sat == 203, + "incorrect value for obs[1].sid.sat, expected 203, is %d", + check_msg->obs[1].sid.sat); + ck_assert_msg(check_msg->obs[2].L.f == 2, + "incorrect value for obs[2].L.f, expected 2, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == 122530650, + "incorrect value for obs[2].L.i, expected 122530650, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 2331537287, + "incorrect value for obs[2].P, expected 2331537287, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].cn0 == 150, + "incorrect value for obs[2].cn0, expected 150, is %d", + check_msg->obs[2].cn0); + ck_assert_msg(check_msg->obs[2].lock == 0, + "incorrect value for obs[2].lock, expected 0, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].sid.code == 0, + "incorrect value for obs[2].sid.code, expected 0, is %d", + check_msg->obs[2].sid.code); + ck_assert_msg(check_msg->obs[2].sid.reserved == 0, + "incorrect value for obs[2].sid.reserved, expected 0, is %d", + check_msg->obs[2].sid.reserved); + ck_assert_msg(check_msg->obs[2].sid.sat == 208, + "incorrect value for obs[2].sid.sat, expected 208, is %d", + check_msg->obs[2].sid.sat); + ck_assert_msg(check_msg->obs[3].L.f == 241, + "incorrect value for obs[3].L.f, expected 241, is %d", + check_msg->obs[3].L.f); + ck_assert_msg(check_msg->obs[3].L.i == 119280830, + "incorrect value for obs[3].L.i, expected 119280830, is %d", + check_msg->obs[3].L.i); + ck_assert_msg(check_msg->obs[3].P == 2269703860, + "incorrect value for obs[3].P, expected 2269703860, is %d", + check_msg->obs[3].P); + ck_assert_msg(check_msg->obs[3].cn0 == 155, + "incorrect value for obs[3].cn0, expected 155, is %d", + check_msg->obs[3].cn0); + ck_assert_msg(check_msg->obs[3].lock == 0, + "incorrect value for obs[3].lock, expected 0, is %d", + check_msg->obs[3].lock); + ck_assert_msg(check_msg->obs[3].sid.code == 0, + "incorrect value for obs[3].sid.code, expected 0, is %d", + check_msg->obs[3].sid.code); + ck_assert_msg(check_msg->obs[3].sid.reserved == 0, + "incorrect value for obs[3].sid.reserved, expected 0, is %d", + check_msg->obs[3].sid.reserved); + ck_assert_msg(check_msg->obs[3].sid.sat == 212, + "incorrect value for obs[3].sid.sat, expected 212, is %d", + check_msg->obs[3].sid.sat); + ck_assert_msg(check_msg->obs[4].L.f == 153, + "incorrect value for obs[4].L.f, expected 153, is %d", + check_msg->obs[4].L.f); + ck_assert_msg(check_msg->obs[4].L.i == 109691996, + "incorrect value for obs[4].L.i, expected 109691996, is %d", + check_msg->obs[4].L.i); + ck_assert_msg(check_msg->obs[4].P == 2087295247, + "incorrect value for obs[4].P, expected 2087295247, is %d", + check_msg->obs[4].P); + ck_assert_msg(check_msg->obs[4].cn0 == 168, + "incorrect value for obs[4].cn0, expected 168, is %d", + check_msg->obs[4].cn0); + ck_assert_msg(check_msg->obs[4].lock == 0, + "incorrect value for obs[4].lock, expected 0, is %d", + check_msg->obs[4].lock); + ck_assert_msg(check_msg->obs[4].sid.code == 0, + "incorrect value for obs[4].sid.code, expected 0, is %d", + check_msg->obs[4].sid.code); + ck_assert_msg(check_msg->obs[4].sid.reserved == 0, + "incorrect value for obs[4].sid.reserved, expected 0, is %d", + check_msg->obs[4].sid.reserved); + ck_assert_msg(check_msg->obs[4].sid.sat == 217, + "incorrect value for obs[4].sid.sat, expected 217, is %d", + check_msg->obs[4].sid.sat); + ck_assert_msg(check_msg->obs[5].L.f == 41, + "incorrect value for obs[5].L.f, expected 41, is %d", + check_msg->obs[5].L.f); + ck_assert_msg(check_msg->obs[5].L.i == 123340176, + "incorrect value for obs[5].L.i, expected 123340176, is %d", + check_msg->obs[5].L.i); + ck_assert_msg(check_msg->obs[5].P == 2347022641, + "incorrect value for obs[5].P, expected 2347022641, is %d", + check_msg->obs[5].P); + ck_assert_msg(check_msg->obs[5].cn0 == 150, + "incorrect value for obs[5].cn0, expected 150, is %d", + check_msg->obs[5].cn0); + ck_assert_msg(check_msg->obs[5].lock == 0, + "incorrect value for obs[5].lock, expected 0, is %d", + check_msg->obs[5].lock); + ck_assert_msg(check_msg->obs[5].sid.code == 0, + "incorrect value for obs[5].sid.code, expected 0, is %d", + check_msg->obs[5].sid.code); + ck_assert_msg(check_msg->obs[5].sid.reserved == 0, + "incorrect value for obs[5].sid.reserved, expected 0, is %d", + check_msg->obs[5].sid.reserved); + ck_assert_msg(check_msg->obs[5].sid.sat == 218, + "incorrect value for obs[5].sid.sat, expected 218, is %d", + check_msg->obs[5].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -665,17 +971,24 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x43, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x43, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x43, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x43, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,67,0,246,215,55,64,47,39,0,251,6,33,234,148,101,136,15,245,42,7,20,154,0,0,220,0,0,0,208,247,122,133,16,214,3,7,38,156,0,0,222,0,0,0,15,150,81,122,22,172,109,6,7,172,0,0,225,0,0,0,201,13, }; + u8 encoded_frame[] = { + 85, 67, 0, 246, 215, 55, 64, 47, 39, 0, 251, 6, 33, 234, 148, 101, + 136, 15, 245, 42, 7, 20, 154, 0, 0, 220, 0, 0, 0, 208, 247, 122, + 133, 16, 214, 3, 7, 38, 156, 0, 0, 222, 0, 0, 0, 15, 150, 81, + 122, 22, 172, 109, 6, 7, 172, 0, 0, 225, 0, 0, 0, 201, 13, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_b_t* test_msg = ( msg_obs_dep_b_t* )test_msg_storage; + msg_obs_dep_b_t* test_msg = (msg_obs_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 33; test_msg->header.t.tow = 2568000; @@ -716,86 +1029,147 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepB ) test_msg->obs[2].sid.code = 0; test_msg->obs[2].sid.reserved = 0; test_msg->obs[2].sid.sat = 225; - sbp_payload_send(&sbp_state, 0x43, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x43, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x43, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_b_t* check_msg = ( msg_obs_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_b_t* check_msg = (msg_obs_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 33, "incorrect value for header.n_obs, expected 33, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 2568000, "incorrect value for header.t.tow, expected 2568000, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1787, "incorrect value for header.t.wn, expected 1787, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 20, "incorrect value for obs[0].L.f, expected 20, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == 120255759, "incorrect value for obs[0].L.i, expected 120255759, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 2288358634, "incorrect value for obs[0].P, expected 2288358634, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 154, "incorrect value for obs[0].cn0, expected 154, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 0, "incorrect value for obs[0].lock, expected 0, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].sid.code == 0, "incorrect value for obs[0].sid.code, expected 0, is %d", check_msg->obs[0].sid.code); - ck_assert_msg(check_msg->obs[0].sid.reserved == 0, "incorrect value for obs[0].sid.reserved, expected 0, is %d", check_msg->obs[0].sid.reserved); - ck_assert_msg(check_msg->obs[0].sid.sat == 220, "incorrect value for obs[0].sid.sat, expected 220, is %d", check_msg->obs[0].sid.sat); - ck_assert_msg(check_msg->obs[1].L.f == 38, "incorrect value for obs[1].L.f, expected 38, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == 117691920, "incorrect value for obs[1].L.i, expected 117691920, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 2239428560, "incorrect value for obs[1].P, expected 2239428560, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].cn0 == 156, "incorrect value for obs[1].cn0, expected 156, is %d", check_msg->obs[1].cn0); - ck_assert_msg(check_msg->obs[1].lock == 0, "incorrect value for obs[1].lock, expected 0, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].sid.code == 0, "incorrect value for obs[1].sid.code, expected 0, is %d", check_msg->obs[1].sid.code); - ck_assert_msg(check_msg->obs[1].sid.reserved == 0, "incorrect value for obs[1].sid.reserved, expected 0, is %d", check_msg->obs[1].sid.reserved); - ck_assert_msg(check_msg->obs[1].sid.sat == 222, "incorrect value for obs[1].sid.sat, expected 222, is %d", check_msg->obs[1].sid.sat); - ck_assert_msg(check_msg->obs[2].L.f == 7, "incorrect value for obs[2].L.f, expected 7, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == 107850774, "incorrect value for obs[2].L.i, expected 107850774, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 2052167183, "incorrect value for obs[2].P, expected 2052167183, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].cn0 == 172, "incorrect value for obs[2].cn0, expected 172, is %d", check_msg->obs[2].cn0); - ck_assert_msg(check_msg->obs[2].lock == 0, "incorrect value for obs[2].lock, expected 0, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].sid.code == 0, "incorrect value for obs[2].sid.code, expected 0, is %d", check_msg->obs[2].sid.code); - ck_assert_msg(check_msg->obs[2].sid.reserved == 0, "incorrect value for obs[2].sid.reserved, expected 0, is %d", check_msg->obs[2].sid.reserved); - ck_assert_msg(check_msg->obs[2].sid.sat == 225, "incorrect value for obs[2].sid.sat, expected 225, is %d", check_msg->obs[2].sid.sat); + ck_assert_msg(check_msg->header.n_obs == 33, + "incorrect value for header.n_obs, expected 33, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 2568000, + "incorrect value for header.t.tow, expected 2568000, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1787, + "incorrect value for header.t.wn, expected 1787, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 20, + "incorrect value for obs[0].L.f, expected 20, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == 120255759, + "incorrect value for obs[0].L.i, expected 120255759, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 2288358634, + "incorrect value for obs[0].P, expected 2288358634, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 154, + "incorrect value for obs[0].cn0, expected 154, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 0, + "incorrect value for obs[0].lock, expected 0, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].sid.code == 0, + "incorrect value for obs[0].sid.code, expected 0, is %d", + check_msg->obs[0].sid.code); + ck_assert_msg(check_msg->obs[0].sid.reserved == 0, + "incorrect value for obs[0].sid.reserved, expected 0, is %d", + check_msg->obs[0].sid.reserved); + ck_assert_msg(check_msg->obs[0].sid.sat == 220, + "incorrect value for obs[0].sid.sat, expected 220, is %d", + check_msg->obs[0].sid.sat); + ck_assert_msg(check_msg->obs[1].L.f == 38, + "incorrect value for obs[1].L.f, expected 38, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == 117691920, + "incorrect value for obs[1].L.i, expected 117691920, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 2239428560, + "incorrect value for obs[1].P, expected 2239428560, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].cn0 == 156, + "incorrect value for obs[1].cn0, expected 156, is %d", + check_msg->obs[1].cn0); + ck_assert_msg(check_msg->obs[1].lock == 0, + "incorrect value for obs[1].lock, expected 0, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].sid.code == 0, + "incorrect value for obs[1].sid.code, expected 0, is %d", + check_msg->obs[1].sid.code); + ck_assert_msg(check_msg->obs[1].sid.reserved == 0, + "incorrect value for obs[1].sid.reserved, expected 0, is %d", + check_msg->obs[1].sid.reserved); + ck_assert_msg(check_msg->obs[1].sid.sat == 222, + "incorrect value for obs[1].sid.sat, expected 222, is %d", + check_msg->obs[1].sid.sat); + ck_assert_msg(check_msg->obs[2].L.f == 7, + "incorrect value for obs[2].L.f, expected 7, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == 107850774, + "incorrect value for obs[2].L.i, expected 107850774, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 2052167183, + "incorrect value for obs[2].P, expected 2052167183, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].cn0 == 172, + "incorrect value for obs[2].cn0, expected 172, is %d", + check_msg->obs[2].cn0); + ck_assert_msg(check_msg->obs[2].lock == 0, + "incorrect value for obs[2].lock, expected 0, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].sid.code == 0, + "incorrect value for obs[2].sid.code, expected 0, is %d", + check_msg->obs[2].sid.code); + ck_assert_msg(check_msg->obs[2].sid.reserved == 0, + "incorrect value for obs[2].sid.reserved, expected 0, is %d", + check_msg->obs[2].sid.reserved); + ck_assert_msg(check_msg->obs[2].sid.sat == 225, + "incorrect value for obs[2].sid.sat, expected 225, is %d", + check_msg->obs[2].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -803,17 +1177,28 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x43, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x43, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,67,0,246,215,103,8,48,39,0,251,6,32,254,96,187,133,249,49,7,7,165,156,0,0,202,0,0,0,113,229,85,147,11,33,190,7,106,143,0,0,203,0,0,0,182,85,248,138,227,169,77,7,159,150,0,0,208,0,0,0,17,24,73,135,10,23,28,7,7,156,0,0,212,0,0,0,108,155,105,124,166,196,137,6,186,170,0,0,217,0,0,0,214,142,228,139,77,3,90,7,236,151,0,0,218,0,0,0,59,118, }; + sbp_payload_callback_register(&sbp_state, 0x43, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x43, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 67, 0, 246, 215, 103, 8, 48, 39, 0, 251, 6, 32, 254, + 96, 187, 133, 249, 49, 7, 7, 165, 156, 0, 0, 202, 0, 0, + 0, 113, 229, 85, 147, 11, 33, 190, 7, 106, 143, 0, 0, 203, + 0, 0, 0, 182, 85, 248, 138, 227, 169, 77, 7, 159, 150, 0, + 0, 208, 0, 0, 0, 17, 24, 73, 135, 10, 23, 28, 7, 7, + 156, 0, 0, 212, 0, 0, 0, 108, 155, 105, 124, 166, 196, 137, + 6, 186, 170, 0, 0, 217, 0, 0, 0, 214, 142, 228, 139, 77, + 3, 90, 7, 236, 151, 0, 0, 218, 0, 0, 0, 59, 118, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_b_t* test_msg = ( msg_obs_dep_b_t* )test_msg_storage; + msg_obs_dep_b_t* test_msg = (msg_obs_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 32; test_msg->header.t.tow = 2568200; @@ -890,113 +1275,222 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepB ) test_msg->obs[5].sid.code = 0; test_msg->obs[5].sid.reserved = 0; test_msg->obs[5].sid.sat = 218; - sbp_payload_send(&sbp_state, 0x43, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x43, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x43, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_b_t* check_msg = ( msg_obs_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_b_t* check_msg = (msg_obs_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 32, "incorrect value for header.n_obs, expected 32, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 2568200, "incorrect value for header.t.tow, expected 2568200, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1787, "incorrect value for header.t.wn, expected 1787, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 165, "incorrect value for obs[0].L.f, expected 165, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == 117912057, "incorrect value for obs[0].L.i, expected 117912057, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 2243649790, "incorrect value for obs[0].P, expected 2243649790, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 156, "incorrect value for obs[0].cn0, expected 156, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 0, "incorrect value for obs[0].lock, expected 0, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].sid.code == 0, "incorrect value for obs[0].sid.code, expected 0, is %d", check_msg->obs[0].sid.code); - ck_assert_msg(check_msg->obs[0].sid.reserved == 0, "incorrect value for obs[0].sid.reserved, expected 0, is %d", check_msg->obs[0].sid.reserved); - ck_assert_msg(check_msg->obs[0].sid.sat == 202, "incorrect value for obs[0].sid.sat, expected 202, is %d", check_msg->obs[0].sid.sat); - ck_assert_msg(check_msg->obs[1].L.f == 106, "incorrect value for obs[1].L.f, expected 106, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == 129900811, "incorrect value for obs[1].L.i, expected 129900811, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 2471880049, "incorrect value for obs[1].P, expected 2471880049, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].cn0 == 143, "incorrect value for obs[1].cn0, expected 143, is %d", check_msg->obs[1].cn0); - ck_assert_msg(check_msg->obs[1].lock == 0, "incorrect value for obs[1].lock, expected 0, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].sid.code == 0, "incorrect value for obs[1].sid.code, expected 0, is %d", check_msg->obs[1].sid.code); - ck_assert_msg(check_msg->obs[1].sid.reserved == 0, "incorrect value for obs[1].sid.reserved, expected 0, is %d", check_msg->obs[1].sid.reserved); - ck_assert_msg(check_msg->obs[1].sid.sat == 203, "incorrect value for obs[1].sid.sat, expected 203, is %d", check_msg->obs[1].sid.sat); - ck_assert_msg(check_msg->obs[2].L.f == 159, "incorrect value for obs[2].L.f, expected 159, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == 122530275, "incorrect value for obs[2].L.i, expected 122530275, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 2331530678, "incorrect value for obs[2].P, expected 2331530678, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].cn0 == 150, "incorrect value for obs[2].cn0, expected 150, is %d", check_msg->obs[2].cn0); - ck_assert_msg(check_msg->obs[2].lock == 0, "incorrect value for obs[2].lock, expected 0, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].sid.code == 0, "incorrect value for obs[2].sid.code, expected 0, is %d", check_msg->obs[2].sid.code); - ck_assert_msg(check_msg->obs[2].sid.reserved == 0, "incorrect value for obs[2].sid.reserved, expected 0, is %d", check_msg->obs[2].sid.reserved); - ck_assert_msg(check_msg->obs[2].sid.sat == 208, "incorrect value for obs[2].sid.sat, expected 208, is %d", check_msg->obs[2].sid.sat); - ck_assert_msg(check_msg->obs[3].L.f == 7, "incorrect value for obs[3].L.f, expected 7, is %d", check_msg->obs[3].L.f); - ck_assert_msg(check_msg->obs[3].L.i == 119281418, "incorrect value for obs[3].L.i, expected 119281418, is %d", check_msg->obs[3].L.i); - ck_assert_msg(check_msg->obs[3].P == 2269714449, "incorrect value for obs[3].P, expected 2269714449, is %d", check_msg->obs[3].P); - ck_assert_msg(check_msg->obs[3].cn0 == 156, "incorrect value for obs[3].cn0, expected 156, is %d", check_msg->obs[3].cn0); - ck_assert_msg(check_msg->obs[3].lock == 0, "incorrect value for obs[3].lock, expected 0, is %d", check_msg->obs[3].lock); - ck_assert_msg(check_msg->obs[3].sid.code == 0, "incorrect value for obs[3].sid.code, expected 0, is %d", check_msg->obs[3].sid.code); - ck_assert_msg(check_msg->obs[3].sid.reserved == 0, "incorrect value for obs[3].sid.reserved, expected 0, is %d", check_msg->obs[3].sid.reserved); - ck_assert_msg(check_msg->obs[3].sid.sat == 212, "incorrect value for obs[3].sid.sat, expected 212, is %d", check_msg->obs[3].sid.sat); - ck_assert_msg(check_msg->obs[4].L.f == 186, "incorrect value for obs[4].L.f, expected 186, is %d", check_msg->obs[4].L.f); - ck_assert_msg(check_msg->obs[4].L.i == 109692070, "incorrect value for obs[4].L.i, expected 109692070, is %d", check_msg->obs[4].L.i); - ck_assert_msg(check_msg->obs[4].P == 2087295852, "incorrect value for obs[4].P, expected 2087295852, is %d", check_msg->obs[4].P); - ck_assert_msg(check_msg->obs[4].cn0 == 170, "incorrect value for obs[4].cn0, expected 170, is %d", check_msg->obs[4].cn0); - ck_assert_msg(check_msg->obs[4].lock == 0, "incorrect value for obs[4].lock, expected 0, is %d", check_msg->obs[4].lock); - ck_assert_msg(check_msg->obs[4].sid.code == 0, "incorrect value for obs[4].sid.code, expected 0, is %d", check_msg->obs[4].sid.code); - ck_assert_msg(check_msg->obs[4].sid.reserved == 0, "incorrect value for obs[4].sid.reserved, expected 0, is %d", check_msg->obs[4].sid.reserved); - ck_assert_msg(check_msg->obs[4].sid.sat == 217, "incorrect value for obs[4].sid.sat, expected 217, is %d", check_msg->obs[4].sid.sat); - ck_assert_msg(check_msg->obs[5].L.f == 236, "incorrect value for obs[5].L.f, expected 236, is %d", check_msg->obs[5].L.f); - ck_assert_msg(check_msg->obs[5].L.i == 123339597, "incorrect value for obs[5].L.i, expected 123339597, is %d", check_msg->obs[5].L.i); - ck_assert_msg(check_msg->obs[5].P == 2347011798, "incorrect value for obs[5].P, expected 2347011798, is %d", check_msg->obs[5].P); - ck_assert_msg(check_msg->obs[5].cn0 == 151, "incorrect value for obs[5].cn0, expected 151, is %d", check_msg->obs[5].cn0); - ck_assert_msg(check_msg->obs[5].lock == 0, "incorrect value for obs[5].lock, expected 0, is %d", check_msg->obs[5].lock); - ck_assert_msg(check_msg->obs[5].sid.code == 0, "incorrect value for obs[5].sid.code, expected 0, is %d", check_msg->obs[5].sid.code); - ck_assert_msg(check_msg->obs[5].sid.reserved == 0, "incorrect value for obs[5].sid.reserved, expected 0, is %d", check_msg->obs[5].sid.reserved); - ck_assert_msg(check_msg->obs[5].sid.sat == 218, "incorrect value for obs[5].sid.sat, expected 218, is %d", check_msg->obs[5].sid.sat); + ck_assert_msg(check_msg->header.n_obs == 32, + "incorrect value for header.n_obs, expected 32, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 2568200, + "incorrect value for header.t.tow, expected 2568200, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1787, + "incorrect value for header.t.wn, expected 1787, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 165, + "incorrect value for obs[0].L.f, expected 165, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == 117912057, + "incorrect value for obs[0].L.i, expected 117912057, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 2243649790, + "incorrect value for obs[0].P, expected 2243649790, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 156, + "incorrect value for obs[0].cn0, expected 156, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 0, + "incorrect value for obs[0].lock, expected 0, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].sid.code == 0, + "incorrect value for obs[0].sid.code, expected 0, is %d", + check_msg->obs[0].sid.code); + ck_assert_msg(check_msg->obs[0].sid.reserved == 0, + "incorrect value for obs[0].sid.reserved, expected 0, is %d", + check_msg->obs[0].sid.reserved); + ck_assert_msg(check_msg->obs[0].sid.sat == 202, + "incorrect value for obs[0].sid.sat, expected 202, is %d", + check_msg->obs[0].sid.sat); + ck_assert_msg(check_msg->obs[1].L.f == 106, + "incorrect value for obs[1].L.f, expected 106, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == 129900811, + "incorrect value for obs[1].L.i, expected 129900811, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 2471880049, + "incorrect value for obs[1].P, expected 2471880049, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].cn0 == 143, + "incorrect value for obs[1].cn0, expected 143, is %d", + check_msg->obs[1].cn0); + ck_assert_msg(check_msg->obs[1].lock == 0, + "incorrect value for obs[1].lock, expected 0, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].sid.code == 0, + "incorrect value for obs[1].sid.code, expected 0, is %d", + check_msg->obs[1].sid.code); + ck_assert_msg(check_msg->obs[1].sid.reserved == 0, + "incorrect value for obs[1].sid.reserved, expected 0, is %d", + check_msg->obs[1].sid.reserved); + ck_assert_msg(check_msg->obs[1].sid.sat == 203, + "incorrect value for obs[1].sid.sat, expected 203, is %d", + check_msg->obs[1].sid.sat); + ck_assert_msg(check_msg->obs[2].L.f == 159, + "incorrect value for obs[2].L.f, expected 159, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == 122530275, + "incorrect value for obs[2].L.i, expected 122530275, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 2331530678, + "incorrect value for obs[2].P, expected 2331530678, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].cn0 == 150, + "incorrect value for obs[2].cn0, expected 150, is %d", + check_msg->obs[2].cn0); + ck_assert_msg(check_msg->obs[2].lock == 0, + "incorrect value for obs[2].lock, expected 0, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].sid.code == 0, + "incorrect value for obs[2].sid.code, expected 0, is %d", + check_msg->obs[2].sid.code); + ck_assert_msg(check_msg->obs[2].sid.reserved == 0, + "incorrect value for obs[2].sid.reserved, expected 0, is %d", + check_msg->obs[2].sid.reserved); + ck_assert_msg(check_msg->obs[2].sid.sat == 208, + "incorrect value for obs[2].sid.sat, expected 208, is %d", + check_msg->obs[2].sid.sat); + ck_assert_msg(check_msg->obs[3].L.f == 7, + "incorrect value for obs[3].L.f, expected 7, is %d", + check_msg->obs[3].L.f); + ck_assert_msg(check_msg->obs[3].L.i == 119281418, + "incorrect value for obs[3].L.i, expected 119281418, is %d", + check_msg->obs[3].L.i); + ck_assert_msg(check_msg->obs[3].P == 2269714449, + "incorrect value for obs[3].P, expected 2269714449, is %d", + check_msg->obs[3].P); + ck_assert_msg(check_msg->obs[3].cn0 == 156, + "incorrect value for obs[3].cn0, expected 156, is %d", + check_msg->obs[3].cn0); + ck_assert_msg(check_msg->obs[3].lock == 0, + "incorrect value for obs[3].lock, expected 0, is %d", + check_msg->obs[3].lock); + ck_assert_msg(check_msg->obs[3].sid.code == 0, + "incorrect value for obs[3].sid.code, expected 0, is %d", + check_msg->obs[3].sid.code); + ck_assert_msg(check_msg->obs[3].sid.reserved == 0, + "incorrect value for obs[3].sid.reserved, expected 0, is %d", + check_msg->obs[3].sid.reserved); + ck_assert_msg(check_msg->obs[3].sid.sat == 212, + "incorrect value for obs[3].sid.sat, expected 212, is %d", + check_msg->obs[3].sid.sat); + ck_assert_msg(check_msg->obs[4].L.f == 186, + "incorrect value for obs[4].L.f, expected 186, is %d", + check_msg->obs[4].L.f); + ck_assert_msg(check_msg->obs[4].L.i == 109692070, + "incorrect value for obs[4].L.i, expected 109692070, is %d", + check_msg->obs[4].L.i); + ck_assert_msg(check_msg->obs[4].P == 2087295852, + "incorrect value for obs[4].P, expected 2087295852, is %d", + check_msg->obs[4].P); + ck_assert_msg(check_msg->obs[4].cn0 == 170, + "incorrect value for obs[4].cn0, expected 170, is %d", + check_msg->obs[4].cn0); + ck_assert_msg(check_msg->obs[4].lock == 0, + "incorrect value for obs[4].lock, expected 0, is %d", + check_msg->obs[4].lock); + ck_assert_msg(check_msg->obs[4].sid.code == 0, + "incorrect value for obs[4].sid.code, expected 0, is %d", + check_msg->obs[4].sid.code); + ck_assert_msg(check_msg->obs[4].sid.reserved == 0, + "incorrect value for obs[4].sid.reserved, expected 0, is %d", + check_msg->obs[4].sid.reserved); + ck_assert_msg(check_msg->obs[4].sid.sat == 217, + "incorrect value for obs[4].sid.sat, expected 217, is %d", + check_msg->obs[4].sid.sat); + ck_assert_msg(check_msg->obs[5].L.f == 236, + "incorrect value for obs[5].L.f, expected 236, is %d", + check_msg->obs[5].L.f); + ck_assert_msg(check_msg->obs[5].L.i == 123339597, + "incorrect value for obs[5].L.i, expected 123339597, is %d", + check_msg->obs[5].L.i); + ck_assert_msg(check_msg->obs[5].P == 2347011798, + "incorrect value for obs[5].P, expected 2347011798, is %d", + check_msg->obs[5].P); + ck_assert_msg(check_msg->obs[5].cn0 == 151, + "incorrect value for obs[5].cn0, expected 151, is %d", + check_msg->obs[5].cn0); + ck_assert_msg(check_msg->obs[5].lock == 0, + "incorrect value for obs[5].lock, expected 0, is %d", + check_msg->obs[5].lock); + ck_assert_msg(check_msg->obs[5].sid.code == 0, + "incorrect value for obs[5].sid.code, expected 0, is %d", + check_msg->obs[5].sid.code); + ck_assert_msg(check_msg->obs[5].sid.reserved == 0, + "incorrect value for obs[5].sid.reserved, expected 0, is %d", + check_msg->obs[5].sid.reserved); + ck_assert_msg(check_msg->obs[5].sid.sat == 218, + "incorrect value for obs[5].sid.sat, expected 218, is %d", + check_msg->obs[5].sid.sat); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgObsDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgObsDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgObsDepB"); +Suite* legacy_auto_check_sbp_observation_MsgObsDepB_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_observation_MsgObsDepB"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgObsDepB"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgObsDepB); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_observation_MsgObsDepC.c b/c/test/legacy/auto_check_sbp_observation_MsgObsDepC.c index f79460519..40335e8f3 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgObsDepC.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgObsDepC.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepC.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepC ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgObsDepC) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepC ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,27 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepC ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x49, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x49, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,73,0,70,152,87,8,95,183,24,106,7,32,126,250,73,80,113,94,247,255,231,163,229,229,4,0,0,0,60,220,96,70,81,147,250,255,196,208,20,28,6,0,0,0,248,61,62,77,28,60,242,255,110,171,180,178,7,0,0,0,237,84,190,77,172,37,13,0,41,170,233,164,10,0,0,0,36,85,9,75,240,188,21,0,19,182,196,209,12,0,0,0,190,175, }; + sbp_payload_callback_register(&sbp_state, 0x49, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x49, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 73, 0, 70, 152, 87, 8, 95, 183, 24, 106, 7, 32, 126, + 250, 73, 80, 113, 94, 247, 255, 231, 163, 229, 229, 4, 0, 0, + 0, 60, 220, 96, 70, 81, 147, 250, 255, 196, 208, 20, 28, 6, + 0, 0, 0, 248, 61, 62, 77, 28, 60, 242, 255, 110, 171, 180, + 178, 7, 0, 0, 0, 237, 84, 190, 77, 172, 37, 13, 0, 41, + 170, 233, 164, 10, 0, 0, 0, 36, 85, 9, 75, 240, 188, 21, + 0, 19, 182, 196, 209, 12, 0, 0, 0, 190, 175, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_c_t* test_msg = ( msg_obs_dep_c_t* )test_msg_storage; + msg_obs_dep_c_t* test_msg = (msg_obs_dep_c_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 32; test_msg->header.t.tow = 414670600; @@ -206,102 +213,195 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepC ) test_msg->obs[4].sid.code = 0; test_msg->obs[4].sid.reserved = 0; test_msg->obs[4].sid.sat = 12; - sbp_payload_send(&sbp_state, 0x49, 38982, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x49, 38982, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 38982, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 38982, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x49, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_c_t* check_msg = ( msg_obs_dep_c_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_c_t* check_msg = (msg_obs_dep_c_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 32, "incorrect value for header.n_obs, expected 32, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 414670600, "incorrect value for header.t.tow, expected 414670600, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1898, "incorrect value for header.t.wn, expected 1898, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 231, "incorrect value for obs[0].L.f, expected 231, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == -565647, "incorrect value for obs[0].L.i, expected -565647, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 1347025534, "incorrect value for obs[0].P, expected 1347025534, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 163, "incorrect value for obs[0].cn0, expected 163, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 58853, "incorrect value for obs[0].lock, expected 58853, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].sid.code == 0, "incorrect value for obs[0].sid.code, expected 0, is %d", check_msg->obs[0].sid.code); - ck_assert_msg(check_msg->obs[0].sid.reserved == 0, "incorrect value for obs[0].sid.reserved, expected 0, is %d", check_msg->obs[0].sid.reserved); - ck_assert_msg(check_msg->obs[0].sid.sat == 4, "incorrect value for obs[0].sid.sat, expected 4, is %d", check_msg->obs[0].sid.sat); - ck_assert_msg(check_msg->obs[1].L.f == 196, "incorrect value for obs[1].L.f, expected 196, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == -355503, "incorrect value for obs[1].L.i, expected -355503, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 1180752956, "incorrect value for obs[1].P, expected 1180752956, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].cn0 == 208, "incorrect value for obs[1].cn0, expected 208, is %d", check_msg->obs[1].cn0); - ck_assert_msg(check_msg->obs[1].lock == 7188, "incorrect value for obs[1].lock, expected 7188, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].sid.code == 0, "incorrect value for obs[1].sid.code, expected 0, is %d", check_msg->obs[1].sid.code); - ck_assert_msg(check_msg->obs[1].sid.reserved == 0, "incorrect value for obs[1].sid.reserved, expected 0, is %d", check_msg->obs[1].sid.reserved); - ck_assert_msg(check_msg->obs[1].sid.sat == 6, "incorrect value for obs[1].sid.sat, expected 6, is %d", check_msg->obs[1].sid.sat); - ck_assert_msg(check_msg->obs[2].L.f == 110, "incorrect value for obs[2].L.f, expected 110, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == -902116, "incorrect value for obs[2].L.i, expected -902116, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 1295924728, "incorrect value for obs[2].P, expected 1295924728, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].cn0 == 171, "incorrect value for obs[2].cn0, expected 171, is %d", check_msg->obs[2].cn0); - ck_assert_msg(check_msg->obs[2].lock == 45748, "incorrect value for obs[2].lock, expected 45748, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].sid.code == 0, "incorrect value for obs[2].sid.code, expected 0, is %d", check_msg->obs[2].sid.code); - ck_assert_msg(check_msg->obs[2].sid.reserved == 0, "incorrect value for obs[2].sid.reserved, expected 0, is %d", check_msg->obs[2].sid.reserved); - ck_assert_msg(check_msg->obs[2].sid.sat == 7, "incorrect value for obs[2].sid.sat, expected 7, is %d", check_msg->obs[2].sid.sat); - ck_assert_msg(check_msg->obs[3].L.f == 41, "incorrect value for obs[3].L.f, expected 41, is %d", check_msg->obs[3].L.f); - ck_assert_msg(check_msg->obs[3].L.i == 861612, "incorrect value for obs[3].L.i, expected 861612, is %d", check_msg->obs[3].L.i); - ck_assert_msg(check_msg->obs[3].P == 1304319213, "incorrect value for obs[3].P, expected 1304319213, is %d", check_msg->obs[3].P); - ck_assert_msg(check_msg->obs[3].cn0 == 170, "incorrect value for obs[3].cn0, expected 170, is %d", check_msg->obs[3].cn0); - ck_assert_msg(check_msg->obs[3].lock == 42217, "incorrect value for obs[3].lock, expected 42217, is %d", check_msg->obs[3].lock); - ck_assert_msg(check_msg->obs[3].sid.code == 0, "incorrect value for obs[3].sid.code, expected 0, is %d", check_msg->obs[3].sid.code); - ck_assert_msg(check_msg->obs[3].sid.reserved == 0, "incorrect value for obs[3].sid.reserved, expected 0, is %d", check_msg->obs[3].sid.reserved); - ck_assert_msg(check_msg->obs[3].sid.sat == 10, "incorrect value for obs[3].sid.sat, expected 10, is %d", check_msg->obs[3].sid.sat); - ck_assert_msg(check_msg->obs[4].L.f == 19, "incorrect value for obs[4].L.f, expected 19, is %d", check_msg->obs[4].L.f); - ck_assert_msg(check_msg->obs[4].L.i == 1424624, "incorrect value for obs[4].L.i, expected 1424624, is %d", check_msg->obs[4].L.i); - ck_assert_msg(check_msg->obs[4].P == 1258902820, "incorrect value for obs[4].P, expected 1258902820, is %d", check_msg->obs[4].P); - ck_assert_msg(check_msg->obs[4].cn0 == 182, "incorrect value for obs[4].cn0, expected 182, is %d", check_msg->obs[4].cn0); - ck_assert_msg(check_msg->obs[4].lock == 53700, "incorrect value for obs[4].lock, expected 53700, is %d", check_msg->obs[4].lock); - ck_assert_msg(check_msg->obs[4].sid.code == 0, "incorrect value for obs[4].sid.code, expected 0, is %d", check_msg->obs[4].sid.code); - ck_assert_msg(check_msg->obs[4].sid.reserved == 0, "incorrect value for obs[4].sid.reserved, expected 0, is %d", check_msg->obs[4].sid.reserved); - ck_assert_msg(check_msg->obs[4].sid.sat == 12, "incorrect value for obs[4].sid.sat, expected 12, is %d", check_msg->obs[4].sid.sat); + ck_assert_msg(check_msg->header.n_obs == 32, + "incorrect value for header.n_obs, expected 32, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 414670600, + "incorrect value for header.t.tow, expected 414670600, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1898, + "incorrect value for header.t.wn, expected 1898, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 231, + "incorrect value for obs[0].L.f, expected 231, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == -565647, + "incorrect value for obs[0].L.i, expected -565647, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 1347025534, + "incorrect value for obs[0].P, expected 1347025534, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 163, + "incorrect value for obs[0].cn0, expected 163, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 58853, + "incorrect value for obs[0].lock, expected 58853, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].sid.code == 0, + "incorrect value for obs[0].sid.code, expected 0, is %d", + check_msg->obs[0].sid.code); + ck_assert_msg(check_msg->obs[0].sid.reserved == 0, + "incorrect value for obs[0].sid.reserved, expected 0, is %d", + check_msg->obs[0].sid.reserved); + ck_assert_msg(check_msg->obs[0].sid.sat == 4, + "incorrect value for obs[0].sid.sat, expected 4, is %d", + check_msg->obs[0].sid.sat); + ck_assert_msg(check_msg->obs[1].L.f == 196, + "incorrect value for obs[1].L.f, expected 196, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == -355503, + "incorrect value for obs[1].L.i, expected -355503, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 1180752956, + "incorrect value for obs[1].P, expected 1180752956, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].cn0 == 208, + "incorrect value for obs[1].cn0, expected 208, is %d", + check_msg->obs[1].cn0); + ck_assert_msg(check_msg->obs[1].lock == 7188, + "incorrect value for obs[1].lock, expected 7188, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].sid.code == 0, + "incorrect value for obs[1].sid.code, expected 0, is %d", + check_msg->obs[1].sid.code); + ck_assert_msg(check_msg->obs[1].sid.reserved == 0, + "incorrect value for obs[1].sid.reserved, expected 0, is %d", + check_msg->obs[1].sid.reserved); + ck_assert_msg(check_msg->obs[1].sid.sat == 6, + "incorrect value for obs[1].sid.sat, expected 6, is %d", + check_msg->obs[1].sid.sat); + ck_assert_msg(check_msg->obs[2].L.f == 110, + "incorrect value for obs[2].L.f, expected 110, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == -902116, + "incorrect value for obs[2].L.i, expected -902116, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 1295924728, + "incorrect value for obs[2].P, expected 1295924728, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].cn0 == 171, + "incorrect value for obs[2].cn0, expected 171, is %d", + check_msg->obs[2].cn0); + ck_assert_msg(check_msg->obs[2].lock == 45748, + "incorrect value for obs[2].lock, expected 45748, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].sid.code == 0, + "incorrect value for obs[2].sid.code, expected 0, is %d", + check_msg->obs[2].sid.code); + ck_assert_msg(check_msg->obs[2].sid.reserved == 0, + "incorrect value for obs[2].sid.reserved, expected 0, is %d", + check_msg->obs[2].sid.reserved); + ck_assert_msg(check_msg->obs[2].sid.sat == 7, + "incorrect value for obs[2].sid.sat, expected 7, is %d", + check_msg->obs[2].sid.sat); + ck_assert_msg(check_msg->obs[3].L.f == 41, + "incorrect value for obs[3].L.f, expected 41, is %d", + check_msg->obs[3].L.f); + ck_assert_msg(check_msg->obs[3].L.i == 861612, + "incorrect value for obs[3].L.i, expected 861612, is %d", + check_msg->obs[3].L.i); + ck_assert_msg(check_msg->obs[3].P == 1304319213, + "incorrect value for obs[3].P, expected 1304319213, is %d", + check_msg->obs[3].P); + ck_assert_msg(check_msg->obs[3].cn0 == 170, + "incorrect value for obs[3].cn0, expected 170, is %d", + check_msg->obs[3].cn0); + ck_assert_msg(check_msg->obs[3].lock == 42217, + "incorrect value for obs[3].lock, expected 42217, is %d", + check_msg->obs[3].lock); + ck_assert_msg(check_msg->obs[3].sid.code == 0, + "incorrect value for obs[3].sid.code, expected 0, is %d", + check_msg->obs[3].sid.code); + ck_assert_msg(check_msg->obs[3].sid.reserved == 0, + "incorrect value for obs[3].sid.reserved, expected 0, is %d", + check_msg->obs[3].sid.reserved); + ck_assert_msg(check_msg->obs[3].sid.sat == 10, + "incorrect value for obs[3].sid.sat, expected 10, is %d", + check_msg->obs[3].sid.sat); + ck_assert_msg(check_msg->obs[4].L.f == 19, + "incorrect value for obs[4].L.f, expected 19, is %d", + check_msg->obs[4].L.f); + ck_assert_msg(check_msg->obs[4].L.i == 1424624, + "incorrect value for obs[4].L.i, expected 1424624, is %d", + check_msg->obs[4].L.i); + ck_assert_msg(check_msg->obs[4].P == 1258902820, + "incorrect value for obs[4].P, expected 1258902820, is %d", + check_msg->obs[4].P); + ck_assert_msg(check_msg->obs[4].cn0 == 182, + "incorrect value for obs[4].cn0, expected 182, is %d", + check_msg->obs[4].cn0); + ck_assert_msg(check_msg->obs[4].lock == 53700, + "incorrect value for obs[4].lock, expected 53700, is %d", + check_msg->obs[4].lock); + ck_assert_msg(check_msg->obs[4].sid.code == 0, + "incorrect value for obs[4].sid.code, expected 0, is %d", + check_msg->obs[4].sid.code); + ck_assert_msg(check_msg->obs[4].sid.reserved == 0, + "incorrect value for obs[4].sid.reserved, expected 0, is %d", + check_msg->obs[4].sid.reserved); + ck_assert_msg(check_msg->obs[4].sid.sat == 12, + "incorrect value for obs[4].sid.sat, expected 12, is %d", + check_msg->obs[4].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -309,17 +409,24 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepC ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x49, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x49, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x49, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x49, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,73,0,70,152,55,8,95,183,24,106,7,33,68,166,75,77,186,230,24,0,101,186,162,102,16,0,0,0,87,255,155,69,74,158,5,0,26,190,206,30,27,0,0,0,64,89,124,68,26,22,3,0,114,217,225,73,29,0,0,0,37,179, }; + u8 encoded_frame[] = { + 85, 73, 0, 70, 152, 55, 8, 95, 183, 24, 106, 7, 33, 68, 166, 75, + 77, 186, 230, 24, 0, 101, 186, 162, 102, 16, 0, 0, 0, 87, 255, 155, + 69, 74, 158, 5, 0, 26, 190, 206, 30, 27, 0, 0, 0, 64, 89, 124, + 68, 26, 22, 3, 0, 114, 217, 225, 73, 29, 0, 0, 0, 37, 179, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_c_t* test_msg = ( msg_obs_dep_c_t* )test_msg_storage; + msg_obs_dep_c_t* test_msg = (msg_obs_dep_c_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 33; test_msg->header.t.tow = 414670600; @@ -360,86 +467,147 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepC ) test_msg->obs[2].sid.code = 0; test_msg->obs[2].sid.reserved = 0; test_msg->obs[2].sid.sat = 29; - sbp_payload_send(&sbp_state, 0x49, 38982, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x49, 38982, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 38982, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 38982, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x49, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_c_t* check_msg = ( msg_obs_dep_c_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_c_t* check_msg = (msg_obs_dep_c_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 33, "incorrect value for header.n_obs, expected 33, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 414670600, "incorrect value for header.t.tow, expected 414670600, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1898, "incorrect value for header.t.wn, expected 1898, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 101, "incorrect value for obs[0].L.f, expected 101, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == 1631930, "incorrect value for obs[0].L.i, expected 1631930, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 1296803396, "incorrect value for obs[0].P, expected 1296803396, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 186, "incorrect value for obs[0].cn0, expected 186, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 26274, "incorrect value for obs[0].lock, expected 26274, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].sid.code == 0, "incorrect value for obs[0].sid.code, expected 0, is %d", check_msg->obs[0].sid.code); - ck_assert_msg(check_msg->obs[0].sid.reserved == 0, "incorrect value for obs[0].sid.reserved, expected 0, is %d", check_msg->obs[0].sid.reserved); - ck_assert_msg(check_msg->obs[0].sid.sat == 16, "incorrect value for obs[0].sid.sat, expected 16, is %d", check_msg->obs[0].sid.sat); - ck_assert_msg(check_msg->obs[1].L.f == 26, "incorrect value for obs[1].L.f, expected 26, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == 368202, "incorrect value for obs[1].L.i, expected 368202, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 1167851351, "incorrect value for obs[1].P, expected 1167851351, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].cn0 == 190, "incorrect value for obs[1].cn0, expected 190, is %d", check_msg->obs[1].cn0); - ck_assert_msg(check_msg->obs[1].lock == 7886, "incorrect value for obs[1].lock, expected 7886, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].sid.code == 0, "incorrect value for obs[1].sid.code, expected 0, is %d", check_msg->obs[1].sid.code); - ck_assert_msg(check_msg->obs[1].sid.reserved == 0, "incorrect value for obs[1].sid.reserved, expected 0, is %d", check_msg->obs[1].sid.reserved); - ck_assert_msg(check_msg->obs[1].sid.sat == 27, "incorrect value for obs[1].sid.sat, expected 27, is %d", check_msg->obs[1].sid.sat); - ck_assert_msg(check_msg->obs[2].L.f == 114, "incorrect value for obs[2].L.f, expected 114, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == 202266, "incorrect value for obs[2].L.i, expected 202266, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 1149000000, "incorrect value for obs[2].P, expected 1149000000, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].cn0 == 217, "incorrect value for obs[2].cn0, expected 217, is %d", check_msg->obs[2].cn0); - ck_assert_msg(check_msg->obs[2].lock == 18913, "incorrect value for obs[2].lock, expected 18913, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].sid.code == 0, "incorrect value for obs[2].sid.code, expected 0, is %d", check_msg->obs[2].sid.code); - ck_assert_msg(check_msg->obs[2].sid.reserved == 0, "incorrect value for obs[2].sid.reserved, expected 0, is %d", check_msg->obs[2].sid.reserved); - ck_assert_msg(check_msg->obs[2].sid.sat == 29, "incorrect value for obs[2].sid.sat, expected 29, is %d", check_msg->obs[2].sid.sat); + ck_assert_msg(check_msg->header.n_obs == 33, + "incorrect value for header.n_obs, expected 33, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 414670600, + "incorrect value for header.t.tow, expected 414670600, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1898, + "incorrect value for header.t.wn, expected 1898, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 101, + "incorrect value for obs[0].L.f, expected 101, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == 1631930, + "incorrect value for obs[0].L.i, expected 1631930, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 1296803396, + "incorrect value for obs[0].P, expected 1296803396, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 186, + "incorrect value for obs[0].cn0, expected 186, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 26274, + "incorrect value for obs[0].lock, expected 26274, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].sid.code == 0, + "incorrect value for obs[0].sid.code, expected 0, is %d", + check_msg->obs[0].sid.code); + ck_assert_msg(check_msg->obs[0].sid.reserved == 0, + "incorrect value for obs[0].sid.reserved, expected 0, is %d", + check_msg->obs[0].sid.reserved); + ck_assert_msg(check_msg->obs[0].sid.sat == 16, + "incorrect value for obs[0].sid.sat, expected 16, is %d", + check_msg->obs[0].sid.sat); + ck_assert_msg(check_msg->obs[1].L.f == 26, + "incorrect value for obs[1].L.f, expected 26, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == 368202, + "incorrect value for obs[1].L.i, expected 368202, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 1167851351, + "incorrect value for obs[1].P, expected 1167851351, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].cn0 == 190, + "incorrect value for obs[1].cn0, expected 190, is %d", + check_msg->obs[1].cn0); + ck_assert_msg(check_msg->obs[1].lock == 7886, + "incorrect value for obs[1].lock, expected 7886, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].sid.code == 0, + "incorrect value for obs[1].sid.code, expected 0, is %d", + check_msg->obs[1].sid.code); + ck_assert_msg(check_msg->obs[1].sid.reserved == 0, + "incorrect value for obs[1].sid.reserved, expected 0, is %d", + check_msg->obs[1].sid.reserved); + ck_assert_msg(check_msg->obs[1].sid.sat == 27, + "incorrect value for obs[1].sid.sat, expected 27, is %d", + check_msg->obs[1].sid.sat); + ck_assert_msg(check_msg->obs[2].L.f == 114, + "incorrect value for obs[2].L.f, expected 114, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == 202266, + "incorrect value for obs[2].L.i, expected 202266, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 1149000000, + "incorrect value for obs[2].P, expected 1149000000, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].cn0 == 217, + "incorrect value for obs[2].cn0, expected 217, is %d", + check_msg->obs[2].cn0); + ck_assert_msg(check_msg->obs[2].lock == 18913, + "incorrect value for obs[2].lock, expected 18913, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].sid.code == 0, + "incorrect value for obs[2].sid.code, expected 0, is %d", + check_msg->obs[2].sid.code); + ck_assert_msg(check_msg->obs[2].sid.reserved == 0, + "incorrect value for obs[2].sid.reserved, expected 0, is %d", + check_msg->obs[2].sid.reserved); + ck_assert_msg(check_msg->obs[2].sid.sat == 29, + "incorrect value for obs[2].sid.sat, expected 29, is %d", + check_msg->obs[2].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -447,17 +615,27 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepC ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x49, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x49, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,73,0,0,0,87,8,95,183,24,106,7,32,217,251,73,80,9,72,248,255,30,168,113,81,4,0,0,0,211,220,96,70,198,107,251,255,115,195,53,144,6,0,0,0,77,61,62,77,40,161,243,255,130,176,93,142,7,0,0,0,1,86,190,77,88,77,12,0,116,199,229,213,10,0,0,0,93,85,9,75,64,139,20,0,120,177,196,194,12,0,0,0,141,161, }; + sbp_payload_callback_register(&sbp_state, 0x49, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x49, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 73, 0, 0, 0, 87, 8, 95, 183, 24, 106, 7, 32, 217, + 251, 73, 80, 9, 72, 248, 255, 30, 168, 113, 81, 4, 0, 0, + 0, 211, 220, 96, 70, 198, 107, 251, 255, 115, 195, 53, 144, 6, + 0, 0, 0, 77, 61, 62, 77, 40, 161, 243, 255, 130, 176, 93, + 142, 7, 0, 0, 0, 1, 86, 190, 77, 88, 77, 12, 0, 116, + 199, 229, 213, 10, 0, 0, 0, 93, 85, 9, 75, 64, 139, 20, + 0, 120, 177, 196, 194, 12, 0, 0, 0, 141, 161, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_c_t* test_msg = ( msg_obs_dep_c_t* )test_msg_storage; + msg_obs_dep_c_t* test_msg = (msg_obs_dep_c_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 32; test_msg->header.t.tow = 414670600; @@ -522,102 +700,195 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepC ) test_msg->obs[4].sid.code = 0; test_msg->obs[4].sid.reserved = 0; test_msg->obs[4].sid.sat = 12; - sbp_payload_send(&sbp_state, 0x49, 0, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x49, 0, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 0, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x49, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_c_t* check_msg = ( msg_obs_dep_c_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_c_t* check_msg = (msg_obs_dep_c_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 32, "incorrect value for header.n_obs, expected 32, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 414670600, "incorrect value for header.t.tow, expected 414670600, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1898, "incorrect value for header.t.wn, expected 1898, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 30, "incorrect value for obs[0].L.f, expected 30, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == -505847, "incorrect value for obs[0].L.i, expected -505847, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 1347025881, "incorrect value for obs[0].P, expected 1347025881, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 168, "incorrect value for obs[0].cn0, expected 168, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 20849, "incorrect value for obs[0].lock, expected 20849, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].sid.code == 0, "incorrect value for obs[0].sid.code, expected 0, is %d", check_msg->obs[0].sid.code); - ck_assert_msg(check_msg->obs[0].sid.reserved == 0, "incorrect value for obs[0].sid.reserved, expected 0, is %d", check_msg->obs[0].sid.reserved); - ck_assert_msg(check_msg->obs[0].sid.sat == 4, "incorrect value for obs[0].sid.sat, expected 4, is %d", check_msg->obs[0].sid.sat); - ck_assert_msg(check_msg->obs[1].L.f == 115, "incorrect value for obs[1].L.f, expected 115, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == -300090, "incorrect value for obs[1].L.i, expected -300090, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 1180753107, "incorrect value for obs[1].P, expected 1180753107, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].cn0 == 195, "incorrect value for obs[1].cn0, expected 195, is %d", check_msg->obs[1].cn0); - ck_assert_msg(check_msg->obs[1].lock == 36917, "incorrect value for obs[1].lock, expected 36917, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].sid.code == 0, "incorrect value for obs[1].sid.code, expected 0, is %d", check_msg->obs[1].sid.code); - ck_assert_msg(check_msg->obs[1].sid.reserved == 0, "incorrect value for obs[1].sid.reserved, expected 0, is %d", check_msg->obs[1].sid.reserved); - ck_assert_msg(check_msg->obs[1].sid.sat == 6, "incorrect value for obs[1].sid.sat, expected 6, is %d", check_msg->obs[1].sid.sat); - ck_assert_msg(check_msg->obs[2].L.f == 130, "incorrect value for obs[2].L.f, expected 130, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == -810712, "incorrect value for obs[2].L.i, expected -810712, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 1295924557, "incorrect value for obs[2].P, expected 1295924557, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].cn0 == 176, "incorrect value for obs[2].cn0, expected 176, is %d", check_msg->obs[2].cn0); - ck_assert_msg(check_msg->obs[2].lock == 36445, "incorrect value for obs[2].lock, expected 36445, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].sid.code == 0, "incorrect value for obs[2].sid.code, expected 0, is %d", check_msg->obs[2].sid.code); - ck_assert_msg(check_msg->obs[2].sid.reserved == 0, "incorrect value for obs[2].sid.reserved, expected 0, is %d", check_msg->obs[2].sid.reserved); - ck_assert_msg(check_msg->obs[2].sid.sat == 7, "incorrect value for obs[2].sid.sat, expected 7, is %d", check_msg->obs[2].sid.sat); - ck_assert_msg(check_msg->obs[3].L.f == 116, "incorrect value for obs[3].L.f, expected 116, is %d", check_msg->obs[3].L.f); - ck_assert_msg(check_msg->obs[3].L.i == 806232, "incorrect value for obs[3].L.i, expected 806232, is %d", check_msg->obs[3].L.i); - ck_assert_msg(check_msg->obs[3].P == 1304319489, "incorrect value for obs[3].P, expected 1304319489, is %d", check_msg->obs[3].P); - ck_assert_msg(check_msg->obs[3].cn0 == 199, "incorrect value for obs[3].cn0, expected 199, is %d", check_msg->obs[3].cn0); - ck_assert_msg(check_msg->obs[3].lock == 54757, "incorrect value for obs[3].lock, expected 54757, is %d", check_msg->obs[3].lock); - ck_assert_msg(check_msg->obs[3].sid.code == 0, "incorrect value for obs[3].sid.code, expected 0, is %d", check_msg->obs[3].sid.code); - ck_assert_msg(check_msg->obs[3].sid.reserved == 0, "incorrect value for obs[3].sid.reserved, expected 0, is %d", check_msg->obs[3].sid.reserved); - ck_assert_msg(check_msg->obs[3].sid.sat == 10, "incorrect value for obs[3].sid.sat, expected 10, is %d", check_msg->obs[3].sid.sat); - ck_assert_msg(check_msg->obs[4].L.f == 120, "incorrect value for obs[4].L.f, expected 120, is %d", check_msg->obs[4].L.f); - ck_assert_msg(check_msg->obs[4].L.i == 1346368, "incorrect value for obs[4].L.i, expected 1346368, is %d", check_msg->obs[4].L.i); - ck_assert_msg(check_msg->obs[4].P == 1258902877, "incorrect value for obs[4].P, expected 1258902877, is %d", check_msg->obs[4].P); - ck_assert_msg(check_msg->obs[4].cn0 == 177, "incorrect value for obs[4].cn0, expected 177, is %d", check_msg->obs[4].cn0); - ck_assert_msg(check_msg->obs[4].lock == 49860, "incorrect value for obs[4].lock, expected 49860, is %d", check_msg->obs[4].lock); - ck_assert_msg(check_msg->obs[4].sid.code == 0, "incorrect value for obs[4].sid.code, expected 0, is %d", check_msg->obs[4].sid.code); - ck_assert_msg(check_msg->obs[4].sid.reserved == 0, "incorrect value for obs[4].sid.reserved, expected 0, is %d", check_msg->obs[4].sid.reserved); - ck_assert_msg(check_msg->obs[4].sid.sat == 12, "incorrect value for obs[4].sid.sat, expected 12, is %d", check_msg->obs[4].sid.sat); + ck_assert_msg(check_msg->header.n_obs == 32, + "incorrect value for header.n_obs, expected 32, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 414670600, + "incorrect value for header.t.tow, expected 414670600, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1898, + "incorrect value for header.t.wn, expected 1898, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 30, + "incorrect value for obs[0].L.f, expected 30, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == -505847, + "incorrect value for obs[0].L.i, expected -505847, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 1347025881, + "incorrect value for obs[0].P, expected 1347025881, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 168, + "incorrect value for obs[0].cn0, expected 168, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 20849, + "incorrect value for obs[0].lock, expected 20849, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].sid.code == 0, + "incorrect value for obs[0].sid.code, expected 0, is %d", + check_msg->obs[0].sid.code); + ck_assert_msg(check_msg->obs[0].sid.reserved == 0, + "incorrect value for obs[0].sid.reserved, expected 0, is %d", + check_msg->obs[0].sid.reserved); + ck_assert_msg(check_msg->obs[0].sid.sat == 4, + "incorrect value for obs[0].sid.sat, expected 4, is %d", + check_msg->obs[0].sid.sat); + ck_assert_msg(check_msg->obs[1].L.f == 115, + "incorrect value for obs[1].L.f, expected 115, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == -300090, + "incorrect value for obs[1].L.i, expected -300090, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 1180753107, + "incorrect value for obs[1].P, expected 1180753107, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].cn0 == 195, + "incorrect value for obs[1].cn0, expected 195, is %d", + check_msg->obs[1].cn0); + ck_assert_msg(check_msg->obs[1].lock == 36917, + "incorrect value for obs[1].lock, expected 36917, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].sid.code == 0, + "incorrect value for obs[1].sid.code, expected 0, is %d", + check_msg->obs[1].sid.code); + ck_assert_msg(check_msg->obs[1].sid.reserved == 0, + "incorrect value for obs[1].sid.reserved, expected 0, is %d", + check_msg->obs[1].sid.reserved); + ck_assert_msg(check_msg->obs[1].sid.sat == 6, + "incorrect value for obs[1].sid.sat, expected 6, is %d", + check_msg->obs[1].sid.sat); + ck_assert_msg(check_msg->obs[2].L.f == 130, + "incorrect value for obs[2].L.f, expected 130, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == -810712, + "incorrect value for obs[2].L.i, expected -810712, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 1295924557, + "incorrect value for obs[2].P, expected 1295924557, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].cn0 == 176, + "incorrect value for obs[2].cn0, expected 176, is %d", + check_msg->obs[2].cn0); + ck_assert_msg(check_msg->obs[2].lock == 36445, + "incorrect value for obs[2].lock, expected 36445, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].sid.code == 0, + "incorrect value for obs[2].sid.code, expected 0, is %d", + check_msg->obs[2].sid.code); + ck_assert_msg(check_msg->obs[2].sid.reserved == 0, + "incorrect value for obs[2].sid.reserved, expected 0, is %d", + check_msg->obs[2].sid.reserved); + ck_assert_msg(check_msg->obs[2].sid.sat == 7, + "incorrect value for obs[2].sid.sat, expected 7, is %d", + check_msg->obs[2].sid.sat); + ck_assert_msg(check_msg->obs[3].L.f == 116, + "incorrect value for obs[3].L.f, expected 116, is %d", + check_msg->obs[3].L.f); + ck_assert_msg(check_msg->obs[3].L.i == 806232, + "incorrect value for obs[3].L.i, expected 806232, is %d", + check_msg->obs[3].L.i); + ck_assert_msg(check_msg->obs[3].P == 1304319489, + "incorrect value for obs[3].P, expected 1304319489, is %d", + check_msg->obs[3].P); + ck_assert_msg(check_msg->obs[3].cn0 == 199, + "incorrect value for obs[3].cn0, expected 199, is %d", + check_msg->obs[3].cn0); + ck_assert_msg(check_msg->obs[3].lock == 54757, + "incorrect value for obs[3].lock, expected 54757, is %d", + check_msg->obs[3].lock); + ck_assert_msg(check_msg->obs[3].sid.code == 0, + "incorrect value for obs[3].sid.code, expected 0, is %d", + check_msg->obs[3].sid.code); + ck_assert_msg(check_msg->obs[3].sid.reserved == 0, + "incorrect value for obs[3].sid.reserved, expected 0, is %d", + check_msg->obs[3].sid.reserved); + ck_assert_msg(check_msg->obs[3].sid.sat == 10, + "incorrect value for obs[3].sid.sat, expected 10, is %d", + check_msg->obs[3].sid.sat); + ck_assert_msg(check_msg->obs[4].L.f == 120, + "incorrect value for obs[4].L.f, expected 120, is %d", + check_msg->obs[4].L.f); + ck_assert_msg(check_msg->obs[4].L.i == 1346368, + "incorrect value for obs[4].L.i, expected 1346368, is %d", + check_msg->obs[4].L.i); + ck_assert_msg(check_msg->obs[4].P == 1258902877, + "incorrect value for obs[4].P, expected 1258902877, is %d", + check_msg->obs[4].P); + ck_assert_msg(check_msg->obs[4].cn0 == 177, + "incorrect value for obs[4].cn0, expected 177, is %d", + check_msg->obs[4].cn0); + ck_assert_msg(check_msg->obs[4].lock == 49860, + "incorrect value for obs[4].lock, expected 49860, is %d", + check_msg->obs[4].lock); + ck_assert_msg(check_msg->obs[4].sid.code == 0, + "incorrect value for obs[4].sid.code, expected 0, is %d", + check_msg->obs[4].sid.code); + ck_assert_msg(check_msg->obs[4].sid.reserved == 0, + "incorrect value for obs[4].sid.reserved, expected 0, is %d", + check_msg->obs[4].sid.reserved); + ck_assert_msg(check_msg->obs[4].sid.sat == 12, + "incorrect value for obs[4].sid.sat, expected 12, is %d", + check_msg->obs[4].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -625,17 +896,24 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepC ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x49, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x49, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x49, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x49, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,73,0,0,0,55,8,95,183,24,106,7,33,70,167,75,77,140,136,23,0,90,187,158,129,16,0,0,0,232,255,155,69,45,175,5,0,17,208,175,56,27,0,0,0,64,89,124,68,45,96,3,0,75,185,73,206,29,0,0,0,220,158, }; + u8 encoded_frame[] = { + 85, 73, 0, 0, 0, 55, 8, 95, 183, 24, 106, 7, 33, 70, 167, 75, + 77, 140, 136, 23, 0, 90, 187, 158, 129, 16, 0, 0, 0, 232, 255, 155, + 69, 45, 175, 5, 0, 17, 208, 175, 56, 27, 0, 0, 0, 64, 89, 124, + 68, 45, 96, 3, 0, 75, 185, 73, 206, 29, 0, 0, 0, 220, 158, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_c_t* test_msg = ( msg_obs_dep_c_t* )test_msg_storage; + msg_obs_dep_c_t* test_msg = (msg_obs_dep_c_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 33; test_msg->header.t.tow = 414670600; @@ -676,86 +954,147 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepC ) test_msg->obs[2].sid.code = 0; test_msg->obs[2].sid.reserved = 0; test_msg->obs[2].sid.sat = 29; - sbp_payload_send(&sbp_state, 0x49, 0, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x49, 0, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 0, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x49, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_c_t* check_msg = ( msg_obs_dep_c_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_c_t* check_msg = (msg_obs_dep_c_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 33, "incorrect value for header.n_obs, expected 33, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 414670600, "incorrect value for header.t.tow, expected 414670600, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1898, "incorrect value for header.t.wn, expected 1898, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 90, "incorrect value for obs[0].L.f, expected 90, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == 1542284, "incorrect value for obs[0].L.i, expected 1542284, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 1296803654, "incorrect value for obs[0].P, expected 1296803654, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 187, "incorrect value for obs[0].cn0, expected 187, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 33182, "incorrect value for obs[0].lock, expected 33182, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].sid.code == 0, "incorrect value for obs[0].sid.code, expected 0, is %d", check_msg->obs[0].sid.code); - ck_assert_msg(check_msg->obs[0].sid.reserved == 0, "incorrect value for obs[0].sid.reserved, expected 0, is %d", check_msg->obs[0].sid.reserved); - ck_assert_msg(check_msg->obs[0].sid.sat == 16, "incorrect value for obs[0].sid.sat, expected 16, is %d", check_msg->obs[0].sid.sat); - ck_assert_msg(check_msg->obs[1].L.f == 17, "incorrect value for obs[1].L.f, expected 17, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == 372525, "incorrect value for obs[1].L.i, expected 372525, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 1167851496, "incorrect value for obs[1].P, expected 1167851496, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].cn0 == 208, "incorrect value for obs[1].cn0, expected 208, is %d", check_msg->obs[1].cn0); - ck_assert_msg(check_msg->obs[1].lock == 14511, "incorrect value for obs[1].lock, expected 14511, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].sid.code == 0, "incorrect value for obs[1].sid.code, expected 0, is %d", check_msg->obs[1].sid.code); - ck_assert_msg(check_msg->obs[1].sid.reserved == 0, "incorrect value for obs[1].sid.reserved, expected 0, is %d", check_msg->obs[1].sid.reserved); - ck_assert_msg(check_msg->obs[1].sid.sat == 27, "incorrect value for obs[1].sid.sat, expected 27, is %d", check_msg->obs[1].sid.sat); - ck_assert_msg(check_msg->obs[2].L.f == 75, "incorrect value for obs[2].L.f, expected 75, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == 221229, "incorrect value for obs[2].L.i, expected 221229, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 1149000000, "incorrect value for obs[2].P, expected 1149000000, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].cn0 == 185, "incorrect value for obs[2].cn0, expected 185, is %d", check_msg->obs[2].cn0); - ck_assert_msg(check_msg->obs[2].lock == 52809, "incorrect value for obs[2].lock, expected 52809, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].sid.code == 0, "incorrect value for obs[2].sid.code, expected 0, is %d", check_msg->obs[2].sid.code); - ck_assert_msg(check_msg->obs[2].sid.reserved == 0, "incorrect value for obs[2].sid.reserved, expected 0, is %d", check_msg->obs[2].sid.reserved); - ck_assert_msg(check_msg->obs[2].sid.sat == 29, "incorrect value for obs[2].sid.sat, expected 29, is %d", check_msg->obs[2].sid.sat); + ck_assert_msg(check_msg->header.n_obs == 33, + "incorrect value for header.n_obs, expected 33, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 414670600, + "incorrect value for header.t.tow, expected 414670600, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1898, + "incorrect value for header.t.wn, expected 1898, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 90, + "incorrect value for obs[0].L.f, expected 90, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == 1542284, + "incorrect value for obs[0].L.i, expected 1542284, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 1296803654, + "incorrect value for obs[0].P, expected 1296803654, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 187, + "incorrect value for obs[0].cn0, expected 187, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 33182, + "incorrect value for obs[0].lock, expected 33182, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].sid.code == 0, + "incorrect value for obs[0].sid.code, expected 0, is %d", + check_msg->obs[0].sid.code); + ck_assert_msg(check_msg->obs[0].sid.reserved == 0, + "incorrect value for obs[0].sid.reserved, expected 0, is %d", + check_msg->obs[0].sid.reserved); + ck_assert_msg(check_msg->obs[0].sid.sat == 16, + "incorrect value for obs[0].sid.sat, expected 16, is %d", + check_msg->obs[0].sid.sat); + ck_assert_msg(check_msg->obs[1].L.f == 17, + "incorrect value for obs[1].L.f, expected 17, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == 372525, + "incorrect value for obs[1].L.i, expected 372525, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 1167851496, + "incorrect value for obs[1].P, expected 1167851496, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].cn0 == 208, + "incorrect value for obs[1].cn0, expected 208, is %d", + check_msg->obs[1].cn0); + ck_assert_msg(check_msg->obs[1].lock == 14511, + "incorrect value for obs[1].lock, expected 14511, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].sid.code == 0, + "incorrect value for obs[1].sid.code, expected 0, is %d", + check_msg->obs[1].sid.code); + ck_assert_msg(check_msg->obs[1].sid.reserved == 0, + "incorrect value for obs[1].sid.reserved, expected 0, is %d", + check_msg->obs[1].sid.reserved); + ck_assert_msg(check_msg->obs[1].sid.sat == 27, + "incorrect value for obs[1].sid.sat, expected 27, is %d", + check_msg->obs[1].sid.sat); + ck_assert_msg(check_msg->obs[2].L.f == 75, + "incorrect value for obs[2].L.f, expected 75, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == 221229, + "incorrect value for obs[2].L.i, expected 221229, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 1149000000, + "incorrect value for obs[2].P, expected 1149000000, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].cn0 == 185, + "incorrect value for obs[2].cn0, expected 185, is %d", + check_msg->obs[2].cn0); + ck_assert_msg(check_msg->obs[2].lock == 52809, + "incorrect value for obs[2].lock, expected 52809, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].sid.code == 0, + "incorrect value for obs[2].sid.code, expected 0, is %d", + check_msg->obs[2].sid.code); + ck_assert_msg(check_msg->obs[2].sid.reserved == 0, + "incorrect value for obs[2].sid.reserved, expected 0, is %d", + check_msg->obs[2].sid.reserved); + ck_assert_msg(check_msg->obs[2].sid.sat == 29, + "incorrect value for obs[2].sid.sat, expected 29, is %d", + check_msg->obs[2].sid.sat); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -763,17 +1102,27 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepC ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x49, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x49, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,73,0,70,152,87,208,95,183,24,106,7,32,44,8,74,80,86,93,247,255,57,158,229,229,4,0,0,0,224,229,96,70,156,146,250,255,221,200,20,28,6,0,0,0,60,82,62,77,93,58,242,255,39,164,180,178,7,0,0,0,222,73,190,77,46,39,13,0,202,181,233,164,10,0,0,0,149,64,9,75,114,191,21,0,249,182,196,209,12,0,0,0,112,8, }; + sbp_payload_callback_register(&sbp_state, 0x49, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x49, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 73, 0, 70, 152, 87, 208, 95, 183, 24, 106, 7, 32, 44, + 8, 74, 80, 86, 93, 247, 255, 57, 158, 229, 229, 4, 0, 0, + 0, 224, 229, 96, 70, 156, 146, 250, 255, 221, 200, 20, 28, 6, + 0, 0, 0, 60, 82, 62, 77, 93, 58, 242, 255, 39, 164, 180, + 178, 7, 0, 0, 0, 222, 73, 190, 77, 46, 39, 13, 0, 202, + 181, 233, 164, 10, 0, 0, 0, 149, 64, 9, 75, 114, 191, 21, + 0, 249, 182, 196, 209, 12, 0, 0, 0, 112, 8, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_c_t* test_msg = ( msg_obs_dep_c_t* )test_msg_storage; + msg_obs_dep_c_t* test_msg = (msg_obs_dep_c_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 32; test_msg->header.t.tow = 414670800; @@ -838,105 +1187,198 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgObsDepC ) test_msg->obs[4].sid.code = 0; test_msg->obs[4].sid.reserved = 0; test_msg->obs[4].sid.sat = 12; - sbp_payload_send(&sbp_state, 0x49, 38982, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x49, 38982, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 38982, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 38982, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x49, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_c_t* check_msg = ( msg_obs_dep_c_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_c_t* check_msg = (msg_obs_dep_c_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 32, "incorrect value for header.n_obs, expected 32, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 414670800, "incorrect value for header.t.tow, expected 414670800, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1898, "incorrect value for header.t.wn, expected 1898, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 57, "incorrect value for obs[0].L.f, expected 57, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == -565930, "incorrect value for obs[0].L.i, expected -565930, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 1347029036, "incorrect value for obs[0].P, expected 1347029036, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 158, "incorrect value for obs[0].cn0, expected 158, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 58853, "incorrect value for obs[0].lock, expected 58853, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].sid.code == 0, "incorrect value for obs[0].sid.code, expected 0, is %d", check_msg->obs[0].sid.code); - ck_assert_msg(check_msg->obs[0].sid.reserved == 0, "incorrect value for obs[0].sid.reserved, expected 0, is %d", check_msg->obs[0].sid.reserved); - ck_assert_msg(check_msg->obs[0].sid.sat == 4, "incorrect value for obs[0].sid.sat, expected 4, is %d", check_msg->obs[0].sid.sat); - ck_assert_msg(check_msg->obs[1].L.f == 221, "incorrect value for obs[1].L.f, expected 221, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == -355684, "incorrect value for obs[1].L.i, expected -355684, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 1180755424, "incorrect value for obs[1].P, expected 1180755424, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].cn0 == 200, "incorrect value for obs[1].cn0, expected 200, is %d", check_msg->obs[1].cn0); - ck_assert_msg(check_msg->obs[1].lock == 7188, "incorrect value for obs[1].lock, expected 7188, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].sid.code == 0, "incorrect value for obs[1].sid.code, expected 0, is %d", check_msg->obs[1].sid.code); - ck_assert_msg(check_msg->obs[1].sid.reserved == 0, "incorrect value for obs[1].sid.reserved, expected 0, is %d", check_msg->obs[1].sid.reserved); - ck_assert_msg(check_msg->obs[1].sid.sat == 6, "incorrect value for obs[1].sid.sat, expected 6, is %d", check_msg->obs[1].sid.sat); - ck_assert_msg(check_msg->obs[2].L.f == 39, "incorrect value for obs[2].L.f, expected 39, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == -902563, "incorrect value for obs[2].L.i, expected -902563, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 1295929916, "incorrect value for obs[2].P, expected 1295929916, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].cn0 == 164, "incorrect value for obs[2].cn0, expected 164, is %d", check_msg->obs[2].cn0); - ck_assert_msg(check_msg->obs[2].lock == 45748, "incorrect value for obs[2].lock, expected 45748, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].sid.code == 0, "incorrect value for obs[2].sid.code, expected 0, is %d", check_msg->obs[2].sid.code); - ck_assert_msg(check_msg->obs[2].sid.reserved == 0, "incorrect value for obs[2].sid.reserved, expected 0, is %d", check_msg->obs[2].sid.reserved); - ck_assert_msg(check_msg->obs[2].sid.sat == 7, "incorrect value for obs[2].sid.sat, expected 7, is %d", check_msg->obs[2].sid.sat); - ck_assert_msg(check_msg->obs[3].L.f == 202, "incorrect value for obs[3].L.f, expected 202, is %d", check_msg->obs[3].L.f); - ck_assert_msg(check_msg->obs[3].L.i == 861998, "incorrect value for obs[3].L.i, expected 861998, is %d", check_msg->obs[3].L.i); - ck_assert_msg(check_msg->obs[3].P == 1304316382, "incorrect value for obs[3].P, expected 1304316382, is %d", check_msg->obs[3].P); - ck_assert_msg(check_msg->obs[3].cn0 == 181, "incorrect value for obs[3].cn0, expected 181, is %d", check_msg->obs[3].cn0); - ck_assert_msg(check_msg->obs[3].lock == 42217, "incorrect value for obs[3].lock, expected 42217, is %d", check_msg->obs[3].lock); - ck_assert_msg(check_msg->obs[3].sid.code == 0, "incorrect value for obs[3].sid.code, expected 0, is %d", check_msg->obs[3].sid.code); - ck_assert_msg(check_msg->obs[3].sid.reserved == 0, "incorrect value for obs[3].sid.reserved, expected 0, is %d", check_msg->obs[3].sid.reserved); - ck_assert_msg(check_msg->obs[3].sid.sat == 10, "incorrect value for obs[3].sid.sat, expected 10, is %d", check_msg->obs[3].sid.sat); - ck_assert_msg(check_msg->obs[4].L.f == 249, "incorrect value for obs[4].L.f, expected 249, is %d", check_msg->obs[4].L.f); - ck_assert_msg(check_msg->obs[4].L.i == 1425266, "incorrect value for obs[4].L.i, expected 1425266, is %d", check_msg->obs[4].L.i); - ck_assert_msg(check_msg->obs[4].P == 1258897557, "incorrect value for obs[4].P, expected 1258897557, is %d", check_msg->obs[4].P); - ck_assert_msg(check_msg->obs[4].cn0 == 182, "incorrect value for obs[4].cn0, expected 182, is %d", check_msg->obs[4].cn0); - ck_assert_msg(check_msg->obs[4].lock == 53700, "incorrect value for obs[4].lock, expected 53700, is %d", check_msg->obs[4].lock); - ck_assert_msg(check_msg->obs[4].sid.code == 0, "incorrect value for obs[4].sid.code, expected 0, is %d", check_msg->obs[4].sid.code); - ck_assert_msg(check_msg->obs[4].sid.reserved == 0, "incorrect value for obs[4].sid.reserved, expected 0, is %d", check_msg->obs[4].sid.reserved); - ck_assert_msg(check_msg->obs[4].sid.sat == 12, "incorrect value for obs[4].sid.sat, expected 12, is %d", check_msg->obs[4].sid.sat); + ck_assert_msg(check_msg->header.n_obs == 32, + "incorrect value for header.n_obs, expected 32, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 414670800, + "incorrect value for header.t.tow, expected 414670800, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1898, + "incorrect value for header.t.wn, expected 1898, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 57, + "incorrect value for obs[0].L.f, expected 57, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == -565930, + "incorrect value for obs[0].L.i, expected -565930, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 1347029036, + "incorrect value for obs[0].P, expected 1347029036, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 158, + "incorrect value for obs[0].cn0, expected 158, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 58853, + "incorrect value for obs[0].lock, expected 58853, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].sid.code == 0, + "incorrect value for obs[0].sid.code, expected 0, is %d", + check_msg->obs[0].sid.code); + ck_assert_msg(check_msg->obs[0].sid.reserved == 0, + "incorrect value for obs[0].sid.reserved, expected 0, is %d", + check_msg->obs[0].sid.reserved); + ck_assert_msg(check_msg->obs[0].sid.sat == 4, + "incorrect value for obs[0].sid.sat, expected 4, is %d", + check_msg->obs[0].sid.sat); + ck_assert_msg(check_msg->obs[1].L.f == 221, + "incorrect value for obs[1].L.f, expected 221, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == -355684, + "incorrect value for obs[1].L.i, expected -355684, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 1180755424, + "incorrect value for obs[1].P, expected 1180755424, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].cn0 == 200, + "incorrect value for obs[1].cn0, expected 200, is %d", + check_msg->obs[1].cn0); + ck_assert_msg(check_msg->obs[1].lock == 7188, + "incorrect value for obs[1].lock, expected 7188, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].sid.code == 0, + "incorrect value for obs[1].sid.code, expected 0, is %d", + check_msg->obs[1].sid.code); + ck_assert_msg(check_msg->obs[1].sid.reserved == 0, + "incorrect value for obs[1].sid.reserved, expected 0, is %d", + check_msg->obs[1].sid.reserved); + ck_assert_msg(check_msg->obs[1].sid.sat == 6, + "incorrect value for obs[1].sid.sat, expected 6, is %d", + check_msg->obs[1].sid.sat); + ck_assert_msg(check_msg->obs[2].L.f == 39, + "incorrect value for obs[2].L.f, expected 39, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == -902563, + "incorrect value for obs[2].L.i, expected -902563, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 1295929916, + "incorrect value for obs[2].P, expected 1295929916, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].cn0 == 164, + "incorrect value for obs[2].cn0, expected 164, is %d", + check_msg->obs[2].cn0); + ck_assert_msg(check_msg->obs[2].lock == 45748, + "incorrect value for obs[2].lock, expected 45748, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].sid.code == 0, + "incorrect value for obs[2].sid.code, expected 0, is %d", + check_msg->obs[2].sid.code); + ck_assert_msg(check_msg->obs[2].sid.reserved == 0, + "incorrect value for obs[2].sid.reserved, expected 0, is %d", + check_msg->obs[2].sid.reserved); + ck_assert_msg(check_msg->obs[2].sid.sat == 7, + "incorrect value for obs[2].sid.sat, expected 7, is %d", + check_msg->obs[2].sid.sat); + ck_assert_msg(check_msg->obs[3].L.f == 202, + "incorrect value for obs[3].L.f, expected 202, is %d", + check_msg->obs[3].L.f); + ck_assert_msg(check_msg->obs[3].L.i == 861998, + "incorrect value for obs[3].L.i, expected 861998, is %d", + check_msg->obs[3].L.i); + ck_assert_msg(check_msg->obs[3].P == 1304316382, + "incorrect value for obs[3].P, expected 1304316382, is %d", + check_msg->obs[3].P); + ck_assert_msg(check_msg->obs[3].cn0 == 181, + "incorrect value for obs[3].cn0, expected 181, is %d", + check_msg->obs[3].cn0); + ck_assert_msg(check_msg->obs[3].lock == 42217, + "incorrect value for obs[3].lock, expected 42217, is %d", + check_msg->obs[3].lock); + ck_assert_msg(check_msg->obs[3].sid.code == 0, + "incorrect value for obs[3].sid.code, expected 0, is %d", + check_msg->obs[3].sid.code); + ck_assert_msg(check_msg->obs[3].sid.reserved == 0, + "incorrect value for obs[3].sid.reserved, expected 0, is %d", + check_msg->obs[3].sid.reserved); + ck_assert_msg(check_msg->obs[3].sid.sat == 10, + "incorrect value for obs[3].sid.sat, expected 10, is %d", + check_msg->obs[3].sid.sat); + ck_assert_msg(check_msg->obs[4].L.f == 249, + "incorrect value for obs[4].L.f, expected 249, is %d", + check_msg->obs[4].L.f); + ck_assert_msg(check_msg->obs[4].L.i == 1425266, + "incorrect value for obs[4].L.i, expected 1425266, is %d", + check_msg->obs[4].L.i); + ck_assert_msg(check_msg->obs[4].P == 1258897557, + "incorrect value for obs[4].P, expected 1258897557, is %d", + check_msg->obs[4].P); + ck_assert_msg(check_msg->obs[4].cn0 == 182, + "incorrect value for obs[4].cn0, expected 182, is %d", + check_msg->obs[4].cn0); + ck_assert_msg(check_msg->obs[4].lock == 53700, + "incorrect value for obs[4].lock, expected 53700, is %d", + check_msg->obs[4].lock); + ck_assert_msg(check_msg->obs[4].sid.code == 0, + "incorrect value for obs[4].sid.code, expected 0, is %d", + check_msg->obs[4].sid.code); + ck_assert_msg(check_msg->obs[4].sid.reserved == 0, + "incorrect value for obs[4].sid.reserved, expected 0, is %d", + check_msg->obs[4].sid.reserved); + ck_assert_msg(check_msg->obs[4].sid.sat == 12, + "incorrect value for obs[4].sid.sat, expected 12, is %d", + check_msg->obs[4].sid.sat); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgObsDepC_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgObsDepC"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgObsDepC"); +Suite* legacy_auto_check_sbp_observation_MsgObsDepC_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_observation_MsgObsDepC"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgObsDepC"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgObsDepC); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_observation_MsgOsr.c b/c/test/legacy/auto_check_sbp_observation_MsgOsr.c index 0abf2d6a7..b00fc8891 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgOsr.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgOsr.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgOsr.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgOsr.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgOsr ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgOsr) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgOsr ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,38 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgOsr ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x640, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x640, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x640, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x640, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,64,6,0,0,239,248,225,233,29,0,0,0,0,104,8,64,75,143,241,68,230,250,62,7,66,15,3,1,0,13,0,7,0,7,0,206,232,105,63,236,49,170,6,75,15,3,13,0,13,0,3,0,3,0,45,145,198,62,33,7,153,6,128,15,3,14,0,13,0,3,0,3,0,89,132,204,67,143,46,32,7,127,15,3,15,0,13,0,5,0,5,0,244,254,164,60,22,176,95,6,55,15,3,17,0,0,0,2,0,2,0,106,157,101,62,151,214,142,6,108,15,3,19,0,13,0,3,0,3,0,81,237,60,63,181,119,165,6,206,15,3,28,0,13,0,3,0,3,0,134,228,110,64,183,159,197,6,200,15,3,30,0,13,0,3,0,3,0,53,144,241,68,78,112,165,5,170,15,3,1,6,21,0,7,0,7,0,251,232,105,63,163,128,49,5,129,15,3,13,6,21,0,3,0,3,0,112,145,198,62,37,32,36,5,46,15,3,14,6,21,0,3,0,3,0,166,132,204,67,184,112,141,5,95,15,3,15,6,21,0,5,0,5,0,121,227, }; + u8 encoded_frame[] = { + 85, 64, 6, 0, 0, 239, 248, 225, 233, 29, 0, 0, 0, 0, + 104, 8, 64, 75, 143, 241, 68, 230, 250, 62, 7, 66, 15, 3, + 1, 0, 13, 0, 7, 0, 7, 0, 206, 232, 105, 63, 236, 49, + 170, 6, 75, 15, 3, 13, 0, 13, 0, 3, 0, 3, 0, 45, + 145, 198, 62, 33, 7, 153, 6, 128, 15, 3, 14, 0, 13, 0, + 3, 0, 3, 0, 89, 132, 204, 67, 143, 46, 32, 7, 127, 15, + 3, 15, 0, 13, 0, 5, 0, 5, 0, 244, 254, 164, 60, 22, + 176, 95, 6, 55, 15, 3, 17, 0, 0, 0, 2, 0, 2, 0, + 106, 157, 101, 62, 151, 214, 142, 6, 108, 15, 3, 19, 0, 13, + 0, 3, 0, 3, 0, 81, 237, 60, 63, 181, 119, 165, 6, 206, + 15, 3, 28, 0, 13, 0, 3, 0, 3, 0, 134, 228, 110, 64, + 183, 159, 197, 6, 200, 15, 3, 30, 0, 13, 0, 3, 0, 3, + 0, 53, 144, 241, 68, 78, 112, 165, 5, 170, 15, 3, 1, 6, + 21, 0, 7, 0, 7, 0, 251, 232, 105, 63, 163, 128, 49, 5, + 129, 15, 3, 13, 6, 21, 0, 3, 0, 3, 0, 112, 145, 198, + 62, 37, 32, 36, 5, 46, 15, 3, 14, 6, 21, 0, 3, 0, + 3, 0, 166, 132, 204, 67, 184, 112, 141, 5, 95, 15, 3, 15, + 6, 21, 0, 5, 0, 5, 0, 121, 227, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_osr_t* test_msg = ( msg_osr_t* )test_msg_storage; + msg_osr_t *test_msg = (msg_osr_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 64; test_msg->header.t.ns_residual = 0; @@ -315,186 +333,441 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgOsr ) test_msg->obs[11].sid.code = 6; test_msg->obs[11].sid.sat = 15; test_msg->obs[11].tropo_std = 5; - sbp_payload_send(&sbp_state, 0x640, 0, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x640, 0, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 0, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x640, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_osr_t* check_msg = ( msg_osr_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_osr_t *check_msg = (msg_osr_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 64, "incorrect value for header.n_obs, expected 64, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.ns_residual == 0, "incorrect value for header.t.ns_residual, expected 0, is %d", check_msg->header.t.ns_residual); - ck_assert_msg(check_msg->header.t.tow == 501867000, "incorrect value for header.t.tow, expected 501867000, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 2152, "incorrect value for header.t.wn, expected 2152, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 66, "incorrect value for obs[0].L.f, expected 66, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == 121567974, "incorrect value for obs[0].L.i, expected 121567974, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 1156681547, "incorrect value for obs[0].P, expected 1156681547, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].flags == 3, "incorrect value for obs[0].flags, expected 3, is %d", check_msg->obs[0].flags); - ck_assert_msg(check_msg->obs[0].iono_std == 13, "incorrect value for obs[0].iono_std, expected 13, is %d", check_msg->obs[0].iono_std); - ck_assert_msg(check_msg->obs[0].lock == 15, "incorrect value for obs[0].lock, expected 15, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].range_std == 7, "incorrect value for obs[0].range_std, expected 7, is %d", check_msg->obs[0].range_std); - ck_assert_msg(check_msg->obs[0].sid.code == 0, "incorrect value for obs[0].sid.code, expected 0, is %d", check_msg->obs[0].sid.code); - ck_assert_msg(check_msg->obs[0].sid.sat == 1, "incorrect value for obs[0].sid.sat, expected 1, is %d", check_msg->obs[0].sid.sat); - ck_assert_msg(check_msg->obs[0].tropo_std == 7, "incorrect value for obs[0].tropo_std, expected 7, is %d", check_msg->obs[0].tropo_std); - ck_assert_msg(check_msg->obs[1].L.f == 75, "incorrect value for obs[1].L.f, expected 75, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == 111817196, "incorrect value for obs[1].L.i, expected 111817196, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 1063905486, "incorrect value for obs[1].P, expected 1063905486, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].flags == 3, "incorrect value for obs[1].flags, expected 3, is %d", check_msg->obs[1].flags); - ck_assert_msg(check_msg->obs[1].iono_std == 13, "incorrect value for obs[1].iono_std, expected 13, is %d", check_msg->obs[1].iono_std); - ck_assert_msg(check_msg->obs[1].lock == 15, "incorrect value for obs[1].lock, expected 15, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].range_std == 3, "incorrect value for obs[1].range_std, expected 3, is %d", check_msg->obs[1].range_std); - ck_assert_msg(check_msg->obs[1].sid.code == 0, "incorrect value for obs[1].sid.code, expected 0, is %d", check_msg->obs[1].sid.code); - ck_assert_msg(check_msg->obs[1].sid.sat == 13, "incorrect value for obs[1].sid.sat, expected 13, is %d", check_msg->obs[1].sid.sat); - ck_assert_msg(check_msg->obs[1].tropo_std == 3, "incorrect value for obs[1].tropo_std, expected 3, is %d", check_msg->obs[1].tropo_std); - ck_assert_msg(check_msg->obs[2].L.f == 128, "incorrect value for obs[2].L.f, expected 128, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == 110692129, "incorrect value for obs[2].L.i, expected 110692129, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 1053200685, "incorrect value for obs[2].P, expected 1053200685, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].flags == 3, "incorrect value for obs[2].flags, expected 3, is %d", check_msg->obs[2].flags); - ck_assert_msg(check_msg->obs[2].iono_std == 13, "incorrect value for obs[2].iono_std, expected 13, is %d", check_msg->obs[2].iono_std); - ck_assert_msg(check_msg->obs[2].lock == 15, "incorrect value for obs[2].lock, expected 15, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].range_std == 3, "incorrect value for obs[2].range_std, expected 3, is %d", check_msg->obs[2].range_std); - ck_assert_msg(check_msg->obs[2].sid.code == 0, "incorrect value for obs[2].sid.code, expected 0, is %d", check_msg->obs[2].sid.code); - ck_assert_msg(check_msg->obs[2].sid.sat == 14, "incorrect value for obs[2].sid.sat, expected 14, is %d", check_msg->obs[2].sid.sat); - ck_assert_msg(check_msg->obs[2].tropo_std == 3, "incorrect value for obs[2].tropo_std, expected 3, is %d", check_msg->obs[2].tropo_std); - ck_assert_msg(check_msg->obs[3].L.f == 127, "incorrect value for obs[3].L.f, expected 127, is %d", check_msg->obs[3].L.f); - ck_assert_msg(check_msg->obs[3].L.i == 119549583, "incorrect value for obs[3].L.i, expected 119549583, is %d", check_msg->obs[3].L.i); - ck_assert_msg(check_msg->obs[3].P == 1137476697, "incorrect value for obs[3].P, expected 1137476697, is %d", check_msg->obs[3].P); - ck_assert_msg(check_msg->obs[3].flags == 3, "incorrect value for obs[3].flags, expected 3, is %d", check_msg->obs[3].flags); - ck_assert_msg(check_msg->obs[3].iono_std == 13, "incorrect value for obs[3].iono_std, expected 13, is %d", check_msg->obs[3].iono_std); - ck_assert_msg(check_msg->obs[3].lock == 15, "incorrect value for obs[3].lock, expected 15, is %d", check_msg->obs[3].lock); - ck_assert_msg(check_msg->obs[3].range_std == 5, "incorrect value for obs[3].range_std, expected 5, is %d", check_msg->obs[3].range_std); - ck_assert_msg(check_msg->obs[3].sid.code == 0, "incorrect value for obs[3].sid.code, expected 0, is %d", check_msg->obs[3].sid.code); - ck_assert_msg(check_msg->obs[3].sid.sat == 15, "incorrect value for obs[3].sid.sat, expected 15, is %d", check_msg->obs[3].sid.sat); - ck_assert_msg(check_msg->obs[3].tropo_std == 5, "incorrect value for obs[3].tropo_std, expected 5, is %d", check_msg->obs[3].tropo_std); - ck_assert_msg(check_msg->obs[4].L.f == 55, "incorrect value for obs[4].L.f, expected 55, is %d", check_msg->obs[4].L.f); - ck_assert_msg(check_msg->obs[4].L.i == 106934294, "incorrect value for obs[4].L.i, expected 106934294, is %d", check_msg->obs[4].L.i); - ck_assert_msg(check_msg->obs[4].P == 1017446132, "incorrect value for obs[4].P, expected 1017446132, is %d", check_msg->obs[4].P); - ck_assert_msg(check_msg->obs[4].flags == 3, "incorrect value for obs[4].flags, expected 3, is %d", check_msg->obs[4].flags); - ck_assert_msg(check_msg->obs[4].iono_std == 0, "incorrect value for obs[4].iono_std, expected 0, is %d", check_msg->obs[4].iono_std); - ck_assert_msg(check_msg->obs[4].lock == 15, "incorrect value for obs[4].lock, expected 15, is %d", check_msg->obs[4].lock); - ck_assert_msg(check_msg->obs[4].range_std == 2, "incorrect value for obs[4].range_std, expected 2, is %d", check_msg->obs[4].range_std); - ck_assert_msg(check_msg->obs[4].sid.code == 0, "incorrect value for obs[4].sid.code, expected 0, is %d", check_msg->obs[4].sid.code); - ck_assert_msg(check_msg->obs[4].sid.sat == 17, "incorrect value for obs[4].sid.sat, expected 17, is %d", check_msg->obs[4].sid.sat); - ck_assert_msg(check_msg->obs[4].tropo_std == 2, "incorrect value for obs[4].tropo_std, expected 2, is %d", check_msg->obs[4].tropo_std); - ck_assert_msg(check_msg->obs[5].L.f == 108, "incorrect value for obs[5].L.f, expected 108, is %d", check_msg->obs[5].L.f); - ck_assert_msg(check_msg->obs[5].L.i == 110024343, "incorrect value for obs[5].L.i, expected 110024343, is %d", check_msg->obs[5].L.i); - ck_assert_msg(check_msg->obs[5].P == 1046846826, "incorrect value for obs[5].P, expected 1046846826, is %d", check_msg->obs[5].P); - ck_assert_msg(check_msg->obs[5].flags == 3, "incorrect value for obs[5].flags, expected 3, is %d", check_msg->obs[5].flags); - ck_assert_msg(check_msg->obs[5].iono_std == 13, "incorrect value for obs[5].iono_std, expected 13, is %d", check_msg->obs[5].iono_std); - ck_assert_msg(check_msg->obs[5].lock == 15, "incorrect value for obs[5].lock, expected 15, is %d", check_msg->obs[5].lock); - ck_assert_msg(check_msg->obs[5].range_std == 3, "incorrect value for obs[5].range_std, expected 3, is %d", check_msg->obs[5].range_std); - ck_assert_msg(check_msg->obs[5].sid.code == 0, "incorrect value for obs[5].sid.code, expected 0, is %d", check_msg->obs[5].sid.code); - ck_assert_msg(check_msg->obs[5].sid.sat == 19, "incorrect value for obs[5].sid.sat, expected 19, is %d", check_msg->obs[5].sid.sat); - ck_assert_msg(check_msg->obs[5].tropo_std == 3, "incorrect value for obs[5].tropo_std, expected 3, is %d", check_msg->obs[5].tropo_std); - ck_assert_msg(check_msg->obs[6].L.f == 206, "incorrect value for obs[6].L.f, expected 206, is %d", check_msg->obs[6].L.f); - ck_assert_msg(check_msg->obs[6].L.i == 111507381, "incorrect value for obs[6].L.i, expected 111507381, is %d", check_msg->obs[6].L.i); - ck_assert_msg(check_msg->obs[6].P == 1060957521, "incorrect value for obs[6].P, expected 1060957521, is %d", check_msg->obs[6].P); - ck_assert_msg(check_msg->obs[6].flags == 3, "incorrect value for obs[6].flags, expected 3, is %d", check_msg->obs[6].flags); - ck_assert_msg(check_msg->obs[6].iono_std == 13, "incorrect value for obs[6].iono_std, expected 13, is %d", check_msg->obs[6].iono_std); - ck_assert_msg(check_msg->obs[6].lock == 15, "incorrect value for obs[6].lock, expected 15, is %d", check_msg->obs[6].lock); - ck_assert_msg(check_msg->obs[6].range_std == 3, "incorrect value for obs[6].range_std, expected 3, is %d", check_msg->obs[6].range_std); - ck_assert_msg(check_msg->obs[6].sid.code == 0, "incorrect value for obs[6].sid.code, expected 0, is %d", check_msg->obs[6].sid.code); - ck_assert_msg(check_msg->obs[6].sid.sat == 28, "incorrect value for obs[6].sid.sat, expected 28, is %d", check_msg->obs[6].sid.sat); - ck_assert_msg(check_msg->obs[6].tropo_std == 3, "incorrect value for obs[6].tropo_std, expected 3, is %d", check_msg->obs[6].tropo_std); - ck_assert_msg(check_msg->obs[7].L.f == 200, "incorrect value for obs[7].L.f, expected 200, is %d", check_msg->obs[7].L.f); - ck_assert_msg(check_msg->obs[7].L.i == 113614775, "incorrect value for obs[7].L.i, expected 113614775, is %d", check_msg->obs[7].L.i); - ck_assert_msg(check_msg->obs[7].P == 1081009286, "incorrect value for obs[7].P, expected 1081009286, is %d", check_msg->obs[7].P); - ck_assert_msg(check_msg->obs[7].flags == 3, "incorrect value for obs[7].flags, expected 3, is %d", check_msg->obs[7].flags); - ck_assert_msg(check_msg->obs[7].iono_std == 13, "incorrect value for obs[7].iono_std, expected 13, is %d", check_msg->obs[7].iono_std); - ck_assert_msg(check_msg->obs[7].lock == 15, "incorrect value for obs[7].lock, expected 15, is %d", check_msg->obs[7].lock); - ck_assert_msg(check_msg->obs[7].range_std == 3, "incorrect value for obs[7].range_std, expected 3, is %d", check_msg->obs[7].range_std); - ck_assert_msg(check_msg->obs[7].sid.code == 0, "incorrect value for obs[7].sid.code, expected 0, is %d", check_msg->obs[7].sid.code); - ck_assert_msg(check_msg->obs[7].sid.sat == 30, "incorrect value for obs[7].sid.sat, expected 30, is %d", check_msg->obs[7].sid.sat); - ck_assert_msg(check_msg->obs[7].tropo_std == 3, "incorrect value for obs[7].tropo_std, expected 3, is %d", check_msg->obs[7].tropo_std); - ck_assert_msg(check_msg->obs[8].L.f == 170, "incorrect value for obs[8].L.f, expected 170, is %d", check_msg->obs[8].L.f); - ck_assert_msg(check_msg->obs[8].L.i == 94728270, "incorrect value for obs[8].L.i, expected 94728270, is %d", check_msg->obs[8].L.i); - ck_assert_msg(check_msg->obs[8].P == 1156681781, "incorrect value for obs[8].P, expected 1156681781, is %d", check_msg->obs[8].P); - ck_assert_msg(check_msg->obs[8].flags == 3, "incorrect value for obs[8].flags, expected 3, is %d", check_msg->obs[8].flags); - ck_assert_msg(check_msg->obs[8].iono_std == 21, "incorrect value for obs[8].iono_std, expected 21, is %d", check_msg->obs[8].iono_std); - ck_assert_msg(check_msg->obs[8].lock == 15, "incorrect value for obs[8].lock, expected 15, is %d", check_msg->obs[8].lock); - ck_assert_msg(check_msg->obs[8].range_std == 7, "incorrect value for obs[8].range_std, expected 7, is %d", check_msg->obs[8].range_std); - ck_assert_msg(check_msg->obs[8].sid.code == 6, "incorrect value for obs[8].sid.code, expected 6, is %d", check_msg->obs[8].sid.code); - ck_assert_msg(check_msg->obs[8].sid.sat == 1, "incorrect value for obs[8].sid.sat, expected 1, is %d", check_msg->obs[8].sid.sat); - ck_assert_msg(check_msg->obs[8].tropo_std == 7, "incorrect value for obs[8].tropo_std, expected 7, is %d", check_msg->obs[8].tropo_std); - ck_assert_msg(check_msg->obs[9].L.f == 129, "incorrect value for obs[9].L.f, expected 129, is %d", check_msg->obs[9].L.f); - ck_assert_msg(check_msg->obs[9].L.i == 87130275, "incorrect value for obs[9].L.i, expected 87130275, is %d", check_msg->obs[9].L.i); - ck_assert_msg(check_msg->obs[9].P == 1063905531, "incorrect value for obs[9].P, expected 1063905531, is %d", check_msg->obs[9].P); - ck_assert_msg(check_msg->obs[9].flags == 3, "incorrect value for obs[9].flags, expected 3, is %d", check_msg->obs[9].flags); - ck_assert_msg(check_msg->obs[9].iono_std == 21, "incorrect value for obs[9].iono_std, expected 21, is %d", check_msg->obs[9].iono_std); - ck_assert_msg(check_msg->obs[9].lock == 15, "incorrect value for obs[9].lock, expected 15, is %d", check_msg->obs[9].lock); - ck_assert_msg(check_msg->obs[9].range_std == 3, "incorrect value for obs[9].range_std, expected 3, is %d", check_msg->obs[9].range_std); - ck_assert_msg(check_msg->obs[9].sid.code == 6, "incorrect value for obs[9].sid.code, expected 6, is %d", check_msg->obs[9].sid.code); - ck_assert_msg(check_msg->obs[9].sid.sat == 13, "incorrect value for obs[9].sid.sat, expected 13, is %d", check_msg->obs[9].sid.sat); - ck_assert_msg(check_msg->obs[9].tropo_std == 3, "incorrect value for obs[9].tropo_std, expected 3, is %d", check_msg->obs[9].tropo_std); - ck_assert_msg(check_msg->obs[10].L.f == 46, "incorrect value for obs[10].L.f, expected 46, is %d", check_msg->obs[10].L.f); - ck_assert_msg(check_msg->obs[10].L.i == 86253605, "incorrect value for obs[10].L.i, expected 86253605, is %d", check_msg->obs[10].L.i); - ck_assert_msg(check_msg->obs[10].P == 1053200752, "incorrect value for obs[10].P, expected 1053200752, is %d", check_msg->obs[10].P); - ck_assert_msg(check_msg->obs[10].flags == 3, "incorrect value for obs[10].flags, expected 3, is %d", check_msg->obs[10].flags); - ck_assert_msg(check_msg->obs[10].iono_std == 21, "incorrect value for obs[10].iono_std, expected 21, is %d", check_msg->obs[10].iono_std); - ck_assert_msg(check_msg->obs[10].lock == 15, "incorrect value for obs[10].lock, expected 15, is %d", check_msg->obs[10].lock); - ck_assert_msg(check_msg->obs[10].range_std == 3, "incorrect value for obs[10].range_std, expected 3, is %d", check_msg->obs[10].range_std); - ck_assert_msg(check_msg->obs[10].sid.code == 6, "incorrect value for obs[10].sid.code, expected 6, is %d", check_msg->obs[10].sid.code); - ck_assert_msg(check_msg->obs[10].sid.sat == 14, "incorrect value for obs[10].sid.sat, expected 14, is %d", check_msg->obs[10].sid.sat); - ck_assert_msg(check_msg->obs[10].tropo_std == 3, "incorrect value for obs[10].tropo_std, expected 3, is %d", check_msg->obs[10].tropo_std); - ck_assert_msg(check_msg->obs[11].L.f == 95, "incorrect value for obs[11].L.f, expected 95, is %d", check_msg->obs[11].L.f); - ck_assert_msg(check_msg->obs[11].L.i == 93155512, "incorrect value for obs[11].L.i, expected 93155512, is %d", check_msg->obs[11].L.i); - ck_assert_msg(check_msg->obs[11].P == 1137476774, "incorrect value for obs[11].P, expected 1137476774, is %d", check_msg->obs[11].P); - ck_assert_msg(check_msg->obs[11].flags == 3, "incorrect value for obs[11].flags, expected 3, is %d", check_msg->obs[11].flags); - ck_assert_msg(check_msg->obs[11].iono_std == 21, "incorrect value for obs[11].iono_std, expected 21, is %d", check_msg->obs[11].iono_std); - ck_assert_msg(check_msg->obs[11].lock == 15, "incorrect value for obs[11].lock, expected 15, is %d", check_msg->obs[11].lock); - ck_assert_msg(check_msg->obs[11].range_std == 5, "incorrect value for obs[11].range_std, expected 5, is %d", check_msg->obs[11].range_std); - ck_assert_msg(check_msg->obs[11].sid.code == 6, "incorrect value for obs[11].sid.code, expected 6, is %d", check_msg->obs[11].sid.code); - ck_assert_msg(check_msg->obs[11].sid.sat == 15, "incorrect value for obs[11].sid.sat, expected 15, is %d", check_msg->obs[11].sid.sat); - ck_assert_msg(check_msg->obs[11].tropo_std == 5, "incorrect value for obs[11].tropo_std, expected 5, is %d", check_msg->obs[11].tropo_std); + ck_assert_msg(check_msg->header.n_obs == 64, + "incorrect value for header.n_obs, expected 64, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.ns_residual == 0, + "incorrect value for header.t.ns_residual, expected 0, is %d", + check_msg->header.t.ns_residual); + ck_assert_msg(check_msg->header.t.tow == 501867000, + "incorrect value for header.t.tow, expected 501867000, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 2152, + "incorrect value for header.t.wn, expected 2152, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 66, + "incorrect value for obs[0].L.f, expected 66, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == 121567974, + "incorrect value for obs[0].L.i, expected 121567974, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 1156681547, + "incorrect value for obs[0].P, expected 1156681547, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].flags == 3, + "incorrect value for obs[0].flags, expected 3, is %d", + check_msg->obs[0].flags); + ck_assert_msg(check_msg->obs[0].iono_std == 13, + "incorrect value for obs[0].iono_std, expected 13, is %d", + check_msg->obs[0].iono_std); + ck_assert_msg(check_msg->obs[0].lock == 15, + "incorrect value for obs[0].lock, expected 15, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].range_std == 7, + "incorrect value for obs[0].range_std, expected 7, is %d", + check_msg->obs[0].range_std); + ck_assert_msg(check_msg->obs[0].sid.code == 0, + "incorrect value for obs[0].sid.code, expected 0, is %d", + check_msg->obs[0].sid.code); + ck_assert_msg(check_msg->obs[0].sid.sat == 1, + "incorrect value for obs[0].sid.sat, expected 1, is %d", + check_msg->obs[0].sid.sat); + ck_assert_msg(check_msg->obs[0].tropo_std == 7, + "incorrect value for obs[0].tropo_std, expected 7, is %d", + check_msg->obs[0].tropo_std); + ck_assert_msg(check_msg->obs[1].L.f == 75, + "incorrect value for obs[1].L.f, expected 75, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == 111817196, + "incorrect value for obs[1].L.i, expected 111817196, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 1063905486, + "incorrect value for obs[1].P, expected 1063905486, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].flags == 3, + "incorrect value for obs[1].flags, expected 3, is %d", + check_msg->obs[1].flags); + ck_assert_msg(check_msg->obs[1].iono_std == 13, + "incorrect value for obs[1].iono_std, expected 13, is %d", + check_msg->obs[1].iono_std); + ck_assert_msg(check_msg->obs[1].lock == 15, + "incorrect value for obs[1].lock, expected 15, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].range_std == 3, + "incorrect value for obs[1].range_std, expected 3, is %d", + check_msg->obs[1].range_std); + ck_assert_msg(check_msg->obs[1].sid.code == 0, + "incorrect value for obs[1].sid.code, expected 0, is %d", + check_msg->obs[1].sid.code); + ck_assert_msg(check_msg->obs[1].sid.sat == 13, + "incorrect value for obs[1].sid.sat, expected 13, is %d", + check_msg->obs[1].sid.sat); + ck_assert_msg(check_msg->obs[1].tropo_std == 3, + "incorrect value for obs[1].tropo_std, expected 3, is %d", + check_msg->obs[1].tropo_std); + ck_assert_msg(check_msg->obs[2].L.f == 128, + "incorrect value for obs[2].L.f, expected 128, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == 110692129, + "incorrect value for obs[2].L.i, expected 110692129, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 1053200685, + "incorrect value for obs[2].P, expected 1053200685, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].flags == 3, + "incorrect value for obs[2].flags, expected 3, is %d", + check_msg->obs[2].flags); + ck_assert_msg(check_msg->obs[2].iono_std == 13, + "incorrect value for obs[2].iono_std, expected 13, is %d", + check_msg->obs[2].iono_std); + ck_assert_msg(check_msg->obs[2].lock == 15, + "incorrect value for obs[2].lock, expected 15, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].range_std == 3, + "incorrect value for obs[2].range_std, expected 3, is %d", + check_msg->obs[2].range_std); + ck_assert_msg(check_msg->obs[2].sid.code == 0, + "incorrect value for obs[2].sid.code, expected 0, is %d", + check_msg->obs[2].sid.code); + ck_assert_msg(check_msg->obs[2].sid.sat == 14, + "incorrect value for obs[2].sid.sat, expected 14, is %d", + check_msg->obs[2].sid.sat); + ck_assert_msg(check_msg->obs[2].tropo_std == 3, + "incorrect value for obs[2].tropo_std, expected 3, is %d", + check_msg->obs[2].tropo_std); + ck_assert_msg(check_msg->obs[3].L.f == 127, + "incorrect value for obs[3].L.f, expected 127, is %d", + check_msg->obs[3].L.f); + ck_assert_msg(check_msg->obs[3].L.i == 119549583, + "incorrect value for obs[3].L.i, expected 119549583, is %d", + check_msg->obs[3].L.i); + ck_assert_msg(check_msg->obs[3].P == 1137476697, + "incorrect value for obs[3].P, expected 1137476697, is %d", + check_msg->obs[3].P); + ck_assert_msg(check_msg->obs[3].flags == 3, + "incorrect value for obs[3].flags, expected 3, is %d", + check_msg->obs[3].flags); + ck_assert_msg(check_msg->obs[3].iono_std == 13, + "incorrect value for obs[3].iono_std, expected 13, is %d", + check_msg->obs[3].iono_std); + ck_assert_msg(check_msg->obs[3].lock == 15, + "incorrect value for obs[3].lock, expected 15, is %d", + check_msg->obs[3].lock); + ck_assert_msg(check_msg->obs[3].range_std == 5, + "incorrect value for obs[3].range_std, expected 5, is %d", + check_msg->obs[3].range_std); + ck_assert_msg(check_msg->obs[3].sid.code == 0, + "incorrect value for obs[3].sid.code, expected 0, is %d", + check_msg->obs[3].sid.code); + ck_assert_msg(check_msg->obs[3].sid.sat == 15, + "incorrect value for obs[3].sid.sat, expected 15, is %d", + check_msg->obs[3].sid.sat); + ck_assert_msg(check_msg->obs[3].tropo_std == 5, + "incorrect value for obs[3].tropo_std, expected 5, is %d", + check_msg->obs[3].tropo_std); + ck_assert_msg(check_msg->obs[4].L.f == 55, + "incorrect value for obs[4].L.f, expected 55, is %d", + check_msg->obs[4].L.f); + ck_assert_msg(check_msg->obs[4].L.i == 106934294, + "incorrect value for obs[4].L.i, expected 106934294, is %d", + check_msg->obs[4].L.i); + ck_assert_msg(check_msg->obs[4].P == 1017446132, + "incorrect value for obs[4].P, expected 1017446132, is %d", + check_msg->obs[4].P); + ck_assert_msg(check_msg->obs[4].flags == 3, + "incorrect value for obs[4].flags, expected 3, is %d", + check_msg->obs[4].flags); + ck_assert_msg(check_msg->obs[4].iono_std == 0, + "incorrect value for obs[4].iono_std, expected 0, is %d", + check_msg->obs[4].iono_std); + ck_assert_msg(check_msg->obs[4].lock == 15, + "incorrect value for obs[4].lock, expected 15, is %d", + check_msg->obs[4].lock); + ck_assert_msg(check_msg->obs[4].range_std == 2, + "incorrect value for obs[4].range_std, expected 2, is %d", + check_msg->obs[4].range_std); + ck_assert_msg(check_msg->obs[4].sid.code == 0, + "incorrect value for obs[4].sid.code, expected 0, is %d", + check_msg->obs[4].sid.code); + ck_assert_msg(check_msg->obs[4].sid.sat == 17, + "incorrect value for obs[4].sid.sat, expected 17, is %d", + check_msg->obs[4].sid.sat); + ck_assert_msg(check_msg->obs[4].tropo_std == 2, + "incorrect value for obs[4].tropo_std, expected 2, is %d", + check_msg->obs[4].tropo_std); + ck_assert_msg(check_msg->obs[5].L.f == 108, + "incorrect value for obs[5].L.f, expected 108, is %d", + check_msg->obs[5].L.f); + ck_assert_msg(check_msg->obs[5].L.i == 110024343, + "incorrect value for obs[5].L.i, expected 110024343, is %d", + check_msg->obs[5].L.i); + ck_assert_msg(check_msg->obs[5].P == 1046846826, + "incorrect value for obs[5].P, expected 1046846826, is %d", + check_msg->obs[5].P); + ck_assert_msg(check_msg->obs[5].flags == 3, + "incorrect value for obs[5].flags, expected 3, is %d", + check_msg->obs[5].flags); + ck_assert_msg(check_msg->obs[5].iono_std == 13, + "incorrect value for obs[5].iono_std, expected 13, is %d", + check_msg->obs[5].iono_std); + ck_assert_msg(check_msg->obs[5].lock == 15, + "incorrect value for obs[5].lock, expected 15, is %d", + check_msg->obs[5].lock); + ck_assert_msg(check_msg->obs[5].range_std == 3, + "incorrect value for obs[5].range_std, expected 3, is %d", + check_msg->obs[5].range_std); + ck_assert_msg(check_msg->obs[5].sid.code == 0, + "incorrect value for obs[5].sid.code, expected 0, is %d", + check_msg->obs[5].sid.code); + ck_assert_msg(check_msg->obs[5].sid.sat == 19, + "incorrect value for obs[5].sid.sat, expected 19, is %d", + check_msg->obs[5].sid.sat); + ck_assert_msg(check_msg->obs[5].tropo_std == 3, + "incorrect value for obs[5].tropo_std, expected 3, is %d", + check_msg->obs[5].tropo_std); + ck_assert_msg(check_msg->obs[6].L.f == 206, + "incorrect value for obs[6].L.f, expected 206, is %d", + check_msg->obs[6].L.f); + ck_assert_msg(check_msg->obs[6].L.i == 111507381, + "incorrect value for obs[6].L.i, expected 111507381, is %d", + check_msg->obs[6].L.i); + ck_assert_msg(check_msg->obs[6].P == 1060957521, + "incorrect value for obs[6].P, expected 1060957521, is %d", + check_msg->obs[6].P); + ck_assert_msg(check_msg->obs[6].flags == 3, + "incorrect value for obs[6].flags, expected 3, is %d", + check_msg->obs[6].flags); + ck_assert_msg(check_msg->obs[6].iono_std == 13, + "incorrect value for obs[6].iono_std, expected 13, is %d", + check_msg->obs[6].iono_std); + ck_assert_msg(check_msg->obs[6].lock == 15, + "incorrect value for obs[6].lock, expected 15, is %d", + check_msg->obs[6].lock); + ck_assert_msg(check_msg->obs[6].range_std == 3, + "incorrect value for obs[6].range_std, expected 3, is %d", + check_msg->obs[6].range_std); + ck_assert_msg(check_msg->obs[6].sid.code == 0, + "incorrect value for obs[6].sid.code, expected 0, is %d", + check_msg->obs[6].sid.code); + ck_assert_msg(check_msg->obs[6].sid.sat == 28, + "incorrect value for obs[6].sid.sat, expected 28, is %d", + check_msg->obs[6].sid.sat); + ck_assert_msg(check_msg->obs[6].tropo_std == 3, + "incorrect value for obs[6].tropo_std, expected 3, is %d", + check_msg->obs[6].tropo_std); + ck_assert_msg(check_msg->obs[7].L.f == 200, + "incorrect value for obs[7].L.f, expected 200, is %d", + check_msg->obs[7].L.f); + ck_assert_msg(check_msg->obs[7].L.i == 113614775, + "incorrect value for obs[7].L.i, expected 113614775, is %d", + check_msg->obs[7].L.i); + ck_assert_msg(check_msg->obs[7].P == 1081009286, + "incorrect value for obs[7].P, expected 1081009286, is %d", + check_msg->obs[7].P); + ck_assert_msg(check_msg->obs[7].flags == 3, + "incorrect value for obs[7].flags, expected 3, is %d", + check_msg->obs[7].flags); + ck_assert_msg(check_msg->obs[7].iono_std == 13, + "incorrect value for obs[7].iono_std, expected 13, is %d", + check_msg->obs[7].iono_std); + ck_assert_msg(check_msg->obs[7].lock == 15, + "incorrect value for obs[7].lock, expected 15, is %d", + check_msg->obs[7].lock); + ck_assert_msg(check_msg->obs[7].range_std == 3, + "incorrect value for obs[7].range_std, expected 3, is %d", + check_msg->obs[7].range_std); + ck_assert_msg(check_msg->obs[7].sid.code == 0, + "incorrect value for obs[7].sid.code, expected 0, is %d", + check_msg->obs[7].sid.code); + ck_assert_msg(check_msg->obs[7].sid.sat == 30, + "incorrect value for obs[7].sid.sat, expected 30, is %d", + check_msg->obs[7].sid.sat); + ck_assert_msg(check_msg->obs[7].tropo_std == 3, + "incorrect value for obs[7].tropo_std, expected 3, is %d", + check_msg->obs[7].tropo_std); + ck_assert_msg(check_msg->obs[8].L.f == 170, + "incorrect value for obs[8].L.f, expected 170, is %d", + check_msg->obs[8].L.f); + ck_assert_msg(check_msg->obs[8].L.i == 94728270, + "incorrect value for obs[8].L.i, expected 94728270, is %d", + check_msg->obs[8].L.i); + ck_assert_msg(check_msg->obs[8].P == 1156681781, + "incorrect value for obs[8].P, expected 1156681781, is %d", + check_msg->obs[8].P); + ck_assert_msg(check_msg->obs[8].flags == 3, + "incorrect value for obs[8].flags, expected 3, is %d", + check_msg->obs[8].flags); + ck_assert_msg(check_msg->obs[8].iono_std == 21, + "incorrect value for obs[8].iono_std, expected 21, is %d", + check_msg->obs[8].iono_std); + ck_assert_msg(check_msg->obs[8].lock == 15, + "incorrect value for obs[8].lock, expected 15, is %d", + check_msg->obs[8].lock); + ck_assert_msg(check_msg->obs[8].range_std == 7, + "incorrect value for obs[8].range_std, expected 7, is %d", + check_msg->obs[8].range_std); + ck_assert_msg(check_msg->obs[8].sid.code == 6, + "incorrect value for obs[8].sid.code, expected 6, is %d", + check_msg->obs[8].sid.code); + ck_assert_msg(check_msg->obs[8].sid.sat == 1, + "incorrect value for obs[8].sid.sat, expected 1, is %d", + check_msg->obs[8].sid.sat); + ck_assert_msg(check_msg->obs[8].tropo_std == 7, + "incorrect value for obs[8].tropo_std, expected 7, is %d", + check_msg->obs[8].tropo_std); + ck_assert_msg(check_msg->obs[9].L.f == 129, + "incorrect value for obs[9].L.f, expected 129, is %d", + check_msg->obs[9].L.f); + ck_assert_msg(check_msg->obs[9].L.i == 87130275, + "incorrect value for obs[9].L.i, expected 87130275, is %d", + check_msg->obs[9].L.i); + ck_assert_msg(check_msg->obs[9].P == 1063905531, + "incorrect value for obs[9].P, expected 1063905531, is %d", + check_msg->obs[9].P); + ck_assert_msg(check_msg->obs[9].flags == 3, + "incorrect value for obs[9].flags, expected 3, is %d", + check_msg->obs[9].flags); + ck_assert_msg(check_msg->obs[9].iono_std == 21, + "incorrect value for obs[9].iono_std, expected 21, is %d", + check_msg->obs[9].iono_std); + ck_assert_msg(check_msg->obs[9].lock == 15, + "incorrect value for obs[9].lock, expected 15, is %d", + check_msg->obs[9].lock); + ck_assert_msg(check_msg->obs[9].range_std == 3, + "incorrect value for obs[9].range_std, expected 3, is %d", + check_msg->obs[9].range_std); + ck_assert_msg(check_msg->obs[9].sid.code == 6, + "incorrect value for obs[9].sid.code, expected 6, is %d", + check_msg->obs[9].sid.code); + ck_assert_msg(check_msg->obs[9].sid.sat == 13, + "incorrect value for obs[9].sid.sat, expected 13, is %d", + check_msg->obs[9].sid.sat); + ck_assert_msg(check_msg->obs[9].tropo_std == 3, + "incorrect value for obs[9].tropo_std, expected 3, is %d", + check_msg->obs[9].tropo_std); + ck_assert_msg(check_msg->obs[10].L.f == 46, + "incorrect value for obs[10].L.f, expected 46, is %d", + check_msg->obs[10].L.f); + ck_assert_msg(check_msg->obs[10].L.i == 86253605, + "incorrect value for obs[10].L.i, expected 86253605, is %d", + check_msg->obs[10].L.i); + ck_assert_msg(check_msg->obs[10].P == 1053200752, + "incorrect value for obs[10].P, expected 1053200752, is %d", + check_msg->obs[10].P); + ck_assert_msg(check_msg->obs[10].flags == 3, + "incorrect value for obs[10].flags, expected 3, is %d", + check_msg->obs[10].flags); + ck_assert_msg(check_msg->obs[10].iono_std == 21, + "incorrect value for obs[10].iono_std, expected 21, is %d", + check_msg->obs[10].iono_std); + ck_assert_msg(check_msg->obs[10].lock == 15, + "incorrect value for obs[10].lock, expected 15, is %d", + check_msg->obs[10].lock); + ck_assert_msg(check_msg->obs[10].range_std == 3, + "incorrect value for obs[10].range_std, expected 3, is %d", + check_msg->obs[10].range_std); + ck_assert_msg(check_msg->obs[10].sid.code == 6, + "incorrect value for obs[10].sid.code, expected 6, is %d", + check_msg->obs[10].sid.code); + ck_assert_msg(check_msg->obs[10].sid.sat == 14, + "incorrect value for obs[10].sid.sat, expected 14, is %d", + check_msg->obs[10].sid.sat); + ck_assert_msg(check_msg->obs[10].tropo_std == 3, + "incorrect value for obs[10].tropo_std, expected 3, is %d", + check_msg->obs[10].tropo_std); + ck_assert_msg(check_msg->obs[11].L.f == 95, + "incorrect value for obs[11].L.f, expected 95, is %d", + check_msg->obs[11].L.f); + ck_assert_msg(check_msg->obs[11].L.i == 93155512, + "incorrect value for obs[11].L.i, expected 93155512, is %d", + check_msg->obs[11].L.i); + ck_assert_msg(check_msg->obs[11].P == 1137476774, + "incorrect value for obs[11].P, expected 1137476774, is %d", + check_msg->obs[11].P); + ck_assert_msg(check_msg->obs[11].flags == 3, + "incorrect value for obs[11].flags, expected 3, is %d", + check_msg->obs[11].flags); + ck_assert_msg(check_msg->obs[11].iono_std == 21, + "incorrect value for obs[11].iono_std, expected 21, is %d", + check_msg->obs[11].iono_std); + ck_assert_msg(check_msg->obs[11].lock == 15, + "incorrect value for obs[11].lock, expected 15, is %d", + check_msg->obs[11].lock); + ck_assert_msg(check_msg->obs[11].range_std == 5, + "incorrect value for obs[11].range_std, expected 5, is %d", + check_msg->obs[11].range_std); + ck_assert_msg(check_msg->obs[11].sid.code == 6, + "incorrect value for obs[11].sid.code, expected 6, is %d", + check_msg->obs[11].sid.code); + ck_assert_msg(check_msg->obs[11].sid.sat == 15, + "incorrect value for obs[11].sid.sat, expected 15, is %d", + check_msg->obs[11].sid.sat); + ck_assert_msg(check_msg->obs[11].tropo_std == 5, + "incorrect value for obs[11].tropo_std, expected 5, is %d", + check_msg->obs[11].tropo_std); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgOsr_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgOsr"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgOsr"); +Suite *legacy_auto_check_sbp_observation_MsgOsr_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_observation_MsgOsr"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgOsr"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgOsr); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_observation_MsgSvAzEl.c b/c/test/legacy/auto_check_sbp_observation_MsgSvAzEl.c index b5a5a32c8..79c417888 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgSvAzEl.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgSvAzEl.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvAzEl.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvAzEl.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgSvAzEl ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgSvAzEl) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgSvAzEl ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,29 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgSvAzEl ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x97, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x97, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x97, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x97, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,151,0,207,121,132,8,0,160,12,10,0,139,66,13,0,16,1,15,0,24,25,16,0,127,18,18,0,42,53,20,0,31,16,23,0,12,67,24,0,47,10,26,0,116,8,27,0,153,43,29,0,77,10,32,0,94,26,1,3,16,58,2,3,108,53,8,3,17,13,17,3,165,40,23,3,63,35,24,3,41,73,20,12,114,26,27,12,72,54,28,12,69,3,29,12,158,14,30,12,152,68,32,12,120,82,2,14,131,6,4,14,27,44,5,14,101,21,9,14,81,65,11,14,49,56,12,14,59,6,30,14,154,4,36,14,165,62,168,36, }; + u8 encoded_frame[] = { + 85, 151, 0, 207, 121, 132, 8, 0, 160, 12, 10, 0, 139, 66, 13, 0, + 16, 1, 15, 0, 24, 25, 16, 0, 127, 18, 18, 0, 42, 53, 20, 0, + 31, 16, 23, 0, 12, 67, 24, 0, 47, 10, 26, 0, 116, 8, 27, 0, + 153, 43, 29, 0, 77, 10, 32, 0, 94, 26, 1, 3, 16, 58, 2, 3, + 108, 53, 8, 3, 17, 13, 17, 3, 165, 40, 23, 3, 63, 35, 24, 3, + 41, 73, 20, 12, 114, 26, 27, 12, 72, 54, 28, 12, 69, 3, 29, 12, + 158, 14, 30, 12, 152, 68, 32, 12, 120, 82, 2, 14, 131, 6, 4, 14, + 27, 44, 5, 14, 101, 21, 9, 14, 81, 65, 11, 14, 49, 56, 12, 14, + 59, 6, 30, 14, 154, 4, 36, 14, 165, 62, 168, 36, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_sv_az_el_t* test_msg = ( msg_sv_az_el_t* )test_msg_storage; + msg_sv_az_el_t *test_msg = (msg_sv_az_el_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->azel) == 0) { // Cope with variable length arrays @@ -407,194 +416,465 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgSvAzEl ) test_msg->azel[32].el = 62; test_msg->azel[32].sid.code = 14; test_msg->azel[32].sid.sat = 36; - sbp_payload_send(&sbp_state, 0x97, 31183, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x97, 31183, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 31183, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 31183, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x97, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_sv_az_el_t* check_msg = ( msg_sv_az_el_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_sv_az_el_t *check_msg = (msg_sv_az_el_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->azel[0].az == 160, "incorrect value for azel[0].az, expected 160, is %d", check_msg->azel[0].az); - ck_assert_msg(check_msg->azel[0].el == 12, "incorrect value for azel[0].el, expected 12, is %d", check_msg->azel[0].el); - ck_assert_msg(check_msg->azel[0].sid.code == 0, "incorrect value for azel[0].sid.code, expected 0, is %d", check_msg->azel[0].sid.code); - ck_assert_msg(check_msg->azel[0].sid.sat == 8, "incorrect value for azel[0].sid.sat, expected 8, is %d", check_msg->azel[0].sid.sat); - ck_assert_msg(check_msg->azel[1].az == 139, "incorrect value for azel[1].az, expected 139, is %d", check_msg->azel[1].az); - ck_assert_msg(check_msg->azel[1].el == 66, "incorrect value for azel[1].el, expected 66, is %d", check_msg->azel[1].el); - ck_assert_msg(check_msg->azel[1].sid.code == 0, "incorrect value for azel[1].sid.code, expected 0, is %d", check_msg->azel[1].sid.code); - ck_assert_msg(check_msg->azel[1].sid.sat == 10, "incorrect value for azel[1].sid.sat, expected 10, is %d", check_msg->azel[1].sid.sat); - ck_assert_msg(check_msg->azel[2].az == 16, "incorrect value for azel[2].az, expected 16, is %d", check_msg->azel[2].az); - ck_assert_msg(check_msg->azel[2].el == 1, "incorrect value for azel[2].el, expected 1, is %d", check_msg->azel[2].el); - ck_assert_msg(check_msg->azel[2].sid.code == 0, "incorrect value for azel[2].sid.code, expected 0, is %d", check_msg->azel[2].sid.code); - ck_assert_msg(check_msg->azel[2].sid.sat == 13, "incorrect value for azel[2].sid.sat, expected 13, is %d", check_msg->azel[2].sid.sat); - ck_assert_msg(check_msg->azel[3].az == 24, "incorrect value for azel[3].az, expected 24, is %d", check_msg->azel[3].az); - ck_assert_msg(check_msg->azel[3].el == 25, "incorrect value for azel[3].el, expected 25, is %d", check_msg->azel[3].el); - ck_assert_msg(check_msg->azel[3].sid.code == 0, "incorrect value for azel[3].sid.code, expected 0, is %d", check_msg->azel[3].sid.code); - ck_assert_msg(check_msg->azel[3].sid.sat == 15, "incorrect value for azel[3].sid.sat, expected 15, is %d", check_msg->azel[3].sid.sat); - ck_assert_msg(check_msg->azel[4].az == 127, "incorrect value for azel[4].az, expected 127, is %d", check_msg->azel[4].az); - ck_assert_msg(check_msg->azel[4].el == 18, "incorrect value for azel[4].el, expected 18, is %d", check_msg->azel[4].el); - ck_assert_msg(check_msg->azel[4].sid.code == 0, "incorrect value for azel[4].sid.code, expected 0, is %d", check_msg->azel[4].sid.code); - ck_assert_msg(check_msg->azel[4].sid.sat == 16, "incorrect value for azel[4].sid.sat, expected 16, is %d", check_msg->azel[4].sid.sat); - ck_assert_msg(check_msg->azel[5].az == 42, "incorrect value for azel[5].az, expected 42, is %d", check_msg->azel[5].az); - ck_assert_msg(check_msg->azel[5].el == 53, "incorrect value for azel[5].el, expected 53, is %d", check_msg->azel[5].el); - ck_assert_msg(check_msg->azel[5].sid.code == 0, "incorrect value for azel[5].sid.code, expected 0, is %d", check_msg->azel[5].sid.code); - ck_assert_msg(check_msg->azel[5].sid.sat == 18, "incorrect value for azel[5].sid.sat, expected 18, is %d", check_msg->azel[5].sid.sat); - ck_assert_msg(check_msg->azel[6].az == 31, "incorrect value for azel[6].az, expected 31, is %d", check_msg->azel[6].az); - ck_assert_msg(check_msg->azel[6].el == 16, "incorrect value for azel[6].el, expected 16, is %d", check_msg->azel[6].el); - ck_assert_msg(check_msg->azel[6].sid.code == 0, "incorrect value for azel[6].sid.code, expected 0, is %d", check_msg->azel[6].sid.code); - ck_assert_msg(check_msg->azel[6].sid.sat == 20, "incorrect value for azel[6].sid.sat, expected 20, is %d", check_msg->azel[6].sid.sat); - ck_assert_msg(check_msg->azel[7].az == 12, "incorrect value for azel[7].az, expected 12, is %d", check_msg->azel[7].az); - ck_assert_msg(check_msg->azel[7].el == 67, "incorrect value for azel[7].el, expected 67, is %d", check_msg->azel[7].el); - ck_assert_msg(check_msg->azel[7].sid.code == 0, "incorrect value for azel[7].sid.code, expected 0, is %d", check_msg->azel[7].sid.code); - ck_assert_msg(check_msg->azel[7].sid.sat == 23, "incorrect value for azel[7].sid.sat, expected 23, is %d", check_msg->azel[7].sid.sat); - ck_assert_msg(check_msg->azel[8].az == 47, "incorrect value for azel[8].az, expected 47, is %d", check_msg->azel[8].az); - ck_assert_msg(check_msg->azel[8].el == 10, "incorrect value for azel[8].el, expected 10, is %d", check_msg->azel[8].el); - ck_assert_msg(check_msg->azel[8].sid.code == 0, "incorrect value for azel[8].sid.code, expected 0, is %d", check_msg->azel[8].sid.code); - ck_assert_msg(check_msg->azel[8].sid.sat == 24, "incorrect value for azel[8].sid.sat, expected 24, is %d", check_msg->azel[8].sid.sat); - ck_assert_msg(check_msg->azel[9].az == 116, "incorrect value for azel[9].az, expected 116, is %d", check_msg->azel[9].az); - ck_assert_msg(check_msg->azel[9].el == 8, "incorrect value for azel[9].el, expected 8, is %d", check_msg->azel[9].el); - ck_assert_msg(check_msg->azel[9].sid.code == 0, "incorrect value for azel[9].sid.code, expected 0, is %d", check_msg->azel[9].sid.code); - ck_assert_msg(check_msg->azel[9].sid.sat == 26, "incorrect value for azel[9].sid.sat, expected 26, is %d", check_msg->azel[9].sid.sat); - ck_assert_msg(check_msg->azel[10].az == 153, "incorrect value for azel[10].az, expected 153, is %d", check_msg->azel[10].az); - ck_assert_msg(check_msg->azel[10].el == 43, "incorrect value for azel[10].el, expected 43, is %d", check_msg->azel[10].el); - ck_assert_msg(check_msg->azel[10].sid.code == 0, "incorrect value for azel[10].sid.code, expected 0, is %d", check_msg->azel[10].sid.code); - ck_assert_msg(check_msg->azel[10].sid.sat == 27, "incorrect value for azel[10].sid.sat, expected 27, is %d", check_msg->azel[10].sid.sat); - ck_assert_msg(check_msg->azel[11].az == 77, "incorrect value for azel[11].az, expected 77, is %d", check_msg->azel[11].az); - ck_assert_msg(check_msg->azel[11].el == 10, "incorrect value for azel[11].el, expected 10, is %d", check_msg->azel[11].el); - ck_assert_msg(check_msg->azel[11].sid.code == 0, "incorrect value for azel[11].sid.code, expected 0, is %d", check_msg->azel[11].sid.code); - ck_assert_msg(check_msg->azel[11].sid.sat == 29, "incorrect value for azel[11].sid.sat, expected 29, is %d", check_msg->azel[11].sid.sat); - ck_assert_msg(check_msg->azel[12].az == 94, "incorrect value for azel[12].az, expected 94, is %d", check_msg->azel[12].az); - ck_assert_msg(check_msg->azel[12].el == 26, "incorrect value for azel[12].el, expected 26, is %d", check_msg->azel[12].el); - ck_assert_msg(check_msg->azel[12].sid.code == 0, "incorrect value for azel[12].sid.code, expected 0, is %d", check_msg->azel[12].sid.code); - ck_assert_msg(check_msg->azel[12].sid.sat == 32, "incorrect value for azel[12].sid.sat, expected 32, is %d", check_msg->azel[12].sid.sat); - ck_assert_msg(check_msg->azel[13].az == 16, "incorrect value for azel[13].az, expected 16, is %d", check_msg->azel[13].az); - ck_assert_msg(check_msg->azel[13].el == 58, "incorrect value for azel[13].el, expected 58, is %d", check_msg->azel[13].el); - ck_assert_msg(check_msg->azel[13].sid.code == 3, "incorrect value for azel[13].sid.code, expected 3, is %d", check_msg->azel[13].sid.code); - ck_assert_msg(check_msg->azel[13].sid.sat == 1, "incorrect value for azel[13].sid.sat, expected 1, is %d", check_msg->azel[13].sid.sat); - ck_assert_msg(check_msg->azel[14].az == 108, "incorrect value for azel[14].az, expected 108, is %d", check_msg->azel[14].az); - ck_assert_msg(check_msg->azel[14].el == 53, "incorrect value for azel[14].el, expected 53, is %d", check_msg->azel[14].el); - ck_assert_msg(check_msg->azel[14].sid.code == 3, "incorrect value for azel[14].sid.code, expected 3, is %d", check_msg->azel[14].sid.code); - ck_assert_msg(check_msg->azel[14].sid.sat == 2, "incorrect value for azel[14].sid.sat, expected 2, is %d", check_msg->azel[14].sid.sat); - ck_assert_msg(check_msg->azel[15].az == 17, "incorrect value for azel[15].az, expected 17, is %d", check_msg->azel[15].az); - ck_assert_msg(check_msg->azel[15].el == 13, "incorrect value for azel[15].el, expected 13, is %d", check_msg->azel[15].el); - ck_assert_msg(check_msg->azel[15].sid.code == 3, "incorrect value for azel[15].sid.code, expected 3, is %d", check_msg->azel[15].sid.code); - ck_assert_msg(check_msg->azel[15].sid.sat == 8, "incorrect value for azel[15].sid.sat, expected 8, is %d", check_msg->azel[15].sid.sat); - ck_assert_msg(check_msg->azel[16].az == 165, "incorrect value for azel[16].az, expected 165, is %d", check_msg->azel[16].az); - ck_assert_msg(check_msg->azel[16].el == 40, "incorrect value for azel[16].el, expected 40, is %d", check_msg->azel[16].el); - ck_assert_msg(check_msg->azel[16].sid.code == 3, "incorrect value for azel[16].sid.code, expected 3, is %d", check_msg->azel[16].sid.code); - ck_assert_msg(check_msg->azel[16].sid.sat == 17, "incorrect value for azel[16].sid.sat, expected 17, is %d", check_msg->azel[16].sid.sat); - ck_assert_msg(check_msg->azel[17].az == 63, "incorrect value for azel[17].az, expected 63, is %d", check_msg->azel[17].az); - ck_assert_msg(check_msg->azel[17].el == 35, "incorrect value for azel[17].el, expected 35, is %d", check_msg->azel[17].el); - ck_assert_msg(check_msg->azel[17].sid.code == 3, "incorrect value for azel[17].sid.code, expected 3, is %d", check_msg->azel[17].sid.code); - ck_assert_msg(check_msg->azel[17].sid.sat == 23, "incorrect value for azel[17].sid.sat, expected 23, is %d", check_msg->azel[17].sid.sat); - ck_assert_msg(check_msg->azel[18].az == 41, "incorrect value for azel[18].az, expected 41, is %d", check_msg->azel[18].az); - ck_assert_msg(check_msg->azel[18].el == 73, "incorrect value for azel[18].el, expected 73, is %d", check_msg->azel[18].el); - ck_assert_msg(check_msg->azel[18].sid.code == 3, "incorrect value for azel[18].sid.code, expected 3, is %d", check_msg->azel[18].sid.code); - ck_assert_msg(check_msg->azel[18].sid.sat == 24, "incorrect value for azel[18].sid.sat, expected 24, is %d", check_msg->azel[18].sid.sat); - ck_assert_msg(check_msg->azel[19].az == 114, "incorrect value for azel[19].az, expected 114, is %d", check_msg->azel[19].az); - ck_assert_msg(check_msg->azel[19].el == 26, "incorrect value for azel[19].el, expected 26, is %d", check_msg->azel[19].el); - ck_assert_msg(check_msg->azel[19].sid.code == 12, "incorrect value for azel[19].sid.code, expected 12, is %d", check_msg->azel[19].sid.code); - ck_assert_msg(check_msg->azel[19].sid.sat == 20, "incorrect value for azel[19].sid.sat, expected 20, is %d", check_msg->azel[19].sid.sat); - ck_assert_msg(check_msg->azel[20].az == 72, "incorrect value for azel[20].az, expected 72, is %d", check_msg->azel[20].az); - ck_assert_msg(check_msg->azel[20].el == 54, "incorrect value for azel[20].el, expected 54, is %d", check_msg->azel[20].el); - ck_assert_msg(check_msg->azel[20].sid.code == 12, "incorrect value for azel[20].sid.code, expected 12, is %d", check_msg->azel[20].sid.code); - ck_assert_msg(check_msg->azel[20].sid.sat == 27, "incorrect value for azel[20].sid.sat, expected 27, is %d", check_msg->azel[20].sid.sat); - ck_assert_msg(check_msg->azel[21].az == 69, "incorrect value for azel[21].az, expected 69, is %d", check_msg->azel[21].az); - ck_assert_msg(check_msg->azel[21].el == 3, "incorrect value for azel[21].el, expected 3, is %d", check_msg->azel[21].el); - ck_assert_msg(check_msg->azel[21].sid.code == 12, "incorrect value for azel[21].sid.code, expected 12, is %d", check_msg->azel[21].sid.code); - ck_assert_msg(check_msg->azel[21].sid.sat == 28, "incorrect value for azel[21].sid.sat, expected 28, is %d", check_msg->azel[21].sid.sat); - ck_assert_msg(check_msg->azel[22].az == 158, "incorrect value for azel[22].az, expected 158, is %d", check_msg->azel[22].az); - ck_assert_msg(check_msg->azel[22].el == 14, "incorrect value for azel[22].el, expected 14, is %d", check_msg->azel[22].el); - ck_assert_msg(check_msg->azel[22].sid.code == 12, "incorrect value for azel[22].sid.code, expected 12, is %d", check_msg->azel[22].sid.code); - ck_assert_msg(check_msg->azel[22].sid.sat == 29, "incorrect value for azel[22].sid.sat, expected 29, is %d", check_msg->azel[22].sid.sat); - ck_assert_msg(check_msg->azel[23].az == 152, "incorrect value for azel[23].az, expected 152, is %d", check_msg->azel[23].az); - ck_assert_msg(check_msg->azel[23].el == 68, "incorrect value for azel[23].el, expected 68, is %d", check_msg->azel[23].el); - ck_assert_msg(check_msg->azel[23].sid.code == 12, "incorrect value for azel[23].sid.code, expected 12, is %d", check_msg->azel[23].sid.code); - ck_assert_msg(check_msg->azel[23].sid.sat == 30, "incorrect value for azel[23].sid.sat, expected 30, is %d", check_msg->azel[23].sid.sat); - ck_assert_msg(check_msg->azel[24].az == 120, "incorrect value for azel[24].az, expected 120, is %d", check_msg->azel[24].az); - ck_assert_msg(check_msg->azel[24].el == 82, "incorrect value for azel[24].el, expected 82, is %d", check_msg->azel[24].el); - ck_assert_msg(check_msg->azel[24].sid.code == 12, "incorrect value for azel[24].sid.code, expected 12, is %d", check_msg->azel[24].sid.code); - ck_assert_msg(check_msg->azel[24].sid.sat == 32, "incorrect value for azel[24].sid.sat, expected 32, is %d", check_msg->azel[24].sid.sat); - ck_assert_msg(check_msg->azel[25].az == 131, "incorrect value for azel[25].az, expected 131, is %d", check_msg->azel[25].az); - ck_assert_msg(check_msg->azel[25].el == 6, "incorrect value for azel[25].el, expected 6, is %d", check_msg->azel[25].el); - ck_assert_msg(check_msg->azel[25].sid.code == 14, "incorrect value for azel[25].sid.code, expected 14, is %d", check_msg->azel[25].sid.code); - ck_assert_msg(check_msg->azel[25].sid.sat == 2, "incorrect value for azel[25].sid.sat, expected 2, is %d", check_msg->azel[25].sid.sat); - ck_assert_msg(check_msg->azel[26].az == 27, "incorrect value for azel[26].az, expected 27, is %d", check_msg->azel[26].az); - ck_assert_msg(check_msg->azel[26].el == 44, "incorrect value for azel[26].el, expected 44, is %d", check_msg->azel[26].el); - ck_assert_msg(check_msg->azel[26].sid.code == 14, "incorrect value for azel[26].sid.code, expected 14, is %d", check_msg->azel[26].sid.code); - ck_assert_msg(check_msg->azel[26].sid.sat == 4, "incorrect value for azel[26].sid.sat, expected 4, is %d", check_msg->azel[26].sid.sat); - ck_assert_msg(check_msg->azel[27].az == 101, "incorrect value for azel[27].az, expected 101, is %d", check_msg->azel[27].az); - ck_assert_msg(check_msg->azel[27].el == 21, "incorrect value for azel[27].el, expected 21, is %d", check_msg->azel[27].el); - ck_assert_msg(check_msg->azel[27].sid.code == 14, "incorrect value for azel[27].sid.code, expected 14, is %d", check_msg->azel[27].sid.code); - ck_assert_msg(check_msg->azel[27].sid.sat == 5, "incorrect value for azel[27].sid.sat, expected 5, is %d", check_msg->azel[27].sid.sat); - ck_assert_msg(check_msg->azel[28].az == 81, "incorrect value for azel[28].az, expected 81, is %d", check_msg->azel[28].az); - ck_assert_msg(check_msg->azel[28].el == 65, "incorrect value for azel[28].el, expected 65, is %d", check_msg->azel[28].el); - ck_assert_msg(check_msg->azel[28].sid.code == 14, "incorrect value for azel[28].sid.code, expected 14, is %d", check_msg->azel[28].sid.code); - ck_assert_msg(check_msg->azel[28].sid.sat == 9, "incorrect value for azel[28].sid.sat, expected 9, is %d", check_msg->azel[28].sid.sat); - ck_assert_msg(check_msg->azel[29].az == 49, "incorrect value for azel[29].az, expected 49, is %d", check_msg->azel[29].az); - ck_assert_msg(check_msg->azel[29].el == 56, "incorrect value for azel[29].el, expected 56, is %d", check_msg->azel[29].el); - ck_assert_msg(check_msg->azel[29].sid.code == 14, "incorrect value for azel[29].sid.code, expected 14, is %d", check_msg->azel[29].sid.code); - ck_assert_msg(check_msg->azel[29].sid.sat == 11, "incorrect value for azel[29].sid.sat, expected 11, is %d", check_msg->azel[29].sid.sat); - ck_assert_msg(check_msg->azel[30].az == 59, "incorrect value for azel[30].az, expected 59, is %d", check_msg->azel[30].az); - ck_assert_msg(check_msg->azel[30].el == 6, "incorrect value for azel[30].el, expected 6, is %d", check_msg->azel[30].el); - ck_assert_msg(check_msg->azel[30].sid.code == 14, "incorrect value for azel[30].sid.code, expected 14, is %d", check_msg->azel[30].sid.code); - ck_assert_msg(check_msg->azel[30].sid.sat == 12, "incorrect value for azel[30].sid.sat, expected 12, is %d", check_msg->azel[30].sid.sat); - ck_assert_msg(check_msg->azel[31].az == 154, "incorrect value for azel[31].az, expected 154, is %d", check_msg->azel[31].az); - ck_assert_msg(check_msg->azel[31].el == 4, "incorrect value for azel[31].el, expected 4, is %d", check_msg->azel[31].el); - ck_assert_msg(check_msg->azel[31].sid.code == 14, "incorrect value for azel[31].sid.code, expected 14, is %d", check_msg->azel[31].sid.code); - ck_assert_msg(check_msg->azel[31].sid.sat == 30, "incorrect value for azel[31].sid.sat, expected 30, is %d", check_msg->azel[31].sid.sat); - ck_assert_msg(check_msg->azel[32].az == 165, "incorrect value for azel[32].az, expected 165, is %d", check_msg->azel[32].az); - ck_assert_msg(check_msg->azel[32].el == 62, "incorrect value for azel[32].el, expected 62, is %d", check_msg->azel[32].el); - ck_assert_msg(check_msg->azel[32].sid.code == 14, "incorrect value for azel[32].sid.code, expected 14, is %d", check_msg->azel[32].sid.code); - ck_assert_msg(check_msg->azel[32].sid.sat == 36, "incorrect value for azel[32].sid.sat, expected 36, is %d", check_msg->azel[32].sid.sat); + ck_assert_msg(check_msg->azel[0].az == 160, + "incorrect value for azel[0].az, expected 160, is %d", + check_msg->azel[0].az); + ck_assert_msg(check_msg->azel[0].el == 12, + "incorrect value for azel[0].el, expected 12, is %d", + check_msg->azel[0].el); + ck_assert_msg(check_msg->azel[0].sid.code == 0, + "incorrect value for azel[0].sid.code, expected 0, is %d", + check_msg->azel[0].sid.code); + ck_assert_msg(check_msg->azel[0].sid.sat == 8, + "incorrect value for azel[0].sid.sat, expected 8, is %d", + check_msg->azel[0].sid.sat); + ck_assert_msg(check_msg->azel[1].az == 139, + "incorrect value for azel[1].az, expected 139, is %d", + check_msg->azel[1].az); + ck_assert_msg(check_msg->azel[1].el == 66, + "incorrect value for azel[1].el, expected 66, is %d", + check_msg->azel[1].el); + ck_assert_msg(check_msg->azel[1].sid.code == 0, + "incorrect value for azel[1].sid.code, expected 0, is %d", + check_msg->azel[1].sid.code); + ck_assert_msg(check_msg->azel[1].sid.sat == 10, + "incorrect value for azel[1].sid.sat, expected 10, is %d", + check_msg->azel[1].sid.sat); + ck_assert_msg(check_msg->azel[2].az == 16, + "incorrect value for azel[2].az, expected 16, is %d", + check_msg->azel[2].az); + ck_assert_msg(check_msg->azel[2].el == 1, + "incorrect value for azel[2].el, expected 1, is %d", + check_msg->azel[2].el); + ck_assert_msg(check_msg->azel[2].sid.code == 0, + "incorrect value for azel[2].sid.code, expected 0, is %d", + check_msg->azel[2].sid.code); + ck_assert_msg(check_msg->azel[2].sid.sat == 13, + "incorrect value for azel[2].sid.sat, expected 13, is %d", + check_msg->azel[2].sid.sat); + ck_assert_msg(check_msg->azel[3].az == 24, + "incorrect value for azel[3].az, expected 24, is %d", + check_msg->azel[3].az); + ck_assert_msg(check_msg->azel[3].el == 25, + "incorrect value for azel[3].el, expected 25, is %d", + check_msg->azel[3].el); + ck_assert_msg(check_msg->azel[3].sid.code == 0, + "incorrect value for azel[3].sid.code, expected 0, is %d", + check_msg->azel[3].sid.code); + ck_assert_msg(check_msg->azel[3].sid.sat == 15, + "incorrect value for azel[3].sid.sat, expected 15, is %d", + check_msg->azel[3].sid.sat); + ck_assert_msg(check_msg->azel[4].az == 127, + "incorrect value for azel[4].az, expected 127, is %d", + check_msg->azel[4].az); + ck_assert_msg(check_msg->azel[4].el == 18, + "incorrect value for azel[4].el, expected 18, is %d", + check_msg->azel[4].el); + ck_assert_msg(check_msg->azel[4].sid.code == 0, + "incorrect value for azel[4].sid.code, expected 0, is %d", + check_msg->azel[4].sid.code); + ck_assert_msg(check_msg->azel[4].sid.sat == 16, + "incorrect value for azel[4].sid.sat, expected 16, is %d", + check_msg->azel[4].sid.sat); + ck_assert_msg(check_msg->azel[5].az == 42, + "incorrect value for azel[5].az, expected 42, is %d", + check_msg->azel[5].az); + ck_assert_msg(check_msg->azel[5].el == 53, + "incorrect value for azel[5].el, expected 53, is %d", + check_msg->azel[5].el); + ck_assert_msg(check_msg->azel[5].sid.code == 0, + "incorrect value for azel[5].sid.code, expected 0, is %d", + check_msg->azel[5].sid.code); + ck_assert_msg(check_msg->azel[5].sid.sat == 18, + "incorrect value for azel[5].sid.sat, expected 18, is %d", + check_msg->azel[5].sid.sat); + ck_assert_msg(check_msg->azel[6].az == 31, + "incorrect value for azel[6].az, expected 31, is %d", + check_msg->azel[6].az); + ck_assert_msg(check_msg->azel[6].el == 16, + "incorrect value for azel[6].el, expected 16, is %d", + check_msg->azel[6].el); + ck_assert_msg(check_msg->azel[6].sid.code == 0, + "incorrect value for azel[6].sid.code, expected 0, is %d", + check_msg->azel[6].sid.code); + ck_assert_msg(check_msg->azel[6].sid.sat == 20, + "incorrect value for azel[6].sid.sat, expected 20, is %d", + check_msg->azel[6].sid.sat); + ck_assert_msg(check_msg->azel[7].az == 12, + "incorrect value for azel[7].az, expected 12, is %d", + check_msg->azel[7].az); + ck_assert_msg(check_msg->azel[7].el == 67, + "incorrect value for azel[7].el, expected 67, is %d", + check_msg->azel[7].el); + ck_assert_msg(check_msg->azel[7].sid.code == 0, + "incorrect value for azel[7].sid.code, expected 0, is %d", + check_msg->azel[7].sid.code); + ck_assert_msg(check_msg->azel[7].sid.sat == 23, + "incorrect value for azel[7].sid.sat, expected 23, is %d", + check_msg->azel[7].sid.sat); + ck_assert_msg(check_msg->azel[8].az == 47, + "incorrect value for azel[8].az, expected 47, is %d", + check_msg->azel[8].az); + ck_assert_msg(check_msg->azel[8].el == 10, + "incorrect value for azel[8].el, expected 10, is %d", + check_msg->azel[8].el); + ck_assert_msg(check_msg->azel[8].sid.code == 0, + "incorrect value for azel[8].sid.code, expected 0, is %d", + check_msg->azel[8].sid.code); + ck_assert_msg(check_msg->azel[8].sid.sat == 24, + "incorrect value for azel[8].sid.sat, expected 24, is %d", + check_msg->azel[8].sid.sat); + ck_assert_msg(check_msg->azel[9].az == 116, + "incorrect value for azel[9].az, expected 116, is %d", + check_msg->azel[9].az); + ck_assert_msg(check_msg->azel[9].el == 8, + "incorrect value for azel[9].el, expected 8, is %d", + check_msg->azel[9].el); + ck_assert_msg(check_msg->azel[9].sid.code == 0, + "incorrect value for azel[9].sid.code, expected 0, is %d", + check_msg->azel[9].sid.code); + ck_assert_msg(check_msg->azel[9].sid.sat == 26, + "incorrect value for azel[9].sid.sat, expected 26, is %d", + check_msg->azel[9].sid.sat); + ck_assert_msg(check_msg->azel[10].az == 153, + "incorrect value for azel[10].az, expected 153, is %d", + check_msg->azel[10].az); + ck_assert_msg(check_msg->azel[10].el == 43, + "incorrect value for azel[10].el, expected 43, is %d", + check_msg->azel[10].el); + ck_assert_msg(check_msg->azel[10].sid.code == 0, + "incorrect value for azel[10].sid.code, expected 0, is %d", + check_msg->azel[10].sid.code); + ck_assert_msg(check_msg->azel[10].sid.sat == 27, + "incorrect value for azel[10].sid.sat, expected 27, is %d", + check_msg->azel[10].sid.sat); + ck_assert_msg(check_msg->azel[11].az == 77, + "incorrect value for azel[11].az, expected 77, is %d", + check_msg->azel[11].az); + ck_assert_msg(check_msg->azel[11].el == 10, + "incorrect value for azel[11].el, expected 10, is %d", + check_msg->azel[11].el); + ck_assert_msg(check_msg->azel[11].sid.code == 0, + "incorrect value for azel[11].sid.code, expected 0, is %d", + check_msg->azel[11].sid.code); + ck_assert_msg(check_msg->azel[11].sid.sat == 29, + "incorrect value for azel[11].sid.sat, expected 29, is %d", + check_msg->azel[11].sid.sat); + ck_assert_msg(check_msg->azel[12].az == 94, + "incorrect value for azel[12].az, expected 94, is %d", + check_msg->azel[12].az); + ck_assert_msg(check_msg->azel[12].el == 26, + "incorrect value for azel[12].el, expected 26, is %d", + check_msg->azel[12].el); + ck_assert_msg(check_msg->azel[12].sid.code == 0, + "incorrect value for azel[12].sid.code, expected 0, is %d", + check_msg->azel[12].sid.code); + ck_assert_msg(check_msg->azel[12].sid.sat == 32, + "incorrect value for azel[12].sid.sat, expected 32, is %d", + check_msg->azel[12].sid.sat); + ck_assert_msg(check_msg->azel[13].az == 16, + "incorrect value for azel[13].az, expected 16, is %d", + check_msg->azel[13].az); + ck_assert_msg(check_msg->azel[13].el == 58, + "incorrect value for azel[13].el, expected 58, is %d", + check_msg->azel[13].el); + ck_assert_msg(check_msg->azel[13].sid.code == 3, + "incorrect value for azel[13].sid.code, expected 3, is %d", + check_msg->azel[13].sid.code); + ck_assert_msg(check_msg->azel[13].sid.sat == 1, + "incorrect value for azel[13].sid.sat, expected 1, is %d", + check_msg->azel[13].sid.sat); + ck_assert_msg(check_msg->azel[14].az == 108, + "incorrect value for azel[14].az, expected 108, is %d", + check_msg->azel[14].az); + ck_assert_msg(check_msg->azel[14].el == 53, + "incorrect value for azel[14].el, expected 53, is %d", + check_msg->azel[14].el); + ck_assert_msg(check_msg->azel[14].sid.code == 3, + "incorrect value for azel[14].sid.code, expected 3, is %d", + check_msg->azel[14].sid.code); + ck_assert_msg(check_msg->azel[14].sid.sat == 2, + "incorrect value for azel[14].sid.sat, expected 2, is %d", + check_msg->azel[14].sid.sat); + ck_assert_msg(check_msg->azel[15].az == 17, + "incorrect value for azel[15].az, expected 17, is %d", + check_msg->azel[15].az); + ck_assert_msg(check_msg->azel[15].el == 13, + "incorrect value for azel[15].el, expected 13, is %d", + check_msg->azel[15].el); + ck_assert_msg(check_msg->azel[15].sid.code == 3, + "incorrect value for azel[15].sid.code, expected 3, is %d", + check_msg->azel[15].sid.code); + ck_assert_msg(check_msg->azel[15].sid.sat == 8, + "incorrect value for azel[15].sid.sat, expected 8, is %d", + check_msg->azel[15].sid.sat); + ck_assert_msg(check_msg->azel[16].az == 165, + "incorrect value for azel[16].az, expected 165, is %d", + check_msg->azel[16].az); + ck_assert_msg(check_msg->azel[16].el == 40, + "incorrect value for azel[16].el, expected 40, is %d", + check_msg->azel[16].el); + ck_assert_msg(check_msg->azel[16].sid.code == 3, + "incorrect value for azel[16].sid.code, expected 3, is %d", + check_msg->azel[16].sid.code); + ck_assert_msg(check_msg->azel[16].sid.sat == 17, + "incorrect value for azel[16].sid.sat, expected 17, is %d", + check_msg->azel[16].sid.sat); + ck_assert_msg(check_msg->azel[17].az == 63, + "incorrect value for azel[17].az, expected 63, is %d", + check_msg->azel[17].az); + ck_assert_msg(check_msg->azel[17].el == 35, + "incorrect value for azel[17].el, expected 35, is %d", + check_msg->azel[17].el); + ck_assert_msg(check_msg->azel[17].sid.code == 3, + "incorrect value for azel[17].sid.code, expected 3, is %d", + check_msg->azel[17].sid.code); + ck_assert_msg(check_msg->azel[17].sid.sat == 23, + "incorrect value for azel[17].sid.sat, expected 23, is %d", + check_msg->azel[17].sid.sat); + ck_assert_msg(check_msg->azel[18].az == 41, + "incorrect value for azel[18].az, expected 41, is %d", + check_msg->azel[18].az); + ck_assert_msg(check_msg->azel[18].el == 73, + "incorrect value for azel[18].el, expected 73, is %d", + check_msg->azel[18].el); + ck_assert_msg(check_msg->azel[18].sid.code == 3, + "incorrect value for azel[18].sid.code, expected 3, is %d", + check_msg->azel[18].sid.code); + ck_assert_msg(check_msg->azel[18].sid.sat == 24, + "incorrect value for azel[18].sid.sat, expected 24, is %d", + check_msg->azel[18].sid.sat); + ck_assert_msg(check_msg->azel[19].az == 114, + "incorrect value for azel[19].az, expected 114, is %d", + check_msg->azel[19].az); + ck_assert_msg(check_msg->azel[19].el == 26, + "incorrect value for azel[19].el, expected 26, is %d", + check_msg->azel[19].el); + ck_assert_msg(check_msg->azel[19].sid.code == 12, + "incorrect value for azel[19].sid.code, expected 12, is %d", + check_msg->azel[19].sid.code); + ck_assert_msg(check_msg->azel[19].sid.sat == 20, + "incorrect value for azel[19].sid.sat, expected 20, is %d", + check_msg->azel[19].sid.sat); + ck_assert_msg(check_msg->azel[20].az == 72, + "incorrect value for azel[20].az, expected 72, is %d", + check_msg->azel[20].az); + ck_assert_msg(check_msg->azel[20].el == 54, + "incorrect value for azel[20].el, expected 54, is %d", + check_msg->azel[20].el); + ck_assert_msg(check_msg->azel[20].sid.code == 12, + "incorrect value for azel[20].sid.code, expected 12, is %d", + check_msg->azel[20].sid.code); + ck_assert_msg(check_msg->azel[20].sid.sat == 27, + "incorrect value for azel[20].sid.sat, expected 27, is %d", + check_msg->azel[20].sid.sat); + ck_assert_msg(check_msg->azel[21].az == 69, + "incorrect value for azel[21].az, expected 69, is %d", + check_msg->azel[21].az); + ck_assert_msg(check_msg->azel[21].el == 3, + "incorrect value for azel[21].el, expected 3, is %d", + check_msg->azel[21].el); + ck_assert_msg(check_msg->azel[21].sid.code == 12, + "incorrect value for azel[21].sid.code, expected 12, is %d", + check_msg->azel[21].sid.code); + ck_assert_msg(check_msg->azel[21].sid.sat == 28, + "incorrect value for azel[21].sid.sat, expected 28, is %d", + check_msg->azel[21].sid.sat); + ck_assert_msg(check_msg->azel[22].az == 158, + "incorrect value for azel[22].az, expected 158, is %d", + check_msg->azel[22].az); + ck_assert_msg(check_msg->azel[22].el == 14, + "incorrect value for azel[22].el, expected 14, is %d", + check_msg->azel[22].el); + ck_assert_msg(check_msg->azel[22].sid.code == 12, + "incorrect value for azel[22].sid.code, expected 12, is %d", + check_msg->azel[22].sid.code); + ck_assert_msg(check_msg->azel[22].sid.sat == 29, + "incorrect value for azel[22].sid.sat, expected 29, is %d", + check_msg->azel[22].sid.sat); + ck_assert_msg(check_msg->azel[23].az == 152, + "incorrect value for azel[23].az, expected 152, is %d", + check_msg->azel[23].az); + ck_assert_msg(check_msg->azel[23].el == 68, + "incorrect value for azel[23].el, expected 68, is %d", + check_msg->azel[23].el); + ck_assert_msg(check_msg->azel[23].sid.code == 12, + "incorrect value for azel[23].sid.code, expected 12, is %d", + check_msg->azel[23].sid.code); + ck_assert_msg(check_msg->azel[23].sid.sat == 30, + "incorrect value for azel[23].sid.sat, expected 30, is %d", + check_msg->azel[23].sid.sat); + ck_assert_msg(check_msg->azel[24].az == 120, + "incorrect value for azel[24].az, expected 120, is %d", + check_msg->azel[24].az); + ck_assert_msg(check_msg->azel[24].el == 82, + "incorrect value for azel[24].el, expected 82, is %d", + check_msg->azel[24].el); + ck_assert_msg(check_msg->azel[24].sid.code == 12, + "incorrect value for azel[24].sid.code, expected 12, is %d", + check_msg->azel[24].sid.code); + ck_assert_msg(check_msg->azel[24].sid.sat == 32, + "incorrect value for azel[24].sid.sat, expected 32, is %d", + check_msg->azel[24].sid.sat); + ck_assert_msg(check_msg->azel[25].az == 131, + "incorrect value for azel[25].az, expected 131, is %d", + check_msg->azel[25].az); + ck_assert_msg(check_msg->azel[25].el == 6, + "incorrect value for azel[25].el, expected 6, is %d", + check_msg->azel[25].el); + ck_assert_msg(check_msg->azel[25].sid.code == 14, + "incorrect value for azel[25].sid.code, expected 14, is %d", + check_msg->azel[25].sid.code); + ck_assert_msg(check_msg->azel[25].sid.sat == 2, + "incorrect value for azel[25].sid.sat, expected 2, is %d", + check_msg->azel[25].sid.sat); + ck_assert_msg(check_msg->azel[26].az == 27, + "incorrect value for azel[26].az, expected 27, is %d", + check_msg->azel[26].az); + ck_assert_msg(check_msg->azel[26].el == 44, + "incorrect value for azel[26].el, expected 44, is %d", + check_msg->azel[26].el); + ck_assert_msg(check_msg->azel[26].sid.code == 14, + "incorrect value for azel[26].sid.code, expected 14, is %d", + check_msg->azel[26].sid.code); + ck_assert_msg(check_msg->azel[26].sid.sat == 4, + "incorrect value for azel[26].sid.sat, expected 4, is %d", + check_msg->azel[26].sid.sat); + ck_assert_msg(check_msg->azel[27].az == 101, + "incorrect value for azel[27].az, expected 101, is %d", + check_msg->azel[27].az); + ck_assert_msg(check_msg->azel[27].el == 21, + "incorrect value for azel[27].el, expected 21, is %d", + check_msg->azel[27].el); + ck_assert_msg(check_msg->azel[27].sid.code == 14, + "incorrect value for azel[27].sid.code, expected 14, is %d", + check_msg->azel[27].sid.code); + ck_assert_msg(check_msg->azel[27].sid.sat == 5, + "incorrect value for azel[27].sid.sat, expected 5, is %d", + check_msg->azel[27].sid.sat); + ck_assert_msg(check_msg->azel[28].az == 81, + "incorrect value for azel[28].az, expected 81, is %d", + check_msg->azel[28].az); + ck_assert_msg(check_msg->azel[28].el == 65, + "incorrect value for azel[28].el, expected 65, is %d", + check_msg->azel[28].el); + ck_assert_msg(check_msg->azel[28].sid.code == 14, + "incorrect value for azel[28].sid.code, expected 14, is %d", + check_msg->azel[28].sid.code); + ck_assert_msg(check_msg->azel[28].sid.sat == 9, + "incorrect value for azel[28].sid.sat, expected 9, is %d", + check_msg->azel[28].sid.sat); + ck_assert_msg(check_msg->azel[29].az == 49, + "incorrect value for azel[29].az, expected 49, is %d", + check_msg->azel[29].az); + ck_assert_msg(check_msg->azel[29].el == 56, + "incorrect value for azel[29].el, expected 56, is %d", + check_msg->azel[29].el); + ck_assert_msg(check_msg->azel[29].sid.code == 14, + "incorrect value for azel[29].sid.code, expected 14, is %d", + check_msg->azel[29].sid.code); + ck_assert_msg(check_msg->azel[29].sid.sat == 11, + "incorrect value for azel[29].sid.sat, expected 11, is %d", + check_msg->azel[29].sid.sat); + ck_assert_msg(check_msg->azel[30].az == 59, + "incorrect value for azel[30].az, expected 59, is %d", + check_msg->azel[30].az); + ck_assert_msg(check_msg->azel[30].el == 6, + "incorrect value for azel[30].el, expected 6, is %d", + check_msg->azel[30].el); + ck_assert_msg(check_msg->azel[30].sid.code == 14, + "incorrect value for azel[30].sid.code, expected 14, is %d", + check_msg->azel[30].sid.code); + ck_assert_msg(check_msg->azel[30].sid.sat == 12, + "incorrect value for azel[30].sid.sat, expected 12, is %d", + check_msg->azel[30].sid.sat); + ck_assert_msg(check_msg->azel[31].az == 154, + "incorrect value for azel[31].az, expected 154, is %d", + check_msg->azel[31].az); + ck_assert_msg(check_msg->azel[31].el == 4, + "incorrect value for azel[31].el, expected 4, is %d", + check_msg->azel[31].el); + ck_assert_msg(check_msg->azel[31].sid.code == 14, + "incorrect value for azel[31].sid.code, expected 14, is %d", + check_msg->azel[31].sid.code); + ck_assert_msg(check_msg->azel[31].sid.sat == 30, + "incorrect value for azel[31].sid.sat, expected 30, is %d", + check_msg->azel[31].sid.sat); + ck_assert_msg(check_msg->azel[32].az == 165, + "incorrect value for azel[32].az, expected 165, is %d", + check_msg->azel[32].az); + ck_assert_msg(check_msg->azel[32].el == 62, + "incorrect value for azel[32].el, expected 62, is %d", + check_msg->azel[32].el); + ck_assert_msg(check_msg->azel[32].sid.code == 14, + "incorrect value for azel[32].sid.code, expected 14, is %d", + check_msg->azel[32].sid.code); + ck_assert_msg(check_msg->azel[32].sid.sat == 36, + "incorrect value for azel[32].sid.sat, expected 36, is %d", + check_msg->azel[32].sid.sat); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgSvAzEl_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgSvAzEl"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgSvAzEl"); +Suite *legacy_auto_check_sbp_observation_MsgSvAzEl_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_observation_MsgSvAzEl"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_MsgSvAzEl"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgSvAzEl); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_observation_MsgSvConfigurationGpsDep.c b/c/test/legacy/auto_check_sbp_observation_MsgSvConfigurationGpsDep.c index 75ef38126..6094fb009 100644 --- a/c/test/legacy/auto_check_sbp_observation_MsgSvConfigurationGpsDep.c +++ b/c/test/legacy/auto_check_sbp_observation_MsgSvConfigurationGpsDep.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvConfigurationGpsDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvConfigurationGpsDep.yaml +// by generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,81 +128,103 @@ START_TEST( test_legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x91, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x91, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x91, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x91, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,145,0,123,0,10,0,0,0,0,0,0,66,188,101,167,18,42, }; + u8 encoded_frame[] = { + 85, 145, 0, 123, 0, 10, 0, 0, 0, 0, 0, 0, 66, 188, 101, 167, 18, 42, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_sv_configuration_gps_dep_t* test_msg = ( msg_sv_configuration_gps_dep_t* )test_msg_storage; + msg_sv_configuration_gps_dep_t *test_msg = + (msg_sv_configuration_gps_dep_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->l2c_mask = 2808462402; test_msg->t_nmct.tow = 0; test_msg->t_nmct.wn = 0; - sbp_payload_send(&sbp_state, 0x91, 123, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x91, 123, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 123, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x91, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_sv_configuration_gps_dep_t* check_msg = ( msg_sv_configuration_gps_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_sv_configuration_gps_dep_t *check_msg = + (msg_sv_configuration_gps_dep_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->l2c_mask == 2808462402, "incorrect value for l2c_mask, expected 2808462402, is %d", check_msg->l2c_mask); - ck_assert_msg(check_msg->t_nmct.tow == 0, "incorrect value for t_nmct.tow, expected 0, is %d", check_msg->t_nmct.tow); - ck_assert_msg(check_msg->t_nmct.wn == 0, "incorrect value for t_nmct.wn, expected 0, is %d", check_msg->t_nmct.wn); + ck_assert_msg(check_msg->l2c_mask == 2808462402, + "incorrect value for l2c_mask, expected 2808462402, is %d", + check_msg->l2c_mask); + ck_assert_msg(check_msg->t_nmct.tow == 0, + "incorrect value for t_nmct.tow, expected 0, is %d", + check_msg->t_nmct.tow); + ck_assert_msg(check_msg->t_nmct.wn == 0, + "incorrect value for t_nmct.wn, expected 0, is %d", + check_msg->t_nmct.wn); } } END_TEST -Suite* legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep); +Suite *legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_" + "MsgSvConfigurationGpsDep"); + tcase_add_test( + tc_acq, test_legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_msgEphemerisDepB.c b/c/test/legacy/auto_check_sbp_observation_msgEphemerisDepB.c index 031c6ed77..7aedc5489 100644 --- a/c/test/legacy/auto_check_sbp_observation_msgEphemerisDepB.c +++ b/c/test/legacy/auto_check_sbp_observation_msgEphemerisDepB.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisDepB ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_msgEphemerisDepB) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,34 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x46, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x46, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,60,190,0,0,0,0,0,186,82,192,0,0,0,0,0,76,109,64,0,0,0,0,0,132,208,190,0,0,0,0,0,254,220,62,0,0,0,0,0,0,113,62,0,0,0,0,0,0,133,190,28,36,25,81,223,254,52,62,220,116,216,39,33,189,3,64,0,0,0,156,177,204,134,63,0,0,160,220,182,33,180,64,152,225,192,44,254,76,238,191,41,150,24,2,148,156,65,190,252,90,119,48,15,215,240,63,124,127,115,94,208,16,238,63,165,115,52,74,97,167,246,189,0,0,0,0,192,180,229,190,0,0,0,0,0,0,112,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,3,0,225,156, }; + sbp_payload_callback_register(&sbp_state, 0x46, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x46, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 60, 190, + 0, 0, 0, 0, 0, 186, 82, 192, 0, 0, 0, 0, 0, 76, + 109, 64, 0, 0, 0, 0, 0, 132, 208, 190, 0, 0, 0, 0, + 0, 254, 220, 62, 0, 0, 0, 0, 0, 0, 113, 62, 0, 0, + 0, 0, 0, 0, 133, 190, 28, 36, 25, 81, 223, 254, 52, 62, + 220, 116, 216, 39, 33, 189, 3, 64, 0, 0, 0, 156, 177, 204, + 134, 63, 0, 0, 160, 220, 182, 33, 180, 64, 152, 225, 192, 44, + 254, 76, 238, 191, 41, 150, 24, 2, 148, 156, 65, 190, 252, 90, + 119, 48, 15, 215, 240, 63, 124, 127, 115, 94, 208, 16, 238, 63, + 165, 115, 52, 74, 97, 167, 246, 189, 0, 0, 0, 0, 192, 180, + 229, 190, 0, 0, 0, 0, 0, 0, 112, 189, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, + 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, 3, 0, + 225, 156, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_dep_b_t* test_msg = ( msg_ephemeris_dep_b_t* )test_msg_storage; + msg_ephemeris_dep_b_t* test_msg = (msg_ephemeris_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = -1.035025343298912e-05; test_msg->af1 = -9.094947017729282e-13; @@ -170,86 +184,151 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisDepB ) test_msg->toe_wn = 1838; test_msg->valid = 1; test_msg->w = 1.0525047200405302; - sbp_payload_send(&sbp_state, 0x46, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x46, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x46, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_dep_b_t* check_msg = ( msg_ephemeris_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_dep_b_t* check_msg = + (msg_ephemeris_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - -1.0350253433e-05*100) < 0.05, "incorrect value for af0, expected -1.0350253433e-05, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - -9.09494701773e-13*100) < 0.05, "incorrect value for af1, expected -9.09494701773e-13, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - 0.0*100) < 0.05, "incorrect value for af2, expected 0.0, is %f", check_msg->af2); - ck_assert_msg((check_msg->c_ic*100 - 6.33299350739e-08*100) < 0.05, "incorrect value for c_ic, expected 6.33299350739e-08, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - -1.56462192535e-07*100) < 0.05, "incorrect value for c_is, expected -1.56462192535e-07, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - 234.375*100) < 0.05, "incorrect value for c_rc, expected 234.375, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - -74.90625*100) < 0.05, "incorrect value for c_rs, expected -74.90625, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - -3.93763184547e-06*100) < 0.05, "incorrect value for c_uc, expected -3.93763184547e-06, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 6.9122761488e-06*100) < 0.05, "incorrect value for c_us, expected 6.9122761488e-06, is %f", check_msg->c_us); - ck_assert_msg((check_msg->dn*100 - 4.88841790794e-09*100) < 0.05, "incorrect value for dn, expected 4.88841790794e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.0111326099141*100) < 0.05, "incorrect value for ecc, expected 0.0111326099141, is %f", check_msg->ecc); - ck_assert_msg(check_msg->healthy == 1, "incorrect value for healthy, expected 1, is %d", check_msg->healthy); - ck_assert_msg((check_msg->inc*100 - 0.939552483058*100) < 0.05, "incorrect value for inc, expected 0.939552483058, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - -3.29656588663e-10*100) < 0.05, "incorrect value for inc_dot, expected -3.29656588663e-10, is %f", check_msg->inc_dot); - ck_assert_msg(check_msg->iode == 0, "incorrect value for iode, expected 0, is %d", check_msg->iode); - ck_assert_msg((check_msg->m0*100 - 2.46734839563*100) < 0.05, "incorrect value for m0, expected 2.46734839563, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - -0.946898543748*100) < 0.05, "incorrect value for omega0, expected -0.946898543748, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -8.20105589261e-09*100) < 0.05, "incorrect value for omegadot, expected -8.20105589261e-09, is %f", check_msg->omegadot); - ck_assert_msg(check_msg->prn == 3, "incorrect value for prn, expected 3, is %d", check_msg->prn); - ck_assert_msg((check_msg->sqrta*100 - 5153.71430397*100) < 0.05, "incorrect value for sqrta, expected 5153.71430397, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->tgd*100 - -6.51925802231e-09*100) < 0.05, "incorrect value for tgd, expected -6.51925802231e-09, is %f", check_msg->tgd); - ck_assert_msg((check_msg->toc_tow*100 - 410400.0*100) < 0.05, "incorrect value for toc_tow, expected 410400.0, is %f", check_msg->toc_tow); - ck_assert_msg(check_msg->toc_wn == 1838, "incorrect value for toc_wn, expected 1838, is %d", check_msg->toc_wn); - ck_assert_msg((check_msg->toe_tow*100 - 410400.0*100) < 0.05, "incorrect value for toe_tow, expected 410400.0, is %f", check_msg->toe_tow); - ck_assert_msg(check_msg->toe_wn == 1838, "incorrect value for toe_wn, expected 1838, is %d", check_msg->toe_wn); - ck_assert_msg(check_msg->valid == 1, "incorrect value for valid, expected 1, is %d", check_msg->valid); - ck_assert_msg((check_msg->w*100 - 1.05250472004*100) < 0.05, "incorrect value for w, expected 1.05250472004, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - -1.0350253433e-05 * 100) < 0.05, + "incorrect value for af0, expected -1.0350253433e-05, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - -9.09494701773e-13 * 100) < 0.05, + "incorrect value for af1, expected -9.09494701773e-13, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for af2, expected 0.0, is %f", + check_msg->af2); + ck_assert_msg((check_msg->c_ic * 100 - 6.33299350739e-08 * 100) < 0.05, + "incorrect value for c_ic, expected 6.33299350739e-08, is %f", + check_msg->c_ic); + ck_assert_msg( + (check_msg->c_is * 100 - -1.56462192535e-07 * 100) < 0.05, + "incorrect value for c_is, expected -1.56462192535e-07, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - 234.375 * 100) < 0.05, + "incorrect value for c_rc, expected 234.375, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - -74.90625 * 100) < 0.05, + "incorrect value for c_rs, expected -74.90625, is %f", + check_msg->c_rs); + ck_assert_msg( + (check_msg->c_uc * 100 - -3.93763184547e-06 * 100) < 0.05, + "incorrect value for c_uc, expected -3.93763184547e-06, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 6.9122761488e-06 * 100) < 0.05, + "incorrect value for c_us, expected 6.9122761488e-06, is %f", + check_msg->c_us); + ck_assert_msg((check_msg->dn * 100 - 4.88841790794e-09 * 100) < 0.05, + "incorrect value for dn, expected 4.88841790794e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.0111326099141 * 100) < 0.05, + "incorrect value for ecc, expected 0.0111326099141, is %f", + check_msg->ecc); + ck_assert_msg(check_msg->healthy == 1, + "incorrect value for healthy, expected 1, is %d", + check_msg->healthy); + ck_assert_msg((check_msg->inc * 100 - 0.939552483058 * 100) < 0.05, + "incorrect value for inc, expected 0.939552483058, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - -3.29656588663e-10 * 100) < 0.05, + "incorrect value for inc_dot, expected -3.29656588663e-10, is %f", + check_msg->inc_dot); + ck_assert_msg(check_msg->iode == 0, + "incorrect value for iode, expected 0, is %d", + check_msg->iode); + ck_assert_msg((check_msg->m0 * 100 - 2.46734839563 * 100) < 0.05, + "incorrect value for m0, expected 2.46734839563, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - -0.946898543748 * 100) < 0.05, + "incorrect value for omega0, expected -0.946898543748, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -8.20105589261e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -8.20105589261e-09, is %f", + check_msg->omegadot); + ck_assert_msg(check_msg->prn == 3, + "incorrect value for prn, expected 3, is %d", check_msg->prn); + ck_assert_msg((check_msg->sqrta * 100 - 5153.71430397 * 100) < 0.05, + "incorrect value for sqrta, expected 5153.71430397, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->tgd * 100 - -6.51925802231e-09 * 100) < 0.05, + "incorrect value for tgd, expected -6.51925802231e-09, is %f", + check_msg->tgd); + ck_assert_msg((check_msg->toc_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for toc_tow, expected 410400.0, is %f", + check_msg->toc_tow); + ck_assert_msg(check_msg->toc_wn == 1838, + "incorrect value for toc_wn, expected 1838, is %d", + check_msg->toc_wn); + ck_assert_msg((check_msg->toe_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for toe_tow, expected 410400.0, is %f", + check_msg->toe_tow); + ck_assert_msg(check_msg->toe_wn == 1838, + "incorrect value for toe_wn, expected 1838, is %d", + check_msg->toe_wn); + ck_assert_msg(check_msg->valid == 1, + "incorrect value for valid, expected 1, is %d", + check_msg->valid); + ck_assert_msg((check_msg->w * 100 - 1.05250472004 * 100) < 0.05, + "incorrect value for w, expected 1.05250472004, is %f", + check_msg->w); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -257,17 +336,34 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x46, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x46, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,68,190,0,0,0,0,0,72,66,64,0,0,0,0,128,188,115,64,0,0,0,0,0,80,193,62,0,0,0,0,0,164,204,62,0,0,0,0,0,0,130,62,0,0,0,0,0,0,128,62,72,181,127,6,208,225,52,62,158,174,129,91,27,105,249,191,0,0,0,96,204,57,128,63,0,0,160,35,146,33,180,64,247,169,1,36,133,206,243,63,79,11,109,92,156,208,65,190,103,78,3,253,223,147,255,191,164,214,90,250,218,240,238,63,94,239,187,37,36,10,242,61,0,0,0,0,176,91,19,63,0,0,0,0,0,0,137,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,13,0,180,21, }; + sbp_payload_callback_register(&sbp_state, 0x46, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x46, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 68, 190, + 0, 0, 0, 0, 0, 72, 66, 64, 0, 0, 0, 0, 128, 188, + 115, 64, 0, 0, 0, 0, 0, 80, 193, 62, 0, 0, 0, 0, + 0, 164, 204, 62, 0, 0, 0, 0, 0, 0, 130, 62, 0, 0, + 0, 0, 0, 0, 128, 62, 72, 181, 127, 6, 208, 225, 52, 62, + 158, 174, 129, 91, 27, 105, 249, 191, 0, 0, 0, 96, 204, 57, + 128, 63, 0, 0, 160, 35, 146, 33, 180, 64, 247, 169, 1, 36, + 133, 206, 243, 63, 79, 11, 109, 92, 156, 208, 65, 190, 103, 78, + 3, 253, 223, 147, 255, 191, 164, 214, 90, 250, 218, 240, 238, 63, + 94, 239, 187, 37, 36, 10, 242, 61, 0, 0, 0, 0, 176, 91, + 19, 63, 0, 0, 0, 0, 0, 0, 137, 189, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, + 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, 13, 0, + 180, 21, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_dep_b_t* test_msg = ( msg_ephemeris_dep_b_t* )test_msg_storage; + msg_ephemeris_dep_b_t* test_msg = (msg_ephemeris_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = 7.384549826383591e-05; test_msg->af1 = -2.8421709430404007e-12; @@ -296,86 +392,150 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisDepB ) test_msg->toe_wn = 1838; test_msg->valid = 1; test_msg->w = -1.9736022837941165; - sbp_payload_send(&sbp_state, 0x46, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x46, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x46, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_dep_b_t* check_msg = ( msg_ephemeris_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_dep_b_t* check_msg = + (msg_ephemeris_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - 7.38454982638e-05*100) < 0.05, "incorrect value for af0, expected 7.38454982638e-05, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - -2.84217094304e-12*100) < 0.05, "incorrect value for af1, expected -2.84217094304e-12, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - 0.0*100) < 0.05, "incorrect value for af2, expected 0.0, is %f", check_msg->af2); - ck_assert_msg((check_msg->c_ic*100 - 1.34110450745e-07*100) < 0.05, "incorrect value for c_ic, expected 1.34110450745e-07, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - 1.19209289551e-07*100) < 0.05, "incorrect value for c_is, expected 1.19209289551e-07, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - 315.78125*100) < 0.05, "incorrect value for c_rc, expected 315.78125, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - 36.5625*100) < 0.05, "incorrect value for c_rs, expected 36.5625, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - 2.06381082535e-06*100) < 0.05, "incorrect value for c_uc, expected 2.06381082535e-06, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 3.41422855854e-06*100) < 0.05, "incorrect value for c_us, expected 3.41422855854e-06, is %f", check_msg->c_us); - ck_assert_msg((check_msg->dn*100 - 4.86198823561e-09*100) < 0.05, "incorrect value for dn, expected 4.86198823561e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.00792274158448*100) < 0.05, "incorrect value for ecc, expected 0.00792274158448, is %f", check_msg->ecc); - ck_assert_msg(check_msg->healthy == 1, "incorrect value for healthy, expected 1, is %d", check_msg->healthy); - ck_assert_msg((check_msg->inc*100 - 0.966901291823*100) < 0.05, "incorrect value for inc, expected 0.966901291823, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - 2.62510934634e-10*100) < 0.05, "incorrect value for inc_dot, expected 2.62510934634e-10, is %f", check_msg->inc_dot); - ck_assert_msg(check_msg->iode == 0, "incorrect value for iode, expected 0, is %d", check_msg->iode); - ck_assert_msg((check_msg->m0*100 - -1.58816085572*100) < 0.05, "incorrect value for m0, expected -1.58816085572, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - 1.23791994157*100) < 0.05, "incorrect value for omega0, expected 1.23791994157, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -8.29570269217e-09*100) < 0.05, "incorrect value for omegadot, expected -8.29570269217e-09, is %f", check_msg->omegadot); - ck_assert_msg(check_msg->prn == 13, "incorrect value for prn, expected 13, is %d", check_msg->prn); - ck_assert_msg((check_msg->sqrta*100 - 5153.57085609*100) < 0.05, "incorrect value for sqrta, expected 5153.57085609, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->tgd*100 - -9.31322574615e-09*100) < 0.05, "incorrect value for tgd, expected -9.31322574615e-09, is %f", check_msg->tgd); - ck_assert_msg((check_msg->toc_tow*100 - 410400.0*100) < 0.05, "incorrect value for toc_tow, expected 410400.0, is %f", check_msg->toc_tow); - ck_assert_msg(check_msg->toc_wn == 1838, "incorrect value for toc_wn, expected 1838, is %d", check_msg->toc_wn); - ck_assert_msg((check_msg->toe_tow*100 - 410400.0*100) < 0.05, "incorrect value for toe_tow, expected 410400.0, is %f", check_msg->toe_tow); - ck_assert_msg(check_msg->toe_wn == 1838, "incorrect value for toe_wn, expected 1838, is %d", check_msg->toe_wn); - ck_assert_msg(check_msg->valid == 1, "incorrect value for valid, expected 1, is %d", check_msg->valid); - ck_assert_msg((check_msg->w*100 - -1.97360228379*100) < 0.05, "incorrect value for w, expected -1.97360228379, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - 7.38454982638e-05 * 100) < 0.05, + "incorrect value for af0, expected 7.38454982638e-05, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - -2.84217094304e-12 * 100) < 0.05, + "incorrect value for af1, expected -2.84217094304e-12, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for af2, expected 0.0, is %f", + check_msg->af2); + ck_assert_msg((check_msg->c_ic * 100 - 1.34110450745e-07 * 100) < 0.05, + "incorrect value for c_ic, expected 1.34110450745e-07, is %f", + check_msg->c_ic); + ck_assert_msg((check_msg->c_is * 100 - 1.19209289551e-07 * 100) < 0.05, + "incorrect value for c_is, expected 1.19209289551e-07, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - 315.78125 * 100) < 0.05, + "incorrect value for c_rc, expected 315.78125, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - 36.5625 * 100) < 0.05, + "incorrect value for c_rs, expected 36.5625, is %f", + check_msg->c_rs); + ck_assert_msg((check_msg->c_uc * 100 - 2.06381082535e-06 * 100) < 0.05, + "incorrect value for c_uc, expected 2.06381082535e-06, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 3.41422855854e-06 * 100) < 0.05, + "incorrect value for c_us, expected 3.41422855854e-06, is %f", + check_msg->c_us); + ck_assert_msg((check_msg->dn * 100 - 4.86198823561e-09 * 100) < 0.05, + "incorrect value for dn, expected 4.86198823561e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.00792274158448 * 100) < 0.05, + "incorrect value for ecc, expected 0.00792274158448, is %f", + check_msg->ecc); + ck_assert_msg(check_msg->healthy == 1, + "incorrect value for healthy, expected 1, is %d", + check_msg->healthy); + ck_assert_msg((check_msg->inc * 100 - 0.966901291823 * 100) < 0.05, + "incorrect value for inc, expected 0.966901291823, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - 2.62510934634e-10 * 100) < 0.05, + "incorrect value for inc_dot, expected 2.62510934634e-10, is %f", + check_msg->inc_dot); + ck_assert_msg(check_msg->iode == 0, + "incorrect value for iode, expected 0, is %d", + check_msg->iode); + ck_assert_msg((check_msg->m0 * 100 - -1.58816085572 * 100) < 0.05, + "incorrect value for m0, expected -1.58816085572, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - 1.23791994157 * 100) < 0.05, + "incorrect value for omega0, expected 1.23791994157, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -8.29570269217e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -8.29570269217e-09, is %f", + check_msg->omegadot); + ck_assert_msg(check_msg->prn == 13, + "incorrect value for prn, expected 13, is %d", + check_msg->prn); + ck_assert_msg((check_msg->sqrta * 100 - 5153.57085609 * 100) < 0.05, + "incorrect value for sqrta, expected 5153.57085609, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->tgd * 100 - -9.31322574615e-09 * 100) < 0.05, + "incorrect value for tgd, expected -9.31322574615e-09, is %f", + check_msg->tgd); + ck_assert_msg((check_msg->toc_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for toc_tow, expected 410400.0, is %f", + check_msg->toc_tow); + ck_assert_msg(check_msg->toc_wn == 1838, + "incorrect value for toc_wn, expected 1838, is %d", + check_msg->toc_wn); + ck_assert_msg((check_msg->toe_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for toe_tow, expected 410400.0, is %f", + check_msg->toe_tow); + ck_assert_msg(check_msg->toe_wn == 1838, + "incorrect value for toe_wn, expected 1838, is %d", + check_msg->toe_wn); + ck_assert_msg(check_msg->valid == 1, + "incorrect value for valid, expected 1, is %d", + check_msg->valid); + ck_assert_msg((check_msg->w * 100 - -1.97360228379 * 100) < 0.05, + "incorrect value for w, expected -1.97360228379, is %f", + check_msg->w); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -383,17 +543,34 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x46, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x46, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,56,62,0,0,0,0,0,40,81,192,0,0,0,0,0,129,109,64,0,0,0,0,0,28,205,190,0,0,0,0,0,76,223,62,0,0,0,0,0,0,105,190,0,0,0,0,0,0,92,190,134,161,223,255,243,43,51,62,146,176,113,142,234,164,5,64,0,0,0,56,175,140,112,63,0,0,192,90,171,33,180,64,36,38,237,255,200,160,237,191,204,92,63,154,49,91,65,190,125,94,251,132,52,61,216,63,2,139,28,27,231,199,238,63,124,183,4,180,194,30,247,189,0,0,0,0,0,104,222,190,0,0,0,0,0,0,96,61,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,0,0,222,152, }; + sbp_payload_callback_register(&sbp_state, 0x46, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x46, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 56, 62, + 0, 0, 0, 0, 0, 40, 81, 192, 0, 0, 0, 0, 0, 129, + 109, 64, 0, 0, 0, 0, 0, 28, 205, 190, 0, 0, 0, 0, + 0, 76, 223, 62, 0, 0, 0, 0, 0, 0, 105, 190, 0, 0, + 0, 0, 0, 0, 92, 190, 134, 161, 223, 255, 243, 43, 51, 62, + 146, 176, 113, 142, 234, 164, 5, 64, 0, 0, 0, 56, 175, 140, + 112, 63, 0, 0, 192, 90, 171, 33, 180, 64, 36, 38, 237, 255, + 200, 160, 237, 191, 204, 92, 63, 154, 49, 91, 65, 190, 125, 94, + 251, 132, 52, 61, 216, 63, 2, 139, 28, 27, 231, 199, 238, 63, + 124, 183, 4, 180, 194, 30, 247, 189, 0, 0, 0, 0, 0, 104, + 222, 190, 0, 0, 0, 0, 0, 0, 96, 61, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, + 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, 0, 0, + 222, 152, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_dep_b_t* test_msg = ( msg_ephemeris_dep_b_t* )test_msg_storage; + msg_ephemeris_dep_b_t* test_msg = (msg_ephemeris_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = -7.249414920806885e-06; test_msg->af1 = 4.547473508864641e-13; @@ -422,86 +599,152 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisDepB ) test_msg->toe_wn = 1838; test_msg->valid = 1; test_msg->w = 0.37873566614641857; - sbp_payload_send(&sbp_state, 0x46, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x46, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x46, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_dep_b_t* check_msg = ( msg_ephemeris_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_dep_b_t* check_msg = + (msg_ephemeris_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - -7.24941492081e-06*100) < 0.05, "incorrect value for af0, expected -7.24941492081e-06, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - 4.54747350886e-13*100) < 0.05, "incorrect value for af1, expected 4.54747350886e-13, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - 0.0*100) < 0.05, "incorrect value for af2, expected 0.0, is %f", check_msg->af2); - ck_assert_msg((check_msg->c_ic*100 - -4.65661287308e-08*100) < 0.05, "incorrect value for c_ic, expected -4.65661287308e-08, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - -2.60770320892e-08*100) < 0.05, "incorrect value for c_is, expected -2.60770320892e-08, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - 236.03125*100) < 0.05, "incorrect value for c_rc, expected 236.03125, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - -68.625*100) < 0.05, "incorrect value for c_rs, expected -68.625, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - -3.47010791302e-06*100) < 0.05, "incorrect value for c_uc, expected -3.47010791302e-06, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 7.46175646782e-06*100) < 0.05, "incorrect value for c_us, expected 7.46175646782e-06, is %f", check_msg->c_us); - ck_assert_msg((check_msg->dn*100 - 4.46375736198e-09*100) < 0.05, "incorrect value for dn, expected 4.46375736198e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.00404041714501*100) < 0.05, "incorrect value for ecc, expected 0.00404041714501, is %f", check_msg->ecc); - ck_assert_msg(check_msg->healthy == 1, "incorrect value for healthy, expected 1, is %d", check_msg->healthy); - ck_assert_msg((check_msg->inc*100 - 0.96190219207*100) < 0.05, "incorrect value for inc, expected 0.96190219207, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - -3.36442585613e-10*100) < 0.05, "incorrect value for inc_dot, expected -3.36442585613e-10, is %f", check_msg->inc_dot); - ck_assert_msg(check_msg->iode == 0, "incorrect value for iode, expected 0, is %d", check_msg->iode); - ck_assert_msg((check_msg->m0*100 - 2.70552550587*100) < 0.05, "incorrect value for m0, expected 2.70552550587, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - -0.925877094132*100) < 0.05, "incorrect value for omega0, expected -0.925877094132, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -8.08212236712e-09*100) < 0.05, "incorrect value for omegadot, expected -8.08212236712e-09, is %f", check_msg->omegadot); - ck_assert_msg(check_msg->prn == 0, "incorrect value for prn, expected 0, is %d", check_msg->prn); - ck_assert_msg((check_msg->sqrta*100 - 5153.66935349*100) < 0.05, "incorrect value for sqrta, expected 5153.66935349, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->tgd*100 - 5.58793544769e-09*100) < 0.05, "incorrect value for tgd, expected 5.58793544769e-09, is %f", check_msg->tgd); - ck_assert_msg((check_msg->toc_tow*100 - 410400.0*100) < 0.05, "incorrect value for toc_tow, expected 410400.0, is %f", check_msg->toc_tow); - ck_assert_msg(check_msg->toc_wn == 1838, "incorrect value for toc_wn, expected 1838, is %d", check_msg->toc_wn); - ck_assert_msg((check_msg->toe_tow*100 - 410400.0*100) < 0.05, "incorrect value for toe_tow, expected 410400.0, is %f", check_msg->toe_tow); - ck_assert_msg(check_msg->toe_wn == 1838, "incorrect value for toe_wn, expected 1838, is %d", check_msg->toe_wn); - ck_assert_msg(check_msg->valid == 1, "incorrect value for valid, expected 1, is %d", check_msg->valid); - ck_assert_msg((check_msg->w*100 - 0.378735666146*100) < 0.05, "incorrect value for w, expected 0.378735666146, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - -7.24941492081e-06 * 100) < 0.05, + "incorrect value for af0, expected -7.24941492081e-06, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - 4.54747350886e-13 * 100) < 0.05, + "incorrect value for af1, expected 4.54747350886e-13, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for af2, expected 0.0, is %f", + check_msg->af2); + ck_assert_msg( + (check_msg->c_ic * 100 - -4.65661287308e-08 * 100) < 0.05, + "incorrect value for c_ic, expected -4.65661287308e-08, is %f", + check_msg->c_ic); + ck_assert_msg( + (check_msg->c_is * 100 - -2.60770320892e-08 * 100) < 0.05, + "incorrect value for c_is, expected -2.60770320892e-08, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - 236.03125 * 100) < 0.05, + "incorrect value for c_rc, expected 236.03125, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - -68.625 * 100) < 0.05, + "incorrect value for c_rs, expected -68.625, is %f", + check_msg->c_rs); + ck_assert_msg( + (check_msg->c_uc * 100 - -3.47010791302e-06 * 100) < 0.05, + "incorrect value for c_uc, expected -3.47010791302e-06, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 7.46175646782e-06 * 100) < 0.05, + "incorrect value for c_us, expected 7.46175646782e-06, is %f", + check_msg->c_us); + ck_assert_msg((check_msg->dn * 100 - 4.46375736198e-09 * 100) < 0.05, + "incorrect value for dn, expected 4.46375736198e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.00404041714501 * 100) < 0.05, + "incorrect value for ecc, expected 0.00404041714501, is %f", + check_msg->ecc); + ck_assert_msg(check_msg->healthy == 1, + "incorrect value for healthy, expected 1, is %d", + check_msg->healthy); + ck_assert_msg((check_msg->inc * 100 - 0.96190219207 * 100) < 0.05, + "incorrect value for inc, expected 0.96190219207, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - -3.36442585613e-10 * 100) < 0.05, + "incorrect value for inc_dot, expected -3.36442585613e-10, is %f", + check_msg->inc_dot); + ck_assert_msg(check_msg->iode == 0, + "incorrect value for iode, expected 0, is %d", + check_msg->iode); + ck_assert_msg((check_msg->m0 * 100 - 2.70552550587 * 100) < 0.05, + "incorrect value for m0, expected 2.70552550587, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - -0.925877094132 * 100) < 0.05, + "incorrect value for omega0, expected -0.925877094132, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -8.08212236712e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -8.08212236712e-09, is %f", + check_msg->omegadot); + ck_assert_msg(check_msg->prn == 0, + "incorrect value for prn, expected 0, is %d", check_msg->prn); + ck_assert_msg((check_msg->sqrta * 100 - 5153.66935349 * 100) < 0.05, + "incorrect value for sqrta, expected 5153.66935349, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->tgd * 100 - 5.58793544769e-09 * 100) < 0.05, + "incorrect value for tgd, expected 5.58793544769e-09, is %f", + check_msg->tgd); + ck_assert_msg((check_msg->toc_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for toc_tow, expected 410400.0, is %f", + check_msg->toc_tow); + ck_assert_msg(check_msg->toc_wn == 1838, + "incorrect value for toc_wn, expected 1838, is %d", + check_msg->toc_wn); + ck_assert_msg((check_msg->toe_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for toe_tow, expected 410400.0, is %f", + check_msg->toe_tow); + ck_assert_msg(check_msg->toe_wn == 1838, + "incorrect value for toe_wn, expected 1838, is %d", + check_msg->toe_wn); + ck_assert_msg(check_msg->valid == 1, + "incorrect value for valid, expected 1, is %d", + check_msg->valid); + ck_assert_msg((check_msg->w * 100 - 0.378735666146 * 100) < 0.05, + "incorrect value for w, expected 0.378735666146, is %f", + check_msg->w); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -509,17 +752,34 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x46, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x46, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,68,190,0,0,0,0,0,72,66,64,0,0,0,0,128,188,115,64,0,0,0,0,0,80,193,62,0,0,0,0,0,164,204,62,0,0,0,0,0,0,130,62,0,0,0,0,0,0,128,62,72,181,127,6,208,225,52,62,158,174,129,91,27,105,249,191,0,0,0,96,204,57,128,63,0,0,160,35,146,33,180,64,247,169,1,36,133,206,243,63,79,11,109,92,156,208,65,190,103,78,3,253,223,147,255,191,164,214,90,250,218,240,238,63,94,239,187,37,36,10,242,61,0,0,0,0,176,91,19,63,0,0,0,0,0,0,137,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,13,0,180,21, }; + sbp_payload_callback_register(&sbp_state, 0x46, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x46, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 68, 190, + 0, 0, 0, 0, 0, 72, 66, 64, 0, 0, 0, 0, 128, 188, + 115, 64, 0, 0, 0, 0, 0, 80, 193, 62, 0, 0, 0, 0, + 0, 164, 204, 62, 0, 0, 0, 0, 0, 0, 130, 62, 0, 0, + 0, 0, 0, 0, 128, 62, 72, 181, 127, 6, 208, 225, 52, 62, + 158, 174, 129, 91, 27, 105, 249, 191, 0, 0, 0, 96, 204, 57, + 128, 63, 0, 0, 160, 35, 146, 33, 180, 64, 247, 169, 1, 36, + 133, 206, 243, 63, 79, 11, 109, 92, 156, 208, 65, 190, 103, 78, + 3, 253, 223, 147, 255, 191, 164, 214, 90, 250, 218, 240, 238, 63, + 94, 239, 187, 37, 36, 10, 242, 61, 0, 0, 0, 0, 176, 91, + 19, 63, 0, 0, 0, 0, 0, 0, 137, 189, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, + 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, 13, 0, + 180, 21, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_dep_b_t* test_msg = ( msg_ephemeris_dep_b_t* )test_msg_storage; + msg_ephemeris_dep_b_t* test_msg = (msg_ephemeris_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = 7.384549826383591e-05; test_msg->af1 = -2.8421709430404007e-12; @@ -548,86 +808,150 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisDepB ) test_msg->toe_wn = 1838; test_msg->valid = 1; test_msg->w = -1.9736022837941165; - sbp_payload_send(&sbp_state, 0x46, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x46, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x46, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_dep_b_t* check_msg = ( msg_ephemeris_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_dep_b_t* check_msg = + (msg_ephemeris_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - 7.38454982638e-05*100) < 0.05, "incorrect value for af0, expected 7.38454982638e-05, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - -2.84217094304e-12*100) < 0.05, "incorrect value for af1, expected -2.84217094304e-12, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - 0.0*100) < 0.05, "incorrect value for af2, expected 0.0, is %f", check_msg->af2); - ck_assert_msg((check_msg->c_ic*100 - 1.34110450745e-07*100) < 0.05, "incorrect value for c_ic, expected 1.34110450745e-07, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - 1.19209289551e-07*100) < 0.05, "incorrect value for c_is, expected 1.19209289551e-07, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - 315.78125*100) < 0.05, "incorrect value for c_rc, expected 315.78125, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - 36.5625*100) < 0.05, "incorrect value for c_rs, expected 36.5625, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - 2.06381082535e-06*100) < 0.05, "incorrect value for c_uc, expected 2.06381082535e-06, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 3.41422855854e-06*100) < 0.05, "incorrect value for c_us, expected 3.41422855854e-06, is %f", check_msg->c_us); - ck_assert_msg((check_msg->dn*100 - 4.86198823561e-09*100) < 0.05, "incorrect value for dn, expected 4.86198823561e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.00792274158448*100) < 0.05, "incorrect value for ecc, expected 0.00792274158448, is %f", check_msg->ecc); - ck_assert_msg(check_msg->healthy == 1, "incorrect value for healthy, expected 1, is %d", check_msg->healthy); - ck_assert_msg((check_msg->inc*100 - 0.966901291823*100) < 0.05, "incorrect value for inc, expected 0.966901291823, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - 2.62510934634e-10*100) < 0.05, "incorrect value for inc_dot, expected 2.62510934634e-10, is %f", check_msg->inc_dot); - ck_assert_msg(check_msg->iode == 0, "incorrect value for iode, expected 0, is %d", check_msg->iode); - ck_assert_msg((check_msg->m0*100 - -1.58816085572*100) < 0.05, "incorrect value for m0, expected -1.58816085572, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - 1.23791994157*100) < 0.05, "incorrect value for omega0, expected 1.23791994157, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -8.29570269217e-09*100) < 0.05, "incorrect value for omegadot, expected -8.29570269217e-09, is %f", check_msg->omegadot); - ck_assert_msg(check_msg->prn == 13, "incorrect value for prn, expected 13, is %d", check_msg->prn); - ck_assert_msg((check_msg->sqrta*100 - 5153.57085609*100) < 0.05, "incorrect value for sqrta, expected 5153.57085609, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->tgd*100 - -9.31322574615e-09*100) < 0.05, "incorrect value for tgd, expected -9.31322574615e-09, is %f", check_msg->tgd); - ck_assert_msg((check_msg->toc_tow*100 - 410400.0*100) < 0.05, "incorrect value for toc_tow, expected 410400.0, is %f", check_msg->toc_tow); - ck_assert_msg(check_msg->toc_wn == 1838, "incorrect value for toc_wn, expected 1838, is %d", check_msg->toc_wn); - ck_assert_msg((check_msg->toe_tow*100 - 410400.0*100) < 0.05, "incorrect value for toe_tow, expected 410400.0, is %f", check_msg->toe_tow); - ck_assert_msg(check_msg->toe_wn == 1838, "incorrect value for toe_wn, expected 1838, is %d", check_msg->toe_wn); - ck_assert_msg(check_msg->valid == 1, "incorrect value for valid, expected 1, is %d", check_msg->valid); - ck_assert_msg((check_msg->w*100 - -1.97360228379*100) < 0.05, "incorrect value for w, expected -1.97360228379, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - 7.38454982638e-05 * 100) < 0.05, + "incorrect value for af0, expected 7.38454982638e-05, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - -2.84217094304e-12 * 100) < 0.05, + "incorrect value for af1, expected -2.84217094304e-12, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for af2, expected 0.0, is %f", + check_msg->af2); + ck_assert_msg((check_msg->c_ic * 100 - 1.34110450745e-07 * 100) < 0.05, + "incorrect value for c_ic, expected 1.34110450745e-07, is %f", + check_msg->c_ic); + ck_assert_msg((check_msg->c_is * 100 - 1.19209289551e-07 * 100) < 0.05, + "incorrect value for c_is, expected 1.19209289551e-07, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - 315.78125 * 100) < 0.05, + "incorrect value for c_rc, expected 315.78125, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - 36.5625 * 100) < 0.05, + "incorrect value for c_rs, expected 36.5625, is %f", + check_msg->c_rs); + ck_assert_msg((check_msg->c_uc * 100 - 2.06381082535e-06 * 100) < 0.05, + "incorrect value for c_uc, expected 2.06381082535e-06, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 3.41422855854e-06 * 100) < 0.05, + "incorrect value for c_us, expected 3.41422855854e-06, is %f", + check_msg->c_us); + ck_assert_msg((check_msg->dn * 100 - 4.86198823561e-09 * 100) < 0.05, + "incorrect value for dn, expected 4.86198823561e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.00792274158448 * 100) < 0.05, + "incorrect value for ecc, expected 0.00792274158448, is %f", + check_msg->ecc); + ck_assert_msg(check_msg->healthy == 1, + "incorrect value for healthy, expected 1, is %d", + check_msg->healthy); + ck_assert_msg((check_msg->inc * 100 - 0.966901291823 * 100) < 0.05, + "incorrect value for inc, expected 0.966901291823, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - 2.62510934634e-10 * 100) < 0.05, + "incorrect value for inc_dot, expected 2.62510934634e-10, is %f", + check_msg->inc_dot); + ck_assert_msg(check_msg->iode == 0, + "incorrect value for iode, expected 0, is %d", + check_msg->iode); + ck_assert_msg((check_msg->m0 * 100 - -1.58816085572 * 100) < 0.05, + "incorrect value for m0, expected -1.58816085572, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - 1.23791994157 * 100) < 0.05, + "incorrect value for omega0, expected 1.23791994157, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -8.29570269217e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -8.29570269217e-09, is %f", + check_msg->omegadot); + ck_assert_msg(check_msg->prn == 13, + "incorrect value for prn, expected 13, is %d", + check_msg->prn); + ck_assert_msg((check_msg->sqrta * 100 - 5153.57085609 * 100) < 0.05, + "incorrect value for sqrta, expected 5153.57085609, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->tgd * 100 - -9.31322574615e-09 * 100) < 0.05, + "incorrect value for tgd, expected -9.31322574615e-09, is %f", + check_msg->tgd); + ck_assert_msg((check_msg->toc_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for toc_tow, expected 410400.0, is %f", + check_msg->toc_tow); + ck_assert_msg(check_msg->toc_wn == 1838, + "incorrect value for toc_wn, expected 1838, is %d", + check_msg->toc_wn); + ck_assert_msg((check_msg->toe_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for toe_tow, expected 410400.0, is %f", + check_msg->toe_tow); + ck_assert_msg(check_msg->toe_wn == 1838, + "incorrect value for toe_wn, expected 1838, is %d", + check_msg->toe_wn); + ck_assert_msg(check_msg->valid == 1, + "incorrect value for valid, expected 1, is %d", + check_msg->valid); + ck_assert_msg((check_msg->w * 100 - -1.97360228379 * 100) < 0.05, + "incorrect value for w, expected -1.97360228379, is %f", + check_msg->w); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -635,17 +959,34 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x46, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x46, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,128,85,190,0,0,0,0,0,156,69,64,0,0,0,0,128,19,115,64,0,0,0,0,0,160,193,62,0,0,0,0,0,152,207,62,0,0,0,0,0,0,97,190,0,0,0,0,0,192,139,190,26,26,13,149,16,152,54,62,104,7,46,214,75,84,5,192,0,0,0,128,230,82,132,63,0,0,160,252,162,33,180,64,73,6,130,54,217,171,242,63,81,224,163,123,238,42,66,190,206,43,141,67,243,157,5,192,113,179,153,187,43,92,238,63,254,236,31,43,224,157,244,61,0,0,0,0,232,4,26,191,0,0,0,0,0,0,134,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,22,0,99,61, }; + sbp_payload_callback_register(&sbp_state, 0x46, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x46, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 128, 85, 190, + 0, 0, 0, 0, 0, 156, 69, 64, 0, 0, 0, 0, 128, 19, + 115, 64, 0, 0, 0, 0, 0, 160, 193, 62, 0, 0, 0, 0, + 0, 152, 207, 62, 0, 0, 0, 0, 0, 0, 97, 190, 0, 0, + 0, 0, 0, 192, 139, 190, 26, 26, 13, 149, 16, 152, 54, 62, + 104, 7, 46, 214, 75, 84, 5, 192, 0, 0, 0, 128, 230, 82, + 132, 63, 0, 0, 160, 252, 162, 33, 180, 64, 73, 6, 130, 54, + 217, 171, 242, 63, 81, 224, 163, 123, 238, 42, 66, 190, 206, 43, + 141, 67, 243, 157, 5, 192, 113, 179, 153, 187, 43, 92, 238, 63, + 254, 236, 31, 43, 224, 157, 244, 61, 0, 0, 0, 0, 232, 4, + 26, 191, 0, 0, 0, 0, 0, 0, 134, 189, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, + 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, 22, 0, + 99, 61, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_dep_b_t* test_msg = ( msg_ephemeris_dep_b_t* )test_msg_storage; + msg_ephemeris_dep_b_t* test_msg = (msg_ephemeris_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = -9.925523772835732e-05; test_msg->af1 = -2.5011104298755527e-12; @@ -674,86 +1015,152 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisDepB ) test_msg->toe_wn = 1838; test_msg->valid = 1; test_msg->w = -2.7021241452652935; - sbp_payload_send(&sbp_state, 0x46, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x46, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x46, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_dep_b_t* check_msg = ( msg_ephemeris_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_dep_b_t* check_msg = + (msg_ephemeris_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - -9.92552377284e-05*100) < 0.05, "incorrect value for af0, expected -9.92552377284e-05, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - -2.50111042988e-12*100) < 0.05, "incorrect value for af1, expected -2.50111042988e-12, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - 0.0*100) < 0.05, "incorrect value for af2, expected 0.0, is %f", check_msg->af2); - ck_assert_msg((check_msg->c_ic*100 - -3.16649675369e-08*100) < 0.05, "incorrect value for c_ic, expected -3.16649675369e-08, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - -2.06753611565e-07*100) < 0.05, "incorrect value for c_is, expected -2.06753611565e-07, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - 305.21875*100) < 0.05, "incorrect value for c_rc, expected 305.21875, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - 43.21875*100) < 0.05, "incorrect value for c_rs, expected 43.21875, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - 2.10106372833e-06*100) < 0.05, "incorrect value for c_uc, expected 2.10106372833e-06, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 3.76626849174e-06*100) < 0.05, "incorrect value for c_us, expected 3.76626849174e-06, is %f", check_msg->c_us); - ck_assert_msg((check_msg->dn*100 - 5.26057626697e-09*100) < 0.05, "incorrect value for dn, expected 5.26057626697e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.00992374494672*100) < 0.05, "incorrect value for ecc, expected 0.00992374494672, is %f", check_msg->ecc); - ck_assert_msg(check_msg->healthy == 1, "incorrect value for healthy, expected 1, is %d", check_msg->healthy); - ck_assert_msg((check_msg->inc*100 - 0.948751322181*100) < 0.05, "incorrect value for inc, expected 0.948751322181, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - 3.00012496725e-10*100) < 0.05, "incorrect value for inc_dot, expected 3.00012496725e-10, is %f", check_msg->inc_dot); - ck_assert_msg(check_msg->iode == 0, "incorrect value for iode, expected 0, is %d", check_msg->iode); - ck_assert_msg((check_msg->m0*100 - -2.66616027191*100) < 0.05, "incorrect value for m0, expected -2.66616027191, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - 1.16695519726*100) < 0.05, "incorrect value for omega0, expected 1.16695519726, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -8.4599952499e-09*100) < 0.05, "incorrect value for omegadot, expected -8.4599952499e-09, is %f", check_msg->omegadot); - ck_assert_msg(check_msg->prn == 22, "incorrect value for prn, expected 22, is %d", check_msg->prn); - ck_assert_msg((check_msg->sqrta*100 - 5153.63666725*100) < 0.05, "incorrect value for sqrta, expected 5153.63666725, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->tgd*100 - -2.00234353542e-08*100) < 0.05, "incorrect value for tgd, expected -2.00234353542e-08, is %f", check_msg->tgd); - ck_assert_msg((check_msg->toc_tow*100 - 410400.0*100) < 0.05, "incorrect value for toc_tow, expected 410400.0, is %f", check_msg->toc_tow); - ck_assert_msg(check_msg->toc_wn == 1838, "incorrect value for toc_wn, expected 1838, is %d", check_msg->toc_wn); - ck_assert_msg((check_msg->toe_tow*100 - 410400.0*100) < 0.05, "incorrect value for toe_tow, expected 410400.0, is %f", check_msg->toe_tow); - ck_assert_msg(check_msg->toe_wn == 1838, "incorrect value for toe_wn, expected 1838, is %d", check_msg->toe_wn); - ck_assert_msg(check_msg->valid == 1, "incorrect value for valid, expected 1, is %d", check_msg->valid); - ck_assert_msg((check_msg->w*100 - -2.70212414527*100) < 0.05, "incorrect value for w, expected -2.70212414527, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - -9.92552377284e-05 * 100) < 0.05, + "incorrect value for af0, expected -9.92552377284e-05, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - -2.50111042988e-12 * 100) < 0.05, + "incorrect value for af1, expected -2.50111042988e-12, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for af2, expected 0.0, is %f", + check_msg->af2); + ck_assert_msg( + (check_msg->c_ic * 100 - -3.16649675369e-08 * 100) < 0.05, + "incorrect value for c_ic, expected -3.16649675369e-08, is %f", + check_msg->c_ic); + ck_assert_msg( + (check_msg->c_is * 100 - -2.06753611565e-07 * 100) < 0.05, + "incorrect value for c_is, expected -2.06753611565e-07, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - 305.21875 * 100) < 0.05, + "incorrect value for c_rc, expected 305.21875, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - 43.21875 * 100) < 0.05, + "incorrect value for c_rs, expected 43.21875, is %f", + check_msg->c_rs); + ck_assert_msg((check_msg->c_uc * 100 - 2.10106372833e-06 * 100) < 0.05, + "incorrect value for c_uc, expected 2.10106372833e-06, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 3.76626849174e-06 * 100) < 0.05, + "incorrect value for c_us, expected 3.76626849174e-06, is %f", + check_msg->c_us); + ck_assert_msg((check_msg->dn * 100 - 5.26057626697e-09 * 100) < 0.05, + "incorrect value for dn, expected 5.26057626697e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.00992374494672 * 100) < 0.05, + "incorrect value for ecc, expected 0.00992374494672, is %f", + check_msg->ecc); + ck_assert_msg(check_msg->healthy == 1, + "incorrect value for healthy, expected 1, is %d", + check_msg->healthy); + ck_assert_msg((check_msg->inc * 100 - 0.948751322181 * 100) < 0.05, + "incorrect value for inc, expected 0.948751322181, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - 3.00012496725e-10 * 100) < 0.05, + "incorrect value for inc_dot, expected 3.00012496725e-10, is %f", + check_msg->inc_dot); + ck_assert_msg(check_msg->iode == 0, + "incorrect value for iode, expected 0, is %d", + check_msg->iode); + ck_assert_msg((check_msg->m0 * 100 - -2.66616027191 * 100) < 0.05, + "incorrect value for m0, expected -2.66616027191, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - 1.16695519726 * 100) < 0.05, + "incorrect value for omega0, expected 1.16695519726, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -8.4599952499e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -8.4599952499e-09, is %f", + check_msg->omegadot); + ck_assert_msg(check_msg->prn == 22, + "incorrect value for prn, expected 22, is %d", + check_msg->prn); + ck_assert_msg((check_msg->sqrta * 100 - 5153.63666725 * 100) < 0.05, + "incorrect value for sqrta, expected 5153.63666725, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->tgd * 100 - -2.00234353542e-08 * 100) < 0.05, + "incorrect value for tgd, expected -2.00234353542e-08, is %f", + check_msg->tgd); + ck_assert_msg((check_msg->toc_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for toc_tow, expected 410400.0, is %f", + check_msg->toc_tow); + ck_assert_msg(check_msg->toc_wn == 1838, + "incorrect value for toc_wn, expected 1838, is %d", + check_msg->toc_wn); + ck_assert_msg((check_msg->toe_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for toe_tow, expected 410400.0, is %f", + check_msg->toe_tow); + ck_assert_msg(check_msg->toe_wn == 1838, + "incorrect value for toe_wn, expected 1838, is %d", + check_msg->toe_wn); + ck_assert_msg(check_msg->valid == 1, + "incorrect value for valid, expected 1, is %d", + check_msg->valid); + ck_assert_msg((check_msg->w * 100 - -2.70212414527 * 100) < 0.05, + "incorrect value for w, expected -2.70212414527, is %f", + check_msg->w); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -761,17 +1168,34 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x46, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x46, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,77,190,0,0,0,0,0,122,83,192,0,0,0,0,0,233,110,64,0,0,0,0,0,60,207,190,0,0,0,0,0,28,222,62,0,0,0,0,0,128,120,62,0,0,0,0,0,0,108,62,10,230,183,140,214,230,50,62,54,86,196,164,252,10,255,63,0,0,0,36,247,191,128,63,0,0,160,5,193,33,180,64,186,138,81,129,88,239,1,64,94,210,120,170,106,25,65,190,103,213,32,155,227,194,224,191,156,47,104,93,101,55,239,63,196,83,100,254,51,54,4,190,0,0,0,0,50,242,52,63,0,0,0,0,0,0,114,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,30,0,170,33, }; + sbp_payload_callback_register(&sbp_state, 0x46, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x46, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 77, 190, + 0, 0, 0, 0, 0, 122, 83, 192, 0, 0, 0, 0, 0, 233, + 110, 64, 0, 0, 0, 0, 0, 60, 207, 190, 0, 0, 0, 0, + 0, 28, 222, 62, 0, 0, 0, 0, 0, 128, 120, 62, 0, 0, + 0, 0, 0, 0, 108, 62, 10, 230, 183, 140, 214, 230, 50, 62, + 54, 86, 196, 164, 252, 10, 255, 63, 0, 0, 0, 36, 247, 191, + 128, 63, 0, 0, 160, 5, 193, 33, 180, 64, 186, 138, 81, 129, + 88, 239, 1, 64, 94, 210, 120, 170, 106, 25, 65, 190, 103, 213, + 32, 155, 227, 194, 224, 191, 156, 47, 104, 93, 101, 55, 239, 63, + 196, 83, 100, 254, 51, 54, 4, 190, 0, 0, 0, 0, 50, 242, + 52, 63, 0, 0, 0, 0, 0, 0, 114, 189, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, + 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, 30, 0, + 170, 33, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_dep_b_t* test_msg = ( msg_ephemeris_dep_b_t* )test_msg_storage; + msg_ephemeris_dep_b_t* test_msg = (msg_ephemeris_dep_b_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = 0.0003196117468178272; test_msg->af1 = -1.0231815394945443e-12; @@ -800,90 +1224,157 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisDepB ) test_msg->toe_wn = 1838; test_msg->valid = 1; test_msg->w = -0.5237901716088061; - sbp_payload_send(&sbp_state, 0x46, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x46, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x46, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_dep_b_t* check_msg = ( msg_ephemeris_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_dep_b_t* check_msg = + (msg_ephemeris_dep_b_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - 0.000319611746818*100) < 0.05, "incorrect value for af0, expected 0.000319611746818, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - -1.02318153949e-12*100) < 0.05, "incorrect value for af1, expected -1.02318153949e-12, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - 0.0*100) < 0.05, "incorrect value for af2, expected 0.0, is %f", check_msg->af2); - ck_assert_msg((check_msg->c_ic*100 - 9.12696123123e-08*100) < 0.05, "incorrect value for c_ic, expected 9.12696123123e-08, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - 5.21540641785e-08*100) < 0.05, "incorrect value for c_is, expected 5.21540641785e-08, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - 247.28125*100) < 0.05, "incorrect value for c_rc, expected 247.28125, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - -77.90625*100) < 0.05, "incorrect value for c_rs, expected -77.90625, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - -3.72342765331e-06*100) < 0.05, "incorrect value for c_uc, expected -3.72342765331e-06, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 7.17863440514e-06*100) < 0.05, "incorrect value for c_us, expected 7.17863440514e-06, is %f", check_msg->c_us); - ck_assert_msg((check_msg->dn*100 - 4.40089760076e-09*100) < 0.05, "incorrect value for dn, expected 4.40089760076e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.00817864493001*100) < 0.05, "incorrect value for ecc, expected 0.00817864493001, is %f", check_msg->ecc); - ck_assert_msg(check_msg->healthy == 1, "incorrect value for healthy, expected 1, is %d", check_msg->healthy); - ck_assert_msg((check_msg->inc*100 - 0.975512201725*100) < 0.05, "incorrect value for inc, expected 0.975512201725, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - -5.88238788221e-10*100) < 0.05, "incorrect value for inc_dot, expected -5.88238788221e-10, is %f", check_msg->inc_dot); - ck_assert_msg(check_msg->iode == 0, "incorrect value for iode, expected 0, is %d", check_msg->iode); - ck_assert_msg((check_msg->m0*100 - 1.94018234598*100) < 0.05, "incorrect value for m0, expected 1.94018234598, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - 2.24186802893*100) < 0.05, "incorrect value for omega0, expected 2.24186802893, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -7.96247452617e-09*100) < 0.05, "incorrect value for omegadot, expected -7.96247452617e-09, is %f", check_msg->omegadot); - ck_assert_msg(check_msg->prn == 30, "incorrect value for prn, expected 30, is %d", check_msg->prn); - ck_assert_msg((check_msg->sqrta*100 - 5153.75399208*100) < 0.05, "incorrect value for sqrta, expected 5153.75399208, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->tgd*100 - -1.35041773319e-08*100) < 0.05, "incorrect value for tgd, expected -1.35041773319e-08, is %f", check_msg->tgd); - ck_assert_msg((check_msg->toc_tow*100 - 410400.0*100) < 0.05, "incorrect value for toc_tow, expected 410400.0, is %f", check_msg->toc_tow); - ck_assert_msg(check_msg->toc_wn == 1838, "incorrect value for toc_wn, expected 1838, is %d", check_msg->toc_wn); - ck_assert_msg((check_msg->toe_tow*100 - 410400.0*100) < 0.05, "incorrect value for toe_tow, expected 410400.0, is %f", check_msg->toe_tow); - ck_assert_msg(check_msg->toe_wn == 1838, "incorrect value for toe_wn, expected 1838, is %d", check_msg->toe_wn); - ck_assert_msg(check_msg->valid == 1, "incorrect value for valid, expected 1, is %d", check_msg->valid); - ck_assert_msg((check_msg->w*100 - -0.523790171609*100) < 0.05, "incorrect value for w, expected -0.523790171609, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - 0.000319611746818 * 100) < 0.05, + "incorrect value for af0, expected 0.000319611746818, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - -1.02318153949e-12 * 100) < 0.05, + "incorrect value for af1, expected -1.02318153949e-12, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for af2, expected 0.0, is %f", + check_msg->af2); + ck_assert_msg((check_msg->c_ic * 100 - 9.12696123123e-08 * 100) < 0.05, + "incorrect value for c_ic, expected 9.12696123123e-08, is %f", + check_msg->c_ic); + ck_assert_msg((check_msg->c_is * 100 - 5.21540641785e-08 * 100) < 0.05, + "incorrect value for c_is, expected 5.21540641785e-08, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - 247.28125 * 100) < 0.05, + "incorrect value for c_rc, expected 247.28125, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - -77.90625 * 100) < 0.05, + "incorrect value for c_rs, expected -77.90625, is %f", + check_msg->c_rs); + ck_assert_msg( + (check_msg->c_uc * 100 - -3.72342765331e-06 * 100) < 0.05, + "incorrect value for c_uc, expected -3.72342765331e-06, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 7.17863440514e-06 * 100) < 0.05, + "incorrect value for c_us, expected 7.17863440514e-06, is %f", + check_msg->c_us); + ck_assert_msg((check_msg->dn * 100 - 4.40089760076e-09 * 100) < 0.05, + "incorrect value for dn, expected 4.40089760076e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.00817864493001 * 100) < 0.05, + "incorrect value for ecc, expected 0.00817864493001, is %f", + check_msg->ecc); + ck_assert_msg(check_msg->healthy == 1, + "incorrect value for healthy, expected 1, is %d", + check_msg->healthy); + ck_assert_msg((check_msg->inc * 100 - 0.975512201725 * 100) < 0.05, + "incorrect value for inc, expected 0.975512201725, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - -5.88238788221e-10 * 100) < 0.05, + "incorrect value for inc_dot, expected -5.88238788221e-10, is %f", + check_msg->inc_dot); + ck_assert_msg(check_msg->iode == 0, + "incorrect value for iode, expected 0, is %d", + check_msg->iode); + ck_assert_msg((check_msg->m0 * 100 - 1.94018234598 * 100) < 0.05, + "incorrect value for m0, expected 1.94018234598, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - 2.24186802893 * 100) < 0.05, + "incorrect value for omega0, expected 2.24186802893, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -7.96247452617e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -7.96247452617e-09, is %f", + check_msg->omegadot); + ck_assert_msg(check_msg->prn == 30, + "incorrect value for prn, expected 30, is %d", + check_msg->prn); + ck_assert_msg((check_msg->sqrta * 100 - 5153.75399208 * 100) < 0.05, + "incorrect value for sqrta, expected 5153.75399208, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->tgd * 100 - -1.35041773319e-08 * 100) < 0.05, + "incorrect value for tgd, expected -1.35041773319e-08, is %f", + check_msg->tgd); + ck_assert_msg((check_msg->toc_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for toc_tow, expected 410400.0, is %f", + check_msg->toc_tow); + ck_assert_msg(check_msg->toc_wn == 1838, + "incorrect value for toc_wn, expected 1838, is %d", + check_msg->toc_wn); + ck_assert_msg((check_msg->toe_tow * 100 - 410400.0 * 100) < 0.05, + "incorrect value for toe_tow, expected 410400.0, is %f", + check_msg->toe_tow); + ck_assert_msg(check_msg->toe_wn == 1838, + "incorrect value for toe_wn, expected 1838, is %d", + check_msg->toe_wn); + ck_assert_msg(check_msg->valid == 1, + "incorrect value for valid, expected 1, is %d", + check_msg->valid); + ck_assert_msg((check_msg->w * 100 - -0.523790171609 * 100) < 0.05, + "incorrect value for w, expected -0.523790171609, is %f", + check_msg->w); } } END_TEST -Suite* legacy_auto_check_sbp_observation_msgEphemerisDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_msgEphemerisDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_msgEphemerisDepB"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_msgEphemerisDepB); +Suite* legacy_auto_check_sbp_observation_msgEphemerisDepB_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_msgEphemerisDepB"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_msgEphemerisDepB"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_msgEphemerisDepB); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_msgEphemerisQzss.c b/c/test/legacy/auto_check_sbp_observation_msgEphemerisQzss.c index eff93562f..08f513b8a 100644 --- a/c/test/legacy/auto_check_sbp_observation_msgEphemerisQzss.c +++ b/c/test/legacy/auto_check_sbp_observation_msgEphemerisQzss.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisQzss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisQzss.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisQzss ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_msgEphemerisQzss) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisQzss ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,31 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisQzss ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x8e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x8e, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x8e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x8e, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,142,0,128,240,139,193,31,208,221,6,0,106,8,0,0,0,64,64,56,0,0,0,0,0,0,192,177,0,232,228,195,0,160,19,194,0,224,135,183,0,96,10,55,0,192,157,181,0,0,46,52,167,72,107,105,179,1,39,62,15,224,158,211,241,164,211,63,0,0,0,24,251,83,179,63,0,0,0,34,44,93,185,64,143,62,206,232,193,181,242,191,207,216,69,106,98,255,39,190,65,132,95,22,48,15,249,191,249,82,67,94,30,100,231,63,117,167,187,233,187,253,181,61,160,129,193,185,0,0,168,172,0,0,0,0,208,221,6,0,106,8,49,49,3,126,23, }; + u8 encoded_frame[] = { + 85, 142, 0, 128, 240, 139, 193, 31, 208, 221, 6, 0, 106, 8, + 0, 0, 0, 64, 64, 56, 0, 0, 0, 0, 0, 0, 192, 177, + 0, 232, 228, 195, 0, 160, 19, 194, 0, 224, 135, 183, 0, 96, + 10, 55, 0, 192, 157, 181, 0, 0, 46, 52, 167, 72, 107, 105, + 179, 1, 39, 62, 15, 224, 158, 211, 241, 164, 211, 63, 0, 0, + 0, 24, 251, 83, 179, 63, 0, 0, 0, 34, 44, 93, 185, 64, + 143, 62, 206, 232, 193, 181, 242, 191, 207, 216, 69, 106, 98, 255, + 39, 190, 65, 132, 95, 22, 48, 15, 249, 191, 249, 82, 67, 94, + 30, 100, 231, 63, 117, 167, 187, 233, 187, 253, 181, 61, 160, 129, + 193, 185, 0, 0, 168, 172, 0, 0, 0, 0, 208, 221, 6, 0, + 106, 8, 49, 49, 3, 126, 23, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ephemeris_qzss_t* test_msg = ( msg_ephemeris_qzss_t* )test_msg_storage; + msg_ephemeris_qzss_t *test_msg = (msg_ephemeris_qzss_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->af0 = -0.00036908406764268875; test_msg->af1 = -4.774847184307873e-12; @@ -174,94 +185,171 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgEphemerisQzss ) test_msg->toc.tow = 450000; test_msg->toc.wn = 2154; test_msg->w = -1.5662079690885238; - sbp_payload_send(&sbp_state, 0x8e, 61568, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x8e, 61568, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61568, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 61568, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x8e, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ephemeris_qzss_t* check_msg = ( msg_ephemeris_qzss_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ephemeris_qzss_t *check_msg = + (msg_ephemeris_qzss_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->af0*100 - -0.000369084067643*100) < 0.05, "incorrect value for af0, expected -0.000369084067643, is %f", check_msg->af0); - ck_assert_msg((check_msg->af1*100 - -4.77484718431e-12*100) < 0.05, "incorrect value for af1, expected -4.77484718431e-12, is %f", check_msg->af1); - ck_assert_msg((check_msg->af2*100 - 0.0*100) < 0.05, "incorrect value for af2, expected 0.0, is %f", check_msg->af2); - ck_assert_msg((check_msg->c_ic*100 - -1.17532908916e-06*100) < 0.05, "incorrect value for c_ic, expected -1.17532908916e-06, is %f", check_msg->c_ic); - ck_assert_msg((check_msg->c_is*100 - 1.62050127983e-07*100) < 0.05, "incorrect value for c_is, expected 1.62050127983e-07, is %f", check_msg->c_is); - ck_assert_msg((check_msg->c_rc*100 - -36.90625*100) < 0.05, "incorrect value for c_rc, expected -36.90625, is %f", check_msg->c_rc); - ck_assert_msg((check_msg->c_rs*100 - -457.8125*100) < 0.05, "incorrect value for c_rs, expected -457.8125, is %f", check_msg->c_rs); - ck_assert_msg((check_msg->c_uc*100 - -1.61975622177e-05*100) < 0.05, "incorrect value for c_uc, expected -1.61975622177e-05, is %f", check_msg->c_uc); - ck_assert_msg((check_msg->c_us*100 - 8.24779272079e-06*100) < 0.05, "incorrect value for c_us, expected 8.24779272079e-06, is %f", check_msg->c_us); - ck_assert_msg(check_msg->common.fit_interval == 14400, "incorrect value for common.fit_interval, expected 14400, is %d", check_msg->common.fit_interval); - ck_assert_msg(check_msg->common.health_bits == 0, "incorrect value for common.health_bits, expected 0, is %d", check_msg->common.health_bits); - ck_assert_msg(check_msg->common.sid.code == 31, "incorrect value for common.sid.code, expected 31, is %d", check_msg->common.sid.code); - ck_assert_msg(check_msg->common.sid.sat == 193, "incorrect value for common.sid.sat, expected 193, is %d", check_msg->common.sid.sat); - ck_assert_msg(check_msg->common.toe.tow == 450000, "incorrect value for common.toe.tow, expected 450000, is %d", check_msg->common.toe.tow); - ck_assert_msg(check_msg->common.toe.wn == 2154, "incorrect value for common.toe.wn, expected 2154, is %d", check_msg->common.toe.wn); - ck_assert_msg((check_msg->common.ura*100 - 2.0*100) < 0.05, "incorrect value for common.ura, expected 2.0, is %f", check_msg->common.ura); - ck_assert_msg(check_msg->common.valid == 0, "incorrect value for common.valid, expected 0, is %d", check_msg->common.valid); - ck_assert_msg((check_msg->dn*100 - 2.67832584874e-09*100) < 0.05, "incorrect value for dn, expected 2.67832584874e-09, is %f", check_msg->dn); - ck_assert_msg((check_msg->ecc*100 - 0.075500195846*100) < 0.05, "incorrect value for ecc, expected 0.075500195846, is %f", check_msg->ecc); - ck_assert_msg((check_msg->inc*100 - 0.730971511943*100) < 0.05, "incorrect value for inc, expected 0.730971511943, is %f", check_msg->inc); - ck_assert_msg((check_msg->inc_dot*100 - 2.0000833115e-11*100) < 0.05, "incorrect value for inc_dot, expected 2.0000833115e-11, is %f", check_msg->inc_dot); - ck_assert_msg(check_msg->iodc == 817, "incorrect value for iodc, expected 817, is %d", check_msg->iodc); - ck_assert_msg(check_msg->iode == 49, "incorrect value for iode, expected 49, is %d", check_msg->iode); - ck_assert_msg((check_msg->m0*100 - 0.30694242159*100) < 0.05, "incorrect value for m0, expected 0.30694242159, is %f", check_msg->m0); - ck_assert_msg((check_msg->omega0*100 - -1.16937437954*100) < 0.05, "incorrect value for omega0, expected -1.16937437954, is %f", check_msg->omega0); - ck_assert_msg((check_msg->omegadot*100 - -2.79368779688e-09*100) < 0.05, "incorrect value for omegadot, expected -2.79368779688e-09, is %f", check_msg->omegadot); - ck_assert_msg((check_msg->sqrta*100 - 6493.1723938*100) < 0.05, "incorrect value for sqrta, expected 6493.1723938, is %f", check_msg->sqrta); - ck_assert_msg((check_msg->tgd*100 - -5.58793544769e-09*100) < 0.05, "incorrect value for tgd, expected -5.58793544769e-09, is %f", check_msg->tgd); - ck_assert_msg(check_msg->toc.tow == 450000, "incorrect value for toc.tow, expected 450000, is %d", check_msg->toc.tow); - ck_assert_msg(check_msg->toc.wn == 2154, "incorrect value for toc.wn, expected 2154, is %d", check_msg->toc.wn); - ck_assert_msg((check_msg->w*100 - -1.56620796909*100) < 0.05, "incorrect value for w, expected -1.56620796909, is %f", check_msg->w); + ck_assert_msg((check_msg->af0 * 100 - -0.000369084067643 * 100) < 0.05, + "incorrect value for af0, expected -0.000369084067643, is %f", + check_msg->af0); + ck_assert_msg((check_msg->af1 * 100 - -4.77484718431e-12 * 100) < 0.05, + "incorrect value for af1, expected -4.77484718431e-12, is %f", + check_msg->af1); + ck_assert_msg((check_msg->af2 * 100 - 0.0 * 100) < 0.05, + "incorrect value for af2, expected 0.0, is %f", + check_msg->af2); + ck_assert_msg( + (check_msg->c_ic * 100 - -1.17532908916e-06 * 100) < 0.05, + "incorrect value for c_ic, expected -1.17532908916e-06, is %f", + check_msg->c_ic); + ck_assert_msg((check_msg->c_is * 100 - 1.62050127983e-07 * 100) < 0.05, + "incorrect value for c_is, expected 1.62050127983e-07, is %f", + check_msg->c_is); + ck_assert_msg((check_msg->c_rc * 100 - -36.90625 * 100) < 0.05, + "incorrect value for c_rc, expected -36.90625, is %f", + check_msg->c_rc); + ck_assert_msg((check_msg->c_rs * 100 - -457.8125 * 100) < 0.05, + "incorrect value for c_rs, expected -457.8125, is %f", + check_msg->c_rs); + ck_assert_msg( + (check_msg->c_uc * 100 - -1.61975622177e-05 * 100) < 0.05, + "incorrect value for c_uc, expected -1.61975622177e-05, is %f", + check_msg->c_uc); + ck_assert_msg((check_msg->c_us * 100 - 8.24779272079e-06 * 100) < 0.05, + "incorrect value for c_us, expected 8.24779272079e-06, is %f", + check_msg->c_us); + ck_assert_msg( + check_msg->common.fit_interval == 14400, + "incorrect value for common.fit_interval, expected 14400, is %d", + check_msg->common.fit_interval); + ck_assert_msg(check_msg->common.health_bits == 0, + "incorrect value for common.health_bits, expected 0, is %d", + check_msg->common.health_bits); + ck_assert_msg(check_msg->common.sid.code == 31, + "incorrect value for common.sid.code, expected 31, is %d", + check_msg->common.sid.code); + ck_assert_msg(check_msg->common.sid.sat == 193, + "incorrect value for common.sid.sat, expected 193, is %d", + check_msg->common.sid.sat); + ck_assert_msg(check_msg->common.toe.tow == 450000, + "incorrect value for common.toe.tow, expected 450000, is %d", + check_msg->common.toe.tow); + ck_assert_msg(check_msg->common.toe.wn == 2154, + "incorrect value for common.toe.wn, expected 2154, is %d", + check_msg->common.toe.wn); + ck_assert_msg((check_msg->common.ura * 100 - 2.0 * 100) < 0.05, + "incorrect value for common.ura, expected 2.0, is %f", + check_msg->common.ura); + ck_assert_msg(check_msg->common.valid == 0, + "incorrect value for common.valid, expected 0, is %d", + check_msg->common.valid); + ck_assert_msg((check_msg->dn * 100 - 2.67832584874e-09 * 100) < 0.05, + "incorrect value for dn, expected 2.67832584874e-09, is %f", + check_msg->dn); + ck_assert_msg((check_msg->ecc * 100 - 0.075500195846 * 100) < 0.05, + "incorrect value for ecc, expected 0.075500195846, is %f", + check_msg->ecc); + ck_assert_msg((check_msg->inc * 100 - 0.730971511943 * 100) < 0.05, + "incorrect value for inc, expected 0.730971511943, is %f", + check_msg->inc); + ck_assert_msg( + (check_msg->inc_dot * 100 - 2.0000833115e-11 * 100) < 0.05, + "incorrect value for inc_dot, expected 2.0000833115e-11, is %f", + check_msg->inc_dot); + ck_assert_msg(check_msg->iodc == 817, + "incorrect value for iodc, expected 817, is %d", + check_msg->iodc); + ck_assert_msg(check_msg->iode == 49, + "incorrect value for iode, expected 49, is %d", + check_msg->iode); + ck_assert_msg((check_msg->m0 * 100 - 0.30694242159 * 100) < 0.05, + "incorrect value for m0, expected 0.30694242159, is %f", + check_msg->m0); + ck_assert_msg((check_msg->omega0 * 100 - -1.16937437954 * 100) < 0.05, + "incorrect value for omega0, expected -1.16937437954, is %f", + check_msg->omega0); + ck_assert_msg( + (check_msg->omegadot * 100 - -2.79368779688e-09 * 100) < 0.05, + "incorrect value for omegadot, expected -2.79368779688e-09, is %f", + check_msg->omegadot); + ck_assert_msg((check_msg->sqrta * 100 - 6493.1723938 * 100) < 0.05, + "incorrect value for sqrta, expected 6493.1723938, is %f", + check_msg->sqrta); + ck_assert_msg((check_msg->tgd * 100 - -5.58793544769e-09 * 100) < 0.05, + "incorrect value for tgd, expected -5.58793544769e-09, is %f", + check_msg->tgd); + ck_assert_msg(check_msg->toc.tow == 450000, + "incorrect value for toc.tow, expected 450000, is %d", + check_msg->toc.tow); + ck_assert_msg(check_msg->toc.wn == 2154, + "incorrect value for toc.wn, expected 2154, is %d", + check_msg->toc.wn); + ck_assert_msg((check_msg->w * 100 - -1.56620796909 * 100) < 0.05, + "incorrect value for w, expected -1.56620796909, is %f", + check_msg->w); } } END_TEST -Suite* legacy_auto_check_sbp_observation_msgEphemerisQzss_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_msgEphemerisQzss"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_msgEphemerisQzss"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_msgEphemerisQzss); +Suite *legacy_auto_check_sbp_observation_msgEphemerisQzss_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_observation_msgEphemerisQzss"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_msgEphemerisQzss"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_observation_msgEphemerisQzss); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_observation_msgObsDepA.c b/c/test/legacy/auto_check_sbp_observation_msgObsDepA.c index 17a3b589a..91b196814 100644 --- a/c/test/legacy/auto_check_sbp_observation_msgObsDepA.c +++ b/c/test/legacy/auto_check_sbp_observation_msgObsDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_msgObsDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_msgObsDepA.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_observation_msgObsDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_observation_msgObsDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgObsDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,28 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgObsDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x45, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x45, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,69,0,195,4,98,56,158,67,24,46,7,32,56,235,249,121,244,114,255,255,33,46,67,218,0,238,203,70,124,22,25,3,0,98,43,184,157,2,176,133,197,125,126,71,253,255,185,39,68,55,3,60,173,162,131,98,231,253,255,139,30,33,16,10,128,178,248,136,42,113,253,255,40,20,42,71,13,246,246,17,135,255,51,3,0,64,27,108,249,22,210,41,114,118,131,48,255,255,31,52,226,58,30,23,217, }; + sbp_payload_callback_register(&sbp_state, 0x45, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x45, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 69, 0, 195, 4, 98, 56, 158, 67, 24, 46, 7, 32, 56, + 235, 249, 121, 244, 114, 255, 255, 33, 46, 67, 218, 0, 238, 203, + 70, 124, 22, 25, 3, 0, 98, 43, 184, 157, 2, 176, 133, 197, + 125, 126, 71, 253, 255, 185, 39, 68, 55, 3, 60, 173, 162, 131, + 98, 231, 253, 255, 139, 30, 33, 16, 10, 128, 178, 248, 136, 42, + 113, 253, 255, 40, 20, 42, 71, 13, 246, 246, 17, 135, 255, 51, + 3, 0, 64, 27, 108, 249, 22, 210, 41, 114, 118, 131, 48, 255, + 255, 31, 52, 226, 58, 30, 23, 217, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_a_t* test_msg = ( msg_obs_dep_a_t* )test_msg_storage; + msg_obs_dep_a_t* test_msg = (msg_obs_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 32; test_msg->header.t.tow = 407084600; @@ -216,104 +224,201 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgObsDepA ) test_msg->obs[6].cn0 = 52; test_msg->obs[6].lock = 15074; test_msg->obs[6].prn = 30; - sbp_payload_send(&sbp_state, 0x45, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x45, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x45, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_a_t* check_msg = ( msg_obs_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_a_t* check_msg = (msg_obs_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 32, "incorrect value for header.n_obs, expected 32, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 407084600, "incorrect value for header.t.tow, expected 407084600, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1838, "incorrect value for header.t.wn, expected 1838, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 33, "incorrect value for obs[0].L.f, expected 33, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == -36108, "incorrect value for obs[0].L.i, expected -36108, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 2046421816, "incorrect value for obs[0].P, expected 2046421816, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 46, "incorrect value for obs[0].cn0, expected 46, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 55875, "incorrect value for obs[0].lock, expected 55875, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].prn == 0, "incorrect value for obs[0].prn, expected 0, is %d", check_msg->obs[0].prn); - ck_assert_msg(check_msg->obs[1].L.f == 98, "incorrect value for obs[1].L.f, expected 98, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == 203030, "incorrect value for obs[1].L.i, expected 203030, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 2085014510, "incorrect value for obs[1].P, expected 2085014510, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].cn0 == 43, "incorrect value for obs[1].cn0, expected 43, is %d", check_msg->obs[1].cn0); - ck_assert_msg(check_msg->obs[1].lock == 40376, "incorrect value for obs[1].lock, expected 40376, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].prn == 2, "incorrect value for obs[1].prn, expected 2, is %d", check_msg->obs[1].prn); - ck_assert_msg(check_msg->obs[2].L.f == 185, "incorrect value for obs[2].L.f, expected 185, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == -178306, "incorrect value for obs[2].L.i, expected -178306, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 2110096816, "incorrect value for obs[2].P, expected 2110096816, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].cn0 == 39, "incorrect value for obs[2].cn0, expected 39, is %d", check_msg->obs[2].cn0); - ck_assert_msg(check_msg->obs[2].lock == 14148, "incorrect value for obs[2].lock, expected 14148, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].prn == 3, "incorrect value for obs[2].prn, expected 3, is %d", check_msg->obs[2].prn); - ck_assert_msg(check_msg->obs[3].L.f == 139, "incorrect value for obs[3].L.f, expected 139, is %d", check_msg->obs[3].L.f); - ck_assert_msg(check_msg->obs[3].L.i == -137374, "incorrect value for obs[3].L.i, expected -137374, is %d", check_msg->obs[3].L.i); - ck_assert_msg(check_msg->obs[3].P == 2208476476, "incorrect value for obs[3].P, expected 2208476476, is %d", check_msg->obs[3].P); - ck_assert_msg(check_msg->obs[3].cn0 == 30, "incorrect value for obs[3].cn0, expected 30, is %d", check_msg->obs[3].cn0); - ck_assert_msg(check_msg->obs[3].lock == 4129, "incorrect value for obs[3].lock, expected 4129, is %d", check_msg->obs[3].lock); - ck_assert_msg(check_msg->obs[3].prn == 10, "incorrect value for obs[3].prn, expected 10, is %d", check_msg->obs[3].prn); - ck_assert_msg(check_msg->obs[4].L.f == 40, "incorrect value for obs[4].L.f, expected 40, is %d", check_msg->obs[4].L.f); - ck_assert_msg(check_msg->obs[4].L.i == -167638, "incorrect value for obs[4].L.i, expected -167638, is %d", check_msg->obs[4].L.i); - ck_assert_msg(check_msg->obs[4].P == 2298000000, "incorrect value for obs[4].P, expected 2298000000, is %d", check_msg->obs[4].P); - ck_assert_msg(check_msg->obs[4].cn0 == 20, "incorrect value for obs[4].cn0, expected 20, is %d", check_msg->obs[4].cn0); - ck_assert_msg(check_msg->obs[4].lock == 18218, "incorrect value for obs[4].lock, expected 18218, is %d", check_msg->obs[4].lock); - ck_assert_msg(check_msg->obs[4].prn == 13, "incorrect value for obs[4].prn, expected 13, is %d", check_msg->obs[4].prn); - ck_assert_msg(check_msg->obs[5].L.f == 64, "incorrect value for obs[5].L.f, expected 64, is %d", check_msg->obs[5].L.f); - ck_assert_msg(check_msg->obs[5].L.i == 209919, "incorrect value for obs[5].L.i, expected 209919, is %d", check_msg->obs[5].L.i); - ck_assert_msg(check_msg->obs[5].P == 2266101494, "incorrect value for obs[5].P, expected 2266101494, is %d", check_msg->obs[5].P); - ck_assert_msg(check_msg->obs[5].cn0 == 27, "incorrect value for obs[5].cn0, expected 27, is %d", check_msg->obs[5].cn0); - ck_assert_msg(check_msg->obs[5].lock == 63852, "incorrect value for obs[5].lock, expected 63852, is %d", check_msg->obs[5].lock); - ck_assert_msg(check_msg->obs[5].prn == 22, "incorrect value for obs[5].prn, expected 22, is %d", check_msg->obs[5].prn); - ck_assert_msg(check_msg->obs[6].L.f == 31, "incorrect value for obs[6].L.f, expected 31, is %d", check_msg->obs[6].L.f); - ck_assert_msg(check_msg->obs[6].L.i == -53117, "incorrect value for obs[6].L.i, expected -53117, is %d", check_msg->obs[6].L.i); - ck_assert_msg(check_msg->obs[6].P == 1987193298, "incorrect value for obs[6].P, expected 1987193298, is %d", check_msg->obs[6].P); - ck_assert_msg(check_msg->obs[6].cn0 == 52, "incorrect value for obs[6].cn0, expected 52, is %d", check_msg->obs[6].cn0); - ck_assert_msg(check_msg->obs[6].lock == 15074, "incorrect value for obs[6].lock, expected 15074, is %d", check_msg->obs[6].lock); - ck_assert_msg(check_msg->obs[6].prn == 30, "incorrect value for obs[6].prn, expected 30, is %d", check_msg->obs[6].prn); + ck_assert_msg(check_msg->header.n_obs == 32, + "incorrect value for header.n_obs, expected 32, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 407084600, + "incorrect value for header.t.tow, expected 407084600, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1838, + "incorrect value for header.t.wn, expected 1838, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 33, + "incorrect value for obs[0].L.f, expected 33, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == -36108, + "incorrect value for obs[0].L.i, expected -36108, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 2046421816, + "incorrect value for obs[0].P, expected 2046421816, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 46, + "incorrect value for obs[0].cn0, expected 46, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 55875, + "incorrect value for obs[0].lock, expected 55875, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].prn == 0, + "incorrect value for obs[0].prn, expected 0, is %d", + check_msg->obs[0].prn); + ck_assert_msg(check_msg->obs[1].L.f == 98, + "incorrect value for obs[1].L.f, expected 98, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == 203030, + "incorrect value for obs[1].L.i, expected 203030, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 2085014510, + "incorrect value for obs[1].P, expected 2085014510, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].cn0 == 43, + "incorrect value for obs[1].cn0, expected 43, is %d", + check_msg->obs[1].cn0); + ck_assert_msg(check_msg->obs[1].lock == 40376, + "incorrect value for obs[1].lock, expected 40376, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].prn == 2, + "incorrect value for obs[1].prn, expected 2, is %d", + check_msg->obs[1].prn); + ck_assert_msg(check_msg->obs[2].L.f == 185, + "incorrect value for obs[2].L.f, expected 185, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == -178306, + "incorrect value for obs[2].L.i, expected -178306, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 2110096816, + "incorrect value for obs[2].P, expected 2110096816, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].cn0 == 39, + "incorrect value for obs[2].cn0, expected 39, is %d", + check_msg->obs[2].cn0); + ck_assert_msg(check_msg->obs[2].lock == 14148, + "incorrect value for obs[2].lock, expected 14148, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].prn == 3, + "incorrect value for obs[2].prn, expected 3, is %d", + check_msg->obs[2].prn); + ck_assert_msg(check_msg->obs[3].L.f == 139, + "incorrect value for obs[3].L.f, expected 139, is %d", + check_msg->obs[3].L.f); + ck_assert_msg(check_msg->obs[3].L.i == -137374, + "incorrect value for obs[3].L.i, expected -137374, is %d", + check_msg->obs[3].L.i); + ck_assert_msg(check_msg->obs[3].P == 2208476476, + "incorrect value for obs[3].P, expected 2208476476, is %d", + check_msg->obs[3].P); + ck_assert_msg(check_msg->obs[3].cn0 == 30, + "incorrect value for obs[3].cn0, expected 30, is %d", + check_msg->obs[3].cn0); + ck_assert_msg(check_msg->obs[3].lock == 4129, + "incorrect value for obs[3].lock, expected 4129, is %d", + check_msg->obs[3].lock); + ck_assert_msg(check_msg->obs[3].prn == 10, + "incorrect value for obs[3].prn, expected 10, is %d", + check_msg->obs[3].prn); + ck_assert_msg(check_msg->obs[4].L.f == 40, + "incorrect value for obs[4].L.f, expected 40, is %d", + check_msg->obs[4].L.f); + ck_assert_msg(check_msg->obs[4].L.i == -167638, + "incorrect value for obs[4].L.i, expected -167638, is %d", + check_msg->obs[4].L.i); + ck_assert_msg(check_msg->obs[4].P == 2298000000, + "incorrect value for obs[4].P, expected 2298000000, is %d", + check_msg->obs[4].P); + ck_assert_msg(check_msg->obs[4].cn0 == 20, + "incorrect value for obs[4].cn0, expected 20, is %d", + check_msg->obs[4].cn0); + ck_assert_msg(check_msg->obs[4].lock == 18218, + "incorrect value for obs[4].lock, expected 18218, is %d", + check_msg->obs[4].lock); + ck_assert_msg(check_msg->obs[4].prn == 13, + "incorrect value for obs[4].prn, expected 13, is %d", + check_msg->obs[4].prn); + ck_assert_msg(check_msg->obs[5].L.f == 64, + "incorrect value for obs[5].L.f, expected 64, is %d", + check_msg->obs[5].L.f); + ck_assert_msg(check_msg->obs[5].L.i == 209919, + "incorrect value for obs[5].L.i, expected 209919, is %d", + check_msg->obs[5].L.i); + ck_assert_msg(check_msg->obs[5].P == 2266101494, + "incorrect value for obs[5].P, expected 2266101494, is %d", + check_msg->obs[5].P); + ck_assert_msg(check_msg->obs[5].cn0 == 27, + "incorrect value for obs[5].cn0, expected 27, is %d", + check_msg->obs[5].cn0); + ck_assert_msg(check_msg->obs[5].lock == 63852, + "incorrect value for obs[5].lock, expected 63852, is %d", + check_msg->obs[5].lock); + ck_assert_msg(check_msg->obs[5].prn == 22, + "incorrect value for obs[5].prn, expected 22, is %d", + check_msg->obs[5].prn); + ck_assert_msg(check_msg->obs[6].L.f == 31, + "incorrect value for obs[6].L.f, expected 31, is %d", + check_msg->obs[6].L.f); + ck_assert_msg(check_msg->obs[6].L.i == -53117, + "incorrect value for obs[6].L.i, expected -53117, is %d", + check_msg->obs[6].L.i); + ck_assert_msg(check_msg->obs[6].P == 1987193298, + "incorrect value for obs[6].P, expected 1987193298, is %d", + check_msg->obs[6].P); + ck_assert_msg(check_msg->obs[6].cn0 == 52, + "incorrect value for obs[6].cn0, expected 52, is %d", + check_msg->obs[6].cn0); + ck_assert_msg(check_msg->obs[6].lock == 15074, + "incorrect value for obs[6].lock, expected 15074, is %d", + check_msg->obs[6].lock); + ck_assert_msg(check_msg->obs[6].prn == 30, + "incorrect value for obs[6].prn, expected 30, is %d", + check_msg->obs[6].prn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -321,17 +426,22 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgObsDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x45, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x45, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x45, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x45, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,69,0,195,4,20,56,158,67,24,46,7,33,84,52,164,117,102,32,0,0,147,62,62,250,31,234,14, }; + u8 encoded_frame[] = { + 85, 69, 0, 195, 4, 20, 56, 158, 67, 24, 46, 7, 33, 84, + 52, 164, 117, 102, 32, 0, 0, 147, 62, 62, 250, 31, 234, 14, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_a_t* test_msg = ( msg_obs_dep_a_t* )test_msg_storage; + msg_obs_dep_a_t* test_msg = (msg_obs_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 33; test_msg->header.t.tow = 407084600; @@ -346,68 +456,93 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgObsDepA ) test_msg->obs[0].cn0 = 62; test_msg->obs[0].lock = 64062; test_msg->obs[0].prn = 31; - sbp_payload_send(&sbp_state, 0x45, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x45, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x45, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_a_t* check_msg = ( msg_obs_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_a_t* check_msg = (msg_obs_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 33, "incorrect value for header.n_obs, expected 33, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 407084600, "incorrect value for header.t.tow, expected 407084600, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1838, "incorrect value for header.t.wn, expected 1838, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 147, "incorrect value for obs[0].L.f, expected 147, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == 8294, "incorrect value for obs[0].L.i, expected 8294, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 1973695572, "incorrect value for obs[0].P, expected 1973695572, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 62, "incorrect value for obs[0].cn0, expected 62, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 64062, "incorrect value for obs[0].lock, expected 64062, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].prn == 31, "incorrect value for obs[0].prn, expected 31, is %d", check_msg->obs[0].prn); + ck_assert_msg(check_msg->header.n_obs == 33, + "incorrect value for header.n_obs, expected 33, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 407084600, + "incorrect value for header.t.tow, expected 407084600, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1838, + "incorrect value for header.t.wn, expected 1838, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 147, + "incorrect value for obs[0].L.f, expected 147, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == 8294, + "incorrect value for obs[0].L.i, expected 8294, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 1973695572, + "incorrect value for obs[0].P, expected 1973695572, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 62, + "incorrect value for obs[0].cn0, expected 62, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 64062, + "incorrect value for obs[0].lock, expected 64062, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].prn == 31, + "incorrect value for obs[0].prn, expected 31, is %d", + check_msg->obs[0].prn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -415,17 +550,28 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgObsDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x45, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x45, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,69,0,195,4,98,0,159,67,24,46,7,32,32,209,249,121,145,114,255,255,141,45,67,218,0,177,128,70,124,79,27,3,0,159,44,184,157,2,59,135,197,125,175,69,253,255,77,40,68,55,3,211,172,162,131,177,229,253,255,20,31,33,16,10,128,178,248,136,116,111,253,255,94,21,42,71,13,182,173,17,135,37,54,3,0,214,27,108,249,22,91,20,114,118,240,47,255,255,129,52,226,58,30,200,119, }; + sbp_payload_callback_register(&sbp_state, 0x45, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x45, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 69, 0, 195, 4, 98, 0, 159, 67, 24, 46, 7, 32, 32, + 209, 249, 121, 145, 114, 255, 255, 141, 45, 67, 218, 0, 177, 128, + 70, 124, 79, 27, 3, 0, 159, 44, 184, 157, 2, 59, 135, 197, + 125, 175, 69, 253, 255, 77, 40, 68, 55, 3, 211, 172, 162, 131, + 177, 229, 253, 255, 20, 31, 33, 16, 10, 128, 178, 248, 136, 116, + 111, 253, 255, 94, 21, 42, 71, 13, 182, 173, 17, 135, 37, 54, + 3, 0, 214, 27, 108, 249, 22, 91, 20, 114, 118, 240, 47, 255, + 255, 129, 52, 226, 58, 30, 200, 119, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_a_t* test_msg = ( msg_obs_dep_a_t* )test_msg_storage; + msg_obs_dep_a_t* test_msg = (msg_obs_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 32; test_msg->header.t.tow = 407084800; @@ -500,104 +646,201 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgObsDepA ) test_msg->obs[6].cn0 = 52; test_msg->obs[6].lock = 15074; test_msg->obs[6].prn = 30; - sbp_payload_send(&sbp_state, 0x45, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x45, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x45, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_a_t* check_msg = ( msg_obs_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_a_t* check_msg = (msg_obs_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 32, "incorrect value for header.n_obs, expected 32, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 407084800, "incorrect value for header.t.tow, expected 407084800, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1838, "incorrect value for header.t.wn, expected 1838, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 141, "incorrect value for obs[0].L.f, expected 141, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == -36207, "incorrect value for obs[0].L.i, expected -36207, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 2046415136, "incorrect value for obs[0].P, expected 2046415136, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 45, "incorrect value for obs[0].cn0, expected 45, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 55875, "incorrect value for obs[0].lock, expected 55875, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].prn == 0, "incorrect value for obs[0].prn, expected 0, is %d", check_msg->obs[0].prn); - ck_assert_msg(check_msg->obs[1].L.f == 159, "incorrect value for obs[1].L.f, expected 159, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == 203599, "incorrect value for obs[1].L.i, expected 203599, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 2084995249, "incorrect value for obs[1].P, expected 2084995249, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].cn0 == 44, "incorrect value for obs[1].cn0, expected 44, is %d", check_msg->obs[1].cn0); - ck_assert_msg(check_msg->obs[1].lock == 40376, "incorrect value for obs[1].lock, expected 40376, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].prn == 2, "incorrect value for obs[1].prn, expected 2, is %d", check_msg->obs[1].prn); - ck_assert_msg(check_msg->obs[2].L.f == 77, "incorrect value for obs[2].L.f, expected 77, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == -178769, "incorrect value for obs[2].L.i, expected -178769, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 2110097211, "incorrect value for obs[2].P, expected 2110097211, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].cn0 == 40, "incorrect value for obs[2].cn0, expected 40, is %d", check_msg->obs[2].cn0); - ck_assert_msg(check_msg->obs[2].lock == 14148, "incorrect value for obs[2].lock, expected 14148, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].prn == 3, "incorrect value for obs[2].prn, expected 3, is %d", check_msg->obs[2].prn); - ck_assert_msg(check_msg->obs[3].L.f == 20, "incorrect value for obs[3].L.f, expected 20, is %d", check_msg->obs[3].L.f); - ck_assert_msg(check_msg->obs[3].L.i == -137807, "incorrect value for obs[3].L.i, expected -137807, is %d", check_msg->obs[3].L.i); - ck_assert_msg(check_msg->obs[3].P == 2208476371, "incorrect value for obs[3].P, expected 2208476371, is %d", check_msg->obs[3].P); - ck_assert_msg(check_msg->obs[3].cn0 == 31, "incorrect value for obs[3].cn0, expected 31, is %d", check_msg->obs[3].cn0); - ck_assert_msg(check_msg->obs[3].lock == 4129, "incorrect value for obs[3].lock, expected 4129, is %d", check_msg->obs[3].lock); - ck_assert_msg(check_msg->obs[3].prn == 10, "incorrect value for obs[3].prn, expected 10, is %d", check_msg->obs[3].prn); - ck_assert_msg(check_msg->obs[4].L.f == 94, "incorrect value for obs[4].L.f, expected 94, is %d", check_msg->obs[4].L.f); - ck_assert_msg(check_msg->obs[4].L.i == -168076, "incorrect value for obs[4].L.i, expected -168076, is %d", check_msg->obs[4].L.i); - ck_assert_msg(check_msg->obs[4].P == 2298000000, "incorrect value for obs[4].P, expected 2298000000, is %d", check_msg->obs[4].P); - ck_assert_msg(check_msg->obs[4].cn0 == 21, "incorrect value for obs[4].cn0, expected 21, is %d", check_msg->obs[4].cn0); - ck_assert_msg(check_msg->obs[4].lock == 18218, "incorrect value for obs[4].lock, expected 18218, is %d", check_msg->obs[4].lock); - ck_assert_msg(check_msg->obs[4].prn == 13, "incorrect value for obs[4].prn, expected 13, is %d", check_msg->obs[4].prn); - ck_assert_msg(check_msg->obs[5].L.f == 214, "incorrect value for obs[5].L.f, expected 214, is %d", check_msg->obs[5].L.f); - ck_assert_msg(check_msg->obs[5].L.i == 210469, "incorrect value for obs[5].L.i, expected 210469, is %d", check_msg->obs[5].L.i); - ck_assert_msg(check_msg->obs[5].P == 2266082742, "incorrect value for obs[5].P, expected 2266082742, is %d", check_msg->obs[5].P); - ck_assert_msg(check_msg->obs[5].cn0 == 27, "incorrect value for obs[5].cn0, expected 27, is %d", check_msg->obs[5].cn0); - ck_assert_msg(check_msg->obs[5].lock == 63852, "incorrect value for obs[5].lock, expected 63852, is %d", check_msg->obs[5].lock); - ck_assert_msg(check_msg->obs[5].prn == 22, "incorrect value for obs[5].prn, expected 22, is %d", check_msg->obs[5].prn); - ck_assert_msg(check_msg->obs[6].L.f == 129, "incorrect value for obs[6].L.f, expected 129, is %d", check_msg->obs[6].L.f); - ck_assert_msg(check_msg->obs[6].L.i == -53264, "incorrect value for obs[6].L.i, expected -53264, is %d", check_msg->obs[6].L.i); - ck_assert_msg(check_msg->obs[6].P == 1987187803, "incorrect value for obs[6].P, expected 1987187803, is %d", check_msg->obs[6].P); - ck_assert_msg(check_msg->obs[6].cn0 == 52, "incorrect value for obs[6].cn0, expected 52, is %d", check_msg->obs[6].cn0); - ck_assert_msg(check_msg->obs[6].lock == 15074, "incorrect value for obs[6].lock, expected 15074, is %d", check_msg->obs[6].lock); - ck_assert_msg(check_msg->obs[6].prn == 30, "incorrect value for obs[6].prn, expected 30, is %d", check_msg->obs[6].prn); + ck_assert_msg(check_msg->header.n_obs == 32, + "incorrect value for header.n_obs, expected 32, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 407084800, + "incorrect value for header.t.tow, expected 407084800, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1838, + "incorrect value for header.t.wn, expected 1838, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 141, + "incorrect value for obs[0].L.f, expected 141, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == -36207, + "incorrect value for obs[0].L.i, expected -36207, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 2046415136, + "incorrect value for obs[0].P, expected 2046415136, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 45, + "incorrect value for obs[0].cn0, expected 45, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 55875, + "incorrect value for obs[0].lock, expected 55875, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].prn == 0, + "incorrect value for obs[0].prn, expected 0, is %d", + check_msg->obs[0].prn); + ck_assert_msg(check_msg->obs[1].L.f == 159, + "incorrect value for obs[1].L.f, expected 159, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == 203599, + "incorrect value for obs[1].L.i, expected 203599, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 2084995249, + "incorrect value for obs[1].P, expected 2084995249, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].cn0 == 44, + "incorrect value for obs[1].cn0, expected 44, is %d", + check_msg->obs[1].cn0); + ck_assert_msg(check_msg->obs[1].lock == 40376, + "incorrect value for obs[1].lock, expected 40376, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].prn == 2, + "incorrect value for obs[1].prn, expected 2, is %d", + check_msg->obs[1].prn); + ck_assert_msg(check_msg->obs[2].L.f == 77, + "incorrect value for obs[2].L.f, expected 77, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == -178769, + "incorrect value for obs[2].L.i, expected -178769, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 2110097211, + "incorrect value for obs[2].P, expected 2110097211, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].cn0 == 40, + "incorrect value for obs[2].cn0, expected 40, is %d", + check_msg->obs[2].cn0); + ck_assert_msg(check_msg->obs[2].lock == 14148, + "incorrect value for obs[2].lock, expected 14148, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].prn == 3, + "incorrect value for obs[2].prn, expected 3, is %d", + check_msg->obs[2].prn); + ck_assert_msg(check_msg->obs[3].L.f == 20, + "incorrect value for obs[3].L.f, expected 20, is %d", + check_msg->obs[3].L.f); + ck_assert_msg(check_msg->obs[3].L.i == -137807, + "incorrect value for obs[3].L.i, expected -137807, is %d", + check_msg->obs[3].L.i); + ck_assert_msg(check_msg->obs[3].P == 2208476371, + "incorrect value for obs[3].P, expected 2208476371, is %d", + check_msg->obs[3].P); + ck_assert_msg(check_msg->obs[3].cn0 == 31, + "incorrect value for obs[3].cn0, expected 31, is %d", + check_msg->obs[3].cn0); + ck_assert_msg(check_msg->obs[3].lock == 4129, + "incorrect value for obs[3].lock, expected 4129, is %d", + check_msg->obs[3].lock); + ck_assert_msg(check_msg->obs[3].prn == 10, + "incorrect value for obs[3].prn, expected 10, is %d", + check_msg->obs[3].prn); + ck_assert_msg(check_msg->obs[4].L.f == 94, + "incorrect value for obs[4].L.f, expected 94, is %d", + check_msg->obs[4].L.f); + ck_assert_msg(check_msg->obs[4].L.i == -168076, + "incorrect value for obs[4].L.i, expected -168076, is %d", + check_msg->obs[4].L.i); + ck_assert_msg(check_msg->obs[4].P == 2298000000, + "incorrect value for obs[4].P, expected 2298000000, is %d", + check_msg->obs[4].P); + ck_assert_msg(check_msg->obs[4].cn0 == 21, + "incorrect value for obs[4].cn0, expected 21, is %d", + check_msg->obs[4].cn0); + ck_assert_msg(check_msg->obs[4].lock == 18218, + "incorrect value for obs[4].lock, expected 18218, is %d", + check_msg->obs[4].lock); + ck_assert_msg(check_msg->obs[4].prn == 13, + "incorrect value for obs[4].prn, expected 13, is %d", + check_msg->obs[4].prn); + ck_assert_msg(check_msg->obs[5].L.f == 214, + "incorrect value for obs[5].L.f, expected 214, is %d", + check_msg->obs[5].L.f); + ck_assert_msg(check_msg->obs[5].L.i == 210469, + "incorrect value for obs[5].L.i, expected 210469, is %d", + check_msg->obs[5].L.i); + ck_assert_msg(check_msg->obs[5].P == 2266082742, + "incorrect value for obs[5].P, expected 2266082742, is %d", + check_msg->obs[5].P); + ck_assert_msg(check_msg->obs[5].cn0 == 27, + "incorrect value for obs[5].cn0, expected 27, is %d", + check_msg->obs[5].cn0); + ck_assert_msg(check_msg->obs[5].lock == 63852, + "incorrect value for obs[5].lock, expected 63852, is %d", + check_msg->obs[5].lock); + ck_assert_msg(check_msg->obs[5].prn == 22, + "incorrect value for obs[5].prn, expected 22, is %d", + check_msg->obs[5].prn); + ck_assert_msg(check_msg->obs[6].L.f == 129, + "incorrect value for obs[6].L.f, expected 129, is %d", + check_msg->obs[6].L.f); + ck_assert_msg(check_msg->obs[6].L.i == -53264, + "incorrect value for obs[6].L.i, expected -53264, is %d", + check_msg->obs[6].L.i); + ck_assert_msg(check_msg->obs[6].P == 1987187803, + "incorrect value for obs[6].P, expected 1987187803, is %d", + check_msg->obs[6].P); + ck_assert_msg(check_msg->obs[6].cn0 == 52, + "incorrect value for obs[6].cn0, expected 52, is %d", + check_msg->obs[6].cn0); + ck_assert_msg(check_msg->obs[6].lock == 15074, + "incorrect value for obs[6].lock, expected 15074, is %d", + check_msg->obs[6].lock); + ck_assert_msg(check_msg->obs[6].prn == 30, + "incorrect value for obs[6].prn, expected 30, is %d", + check_msg->obs[6].prn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -605,17 +848,22 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgObsDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x45, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x45, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x45, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x45, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,69,0,195,4,20,0,159,67,24,46,7,33,49,19,164,117,120,32,0,0,222,63,62,250,31,11,231, }; + u8 encoded_frame[] = { + 85, 69, 0, 195, 4, 20, 0, 159, 67, 24, 46, 7, 33, 49, + 19, 164, 117, 120, 32, 0, 0, 222, 63, 62, 250, 31, 11, 231, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_a_t* test_msg = ( msg_obs_dep_a_t* )test_msg_storage; + msg_obs_dep_a_t* test_msg = (msg_obs_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 33; test_msg->header.t.tow = 407084800; @@ -630,68 +878,93 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgObsDepA ) test_msg->obs[0].cn0 = 63; test_msg->obs[0].lock = 64062; test_msg->obs[0].prn = 31; - sbp_payload_send(&sbp_state, 0x45, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x45, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x45, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_a_t* check_msg = ( msg_obs_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_a_t* check_msg = (msg_obs_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 33, "incorrect value for header.n_obs, expected 33, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 407084800, "incorrect value for header.t.tow, expected 407084800, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1838, "incorrect value for header.t.wn, expected 1838, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 222, "incorrect value for obs[0].L.f, expected 222, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == 8312, "incorrect value for obs[0].L.i, expected 8312, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 1973687089, "incorrect value for obs[0].P, expected 1973687089, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 63, "incorrect value for obs[0].cn0, expected 63, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 64062, "incorrect value for obs[0].lock, expected 64062, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].prn == 31, "incorrect value for obs[0].prn, expected 31, is %d", check_msg->obs[0].prn); + ck_assert_msg(check_msg->header.n_obs == 33, + "incorrect value for header.n_obs, expected 33, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 407084800, + "incorrect value for header.t.tow, expected 407084800, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1838, + "incorrect value for header.t.wn, expected 1838, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 222, + "incorrect value for obs[0].L.f, expected 222, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == 8312, + "incorrect value for obs[0].L.i, expected 8312, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 1973687089, + "incorrect value for obs[0].P, expected 1973687089, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 63, + "incorrect value for obs[0].cn0, expected 63, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 64062, + "incorrect value for obs[0].lock, expected 64062, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].prn == 31, + "incorrect value for obs[0].prn, expected 31, is %d", + check_msg->obs[0].prn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -699,17 +972,26 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgObsDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x45, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x45, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x45, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x45, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,69,0,195,4,72,96,162,68,24,46,7,16,87,132,217,121,121,148,255,255,189,43,175,147,0,132,64,200,125,106,31,254,255,1,41,14,177,3,128,178,248,136,70,68,254,255,166,18,184,133,13,24,127,178,134,6,25,2,0,249,28,33,96,22,170,104,86,118,67,112,255,255,203,56,208,88,30,43,107, }; + u8 encoded_frame[] = { + 85, 69, 0, 195, 4, 72, 96, 162, 68, 24, 46, 7, 16, 87, + 132, 217, 121, 121, 148, 255, 255, 189, 43, 175, 147, 0, 132, 64, + 200, 125, 106, 31, 254, 255, 1, 41, 14, 177, 3, 128, 178, 248, + 136, 70, 68, 254, 255, 166, 18, 184, 133, 13, 24, 127, 178, 134, + 6, 25, 2, 0, 249, 28, 33, 96, 22, 170, 104, 86, 118, 67, + 112, 255, 255, 203, 56, 208, 88, 30, 43, 107, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_a_t* test_msg = ( msg_obs_dep_a_t* )test_msg_storage; + msg_obs_dep_a_t* test_msg = (msg_obs_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 16; test_msg->header.t.tow = 407151200; @@ -764,92 +1046,165 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgObsDepA ) test_msg->obs[4].cn0 = 56; test_msg->obs[4].lock = 22736; test_msg->obs[4].prn = 30; - sbp_payload_send(&sbp_state, 0x45, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x45, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x45, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_a_t* check_msg = ( msg_obs_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_a_t* check_msg = (msg_obs_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 16, "incorrect value for header.n_obs, expected 16, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 407151200, "incorrect value for header.t.tow, expected 407151200, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1838, "incorrect value for header.t.wn, expected 1838, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 189, "incorrect value for obs[0].L.f, expected 189, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == -27527, "incorrect value for obs[0].L.i, expected -27527, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 2044298327, "incorrect value for obs[0].P, expected 2044298327, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 43, "incorrect value for obs[0].cn0, expected 43, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 37807, "incorrect value for obs[0].lock, expected 37807, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].prn == 0, "incorrect value for obs[0].prn, expected 0, is %d", check_msg->obs[0].prn); - ck_assert_msg(check_msg->obs[1].L.f == 1, "incorrect value for obs[1].L.f, expected 1, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == -123030, "incorrect value for obs[1].L.i, expected -123030, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 2110275716, "incorrect value for obs[1].P, expected 2110275716, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].cn0 == 41, "incorrect value for obs[1].cn0, expected 41, is %d", check_msg->obs[1].cn0); - ck_assert_msg(check_msg->obs[1].lock == 45326, "incorrect value for obs[1].lock, expected 45326, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].prn == 3, "incorrect value for obs[1].prn, expected 3, is %d", check_msg->obs[1].prn); - ck_assert_msg(check_msg->obs[2].L.f == 166, "incorrect value for obs[2].L.f, expected 166, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == -113594, "incorrect value for obs[2].L.i, expected -113594, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 2298000000, "incorrect value for obs[2].P, expected 2298000000, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].cn0 == 18, "incorrect value for obs[2].cn0, expected 18, is %d", check_msg->obs[2].cn0); - ck_assert_msg(check_msg->obs[2].lock == 34232, "incorrect value for obs[2].lock, expected 34232, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].prn == 13, "incorrect value for obs[2].prn, expected 13, is %d", check_msg->obs[2].prn); - ck_assert_msg(check_msg->obs[3].L.f == 249, "incorrect value for obs[3].L.f, expected 249, is %d", check_msg->obs[3].L.f); - ck_assert_msg(check_msg->obs[3].L.i == 137478, "incorrect value for obs[3].L.i, expected 137478, is %d", check_msg->obs[3].L.i); - ck_assert_msg(check_msg->obs[3].P == 2259844888, "incorrect value for obs[3].P, expected 2259844888, is %d", check_msg->obs[3].P); - ck_assert_msg(check_msg->obs[3].cn0 == 28, "incorrect value for obs[3].cn0, expected 28, is %d", check_msg->obs[3].cn0); - ck_assert_msg(check_msg->obs[3].lock == 24609, "incorrect value for obs[3].lock, expected 24609, is %d", check_msg->obs[3].lock); - ck_assert_msg(check_msg->obs[3].prn == 22, "incorrect value for obs[3].prn, expected 22, is %d", check_msg->obs[3].prn); - ck_assert_msg(check_msg->obs[4].L.f == 203, "incorrect value for obs[4].L.f, expected 203, is %d", check_msg->obs[4].L.f); - ck_assert_msg(check_msg->obs[4].L.i == -36797, "incorrect value for obs[4].L.i, expected -36797, is %d", check_msg->obs[4].L.i); - ck_assert_msg(check_msg->obs[4].P == 1985374378, "incorrect value for obs[4].P, expected 1985374378, is %d", check_msg->obs[4].P); - ck_assert_msg(check_msg->obs[4].cn0 == 56, "incorrect value for obs[4].cn0, expected 56, is %d", check_msg->obs[4].cn0); - ck_assert_msg(check_msg->obs[4].lock == 22736, "incorrect value for obs[4].lock, expected 22736, is %d", check_msg->obs[4].lock); - ck_assert_msg(check_msg->obs[4].prn == 30, "incorrect value for obs[4].prn, expected 30, is %d", check_msg->obs[4].prn); + ck_assert_msg(check_msg->header.n_obs == 16, + "incorrect value for header.n_obs, expected 16, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 407151200, + "incorrect value for header.t.tow, expected 407151200, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1838, + "incorrect value for header.t.wn, expected 1838, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 189, + "incorrect value for obs[0].L.f, expected 189, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == -27527, + "incorrect value for obs[0].L.i, expected -27527, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 2044298327, + "incorrect value for obs[0].P, expected 2044298327, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 43, + "incorrect value for obs[0].cn0, expected 43, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 37807, + "incorrect value for obs[0].lock, expected 37807, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].prn == 0, + "incorrect value for obs[0].prn, expected 0, is %d", + check_msg->obs[0].prn); + ck_assert_msg(check_msg->obs[1].L.f == 1, + "incorrect value for obs[1].L.f, expected 1, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == -123030, + "incorrect value for obs[1].L.i, expected -123030, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 2110275716, + "incorrect value for obs[1].P, expected 2110275716, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].cn0 == 41, + "incorrect value for obs[1].cn0, expected 41, is %d", + check_msg->obs[1].cn0); + ck_assert_msg(check_msg->obs[1].lock == 45326, + "incorrect value for obs[1].lock, expected 45326, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].prn == 3, + "incorrect value for obs[1].prn, expected 3, is %d", + check_msg->obs[1].prn); + ck_assert_msg(check_msg->obs[2].L.f == 166, + "incorrect value for obs[2].L.f, expected 166, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == -113594, + "incorrect value for obs[2].L.i, expected -113594, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 2298000000, + "incorrect value for obs[2].P, expected 2298000000, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].cn0 == 18, + "incorrect value for obs[2].cn0, expected 18, is %d", + check_msg->obs[2].cn0); + ck_assert_msg(check_msg->obs[2].lock == 34232, + "incorrect value for obs[2].lock, expected 34232, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].prn == 13, + "incorrect value for obs[2].prn, expected 13, is %d", + check_msg->obs[2].prn); + ck_assert_msg(check_msg->obs[3].L.f == 249, + "incorrect value for obs[3].L.f, expected 249, is %d", + check_msg->obs[3].L.f); + ck_assert_msg(check_msg->obs[3].L.i == 137478, + "incorrect value for obs[3].L.i, expected 137478, is %d", + check_msg->obs[3].L.i); + ck_assert_msg(check_msg->obs[3].P == 2259844888, + "incorrect value for obs[3].P, expected 2259844888, is %d", + check_msg->obs[3].P); + ck_assert_msg(check_msg->obs[3].cn0 == 28, + "incorrect value for obs[3].cn0, expected 28, is %d", + check_msg->obs[3].cn0); + ck_assert_msg(check_msg->obs[3].lock == 24609, + "incorrect value for obs[3].lock, expected 24609, is %d", + check_msg->obs[3].lock); + ck_assert_msg(check_msg->obs[3].prn == 22, + "incorrect value for obs[3].prn, expected 22, is %d", + check_msg->obs[3].prn); + ck_assert_msg(check_msg->obs[4].L.f == 203, + "incorrect value for obs[4].L.f, expected 203, is %d", + check_msg->obs[4].L.f); + ck_assert_msg(check_msg->obs[4].L.i == -36797, + "incorrect value for obs[4].L.i, expected -36797, is %d", + check_msg->obs[4].L.i); + ck_assert_msg(check_msg->obs[4].P == 1985374378, + "incorrect value for obs[4].P, expected 1985374378, is %d", + check_msg->obs[4].P); + ck_assert_msg(check_msg->obs[4].cn0 == 56, + "incorrect value for obs[4].cn0, expected 56, is %d", + check_msg->obs[4].cn0); + ck_assert_msg(check_msg->obs[4].lock == 22736, + "incorrect value for obs[4].lock, expected 22736, is %d", + check_msg->obs[4].lock); + ck_assert_msg(check_msg->obs[4].prn == 30, + "incorrect value for obs[4].prn, expected 30, is %d", + check_msg->obs[4].prn); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -857,17 +1212,26 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgObsDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x45, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x45, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x45, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x45, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,69,0,195,4,72,40,163,68,24,46,7,16,132,107,217,121,14,148,255,255,1,44,175,147,0,129,66,200,125,148,29,254,255,153,41,14,177,3,128,178,248,136,143,66,254,255,222,18,184,133,13,158,53,178,134,42,27,2,0,237,30,33,96,22,38,83,86,118,168,111,255,255,45,56,208,88,30,1,175, }; + u8 encoded_frame[] = { + 85, 69, 0, 195, 4, 72, 40, 163, 68, 24, 46, 7, 16, 132, + 107, 217, 121, 14, 148, 255, 255, 1, 44, 175, 147, 0, 129, 66, + 200, 125, 148, 29, 254, 255, 153, 41, 14, 177, 3, 128, 178, 248, + 136, 143, 66, 254, 255, 222, 18, 184, 133, 13, 158, 53, 178, 134, + 42, 27, 2, 0, 237, 30, 33, 96, 22, 38, 83, 86, 118, 168, + 111, 255, 255, 45, 56, 208, 88, 30, 1, 175, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_obs_dep_a_t* test_msg = ( msg_obs_dep_a_t* )test_msg_storage; + msg_obs_dep_a_t* test_msg = (msg_obs_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.n_obs = 16; test_msg->header.t.tow = 407151400; @@ -922,95 +1286,168 @@ START_TEST( test_legacy_auto_check_sbp_observation_msgObsDepA ) test_msg->obs[4].cn0 = 56; test_msg->obs[4].lock = 22736; test_msg->obs[4].prn = 30; - sbp_payload_send(&sbp_state, 0x45, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x45, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x45, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_obs_dep_a_t* check_msg = ( msg_obs_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_obs_dep_a_t* check_msg = (msg_obs_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.n_obs == 16, "incorrect value for header.n_obs, expected 16, is %d", check_msg->header.n_obs); - ck_assert_msg(check_msg->header.t.tow == 407151400, "incorrect value for header.t.tow, expected 407151400, is %d", check_msg->header.t.tow); - ck_assert_msg(check_msg->header.t.wn == 1838, "incorrect value for header.t.wn, expected 1838, is %d", check_msg->header.t.wn); - ck_assert_msg(check_msg->obs[0].L.f == 1, "incorrect value for obs[0].L.f, expected 1, is %d", check_msg->obs[0].L.f); - ck_assert_msg(check_msg->obs[0].L.i == -27634, "incorrect value for obs[0].L.i, expected -27634, is %d", check_msg->obs[0].L.i); - ck_assert_msg(check_msg->obs[0].P == 2044291972, "incorrect value for obs[0].P, expected 2044291972, is %d", check_msg->obs[0].P); - ck_assert_msg(check_msg->obs[0].cn0 == 44, "incorrect value for obs[0].cn0, expected 44, is %d", check_msg->obs[0].cn0); - ck_assert_msg(check_msg->obs[0].lock == 37807, "incorrect value for obs[0].lock, expected 37807, is %d", check_msg->obs[0].lock); - ck_assert_msg(check_msg->obs[0].prn == 0, "incorrect value for obs[0].prn, expected 0, is %d", check_msg->obs[0].prn); - ck_assert_msg(check_msg->obs[1].L.f == 153, "incorrect value for obs[1].L.f, expected 153, is %d", check_msg->obs[1].L.f); - ck_assert_msg(check_msg->obs[1].L.i == -123500, "incorrect value for obs[1].L.i, expected -123500, is %d", check_msg->obs[1].L.i); - ck_assert_msg(check_msg->obs[1].P == 2110276225, "incorrect value for obs[1].P, expected 2110276225, is %d", check_msg->obs[1].P); - ck_assert_msg(check_msg->obs[1].cn0 == 41, "incorrect value for obs[1].cn0, expected 41, is %d", check_msg->obs[1].cn0); - ck_assert_msg(check_msg->obs[1].lock == 45326, "incorrect value for obs[1].lock, expected 45326, is %d", check_msg->obs[1].lock); - ck_assert_msg(check_msg->obs[1].prn == 3, "incorrect value for obs[1].prn, expected 3, is %d", check_msg->obs[1].prn); - ck_assert_msg(check_msg->obs[2].L.f == 222, "incorrect value for obs[2].L.f, expected 222, is %d", check_msg->obs[2].L.f); - ck_assert_msg(check_msg->obs[2].L.i == -114033, "incorrect value for obs[2].L.i, expected -114033, is %d", check_msg->obs[2].L.i); - ck_assert_msg(check_msg->obs[2].P == 2298000000, "incorrect value for obs[2].P, expected 2298000000, is %d", check_msg->obs[2].P); - ck_assert_msg(check_msg->obs[2].cn0 == 18, "incorrect value for obs[2].cn0, expected 18, is %d", check_msg->obs[2].cn0); - ck_assert_msg(check_msg->obs[2].lock == 34232, "incorrect value for obs[2].lock, expected 34232, is %d", check_msg->obs[2].lock); - ck_assert_msg(check_msg->obs[2].prn == 13, "incorrect value for obs[2].prn, expected 13, is %d", check_msg->obs[2].prn); - ck_assert_msg(check_msg->obs[3].L.f == 237, "incorrect value for obs[3].L.f, expected 237, is %d", check_msg->obs[3].L.f); - ck_assert_msg(check_msg->obs[3].L.i == 138026, "incorrect value for obs[3].L.i, expected 138026, is %d", check_msg->obs[3].L.i); - ck_assert_msg(check_msg->obs[3].P == 2259826078, "incorrect value for obs[3].P, expected 2259826078, is %d", check_msg->obs[3].P); - ck_assert_msg(check_msg->obs[3].cn0 == 30, "incorrect value for obs[3].cn0, expected 30, is %d", check_msg->obs[3].cn0); - ck_assert_msg(check_msg->obs[3].lock == 24609, "incorrect value for obs[3].lock, expected 24609, is %d", check_msg->obs[3].lock); - ck_assert_msg(check_msg->obs[3].prn == 22, "incorrect value for obs[3].prn, expected 22, is %d", check_msg->obs[3].prn); - ck_assert_msg(check_msg->obs[4].L.f == 45, "incorrect value for obs[4].L.f, expected 45, is %d", check_msg->obs[4].L.f); - ck_assert_msg(check_msg->obs[4].L.i == -36952, "incorrect value for obs[4].L.i, expected -36952, is %d", check_msg->obs[4].L.i); - ck_assert_msg(check_msg->obs[4].P == 1985368870, "incorrect value for obs[4].P, expected 1985368870, is %d", check_msg->obs[4].P); - ck_assert_msg(check_msg->obs[4].cn0 == 56, "incorrect value for obs[4].cn0, expected 56, is %d", check_msg->obs[4].cn0); - ck_assert_msg(check_msg->obs[4].lock == 22736, "incorrect value for obs[4].lock, expected 22736, is %d", check_msg->obs[4].lock); - ck_assert_msg(check_msg->obs[4].prn == 30, "incorrect value for obs[4].prn, expected 30, is %d", check_msg->obs[4].prn); + ck_assert_msg(check_msg->header.n_obs == 16, + "incorrect value for header.n_obs, expected 16, is %d", + check_msg->header.n_obs); + ck_assert_msg(check_msg->header.t.tow == 407151400, + "incorrect value for header.t.tow, expected 407151400, is %d", + check_msg->header.t.tow); + ck_assert_msg(check_msg->header.t.wn == 1838, + "incorrect value for header.t.wn, expected 1838, is %d", + check_msg->header.t.wn); + ck_assert_msg(check_msg->obs[0].L.f == 1, + "incorrect value for obs[0].L.f, expected 1, is %d", + check_msg->obs[0].L.f); + ck_assert_msg(check_msg->obs[0].L.i == -27634, + "incorrect value for obs[0].L.i, expected -27634, is %d", + check_msg->obs[0].L.i); + ck_assert_msg(check_msg->obs[0].P == 2044291972, + "incorrect value for obs[0].P, expected 2044291972, is %d", + check_msg->obs[0].P); + ck_assert_msg(check_msg->obs[0].cn0 == 44, + "incorrect value for obs[0].cn0, expected 44, is %d", + check_msg->obs[0].cn0); + ck_assert_msg(check_msg->obs[0].lock == 37807, + "incorrect value for obs[0].lock, expected 37807, is %d", + check_msg->obs[0].lock); + ck_assert_msg(check_msg->obs[0].prn == 0, + "incorrect value for obs[0].prn, expected 0, is %d", + check_msg->obs[0].prn); + ck_assert_msg(check_msg->obs[1].L.f == 153, + "incorrect value for obs[1].L.f, expected 153, is %d", + check_msg->obs[1].L.f); + ck_assert_msg(check_msg->obs[1].L.i == -123500, + "incorrect value for obs[1].L.i, expected -123500, is %d", + check_msg->obs[1].L.i); + ck_assert_msg(check_msg->obs[1].P == 2110276225, + "incorrect value for obs[1].P, expected 2110276225, is %d", + check_msg->obs[1].P); + ck_assert_msg(check_msg->obs[1].cn0 == 41, + "incorrect value for obs[1].cn0, expected 41, is %d", + check_msg->obs[1].cn0); + ck_assert_msg(check_msg->obs[1].lock == 45326, + "incorrect value for obs[1].lock, expected 45326, is %d", + check_msg->obs[1].lock); + ck_assert_msg(check_msg->obs[1].prn == 3, + "incorrect value for obs[1].prn, expected 3, is %d", + check_msg->obs[1].prn); + ck_assert_msg(check_msg->obs[2].L.f == 222, + "incorrect value for obs[2].L.f, expected 222, is %d", + check_msg->obs[2].L.f); + ck_assert_msg(check_msg->obs[2].L.i == -114033, + "incorrect value for obs[2].L.i, expected -114033, is %d", + check_msg->obs[2].L.i); + ck_assert_msg(check_msg->obs[2].P == 2298000000, + "incorrect value for obs[2].P, expected 2298000000, is %d", + check_msg->obs[2].P); + ck_assert_msg(check_msg->obs[2].cn0 == 18, + "incorrect value for obs[2].cn0, expected 18, is %d", + check_msg->obs[2].cn0); + ck_assert_msg(check_msg->obs[2].lock == 34232, + "incorrect value for obs[2].lock, expected 34232, is %d", + check_msg->obs[2].lock); + ck_assert_msg(check_msg->obs[2].prn == 13, + "incorrect value for obs[2].prn, expected 13, is %d", + check_msg->obs[2].prn); + ck_assert_msg(check_msg->obs[3].L.f == 237, + "incorrect value for obs[3].L.f, expected 237, is %d", + check_msg->obs[3].L.f); + ck_assert_msg(check_msg->obs[3].L.i == 138026, + "incorrect value for obs[3].L.i, expected 138026, is %d", + check_msg->obs[3].L.i); + ck_assert_msg(check_msg->obs[3].P == 2259826078, + "incorrect value for obs[3].P, expected 2259826078, is %d", + check_msg->obs[3].P); + ck_assert_msg(check_msg->obs[3].cn0 == 30, + "incorrect value for obs[3].cn0, expected 30, is %d", + check_msg->obs[3].cn0); + ck_assert_msg(check_msg->obs[3].lock == 24609, + "incorrect value for obs[3].lock, expected 24609, is %d", + check_msg->obs[3].lock); + ck_assert_msg(check_msg->obs[3].prn == 22, + "incorrect value for obs[3].prn, expected 22, is %d", + check_msg->obs[3].prn); + ck_assert_msg(check_msg->obs[4].L.f == 45, + "incorrect value for obs[4].L.f, expected 45, is %d", + check_msg->obs[4].L.f); + ck_assert_msg(check_msg->obs[4].L.i == -36952, + "incorrect value for obs[4].L.i, expected -36952, is %d", + check_msg->obs[4].L.i); + ck_assert_msg(check_msg->obs[4].P == 1985368870, + "incorrect value for obs[4].P, expected 1985368870, is %d", + check_msg->obs[4].P); + ck_assert_msg(check_msg->obs[4].cn0 == 56, + "incorrect value for obs[4].cn0, expected 56, is %d", + check_msg->obs[4].cn0); + ck_assert_msg(check_msg->obs[4].lock == 22736, + "incorrect value for obs[4].lock, expected 22736, is %d", + check_msg->obs[4].lock); + ck_assert_msg(check_msg->obs[4].prn == 30, + "incorrect value for obs[4].prn, expected 30, is %d", + check_msg->obs[4].prn); } } END_TEST -Suite* legacy_auto_check_sbp_observation_msgObsDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_observation_msgObsDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_observation_msgObsDepA"); +Suite* legacy_auto_check_sbp_observation_msgObsDepA_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_observation_msgObsDepA"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_observation_msgObsDepA"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_observation_msgObsDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_orientation_MsgAngularRate.c b/c/test/legacy/auto_check_sbp_orientation_MsgAngularRate.c index 08706669e..a1d390728 100644 --- a/c/test/legacy/auto_check_sbp_orientation_MsgAngularRate.c +++ b/c/test/legacy/auto_check_sbp_orientation_MsgAngularRate.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgAngularRate.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgAngularRate.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_orientation_MsgAngularRate ) -{ +START_TEST(test_legacy_auto_check_sbp_orientation_MsgAngularRate) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_orientation_MsgAngularRate ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,84 +128,104 @@ START_TEST( test_legacy_auto_check_sbp_orientation_MsgAngularRate ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x222, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x222, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x222, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x222, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,34,2,66,0,17,2,0,0,0,2,0,0,0,5,0,0,0,2,0,0,0,0,88,70, }; + u8 encoded_frame[] = { + 85, 34, 2, 66, 0, 17, 2, 0, 0, 0, 2, 0, 0, + 0, 5, 0, 0, 0, 2, 0, 0, 0, 0, 88, 70, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_angular_rate_t* test_msg = ( msg_angular_rate_t* )test_msg_storage; + msg_angular_rate_t *test_msg = (msg_angular_rate_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->tow = 2; test_msg->x = 2; test_msg->y = 5; test_msg->z = 2; - sbp_payload_send(&sbp_state, 0x222, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x222, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x222, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_angular_rate_t* check_msg = ( msg_angular_rate_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_angular_rate_t *check_msg = + (msg_angular_rate_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->tow == 2, "incorrect value for tow, expected 2, is %d", check_msg->tow); - ck_assert_msg(check_msg->x == 2, "incorrect value for x, expected 2, is %d", check_msg->x); - ck_assert_msg(check_msg->y == 5, "incorrect value for y, expected 5, is %d", check_msg->y); - ck_assert_msg(check_msg->z == 2, "incorrect value for z, expected 2, is %d", check_msg->z); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->tow == 2, + "incorrect value for tow, expected 2, is %d", check_msg->tow); + ck_assert_msg(check_msg->x == 2, "incorrect value for x, expected 2, is %d", + check_msg->x); + ck_assert_msg(check_msg->y == 5, "incorrect value for y, expected 5, is %d", + check_msg->y); + ck_assert_msg(check_msg->z == 2, "incorrect value for z, expected 2, is %d", + check_msg->z); } } END_TEST -Suite* legacy_auto_check_sbp_orientation_MsgAngularRate_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_orientation_MsgAngularRate"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_orientation_MsgAngularRate"); +Suite *legacy_auto_check_sbp_orientation_MsgAngularRate_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_orientation_MsgAngularRate"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_orientation_MsgAngularRate"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_orientation_MsgAngularRate); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_orientation_MsgBaselineHeading.c b/c/test/legacy/auto_check_sbp_orientation_MsgBaselineHeading.c index 3349d4f69..49eac1215 100644 --- a/c/test/legacy/auto_check_sbp_orientation_MsgBaselineHeading.c +++ b/c/test/legacy/auto_check_sbp_orientation_MsgBaselineHeading.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgBaselineHeading.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgBaselineHeading.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_orientation_MsgBaselineHeading ) -{ +START_TEST(test_legacy_auto_check_sbp_orientation_MsgBaselineHeading) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_orientation_MsgBaselineHeading ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,83 +128,107 @@ START_TEST( test_legacy_auto_check_sbp_orientation_MsgBaselineHeading ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x20f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x20f, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x20f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x20f, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,15,2,211,93,10,156,45,13,196,44,84,197,61,91,91,224,254, }; + u8 encoded_frame[] = { + 85, 15, 2, 211, 93, 10, 156, 45, 13, + 196, 44, 84, 197, 61, 91, 91, 224, 254, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_baseline_heading_t* test_msg = ( msg_baseline_heading_t* )test_msg_storage; + msg_baseline_heading_t *test_msg = + (msg_baseline_heading_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 91; test_msg->heading = 1036342316; test_msg->n_sats = 91; test_msg->tow = 3289197980; - sbp_payload_send(&sbp_state, 0x20f, 24019, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x20f, 24019, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 24019, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 24019, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x20f, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_baseline_heading_t* check_msg = ( msg_baseline_heading_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_baseline_heading_t *check_msg = + (msg_baseline_heading_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 91, "incorrect value for flags, expected 91, is %d", check_msg->flags); - ck_assert_msg(check_msg->heading == 1036342316, "incorrect value for heading, expected 1036342316, is %d", check_msg->heading); - ck_assert_msg(check_msg->n_sats == 91, "incorrect value for n_sats, expected 91, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->tow == 3289197980, "incorrect value for tow, expected 3289197980, is %d", check_msg->tow); + ck_assert_msg(check_msg->flags == 91, + "incorrect value for flags, expected 91, is %d", + check_msg->flags); + ck_assert_msg(check_msg->heading == 1036342316, + "incorrect value for heading, expected 1036342316, is %d", + check_msg->heading); + ck_assert_msg(check_msg->n_sats == 91, + "incorrect value for n_sats, expected 91, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->tow == 3289197980, + "incorrect value for tow, expected 3289197980, is %d", + check_msg->tow); } } END_TEST -Suite* legacy_auto_check_sbp_orientation_MsgBaselineHeading_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_orientation_MsgBaselineHeading"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_orientation_MsgBaselineHeading"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_orientation_MsgBaselineHeading); +Suite *legacy_auto_check_sbp_orientation_MsgBaselineHeading_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_orientation_MsgBaselineHeading"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_orientation_MsgBaselineHeading"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_orientation_MsgBaselineHeading); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_orientation_MsgOrientEuler.c b/c/test/legacy/auto_check_sbp_orientation_MsgOrientEuler.c index e7a7cda68..b8f857d2c 100644 --- a/c/test/legacy/auto_check_sbp_orientation_MsgOrientEuler.c +++ b/c/test/legacy/auto_check_sbp_orientation_MsgOrientEuler.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientEuler.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientEuler.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_orientation_MsgOrientEuler ) -{ +START_TEST(test_legacy_auto_check_sbp_orientation_MsgOrientEuler) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_orientation_MsgOrientEuler ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_orientation_MsgOrientEuler ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x221, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x221, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x221, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x221, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,33,2,66,0,29,1,0,0,0,1,0,0,0,2,0,0,0,8,0,0,0,0,0,224,64,0,0,64,64,0,0,224,64,3,44,226, }; + u8 encoded_frame[] = { + 85, 33, 2, 66, 0, 29, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 8, + 0, 0, 0, 0, 0, 224, 64, 0, 0, 64, 64, 0, 0, 224, 64, 3, 44, 226, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_orient_euler_t* test_msg = ( msg_orient_euler_t* )test_msg_storage; + msg_orient_euler_t *test_msg = (msg_orient_euler_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 3; test_msg->pitch = 2; @@ -151,70 +153,93 @@ START_TEST( test_legacy_auto_check_sbp_orientation_MsgOrientEuler ) test_msg->tow = 1; test_msg->yaw = 8; test_msg->yaw_accuracy = 7.0; - sbp_payload_send(&sbp_state, 0x221, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x221, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x221, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_orient_euler_t* check_msg = ( msg_orient_euler_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_orient_euler_t *check_msg = + (msg_orient_euler_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 3, "incorrect value for flags, expected 3, is %d", check_msg->flags); - ck_assert_msg(check_msg->pitch == 2, "incorrect value for pitch, expected 2, is %d", check_msg->pitch); - ck_assert_msg((check_msg->pitch_accuracy*100 - 3.0*100) < 0.05, "incorrect value for pitch_accuracy, expected 3.0, is %f", check_msg->pitch_accuracy); - ck_assert_msg(check_msg->roll == 1, "incorrect value for roll, expected 1, is %d", check_msg->roll); - ck_assert_msg((check_msg->roll_accuracy*100 - 7.0*100) < 0.05, "incorrect value for roll_accuracy, expected 7.0, is %f", check_msg->roll_accuracy); - ck_assert_msg(check_msg->tow == 1, "incorrect value for tow, expected 1, is %d", check_msg->tow); - ck_assert_msg(check_msg->yaw == 8, "incorrect value for yaw, expected 8, is %d", check_msg->yaw); - ck_assert_msg((check_msg->yaw_accuracy*100 - 7.0*100) < 0.05, "incorrect value for yaw_accuracy, expected 7.0, is %f", check_msg->yaw_accuracy); + ck_assert_msg(check_msg->flags == 3, + "incorrect value for flags, expected 3, is %d", + check_msg->flags); + ck_assert_msg(check_msg->pitch == 2, + "incorrect value for pitch, expected 2, is %d", + check_msg->pitch); + ck_assert_msg((check_msg->pitch_accuracy * 100 - 3.0 * 100) < 0.05, + "incorrect value for pitch_accuracy, expected 3.0, is %f", + check_msg->pitch_accuracy); + ck_assert_msg(check_msg->roll == 1, + "incorrect value for roll, expected 1, is %d", + check_msg->roll); + ck_assert_msg((check_msg->roll_accuracy * 100 - 7.0 * 100) < 0.05, + "incorrect value for roll_accuracy, expected 7.0, is %f", + check_msg->roll_accuracy); + ck_assert_msg(check_msg->tow == 1, + "incorrect value for tow, expected 1, is %d", check_msg->tow); + ck_assert_msg(check_msg->yaw == 8, + "incorrect value for yaw, expected 8, is %d", check_msg->yaw); + ck_assert_msg((check_msg->yaw_accuracy * 100 - 7.0 * 100) < 0.05, + "incorrect value for yaw_accuracy, expected 7.0, is %f", + check_msg->yaw_accuracy); } } END_TEST -Suite* legacy_auto_check_sbp_orientation_MsgOrientEuler_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_orientation_MsgOrientEuler"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_orientation_MsgOrientEuler"); +Suite *legacy_auto_check_sbp_orientation_MsgOrientEuler_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_orientation_MsgOrientEuler"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_orientation_MsgOrientEuler"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_orientation_MsgOrientEuler); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_orientation_MsgOrientQuat.c b/c/test/legacy/auto_check_sbp_orientation_MsgOrientQuat.c index e3e651891..bd44beb0f 100644 --- a/c/test/legacy/auto_check_sbp_orientation_MsgOrientQuat.c +++ b/c/test/legacy/auto_check_sbp_orientation_MsgOrientQuat.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientQuat.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientQuat.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_orientation_MsgOrientQuat ) -{ +START_TEST(test_legacy_auto_check_sbp_orientation_MsgOrientQuat) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_orientation_MsgOrientQuat ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_orientation_MsgOrientQuat ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x220, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x220, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x220, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x220, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,32,2,66,0,37,0,0,0,0,3,0,0,0,7,0,0,0,8,0,0,0,4,0,0,0,0,0,64,64,0,0,128,64,0,0,0,65,0,0,64,64,1,186,6, }; + u8 encoded_frame[] = { + 85, 32, 2, 66, 0, 37, 0, 0, 0, 0, 3, 0, 0, 0, 7, + 0, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0, 0, 0, 64, 64, + 0, 0, 128, 64, 0, 0, 0, 65, 0, 0, 64, 64, 1, 186, 6, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_orient_quat_t* test_msg = ( msg_orient_quat_t* )test_msg_storage; + msg_orient_quat_t *test_msg = (msg_orient_quat_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 1; test_msg->tow = 0; @@ -153,72 +156,95 @@ START_TEST( test_legacy_auto_check_sbp_orientation_MsgOrientQuat ) test_msg->y_accuracy = 8.0; test_msg->z = 4; test_msg->z_accuracy = 3.0; - sbp_payload_send(&sbp_state, 0x220, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x220, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x220, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_orient_quat_t* check_msg = ( msg_orient_quat_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_orient_quat_t *check_msg = (msg_orient_quat_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->tow == 0, "incorrect value for tow, expected 0, is %d", check_msg->tow); - ck_assert_msg(check_msg->w == 3, "incorrect value for w, expected 3, is %d", check_msg->w); - ck_assert_msg((check_msg->w_accuracy*100 - 3.0*100) < 0.05, "incorrect value for w_accuracy, expected 3.0, is %f", check_msg->w_accuracy); - ck_assert_msg(check_msg->x == 7, "incorrect value for x, expected 7, is %d", check_msg->x); - ck_assert_msg((check_msg->x_accuracy*100 - 4.0*100) < 0.05, "incorrect value for x_accuracy, expected 4.0, is %f", check_msg->x_accuracy); - ck_assert_msg(check_msg->y == 8, "incorrect value for y, expected 8, is %d", check_msg->y); - ck_assert_msg((check_msg->y_accuracy*100 - 8.0*100) < 0.05, "incorrect value for y_accuracy, expected 8.0, is %f", check_msg->y_accuracy); - ck_assert_msg(check_msg->z == 4, "incorrect value for z, expected 4, is %d", check_msg->z); - ck_assert_msg((check_msg->z_accuracy*100 - 3.0*100) < 0.05, "incorrect value for z_accuracy, expected 3.0, is %f", check_msg->z_accuracy); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->tow == 0, + "incorrect value for tow, expected 0, is %d", check_msg->tow); + ck_assert_msg(check_msg->w == 3, "incorrect value for w, expected 3, is %d", + check_msg->w); + ck_assert_msg((check_msg->w_accuracy * 100 - 3.0 * 100) < 0.05, + "incorrect value for w_accuracy, expected 3.0, is %f", + check_msg->w_accuracy); + ck_assert_msg(check_msg->x == 7, "incorrect value for x, expected 7, is %d", + check_msg->x); + ck_assert_msg((check_msg->x_accuracy * 100 - 4.0 * 100) < 0.05, + "incorrect value for x_accuracy, expected 4.0, is %f", + check_msg->x_accuracy); + ck_assert_msg(check_msg->y == 8, "incorrect value for y, expected 8, is %d", + check_msg->y); + ck_assert_msg((check_msg->y_accuracy * 100 - 8.0 * 100) < 0.05, + "incorrect value for y_accuracy, expected 8.0, is %f", + check_msg->y_accuracy); + ck_assert_msg(check_msg->z == 4, "incorrect value for z, expected 4, is %d", + check_msg->z); + ck_assert_msg((check_msg->z_accuracy * 100 - 3.0 * 100) < 0.05, + "incorrect value for z_accuracy, expected 3.0, is %f", + check_msg->z_accuracy); } } END_TEST -Suite* legacy_auto_check_sbp_orientation_MsgOrientQuat_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_orientation_MsgOrientQuat"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_orientation_MsgOrientQuat"); +Suite *legacy_auto_check_sbp_orientation_MsgOrientQuat_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_orientation_MsgOrientQuat"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_orientation_MsgOrientQuat"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_orientation_MsgOrientQuat); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgAlmanac.c b/c/test/legacy/auto_check_sbp_piksi_MsgAlmanac.c index 0ef731623..eb1ffe7ab 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgAlmanac.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgAlmanac.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgAlmanac.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgAlmanac.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgAlmanac ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgAlmanac) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgAlmanac ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,69 +128,80 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgAlmanac ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x69, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x69, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x69, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x69, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,105,0,108,138,0,249,171, }; + u8 encoded_frame[] = { + 85, 105, 0, 108, 138, 0, 249, 171, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - sbp_payload_send(&sbp_state, 0x69, 35436, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x69, 35436, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35436, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35436, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x69, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts + // Cast to expected message type - the +6 byte offset is where the payload + // starts } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgAlmanac_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgAlmanac"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgAlmanac"); +Suite *legacy_auto_check_sbp_piksi_MsgAlmanac_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgAlmanac"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgAlmanac"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgAlmanac); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgCellModemStatus.c b/c/test/legacy/auto_check_sbp_piksi_MsgCellModemStatus.c index 1d8061d9d..9ff218bea 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgCellModemStatus.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgCellModemStatus.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCellModemStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCellModemStatus.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgCellModemStatus ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgCellModemStatus) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgCellModemStatus ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,40 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgCellModemStatus ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xbe, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xbe, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xbe, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xbe, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,190,0,19,27,255,103,205,48,6,70,123,242,46,52,64,176,154,98,43,132,196,89,253,161,250,174,204,110,47,38,187,63,102,177,162,49,80,194,37,107,60,225,52,101,178,142,246,21,17,93,75,169,86,16,209,80,243,30,206,220,206,115,47,154,91,227,88,11,1,85,146,100,190,232,207,61,61,201,220,31,78,34,57,82,59,104,65,221,0,43,210,9,32,122,29,237,11,151,223,18,81,204,172,234,127,3,82,133,169,12,176,193,0,24,121,85,55,214,198,75,234,179,214,85,94,115,21,73,121,75,46,158,63,100,122,213,20,85,212,131,50,224,218,215,215,149,2,19,129,39,164,5,175,6,62,51,78,66,248,116,88,90,128,226,177,0,47,140,33,126,221,110,144,97,74,250,181,199,27,176,65,185,110,92,34,44,131,96,178,40,176,4,90,36,7,180,244,244,23,108,171,204,196,61,51,179,242,156,81,83,16,15,134,40,245,253,150,94,150,144,197,113,5,141,232,33,101,231,38,75,178,243,119,1,248,218,86,7,88,197,148,240,227,2,65,173,122,143,251,156,217,67,239,219,31,224,176,129,81,80,40,230, }; + u8 encoded_frame[] = { + 85, 190, 0, 19, 27, 255, 103, 205, 48, 6, 70, 123, 242, 46, + 52, 64, 176, 154, 98, 43, 132, 196, 89, 253, 161, 250, 174, 204, + 110, 47, 38, 187, 63, 102, 177, 162, 49, 80, 194, 37, 107, 60, + 225, 52, 101, 178, 142, 246, 21, 17, 93, 75, 169, 86, 16, 209, + 80, 243, 30, 206, 220, 206, 115, 47, 154, 91, 227, 88, 11, 1, + 85, 146, 100, 190, 232, 207, 61, 61, 201, 220, 31, 78, 34, 57, + 82, 59, 104, 65, 221, 0, 43, 210, 9, 32, 122, 29, 237, 11, + 151, 223, 18, 81, 204, 172, 234, 127, 3, 82, 133, 169, 12, 176, + 193, 0, 24, 121, 85, 55, 214, 198, 75, 234, 179, 214, 85, 94, + 115, 21, 73, 121, 75, 46, 158, 63, 100, 122, 213, 20, 85, 212, + 131, 50, 224, 218, 215, 215, 149, 2, 19, 129, 39, 164, 5, 175, + 6, 62, 51, 78, 66, 248, 116, 88, 90, 128, 226, 177, 0, 47, + 140, 33, 126, 221, 110, 144, 97, 74, 250, 181, 199, 27, 176, 65, + 185, 110, 92, 34, 44, 131, 96, 178, 40, 176, 4, 90, 36, 7, + 180, 244, 244, 23, 108, 171, 204, 196, 61, 51, 179, 242, 156, 81, + 83, 16, 15, 134, 40, 245, 253, 150, 94, 150, 144, 197, 113, 5, + 141, 232, 33, 101, 231, 38, 75, 178, 243, 119, 1, 248, 218, 86, + 7, 88, 197, 148, 240, 227, 2, 65, 173, 122, 143, 251, 156, 217, + 67, 239, 219, 31, 224, 176, 129, 81, 80, 40, 230, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_cell_modem_status_t* test_msg = ( msg_cell_modem_status_t* )test_msg_storage; + msg_cell_modem_status_t *test_msg = + (msg_cell_modem_status_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->reserved) == 0) { // Cope with variable length arrays @@ -1395,314 +1415,828 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgCellModemStatus ) test_msg->reserved[249] = 80; test_msg->signal_error_rate = 8588.2001953125; test_msg->signal_strength = 103; - sbp_payload_send(&sbp_state, 0xbe, 6931, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xbe, 6931, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 6931, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 6931, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xbe, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_cell_modem_status_t* check_msg = ( msg_cell_modem_status_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_cell_modem_status_t *check_msg = + (msg_cell_modem_status_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->reserved[0] == 123, "incorrect value for reserved[0], expected 123, is %d", check_msg->reserved[0]); - ck_assert_msg(check_msg->reserved[1] == 242, "incorrect value for reserved[1], expected 242, is %d", check_msg->reserved[1]); - ck_assert_msg(check_msg->reserved[2] == 46, "incorrect value for reserved[2], expected 46, is %d", check_msg->reserved[2]); - ck_assert_msg(check_msg->reserved[3] == 52, "incorrect value for reserved[3], expected 52, is %d", check_msg->reserved[3]); - ck_assert_msg(check_msg->reserved[4] == 64, "incorrect value for reserved[4], expected 64, is %d", check_msg->reserved[4]); - ck_assert_msg(check_msg->reserved[5] == 176, "incorrect value for reserved[5], expected 176, is %d", check_msg->reserved[5]); - ck_assert_msg(check_msg->reserved[6] == 154, "incorrect value for reserved[6], expected 154, is %d", check_msg->reserved[6]); - ck_assert_msg(check_msg->reserved[7] == 98, "incorrect value for reserved[7], expected 98, is %d", check_msg->reserved[7]); - ck_assert_msg(check_msg->reserved[8] == 43, "incorrect value for reserved[8], expected 43, is %d", check_msg->reserved[8]); - ck_assert_msg(check_msg->reserved[9] == 132, "incorrect value for reserved[9], expected 132, is %d", check_msg->reserved[9]); - ck_assert_msg(check_msg->reserved[10] == 196, "incorrect value for reserved[10], expected 196, is %d", check_msg->reserved[10]); - ck_assert_msg(check_msg->reserved[11] == 89, "incorrect value for reserved[11], expected 89, is %d", check_msg->reserved[11]); - ck_assert_msg(check_msg->reserved[12] == 253, "incorrect value for reserved[12], expected 253, is %d", check_msg->reserved[12]); - ck_assert_msg(check_msg->reserved[13] == 161, "incorrect value for reserved[13], expected 161, is %d", check_msg->reserved[13]); - ck_assert_msg(check_msg->reserved[14] == 250, "incorrect value for reserved[14], expected 250, is %d", check_msg->reserved[14]); - ck_assert_msg(check_msg->reserved[15] == 174, "incorrect value for reserved[15], expected 174, is %d", check_msg->reserved[15]); - ck_assert_msg(check_msg->reserved[16] == 204, "incorrect value for reserved[16], expected 204, is %d", check_msg->reserved[16]); - ck_assert_msg(check_msg->reserved[17] == 110, "incorrect value for reserved[17], expected 110, is %d", check_msg->reserved[17]); - ck_assert_msg(check_msg->reserved[18] == 47, "incorrect value for reserved[18], expected 47, is %d", check_msg->reserved[18]); - ck_assert_msg(check_msg->reserved[19] == 38, "incorrect value for reserved[19], expected 38, is %d", check_msg->reserved[19]); - ck_assert_msg(check_msg->reserved[20] == 187, "incorrect value for reserved[20], expected 187, is %d", check_msg->reserved[20]); - ck_assert_msg(check_msg->reserved[21] == 63, "incorrect value for reserved[21], expected 63, is %d", check_msg->reserved[21]); - ck_assert_msg(check_msg->reserved[22] == 102, "incorrect value for reserved[22], expected 102, is %d", check_msg->reserved[22]); - ck_assert_msg(check_msg->reserved[23] == 177, "incorrect value for reserved[23], expected 177, is %d", check_msg->reserved[23]); - ck_assert_msg(check_msg->reserved[24] == 162, "incorrect value for reserved[24], expected 162, is %d", check_msg->reserved[24]); - ck_assert_msg(check_msg->reserved[25] == 49, "incorrect value for reserved[25], expected 49, is %d", check_msg->reserved[25]); - ck_assert_msg(check_msg->reserved[26] == 80, "incorrect value for reserved[26], expected 80, is %d", check_msg->reserved[26]); - ck_assert_msg(check_msg->reserved[27] == 194, "incorrect value for reserved[27], expected 194, is %d", check_msg->reserved[27]); - ck_assert_msg(check_msg->reserved[28] == 37, "incorrect value for reserved[28], expected 37, is %d", check_msg->reserved[28]); - ck_assert_msg(check_msg->reserved[29] == 107, "incorrect value for reserved[29], expected 107, is %d", check_msg->reserved[29]); - ck_assert_msg(check_msg->reserved[30] == 60, "incorrect value for reserved[30], expected 60, is %d", check_msg->reserved[30]); - ck_assert_msg(check_msg->reserved[31] == 225, "incorrect value for reserved[31], expected 225, is %d", check_msg->reserved[31]); - ck_assert_msg(check_msg->reserved[32] == 52, "incorrect value for reserved[32], expected 52, is %d", check_msg->reserved[32]); - ck_assert_msg(check_msg->reserved[33] == 101, "incorrect value for reserved[33], expected 101, is %d", check_msg->reserved[33]); - ck_assert_msg(check_msg->reserved[34] == 178, "incorrect value for reserved[34], expected 178, is %d", check_msg->reserved[34]); - ck_assert_msg(check_msg->reserved[35] == 142, "incorrect value for reserved[35], expected 142, is %d", check_msg->reserved[35]); - ck_assert_msg(check_msg->reserved[36] == 246, "incorrect value for reserved[36], expected 246, is %d", check_msg->reserved[36]); - ck_assert_msg(check_msg->reserved[37] == 21, "incorrect value for reserved[37], expected 21, is %d", check_msg->reserved[37]); - ck_assert_msg(check_msg->reserved[38] == 17, "incorrect value for reserved[38], expected 17, is %d", check_msg->reserved[38]); - ck_assert_msg(check_msg->reserved[39] == 93, "incorrect value for reserved[39], expected 93, is %d", check_msg->reserved[39]); - ck_assert_msg(check_msg->reserved[40] == 75, "incorrect value for reserved[40], expected 75, is %d", check_msg->reserved[40]); - ck_assert_msg(check_msg->reserved[41] == 169, "incorrect value for reserved[41], expected 169, is %d", check_msg->reserved[41]); - ck_assert_msg(check_msg->reserved[42] == 86, "incorrect value for reserved[42], expected 86, is %d", check_msg->reserved[42]); - ck_assert_msg(check_msg->reserved[43] == 16, "incorrect value for reserved[43], expected 16, is %d", check_msg->reserved[43]); - ck_assert_msg(check_msg->reserved[44] == 209, "incorrect value for reserved[44], expected 209, is %d", check_msg->reserved[44]); - ck_assert_msg(check_msg->reserved[45] == 80, "incorrect value for reserved[45], expected 80, is %d", check_msg->reserved[45]); - ck_assert_msg(check_msg->reserved[46] == 243, "incorrect value for reserved[46], expected 243, is %d", check_msg->reserved[46]); - ck_assert_msg(check_msg->reserved[47] == 30, "incorrect value for reserved[47], expected 30, is %d", check_msg->reserved[47]); - ck_assert_msg(check_msg->reserved[48] == 206, "incorrect value for reserved[48], expected 206, is %d", check_msg->reserved[48]); - ck_assert_msg(check_msg->reserved[49] == 220, "incorrect value for reserved[49], expected 220, is %d", check_msg->reserved[49]); - ck_assert_msg(check_msg->reserved[50] == 206, "incorrect value for reserved[50], expected 206, is %d", check_msg->reserved[50]); - ck_assert_msg(check_msg->reserved[51] == 115, "incorrect value for reserved[51], expected 115, is %d", check_msg->reserved[51]); - ck_assert_msg(check_msg->reserved[52] == 47, "incorrect value for reserved[52], expected 47, is %d", check_msg->reserved[52]); - ck_assert_msg(check_msg->reserved[53] == 154, "incorrect value for reserved[53], expected 154, is %d", check_msg->reserved[53]); - ck_assert_msg(check_msg->reserved[54] == 91, "incorrect value for reserved[54], expected 91, is %d", check_msg->reserved[54]); - ck_assert_msg(check_msg->reserved[55] == 227, "incorrect value for reserved[55], expected 227, is %d", check_msg->reserved[55]); - ck_assert_msg(check_msg->reserved[56] == 88, "incorrect value for reserved[56], expected 88, is %d", check_msg->reserved[56]); - ck_assert_msg(check_msg->reserved[57] == 11, "incorrect value for reserved[57], expected 11, is %d", check_msg->reserved[57]); - ck_assert_msg(check_msg->reserved[58] == 1, "incorrect value for reserved[58], expected 1, is %d", check_msg->reserved[58]); - ck_assert_msg(check_msg->reserved[59] == 85, "incorrect value for reserved[59], expected 85, is %d", check_msg->reserved[59]); - ck_assert_msg(check_msg->reserved[60] == 146, "incorrect value for reserved[60], expected 146, is %d", check_msg->reserved[60]); - ck_assert_msg(check_msg->reserved[61] == 100, "incorrect value for reserved[61], expected 100, is %d", check_msg->reserved[61]); - ck_assert_msg(check_msg->reserved[62] == 190, "incorrect value for reserved[62], expected 190, is %d", check_msg->reserved[62]); - ck_assert_msg(check_msg->reserved[63] == 232, "incorrect value for reserved[63], expected 232, is %d", check_msg->reserved[63]); - ck_assert_msg(check_msg->reserved[64] == 207, "incorrect value for reserved[64], expected 207, is %d", check_msg->reserved[64]); - ck_assert_msg(check_msg->reserved[65] == 61, "incorrect value for reserved[65], expected 61, is %d", check_msg->reserved[65]); - ck_assert_msg(check_msg->reserved[66] == 61, "incorrect value for reserved[66], expected 61, is %d", check_msg->reserved[66]); - ck_assert_msg(check_msg->reserved[67] == 201, "incorrect value for reserved[67], expected 201, is %d", check_msg->reserved[67]); - ck_assert_msg(check_msg->reserved[68] == 220, "incorrect value for reserved[68], expected 220, is %d", check_msg->reserved[68]); - ck_assert_msg(check_msg->reserved[69] == 31, "incorrect value for reserved[69], expected 31, is %d", check_msg->reserved[69]); - ck_assert_msg(check_msg->reserved[70] == 78, "incorrect value for reserved[70], expected 78, is %d", check_msg->reserved[70]); - ck_assert_msg(check_msg->reserved[71] == 34, "incorrect value for reserved[71], expected 34, is %d", check_msg->reserved[71]); - ck_assert_msg(check_msg->reserved[72] == 57, "incorrect value for reserved[72], expected 57, is %d", check_msg->reserved[72]); - ck_assert_msg(check_msg->reserved[73] == 82, "incorrect value for reserved[73], expected 82, is %d", check_msg->reserved[73]); - ck_assert_msg(check_msg->reserved[74] == 59, "incorrect value for reserved[74], expected 59, is %d", check_msg->reserved[74]); - ck_assert_msg(check_msg->reserved[75] == 104, "incorrect value for reserved[75], expected 104, is %d", check_msg->reserved[75]); - ck_assert_msg(check_msg->reserved[76] == 65, "incorrect value for reserved[76], expected 65, is %d", check_msg->reserved[76]); - ck_assert_msg(check_msg->reserved[77] == 221, "incorrect value for reserved[77], expected 221, is %d", check_msg->reserved[77]); - ck_assert_msg(check_msg->reserved[78] == 0, "incorrect value for reserved[78], expected 0, is %d", check_msg->reserved[78]); - ck_assert_msg(check_msg->reserved[79] == 43, "incorrect value for reserved[79], expected 43, is %d", check_msg->reserved[79]); - ck_assert_msg(check_msg->reserved[80] == 210, "incorrect value for reserved[80], expected 210, is %d", check_msg->reserved[80]); - ck_assert_msg(check_msg->reserved[81] == 9, "incorrect value for reserved[81], expected 9, is %d", check_msg->reserved[81]); - ck_assert_msg(check_msg->reserved[82] == 32, "incorrect value for reserved[82], expected 32, is %d", check_msg->reserved[82]); - ck_assert_msg(check_msg->reserved[83] == 122, "incorrect value for reserved[83], expected 122, is %d", check_msg->reserved[83]); - ck_assert_msg(check_msg->reserved[84] == 29, "incorrect value for reserved[84], expected 29, is %d", check_msg->reserved[84]); - ck_assert_msg(check_msg->reserved[85] == 237, "incorrect value for reserved[85], expected 237, is %d", check_msg->reserved[85]); - ck_assert_msg(check_msg->reserved[86] == 11, "incorrect value for reserved[86], expected 11, is %d", check_msg->reserved[86]); - ck_assert_msg(check_msg->reserved[87] == 151, "incorrect value for reserved[87], expected 151, is %d", check_msg->reserved[87]); - ck_assert_msg(check_msg->reserved[88] == 223, "incorrect value for reserved[88], expected 223, is %d", check_msg->reserved[88]); - ck_assert_msg(check_msg->reserved[89] == 18, "incorrect value for reserved[89], expected 18, is %d", check_msg->reserved[89]); - ck_assert_msg(check_msg->reserved[90] == 81, "incorrect value for reserved[90], expected 81, is %d", check_msg->reserved[90]); - ck_assert_msg(check_msg->reserved[91] == 204, "incorrect value for reserved[91], expected 204, is %d", check_msg->reserved[91]); - ck_assert_msg(check_msg->reserved[92] == 172, "incorrect value for reserved[92], expected 172, is %d", check_msg->reserved[92]); - ck_assert_msg(check_msg->reserved[93] == 234, "incorrect value for reserved[93], expected 234, is %d", check_msg->reserved[93]); - ck_assert_msg(check_msg->reserved[94] == 127, "incorrect value for reserved[94], expected 127, is %d", check_msg->reserved[94]); - ck_assert_msg(check_msg->reserved[95] == 3, "incorrect value for reserved[95], expected 3, is %d", check_msg->reserved[95]); - ck_assert_msg(check_msg->reserved[96] == 82, "incorrect value for reserved[96], expected 82, is %d", check_msg->reserved[96]); - ck_assert_msg(check_msg->reserved[97] == 133, "incorrect value for reserved[97], expected 133, is %d", check_msg->reserved[97]); - ck_assert_msg(check_msg->reserved[98] == 169, "incorrect value for reserved[98], expected 169, is %d", check_msg->reserved[98]); - ck_assert_msg(check_msg->reserved[99] == 12, "incorrect value for reserved[99], expected 12, is %d", check_msg->reserved[99]); - ck_assert_msg(check_msg->reserved[100] == 176, "incorrect value for reserved[100], expected 176, is %d", check_msg->reserved[100]); - ck_assert_msg(check_msg->reserved[101] == 193, "incorrect value for reserved[101], expected 193, is %d", check_msg->reserved[101]); - ck_assert_msg(check_msg->reserved[102] == 0, "incorrect value for reserved[102], expected 0, is %d", check_msg->reserved[102]); - ck_assert_msg(check_msg->reserved[103] == 24, "incorrect value for reserved[103], expected 24, is %d", check_msg->reserved[103]); - ck_assert_msg(check_msg->reserved[104] == 121, "incorrect value for reserved[104], expected 121, is %d", check_msg->reserved[104]); - ck_assert_msg(check_msg->reserved[105] == 85, "incorrect value for reserved[105], expected 85, is %d", check_msg->reserved[105]); - ck_assert_msg(check_msg->reserved[106] == 55, "incorrect value for reserved[106], expected 55, is %d", check_msg->reserved[106]); - ck_assert_msg(check_msg->reserved[107] == 214, "incorrect value for reserved[107], expected 214, is %d", check_msg->reserved[107]); - ck_assert_msg(check_msg->reserved[108] == 198, "incorrect value for reserved[108], expected 198, is %d", check_msg->reserved[108]); - ck_assert_msg(check_msg->reserved[109] == 75, "incorrect value for reserved[109], expected 75, is %d", check_msg->reserved[109]); - ck_assert_msg(check_msg->reserved[110] == 234, "incorrect value for reserved[110], expected 234, is %d", check_msg->reserved[110]); - ck_assert_msg(check_msg->reserved[111] == 179, "incorrect value for reserved[111], expected 179, is %d", check_msg->reserved[111]); - ck_assert_msg(check_msg->reserved[112] == 214, "incorrect value for reserved[112], expected 214, is %d", check_msg->reserved[112]); - ck_assert_msg(check_msg->reserved[113] == 85, "incorrect value for reserved[113], expected 85, is %d", check_msg->reserved[113]); - ck_assert_msg(check_msg->reserved[114] == 94, "incorrect value for reserved[114], expected 94, is %d", check_msg->reserved[114]); - ck_assert_msg(check_msg->reserved[115] == 115, "incorrect value for reserved[115], expected 115, is %d", check_msg->reserved[115]); - ck_assert_msg(check_msg->reserved[116] == 21, "incorrect value for reserved[116], expected 21, is %d", check_msg->reserved[116]); - ck_assert_msg(check_msg->reserved[117] == 73, "incorrect value for reserved[117], expected 73, is %d", check_msg->reserved[117]); - ck_assert_msg(check_msg->reserved[118] == 121, "incorrect value for reserved[118], expected 121, is %d", check_msg->reserved[118]); - ck_assert_msg(check_msg->reserved[119] == 75, "incorrect value for reserved[119], expected 75, is %d", check_msg->reserved[119]); - ck_assert_msg(check_msg->reserved[120] == 46, "incorrect value for reserved[120], expected 46, is %d", check_msg->reserved[120]); - ck_assert_msg(check_msg->reserved[121] == 158, "incorrect value for reserved[121], expected 158, is %d", check_msg->reserved[121]); - ck_assert_msg(check_msg->reserved[122] == 63, "incorrect value for reserved[122], expected 63, is %d", check_msg->reserved[122]); - ck_assert_msg(check_msg->reserved[123] == 100, "incorrect value for reserved[123], expected 100, is %d", check_msg->reserved[123]); - ck_assert_msg(check_msg->reserved[124] == 122, "incorrect value for reserved[124], expected 122, is %d", check_msg->reserved[124]); - ck_assert_msg(check_msg->reserved[125] == 213, "incorrect value for reserved[125], expected 213, is %d", check_msg->reserved[125]); - ck_assert_msg(check_msg->reserved[126] == 20, "incorrect value for reserved[126], expected 20, is %d", check_msg->reserved[126]); - ck_assert_msg(check_msg->reserved[127] == 85, "incorrect value for reserved[127], expected 85, is %d", check_msg->reserved[127]); - ck_assert_msg(check_msg->reserved[128] == 212, "incorrect value for reserved[128], expected 212, is %d", check_msg->reserved[128]); - ck_assert_msg(check_msg->reserved[129] == 131, "incorrect value for reserved[129], expected 131, is %d", check_msg->reserved[129]); - ck_assert_msg(check_msg->reserved[130] == 50, "incorrect value for reserved[130], expected 50, is %d", check_msg->reserved[130]); - ck_assert_msg(check_msg->reserved[131] == 224, "incorrect value for reserved[131], expected 224, is %d", check_msg->reserved[131]); - ck_assert_msg(check_msg->reserved[132] == 218, "incorrect value for reserved[132], expected 218, is %d", check_msg->reserved[132]); - ck_assert_msg(check_msg->reserved[133] == 215, "incorrect value for reserved[133], expected 215, is %d", check_msg->reserved[133]); - ck_assert_msg(check_msg->reserved[134] == 215, "incorrect value for reserved[134], expected 215, is %d", check_msg->reserved[134]); - ck_assert_msg(check_msg->reserved[135] == 149, "incorrect value for reserved[135], expected 149, is %d", check_msg->reserved[135]); - ck_assert_msg(check_msg->reserved[136] == 2, "incorrect value for reserved[136], expected 2, is %d", check_msg->reserved[136]); - ck_assert_msg(check_msg->reserved[137] == 19, "incorrect value for reserved[137], expected 19, is %d", check_msg->reserved[137]); - ck_assert_msg(check_msg->reserved[138] == 129, "incorrect value for reserved[138], expected 129, is %d", check_msg->reserved[138]); - ck_assert_msg(check_msg->reserved[139] == 39, "incorrect value for reserved[139], expected 39, is %d", check_msg->reserved[139]); - ck_assert_msg(check_msg->reserved[140] == 164, "incorrect value for reserved[140], expected 164, is %d", check_msg->reserved[140]); - ck_assert_msg(check_msg->reserved[141] == 5, "incorrect value for reserved[141], expected 5, is %d", check_msg->reserved[141]); - ck_assert_msg(check_msg->reserved[142] == 175, "incorrect value for reserved[142], expected 175, is %d", check_msg->reserved[142]); - ck_assert_msg(check_msg->reserved[143] == 6, "incorrect value for reserved[143], expected 6, is %d", check_msg->reserved[143]); - ck_assert_msg(check_msg->reserved[144] == 62, "incorrect value for reserved[144], expected 62, is %d", check_msg->reserved[144]); - ck_assert_msg(check_msg->reserved[145] == 51, "incorrect value for reserved[145], expected 51, is %d", check_msg->reserved[145]); - ck_assert_msg(check_msg->reserved[146] == 78, "incorrect value for reserved[146], expected 78, is %d", check_msg->reserved[146]); - ck_assert_msg(check_msg->reserved[147] == 66, "incorrect value for reserved[147], expected 66, is %d", check_msg->reserved[147]); - ck_assert_msg(check_msg->reserved[148] == 248, "incorrect value for reserved[148], expected 248, is %d", check_msg->reserved[148]); - ck_assert_msg(check_msg->reserved[149] == 116, "incorrect value for reserved[149], expected 116, is %d", check_msg->reserved[149]); - ck_assert_msg(check_msg->reserved[150] == 88, "incorrect value for reserved[150], expected 88, is %d", check_msg->reserved[150]); - ck_assert_msg(check_msg->reserved[151] == 90, "incorrect value for reserved[151], expected 90, is %d", check_msg->reserved[151]); - ck_assert_msg(check_msg->reserved[152] == 128, "incorrect value for reserved[152], expected 128, is %d", check_msg->reserved[152]); - ck_assert_msg(check_msg->reserved[153] == 226, "incorrect value for reserved[153], expected 226, is %d", check_msg->reserved[153]); - ck_assert_msg(check_msg->reserved[154] == 177, "incorrect value for reserved[154], expected 177, is %d", check_msg->reserved[154]); - ck_assert_msg(check_msg->reserved[155] == 0, "incorrect value for reserved[155], expected 0, is %d", check_msg->reserved[155]); - ck_assert_msg(check_msg->reserved[156] == 47, "incorrect value for reserved[156], expected 47, is %d", check_msg->reserved[156]); - ck_assert_msg(check_msg->reserved[157] == 140, "incorrect value for reserved[157], expected 140, is %d", check_msg->reserved[157]); - ck_assert_msg(check_msg->reserved[158] == 33, "incorrect value for reserved[158], expected 33, is %d", check_msg->reserved[158]); - ck_assert_msg(check_msg->reserved[159] == 126, "incorrect value for reserved[159], expected 126, is %d", check_msg->reserved[159]); - ck_assert_msg(check_msg->reserved[160] == 221, "incorrect value for reserved[160], expected 221, is %d", check_msg->reserved[160]); - ck_assert_msg(check_msg->reserved[161] == 110, "incorrect value for reserved[161], expected 110, is %d", check_msg->reserved[161]); - ck_assert_msg(check_msg->reserved[162] == 144, "incorrect value for reserved[162], expected 144, is %d", check_msg->reserved[162]); - ck_assert_msg(check_msg->reserved[163] == 97, "incorrect value for reserved[163], expected 97, is %d", check_msg->reserved[163]); - ck_assert_msg(check_msg->reserved[164] == 74, "incorrect value for reserved[164], expected 74, is %d", check_msg->reserved[164]); - ck_assert_msg(check_msg->reserved[165] == 250, "incorrect value for reserved[165], expected 250, is %d", check_msg->reserved[165]); - ck_assert_msg(check_msg->reserved[166] == 181, "incorrect value for reserved[166], expected 181, is %d", check_msg->reserved[166]); - ck_assert_msg(check_msg->reserved[167] == 199, "incorrect value for reserved[167], expected 199, is %d", check_msg->reserved[167]); - ck_assert_msg(check_msg->reserved[168] == 27, "incorrect value for reserved[168], expected 27, is %d", check_msg->reserved[168]); - ck_assert_msg(check_msg->reserved[169] == 176, "incorrect value for reserved[169], expected 176, is %d", check_msg->reserved[169]); - ck_assert_msg(check_msg->reserved[170] == 65, "incorrect value for reserved[170], expected 65, is %d", check_msg->reserved[170]); - ck_assert_msg(check_msg->reserved[171] == 185, "incorrect value for reserved[171], expected 185, is %d", check_msg->reserved[171]); - ck_assert_msg(check_msg->reserved[172] == 110, "incorrect value for reserved[172], expected 110, is %d", check_msg->reserved[172]); - ck_assert_msg(check_msg->reserved[173] == 92, "incorrect value for reserved[173], expected 92, is %d", check_msg->reserved[173]); - ck_assert_msg(check_msg->reserved[174] == 34, "incorrect value for reserved[174], expected 34, is %d", check_msg->reserved[174]); - ck_assert_msg(check_msg->reserved[175] == 44, "incorrect value for reserved[175], expected 44, is %d", check_msg->reserved[175]); - ck_assert_msg(check_msg->reserved[176] == 131, "incorrect value for reserved[176], expected 131, is %d", check_msg->reserved[176]); - ck_assert_msg(check_msg->reserved[177] == 96, "incorrect value for reserved[177], expected 96, is %d", check_msg->reserved[177]); - ck_assert_msg(check_msg->reserved[178] == 178, "incorrect value for reserved[178], expected 178, is %d", check_msg->reserved[178]); - ck_assert_msg(check_msg->reserved[179] == 40, "incorrect value for reserved[179], expected 40, is %d", check_msg->reserved[179]); - ck_assert_msg(check_msg->reserved[180] == 176, "incorrect value for reserved[180], expected 176, is %d", check_msg->reserved[180]); - ck_assert_msg(check_msg->reserved[181] == 4, "incorrect value for reserved[181], expected 4, is %d", check_msg->reserved[181]); - ck_assert_msg(check_msg->reserved[182] == 90, "incorrect value for reserved[182], expected 90, is %d", check_msg->reserved[182]); - ck_assert_msg(check_msg->reserved[183] == 36, "incorrect value for reserved[183], expected 36, is %d", check_msg->reserved[183]); - ck_assert_msg(check_msg->reserved[184] == 7, "incorrect value for reserved[184], expected 7, is %d", check_msg->reserved[184]); - ck_assert_msg(check_msg->reserved[185] == 180, "incorrect value for reserved[185], expected 180, is %d", check_msg->reserved[185]); - ck_assert_msg(check_msg->reserved[186] == 244, "incorrect value for reserved[186], expected 244, is %d", check_msg->reserved[186]); - ck_assert_msg(check_msg->reserved[187] == 244, "incorrect value for reserved[187], expected 244, is %d", check_msg->reserved[187]); - ck_assert_msg(check_msg->reserved[188] == 23, "incorrect value for reserved[188], expected 23, is %d", check_msg->reserved[188]); - ck_assert_msg(check_msg->reserved[189] == 108, "incorrect value for reserved[189], expected 108, is %d", check_msg->reserved[189]); - ck_assert_msg(check_msg->reserved[190] == 171, "incorrect value for reserved[190], expected 171, is %d", check_msg->reserved[190]); - ck_assert_msg(check_msg->reserved[191] == 204, "incorrect value for reserved[191], expected 204, is %d", check_msg->reserved[191]); - ck_assert_msg(check_msg->reserved[192] == 196, "incorrect value for reserved[192], expected 196, is %d", check_msg->reserved[192]); - ck_assert_msg(check_msg->reserved[193] == 61, "incorrect value for reserved[193], expected 61, is %d", check_msg->reserved[193]); - ck_assert_msg(check_msg->reserved[194] == 51, "incorrect value for reserved[194], expected 51, is %d", check_msg->reserved[194]); - ck_assert_msg(check_msg->reserved[195] == 179, "incorrect value for reserved[195], expected 179, is %d", check_msg->reserved[195]); - ck_assert_msg(check_msg->reserved[196] == 242, "incorrect value for reserved[196], expected 242, is %d", check_msg->reserved[196]); - ck_assert_msg(check_msg->reserved[197] == 156, "incorrect value for reserved[197], expected 156, is %d", check_msg->reserved[197]); - ck_assert_msg(check_msg->reserved[198] == 81, "incorrect value for reserved[198], expected 81, is %d", check_msg->reserved[198]); - ck_assert_msg(check_msg->reserved[199] == 83, "incorrect value for reserved[199], expected 83, is %d", check_msg->reserved[199]); - ck_assert_msg(check_msg->reserved[200] == 16, "incorrect value for reserved[200], expected 16, is %d", check_msg->reserved[200]); - ck_assert_msg(check_msg->reserved[201] == 15, "incorrect value for reserved[201], expected 15, is %d", check_msg->reserved[201]); - ck_assert_msg(check_msg->reserved[202] == 134, "incorrect value for reserved[202], expected 134, is %d", check_msg->reserved[202]); - ck_assert_msg(check_msg->reserved[203] == 40, "incorrect value for reserved[203], expected 40, is %d", check_msg->reserved[203]); - ck_assert_msg(check_msg->reserved[204] == 245, "incorrect value for reserved[204], expected 245, is %d", check_msg->reserved[204]); - ck_assert_msg(check_msg->reserved[205] == 253, "incorrect value for reserved[205], expected 253, is %d", check_msg->reserved[205]); - ck_assert_msg(check_msg->reserved[206] == 150, "incorrect value for reserved[206], expected 150, is %d", check_msg->reserved[206]); - ck_assert_msg(check_msg->reserved[207] == 94, "incorrect value for reserved[207], expected 94, is %d", check_msg->reserved[207]); - ck_assert_msg(check_msg->reserved[208] == 150, "incorrect value for reserved[208], expected 150, is %d", check_msg->reserved[208]); - ck_assert_msg(check_msg->reserved[209] == 144, "incorrect value for reserved[209], expected 144, is %d", check_msg->reserved[209]); - ck_assert_msg(check_msg->reserved[210] == 197, "incorrect value for reserved[210], expected 197, is %d", check_msg->reserved[210]); - ck_assert_msg(check_msg->reserved[211] == 113, "incorrect value for reserved[211], expected 113, is %d", check_msg->reserved[211]); - ck_assert_msg(check_msg->reserved[212] == 5, "incorrect value for reserved[212], expected 5, is %d", check_msg->reserved[212]); - ck_assert_msg(check_msg->reserved[213] == 141, "incorrect value for reserved[213], expected 141, is %d", check_msg->reserved[213]); - ck_assert_msg(check_msg->reserved[214] == 232, "incorrect value for reserved[214], expected 232, is %d", check_msg->reserved[214]); - ck_assert_msg(check_msg->reserved[215] == 33, "incorrect value for reserved[215], expected 33, is %d", check_msg->reserved[215]); - ck_assert_msg(check_msg->reserved[216] == 101, "incorrect value for reserved[216], expected 101, is %d", check_msg->reserved[216]); - ck_assert_msg(check_msg->reserved[217] == 231, "incorrect value for reserved[217], expected 231, is %d", check_msg->reserved[217]); - ck_assert_msg(check_msg->reserved[218] == 38, "incorrect value for reserved[218], expected 38, is %d", check_msg->reserved[218]); - ck_assert_msg(check_msg->reserved[219] == 75, "incorrect value for reserved[219], expected 75, is %d", check_msg->reserved[219]); - ck_assert_msg(check_msg->reserved[220] == 178, "incorrect value for reserved[220], expected 178, is %d", check_msg->reserved[220]); - ck_assert_msg(check_msg->reserved[221] == 243, "incorrect value for reserved[221], expected 243, is %d", check_msg->reserved[221]); - ck_assert_msg(check_msg->reserved[222] == 119, "incorrect value for reserved[222], expected 119, is %d", check_msg->reserved[222]); - ck_assert_msg(check_msg->reserved[223] == 1, "incorrect value for reserved[223], expected 1, is %d", check_msg->reserved[223]); - ck_assert_msg(check_msg->reserved[224] == 248, "incorrect value for reserved[224], expected 248, is %d", check_msg->reserved[224]); - ck_assert_msg(check_msg->reserved[225] == 218, "incorrect value for reserved[225], expected 218, is %d", check_msg->reserved[225]); - ck_assert_msg(check_msg->reserved[226] == 86, "incorrect value for reserved[226], expected 86, is %d", check_msg->reserved[226]); - ck_assert_msg(check_msg->reserved[227] == 7, "incorrect value for reserved[227], expected 7, is %d", check_msg->reserved[227]); - ck_assert_msg(check_msg->reserved[228] == 88, "incorrect value for reserved[228], expected 88, is %d", check_msg->reserved[228]); - ck_assert_msg(check_msg->reserved[229] == 197, "incorrect value for reserved[229], expected 197, is %d", check_msg->reserved[229]); - ck_assert_msg(check_msg->reserved[230] == 148, "incorrect value for reserved[230], expected 148, is %d", check_msg->reserved[230]); - ck_assert_msg(check_msg->reserved[231] == 240, "incorrect value for reserved[231], expected 240, is %d", check_msg->reserved[231]); - ck_assert_msg(check_msg->reserved[232] == 227, "incorrect value for reserved[232], expected 227, is %d", check_msg->reserved[232]); - ck_assert_msg(check_msg->reserved[233] == 2, "incorrect value for reserved[233], expected 2, is %d", check_msg->reserved[233]); - ck_assert_msg(check_msg->reserved[234] == 65, "incorrect value for reserved[234], expected 65, is %d", check_msg->reserved[234]); - ck_assert_msg(check_msg->reserved[235] == 173, "incorrect value for reserved[235], expected 173, is %d", check_msg->reserved[235]); - ck_assert_msg(check_msg->reserved[236] == 122, "incorrect value for reserved[236], expected 122, is %d", check_msg->reserved[236]); - ck_assert_msg(check_msg->reserved[237] == 143, "incorrect value for reserved[237], expected 143, is %d", check_msg->reserved[237]); - ck_assert_msg(check_msg->reserved[238] == 251, "incorrect value for reserved[238], expected 251, is %d", check_msg->reserved[238]); - ck_assert_msg(check_msg->reserved[239] == 156, "incorrect value for reserved[239], expected 156, is %d", check_msg->reserved[239]); - ck_assert_msg(check_msg->reserved[240] == 217, "incorrect value for reserved[240], expected 217, is %d", check_msg->reserved[240]); - ck_assert_msg(check_msg->reserved[241] == 67, "incorrect value for reserved[241], expected 67, is %d", check_msg->reserved[241]); - ck_assert_msg(check_msg->reserved[242] == 239, "incorrect value for reserved[242], expected 239, is %d", check_msg->reserved[242]); - ck_assert_msg(check_msg->reserved[243] == 219, "incorrect value for reserved[243], expected 219, is %d", check_msg->reserved[243]); - ck_assert_msg(check_msg->reserved[244] == 31, "incorrect value for reserved[244], expected 31, is %d", check_msg->reserved[244]); - ck_assert_msg(check_msg->reserved[245] == 224, "incorrect value for reserved[245], expected 224, is %d", check_msg->reserved[245]); - ck_assert_msg(check_msg->reserved[246] == 176, "incorrect value for reserved[246], expected 176, is %d", check_msg->reserved[246]); - ck_assert_msg(check_msg->reserved[247] == 129, "incorrect value for reserved[247], expected 129, is %d", check_msg->reserved[247]); - ck_assert_msg(check_msg->reserved[248] == 81, "incorrect value for reserved[248], expected 81, is %d", check_msg->reserved[248]); - ck_assert_msg(check_msg->reserved[249] == 80, "incorrect value for reserved[249], expected 80, is %d", check_msg->reserved[249]); - ck_assert_msg((check_msg->signal_error_rate*100 - 8588.20019531*100) < 0.05, "incorrect value for signal_error_rate, expected 8588.20019531, is %f", check_msg->signal_error_rate); - ck_assert_msg(check_msg->signal_strength == 103, "incorrect value for signal_strength, expected 103, is %d", check_msg->signal_strength); + ck_assert_msg(check_msg->reserved[0] == 123, + "incorrect value for reserved[0], expected 123, is %d", + check_msg->reserved[0]); + ck_assert_msg(check_msg->reserved[1] == 242, + "incorrect value for reserved[1], expected 242, is %d", + check_msg->reserved[1]); + ck_assert_msg(check_msg->reserved[2] == 46, + "incorrect value for reserved[2], expected 46, is %d", + check_msg->reserved[2]); + ck_assert_msg(check_msg->reserved[3] == 52, + "incorrect value for reserved[3], expected 52, is %d", + check_msg->reserved[3]); + ck_assert_msg(check_msg->reserved[4] == 64, + "incorrect value for reserved[4], expected 64, is %d", + check_msg->reserved[4]); + ck_assert_msg(check_msg->reserved[5] == 176, + "incorrect value for reserved[5], expected 176, is %d", + check_msg->reserved[5]); + ck_assert_msg(check_msg->reserved[6] == 154, + "incorrect value for reserved[6], expected 154, is %d", + check_msg->reserved[6]); + ck_assert_msg(check_msg->reserved[7] == 98, + "incorrect value for reserved[7], expected 98, is %d", + check_msg->reserved[7]); + ck_assert_msg(check_msg->reserved[8] == 43, + "incorrect value for reserved[8], expected 43, is %d", + check_msg->reserved[8]); + ck_assert_msg(check_msg->reserved[9] == 132, + "incorrect value for reserved[9], expected 132, is %d", + check_msg->reserved[9]); + ck_assert_msg(check_msg->reserved[10] == 196, + "incorrect value for reserved[10], expected 196, is %d", + check_msg->reserved[10]); + ck_assert_msg(check_msg->reserved[11] == 89, + "incorrect value for reserved[11], expected 89, is %d", + check_msg->reserved[11]); + ck_assert_msg(check_msg->reserved[12] == 253, + "incorrect value for reserved[12], expected 253, is %d", + check_msg->reserved[12]); + ck_assert_msg(check_msg->reserved[13] == 161, + "incorrect value for reserved[13], expected 161, is %d", + check_msg->reserved[13]); + ck_assert_msg(check_msg->reserved[14] == 250, + "incorrect value for reserved[14], expected 250, is %d", + check_msg->reserved[14]); + ck_assert_msg(check_msg->reserved[15] == 174, + "incorrect value for reserved[15], expected 174, is %d", + check_msg->reserved[15]); + ck_assert_msg(check_msg->reserved[16] == 204, + "incorrect value for reserved[16], expected 204, is %d", + check_msg->reserved[16]); + ck_assert_msg(check_msg->reserved[17] == 110, + "incorrect value for reserved[17], expected 110, is %d", + check_msg->reserved[17]); + ck_assert_msg(check_msg->reserved[18] == 47, + "incorrect value for reserved[18], expected 47, is %d", + check_msg->reserved[18]); + ck_assert_msg(check_msg->reserved[19] == 38, + "incorrect value for reserved[19], expected 38, is %d", + check_msg->reserved[19]); + ck_assert_msg(check_msg->reserved[20] == 187, + "incorrect value for reserved[20], expected 187, is %d", + check_msg->reserved[20]); + ck_assert_msg(check_msg->reserved[21] == 63, + "incorrect value for reserved[21], expected 63, is %d", + check_msg->reserved[21]); + ck_assert_msg(check_msg->reserved[22] == 102, + "incorrect value for reserved[22], expected 102, is %d", + check_msg->reserved[22]); + ck_assert_msg(check_msg->reserved[23] == 177, + "incorrect value for reserved[23], expected 177, is %d", + check_msg->reserved[23]); + ck_assert_msg(check_msg->reserved[24] == 162, + "incorrect value for reserved[24], expected 162, is %d", + check_msg->reserved[24]); + ck_assert_msg(check_msg->reserved[25] == 49, + "incorrect value for reserved[25], expected 49, is %d", + check_msg->reserved[25]); + ck_assert_msg(check_msg->reserved[26] == 80, + "incorrect value for reserved[26], expected 80, is %d", + check_msg->reserved[26]); + ck_assert_msg(check_msg->reserved[27] == 194, + "incorrect value for reserved[27], expected 194, is %d", + check_msg->reserved[27]); + ck_assert_msg(check_msg->reserved[28] == 37, + "incorrect value for reserved[28], expected 37, is %d", + check_msg->reserved[28]); + ck_assert_msg(check_msg->reserved[29] == 107, + "incorrect value for reserved[29], expected 107, is %d", + check_msg->reserved[29]); + ck_assert_msg(check_msg->reserved[30] == 60, + "incorrect value for reserved[30], expected 60, is %d", + check_msg->reserved[30]); + ck_assert_msg(check_msg->reserved[31] == 225, + "incorrect value for reserved[31], expected 225, is %d", + check_msg->reserved[31]); + ck_assert_msg(check_msg->reserved[32] == 52, + "incorrect value for reserved[32], expected 52, is %d", + check_msg->reserved[32]); + ck_assert_msg(check_msg->reserved[33] == 101, + "incorrect value for reserved[33], expected 101, is %d", + check_msg->reserved[33]); + ck_assert_msg(check_msg->reserved[34] == 178, + "incorrect value for reserved[34], expected 178, is %d", + check_msg->reserved[34]); + ck_assert_msg(check_msg->reserved[35] == 142, + "incorrect value for reserved[35], expected 142, is %d", + check_msg->reserved[35]); + ck_assert_msg(check_msg->reserved[36] == 246, + "incorrect value for reserved[36], expected 246, is %d", + check_msg->reserved[36]); + ck_assert_msg(check_msg->reserved[37] == 21, + "incorrect value for reserved[37], expected 21, is %d", + check_msg->reserved[37]); + ck_assert_msg(check_msg->reserved[38] == 17, + "incorrect value for reserved[38], expected 17, is %d", + check_msg->reserved[38]); + ck_assert_msg(check_msg->reserved[39] == 93, + "incorrect value for reserved[39], expected 93, is %d", + check_msg->reserved[39]); + ck_assert_msg(check_msg->reserved[40] == 75, + "incorrect value for reserved[40], expected 75, is %d", + check_msg->reserved[40]); + ck_assert_msg(check_msg->reserved[41] == 169, + "incorrect value for reserved[41], expected 169, is %d", + check_msg->reserved[41]); + ck_assert_msg(check_msg->reserved[42] == 86, + "incorrect value for reserved[42], expected 86, is %d", + check_msg->reserved[42]); + ck_assert_msg(check_msg->reserved[43] == 16, + "incorrect value for reserved[43], expected 16, is %d", + check_msg->reserved[43]); + ck_assert_msg(check_msg->reserved[44] == 209, + "incorrect value for reserved[44], expected 209, is %d", + check_msg->reserved[44]); + ck_assert_msg(check_msg->reserved[45] == 80, + "incorrect value for reserved[45], expected 80, is %d", + check_msg->reserved[45]); + ck_assert_msg(check_msg->reserved[46] == 243, + "incorrect value for reserved[46], expected 243, is %d", + check_msg->reserved[46]); + ck_assert_msg(check_msg->reserved[47] == 30, + "incorrect value for reserved[47], expected 30, is %d", + check_msg->reserved[47]); + ck_assert_msg(check_msg->reserved[48] == 206, + "incorrect value for reserved[48], expected 206, is %d", + check_msg->reserved[48]); + ck_assert_msg(check_msg->reserved[49] == 220, + "incorrect value for reserved[49], expected 220, is %d", + check_msg->reserved[49]); + ck_assert_msg(check_msg->reserved[50] == 206, + "incorrect value for reserved[50], expected 206, is %d", + check_msg->reserved[50]); + ck_assert_msg(check_msg->reserved[51] == 115, + "incorrect value for reserved[51], expected 115, is %d", + check_msg->reserved[51]); + ck_assert_msg(check_msg->reserved[52] == 47, + "incorrect value for reserved[52], expected 47, is %d", + check_msg->reserved[52]); + ck_assert_msg(check_msg->reserved[53] == 154, + "incorrect value for reserved[53], expected 154, is %d", + check_msg->reserved[53]); + ck_assert_msg(check_msg->reserved[54] == 91, + "incorrect value for reserved[54], expected 91, is %d", + check_msg->reserved[54]); + ck_assert_msg(check_msg->reserved[55] == 227, + "incorrect value for reserved[55], expected 227, is %d", + check_msg->reserved[55]); + ck_assert_msg(check_msg->reserved[56] == 88, + "incorrect value for reserved[56], expected 88, is %d", + check_msg->reserved[56]); + ck_assert_msg(check_msg->reserved[57] == 11, + "incorrect value for reserved[57], expected 11, is %d", + check_msg->reserved[57]); + ck_assert_msg(check_msg->reserved[58] == 1, + "incorrect value for reserved[58], expected 1, is %d", + check_msg->reserved[58]); + ck_assert_msg(check_msg->reserved[59] == 85, + "incorrect value for reserved[59], expected 85, is %d", + check_msg->reserved[59]); + ck_assert_msg(check_msg->reserved[60] == 146, + "incorrect value for reserved[60], expected 146, is %d", + check_msg->reserved[60]); + ck_assert_msg(check_msg->reserved[61] == 100, + "incorrect value for reserved[61], expected 100, is %d", + check_msg->reserved[61]); + ck_assert_msg(check_msg->reserved[62] == 190, + "incorrect value for reserved[62], expected 190, is %d", + check_msg->reserved[62]); + ck_assert_msg(check_msg->reserved[63] == 232, + "incorrect value for reserved[63], expected 232, is %d", + check_msg->reserved[63]); + ck_assert_msg(check_msg->reserved[64] == 207, + "incorrect value for reserved[64], expected 207, is %d", + check_msg->reserved[64]); + ck_assert_msg(check_msg->reserved[65] == 61, + "incorrect value for reserved[65], expected 61, is %d", + check_msg->reserved[65]); + ck_assert_msg(check_msg->reserved[66] == 61, + "incorrect value for reserved[66], expected 61, is %d", + check_msg->reserved[66]); + ck_assert_msg(check_msg->reserved[67] == 201, + "incorrect value for reserved[67], expected 201, is %d", + check_msg->reserved[67]); + ck_assert_msg(check_msg->reserved[68] == 220, + "incorrect value for reserved[68], expected 220, is %d", + check_msg->reserved[68]); + ck_assert_msg(check_msg->reserved[69] == 31, + "incorrect value for reserved[69], expected 31, is %d", + check_msg->reserved[69]); + ck_assert_msg(check_msg->reserved[70] == 78, + "incorrect value for reserved[70], expected 78, is %d", + check_msg->reserved[70]); + ck_assert_msg(check_msg->reserved[71] == 34, + "incorrect value for reserved[71], expected 34, is %d", + check_msg->reserved[71]); + ck_assert_msg(check_msg->reserved[72] == 57, + "incorrect value for reserved[72], expected 57, is %d", + check_msg->reserved[72]); + ck_assert_msg(check_msg->reserved[73] == 82, + "incorrect value for reserved[73], expected 82, is %d", + check_msg->reserved[73]); + ck_assert_msg(check_msg->reserved[74] == 59, + "incorrect value for reserved[74], expected 59, is %d", + check_msg->reserved[74]); + ck_assert_msg(check_msg->reserved[75] == 104, + "incorrect value for reserved[75], expected 104, is %d", + check_msg->reserved[75]); + ck_assert_msg(check_msg->reserved[76] == 65, + "incorrect value for reserved[76], expected 65, is %d", + check_msg->reserved[76]); + ck_assert_msg(check_msg->reserved[77] == 221, + "incorrect value for reserved[77], expected 221, is %d", + check_msg->reserved[77]); + ck_assert_msg(check_msg->reserved[78] == 0, + "incorrect value for reserved[78], expected 0, is %d", + check_msg->reserved[78]); + ck_assert_msg(check_msg->reserved[79] == 43, + "incorrect value for reserved[79], expected 43, is %d", + check_msg->reserved[79]); + ck_assert_msg(check_msg->reserved[80] == 210, + "incorrect value for reserved[80], expected 210, is %d", + check_msg->reserved[80]); + ck_assert_msg(check_msg->reserved[81] == 9, + "incorrect value for reserved[81], expected 9, is %d", + check_msg->reserved[81]); + ck_assert_msg(check_msg->reserved[82] == 32, + "incorrect value for reserved[82], expected 32, is %d", + check_msg->reserved[82]); + ck_assert_msg(check_msg->reserved[83] == 122, + "incorrect value for reserved[83], expected 122, is %d", + check_msg->reserved[83]); + ck_assert_msg(check_msg->reserved[84] == 29, + "incorrect value for reserved[84], expected 29, is %d", + check_msg->reserved[84]); + ck_assert_msg(check_msg->reserved[85] == 237, + "incorrect value for reserved[85], expected 237, is %d", + check_msg->reserved[85]); + ck_assert_msg(check_msg->reserved[86] == 11, + "incorrect value for reserved[86], expected 11, is %d", + check_msg->reserved[86]); + ck_assert_msg(check_msg->reserved[87] == 151, + "incorrect value for reserved[87], expected 151, is %d", + check_msg->reserved[87]); + ck_assert_msg(check_msg->reserved[88] == 223, + "incorrect value for reserved[88], expected 223, is %d", + check_msg->reserved[88]); + ck_assert_msg(check_msg->reserved[89] == 18, + "incorrect value for reserved[89], expected 18, is %d", + check_msg->reserved[89]); + ck_assert_msg(check_msg->reserved[90] == 81, + "incorrect value for reserved[90], expected 81, is %d", + check_msg->reserved[90]); + ck_assert_msg(check_msg->reserved[91] == 204, + "incorrect value for reserved[91], expected 204, is %d", + check_msg->reserved[91]); + ck_assert_msg(check_msg->reserved[92] == 172, + "incorrect value for reserved[92], expected 172, is %d", + check_msg->reserved[92]); + ck_assert_msg(check_msg->reserved[93] == 234, + "incorrect value for reserved[93], expected 234, is %d", + check_msg->reserved[93]); + ck_assert_msg(check_msg->reserved[94] == 127, + "incorrect value for reserved[94], expected 127, is %d", + check_msg->reserved[94]); + ck_assert_msg(check_msg->reserved[95] == 3, + "incorrect value for reserved[95], expected 3, is %d", + check_msg->reserved[95]); + ck_assert_msg(check_msg->reserved[96] == 82, + "incorrect value for reserved[96], expected 82, is %d", + check_msg->reserved[96]); + ck_assert_msg(check_msg->reserved[97] == 133, + "incorrect value for reserved[97], expected 133, is %d", + check_msg->reserved[97]); + ck_assert_msg(check_msg->reserved[98] == 169, + "incorrect value for reserved[98], expected 169, is %d", + check_msg->reserved[98]); + ck_assert_msg(check_msg->reserved[99] == 12, + "incorrect value for reserved[99], expected 12, is %d", + check_msg->reserved[99]); + ck_assert_msg(check_msg->reserved[100] == 176, + "incorrect value for reserved[100], expected 176, is %d", + check_msg->reserved[100]); + ck_assert_msg(check_msg->reserved[101] == 193, + "incorrect value for reserved[101], expected 193, is %d", + check_msg->reserved[101]); + ck_assert_msg(check_msg->reserved[102] == 0, + "incorrect value for reserved[102], expected 0, is %d", + check_msg->reserved[102]); + ck_assert_msg(check_msg->reserved[103] == 24, + "incorrect value for reserved[103], expected 24, is %d", + check_msg->reserved[103]); + ck_assert_msg(check_msg->reserved[104] == 121, + "incorrect value for reserved[104], expected 121, is %d", + check_msg->reserved[104]); + ck_assert_msg(check_msg->reserved[105] == 85, + "incorrect value for reserved[105], expected 85, is %d", + check_msg->reserved[105]); + ck_assert_msg(check_msg->reserved[106] == 55, + "incorrect value for reserved[106], expected 55, is %d", + check_msg->reserved[106]); + ck_assert_msg(check_msg->reserved[107] == 214, + "incorrect value for reserved[107], expected 214, is %d", + check_msg->reserved[107]); + ck_assert_msg(check_msg->reserved[108] == 198, + "incorrect value for reserved[108], expected 198, is %d", + check_msg->reserved[108]); + ck_assert_msg(check_msg->reserved[109] == 75, + "incorrect value for reserved[109], expected 75, is %d", + check_msg->reserved[109]); + ck_assert_msg(check_msg->reserved[110] == 234, + "incorrect value for reserved[110], expected 234, is %d", + check_msg->reserved[110]); + ck_assert_msg(check_msg->reserved[111] == 179, + "incorrect value for reserved[111], expected 179, is %d", + check_msg->reserved[111]); + ck_assert_msg(check_msg->reserved[112] == 214, + "incorrect value for reserved[112], expected 214, is %d", + check_msg->reserved[112]); + ck_assert_msg(check_msg->reserved[113] == 85, + "incorrect value for reserved[113], expected 85, is %d", + check_msg->reserved[113]); + ck_assert_msg(check_msg->reserved[114] == 94, + "incorrect value for reserved[114], expected 94, is %d", + check_msg->reserved[114]); + ck_assert_msg(check_msg->reserved[115] == 115, + "incorrect value for reserved[115], expected 115, is %d", + check_msg->reserved[115]); + ck_assert_msg(check_msg->reserved[116] == 21, + "incorrect value for reserved[116], expected 21, is %d", + check_msg->reserved[116]); + ck_assert_msg(check_msg->reserved[117] == 73, + "incorrect value for reserved[117], expected 73, is %d", + check_msg->reserved[117]); + ck_assert_msg(check_msg->reserved[118] == 121, + "incorrect value for reserved[118], expected 121, is %d", + check_msg->reserved[118]); + ck_assert_msg(check_msg->reserved[119] == 75, + "incorrect value for reserved[119], expected 75, is %d", + check_msg->reserved[119]); + ck_assert_msg(check_msg->reserved[120] == 46, + "incorrect value for reserved[120], expected 46, is %d", + check_msg->reserved[120]); + ck_assert_msg(check_msg->reserved[121] == 158, + "incorrect value for reserved[121], expected 158, is %d", + check_msg->reserved[121]); + ck_assert_msg(check_msg->reserved[122] == 63, + "incorrect value for reserved[122], expected 63, is %d", + check_msg->reserved[122]); + ck_assert_msg(check_msg->reserved[123] == 100, + "incorrect value for reserved[123], expected 100, is %d", + check_msg->reserved[123]); + ck_assert_msg(check_msg->reserved[124] == 122, + "incorrect value for reserved[124], expected 122, is %d", + check_msg->reserved[124]); + ck_assert_msg(check_msg->reserved[125] == 213, + "incorrect value for reserved[125], expected 213, is %d", + check_msg->reserved[125]); + ck_assert_msg(check_msg->reserved[126] == 20, + "incorrect value for reserved[126], expected 20, is %d", + check_msg->reserved[126]); + ck_assert_msg(check_msg->reserved[127] == 85, + "incorrect value for reserved[127], expected 85, is %d", + check_msg->reserved[127]); + ck_assert_msg(check_msg->reserved[128] == 212, + "incorrect value for reserved[128], expected 212, is %d", + check_msg->reserved[128]); + ck_assert_msg(check_msg->reserved[129] == 131, + "incorrect value for reserved[129], expected 131, is %d", + check_msg->reserved[129]); + ck_assert_msg(check_msg->reserved[130] == 50, + "incorrect value for reserved[130], expected 50, is %d", + check_msg->reserved[130]); + ck_assert_msg(check_msg->reserved[131] == 224, + "incorrect value for reserved[131], expected 224, is %d", + check_msg->reserved[131]); + ck_assert_msg(check_msg->reserved[132] == 218, + "incorrect value for reserved[132], expected 218, is %d", + check_msg->reserved[132]); + ck_assert_msg(check_msg->reserved[133] == 215, + "incorrect value for reserved[133], expected 215, is %d", + check_msg->reserved[133]); + ck_assert_msg(check_msg->reserved[134] == 215, + "incorrect value for reserved[134], expected 215, is %d", + check_msg->reserved[134]); + ck_assert_msg(check_msg->reserved[135] == 149, + "incorrect value for reserved[135], expected 149, is %d", + check_msg->reserved[135]); + ck_assert_msg(check_msg->reserved[136] == 2, + "incorrect value for reserved[136], expected 2, is %d", + check_msg->reserved[136]); + ck_assert_msg(check_msg->reserved[137] == 19, + "incorrect value for reserved[137], expected 19, is %d", + check_msg->reserved[137]); + ck_assert_msg(check_msg->reserved[138] == 129, + "incorrect value for reserved[138], expected 129, is %d", + check_msg->reserved[138]); + ck_assert_msg(check_msg->reserved[139] == 39, + "incorrect value for reserved[139], expected 39, is %d", + check_msg->reserved[139]); + ck_assert_msg(check_msg->reserved[140] == 164, + "incorrect value for reserved[140], expected 164, is %d", + check_msg->reserved[140]); + ck_assert_msg(check_msg->reserved[141] == 5, + "incorrect value for reserved[141], expected 5, is %d", + check_msg->reserved[141]); + ck_assert_msg(check_msg->reserved[142] == 175, + "incorrect value for reserved[142], expected 175, is %d", + check_msg->reserved[142]); + ck_assert_msg(check_msg->reserved[143] == 6, + "incorrect value for reserved[143], expected 6, is %d", + check_msg->reserved[143]); + ck_assert_msg(check_msg->reserved[144] == 62, + "incorrect value for reserved[144], expected 62, is %d", + check_msg->reserved[144]); + ck_assert_msg(check_msg->reserved[145] == 51, + "incorrect value for reserved[145], expected 51, is %d", + check_msg->reserved[145]); + ck_assert_msg(check_msg->reserved[146] == 78, + "incorrect value for reserved[146], expected 78, is %d", + check_msg->reserved[146]); + ck_assert_msg(check_msg->reserved[147] == 66, + "incorrect value for reserved[147], expected 66, is %d", + check_msg->reserved[147]); + ck_assert_msg(check_msg->reserved[148] == 248, + "incorrect value for reserved[148], expected 248, is %d", + check_msg->reserved[148]); + ck_assert_msg(check_msg->reserved[149] == 116, + "incorrect value for reserved[149], expected 116, is %d", + check_msg->reserved[149]); + ck_assert_msg(check_msg->reserved[150] == 88, + "incorrect value for reserved[150], expected 88, is %d", + check_msg->reserved[150]); + ck_assert_msg(check_msg->reserved[151] == 90, + "incorrect value for reserved[151], expected 90, is %d", + check_msg->reserved[151]); + ck_assert_msg(check_msg->reserved[152] == 128, + "incorrect value for reserved[152], expected 128, is %d", + check_msg->reserved[152]); + ck_assert_msg(check_msg->reserved[153] == 226, + "incorrect value for reserved[153], expected 226, is %d", + check_msg->reserved[153]); + ck_assert_msg(check_msg->reserved[154] == 177, + "incorrect value for reserved[154], expected 177, is %d", + check_msg->reserved[154]); + ck_assert_msg(check_msg->reserved[155] == 0, + "incorrect value for reserved[155], expected 0, is %d", + check_msg->reserved[155]); + ck_assert_msg(check_msg->reserved[156] == 47, + "incorrect value for reserved[156], expected 47, is %d", + check_msg->reserved[156]); + ck_assert_msg(check_msg->reserved[157] == 140, + "incorrect value for reserved[157], expected 140, is %d", + check_msg->reserved[157]); + ck_assert_msg(check_msg->reserved[158] == 33, + "incorrect value for reserved[158], expected 33, is %d", + check_msg->reserved[158]); + ck_assert_msg(check_msg->reserved[159] == 126, + "incorrect value for reserved[159], expected 126, is %d", + check_msg->reserved[159]); + ck_assert_msg(check_msg->reserved[160] == 221, + "incorrect value for reserved[160], expected 221, is %d", + check_msg->reserved[160]); + ck_assert_msg(check_msg->reserved[161] == 110, + "incorrect value for reserved[161], expected 110, is %d", + check_msg->reserved[161]); + ck_assert_msg(check_msg->reserved[162] == 144, + "incorrect value for reserved[162], expected 144, is %d", + check_msg->reserved[162]); + ck_assert_msg(check_msg->reserved[163] == 97, + "incorrect value for reserved[163], expected 97, is %d", + check_msg->reserved[163]); + ck_assert_msg(check_msg->reserved[164] == 74, + "incorrect value for reserved[164], expected 74, is %d", + check_msg->reserved[164]); + ck_assert_msg(check_msg->reserved[165] == 250, + "incorrect value for reserved[165], expected 250, is %d", + check_msg->reserved[165]); + ck_assert_msg(check_msg->reserved[166] == 181, + "incorrect value for reserved[166], expected 181, is %d", + check_msg->reserved[166]); + ck_assert_msg(check_msg->reserved[167] == 199, + "incorrect value for reserved[167], expected 199, is %d", + check_msg->reserved[167]); + ck_assert_msg(check_msg->reserved[168] == 27, + "incorrect value for reserved[168], expected 27, is %d", + check_msg->reserved[168]); + ck_assert_msg(check_msg->reserved[169] == 176, + "incorrect value for reserved[169], expected 176, is %d", + check_msg->reserved[169]); + ck_assert_msg(check_msg->reserved[170] == 65, + "incorrect value for reserved[170], expected 65, is %d", + check_msg->reserved[170]); + ck_assert_msg(check_msg->reserved[171] == 185, + "incorrect value for reserved[171], expected 185, is %d", + check_msg->reserved[171]); + ck_assert_msg(check_msg->reserved[172] == 110, + "incorrect value for reserved[172], expected 110, is %d", + check_msg->reserved[172]); + ck_assert_msg(check_msg->reserved[173] == 92, + "incorrect value for reserved[173], expected 92, is %d", + check_msg->reserved[173]); + ck_assert_msg(check_msg->reserved[174] == 34, + "incorrect value for reserved[174], expected 34, is %d", + check_msg->reserved[174]); + ck_assert_msg(check_msg->reserved[175] == 44, + "incorrect value for reserved[175], expected 44, is %d", + check_msg->reserved[175]); + ck_assert_msg(check_msg->reserved[176] == 131, + "incorrect value for reserved[176], expected 131, is %d", + check_msg->reserved[176]); + ck_assert_msg(check_msg->reserved[177] == 96, + "incorrect value for reserved[177], expected 96, is %d", + check_msg->reserved[177]); + ck_assert_msg(check_msg->reserved[178] == 178, + "incorrect value for reserved[178], expected 178, is %d", + check_msg->reserved[178]); + ck_assert_msg(check_msg->reserved[179] == 40, + "incorrect value for reserved[179], expected 40, is %d", + check_msg->reserved[179]); + ck_assert_msg(check_msg->reserved[180] == 176, + "incorrect value for reserved[180], expected 176, is %d", + check_msg->reserved[180]); + ck_assert_msg(check_msg->reserved[181] == 4, + "incorrect value for reserved[181], expected 4, is %d", + check_msg->reserved[181]); + ck_assert_msg(check_msg->reserved[182] == 90, + "incorrect value for reserved[182], expected 90, is %d", + check_msg->reserved[182]); + ck_assert_msg(check_msg->reserved[183] == 36, + "incorrect value for reserved[183], expected 36, is %d", + check_msg->reserved[183]); + ck_assert_msg(check_msg->reserved[184] == 7, + "incorrect value for reserved[184], expected 7, is %d", + check_msg->reserved[184]); + ck_assert_msg(check_msg->reserved[185] == 180, + "incorrect value for reserved[185], expected 180, is %d", + check_msg->reserved[185]); + ck_assert_msg(check_msg->reserved[186] == 244, + "incorrect value for reserved[186], expected 244, is %d", + check_msg->reserved[186]); + ck_assert_msg(check_msg->reserved[187] == 244, + "incorrect value for reserved[187], expected 244, is %d", + check_msg->reserved[187]); + ck_assert_msg(check_msg->reserved[188] == 23, + "incorrect value for reserved[188], expected 23, is %d", + check_msg->reserved[188]); + ck_assert_msg(check_msg->reserved[189] == 108, + "incorrect value for reserved[189], expected 108, is %d", + check_msg->reserved[189]); + ck_assert_msg(check_msg->reserved[190] == 171, + "incorrect value for reserved[190], expected 171, is %d", + check_msg->reserved[190]); + ck_assert_msg(check_msg->reserved[191] == 204, + "incorrect value for reserved[191], expected 204, is %d", + check_msg->reserved[191]); + ck_assert_msg(check_msg->reserved[192] == 196, + "incorrect value for reserved[192], expected 196, is %d", + check_msg->reserved[192]); + ck_assert_msg(check_msg->reserved[193] == 61, + "incorrect value for reserved[193], expected 61, is %d", + check_msg->reserved[193]); + ck_assert_msg(check_msg->reserved[194] == 51, + "incorrect value for reserved[194], expected 51, is %d", + check_msg->reserved[194]); + ck_assert_msg(check_msg->reserved[195] == 179, + "incorrect value for reserved[195], expected 179, is %d", + check_msg->reserved[195]); + ck_assert_msg(check_msg->reserved[196] == 242, + "incorrect value for reserved[196], expected 242, is %d", + check_msg->reserved[196]); + ck_assert_msg(check_msg->reserved[197] == 156, + "incorrect value for reserved[197], expected 156, is %d", + check_msg->reserved[197]); + ck_assert_msg(check_msg->reserved[198] == 81, + "incorrect value for reserved[198], expected 81, is %d", + check_msg->reserved[198]); + ck_assert_msg(check_msg->reserved[199] == 83, + "incorrect value for reserved[199], expected 83, is %d", + check_msg->reserved[199]); + ck_assert_msg(check_msg->reserved[200] == 16, + "incorrect value for reserved[200], expected 16, is %d", + check_msg->reserved[200]); + ck_assert_msg(check_msg->reserved[201] == 15, + "incorrect value for reserved[201], expected 15, is %d", + check_msg->reserved[201]); + ck_assert_msg(check_msg->reserved[202] == 134, + "incorrect value for reserved[202], expected 134, is %d", + check_msg->reserved[202]); + ck_assert_msg(check_msg->reserved[203] == 40, + "incorrect value for reserved[203], expected 40, is %d", + check_msg->reserved[203]); + ck_assert_msg(check_msg->reserved[204] == 245, + "incorrect value for reserved[204], expected 245, is %d", + check_msg->reserved[204]); + ck_assert_msg(check_msg->reserved[205] == 253, + "incorrect value for reserved[205], expected 253, is %d", + check_msg->reserved[205]); + ck_assert_msg(check_msg->reserved[206] == 150, + "incorrect value for reserved[206], expected 150, is %d", + check_msg->reserved[206]); + ck_assert_msg(check_msg->reserved[207] == 94, + "incorrect value for reserved[207], expected 94, is %d", + check_msg->reserved[207]); + ck_assert_msg(check_msg->reserved[208] == 150, + "incorrect value for reserved[208], expected 150, is %d", + check_msg->reserved[208]); + ck_assert_msg(check_msg->reserved[209] == 144, + "incorrect value for reserved[209], expected 144, is %d", + check_msg->reserved[209]); + ck_assert_msg(check_msg->reserved[210] == 197, + "incorrect value for reserved[210], expected 197, is %d", + check_msg->reserved[210]); + ck_assert_msg(check_msg->reserved[211] == 113, + "incorrect value for reserved[211], expected 113, is %d", + check_msg->reserved[211]); + ck_assert_msg(check_msg->reserved[212] == 5, + "incorrect value for reserved[212], expected 5, is %d", + check_msg->reserved[212]); + ck_assert_msg(check_msg->reserved[213] == 141, + "incorrect value for reserved[213], expected 141, is %d", + check_msg->reserved[213]); + ck_assert_msg(check_msg->reserved[214] == 232, + "incorrect value for reserved[214], expected 232, is %d", + check_msg->reserved[214]); + ck_assert_msg(check_msg->reserved[215] == 33, + "incorrect value for reserved[215], expected 33, is %d", + check_msg->reserved[215]); + ck_assert_msg(check_msg->reserved[216] == 101, + "incorrect value for reserved[216], expected 101, is %d", + check_msg->reserved[216]); + ck_assert_msg(check_msg->reserved[217] == 231, + "incorrect value for reserved[217], expected 231, is %d", + check_msg->reserved[217]); + ck_assert_msg(check_msg->reserved[218] == 38, + "incorrect value for reserved[218], expected 38, is %d", + check_msg->reserved[218]); + ck_assert_msg(check_msg->reserved[219] == 75, + "incorrect value for reserved[219], expected 75, is %d", + check_msg->reserved[219]); + ck_assert_msg(check_msg->reserved[220] == 178, + "incorrect value for reserved[220], expected 178, is %d", + check_msg->reserved[220]); + ck_assert_msg(check_msg->reserved[221] == 243, + "incorrect value for reserved[221], expected 243, is %d", + check_msg->reserved[221]); + ck_assert_msg(check_msg->reserved[222] == 119, + "incorrect value for reserved[222], expected 119, is %d", + check_msg->reserved[222]); + ck_assert_msg(check_msg->reserved[223] == 1, + "incorrect value for reserved[223], expected 1, is %d", + check_msg->reserved[223]); + ck_assert_msg(check_msg->reserved[224] == 248, + "incorrect value for reserved[224], expected 248, is %d", + check_msg->reserved[224]); + ck_assert_msg(check_msg->reserved[225] == 218, + "incorrect value for reserved[225], expected 218, is %d", + check_msg->reserved[225]); + ck_assert_msg(check_msg->reserved[226] == 86, + "incorrect value for reserved[226], expected 86, is %d", + check_msg->reserved[226]); + ck_assert_msg(check_msg->reserved[227] == 7, + "incorrect value for reserved[227], expected 7, is %d", + check_msg->reserved[227]); + ck_assert_msg(check_msg->reserved[228] == 88, + "incorrect value for reserved[228], expected 88, is %d", + check_msg->reserved[228]); + ck_assert_msg(check_msg->reserved[229] == 197, + "incorrect value for reserved[229], expected 197, is %d", + check_msg->reserved[229]); + ck_assert_msg(check_msg->reserved[230] == 148, + "incorrect value for reserved[230], expected 148, is %d", + check_msg->reserved[230]); + ck_assert_msg(check_msg->reserved[231] == 240, + "incorrect value for reserved[231], expected 240, is %d", + check_msg->reserved[231]); + ck_assert_msg(check_msg->reserved[232] == 227, + "incorrect value for reserved[232], expected 227, is %d", + check_msg->reserved[232]); + ck_assert_msg(check_msg->reserved[233] == 2, + "incorrect value for reserved[233], expected 2, is %d", + check_msg->reserved[233]); + ck_assert_msg(check_msg->reserved[234] == 65, + "incorrect value for reserved[234], expected 65, is %d", + check_msg->reserved[234]); + ck_assert_msg(check_msg->reserved[235] == 173, + "incorrect value for reserved[235], expected 173, is %d", + check_msg->reserved[235]); + ck_assert_msg(check_msg->reserved[236] == 122, + "incorrect value for reserved[236], expected 122, is %d", + check_msg->reserved[236]); + ck_assert_msg(check_msg->reserved[237] == 143, + "incorrect value for reserved[237], expected 143, is %d", + check_msg->reserved[237]); + ck_assert_msg(check_msg->reserved[238] == 251, + "incorrect value for reserved[238], expected 251, is %d", + check_msg->reserved[238]); + ck_assert_msg(check_msg->reserved[239] == 156, + "incorrect value for reserved[239], expected 156, is %d", + check_msg->reserved[239]); + ck_assert_msg(check_msg->reserved[240] == 217, + "incorrect value for reserved[240], expected 217, is %d", + check_msg->reserved[240]); + ck_assert_msg(check_msg->reserved[241] == 67, + "incorrect value for reserved[241], expected 67, is %d", + check_msg->reserved[241]); + ck_assert_msg(check_msg->reserved[242] == 239, + "incorrect value for reserved[242], expected 239, is %d", + check_msg->reserved[242]); + ck_assert_msg(check_msg->reserved[243] == 219, + "incorrect value for reserved[243], expected 219, is %d", + check_msg->reserved[243]); + ck_assert_msg(check_msg->reserved[244] == 31, + "incorrect value for reserved[244], expected 31, is %d", + check_msg->reserved[244]); + ck_assert_msg(check_msg->reserved[245] == 224, + "incorrect value for reserved[245], expected 224, is %d", + check_msg->reserved[245]); + ck_assert_msg(check_msg->reserved[246] == 176, + "incorrect value for reserved[246], expected 176, is %d", + check_msg->reserved[246]); + ck_assert_msg(check_msg->reserved[247] == 129, + "incorrect value for reserved[247], expected 129, is %d", + check_msg->reserved[247]); + ck_assert_msg(check_msg->reserved[248] == 81, + "incorrect value for reserved[248], expected 81, is %d", + check_msg->reserved[248]); + ck_assert_msg(check_msg->reserved[249] == 80, + "incorrect value for reserved[249], expected 80, is %d", + check_msg->reserved[249]); + ck_assert_msg( + (check_msg->signal_error_rate * 100 - 8588.20019531 * 100) < 0.05, + "incorrect value for signal_error_rate, expected 8588.20019531, is %f", + check_msg->signal_error_rate); + ck_assert_msg(check_msg->signal_strength == 103, + "incorrect value for signal_strength, expected 103, is %d", + check_msg->signal_strength); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgCellModemStatus_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgCellModemStatus"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgCellModemStatus"); +Suite *legacy_auto_check_sbp_piksi_MsgCellModemStatus_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_piksi_MsgCellModemStatus"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_piksi_MsgCellModemStatus"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgCellModemStatus); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgCommandOutput.c b/c/test/legacy/auto_check_sbp_piksi_MsgCommandOutput.c index 963547580..74536fc7a 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgCommandOutput.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgCommandOutput.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandOutput.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandOutput.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgCommandOutput ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgCommandOutput) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgCommandOutput ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,87 +128,111 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgCommandOutput ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xbc, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xbc, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xbc, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xbc, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,188,0,50,84,20,126,164,116,149,83,111,109,101,32,111,117,116,112,117,116,32,116,101,120,116,11,109, }; + u8 encoded_frame[] = { + 85, 188, 0, 50, 84, 20, 126, 164, 116, 149, 83, 111, 109, 101, + 32, 111, 117, 116, 112, 117, 116, 32, 116, 101, 120, 116, 11, 109, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_command_output_t* test_msg = ( msg_command_output_t* )test_msg_storage; + msg_command_output_t *test_msg = (msg_command_output_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)83,(char)111,(char)109,(char)101,(char)32,(char)111,(char)117,(char)116,(char)112,(char)117,(char)116,(char)32,(char)116,(char)101,(char)120,(char)116 }; + const char assign_string[] = {(char)83, (char)111, (char)109, (char)101, + (char)32, (char)111, (char)117, (char)116, + (char)112, (char)117, (char)116, (char)32, + (char)116, (char)101, (char)120, (char)116}; memcpy(test_msg->line, assign_string, sizeof(assign_string)); if (sizeof(test_msg->line) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->sequence = 2507449470; - sbp_payload_send(&sbp_state, 0xbc, 21554, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xbc, 21554, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 21554, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 21554, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xbc, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_command_output_t* check_msg = ( msg_command_output_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_command_output_t *check_msg = + (msg_command_output_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)83,(char)111,(char)109,(char)101,(char)32,(char)111,(char)117,(char)116,(char)112,(char)117,(char)116,(char)32,(char)116,(char)101,(char)120,(char)116 }; - ck_assert_msg(memcmp(check_msg->line, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->line, expected string '%s', is '%s'", check_string, check_msg->line); + const char check_string[] = {(char)83, (char)111, (char)109, (char)101, + (char)32, (char)111, (char)117, (char)116, + (char)112, (char)117, (char)116, (char)32, + (char)116, (char)101, (char)120, (char)116}; + ck_assert_msg( + memcmp(check_msg->line, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->line, expected string '%s', is '%s'", + check_string, check_msg->line); } - ck_assert_msg(check_msg->sequence == 2507449470, "incorrect value for sequence, expected 2507449470, is %d", check_msg->sequence); + ck_assert_msg(check_msg->sequence == 2507449470, + "incorrect value for sequence, expected 2507449470, is %d", + check_msg->sequence); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgCommandOutput_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgCommandOutput"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgCommandOutput"); +Suite *legacy_auto_check_sbp_piksi_MsgCommandOutput_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgCommandOutput"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_piksi_MsgCommandOutput"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgCommandOutput); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgCommandReq.c b/c/test/legacy/auto_check_sbp_piksi_MsgCommandReq.c index faeeced3e..e90f6050c 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgCommandReq.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgCommandReq.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandReq.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgCommandReq ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgCommandReq) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgCommandReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,87 +128,116 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgCommandReq ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xb8, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xb8, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xb8, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xb8, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,184,0,170,184,31,51,77,163,104,47,112,97,116,104,47,116,111,47,99,111,109,109,97,110,100,32,119,105,116,104,32,97,114,103,115,0,38,24, }; + u8 encoded_frame[] = { + 85, 184, 0, 170, 184, 31, 51, 77, 163, 104, 47, 112, 97, + 116, 104, 47, 116, 111, 47, 99, 111, 109, 109, 97, 110, 100, + 32, 119, 105, 116, 104, 32, 97, 114, 103, 115, 0, 38, 24, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_command_req_t* test_msg = ( msg_command_req_t* )test_msg_storage; + msg_command_req_t *test_msg = (msg_command_req_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)99,(char)111,(char)109,(char)109,(char)97,(char)110,(char)100,(char)32,(char)119,(char)105,(char)116,(char)104,(char)32,(char)97,(char)114,(char)103,(char)115,(char)0 }; + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)99, (char)111, (char)109, + (char)109, (char)97, (char)110, (char)100, (char)32, (char)119, + (char)105, (char)116, (char)104, (char)32, (char)97, (char)114, + (char)103, (char)115, (char)0}; memcpy(test_msg->command, assign_string, sizeof(assign_string)); if (sizeof(test_msg->command) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->sequence = 1755532595; - sbp_payload_send(&sbp_state, 0xb8, 47274, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xb8, 47274, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 47274, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 47274, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xb8, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_command_req_t* check_msg = ( msg_command_req_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_command_req_t *check_msg = (msg_command_req_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)99,(char)111,(char)109,(char)109,(char)97,(char)110,(char)100,(char)32,(char)119,(char)105,(char)116,(char)104,(char)32,(char)97,(char)114,(char)103,(char)115,(char)0 }; - ck_assert_msg(memcmp(check_msg->command, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->command, expected string '%s', is '%s'", check_string, check_msg->command); + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)99, (char)111, (char)109, + (char)109, (char)97, (char)110, (char)100, (char)32, (char)119, + (char)105, (char)116, (char)104, (char)32, (char)97, (char)114, + (char)103, (char)115, (char)0}; + ck_assert_msg( + memcmp(check_msg->command, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->command, expected string '%s', is " + "'%s'", + check_string, check_msg->command); } - ck_assert_msg(check_msg->sequence == 1755532595, "incorrect value for sequence, expected 1755532595, is %d", check_msg->sequence); + ck_assert_msg(check_msg->sequence == 1755532595, + "incorrect value for sequence, expected 1755532595, is %d", + check_msg->sequence); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgCommandReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgCommandReq"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgCommandReq"); +Suite *legacy_auto_check_sbp_piksi_MsgCommandReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgCommandReq"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgCommandReq"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgCommandReq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgCommandResp.c b/c/test/legacy/auto_check_sbp_piksi_MsgCommandResp.c index 7e9ad2f02..947414617 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgCommandResp.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgCommandResp.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandResp.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgCommandResp ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgCommandResp) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgCommandResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,78 +128,95 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgCommandResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xb9, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xb9, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xb9, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xb9, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,185,0,57,206,8,118,215,131,160,210,110,150,103,164,240, }; + u8 encoded_frame[] = { + 85, 185, 0, 57, 206, 8, 118, 215, + 131, 160, 210, 110, 150, 103, 164, 240, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_command_resp_t* test_msg = ( msg_command_resp_t* )test_msg_storage; + msg_command_resp_t *test_msg = (msg_command_resp_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->code = 1737912018; test_msg->sequence = 2692994934; - sbp_payload_send(&sbp_state, 0xb9, 52793, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xb9, 52793, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 52793, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 52793, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xb9, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_command_resp_t* check_msg = ( msg_command_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_command_resp_t *check_msg = + (msg_command_resp_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->code == 1737912018, "incorrect value for code, expected 1737912018, is %d", check_msg->code); - ck_assert_msg(check_msg->sequence == 2692994934, "incorrect value for sequence, expected 2692994934, is %d", check_msg->sequence); + ck_assert_msg(check_msg->code == 1737912018, + "incorrect value for code, expected 1737912018, is %d", + check_msg->code); + ck_assert_msg(check_msg->sequence == 2692994934, + "incorrect value for sequence, expected 2692994934, is %d", + check_msg->sequence); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgCommandResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgCommandResp"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgCommandResp"); +Suite *legacy_auto_check_sbp_piksi_MsgCommandResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgCommandResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_piksi_MsgCommandResp"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgCommandResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgCwResults.c b/c/test/legacy/auto_check_sbp_piksi_MsgCwResults.c index 64a11ab58..da5100d6d 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgCwResults.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgCwResults.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwResults.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwResults.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgCwResults ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgCwResults) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgCwResults ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,69 +128,80 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgCwResults ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xc0, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xc0, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xc0, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xc0, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,192,0,99,246,0,228,72, }; + u8 encoded_frame[] = { + 85, 192, 0, 99, 246, 0, 228, 72, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - sbp_payload_send(&sbp_state, 0xc0, 63075, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xc0, 63075, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 63075, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 63075, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xc0, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts + // Cast to expected message type - the +6 byte offset is where the payload + // starts } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgCwResults_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgCwResults"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgCwResults"); +Suite *legacy_auto_check_sbp_piksi_MsgCwResults_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgCwResults"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgCwResults"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgCwResults); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgCwStart.c b/c/test/legacy/auto_check_sbp_piksi_MsgCwStart.c index c0e53919a..4454c6075 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgCwStart.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgCwStart.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwStart.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwStart.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgCwStart ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgCwStart) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgCwStart ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,69 +128,80 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgCwStart ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xc1, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xc1, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xc1, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xc1, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,193,0,30,179,0,213,138, }; + u8 encoded_frame[] = { + 85, 193, 0, 30, 179, 0, 213, 138, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - sbp_payload_send(&sbp_state, 0xc1, 45854, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xc1, 45854, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 45854, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 45854, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xc1, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts + // Cast to expected message type - the +6 byte offset is where the payload + // starts } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgCwStart_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgCwStart"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgCwStart"); +Suite *legacy_auto_check_sbp_piksi_MsgCwStart_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgCwStart"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgCwStart"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgCwStart); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgDeviceMonitor.c b/c/test/legacy/auto_check_sbp_piksi_MsgDeviceMonitor.c index 202d7e190..86aacf8e7 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgDeviceMonitor.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgDeviceMonitor.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgDeviceMonitor.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgDeviceMonitor.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,81 +128,104 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xb5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xb5, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xb5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xb5, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,181,0,95,66,10,241,216,219,3,253,6,21,24,168,18,207,233, }; + u8 encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 219, + 3, 253, 6, 21, 24, 168, 18, 207, 233, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_device_monitor_t* test_msg = ( msg_device_monitor_t* )test_msg_storage; + msg_device_monitor_t* test_msg = (msg_device_monitor_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu_temperature = 6165; test_msg->cpu_vaux = 1789; test_msg->cpu_vint = 987; test_msg->dev_vin = -9999; test_msg->fe_temperature = 4776; - sbp_payload_send(&sbp_state, 0xb5, 16991, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xb5, 16991, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 16991, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 16991, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xb5, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_device_monitor_t* check_msg = ( msg_device_monitor_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_device_monitor_t* check_msg = + (msg_device_monitor_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu_temperature == 6165, "incorrect value for cpu_temperature, expected 6165, is %d", check_msg->cpu_temperature); - ck_assert_msg(check_msg->cpu_vaux == 1789, "incorrect value for cpu_vaux, expected 1789, is %d", check_msg->cpu_vaux); - ck_assert_msg(check_msg->cpu_vint == 987, "incorrect value for cpu_vint, expected 987, is %d", check_msg->cpu_vint); - ck_assert_msg(check_msg->dev_vin == -9999, "incorrect value for dev_vin, expected -9999, is %d", check_msg->dev_vin); - ck_assert_msg(check_msg->fe_temperature == 4776, "incorrect value for fe_temperature, expected 4776, is %d", check_msg->fe_temperature); + ck_assert_msg(check_msg->cpu_temperature == 6165, + "incorrect value for cpu_temperature, expected 6165, is %d", + check_msg->cpu_temperature); + ck_assert_msg(check_msg->cpu_vaux == 1789, + "incorrect value for cpu_vaux, expected 1789, is %d", + check_msg->cpu_vaux); + ck_assert_msg(check_msg->cpu_vint == 987, + "incorrect value for cpu_vint, expected 987, is %d", + check_msg->cpu_vint); + ck_assert_msg(check_msg->dev_vin == -9999, + "incorrect value for dev_vin, expected -9999, is %d", + check_msg->dev_vin); + ck_assert_msg(check_msg->fe_temperature == 4776, + "incorrect value for fe_temperature, expected 4776, is %d", + check_msg->fe_temperature); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -213,81 +233,104 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xb5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xb5, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xb5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xb5, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,181,0,95,66,10,241,216,219,3,254,6,24,24,168,18,169,30, }; + u8 encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 219, + 3, 254, 6, 24, 24, 168, 18, 169, 30, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_device_monitor_t* test_msg = ( msg_device_monitor_t* )test_msg_storage; + msg_device_monitor_t* test_msg = (msg_device_monitor_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu_temperature = 6168; test_msg->cpu_vaux = 1790; test_msg->cpu_vint = 987; test_msg->dev_vin = -9999; test_msg->fe_temperature = 4776; - sbp_payload_send(&sbp_state, 0xb5, 16991, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xb5, 16991, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 16991, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 16991, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xb5, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_device_monitor_t* check_msg = ( msg_device_monitor_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_device_monitor_t* check_msg = + (msg_device_monitor_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu_temperature == 6168, "incorrect value for cpu_temperature, expected 6168, is %d", check_msg->cpu_temperature); - ck_assert_msg(check_msg->cpu_vaux == 1790, "incorrect value for cpu_vaux, expected 1790, is %d", check_msg->cpu_vaux); - ck_assert_msg(check_msg->cpu_vint == 987, "incorrect value for cpu_vint, expected 987, is %d", check_msg->cpu_vint); - ck_assert_msg(check_msg->dev_vin == -9999, "incorrect value for dev_vin, expected -9999, is %d", check_msg->dev_vin); - ck_assert_msg(check_msg->fe_temperature == 4776, "incorrect value for fe_temperature, expected 4776, is %d", check_msg->fe_temperature); + ck_assert_msg(check_msg->cpu_temperature == 6168, + "incorrect value for cpu_temperature, expected 6168, is %d", + check_msg->cpu_temperature); + ck_assert_msg(check_msg->cpu_vaux == 1790, + "incorrect value for cpu_vaux, expected 1790, is %d", + check_msg->cpu_vaux); + ck_assert_msg(check_msg->cpu_vint == 987, + "incorrect value for cpu_vint, expected 987, is %d", + check_msg->cpu_vint); + ck_assert_msg(check_msg->dev_vin == -9999, + "incorrect value for dev_vin, expected -9999, is %d", + check_msg->dev_vin); + ck_assert_msg(check_msg->fe_temperature == 4776, + "incorrect value for fe_temperature, expected 4776, is %d", + check_msg->fe_temperature); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -295,81 +338,104 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xb5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xb5, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xb5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xb5, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,181,0,95,66,10,241,216,219,3,253,6,22,24,168,18,19,114, }; + u8 encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 219, + 3, 253, 6, 22, 24, 168, 18, 19, 114, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_device_monitor_t* test_msg = ( msg_device_monitor_t* )test_msg_storage; + msg_device_monitor_t* test_msg = (msg_device_monitor_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu_temperature = 6166; test_msg->cpu_vaux = 1789; test_msg->cpu_vint = 987; test_msg->dev_vin = -9999; test_msg->fe_temperature = 4776; - sbp_payload_send(&sbp_state, 0xb5, 16991, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xb5, 16991, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 16991, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 16991, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xb5, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_device_monitor_t* check_msg = ( msg_device_monitor_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_device_monitor_t* check_msg = + (msg_device_monitor_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu_temperature == 6166, "incorrect value for cpu_temperature, expected 6166, is %d", check_msg->cpu_temperature); - ck_assert_msg(check_msg->cpu_vaux == 1789, "incorrect value for cpu_vaux, expected 1789, is %d", check_msg->cpu_vaux); - ck_assert_msg(check_msg->cpu_vint == 987, "incorrect value for cpu_vint, expected 987, is %d", check_msg->cpu_vint); - ck_assert_msg(check_msg->dev_vin == -9999, "incorrect value for dev_vin, expected -9999, is %d", check_msg->dev_vin); - ck_assert_msg(check_msg->fe_temperature == 4776, "incorrect value for fe_temperature, expected 4776, is %d", check_msg->fe_temperature); + ck_assert_msg(check_msg->cpu_temperature == 6166, + "incorrect value for cpu_temperature, expected 6166, is %d", + check_msg->cpu_temperature); + ck_assert_msg(check_msg->cpu_vaux == 1789, + "incorrect value for cpu_vaux, expected 1789, is %d", + check_msg->cpu_vaux); + ck_assert_msg(check_msg->cpu_vint == 987, + "incorrect value for cpu_vint, expected 987, is %d", + check_msg->cpu_vint); + ck_assert_msg(check_msg->dev_vin == -9999, + "incorrect value for dev_vin, expected -9999, is %d", + check_msg->dev_vin); + ck_assert_msg(check_msg->fe_temperature == 4776, + "incorrect value for fe_temperature, expected 4776, is %d", + check_msg->fe_temperature); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -377,81 +443,104 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xb5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xb5, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xb5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xb5, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,181,0,95,66,10,241,216,218,3,252,6,6,24,168,18,199,107, }; + u8 encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 218, + 3, 252, 6, 6, 24, 168, 18, 199, 107, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_device_monitor_t* test_msg = ( msg_device_monitor_t* )test_msg_storage; + msg_device_monitor_t* test_msg = (msg_device_monitor_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu_temperature = 6150; test_msg->cpu_vaux = 1788; test_msg->cpu_vint = 986; test_msg->dev_vin = -9999; test_msg->fe_temperature = 4776; - sbp_payload_send(&sbp_state, 0xb5, 16991, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xb5, 16991, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 16991, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 16991, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xb5, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_device_monitor_t* check_msg = ( msg_device_monitor_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_device_monitor_t* check_msg = + (msg_device_monitor_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu_temperature == 6150, "incorrect value for cpu_temperature, expected 6150, is %d", check_msg->cpu_temperature); - ck_assert_msg(check_msg->cpu_vaux == 1788, "incorrect value for cpu_vaux, expected 1788, is %d", check_msg->cpu_vaux); - ck_assert_msg(check_msg->cpu_vint == 986, "incorrect value for cpu_vint, expected 986, is %d", check_msg->cpu_vint); - ck_assert_msg(check_msg->dev_vin == -9999, "incorrect value for dev_vin, expected -9999, is %d", check_msg->dev_vin); - ck_assert_msg(check_msg->fe_temperature == 4776, "incorrect value for fe_temperature, expected 4776, is %d", check_msg->fe_temperature); + ck_assert_msg(check_msg->cpu_temperature == 6150, + "incorrect value for cpu_temperature, expected 6150, is %d", + check_msg->cpu_temperature); + ck_assert_msg(check_msg->cpu_vaux == 1788, + "incorrect value for cpu_vaux, expected 1788, is %d", + check_msg->cpu_vaux); + ck_assert_msg(check_msg->cpu_vint == 986, + "incorrect value for cpu_vint, expected 986, is %d", + check_msg->cpu_vint); + ck_assert_msg(check_msg->dev_vin == -9999, + "incorrect value for dev_vin, expected -9999, is %d", + check_msg->dev_vin); + ck_assert_msg(check_msg->fe_temperature == 4776, + "incorrect value for fe_temperature, expected 4776, is %d", + check_msg->fe_temperature); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -459,84 +548,107 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xb5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xb5, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xb5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xb5, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,181,0,95,66,10,241,216,220,3,253,6,235,23,168,18,241,63, }; + u8 encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 220, + 3, 253, 6, 235, 23, 168, 18, 241, 63, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_device_monitor_t* test_msg = ( msg_device_monitor_t* )test_msg_storage; + msg_device_monitor_t* test_msg = (msg_device_monitor_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu_temperature = 6123; test_msg->cpu_vaux = 1789; test_msg->cpu_vint = 988; test_msg->dev_vin = -9999; test_msg->fe_temperature = 4776; - sbp_payload_send(&sbp_state, 0xb5, 16991, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xb5, 16991, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 16991, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 16991, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xb5, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_device_monitor_t* check_msg = ( msg_device_monitor_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_device_monitor_t* check_msg = + (msg_device_monitor_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu_temperature == 6123, "incorrect value for cpu_temperature, expected 6123, is %d", check_msg->cpu_temperature); - ck_assert_msg(check_msg->cpu_vaux == 1789, "incorrect value for cpu_vaux, expected 1789, is %d", check_msg->cpu_vaux); - ck_assert_msg(check_msg->cpu_vint == 988, "incorrect value for cpu_vint, expected 988, is %d", check_msg->cpu_vint); - ck_assert_msg(check_msg->dev_vin == -9999, "incorrect value for dev_vin, expected -9999, is %d", check_msg->dev_vin); - ck_assert_msg(check_msg->fe_temperature == 4776, "incorrect value for fe_temperature, expected 4776, is %d", check_msg->fe_temperature); + ck_assert_msg(check_msg->cpu_temperature == 6123, + "incorrect value for cpu_temperature, expected 6123, is %d", + check_msg->cpu_temperature); + ck_assert_msg(check_msg->cpu_vaux == 1789, + "incorrect value for cpu_vaux, expected 1789, is %d", + check_msg->cpu_vaux); + ck_assert_msg(check_msg->cpu_vint == 988, + "incorrect value for cpu_vint, expected 988, is %d", + check_msg->cpu_vint); + ck_assert_msg(check_msg->dev_vin == -9999, + "incorrect value for dev_vin, expected -9999, is %d", + check_msg->dev_vin); + ck_assert_msg(check_msg->fe_temperature == 4776, + "incorrect value for fe_temperature, expected 4776, is %d", + check_msg->fe_temperature); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgDeviceMonitor_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgDeviceMonitor"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgDeviceMonitor"); +Suite* legacy_auto_check_sbp_piksi_MsgDeviceMonitor_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgDeviceMonitor"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_piksi_MsgDeviceMonitor"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgFrontEndGain.c b/c/test/legacy/auto_check_sbp_piksi_MsgFrontEndGain.c index 832a4d22d..f1b601e0c 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgFrontEndGain.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgFrontEndGain.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgFrontEndGain.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgFrontEndGain.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgFrontEndGain ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgFrontEndGain) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgFrontEndGain ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgFrontEndGain ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xbf, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xbf, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xbf, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xbf, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,191,0,175,245,16,41,133,134,10,105,20,38,38,246,233,216,80,187,213,85,2,235,135, }; + u8 encoded_frame[] = { + 85, 191, 0, 175, 245, 16, 41, 133, 134, 10, 105, 20, + 38, 38, 246, 233, 216, 80, 187, 213, 85, 2, 235, 135, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_front_end_gain_t* test_msg = ( msg_front_end_gain_t* )test_msg_storage; + msg_front_end_gain_t *test_msg = (msg_front_end_gain_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->if_gain) == 0) { // Cope with variable length arrays @@ -223,78 +225,118 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgFrontEndGain ) test_msg_len += sizeof(test_msg->rf_gain[0]); } test_msg->rf_gain[7] = 38; - sbp_payload_send(&sbp_state, 0xbf, 62895, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xbf, 62895, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 62895, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 62895, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xbf, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_front_end_gain_t* check_msg = ( msg_front_end_gain_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_front_end_gain_t *check_msg = + (msg_front_end_gain_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->if_gain[0] == -10, "incorrect value for if_gain[0], expected -10, is %d", check_msg->if_gain[0]); - ck_assert_msg(check_msg->if_gain[1] == -23, "incorrect value for if_gain[1], expected -23, is %d", check_msg->if_gain[1]); - ck_assert_msg(check_msg->if_gain[2] == -40, "incorrect value for if_gain[2], expected -40, is %d", check_msg->if_gain[2]); - ck_assert_msg(check_msg->if_gain[3] == 80, "incorrect value for if_gain[3], expected 80, is %d", check_msg->if_gain[3]); - ck_assert_msg(check_msg->if_gain[4] == -69, "incorrect value for if_gain[4], expected -69, is %d", check_msg->if_gain[4]); - ck_assert_msg(check_msg->if_gain[5] == -43, "incorrect value for if_gain[5], expected -43, is %d", check_msg->if_gain[5]); - ck_assert_msg(check_msg->if_gain[6] == 85, "incorrect value for if_gain[6], expected 85, is %d", check_msg->if_gain[6]); - ck_assert_msg(check_msg->if_gain[7] == 2, "incorrect value for if_gain[7], expected 2, is %d", check_msg->if_gain[7]); - ck_assert_msg(check_msg->rf_gain[0] == 41, "incorrect value for rf_gain[0], expected 41, is %d", check_msg->rf_gain[0]); - ck_assert_msg(check_msg->rf_gain[1] == -123, "incorrect value for rf_gain[1], expected -123, is %d", check_msg->rf_gain[1]); - ck_assert_msg(check_msg->rf_gain[2] == -122, "incorrect value for rf_gain[2], expected -122, is %d", check_msg->rf_gain[2]); - ck_assert_msg(check_msg->rf_gain[3] == 10, "incorrect value for rf_gain[3], expected 10, is %d", check_msg->rf_gain[3]); - ck_assert_msg(check_msg->rf_gain[4] == 105, "incorrect value for rf_gain[4], expected 105, is %d", check_msg->rf_gain[4]); - ck_assert_msg(check_msg->rf_gain[5] == 20, "incorrect value for rf_gain[5], expected 20, is %d", check_msg->rf_gain[5]); - ck_assert_msg(check_msg->rf_gain[6] == 38, "incorrect value for rf_gain[6], expected 38, is %d", check_msg->rf_gain[6]); - ck_assert_msg(check_msg->rf_gain[7] == 38, "incorrect value for rf_gain[7], expected 38, is %d", check_msg->rf_gain[7]); + ck_assert_msg(check_msg->if_gain[0] == -10, + "incorrect value for if_gain[0], expected -10, is %d", + check_msg->if_gain[0]); + ck_assert_msg(check_msg->if_gain[1] == -23, + "incorrect value for if_gain[1], expected -23, is %d", + check_msg->if_gain[1]); + ck_assert_msg(check_msg->if_gain[2] == -40, + "incorrect value for if_gain[2], expected -40, is %d", + check_msg->if_gain[2]); + ck_assert_msg(check_msg->if_gain[3] == 80, + "incorrect value for if_gain[3], expected 80, is %d", + check_msg->if_gain[3]); + ck_assert_msg(check_msg->if_gain[4] == -69, + "incorrect value for if_gain[4], expected -69, is %d", + check_msg->if_gain[4]); + ck_assert_msg(check_msg->if_gain[5] == -43, + "incorrect value for if_gain[5], expected -43, is %d", + check_msg->if_gain[5]); + ck_assert_msg(check_msg->if_gain[6] == 85, + "incorrect value for if_gain[6], expected 85, is %d", + check_msg->if_gain[6]); + ck_assert_msg(check_msg->if_gain[7] == 2, + "incorrect value for if_gain[7], expected 2, is %d", + check_msg->if_gain[7]); + ck_assert_msg(check_msg->rf_gain[0] == 41, + "incorrect value for rf_gain[0], expected 41, is %d", + check_msg->rf_gain[0]); + ck_assert_msg(check_msg->rf_gain[1] == -123, + "incorrect value for rf_gain[1], expected -123, is %d", + check_msg->rf_gain[1]); + ck_assert_msg(check_msg->rf_gain[2] == -122, + "incorrect value for rf_gain[2], expected -122, is %d", + check_msg->rf_gain[2]); + ck_assert_msg(check_msg->rf_gain[3] == 10, + "incorrect value for rf_gain[3], expected 10, is %d", + check_msg->rf_gain[3]); + ck_assert_msg(check_msg->rf_gain[4] == 105, + "incorrect value for rf_gain[4], expected 105, is %d", + check_msg->rf_gain[4]); + ck_assert_msg(check_msg->rf_gain[5] == 20, + "incorrect value for rf_gain[5], expected 20, is %d", + check_msg->rf_gain[5]); + ck_assert_msg(check_msg->rf_gain[6] == 38, + "incorrect value for rf_gain[6], expected 38, is %d", + check_msg->rf_gain[6]); + ck_assert_msg(check_msg->rf_gain[7] == 38, + "incorrect value for rf_gain[7], expected 38, is %d", + check_msg->rf_gain[7]); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgFrontEndGain_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgFrontEndGain"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgFrontEndGain"); +Suite *legacy_auto_check_sbp_piksi_MsgFrontEndGain_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgFrontEndGain"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_piksi_MsgFrontEndGain"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgFrontEndGain); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgIarState.c b/c/test/legacy/auto_check_sbp_piksi_MsgIarState.c index 4e67caedc..fa51e4db0 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgIarState.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgIarState.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgIarState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgIarState.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgIarState ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgIarState) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgIarState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,73 +128,86 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgIarState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x19, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x19, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x19, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x19, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,25,0,246,215,4,1,0,0,0,216,140, }; + u8 encoded_frame[] = { + 85, 25, 0, 246, 215, 4, 1, 0, 0, 0, 216, 140, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_iar_state_t* test_msg = ( msg_iar_state_t* )test_msg_storage; + msg_iar_state_t* test_msg = (msg_iar_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->num_hyps = 1; - sbp_payload_send(&sbp_state, 0x19, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x19, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x19, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_iar_state_t* check_msg = ( msg_iar_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_iar_state_t* check_msg = (msg_iar_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->num_hyps == 1, "incorrect value for num_hyps, expected 1, is %d", check_msg->num_hyps); + ck_assert_msg(check_msg->num_hyps == 1, + "incorrect value for num_hyps, expected 1, is %d", + check_msg->num_hyps); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -205,73 +215,86 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgIarState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x19, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x19, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x19, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x19, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,25,0,195,4,4,0,0,0,0,18,176, }; + u8 encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 0, 0, 0, 0, 18, 176, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_iar_state_t* test_msg = ( msg_iar_state_t* )test_msg_storage; + msg_iar_state_t* test_msg = (msg_iar_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->num_hyps = 0; - sbp_payload_send(&sbp_state, 0x19, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x19, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x19, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_iar_state_t* check_msg = ( msg_iar_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_iar_state_t* check_msg = (msg_iar_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->num_hyps == 0, "incorrect value for num_hyps, expected 0, is %d", check_msg->num_hyps); + ck_assert_msg(check_msg->num_hyps == 0, + "incorrect value for num_hyps, expected 0, is %d", + check_msg->num_hyps); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -279,73 +302,86 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgIarState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x19, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x19, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x19, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x19, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,25,0,195,4,4,1,0,0,0,166,198, }; + u8 encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 1, 0, 0, 0, 166, 198, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_iar_state_t* test_msg = ( msg_iar_state_t* )test_msg_storage; + msg_iar_state_t* test_msg = (msg_iar_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->num_hyps = 1; - sbp_payload_send(&sbp_state, 0x19, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x19, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x19, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_iar_state_t* check_msg = ( msg_iar_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_iar_state_t* check_msg = (msg_iar_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->num_hyps == 1, "incorrect value for num_hyps, expected 1, is %d", check_msg->num_hyps); + ck_assert_msg(check_msg->num_hyps == 1, + "incorrect value for num_hyps, expected 1, is %d", + check_msg->num_hyps); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -353,73 +389,86 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgIarState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x19, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x19, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x19, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x19, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,25,0,195,4,4,217,2,0,0,6,133, }; + u8 encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 217, 2, 0, 0, 6, 133, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_iar_state_t* test_msg = ( msg_iar_state_t* )test_msg_storage; + msg_iar_state_t* test_msg = (msg_iar_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->num_hyps = 729; - sbp_payload_send(&sbp_state, 0x19, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x19, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x19, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_iar_state_t* check_msg = ( msg_iar_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_iar_state_t* check_msg = (msg_iar_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->num_hyps == 729, "incorrect value for num_hyps, expected 729, is %d", check_msg->num_hyps); + ck_assert_msg(check_msg->num_hyps == 729, + "incorrect value for num_hyps, expected 729, is %d", + check_msg->num_hyps); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -427,73 +476,86 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgIarState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x19, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x19, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x19, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x19, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,25,0,195,4,4,216,2,0,0,178,243, }; + u8 encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 216, 2, 0, 0, 178, 243, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_iar_state_t* test_msg = ( msg_iar_state_t* )test_msg_storage; + msg_iar_state_t* test_msg = (msg_iar_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->num_hyps = 728; - sbp_payload_send(&sbp_state, 0x19, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x19, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x19, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_iar_state_t* check_msg = ( msg_iar_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_iar_state_t* check_msg = (msg_iar_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->num_hyps == 728, "incorrect value for num_hyps, expected 728, is %d", check_msg->num_hyps); + ck_assert_msg(check_msg->num_hyps == 728, + "incorrect value for num_hyps, expected 728, is %d", + check_msg->num_hyps); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -501,73 +563,86 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgIarState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x19, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x19, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x19, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x19, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,25,0,195,4,4,215,2,0,0,92,39, }; + u8 encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 215, 2, 0, 0, 92, 39, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_iar_state_t* test_msg = ( msg_iar_state_t* )test_msg_storage; + msg_iar_state_t* test_msg = (msg_iar_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->num_hyps = 727; - sbp_payload_send(&sbp_state, 0x19, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x19, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x19, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_iar_state_t* check_msg = ( msg_iar_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_iar_state_t* check_msg = (msg_iar_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->num_hyps == 727, "incorrect value for num_hyps, expected 727, is %d", check_msg->num_hyps); + ck_assert_msg(check_msg->num_hyps == 727, + "incorrect value for num_hyps, expected 727, is %d", + check_msg->num_hyps); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -575,76 +650,89 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgIarState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x19, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x19, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x19, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x19, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,25,0,195,4,4,211,2,0,0,173,237, }; + u8 encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 211, 2, 0, 0, 173, 237, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_iar_state_t* test_msg = ( msg_iar_state_t* )test_msg_storage; + msg_iar_state_t* test_msg = (msg_iar_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->num_hyps = 723; - sbp_payload_send(&sbp_state, 0x19, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x19, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x19, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_iar_state_t* check_msg = ( msg_iar_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_iar_state_t* check_msg = (msg_iar_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->num_hyps == 723, "incorrect value for num_hyps, expected 723, is %d", check_msg->num_hyps); + ck_assert_msg(check_msg->num_hyps == 723, + "incorrect value for num_hyps, expected 723, is %d", + check_msg->num_hyps); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgIarState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgIarState"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgIarState"); +Suite* legacy_auto_check_sbp_piksi_MsgIarState_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgIarState"); + TCase* tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgIarState"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgIarState); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgInitBaseDep.c b/c/test/legacy/auto_check_sbp_piksi_MsgInitBaseDep.c index e26d944e1..fe4efebc3 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgInitBaseDep.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgInitBaseDep.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgInitBaseDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgInitBaseDep.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgInitBaseDep ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgInitBaseDep) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgInitBaseDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,69 +128,80 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgInitBaseDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x23, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x23, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x23, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x23, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,35,0,184,41,0,70,13, }; + u8 encoded_frame[] = { + 85, 35, 0, 184, 41, 0, 70, 13, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - sbp_payload_send(&sbp_state, 0x23, 10680, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x23, 10680, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 10680, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 10680, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x23, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts + // Cast to expected message type - the +6 byte offset is where the payload + // starts } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgInitBaseDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgInitBaseDep"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgInitBaseDep"); +Suite *legacy_auto_check_sbp_piksi_MsgInitBaseDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgInitBaseDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_piksi_MsgInitBaseDep"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgInitBaseDep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgMaskSatellite.c b/c/test/legacy/auto_check_sbp_piksi_MsgMaskSatellite.c index cee5e8c8e..a073f507a 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgMaskSatellite.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgMaskSatellite.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatellite.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatellite.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgMaskSatellite ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgMaskSatellite) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgMaskSatellite ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,80 +128,98 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgMaskSatellite ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x2b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x2b, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x2b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x2b, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,43,0,173,151,3,183,87,57,19,147, }; + u8 encoded_frame[] = { + 85, 43, 0, 173, 151, 3, 183, 87, 57, 19, 147, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_mask_satellite_t* test_msg = ( msg_mask_satellite_t* )test_msg_storage; + msg_mask_satellite_t *test_msg = (msg_mask_satellite_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->mask = 183; test_msg->sid.code = 57; test_msg->sid.sat = 87; - sbp_payload_send(&sbp_state, 0x2b, 38829, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x2b, 38829, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 38829, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 38829, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x2b, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_mask_satellite_t* check_msg = ( msg_mask_satellite_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_mask_satellite_t *check_msg = + (msg_mask_satellite_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->mask == 183, "incorrect value for mask, expected 183, is %d", check_msg->mask); - ck_assert_msg(check_msg->sid.code == 57, "incorrect value for sid.code, expected 57, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.sat == 87, "incorrect value for sid.sat, expected 87, is %d", check_msg->sid.sat); + ck_assert_msg(check_msg->mask == 183, + "incorrect value for mask, expected 183, is %d", + check_msg->mask); + ck_assert_msg(check_msg->sid.code == 57, + "incorrect value for sid.code, expected 57, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.sat == 87, + "incorrect value for sid.sat, expected 87, is %d", + check_msg->sid.sat); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgMaskSatellite_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgMaskSatellite"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgMaskSatellite"); +Suite *legacy_auto_check_sbp_piksi_MsgMaskSatellite_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgMaskSatellite"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_piksi_MsgMaskSatellite"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgMaskSatellite); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgMaskSatelliteDep.c b/c/test/legacy/auto_check_sbp_piksi_MsgMaskSatelliteDep.c index e339a6b46..6e8608b6d 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgMaskSatelliteDep.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgMaskSatelliteDep.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatelliteDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatelliteDep.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,82 +128,104 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x1b, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x1b, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x1b, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x1b, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,27,0,187,134,5,33,2,153,95,4,29,188, }; + u8 encoded_frame[] = { + 85, 27, 0, 187, 134, 5, 33, 2, 153, 95, 4, 29, 188, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_mask_satellite_dep_t* test_msg = ( msg_mask_satellite_dep_t* )test_msg_storage; + msg_mask_satellite_dep_t *test_msg = + (msg_mask_satellite_dep_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->mask = 33; test_msg->sid.code = 95; test_msg->sid.reserved = 4; test_msg->sid.sat = 39170; - sbp_payload_send(&sbp_state, 0x1b, 34491, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x1b, 34491, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 34491, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 34491, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x1b, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_mask_satellite_dep_t* check_msg = ( msg_mask_satellite_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_mask_satellite_dep_t *check_msg = + (msg_mask_satellite_dep_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->mask == 33, "incorrect value for mask, expected 33, is %d", check_msg->mask); - ck_assert_msg(check_msg->sid.code == 95, "incorrect value for sid.code, expected 95, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 4, "incorrect value for sid.reserved, expected 4, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 39170, "incorrect value for sid.sat, expected 39170, is %d", check_msg->sid.sat); + ck_assert_msg(check_msg->mask == 33, + "incorrect value for mask, expected 33, is %d", + check_msg->mask); + ck_assert_msg(check_msg->sid.code == 95, + "incorrect value for sid.code, expected 95, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 4, + "incorrect value for sid.reserved, expected 4, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 39170, + "incorrect value for sid.sat, expected 39170, is %d", + check_msg->sid.sat); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep"); +Suite *legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.c b/c/test/legacy/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.c index cad20d407..9029525a4 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkBandwidthUsage.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkBandwidthUsage.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,36 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xBD, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xBD, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xBD, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xBD, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,189,0,207,121,200,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,99,97,110,48,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,99,97,110,49,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,165,235,94,203,0,0,0,0,237,14,148,240,184,220,202,218,101,116,104,48,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,115,105,116,48,0,0,0,0,0,0,0,0,0,0,0,0,27,133, }; + u8 encoded_frame[] = { + 85, 189, 0, 207, 121, 200, 94, 105, 178, 128, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 99, 97, 110, 48, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 94, 105, 178, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 94, 105, 178, 128, 0, 0, 0, 0, 165, 235, 94, 203, + 0, 0, 0, 0, 237, 14, 148, 240, 184, 220, 202, 218, 101, 116, + 104, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 94, 105, 178, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 111, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 105, + 178, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 115, 105, 116, 48, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 133, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_network_bandwidth_usage_t* test_msg = ( msg_network_bandwidth_usage_t* )test_msg_storage; + msg_network_bandwidth_usage_t *test_msg = + (msg_network_bandwidth_usage_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->interfaces) == 0) { // Cope with variable length arrays @@ -149,8 +165,12 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage ) } test_msg->interfaces[0].duration = 2159176030; { - const char assign_string[] = { (char)99,(char)97,(char)110,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->interfaces[0].interface_name, assign_string, sizeof(assign_string)); + const char assign_string[] = {(char)99, (char)97, (char)110, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->interfaces[0].interface_name, assign_string, + sizeof(assign_string)); if (sizeof(test_msg->interfaces[0].interface_name) == 0) { test_msg_len += sizeof(assign_string); } @@ -164,8 +184,12 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage ) } test_msg->interfaces[1].duration = 2159176030; { - const char assign_string[] = { (char)99,(char)97,(char)110,(char)49,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->interfaces[1].interface_name, assign_string, sizeof(assign_string)); + const char assign_string[] = {(char)99, (char)97, (char)110, (char)49, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->interfaces[1].interface_name, assign_string, + sizeof(assign_string)); if (sizeof(test_msg->interfaces[1].interface_name) == 0) { test_msg_len += sizeof(assign_string); } @@ -179,8 +203,12 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage ) } test_msg->interfaces[2].duration = 2159176030; { - const char assign_string[] = { (char)101,(char)116,(char)104,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->interfaces[2].interface_name, assign_string, sizeof(assign_string)); + const char assign_string[] = {(char)101, (char)116, (char)104, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->interfaces[2].interface_name, assign_string, + sizeof(assign_string)); if (sizeof(test_msg->interfaces[2].interface_name) == 0) { test_msg_len += sizeof(assign_string); } @@ -194,8 +222,12 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage ) } test_msg->interfaces[3].duration = 2159176030; { - const char assign_string[] = { (char)108,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->interfaces[3].interface_name, assign_string, sizeof(assign_string)); + const char assign_string[] = {(char)108, (char)111, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->interfaces[3].interface_name, assign_string, + sizeof(assign_string)); if (sizeof(test_msg->interfaces[3].interface_name) == 0) { test_msg_len += sizeof(assign_string); } @@ -209,8 +241,12 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage ) } test_msg->interfaces[4].duration = 2159176030; { - const char assign_string[] = { (char)115,(char)105,(char)116,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->interfaces[4].interface_name, assign_string, sizeof(assign_string)); + const char assign_string[] = {(char)115, (char)105, (char)116, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->interfaces[4].interface_name, assign_string, + sizeof(assign_string)); if (sizeof(test_msg->interfaces[4].interface_name) == 0) { test_msg_len += sizeof(assign_string); } @@ -218,103 +254,213 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage ) test_msg->interfaces[4].rx_bytes = 0; test_msg->interfaces[4].total_bytes = 0; test_msg->interfaces[4].tx_bytes = 0; - sbp_payload_send(&sbp_state, 0xBD, 31183, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xBD, 31183, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 31183, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 31183, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xBD, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_network_bandwidth_usage_t* check_msg = ( msg_network_bandwidth_usage_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_network_bandwidth_usage_t *check_msg = + (msg_network_bandwidth_usage_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->interfaces[0].duration == 2159176030, "incorrect value for interfaces[0].duration, expected 2159176030, is %d", check_msg->interfaces[0].duration); + ck_assert_msg(check_msg->interfaces[0].duration == 2159176030, + "incorrect value for interfaces[0].duration, expected " + "2159176030, is %d", + check_msg->interfaces[0].duration); { - const char check_string[] = { (char)99,(char)97,(char)110,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->interfaces[0].interface_name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->interfaces[0].interface_name, expected string '%s', is '%s'", check_string, check_msg->interfaces[0].interface_name); + const char check_string[] = {(char)99, (char)97, (char)110, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->interfaces[0].interface_name, check_string, + sizeof(check_string)) == 0, + "incorrect value for check_msg->interfaces[0].interface_name, " + "expected string '%s', is '%s'", + check_string, check_msg->interfaces[0].interface_name); } - ck_assert_msg(check_msg->interfaces[0].rx_bytes == 0, "incorrect value for interfaces[0].rx_bytes, expected 0, is %d", check_msg->interfaces[0].rx_bytes); - ck_assert_msg(check_msg->interfaces[0].total_bytes == 0, "incorrect value for interfaces[0].total_bytes, expected 0, is %d", check_msg->interfaces[0].total_bytes); - ck_assert_msg(check_msg->interfaces[0].tx_bytes == 0, "incorrect value for interfaces[0].tx_bytes, expected 0, is %d", check_msg->interfaces[0].tx_bytes); - ck_assert_msg(check_msg->interfaces[1].duration == 2159176030, "incorrect value for interfaces[1].duration, expected 2159176030, is %d", check_msg->interfaces[1].duration); + ck_assert_msg( + check_msg->interfaces[0].rx_bytes == 0, + "incorrect value for interfaces[0].rx_bytes, expected 0, is %d", + check_msg->interfaces[0].rx_bytes); + ck_assert_msg( + check_msg->interfaces[0].total_bytes == 0, + "incorrect value for interfaces[0].total_bytes, expected 0, is %d", + check_msg->interfaces[0].total_bytes); + ck_assert_msg( + check_msg->interfaces[0].tx_bytes == 0, + "incorrect value for interfaces[0].tx_bytes, expected 0, is %d", + check_msg->interfaces[0].tx_bytes); + ck_assert_msg(check_msg->interfaces[1].duration == 2159176030, + "incorrect value for interfaces[1].duration, expected " + "2159176030, is %d", + check_msg->interfaces[1].duration); { - const char check_string[] = { (char)99,(char)97,(char)110,(char)49,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->interfaces[1].interface_name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->interfaces[1].interface_name, expected string '%s', is '%s'", check_string, check_msg->interfaces[1].interface_name); + const char check_string[] = {(char)99, (char)97, (char)110, (char)49, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->interfaces[1].interface_name, check_string, + sizeof(check_string)) == 0, + "incorrect value for check_msg->interfaces[1].interface_name, " + "expected string '%s', is '%s'", + check_string, check_msg->interfaces[1].interface_name); } - ck_assert_msg(check_msg->interfaces[1].rx_bytes == 0, "incorrect value for interfaces[1].rx_bytes, expected 0, is %d", check_msg->interfaces[1].rx_bytes); - ck_assert_msg(check_msg->interfaces[1].total_bytes == 0, "incorrect value for interfaces[1].total_bytes, expected 0, is %d", check_msg->interfaces[1].total_bytes); - ck_assert_msg(check_msg->interfaces[1].tx_bytes == 0, "incorrect value for interfaces[1].tx_bytes, expected 0, is %d", check_msg->interfaces[1].tx_bytes); - ck_assert_msg(check_msg->interfaces[2].duration == 2159176030, "incorrect value for interfaces[2].duration, expected 2159176030, is %d", check_msg->interfaces[2].duration); + ck_assert_msg( + check_msg->interfaces[1].rx_bytes == 0, + "incorrect value for interfaces[1].rx_bytes, expected 0, is %d", + check_msg->interfaces[1].rx_bytes); + ck_assert_msg( + check_msg->interfaces[1].total_bytes == 0, + "incorrect value for interfaces[1].total_bytes, expected 0, is %d", + check_msg->interfaces[1].total_bytes); + ck_assert_msg( + check_msg->interfaces[1].tx_bytes == 0, + "incorrect value for interfaces[1].tx_bytes, expected 0, is %d", + check_msg->interfaces[1].tx_bytes); + ck_assert_msg(check_msg->interfaces[2].duration == 2159176030, + "incorrect value for interfaces[2].duration, expected " + "2159176030, is %d", + check_msg->interfaces[2].duration); { - const char check_string[] = { (char)101,(char)116,(char)104,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->interfaces[2].interface_name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->interfaces[2].interface_name, expected string '%s', is '%s'", check_string, check_msg->interfaces[2].interface_name); + const char check_string[] = {(char)101, (char)116, (char)104, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->interfaces[2].interface_name, check_string, + sizeof(check_string)) == 0, + "incorrect value for check_msg->interfaces[2].interface_name, " + "expected string '%s', is '%s'", + check_string, check_msg->interfaces[2].interface_name); } - ck_assert_msg(check_msg->interfaces[2].rx_bytes == 4036234989, "incorrect value for interfaces[2].rx_bytes, expected 4036234989, is %d", check_msg->interfaces[2].rx_bytes); - ck_assert_msg(check_msg->interfaces[2].total_bytes == 3411995557, "incorrect value for interfaces[2].total_bytes, expected 3411995557, is %d", check_msg->interfaces[2].total_bytes); - ck_assert_msg(check_msg->interfaces[2].tx_bytes == 3670727864, "incorrect value for interfaces[2].tx_bytes, expected 3670727864, is %d", check_msg->interfaces[2].tx_bytes); - ck_assert_msg(check_msg->interfaces[3].duration == 2159176030, "incorrect value for interfaces[3].duration, expected 2159176030, is %d", check_msg->interfaces[3].duration); + ck_assert_msg(check_msg->interfaces[2].rx_bytes == 4036234989, + "incorrect value for interfaces[2].rx_bytes, expected " + "4036234989, is %d", + check_msg->interfaces[2].rx_bytes); + ck_assert_msg(check_msg->interfaces[2].total_bytes == 3411995557, + "incorrect value for interfaces[2].total_bytes, expected " + "3411995557, is %d", + check_msg->interfaces[2].total_bytes); + ck_assert_msg(check_msg->interfaces[2].tx_bytes == 3670727864, + "incorrect value for interfaces[2].tx_bytes, expected " + "3670727864, is %d", + check_msg->interfaces[2].tx_bytes); + ck_assert_msg(check_msg->interfaces[3].duration == 2159176030, + "incorrect value for interfaces[3].duration, expected " + "2159176030, is %d", + check_msg->interfaces[3].duration); { - const char check_string[] = { (char)108,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->interfaces[3].interface_name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->interfaces[3].interface_name, expected string '%s', is '%s'", check_string, check_msg->interfaces[3].interface_name); + const char check_string[] = {(char)108, (char)111, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->interfaces[3].interface_name, check_string, + sizeof(check_string)) == 0, + "incorrect value for check_msg->interfaces[3].interface_name, " + "expected string '%s', is '%s'", + check_string, check_msg->interfaces[3].interface_name); } - ck_assert_msg(check_msg->interfaces[3].rx_bytes == 0, "incorrect value for interfaces[3].rx_bytes, expected 0, is %d", check_msg->interfaces[3].rx_bytes); - ck_assert_msg(check_msg->interfaces[3].total_bytes == 0, "incorrect value for interfaces[3].total_bytes, expected 0, is %d", check_msg->interfaces[3].total_bytes); - ck_assert_msg(check_msg->interfaces[3].tx_bytes == 0, "incorrect value for interfaces[3].tx_bytes, expected 0, is %d", check_msg->interfaces[3].tx_bytes); - ck_assert_msg(check_msg->interfaces[4].duration == 2159176030, "incorrect value for interfaces[4].duration, expected 2159176030, is %d", check_msg->interfaces[4].duration); + ck_assert_msg( + check_msg->interfaces[3].rx_bytes == 0, + "incorrect value for interfaces[3].rx_bytes, expected 0, is %d", + check_msg->interfaces[3].rx_bytes); + ck_assert_msg( + check_msg->interfaces[3].total_bytes == 0, + "incorrect value for interfaces[3].total_bytes, expected 0, is %d", + check_msg->interfaces[3].total_bytes); + ck_assert_msg( + check_msg->interfaces[3].tx_bytes == 0, + "incorrect value for interfaces[3].tx_bytes, expected 0, is %d", + check_msg->interfaces[3].tx_bytes); + ck_assert_msg(check_msg->interfaces[4].duration == 2159176030, + "incorrect value for interfaces[4].duration, expected " + "2159176030, is %d", + check_msg->interfaces[4].duration); { - const char check_string[] = { (char)115,(char)105,(char)116,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->interfaces[4].interface_name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->interfaces[4].interface_name, expected string '%s', is '%s'", check_string, check_msg->interfaces[4].interface_name); + const char check_string[] = {(char)115, (char)105, (char)116, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->interfaces[4].interface_name, check_string, + sizeof(check_string)) == 0, + "incorrect value for check_msg->interfaces[4].interface_name, " + "expected string '%s', is '%s'", + check_string, check_msg->interfaces[4].interface_name); } - ck_assert_msg(check_msg->interfaces[4].rx_bytes == 0, "incorrect value for interfaces[4].rx_bytes, expected 0, is %d", check_msg->interfaces[4].rx_bytes); - ck_assert_msg(check_msg->interfaces[4].total_bytes == 0, "incorrect value for interfaces[4].total_bytes, expected 0, is %d", check_msg->interfaces[4].total_bytes); - ck_assert_msg(check_msg->interfaces[4].tx_bytes == 0, "incorrect value for interfaces[4].tx_bytes, expected 0, is %d", check_msg->interfaces[4].tx_bytes); + ck_assert_msg( + check_msg->interfaces[4].rx_bytes == 0, + "incorrect value for interfaces[4].rx_bytes, expected 0, is %d", + check_msg->interfaces[4].rx_bytes); + ck_assert_msg( + check_msg->interfaces[4].total_bytes == 0, + "incorrect value for interfaces[4].total_bytes, expected 0, is %d", + check_msg->interfaces[4].total_bytes); + ck_assert_msg( + check_msg->interfaces[4].tx_bytes == 0, + "incorrect value for interfaces[4].tx_bytes, expected 0, is %d", + check_msg->interfaces[4].tx_bytes); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage); +Suite *legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgNetworkStateReq.c b/c/test/legacy/auto_check_sbp_piksi_MsgNetworkStateReq.c index a747c4b35..e8dcd2f34 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgNetworkStateReq.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgNetworkStateReq.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkStateReq ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgNetworkStateReq) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkStateReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,69 +128,81 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkStateReq ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xba, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xba, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xba, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xba, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,186,0,83,62,0,148,73, }; + u8 encoded_frame[] = { + 85, 186, 0, 83, 62, 0, 148, 73, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - sbp_payload_send(&sbp_state, 0xba, 15955, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xba, 15955, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 15955, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 15955, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xba, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts + // Cast to expected message type - the +6 byte offset is where the payload + // starts } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgNetworkStateReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgNetworkStateReq"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgNetworkStateReq"); +Suite *legacy_auto_check_sbp_piksi_MsgNetworkStateReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_piksi_MsgNetworkStateReq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_piksi_MsgNetworkStateReq"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgNetworkStateReq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgNetworkStateResp.c b/c/test/legacy/auto_check_sbp_piksi_MsgNetworkStateResp.c index 83002123e..3725068db 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgNetworkStateResp.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgNetworkStateResp.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkStateResp ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgNetworkStateResp) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkStateResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,21 +128,33 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkStateResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xbb, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xbb, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xbb, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xbb, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,187,0,40,15,50,143,241,84,180,152,194,137,32,44,114,147,68,222,92,192,78,235,63,208,114,53,183,24,244,231,26,105,25,136,3,105,102,48,0,0,0,0,0,0,0,0,0,0,0,0,0,195,229,80,147,118,193, }; + u8 encoded_frame[] = { + 85, 187, 0, 40, 15, 50, 143, 241, 84, 180, 152, 194, + 137, 32, 44, 114, 147, 68, 222, 92, 192, 78, 235, 63, + 208, 114, 53, 183, 24, 244, 231, 26, 105, 25, 136, 3, + 105, 102, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 195, 229, 80, 147, 118, 193, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_network_state_resp_t* test_msg = ( msg_network_state_resp_t* )test_msg_storage; + msg_network_state_resp_t *test_msg = + (msg_network_state_resp_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 2471552451; { - const char assign_string[] = { (char)105,(char)102,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = {(char)105, (char)102, (char)48, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg->interface_name, assign_string, sizeof(assign_string)); if (sizeof(test_msg->interface_name) == 0) { test_msg_len += sizeof(assign_string); @@ -255,91 +264,157 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgNetworkStateResp ) test_msg->ipv6_mask_size = 183; test_msg->rx_bytes = 451408920; test_msg->tx_bytes = 59251049; - sbp_payload_send(&sbp_state, 0xbb, 3880, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xbb, 3880, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 3880, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 3880, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xbb, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_network_state_resp_t* check_msg = ( msg_network_state_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_network_state_resp_t *check_msg = + (msg_network_state_resp_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 2471552451, "incorrect value for flags, expected 2471552451, is %d", check_msg->flags); + ck_assert_msg(check_msg->flags == 2471552451, + "incorrect value for flags, expected 2471552451, is %d", + check_msg->flags); { - const char check_string[] = { (char)105,(char)102,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->interface_name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->interface_name, expected string '%s', is '%s'", check_string, check_msg->interface_name); + const char check_string[] = {(char)105, (char)102, (char)48, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg(memcmp(check_msg->interface_name, check_string, + sizeof(check_string)) == 0, + "incorrect value for check_msg->interface_name, expected " + "string '%s', is '%s'", + check_string, check_msg->interface_name); } - ck_assert_msg(check_msg->ipv4_address[0] == 143, "incorrect value for ipv4_address[0], expected 143, is %d", check_msg->ipv4_address[0]); - ck_assert_msg(check_msg->ipv4_address[1] == 241, "incorrect value for ipv4_address[1], expected 241, is %d", check_msg->ipv4_address[1]); - ck_assert_msg(check_msg->ipv4_address[2] == 84, "incorrect value for ipv4_address[2], expected 84, is %d", check_msg->ipv4_address[2]); - ck_assert_msg(check_msg->ipv4_address[3] == 180, "incorrect value for ipv4_address[3], expected 180, is %d", check_msg->ipv4_address[3]); - ck_assert_msg(check_msg->ipv4_mask_size == 152, "incorrect value for ipv4_mask_size, expected 152, is %d", check_msg->ipv4_mask_size); - ck_assert_msg(check_msg->ipv6_address[0] == 194, "incorrect value for ipv6_address[0], expected 194, is %d", check_msg->ipv6_address[0]); - ck_assert_msg(check_msg->ipv6_address[1] == 137, "incorrect value for ipv6_address[1], expected 137, is %d", check_msg->ipv6_address[1]); - ck_assert_msg(check_msg->ipv6_address[2] == 32, "incorrect value for ipv6_address[2], expected 32, is %d", check_msg->ipv6_address[2]); - ck_assert_msg(check_msg->ipv6_address[3] == 44, "incorrect value for ipv6_address[3], expected 44, is %d", check_msg->ipv6_address[3]); - ck_assert_msg(check_msg->ipv6_address[4] == 114, "incorrect value for ipv6_address[4], expected 114, is %d", check_msg->ipv6_address[4]); - ck_assert_msg(check_msg->ipv6_address[5] == 147, "incorrect value for ipv6_address[5], expected 147, is %d", check_msg->ipv6_address[5]); - ck_assert_msg(check_msg->ipv6_address[6] == 68, "incorrect value for ipv6_address[6], expected 68, is %d", check_msg->ipv6_address[6]); - ck_assert_msg(check_msg->ipv6_address[7] == 222, "incorrect value for ipv6_address[7], expected 222, is %d", check_msg->ipv6_address[7]); - ck_assert_msg(check_msg->ipv6_address[8] == 92, "incorrect value for ipv6_address[8], expected 92, is %d", check_msg->ipv6_address[8]); - ck_assert_msg(check_msg->ipv6_address[9] == 192, "incorrect value for ipv6_address[9], expected 192, is %d", check_msg->ipv6_address[9]); - ck_assert_msg(check_msg->ipv6_address[10] == 78, "incorrect value for ipv6_address[10], expected 78, is %d", check_msg->ipv6_address[10]); - ck_assert_msg(check_msg->ipv6_address[11] == 235, "incorrect value for ipv6_address[11], expected 235, is %d", check_msg->ipv6_address[11]); - ck_assert_msg(check_msg->ipv6_address[12] == 63, "incorrect value for ipv6_address[12], expected 63, is %d", check_msg->ipv6_address[12]); - ck_assert_msg(check_msg->ipv6_address[13] == 208, "incorrect value for ipv6_address[13], expected 208, is %d", check_msg->ipv6_address[13]); - ck_assert_msg(check_msg->ipv6_address[14] == 114, "incorrect value for ipv6_address[14], expected 114, is %d", check_msg->ipv6_address[14]); - ck_assert_msg(check_msg->ipv6_address[15] == 53, "incorrect value for ipv6_address[15], expected 53, is %d", check_msg->ipv6_address[15]); - ck_assert_msg(check_msg->ipv6_mask_size == 183, "incorrect value for ipv6_mask_size, expected 183, is %d", check_msg->ipv6_mask_size); - ck_assert_msg(check_msg->rx_bytes == 451408920, "incorrect value for rx_bytes, expected 451408920, is %d", check_msg->rx_bytes); - ck_assert_msg(check_msg->tx_bytes == 59251049, "incorrect value for tx_bytes, expected 59251049, is %d", check_msg->tx_bytes); + ck_assert_msg(check_msg->ipv4_address[0] == 143, + "incorrect value for ipv4_address[0], expected 143, is %d", + check_msg->ipv4_address[0]); + ck_assert_msg(check_msg->ipv4_address[1] == 241, + "incorrect value for ipv4_address[1], expected 241, is %d", + check_msg->ipv4_address[1]); + ck_assert_msg(check_msg->ipv4_address[2] == 84, + "incorrect value for ipv4_address[2], expected 84, is %d", + check_msg->ipv4_address[2]); + ck_assert_msg(check_msg->ipv4_address[3] == 180, + "incorrect value for ipv4_address[3], expected 180, is %d", + check_msg->ipv4_address[3]); + ck_assert_msg(check_msg->ipv4_mask_size == 152, + "incorrect value for ipv4_mask_size, expected 152, is %d", + check_msg->ipv4_mask_size); + ck_assert_msg(check_msg->ipv6_address[0] == 194, + "incorrect value for ipv6_address[0], expected 194, is %d", + check_msg->ipv6_address[0]); + ck_assert_msg(check_msg->ipv6_address[1] == 137, + "incorrect value for ipv6_address[1], expected 137, is %d", + check_msg->ipv6_address[1]); + ck_assert_msg(check_msg->ipv6_address[2] == 32, + "incorrect value for ipv6_address[2], expected 32, is %d", + check_msg->ipv6_address[2]); + ck_assert_msg(check_msg->ipv6_address[3] == 44, + "incorrect value for ipv6_address[3], expected 44, is %d", + check_msg->ipv6_address[3]); + ck_assert_msg(check_msg->ipv6_address[4] == 114, + "incorrect value for ipv6_address[4], expected 114, is %d", + check_msg->ipv6_address[4]); + ck_assert_msg(check_msg->ipv6_address[5] == 147, + "incorrect value for ipv6_address[5], expected 147, is %d", + check_msg->ipv6_address[5]); + ck_assert_msg(check_msg->ipv6_address[6] == 68, + "incorrect value for ipv6_address[6], expected 68, is %d", + check_msg->ipv6_address[6]); + ck_assert_msg(check_msg->ipv6_address[7] == 222, + "incorrect value for ipv6_address[7], expected 222, is %d", + check_msg->ipv6_address[7]); + ck_assert_msg(check_msg->ipv6_address[8] == 92, + "incorrect value for ipv6_address[8], expected 92, is %d", + check_msg->ipv6_address[8]); + ck_assert_msg(check_msg->ipv6_address[9] == 192, + "incorrect value for ipv6_address[9], expected 192, is %d", + check_msg->ipv6_address[9]); + ck_assert_msg(check_msg->ipv6_address[10] == 78, + "incorrect value for ipv6_address[10], expected 78, is %d", + check_msg->ipv6_address[10]); + ck_assert_msg(check_msg->ipv6_address[11] == 235, + "incorrect value for ipv6_address[11], expected 235, is %d", + check_msg->ipv6_address[11]); + ck_assert_msg(check_msg->ipv6_address[12] == 63, + "incorrect value for ipv6_address[12], expected 63, is %d", + check_msg->ipv6_address[12]); + ck_assert_msg(check_msg->ipv6_address[13] == 208, + "incorrect value for ipv6_address[13], expected 208, is %d", + check_msg->ipv6_address[13]); + ck_assert_msg(check_msg->ipv6_address[14] == 114, + "incorrect value for ipv6_address[14], expected 114, is %d", + check_msg->ipv6_address[14]); + ck_assert_msg(check_msg->ipv6_address[15] == 53, + "incorrect value for ipv6_address[15], expected 53, is %d", + check_msg->ipv6_address[15]); + ck_assert_msg(check_msg->ipv6_mask_size == 183, + "incorrect value for ipv6_mask_size, expected 183, is %d", + check_msg->ipv6_mask_size); + ck_assert_msg(check_msg->rx_bytes == 451408920, + "incorrect value for rx_bytes, expected 451408920, is %d", + check_msg->rx_bytes); + ck_assert_msg(check_msg->tx_bytes == 59251049, + "incorrect value for tx_bytes, expected 59251049, is %d", + check_msg->tx_bytes); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgNetworkStateResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgNetworkStateResp"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgNetworkStateResp"); +Suite *legacy_auto_check_sbp_piksi_MsgNetworkStateResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_piksi_MsgNetworkStateResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_piksi_MsgNetworkStateResp"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgNetworkStateResp); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgReset.c b/c/test/legacy/auto_check_sbp_piksi_MsgReset.c index 7656a3725..c6d08dcd2 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgReset.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgReset.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgReset.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgReset.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgReset ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgReset) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgReset ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,76 +128,89 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgReset ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xb6, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xb6, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xb6, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xb6, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,182,0,63,210,4,88,248,238,19,74,207, }; + u8 encoded_frame[] = { + 85, 182, 0, 63, 210, 4, 88, 248, 238, 19, 74, 207, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_reset_t* test_msg = ( msg_reset_t* )test_msg_storage; + msg_reset_t *test_msg = (msg_reset_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 334428248; - sbp_payload_send(&sbp_state, 0xb6, 53823, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xb6, 53823, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 53823, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 53823, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xb6, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_reset_t* check_msg = ( msg_reset_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_reset_t *check_msg = (msg_reset_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 334428248, "incorrect value for flags, expected 334428248, is %d", check_msg->flags); + ck_assert_msg(check_msg->flags == 334428248, + "incorrect value for flags, expected 334428248, is %d", + check_msg->flags); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgReset_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgReset"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgReset"); +Suite *legacy_auto_check_sbp_piksi_MsgReset_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgReset"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgReset"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgReset); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgResetDep.c b/c/test/legacy/auto_check_sbp_piksi_MsgResetDep.c index dad7cc241..a1468a2d7 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgResetDep.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgResetDep.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetDep.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgResetDep ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgResetDep) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgResetDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,69 +128,80 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgResetDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xb2, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xb2, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xb2, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xb2, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,178,0,64,11,0,234,171, }; + u8 encoded_frame[] = { + 85, 178, 0, 64, 11, 0, 234, 171, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - sbp_payload_send(&sbp_state, 0xb2, 2880, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xb2, 2880, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 2880, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 2880, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xb2, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts + // Cast to expected message type - the +6 byte offset is where the payload + // starts } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgResetDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgResetDep"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgResetDep"); +Suite *legacy_auto_check_sbp_piksi_MsgResetDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgResetDep"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgResetDep"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgResetDep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgResetFilters.c b/c/test/legacy/auto_check_sbp_piksi_MsgResetFilters.c index ff781b058..4e2ebceda 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgResetFilters.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgResetFilters.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetFilters.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetFilters.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgResetFilters ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgResetFilters) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgResetFilters ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,76 +128,90 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgResetFilters ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x22, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x22, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x22, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x22, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,34,0,81,200,1,100,130,45, }; + u8 encoded_frame[] = { + 85, 34, 0, 81, 200, 1, 100, 130, 45, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_reset_filters_t* test_msg = ( msg_reset_filters_t* )test_msg_storage; + msg_reset_filters_t *test_msg = (msg_reset_filters_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->filter = 100; - sbp_payload_send(&sbp_state, 0x22, 51281, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x22, 51281, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 51281, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 51281, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x22, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_reset_filters_t* check_msg = ( msg_reset_filters_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_reset_filters_t *check_msg = + (msg_reset_filters_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->filter == 100, "incorrect value for filter, expected 100, is %d", check_msg->filter); + ck_assert_msg(check_msg->filter == 100, + "incorrect value for filter, expected 100, is %d", + check_msg->filter); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgResetFilters_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgResetFilters"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgResetFilters"); +Suite *legacy_auto_check_sbp_piksi_MsgResetFilters_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgResetFilters"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_piksi_MsgResetFilters"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgResetFilters); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgSetTime.c b/c/test/legacy/auto_check_sbp_piksi_MsgSetTime.c index 4522ed8a1..6cfe67f62 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgSetTime.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgSetTime.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSetTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSetTime.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgSetTime ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgSetTime) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgSetTime ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,69 +128,80 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgSetTime ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x68, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x68, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x68, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x68, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,104,0,21,170,0,215,65, }; + u8 encoded_frame[] = { + 85, 104, 0, 21, 170, 0, 215, 65, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - sbp_payload_send(&sbp_state, 0x68, 43541, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x68, 43541, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 43541, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 43541, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x68, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts + // Cast to expected message type - the +6 byte offset is where the payload + // starts } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgSetTime_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgSetTime"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgSetTime"); +Suite *legacy_auto_check_sbp_piksi_MsgSetTime_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgSetTime"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgSetTime"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgSetTime); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgSpecan.c b/c/test/legacy/auto_check_sbp_piksi_MsgSpecan.c index 9421f85f9..d739e9546 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgSpecan.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgSpecan.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecan.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecan.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgSpecan ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgSpecan) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgSpecan ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,39 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgSpecan ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x51, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x51, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x51, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x51, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,81,0,28,212,255,74,137,71,245,34,73,12,221,215,167,211,19,154,201,241,69,205,136,0,70,51,67,108,69,102,38,166,68,100,179,185,17,175,49,193,228,228,47,33,24,141,177,18,99,246,121,61,40,91,145,223,167,174,9,116,11,247,84,49,153,205,2,230,194,218,241,101,107,45,137,93,114,230,43,224,23,74,209,199,211,130,89,220,163,68,20,253,7,206,50,129,116,194,23,31,226,217,157,205,221,5,224,92,82,109,223,195,233,165,1,82,141,157,177,169,244,131,96,109,111,253,149,28,225,225,72,158,158,210,196,206,70,63,225,184,150,174,240,45,146,59,82,194,4,179,148,66,254,115,77,30,46,4,204,37,200,121,18,17,171,102,163,175,50,66,101,69,13,223,172,160,233,220,101,237,156,62,117,47,143,94,135,22,155,113,110,15,243,141,227,46,143,227,209,249,2,153,168,131,249,160,88,38,117,129,57,40,109,209,177,38,47,12,15,16,9,175,69,70,182,239,117,135,6,71,99,230,115,2,71,165,228,123,210,168,90,124,20,7,220,144,168,69,22,72,162,69,111,91,251,72,220,28,119,150,95,2, }; + u8 encoded_frame[] = { + 85, 81, 0, 28, 212, 255, 74, 137, 71, 245, 34, 73, 12, 221, + 215, 167, 211, 19, 154, 201, 241, 69, 205, 136, 0, 70, 51, 67, + 108, 69, 102, 38, 166, 68, 100, 179, 185, 17, 175, 49, 193, 228, + 228, 47, 33, 24, 141, 177, 18, 99, 246, 121, 61, 40, 91, 145, + 223, 167, 174, 9, 116, 11, 247, 84, 49, 153, 205, 2, 230, 194, + 218, 241, 101, 107, 45, 137, 93, 114, 230, 43, 224, 23, 74, 209, + 199, 211, 130, 89, 220, 163, 68, 20, 253, 7, 206, 50, 129, 116, + 194, 23, 31, 226, 217, 157, 205, 221, 5, 224, 92, 82, 109, 223, + 195, 233, 165, 1, 82, 141, 157, 177, 169, 244, 131, 96, 109, 111, + 253, 149, 28, 225, 225, 72, 158, 158, 210, 196, 206, 70, 63, 225, + 184, 150, 174, 240, 45, 146, 59, 82, 194, 4, 179, 148, 66, 254, + 115, 77, 30, 46, 4, 204, 37, 200, 121, 18, 17, 171, 102, 163, + 175, 50, 66, 101, 69, 13, 223, 172, 160, 233, 220, 101, 237, 156, + 62, 117, 47, 143, 94, 135, 22, 155, 113, 110, 15, 243, 141, 227, + 46, 143, 227, 209, 249, 2, 153, 168, 131, 249, 160, 88, 38, 117, + 129, 57, 40, 109, 209, 177, 38, 47, 12, 15, 16, 9, 175, 69, + 70, 182, 239, 117, 135, 6, 71, 99, 230, 115, 2, 71, 165, 228, + 123, 210, 168, 90, 124, 20, 7, 220, 144, 168, 69, 22, 72, 162, + 69, 111, 91, 251, 72, 220, 28, 119, 150, 95, 2, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_specan_t* test_msg = ( msg_specan_t* )test_msg_storage; + msg_specan_t *test_msg = (msg_specan_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->amplitude_ref = 3780.199951171875; test_msg->amplitude_unit = 1329.199951171875; @@ -1286,297 +1305,956 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgSpecan ) test_msg->t.ns_residual = -1479025396; test_msg->t.tow = 1227027783; test_msg->t.wn = 5075; - sbp_payload_send(&sbp_state, 0x51, 54300, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x51, 54300, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 54300, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 54300, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x51, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_specan_t* check_msg = ( msg_specan_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_specan_t *check_msg = (msg_specan_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->amplitude_ref*100 - 3780.19995117*100) < 0.05, "incorrect value for amplitude_ref, expected 3780.19995117, is %f", check_msg->amplitude_ref); - ck_assert_msg((check_msg->amplitude_unit*100 - 1329.19995117*100) < 0.05, "incorrect value for amplitude_unit, expected 1329.19995117, is %f", check_msg->amplitude_unit); - ck_assert_msg(check_msg->amplitude_value[0] == 100, "incorrect value for amplitude_value[0], expected 100, is %d", check_msg->amplitude_value[0]); - ck_assert_msg(check_msg->amplitude_value[1] == 179, "incorrect value for amplitude_value[1], expected 179, is %d", check_msg->amplitude_value[1]); - ck_assert_msg(check_msg->amplitude_value[2] == 185, "incorrect value for amplitude_value[2], expected 185, is %d", check_msg->amplitude_value[2]); - ck_assert_msg(check_msg->amplitude_value[3] == 17, "incorrect value for amplitude_value[3], expected 17, is %d", check_msg->amplitude_value[3]); - ck_assert_msg(check_msg->amplitude_value[4] == 175, "incorrect value for amplitude_value[4], expected 175, is %d", check_msg->amplitude_value[4]); - ck_assert_msg(check_msg->amplitude_value[5] == 49, "incorrect value for amplitude_value[5], expected 49, is %d", check_msg->amplitude_value[5]); - ck_assert_msg(check_msg->amplitude_value[6] == 193, "incorrect value for amplitude_value[6], expected 193, is %d", check_msg->amplitude_value[6]); - ck_assert_msg(check_msg->amplitude_value[7] == 228, "incorrect value for amplitude_value[7], expected 228, is %d", check_msg->amplitude_value[7]); - ck_assert_msg(check_msg->amplitude_value[8] == 228, "incorrect value for amplitude_value[8], expected 228, is %d", check_msg->amplitude_value[8]); - ck_assert_msg(check_msg->amplitude_value[9] == 47, "incorrect value for amplitude_value[9], expected 47, is %d", check_msg->amplitude_value[9]); - ck_assert_msg(check_msg->amplitude_value[10] == 33, "incorrect value for amplitude_value[10], expected 33, is %d", check_msg->amplitude_value[10]); - ck_assert_msg(check_msg->amplitude_value[11] == 24, "incorrect value for amplitude_value[11], expected 24, is %d", check_msg->amplitude_value[11]); - ck_assert_msg(check_msg->amplitude_value[12] == 141, "incorrect value for amplitude_value[12], expected 141, is %d", check_msg->amplitude_value[12]); - ck_assert_msg(check_msg->amplitude_value[13] == 177, "incorrect value for amplitude_value[13], expected 177, is %d", check_msg->amplitude_value[13]); - ck_assert_msg(check_msg->amplitude_value[14] == 18, "incorrect value for amplitude_value[14], expected 18, is %d", check_msg->amplitude_value[14]); - ck_assert_msg(check_msg->amplitude_value[15] == 99, "incorrect value for amplitude_value[15], expected 99, is %d", check_msg->amplitude_value[15]); - ck_assert_msg(check_msg->amplitude_value[16] == 246, "incorrect value for amplitude_value[16], expected 246, is %d", check_msg->amplitude_value[16]); - ck_assert_msg(check_msg->amplitude_value[17] == 121, "incorrect value for amplitude_value[17], expected 121, is %d", check_msg->amplitude_value[17]); - ck_assert_msg(check_msg->amplitude_value[18] == 61, "incorrect value for amplitude_value[18], expected 61, is %d", check_msg->amplitude_value[18]); - ck_assert_msg(check_msg->amplitude_value[19] == 40, "incorrect value for amplitude_value[19], expected 40, is %d", check_msg->amplitude_value[19]); - ck_assert_msg(check_msg->amplitude_value[20] == 91, "incorrect value for amplitude_value[20], expected 91, is %d", check_msg->amplitude_value[20]); - ck_assert_msg(check_msg->amplitude_value[21] == 145, "incorrect value for amplitude_value[21], expected 145, is %d", check_msg->amplitude_value[21]); - ck_assert_msg(check_msg->amplitude_value[22] == 223, "incorrect value for amplitude_value[22], expected 223, is %d", check_msg->amplitude_value[22]); - ck_assert_msg(check_msg->amplitude_value[23] == 167, "incorrect value for amplitude_value[23], expected 167, is %d", check_msg->amplitude_value[23]); - ck_assert_msg(check_msg->amplitude_value[24] == 174, "incorrect value for amplitude_value[24], expected 174, is %d", check_msg->amplitude_value[24]); - ck_assert_msg(check_msg->amplitude_value[25] == 9, "incorrect value for amplitude_value[25], expected 9, is %d", check_msg->amplitude_value[25]); - ck_assert_msg(check_msg->amplitude_value[26] == 116, "incorrect value for amplitude_value[26], expected 116, is %d", check_msg->amplitude_value[26]); - ck_assert_msg(check_msg->amplitude_value[27] == 11, "incorrect value for amplitude_value[27], expected 11, is %d", check_msg->amplitude_value[27]); - ck_assert_msg(check_msg->amplitude_value[28] == 247, "incorrect value for amplitude_value[28], expected 247, is %d", check_msg->amplitude_value[28]); - ck_assert_msg(check_msg->amplitude_value[29] == 84, "incorrect value for amplitude_value[29], expected 84, is %d", check_msg->amplitude_value[29]); - ck_assert_msg(check_msg->amplitude_value[30] == 49, "incorrect value for amplitude_value[30], expected 49, is %d", check_msg->amplitude_value[30]); - ck_assert_msg(check_msg->amplitude_value[31] == 153, "incorrect value for amplitude_value[31], expected 153, is %d", check_msg->amplitude_value[31]); - ck_assert_msg(check_msg->amplitude_value[32] == 205, "incorrect value for amplitude_value[32], expected 205, is %d", check_msg->amplitude_value[32]); - ck_assert_msg(check_msg->amplitude_value[33] == 2, "incorrect value for amplitude_value[33], expected 2, is %d", check_msg->amplitude_value[33]); - ck_assert_msg(check_msg->amplitude_value[34] == 230, "incorrect value for amplitude_value[34], expected 230, is %d", check_msg->amplitude_value[34]); - ck_assert_msg(check_msg->amplitude_value[35] == 194, "incorrect value for amplitude_value[35], expected 194, is %d", check_msg->amplitude_value[35]); - ck_assert_msg(check_msg->amplitude_value[36] == 218, "incorrect value for amplitude_value[36], expected 218, is %d", check_msg->amplitude_value[36]); - ck_assert_msg(check_msg->amplitude_value[37] == 241, "incorrect value for amplitude_value[37], expected 241, is %d", check_msg->amplitude_value[37]); - ck_assert_msg(check_msg->amplitude_value[38] == 101, "incorrect value for amplitude_value[38], expected 101, is %d", check_msg->amplitude_value[38]); - ck_assert_msg(check_msg->amplitude_value[39] == 107, "incorrect value for amplitude_value[39], expected 107, is %d", check_msg->amplitude_value[39]); - ck_assert_msg(check_msg->amplitude_value[40] == 45, "incorrect value for amplitude_value[40], expected 45, is %d", check_msg->amplitude_value[40]); - ck_assert_msg(check_msg->amplitude_value[41] == 137, "incorrect value for amplitude_value[41], expected 137, is %d", check_msg->amplitude_value[41]); - ck_assert_msg(check_msg->amplitude_value[42] == 93, "incorrect value for amplitude_value[42], expected 93, is %d", check_msg->amplitude_value[42]); - ck_assert_msg(check_msg->amplitude_value[43] == 114, "incorrect value for amplitude_value[43], expected 114, is %d", check_msg->amplitude_value[43]); - ck_assert_msg(check_msg->amplitude_value[44] == 230, "incorrect value for amplitude_value[44], expected 230, is %d", check_msg->amplitude_value[44]); - ck_assert_msg(check_msg->amplitude_value[45] == 43, "incorrect value for amplitude_value[45], expected 43, is %d", check_msg->amplitude_value[45]); - ck_assert_msg(check_msg->amplitude_value[46] == 224, "incorrect value for amplitude_value[46], expected 224, is %d", check_msg->amplitude_value[46]); - ck_assert_msg(check_msg->amplitude_value[47] == 23, "incorrect value for amplitude_value[47], expected 23, is %d", check_msg->amplitude_value[47]); - ck_assert_msg(check_msg->amplitude_value[48] == 74, "incorrect value for amplitude_value[48], expected 74, is %d", check_msg->amplitude_value[48]); - ck_assert_msg(check_msg->amplitude_value[49] == 209, "incorrect value for amplitude_value[49], expected 209, is %d", check_msg->amplitude_value[49]); - ck_assert_msg(check_msg->amplitude_value[50] == 199, "incorrect value for amplitude_value[50], expected 199, is %d", check_msg->amplitude_value[50]); - ck_assert_msg(check_msg->amplitude_value[51] == 211, "incorrect value for amplitude_value[51], expected 211, is %d", check_msg->amplitude_value[51]); - ck_assert_msg(check_msg->amplitude_value[52] == 130, "incorrect value for amplitude_value[52], expected 130, is %d", check_msg->amplitude_value[52]); - ck_assert_msg(check_msg->amplitude_value[53] == 89, "incorrect value for amplitude_value[53], expected 89, is %d", check_msg->amplitude_value[53]); - ck_assert_msg(check_msg->amplitude_value[54] == 220, "incorrect value for amplitude_value[54], expected 220, is %d", check_msg->amplitude_value[54]); - ck_assert_msg(check_msg->amplitude_value[55] == 163, "incorrect value for amplitude_value[55], expected 163, is %d", check_msg->amplitude_value[55]); - ck_assert_msg(check_msg->amplitude_value[56] == 68, "incorrect value for amplitude_value[56], expected 68, is %d", check_msg->amplitude_value[56]); - ck_assert_msg(check_msg->amplitude_value[57] == 20, "incorrect value for amplitude_value[57], expected 20, is %d", check_msg->amplitude_value[57]); - ck_assert_msg(check_msg->amplitude_value[58] == 253, "incorrect value for amplitude_value[58], expected 253, is %d", check_msg->amplitude_value[58]); - ck_assert_msg(check_msg->amplitude_value[59] == 7, "incorrect value for amplitude_value[59], expected 7, is %d", check_msg->amplitude_value[59]); - ck_assert_msg(check_msg->amplitude_value[60] == 206, "incorrect value for amplitude_value[60], expected 206, is %d", check_msg->amplitude_value[60]); - ck_assert_msg(check_msg->amplitude_value[61] == 50, "incorrect value for amplitude_value[61], expected 50, is %d", check_msg->amplitude_value[61]); - ck_assert_msg(check_msg->amplitude_value[62] == 129, "incorrect value for amplitude_value[62], expected 129, is %d", check_msg->amplitude_value[62]); - ck_assert_msg(check_msg->amplitude_value[63] == 116, "incorrect value for amplitude_value[63], expected 116, is %d", check_msg->amplitude_value[63]); - ck_assert_msg(check_msg->amplitude_value[64] == 194, "incorrect value for amplitude_value[64], expected 194, is %d", check_msg->amplitude_value[64]); - ck_assert_msg(check_msg->amplitude_value[65] == 23, "incorrect value for amplitude_value[65], expected 23, is %d", check_msg->amplitude_value[65]); - ck_assert_msg(check_msg->amplitude_value[66] == 31, "incorrect value for amplitude_value[66], expected 31, is %d", check_msg->amplitude_value[66]); - ck_assert_msg(check_msg->amplitude_value[67] == 226, "incorrect value for amplitude_value[67], expected 226, is %d", check_msg->amplitude_value[67]); - ck_assert_msg(check_msg->amplitude_value[68] == 217, "incorrect value for amplitude_value[68], expected 217, is %d", check_msg->amplitude_value[68]); - ck_assert_msg(check_msg->amplitude_value[69] == 157, "incorrect value for amplitude_value[69], expected 157, is %d", check_msg->amplitude_value[69]); - ck_assert_msg(check_msg->amplitude_value[70] == 205, "incorrect value for amplitude_value[70], expected 205, is %d", check_msg->amplitude_value[70]); - ck_assert_msg(check_msg->amplitude_value[71] == 221, "incorrect value for amplitude_value[71], expected 221, is %d", check_msg->amplitude_value[71]); - ck_assert_msg(check_msg->amplitude_value[72] == 5, "incorrect value for amplitude_value[72], expected 5, is %d", check_msg->amplitude_value[72]); - ck_assert_msg(check_msg->amplitude_value[73] == 224, "incorrect value for amplitude_value[73], expected 224, is %d", check_msg->amplitude_value[73]); - ck_assert_msg(check_msg->amplitude_value[74] == 92, "incorrect value for amplitude_value[74], expected 92, is %d", check_msg->amplitude_value[74]); - ck_assert_msg(check_msg->amplitude_value[75] == 82, "incorrect value for amplitude_value[75], expected 82, is %d", check_msg->amplitude_value[75]); - ck_assert_msg(check_msg->amplitude_value[76] == 109, "incorrect value for amplitude_value[76], expected 109, is %d", check_msg->amplitude_value[76]); - ck_assert_msg(check_msg->amplitude_value[77] == 223, "incorrect value for amplitude_value[77], expected 223, is %d", check_msg->amplitude_value[77]); - ck_assert_msg(check_msg->amplitude_value[78] == 195, "incorrect value for amplitude_value[78], expected 195, is %d", check_msg->amplitude_value[78]); - ck_assert_msg(check_msg->amplitude_value[79] == 233, "incorrect value for amplitude_value[79], expected 233, is %d", check_msg->amplitude_value[79]); - ck_assert_msg(check_msg->amplitude_value[80] == 165, "incorrect value for amplitude_value[80], expected 165, is %d", check_msg->amplitude_value[80]); - ck_assert_msg(check_msg->amplitude_value[81] == 1, "incorrect value for amplitude_value[81], expected 1, is %d", check_msg->amplitude_value[81]); - ck_assert_msg(check_msg->amplitude_value[82] == 82, "incorrect value for amplitude_value[82], expected 82, is %d", check_msg->amplitude_value[82]); - ck_assert_msg(check_msg->amplitude_value[83] == 141, "incorrect value for amplitude_value[83], expected 141, is %d", check_msg->amplitude_value[83]); - ck_assert_msg(check_msg->amplitude_value[84] == 157, "incorrect value for amplitude_value[84], expected 157, is %d", check_msg->amplitude_value[84]); - ck_assert_msg(check_msg->amplitude_value[85] == 177, "incorrect value for amplitude_value[85], expected 177, is %d", check_msg->amplitude_value[85]); - ck_assert_msg(check_msg->amplitude_value[86] == 169, "incorrect value for amplitude_value[86], expected 169, is %d", check_msg->amplitude_value[86]); - ck_assert_msg(check_msg->amplitude_value[87] == 244, "incorrect value for amplitude_value[87], expected 244, is %d", check_msg->amplitude_value[87]); - ck_assert_msg(check_msg->amplitude_value[88] == 131, "incorrect value for amplitude_value[88], expected 131, is %d", check_msg->amplitude_value[88]); - ck_assert_msg(check_msg->amplitude_value[89] == 96, "incorrect value for amplitude_value[89], expected 96, is %d", check_msg->amplitude_value[89]); - ck_assert_msg(check_msg->amplitude_value[90] == 109, "incorrect value for amplitude_value[90], expected 109, is %d", check_msg->amplitude_value[90]); - ck_assert_msg(check_msg->amplitude_value[91] == 111, "incorrect value for amplitude_value[91], expected 111, is %d", check_msg->amplitude_value[91]); - ck_assert_msg(check_msg->amplitude_value[92] == 253, "incorrect value for amplitude_value[92], expected 253, is %d", check_msg->amplitude_value[92]); - ck_assert_msg(check_msg->amplitude_value[93] == 149, "incorrect value for amplitude_value[93], expected 149, is %d", check_msg->amplitude_value[93]); - ck_assert_msg(check_msg->amplitude_value[94] == 28, "incorrect value for amplitude_value[94], expected 28, is %d", check_msg->amplitude_value[94]); - ck_assert_msg(check_msg->amplitude_value[95] == 225, "incorrect value for amplitude_value[95], expected 225, is %d", check_msg->amplitude_value[95]); - ck_assert_msg(check_msg->amplitude_value[96] == 225, "incorrect value for amplitude_value[96], expected 225, is %d", check_msg->amplitude_value[96]); - ck_assert_msg(check_msg->amplitude_value[97] == 72, "incorrect value for amplitude_value[97], expected 72, is %d", check_msg->amplitude_value[97]); - ck_assert_msg(check_msg->amplitude_value[98] == 158, "incorrect value for amplitude_value[98], expected 158, is %d", check_msg->amplitude_value[98]); - ck_assert_msg(check_msg->amplitude_value[99] == 158, "incorrect value for amplitude_value[99], expected 158, is %d", check_msg->amplitude_value[99]); - ck_assert_msg(check_msg->amplitude_value[100] == 210, "incorrect value for amplitude_value[100], expected 210, is %d", check_msg->amplitude_value[100]); - ck_assert_msg(check_msg->amplitude_value[101] == 196, "incorrect value for amplitude_value[101], expected 196, is %d", check_msg->amplitude_value[101]); - ck_assert_msg(check_msg->amplitude_value[102] == 206, "incorrect value for amplitude_value[102], expected 206, is %d", check_msg->amplitude_value[102]); - ck_assert_msg(check_msg->amplitude_value[103] == 70, "incorrect value for amplitude_value[103], expected 70, is %d", check_msg->amplitude_value[103]); - ck_assert_msg(check_msg->amplitude_value[104] == 63, "incorrect value for amplitude_value[104], expected 63, is %d", check_msg->amplitude_value[104]); - ck_assert_msg(check_msg->amplitude_value[105] == 225, "incorrect value for amplitude_value[105], expected 225, is %d", check_msg->amplitude_value[105]); - ck_assert_msg(check_msg->amplitude_value[106] == 184, "incorrect value for amplitude_value[106], expected 184, is %d", check_msg->amplitude_value[106]); - ck_assert_msg(check_msg->amplitude_value[107] == 150, "incorrect value for amplitude_value[107], expected 150, is %d", check_msg->amplitude_value[107]); - ck_assert_msg(check_msg->amplitude_value[108] == 174, "incorrect value for amplitude_value[108], expected 174, is %d", check_msg->amplitude_value[108]); - ck_assert_msg(check_msg->amplitude_value[109] == 240, "incorrect value for amplitude_value[109], expected 240, is %d", check_msg->amplitude_value[109]); - ck_assert_msg(check_msg->amplitude_value[110] == 45, "incorrect value for amplitude_value[110], expected 45, is %d", check_msg->amplitude_value[110]); - ck_assert_msg(check_msg->amplitude_value[111] == 146, "incorrect value for amplitude_value[111], expected 146, is %d", check_msg->amplitude_value[111]); - ck_assert_msg(check_msg->amplitude_value[112] == 59, "incorrect value for amplitude_value[112], expected 59, is %d", check_msg->amplitude_value[112]); - ck_assert_msg(check_msg->amplitude_value[113] == 82, "incorrect value for amplitude_value[113], expected 82, is %d", check_msg->amplitude_value[113]); - ck_assert_msg(check_msg->amplitude_value[114] == 194, "incorrect value for amplitude_value[114], expected 194, is %d", check_msg->amplitude_value[114]); - ck_assert_msg(check_msg->amplitude_value[115] == 4, "incorrect value for amplitude_value[115], expected 4, is %d", check_msg->amplitude_value[115]); - ck_assert_msg(check_msg->amplitude_value[116] == 179, "incorrect value for amplitude_value[116], expected 179, is %d", check_msg->amplitude_value[116]); - ck_assert_msg(check_msg->amplitude_value[117] == 148, "incorrect value for amplitude_value[117], expected 148, is %d", check_msg->amplitude_value[117]); - ck_assert_msg(check_msg->amplitude_value[118] == 66, "incorrect value for amplitude_value[118], expected 66, is %d", check_msg->amplitude_value[118]); - ck_assert_msg(check_msg->amplitude_value[119] == 254, "incorrect value for amplitude_value[119], expected 254, is %d", check_msg->amplitude_value[119]); - ck_assert_msg(check_msg->amplitude_value[120] == 115, "incorrect value for amplitude_value[120], expected 115, is %d", check_msg->amplitude_value[120]); - ck_assert_msg(check_msg->amplitude_value[121] == 77, "incorrect value for amplitude_value[121], expected 77, is %d", check_msg->amplitude_value[121]); - ck_assert_msg(check_msg->amplitude_value[122] == 30, "incorrect value for amplitude_value[122], expected 30, is %d", check_msg->amplitude_value[122]); - ck_assert_msg(check_msg->amplitude_value[123] == 46, "incorrect value for amplitude_value[123], expected 46, is %d", check_msg->amplitude_value[123]); - ck_assert_msg(check_msg->amplitude_value[124] == 4, "incorrect value for amplitude_value[124], expected 4, is %d", check_msg->amplitude_value[124]); - ck_assert_msg(check_msg->amplitude_value[125] == 204, "incorrect value for amplitude_value[125], expected 204, is %d", check_msg->amplitude_value[125]); - ck_assert_msg(check_msg->amplitude_value[126] == 37, "incorrect value for amplitude_value[126], expected 37, is %d", check_msg->amplitude_value[126]); - ck_assert_msg(check_msg->amplitude_value[127] == 200, "incorrect value for amplitude_value[127], expected 200, is %d", check_msg->amplitude_value[127]); - ck_assert_msg(check_msg->amplitude_value[128] == 121, "incorrect value for amplitude_value[128], expected 121, is %d", check_msg->amplitude_value[128]); - ck_assert_msg(check_msg->amplitude_value[129] == 18, "incorrect value for amplitude_value[129], expected 18, is %d", check_msg->amplitude_value[129]); - ck_assert_msg(check_msg->amplitude_value[130] == 17, "incorrect value for amplitude_value[130], expected 17, is %d", check_msg->amplitude_value[130]); - ck_assert_msg(check_msg->amplitude_value[131] == 171, "incorrect value for amplitude_value[131], expected 171, is %d", check_msg->amplitude_value[131]); - ck_assert_msg(check_msg->amplitude_value[132] == 102, "incorrect value for amplitude_value[132], expected 102, is %d", check_msg->amplitude_value[132]); - ck_assert_msg(check_msg->amplitude_value[133] == 163, "incorrect value for amplitude_value[133], expected 163, is %d", check_msg->amplitude_value[133]); - ck_assert_msg(check_msg->amplitude_value[134] == 175, "incorrect value for amplitude_value[134], expected 175, is %d", check_msg->amplitude_value[134]); - ck_assert_msg(check_msg->amplitude_value[135] == 50, "incorrect value for amplitude_value[135], expected 50, is %d", check_msg->amplitude_value[135]); - ck_assert_msg(check_msg->amplitude_value[136] == 66, "incorrect value for amplitude_value[136], expected 66, is %d", check_msg->amplitude_value[136]); - ck_assert_msg(check_msg->amplitude_value[137] == 101, "incorrect value for amplitude_value[137], expected 101, is %d", check_msg->amplitude_value[137]); - ck_assert_msg(check_msg->amplitude_value[138] == 69, "incorrect value for amplitude_value[138], expected 69, is %d", check_msg->amplitude_value[138]); - ck_assert_msg(check_msg->amplitude_value[139] == 13, "incorrect value for amplitude_value[139], expected 13, is %d", check_msg->amplitude_value[139]); - ck_assert_msg(check_msg->amplitude_value[140] == 223, "incorrect value for amplitude_value[140], expected 223, is %d", check_msg->amplitude_value[140]); - ck_assert_msg(check_msg->amplitude_value[141] == 172, "incorrect value for amplitude_value[141], expected 172, is %d", check_msg->amplitude_value[141]); - ck_assert_msg(check_msg->amplitude_value[142] == 160, "incorrect value for amplitude_value[142], expected 160, is %d", check_msg->amplitude_value[142]); - ck_assert_msg(check_msg->amplitude_value[143] == 233, "incorrect value for amplitude_value[143], expected 233, is %d", check_msg->amplitude_value[143]); - ck_assert_msg(check_msg->amplitude_value[144] == 220, "incorrect value for amplitude_value[144], expected 220, is %d", check_msg->amplitude_value[144]); - ck_assert_msg(check_msg->amplitude_value[145] == 101, "incorrect value for amplitude_value[145], expected 101, is %d", check_msg->amplitude_value[145]); - ck_assert_msg(check_msg->amplitude_value[146] == 237, "incorrect value for amplitude_value[146], expected 237, is %d", check_msg->amplitude_value[146]); - ck_assert_msg(check_msg->amplitude_value[147] == 156, "incorrect value for amplitude_value[147], expected 156, is %d", check_msg->amplitude_value[147]); - ck_assert_msg(check_msg->amplitude_value[148] == 62, "incorrect value for amplitude_value[148], expected 62, is %d", check_msg->amplitude_value[148]); - ck_assert_msg(check_msg->amplitude_value[149] == 117, "incorrect value for amplitude_value[149], expected 117, is %d", check_msg->amplitude_value[149]); - ck_assert_msg(check_msg->amplitude_value[150] == 47, "incorrect value for amplitude_value[150], expected 47, is %d", check_msg->amplitude_value[150]); - ck_assert_msg(check_msg->amplitude_value[151] == 143, "incorrect value for amplitude_value[151], expected 143, is %d", check_msg->amplitude_value[151]); - ck_assert_msg(check_msg->amplitude_value[152] == 94, "incorrect value for amplitude_value[152], expected 94, is %d", check_msg->amplitude_value[152]); - ck_assert_msg(check_msg->amplitude_value[153] == 135, "incorrect value for amplitude_value[153], expected 135, is %d", check_msg->amplitude_value[153]); - ck_assert_msg(check_msg->amplitude_value[154] == 22, "incorrect value for amplitude_value[154], expected 22, is %d", check_msg->amplitude_value[154]); - ck_assert_msg(check_msg->amplitude_value[155] == 155, "incorrect value for amplitude_value[155], expected 155, is %d", check_msg->amplitude_value[155]); - ck_assert_msg(check_msg->amplitude_value[156] == 113, "incorrect value for amplitude_value[156], expected 113, is %d", check_msg->amplitude_value[156]); - ck_assert_msg(check_msg->amplitude_value[157] == 110, "incorrect value for amplitude_value[157], expected 110, is %d", check_msg->amplitude_value[157]); - ck_assert_msg(check_msg->amplitude_value[158] == 15, "incorrect value for amplitude_value[158], expected 15, is %d", check_msg->amplitude_value[158]); - ck_assert_msg(check_msg->amplitude_value[159] == 243, "incorrect value for amplitude_value[159], expected 243, is %d", check_msg->amplitude_value[159]); - ck_assert_msg(check_msg->amplitude_value[160] == 141, "incorrect value for amplitude_value[160], expected 141, is %d", check_msg->amplitude_value[160]); - ck_assert_msg(check_msg->amplitude_value[161] == 227, "incorrect value for amplitude_value[161], expected 227, is %d", check_msg->amplitude_value[161]); - ck_assert_msg(check_msg->amplitude_value[162] == 46, "incorrect value for amplitude_value[162], expected 46, is %d", check_msg->amplitude_value[162]); - ck_assert_msg(check_msg->amplitude_value[163] == 143, "incorrect value for amplitude_value[163], expected 143, is %d", check_msg->amplitude_value[163]); - ck_assert_msg(check_msg->amplitude_value[164] == 227, "incorrect value for amplitude_value[164], expected 227, is %d", check_msg->amplitude_value[164]); - ck_assert_msg(check_msg->amplitude_value[165] == 209, "incorrect value for amplitude_value[165], expected 209, is %d", check_msg->amplitude_value[165]); - ck_assert_msg(check_msg->amplitude_value[166] == 249, "incorrect value for amplitude_value[166], expected 249, is %d", check_msg->amplitude_value[166]); - ck_assert_msg(check_msg->amplitude_value[167] == 2, "incorrect value for amplitude_value[167], expected 2, is %d", check_msg->amplitude_value[167]); - ck_assert_msg(check_msg->amplitude_value[168] == 153, "incorrect value for amplitude_value[168], expected 153, is %d", check_msg->amplitude_value[168]); - ck_assert_msg(check_msg->amplitude_value[169] == 168, "incorrect value for amplitude_value[169], expected 168, is %d", check_msg->amplitude_value[169]); - ck_assert_msg(check_msg->amplitude_value[170] == 131, "incorrect value for amplitude_value[170], expected 131, is %d", check_msg->amplitude_value[170]); - ck_assert_msg(check_msg->amplitude_value[171] == 249, "incorrect value for amplitude_value[171], expected 249, is %d", check_msg->amplitude_value[171]); - ck_assert_msg(check_msg->amplitude_value[172] == 160, "incorrect value for amplitude_value[172], expected 160, is %d", check_msg->amplitude_value[172]); - ck_assert_msg(check_msg->amplitude_value[173] == 88, "incorrect value for amplitude_value[173], expected 88, is %d", check_msg->amplitude_value[173]); - ck_assert_msg(check_msg->amplitude_value[174] == 38, "incorrect value for amplitude_value[174], expected 38, is %d", check_msg->amplitude_value[174]); - ck_assert_msg(check_msg->amplitude_value[175] == 117, "incorrect value for amplitude_value[175], expected 117, is %d", check_msg->amplitude_value[175]); - ck_assert_msg(check_msg->amplitude_value[176] == 129, "incorrect value for amplitude_value[176], expected 129, is %d", check_msg->amplitude_value[176]); - ck_assert_msg(check_msg->amplitude_value[177] == 57, "incorrect value for amplitude_value[177], expected 57, is %d", check_msg->amplitude_value[177]); - ck_assert_msg(check_msg->amplitude_value[178] == 40, "incorrect value for amplitude_value[178], expected 40, is %d", check_msg->amplitude_value[178]); - ck_assert_msg(check_msg->amplitude_value[179] == 109, "incorrect value for amplitude_value[179], expected 109, is %d", check_msg->amplitude_value[179]); - ck_assert_msg(check_msg->amplitude_value[180] == 209, "incorrect value for amplitude_value[180], expected 209, is %d", check_msg->amplitude_value[180]); - ck_assert_msg(check_msg->amplitude_value[181] == 177, "incorrect value for amplitude_value[181], expected 177, is %d", check_msg->amplitude_value[181]); - ck_assert_msg(check_msg->amplitude_value[182] == 38, "incorrect value for amplitude_value[182], expected 38, is %d", check_msg->amplitude_value[182]); - ck_assert_msg(check_msg->amplitude_value[183] == 47, "incorrect value for amplitude_value[183], expected 47, is %d", check_msg->amplitude_value[183]); - ck_assert_msg(check_msg->amplitude_value[184] == 12, "incorrect value for amplitude_value[184], expected 12, is %d", check_msg->amplitude_value[184]); - ck_assert_msg(check_msg->amplitude_value[185] == 15, "incorrect value for amplitude_value[185], expected 15, is %d", check_msg->amplitude_value[185]); - ck_assert_msg(check_msg->amplitude_value[186] == 16, "incorrect value for amplitude_value[186], expected 16, is %d", check_msg->amplitude_value[186]); - ck_assert_msg(check_msg->amplitude_value[187] == 9, "incorrect value for amplitude_value[187], expected 9, is %d", check_msg->amplitude_value[187]); - ck_assert_msg(check_msg->amplitude_value[188] == 175, "incorrect value for amplitude_value[188], expected 175, is %d", check_msg->amplitude_value[188]); - ck_assert_msg(check_msg->amplitude_value[189] == 69, "incorrect value for amplitude_value[189], expected 69, is %d", check_msg->amplitude_value[189]); - ck_assert_msg(check_msg->amplitude_value[190] == 70, "incorrect value for amplitude_value[190], expected 70, is %d", check_msg->amplitude_value[190]); - ck_assert_msg(check_msg->amplitude_value[191] == 182, "incorrect value for amplitude_value[191], expected 182, is %d", check_msg->amplitude_value[191]); - ck_assert_msg(check_msg->amplitude_value[192] == 239, "incorrect value for amplitude_value[192], expected 239, is %d", check_msg->amplitude_value[192]); - ck_assert_msg(check_msg->amplitude_value[193] == 117, "incorrect value for amplitude_value[193], expected 117, is %d", check_msg->amplitude_value[193]); - ck_assert_msg(check_msg->amplitude_value[194] == 135, "incorrect value for amplitude_value[194], expected 135, is %d", check_msg->amplitude_value[194]); - ck_assert_msg(check_msg->amplitude_value[195] == 6, "incorrect value for amplitude_value[195], expected 6, is %d", check_msg->amplitude_value[195]); - ck_assert_msg(check_msg->amplitude_value[196] == 71, "incorrect value for amplitude_value[196], expected 71, is %d", check_msg->amplitude_value[196]); - ck_assert_msg(check_msg->amplitude_value[197] == 99, "incorrect value for amplitude_value[197], expected 99, is %d", check_msg->amplitude_value[197]); - ck_assert_msg(check_msg->amplitude_value[198] == 230, "incorrect value for amplitude_value[198], expected 230, is %d", check_msg->amplitude_value[198]); - ck_assert_msg(check_msg->amplitude_value[199] == 115, "incorrect value for amplitude_value[199], expected 115, is %d", check_msg->amplitude_value[199]); - ck_assert_msg(check_msg->amplitude_value[200] == 2, "incorrect value for amplitude_value[200], expected 2, is %d", check_msg->amplitude_value[200]); - ck_assert_msg(check_msg->amplitude_value[201] == 71, "incorrect value for amplitude_value[201], expected 71, is %d", check_msg->amplitude_value[201]); - ck_assert_msg(check_msg->amplitude_value[202] == 165, "incorrect value for amplitude_value[202], expected 165, is %d", check_msg->amplitude_value[202]); - ck_assert_msg(check_msg->amplitude_value[203] == 228, "incorrect value for amplitude_value[203], expected 228, is %d", check_msg->amplitude_value[203]); - ck_assert_msg(check_msg->amplitude_value[204] == 123, "incorrect value for amplitude_value[204], expected 123, is %d", check_msg->amplitude_value[204]); - ck_assert_msg(check_msg->amplitude_value[205] == 210, "incorrect value for amplitude_value[205], expected 210, is %d", check_msg->amplitude_value[205]); - ck_assert_msg(check_msg->amplitude_value[206] == 168, "incorrect value for amplitude_value[206], expected 168, is %d", check_msg->amplitude_value[206]); - ck_assert_msg(check_msg->amplitude_value[207] == 90, "incorrect value for amplitude_value[207], expected 90, is %d", check_msg->amplitude_value[207]); - ck_assert_msg(check_msg->amplitude_value[208] == 124, "incorrect value for amplitude_value[208], expected 124, is %d", check_msg->amplitude_value[208]); - ck_assert_msg(check_msg->amplitude_value[209] == 20, "incorrect value for amplitude_value[209], expected 20, is %d", check_msg->amplitude_value[209]); - ck_assert_msg(check_msg->amplitude_value[210] == 7, "incorrect value for amplitude_value[210], expected 7, is %d", check_msg->amplitude_value[210]); - ck_assert_msg(check_msg->amplitude_value[211] == 220, "incorrect value for amplitude_value[211], expected 220, is %d", check_msg->amplitude_value[211]); - ck_assert_msg(check_msg->amplitude_value[212] == 144, "incorrect value for amplitude_value[212], expected 144, is %d", check_msg->amplitude_value[212]); - ck_assert_msg(check_msg->amplitude_value[213] == 168, "incorrect value for amplitude_value[213], expected 168, is %d", check_msg->amplitude_value[213]); - ck_assert_msg(check_msg->amplitude_value[214] == 69, "incorrect value for amplitude_value[214], expected 69, is %d", check_msg->amplitude_value[214]); - ck_assert_msg(check_msg->amplitude_value[215] == 22, "incorrect value for amplitude_value[215], expected 22, is %d", check_msg->amplitude_value[215]); - ck_assert_msg(check_msg->amplitude_value[216] == 72, "incorrect value for amplitude_value[216], expected 72, is %d", check_msg->amplitude_value[216]); - ck_assert_msg(check_msg->amplitude_value[217] == 162, "incorrect value for amplitude_value[217], expected 162, is %d", check_msg->amplitude_value[217]); - ck_assert_msg(check_msg->amplitude_value[218] == 69, "incorrect value for amplitude_value[218], expected 69, is %d", check_msg->amplitude_value[218]); - ck_assert_msg(check_msg->amplitude_value[219] == 111, "incorrect value for amplitude_value[219], expected 111, is %d", check_msg->amplitude_value[219]); - ck_assert_msg(check_msg->amplitude_value[220] == 91, "incorrect value for amplitude_value[220], expected 91, is %d", check_msg->amplitude_value[220]); - ck_assert_msg(check_msg->amplitude_value[221] == 251, "incorrect value for amplitude_value[221], expected 251, is %d", check_msg->amplitude_value[221]); - ck_assert_msg(check_msg->amplitude_value[222] == 72, "incorrect value for amplitude_value[222], expected 72, is %d", check_msg->amplitude_value[222]); - ck_assert_msg(check_msg->amplitude_value[223] == 220, "incorrect value for amplitude_value[223], expected 220, is %d", check_msg->amplitude_value[223]); - ck_assert_msg(check_msg->amplitude_value[224] == 28, "incorrect value for amplitude_value[224], expected 28, is %d", check_msg->amplitude_value[224]); - ck_assert_msg(check_msg->amplitude_value[225] == 119, "incorrect value for amplitude_value[225], expected 119, is %d", check_msg->amplitude_value[225]); - ck_assert_msg(check_msg->amplitude_value[226] == 150, "incorrect value for amplitude_value[226], expected 150, is %d", check_msg->amplitude_value[226]); - ck_assert_msg(check_msg->channel_tag == 35146, "incorrect value for channel_tag, expected 35146, is %d", check_msg->channel_tag); - ck_assert_msg((check_msg->freq_ref*100 - 7737.20019531*100) < 0.05, "incorrect value for freq_ref, expected 7737.20019531, is %f", check_msg->freq_ref); - ck_assert_msg((check_msg->freq_step*100 - 8226.20019531*100) < 0.05, "incorrect value for freq_step, expected 8226.20019531, is %f", check_msg->freq_step); - ck_assert_msg(check_msg->t.ns_residual == -1479025396, "incorrect value for t.ns_residual, expected -1479025396, is %d", check_msg->t.ns_residual); - ck_assert_msg(check_msg->t.tow == 1227027783, "incorrect value for t.tow, expected 1227027783, is %d", check_msg->t.tow); - ck_assert_msg(check_msg->t.wn == 5075, "incorrect value for t.wn, expected 5075, is %d", check_msg->t.wn); + ck_assert_msg( + (check_msg->amplitude_ref * 100 - 3780.19995117 * 100) < 0.05, + "incorrect value for amplitude_ref, expected 3780.19995117, is %f", + check_msg->amplitude_ref); + ck_assert_msg( + (check_msg->amplitude_unit * 100 - 1329.19995117 * 100) < 0.05, + "incorrect value for amplitude_unit, expected 1329.19995117, is %f", + check_msg->amplitude_unit); + ck_assert_msg(check_msg->amplitude_value[0] == 100, + "incorrect value for amplitude_value[0], expected 100, is %d", + check_msg->amplitude_value[0]); + ck_assert_msg(check_msg->amplitude_value[1] == 179, + "incorrect value for amplitude_value[1], expected 179, is %d", + check_msg->amplitude_value[1]); + ck_assert_msg(check_msg->amplitude_value[2] == 185, + "incorrect value for amplitude_value[2], expected 185, is %d", + check_msg->amplitude_value[2]); + ck_assert_msg(check_msg->amplitude_value[3] == 17, + "incorrect value for amplitude_value[3], expected 17, is %d", + check_msg->amplitude_value[3]); + ck_assert_msg(check_msg->amplitude_value[4] == 175, + "incorrect value for amplitude_value[4], expected 175, is %d", + check_msg->amplitude_value[4]); + ck_assert_msg(check_msg->amplitude_value[5] == 49, + "incorrect value for amplitude_value[5], expected 49, is %d", + check_msg->amplitude_value[5]); + ck_assert_msg(check_msg->amplitude_value[6] == 193, + "incorrect value for amplitude_value[6], expected 193, is %d", + check_msg->amplitude_value[6]); + ck_assert_msg(check_msg->amplitude_value[7] == 228, + "incorrect value for amplitude_value[7], expected 228, is %d", + check_msg->amplitude_value[7]); + ck_assert_msg(check_msg->amplitude_value[8] == 228, + "incorrect value for amplitude_value[8], expected 228, is %d", + check_msg->amplitude_value[8]); + ck_assert_msg(check_msg->amplitude_value[9] == 47, + "incorrect value for amplitude_value[9], expected 47, is %d", + check_msg->amplitude_value[9]); + ck_assert_msg(check_msg->amplitude_value[10] == 33, + "incorrect value for amplitude_value[10], expected 33, is %d", + check_msg->amplitude_value[10]); + ck_assert_msg(check_msg->amplitude_value[11] == 24, + "incorrect value for amplitude_value[11], expected 24, is %d", + check_msg->amplitude_value[11]); + ck_assert_msg( + check_msg->amplitude_value[12] == 141, + "incorrect value for amplitude_value[12], expected 141, is %d", + check_msg->amplitude_value[12]); + ck_assert_msg( + check_msg->amplitude_value[13] == 177, + "incorrect value for amplitude_value[13], expected 177, is %d", + check_msg->amplitude_value[13]); + ck_assert_msg(check_msg->amplitude_value[14] == 18, + "incorrect value for amplitude_value[14], expected 18, is %d", + check_msg->amplitude_value[14]); + ck_assert_msg(check_msg->amplitude_value[15] == 99, + "incorrect value for amplitude_value[15], expected 99, is %d", + check_msg->amplitude_value[15]); + ck_assert_msg( + check_msg->amplitude_value[16] == 246, + "incorrect value for amplitude_value[16], expected 246, is %d", + check_msg->amplitude_value[16]); + ck_assert_msg( + check_msg->amplitude_value[17] == 121, + "incorrect value for amplitude_value[17], expected 121, is %d", + check_msg->amplitude_value[17]); + ck_assert_msg(check_msg->amplitude_value[18] == 61, + "incorrect value for amplitude_value[18], expected 61, is %d", + check_msg->amplitude_value[18]); + ck_assert_msg(check_msg->amplitude_value[19] == 40, + "incorrect value for amplitude_value[19], expected 40, is %d", + check_msg->amplitude_value[19]); + ck_assert_msg(check_msg->amplitude_value[20] == 91, + "incorrect value for amplitude_value[20], expected 91, is %d", + check_msg->amplitude_value[20]); + ck_assert_msg( + check_msg->amplitude_value[21] == 145, + "incorrect value for amplitude_value[21], expected 145, is %d", + check_msg->amplitude_value[21]); + ck_assert_msg( + check_msg->amplitude_value[22] == 223, + "incorrect value for amplitude_value[22], expected 223, is %d", + check_msg->amplitude_value[22]); + ck_assert_msg( + check_msg->amplitude_value[23] == 167, + "incorrect value for amplitude_value[23], expected 167, is %d", + check_msg->amplitude_value[23]); + ck_assert_msg( + check_msg->amplitude_value[24] == 174, + "incorrect value for amplitude_value[24], expected 174, is %d", + check_msg->amplitude_value[24]); + ck_assert_msg(check_msg->amplitude_value[25] == 9, + "incorrect value for amplitude_value[25], expected 9, is %d", + check_msg->amplitude_value[25]); + ck_assert_msg( + check_msg->amplitude_value[26] == 116, + "incorrect value for amplitude_value[26], expected 116, is %d", + check_msg->amplitude_value[26]); + ck_assert_msg(check_msg->amplitude_value[27] == 11, + "incorrect value for amplitude_value[27], expected 11, is %d", + check_msg->amplitude_value[27]); + ck_assert_msg( + check_msg->amplitude_value[28] == 247, + "incorrect value for amplitude_value[28], expected 247, is %d", + check_msg->amplitude_value[28]); + ck_assert_msg(check_msg->amplitude_value[29] == 84, + "incorrect value for amplitude_value[29], expected 84, is %d", + check_msg->amplitude_value[29]); + ck_assert_msg(check_msg->amplitude_value[30] == 49, + "incorrect value for amplitude_value[30], expected 49, is %d", + check_msg->amplitude_value[30]); + ck_assert_msg( + check_msg->amplitude_value[31] == 153, + "incorrect value for amplitude_value[31], expected 153, is %d", + check_msg->amplitude_value[31]); + ck_assert_msg( + check_msg->amplitude_value[32] == 205, + "incorrect value for amplitude_value[32], expected 205, is %d", + check_msg->amplitude_value[32]); + ck_assert_msg(check_msg->amplitude_value[33] == 2, + "incorrect value for amplitude_value[33], expected 2, is %d", + check_msg->amplitude_value[33]); + ck_assert_msg( + check_msg->amplitude_value[34] == 230, + "incorrect value for amplitude_value[34], expected 230, is %d", + check_msg->amplitude_value[34]); + ck_assert_msg( + check_msg->amplitude_value[35] == 194, + "incorrect value for amplitude_value[35], expected 194, is %d", + check_msg->amplitude_value[35]); + ck_assert_msg( + check_msg->amplitude_value[36] == 218, + "incorrect value for amplitude_value[36], expected 218, is %d", + check_msg->amplitude_value[36]); + ck_assert_msg( + check_msg->amplitude_value[37] == 241, + "incorrect value for amplitude_value[37], expected 241, is %d", + check_msg->amplitude_value[37]); + ck_assert_msg( + check_msg->amplitude_value[38] == 101, + "incorrect value for amplitude_value[38], expected 101, is %d", + check_msg->amplitude_value[38]); + ck_assert_msg( + check_msg->amplitude_value[39] == 107, + "incorrect value for amplitude_value[39], expected 107, is %d", + check_msg->amplitude_value[39]); + ck_assert_msg(check_msg->amplitude_value[40] == 45, + "incorrect value for amplitude_value[40], expected 45, is %d", + check_msg->amplitude_value[40]); + ck_assert_msg( + check_msg->amplitude_value[41] == 137, + "incorrect value for amplitude_value[41], expected 137, is %d", + check_msg->amplitude_value[41]); + ck_assert_msg(check_msg->amplitude_value[42] == 93, + "incorrect value for amplitude_value[42], expected 93, is %d", + check_msg->amplitude_value[42]); + ck_assert_msg( + check_msg->amplitude_value[43] == 114, + "incorrect value for amplitude_value[43], expected 114, is %d", + check_msg->amplitude_value[43]); + ck_assert_msg( + check_msg->amplitude_value[44] == 230, + "incorrect value for amplitude_value[44], expected 230, is %d", + check_msg->amplitude_value[44]); + ck_assert_msg(check_msg->amplitude_value[45] == 43, + "incorrect value for amplitude_value[45], expected 43, is %d", + check_msg->amplitude_value[45]); + ck_assert_msg( + check_msg->amplitude_value[46] == 224, + "incorrect value for amplitude_value[46], expected 224, is %d", + check_msg->amplitude_value[46]); + ck_assert_msg(check_msg->amplitude_value[47] == 23, + "incorrect value for amplitude_value[47], expected 23, is %d", + check_msg->amplitude_value[47]); + ck_assert_msg(check_msg->amplitude_value[48] == 74, + "incorrect value for amplitude_value[48], expected 74, is %d", + check_msg->amplitude_value[48]); + ck_assert_msg( + check_msg->amplitude_value[49] == 209, + "incorrect value for amplitude_value[49], expected 209, is %d", + check_msg->amplitude_value[49]); + ck_assert_msg( + check_msg->amplitude_value[50] == 199, + "incorrect value for amplitude_value[50], expected 199, is %d", + check_msg->amplitude_value[50]); + ck_assert_msg( + check_msg->amplitude_value[51] == 211, + "incorrect value for amplitude_value[51], expected 211, is %d", + check_msg->amplitude_value[51]); + ck_assert_msg( + check_msg->amplitude_value[52] == 130, + "incorrect value for amplitude_value[52], expected 130, is %d", + check_msg->amplitude_value[52]); + ck_assert_msg(check_msg->amplitude_value[53] == 89, + "incorrect value for amplitude_value[53], expected 89, is %d", + check_msg->amplitude_value[53]); + ck_assert_msg( + check_msg->amplitude_value[54] == 220, + "incorrect value for amplitude_value[54], expected 220, is %d", + check_msg->amplitude_value[54]); + ck_assert_msg( + check_msg->amplitude_value[55] == 163, + "incorrect value for amplitude_value[55], expected 163, is %d", + check_msg->amplitude_value[55]); + ck_assert_msg(check_msg->amplitude_value[56] == 68, + "incorrect value for amplitude_value[56], expected 68, is %d", + check_msg->amplitude_value[56]); + ck_assert_msg(check_msg->amplitude_value[57] == 20, + "incorrect value for amplitude_value[57], expected 20, is %d", + check_msg->amplitude_value[57]); + ck_assert_msg( + check_msg->amplitude_value[58] == 253, + "incorrect value for amplitude_value[58], expected 253, is %d", + check_msg->amplitude_value[58]); + ck_assert_msg(check_msg->amplitude_value[59] == 7, + "incorrect value for amplitude_value[59], expected 7, is %d", + check_msg->amplitude_value[59]); + ck_assert_msg( + check_msg->amplitude_value[60] == 206, + "incorrect value for amplitude_value[60], expected 206, is %d", + check_msg->amplitude_value[60]); + ck_assert_msg(check_msg->amplitude_value[61] == 50, + "incorrect value for amplitude_value[61], expected 50, is %d", + check_msg->amplitude_value[61]); + ck_assert_msg( + check_msg->amplitude_value[62] == 129, + "incorrect value for amplitude_value[62], expected 129, is %d", + check_msg->amplitude_value[62]); + ck_assert_msg( + check_msg->amplitude_value[63] == 116, + "incorrect value for amplitude_value[63], expected 116, is %d", + check_msg->amplitude_value[63]); + ck_assert_msg( + check_msg->amplitude_value[64] == 194, + "incorrect value for amplitude_value[64], expected 194, is %d", + check_msg->amplitude_value[64]); + ck_assert_msg(check_msg->amplitude_value[65] == 23, + "incorrect value for amplitude_value[65], expected 23, is %d", + check_msg->amplitude_value[65]); + ck_assert_msg(check_msg->amplitude_value[66] == 31, + "incorrect value for amplitude_value[66], expected 31, is %d", + check_msg->amplitude_value[66]); + ck_assert_msg( + check_msg->amplitude_value[67] == 226, + "incorrect value for amplitude_value[67], expected 226, is %d", + check_msg->amplitude_value[67]); + ck_assert_msg( + check_msg->amplitude_value[68] == 217, + "incorrect value for amplitude_value[68], expected 217, is %d", + check_msg->amplitude_value[68]); + ck_assert_msg( + check_msg->amplitude_value[69] == 157, + "incorrect value for amplitude_value[69], expected 157, is %d", + check_msg->amplitude_value[69]); + ck_assert_msg( + check_msg->amplitude_value[70] == 205, + "incorrect value for amplitude_value[70], expected 205, is %d", + check_msg->amplitude_value[70]); + ck_assert_msg( + check_msg->amplitude_value[71] == 221, + "incorrect value for amplitude_value[71], expected 221, is %d", + check_msg->amplitude_value[71]); + ck_assert_msg(check_msg->amplitude_value[72] == 5, + "incorrect value for amplitude_value[72], expected 5, is %d", + check_msg->amplitude_value[72]); + ck_assert_msg( + check_msg->amplitude_value[73] == 224, + "incorrect value for amplitude_value[73], expected 224, is %d", + check_msg->amplitude_value[73]); + ck_assert_msg(check_msg->amplitude_value[74] == 92, + "incorrect value for amplitude_value[74], expected 92, is %d", + check_msg->amplitude_value[74]); + ck_assert_msg(check_msg->amplitude_value[75] == 82, + "incorrect value for amplitude_value[75], expected 82, is %d", + check_msg->amplitude_value[75]); + ck_assert_msg( + check_msg->amplitude_value[76] == 109, + "incorrect value for amplitude_value[76], expected 109, is %d", + check_msg->amplitude_value[76]); + ck_assert_msg( + check_msg->amplitude_value[77] == 223, + "incorrect value for amplitude_value[77], expected 223, is %d", + check_msg->amplitude_value[77]); + ck_assert_msg( + check_msg->amplitude_value[78] == 195, + "incorrect value for amplitude_value[78], expected 195, is %d", + check_msg->amplitude_value[78]); + ck_assert_msg( + check_msg->amplitude_value[79] == 233, + "incorrect value for amplitude_value[79], expected 233, is %d", + check_msg->amplitude_value[79]); + ck_assert_msg( + check_msg->amplitude_value[80] == 165, + "incorrect value for amplitude_value[80], expected 165, is %d", + check_msg->amplitude_value[80]); + ck_assert_msg(check_msg->amplitude_value[81] == 1, + "incorrect value for amplitude_value[81], expected 1, is %d", + check_msg->amplitude_value[81]); + ck_assert_msg(check_msg->amplitude_value[82] == 82, + "incorrect value for amplitude_value[82], expected 82, is %d", + check_msg->amplitude_value[82]); + ck_assert_msg( + check_msg->amplitude_value[83] == 141, + "incorrect value for amplitude_value[83], expected 141, is %d", + check_msg->amplitude_value[83]); + ck_assert_msg( + check_msg->amplitude_value[84] == 157, + "incorrect value for amplitude_value[84], expected 157, is %d", + check_msg->amplitude_value[84]); + ck_assert_msg( + check_msg->amplitude_value[85] == 177, + "incorrect value for amplitude_value[85], expected 177, is %d", + check_msg->amplitude_value[85]); + ck_assert_msg( + check_msg->amplitude_value[86] == 169, + "incorrect value for amplitude_value[86], expected 169, is %d", + check_msg->amplitude_value[86]); + ck_assert_msg( + check_msg->amplitude_value[87] == 244, + "incorrect value for amplitude_value[87], expected 244, is %d", + check_msg->amplitude_value[87]); + ck_assert_msg( + check_msg->amplitude_value[88] == 131, + "incorrect value for amplitude_value[88], expected 131, is %d", + check_msg->amplitude_value[88]); + ck_assert_msg(check_msg->amplitude_value[89] == 96, + "incorrect value for amplitude_value[89], expected 96, is %d", + check_msg->amplitude_value[89]); + ck_assert_msg( + check_msg->amplitude_value[90] == 109, + "incorrect value for amplitude_value[90], expected 109, is %d", + check_msg->amplitude_value[90]); + ck_assert_msg( + check_msg->amplitude_value[91] == 111, + "incorrect value for amplitude_value[91], expected 111, is %d", + check_msg->amplitude_value[91]); + ck_assert_msg( + check_msg->amplitude_value[92] == 253, + "incorrect value for amplitude_value[92], expected 253, is %d", + check_msg->amplitude_value[92]); + ck_assert_msg( + check_msg->amplitude_value[93] == 149, + "incorrect value for amplitude_value[93], expected 149, is %d", + check_msg->amplitude_value[93]); + ck_assert_msg(check_msg->amplitude_value[94] == 28, + "incorrect value for amplitude_value[94], expected 28, is %d", + check_msg->amplitude_value[94]); + ck_assert_msg( + check_msg->amplitude_value[95] == 225, + "incorrect value for amplitude_value[95], expected 225, is %d", + check_msg->amplitude_value[95]); + ck_assert_msg( + check_msg->amplitude_value[96] == 225, + "incorrect value for amplitude_value[96], expected 225, is %d", + check_msg->amplitude_value[96]); + ck_assert_msg(check_msg->amplitude_value[97] == 72, + "incorrect value for amplitude_value[97], expected 72, is %d", + check_msg->amplitude_value[97]); + ck_assert_msg( + check_msg->amplitude_value[98] == 158, + "incorrect value for amplitude_value[98], expected 158, is %d", + check_msg->amplitude_value[98]); + ck_assert_msg( + check_msg->amplitude_value[99] == 158, + "incorrect value for amplitude_value[99], expected 158, is %d", + check_msg->amplitude_value[99]); + ck_assert_msg( + check_msg->amplitude_value[100] == 210, + "incorrect value for amplitude_value[100], expected 210, is %d", + check_msg->amplitude_value[100]); + ck_assert_msg( + check_msg->amplitude_value[101] == 196, + "incorrect value for amplitude_value[101], expected 196, is %d", + check_msg->amplitude_value[101]); + ck_assert_msg( + check_msg->amplitude_value[102] == 206, + "incorrect value for amplitude_value[102], expected 206, is %d", + check_msg->amplitude_value[102]); + ck_assert_msg( + check_msg->amplitude_value[103] == 70, + "incorrect value for amplitude_value[103], expected 70, is %d", + check_msg->amplitude_value[103]); + ck_assert_msg( + check_msg->amplitude_value[104] == 63, + "incorrect value for amplitude_value[104], expected 63, is %d", + check_msg->amplitude_value[104]); + ck_assert_msg( + check_msg->amplitude_value[105] == 225, + "incorrect value for amplitude_value[105], expected 225, is %d", + check_msg->amplitude_value[105]); + ck_assert_msg( + check_msg->amplitude_value[106] == 184, + "incorrect value for amplitude_value[106], expected 184, is %d", + check_msg->amplitude_value[106]); + ck_assert_msg( + check_msg->amplitude_value[107] == 150, + "incorrect value for amplitude_value[107], expected 150, is %d", + check_msg->amplitude_value[107]); + ck_assert_msg( + check_msg->amplitude_value[108] == 174, + "incorrect value for amplitude_value[108], expected 174, is %d", + check_msg->amplitude_value[108]); + ck_assert_msg( + check_msg->amplitude_value[109] == 240, + "incorrect value for amplitude_value[109], expected 240, is %d", + check_msg->amplitude_value[109]); + ck_assert_msg( + check_msg->amplitude_value[110] == 45, + "incorrect value for amplitude_value[110], expected 45, is %d", + check_msg->amplitude_value[110]); + ck_assert_msg( + check_msg->amplitude_value[111] == 146, + "incorrect value for amplitude_value[111], expected 146, is %d", + check_msg->amplitude_value[111]); + ck_assert_msg( + check_msg->amplitude_value[112] == 59, + "incorrect value for amplitude_value[112], expected 59, is %d", + check_msg->amplitude_value[112]); + ck_assert_msg( + check_msg->amplitude_value[113] == 82, + "incorrect value for amplitude_value[113], expected 82, is %d", + check_msg->amplitude_value[113]); + ck_assert_msg( + check_msg->amplitude_value[114] == 194, + "incorrect value for amplitude_value[114], expected 194, is %d", + check_msg->amplitude_value[114]); + ck_assert_msg(check_msg->amplitude_value[115] == 4, + "incorrect value for amplitude_value[115], expected 4, is %d", + check_msg->amplitude_value[115]); + ck_assert_msg( + check_msg->amplitude_value[116] == 179, + "incorrect value for amplitude_value[116], expected 179, is %d", + check_msg->amplitude_value[116]); + ck_assert_msg( + check_msg->amplitude_value[117] == 148, + "incorrect value for amplitude_value[117], expected 148, is %d", + check_msg->amplitude_value[117]); + ck_assert_msg( + check_msg->amplitude_value[118] == 66, + "incorrect value for amplitude_value[118], expected 66, is %d", + check_msg->amplitude_value[118]); + ck_assert_msg( + check_msg->amplitude_value[119] == 254, + "incorrect value for amplitude_value[119], expected 254, is %d", + check_msg->amplitude_value[119]); + ck_assert_msg( + check_msg->amplitude_value[120] == 115, + "incorrect value for amplitude_value[120], expected 115, is %d", + check_msg->amplitude_value[120]); + ck_assert_msg( + check_msg->amplitude_value[121] == 77, + "incorrect value for amplitude_value[121], expected 77, is %d", + check_msg->amplitude_value[121]); + ck_assert_msg( + check_msg->amplitude_value[122] == 30, + "incorrect value for amplitude_value[122], expected 30, is %d", + check_msg->amplitude_value[122]); + ck_assert_msg( + check_msg->amplitude_value[123] == 46, + "incorrect value for amplitude_value[123], expected 46, is %d", + check_msg->amplitude_value[123]); + ck_assert_msg(check_msg->amplitude_value[124] == 4, + "incorrect value for amplitude_value[124], expected 4, is %d", + check_msg->amplitude_value[124]); + ck_assert_msg( + check_msg->amplitude_value[125] == 204, + "incorrect value for amplitude_value[125], expected 204, is %d", + check_msg->amplitude_value[125]); + ck_assert_msg( + check_msg->amplitude_value[126] == 37, + "incorrect value for amplitude_value[126], expected 37, is %d", + check_msg->amplitude_value[126]); + ck_assert_msg( + check_msg->amplitude_value[127] == 200, + "incorrect value for amplitude_value[127], expected 200, is %d", + check_msg->amplitude_value[127]); + ck_assert_msg( + check_msg->amplitude_value[128] == 121, + "incorrect value for amplitude_value[128], expected 121, is %d", + check_msg->amplitude_value[128]); + ck_assert_msg( + check_msg->amplitude_value[129] == 18, + "incorrect value for amplitude_value[129], expected 18, is %d", + check_msg->amplitude_value[129]); + ck_assert_msg( + check_msg->amplitude_value[130] == 17, + "incorrect value for amplitude_value[130], expected 17, is %d", + check_msg->amplitude_value[130]); + ck_assert_msg( + check_msg->amplitude_value[131] == 171, + "incorrect value for amplitude_value[131], expected 171, is %d", + check_msg->amplitude_value[131]); + ck_assert_msg( + check_msg->amplitude_value[132] == 102, + "incorrect value for amplitude_value[132], expected 102, is %d", + check_msg->amplitude_value[132]); + ck_assert_msg( + check_msg->amplitude_value[133] == 163, + "incorrect value for amplitude_value[133], expected 163, is %d", + check_msg->amplitude_value[133]); + ck_assert_msg( + check_msg->amplitude_value[134] == 175, + "incorrect value for amplitude_value[134], expected 175, is %d", + check_msg->amplitude_value[134]); + ck_assert_msg( + check_msg->amplitude_value[135] == 50, + "incorrect value for amplitude_value[135], expected 50, is %d", + check_msg->amplitude_value[135]); + ck_assert_msg( + check_msg->amplitude_value[136] == 66, + "incorrect value for amplitude_value[136], expected 66, is %d", + check_msg->amplitude_value[136]); + ck_assert_msg( + check_msg->amplitude_value[137] == 101, + "incorrect value for amplitude_value[137], expected 101, is %d", + check_msg->amplitude_value[137]); + ck_assert_msg( + check_msg->amplitude_value[138] == 69, + "incorrect value for amplitude_value[138], expected 69, is %d", + check_msg->amplitude_value[138]); + ck_assert_msg( + check_msg->amplitude_value[139] == 13, + "incorrect value for amplitude_value[139], expected 13, is %d", + check_msg->amplitude_value[139]); + ck_assert_msg( + check_msg->amplitude_value[140] == 223, + "incorrect value for amplitude_value[140], expected 223, is %d", + check_msg->amplitude_value[140]); + ck_assert_msg( + check_msg->amplitude_value[141] == 172, + "incorrect value for amplitude_value[141], expected 172, is %d", + check_msg->amplitude_value[141]); + ck_assert_msg( + check_msg->amplitude_value[142] == 160, + "incorrect value for amplitude_value[142], expected 160, is %d", + check_msg->amplitude_value[142]); + ck_assert_msg( + check_msg->amplitude_value[143] == 233, + "incorrect value for amplitude_value[143], expected 233, is %d", + check_msg->amplitude_value[143]); + ck_assert_msg( + check_msg->amplitude_value[144] == 220, + "incorrect value for amplitude_value[144], expected 220, is %d", + check_msg->amplitude_value[144]); + ck_assert_msg( + check_msg->amplitude_value[145] == 101, + "incorrect value for amplitude_value[145], expected 101, is %d", + check_msg->amplitude_value[145]); + ck_assert_msg( + check_msg->amplitude_value[146] == 237, + "incorrect value for amplitude_value[146], expected 237, is %d", + check_msg->amplitude_value[146]); + ck_assert_msg( + check_msg->amplitude_value[147] == 156, + "incorrect value for amplitude_value[147], expected 156, is %d", + check_msg->amplitude_value[147]); + ck_assert_msg( + check_msg->amplitude_value[148] == 62, + "incorrect value for amplitude_value[148], expected 62, is %d", + check_msg->amplitude_value[148]); + ck_assert_msg( + check_msg->amplitude_value[149] == 117, + "incorrect value for amplitude_value[149], expected 117, is %d", + check_msg->amplitude_value[149]); + ck_assert_msg( + check_msg->amplitude_value[150] == 47, + "incorrect value for amplitude_value[150], expected 47, is %d", + check_msg->amplitude_value[150]); + ck_assert_msg( + check_msg->amplitude_value[151] == 143, + "incorrect value for amplitude_value[151], expected 143, is %d", + check_msg->amplitude_value[151]); + ck_assert_msg( + check_msg->amplitude_value[152] == 94, + "incorrect value for amplitude_value[152], expected 94, is %d", + check_msg->amplitude_value[152]); + ck_assert_msg( + check_msg->amplitude_value[153] == 135, + "incorrect value for amplitude_value[153], expected 135, is %d", + check_msg->amplitude_value[153]); + ck_assert_msg( + check_msg->amplitude_value[154] == 22, + "incorrect value for amplitude_value[154], expected 22, is %d", + check_msg->amplitude_value[154]); + ck_assert_msg( + check_msg->amplitude_value[155] == 155, + "incorrect value for amplitude_value[155], expected 155, is %d", + check_msg->amplitude_value[155]); + ck_assert_msg( + check_msg->amplitude_value[156] == 113, + "incorrect value for amplitude_value[156], expected 113, is %d", + check_msg->amplitude_value[156]); + ck_assert_msg( + check_msg->amplitude_value[157] == 110, + "incorrect value for amplitude_value[157], expected 110, is %d", + check_msg->amplitude_value[157]); + ck_assert_msg( + check_msg->amplitude_value[158] == 15, + "incorrect value for amplitude_value[158], expected 15, is %d", + check_msg->amplitude_value[158]); + ck_assert_msg( + check_msg->amplitude_value[159] == 243, + "incorrect value for amplitude_value[159], expected 243, is %d", + check_msg->amplitude_value[159]); + ck_assert_msg( + check_msg->amplitude_value[160] == 141, + "incorrect value for amplitude_value[160], expected 141, is %d", + check_msg->amplitude_value[160]); + ck_assert_msg( + check_msg->amplitude_value[161] == 227, + "incorrect value for amplitude_value[161], expected 227, is %d", + check_msg->amplitude_value[161]); + ck_assert_msg( + check_msg->amplitude_value[162] == 46, + "incorrect value for amplitude_value[162], expected 46, is %d", + check_msg->amplitude_value[162]); + ck_assert_msg( + check_msg->amplitude_value[163] == 143, + "incorrect value for amplitude_value[163], expected 143, is %d", + check_msg->amplitude_value[163]); + ck_assert_msg( + check_msg->amplitude_value[164] == 227, + "incorrect value for amplitude_value[164], expected 227, is %d", + check_msg->amplitude_value[164]); + ck_assert_msg( + check_msg->amplitude_value[165] == 209, + "incorrect value for amplitude_value[165], expected 209, is %d", + check_msg->amplitude_value[165]); + ck_assert_msg( + check_msg->amplitude_value[166] == 249, + "incorrect value for amplitude_value[166], expected 249, is %d", + check_msg->amplitude_value[166]); + ck_assert_msg(check_msg->amplitude_value[167] == 2, + "incorrect value for amplitude_value[167], expected 2, is %d", + check_msg->amplitude_value[167]); + ck_assert_msg( + check_msg->amplitude_value[168] == 153, + "incorrect value for amplitude_value[168], expected 153, is %d", + check_msg->amplitude_value[168]); + ck_assert_msg( + check_msg->amplitude_value[169] == 168, + "incorrect value for amplitude_value[169], expected 168, is %d", + check_msg->amplitude_value[169]); + ck_assert_msg( + check_msg->amplitude_value[170] == 131, + "incorrect value for amplitude_value[170], expected 131, is %d", + check_msg->amplitude_value[170]); + ck_assert_msg( + check_msg->amplitude_value[171] == 249, + "incorrect value for amplitude_value[171], expected 249, is %d", + check_msg->amplitude_value[171]); + ck_assert_msg( + check_msg->amplitude_value[172] == 160, + "incorrect value for amplitude_value[172], expected 160, is %d", + check_msg->amplitude_value[172]); + ck_assert_msg( + check_msg->amplitude_value[173] == 88, + "incorrect value for amplitude_value[173], expected 88, is %d", + check_msg->amplitude_value[173]); + ck_assert_msg( + check_msg->amplitude_value[174] == 38, + "incorrect value for amplitude_value[174], expected 38, is %d", + check_msg->amplitude_value[174]); + ck_assert_msg( + check_msg->amplitude_value[175] == 117, + "incorrect value for amplitude_value[175], expected 117, is %d", + check_msg->amplitude_value[175]); + ck_assert_msg( + check_msg->amplitude_value[176] == 129, + "incorrect value for amplitude_value[176], expected 129, is %d", + check_msg->amplitude_value[176]); + ck_assert_msg( + check_msg->amplitude_value[177] == 57, + "incorrect value for amplitude_value[177], expected 57, is %d", + check_msg->amplitude_value[177]); + ck_assert_msg( + check_msg->amplitude_value[178] == 40, + "incorrect value for amplitude_value[178], expected 40, is %d", + check_msg->amplitude_value[178]); + ck_assert_msg( + check_msg->amplitude_value[179] == 109, + "incorrect value for amplitude_value[179], expected 109, is %d", + check_msg->amplitude_value[179]); + ck_assert_msg( + check_msg->amplitude_value[180] == 209, + "incorrect value for amplitude_value[180], expected 209, is %d", + check_msg->amplitude_value[180]); + ck_assert_msg( + check_msg->amplitude_value[181] == 177, + "incorrect value for amplitude_value[181], expected 177, is %d", + check_msg->amplitude_value[181]); + ck_assert_msg( + check_msg->amplitude_value[182] == 38, + "incorrect value for amplitude_value[182], expected 38, is %d", + check_msg->amplitude_value[182]); + ck_assert_msg( + check_msg->amplitude_value[183] == 47, + "incorrect value for amplitude_value[183], expected 47, is %d", + check_msg->amplitude_value[183]); + ck_assert_msg( + check_msg->amplitude_value[184] == 12, + "incorrect value for amplitude_value[184], expected 12, is %d", + check_msg->amplitude_value[184]); + ck_assert_msg( + check_msg->amplitude_value[185] == 15, + "incorrect value for amplitude_value[185], expected 15, is %d", + check_msg->amplitude_value[185]); + ck_assert_msg( + check_msg->amplitude_value[186] == 16, + "incorrect value for amplitude_value[186], expected 16, is %d", + check_msg->amplitude_value[186]); + ck_assert_msg(check_msg->amplitude_value[187] == 9, + "incorrect value for amplitude_value[187], expected 9, is %d", + check_msg->amplitude_value[187]); + ck_assert_msg( + check_msg->amplitude_value[188] == 175, + "incorrect value for amplitude_value[188], expected 175, is %d", + check_msg->amplitude_value[188]); + ck_assert_msg( + check_msg->amplitude_value[189] == 69, + "incorrect value for amplitude_value[189], expected 69, is %d", + check_msg->amplitude_value[189]); + ck_assert_msg( + check_msg->amplitude_value[190] == 70, + "incorrect value for amplitude_value[190], expected 70, is %d", + check_msg->amplitude_value[190]); + ck_assert_msg( + check_msg->amplitude_value[191] == 182, + "incorrect value for amplitude_value[191], expected 182, is %d", + check_msg->amplitude_value[191]); + ck_assert_msg( + check_msg->amplitude_value[192] == 239, + "incorrect value for amplitude_value[192], expected 239, is %d", + check_msg->amplitude_value[192]); + ck_assert_msg( + check_msg->amplitude_value[193] == 117, + "incorrect value for amplitude_value[193], expected 117, is %d", + check_msg->amplitude_value[193]); + ck_assert_msg( + check_msg->amplitude_value[194] == 135, + "incorrect value for amplitude_value[194], expected 135, is %d", + check_msg->amplitude_value[194]); + ck_assert_msg(check_msg->amplitude_value[195] == 6, + "incorrect value for amplitude_value[195], expected 6, is %d", + check_msg->amplitude_value[195]); + ck_assert_msg( + check_msg->amplitude_value[196] == 71, + "incorrect value for amplitude_value[196], expected 71, is %d", + check_msg->amplitude_value[196]); + ck_assert_msg( + check_msg->amplitude_value[197] == 99, + "incorrect value for amplitude_value[197], expected 99, is %d", + check_msg->amplitude_value[197]); + ck_assert_msg( + check_msg->amplitude_value[198] == 230, + "incorrect value for amplitude_value[198], expected 230, is %d", + check_msg->amplitude_value[198]); + ck_assert_msg( + check_msg->amplitude_value[199] == 115, + "incorrect value for amplitude_value[199], expected 115, is %d", + check_msg->amplitude_value[199]); + ck_assert_msg(check_msg->amplitude_value[200] == 2, + "incorrect value for amplitude_value[200], expected 2, is %d", + check_msg->amplitude_value[200]); + ck_assert_msg( + check_msg->amplitude_value[201] == 71, + "incorrect value for amplitude_value[201], expected 71, is %d", + check_msg->amplitude_value[201]); + ck_assert_msg( + check_msg->amplitude_value[202] == 165, + "incorrect value for amplitude_value[202], expected 165, is %d", + check_msg->amplitude_value[202]); + ck_assert_msg( + check_msg->amplitude_value[203] == 228, + "incorrect value for amplitude_value[203], expected 228, is %d", + check_msg->amplitude_value[203]); + ck_assert_msg( + check_msg->amplitude_value[204] == 123, + "incorrect value for amplitude_value[204], expected 123, is %d", + check_msg->amplitude_value[204]); + ck_assert_msg( + check_msg->amplitude_value[205] == 210, + "incorrect value for amplitude_value[205], expected 210, is %d", + check_msg->amplitude_value[205]); + ck_assert_msg( + check_msg->amplitude_value[206] == 168, + "incorrect value for amplitude_value[206], expected 168, is %d", + check_msg->amplitude_value[206]); + ck_assert_msg( + check_msg->amplitude_value[207] == 90, + "incorrect value for amplitude_value[207], expected 90, is %d", + check_msg->amplitude_value[207]); + ck_assert_msg( + check_msg->amplitude_value[208] == 124, + "incorrect value for amplitude_value[208], expected 124, is %d", + check_msg->amplitude_value[208]); + ck_assert_msg( + check_msg->amplitude_value[209] == 20, + "incorrect value for amplitude_value[209], expected 20, is %d", + check_msg->amplitude_value[209]); + ck_assert_msg(check_msg->amplitude_value[210] == 7, + "incorrect value for amplitude_value[210], expected 7, is %d", + check_msg->amplitude_value[210]); + ck_assert_msg( + check_msg->amplitude_value[211] == 220, + "incorrect value for amplitude_value[211], expected 220, is %d", + check_msg->amplitude_value[211]); + ck_assert_msg( + check_msg->amplitude_value[212] == 144, + "incorrect value for amplitude_value[212], expected 144, is %d", + check_msg->amplitude_value[212]); + ck_assert_msg( + check_msg->amplitude_value[213] == 168, + "incorrect value for amplitude_value[213], expected 168, is %d", + check_msg->amplitude_value[213]); + ck_assert_msg( + check_msg->amplitude_value[214] == 69, + "incorrect value for amplitude_value[214], expected 69, is %d", + check_msg->amplitude_value[214]); + ck_assert_msg( + check_msg->amplitude_value[215] == 22, + "incorrect value for amplitude_value[215], expected 22, is %d", + check_msg->amplitude_value[215]); + ck_assert_msg( + check_msg->amplitude_value[216] == 72, + "incorrect value for amplitude_value[216], expected 72, is %d", + check_msg->amplitude_value[216]); + ck_assert_msg( + check_msg->amplitude_value[217] == 162, + "incorrect value for amplitude_value[217], expected 162, is %d", + check_msg->amplitude_value[217]); + ck_assert_msg( + check_msg->amplitude_value[218] == 69, + "incorrect value for amplitude_value[218], expected 69, is %d", + check_msg->amplitude_value[218]); + ck_assert_msg( + check_msg->amplitude_value[219] == 111, + "incorrect value for amplitude_value[219], expected 111, is %d", + check_msg->amplitude_value[219]); + ck_assert_msg( + check_msg->amplitude_value[220] == 91, + "incorrect value for amplitude_value[220], expected 91, is %d", + check_msg->amplitude_value[220]); + ck_assert_msg( + check_msg->amplitude_value[221] == 251, + "incorrect value for amplitude_value[221], expected 251, is %d", + check_msg->amplitude_value[221]); + ck_assert_msg( + check_msg->amplitude_value[222] == 72, + "incorrect value for amplitude_value[222], expected 72, is %d", + check_msg->amplitude_value[222]); + ck_assert_msg( + check_msg->amplitude_value[223] == 220, + "incorrect value for amplitude_value[223], expected 220, is %d", + check_msg->amplitude_value[223]); + ck_assert_msg( + check_msg->amplitude_value[224] == 28, + "incorrect value for amplitude_value[224], expected 28, is %d", + check_msg->amplitude_value[224]); + ck_assert_msg( + check_msg->amplitude_value[225] == 119, + "incorrect value for amplitude_value[225], expected 119, is %d", + check_msg->amplitude_value[225]); + ck_assert_msg( + check_msg->amplitude_value[226] == 150, + "incorrect value for amplitude_value[226], expected 150, is %d", + check_msg->amplitude_value[226]); + ck_assert_msg(check_msg->channel_tag == 35146, + "incorrect value for channel_tag, expected 35146, is %d", + check_msg->channel_tag); + ck_assert_msg((check_msg->freq_ref * 100 - 7737.20019531 * 100) < 0.05, + "incorrect value for freq_ref, expected 7737.20019531, is %f", + check_msg->freq_ref); + ck_assert_msg( + (check_msg->freq_step * 100 - 8226.20019531 * 100) < 0.05, + "incorrect value for freq_step, expected 8226.20019531, is %f", + check_msg->freq_step); + ck_assert_msg( + check_msg->t.ns_residual == -1479025396, + "incorrect value for t.ns_residual, expected -1479025396, is %d", + check_msg->t.ns_residual); + ck_assert_msg(check_msg->t.tow == 1227027783, + "incorrect value for t.tow, expected 1227027783, is %d", + check_msg->t.tow); + ck_assert_msg(check_msg->t.wn == 5075, + "incorrect value for t.wn, expected 5075, is %d", + check_msg->t.wn); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgSpecan_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgSpecan"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgSpecan"); +Suite *legacy_auto_check_sbp_piksi_MsgSpecan_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgSpecan"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgSpecan"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgSpecan); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgSpecanDep.c b/c/test/legacy/auto_check_sbp_piksi_MsgSpecanDep.c index d1d3ffebe..b80df4570 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgSpecanDep.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgSpecanDep.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecanDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecanDep.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgSpecanDep ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgSpecanDep) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgSpecanDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,39 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgSpecanDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x50, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x50, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x50, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x50, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,80,0,112,217,255,246,22,221,56,37,59,45,27,154,97,198,69,154,1,144,69,205,20,18,70,51,211,89,69,240,14,179,186,227,244,173,240,182,71,166,117,196,13,44,27,33,28,67,254,3,249,92,44,122,169,77,186,68,135,63,168,162,89,36,186,99,63,105,116,216,44,67,212,156,75,81,53,250,225,23,205,26,34,119,50,101,64,7,231,124,183,203,102,234,84,83,208,23,68,54,179,98,96,116,244,246,94,104,94,13,56,210,18,191,22,133,81,153,159,161,219,59,21,164,121,145,203,171,132,57,180,102,101,11,229,175,145,73,72,124,4,184,228,61,234,218,62,226,217,193,7,109,44,83,201,20,101,9,140,186,162,81,91,30,231,161,81,216,114,60,231,163,163,49,237,244,185,240,89,143,174,165,211,241,13,16,61,141,101,89,37,117,189,86,118,176,228,12,14,119,135,129,243,50,29,207,198,117,100,225,6,139,110,39,210,68,199,43,132,64,17,51,173,181,12,140,16,247,84,183,105,39,157,77,30,205,194,59,64,241,183,238,105,181,170,45,8,166,164,238,83,148,173,108,228,67,89,189,67,26,39,216, }; + u8 encoded_frame[] = { + 85, 80, 0, 112, 217, 255, 246, 22, 221, 56, 37, 59, 45, 27, + 154, 97, 198, 69, 154, 1, 144, 69, 205, 20, 18, 70, 51, 211, + 89, 69, 240, 14, 179, 186, 227, 244, 173, 240, 182, 71, 166, 117, + 196, 13, 44, 27, 33, 28, 67, 254, 3, 249, 92, 44, 122, 169, + 77, 186, 68, 135, 63, 168, 162, 89, 36, 186, 99, 63, 105, 116, + 216, 44, 67, 212, 156, 75, 81, 53, 250, 225, 23, 205, 26, 34, + 119, 50, 101, 64, 7, 231, 124, 183, 203, 102, 234, 84, 83, 208, + 23, 68, 54, 179, 98, 96, 116, 244, 246, 94, 104, 94, 13, 56, + 210, 18, 191, 22, 133, 81, 153, 159, 161, 219, 59, 21, 164, 121, + 145, 203, 171, 132, 57, 180, 102, 101, 11, 229, 175, 145, 73, 72, + 124, 4, 184, 228, 61, 234, 218, 62, 226, 217, 193, 7, 109, 44, + 83, 201, 20, 101, 9, 140, 186, 162, 81, 91, 30, 231, 161, 81, + 216, 114, 60, 231, 163, 163, 49, 237, 244, 185, 240, 89, 143, 174, + 165, 211, 241, 13, 16, 61, 141, 101, 89, 37, 117, 189, 86, 118, + 176, 228, 12, 14, 119, 135, 129, 243, 50, 29, 207, 198, 117, 100, + 225, 6, 139, 110, 39, 210, 68, 199, 43, 132, 64, 17, 51, 173, + 181, 12, 140, 16, 247, 84, 183, 105, 39, 157, 77, 30, 205, 194, + 59, 64, 241, 183, 238, 105, 181, 170, 45, 8, 166, 164, 238, 83, + 148, 173, 108, 228, 67, 89, 189, 67, 26, 39, 216, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_specan_dep_t* test_msg = ( msg_specan_dep_t* )test_msg_storage; + msg_specan_dep_t *test_msg = (msg_specan_dep_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->amplitude_ref = 9349.2001953125; test_msg->amplitude_unit = 3485.199951171875; @@ -1305,300 +1324,959 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgSpecanDep ) test_msg->freq_step = 4608.2001953125; test_msg->t.tow = 992295133; test_msg->t.wn = 6957; - sbp_payload_send(&sbp_state, 0x50, 55664, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x50, 55664, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55664, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55664, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x50, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_specan_dep_t* check_msg = ( msg_specan_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_specan_dep_t *check_msg = (msg_specan_dep_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->amplitude_ref*100 - 9349.20019531*100) < 0.05, "incorrect value for amplitude_ref, expected 9349.20019531, is %f", check_msg->amplitude_ref); - ck_assert_msg((check_msg->amplitude_unit*100 - 3485.19995117*100) < 0.05, "incorrect value for amplitude_unit, expected 3485.19995117, is %f", check_msg->amplitude_unit); - ck_assert_msg(check_msg->amplitude_value[0] == 240, "incorrect value for amplitude_value[0], expected 240, is %d", check_msg->amplitude_value[0]); - ck_assert_msg(check_msg->amplitude_value[1] == 14, "incorrect value for amplitude_value[1], expected 14, is %d", check_msg->amplitude_value[1]); - ck_assert_msg(check_msg->amplitude_value[2] == 179, "incorrect value for amplitude_value[2], expected 179, is %d", check_msg->amplitude_value[2]); - ck_assert_msg(check_msg->amplitude_value[3] == 186, "incorrect value for amplitude_value[3], expected 186, is %d", check_msg->amplitude_value[3]); - ck_assert_msg(check_msg->amplitude_value[4] == 227, "incorrect value for amplitude_value[4], expected 227, is %d", check_msg->amplitude_value[4]); - ck_assert_msg(check_msg->amplitude_value[5] == 244, "incorrect value for amplitude_value[5], expected 244, is %d", check_msg->amplitude_value[5]); - ck_assert_msg(check_msg->amplitude_value[6] == 173, "incorrect value for amplitude_value[6], expected 173, is %d", check_msg->amplitude_value[6]); - ck_assert_msg(check_msg->amplitude_value[7] == 240, "incorrect value for amplitude_value[7], expected 240, is %d", check_msg->amplitude_value[7]); - ck_assert_msg(check_msg->amplitude_value[8] == 182, "incorrect value for amplitude_value[8], expected 182, is %d", check_msg->amplitude_value[8]); - ck_assert_msg(check_msg->amplitude_value[9] == 71, "incorrect value for amplitude_value[9], expected 71, is %d", check_msg->amplitude_value[9]); - ck_assert_msg(check_msg->amplitude_value[10] == 166, "incorrect value for amplitude_value[10], expected 166, is %d", check_msg->amplitude_value[10]); - ck_assert_msg(check_msg->amplitude_value[11] == 117, "incorrect value for amplitude_value[11], expected 117, is %d", check_msg->amplitude_value[11]); - ck_assert_msg(check_msg->amplitude_value[12] == 196, "incorrect value for amplitude_value[12], expected 196, is %d", check_msg->amplitude_value[12]); - ck_assert_msg(check_msg->amplitude_value[13] == 13, "incorrect value for amplitude_value[13], expected 13, is %d", check_msg->amplitude_value[13]); - ck_assert_msg(check_msg->amplitude_value[14] == 44, "incorrect value for amplitude_value[14], expected 44, is %d", check_msg->amplitude_value[14]); - ck_assert_msg(check_msg->amplitude_value[15] == 27, "incorrect value for amplitude_value[15], expected 27, is %d", check_msg->amplitude_value[15]); - ck_assert_msg(check_msg->amplitude_value[16] == 33, "incorrect value for amplitude_value[16], expected 33, is %d", check_msg->amplitude_value[16]); - ck_assert_msg(check_msg->amplitude_value[17] == 28, "incorrect value for amplitude_value[17], expected 28, is %d", check_msg->amplitude_value[17]); - ck_assert_msg(check_msg->amplitude_value[18] == 67, "incorrect value for amplitude_value[18], expected 67, is %d", check_msg->amplitude_value[18]); - ck_assert_msg(check_msg->amplitude_value[19] == 254, "incorrect value for amplitude_value[19], expected 254, is %d", check_msg->amplitude_value[19]); - ck_assert_msg(check_msg->amplitude_value[20] == 3, "incorrect value for amplitude_value[20], expected 3, is %d", check_msg->amplitude_value[20]); - ck_assert_msg(check_msg->amplitude_value[21] == 249, "incorrect value for amplitude_value[21], expected 249, is %d", check_msg->amplitude_value[21]); - ck_assert_msg(check_msg->amplitude_value[22] == 92, "incorrect value for amplitude_value[22], expected 92, is %d", check_msg->amplitude_value[22]); - ck_assert_msg(check_msg->amplitude_value[23] == 44, "incorrect value for amplitude_value[23], expected 44, is %d", check_msg->amplitude_value[23]); - ck_assert_msg(check_msg->amplitude_value[24] == 122, "incorrect value for amplitude_value[24], expected 122, is %d", check_msg->amplitude_value[24]); - ck_assert_msg(check_msg->amplitude_value[25] == 169, "incorrect value for amplitude_value[25], expected 169, is %d", check_msg->amplitude_value[25]); - ck_assert_msg(check_msg->amplitude_value[26] == 77, "incorrect value for amplitude_value[26], expected 77, is %d", check_msg->amplitude_value[26]); - ck_assert_msg(check_msg->amplitude_value[27] == 186, "incorrect value for amplitude_value[27], expected 186, is %d", check_msg->amplitude_value[27]); - ck_assert_msg(check_msg->amplitude_value[28] == 68, "incorrect value for amplitude_value[28], expected 68, is %d", check_msg->amplitude_value[28]); - ck_assert_msg(check_msg->amplitude_value[29] == 135, "incorrect value for amplitude_value[29], expected 135, is %d", check_msg->amplitude_value[29]); - ck_assert_msg(check_msg->amplitude_value[30] == 63, "incorrect value for amplitude_value[30], expected 63, is %d", check_msg->amplitude_value[30]); - ck_assert_msg(check_msg->amplitude_value[31] == 168, "incorrect value for amplitude_value[31], expected 168, is %d", check_msg->amplitude_value[31]); - ck_assert_msg(check_msg->amplitude_value[32] == 162, "incorrect value for amplitude_value[32], expected 162, is %d", check_msg->amplitude_value[32]); - ck_assert_msg(check_msg->amplitude_value[33] == 89, "incorrect value for amplitude_value[33], expected 89, is %d", check_msg->amplitude_value[33]); - ck_assert_msg(check_msg->amplitude_value[34] == 36, "incorrect value for amplitude_value[34], expected 36, is %d", check_msg->amplitude_value[34]); - ck_assert_msg(check_msg->amplitude_value[35] == 186, "incorrect value for amplitude_value[35], expected 186, is %d", check_msg->amplitude_value[35]); - ck_assert_msg(check_msg->amplitude_value[36] == 99, "incorrect value for amplitude_value[36], expected 99, is %d", check_msg->amplitude_value[36]); - ck_assert_msg(check_msg->amplitude_value[37] == 63, "incorrect value for amplitude_value[37], expected 63, is %d", check_msg->amplitude_value[37]); - ck_assert_msg(check_msg->amplitude_value[38] == 105, "incorrect value for amplitude_value[38], expected 105, is %d", check_msg->amplitude_value[38]); - ck_assert_msg(check_msg->amplitude_value[39] == 116, "incorrect value for amplitude_value[39], expected 116, is %d", check_msg->amplitude_value[39]); - ck_assert_msg(check_msg->amplitude_value[40] == 216, "incorrect value for amplitude_value[40], expected 216, is %d", check_msg->amplitude_value[40]); - ck_assert_msg(check_msg->amplitude_value[41] == 44, "incorrect value for amplitude_value[41], expected 44, is %d", check_msg->amplitude_value[41]); - ck_assert_msg(check_msg->amplitude_value[42] == 67, "incorrect value for amplitude_value[42], expected 67, is %d", check_msg->amplitude_value[42]); - ck_assert_msg(check_msg->amplitude_value[43] == 212, "incorrect value for amplitude_value[43], expected 212, is %d", check_msg->amplitude_value[43]); - ck_assert_msg(check_msg->amplitude_value[44] == 156, "incorrect value for amplitude_value[44], expected 156, is %d", check_msg->amplitude_value[44]); - ck_assert_msg(check_msg->amplitude_value[45] == 75, "incorrect value for amplitude_value[45], expected 75, is %d", check_msg->amplitude_value[45]); - ck_assert_msg(check_msg->amplitude_value[46] == 81, "incorrect value for amplitude_value[46], expected 81, is %d", check_msg->amplitude_value[46]); - ck_assert_msg(check_msg->amplitude_value[47] == 53, "incorrect value for amplitude_value[47], expected 53, is %d", check_msg->amplitude_value[47]); - ck_assert_msg(check_msg->amplitude_value[48] == 250, "incorrect value for amplitude_value[48], expected 250, is %d", check_msg->amplitude_value[48]); - ck_assert_msg(check_msg->amplitude_value[49] == 225, "incorrect value for amplitude_value[49], expected 225, is %d", check_msg->amplitude_value[49]); - ck_assert_msg(check_msg->amplitude_value[50] == 23, "incorrect value for amplitude_value[50], expected 23, is %d", check_msg->amplitude_value[50]); - ck_assert_msg(check_msg->amplitude_value[51] == 205, "incorrect value for amplitude_value[51], expected 205, is %d", check_msg->amplitude_value[51]); - ck_assert_msg(check_msg->amplitude_value[52] == 26, "incorrect value for amplitude_value[52], expected 26, is %d", check_msg->amplitude_value[52]); - ck_assert_msg(check_msg->amplitude_value[53] == 34, "incorrect value for amplitude_value[53], expected 34, is %d", check_msg->amplitude_value[53]); - ck_assert_msg(check_msg->amplitude_value[54] == 119, "incorrect value for amplitude_value[54], expected 119, is %d", check_msg->amplitude_value[54]); - ck_assert_msg(check_msg->amplitude_value[55] == 50, "incorrect value for amplitude_value[55], expected 50, is %d", check_msg->amplitude_value[55]); - ck_assert_msg(check_msg->amplitude_value[56] == 101, "incorrect value for amplitude_value[56], expected 101, is %d", check_msg->amplitude_value[56]); - ck_assert_msg(check_msg->amplitude_value[57] == 64, "incorrect value for amplitude_value[57], expected 64, is %d", check_msg->amplitude_value[57]); - ck_assert_msg(check_msg->amplitude_value[58] == 7, "incorrect value for amplitude_value[58], expected 7, is %d", check_msg->amplitude_value[58]); - ck_assert_msg(check_msg->amplitude_value[59] == 231, "incorrect value for amplitude_value[59], expected 231, is %d", check_msg->amplitude_value[59]); - ck_assert_msg(check_msg->amplitude_value[60] == 124, "incorrect value for amplitude_value[60], expected 124, is %d", check_msg->amplitude_value[60]); - ck_assert_msg(check_msg->amplitude_value[61] == 183, "incorrect value for amplitude_value[61], expected 183, is %d", check_msg->amplitude_value[61]); - ck_assert_msg(check_msg->amplitude_value[62] == 203, "incorrect value for amplitude_value[62], expected 203, is %d", check_msg->amplitude_value[62]); - ck_assert_msg(check_msg->amplitude_value[63] == 102, "incorrect value for amplitude_value[63], expected 102, is %d", check_msg->amplitude_value[63]); - ck_assert_msg(check_msg->amplitude_value[64] == 234, "incorrect value for amplitude_value[64], expected 234, is %d", check_msg->amplitude_value[64]); - ck_assert_msg(check_msg->amplitude_value[65] == 84, "incorrect value for amplitude_value[65], expected 84, is %d", check_msg->amplitude_value[65]); - ck_assert_msg(check_msg->amplitude_value[66] == 83, "incorrect value for amplitude_value[66], expected 83, is %d", check_msg->amplitude_value[66]); - ck_assert_msg(check_msg->amplitude_value[67] == 208, "incorrect value for amplitude_value[67], expected 208, is %d", check_msg->amplitude_value[67]); - ck_assert_msg(check_msg->amplitude_value[68] == 23, "incorrect value for amplitude_value[68], expected 23, is %d", check_msg->amplitude_value[68]); - ck_assert_msg(check_msg->amplitude_value[69] == 68, "incorrect value for amplitude_value[69], expected 68, is %d", check_msg->amplitude_value[69]); - ck_assert_msg(check_msg->amplitude_value[70] == 54, "incorrect value for amplitude_value[70], expected 54, is %d", check_msg->amplitude_value[70]); - ck_assert_msg(check_msg->amplitude_value[71] == 179, "incorrect value for amplitude_value[71], expected 179, is %d", check_msg->amplitude_value[71]); - ck_assert_msg(check_msg->amplitude_value[72] == 98, "incorrect value for amplitude_value[72], expected 98, is %d", check_msg->amplitude_value[72]); - ck_assert_msg(check_msg->amplitude_value[73] == 96, "incorrect value for amplitude_value[73], expected 96, is %d", check_msg->amplitude_value[73]); - ck_assert_msg(check_msg->amplitude_value[74] == 116, "incorrect value for amplitude_value[74], expected 116, is %d", check_msg->amplitude_value[74]); - ck_assert_msg(check_msg->amplitude_value[75] == 244, "incorrect value for amplitude_value[75], expected 244, is %d", check_msg->amplitude_value[75]); - ck_assert_msg(check_msg->amplitude_value[76] == 246, "incorrect value for amplitude_value[76], expected 246, is %d", check_msg->amplitude_value[76]); - ck_assert_msg(check_msg->amplitude_value[77] == 94, "incorrect value for amplitude_value[77], expected 94, is %d", check_msg->amplitude_value[77]); - ck_assert_msg(check_msg->amplitude_value[78] == 104, "incorrect value for amplitude_value[78], expected 104, is %d", check_msg->amplitude_value[78]); - ck_assert_msg(check_msg->amplitude_value[79] == 94, "incorrect value for amplitude_value[79], expected 94, is %d", check_msg->amplitude_value[79]); - ck_assert_msg(check_msg->amplitude_value[80] == 13, "incorrect value for amplitude_value[80], expected 13, is %d", check_msg->amplitude_value[80]); - ck_assert_msg(check_msg->amplitude_value[81] == 56, "incorrect value for amplitude_value[81], expected 56, is %d", check_msg->amplitude_value[81]); - ck_assert_msg(check_msg->amplitude_value[82] == 210, "incorrect value for amplitude_value[82], expected 210, is %d", check_msg->amplitude_value[82]); - ck_assert_msg(check_msg->amplitude_value[83] == 18, "incorrect value for amplitude_value[83], expected 18, is %d", check_msg->amplitude_value[83]); - ck_assert_msg(check_msg->amplitude_value[84] == 191, "incorrect value for amplitude_value[84], expected 191, is %d", check_msg->amplitude_value[84]); - ck_assert_msg(check_msg->amplitude_value[85] == 22, "incorrect value for amplitude_value[85], expected 22, is %d", check_msg->amplitude_value[85]); - ck_assert_msg(check_msg->amplitude_value[86] == 133, "incorrect value for amplitude_value[86], expected 133, is %d", check_msg->amplitude_value[86]); - ck_assert_msg(check_msg->amplitude_value[87] == 81, "incorrect value for amplitude_value[87], expected 81, is %d", check_msg->amplitude_value[87]); - ck_assert_msg(check_msg->amplitude_value[88] == 153, "incorrect value for amplitude_value[88], expected 153, is %d", check_msg->amplitude_value[88]); - ck_assert_msg(check_msg->amplitude_value[89] == 159, "incorrect value for amplitude_value[89], expected 159, is %d", check_msg->amplitude_value[89]); - ck_assert_msg(check_msg->amplitude_value[90] == 161, "incorrect value for amplitude_value[90], expected 161, is %d", check_msg->amplitude_value[90]); - ck_assert_msg(check_msg->amplitude_value[91] == 219, "incorrect value for amplitude_value[91], expected 219, is %d", check_msg->amplitude_value[91]); - ck_assert_msg(check_msg->amplitude_value[92] == 59, "incorrect value for amplitude_value[92], expected 59, is %d", check_msg->amplitude_value[92]); - ck_assert_msg(check_msg->amplitude_value[93] == 21, "incorrect value for amplitude_value[93], expected 21, is %d", check_msg->amplitude_value[93]); - ck_assert_msg(check_msg->amplitude_value[94] == 164, "incorrect value for amplitude_value[94], expected 164, is %d", check_msg->amplitude_value[94]); - ck_assert_msg(check_msg->amplitude_value[95] == 121, "incorrect value for amplitude_value[95], expected 121, is %d", check_msg->amplitude_value[95]); - ck_assert_msg(check_msg->amplitude_value[96] == 145, "incorrect value for amplitude_value[96], expected 145, is %d", check_msg->amplitude_value[96]); - ck_assert_msg(check_msg->amplitude_value[97] == 203, "incorrect value for amplitude_value[97], expected 203, is %d", check_msg->amplitude_value[97]); - ck_assert_msg(check_msg->amplitude_value[98] == 171, "incorrect value for amplitude_value[98], expected 171, is %d", check_msg->amplitude_value[98]); - ck_assert_msg(check_msg->amplitude_value[99] == 132, "incorrect value for amplitude_value[99], expected 132, is %d", check_msg->amplitude_value[99]); - ck_assert_msg(check_msg->amplitude_value[100] == 57, "incorrect value for amplitude_value[100], expected 57, is %d", check_msg->amplitude_value[100]); - ck_assert_msg(check_msg->amplitude_value[101] == 180, "incorrect value for amplitude_value[101], expected 180, is %d", check_msg->amplitude_value[101]); - ck_assert_msg(check_msg->amplitude_value[102] == 102, "incorrect value for amplitude_value[102], expected 102, is %d", check_msg->amplitude_value[102]); - ck_assert_msg(check_msg->amplitude_value[103] == 101, "incorrect value for amplitude_value[103], expected 101, is %d", check_msg->amplitude_value[103]); - ck_assert_msg(check_msg->amplitude_value[104] == 11, "incorrect value for amplitude_value[104], expected 11, is %d", check_msg->amplitude_value[104]); - ck_assert_msg(check_msg->amplitude_value[105] == 229, "incorrect value for amplitude_value[105], expected 229, is %d", check_msg->amplitude_value[105]); - ck_assert_msg(check_msg->amplitude_value[106] == 175, "incorrect value for amplitude_value[106], expected 175, is %d", check_msg->amplitude_value[106]); - ck_assert_msg(check_msg->amplitude_value[107] == 145, "incorrect value for amplitude_value[107], expected 145, is %d", check_msg->amplitude_value[107]); - ck_assert_msg(check_msg->amplitude_value[108] == 73, "incorrect value for amplitude_value[108], expected 73, is %d", check_msg->amplitude_value[108]); - ck_assert_msg(check_msg->amplitude_value[109] == 72, "incorrect value for amplitude_value[109], expected 72, is %d", check_msg->amplitude_value[109]); - ck_assert_msg(check_msg->amplitude_value[110] == 124, "incorrect value for amplitude_value[110], expected 124, is %d", check_msg->amplitude_value[110]); - ck_assert_msg(check_msg->amplitude_value[111] == 4, "incorrect value for amplitude_value[111], expected 4, is %d", check_msg->amplitude_value[111]); - ck_assert_msg(check_msg->amplitude_value[112] == 184, "incorrect value for amplitude_value[112], expected 184, is %d", check_msg->amplitude_value[112]); - ck_assert_msg(check_msg->amplitude_value[113] == 228, "incorrect value for amplitude_value[113], expected 228, is %d", check_msg->amplitude_value[113]); - ck_assert_msg(check_msg->amplitude_value[114] == 61, "incorrect value for amplitude_value[114], expected 61, is %d", check_msg->amplitude_value[114]); - ck_assert_msg(check_msg->amplitude_value[115] == 234, "incorrect value for amplitude_value[115], expected 234, is %d", check_msg->amplitude_value[115]); - ck_assert_msg(check_msg->amplitude_value[116] == 218, "incorrect value for amplitude_value[116], expected 218, is %d", check_msg->amplitude_value[116]); - ck_assert_msg(check_msg->amplitude_value[117] == 62, "incorrect value for amplitude_value[117], expected 62, is %d", check_msg->amplitude_value[117]); - ck_assert_msg(check_msg->amplitude_value[118] == 226, "incorrect value for amplitude_value[118], expected 226, is %d", check_msg->amplitude_value[118]); - ck_assert_msg(check_msg->amplitude_value[119] == 217, "incorrect value for amplitude_value[119], expected 217, is %d", check_msg->amplitude_value[119]); - ck_assert_msg(check_msg->amplitude_value[120] == 193, "incorrect value for amplitude_value[120], expected 193, is %d", check_msg->amplitude_value[120]); - ck_assert_msg(check_msg->amplitude_value[121] == 7, "incorrect value for amplitude_value[121], expected 7, is %d", check_msg->amplitude_value[121]); - ck_assert_msg(check_msg->amplitude_value[122] == 109, "incorrect value for amplitude_value[122], expected 109, is %d", check_msg->amplitude_value[122]); - ck_assert_msg(check_msg->amplitude_value[123] == 44, "incorrect value for amplitude_value[123], expected 44, is %d", check_msg->amplitude_value[123]); - ck_assert_msg(check_msg->amplitude_value[124] == 83, "incorrect value for amplitude_value[124], expected 83, is %d", check_msg->amplitude_value[124]); - ck_assert_msg(check_msg->amplitude_value[125] == 201, "incorrect value for amplitude_value[125], expected 201, is %d", check_msg->amplitude_value[125]); - ck_assert_msg(check_msg->amplitude_value[126] == 20, "incorrect value for amplitude_value[126], expected 20, is %d", check_msg->amplitude_value[126]); - ck_assert_msg(check_msg->amplitude_value[127] == 101, "incorrect value for amplitude_value[127], expected 101, is %d", check_msg->amplitude_value[127]); - ck_assert_msg(check_msg->amplitude_value[128] == 9, "incorrect value for amplitude_value[128], expected 9, is %d", check_msg->amplitude_value[128]); - ck_assert_msg(check_msg->amplitude_value[129] == 140, "incorrect value for amplitude_value[129], expected 140, is %d", check_msg->amplitude_value[129]); - ck_assert_msg(check_msg->amplitude_value[130] == 186, "incorrect value for amplitude_value[130], expected 186, is %d", check_msg->amplitude_value[130]); - ck_assert_msg(check_msg->amplitude_value[131] == 162, "incorrect value for amplitude_value[131], expected 162, is %d", check_msg->amplitude_value[131]); - ck_assert_msg(check_msg->amplitude_value[132] == 81, "incorrect value for amplitude_value[132], expected 81, is %d", check_msg->amplitude_value[132]); - ck_assert_msg(check_msg->amplitude_value[133] == 91, "incorrect value for amplitude_value[133], expected 91, is %d", check_msg->amplitude_value[133]); - ck_assert_msg(check_msg->amplitude_value[134] == 30, "incorrect value for amplitude_value[134], expected 30, is %d", check_msg->amplitude_value[134]); - ck_assert_msg(check_msg->amplitude_value[135] == 231, "incorrect value for amplitude_value[135], expected 231, is %d", check_msg->amplitude_value[135]); - ck_assert_msg(check_msg->amplitude_value[136] == 161, "incorrect value for amplitude_value[136], expected 161, is %d", check_msg->amplitude_value[136]); - ck_assert_msg(check_msg->amplitude_value[137] == 81, "incorrect value for amplitude_value[137], expected 81, is %d", check_msg->amplitude_value[137]); - ck_assert_msg(check_msg->amplitude_value[138] == 216, "incorrect value for amplitude_value[138], expected 216, is %d", check_msg->amplitude_value[138]); - ck_assert_msg(check_msg->amplitude_value[139] == 114, "incorrect value for amplitude_value[139], expected 114, is %d", check_msg->amplitude_value[139]); - ck_assert_msg(check_msg->amplitude_value[140] == 60, "incorrect value for amplitude_value[140], expected 60, is %d", check_msg->amplitude_value[140]); - ck_assert_msg(check_msg->amplitude_value[141] == 231, "incorrect value for amplitude_value[141], expected 231, is %d", check_msg->amplitude_value[141]); - ck_assert_msg(check_msg->amplitude_value[142] == 163, "incorrect value for amplitude_value[142], expected 163, is %d", check_msg->amplitude_value[142]); - ck_assert_msg(check_msg->amplitude_value[143] == 163, "incorrect value for amplitude_value[143], expected 163, is %d", check_msg->amplitude_value[143]); - ck_assert_msg(check_msg->amplitude_value[144] == 49, "incorrect value for amplitude_value[144], expected 49, is %d", check_msg->amplitude_value[144]); - ck_assert_msg(check_msg->amplitude_value[145] == 237, "incorrect value for amplitude_value[145], expected 237, is %d", check_msg->amplitude_value[145]); - ck_assert_msg(check_msg->amplitude_value[146] == 244, "incorrect value for amplitude_value[146], expected 244, is %d", check_msg->amplitude_value[146]); - ck_assert_msg(check_msg->amplitude_value[147] == 185, "incorrect value for amplitude_value[147], expected 185, is %d", check_msg->amplitude_value[147]); - ck_assert_msg(check_msg->amplitude_value[148] == 240, "incorrect value for amplitude_value[148], expected 240, is %d", check_msg->amplitude_value[148]); - ck_assert_msg(check_msg->amplitude_value[149] == 89, "incorrect value for amplitude_value[149], expected 89, is %d", check_msg->amplitude_value[149]); - ck_assert_msg(check_msg->amplitude_value[150] == 143, "incorrect value for amplitude_value[150], expected 143, is %d", check_msg->amplitude_value[150]); - ck_assert_msg(check_msg->amplitude_value[151] == 174, "incorrect value for amplitude_value[151], expected 174, is %d", check_msg->amplitude_value[151]); - ck_assert_msg(check_msg->amplitude_value[152] == 165, "incorrect value for amplitude_value[152], expected 165, is %d", check_msg->amplitude_value[152]); - ck_assert_msg(check_msg->amplitude_value[153] == 211, "incorrect value for amplitude_value[153], expected 211, is %d", check_msg->amplitude_value[153]); - ck_assert_msg(check_msg->amplitude_value[154] == 241, "incorrect value for amplitude_value[154], expected 241, is %d", check_msg->amplitude_value[154]); - ck_assert_msg(check_msg->amplitude_value[155] == 13, "incorrect value for amplitude_value[155], expected 13, is %d", check_msg->amplitude_value[155]); - ck_assert_msg(check_msg->amplitude_value[156] == 16, "incorrect value for amplitude_value[156], expected 16, is %d", check_msg->amplitude_value[156]); - ck_assert_msg(check_msg->amplitude_value[157] == 61, "incorrect value for amplitude_value[157], expected 61, is %d", check_msg->amplitude_value[157]); - ck_assert_msg(check_msg->amplitude_value[158] == 141, "incorrect value for amplitude_value[158], expected 141, is %d", check_msg->amplitude_value[158]); - ck_assert_msg(check_msg->amplitude_value[159] == 101, "incorrect value for amplitude_value[159], expected 101, is %d", check_msg->amplitude_value[159]); - ck_assert_msg(check_msg->amplitude_value[160] == 89, "incorrect value for amplitude_value[160], expected 89, is %d", check_msg->amplitude_value[160]); - ck_assert_msg(check_msg->amplitude_value[161] == 37, "incorrect value for amplitude_value[161], expected 37, is %d", check_msg->amplitude_value[161]); - ck_assert_msg(check_msg->amplitude_value[162] == 117, "incorrect value for amplitude_value[162], expected 117, is %d", check_msg->amplitude_value[162]); - ck_assert_msg(check_msg->amplitude_value[163] == 189, "incorrect value for amplitude_value[163], expected 189, is %d", check_msg->amplitude_value[163]); - ck_assert_msg(check_msg->amplitude_value[164] == 86, "incorrect value for amplitude_value[164], expected 86, is %d", check_msg->amplitude_value[164]); - ck_assert_msg(check_msg->amplitude_value[165] == 118, "incorrect value for amplitude_value[165], expected 118, is %d", check_msg->amplitude_value[165]); - ck_assert_msg(check_msg->amplitude_value[166] == 176, "incorrect value for amplitude_value[166], expected 176, is %d", check_msg->amplitude_value[166]); - ck_assert_msg(check_msg->amplitude_value[167] == 228, "incorrect value for amplitude_value[167], expected 228, is %d", check_msg->amplitude_value[167]); - ck_assert_msg(check_msg->amplitude_value[168] == 12, "incorrect value for amplitude_value[168], expected 12, is %d", check_msg->amplitude_value[168]); - ck_assert_msg(check_msg->amplitude_value[169] == 14, "incorrect value for amplitude_value[169], expected 14, is %d", check_msg->amplitude_value[169]); - ck_assert_msg(check_msg->amplitude_value[170] == 119, "incorrect value for amplitude_value[170], expected 119, is %d", check_msg->amplitude_value[170]); - ck_assert_msg(check_msg->amplitude_value[171] == 135, "incorrect value for amplitude_value[171], expected 135, is %d", check_msg->amplitude_value[171]); - ck_assert_msg(check_msg->amplitude_value[172] == 129, "incorrect value for amplitude_value[172], expected 129, is %d", check_msg->amplitude_value[172]); - ck_assert_msg(check_msg->amplitude_value[173] == 243, "incorrect value for amplitude_value[173], expected 243, is %d", check_msg->amplitude_value[173]); - ck_assert_msg(check_msg->amplitude_value[174] == 50, "incorrect value for amplitude_value[174], expected 50, is %d", check_msg->amplitude_value[174]); - ck_assert_msg(check_msg->amplitude_value[175] == 29, "incorrect value for amplitude_value[175], expected 29, is %d", check_msg->amplitude_value[175]); - ck_assert_msg(check_msg->amplitude_value[176] == 207, "incorrect value for amplitude_value[176], expected 207, is %d", check_msg->amplitude_value[176]); - ck_assert_msg(check_msg->amplitude_value[177] == 198, "incorrect value for amplitude_value[177], expected 198, is %d", check_msg->amplitude_value[177]); - ck_assert_msg(check_msg->amplitude_value[178] == 117, "incorrect value for amplitude_value[178], expected 117, is %d", check_msg->amplitude_value[178]); - ck_assert_msg(check_msg->amplitude_value[179] == 100, "incorrect value for amplitude_value[179], expected 100, is %d", check_msg->amplitude_value[179]); - ck_assert_msg(check_msg->amplitude_value[180] == 225, "incorrect value for amplitude_value[180], expected 225, is %d", check_msg->amplitude_value[180]); - ck_assert_msg(check_msg->amplitude_value[181] == 6, "incorrect value for amplitude_value[181], expected 6, is %d", check_msg->amplitude_value[181]); - ck_assert_msg(check_msg->amplitude_value[182] == 139, "incorrect value for amplitude_value[182], expected 139, is %d", check_msg->amplitude_value[182]); - ck_assert_msg(check_msg->amplitude_value[183] == 110, "incorrect value for amplitude_value[183], expected 110, is %d", check_msg->amplitude_value[183]); - ck_assert_msg(check_msg->amplitude_value[184] == 39, "incorrect value for amplitude_value[184], expected 39, is %d", check_msg->amplitude_value[184]); - ck_assert_msg(check_msg->amplitude_value[185] == 210, "incorrect value for amplitude_value[185], expected 210, is %d", check_msg->amplitude_value[185]); - ck_assert_msg(check_msg->amplitude_value[186] == 68, "incorrect value for amplitude_value[186], expected 68, is %d", check_msg->amplitude_value[186]); - ck_assert_msg(check_msg->amplitude_value[187] == 199, "incorrect value for amplitude_value[187], expected 199, is %d", check_msg->amplitude_value[187]); - ck_assert_msg(check_msg->amplitude_value[188] == 43, "incorrect value for amplitude_value[188], expected 43, is %d", check_msg->amplitude_value[188]); - ck_assert_msg(check_msg->amplitude_value[189] == 132, "incorrect value for amplitude_value[189], expected 132, is %d", check_msg->amplitude_value[189]); - ck_assert_msg(check_msg->amplitude_value[190] == 64, "incorrect value for amplitude_value[190], expected 64, is %d", check_msg->amplitude_value[190]); - ck_assert_msg(check_msg->amplitude_value[191] == 17, "incorrect value for amplitude_value[191], expected 17, is %d", check_msg->amplitude_value[191]); - ck_assert_msg(check_msg->amplitude_value[192] == 51, "incorrect value for amplitude_value[192], expected 51, is %d", check_msg->amplitude_value[192]); - ck_assert_msg(check_msg->amplitude_value[193] == 173, "incorrect value for amplitude_value[193], expected 173, is %d", check_msg->amplitude_value[193]); - ck_assert_msg(check_msg->amplitude_value[194] == 181, "incorrect value for amplitude_value[194], expected 181, is %d", check_msg->amplitude_value[194]); - ck_assert_msg(check_msg->amplitude_value[195] == 12, "incorrect value for amplitude_value[195], expected 12, is %d", check_msg->amplitude_value[195]); - ck_assert_msg(check_msg->amplitude_value[196] == 140, "incorrect value for amplitude_value[196], expected 140, is %d", check_msg->amplitude_value[196]); - ck_assert_msg(check_msg->amplitude_value[197] == 16, "incorrect value for amplitude_value[197], expected 16, is %d", check_msg->amplitude_value[197]); - ck_assert_msg(check_msg->amplitude_value[198] == 247, "incorrect value for amplitude_value[198], expected 247, is %d", check_msg->amplitude_value[198]); - ck_assert_msg(check_msg->amplitude_value[199] == 84, "incorrect value for amplitude_value[199], expected 84, is %d", check_msg->amplitude_value[199]); - ck_assert_msg(check_msg->amplitude_value[200] == 183, "incorrect value for amplitude_value[200], expected 183, is %d", check_msg->amplitude_value[200]); - ck_assert_msg(check_msg->amplitude_value[201] == 105, "incorrect value for amplitude_value[201], expected 105, is %d", check_msg->amplitude_value[201]); - ck_assert_msg(check_msg->amplitude_value[202] == 39, "incorrect value for amplitude_value[202], expected 39, is %d", check_msg->amplitude_value[202]); - ck_assert_msg(check_msg->amplitude_value[203] == 157, "incorrect value for amplitude_value[203], expected 157, is %d", check_msg->amplitude_value[203]); - ck_assert_msg(check_msg->amplitude_value[204] == 77, "incorrect value for amplitude_value[204], expected 77, is %d", check_msg->amplitude_value[204]); - ck_assert_msg(check_msg->amplitude_value[205] == 30, "incorrect value for amplitude_value[205], expected 30, is %d", check_msg->amplitude_value[205]); - ck_assert_msg(check_msg->amplitude_value[206] == 205, "incorrect value for amplitude_value[206], expected 205, is %d", check_msg->amplitude_value[206]); - ck_assert_msg(check_msg->amplitude_value[207] == 194, "incorrect value for amplitude_value[207], expected 194, is %d", check_msg->amplitude_value[207]); - ck_assert_msg(check_msg->amplitude_value[208] == 59, "incorrect value for amplitude_value[208], expected 59, is %d", check_msg->amplitude_value[208]); - ck_assert_msg(check_msg->amplitude_value[209] == 64, "incorrect value for amplitude_value[209], expected 64, is %d", check_msg->amplitude_value[209]); - ck_assert_msg(check_msg->amplitude_value[210] == 241, "incorrect value for amplitude_value[210], expected 241, is %d", check_msg->amplitude_value[210]); - ck_assert_msg(check_msg->amplitude_value[211] == 183, "incorrect value for amplitude_value[211], expected 183, is %d", check_msg->amplitude_value[211]); - ck_assert_msg(check_msg->amplitude_value[212] == 238, "incorrect value for amplitude_value[212], expected 238, is %d", check_msg->amplitude_value[212]); - ck_assert_msg(check_msg->amplitude_value[213] == 105, "incorrect value for amplitude_value[213], expected 105, is %d", check_msg->amplitude_value[213]); - ck_assert_msg(check_msg->amplitude_value[214] == 181, "incorrect value for amplitude_value[214], expected 181, is %d", check_msg->amplitude_value[214]); - ck_assert_msg(check_msg->amplitude_value[215] == 170, "incorrect value for amplitude_value[215], expected 170, is %d", check_msg->amplitude_value[215]); - ck_assert_msg(check_msg->amplitude_value[216] == 45, "incorrect value for amplitude_value[216], expected 45, is %d", check_msg->amplitude_value[216]); - ck_assert_msg(check_msg->amplitude_value[217] == 8, "incorrect value for amplitude_value[217], expected 8, is %d", check_msg->amplitude_value[217]); - ck_assert_msg(check_msg->amplitude_value[218] == 166, "incorrect value for amplitude_value[218], expected 166, is %d", check_msg->amplitude_value[218]); - ck_assert_msg(check_msg->amplitude_value[219] == 164, "incorrect value for amplitude_value[219], expected 164, is %d", check_msg->amplitude_value[219]); - ck_assert_msg(check_msg->amplitude_value[220] == 238, "incorrect value for amplitude_value[220], expected 238, is %d", check_msg->amplitude_value[220]); - ck_assert_msg(check_msg->amplitude_value[221] == 83, "incorrect value for amplitude_value[221], expected 83, is %d", check_msg->amplitude_value[221]); - ck_assert_msg(check_msg->amplitude_value[222] == 148, "incorrect value for amplitude_value[222], expected 148, is %d", check_msg->amplitude_value[222]); - ck_assert_msg(check_msg->amplitude_value[223] == 173, "incorrect value for amplitude_value[223], expected 173, is %d", check_msg->amplitude_value[223]); - ck_assert_msg(check_msg->amplitude_value[224] == 108, "incorrect value for amplitude_value[224], expected 108, is %d", check_msg->amplitude_value[224]); - ck_assert_msg(check_msg->amplitude_value[225] == 228, "incorrect value for amplitude_value[225], expected 228, is %d", check_msg->amplitude_value[225]); - ck_assert_msg(check_msg->amplitude_value[226] == 67, "incorrect value for amplitude_value[226], expected 67, is %d", check_msg->amplitude_value[226]); - ck_assert_msg(check_msg->amplitude_value[227] == 89, "incorrect value for amplitude_value[227], expected 89, is %d", check_msg->amplitude_value[227]); - ck_assert_msg(check_msg->amplitude_value[228] == 189, "incorrect value for amplitude_value[228], expected 189, is %d", check_msg->amplitude_value[228]); - ck_assert_msg(check_msg->amplitude_value[229] == 67, "incorrect value for amplitude_value[229], expected 67, is %d", check_msg->amplitude_value[229]); - ck_assert_msg(check_msg->amplitude_value[230] == 26, "incorrect value for amplitude_value[230], expected 26, is %d", check_msg->amplitude_value[230]); - ck_assert_msg(check_msg->channel_tag == 5878, "incorrect value for channel_tag, expected 5878, is %d", check_msg->channel_tag); - ck_assert_msg((check_msg->freq_ref*100 - 6348.20019531*100) < 0.05, "incorrect value for freq_ref, expected 6348.20019531, is %f", check_msg->freq_ref); - ck_assert_msg((check_msg->freq_step*100 - 4608.20019531*100) < 0.05, "incorrect value for freq_step, expected 4608.20019531, is %f", check_msg->freq_step); - ck_assert_msg(check_msg->t.tow == 992295133, "incorrect value for t.tow, expected 992295133, is %d", check_msg->t.tow); - ck_assert_msg(check_msg->t.wn == 6957, "incorrect value for t.wn, expected 6957, is %d", check_msg->t.wn); + ck_assert_msg( + (check_msg->amplitude_ref * 100 - 9349.20019531 * 100) < 0.05, + "incorrect value for amplitude_ref, expected 9349.20019531, is %f", + check_msg->amplitude_ref); + ck_assert_msg( + (check_msg->amplitude_unit * 100 - 3485.19995117 * 100) < 0.05, + "incorrect value for amplitude_unit, expected 3485.19995117, is %f", + check_msg->amplitude_unit); + ck_assert_msg(check_msg->amplitude_value[0] == 240, + "incorrect value for amplitude_value[0], expected 240, is %d", + check_msg->amplitude_value[0]); + ck_assert_msg(check_msg->amplitude_value[1] == 14, + "incorrect value for amplitude_value[1], expected 14, is %d", + check_msg->amplitude_value[1]); + ck_assert_msg(check_msg->amplitude_value[2] == 179, + "incorrect value for amplitude_value[2], expected 179, is %d", + check_msg->amplitude_value[2]); + ck_assert_msg(check_msg->amplitude_value[3] == 186, + "incorrect value for amplitude_value[3], expected 186, is %d", + check_msg->amplitude_value[3]); + ck_assert_msg(check_msg->amplitude_value[4] == 227, + "incorrect value for amplitude_value[4], expected 227, is %d", + check_msg->amplitude_value[4]); + ck_assert_msg(check_msg->amplitude_value[5] == 244, + "incorrect value for amplitude_value[5], expected 244, is %d", + check_msg->amplitude_value[5]); + ck_assert_msg(check_msg->amplitude_value[6] == 173, + "incorrect value for amplitude_value[6], expected 173, is %d", + check_msg->amplitude_value[6]); + ck_assert_msg(check_msg->amplitude_value[7] == 240, + "incorrect value for amplitude_value[7], expected 240, is %d", + check_msg->amplitude_value[7]); + ck_assert_msg(check_msg->amplitude_value[8] == 182, + "incorrect value for amplitude_value[8], expected 182, is %d", + check_msg->amplitude_value[8]); + ck_assert_msg(check_msg->amplitude_value[9] == 71, + "incorrect value for amplitude_value[9], expected 71, is %d", + check_msg->amplitude_value[9]); + ck_assert_msg( + check_msg->amplitude_value[10] == 166, + "incorrect value for amplitude_value[10], expected 166, is %d", + check_msg->amplitude_value[10]); + ck_assert_msg( + check_msg->amplitude_value[11] == 117, + "incorrect value for amplitude_value[11], expected 117, is %d", + check_msg->amplitude_value[11]); + ck_assert_msg( + check_msg->amplitude_value[12] == 196, + "incorrect value for amplitude_value[12], expected 196, is %d", + check_msg->amplitude_value[12]); + ck_assert_msg(check_msg->amplitude_value[13] == 13, + "incorrect value for amplitude_value[13], expected 13, is %d", + check_msg->amplitude_value[13]); + ck_assert_msg(check_msg->amplitude_value[14] == 44, + "incorrect value for amplitude_value[14], expected 44, is %d", + check_msg->amplitude_value[14]); + ck_assert_msg(check_msg->amplitude_value[15] == 27, + "incorrect value for amplitude_value[15], expected 27, is %d", + check_msg->amplitude_value[15]); + ck_assert_msg(check_msg->amplitude_value[16] == 33, + "incorrect value for amplitude_value[16], expected 33, is %d", + check_msg->amplitude_value[16]); + ck_assert_msg(check_msg->amplitude_value[17] == 28, + "incorrect value for amplitude_value[17], expected 28, is %d", + check_msg->amplitude_value[17]); + ck_assert_msg(check_msg->amplitude_value[18] == 67, + "incorrect value for amplitude_value[18], expected 67, is %d", + check_msg->amplitude_value[18]); + ck_assert_msg( + check_msg->amplitude_value[19] == 254, + "incorrect value for amplitude_value[19], expected 254, is %d", + check_msg->amplitude_value[19]); + ck_assert_msg(check_msg->amplitude_value[20] == 3, + "incorrect value for amplitude_value[20], expected 3, is %d", + check_msg->amplitude_value[20]); + ck_assert_msg( + check_msg->amplitude_value[21] == 249, + "incorrect value for amplitude_value[21], expected 249, is %d", + check_msg->amplitude_value[21]); + ck_assert_msg(check_msg->amplitude_value[22] == 92, + "incorrect value for amplitude_value[22], expected 92, is %d", + check_msg->amplitude_value[22]); + ck_assert_msg(check_msg->amplitude_value[23] == 44, + "incorrect value for amplitude_value[23], expected 44, is %d", + check_msg->amplitude_value[23]); + ck_assert_msg( + check_msg->amplitude_value[24] == 122, + "incorrect value for amplitude_value[24], expected 122, is %d", + check_msg->amplitude_value[24]); + ck_assert_msg( + check_msg->amplitude_value[25] == 169, + "incorrect value for amplitude_value[25], expected 169, is %d", + check_msg->amplitude_value[25]); + ck_assert_msg(check_msg->amplitude_value[26] == 77, + "incorrect value for amplitude_value[26], expected 77, is %d", + check_msg->amplitude_value[26]); + ck_assert_msg( + check_msg->amplitude_value[27] == 186, + "incorrect value for amplitude_value[27], expected 186, is %d", + check_msg->amplitude_value[27]); + ck_assert_msg(check_msg->amplitude_value[28] == 68, + "incorrect value for amplitude_value[28], expected 68, is %d", + check_msg->amplitude_value[28]); + ck_assert_msg( + check_msg->amplitude_value[29] == 135, + "incorrect value for amplitude_value[29], expected 135, is %d", + check_msg->amplitude_value[29]); + ck_assert_msg(check_msg->amplitude_value[30] == 63, + "incorrect value for amplitude_value[30], expected 63, is %d", + check_msg->amplitude_value[30]); + ck_assert_msg( + check_msg->amplitude_value[31] == 168, + "incorrect value for amplitude_value[31], expected 168, is %d", + check_msg->amplitude_value[31]); + ck_assert_msg( + check_msg->amplitude_value[32] == 162, + "incorrect value for amplitude_value[32], expected 162, is %d", + check_msg->amplitude_value[32]); + ck_assert_msg(check_msg->amplitude_value[33] == 89, + "incorrect value for amplitude_value[33], expected 89, is %d", + check_msg->amplitude_value[33]); + ck_assert_msg(check_msg->amplitude_value[34] == 36, + "incorrect value for amplitude_value[34], expected 36, is %d", + check_msg->amplitude_value[34]); + ck_assert_msg( + check_msg->amplitude_value[35] == 186, + "incorrect value for amplitude_value[35], expected 186, is %d", + check_msg->amplitude_value[35]); + ck_assert_msg(check_msg->amplitude_value[36] == 99, + "incorrect value for amplitude_value[36], expected 99, is %d", + check_msg->amplitude_value[36]); + ck_assert_msg(check_msg->amplitude_value[37] == 63, + "incorrect value for amplitude_value[37], expected 63, is %d", + check_msg->amplitude_value[37]); + ck_assert_msg( + check_msg->amplitude_value[38] == 105, + "incorrect value for amplitude_value[38], expected 105, is %d", + check_msg->amplitude_value[38]); + ck_assert_msg( + check_msg->amplitude_value[39] == 116, + "incorrect value for amplitude_value[39], expected 116, is %d", + check_msg->amplitude_value[39]); + ck_assert_msg( + check_msg->amplitude_value[40] == 216, + "incorrect value for amplitude_value[40], expected 216, is %d", + check_msg->amplitude_value[40]); + ck_assert_msg(check_msg->amplitude_value[41] == 44, + "incorrect value for amplitude_value[41], expected 44, is %d", + check_msg->amplitude_value[41]); + ck_assert_msg(check_msg->amplitude_value[42] == 67, + "incorrect value for amplitude_value[42], expected 67, is %d", + check_msg->amplitude_value[42]); + ck_assert_msg( + check_msg->amplitude_value[43] == 212, + "incorrect value for amplitude_value[43], expected 212, is %d", + check_msg->amplitude_value[43]); + ck_assert_msg( + check_msg->amplitude_value[44] == 156, + "incorrect value for amplitude_value[44], expected 156, is %d", + check_msg->amplitude_value[44]); + ck_assert_msg(check_msg->amplitude_value[45] == 75, + "incorrect value for amplitude_value[45], expected 75, is %d", + check_msg->amplitude_value[45]); + ck_assert_msg(check_msg->amplitude_value[46] == 81, + "incorrect value for amplitude_value[46], expected 81, is %d", + check_msg->amplitude_value[46]); + ck_assert_msg(check_msg->amplitude_value[47] == 53, + "incorrect value for amplitude_value[47], expected 53, is %d", + check_msg->amplitude_value[47]); + ck_assert_msg( + check_msg->amplitude_value[48] == 250, + "incorrect value for amplitude_value[48], expected 250, is %d", + check_msg->amplitude_value[48]); + ck_assert_msg( + check_msg->amplitude_value[49] == 225, + "incorrect value for amplitude_value[49], expected 225, is %d", + check_msg->amplitude_value[49]); + ck_assert_msg(check_msg->amplitude_value[50] == 23, + "incorrect value for amplitude_value[50], expected 23, is %d", + check_msg->amplitude_value[50]); + ck_assert_msg( + check_msg->amplitude_value[51] == 205, + "incorrect value for amplitude_value[51], expected 205, is %d", + check_msg->amplitude_value[51]); + ck_assert_msg(check_msg->amplitude_value[52] == 26, + "incorrect value for amplitude_value[52], expected 26, is %d", + check_msg->amplitude_value[52]); + ck_assert_msg(check_msg->amplitude_value[53] == 34, + "incorrect value for amplitude_value[53], expected 34, is %d", + check_msg->amplitude_value[53]); + ck_assert_msg( + check_msg->amplitude_value[54] == 119, + "incorrect value for amplitude_value[54], expected 119, is %d", + check_msg->amplitude_value[54]); + ck_assert_msg(check_msg->amplitude_value[55] == 50, + "incorrect value for amplitude_value[55], expected 50, is %d", + check_msg->amplitude_value[55]); + ck_assert_msg( + check_msg->amplitude_value[56] == 101, + "incorrect value for amplitude_value[56], expected 101, is %d", + check_msg->amplitude_value[56]); + ck_assert_msg(check_msg->amplitude_value[57] == 64, + "incorrect value for amplitude_value[57], expected 64, is %d", + check_msg->amplitude_value[57]); + ck_assert_msg(check_msg->amplitude_value[58] == 7, + "incorrect value for amplitude_value[58], expected 7, is %d", + check_msg->amplitude_value[58]); + ck_assert_msg( + check_msg->amplitude_value[59] == 231, + "incorrect value for amplitude_value[59], expected 231, is %d", + check_msg->amplitude_value[59]); + ck_assert_msg( + check_msg->amplitude_value[60] == 124, + "incorrect value for amplitude_value[60], expected 124, is %d", + check_msg->amplitude_value[60]); + ck_assert_msg( + check_msg->amplitude_value[61] == 183, + "incorrect value for amplitude_value[61], expected 183, is %d", + check_msg->amplitude_value[61]); + ck_assert_msg( + check_msg->amplitude_value[62] == 203, + "incorrect value for amplitude_value[62], expected 203, is %d", + check_msg->amplitude_value[62]); + ck_assert_msg( + check_msg->amplitude_value[63] == 102, + "incorrect value for amplitude_value[63], expected 102, is %d", + check_msg->amplitude_value[63]); + ck_assert_msg( + check_msg->amplitude_value[64] == 234, + "incorrect value for amplitude_value[64], expected 234, is %d", + check_msg->amplitude_value[64]); + ck_assert_msg(check_msg->amplitude_value[65] == 84, + "incorrect value for amplitude_value[65], expected 84, is %d", + check_msg->amplitude_value[65]); + ck_assert_msg(check_msg->amplitude_value[66] == 83, + "incorrect value for amplitude_value[66], expected 83, is %d", + check_msg->amplitude_value[66]); + ck_assert_msg( + check_msg->amplitude_value[67] == 208, + "incorrect value for amplitude_value[67], expected 208, is %d", + check_msg->amplitude_value[67]); + ck_assert_msg(check_msg->amplitude_value[68] == 23, + "incorrect value for amplitude_value[68], expected 23, is %d", + check_msg->amplitude_value[68]); + ck_assert_msg(check_msg->amplitude_value[69] == 68, + "incorrect value for amplitude_value[69], expected 68, is %d", + check_msg->amplitude_value[69]); + ck_assert_msg(check_msg->amplitude_value[70] == 54, + "incorrect value for amplitude_value[70], expected 54, is %d", + check_msg->amplitude_value[70]); + ck_assert_msg( + check_msg->amplitude_value[71] == 179, + "incorrect value for amplitude_value[71], expected 179, is %d", + check_msg->amplitude_value[71]); + ck_assert_msg(check_msg->amplitude_value[72] == 98, + "incorrect value for amplitude_value[72], expected 98, is %d", + check_msg->amplitude_value[72]); + ck_assert_msg(check_msg->amplitude_value[73] == 96, + "incorrect value for amplitude_value[73], expected 96, is %d", + check_msg->amplitude_value[73]); + ck_assert_msg( + check_msg->amplitude_value[74] == 116, + "incorrect value for amplitude_value[74], expected 116, is %d", + check_msg->amplitude_value[74]); + ck_assert_msg( + check_msg->amplitude_value[75] == 244, + "incorrect value for amplitude_value[75], expected 244, is %d", + check_msg->amplitude_value[75]); + ck_assert_msg( + check_msg->amplitude_value[76] == 246, + "incorrect value for amplitude_value[76], expected 246, is %d", + check_msg->amplitude_value[76]); + ck_assert_msg(check_msg->amplitude_value[77] == 94, + "incorrect value for amplitude_value[77], expected 94, is %d", + check_msg->amplitude_value[77]); + ck_assert_msg( + check_msg->amplitude_value[78] == 104, + "incorrect value for amplitude_value[78], expected 104, is %d", + check_msg->amplitude_value[78]); + ck_assert_msg(check_msg->amplitude_value[79] == 94, + "incorrect value for amplitude_value[79], expected 94, is %d", + check_msg->amplitude_value[79]); + ck_assert_msg(check_msg->amplitude_value[80] == 13, + "incorrect value for amplitude_value[80], expected 13, is %d", + check_msg->amplitude_value[80]); + ck_assert_msg(check_msg->amplitude_value[81] == 56, + "incorrect value for amplitude_value[81], expected 56, is %d", + check_msg->amplitude_value[81]); + ck_assert_msg( + check_msg->amplitude_value[82] == 210, + "incorrect value for amplitude_value[82], expected 210, is %d", + check_msg->amplitude_value[82]); + ck_assert_msg(check_msg->amplitude_value[83] == 18, + "incorrect value for amplitude_value[83], expected 18, is %d", + check_msg->amplitude_value[83]); + ck_assert_msg( + check_msg->amplitude_value[84] == 191, + "incorrect value for amplitude_value[84], expected 191, is %d", + check_msg->amplitude_value[84]); + ck_assert_msg(check_msg->amplitude_value[85] == 22, + "incorrect value for amplitude_value[85], expected 22, is %d", + check_msg->amplitude_value[85]); + ck_assert_msg( + check_msg->amplitude_value[86] == 133, + "incorrect value for amplitude_value[86], expected 133, is %d", + check_msg->amplitude_value[86]); + ck_assert_msg(check_msg->amplitude_value[87] == 81, + "incorrect value for amplitude_value[87], expected 81, is %d", + check_msg->amplitude_value[87]); + ck_assert_msg( + check_msg->amplitude_value[88] == 153, + "incorrect value for amplitude_value[88], expected 153, is %d", + check_msg->amplitude_value[88]); + ck_assert_msg( + check_msg->amplitude_value[89] == 159, + "incorrect value for amplitude_value[89], expected 159, is %d", + check_msg->amplitude_value[89]); + ck_assert_msg( + check_msg->amplitude_value[90] == 161, + "incorrect value for amplitude_value[90], expected 161, is %d", + check_msg->amplitude_value[90]); + ck_assert_msg( + check_msg->amplitude_value[91] == 219, + "incorrect value for amplitude_value[91], expected 219, is %d", + check_msg->amplitude_value[91]); + ck_assert_msg(check_msg->amplitude_value[92] == 59, + "incorrect value for amplitude_value[92], expected 59, is %d", + check_msg->amplitude_value[92]); + ck_assert_msg(check_msg->amplitude_value[93] == 21, + "incorrect value for amplitude_value[93], expected 21, is %d", + check_msg->amplitude_value[93]); + ck_assert_msg( + check_msg->amplitude_value[94] == 164, + "incorrect value for amplitude_value[94], expected 164, is %d", + check_msg->amplitude_value[94]); + ck_assert_msg( + check_msg->amplitude_value[95] == 121, + "incorrect value for amplitude_value[95], expected 121, is %d", + check_msg->amplitude_value[95]); + ck_assert_msg( + check_msg->amplitude_value[96] == 145, + "incorrect value for amplitude_value[96], expected 145, is %d", + check_msg->amplitude_value[96]); + ck_assert_msg( + check_msg->amplitude_value[97] == 203, + "incorrect value for amplitude_value[97], expected 203, is %d", + check_msg->amplitude_value[97]); + ck_assert_msg( + check_msg->amplitude_value[98] == 171, + "incorrect value for amplitude_value[98], expected 171, is %d", + check_msg->amplitude_value[98]); + ck_assert_msg( + check_msg->amplitude_value[99] == 132, + "incorrect value for amplitude_value[99], expected 132, is %d", + check_msg->amplitude_value[99]); + ck_assert_msg( + check_msg->amplitude_value[100] == 57, + "incorrect value for amplitude_value[100], expected 57, is %d", + check_msg->amplitude_value[100]); + ck_assert_msg( + check_msg->amplitude_value[101] == 180, + "incorrect value for amplitude_value[101], expected 180, is %d", + check_msg->amplitude_value[101]); + ck_assert_msg( + check_msg->amplitude_value[102] == 102, + "incorrect value for amplitude_value[102], expected 102, is %d", + check_msg->amplitude_value[102]); + ck_assert_msg( + check_msg->amplitude_value[103] == 101, + "incorrect value for amplitude_value[103], expected 101, is %d", + check_msg->amplitude_value[103]); + ck_assert_msg( + check_msg->amplitude_value[104] == 11, + "incorrect value for amplitude_value[104], expected 11, is %d", + check_msg->amplitude_value[104]); + ck_assert_msg( + check_msg->amplitude_value[105] == 229, + "incorrect value for amplitude_value[105], expected 229, is %d", + check_msg->amplitude_value[105]); + ck_assert_msg( + check_msg->amplitude_value[106] == 175, + "incorrect value for amplitude_value[106], expected 175, is %d", + check_msg->amplitude_value[106]); + ck_assert_msg( + check_msg->amplitude_value[107] == 145, + "incorrect value for amplitude_value[107], expected 145, is %d", + check_msg->amplitude_value[107]); + ck_assert_msg( + check_msg->amplitude_value[108] == 73, + "incorrect value for amplitude_value[108], expected 73, is %d", + check_msg->amplitude_value[108]); + ck_assert_msg( + check_msg->amplitude_value[109] == 72, + "incorrect value for amplitude_value[109], expected 72, is %d", + check_msg->amplitude_value[109]); + ck_assert_msg( + check_msg->amplitude_value[110] == 124, + "incorrect value for amplitude_value[110], expected 124, is %d", + check_msg->amplitude_value[110]); + ck_assert_msg(check_msg->amplitude_value[111] == 4, + "incorrect value for amplitude_value[111], expected 4, is %d", + check_msg->amplitude_value[111]); + ck_assert_msg( + check_msg->amplitude_value[112] == 184, + "incorrect value for amplitude_value[112], expected 184, is %d", + check_msg->amplitude_value[112]); + ck_assert_msg( + check_msg->amplitude_value[113] == 228, + "incorrect value for amplitude_value[113], expected 228, is %d", + check_msg->amplitude_value[113]); + ck_assert_msg( + check_msg->amplitude_value[114] == 61, + "incorrect value for amplitude_value[114], expected 61, is %d", + check_msg->amplitude_value[114]); + ck_assert_msg( + check_msg->amplitude_value[115] == 234, + "incorrect value for amplitude_value[115], expected 234, is %d", + check_msg->amplitude_value[115]); + ck_assert_msg( + check_msg->amplitude_value[116] == 218, + "incorrect value for amplitude_value[116], expected 218, is %d", + check_msg->amplitude_value[116]); + ck_assert_msg( + check_msg->amplitude_value[117] == 62, + "incorrect value for amplitude_value[117], expected 62, is %d", + check_msg->amplitude_value[117]); + ck_assert_msg( + check_msg->amplitude_value[118] == 226, + "incorrect value for amplitude_value[118], expected 226, is %d", + check_msg->amplitude_value[118]); + ck_assert_msg( + check_msg->amplitude_value[119] == 217, + "incorrect value for amplitude_value[119], expected 217, is %d", + check_msg->amplitude_value[119]); + ck_assert_msg( + check_msg->amplitude_value[120] == 193, + "incorrect value for amplitude_value[120], expected 193, is %d", + check_msg->amplitude_value[120]); + ck_assert_msg(check_msg->amplitude_value[121] == 7, + "incorrect value for amplitude_value[121], expected 7, is %d", + check_msg->amplitude_value[121]); + ck_assert_msg( + check_msg->amplitude_value[122] == 109, + "incorrect value for amplitude_value[122], expected 109, is %d", + check_msg->amplitude_value[122]); + ck_assert_msg( + check_msg->amplitude_value[123] == 44, + "incorrect value for amplitude_value[123], expected 44, is %d", + check_msg->amplitude_value[123]); + ck_assert_msg( + check_msg->amplitude_value[124] == 83, + "incorrect value for amplitude_value[124], expected 83, is %d", + check_msg->amplitude_value[124]); + ck_assert_msg( + check_msg->amplitude_value[125] == 201, + "incorrect value for amplitude_value[125], expected 201, is %d", + check_msg->amplitude_value[125]); + ck_assert_msg( + check_msg->amplitude_value[126] == 20, + "incorrect value for amplitude_value[126], expected 20, is %d", + check_msg->amplitude_value[126]); + ck_assert_msg( + check_msg->amplitude_value[127] == 101, + "incorrect value for amplitude_value[127], expected 101, is %d", + check_msg->amplitude_value[127]); + ck_assert_msg(check_msg->amplitude_value[128] == 9, + "incorrect value for amplitude_value[128], expected 9, is %d", + check_msg->amplitude_value[128]); + ck_assert_msg( + check_msg->amplitude_value[129] == 140, + "incorrect value for amplitude_value[129], expected 140, is %d", + check_msg->amplitude_value[129]); + ck_assert_msg( + check_msg->amplitude_value[130] == 186, + "incorrect value for amplitude_value[130], expected 186, is %d", + check_msg->amplitude_value[130]); + ck_assert_msg( + check_msg->amplitude_value[131] == 162, + "incorrect value for amplitude_value[131], expected 162, is %d", + check_msg->amplitude_value[131]); + ck_assert_msg( + check_msg->amplitude_value[132] == 81, + "incorrect value for amplitude_value[132], expected 81, is %d", + check_msg->amplitude_value[132]); + ck_assert_msg( + check_msg->amplitude_value[133] == 91, + "incorrect value for amplitude_value[133], expected 91, is %d", + check_msg->amplitude_value[133]); + ck_assert_msg( + check_msg->amplitude_value[134] == 30, + "incorrect value for amplitude_value[134], expected 30, is %d", + check_msg->amplitude_value[134]); + ck_assert_msg( + check_msg->amplitude_value[135] == 231, + "incorrect value for amplitude_value[135], expected 231, is %d", + check_msg->amplitude_value[135]); + ck_assert_msg( + check_msg->amplitude_value[136] == 161, + "incorrect value for amplitude_value[136], expected 161, is %d", + check_msg->amplitude_value[136]); + ck_assert_msg( + check_msg->amplitude_value[137] == 81, + "incorrect value for amplitude_value[137], expected 81, is %d", + check_msg->amplitude_value[137]); + ck_assert_msg( + check_msg->amplitude_value[138] == 216, + "incorrect value for amplitude_value[138], expected 216, is %d", + check_msg->amplitude_value[138]); + ck_assert_msg( + check_msg->amplitude_value[139] == 114, + "incorrect value for amplitude_value[139], expected 114, is %d", + check_msg->amplitude_value[139]); + ck_assert_msg( + check_msg->amplitude_value[140] == 60, + "incorrect value for amplitude_value[140], expected 60, is %d", + check_msg->amplitude_value[140]); + ck_assert_msg( + check_msg->amplitude_value[141] == 231, + "incorrect value for amplitude_value[141], expected 231, is %d", + check_msg->amplitude_value[141]); + ck_assert_msg( + check_msg->amplitude_value[142] == 163, + "incorrect value for amplitude_value[142], expected 163, is %d", + check_msg->amplitude_value[142]); + ck_assert_msg( + check_msg->amplitude_value[143] == 163, + "incorrect value for amplitude_value[143], expected 163, is %d", + check_msg->amplitude_value[143]); + ck_assert_msg( + check_msg->amplitude_value[144] == 49, + "incorrect value for amplitude_value[144], expected 49, is %d", + check_msg->amplitude_value[144]); + ck_assert_msg( + check_msg->amplitude_value[145] == 237, + "incorrect value for amplitude_value[145], expected 237, is %d", + check_msg->amplitude_value[145]); + ck_assert_msg( + check_msg->amplitude_value[146] == 244, + "incorrect value for amplitude_value[146], expected 244, is %d", + check_msg->amplitude_value[146]); + ck_assert_msg( + check_msg->amplitude_value[147] == 185, + "incorrect value for amplitude_value[147], expected 185, is %d", + check_msg->amplitude_value[147]); + ck_assert_msg( + check_msg->amplitude_value[148] == 240, + "incorrect value for amplitude_value[148], expected 240, is %d", + check_msg->amplitude_value[148]); + ck_assert_msg( + check_msg->amplitude_value[149] == 89, + "incorrect value for amplitude_value[149], expected 89, is %d", + check_msg->amplitude_value[149]); + ck_assert_msg( + check_msg->amplitude_value[150] == 143, + "incorrect value for amplitude_value[150], expected 143, is %d", + check_msg->amplitude_value[150]); + ck_assert_msg( + check_msg->amplitude_value[151] == 174, + "incorrect value for amplitude_value[151], expected 174, is %d", + check_msg->amplitude_value[151]); + ck_assert_msg( + check_msg->amplitude_value[152] == 165, + "incorrect value for amplitude_value[152], expected 165, is %d", + check_msg->amplitude_value[152]); + ck_assert_msg( + check_msg->amplitude_value[153] == 211, + "incorrect value for amplitude_value[153], expected 211, is %d", + check_msg->amplitude_value[153]); + ck_assert_msg( + check_msg->amplitude_value[154] == 241, + "incorrect value for amplitude_value[154], expected 241, is %d", + check_msg->amplitude_value[154]); + ck_assert_msg( + check_msg->amplitude_value[155] == 13, + "incorrect value for amplitude_value[155], expected 13, is %d", + check_msg->amplitude_value[155]); + ck_assert_msg( + check_msg->amplitude_value[156] == 16, + "incorrect value for amplitude_value[156], expected 16, is %d", + check_msg->amplitude_value[156]); + ck_assert_msg( + check_msg->amplitude_value[157] == 61, + "incorrect value for amplitude_value[157], expected 61, is %d", + check_msg->amplitude_value[157]); + ck_assert_msg( + check_msg->amplitude_value[158] == 141, + "incorrect value for amplitude_value[158], expected 141, is %d", + check_msg->amplitude_value[158]); + ck_assert_msg( + check_msg->amplitude_value[159] == 101, + "incorrect value for amplitude_value[159], expected 101, is %d", + check_msg->amplitude_value[159]); + ck_assert_msg( + check_msg->amplitude_value[160] == 89, + "incorrect value for amplitude_value[160], expected 89, is %d", + check_msg->amplitude_value[160]); + ck_assert_msg( + check_msg->amplitude_value[161] == 37, + "incorrect value for amplitude_value[161], expected 37, is %d", + check_msg->amplitude_value[161]); + ck_assert_msg( + check_msg->amplitude_value[162] == 117, + "incorrect value for amplitude_value[162], expected 117, is %d", + check_msg->amplitude_value[162]); + ck_assert_msg( + check_msg->amplitude_value[163] == 189, + "incorrect value for amplitude_value[163], expected 189, is %d", + check_msg->amplitude_value[163]); + ck_assert_msg( + check_msg->amplitude_value[164] == 86, + "incorrect value for amplitude_value[164], expected 86, is %d", + check_msg->amplitude_value[164]); + ck_assert_msg( + check_msg->amplitude_value[165] == 118, + "incorrect value for amplitude_value[165], expected 118, is %d", + check_msg->amplitude_value[165]); + ck_assert_msg( + check_msg->amplitude_value[166] == 176, + "incorrect value for amplitude_value[166], expected 176, is %d", + check_msg->amplitude_value[166]); + ck_assert_msg( + check_msg->amplitude_value[167] == 228, + "incorrect value for amplitude_value[167], expected 228, is %d", + check_msg->amplitude_value[167]); + ck_assert_msg( + check_msg->amplitude_value[168] == 12, + "incorrect value for amplitude_value[168], expected 12, is %d", + check_msg->amplitude_value[168]); + ck_assert_msg( + check_msg->amplitude_value[169] == 14, + "incorrect value for amplitude_value[169], expected 14, is %d", + check_msg->amplitude_value[169]); + ck_assert_msg( + check_msg->amplitude_value[170] == 119, + "incorrect value for amplitude_value[170], expected 119, is %d", + check_msg->amplitude_value[170]); + ck_assert_msg( + check_msg->amplitude_value[171] == 135, + "incorrect value for amplitude_value[171], expected 135, is %d", + check_msg->amplitude_value[171]); + ck_assert_msg( + check_msg->amplitude_value[172] == 129, + "incorrect value for amplitude_value[172], expected 129, is %d", + check_msg->amplitude_value[172]); + ck_assert_msg( + check_msg->amplitude_value[173] == 243, + "incorrect value for amplitude_value[173], expected 243, is %d", + check_msg->amplitude_value[173]); + ck_assert_msg( + check_msg->amplitude_value[174] == 50, + "incorrect value for amplitude_value[174], expected 50, is %d", + check_msg->amplitude_value[174]); + ck_assert_msg( + check_msg->amplitude_value[175] == 29, + "incorrect value for amplitude_value[175], expected 29, is %d", + check_msg->amplitude_value[175]); + ck_assert_msg( + check_msg->amplitude_value[176] == 207, + "incorrect value for amplitude_value[176], expected 207, is %d", + check_msg->amplitude_value[176]); + ck_assert_msg( + check_msg->amplitude_value[177] == 198, + "incorrect value for amplitude_value[177], expected 198, is %d", + check_msg->amplitude_value[177]); + ck_assert_msg( + check_msg->amplitude_value[178] == 117, + "incorrect value for amplitude_value[178], expected 117, is %d", + check_msg->amplitude_value[178]); + ck_assert_msg( + check_msg->amplitude_value[179] == 100, + "incorrect value for amplitude_value[179], expected 100, is %d", + check_msg->amplitude_value[179]); + ck_assert_msg( + check_msg->amplitude_value[180] == 225, + "incorrect value for amplitude_value[180], expected 225, is %d", + check_msg->amplitude_value[180]); + ck_assert_msg(check_msg->amplitude_value[181] == 6, + "incorrect value for amplitude_value[181], expected 6, is %d", + check_msg->amplitude_value[181]); + ck_assert_msg( + check_msg->amplitude_value[182] == 139, + "incorrect value for amplitude_value[182], expected 139, is %d", + check_msg->amplitude_value[182]); + ck_assert_msg( + check_msg->amplitude_value[183] == 110, + "incorrect value for amplitude_value[183], expected 110, is %d", + check_msg->amplitude_value[183]); + ck_assert_msg( + check_msg->amplitude_value[184] == 39, + "incorrect value for amplitude_value[184], expected 39, is %d", + check_msg->amplitude_value[184]); + ck_assert_msg( + check_msg->amplitude_value[185] == 210, + "incorrect value for amplitude_value[185], expected 210, is %d", + check_msg->amplitude_value[185]); + ck_assert_msg( + check_msg->amplitude_value[186] == 68, + "incorrect value for amplitude_value[186], expected 68, is %d", + check_msg->amplitude_value[186]); + ck_assert_msg( + check_msg->amplitude_value[187] == 199, + "incorrect value for amplitude_value[187], expected 199, is %d", + check_msg->amplitude_value[187]); + ck_assert_msg( + check_msg->amplitude_value[188] == 43, + "incorrect value for amplitude_value[188], expected 43, is %d", + check_msg->amplitude_value[188]); + ck_assert_msg( + check_msg->amplitude_value[189] == 132, + "incorrect value for amplitude_value[189], expected 132, is %d", + check_msg->amplitude_value[189]); + ck_assert_msg( + check_msg->amplitude_value[190] == 64, + "incorrect value for amplitude_value[190], expected 64, is %d", + check_msg->amplitude_value[190]); + ck_assert_msg( + check_msg->amplitude_value[191] == 17, + "incorrect value for amplitude_value[191], expected 17, is %d", + check_msg->amplitude_value[191]); + ck_assert_msg( + check_msg->amplitude_value[192] == 51, + "incorrect value for amplitude_value[192], expected 51, is %d", + check_msg->amplitude_value[192]); + ck_assert_msg( + check_msg->amplitude_value[193] == 173, + "incorrect value for amplitude_value[193], expected 173, is %d", + check_msg->amplitude_value[193]); + ck_assert_msg( + check_msg->amplitude_value[194] == 181, + "incorrect value for amplitude_value[194], expected 181, is %d", + check_msg->amplitude_value[194]); + ck_assert_msg( + check_msg->amplitude_value[195] == 12, + "incorrect value for amplitude_value[195], expected 12, is %d", + check_msg->amplitude_value[195]); + ck_assert_msg( + check_msg->amplitude_value[196] == 140, + "incorrect value for amplitude_value[196], expected 140, is %d", + check_msg->amplitude_value[196]); + ck_assert_msg( + check_msg->amplitude_value[197] == 16, + "incorrect value for amplitude_value[197], expected 16, is %d", + check_msg->amplitude_value[197]); + ck_assert_msg( + check_msg->amplitude_value[198] == 247, + "incorrect value for amplitude_value[198], expected 247, is %d", + check_msg->amplitude_value[198]); + ck_assert_msg( + check_msg->amplitude_value[199] == 84, + "incorrect value for amplitude_value[199], expected 84, is %d", + check_msg->amplitude_value[199]); + ck_assert_msg( + check_msg->amplitude_value[200] == 183, + "incorrect value for amplitude_value[200], expected 183, is %d", + check_msg->amplitude_value[200]); + ck_assert_msg( + check_msg->amplitude_value[201] == 105, + "incorrect value for amplitude_value[201], expected 105, is %d", + check_msg->amplitude_value[201]); + ck_assert_msg( + check_msg->amplitude_value[202] == 39, + "incorrect value for amplitude_value[202], expected 39, is %d", + check_msg->amplitude_value[202]); + ck_assert_msg( + check_msg->amplitude_value[203] == 157, + "incorrect value for amplitude_value[203], expected 157, is %d", + check_msg->amplitude_value[203]); + ck_assert_msg( + check_msg->amplitude_value[204] == 77, + "incorrect value for amplitude_value[204], expected 77, is %d", + check_msg->amplitude_value[204]); + ck_assert_msg( + check_msg->amplitude_value[205] == 30, + "incorrect value for amplitude_value[205], expected 30, is %d", + check_msg->amplitude_value[205]); + ck_assert_msg( + check_msg->amplitude_value[206] == 205, + "incorrect value for amplitude_value[206], expected 205, is %d", + check_msg->amplitude_value[206]); + ck_assert_msg( + check_msg->amplitude_value[207] == 194, + "incorrect value for amplitude_value[207], expected 194, is %d", + check_msg->amplitude_value[207]); + ck_assert_msg( + check_msg->amplitude_value[208] == 59, + "incorrect value for amplitude_value[208], expected 59, is %d", + check_msg->amplitude_value[208]); + ck_assert_msg( + check_msg->amplitude_value[209] == 64, + "incorrect value for amplitude_value[209], expected 64, is %d", + check_msg->amplitude_value[209]); + ck_assert_msg( + check_msg->amplitude_value[210] == 241, + "incorrect value for amplitude_value[210], expected 241, is %d", + check_msg->amplitude_value[210]); + ck_assert_msg( + check_msg->amplitude_value[211] == 183, + "incorrect value for amplitude_value[211], expected 183, is %d", + check_msg->amplitude_value[211]); + ck_assert_msg( + check_msg->amplitude_value[212] == 238, + "incorrect value for amplitude_value[212], expected 238, is %d", + check_msg->amplitude_value[212]); + ck_assert_msg( + check_msg->amplitude_value[213] == 105, + "incorrect value for amplitude_value[213], expected 105, is %d", + check_msg->amplitude_value[213]); + ck_assert_msg( + check_msg->amplitude_value[214] == 181, + "incorrect value for amplitude_value[214], expected 181, is %d", + check_msg->amplitude_value[214]); + ck_assert_msg( + check_msg->amplitude_value[215] == 170, + "incorrect value for amplitude_value[215], expected 170, is %d", + check_msg->amplitude_value[215]); + ck_assert_msg( + check_msg->amplitude_value[216] == 45, + "incorrect value for amplitude_value[216], expected 45, is %d", + check_msg->amplitude_value[216]); + ck_assert_msg(check_msg->amplitude_value[217] == 8, + "incorrect value for amplitude_value[217], expected 8, is %d", + check_msg->amplitude_value[217]); + ck_assert_msg( + check_msg->amplitude_value[218] == 166, + "incorrect value for amplitude_value[218], expected 166, is %d", + check_msg->amplitude_value[218]); + ck_assert_msg( + check_msg->amplitude_value[219] == 164, + "incorrect value for amplitude_value[219], expected 164, is %d", + check_msg->amplitude_value[219]); + ck_assert_msg( + check_msg->amplitude_value[220] == 238, + "incorrect value for amplitude_value[220], expected 238, is %d", + check_msg->amplitude_value[220]); + ck_assert_msg( + check_msg->amplitude_value[221] == 83, + "incorrect value for amplitude_value[221], expected 83, is %d", + check_msg->amplitude_value[221]); + ck_assert_msg( + check_msg->amplitude_value[222] == 148, + "incorrect value for amplitude_value[222], expected 148, is %d", + check_msg->amplitude_value[222]); + ck_assert_msg( + check_msg->amplitude_value[223] == 173, + "incorrect value for amplitude_value[223], expected 173, is %d", + check_msg->amplitude_value[223]); + ck_assert_msg( + check_msg->amplitude_value[224] == 108, + "incorrect value for amplitude_value[224], expected 108, is %d", + check_msg->amplitude_value[224]); + ck_assert_msg( + check_msg->amplitude_value[225] == 228, + "incorrect value for amplitude_value[225], expected 228, is %d", + check_msg->amplitude_value[225]); + ck_assert_msg( + check_msg->amplitude_value[226] == 67, + "incorrect value for amplitude_value[226], expected 67, is %d", + check_msg->amplitude_value[226]); + ck_assert_msg( + check_msg->amplitude_value[227] == 89, + "incorrect value for amplitude_value[227], expected 89, is %d", + check_msg->amplitude_value[227]); + ck_assert_msg( + check_msg->amplitude_value[228] == 189, + "incorrect value for amplitude_value[228], expected 189, is %d", + check_msg->amplitude_value[228]); + ck_assert_msg( + check_msg->amplitude_value[229] == 67, + "incorrect value for amplitude_value[229], expected 67, is %d", + check_msg->amplitude_value[229]); + ck_assert_msg( + check_msg->amplitude_value[230] == 26, + "incorrect value for amplitude_value[230], expected 26, is %d", + check_msg->amplitude_value[230]); + ck_assert_msg(check_msg->channel_tag == 5878, + "incorrect value for channel_tag, expected 5878, is %d", + check_msg->channel_tag); + ck_assert_msg((check_msg->freq_ref * 100 - 6348.20019531 * 100) < 0.05, + "incorrect value for freq_ref, expected 6348.20019531, is %f", + check_msg->freq_ref); + ck_assert_msg( + (check_msg->freq_step * 100 - 4608.20019531 * 100) < 0.05, + "incorrect value for freq_step, expected 4608.20019531, is %f", + check_msg->freq_step); + ck_assert_msg(check_msg->t.tow == 992295133, + "incorrect value for t.tow, expected 992295133, is %d", + check_msg->t.tow); + ck_assert_msg(check_msg->t.wn == 6957, + "incorrect value for t.wn, expected 6957, is %d", + check_msg->t.wn); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgSpecanDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgSpecanDep"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgSpecanDep"); +Suite *legacy_auto_check_sbp_piksi_MsgSpecanDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgSpecanDep"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgSpecanDep"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgSpecanDep); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgThreadState.c b/c/test/legacy/auto_check_sbp_piksi_MsgThreadState.c index 989faa178..02b467177 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgThreadState.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgThreadState.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgThreadState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgThreadState.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgThreadState ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgThreadState) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgThreadState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,86 +128,110 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,23,0,246,215,26,109,97,105,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,156,9,0,0,73,138, }; + u8 encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 109, 97, 105, 110, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 9, 0, 0, 73, 138, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; + msg_thread_state_t* test_msg = (msg_thread_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu = 0; { - const char assign_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg->name, assign_string, sizeof(assign_string)); if (sizeof(test_msg->name) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->stack_free = 2460; - sbp_payload_send(&sbp_state, 0x17, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x17, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x17, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_thread_state_t* check_msg = ( msg_thread_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_thread_state_t* check_msg = (msg_thread_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu == 0, "incorrect value for cpu, expected 0, is %d", check_msg->cpu); + ck_assert_msg(check_msg->cpu == 0, + "incorrect value for cpu, expected 0, is %d", check_msg->cpu); { - const char check_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->name, expected string '%s', is '%s'", check_string, check_msg->name); + const char check_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->name, expected string '%s', is '%s'", + check_string, check_msg->name); } - ck_assert_msg(check_msg->stack_free == 2460, "incorrect value for stack_free, expected 2460, is %d", check_msg->stack_free); + ck_assert_msg(check_msg->stack_free == 2460, + "incorrect value for stack_free, expected 2460, is %d", + check_msg->stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -218,86 +239,111 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,23,0,246,215,26,105,100,108,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,2,36,0,0,0,151,20, }; + u8 encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 105, 100, 108, 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 2, 36, 0, 0, 0, 151, 20, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; + msg_thread_state_t* test_msg = (msg_thread_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu = 595; { - const char assign_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg->name, assign_string, sizeof(assign_string)); if (sizeof(test_msg->name) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->stack_free = 36; - sbp_payload_send(&sbp_state, 0x17, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x17, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x17, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_thread_state_t* check_msg = ( msg_thread_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_thread_state_t* check_msg = (msg_thread_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu == 595, "incorrect value for cpu, expected 595, is %d", check_msg->cpu); + ck_assert_msg(check_msg->cpu == 595, + "incorrect value for cpu, expected 595, is %d", + check_msg->cpu); { - const char check_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->name, expected string '%s', is '%s'", check_string, check_msg->name); + const char check_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->name, expected string '%s', is '%s'", + check_string, check_msg->name); } - ck_assert_msg(check_msg->stack_free == 36, "incorrect value for stack_free, expected 36, is %d", check_msg->stack_free); + ck_assert_msg(check_msg->stack_free == 36, + "incorrect value for stack_free, expected 36, is %d", + check_msg->stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -305,86 +351,111 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,23,0,246,215,26,78,65,80,32,73,83,82,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,116,4,0,0,226,60, }; + u8 encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 78, 65, 80, 32, 73, 83, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 116, 4, 0, 0, 226, 60, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; + msg_thread_state_t* test_msg = (msg_thread_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu = 14; { - const char assign_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg->name, assign_string, sizeof(assign_string)); if (sizeof(test_msg->name) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->stack_free = 1140; - sbp_payload_send(&sbp_state, 0x17, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x17, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x17, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_thread_state_t* check_msg = ( msg_thread_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_thread_state_t* check_msg = (msg_thread_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu == 14, "incorrect value for cpu, expected 14, is %d", check_msg->cpu); + ck_assert_msg(check_msg->cpu == 14, + "incorrect value for cpu, expected 14, is %d", + check_msg->cpu); { - const char check_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->name, expected string '%s', is '%s'", check_string, check_msg->name); + const char check_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->name, expected string '%s', is '%s'", + check_string, check_msg->name); } - ck_assert_msg(check_msg->stack_free == 1140, "incorrect value for stack_free, expected 1140, is %d", check_msg->stack_free); + ck_assert_msg(check_msg->stack_free == 1140, + "incorrect value for stack_free, expected 1140, is %d", + check_msg->stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -392,86 +463,110 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,23,0,246,215,26,83,66,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,196,19,0,0,90,169, }; + u8 encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 83, 66, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 196, 19, 0, 0, 90, 169, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; + msg_thread_state_t* test_msg = (msg_thread_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu = 1; { - const char assign_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg->name, assign_string, sizeof(assign_string)); if (sizeof(test_msg->name) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->stack_free = 5060; - sbp_payload_send(&sbp_state, 0x17, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x17, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x17, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_thread_state_t* check_msg = ( msg_thread_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_thread_state_t* check_msg = (msg_thread_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu == 1, "incorrect value for cpu, expected 1, is %d", check_msg->cpu); + ck_assert_msg(check_msg->cpu == 1, + "incorrect value for cpu, expected 1, is %d", check_msg->cpu); { - const char check_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->name, expected string '%s', is '%s'", check_string, check_msg->name); + const char check_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->name, expected string '%s', is '%s'", + check_string, check_msg->name); } - ck_assert_msg(check_msg->stack_free == 5060, "incorrect value for stack_free, expected 5060, is %d", check_msg->stack_free); + ck_assert_msg(check_msg->stack_free == 5060, + "incorrect value for stack_free, expected 5060, is %d", + check_msg->stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -479,86 +574,113 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,23,0,246,215,26,109,97,110,97,103,101,32,97,99,113,0,0,0,0,0,0,0,0,0,0,7,0,20,9,0,0,47,75, }; + u8 encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 109, 97, 110, 97, 103, 101, + 32, 97, 99, 113, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 7, 0, 20, 9, 0, 0, 47, 75, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; + msg_thread_state_t* test_msg = (msg_thread_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu = 7; { - const char assign_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg->name, assign_string, sizeof(assign_string)); if (sizeof(test_msg->name) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->stack_free = 2324; - sbp_payload_send(&sbp_state, 0x17, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x17, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x17, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_thread_state_t* check_msg = ( msg_thread_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_thread_state_t* check_msg = (msg_thread_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu == 7, "incorrect value for cpu, expected 7, is %d", check_msg->cpu); + ck_assert_msg(check_msg->cpu == 7, + "incorrect value for cpu, expected 7, is %d", check_msg->cpu); { - const char check_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->name, expected string '%s', is '%s'", check_string, check_msg->name); + const char check_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->name, expected string '%s', is '%s'", + check_string, check_msg->name); } - ck_assert_msg(check_msg->stack_free == 2324, "incorrect value for stack_free, expected 2324, is %d", check_msg->stack_free); + ck_assert_msg(check_msg->stack_free == 2324, + "incorrect value for stack_free, expected 2324, is %d", + check_msg->stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -566,86 +688,110 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,23,0,195,4,26,109,97,105,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148,9,0,0,195,212, }; + u8 encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 109, 97, 105, 110, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 9, 0, 0, 195, 212, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; + msg_thread_state_t* test_msg = (msg_thread_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu = 0; { - const char assign_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg->name, assign_string, sizeof(assign_string)); if (sizeof(test_msg->name) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->stack_free = 2452; - sbp_payload_send(&sbp_state, 0x17, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x17, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x17, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_thread_state_t* check_msg = ( msg_thread_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_thread_state_t* check_msg = (msg_thread_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu == 0, "incorrect value for cpu, expected 0, is %d", check_msg->cpu); + ck_assert_msg(check_msg->cpu == 0, + "incorrect value for cpu, expected 0, is %d", check_msg->cpu); { - const char check_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->name, expected string '%s', is '%s'", check_string, check_msg->name); + const char check_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->name, expected string '%s', is '%s'", + check_string, check_msg->name); } - ck_assert_msg(check_msg->stack_free == 2452, "incorrect value for stack_free, expected 2452, is %d", check_msg->stack_free); + ck_assert_msg(check_msg->stack_free == 2452, + "incorrect value for stack_free, expected 2452, is %d", + check_msg->stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -653,86 +799,111 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,23,0,195,4,26,105,100,108,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,228,1,36,0,0,0,225,18, }; + u8 encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 105, 100, 108, 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 1, 36, 0, 0, 0, 225, 18, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; + msg_thread_state_t* test_msg = (msg_thread_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu = 484; { - const char assign_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg->name, assign_string, sizeof(assign_string)); if (sizeof(test_msg->name) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->stack_free = 36; - sbp_payload_send(&sbp_state, 0x17, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x17, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x17, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_thread_state_t* check_msg = ( msg_thread_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_thread_state_t* check_msg = (msg_thread_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu == 484, "incorrect value for cpu, expected 484, is %d", check_msg->cpu); + ck_assert_msg(check_msg->cpu == 484, + "incorrect value for cpu, expected 484, is %d", + check_msg->cpu); { - const char check_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->name, expected string '%s', is '%s'", check_string, check_msg->name); + const char check_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->name, expected string '%s', is '%s'", + check_string, check_msg->name); } - ck_assert_msg(check_msg->stack_free == 36, "incorrect value for stack_free, expected 36, is %d", check_msg->stack_free); + ck_assert_msg(check_msg->stack_free == 36, + "incorrect value for stack_free, expected 36, is %d", + check_msg->stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -740,86 +911,111 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,23,0,195,4,26,78,65,80,32,73,83,82,0,0,0,0,0,0,0,0,0,0,0,0,0,138,1,92,7,0,0,166,116, }; + u8 encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 78, 65, 80, 32, 73, 83, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 1, 92, 7, 0, 0, 166, 116, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; + msg_thread_state_t* test_msg = (msg_thread_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu = 394; { - const char assign_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg->name, assign_string, sizeof(assign_string)); if (sizeof(test_msg->name) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->stack_free = 1884; - sbp_payload_send(&sbp_state, 0x17, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x17, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x17, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_thread_state_t* check_msg = ( msg_thread_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_thread_state_t* check_msg = (msg_thread_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu == 394, "incorrect value for cpu, expected 394, is %d", check_msg->cpu); + ck_assert_msg(check_msg->cpu == 394, + "incorrect value for cpu, expected 394, is %d", + check_msg->cpu); { - const char check_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->name, expected string '%s', is '%s'", check_string, check_msg->name); + const char check_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->name, expected string '%s', is '%s'", + check_string, check_msg->name); } - ck_assert_msg(check_msg->stack_free == 1884, "incorrect value for stack_free, expected 1884, is %d", check_msg->stack_free); + ck_assert_msg(check_msg->stack_free == 1884, + "incorrect value for stack_free, expected 1884, is %d", + check_msg->stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -827,86 +1023,110 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,23,0,195,4,26,83,66,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,4,12,0,0,229,174, }; + u8 encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 83, 66, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 12, 0, 0, 229, 174, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; + msg_thread_state_t* test_msg = (msg_thread_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu = 1; { - const char assign_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg->name, assign_string, sizeof(assign_string)); if (sizeof(test_msg->name) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->stack_free = 3076; - sbp_payload_send(&sbp_state, 0x17, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x17, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x17, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_thread_state_t* check_msg = ( msg_thread_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_thread_state_t* check_msg = (msg_thread_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu == 1, "incorrect value for cpu, expected 1, is %d", check_msg->cpu); + ck_assert_msg(check_msg->cpu == 1, + "incorrect value for cpu, expected 1, is %d", check_msg->cpu); { - const char check_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->name, expected string '%s', is '%s'", check_string, check_msg->name); + const char check_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->name, expected string '%s', is '%s'", + check_string, check_msg->name); } - ck_assert_msg(check_msg->stack_free == 3076, "incorrect value for stack_free, expected 3076, is %d", check_msg->stack_free); + ck_assert_msg(check_msg->stack_free == 3076, + "incorrect value for stack_free, expected 3076, is %d", + check_msg->stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -914,86 +1134,113 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,23,0,195,4,26,109,97,110,97,103,101,32,97,99,113,0,0,0,0,0,0,0,0,0,0,10,0,124,9,0,0,52,2, }; + u8 encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 109, 97, 110, 97, 103, 101, 32, 97, 99, 113, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 124, 9, 0, 0, 52, 2, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; + msg_thread_state_t* test_msg = (msg_thread_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu = 10; { - const char assign_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg->name, assign_string, sizeof(assign_string)); if (sizeof(test_msg->name) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->stack_free = 2428; - sbp_payload_send(&sbp_state, 0x17, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x17, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x17, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_thread_state_t* check_msg = ( msg_thread_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_thread_state_t* check_msg = (msg_thread_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu == 10, "incorrect value for cpu, expected 10, is %d", check_msg->cpu); + ck_assert_msg(check_msg->cpu == 10, + "incorrect value for cpu, expected 10, is %d", + check_msg->cpu); { - const char check_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->name, expected string '%s', is '%s'", check_string, check_msg->name); + const char check_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->name, expected string '%s', is '%s'", + check_string, check_msg->name); } - ck_assert_msg(check_msg->stack_free == 2428, "incorrect value for stack_free, expected 2428, is %d", check_msg->stack_free); + ck_assert_msg(check_msg->stack_free == 2428, + "incorrect value for stack_free, expected 2428, is %d", + check_msg->stack_free); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -1001,89 +1248,116 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgThreadState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x17, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x17, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,23,0,195,4,26,109,97,110,97,103,101,32,116,114,97,99,107,0,0,0,0,0,0,0,0,0,0,28,9,0,0,122,54, }; + u8 encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 109, 97, 110, 97, 103, 101, + 32, 116, 114, 97, 99, 107, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 28, 9, 0, 0, 122, 54, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; + msg_thread_state_t* test_msg = (msg_thread_state_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cpu = 0; { - const char assign_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)116,(char)114,(char)97,(char)99,(char)107,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; + const char assign_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)116, + (char)114, (char)97, (char)99, (char)107, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; memcpy(test_msg->name, assign_string, sizeof(assign_string)); if (sizeof(test_msg->name) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->stack_free = 2332; - sbp_payload_send(&sbp_state, 0x17, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x17, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x17, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_thread_state_t* check_msg = ( msg_thread_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_thread_state_t* check_msg = (msg_thread_state_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cpu == 0, "incorrect value for cpu, expected 0, is %d", check_msg->cpu); + ck_assert_msg(check_msg->cpu == 0, + "incorrect value for cpu, expected 0, is %d", check_msg->cpu); { - const char check_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)116,(char)114,(char)97,(char)99,(char)107,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - ck_assert_msg(memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->name, expected string '%s', is '%s'", check_string, check_msg->name); + const char check_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)116, + (char)114, (char)97, (char)99, (char)107, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + ck_assert_msg( + memcmp(check_msg->name, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->name, expected string '%s', is '%s'", + check_string, check_msg->name); } - ck_assert_msg(check_msg->stack_free == 2332, "incorrect value for stack_free, expected 2332, is %d", check_msg->stack_free); + ck_assert_msg(check_msg->stack_free == 2332, + "incorrect value for stack_free, expected 2332, is %d", + check_msg->stack_free); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgThreadState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgThreadState"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgThreadState"); +Suite* legacy_auto_check_sbp_piksi_MsgThreadState_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgThreadState"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_piksi_MsgThreadState"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgThreadState); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgUartState.c b/c/test/legacy/auto_check_sbp_piksi_MsgUartState.c index bd8f6a5e6..98728b9e4 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgUartState.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgUartState.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartState.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartState ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgUartState) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,26 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x1d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x1d, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x1d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x1d, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,29,0,200,224,74,154,169,242,69,102,166,231,68,89,98,79,184,138,244,154,73,201,69,154,65,211,69,201,16,103,249,143,161,154,17,186,69,51,211,7,69,215,149,253,25,218,24,29,195,16,19,159,142,71,17,10,113,137,219,135,18,182,21,38,190,59,196,169,155,107,111,253,168,244,158,112,19,251,131,100,225, }; + u8 encoded_frame[] = { + 85, 29, 0, 200, 224, 74, 154, 169, 242, 69, 102, 166, 231, 68, + 89, 98, 79, 184, 138, 244, 154, 73, 201, 69, 154, 65, 211, 69, + 201, 16, 103, 249, 143, 161, 154, 17, 186, 69, 51, 211, 7, 69, + 215, 149, 253, 25, 218, 24, 29, 195, 16, 19, 159, 142, 71, 17, + 10, 113, 137, 219, 135, 18, 182, 21, 38, 190, 59, 196, 169, 155, + 107, 111, 253, 168, 244, 158, 112, 19, 251, 131, 100, 225, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_uart_state_t* test_msg = ( msg_uart_state_t* )test_msg_storage; + msg_uart_state_t *test_msg = (msg_uart_state_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->latency.avg = 319865629; test_msg->latency.current = 364253831; @@ -169,88 +175,177 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartState ) test_msg->uart_ftdi.rx_throughput = 2173.199951171875; test_msg->uart_ftdi.tx_buffer_level = 218; test_msg->uart_ftdi.tx_throughput = 5954.2001953125; - sbp_payload_send(&sbp_state, 0x1d, 57544, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x1d, 57544, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 57544, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 57544, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x1d, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_uart_state_t* check_msg = ( msg_uart_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_uart_state_t *check_msg = (msg_uart_state_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->latency.avg == 319865629, "incorrect value for latency.avg, expected 319865629, is %d", check_msg->latency.avg); - ck_assert_msg(check_msg->latency.current == 364253831, "incorrect value for latency.current, expected 364253831, is %d", check_msg->latency.current); - ck_assert_msg(check_msg->latency.lmax == -611749622, "incorrect value for latency.lmax, expected -611749622, is %d", check_msg->latency.lmax); - ck_assert_msg(check_msg->latency.lmin == 289902239, "incorrect value for latency.lmin, expected 289902239, is %d", check_msg->latency.lmin); - ck_assert_msg(check_msg->obs_period.avg == -1002717658, "incorrect value for obs_period.avg, expected -1002717658, is %d", check_msg->obs_period.avg); - ck_assert_msg(check_msg->obs_period.current == -2080697488, "incorrect value for obs_period.current, expected -2080697488, is %d", check_msg->obs_period.current); - ck_assert_msg(check_msg->obs_period.pmax == -1628133123, "incorrect value for obs_period.pmax, expected -1628133123, is %d", check_msg->obs_period.pmax); - ck_assert_msg(check_msg->obs_period.pmin == 1869323177, "incorrect value for obs_period.pmin, expected 1869323177, is %d", check_msg->obs_period.pmin); - ck_assert_msg(check_msg->uart_a.crc_error_count == 25177, "incorrect value for uart_a.crc_error_count, expected 25177, is %d", check_msg->uart_a.crc_error_count); - ck_assert_msg(check_msg->uart_a.io_error_count == 47183, "incorrect value for uart_a.io_error_count, expected 47183, is %d", check_msg->uart_a.io_error_count); - ck_assert_msg(check_msg->uart_a.rx_buffer_level == 244, "incorrect value for uart_a.rx_buffer_level, expected 244, is %d", check_msg->uart_a.rx_buffer_level); - ck_assert_msg((check_msg->uart_a.rx_throughput*100 - 1853.19995117*100) < 0.05, "incorrect value for uart_a.rx_throughput, expected 1853.19995117, is %f", check_msg->uart_a.rx_throughput); - ck_assert_msg(check_msg->uart_a.tx_buffer_level == 138, "incorrect value for uart_a.tx_buffer_level, expected 138, is %d", check_msg->uart_a.tx_buffer_level); - ck_assert_msg((check_msg->uart_a.tx_throughput*100 - 7765.20019531*100) < 0.05, "incorrect value for uart_a.tx_throughput, expected 7765.20019531, is %f", check_msg->uart_a.tx_throughput); - ck_assert_msg(check_msg->uart_b.crc_error_count == 4297, "incorrect value for uart_b.crc_error_count, expected 4297, is %d", check_msg->uart_b.crc_error_count); - ck_assert_msg(check_msg->uart_b.io_error_count == 63847, "incorrect value for uart_b.io_error_count, expected 63847, is %d", check_msg->uart_b.io_error_count); - ck_assert_msg(check_msg->uart_b.rx_buffer_level == 161, "incorrect value for uart_b.rx_buffer_level, expected 161, is %d", check_msg->uart_b.rx_buffer_level); - ck_assert_msg((check_msg->uart_b.rx_throughput*100 - 6760.20019531*100) < 0.05, "incorrect value for uart_b.rx_throughput, expected 6760.20019531, is %f", check_msg->uart_b.rx_throughput); - ck_assert_msg(check_msg->uart_b.tx_buffer_level == 143, "incorrect value for uart_b.tx_buffer_level, expected 143, is %d", check_msg->uart_b.tx_buffer_level); - ck_assert_msg((check_msg->uart_b.tx_throughput*100 - 6441.20019531*100) < 0.05, "incorrect value for uart_b.tx_throughput, expected 6441.20019531, is %f", check_msg->uart_b.tx_throughput); - ck_assert_msg(check_msg->uart_ftdi.crc_error_count == 38359, "incorrect value for uart_ftdi.crc_error_count, expected 38359, is %d", check_msg->uart_ftdi.crc_error_count); - ck_assert_msg(check_msg->uart_ftdi.io_error_count == 6653, "incorrect value for uart_ftdi.io_error_count, expected 6653, is %d", check_msg->uart_ftdi.io_error_count); - ck_assert_msg(check_msg->uart_ftdi.rx_buffer_level == 24, "incorrect value for uart_ftdi.rx_buffer_level, expected 24, is %d", check_msg->uart_ftdi.rx_buffer_level); - ck_assert_msg((check_msg->uart_ftdi.rx_throughput*100 - 2173.19995117*100) < 0.05, "incorrect value for uart_ftdi.rx_throughput, expected 2173.19995117, is %f", check_msg->uart_ftdi.rx_throughput); - ck_assert_msg(check_msg->uart_ftdi.tx_buffer_level == 218, "incorrect value for uart_ftdi.tx_buffer_level, expected 218, is %d", check_msg->uart_ftdi.tx_buffer_level); - ck_assert_msg((check_msg->uart_ftdi.tx_throughput*100 - 5954.20019531*100) < 0.05, "incorrect value for uart_ftdi.tx_throughput, expected 5954.20019531, is %f", check_msg->uart_ftdi.tx_throughput); + ck_assert_msg(check_msg->latency.avg == 319865629, + "incorrect value for latency.avg, expected 319865629, is %d", + check_msg->latency.avg); + ck_assert_msg( + check_msg->latency.current == 364253831, + "incorrect value for latency.current, expected 364253831, is %d", + check_msg->latency.current); + ck_assert_msg( + check_msg->latency.lmax == -611749622, + "incorrect value for latency.lmax, expected -611749622, is %d", + check_msg->latency.lmax); + ck_assert_msg(check_msg->latency.lmin == 289902239, + "incorrect value for latency.lmin, expected 289902239, is %d", + check_msg->latency.lmin); + ck_assert_msg( + check_msg->obs_period.avg == -1002717658, + "incorrect value for obs_period.avg, expected -1002717658, is %d", + check_msg->obs_period.avg); + ck_assert_msg( + check_msg->obs_period.current == -2080697488, + "incorrect value for obs_period.current, expected -2080697488, is %d", + check_msg->obs_period.current); + ck_assert_msg( + check_msg->obs_period.pmax == -1628133123, + "incorrect value for obs_period.pmax, expected -1628133123, is %d", + check_msg->obs_period.pmax); + ck_assert_msg( + check_msg->obs_period.pmin == 1869323177, + "incorrect value for obs_period.pmin, expected 1869323177, is %d", + check_msg->obs_period.pmin); + ck_assert_msg( + check_msg->uart_a.crc_error_count == 25177, + "incorrect value for uart_a.crc_error_count, expected 25177, is %d", + check_msg->uart_a.crc_error_count); + ck_assert_msg( + check_msg->uart_a.io_error_count == 47183, + "incorrect value for uart_a.io_error_count, expected 47183, is %d", + check_msg->uart_a.io_error_count); + ck_assert_msg( + check_msg->uart_a.rx_buffer_level == 244, + "incorrect value for uart_a.rx_buffer_level, expected 244, is %d", + check_msg->uart_a.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_a.rx_throughput * 100 - 1853.19995117 * 100) < 0.05, + "incorrect value for uart_a.rx_throughput, expected 1853.19995117, is " + "%f", + check_msg->uart_a.rx_throughput); + ck_assert_msg( + check_msg->uart_a.tx_buffer_level == 138, + "incorrect value for uart_a.tx_buffer_level, expected 138, is %d", + check_msg->uart_a.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_a.tx_throughput * 100 - 7765.20019531 * 100) < 0.05, + "incorrect value for uart_a.tx_throughput, expected 7765.20019531, is " + "%f", + check_msg->uart_a.tx_throughput); + ck_assert_msg( + check_msg->uart_b.crc_error_count == 4297, + "incorrect value for uart_b.crc_error_count, expected 4297, is %d", + check_msg->uart_b.crc_error_count); + ck_assert_msg( + check_msg->uart_b.io_error_count == 63847, + "incorrect value for uart_b.io_error_count, expected 63847, is %d", + check_msg->uart_b.io_error_count); + ck_assert_msg( + check_msg->uart_b.rx_buffer_level == 161, + "incorrect value for uart_b.rx_buffer_level, expected 161, is %d", + check_msg->uart_b.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_b.rx_throughput * 100 - 6760.20019531 * 100) < 0.05, + "incorrect value for uart_b.rx_throughput, expected 6760.20019531, is " + "%f", + check_msg->uart_b.rx_throughput); + ck_assert_msg( + check_msg->uart_b.tx_buffer_level == 143, + "incorrect value for uart_b.tx_buffer_level, expected 143, is %d", + check_msg->uart_b.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_b.tx_throughput * 100 - 6441.20019531 * 100) < 0.05, + "incorrect value for uart_b.tx_throughput, expected 6441.20019531, is " + "%f", + check_msg->uart_b.tx_throughput); + ck_assert_msg( + check_msg->uart_ftdi.crc_error_count == 38359, + "incorrect value for uart_ftdi.crc_error_count, expected 38359, is %d", + check_msg->uart_ftdi.crc_error_count); + ck_assert_msg( + check_msg->uart_ftdi.io_error_count == 6653, + "incorrect value for uart_ftdi.io_error_count, expected 6653, is %d", + check_msg->uart_ftdi.io_error_count); + ck_assert_msg( + check_msg->uart_ftdi.rx_buffer_level == 24, + "incorrect value for uart_ftdi.rx_buffer_level, expected 24, is %d", + check_msg->uart_ftdi.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_ftdi.rx_throughput * 100 - 2173.19995117 * 100) < 0.05, + "incorrect value for uart_ftdi.rx_throughput, expected 2173.19995117, " + "is %f", + check_msg->uart_ftdi.rx_throughput); + ck_assert_msg( + check_msg->uart_ftdi.tx_buffer_level == 218, + "incorrect value for uart_ftdi.tx_buffer_level, expected 218, is %d", + check_msg->uart_ftdi.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_ftdi.tx_throughput * 100 - 5954.20019531 * 100) < 0.05, + "incorrect value for uart_ftdi.tx_throughput, expected 5954.20019531, " + "is %f", + check_msg->uart_ftdi.tx_throughput); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgUartState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgUartState"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgUartState"); +Suite *legacy_auto_check_sbp_piksi_MsgUartState_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgUartState"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgUartState"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgUartState); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_piksi_MsgUartStateDepA.c b/c/test/legacy/auto_check_sbp_piksi_MsgUartStateDepA.c index 1feae652d..64a75b29a 100644 --- a/c/test/legacy/auto_check_sbp_piksi_MsgUartStateDepA.c +++ b/c/test/legacy/auto_check_sbp_piksi_MsgUartStateDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartStateDepA.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartStateDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_piksi_MsgUartStateDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartStateDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,25 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartStateDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x18, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x18, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x18, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x18, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,154,153,57,65,0,0,0,0,0,0,0,0,15,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,247,5, }; + u8 encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 154, 153, 57, 65, 0, 0, 0, 0, + 0, 0, 0, 0, 15, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 247, 5, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_uart_state_depa_t* test_msg = ( msg_uart_state_depa_t* )test_msg_storage; + msg_uart_state_depa_t* test_msg = (msg_uart_state_depa_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->latency.avg = -1; test_msg->latency.current = -1; @@ -165,81 +170,152 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartStateDepA ) test_msg->uart_ftdi.rx_throughput = 0.0; test_msg->uart_ftdi.tx_buffer_level = 15; test_msg->uart_ftdi.tx_throughput = 11.600000381469727; - sbp_payload_send(&sbp_state, 0x18, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x18, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x18, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_uart_state_depa_t* check_msg = ( msg_uart_state_depa_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_uart_state_depa_t* check_msg = + (msg_uart_state_depa_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->latency.avg == -1, "incorrect value for latency.avg, expected -1, is %d", check_msg->latency.avg); - ck_assert_msg(check_msg->latency.current == -1, "incorrect value for latency.current, expected -1, is %d", check_msg->latency.current); - ck_assert_msg(check_msg->latency.lmax == 0, "incorrect value for latency.lmax, expected 0, is %d", check_msg->latency.lmax); - ck_assert_msg(check_msg->latency.lmin == 0, "incorrect value for latency.lmin, expected 0, is %d", check_msg->latency.lmin); - ck_assert_msg(check_msg->uart_a.crc_error_count == 0, "incorrect value for uart_a.crc_error_count, expected 0, is %d", check_msg->uart_a.crc_error_count); - ck_assert_msg(check_msg->uart_a.io_error_count == 0, "incorrect value for uart_a.io_error_count, expected 0, is %d", check_msg->uart_a.io_error_count); - ck_assert_msg(check_msg->uart_a.rx_buffer_level == 0, "incorrect value for uart_a.rx_buffer_level, expected 0, is %d", check_msg->uart_a.rx_buffer_level); - ck_assert_msg((check_msg->uart_a.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_a.rx_throughput, expected 0.0, is %f", check_msg->uart_a.rx_throughput); - ck_assert_msg(check_msg->uart_a.tx_buffer_level == 0, "incorrect value for uart_a.tx_buffer_level, expected 0, is %d", check_msg->uart_a.tx_buffer_level); - ck_assert_msg((check_msg->uart_a.tx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_a.tx_throughput, expected 0.0, is %f", check_msg->uart_a.tx_throughput); - ck_assert_msg(check_msg->uart_b.crc_error_count == 0, "incorrect value for uart_b.crc_error_count, expected 0, is %d", check_msg->uart_b.crc_error_count); - ck_assert_msg(check_msg->uart_b.io_error_count == 0, "incorrect value for uart_b.io_error_count, expected 0, is %d", check_msg->uart_b.io_error_count); - ck_assert_msg(check_msg->uart_b.rx_buffer_level == 0, "incorrect value for uart_b.rx_buffer_level, expected 0, is %d", check_msg->uart_b.rx_buffer_level); - ck_assert_msg((check_msg->uart_b.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_b.rx_throughput, expected 0.0, is %f", check_msg->uart_b.rx_throughput); - ck_assert_msg(check_msg->uart_b.tx_buffer_level == 0, "incorrect value for uart_b.tx_buffer_level, expected 0, is %d", check_msg->uart_b.tx_buffer_level); - ck_assert_msg((check_msg->uart_b.tx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_b.tx_throughput, expected 0.0, is %f", check_msg->uart_b.tx_throughput); - ck_assert_msg(check_msg->uart_ftdi.crc_error_count == 0, "incorrect value for uart_ftdi.crc_error_count, expected 0, is %d", check_msg->uart_ftdi.crc_error_count); - ck_assert_msg(check_msg->uart_ftdi.io_error_count == 0, "incorrect value for uart_ftdi.io_error_count, expected 0, is %d", check_msg->uart_ftdi.io_error_count); - ck_assert_msg(check_msg->uart_ftdi.rx_buffer_level == 0, "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is %d", check_msg->uart_ftdi.rx_buffer_level); - ck_assert_msg((check_msg->uart_ftdi.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is %f", check_msg->uart_ftdi.rx_throughput); - ck_assert_msg(check_msg->uart_ftdi.tx_buffer_level == 15, "incorrect value for uart_ftdi.tx_buffer_level, expected 15, is %d", check_msg->uart_ftdi.tx_buffer_level); - ck_assert_msg((check_msg->uart_ftdi.tx_throughput*100 - 11.6000003815*100) < 0.05, "incorrect value for uart_ftdi.tx_throughput, expected 11.6000003815, is %f", check_msg->uart_ftdi.tx_throughput); + ck_assert_msg(check_msg->latency.avg == -1, + "incorrect value for latency.avg, expected -1, is %d", + check_msg->latency.avg); + ck_assert_msg(check_msg->latency.current == -1, + "incorrect value for latency.current, expected -1, is %d", + check_msg->latency.current); + ck_assert_msg(check_msg->latency.lmax == 0, + "incorrect value for latency.lmax, expected 0, is %d", + check_msg->latency.lmax); + ck_assert_msg(check_msg->latency.lmin == 0, + "incorrect value for latency.lmin, expected 0, is %d", + check_msg->latency.lmin); + ck_assert_msg( + check_msg->uart_a.crc_error_count == 0, + "incorrect value for uart_a.crc_error_count, expected 0, is %d", + check_msg->uart_a.crc_error_count); + ck_assert_msg( + check_msg->uart_a.io_error_count == 0, + "incorrect value for uart_a.io_error_count, expected 0, is %d", + check_msg->uart_a.io_error_count); + ck_assert_msg( + check_msg->uart_a.rx_buffer_level == 0, + "incorrect value for uart_a.rx_buffer_level, expected 0, is %d", + check_msg->uart_a.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_a.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_a.rx_throughput, expected 0.0, is %f", + check_msg->uart_a.rx_throughput); + ck_assert_msg( + check_msg->uart_a.tx_buffer_level == 0, + "incorrect value for uart_a.tx_buffer_level, expected 0, is %d", + check_msg->uart_a.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_a.tx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_a.tx_throughput, expected 0.0, is %f", + check_msg->uart_a.tx_throughput); + ck_assert_msg( + check_msg->uart_b.crc_error_count == 0, + "incorrect value for uart_b.crc_error_count, expected 0, is %d", + check_msg->uart_b.crc_error_count); + ck_assert_msg( + check_msg->uart_b.io_error_count == 0, + "incorrect value for uart_b.io_error_count, expected 0, is %d", + check_msg->uart_b.io_error_count); + ck_assert_msg( + check_msg->uart_b.rx_buffer_level == 0, + "incorrect value for uart_b.rx_buffer_level, expected 0, is %d", + check_msg->uart_b.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_b.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_b.rx_throughput, expected 0.0, is %f", + check_msg->uart_b.rx_throughput); + ck_assert_msg( + check_msg->uart_b.tx_buffer_level == 0, + "incorrect value for uart_b.tx_buffer_level, expected 0, is %d", + check_msg->uart_b.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_b.tx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_b.tx_throughput, expected 0.0, is %f", + check_msg->uart_b.tx_throughput); + ck_assert_msg( + check_msg->uart_ftdi.crc_error_count == 0, + "incorrect value for uart_ftdi.crc_error_count, expected 0, is %d", + check_msg->uart_ftdi.crc_error_count); + ck_assert_msg( + check_msg->uart_ftdi.io_error_count == 0, + "incorrect value for uart_ftdi.io_error_count, expected 0, is %d", + check_msg->uart_ftdi.io_error_count); + ck_assert_msg( + check_msg->uart_ftdi.rx_buffer_level == 0, + "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is %d", + check_msg->uart_ftdi.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_ftdi.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is %f", + check_msg->uart_ftdi.rx_throughput); + ck_assert_msg( + check_msg->uart_ftdi.tx_buffer_level == 15, + "incorrect value for uart_ftdi.tx_buffer_level, expected 15, is %d", + check_msg->uart_ftdi.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_ftdi.tx_throughput * 100 - 11.6000003815 * 100) < 0.05, + "incorrect value for uart_ftdi.tx_throughput, expected 11.6000003815, " + "is %f", + check_msg->uart_ftdi.tx_throughput); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -247,17 +323,25 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartStateDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x18, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x18, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x18, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x18, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,43,135,61,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,65,110, }; + u8 encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 2, 43, 135, 61, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 65, 110, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_uart_state_depa_t* test_msg = ( msg_uart_state_depa_t* )test_msg_storage; + msg_uart_state_depa_t* test_msg = (msg_uart_state_depa_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->latency.avg = -1; test_msg->latency.current = -1; @@ -281,81 +365,152 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartStateDepA ) test_msg->uart_ftdi.rx_throughput = 0.0; test_msg->uart_ftdi.tx_buffer_level = 0; test_msg->uart_ftdi.tx_throughput = 0.06599999964237213; - sbp_payload_send(&sbp_state, 0x18, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x18, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x18, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_uart_state_depa_t* check_msg = ( msg_uart_state_depa_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_uart_state_depa_t* check_msg = + (msg_uart_state_depa_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->latency.avg == -1, "incorrect value for latency.avg, expected -1, is %d", check_msg->latency.avg); - ck_assert_msg(check_msg->latency.current == -1, "incorrect value for latency.current, expected -1, is %d", check_msg->latency.current); - ck_assert_msg(check_msg->latency.lmax == 0, "incorrect value for latency.lmax, expected 0, is %d", check_msg->latency.lmax); - ck_assert_msg(check_msg->latency.lmin == 0, "incorrect value for latency.lmin, expected 0, is %d", check_msg->latency.lmin); - ck_assert_msg(check_msg->uart_a.crc_error_count == 0, "incorrect value for uart_a.crc_error_count, expected 0, is %d", check_msg->uart_a.crc_error_count); - ck_assert_msg(check_msg->uart_a.io_error_count == 0, "incorrect value for uart_a.io_error_count, expected 0, is %d", check_msg->uart_a.io_error_count); - ck_assert_msg(check_msg->uart_a.rx_buffer_level == 0, "incorrect value for uart_a.rx_buffer_level, expected 0, is %d", check_msg->uart_a.rx_buffer_level); - ck_assert_msg((check_msg->uart_a.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_a.rx_throughput, expected 0.0, is %f", check_msg->uart_a.rx_throughput); - ck_assert_msg(check_msg->uart_a.tx_buffer_level == 0, "incorrect value for uart_a.tx_buffer_level, expected 0, is %d", check_msg->uart_a.tx_buffer_level); - ck_assert_msg((check_msg->uart_a.tx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_a.tx_throughput, expected 0.0, is %f", check_msg->uart_a.tx_throughput); - ck_assert_msg(check_msg->uart_b.crc_error_count == 0, "incorrect value for uart_b.crc_error_count, expected 0, is %d", check_msg->uart_b.crc_error_count); - ck_assert_msg(check_msg->uart_b.io_error_count == 0, "incorrect value for uart_b.io_error_count, expected 0, is %d", check_msg->uart_b.io_error_count); - ck_assert_msg(check_msg->uart_b.rx_buffer_level == 0, "incorrect value for uart_b.rx_buffer_level, expected 0, is %d", check_msg->uart_b.rx_buffer_level); - ck_assert_msg((check_msg->uart_b.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_b.rx_throughput, expected 0.0, is %f", check_msg->uart_b.rx_throughput); - ck_assert_msg(check_msg->uart_b.tx_buffer_level == 0, "incorrect value for uart_b.tx_buffer_level, expected 0, is %d", check_msg->uart_b.tx_buffer_level); - ck_assert_msg((check_msg->uart_b.tx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_b.tx_throughput, expected 0.0, is %f", check_msg->uart_b.tx_throughput); - ck_assert_msg(check_msg->uart_ftdi.crc_error_count == 0, "incorrect value for uart_ftdi.crc_error_count, expected 0, is %d", check_msg->uart_ftdi.crc_error_count); - ck_assert_msg(check_msg->uart_ftdi.io_error_count == 0, "incorrect value for uart_ftdi.io_error_count, expected 0, is %d", check_msg->uart_ftdi.io_error_count); - ck_assert_msg(check_msg->uart_ftdi.rx_buffer_level == 0, "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is %d", check_msg->uart_ftdi.rx_buffer_level); - ck_assert_msg((check_msg->uart_ftdi.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is %f", check_msg->uart_ftdi.rx_throughput); - ck_assert_msg(check_msg->uart_ftdi.tx_buffer_level == 0, "incorrect value for uart_ftdi.tx_buffer_level, expected 0, is %d", check_msg->uart_ftdi.tx_buffer_level); - ck_assert_msg((check_msg->uart_ftdi.tx_throughput*100 - 0.0659999996424*100) < 0.05, "incorrect value for uart_ftdi.tx_throughput, expected 0.0659999996424, is %f", check_msg->uart_ftdi.tx_throughput); + ck_assert_msg(check_msg->latency.avg == -1, + "incorrect value for latency.avg, expected -1, is %d", + check_msg->latency.avg); + ck_assert_msg(check_msg->latency.current == -1, + "incorrect value for latency.current, expected -1, is %d", + check_msg->latency.current); + ck_assert_msg(check_msg->latency.lmax == 0, + "incorrect value for latency.lmax, expected 0, is %d", + check_msg->latency.lmax); + ck_assert_msg(check_msg->latency.lmin == 0, + "incorrect value for latency.lmin, expected 0, is %d", + check_msg->latency.lmin); + ck_assert_msg( + check_msg->uart_a.crc_error_count == 0, + "incorrect value for uart_a.crc_error_count, expected 0, is %d", + check_msg->uart_a.crc_error_count); + ck_assert_msg( + check_msg->uart_a.io_error_count == 0, + "incorrect value for uart_a.io_error_count, expected 0, is %d", + check_msg->uart_a.io_error_count); + ck_assert_msg( + check_msg->uart_a.rx_buffer_level == 0, + "incorrect value for uart_a.rx_buffer_level, expected 0, is %d", + check_msg->uart_a.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_a.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_a.rx_throughput, expected 0.0, is %f", + check_msg->uart_a.rx_throughput); + ck_assert_msg( + check_msg->uart_a.tx_buffer_level == 0, + "incorrect value for uart_a.tx_buffer_level, expected 0, is %d", + check_msg->uart_a.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_a.tx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_a.tx_throughput, expected 0.0, is %f", + check_msg->uart_a.tx_throughput); + ck_assert_msg( + check_msg->uart_b.crc_error_count == 0, + "incorrect value for uart_b.crc_error_count, expected 0, is %d", + check_msg->uart_b.crc_error_count); + ck_assert_msg( + check_msg->uart_b.io_error_count == 0, + "incorrect value for uart_b.io_error_count, expected 0, is %d", + check_msg->uart_b.io_error_count); + ck_assert_msg( + check_msg->uart_b.rx_buffer_level == 0, + "incorrect value for uart_b.rx_buffer_level, expected 0, is %d", + check_msg->uart_b.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_b.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_b.rx_throughput, expected 0.0, is %f", + check_msg->uart_b.rx_throughput); + ck_assert_msg( + check_msg->uart_b.tx_buffer_level == 0, + "incorrect value for uart_b.tx_buffer_level, expected 0, is %d", + check_msg->uart_b.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_b.tx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_b.tx_throughput, expected 0.0, is %f", + check_msg->uart_b.tx_throughput); + ck_assert_msg( + check_msg->uart_ftdi.crc_error_count == 0, + "incorrect value for uart_ftdi.crc_error_count, expected 0, is %d", + check_msg->uart_ftdi.crc_error_count); + ck_assert_msg( + check_msg->uart_ftdi.io_error_count == 0, + "incorrect value for uart_ftdi.io_error_count, expected 0, is %d", + check_msg->uart_ftdi.io_error_count); + ck_assert_msg( + check_msg->uart_ftdi.rx_buffer_level == 0, + "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is %d", + check_msg->uart_ftdi.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_ftdi.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is %f", + check_msg->uart_ftdi.rx_throughput); + ck_assert_msg( + check_msg->uart_ftdi.tx_buffer_level == 0, + "incorrect value for uart_ftdi.tx_buffer_level, expected 0, is %d", + check_msg->uart_ftdi.tx_buffer_level); + ck_assert_msg((check_msg->uart_ftdi.tx_throughput * 100 - + 0.0659999996424 * 100) < 0.05, + "incorrect value for uart_ftdi.tx_throughput, expected " + "0.0659999996424, is %f", + check_msg->uart_ftdi.tx_throughput); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -363,17 +518,25 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartStateDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x18, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x18, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x18, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x18, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,86,14,62,0,0,0,0,0,0,0,0,10,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,198,36, }; + u8 encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 4, 86, 14, 62, 0, 0, 0, 0, + 0, 0, 0, 0, 10, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 198, 36, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_uart_state_depa_t* test_msg = ( msg_uart_state_depa_t* )test_msg_storage; + msg_uart_state_depa_t* test_msg = (msg_uart_state_depa_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->latency.avg = -1; test_msg->latency.current = -1; @@ -397,81 +560,152 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartStateDepA ) test_msg->uart_ftdi.rx_throughput = 0.0; test_msg->uart_ftdi.tx_buffer_level = 10; test_msg->uart_ftdi.tx_throughput = 0.13899999856948853; - sbp_payload_send(&sbp_state, 0x18, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x18, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x18, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_uart_state_depa_t* check_msg = ( msg_uart_state_depa_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_uart_state_depa_t* check_msg = + (msg_uart_state_depa_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->latency.avg == -1, "incorrect value for latency.avg, expected -1, is %d", check_msg->latency.avg); - ck_assert_msg(check_msg->latency.current == -1, "incorrect value for latency.current, expected -1, is %d", check_msg->latency.current); - ck_assert_msg(check_msg->latency.lmax == 0, "incorrect value for latency.lmax, expected 0, is %d", check_msg->latency.lmax); - ck_assert_msg(check_msg->latency.lmin == 0, "incorrect value for latency.lmin, expected 0, is %d", check_msg->latency.lmin); - ck_assert_msg(check_msg->uart_a.crc_error_count == 0, "incorrect value for uart_a.crc_error_count, expected 0, is %d", check_msg->uart_a.crc_error_count); - ck_assert_msg(check_msg->uart_a.io_error_count == 0, "incorrect value for uart_a.io_error_count, expected 0, is %d", check_msg->uart_a.io_error_count); - ck_assert_msg(check_msg->uart_a.rx_buffer_level == 0, "incorrect value for uart_a.rx_buffer_level, expected 0, is %d", check_msg->uart_a.rx_buffer_level); - ck_assert_msg((check_msg->uart_a.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_a.rx_throughput, expected 0.0, is %f", check_msg->uart_a.rx_throughput); - ck_assert_msg(check_msg->uart_a.tx_buffer_level == 0, "incorrect value for uart_a.tx_buffer_level, expected 0, is %d", check_msg->uart_a.tx_buffer_level); - ck_assert_msg((check_msg->uart_a.tx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_a.tx_throughput, expected 0.0, is %f", check_msg->uart_a.tx_throughput); - ck_assert_msg(check_msg->uart_b.crc_error_count == 0, "incorrect value for uart_b.crc_error_count, expected 0, is %d", check_msg->uart_b.crc_error_count); - ck_assert_msg(check_msg->uart_b.io_error_count == 0, "incorrect value for uart_b.io_error_count, expected 0, is %d", check_msg->uart_b.io_error_count); - ck_assert_msg(check_msg->uart_b.rx_buffer_level == 0, "incorrect value for uart_b.rx_buffer_level, expected 0, is %d", check_msg->uart_b.rx_buffer_level); - ck_assert_msg((check_msg->uart_b.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_b.rx_throughput, expected 0.0, is %f", check_msg->uart_b.rx_throughput); - ck_assert_msg(check_msg->uart_b.tx_buffer_level == 0, "incorrect value for uart_b.tx_buffer_level, expected 0, is %d", check_msg->uart_b.tx_buffer_level); - ck_assert_msg((check_msg->uart_b.tx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_b.tx_throughput, expected 0.0, is %f", check_msg->uart_b.tx_throughput); - ck_assert_msg(check_msg->uart_ftdi.crc_error_count == 0, "incorrect value for uart_ftdi.crc_error_count, expected 0, is %d", check_msg->uart_ftdi.crc_error_count); - ck_assert_msg(check_msg->uart_ftdi.io_error_count == 0, "incorrect value for uart_ftdi.io_error_count, expected 0, is %d", check_msg->uart_ftdi.io_error_count); - ck_assert_msg(check_msg->uart_ftdi.rx_buffer_level == 0, "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is %d", check_msg->uart_ftdi.rx_buffer_level); - ck_assert_msg((check_msg->uart_ftdi.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is %f", check_msg->uart_ftdi.rx_throughput); - ck_assert_msg(check_msg->uart_ftdi.tx_buffer_level == 10, "incorrect value for uart_ftdi.tx_buffer_level, expected 10, is %d", check_msg->uart_ftdi.tx_buffer_level); - ck_assert_msg((check_msg->uart_ftdi.tx_throughput*100 - 0.138999998569*100) < 0.05, "incorrect value for uart_ftdi.tx_throughput, expected 0.138999998569, is %f", check_msg->uart_ftdi.tx_throughput); + ck_assert_msg(check_msg->latency.avg == -1, + "incorrect value for latency.avg, expected -1, is %d", + check_msg->latency.avg); + ck_assert_msg(check_msg->latency.current == -1, + "incorrect value for latency.current, expected -1, is %d", + check_msg->latency.current); + ck_assert_msg(check_msg->latency.lmax == 0, + "incorrect value for latency.lmax, expected 0, is %d", + check_msg->latency.lmax); + ck_assert_msg(check_msg->latency.lmin == 0, + "incorrect value for latency.lmin, expected 0, is %d", + check_msg->latency.lmin); + ck_assert_msg( + check_msg->uart_a.crc_error_count == 0, + "incorrect value for uart_a.crc_error_count, expected 0, is %d", + check_msg->uart_a.crc_error_count); + ck_assert_msg( + check_msg->uart_a.io_error_count == 0, + "incorrect value for uart_a.io_error_count, expected 0, is %d", + check_msg->uart_a.io_error_count); + ck_assert_msg( + check_msg->uart_a.rx_buffer_level == 0, + "incorrect value for uart_a.rx_buffer_level, expected 0, is %d", + check_msg->uart_a.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_a.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_a.rx_throughput, expected 0.0, is %f", + check_msg->uart_a.rx_throughput); + ck_assert_msg( + check_msg->uart_a.tx_buffer_level == 0, + "incorrect value for uart_a.tx_buffer_level, expected 0, is %d", + check_msg->uart_a.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_a.tx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_a.tx_throughput, expected 0.0, is %f", + check_msg->uart_a.tx_throughput); + ck_assert_msg( + check_msg->uart_b.crc_error_count == 0, + "incorrect value for uart_b.crc_error_count, expected 0, is %d", + check_msg->uart_b.crc_error_count); + ck_assert_msg( + check_msg->uart_b.io_error_count == 0, + "incorrect value for uart_b.io_error_count, expected 0, is %d", + check_msg->uart_b.io_error_count); + ck_assert_msg( + check_msg->uart_b.rx_buffer_level == 0, + "incorrect value for uart_b.rx_buffer_level, expected 0, is %d", + check_msg->uart_b.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_b.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_b.rx_throughput, expected 0.0, is %f", + check_msg->uart_b.rx_throughput); + ck_assert_msg( + check_msg->uart_b.tx_buffer_level == 0, + "incorrect value for uart_b.tx_buffer_level, expected 0, is %d", + check_msg->uart_b.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_b.tx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_b.tx_throughput, expected 0.0, is %f", + check_msg->uart_b.tx_throughput); + ck_assert_msg( + check_msg->uart_ftdi.crc_error_count == 0, + "incorrect value for uart_ftdi.crc_error_count, expected 0, is %d", + check_msg->uart_ftdi.crc_error_count); + ck_assert_msg( + check_msg->uart_ftdi.io_error_count == 0, + "incorrect value for uart_ftdi.io_error_count, expected 0, is %d", + check_msg->uart_ftdi.io_error_count); + ck_assert_msg( + check_msg->uart_ftdi.rx_buffer_level == 0, + "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is %d", + check_msg->uart_ftdi.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_ftdi.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is %f", + check_msg->uart_ftdi.rx_throughput); + ck_assert_msg( + check_msg->uart_ftdi.tx_buffer_level == 10, + "incorrect value for uart_ftdi.tx_buffer_level, expected 10, is %d", + check_msg->uart_ftdi.tx_buffer_level); + ck_assert_msg((check_msg->uart_ftdi.tx_throughput * 100 - + 0.138999998569 * 100) < 0.05, + "incorrect value for uart_ftdi.tx_throughput, expected " + "0.138999998569, is %f", + check_msg->uart_ftdi.tx_throughput); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -479,17 +713,25 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartStateDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x18, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x18, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x18, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x18, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,43,135,61,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,65,110, }; + u8 encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 2, 43, 135, 61, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 65, 110, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_uart_state_depa_t* test_msg = ( msg_uart_state_depa_t* )test_msg_storage; + msg_uart_state_depa_t* test_msg = (msg_uart_state_depa_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->latency.avg = -1; test_msg->latency.current = -1; @@ -513,81 +755,152 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartStateDepA ) test_msg->uart_ftdi.rx_throughput = 0.0; test_msg->uart_ftdi.tx_buffer_level = 0; test_msg->uart_ftdi.tx_throughput = 0.06599999964237213; - sbp_payload_send(&sbp_state, 0x18, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x18, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x18, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_uart_state_depa_t* check_msg = ( msg_uart_state_depa_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_uart_state_depa_t* check_msg = + (msg_uart_state_depa_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->latency.avg == -1, "incorrect value for latency.avg, expected -1, is %d", check_msg->latency.avg); - ck_assert_msg(check_msg->latency.current == -1, "incorrect value for latency.current, expected -1, is %d", check_msg->latency.current); - ck_assert_msg(check_msg->latency.lmax == 0, "incorrect value for latency.lmax, expected 0, is %d", check_msg->latency.lmax); - ck_assert_msg(check_msg->latency.lmin == 0, "incorrect value for latency.lmin, expected 0, is %d", check_msg->latency.lmin); - ck_assert_msg(check_msg->uart_a.crc_error_count == 0, "incorrect value for uart_a.crc_error_count, expected 0, is %d", check_msg->uart_a.crc_error_count); - ck_assert_msg(check_msg->uart_a.io_error_count == 0, "incorrect value for uart_a.io_error_count, expected 0, is %d", check_msg->uart_a.io_error_count); - ck_assert_msg(check_msg->uart_a.rx_buffer_level == 0, "incorrect value for uart_a.rx_buffer_level, expected 0, is %d", check_msg->uart_a.rx_buffer_level); - ck_assert_msg((check_msg->uart_a.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_a.rx_throughput, expected 0.0, is %f", check_msg->uart_a.rx_throughput); - ck_assert_msg(check_msg->uart_a.tx_buffer_level == 0, "incorrect value for uart_a.tx_buffer_level, expected 0, is %d", check_msg->uart_a.tx_buffer_level); - ck_assert_msg((check_msg->uart_a.tx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_a.tx_throughput, expected 0.0, is %f", check_msg->uart_a.tx_throughput); - ck_assert_msg(check_msg->uart_b.crc_error_count == 0, "incorrect value for uart_b.crc_error_count, expected 0, is %d", check_msg->uart_b.crc_error_count); - ck_assert_msg(check_msg->uart_b.io_error_count == 0, "incorrect value for uart_b.io_error_count, expected 0, is %d", check_msg->uart_b.io_error_count); - ck_assert_msg(check_msg->uart_b.rx_buffer_level == 0, "incorrect value for uart_b.rx_buffer_level, expected 0, is %d", check_msg->uart_b.rx_buffer_level); - ck_assert_msg((check_msg->uart_b.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_b.rx_throughput, expected 0.0, is %f", check_msg->uart_b.rx_throughput); - ck_assert_msg(check_msg->uart_b.tx_buffer_level == 0, "incorrect value for uart_b.tx_buffer_level, expected 0, is %d", check_msg->uart_b.tx_buffer_level); - ck_assert_msg((check_msg->uart_b.tx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_b.tx_throughput, expected 0.0, is %f", check_msg->uart_b.tx_throughput); - ck_assert_msg(check_msg->uart_ftdi.crc_error_count == 0, "incorrect value for uart_ftdi.crc_error_count, expected 0, is %d", check_msg->uart_ftdi.crc_error_count); - ck_assert_msg(check_msg->uart_ftdi.io_error_count == 0, "incorrect value for uart_ftdi.io_error_count, expected 0, is %d", check_msg->uart_ftdi.io_error_count); - ck_assert_msg(check_msg->uart_ftdi.rx_buffer_level == 0, "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is %d", check_msg->uart_ftdi.rx_buffer_level); - ck_assert_msg((check_msg->uart_ftdi.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is %f", check_msg->uart_ftdi.rx_throughput); - ck_assert_msg(check_msg->uart_ftdi.tx_buffer_level == 0, "incorrect value for uart_ftdi.tx_buffer_level, expected 0, is %d", check_msg->uart_ftdi.tx_buffer_level); - ck_assert_msg((check_msg->uart_ftdi.tx_throughput*100 - 0.0659999996424*100) < 0.05, "incorrect value for uart_ftdi.tx_throughput, expected 0.0659999996424, is %f", check_msg->uart_ftdi.tx_throughput); + ck_assert_msg(check_msg->latency.avg == -1, + "incorrect value for latency.avg, expected -1, is %d", + check_msg->latency.avg); + ck_assert_msg(check_msg->latency.current == -1, + "incorrect value for latency.current, expected -1, is %d", + check_msg->latency.current); + ck_assert_msg(check_msg->latency.lmax == 0, + "incorrect value for latency.lmax, expected 0, is %d", + check_msg->latency.lmax); + ck_assert_msg(check_msg->latency.lmin == 0, + "incorrect value for latency.lmin, expected 0, is %d", + check_msg->latency.lmin); + ck_assert_msg( + check_msg->uart_a.crc_error_count == 0, + "incorrect value for uart_a.crc_error_count, expected 0, is %d", + check_msg->uart_a.crc_error_count); + ck_assert_msg( + check_msg->uart_a.io_error_count == 0, + "incorrect value for uart_a.io_error_count, expected 0, is %d", + check_msg->uart_a.io_error_count); + ck_assert_msg( + check_msg->uart_a.rx_buffer_level == 0, + "incorrect value for uart_a.rx_buffer_level, expected 0, is %d", + check_msg->uart_a.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_a.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_a.rx_throughput, expected 0.0, is %f", + check_msg->uart_a.rx_throughput); + ck_assert_msg( + check_msg->uart_a.tx_buffer_level == 0, + "incorrect value for uart_a.tx_buffer_level, expected 0, is %d", + check_msg->uart_a.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_a.tx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_a.tx_throughput, expected 0.0, is %f", + check_msg->uart_a.tx_throughput); + ck_assert_msg( + check_msg->uart_b.crc_error_count == 0, + "incorrect value for uart_b.crc_error_count, expected 0, is %d", + check_msg->uart_b.crc_error_count); + ck_assert_msg( + check_msg->uart_b.io_error_count == 0, + "incorrect value for uart_b.io_error_count, expected 0, is %d", + check_msg->uart_b.io_error_count); + ck_assert_msg( + check_msg->uart_b.rx_buffer_level == 0, + "incorrect value for uart_b.rx_buffer_level, expected 0, is %d", + check_msg->uart_b.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_b.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_b.rx_throughput, expected 0.0, is %f", + check_msg->uart_b.rx_throughput); + ck_assert_msg( + check_msg->uart_b.tx_buffer_level == 0, + "incorrect value for uart_b.tx_buffer_level, expected 0, is %d", + check_msg->uart_b.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_b.tx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_b.tx_throughput, expected 0.0, is %f", + check_msg->uart_b.tx_throughput); + ck_assert_msg( + check_msg->uart_ftdi.crc_error_count == 0, + "incorrect value for uart_ftdi.crc_error_count, expected 0, is %d", + check_msg->uart_ftdi.crc_error_count); + ck_assert_msg( + check_msg->uart_ftdi.io_error_count == 0, + "incorrect value for uart_ftdi.io_error_count, expected 0, is %d", + check_msg->uart_ftdi.io_error_count); + ck_assert_msg( + check_msg->uart_ftdi.rx_buffer_level == 0, + "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is %d", + check_msg->uart_ftdi.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_ftdi.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is %f", + check_msg->uart_ftdi.rx_throughput); + ck_assert_msg( + check_msg->uart_ftdi.tx_buffer_level == 0, + "incorrect value for uart_ftdi.tx_buffer_level, expected 0, is %d", + check_msg->uart_ftdi.tx_buffer_level); + ck_assert_msg((check_msg->uart_ftdi.tx_throughput * 100 - + 0.0659999996424 * 100) < 0.05, + "incorrect value for uart_ftdi.tx_throughput, expected " + "0.0659999996424, is %f", + check_msg->uart_ftdi.tx_throughput); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -595,17 +908,25 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartStateDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x18, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x18, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x18, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x18, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,138,75,6,60,0,0,0,0,0,0,80,113,201,61,0,0,0,0,0,0,0,0,2,0,145,237,252,62,0,0,0,0,0,0,0,0,38,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,112,111, }; + u8 encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 138, 75, 6, 60, + 0, 0, 0, 0, 0, 0, 80, 113, 201, 61, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 145, 237, 252, 62, 0, 0, 0, 0, + 0, 0, 0, 0, 38, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 112, 111, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_uart_state_depa_t* test_msg = ( msg_uart_state_depa_t* )test_msg_storage; + msg_uart_state_depa_t* test_msg = (msg_uart_state_depa_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->latency.avg = -1; test_msg->latency.current = -1; @@ -629,81 +950,154 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartStateDepA ) test_msg->uart_ftdi.rx_throughput = 0.0; test_msg->uart_ftdi.tx_buffer_level = 38; test_msg->uart_ftdi.tx_throughput = 0.49399998784065247; - sbp_payload_send(&sbp_state, 0x18, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x18, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x18, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_uart_state_depa_t* check_msg = ( msg_uart_state_depa_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_uart_state_depa_t* check_msg = + (msg_uart_state_depa_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->latency.avg == -1, "incorrect value for latency.avg, expected -1, is %d", check_msg->latency.avg); - ck_assert_msg(check_msg->latency.current == -1, "incorrect value for latency.current, expected -1, is %d", check_msg->latency.current); - ck_assert_msg(check_msg->latency.lmax == 0, "incorrect value for latency.lmax, expected 0, is %d", check_msg->latency.lmax); - ck_assert_msg(check_msg->latency.lmin == 0, "incorrect value for latency.lmin, expected 0, is %d", check_msg->latency.lmin); - ck_assert_msg(check_msg->uart_a.crc_error_count == 0, "incorrect value for uart_a.crc_error_count, expected 0, is %d", check_msg->uart_a.crc_error_count); - ck_assert_msg(check_msg->uart_a.io_error_count == 0, "incorrect value for uart_a.io_error_count, expected 0, is %d", check_msg->uart_a.io_error_count); - ck_assert_msg(check_msg->uart_a.rx_buffer_level == 0, "incorrect value for uart_a.rx_buffer_level, expected 0, is %d", check_msg->uart_a.rx_buffer_level); - ck_assert_msg((check_msg->uart_a.rx_throughput*100 - 0.00819672085345*100) < 0.05, "incorrect value for uart_a.rx_throughput, expected 0.00819672085345, is %f", check_msg->uart_a.rx_throughput); - ck_assert_msg(check_msg->uart_a.tx_buffer_level == 0, "incorrect value for uart_a.tx_buffer_level, expected 0, is %d", check_msg->uart_a.tx_buffer_level); - ck_assert_msg((check_msg->uart_a.tx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_a.tx_throughput, expected 0.0, is %f", check_msg->uart_a.tx_throughput); - ck_assert_msg(check_msg->uart_b.crc_error_count == 0, "incorrect value for uart_b.crc_error_count, expected 0, is %d", check_msg->uart_b.crc_error_count); - ck_assert_msg(check_msg->uart_b.io_error_count == 0, "incorrect value for uart_b.io_error_count, expected 0, is %d", check_msg->uart_b.io_error_count); - ck_assert_msg(check_msg->uart_b.rx_buffer_level == 0, "incorrect value for uart_b.rx_buffer_level, expected 0, is %d", check_msg->uart_b.rx_buffer_level); - ck_assert_msg((check_msg->uart_b.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_b.rx_throughput, expected 0.0, is %f", check_msg->uart_b.rx_throughput); - ck_assert_msg(check_msg->uart_b.tx_buffer_level == 2, "incorrect value for uart_b.tx_buffer_level, expected 2, is %d", check_msg->uart_b.tx_buffer_level); - ck_assert_msg((check_msg->uart_b.tx_throughput*100 - 0.098360657692*100) < 0.05, "incorrect value for uart_b.tx_throughput, expected 0.098360657692, is %f", check_msg->uart_b.tx_throughput); - ck_assert_msg(check_msg->uart_ftdi.crc_error_count == 0, "incorrect value for uart_ftdi.crc_error_count, expected 0, is %d", check_msg->uart_ftdi.crc_error_count); - ck_assert_msg(check_msg->uart_ftdi.io_error_count == 0, "incorrect value for uart_ftdi.io_error_count, expected 0, is %d", check_msg->uart_ftdi.io_error_count); - ck_assert_msg(check_msg->uart_ftdi.rx_buffer_level == 0, "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is %d", check_msg->uart_ftdi.rx_buffer_level); - ck_assert_msg((check_msg->uart_ftdi.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is %f", check_msg->uart_ftdi.rx_throughput); - ck_assert_msg(check_msg->uart_ftdi.tx_buffer_level == 38, "incorrect value for uart_ftdi.tx_buffer_level, expected 38, is %d", check_msg->uart_ftdi.tx_buffer_level); - ck_assert_msg((check_msg->uart_ftdi.tx_throughput*100 - 0.493999987841*100) < 0.05, "incorrect value for uart_ftdi.tx_throughput, expected 0.493999987841, is %f", check_msg->uart_ftdi.tx_throughput); + ck_assert_msg(check_msg->latency.avg == -1, + "incorrect value for latency.avg, expected -1, is %d", + check_msg->latency.avg); + ck_assert_msg(check_msg->latency.current == -1, + "incorrect value for latency.current, expected -1, is %d", + check_msg->latency.current); + ck_assert_msg(check_msg->latency.lmax == 0, + "incorrect value for latency.lmax, expected 0, is %d", + check_msg->latency.lmax); + ck_assert_msg(check_msg->latency.lmin == 0, + "incorrect value for latency.lmin, expected 0, is %d", + check_msg->latency.lmin); + ck_assert_msg( + check_msg->uart_a.crc_error_count == 0, + "incorrect value for uart_a.crc_error_count, expected 0, is %d", + check_msg->uart_a.crc_error_count); + ck_assert_msg( + check_msg->uart_a.io_error_count == 0, + "incorrect value for uart_a.io_error_count, expected 0, is %d", + check_msg->uart_a.io_error_count); + ck_assert_msg( + check_msg->uart_a.rx_buffer_level == 0, + "incorrect value for uart_a.rx_buffer_level, expected 0, is %d", + check_msg->uart_a.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_a.rx_throughput * 100 - 0.00819672085345 * 100) < 0.05, + "incorrect value for uart_a.rx_throughput, expected 0.00819672085345, " + "is %f", + check_msg->uart_a.rx_throughput); + ck_assert_msg( + check_msg->uart_a.tx_buffer_level == 0, + "incorrect value for uart_a.tx_buffer_level, expected 0, is %d", + check_msg->uart_a.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_a.tx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_a.tx_throughput, expected 0.0, is %f", + check_msg->uart_a.tx_throughput); + ck_assert_msg( + check_msg->uart_b.crc_error_count == 0, + "incorrect value for uart_b.crc_error_count, expected 0, is %d", + check_msg->uart_b.crc_error_count); + ck_assert_msg( + check_msg->uart_b.io_error_count == 0, + "incorrect value for uart_b.io_error_count, expected 0, is %d", + check_msg->uart_b.io_error_count); + ck_assert_msg( + check_msg->uart_b.rx_buffer_level == 0, + "incorrect value for uart_b.rx_buffer_level, expected 0, is %d", + check_msg->uart_b.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_b.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_b.rx_throughput, expected 0.0, is %f", + check_msg->uart_b.rx_throughput); + ck_assert_msg( + check_msg->uart_b.tx_buffer_level == 2, + "incorrect value for uart_b.tx_buffer_level, expected 2, is %d", + check_msg->uart_b.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_b.tx_throughput * 100 - 0.098360657692 * 100) < 0.05, + "incorrect value for uart_b.tx_throughput, expected 0.098360657692, is " + "%f", + check_msg->uart_b.tx_throughput); + ck_assert_msg( + check_msg->uart_ftdi.crc_error_count == 0, + "incorrect value for uart_ftdi.crc_error_count, expected 0, is %d", + check_msg->uart_ftdi.crc_error_count); + ck_assert_msg( + check_msg->uart_ftdi.io_error_count == 0, + "incorrect value for uart_ftdi.io_error_count, expected 0, is %d", + check_msg->uart_ftdi.io_error_count); + ck_assert_msg( + check_msg->uart_ftdi.rx_buffer_level == 0, + "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is %d", + check_msg->uart_ftdi.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_ftdi.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is %f", + check_msg->uart_ftdi.rx_throughput); + ck_assert_msg( + check_msg->uart_ftdi.tx_buffer_level == 38, + "incorrect value for uart_ftdi.tx_buffer_level, expected 38, is %d", + check_msg->uart_ftdi.tx_buffer_level); + ck_assert_msg((check_msg->uart_ftdi.tx_throughput * 100 - + 0.493999987841 * 100) < 0.05, + "incorrect value for uart_ftdi.tx_throughput, expected " + "0.493999987841, is %f", + check_msg->uart_ftdi.tx_throughput); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -711,17 +1105,25 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartStateDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x18, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x18, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x18, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x18, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,24,0,195,4,58,166,155,68,60,0,0,0,0,0,0,0,0,2,0,166,155,68,60,0,0,0,0,0,0,0,0,2,0,236,81,168,63,0,0,0,0,0,0,0,0,50,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,22,72, }; + u8 encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 166, 155, 68, 60, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 166, 155, 68, 60, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 236, 81, 168, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 22, 72, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_uart_state_depa_t* test_msg = ( msg_uart_state_depa_t* )test_msg_storage; + msg_uart_state_depa_t* test_msg = (msg_uart_state_depa_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->latency.avg = -1; test_msg->latency.current = -1; @@ -745,84 +1147,157 @@ START_TEST( test_legacy_auto_check_sbp_piksi_MsgUartStateDepA ) test_msg->uart_ftdi.rx_throughput = 0.0; test_msg->uart_ftdi.tx_buffer_level = 50; test_msg->uart_ftdi.tx_throughput = 1.315000057220459; - sbp_payload_send(&sbp_state, 0x18, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x18, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x18, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_uart_state_depa_t* check_msg = ( msg_uart_state_depa_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_uart_state_depa_t* check_msg = + (msg_uart_state_depa_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->latency.avg == -1, "incorrect value for latency.avg, expected -1, is %d", check_msg->latency.avg); - ck_assert_msg(check_msg->latency.current == -1, "incorrect value for latency.current, expected -1, is %d", check_msg->latency.current); - ck_assert_msg(check_msg->latency.lmax == 0, "incorrect value for latency.lmax, expected 0, is %d", check_msg->latency.lmax); - ck_assert_msg(check_msg->latency.lmin == 0, "incorrect value for latency.lmin, expected 0, is %d", check_msg->latency.lmin); - ck_assert_msg(check_msg->uart_a.crc_error_count == 0, "incorrect value for uart_a.crc_error_count, expected 0, is %d", check_msg->uart_a.crc_error_count); - ck_assert_msg(check_msg->uart_a.io_error_count == 0, "incorrect value for uart_a.io_error_count, expected 0, is %d", check_msg->uart_a.io_error_count); - ck_assert_msg(check_msg->uart_a.rx_buffer_level == 0, "incorrect value for uart_a.rx_buffer_level, expected 0, is %d", check_msg->uart_a.rx_buffer_level); - ck_assert_msg((check_msg->uart_a.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_a.rx_throughput, expected 0.0, is %f", check_msg->uart_a.rx_throughput); - ck_assert_msg(check_msg->uart_a.tx_buffer_level == 2, "incorrect value for uart_a.tx_buffer_level, expected 2, is %d", check_msg->uart_a.tx_buffer_level); - ck_assert_msg((check_msg->uart_a.tx_throughput*100 - 0.0120000001043*100) < 0.05, "incorrect value for uart_a.tx_throughput, expected 0.0120000001043, is %f", check_msg->uart_a.tx_throughput); - ck_assert_msg(check_msg->uart_b.crc_error_count == 0, "incorrect value for uart_b.crc_error_count, expected 0, is %d", check_msg->uart_b.crc_error_count); - ck_assert_msg(check_msg->uart_b.io_error_count == 0, "incorrect value for uart_b.io_error_count, expected 0, is %d", check_msg->uart_b.io_error_count); - ck_assert_msg(check_msg->uart_b.rx_buffer_level == 0, "incorrect value for uart_b.rx_buffer_level, expected 0, is %d", check_msg->uart_b.rx_buffer_level); - ck_assert_msg((check_msg->uart_b.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_b.rx_throughput, expected 0.0, is %f", check_msg->uart_b.rx_throughput); - ck_assert_msg(check_msg->uart_b.tx_buffer_level == 2, "incorrect value for uart_b.tx_buffer_level, expected 2, is %d", check_msg->uart_b.tx_buffer_level); - ck_assert_msg((check_msg->uart_b.tx_throughput*100 - 0.0120000001043*100) < 0.05, "incorrect value for uart_b.tx_throughput, expected 0.0120000001043, is %f", check_msg->uart_b.tx_throughput); - ck_assert_msg(check_msg->uart_ftdi.crc_error_count == 0, "incorrect value for uart_ftdi.crc_error_count, expected 0, is %d", check_msg->uart_ftdi.crc_error_count); - ck_assert_msg(check_msg->uart_ftdi.io_error_count == 0, "incorrect value for uart_ftdi.io_error_count, expected 0, is %d", check_msg->uart_ftdi.io_error_count); - ck_assert_msg(check_msg->uart_ftdi.rx_buffer_level == 0, "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is %d", check_msg->uart_ftdi.rx_buffer_level); - ck_assert_msg((check_msg->uart_ftdi.rx_throughput*100 - 0.0*100) < 0.05, "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is %f", check_msg->uart_ftdi.rx_throughput); - ck_assert_msg(check_msg->uart_ftdi.tx_buffer_level == 50, "incorrect value for uart_ftdi.tx_buffer_level, expected 50, is %d", check_msg->uart_ftdi.tx_buffer_level); - ck_assert_msg((check_msg->uart_ftdi.tx_throughput*100 - 1.31500005722*100) < 0.05, "incorrect value for uart_ftdi.tx_throughput, expected 1.31500005722, is %f", check_msg->uart_ftdi.tx_throughput); + ck_assert_msg(check_msg->latency.avg == -1, + "incorrect value for latency.avg, expected -1, is %d", + check_msg->latency.avg); + ck_assert_msg(check_msg->latency.current == -1, + "incorrect value for latency.current, expected -1, is %d", + check_msg->latency.current); + ck_assert_msg(check_msg->latency.lmax == 0, + "incorrect value for latency.lmax, expected 0, is %d", + check_msg->latency.lmax); + ck_assert_msg(check_msg->latency.lmin == 0, + "incorrect value for latency.lmin, expected 0, is %d", + check_msg->latency.lmin); + ck_assert_msg( + check_msg->uart_a.crc_error_count == 0, + "incorrect value for uart_a.crc_error_count, expected 0, is %d", + check_msg->uart_a.crc_error_count); + ck_assert_msg( + check_msg->uart_a.io_error_count == 0, + "incorrect value for uart_a.io_error_count, expected 0, is %d", + check_msg->uart_a.io_error_count); + ck_assert_msg( + check_msg->uart_a.rx_buffer_level == 0, + "incorrect value for uart_a.rx_buffer_level, expected 0, is %d", + check_msg->uart_a.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_a.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_a.rx_throughput, expected 0.0, is %f", + check_msg->uart_a.rx_throughput); + ck_assert_msg( + check_msg->uart_a.tx_buffer_level == 2, + "incorrect value for uart_a.tx_buffer_level, expected 2, is %d", + check_msg->uart_a.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_a.tx_throughput * 100 - 0.0120000001043 * 100) < 0.05, + "incorrect value for uart_a.tx_throughput, expected 0.0120000001043, " + "is %f", + check_msg->uart_a.tx_throughput); + ck_assert_msg( + check_msg->uart_b.crc_error_count == 0, + "incorrect value for uart_b.crc_error_count, expected 0, is %d", + check_msg->uart_b.crc_error_count); + ck_assert_msg( + check_msg->uart_b.io_error_count == 0, + "incorrect value for uart_b.io_error_count, expected 0, is %d", + check_msg->uart_b.io_error_count); + ck_assert_msg( + check_msg->uart_b.rx_buffer_level == 0, + "incorrect value for uart_b.rx_buffer_level, expected 0, is %d", + check_msg->uart_b.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_b.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_b.rx_throughput, expected 0.0, is %f", + check_msg->uart_b.rx_throughput); + ck_assert_msg( + check_msg->uart_b.tx_buffer_level == 2, + "incorrect value for uart_b.tx_buffer_level, expected 2, is %d", + check_msg->uart_b.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_b.tx_throughput * 100 - 0.0120000001043 * 100) < 0.05, + "incorrect value for uart_b.tx_throughput, expected 0.0120000001043, " + "is %f", + check_msg->uart_b.tx_throughput); + ck_assert_msg( + check_msg->uart_ftdi.crc_error_count == 0, + "incorrect value for uart_ftdi.crc_error_count, expected 0, is %d", + check_msg->uart_ftdi.crc_error_count); + ck_assert_msg( + check_msg->uart_ftdi.io_error_count == 0, + "incorrect value for uart_ftdi.io_error_count, expected 0, is %d", + check_msg->uart_ftdi.io_error_count); + ck_assert_msg( + check_msg->uart_ftdi.rx_buffer_level == 0, + "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is %d", + check_msg->uart_ftdi.rx_buffer_level); + ck_assert_msg( + (check_msg->uart_ftdi.rx_throughput * 100 - 0.0 * 100) < 0.05, + "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is %f", + check_msg->uart_ftdi.rx_throughput); + ck_assert_msg( + check_msg->uart_ftdi.tx_buffer_level == 50, + "incorrect value for uart_ftdi.tx_buffer_level, expected 50, is %d", + check_msg->uart_ftdi.tx_buffer_level); + ck_assert_msg( + (check_msg->uart_ftdi.tx_throughput * 100 - 1.31500005722 * 100) < 0.05, + "incorrect value for uart_ftdi.tx_throughput, expected 1.31500005722, " + "is %f", + check_msg->uart_ftdi.tx_throughput); } } END_TEST -Suite* legacy_auto_check_sbp_piksi_MsgUartStateDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_piksi_MsgUartStateDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_piksi_MsgUartStateDepA"); +Suite* legacy_auto_check_sbp_piksi_MsgUartStateDepA_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_piksi_MsgUartStateDepA"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_piksi_MsgUartStateDepA"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_piksi_MsgUartStateDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_sbas_MsgSbasRaw.c b/c/test/legacy/auto_check_sbp_sbas_MsgSbasRaw.c index f495f1272..bb91d2e9f 100644 --- a/c/test/legacy/auto_check_sbp_sbas_MsgSbasRaw.c +++ b/c/test/legacy/auto_check_sbp_sbas_MsgSbasRaw.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/sbas/test_MsgSbasRaw.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/sbas/test_MsgSbasRaw.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_sbas_MsgSbasRaw ) -{ +START_TEST(test_legacy_auto_check_sbp_sbas_MsgSbasRaw) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_sbas_MsgSbasRaw ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_sbas_MsgSbasRaw ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x7777, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x7777, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x7777, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x7777, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,119,119,28,200,34,131,2,201,228,233,29,4,23,255,0,23,255,0,23,255,127,240,2,255,192,3,127,247,255,127,247,255,229,229,238,170,175,255,240,167,14, }; + u8 encoded_frame[] = { + 85, 119, 119, 28, 200, 34, 131, 2, 201, 228, 233, 29, 4, 23, + 255, 0, 23, 255, 0, 23, 255, 127, 240, 2, 255, 192, 3, 127, + 247, 255, 127, 247, 255, 229, 229, 238, 170, 175, 255, 240, 167, 14, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_sbas_raw_t* test_msg = ( msg_sbas_raw_t* )test_msg_storage; + msg_sbas_raw_t *test_msg = (msg_sbas_raw_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->data) == 0) { // Cope with variable length arrays @@ -282,93 +285,162 @@ START_TEST( test_legacy_auto_check_sbp_sbas_MsgSbasRaw ) test_msg->sid.code = 2; test_msg->sid.sat = 131; test_msg->tow = 501867721; - sbp_payload_send(&sbp_state, 0x7777, 51228, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x7777, 51228, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 51228, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 51228, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x7777, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_sbas_raw_t* check_msg = ( msg_sbas_raw_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_sbas_raw_t *check_msg = (msg_sbas_raw_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->data[0] == 23, "incorrect value for data[0], expected 23, is %d", check_msg->data[0]); - ck_assert_msg(check_msg->data[1] == 255, "incorrect value for data[1], expected 255, is %d", check_msg->data[1]); - ck_assert_msg(check_msg->data[2] == 0, "incorrect value for data[2], expected 0, is %d", check_msg->data[2]); - ck_assert_msg(check_msg->data[3] == 23, "incorrect value for data[3], expected 23, is %d", check_msg->data[3]); - ck_assert_msg(check_msg->data[4] == 255, "incorrect value for data[4], expected 255, is %d", check_msg->data[4]); - ck_assert_msg(check_msg->data[5] == 0, "incorrect value for data[5], expected 0, is %d", check_msg->data[5]); - ck_assert_msg(check_msg->data[6] == 23, "incorrect value for data[6], expected 23, is %d", check_msg->data[6]); - ck_assert_msg(check_msg->data[7] == 255, "incorrect value for data[7], expected 255, is %d", check_msg->data[7]); - ck_assert_msg(check_msg->data[8] == 127, "incorrect value for data[8], expected 127, is %d", check_msg->data[8]); - ck_assert_msg(check_msg->data[9] == 240, "incorrect value for data[9], expected 240, is %d", check_msg->data[9]); - ck_assert_msg(check_msg->data[10] == 2, "incorrect value for data[10], expected 2, is %d", check_msg->data[10]); - ck_assert_msg(check_msg->data[11] == 255, "incorrect value for data[11], expected 255, is %d", check_msg->data[11]); - ck_assert_msg(check_msg->data[12] == 192, "incorrect value for data[12], expected 192, is %d", check_msg->data[12]); - ck_assert_msg(check_msg->data[13] == 3, "incorrect value for data[13], expected 3, is %d", check_msg->data[13]); - ck_assert_msg(check_msg->data[14] == 127, "incorrect value for data[14], expected 127, is %d", check_msg->data[14]); - ck_assert_msg(check_msg->data[15] == 247, "incorrect value for data[15], expected 247, is %d", check_msg->data[15]); - ck_assert_msg(check_msg->data[16] == 255, "incorrect value for data[16], expected 255, is %d", check_msg->data[16]); - ck_assert_msg(check_msg->data[17] == 127, "incorrect value for data[17], expected 127, is %d", check_msg->data[17]); - ck_assert_msg(check_msg->data[18] == 247, "incorrect value for data[18], expected 247, is %d", check_msg->data[18]); - ck_assert_msg(check_msg->data[19] == 255, "incorrect value for data[19], expected 255, is %d", check_msg->data[19]); - ck_assert_msg(check_msg->data[20] == 229, "incorrect value for data[20], expected 229, is %d", check_msg->data[20]); - ck_assert_msg(check_msg->data[21] == 229, "incorrect value for data[21], expected 229, is %d", check_msg->data[21]); - ck_assert_msg(check_msg->data[22] == 238, "incorrect value for data[22], expected 238, is %d", check_msg->data[22]); - ck_assert_msg(check_msg->data[23] == 170, "incorrect value for data[23], expected 170, is %d", check_msg->data[23]); - ck_assert_msg(check_msg->data[24] == 175, "incorrect value for data[24], expected 175, is %d", check_msg->data[24]); - ck_assert_msg(check_msg->data[25] == 255, "incorrect value for data[25], expected 255, is %d", check_msg->data[25]); - ck_assert_msg(check_msg->data[26] == 240, "incorrect value for data[26], expected 240, is %d", check_msg->data[26]); - ck_assert_msg(check_msg->message_type == 4, "incorrect value for message_type, expected 4, is %d", check_msg->message_type); - ck_assert_msg(check_msg->sid.code == 2, "incorrect value for sid.code, expected 2, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.sat == 131, "incorrect value for sid.sat, expected 131, is %d", check_msg->sid.sat); - ck_assert_msg(check_msg->tow == 501867721, "incorrect value for tow, expected 501867721, is %d", check_msg->tow); + ck_assert_msg(check_msg->data[0] == 23, + "incorrect value for data[0], expected 23, is %d", + check_msg->data[0]); + ck_assert_msg(check_msg->data[1] == 255, + "incorrect value for data[1], expected 255, is %d", + check_msg->data[1]); + ck_assert_msg(check_msg->data[2] == 0, + "incorrect value for data[2], expected 0, is %d", + check_msg->data[2]); + ck_assert_msg(check_msg->data[3] == 23, + "incorrect value for data[3], expected 23, is %d", + check_msg->data[3]); + ck_assert_msg(check_msg->data[4] == 255, + "incorrect value for data[4], expected 255, is %d", + check_msg->data[4]); + ck_assert_msg(check_msg->data[5] == 0, + "incorrect value for data[5], expected 0, is %d", + check_msg->data[5]); + ck_assert_msg(check_msg->data[6] == 23, + "incorrect value for data[6], expected 23, is %d", + check_msg->data[6]); + ck_assert_msg(check_msg->data[7] == 255, + "incorrect value for data[7], expected 255, is %d", + check_msg->data[7]); + ck_assert_msg(check_msg->data[8] == 127, + "incorrect value for data[8], expected 127, is %d", + check_msg->data[8]); + ck_assert_msg(check_msg->data[9] == 240, + "incorrect value for data[9], expected 240, is %d", + check_msg->data[9]); + ck_assert_msg(check_msg->data[10] == 2, + "incorrect value for data[10], expected 2, is %d", + check_msg->data[10]); + ck_assert_msg(check_msg->data[11] == 255, + "incorrect value for data[11], expected 255, is %d", + check_msg->data[11]); + ck_assert_msg(check_msg->data[12] == 192, + "incorrect value for data[12], expected 192, is %d", + check_msg->data[12]); + ck_assert_msg(check_msg->data[13] == 3, + "incorrect value for data[13], expected 3, is %d", + check_msg->data[13]); + ck_assert_msg(check_msg->data[14] == 127, + "incorrect value for data[14], expected 127, is %d", + check_msg->data[14]); + ck_assert_msg(check_msg->data[15] == 247, + "incorrect value for data[15], expected 247, is %d", + check_msg->data[15]); + ck_assert_msg(check_msg->data[16] == 255, + "incorrect value for data[16], expected 255, is %d", + check_msg->data[16]); + ck_assert_msg(check_msg->data[17] == 127, + "incorrect value for data[17], expected 127, is %d", + check_msg->data[17]); + ck_assert_msg(check_msg->data[18] == 247, + "incorrect value for data[18], expected 247, is %d", + check_msg->data[18]); + ck_assert_msg(check_msg->data[19] == 255, + "incorrect value for data[19], expected 255, is %d", + check_msg->data[19]); + ck_assert_msg(check_msg->data[20] == 229, + "incorrect value for data[20], expected 229, is %d", + check_msg->data[20]); + ck_assert_msg(check_msg->data[21] == 229, + "incorrect value for data[21], expected 229, is %d", + check_msg->data[21]); + ck_assert_msg(check_msg->data[22] == 238, + "incorrect value for data[22], expected 238, is %d", + check_msg->data[22]); + ck_assert_msg(check_msg->data[23] == 170, + "incorrect value for data[23], expected 170, is %d", + check_msg->data[23]); + ck_assert_msg(check_msg->data[24] == 175, + "incorrect value for data[24], expected 175, is %d", + check_msg->data[24]); + ck_assert_msg(check_msg->data[25] == 255, + "incorrect value for data[25], expected 255, is %d", + check_msg->data[25]); + ck_assert_msg(check_msg->data[26] == 240, + "incorrect value for data[26], expected 240, is %d", + check_msg->data[26]); + ck_assert_msg(check_msg->message_type == 4, + "incorrect value for message_type, expected 4, is %d", + check_msg->message_type); + ck_assert_msg(check_msg->sid.code == 2, + "incorrect value for sid.code, expected 2, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.sat == 131, + "incorrect value for sid.sat, expected 131, is %d", + check_msg->sid.sat); + ck_assert_msg(check_msg->tow == 501867721, + "incorrect value for tow, expected 501867721, is %d", + check_msg->tow); } } END_TEST -Suite* legacy_auto_check_sbp_sbas_MsgSbasRaw_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_sbas_MsgSbasRaw"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_sbas_MsgSbasRaw"); +Suite *legacy_auto_check_sbp_sbas_MsgSbasRaw_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_sbas_MsgSbasRaw"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_sbas_MsgSbasRaw"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_sbas_MsgSbasRaw); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadByIndexDone.c b/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadByIndexDone.c index 1684960d4..b2bcb78a9 100644 --- a/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadByIndexDone.c +++ b/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadByIndexDone.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexDone.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexDone.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexDone ) -{ +START_TEST(test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexDone) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexDone ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,70 +128,84 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexDone ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xa6, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xa6, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xa6, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xa6, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,166,0,246,215,0,163,58, }; + u8 encoded_frame[] = { + 85, 166, 0, 246, 215, 0, 163, 58, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - sbp_payload_send(&sbp_state, 0xa6, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xa6, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xa6, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts + // Cast to expected message type - the +6 byte offset is where the payload + // starts } } END_TEST -Suite* legacy_auto_check_sbp_settings_MsgSettingsReadByIndexDone_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_settings_MsgSettingsReadByIndexDone"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexDone"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexDone); +Suite *legacy_auto_check_sbp_settings_MsgSettingsReadByIndexDone_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_settings_MsgSettingsReadByIndexDone"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_settings_" + "MsgSettingsReadByIndexDone"); + tcase_add_test( + tc_acq, test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexDone); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadByIndexReq.c b/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadByIndexReq.c index dc4f62852..46593cd69 100644 --- a/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadByIndexReq.c +++ b/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadByIndexReq.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq ) -{ +START_TEST(test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,77 +128,95 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xa2, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xa2, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xa2, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xa2, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,162,0,122,123,2,244,34,235,23, }; + u8 encoded_frame[] = { + 85, 162, 0, 122, 123, 2, 244, 34, 235, 23, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_settings_read_by_index_req_t* test_msg = ( msg_settings_read_by_index_req_t* )test_msg_storage; + msg_settings_read_by_index_req_t *test_msg = + (msg_settings_read_by_index_req_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->index = 8948; - sbp_payload_send(&sbp_state, 0xa2, 31610, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xa2, 31610, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 31610, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 31610, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xa2, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_settings_read_by_index_req_t* check_msg = ( msg_settings_read_by_index_req_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_settings_read_by_index_req_t *check_msg = + (msg_settings_read_by_index_req_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->index == 8948, "incorrect value for index, expected 8948, is %d", check_msg->index); + ck_assert_msg(check_msg->index == 8948, + "incorrect value for index, expected 8948, is %d", + check_msg->index); } } END_TEST -Suite* legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq); +Suite *legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_settings_" + "MsgSettingsReadByIndexReq"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadByIndexResp.c b/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadByIndexResp.c index ed986ee68..6489a55ee 100644 --- a/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadByIndexResp.c +++ b/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadByIndexResp.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp ) -{ +START_TEST(test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,84 +128,135 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xa7, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xa7, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - - u8 encoded_frame[] = {85,167,0,246,215,78,0,0,116,101,108,101,109,101,116,114,121,95,114,97,100,105,111,0,99,111,110,102,105,103,117,114,97,116,105,111,110,95,115,116,114,105,110,103,0,65,84,38,70,44,65,84,83,49,61,49,49,53,44,65,84,83,50,61,49,50,56,44,65,84,83,53,61,48,44,65,84,38,87,44,65,84,90,0,248,233, }; + sbp_payload_callback_register(&sbp_state, 0xa7, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xa7, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 167, 0, 246, 215, 78, 0, 0, 116, 101, 108, 101, 109, + 101, 116, 114, 121, 95, 114, 97, 100, 105, 111, 0, 99, 111, + 110, 102, 105, 103, 117, 114, 97, 116, 105, 111, 110, 95, 115, + 116, 114, 105, 110, 103, 0, 65, 84, 38, 70, 44, 65, 84, + 83, 49, 61, 49, 49, 53, 44, 65, 84, 83, 50, 61, 49, + 50, 56, 44, 65, 84, 83, 53, 61, 48, 44, 65, 84, 38, + 87, 44, 65, 84, 90, 0, 248, 233, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_settings_read_by_index_resp_t* test_msg = ( msg_settings_read_by_index_resp_t* )test_msg_storage; + msg_settings_read_by_index_resp_t* test_msg = + (msg_settings_read_by_index_resp_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->index = 0; { - const char assign_string[] = { (char)116,(char)101,(char)108,(char)101,(char)109,(char)101,(char)116,(char)114,(char)121,(char)95,(char)114,(char)97,(char)100,(char)105,(char)111,(char)0,(char)99,(char)111,(char)110,(char)102,(char)105,(char)103,(char)117,(char)114,(char)97,(char)116,(char)105,(char)111,(char)110,(char)95,(char)115,(char)116,(char)114,(char)105,(char)110,(char)103,(char)0,(char)65,(char)84,(char)38,(char)70,(char)44,(char)65,(char)84,(char)83,(char)49,(char)61,(char)49,(char)49,(char)53,(char)44,(char)65,(char)84,(char)83,(char)50,(char)61,(char)49,(char)50,(char)56,(char)44,(char)65,(char)84,(char)83,(char)53,(char)61,(char)48,(char)44,(char)65,(char)84,(char)38,(char)87,(char)44,(char)65,(char)84,(char)90,(char)0 }; + const char assign_string[] = { + (char)116, (char)101, (char)108, (char)101, (char)109, (char)101, + (char)116, (char)114, (char)121, (char)95, (char)114, (char)97, + (char)100, (char)105, (char)111, (char)0, (char)99, (char)111, + (char)110, (char)102, (char)105, (char)103, (char)117, (char)114, + (char)97, (char)116, (char)105, (char)111, (char)110, (char)95, + (char)115, (char)116, (char)114, (char)105, (char)110, (char)103, + (char)0, (char)65, (char)84, (char)38, (char)70, (char)44, + (char)65, (char)84, (char)83, (char)49, (char)61, (char)49, + (char)49, (char)53, (char)44, (char)65, (char)84, (char)83, + (char)50, (char)61, (char)49, (char)50, (char)56, (char)44, + (char)65, (char)84, (char)83, (char)53, (char)61, (char)48, + (char)44, (char)65, (char)84, (char)38, (char)87, (char)44, + (char)65, (char)84, (char)90, (char)0}; memcpy(test_msg->setting, assign_string, sizeof(assign_string)); if (sizeof(test_msg->setting) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0xa7, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xa7, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xa7, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_settings_read_by_index_resp_t* check_msg = ( msg_settings_read_by_index_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_settings_read_by_index_resp_t* check_msg = + (msg_settings_read_by_index_resp_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->index == 0, "incorrect value for index, expected 0, is %d", check_msg->index); + ck_assert_msg(check_msg->index == 0, + "incorrect value for index, expected 0, is %d", + check_msg->index); { - const char check_string[] = { (char)116,(char)101,(char)108,(char)101,(char)109,(char)101,(char)116,(char)114,(char)121,(char)95,(char)114,(char)97,(char)100,(char)105,(char)111,(char)0,(char)99,(char)111,(char)110,(char)102,(char)105,(char)103,(char)117,(char)114,(char)97,(char)116,(char)105,(char)111,(char)110,(char)95,(char)115,(char)116,(char)114,(char)105,(char)110,(char)103,(char)0,(char)65,(char)84,(char)38,(char)70,(char)44,(char)65,(char)84,(char)83,(char)49,(char)61,(char)49,(char)49,(char)53,(char)44,(char)65,(char)84,(char)83,(char)50,(char)61,(char)49,(char)50,(char)56,(char)44,(char)65,(char)84,(char)83,(char)53,(char)61,(char)48,(char)44,(char)65,(char)84,(char)38,(char)87,(char)44,(char)65,(char)84,(char)90,(char)0 }; - ck_assert_msg(memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->setting, expected string '%s', is '%s'", check_string, check_msg->setting); + const char check_string[] = { + (char)116, (char)101, (char)108, (char)101, (char)109, (char)101, + (char)116, (char)114, (char)121, (char)95, (char)114, (char)97, + (char)100, (char)105, (char)111, (char)0, (char)99, (char)111, + (char)110, (char)102, (char)105, (char)103, (char)117, (char)114, + (char)97, (char)116, (char)105, (char)111, (char)110, (char)95, + (char)115, (char)116, (char)114, (char)105, (char)110, (char)103, + (char)0, (char)65, (char)84, (char)38, (char)70, (char)44, + (char)65, (char)84, (char)83, (char)49, (char)61, (char)49, + (char)49, (char)53, (char)44, (char)65, (char)84, (char)83, + (char)50, (char)61, (char)49, (char)50, (char)56, (char)44, + (char)65, (char)84, (char)83, (char)53, (char)61, (char)48, + (char)44, (char)65, (char)84, (char)38, (char)87, (char)44, + (char)65, (char)84, (char)90, (char)0}; + ck_assert_msg( + memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->setting, expected string '%s', is " + "'%s'", + check_string, check_msg->setting); } } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -216,84 +264,117 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xa7, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xa7, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xa7, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xa7, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,167,0,246,215,35,1,0,117,97,114,116,95,102,116,100,105,0,109,111,100,101,0,83,66,80,0,101,110,117,109,58,83,66,80,44,78,77,69,65,0,167,243, }; + u8 encoded_frame[] = { + 85, 167, 0, 246, 215, 35, 1, 0, 117, 97, 114, 116, 95, 102, 116, + 100, 105, 0, 109, 111, 100, 101, 0, 83, 66, 80, 0, 101, 110, 117, + 109, 58, 83, 66, 80, 44, 78, 77, 69, 65, 0, 167, 243, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_settings_read_by_index_resp_t* test_msg = ( msg_settings_read_by_index_resp_t* )test_msg_storage; + msg_settings_read_by_index_resp_t* test_msg = + (msg_settings_read_by_index_resp_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->index = 1; { - const char assign_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)102,(char)116,(char)100,(char)105,(char)0,(char)109,(char)111,(char)100,(char)101,(char)0,(char)83,(char)66,(char)80,(char)0,(char)101,(char)110,(char)117,(char)109,(char)58,(char)83,(char)66,(char)80,(char)44,(char)78,(char)77,(char)69,(char)65,(char)0 }; + const char assign_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)102, + (char)116, (char)100, (char)105, (char)0, (char)109, (char)111, + (char)100, (char)101, (char)0, (char)83, (char)66, (char)80, + (char)0, (char)101, (char)110, (char)117, (char)109, (char)58, + (char)83, (char)66, (char)80, (char)44, (char)78, (char)77, + (char)69, (char)65, (char)0}; memcpy(test_msg->setting, assign_string, sizeof(assign_string)); if (sizeof(test_msg->setting) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0xa7, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xa7, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xa7, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_settings_read_by_index_resp_t* check_msg = ( msg_settings_read_by_index_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_settings_read_by_index_resp_t* check_msg = + (msg_settings_read_by_index_resp_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->index == 1, "incorrect value for index, expected 1, is %d", check_msg->index); + ck_assert_msg(check_msg->index == 1, + "incorrect value for index, expected 1, is %d", + check_msg->index); { - const char check_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)102,(char)116,(char)100,(char)105,(char)0,(char)109,(char)111,(char)100,(char)101,(char)0,(char)83,(char)66,(char)80,(char)0,(char)101,(char)110,(char)117,(char)109,(char)58,(char)83,(char)66,(char)80,(char)44,(char)78,(char)77,(char)69,(char)65,(char)0 }; - ck_assert_msg(memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->setting, expected string '%s', is '%s'", check_string, check_msg->setting); + const char check_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)102, + (char)116, (char)100, (char)105, (char)0, (char)109, (char)111, + (char)100, (char)101, (char)0, (char)83, (char)66, (char)80, + (char)0, (char)101, (char)110, (char)117, (char)109, (char)58, + (char)83, (char)66, (char)80, (char)44, (char)78, (char)77, + (char)69, (char)65, (char)0}; + ck_assert_msg( + memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->setting, expected string '%s', is " + "'%s'", + check_string, check_msg->setting); } } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -301,84 +382,118 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xa7, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xa7, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xa7, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xa7, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,167,0,246,215,35,2,0,117,97,114,116,95,102,116,100,105,0,115,98,112,95,109,101,115,115,97,103,101,95,109,97,115,107,0,54,53,53,51,53,0,4,56, }; + u8 encoded_frame[] = { + 85, 167, 0, 246, 215, 35, 2, 0, 117, 97, 114, + 116, 95, 102, 116, 100, 105, 0, 115, 98, 112, 95, + 109, 101, 115, 115, 97, 103, 101, 95, 109, 97, 115, + 107, 0, 54, 53, 53, 51, 53, 0, 4, 56, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_settings_read_by_index_resp_t* test_msg = ( msg_settings_read_by_index_resp_t* )test_msg_storage; + msg_settings_read_by_index_resp_t* test_msg = + (msg_settings_read_by_index_resp_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->index = 2; { - const char assign_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)102,(char)116,(char)100,(char)105,(char)0,(char)115,(char)98,(char)112,(char)95,(char)109,(char)101,(char)115,(char)115,(char)97,(char)103,(char)101,(char)95,(char)109,(char)97,(char)115,(char)107,(char)0,(char)54,(char)53,(char)53,(char)51,(char)53,(char)0 }; + const char assign_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)102, + (char)116, (char)100, (char)105, (char)0, (char)115, (char)98, + (char)112, (char)95, (char)109, (char)101, (char)115, (char)115, + (char)97, (char)103, (char)101, (char)95, (char)109, (char)97, + (char)115, (char)107, (char)0, (char)54, (char)53, (char)53, + (char)51, (char)53, (char)0}; memcpy(test_msg->setting, assign_string, sizeof(assign_string)); if (sizeof(test_msg->setting) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0xa7, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xa7, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xa7, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_settings_read_by_index_resp_t* check_msg = ( msg_settings_read_by_index_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_settings_read_by_index_resp_t* check_msg = + (msg_settings_read_by_index_resp_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->index == 2, "incorrect value for index, expected 2, is %d", check_msg->index); + ck_assert_msg(check_msg->index == 2, + "incorrect value for index, expected 2, is %d", + check_msg->index); { - const char check_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)102,(char)116,(char)100,(char)105,(char)0,(char)115,(char)98,(char)112,(char)95,(char)109,(char)101,(char)115,(char)115,(char)97,(char)103,(char)101,(char)95,(char)109,(char)97,(char)115,(char)107,(char)0,(char)54,(char)53,(char)53,(char)51,(char)53,(char)0 }; - ck_assert_msg(memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->setting, expected string '%s', is '%s'", check_string, check_msg->setting); + const char check_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)102, + (char)116, (char)100, (char)105, (char)0, (char)115, (char)98, + (char)112, (char)95, (char)109, (char)101, (char)115, (char)115, + (char)97, (char)103, (char)101, (char)95, (char)109, (char)97, + (char)115, (char)107, (char)0, (char)54, (char)53, (char)53, + (char)51, (char)53, (char)0}; + ck_assert_msg( + memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->setting, expected string '%s', is " + "'%s'", + check_string, check_msg->setting); } } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -386,84 +501,115 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xa7, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xa7, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xa7, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xa7, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,167,0,246,215,29,3,0,117,97,114,116,95,102,116,100,105,0,98,97,117,100,114,97,116,101,0,49,48,48,48,48,48,48,0,242,146, }; + u8 encoded_frame[] = { + 85, 167, 0, 246, 215, 29, 3, 0, 117, 97, 114, 116, 95, + 102, 116, 100, 105, 0, 98, 97, 117, 100, 114, 97, 116, 101, + 0, 49, 48, 48, 48, 48, 48, 48, 0, 242, 146, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_settings_read_by_index_resp_t* test_msg = ( msg_settings_read_by_index_resp_t* )test_msg_storage; + msg_settings_read_by_index_resp_t* test_msg = + (msg_settings_read_by_index_resp_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->index = 3; { - const char assign_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)102,(char)116,(char)100,(char)105,(char)0,(char)98,(char)97,(char)117,(char)100,(char)114,(char)97,(char)116,(char)101,(char)0,(char)49,(char)48,(char)48,(char)48,(char)48,(char)48,(char)48,(char)0 }; + const char assign_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)102, + (char)116, (char)100, (char)105, (char)0, (char)98, (char)97, + (char)117, (char)100, (char)114, (char)97, (char)116, (char)101, + (char)0, (char)49, (char)48, (char)48, (char)48, (char)48, + (char)48, (char)48, (char)0}; memcpy(test_msg->setting, assign_string, sizeof(assign_string)); if (sizeof(test_msg->setting) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0xa7, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xa7, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xa7, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_settings_read_by_index_resp_t* check_msg = ( msg_settings_read_by_index_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_settings_read_by_index_resp_t* check_msg = + (msg_settings_read_by_index_resp_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->index == 3, "incorrect value for index, expected 3, is %d", check_msg->index); + ck_assert_msg(check_msg->index == 3, + "incorrect value for index, expected 3, is %d", + check_msg->index); { - const char check_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)102,(char)116,(char)100,(char)105,(char)0,(char)98,(char)97,(char)117,(char)100,(char)114,(char)97,(char)116,(char)101,(char)0,(char)49,(char)48,(char)48,(char)48,(char)48,(char)48,(char)48,(char)0 }; - ck_assert_msg(memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->setting, expected string '%s', is '%s'", check_string, check_msg->setting); + const char check_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)102, + (char)116, (char)100, (char)105, (char)0, (char)98, (char)97, + (char)117, (char)100, (char)114, (char)97, (char)116, (char)101, + (char)0, (char)49, (char)48, (char)48, (char)48, (char)48, + (char)48, (char)48, (char)0}; + ck_assert_msg( + memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->setting, expected string '%s', is " + "'%s'", + check_string, check_msg->setting); } } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -471,88 +617,124 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xa7, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xa7, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xa7, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xa7, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,167,0,246,215,36,4,0,117,97,114,116,95,117,97,114,116,97,0,109,111,100,101,0,83,66,80,0,101,110,117,109,58,83,66,80,44,78,77,69,65,0,22,4, }; + u8 encoded_frame[] = { + 85, 167, 0, 246, 215, 36, 4, 0, 117, 97, 114, 116, 95, 117, 97, + 114, 116, 97, 0, 109, 111, 100, 101, 0, 83, 66, 80, 0, 101, 110, + 117, 109, 58, 83, 66, 80, 44, 78, 77, 69, 65, 0, 22, 4, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_settings_read_by_index_resp_t* test_msg = ( msg_settings_read_by_index_resp_t* )test_msg_storage; + msg_settings_read_by_index_resp_t* test_msg = + (msg_settings_read_by_index_resp_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->index = 4; { - const char assign_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)117,(char)97,(char)114,(char)116,(char)97,(char)0,(char)109,(char)111,(char)100,(char)101,(char)0,(char)83,(char)66,(char)80,(char)0,(char)101,(char)110,(char)117,(char)109,(char)58,(char)83,(char)66,(char)80,(char)44,(char)78,(char)77,(char)69,(char)65,(char)0 }; + const char assign_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)117, + (char)97, (char)114, (char)116, (char)97, (char)0, (char)109, + (char)111, (char)100, (char)101, (char)0, (char)83, (char)66, + (char)80, (char)0, (char)101, (char)110, (char)117, (char)109, + (char)58, (char)83, (char)66, (char)80, (char)44, (char)78, + (char)77, (char)69, (char)65, (char)0}; memcpy(test_msg->setting, assign_string, sizeof(assign_string)); if (sizeof(test_msg->setting) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0xa7, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xa7, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xa7, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_settings_read_by_index_resp_t* check_msg = ( msg_settings_read_by_index_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_settings_read_by_index_resp_t* check_msg = + (msg_settings_read_by_index_resp_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->index == 4, "incorrect value for index, expected 4, is %d", check_msg->index); + ck_assert_msg(check_msg->index == 4, + "incorrect value for index, expected 4, is %d", + check_msg->index); { - const char check_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)117,(char)97,(char)114,(char)116,(char)97,(char)0,(char)109,(char)111,(char)100,(char)101,(char)0,(char)83,(char)66,(char)80,(char)0,(char)101,(char)110,(char)117,(char)109,(char)58,(char)83,(char)66,(char)80,(char)44,(char)78,(char)77,(char)69,(char)65,(char)0 }; - ck_assert_msg(memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->setting, expected string '%s', is '%s'", check_string, check_msg->setting); + const char check_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)117, + (char)97, (char)114, (char)116, (char)97, (char)0, (char)109, + (char)111, (char)100, (char)101, (char)0, (char)83, (char)66, + (char)80, (char)0, (char)101, (char)110, (char)117, (char)109, + (char)58, (char)83, (char)66, (char)80, (char)44, (char)78, + (char)77, (char)69, (char)65, (char)0}; + ck_assert_msg( + memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->setting, expected string '%s', is " + "'%s'", + check_string, check_msg->setting); } } } END_TEST -Suite* legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp); +Suite* legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_settings_" + "MsgSettingsReadByIndexResp"); + tcase_add_test( + tc_acq, test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadReq.c b/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadReq.c index 2c18a9087..47bff9f12 100644 --- a/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadReq.c +++ b/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadReq.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadReq ) -{ +START_TEST(test_legacy_auto_check_sbp_settings_MsgSettingsReadReq) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadReq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,86 +128,117 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadReq ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xa4, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xa4, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xa4, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xa4, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,164,0,152,214,26,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,181,228, }; + u8 encoded_frame[] = { + 85, 164, 0, 152, 214, 26, 115, 101, 99, 116, 105, 111, + 110, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, + 110, 103, 45, 110, 97, 109, 101, 0, 181, 228, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_settings_read_req_t* test_msg = ( msg_settings_read_req_t* )test_msg_storage; + msg_settings_read_req_t *test_msg = + (msg_settings_read_req_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0 }; + const char assign_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0}; memcpy(test_msg->setting, assign_string, sizeof(assign_string)); if (sizeof(test_msg->setting) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0xa4, 54936, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xa4, 54936, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 54936, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 54936, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xa4, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_settings_read_req_t* check_msg = ( msg_settings_read_req_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_settings_read_req_t *check_msg = + (msg_settings_read_req_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0 }; - ck_assert_msg(memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->setting, expected string '%s', is '%s'", check_string, check_msg->setting); + const char check_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0}; + ck_assert_msg( + memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->setting, expected string '%s', is " + "'%s'", + check_string, check_msg->setting); } } } END_TEST -Suite* legacy_auto_check_sbp_settings_MsgSettingsReadReq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_settings_MsgSettingsReadReq"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsReadReq"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_settings_MsgSettingsReadReq); +Suite *legacy_auto_check_sbp_settings_MsgSettingsReadReq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_settings_MsgSettingsReadReq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsReadReq"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_settings_MsgSettingsReadReq); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadResp.c b/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadResp.c index 84b73f558..dd56d02a5 100644 --- a/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadResp.c +++ b/c/test/legacy/auto_check_sbp_settings_MsgSettingsReadResp.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadResp ) -{ +START_TEST(test_legacy_auto_check_sbp_settings_MsgSettingsReadResp) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,86 +128,132 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsReadResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xa5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xa5, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xa5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xa5, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,165,0,136,240,66,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,203,199, }; + u8 encoded_frame[] = { + 85, 165, 0, 136, 240, 66, 115, 101, 99, 116, 105, 111, 110, + 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, + 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, + 45, 118, 97, 108, 117, 101, 0, 101, 110, 117, 109, 59, 118, + 97, 108, 117, 101, 49, 44, 118, 97, 108, 117, 101, 50, 44, + 118, 97, 108, 117, 101, 51, 0, 203, 199, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_settings_read_resp_t* test_msg = ( msg_settings_read_resp_t* )test_msg_storage; + msg_settings_read_resp_t *test_msg = + (msg_settings_read_resp_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; + const char assign_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; memcpy(test_msg->setting, assign_string, sizeof(assign_string)); if (sizeof(test_msg->setting) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0xa5, 61576, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xa5, 61576, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61576, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 61576, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xa5, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_settings_read_resp_t* check_msg = ( msg_settings_read_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_settings_read_resp_t *check_msg = + (msg_settings_read_resp_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; - ck_assert_msg(memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->setting, expected string '%s', is '%s'", check_string, check_msg->setting); + const char check_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; + ck_assert_msg( + memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->setting, expected string '%s', is " + "'%s'", + check_string, check_msg->setting); } } } END_TEST -Suite* legacy_auto_check_sbp_settings_MsgSettingsReadResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_settings_MsgSettingsReadResp"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsReadResp"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_settings_MsgSettingsReadResp); +Suite *legacy_auto_check_sbp_settings_MsgSettingsReadResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_settings_MsgSettingsReadResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsReadResp"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_settings_MsgSettingsReadResp); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_settings_MsgSettingsRegister.c b/c/test/legacy/auto_check_sbp_settings_MsgSettingsRegister.c index 2dfed9f30..8ac4e75b4 100644 --- a/c/test/legacy/auto_check_sbp_settings_MsgSettingsRegister.c +++ b/c/test/legacy/auto_check_sbp_settings_MsgSettingsRegister.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegister.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegister.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsRegister ) -{ +START_TEST(test_legacy_auto_check_sbp_settings_MsgSettingsRegister) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsRegister ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,86 +128,132 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsRegister ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xae, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xae, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xae, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xae, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,174,0,84,6,66,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,142,235, }; + u8 encoded_frame[] = { + 85, 174, 0, 84, 6, 66, 115, 101, 99, 116, 105, 111, 110, + 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, + 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, + 45, 118, 97, 108, 117, 101, 0, 101, 110, 117, 109, 59, 118, + 97, 108, 117, 101, 49, 44, 118, 97, 108, 117, 101, 50, 44, + 118, 97, 108, 117, 101, 51, 0, 142, 235, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_settings_register_t* test_msg = ( msg_settings_register_t* )test_msg_storage; + msg_settings_register_t *test_msg = + (msg_settings_register_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; + const char assign_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; memcpy(test_msg->setting, assign_string, sizeof(assign_string)); if (sizeof(test_msg->setting) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0xae, 1620, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xae, 1620, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1620, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1620, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xae, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_settings_register_t* check_msg = ( msg_settings_register_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_settings_register_t *check_msg = + (msg_settings_register_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; - ck_assert_msg(memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->setting, expected string '%s', is '%s'", check_string, check_msg->setting); + const char check_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; + ck_assert_msg( + memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->setting, expected string '%s', is " + "'%s'", + check_string, check_msg->setting); } } } END_TEST -Suite* legacy_auto_check_sbp_settings_MsgSettingsRegister_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_settings_MsgSettingsRegister"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsRegister"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_settings_MsgSettingsRegister); +Suite *legacy_auto_check_sbp_settings_MsgSettingsRegister_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_settings_MsgSettingsRegister"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsRegister"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_settings_MsgSettingsRegister); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_settings_MsgSettingsRegisterResp.c b/c/test/legacy/auto_check_sbp_settings_MsgSettingsRegisterResp.c index 9c422e3f0..a956652ee 100644 --- a/c/test/legacy/auto_check_sbp_settings_MsgSettingsRegisterResp.c +++ b/c/test/legacy/auto_check_sbp_settings_MsgSettingsRegisterResp.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegisterResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegisterResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsRegisterResp ) -{ +START_TEST(test_legacy_auto_check_sbp_settings_MsgSettingsRegisterResp) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsRegisterResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,88 +128,136 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsRegisterResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x1af, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x1af, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x1af, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x1af, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,175,1,41,213,67,18,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,82,16, }; + u8 encoded_frame[] = { + 85, 175, 1, 41, 213, 67, 18, 115, 101, 99, 116, 105, 111, + 110, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, + 103, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, + 103, 45, 118, 97, 108, 117, 101, 0, 101, 110, 117, 109, 59, + 118, 97, 108, 117, 101, 49, 44, 118, 97, 108, 117, 101, 50, + 44, 118, 97, 108, 117, 101, 51, 0, 82, 16, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_settings_register_resp_t* test_msg = ( msg_settings_register_resp_t* )test_msg_storage; + msg_settings_register_resp_t *test_msg = + (msg_settings_register_resp_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; + const char assign_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; memcpy(test_msg->setting, assign_string, sizeof(assign_string)); if (sizeof(test_msg->setting) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->status = 18; - sbp_payload_send(&sbp_state, 0x1af, 54569, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x1af, 54569, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 54569, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 54569, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x1af, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_settings_register_resp_t* check_msg = ( msg_settings_register_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_settings_register_resp_t *check_msg = + (msg_settings_register_resp_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; - ck_assert_msg(memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->setting, expected string '%s', is '%s'", check_string, check_msg->setting); + const char check_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; + ck_assert_msg( + memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->setting, expected string '%s', is " + "'%s'", + check_string, check_msg->setting); } - ck_assert_msg(check_msg->status == 18, "incorrect value for status, expected 18, is %d", check_msg->status); + ck_assert_msg(check_msg->status == 18, + "incorrect value for status, expected 18, is %d", + check_msg->status); } } END_TEST -Suite* legacy_auto_check_sbp_settings_MsgSettingsRegisterResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_settings_MsgSettingsRegisterResp"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsRegisterResp"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_settings_MsgSettingsRegisterResp); +Suite *legacy_auto_check_sbp_settings_MsgSettingsRegisterResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_settings_MsgSettingsRegisterResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsRegisterResp"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_settings_MsgSettingsRegisterResp); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_settings_MsgSettingsSave.c b/c/test/legacy/auto_check_sbp_settings_MsgSettingsSave.c index 1167cea22..819286bf9 100644 --- a/c/test/legacy/auto_check_sbp_settings_MsgSettingsSave.c +++ b/c/test/legacy/auto_check_sbp_settings_MsgSettingsSave.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsSave.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsSave.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsSave ) -{ +START_TEST(test_legacy_auto_check_sbp_settings_MsgSettingsSave) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsSave ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,69 +128,81 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsSave ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xa1, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xa1, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xa1, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xa1, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,161,0,162,224,0,123,67, }; + u8 encoded_frame[] = { + 85, 161, 0, 162, 224, 0, 123, 67, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - sbp_payload_send(&sbp_state, 0xa1, 57506, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xa1, 57506, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 57506, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 57506, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xa1, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts + // Cast to expected message type - the +6 byte offset is where the payload + // starts } } END_TEST -Suite* legacy_auto_check_sbp_settings_MsgSettingsSave_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_settings_MsgSettingsSave"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsSave"); +Suite *legacy_auto_check_sbp_settings_MsgSettingsSave_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_settings_MsgSettingsSave"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsSave"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_settings_MsgSettingsSave); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_settings_MsgSettingsWrite.c b/c/test/legacy/auto_check_sbp_settings_MsgSettingsWrite.c index 80b6fb9ad..087d3ec64 100644 --- a/c/test/legacy/auto_check_sbp_settings_MsgSettingsWrite.c +++ b/c/test/legacy/auto_check_sbp_settings_MsgSettingsWrite.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWrite.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWrite.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsWrite ) -{ +START_TEST(test_legacy_auto_check_sbp_settings_MsgSettingsWrite) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsWrite ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,85 +128,119 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsWrite ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xa0, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xa0, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xa0, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xa0, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,160,0,123,0,40,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,244,10, }; + u8 encoded_frame[] = { + 85, 160, 0, 123, 0, 40, 115, 101, 99, 116, 105, 111, + 110, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, + 110, 103, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, + 105, 110, 103, 45, 118, 97, 108, 117, 101, 0, 244, 10, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_settings_write_t* test_msg = ( msg_settings_write_t* )test_msg_storage; + msg_settings_write_t *test_msg = (msg_settings_write_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0 }; + const char assign_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0}; memcpy(test_msg->setting, assign_string, sizeof(assign_string)); if (sizeof(test_msg->setting) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0xa0, 123, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xa0, 123, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 123, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 123, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xa0, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_settings_write_t* check_msg = ( msg_settings_write_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_settings_write_t *check_msg = + (msg_settings_write_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0 }; - ck_assert_msg(memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->setting, expected string '%s', is '%s'", check_string, check_msg->setting); + const char check_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0}; + ck_assert_msg( + memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->setting, expected string '%s', is " + "'%s'", + check_string, check_msg->setting); } } } END_TEST -Suite* legacy_auto_check_sbp_settings_MsgSettingsWrite_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_settings_MsgSettingsWrite"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsWrite"); +Suite *legacy_auto_check_sbp_settings_MsgSettingsWrite_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_settings_MsgSettingsWrite"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsWrite"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_settings_MsgSettingsWrite); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_settings_MsgSettingsWriteResp.c b/c/test/legacy/auto_check_sbp_settings_MsgSettingsWriteResp.c index 33bee647a..5d843d3c8 100644 --- a/c/test/legacy/auto_check_sbp_settings_MsgSettingsWriteResp.c +++ b/c/test/legacy/auto_check_sbp_settings_MsgSettingsWriteResp.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWriteResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWriteResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsWriteResp ) -{ +START_TEST(test_legacy_auto_check_sbp_settings_MsgSettingsWriteResp) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsWriteResp ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,88 +128,136 @@ START_TEST( test_legacy_auto_check_sbp_settings_MsgSettingsWriteResp ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xaf, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xaf, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xaf, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xaf, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,175,0,91,55,67,152,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,54,0, }; + u8 encoded_frame[] = { + 85, 175, 0, 91, 55, 67, 152, 115, 101, 99, 116, 105, 111, + 110, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, + 103, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, + 103, 45, 118, 97, 108, 117, 101, 0, 101, 110, 117, 109, 59, + 118, 97, 108, 117, 101, 49, 44, 118, 97, 108, 117, 101, 50, + 44, 118, 97, 108, 117, 101, 51, 0, 54, 0, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_settings_write_resp_t* test_msg = ( msg_settings_write_resp_t* )test_msg_storage; + msg_settings_write_resp_t *test_msg = + (msg_settings_write_resp_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); { - const char assign_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; + const char assign_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; memcpy(test_msg->setting, assign_string, sizeof(assign_string)); if (sizeof(test_msg->setting) == 0) { test_msg_len += sizeof(assign_string); } } test_msg->status = 152; - sbp_payload_send(&sbp_state, 0xaf, 14171, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xaf, 14171, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 14171, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 14171, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xaf, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_settings_write_resp_t* check_msg = ( msg_settings_write_resp_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_settings_write_resp_t *check_msg = + (msg_settings_write_resp_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); { - const char check_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; - ck_assert_msg(memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->setting, expected string '%s', is '%s'", check_string, check_msg->setting); + const char check_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; + ck_assert_msg( + memcmp(check_msg->setting, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->setting, expected string '%s', is " + "'%s'", + check_string, check_msg->setting); } - ck_assert_msg(check_msg->status == 152, "incorrect value for status, expected 152, is %d", check_msg->status); + ck_assert_msg(check_msg->status == 152, + "incorrect value for status, expected 152, is %d", + check_msg->status); } } END_TEST -Suite* legacy_auto_check_sbp_settings_MsgSettingsWriteResp_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_settings_MsgSettingsWriteResp"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsWriteResp"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_settings_MsgSettingsWriteResp); +Suite *legacy_auto_check_sbp_settings_MsgSettingsWriteResp_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_settings_MsgSettingsWriteResp"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_settings_MsgSettingsWriteResp"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_settings_MsgSettingsWriteResp); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_signing_MsgCertificateChain.c b/c/test/legacy/auto_check_sbp_signing_MsgCertificateChain.c index dcb2e3401..f60cb4207 100644 --- a/c/test/legacy/auto_check_sbp_signing_MsgCertificateChain.c +++ b/c/test/legacy/auto_check_sbp_signing_MsgCertificateChain.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChain.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChain.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_signing_MsgCertificateChain ) -{ +START_TEST(test_legacy_auto_check_sbp_signing_MsgCertificateChain) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgCertificateChain ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,30 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgCertificateChain ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xC09, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xC09, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xC09, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xC09, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,9,12,66,0,144,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,20,21,22,23,24,25,26,27,28,29,10,11,12,13,14,15,16,17,18,19,232,7,3,30,12,34,59,21,205,91,7,72,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,227,224, }; + u8 encoded_frame[] = { + 85, 9, 12, 66, 0, 144, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 232, 7, + 3, 30, 12, 34, 59, 21, 205, 91, 7, 72, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 227, 224, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_certificate_chain_t* test_msg = ( msg_certificate_chain_t* )test_msg_storage; + msg_certificate_chain_t *test_msg = + (msg_certificate_chain_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->corrections_certificate) == 0) { // Cope with variable length arrays @@ -811,203 +821,544 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgCertificateChain ) } test_msg->signature.data[71] = 71; test_msg->signature.len = 72; - sbp_payload_send(&sbp_state, 0xC09, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xC09, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xC09, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_certificate_chain_t* check_msg = ( msg_certificate_chain_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_certificate_chain_t *check_msg = + (msg_certificate_chain_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->corrections_certificate[0] == 20, "incorrect value for corrections_certificate[0], expected 20, is %d", check_msg->corrections_certificate[0]); - ck_assert_msg(check_msg->corrections_certificate[1] == 21, "incorrect value for corrections_certificate[1], expected 21, is %d", check_msg->corrections_certificate[1]); - ck_assert_msg(check_msg->corrections_certificate[2] == 22, "incorrect value for corrections_certificate[2], expected 22, is %d", check_msg->corrections_certificate[2]); - ck_assert_msg(check_msg->corrections_certificate[3] == 23, "incorrect value for corrections_certificate[3], expected 23, is %d", check_msg->corrections_certificate[3]); - ck_assert_msg(check_msg->corrections_certificate[4] == 24, "incorrect value for corrections_certificate[4], expected 24, is %d", check_msg->corrections_certificate[4]); - ck_assert_msg(check_msg->corrections_certificate[5] == 25, "incorrect value for corrections_certificate[5], expected 25, is %d", check_msg->corrections_certificate[5]); - ck_assert_msg(check_msg->corrections_certificate[6] == 26, "incorrect value for corrections_certificate[6], expected 26, is %d", check_msg->corrections_certificate[6]); - ck_assert_msg(check_msg->corrections_certificate[7] == 27, "incorrect value for corrections_certificate[7], expected 27, is %d", check_msg->corrections_certificate[7]); - ck_assert_msg(check_msg->corrections_certificate[8] == 28, "incorrect value for corrections_certificate[8], expected 28, is %d", check_msg->corrections_certificate[8]); - ck_assert_msg(check_msg->corrections_certificate[9] == 29, "incorrect value for corrections_certificate[9], expected 29, is %d", check_msg->corrections_certificate[9]); - ck_assert_msg(check_msg->corrections_certificate[10] == 10, "incorrect value for corrections_certificate[10], expected 10, is %d", check_msg->corrections_certificate[10]); - ck_assert_msg(check_msg->corrections_certificate[11] == 11, "incorrect value for corrections_certificate[11], expected 11, is %d", check_msg->corrections_certificate[11]); - ck_assert_msg(check_msg->corrections_certificate[12] == 12, "incorrect value for corrections_certificate[12], expected 12, is %d", check_msg->corrections_certificate[12]); - ck_assert_msg(check_msg->corrections_certificate[13] == 13, "incorrect value for corrections_certificate[13], expected 13, is %d", check_msg->corrections_certificate[13]); - ck_assert_msg(check_msg->corrections_certificate[14] == 14, "incorrect value for corrections_certificate[14], expected 14, is %d", check_msg->corrections_certificate[14]); - ck_assert_msg(check_msg->corrections_certificate[15] == 15, "incorrect value for corrections_certificate[15], expected 15, is %d", check_msg->corrections_certificate[15]); - ck_assert_msg(check_msg->corrections_certificate[16] == 16, "incorrect value for corrections_certificate[16], expected 16, is %d", check_msg->corrections_certificate[16]); - ck_assert_msg(check_msg->corrections_certificate[17] == 17, "incorrect value for corrections_certificate[17], expected 17, is %d", check_msg->corrections_certificate[17]); - ck_assert_msg(check_msg->corrections_certificate[18] == 18, "incorrect value for corrections_certificate[18], expected 18, is %d", check_msg->corrections_certificate[18]); - ck_assert_msg(check_msg->corrections_certificate[19] == 19, "incorrect value for corrections_certificate[19], expected 19, is %d", check_msg->corrections_certificate[19]); - ck_assert_msg(check_msg->expiration.day == 30, "incorrect value for expiration.day, expected 30, is %d", check_msg->expiration.day); - ck_assert_msg(check_msg->expiration.hours == 12, "incorrect value for expiration.hours, expected 12, is %d", check_msg->expiration.hours); - ck_assert_msg(check_msg->expiration.minutes == 34, "incorrect value for expiration.minutes, expected 34, is %d", check_msg->expiration.minutes); - ck_assert_msg(check_msg->expiration.month == 3, "incorrect value for expiration.month, expected 3, is %d", check_msg->expiration.month); - ck_assert_msg(check_msg->expiration.ns == 123456789, "incorrect value for expiration.ns, expected 123456789, is %d", check_msg->expiration.ns); - ck_assert_msg(check_msg->expiration.seconds == 59, "incorrect value for expiration.seconds, expected 59, is %d", check_msg->expiration.seconds); - ck_assert_msg(check_msg->expiration.year == 2024, "incorrect value for expiration.year, expected 2024, is %d", check_msg->expiration.year); - ck_assert_msg(check_msg->intermediate_certificate[0] == 10, "incorrect value for intermediate_certificate[0], expected 10, is %d", check_msg->intermediate_certificate[0]); - ck_assert_msg(check_msg->intermediate_certificate[1] == 11, "incorrect value for intermediate_certificate[1], expected 11, is %d", check_msg->intermediate_certificate[1]); - ck_assert_msg(check_msg->intermediate_certificate[2] == 12, "incorrect value for intermediate_certificate[2], expected 12, is %d", check_msg->intermediate_certificate[2]); - ck_assert_msg(check_msg->intermediate_certificate[3] == 13, "incorrect value for intermediate_certificate[3], expected 13, is %d", check_msg->intermediate_certificate[3]); - ck_assert_msg(check_msg->intermediate_certificate[4] == 14, "incorrect value for intermediate_certificate[4], expected 14, is %d", check_msg->intermediate_certificate[4]); - ck_assert_msg(check_msg->intermediate_certificate[5] == 15, "incorrect value for intermediate_certificate[5], expected 15, is %d", check_msg->intermediate_certificate[5]); - ck_assert_msg(check_msg->intermediate_certificate[6] == 16, "incorrect value for intermediate_certificate[6], expected 16, is %d", check_msg->intermediate_certificate[6]); - ck_assert_msg(check_msg->intermediate_certificate[7] == 17, "incorrect value for intermediate_certificate[7], expected 17, is %d", check_msg->intermediate_certificate[7]); - ck_assert_msg(check_msg->intermediate_certificate[8] == 18, "incorrect value for intermediate_certificate[8], expected 18, is %d", check_msg->intermediate_certificate[8]); - ck_assert_msg(check_msg->intermediate_certificate[9] == 19, "incorrect value for intermediate_certificate[9], expected 19, is %d", check_msg->intermediate_certificate[9]); - ck_assert_msg(check_msg->intermediate_certificate[10] == 0, "incorrect value for intermediate_certificate[10], expected 0, is %d", check_msg->intermediate_certificate[10]); - ck_assert_msg(check_msg->intermediate_certificate[11] == 1, "incorrect value for intermediate_certificate[11], expected 1, is %d", check_msg->intermediate_certificate[11]); - ck_assert_msg(check_msg->intermediate_certificate[12] == 2, "incorrect value for intermediate_certificate[12], expected 2, is %d", check_msg->intermediate_certificate[12]); - ck_assert_msg(check_msg->intermediate_certificate[13] == 3, "incorrect value for intermediate_certificate[13], expected 3, is %d", check_msg->intermediate_certificate[13]); - ck_assert_msg(check_msg->intermediate_certificate[14] == 4, "incorrect value for intermediate_certificate[14], expected 4, is %d", check_msg->intermediate_certificate[14]); - ck_assert_msg(check_msg->intermediate_certificate[15] == 5, "incorrect value for intermediate_certificate[15], expected 5, is %d", check_msg->intermediate_certificate[15]); - ck_assert_msg(check_msg->intermediate_certificate[16] == 6, "incorrect value for intermediate_certificate[16], expected 6, is %d", check_msg->intermediate_certificate[16]); - ck_assert_msg(check_msg->intermediate_certificate[17] == 7, "incorrect value for intermediate_certificate[17], expected 7, is %d", check_msg->intermediate_certificate[17]); - ck_assert_msg(check_msg->intermediate_certificate[18] == 8, "incorrect value for intermediate_certificate[18], expected 8, is %d", check_msg->intermediate_certificate[18]); - ck_assert_msg(check_msg->intermediate_certificate[19] == 9, "incorrect value for intermediate_certificate[19], expected 9, is %d", check_msg->intermediate_certificate[19]); - ck_assert_msg(check_msg->root_certificate[0] == 0, "incorrect value for root_certificate[0], expected 0, is %d", check_msg->root_certificate[0]); - ck_assert_msg(check_msg->root_certificate[1] == 1, "incorrect value for root_certificate[1], expected 1, is %d", check_msg->root_certificate[1]); - ck_assert_msg(check_msg->root_certificate[2] == 2, "incorrect value for root_certificate[2], expected 2, is %d", check_msg->root_certificate[2]); - ck_assert_msg(check_msg->root_certificate[3] == 3, "incorrect value for root_certificate[3], expected 3, is %d", check_msg->root_certificate[3]); - ck_assert_msg(check_msg->root_certificate[4] == 4, "incorrect value for root_certificate[4], expected 4, is %d", check_msg->root_certificate[4]); - ck_assert_msg(check_msg->root_certificate[5] == 5, "incorrect value for root_certificate[5], expected 5, is %d", check_msg->root_certificate[5]); - ck_assert_msg(check_msg->root_certificate[6] == 6, "incorrect value for root_certificate[6], expected 6, is %d", check_msg->root_certificate[6]); - ck_assert_msg(check_msg->root_certificate[7] == 7, "incorrect value for root_certificate[7], expected 7, is %d", check_msg->root_certificate[7]); - ck_assert_msg(check_msg->root_certificate[8] == 8, "incorrect value for root_certificate[8], expected 8, is %d", check_msg->root_certificate[8]); - ck_assert_msg(check_msg->root_certificate[9] == 9, "incorrect value for root_certificate[9], expected 9, is %d", check_msg->root_certificate[9]); - ck_assert_msg(check_msg->root_certificate[10] == 10, "incorrect value for root_certificate[10], expected 10, is %d", check_msg->root_certificate[10]); - ck_assert_msg(check_msg->root_certificate[11] == 11, "incorrect value for root_certificate[11], expected 11, is %d", check_msg->root_certificate[11]); - ck_assert_msg(check_msg->root_certificate[12] == 12, "incorrect value for root_certificate[12], expected 12, is %d", check_msg->root_certificate[12]); - ck_assert_msg(check_msg->root_certificate[13] == 13, "incorrect value for root_certificate[13], expected 13, is %d", check_msg->root_certificate[13]); - ck_assert_msg(check_msg->root_certificate[14] == 14, "incorrect value for root_certificate[14], expected 14, is %d", check_msg->root_certificate[14]); - ck_assert_msg(check_msg->root_certificate[15] == 15, "incorrect value for root_certificate[15], expected 15, is %d", check_msg->root_certificate[15]); - ck_assert_msg(check_msg->root_certificate[16] == 16, "incorrect value for root_certificate[16], expected 16, is %d", check_msg->root_certificate[16]); - ck_assert_msg(check_msg->root_certificate[17] == 17, "incorrect value for root_certificate[17], expected 17, is %d", check_msg->root_certificate[17]); - ck_assert_msg(check_msg->root_certificate[18] == 18, "incorrect value for root_certificate[18], expected 18, is %d", check_msg->root_certificate[18]); - ck_assert_msg(check_msg->root_certificate[19] == 19, "incorrect value for root_certificate[19], expected 19, is %d", check_msg->root_certificate[19]); - ck_assert_msg(check_msg->signature.data[0] == 0, "incorrect value for signature.data[0], expected 0, is %d", check_msg->signature.data[0]); - ck_assert_msg(check_msg->signature.data[1] == 1, "incorrect value for signature.data[1], expected 1, is %d", check_msg->signature.data[1]); - ck_assert_msg(check_msg->signature.data[2] == 2, "incorrect value for signature.data[2], expected 2, is %d", check_msg->signature.data[2]); - ck_assert_msg(check_msg->signature.data[3] == 3, "incorrect value for signature.data[3], expected 3, is %d", check_msg->signature.data[3]); - ck_assert_msg(check_msg->signature.data[4] == 4, "incorrect value for signature.data[4], expected 4, is %d", check_msg->signature.data[4]); - ck_assert_msg(check_msg->signature.data[5] == 5, "incorrect value for signature.data[5], expected 5, is %d", check_msg->signature.data[5]); - ck_assert_msg(check_msg->signature.data[6] == 6, "incorrect value for signature.data[6], expected 6, is %d", check_msg->signature.data[6]); - ck_assert_msg(check_msg->signature.data[7] == 7, "incorrect value for signature.data[7], expected 7, is %d", check_msg->signature.data[7]); - ck_assert_msg(check_msg->signature.data[8] == 8, "incorrect value for signature.data[8], expected 8, is %d", check_msg->signature.data[8]); - ck_assert_msg(check_msg->signature.data[9] == 9, "incorrect value for signature.data[9], expected 9, is %d", check_msg->signature.data[9]); - ck_assert_msg(check_msg->signature.data[10] == 10, "incorrect value for signature.data[10], expected 10, is %d", check_msg->signature.data[10]); - ck_assert_msg(check_msg->signature.data[11] == 11, "incorrect value for signature.data[11], expected 11, is %d", check_msg->signature.data[11]); - ck_assert_msg(check_msg->signature.data[12] == 12, "incorrect value for signature.data[12], expected 12, is %d", check_msg->signature.data[12]); - ck_assert_msg(check_msg->signature.data[13] == 13, "incorrect value for signature.data[13], expected 13, is %d", check_msg->signature.data[13]); - ck_assert_msg(check_msg->signature.data[14] == 14, "incorrect value for signature.data[14], expected 14, is %d", check_msg->signature.data[14]); - ck_assert_msg(check_msg->signature.data[15] == 15, "incorrect value for signature.data[15], expected 15, is %d", check_msg->signature.data[15]); - ck_assert_msg(check_msg->signature.data[16] == 16, "incorrect value for signature.data[16], expected 16, is %d", check_msg->signature.data[16]); - ck_assert_msg(check_msg->signature.data[17] == 17, "incorrect value for signature.data[17], expected 17, is %d", check_msg->signature.data[17]); - ck_assert_msg(check_msg->signature.data[18] == 18, "incorrect value for signature.data[18], expected 18, is %d", check_msg->signature.data[18]); - ck_assert_msg(check_msg->signature.data[19] == 19, "incorrect value for signature.data[19], expected 19, is %d", check_msg->signature.data[19]); - ck_assert_msg(check_msg->signature.data[20] == 20, "incorrect value for signature.data[20], expected 20, is %d", check_msg->signature.data[20]); - ck_assert_msg(check_msg->signature.data[21] == 21, "incorrect value for signature.data[21], expected 21, is %d", check_msg->signature.data[21]); - ck_assert_msg(check_msg->signature.data[22] == 22, "incorrect value for signature.data[22], expected 22, is %d", check_msg->signature.data[22]); - ck_assert_msg(check_msg->signature.data[23] == 23, "incorrect value for signature.data[23], expected 23, is %d", check_msg->signature.data[23]); - ck_assert_msg(check_msg->signature.data[24] == 24, "incorrect value for signature.data[24], expected 24, is %d", check_msg->signature.data[24]); - ck_assert_msg(check_msg->signature.data[25] == 25, "incorrect value for signature.data[25], expected 25, is %d", check_msg->signature.data[25]); - ck_assert_msg(check_msg->signature.data[26] == 26, "incorrect value for signature.data[26], expected 26, is %d", check_msg->signature.data[26]); - ck_assert_msg(check_msg->signature.data[27] == 27, "incorrect value for signature.data[27], expected 27, is %d", check_msg->signature.data[27]); - ck_assert_msg(check_msg->signature.data[28] == 28, "incorrect value for signature.data[28], expected 28, is %d", check_msg->signature.data[28]); - ck_assert_msg(check_msg->signature.data[29] == 29, "incorrect value for signature.data[29], expected 29, is %d", check_msg->signature.data[29]); - ck_assert_msg(check_msg->signature.data[30] == 30, "incorrect value for signature.data[30], expected 30, is %d", check_msg->signature.data[30]); - ck_assert_msg(check_msg->signature.data[31] == 31, "incorrect value for signature.data[31], expected 31, is %d", check_msg->signature.data[31]); - ck_assert_msg(check_msg->signature.data[32] == 32, "incorrect value for signature.data[32], expected 32, is %d", check_msg->signature.data[32]); - ck_assert_msg(check_msg->signature.data[33] == 33, "incorrect value for signature.data[33], expected 33, is %d", check_msg->signature.data[33]); - ck_assert_msg(check_msg->signature.data[34] == 34, "incorrect value for signature.data[34], expected 34, is %d", check_msg->signature.data[34]); - ck_assert_msg(check_msg->signature.data[35] == 35, "incorrect value for signature.data[35], expected 35, is %d", check_msg->signature.data[35]); - ck_assert_msg(check_msg->signature.data[36] == 36, "incorrect value for signature.data[36], expected 36, is %d", check_msg->signature.data[36]); - ck_assert_msg(check_msg->signature.data[37] == 37, "incorrect value for signature.data[37], expected 37, is %d", check_msg->signature.data[37]); - ck_assert_msg(check_msg->signature.data[38] == 38, "incorrect value for signature.data[38], expected 38, is %d", check_msg->signature.data[38]); - ck_assert_msg(check_msg->signature.data[39] == 39, "incorrect value for signature.data[39], expected 39, is %d", check_msg->signature.data[39]); - ck_assert_msg(check_msg->signature.data[40] == 40, "incorrect value for signature.data[40], expected 40, is %d", check_msg->signature.data[40]); - ck_assert_msg(check_msg->signature.data[41] == 41, "incorrect value for signature.data[41], expected 41, is %d", check_msg->signature.data[41]); - ck_assert_msg(check_msg->signature.data[42] == 42, "incorrect value for signature.data[42], expected 42, is %d", check_msg->signature.data[42]); - ck_assert_msg(check_msg->signature.data[43] == 43, "incorrect value for signature.data[43], expected 43, is %d", check_msg->signature.data[43]); - ck_assert_msg(check_msg->signature.data[44] == 44, "incorrect value for signature.data[44], expected 44, is %d", check_msg->signature.data[44]); - ck_assert_msg(check_msg->signature.data[45] == 45, "incorrect value for signature.data[45], expected 45, is %d", check_msg->signature.data[45]); - ck_assert_msg(check_msg->signature.data[46] == 46, "incorrect value for signature.data[46], expected 46, is %d", check_msg->signature.data[46]); - ck_assert_msg(check_msg->signature.data[47] == 47, "incorrect value for signature.data[47], expected 47, is %d", check_msg->signature.data[47]); - ck_assert_msg(check_msg->signature.data[48] == 48, "incorrect value for signature.data[48], expected 48, is %d", check_msg->signature.data[48]); - ck_assert_msg(check_msg->signature.data[49] == 49, "incorrect value for signature.data[49], expected 49, is %d", check_msg->signature.data[49]); - ck_assert_msg(check_msg->signature.data[50] == 50, "incorrect value for signature.data[50], expected 50, is %d", check_msg->signature.data[50]); - ck_assert_msg(check_msg->signature.data[51] == 51, "incorrect value for signature.data[51], expected 51, is %d", check_msg->signature.data[51]); - ck_assert_msg(check_msg->signature.data[52] == 52, "incorrect value for signature.data[52], expected 52, is %d", check_msg->signature.data[52]); - ck_assert_msg(check_msg->signature.data[53] == 53, "incorrect value for signature.data[53], expected 53, is %d", check_msg->signature.data[53]); - ck_assert_msg(check_msg->signature.data[54] == 54, "incorrect value for signature.data[54], expected 54, is %d", check_msg->signature.data[54]); - ck_assert_msg(check_msg->signature.data[55] == 55, "incorrect value for signature.data[55], expected 55, is %d", check_msg->signature.data[55]); - ck_assert_msg(check_msg->signature.data[56] == 56, "incorrect value for signature.data[56], expected 56, is %d", check_msg->signature.data[56]); - ck_assert_msg(check_msg->signature.data[57] == 57, "incorrect value for signature.data[57], expected 57, is %d", check_msg->signature.data[57]); - ck_assert_msg(check_msg->signature.data[58] == 58, "incorrect value for signature.data[58], expected 58, is %d", check_msg->signature.data[58]); - ck_assert_msg(check_msg->signature.data[59] == 59, "incorrect value for signature.data[59], expected 59, is %d", check_msg->signature.data[59]); - ck_assert_msg(check_msg->signature.data[60] == 60, "incorrect value for signature.data[60], expected 60, is %d", check_msg->signature.data[60]); - ck_assert_msg(check_msg->signature.data[61] == 61, "incorrect value for signature.data[61], expected 61, is %d", check_msg->signature.data[61]); - ck_assert_msg(check_msg->signature.data[62] == 62, "incorrect value for signature.data[62], expected 62, is %d", check_msg->signature.data[62]); - ck_assert_msg(check_msg->signature.data[63] == 63, "incorrect value for signature.data[63], expected 63, is %d", check_msg->signature.data[63]); - ck_assert_msg(check_msg->signature.data[64] == 64, "incorrect value for signature.data[64], expected 64, is %d", check_msg->signature.data[64]); - ck_assert_msg(check_msg->signature.data[65] == 65, "incorrect value for signature.data[65], expected 65, is %d", check_msg->signature.data[65]); - ck_assert_msg(check_msg->signature.data[66] == 66, "incorrect value for signature.data[66], expected 66, is %d", check_msg->signature.data[66]); - ck_assert_msg(check_msg->signature.data[67] == 67, "incorrect value for signature.data[67], expected 67, is %d", check_msg->signature.data[67]); - ck_assert_msg(check_msg->signature.data[68] == 68, "incorrect value for signature.data[68], expected 68, is %d", check_msg->signature.data[68]); - ck_assert_msg(check_msg->signature.data[69] == 69, "incorrect value for signature.data[69], expected 69, is %d", check_msg->signature.data[69]); - ck_assert_msg(check_msg->signature.data[70] == 70, "incorrect value for signature.data[70], expected 70, is %d", check_msg->signature.data[70]); - ck_assert_msg(check_msg->signature.data[71] == 71, "incorrect value for signature.data[71], expected 71, is %d", check_msg->signature.data[71]); - ck_assert_msg(check_msg->signature.len == 72, "incorrect value for signature.len, expected 72, is %d", check_msg->signature.len); + ck_assert_msg( + check_msg->corrections_certificate[0] == 20, + "incorrect value for corrections_certificate[0], expected 20, is %d", + check_msg->corrections_certificate[0]); + ck_assert_msg( + check_msg->corrections_certificate[1] == 21, + "incorrect value for corrections_certificate[1], expected 21, is %d", + check_msg->corrections_certificate[1]); + ck_assert_msg( + check_msg->corrections_certificate[2] == 22, + "incorrect value for corrections_certificate[2], expected 22, is %d", + check_msg->corrections_certificate[2]); + ck_assert_msg( + check_msg->corrections_certificate[3] == 23, + "incorrect value for corrections_certificate[3], expected 23, is %d", + check_msg->corrections_certificate[3]); + ck_assert_msg( + check_msg->corrections_certificate[4] == 24, + "incorrect value for corrections_certificate[4], expected 24, is %d", + check_msg->corrections_certificate[4]); + ck_assert_msg( + check_msg->corrections_certificate[5] == 25, + "incorrect value for corrections_certificate[5], expected 25, is %d", + check_msg->corrections_certificate[5]); + ck_assert_msg( + check_msg->corrections_certificate[6] == 26, + "incorrect value for corrections_certificate[6], expected 26, is %d", + check_msg->corrections_certificate[6]); + ck_assert_msg( + check_msg->corrections_certificate[7] == 27, + "incorrect value for corrections_certificate[7], expected 27, is %d", + check_msg->corrections_certificate[7]); + ck_assert_msg( + check_msg->corrections_certificate[8] == 28, + "incorrect value for corrections_certificate[8], expected 28, is %d", + check_msg->corrections_certificate[8]); + ck_assert_msg( + check_msg->corrections_certificate[9] == 29, + "incorrect value for corrections_certificate[9], expected 29, is %d", + check_msg->corrections_certificate[9]); + ck_assert_msg( + check_msg->corrections_certificate[10] == 10, + "incorrect value for corrections_certificate[10], expected 10, is %d", + check_msg->corrections_certificate[10]); + ck_assert_msg( + check_msg->corrections_certificate[11] == 11, + "incorrect value for corrections_certificate[11], expected 11, is %d", + check_msg->corrections_certificate[11]); + ck_assert_msg( + check_msg->corrections_certificate[12] == 12, + "incorrect value for corrections_certificate[12], expected 12, is %d", + check_msg->corrections_certificate[12]); + ck_assert_msg( + check_msg->corrections_certificate[13] == 13, + "incorrect value for corrections_certificate[13], expected 13, is %d", + check_msg->corrections_certificate[13]); + ck_assert_msg( + check_msg->corrections_certificate[14] == 14, + "incorrect value for corrections_certificate[14], expected 14, is %d", + check_msg->corrections_certificate[14]); + ck_assert_msg( + check_msg->corrections_certificate[15] == 15, + "incorrect value for corrections_certificate[15], expected 15, is %d", + check_msg->corrections_certificate[15]); + ck_assert_msg( + check_msg->corrections_certificate[16] == 16, + "incorrect value for corrections_certificate[16], expected 16, is %d", + check_msg->corrections_certificate[16]); + ck_assert_msg( + check_msg->corrections_certificate[17] == 17, + "incorrect value for corrections_certificate[17], expected 17, is %d", + check_msg->corrections_certificate[17]); + ck_assert_msg( + check_msg->corrections_certificate[18] == 18, + "incorrect value for corrections_certificate[18], expected 18, is %d", + check_msg->corrections_certificate[18]); + ck_assert_msg( + check_msg->corrections_certificate[19] == 19, + "incorrect value for corrections_certificate[19], expected 19, is %d", + check_msg->corrections_certificate[19]); + ck_assert_msg(check_msg->expiration.day == 30, + "incorrect value for expiration.day, expected 30, is %d", + check_msg->expiration.day); + ck_assert_msg(check_msg->expiration.hours == 12, + "incorrect value for expiration.hours, expected 12, is %d", + check_msg->expiration.hours); + ck_assert_msg(check_msg->expiration.minutes == 34, + "incorrect value for expiration.minutes, expected 34, is %d", + check_msg->expiration.minutes); + ck_assert_msg(check_msg->expiration.month == 3, + "incorrect value for expiration.month, expected 3, is %d", + check_msg->expiration.month); + ck_assert_msg( + check_msg->expiration.ns == 123456789, + "incorrect value for expiration.ns, expected 123456789, is %d", + check_msg->expiration.ns); + ck_assert_msg(check_msg->expiration.seconds == 59, + "incorrect value for expiration.seconds, expected 59, is %d", + check_msg->expiration.seconds); + ck_assert_msg(check_msg->expiration.year == 2024, + "incorrect value for expiration.year, expected 2024, is %d", + check_msg->expiration.year); + ck_assert_msg( + check_msg->intermediate_certificate[0] == 10, + "incorrect value for intermediate_certificate[0], expected 10, is %d", + check_msg->intermediate_certificate[0]); + ck_assert_msg( + check_msg->intermediate_certificate[1] == 11, + "incorrect value for intermediate_certificate[1], expected 11, is %d", + check_msg->intermediate_certificate[1]); + ck_assert_msg( + check_msg->intermediate_certificate[2] == 12, + "incorrect value for intermediate_certificate[2], expected 12, is %d", + check_msg->intermediate_certificate[2]); + ck_assert_msg( + check_msg->intermediate_certificate[3] == 13, + "incorrect value for intermediate_certificate[3], expected 13, is %d", + check_msg->intermediate_certificate[3]); + ck_assert_msg( + check_msg->intermediate_certificate[4] == 14, + "incorrect value for intermediate_certificate[4], expected 14, is %d", + check_msg->intermediate_certificate[4]); + ck_assert_msg( + check_msg->intermediate_certificate[5] == 15, + "incorrect value for intermediate_certificate[5], expected 15, is %d", + check_msg->intermediate_certificate[5]); + ck_assert_msg( + check_msg->intermediate_certificate[6] == 16, + "incorrect value for intermediate_certificate[6], expected 16, is %d", + check_msg->intermediate_certificate[6]); + ck_assert_msg( + check_msg->intermediate_certificate[7] == 17, + "incorrect value for intermediate_certificate[7], expected 17, is %d", + check_msg->intermediate_certificate[7]); + ck_assert_msg( + check_msg->intermediate_certificate[8] == 18, + "incorrect value for intermediate_certificate[8], expected 18, is %d", + check_msg->intermediate_certificate[8]); + ck_assert_msg( + check_msg->intermediate_certificate[9] == 19, + "incorrect value for intermediate_certificate[9], expected 19, is %d", + check_msg->intermediate_certificate[9]); + ck_assert_msg( + check_msg->intermediate_certificate[10] == 0, + "incorrect value for intermediate_certificate[10], expected 0, is %d", + check_msg->intermediate_certificate[10]); + ck_assert_msg( + check_msg->intermediate_certificate[11] == 1, + "incorrect value for intermediate_certificate[11], expected 1, is %d", + check_msg->intermediate_certificate[11]); + ck_assert_msg( + check_msg->intermediate_certificate[12] == 2, + "incorrect value for intermediate_certificate[12], expected 2, is %d", + check_msg->intermediate_certificate[12]); + ck_assert_msg( + check_msg->intermediate_certificate[13] == 3, + "incorrect value for intermediate_certificate[13], expected 3, is %d", + check_msg->intermediate_certificate[13]); + ck_assert_msg( + check_msg->intermediate_certificate[14] == 4, + "incorrect value for intermediate_certificate[14], expected 4, is %d", + check_msg->intermediate_certificate[14]); + ck_assert_msg( + check_msg->intermediate_certificate[15] == 5, + "incorrect value for intermediate_certificate[15], expected 5, is %d", + check_msg->intermediate_certificate[15]); + ck_assert_msg( + check_msg->intermediate_certificate[16] == 6, + "incorrect value for intermediate_certificate[16], expected 6, is %d", + check_msg->intermediate_certificate[16]); + ck_assert_msg( + check_msg->intermediate_certificate[17] == 7, + "incorrect value for intermediate_certificate[17], expected 7, is %d", + check_msg->intermediate_certificate[17]); + ck_assert_msg( + check_msg->intermediate_certificate[18] == 8, + "incorrect value for intermediate_certificate[18], expected 8, is %d", + check_msg->intermediate_certificate[18]); + ck_assert_msg( + check_msg->intermediate_certificate[19] == 9, + "incorrect value for intermediate_certificate[19], expected 9, is %d", + check_msg->intermediate_certificate[19]); + ck_assert_msg(check_msg->root_certificate[0] == 0, + "incorrect value for root_certificate[0], expected 0, is %d", + check_msg->root_certificate[0]); + ck_assert_msg(check_msg->root_certificate[1] == 1, + "incorrect value for root_certificate[1], expected 1, is %d", + check_msg->root_certificate[1]); + ck_assert_msg(check_msg->root_certificate[2] == 2, + "incorrect value for root_certificate[2], expected 2, is %d", + check_msg->root_certificate[2]); + ck_assert_msg(check_msg->root_certificate[3] == 3, + "incorrect value for root_certificate[3], expected 3, is %d", + check_msg->root_certificate[3]); + ck_assert_msg(check_msg->root_certificate[4] == 4, + "incorrect value for root_certificate[4], expected 4, is %d", + check_msg->root_certificate[4]); + ck_assert_msg(check_msg->root_certificate[5] == 5, + "incorrect value for root_certificate[5], expected 5, is %d", + check_msg->root_certificate[5]); + ck_assert_msg(check_msg->root_certificate[6] == 6, + "incorrect value for root_certificate[6], expected 6, is %d", + check_msg->root_certificate[6]); + ck_assert_msg(check_msg->root_certificate[7] == 7, + "incorrect value for root_certificate[7], expected 7, is %d", + check_msg->root_certificate[7]); + ck_assert_msg(check_msg->root_certificate[8] == 8, + "incorrect value for root_certificate[8], expected 8, is %d", + check_msg->root_certificate[8]); + ck_assert_msg(check_msg->root_certificate[9] == 9, + "incorrect value for root_certificate[9], expected 9, is %d", + check_msg->root_certificate[9]); + ck_assert_msg( + check_msg->root_certificate[10] == 10, + "incorrect value for root_certificate[10], expected 10, is %d", + check_msg->root_certificate[10]); + ck_assert_msg( + check_msg->root_certificate[11] == 11, + "incorrect value for root_certificate[11], expected 11, is %d", + check_msg->root_certificate[11]); + ck_assert_msg( + check_msg->root_certificate[12] == 12, + "incorrect value for root_certificate[12], expected 12, is %d", + check_msg->root_certificate[12]); + ck_assert_msg( + check_msg->root_certificate[13] == 13, + "incorrect value for root_certificate[13], expected 13, is %d", + check_msg->root_certificate[13]); + ck_assert_msg( + check_msg->root_certificate[14] == 14, + "incorrect value for root_certificate[14], expected 14, is %d", + check_msg->root_certificate[14]); + ck_assert_msg( + check_msg->root_certificate[15] == 15, + "incorrect value for root_certificate[15], expected 15, is %d", + check_msg->root_certificate[15]); + ck_assert_msg( + check_msg->root_certificate[16] == 16, + "incorrect value for root_certificate[16], expected 16, is %d", + check_msg->root_certificate[16]); + ck_assert_msg( + check_msg->root_certificate[17] == 17, + "incorrect value for root_certificate[17], expected 17, is %d", + check_msg->root_certificate[17]); + ck_assert_msg( + check_msg->root_certificate[18] == 18, + "incorrect value for root_certificate[18], expected 18, is %d", + check_msg->root_certificate[18]); + ck_assert_msg( + check_msg->root_certificate[19] == 19, + "incorrect value for root_certificate[19], expected 19, is %d", + check_msg->root_certificate[19]); + ck_assert_msg(check_msg->signature.data[0] == 0, + "incorrect value for signature.data[0], expected 0, is %d", + check_msg->signature.data[0]); + ck_assert_msg(check_msg->signature.data[1] == 1, + "incorrect value for signature.data[1], expected 1, is %d", + check_msg->signature.data[1]); + ck_assert_msg(check_msg->signature.data[2] == 2, + "incorrect value for signature.data[2], expected 2, is %d", + check_msg->signature.data[2]); + ck_assert_msg(check_msg->signature.data[3] == 3, + "incorrect value for signature.data[3], expected 3, is %d", + check_msg->signature.data[3]); + ck_assert_msg(check_msg->signature.data[4] == 4, + "incorrect value for signature.data[4], expected 4, is %d", + check_msg->signature.data[4]); + ck_assert_msg(check_msg->signature.data[5] == 5, + "incorrect value for signature.data[5], expected 5, is %d", + check_msg->signature.data[5]); + ck_assert_msg(check_msg->signature.data[6] == 6, + "incorrect value for signature.data[6], expected 6, is %d", + check_msg->signature.data[6]); + ck_assert_msg(check_msg->signature.data[7] == 7, + "incorrect value for signature.data[7], expected 7, is %d", + check_msg->signature.data[7]); + ck_assert_msg(check_msg->signature.data[8] == 8, + "incorrect value for signature.data[8], expected 8, is %d", + check_msg->signature.data[8]); + ck_assert_msg(check_msg->signature.data[9] == 9, + "incorrect value for signature.data[9], expected 9, is %d", + check_msg->signature.data[9]); + ck_assert_msg(check_msg->signature.data[10] == 10, + "incorrect value for signature.data[10], expected 10, is %d", + check_msg->signature.data[10]); + ck_assert_msg(check_msg->signature.data[11] == 11, + "incorrect value for signature.data[11], expected 11, is %d", + check_msg->signature.data[11]); + ck_assert_msg(check_msg->signature.data[12] == 12, + "incorrect value for signature.data[12], expected 12, is %d", + check_msg->signature.data[12]); + ck_assert_msg(check_msg->signature.data[13] == 13, + "incorrect value for signature.data[13], expected 13, is %d", + check_msg->signature.data[13]); + ck_assert_msg(check_msg->signature.data[14] == 14, + "incorrect value for signature.data[14], expected 14, is %d", + check_msg->signature.data[14]); + ck_assert_msg(check_msg->signature.data[15] == 15, + "incorrect value for signature.data[15], expected 15, is %d", + check_msg->signature.data[15]); + ck_assert_msg(check_msg->signature.data[16] == 16, + "incorrect value for signature.data[16], expected 16, is %d", + check_msg->signature.data[16]); + ck_assert_msg(check_msg->signature.data[17] == 17, + "incorrect value for signature.data[17], expected 17, is %d", + check_msg->signature.data[17]); + ck_assert_msg(check_msg->signature.data[18] == 18, + "incorrect value for signature.data[18], expected 18, is %d", + check_msg->signature.data[18]); + ck_assert_msg(check_msg->signature.data[19] == 19, + "incorrect value for signature.data[19], expected 19, is %d", + check_msg->signature.data[19]); + ck_assert_msg(check_msg->signature.data[20] == 20, + "incorrect value for signature.data[20], expected 20, is %d", + check_msg->signature.data[20]); + ck_assert_msg(check_msg->signature.data[21] == 21, + "incorrect value for signature.data[21], expected 21, is %d", + check_msg->signature.data[21]); + ck_assert_msg(check_msg->signature.data[22] == 22, + "incorrect value for signature.data[22], expected 22, is %d", + check_msg->signature.data[22]); + ck_assert_msg(check_msg->signature.data[23] == 23, + "incorrect value for signature.data[23], expected 23, is %d", + check_msg->signature.data[23]); + ck_assert_msg(check_msg->signature.data[24] == 24, + "incorrect value for signature.data[24], expected 24, is %d", + check_msg->signature.data[24]); + ck_assert_msg(check_msg->signature.data[25] == 25, + "incorrect value for signature.data[25], expected 25, is %d", + check_msg->signature.data[25]); + ck_assert_msg(check_msg->signature.data[26] == 26, + "incorrect value for signature.data[26], expected 26, is %d", + check_msg->signature.data[26]); + ck_assert_msg(check_msg->signature.data[27] == 27, + "incorrect value for signature.data[27], expected 27, is %d", + check_msg->signature.data[27]); + ck_assert_msg(check_msg->signature.data[28] == 28, + "incorrect value for signature.data[28], expected 28, is %d", + check_msg->signature.data[28]); + ck_assert_msg(check_msg->signature.data[29] == 29, + "incorrect value for signature.data[29], expected 29, is %d", + check_msg->signature.data[29]); + ck_assert_msg(check_msg->signature.data[30] == 30, + "incorrect value for signature.data[30], expected 30, is %d", + check_msg->signature.data[30]); + ck_assert_msg(check_msg->signature.data[31] == 31, + "incorrect value for signature.data[31], expected 31, is %d", + check_msg->signature.data[31]); + ck_assert_msg(check_msg->signature.data[32] == 32, + "incorrect value for signature.data[32], expected 32, is %d", + check_msg->signature.data[32]); + ck_assert_msg(check_msg->signature.data[33] == 33, + "incorrect value for signature.data[33], expected 33, is %d", + check_msg->signature.data[33]); + ck_assert_msg(check_msg->signature.data[34] == 34, + "incorrect value for signature.data[34], expected 34, is %d", + check_msg->signature.data[34]); + ck_assert_msg(check_msg->signature.data[35] == 35, + "incorrect value for signature.data[35], expected 35, is %d", + check_msg->signature.data[35]); + ck_assert_msg(check_msg->signature.data[36] == 36, + "incorrect value for signature.data[36], expected 36, is %d", + check_msg->signature.data[36]); + ck_assert_msg(check_msg->signature.data[37] == 37, + "incorrect value for signature.data[37], expected 37, is %d", + check_msg->signature.data[37]); + ck_assert_msg(check_msg->signature.data[38] == 38, + "incorrect value for signature.data[38], expected 38, is %d", + check_msg->signature.data[38]); + ck_assert_msg(check_msg->signature.data[39] == 39, + "incorrect value for signature.data[39], expected 39, is %d", + check_msg->signature.data[39]); + ck_assert_msg(check_msg->signature.data[40] == 40, + "incorrect value for signature.data[40], expected 40, is %d", + check_msg->signature.data[40]); + ck_assert_msg(check_msg->signature.data[41] == 41, + "incorrect value for signature.data[41], expected 41, is %d", + check_msg->signature.data[41]); + ck_assert_msg(check_msg->signature.data[42] == 42, + "incorrect value for signature.data[42], expected 42, is %d", + check_msg->signature.data[42]); + ck_assert_msg(check_msg->signature.data[43] == 43, + "incorrect value for signature.data[43], expected 43, is %d", + check_msg->signature.data[43]); + ck_assert_msg(check_msg->signature.data[44] == 44, + "incorrect value for signature.data[44], expected 44, is %d", + check_msg->signature.data[44]); + ck_assert_msg(check_msg->signature.data[45] == 45, + "incorrect value for signature.data[45], expected 45, is %d", + check_msg->signature.data[45]); + ck_assert_msg(check_msg->signature.data[46] == 46, + "incorrect value for signature.data[46], expected 46, is %d", + check_msg->signature.data[46]); + ck_assert_msg(check_msg->signature.data[47] == 47, + "incorrect value for signature.data[47], expected 47, is %d", + check_msg->signature.data[47]); + ck_assert_msg(check_msg->signature.data[48] == 48, + "incorrect value for signature.data[48], expected 48, is %d", + check_msg->signature.data[48]); + ck_assert_msg(check_msg->signature.data[49] == 49, + "incorrect value for signature.data[49], expected 49, is %d", + check_msg->signature.data[49]); + ck_assert_msg(check_msg->signature.data[50] == 50, + "incorrect value for signature.data[50], expected 50, is %d", + check_msg->signature.data[50]); + ck_assert_msg(check_msg->signature.data[51] == 51, + "incorrect value for signature.data[51], expected 51, is %d", + check_msg->signature.data[51]); + ck_assert_msg(check_msg->signature.data[52] == 52, + "incorrect value for signature.data[52], expected 52, is %d", + check_msg->signature.data[52]); + ck_assert_msg(check_msg->signature.data[53] == 53, + "incorrect value for signature.data[53], expected 53, is %d", + check_msg->signature.data[53]); + ck_assert_msg(check_msg->signature.data[54] == 54, + "incorrect value for signature.data[54], expected 54, is %d", + check_msg->signature.data[54]); + ck_assert_msg(check_msg->signature.data[55] == 55, + "incorrect value for signature.data[55], expected 55, is %d", + check_msg->signature.data[55]); + ck_assert_msg(check_msg->signature.data[56] == 56, + "incorrect value for signature.data[56], expected 56, is %d", + check_msg->signature.data[56]); + ck_assert_msg(check_msg->signature.data[57] == 57, + "incorrect value for signature.data[57], expected 57, is %d", + check_msg->signature.data[57]); + ck_assert_msg(check_msg->signature.data[58] == 58, + "incorrect value for signature.data[58], expected 58, is %d", + check_msg->signature.data[58]); + ck_assert_msg(check_msg->signature.data[59] == 59, + "incorrect value for signature.data[59], expected 59, is %d", + check_msg->signature.data[59]); + ck_assert_msg(check_msg->signature.data[60] == 60, + "incorrect value for signature.data[60], expected 60, is %d", + check_msg->signature.data[60]); + ck_assert_msg(check_msg->signature.data[61] == 61, + "incorrect value for signature.data[61], expected 61, is %d", + check_msg->signature.data[61]); + ck_assert_msg(check_msg->signature.data[62] == 62, + "incorrect value for signature.data[62], expected 62, is %d", + check_msg->signature.data[62]); + ck_assert_msg(check_msg->signature.data[63] == 63, + "incorrect value for signature.data[63], expected 63, is %d", + check_msg->signature.data[63]); + ck_assert_msg(check_msg->signature.data[64] == 64, + "incorrect value for signature.data[64], expected 64, is %d", + check_msg->signature.data[64]); + ck_assert_msg(check_msg->signature.data[65] == 65, + "incorrect value for signature.data[65], expected 65, is %d", + check_msg->signature.data[65]); + ck_assert_msg(check_msg->signature.data[66] == 66, + "incorrect value for signature.data[66], expected 66, is %d", + check_msg->signature.data[66]); + ck_assert_msg(check_msg->signature.data[67] == 67, + "incorrect value for signature.data[67], expected 67, is %d", + check_msg->signature.data[67]); + ck_assert_msg(check_msg->signature.data[68] == 68, + "incorrect value for signature.data[68], expected 68, is %d", + check_msg->signature.data[68]); + ck_assert_msg(check_msg->signature.data[69] == 69, + "incorrect value for signature.data[69], expected 69, is %d", + check_msg->signature.data[69]); + ck_assert_msg(check_msg->signature.data[70] == 70, + "incorrect value for signature.data[70], expected 70, is %d", + check_msg->signature.data[70]); + ck_assert_msg(check_msg->signature.data[71] == 71, + "incorrect value for signature.data[71], expected 71, is %d", + check_msg->signature.data[71]); + ck_assert_msg(check_msg->signature.len == 72, + "incorrect value for signature.len, expected 72, is %d", + check_msg->signature.len); } } END_TEST -Suite* legacy_auto_check_sbp_signing_MsgCertificateChain_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_signing_MsgCertificateChain"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_signing_MsgCertificateChain"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_signing_MsgCertificateChain); +Suite *legacy_auto_check_sbp_signing_MsgCertificateChain_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_signing_MsgCertificateChain"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_signing_MsgCertificateChain"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_signing_MsgCertificateChain); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_signing_MsgCertificateChainDep.c b/c/test/legacy/auto_check_sbp_signing_MsgCertificateChainDep.c index 933efb298..a021f47a2 100644 --- a/c/test/legacy/auto_check_sbp_signing_MsgCertificateChainDep.c +++ b/c/test/legacy/auto_check_sbp_signing_MsgCertificateChainDep.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_signing_MsgCertificateChainDep ) -{ +START_TEST(test_legacy_auto_check_sbp_signing_MsgCertificateChainDep) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgCertificateChainDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,30 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgCertificateChainDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xC05, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xC05, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xC05, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xC05, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,12,66,0,135,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,20,21,22,23,24,25,26,27,28,29,10,11,12,13,14,15,16,17,18,19,232,7,3,30,12,34,59,21,205,91,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,112,100, }; + u8 encoded_frame[] = { + 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 232, 7, 3, 30, 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_certificate_chain_dep_t* test_msg = ( msg_certificate_chain_dep_t* )test_msg_storage; + msg_certificate_chain_dep_t *test_msg = + (msg_certificate_chain_dep_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->corrections_certificate) == 0) { // Cope with variable length arrays @@ -770,194 +780,517 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgCertificateChainDep ) test_msg_len += sizeof(test_msg->signature[0]); } test_msg->signature[63] = 7; - sbp_payload_send(&sbp_state, 0xC05, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xC05, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xC05, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_certificate_chain_dep_t* check_msg = ( msg_certificate_chain_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_certificate_chain_dep_t *check_msg = + (msg_certificate_chain_dep_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->corrections_certificate[0] == 20, "incorrect value for corrections_certificate[0], expected 20, is %d", check_msg->corrections_certificate[0]); - ck_assert_msg(check_msg->corrections_certificate[1] == 21, "incorrect value for corrections_certificate[1], expected 21, is %d", check_msg->corrections_certificate[1]); - ck_assert_msg(check_msg->corrections_certificate[2] == 22, "incorrect value for corrections_certificate[2], expected 22, is %d", check_msg->corrections_certificate[2]); - ck_assert_msg(check_msg->corrections_certificate[3] == 23, "incorrect value for corrections_certificate[3], expected 23, is %d", check_msg->corrections_certificate[3]); - ck_assert_msg(check_msg->corrections_certificate[4] == 24, "incorrect value for corrections_certificate[4], expected 24, is %d", check_msg->corrections_certificate[4]); - ck_assert_msg(check_msg->corrections_certificate[5] == 25, "incorrect value for corrections_certificate[5], expected 25, is %d", check_msg->corrections_certificate[5]); - ck_assert_msg(check_msg->corrections_certificate[6] == 26, "incorrect value for corrections_certificate[6], expected 26, is %d", check_msg->corrections_certificate[6]); - ck_assert_msg(check_msg->corrections_certificate[7] == 27, "incorrect value for corrections_certificate[7], expected 27, is %d", check_msg->corrections_certificate[7]); - ck_assert_msg(check_msg->corrections_certificate[8] == 28, "incorrect value for corrections_certificate[8], expected 28, is %d", check_msg->corrections_certificate[8]); - ck_assert_msg(check_msg->corrections_certificate[9] == 29, "incorrect value for corrections_certificate[9], expected 29, is %d", check_msg->corrections_certificate[9]); - ck_assert_msg(check_msg->corrections_certificate[10] == 10, "incorrect value for corrections_certificate[10], expected 10, is %d", check_msg->corrections_certificate[10]); - ck_assert_msg(check_msg->corrections_certificate[11] == 11, "incorrect value for corrections_certificate[11], expected 11, is %d", check_msg->corrections_certificate[11]); - ck_assert_msg(check_msg->corrections_certificate[12] == 12, "incorrect value for corrections_certificate[12], expected 12, is %d", check_msg->corrections_certificate[12]); - ck_assert_msg(check_msg->corrections_certificate[13] == 13, "incorrect value for corrections_certificate[13], expected 13, is %d", check_msg->corrections_certificate[13]); - ck_assert_msg(check_msg->corrections_certificate[14] == 14, "incorrect value for corrections_certificate[14], expected 14, is %d", check_msg->corrections_certificate[14]); - ck_assert_msg(check_msg->corrections_certificate[15] == 15, "incorrect value for corrections_certificate[15], expected 15, is %d", check_msg->corrections_certificate[15]); - ck_assert_msg(check_msg->corrections_certificate[16] == 16, "incorrect value for corrections_certificate[16], expected 16, is %d", check_msg->corrections_certificate[16]); - ck_assert_msg(check_msg->corrections_certificate[17] == 17, "incorrect value for corrections_certificate[17], expected 17, is %d", check_msg->corrections_certificate[17]); - ck_assert_msg(check_msg->corrections_certificate[18] == 18, "incorrect value for corrections_certificate[18], expected 18, is %d", check_msg->corrections_certificate[18]); - ck_assert_msg(check_msg->corrections_certificate[19] == 19, "incorrect value for corrections_certificate[19], expected 19, is %d", check_msg->corrections_certificate[19]); - ck_assert_msg(check_msg->expiration.day == 30, "incorrect value for expiration.day, expected 30, is %d", check_msg->expiration.day); - ck_assert_msg(check_msg->expiration.hours == 12, "incorrect value for expiration.hours, expected 12, is %d", check_msg->expiration.hours); - ck_assert_msg(check_msg->expiration.minutes == 34, "incorrect value for expiration.minutes, expected 34, is %d", check_msg->expiration.minutes); - ck_assert_msg(check_msg->expiration.month == 3, "incorrect value for expiration.month, expected 3, is %d", check_msg->expiration.month); - ck_assert_msg(check_msg->expiration.ns == 123456789, "incorrect value for expiration.ns, expected 123456789, is %d", check_msg->expiration.ns); - ck_assert_msg(check_msg->expiration.seconds == 59, "incorrect value for expiration.seconds, expected 59, is %d", check_msg->expiration.seconds); - ck_assert_msg(check_msg->expiration.year == 2024, "incorrect value for expiration.year, expected 2024, is %d", check_msg->expiration.year); - ck_assert_msg(check_msg->intermediate_certificate[0] == 10, "incorrect value for intermediate_certificate[0], expected 10, is %d", check_msg->intermediate_certificate[0]); - ck_assert_msg(check_msg->intermediate_certificate[1] == 11, "incorrect value for intermediate_certificate[1], expected 11, is %d", check_msg->intermediate_certificate[1]); - ck_assert_msg(check_msg->intermediate_certificate[2] == 12, "incorrect value for intermediate_certificate[2], expected 12, is %d", check_msg->intermediate_certificate[2]); - ck_assert_msg(check_msg->intermediate_certificate[3] == 13, "incorrect value for intermediate_certificate[3], expected 13, is %d", check_msg->intermediate_certificate[3]); - ck_assert_msg(check_msg->intermediate_certificate[4] == 14, "incorrect value for intermediate_certificate[4], expected 14, is %d", check_msg->intermediate_certificate[4]); - ck_assert_msg(check_msg->intermediate_certificate[5] == 15, "incorrect value for intermediate_certificate[5], expected 15, is %d", check_msg->intermediate_certificate[5]); - ck_assert_msg(check_msg->intermediate_certificate[6] == 16, "incorrect value for intermediate_certificate[6], expected 16, is %d", check_msg->intermediate_certificate[6]); - ck_assert_msg(check_msg->intermediate_certificate[7] == 17, "incorrect value for intermediate_certificate[7], expected 17, is %d", check_msg->intermediate_certificate[7]); - ck_assert_msg(check_msg->intermediate_certificate[8] == 18, "incorrect value for intermediate_certificate[8], expected 18, is %d", check_msg->intermediate_certificate[8]); - ck_assert_msg(check_msg->intermediate_certificate[9] == 19, "incorrect value for intermediate_certificate[9], expected 19, is %d", check_msg->intermediate_certificate[9]); - ck_assert_msg(check_msg->intermediate_certificate[10] == 0, "incorrect value for intermediate_certificate[10], expected 0, is %d", check_msg->intermediate_certificate[10]); - ck_assert_msg(check_msg->intermediate_certificate[11] == 1, "incorrect value for intermediate_certificate[11], expected 1, is %d", check_msg->intermediate_certificate[11]); - ck_assert_msg(check_msg->intermediate_certificate[12] == 2, "incorrect value for intermediate_certificate[12], expected 2, is %d", check_msg->intermediate_certificate[12]); - ck_assert_msg(check_msg->intermediate_certificate[13] == 3, "incorrect value for intermediate_certificate[13], expected 3, is %d", check_msg->intermediate_certificate[13]); - ck_assert_msg(check_msg->intermediate_certificate[14] == 4, "incorrect value for intermediate_certificate[14], expected 4, is %d", check_msg->intermediate_certificate[14]); - ck_assert_msg(check_msg->intermediate_certificate[15] == 5, "incorrect value for intermediate_certificate[15], expected 5, is %d", check_msg->intermediate_certificate[15]); - ck_assert_msg(check_msg->intermediate_certificate[16] == 6, "incorrect value for intermediate_certificate[16], expected 6, is %d", check_msg->intermediate_certificate[16]); - ck_assert_msg(check_msg->intermediate_certificate[17] == 7, "incorrect value for intermediate_certificate[17], expected 7, is %d", check_msg->intermediate_certificate[17]); - ck_assert_msg(check_msg->intermediate_certificate[18] == 8, "incorrect value for intermediate_certificate[18], expected 8, is %d", check_msg->intermediate_certificate[18]); - ck_assert_msg(check_msg->intermediate_certificate[19] == 9, "incorrect value for intermediate_certificate[19], expected 9, is %d", check_msg->intermediate_certificate[19]); - ck_assert_msg(check_msg->root_certificate[0] == 0, "incorrect value for root_certificate[0], expected 0, is %d", check_msg->root_certificate[0]); - ck_assert_msg(check_msg->root_certificate[1] == 1, "incorrect value for root_certificate[1], expected 1, is %d", check_msg->root_certificate[1]); - ck_assert_msg(check_msg->root_certificate[2] == 2, "incorrect value for root_certificate[2], expected 2, is %d", check_msg->root_certificate[2]); - ck_assert_msg(check_msg->root_certificate[3] == 3, "incorrect value for root_certificate[3], expected 3, is %d", check_msg->root_certificate[3]); - ck_assert_msg(check_msg->root_certificate[4] == 4, "incorrect value for root_certificate[4], expected 4, is %d", check_msg->root_certificate[4]); - ck_assert_msg(check_msg->root_certificate[5] == 5, "incorrect value for root_certificate[5], expected 5, is %d", check_msg->root_certificate[5]); - ck_assert_msg(check_msg->root_certificate[6] == 6, "incorrect value for root_certificate[6], expected 6, is %d", check_msg->root_certificate[6]); - ck_assert_msg(check_msg->root_certificate[7] == 7, "incorrect value for root_certificate[7], expected 7, is %d", check_msg->root_certificate[7]); - ck_assert_msg(check_msg->root_certificate[8] == 8, "incorrect value for root_certificate[8], expected 8, is %d", check_msg->root_certificate[8]); - ck_assert_msg(check_msg->root_certificate[9] == 9, "incorrect value for root_certificate[9], expected 9, is %d", check_msg->root_certificate[9]); - ck_assert_msg(check_msg->root_certificate[10] == 10, "incorrect value for root_certificate[10], expected 10, is %d", check_msg->root_certificate[10]); - ck_assert_msg(check_msg->root_certificate[11] == 11, "incorrect value for root_certificate[11], expected 11, is %d", check_msg->root_certificate[11]); - ck_assert_msg(check_msg->root_certificate[12] == 12, "incorrect value for root_certificate[12], expected 12, is %d", check_msg->root_certificate[12]); - ck_assert_msg(check_msg->root_certificate[13] == 13, "incorrect value for root_certificate[13], expected 13, is %d", check_msg->root_certificate[13]); - ck_assert_msg(check_msg->root_certificate[14] == 14, "incorrect value for root_certificate[14], expected 14, is %d", check_msg->root_certificate[14]); - ck_assert_msg(check_msg->root_certificate[15] == 15, "incorrect value for root_certificate[15], expected 15, is %d", check_msg->root_certificate[15]); - ck_assert_msg(check_msg->root_certificate[16] == 16, "incorrect value for root_certificate[16], expected 16, is %d", check_msg->root_certificate[16]); - ck_assert_msg(check_msg->root_certificate[17] == 17, "incorrect value for root_certificate[17], expected 17, is %d", check_msg->root_certificate[17]); - ck_assert_msg(check_msg->root_certificate[18] == 18, "incorrect value for root_certificate[18], expected 18, is %d", check_msg->root_certificate[18]); - ck_assert_msg(check_msg->root_certificate[19] == 19, "incorrect value for root_certificate[19], expected 19, is %d", check_msg->root_certificate[19]); - ck_assert_msg(check_msg->signature[0] == 0, "incorrect value for signature[0], expected 0, is %d", check_msg->signature[0]); - ck_assert_msg(check_msg->signature[1] == 1, "incorrect value for signature[1], expected 1, is %d", check_msg->signature[1]); - ck_assert_msg(check_msg->signature[2] == 2, "incorrect value for signature[2], expected 2, is %d", check_msg->signature[2]); - ck_assert_msg(check_msg->signature[3] == 3, "incorrect value for signature[3], expected 3, is %d", check_msg->signature[3]); - ck_assert_msg(check_msg->signature[4] == 4, "incorrect value for signature[4], expected 4, is %d", check_msg->signature[4]); - ck_assert_msg(check_msg->signature[5] == 5, "incorrect value for signature[5], expected 5, is %d", check_msg->signature[5]); - ck_assert_msg(check_msg->signature[6] == 6, "incorrect value for signature[6], expected 6, is %d", check_msg->signature[6]); - ck_assert_msg(check_msg->signature[7] == 7, "incorrect value for signature[7], expected 7, is %d", check_msg->signature[7]); - ck_assert_msg(check_msg->signature[8] == 0, "incorrect value for signature[8], expected 0, is %d", check_msg->signature[8]); - ck_assert_msg(check_msg->signature[9] == 1, "incorrect value for signature[9], expected 1, is %d", check_msg->signature[9]); - ck_assert_msg(check_msg->signature[10] == 2, "incorrect value for signature[10], expected 2, is %d", check_msg->signature[10]); - ck_assert_msg(check_msg->signature[11] == 3, "incorrect value for signature[11], expected 3, is %d", check_msg->signature[11]); - ck_assert_msg(check_msg->signature[12] == 4, "incorrect value for signature[12], expected 4, is %d", check_msg->signature[12]); - ck_assert_msg(check_msg->signature[13] == 5, "incorrect value for signature[13], expected 5, is %d", check_msg->signature[13]); - ck_assert_msg(check_msg->signature[14] == 6, "incorrect value for signature[14], expected 6, is %d", check_msg->signature[14]); - ck_assert_msg(check_msg->signature[15] == 7, "incorrect value for signature[15], expected 7, is %d", check_msg->signature[15]); - ck_assert_msg(check_msg->signature[16] == 0, "incorrect value for signature[16], expected 0, is %d", check_msg->signature[16]); - ck_assert_msg(check_msg->signature[17] == 1, "incorrect value for signature[17], expected 1, is %d", check_msg->signature[17]); - ck_assert_msg(check_msg->signature[18] == 2, "incorrect value for signature[18], expected 2, is %d", check_msg->signature[18]); - ck_assert_msg(check_msg->signature[19] == 3, "incorrect value for signature[19], expected 3, is %d", check_msg->signature[19]); - ck_assert_msg(check_msg->signature[20] == 4, "incorrect value for signature[20], expected 4, is %d", check_msg->signature[20]); - ck_assert_msg(check_msg->signature[21] == 5, "incorrect value for signature[21], expected 5, is %d", check_msg->signature[21]); - ck_assert_msg(check_msg->signature[22] == 6, "incorrect value for signature[22], expected 6, is %d", check_msg->signature[22]); - ck_assert_msg(check_msg->signature[23] == 7, "incorrect value for signature[23], expected 7, is %d", check_msg->signature[23]); - ck_assert_msg(check_msg->signature[24] == 0, "incorrect value for signature[24], expected 0, is %d", check_msg->signature[24]); - ck_assert_msg(check_msg->signature[25] == 1, "incorrect value for signature[25], expected 1, is %d", check_msg->signature[25]); - ck_assert_msg(check_msg->signature[26] == 2, "incorrect value for signature[26], expected 2, is %d", check_msg->signature[26]); - ck_assert_msg(check_msg->signature[27] == 3, "incorrect value for signature[27], expected 3, is %d", check_msg->signature[27]); - ck_assert_msg(check_msg->signature[28] == 4, "incorrect value for signature[28], expected 4, is %d", check_msg->signature[28]); - ck_assert_msg(check_msg->signature[29] == 5, "incorrect value for signature[29], expected 5, is %d", check_msg->signature[29]); - ck_assert_msg(check_msg->signature[30] == 6, "incorrect value for signature[30], expected 6, is %d", check_msg->signature[30]); - ck_assert_msg(check_msg->signature[31] == 7, "incorrect value for signature[31], expected 7, is %d", check_msg->signature[31]); - ck_assert_msg(check_msg->signature[32] == 0, "incorrect value for signature[32], expected 0, is %d", check_msg->signature[32]); - ck_assert_msg(check_msg->signature[33] == 1, "incorrect value for signature[33], expected 1, is %d", check_msg->signature[33]); - ck_assert_msg(check_msg->signature[34] == 2, "incorrect value for signature[34], expected 2, is %d", check_msg->signature[34]); - ck_assert_msg(check_msg->signature[35] == 3, "incorrect value for signature[35], expected 3, is %d", check_msg->signature[35]); - ck_assert_msg(check_msg->signature[36] == 4, "incorrect value for signature[36], expected 4, is %d", check_msg->signature[36]); - ck_assert_msg(check_msg->signature[37] == 5, "incorrect value for signature[37], expected 5, is %d", check_msg->signature[37]); - ck_assert_msg(check_msg->signature[38] == 6, "incorrect value for signature[38], expected 6, is %d", check_msg->signature[38]); - ck_assert_msg(check_msg->signature[39] == 7, "incorrect value for signature[39], expected 7, is %d", check_msg->signature[39]); - ck_assert_msg(check_msg->signature[40] == 0, "incorrect value for signature[40], expected 0, is %d", check_msg->signature[40]); - ck_assert_msg(check_msg->signature[41] == 1, "incorrect value for signature[41], expected 1, is %d", check_msg->signature[41]); - ck_assert_msg(check_msg->signature[42] == 2, "incorrect value for signature[42], expected 2, is %d", check_msg->signature[42]); - ck_assert_msg(check_msg->signature[43] == 3, "incorrect value for signature[43], expected 3, is %d", check_msg->signature[43]); - ck_assert_msg(check_msg->signature[44] == 4, "incorrect value for signature[44], expected 4, is %d", check_msg->signature[44]); - ck_assert_msg(check_msg->signature[45] == 5, "incorrect value for signature[45], expected 5, is %d", check_msg->signature[45]); - ck_assert_msg(check_msg->signature[46] == 6, "incorrect value for signature[46], expected 6, is %d", check_msg->signature[46]); - ck_assert_msg(check_msg->signature[47] == 7, "incorrect value for signature[47], expected 7, is %d", check_msg->signature[47]); - ck_assert_msg(check_msg->signature[48] == 0, "incorrect value for signature[48], expected 0, is %d", check_msg->signature[48]); - ck_assert_msg(check_msg->signature[49] == 1, "incorrect value for signature[49], expected 1, is %d", check_msg->signature[49]); - ck_assert_msg(check_msg->signature[50] == 2, "incorrect value for signature[50], expected 2, is %d", check_msg->signature[50]); - ck_assert_msg(check_msg->signature[51] == 3, "incorrect value for signature[51], expected 3, is %d", check_msg->signature[51]); - ck_assert_msg(check_msg->signature[52] == 4, "incorrect value for signature[52], expected 4, is %d", check_msg->signature[52]); - ck_assert_msg(check_msg->signature[53] == 5, "incorrect value for signature[53], expected 5, is %d", check_msg->signature[53]); - ck_assert_msg(check_msg->signature[54] == 6, "incorrect value for signature[54], expected 6, is %d", check_msg->signature[54]); - ck_assert_msg(check_msg->signature[55] == 7, "incorrect value for signature[55], expected 7, is %d", check_msg->signature[55]); - ck_assert_msg(check_msg->signature[56] == 0, "incorrect value for signature[56], expected 0, is %d", check_msg->signature[56]); - ck_assert_msg(check_msg->signature[57] == 1, "incorrect value for signature[57], expected 1, is %d", check_msg->signature[57]); - ck_assert_msg(check_msg->signature[58] == 2, "incorrect value for signature[58], expected 2, is %d", check_msg->signature[58]); - ck_assert_msg(check_msg->signature[59] == 3, "incorrect value for signature[59], expected 3, is %d", check_msg->signature[59]); - ck_assert_msg(check_msg->signature[60] == 4, "incorrect value for signature[60], expected 4, is %d", check_msg->signature[60]); - ck_assert_msg(check_msg->signature[61] == 5, "incorrect value for signature[61], expected 5, is %d", check_msg->signature[61]); - ck_assert_msg(check_msg->signature[62] == 6, "incorrect value for signature[62], expected 6, is %d", check_msg->signature[62]); - ck_assert_msg(check_msg->signature[63] == 7, "incorrect value for signature[63], expected 7, is %d", check_msg->signature[63]); + ck_assert_msg( + check_msg->corrections_certificate[0] == 20, + "incorrect value for corrections_certificate[0], expected 20, is %d", + check_msg->corrections_certificate[0]); + ck_assert_msg( + check_msg->corrections_certificate[1] == 21, + "incorrect value for corrections_certificate[1], expected 21, is %d", + check_msg->corrections_certificate[1]); + ck_assert_msg( + check_msg->corrections_certificate[2] == 22, + "incorrect value for corrections_certificate[2], expected 22, is %d", + check_msg->corrections_certificate[2]); + ck_assert_msg( + check_msg->corrections_certificate[3] == 23, + "incorrect value for corrections_certificate[3], expected 23, is %d", + check_msg->corrections_certificate[3]); + ck_assert_msg( + check_msg->corrections_certificate[4] == 24, + "incorrect value for corrections_certificate[4], expected 24, is %d", + check_msg->corrections_certificate[4]); + ck_assert_msg( + check_msg->corrections_certificate[5] == 25, + "incorrect value for corrections_certificate[5], expected 25, is %d", + check_msg->corrections_certificate[5]); + ck_assert_msg( + check_msg->corrections_certificate[6] == 26, + "incorrect value for corrections_certificate[6], expected 26, is %d", + check_msg->corrections_certificate[6]); + ck_assert_msg( + check_msg->corrections_certificate[7] == 27, + "incorrect value for corrections_certificate[7], expected 27, is %d", + check_msg->corrections_certificate[7]); + ck_assert_msg( + check_msg->corrections_certificate[8] == 28, + "incorrect value for corrections_certificate[8], expected 28, is %d", + check_msg->corrections_certificate[8]); + ck_assert_msg( + check_msg->corrections_certificate[9] == 29, + "incorrect value for corrections_certificate[9], expected 29, is %d", + check_msg->corrections_certificate[9]); + ck_assert_msg( + check_msg->corrections_certificate[10] == 10, + "incorrect value for corrections_certificate[10], expected 10, is %d", + check_msg->corrections_certificate[10]); + ck_assert_msg( + check_msg->corrections_certificate[11] == 11, + "incorrect value for corrections_certificate[11], expected 11, is %d", + check_msg->corrections_certificate[11]); + ck_assert_msg( + check_msg->corrections_certificate[12] == 12, + "incorrect value for corrections_certificate[12], expected 12, is %d", + check_msg->corrections_certificate[12]); + ck_assert_msg( + check_msg->corrections_certificate[13] == 13, + "incorrect value for corrections_certificate[13], expected 13, is %d", + check_msg->corrections_certificate[13]); + ck_assert_msg( + check_msg->corrections_certificate[14] == 14, + "incorrect value for corrections_certificate[14], expected 14, is %d", + check_msg->corrections_certificate[14]); + ck_assert_msg( + check_msg->corrections_certificate[15] == 15, + "incorrect value for corrections_certificate[15], expected 15, is %d", + check_msg->corrections_certificate[15]); + ck_assert_msg( + check_msg->corrections_certificate[16] == 16, + "incorrect value for corrections_certificate[16], expected 16, is %d", + check_msg->corrections_certificate[16]); + ck_assert_msg( + check_msg->corrections_certificate[17] == 17, + "incorrect value for corrections_certificate[17], expected 17, is %d", + check_msg->corrections_certificate[17]); + ck_assert_msg( + check_msg->corrections_certificate[18] == 18, + "incorrect value for corrections_certificate[18], expected 18, is %d", + check_msg->corrections_certificate[18]); + ck_assert_msg( + check_msg->corrections_certificate[19] == 19, + "incorrect value for corrections_certificate[19], expected 19, is %d", + check_msg->corrections_certificate[19]); + ck_assert_msg(check_msg->expiration.day == 30, + "incorrect value for expiration.day, expected 30, is %d", + check_msg->expiration.day); + ck_assert_msg(check_msg->expiration.hours == 12, + "incorrect value for expiration.hours, expected 12, is %d", + check_msg->expiration.hours); + ck_assert_msg(check_msg->expiration.minutes == 34, + "incorrect value for expiration.minutes, expected 34, is %d", + check_msg->expiration.minutes); + ck_assert_msg(check_msg->expiration.month == 3, + "incorrect value for expiration.month, expected 3, is %d", + check_msg->expiration.month); + ck_assert_msg( + check_msg->expiration.ns == 123456789, + "incorrect value for expiration.ns, expected 123456789, is %d", + check_msg->expiration.ns); + ck_assert_msg(check_msg->expiration.seconds == 59, + "incorrect value for expiration.seconds, expected 59, is %d", + check_msg->expiration.seconds); + ck_assert_msg(check_msg->expiration.year == 2024, + "incorrect value for expiration.year, expected 2024, is %d", + check_msg->expiration.year); + ck_assert_msg( + check_msg->intermediate_certificate[0] == 10, + "incorrect value for intermediate_certificate[0], expected 10, is %d", + check_msg->intermediate_certificate[0]); + ck_assert_msg( + check_msg->intermediate_certificate[1] == 11, + "incorrect value for intermediate_certificate[1], expected 11, is %d", + check_msg->intermediate_certificate[1]); + ck_assert_msg( + check_msg->intermediate_certificate[2] == 12, + "incorrect value for intermediate_certificate[2], expected 12, is %d", + check_msg->intermediate_certificate[2]); + ck_assert_msg( + check_msg->intermediate_certificate[3] == 13, + "incorrect value for intermediate_certificate[3], expected 13, is %d", + check_msg->intermediate_certificate[3]); + ck_assert_msg( + check_msg->intermediate_certificate[4] == 14, + "incorrect value for intermediate_certificate[4], expected 14, is %d", + check_msg->intermediate_certificate[4]); + ck_assert_msg( + check_msg->intermediate_certificate[5] == 15, + "incorrect value for intermediate_certificate[5], expected 15, is %d", + check_msg->intermediate_certificate[5]); + ck_assert_msg( + check_msg->intermediate_certificate[6] == 16, + "incorrect value for intermediate_certificate[6], expected 16, is %d", + check_msg->intermediate_certificate[6]); + ck_assert_msg( + check_msg->intermediate_certificate[7] == 17, + "incorrect value for intermediate_certificate[7], expected 17, is %d", + check_msg->intermediate_certificate[7]); + ck_assert_msg( + check_msg->intermediate_certificate[8] == 18, + "incorrect value for intermediate_certificate[8], expected 18, is %d", + check_msg->intermediate_certificate[8]); + ck_assert_msg( + check_msg->intermediate_certificate[9] == 19, + "incorrect value for intermediate_certificate[9], expected 19, is %d", + check_msg->intermediate_certificate[9]); + ck_assert_msg( + check_msg->intermediate_certificate[10] == 0, + "incorrect value for intermediate_certificate[10], expected 0, is %d", + check_msg->intermediate_certificate[10]); + ck_assert_msg( + check_msg->intermediate_certificate[11] == 1, + "incorrect value for intermediate_certificate[11], expected 1, is %d", + check_msg->intermediate_certificate[11]); + ck_assert_msg( + check_msg->intermediate_certificate[12] == 2, + "incorrect value for intermediate_certificate[12], expected 2, is %d", + check_msg->intermediate_certificate[12]); + ck_assert_msg( + check_msg->intermediate_certificate[13] == 3, + "incorrect value for intermediate_certificate[13], expected 3, is %d", + check_msg->intermediate_certificate[13]); + ck_assert_msg( + check_msg->intermediate_certificate[14] == 4, + "incorrect value for intermediate_certificate[14], expected 4, is %d", + check_msg->intermediate_certificate[14]); + ck_assert_msg( + check_msg->intermediate_certificate[15] == 5, + "incorrect value for intermediate_certificate[15], expected 5, is %d", + check_msg->intermediate_certificate[15]); + ck_assert_msg( + check_msg->intermediate_certificate[16] == 6, + "incorrect value for intermediate_certificate[16], expected 6, is %d", + check_msg->intermediate_certificate[16]); + ck_assert_msg( + check_msg->intermediate_certificate[17] == 7, + "incorrect value for intermediate_certificate[17], expected 7, is %d", + check_msg->intermediate_certificate[17]); + ck_assert_msg( + check_msg->intermediate_certificate[18] == 8, + "incorrect value for intermediate_certificate[18], expected 8, is %d", + check_msg->intermediate_certificate[18]); + ck_assert_msg( + check_msg->intermediate_certificate[19] == 9, + "incorrect value for intermediate_certificate[19], expected 9, is %d", + check_msg->intermediate_certificate[19]); + ck_assert_msg(check_msg->root_certificate[0] == 0, + "incorrect value for root_certificate[0], expected 0, is %d", + check_msg->root_certificate[0]); + ck_assert_msg(check_msg->root_certificate[1] == 1, + "incorrect value for root_certificate[1], expected 1, is %d", + check_msg->root_certificate[1]); + ck_assert_msg(check_msg->root_certificate[2] == 2, + "incorrect value for root_certificate[2], expected 2, is %d", + check_msg->root_certificate[2]); + ck_assert_msg(check_msg->root_certificate[3] == 3, + "incorrect value for root_certificate[3], expected 3, is %d", + check_msg->root_certificate[3]); + ck_assert_msg(check_msg->root_certificate[4] == 4, + "incorrect value for root_certificate[4], expected 4, is %d", + check_msg->root_certificate[4]); + ck_assert_msg(check_msg->root_certificate[5] == 5, + "incorrect value for root_certificate[5], expected 5, is %d", + check_msg->root_certificate[5]); + ck_assert_msg(check_msg->root_certificate[6] == 6, + "incorrect value for root_certificate[6], expected 6, is %d", + check_msg->root_certificate[6]); + ck_assert_msg(check_msg->root_certificate[7] == 7, + "incorrect value for root_certificate[7], expected 7, is %d", + check_msg->root_certificate[7]); + ck_assert_msg(check_msg->root_certificate[8] == 8, + "incorrect value for root_certificate[8], expected 8, is %d", + check_msg->root_certificate[8]); + ck_assert_msg(check_msg->root_certificate[9] == 9, + "incorrect value for root_certificate[9], expected 9, is %d", + check_msg->root_certificate[9]); + ck_assert_msg( + check_msg->root_certificate[10] == 10, + "incorrect value for root_certificate[10], expected 10, is %d", + check_msg->root_certificate[10]); + ck_assert_msg( + check_msg->root_certificate[11] == 11, + "incorrect value for root_certificate[11], expected 11, is %d", + check_msg->root_certificate[11]); + ck_assert_msg( + check_msg->root_certificate[12] == 12, + "incorrect value for root_certificate[12], expected 12, is %d", + check_msg->root_certificate[12]); + ck_assert_msg( + check_msg->root_certificate[13] == 13, + "incorrect value for root_certificate[13], expected 13, is %d", + check_msg->root_certificate[13]); + ck_assert_msg( + check_msg->root_certificate[14] == 14, + "incorrect value for root_certificate[14], expected 14, is %d", + check_msg->root_certificate[14]); + ck_assert_msg( + check_msg->root_certificate[15] == 15, + "incorrect value for root_certificate[15], expected 15, is %d", + check_msg->root_certificate[15]); + ck_assert_msg( + check_msg->root_certificate[16] == 16, + "incorrect value for root_certificate[16], expected 16, is %d", + check_msg->root_certificate[16]); + ck_assert_msg( + check_msg->root_certificate[17] == 17, + "incorrect value for root_certificate[17], expected 17, is %d", + check_msg->root_certificate[17]); + ck_assert_msg( + check_msg->root_certificate[18] == 18, + "incorrect value for root_certificate[18], expected 18, is %d", + check_msg->root_certificate[18]); + ck_assert_msg( + check_msg->root_certificate[19] == 19, + "incorrect value for root_certificate[19], expected 19, is %d", + check_msg->root_certificate[19]); + ck_assert_msg(check_msg->signature[0] == 0, + "incorrect value for signature[0], expected 0, is %d", + check_msg->signature[0]); + ck_assert_msg(check_msg->signature[1] == 1, + "incorrect value for signature[1], expected 1, is %d", + check_msg->signature[1]); + ck_assert_msg(check_msg->signature[2] == 2, + "incorrect value for signature[2], expected 2, is %d", + check_msg->signature[2]); + ck_assert_msg(check_msg->signature[3] == 3, + "incorrect value for signature[3], expected 3, is %d", + check_msg->signature[3]); + ck_assert_msg(check_msg->signature[4] == 4, + "incorrect value for signature[4], expected 4, is %d", + check_msg->signature[4]); + ck_assert_msg(check_msg->signature[5] == 5, + "incorrect value for signature[5], expected 5, is %d", + check_msg->signature[5]); + ck_assert_msg(check_msg->signature[6] == 6, + "incorrect value for signature[6], expected 6, is %d", + check_msg->signature[6]); + ck_assert_msg(check_msg->signature[7] == 7, + "incorrect value for signature[7], expected 7, is %d", + check_msg->signature[7]); + ck_assert_msg(check_msg->signature[8] == 0, + "incorrect value for signature[8], expected 0, is %d", + check_msg->signature[8]); + ck_assert_msg(check_msg->signature[9] == 1, + "incorrect value for signature[9], expected 1, is %d", + check_msg->signature[9]); + ck_assert_msg(check_msg->signature[10] == 2, + "incorrect value for signature[10], expected 2, is %d", + check_msg->signature[10]); + ck_assert_msg(check_msg->signature[11] == 3, + "incorrect value for signature[11], expected 3, is %d", + check_msg->signature[11]); + ck_assert_msg(check_msg->signature[12] == 4, + "incorrect value for signature[12], expected 4, is %d", + check_msg->signature[12]); + ck_assert_msg(check_msg->signature[13] == 5, + "incorrect value for signature[13], expected 5, is %d", + check_msg->signature[13]); + ck_assert_msg(check_msg->signature[14] == 6, + "incorrect value for signature[14], expected 6, is %d", + check_msg->signature[14]); + ck_assert_msg(check_msg->signature[15] == 7, + "incorrect value for signature[15], expected 7, is %d", + check_msg->signature[15]); + ck_assert_msg(check_msg->signature[16] == 0, + "incorrect value for signature[16], expected 0, is %d", + check_msg->signature[16]); + ck_assert_msg(check_msg->signature[17] == 1, + "incorrect value for signature[17], expected 1, is %d", + check_msg->signature[17]); + ck_assert_msg(check_msg->signature[18] == 2, + "incorrect value for signature[18], expected 2, is %d", + check_msg->signature[18]); + ck_assert_msg(check_msg->signature[19] == 3, + "incorrect value for signature[19], expected 3, is %d", + check_msg->signature[19]); + ck_assert_msg(check_msg->signature[20] == 4, + "incorrect value for signature[20], expected 4, is %d", + check_msg->signature[20]); + ck_assert_msg(check_msg->signature[21] == 5, + "incorrect value for signature[21], expected 5, is %d", + check_msg->signature[21]); + ck_assert_msg(check_msg->signature[22] == 6, + "incorrect value for signature[22], expected 6, is %d", + check_msg->signature[22]); + ck_assert_msg(check_msg->signature[23] == 7, + "incorrect value for signature[23], expected 7, is %d", + check_msg->signature[23]); + ck_assert_msg(check_msg->signature[24] == 0, + "incorrect value for signature[24], expected 0, is %d", + check_msg->signature[24]); + ck_assert_msg(check_msg->signature[25] == 1, + "incorrect value for signature[25], expected 1, is %d", + check_msg->signature[25]); + ck_assert_msg(check_msg->signature[26] == 2, + "incorrect value for signature[26], expected 2, is %d", + check_msg->signature[26]); + ck_assert_msg(check_msg->signature[27] == 3, + "incorrect value for signature[27], expected 3, is %d", + check_msg->signature[27]); + ck_assert_msg(check_msg->signature[28] == 4, + "incorrect value for signature[28], expected 4, is %d", + check_msg->signature[28]); + ck_assert_msg(check_msg->signature[29] == 5, + "incorrect value for signature[29], expected 5, is %d", + check_msg->signature[29]); + ck_assert_msg(check_msg->signature[30] == 6, + "incorrect value for signature[30], expected 6, is %d", + check_msg->signature[30]); + ck_assert_msg(check_msg->signature[31] == 7, + "incorrect value for signature[31], expected 7, is %d", + check_msg->signature[31]); + ck_assert_msg(check_msg->signature[32] == 0, + "incorrect value for signature[32], expected 0, is %d", + check_msg->signature[32]); + ck_assert_msg(check_msg->signature[33] == 1, + "incorrect value for signature[33], expected 1, is %d", + check_msg->signature[33]); + ck_assert_msg(check_msg->signature[34] == 2, + "incorrect value for signature[34], expected 2, is %d", + check_msg->signature[34]); + ck_assert_msg(check_msg->signature[35] == 3, + "incorrect value for signature[35], expected 3, is %d", + check_msg->signature[35]); + ck_assert_msg(check_msg->signature[36] == 4, + "incorrect value for signature[36], expected 4, is %d", + check_msg->signature[36]); + ck_assert_msg(check_msg->signature[37] == 5, + "incorrect value for signature[37], expected 5, is %d", + check_msg->signature[37]); + ck_assert_msg(check_msg->signature[38] == 6, + "incorrect value for signature[38], expected 6, is %d", + check_msg->signature[38]); + ck_assert_msg(check_msg->signature[39] == 7, + "incorrect value for signature[39], expected 7, is %d", + check_msg->signature[39]); + ck_assert_msg(check_msg->signature[40] == 0, + "incorrect value for signature[40], expected 0, is %d", + check_msg->signature[40]); + ck_assert_msg(check_msg->signature[41] == 1, + "incorrect value for signature[41], expected 1, is %d", + check_msg->signature[41]); + ck_assert_msg(check_msg->signature[42] == 2, + "incorrect value for signature[42], expected 2, is %d", + check_msg->signature[42]); + ck_assert_msg(check_msg->signature[43] == 3, + "incorrect value for signature[43], expected 3, is %d", + check_msg->signature[43]); + ck_assert_msg(check_msg->signature[44] == 4, + "incorrect value for signature[44], expected 4, is %d", + check_msg->signature[44]); + ck_assert_msg(check_msg->signature[45] == 5, + "incorrect value for signature[45], expected 5, is %d", + check_msg->signature[45]); + ck_assert_msg(check_msg->signature[46] == 6, + "incorrect value for signature[46], expected 6, is %d", + check_msg->signature[46]); + ck_assert_msg(check_msg->signature[47] == 7, + "incorrect value for signature[47], expected 7, is %d", + check_msg->signature[47]); + ck_assert_msg(check_msg->signature[48] == 0, + "incorrect value for signature[48], expected 0, is %d", + check_msg->signature[48]); + ck_assert_msg(check_msg->signature[49] == 1, + "incorrect value for signature[49], expected 1, is %d", + check_msg->signature[49]); + ck_assert_msg(check_msg->signature[50] == 2, + "incorrect value for signature[50], expected 2, is %d", + check_msg->signature[50]); + ck_assert_msg(check_msg->signature[51] == 3, + "incorrect value for signature[51], expected 3, is %d", + check_msg->signature[51]); + ck_assert_msg(check_msg->signature[52] == 4, + "incorrect value for signature[52], expected 4, is %d", + check_msg->signature[52]); + ck_assert_msg(check_msg->signature[53] == 5, + "incorrect value for signature[53], expected 5, is %d", + check_msg->signature[53]); + ck_assert_msg(check_msg->signature[54] == 6, + "incorrect value for signature[54], expected 6, is %d", + check_msg->signature[54]); + ck_assert_msg(check_msg->signature[55] == 7, + "incorrect value for signature[55], expected 7, is %d", + check_msg->signature[55]); + ck_assert_msg(check_msg->signature[56] == 0, + "incorrect value for signature[56], expected 0, is %d", + check_msg->signature[56]); + ck_assert_msg(check_msg->signature[57] == 1, + "incorrect value for signature[57], expected 1, is %d", + check_msg->signature[57]); + ck_assert_msg(check_msg->signature[58] == 2, + "incorrect value for signature[58], expected 2, is %d", + check_msg->signature[58]); + ck_assert_msg(check_msg->signature[59] == 3, + "incorrect value for signature[59], expected 3, is %d", + check_msg->signature[59]); + ck_assert_msg(check_msg->signature[60] == 4, + "incorrect value for signature[60], expected 4, is %d", + check_msg->signature[60]); + ck_assert_msg(check_msg->signature[61] == 5, + "incorrect value for signature[61], expected 5, is %d", + check_msg->signature[61]); + ck_assert_msg(check_msg->signature[62] == 6, + "incorrect value for signature[62], expected 6, is %d", + check_msg->signature[62]); + ck_assert_msg(check_msg->signature[63] == 7, + "incorrect value for signature[63], expected 7, is %d", + check_msg->signature[63]); } } END_TEST -Suite* legacy_auto_check_sbp_signing_MsgCertificateChainDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_signing_MsgCertificateChainDep"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_signing_MsgCertificateChainDep"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_signing_MsgCertificateChainDep); +Suite *legacy_auto_check_sbp_signing_MsgCertificateChainDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_signing_MsgCertificateChainDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_signing_MsgCertificateChainDep"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_signing_MsgCertificateChainDep); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_signing_MsgEcdsaCertificate.c b/c/test/legacy/auto_check_sbp_signing_MsgEcdsaCertificate.c index 6b8aa5978..b67abacee 100644 --- a/c/test/legacy/auto_check_sbp_signing_MsgEcdsaCertificate.c +++ b/c/test/legacy/auto_check_sbp_signing_MsgEcdsaCertificate.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaCertificate.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaCertificate.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaCertificate ) -{ +START_TEST(test_legacy_auto_check_sbp_signing_MsgEcdsaCertificate) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaCertificate ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,40 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaCertificate ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xC04, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xC04, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xC04, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xC04, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,12,66,0,253,48,10,11,12,13,2,180,160,116,77,243,28,173,36,86,33,8,31,120,73,64,169,148,224,57,95,17,40,213,92,195,146,235,228,177,101,82,182,25,172,170,250,236,7,119,4,201,10,14,208,47,126,49,210,174,75,221,203,24,66,52,35,26,30,140,111,246,39,226,205,198,178,196,5,81,9,44,164,163,214,138,123,76,74,237,121,13,137,186,97,193,189,200,124,69,115,230,159,185,158,51,12,225,65,192,105,56,41,85,133,19,217,166,48,139,131,96,216,98,147,132,234,167,248,247,32,239,194,188,254,114,117,83,25,251,191,104,240,118,68,42,93,18,16,37,232,99,179,23,90,94,136,6,125,91,255,15,71,43,46,25,252,229,80,143,58,241,11,62,181,155,53,153,149,152,227,150,87,112,165,2,128,231,25,157,244,204,108,253,127,122,145,113,162,197,171,199,54,184,222,206,67,144,78,187,207,60,211,141,135,106,220,79,183,245,21,161,168,34,129,50,176,1,218,20,130,59,249,109,219,0,100,103,55,29,242,110,154,190,233,142,45,61,215,202,238,88,209,70,63,151,27,102,219,30, }; + u8 encoded_frame[] = { + 85, 4, 12, 66, 0, 253, 48, 10, 11, 12, 13, 2, 180, 160, + 116, 77, 243, 28, 173, 36, 86, 33, 8, 31, 120, 73, 64, 169, + 148, 224, 57, 95, 17, 40, 213, 92, 195, 146, 235, 228, 177, 101, + 82, 182, 25, 172, 170, 250, 236, 7, 119, 4, 201, 10, 14, 208, + 47, 126, 49, 210, 174, 75, 221, 203, 24, 66, 52, 35, 26, 30, + 140, 111, 246, 39, 226, 205, 198, 178, 196, 5, 81, 9, 44, 164, + 163, 214, 138, 123, 76, 74, 237, 121, 13, 137, 186, 97, 193, 189, + 200, 124, 69, 115, 230, 159, 185, 158, 51, 12, 225, 65, 192, 105, + 56, 41, 85, 133, 19, 217, 166, 48, 139, 131, 96, 216, 98, 147, + 132, 234, 167, 248, 247, 32, 239, 194, 188, 254, 114, 117, 83, 25, + 251, 191, 104, 240, 118, 68, 42, 93, 18, 16, 37, 232, 99, 179, + 23, 90, 94, 136, 6, 125, 91, 255, 15, 71, 43, 46, 25, 252, + 229, 80, 143, 58, 241, 11, 62, 181, 155, 53, 153, 149, 152, 227, + 150, 87, 112, 165, 2, 128, 231, 25, 157, 244, 204, 108, 253, 127, + 122, 145, 113, 162, 197, 171, 199, 54, 184, 222, 206, 67, 144, 78, + 187, 207, 60, 211, 141, 135, 106, 220, 79, 183, 245, 21, 161, 168, + 34, 129, 50, 176, 1, 218, 20, 130, 59, 249, 109, 219, 0, 100, + 103, 55, 29, 242, 110, 154, 190, 233, 142, 45, 61, 215, 202, 238, + 88, 209, 70, 63, 151, 27, 102, 219, 30, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ecdsa_certificate_t* test_msg = ( msg_ecdsa_certificate_t* )test_msg_storage; + msg_ecdsa_certificate_t *test_msg = + (msg_ecdsa_certificate_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->certificate_bytes) == 0) { // Cope with variable length arrays @@ -1400,316 +1420,1079 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaCertificate ) test_msg->certificate_id[3] = 13; test_msg->flags = 2; test_msg->n_msg = 48; - sbp_payload_send(&sbp_state, 0xC04, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xC04, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xC04, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ecdsa_certificate_t* check_msg = ( msg_ecdsa_certificate_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ecdsa_certificate_t *check_msg = + (msg_ecdsa_certificate_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->certificate_bytes[0] == 180, "incorrect value for certificate_bytes[0], expected 180, is %d", check_msg->certificate_bytes[0]); - ck_assert_msg(check_msg->certificate_bytes[1] == 160, "incorrect value for certificate_bytes[1], expected 160, is %d", check_msg->certificate_bytes[1]); - ck_assert_msg(check_msg->certificate_bytes[2] == 116, "incorrect value for certificate_bytes[2], expected 116, is %d", check_msg->certificate_bytes[2]); - ck_assert_msg(check_msg->certificate_bytes[3] == 77, "incorrect value for certificate_bytes[3], expected 77, is %d", check_msg->certificate_bytes[3]); - ck_assert_msg(check_msg->certificate_bytes[4] == 243, "incorrect value for certificate_bytes[4], expected 243, is %d", check_msg->certificate_bytes[4]); - ck_assert_msg(check_msg->certificate_bytes[5] == 28, "incorrect value for certificate_bytes[5], expected 28, is %d", check_msg->certificate_bytes[5]); - ck_assert_msg(check_msg->certificate_bytes[6] == 173, "incorrect value for certificate_bytes[6], expected 173, is %d", check_msg->certificate_bytes[6]); - ck_assert_msg(check_msg->certificate_bytes[7] == 36, "incorrect value for certificate_bytes[7], expected 36, is %d", check_msg->certificate_bytes[7]); - ck_assert_msg(check_msg->certificate_bytes[8] == 86, "incorrect value for certificate_bytes[8], expected 86, is %d", check_msg->certificate_bytes[8]); - ck_assert_msg(check_msg->certificate_bytes[9] == 33, "incorrect value for certificate_bytes[9], expected 33, is %d", check_msg->certificate_bytes[9]); - ck_assert_msg(check_msg->certificate_bytes[10] == 8, "incorrect value for certificate_bytes[10], expected 8, is %d", check_msg->certificate_bytes[10]); - ck_assert_msg(check_msg->certificate_bytes[11] == 31, "incorrect value for certificate_bytes[11], expected 31, is %d", check_msg->certificate_bytes[11]); - ck_assert_msg(check_msg->certificate_bytes[12] == 120, "incorrect value for certificate_bytes[12], expected 120, is %d", check_msg->certificate_bytes[12]); - ck_assert_msg(check_msg->certificate_bytes[13] == 73, "incorrect value for certificate_bytes[13], expected 73, is %d", check_msg->certificate_bytes[13]); - ck_assert_msg(check_msg->certificate_bytes[14] == 64, "incorrect value for certificate_bytes[14], expected 64, is %d", check_msg->certificate_bytes[14]); - ck_assert_msg(check_msg->certificate_bytes[15] == 169, "incorrect value for certificate_bytes[15], expected 169, is %d", check_msg->certificate_bytes[15]); - ck_assert_msg(check_msg->certificate_bytes[16] == 148, "incorrect value for certificate_bytes[16], expected 148, is %d", check_msg->certificate_bytes[16]); - ck_assert_msg(check_msg->certificate_bytes[17] == 224, "incorrect value for certificate_bytes[17], expected 224, is %d", check_msg->certificate_bytes[17]); - ck_assert_msg(check_msg->certificate_bytes[18] == 57, "incorrect value for certificate_bytes[18], expected 57, is %d", check_msg->certificate_bytes[18]); - ck_assert_msg(check_msg->certificate_bytes[19] == 95, "incorrect value for certificate_bytes[19], expected 95, is %d", check_msg->certificate_bytes[19]); - ck_assert_msg(check_msg->certificate_bytes[20] == 17, "incorrect value for certificate_bytes[20], expected 17, is %d", check_msg->certificate_bytes[20]); - ck_assert_msg(check_msg->certificate_bytes[21] == 40, "incorrect value for certificate_bytes[21], expected 40, is %d", check_msg->certificate_bytes[21]); - ck_assert_msg(check_msg->certificate_bytes[22] == 213, "incorrect value for certificate_bytes[22], expected 213, is %d", check_msg->certificate_bytes[22]); - ck_assert_msg(check_msg->certificate_bytes[23] == 92, "incorrect value for certificate_bytes[23], expected 92, is %d", check_msg->certificate_bytes[23]); - ck_assert_msg(check_msg->certificate_bytes[24] == 195, "incorrect value for certificate_bytes[24], expected 195, is %d", check_msg->certificate_bytes[24]); - ck_assert_msg(check_msg->certificate_bytes[25] == 146, "incorrect value for certificate_bytes[25], expected 146, is %d", check_msg->certificate_bytes[25]); - ck_assert_msg(check_msg->certificate_bytes[26] == 235, "incorrect value for certificate_bytes[26], expected 235, is %d", check_msg->certificate_bytes[26]); - ck_assert_msg(check_msg->certificate_bytes[27] == 228, "incorrect value for certificate_bytes[27], expected 228, is %d", check_msg->certificate_bytes[27]); - ck_assert_msg(check_msg->certificate_bytes[28] == 177, "incorrect value for certificate_bytes[28], expected 177, is %d", check_msg->certificate_bytes[28]); - ck_assert_msg(check_msg->certificate_bytes[29] == 101, "incorrect value for certificate_bytes[29], expected 101, is %d", check_msg->certificate_bytes[29]); - ck_assert_msg(check_msg->certificate_bytes[30] == 82, "incorrect value for certificate_bytes[30], expected 82, is %d", check_msg->certificate_bytes[30]); - ck_assert_msg(check_msg->certificate_bytes[31] == 182, "incorrect value for certificate_bytes[31], expected 182, is %d", check_msg->certificate_bytes[31]); - ck_assert_msg(check_msg->certificate_bytes[32] == 25, "incorrect value for certificate_bytes[32], expected 25, is %d", check_msg->certificate_bytes[32]); - ck_assert_msg(check_msg->certificate_bytes[33] == 172, "incorrect value for certificate_bytes[33], expected 172, is %d", check_msg->certificate_bytes[33]); - ck_assert_msg(check_msg->certificate_bytes[34] == 170, "incorrect value for certificate_bytes[34], expected 170, is %d", check_msg->certificate_bytes[34]); - ck_assert_msg(check_msg->certificate_bytes[35] == 250, "incorrect value for certificate_bytes[35], expected 250, is %d", check_msg->certificate_bytes[35]); - ck_assert_msg(check_msg->certificate_bytes[36] == 236, "incorrect value for certificate_bytes[36], expected 236, is %d", check_msg->certificate_bytes[36]); - ck_assert_msg(check_msg->certificate_bytes[37] == 7, "incorrect value for certificate_bytes[37], expected 7, is %d", check_msg->certificate_bytes[37]); - ck_assert_msg(check_msg->certificate_bytes[38] == 119, "incorrect value for certificate_bytes[38], expected 119, is %d", check_msg->certificate_bytes[38]); - ck_assert_msg(check_msg->certificate_bytes[39] == 4, "incorrect value for certificate_bytes[39], expected 4, is %d", check_msg->certificate_bytes[39]); - ck_assert_msg(check_msg->certificate_bytes[40] == 201, "incorrect value for certificate_bytes[40], expected 201, is %d", check_msg->certificate_bytes[40]); - ck_assert_msg(check_msg->certificate_bytes[41] == 10, "incorrect value for certificate_bytes[41], expected 10, is %d", check_msg->certificate_bytes[41]); - ck_assert_msg(check_msg->certificate_bytes[42] == 14, "incorrect value for certificate_bytes[42], expected 14, is %d", check_msg->certificate_bytes[42]); - ck_assert_msg(check_msg->certificate_bytes[43] == 208, "incorrect value for certificate_bytes[43], expected 208, is %d", check_msg->certificate_bytes[43]); - ck_assert_msg(check_msg->certificate_bytes[44] == 47, "incorrect value for certificate_bytes[44], expected 47, is %d", check_msg->certificate_bytes[44]); - ck_assert_msg(check_msg->certificate_bytes[45] == 126, "incorrect value for certificate_bytes[45], expected 126, is %d", check_msg->certificate_bytes[45]); - ck_assert_msg(check_msg->certificate_bytes[46] == 49, "incorrect value for certificate_bytes[46], expected 49, is %d", check_msg->certificate_bytes[46]); - ck_assert_msg(check_msg->certificate_bytes[47] == 210, "incorrect value for certificate_bytes[47], expected 210, is %d", check_msg->certificate_bytes[47]); - ck_assert_msg(check_msg->certificate_bytes[48] == 174, "incorrect value for certificate_bytes[48], expected 174, is %d", check_msg->certificate_bytes[48]); - ck_assert_msg(check_msg->certificate_bytes[49] == 75, "incorrect value for certificate_bytes[49], expected 75, is %d", check_msg->certificate_bytes[49]); - ck_assert_msg(check_msg->certificate_bytes[50] == 221, "incorrect value for certificate_bytes[50], expected 221, is %d", check_msg->certificate_bytes[50]); - ck_assert_msg(check_msg->certificate_bytes[51] == 203, "incorrect value for certificate_bytes[51], expected 203, is %d", check_msg->certificate_bytes[51]); - ck_assert_msg(check_msg->certificate_bytes[52] == 24, "incorrect value for certificate_bytes[52], expected 24, is %d", check_msg->certificate_bytes[52]); - ck_assert_msg(check_msg->certificate_bytes[53] == 66, "incorrect value for certificate_bytes[53], expected 66, is %d", check_msg->certificate_bytes[53]); - ck_assert_msg(check_msg->certificate_bytes[54] == 52, "incorrect value for certificate_bytes[54], expected 52, is %d", check_msg->certificate_bytes[54]); - ck_assert_msg(check_msg->certificate_bytes[55] == 35, "incorrect value for certificate_bytes[55], expected 35, is %d", check_msg->certificate_bytes[55]); - ck_assert_msg(check_msg->certificate_bytes[56] == 26, "incorrect value for certificate_bytes[56], expected 26, is %d", check_msg->certificate_bytes[56]); - ck_assert_msg(check_msg->certificate_bytes[57] == 30, "incorrect value for certificate_bytes[57], expected 30, is %d", check_msg->certificate_bytes[57]); - ck_assert_msg(check_msg->certificate_bytes[58] == 140, "incorrect value for certificate_bytes[58], expected 140, is %d", check_msg->certificate_bytes[58]); - ck_assert_msg(check_msg->certificate_bytes[59] == 111, "incorrect value for certificate_bytes[59], expected 111, is %d", check_msg->certificate_bytes[59]); - ck_assert_msg(check_msg->certificate_bytes[60] == 246, "incorrect value for certificate_bytes[60], expected 246, is %d", check_msg->certificate_bytes[60]); - ck_assert_msg(check_msg->certificate_bytes[61] == 39, "incorrect value for certificate_bytes[61], expected 39, is %d", check_msg->certificate_bytes[61]); - ck_assert_msg(check_msg->certificate_bytes[62] == 226, "incorrect value for certificate_bytes[62], expected 226, is %d", check_msg->certificate_bytes[62]); - ck_assert_msg(check_msg->certificate_bytes[63] == 205, "incorrect value for certificate_bytes[63], expected 205, is %d", check_msg->certificate_bytes[63]); - ck_assert_msg(check_msg->certificate_bytes[64] == 198, "incorrect value for certificate_bytes[64], expected 198, is %d", check_msg->certificate_bytes[64]); - ck_assert_msg(check_msg->certificate_bytes[65] == 178, "incorrect value for certificate_bytes[65], expected 178, is %d", check_msg->certificate_bytes[65]); - ck_assert_msg(check_msg->certificate_bytes[66] == 196, "incorrect value for certificate_bytes[66], expected 196, is %d", check_msg->certificate_bytes[66]); - ck_assert_msg(check_msg->certificate_bytes[67] == 5, "incorrect value for certificate_bytes[67], expected 5, is %d", check_msg->certificate_bytes[67]); - ck_assert_msg(check_msg->certificate_bytes[68] == 81, "incorrect value for certificate_bytes[68], expected 81, is %d", check_msg->certificate_bytes[68]); - ck_assert_msg(check_msg->certificate_bytes[69] == 9, "incorrect value for certificate_bytes[69], expected 9, is %d", check_msg->certificate_bytes[69]); - ck_assert_msg(check_msg->certificate_bytes[70] == 44, "incorrect value for certificate_bytes[70], expected 44, is %d", check_msg->certificate_bytes[70]); - ck_assert_msg(check_msg->certificate_bytes[71] == 164, "incorrect value for certificate_bytes[71], expected 164, is %d", check_msg->certificate_bytes[71]); - ck_assert_msg(check_msg->certificate_bytes[72] == 163, "incorrect value for certificate_bytes[72], expected 163, is %d", check_msg->certificate_bytes[72]); - ck_assert_msg(check_msg->certificate_bytes[73] == 214, "incorrect value for certificate_bytes[73], expected 214, is %d", check_msg->certificate_bytes[73]); - ck_assert_msg(check_msg->certificate_bytes[74] == 138, "incorrect value for certificate_bytes[74], expected 138, is %d", check_msg->certificate_bytes[74]); - ck_assert_msg(check_msg->certificate_bytes[75] == 123, "incorrect value for certificate_bytes[75], expected 123, is %d", check_msg->certificate_bytes[75]); - ck_assert_msg(check_msg->certificate_bytes[76] == 76, "incorrect value for certificate_bytes[76], expected 76, is %d", check_msg->certificate_bytes[76]); - ck_assert_msg(check_msg->certificate_bytes[77] == 74, "incorrect value for certificate_bytes[77], expected 74, is %d", check_msg->certificate_bytes[77]); - ck_assert_msg(check_msg->certificate_bytes[78] == 237, "incorrect value for certificate_bytes[78], expected 237, is %d", check_msg->certificate_bytes[78]); - ck_assert_msg(check_msg->certificate_bytes[79] == 121, "incorrect value for certificate_bytes[79], expected 121, is %d", check_msg->certificate_bytes[79]); - ck_assert_msg(check_msg->certificate_bytes[80] == 13, "incorrect value for certificate_bytes[80], expected 13, is %d", check_msg->certificate_bytes[80]); - ck_assert_msg(check_msg->certificate_bytes[81] == 137, "incorrect value for certificate_bytes[81], expected 137, is %d", check_msg->certificate_bytes[81]); - ck_assert_msg(check_msg->certificate_bytes[82] == 186, "incorrect value for certificate_bytes[82], expected 186, is %d", check_msg->certificate_bytes[82]); - ck_assert_msg(check_msg->certificate_bytes[83] == 97, "incorrect value for certificate_bytes[83], expected 97, is %d", check_msg->certificate_bytes[83]); - ck_assert_msg(check_msg->certificate_bytes[84] == 193, "incorrect value for certificate_bytes[84], expected 193, is %d", check_msg->certificate_bytes[84]); - ck_assert_msg(check_msg->certificate_bytes[85] == 189, "incorrect value for certificate_bytes[85], expected 189, is %d", check_msg->certificate_bytes[85]); - ck_assert_msg(check_msg->certificate_bytes[86] == 200, "incorrect value for certificate_bytes[86], expected 200, is %d", check_msg->certificate_bytes[86]); - ck_assert_msg(check_msg->certificate_bytes[87] == 124, "incorrect value for certificate_bytes[87], expected 124, is %d", check_msg->certificate_bytes[87]); - ck_assert_msg(check_msg->certificate_bytes[88] == 69, "incorrect value for certificate_bytes[88], expected 69, is %d", check_msg->certificate_bytes[88]); - ck_assert_msg(check_msg->certificate_bytes[89] == 115, "incorrect value for certificate_bytes[89], expected 115, is %d", check_msg->certificate_bytes[89]); - ck_assert_msg(check_msg->certificate_bytes[90] == 230, "incorrect value for certificate_bytes[90], expected 230, is %d", check_msg->certificate_bytes[90]); - ck_assert_msg(check_msg->certificate_bytes[91] == 159, "incorrect value for certificate_bytes[91], expected 159, is %d", check_msg->certificate_bytes[91]); - ck_assert_msg(check_msg->certificate_bytes[92] == 185, "incorrect value for certificate_bytes[92], expected 185, is %d", check_msg->certificate_bytes[92]); - ck_assert_msg(check_msg->certificate_bytes[93] == 158, "incorrect value for certificate_bytes[93], expected 158, is %d", check_msg->certificate_bytes[93]); - ck_assert_msg(check_msg->certificate_bytes[94] == 51, "incorrect value for certificate_bytes[94], expected 51, is %d", check_msg->certificate_bytes[94]); - ck_assert_msg(check_msg->certificate_bytes[95] == 12, "incorrect value for certificate_bytes[95], expected 12, is %d", check_msg->certificate_bytes[95]); - ck_assert_msg(check_msg->certificate_bytes[96] == 225, "incorrect value for certificate_bytes[96], expected 225, is %d", check_msg->certificate_bytes[96]); - ck_assert_msg(check_msg->certificate_bytes[97] == 65, "incorrect value for certificate_bytes[97], expected 65, is %d", check_msg->certificate_bytes[97]); - ck_assert_msg(check_msg->certificate_bytes[98] == 192, "incorrect value for certificate_bytes[98], expected 192, is %d", check_msg->certificate_bytes[98]); - ck_assert_msg(check_msg->certificate_bytes[99] == 105, "incorrect value for certificate_bytes[99], expected 105, is %d", check_msg->certificate_bytes[99]); - ck_assert_msg(check_msg->certificate_bytes[100] == 56, "incorrect value for certificate_bytes[100], expected 56, is %d", check_msg->certificate_bytes[100]); - ck_assert_msg(check_msg->certificate_bytes[101] == 41, "incorrect value for certificate_bytes[101], expected 41, is %d", check_msg->certificate_bytes[101]); - ck_assert_msg(check_msg->certificate_bytes[102] == 85, "incorrect value for certificate_bytes[102], expected 85, is %d", check_msg->certificate_bytes[102]); - ck_assert_msg(check_msg->certificate_bytes[103] == 133, "incorrect value for certificate_bytes[103], expected 133, is %d", check_msg->certificate_bytes[103]); - ck_assert_msg(check_msg->certificate_bytes[104] == 19, "incorrect value for certificate_bytes[104], expected 19, is %d", check_msg->certificate_bytes[104]); - ck_assert_msg(check_msg->certificate_bytes[105] == 217, "incorrect value for certificate_bytes[105], expected 217, is %d", check_msg->certificate_bytes[105]); - ck_assert_msg(check_msg->certificate_bytes[106] == 166, "incorrect value for certificate_bytes[106], expected 166, is %d", check_msg->certificate_bytes[106]); - ck_assert_msg(check_msg->certificate_bytes[107] == 48, "incorrect value for certificate_bytes[107], expected 48, is %d", check_msg->certificate_bytes[107]); - ck_assert_msg(check_msg->certificate_bytes[108] == 139, "incorrect value for certificate_bytes[108], expected 139, is %d", check_msg->certificate_bytes[108]); - ck_assert_msg(check_msg->certificate_bytes[109] == 131, "incorrect value for certificate_bytes[109], expected 131, is %d", check_msg->certificate_bytes[109]); - ck_assert_msg(check_msg->certificate_bytes[110] == 96, "incorrect value for certificate_bytes[110], expected 96, is %d", check_msg->certificate_bytes[110]); - ck_assert_msg(check_msg->certificate_bytes[111] == 216, "incorrect value for certificate_bytes[111], expected 216, is %d", check_msg->certificate_bytes[111]); - ck_assert_msg(check_msg->certificate_bytes[112] == 98, "incorrect value for certificate_bytes[112], expected 98, is %d", check_msg->certificate_bytes[112]); - ck_assert_msg(check_msg->certificate_bytes[113] == 147, "incorrect value for certificate_bytes[113], expected 147, is %d", check_msg->certificate_bytes[113]); - ck_assert_msg(check_msg->certificate_bytes[114] == 132, "incorrect value for certificate_bytes[114], expected 132, is %d", check_msg->certificate_bytes[114]); - ck_assert_msg(check_msg->certificate_bytes[115] == 234, "incorrect value for certificate_bytes[115], expected 234, is %d", check_msg->certificate_bytes[115]); - ck_assert_msg(check_msg->certificate_bytes[116] == 167, "incorrect value for certificate_bytes[116], expected 167, is %d", check_msg->certificate_bytes[116]); - ck_assert_msg(check_msg->certificate_bytes[117] == 248, "incorrect value for certificate_bytes[117], expected 248, is %d", check_msg->certificate_bytes[117]); - ck_assert_msg(check_msg->certificate_bytes[118] == 247, "incorrect value for certificate_bytes[118], expected 247, is %d", check_msg->certificate_bytes[118]); - ck_assert_msg(check_msg->certificate_bytes[119] == 32, "incorrect value for certificate_bytes[119], expected 32, is %d", check_msg->certificate_bytes[119]); - ck_assert_msg(check_msg->certificate_bytes[120] == 239, "incorrect value for certificate_bytes[120], expected 239, is %d", check_msg->certificate_bytes[120]); - ck_assert_msg(check_msg->certificate_bytes[121] == 194, "incorrect value for certificate_bytes[121], expected 194, is %d", check_msg->certificate_bytes[121]); - ck_assert_msg(check_msg->certificate_bytes[122] == 188, "incorrect value for certificate_bytes[122], expected 188, is %d", check_msg->certificate_bytes[122]); - ck_assert_msg(check_msg->certificate_bytes[123] == 254, "incorrect value for certificate_bytes[123], expected 254, is %d", check_msg->certificate_bytes[123]); - ck_assert_msg(check_msg->certificate_bytes[124] == 114, "incorrect value for certificate_bytes[124], expected 114, is %d", check_msg->certificate_bytes[124]); - ck_assert_msg(check_msg->certificate_bytes[125] == 117, "incorrect value for certificate_bytes[125], expected 117, is %d", check_msg->certificate_bytes[125]); - ck_assert_msg(check_msg->certificate_bytes[126] == 83, "incorrect value for certificate_bytes[126], expected 83, is %d", check_msg->certificate_bytes[126]); - ck_assert_msg(check_msg->certificate_bytes[127] == 25, "incorrect value for certificate_bytes[127], expected 25, is %d", check_msg->certificate_bytes[127]); - ck_assert_msg(check_msg->certificate_bytes[128] == 251, "incorrect value for certificate_bytes[128], expected 251, is %d", check_msg->certificate_bytes[128]); - ck_assert_msg(check_msg->certificate_bytes[129] == 191, "incorrect value for certificate_bytes[129], expected 191, is %d", check_msg->certificate_bytes[129]); - ck_assert_msg(check_msg->certificate_bytes[130] == 104, "incorrect value for certificate_bytes[130], expected 104, is %d", check_msg->certificate_bytes[130]); - ck_assert_msg(check_msg->certificate_bytes[131] == 240, "incorrect value for certificate_bytes[131], expected 240, is %d", check_msg->certificate_bytes[131]); - ck_assert_msg(check_msg->certificate_bytes[132] == 118, "incorrect value for certificate_bytes[132], expected 118, is %d", check_msg->certificate_bytes[132]); - ck_assert_msg(check_msg->certificate_bytes[133] == 68, "incorrect value for certificate_bytes[133], expected 68, is %d", check_msg->certificate_bytes[133]); - ck_assert_msg(check_msg->certificate_bytes[134] == 42, "incorrect value for certificate_bytes[134], expected 42, is %d", check_msg->certificate_bytes[134]); - ck_assert_msg(check_msg->certificate_bytes[135] == 93, "incorrect value for certificate_bytes[135], expected 93, is %d", check_msg->certificate_bytes[135]); - ck_assert_msg(check_msg->certificate_bytes[136] == 18, "incorrect value for certificate_bytes[136], expected 18, is %d", check_msg->certificate_bytes[136]); - ck_assert_msg(check_msg->certificate_bytes[137] == 16, "incorrect value for certificate_bytes[137], expected 16, is %d", check_msg->certificate_bytes[137]); - ck_assert_msg(check_msg->certificate_bytes[138] == 37, "incorrect value for certificate_bytes[138], expected 37, is %d", check_msg->certificate_bytes[138]); - ck_assert_msg(check_msg->certificate_bytes[139] == 232, "incorrect value for certificate_bytes[139], expected 232, is %d", check_msg->certificate_bytes[139]); - ck_assert_msg(check_msg->certificate_bytes[140] == 99, "incorrect value for certificate_bytes[140], expected 99, is %d", check_msg->certificate_bytes[140]); - ck_assert_msg(check_msg->certificate_bytes[141] == 179, "incorrect value for certificate_bytes[141], expected 179, is %d", check_msg->certificate_bytes[141]); - ck_assert_msg(check_msg->certificate_bytes[142] == 23, "incorrect value for certificate_bytes[142], expected 23, is %d", check_msg->certificate_bytes[142]); - ck_assert_msg(check_msg->certificate_bytes[143] == 90, "incorrect value for certificate_bytes[143], expected 90, is %d", check_msg->certificate_bytes[143]); - ck_assert_msg(check_msg->certificate_bytes[144] == 94, "incorrect value for certificate_bytes[144], expected 94, is %d", check_msg->certificate_bytes[144]); - ck_assert_msg(check_msg->certificate_bytes[145] == 136, "incorrect value for certificate_bytes[145], expected 136, is %d", check_msg->certificate_bytes[145]); - ck_assert_msg(check_msg->certificate_bytes[146] == 6, "incorrect value for certificate_bytes[146], expected 6, is %d", check_msg->certificate_bytes[146]); - ck_assert_msg(check_msg->certificate_bytes[147] == 125, "incorrect value for certificate_bytes[147], expected 125, is %d", check_msg->certificate_bytes[147]); - ck_assert_msg(check_msg->certificate_bytes[148] == 91, "incorrect value for certificate_bytes[148], expected 91, is %d", check_msg->certificate_bytes[148]); - ck_assert_msg(check_msg->certificate_bytes[149] == 255, "incorrect value for certificate_bytes[149], expected 255, is %d", check_msg->certificate_bytes[149]); - ck_assert_msg(check_msg->certificate_bytes[150] == 15, "incorrect value for certificate_bytes[150], expected 15, is %d", check_msg->certificate_bytes[150]); - ck_assert_msg(check_msg->certificate_bytes[151] == 71, "incorrect value for certificate_bytes[151], expected 71, is %d", check_msg->certificate_bytes[151]); - ck_assert_msg(check_msg->certificate_bytes[152] == 43, "incorrect value for certificate_bytes[152], expected 43, is %d", check_msg->certificate_bytes[152]); - ck_assert_msg(check_msg->certificate_bytes[153] == 46, "incorrect value for certificate_bytes[153], expected 46, is %d", check_msg->certificate_bytes[153]); - ck_assert_msg(check_msg->certificate_bytes[154] == 25, "incorrect value for certificate_bytes[154], expected 25, is %d", check_msg->certificate_bytes[154]); - ck_assert_msg(check_msg->certificate_bytes[155] == 252, "incorrect value for certificate_bytes[155], expected 252, is %d", check_msg->certificate_bytes[155]); - ck_assert_msg(check_msg->certificate_bytes[156] == 229, "incorrect value for certificate_bytes[156], expected 229, is %d", check_msg->certificate_bytes[156]); - ck_assert_msg(check_msg->certificate_bytes[157] == 80, "incorrect value for certificate_bytes[157], expected 80, is %d", check_msg->certificate_bytes[157]); - ck_assert_msg(check_msg->certificate_bytes[158] == 143, "incorrect value for certificate_bytes[158], expected 143, is %d", check_msg->certificate_bytes[158]); - ck_assert_msg(check_msg->certificate_bytes[159] == 58, "incorrect value for certificate_bytes[159], expected 58, is %d", check_msg->certificate_bytes[159]); - ck_assert_msg(check_msg->certificate_bytes[160] == 241, "incorrect value for certificate_bytes[160], expected 241, is %d", check_msg->certificate_bytes[160]); - ck_assert_msg(check_msg->certificate_bytes[161] == 11, "incorrect value for certificate_bytes[161], expected 11, is %d", check_msg->certificate_bytes[161]); - ck_assert_msg(check_msg->certificate_bytes[162] == 62, "incorrect value for certificate_bytes[162], expected 62, is %d", check_msg->certificate_bytes[162]); - ck_assert_msg(check_msg->certificate_bytes[163] == 181, "incorrect value for certificate_bytes[163], expected 181, is %d", check_msg->certificate_bytes[163]); - ck_assert_msg(check_msg->certificate_bytes[164] == 155, "incorrect value for certificate_bytes[164], expected 155, is %d", check_msg->certificate_bytes[164]); - ck_assert_msg(check_msg->certificate_bytes[165] == 53, "incorrect value for certificate_bytes[165], expected 53, is %d", check_msg->certificate_bytes[165]); - ck_assert_msg(check_msg->certificate_bytes[166] == 153, "incorrect value for certificate_bytes[166], expected 153, is %d", check_msg->certificate_bytes[166]); - ck_assert_msg(check_msg->certificate_bytes[167] == 149, "incorrect value for certificate_bytes[167], expected 149, is %d", check_msg->certificate_bytes[167]); - ck_assert_msg(check_msg->certificate_bytes[168] == 152, "incorrect value for certificate_bytes[168], expected 152, is %d", check_msg->certificate_bytes[168]); - ck_assert_msg(check_msg->certificate_bytes[169] == 227, "incorrect value for certificate_bytes[169], expected 227, is %d", check_msg->certificate_bytes[169]); - ck_assert_msg(check_msg->certificate_bytes[170] == 150, "incorrect value for certificate_bytes[170], expected 150, is %d", check_msg->certificate_bytes[170]); - ck_assert_msg(check_msg->certificate_bytes[171] == 87, "incorrect value for certificate_bytes[171], expected 87, is %d", check_msg->certificate_bytes[171]); - ck_assert_msg(check_msg->certificate_bytes[172] == 112, "incorrect value for certificate_bytes[172], expected 112, is %d", check_msg->certificate_bytes[172]); - ck_assert_msg(check_msg->certificate_bytes[173] == 165, "incorrect value for certificate_bytes[173], expected 165, is %d", check_msg->certificate_bytes[173]); - ck_assert_msg(check_msg->certificate_bytes[174] == 2, "incorrect value for certificate_bytes[174], expected 2, is %d", check_msg->certificate_bytes[174]); - ck_assert_msg(check_msg->certificate_bytes[175] == 128, "incorrect value for certificate_bytes[175], expected 128, is %d", check_msg->certificate_bytes[175]); - ck_assert_msg(check_msg->certificate_bytes[176] == 231, "incorrect value for certificate_bytes[176], expected 231, is %d", check_msg->certificate_bytes[176]); - ck_assert_msg(check_msg->certificate_bytes[177] == 25, "incorrect value for certificate_bytes[177], expected 25, is %d", check_msg->certificate_bytes[177]); - ck_assert_msg(check_msg->certificate_bytes[178] == 157, "incorrect value for certificate_bytes[178], expected 157, is %d", check_msg->certificate_bytes[178]); - ck_assert_msg(check_msg->certificate_bytes[179] == 244, "incorrect value for certificate_bytes[179], expected 244, is %d", check_msg->certificate_bytes[179]); - ck_assert_msg(check_msg->certificate_bytes[180] == 204, "incorrect value for certificate_bytes[180], expected 204, is %d", check_msg->certificate_bytes[180]); - ck_assert_msg(check_msg->certificate_bytes[181] == 108, "incorrect value for certificate_bytes[181], expected 108, is %d", check_msg->certificate_bytes[181]); - ck_assert_msg(check_msg->certificate_bytes[182] == 253, "incorrect value for certificate_bytes[182], expected 253, is %d", check_msg->certificate_bytes[182]); - ck_assert_msg(check_msg->certificate_bytes[183] == 127, "incorrect value for certificate_bytes[183], expected 127, is %d", check_msg->certificate_bytes[183]); - ck_assert_msg(check_msg->certificate_bytes[184] == 122, "incorrect value for certificate_bytes[184], expected 122, is %d", check_msg->certificate_bytes[184]); - ck_assert_msg(check_msg->certificate_bytes[185] == 145, "incorrect value for certificate_bytes[185], expected 145, is %d", check_msg->certificate_bytes[185]); - ck_assert_msg(check_msg->certificate_bytes[186] == 113, "incorrect value for certificate_bytes[186], expected 113, is %d", check_msg->certificate_bytes[186]); - ck_assert_msg(check_msg->certificate_bytes[187] == 162, "incorrect value for certificate_bytes[187], expected 162, is %d", check_msg->certificate_bytes[187]); - ck_assert_msg(check_msg->certificate_bytes[188] == 197, "incorrect value for certificate_bytes[188], expected 197, is %d", check_msg->certificate_bytes[188]); - ck_assert_msg(check_msg->certificate_bytes[189] == 171, "incorrect value for certificate_bytes[189], expected 171, is %d", check_msg->certificate_bytes[189]); - ck_assert_msg(check_msg->certificate_bytes[190] == 199, "incorrect value for certificate_bytes[190], expected 199, is %d", check_msg->certificate_bytes[190]); - ck_assert_msg(check_msg->certificate_bytes[191] == 54, "incorrect value for certificate_bytes[191], expected 54, is %d", check_msg->certificate_bytes[191]); - ck_assert_msg(check_msg->certificate_bytes[192] == 184, "incorrect value for certificate_bytes[192], expected 184, is %d", check_msg->certificate_bytes[192]); - ck_assert_msg(check_msg->certificate_bytes[193] == 222, "incorrect value for certificate_bytes[193], expected 222, is %d", check_msg->certificate_bytes[193]); - ck_assert_msg(check_msg->certificate_bytes[194] == 206, "incorrect value for certificate_bytes[194], expected 206, is %d", check_msg->certificate_bytes[194]); - ck_assert_msg(check_msg->certificate_bytes[195] == 67, "incorrect value for certificate_bytes[195], expected 67, is %d", check_msg->certificate_bytes[195]); - ck_assert_msg(check_msg->certificate_bytes[196] == 144, "incorrect value for certificate_bytes[196], expected 144, is %d", check_msg->certificate_bytes[196]); - ck_assert_msg(check_msg->certificate_bytes[197] == 78, "incorrect value for certificate_bytes[197], expected 78, is %d", check_msg->certificate_bytes[197]); - ck_assert_msg(check_msg->certificate_bytes[198] == 187, "incorrect value for certificate_bytes[198], expected 187, is %d", check_msg->certificate_bytes[198]); - ck_assert_msg(check_msg->certificate_bytes[199] == 207, "incorrect value for certificate_bytes[199], expected 207, is %d", check_msg->certificate_bytes[199]); - ck_assert_msg(check_msg->certificate_bytes[200] == 60, "incorrect value for certificate_bytes[200], expected 60, is %d", check_msg->certificate_bytes[200]); - ck_assert_msg(check_msg->certificate_bytes[201] == 211, "incorrect value for certificate_bytes[201], expected 211, is %d", check_msg->certificate_bytes[201]); - ck_assert_msg(check_msg->certificate_bytes[202] == 141, "incorrect value for certificate_bytes[202], expected 141, is %d", check_msg->certificate_bytes[202]); - ck_assert_msg(check_msg->certificate_bytes[203] == 135, "incorrect value for certificate_bytes[203], expected 135, is %d", check_msg->certificate_bytes[203]); - ck_assert_msg(check_msg->certificate_bytes[204] == 106, "incorrect value for certificate_bytes[204], expected 106, is %d", check_msg->certificate_bytes[204]); - ck_assert_msg(check_msg->certificate_bytes[205] == 220, "incorrect value for certificate_bytes[205], expected 220, is %d", check_msg->certificate_bytes[205]); - ck_assert_msg(check_msg->certificate_bytes[206] == 79, "incorrect value for certificate_bytes[206], expected 79, is %d", check_msg->certificate_bytes[206]); - ck_assert_msg(check_msg->certificate_bytes[207] == 183, "incorrect value for certificate_bytes[207], expected 183, is %d", check_msg->certificate_bytes[207]); - ck_assert_msg(check_msg->certificate_bytes[208] == 245, "incorrect value for certificate_bytes[208], expected 245, is %d", check_msg->certificate_bytes[208]); - ck_assert_msg(check_msg->certificate_bytes[209] == 21, "incorrect value for certificate_bytes[209], expected 21, is %d", check_msg->certificate_bytes[209]); - ck_assert_msg(check_msg->certificate_bytes[210] == 161, "incorrect value for certificate_bytes[210], expected 161, is %d", check_msg->certificate_bytes[210]); - ck_assert_msg(check_msg->certificate_bytes[211] == 168, "incorrect value for certificate_bytes[211], expected 168, is %d", check_msg->certificate_bytes[211]); - ck_assert_msg(check_msg->certificate_bytes[212] == 34, "incorrect value for certificate_bytes[212], expected 34, is %d", check_msg->certificate_bytes[212]); - ck_assert_msg(check_msg->certificate_bytes[213] == 129, "incorrect value for certificate_bytes[213], expected 129, is %d", check_msg->certificate_bytes[213]); - ck_assert_msg(check_msg->certificate_bytes[214] == 50, "incorrect value for certificate_bytes[214], expected 50, is %d", check_msg->certificate_bytes[214]); - ck_assert_msg(check_msg->certificate_bytes[215] == 176, "incorrect value for certificate_bytes[215], expected 176, is %d", check_msg->certificate_bytes[215]); - ck_assert_msg(check_msg->certificate_bytes[216] == 1, "incorrect value for certificate_bytes[216], expected 1, is %d", check_msg->certificate_bytes[216]); - ck_assert_msg(check_msg->certificate_bytes[217] == 218, "incorrect value for certificate_bytes[217], expected 218, is %d", check_msg->certificate_bytes[217]); - ck_assert_msg(check_msg->certificate_bytes[218] == 20, "incorrect value for certificate_bytes[218], expected 20, is %d", check_msg->certificate_bytes[218]); - ck_assert_msg(check_msg->certificate_bytes[219] == 130, "incorrect value for certificate_bytes[219], expected 130, is %d", check_msg->certificate_bytes[219]); - ck_assert_msg(check_msg->certificate_bytes[220] == 59, "incorrect value for certificate_bytes[220], expected 59, is %d", check_msg->certificate_bytes[220]); - ck_assert_msg(check_msg->certificate_bytes[221] == 249, "incorrect value for certificate_bytes[221], expected 249, is %d", check_msg->certificate_bytes[221]); - ck_assert_msg(check_msg->certificate_bytes[222] == 109, "incorrect value for certificate_bytes[222], expected 109, is %d", check_msg->certificate_bytes[222]); - ck_assert_msg(check_msg->certificate_bytes[223] == 219, "incorrect value for certificate_bytes[223], expected 219, is %d", check_msg->certificate_bytes[223]); - ck_assert_msg(check_msg->certificate_bytes[224] == 0, "incorrect value for certificate_bytes[224], expected 0, is %d", check_msg->certificate_bytes[224]); - ck_assert_msg(check_msg->certificate_bytes[225] == 100, "incorrect value for certificate_bytes[225], expected 100, is %d", check_msg->certificate_bytes[225]); - ck_assert_msg(check_msg->certificate_bytes[226] == 103, "incorrect value for certificate_bytes[226], expected 103, is %d", check_msg->certificate_bytes[226]); - ck_assert_msg(check_msg->certificate_bytes[227] == 55, "incorrect value for certificate_bytes[227], expected 55, is %d", check_msg->certificate_bytes[227]); - ck_assert_msg(check_msg->certificate_bytes[228] == 29, "incorrect value for certificate_bytes[228], expected 29, is %d", check_msg->certificate_bytes[228]); - ck_assert_msg(check_msg->certificate_bytes[229] == 242, "incorrect value for certificate_bytes[229], expected 242, is %d", check_msg->certificate_bytes[229]); - ck_assert_msg(check_msg->certificate_bytes[230] == 110, "incorrect value for certificate_bytes[230], expected 110, is %d", check_msg->certificate_bytes[230]); - ck_assert_msg(check_msg->certificate_bytes[231] == 154, "incorrect value for certificate_bytes[231], expected 154, is %d", check_msg->certificate_bytes[231]); - ck_assert_msg(check_msg->certificate_bytes[232] == 190, "incorrect value for certificate_bytes[232], expected 190, is %d", check_msg->certificate_bytes[232]); - ck_assert_msg(check_msg->certificate_bytes[233] == 233, "incorrect value for certificate_bytes[233], expected 233, is %d", check_msg->certificate_bytes[233]); - ck_assert_msg(check_msg->certificate_bytes[234] == 142, "incorrect value for certificate_bytes[234], expected 142, is %d", check_msg->certificate_bytes[234]); - ck_assert_msg(check_msg->certificate_bytes[235] == 45, "incorrect value for certificate_bytes[235], expected 45, is %d", check_msg->certificate_bytes[235]); - ck_assert_msg(check_msg->certificate_bytes[236] == 61, "incorrect value for certificate_bytes[236], expected 61, is %d", check_msg->certificate_bytes[236]); - ck_assert_msg(check_msg->certificate_bytes[237] == 215, "incorrect value for certificate_bytes[237], expected 215, is %d", check_msg->certificate_bytes[237]); - ck_assert_msg(check_msg->certificate_bytes[238] == 202, "incorrect value for certificate_bytes[238], expected 202, is %d", check_msg->certificate_bytes[238]); - ck_assert_msg(check_msg->certificate_bytes[239] == 238, "incorrect value for certificate_bytes[239], expected 238, is %d", check_msg->certificate_bytes[239]); - ck_assert_msg(check_msg->certificate_bytes[240] == 88, "incorrect value for certificate_bytes[240], expected 88, is %d", check_msg->certificate_bytes[240]); - ck_assert_msg(check_msg->certificate_bytes[241] == 209, "incorrect value for certificate_bytes[241], expected 209, is %d", check_msg->certificate_bytes[241]); - ck_assert_msg(check_msg->certificate_bytes[242] == 70, "incorrect value for certificate_bytes[242], expected 70, is %d", check_msg->certificate_bytes[242]); - ck_assert_msg(check_msg->certificate_bytes[243] == 63, "incorrect value for certificate_bytes[243], expected 63, is %d", check_msg->certificate_bytes[243]); - ck_assert_msg(check_msg->certificate_bytes[244] == 151, "incorrect value for certificate_bytes[244], expected 151, is %d", check_msg->certificate_bytes[244]); - ck_assert_msg(check_msg->certificate_bytes[245] == 27, "incorrect value for certificate_bytes[245], expected 27, is %d", check_msg->certificate_bytes[245]); - ck_assert_msg(check_msg->certificate_bytes[246] == 102, "incorrect value for certificate_bytes[246], expected 102, is %d", check_msg->certificate_bytes[246]); - ck_assert_msg(check_msg->certificate_id[0] == 10, "incorrect value for certificate_id[0], expected 10, is %d", check_msg->certificate_id[0]); - ck_assert_msg(check_msg->certificate_id[1] == 11, "incorrect value for certificate_id[1], expected 11, is %d", check_msg->certificate_id[1]); - ck_assert_msg(check_msg->certificate_id[2] == 12, "incorrect value for certificate_id[2], expected 12, is %d", check_msg->certificate_id[2]); - ck_assert_msg(check_msg->certificate_id[3] == 13, "incorrect value for certificate_id[3], expected 13, is %d", check_msg->certificate_id[3]); - ck_assert_msg(check_msg->flags == 2, "incorrect value for flags, expected 2, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_msg == 48, "incorrect value for n_msg, expected 48, is %d", check_msg->n_msg); + ck_assert_msg( + check_msg->certificate_bytes[0] == 180, + "incorrect value for certificate_bytes[0], expected 180, is %d", + check_msg->certificate_bytes[0]); + ck_assert_msg( + check_msg->certificate_bytes[1] == 160, + "incorrect value for certificate_bytes[1], expected 160, is %d", + check_msg->certificate_bytes[1]); + ck_assert_msg( + check_msg->certificate_bytes[2] == 116, + "incorrect value for certificate_bytes[2], expected 116, is %d", + check_msg->certificate_bytes[2]); + ck_assert_msg( + check_msg->certificate_bytes[3] == 77, + "incorrect value for certificate_bytes[3], expected 77, is %d", + check_msg->certificate_bytes[3]); + ck_assert_msg( + check_msg->certificate_bytes[4] == 243, + "incorrect value for certificate_bytes[4], expected 243, is %d", + check_msg->certificate_bytes[4]); + ck_assert_msg( + check_msg->certificate_bytes[5] == 28, + "incorrect value for certificate_bytes[5], expected 28, is %d", + check_msg->certificate_bytes[5]); + ck_assert_msg( + check_msg->certificate_bytes[6] == 173, + "incorrect value for certificate_bytes[6], expected 173, is %d", + check_msg->certificate_bytes[6]); + ck_assert_msg( + check_msg->certificate_bytes[7] == 36, + "incorrect value for certificate_bytes[7], expected 36, is %d", + check_msg->certificate_bytes[7]); + ck_assert_msg( + check_msg->certificate_bytes[8] == 86, + "incorrect value for certificate_bytes[8], expected 86, is %d", + check_msg->certificate_bytes[8]); + ck_assert_msg( + check_msg->certificate_bytes[9] == 33, + "incorrect value for certificate_bytes[9], expected 33, is %d", + check_msg->certificate_bytes[9]); + ck_assert_msg( + check_msg->certificate_bytes[10] == 8, + "incorrect value for certificate_bytes[10], expected 8, is %d", + check_msg->certificate_bytes[10]); + ck_assert_msg( + check_msg->certificate_bytes[11] == 31, + "incorrect value for certificate_bytes[11], expected 31, is %d", + check_msg->certificate_bytes[11]); + ck_assert_msg( + check_msg->certificate_bytes[12] == 120, + "incorrect value for certificate_bytes[12], expected 120, is %d", + check_msg->certificate_bytes[12]); + ck_assert_msg( + check_msg->certificate_bytes[13] == 73, + "incorrect value for certificate_bytes[13], expected 73, is %d", + check_msg->certificate_bytes[13]); + ck_assert_msg( + check_msg->certificate_bytes[14] == 64, + "incorrect value for certificate_bytes[14], expected 64, is %d", + check_msg->certificate_bytes[14]); + ck_assert_msg( + check_msg->certificate_bytes[15] == 169, + "incorrect value for certificate_bytes[15], expected 169, is %d", + check_msg->certificate_bytes[15]); + ck_assert_msg( + check_msg->certificate_bytes[16] == 148, + "incorrect value for certificate_bytes[16], expected 148, is %d", + check_msg->certificate_bytes[16]); + ck_assert_msg( + check_msg->certificate_bytes[17] == 224, + "incorrect value for certificate_bytes[17], expected 224, is %d", + check_msg->certificate_bytes[17]); + ck_assert_msg( + check_msg->certificate_bytes[18] == 57, + "incorrect value for certificate_bytes[18], expected 57, is %d", + check_msg->certificate_bytes[18]); + ck_assert_msg( + check_msg->certificate_bytes[19] == 95, + "incorrect value for certificate_bytes[19], expected 95, is %d", + check_msg->certificate_bytes[19]); + ck_assert_msg( + check_msg->certificate_bytes[20] == 17, + "incorrect value for certificate_bytes[20], expected 17, is %d", + check_msg->certificate_bytes[20]); + ck_assert_msg( + check_msg->certificate_bytes[21] == 40, + "incorrect value for certificate_bytes[21], expected 40, is %d", + check_msg->certificate_bytes[21]); + ck_assert_msg( + check_msg->certificate_bytes[22] == 213, + "incorrect value for certificate_bytes[22], expected 213, is %d", + check_msg->certificate_bytes[22]); + ck_assert_msg( + check_msg->certificate_bytes[23] == 92, + "incorrect value for certificate_bytes[23], expected 92, is %d", + check_msg->certificate_bytes[23]); + ck_assert_msg( + check_msg->certificate_bytes[24] == 195, + "incorrect value for certificate_bytes[24], expected 195, is %d", + check_msg->certificate_bytes[24]); + ck_assert_msg( + check_msg->certificate_bytes[25] == 146, + "incorrect value for certificate_bytes[25], expected 146, is %d", + check_msg->certificate_bytes[25]); + ck_assert_msg( + check_msg->certificate_bytes[26] == 235, + "incorrect value for certificate_bytes[26], expected 235, is %d", + check_msg->certificate_bytes[26]); + ck_assert_msg( + check_msg->certificate_bytes[27] == 228, + "incorrect value for certificate_bytes[27], expected 228, is %d", + check_msg->certificate_bytes[27]); + ck_assert_msg( + check_msg->certificate_bytes[28] == 177, + "incorrect value for certificate_bytes[28], expected 177, is %d", + check_msg->certificate_bytes[28]); + ck_assert_msg( + check_msg->certificate_bytes[29] == 101, + "incorrect value for certificate_bytes[29], expected 101, is %d", + check_msg->certificate_bytes[29]); + ck_assert_msg( + check_msg->certificate_bytes[30] == 82, + "incorrect value for certificate_bytes[30], expected 82, is %d", + check_msg->certificate_bytes[30]); + ck_assert_msg( + check_msg->certificate_bytes[31] == 182, + "incorrect value for certificate_bytes[31], expected 182, is %d", + check_msg->certificate_bytes[31]); + ck_assert_msg( + check_msg->certificate_bytes[32] == 25, + "incorrect value for certificate_bytes[32], expected 25, is %d", + check_msg->certificate_bytes[32]); + ck_assert_msg( + check_msg->certificate_bytes[33] == 172, + "incorrect value for certificate_bytes[33], expected 172, is %d", + check_msg->certificate_bytes[33]); + ck_assert_msg( + check_msg->certificate_bytes[34] == 170, + "incorrect value for certificate_bytes[34], expected 170, is %d", + check_msg->certificate_bytes[34]); + ck_assert_msg( + check_msg->certificate_bytes[35] == 250, + "incorrect value for certificate_bytes[35], expected 250, is %d", + check_msg->certificate_bytes[35]); + ck_assert_msg( + check_msg->certificate_bytes[36] == 236, + "incorrect value for certificate_bytes[36], expected 236, is %d", + check_msg->certificate_bytes[36]); + ck_assert_msg( + check_msg->certificate_bytes[37] == 7, + "incorrect value for certificate_bytes[37], expected 7, is %d", + check_msg->certificate_bytes[37]); + ck_assert_msg( + check_msg->certificate_bytes[38] == 119, + "incorrect value for certificate_bytes[38], expected 119, is %d", + check_msg->certificate_bytes[38]); + ck_assert_msg( + check_msg->certificate_bytes[39] == 4, + "incorrect value for certificate_bytes[39], expected 4, is %d", + check_msg->certificate_bytes[39]); + ck_assert_msg( + check_msg->certificate_bytes[40] == 201, + "incorrect value for certificate_bytes[40], expected 201, is %d", + check_msg->certificate_bytes[40]); + ck_assert_msg( + check_msg->certificate_bytes[41] == 10, + "incorrect value for certificate_bytes[41], expected 10, is %d", + check_msg->certificate_bytes[41]); + ck_assert_msg( + check_msg->certificate_bytes[42] == 14, + "incorrect value for certificate_bytes[42], expected 14, is %d", + check_msg->certificate_bytes[42]); + ck_assert_msg( + check_msg->certificate_bytes[43] == 208, + "incorrect value for certificate_bytes[43], expected 208, is %d", + check_msg->certificate_bytes[43]); + ck_assert_msg( + check_msg->certificate_bytes[44] == 47, + "incorrect value for certificate_bytes[44], expected 47, is %d", + check_msg->certificate_bytes[44]); + ck_assert_msg( + check_msg->certificate_bytes[45] == 126, + "incorrect value for certificate_bytes[45], expected 126, is %d", + check_msg->certificate_bytes[45]); + ck_assert_msg( + check_msg->certificate_bytes[46] == 49, + "incorrect value for certificate_bytes[46], expected 49, is %d", + check_msg->certificate_bytes[46]); + ck_assert_msg( + check_msg->certificate_bytes[47] == 210, + "incorrect value for certificate_bytes[47], expected 210, is %d", + check_msg->certificate_bytes[47]); + ck_assert_msg( + check_msg->certificate_bytes[48] == 174, + "incorrect value for certificate_bytes[48], expected 174, is %d", + check_msg->certificate_bytes[48]); + ck_assert_msg( + check_msg->certificate_bytes[49] == 75, + "incorrect value for certificate_bytes[49], expected 75, is %d", + check_msg->certificate_bytes[49]); + ck_assert_msg( + check_msg->certificate_bytes[50] == 221, + "incorrect value for certificate_bytes[50], expected 221, is %d", + check_msg->certificate_bytes[50]); + ck_assert_msg( + check_msg->certificate_bytes[51] == 203, + "incorrect value for certificate_bytes[51], expected 203, is %d", + check_msg->certificate_bytes[51]); + ck_assert_msg( + check_msg->certificate_bytes[52] == 24, + "incorrect value for certificate_bytes[52], expected 24, is %d", + check_msg->certificate_bytes[52]); + ck_assert_msg( + check_msg->certificate_bytes[53] == 66, + "incorrect value for certificate_bytes[53], expected 66, is %d", + check_msg->certificate_bytes[53]); + ck_assert_msg( + check_msg->certificate_bytes[54] == 52, + "incorrect value for certificate_bytes[54], expected 52, is %d", + check_msg->certificate_bytes[54]); + ck_assert_msg( + check_msg->certificate_bytes[55] == 35, + "incorrect value for certificate_bytes[55], expected 35, is %d", + check_msg->certificate_bytes[55]); + ck_assert_msg( + check_msg->certificate_bytes[56] == 26, + "incorrect value for certificate_bytes[56], expected 26, is %d", + check_msg->certificate_bytes[56]); + ck_assert_msg( + check_msg->certificate_bytes[57] == 30, + "incorrect value for certificate_bytes[57], expected 30, is %d", + check_msg->certificate_bytes[57]); + ck_assert_msg( + check_msg->certificate_bytes[58] == 140, + "incorrect value for certificate_bytes[58], expected 140, is %d", + check_msg->certificate_bytes[58]); + ck_assert_msg( + check_msg->certificate_bytes[59] == 111, + "incorrect value for certificate_bytes[59], expected 111, is %d", + check_msg->certificate_bytes[59]); + ck_assert_msg( + check_msg->certificate_bytes[60] == 246, + "incorrect value for certificate_bytes[60], expected 246, is %d", + check_msg->certificate_bytes[60]); + ck_assert_msg( + check_msg->certificate_bytes[61] == 39, + "incorrect value for certificate_bytes[61], expected 39, is %d", + check_msg->certificate_bytes[61]); + ck_assert_msg( + check_msg->certificate_bytes[62] == 226, + "incorrect value for certificate_bytes[62], expected 226, is %d", + check_msg->certificate_bytes[62]); + ck_assert_msg( + check_msg->certificate_bytes[63] == 205, + "incorrect value for certificate_bytes[63], expected 205, is %d", + check_msg->certificate_bytes[63]); + ck_assert_msg( + check_msg->certificate_bytes[64] == 198, + "incorrect value for certificate_bytes[64], expected 198, is %d", + check_msg->certificate_bytes[64]); + ck_assert_msg( + check_msg->certificate_bytes[65] == 178, + "incorrect value for certificate_bytes[65], expected 178, is %d", + check_msg->certificate_bytes[65]); + ck_assert_msg( + check_msg->certificate_bytes[66] == 196, + "incorrect value for certificate_bytes[66], expected 196, is %d", + check_msg->certificate_bytes[66]); + ck_assert_msg( + check_msg->certificate_bytes[67] == 5, + "incorrect value for certificate_bytes[67], expected 5, is %d", + check_msg->certificate_bytes[67]); + ck_assert_msg( + check_msg->certificate_bytes[68] == 81, + "incorrect value for certificate_bytes[68], expected 81, is %d", + check_msg->certificate_bytes[68]); + ck_assert_msg( + check_msg->certificate_bytes[69] == 9, + "incorrect value for certificate_bytes[69], expected 9, is %d", + check_msg->certificate_bytes[69]); + ck_assert_msg( + check_msg->certificate_bytes[70] == 44, + "incorrect value for certificate_bytes[70], expected 44, is %d", + check_msg->certificate_bytes[70]); + ck_assert_msg( + check_msg->certificate_bytes[71] == 164, + "incorrect value for certificate_bytes[71], expected 164, is %d", + check_msg->certificate_bytes[71]); + ck_assert_msg( + check_msg->certificate_bytes[72] == 163, + "incorrect value for certificate_bytes[72], expected 163, is %d", + check_msg->certificate_bytes[72]); + ck_assert_msg( + check_msg->certificate_bytes[73] == 214, + "incorrect value for certificate_bytes[73], expected 214, is %d", + check_msg->certificate_bytes[73]); + ck_assert_msg( + check_msg->certificate_bytes[74] == 138, + "incorrect value for certificate_bytes[74], expected 138, is %d", + check_msg->certificate_bytes[74]); + ck_assert_msg( + check_msg->certificate_bytes[75] == 123, + "incorrect value for certificate_bytes[75], expected 123, is %d", + check_msg->certificate_bytes[75]); + ck_assert_msg( + check_msg->certificate_bytes[76] == 76, + "incorrect value for certificate_bytes[76], expected 76, is %d", + check_msg->certificate_bytes[76]); + ck_assert_msg( + check_msg->certificate_bytes[77] == 74, + "incorrect value for certificate_bytes[77], expected 74, is %d", + check_msg->certificate_bytes[77]); + ck_assert_msg( + check_msg->certificate_bytes[78] == 237, + "incorrect value for certificate_bytes[78], expected 237, is %d", + check_msg->certificate_bytes[78]); + ck_assert_msg( + check_msg->certificate_bytes[79] == 121, + "incorrect value for certificate_bytes[79], expected 121, is %d", + check_msg->certificate_bytes[79]); + ck_assert_msg( + check_msg->certificate_bytes[80] == 13, + "incorrect value for certificate_bytes[80], expected 13, is %d", + check_msg->certificate_bytes[80]); + ck_assert_msg( + check_msg->certificate_bytes[81] == 137, + "incorrect value for certificate_bytes[81], expected 137, is %d", + check_msg->certificate_bytes[81]); + ck_assert_msg( + check_msg->certificate_bytes[82] == 186, + "incorrect value for certificate_bytes[82], expected 186, is %d", + check_msg->certificate_bytes[82]); + ck_assert_msg( + check_msg->certificate_bytes[83] == 97, + "incorrect value for certificate_bytes[83], expected 97, is %d", + check_msg->certificate_bytes[83]); + ck_assert_msg( + check_msg->certificate_bytes[84] == 193, + "incorrect value for certificate_bytes[84], expected 193, is %d", + check_msg->certificate_bytes[84]); + ck_assert_msg( + check_msg->certificate_bytes[85] == 189, + "incorrect value for certificate_bytes[85], expected 189, is %d", + check_msg->certificate_bytes[85]); + ck_assert_msg( + check_msg->certificate_bytes[86] == 200, + "incorrect value for certificate_bytes[86], expected 200, is %d", + check_msg->certificate_bytes[86]); + ck_assert_msg( + check_msg->certificate_bytes[87] == 124, + "incorrect value for certificate_bytes[87], expected 124, is %d", + check_msg->certificate_bytes[87]); + ck_assert_msg( + check_msg->certificate_bytes[88] == 69, + "incorrect value for certificate_bytes[88], expected 69, is %d", + check_msg->certificate_bytes[88]); + ck_assert_msg( + check_msg->certificate_bytes[89] == 115, + "incorrect value for certificate_bytes[89], expected 115, is %d", + check_msg->certificate_bytes[89]); + ck_assert_msg( + check_msg->certificate_bytes[90] == 230, + "incorrect value for certificate_bytes[90], expected 230, is %d", + check_msg->certificate_bytes[90]); + ck_assert_msg( + check_msg->certificate_bytes[91] == 159, + "incorrect value for certificate_bytes[91], expected 159, is %d", + check_msg->certificate_bytes[91]); + ck_assert_msg( + check_msg->certificate_bytes[92] == 185, + "incorrect value for certificate_bytes[92], expected 185, is %d", + check_msg->certificate_bytes[92]); + ck_assert_msg( + check_msg->certificate_bytes[93] == 158, + "incorrect value for certificate_bytes[93], expected 158, is %d", + check_msg->certificate_bytes[93]); + ck_assert_msg( + check_msg->certificate_bytes[94] == 51, + "incorrect value for certificate_bytes[94], expected 51, is %d", + check_msg->certificate_bytes[94]); + ck_assert_msg( + check_msg->certificate_bytes[95] == 12, + "incorrect value for certificate_bytes[95], expected 12, is %d", + check_msg->certificate_bytes[95]); + ck_assert_msg( + check_msg->certificate_bytes[96] == 225, + "incorrect value for certificate_bytes[96], expected 225, is %d", + check_msg->certificate_bytes[96]); + ck_assert_msg( + check_msg->certificate_bytes[97] == 65, + "incorrect value for certificate_bytes[97], expected 65, is %d", + check_msg->certificate_bytes[97]); + ck_assert_msg( + check_msg->certificate_bytes[98] == 192, + "incorrect value for certificate_bytes[98], expected 192, is %d", + check_msg->certificate_bytes[98]); + ck_assert_msg( + check_msg->certificate_bytes[99] == 105, + "incorrect value for certificate_bytes[99], expected 105, is %d", + check_msg->certificate_bytes[99]); + ck_assert_msg( + check_msg->certificate_bytes[100] == 56, + "incorrect value for certificate_bytes[100], expected 56, is %d", + check_msg->certificate_bytes[100]); + ck_assert_msg( + check_msg->certificate_bytes[101] == 41, + "incorrect value for certificate_bytes[101], expected 41, is %d", + check_msg->certificate_bytes[101]); + ck_assert_msg( + check_msg->certificate_bytes[102] == 85, + "incorrect value for certificate_bytes[102], expected 85, is %d", + check_msg->certificate_bytes[102]); + ck_assert_msg( + check_msg->certificate_bytes[103] == 133, + "incorrect value for certificate_bytes[103], expected 133, is %d", + check_msg->certificate_bytes[103]); + ck_assert_msg( + check_msg->certificate_bytes[104] == 19, + "incorrect value for certificate_bytes[104], expected 19, is %d", + check_msg->certificate_bytes[104]); + ck_assert_msg( + check_msg->certificate_bytes[105] == 217, + "incorrect value for certificate_bytes[105], expected 217, is %d", + check_msg->certificate_bytes[105]); + ck_assert_msg( + check_msg->certificate_bytes[106] == 166, + "incorrect value for certificate_bytes[106], expected 166, is %d", + check_msg->certificate_bytes[106]); + ck_assert_msg( + check_msg->certificate_bytes[107] == 48, + "incorrect value for certificate_bytes[107], expected 48, is %d", + check_msg->certificate_bytes[107]); + ck_assert_msg( + check_msg->certificate_bytes[108] == 139, + "incorrect value for certificate_bytes[108], expected 139, is %d", + check_msg->certificate_bytes[108]); + ck_assert_msg( + check_msg->certificate_bytes[109] == 131, + "incorrect value for certificate_bytes[109], expected 131, is %d", + check_msg->certificate_bytes[109]); + ck_assert_msg( + check_msg->certificate_bytes[110] == 96, + "incorrect value for certificate_bytes[110], expected 96, is %d", + check_msg->certificate_bytes[110]); + ck_assert_msg( + check_msg->certificate_bytes[111] == 216, + "incorrect value for certificate_bytes[111], expected 216, is %d", + check_msg->certificate_bytes[111]); + ck_assert_msg( + check_msg->certificate_bytes[112] == 98, + "incorrect value for certificate_bytes[112], expected 98, is %d", + check_msg->certificate_bytes[112]); + ck_assert_msg( + check_msg->certificate_bytes[113] == 147, + "incorrect value for certificate_bytes[113], expected 147, is %d", + check_msg->certificate_bytes[113]); + ck_assert_msg( + check_msg->certificate_bytes[114] == 132, + "incorrect value for certificate_bytes[114], expected 132, is %d", + check_msg->certificate_bytes[114]); + ck_assert_msg( + check_msg->certificate_bytes[115] == 234, + "incorrect value for certificate_bytes[115], expected 234, is %d", + check_msg->certificate_bytes[115]); + ck_assert_msg( + check_msg->certificate_bytes[116] == 167, + "incorrect value for certificate_bytes[116], expected 167, is %d", + check_msg->certificate_bytes[116]); + ck_assert_msg( + check_msg->certificate_bytes[117] == 248, + "incorrect value for certificate_bytes[117], expected 248, is %d", + check_msg->certificate_bytes[117]); + ck_assert_msg( + check_msg->certificate_bytes[118] == 247, + "incorrect value for certificate_bytes[118], expected 247, is %d", + check_msg->certificate_bytes[118]); + ck_assert_msg( + check_msg->certificate_bytes[119] == 32, + "incorrect value for certificate_bytes[119], expected 32, is %d", + check_msg->certificate_bytes[119]); + ck_assert_msg( + check_msg->certificate_bytes[120] == 239, + "incorrect value for certificate_bytes[120], expected 239, is %d", + check_msg->certificate_bytes[120]); + ck_assert_msg( + check_msg->certificate_bytes[121] == 194, + "incorrect value for certificate_bytes[121], expected 194, is %d", + check_msg->certificate_bytes[121]); + ck_assert_msg( + check_msg->certificate_bytes[122] == 188, + "incorrect value for certificate_bytes[122], expected 188, is %d", + check_msg->certificate_bytes[122]); + ck_assert_msg( + check_msg->certificate_bytes[123] == 254, + "incorrect value for certificate_bytes[123], expected 254, is %d", + check_msg->certificate_bytes[123]); + ck_assert_msg( + check_msg->certificate_bytes[124] == 114, + "incorrect value for certificate_bytes[124], expected 114, is %d", + check_msg->certificate_bytes[124]); + ck_assert_msg( + check_msg->certificate_bytes[125] == 117, + "incorrect value for certificate_bytes[125], expected 117, is %d", + check_msg->certificate_bytes[125]); + ck_assert_msg( + check_msg->certificate_bytes[126] == 83, + "incorrect value for certificate_bytes[126], expected 83, is %d", + check_msg->certificate_bytes[126]); + ck_assert_msg( + check_msg->certificate_bytes[127] == 25, + "incorrect value for certificate_bytes[127], expected 25, is %d", + check_msg->certificate_bytes[127]); + ck_assert_msg( + check_msg->certificate_bytes[128] == 251, + "incorrect value for certificate_bytes[128], expected 251, is %d", + check_msg->certificate_bytes[128]); + ck_assert_msg( + check_msg->certificate_bytes[129] == 191, + "incorrect value for certificate_bytes[129], expected 191, is %d", + check_msg->certificate_bytes[129]); + ck_assert_msg( + check_msg->certificate_bytes[130] == 104, + "incorrect value for certificate_bytes[130], expected 104, is %d", + check_msg->certificate_bytes[130]); + ck_assert_msg( + check_msg->certificate_bytes[131] == 240, + "incorrect value for certificate_bytes[131], expected 240, is %d", + check_msg->certificate_bytes[131]); + ck_assert_msg( + check_msg->certificate_bytes[132] == 118, + "incorrect value for certificate_bytes[132], expected 118, is %d", + check_msg->certificate_bytes[132]); + ck_assert_msg( + check_msg->certificate_bytes[133] == 68, + "incorrect value for certificate_bytes[133], expected 68, is %d", + check_msg->certificate_bytes[133]); + ck_assert_msg( + check_msg->certificate_bytes[134] == 42, + "incorrect value for certificate_bytes[134], expected 42, is %d", + check_msg->certificate_bytes[134]); + ck_assert_msg( + check_msg->certificate_bytes[135] == 93, + "incorrect value for certificate_bytes[135], expected 93, is %d", + check_msg->certificate_bytes[135]); + ck_assert_msg( + check_msg->certificate_bytes[136] == 18, + "incorrect value for certificate_bytes[136], expected 18, is %d", + check_msg->certificate_bytes[136]); + ck_assert_msg( + check_msg->certificate_bytes[137] == 16, + "incorrect value for certificate_bytes[137], expected 16, is %d", + check_msg->certificate_bytes[137]); + ck_assert_msg( + check_msg->certificate_bytes[138] == 37, + "incorrect value for certificate_bytes[138], expected 37, is %d", + check_msg->certificate_bytes[138]); + ck_assert_msg( + check_msg->certificate_bytes[139] == 232, + "incorrect value for certificate_bytes[139], expected 232, is %d", + check_msg->certificate_bytes[139]); + ck_assert_msg( + check_msg->certificate_bytes[140] == 99, + "incorrect value for certificate_bytes[140], expected 99, is %d", + check_msg->certificate_bytes[140]); + ck_assert_msg( + check_msg->certificate_bytes[141] == 179, + "incorrect value for certificate_bytes[141], expected 179, is %d", + check_msg->certificate_bytes[141]); + ck_assert_msg( + check_msg->certificate_bytes[142] == 23, + "incorrect value for certificate_bytes[142], expected 23, is %d", + check_msg->certificate_bytes[142]); + ck_assert_msg( + check_msg->certificate_bytes[143] == 90, + "incorrect value for certificate_bytes[143], expected 90, is %d", + check_msg->certificate_bytes[143]); + ck_assert_msg( + check_msg->certificate_bytes[144] == 94, + "incorrect value for certificate_bytes[144], expected 94, is %d", + check_msg->certificate_bytes[144]); + ck_assert_msg( + check_msg->certificate_bytes[145] == 136, + "incorrect value for certificate_bytes[145], expected 136, is %d", + check_msg->certificate_bytes[145]); + ck_assert_msg( + check_msg->certificate_bytes[146] == 6, + "incorrect value for certificate_bytes[146], expected 6, is %d", + check_msg->certificate_bytes[146]); + ck_assert_msg( + check_msg->certificate_bytes[147] == 125, + "incorrect value for certificate_bytes[147], expected 125, is %d", + check_msg->certificate_bytes[147]); + ck_assert_msg( + check_msg->certificate_bytes[148] == 91, + "incorrect value for certificate_bytes[148], expected 91, is %d", + check_msg->certificate_bytes[148]); + ck_assert_msg( + check_msg->certificate_bytes[149] == 255, + "incorrect value for certificate_bytes[149], expected 255, is %d", + check_msg->certificate_bytes[149]); + ck_assert_msg( + check_msg->certificate_bytes[150] == 15, + "incorrect value for certificate_bytes[150], expected 15, is %d", + check_msg->certificate_bytes[150]); + ck_assert_msg( + check_msg->certificate_bytes[151] == 71, + "incorrect value for certificate_bytes[151], expected 71, is %d", + check_msg->certificate_bytes[151]); + ck_assert_msg( + check_msg->certificate_bytes[152] == 43, + "incorrect value for certificate_bytes[152], expected 43, is %d", + check_msg->certificate_bytes[152]); + ck_assert_msg( + check_msg->certificate_bytes[153] == 46, + "incorrect value for certificate_bytes[153], expected 46, is %d", + check_msg->certificate_bytes[153]); + ck_assert_msg( + check_msg->certificate_bytes[154] == 25, + "incorrect value for certificate_bytes[154], expected 25, is %d", + check_msg->certificate_bytes[154]); + ck_assert_msg( + check_msg->certificate_bytes[155] == 252, + "incorrect value for certificate_bytes[155], expected 252, is %d", + check_msg->certificate_bytes[155]); + ck_assert_msg( + check_msg->certificate_bytes[156] == 229, + "incorrect value for certificate_bytes[156], expected 229, is %d", + check_msg->certificate_bytes[156]); + ck_assert_msg( + check_msg->certificate_bytes[157] == 80, + "incorrect value for certificate_bytes[157], expected 80, is %d", + check_msg->certificate_bytes[157]); + ck_assert_msg( + check_msg->certificate_bytes[158] == 143, + "incorrect value for certificate_bytes[158], expected 143, is %d", + check_msg->certificate_bytes[158]); + ck_assert_msg( + check_msg->certificate_bytes[159] == 58, + "incorrect value for certificate_bytes[159], expected 58, is %d", + check_msg->certificate_bytes[159]); + ck_assert_msg( + check_msg->certificate_bytes[160] == 241, + "incorrect value for certificate_bytes[160], expected 241, is %d", + check_msg->certificate_bytes[160]); + ck_assert_msg( + check_msg->certificate_bytes[161] == 11, + "incorrect value for certificate_bytes[161], expected 11, is %d", + check_msg->certificate_bytes[161]); + ck_assert_msg( + check_msg->certificate_bytes[162] == 62, + "incorrect value for certificate_bytes[162], expected 62, is %d", + check_msg->certificate_bytes[162]); + ck_assert_msg( + check_msg->certificate_bytes[163] == 181, + "incorrect value for certificate_bytes[163], expected 181, is %d", + check_msg->certificate_bytes[163]); + ck_assert_msg( + check_msg->certificate_bytes[164] == 155, + "incorrect value for certificate_bytes[164], expected 155, is %d", + check_msg->certificate_bytes[164]); + ck_assert_msg( + check_msg->certificate_bytes[165] == 53, + "incorrect value for certificate_bytes[165], expected 53, is %d", + check_msg->certificate_bytes[165]); + ck_assert_msg( + check_msg->certificate_bytes[166] == 153, + "incorrect value for certificate_bytes[166], expected 153, is %d", + check_msg->certificate_bytes[166]); + ck_assert_msg( + check_msg->certificate_bytes[167] == 149, + "incorrect value for certificate_bytes[167], expected 149, is %d", + check_msg->certificate_bytes[167]); + ck_assert_msg( + check_msg->certificate_bytes[168] == 152, + "incorrect value for certificate_bytes[168], expected 152, is %d", + check_msg->certificate_bytes[168]); + ck_assert_msg( + check_msg->certificate_bytes[169] == 227, + "incorrect value for certificate_bytes[169], expected 227, is %d", + check_msg->certificate_bytes[169]); + ck_assert_msg( + check_msg->certificate_bytes[170] == 150, + "incorrect value for certificate_bytes[170], expected 150, is %d", + check_msg->certificate_bytes[170]); + ck_assert_msg( + check_msg->certificate_bytes[171] == 87, + "incorrect value for certificate_bytes[171], expected 87, is %d", + check_msg->certificate_bytes[171]); + ck_assert_msg( + check_msg->certificate_bytes[172] == 112, + "incorrect value for certificate_bytes[172], expected 112, is %d", + check_msg->certificate_bytes[172]); + ck_assert_msg( + check_msg->certificate_bytes[173] == 165, + "incorrect value for certificate_bytes[173], expected 165, is %d", + check_msg->certificate_bytes[173]); + ck_assert_msg( + check_msg->certificate_bytes[174] == 2, + "incorrect value for certificate_bytes[174], expected 2, is %d", + check_msg->certificate_bytes[174]); + ck_assert_msg( + check_msg->certificate_bytes[175] == 128, + "incorrect value for certificate_bytes[175], expected 128, is %d", + check_msg->certificate_bytes[175]); + ck_assert_msg( + check_msg->certificate_bytes[176] == 231, + "incorrect value for certificate_bytes[176], expected 231, is %d", + check_msg->certificate_bytes[176]); + ck_assert_msg( + check_msg->certificate_bytes[177] == 25, + "incorrect value for certificate_bytes[177], expected 25, is %d", + check_msg->certificate_bytes[177]); + ck_assert_msg( + check_msg->certificate_bytes[178] == 157, + "incorrect value for certificate_bytes[178], expected 157, is %d", + check_msg->certificate_bytes[178]); + ck_assert_msg( + check_msg->certificate_bytes[179] == 244, + "incorrect value for certificate_bytes[179], expected 244, is %d", + check_msg->certificate_bytes[179]); + ck_assert_msg( + check_msg->certificate_bytes[180] == 204, + "incorrect value for certificate_bytes[180], expected 204, is %d", + check_msg->certificate_bytes[180]); + ck_assert_msg( + check_msg->certificate_bytes[181] == 108, + "incorrect value for certificate_bytes[181], expected 108, is %d", + check_msg->certificate_bytes[181]); + ck_assert_msg( + check_msg->certificate_bytes[182] == 253, + "incorrect value for certificate_bytes[182], expected 253, is %d", + check_msg->certificate_bytes[182]); + ck_assert_msg( + check_msg->certificate_bytes[183] == 127, + "incorrect value for certificate_bytes[183], expected 127, is %d", + check_msg->certificate_bytes[183]); + ck_assert_msg( + check_msg->certificate_bytes[184] == 122, + "incorrect value for certificate_bytes[184], expected 122, is %d", + check_msg->certificate_bytes[184]); + ck_assert_msg( + check_msg->certificate_bytes[185] == 145, + "incorrect value for certificate_bytes[185], expected 145, is %d", + check_msg->certificate_bytes[185]); + ck_assert_msg( + check_msg->certificate_bytes[186] == 113, + "incorrect value for certificate_bytes[186], expected 113, is %d", + check_msg->certificate_bytes[186]); + ck_assert_msg( + check_msg->certificate_bytes[187] == 162, + "incorrect value for certificate_bytes[187], expected 162, is %d", + check_msg->certificate_bytes[187]); + ck_assert_msg( + check_msg->certificate_bytes[188] == 197, + "incorrect value for certificate_bytes[188], expected 197, is %d", + check_msg->certificate_bytes[188]); + ck_assert_msg( + check_msg->certificate_bytes[189] == 171, + "incorrect value for certificate_bytes[189], expected 171, is %d", + check_msg->certificate_bytes[189]); + ck_assert_msg( + check_msg->certificate_bytes[190] == 199, + "incorrect value for certificate_bytes[190], expected 199, is %d", + check_msg->certificate_bytes[190]); + ck_assert_msg( + check_msg->certificate_bytes[191] == 54, + "incorrect value for certificate_bytes[191], expected 54, is %d", + check_msg->certificate_bytes[191]); + ck_assert_msg( + check_msg->certificate_bytes[192] == 184, + "incorrect value for certificate_bytes[192], expected 184, is %d", + check_msg->certificate_bytes[192]); + ck_assert_msg( + check_msg->certificate_bytes[193] == 222, + "incorrect value for certificate_bytes[193], expected 222, is %d", + check_msg->certificate_bytes[193]); + ck_assert_msg( + check_msg->certificate_bytes[194] == 206, + "incorrect value for certificate_bytes[194], expected 206, is %d", + check_msg->certificate_bytes[194]); + ck_assert_msg( + check_msg->certificate_bytes[195] == 67, + "incorrect value for certificate_bytes[195], expected 67, is %d", + check_msg->certificate_bytes[195]); + ck_assert_msg( + check_msg->certificate_bytes[196] == 144, + "incorrect value for certificate_bytes[196], expected 144, is %d", + check_msg->certificate_bytes[196]); + ck_assert_msg( + check_msg->certificate_bytes[197] == 78, + "incorrect value for certificate_bytes[197], expected 78, is %d", + check_msg->certificate_bytes[197]); + ck_assert_msg( + check_msg->certificate_bytes[198] == 187, + "incorrect value for certificate_bytes[198], expected 187, is %d", + check_msg->certificate_bytes[198]); + ck_assert_msg( + check_msg->certificate_bytes[199] == 207, + "incorrect value for certificate_bytes[199], expected 207, is %d", + check_msg->certificate_bytes[199]); + ck_assert_msg( + check_msg->certificate_bytes[200] == 60, + "incorrect value for certificate_bytes[200], expected 60, is %d", + check_msg->certificate_bytes[200]); + ck_assert_msg( + check_msg->certificate_bytes[201] == 211, + "incorrect value for certificate_bytes[201], expected 211, is %d", + check_msg->certificate_bytes[201]); + ck_assert_msg( + check_msg->certificate_bytes[202] == 141, + "incorrect value for certificate_bytes[202], expected 141, is %d", + check_msg->certificate_bytes[202]); + ck_assert_msg( + check_msg->certificate_bytes[203] == 135, + "incorrect value for certificate_bytes[203], expected 135, is %d", + check_msg->certificate_bytes[203]); + ck_assert_msg( + check_msg->certificate_bytes[204] == 106, + "incorrect value for certificate_bytes[204], expected 106, is %d", + check_msg->certificate_bytes[204]); + ck_assert_msg( + check_msg->certificate_bytes[205] == 220, + "incorrect value for certificate_bytes[205], expected 220, is %d", + check_msg->certificate_bytes[205]); + ck_assert_msg( + check_msg->certificate_bytes[206] == 79, + "incorrect value for certificate_bytes[206], expected 79, is %d", + check_msg->certificate_bytes[206]); + ck_assert_msg( + check_msg->certificate_bytes[207] == 183, + "incorrect value for certificate_bytes[207], expected 183, is %d", + check_msg->certificate_bytes[207]); + ck_assert_msg( + check_msg->certificate_bytes[208] == 245, + "incorrect value for certificate_bytes[208], expected 245, is %d", + check_msg->certificate_bytes[208]); + ck_assert_msg( + check_msg->certificate_bytes[209] == 21, + "incorrect value for certificate_bytes[209], expected 21, is %d", + check_msg->certificate_bytes[209]); + ck_assert_msg( + check_msg->certificate_bytes[210] == 161, + "incorrect value for certificate_bytes[210], expected 161, is %d", + check_msg->certificate_bytes[210]); + ck_assert_msg( + check_msg->certificate_bytes[211] == 168, + "incorrect value for certificate_bytes[211], expected 168, is %d", + check_msg->certificate_bytes[211]); + ck_assert_msg( + check_msg->certificate_bytes[212] == 34, + "incorrect value for certificate_bytes[212], expected 34, is %d", + check_msg->certificate_bytes[212]); + ck_assert_msg( + check_msg->certificate_bytes[213] == 129, + "incorrect value for certificate_bytes[213], expected 129, is %d", + check_msg->certificate_bytes[213]); + ck_assert_msg( + check_msg->certificate_bytes[214] == 50, + "incorrect value for certificate_bytes[214], expected 50, is %d", + check_msg->certificate_bytes[214]); + ck_assert_msg( + check_msg->certificate_bytes[215] == 176, + "incorrect value for certificate_bytes[215], expected 176, is %d", + check_msg->certificate_bytes[215]); + ck_assert_msg( + check_msg->certificate_bytes[216] == 1, + "incorrect value for certificate_bytes[216], expected 1, is %d", + check_msg->certificate_bytes[216]); + ck_assert_msg( + check_msg->certificate_bytes[217] == 218, + "incorrect value for certificate_bytes[217], expected 218, is %d", + check_msg->certificate_bytes[217]); + ck_assert_msg( + check_msg->certificate_bytes[218] == 20, + "incorrect value for certificate_bytes[218], expected 20, is %d", + check_msg->certificate_bytes[218]); + ck_assert_msg( + check_msg->certificate_bytes[219] == 130, + "incorrect value for certificate_bytes[219], expected 130, is %d", + check_msg->certificate_bytes[219]); + ck_assert_msg( + check_msg->certificate_bytes[220] == 59, + "incorrect value for certificate_bytes[220], expected 59, is %d", + check_msg->certificate_bytes[220]); + ck_assert_msg( + check_msg->certificate_bytes[221] == 249, + "incorrect value for certificate_bytes[221], expected 249, is %d", + check_msg->certificate_bytes[221]); + ck_assert_msg( + check_msg->certificate_bytes[222] == 109, + "incorrect value for certificate_bytes[222], expected 109, is %d", + check_msg->certificate_bytes[222]); + ck_assert_msg( + check_msg->certificate_bytes[223] == 219, + "incorrect value for certificate_bytes[223], expected 219, is %d", + check_msg->certificate_bytes[223]); + ck_assert_msg( + check_msg->certificate_bytes[224] == 0, + "incorrect value for certificate_bytes[224], expected 0, is %d", + check_msg->certificate_bytes[224]); + ck_assert_msg( + check_msg->certificate_bytes[225] == 100, + "incorrect value for certificate_bytes[225], expected 100, is %d", + check_msg->certificate_bytes[225]); + ck_assert_msg( + check_msg->certificate_bytes[226] == 103, + "incorrect value for certificate_bytes[226], expected 103, is %d", + check_msg->certificate_bytes[226]); + ck_assert_msg( + check_msg->certificate_bytes[227] == 55, + "incorrect value for certificate_bytes[227], expected 55, is %d", + check_msg->certificate_bytes[227]); + ck_assert_msg( + check_msg->certificate_bytes[228] == 29, + "incorrect value for certificate_bytes[228], expected 29, is %d", + check_msg->certificate_bytes[228]); + ck_assert_msg( + check_msg->certificate_bytes[229] == 242, + "incorrect value for certificate_bytes[229], expected 242, is %d", + check_msg->certificate_bytes[229]); + ck_assert_msg( + check_msg->certificate_bytes[230] == 110, + "incorrect value for certificate_bytes[230], expected 110, is %d", + check_msg->certificate_bytes[230]); + ck_assert_msg( + check_msg->certificate_bytes[231] == 154, + "incorrect value for certificate_bytes[231], expected 154, is %d", + check_msg->certificate_bytes[231]); + ck_assert_msg( + check_msg->certificate_bytes[232] == 190, + "incorrect value for certificate_bytes[232], expected 190, is %d", + check_msg->certificate_bytes[232]); + ck_assert_msg( + check_msg->certificate_bytes[233] == 233, + "incorrect value for certificate_bytes[233], expected 233, is %d", + check_msg->certificate_bytes[233]); + ck_assert_msg( + check_msg->certificate_bytes[234] == 142, + "incorrect value for certificate_bytes[234], expected 142, is %d", + check_msg->certificate_bytes[234]); + ck_assert_msg( + check_msg->certificate_bytes[235] == 45, + "incorrect value for certificate_bytes[235], expected 45, is %d", + check_msg->certificate_bytes[235]); + ck_assert_msg( + check_msg->certificate_bytes[236] == 61, + "incorrect value for certificate_bytes[236], expected 61, is %d", + check_msg->certificate_bytes[236]); + ck_assert_msg( + check_msg->certificate_bytes[237] == 215, + "incorrect value for certificate_bytes[237], expected 215, is %d", + check_msg->certificate_bytes[237]); + ck_assert_msg( + check_msg->certificate_bytes[238] == 202, + "incorrect value for certificate_bytes[238], expected 202, is %d", + check_msg->certificate_bytes[238]); + ck_assert_msg( + check_msg->certificate_bytes[239] == 238, + "incorrect value for certificate_bytes[239], expected 238, is %d", + check_msg->certificate_bytes[239]); + ck_assert_msg( + check_msg->certificate_bytes[240] == 88, + "incorrect value for certificate_bytes[240], expected 88, is %d", + check_msg->certificate_bytes[240]); + ck_assert_msg( + check_msg->certificate_bytes[241] == 209, + "incorrect value for certificate_bytes[241], expected 209, is %d", + check_msg->certificate_bytes[241]); + ck_assert_msg( + check_msg->certificate_bytes[242] == 70, + "incorrect value for certificate_bytes[242], expected 70, is %d", + check_msg->certificate_bytes[242]); + ck_assert_msg( + check_msg->certificate_bytes[243] == 63, + "incorrect value for certificate_bytes[243], expected 63, is %d", + check_msg->certificate_bytes[243]); + ck_assert_msg( + check_msg->certificate_bytes[244] == 151, + "incorrect value for certificate_bytes[244], expected 151, is %d", + check_msg->certificate_bytes[244]); + ck_assert_msg( + check_msg->certificate_bytes[245] == 27, + "incorrect value for certificate_bytes[245], expected 27, is %d", + check_msg->certificate_bytes[245]); + ck_assert_msg( + check_msg->certificate_bytes[246] == 102, + "incorrect value for certificate_bytes[246], expected 102, is %d", + check_msg->certificate_bytes[246]); + ck_assert_msg(check_msg->certificate_id[0] == 10, + "incorrect value for certificate_id[0], expected 10, is %d", + check_msg->certificate_id[0]); + ck_assert_msg(check_msg->certificate_id[1] == 11, + "incorrect value for certificate_id[1], expected 11, is %d", + check_msg->certificate_id[1]); + ck_assert_msg(check_msg->certificate_id[2] == 12, + "incorrect value for certificate_id[2], expected 12, is %d", + check_msg->certificate_id[2]); + ck_assert_msg(check_msg->certificate_id[3] == 13, + "incorrect value for certificate_id[3], expected 13, is %d", + check_msg->certificate_id[3]); + ck_assert_msg(check_msg->flags == 2, + "incorrect value for flags, expected 2, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_msg == 48, + "incorrect value for n_msg, expected 48, is %d", + check_msg->n_msg); } } END_TEST -Suite* legacy_auto_check_sbp_signing_MsgEcdsaCertificate_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_signing_MsgEcdsaCertificate"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_signing_MsgEcdsaCertificate"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_signing_MsgEcdsaCertificate); +Suite *legacy_auto_check_sbp_signing_MsgEcdsaCertificate_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_signing_MsgEcdsaCertificate"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_signing_MsgEcdsaCertificate"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_signing_MsgEcdsaCertificate); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignature.c b/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignature.c index 9bd644941..ff172233d 100644 --- a/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignature.c +++ b/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignature.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaSignature ) -{ +START_TEST(test_legacy_auto_check_sbp_signing_MsgEcdsaSignature) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaSignature ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,26 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaSignature ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xC08, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xC08, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xC08, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xC08, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,8,12,66,0,83,0,1,2,1,2,3,4,72,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,10,21,23,232,131, }; + u8 encoded_frame[] = { + 85, 8, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 232, 131, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ecdsa_signature_t* test_msg = ( msg_ecdsa_signature_t* )test_msg_storage; + msg_ecdsa_signature_t *test_msg = (msg_ecdsa_signature_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->certificate_id) == 0) { // Cope with variable length arrays @@ -542,145 +548,320 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaSignature ) } test_msg->signed_messages[2] = 23; test_msg->stream_counter = 1; - sbp_payload_send(&sbp_state, 0xC08, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xC08, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xC08, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ecdsa_signature_t* check_msg = ( msg_ecdsa_signature_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ecdsa_signature_t *check_msg = + (msg_ecdsa_signature_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->certificate_id[0] == 1, "incorrect value for certificate_id[0], expected 1, is %d", check_msg->certificate_id[0]); - ck_assert_msg(check_msg->certificate_id[1] == 2, "incorrect value for certificate_id[1], expected 2, is %d", check_msg->certificate_id[1]); - ck_assert_msg(check_msg->certificate_id[2] == 3, "incorrect value for certificate_id[2], expected 3, is %d", check_msg->certificate_id[2]); - ck_assert_msg(check_msg->certificate_id[3] == 4, "incorrect value for certificate_id[3], expected 4, is %d", check_msg->certificate_id[3]); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->on_demand_counter == 2, "incorrect value for on_demand_counter, expected 2, is %d", check_msg->on_demand_counter); - ck_assert_msg(check_msg->signature.data[0] == 0, "incorrect value for signature.data[0], expected 0, is %d", check_msg->signature.data[0]); - ck_assert_msg(check_msg->signature.data[1] == 1, "incorrect value for signature.data[1], expected 1, is %d", check_msg->signature.data[1]); - ck_assert_msg(check_msg->signature.data[2] == 2, "incorrect value for signature.data[2], expected 2, is %d", check_msg->signature.data[2]); - ck_assert_msg(check_msg->signature.data[3] == 3, "incorrect value for signature.data[3], expected 3, is %d", check_msg->signature.data[3]); - ck_assert_msg(check_msg->signature.data[4] == 4, "incorrect value for signature.data[4], expected 4, is %d", check_msg->signature.data[4]); - ck_assert_msg(check_msg->signature.data[5] == 5, "incorrect value for signature.data[5], expected 5, is %d", check_msg->signature.data[5]); - ck_assert_msg(check_msg->signature.data[6] == 6, "incorrect value for signature.data[6], expected 6, is %d", check_msg->signature.data[6]); - ck_assert_msg(check_msg->signature.data[7] == 7, "incorrect value for signature.data[7], expected 7, is %d", check_msg->signature.data[7]); - ck_assert_msg(check_msg->signature.data[8] == 8, "incorrect value for signature.data[8], expected 8, is %d", check_msg->signature.data[8]); - ck_assert_msg(check_msg->signature.data[9] == 9, "incorrect value for signature.data[9], expected 9, is %d", check_msg->signature.data[9]); - ck_assert_msg(check_msg->signature.data[10] == 10, "incorrect value for signature.data[10], expected 10, is %d", check_msg->signature.data[10]); - ck_assert_msg(check_msg->signature.data[11] == 11, "incorrect value for signature.data[11], expected 11, is %d", check_msg->signature.data[11]); - ck_assert_msg(check_msg->signature.data[12] == 12, "incorrect value for signature.data[12], expected 12, is %d", check_msg->signature.data[12]); - ck_assert_msg(check_msg->signature.data[13] == 13, "incorrect value for signature.data[13], expected 13, is %d", check_msg->signature.data[13]); - ck_assert_msg(check_msg->signature.data[14] == 14, "incorrect value for signature.data[14], expected 14, is %d", check_msg->signature.data[14]); - ck_assert_msg(check_msg->signature.data[15] == 15, "incorrect value for signature.data[15], expected 15, is %d", check_msg->signature.data[15]); - ck_assert_msg(check_msg->signature.data[16] == 16, "incorrect value for signature.data[16], expected 16, is %d", check_msg->signature.data[16]); - ck_assert_msg(check_msg->signature.data[17] == 17, "incorrect value for signature.data[17], expected 17, is %d", check_msg->signature.data[17]); - ck_assert_msg(check_msg->signature.data[18] == 18, "incorrect value for signature.data[18], expected 18, is %d", check_msg->signature.data[18]); - ck_assert_msg(check_msg->signature.data[19] == 19, "incorrect value for signature.data[19], expected 19, is %d", check_msg->signature.data[19]); - ck_assert_msg(check_msg->signature.data[20] == 20, "incorrect value for signature.data[20], expected 20, is %d", check_msg->signature.data[20]); - ck_assert_msg(check_msg->signature.data[21] == 21, "incorrect value for signature.data[21], expected 21, is %d", check_msg->signature.data[21]); - ck_assert_msg(check_msg->signature.data[22] == 22, "incorrect value for signature.data[22], expected 22, is %d", check_msg->signature.data[22]); - ck_assert_msg(check_msg->signature.data[23] == 23, "incorrect value for signature.data[23], expected 23, is %d", check_msg->signature.data[23]); - ck_assert_msg(check_msg->signature.data[24] == 24, "incorrect value for signature.data[24], expected 24, is %d", check_msg->signature.data[24]); - ck_assert_msg(check_msg->signature.data[25] == 25, "incorrect value for signature.data[25], expected 25, is %d", check_msg->signature.data[25]); - ck_assert_msg(check_msg->signature.data[26] == 26, "incorrect value for signature.data[26], expected 26, is %d", check_msg->signature.data[26]); - ck_assert_msg(check_msg->signature.data[27] == 27, "incorrect value for signature.data[27], expected 27, is %d", check_msg->signature.data[27]); - ck_assert_msg(check_msg->signature.data[28] == 28, "incorrect value for signature.data[28], expected 28, is %d", check_msg->signature.data[28]); - ck_assert_msg(check_msg->signature.data[29] == 29, "incorrect value for signature.data[29], expected 29, is %d", check_msg->signature.data[29]); - ck_assert_msg(check_msg->signature.data[30] == 30, "incorrect value for signature.data[30], expected 30, is %d", check_msg->signature.data[30]); - ck_assert_msg(check_msg->signature.data[31] == 31, "incorrect value for signature.data[31], expected 31, is %d", check_msg->signature.data[31]); - ck_assert_msg(check_msg->signature.data[32] == 32, "incorrect value for signature.data[32], expected 32, is %d", check_msg->signature.data[32]); - ck_assert_msg(check_msg->signature.data[33] == 33, "incorrect value for signature.data[33], expected 33, is %d", check_msg->signature.data[33]); - ck_assert_msg(check_msg->signature.data[34] == 34, "incorrect value for signature.data[34], expected 34, is %d", check_msg->signature.data[34]); - ck_assert_msg(check_msg->signature.data[35] == 35, "incorrect value for signature.data[35], expected 35, is %d", check_msg->signature.data[35]); - ck_assert_msg(check_msg->signature.data[36] == 36, "incorrect value for signature.data[36], expected 36, is %d", check_msg->signature.data[36]); - ck_assert_msg(check_msg->signature.data[37] == 37, "incorrect value for signature.data[37], expected 37, is %d", check_msg->signature.data[37]); - ck_assert_msg(check_msg->signature.data[38] == 38, "incorrect value for signature.data[38], expected 38, is %d", check_msg->signature.data[38]); - ck_assert_msg(check_msg->signature.data[39] == 39, "incorrect value for signature.data[39], expected 39, is %d", check_msg->signature.data[39]); - ck_assert_msg(check_msg->signature.data[40] == 40, "incorrect value for signature.data[40], expected 40, is %d", check_msg->signature.data[40]); - ck_assert_msg(check_msg->signature.data[41] == 41, "incorrect value for signature.data[41], expected 41, is %d", check_msg->signature.data[41]); - ck_assert_msg(check_msg->signature.data[42] == 42, "incorrect value for signature.data[42], expected 42, is %d", check_msg->signature.data[42]); - ck_assert_msg(check_msg->signature.data[43] == 43, "incorrect value for signature.data[43], expected 43, is %d", check_msg->signature.data[43]); - ck_assert_msg(check_msg->signature.data[44] == 44, "incorrect value for signature.data[44], expected 44, is %d", check_msg->signature.data[44]); - ck_assert_msg(check_msg->signature.data[45] == 45, "incorrect value for signature.data[45], expected 45, is %d", check_msg->signature.data[45]); - ck_assert_msg(check_msg->signature.data[46] == 46, "incorrect value for signature.data[46], expected 46, is %d", check_msg->signature.data[46]); - ck_assert_msg(check_msg->signature.data[47] == 47, "incorrect value for signature.data[47], expected 47, is %d", check_msg->signature.data[47]); - ck_assert_msg(check_msg->signature.data[48] == 48, "incorrect value for signature.data[48], expected 48, is %d", check_msg->signature.data[48]); - ck_assert_msg(check_msg->signature.data[49] == 49, "incorrect value for signature.data[49], expected 49, is %d", check_msg->signature.data[49]); - ck_assert_msg(check_msg->signature.data[50] == 50, "incorrect value for signature.data[50], expected 50, is %d", check_msg->signature.data[50]); - ck_assert_msg(check_msg->signature.data[51] == 51, "incorrect value for signature.data[51], expected 51, is %d", check_msg->signature.data[51]); - ck_assert_msg(check_msg->signature.data[52] == 52, "incorrect value for signature.data[52], expected 52, is %d", check_msg->signature.data[52]); - ck_assert_msg(check_msg->signature.data[53] == 53, "incorrect value for signature.data[53], expected 53, is %d", check_msg->signature.data[53]); - ck_assert_msg(check_msg->signature.data[54] == 54, "incorrect value for signature.data[54], expected 54, is %d", check_msg->signature.data[54]); - ck_assert_msg(check_msg->signature.data[55] == 55, "incorrect value for signature.data[55], expected 55, is %d", check_msg->signature.data[55]); - ck_assert_msg(check_msg->signature.data[56] == 56, "incorrect value for signature.data[56], expected 56, is %d", check_msg->signature.data[56]); - ck_assert_msg(check_msg->signature.data[57] == 57, "incorrect value for signature.data[57], expected 57, is %d", check_msg->signature.data[57]); - ck_assert_msg(check_msg->signature.data[58] == 58, "incorrect value for signature.data[58], expected 58, is %d", check_msg->signature.data[58]); - ck_assert_msg(check_msg->signature.data[59] == 59, "incorrect value for signature.data[59], expected 59, is %d", check_msg->signature.data[59]); - ck_assert_msg(check_msg->signature.data[60] == 60, "incorrect value for signature.data[60], expected 60, is %d", check_msg->signature.data[60]); - ck_assert_msg(check_msg->signature.data[61] == 61, "incorrect value for signature.data[61], expected 61, is %d", check_msg->signature.data[61]); - ck_assert_msg(check_msg->signature.data[62] == 62, "incorrect value for signature.data[62], expected 62, is %d", check_msg->signature.data[62]); - ck_assert_msg(check_msg->signature.data[63] == 63, "incorrect value for signature.data[63], expected 63, is %d", check_msg->signature.data[63]); - ck_assert_msg(check_msg->signature.data[64] == 64, "incorrect value for signature.data[64], expected 64, is %d", check_msg->signature.data[64]); - ck_assert_msg(check_msg->signature.data[65] == 65, "incorrect value for signature.data[65], expected 65, is %d", check_msg->signature.data[65]); - ck_assert_msg(check_msg->signature.data[66] == 66, "incorrect value for signature.data[66], expected 66, is %d", check_msg->signature.data[66]); - ck_assert_msg(check_msg->signature.data[67] == 67, "incorrect value for signature.data[67], expected 67, is %d", check_msg->signature.data[67]); - ck_assert_msg(check_msg->signature.data[68] == 68, "incorrect value for signature.data[68], expected 68, is %d", check_msg->signature.data[68]); - ck_assert_msg(check_msg->signature.data[69] == 69, "incorrect value for signature.data[69], expected 69, is %d", check_msg->signature.data[69]); - ck_assert_msg(check_msg->signature.data[70] == 70, "incorrect value for signature.data[70], expected 70, is %d", check_msg->signature.data[70]); - ck_assert_msg(check_msg->signature.data[71] == 71, "incorrect value for signature.data[71], expected 71, is %d", check_msg->signature.data[71]); - ck_assert_msg(check_msg->signature.len == 72, "incorrect value for signature.len, expected 72, is %d", check_msg->signature.len); - ck_assert_msg(check_msg->signed_messages[0] == 10, "incorrect value for signed_messages[0], expected 10, is %d", check_msg->signed_messages[0]); - ck_assert_msg(check_msg->signed_messages[1] == 21, "incorrect value for signed_messages[1], expected 21, is %d", check_msg->signed_messages[1]); - ck_assert_msg(check_msg->signed_messages[2] == 23, "incorrect value for signed_messages[2], expected 23, is %d", check_msg->signed_messages[2]); - ck_assert_msg(check_msg->stream_counter == 1, "incorrect value for stream_counter, expected 1, is %d", check_msg->stream_counter); + ck_assert_msg(check_msg->certificate_id[0] == 1, + "incorrect value for certificate_id[0], expected 1, is %d", + check_msg->certificate_id[0]); + ck_assert_msg(check_msg->certificate_id[1] == 2, + "incorrect value for certificate_id[1], expected 2, is %d", + check_msg->certificate_id[1]); + ck_assert_msg(check_msg->certificate_id[2] == 3, + "incorrect value for certificate_id[2], expected 3, is %d", + check_msg->certificate_id[2]); + ck_assert_msg(check_msg->certificate_id[3] == 4, + "incorrect value for certificate_id[3], expected 4, is %d", + check_msg->certificate_id[3]); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->on_demand_counter == 2, + "incorrect value for on_demand_counter, expected 2, is %d", + check_msg->on_demand_counter); + ck_assert_msg(check_msg->signature.data[0] == 0, + "incorrect value for signature.data[0], expected 0, is %d", + check_msg->signature.data[0]); + ck_assert_msg(check_msg->signature.data[1] == 1, + "incorrect value for signature.data[1], expected 1, is %d", + check_msg->signature.data[1]); + ck_assert_msg(check_msg->signature.data[2] == 2, + "incorrect value for signature.data[2], expected 2, is %d", + check_msg->signature.data[2]); + ck_assert_msg(check_msg->signature.data[3] == 3, + "incorrect value for signature.data[3], expected 3, is %d", + check_msg->signature.data[3]); + ck_assert_msg(check_msg->signature.data[4] == 4, + "incorrect value for signature.data[4], expected 4, is %d", + check_msg->signature.data[4]); + ck_assert_msg(check_msg->signature.data[5] == 5, + "incorrect value for signature.data[5], expected 5, is %d", + check_msg->signature.data[5]); + ck_assert_msg(check_msg->signature.data[6] == 6, + "incorrect value for signature.data[6], expected 6, is %d", + check_msg->signature.data[6]); + ck_assert_msg(check_msg->signature.data[7] == 7, + "incorrect value for signature.data[7], expected 7, is %d", + check_msg->signature.data[7]); + ck_assert_msg(check_msg->signature.data[8] == 8, + "incorrect value for signature.data[8], expected 8, is %d", + check_msg->signature.data[8]); + ck_assert_msg(check_msg->signature.data[9] == 9, + "incorrect value for signature.data[9], expected 9, is %d", + check_msg->signature.data[9]); + ck_assert_msg(check_msg->signature.data[10] == 10, + "incorrect value for signature.data[10], expected 10, is %d", + check_msg->signature.data[10]); + ck_assert_msg(check_msg->signature.data[11] == 11, + "incorrect value for signature.data[11], expected 11, is %d", + check_msg->signature.data[11]); + ck_assert_msg(check_msg->signature.data[12] == 12, + "incorrect value for signature.data[12], expected 12, is %d", + check_msg->signature.data[12]); + ck_assert_msg(check_msg->signature.data[13] == 13, + "incorrect value for signature.data[13], expected 13, is %d", + check_msg->signature.data[13]); + ck_assert_msg(check_msg->signature.data[14] == 14, + "incorrect value for signature.data[14], expected 14, is %d", + check_msg->signature.data[14]); + ck_assert_msg(check_msg->signature.data[15] == 15, + "incorrect value for signature.data[15], expected 15, is %d", + check_msg->signature.data[15]); + ck_assert_msg(check_msg->signature.data[16] == 16, + "incorrect value for signature.data[16], expected 16, is %d", + check_msg->signature.data[16]); + ck_assert_msg(check_msg->signature.data[17] == 17, + "incorrect value for signature.data[17], expected 17, is %d", + check_msg->signature.data[17]); + ck_assert_msg(check_msg->signature.data[18] == 18, + "incorrect value for signature.data[18], expected 18, is %d", + check_msg->signature.data[18]); + ck_assert_msg(check_msg->signature.data[19] == 19, + "incorrect value for signature.data[19], expected 19, is %d", + check_msg->signature.data[19]); + ck_assert_msg(check_msg->signature.data[20] == 20, + "incorrect value for signature.data[20], expected 20, is %d", + check_msg->signature.data[20]); + ck_assert_msg(check_msg->signature.data[21] == 21, + "incorrect value for signature.data[21], expected 21, is %d", + check_msg->signature.data[21]); + ck_assert_msg(check_msg->signature.data[22] == 22, + "incorrect value for signature.data[22], expected 22, is %d", + check_msg->signature.data[22]); + ck_assert_msg(check_msg->signature.data[23] == 23, + "incorrect value for signature.data[23], expected 23, is %d", + check_msg->signature.data[23]); + ck_assert_msg(check_msg->signature.data[24] == 24, + "incorrect value for signature.data[24], expected 24, is %d", + check_msg->signature.data[24]); + ck_assert_msg(check_msg->signature.data[25] == 25, + "incorrect value for signature.data[25], expected 25, is %d", + check_msg->signature.data[25]); + ck_assert_msg(check_msg->signature.data[26] == 26, + "incorrect value for signature.data[26], expected 26, is %d", + check_msg->signature.data[26]); + ck_assert_msg(check_msg->signature.data[27] == 27, + "incorrect value for signature.data[27], expected 27, is %d", + check_msg->signature.data[27]); + ck_assert_msg(check_msg->signature.data[28] == 28, + "incorrect value for signature.data[28], expected 28, is %d", + check_msg->signature.data[28]); + ck_assert_msg(check_msg->signature.data[29] == 29, + "incorrect value for signature.data[29], expected 29, is %d", + check_msg->signature.data[29]); + ck_assert_msg(check_msg->signature.data[30] == 30, + "incorrect value for signature.data[30], expected 30, is %d", + check_msg->signature.data[30]); + ck_assert_msg(check_msg->signature.data[31] == 31, + "incorrect value for signature.data[31], expected 31, is %d", + check_msg->signature.data[31]); + ck_assert_msg(check_msg->signature.data[32] == 32, + "incorrect value for signature.data[32], expected 32, is %d", + check_msg->signature.data[32]); + ck_assert_msg(check_msg->signature.data[33] == 33, + "incorrect value for signature.data[33], expected 33, is %d", + check_msg->signature.data[33]); + ck_assert_msg(check_msg->signature.data[34] == 34, + "incorrect value for signature.data[34], expected 34, is %d", + check_msg->signature.data[34]); + ck_assert_msg(check_msg->signature.data[35] == 35, + "incorrect value for signature.data[35], expected 35, is %d", + check_msg->signature.data[35]); + ck_assert_msg(check_msg->signature.data[36] == 36, + "incorrect value for signature.data[36], expected 36, is %d", + check_msg->signature.data[36]); + ck_assert_msg(check_msg->signature.data[37] == 37, + "incorrect value for signature.data[37], expected 37, is %d", + check_msg->signature.data[37]); + ck_assert_msg(check_msg->signature.data[38] == 38, + "incorrect value for signature.data[38], expected 38, is %d", + check_msg->signature.data[38]); + ck_assert_msg(check_msg->signature.data[39] == 39, + "incorrect value for signature.data[39], expected 39, is %d", + check_msg->signature.data[39]); + ck_assert_msg(check_msg->signature.data[40] == 40, + "incorrect value for signature.data[40], expected 40, is %d", + check_msg->signature.data[40]); + ck_assert_msg(check_msg->signature.data[41] == 41, + "incorrect value for signature.data[41], expected 41, is %d", + check_msg->signature.data[41]); + ck_assert_msg(check_msg->signature.data[42] == 42, + "incorrect value for signature.data[42], expected 42, is %d", + check_msg->signature.data[42]); + ck_assert_msg(check_msg->signature.data[43] == 43, + "incorrect value for signature.data[43], expected 43, is %d", + check_msg->signature.data[43]); + ck_assert_msg(check_msg->signature.data[44] == 44, + "incorrect value for signature.data[44], expected 44, is %d", + check_msg->signature.data[44]); + ck_assert_msg(check_msg->signature.data[45] == 45, + "incorrect value for signature.data[45], expected 45, is %d", + check_msg->signature.data[45]); + ck_assert_msg(check_msg->signature.data[46] == 46, + "incorrect value for signature.data[46], expected 46, is %d", + check_msg->signature.data[46]); + ck_assert_msg(check_msg->signature.data[47] == 47, + "incorrect value for signature.data[47], expected 47, is %d", + check_msg->signature.data[47]); + ck_assert_msg(check_msg->signature.data[48] == 48, + "incorrect value for signature.data[48], expected 48, is %d", + check_msg->signature.data[48]); + ck_assert_msg(check_msg->signature.data[49] == 49, + "incorrect value for signature.data[49], expected 49, is %d", + check_msg->signature.data[49]); + ck_assert_msg(check_msg->signature.data[50] == 50, + "incorrect value for signature.data[50], expected 50, is %d", + check_msg->signature.data[50]); + ck_assert_msg(check_msg->signature.data[51] == 51, + "incorrect value for signature.data[51], expected 51, is %d", + check_msg->signature.data[51]); + ck_assert_msg(check_msg->signature.data[52] == 52, + "incorrect value for signature.data[52], expected 52, is %d", + check_msg->signature.data[52]); + ck_assert_msg(check_msg->signature.data[53] == 53, + "incorrect value for signature.data[53], expected 53, is %d", + check_msg->signature.data[53]); + ck_assert_msg(check_msg->signature.data[54] == 54, + "incorrect value for signature.data[54], expected 54, is %d", + check_msg->signature.data[54]); + ck_assert_msg(check_msg->signature.data[55] == 55, + "incorrect value for signature.data[55], expected 55, is %d", + check_msg->signature.data[55]); + ck_assert_msg(check_msg->signature.data[56] == 56, + "incorrect value for signature.data[56], expected 56, is %d", + check_msg->signature.data[56]); + ck_assert_msg(check_msg->signature.data[57] == 57, + "incorrect value for signature.data[57], expected 57, is %d", + check_msg->signature.data[57]); + ck_assert_msg(check_msg->signature.data[58] == 58, + "incorrect value for signature.data[58], expected 58, is %d", + check_msg->signature.data[58]); + ck_assert_msg(check_msg->signature.data[59] == 59, + "incorrect value for signature.data[59], expected 59, is %d", + check_msg->signature.data[59]); + ck_assert_msg(check_msg->signature.data[60] == 60, + "incorrect value for signature.data[60], expected 60, is %d", + check_msg->signature.data[60]); + ck_assert_msg(check_msg->signature.data[61] == 61, + "incorrect value for signature.data[61], expected 61, is %d", + check_msg->signature.data[61]); + ck_assert_msg(check_msg->signature.data[62] == 62, + "incorrect value for signature.data[62], expected 62, is %d", + check_msg->signature.data[62]); + ck_assert_msg(check_msg->signature.data[63] == 63, + "incorrect value for signature.data[63], expected 63, is %d", + check_msg->signature.data[63]); + ck_assert_msg(check_msg->signature.data[64] == 64, + "incorrect value for signature.data[64], expected 64, is %d", + check_msg->signature.data[64]); + ck_assert_msg(check_msg->signature.data[65] == 65, + "incorrect value for signature.data[65], expected 65, is %d", + check_msg->signature.data[65]); + ck_assert_msg(check_msg->signature.data[66] == 66, + "incorrect value for signature.data[66], expected 66, is %d", + check_msg->signature.data[66]); + ck_assert_msg(check_msg->signature.data[67] == 67, + "incorrect value for signature.data[67], expected 67, is %d", + check_msg->signature.data[67]); + ck_assert_msg(check_msg->signature.data[68] == 68, + "incorrect value for signature.data[68], expected 68, is %d", + check_msg->signature.data[68]); + ck_assert_msg(check_msg->signature.data[69] == 69, + "incorrect value for signature.data[69], expected 69, is %d", + check_msg->signature.data[69]); + ck_assert_msg(check_msg->signature.data[70] == 70, + "incorrect value for signature.data[70], expected 70, is %d", + check_msg->signature.data[70]); + ck_assert_msg(check_msg->signature.data[71] == 71, + "incorrect value for signature.data[71], expected 71, is %d", + check_msg->signature.data[71]); + ck_assert_msg(check_msg->signature.len == 72, + "incorrect value for signature.len, expected 72, is %d", + check_msg->signature.len); + ck_assert_msg(check_msg->signed_messages[0] == 10, + "incorrect value for signed_messages[0], expected 10, is %d", + check_msg->signed_messages[0]); + ck_assert_msg(check_msg->signed_messages[1] == 21, + "incorrect value for signed_messages[1], expected 21, is %d", + check_msg->signed_messages[1]); + ck_assert_msg(check_msg->signed_messages[2] == 23, + "incorrect value for signed_messages[2], expected 23, is %d", + check_msg->signed_messages[2]); + ck_assert_msg(check_msg->stream_counter == 1, + "incorrect value for stream_counter, expected 1, is %d", + check_msg->stream_counter); } } END_TEST -Suite* legacy_auto_check_sbp_signing_MsgEcdsaSignature_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_signing_MsgEcdsaSignature"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_signing_MsgEcdsaSignature"); +Suite *legacy_auto_check_sbp_signing_MsgEcdsaSignature_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_signing_MsgEcdsaSignature"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_signing_MsgEcdsaSignature"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_signing_MsgEcdsaSignature); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDepA.c b/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDepA.c index 315d6193a..ffa941603 100644 --- a/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDepA.c +++ b/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,40 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xC06, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xC06, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xC06, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xC06, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,6,12,66,0,255,0,1,2,1,2,3,4,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,10,21,23,63,140,37,130,106,28,40,165,179,73,178,60,126,114,78,113,27,95,3,62,104,145,96,19,92,123,14,90,153,183,9,72,81,118,112,124,16,182,76,146,115,58,144,17,105,66,31,135,54,100,84,181,103,11,88,133,155,167,173,143,86,158,20,168,132,141,102,50,48,71,147,53,87,1,108,138,36,134,139,163,82,43,52,150,12,30,110,156,107,120,91,122,69,164,170,116,25,94,5,22,24,162,175,38,157,98,44,160,47,97,142,8,74,13,177,15,128,26,131,154,65,169,55,136,125,171,161,29,129,151,68,166,51,70,45,56,79,149,99,42,101,152,39,89,180,64,49,6,80,172,32,109,2,119,93,176,0,33,57,34,18,85,121,137,83,111,59,7,77,4,117,159,148,35,61,41,67,46,127,75,174,97,172, }; + u8 encoded_frame[] = { + 85, 6, 12, 66, 0, 255, 0, 1, 2, 1, 2, 3, 4, 0, + 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, + 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, + 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, + 1, 2, 3, 4, 5, 6, 7, 10, 21, 23, 63, 140, 37, 130, + 106, 28, 40, 165, 179, 73, 178, 60, 126, 114, 78, 113, 27, 95, + 3, 62, 104, 145, 96, 19, 92, 123, 14, 90, 153, 183, 9, 72, + 81, 118, 112, 124, 16, 182, 76, 146, 115, 58, 144, 17, 105, 66, + 31, 135, 54, 100, 84, 181, 103, 11, 88, 133, 155, 167, 173, 143, + 86, 158, 20, 168, 132, 141, 102, 50, 48, 71, 147, 53, 87, 1, + 108, 138, 36, 134, 139, 163, 82, 43, 52, 150, 12, 30, 110, 156, + 107, 120, 91, 122, 69, 164, 170, 116, 25, 94, 5, 22, 24, 162, + 175, 38, 157, 98, 44, 160, 47, 97, 142, 8, 74, 13, 177, 15, + 128, 26, 131, 154, 65, 169, 55, 136, 125, 171, 161, 29, 129, 151, + 68, 166, 51, 70, 45, 56, 79, 149, 99, 42, 101, 152, 39, 89, + 180, 64, 49, 6, 80, 172, 32, 109, 2, 119, 93, 176, 0, 33, + 57, 34, 18, 85, 121, 137, 83, 111, 59, 7, 77, 4, 117, 159, + 148, 35, 61, 41, 67, 46, 127, 75, 174, 97, 172, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ecdsa_signature_dep_a_t* test_msg = ( msg_ecdsa_signature_dep_a_t* )test_msg_storage; + msg_ecdsa_signature_dep_a_t *test_msg = + (msg_ecdsa_signature_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->certificate_id) == 0) { // Cope with variable length arrays @@ -1406,318 +1426,963 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA ) } test_msg->signed_messages[183] = 174; test_msg->stream_counter = 1; - sbp_payload_send(&sbp_state, 0xC06, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xC06, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xC06, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ecdsa_signature_dep_a_t* check_msg = ( msg_ecdsa_signature_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ecdsa_signature_dep_a_t *check_msg = + (msg_ecdsa_signature_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->certificate_id[0] == 1, "incorrect value for certificate_id[0], expected 1, is %d", check_msg->certificate_id[0]); - ck_assert_msg(check_msg->certificate_id[1] == 2, "incorrect value for certificate_id[1], expected 2, is %d", check_msg->certificate_id[1]); - ck_assert_msg(check_msg->certificate_id[2] == 3, "incorrect value for certificate_id[2], expected 3, is %d", check_msg->certificate_id[2]); - ck_assert_msg(check_msg->certificate_id[3] == 4, "incorrect value for certificate_id[3], expected 4, is %d", check_msg->certificate_id[3]); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->on_demand_counter == 2, "incorrect value for on_demand_counter, expected 2, is %d", check_msg->on_demand_counter); - ck_assert_msg(check_msg->signature[0] == 0, "incorrect value for signature[0], expected 0, is %d", check_msg->signature[0]); - ck_assert_msg(check_msg->signature[1] == 1, "incorrect value for signature[1], expected 1, is %d", check_msg->signature[1]); - ck_assert_msg(check_msg->signature[2] == 2, "incorrect value for signature[2], expected 2, is %d", check_msg->signature[2]); - ck_assert_msg(check_msg->signature[3] == 3, "incorrect value for signature[3], expected 3, is %d", check_msg->signature[3]); - ck_assert_msg(check_msg->signature[4] == 4, "incorrect value for signature[4], expected 4, is %d", check_msg->signature[4]); - ck_assert_msg(check_msg->signature[5] == 5, "incorrect value for signature[5], expected 5, is %d", check_msg->signature[5]); - ck_assert_msg(check_msg->signature[6] == 6, "incorrect value for signature[6], expected 6, is %d", check_msg->signature[6]); - ck_assert_msg(check_msg->signature[7] == 7, "incorrect value for signature[7], expected 7, is %d", check_msg->signature[7]); - ck_assert_msg(check_msg->signature[8] == 0, "incorrect value for signature[8], expected 0, is %d", check_msg->signature[8]); - ck_assert_msg(check_msg->signature[9] == 1, "incorrect value for signature[9], expected 1, is %d", check_msg->signature[9]); - ck_assert_msg(check_msg->signature[10] == 2, "incorrect value for signature[10], expected 2, is %d", check_msg->signature[10]); - ck_assert_msg(check_msg->signature[11] == 3, "incorrect value for signature[11], expected 3, is %d", check_msg->signature[11]); - ck_assert_msg(check_msg->signature[12] == 4, "incorrect value for signature[12], expected 4, is %d", check_msg->signature[12]); - ck_assert_msg(check_msg->signature[13] == 5, "incorrect value for signature[13], expected 5, is %d", check_msg->signature[13]); - ck_assert_msg(check_msg->signature[14] == 6, "incorrect value for signature[14], expected 6, is %d", check_msg->signature[14]); - ck_assert_msg(check_msg->signature[15] == 7, "incorrect value for signature[15], expected 7, is %d", check_msg->signature[15]); - ck_assert_msg(check_msg->signature[16] == 0, "incorrect value for signature[16], expected 0, is %d", check_msg->signature[16]); - ck_assert_msg(check_msg->signature[17] == 1, "incorrect value for signature[17], expected 1, is %d", check_msg->signature[17]); - ck_assert_msg(check_msg->signature[18] == 2, "incorrect value for signature[18], expected 2, is %d", check_msg->signature[18]); - ck_assert_msg(check_msg->signature[19] == 3, "incorrect value for signature[19], expected 3, is %d", check_msg->signature[19]); - ck_assert_msg(check_msg->signature[20] == 4, "incorrect value for signature[20], expected 4, is %d", check_msg->signature[20]); - ck_assert_msg(check_msg->signature[21] == 5, "incorrect value for signature[21], expected 5, is %d", check_msg->signature[21]); - ck_assert_msg(check_msg->signature[22] == 6, "incorrect value for signature[22], expected 6, is %d", check_msg->signature[22]); - ck_assert_msg(check_msg->signature[23] == 7, "incorrect value for signature[23], expected 7, is %d", check_msg->signature[23]); - ck_assert_msg(check_msg->signature[24] == 0, "incorrect value for signature[24], expected 0, is %d", check_msg->signature[24]); - ck_assert_msg(check_msg->signature[25] == 1, "incorrect value for signature[25], expected 1, is %d", check_msg->signature[25]); - ck_assert_msg(check_msg->signature[26] == 2, "incorrect value for signature[26], expected 2, is %d", check_msg->signature[26]); - ck_assert_msg(check_msg->signature[27] == 3, "incorrect value for signature[27], expected 3, is %d", check_msg->signature[27]); - ck_assert_msg(check_msg->signature[28] == 4, "incorrect value for signature[28], expected 4, is %d", check_msg->signature[28]); - ck_assert_msg(check_msg->signature[29] == 5, "incorrect value for signature[29], expected 5, is %d", check_msg->signature[29]); - ck_assert_msg(check_msg->signature[30] == 6, "incorrect value for signature[30], expected 6, is %d", check_msg->signature[30]); - ck_assert_msg(check_msg->signature[31] == 7, "incorrect value for signature[31], expected 7, is %d", check_msg->signature[31]); - ck_assert_msg(check_msg->signature[32] == 0, "incorrect value for signature[32], expected 0, is %d", check_msg->signature[32]); - ck_assert_msg(check_msg->signature[33] == 1, "incorrect value for signature[33], expected 1, is %d", check_msg->signature[33]); - ck_assert_msg(check_msg->signature[34] == 2, "incorrect value for signature[34], expected 2, is %d", check_msg->signature[34]); - ck_assert_msg(check_msg->signature[35] == 3, "incorrect value for signature[35], expected 3, is %d", check_msg->signature[35]); - ck_assert_msg(check_msg->signature[36] == 4, "incorrect value for signature[36], expected 4, is %d", check_msg->signature[36]); - ck_assert_msg(check_msg->signature[37] == 5, "incorrect value for signature[37], expected 5, is %d", check_msg->signature[37]); - ck_assert_msg(check_msg->signature[38] == 6, "incorrect value for signature[38], expected 6, is %d", check_msg->signature[38]); - ck_assert_msg(check_msg->signature[39] == 7, "incorrect value for signature[39], expected 7, is %d", check_msg->signature[39]); - ck_assert_msg(check_msg->signature[40] == 0, "incorrect value for signature[40], expected 0, is %d", check_msg->signature[40]); - ck_assert_msg(check_msg->signature[41] == 1, "incorrect value for signature[41], expected 1, is %d", check_msg->signature[41]); - ck_assert_msg(check_msg->signature[42] == 2, "incorrect value for signature[42], expected 2, is %d", check_msg->signature[42]); - ck_assert_msg(check_msg->signature[43] == 3, "incorrect value for signature[43], expected 3, is %d", check_msg->signature[43]); - ck_assert_msg(check_msg->signature[44] == 4, "incorrect value for signature[44], expected 4, is %d", check_msg->signature[44]); - ck_assert_msg(check_msg->signature[45] == 5, "incorrect value for signature[45], expected 5, is %d", check_msg->signature[45]); - ck_assert_msg(check_msg->signature[46] == 6, "incorrect value for signature[46], expected 6, is %d", check_msg->signature[46]); - ck_assert_msg(check_msg->signature[47] == 7, "incorrect value for signature[47], expected 7, is %d", check_msg->signature[47]); - ck_assert_msg(check_msg->signature[48] == 0, "incorrect value for signature[48], expected 0, is %d", check_msg->signature[48]); - ck_assert_msg(check_msg->signature[49] == 1, "incorrect value for signature[49], expected 1, is %d", check_msg->signature[49]); - ck_assert_msg(check_msg->signature[50] == 2, "incorrect value for signature[50], expected 2, is %d", check_msg->signature[50]); - ck_assert_msg(check_msg->signature[51] == 3, "incorrect value for signature[51], expected 3, is %d", check_msg->signature[51]); - ck_assert_msg(check_msg->signature[52] == 4, "incorrect value for signature[52], expected 4, is %d", check_msg->signature[52]); - ck_assert_msg(check_msg->signature[53] == 5, "incorrect value for signature[53], expected 5, is %d", check_msg->signature[53]); - ck_assert_msg(check_msg->signature[54] == 6, "incorrect value for signature[54], expected 6, is %d", check_msg->signature[54]); - ck_assert_msg(check_msg->signature[55] == 7, "incorrect value for signature[55], expected 7, is %d", check_msg->signature[55]); - ck_assert_msg(check_msg->signature[56] == 0, "incorrect value for signature[56], expected 0, is %d", check_msg->signature[56]); - ck_assert_msg(check_msg->signature[57] == 1, "incorrect value for signature[57], expected 1, is %d", check_msg->signature[57]); - ck_assert_msg(check_msg->signature[58] == 2, "incorrect value for signature[58], expected 2, is %d", check_msg->signature[58]); - ck_assert_msg(check_msg->signature[59] == 3, "incorrect value for signature[59], expected 3, is %d", check_msg->signature[59]); - ck_assert_msg(check_msg->signature[60] == 4, "incorrect value for signature[60], expected 4, is %d", check_msg->signature[60]); - ck_assert_msg(check_msg->signature[61] == 5, "incorrect value for signature[61], expected 5, is %d", check_msg->signature[61]); - ck_assert_msg(check_msg->signature[62] == 6, "incorrect value for signature[62], expected 6, is %d", check_msg->signature[62]); - ck_assert_msg(check_msg->signature[63] == 7, "incorrect value for signature[63], expected 7, is %d", check_msg->signature[63]); - ck_assert_msg(check_msg->signed_messages[0] == 10, "incorrect value for signed_messages[0], expected 10, is %d", check_msg->signed_messages[0]); - ck_assert_msg(check_msg->signed_messages[1] == 21, "incorrect value for signed_messages[1], expected 21, is %d", check_msg->signed_messages[1]); - ck_assert_msg(check_msg->signed_messages[2] == 23, "incorrect value for signed_messages[2], expected 23, is %d", check_msg->signed_messages[2]); - ck_assert_msg(check_msg->signed_messages[3] == 63, "incorrect value for signed_messages[3], expected 63, is %d", check_msg->signed_messages[3]); - ck_assert_msg(check_msg->signed_messages[4] == 140, "incorrect value for signed_messages[4], expected 140, is %d", check_msg->signed_messages[4]); - ck_assert_msg(check_msg->signed_messages[5] == 37, "incorrect value for signed_messages[5], expected 37, is %d", check_msg->signed_messages[5]); - ck_assert_msg(check_msg->signed_messages[6] == 130, "incorrect value for signed_messages[6], expected 130, is %d", check_msg->signed_messages[6]); - ck_assert_msg(check_msg->signed_messages[7] == 106, "incorrect value for signed_messages[7], expected 106, is %d", check_msg->signed_messages[7]); - ck_assert_msg(check_msg->signed_messages[8] == 28, "incorrect value for signed_messages[8], expected 28, is %d", check_msg->signed_messages[8]); - ck_assert_msg(check_msg->signed_messages[9] == 40, "incorrect value for signed_messages[9], expected 40, is %d", check_msg->signed_messages[9]); - ck_assert_msg(check_msg->signed_messages[10] == 165, "incorrect value for signed_messages[10], expected 165, is %d", check_msg->signed_messages[10]); - ck_assert_msg(check_msg->signed_messages[11] == 179, "incorrect value for signed_messages[11], expected 179, is %d", check_msg->signed_messages[11]); - ck_assert_msg(check_msg->signed_messages[12] == 73, "incorrect value for signed_messages[12], expected 73, is %d", check_msg->signed_messages[12]); - ck_assert_msg(check_msg->signed_messages[13] == 178, "incorrect value for signed_messages[13], expected 178, is %d", check_msg->signed_messages[13]); - ck_assert_msg(check_msg->signed_messages[14] == 60, "incorrect value for signed_messages[14], expected 60, is %d", check_msg->signed_messages[14]); - ck_assert_msg(check_msg->signed_messages[15] == 126, "incorrect value for signed_messages[15], expected 126, is %d", check_msg->signed_messages[15]); - ck_assert_msg(check_msg->signed_messages[16] == 114, "incorrect value for signed_messages[16], expected 114, is %d", check_msg->signed_messages[16]); - ck_assert_msg(check_msg->signed_messages[17] == 78, "incorrect value for signed_messages[17], expected 78, is %d", check_msg->signed_messages[17]); - ck_assert_msg(check_msg->signed_messages[18] == 113, "incorrect value for signed_messages[18], expected 113, is %d", check_msg->signed_messages[18]); - ck_assert_msg(check_msg->signed_messages[19] == 27, "incorrect value for signed_messages[19], expected 27, is %d", check_msg->signed_messages[19]); - ck_assert_msg(check_msg->signed_messages[20] == 95, "incorrect value for signed_messages[20], expected 95, is %d", check_msg->signed_messages[20]); - ck_assert_msg(check_msg->signed_messages[21] == 3, "incorrect value for signed_messages[21], expected 3, is %d", check_msg->signed_messages[21]); - ck_assert_msg(check_msg->signed_messages[22] == 62, "incorrect value for signed_messages[22], expected 62, is %d", check_msg->signed_messages[22]); - ck_assert_msg(check_msg->signed_messages[23] == 104, "incorrect value for signed_messages[23], expected 104, is %d", check_msg->signed_messages[23]); - ck_assert_msg(check_msg->signed_messages[24] == 145, "incorrect value for signed_messages[24], expected 145, is %d", check_msg->signed_messages[24]); - ck_assert_msg(check_msg->signed_messages[25] == 96, "incorrect value for signed_messages[25], expected 96, is %d", check_msg->signed_messages[25]); - ck_assert_msg(check_msg->signed_messages[26] == 19, "incorrect value for signed_messages[26], expected 19, is %d", check_msg->signed_messages[26]); - ck_assert_msg(check_msg->signed_messages[27] == 92, "incorrect value for signed_messages[27], expected 92, is %d", check_msg->signed_messages[27]); - ck_assert_msg(check_msg->signed_messages[28] == 123, "incorrect value for signed_messages[28], expected 123, is %d", check_msg->signed_messages[28]); - ck_assert_msg(check_msg->signed_messages[29] == 14, "incorrect value for signed_messages[29], expected 14, is %d", check_msg->signed_messages[29]); - ck_assert_msg(check_msg->signed_messages[30] == 90, "incorrect value for signed_messages[30], expected 90, is %d", check_msg->signed_messages[30]); - ck_assert_msg(check_msg->signed_messages[31] == 153, "incorrect value for signed_messages[31], expected 153, is %d", check_msg->signed_messages[31]); - ck_assert_msg(check_msg->signed_messages[32] == 183, "incorrect value for signed_messages[32], expected 183, is %d", check_msg->signed_messages[32]); - ck_assert_msg(check_msg->signed_messages[33] == 9, "incorrect value for signed_messages[33], expected 9, is %d", check_msg->signed_messages[33]); - ck_assert_msg(check_msg->signed_messages[34] == 72, "incorrect value for signed_messages[34], expected 72, is %d", check_msg->signed_messages[34]); - ck_assert_msg(check_msg->signed_messages[35] == 81, "incorrect value for signed_messages[35], expected 81, is %d", check_msg->signed_messages[35]); - ck_assert_msg(check_msg->signed_messages[36] == 118, "incorrect value for signed_messages[36], expected 118, is %d", check_msg->signed_messages[36]); - ck_assert_msg(check_msg->signed_messages[37] == 112, "incorrect value for signed_messages[37], expected 112, is %d", check_msg->signed_messages[37]); - ck_assert_msg(check_msg->signed_messages[38] == 124, "incorrect value for signed_messages[38], expected 124, is %d", check_msg->signed_messages[38]); - ck_assert_msg(check_msg->signed_messages[39] == 16, "incorrect value for signed_messages[39], expected 16, is %d", check_msg->signed_messages[39]); - ck_assert_msg(check_msg->signed_messages[40] == 182, "incorrect value for signed_messages[40], expected 182, is %d", check_msg->signed_messages[40]); - ck_assert_msg(check_msg->signed_messages[41] == 76, "incorrect value for signed_messages[41], expected 76, is %d", check_msg->signed_messages[41]); - ck_assert_msg(check_msg->signed_messages[42] == 146, "incorrect value for signed_messages[42], expected 146, is %d", check_msg->signed_messages[42]); - ck_assert_msg(check_msg->signed_messages[43] == 115, "incorrect value for signed_messages[43], expected 115, is %d", check_msg->signed_messages[43]); - ck_assert_msg(check_msg->signed_messages[44] == 58, "incorrect value for signed_messages[44], expected 58, is %d", check_msg->signed_messages[44]); - ck_assert_msg(check_msg->signed_messages[45] == 144, "incorrect value for signed_messages[45], expected 144, is %d", check_msg->signed_messages[45]); - ck_assert_msg(check_msg->signed_messages[46] == 17, "incorrect value for signed_messages[46], expected 17, is %d", check_msg->signed_messages[46]); - ck_assert_msg(check_msg->signed_messages[47] == 105, "incorrect value for signed_messages[47], expected 105, is %d", check_msg->signed_messages[47]); - ck_assert_msg(check_msg->signed_messages[48] == 66, "incorrect value for signed_messages[48], expected 66, is %d", check_msg->signed_messages[48]); - ck_assert_msg(check_msg->signed_messages[49] == 31, "incorrect value for signed_messages[49], expected 31, is %d", check_msg->signed_messages[49]); - ck_assert_msg(check_msg->signed_messages[50] == 135, "incorrect value for signed_messages[50], expected 135, is %d", check_msg->signed_messages[50]); - ck_assert_msg(check_msg->signed_messages[51] == 54, "incorrect value for signed_messages[51], expected 54, is %d", check_msg->signed_messages[51]); - ck_assert_msg(check_msg->signed_messages[52] == 100, "incorrect value for signed_messages[52], expected 100, is %d", check_msg->signed_messages[52]); - ck_assert_msg(check_msg->signed_messages[53] == 84, "incorrect value for signed_messages[53], expected 84, is %d", check_msg->signed_messages[53]); - ck_assert_msg(check_msg->signed_messages[54] == 181, "incorrect value for signed_messages[54], expected 181, is %d", check_msg->signed_messages[54]); - ck_assert_msg(check_msg->signed_messages[55] == 103, "incorrect value for signed_messages[55], expected 103, is %d", check_msg->signed_messages[55]); - ck_assert_msg(check_msg->signed_messages[56] == 11, "incorrect value for signed_messages[56], expected 11, is %d", check_msg->signed_messages[56]); - ck_assert_msg(check_msg->signed_messages[57] == 88, "incorrect value for signed_messages[57], expected 88, is %d", check_msg->signed_messages[57]); - ck_assert_msg(check_msg->signed_messages[58] == 133, "incorrect value for signed_messages[58], expected 133, is %d", check_msg->signed_messages[58]); - ck_assert_msg(check_msg->signed_messages[59] == 155, "incorrect value for signed_messages[59], expected 155, is %d", check_msg->signed_messages[59]); - ck_assert_msg(check_msg->signed_messages[60] == 167, "incorrect value for signed_messages[60], expected 167, is %d", check_msg->signed_messages[60]); - ck_assert_msg(check_msg->signed_messages[61] == 173, "incorrect value for signed_messages[61], expected 173, is %d", check_msg->signed_messages[61]); - ck_assert_msg(check_msg->signed_messages[62] == 143, "incorrect value for signed_messages[62], expected 143, is %d", check_msg->signed_messages[62]); - ck_assert_msg(check_msg->signed_messages[63] == 86, "incorrect value for signed_messages[63], expected 86, is %d", check_msg->signed_messages[63]); - ck_assert_msg(check_msg->signed_messages[64] == 158, "incorrect value for signed_messages[64], expected 158, is %d", check_msg->signed_messages[64]); - ck_assert_msg(check_msg->signed_messages[65] == 20, "incorrect value for signed_messages[65], expected 20, is %d", check_msg->signed_messages[65]); - ck_assert_msg(check_msg->signed_messages[66] == 168, "incorrect value for signed_messages[66], expected 168, is %d", check_msg->signed_messages[66]); - ck_assert_msg(check_msg->signed_messages[67] == 132, "incorrect value for signed_messages[67], expected 132, is %d", check_msg->signed_messages[67]); - ck_assert_msg(check_msg->signed_messages[68] == 141, "incorrect value for signed_messages[68], expected 141, is %d", check_msg->signed_messages[68]); - ck_assert_msg(check_msg->signed_messages[69] == 102, "incorrect value for signed_messages[69], expected 102, is %d", check_msg->signed_messages[69]); - ck_assert_msg(check_msg->signed_messages[70] == 50, "incorrect value for signed_messages[70], expected 50, is %d", check_msg->signed_messages[70]); - ck_assert_msg(check_msg->signed_messages[71] == 48, "incorrect value for signed_messages[71], expected 48, is %d", check_msg->signed_messages[71]); - ck_assert_msg(check_msg->signed_messages[72] == 71, "incorrect value for signed_messages[72], expected 71, is %d", check_msg->signed_messages[72]); - ck_assert_msg(check_msg->signed_messages[73] == 147, "incorrect value for signed_messages[73], expected 147, is %d", check_msg->signed_messages[73]); - ck_assert_msg(check_msg->signed_messages[74] == 53, "incorrect value for signed_messages[74], expected 53, is %d", check_msg->signed_messages[74]); - ck_assert_msg(check_msg->signed_messages[75] == 87, "incorrect value for signed_messages[75], expected 87, is %d", check_msg->signed_messages[75]); - ck_assert_msg(check_msg->signed_messages[76] == 1, "incorrect value for signed_messages[76], expected 1, is %d", check_msg->signed_messages[76]); - ck_assert_msg(check_msg->signed_messages[77] == 108, "incorrect value for signed_messages[77], expected 108, is %d", check_msg->signed_messages[77]); - ck_assert_msg(check_msg->signed_messages[78] == 138, "incorrect value for signed_messages[78], expected 138, is %d", check_msg->signed_messages[78]); - ck_assert_msg(check_msg->signed_messages[79] == 36, "incorrect value for signed_messages[79], expected 36, is %d", check_msg->signed_messages[79]); - ck_assert_msg(check_msg->signed_messages[80] == 134, "incorrect value for signed_messages[80], expected 134, is %d", check_msg->signed_messages[80]); - ck_assert_msg(check_msg->signed_messages[81] == 139, "incorrect value for signed_messages[81], expected 139, is %d", check_msg->signed_messages[81]); - ck_assert_msg(check_msg->signed_messages[82] == 163, "incorrect value for signed_messages[82], expected 163, is %d", check_msg->signed_messages[82]); - ck_assert_msg(check_msg->signed_messages[83] == 82, "incorrect value for signed_messages[83], expected 82, is %d", check_msg->signed_messages[83]); - ck_assert_msg(check_msg->signed_messages[84] == 43, "incorrect value for signed_messages[84], expected 43, is %d", check_msg->signed_messages[84]); - ck_assert_msg(check_msg->signed_messages[85] == 52, "incorrect value for signed_messages[85], expected 52, is %d", check_msg->signed_messages[85]); - ck_assert_msg(check_msg->signed_messages[86] == 150, "incorrect value for signed_messages[86], expected 150, is %d", check_msg->signed_messages[86]); - ck_assert_msg(check_msg->signed_messages[87] == 12, "incorrect value for signed_messages[87], expected 12, is %d", check_msg->signed_messages[87]); - ck_assert_msg(check_msg->signed_messages[88] == 30, "incorrect value for signed_messages[88], expected 30, is %d", check_msg->signed_messages[88]); - ck_assert_msg(check_msg->signed_messages[89] == 110, "incorrect value for signed_messages[89], expected 110, is %d", check_msg->signed_messages[89]); - ck_assert_msg(check_msg->signed_messages[90] == 156, "incorrect value for signed_messages[90], expected 156, is %d", check_msg->signed_messages[90]); - ck_assert_msg(check_msg->signed_messages[91] == 107, "incorrect value for signed_messages[91], expected 107, is %d", check_msg->signed_messages[91]); - ck_assert_msg(check_msg->signed_messages[92] == 120, "incorrect value for signed_messages[92], expected 120, is %d", check_msg->signed_messages[92]); - ck_assert_msg(check_msg->signed_messages[93] == 91, "incorrect value for signed_messages[93], expected 91, is %d", check_msg->signed_messages[93]); - ck_assert_msg(check_msg->signed_messages[94] == 122, "incorrect value for signed_messages[94], expected 122, is %d", check_msg->signed_messages[94]); - ck_assert_msg(check_msg->signed_messages[95] == 69, "incorrect value for signed_messages[95], expected 69, is %d", check_msg->signed_messages[95]); - ck_assert_msg(check_msg->signed_messages[96] == 164, "incorrect value for signed_messages[96], expected 164, is %d", check_msg->signed_messages[96]); - ck_assert_msg(check_msg->signed_messages[97] == 170, "incorrect value for signed_messages[97], expected 170, is %d", check_msg->signed_messages[97]); - ck_assert_msg(check_msg->signed_messages[98] == 116, "incorrect value for signed_messages[98], expected 116, is %d", check_msg->signed_messages[98]); - ck_assert_msg(check_msg->signed_messages[99] == 25, "incorrect value for signed_messages[99], expected 25, is %d", check_msg->signed_messages[99]); - ck_assert_msg(check_msg->signed_messages[100] == 94, "incorrect value for signed_messages[100], expected 94, is %d", check_msg->signed_messages[100]); - ck_assert_msg(check_msg->signed_messages[101] == 5, "incorrect value for signed_messages[101], expected 5, is %d", check_msg->signed_messages[101]); - ck_assert_msg(check_msg->signed_messages[102] == 22, "incorrect value for signed_messages[102], expected 22, is %d", check_msg->signed_messages[102]); - ck_assert_msg(check_msg->signed_messages[103] == 24, "incorrect value for signed_messages[103], expected 24, is %d", check_msg->signed_messages[103]); - ck_assert_msg(check_msg->signed_messages[104] == 162, "incorrect value for signed_messages[104], expected 162, is %d", check_msg->signed_messages[104]); - ck_assert_msg(check_msg->signed_messages[105] == 175, "incorrect value for signed_messages[105], expected 175, is %d", check_msg->signed_messages[105]); - ck_assert_msg(check_msg->signed_messages[106] == 38, "incorrect value for signed_messages[106], expected 38, is %d", check_msg->signed_messages[106]); - ck_assert_msg(check_msg->signed_messages[107] == 157, "incorrect value for signed_messages[107], expected 157, is %d", check_msg->signed_messages[107]); - ck_assert_msg(check_msg->signed_messages[108] == 98, "incorrect value for signed_messages[108], expected 98, is %d", check_msg->signed_messages[108]); - ck_assert_msg(check_msg->signed_messages[109] == 44, "incorrect value for signed_messages[109], expected 44, is %d", check_msg->signed_messages[109]); - ck_assert_msg(check_msg->signed_messages[110] == 160, "incorrect value for signed_messages[110], expected 160, is %d", check_msg->signed_messages[110]); - ck_assert_msg(check_msg->signed_messages[111] == 47, "incorrect value for signed_messages[111], expected 47, is %d", check_msg->signed_messages[111]); - ck_assert_msg(check_msg->signed_messages[112] == 97, "incorrect value for signed_messages[112], expected 97, is %d", check_msg->signed_messages[112]); - ck_assert_msg(check_msg->signed_messages[113] == 142, "incorrect value for signed_messages[113], expected 142, is %d", check_msg->signed_messages[113]); - ck_assert_msg(check_msg->signed_messages[114] == 8, "incorrect value for signed_messages[114], expected 8, is %d", check_msg->signed_messages[114]); - ck_assert_msg(check_msg->signed_messages[115] == 74, "incorrect value for signed_messages[115], expected 74, is %d", check_msg->signed_messages[115]); - ck_assert_msg(check_msg->signed_messages[116] == 13, "incorrect value for signed_messages[116], expected 13, is %d", check_msg->signed_messages[116]); - ck_assert_msg(check_msg->signed_messages[117] == 177, "incorrect value for signed_messages[117], expected 177, is %d", check_msg->signed_messages[117]); - ck_assert_msg(check_msg->signed_messages[118] == 15, "incorrect value for signed_messages[118], expected 15, is %d", check_msg->signed_messages[118]); - ck_assert_msg(check_msg->signed_messages[119] == 128, "incorrect value for signed_messages[119], expected 128, is %d", check_msg->signed_messages[119]); - ck_assert_msg(check_msg->signed_messages[120] == 26, "incorrect value for signed_messages[120], expected 26, is %d", check_msg->signed_messages[120]); - ck_assert_msg(check_msg->signed_messages[121] == 131, "incorrect value for signed_messages[121], expected 131, is %d", check_msg->signed_messages[121]); - ck_assert_msg(check_msg->signed_messages[122] == 154, "incorrect value for signed_messages[122], expected 154, is %d", check_msg->signed_messages[122]); - ck_assert_msg(check_msg->signed_messages[123] == 65, "incorrect value for signed_messages[123], expected 65, is %d", check_msg->signed_messages[123]); - ck_assert_msg(check_msg->signed_messages[124] == 169, "incorrect value for signed_messages[124], expected 169, is %d", check_msg->signed_messages[124]); - ck_assert_msg(check_msg->signed_messages[125] == 55, "incorrect value for signed_messages[125], expected 55, is %d", check_msg->signed_messages[125]); - ck_assert_msg(check_msg->signed_messages[126] == 136, "incorrect value for signed_messages[126], expected 136, is %d", check_msg->signed_messages[126]); - ck_assert_msg(check_msg->signed_messages[127] == 125, "incorrect value for signed_messages[127], expected 125, is %d", check_msg->signed_messages[127]); - ck_assert_msg(check_msg->signed_messages[128] == 171, "incorrect value for signed_messages[128], expected 171, is %d", check_msg->signed_messages[128]); - ck_assert_msg(check_msg->signed_messages[129] == 161, "incorrect value for signed_messages[129], expected 161, is %d", check_msg->signed_messages[129]); - ck_assert_msg(check_msg->signed_messages[130] == 29, "incorrect value for signed_messages[130], expected 29, is %d", check_msg->signed_messages[130]); - ck_assert_msg(check_msg->signed_messages[131] == 129, "incorrect value for signed_messages[131], expected 129, is %d", check_msg->signed_messages[131]); - ck_assert_msg(check_msg->signed_messages[132] == 151, "incorrect value for signed_messages[132], expected 151, is %d", check_msg->signed_messages[132]); - ck_assert_msg(check_msg->signed_messages[133] == 68, "incorrect value for signed_messages[133], expected 68, is %d", check_msg->signed_messages[133]); - ck_assert_msg(check_msg->signed_messages[134] == 166, "incorrect value for signed_messages[134], expected 166, is %d", check_msg->signed_messages[134]); - ck_assert_msg(check_msg->signed_messages[135] == 51, "incorrect value for signed_messages[135], expected 51, is %d", check_msg->signed_messages[135]); - ck_assert_msg(check_msg->signed_messages[136] == 70, "incorrect value for signed_messages[136], expected 70, is %d", check_msg->signed_messages[136]); - ck_assert_msg(check_msg->signed_messages[137] == 45, "incorrect value for signed_messages[137], expected 45, is %d", check_msg->signed_messages[137]); - ck_assert_msg(check_msg->signed_messages[138] == 56, "incorrect value for signed_messages[138], expected 56, is %d", check_msg->signed_messages[138]); - ck_assert_msg(check_msg->signed_messages[139] == 79, "incorrect value for signed_messages[139], expected 79, is %d", check_msg->signed_messages[139]); - ck_assert_msg(check_msg->signed_messages[140] == 149, "incorrect value for signed_messages[140], expected 149, is %d", check_msg->signed_messages[140]); - ck_assert_msg(check_msg->signed_messages[141] == 99, "incorrect value for signed_messages[141], expected 99, is %d", check_msg->signed_messages[141]); - ck_assert_msg(check_msg->signed_messages[142] == 42, "incorrect value for signed_messages[142], expected 42, is %d", check_msg->signed_messages[142]); - ck_assert_msg(check_msg->signed_messages[143] == 101, "incorrect value for signed_messages[143], expected 101, is %d", check_msg->signed_messages[143]); - ck_assert_msg(check_msg->signed_messages[144] == 152, "incorrect value for signed_messages[144], expected 152, is %d", check_msg->signed_messages[144]); - ck_assert_msg(check_msg->signed_messages[145] == 39, "incorrect value for signed_messages[145], expected 39, is %d", check_msg->signed_messages[145]); - ck_assert_msg(check_msg->signed_messages[146] == 89, "incorrect value for signed_messages[146], expected 89, is %d", check_msg->signed_messages[146]); - ck_assert_msg(check_msg->signed_messages[147] == 180, "incorrect value for signed_messages[147], expected 180, is %d", check_msg->signed_messages[147]); - ck_assert_msg(check_msg->signed_messages[148] == 64, "incorrect value for signed_messages[148], expected 64, is %d", check_msg->signed_messages[148]); - ck_assert_msg(check_msg->signed_messages[149] == 49, "incorrect value for signed_messages[149], expected 49, is %d", check_msg->signed_messages[149]); - ck_assert_msg(check_msg->signed_messages[150] == 6, "incorrect value for signed_messages[150], expected 6, is %d", check_msg->signed_messages[150]); - ck_assert_msg(check_msg->signed_messages[151] == 80, "incorrect value for signed_messages[151], expected 80, is %d", check_msg->signed_messages[151]); - ck_assert_msg(check_msg->signed_messages[152] == 172, "incorrect value for signed_messages[152], expected 172, is %d", check_msg->signed_messages[152]); - ck_assert_msg(check_msg->signed_messages[153] == 32, "incorrect value for signed_messages[153], expected 32, is %d", check_msg->signed_messages[153]); - ck_assert_msg(check_msg->signed_messages[154] == 109, "incorrect value for signed_messages[154], expected 109, is %d", check_msg->signed_messages[154]); - ck_assert_msg(check_msg->signed_messages[155] == 2, "incorrect value for signed_messages[155], expected 2, is %d", check_msg->signed_messages[155]); - ck_assert_msg(check_msg->signed_messages[156] == 119, "incorrect value for signed_messages[156], expected 119, is %d", check_msg->signed_messages[156]); - ck_assert_msg(check_msg->signed_messages[157] == 93, "incorrect value for signed_messages[157], expected 93, is %d", check_msg->signed_messages[157]); - ck_assert_msg(check_msg->signed_messages[158] == 176, "incorrect value for signed_messages[158], expected 176, is %d", check_msg->signed_messages[158]); - ck_assert_msg(check_msg->signed_messages[159] == 0, "incorrect value for signed_messages[159], expected 0, is %d", check_msg->signed_messages[159]); - ck_assert_msg(check_msg->signed_messages[160] == 33, "incorrect value for signed_messages[160], expected 33, is %d", check_msg->signed_messages[160]); - ck_assert_msg(check_msg->signed_messages[161] == 57, "incorrect value for signed_messages[161], expected 57, is %d", check_msg->signed_messages[161]); - ck_assert_msg(check_msg->signed_messages[162] == 34, "incorrect value for signed_messages[162], expected 34, is %d", check_msg->signed_messages[162]); - ck_assert_msg(check_msg->signed_messages[163] == 18, "incorrect value for signed_messages[163], expected 18, is %d", check_msg->signed_messages[163]); - ck_assert_msg(check_msg->signed_messages[164] == 85, "incorrect value for signed_messages[164], expected 85, is %d", check_msg->signed_messages[164]); - ck_assert_msg(check_msg->signed_messages[165] == 121, "incorrect value for signed_messages[165], expected 121, is %d", check_msg->signed_messages[165]); - ck_assert_msg(check_msg->signed_messages[166] == 137, "incorrect value for signed_messages[166], expected 137, is %d", check_msg->signed_messages[166]); - ck_assert_msg(check_msg->signed_messages[167] == 83, "incorrect value for signed_messages[167], expected 83, is %d", check_msg->signed_messages[167]); - ck_assert_msg(check_msg->signed_messages[168] == 111, "incorrect value for signed_messages[168], expected 111, is %d", check_msg->signed_messages[168]); - ck_assert_msg(check_msg->signed_messages[169] == 59, "incorrect value for signed_messages[169], expected 59, is %d", check_msg->signed_messages[169]); - ck_assert_msg(check_msg->signed_messages[170] == 7, "incorrect value for signed_messages[170], expected 7, is %d", check_msg->signed_messages[170]); - ck_assert_msg(check_msg->signed_messages[171] == 77, "incorrect value for signed_messages[171], expected 77, is %d", check_msg->signed_messages[171]); - ck_assert_msg(check_msg->signed_messages[172] == 4, "incorrect value for signed_messages[172], expected 4, is %d", check_msg->signed_messages[172]); - ck_assert_msg(check_msg->signed_messages[173] == 117, "incorrect value for signed_messages[173], expected 117, is %d", check_msg->signed_messages[173]); - ck_assert_msg(check_msg->signed_messages[174] == 159, "incorrect value for signed_messages[174], expected 159, is %d", check_msg->signed_messages[174]); - ck_assert_msg(check_msg->signed_messages[175] == 148, "incorrect value for signed_messages[175], expected 148, is %d", check_msg->signed_messages[175]); - ck_assert_msg(check_msg->signed_messages[176] == 35, "incorrect value for signed_messages[176], expected 35, is %d", check_msg->signed_messages[176]); - ck_assert_msg(check_msg->signed_messages[177] == 61, "incorrect value for signed_messages[177], expected 61, is %d", check_msg->signed_messages[177]); - ck_assert_msg(check_msg->signed_messages[178] == 41, "incorrect value for signed_messages[178], expected 41, is %d", check_msg->signed_messages[178]); - ck_assert_msg(check_msg->signed_messages[179] == 67, "incorrect value for signed_messages[179], expected 67, is %d", check_msg->signed_messages[179]); - ck_assert_msg(check_msg->signed_messages[180] == 46, "incorrect value for signed_messages[180], expected 46, is %d", check_msg->signed_messages[180]); - ck_assert_msg(check_msg->signed_messages[181] == 127, "incorrect value for signed_messages[181], expected 127, is %d", check_msg->signed_messages[181]); - ck_assert_msg(check_msg->signed_messages[182] == 75, "incorrect value for signed_messages[182], expected 75, is %d", check_msg->signed_messages[182]); - ck_assert_msg(check_msg->signed_messages[183] == 174, "incorrect value for signed_messages[183], expected 174, is %d", check_msg->signed_messages[183]); - ck_assert_msg(check_msg->stream_counter == 1, "incorrect value for stream_counter, expected 1, is %d", check_msg->stream_counter); + ck_assert_msg(check_msg->certificate_id[0] == 1, + "incorrect value for certificate_id[0], expected 1, is %d", + check_msg->certificate_id[0]); + ck_assert_msg(check_msg->certificate_id[1] == 2, + "incorrect value for certificate_id[1], expected 2, is %d", + check_msg->certificate_id[1]); + ck_assert_msg(check_msg->certificate_id[2] == 3, + "incorrect value for certificate_id[2], expected 3, is %d", + check_msg->certificate_id[2]); + ck_assert_msg(check_msg->certificate_id[3] == 4, + "incorrect value for certificate_id[3], expected 4, is %d", + check_msg->certificate_id[3]); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->on_demand_counter == 2, + "incorrect value for on_demand_counter, expected 2, is %d", + check_msg->on_demand_counter); + ck_assert_msg(check_msg->signature[0] == 0, + "incorrect value for signature[0], expected 0, is %d", + check_msg->signature[0]); + ck_assert_msg(check_msg->signature[1] == 1, + "incorrect value for signature[1], expected 1, is %d", + check_msg->signature[1]); + ck_assert_msg(check_msg->signature[2] == 2, + "incorrect value for signature[2], expected 2, is %d", + check_msg->signature[2]); + ck_assert_msg(check_msg->signature[3] == 3, + "incorrect value for signature[3], expected 3, is %d", + check_msg->signature[3]); + ck_assert_msg(check_msg->signature[4] == 4, + "incorrect value for signature[4], expected 4, is %d", + check_msg->signature[4]); + ck_assert_msg(check_msg->signature[5] == 5, + "incorrect value for signature[5], expected 5, is %d", + check_msg->signature[5]); + ck_assert_msg(check_msg->signature[6] == 6, + "incorrect value for signature[6], expected 6, is %d", + check_msg->signature[6]); + ck_assert_msg(check_msg->signature[7] == 7, + "incorrect value for signature[7], expected 7, is %d", + check_msg->signature[7]); + ck_assert_msg(check_msg->signature[8] == 0, + "incorrect value for signature[8], expected 0, is %d", + check_msg->signature[8]); + ck_assert_msg(check_msg->signature[9] == 1, + "incorrect value for signature[9], expected 1, is %d", + check_msg->signature[9]); + ck_assert_msg(check_msg->signature[10] == 2, + "incorrect value for signature[10], expected 2, is %d", + check_msg->signature[10]); + ck_assert_msg(check_msg->signature[11] == 3, + "incorrect value for signature[11], expected 3, is %d", + check_msg->signature[11]); + ck_assert_msg(check_msg->signature[12] == 4, + "incorrect value for signature[12], expected 4, is %d", + check_msg->signature[12]); + ck_assert_msg(check_msg->signature[13] == 5, + "incorrect value for signature[13], expected 5, is %d", + check_msg->signature[13]); + ck_assert_msg(check_msg->signature[14] == 6, + "incorrect value for signature[14], expected 6, is %d", + check_msg->signature[14]); + ck_assert_msg(check_msg->signature[15] == 7, + "incorrect value for signature[15], expected 7, is %d", + check_msg->signature[15]); + ck_assert_msg(check_msg->signature[16] == 0, + "incorrect value for signature[16], expected 0, is %d", + check_msg->signature[16]); + ck_assert_msg(check_msg->signature[17] == 1, + "incorrect value for signature[17], expected 1, is %d", + check_msg->signature[17]); + ck_assert_msg(check_msg->signature[18] == 2, + "incorrect value for signature[18], expected 2, is %d", + check_msg->signature[18]); + ck_assert_msg(check_msg->signature[19] == 3, + "incorrect value for signature[19], expected 3, is %d", + check_msg->signature[19]); + ck_assert_msg(check_msg->signature[20] == 4, + "incorrect value for signature[20], expected 4, is %d", + check_msg->signature[20]); + ck_assert_msg(check_msg->signature[21] == 5, + "incorrect value for signature[21], expected 5, is %d", + check_msg->signature[21]); + ck_assert_msg(check_msg->signature[22] == 6, + "incorrect value for signature[22], expected 6, is %d", + check_msg->signature[22]); + ck_assert_msg(check_msg->signature[23] == 7, + "incorrect value for signature[23], expected 7, is %d", + check_msg->signature[23]); + ck_assert_msg(check_msg->signature[24] == 0, + "incorrect value for signature[24], expected 0, is %d", + check_msg->signature[24]); + ck_assert_msg(check_msg->signature[25] == 1, + "incorrect value for signature[25], expected 1, is %d", + check_msg->signature[25]); + ck_assert_msg(check_msg->signature[26] == 2, + "incorrect value for signature[26], expected 2, is %d", + check_msg->signature[26]); + ck_assert_msg(check_msg->signature[27] == 3, + "incorrect value for signature[27], expected 3, is %d", + check_msg->signature[27]); + ck_assert_msg(check_msg->signature[28] == 4, + "incorrect value for signature[28], expected 4, is %d", + check_msg->signature[28]); + ck_assert_msg(check_msg->signature[29] == 5, + "incorrect value for signature[29], expected 5, is %d", + check_msg->signature[29]); + ck_assert_msg(check_msg->signature[30] == 6, + "incorrect value for signature[30], expected 6, is %d", + check_msg->signature[30]); + ck_assert_msg(check_msg->signature[31] == 7, + "incorrect value for signature[31], expected 7, is %d", + check_msg->signature[31]); + ck_assert_msg(check_msg->signature[32] == 0, + "incorrect value for signature[32], expected 0, is %d", + check_msg->signature[32]); + ck_assert_msg(check_msg->signature[33] == 1, + "incorrect value for signature[33], expected 1, is %d", + check_msg->signature[33]); + ck_assert_msg(check_msg->signature[34] == 2, + "incorrect value for signature[34], expected 2, is %d", + check_msg->signature[34]); + ck_assert_msg(check_msg->signature[35] == 3, + "incorrect value for signature[35], expected 3, is %d", + check_msg->signature[35]); + ck_assert_msg(check_msg->signature[36] == 4, + "incorrect value for signature[36], expected 4, is %d", + check_msg->signature[36]); + ck_assert_msg(check_msg->signature[37] == 5, + "incorrect value for signature[37], expected 5, is %d", + check_msg->signature[37]); + ck_assert_msg(check_msg->signature[38] == 6, + "incorrect value for signature[38], expected 6, is %d", + check_msg->signature[38]); + ck_assert_msg(check_msg->signature[39] == 7, + "incorrect value for signature[39], expected 7, is %d", + check_msg->signature[39]); + ck_assert_msg(check_msg->signature[40] == 0, + "incorrect value for signature[40], expected 0, is %d", + check_msg->signature[40]); + ck_assert_msg(check_msg->signature[41] == 1, + "incorrect value for signature[41], expected 1, is %d", + check_msg->signature[41]); + ck_assert_msg(check_msg->signature[42] == 2, + "incorrect value for signature[42], expected 2, is %d", + check_msg->signature[42]); + ck_assert_msg(check_msg->signature[43] == 3, + "incorrect value for signature[43], expected 3, is %d", + check_msg->signature[43]); + ck_assert_msg(check_msg->signature[44] == 4, + "incorrect value for signature[44], expected 4, is %d", + check_msg->signature[44]); + ck_assert_msg(check_msg->signature[45] == 5, + "incorrect value for signature[45], expected 5, is %d", + check_msg->signature[45]); + ck_assert_msg(check_msg->signature[46] == 6, + "incorrect value for signature[46], expected 6, is %d", + check_msg->signature[46]); + ck_assert_msg(check_msg->signature[47] == 7, + "incorrect value for signature[47], expected 7, is %d", + check_msg->signature[47]); + ck_assert_msg(check_msg->signature[48] == 0, + "incorrect value for signature[48], expected 0, is %d", + check_msg->signature[48]); + ck_assert_msg(check_msg->signature[49] == 1, + "incorrect value for signature[49], expected 1, is %d", + check_msg->signature[49]); + ck_assert_msg(check_msg->signature[50] == 2, + "incorrect value for signature[50], expected 2, is %d", + check_msg->signature[50]); + ck_assert_msg(check_msg->signature[51] == 3, + "incorrect value for signature[51], expected 3, is %d", + check_msg->signature[51]); + ck_assert_msg(check_msg->signature[52] == 4, + "incorrect value for signature[52], expected 4, is %d", + check_msg->signature[52]); + ck_assert_msg(check_msg->signature[53] == 5, + "incorrect value for signature[53], expected 5, is %d", + check_msg->signature[53]); + ck_assert_msg(check_msg->signature[54] == 6, + "incorrect value for signature[54], expected 6, is %d", + check_msg->signature[54]); + ck_assert_msg(check_msg->signature[55] == 7, + "incorrect value for signature[55], expected 7, is %d", + check_msg->signature[55]); + ck_assert_msg(check_msg->signature[56] == 0, + "incorrect value for signature[56], expected 0, is %d", + check_msg->signature[56]); + ck_assert_msg(check_msg->signature[57] == 1, + "incorrect value for signature[57], expected 1, is %d", + check_msg->signature[57]); + ck_assert_msg(check_msg->signature[58] == 2, + "incorrect value for signature[58], expected 2, is %d", + check_msg->signature[58]); + ck_assert_msg(check_msg->signature[59] == 3, + "incorrect value for signature[59], expected 3, is %d", + check_msg->signature[59]); + ck_assert_msg(check_msg->signature[60] == 4, + "incorrect value for signature[60], expected 4, is %d", + check_msg->signature[60]); + ck_assert_msg(check_msg->signature[61] == 5, + "incorrect value for signature[61], expected 5, is %d", + check_msg->signature[61]); + ck_assert_msg(check_msg->signature[62] == 6, + "incorrect value for signature[62], expected 6, is %d", + check_msg->signature[62]); + ck_assert_msg(check_msg->signature[63] == 7, + "incorrect value for signature[63], expected 7, is %d", + check_msg->signature[63]); + ck_assert_msg(check_msg->signed_messages[0] == 10, + "incorrect value for signed_messages[0], expected 10, is %d", + check_msg->signed_messages[0]); + ck_assert_msg(check_msg->signed_messages[1] == 21, + "incorrect value for signed_messages[1], expected 21, is %d", + check_msg->signed_messages[1]); + ck_assert_msg(check_msg->signed_messages[2] == 23, + "incorrect value for signed_messages[2], expected 23, is %d", + check_msg->signed_messages[2]); + ck_assert_msg(check_msg->signed_messages[3] == 63, + "incorrect value for signed_messages[3], expected 63, is %d", + check_msg->signed_messages[3]); + ck_assert_msg(check_msg->signed_messages[4] == 140, + "incorrect value for signed_messages[4], expected 140, is %d", + check_msg->signed_messages[4]); + ck_assert_msg(check_msg->signed_messages[5] == 37, + "incorrect value for signed_messages[5], expected 37, is %d", + check_msg->signed_messages[5]); + ck_assert_msg(check_msg->signed_messages[6] == 130, + "incorrect value for signed_messages[6], expected 130, is %d", + check_msg->signed_messages[6]); + ck_assert_msg(check_msg->signed_messages[7] == 106, + "incorrect value for signed_messages[7], expected 106, is %d", + check_msg->signed_messages[7]); + ck_assert_msg(check_msg->signed_messages[8] == 28, + "incorrect value for signed_messages[8], expected 28, is %d", + check_msg->signed_messages[8]); + ck_assert_msg(check_msg->signed_messages[9] == 40, + "incorrect value for signed_messages[9], expected 40, is %d", + check_msg->signed_messages[9]); + ck_assert_msg( + check_msg->signed_messages[10] == 165, + "incorrect value for signed_messages[10], expected 165, is %d", + check_msg->signed_messages[10]); + ck_assert_msg( + check_msg->signed_messages[11] == 179, + "incorrect value for signed_messages[11], expected 179, is %d", + check_msg->signed_messages[11]); + ck_assert_msg(check_msg->signed_messages[12] == 73, + "incorrect value for signed_messages[12], expected 73, is %d", + check_msg->signed_messages[12]); + ck_assert_msg( + check_msg->signed_messages[13] == 178, + "incorrect value for signed_messages[13], expected 178, is %d", + check_msg->signed_messages[13]); + ck_assert_msg(check_msg->signed_messages[14] == 60, + "incorrect value for signed_messages[14], expected 60, is %d", + check_msg->signed_messages[14]); + ck_assert_msg( + check_msg->signed_messages[15] == 126, + "incorrect value for signed_messages[15], expected 126, is %d", + check_msg->signed_messages[15]); + ck_assert_msg( + check_msg->signed_messages[16] == 114, + "incorrect value for signed_messages[16], expected 114, is %d", + check_msg->signed_messages[16]); + ck_assert_msg(check_msg->signed_messages[17] == 78, + "incorrect value for signed_messages[17], expected 78, is %d", + check_msg->signed_messages[17]); + ck_assert_msg( + check_msg->signed_messages[18] == 113, + "incorrect value for signed_messages[18], expected 113, is %d", + check_msg->signed_messages[18]); + ck_assert_msg(check_msg->signed_messages[19] == 27, + "incorrect value for signed_messages[19], expected 27, is %d", + check_msg->signed_messages[19]); + ck_assert_msg(check_msg->signed_messages[20] == 95, + "incorrect value for signed_messages[20], expected 95, is %d", + check_msg->signed_messages[20]); + ck_assert_msg(check_msg->signed_messages[21] == 3, + "incorrect value for signed_messages[21], expected 3, is %d", + check_msg->signed_messages[21]); + ck_assert_msg(check_msg->signed_messages[22] == 62, + "incorrect value for signed_messages[22], expected 62, is %d", + check_msg->signed_messages[22]); + ck_assert_msg( + check_msg->signed_messages[23] == 104, + "incorrect value for signed_messages[23], expected 104, is %d", + check_msg->signed_messages[23]); + ck_assert_msg( + check_msg->signed_messages[24] == 145, + "incorrect value for signed_messages[24], expected 145, is %d", + check_msg->signed_messages[24]); + ck_assert_msg(check_msg->signed_messages[25] == 96, + "incorrect value for signed_messages[25], expected 96, is %d", + check_msg->signed_messages[25]); + ck_assert_msg(check_msg->signed_messages[26] == 19, + "incorrect value for signed_messages[26], expected 19, is %d", + check_msg->signed_messages[26]); + ck_assert_msg(check_msg->signed_messages[27] == 92, + "incorrect value for signed_messages[27], expected 92, is %d", + check_msg->signed_messages[27]); + ck_assert_msg( + check_msg->signed_messages[28] == 123, + "incorrect value for signed_messages[28], expected 123, is %d", + check_msg->signed_messages[28]); + ck_assert_msg(check_msg->signed_messages[29] == 14, + "incorrect value for signed_messages[29], expected 14, is %d", + check_msg->signed_messages[29]); + ck_assert_msg(check_msg->signed_messages[30] == 90, + "incorrect value for signed_messages[30], expected 90, is %d", + check_msg->signed_messages[30]); + ck_assert_msg( + check_msg->signed_messages[31] == 153, + "incorrect value for signed_messages[31], expected 153, is %d", + check_msg->signed_messages[31]); + ck_assert_msg( + check_msg->signed_messages[32] == 183, + "incorrect value for signed_messages[32], expected 183, is %d", + check_msg->signed_messages[32]); + ck_assert_msg(check_msg->signed_messages[33] == 9, + "incorrect value for signed_messages[33], expected 9, is %d", + check_msg->signed_messages[33]); + ck_assert_msg(check_msg->signed_messages[34] == 72, + "incorrect value for signed_messages[34], expected 72, is %d", + check_msg->signed_messages[34]); + ck_assert_msg(check_msg->signed_messages[35] == 81, + "incorrect value for signed_messages[35], expected 81, is %d", + check_msg->signed_messages[35]); + ck_assert_msg( + check_msg->signed_messages[36] == 118, + "incorrect value for signed_messages[36], expected 118, is %d", + check_msg->signed_messages[36]); + ck_assert_msg( + check_msg->signed_messages[37] == 112, + "incorrect value for signed_messages[37], expected 112, is %d", + check_msg->signed_messages[37]); + ck_assert_msg( + check_msg->signed_messages[38] == 124, + "incorrect value for signed_messages[38], expected 124, is %d", + check_msg->signed_messages[38]); + ck_assert_msg(check_msg->signed_messages[39] == 16, + "incorrect value for signed_messages[39], expected 16, is %d", + check_msg->signed_messages[39]); + ck_assert_msg( + check_msg->signed_messages[40] == 182, + "incorrect value for signed_messages[40], expected 182, is %d", + check_msg->signed_messages[40]); + ck_assert_msg(check_msg->signed_messages[41] == 76, + "incorrect value for signed_messages[41], expected 76, is %d", + check_msg->signed_messages[41]); + ck_assert_msg( + check_msg->signed_messages[42] == 146, + "incorrect value for signed_messages[42], expected 146, is %d", + check_msg->signed_messages[42]); + ck_assert_msg( + check_msg->signed_messages[43] == 115, + "incorrect value for signed_messages[43], expected 115, is %d", + check_msg->signed_messages[43]); + ck_assert_msg(check_msg->signed_messages[44] == 58, + "incorrect value for signed_messages[44], expected 58, is %d", + check_msg->signed_messages[44]); + ck_assert_msg( + check_msg->signed_messages[45] == 144, + "incorrect value for signed_messages[45], expected 144, is %d", + check_msg->signed_messages[45]); + ck_assert_msg(check_msg->signed_messages[46] == 17, + "incorrect value for signed_messages[46], expected 17, is %d", + check_msg->signed_messages[46]); + ck_assert_msg( + check_msg->signed_messages[47] == 105, + "incorrect value for signed_messages[47], expected 105, is %d", + check_msg->signed_messages[47]); + ck_assert_msg(check_msg->signed_messages[48] == 66, + "incorrect value for signed_messages[48], expected 66, is %d", + check_msg->signed_messages[48]); + ck_assert_msg(check_msg->signed_messages[49] == 31, + "incorrect value for signed_messages[49], expected 31, is %d", + check_msg->signed_messages[49]); + ck_assert_msg( + check_msg->signed_messages[50] == 135, + "incorrect value for signed_messages[50], expected 135, is %d", + check_msg->signed_messages[50]); + ck_assert_msg(check_msg->signed_messages[51] == 54, + "incorrect value for signed_messages[51], expected 54, is %d", + check_msg->signed_messages[51]); + ck_assert_msg( + check_msg->signed_messages[52] == 100, + "incorrect value for signed_messages[52], expected 100, is %d", + check_msg->signed_messages[52]); + ck_assert_msg(check_msg->signed_messages[53] == 84, + "incorrect value for signed_messages[53], expected 84, is %d", + check_msg->signed_messages[53]); + ck_assert_msg( + check_msg->signed_messages[54] == 181, + "incorrect value for signed_messages[54], expected 181, is %d", + check_msg->signed_messages[54]); + ck_assert_msg( + check_msg->signed_messages[55] == 103, + "incorrect value for signed_messages[55], expected 103, is %d", + check_msg->signed_messages[55]); + ck_assert_msg(check_msg->signed_messages[56] == 11, + "incorrect value for signed_messages[56], expected 11, is %d", + check_msg->signed_messages[56]); + ck_assert_msg(check_msg->signed_messages[57] == 88, + "incorrect value for signed_messages[57], expected 88, is %d", + check_msg->signed_messages[57]); + ck_assert_msg( + check_msg->signed_messages[58] == 133, + "incorrect value for signed_messages[58], expected 133, is %d", + check_msg->signed_messages[58]); + ck_assert_msg( + check_msg->signed_messages[59] == 155, + "incorrect value for signed_messages[59], expected 155, is %d", + check_msg->signed_messages[59]); + ck_assert_msg( + check_msg->signed_messages[60] == 167, + "incorrect value for signed_messages[60], expected 167, is %d", + check_msg->signed_messages[60]); + ck_assert_msg( + check_msg->signed_messages[61] == 173, + "incorrect value for signed_messages[61], expected 173, is %d", + check_msg->signed_messages[61]); + ck_assert_msg( + check_msg->signed_messages[62] == 143, + "incorrect value for signed_messages[62], expected 143, is %d", + check_msg->signed_messages[62]); + ck_assert_msg(check_msg->signed_messages[63] == 86, + "incorrect value for signed_messages[63], expected 86, is %d", + check_msg->signed_messages[63]); + ck_assert_msg( + check_msg->signed_messages[64] == 158, + "incorrect value for signed_messages[64], expected 158, is %d", + check_msg->signed_messages[64]); + ck_assert_msg(check_msg->signed_messages[65] == 20, + "incorrect value for signed_messages[65], expected 20, is %d", + check_msg->signed_messages[65]); + ck_assert_msg( + check_msg->signed_messages[66] == 168, + "incorrect value for signed_messages[66], expected 168, is %d", + check_msg->signed_messages[66]); + ck_assert_msg( + check_msg->signed_messages[67] == 132, + "incorrect value for signed_messages[67], expected 132, is %d", + check_msg->signed_messages[67]); + ck_assert_msg( + check_msg->signed_messages[68] == 141, + "incorrect value for signed_messages[68], expected 141, is %d", + check_msg->signed_messages[68]); + ck_assert_msg( + check_msg->signed_messages[69] == 102, + "incorrect value for signed_messages[69], expected 102, is %d", + check_msg->signed_messages[69]); + ck_assert_msg(check_msg->signed_messages[70] == 50, + "incorrect value for signed_messages[70], expected 50, is %d", + check_msg->signed_messages[70]); + ck_assert_msg(check_msg->signed_messages[71] == 48, + "incorrect value for signed_messages[71], expected 48, is %d", + check_msg->signed_messages[71]); + ck_assert_msg(check_msg->signed_messages[72] == 71, + "incorrect value for signed_messages[72], expected 71, is %d", + check_msg->signed_messages[72]); + ck_assert_msg( + check_msg->signed_messages[73] == 147, + "incorrect value for signed_messages[73], expected 147, is %d", + check_msg->signed_messages[73]); + ck_assert_msg(check_msg->signed_messages[74] == 53, + "incorrect value for signed_messages[74], expected 53, is %d", + check_msg->signed_messages[74]); + ck_assert_msg(check_msg->signed_messages[75] == 87, + "incorrect value for signed_messages[75], expected 87, is %d", + check_msg->signed_messages[75]); + ck_assert_msg(check_msg->signed_messages[76] == 1, + "incorrect value for signed_messages[76], expected 1, is %d", + check_msg->signed_messages[76]); + ck_assert_msg( + check_msg->signed_messages[77] == 108, + "incorrect value for signed_messages[77], expected 108, is %d", + check_msg->signed_messages[77]); + ck_assert_msg( + check_msg->signed_messages[78] == 138, + "incorrect value for signed_messages[78], expected 138, is %d", + check_msg->signed_messages[78]); + ck_assert_msg(check_msg->signed_messages[79] == 36, + "incorrect value for signed_messages[79], expected 36, is %d", + check_msg->signed_messages[79]); + ck_assert_msg( + check_msg->signed_messages[80] == 134, + "incorrect value for signed_messages[80], expected 134, is %d", + check_msg->signed_messages[80]); + ck_assert_msg( + check_msg->signed_messages[81] == 139, + "incorrect value for signed_messages[81], expected 139, is %d", + check_msg->signed_messages[81]); + ck_assert_msg( + check_msg->signed_messages[82] == 163, + "incorrect value for signed_messages[82], expected 163, is %d", + check_msg->signed_messages[82]); + ck_assert_msg(check_msg->signed_messages[83] == 82, + "incorrect value for signed_messages[83], expected 82, is %d", + check_msg->signed_messages[83]); + ck_assert_msg(check_msg->signed_messages[84] == 43, + "incorrect value for signed_messages[84], expected 43, is %d", + check_msg->signed_messages[84]); + ck_assert_msg(check_msg->signed_messages[85] == 52, + "incorrect value for signed_messages[85], expected 52, is %d", + check_msg->signed_messages[85]); + ck_assert_msg( + check_msg->signed_messages[86] == 150, + "incorrect value for signed_messages[86], expected 150, is %d", + check_msg->signed_messages[86]); + ck_assert_msg(check_msg->signed_messages[87] == 12, + "incorrect value for signed_messages[87], expected 12, is %d", + check_msg->signed_messages[87]); + ck_assert_msg(check_msg->signed_messages[88] == 30, + "incorrect value for signed_messages[88], expected 30, is %d", + check_msg->signed_messages[88]); + ck_assert_msg( + check_msg->signed_messages[89] == 110, + "incorrect value for signed_messages[89], expected 110, is %d", + check_msg->signed_messages[89]); + ck_assert_msg( + check_msg->signed_messages[90] == 156, + "incorrect value for signed_messages[90], expected 156, is %d", + check_msg->signed_messages[90]); + ck_assert_msg( + check_msg->signed_messages[91] == 107, + "incorrect value for signed_messages[91], expected 107, is %d", + check_msg->signed_messages[91]); + ck_assert_msg( + check_msg->signed_messages[92] == 120, + "incorrect value for signed_messages[92], expected 120, is %d", + check_msg->signed_messages[92]); + ck_assert_msg(check_msg->signed_messages[93] == 91, + "incorrect value for signed_messages[93], expected 91, is %d", + check_msg->signed_messages[93]); + ck_assert_msg( + check_msg->signed_messages[94] == 122, + "incorrect value for signed_messages[94], expected 122, is %d", + check_msg->signed_messages[94]); + ck_assert_msg(check_msg->signed_messages[95] == 69, + "incorrect value for signed_messages[95], expected 69, is %d", + check_msg->signed_messages[95]); + ck_assert_msg( + check_msg->signed_messages[96] == 164, + "incorrect value for signed_messages[96], expected 164, is %d", + check_msg->signed_messages[96]); + ck_assert_msg( + check_msg->signed_messages[97] == 170, + "incorrect value for signed_messages[97], expected 170, is %d", + check_msg->signed_messages[97]); + ck_assert_msg( + check_msg->signed_messages[98] == 116, + "incorrect value for signed_messages[98], expected 116, is %d", + check_msg->signed_messages[98]); + ck_assert_msg(check_msg->signed_messages[99] == 25, + "incorrect value for signed_messages[99], expected 25, is %d", + check_msg->signed_messages[99]); + ck_assert_msg( + check_msg->signed_messages[100] == 94, + "incorrect value for signed_messages[100], expected 94, is %d", + check_msg->signed_messages[100]); + ck_assert_msg(check_msg->signed_messages[101] == 5, + "incorrect value for signed_messages[101], expected 5, is %d", + check_msg->signed_messages[101]); + ck_assert_msg( + check_msg->signed_messages[102] == 22, + "incorrect value for signed_messages[102], expected 22, is %d", + check_msg->signed_messages[102]); + ck_assert_msg( + check_msg->signed_messages[103] == 24, + "incorrect value for signed_messages[103], expected 24, is %d", + check_msg->signed_messages[103]); + ck_assert_msg( + check_msg->signed_messages[104] == 162, + "incorrect value for signed_messages[104], expected 162, is %d", + check_msg->signed_messages[104]); + ck_assert_msg( + check_msg->signed_messages[105] == 175, + "incorrect value for signed_messages[105], expected 175, is %d", + check_msg->signed_messages[105]); + ck_assert_msg( + check_msg->signed_messages[106] == 38, + "incorrect value for signed_messages[106], expected 38, is %d", + check_msg->signed_messages[106]); + ck_assert_msg( + check_msg->signed_messages[107] == 157, + "incorrect value for signed_messages[107], expected 157, is %d", + check_msg->signed_messages[107]); + ck_assert_msg( + check_msg->signed_messages[108] == 98, + "incorrect value for signed_messages[108], expected 98, is %d", + check_msg->signed_messages[108]); + ck_assert_msg( + check_msg->signed_messages[109] == 44, + "incorrect value for signed_messages[109], expected 44, is %d", + check_msg->signed_messages[109]); + ck_assert_msg( + check_msg->signed_messages[110] == 160, + "incorrect value for signed_messages[110], expected 160, is %d", + check_msg->signed_messages[110]); + ck_assert_msg( + check_msg->signed_messages[111] == 47, + "incorrect value for signed_messages[111], expected 47, is %d", + check_msg->signed_messages[111]); + ck_assert_msg( + check_msg->signed_messages[112] == 97, + "incorrect value for signed_messages[112], expected 97, is %d", + check_msg->signed_messages[112]); + ck_assert_msg( + check_msg->signed_messages[113] == 142, + "incorrect value for signed_messages[113], expected 142, is %d", + check_msg->signed_messages[113]); + ck_assert_msg(check_msg->signed_messages[114] == 8, + "incorrect value for signed_messages[114], expected 8, is %d", + check_msg->signed_messages[114]); + ck_assert_msg( + check_msg->signed_messages[115] == 74, + "incorrect value for signed_messages[115], expected 74, is %d", + check_msg->signed_messages[115]); + ck_assert_msg( + check_msg->signed_messages[116] == 13, + "incorrect value for signed_messages[116], expected 13, is %d", + check_msg->signed_messages[116]); + ck_assert_msg( + check_msg->signed_messages[117] == 177, + "incorrect value for signed_messages[117], expected 177, is %d", + check_msg->signed_messages[117]); + ck_assert_msg( + check_msg->signed_messages[118] == 15, + "incorrect value for signed_messages[118], expected 15, is %d", + check_msg->signed_messages[118]); + ck_assert_msg( + check_msg->signed_messages[119] == 128, + "incorrect value for signed_messages[119], expected 128, is %d", + check_msg->signed_messages[119]); + ck_assert_msg( + check_msg->signed_messages[120] == 26, + "incorrect value for signed_messages[120], expected 26, is %d", + check_msg->signed_messages[120]); + ck_assert_msg( + check_msg->signed_messages[121] == 131, + "incorrect value for signed_messages[121], expected 131, is %d", + check_msg->signed_messages[121]); + ck_assert_msg( + check_msg->signed_messages[122] == 154, + "incorrect value for signed_messages[122], expected 154, is %d", + check_msg->signed_messages[122]); + ck_assert_msg( + check_msg->signed_messages[123] == 65, + "incorrect value for signed_messages[123], expected 65, is %d", + check_msg->signed_messages[123]); + ck_assert_msg( + check_msg->signed_messages[124] == 169, + "incorrect value for signed_messages[124], expected 169, is %d", + check_msg->signed_messages[124]); + ck_assert_msg( + check_msg->signed_messages[125] == 55, + "incorrect value for signed_messages[125], expected 55, is %d", + check_msg->signed_messages[125]); + ck_assert_msg( + check_msg->signed_messages[126] == 136, + "incorrect value for signed_messages[126], expected 136, is %d", + check_msg->signed_messages[126]); + ck_assert_msg( + check_msg->signed_messages[127] == 125, + "incorrect value for signed_messages[127], expected 125, is %d", + check_msg->signed_messages[127]); + ck_assert_msg( + check_msg->signed_messages[128] == 171, + "incorrect value for signed_messages[128], expected 171, is %d", + check_msg->signed_messages[128]); + ck_assert_msg( + check_msg->signed_messages[129] == 161, + "incorrect value for signed_messages[129], expected 161, is %d", + check_msg->signed_messages[129]); + ck_assert_msg( + check_msg->signed_messages[130] == 29, + "incorrect value for signed_messages[130], expected 29, is %d", + check_msg->signed_messages[130]); + ck_assert_msg( + check_msg->signed_messages[131] == 129, + "incorrect value for signed_messages[131], expected 129, is %d", + check_msg->signed_messages[131]); + ck_assert_msg( + check_msg->signed_messages[132] == 151, + "incorrect value for signed_messages[132], expected 151, is %d", + check_msg->signed_messages[132]); + ck_assert_msg( + check_msg->signed_messages[133] == 68, + "incorrect value for signed_messages[133], expected 68, is %d", + check_msg->signed_messages[133]); + ck_assert_msg( + check_msg->signed_messages[134] == 166, + "incorrect value for signed_messages[134], expected 166, is %d", + check_msg->signed_messages[134]); + ck_assert_msg( + check_msg->signed_messages[135] == 51, + "incorrect value for signed_messages[135], expected 51, is %d", + check_msg->signed_messages[135]); + ck_assert_msg( + check_msg->signed_messages[136] == 70, + "incorrect value for signed_messages[136], expected 70, is %d", + check_msg->signed_messages[136]); + ck_assert_msg( + check_msg->signed_messages[137] == 45, + "incorrect value for signed_messages[137], expected 45, is %d", + check_msg->signed_messages[137]); + ck_assert_msg( + check_msg->signed_messages[138] == 56, + "incorrect value for signed_messages[138], expected 56, is %d", + check_msg->signed_messages[138]); + ck_assert_msg( + check_msg->signed_messages[139] == 79, + "incorrect value for signed_messages[139], expected 79, is %d", + check_msg->signed_messages[139]); + ck_assert_msg( + check_msg->signed_messages[140] == 149, + "incorrect value for signed_messages[140], expected 149, is %d", + check_msg->signed_messages[140]); + ck_assert_msg( + check_msg->signed_messages[141] == 99, + "incorrect value for signed_messages[141], expected 99, is %d", + check_msg->signed_messages[141]); + ck_assert_msg( + check_msg->signed_messages[142] == 42, + "incorrect value for signed_messages[142], expected 42, is %d", + check_msg->signed_messages[142]); + ck_assert_msg( + check_msg->signed_messages[143] == 101, + "incorrect value for signed_messages[143], expected 101, is %d", + check_msg->signed_messages[143]); + ck_assert_msg( + check_msg->signed_messages[144] == 152, + "incorrect value for signed_messages[144], expected 152, is %d", + check_msg->signed_messages[144]); + ck_assert_msg( + check_msg->signed_messages[145] == 39, + "incorrect value for signed_messages[145], expected 39, is %d", + check_msg->signed_messages[145]); + ck_assert_msg( + check_msg->signed_messages[146] == 89, + "incorrect value for signed_messages[146], expected 89, is %d", + check_msg->signed_messages[146]); + ck_assert_msg( + check_msg->signed_messages[147] == 180, + "incorrect value for signed_messages[147], expected 180, is %d", + check_msg->signed_messages[147]); + ck_assert_msg( + check_msg->signed_messages[148] == 64, + "incorrect value for signed_messages[148], expected 64, is %d", + check_msg->signed_messages[148]); + ck_assert_msg( + check_msg->signed_messages[149] == 49, + "incorrect value for signed_messages[149], expected 49, is %d", + check_msg->signed_messages[149]); + ck_assert_msg(check_msg->signed_messages[150] == 6, + "incorrect value for signed_messages[150], expected 6, is %d", + check_msg->signed_messages[150]); + ck_assert_msg( + check_msg->signed_messages[151] == 80, + "incorrect value for signed_messages[151], expected 80, is %d", + check_msg->signed_messages[151]); + ck_assert_msg( + check_msg->signed_messages[152] == 172, + "incorrect value for signed_messages[152], expected 172, is %d", + check_msg->signed_messages[152]); + ck_assert_msg( + check_msg->signed_messages[153] == 32, + "incorrect value for signed_messages[153], expected 32, is %d", + check_msg->signed_messages[153]); + ck_assert_msg( + check_msg->signed_messages[154] == 109, + "incorrect value for signed_messages[154], expected 109, is %d", + check_msg->signed_messages[154]); + ck_assert_msg(check_msg->signed_messages[155] == 2, + "incorrect value for signed_messages[155], expected 2, is %d", + check_msg->signed_messages[155]); + ck_assert_msg( + check_msg->signed_messages[156] == 119, + "incorrect value for signed_messages[156], expected 119, is %d", + check_msg->signed_messages[156]); + ck_assert_msg( + check_msg->signed_messages[157] == 93, + "incorrect value for signed_messages[157], expected 93, is %d", + check_msg->signed_messages[157]); + ck_assert_msg( + check_msg->signed_messages[158] == 176, + "incorrect value for signed_messages[158], expected 176, is %d", + check_msg->signed_messages[158]); + ck_assert_msg(check_msg->signed_messages[159] == 0, + "incorrect value for signed_messages[159], expected 0, is %d", + check_msg->signed_messages[159]); + ck_assert_msg( + check_msg->signed_messages[160] == 33, + "incorrect value for signed_messages[160], expected 33, is %d", + check_msg->signed_messages[160]); + ck_assert_msg( + check_msg->signed_messages[161] == 57, + "incorrect value for signed_messages[161], expected 57, is %d", + check_msg->signed_messages[161]); + ck_assert_msg( + check_msg->signed_messages[162] == 34, + "incorrect value for signed_messages[162], expected 34, is %d", + check_msg->signed_messages[162]); + ck_assert_msg( + check_msg->signed_messages[163] == 18, + "incorrect value for signed_messages[163], expected 18, is %d", + check_msg->signed_messages[163]); + ck_assert_msg( + check_msg->signed_messages[164] == 85, + "incorrect value for signed_messages[164], expected 85, is %d", + check_msg->signed_messages[164]); + ck_assert_msg( + check_msg->signed_messages[165] == 121, + "incorrect value for signed_messages[165], expected 121, is %d", + check_msg->signed_messages[165]); + ck_assert_msg( + check_msg->signed_messages[166] == 137, + "incorrect value for signed_messages[166], expected 137, is %d", + check_msg->signed_messages[166]); + ck_assert_msg( + check_msg->signed_messages[167] == 83, + "incorrect value for signed_messages[167], expected 83, is %d", + check_msg->signed_messages[167]); + ck_assert_msg( + check_msg->signed_messages[168] == 111, + "incorrect value for signed_messages[168], expected 111, is %d", + check_msg->signed_messages[168]); + ck_assert_msg( + check_msg->signed_messages[169] == 59, + "incorrect value for signed_messages[169], expected 59, is %d", + check_msg->signed_messages[169]); + ck_assert_msg(check_msg->signed_messages[170] == 7, + "incorrect value for signed_messages[170], expected 7, is %d", + check_msg->signed_messages[170]); + ck_assert_msg( + check_msg->signed_messages[171] == 77, + "incorrect value for signed_messages[171], expected 77, is %d", + check_msg->signed_messages[171]); + ck_assert_msg(check_msg->signed_messages[172] == 4, + "incorrect value for signed_messages[172], expected 4, is %d", + check_msg->signed_messages[172]); + ck_assert_msg( + check_msg->signed_messages[173] == 117, + "incorrect value for signed_messages[173], expected 117, is %d", + check_msg->signed_messages[173]); + ck_assert_msg( + check_msg->signed_messages[174] == 159, + "incorrect value for signed_messages[174], expected 159, is %d", + check_msg->signed_messages[174]); + ck_assert_msg( + check_msg->signed_messages[175] == 148, + "incorrect value for signed_messages[175], expected 148, is %d", + check_msg->signed_messages[175]); + ck_assert_msg( + check_msg->signed_messages[176] == 35, + "incorrect value for signed_messages[176], expected 35, is %d", + check_msg->signed_messages[176]); + ck_assert_msg( + check_msg->signed_messages[177] == 61, + "incorrect value for signed_messages[177], expected 61, is %d", + check_msg->signed_messages[177]); + ck_assert_msg( + check_msg->signed_messages[178] == 41, + "incorrect value for signed_messages[178], expected 41, is %d", + check_msg->signed_messages[178]); + ck_assert_msg( + check_msg->signed_messages[179] == 67, + "incorrect value for signed_messages[179], expected 67, is %d", + check_msg->signed_messages[179]); + ck_assert_msg( + check_msg->signed_messages[180] == 46, + "incorrect value for signed_messages[180], expected 46, is %d", + check_msg->signed_messages[180]); + ck_assert_msg( + check_msg->signed_messages[181] == 127, + "incorrect value for signed_messages[181], expected 127, is %d", + check_msg->signed_messages[181]); + ck_assert_msg( + check_msg->signed_messages[182] == 75, + "incorrect value for signed_messages[182], expected 75, is %d", + check_msg->signed_messages[182]); + ck_assert_msg( + check_msg->signed_messages[183] == 174, + "incorrect value for signed_messages[183], expected 174, is %d", + check_msg->signed_messages[183]); + ck_assert_msg(check_msg->stream_counter == 1, + "incorrect value for stream_counter, expected 1, is %d", + check_msg->stream_counter); } } END_TEST -Suite* legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA); +Suite *legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c b/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c index 37cae55d6..9dda1ed03 100644 --- a/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c +++ b/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB ) -{ +START_TEST(test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,27 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xC07, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xC07, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xC07, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xC07, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,7,12,66,0,83,0,1,2,1,2,3,4,72,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,10,21,23,254,159, }; + u8 encoded_frame[] = { + 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ecdsa_signature_dep_b_t* test_msg = ( msg_ecdsa_signature_dep_b_t* )test_msg_storage; + msg_ecdsa_signature_dep_b_t *test_msg = + (msg_ecdsa_signature_dep_b_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->certificate_id) == 0) { // Cope with variable length arrays @@ -542,146 +549,322 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB ) } test_msg->signed_messages[2] = 23; test_msg->stream_counter = 1; - sbp_payload_send(&sbp_state, 0xC07, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xC07, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xC07, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ecdsa_signature_dep_b_t* check_msg = ( msg_ecdsa_signature_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ecdsa_signature_dep_b_t *check_msg = + (msg_ecdsa_signature_dep_b_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->certificate_id[0] == 1, "incorrect value for certificate_id[0], expected 1, is %d", check_msg->certificate_id[0]); - ck_assert_msg(check_msg->certificate_id[1] == 2, "incorrect value for certificate_id[1], expected 2, is %d", check_msg->certificate_id[1]); - ck_assert_msg(check_msg->certificate_id[2] == 3, "incorrect value for certificate_id[2], expected 3, is %d", check_msg->certificate_id[2]); - ck_assert_msg(check_msg->certificate_id[3] == 4, "incorrect value for certificate_id[3], expected 4, is %d", check_msg->certificate_id[3]); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_signature_bytes == 72, "incorrect value for n_signature_bytes, expected 72, is %d", check_msg->n_signature_bytes); - ck_assert_msg(check_msg->on_demand_counter == 2, "incorrect value for on_demand_counter, expected 2, is %d", check_msg->on_demand_counter); - ck_assert_msg(check_msg->signature[0] == 0, "incorrect value for signature[0], expected 0, is %d", check_msg->signature[0]); - ck_assert_msg(check_msg->signature[1] == 1, "incorrect value for signature[1], expected 1, is %d", check_msg->signature[1]); - ck_assert_msg(check_msg->signature[2] == 2, "incorrect value for signature[2], expected 2, is %d", check_msg->signature[2]); - ck_assert_msg(check_msg->signature[3] == 3, "incorrect value for signature[3], expected 3, is %d", check_msg->signature[3]); - ck_assert_msg(check_msg->signature[4] == 4, "incorrect value for signature[4], expected 4, is %d", check_msg->signature[4]); - ck_assert_msg(check_msg->signature[5] == 5, "incorrect value for signature[5], expected 5, is %d", check_msg->signature[5]); - ck_assert_msg(check_msg->signature[6] == 6, "incorrect value for signature[6], expected 6, is %d", check_msg->signature[6]); - ck_assert_msg(check_msg->signature[7] == 7, "incorrect value for signature[7], expected 7, is %d", check_msg->signature[7]); - ck_assert_msg(check_msg->signature[8] == 8, "incorrect value for signature[8], expected 8, is %d", check_msg->signature[8]); - ck_assert_msg(check_msg->signature[9] == 9, "incorrect value for signature[9], expected 9, is %d", check_msg->signature[9]); - ck_assert_msg(check_msg->signature[10] == 10, "incorrect value for signature[10], expected 10, is %d", check_msg->signature[10]); - ck_assert_msg(check_msg->signature[11] == 11, "incorrect value for signature[11], expected 11, is %d", check_msg->signature[11]); - ck_assert_msg(check_msg->signature[12] == 12, "incorrect value for signature[12], expected 12, is %d", check_msg->signature[12]); - ck_assert_msg(check_msg->signature[13] == 13, "incorrect value for signature[13], expected 13, is %d", check_msg->signature[13]); - ck_assert_msg(check_msg->signature[14] == 14, "incorrect value for signature[14], expected 14, is %d", check_msg->signature[14]); - ck_assert_msg(check_msg->signature[15] == 15, "incorrect value for signature[15], expected 15, is %d", check_msg->signature[15]); - ck_assert_msg(check_msg->signature[16] == 16, "incorrect value for signature[16], expected 16, is %d", check_msg->signature[16]); - ck_assert_msg(check_msg->signature[17] == 17, "incorrect value for signature[17], expected 17, is %d", check_msg->signature[17]); - ck_assert_msg(check_msg->signature[18] == 18, "incorrect value for signature[18], expected 18, is %d", check_msg->signature[18]); - ck_assert_msg(check_msg->signature[19] == 19, "incorrect value for signature[19], expected 19, is %d", check_msg->signature[19]); - ck_assert_msg(check_msg->signature[20] == 20, "incorrect value for signature[20], expected 20, is %d", check_msg->signature[20]); - ck_assert_msg(check_msg->signature[21] == 21, "incorrect value for signature[21], expected 21, is %d", check_msg->signature[21]); - ck_assert_msg(check_msg->signature[22] == 22, "incorrect value for signature[22], expected 22, is %d", check_msg->signature[22]); - ck_assert_msg(check_msg->signature[23] == 23, "incorrect value for signature[23], expected 23, is %d", check_msg->signature[23]); - ck_assert_msg(check_msg->signature[24] == 24, "incorrect value for signature[24], expected 24, is %d", check_msg->signature[24]); - ck_assert_msg(check_msg->signature[25] == 25, "incorrect value for signature[25], expected 25, is %d", check_msg->signature[25]); - ck_assert_msg(check_msg->signature[26] == 26, "incorrect value for signature[26], expected 26, is %d", check_msg->signature[26]); - ck_assert_msg(check_msg->signature[27] == 27, "incorrect value for signature[27], expected 27, is %d", check_msg->signature[27]); - ck_assert_msg(check_msg->signature[28] == 28, "incorrect value for signature[28], expected 28, is %d", check_msg->signature[28]); - ck_assert_msg(check_msg->signature[29] == 29, "incorrect value for signature[29], expected 29, is %d", check_msg->signature[29]); - ck_assert_msg(check_msg->signature[30] == 30, "incorrect value for signature[30], expected 30, is %d", check_msg->signature[30]); - ck_assert_msg(check_msg->signature[31] == 31, "incorrect value for signature[31], expected 31, is %d", check_msg->signature[31]); - ck_assert_msg(check_msg->signature[32] == 32, "incorrect value for signature[32], expected 32, is %d", check_msg->signature[32]); - ck_assert_msg(check_msg->signature[33] == 33, "incorrect value for signature[33], expected 33, is %d", check_msg->signature[33]); - ck_assert_msg(check_msg->signature[34] == 34, "incorrect value for signature[34], expected 34, is %d", check_msg->signature[34]); - ck_assert_msg(check_msg->signature[35] == 35, "incorrect value for signature[35], expected 35, is %d", check_msg->signature[35]); - ck_assert_msg(check_msg->signature[36] == 36, "incorrect value for signature[36], expected 36, is %d", check_msg->signature[36]); - ck_assert_msg(check_msg->signature[37] == 37, "incorrect value for signature[37], expected 37, is %d", check_msg->signature[37]); - ck_assert_msg(check_msg->signature[38] == 38, "incorrect value for signature[38], expected 38, is %d", check_msg->signature[38]); - ck_assert_msg(check_msg->signature[39] == 39, "incorrect value for signature[39], expected 39, is %d", check_msg->signature[39]); - ck_assert_msg(check_msg->signature[40] == 40, "incorrect value for signature[40], expected 40, is %d", check_msg->signature[40]); - ck_assert_msg(check_msg->signature[41] == 41, "incorrect value for signature[41], expected 41, is %d", check_msg->signature[41]); - ck_assert_msg(check_msg->signature[42] == 42, "incorrect value for signature[42], expected 42, is %d", check_msg->signature[42]); - ck_assert_msg(check_msg->signature[43] == 43, "incorrect value for signature[43], expected 43, is %d", check_msg->signature[43]); - ck_assert_msg(check_msg->signature[44] == 44, "incorrect value for signature[44], expected 44, is %d", check_msg->signature[44]); - ck_assert_msg(check_msg->signature[45] == 45, "incorrect value for signature[45], expected 45, is %d", check_msg->signature[45]); - ck_assert_msg(check_msg->signature[46] == 46, "incorrect value for signature[46], expected 46, is %d", check_msg->signature[46]); - ck_assert_msg(check_msg->signature[47] == 47, "incorrect value for signature[47], expected 47, is %d", check_msg->signature[47]); - ck_assert_msg(check_msg->signature[48] == 48, "incorrect value for signature[48], expected 48, is %d", check_msg->signature[48]); - ck_assert_msg(check_msg->signature[49] == 49, "incorrect value for signature[49], expected 49, is %d", check_msg->signature[49]); - ck_assert_msg(check_msg->signature[50] == 50, "incorrect value for signature[50], expected 50, is %d", check_msg->signature[50]); - ck_assert_msg(check_msg->signature[51] == 51, "incorrect value for signature[51], expected 51, is %d", check_msg->signature[51]); - ck_assert_msg(check_msg->signature[52] == 52, "incorrect value for signature[52], expected 52, is %d", check_msg->signature[52]); - ck_assert_msg(check_msg->signature[53] == 53, "incorrect value for signature[53], expected 53, is %d", check_msg->signature[53]); - ck_assert_msg(check_msg->signature[54] == 54, "incorrect value for signature[54], expected 54, is %d", check_msg->signature[54]); - ck_assert_msg(check_msg->signature[55] == 55, "incorrect value for signature[55], expected 55, is %d", check_msg->signature[55]); - ck_assert_msg(check_msg->signature[56] == 56, "incorrect value for signature[56], expected 56, is %d", check_msg->signature[56]); - ck_assert_msg(check_msg->signature[57] == 57, "incorrect value for signature[57], expected 57, is %d", check_msg->signature[57]); - ck_assert_msg(check_msg->signature[58] == 58, "incorrect value for signature[58], expected 58, is %d", check_msg->signature[58]); - ck_assert_msg(check_msg->signature[59] == 59, "incorrect value for signature[59], expected 59, is %d", check_msg->signature[59]); - ck_assert_msg(check_msg->signature[60] == 60, "incorrect value for signature[60], expected 60, is %d", check_msg->signature[60]); - ck_assert_msg(check_msg->signature[61] == 61, "incorrect value for signature[61], expected 61, is %d", check_msg->signature[61]); - ck_assert_msg(check_msg->signature[62] == 62, "incorrect value for signature[62], expected 62, is %d", check_msg->signature[62]); - ck_assert_msg(check_msg->signature[63] == 63, "incorrect value for signature[63], expected 63, is %d", check_msg->signature[63]); - ck_assert_msg(check_msg->signature[64] == 64, "incorrect value for signature[64], expected 64, is %d", check_msg->signature[64]); - ck_assert_msg(check_msg->signature[65] == 65, "incorrect value for signature[65], expected 65, is %d", check_msg->signature[65]); - ck_assert_msg(check_msg->signature[66] == 66, "incorrect value for signature[66], expected 66, is %d", check_msg->signature[66]); - ck_assert_msg(check_msg->signature[67] == 67, "incorrect value for signature[67], expected 67, is %d", check_msg->signature[67]); - ck_assert_msg(check_msg->signature[68] == 68, "incorrect value for signature[68], expected 68, is %d", check_msg->signature[68]); - ck_assert_msg(check_msg->signature[69] == 69, "incorrect value for signature[69], expected 69, is %d", check_msg->signature[69]); - ck_assert_msg(check_msg->signature[70] == 70, "incorrect value for signature[70], expected 70, is %d", check_msg->signature[70]); - ck_assert_msg(check_msg->signature[71] == 71, "incorrect value for signature[71], expected 71, is %d", check_msg->signature[71]); - ck_assert_msg(check_msg->signed_messages[0] == 10, "incorrect value for signed_messages[0], expected 10, is %d", check_msg->signed_messages[0]); - ck_assert_msg(check_msg->signed_messages[1] == 21, "incorrect value for signed_messages[1], expected 21, is %d", check_msg->signed_messages[1]); - ck_assert_msg(check_msg->signed_messages[2] == 23, "incorrect value for signed_messages[2], expected 23, is %d", check_msg->signed_messages[2]); - ck_assert_msg(check_msg->stream_counter == 1, "incorrect value for stream_counter, expected 1, is %d", check_msg->stream_counter); + ck_assert_msg(check_msg->certificate_id[0] == 1, + "incorrect value for certificate_id[0], expected 1, is %d", + check_msg->certificate_id[0]); + ck_assert_msg(check_msg->certificate_id[1] == 2, + "incorrect value for certificate_id[1], expected 2, is %d", + check_msg->certificate_id[1]); + ck_assert_msg(check_msg->certificate_id[2] == 3, + "incorrect value for certificate_id[2], expected 3, is %d", + check_msg->certificate_id[2]); + ck_assert_msg(check_msg->certificate_id[3] == 4, + "incorrect value for certificate_id[3], expected 4, is %d", + check_msg->certificate_id[3]); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_signature_bytes == 72, + "incorrect value for n_signature_bytes, expected 72, is %d", + check_msg->n_signature_bytes); + ck_assert_msg(check_msg->on_demand_counter == 2, + "incorrect value for on_demand_counter, expected 2, is %d", + check_msg->on_demand_counter); + ck_assert_msg(check_msg->signature[0] == 0, + "incorrect value for signature[0], expected 0, is %d", + check_msg->signature[0]); + ck_assert_msg(check_msg->signature[1] == 1, + "incorrect value for signature[1], expected 1, is %d", + check_msg->signature[1]); + ck_assert_msg(check_msg->signature[2] == 2, + "incorrect value for signature[2], expected 2, is %d", + check_msg->signature[2]); + ck_assert_msg(check_msg->signature[3] == 3, + "incorrect value for signature[3], expected 3, is %d", + check_msg->signature[3]); + ck_assert_msg(check_msg->signature[4] == 4, + "incorrect value for signature[4], expected 4, is %d", + check_msg->signature[4]); + ck_assert_msg(check_msg->signature[5] == 5, + "incorrect value for signature[5], expected 5, is %d", + check_msg->signature[5]); + ck_assert_msg(check_msg->signature[6] == 6, + "incorrect value for signature[6], expected 6, is %d", + check_msg->signature[6]); + ck_assert_msg(check_msg->signature[7] == 7, + "incorrect value for signature[7], expected 7, is %d", + check_msg->signature[7]); + ck_assert_msg(check_msg->signature[8] == 8, + "incorrect value for signature[8], expected 8, is %d", + check_msg->signature[8]); + ck_assert_msg(check_msg->signature[9] == 9, + "incorrect value for signature[9], expected 9, is %d", + check_msg->signature[9]); + ck_assert_msg(check_msg->signature[10] == 10, + "incorrect value for signature[10], expected 10, is %d", + check_msg->signature[10]); + ck_assert_msg(check_msg->signature[11] == 11, + "incorrect value for signature[11], expected 11, is %d", + check_msg->signature[11]); + ck_assert_msg(check_msg->signature[12] == 12, + "incorrect value for signature[12], expected 12, is %d", + check_msg->signature[12]); + ck_assert_msg(check_msg->signature[13] == 13, + "incorrect value for signature[13], expected 13, is %d", + check_msg->signature[13]); + ck_assert_msg(check_msg->signature[14] == 14, + "incorrect value for signature[14], expected 14, is %d", + check_msg->signature[14]); + ck_assert_msg(check_msg->signature[15] == 15, + "incorrect value for signature[15], expected 15, is %d", + check_msg->signature[15]); + ck_assert_msg(check_msg->signature[16] == 16, + "incorrect value for signature[16], expected 16, is %d", + check_msg->signature[16]); + ck_assert_msg(check_msg->signature[17] == 17, + "incorrect value for signature[17], expected 17, is %d", + check_msg->signature[17]); + ck_assert_msg(check_msg->signature[18] == 18, + "incorrect value for signature[18], expected 18, is %d", + check_msg->signature[18]); + ck_assert_msg(check_msg->signature[19] == 19, + "incorrect value for signature[19], expected 19, is %d", + check_msg->signature[19]); + ck_assert_msg(check_msg->signature[20] == 20, + "incorrect value for signature[20], expected 20, is %d", + check_msg->signature[20]); + ck_assert_msg(check_msg->signature[21] == 21, + "incorrect value for signature[21], expected 21, is %d", + check_msg->signature[21]); + ck_assert_msg(check_msg->signature[22] == 22, + "incorrect value for signature[22], expected 22, is %d", + check_msg->signature[22]); + ck_assert_msg(check_msg->signature[23] == 23, + "incorrect value for signature[23], expected 23, is %d", + check_msg->signature[23]); + ck_assert_msg(check_msg->signature[24] == 24, + "incorrect value for signature[24], expected 24, is %d", + check_msg->signature[24]); + ck_assert_msg(check_msg->signature[25] == 25, + "incorrect value for signature[25], expected 25, is %d", + check_msg->signature[25]); + ck_assert_msg(check_msg->signature[26] == 26, + "incorrect value for signature[26], expected 26, is %d", + check_msg->signature[26]); + ck_assert_msg(check_msg->signature[27] == 27, + "incorrect value for signature[27], expected 27, is %d", + check_msg->signature[27]); + ck_assert_msg(check_msg->signature[28] == 28, + "incorrect value for signature[28], expected 28, is %d", + check_msg->signature[28]); + ck_assert_msg(check_msg->signature[29] == 29, + "incorrect value for signature[29], expected 29, is %d", + check_msg->signature[29]); + ck_assert_msg(check_msg->signature[30] == 30, + "incorrect value for signature[30], expected 30, is %d", + check_msg->signature[30]); + ck_assert_msg(check_msg->signature[31] == 31, + "incorrect value for signature[31], expected 31, is %d", + check_msg->signature[31]); + ck_assert_msg(check_msg->signature[32] == 32, + "incorrect value for signature[32], expected 32, is %d", + check_msg->signature[32]); + ck_assert_msg(check_msg->signature[33] == 33, + "incorrect value for signature[33], expected 33, is %d", + check_msg->signature[33]); + ck_assert_msg(check_msg->signature[34] == 34, + "incorrect value for signature[34], expected 34, is %d", + check_msg->signature[34]); + ck_assert_msg(check_msg->signature[35] == 35, + "incorrect value for signature[35], expected 35, is %d", + check_msg->signature[35]); + ck_assert_msg(check_msg->signature[36] == 36, + "incorrect value for signature[36], expected 36, is %d", + check_msg->signature[36]); + ck_assert_msg(check_msg->signature[37] == 37, + "incorrect value for signature[37], expected 37, is %d", + check_msg->signature[37]); + ck_assert_msg(check_msg->signature[38] == 38, + "incorrect value for signature[38], expected 38, is %d", + check_msg->signature[38]); + ck_assert_msg(check_msg->signature[39] == 39, + "incorrect value for signature[39], expected 39, is %d", + check_msg->signature[39]); + ck_assert_msg(check_msg->signature[40] == 40, + "incorrect value for signature[40], expected 40, is %d", + check_msg->signature[40]); + ck_assert_msg(check_msg->signature[41] == 41, + "incorrect value for signature[41], expected 41, is %d", + check_msg->signature[41]); + ck_assert_msg(check_msg->signature[42] == 42, + "incorrect value for signature[42], expected 42, is %d", + check_msg->signature[42]); + ck_assert_msg(check_msg->signature[43] == 43, + "incorrect value for signature[43], expected 43, is %d", + check_msg->signature[43]); + ck_assert_msg(check_msg->signature[44] == 44, + "incorrect value for signature[44], expected 44, is %d", + check_msg->signature[44]); + ck_assert_msg(check_msg->signature[45] == 45, + "incorrect value for signature[45], expected 45, is %d", + check_msg->signature[45]); + ck_assert_msg(check_msg->signature[46] == 46, + "incorrect value for signature[46], expected 46, is %d", + check_msg->signature[46]); + ck_assert_msg(check_msg->signature[47] == 47, + "incorrect value for signature[47], expected 47, is %d", + check_msg->signature[47]); + ck_assert_msg(check_msg->signature[48] == 48, + "incorrect value for signature[48], expected 48, is %d", + check_msg->signature[48]); + ck_assert_msg(check_msg->signature[49] == 49, + "incorrect value for signature[49], expected 49, is %d", + check_msg->signature[49]); + ck_assert_msg(check_msg->signature[50] == 50, + "incorrect value for signature[50], expected 50, is %d", + check_msg->signature[50]); + ck_assert_msg(check_msg->signature[51] == 51, + "incorrect value for signature[51], expected 51, is %d", + check_msg->signature[51]); + ck_assert_msg(check_msg->signature[52] == 52, + "incorrect value for signature[52], expected 52, is %d", + check_msg->signature[52]); + ck_assert_msg(check_msg->signature[53] == 53, + "incorrect value for signature[53], expected 53, is %d", + check_msg->signature[53]); + ck_assert_msg(check_msg->signature[54] == 54, + "incorrect value for signature[54], expected 54, is %d", + check_msg->signature[54]); + ck_assert_msg(check_msg->signature[55] == 55, + "incorrect value for signature[55], expected 55, is %d", + check_msg->signature[55]); + ck_assert_msg(check_msg->signature[56] == 56, + "incorrect value for signature[56], expected 56, is %d", + check_msg->signature[56]); + ck_assert_msg(check_msg->signature[57] == 57, + "incorrect value for signature[57], expected 57, is %d", + check_msg->signature[57]); + ck_assert_msg(check_msg->signature[58] == 58, + "incorrect value for signature[58], expected 58, is %d", + check_msg->signature[58]); + ck_assert_msg(check_msg->signature[59] == 59, + "incorrect value for signature[59], expected 59, is %d", + check_msg->signature[59]); + ck_assert_msg(check_msg->signature[60] == 60, + "incorrect value for signature[60], expected 60, is %d", + check_msg->signature[60]); + ck_assert_msg(check_msg->signature[61] == 61, + "incorrect value for signature[61], expected 61, is %d", + check_msg->signature[61]); + ck_assert_msg(check_msg->signature[62] == 62, + "incorrect value for signature[62], expected 62, is %d", + check_msg->signature[62]); + ck_assert_msg(check_msg->signature[63] == 63, + "incorrect value for signature[63], expected 63, is %d", + check_msg->signature[63]); + ck_assert_msg(check_msg->signature[64] == 64, + "incorrect value for signature[64], expected 64, is %d", + check_msg->signature[64]); + ck_assert_msg(check_msg->signature[65] == 65, + "incorrect value for signature[65], expected 65, is %d", + check_msg->signature[65]); + ck_assert_msg(check_msg->signature[66] == 66, + "incorrect value for signature[66], expected 66, is %d", + check_msg->signature[66]); + ck_assert_msg(check_msg->signature[67] == 67, + "incorrect value for signature[67], expected 67, is %d", + check_msg->signature[67]); + ck_assert_msg(check_msg->signature[68] == 68, + "incorrect value for signature[68], expected 68, is %d", + check_msg->signature[68]); + ck_assert_msg(check_msg->signature[69] == 69, + "incorrect value for signature[69], expected 69, is %d", + check_msg->signature[69]); + ck_assert_msg(check_msg->signature[70] == 70, + "incorrect value for signature[70], expected 70, is %d", + check_msg->signature[70]); + ck_assert_msg(check_msg->signature[71] == 71, + "incorrect value for signature[71], expected 71, is %d", + check_msg->signature[71]); + ck_assert_msg(check_msg->signed_messages[0] == 10, + "incorrect value for signed_messages[0], expected 10, is %d", + check_msg->signed_messages[0]); + ck_assert_msg(check_msg->signed_messages[1] == 21, + "incorrect value for signed_messages[1], expected 21, is %d", + check_msg->signed_messages[1]); + ck_assert_msg(check_msg->signed_messages[2] == 23, + "incorrect value for signed_messages[2], expected 23, is %d", + check_msg->signed_messages[2]); + ck_assert_msg(check_msg->stream_counter == 1, + "incorrect value for stream_counter, expected 1, is %d", + check_msg->stream_counter); } } END_TEST -Suite* legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB); +Suite *legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_signing_MsgEd25519CertificateDep.c b/c/test/legacy/auto_check_sbp_signing_MsgEd25519CertificateDep.c index f59afdd89..242e3b714 100644 --- a/c/test/legacy/auto_check_sbp_signing_MsgEd25519CertificateDep.c +++ b/c/test/legacy/auto_check_sbp_signing_MsgEd25519CertificateDep.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519CertificateDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519CertificateDep.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep ) -{ +START_TEST(test_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,30 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xC02, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xC02, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xC02, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xC02, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,12,66,0,106,16,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,123,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,177,180,183,186,189,192,195,198,201,204,207,210,213,216,219,222,225,228,231,234,237,240,243,246,249,252,218,148, }; + u8 encoded_frame[] = { + 85, 2, 12, 66, 0, 106, 16, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, + 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, + 75, 78, 81, 84, 87, 90, 93, 96, 99, 102, 105, 108, 111, + 114, 117, 120, 123, 126, 129, 132, 135, 138, 141, 144, 147, 150, + 153, 156, 159, 162, 165, 168, 171, 174, 177, 180, 183, 186, 189, + 192, 195, 198, 201, 204, 207, 210, 213, 216, 219, 222, 225, 228, + 231, 234, 237, 240, 243, 246, 249, 252, 218, 148, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ed25519_certificate_dep_t* test_msg = ( msg_ed25519_certificate_dep_t* )test_msg_storage; + msg_ed25519_certificate_dep_t *test_msg = + (msg_ed25519_certificate_dep_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->certificate_bytes) == 0) { // Cope with variable length arrays @@ -669,169 +679,472 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep ) } test_msg->fingerprint[19] = 119; test_msg->n_msg = 16; - sbp_payload_send(&sbp_state, 0xC02, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xC02, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xC02, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ed25519_certificate_dep_t* check_msg = ( msg_ed25519_certificate_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ed25519_certificate_dep_t *check_msg = + (msg_ed25519_certificate_dep_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->certificate_bytes[0] == 0, "incorrect value for certificate_bytes[0], expected 0, is %d", check_msg->certificate_bytes[0]); - ck_assert_msg(check_msg->certificate_bytes[1] == 3, "incorrect value for certificate_bytes[1], expected 3, is %d", check_msg->certificate_bytes[1]); - ck_assert_msg(check_msg->certificate_bytes[2] == 6, "incorrect value for certificate_bytes[2], expected 6, is %d", check_msg->certificate_bytes[2]); - ck_assert_msg(check_msg->certificate_bytes[3] == 9, "incorrect value for certificate_bytes[3], expected 9, is %d", check_msg->certificate_bytes[3]); - ck_assert_msg(check_msg->certificate_bytes[4] == 12, "incorrect value for certificate_bytes[4], expected 12, is %d", check_msg->certificate_bytes[4]); - ck_assert_msg(check_msg->certificate_bytes[5] == 15, "incorrect value for certificate_bytes[5], expected 15, is %d", check_msg->certificate_bytes[5]); - ck_assert_msg(check_msg->certificate_bytes[6] == 18, "incorrect value for certificate_bytes[6], expected 18, is %d", check_msg->certificate_bytes[6]); - ck_assert_msg(check_msg->certificate_bytes[7] == 21, "incorrect value for certificate_bytes[7], expected 21, is %d", check_msg->certificate_bytes[7]); - ck_assert_msg(check_msg->certificate_bytes[8] == 24, "incorrect value for certificate_bytes[8], expected 24, is %d", check_msg->certificate_bytes[8]); - ck_assert_msg(check_msg->certificate_bytes[9] == 27, "incorrect value for certificate_bytes[9], expected 27, is %d", check_msg->certificate_bytes[9]); - ck_assert_msg(check_msg->certificate_bytes[10] == 30, "incorrect value for certificate_bytes[10], expected 30, is %d", check_msg->certificate_bytes[10]); - ck_assert_msg(check_msg->certificate_bytes[11] == 33, "incorrect value for certificate_bytes[11], expected 33, is %d", check_msg->certificate_bytes[11]); - ck_assert_msg(check_msg->certificate_bytes[12] == 36, "incorrect value for certificate_bytes[12], expected 36, is %d", check_msg->certificate_bytes[12]); - ck_assert_msg(check_msg->certificate_bytes[13] == 39, "incorrect value for certificate_bytes[13], expected 39, is %d", check_msg->certificate_bytes[13]); - ck_assert_msg(check_msg->certificate_bytes[14] == 42, "incorrect value for certificate_bytes[14], expected 42, is %d", check_msg->certificate_bytes[14]); - ck_assert_msg(check_msg->certificate_bytes[15] == 45, "incorrect value for certificate_bytes[15], expected 45, is %d", check_msg->certificate_bytes[15]); - ck_assert_msg(check_msg->certificate_bytes[16] == 48, "incorrect value for certificate_bytes[16], expected 48, is %d", check_msg->certificate_bytes[16]); - ck_assert_msg(check_msg->certificate_bytes[17] == 51, "incorrect value for certificate_bytes[17], expected 51, is %d", check_msg->certificate_bytes[17]); - ck_assert_msg(check_msg->certificate_bytes[18] == 54, "incorrect value for certificate_bytes[18], expected 54, is %d", check_msg->certificate_bytes[18]); - ck_assert_msg(check_msg->certificate_bytes[19] == 57, "incorrect value for certificate_bytes[19], expected 57, is %d", check_msg->certificate_bytes[19]); - ck_assert_msg(check_msg->certificate_bytes[20] == 60, "incorrect value for certificate_bytes[20], expected 60, is %d", check_msg->certificate_bytes[20]); - ck_assert_msg(check_msg->certificate_bytes[21] == 63, "incorrect value for certificate_bytes[21], expected 63, is %d", check_msg->certificate_bytes[21]); - ck_assert_msg(check_msg->certificate_bytes[22] == 66, "incorrect value for certificate_bytes[22], expected 66, is %d", check_msg->certificate_bytes[22]); - ck_assert_msg(check_msg->certificate_bytes[23] == 69, "incorrect value for certificate_bytes[23], expected 69, is %d", check_msg->certificate_bytes[23]); - ck_assert_msg(check_msg->certificate_bytes[24] == 72, "incorrect value for certificate_bytes[24], expected 72, is %d", check_msg->certificate_bytes[24]); - ck_assert_msg(check_msg->certificate_bytes[25] == 75, "incorrect value for certificate_bytes[25], expected 75, is %d", check_msg->certificate_bytes[25]); - ck_assert_msg(check_msg->certificate_bytes[26] == 78, "incorrect value for certificate_bytes[26], expected 78, is %d", check_msg->certificate_bytes[26]); - ck_assert_msg(check_msg->certificate_bytes[27] == 81, "incorrect value for certificate_bytes[27], expected 81, is %d", check_msg->certificate_bytes[27]); - ck_assert_msg(check_msg->certificate_bytes[28] == 84, "incorrect value for certificate_bytes[28], expected 84, is %d", check_msg->certificate_bytes[28]); - ck_assert_msg(check_msg->certificate_bytes[29] == 87, "incorrect value for certificate_bytes[29], expected 87, is %d", check_msg->certificate_bytes[29]); - ck_assert_msg(check_msg->certificate_bytes[30] == 90, "incorrect value for certificate_bytes[30], expected 90, is %d", check_msg->certificate_bytes[30]); - ck_assert_msg(check_msg->certificate_bytes[31] == 93, "incorrect value for certificate_bytes[31], expected 93, is %d", check_msg->certificate_bytes[31]); - ck_assert_msg(check_msg->certificate_bytes[32] == 96, "incorrect value for certificate_bytes[32], expected 96, is %d", check_msg->certificate_bytes[32]); - ck_assert_msg(check_msg->certificate_bytes[33] == 99, "incorrect value for certificate_bytes[33], expected 99, is %d", check_msg->certificate_bytes[33]); - ck_assert_msg(check_msg->certificate_bytes[34] == 102, "incorrect value for certificate_bytes[34], expected 102, is %d", check_msg->certificate_bytes[34]); - ck_assert_msg(check_msg->certificate_bytes[35] == 105, "incorrect value for certificate_bytes[35], expected 105, is %d", check_msg->certificate_bytes[35]); - ck_assert_msg(check_msg->certificate_bytes[36] == 108, "incorrect value for certificate_bytes[36], expected 108, is %d", check_msg->certificate_bytes[36]); - ck_assert_msg(check_msg->certificate_bytes[37] == 111, "incorrect value for certificate_bytes[37], expected 111, is %d", check_msg->certificate_bytes[37]); - ck_assert_msg(check_msg->certificate_bytes[38] == 114, "incorrect value for certificate_bytes[38], expected 114, is %d", check_msg->certificate_bytes[38]); - ck_assert_msg(check_msg->certificate_bytes[39] == 117, "incorrect value for certificate_bytes[39], expected 117, is %d", check_msg->certificate_bytes[39]); - ck_assert_msg(check_msg->certificate_bytes[40] == 120, "incorrect value for certificate_bytes[40], expected 120, is %d", check_msg->certificate_bytes[40]); - ck_assert_msg(check_msg->certificate_bytes[41] == 123, "incorrect value for certificate_bytes[41], expected 123, is %d", check_msg->certificate_bytes[41]); - ck_assert_msg(check_msg->certificate_bytes[42] == 126, "incorrect value for certificate_bytes[42], expected 126, is %d", check_msg->certificate_bytes[42]); - ck_assert_msg(check_msg->certificate_bytes[43] == 129, "incorrect value for certificate_bytes[43], expected 129, is %d", check_msg->certificate_bytes[43]); - ck_assert_msg(check_msg->certificate_bytes[44] == 132, "incorrect value for certificate_bytes[44], expected 132, is %d", check_msg->certificate_bytes[44]); - ck_assert_msg(check_msg->certificate_bytes[45] == 135, "incorrect value for certificate_bytes[45], expected 135, is %d", check_msg->certificate_bytes[45]); - ck_assert_msg(check_msg->certificate_bytes[46] == 138, "incorrect value for certificate_bytes[46], expected 138, is %d", check_msg->certificate_bytes[46]); - ck_assert_msg(check_msg->certificate_bytes[47] == 141, "incorrect value for certificate_bytes[47], expected 141, is %d", check_msg->certificate_bytes[47]); - ck_assert_msg(check_msg->certificate_bytes[48] == 144, "incorrect value for certificate_bytes[48], expected 144, is %d", check_msg->certificate_bytes[48]); - ck_assert_msg(check_msg->certificate_bytes[49] == 147, "incorrect value for certificate_bytes[49], expected 147, is %d", check_msg->certificate_bytes[49]); - ck_assert_msg(check_msg->certificate_bytes[50] == 150, "incorrect value for certificate_bytes[50], expected 150, is %d", check_msg->certificate_bytes[50]); - ck_assert_msg(check_msg->certificate_bytes[51] == 153, "incorrect value for certificate_bytes[51], expected 153, is %d", check_msg->certificate_bytes[51]); - ck_assert_msg(check_msg->certificate_bytes[52] == 156, "incorrect value for certificate_bytes[52], expected 156, is %d", check_msg->certificate_bytes[52]); - ck_assert_msg(check_msg->certificate_bytes[53] == 159, "incorrect value for certificate_bytes[53], expected 159, is %d", check_msg->certificate_bytes[53]); - ck_assert_msg(check_msg->certificate_bytes[54] == 162, "incorrect value for certificate_bytes[54], expected 162, is %d", check_msg->certificate_bytes[54]); - ck_assert_msg(check_msg->certificate_bytes[55] == 165, "incorrect value for certificate_bytes[55], expected 165, is %d", check_msg->certificate_bytes[55]); - ck_assert_msg(check_msg->certificate_bytes[56] == 168, "incorrect value for certificate_bytes[56], expected 168, is %d", check_msg->certificate_bytes[56]); - ck_assert_msg(check_msg->certificate_bytes[57] == 171, "incorrect value for certificate_bytes[57], expected 171, is %d", check_msg->certificate_bytes[57]); - ck_assert_msg(check_msg->certificate_bytes[58] == 174, "incorrect value for certificate_bytes[58], expected 174, is %d", check_msg->certificate_bytes[58]); - ck_assert_msg(check_msg->certificate_bytes[59] == 177, "incorrect value for certificate_bytes[59], expected 177, is %d", check_msg->certificate_bytes[59]); - ck_assert_msg(check_msg->certificate_bytes[60] == 180, "incorrect value for certificate_bytes[60], expected 180, is %d", check_msg->certificate_bytes[60]); - ck_assert_msg(check_msg->certificate_bytes[61] == 183, "incorrect value for certificate_bytes[61], expected 183, is %d", check_msg->certificate_bytes[61]); - ck_assert_msg(check_msg->certificate_bytes[62] == 186, "incorrect value for certificate_bytes[62], expected 186, is %d", check_msg->certificate_bytes[62]); - ck_assert_msg(check_msg->certificate_bytes[63] == 189, "incorrect value for certificate_bytes[63], expected 189, is %d", check_msg->certificate_bytes[63]); - ck_assert_msg(check_msg->certificate_bytes[64] == 192, "incorrect value for certificate_bytes[64], expected 192, is %d", check_msg->certificate_bytes[64]); - ck_assert_msg(check_msg->certificate_bytes[65] == 195, "incorrect value for certificate_bytes[65], expected 195, is %d", check_msg->certificate_bytes[65]); - ck_assert_msg(check_msg->certificate_bytes[66] == 198, "incorrect value for certificate_bytes[66], expected 198, is %d", check_msg->certificate_bytes[66]); - ck_assert_msg(check_msg->certificate_bytes[67] == 201, "incorrect value for certificate_bytes[67], expected 201, is %d", check_msg->certificate_bytes[67]); - ck_assert_msg(check_msg->certificate_bytes[68] == 204, "incorrect value for certificate_bytes[68], expected 204, is %d", check_msg->certificate_bytes[68]); - ck_assert_msg(check_msg->certificate_bytes[69] == 207, "incorrect value for certificate_bytes[69], expected 207, is %d", check_msg->certificate_bytes[69]); - ck_assert_msg(check_msg->certificate_bytes[70] == 210, "incorrect value for certificate_bytes[70], expected 210, is %d", check_msg->certificate_bytes[70]); - ck_assert_msg(check_msg->certificate_bytes[71] == 213, "incorrect value for certificate_bytes[71], expected 213, is %d", check_msg->certificate_bytes[71]); - ck_assert_msg(check_msg->certificate_bytes[72] == 216, "incorrect value for certificate_bytes[72], expected 216, is %d", check_msg->certificate_bytes[72]); - ck_assert_msg(check_msg->certificate_bytes[73] == 219, "incorrect value for certificate_bytes[73], expected 219, is %d", check_msg->certificate_bytes[73]); - ck_assert_msg(check_msg->certificate_bytes[74] == 222, "incorrect value for certificate_bytes[74], expected 222, is %d", check_msg->certificate_bytes[74]); - ck_assert_msg(check_msg->certificate_bytes[75] == 225, "incorrect value for certificate_bytes[75], expected 225, is %d", check_msg->certificate_bytes[75]); - ck_assert_msg(check_msg->certificate_bytes[76] == 228, "incorrect value for certificate_bytes[76], expected 228, is %d", check_msg->certificate_bytes[76]); - ck_assert_msg(check_msg->certificate_bytes[77] == 231, "incorrect value for certificate_bytes[77], expected 231, is %d", check_msg->certificate_bytes[77]); - ck_assert_msg(check_msg->certificate_bytes[78] == 234, "incorrect value for certificate_bytes[78], expected 234, is %d", check_msg->certificate_bytes[78]); - ck_assert_msg(check_msg->certificate_bytes[79] == 237, "incorrect value for certificate_bytes[79], expected 237, is %d", check_msg->certificate_bytes[79]); - ck_assert_msg(check_msg->certificate_bytes[80] == 240, "incorrect value for certificate_bytes[80], expected 240, is %d", check_msg->certificate_bytes[80]); - ck_assert_msg(check_msg->certificate_bytes[81] == 243, "incorrect value for certificate_bytes[81], expected 243, is %d", check_msg->certificate_bytes[81]); - ck_assert_msg(check_msg->certificate_bytes[82] == 246, "incorrect value for certificate_bytes[82], expected 246, is %d", check_msg->certificate_bytes[82]); - ck_assert_msg(check_msg->certificate_bytes[83] == 249, "incorrect value for certificate_bytes[83], expected 249, is %d", check_msg->certificate_bytes[83]); - ck_assert_msg(check_msg->certificate_bytes[84] == 252, "incorrect value for certificate_bytes[84], expected 252, is %d", check_msg->certificate_bytes[84]); - ck_assert_msg(check_msg->fingerprint[0] == 100, "incorrect value for fingerprint[0], expected 100, is %d", check_msg->fingerprint[0]); - ck_assert_msg(check_msg->fingerprint[1] == 101, "incorrect value for fingerprint[1], expected 101, is %d", check_msg->fingerprint[1]); - ck_assert_msg(check_msg->fingerprint[2] == 102, "incorrect value for fingerprint[2], expected 102, is %d", check_msg->fingerprint[2]); - ck_assert_msg(check_msg->fingerprint[3] == 103, "incorrect value for fingerprint[3], expected 103, is %d", check_msg->fingerprint[3]); - ck_assert_msg(check_msg->fingerprint[4] == 104, "incorrect value for fingerprint[4], expected 104, is %d", check_msg->fingerprint[4]); - ck_assert_msg(check_msg->fingerprint[5] == 105, "incorrect value for fingerprint[5], expected 105, is %d", check_msg->fingerprint[5]); - ck_assert_msg(check_msg->fingerprint[6] == 106, "incorrect value for fingerprint[6], expected 106, is %d", check_msg->fingerprint[6]); - ck_assert_msg(check_msg->fingerprint[7] == 107, "incorrect value for fingerprint[7], expected 107, is %d", check_msg->fingerprint[7]); - ck_assert_msg(check_msg->fingerprint[8] == 108, "incorrect value for fingerprint[8], expected 108, is %d", check_msg->fingerprint[8]); - ck_assert_msg(check_msg->fingerprint[9] == 109, "incorrect value for fingerprint[9], expected 109, is %d", check_msg->fingerprint[9]); - ck_assert_msg(check_msg->fingerprint[10] == 110, "incorrect value for fingerprint[10], expected 110, is %d", check_msg->fingerprint[10]); - ck_assert_msg(check_msg->fingerprint[11] == 111, "incorrect value for fingerprint[11], expected 111, is %d", check_msg->fingerprint[11]); - ck_assert_msg(check_msg->fingerprint[12] == 112, "incorrect value for fingerprint[12], expected 112, is %d", check_msg->fingerprint[12]); - ck_assert_msg(check_msg->fingerprint[13] == 113, "incorrect value for fingerprint[13], expected 113, is %d", check_msg->fingerprint[13]); - ck_assert_msg(check_msg->fingerprint[14] == 114, "incorrect value for fingerprint[14], expected 114, is %d", check_msg->fingerprint[14]); - ck_assert_msg(check_msg->fingerprint[15] == 115, "incorrect value for fingerprint[15], expected 115, is %d", check_msg->fingerprint[15]); - ck_assert_msg(check_msg->fingerprint[16] == 116, "incorrect value for fingerprint[16], expected 116, is %d", check_msg->fingerprint[16]); - ck_assert_msg(check_msg->fingerprint[17] == 117, "incorrect value for fingerprint[17], expected 117, is %d", check_msg->fingerprint[17]); - ck_assert_msg(check_msg->fingerprint[18] == 118, "incorrect value for fingerprint[18], expected 118, is %d", check_msg->fingerprint[18]); - ck_assert_msg(check_msg->fingerprint[19] == 119, "incorrect value for fingerprint[19], expected 119, is %d", check_msg->fingerprint[19]); - ck_assert_msg(check_msg->n_msg == 16, "incorrect value for n_msg, expected 16, is %d", check_msg->n_msg); + ck_assert_msg(check_msg->certificate_bytes[0] == 0, + "incorrect value for certificate_bytes[0], expected 0, is %d", + check_msg->certificate_bytes[0]); + ck_assert_msg(check_msg->certificate_bytes[1] == 3, + "incorrect value for certificate_bytes[1], expected 3, is %d", + check_msg->certificate_bytes[1]); + ck_assert_msg(check_msg->certificate_bytes[2] == 6, + "incorrect value for certificate_bytes[2], expected 6, is %d", + check_msg->certificate_bytes[2]); + ck_assert_msg(check_msg->certificate_bytes[3] == 9, + "incorrect value for certificate_bytes[3], expected 9, is %d", + check_msg->certificate_bytes[3]); + ck_assert_msg( + check_msg->certificate_bytes[4] == 12, + "incorrect value for certificate_bytes[4], expected 12, is %d", + check_msg->certificate_bytes[4]); + ck_assert_msg( + check_msg->certificate_bytes[5] == 15, + "incorrect value for certificate_bytes[5], expected 15, is %d", + check_msg->certificate_bytes[5]); + ck_assert_msg( + check_msg->certificate_bytes[6] == 18, + "incorrect value for certificate_bytes[6], expected 18, is %d", + check_msg->certificate_bytes[6]); + ck_assert_msg( + check_msg->certificate_bytes[7] == 21, + "incorrect value for certificate_bytes[7], expected 21, is %d", + check_msg->certificate_bytes[7]); + ck_assert_msg( + check_msg->certificate_bytes[8] == 24, + "incorrect value for certificate_bytes[8], expected 24, is %d", + check_msg->certificate_bytes[8]); + ck_assert_msg( + check_msg->certificate_bytes[9] == 27, + "incorrect value for certificate_bytes[9], expected 27, is %d", + check_msg->certificate_bytes[9]); + ck_assert_msg( + check_msg->certificate_bytes[10] == 30, + "incorrect value for certificate_bytes[10], expected 30, is %d", + check_msg->certificate_bytes[10]); + ck_assert_msg( + check_msg->certificate_bytes[11] == 33, + "incorrect value for certificate_bytes[11], expected 33, is %d", + check_msg->certificate_bytes[11]); + ck_assert_msg( + check_msg->certificate_bytes[12] == 36, + "incorrect value for certificate_bytes[12], expected 36, is %d", + check_msg->certificate_bytes[12]); + ck_assert_msg( + check_msg->certificate_bytes[13] == 39, + "incorrect value for certificate_bytes[13], expected 39, is %d", + check_msg->certificate_bytes[13]); + ck_assert_msg( + check_msg->certificate_bytes[14] == 42, + "incorrect value for certificate_bytes[14], expected 42, is %d", + check_msg->certificate_bytes[14]); + ck_assert_msg( + check_msg->certificate_bytes[15] == 45, + "incorrect value for certificate_bytes[15], expected 45, is %d", + check_msg->certificate_bytes[15]); + ck_assert_msg( + check_msg->certificate_bytes[16] == 48, + "incorrect value for certificate_bytes[16], expected 48, is %d", + check_msg->certificate_bytes[16]); + ck_assert_msg( + check_msg->certificate_bytes[17] == 51, + "incorrect value for certificate_bytes[17], expected 51, is %d", + check_msg->certificate_bytes[17]); + ck_assert_msg( + check_msg->certificate_bytes[18] == 54, + "incorrect value for certificate_bytes[18], expected 54, is %d", + check_msg->certificate_bytes[18]); + ck_assert_msg( + check_msg->certificate_bytes[19] == 57, + "incorrect value for certificate_bytes[19], expected 57, is %d", + check_msg->certificate_bytes[19]); + ck_assert_msg( + check_msg->certificate_bytes[20] == 60, + "incorrect value for certificate_bytes[20], expected 60, is %d", + check_msg->certificate_bytes[20]); + ck_assert_msg( + check_msg->certificate_bytes[21] == 63, + "incorrect value for certificate_bytes[21], expected 63, is %d", + check_msg->certificate_bytes[21]); + ck_assert_msg( + check_msg->certificate_bytes[22] == 66, + "incorrect value for certificate_bytes[22], expected 66, is %d", + check_msg->certificate_bytes[22]); + ck_assert_msg( + check_msg->certificate_bytes[23] == 69, + "incorrect value for certificate_bytes[23], expected 69, is %d", + check_msg->certificate_bytes[23]); + ck_assert_msg( + check_msg->certificate_bytes[24] == 72, + "incorrect value for certificate_bytes[24], expected 72, is %d", + check_msg->certificate_bytes[24]); + ck_assert_msg( + check_msg->certificate_bytes[25] == 75, + "incorrect value for certificate_bytes[25], expected 75, is %d", + check_msg->certificate_bytes[25]); + ck_assert_msg( + check_msg->certificate_bytes[26] == 78, + "incorrect value for certificate_bytes[26], expected 78, is %d", + check_msg->certificate_bytes[26]); + ck_assert_msg( + check_msg->certificate_bytes[27] == 81, + "incorrect value for certificate_bytes[27], expected 81, is %d", + check_msg->certificate_bytes[27]); + ck_assert_msg( + check_msg->certificate_bytes[28] == 84, + "incorrect value for certificate_bytes[28], expected 84, is %d", + check_msg->certificate_bytes[28]); + ck_assert_msg( + check_msg->certificate_bytes[29] == 87, + "incorrect value for certificate_bytes[29], expected 87, is %d", + check_msg->certificate_bytes[29]); + ck_assert_msg( + check_msg->certificate_bytes[30] == 90, + "incorrect value for certificate_bytes[30], expected 90, is %d", + check_msg->certificate_bytes[30]); + ck_assert_msg( + check_msg->certificate_bytes[31] == 93, + "incorrect value for certificate_bytes[31], expected 93, is %d", + check_msg->certificate_bytes[31]); + ck_assert_msg( + check_msg->certificate_bytes[32] == 96, + "incorrect value for certificate_bytes[32], expected 96, is %d", + check_msg->certificate_bytes[32]); + ck_assert_msg( + check_msg->certificate_bytes[33] == 99, + "incorrect value for certificate_bytes[33], expected 99, is %d", + check_msg->certificate_bytes[33]); + ck_assert_msg( + check_msg->certificate_bytes[34] == 102, + "incorrect value for certificate_bytes[34], expected 102, is %d", + check_msg->certificate_bytes[34]); + ck_assert_msg( + check_msg->certificate_bytes[35] == 105, + "incorrect value for certificate_bytes[35], expected 105, is %d", + check_msg->certificate_bytes[35]); + ck_assert_msg( + check_msg->certificate_bytes[36] == 108, + "incorrect value for certificate_bytes[36], expected 108, is %d", + check_msg->certificate_bytes[36]); + ck_assert_msg( + check_msg->certificate_bytes[37] == 111, + "incorrect value for certificate_bytes[37], expected 111, is %d", + check_msg->certificate_bytes[37]); + ck_assert_msg( + check_msg->certificate_bytes[38] == 114, + "incorrect value for certificate_bytes[38], expected 114, is %d", + check_msg->certificate_bytes[38]); + ck_assert_msg( + check_msg->certificate_bytes[39] == 117, + "incorrect value for certificate_bytes[39], expected 117, is %d", + check_msg->certificate_bytes[39]); + ck_assert_msg( + check_msg->certificate_bytes[40] == 120, + "incorrect value for certificate_bytes[40], expected 120, is %d", + check_msg->certificate_bytes[40]); + ck_assert_msg( + check_msg->certificate_bytes[41] == 123, + "incorrect value for certificate_bytes[41], expected 123, is %d", + check_msg->certificate_bytes[41]); + ck_assert_msg( + check_msg->certificate_bytes[42] == 126, + "incorrect value for certificate_bytes[42], expected 126, is %d", + check_msg->certificate_bytes[42]); + ck_assert_msg( + check_msg->certificate_bytes[43] == 129, + "incorrect value for certificate_bytes[43], expected 129, is %d", + check_msg->certificate_bytes[43]); + ck_assert_msg( + check_msg->certificate_bytes[44] == 132, + "incorrect value for certificate_bytes[44], expected 132, is %d", + check_msg->certificate_bytes[44]); + ck_assert_msg( + check_msg->certificate_bytes[45] == 135, + "incorrect value for certificate_bytes[45], expected 135, is %d", + check_msg->certificate_bytes[45]); + ck_assert_msg( + check_msg->certificate_bytes[46] == 138, + "incorrect value for certificate_bytes[46], expected 138, is %d", + check_msg->certificate_bytes[46]); + ck_assert_msg( + check_msg->certificate_bytes[47] == 141, + "incorrect value for certificate_bytes[47], expected 141, is %d", + check_msg->certificate_bytes[47]); + ck_assert_msg( + check_msg->certificate_bytes[48] == 144, + "incorrect value for certificate_bytes[48], expected 144, is %d", + check_msg->certificate_bytes[48]); + ck_assert_msg( + check_msg->certificate_bytes[49] == 147, + "incorrect value for certificate_bytes[49], expected 147, is %d", + check_msg->certificate_bytes[49]); + ck_assert_msg( + check_msg->certificate_bytes[50] == 150, + "incorrect value for certificate_bytes[50], expected 150, is %d", + check_msg->certificate_bytes[50]); + ck_assert_msg( + check_msg->certificate_bytes[51] == 153, + "incorrect value for certificate_bytes[51], expected 153, is %d", + check_msg->certificate_bytes[51]); + ck_assert_msg( + check_msg->certificate_bytes[52] == 156, + "incorrect value for certificate_bytes[52], expected 156, is %d", + check_msg->certificate_bytes[52]); + ck_assert_msg( + check_msg->certificate_bytes[53] == 159, + "incorrect value for certificate_bytes[53], expected 159, is %d", + check_msg->certificate_bytes[53]); + ck_assert_msg( + check_msg->certificate_bytes[54] == 162, + "incorrect value for certificate_bytes[54], expected 162, is %d", + check_msg->certificate_bytes[54]); + ck_assert_msg( + check_msg->certificate_bytes[55] == 165, + "incorrect value for certificate_bytes[55], expected 165, is %d", + check_msg->certificate_bytes[55]); + ck_assert_msg( + check_msg->certificate_bytes[56] == 168, + "incorrect value for certificate_bytes[56], expected 168, is %d", + check_msg->certificate_bytes[56]); + ck_assert_msg( + check_msg->certificate_bytes[57] == 171, + "incorrect value for certificate_bytes[57], expected 171, is %d", + check_msg->certificate_bytes[57]); + ck_assert_msg( + check_msg->certificate_bytes[58] == 174, + "incorrect value for certificate_bytes[58], expected 174, is %d", + check_msg->certificate_bytes[58]); + ck_assert_msg( + check_msg->certificate_bytes[59] == 177, + "incorrect value for certificate_bytes[59], expected 177, is %d", + check_msg->certificate_bytes[59]); + ck_assert_msg( + check_msg->certificate_bytes[60] == 180, + "incorrect value for certificate_bytes[60], expected 180, is %d", + check_msg->certificate_bytes[60]); + ck_assert_msg( + check_msg->certificate_bytes[61] == 183, + "incorrect value for certificate_bytes[61], expected 183, is %d", + check_msg->certificate_bytes[61]); + ck_assert_msg( + check_msg->certificate_bytes[62] == 186, + "incorrect value for certificate_bytes[62], expected 186, is %d", + check_msg->certificate_bytes[62]); + ck_assert_msg( + check_msg->certificate_bytes[63] == 189, + "incorrect value for certificate_bytes[63], expected 189, is %d", + check_msg->certificate_bytes[63]); + ck_assert_msg( + check_msg->certificate_bytes[64] == 192, + "incorrect value for certificate_bytes[64], expected 192, is %d", + check_msg->certificate_bytes[64]); + ck_assert_msg( + check_msg->certificate_bytes[65] == 195, + "incorrect value for certificate_bytes[65], expected 195, is %d", + check_msg->certificate_bytes[65]); + ck_assert_msg( + check_msg->certificate_bytes[66] == 198, + "incorrect value for certificate_bytes[66], expected 198, is %d", + check_msg->certificate_bytes[66]); + ck_assert_msg( + check_msg->certificate_bytes[67] == 201, + "incorrect value for certificate_bytes[67], expected 201, is %d", + check_msg->certificate_bytes[67]); + ck_assert_msg( + check_msg->certificate_bytes[68] == 204, + "incorrect value for certificate_bytes[68], expected 204, is %d", + check_msg->certificate_bytes[68]); + ck_assert_msg( + check_msg->certificate_bytes[69] == 207, + "incorrect value for certificate_bytes[69], expected 207, is %d", + check_msg->certificate_bytes[69]); + ck_assert_msg( + check_msg->certificate_bytes[70] == 210, + "incorrect value for certificate_bytes[70], expected 210, is %d", + check_msg->certificate_bytes[70]); + ck_assert_msg( + check_msg->certificate_bytes[71] == 213, + "incorrect value for certificate_bytes[71], expected 213, is %d", + check_msg->certificate_bytes[71]); + ck_assert_msg( + check_msg->certificate_bytes[72] == 216, + "incorrect value for certificate_bytes[72], expected 216, is %d", + check_msg->certificate_bytes[72]); + ck_assert_msg( + check_msg->certificate_bytes[73] == 219, + "incorrect value for certificate_bytes[73], expected 219, is %d", + check_msg->certificate_bytes[73]); + ck_assert_msg( + check_msg->certificate_bytes[74] == 222, + "incorrect value for certificate_bytes[74], expected 222, is %d", + check_msg->certificate_bytes[74]); + ck_assert_msg( + check_msg->certificate_bytes[75] == 225, + "incorrect value for certificate_bytes[75], expected 225, is %d", + check_msg->certificate_bytes[75]); + ck_assert_msg( + check_msg->certificate_bytes[76] == 228, + "incorrect value for certificate_bytes[76], expected 228, is %d", + check_msg->certificate_bytes[76]); + ck_assert_msg( + check_msg->certificate_bytes[77] == 231, + "incorrect value for certificate_bytes[77], expected 231, is %d", + check_msg->certificate_bytes[77]); + ck_assert_msg( + check_msg->certificate_bytes[78] == 234, + "incorrect value for certificate_bytes[78], expected 234, is %d", + check_msg->certificate_bytes[78]); + ck_assert_msg( + check_msg->certificate_bytes[79] == 237, + "incorrect value for certificate_bytes[79], expected 237, is %d", + check_msg->certificate_bytes[79]); + ck_assert_msg( + check_msg->certificate_bytes[80] == 240, + "incorrect value for certificate_bytes[80], expected 240, is %d", + check_msg->certificate_bytes[80]); + ck_assert_msg( + check_msg->certificate_bytes[81] == 243, + "incorrect value for certificate_bytes[81], expected 243, is %d", + check_msg->certificate_bytes[81]); + ck_assert_msg( + check_msg->certificate_bytes[82] == 246, + "incorrect value for certificate_bytes[82], expected 246, is %d", + check_msg->certificate_bytes[82]); + ck_assert_msg( + check_msg->certificate_bytes[83] == 249, + "incorrect value for certificate_bytes[83], expected 249, is %d", + check_msg->certificate_bytes[83]); + ck_assert_msg( + check_msg->certificate_bytes[84] == 252, + "incorrect value for certificate_bytes[84], expected 252, is %d", + check_msg->certificate_bytes[84]); + ck_assert_msg(check_msg->fingerprint[0] == 100, + "incorrect value for fingerprint[0], expected 100, is %d", + check_msg->fingerprint[0]); + ck_assert_msg(check_msg->fingerprint[1] == 101, + "incorrect value for fingerprint[1], expected 101, is %d", + check_msg->fingerprint[1]); + ck_assert_msg(check_msg->fingerprint[2] == 102, + "incorrect value for fingerprint[2], expected 102, is %d", + check_msg->fingerprint[2]); + ck_assert_msg(check_msg->fingerprint[3] == 103, + "incorrect value for fingerprint[3], expected 103, is %d", + check_msg->fingerprint[3]); + ck_assert_msg(check_msg->fingerprint[4] == 104, + "incorrect value for fingerprint[4], expected 104, is %d", + check_msg->fingerprint[4]); + ck_assert_msg(check_msg->fingerprint[5] == 105, + "incorrect value for fingerprint[5], expected 105, is %d", + check_msg->fingerprint[5]); + ck_assert_msg(check_msg->fingerprint[6] == 106, + "incorrect value for fingerprint[6], expected 106, is %d", + check_msg->fingerprint[6]); + ck_assert_msg(check_msg->fingerprint[7] == 107, + "incorrect value for fingerprint[7], expected 107, is %d", + check_msg->fingerprint[7]); + ck_assert_msg(check_msg->fingerprint[8] == 108, + "incorrect value for fingerprint[8], expected 108, is %d", + check_msg->fingerprint[8]); + ck_assert_msg(check_msg->fingerprint[9] == 109, + "incorrect value for fingerprint[9], expected 109, is %d", + check_msg->fingerprint[9]); + ck_assert_msg(check_msg->fingerprint[10] == 110, + "incorrect value for fingerprint[10], expected 110, is %d", + check_msg->fingerprint[10]); + ck_assert_msg(check_msg->fingerprint[11] == 111, + "incorrect value for fingerprint[11], expected 111, is %d", + check_msg->fingerprint[11]); + ck_assert_msg(check_msg->fingerprint[12] == 112, + "incorrect value for fingerprint[12], expected 112, is %d", + check_msg->fingerprint[12]); + ck_assert_msg(check_msg->fingerprint[13] == 113, + "incorrect value for fingerprint[13], expected 113, is %d", + check_msg->fingerprint[13]); + ck_assert_msg(check_msg->fingerprint[14] == 114, + "incorrect value for fingerprint[14], expected 114, is %d", + check_msg->fingerprint[14]); + ck_assert_msg(check_msg->fingerprint[15] == 115, + "incorrect value for fingerprint[15], expected 115, is %d", + check_msg->fingerprint[15]); + ck_assert_msg(check_msg->fingerprint[16] == 116, + "incorrect value for fingerprint[16], expected 116, is %d", + check_msg->fingerprint[16]); + ck_assert_msg(check_msg->fingerprint[17] == 117, + "incorrect value for fingerprint[17], expected 117, is %d", + check_msg->fingerprint[17]); + ck_assert_msg(check_msg->fingerprint[18] == 118, + "incorrect value for fingerprint[18], expected 118, is %d", + check_msg->fingerprint[18]); + ck_assert_msg(check_msg->fingerprint[19] == 119, + "incorrect value for fingerprint[19], expected 119, is %d", + check_msg->fingerprint[19]); + ck_assert_msg(check_msg->n_msg == 16, + "incorrect value for n_msg, expected 16, is %d", + check_msg->n_msg); } } END_TEST -Suite* legacy_auto_check_sbp_signing_MsgEd25519CertificateDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_signing_MsgEd25519CertificateDep"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep); +Suite *legacy_auto_check_sbp_signing_MsgEd25519CertificateDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_signing_MsgEd25519CertificateDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_signing_MsgEd25519SignatureDepA.c b/c/test/legacy/auto_check_sbp_signing_MsgEd25519SignatureDepA.c index 0a800ed59..815b86ac2 100644 --- a/c/test/legacy/auto_check_sbp_signing_MsgEd25519SignatureDepA.c +++ b/c/test/legacy/auto_check_sbp_signing_MsgEd25519SignatureDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,35 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xC01, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xC01, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xC01, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xC01, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,1,12,66,0,184,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,136,19,0,0,114,20,0,0,92,21,0,0,70,22,0,0,48,23,0,0,26,24,0,0,4,25,0,0,238,25,0,0,216,26,0,0,194,27,0,0,172,28,0,0,150,29,0,0,128,30,0,0,106,31,0,0,84,32,0,0,62,33,0,0,40,34,0,0,18,35,0,0,252,35,0,0,230,36,0,0,208,37,0,0,186,38,0,0,164,39,0,0,142,40,0,0,120,41,0,0,169,111, }; + u8 encoded_frame[] = { + 85, 1, 12, 66, 0, 184, 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 136, 19, 0, 0, 114, 20, 0, 0, + 92, 21, 0, 0, 70, 22, 0, 0, 48, 23, 0, 0, 26, 24, + 0, 0, 4, 25, 0, 0, 238, 25, 0, 0, 216, 26, 0, 0, + 194, 27, 0, 0, 172, 28, 0, 0, 150, 29, 0, 0, 128, 30, + 0, 0, 106, 31, 0, 0, 84, 32, 0, 0, 62, 33, 0, 0, + 40, 34, 0, 0, 18, 35, 0, 0, 252, 35, 0, 0, 230, 36, + 0, 0, 208, 37, 0, 0, 186, 38, 0, 0, 164, 39, 0, 0, + 142, 40, 0, 0, 120, 41, 0, 0, 169, 111, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ed25519_signature_dep_a_t* test_msg = ( msg_ed25519_signature_dep_a_t* )test_msg_storage; + msg_ed25519_signature_dep_a_t *test_msg = + (msg_ed25519_signature_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->fingerprint) == 0) { // Cope with variable length arrays @@ -688,172 +703,425 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA ) test_msg_len += sizeof(test_msg->signed_messages[0]); } test_msg->signed_messages[24] = 10616; - sbp_payload_send(&sbp_state, 0xC01, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xC01, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xC01, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ed25519_signature_dep_a_t* check_msg = ( msg_ed25519_signature_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ed25519_signature_dep_a_t *check_msg = + (msg_ed25519_signature_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->fingerprint[0] == 100, "incorrect value for fingerprint[0], expected 100, is %d", check_msg->fingerprint[0]); - ck_assert_msg(check_msg->fingerprint[1] == 101, "incorrect value for fingerprint[1], expected 101, is %d", check_msg->fingerprint[1]); - ck_assert_msg(check_msg->fingerprint[2] == 102, "incorrect value for fingerprint[2], expected 102, is %d", check_msg->fingerprint[2]); - ck_assert_msg(check_msg->fingerprint[3] == 103, "incorrect value for fingerprint[3], expected 103, is %d", check_msg->fingerprint[3]); - ck_assert_msg(check_msg->fingerprint[4] == 104, "incorrect value for fingerprint[4], expected 104, is %d", check_msg->fingerprint[4]); - ck_assert_msg(check_msg->fingerprint[5] == 105, "incorrect value for fingerprint[5], expected 105, is %d", check_msg->fingerprint[5]); - ck_assert_msg(check_msg->fingerprint[6] == 106, "incorrect value for fingerprint[6], expected 106, is %d", check_msg->fingerprint[6]); - ck_assert_msg(check_msg->fingerprint[7] == 107, "incorrect value for fingerprint[7], expected 107, is %d", check_msg->fingerprint[7]); - ck_assert_msg(check_msg->fingerprint[8] == 108, "incorrect value for fingerprint[8], expected 108, is %d", check_msg->fingerprint[8]); - ck_assert_msg(check_msg->fingerprint[9] == 109, "incorrect value for fingerprint[9], expected 109, is %d", check_msg->fingerprint[9]); - ck_assert_msg(check_msg->fingerprint[10] == 110, "incorrect value for fingerprint[10], expected 110, is %d", check_msg->fingerprint[10]); - ck_assert_msg(check_msg->fingerprint[11] == 111, "incorrect value for fingerprint[11], expected 111, is %d", check_msg->fingerprint[11]); - ck_assert_msg(check_msg->fingerprint[12] == 112, "incorrect value for fingerprint[12], expected 112, is %d", check_msg->fingerprint[12]); - ck_assert_msg(check_msg->fingerprint[13] == 113, "incorrect value for fingerprint[13], expected 113, is %d", check_msg->fingerprint[13]); - ck_assert_msg(check_msg->fingerprint[14] == 114, "incorrect value for fingerprint[14], expected 114, is %d", check_msg->fingerprint[14]); - ck_assert_msg(check_msg->fingerprint[15] == 115, "incorrect value for fingerprint[15], expected 115, is %d", check_msg->fingerprint[15]); - ck_assert_msg(check_msg->fingerprint[16] == 116, "incorrect value for fingerprint[16], expected 116, is %d", check_msg->fingerprint[16]); - ck_assert_msg(check_msg->fingerprint[17] == 117, "incorrect value for fingerprint[17], expected 117, is %d", check_msg->fingerprint[17]); - ck_assert_msg(check_msg->fingerprint[18] == 118, "incorrect value for fingerprint[18], expected 118, is %d", check_msg->fingerprint[18]); - ck_assert_msg(check_msg->fingerprint[19] == 119, "incorrect value for fingerprint[19], expected 119, is %d", check_msg->fingerprint[19]); - ck_assert_msg(check_msg->signature[0] == 0, "incorrect value for signature[0], expected 0, is %d", check_msg->signature[0]); - ck_assert_msg(check_msg->signature[1] == 1, "incorrect value for signature[1], expected 1, is %d", check_msg->signature[1]); - ck_assert_msg(check_msg->signature[2] == 2, "incorrect value for signature[2], expected 2, is %d", check_msg->signature[2]); - ck_assert_msg(check_msg->signature[3] == 3, "incorrect value for signature[3], expected 3, is %d", check_msg->signature[3]); - ck_assert_msg(check_msg->signature[4] == 4, "incorrect value for signature[4], expected 4, is %d", check_msg->signature[4]); - ck_assert_msg(check_msg->signature[5] == 5, "incorrect value for signature[5], expected 5, is %d", check_msg->signature[5]); - ck_assert_msg(check_msg->signature[6] == 6, "incorrect value for signature[6], expected 6, is %d", check_msg->signature[6]); - ck_assert_msg(check_msg->signature[7] == 7, "incorrect value for signature[7], expected 7, is %d", check_msg->signature[7]); - ck_assert_msg(check_msg->signature[8] == 8, "incorrect value for signature[8], expected 8, is %d", check_msg->signature[8]); - ck_assert_msg(check_msg->signature[9] == 9, "incorrect value for signature[9], expected 9, is %d", check_msg->signature[9]); - ck_assert_msg(check_msg->signature[10] == 10, "incorrect value for signature[10], expected 10, is %d", check_msg->signature[10]); - ck_assert_msg(check_msg->signature[11] == 11, "incorrect value for signature[11], expected 11, is %d", check_msg->signature[11]); - ck_assert_msg(check_msg->signature[12] == 12, "incorrect value for signature[12], expected 12, is %d", check_msg->signature[12]); - ck_assert_msg(check_msg->signature[13] == 13, "incorrect value for signature[13], expected 13, is %d", check_msg->signature[13]); - ck_assert_msg(check_msg->signature[14] == 14, "incorrect value for signature[14], expected 14, is %d", check_msg->signature[14]); - ck_assert_msg(check_msg->signature[15] == 15, "incorrect value for signature[15], expected 15, is %d", check_msg->signature[15]); - ck_assert_msg(check_msg->signature[16] == 16, "incorrect value for signature[16], expected 16, is %d", check_msg->signature[16]); - ck_assert_msg(check_msg->signature[17] == 17, "incorrect value for signature[17], expected 17, is %d", check_msg->signature[17]); - ck_assert_msg(check_msg->signature[18] == 18, "incorrect value for signature[18], expected 18, is %d", check_msg->signature[18]); - ck_assert_msg(check_msg->signature[19] == 19, "incorrect value for signature[19], expected 19, is %d", check_msg->signature[19]); - ck_assert_msg(check_msg->signature[20] == 20, "incorrect value for signature[20], expected 20, is %d", check_msg->signature[20]); - ck_assert_msg(check_msg->signature[21] == 21, "incorrect value for signature[21], expected 21, is %d", check_msg->signature[21]); - ck_assert_msg(check_msg->signature[22] == 22, "incorrect value for signature[22], expected 22, is %d", check_msg->signature[22]); - ck_assert_msg(check_msg->signature[23] == 23, "incorrect value for signature[23], expected 23, is %d", check_msg->signature[23]); - ck_assert_msg(check_msg->signature[24] == 24, "incorrect value for signature[24], expected 24, is %d", check_msg->signature[24]); - ck_assert_msg(check_msg->signature[25] == 25, "incorrect value for signature[25], expected 25, is %d", check_msg->signature[25]); - ck_assert_msg(check_msg->signature[26] == 26, "incorrect value for signature[26], expected 26, is %d", check_msg->signature[26]); - ck_assert_msg(check_msg->signature[27] == 27, "incorrect value for signature[27], expected 27, is %d", check_msg->signature[27]); - ck_assert_msg(check_msg->signature[28] == 28, "incorrect value for signature[28], expected 28, is %d", check_msg->signature[28]); - ck_assert_msg(check_msg->signature[29] == 29, "incorrect value for signature[29], expected 29, is %d", check_msg->signature[29]); - ck_assert_msg(check_msg->signature[30] == 30, "incorrect value for signature[30], expected 30, is %d", check_msg->signature[30]); - ck_assert_msg(check_msg->signature[31] == 31, "incorrect value for signature[31], expected 31, is %d", check_msg->signature[31]); - ck_assert_msg(check_msg->signature[32] == 32, "incorrect value for signature[32], expected 32, is %d", check_msg->signature[32]); - ck_assert_msg(check_msg->signature[33] == 33, "incorrect value for signature[33], expected 33, is %d", check_msg->signature[33]); - ck_assert_msg(check_msg->signature[34] == 34, "incorrect value for signature[34], expected 34, is %d", check_msg->signature[34]); - ck_assert_msg(check_msg->signature[35] == 35, "incorrect value for signature[35], expected 35, is %d", check_msg->signature[35]); - ck_assert_msg(check_msg->signature[36] == 36, "incorrect value for signature[36], expected 36, is %d", check_msg->signature[36]); - ck_assert_msg(check_msg->signature[37] == 37, "incorrect value for signature[37], expected 37, is %d", check_msg->signature[37]); - ck_assert_msg(check_msg->signature[38] == 38, "incorrect value for signature[38], expected 38, is %d", check_msg->signature[38]); - ck_assert_msg(check_msg->signature[39] == 39, "incorrect value for signature[39], expected 39, is %d", check_msg->signature[39]); - ck_assert_msg(check_msg->signature[40] == 40, "incorrect value for signature[40], expected 40, is %d", check_msg->signature[40]); - ck_assert_msg(check_msg->signature[41] == 41, "incorrect value for signature[41], expected 41, is %d", check_msg->signature[41]); - ck_assert_msg(check_msg->signature[42] == 42, "incorrect value for signature[42], expected 42, is %d", check_msg->signature[42]); - ck_assert_msg(check_msg->signature[43] == 43, "incorrect value for signature[43], expected 43, is %d", check_msg->signature[43]); - ck_assert_msg(check_msg->signature[44] == 44, "incorrect value for signature[44], expected 44, is %d", check_msg->signature[44]); - ck_assert_msg(check_msg->signature[45] == 45, "incorrect value for signature[45], expected 45, is %d", check_msg->signature[45]); - ck_assert_msg(check_msg->signature[46] == 46, "incorrect value for signature[46], expected 46, is %d", check_msg->signature[46]); - ck_assert_msg(check_msg->signature[47] == 47, "incorrect value for signature[47], expected 47, is %d", check_msg->signature[47]); - ck_assert_msg(check_msg->signature[48] == 48, "incorrect value for signature[48], expected 48, is %d", check_msg->signature[48]); - ck_assert_msg(check_msg->signature[49] == 49, "incorrect value for signature[49], expected 49, is %d", check_msg->signature[49]); - ck_assert_msg(check_msg->signature[50] == 50, "incorrect value for signature[50], expected 50, is %d", check_msg->signature[50]); - ck_assert_msg(check_msg->signature[51] == 51, "incorrect value for signature[51], expected 51, is %d", check_msg->signature[51]); - ck_assert_msg(check_msg->signature[52] == 52, "incorrect value for signature[52], expected 52, is %d", check_msg->signature[52]); - ck_assert_msg(check_msg->signature[53] == 53, "incorrect value for signature[53], expected 53, is %d", check_msg->signature[53]); - ck_assert_msg(check_msg->signature[54] == 54, "incorrect value for signature[54], expected 54, is %d", check_msg->signature[54]); - ck_assert_msg(check_msg->signature[55] == 55, "incorrect value for signature[55], expected 55, is %d", check_msg->signature[55]); - ck_assert_msg(check_msg->signature[56] == 56, "incorrect value for signature[56], expected 56, is %d", check_msg->signature[56]); - ck_assert_msg(check_msg->signature[57] == 57, "incorrect value for signature[57], expected 57, is %d", check_msg->signature[57]); - ck_assert_msg(check_msg->signature[58] == 58, "incorrect value for signature[58], expected 58, is %d", check_msg->signature[58]); - ck_assert_msg(check_msg->signature[59] == 59, "incorrect value for signature[59], expected 59, is %d", check_msg->signature[59]); - ck_assert_msg(check_msg->signature[60] == 60, "incorrect value for signature[60], expected 60, is %d", check_msg->signature[60]); - ck_assert_msg(check_msg->signature[61] == 61, "incorrect value for signature[61], expected 61, is %d", check_msg->signature[61]); - ck_assert_msg(check_msg->signature[62] == 62, "incorrect value for signature[62], expected 62, is %d", check_msg->signature[62]); - ck_assert_msg(check_msg->signature[63] == 63, "incorrect value for signature[63], expected 63, is %d", check_msg->signature[63]); - ck_assert_msg(check_msg->signed_messages[0] == 5000, "incorrect value for signed_messages[0], expected 5000, is %d", check_msg->signed_messages[0]); - ck_assert_msg(check_msg->signed_messages[1] == 5234, "incorrect value for signed_messages[1], expected 5234, is %d", check_msg->signed_messages[1]); - ck_assert_msg(check_msg->signed_messages[2] == 5468, "incorrect value for signed_messages[2], expected 5468, is %d", check_msg->signed_messages[2]); - ck_assert_msg(check_msg->signed_messages[3] == 5702, "incorrect value for signed_messages[3], expected 5702, is %d", check_msg->signed_messages[3]); - ck_assert_msg(check_msg->signed_messages[4] == 5936, "incorrect value for signed_messages[4], expected 5936, is %d", check_msg->signed_messages[4]); - ck_assert_msg(check_msg->signed_messages[5] == 6170, "incorrect value for signed_messages[5], expected 6170, is %d", check_msg->signed_messages[5]); - ck_assert_msg(check_msg->signed_messages[6] == 6404, "incorrect value for signed_messages[6], expected 6404, is %d", check_msg->signed_messages[6]); - ck_assert_msg(check_msg->signed_messages[7] == 6638, "incorrect value for signed_messages[7], expected 6638, is %d", check_msg->signed_messages[7]); - ck_assert_msg(check_msg->signed_messages[8] == 6872, "incorrect value for signed_messages[8], expected 6872, is %d", check_msg->signed_messages[8]); - ck_assert_msg(check_msg->signed_messages[9] == 7106, "incorrect value for signed_messages[9], expected 7106, is %d", check_msg->signed_messages[9]); - ck_assert_msg(check_msg->signed_messages[10] == 7340, "incorrect value for signed_messages[10], expected 7340, is %d", check_msg->signed_messages[10]); - ck_assert_msg(check_msg->signed_messages[11] == 7574, "incorrect value for signed_messages[11], expected 7574, is %d", check_msg->signed_messages[11]); - ck_assert_msg(check_msg->signed_messages[12] == 7808, "incorrect value for signed_messages[12], expected 7808, is %d", check_msg->signed_messages[12]); - ck_assert_msg(check_msg->signed_messages[13] == 8042, "incorrect value for signed_messages[13], expected 8042, is %d", check_msg->signed_messages[13]); - ck_assert_msg(check_msg->signed_messages[14] == 8276, "incorrect value for signed_messages[14], expected 8276, is %d", check_msg->signed_messages[14]); - ck_assert_msg(check_msg->signed_messages[15] == 8510, "incorrect value for signed_messages[15], expected 8510, is %d", check_msg->signed_messages[15]); - ck_assert_msg(check_msg->signed_messages[16] == 8744, "incorrect value for signed_messages[16], expected 8744, is %d", check_msg->signed_messages[16]); - ck_assert_msg(check_msg->signed_messages[17] == 8978, "incorrect value for signed_messages[17], expected 8978, is %d", check_msg->signed_messages[17]); - ck_assert_msg(check_msg->signed_messages[18] == 9212, "incorrect value for signed_messages[18], expected 9212, is %d", check_msg->signed_messages[18]); - ck_assert_msg(check_msg->signed_messages[19] == 9446, "incorrect value for signed_messages[19], expected 9446, is %d", check_msg->signed_messages[19]); - ck_assert_msg(check_msg->signed_messages[20] == 9680, "incorrect value for signed_messages[20], expected 9680, is %d", check_msg->signed_messages[20]); - ck_assert_msg(check_msg->signed_messages[21] == 9914, "incorrect value for signed_messages[21], expected 9914, is %d", check_msg->signed_messages[21]); - ck_assert_msg(check_msg->signed_messages[22] == 10148, "incorrect value for signed_messages[22], expected 10148, is %d", check_msg->signed_messages[22]); - ck_assert_msg(check_msg->signed_messages[23] == 10382, "incorrect value for signed_messages[23], expected 10382, is %d", check_msg->signed_messages[23]); - ck_assert_msg(check_msg->signed_messages[24] == 10616, "incorrect value for signed_messages[24], expected 10616, is %d", check_msg->signed_messages[24]); + ck_assert_msg(check_msg->fingerprint[0] == 100, + "incorrect value for fingerprint[0], expected 100, is %d", + check_msg->fingerprint[0]); + ck_assert_msg(check_msg->fingerprint[1] == 101, + "incorrect value for fingerprint[1], expected 101, is %d", + check_msg->fingerprint[1]); + ck_assert_msg(check_msg->fingerprint[2] == 102, + "incorrect value for fingerprint[2], expected 102, is %d", + check_msg->fingerprint[2]); + ck_assert_msg(check_msg->fingerprint[3] == 103, + "incorrect value for fingerprint[3], expected 103, is %d", + check_msg->fingerprint[3]); + ck_assert_msg(check_msg->fingerprint[4] == 104, + "incorrect value for fingerprint[4], expected 104, is %d", + check_msg->fingerprint[4]); + ck_assert_msg(check_msg->fingerprint[5] == 105, + "incorrect value for fingerprint[5], expected 105, is %d", + check_msg->fingerprint[5]); + ck_assert_msg(check_msg->fingerprint[6] == 106, + "incorrect value for fingerprint[6], expected 106, is %d", + check_msg->fingerprint[6]); + ck_assert_msg(check_msg->fingerprint[7] == 107, + "incorrect value for fingerprint[7], expected 107, is %d", + check_msg->fingerprint[7]); + ck_assert_msg(check_msg->fingerprint[8] == 108, + "incorrect value for fingerprint[8], expected 108, is %d", + check_msg->fingerprint[8]); + ck_assert_msg(check_msg->fingerprint[9] == 109, + "incorrect value for fingerprint[9], expected 109, is %d", + check_msg->fingerprint[9]); + ck_assert_msg(check_msg->fingerprint[10] == 110, + "incorrect value for fingerprint[10], expected 110, is %d", + check_msg->fingerprint[10]); + ck_assert_msg(check_msg->fingerprint[11] == 111, + "incorrect value for fingerprint[11], expected 111, is %d", + check_msg->fingerprint[11]); + ck_assert_msg(check_msg->fingerprint[12] == 112, + "incorrect value for fingerprint[12], expected 112, is %d", + check_msg->fingerprint[12]); + ck_assert_msg(check_msg->fingerprint[13] == 113, + "incorrect value for fingerprint[13], expected 113, is %d", + check_msg->fingerprint[13]); + ck_assert_msg(check_msg->fingerprint[14] == 114, + "incorrect value for fingerprint[14], expected 114, is %d", + check_msg->fingerprint[14]); + ck_assert_msg(check_msg->fingerprint[15] == 115, + "incorrect value for fingerprint[15], expected 115, is %d", + check_msg->fingerprint[15]); + ck_assert_msg(check_msg->fingerprint[16] == 116, + "incorrect value for fingerprint[16], expected 116, is %d", + check_msg->fingerprint[16]); + ck_assert_msg(check_msg->fingerprint[17] == 117, + "incorrect value for fingerprint[17], expected 117, is %d", + check_msg->fingerprint[17]); + ck_assert_msg(check_msg->fingerprint[18] == 118, + "incorrect value for fingerprint[18], expected 118, is %d", + check_msg->fingerprint[18]); + ck_assert_msg(check_msg->fingerprint[19] == 119, + "incorrect value for fingerprint[19], expected 119, is %d", + check_msg->fingerprint[19]); + ck_assert_msg(check_msg->signature[0] == 0, + "incorrect value for signature[0], expected 0, is %d", + check_msg->signature[0]); + ck_assert_msg(check_msg->signature[1] == 1, + "incorrect value for signature[1], expected 1, is %d", + check_msg->signature[1]); + ck_assert_msg(check_msg->signature[2] == 2, + "incorrect value for signature[2], expected 2, is %d", + check_msg->signature[2]); + ck_assert_msg(check_msg->signature[3] == 3, + "incorrect value for signature[3], expected 3, is %d", + check_msg->signature[3]); + ck_assert_msg(check_msg->signature[4] == 4, + "incorrect value for signature[4], expected 4, is %d", + check_msg->signature[4]); + ck_assert_msg(check_msg->signature[5] == 5, + "incorrect value for signature[5], expected 5, is %d", + check_msg->signature[5]); + ck_assert_msg(check_msg->signature[6] == 6, + "incorrect value for signature[6], expected 6, is %d", + check_msg->signature[6]); + ck_assert_msg(check_msg->signature[7] == 7, + "incorrect value for signature[7], expected 7, is %d", + check_msg->signature[7]); + ck_assert_msg(check_msg->signature[8] == 8, + "incorrect value for signature[8], expected 8, is %d", + check_msg->signature[8]); + ck_assert_msg(check_msg->signature[9] == 9, + "incorrect value for signature[9], expected 9, is %d", + check_msg->signature[9]); + ck_assert_msg(check_msg->signature[10] == 10, + "incorrect value for signature[10], expected 10, is %d", + check_msg->signature[10]); + ck_assert_msg(check_msg->signature[11] == 11, + "incorrect value for signature[11], expected 11, is %d", + check_msg->signature[11]); + ck_assert_msg(check_msg->signature[12] == 12, + "incorrect value for signature[12], expected 12, is %d", + check_msg->signature[12]); + ck_assert_msg(check_msg->signature[13] == 13, + "incorrect value for signature[13], expected 13, is %d", + check_msg->signature[13]); + ck_assert_msg(check_msg->signature[14] == 14, + "incorrect value for signature[14], expected 14, is %d", + check_msg->signature[14]); + ck_assert_msg(check_msg->signature[15] == 15, + "incorrect value for signature[15], expected 15, is %d", + check_msg->signature[15]); + ck_assert_msg(check_msg->signature[16] == 16, + "incorrect value for signature[16], expected 16, is %d", + check_msg->signature[16]); + ck_assert_msg(check_msg->signature[17] == 17, + "incorrect value for signature[17], expected 17, is %d", + check_msg->signature[17]); + ck_assert_msg(check_msg->signature[18] == 18, + "incorrect value for signature[18], expected 18, is %d", + check_msg->signature[18]); + ck_assert_msg(check_msg->signature[19] == 19, + "incorrect value for signature[19], expected 19, is %d", + check_msg->signature[19]); + ck_assert_msg(check_msg->signature[20] == 20, + "incorrect value for signature[20], expected 20, is %d", + check_msg->signature[20]); + ck_assert_msg(check_msg->signature[21] == 21, + "incorrect value for signature[21], expected 21, is %d", + check_msg->signature[21]); + ck_assert_msg(check_msg->signature[22] == 22, + "incorrect value for signature[22], expected 22, is %d", + check_msg->signature[22]); + ck_assert_msg(check_msg->signature[23] == 23, + "incorrect value for signature[23], expected 23, is %d", + check_msg->signature[23]); + ck_assert_msg(check_msg->signature[24] == 24, + "incorrect value for signature[24], expected 24, is %d", + check_msg->signature[24]); + ck_assert_msg(check_msg->signature[25] == 25, + "incorrect value for signature[25], expected 25, is %d", + check_msg->signature[25]); + ck_assert_msg(check_msg->signature[26] == 26, + "incorrect value for signature[26], expected 26, is %d", + check_msg->signature[26]); + ck_assert_msg(check_msg->signature[27] == 27, + "incorrect value for signature[27], expected 27, is %d", + check_msg->signature[27]); + ck_assert_msg(check_msg->signature[28] == 28, + "incorrect value for signature[28], expected 28, is %d", + check_msg->signature[28]); + ck_assert_msg(check_msg->signature[29] == 29, + "incorrect value for signature[29], expected 29, is %d", + check_msg->signature[29]); + ck_assert_msg(check_msg->signature[30] == 30, + "incorrect value for signature[30], expected 30, is %d", + check_msg->signature[30]); + ck_assert_msg(check_msg->signature[31] == 31, + "incorrect value for signature[31], expected 31, is %d", + check_msg->signature[31]); + ck_assert_msg(check_msg->signature[32] == 32, + "incorrect value for signature[32], expected 32, is %d", + check_msg->signature[32]); + ck_assert_msg(check_msg->signature[33] == 33, + "incorrect value for signature[33], expected 33, is %d", + check_msg->signature[33]); + ck_assert_msg(check_msg->signature[34] == 34, + "incorrect value for signature[34], expected 34, is %d", + check_msg->signature[34]); + ck_assert_msg(check_msg->signature[35] == 35, + "incorrect value for signature[35], expected 35, is %d", + check_msg->signature[35]); + ck_assert_msg(check_msg->signature[36] == 36, + "incorrect value for signature[36], expected 36, is %d", + check_msg->signature[36]); + ck_assert_msg(check_msg->signature[37] == 37, + "incorrect value for signature[37], expected 37, is %d", + check_msg->signature[37]); + ck_assert_msg(check_msg->signature[38] == 38, + "incorrect value for signature[38], expected 38, is %d", + check_msg->signature[38]); + ck_assert_msg(check_msg->signature[39] == 39, + "incorrect value for signature[39], expected 39, is %d", + check_msg->signature[39]); + ck_assert_msg(check_msg->signature[40] == 40, + "incorrect value for signature[40], expected 40, is %d", + check_msg->signature[40]); + ck_assert_msg(check_msg->signature[41] == 41, + "incorrect value for signature[41], expected 41, is %d", + check_msg->signature[41]); + ck_assert_msg(check_msg->signature[42] == 42, + "incorrect value for signature[42], expected 42, is %d", + check_msg->signature[42]); + ck_assert_msg(check_msg->signature[43] == 43, + "incorrect value for signature[43], expected 43, is %d", + check_msg->signature[43]); + ck_assert_msg(check_msg->signature[44] == 44, + "incorrect value for signature[44], expected 44, is %d", + check_msg->signature[44]); + ck_assert_msg(check_msg->signature[45] == 45, + "incorrect value for signature[45], expected 45, is %d", + check_msg->signature[45]); + ck_assert_msg(check_msg->signature[46] == 46, + "incorrect value for signature[46], expected 46, is %d", + check_msg->signature[46]); + ck_assert_msg(check_msg->signature[47] == 47, + "incorrect value for signature[47], expected 47, is %d", + check_msg->signature[47]); + ck_assert_msg(check_msg->signature[48] == 48, + "incorrect value for signature[48], expected 48, is %d", + check_msg->signature[48]); + ck_assert_msg(check_msg->signature[49] == 49, + "incorrect value for signature[49], expected 49, is %d", + check_msg->signature[49]); + ck_assert_msg(check_msg->signature[50] == 50, + "incorrect value for signature[50], expected 50, is %d", + check_msg->signature[50]); + ck_assert_msg(check_msg->signature[51] == 51, + "incorrect value for signature[51], expected 51, is %d", + check_msg->signature[51]); + ck_assert_msg(check_msg->signature[52] == 52, + "incorrect value for signature[52], expected 52, is %d", + check_msg->signature[52]); + ck_assert_msg(check_msg->signature[53] == 53, + "incorrect value for signature[53], expected 53, is %d", + check_msg->signature[53]); + ck_assert_msg(check_msg->signature[54] == 54, + "incorrect value for signature[54], expected 54, is %d", + check_msg->signature[54]); + ck_assert_msg(check_msg->signature[55] == 55, + "incorrect value for signature[55], expected 55, is %d", + check_msg->signature[55]); + ck_assert_msg(check_msg->signature[56] == 56, + "incorrect value for signature[56], expected 56, is %d", + check_msg->signature[56]); + ck_assert_msg(check_msg->signature[57] == 57, + "incorrect value for signature[57], expected 57, is %d", + check_msg->signature[57]); + ck_assert_msg(check_msg->signature[58] == 58, + "incorrect value for signature[58], expected 58, is %d", + check_msg->signature[58]); + ck_assert_msg(check_msg->signature[59] == 59, + "incorrect value for signature[59], expected 59, is %d", + check_msg->signature[59]); + ck_assert_msg(check_msg->signature[60] == 60, + "incorrect value for signature[60], expected 60, is %d", + check_msg->signature[60]); + ck_assert_msg(check_msg->signature[61] == 61, + "incorrect value for signature[61], expected 61, is %d", + check_msg->signature[61]); + ck_assert_msg(check_msg->signature[62] == 62, + "incorrect value for signature[62], expected 62, is %d", + check_msg->signature[62]); + ck_assert_msg(check_msg->signature[63] == 63, + "incorrect value for signature[63], expected 63, is %d", + check_msg->signature[63]); + ck_assert_msg( + check_msg->signed_messages[0] == 5000, + "incorrect value for signed_messages[0], expected 5000, is %d", + check_msg->signed_messages[0]); + ck_assert_msg( + check_msg->signed_messages[1] == 5234, + "incorrect value for signed_messages[1], expected 5234, is %d", + check_msg->signed_messages[1]); + ck_assert_msg( + check_msg->signed_messages[2] == 5468, + "incorrect value for signed_messages[2], expected 5468, is %d", + check_msg->signed_messages[2]); + ck_assert_msg( + check_msg->signed_messages[3] == 5702, + "incorrect value for signed_messages[3], expected 5702, is %d", + check_msg->signed_messages[3]); + ck_assert_msg( + check_msg->signed_messages[4] == 5936, + "incorrect value for signed_messages[4], expected 5936, is %d", + check_msg->signed_messages[4]); + ck_assert_msg( + check_msg->signed_messages[5] == 6170, + "incorrect value for signed_messages[5], expected 6170, is %d", + check_msg->signed_messages[5]); + ck_assert_msg( + check_msg->signed_messages[6] == 6404, + "incorrect value for signed_messages[6], expected 6404, is %d", + check_msg->signed_messages[6]); + ck_assert_msg( + check_msg->signed_messages[7] == 6638, + "incorrect value for signed_messages[7], expected 6638, is %d", + check_msg->signed_messages[7]); + ck_assert_msg( + check_msg->signed_messages[8] == 6872, + "incorrect value for signed_messages[8], expected 6872, is %d", + check_msg->signed_messages[8]); + ck_assert_msg( + check_msg->signed_messages[9] == 7106, + "incorrect value for signed_messages[9], expected 7106, is %d", + check_msg->signed_messages[9]); + ck_assert_msg( + check_msg->signed_messages[10] == 7340, + "incorrect value for signed_messages[10], expected 7340, is %d", + check_msg->signed_messages[10]); + ck_assert_msg( + check_msg->signed_messages[11] == 7574, + "incorrect value for signed_messages[11], expected 7574, is %d", + check_msg->signed_messages[11]); + ck_assert_msg( + check_msg->signed_messages[12] == 7808, + "incorrect value for signed_messages[12], expected 7808, is %d", + check_msg->signed_messages[12]); + ck_assert_msg( + check_msg->signed_messages[13] == 8042, + "incorrect value for signed_messages[13], expected 8042, is %d", + check_msg->signed_messages[13]); + ck_assert_msg( + check_msg->signed_messages[14] == 8276, + "incorrect value for signed_messages[14], expected 8276, is %d", + check_msg->signed_messages[14]); + ck_assert_msg( + check_msg->signed_messages[15] == 8510, + "incorrect value for signed_messages[15], expected 8510, is %d", + check_msg->signed_messages[15]); + ck_assert_msg( + check_msg->signed_messages[16] == 8744, + "incorrect value for signed_messages[16], expected 8744, is %d", + check_msg->signed_messages[16]); + ck_assert_msg( + check_msg->signed_messages[17] == 8978, + "incorrect value for signed_messages[17], expected 8978, is %d", + check_msg->signed_messages[17]); + ck_assert_msg( + check_msg->signed_messages[18] == 9212, + "incorrect value for signed_messages[18], expected 9212, is %d", + check_msg->signed_messages[18]); + ck_assert_msg( + check_msg->signed_messages[19] == 9446, + "incorrect value for signed_messages[19], expected 9446, is %d", + check_msg->signed_messages[19]); + ck_assert_msg( + check_msg->signed_messages[20] == 9680, + "incorrect value for signed_messages[20], expected 9680, is %d", + check_msg->signed_messages[20]); + ck_assert_msg( + check_msg->signed_messages[21] == 9914, + "incorrect value for signed_messages[21], expected 9914, is %d", + check_msg->signed_messages[21]); + ck_assert_msg( + check_msg->signed_messages[22] == 10148, + "incorrect value for signed_messages[22], expected 10148, is %d", + check_msg->signed_messages[22]); + ck_assert_msg( + check_msg->signed_messages[23] == 10382, + "incorrect value for signed_messages[23], expected 10382, is %d", + check_msg->signed_messages[23]); + ck_assert_msg( + check_msg->signed_messages[24] == 10616, + "incorrect value for signed_messages[24], expected 10616, is %d", + check_msg->signed_messages[24]); } } END_TEST -Suite* legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA); +Suite *legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_signing_MsgEd25519SignatureDepB.c b/c/test/legacy/auto_check_sbp_signing_MsgEd25519SignatureDepB.c index 46e498cf4..596b8f0ef 100644 --- a/c/test/legacy/auto_check_sbp_signing_MsgEd25519SignatureDepB.c +++ b/c/test/legacy/auto_check_sbp_signing_MsgEd25519SignatureDepB.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB ) -{ +START_TEST(test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,35 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xC03, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xC03, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xC03, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xC03, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,12,66,0,186,1,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,136,19,0,0,114,20,0,0,92,21,0,0,70,22,0,0,48,23,0,0,26,24,0,0,4,25,0,0,238,25,0,0,216,26,0,0,194,27,0,0,172,28,0,0,150,29,0,0,128,30,0,0,106,31,0,0,84,32,0,0,62,33,0,0,40,34,0,0,18,35,0,0,252,35,0,0,230,36,0,0,208,37,0,0,186,38,0,0,164,39,0,0,142,40,0,0,120,41,0,0,238,145, }; + u8 encoded_frame[] = { + 85, 3, 12, 66, 0, 186, 1, 0, 0, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 136, 19, 0, 0, 114, 20, + 0, 0, 92, 21, 0, 0, 70, 22, 0, 0, 48, 23, 0, 0, + 26, 24, 0, 0, 4, 25, 0, 0, 238, 25, 0, 0, 216, 26, + 0, 0, 194, 27, 0, 0, 172, 28, 0, 0, 150, 29, 0, 0, + 128, 30, 0, 0, 106, 31, 0, 0, 84, 32, 0, 0, 62, 33, + 0, 0, 40, 34, 0, 0, 18, 35, 0, 0, 252, 35, 0, 0, + 230, 36, 0, 0, 208, 37, 0, 0, 186, 38, 0, 0, 164, 39, + 0, 0, 142, 40, 0, 0, 120, 41, 0, 0, 238, 145, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ed25519_signature_dep_b_t* test_msg = ( msg_ed25519_signature_dep_b_t* )test_msg_storage; + msg_ed25519_signature_dep_b_t *test_msg = + (msg_ed25519_signature_dep_b_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->fingerprint) == 0) { // Cope with variable length arrays @@ -690,174 +705,431 @@ START_TEST( test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB ) } test_msg->signed_messages[24] = 10616; test_msg->stream_counter = 1; - sbp_payload_send(&sbp_state, 0xC03, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xC03, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xC03, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ed25519_signature_dep_b_t* check_msg = ( msg_ed25519_signature_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ed25519_signature_dep_b_t *check_msg = + (msg_ed25519_signature_dep_b_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->fingerprint[0] == 100, "incorrect value for fingerprint[0], expected 100, is %d", check_msg->fingerprint[0]); - ck_assert_msg(check_msg->fingerprint[1] == 101, "incorrect value for fingerprint[1], expected 101, is %d", check_msg->fingerprint[1]); - ck_assert_msg(check_msg->fingerprint[2] == 102, "incorrect value for fingerprint[2], expected 102, is %d", check_msg->fingerprint[2]); - ck_assert_msg(check_msg->fingerprint[3] == 103, "incorrect value for fingerprint[3], expected 103, is %d", check_msg->fingerprint[3]); - ck_assert_msg(check_msg->fingerprint[4] == 104, "incorrect value for fingerprint[4], expected 104, is %d", check_msg->fingerprint[4]); - ck_assert_msg(check_msg->fingerprint[5] == 105, "incorrect value for fingerprint[5], expected 105, is %d", check_msg->fingerprint[5]); - ck_assert_msg(check_msg->fingerprint[6] == 106, "incorrect value for fingerprint[6], expected 106, is %d", check_msg->fingerprint[6]); - ck_assert_msg(check_msg->fingerprint[7] == 107, "incorrect value for fingerprint[7], expected 107, is %d", check_msg->fingerprint[7]); - ck_assert_msg(check_msg->fingerprint[8] == 108, "incorrect value for fingerprint[8], expected 108, is %d", check_msg->fingerprint[8]); - ck_assert_msg(check_msg->fingerprint[9] == 109, "incorrect value for fingerprint[9], expected 109, is %d", check_msg->fingerprint[9]); - ck_assert_msg(check_msg->fingerprint[10] == 110, "incorrect value for fingerprint[10], expected 110, is %d", check_msg->fingerprint[10]); - ck_assert_msg(check_msg->fingerprint[11] == 111, "incorrect value for fingerprint[11], expected 111, is %d", check_msg->fingerprint[11]); - ck_assert_msg(check_msg->fingerprint[12] == 112, "incorrect value for fingerprint[12], expected 112, is %d", check_msg->fingerprint[12]); - ck_assert_msg(check_msg->fingerprint[13] == 113, "incorrect value for fingerprint[13], expected 113, is %d", check_msg->fingerprint[13]); - ck_assert_msg(check_msg->fingerprint[14] == 114, "incorrect value for fingerprint[14], expected 114, is %d", check_msg->fingerprint[14]); - ck_assert_msg(check_msg->fingerprint[15] == 115, "incorrect value for fingerprint[15], expected 115, is %d", check_msg->fingerprint[15]); - ck_assert_msg(check_msg->fingerprint[16] == 116, "incorrect value for fingerprint[16], expected 116, is %d", check_msg->fingerprint[16]); - ck_assert_msg(check_msg->fingerprint[17] == 117, "incorrect value for fingerprint[17], expected 117, is %d", check_msg->fingerprint[17]); - ck_assert_msg(check_msg->fingerprint[18] == 118, "incorrect value for fingerprint[18], expected 118, is %d", check_msg->fingerprint[18]); - ck_assert_msg(check_msg->fingerprint[19] == 119, "incorrect value for fingerprint[19], expected 119, is %d", check_msg->fingerprint[19]); - ck_assert_msg(check_msg->on_demand_counter == 0, "incorrect value for on_demand_counter, expected 0, is %d", check_msg->on_demand_counter); - ck_assert_msg(check_msg->signature[0] == 0, "incorrect value for signature[0], expected 0, is %d", check_msg->signature[0]); - ck_assert_msg(check_msg->signature[1] == 1, "incorrect value for signature[1], expected 1, is %d", check_msg->signature[1]); - ck_assert_msg(check_msg->signature[2] == 2, "incorrect value for signature[2], expected 2, is %d", check_msg->signature[2]); - ck_assert_msg(check_msg->signature[3] == 3, "incorrect value for signature[3], expected 3, is %d", check_msg->signature[3]); - ck_assert_msg(check_msg->signature[4] == 4, "incorrect value for signature[4], expected 4, is %d", check_msg->signature[4]); - ck_assert_msg(check_msg->signature[5] == 5, "incorrect value for signature[5], expected 5, is %d", check_msg->signature[5]); - ck_assert_msg(check_msg->signature[6] == 6, "incorrect value for signature[6], expected 6, is %d", check_msg->signature[6]); - ck_assert_msg(check_msg->signature[7] == 7, "incorrect value for signature[7], expected 7, is %d", check_msg->signature[7]); - ck_assert_msg(check_msg->signature[8] == 8, "incorrect value for signature[8], expected 8, is %d", check_msg->signature[8]); - ck_assert_msg(check_msg->signature[9] == 9, "incorrect value for signature[9], expected 9, is %d", check_msg->signature[9]); - ck_assert_msg(check_msg->signature[10] == 10, "incorrect value for signature[10], expected 10, is %d", check_msg->signature[10]); - ck_assert_msg(check_msg->signature[11] == 11, "incorrect value for signature[11], expected 11, is %d", check_msg->signature[11]); - ck_assert_msg(check_msg->signature[12] == 12, "incorrect value for signature[12], expected 12, is %d", check_msg->signature[12]); - ck_assert_msg(check_msg->signature[13] == 13, "incorrect value for signature[13], expected 13, is %d", check_msg->signature[13]); - ck_assert_msg(check_msg->signature[14] == 14, "incorrect value for signature[14], expected 14, is %d", check_msg->signature[14]); - ck_assert_msg(check_msg->signature[15] == 15, "incorrect value for signature[15], expected 15, is %d", check_msg->signature[15]); - ck_assert_msg(check_msg->signature[16] == 16, "incorrect value for signature[16], expected 16, is %d", check_msg->signature[16]); - ck_assert_msg(check_msg->signature[17] == 17, "incorrect value for signature[17], expected 17, is %d", check_msg->signature[17]); - ck_assert_msg(check_msg->signature[18] == 18, "incorrect value for signature[18], expected 18, is %d", check_msg->signature[18]); - ck_assert_msg(check_msg->signature[19] == 19, "incorrect value for signature[19], expected 19, is %d", check_msg->signature[19]); - ck_assert_msg(check_msg->signature[20] == 20, "incorrect value for signature[20], expected 20, is %d", check_msg->signature[20]); - ck_assert_msg(check_msg->signature[21] == 21, "incorrect value for signature[21], expected 21, is %d", check_msg->signature[21]); - ck_assert_msg(check_msg->signature[22] == 22, "incorrect value for signature[22], expected 22, is %d", check_msg->signature[22]); - ck_assert_msg(check_msg->signature[23] == 23, "incorrect value for signature[23], expected 23, is %d", check_msg->signature[23]); - ck_assert_msg(check_msg->signature[24] == 24, "incorrect value for signature[24], expected 24, is %d", check_msg->signature[24]); - ck_assert_msg(check_msg->signature[25] == 25, "incorrect value for signature[25], expected 25, is %d", check_msg->signature[25]); - ck_assert_msg(check_msg->signature[26] == 26, "incorrect value for signature[26], expected 26, is %d", check_msg->signature[26]); - ck_assert_msg(check_msg->signature[27] == 27, "incorrect value for signature[27], expected 27, is %d", check_msg->signature[27]); - ck_assert_msg(check_msg->signature[28] == 28, "incorrect value for signature[28], expected 28, is %d", check_msg->signature[28]); - ck_assert_msg(check_msg->signature[29] == 29, "incorrect value for signature[29], expected 29, is %d", check_msg->signature[29]); - ck_assert_msg(check_msg->signature[30] == 30, "incorrect value for signature[30], expected 30, is %d", check_msg->signature[30]); - ck_assert_msg(check_msg->signature[31] == 31, "incorrect value for signature[31], expected 31, is %d", check_msg->signature[31]); - ck_assert_msg(check_msg->signature[32] == 32, "incorrect value for signature[32], expected 32, is %d", check_msg->signature[32]); - ck_assert_msg(check_msg->signature[33] == 33, "incorrect value for signature[33], expected 33, is %d", check_msg->signature[33]); - ck_assert_msg(check_msg->signature[34] == 34, "incorrect value for signature[34], expected 34, is %d", check_msg->signature[34]); - ck_assert_msg(check_msg->signature[35] == 35, "incorrect value for signature[35], expected 35, is %d", check_msg->signature[35]); - ck_assert_msg(check_msg->signature[36] == 36, "incorrect value for signature[36], expected 36, is %d", check_msg->signature[36]); - ck_assert_msg(check_msg->signature[37] == 37, "incorrect value for signature[37], expected 37, is %d", check_msg->signature[37]); - ck_assert_msg(check_msg->signature[38] == 38, "incorrect value for signature[38], expected 38, is %d", check_msg->signature[38]); - ck_assert_msg(check_msg->signature[39] == 39, "incorrect value for signature[39], expected 39, is %d", check_msg->signature[39]); - ck_assert_msg(check_msg->signature[40] == 40, "incorrect value for signature[40], expected 40, is %d", check_msg->signature[40]); - ck_assert_msg(check_msg->signature[41] == 41, "incorrect value for signature[41], expected 41, is %d", check_msg->signature[41]); - ck_assert_msg(check_msg->signature[42] == 42, "incorrect value for signature[42], expected 42, is %d", check_msg->signature[42]); - ck_assert_msg(check_msg->signature[43] == 43, "incorrect value for signature[43], expected 43, is %d", check_msg->signature[43]); - ck_assert_msg(check_msg->signature[44] == 44, "incorrect value for signature[44], expected 44, is %d", check_msg->signature[44]); - ck_assert_msg(check_msg->signature[45] == 45, "incorrect value for signature[45], expected 45, is %d", check_msg->signature[45]); - ck_assert_msg(check_msg->signature[46] == 46, "incorrect value for signature[46], expected 46, is %d", check_msg->signature[46]); - ck_assert_msg(check_msg->signature[47] == 47, "incorrect value for signature[47], expected 47, is %d", check_msg->signature[47]); - ck_assert_msg(check_msg->signature[48] == 48, "incorrect value for signature[48], expected 48, is %d", check_msg->signature[48]); - ck_assert_msg(check_msg->signature[49] == 49, "incorrect value for signature[49], expected 49, is %d", check_msg->signature[49]); - ck_assert_msg(check_msg->signature[50] == 50, "incorrect value for signature[50], expected 50, is %d", check_msg->signature[50]); - ck_assert_msg(check_msg->signature[51] == 51, "incorrect value for signature[51], expected 51, is %d", check_msg->signature[51]); - ck_assert_msg(check_msg->signature[52] == 52, "incorrect value for signature[52], expected 52, is %d", check_msg->signature[52]); - ck_assert_msg(check_msg->signature[53] == 53, "incorrect value for signature[53], expected 53, is %d", check_msg->signature[53]); - ck_assert_msg(check_msg->signature[54] == 54, "incorrect value for signature[54], expected 54, is %d", check_msg->signature[54]); - ck_assert_msg(check_msg->signature[55] == 55, "incorrect value for signature[55], expected 55, is %d", check_msg->signature[55]); - ck_assert_msg(check_msg->signature[56] == 56, "incorrect value for signature[56], expected 56, is %d", check_msg->signature[56]); - ck_assert_msg(check_msg->signature[57] == 57, "incorrect value for signature[57], expected 57, is %d", check_msg->signature[57]); - ck_assert_msg(check_msg->signature[58] == 58, "incorrect value for signature[58], expected 58, is %d", check_msg->signature[58]); - ck_assert_msg(check_msg->signature[59] == 59, "incorrect value for signature[59], expected 59, is %d", check_msg->signature[59]); - ck_assert_msg(check_msg->signature[60] == 60, "incorrect value for signature[60], expected 60, is %d", check_msg->signature[60]); - ck_assert_msg(check_msg->signature[61] == 61, "incorrect value for signature[61], expected 61, is %d", check_msg->signature[61]); - ck_assert_msg(check_msg->signature[62] == 62, "incorrect value for signature[62], expected 62, is %d", check_msg->signature[62]); - ck_assert_msg(check_msg->signature[63] == 63, "incorrect value for signature[63], expected 63, is %d", check_msg->signature[63]); - ck_assert_msg(check_msg->signed_messages[0] == 5000, "incorrect value for signed_messages[0], expected 5000, is %d", check_msg->signed_messages[0]); - ck_assert_msg(check_msg->signed_messages[1] == 5234, "incorrect value for signed_messages[1], expected 5234, is %d", check_msg->signed_messages[1]); - ck_assert_msg(check_msg->signed_messages[2] == 5468, "incorrect value for signed_messages[2], expected 5468, is %d", check_msg->signed_messages[2]); - ck_assert_msg(check_msg->signed_messages[3] == 5702, "incorrect value for signed_messages[3], expected 5702, is %d", check_msg->signed_messages[3]); - ck_assert_msg(check_msg->signed_messages[4] == 5936, "incorrect value for signed_messages[4], expected 5936, is %d", check_msg->signed_messages[4]); - ck_assert_msg(check_msg->signed_messages[5] == 6170, "incorrect value for signed_messages[5], expected 6170, is %d", check_msg->signed_messages[5]); - ck_assert_msg(check_msg->signed_messages[6] == 6404, "incorrect value for signed_messages[6], expected 6404, is %d", check_msg->signed_messages[6]); - ck_assert_msg(check_msg->signed_messages[7] == 6638, "incorrect value for signed_messages[7], expected 6638, is %d", check_msg->signed_messages[7]); - ck_assert_msg(check_msg->signed_messages[8] == 6872, "incorrect value for signed_messages[8], expected 6872, is %d", check_msg->signed_messages[8]); - ck_assert_msg(check_msg->signed_messages[9] == 7106, "incorrect value for signed_messages[9], expected 7106, is %d", check_msg->signed_messages[9]); - ck_assert_msg(check_msg->signed_messages[10] == 7340, "incorrect value for signed_messages[10], expected 7340, is %d", check_msg->signed_messages[10]); - ck_assert_msg(check_msg->signed_messages[11] == 7574, "incorrect value for signed_messages[11], expected 7574, is %d", check_msg->signed_messages[11]); - ck_assert_msg(check_msg->signed_messages[12] == 7808, "incorrect value for signed_messages[12], expected 7808, is %d", check_msg->signed_messages[12]); - ck_assert_msg(check_msg->signed_messages[13] == 8042, "incorrect value for signed_messages[13], expected 8042, is %d", check_msg->signed_messages[13]); - ck_assert_msg(check_msg->signed_messages[14] == 8276, "incorrect value for signed_messages[14], expected 8276, is %d", check_msg->signed_messages[14]); - ck_assert_msg(check_msg->signed_messages[15] == 8510, "incorrect value for signed_messages[15], expected 8510, is %d", check_msg->signed_messages[15]); - ck_assert_msg(check_msg->signed_messages[16] == 8744, "incorrect value for signed_messages[16], expected 8744, is %d", check_msg->signed_messages[16]); - ck_assert_msg(check_msg->signed_messages[17] == 8978, "incorrect value for signed_messages[17], expected 8978, is %d", check_msg->signed_messages[17]); - ck_assert_msg(check_msg->signed_messages[18] == 9212, "incorrect value for signed_messages[18], expected 9212, is %d", check_msg->signed_messages[18]); - ck_assert_msg(check_msg->signed_messages[19] == 9446, "incorrect value for signed_messages[19], expected 9446, is %d", check_msg->signed_messages[19]); - ck_assert_msg(check_msg->signed_messages[20] == 9680, "incorrect value for signed_messages[20], expected 9680, is %d", check_msg->signed_messages[20]); - ck_assert_msg(check_msg->signed_messages[21] == 9914, "incorrect value for signed_messages[21], expected 9914, is %d", check_msg->signed_messages[21]); - ck_assert_msg(check_msg->signed_messages[22] == 10148, "incorrect value for signed_messages[22], expected 10148, is %d", check_msg->signed_messages[22]); - ck_assert_msg(check_msg->signed_messages[23] == 10382, "incorrect value for signed_messages[23], expected 10382, is %d", check_msg->signed_messages[23]); - ck_assert_msg(check_msg->signed_messages[24] == 10616, "incorrect value for signed_messages[24], expected 10616, is %d", check_msg->signed_messages[24]); - ck_assert_msg(check_msg->stream_counter == 1, "incorrect value for stream_counter, expected 1, is %d", check_msg->stream_counter); + ck_assert_msg(check_msg->fingerprint[0] == 100, + "incorrect value for fingerprint[0], expected 100, is %d", + check_msg->fingerprint[0]); + ck_assert_msg(check_msg->fingerprint[1] == 101, + "incorrect value for fingerprint[1], expected 101, is %d", + check_msg->fingerprint[1]); + ck_assert_msg(check_msg->fingerprint[2] == 102, + "incorrect value for fingerprint[2], expected 102, is %d", + check_msg->fingerprint[2]); + ck_assert_msg(check_msg->fingerprint[3] == 103, + "incorrect value for fingerprint[3], expected 103, is %d", + check_msg->fingerprint[3]); + ck_assert_msg(check_msg->fingerprint[4] == 104, + "incorrect value for fingerprint[4], expected 104, is %d", + check_msg->fingerprint[4]); + ck_assert_msg(check_msg->fingerprint[5] == 105, + "incorrect value for fingerprint[5], expected 105, is %d", + check_msg->fingerprint[5]); + ck_assert_msg(check_msg->fingerprint[6] == 106, + "incorrect value for fingerprint[6], expected 106, is %d", + check_msg->fingerprint[6]); + ck_assert_msg(check_msg->fingerprint[7] == 107, + "incorrect value for fingerprint[7], expected 107, is %d", + check_msg->fingerprint[7]); + ck_assert_msg(check_msg->fingerprint[8] == 108, + "incorrect value for fingerprint[8], expected 108, is %d", + check_msg->fingerprint[8]); + ck_assert_msg(check_msg->fingerprint[9] == 109, + "incorrect value for fingerprint[9], expected 109, is %d", + check_msg->fingerprint[9]); + ck_assert_msg(check_msg->fingerprint[10] == 110, + "incorrect value for fingerprint[10], expected 110, is %d", + check_msg->fingerprint[10]); + ck_assert_msg(check_msg->fingerprint[11] == 111, + "incorrect value for fingerprint[11], expected 111, is %d", + check_msg->fingerprint[11]); + ck_assert_msg(check_msg->fingerprint[12] == 112, + "incorrect value for fingerprint[12], expected 112, is %d", + check_msg->fingerprint[12]); + ck_assert_msg(check_msg->fingerprint[13] == 113, + "incorrect value for fingerprint[13], expected 113, is %d", + check_msg->fingerprint[13]); + ck_assert_msg(check_msg->fingerprint[14] == 114, + "incorrect value for fingerprint[14], expected 114, is %d", + check_msg->fingerprint[14]); + ck_assert_msg(check_msg->fingerprint[15] == 115, + "incorrect value for fingerprint[15], expected 115, is %d", + check_msg->fingerprint[15]); + ck_assert_msg(check_msg->fingerprint[16] == 116, + "incorrect value for fingerprint[16], expected 116, is %d", + check_msg->fingerprint[16]); + ck_assert_msg(check_msg->fingerprint[17] == 117, + "incorrect value for fingerprint[17], expected 117, is %d", + check_msg->fingerprint[17]); + ck_assert_msg(check_msg->fingerprint[18] == 118, + "incorrect value for fingerprint[18], expected 118, is %d", + check_msg->fingerprint[18]); + ck_assert_msg(check_msg->fingerprint[19] == 119, + "incorrect value for fingerprint[19], expected 119, is %d", + check_msg->fingerprint[19]); + ck_assert_msg(check_msg->on_demand_counter == 0, + "incorrect value for on_demand_counter, expected 0, is %d", + check_msg->on_demand_counter); + ck_assert_msg(check_msg->signature[0] == 0, + "incorrect value for signature[0], expected 0, is %d", + check_msg->signature[0]); + ck_assert_msg(check_msg->signature[1] == 1, + "incorrect value for signature[1], expected 1, is %d", + check_msg->signature[1]); + ck_assert_msg(check_msg->signature[2] == 2, + "incorrect value for signature[2], expected 2, is %d", + check_msg->signature[2]); + ck_assert_msg(check_msg->signature[3] == 3, + "incorrect value for signature[3], expected 3, is %d", + check_msg->signature[3]); + ck_assert_msg(check_msg->signature[4] == 4, + "incorrect value for signature[4], expected 4, is %d", + check_msg->signature[4]); + ck_assert_msg(check_msg->signature[5] == 5, + "incorrect value for signature[5], expected 5, is %d", + check_msg->signature[5]); + ck_assert_msg(check_msg->signature[6] == 6, + "incorrect value for signature[6], expected 6, is %d", + check_msg->signature[6]); + ck_assert_msg(check_msg->signature[7] == 7, + "incorrect value for signature[7], expected 7, is %d", + check_msg->signature[7]); + ck_assert_msg(check_msg->signature[8] == 8, + "incorrect value for signature[8], expected 8, is %d", + check_msg->signature[8]); + ck_assert_msg(check_msg->signature[9] == 9, + "incorrect value for signature[9], expected 9, is %d", + check_msg->signature[9]); + ck_assert_msg(check_msg->signature[10] == 10, + "incorrect value for signature[10], expected 10, is %d", + check_msg->signature[10]); + ck_assert_msg(check_msg->signature[11] == 11, + "incorrect value for signature[11], expected 11, is %d", + check_msg->signature[11]); + ck_assert_msg(check_msg->signature[12] == 12, + "incorrect value for signature[12], expected 12, is %d", + check_msg->signature[12]); + ck_assert_msg(check_msg->signature[13] == 13, + "incorrect value for signature[13], expected 13, is %d", + check_msg->signature[13]); + ck_assert_msg(check_msg->signature[14] == 14, + "incorrect value for signature[14], expected 14, is %d", + check_msg->signature[14]); + ck_assert_msg(check_msg->signature[15] == 15, + "incorrect value for signature[15], expected 15, is %d", + check_msg->signature[15]); + ck_assert_msg(check_msg->signature[16] == 16, + "incorrect value for signature[16], expected 16, is %d", + check_msg->signature[16]); + ck_assert_msg(check_msg->signature[17] == 17, + "incorrect value for signature[17], expected 17, is %d", + check_msg->signature[17]); + ck_assert_msg(check_msg->signature[18] == 18, + "incorrect value for signature[18], expected 18, is %d", + check_msg->signature[18]); + ck_assert_msg(check_msg->signature[19] == 19, + "incorrect value for signature[19], expected 19, is %d", + check_msg->signature[19]); + ck_assert_msg(check_msg->signature[20] == 20, + "incorrect value for signature[20], expected 20, is %d", + check_msg->signature[20]); + ck_assert_msg(check_msg->signature[21] == 21, + "incorrect value for signature[21], expected 21, is %d", + check_msg->signature[21]); + ck_assert_msg(check_msg->signature[22] == 22, + "incorrect value for signature[22], expected 22, is %d", + check_msg->signature[22]); + ck_assert_msg(check_msg->signature[23] == 23, + "incorrect value for signature[23], expected 23, is %d", + check_msg->signature[23]); + ck_assert_msg(check_msg->signature[24] == 24, + "incorrect value for signature[24], expected 24, is %d", + check_msg->signature[24]); + ck_assert_msg(check_msg->signature[25] == 25, + "incorrect value for signature[25], expected 25, is %d", + check_msg->signature[25]); + ck_assert_msg(check_msg->signature[26] == 26, + "incorrect value for signature[26], expected 26, is %d", + check_msg->signature[26]); + ck_assert_msg(check_msg->signature[27] == 27, + "incorrect value for signature[27], expected 27, is %d", + check_msg->signature[27]); + ck_assert_msg(check_msg->signature[28] == 28, + "incorrect value for signature[28], expected 28, is %d", + check_msg->signature[28]); + ck_assert_msg(check_msg->signature[29] == 29, + "incorrect value for signature[29], expected 29, is %d", + check_msg->signature[29]); + ck_assert_msg(check_msg->signature[30] == 30, + "incorrect value for signature[30], expected 30, is %d", + check_msg->signature[30]); + ck_assert_msg(check_msg->signature[31] == 31, + "incorrect value for signature[31], expected 31, is %d", + check_msg->signature[31]); + ck_assert_msg(check_msg->signature[32] == 32, + "incorrect value for signature[32], expected 32, is %d", + check_msg->signature[32]); + ck_assert_msg(check_msg->signature[33] == 33, + "incorrect value for signature[33], expected 33, is %d", + check_msg->signature[33]); + ck_assert_msg(check_msg->signature[34] == 34, + "incorrect value for signature[34], expected 34, is %d", + check_msg->signature[34]); + ck_assert_msg(check_msg->signature[35] == 35, + "incorrect value for signature[35], expected 35, is %d", + check_msg->signature[35]); + ck_assert_msg(check_msg->signature[36] == 36, + "incorrect value for signature[36], expected 36, is %d", + check_msg->signature[36]); + ck_assert_msg(check_msg->signature[37] == 37, + "incorrect value for signature[37], expected 37, is %d", + check_msg->signature[37]); + ck_assert_msg(check_msg->signature[38] == 38, + "incorrect value for signature[38], expected 38, is %d", + check_msg->signature[38]); + ck_assert_msg(check_msg->signature[39] == 39, + "incorrect value for signature[39], expected 39, is %d", + check_msg->signature[39]); + ck_assert_msg(check_msg->signature[40] == 40, + "incorrect value for signature[40], expected 40, is %d", + check_msg->signature[40]); + ck_assert_msg(check_msg->signature[41] == 41, + "incorrect value for signature[41], expected 41, is %d", + check_msg->signature[41]); + ck_assert_msg(check_msg->signature[42] == 42, + "incorrect value for signature[42], expected 42, is %d", + check_msg->signature[42]); + ck_assert_msg(check_msg->signature[43] == 43, + "incorrect value for signature[43], expected 43, is %d", + check_msg->signature[43]); + ck_assert_msg(check_msg->signature[44] == 44, + "incorrect value for signature[44], expected 44, is %d", + check_msg->signature[44]); + ck_assert_msg(check_msg->signature[45] == 45, + "incorrect value for signature[45], expected 45, is %d", + check_msg->signature[45]); + ck_assert_msg(check_msg->signature[46] == 46, + "incorrect value for signature[46], expected 46, is %d", + check_msg->signature[46]); + ck_assert_msg(check_msg->signature[47] == 47, + "incorrect value for signature[47], expected 47, is %d", + check_msg->signature[47]); + ck_assert_msg(check_msg->signature[48] == 48, + "incorrect value for signature[48], expected 48, is %d", + check_msg->signature[48]); + ck_assert_msg(check_msg->signature[49] == 49, + "incorrect value for signature[49], expected 49, is %d", + check_msg->signature[49]); + ck_assert_msg(check_msg->signature[50] == 50, + "incorrect value for signature[50], expected 50, is %d", + check_msg->signature[50]); + ck_assert_msg(check_msg->signature[51] == 51, + "incorrect value for signature[51], expected 51, is %d", + check_msg->signature[51]); + ck_assert_msg(check_msg->signature[52] == 52, + "incorrect value for signature[52], expected 52, is %d", + check_msg->signature[52]); + ck_assert_msg(check_msg->signature[53] == 53, + "incorrect value for signature[53], expected 53, is %d", + check_msg->signature[53]); + ck_assert_msg(check_msg->signature[54] == 54, + "incorrect value for signature[54], expected 54, is %d", + check_msg->signature[54]); + ck_assert_msg(check_msg->signature[55] == 55, + "incorrect value for signature[55], expected 55, is %d", + check_msg->signature[55]); + ck_assert_msg(check_msg->signature[56] == 56, + "incorrect value for signature[56], expected 56, is %d", + check_msg->signature[56]); + ck_assert_msg(check_msg->signature[57] == 57, + "incorrect value for signature[57], expected 57, is %d", + check_msg->signature[57]); + ck_assert_msg(check_msg->signature[58] == 58, + "incorrect value for signature[58], expected 58, is %d", + check_msg->signature[58]); + ck_assert_msg(check_msg->signature[59] == 59, + "incorrect value for signature[59], expected 59, is %d", + check_msg->signature[59]); + ck_assert_msg(check_msg->signature[60] == 60, + "incorrect value for signature[60], expected 60, is %d", + check_msg->signature[60]); + ck_assert_msg(check_msg->signature[61] == 61, + "incorrect value for signature[61], expected 61, is %d", + check_msg->signature[61]); + ck_assert_msg(check_msg->signature[62] == 62, + "incorrect value for signature[62], expected 62, is %d", + check_msg->signature[62]); + ck_assert_msg(check_msg->signature[63] == 63, + "incorrect value for signature[63], expected 63, is %d", + check_msg->signature[63]); + ck_assert_msg( + check_msg->signed_messages[0] == 5000, + "incorrect value for signed_messages[0], expected 5000, is %d", + check_msg->signed_messages[0]); + ck_assert_msg( + check_msg->signed_messages[1] == 5234, + "incorrect value for signed_messages[1], expected 5234, is %d", + check_msg->signed_messages[1]); + ck_assert_msg( + check_msg->signed_messages[2] == 5468, + "incorrect value for signed_messages[2], expected 5468, is %d", + check_msg->signed_messages[2]); + ck_assert_msg( + check_msg->signed_messages[3] == 5702, + "incorrect value for signed_messages[3], expected 5702, is %d", + check_msg->signed_messages[3]); + ck_assert_msg( + check_msg->signed_messages[4] == 5936, + "incorrect value for signed_messages[4], expected 5936, is %d", + check_msg->signed_messages[4]); + ck_assert_msg( + check_msg->signed_messages[5] == 6170, + "incorrect value for signed_messages[5], expected 6170, is %d", + check_msg->signed_messages[5]); + ck_assert_msg( + check_msg->signed_messages[6] == 6404, + "incorrect value for signed_messages[6], expected 6404, is %d", + check_msg->signed_messages[6]); + ck_assert_msg( + check_msg->signed_messages[7] == 6638, + "incorrect value for signed_messages[7], expected 6638, is %d", + check_msg->signed_messages[7]); + ck_assert_msg( + check_msg->signed_messages[8] == 6872, + "incorrect value for signed_messages[8], expected 6872, is %d", + check_msg->signed_messages[8]); + ck_assert_msg( + check_msg->signed_messages[9] == 7106, + "incorrect value for signed_messages[9], expected 7106, is %d", + check_msg->signed_messages[9]); + ck_assert_msg( + check_msg->signed_messages[10] == 7340, + "incorrect value for signed_messages[10], expected 7340, is %d", + check_msg->signed_messages[10]); + ck_assert_msg( + check_msg->signed_messages[11] == 7574, + "incorrect value for signed_messages[11], expected 7574, is %d", + check_msg->signed_messages[11]); + ck_assert_msg( + check_msg->signed_messages[12] == 7808, + "incorrect value for signed_messages[12], expected 7808, is %d", + check_msg->signed_messages[12]); + ck_assert_msg( + check_msg->signed_messages[13] == 8042, + "incorrect value for signed_messages[13], expected 8042, is %d", + check_msg->signed_messages[13]); + ck_assert_msg( + check_msg->signed_messages[14] == 8276, + "incorrect value for signed_messages[14], expected 8276, is %d", + check_msg->signed_messages[14]); + ck_assert_msg( + check_msg->signed_messages[15] == 8510, + "incorrect value for signed_messages[15], expected 8510, is %d", + check_msg->signed_messages[15]); + ck_assert_msg( + check_msg->signed_messages[16] == 8744, + "incorrect value for signed_messages[16], expected 8744, is %d", + check_msg->signed_messages[16]); + ck_assert_msg( + check_msg->signed_messages[17] == 8978, + "incorrect value for signed_messages[17], expected 8978, is %d", + check_msg->signed_messages[17]); + ck_assert_msg( + check_msg->signed_messages[18] == 9212, + "incorrect value for signed_messages[18], expected 9212, is %d", + check_msg->signed_messages[18]); + ck_assert_msg( + check_msg->signed_messages[19] == 9446, + "incorrect value for signed_messages[19], expected 9446, is %d", + check_msg->signed_messages[19]); + ck_assert_msg( + check_msg->signed_messages[20] == 9680, + "incorrect value for signed_messages[20], expected 9680, is %d", + check_msg->signed_messages[20]); + ck_assert_msg( + check_msg->signed_messages[21] == 9914, + "incorrect value for signed_messages[21], expected 9914, is %d", + check_msg->signed_messages[21]); + ck_assert_msg( + check_msg->signed_messages[22] == 10148, + "incorrect value for signed_messages[22], expected 10148, is %d", + check_msg->signed_messages[22]); + ck_assert_msg( + check_msg->signed_messages[23] == 10382, + "incorrect value for signed_messages[23], expected 10382, is %d", + check_msg->signed_messages[23]); + ck_assert_msg( + check_msg->signed_messages[24] == 10616, + "incorrect value for signed_messages[24], expected 10616, is %d", + check_msg->signed_messages[24]); + ck_assert_msg(check_msg->stream_counter == 1, + "incorrect value for stream_counter, expected 1, is %d", + check_msg->stream_counter); } } END_TEST -Suite* legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB); +Suite *legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_solution_meta_MsgSolnMeta.c b/c/test/legacy/auto_check_sbp_solution_meta_MsgSolnMeta.c index d70f572d1..e4c252d8f 100644 --- a/c/test/legacy/auto_check_sbp_solution_meta_MsgSolnMeta.c +++ b/c/test/legacy/auto_check_sbp_solution_meta_MsgSolnMeta.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMeta.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMeta.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_solution_meta_MsgSolnMeta ) -{ +START_TEST(test_legacy_auto_check_sbp_solution_meta_MsgSolnMeta) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_solution_meta_MsgSolnMeta ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,39 @@ START_TEST( test_legacy_auto_check_sbp_solution_meta_MsgSolnMeta ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xff0e, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xff0e, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xff0e, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xff0e, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,14,255,0,60,254,48,208,65,216,122,45,196,160,144,228,8,83,89,87,3,213,95,109,86,131,71,70,84,73,131,26,82,247,140,97,115,110,118,253,2,122,186,148,122,148,180,231,68,46,190,102,243,48,192,15,208,89,56,10,245,2,254,201,120,32,126,2,83,161,238,123,102,230,76,190,225,182,207,228,7,218,117,89,29,191,56,248,185,255,46,18,72,142,82,113,26,4,172,254,178,136,113,115,58,193,89,227,182,246,76,77,108,245,41,31,70,124,249,145,15,78,228,38,241,129,8,176,251,72,248,80,115,244,231,145,191,190,178,168,89,233,69,176,174,140,182,141,81,82,92,79,101,223,100,64,184,215,124,37,21,227,135,102,72,36,219,56,146,90,219,104,227,102,83,12,41,122,173,94,1,174,134,130,104,237,116,249,107,230,130,123,25,162,57,223,193,174,146,193,239,44,246,197,214,80,83,100,66,72,133,137,140,82,2,2,96,9,96,158,134,97,43,129,141,25,183,200,214,57,248,103,222,65,195,15,244,21,180,46,140,130,36,17,194,209,65,254,115,103,152,129,234,235,194,234,170,201,210,154,150,247, }; + u8 encoded_frame[] = { + 85, 14, 255, 0, 60, 254, 48, 208, 65, 216, 122, 45, 196, 160, + 144, 228, 8, 83, 89, 87, 3, 213, 95, 109, 86, 131, 71, 70, + 84, 73, 131, 26, 82, 247, 140, 97, 115, 110, 118, 253, 2, 122, + 186, 148, 122, 148, 180, 231, 68, 46, 190, 102, 243, 48, 192, 15, + 208, 89, 56, 10, 245, 2, 254, 201, 120, 32, 126, 2, 83, 161, + 238, 123, 102, 230, 76, 190, 225, 182, 207, 228, 7, 218, 117, 89, + 29, 191, 56, 248, 185, 255, 46, 18, 72, 142, 82, 113, 26, 4, + 172, 254, 178, 136, 113, 115, 58, 193, 89, 227, 182, 246, 76, 77, + 108, 245, 41, 31, 70, 124, 249, 145, 15, 78, 228, 38, 241, 129, + 8, 176, 251, 72, 248, 80, 115, 244, 231, 145, 191, 190, 178, 168, + 89, 233, 69, 176, 174, 140, 182, 141, 81, 82, 92, 79, 101, 223, + 100, 64, 184, 215, 124, 37, 21, 227, 135, 102, 72, 36, 219, 56, + 146, 90, 219, 104, 227, 102, 83, 12, 41, 122, 173, 94, 1, 174, + 134, 130, 104, 237, 116, 249, 107, 230, 130, 123, 25, 162, 57, 223, + 193, 174, 146, 193, 239, 44, 246, 197, 214, 80, 83, 100, 66, 72, + 133, 137, 140, 82, 2, 2, 96, 9, 96, 158, 134, 97, 43, 129, + 141, 25, 183, 200, 214, 57, 248, 103, 222, 65, 195, 15, 244, 21, + 180, 46, 140, 130, 36, 17, 194, 209, 65, 254, 115, 103, 152, 129, + 234, 235, 194, 234, 170, 201, 210, 154, 150, 247, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_soln_meta_t* test_msg = ( msg_soln_meta_t* )test_msg_storage; + msg_soln_meta_t *test_msg = (msg_soln_meta_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->age_corrections = 21256; test_msg->age_gnss = 3573765977; @@ -863,306 +882,921 @@ START_TEST( test_legacy_auto_check_sbp_solution_meta_MsgSolnMeta ) test_msg->sol_in[118].sensor_type = 210; test_msg->tow = 3628191792; test_msg->vdop = 58512; - sbp_payload_send(&sbp_state, 0xff0e, 15360, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xff0e, 15360, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 15360, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 15360, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xff0e, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_soln_meta_t* check_msg = ( msg_soln_meta_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_soln_meta_t *check_msg = (msg_soln_meta_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->age_corrections == 21256, "incorrect value for age_corrections, expected 21256, is %d", check_msg->age_corrections); - ck_assert_msg(check_msg->age_gnss == 3573765977, "incorrect value for age_gnss, expected 3573765977, is %d", check_msg->age_gnss); - ck_assert_msg(check_msg->hdop == 41156, "incorrect value for hdop, expected 41156, is %d", check_msg->hdop); - ck_assert_msg(check_msg->pdop == 11642, "incorrect value for pdop, expected 11642, is %d", check_msg->pdop); - ck_assert_msg(check_msg->sol_in[0].flags == 109, "incorrect value for sol_in[0].flags, expected 109, is %d", check_msg->sol_in[0].flags); - ck_assert_msg(check_msg->sol_in[0].sensor_type == 95, "incorrect value for sol_in[0].sensor_type, expected 95, is %d", check_msg->sol_in[0].sensor_type); - ck_assert_msg(check_msg->sol_in[1].flags == 131, "incorrect value for sol_in[1].flags, expected 131, is %d", check_msg->sol_in[1].flags); - ck_assert_msg(check_msg->sol_in[1].sensor_type == 86, "incorrect value for sol_in[1].sensor_type, expected 86, is %d", check_msg->sol_in[1].sensor_type); - ck_assert_msg(check_msg->sol_in[2].flags == 70, "incorrect value for sol_in[2].flags, expected 70, is %d", check_msg->sol_in[2].flags); - ck_assert_msg(check_msg->sol_in[2].sensor_type == 71, "incorrect value for sol_in[2].sensor_type, expected 71, is %d", check_msg->sol_in[2].sensor_type); - ck_assert_msg(check_msg->sol_in[3].flags == 73, "incorrect value for sol_in[3].flags, expected 73, is %d", check_msg->sol_in[3].flags); - ck_assert_msg(check_msg->sol_in[3].sensor_type == 84, "incorrect value for sol_in[3].sensor_type, expected 84, is %d", check_msg->sol_in[3].sensor_type); - ck_assert_msg(check_msg->sol_in[4].flags == 26, "incorrect value for sol_in[4].flags, expected 26, is %d", check_msg->sol_in[4].flags); - ck_assert_msg(check_msg->sol_in[4].sensor_type == 131, "incorrect value for sol_in[4].sensor_type, expected 131, is %d", check_msg->sol_in[4].sensor_type); - ck_assert_msg(check_msg->sol_in[5].flags == 247, "incorrect value for sol_in[5].flags, expected 247, is %d", check_msg->sol_in[5].flags); - ck_assert_msg(check_msg->sol_in[5].sensor_type == 82, "incorrect value for sol_in[5].sensor_type, expected 82, is %d", check_msg->sol_in[5].sensor_type); - ck_assert_msg(check_msg->sol_in[6].flags == 97, "incorrect value for sol_in[6].flags, expected 97, is %d", check_msg->sol_in[6].flags); - ck_assert_msg(check_msg->sol_in[6].sensor_type == 140, "incorrect value for sol_in[6].sensor_type, expected 140, is %d", check_msg->sol_in[6].sensor_type); - ck_assert_msg(check_msg->sol_in[7].flags == 110, "incorrect value for sol_in[7].flags, expected 110, is %d", check_msg->sol_in[7].flags); - ck_assert_msg(check_msg->sol_in[7].sensor_type == 115, "incorrect value for sol_in[7].sensor_type, expected 115, is %d", check_msg->sol_in[7].sensor_type); - ck_assert_msg(check_msg->sol_in[8].flags == 253, "incorrect value for sol_in[8].flags, expected 253, is %d", check_msg->sol_in[8].flags); - ck_assert_msg(check_msg->sol_in[8].sensor_type == 118, "incorrect value for sol_in[8].sensor_type, expected 118, is %d", check_msg->sol_in[8].sensor_type); - ck_assert_msg(check_msg->sol_in[9].flags == 122, "incorrect value for sol_in[9].flags, expected 122, is %d", check_msg->sol_in[9].flags); - ck_assert_msg(check_msg->sol_in[9].sensor_type == 2, "incorrect value for sol_in[9].sensor_type, expected 2, is %d", check_msg->sol_in[9].sensor_type); - ck_assert_msg(check_msg->sol_in[10].flags == 148, "incorrect value for sol_in[10].flags, expected 148, is %d", check_msg->sol_in[10].flags); - ck_assert_msg(check_msg->sol_in[10].sensor_type == 186, "incorrect value for sol_in[10].sensor_type, expected 186, is %d", check_msg->sol_in[10].sensor_type); - ck_assert_msg(check_msg->sol_in[11].flags == 148, "incorrect value for sol_in[11].flags, expected 148, is %d", check_msg->sol_in[11].flags); - ck_assert_msg(check_msg->sol_in[11].sensor_type == 122, "incorrect value for sol_in[11].sensor_type, expected 122, is %d", check_msg->sol_in[11].sensor_type); - ck_assert_msg(check_msg->sol_in[12].flags == 231, "incorrect value for sol_in[12].flags, expected 231, is %d", check_msg->sol_in[12].flags); - ck_assert_msg(check_msg->sol_in[12].sensor_type == 180, "incorrect value for sol_in[12].sensor_type, expected 180, is %d", check_msg->sol_in[12].sensor_type); - ck_assert_msg(check_msg->sol_in[13].flags == 46, "incorrect value for sol_in[13].flags, expected 46, is %d", check_msg->sol_in[13].flags); - ck_assert_msg(check_msg->sol_in[13].sensor_type == 68, "incorrect value for sol_in[13].sensor_type, expected 68, is %d", check_msg->sol_in[13].sensor_type); - ck_assert_msg(check_msg->sol_in[14].flags == 102, "incorrect value for sol_in[14].flags, expected 102, is %d", check_msg->sol_in[14].flags); - ck_assert_msg(check_msg->sol_in[14].sensor_type == 190, "incorrect value for sol_in[14].sensor_type, expected 190, is %d", check_msg->sol_in[14].sensor_type); - ck_assert_msg(check_msg->sol_in[15].flags == 48, "incorrect value for sol_in[15].flags, expected 48, is %d", check_msg->sol_in[15].flags); - ck_assert_msg(check_msg->sol_in[15].sensor_type == 243, "incorrect value for sol_in[15].sensor_type, expected 243, is %d", check_msg->sol_in[15].sensor_type); - ck_assert_msg(check_msg->sol_in[16].flags == 15, "incorrect value for sol_in[16].flags, expected 15, is %d", check_msg->sol_in[16].flags); - ck_assert_msg(check_msg->sol_in[16].sensor_type == 192, "incorrect value for sol_in[16].sensor_type, expected 192, is %d", check_msg->sol_in[16].sensor_type); - ck_assert_msg(check_msg->sol_in[17].flags == 89, "incorrect value for sol_in[17].flags, expected 89, is %d", check_msg->sol_in[17].flags); - ck_assert_msg(check_msg->sol_in[17].sensor_type == 208, "incorrect value for sol_in[17].sensor_type, expected 208, is %d", check_msg->sol_in[17].sensor_type); - ck_assert_msg(check_msg->sol_in[18].flags == 10, "incorrect value for sol_in[18].flags, expected 10, is %d", check_msg->sol_in[18].flags); - ck_assert_msg(check_msg->sol_in[18].sensor_type == 56, "incorrect value for sol_in[18].sensor_type, expected 56, is %d", check_msg->sol_in[18].sensor_type); - ck_assert_msg(check_msg->sol_in[19].flags == 2, "incorrect value for sol_in[19].flags, expected 2, is %d", check_msg->sol_in[19].flags); - ck_assert_msg(check_msg->sol_in[19].sensor_type == 245, "incorrect value for sol_in[19].sensor_type, expected 245, is %d", check_msg->sol_in[19].sensor_type); - ck_assert_msg(check_msg->sol_in[20].flags == 201, "incorrect value for sol_in[20].flags, expected 201, is %d", check_msg->sol_in[20].flags); - ck_assert_msg(check_msg->sol_in[20].sensor_type == 254, "incorrect value for sol_in[20].sensor_type, expected 254, is %d", check_msg->sol_in[20].sensor_type); - ck_assert_msg(check_msg->sol_in[21].flags == 32, "incorrect value for sol_in[21].flags, expected 32, is %d", check_msg->sol_in[21].flags); - ck_assert_msg(check_msg->sol_in[21].sensor_type == 120, "incorrect value for sol_in[21].sensor_type, expected 120, is %d", check_msg->sol_in[21].sensor_type); - ck_assert_msg(check_msg->sol_in[22].flags == 2, "incorrect value for sol_in[22].flags, expected 2, is %d", check_msg->sol_in[22].flags); - ck_assert_msg(check_msg->sol_in[22].sensor_type == 126, "incorrect value for sol_in[22].sensor_type, expected 126, is %d", check_msg->sol_in[22].sensor_type); - ck_assert_msg(check_msg->sol_in[23].flags == 161, "incorrect value for sol_in[23].flags, expected 161, is %d", check_msg->sol_in[23].flags); - ck_assert_msg(check_msg->sol_in[23].sensor_type == 83, "incorrect value for sol_in[23].sensor_type, expected 83, is %d", check_msg->sol_in[23].sensor_type); - ck_assert_msg(check_msg->sol_in[24].flags == 123, "incorrect value for sol_in[24].flags, expected 123, is %d", check_msg->sol_in[24].flags); - ck_assert_msg(check_msg->sol_in[24].sensor_type == 238, "incorrect value for sol_in[24].sensor_type, expected 238, is %d", check_msg->sol_in[24].sensor_type); - ck_assert_msg(check_msg->sol_in[25].flags == 230, "incorrect value for sol_in[25].flags, expected 230, is %d", check_msg->sol_in[25].flags); - ck_assert_msg(check_msg->sol_in[25].sensor_type == 102, "incorrect value for sol_in[25].sensor_type, expected 102, is %d", check_msg->sol_in[25].sensor_type); - ck_assert_msg(check_msg->sol_in[26].flags == 190, "incorrect value for sol_in[26].flags, expected 190, is %d", check_msg->sol_in[26].flags); - ck_assert_msg(check_msg->sol_in[26].sensor_type == 76, "incorrect value for sol_in[26].sensor_type, expected 76, is %d", check_msg->sol_in[26].sensor_type); - ck_assert_msg(check_msg->sol_in[27].flags == 182, "incorrect value for sol_in[27].flags, expected 182, is %d", check_msg->sol_in[27].flags); - ck_assert_msg(check_msg->sol_in[27].sensor_type == 225, "incorrect value for sol_in[27].sensor_type, expected 225, is %d", check_msg->sol_in[27].sensor_type); - ck_assert_msg(check_msg->sol_in[28].flags == 228, "incorrect value for sol_in[28].flags, expected 228, is %d", check_msg->sol_in[28].flags); - ck_assert_msg(check_msg->sol_in[28].sensor_type == 207, "incorrect value for sol_in[28].sensor_type, expected 207, is %d", check_msg->sol_in[28].sensor_type); - ck_assert_msg(check_msg->sol_in[29].flags == 218, "incorrect value for sol_in[29].flags, expected 218, is %d", check_msg->sol_in[29].flags); - ck_assert_msg(check_msg->sol_in[29].sensor_type == 7, "incorrect value for sol_in[29].sensor_type, expected 7, is %d", check_msg->sol_in[29].sensor_type); - ck_assert_msg(check_msg->sol_in[30].flags == 89, "incorrect value for sol_in[30].flags, expected 89, is %d", check_msg->sol_in[30].flags); - ck_assert_msg(check_msg->sol_in[30].sensor_type == 117, "incorrect value for sol_in[30].sensor_type, expected 117, is %d", check_msg->sol_in[30].sensor_type); - ck_assert_msg(check_msg->sol_in[31].flags == 191, "incorrect value for sol_in[31].flags, expected 191, is %d", check_msg->sol_in[31].flags); - ck_assert_msg(check_msg->sol_in[31].sensor_type == 29, "incorrect value for sol_in[31].sensor_type, expected 29, is %d", check_msg->sol_in[31].sensor_type); - ck_assert_msg(check_msg->sol_in[32].flags == 248, "incorrect value for sol_in[32].flags, expected 248, is %d", check_msg->sol_in[32].flags); - ck_assert_msg(check_msg->sol_in[32].sensor_type == 56, "incorrect value for sol_in[32].sensor_type, expected 56, is %d", check_msg->sol_in[32].sensor_type); - ck_assert_msg(check_msg->sol_in[33].flags == 255, "incorrect value for sol_in[33].flags, expected 255, is %d", check_msg->sol_in[33].flags); - ck_assert_msg(check_msg->sol_in[33].sensor_type == 185, "incorrect value for sol_in[33].sensor_type, expected 185, is %d", check_msg->sol_in[33].sensor_type); - ck_assert_msg(check_msg->sol_in[34].flags == 18, "incorrect value for sol_in[34].flags, expected 18, is %d", check_msg->sol_in[34].flags); - ck_assert_msg(check_msg->sol_in[34].sensor_type == 46, "incorrect value for sol_in[34].sensor_type, expected 46, is %d", check_msg->sol_in[34].sensor_type); - ck_assert_msg(check_msg->sol_in[35].flags == 142, "incorrect value for sol_in[35].flags, expected 142, is %d", check_msg->sol_in[35].flags); - ck_assert_msg(check_msg->sol_in[35].sensor_type == 72, "incorrect value for sol_in[35].sensor_type, expected 72, is %d", check_msg->sol_in[35].sensor_type); - ck_assert_msg(check_msg->sol_in[36].flags == 113, "incorrect value for sol_in[36].flags, expected 113, is %d", check_msg->sol_in[36].flags); - ck_assert_msg(check_msg->sol_in[36].sensor_type == 82, "incorrect value for sol_in[36].sensor_type, expected 82, is %d", check_msg->sol_in[36].sensor_type); - ck_assert_msg(check_msg->sol_in[37].flags == 4, "incorrect value for sol_in[37].flags, expected 4, is %d", check_msg->sol_in[37].flags); - ck_assert_msg(check_msg->sol_in[37].sensor_type == 26, "incorrect value for sol_in[37].sensor_type, expected 26, is %d", check_msg->sol_in[37].sensor_type); - ck_assert_msg(check_msg->sol_in[38].flags == 254, "incorrect value for sol_in[38].flags, expected 254, is %d", check_msg->sol_in[38].flags); - ck_assert_msg(check_msg->sol_in[38].sensor_type == 172, "incorrect value for sol_in[38].sensor_type, expected 172, is %d", check_msg->sol_in[38].sensor_type); - ck_assert_msg(check_msg->sol_in[39].flags == 136, "incorrect value for sol_in[39].flags, expected 136, is %d", check_msg->sol_in[39].flags); - ck_assert_msg(check_msg->sol_in[39].sensor_type == 178, "incorrect value for sol_in[39].sensor_type, expected 178, is %d", check_msg->sol_in[39].sensor_type); - ck_assert_msg(check_msg->sol_in[40].flags == 115, "incorrect value for sol_in[40].flags, expected 115, is %d", check_msg->sol_in[40].flags); - ck_assert_msg(check_msg->sol_in[40].sensor_type == 113, "incorrect value for sol_in[40].sensor_type, expected 113, is %d", check_msg->sol_in[40].sensor_type); - ck_assert_msg(check_msg->sol_in[41].flags == 193, "incorrect value for sol_in[41].flags, expected 193, is %d", check_msg->sol_in[41].flags); - ck_assert_msg(check_msg->sol_in[41].sensor_type == 58, "incorrect value for sol_in[41].sensor_type, expected 58, is %d", check_msg->sol_in[41].sensor_type); - ck_assert_msg(check_msg->sol_in[42].flags == 227, "incorrect value for sol_in[42].flags, expected 227, is %d", check_msg->sol_in[42].flags); - ck_assert_msg(check_msg->sol_in[42].sensor_type == 89, "incorrect value for sol_in[42].sensor_type, expected 89, is %d", check_msg->sol_in[42].sensor_type); - ck_assert_msg(check_msg->sol_in[43].flags == 246, "incorrect value for sol_in[43].flags, expected 246, is %d", check_msg->sol_in[43].flags); - ck_assert_msg(check_msg->sol_in[43].sensor_type == 182, "incorrect value for sol_in[43].sensor_type, expected 182, is %d", check_msg->sol_in[43].sensor_type); - ck_assert_msg(check_msg->sol_in[44].flags == 77, "incorrect value for sol_in[44].flags, expected 77, is %d", check_msg->sol_in[44].flags); - ck_assert_msg(check_msg->sol_in[44].sensor_type == 76, "incorrect value for sol_in[44].sensor_type, expected 76, is %d", check_msg->sol_in[44].sensor_type); - ck_assert_msg(check_msg->sol_in[45].flags == 245, "incorrect value for sol_in[45].flags, expected 245, is %d", check_msg->sol_in[45].flags); - ck_assert_msg(check_msg->sol_in[45].sensor_type == 108, "incorrect value for sol_in[45].sensor_type, expected 108, is %d", check_msg->sol_in[45].sensor_type); - ck_assert_msg(check_msg->sol_in[46].flags == 31, "incorrect value for sol_in[46].flags, expected 31, is %d", check_msg->sol_in[46].flags); - ck_assert_msg(check_msg->sol_in[46].sensor_type == 41, "incorrect value for sol_in[46].sensor_type, expected 41, is %d", check_msg->sol_in[46].sensor_type); - ck_assert_msg(check_msg->sol_in[47].flags == 124, "incorrect value for sol_in[47].flags, expected 124, is %d", check_msg->sol_in[47].flags); - ck_assert_msg(check_msg->sol_in[47].sensor_type == 70, "incorrect value for sol_in[47].sensor_type, expected 70, is %d", check_msg->sol_in[47].sensor_type); - ck_assert_msg(check_msg->sol_in[48].flags == 145, "incorrect value for sol_in[48].flags, expected 145, is %d", check_msg->sol_in[48].flags); - ck_assert_msg(check_msg->sol_in[48].sensor_type == 249, "incorrect value for sol_in[48].sensor_type, expected 249, is %d", check_msg->sol_in[48].sensor_type); - ck_assert_msg(check_msg->sol_in[49].flags == 78, "incorrect value for sol_in[49].flags, expected 78, is %d", check_msg->sol_in[49].flags); - ck_assert_msg(check_msg->sol_in[49].sensor_type == 15, "incorrect value for sol_in[49].sensor_type, expected 15, is %d", check_msg->sol_in[49].sensor_type); - ck_assert_msg(check_msg->sol_in[50].flags == 38, "incorrect value for sol_in[50].flags, expected 38, is %d", check_msg->sol_in[50].flags); - ck_assert_msg(check_msg->sol_in[50].sensor_type == 228, "incorrect value for sol_in[50].sensor_type, expected 228, is %d", check_msg->sol_in[50].sensor_type); - ck_assert_msg(check_msg->sol_in[51].flags == 129, "incorrect value for sol_in[51].flags, expected 129, is %d", check_msg->sol_in[51].flags); - ck_assert_msg(check_msg->sol_in[51].sensor_type == 241, "incorrect value for sol_in[51].sensor_type, expected 241, is %d", check_msg->sol_in[51].sensor_type); - ck_assert_msg(check_msg->sol_in[52].flags == 176, "incorrect value for sol_in[52].flags, expected 176, is %d", check_msg->sol_in[52].flags); - ck_assert_msg(check_msg->sol_in[52].sensor_type == 8, "incorrect value for sol_in[52].sensor_type, expected 8, is %d", check_msg->sol_in[52].sensor_type); - ck_assert_msg(check_msg->sol_in[53].flags == 72, "incorrect value for sol_in[53].flags, expected 72, is %d", check_msg->sol_in[53].flags); - ck_assert_msg(check_msg->sol_in[53].sensor_type == 251, "incorrect value for sol_in[53].sensor_type, expected 251, is %d", check_msg->sol_in[53].sensor_type); - ck_assert_msg(check_msg->sol_in[54].flags == 80, "incorrect value for sol_in[54].flags, expected 80, is %d", check_msg->sol_in[54].flags); - ck_assert_msg(check_msg->sol_in[54].sensor_type == 248, "incorrect value for sol_in[54].sensor_type, expected 248, is %d", check_msg->sol_in[54].sensor_type); - ck_assert_msg(check_msg->sol_in[55].flags == 244, "incorrect value for sol_in[55].flags, expected 244, is %d", check_msg->sol_in[55].flags); - ck_assert_msg(check_msg->sol_in[55].sensor_type == 115, "incorrect value for sol_in[55].sensor_type, expected 115, is %d", check_msg->sol_in[55].sensor_type); - ck_assert_msg(check_msg->sol_in[56].flags == 145, "incorrect value for sol_in[56].flags, expected 145, is %d", check_msg->sol_in[56].flags); - ck_assert_msg(check_msg->sol_in[56].sensor_type == 231, "incorrect value for sol_in[56].sensor_type, expected 231, is %d", check_msg->sol_in[56].sensor_type); - ck_assert_msg(check_msg->sol_in[57].flags == 190, "incorrect value for sol_in[57].flags, expected 190, is %d", check_msg->sol_in[57].flags); - ck_assert_msg(check_msg->sol_in[57].sensor_type == 191, "incorrect value for sol_in[57].sensor_type, expected 191, is %d", check_msg->sol_in[57].sensor_type); - ck_assert_msg(check_msg->sol_in[58].flags == 168, "incorrect value for sol_in[58].flags, expected 168, is %d", check_msg->sol_in[58].flags); - ck_assert_msg(check_msg->sol_in[58].sensor_type == 178, "incorrect value for sol_in[58].sensor_type, expected 178, is %d", check_msg->sol_in[58].sensor_type); - ck_assert_msg(check_msg->sol_in[59].flags == 233, "incorrect value for sol_in[59].flags, expected 233, is %d", check_msg->sol_in[59].flags); - ck_assert_msg(check_msg->sol_in[59].sensor_type == 89, "incorrect value for sol_in[59].sensor_type, expected 89, is %d", check_msg->sol_in[59].sensor_type); - ck_assert_msg(check_msg->sol_in[60].flags == 176, "incorrect value for sol_in[60].flags, expected 176, is %d", check_msg->sol_in[60].flags); - ck_assert_msg(check_msg->sol_in[60].sensor_type == 69, "incorrect value for sol_in[60].sensor_type, expected 69, is %d", check_msg->sol_in[60].sensor_type); - ck_assert_msg(check_msg->sol_in[61].flags == 140, "incorrect value for sol_in[61].flags, expected 140, is %d", check_msg->sol_in[61].flags); - ck_assert_msg(check_msg->sol_in[61].sensor_type == 174, "incorrect value for sol_in[61].sensor_type, expected 174, is %d", check_msg->sol_in[61].sensor_type); - ck_assert_msg(check_msg->sol_in[62].flags == 141, "incorrect value for sol_in[62].flags, expected 141, is %d", check_msg->sol_in[62].flags); - ck_assert_msg(check_msg->sol_in[62].sensor_type == 182, "incorrect value for sol_in[62].sensor_type, expected 182, is %d", check_msg->sol_in[62].sensor_type); - ck_assert_msg(check_msg->sol_in[63].flags == 82, "incorrect value for sol_in[63].flags, expected 82, is %d", check_msg->sol_in[63].flags); - ck_assert_msg(check_msg->sol_in[63].sensor_type == 81, "incorrect value for sol_in[63].sensor_type, expected 81, is %d", check_msg->sol_in[63].sensor_type); - ck_assert_msg(check_msg->sol_in[64].flags == 79, "incorrect value for sol_in[64].flags, expected 79, is %d", check_msg->sol_in[64].flags); - ck_assert_msg(check_msg->sol_in[64].sensor_type == 92, "incorrect value for sol_in[64].sensor_type, expected 92, is %d", check_msg->sol_in[64].sensor_type); - ck_assert_msg(check_msg->sol_in[65].flags == 223, "incorrect value for sol_in[65].flags, expected 223, is %d", check_msg->sol_in[65].flags); - ck_assert_msg(check_msg->sol_in[65].sensor_type == 101, "incorrect value for sol_in[65].sensor_type, expected 101, is %d", check_msg->sol_in[65].sensor_type); - ck_assert_msg(check_msg->sol_in[66].flags == 64, "incorrect value for sol_in[66].flags, expected 64, is %d", check_msg->sol_in[66].flags); - ck_assert_msg(check_msg->sol_in[66].sensor_type == 100, "incorrect value for sol_in[66].sensor_type, expected 100, is %d", check_msg->sol_in[66].sensor_type); - ck_assert_msg(check_msg->sol_in[67].flags == 215, "incorrect value for sol_in[67].flags, expected 215, is %d", check_msg->sol_in[67].flags); - ck_assert_msg(check_msg->sol_in[67].sensor_type == 184, "incorrect value for sol_in[67].sensor_type, expected 184, is %d", check_msg->sol_in[67].sensor_type); - ck_assert_msg(check_msg->sol_in[68].flags == 37, "incorrect value for sol_in[68].flags, expected 37, is %d", check_msg->sol_in[68].flags); - ck_assert_msg(check_msg->sol_in[68].sensor_type == 124, "incorrect value for sol_in[68].sensor_type, expected 124, is %d", check_msg->sol_in[68].sensor_type); - ck_assert_msg(check_msg->sol_in[69].flags == 227, "incorrect value for sol_in[69].flags, expected 227, is %d", check_msg->sol_in[69].flags); - ck_assert_msg(check_msg->sol_in[69].sensor_type == 21, "incorrect value for sol_in[69].sensor_type, expected 21, is %d", check_msg->sol_in[69].sensor_type); - ck_assert_msg(check_msg->sol_in[70].flags == 102, "incorrect value for sol_in[70].flags, expected 102, is %d", check_msg->sol_in[70].flags); - ck_assert_msg(check_msg->sol_in[70].sensor_type == 135, "incorrect value for sol_in[70].sensor_type, expected 135, is %d", check_msg->sol_in[70].sensor_type); - ck_assert_msg(check_msg->sol_in[71].flags == 36, "incorrect value for sol_in[71].flags, expected 36, is %d", check_msg->sol_in[71].flags); - ck_assert_msg(check_msg->sol_in[71].sensor_type == 72, "incorrect value for sol_in[71].sensor_type, expected 72, is %d", check_msg->sol_in[71].sensor_type); - ck_assert_msg(check_msg->sol_in[72].flags == 56, "incorrect value for sol_in[72].flags, expected 56, is %d", check_msg->sol_in[72].flags); - ck_assert_msg(check_msg->sol_in[72].sensor_type == 219, "incorrect value for sol_in[72].sensor_type, expected 219, is %d", check_msg->sol_in[72].sensor_type); - ck_assert_msg(check_msg->sol_in[73].flags == 90, "incorrect value for sol_in[73].flags, expected 90, is %d", check_msg->sol_in[73].flags); - ck_assert_msg(check_msg->sol_in[73].sensor_type == 146, "incorrect value for sol_in[73].sensor_type, expected 146, is %d", check_msg->sol_in[73].sensor_type); - ck_assert_msg(check_msg->sol_in[74].flags == 104, "incorrect value for sol_in[74].flags, expected 104, is %d", check_msg->sol_in[74].flags); - ck_assert_msg(check_msg->sol_in[74].sensor_type == 219, "incorrect value for sol_in[74].sensor_type, expected 219, is %d", check_msg->sol_in[74].sensor_type); - ck_assert_msg(check_msg->sol_in[75].flags == 102, "incorrect value for sol_in[75].flags, expected 102, is %d", check_msg->sol_in[75].flags); - ck_assert_msg(check_msg->sol_in[75].sensor_type == 227, "incorrect value for sol_in[75].sensor_type, expected 227, is %d", check_msg->sol_in[75].sensor_type); - ck_assert_msg(check_msg->sol_in[76].flags == 12, "incorrect value for sol_in[76].flags, expected 12, is %d", check_msg->sol_in[76].flags); - ck_assert_msg(check_msg->sol_in[76].sensor_type == 83, "incorrect value for sol_in[76].sensor_type, expected 83, is %d", check_msg->sol_in[76].sensor_type); - ck_assert_msg(check_msg->sol_in[77].flags == 122, "incorrect value for sol_in[77].flags, expected 122, is %d", check_msg->sol_in[77].flags); - ck_assert_msg(check_msg->sol_in[77].sensor_type == 41, "incorrect value for sol_in[77].sensor_type, expected 41, is %d", check_msg->sol_in[77].sensor_type); - ck_assert_msg(check_msg->sol_in[78].flags == 94, "incorrect value for sol_in[78].flags, expected 94, is %d", check_msg->sol_in[78].flags); - ck_assert_msg(check_msg->sol_in[78].sensor_type == 173, "incorrect value for sol_in[78].sensor_type, expected 173, is %d", check_msg->sol_in[78].sensor_type); - ck_assert_msg(check_msg->sol_in[79].flags == 174, "incorrect value for sol_in[79].flags, expected 174, is %d", check_msg->sol_in[79].flags); - ck_assert_msg(check_msg->sol_in[79].sensor_type == 1, "incorrect value for sol_in[79].sensor_type, expected 1, is %d", check_msg->sol_in[79].sensor_type); - ck_assert_msg(check_msg->sol_in[80].flags == 130, "incorrect value for sol_in[80].flags, expected 130, is %d", check_msg->sol_in[80].flags); - ck_assert_msg(check_msg->sol_in[80].sensor_type == 134, "incorrect value for sol_in[80].sensor_type, expected 134, is %d", check_msg->sol_in[80].sensor_type); - ck_assert_msg(check_msg->sol_in[81].flags == 237, "incorrect value for sol_in[81].flags, expected 237, is %d", check_msg->sol_in[81].flags); - ck_assert_msg(check_msg->sol_in[81].sensor_type == 104, "incorrect value for sol_in[81].sensor_type, expected 104, is %d", check_msg->sol_in[81].sensor_type); - ck_assert_msg(check_msg->sol_in[82].flags == 249, "incorrect value for sol_in[82].flags, expected 249, is %d", check_msg->sol_in[82].flags); - ck_assert_msg(check_msg->sol_in[82].sensor_type == 116, "incorrect value for sol_in[82].sensor_type, expected 116, is %d", check_msg->sol_in[82].sensor_type); - ck_assert_msg(check_msg->sol_in[83].flags == 230, "incorrect value for sol_in[83].flags, expected 230, is %d", check_msg->sol_in[83].flags); - ck_assert_msg(check_msg->sol_in[83].sensor_type == 107, "incorrect value for sol_in[83].sensor_type, expected 107, is %d", check_msg->sol_in[83].sensor_type); - ck_assert_msg(check_msg->sol_in[84].flags == 123, "incorrect value for sol_in[84].flags, expected 123, is %d", check_msg->sol_in[84].flags); - ck_assert_msg(check_msg->sol_in[84].sensor_type == 130, "incorrect value for sol_in[84].sensor_type, expected 130, is %d", check_msg->sol_in[84].sensor_type); - ck_assert_msg(check_msg->sol_in[85].flags == 162, "incorrect value for sol_in[85].flags, expected 162, is %d", check_msg->sol_in[85].flags); - ck_assert_msg(check_msg->sol_in[85].sensor_type == 25, "incorrect value for sol_in[85].sensor_type, expected 25, is %d", check_msg->sol_in[85].sensor_type); - ck_assert_msg(check_msg->sol_in[86].flags == 223, "incorrect value for sol_in[86].flags, expected 223, is %d", check_msg->sol_in[86].flags); - ck_assert_msg(check_msg->sol_in[86].sensor_type == 57, "incorrect value for sol_in[86].sensor_type, expected 57, is %d", check_msg->sol_in[86].sensor_type); - ck_assert_msg(check_msg->sol_in[87].flags == 174, "incorrect value for sol_in[87].flags, expected 174, is %d", check_msg->sol_in[87].flags); - ck_assert_msg(check_msg->sol_in[87].sensor_type == 193, "incorrect value for sol_in[87].sensor_type, expected 193, is %d", check_msg->sol_in[87].sensor_type); - ck_assert_msg(check_msg->sol_in[88].flags == 193, "incorrect value for sol_in[88].flags, expected 193, is %d", check_msg->sol_in[88].flags); - ck_assert_msg(check_msg->sol_in[88].sensor_type == 146, "incorrect value for sol_in[88].sensor_type, expected 146, is %d", check_msg->sol_in[88].sensor_type); - ck_assert_msg(check_msg->sol_in[89].flags == 44, "incorrect value for sol_in[89].flags, expected 44, is %d", check_msg->sol_in[89].flags); - ck_assert_msg(check_msg->sol_in[89].sensor_type == 239, "incorrect value for sol_in[89].sensor_type, expected 239, is %d", check_msg->sol_in[89].sensor_type); - ck_assert_msg(check_msg->sol_in[90].flags == 197, "incorrect value for sol_in[90].flags, expected 197, is %d", check_msg->sol_in[90].flags); - ck_assert_msg(check_msg->sol_in[90].sensor_type == 246, "incorrect value for sol_in[90].sensor_type, expected 246, is %d", check_msg->sol_in[90].sensor_type); - ck_assert_msg(check_msg->sol_in[91].flags == 80, "incorrect value for sol_in[91].flags, expected 80, is %d", check_msg->sol_in[91].flags); - ck_assert_msg(check_msg->sol_in[91].sensor_type == 214, "incorrect value for sol_in[91].sensor_type, expected 214, is %d", check_msg->sol_in[91].sensor_type); - ck_assert_msg(check_msg->sol_in[92].flags == 100, "incorrect value for sol_in[92].flags, expected 100, is %d", check_msg->sol_in[92].flags); - ck_assert_msg(check_msg->sol_in[92].sensor_type == 83, "incorrect value for sol_in[92].sensor_type, expected 83, is %d", check_msg->sol_in[92].sensor_type); - ck_assert_msg(check_msg->sol_in[93].flags == 72, "incorrect value for sol_in[93].flags, expected 72, is %d", check_msg->sol_in[93].flags); - ck_assert_msg(check_msg->sol_in[93].sensor_type == 66, "incorrect value for sol_in[93].sensor_type, expected 66, is %d", check_msg->sol_in[93].sensor_type); - ck_assert_msg(check_msg->sol_in[94].flags == 137, "incorrect value for sol_in[94].flags, expected 137, is %d", check_msg->sol_in[94].flags); - ck_assert_msg(check_msg->sol_in[94].sensor_type == 133, "incorrect value for sol_in[94].sensor_type, expected 133, is %d", check_msg->sol_in[94].sensor_type); - ck_assert_msg(check_msg->sol_in[95].flags == 82, "incorrect value for sol_in[95].flags, expected 82, is %d", check_msg->sol_in[95].flags); - ck_assert_msg(check_msg->sol_in[95].sensor_type == 140, "incorrect value for sol_in[95].sensor_type, expected 140, is %d", check_msg->sol_in[95].sensor_type); - ck_assert_msg(check_msg->sol_in[96].flags == 2, "incorrect value for sol_in[96].flags, expected 2, is %d", check_msg->sol_in[96].flags); - ck_assert_msg(check_msg->sol_in[96].sensor_type == 2, "incorrect value for sol_in[96].sensor_type, expected 2, is %d", check_msg->sol_in[96].sensor_type); - ck_assert_msg(check_msg->sol_in[97].flags == 9, "incorrect value for sol_in[97].flags, expected 9, is %d", check_msg->sol_in[97].flags); - ck_assert_msg(check_msg->sol_in[97].sensor_type == 96, "incorrect value for sol_in[97].sensor_type, expected 96, is %d", check_msg->sol_in[97].sensor_type); - ck_assert_msg(check_msg->sol_in[98].flags == 158, "incorrect value for sol_in[98].flags, expected 158, is %d", check_msg->sol_in[98].flags); - ck_assert_msg(check_msg->sol_in[98].sensor_type == 96, "incorrect value for sol_in[98].sensor_type, expected 96, is %d", check_msg->sol_in[98].sensor_type); - ck_assert_msg(check_msg->sol_in[99].flags == 97, "incorrect value for sol_in[99].flags, expected 97, is %d", check_msg->sol_in[99].flags); - ck_assert_msg(check_msg->sol_in[99].sensor_type == 134, "incorrect value for sol_in[99].sensor_type, expected 134, is %d", check_msg->sol_in[99].sensor_type); - ck_assert_msg(check_msg->sol_in[100].flags == 129, "incorrect value for sol_in[100].flags, expected 129, is %d", check_msg->sol_in[100].flags); - ck_assert_msg(check_msg->sol_in[100].sensor_type == 43, "incorrect value for sol_in[100].sensor_type, expected 43, is %d", check_msg->sol_in[100].sensor_type); - ck_assert_msg(check_msg->sol_in[101].flags == 25, "incorrect value for sol_in[101].flags, expected 25, is %d", check_msg->sol_in[101].flags); - ck_assert_msg(check_msg->sol_in[101].sensor_type == 141, "incorrect value for sol_in[101].sensor_type, expected 141, is %d", check_msg->sol_in[101].sensor_type); - ck_assert_msg(check_msg->sol_in[102].flags == 200, "incorrect value for sol_in[102].flags, expected 200, is %d", check_msg->sol_in[102].flags); - ck_assert_msg(check_msg->sol_in[102].sensor_type == 183, "incorrect value for sol_in[102].sensor_type, expected 183, is %d", check_msg->sol_in[102].sensor_type); - ck_assert_msg(check_msg->sol_in[103].flags == 57, "incorrect value for sol_in[103].flags, expected 57, is %d", check_msg->sol_in[103].flags); - ck_assert_msg(check_msg->sol_in[103].sensor_type == 214, "incorrect value for sol_in[103].sensor_type, expected 214, is %d", check_msg->sol_in[103].sensor_type); - ck_assert_msg(check_msg->sol_in[104].flags == 103, "incorrect value for sol_in[104].flags, expected 103, is %d", check_msg->sol_in[104].flags); - ck_assert_msg(check_msg->sol_in[104].sensor_type == 248, "incorrect value for sol_in[104].sensor_type, expected 248, is %d", check_msg->sol_in[104].sensor_type); - ck_assert_msg(check_msg->sol_in[105].flags == 65, "incorrect value for sol_in[105].flags, expected 65, is %d", check_msg->sol_in[105].flags); - ck_assert_msg(check_msg->sol_in[105].sensor_type == 222, "incorrect value for sol_in[105].sensor_type, expected 222, is %d", check_msg->sol_in[105].sensor_type); - ck_assert_msg(check_msg->sol_in[106].flags == 15, "incorrect value for sol_in[106].flags, expected 15, is %d", check_msg->sol_in[106].flags); - ck_assert_msg(check_msg->sol_in[106].sensor_type == 195, "incorrect value for sol_in[106].sensor_type, expected 195, is %d", check_msg->sol_in[106].sensor_type); - ck_assert_msg(check_msg->sol_in[107].flags == 21, "incorrect value for sol_in[107].flags, expected 21, is %d", check_msg->sol_in[107].flags); - ck_assert_msg(check_msg->sol_in[107].sensor_type == 244, "incorrect value for sol_in[107].sensor_type, expected 244, is %d", check_msg->sol_in[107].sensor_type); - ck_assert_msg(check_msg->sol_in[108].flags == 46, "incorrect value for sol_in[108].flags, expected 46, is %d", check_msg->sol_in[108].flags); - ck_assert_msg(check_msg->sol_in[108].sensor_type == 180, "incorrect value for sol_in[108].sensor_type, expected 180, is %d", check_msg->sol_in[108].sensor_type); - ck_assert_msg(check_msg->sol_in[109].flags == 130, "incorrect value for sol_in[109].flags, expected 130, is %d", check_msg->sol_in[109].flags); - ck_assert_msg(check_msg->sol_in[109].sensor_type == 140, "incorrect value for sol_in[109].sensor_type, expected 140, is %d", check_msg->sol_in[109].sensor_type); - ck_assert_msg(check_msg->sol_in[110].flags == 17, "incorrect value for sol_in[110].flags, expected 17, is %d", check_msg->sol_in[110].flags); - ck_assert_msg(check_msg->sol_in[110].sensor_type == 36, "incorrect value for sol_in[110].sensor_type, expected 36, is %d", check_msg->sol_in[110].sensor_type); - ck_assert_msg(check_msg->sol_in[111].flags == 209, "incorrect value for sol_in[111].flags, expected 209, is %d", check_msg->sol_in[111].flags); - ck_assert_msg(check_msg->sol_in[111].sensor_type == 194, "incorrect value for sol_in[111].sensor_type, expected 194, is %d", check_msg->sol_in[111].sensor_type); - ck_assert_msg(check_msg->sol_in[112].flags == 254, "incorrect value for sol_in[112].flags, expected 254, is %d", check_msg->sol_in[112].flags); - ck_assert_msg(check_msg->sol_in[112].sensor_type == 65, "incorrect value for sol_in[112].sensor_type, expected 65, is %d", check_msg->sol_in[112].sensor_type); - ck_assert_msg(check_msg->sol_in[113].flags == 103, "incorrect value for sol_in[113].flags, expected 103, is %d", check_msg->sol_in[113].flags); - ck_assert_msg(check_msg->sol_in[113].sensor_type == 115, "incorrect value for sol_in[113].sensor_type, expected 115, is %d", check_msg->sol_in[113].sensor_type); - ck_assert_msg(check_msg->sol_in[114].flags == 129, "incorrect value for sol_in[114].flags, expected 129, is %d", check_msg->sol_in[114].flags); - ck_assert_msg(check_msg->sol_in[114].sensor_type == 152, "incorrect value for sol_in[114].sensor_type, expected 152, is %d", check_msg->sol_in[114].sensor_type); - ck_assert_msg(check_msg->sol_in[115].flags == 235, "incorrect value for sol_in[115].flags, expected 235, is %d", check_msg->sol_in[115].flags); - ck_assert_msg(check_msg->sol_in[115].sensor_type == 234, "incorrect value for sol_in[115].sensor_type, expected 234, is %d", check_msg->sol_in[115].sensor_type); - ck_assert_msg(check_msg->sol_in[116].flags == 234, "incorrect value for sol_in[116].flags, expected 234, is %d", check_msg->sol_in[116].flags); - ck_assert_msg(check_msg->sol_in[116].sensor_type == 194, "incorrect value for sol_in[116].sensor_type, expected 194, is %d", check_msg->sol_in[116].sensor_type); - ck_assert_msg(check_msg->sol_in[117].flags == 201, "incorrect value for sol_in[117].flags, expected 201, is %d", check_msg->sol_in[117].flags); - ck_assert_msg(check_msg->sol_in[117].sensor_type == 170, "incorrect value for sol_in[117].sensor_type, expected 170, is %d", check_msg->sol_in[117].sensor_type); - ck_assert_msg(check_msg->sol_in[118].flags == 154, "incorrect value for sol_in[118].flags, expected 154, is %d", check_msg->sol_in[118].flags); - ck_assert_msg(check_msg->sol_in[118].sensor_type == 210, "incorrect value for sol_in[118].sensor_type, expected 210, is %d", check_msg->sol_in[118].sensor_type); - ck_assert_msg(check_msg->tow == 3628191792, "incorrect value for tow, expected 3628191792, is %d", check_msg->tow); - ck_assert_msg(check_msg->vdop == 58512, "incorrect value for vdop, expected 58512, is %d", check_msg->vdop); + ck_assert_msg(check_msg->age_corrections == 21256, + "incorrect value for age_corrections, expected 21256, is %d", + check_msg->age_corrections); + ck_assert_msg(check_msg->age_gnss == 3573765977, + "incorrect value for age_gnss, expected 3573765977, is %d", + check_msg->age_gnss); + ck_assert_msg(check_msg->hdop == 41156, + "incorrect value for hdop, expected 41156, is %d", + check_msg->hdop); + ck_assert_msg(check_msg->pdop == 11642, + "incorrect value for pdop, expected 11642, is %d", + check_msg->pdop); + ck_assert_msg(check_msg->sol_in[0].flags == 109, + "incorrect value for sol_in[0].flags, expected 109, is %d", + check_msg->sol_in[0].flags); + ck_assert_msg( + check_msg->sol_in[0].sensor_type == 95, + "incorrect value for sol_in[0].sensor_type, expected 95, is %d", + check_msg->sol_in[0].sensor_type); + ck_assert_msg(check_msg->sol_in[1].flags == 131, + "incorrect value for sol_in[1].flags, expected 131, is %d", + check_msg->sol_in[1].flags); + ck_assert_msg( + check_msg->sol_in[1].sensor_type == 86, + "incorrect value for sol_in[1].sensor_type, expected 86, is %d", + check_msg->sol_in[1].sensor_type); + ck_assert_msg(check_msg->sol_in[2].flags == 70, + "incorrect value for sol_in[2].flags, expected 70, is %d", + check_msg->sol_in[2].flags); + ck_assert_msg( + check_msg->sol_in[2].sensor_type == 71, + "incorrect value for sol_in[2].sensor_type, expected 71, is %d", + check_msg->sol_in[2].sensor_type); + ck_assert_msg(check_msg->sol_in[3].flags == 73, + "incorrect value for sol_in[3].flags, expected 73, is %d", + check_msg->sol_in[3].flags); + ck_assert_msg( + check_msg->sol_in[3].sensor_type == 84, + "incorrect value for sol_in[3].sensor_type, expected 84, is %d", + check_msg->sol_in[3].sensor_type); + ck_assert_msg(check_msg->sol_in[4].flags == 26, + "incorrect value for sol_in[4].flags, expected 26, is %d", + check_msg->sol_in[4].flags); + ck_assert_msg( + check_msg->sol_in[4].sensor_type == 131, + "incorrect value for sol_in[4].sensor_type, expected 131, is %d", + check_msg->sol_in[4].sensor_type); + ck_assert_msg(check_msg->sol_in[5].flags == 247, + "incorrect value for sol_in[5].flags, expected 247, is %d", + check_msg->sol_in[5].flags); + ck_assert_msg( + check_msg->sol_in[5].sensor_type == 82, + "incorrect value for sol_in[5].sensor_type, expected 82, is %d", + check_msg->sol_in[5].sensor_type); + ck_assert_msg(check_msg->sol_in[6].flags == 97, + "incorrect value for sol_in[6].flags, expected 97, is %d", + check_msg->sol_in[6].flags); + ck_assert_msg( + check_msg->sol_in[6].sensor_type == 140, + "incorrect value for sol_in[6].sensor_type, expected 140, is %d", + check_msg->sol_in[6].sensor_type); + ck_assert_msg(check_msg->sol_in[7].flags == 110, + "incorrect value for sol_in[7].flags, expected 110, is %d", + check_msg->sol_in[7].flags); + ck_assert_msg( + check_msg->sol_in[7].sensor_type == 115, + "incorrect value for sol_in[7].sensor_type, expected 115, is %d", + check_msg->sol_in[7].sensor_type); + ck_assert_msg(check_msg->sol_in[8].flags == 253, + "incorrect value for sol_in[8].flags, expected 253, is %d", + check_msg->sol_in[8].flags); + ck_assert_msg( + check_msg->sol_in[8].sensor_type == 118, + "incorrect value for sol_in[8].sensor_type, expected 118, is %d", + check_msg->sol_in[8].sensor_type); + ck_assert_msg(check_msg->sol_in[9].flags == 122, + "incorrect value for sol_in[9].flags, expected 122, is %d", + check_msg->sol_in[9].flags); + ck_assert_msg( + check_msg->sol_in[9].sensor_type == 2, + "incorrect value for sol_in[9].sensor_type, expected 2, is %d", + check_msg->sol_in[9].sensor_type); + ck_assert_msg(check_msg->sol_in[10].flags == 148, + "incorrect value for sol_in[10].flags, expected 148, is %d", + check_msg->sol_in[10].flags); + ck_assert_msg( + check_msg->sol_in[10].sensor_type == 186, + "incorrect value for sol_in[10].sensor_type, expected 186, is %d", + check_msg->sol_in[10].sensor_type); + ck_assert_msg(check_msg->sol_in[11].flags == 148, + "incorrect value for sol_in[11].flags, expected 148, is %d", + check_msg->sol_in[11].flags); + ck_assert_msg( + check_msg->sol_in[11].sensor_type == 122, + "incorrect value for sol_in[11].sensor_type, expected 122, is %d", + check_msg->sol_in[11].sensor_type); + ck_assert_msg(check_msg->sol_in[12].flags == 231, + "incorrect value for sol_in[12].flags, expected 231, is %d", + check_msg->sol_in[12].flags); + ck_assert_msg( + check_msg->sol_in[12].sensor_type == 180, + "incorrect value for sol_in[12].sensor_type, expected 180, is %d", + check_msg->sol_in[12].sensor_type); + ck_assert_msg(check_msg->sol_in[13].flags == 46, + "incorrect value for sol_in[13].flags, expected 46, is %d", + check_msg->sol_in[13].flags); + ck_assert_msg( + check_msg->sol_in[13].sensor_type == 68, + "incorrect value for sol_in[13].sensor_type, expected 68, is %d", + check_msg->sol_in[13].sensor_type); + ck_assert_msg(check_msg->sol_in[14].flags == 102, + "incorrect value for sol_in[14].flags, expected 102, is %d", + check_msg->sol_in[14].flags); + ck_assert_msg( + check_msg->sol_in[14].sensor_type == 190, + "incorrect value for sol_in[14].sensor_type, expected 190, is %d", + check_msg->sol_in[14].sensor_type); + ck_assert_msg(check_msg->sol_in[15].flags == 48, + "incorrect value for sol_in[15].flags, expected 48, is %d", + check_msg->sol_in[15].flags); + ck_assert_msg( + check_msg->sol_in[15].sensor_type == 243, + "incorrect value for sol_in[15].sensor_type, expected 243, is %d", + check_msg->sol_in[15].sensor_type); + ck_assert_msg(check_msg->sol_in[16].flags == 15, + "incorrect value for sol_in[16].flags, expected 15, is %d", + check_msg->sol_in[16].flags); + ck_assert_msg( + check_msg->sol_in[16].sensor_type == 192, + "incorrect value for sol_in[16].sensor_type, expected 192, is %d", + check_msg->sol_in[16].sensor_type); + ck_assert_msg(check_msg->sol_in[17].flags == 89, + "incorrect value for sol_in[17].flags, expected 89, is %d", + check_msg->sol_in[17].flags); + ck_assert_msg( + check_msg->sol_in[17].sensor_type == 208, + "incorrect value for sol_in[17].sensor_type, expected 208, is %d", + check_msg->sol_in[17].sensor_type); + ck_assert_msg(check_msg->sol_in[18].flags == 10, + "incorrect value for sol_in[18].flags, expected 10, is %d", + check_msg->sol_in[18].flags); + ck_assert_msg( + check_msg->sol_in[18].sensor_type == 56, + "incorrect value for sol_in[18].sensor_type, expected 56, is %d", + check_msg->sol_in[18].sensor_type); + ck_assert_msg(check_msg->sol_in[19].flags == 2, + "incorrect value for sol_in[19].flags, expected 2, is %d", + check_msg->sol_in[19].flags); + ck_assert_msg( + check_msg->sol_in[19].sensor_type == 245, + "incorrect value for sol_in[19].sensor_type, expected 245, is %d", + check_msg->sol_in[19].sensor_type); + ck_assert_msg(check_msg->sol_in[20].flags == 201, + "incorrect value for sol_in[20].flags, expected 201, is %d", + check_msg->sol_in[20].flags); + ck_assert_msg( + check_msg->sol_in[20].sensor_type == 254, + "incorrect value for sol_in[20].sensor_type, expected 254, is %d", + check_msg->sol_in[20].sensor_type); + ck_assert_msg(check_msg->sol_in[21].flags == 32, + "incorrect value for sol_in[21].flags, expected 32, is %d", + check_msg->sol_in[21].flags); + ck_assert_msg( + check_msg->sol_in[21].sensor_type == 120, + "incorrect value for sol_in[21].sensor_type, expected 120, is %d", + check_msg->sol_in[21].sensor_type); + ck_assert_msg(check_msg->sol_in[22].flags == 2, + "incorrect value for sol_in[22].flags, expected 2, is %d", + check_msg->sol_in[22].flags); + ck_assert_msg( + check_msg->sol_in[22].sensor_type == 126, + "incorrect value for sol_in[22].sensor_type, expected 126, is %d", + check_msg->sol_in[22].sensor_type); + ck_assert_msg(check_msg->sol_in[23].flags == 161, + "incorrect value for sol_in[23].flags, expected 161, is %d", + check_msg->sol_in[23].flags); + ck_assert_msg( + check_msg->sol_in[23].sensor_type == 83, + "incorrect value for sol_in[23].sensor_type, expected 83, is %d", + check_msg->sol_in[23].sensor_type); + ck_assert_msg(check_msg->sol_in[24].flags == 123, + "incorrect value for sol_in[24].flags, expected 123, is %d", + check_msg->sol_in[24].flags); + ck_assert_msg( + check_msg->sol_in[24].sensor_type == 238, + "incorrect value for sol_in[24].sensor_type, expected 238, is %d", + check_msg->sol_in[24].sensor_type); + ck_assert_msg(check_msg->sol_in[25].flags == 230, + "incorrect value for sol_in[25].flags, expected 230, is %d", + check_msg->sol_in[25].flags); + ck_assert_msg( + check_msg->sol_in[25].sensor_type == 102, + "incorrect value for sol_in[25].sensor_type, expected 102, is %d", + check_msg->sol_in[25].sensor_type); + ck_assert_msg(check_msg->sol_in[26].flags == 190, + "incorrect value for sol_in[26].flags, expected 190, is %d", + check_msg->sol_in[26].flags); + ck_assert_msg( + check_msg->sol_in[26].sensor_type == 76, + "incorrect value for sol_in[26].sensor_type, expected 76, is %d", + check_msg->sol_in[26].sensor_type); + ck_assert_msg(check_msg->sol_in[27].flags == 182, + "incorrect value for sol_in[27].flags, expected 182, is %d", + check_msg->sol_in[27].flags); + ck_assert_msg( + check_msg->sol_in[27].sensor_type == 225, + "incorrect value for sol_in[27].sensor_type, expected 225, is %d", + check_msg->sol_in[27].sensor_type); + ck_assert_msg(check_msg->sol_in[28].flags == 228, + "incorrect value for sol_in[28].flags, expected 228, is %d", + check_msg->sol_in[28].flags); + ck_assert_msg( + check_msg->sol_in[28].sensor_type == 207, + "incorrect value for sol_in[28].sensor_type, expected 207, is %d", + check_msg->sol_in[28].sensor_type); + ck_assert_msg(check_msg->sol_in[29].flags == 218, + "incorrect value for sol_in[29].flags, expected 218, is %d", + check_msg->sol_in[29].flags); + ck_assert_msg( + check_msg->sol_in[29].sensor_type == 7, + "incorrect value for sol_in[29].sensor_type, expected 7, is %d", + check_msg->sol_in[29].sensor_type); + ck_assert_msg(check_msg->sol_in[30].flags == 89, + "incorrect value for sol_in[30].flags, expected 89, is %d", + check_msg->sol_in[30].flags); + ck_assert_msg( + check_msg->sol_in[30].sensor_type == 117, + "incorrect value for sol_in[30].sensor_type, expected 117, is %d", + check_msg->sol_in[30].sensor_type); + ck_assert_msg(check_msg->sol_in[31].flags == 191, + "incorrect value for sol_in[31].flags, expected 191, is %d", + check_msg->sol_in[31].flags); + ck_assert_msg( + check_msg->sol_in[31].sensor_type == 29, + "incorrect value for sol_in[31].sensor_type, expected 29, is %d", + check_msg->sol_in[31].sensor_type); + ck_assert_msg(check_msg->sol_in[32].flags == 248, + "incorrect value for sol_in[32].flags, expected 248, is %d", + check_msg->sol_in[32].flags); + ck_assert_msg( + check_msg->sol_in[32].sensor_type == 56, + "incorrect value for sol_in[32].sensor_type, expected 56, is %d", + check_msg->sol_in[32].sensor_type); + ck_assert_msg(check_msg->sol_in[33].flags == 255, + "incorrect value for sol_in[33].flags, expected 255, is %d", + check_msg->sol_in[33].flags); + ck_assert_msg( + check_msg->sol_in[33].sensor_type == 185, + "incorrect value for sol_in[33].sensor_type, expected 185, is %d", + check_msg->sol_in[33].sensor_type); + ck_assert_msg(check_msg->sol_in[34].flags == 18, + "incorrect value for sol_in[34].flags, expected 18, is %d", + check_msg->sol_in[34].flags); + ck_assert_msg( + check_msg->sol_in[34].sensor_type == 46, + "incorrect value for sol_in[34].sensor_type, expected 46, is %d", + check_msg->sol_in[34].sensor_type); + ck_assert_msg(check_msg->sol_in[35].flags == 142, + "incorrect value for sol_in[35].flags, expected 142, is %d", + check_msg->sol_in[35].flags); + ck_assert_msg( + check_msg->sol_in[35].sensor_type == 72, + "incorrect value for sol_in[35].sensor_type, expected 72, is %d", + check_msg->sol_in[35].sensor_type); + ck_assert_msg(check_msg->sol_in[36].flags == 113, + "incorrect value for sol_in[36].flags, expected 113, is %d", + check_msg->sol_in[36].flags); + ck_assert_msg( + check_msg->sol_in[36].sensor_type == 82, + "incorrect value for sol_in[36].sensor_type, expected 82, is %d", + check_msg->sol_in[36].sensor_type); + ck_assert_msg(check_msg->sol_in[37].flags == 4, + "incorrect value for sol_in[37].flags, expected 4, is %d", + check_msg->sol_in[37].flags); + ck_assert_msg( + check_msg->sol_in[37].sensor_type == 26, + "incorrect value for sol_in[37].sensor_type, expected 26, is %d", + check_msg->sol_in[37].sensor_type); + ck_assert_msg(check_msg->sol_in[38].flags == 254, + "incorrect value for sol_in[38].flags, expected 254, is %d", + check_msg->sol_in[38].flags); + ck_assert_msg( + check_msg->sol_in[38].sensor_type == 172, + "incorrect value for sol_in[38].sensor_type, expected 172, is %d", + check_msg->sol_in[38].sensor_type); + ck_assert_msg(check_msg->sol_in[39].flags == 136, + "incorrect value for sol_in[39].flags, expected 136, is %d", + check_msg->sol_in[39].flags); + ck_assert_msg( + check_msg->sol_in[39].sensor_type == 178, + "incorrect value for sol_in[39].sensor_type, expected 178, is %d", + check_msg->sol_in[39].sensor_type); + ck_assert_msg(check_msg->sol_in[40].flags == 115, + "incorrect value for sol_in[40].flags, expected 115, is %d", + check_msg->sol_in[40].flags); + ck_assert_msg( + check_msg->sol_in[40].sensor_type == 113, + "incorrect value for sol_in[40].sensor_type, expected 113, is %d", + check_msg->sol_in[40].sensor_type); + ck_assert_msg(check_msg->sol_in[41].flags == 193, + "incorrect value for sol_in[41].flags, expected 193, is %d", + check_msg->sol_in[41].flags); + ck_assert_msg( + check_msg->sol_in[41].sensor_type == 58, + "incorrect value for sol_in[41].sensor_type, expected 58, is %d", + check_msg->sol_in[41].sensor_type); + ck_assert_msg(check_msg->sol_in[42].flags == 227, + "incorrect value for sol_in[42].flags, expected 227, is %d", + check_msg->sol_in[42].flags); + ck_assert_msg( + check_msg->sol_in[42].sensor_type == 89, + "incorrect value for sol_in[42].sensor_type, expected 89, is %d", + check_msg->sol_in[42].sensor_type); + ck_assert_msg(check_msg->sol_in[43].flags == 246, + "incorrect value for sol_in[43].flags, expected 246, is %d", + check_msg->sol_in[43].flags); + ck_assert_msg( + check_msg->sol_in[43].sensor_type == 182, + "incorrect value for sol_in[43].sensor_type, expected 182, is %d", + check_msg->sol_in[43].sensor_type); + ck_assert_msg(check_msg->sol_in[44].flags == 77, + "incorrect value for sol_in[44].flags, expected 77, is %d", + check_msg->sol_in[44].flags); + ck_assert_msg( + check_msg->sol_in[44].sensor_type == 76, + "incorrect value for sol_in[44].sensor_type, expected 76, is %d", + check_msg->sol_in[44].sensor_type); + ck_assert_msg(check_msg->sol_in[45].flags == 245, + "incorrect value for sol_in[45].flags, expected 245, is %d", + check_msg->sol_in[45].flags); + ck_assert_msg( + check_msg->sol_in[45].sensor_type == 108, + "incorrect value for sol_in[45].sensor_type, expected 108, is %d", + check_msg->sol_in[45].sensor_type); + ck_assert_msg(check_msg->sol_in[46].flags == 31, + "incorrect value for sol_in[46].flags, expected 31, is %d", + check_msg->sol_in[46].flags); + ck_assert_msg( + check_msg->sol_in[46].sensor_type == 41, + "incorrect value for sol_in[46].sensor_type, expected 41, is %d", + check_msg->sol_in[46].sensor_type); + ck_assert_msg(check_msg->sol_in[47].flags == 124, + "incorrect value for sol_in[47].flags, expected 124, is %d", + check_msg->sol_in[47].flags); + ck_assert_msg( + check_msg->sol_in[47].sensor_type == 70, + "incorrect value for sol_in[47].sensor_type, expected 70, is %d", + check_msg->sol_in[47].sensor_type); + ck_assert_msg(check_msg->sol_in[48].flags == 145, + "incorrect value for sol_in[48].flags, expected 145, is %d", + check_msg->sol_in[48].flags); + ck_assert_msg( + check_msg->sol_in[48].sensor_type == 249, + "incorrect value for sol_in[48].sensor_type, expected 249, is %d", + check_msg->sol_in[48].sensor_type); + ck_assert_msg(check_msg->sol_in[49].flags == 78, + "incorrect value for sol_in[49].flags, expected 78, is %d", + check_msg->sol_in[49].flags); + ck_assert_msg( + check_msg->sol_in[49].sensor_type == 15, + "incorrect value for sol_in[49].sensor_type, expected 15, is %d", + check_msg->sol_in[49].sensor_type); + ck_assert_msg(check_msg->sol_in[50].flags == 38, + "incorrect value for sol_in[50].flags, expected 38, is %d", + check_msg->sol_in[50].flags); + ck_assert_msg( + check_msg->sol_in[50].sensor_type == 228, + "incorrect value for sol_in[50].sensor_type, expected 228, is %d", + check_msg->sol_in[50].sensor_type); + ck_assert_msg(check_msg->sol_in[51].flags == 129, + "incorrect value for sol_in[51].flags, expected 129, is %d", + check_msg->sol_in[51].flags); + ck_assert_msg( + check_msg->sol_in[51].sensor_type == 241, + "incorrect value for sol_in[51].sensor_type, expected 241, is %d", + check_msg->sol_in[51].sensor_type); + ck_assert_msg(check_msg->sol_in[52].flags == 176, + "incorrect value for sol_in[52].flags, expected 176, is %d", + check_msg->sol_in[52].flags); + ck_assert_msg( + check_msg->sol_in[52].sensor_type == 8, + "incorrect value for sol_in[52].sensor_type, expected 8, is %d", + check_msg->sol_in[52].sensor_type); + ck_assert_msg(check_msg->sol_in[53].flags == 72, + "incorrect value for sol_in[53].flags, expected 72, is %d", + check_msg->sol_in[53].flags); + ck_assert_msg( + check_msg->sol_in[53].sensor_type == 251, + "incorrect value for sol_in[53].sensor_type, expected 251, is %d", + check_msg->sol_in[53].sensor_type); + ck_assert_msg(check_msg->sol_in[54].flags == 80, + "incorrect value for sol_in[54].flags, expected 80, is %d", + check_msg->sol_in[54].flags); + ck_assert_msg( + check_msg->sol_in[54].sensor_type == 248, + "incorrect value for sol_in[54].sensor_type, expected 248, is %d", + check_msg->sol_in[54].sensor_type); + ck_assert_msg(check_msg->sol_in[55].flags == 244, + "incorrect value for sol_in[55].flags, expected 244, is %d", + check_msg->sol_in[55].flags); + ck_assert_msg( + check_msg->sol_in[55].sensor_type == 115, + "incorrect value for sol_in[55].sensor_type, expected 115, is %d", + check_msg->sol_in[55].sensor_type); + ck_assert_msg(check_msg->sol_in[56].flags == 145, + "incorrect value for sol_in[56].flags, expected 145, is %d", + check_msg->sol_in[56].flags); + ck_assert_msg( + check_msg->sol_in[56].sensor_type == 231, + "incorrect value for sol_in[56].sensor_type, expected 231, is %d", + check_msg->sol_in[56].sensor_type); + ck_assert_msg(check_msg->sol_in[57].flags == 190, + "incorrect value for sol_in[57].flags, expected 190, is %d", + check_msg->sol_in[57].flags); + ck_assert_msg( + check_msg->sol_in[57].sensor_type == 191, + "incorrect value for sol_in[57].sensor_type, expected 191, is %d", + check_msg->sol_in[57].sensor_type); + ck_assert_msg(check_msg->sol_in[58].flags == 168, + "incorrect value for sol_in[58].flags, expected 168, is %d", + check_msg->sol_in[58].flags); + ck_assert_msg( + check_msg->sol_in[58].sensor_type == 178, + "incorrect value for sol_in[58].sensor_type, expected 178, is %d", + check_msg->sol_in[58].sensor_type); + ck_assert_msg(check_msg->sol_in[59].flags == 233, + "incorrect value for sol_in[59].flags, expected 233, is %d", + check_msg->sol_in[59].flags); + ck_assert_msg( + check_msg->sol_in[59].sensor_type == 89, + "incorrect value for sol_in[59].sensor_type, expected 89, is %d", + check_msg->sol_in[59].sensor_type); + ck_assert_msg(check_msg->sol_in[60].flags == 176, + "incorrect value for sol_in[60].flags, expected 176, is %d", + check_msg->sol_in[60].flags); + ck_assert_msg( + check_msg->sol_in[60].sensor_type == 69, + "incorrect value for sol_in[60].sensor_type, expected 69, is %d", + check_msg->sol_in[60].sensor_type); + ck_assert_msg(check_msg->sol_in[61].flags == 140, + "incorrect value for sol_in[61].flags, expected 140, is %d", + check_msg->sol_in[61].flags); + ck_assert_msg( + check_msg->sol_in[61].sensor_type == 174, + "incorrect value for sol_in[61].sensor_type, expected 174, is %d", + check_msg->sol_in[61].sensor_type); + ck_assert_msg(check_msg->sol_in[62].flags == 141, + "incorrect value for sol_in[62].flags, expected 141, is %d", + check_msg->sol_in[62].flags); + ck_assert_msg( + check_msg->sol_in[62].sensor_type == 182, + "incorrect value for sol_in[62].sensor_type, expected 182, is %d", + check_msg->sol_in[62].sensor_type); + ck_assert_msg(check_msg->sol_in[63].flags == 82, + "incorrect value for sol_in[63].flags, expected 82, is %d", + check_msg->sol_in[63].flags); + ck_assert_msg( + check_msg->sol_in[63].sensor_type == 81, + "incorrect value for sol_in[63].sensor_type, expected 81, is %d", + check_msg->sol_in[63].sensor_type); + ck_assert_msg(check_msg->sol_in[64].flags == 79, + "incorrect value for sol_in[64].flags, expected 79, is %d", + check_msg->sol_in[64].flags); + ck_assert_msg( + check_msg->sol_in[64].sensor_type == 92, + "incorrect value for sol_in[64].sensor_type, expected 92, is %d", + check_msg->sol_in[64].sensor_type); + ck_assert_msg(check_msg->sol_in[65].flags == 223, + "incorrect value for sol_in[65].flags, expected 223, is %d", + check_msg->sol_in[65].flags); + ck_assert_msg( + check_msg->sol_in[65].sensor_type == 101, + "incorrect value for sol_in[65].sensor_type, expected 101, is %d", + check_msg->sol_in[65].sensor_type); + ck_assert_msg(check_msg->sol_in[66].flags == 64, + "incorrect value for sol_in[66].flags, expected 64, is %d", + check_msg->sol_in[66].flags); + ck_assert_msg( + check_msg->sol_in[66].sensor_type == 100, + "incorrect value for sol_in[66].sensor_type, expected 100, is %d", + check_msg->sol_in[66].sensor_type); + ck_assert_msg(check_msg->sol_in[67].flags == 215, + "incorrect value for sol_in[67].flags, expected 215, is %d", + check_msg->sol_in[67].flags); + ck_assert_msg( + check_msg->sol_in[67].sensor_type == 184, + "incorrect value for sol_in[67].sensor_type, expected 184, is %d", + check_msg->sol_in[67].sensor_type); + ck_assert_msg(check_msg->sol_in[68].flags == 37, + "incorrect value for sol_in[68].flags, expected 37, is %d", + check_msg->sol_in[68].flags); + ck_assert_msg( + check_msg->sol_in[68].sensor_type == 124, + "incorrect value for sol_in[68].sensor_type, expected 124, is %d", + check_msg->sol_in[68].sensor_type); + ck_assert_msg(check_msg->sol_in[69].flags == 227, + "incorrect value for sol_in[69].flags, expected 227, is %d", + check_msg->sol_in[69].flags); + ck_assert_msg( + check_msg->sol_in[69].sensor_type == 21, + "incorrect value for sol_in[69].sensor_type, expected 21, is %d", + check_msg->sol_in[69].sensor_type); + ck_assert_msg(check_msg->sol_in[70].flags == 102, + "incorrect value for sol_in[70].flags, expected 102, is %d", + check_msg->sol_in[70].flags); + ck_assert_msg( + check_msg->sol_in[70].sensor_type == 135, + "incorrect value for sol_in[70].sensor_type, expected 135, is %d", + check_msg->sol_in[70].sensor_type); + ck_assert_msg(check_msg->sol_in[71].flags == 36, + "incorrect value for sol_in[71].flags, expected 36, is %d", + check_msg->sol_in[71].flags); + ck_assert_msg( + check_msg->sol_in[71].sensor_type == 72, + "incorrect value for sol_in[71].sensor_type, expected 72, is %d", + check_msg->sol_in[71].sensor_type); + ck_assert_msg(check_msg->sol_in[72].flags == 56, + "incorrect value for sol_in[72].flags, expected 56, is %d", + check_msg->sol_in[72].flags); + ck_assert_msg( + check_msg->sol_in[72].sensor_type == 219, + "incorrect value for sol_in[72].sensor_type, expected 219, is %d", + check_msg->sol_in[72].sensor_type); + ck_assert_msg(check_msg->sol_in[73].flags == 90, + "incorrect value for sol_in[73].flags, expected 90, is %d", + check_msg->sol_in[73].flags); + ck_assert_msg( + check_msg->sol_in[73].sensor_type == 146, + "incorrect value for sol_in[73].sensor_type, expected 146, is %d", + check_msg->sol_in[73].sensor_type); + ck_assert_msg(check_msg->sol_in[74].flags == 104, + "incorrect value for sol_in[74].flags, expected 104, is %d", + check_msg->sol_in[74].flags); + ck_assert_msg( + check_msg->sol_in[74].sensor_type == 219, + "incorrect value for sol_in[74].sensor_type, expected 219, is %d", + check_msg->sol_in[74].sensor_type); + ck_assert_msg(check_msg->sol_in[75].flags == 102, + "incorrect value for sol_in[75].flags, expected 102, is %d", + check_msg->sol_in[75].flags); + ck_assert_msg( + check_msg->sol_in[75].sensor_type == 227, + "incorrect value for sol_in[75].sensor_type, expected 227, is %d", + check_msg->sol_in[75].sensor_type); + ck_assert_msg(check_msg->sol_in[76].flags == 12, + "incorrect value for sol_in[76].flags, expected 12, is %d", + check_msg->sol_in[76].flags); + ck_assert_msg( + check_msg->sol_in[76].sensor_type == 83, + "incorrect value for sol_in[76].sensor_type, expected 83, is %d", + check_msg->sol_in[76].sensor_type); + ck_assert_msg(check_msg->sol_in[77].flags == 122, + "incorrect value for sol_in[77].flags, expected 122, is %d", + check_msg->sol_in[77].flags); + ck_assert_msg( + check_msg->sol_in[77].sensor_type == 41, + "incorrect value for sol_in[77].sensor_type, expected 41, is %d", + check_msg->sol_in[77].sensor_type); + ck_assert_msg(check_msg->sol_in[78].flags == 94, + "incorrect value for sol_in[78].flags, expected 94, is %d", + check_msg->sol_in[78].flags); + ck_assert_msg( + check_msg->sol_in[78].sensor_type == 173, + "incorrect value for sol_in[78].sensor_type, expected 173, is %d", + check_msg->sol_in[78].sensor_type); + ck_assert_msg(check_msg->sol_in[79].flags == 174, + "incorrect value for sol_in[79].flags, expected 174, is %d", + check_msg->sol_in[79].flags); + ck_assert_msg( + check_msg->sol_in[79].sensor_type == 1, + "incorrect value for sol_in[79].sensor_type, expected 1, is %d", + check_msg->sol_in[79].sensor_type); + ck_assert_msg(check_msg->sol_in[80].flags == 130, + "incorrect value for sol_in[80].flags, expected 130, is %d", + check_msg->sol_in[80].flags); + ck_assert_msg( + check_msg->sol_in[80].sensor_type == 134, + "incorrect value for sol_in[80].sensor_type, expected 134, is %d", + check_msg->sol_in[80].sensor_type); + ck_assert_msg(check_msg->sol_in[81].flags == 237, + "incorrect value for sol_in[81].flags, expected 237, is %d", + check_msg->sol_in[81].flags); + ck_assert_msg( + check_msg->sol_in[81].sensor_type == 104, + "incorrect value for sol_in[81].sensor_type, expected 104, is %d", + check_msg->sol_in[81].sensor_type); + ck_assert_msg(check_msg->sol_in[82].flags == 249, + "incorrect value for sol_in[82].flags, expected 249, is %d", + check_msg->sol_in[82].flags); + ck_assert_msg( + check_msg->sol_in[82].sensor_type == 116, + "incorrect value for sol_in[82].sensor_type, expected 116, is %d", + check_msg->sol_in[82].sensor_type); + ck_assert_msg(check_msg->sol_in[83].flags == 230, + "incorrect value for sol_in[83].flags, expected 230, is %d", + check_msg->sol_in[83].flags); + ck_assert_msg( + check_msg->sol_in[83].sensor_type == 107, + "incorrect value for sol_in[83].sensor_type, expected 107, is %d", + check_msg->sol_in[83].sensor_type); + ck_assert_msg(check_msg->sol_in[84].flags == 123, + "incorrect value for sol_in[84].flags, expected 123, is %d", + check_msg->sol_in[84].flags); + ck_assert_msg( + check_msg->sol_in[84].sensor_type == 130, + "incorrect value for sol_in[84].sensor_type, expected 130, is %d", + check_msg->sol_in[84].sensor_type); + ck_assert_msg(check_msg->sol_in[85].flags == 162, + "incorrect value for sol_in[85].flags, expected 162, is %d", + check_msg->sol_in[85].flags); + ck_assert_msg( + check_msg->sol_in[85].sensor_type == 25, + "incorrect value for sol_in[85].sensor_type, expected 25, is %d", + check_msg->sol_in[85].sensor_type); + ck_assert_msg(check_msg->sol_in[86].flags == 223, + "incorrect value for sol_in[86].flags, expected 223, is %d", + check_msg->sol_in[86].flags); + ck_assert_msg( + check_msg->sol_in[86].sensor_type == 57, + "incorrect value for sol_in[86].sensor_type, expected 57, is %d", + check_msg->sol_in[86].sensor_type); + ck_assert_msg(check_msg->sol_in[87].flags == 174, + "incorrect value for sol_in[87].flags, expected 174, is %d", + check_msg->sol_in[87].flags); + ck_assert_msg( + check_msg->sol_in[87].sensor_type == 193, + "incorrect value for sol_in[87].sensor_type, expected 193, is %d", + check_msg->sol_in[87].sensor_type); + ck_assert_msg(check_msg->sol_in[88].flags == 193, + "incorrect value for sol_in[88].flags, expected 193, is %d", + check_msg->sol_in[88].flags); + ck_assert_msg( + check_msg->sol_in[88].sensor_type == 146, + "incorrect value for sol_in[88].sensor_type, expected 146, is %d", + check_msg->sol_in[88].sensor_type); + ck_assert_msg(check_msg->sol_in[89].flags == 44, + "incorrect value for sol_in[89].flags, expected 44, is %d", + check_msg->sol_in[89].flags); + ck_assert_msg( + check_msg->sol_in[89].sensor_type == 239, + "incorrect value for sol_in[89].sensor_type, expected 239, is %d", + check_msg->sol_in[89].sensor_type); + ck_assert_msg(check_msg->sol_in[90].flags == 197, + "incorrect value for sol_in[90].flags, expected 197, is %d", + check_msg->sol_in[90].flags); + ck_assert_msg( + check_msg->sol_in[90].sensor_type == 246, + "incorrect value for sol_in[90].sensor_type, expected 246, is %d", + check_msg->sol_in[90].sensor_type); + ck_assert_msg(check_msg->sol_in[91].flags == 80, + "incorrect value for sol_in[91].flags, expected 80, is %d", + check_msg->sol_in[91].flags); + ck_assert_msg( + check_msg->sol_in[91].sensor_type == 214, + "incorrect value for sol_in[91].sensor_type, expected 214, is %d", + check_msg->sol_in[91].sensor_type); + ck_assert_msg(check_msg->sol_in[92].flags == 100, + "incorrect value for sol_in[92].flags, expected 100, is %d", + check_msg->sol_in[92].flags); + ck_assert_msg( + check_msg->sol_in[92].sensor_type == 83, + "incorrect value for sol_in[92].sensor_type, expected 83, is %d", + check_msg->sol_in[92].sensor_type); + ck_assert_msg(check_msg->sol_in[93].flags == 72, + "incorrect value for sol_in[93].flags, expected 72, is %d", + check_msg->sol_in[93].flags); + ck_assert_msg( + check_msg->sol_in[93].sensor_type == 66, + "incorrect value for sol_in[93].sensor_type, expected 66, is %d", + check_msg->sol_in[93].sensor_type); + ck_assert_msg(check_msg->sol_in[94].flags == 137, + "incorrect value for sol_in[94].flags, expected 137, is %d", + check_msg->sol_in[94].flags); + ck_assert_msg( + check_msg->sol_in[94].sensor_type == 133, + "incorrect value for sol_in[94].sensor_type, expected 133, is %d", + check_msg->sol_in[94].sensor_type); + ck_assert_msg(check_msg->sol_in[95].flags == 82, + "incorrect value for sol_in[95].flags, expected 82, is %d", + check_msg->sol_in[95].flags); + ck_assert_msg( + check_msg->sol_in[95].sensor_type == 140, + "incorrect value for sol_in[95].sensor_type, expected 140, is %d", + check_msg->sol_in[95].sensor_type); + ck_assert_msg(check_msg->sol_in[96].flags == 2, + "incorrect value for sol_in[96].flags, expected 2, is %d", + check_msg->sol_in[96].flags); + ck_assert_msg( + check_msg->sol_in[96].sensor_type == 2, + "incorrect value for sol_in[96].sensor_type, expected 2, is %d", + check_msg->sol_in[96].sensor_type); + ck_assert_msg(check_msg->sol_in[97].flags == 9, + "incorrect value for sol_in[97].flags, expected 9, is %d", + check_msg->sol_in[97].flags); + ck_assert_msg( + check_msg->sol_in[97].sensor_type == 96, + "incorrect value for sol_in[97].sensor_type, expected 96, is %d", + check_msg->sol_in[97].sensor_type); + ck_assert_msg(check_msg->sol_in[98].flags == 158, + "incorrect value for sol_in[98].flags, expected 158, is %d", + check_msg->sol_in[98].flags); + ck_assert_msg( + check_msg->sol_in[98].sensor_type == 96, + "incorrect value for sol_in[98].sensor_type, expected 96, is %d", + check_msg->sol_in[98].sensor_type); + ck_assert_msg(check_msg->sol_in[99].flags == 97, + "incorrect value for sol_in[99].flags, expected 97, is %d", + check_msg->sol_in[99].flags); + ck_assert_msg( + check_msg->sol_in[99].sensor_type == 134, + "incorrect value for sol_in[99].sensor_type, expected 134, is %d", + check_msg->sol_in[99].sensor_type); + ck_assert_msg(check_msg->sol_in[100].flags == 129, + "incorrect value for sol_in[100].flags, expected 129, is %d", + check_msg->sol_in[100].flags); + ck_assert_msg( + check_msg->sol_in[100].sensor_type == 43, + "incorrect value for sol_in[100].sensor_type, expected 43, is %d", + check_msg->sol_in[100].sensor_type); + ck_assert_msg(check_msg->sol_in[101].flags == 25, + "incorrect value for sol_in[101].flags, expected 25, is %d", + check_msg->sol_in[101].flags); + ck_assert_msg( + check_msg->sol_in[101].sensor_type == 141, + "incorrect value for sol_in[101].sensor_type, expected 141, is %d", + check_msg->sol_in[101].sensor_type); + ck_assert_msg(check_msg->sol_in[102].flags == 200, + "incorrect value for sol_in[102].flags, expected 200, is %d", + check_msg->sol_in[102].flags); + ck_assert_msg( + check_msg->sol_in[102].sensor_type == 183, + "incorrect value for sol_in[102].sensor_type, expected 183, is %d", + check_msg->sol_in[102].sensor_type); + ck_assert_msg(check_msg->sol_in[103].flags == 57, + "incorrect value for sol_in[103].flags, expected 57, is %d", + check_msg->sol_in[103].flags); + ck_assert_msg( + check_msg->sol_in[103].sensor_type == 214, + "incorrect value for sol_in[103].sensor_type, expected 214, is %d", + check_msg->sol_in[103].sensor_type); + ck_assert_msg(check_msg->sol_in[104].flags == 103, + "incorrect value for sol_in[104].flags, expected 103, is %d", + check_msg->sol_in[104].flags); + ck_assert_msg( + check_msg->sol_in[104].sensor_type == 248, + "incorrect value for sol_in[104].sensor_type, expected 248, is %d", + check_msg->sol_in[104].sensor_type); + ck_assert_msg(check_msg->sol_in[105].flags == 65, + "incorrect value for sol_in[105].flags, expected 65, is %d", + check_msg->sol_in[105].flags); + ck_assert_msg( + check_msg->sol_in[105].sensor_type == 222, + "incorrect value for sol_in[105].sensor_type, expected 222, is %d", + check_msg->sol_in[105].sensor_type); + ck_assert_msg(check_msg->sol_in[106].flags == 15, + "incorrect value for sol_in[106].flags, expected 15, is %d", + check_msg->sol_in[106].flags); + ck_assert_msg( + check_msg->sol_in[106].sensor_type == 195, + "incorrect value for sol_in[106].sensor_type, expected 195, is %d", + check_msg->sol_in[106].sensor_type); + ck_assert_msg(check_msg->sol_in[107].flags == 21, + "incorrect value for sol_in[107].flags, expected 21, is %d", + check_msg->sol_in[107].flags); + ck_assert_msg( + check_msg->sol_in[107].sensor_type == 244, + "incorrect value for sol_in[107].sensor_type, expected 244, is %d", + check_msg->sol_in[107].sensor_type); + ck_assert_msg(check_msg->sol_in[108].flags == 46, + "incorrect value for sol_in[108].flags, expected 46, is %d", + check_msg->sol_in[108].flags); + ck_assert_msg( + check_msg->sol_in[108].sensor_type == 180, + "incorrect value for sol_in[108].sensor_type, expected 180, is %d", + check_msg->sol_in[108].sensor_type); + ck_assert_msg(check_msg->sol_in[109].flags == 130, + "incorrect value for sol_in[109].flags, expected 130, is %d", + check_msg->sol_in[109].flags); + ck_assert_msg( + check_msg->sol_in[109].sensor_type == 140, + "incorrect value for sol_in[109].sensor_type, expected 140, is %d", + check_msg->sol_in[109].sensor_type); + ck_assert_msg(check_msg->sol_in[110].flags == 17, + "incorrect value for sol_in[110].flags, expected 17, is %d", + check_msg->sol_in[110].flags); + ck_assert_msg( + check_msg->sol_in[110].sensor_type == 36, + "incorrect value for sol_in[110].sensor_type, expected 36, is %d", + check_msg->sol_in[110].sensor_type); + ck_assert_msg(check_msg->sol_in[111].flags == 209, + "incorrect value for sol_in[111].flags, expected 209, is %d", + check_msg->sol_in[111].flags); + ck_assert_msg( + check_msg->sol_in[111].sensor_type == 194, + "incorrect value for sol_in[111].sensor_type, expected 194, is %d", + check_msg->sol_in[111].sensor_type); + ck_assert_msg(check_msg->sol_in[112].flags == 254, + "incorrect value for sol_in[112].flags, expected 254, is %d", + check_msg->sol_in[112].flags); + ck_assert_msg( + check_msg->sol_in[112].sensor_type == 65, + "incorrect value for sol_in[112].sensor_type, expected 65, is %d", + check_msg->sol_in[112].sensor_type); + ck_assert_msg(check_msg->sol_in[113].flags == 103, + "incorrect value for sol_in[113].flags, expected 103, is %d", + check_msg->sol_in[113].flags); + ck_assert_msg( + check_msg->sol_in[113].sensor_type == 115, + "incorrect value for sol_in[113].sensor_type, expected 115, is %d", + check_msg->sol_in[113].sensor_type); + ck_assert_msg(check_msg->sol_in[114].flags == 129, + "incorrect value for sol_in[114].flags, expected 129, is %d", + check_msg->sol_in[114].flags); + ck_assert_msg( + check_msg->sol_in[114].sensor_type == 152, + "incorrect value for sol_in[114].sensor_type, expected 152, is %d", + check_msg->sol_in[114].sensor_type); + ck_assert_msg(check_msg->sol_in[115].flags == 235, + "incorrect value for sol_in[115].flags, expected 235, is %d", + check_msg->sol_in[115].flags); + ck_assert_msg( + check_msg->sol_in[115].sensor_type == 234, + "incorrect value for sol_in[115].sensor_type, expected 234, is %d", + check_msg->sol_in[115].sensor_type); + ck_assert_msg(check_msg->sol_in[116].flags == 234, + "incorrect value for sol_in[116].flags, expected 234, is %d", + check_msg->sol_in[116].flags); + ck_assert_msg( + check_msg->sol_in[116].sensor_type == 194, + "incorrect value for sol_in[116].sensor_type, expected 194, is %d", + check_msg->sol_in[116].sensor_type); + ck_assert_msg(check_msg->sol_in[117].flags == 201, + "incorrect value for sol_in[117].flags, expected 201, is %d", + check_msg->sol_in[117].flags); + ck_assert_msg( + check_msg->sol_in[117].sensor_type == 170, + "incorrect value for sol_in[117].sensor_type, expected 170, is %d", + check_msg->sol_in[117].sensor_type); + ck_assert_msg(check_msg->sol_in[118].flags == 154, + "incorrect value for sol_in[118].flags, expected 154, is %d", + check_msg->sol_in[118].flags); + ck_assert_msg( + check_msg->sol_in[118].sensor_type == 210, + "incorrect value for sol_in[118].sensor_type, expected 210, is %d", + check_msg->sol_in[118].sensor_type); + ck_assert_msg(check_msg->tow == 3628191792, + "incorrect value for tow, expected 3628191792, is %d", + check_msg->tow); + ck_assert_msg(check_msg->vdop == 58512, + "incorrect value for vdop, expected 58512, is %d", + check_msg->vdop); } } END_TEST -Suite* legacy_auto_check_sbp_solution_meta_MsgSolnMeta_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_solution_meta_MsgSolnMeta"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_solution_meta_MsgSolnMeta"); +Suite *legacy_auto_check_sbp_solution_meta_MsgSolnMeta_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_solution_meta_MsgSolnMeta"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_solution_meta_MsgSolnMeta"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_solution_meta_MsgSolnMeta); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_solution_meta_MsgSolnMetaDepA.c b/c/test/legacy/auto_check_sbp_solution_meta_MsgSolnMetaDepA.c index 0e16b9be1..233e731a0 100644 --- a/c/test/legacy/auto_check_sbp_solution_meta_MsgSolnMetaDepA.c +++ b/c/test/legacy/auto_check_sbp_solution_meta_MsgSolnMetaDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMetaDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMetaDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,39 @@ START_TEST( test_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xff0f, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xff0f, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xff0f, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xff0f, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,15,255,84,241,254,183,222,157,121,5,164,238,31,190,115,93,59,103,36,83,161,156,46,253,67,87,200,39,250,245,242,228,72,18,222,11,88,207,218,231,13,226,224,22,196,21,242,12,89,71,219,182,85,145,204,146,40,204,51,21,153,227,44,15,28,255,39,205,216,240,190,93,219,103,42,41,182,76,222,17,23,125,31,18,229,28,47,214,25,100,84,106,72,48,10,222,232,235,73,109,163,51,152,133,235,87,70,2,108,91,101,200,55,24,156,233,73,39,66,97,140,252,227,230,237,135,241,245,205,70,0,219,188,107,136,178,58,1,29,44,213,225,147,190,96,192,108,228,15,203,18,3,222,180,68,101,229,223,203,243,164,92,165,220,159,174,121,112,167,240,40,59,3,230,52,149,148,218,142,212,109,176,71,179,172,77,1,193,70,147,149,23,144,148,239,195,186,86,30,34,143,156,207,63,55,117,255,222,222,219,145,224,191,210,109,86,153,21,32,226,10,60,63,106,236,93,96,30,163,106,238,147,133,132,107,152,214,221,185,202,21,252,51,130,59,166,202,127,170,58,193,215,125,22,58,135,47,88,142,77,211, }; + u8 encoded_frame[] = { + 85, 15, 255, 84, 241, 254, 183, 222, 157, 121, 5, 164, 238, 31, + 190, 115, 93, 59, 103, 36, 83, 161, 156, 46, 253, 67, 87, 200, + 39, 250, 245, 242, 228, 72, 18, 222, 11, 88, 207, 218, 231, 13, + 226, 224, 22, 196, 21, 242, 12, 89, 71, 219, 182, 85, 145, 204, + 146, 40, 204, 51, 21, 153, 227, 44, 15, 28, 255, 39, 205, 216, + 240, 190, 93, 219, 103, 42, 41, 182, 76, 222, 17, 23, 125, 31, + 18, 229, 28, 47, 214, 25, 100, 84, 106, 72, 48, 10, 222, 232, + 235, 73, 109, 163, 51, 152, 133, 235, 87, 70, 2, 108, 91, 101, + 200, 55, 24, 156, 233, 73, 39, 66, 97, 140, 252, 227, 230, 237, + 135, 241, 245, 205, 70, 0, 219, 188, 107, 136, 178, 58, 1, 29, + 44, 213, 225, 147, 190, 96, 192, 108, 228, 15, 203, 18, 3, 222, + 180, 68, 101, 229, 223, 203, 243, 164, 92, 165, 220, 159, 174, 121, + 112, 167, 240, 40, 59, 3, 230, 52, 149, 148, 218, 142, 212, 109, + 176, 71, 179, 172, 77, 1, 193, 70, 147, 149, 23, 144, 148, 239, + 195, 186, 86, 30, 34, 143, 156, 207, 63, 55, 117, 255, 222, 222, + 219, 145, 224, 191, 210, 109, 86, 153, 21, 32, 226, 10, 60, 63, + 106, 236, 93, 96, 30, 163, 106, 238, 147, 133, 132, 107, 152, 214, + 221, 185, 202, 21, 252, 51, 130, 59, 166, 202, 127, 170, 58, 193, + 215, 125, 22, 58, 135, 47, 88, 142, 77, 211, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_soln_meta_dep_a_t* test_msg = ( msg_soln_meta_dep_a_t* )test_msg_storage; + msg_soln_meta_dep_a_t *test_msg = (msg_soln_meta_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->age_corrections = 48671; test_msg->alignment_status = 115; @@ -859,307 +878,925 @@ START_TEST( test_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA ) test_msg->sol_in[117].flags = 142; test_msg->sol_in[117].sensor_type = 88; test_msg->vdop = 41989; - sbp_payload_send(&sbp_state, 0xff0f, 61780, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xff0f, 61780, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61780, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 61780, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xff0f, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_soln_meta_dep_a_t* check_msg = ( msg_soln_meta_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_soln_meta_dep_a_t *check_msg = + (msg_soln_meta_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->age_corrections == 48671, "incorrect value for age_corrections, expected 48671, is %d", check_msg->age_corrections); - ck_assert_msg(check_msg->alignment_status == 115, "incorrect value for alignment_status, expected 115, is %d", check_msg->alignment_status); - ck_assert_msg(check_msg->hdop == 31133, "incorrect value for hdop, expected 31133, is %d", check_msg->hdop); - ck_assert_msg(check_msg->last_used_gnss_pos_tow == 610745181, "incorrect value for last_used_gnss_pos_tow, expected 610745181, is %d", check_msg->last_used_gnss_pos_tow); - ck_assert_msg(check_msg->last_used_gnss_vel_tow == 782016851, "incorrect value for last_used_gnss_vel_tow, expected 782016851, is %d", check_msg->last_used_gnss_vel_tow); - ck_assert_msg(check_msg->n_sats == 238, "incorrect value for n_sats, expected 238, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->pdop == 57015, "incorrect value for pdop, expected 57015, is %d", check_msg->pdop); - ck_assert_msg(check_msg->sol_in[0].flags == 67, "incorrect value for sol_in[0].flags, expected 67, is %d", check_msg->sol_in[0].flags); - ck_assert_msg(check_msg->sol_in[0].sensor_type == 253, "incorrect value for sol_in[0].sensor_type, expected 253, is %d", check_msg->sol_in[0].sensor_type); - ck_assert_msg(check_msg->sol_in[1].flags == 200, "incorrect value for sol_in[1].flags, expected 200, is %d", check_msg->sol_in[1].flags); - ck_assert_msg(check_msg->sol_in[1].sensor_type == 87, "incorrect value for sol_in[1].sensor_type, expected 87, is %d", check_msg->sol_in[1].sensor_type); - ck_assert_msg(check_msg->sol_in[2].flags == 250, "incorrect value for sol_in[2].flags, expected 250, is %d", check_msg->sol_in[2].flags); - ck_assert_msg(check_msg->sol_in[2].sensor_type == 39, "incorrect value for sol_in[2].sensor_type, expected 39, is %d", check_msg->sol_in[2].sensor_type); - ck_assert_msg(check_msg->sol_in[3].flags == 242, "incorrect value for sol_in[3].flags, expected 242, is %d", check_msg->sol_in[3].flags); - ck_assert_msg(check_msg->sol_in[3].sensor_type == 245, "incorrect value for sol_in[3].sensor_type, expected 245, is %d", check_msg->sol_in[3].sensor_type); - ck_assert_msg(check_msg->sol_in[4].flags == 72, "incorrect value for sol_in[4].flags, expected 72, is %d", check_msg->sol_in[4].flags); - ck_assert_msg(check_msg->sol_in[4].sensor_type == 228, "incorrect value for sol_in[4].sensor_type, expected 228, is %d", check_msg->sol_in[4].sensor_type); - ck_assert_msg(check_msg->sol_in[5].flags == 222, "incorrect value for sol_in[5].flags, expected 222, is %d", check_msg->sol_in[5].flags); - ck_assert_msg(check_msg->sol_in[5].sensor_type == 18, "incorrect value for sol_in[5].sensor_type, expected 18, is %d", check_msg->sol_in[5].sensor_type); - ck_assert_msg(check_msg->sol_in[6].flags == 88, "incorrect value for sol_in[6].flags, expected 88, is %d", check_msg->sol_in[6].flags); - ck_assert_msg(check_msg->sol_in[6].sensor_type == 11, "incorrect value for sol_in[6].sensor_type, expected 11, is %d", check_msg->sol_in[6].sensor_type); - ck_assert_msg(check_msg->sol_in[7].flags == 218, "incorrect value for sol_in[7].flags, expected 218, is %d", check_msg->sol_in[7].flags); - ck_assert_msg(check_msg->sol_in[7].sensor_type == 207, "incorrect value for sol_in[7].sensor_type, expected 207, is %d", check_msg->sol_in[7].sensor_type); - ck_assert_msg(check_msg->sol_in[8].flags == 13, "incorrect value for sol_in[8].flags, expected 13, is %d", check_msg->sol_in[8].flags); - ck_assert_msg(check_msg->sol_in[8].sensor_type == 231, "incorrect value for sol_in[8].sensor_type, expected 231, is %d", check_msg->sol_in[8].sensor_type); - ck_assert_msg(check_msg->sol_in[9].flags == 224, "incorrect value for sol_in[9].flags, expected 224, is %d", check_msg->sol_in[9].flags); - ck_assert_msg(check_msg->sol_in[9].sensor_type == 226, "incorrect value for sol_in[9].sensor_type, expected 226, is %d", check_msg->sol_in[9].sensor_type); - ck_assert_msg(check_msg->sol_in[10].flags == 196, "incorrect value for sol_in[10].flags, expected 196, is %d", check_msg->sol_in[10].flags); - ck_assert_msg(check_msg->sol_in[10].sensor_type == 22, "incorrect value for sol_in[10].sensor_type, expected 22, is %d", check_msg->sol_in[10].sensor_type); - ck_assert_msg(check_msg->sol_in[11].flags == 242, "incorrect value for sol_in[11].flags, expected 242, is %d", check_msg->sol_in[11].flags); - ck_assert_msg(check_msg->sol_in[11].sensor_type == 21, "incorrect value for sol_in[11].sensor_type, expected 21, is %d", check_msg->sol_in[11].sensor_type); - ck_assert_msg(check_msg->sol_in[12].flags == 89, "incorrect value for sol_in[12].flags, expected 89, is %d", check_msg->sol_in[12].flags); - ck_assert_msg(check_msg->sol_in[12].sensor_type == 12, "incorrect value for sol_in[12].sensor_type, expected 12, is %d", check_msg->sol_in[12].sensor_type); - ck_assert_msg(check_msg->sol_in[13].flags == 219, "incorrect value for sol_in[13].flags, expected 219, is %d", check_msg->sol_in[13].flags); - ck_assert_msg(check_msg->sol_in[13].sensor_type == 71, "incorrect value for sol_in[13].sensor_type, expected 71, is %d", check_msg->sol_in[13].sensor_type); - ck_assert_msg(check_msg->sol_in[14].flags == 85, "incorrect value for sol_in[14].flags, expected 85, is %d", check_msg->sol_in[14].flags); - ck_assert_msg(check_msg->sol_in[14].sensor_type == 182, "incorrect value for sol_in[14].sensor_type, expected 182, is %d", check_msg->sol_in[14].sensor_type); - ck_assert_msg(check_msg->sol_in[15].flags == 204, "incorrect value for sol_in[15].flags, expected 204, is %d", check_msg->sol_in[15].flags); - ck_assert_msg(check_msg->sol_in[15].sensor_type == 145, "incorrect value for sol_in[15].sensor_type, expected 145, is %d", check_msg->sol_in[15].sensor_type); - ck_assert_msg(check_msg->sol_in[16].flags == 40, "incorrect value for sol_in[16].flags, expected 40, is %d", check_msg->sol_in[16].flags); - ck_assert_msg(check_msg->sol_in[16].sensor_type == 146, "incorrect value for sol_in[16].sensor_type, expected 146, is %d", check_msg->sol_in[16].sensor_type); - ck_assert_msg(check_msg->sol_in[17].flags == 51, "incorrect value for sol_in[17].flags, expected 51, is %d", check_msg->sol_in[17].flags); - ck_assert_msg(check_msg->sol_in[17].sensor_type == 204, "incorrect value for sol_in[17].sensor_type, expected 204, is %d", check_msg->sol_in[17].sensor_type); - ck_assert_msg(check_msg->sol_in[18].flags == 153, "incorrect value for sol_in[18].flags, expected 153, is %d", check_msg->sol_in[18].flags); - ck_assert_msg(check_msg->sol_in[18].sensor_type == 21, "incorrect value for sol_in[18].sensor_type, expected 21, is %d", check_msg->sol_in[18].sensor_type); - ck_assert_msg(check_msg->sol_in[19].flags == 44, "incorrect value for sol_in[19].flags, expected 44, is %d", check_msg->sol_in[19].flags); - ck_assert_msg(check_msg->sol_in[19].sensor_type == 227, "incorrect value for sol_in[19].sensor_type, expected 227, is %d", check_msg->sol_in[19].sensor_type); - ck_assert_msg(check_msg->sol_in[20].flags == 28, "incorrect value for sol_in[20].flags, expected 28, is %d", check_msg->sol_in[20].flags); - ck_assert_msg(check_msg->sol_in[20].sensor_type == 15, "incorrect value for sol_in[20].sensor_type, expected 15, is %d", check_msg->sol_in[20].sensor_type); - ck_assert_msg(check_msg->sol_in[21].flags == 39, "incorrect value for sol_in[21].flags, expected 39, is %d", check_msg->sol_in[21].flags); - ck_assert_msg(check_msg->sol_in[21].sensor_type == 255, "incorrect value for sol_in[21].sensor_type, expected 255, is %d", check_msg->sol_in[21].sensor_type); - ck_assert_msg(check_msg->sol_in[22].flags == 216, "incorrect value for sol_in[22].flags, expected 216, is %d", check_msg->sol_in[22].flags); - ck_assert_msg(check_msg->sol_in[22].sensor_type == 205, "incorrect value for sol_in[22].sensor_type, expected 205, is %d", check_msg->sol_in[22].sensor_type); - ck_assert_msg(check_msg->sol_in[23].flags == 190, "incorrect value for sol_in[23].flags, expected 190, is %d", check_msg->sol_in[23].flags); - ck_assert_msg(check_msg->sol_in[23].sensor_type == 240, "incorrect value for sol_in[23].sensor_type, expected 240, is %d", check_msg->sol_in[23].sensor_type); - ck_assert_msg(check_msg->sol_in[24].flags == 219, "incorrect value for sol_in[24].flags, expected 219, is %d", check_msg->sol_in[24].flags); - ck_assert_msg(check_msg->sol_in[24].sensor_type == 93, "incorrect value for sol_in[24].sensor_type, expected 93, is %d", check_msg->sol_in[24].sensor_type); - ck_assert_msg(check_msg->sol_in[25].flags == 42, "incorrect value for sol_in[25].flags, expected 42, is %d", check_msg->sol_in[25].flags); - ck_assert_msg(check_msg->sol_in[25].sensor_type == 103, "incorrect value for sol_in[25].sensor_type, expected 103, is %d", check_msg->sol_in[25].sensor_type); - ck_assert_msg(check_msg->sol_in[26].flags == 182, "incorrect value for sol_in[26].flags, expected 182, is %d", check_msg->sol_in[26].flags); - ck_assert_msg(check_msg->sol_in[26].sensor_type == 41, "incorrect value for sol_in[26].sensor_type, expected 41, is %d", check_msg->sol_in[26].sensor_type); - ck_assert_msg(check_msg->sol_in[27].flags == 222, "incorrect value for sol_in[27].flags, expected 222, is %d", check_msg->sol_in[27].flags); - ck_assert_msg(check_msg->sol_in[27].sensor_type == 76, "incorrect value for sol_in[27].sensor_type, expected 76, is %d", check_msg->sol_in[27].sensor_type); - ck_assert_msg(check_msg->sol_in[28].flags == 23, "incorrect value for sol_in[28].flags, expected 23, is %d", check_msg->sol_in[28].flags); - ck_assert_msg(check_msg->sol_in[28].sensor_type == 17, "incorrect value for sol_in[28].sensor_type, expected 17, is %d", check_msg->sol_in[28].sensor_type); - ck_assert_msg(check_msg->sol_in[29].flags == 31, "incorrect value for sol_in[29].flags, expected 31, is %d", check_msg->sol_in[29].flags); - ck_assert_msg(check_msg->sol_in[29].sensor_type == 125, "incorrect value for sol_in[29].sensor_type, expected 125, is %d", check_msg->sol_in[29].sensor_type); - ck_assert_msg(check_msg->sol_in[30].flags == 229, "incorrect value for sol_in[30].flags, expected 229, is %d", check_msg->sol_in[30].flags); - ck_assert_msg(check_msg->sol_in[30].sensor_type == 18, "incorrect value for sol_in[30].sensor_type, expected 18, is %d", check_msg->sol_in[30].sensor_type); - ck_assert_msg(check_msg->sol_in[31].flags == 47, "incorrect value for sol_in[31].flags, expected 47, is %d", check_msg->sol_in[31].flags); - ck_assert_msg(check_msg->sol_in[31].sensor_type == 28, "incorrect value for sol_in[31].sensor_type, expected 28, is %d", check_msg->sol_in[31].sensor_type); - ck_assert_msg(check_msg->sol_in[32].flags == 25, "incorrect value for sol_in[32].flags, expected 25, is %d", check_msg->sol_in[32].flags); - ck_assert_msg(check_msg->sol_in[32].sensor_type == 214, "incorrect value for sol_in[32].sensor_type, expected 214, is %d", check_msg->sol_in[32].sensor_type); - ck_assert_msg(check_msg->sol_in[33].flags == 84, "incorrect value for sol_in[33].flags, expected 84, is %d", check_msg->sol_in[33].flags); - ck_assert_msg(check_msg->sol_in[33].sensor_type == 100, "incorrect value for sol_in[33].sensor_type, expected 100, is %d", check_msg->sol_in[33].sensor_type); - ck_assert_msg(check_msg->sol_in[34].flags == 72, "incorrect value for sol_in[34].flags, expected 72, is %d", check_msg->sol_in[34].flags); - ck_assert_msg(check_msg->sol_in[34].sensor_type == 106, "incorrect value for sol_in[34].sensor_type, expected 106, is %d", check_msg->sol_in[34].sensor_type); - ck_assert_msg(check_msg->sol_in[35].flags == 10, "incorrect value for sol_in[35].flags, expected 10, is %d", check_msg->sol_in[35].flags); - ck_assert_msg(check_msg->sol_in[35].sensor_type == 48, "incorrect value for sol_in[35].sensor_type, expected 48, is %d", check_msg->sol_in[35].sensor_type); - ck_assert_msg(check_msg->sol_in[36].flags == 232, "incorrect value for sol_in[36].flags, expected 232, is %d", check_msg->sol_in[36].flags); - ck_assert_msg(check_msg->sol_in[36].sensor_type == 222, "incorrect value for sol_in[36].sensor_type, expected 222, is %d", check_msg->sol_in[36].sensor_type); - ck_assert_msg(check_msg->sol_in[37].flags == 73, "incorrect value for sol_in[37].flags, expected 73, is %d", check_msg->sol_in[37].flags); - ck_assert_msg(check_msg->sol_in[37].sensor_type == 235, "incorrect value for sol_in[37].sensor_type, expected 235, is %d", check_msg->sol_in[37].sensor_type); - ck_assert_msg(check_msg->sol_in[38].flags == 163, "incorrect value for sol_in[38].flags, expected 163, is %d", check_msg->sol_in[38].flags); - ck_assert_msg(check_msg->sol_in[38].sensor_type == 109, "incorrect value for sol_in[38].sensor_type, expected 109, is %d", check_msg->sol_in[38].sensor_type); - ck_assert_msg(check_msg->sol_in[39].flags == 152, "incorrect value for sol_in[39].flags, expected 152, is %d", check_msg->sol_in[39].flags); - ck_assert_msg(check_msg->sol_in[39].sensor_type == 51, "incorrect value for sol_in[39].sensor_type, expected 51, is %d", check_msg->sol_in[39].sensor_type); - ck_assert_msg(check_msg->sol_in[40].flags == 235, "incorrect value for sol_in[40].flags, expected 235, is %d", check_msg->sol_in[40].flags); - ck_assert_msg(check_msg->sol_in[40].sensor_type == 133, "incorrect value for sol_in[40].sensor_type, expected 133, is %d", check_msg->sol_in[40].sensor_type); - ck_assert_msg(check_msg->sol_in[41].flags == 70, "incorrect value for sol_in[41].flags, expected 70, is %d", check_msg->sol_in[41].flags); - ck_assert_msg(check_msg->sol_in[41].sensor_type == 87, "incorrect value for sol_in[41].sensor_type, expected 87, is %d", check_msg->sol_in[41].sensor_type); - ck_assert_msg(check_msg->sol_in[42].flags == 108, "incorrect value for sol_in[42].flags, expected 108, is %d", check_msg->sol_in[42].flags); - ck_assert_msg(check_msg->sol_in[42].sensor_type == 2, "incorrect value for sol_in[42].sensor_type, expected 2, is %d", check_msg->sol_in[42].sensor_type); - ck_assert_msg(check_msg->sol_in[43].flags == 101, "incorrect value for sol_in[43].flags, expected 101, is %d", check_msg->sol_in[43].flags); - ck_assert_msg(check_msg->sol_in[43].sensor_type == 91, "incorrect value for sol_in[43].sensor_type, expected 91, is %d", check_msg->sol_in[43].sensor_type); - ck_assert_msg(check_msg->sol_in[44].flags == 55, "incorrect value for sol_in[44].flags, expected 55, is %d", check_msg->sol_in[44].flags); - ck_assert_msg(check_msg->sol_in[44].sensor_type == 200, "incorrect value for sol_in[44].sensor_type, expected 200, is %d", check_msg->sol_in[44].sensor_type); - ck_assert_msg(check_msg->sol_in[45].flags == 156, "incorrect value for sol_in[45].flags, expected 156, is %d", check_msg->sol_in[45].flags); - ck_assert_msg(check_msg->sol_in[45].sensor_type == 24, "incorrect value for sol_in[45].sensor_type, expected 24, is %d", check_msg->sol_in[45].sensor_type); - ck_assert_msg(check_msg->sol_in[46].flags == 73, "incorrect value for sol_in[46].flags, expected 73, is %d", check_msg->sol_in[46].flags); - ck_assert_msg(check_msg->sol_in[46].sensor_type == 233, "incorrect value for sol_in[46].sensor_type, expected 233, is %d", check_msg->sol_in[46].sensor_type); - ck_assert_msg(check_msg->sol_in[47].flags == 66, "incorrect value for sol_in[47].flags, expected 66, is %d", check_msg->sol_in[47].flags); - ck_assert_msg(check_msg->sol_in[47].sensor_type == 39, "incorrect value for sol_in[47].sensor_type, expected 39, is %d", check_msg->sol_in[47].sensor_type); - ck_assert_msg(check_msg->sol_in[48].flags == 140, "incorrect value for sol_in[48].flags, expected 140, is %d", check_msg->sol_in[48].flags); - ck_assert_msg(check_msg->sol_in[48].sensor_type == 97, "incorrect value for sol_in[48].sensor_type, expected 97, is %d", check_msg->sol_in[48].sensor_type); - ck_assert_msg(check_msg->sol_in[49].flags == 227, "incorrect value for sol_in[49].flags, expected 227, is %d", check_msg->sol_in[49].flags); - ck_assert_msg(check_msg->sol_in[49].sensor_type == 252, "incorrect value for sol_in[49].sensor_type, expected 252, is %d", check_msg->sol_in[49].sensor_type); - ck_assert_msg(check_msg->sol_in[50].flags == 237, "incorrect value for sol_in[50].flags, expected 237, is %d", check_msg->sol_in[50].flags); - ck_assert_msg(check_msg->sol_in[50].sensor_type == 230, "incorrect value for sol_in[50].sensor_type, expected 230, is %d", check_msg->sol_in[50].sensor_type); - ck_assert_msg(check_msg->sol_in[51].flags == 241, "incorrect value for sol_in[51].flags, expected 241, is %d", check_msg->sol_in[51].flags); - ck_assert_msg(check_msg->sol_in[51].sensor_type == 135, "incorrect value for sol_in[51].sensor_type, expected 135, is %d", check_msg->sol_in[51].sensor_type); - ck_assert_msg(check_msg->sol_in[52].flags == 205, "incorrect value for sol_in[52].flags, expected 205, is %d", check_msg->sol_in[52].flags); - ck_assert_msg(check_msg->sol_in[52].sensor_type == 245, "incorrect value for sol_in[52].sensor_type, expected 245, is %d", check_msg->sol_in[52].sensor_type); - ck_assert_msg(check_msg->sol_in[53].flags == 0, "incorrect value for sol_in[53].flags, expected 0, is %d", check_msg->sol_in[53].flags); - ck_assert_msg(check_msg->sol_in[53].sensor_type == 70, "incorrect value for sol_in[53].sensor_type, expected 70, is %d", check_msg->sol_in[53].sensor_type); - ck_assert_msg(check_msg->sol_in[54].flags == 188, "incorrect value for sol_in[54].flags, expected 188, is %d", check_msg->sol_in[54].flags); - ck_assert_msg(check_msg->sol_in[54].sensor_type == 219, "incorrect value for sol_in[54].sensor_type, expected 219, is %d", check_msg->sol_in[54].sensor_type); - ck_assert_msg(check_msg->sol_in[55].flags == 136, "incorrect value for sol_in[55].flags, expected 136, is %d", check_msg->sol_in[55].flags); - ck_assert_msg(check_msg->sol_in[55].sensor_type == 107, "incorrect value for sol_in[55].sensor_type, expected 107, is %d", check_msg->sol_in[55].sensor_type); - ck_assert_msg(check_msg->sol_in[56].flags == 58, "incorrect value for sol_in[56].flags, expected 58, is %d", check_msg->sol_in[56].flags); - ck_assert_msg(check_msg->sol_in[56].sensor_type == 178, "incorrect value for sol_in[56].sensor_type, expected 178, is %d", check_msg->sol_in[56].sensor_type); - ck_assert_msg(check_msg->sol_in[57].flags == 29, "incorrect value for sol_in[57].flags, expected 29, is %d", check_msg->sol_in[57].flags); - ck_assert_msg(check_msg->sol_in[57].sensor_type == 1, "incorrect value for sol_in[57].sensor_type, expected 1, is %d", check_msg->sol_in[57].sensor_type); - ck_assert_msg(check_msg->sol_in[58].flags == 213, "incorrect value for sol_in[58].flags, expected 213, is %d", check_msg->sol_in[58].flags); - ck_assert_msg(check_msg->sol_in[58].sensor_type == 44, "incorrect value for sol_in[58].sensor_type, expected 44, is %d", check_msg->sol_in[58].sensor_type); - ck_assert_msg(check_msg->sol_in[59].flags == 147, "incorrect value for sol_in[59].flags, expected 147, is %d", check_msg->sol_in[59].flags); - ck_assert_msg(check_msg->sol_in[59].sensor_type == 225, "incorrect value for sol_in[59].sensor_type, expected 225, is %d", check_msg->sol_in[59].sensor_type); - ck_assert_msg(check_msg->sol_in[60].flags == 96, "incorrect value for sol_in[60].flags, expected 96, is %d", check_msg->sol_in[60].flags); - ck_assert_msg(check_msg->sol_in[60].sensor_type == 190, "incorrect value for sol_in[60].sensor_type, expected 190, is %d", check_msg->sol_in[60].sensor_type); - ck_assert_msg(check_msg->sol_in[61].flags == 108, "incorrect value for sol_in[61].flags, expected 108, is %d", check_msg->sol_in[61].flags); - ck_assert_msg(check_msg->sol_in[61].sensor_type == 192, "incorrect value for sol_in[61].sensor_type, expected 192, is %d", check_msg->sol_in[61].sensor_type); - ck_assert_msg(check_msg->sol_in[62].flags == 15, "incorrect value for sol_in[62].flags, expected 15, is %d", check_msg->sol_in[62].flags); - ck_assert_msg(check_msg->sol_in[62].sensor_type == 228, "incorrect value for sol_in[62].sensor_type, expected 228, is %d", check_msg->sol_in[62].sensor_type); - ck_assert_msg(check_msg->sol_in[63].flags == 18, "incorrect value for sol_in[63].flags, expected 18, is %d", check_msg->sol_in[63].flags); - ck_assert_msg(check_msg->sol_in[63].sensor_type == 203, "incorrect value for sol_in[63].sensor_type, expected 203, is %d", check_msg->sol_in[63].sensor_type); - ck_assert_msg(check_msg->sol_in[64].flags == 222, "incorrect value for sol_in[64].flags, expected 222, is %d", check_msg->sol_in[64].flags); - ck_assert_msg(check_msg->sol_in[64].sensor_type == 3, "incorrect value for sol_in[64].sensor_type, expected 3, is %d", check_msg->sol_in[64].sensor_type); - ck_assert_msg(check_msg->sol_in[65].flags == 68, "incorrect value for sol_in[65].flags, expected 68, is %d", check_msg->sol_in[65].flags); - ck_assert_msg(check_msg->sol_in[65].sensor_type == 180, "incorrect value for sol_in[65].sensor_type, expected 180, is %d", check_msg->sol_in[65].sensor_type); - ck_assert_msg(check_msg->sol_in[66].flags == 229, "incorrect value for sol_in[66].flags, expected 229, is %d", check_msg->sol_in[66].flags); - ck_assert_msg(check_msg->sol_in[66].sensor_type == 101, "incorrect value for sol_in[66].sensor_type, expected 101, is %d", check_msg->sol_in[66].sensor_type); - ck_assert_msg(check_msg->sol_in[67].flags == 203, "incorrect value for sol_in[67].flags, expected 203, is %d", check_msg->sol_in[67].flags); - ck_assert_msg(check_msg->sol_in[67].sensor_type == 223, "incorrect value for sol_in[67].sensor_type, expected 223, is %d", check_msg->sol_in[67].sensor_type); - ck_assert_msg(check_msg->sol_in[68].flags == 164, "incorrect value for sol_in[68].flags, expected 164, is %d", check_msg->sol_in[68].flags); - ck_assert_msg(check_msg->sol_in[68].sensor_type == 243, "incorrect value for sol_in[68].sensor_type, expected 243, is %d", check_msg->sol_in[68].sensor_type); - ck_assert_msg(check_msg->sol_in[69].flags == 165, "incorrect value for sol_in[69].flags, expected 165, is %d", check_msg->sol_in[69].flags); - ck_assert_msg(check_msg->sol_in[69].sensor_type == 92, "incorrect value for sol_in[69].sensor_type, expected 92, is %d", check_msg->sol_in[69].sensor_type); - ck_assert_msg(check_msg->sol_in[70].flags == 159, "incorrect value for sol_in[70].flags, expected 159, is %d", check_msg->sol_in[70].flags); - ck_assert_msg(check_msg->sol_in[70].sensor_type == 220, "incorrect value for sol_in[70].sensor_type, expected 220, is %d", check_msg->sol_in[70].sensor_type); - ck_assert_msg(check_msg->sol_in[71].flags == 121, "incorrect value for sol_in[71].flags, expected 121, is %d", check_msg->sol_in[71].flags); - ck_assert_msg(check_msg->sol_in[71].sensor_type == 174, "incorrect value for sol_in[71].sensor_type, expected 174, is %d", check_msg->sol_in[71].sensor_type); - ck_assert_msg(check_msg->sol_in[72].flags == 167, "incorrect value for sol_in[72].flags, expected 167, is %d", check_msg->sol_in[72].flags); - ck_assert_msg(check_msg->sol_in[72].sensor_type == 112, "incorrect value for sol_in[72].sensor_type, expected 112, is %d", check_msg->sol_in[72].sensor_type); - ck_assert_msg(check_msg->sol_in[73].flags == 40, "incorrect value for sol_in[73].flags, expected 40, is %d", check_msg->sol_in[73].flags); - ck_assert_msg(check_msg->sol_in[73].sensor_type == 240, "incorrect value for sol_in[73].sensor_type, expected 240, is %d", check_msg->sol_in[73].sensor_type); - ck_assert_msg(check_msg->sol_in[74].flags == 3, "incorrect value for sol_in[74].flags, expected 3, is %d", check_msg->sol_in[74].flags); - ck_assert_msg(check_msg->sol_in[74].sensor_type == 59, "incorrect value for sol_in[74].sensor_type, expected 59, is %d", check_msg->sol_in[74].sensor_type); - ck_assert_msg(check_msg->sol_in[75].flags == 52, "incorrect value for sol_in[75].flags, expected 52, is %d", check_msg->sol_in[75].flags); - ck_assert_msg(check_msg->sol_in[75].sensor_type == 230, "incorrect value for sol_in[75].sensor_type, expected 230, is %d", check_msg->sol_in[75].sensor_type); - ck_assert_msg(check_msg->sol_in[76].flags == 148, "incorrect value for sol_in[76].flags, expected 148, is %d", check_msg->sol_in[76].flags); - ck_assert_msg(check_msg->sol_in[76].sensor_type == 149, "incorrect value for sol_in[76].sensor_type, expected 149, is %d", check_msg->sol_in[76].sensor_type); - ck_assert_msg(check_msg->sol_in[77].flags == 142, "incorrect value for sol_in[77].flags, expected 142, is %d", check_msg->sol_in[77].flags); - ck_assert_msg(check_msg->sol_in[77].sensor_type == 218, "incorrect value for sol_in[77].sensor_type, expected 218, is %d", check_msg->sol_in[77].sensor_type); - ck_assert_msg(check_msg->sol_in[78].flags == 109, "incorrect value for sol_in[78].flags, expected 109, is %d", check_msg->sol_in[78].flags); - ck_assert_msg(check_msg->sol_in[78].sensor_type == 212, "incorrect value for sol_in[78].sensor_type, expected 212, is %d", check_msg->sol_in[78].sensor_type); - ck_assert_msg(check_msg->sol_in[79].flags == 71, "incorrect value for sol_in[79].flags, expected 71, is %d", check_msg->sol_in[79].flags); - ck_assert_msg(check_msg->sol_in[79].sensor_type == 176, "incorrect value for sol_in[79].sensor_type, expected 176, is %d", check_msg->sol_in[79].sensor_type); - ck_assert_msg(check_msg->sol_in[80].flags == 172, "incorrect value for sol_in[80].flags, expected 172, is %d", check_msg->sol_in[80].flags); - ck_assert_msg(check_msg->sol_in[80].sensor_type == 179, "incorrect value for sol_in[80].sensor_type, expected 179, is %d", check_msg->sol_in[80].sensor_type); - ck_assert_msg(check_msg->sol_in[81].flags == 1, "incorrect value for sol_in[81].flags, expected 1, is %d", check_msg->sol_in[81].flags); - ck_assert_msg(check_msg->sol_in[81].sensor_type == 77, "incorrect value for sol_in[81].sensor_type, expected 77, is %d", check_msg->sol_in[81].sensor_type); - ck_assert_msg(check_msg->sol_in[82].flags == 70, "incorrect value for sol_in[82].flags, expected 70, is %d", check_msg->sol_in[82].flags); - ck_assert_msg(check_msg->sol_in[82].sensor_type == 193, "incorrect value for sol_in[82].sensor_type, expected 193, is %d", check_msg->sol_in[82].sensor_type); - ck_assert_msg(check_msg->sol_in[83].flags == 149, "incorrect value for sol_in[83].flags, expected 149, is %d", check_msg->sol_in[83].flags); - ck_assert_msg(check_msg->sol_in[83].sensor_type == 147, "incorrect value for sol_in[83].sensor_type, expected 147, is %d", check_msg->sol_in[83].sensor_type); - ck_assert_msg(check_msg->sol_in[84].flags == 144, "incorrect value for sol_in[84].flags, expected 144, is %d", check_msg->sol_in[84].flags); - ck_assert_msg(check_msg->sol_in[84].sensor_type == 23, "incorrect value for sol_in[84].sensor_type, expected 23, is %d", check_msg->sol_in[84].sensor_type); - ck_assert_msg(check_msg->sol_in[85].flags == 239, "incorrect value for sol_in[85].flags, expected 239, is %d", check_msg->sol_in[85].flags); - ck_assert_msg(check_msg->sol_in[85].sensor_type == 148, "incorrect value for sol_in[85].sensor_type, expected 148, is %d", check_msg->sol_in[85].sensor_type); - ck_assert_msg(check_msg->sol_in[86].flags == 186, "incorrect value for sol_in[86].flags, expected 186, is %d", check_msg->sol_in[86].flags); - ck_assert_msg(check_msg->sol_in[86].sensor_type == 195, "incorrect value for sol_in[86].sensor_type, expected 195, is %d", check_msg->sol_in[86].sensor_type); - ck_assert_msg(check_msg->sol_in[87].flags == 30, "incorrect value for sol_in[87].flags, expected 30, is %d", check_msg->sol_in[87].flags); - ck_assert_msg(check_msg->sol_in[87].sensor_type == 86, "incorrect value for sol_in[87].sensor_type, expected 86, is %d", check_msg->sol_in[87].sensor_type); - ck_assert_msg(check_msg->sol_in[88].flags == 143, "incorrect value for sol_in[88].flags, expected 143, is %d", check_msg->sol_in[88].flags); - ck_assert_msg(check_msg->sol_in[88].sensor_type == 34, "incorrect value for sol_in[88].sensor_type, expected 34, is %d", check_msg->sol_in[88].sensor_type); - ck_assert_msg(check_msg->sol_in[89].flags == 207, "incorrect value for sol_in[89].flags, expected 207, is %d", check_msg->sol_in[89].flags); - ck_assert_msg(check_msg->sol_in[89].sensor_type == 156, "incorrect value for sol_in[89].sensor_type, expected 156, is %d", check_msg->sol_in[89].sensor_type); - ck_assert_msg(check_msg->sol_in[90].flags == 55, "incorrect value for sol_in[90].flags, expected 55, is %d", check_msg->sol_in[90].flags); - ck_assert_msg(check_msg->sol_in[90].sensor_type == 63, "incorrect value for sol_in[90].sensor_type, expected 63, is %d", check_msg->sol_in[90].sensor_type); - ck_assert_msg(check_msg->sol_in[91].flags == 255, "incorrect value for sol_in[91].flags, expected 255, is %d", check_msg->sol_in[91].flags); - ck_assert_msg(check_msg->sol_in[91].sensor_type == 117, "incorrect value for sol_in[91].sensor_type, expected 117, is %d", check_msg->sol_in[91].sensor_type); - ck_assert_msg(check_msg->sol_in[92].flags == 222, "incorrect value for sol_in[92].flags, expected 222, is %d", check_msg->sol_in[92].flags); - ck_assert_msg(check_msg->sol_in[92].sensor_type == 222, "incorrect value for sol_in[92].sensor_type, expected 222, is %d", check_msg->sol_in[92].sensor_type); - ck_assert_msg(check_msg->sol_in[93].flags == 145, "incorrect value for sol_in[93].flags, expected 145, is %d", check_msg->sol_in[93].flags); - ck_assert_msg(check_msg->sol_in[93].sensor_type == 219, "incorrect value for sol_in[93].sensor_type, expected 219, is %d", check_msg->sol_in[93].sensor_type); - ck_assert_msg(check_msg->sol_in[94].flags == 191, "incorrect value for sol_in[94].flags, expected 191, is %d", check_msg->sol_in[94].flags); - ck_assert_msg(check_msg->sol_in[94].sensor_type == 224, "incorrect value for sol_in[94].sensor_type, expected 224, is %d", check_msg->sol_in[94].sensor_type); - ck_assert_msg(check_msg->sol_in[95].flags == 109, "incorrect value for sol_in[95].flags, expected 109, is %d", check_msg->sol_in[95].flags); - ck_assert_msg(check_msg->sol_in[95].sensor_type == 210, "incorrect value for sol_in[95].sensor_type, expected 210, is %d", check_msg->sol_in[95].sensor_type); - ck_assert_msg(check_msg->sol_in[96].flags == 153, "incorrect value for sol_in[96].flags, expected 153, is %d", check_msg->sol_in[96].flags); - ck_assert_msg(check_msg->sol_in[96].sensor_type == 86, "incorrect value for sol_in[96].sensor_type, expected 86, is %d", check_msg->sol_in[96].sensor_type); - ck_assert_msg(check_msg->sol_in[97].flags == 32, "incorrect value for sol_in[97].flags, expected 32, is %d", check_msg->sol_in[97].flags); - ck_assert_msg(check_msg->sol_in[97].sensor_type == 21, "incorrect value for sol_in[97].sensor_type, expected 21, is %d", check_msg->sol_in[97].sensor_type); - ck_assert_msg(check_msg->sol_in[98].flags == 10, "incorrect value for sol_in[98].flags, expected 10, is %d", check_msg->sol_in[98].flags); - ck_assert_msg(check_msg->sol_in[98].sensor_type == 226, "incorrect value for sol_in[98].sensor_type, expected 226, is %d", check_msg->sol_in[98].sensor_type); - ck_assert_msg(check_msg->sol_in[99].flags == 63, "incorrect value for sol_in[99].flags, expected 63, is %d", check_msg->sol_in[99].flags); - ck_assert_msg(check_msg->sol_in[99].sensor_type == 60, "incorrect value for sol_in[99].sensor_type, expected 60, is %d", check_msg->sol_in[99].sensor_type); - ck_assert_msg(check_msg->sol_in[100].flags == 236, "incorrect value for sol_in[100].flags, expected 236, is %d", check_msg->sol_in[100].flags); - ck_assert_msg(check_msg->sol_in[100].sensor_type == 106, "incorrect value for sol_in[100].sensor_type, expected 106, is %d", check_msg->sol_in[100].sensor_type); - ck_assert_msg(check_msg->sol_in[101].flags == 96, "incorrect value for sol_in[101].flags, expected 96, is %d", check_msg->sol_in[101].flags); - ck_assert_msg(check_msg->sol_in[101].sensor_type == 93, "incorrect value for sol_in[101].sensor_type, expected 93, is %d", check_msg->sol_in[101].sensor_type); - ck_assert_msg(check_msg->sol_in[102].flags == 163, "incorrect value for sol_in[102].flags, expected 163, is %d", check_msg->sol_in[102].flags); - ck_assert_msg(check_msg->sol_in[102].sensor_type == 30, "incorrect value for sol_in[102].sensor_type, expected 30, is %d", check_msg->sol_in[102].sensor_type); - ck_assert_msg(check_msg->sol_in[103].flags == 238, "incorrect value for sol_in[103].flags, expected 238, is %d", check_msg->sol_in[103].flags); - ck_assert_msg(check_msg->sol_in[103].sensor_type == 106, "incorrect value for sol_in[103].sensor_type, expected 106, is %d", check_msg->sol_in[103].sensor_type); - ck_assert_msg(check_msg->sol_in[104].flags == 133, "incorrect value for sol_in[104].flags, expected 133, is %d", check_msg->sol_in[104].flags); - ck_assert_msg(check_msg->sol_in[104].sensor_type == 147, "incorrect value for sol_in[104].sensor_type, expected 147, is %d", check_msg->sol_in[104].sensor_type); - ck_assert_msg(check_msg->sol_in[105].flags == 107, "incorrect value for sol_in[105].flags, expected 107, is %d", check_msg->sol_in[105].flags); - ck_assert_msg(check_msg->sol_in[105].sensor_type == 132, "incorrect value for sol_in[105].sensor_type, expected 132, is %d", check_msg->sol_in[105].sensor_type); - ck_assert_msg(check_msg->sol_in[106].flags == 214, "incorrect value for sol_in[106].flags, expected 214, is %d", check_msg->sol_in[106].flags); - ck_assert_msg(check_msg->sol_in[106].sensor_type == 152, "incorrect value for sol_in[106].sensor_type, expected 152, is %d", check_msg->sol_in[106].sensor_type); - ck_assert_msg(check_msg->sol_in[107].flags == 185, "incorrect value for sol_in[107].flags, expected 185, is %d", check_msg->sol_in[107].flags); - ck_assert_msg(check_msg->sol_in[107].sensor_type == 221, "incorrect value for sol_in[107].sensor_type, expected 221, is %d", check_msg->sol_in[107].sensor_type); - ck_assert_msg(check_msg->sol_in[108].flags == 21, "incorrect value for sol_in[108].flags, expected 21, is %d", check_msg->sol_in[108].flags); - ck_assert_msg(check_msg->sol_in[108].sensor_type == 202, "incorrect value for sol_in[108].sensor_type, expected 202, is %d", check_msg->sol_in[108].sensor_type); - ck_assert_msg(check_msg->sol_in[109].flags == 51, "incorrect value for sol_in[109].flags, expected 51, is %d", check_msg->sol_in[109].flags); - ck_assert_msg(check_msg->sol_in[109].sensor_type == 252, "incorrect value for sol_in[109].sensor_type, expected 252, is %d", check_msg->sol_in[109].sensor_type); - ck_assert_msg(check_msg->sol_in[110].flags == 59, "incorrect value for sol_in[110].flags, expected 59, is %d", check_msg->sol_in[110].flags); - ck_assert_msg(check_msg->sol_in[110].sensor_type == 130, "incorrect value for sol_in[110].sensor_type, expected 130, is %d", check_msg->sol_in[110].sensor_type); - ck_assert_msg(check_msg->sol_in[111].flags == 202, "incorrect value for sol_in[111].flags, expected 202, is %d", check_msg->sol_in[111].flags); - ck_assert_msg(check_msg->sol_in[111].sensor_type == 166, "incorrect value for sol_in[111].sensor_type, expected 166, is %d", check_msg->sol_in[111].sensor_type); - ck_assert_msg(check_msg->sol_in[112].flags == 170, "incorrect value for sol_in[112].flags, expected 170, is %d", check_msg->sol_in[112].flags); - ck_assert_msg(check_msg->sol_in[112].sensor_type == 127, "incorrect value for sol_in[112].sensor_type, expected 127, is %d", check_msg->sol_in[112].sensor_type); - ck_assert_msg(check_msg->sol_in[113].flags == 193, "incorrect value for sol_in[113].flags, expected 193, is %d", check_msg->sol_in[113].flags); - ck_assert_msg(check_msg->sol_in[113].sensor_type == 58, "incorrect value for sol_in[113].sensor_type, expected 58, is %d", check_msg->sol_in[113].sensor_type); - ck_assert_msg(check_msg->sol_in[114].flags == 125, "incorrect value for sol_in[114].flags, expected 125, is %d", check_msg->sol_in[114].flags); - ck_assert_msg(check_msg->sol_in[114].sensor_type == 215, "incorrect value for sol_in[114].sensor_type, expected 215, is %d", check_msg->sol_in[114].sensor_type); - ck_assert_msg(check_msg->sol_in[115].flags == 58, "incorrect value for sol_in[115].flags, expected 58, is %d", check_msg->sol_in[115].flags); - ck_assert_msg(check_msg->sol_in[115].sensor_type == 22, "incorrect value for sol_in[115].sensor_type, expected 22, is %d", check_msg->sol_in[115].sensor_type); - ck_assert_msg(check_msg->sol_in[116].flags == 47, "incorrect value for sol_in[116].flags, expected 47, is %d", check_msg->sol_in[116].flags); - ck_assert_msg(check_msg->sol_in[116].sensor_type == 135, "incorrect value for sol_in[116].sensor_type, expected 135, is %d", check_msg->sol_in[116].sensor_type); - ck_assert_msg(check_msg->sol_in[117].flags == 142, "incorrect value for sol_in[117].flags, expected 142, is %d", check_msg->sol_in[117].flags); - ck_assert_msg(check_msg->sol_in[117].sensor_type == 88, "incorrect value for sol_in[117].sensor_type, expected 88, is %d", check_msg->sol_in[117].sensor_type); - ck_assert_msg(check_msg->vdop == 41989, "incorrect value for vdop, expected 41989, is %d", check_msg->vdop); + ck_assert_msg(check_msg->age_corrections == 48671, + "incorrect value for age_corrections, expected 48671, is %d", + check_msg->age_corrections); + ck_assert_msg(check_msg->alignment_status == 115, + "incorrect value for alignment_status, expected 115, is %d", + check_msg->alignment_status); + ck_assert_msg(check_msg->hdop == 31133, + "incorrect value for hdop, expected 31133, is %d", + check_msg->hdop); + ck_assert_msg( + check_msg->last_used_gnss_pos_tow == 610745181, + "incorrect value for last_used_gnss_pos_tow, expected 610745181, is %d", + check_msg->last_used_gnss_pos_tow); + ck_assert_msg( + check_msg->last_used_gnss_vel_tow == 782016851, + "incorrect value for last_used_gnss_vel_tow, expected 782016851, is %d", + check_msg->last_used_gnss_vel_tow); + ck_assert_msg(check_msg->n_sats == 238, + "incorrect value for n_sats, expected 238, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->pdop == 57015, + "incorrect value for pdop, expected 57015, is %d", + check_msg->pdop); + ck_assert_msg(check_msg->sol_in[0].flags == 67, + "incorrect value for sol_in[0].flags, expected 67, is %d", + check_msg->sol_in[0].flags); + ck_assert_msg( + check_msg->sol_in[0].sensor_type == 253, + "incorrect value for sol_in[0].sensor_type, expected 253, is %d", + check_msg->sol_in[0].sensor_type); + ck_assert_msg(check_msg->sol_in[1].flags == 200, + "incorrect value for sol_in[1].flags, expected 200, is %d", + check_msg->sol_in[1].flags); + ck_assert_msg( + check_msg->sol_in[1].sensor_type == 87, + "incorrect value for sol_in[1].sensor_type, expected 87, is %d", + check_msg->sol_in[1].sensor_type); + ck_assert_msg(check_msg->sol_in[2].flags == 250, + "incorrect value for sol_in[2].flags, expected 250, is %d", + check_msg->sol_in[2].flags); + ck_assert_msg( + check_msg->sol_in[2].sensor_type == 39, + "incorrect value for sol_in[2].sensor_type, expected 39, is %d", + check_msg->sol_in[2].sensor_type); + ck_assert_msg(check_msg->sol_in[3].flags == 242, + "incorrect value for sol_in[3].flags, expected 242, is %d", + check_msg->sol_in[3].flags); + ck_assert_msg( + check_msg->sol_in[3].sensor_type == 245, + "incorrect value for sol_in[3].sensor_type, expected 245, is %d", + check_msg->sol_in[3].sensor_type); + ck_assert_msg(check_msg->sol_in[4].flags == 72, + "incorrect value for sol_in[4].flags, expected 72, is %d", + check_msg->sol_in[4].flags); + ck_assert_msg( + check_msg->sol_in[4].sensor_type == 228, + "incorrect value for sol_in[4].sensor_type, expected 228, is %d", + check_msg->sol_in[4].sensor_type); + ck_assert_msg(check_msg->sol_in[5].flags == 222, + "incorrect value for sol_in[5].flags, expected 222, is %d", + check_msg->sol_in[5].flags); + ck_assert_msg( + check_msg->sol_in[5].sensor_type == 18, + "incorrect value for sol_in[5].sensor_type, expected 18, is %d", + check_msg->sol_in[5].sensor_type); + ck_assert_msg(check_msg->sol_in[6].flags == 88, + "incorrect value for sol_in[6].flags, expected 88, is %d", + check_msg->sol_in[6].flags); + ck_assert_msg( + check_msg->sol_in[6].sensor_type == 11, + "incorrect value for sol_in[6].sensor_type, expected 11, is %d", + check_msg->sol_in[6].sensor_type); + ck_assert_msg(check_msg->sol_in[7].flags == 218, + "incorrect value for sol_in[7].flags, expected 218, is %d", + check_msg->sol_in[7].flags); + ck_assert_msg( + check_msg->sol_in[7].sensor_type == 207, + "incorrect value for sol_in[7].sensor_type, expected 207, is %d", + check_msg->sol_in[7].sensor_type); + ck_assert_msg(check_msg->sol_in[8].flags == 13, + "incorrect value for sol_in[8].flags, expected 13, is %d", + check_msg->sol_in[8].flags); + ck_assert_msg( + check_msg->sol_in[8].sensor_type == 231, + "incorrect value for sol_in[8].sensor_type, expected 231, is %d", + check_msg->sol_in[8].sensor_type); + ck_assert_msg(check_msg->sol_in[9].flags == 224, + "incorrect value for sol_in[9].flags, expected 224, is %d", + check_msg->sol_in[9].flags); + ck_assert_msg( + check_msg->sol_in[9].sensor_type == 226, + "incorrect value for sol_in[9].sensor_type, expected 226, is %d", + check_msg->sol_in[9].sensor_type); + ck_assert_msg(check_msg->sol_in[10].flags == 196, + "incorrect value for sol_in[10].flags, expected 196, is %d", + check_msg->sol_in[10].flags); + ck_assert_msg( + check_msg->sol_in[10].sensor_type == 22, + "incorrect value for sol_in[10].sensor_type, expected 22, is %d", + check_msg->sol_in[10].sensor_type); + ck_assert_msg(check_msg->sol_in[11].flags == 242, + "incorrect value for sol_in[11].flags, expected 242, is %d", + check_msg->sol_in[11].flags); + ck_assert_msg( + check_msg->sol_in[11].sensor_type == 21, + "incorrect value for sol_in[11].sensor_type, expected 21, is %d", + check_msg->sol_in[11].sensor_type); + ck_assert_msg(check_msg->sol_in[12].flags == 89, + "incorrect value for sol_in[12].flags, expected 89, is %d", + check_msg->sol_in[12].flags); + ck_assert_msg( + check_msg->sol_in[12].sensor_type == 12, + "incorrect value for sol_in[12].sensor_type, expected 12, is %d", + check_msg->sol_in[12].sensor_type); + ck_assert_msg(check_msg->sol_in[13].flags == 219, + "incorrect value for sol_in[13].flags, expected 219, is %d", + check_msg->sol_in[13].flags); + ck_assert_msg( + check_msg->sol_in[13].sensor_type == 71, + "incorrect value for sol_in[13].sensor_type, expected 71, is %d", + check_msg->sol_in[13].sensor_type); + ck_assert_msg(check_msg->sol_in[14].flags == 85, + "incorrect value for sol_in[14].flags, expected 85, is %d", + check_msg->sol_in[14].flags); + ck_assert_msg( + check_msg->sol_in[14].sensor_type == 182, + "incorrect value for sol_in[14].sensor_type, expected 182, is %d", + check_msg->sol_in[14].sensor_type); + ck_assert_msg(check_msg->sol_in[15].flags == 204, + "incorrect value for sol_in[15].flags, expected 204, is %d", + check_msg->sol_in[15].flags); + ck_assert_msg( + check_msg->sol_in[15].sensor_type == 145, + "incorrect value for sol_in[15].sensor_type, expected 145, is %d", + check_msg->sol_in[15].sensor_type); + ck_assert_msg(check_msg->sol_in[16].flags == 40, + "incorrect value for sol_in[16].flags, expected 40, is %d", + check_msg->sol_in[16].flags); + ck_assert_msg( + check_msg->sol_in[16].sensor_type == 146, + "incorrect value for sol_in[16].sensor_type, expected 146, is %d", + check_msg->sol_in[16].sensor_type); + ck_assert_msg(check_msg->sol_in[17].flags == 51, + "incorrect value for sol_in[17].flags, expected 51, is %d", + check_msg->sol_in[17].flags); + ck_assert_msg( + check_msg->sol_in[17].sensor_type == 204, + "incorrect value for sol_in[17].sensor_type, expected 204, is %d", + check_msg->sol_in[17].sensor_type); + ck_assert_msg(check_msg->sol_in[18].flags == 153, + "incorrect value for sol_in[18].flags, expected 153, is %d", + check_msg->sol_in[18].flags); + ck_assert_msg( + check_msg->sol_in[18].sensor_type == 21, + "incorrect value for sol_in[18].sensor_type, expected 21, is %d", + check_msg->sol_in[18].sensor_type); + ck_assert_msg(check_msg->sol_in[19].flags == 44, + "incorrect value for sol_in[19].flags, expected 44, is %d", + check_msg->sol_in[19].flags); + ck_assert_msg( + check_msg->sol_in[19].sensor_type == 227, + "incorrect value for sol_in[19].sensor_type, expected 227, is %d", + check_msg->sol_in[19].sensor_type); + ck_assert_msg(check_msg->sol_in[20].flags == 28, + "incorrect value for sol_in[20].flags, expected 28, is %d", + check_msg->sol_in[20].flags); + ck_assert_msg( + check_msg->sol_in[20].sensor_type == 15, + "incorrect value for sol_in[20].sensor_type, expected 15, is %d", + check_msg->sol_in[20].sensor_type); + ck_assert_msg(check_msg->sol_in[21].flags == 39, + "incorrect value for sol_in[21].flags, expected 39, is %d", + check_msg->sol_in[21].flags); + ck_assert_msg( + check_msg->sol_in[21].sensor_type == 255, + "incorrect value for sol_in[21].sensor_type, expected 255, is %d", + check_msg->sol_in[21].sensor_type); + ck_assert_msg(check_msg->sol_in[22].flags == 216, + "incorrect value for sol_in[22].flags, expected 216, is %d", + check_msg->sol_in[22].flags); + ck_assert_msg( + check_msg->sol_in[22].sensor_type == 205, + "incorrect value for sol_in[22].sensor_type, expected 205, is %d", + check_msg->sol_in[22].sensor_type); + ck_assert_msg(check_msg->sol_in[23].flags == 190, + "incorrect value for sol_in[23].flags, expected 190, is %d", + check_msg->sol_in[23].flags); + ck_assert_msg( + check_msg->sol_in[23].sensor_type == 240, + "incorrect value for sol_in[23].sensor_type, expected 240, is %d", + check_msg->sol_in[23].sensor_type); + ck_assert_msg(check_msg->sol_in[24].flags == 219, + "incorrect value for sol_in[24].flags, expected 219, is %d", + check_msg->sol_in[24].flags); + ck_assert_msg( + check_msg->sol_in[24].sensor_type == 93, + "incorrect value for sol_in[24].sensor_type, expected 93, is %d", + check_msg->sol_in[24].sensor_type); + ck_assert_msg(check_msg->sol_in[25].flags == 42, + "incorrect value for sol_in[25].flags, expected 42, is %d", + check_msg->sol_in[25].flags); + ck_assert_msg( + check_msg->sol_in[25].sensor_type == 103, + "incorrect value for sol_in[25].sensor_type, expected 103, is %d", + check_msg->sol_in[25].sensor_type); + ck_assert_msg(check_msg->sol_in[26].flags == 182, + "incorrect value for sol_in[26].flags, expected 182, is %d", + check_msg->sol_in[26].flags); + ck_assert_msg( + check_msg->sol_in[26].sensor_type == 41, + "incorrect value for sol_in[26].sensor_type, expected 41, is %d", + check_msg->sol_in[26].sensor_type); + ck_assert_msg(check_msg->sol_in[27].flags == 222, + "incorrect value for sol_in[27].flags, expected 222, is %d", + check_msg->sol_in[27].flags); + ck_assert_msg( + check_msg->sol_in[27].sensor_type == 76, + "incorrect value for sol_in[27].sensor_type, expected 76, is %d", + check_msg->sol_in[27].sensor_type); + ck_assert_msg(check_msg->sol_in[28].flags == 23, + "incorrect value for sol_in[28].flags, expected 23, is %d", + check_msg->sol_in[28].flags); + ck_assert_msg( + check_msg->sol_in[28].sensor_type == 17, + "incorrect value for sol_in[28].sensor_type, expected 17, is %d", + check_msg->sol_in[28].sensor_type); + ck_assert_msg(check_msg->sol_in[29].flags == 31, + "incorrect value for sol_in[29].flags, expected 31, is %d", + check_msg->sol_in[29].flags); + ck_assert_msg( + check_msg->sol_in[29].sensor_type == 125, + "incorrect value for sol_in[29].sensor_type, expected 125, is %d", + check_msg->sol_in[29].sensor_type); + ck_assert_msg(check_msg->sol_in[30].flags == 229, + "incorrect value for sol_in[30].flags, expected 229, is %d", + check_msg->sol_in[30].flags); + ck_assert_msg( + check_msg->sol_in[30].sensor_type == 18, + "incorrect value for sol_in[30].sensor_type, expected 18, is %d", + check_msg->sol_in[30].sensor_type); + ck_assert_msg(check_msg->sol_in[31].flags == 47, + "incorrect value for sol_in[31].flags, expected 47, is %d", + check_msg->sol_in[31].flags); + ck_assert_msg( + check_msg->sol_in[31].sensor_type == 28, + "incorrect value for sol_in[31].sensor_type, expected 28, is %d", + check_msg->sol_in[31].sensor_type); + ck_assert_msg(check_msg->sol_in[32].flags == 25, + "incorrect value for sol_in[32].flags, expected 25, is %d", + check_msg->sol_in[32].flags); + ck_assert_msg( + check_msg->sol_in[32].sensor_type == 214, + "incorrect value for sol_in[32].sensor_type, expected 214, is %d", + check_msg->sol_in[32].sensor_type); + ck_assert_msg(check_msg->sol_in[33].flags == 84, + "incorrect value for sol_in[33].flags, expected 84, is %d", + check_msg->sol_in[33].flags); + ck_assert_msg( + check_msg->sol_in[33].sensor_type == 100, + "incorrect value for sol_in[33].sensor_type, expected 100, is %d", + check_msg->sol_in[33].sensor_type); + ck_assert_msg(check_msg->sol_in[34].flags == 72, + "incorrect value for sol_in[34].flags, expected 72, is %d", + check_msg->sol_in[34].flags); + ck_assert_msg( + check_msg->sol_in[34].sensor_type == 106, + "incorrect value for sol_in[34].sensor_type, expected 106, is %d", + check_msg->sol_in[34].sensor_type); + ck_assert_msg(check_msg->sol_in[35].flags == 10, + "incorrect value for sol_in[35].flags, expected 10, is %d", + check_msg->sol_in[35].flags); + ck_assert_msg( + check_msg->sol_in[35].sensor_type == 48, + "incorrect value for sol_in[35].sensor_type, expected 48, is %d", + check_msg->sol_in[35].sensor_type); + ck_assert_msg(check_msg->sol_in[36].flags == 232, + "incorrect value for sol_in[36].flags, expected 232, is %d", + check_msg->sol_in[36].flags); + ck_assert_msg( + check_msg->sol_in[36].sensor_type == 222, + "incorrect value for sol_in[36].sensor_type, expected 222, is %d", + check_msg->sol_in[36].sensor_type); + ck_assert_msg(check_msg->sol_in[37].flags == 73, + "incorrect value for sol_in[37].flags, expected 73, is %d", + check_msg->sol_in[37].flags); + ck_assert_msg( + check_msg->sol_in[37].sensor_type == 235, + "incorrect value for sol_in[37].sensor_type, expected 235, is %d", + check_msg->sol_in[37].sensor_type); + ck_assert_msg(check_msg->sol_in[38].flags == 163, + "incorrect value for sol_in[38].flags, expected 163, is %d", + check_msg->sol_in[38].flags); + ck_assert_msg( + check_msg->sol_in[38].sensor_type == 109, + "incorrect value for sol_in[38].sensor_type, expected 109, is %d", + check_msg->sol_in[38].sensor_type); + ck_assert_msg(check_msg->sol_in[39].flags == 152, + "incorrect value for sol_in[39].flags, expected 152, is %d", + check_msg->sol_in[39].flags); + ck_assert_msg( + check_msg->sol_in[39].sensor_type == 51, + "incorrect value for sol_in[39].sensor_type, expected 51, is %d", + check_msg->sol_in[39].sensor_type); + ck_assert_msg(check_msg->sol_in[40].flags == 235, + "incorrect value for sol_in[40].flags, expected 235, is %d", + check_msg->sol_in[40].flags); + ck_assert_msg( + check_msg->sol_in[40].sensor_type == 133, + "incorrect value for sol_in[40].sensor_type, expected 133, is %d", + check_msg->sol_in[40].sensor_type); + ck_assert_msg(check_msg->sol_in[41].flags == 70, + "incorrect value for sol_in[41].flags, expected 70, is %d", + check_msg->sol_in[41].flags); + ck_assert_msg( + check_msg->sol_in[41].sensor_type == 87, + "incorrect value for sol_in[41].sensor_type, expected 87, is %d", + check_msg->sol_in[41].sensor_type); + ck_assert_msg(check_msg->sol_in[42].flags == 108, + "incorrect value for sol_in[42].flags, expected 108, is %d", + check_msg->sol_in[42].flags); + ck_assert_msg( + check_msg->sol_in[42].sensor_type == 2, + "incorrect value for sol_in[42].sensor_type, expected 2, is %d", + check_msg->sol_in[42].sensor_type); + ck_assert_msg(check_msg->sol_in[43].flags == 101, + "incorrect value for sol_in[43].flags, expected 101, is %d", + check_msg->sol_in[43].flags); + ck_assert_msg( + check_msg->sol_in[43].sensor_type == 91, + "incorrect value for sol_in[43].sensor_type, expected 91, is %d", + check_msg->sol_in[43].sensor_type); + ck_assert_msg(check_msg->sol_in[44].flags == 55, + "incorrect value for sol_in[44].flags, expected 55, is %d", + check_msg->sol_in[44].flags); + ck_assert_msg( + check_msg->sol_in[44].sensor_type == 200, + "incorrect value for sol_in[44].sensor_type, expected 200, is %d", + check_msg->sol_in[44].sensor_type); + ck_assert_msg(check_msg->sol_in[45].flags == 156, + "incorrect value for sol_in[45].flags, expected 156, is %d", + check_msg->sol_in[45].flags); + ck_assert_msg( + check_msg->sol_in[45].sensor_type == 24, + "incorrect value for sol_in[45].sensor_type, expected 24, is %d", + check_msg->sol_in[45].sensor_type); + ck_assert_msg(check_msg->sol_in[46].flags == 73, + "incorrect value for sol_in[46].flags, expected 73, is %d", + check_msg->sol_in[46].flags); + ck_assert_msg( + check_msg->sol_in[46].sensor_type == 233, + "incorrect value for sol_in[46].sensor_type, expected 233, is %d", + check_msg->sol_in[46].sensor_type); + ck_assert_msg(check_msg->sol_in[47].flags == 66, + "incorrect value for sol_in[47].flags, expected 66, is %d", + check_msg->sol_in[47].flags); + ck_assert_msg( + check_msg->sol_in[47].sensor_type == 39, + "incorrect value for sol_in[47].sensor_type, expected 39, is %d", + check_msg->sol_in[47].sensor_type); + ck_assert_msg(check_msg->sol_in[48].flags == 140, + "incorrect value for sol_in[48].flags, expected 140, is %d", + check_msg->sol_in[48].flags); + ck_assert_msg( + check_msg->sol_in[48].sensor_type == 97, + "incorrect value for sol_in[48].sensor_type, expected 97, is %d", + check_msg->sol_in[48].sensor_type); + ck_assert_msg(check_msg->sol_in[49].flags == 227, + "incorrect value for sol_in[49].flags, expected 227, is %d", + check_msg->sol_in[49].flags); + ck_assert_msg( + check_msg->sol_in[49].sensor_type == 252, + "incorrect value for sol_in[49].sensor_type, expected 252, is %d", + check_msg->sol_in[49].sensor_type); + ck_assert_msg(check_msg->sol_in[50].flags == 237, + "incorrect value for sol_in[50].flags, expected 237, is %d", + check_msg->sol_in[50].flags); + ck_assert_msg( + check_msg->sol_in[50].sensor_type == 230, + "incorrect value for sol_in[50].sensor_type, expected 230, is %d", + check_msg->sol_in[50].sensor_type); + ck_assert_msg(check_msg->sol_in[51].flags == 241, + "incorrect value for sol_in[51].flags, expected 241, is %d", + check_msg->sol_in[51].flags); + ck_assert_msg( + check_msg->sol_in[51].sensor_type == 135, + "incorrect value for sol_in[51].sensor_type, expected 135, is %d", + check_msg->sol_in[51].sensor_type); + ck_assert_msg(check_msg->sol_in[52].flags == 205, + "incorrect value for sol_in[52].flags, expected 205, is %d", + check_msg->sol_in[52].flags); + ck_assert_msg( + check_msg->sol_in[52].sensor_type == 245, + "incorrect value for sol_in[52].sensor_type, expected 245, is %d", + check_msg->sol_in[52].sensor_type); + ck_assert_msg(check_msg->sol_in[53].flags == 0, + "incorrect value for sol_in[53].flags, expected 0, is %d", + check_msg->sol_in[53].flags); + ck_assert_msg( + check_msg->sol_in[53].sensor_type == 70, + "incorrect value for sol_in[53].sensor_type, expected 70, is %d", + check_msg->sol_in[53].sensor_type); + ck_assert_msg(check_msg->sol_in[54].flags == 188, + "incorrect value for sol_in[54].flags, expected 188, is %d", + check_msg->sol_in[54].flags); + ck_assert_msg( + check_msg->sol_in[54].sensor_type == 219, + "incorrect value for sol_in[54].sensor_type, expected 219, is %d", + check_msg->sol_in[54].sensor_type); + ck_assert_msg(check_msg->sol_in[55].flags == 136, + "incorrect value for sol_in[55].flags, expected 136, is %d", + check_msg->sol_in[55].flags); + ck_assert_msg( + check_msg->sol_in[55].sensor_type == 107, + "incorrect value for sol_in[55].sensor_type, expected 107, is %d", + check_msg->sol_in[55].sensor_type); + ck_assert_msg(check_msg->sol_in[56].flags == 58, + "incorrect value for sol_in[56].flags, expected 58, is %d", + check_msg->sol_in[56].flags); + ck_assert_msg( + check_msg->sol_in[56].sensor_type == 178, + "incorrect value for sol_in[56].sensor_type, expected 178, is %d", + check_msg->sol_in[56].sensor_type); + ck_assert_msg(check_msg->sol_in[57].flags == 29, + "incorrect value for sol_in[57].flags, expected 29, is %d", + check_msg->sol_in[57].flags); + ck_assert_msg( + check_msg->sol_in[57].sensor_type == 1, + "incorrect value for sol_in[57].sensor_type, expected 1, is %d", + check_msg->sol_in[57].sensor_type); + ck_assert_msg(check_msg->sol_in[58].flags == 213, + "incorrect value for sol_in[58].flags, expected 213, is %d", + check_msg->sol_in[58].flags); + ck_assert_msg( + check_msg->sol_in[58].sensor_type == 44, + "incorrect value for sol_in[58].sensor_type, expected 44, is %d", + check_msg->sol_in[58].sensor_type); + ck_assert_msg(check_msg->sol_in[59].flags == 147, + "incorrect value for sol_in[59].flags, expected 147, is %d", + check_msg->sol_in[59].flags); + ck_assert_msg( + check_msg->sol_in[59].sensor_type == 225, + "incorrect value for sol_in[59].sensor_type, expected 225, is %d", + check_msg->sol_in[59].sensor_type); + ck_assert_msg(check_msg->sol_in[60].flags == 96, + "incorrect value for sol_in[60].flags, expected 96, is %d", + check_msg->sol_in[60].flags); + ck_assert_msg( + check_msg->sol_in[60].sensor_type == 190, + "incorrect value for sol_in[60].sensor_type, expected 190, is %d", + check_msg->sol_in[60].sensor_type); + ck_assert_msg(check_msg->sol_in[61].flags == 108, + "incorrect value for sol_in[61].flags, expected 108, is %d", + check_msg->sol_in[61].flags); + ck_assert_msg( + check_msg->sol_in[61].sensor_type == 192, + "incorrect value for sol_in[61].sensor_type, expected 192, is %d", + check_msg->sol_in[61].sensor_type); + ck_assert_msg(check_msg->sol_in[62].flags == 15, + "incorrect value for sol_in[62].flags, expected 15, is %d", + check_msg->sol_in[62].flags); + ck_assert_msg( + check_msg->sol_in[62].sensor_type == 228, + "incorrect value for sol_in[62].sensor_type, expected 228, is %d", + check_msg->sol_in[62].sensor_type); + ck_assert_msg(check_msg->sol_in[63].flags == 18, + "incorrect value for sol_in[63].flags, expected 18, is %d", + check_msg->sol_in[63].flags); + ck_assert_msg( + check_msg->sol_in[63].sensor_type == 203, + "incorrect value for sol_in[63].sensor_type, expected 203, is %d", + check_msg->sol_in[63].sensor_type); + ck_assert_msg(check_msg->sol_in[64].flags == 222, + "incorrect value for sol_in[64].flags, expected 222, is %d", + check_msg->sol_in[64].flags); + ck_assert_msg( + check_msg->sol_in[64].sensor_type == 3, + "incorrect value for sol_in[64].sensor_type, expected 3, is %d", + check_msg->sol_in[64].sensor_type); + ck_assert_msg(check_msg->sol_in[65].flags == 68, + "incorrect value for sol_in[65].flags, expected 68, is %d", + check_msg->sol_in[65].flags); + ck_assert_msg( + check_msg->sol_in[65].sensor_type == 180, + "incorrect value for sol_in[65].sensor_type, expected 180, is %d", + check_msg->sol_in[65].sensor_type); + ck_assert_msg(check_msg->sol_in[66].flags == 229, + "incorrect value for sol_in[66].flags, expected 229, is %d", + check_msg->sol_in[66].flags); + ck_assert_msg( + check_msg->sol_in[66].sensor_type == 101, + "incorrect value for sol_in[66].sensor_type, expected 101, is %d", + check_msg->sol_in[66].sensor_type); + ck_assert_msg(check_msg->sol_in[67].flags == 203, + "incorrect value for sol_in[67].flags, expected 203, is %d", + check_msg->sol_in[67].flags); + ck_assert_msg( + check_msg->sol_in[67].sensor_type == 223, + "incorrect value for sol_in[67].sensor_type, expected 223, is %d", + check_msg->sol_in[67].sensor_type); + ck_assert_msg(check_msg->sol_in[68].flags == 164, + "incorrect value for sol_in[68].flags, expected 164, is %d", + check_msg->sol_in[68].flags); + ck_assert_msg( + check_msg->sol_in[68].sensor_type == 243, + "incorrect value for sol_in[68].sensor_type, expected 243, is %d", + check_msg->sol_in[68].sensor_type); + ck_assert_msg(check_msg->sol_in[69].flags == 165, + "incorrect value for sol_in[69].flags, expected 165, is %d", + check_msg->sol_in[69].flags); + ck_assert_msg( + check_msg->sol_in[69].sensor_type == 92, + "incorrect value for sol_in[69].sensor_type, expected 92, is %d", + check_msg->sol_in[69].sensor_type); + ck_assert_msg(check_msg->sol_in[70].flags == 159, + "incorrect value for sol_in[70].flags, expected 159, is %d", + check_msg->sol_in[70].flags); + ck_assert_msg( + check_msg->sol_in[70].sensor_type == 220, + "incorrect value for sol_in[70].sensor_type, expected 220, is %d", + check_msg->sol_in[70].sensor_type); + ck_assert_msg(check_msg->sol_in[71].flags == 121, + "incorrect value for sol_in[71].flags, expected 121, is %d", + check_msg->sol_in[71].flags); + ck_assert_msg( + check_msg->sol_in[71].sensor_type == 174, + "incorrect value for sol_in[71].sensor_type, expected 174, is %d", + check_msg->sol_in[71].sensor_type); + ck_assert_msg(check_msg->sol_in[72].flags == 167, + "incorrect value for sol_in[72].flags, expected 167, is %d", + check_msg->sol_in[72].flags); + ck_assert_msg( + check_msg->sol_in[72].sensor_type == 112, + "incorrect value for sol_in[72].sensor_type, expected 112, is %d", + check_msg->sol_in[72].sensor_type); + ck_assert_msg(check_msg->sol_in[73].flags == 40, + "incorrect value for sol_in[73].flags, expected 40, is %d", + check_msg->sol_in[73].flags); + ck_assert_msg( + check_msg->sol_in[73].sensor_type == 240, + "incorrect value for sol_in[73].sensor_type, expected 240, is %d", + check_msg->sol_in[73].sensor_type); + ck_assert_msg(check_msg->sol_in[74].flags == 3, + "incorrect value for sol_in[74].flags, expected 3, is %d", + check_msg->sol_in[74].flags); + ck_assert_msg( + check_msg->sol_in[74].sensor_type == 59, + "incorrect value for sol_in[74].sensor_type, expected 59, is %d", + check_msg->sol_in[74].sensor_type); + ck_assert_msg(check_msg->sol_in[75].flags == 52, + "incorrect value for sol_in[75].flags, expected 52, is %d", + check_msg->sol_in[75].flags); + ck_assert_msg( + check_msg->sol_in[75].sensor_type == 230, + "incorrect value for sol_in[75].sensor_type, expected 230, is %d", + check_msg->sol_in[75].sensor_type); + ck_assert_msg(check_msg->sol_in[76].flags == 148, + "incorrect value for sol_in[76].flags, expected 148, is %d", + check_msg->sol_in[76].flags); + ck_assert_msg( + check_msg->sol_in[76].sensor_type == 149, + "incorrect value for sol_in[76].sensor_type, expected 149, is %d", + check_msg->sol_in[76].sensor_type); + ck_assert_msg(check_msg->sol_in[77].flags == 142, + "incorrect value for sol_in[77].flags, expected 142, is %d", + check_msg->sol_in[77].flags); + ck_assert_msg( + check_msg->sol_in[77].sensor_type == 218, + "incorrect value for sol_in[77].sensor_type, expected 218, is %d", + check_msg->sol_in[77].sensor_type); + ck_assert_msg(check_msg->sol_in[78].flags == 109, + "incorrect value for sol_in[78].flags, expected 109, is %d", + check_msg->sol_in[78].flags); + ck_assert_msg( + check_msg->sol_in[78].sensor_type == 212, + "incorrect value for sol_in[78].sensor_type, expected 212, is %d", + check_msg->sol_in[78].sensor_type); + ck_assert_msg(check_msg->sol_in[79].flags == 71, + "incorrect value for sol_in[79].flags, expected 71, is %d", + check_msg->sol_in[79].flags); + ck_assert_msg( + check_msg->sol_in[79].sensor_type == 176, + "incorrect value for sol_in[79].sensor_type, expected 176, is %d", + check_msg->sol_in[79].sensor_type); + ck_assert_msg(check_msg->sol_in[80].flags == 172, + "incorrect value for sol_in[80].flags, expected 172, is %d", + check_msg->sol_in[80].flags); + ck_assert_msg( + check_msg->sol_in[80].sensor_type == 179, + "incorrect value for sol_in[80].sensor_type, expected 179, is %d", + check_msg->sol_in[80].sensor_type); + ck_assert_msg(check_msg->sol_in[81].flags == 1, + "incorrect value for sol_in[81].flags, expected 1, is %d", + check_msg->sol_in[81].flags); + ck_assert_msg( + check_msg->sol_in[81].sensor_type == 77, + "incorrect value for sol_in[81].sensor_type, expected 77, is %d", + check_msg->sol_in[81].sensor_type); + ck_assert_msg(check_msg->sol_in[82].flags == 70, + "incorrect value for sol_in[82].flags, expected 70, is %d", + check_msg->sol_in[82].flags); + ck_assert_msg( + check_msg->sol_in[82].sensor_type == 193, + "incorrect value for sol_in[82].sensor_type, expected 193, is %d", + check_msg->sol_in[82].sensor_type); + ck_assert_msg(check_msg->sol_in[83].flags == 149, + "incorrect value for sol_in[83].flags, expected 149, is %d", + check_msg->sol_in[83].flags); + ck_assert_msg( + check_msg->sol_in[83].sensor_type == 147, + "incorrect value for sol_in[83].sensor_type, expected 147, is %d", + check_msg->sol_in[83].sensor_type); + ck_assert_msg(check_msg->sol_in[84].flags == 144, + "incorrect value for sol_in[84].flags, expected 144, is %d", + check_msg->sol_in[84].flags); + ck_assert_msg( + check_msg->sol_in[84].sensor_type == 23, + "incorrect value for sol_in[84].sensor_type, expected 23, is %d", + check_msg->sol_in[84].sensor_type); + ck_assert_msg(check_msg->sol_in[85].flags == 239, + "incorrect value for sol_in[85].flags, expected 239, is %d", + check_msg->sol_in[85].flags); + ck_assert_msg( + check_msg->sol_in[85].sensor_type == 148, + "incorrect value for sol_in[85].sensor_type, expected 148, is %d", + check_msg->sol_in[85].sensor_type); + ck_assert_msg(check_msg->sol_in[86].flags == 186, + "incorrect value for sol_in[86].flags, expected 186, is %d", + check_msg->sol_in[86].flags); + ck_assert_msg( + check_msg->sol_in[86].sensor_type == 195, + "incorrect value for sol_in[86].sensor_type, expected 195, is %d", + check_msg->sol_in[86].sensor_type); + ck_assert_msg(check_msg->sol_in[87].flags == 30, + "incorrect value for sol_in[87].flags, expected 30, is %d", + check_msg->sol_in[87].flags); + ck_assert_msg( + check_msg->sol_in[87].sensor_type == 86, + "incorrect value for sol_in[87].sensor_type, expected 86, is %d", + check_msg->sol_in[87].sensor_type); + ck_assert_msg(check_msg->sol_in[88].flags == 143, + "incorrect value for sol_in[88].flags, expected 143, is %d", + check_msg->sol_in[88].flags); + ck_assert_msg( + check_msg->sol_in[88].sensor_type == 34, + "incorrect value for sol_in[88].sensor_type, expected 34, is %d", + check_msg->sol_in[88].sensor_type); + ck_assert_msg(check_msg->sol_in[89].flags == 207, + "incorrect value for sol_in[89].flags, expected 207, is %d", + check_msg->sol_in[89].flags); + ck_assert_msg( + check_msg->sol_in[89].sensor_type == 156, + "incorrect value for sol_in[89].sensor_type, expected 156, is %d", + check_msg->sol_in[89].sensor_type); + ck_assert_msg(check_msg->sol_in[90].flags == 55, + "incorrect value for sol_in[90].flags, expected 55, is %d", + check_msg->sol_in[90].flags); + ck_assert_msg( + check_msg->sol_in[90].sensor_type == 63, + "incorrect value for sol_in[90].sensor_type, expected 63, is %d", + check_msg->sol_in[90].sensor_type); + ck_assert_msg(check_msg->sol_in[91].flags == 255, + "incorrect value for sol_in[91].flags, expected 255, is %d", + check_msg->sol_in[91].flags); + ck_assert_msg( + check_msg->sol_in[91].sensor_type == 117, + "incorrect value for sol_in[91].sensor_type, expected 117, is %d", + check_msg->sol_in[91].sensor_type); + ck_assert_msg(check_msg->sol_in[92].flags == 222, + "incorrect value for sol_in[92].flags, expected 222, is %d", + check_msg->sol_in[92].flags); + ck_assert_msg( + check_msg->sol_in[92].sensor_type == 222, + "incorrect value for sol_in[92].sensor_type, expected 222, is %d", + check_msg->sol_in[92].sensor_type); + ck_assert_msg(check_msg->sol_in[93].flags == 145, + "incorrect value for sol_in[93].flags, expected 145, is %d", + check_msg->sol_in[93].flags); + ck_assert_msg( + check_msg->sol_in[93].sensor_type == 219, + "incorrect value for sol_in[93].sensor_type, expected 219, is %d", + check_msg->sol_in[93].sensor_type); + ck_assert_msg(check_msg->sol_in[94].flags == 191, + "incorrect value for sol_in[94].flags, expected 191, is %d", + check_msg->sol_in[94].flags); + ck_assert_msg( + check_msg->sol_in[94].sensor_type == 224, + "incorrect value for sol_in[94].sensor_type, expected 224, is %d", + check_msg->sol_in[94].sensor_type); + ck_assert_msg(check_msg->sol_in[95].flags == 109, + "incorrect value for sol_in[95].flags, expected 109, is %d", + check_msg->sol_in[95].flags); + ck_assert_msg( + check_msg->sol_in[95].sensor_type == 210, + "incorrect value for sol_in[95].sensor_type, expected 210, is %d", + check_msg->sol_in[95].sensor_type); + ck_assert_msg(check_msg->sol_in[96].flags == 153, + "incorrect value for sol_in[96].flags, expected 153, is %d", + check_msg->sol_in[96].flags); + ck_assert_msg( + check_msg->sol_in[96].sensor_type == 86, + "incorrect value for sol_in[96].sensor_type, expected 86, is %d", + check_msg->sol_in[96].sensor_type); + ck_assert_msg(check_msg->sol_in[97].flags == 32, + "incorrect value for sol_in[97].flags, expected 32, is %d", + check_msg->sol_in[97].flags); + ck_assert_msg( + check_msg->sol_in[97].sensor_type == 21, + "incorrect value for sol_in[97].sensor_type, expected 21, is %d", + check_msg->sol_in[97].sensor_type); + ck_assert_msg(check_msg->sol_in[98].flags == 10, + "incorrect value for sol_in[98].flags, expected 10, is %d", + check_msg->sol_in[98].flags); + ck_assert_msg( + check_msg->sol_in[98].sensor_type == 226, + "incorrect value for sol_in[98].sensor_type, expected 226, is %d", + check_msg->sol_in[98].sensor_type); + ck_assert_msg(check_msg->sol_in[99].flags == 63, + "incorrect value for sol_in[99].flags, expected 63, is %d", + check_msg->sol_in[99].flags); + ck_assert_msg( + check_msg->sol_in[99].sensor_type == 60, + "incorrect value for sol_in[99].sensor_type, expected 60, is %d", + check_msg->sol_in[99].sensor_type); + ck_assert_msg(check_msg->sol_in[100].flags == 236, + "incorrect value for sol_in[100].flags, expected 236, is %d", + check_msg->sol_in[100].flags); + ck_assert_msg( + check_msg->sol_in[100].sensor_type == 106, + "incorrect value for sol_in[100].sensor_type, expected 106, is %d", + check_msg->sol_in[100].sensor_type); + ck_assert_msg(check_msg->sol_in[101].flags == 96, + "incorrect value for sol_in[101].flags, expected 96, is %d", + check_msg->sol_in[101].flags); + ck_assert_msg( + check_msg->sol_in[101].sensor_type == 93, + "incorrect value for sol_in[101].sensor_type, expected 93, is %d", + check_msg->sol_in[101].sensor_type); + ck_assert_msg(check_msg->sol_in[102].flags == 163, + "incorrect value for sol_in[102].flags, expected 163, is %d", + check_msg->sol_in[102].flags); + ck_assert_msg( + check_msg->sol_in[102].sensor_type == 30, + "incorrect value for sol_in[102].sensor_type, expected 30, is %d", + check_msg->sol_in[102].sensor_type); + ck_assert_msg(check_msg->sol_in[103].flags == 238, + "incorrect value for sol_in[103].flags, expected 238, is %d", + check_msg->sol_in[103].flags); + ck_assert_msg( + check_msg->sol_in[103].sensor_type == 106, + "incorrect value for sol_in[103].sensor_type, expected 106, is %d", + check_msg->sol_in[103].sensor_type); + ck_assert_msg(check_msg->sol_in[104].flags == 133, + "incorrect value for sol_in[104].flags, expected 133, is %d", + check_msg->sol_in[104].flags); + ck_assert_msg( + check_msg->sol_in[104].sensor_type == 147, + "incorrect value for sol_in[104].sensor_type, expected 147, is %d", + check_msg->sol_in[104].sensor_type); + ck_assert_msg(check_msg->sol_in[105].flags == 107, + "incorrect value for sol_in[105].flags, expected 107, is %d", + check_msg->sol_in[105].flags); + ck_assert_msg( + check_msg->sol_in[105].sensor_type == 132, + "incorrect value for sol_in[105].sensor_type, expected 132, is %d", + check_msg->sol_in[105].sensor_type); + ck_assert_msg(check_msg->sol_in[106].flags == 214, + "incorrect value for sol_in[106].flags, expected 214, is %d", + check_msg->sol_in[106].flags); + ck_assert_msg( + check_msg->sol_in[106].sensor_type == 152, + "incorrect value for sol_in[106].sensor_type, expected 152, is %d", + check_msg->sol_in[106].sensor_type); + ck_assert_msg(check_msg->sol_in[107].flags == 185, + "incorrect value for sol_in[107].flags, expected 185, is %d", + check_msg->sol_in[107].flags); + ck_assert_msg( + check_msg->sol_in[107].sensor_type == 221, + "incorrect value for sol_in[107].sensor_type, expected 221, is %d", + check_msg->sol_in[107].sensor_type); + ck_assert_msg(check_msg->sol_in[108].flags == 21, + "incorrect value for sol_in[108].flags, expected 21, is %d", + check_msg->sol_in[108].flags); + ck_assert_msg( + check_msg->sol_in[108].sensor_type == 202, + "incorrect value for sol_in[108].sensor_type, expected 202, is %d", + check_msg->sol_in[108].sensor_type); + ck_assert_msg(check_msg->sol_in[109].flags == 51, + "incorrect value for sol_in[109].flags, expected 51, is %d", + check_msg->sol_in[109].flags); + ck_assert_msg( + check_msg->sol_in[109].sensor_type == 252, + "incorrect value for sol_in[109].sensor_type, expected 252, is %d", + check_msg->sol_in[109].sensor_type); + ck_assert_msg(check_msg->sol_in[110].flags == 59, + "incorrect value for sol_in[110].flags, expected 59, is %d", + check_msg->sol_in[110].flags); + ck_assert_msg( + check_msg->sol_in[110].sensor_type == 130, + "incorrect value for sol_in[110].sensor_type, expected 130, is %d", + check_msg->sol_in[110].sensor_type); + ck_assert_msg(check_msg->sol_in[111].flags == 202, + "incorrect value for sol_in[111].flags, expected 202, is %d", + check_msg->sol_in[111].flags); + ck_assert_msg( + check_msg->sol_in[111].sensor_type == 166, + "incorrect value for sol_in[111].sensor_type, expected 166, is %d", + check_msg->sol_in[111].sensor_type); + ck_assert_msg(check_msg->sol_in[112].flags == 170, + "incorrect value for sol_in[112].flags, expected 170, is %d", + check_msg->sol_in[112].flags); + ck_assert_msg( + check_msg->sol_in[112].sensor_type == 127, + "incorrect value for sol_in[112].sensor_type, expected 127, is %d", + check_msg->sol_in[112].sensor_type); + ck_assert_msg(check_msg->sol_in[113].flags == 193, + "incorrect value for sol_in[113].flags, expected 193, is %d", + check_msg->sol_in[113].flags); + ck_assert_msg( + check_msg->sol_in[113].sensor_type == 58, + "incorrect value for sol_in[113].sensor_type, expected 58, is %d", + check_msg->sol_in[113].sensor_type); + ck_assert_msg(check_msg->sol_in[114].flags == 125, + "incorrect value for sol_in[114].flags, expected 125, is %d", + check_msg->sol_in[114].flags); + ck_assert_msg( + check_msg->sol_in[114].sensor_type == 215, + "incorrect value for sol_in[114].sensor_type, expected 215, is %d", + check_msg->sol_in[114].sensor_type); + ck_assert_msg(check_msg->sol_in[115].flags == 58, + "incorrect value for sol_in[115].flags, expected 58, is %d", + check_msg->sol_in[115].flags); + ck_assert_msg( + check_msg->sol_in[115].sensor_type == 22, + "incorrect value for sol_in[115].sensor_type, expected 22, is %d", + check_msg->sol_in[115].sensor_type); + ck_assert_msg(check_msg->sol_in[116].flags == 47, + "incorrect value for sol_in[116].flags, expected 47, is %d", + check_msg->sol_in[116].flags); + ck_assert_msg( + check_msg->sol_in[116].sensor_type == 135, + "incorrect value for sol_in[116].sensor_type, expected 135, is %d", + check_msg->sol_in[116].sensor_type); + ck_assert_msg(check_msg->sol_in[117].flags == 142, + "incorrect value for sol_in[117].flags, expected 142, is %d", + check_msg->sol_in[117].flags); + ck_assert_msg( + check_msg->sol_in[117].sensor_type == 88, + "incorrect value for sol_in[117].sensor_type, expected 88, is %d", + check_msg->sol_in[117].sensor_type); + ck_assert_msg(check_msg->vdop == 41989, + "incorrect value for vdop, expected 41989, is %d", + check_msg->vdop); } } END_TEST -Suite* legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA); +Suite *legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrCodeBiases.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrCodeBiases.c index f984849ae..b5ea53693 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrCodeBiases.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrCodeBiases.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodeBiases.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodeBiases.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrCodeBiases ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrCodeBiases) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrCodeBiases ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,39 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrCodeBiases ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x5e1, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x5e1, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x5e1, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x5e1, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,225,5,39,87,253,208,90,19,23,9,66,133,241,254,132,51,4,131,240,120,83,148,209,213,62,228,232,71,66,188,210,128,54,131,152,129,111,139,242,177,145,44,9,245,207,241,202,150,141,50,159,220,139,37,187,98,191,23,128,136,167,200,6,211,90,23,244,138,215,209,139,13,101,32,7,18,29,70,250,109,73,202,79,144,9,146,69,241,52,22,99,98,204,3,171,230,180,75,62,145,86,130,31,30,155,37,18,55,210,39,127,242,66,13,237,152,170,212,15,246,59,94,180,195,157,69,100,119,16,68,179,175,144,113,81,82,30,151,21,109,41,225,8,77,164,157,0,73,30,6,78,81,143,116,240,151,55,185,169,254,51,39,74,175,247,34,97,74,97,176,48,236,173,12,174,101,130,30,169,193,190,204,196,123,107,25,225,74,9,10,55,3,131,246,99,133,34,227,203,68,18,97,223,89,192,246,50,69,91,10,151,74,118,110,36,168,247,160,77,179,141,178,99,191,120,77,192,91,224,1,226,50,87,146,148,238,100,179,125,227,215,104,184,31,57,90,79,21,156,245,81,60,93,170,60,200,167,13,125,132, }; + u8 encoded_frame[] = { + 85, 225, 5, 39, 87, 253, 208, 90, 19, 23, 9, 66, 133, 241, + 254, 132, 51, 4, 131, 240, 120, 83, 148, 209, 213, 62, 228, 232, + 71, 66, 188, 210, 128, 54, 131, 152, 129, 111, 139, 242, 177, 145, + 44, 9, 245, 207, 241, 202, 150, 141, 50, 159, 220, 139, 37, 187, + 98, 191, 23, 128, 136, 167, 200, 6, 211, 90, 23, 244, 138, 215, + 209, 139, 13, 101, 32, 7, 18, 29, 70, 250, 109, 73, 202, 79, + 144, 9, 146, 69, 241, 52, 22, 99, 98, 204, 3, 171, 230, 180, + 75, 62, 145, 86, 130, 31, 30, 155, 37, 18, 55, 210, 39, 127, + 242, 66, 13, 237, 152, 170, 212, 15, 246, 59, 94, 180, 195, 157, + 69, 100, 119, 16, 68, 179, 175, 144, 113, 81, 82, 30, 151, 21, + 109, 41, 225, 8, 77, 164, 157, 0, 73, 30, 6, 78, 81, 143, + 116, 240, 151, 55, 185, 169, 254, 51, 39, 74, 175, 247, 34, 97, + 74, 97, 176, 48, 236, 173, 12, 174, 101, 130, 30, 169, 193, 190, + 204, 196, 123, 107, 25, 225, 74, 9, 10, 55, 3, 131, 246, 99, + 133, 34, 227, 203, 68, 18, 97, 223, 89, 192, 246, 50, 69, 91, + 10, 151, 74, 118, 110, 36, 168, 247, 160, 77, 179, 141, 178, 99, + 191, 120, 77, 192, 91, 224, 1, 226, 50, 87, 146, 148, 238, 100, + 179, 125, 227, 215, 104, 184, 31, 57, 90, 79, 21, 156, 245, 81, + 60, 93, 170, 60, 200, 167, 13, 125, 132, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_code_biases_t* test_msg = ( msg_ssr_code_biases_t* )test_msg_storage; + msg_ssr_code_biases_t *test_msg = (msg_ssr_code_biases_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->biases) == 0) { // Cope with variable length arrays @@ -635,230 +654,598 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrCodeBiases ) test_msg->time.tow = 387144400; test_msg->time.wn = 16905; test_msg->update_interval = 254; - sbp_payload_send(&sbp_state, 0x5e1, 22311, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x5e1, 22311, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 22311, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 22311, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x5e1, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_code_biases_t* check_msg = ( msg_ssr_code_biases_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_code_biases_t *check_msg = + (msg_ssr_code_biases_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->biases[0].code == 51, "incorrect value for biases[0].code, expected 51, is %d", check_msg->biases[0].code); - ck_assert_msg(check_msg->biases[0].value == -31996, "incorrect value for biases[0].value, expected -31996, is %d", check_msg->biases[0].value); - ck_assert_msg(check_msg->biases[1].code == 240, "incorrect value for biases[1].code, expected 240, is %d", check_msg->biases[1].code); - ck_assert_msg(check_msg->biases[1].value == 21368, "incorrect value for biases[1].value, expected 21368, is %d", check_msg->biases[1].value); - ck_assert_msg(check_msg->biases[2].code == 148, "incorrect value for biases[2].code, expected 148, is %d", check_msg->biases[2].code); - ck_assert_msg(check_msg->biases[2].value == -10799, "incorrect value for biases[2].value, expected -10799, is %d", check_msg->biases[2].value); - ck_assert_msg(check_msg->biases[3].code == 62, "incorrect value for biases[3].code, expected 62, is %d", check_msg->biases[3].code); - ck_assert_msg(check_msg->biases[3].value == -5916, "incorrect value for biases[3].value, expected -5916, is %d", check_msg->biases[3].value); - ck_assert_msg(check_msg->biases[4].code == 71, "incorrect value for biases[4].code, expected 71, is %d", check_msg->biases[4].code); - ck_assert_msg(check_msg->biases[4].value == -17342, "incorrect value for biases[4].value, expected -17342, is %d", check_msg->biases[4].value); - ck_assert_msg(check_msg->biases[5].code == 210, "incorrect value for biases[5].code, expected 210, is %d", check_msg->biases[5].code); - ck_assert_msg(check_msg->biases[5].value == 13952, "incorrect value for biases[5].value, expected 13952, is %d", check_msg->biases[5].value); - ck_assert_msg(check_msg->biases[6].code == 131, "incorrect value for biases[6].code, expected 131, is %d", check_msg->biases[6].code); - ck_assert_msg(check_msg->biases[6].value == -32360, "incorrect value for biases[6].value, expected -32360, is %d", check_msg->biases[6].value); - ck_assert_msg(check_msg->biases[7].code == 111, "incorrect value for biases[7].code, expected 111, is %d", check_msg->biases[7].code); - ck_assert_msg(check_msg->biases[7].value == -3445, "incorrect value for biases[7].value, expected -3445, is %d", check_msg->biases[7].value); - ck_assert_msg(check_msg->biases[8].code == 177, "incorrect value for biases[8].code, expected 177, is %d", check_msg->biases[8].code); - ck_assert_msg(check_msg->biases[8].value == 11409, "incorrect value for biases[8].value, expected 11409, is %d", check_msg->biases[8].value); - ck_assert_msg(check_msg->biases[9].code == 9, "incorrect value for biases[9].code, expected 9, is %d", check_msg->biases[9].code); - ck_assert_msg(check_msg->biases[9].value == -12299, "incorrect value for biases[9].value, expected -12299, is %d", check_msg->biases[9].value); - ck_assert_msg(check_msg->biases[10].code == 241, "incorrect value for biases[10].code, expected 241, is %d", check_msg->biases[10].code); - ck_assert_msg(check_msg->biases[10].value == -26934, "incorrect value for biases[10].value, expected -26934, is %d", check_msg->biases[10].value); - ck_assert_msg(check_msg->biases[11].code == 141, "incorrect value for biases[11].code, expected 141, is %d", check_msg->biases[11].code); - ck_assert_msg(check_msg->biases[11].value == -24782, "incorrect value for biases[11].value, expected -24782, is %d", check_msg->biases[11].value); - ck_assert_msg(check_msg->biases[12].code == 220, "incorrect value for biases[12].code, expected 220, is %d", check_msg->biases[12].code); - ck_assert_msg(check_msg->biases[12].value == 9611, "incorrect value for biases[12].value, expected 9611, is %d", check_msg->biases[12].value); - ck_assert_msg(check_msg->biases[13].code == 187, "incorrect value for biases[13].code, expected 187, is %d", check_msg->biases[13].code); - ck_assert_msg(check_msg->biases[13].value == -16542, "incorrect value for biases[13].value, expected -16542, is %d", check_msg->biases[13].value); - ck_assert_msg(check_msg->biases[14].code == 23, "incorrect value for biases[14].code, expected 23, is %d", check_msg->biases[14].code); - ck_assert_msg(check_msg->biases[14].value == -30592, "incorrect value for biases[14].value, expected -30592, is %d", check_msg->biases[14].value); - ck_assert_msg(check_msg->biases[15].code == 167, "incorrect value for biases[15].code, expected 167, is %d", check_msg->biases[15].code); - ck_assert_msg(check_msg->biases[15].value == 1736, "incorrect value for biases[15].value, expected 1736, is %d", check_msg->biases[15].value); - ck_assert_msg(check_msg->biases[16].code == 211, "incorrect value for biases[16].code, expected 211, is %d", check_msg->biases[16].code); - ck_assert_msg(check_msg->biases[16].value == 5978, "incorrect value for biases[16].value, expected 5978, is %d", check_msg->biases[16].value); - ck_assert_msg(check_msg->biases[17].code == 244, "incorrect value for biases[17].code, expected 244, is %d", check_msg->biases[17].code); - ck_assert_msg(check_msg->biases[17].value == -10358, "incorrect value for biases[17].value, expected -10358, is %d", check_msg->biases[17].value); - ck_assert_msg(check_msg->biases[18].code == 209, "incorrect value for biases[18].code, expected 209, is %d", check_msg->biases[18].code); - ck_assert_msg(check_msg->biases[18].value == 3467, "incorrect value for biases[18].value, expected 3467, is %d", check_msg->biases[18].value); - ck_assert_msg(check_msg->biases[19].code == 101, "incorrect value for biases[19].code, expected 101, is %d", check_msg->biases[19].code); - ck_assert_msg(check_msg->biases[19].value == 1824, "incorrect value for biases[19].value, expected 1824, is %d", check_msg->biases[19].value); - ck_assert_msg(check_msg->biases[20].code == 18, "incorrect value for biases[20].code, expected 18, is %d", check_msg->biases[20].code); - ck_assert_msg(check_msg->biases[20].value == 17949, "incorrect value for biases[20].value, expected 17949, is %d", check_msg->biases[20].value); - ck_assert_msg(check_msg->biases[21].code == 250, "incorrect value for biases[21].code, expected 250, is %d", check_msg->biases[21].code); - ck_assert_msg(check_msg->biases[21].value == 18797, "incorrect value for biases[21].value, expected 18797, is %d", check_msg->biases[21].value); - ck_assert_msg(check_msg->biases[22].code == 202, "incorrect value for biases[22].code, expected 202, is %d", check_msg->biases[22].code); - ck_assert_msg(check_msg->biases[22].value == -28593, "incorrect value for biases[22].value, expected -28593, is %d", check_msg->biases[22].value); - ck_assert_msg(check_msg->biases[23].code == 9, "incorrect value for biases[23].code, expected 9, is %d", check_msg->biases[23].code); - ck_assert_msg(check_msg->biases[23].value == 17810, "incorrect value for biases[23].value, expected 17810, is %d", check_msg->biases[23].value); - ck_assert_msg(check_msg->biases[24].code == 241, "incorrect value for biases[24].code, expected 241, is %d", check_msg->biases[24].code); - ck_assert_msg(check_msg->biases[24].value == 5684, "incorrect value for biases[24].value, expected 5684, is %d", check_msg->biases[24].value); - ck_assert_msg(check_msg->biases[25].code == 99, "incorrect value for biases[25].code, expected 99, is %d", check_msg->biases[25].code); - ck_assert_msg(check_msg->biases[25].value == -13214, "incorrect value for biases[25].value, expected -13214, is %d", check_msg->biases[25].value); - ck_assert_msg(check_msg->biases[26].code == 3, "incorrect value for biases[26].code, expected 3, is %d", check_msg->biases[26].code); - ck_assert_msg(check_msg->biases[26].value == -6485, "incorrect value for biases[26].value, expected -6485, is %d", check_msg->biases[26].value); - ck_assert_msg(check_msg->biases[27].code == 180, "incorrect value for biases[27].code, expected 180, is %d", check_msg->biases[27].code); - ck_assert_msg(check_msg->biases[27].value == 15947, "incorrect value for biases[27].value, expected 15947, is %d", check_msg->biases[27].value); - ck_assert_msg(check_msg->biases[28].code == 145, "incorrect value for biases[28].code, expected 145, is %d", check_msg->biases[28].code); - ck_assert_msg(check_msg->biases[28].value == -32170, "incorrect value for biases[28].value, expected -32170, is %d", check_msg->biases[28].value); - ck_assert_msg(check_msg->biases[29].code == 31, "incorrect value for biases[29].code, expected 31, is %d", check_msg->biases[29].code); - ck_assert_msg(check_msg->biases[29].value == -25826, "incorrect value for biases[29].value, expected -25826, is %d", check_msg->biases[29].value); - ck_assert_msg(check_msg->biases[30].code == 37, "incorrect value for biases[30].code, expected 37, is %d", check_msg->biases[30].code); - ck_assert_msg(check_msg->biases[30].value == 14098, "incorrect value for biases[30].value, expected 14098, is %d", check_msg->biases[30].value); - ck_assert_msg(check_msg->biases[31].code == 210, "incorrect value for biases[31].code, expected 210, is %d", check_msg->biases[31].code); - ck_assert_msg(check_msg->biases[31].value == 32551, "incorrect value for biases[31].value, expected 32551, is %d", check_msg->biases[31].value); - ck_assert_msg(check_msg->biases[32].code == 242, "incorrect value for biases[32].code, expected 242, is %d", check_msg->biases[32].code); - ck_assert_msg(check_msg->biases[32].value == 3394, "incorrect value for biases[32].value, expected 3394, is %d", check_msg->biases[32].value); - ck_assert_msg(check_msg->biases[33].code == 237, "incorrect value for biases[33].code, expected 237, is %d", check_msg->biases[33].code); - ck_assert_msg(check_msg->biases[33].value == -21864, "incorrect value for biases[33].value, expected -21864, is %d", check_msg->biases[33].value); - ck_assert_msg(check_msg->biases[34].code == 212, "incorrect value for biases[34].code, expected 212, is %d", check_msg->biases[34].code); - ck_assert_msg(check_msg->biases[34].value == -2545, "incorrect value for biases[34].value, expected -2545, is %d", check_msg->biases[34].value); - ck_assert_msg(check_msg->biases[35].code == 59, "incorrect value for biases[35].code, expected 59, is %d", check_msg->biases[35].code); - ck_assert_msg(check_msg->biases[35].value == -19362, "incorrect value for biases[35].value, expected -19362, is %d", check_msg->biases[35].value); - ck_assert_msg(check_msg->biases[36].code == 195, "incorrect value for biases[36].code, expected 195, is %d", check_msg->biases[36].code); - ck_assert_msg(check_msg->biases[36].value == 17821, "incorrect value for biases[36].value, expected 17821, is %d", check_msg->biases[36].value); - ck_assert_msg(check_msg->biases[37].code == 100, "incorrect value for biases[37].code, expected 100, is %d", check_msg->biases[37].code); - ck_assert_msg(check_msg->biases[37].value == 4215, "incorrect value for biases[37].value, expected 4215, is %d", check_msg->biases[37].value); - ck_assert_msg(check_msg->biases[38].code == 68, "incorrect value for biases[38].code, expected 68, is %d", check_msg->biases[38].code); - ck_assert_msg(check_msg->biases[38].value == -20557, "incorrect value for biases[38].value, expected -20557, is %d", check_msg->biases[38].value); - ck_assert_msg(check_msg->biases[39].code == 144, "incorrect value for biases[39].code, expected 144, is %d", check_msg->biases[39].code); - ck_assert_msg(check_msg->biases[39].value == 20849, "incorrect value for biases[39].value, expected 20849, is %d", check_msg->biases[39].value); - ck_assert_msg(check_msg->biases[40].code == 82, "incorrect value for biases[40].code, expected 82, is %d", check_msg->biases[40].code); - ck_assert_msg(check_msg->biases[40].value == -26850, "incorrect value for biases[40].value, expected -26850, is %d", check_msg->biases[40].value); - ck_assert_msg(check_msg->biases[41].code == 21, "incorrect value for biases[41].code, expected 21, is %d", check_msg->biases[41].code); - ck_assert_msg(check_msg->biases[41].value == 10605, "incorrect value for biases[41].value, expected 10605, is %d", check_msg->biases[41].value); - ck_assert_msg(check_msg->biases[42].code == 225, "incorrect value for biases[42].code, expected 225, is %d", check_msg->biases[42].code); - ck_assert_msg(check_msg->biases[42].value == 19720, "incorrect value for biases[42].value, expected 19720, is %d", check_msg->biases[42].value); - ck_assert_msg(check_msg->biases[43].code == 164, "incorrect value for biases[43].code, expected 164, is %d", check_msg->biases[43].code); - ck_assert_msg(check_msg->biases[43].value == 157, "incorrect value for biases[43].value, expected 157, is %d", check_msg->biases[43].value); - ck_assert_msg(check_msg->biases[44].code == 73, "incorrect value for biases[44].code, expected 73, is %d", check_msg->biases[44].code); - ck_assert_msg(check_msg->biases[44].value == 1566, "incorrect value for biases[44].value, expected 1566, is %d", check_msg->biases[44].value); - ck_assert_msg(check_msg->biases[45].code == 78, "incorrect value for biases[45].code, expected 78, is %d", check_msg->biases[45].code); - ck_assert_msg(check_msg->biases[45].value == -28847, "incorrect value for biases[45].value, expected -28847, is %d", check_msg->biases[45].value); - ck_assert_msg(check_msg->biases[46].code == 116, "incorrect value for biases[46].code, expected 116, is %d", check_msg->biases[46].code); - ck_assert_msg(check_msg->biases[46].value == -26640, "incorrect value for biases[46].value, expected -26640, is %d", check_msg->biases[46].value); - ck_assert_msg(check_msg->biases[47].code == 55, "incorrect value for biases[47].code, expected 55, is %d", check_msg->biases[47].code); - ck_assert_msg(check_msg->biases[47].value == -22087, "incorrect value for biases[47].value, expected -22087, is %d", check_msg->biases[47].value); - ck_assert_msg(check_msg->biases[48].code == 254, "incorrect value for biases[48].code, expected 254, is %d", check_msg->biases[48].code); - ck_assert_msg(check_msg->biases[48].value == 10035, "incorrect value for biases[48].value, expected 10035, is %d", check_msg->biases[48].value); - ck_assert_msg(check_msg->biases[49].code == 74, "incorrect value for biases[49].code, expected 74, is %d", check_msg->biases[49].code); - ck_assert_msg(check_msg->biases[49].value == -2129, "incorrect value for biases[49].value, expected -2129, is %d", check_msg->biases[49].value); - ck_assert_msg(check_msg->biases[50].code == 34, "incorrect value for biases[50].code, expected 34, is %d", check_msg->biases[50].code); - ck_assert_msg(check_msg->biases[50].value == 19041, "incorrect value for biases[50].value, expected 19041, is %d", check_msg->biases[50].value); - ck_assert_msg(check_msg->biases[51].code == 97, "incorrect value for biases[51].code, expected 97, is %d", check_msg->biases[51].code); - ck_assert_msg(check_msg->biases[51].value == 12464, "incorrect value for biases[51].value, expected 12464, is %d", check_msg->biases[51].value); - ck_assert_msg(check_msg->biases[52].code == 236, "incorrect value for biases[52].code, expected 236, is %d", check_msg->biases[52].code); - ck_assert_msg(check_msg->biases[52].value == 3245, "incorrect value for biases[52].value, expected 3245, is %d", check_msg->biases[52].value); - ck_assert_msg(check_msg->biases[53].code == 174, "incorrect value for biases[53].code, expected 174, is %d", check_msg->biases[53].code); - ck_assert_msg(check_msg->biases[53].value == -32155, "incorrect value for biases[53].value, expected -32155, is %d", check_msg->biases[53].value); - ck_assert_msg(check_msg->biases[54].code == 30, "incorrect value for biases[54].code, expected 30, is %d", check_msg->biases[54].code); - ck_assert_msg(check_msg->biases[54].value == -15959, "incorrect value for biases[54].value, expected -15959, is %d", check_msg->biases[54].value); - ck_assert_msg(check_msg->biases[55].code == 190, "incorrect value for biases[55].code, expected 190, is %d", check_msg->biases[55].code); - ck_assert_msg(check_msg->biases[55].value == -15156, "incorrect value for biases[55].value, expected -15156, is %d", check_msg->biases[55].value); - ck_assert_msg(check_msg->biases[56].code == 123, "incorrect value for biases[56].code, expected 123, is %d", check_msg->biases[56].code); - ck_assert_msg(check_msg->biases[56].value == 6507, "incorrect value for biases[56].value, expected 6507, is %d", check_msg->biases[56].value); - ck_assert_msg(check_msg->biases[57].code == 225, "incorrect value for biases[57].code, expected 225, is %d", check_msg->biases[57].code); - ck_assert_msg(check_msg->biases[57].value == 2378, "incorrect value for biases[57].value, expected 2378, is %d", check_msg->biases[57].value); - ck_assert_msg(check_msg->biases[58].code == 10, "incorrect value for biases[58].code, expected 10, is %d", check_msg->biases[58].code); - ck_assert_msg(check_msg->biases[58].value == 823, "incorrect value for biases[58].value, expected 823, is %d", check_msg->biases[58].value); - ck_assert_msg(check_msg->biases[59].code == 131, "incorrect value for biases[59].code, expected 131, is %d", check_msg->biases[59].code); - ck_assert_msg(check_msg->biases[59].value == 25590, "incorrect value for biases[59].value, expected 25590, is %d", check_msg->biases[59].value); - ck_assert_msg(check_msg->biases[60].code == 133, "incorrect value for biases[60].code, expected 133, is %d", check_msg->biases[60].code); - ck_assert_msg(check_msg->biases[60].value == -7390, "incorrect value for biases[60].value, expected -7390, is %d", check_msg->biases[60].value); - ck_assert_msg(check_msg->biases[61].code == 203, "incorrect value for biases[61].code, expected 203, is %d", check_msg->biases[61].code); - ck_assert_msg(check_msg->biases[61].value == 4676, "incorrect value for biases[61].value, expected 4676, is %d", check_msg->biases[61].value); - ck_assert_msg(check_msg->biases[62].code == 97, "incorrect value for biases[62].code, expected 97, is %d", check_msg->biases[62].code); - ck_assert_msg(check_msg->biases[62].value == 23007, "incorrect value for biases[62].value, expected 23007, is %d", check_msg->biases[62].value); - ck_assert_msg(check_msg->biases[63].code == 192, "incorrect value for biases[63].code, expected 192, is %d", check_msg->biases[63].code); - ck_assert_msg(check_msg->biases[63].value == 13046, "incorrect value for biases[63].value, expected 13046, is %d", check_msg->biases[63].value); - ck_assert_msg(check_msg->biases[64].code == 69, "incorrect value for biases[64].code, expected 69, is %d", check_msg->biases[64].code); - ck_assert_msg(check_msg->biases[64].value == 2651, "incorrect value for biases[64].value, expected 2651, is %d", check_msg->biases[64].value); - ck_assert_msg(check_msg->biases[65].code == 151, "incorrect value for biases[65].code, expected 151, is %d", check_msg->biases[65].code); - ck_assert_msg(check_msg->biases[65].value == 30282, "incorrect value for biases[65].value, expected 30282, is %d", check_msg->biases[65].value); - ck_assert_msg(check_msg->biases[66].code == 110, "incorrect value for biases[66].code, expected 110, is %d", check_msg->biases[66].code); - ck_assert_msg(check_msg->biases[66].value == -22492, "incorrect value for biases[66].value, expected -22492, is %d", check_msg->biases[66].value); - ck_assert_msg(check_msg->biases[67].code == 247, "incorrect value for biases[67].code, expected 247, is %d", check_msg->biases[67].code); - ck_assert_msg(check_msg->biases[67].value == 19872, "incorrect value for biases[67].value, expected 19872, is %d", check_msg->biases[67].value); - ck_assert_msg(check_msg->biases[68].code == 179, "incorrect value for biases[68].code, expected 179, is %d", check_msg->biases[68].code); - ck_assert_msg(check_msg->biases[68].value == -19827, "incorrect value for biases[68].value, expected -19827, is %d", check_msg->biases[68].value); - ck_assert_msg(check_msg->biases[69].code == 99, "incorrect value for biases[69].code, expected 99, is %d", check_msg->biases[69].code); - ck_assert_msg(check_msg->biases[69].value == 30911, "incorrect value for biases[69].value, expected 30911, is %d", check_msg->biases[69].value); - ck_assert_msg(check_msg->biases[70].code == 77, "incorrect value for biases[70].code, expected 77, is %d", check_msg->biases[70].code); - ck_assert_msg(check_msg->biases[70].value == 23488, "incorrect value for biases[70].value, expected 23488, is %d", check_msg->biases[70].value); - ck_assert_msg(check_msg->biases[71].code == 224, "incorrect value for biases[71].code, expected 224, is %d", check_msg->biases[71].code); - ck_assert_msg(check_msg->biases[71].value == -7679, "incorrect value for biases[71].value, expected -7679, is %d", check_msg->biases[71].value); - ck_assert_msg(check_msg->biases[72].code == 50, "incorrect value for biases[72].code, expected 50, is %d", check_msg->biases[72].code); - ck_assert_msg(check_msg->biases[72].value == -28073, "incorrect value for biases[72].value, expected -28073, is %d", check_msg->biases[72].value); - ck_assert_msg(check_msg->biases[73].code == 148, "incorrect value for biases[73].code, expected 148, is %d", check_msg->biases[73].code); - ck_assert_msg(check_msg->biases[73].value == 25838, "incorrect value for biases[73].value, expected 25838, is %d", check_msg->biases[73].value); - ck_assert_msg(check_msg->biases[74].code == 179, "incorrect value for biases[74].code, expected 179, is %d", check_msg->biases[74].code); - ck_assert_msg(check_msg->biases[74].value == -7299, "incorrect value for biases[74].value, expected -7299, is %d", check_msg->biases[74].value); - ck_assert_msg(check_msg->biases[75].code == 215, "incorrect value for biases[75].code, expected 215, is %d", check_msg->biases[75].code); - ck_assert_msg(check_msg->biases[75].value == -18328, "incorrect value for biases[75].value, expected -18328, is %d", check_msg->biases[75].value); - ck_assert_msg(check_msg->biases[76].code == 31, "incorrect value for biases[76].code, expected 31, is %d", check_msg->biases[76].code); - ck_assert_msg(check_msg->biases[76].value == 23097, "incorrect value for biases[76].value, expected 23097, is %d", check_msg->biases[76].value); - ck_assert_msg(check_msg->biases[77].code == 79, "incorrect value for biases[77].code, expected 79, is %d", check_msg->biases[77].code); - ck_assert_msg(check_msg->biases[77].value == -25579, "incorrect value for biases[77].value, expected -25579, is %d", check_msg->biases[77].value); - ck_assert_msg(check_msg->biases[78].code == 245, "incorrect value for biases[78].code, expected 245, is %d", check_msg->biases[78].code); - ck_assert_msg(check_msg->biases[78].value == 15441, "incorrect value for biases[78].value, expected 15441, is %d", check_msg->biases[78].value); - ck_assert_msg(check_msg->biases[79].code == 93, "incorrect value for biases[79].code, expected 93, is %d", check_msg->biases[79].code); - ck_assert_msg(check_msg->biases[79].value == 15530, "incorrect value for biases[79].value, expected 15530, is %d", check_msg->biases[79].value); - ck_assert_msg(check_msg->biases[80].code == 200, "incorrect value for biases[80].code, expected 200, is %d", check_msg->biases[80].code); - ck_assert_msg(check_msg->biases[80].value == 3495, "incorrect value for biases[80].value, expected 3495, is %d", check_msg->biases[80].value); - ck_assert_msg(check_msg->iod_ssr == 132, "incorrect value for iod_ssr, expected 132, is %d", check_msg->iod_ssr); - ck_assert_msg(check_msg->sid.code == 241, "incorrect value for sid.code, expected 241, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.sat == 133, "incorrect value for sid.sat, expected 133, is %d", check_msg->sid.sat); - ck_assert_msg(check_msg->time.tow == 387144400, "incorrect value for time.tow, expected 387144400, is %d", check_msg->time.tow); - ck_assert_msg(check_msg->time.wn == 16905, "incorrect value for time.wn, expected 16905, is %d", check_msg->time.wn); - ck_assert_msg(check_msg->update_interval == 254, "incorrect value for update_interval, expected 254, is %d", check_msg->update_interval); + ck_assert_msg(check_msg->biases[0].code == 51, + "incorrect value for biases[0].code, expected 51, is %d", + check_msg->biases[0].code); + ck_assert_msg(check_msg->biases[0].value == -31996, + "incorrect value for biases[0].value, expected -31996, is %d", + check_msg->biases[0].value); + ck_assert_msg(check_msg->biases[1].code == 240, + "incorrect value for biases[1].code, expected 240, is %d", + check_msg->biases[1].code); + ck_assert_msg(check_msg->biases[1].value == 21368, + "incorrect value for biases[1].value, expected 21368, is %d", + check_msg->biases[1].value); + ck_assert_msg(check_msg->biases[2].code == 148, + "incorrect value for biases[2].code, expected 148, is %d", + check_msg->biases[2].code); + ck_assert_msg(check_msg->biases[2].value == -10799, + "incorrect value for biases[2].value, expected -10799, is %d", + check_msg->biases[2].value); + ck_assert_msg(check_msg->biases[3].code == 62, + "incorrect value for biases[3].code, expected 62, is %d", + check_msg->biases[3].code); + ck_assert_msg(check_msg->biases[3].value == -5916, + "incorrect value for biases[3].value, expected -5916, is %d", + check_msg->biases[3].value); + ck_assert_msg(check_msg->biases[4].code == 71, + "incorrect value for biases[4].code, expected 71, is %d", + check_msg->biases[4].code); + ck_assert_msg(check_msg->biases[4].value == -17342, + "incorrect value for biases[4].value, expected -17342, is %d", + check_msg->biases[4].value); + ck_assert_msg(check_msg->biases[5].code == 210, + "incorrect value for biases[5].code, expected 210, is %d", + check_msg->biases[5].code); + ck_assert_msg(check_msg->biases[5].value == 13952, + "incorrect value for biases[5].value, expected 13952, is %d", + check_msg->biases[5].value); + ck_assert_msg(check_msg->biases[6].code == 131, + "incorrect value for biases[6].code, expected 131, is %d", + check_msg->biases[6].code); + ck_assert_msg(check_msg->biases[6].value == -32360, + "incorrect value for biases[6].value, expected -32360, is %d", + check_msg->biases[6].value); + ck_assert_msg(check_msg->biases[7].code == 111, + "incorrect value for biases[7].code, expected 111, is %d", + check_msg->biases[7].code); + ck_assert_msg(check_msg->biases[7].value == -3445, + "incorrect value for biases[7].value, expected -3445, is %d", + check_msg->biases[7].value); + ck_assert_msg(check_msg->biases[8].code == 177, + "incorrect value for biases[8].code, expected 177, is %d", + check_msg->biases[8].code); + ck_assert_msg(check_msg->biases[8].value == 11409, + "incorrect value for biases[8].value, expected 11409, is %d", + check_msg->biases[8].value); + ck_assert_msg(check_msg->biases[9].code == 9, + "incorrect value for biases[9].code, expected 9, is %d", + check_msg->biases[9].code); + ck_assert_msg(check_msg->biases[9].value == -12299, + "incorrect value for biases[9].value, expected -12299, is %d", + check_msg->biases[9].value); + ck_assert_msg(check_msg->biases[10].code == 241, + "incorrect value for biases[10].code, expected 241, is %d", + check_msg->biases[10].code); + ck_assert_msg( + check_msg->biases[10].value == -26934, + "incorrect value for biases[10].value, expected -26934, is %d", + check_msg->biases[10].value); + ck_assert_msg(check_msg->biases[11].code == 141, + "incorrect value for biases[11].code, expected 141, is %d", + check_msg->biases[11].code); + ck_assert_msg( + check_msg->biases[11].value == -24782, + "incorrect value for biases[11].value, expected -24782, is %d", + check_msg->biases[11].value); + ck_assert_msg(check_msg->biases[12].code == 220, + "incorrect value for biases[12].code, expected 220, is %d", + check_msg->biases[12].code); + ck_assert_msg(check_msg->biases[12].value == 9611, + "incorrect value for biases[12].value, expected 9611, is %d", + check_msg->biases[12].value); + ck_assert_msg(check_msg->biases[13].code == 187, + "incorrect value for biases[13].code, expected 187, is %d", + check_msg->biases[13].code); + ck_assert_msg( + check_msg->biases[13].value == -16542, + "incorrect value for biases[13].value, expected -16542, is %d", + check_msg->biases[13].value); + ck_assert_msg(check_msg->biases[14].code == 23, + "incorrect value for biases[14].code, expected 23, is %d", + check_msg->biases[14].code); + ck_assert_msg( + check_msg->biases[14].value == -30592, + "incorrect value for biases[14].value, expected -30592, is %d", + check_msg->biases[14].value); + ck_assert_msg(check_msg->biases[15].code == 167, + "incorrect value for biases[15].code, expected 167, is %d", + check_msg->biases[15].code); + ck_assert_msg(check_msg->biases[15].value == 1736, + "incorrect value for biases[15].value, expected 1736, is %d", + check_msg->biases[15].value); + ck_assert_msg(check_msg->biases[16].code == 211, + "incorrect value for biases[16].code, expected 211, is %d", + check_msg->biases[16].code); + ck_assert_msg(check_msg->biases[16].value == 5978, + "incorrect value for biases[16].value, expected 5978, is %d", + check_msg->biases[16].value); + ck_assert_msg(check_msg->biases[17].code == 244, + "incorrect value for biases[17].code, expected 244, is %d", + check_msg->biases[17].code); + ck_assert_msg( + check_msg->biases[17].value == -10358, + "incorrect value for biases[17].value, expected -10358, is %d", + check_msg->biases[17].value); + ck_assert_msg(check_msg->biases[18].code == 209, + "incorrect value for biases[18].code, expected 209, is %d", + check_msg->biases[18].code); + ck_assert_msg(check_msg->biases[18].value == 3467, + "incorrect value for biases[18].value, expected 3467, is %d", + check_msg->biases[18].value); + ck_assert_msg(check_msg->biases[19].code == 101, + "incorrect value for biases[19].code, expected 101, is %d", + check_msg->biases[19].code); + ck_assert_msg(check_msg->biases[19].value == 1824, + "incorrect value for biases[19].value, expected 1824, is %d", + check_msg->biases[19].value); + ck_assert_msg(check_msg->biases[20].code == 18, + "incorrect value for biases[20].code, expected 18, is %d", + check_msg->biases[20].code); + ck_assert_msg(check_msg->biases[20].value == 17949, + "incorrect value for biases[20].value, expected 17949, is %d", + check_msg->biases[20].value); + ck_assert_msg(check_msg->biases[21].code == 250, + "incorrect value for biases[21].code, expected 250, is %d", + check_msg->biases[21].code); + ck_assert_msg(check_msg->biases[21].value == 18797, + "incorrect value for biases[21].value, expected 18797, is %d", + check_msg->biases[21].value); + ck_assert_msg(check_msg->biases[22].code == 202, + "incorrect value for biases[22].code, expected 202, is %d", + check_msg->biases[22].code); + ck_assert_msg( + check_msg->biases[22].value == -28593, + "incorrect value for biases[22].value, expected -28593, is %d", + check_msg->biases[22].value); + ck_assert_msg(check_msg->biases[23].code == 9, + "incorrect value for biases[23].code, expected 9, is %d", + check_msg->biases[23].code); + ck_assert_msg(check_msg->biases[23].value == 17810, + "incorrect value for biases[23].value, expected 17810, is %d", + check_msg->biases[23].value); + ck_assert_msg(check_msg->biases[24].code == 241, + "incorrect value for biases[24].code, expected 241, is %d", + check_msg->biases[24].code); + ck_assert_msg(check_msg->biases[24].value == 5684, + "incorrect value for biases[24].value, expected 5684, is %d", + check_msg->biases[24].value); + ck_assert_msg(check_msg->biases[25].code == 99, + "incorrect value for biases[25].code, expected 99, is %d", + check_msg->biases[25].code); + ck_assert_msg( + check_msg->biases[25].value == -13214, + "incorrect value for biases[25].value, expected -13214, is %d", + check_msg->biases[25].value); + ck_assert_msg(check_msg->biases[26].code == 3, + "incorrect value for biases[26].code, expected 3, is %d", + check_msg->biases[26].code); + ck_assert_msg(check_msg->biases[26].value == -6485, + "incorrect value for biases[26].value, expected -6485, is %d", + check_msg->biases[26].value); + ck_assert_msg(check_msg->biases[27].code == 180, + "incorrect value for biases[27].code, expected 180, is %d", + check_msg->biases[27].code); + ck_assert_msg(check_msg->biases[27].value == 15947, + "incorrect value for biases[27].value, expected 15947, is %d", + check_msg->biases[27].value); + ck_assert_msg(check_msg->biases[28].code == 145, + "incorrect value for biases[28].code, expected 145, is %d", + check_msg->biases[28].code); + ck_assert_msg( + check_msg->biases[28].value == -32170, + "incorrect value for biases[28].value, expected -32170, is %d", + check_msg->biases[28].value); + ck_assert_msg(check_msg->biases[29].code == 31, + "incorrect value for biases[29].code, expected 31, is %d", + check_msg->biases[29].code); + ck_assert_msg( + check_msg->biases[29].value == -25826, + "incorrect value for biases[29].value, expected -25826, is %d", + check_msg->biases[29].value); + ck_assert_msg(check_msg->biases[30].code == 37, + "incorrect value for biases[30].code, expected 37, is %d", + check_msg->biases[30].code); + ck_assert_msg(check_msg->biases[30].value == 14098, + "incorrect value for biases[30].value, expected 14098, is %d", + check_msg->biases[30].value); + ck_assert_msg(check_msg->biases[31].code == 210, + "incorrect value for biases[31].code, expected 210, is %d", + check_msg->biases[31].code); + ck_assert_msg(check_msg->biases[31].value == 32551, + "incorrect value for biases[31].value, expected 32551, is %d", + check_msg->biases[31].value); + ck_assert_msg(check_msg->biases[32].code == 242, + "incorrect value for biases[32].code, expected 242, is %d", + check_msg->biases[32].code); + ck_assert_msg(check_msg->biases[32].value == 3394, + "incorrect value for biases[32].value, expected 3394, is %d", + check_msg->biases[32].value); + ck_assert_msg(check_msg->biases[33].code == 237, + "incorrect value for biases[33].code, expected 237, is %d", + check_msg->biases[33].code); + ck_assert_msg( + check_msg->biases[33].value == -21864, + "incorrect value for biases[33].value, expected -21864, is %d", + check_msg->biases[33].value); + ck_assert_msg(check_msg->biases[34].code == 212, + "incorrect value for biases[34].code, expected 212, is %d", + check_msg->biases[34].code); + ck_assert_msg(check_msg->biases[34].value == -2545, + "incorrect value for biases[34].value, expected -2545, is %d", + check_msg->biases[34].value); + ck_assert_msg(check_msg->biases[35].code == 59, + "incorrect value for biases[35].code, expected 59, is %d", + check_msg->biases[35].code); + ck_assert_msg( + check_msg->biases[35].value == -19362, + "incorrect value for biases[35].value, expected -19362, is %d", + check_msg->biases[35].value); + ck_assert_msg(check_msg->biases[36].code == 195, + "incorrect value for biases[36].code, expected 195, is %d", + check_msg->biases[36].code); + ck_assert_msg(check_msg->biases[36].value == 17821, + "incorrect value for biases[36].value, expected 17821, is %d", + check_msg->biases[36].value); + ck_assert_msg(check_msg->biases[37].code == 100, + "incorrect value for biases[37].code, expected 100, is %d", + check_msg->biases[37].code); + ck_assert_msg(check_msg->biases[37].value == 4215, + "incorrect value for biases[37].value, expected 4215, is %d", + check_msg->biases[37].value); + ck_assert_msg(check_msg->biases[38].code == 68, + "incorrect value for biases[38].code, expected 68, is %d", + check_msg->biases[38].code); + ck_assert_msg( + check_msg->biases[38].value == -20557, + "incorrect value for biases[38].value, expected -20557, is %d", + check_msg->biases[38].value); + ck_assert_msg(check_msg->biases[39].code == 144, + "incorrect value for biases[39].code, expected 144, is %d", + check_msg->biases[39].code); + ck_assert_msg(check_msg->biases[39].value == 20849, + "incorrect value for biases[39].value, expected 20849, is %d", + check_msg->biases[39].value); + ck_assert_msg(check_msg->biases[40].code == 82, + "incorrect value for biases[40].code, expected 82, is %d", + check_msg->biases[40].code); + ck_assert_msg( + check_msg->biases[40].value == -26850, + "incorrect value for biases[40].value, expected -26850, is %d", + check_msg->biases[40].value); + ck_assert_msg(check_msg->biases[41].code == 21, + "incorrect value for biases[41].code, expected 21, is %d", + check_msg->biases[41].code); + ck_assert_msg(check_msg->biases[41].value == 10605, + "incorrect value for biases[41].value, expected 10605, is %d", + check_msg->biases[41].value); + ck_assert_msg(check_msg->biases[42].code == 225, + "incorrect value for biases[42].code, expected 225, is %d", + check_msg->biases[42].code); + ck_assert_msg(check_msg->biases[42].value == 19720, + "incorrect value for biases[42].value, expected 19720, is %d", + check_msg->biases[42].value); + ck_assert_msg(check_msg->biases[43].code == 164, + "incorrect value for biases[43].code, expected 164, is %d", + check_msg->biases[43].code); + ck_assert_msg(check_msg->biases[43].value == 157, + "incorrect value for biases[43].value, expected 157, is %d", + check_msg->biases[43].value); + ck_assert_msg(check_msg->biases[44].code == 73, + "incorrect value for biases[44].code, expected 73, is %d", + check_msg->biases[44].code); + ck_assert_msg(check_msg->biases[44].value == 1566, + "incorrect value for biases[44].value, expected 1566, is %d", + check_msg->biases[44].value); + ck_assert_msg(check_msg->biases[45].code == 78, + "incorrect value for biases[45].code, expected 78, is %d", + check_msg->biases[45].code); + ck_assert_msg( + check_msg->biases[45].value == -28847, + "incorrect value for biases[45].value, expected -28847, is %d", + check_msg->biases[45].value); + ck_assert_msg(check_msg->biases[46].code == 116, + "incorrect value for biases[46].code, expected 116, is %d", + check_msg->biases[46].code); + ck_assert_msg( + check_msg->biases[46].value == -26640, + "incorrect value for biases[46].value, expected -26640, is %d", + check_msg->biases[46].value); + ck_assert_msg(check_msg->biases[47].code == 55, + "incorrect value for biases[47].code, expected 55, is %d", + check_msg->biases[47].code); + ck_assert_msg( + check_msg->biases[47].value == -22087, + "incorrect value for biases[47].value, expected -22087, is %d", + check_msg->biases[47].value); + ck_assert_msg(check_msg->biases[48].code == 254, + "incorrect value for biases[48].code, expected 254, is %d", + check_msg->biases[48].code); + ck_assert_msg(check_msg->biases[48].value == 10035, + "incorrect value for biases[48].value, expected 10035, is %d", + check_msg->biases[48].value); + ck_assert_msg(check_msg->biases[49].code == 74, + "incorrect value for biases[49].code, expected 74, is %d", + check_msg->biases[49].code); + ck_assert_msg(check_msg->biases[49].value == -2129, + "incorrect value for biases[49].value, expected -2129, is %d", + check_msg->biases[49].value); + ck_assert_msg(check_msg->biases[50].code == 34, + "incorrect value for biases[50].code, expected 34, is %d", + check_msg->biases[50].code); + ck_assert_msg(check_msg->biases[50].value == 19041, + "incorrect value for biases[50].value, expected 19041, is %d", + check_msg->biases[50].value); + ck_assert_msg(check_msg->biases[51].code == 97, + "incorrect value for biases[51].code, expected 97, is %d", + check_msg->biases[51].code); + ck_assert_msg(check_msg->biases[51].value == 12464, + "incorrect value for biases[51].value, expected 12464, is %d", + check_msg->biases[51].value); + ck_assert_msg(check_msg->biases[52].code == 236, + "incorrect value for biases[52].code, expected 236, is %d", + check_msg->biases[52].code); + ck_assert_msg(check_msg->biases[52].value == 3245, + "incorrect value for biases[52].value, expected 3245, is %d", + check_msg->biases[52].value); + ck_assert_msg(check_msg->biases[53].code == 174, + "incorrect value for biases[53].code, expected 174, is %d", + check_msg->biases[53].code); + ck_assert_msg( + check_msg->biases[53].value == -32155, + "incorrect value for biases[53].value, expected -32155, is %d", + check_msg->biases[53].value); + ck_assert_msg(check_msg->biases[54].code == 30, + "incorrect value for biases[54].code, expected 30, is %d", + check_msg->biases[54].code); + ck_assert_msg( + check_msg->biases[54].value == -15959, + "incorrect value for biases[54].value, expected -15959, is %d", + check_msg->biases[54].value); + ck_assert_msg(check_msg->biases[55].code == 190, + "incorrect value for biases[55].code, expected 190, is %d", + check_msg->biases[55].code); + ck_assert_msg( + check_msg->biases[55].value == -15156, + "incorrect value for biases[55].value, expected -15156, is %d", + check_msg->biases[55].value); + ck_assert_msg(check_msg->biases[56].code == 123, + "incorrect value for biases[56].code, expected 123, is %d", + check_msg->biases[56].code); + ck_assert_msg(check_msg->biases[56].value == 6507, + "incorrect value for biases[56].value, expected 6507, is %d", + check_msg->biases[56].value); + ck_assert_msg(check_msg->biases[57].code == 225, + "incorrect value for biases[57].code, expected 225, is %d", + check_msg->biases[57].code); + ck_assert_msg(check_msg->biases[57].value == 2378, + "incorrect value for biases[57].value, expected 2378, is %d", + check_msg->biases[57].value); + ck_assert_msg(check_msg->biases[58].code == 10, + "incorrect value for biases[58].code, expected 10, is %d", + check_msg->biases[58].code); + ck_assert_msg(check_msg->biases[58].value == 823, + "incorrect value for biases[58].value, expected 823, is %d", + check_msg->biases[58].value); + ck_assert_msg(check_msg->biases[59].code == 131, + "incorrect value for biases[59].code, expected 131, is %d", + check_msg->biases[59].code); + ck_assert_msg(check_msg->biases[59].value == 25590, + "incorrect value for biases[59].value, expected 25590, is %d", + check_msg->biases[59].value); + ck_assert_msg(check_msg->biases[60].code == 133, + "incorrect value for biases[60].code, expected 133, is %d", + check_msg->biases[60].code); + ck_assert_msg(check_msg->biases[60].value == -7390, + "incorrect value for biases[60].value, expected -7390, is %d", + check_msg->biases[60].value); + ck_assert_msg(check_msg->biases[61].code == 203, + "incorrect value for biases[61].code, expected 203, is %d", + check_msg->biases[61].code); + ck_assert_msg(check_msg->biases[61].value == 4676, + "incorrect value for biases[61].value, expected 4676, is %d", + check_msg->biases[61].value); + ck_assert_msg(check_msg->biases[62].code == 97, + "incorrect value for biases[62].code, expected 97, is %d", + check_msg->biases[62].code); + ck_assert_msg(check_msg->biases[62].value == 23007, + "incorrect value for biases[62].value, expected 23007, is %d", + check_msg->biases[62].value); + ck_assert_msg(check_msg->biases[63].code == 192, + "incorrect value for biases[63].code, expected 192, is %d", + check_msg->biases[63].code); + ck_assert_msg(check_msg->biases[63].value == 13046, + "incorrect value for biases[63].value, expected 13046, is %d", + check_msg->biases[63].value); + ck_assert_msg(check_msg->biases[64].code == 69, + "incorrect value for biases[64].code, expected 69, is %d", + check_msg->biases[64].code); + ck_assert_msg(check_msg->biases[64].value == 2651, + "incorrect value for biases[64].value, expected 2651, is %d", + check_msg->biases[64].value); + ck_assert_msg(check_msg->biases[65].code == 151, + "incorrect value for biases[65].code, expected 151, is %d", + check_msg->biases[65].code); + ck_assert_msg(check_msg->biases[65].value == 30282, + "incorrect value for biases[65].value, expected 30282, is %d", + check_msg->biases[65].value); + ck_assert_msg(check_msg->biases[66].code == 110, + "incorrect value for biases[66].code, expected 110, is %d", + check_msg->biases[66].code); + ck_assert_msg( + check_msg->biases[66].value == -22492, + "incorrect value for biases[66].value, expected -22492, is %d", + check_msg->biases[66].value); + ck_assert_msg(check_msg->biases[67].code == 247, + "incorrect value for biases[67].code, expected 247, is %d", + check_msg->biases[67].code); + ck_assert_msg(check_msg->biases[67].value == 19872, + "incorrect value for biases[67].value, expected 19872, is %d", + check_msg->biases[67].value); + ck_assert_msg(check_msg->biases[68].code == 179, + "incorrect value for biases[68].code, expected 179, is %d", + check_msg->biases[68].code); + ck_assert_msg( + check_msg->biases[68].value == -19827, + "incorrect value for biases[68].value, expected -19827, is %d", + check_msg->biases[68].value); + ck_assert_msg(check_msg->biases[69].code == 99, + "incorrect value for biases[69].code, expected 99, is %d", + check_msg->biases[69].code); + ck_assert_msg(check_msg->biases[69].value == 30911, + "incorrect value for biases[69].value, expected 30911, is %d", + check_msg->biases[69].value); + ck_assert_msg(check_msg->biases[70].code == 77, + "incorrect value for biases[70].code, expected 77, is %d", + check_msg->biases[70].code); + ck_assert_msg(check_msg->biases[70].value == 23488, + "incorrect value for biases[70].value, expected 23488, is %d", + check_msg->biases[70].value); + ck_assert_msg(check_msg->biases[71].code == 224, + "incorrect value for biases[71].code, expected 224, is %d", + check_msg->biases[71].code); + ck_assert_msg(check_msg->biases[71].value == -7679, + "incorrect value for biases[71].value, expected -7679, is %d", + check_msg->biases[71].value); + ck_assert_msg(check_msg->biases[72].code == 50, + "incorrect value for biases[72].code, expected 50, is %d", + check_msg->biases[72].code); + ck_assert_msg( + check_msg->biases[72].value == -28073, + "incorrect value for biases[72].value, expected -28073, is %d", + check_msg->biases[72].value); + ck_assert_msg(check_msg->biases[73].code == 148, + "incorrect value for biases[73].code, expected 148, is %d", + check_msg->biases[73].code); + ck_assert_msg(check_msg->biases[73].value == 25838, + "incorrect value for biases[73].value, expected 25838, is %d", + check_msg->biases[73].value); + ck_assert_msg(check_msg->biases[74].code == 179, + "incorrect value for biases[74].code, expected 179, is %d", + check_msg->biases[74].code); + ck_assert_msg(check_msg->biases[74].value == -7299, + "incorrect value for biases[74].value, expected -7299, is %d", + check_msg->biases[74].value); + ck_assert_msg(check_msg->biases[75].code == 215, + "incorrect value for biases[75].code, expected 215, is %d", + check_msg->biases[75].code); + ck_assert_msg( + check_msg->biases[75].value == -18328, + "incorrect value for biases[75].value, expected -18328, is %d", + check_msg->biases[75].value); + ck_assert_msg(check_msg->biases[76].code == 31, + "incorrect value for biases[76].code, expected 31, is %d", + check_msg->biases[76].code); + ck_assert_msg(check_msg->biases[76].value == 23097, + "incorrect value for biases[76].value, expected 23097, is %d", + check_msg->biases[76].value); + ck_assert_msg(check_msg->biases[77].code == 79, + "incorrect value for biases[77].code, expected 79, is %d", + check_msg->biases[77].code); + ck_assert_msg( + check_msg->biases[77].value == -25579, + "incorrect value for biases[77].value, expected -25579, is %d", + check_msg->biases[77].value); + ck_assert_msg(check_msg->biases[78].code == 245, + "incorrect value for biases[78].code, expected 245, is %d", + check_msg->biases[78].code); + ck_assert_msg(check_msg->biases[78].value == 15441, + "incorrect value for biases[78].value, expected 15441, is %d", + check_msg->biases[78].value); + ck_assert_msg(check_msg->biases[79].code == 93, + "incorrect value for biases[79].code, expected 93, is %d", + check_msg->biases[79].code); + ck_assert_msg(check_msg->biases[79].value == 15530, + "incorrect value for biases[79].value, expected 15530, is %d", + check_msg->biases[79].value); + ck_assert_msg(check_msg->biases[80].code == 200, + "incorrect value for biases[80].code, expected 200, is %d", + check_msg->biases[80].code); + ck_assert_msg(check_msg->biases[80].value == 3495, + "incorrect value for biases[80].value, expected 3495, is %d", + check_msg->biases[80].value); + ck_assert_msg(check_msg->iod_ssr == 132, + "incorrect value for iod_ssr, expected 132, is %d", + check_msg->iod_ssr); + ck_assert_msg(check_msg->sid.code == 241, + "incorrect value for sid.code, expected 241, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.sat == 133, + "incorrect value for sid.sat, expected 133, is %d", + check_msg->sid.sat); + ck_assert_msg(check_msg->time.tow == 387144400, + "incorrect value for time.tow, expected 387144400, is %d", + check_msg->time.tow); + ck_assert_msg(check_msg->time.wn == 16905, + "incorrect value for time.wn, expected 16905, is %d", + check_msg->time.wn); + ck_assert_msg(check_msg->update_interval == 254, + "incorrect value for update_interval, expected 254, is %d", + check_msg->update_interval); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrCodeBiases_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrCodeBiases"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrCodeBiases"); +Suite *legacy_auto_check_sbp_ssr_MsgSsrCodeBiases_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrCodeBiases"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrCodeBiases"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrCodeBiases); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.c index d4eb89bf2..5b0854641 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodePhaseBiasesBounds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodePhaseBiasesBounds.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,24 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 1516, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 1516, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 1516, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 1516, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,236,5,66,0,31,180,0,0,0,3,0,1,2,1,14,15,1,3,0,3,39,1,39,1,1,3,39,1,39,1,1,1,39,1,39,1,23,113, }; + u8 encoded_frame[] = { + 85, 236, 5, 66, 0, 31, 180, 0, 0, 0, 3, 0, 1, + 2, 1, 14, 15, 1, 3, 0, 3, 39, 1, 39, 1, 1, + 3, 39, 1, 39, 1, 1, 1, 39, 1, 39, 1, 23, 113, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_code_phase_biases_bounds_t* test_msg = ( msg_ssr_code_phase_biases_bounds_t* )test_msg_storage; + msg_ssr_code_phase_biases_bounds_t *test_msg = + (msg_ssr_code_phase_biases_bounds_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->const_id = 1; test_msg->header.num_msgs = 1; @@ -182,90 +186,185 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds ) test_msg->satellites_signals[2].sat_id = 1; test_msg->satellites_signals[2].signal_id = 1; test_msg->ssr_iod = 15; - sbp_payload_send(&sbp_state, 1516, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 1516, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 1516, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_code_phase_biases_bounds_t* check_msg = ( msg_ssr_code_phase_biases_bounds_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_code_phase_biases_bounds_t *check_msg = + (msg_ssr_code_phase_biases_bounds_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->const_id == 1, "incorrect value for const_id, expected 1, is %d", check_msg->const_id); - ck_assert_msg(check_msg->header.num_msgs == 1, "incorrect value for header.num_msgs, expected 1, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.seq_num == 2, "incorrect value for header.seq_num, expected 2, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->header.sol_id == 14, "incorrect value for header.sol_id, expected 14, is %d", check_msg->header.sol_id); - ck_assert_msg(check_msg->header.time.tow == 180, "incorrect value for header.time.tow, expected 180, is %d", check_msg->header.time.tow); - ck_assert_msg(check_msg->header.time.wn == 3, "incorrect value for header.time.wn, expected 3, is %d", check_msg->header.time.wn); - ck_assert_msg(check_msg->header.update_interval == 1, "incorrect value for header.update_interval, expected 1, is %d", check_msg->header.update_interval); - ck_assert_msg(check_msg->n_sats_signals == 3, "incorrect value for n_sats_signals, expected 3, is %d", check_msg->n_sats_signals); - ck_assert_msg(check_msg->satellites_signals[0].code_bias_bound_mu == 39, "incorrect value for satellites_signals[0].code_bias_bound_mu, expected 39, is %d", check_msg->satellites_signals[0].code_bias_bound_mu); - ck_assert_msg(check_msg->satellites_signals[0].code_bias_bound_sig == 1, "incorrect value for satellites_signals[0].code_bias_bound_sig, expected 1, is %d", check_msg->satellites_signals[0].code_bias_bound_sig); - ck_assert_msg(check_msg->satellites_signals[0].phase_bias_bound_mu == 39, "incorrect value for satellites_signals[0].phase_bias_bound_mu, expected 39, is %d", check_msg->satellites_signals[0].phase_bias_bound_mu); - ck_assert_msg(check_msg->satellites_signals[0].phase_bias_bound_sig == 1, "incorrect value for satellites_signals[0].phase_bias_bound_sig, expected 1, is %d", check_msg->satellites_signals[0].phase_bias_bound_sig); - ck_assert_msg(check_msg->satellites_signals[0].sat_id == 0, "incorrect value for satellites_signals[0].sat_id, expected 0, is %d", check_msg->satellites_signals[0].sat_id); - ck_assert_msg(check_msg->satellites_signals[0].signal_id == 3, "incorrect value for satellites_signals[0].signal_id, expected 3, is %d", check_msg->satellites_signals[0].signal_id); - ck_assert_msg(check_msg->satellites_signals[1].code_bias_bound_mu == 39, "incorrect value for satellites_signals[1].code_bias_bound_mu, expected 39, is %d", check_msg->satellites_signals[1].code_bias_bound_mu); - ck_assert_msg(check_msg->satellites_signals[1].code_bias_bound_sig == 1, "incorrect value for satellites_signals[1].code_bias_bound_sig, expected 1, is %d", check_msg->satellites_signals[1].code_bias_bound_sig); - ck_assert_msg(check_msg->satellites_signals[1].phase_bias_bound_mu == 39, "incorrect value for satellites_signals[1].phase_bias_bound_mu, expected 39, is %d", check_msg->satellites_signals[1].phase_bias_bound_mu); - ck_assert_msg(check_msg->satellites_signals[1].phase_bias_bound_sig == 1, "incorrect value for satellites_signals[1].phase_bias_bound_sig, expected 1, is %d", check_msg->satellites_signals[1].phase_bias_bound_sig); - ck_assert_msg(check_msg->satellites_signals[1].sat_id == 1, "incorrect value for satellites_signals[1].sat_id, expected 1, is %d", check_msg->satellites_signals[1].sat_id); - ck_assert_msg(check_msg->satellites_signals[1].signal_id == 3, "incorrect value for satellites_signals[1].signal_id, expected 3, is %d", check_msg->satellites_signals[1].signal_id); - ck_assert_msg(check_msg->satellites_signals[2].code_bias_bound_mu == 39, "incorrect value for satellites_signals[2].code_bias_bound_mu, expected 39, is %d", check_msg->satellites_signals[2].code_bias_bound_mu); - ck_assert_msg(check_msg->satellites_signals[2].code_bias_bound_sig == 1, "incorrect value for satellites_signals[2].code_bias_bound_sig, expected 1, is %d", check_msg->satellites_signals[2].code_bias_bound_sig); - ck_assert_msg(check_msg->satellites_signals[2].phase_bias_bound_mu == 39, "incorrect value for satellites_signals[2].phase_bias_bound_mu, expected 39, is %d", check_msg->satellites_signals[2].phase_bias_bound_mu); - ck_assert_msg(check_msg->satellites_signals[2].phase_bias_bound_sig == 1, "incorrect value for satellites_signals[2].phase_bias_bound_sig, expected 1, is %d", check_msg->satellites_signals[2].phase_bias_bound_sig); - ck_assert_msg(check_msg->satellites_signals[2].sat_id == 1, "incorrect value for satellites_signals[2].sat_id, expected 1, is %d", check_msg->satellites_signals[2].sat_id); - ck_assert_msg(check_msg->satellites_signals[2].signal_id == 1, "incorrect value for satellites_signals[2].signal_id, expected 1, is %d", check_msg->satellites_signals[2].signal_id); - ck_assert_msg(check_msg->ssr_iod == 15, "incorrect value for ssr_iod, expected 15, is %d", check_msg->ssr_iod); + ck_assert_msg(check_msg->const_id == 1, + "incorrect value for const_id, expected 1, is %d", + check_msg->const_id); + ck_assert_msg(check_msg->header.num_msgs == 1, + "incorrect value for header.num_msgs, expected 1, is %d", + check_msg->header.num_msgs); + ck_assert_msg(check_msg->header.seq_num == 2, + "incorrect value for header.seq_num, expected 2, is %d", + check_msg->header.seq_num); + ck_assert_msg(check_msg->header.sol_id == 14, + "incorrect value for header.sol_id, expected 14, is %d", + check_msg->header.sol_id); + ck_assert_msg(check_msg->header.time.tow == 180, + "incorrect value for header.time.tow, expected 180, is %d", + check_msg->header.time.tow); + ck_assert_msg(check_msg->header.time.wn == 3, + "incorrect value for header.time.wn, expected 3, is %d", + check_msg->header.time.wn); + ck_assert_msg( + check_msg->header.update_interval == 1, + "incorrect value for header.update_interval, expected 1, is %d", + check_msg->header.update_interval); + ck_assert_msg(check_msg->n_sats_signals == 3, + "incorrect value for n_sats_signals, expected 3, is %d", + check_msg->n_sats_signals); + ck_assert_msg( + check_msg->satellites_signals[0].code_bias_bound_mu == 39, + "incorrect value for satellites_signals[0].code_bias_bound_mu, " + "expected 39, is %d", + check_msg->satellites_signals[0].code_bias_bound_mu); + ck_assert_msg( + check_msg->satellites_signals[0].code_bias_bound_sig == 1, + "incorrect value for satellites_signals[0].code_bias_bound_sig, " + "expected 1, is %d", + check_msg->satellites_signals[0].code_bias_bound_sig); + ck_assert_msg( + check_msg->satellites_signals[0].phase_bias_bound_mu == 39, + "incorrect value for satellites_signals[0].phase_bias_bound_mu, " + "expected 39, is %d", + check_msg->satellites_signals[0].phase_bias_bound_mu); + ck_assert_msg( + check_msg->satellites_signals[0].phase_bias_bound_sig == 1, + "incorrect value for satellites_signals[0].phase_bias_bound_sig, " + "expected 1, is %d", + check_msg->satellites_signals[0].phase_bias_bound_sig); + ck_assert_msg( + check_msg->satellites_signals[0].sat_id == 0, + "incorrect value for satellites_signals[0].sat_id, expected 0, is %d", + check_msg->satellites_signals[0].sat_id); + ck_assert_msg(check_msg->satellites_signals[0].signal_id == 3, + "incorrect value for satellites_signals[0].signal_id, " + "expected 3, is %d", + check_msg->satellites_signals[0].signal_id); + ck_assert_msg( + check_msg->satellites_signals[1].code_bias_bound_mu == 39, + "incorrect value for satellites_signals[1].code_bias_bound_mu, " + "expected 39, is %d", + check_msg->satellites_signals[1].code_bias_bound_mu); + ck_assert_msg( + check_msg->satellites_signals[1].code_bias_bound_sig == 1, + "incorrect value for satellites_signals[1].code_bias_bound_sig, " + "expected 1, is %d", + check_msg->satellites_signals[1].code_bias_bound_sig); + ck_assert_msg( + check_msg->satellites_signals[1].phase_bias_bound_mu == 39, + "incorrect value for satellites_signals[1].phase_bias_bound_mu, " + "expected 39, is %d", + check_msg->satellites_signals[1].phase_bias_bound_mu); + ck_assert_msg( + check_msg->satellites_signals[1].phase_bias_bound_sig == 1, + "incorrect value for satellites_signals[1].phase_bias_bound_sig, " + "expected 1, is %d", + check_msg->satellites_signals[1].phase_bias_bound_sig); + ck_assert_msg( + check_msg->satellites_signals[1].sat_id == 1, + "incorrect value for satellites_signals[1].sat_id, expected 1, is %d", + check_msg->satellites_signals[1].sat_id); + ck_assert_msg(check_msg->satellites_signals[1].signal_id == 3, + "incorrect value for satellites_signals[1].signal_id, " + "expected 3, is %d", + check_msg->satellites_signals[1].signal_id); + ck_assert_msg( + check_msg->satellites_signals[2].code_bias_bound_mu == 39, + "incorrect value for satellites_signals[2].code_bias_bound_mu, " + "expected 39, is %d", + check_msg->satellites_signals[2].code_bias_bound_mu); + ck_assert_msg( + check_msg->satellites_signals[2].code_bias_bound_sig == 1, + "incorrect value for satellites_signals[2].code_bias_bound_sig, " + "expected 1, is %d", + check_msg->satellites_signals[2].code_bias_bound_sig); + ck_assert_msg( + check_msg->satellites_signals[2].phase_bias_bound_mu == 39, + "incorrect value for satellites_signals[2].phase_bias_bound_mu, " + "expected 39, is %d", + check_msg->satellites_signals[2].phase_bias_bound_mu); + ck_assert_msg( + check_msg->satellites_signals[2].phase_bias_bound_sig == 1, + "incorrect value for satellites_signals[2].phase_bias_bound_sig, " + "expected 1, is %d", + check_msg->satellites_signals[2].phase_bias_bound_sig); + ck_assert_msg( + check_msg->satellites_signals[2].sat_id == 1, + "incorrect value for satellites_signals[2].sat_id, expected 1, is %d", + check_msg->satellites_signals[2].sat_id); + ck_assert_msg(check_msg->satellites_signals[2].signal_id == 1, + "incorrect value for satellites_signals[2].signal_id, " + "expected 1, is %d", + check_msg->satellites_signals[2].signal_id); + ck_assert_msg(check_msg->ssr_iod == 15, + "incorrect value for ssr_iod, expected 15, is %d", + check_msg->ssr_iod); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds); +Suite *legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.c index 182791f4f..3bf220b71 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGridDefinitionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGridDefinitionDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,40 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x5f5, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x5f5, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x5f5, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x5f5, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,245,5,181,247,255,11,84,171,229,132,143,46,204,52,92,104,25,204,182,22,98,203,123,211,38,13,253,129,173,171,235,253,26,203,3,120,126,42,44,39,87,69,154,13,28,179,32,47,36,195,39,198,134,235,134,57,120,243,151,35,17,201,211,125,117,164,142,101,239,144,158,239,90,56,71,120,67,221,114,10,190,4,230,164,171,78,185,90,46,177,82,228,123,222,227,145,195,219,27,56,227,246,215,144,158,31,214,241,254,200,86,142,89,12,121,29,124,9,19,153,44,35,126,14,217,65,116,26,139,122,114,90,124,81,0,186,246,46,98,179,243,198,217,36,30,202,12,135,61,42,150,221,102,83,179,43,252,81,62,126,204,195,238,18,128,193,53,94,99,63,182,2,186,220,77,186,224,220,13,212,182,88,15,151,5,93,251,164,18,228,168,226,195,44,170,145,36,58,96,107,144,11,228,12,163,238,247,159,189,1,115,65,202,121,47,193,11,96,93,72,81,207,121,19,151,136,233,51,133,195,77,44,147,206,120,252,77,212,68,60,206,106,207,243,158,94,6,3,205,92,84,2,220,50,61,38,141,117,108,101,76,139, }; + u8 encoded_frame[] = { + 85, 245, 5, 181, 247, 255, 11, 84, 171, 229, 132, 143, 46, 204, + 52, 92, 104, 25, 204, 182, 22, 98, 203, 123, 211, 38, 13, 253, + 129, 173, 171, 235, 253, 26, 203, 3, 120, 126, 42, 44, 39, 87, + 69, 154, 13, 28, 179, 32, 47, 36, 195, 39, 198, 134, 235, 134, + 57, 120, 243, 151, 35, 17, 201, 211, 125, 117, 164, 142, 101, 239, + 144, 158, 239, 90, 56, 71, 120, 67, 221, 114, 10, 190, 4, 230, + 164, 171, 78, 185, 90, 46, 177, 82, 228, 123, 222, 227, 145, 195, + 219, 27, 56, 227, 246, 215, 144, 158, 31, 214, 241, 254, 200, 86, + 142, 89, 12, 121, 29, 124, 9, 19, 153, 44, 35, 126, 14, 217, + 65, 116, 26, 139, 122, 114, 90, 124, 81, 0, 186, 246, 46, 98, + 179, 243, 198, 217, 36, 30, 202, 12, 135, 61, 42, 150, 221, 102, + 83, 179, 43, 252, 81, 62, 126, 204, 195, 238, 18, 128, 193, 53, + 94, 99, 63, 182, 2, 186, 220, 77, 186, 224, 220, 13, 212, 182, + 88, 15, 151, 5, 93, 251, 164, 18, 228, 168, 226, 195, 44, 170, + 145, 36, 58, 96, 107, 144, 11, 228, 12, 163, 238, 247, 159, 189, + 1, 115, 65, 202, 121, 47, 193, 11, 96, 93, 72, 81, 207, 121, + 19, 151, 136, 233, 51, 133, 195, 77, 44, 147, 206, 120, 252, 77, + 212, 68, 60, 206, 106, 207, 243, 158, 94, 6, 3, 205, 92, 84, + 2, 220, 50, 61, 38, 141, 117, 108, 101, 76, 139, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_grid_definition_dep_a_t* test_msg = ( msg_ssr_grid_definition_dep_a_t* )test_msg_storage; + msg_ssr_grid_definition_dep_a_t *test_msg = + (msg_ssr_grid_definition_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.area_width = 43860; test_msg->header.lat_nw_corner_enc = 34021; @@ -1379,315 +1399,833 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA ) test_msg_len += sizeof(test_msg->rle_list[0]); } test_msg->rle_list[245] = 101; - sbp_payload_send(&sbp_state, 0x5f5, 63413, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x5f5, 63413, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 63413, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 63413, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x5f5, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_grid_definition_dep_a_t* check_msg = ( msg_ssr_grid_definition_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_grid_definition_dep_a_t *check_msg = + (msg_ssr_grid_definition_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.area_width == 43860, "incorrect value for header.area_width, expected 43860, is %d", check_msg->header.area_width); - ck_assert_msg(check_msg->header.lat_nw_corner_enc == 34021, "incorrect value for header.lat_nw_corner_enc, expected 34021, is %d", check_msg->header.lat_nw_corner_enc); - ck_assert_msg(check_msg->header.lon_nw_corner_enc == 11919, "incorrect value for header.lon_nw_corner_enc, expected 11919, is %d", check_msg->header.lon_nw_corner_enc); - ck_assert_msg(check_msg->header.num_msgs == 204, "incorrect value for header.num_msgs, expected 204, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.region_size_inverse == 11, "incorrect value for header.region_size_inverse, expected 11, is %d", check_msg->header.region_size_inverse); - ck_assert_msg(check_msg->header.seq_num == 52, "incorrect value for header.seq_num, expected 52, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->rle_list[0] == 92, "incorrect value for rle_list[0], expected 92, is %d", check_msg->rle_list[0]); - ck_assert_msg(check_msg->rle_list[1] == 104, "incorrect value for rle_list[1], expected 104, is %d", check_msg->rle_list[1]); - ck_assert_msg(check_msg->rle_list[2] == 25, "incorrect value for rle_list[2], expected 25, is %d", check_msg->rle_list[2]); - ck_assert_msg(check_msg->rle_list[3] == 204, "incorrect value for rle_list[3], expected 204, is %d", check_msg->rle_list[3]); - ck_assert_msg(check_msg->rle_list[4] == 182, "incorrect value for rle_list[4], expected 182, is %d", check_msg->rle_list[4]); - ck_assert_msg(check_msg->rle_list[5] == 22, "incorrect value for rle_list[5], expected 22, is %d", check_msg->rle_list[5]); - ck_assert_msg(check_msg->rle_list[6] == 98, "incorrect value for rle_list[6], expected 98, is %d", check_msg->rle_list[6]); - ck_assert_msg(check_msg->rle_list[7] == 203, "incorrect value for rle_list[7], expected 203, is %d", check_msg->rle_list[7]); - ck_assert_msg(check_msg->rle_list[8] == 123, "incorrect value for rle_list[8], expected 123, is %d", check_msg->rle_list[8]); - ck_assert_msg(check_msg->rle_list[9] == 211, "incorrect value for rle_list[9], expected 211, is %d", check_msg->rle_list[9]); - ck_assert_msg(check_msg->rle_list[10] == 38, "incorrect value for rle_list[10], expected 38, is %d", check_msg->rle_list[10]); - ck_assert_msg(check_msg->rle_list[11] == 13, "incorrect value for rle_list[11], expected 13, is %d", check_msg->rle_list[11]); - ck_assert_msg(check_msg->rle_list[12] == 253, "incorrect value for rle_list[12], expected 253, is %d", check_msg->rle_list[12]); - ck_assert_msg(check_msg->rle_list[13] == 129, "incorrect value for rle_list[13], expected 129, is %d", check_msg->rle_list[13]); - ck_assert_msg(check_msg->rle_list[14] == 173, "incorrect value for rle_list[14], expected 173, is %d", check_msg->rle_list[14]); - ck_assert_msg(check_msg->rle_list[15] == 171, "incorrect value for rle_list[15], expected 171, is %d", check_msg->rle_list[15]); - ck_assert_msg(check_msg->rle_list[16] == 235, "incorrect value for rle_list[16], expected 235, is %d", check_msg->rle_list[16]); - ck_assert_msg(check_msg->rle_list[17] == 253, "incorrect value for rle_list[17], expected 253, is %d", check_msg->rle_list[17]); - ck_assert_msg(check_msg->rle_list[18] == 26, "incorrect value for rle_list[18], expected 26, is %d", check_msg->rle_list[18]); - ck_assert_msg(check_msg->rle_list[19] == 203, "incorrect value for rle_list[19], expected 203, is %d", check_msg->rle_list[19]); - ck_assert_msg(check_msg->rle_list[20] == 3, "incorrect value for rle_list[20], expected 3, is %d", check_msg->rle_list[20]); - ck_assert_msg(check_msg->rle_list[21] == 120, "incorrect value for rle_list[21], expected 120, is %d", check_msg->rle_list[21]); - ck_assert_msg(check_msg->rle_list[22] == 126, "incorrect value for rle_list[22], expected 126, is %d", check_msg->rle_list[22]); - ck_assert_msg(check_msg->rle_list[23] == 42, "incorrect value for rle_list[23], expected 42, is %d", check_msg->rle_list[23]); - ck_assert_msg(check_msg->rle_list[24] == 44, "incorrect value for rle_list[24], expected 44, is %d", check_msg->rle_list[24]); - ck_assert_msg(check_msg->rle_list[25] == 39, "incorrect value for rle_list[25], expected 39, is %d", check_msg->rle_list[25]); - ck_assert_msg(check_msg->rle_list[26] == 87, "incorrect value for rle_list[26], expected 87, is %d", check_msg->rle_list[26]); - ck_assert_msg(check_msg->rle_list[27] == 69, "incorrect value for rle_list[27], expected 69, is %d", check_msg->rle_list[27]); - ck_assert_msg(check_msg->rle_list[28] == 154, "incorrect value for rle_list[28], expected 154, is %d", check_msg->rle_list[28]); - ck_assert_msg(check_msg->rle_list[29] == 13, "incorrect value for rle_list[29], expected 13, is %d", check_msg->rle_list[29]); - ck_assert_msg(check_msg->rle_list[30] == 28, "incorrect value for rle_list[30], expected 28, is %d", check_msg->rle_list[30]); - ck_assert_msg(check_msg->rle_list[31] == 179, "incorrect value for rle_list[31], expected 179, is %d", check_msg->rle_list[31]); - ck_assert_msg(check_msg->rle_list[32] == 32, "incorrect value for rle_list[32], expected 32, is %d", check_msg->rle_list[32]); - ck_assert_msg(check_msg->rle_list[33] == 47, "incorrect value for rle_list[33], expected 47, is %d", check_msg->rle_list[33]); - ck_assert_msg(check_msg->rle_list[34] == 36, "incorrect value for rle_list[34], expected 36, is %d", check_msg->rle_list[34]); - ck_assert_msg(check_msg->rle_list[35] == 195, "incorrect value for rle_list[35], expected 195, is %d", check_msg->rle_list[35]); - ck_assert_msg(check_msg->rle_list[36] == 39, "incorrect value for rle_list[36], expected 39, is %d", check_msg->rle_list[36]); - ck_assert_msg(check_msg->rle_list[37] == 198, "incorrect value for rle_list[37], expected 198, is %d", check_msg->rle_list[37]); - ck_assert_msg(check_msg->rle_list[38] == 134, "incorrect value for rle_list[38], expected 134, is %d", check_msg->rle_list[38]); - ck_assert_msg(check_msg->rle_list[39] == 235, "incorrect value for rle_list[39], expected 235, is %d", check_msg->rle_list[39]); - ck_assert_msg(check_msg->rle_list[40] == 134, "incorrect value for rle_list[40], expected 134, is %d", check_msg->rle_list[40]); - ck_assert_msg(check_msg->rle_list[41] == 57, "incorrect value for rle_list[41], expected 57, is %d", check_msg->rle_list[41]); - ck_assert_msg(check_msg->rle_list[42] == 120, "incorrect value for rle_list[42], expected 120, is %d", check_msg->rle_list[42]); - ck_assert_msg(check_msg->rle_list[43] == 243, "incorrect value for rle_list[43], expected 243, is %d", check_msg->rle_list[43]); - ck_assert_msg(check_msg->rle_list[44] == 151, "incorrect value for rle_list[44], expected 151, is %d", check_msg->rle_list[44]); - ck_assert_msg(check_msg->rle_list[45] == 35, "incorrect value for rle_list[45], expected 35, is %d", check_msg->rle_list[45]); - ck_assert_msg(check_msg->rle_list[46] == 17, "incorrect value for rle_list[46], expected 17, is %d", check_msg->rle_list[46]); - ck_assert_msg(check_msg->rle_list[47] == 201, "incorrect value for rle_list[47], expected 201, is %d", check_msg->rle_list[47]); - ck_assert_msg(check_msg->rle_list[48] == 211, "incorrect value for rle_list[48], expected 211, is %d", check_msg->rle_list[48]); - ck_assert_msg(check_msg->rle_list[49] == 125, "incorrect value for rle_list[49], expected 125, is %d", check_msg->rle_list[49]); - ck_assert_msg(check_msg->rle_list[50] == 117, "incorrect value for rle_list[50], expected 117, is %d", check_msg->rle_list[50]); - ck_assert_msg(check_msg->rle_list[51] == 164, "incorrect value for rle_list[51], expected 164, is %d", check_msg->rle_list[51]); - ck_assert_msg(check_msg->rle_list[52] == 142, "incorrect value for rle_list[52], expected 142, is %d", check_msg->rle_list[52]); - ck_assert_msg(check_msg->rle_list[53] == 101, "incorrect value for rle_list[53], expected 101, is %d", check_msg->rle_list[53]); - ck_assert_msg(check_msg->rle_list[54] == 239, "incorrect value for rle_list[54], expected 239, is %d", check_msg->rle_list[54]); - ck_assert_msg(check_msg->rle_list[55] == 144, "incorrect value for rle_list[55], expected 144, is %d", check_msg->rle_list[55]); - ck_assert_msg(check_msg->rle_list[56] == 158, "incorrect value for rle_list[56], expected 158, is %d", check_msg->rle_list[56]); - ck_assert_msg(check_msg->rle_list[57] == 239, "incorrect value for rle_list[57], expected 239, is %d", check_msg->rle_list[57]); - ck_assert_msg(check_msg->rle_list[58] == 90, "incorrect value for rle_list[58], expected 90, is %d", check_msg->rle_list[58]); - ck_assert_msg(check_msg->rle_list[59] == 56, "incorrect value for rle_list[59], expected 56, is %d", check_msg->rle_list[59]); - ck_assert_msg(check_msg->rle_list[60] == 71, "incorrect value for rle_list[60], expected 71, is %d", check_msg->rle_list[60]); - ck_assert_msg(check_msg->rle_list[61] == 120, "incorrect value for rle_list[61], expected 120, is %d", check_msg->rle_list[61]); - ck_assert_msg(check_msg->rle_list[62] == 67, "incorrect value for rle_list[62], expected 67, is %d", check_msg->rle_list[62]); - ck_assert_msg(check_msg->rle_list[63] == 221, "incorrect value for rle_list[63], expected 221, is %d", check_msg->rle_list[63]); - ck_assert_msg(check_msg->rle_list[64] == 114, "incorrect value for rle_list[64], expected 114, is %d", check_msg->rle_list[64]); - ck_assert_msg(check_msg->rle_list[65] == 10, "incorrect value for rle_list[65], expected 10, is %d", check_msg->rle_list[65]); - ck_assert_msg(check_msg->rle_list[66] == 190, "incorrect value for rle_list[66], expected 190, is %d", check_msg->rle_list[66]); - ck_assert_msg(check_msg->rle_list[67] == 4, "incorrect value for rle_list[67], expected 4, is %d", check_msg->rle_list[67]); - ck_assert_msg(check_msg->rle_list[68] == 230, "incorrect value for rle_list[68], expected 230, is %d", check_msg->rle_list[68]); - ck_assert_msg(check_msg->rle_list[69] == 164, "incorrect value for rle_list[69], expected 164, is %d", check_msg->rle_list[69]); - ck_assert_msg(check_msg->rle_list[70] == 171, "incorrect value for rle_list[70], expected 171, is %d", check_msg->rle_list[70]); - ck_assert_msg(check_msg->rle_list[71] == 78, "incorrect value for rle_list[71], expected 78, is %d", check_msg->rle_list[71]); - ck_assert_msg(check_msg->rle_list[72] == 185, "incorrect value for rle_list[72], expected 185, is %d", check_msg->rle_list[72]); - ck_assert_msg(check_msg->rle_list[73] == 90, "incorrect value for rle_list[73], expected 90, is %d", check_msg->rle_list[73]); - ck_assert_msg(check_msg->rle_list[74] == 46, "incorrect value for rle_list[74], expected 46, is %d", check_msg->rle_list[74]); - ck_assert_msg(check_msg->rle_list[75] == 177, "incorrect value for rle_list[75], expected 177, is %d", check_msg->rle_list[75]); - ck_assert_msg(check_msg->rle_list[76] == 82, "incorrect value for rle_list[76], expected 82, is %d", check_msg->rle_list[76]); - ck_assert_msg(check_msg->rle_list[77] == 228, "incorrect value for rle_list[77], expected 228, is %d", check_msg->rle_list[77]); - ck_assert_msg(check_msg->rle_list[78] == 123, "incorrect value for rle_list[78], expected 123, is %d", check_msg->rle_list[78]); - ck_assert_msg(check_msg->rle_list[79] == 222, "incorrect value for rle_list[79], expected 222, is %d", check_msg->rle_list[79]); - ck_assert_msg(check_msg->rle_list[80] == 227, "incorrect value for rle_list[80], expected 227, is %d", check_msg->rle_list[80]); - ck_assert_msg(check_msg->rle_list[81] == 145, "incorrect value for rle_list[81], expected 145, is %d", check_msg->rle_list[81]); - ck_assert_msg(check_msg->rle_list[82] == 195, "incorrect value for rle_list[82], expected 195, is %d", check_msg->rle_list[82]); - ck_assert_msg(check_msg->rle_list[83] == 219, "incorrect value for rle_list[83], expected 219, is %d", check_msg->rle_list[83]); - ck_assert_msg(check_msg->rle_list[84] == 27, "incorrect value for rle_list[84], expected 27, is %d", check_msg->rle_list[84]); - ck_assert_msg(check_msg->rle_list[85] == 56, "incorrect value for rle_list[85], expected 56, is %d", check_msg->rle_list[85]); - ck_assert_msg(check_msg->rle_list[86] == 227, "incorrect value for rle_list[86], expected 227, is %d", check_msg->rle_list[86]); - ck_assert_msg(check_msg->rle_list[87] == 246, "incorrect value for rle_list[87], expected 246, is %d", check_msg->rle_list[87]); - ck_assert_msg(check_msg->rle_list[88] == 215, "incorrect value for rle_list[88], expected 215, is %d", check_msg->rle_list[88]); - ck_assert_msg(check_msg->rle_list[89] == 144, "incorrect value for rle_list[89], expected 144, is %d", check_msg->rle_list[89]); - ck_assert_msg(check_msg->rle_list[90] == 158, "incorrect value for rle_list[90], expected 158, is %d", check_msg->rle_list[90]); - ck_assert_msg(check_msg->rle_list[91] == 31, "incorrect value for rle_list[91], expected 31, is %d", check_msg->rle_list[91]); - ck_assert_msg(check_msg->rle_list[92] == 214, "incorrect value for rle_list[92], expected 214, is %d", check_msg->rle_list[92]); - ck_assert_msg(check_msg->rle_list[93] == 241, "incorrect value for rle_list[93], expected 241, is %d", check_msg->rle_list[93]); - ck_assert_msg(check_msg->rle_list[94] == 254, "incorrect value for rle_list[94], expected 254, is %d", check_msg->rle_list[94]); - ck_assert_msg(check_msg->rle_list[95] == 200, "incorrect value for rle_list[95], expected 200, is %d", check_msg->rle_list[95]); - ck_assert_msg(check_msg->rle_list[96] == 86, "incorrect value for rle_list[96], expected 86, is %d", check_msg->rle_list[96]); - ck_assert_msg(check_msg->rle_list[97] == 142, "incorrect value for rle_list[97], expected 142, is %d", check_msg->rle_list[97]); - ck_assert_msg(check_msg->rle_list[98] == 89, "incorrect value for rle_list[98], expected 89, is %d", check_msg->rle_list[98]); - ck_assert_msg(check_msg->rle_list[99] == 12, "incorrect value for rle_list[99], expected 12, is %d", check_msg->rle_list[99]); - ck_assert_msg(check_msg->rle_list[100] == 121, "incorrect value for rle_list[100], expected 121, is %d", check_msg->rle_list[100]); - ck_assert_msg(check_msg->rle_list[101] == 29, "incorrect value for rle_list[101], expected 29, is %d", check_msg->rle_list[101]); - ck_assert_msg(check_msg->rle_list[102] == 124, "incorrect value for rle_list[102], expected 124, is %d", check_msg->rle_list[102]); - ck_assert_msg(check_msg->rle_list[103] == 9, "incorrect value for rle_list[103], expected 9, is %d", check_msg->rle_list[103]); - ck_assert_msg(check_msg->rle_list[104] == 19, "incorrect value for rle_list[104], expected 19, is %d", check_msg->rle_list[104]); - ck_assert_msg(check_msg->rle_list[105] == 153, "incorrect value for rle_list[105], expected 153, is %d", check_msg->rle_list[105]); - ck_assert_msg(check_msg->rle_list[106] == 44, "incorrect value for rle_list[106], expected 44, is %d", check_msg->rle_list[106]); - ck_assert_msg(check_msg->rle_list[107] == 35, "incorrect value for rle_list[107], expected 35, is %d", check_msg->rle_list[107]); - ck_assert_msg(check_msg->rle_list[108] == 126, "incorrect value for rle_list[108], expected 126, is %d", check_msg->rle_list[108]); - ck_assert_msg(check_msg->rle_list[109] == 14, "incorrect value for rle_list[109], expected 14, is %d", check_msg->rle_list[109]); - ck_assert_msg(check_msg->rle_list[110] == 217, "incorrect value for rle_list[110], expected 217, is %d", check_msg->rle_list[110]); - ck_assert_msg(check_msg->rle_list[111] == 65, "incorrect value for rle_list[111], expected 65, is %d", check_msg->rle_list[111]); - ck_assert_msg(check_msg->rle_list[112] == 116, "incorrect value for rle_list[112], expected 116, is %d", check_msg->rle_list[112]); - ck_assert_msg(check_msg->rle_list[113] == 26, "incorrect value for rle_list[113], expected 26, is %d", check_msg->rle_list[113]); - ck_assert_msg(check_msg->rle_list[114] == 139, "incorrect value for rle_list[114], expected 139, is %d", check_msg->rle_list[114]); - ck_assert_msg(check_msg->rle_list[115] == 122, "incorrect value for rle_list[115], expected 122, is %d", check_msg->rle_list[115]); - ck_assert_msg(check_msg->rle_list[116] == 114, "incorrect value for rle_list[116], expected 114, is %d", check_msg->rle_list[116]); - ck_assert_msg(check_msg->rle_list[117] == 90, "incorrect value for rle_list[117], expected 90, is %d", check_msg->rle_list[117]); - ck_assert_msg(check_msg->rle_list[118] == 124, "incorrect value for rle_list[118], expected 124, is %d", check_msg->rle_list[118]); - ck_assert_msg(check_msg->rle_list[119] == 81, "incorrect value for rle_list[119], expected 81, is %d", check_msg->rle_list[119]); - ck_assert_msg(check_msg->rle_list[120] == 0, "incorrect value for rle_list[120], expected 0, is %d", check_msg->rle_list[120]); - ck_assert_msg(check_msg->rle_list[121] == 186, "incorrect value for rle_list[121], expected 186, is %d", check_msg->rle_list[121]); - ck_assert_msg(check_msg->rle_list[122] == 246, "incorrect value for rle_list[122], expected 246, is %d", check_msg->rle_list[122]); - ck_assert_msg(check_msg->rle_list[123] == 46, "incorrect value for rle_list[123], expected 46, is %d", check_msg->rle_list[123]); - ck_assert_msg(check_msg->rle_list[124] == 98, "incorrect value for rle_list[124], expected 98, is %d", check_msg->rle_list[124]); - ck_assert_msg(check_msg->rle_list[125] == 179, "incorrect value for rle_list[125], expected 179, is %d", check_msg->rle_list[125]); - ck_assert_msg(check_msg->rle_list[126] == 243, "incorrect value for rle_list[126], expected 243, is %d", check_msg->rle_list[126]); - ck_assert_msg(check_msg->rle_list[127] == 198, "incorrect value for rle_list[127], expected 198, is %d", check_msg->rle_list[127]); - ck_assert_msg(check_msg->rle_list[128] == 217, "incorrect value for rle_list[128], expected 217, is %d", check_msg->rle_list[128]); - ck_assert_msg(check_msg->rle_list[129] == 36, "incorrect value for rle_list[129], expected 36, is %d", check_msg->rle_list[129]); - ck_assert_msg(check_msg->rle_list[130] == 30, "incorrect value for rle_list[130], expected 30, is %d", check_msg->rle_list[130]); - ck_assert_msg(check_msg->rle_list[131] == 202, "incorrect value for rle_list[131], expected 202, is %d", check_msg->rle_list[131]); - ck_assert_msg(check_msg->rle_list[132] == 12, "incorrect value for rle_list[132], expected 12, is %d", check_msg->rle_list[132]); - ck_assert_msg(check_msg->rle_list[133] == 135, "incorrect value for rle_list[133], expected 135, is %d", check_msg->rle_list[133]); - ck_assert_msg(check_msg->rle_list[134] == 61, "incorrect value for rle_list[134], expected 61, is %d", check_msg->rle_list[134]); - ck_assert_msg(check_msg->rle_list[135] == 42, "incorrect value for rle_list[135], expected 42, is %d", check_msg->rle_list[135]); - ck_assert_msg(check_msg->rle_list[136] == 150, "incorrect value for rle_list[136], expected 150, is %d", check_msg->rle_list[136]); - ck_assert_msg(check_msg->rle_list[137] == 221, "incorrect value for rle_list[137], expected 221, is %d", check_msg->rle_list[137]); - ck_assert_msg(check_msg->rle_list[138] == 102, "incorrect value for rle_list[138], expected 102, is %d", check_msg->rle_list[138]); - ck_assert_msg(check_msg->rle_list[139] == 83, "incorrect value for rle_list[139], expected 83, is %d", check_msg->rle_list[139]); - ck_assert_msg(check_msg->rle_list[140] == 179, "incorrect value for rle_list[140], expected 179, is %d", check_msg->rle_list[140]); - ck_assert_msg(check_msg->rle_list[141] == 43, "incorrect value for rle_list[141], expected 43, is %d", check_msg->rle_list[141]); - ck_assert_msg(check_msg->rle_list[142] == 252, "incorrect value for rle_list[142], expected 252, is %d", check_msg->rle_list[142]); - ck_assert_msg(check_msg->rle_list[143] == 81, "incorrect value for rle_list[143], expected 81, is %d", check_msg->rle_list[143]); - ck_assert_msg(check_msg->rle_list[144] == 62, "incorrect value for rle_list[144], expected 62, is %d", check_msg->rle_list[144]); - ck_assert_msg(check_msg->rle_list[145] == 126, "incorrect value for rle_list[145], expected 126, is %d", check_msg->rle_list[145]); - ck_assert_msg(check_msg->rle_list[146] == 204, "incorrect value for rle_list[146], expected 204, is %d", check_msg->rle_list[146]); - ck_assert_msg(check_msg->rle_list[147] == 195, "incorrect value for rle_list[147], expected 195, is %d", check_msg->rle_list[147]); - ck_assert_msg(check_msg->rle_list[148] == 238, "incorrect value for rle_list[148], expected 238, is %d", check_msg->rle_list[148]); - ck_assert_msg(check_msg->rle_list[149] == 18, "incorrect value for rle_list[149], expected 18, is %d", check_msg->rle_list[149]); - ck_assert_msg(check_msg->rle_list[150] == 128, "incorrect value for rle_list[150], expected 128, is %d", check_msg->rle_list[150]); - ck_assert_msg(check_msg->rle_list[151] == 193, "incorrect value for rle_list[151], expected 193, is %d", check_msg->rle_list[151]); - ck_assert_msg(check_msg->rle_list[152] == 53, "incorrect value for rle_list[152], expected 53, is %d", check_msg->rle_list[152]); - ck_assert_msg(check_msg->rle_list[153] == 94, "incorrect value for rle_list[153], expected 94, is %d", check_msg->rle_list[153]); - ck_assert_msg(check_msg->rle_list[154] == 99, "incorrect value for rle_list[154], expected 99, is %d", check_msg->rle_list[154]); - ck_assert_msg(check_msg->rle_list[155] == 63, "incorrect value for rle_list[155], expected 63, is %d", check_msg->rle_list[155]); - ck_assert_msg(check_msg->rle_list[156] == 182, "incorrect value for rle_list[156], expected 182, is %d", check_msg->rle_list[156]); - ck_assert_msg(check_msg->rle_list[157] == 2, "incorrect value for rle_list[157], expected 2, is %d", check_msg->rle_list[157]); - ck_assert_msg(check_msg->rle_list[158] == 186, "incorrect value for rle_list[158], expected 186, is %d", check_msg->rle_list[158]); - ck_assert_msg(check_msg->rle_list[159] == 220, "incorrect value for rle_list[159], expected 220, is %d", check_msg->rle_list[159]); - ck_assert_msg(check_msg->rle_list[160] == 77, "incorrect value for rle_list[160], expected 77, is %d", check_msg->rle_list[160]); - ck_assert_msg(check_msg->rle_list[161] == 186, "incorrect value for rle_list[161], expected 186, is %d", check_msg->rle_list[161]); - ck_assert_msg(check_msg->rle_list[162] == 224, "incorrect value for rle_list[162], expected 224, is %d", check_msg->rle_list[162]); - ck_assert_msg(check_msg->rle_list[163] == 220, "incorrect value for rle_list[163], expected 220, is %d", check_msg->rle_list[163]); - ck_assert_msg(check_msg->rle_list[164] == 13, "incorrect value for rle_list[164], expected 13, is %d", check_msg->rle_list[164]); - ck_assert_msg(check_msg->rle_list[165] == 212, "incorrect value for rle_list[165], expected 212, is %d", check_msg->rle_list[165]); - ck_assert_msg(check_msg->rle_list[166] == 182, "incorrect value for rle_list[166], expected 182, is %d", check_msg->rle_list[166]); - ck_assert_msg(check_msg->rle_list[167] == 88, "incorrect value for rle_list[167], expected 88, is %d", check_msg->rle_list[167]); - ck_assert_msg(check_msg->rle_list[168] == 15, "incorrect value for rle_list[168], expected 15, is %d", check_msg->rle_list[168]); - ck_assert_msg(check_msg->rle_list[169] == 151, "incorrect value for rle_list[169], expected 151, is %d", check_msg->rle_list[169]); - ck_assert_msg(check_msg->rle_list[170] == 5, "incorrect value for rle_list[170], expected 5, is %d", check_msg->rle_list[170]); - ck_assert_msg(check_msg->rle_list[171] == 93, "incorrect value for rle_list[171], expected 93, is %d", check_msg->rle_list[171]); - ck_assert_msg(check_msg->rle_list[172] == 251, "incorrect value for rle_list[172], expected 251, is %d", check_msg->rle_list[172]); - ck_assert_msg(check_msg->rle_list[173] == 164, "incorrect value for rle_list[173], expected 164, is %d", check_msg->rle_list[173]); - ck_assert_msg(check_msg->rle_list[174] == 18, "incorrect value for rle_list[174], expected 18, is %d", check_msg->rle_list[174]); - ck_assert_msg(check_msg->rle_list[175] == 228, "incorrect value for rle_list[175], expected 228, is %d", check_msg->rle_list[175]); - ck_assert_msg(check_msg->rle_list[176] == 168, "incorrect value for rle_list[176], expected 168, is %d", check_msg->rle_list[176]); - ck_assert_msg(check_msg->rle_list[177] == 226, "incorrect value for rle_list[177], expected 226, is %d", check_msg->rle_list[177]); - ck_assert_msg(check_msg->rle_list[178] == 195, "incorrect value for rle_list[178], expected 195, is %d", check_msg->rle_list[178]); - ck_assert_msg(check_msg->rle_list[179] == 44, "incorrect value for rle_list[179], expected 44, is %d", check_msg->rle_list[179]); - ck_assert_msg(check_msg->rle_list[180] == 170, "incorrect value for rle_list[180], expected 170, is %d", check_msg->rle_list[180]); - ck_assert_msg(check_msg->rle_list[181] == 145, "incorrect value for rle_list[181], expected 145, is %d", check_msg->rle_list[181]); - ck_assert_msg(check_msg->rle_list[182] == 36, "incorrect value for rle_list[182], expected 36, is %d", check_msg->rle_list[182]); - ck_assert_msg(check_msg->rle_list[183] == 58, "incorrect value for rle_list[183], expected 58, is %d", check_msg->rle_list[183]); - ck_assert_msg(check_msg->rle_list[184] == 96, "incorrect value for rle_list[184], expected 96, is %d", check_msg->rle_list[184]); - ck_assert_msg(check_msg->rle_list[185] == 107, "incorrect value for rle_list[185], expected 107, is %d", check_msg->rle_list[185]); - ck_assert_msg(check_msg->rle_list[186] == 144, "incorrect value for rle_list[186], expected 144, is %d", check_msg->rle_list[186]); - ck_assert_msg(check_msg->rle_list[187] == 11, "incorrect value for rle_list[187], expected 11, is %d", check_msg->rle_list[187]); - ck_assert_msg(check_msg->rle_list[188] == 228, "incorrect value for rle_list[188], expected 228, is %d", check_msg->rle_list[188]); - ck_assert_msg(check_msg->rle_list[189] == 12, "incorrect value for rle_list[189], expected 12, is %d", check_msg->rle_list[189]); - ck_assert_msg(check_msg->rle_list[190] == 163, "incorrect value for rle_list[190], expected 163, is %d", check_msg->rle_list[190]); - ck_assert_msg(check_msg->rle_list[191] == 238, "incorrect value for rle_list[191], expected 238, is %d", check_msg->rle_list[191]); - ck_assert_msg(check_msg->rle_list[192] == 247, "incorrect value for rle_list[192], expected 247, is %d", check_msg->rle_list[192]); - ck_assert_msg(check_msg->rle_list[193] == 159, "incorrect value for rle_list[193], expected 159, is %d", check_msg->rle_list[193]); - ck_assert_msg(check_msg->rle_list[194] == 189, "incorrect value for rle_list[194], expected 189, is %d", check_msg->rle_list[194]); - ck_assert_msg(check_msg->rle_list[195] == 1, "incorrect value for rle_list[195], expected 1, is %d", check_msg->rle_list[195]); - ck_assert_msg(check_msg->rle_list[196] == 115, "incorrect value for rle_list[196], expected 115, is %d", check_msg->rle_list[196]); - ck_assert_msg(check_msg->rle_list[197] == 65, "incorrect value for rle_list[197], expected 65, is %d", check_msg->rle_list[197]); - ck_assert_msg(check_msg->rle_list[198] == 202, "incorrect value for rle_list[198], expected 202, is %d", check_msg->rle_list[198]); - ck_assert_msg(check_msg->rle_list[199] == 121, "incorrect value for rle_list[199], expected 121, is %d", check_msg->rle_list[199]); - ck_assert_msg(check_msg->rle_list[200] == 47, "incorrect value for rle_list[200], expected 47, is %d", check_msg->rle_list[200]); - ck_assert_msg(check_msg->rle_list[201] == 193, "incorrect value for rle_list[201], expected 193, is %d", check_msg->rle_list[201]); - ck_assert_msg(check_msg->rle_list[202] == 11, "incorrect value for rle_list[202], expected 11, is %d", check_msg->rle_list[202]); - ck_assert_msg(check_msg->rle_list[203] == 96, "incorrect value for rle_list[203], expected 96, is %d", check_msg->rle_list[203]); - ck_assert_msg(check_msg->rle_list[204] == 93, "incorrect value for rle_list[204], expected 93, is %d", check_msg->rle_list[204]); - ck_assert_msg(check_msg->rle_list[205] == 72, "incorrect value for rle_list[205], expected 72, is %d", check_msg->rle_list[205]); - ck_assert_msg(check_msg->rle_list[206] == 81, "incorrect value for rle_list[206], expected 81, is %d", check_msg->rle_list[206]); - ck_assert_msg(check_msg->rle_list[207] == 207, "incorrect value for rle_list[207], expected 207, is %d", check_msg->rle_list[207]); - ck_assert_msg(check_msg->rle_list[208] == 121, "incorrect value for rle_list[208], expected 121, is %d", check_msg->rle_list[208]); - ck_assert_msg(check_msg->rle_list[209] == 19, "incorrect value for rle_list[209], expected 19, is %d", check_msg->rle_list[209]); - ck_assert_msg(check_msg->rle_list[210] == 151, "incorrect value for rle_list[210], expected 151, is %d", check_msg->rle_list[210]); - ck_assert_msg(check_msg->rle_list[211] == 136, "incorrect value for rle_list[211], expected 136, is %d", check_msg->rle_list[211]); - ck_assert_msg(check_msg->rle_list[212] == 233, "incorrect value for rle_list[212], expected 233, is %d", check_msg->rle_list[212]); - ck_assert_msg(check_msg->rle_list[213] == 51, "incorrect value for rle_list[213], expected 51, is %d", check_msg->rle_list[213]); - ck_assert_msg(check_msg->rle_list[214] == 133, "incorrect value for rle_list[214], expected 133, is %d", check_msg->rle_list[214]); - ck_assert_msg(check_msg->rle_list[215] == 195, "incorrect value for rle_list[215], expected 195, is %d", check_msg->rle_list[215]); - ck_assert_msg(check_msg->rle_list[216] == 77, "incorrect value for rle_list[216], expected 77, is %d", check_msg->rle_list[216]); - ck_assert_msg(check_msg->rle_list[217] == 44, "incorrect value for rle_list[217], expected 44, is %d", check_msg->rle_list[217]); - ck_assert_msg(check_msg->rle_list[218] == 147, "incorrect value for rle_list[218], expected 147, is %d", check_msg->rle_list[218]); - ck_assert_msg(check_msg->rle_list[219] == 206, "incorrect value for rle_list[219], expected 206, is %d", check_msg->rle_list[219]); - ck_assert_msg(check_msg->rle_list[220] == 120, "incorrect value for rle_list[220], expected 120, is %d", check_msg->rle_list[220]); - ck_assert_msg(check_msg->rle_list[221] == 252, "incorrect value for rle_list[221], expected 252, is %d", check_msg->rle_list[221]); - ck_assert_msg(check_msg->rle_list[222] == 77, "incorrect value for rle_list[222], expected 77, is %d", check_msg->rle_list[222]); - ck_assert_msg(check_msg->rle_list[223] == 212, "incorrect value for rle_list[223], expected 212, is %d", check_msg->rle_list[223]); - ck_assert_msg(check_msg->rle_list[224] == 68, "incorrect value for rle_list[224], expected 68, is %d", check_msg->rle_list[224]); - ck_assert_msg(check_msg->rle_list[225] == 60, "incorrect value for rle_list[225], expected 60, is %d", check_msg->rle_list[225]); - ck_assert_msg(check_msg->rle_list[226] == 206, "incorrect value for rle_list[226], expected 206, is %d", check_msg->rle_list[226]); - ck_assert_msg(check_msg->rle_list[227] == 106, "incorrect value for rle_list[227], expected 106, is %d", check_msg->rle_list[227]); - ck_assert_msg(check_msg->rle_list[228] == 207, "incorrect value for rle_list[228], expected 207, is %d", check_msg->rle_list[228]); - ck_assert_msg(check_msg->rle_list[229] == 243, "incorrect value for rle_list[229], expected 243, is %d", check_msg->rle_list[229]); - ck_assert_msg(check_msg->rle_list[230] == 158, "incorrect value for rle_list[230], expected 158, is %d", check_msg->rle_list[230]); - ck_assert_msg(check_msg->rle_list[231] == 94, "incorrect value for rle_list[231], expected 94, is %d", check_msg->rle_list[231]); - ck_assert_msg(check_msg->rle_list[232] == 6, "incorrect value for rle_list[232], expected 6, is %d", check_msg->rle_list[232]); - ck_assert_msg(check_msg->rle_list[233] == 3, "incorrect value for rle_list[233], expected 3, is %d", check_msg->rle_list[233]); - ck_assert_msg(check_msg->rle_list[234] == 205, "incorrect value for rle_list[234], expected 205, is %d", check_msg->rle_list[234]); - ck_assert_msg(check_msg->rle_list[235] == 92, "incorrect value for rle_list[235], expected 92, is %d", check_msg->rle_list[235]); - ck_assert_msg(check_msg->rle_list[236] == 84, "incorrect value for rle_list[236], expected 84, is %d", check_msg->rle_list[236]); - ck_assert_msg(check_msg->rle_list[237] == 2, "incorrect value for rle_list[237], expected 2, is %d", check_msg->rle_list[237]); - ck_assert_msg(check_msg->rle_list[238] == 220, "incorrect value for rle_list[238], expected 220, is %d", check_msg->rle_list[238]); - ck_assert_msg(check_msg->rle_list[239] == 50, "incorrect value for rle_list[239], expected 50, is %d", check_msg->rle_list[239]); - ck_assert_msg(check_msg->rle_list[240] == 61, "incorrect value for rle_list[240], expected 61, is %d", check_msg->rle_list[240]); - ck_assert_msg(check_msg->rle_list[241] == 38, "incorrect value for rle_list[241], expected 38, is %d", check_msg->rle_list[241]); - ck_assert_msg(check_msg->rle_list[242] == 141, "incorrect value for rle_list[242], expected 141, is %d", check_msg->rle_list[242]); - ck_assert_msg(check_msg->rle_list[243] == 117, "incorrect value for rle_list[243], expected 117, is %d", check_msg->rle_list[243]); - ck_assert_msg(check_msg->rle_list[244] == 108, "incorrect value for rle_list[244], expected 108, is %d", check_msg->rle_list[244]); - ck_assert_msg(check_msg->rle_list[245] == 101, "incorrect value for rle_list[245], expected 101, is %d", check_msg->rle_list[245]); + ck_assert_msg( + check_msg->header.area_width == 43860, + "incorrect value for header.area_width, expected 43860, is %d", + check_msg->header.area_width); + ck_assert_msg( + check_msg->header.lat_nw_corner_enc == 34021, + "incorrect value for header.lat_nw_corner_enc, expected 34021, is %d", + check_msg->header.lat_nw_corner_enc); + ck_assert_msg( + check_msg->header.lon_nw_corner_enc == 11919, + "incorrect value for header.lon_nw_corner_enc, expected 11919, is %d", + check_msg->header.lon_nw_corner_enc); + ck_assert_msg(check_msg->header.num_msgs == 204, + "incorrect value for header.num_msgs, expected 204, is %d", + check_msg->header.num_msgs); + ck_assert_msg( + check_msg->header.region_size_inverse == 11, + "incorrect value for header.region_size_inverse, expected 11, is %d", + check_msg->header.region_size_inverse); + ck_assert_msg(check_msg->header.seq_num == 52, + "incorrect value for header.seq_num, expected 52, is %d", + check_msg->header.seq_num); + ck_assert_msg(check_msg->rle_list[0] == 92, + "incorrect value for rle_list[0], expected 92, is %d", + check_msg->rle_list[0]); + ck_assert_msg(check_msg->rle_list[1] == 104, + "incorrect value for rle_list[1], expected 104, is %d", + check_msg->rle_list[1]); + ck_assert_msg(check_msg->rle_list[2] == 25, + "incorrect value for rle_list[2], expected 25, is %d", + check_msg->rle_list[2]); + ck_assert_msg(check_msg->rle_list[3] == 204, + "incorrect value for rle_list[3], expected 204, is %d", + check_msg->rle_list[3]); + ck_assert_msg(check_msg->rle_list[4] == 182, + "incorrect value for rle_list[4], expected 182, is %d", + check_msg->rle_list[4]); + ck_assert_msg(check_msg->rle_list[5] == 22, + "incorrect value for rle_list[5], expected 22, is %d", + check_msg->rle_list[5]); + ck_assert_msg(check_msg->rle_list[6] == 98, + "incorrect value for rle_list[6], expected 98, is %d", + check_msg->rle_list[6]); + ck_assert_msg(check_msg->rle_list[7] == 203, + "incorrect value for rle_list[7], expected 203, is %d", + check_msg->rle_list[7]); + ck_assert_msg(check_msg->rle_list[8] == 123, + "incorrect value for rle_list[8], expected 123, is %d", + check_msg->rle_list[8]); + ck_assert_msg(check_msg->rle_list[9] == 211, + "incorrect value for rle_list[9], expected 211, is %d", + check_msg->rle_list[9]); + ck_assert_msg(check_msg->rle_list[10] == 38, + "incorrect value for rle_list[10], expected 38, is %d", + check_msg->rle_list[10]); + ck_assert_msg(check_msg->rle_list[11] == 13, + "incorrect value for rle_list[11], expected 13, is %d", + check_msg->rle_list[11]); + ck_assert_msg(check_msg->rle_list[12] == 253, + "incorrect value for rle_list[12], expected 253, is %d", + check_msg->rle_list[12]); + ck_assert_msg(check_msg->rle_list[13] == 129, + "incorrect value for rle_list[13], expected 129, is %d", + check_msg->rle_list[13]); + ck_assert_msg(check_msg->rle_list[14] == 173, + "incorrect value for rle_list[14], expected 173, is %d", + check_msg->rle_list[14]); + ck_assert_msg(check_msg->rle_list[15] == 171, + "incorrect value for rle_list[15], expected 171, is %d", + check_msg->rle_list[15]); + ck_assert_msg(check_msg->rle_list[16] == 235, + "incorrect value for rle_list[16], expected 235, is %d", + check_msg->rle_list[16]); + ck_assert_msg(check_msg->rle_list[17] == 253, + "incorrect value for rle_list[17], expected 253, is %d", + check_msg->rle_list[17]); + ck_assert_msg(check_msg->rle_list[18] == 26, + "incorrect value for rle_list[18], expected 26, is %d", + check_msg->rle_list[18]); + ck_assert_msg(check_msg->rle_list[19] == 203, + "incorrect value for rle_list[19], expected 203, is %d", + check_msg->rle_list[19]); + ck_assert_msg(check_msg->rle_list[20] == 3, + "incorrect value for rle_list[20], expected 3, is %d", + check_msg->rle_list[20]); + ck_assert_msg(check_msg->rle_list[21] == 120, + "incorrect value for rle_list[21], expected 120, is %d", + check_msg->rle_list[21]); + ck_assert_msg(check_msg->rle_list[22] == 126, + "incorrect value for rle_list[22], expected 126, is %d", + check_msg->rle_list[22]); + ck_assert_msg(check_msg->rle_list[23] == 42, + "incorrect value for rle_list[23], expected 42, is %d", + check_msg->rle_list[23]); + ck_assert_msg(check_msg->rle_list[24] == 44, + "incorrect value for rle_list[24], expected 44, is %d", + check_msg->rle_list[24]); + ck_assert_msg(check_msg->rle_list[25] == 39, + "incorrect value for rle_list[25], expected 39, is %d", + check_msg->rle_list[25]); + ck_assert_msg(check_msg->rle_list[26] == 87, + "incorrect value for rle_list[26], expected 87, is %d", + check_msg->rle_list[26]); + ck_assert_msg(check_msg->rle_list[27] == 69, + "incorrect value for rle_list[27], expected 69, is %d", + check_msg->rle_list[27]); + ck_assert_msg(check_msg->rle_list[28] == 154, + "incorrect value for rle_list[28], expected 154, is %d", + check_msg->rle_list[28]); + ck_assert_msg(check_msg->rle_list[29] == 13, + "incorrect value for rle_list[29], expected 13, is %d", + check_msg->rle_list[29]); + ck_assert_msg(check_msg->rle_list[30] == 28, + "incorrect value for rle_list[30], expected 28, is %d", + check_msg->rle_list[30]); + ck_assert_msg(check_msg->rle_list[31] == 179, + "incorrect value for rle_list[31], expected 179, is %d", + check_msg->rle_list[31]); + ck_assert_msg(check_msg->rle_list[32] == 32, + "incorrect value for rle_list[32], expected 32, is %d", + check_msg->rle_list[32]); + ck_assert_msg(check_msg->rle_list[33] == 47, + "incorrect value for rle_list[33], expected 47, is %d", + check_msg->rle_list[33]); + ck_assert_msg(check_msg->rle_list[34] == 36, + "incorrect value for rle_list[34], expected 36, is %d", + check_msg->rle_list[34]); + ck_assert_msg(check_msg->rle_list[35] == 195, + "incorrect value for rle_list[35], expected 195, is %d", + check_msg->rle_list[35]); + ck_assert_msg(check_msg->rle_list[36] == 39, + "incorrect value for rle_list[36], expected 39, is %d", + check_msg->rle_list[36]); + ck_assert_msg(check_msg->rle_list[37] == 198, + "incorrect value for rle_list[37], expected 198, is %d", + check_msg->rle_list[37]); + ck_assert_msg(check_msg->rle_list[38] == 134, + "incorrect value for rle_list[38], expected 134, is %d", + check_msg->rle_list[38]); + ck_assert_msg(check_msg->rle_list[39] == 235, + "incorrect value for rle_list[39], expected 235, is %d", + check_msg->rle_list[39]); + ck_assert_msg(check_msg->rle_list[40] == 134, + "incorrect value for rle_list[40], expected 134, is %d", + check_msg->rle_list[40]); + ck_assert_msg(check_msg->rle_list[41] == 57, + "incorrect value for rle_list[41], expected 57, is %d", + check_msg->rle_list[41]); + ck_assert_msg(check_msg->rle_list[42] == 120, + "incorrect value for rle_list[42], expected 120, is %d", + check_msg->rle_list[42]); + ck_assert_msg(check_msg->rle_list[43] == 243, + "incorrect value for rle_list[43], expected 243, is %d", + check_msg->rle_list[43]); + ck_assert_msg(check_msg->rle_list[44] == 151, + "incorrect value for rle_list[44], expected 151, is %d", + check_msg->rle_list[44]); + ck_assert_msg(check_msg->rle_list[45] == 35, + "incorrect value for rle_list[45], expected 35, is %d", + check_msg->rle_list[45]); + ck_assert_msg(check_msg->rle_list[46] == 17, + "incorrect value for rle_list[46], expected 17, is %d", + check_msg->rle_list[46]); + ck_assert_msg(check_msg->rle_list[47] == 201, + "incorrect value for rle_list[47], expected 201, is %d", + check_msg->rle_list[47]); + ck_assert_msg(check_msg->rle_list[48] == 211, + "incorrect value for rle_list[48], expected 211, is %d", + check_msg->rle_list[48]); + ck_assert_msg(check_msg->rle_list[49] == 125, + "incorrect value for rle_list[49], expected 125, is %d", + check_msg->rle_list[49]); + ck_assert_msg(check_msg->rle_list[50] == 117, + "incorrect value for rle_list[50], expected 117, is %d", + check_msg->rle_list[50]); + ck_assert_msg(check_msg->rle_list[51] == 164, + "incorrect value for rle_list[51], expected 164, is %d", + check_msg->rle_list[51]); + ck_assert_msg(check_msg->rle_list[52] == 142, + "incorrect value for rle_list[52], expected 142, is %d", + check_msg->rle_list[52]); + ck_assert_msg(check_msg->rle_list[53] == 101, + "incorrect value for rle_list[53], expected 101, is %d", + check_msg->rle_list[53]); + ck_assert_msg(check_msg->rle_list[54] == 239, + "incorrect value for rle_list[54], expected 239, is %d", + check_msg->rle_list[54]); + ck_assert_msg(check_msg->rle_list[55] == 144, + "incorrect value for rle_list[55], expected 144, is %d", + check_msg->rle_list[55]); + ck_assert_msg(check_msg->rle_list[56] == 158, + "incorrect value for rle_list[56], expected 158, is %d", + check_msg->rle_list[56]); + ck_assert_msg(check_msg->rle_list[57] == 239, + "incorrect value for rle_list[57], expected 239, is %d", + check_msg->rle_list[57]); + ck_assert_msg(check_msg->rle_list[58] == 90, + "incorrect value for rle_list[58], expected 90, is %d", + check_msg->rle_list[58]); + ck_assert_msg(check_msg->rle_list[59] == 56, + "incorrect value for rle_list[59], expected 56, is %d", + check_msg->rle_list[59]); + ck_assert_msg(check_msg->rle_list[60] == 71, + "incorrect value for rle_list[60], expected 71, is %d", + check_msg->rle_list[60]); + ck_assert_msg(check_msg->rle_list[61] == 120, + "incorrect value for rle_list[61], expected 120, is %d", + check_msg->rle_list[61]); + ck_assert_msg(check_msg->rle_list[62] == 67, + "incorrect value for rle_list[62], expected 67, is %d", + check_msg->rle_list[62]); + ck_assert_msg(check_msg->rle_list[63] == 221, + "incorrect value for rle_list[63], expected 221, is %d", + check_msg->rle_list[63]); + ck_assert_msg(check_msg->rle_list[64] == 114, + "incorrect value for rle_list[64], expected 114, is %d", + check_msg->rle_list[64]); + ck_assert_msg(check_msg->rle_list[65] == 10, + "incorrect value for rle_list[65], expected 10, is %d", + check_msg->rle_list[65]); + ck_assert_msg(check_msg->rle_list[66] == 190, + "incorrect value for rle_list[66], expected 190, is %d", + check_msg->rle_list[66]); + ck_assert_msg(check_msg->rle_list[67] == 4, + "incorrect value for rle_list[67], expected 4, is %d", + check_msg->rle_list[67]); + ck_assert_msg(check_msg->rle_list[68] == 230, + "incorrect value for rle_list[68], expected 230, is %d", + check_msg->rle_list[68]); + ck_assert_msg(check_msg->rle_list[69] == 164, + "incorrect value for rle_list[69], expected 164, is %d", + check_msg->rle_list[69]); + ck_assert_msg(check_msg->rle_list[70] == 171, + "incorrect value for rle_list[70], expected 171, is %d", + check_msg->rle_list[70]); + ck_assert_msg(check_msg->rle_list[71] == 78, + "incorrect value for rle_list[71], expected 78, is %d", + check_msg->rle_list[71]); + ck_assert_msg(check_msg->rle_list[72] == 185, + "incorrect value for rle_list[72], expected 185, is %d", + check_msg->rle_list[72]); + ck_assert_msg(check_msg->rle_list[73] == 90, + "incorrect value for rle_list[73], expected 90, is %d", + check_msg->rle_list[73]); + ck_assert_msg(check_msg->rle_list[74] == 46, + "incorrect value for rle_list[74], expected 46, is %d", + check_msg->rle_list[74]); + ck_assert_msg(check_msg->rle_list[75] == 177, + "incorrect value for rle_list[75], expected 177, is %d", + check_msg->rle_list[75]); + ck_assert_msg(check_msg->rle_list[76] == 82, + "incorrect value for rle_list[76], expected 82, is %d", + check_msg->rle_list[76]); + ck_assert_msg(check_msg->rle_list[77] == 228, + "incorrect value for rle_list[77], expected 228, is %d", + check_msg->rle_list[77]); + ck_assert_msg(check_msg->rle_list[78] == 123, + "incorrect value for rle_list[78], expected 123, is %d", + check_msg->rle_list[78]); + ck_assert_msg(check_msg->rle_list[79] == 222, + "incorrect value for rle_list[79], expected 222, is %d", + check_msg->rle_list[79]); + ck_assert_msg(check_msg->rle_list[80] == 227, + "incorrect value for rle_list[80], expected 227, is %d", + check_msg->rle_list[80]); + ck_assert_msg(check_msg->rle_list[81] == 145, + "incorrect value for rle_list[81], expected 145, is %d", + check_msg->rle_list[81]); + ck_assert_msg(check_msg->rle_list[82] == 195, + "incorrect value for rle_list[82], expected 195, is %d", + check_msg->rle_list[82]); + ck_assert_msg(check_msg->rle_list[83] == 219, + "incorrect value for rle_list[83], expected 219, is %d", + check_msg->rle_list[83]); + ck_assert_msg(check_msg->rle_list[84] == 27, + "incorrect value for rle_list[84], expected 27, is %d", + check_msg->rle_list[84]); + ck_assert_msg(check_msg->rle_list[85] == 56, + "incorrect value for rle_list[85], expected 56, is %d", + check_msg->rle_list[85]); + ck_assert_msg(check_msg->rle_list[86] == 227, + "incorrect value for rle_list[86], expected 227, is %d", + check_msg->rle_list[86]); + ck_assert_msg(check_msg->rle_list[87] == 246, + "incorrect value for rle_list[87], expected 246, is %d", + check_msg->rle_list[87]); + ck_assert_msg(check_msg->rle_list[88] == 215, + "incorrect value for rle_list[88], expected 215, is %d", + check_msg->rle_list[88]); + ck_assert_msg(check_msg->rle_list[89] == 144, + "incorrect value for rle_list[89], expected 144, is %d", + check_msg->rle_list[89]); + ck_assert_msg(check_msg->rle_list[90] == 158, + "incorrect value for rle_list[90], expected 158, is %d", + check_msg->rle_list[90]); + ck_assert_msg(check_msg->rle_list[91] == 31, + "incorrect value for rle_list[91], expected 31, is %d", + check_msg->rle_list[91]); + ck_assert_msg(check_msg->rle_list[92] == 214, + "incorrect value for rle_list[92], expected 214, is %d", + check_msg->rle_list[92]); + ck_assert_msg(check_msg->rle_list[93] == 241, + "incorrect value for rle_list[93], expected 241, is %d", + check_msg->rle_list[93]); + ck_assert_msg(check_msg->rle_list[94] == 254, + "incorrect value for rle_list[94], expected 254, is %d", + check_msg->rle_list[94]); + ck_assert_msg(check_msg->rle_list[95] == 200, + "incorrect value for rle_list[95], expected 200, is %d", + check_msg->rle_list[95]); + ck_assert_msg(check_msg->rle_list[96] == 86, + "incorrect value for rle_list[96], expected 86, is %d", + check_msg->rle_list[96]); + ck_assert_msg(check_msg->rle_list[97] == 142, + "incorrect value for rle_list[97], expected 142, is %d", + check_msg->rle_list[97]); + ck_assert_msg(check_msg->rle_list[98] == 89, + "incorrect value for rle_list[98], expected 89, is %d", + check_msg->rle_list[98]); + ck_assert_msg(check_msg->rle_list[99] == 12, + "incorrect value for rle_list[99], expected 12, is %d", + check_msg->rle_list[99]); + ck_assert_msg(check_msg->rle_list[100] == 121, + "incorrect value for rle_list[100], expected 121, is %d", + check_msg->rle_list[100]); + ck_assert_msg(check_msg->rle_list[101] == 29, + "incorrect value for rle_list[101], expected 29, is %d", + check_msg->rle_list[101]); + ck_assert_msg(check_msg->rle_list[102] == 124, + "incorrect value for rle_list[102], expected 124, is %d", + check_msg->rle_list[102]); + ck_assert_msg(check_msg->rle_list[103] == 9, + "incorrect value for rle_list[103], expected 9, is %d", + check_msg->rle_list[103]); + ck_assert_msg(check_msg->rle_list[104] == 19, + "incorrect value for rle_list[104], expected 19, is %d", + check_msg->rle_list[104]); + ck_assert_msg(check_msg->rle_list[105] == 153, + "incorrect value for rle_list[105], expected 153, is %d", + check_msg->rle_list[105]); + ck_assert_msg(check_msg->rle_list[106] == 44, + "incorrect value for rle_list[106], expected 44, is %d", + check_msg->rle_list[106]); + ck_assert_msg(check_msg->rle_list[107] == 35, + "incorrect value for rle_list[107], expected 35, is %d", + check_msg->rle_list[107]); + ck_assert_msg(check_msg->rle_list[108] == 126, + "incorrect value for rle_list[108], expected 126, is %d", + check_msg->rle_list[108]); + ck_assert_msg(check_msg->rle_list[109] == 14, + "incorrect value for rle_list[109], expected 14, is %d", + check_msg->rle_list[109]); + ck_assert_msg(check_msg->rle_list[110] == 217, + "incorrect value for rle_list[110], expected 217, is %d", + check_msg->rle_list[110]); + ck_assert_msg(check_msg->rle_list[111] == 65, + "incorrect value for rle_list[111], expected 65, is %d", + check_msg->rle_list[111]); + ck_assert_msg(check_msg->rle_list[112] == 116, + "incorrect value for rle_list[112], expected 116, is %d", + check_msg->rle_list[112]); + ck_assert_msg(check_msg->rle_list[113] == 26, + "incorrect value for rle_list[113], expected 26, is %d", + check_msg->rle_list[113]); + ck_assert_msg(check_msg->rle_list[114] == 139, + "incorrect value for rle_list[114], expected 139, is %d", + check_msg->rle_list[114]); + ck_assert_msg(check_msg->rle_list[115] == 122, + "incorrect value for rle_list[115], expected 122, is %d", + check_msg->rle_list[115]); + ck_assert_msg(check_msg->rle_list[116] == 114, + "incorrect value for rle_list[116], expected 114, is %d", + check_msg->rle_list[116]); + ck_assert_msg(check_msg->rle_list[117] == 90, + "incorrect value for rle_list[117], expected 90, is %d", + check_msg->rle_list[117]); + ck_assert_msg(check_msg->rle_list[118] == 124, + "incorrect value for rle_list[118], expected 124, is %d", + check_msg->rle_list[118]); + ck_assert_msg(check_msg->rle_list[119] == 81, + "incorrect value for rle_list[119], expected 81, is %d", + check_msg->rle_list[119]); + ck_assert_msg(check_msg->rle_list[120] == 0, + "incorrect value for rle_list[120], expected 0, is %d", + check_msg->rle_list[120]); + ck_assert_msg(check_msg->rle_list[121] == 186, + "incorrect value for rle_list[121], expected 186, is %d", + check_msg->rle_list[121]); + ck_assert_msg(check_msg->rle_list[122] == 246, + "incorrect value for rle_list[122], expected 246, is %d", + check_msg->rle_list[122]); + ck_assert_msg(check_msg->rle_list[123] == 46, + "incorrect value for rle_list[123], expected 46, is %d", + check_msg->rle_list[123]); + ck_assert_msg(check_msg->rle_list[124] == 98, + "incorrect value for rle_list[124], expected 98, is %d", + check_msg->rle_list[124]); + ck_assert_msg(check_msg->rle_list[125] == 179, + "incorrect value for rle_list[125], expected 179, is %d", + check_msg->rle_list[125]); + ck_assert_msg(check_msg->rle_list[126] == 243, + "incorrect value for rle_list[126], expected 243, is %d", + check_msg->rle_list[126]); + ck_assert_msg(check_msg->rle_list[127] == 198, + "incorrect value for rle_list[127], expected 198, is %d", + check_msg->rle_list[127]); + ck_assert_msg(check_msg->rle_list[128] == 217, + "incorrect value for rle_list[128], expected 217, is %d", + check_msg->rle_list[128]); + ck_assert_msg(check_msg->rle_list[129] == 36, + "incorrect value for rle_list[129], expected 36, is %d", + check_msg->rle_list[129]); + ck_assert_msg(check_msg->rle_list[130] == 30, + "incorrect value for rle_list[130], expected 30, is %d", + check_msg->rle_list[130]); + ck_assert_msg(check_msg->rle_list[131] == 202, + "incorrect value for rle_list[131], expected 202, is %d", + check_msg->rle_list[131]); + ck_assert_msg(check_msg->rle_list[132] == 12, + "incorrect value for rle_list[132], expected 12, is %d", + check_msg->rle_list[132]); + ck_assert_msg(check_msg->rle_list[133] == 135, + "incorrect value for rle_list[133], expected 135, is %d", + check_msg->rle_list[133]); + ck_assert_msg(check_msg->rle_list[134] == 61, + "incorrect value for rle_list[134], expected 61, is %d", + check_msg->rle_list[134]); + ck_assert_msg(check_msg->rle_list[135] == 42, + "incorrect value for rle_list[135], expected 42, is %d", + check_msg->rle_list[135]); + ck_assert_msg(check_msg->rle_list[136] == 150, + "incorrect value for rle_list[136], expected 150, is %d", + check_msg->rle_list[136]); + ck_assert_msg(check_msg->rle_list[137] == 221, + "incorrect value for rle_list[137], expected 221, is %d", + check_msg->rle_list[137]); + ck_assert_msg(check_msg->rle_list[138] == 102, + "incorrect value for rle_list[138], expected 102, is %d", + check_msg->rle_list[138]); + ck_assert_msg(check_msg->rle_list[139] == 83, + "incorrect value for rle_list[139], expected 83, is %d", + check_msg->rle_list[139]); + ck_assert_msg(check_msg->rle_list[140] == 179, + "incorrect value for rle_list[140], expected 179, is %d", + check_msg->rle_list[140]); + ck_assert_msg(check_msg->rle_list[141] == 43, + "incorrect value for rle_list[141], expected 43, is %d", + check_msg->rle_list[141]); + ck_assert_msg(check_msg->rle_list[142] == 252, + "incorrect value for rle_list[142], expected 252, is %d", + check_msg->rle_list[142]); + ck_assert_msg(check_msg->rle_list[143] == 81, + "incorrect value for rle_list[143], expected 81, is %d", + check_msg->rle_list[143]); + ck_assert_msg(check_msg->rle_list[144] == 62, + "incorrect value for rle_list[144], expected 62, is %d", + check_msg->rle_list[144]); + ck_assert_msg(check_msg->rle_list[145] == 126, + "incorrect value for rle_list[145], expected 126, is %d", + check_msg->rle_list[145]); + ck_assert_msg(check_msg->rle_list[146] == 204, + "incorrect value for rle_list[146], expected 204, is %d", + check_msg->rle_list[146]); + ck_assert_msg(check_msg->rle_list[147] == 195, + "incorrect value for rle_list[147], expected 195, is %d", + check_msg->rle_list[147]); + ck_assert_msg(check_msg->rle_list[148] == 238, + "incorrect value for rle_list[148], expected 238, is %d", + check_msg->rle_list[148]); + ck_assert_msg(check_msg->rle_list[149] == 18, + "incorrect value for rle_list[149], expected 18, is %d", + check_msg->rle_list[149]); + ck_assert_msg(check_msg->rle_list[150] == 128, + "incorrect value for rle_list[150], expected 128, is %d", + check_msg->rle_list[150]); + ck_assert_msg(check_msg->rle_list[151] == 193, + "incorrect value for rle_list[151], expected 193, is %d", + check_msg->rle_list[151]); + ck_assert_msg(check_msg->rle_list[152] == 53, + "incorrect value for rle_list[152], expected 53, is %d", + check_msg->rle_list[152]); + ck_assert_msg(check_msg->rle_list[153] == 94, + "incorrect value for rle_list[153], expected 94, is %d", + check_msg->rle_list[153]); + ck_assert_msg(check_msg->rle_list[154] == 99, + "incorrect value for rle_list[154], expected 99, is %d", + check_msg->rle_list[154]); + ck_assert_msg(check_msg->rle_list[155] == 63, + "incorrect value for rle_list[155], expected 63, is %d", + check_msg->rle_list[155]); + ck_assert_msg(check_msg->rle_list[156] == 182, + "incorrect value for rle_list[156], expected 182, is %d", + check_msg->rle_list[156]); + ck_assert_msg(check_msg->rle_list[157] == 2, + "incorrect value for rle_list[157], expected 2, is %d", + check_msg->rle_list[157]); + ck_assert_msg(check_msg->rle_list[158] == 186, + "incorrect value for rle_list[158], expected 186, is %d", + check_msg->rle_list[158]); + ck_assert_msg(check_msg->rle_list[159] == 220, + "incorrect value for rle_list[159], expected 220, is %d", + check_msg->rle_list[159]); + ck_assert_msg(check_msg->rle_list[160] == 77, + "incorrect value for rle_list[160], expected 77, is %d", + check_msg->rle_list[160]); + ck_assert_msg(check_msg->rle_list[161] == 186, + "incorrect value for rle_list[161], expected 186, is %d", + check_msg->rle_list[161]); + ck_assert_msg(check_msg->rle_list[162] == 224, + "incorrect value for rle_list[162], expected 224, is %d", + check_msg->rle_list[162]); + ck_assert_msg(check_msg->rle_list[163] == 220, + "incorrect value for rle_list[163], expected 220, is %d", + check_msg->rle_list[163]); + ck_assert_msg(check_msg->rle_list[164] == 13, + "incorrect value for rle_list[164], expected 13, is %d", + check_msg->rle_list[164]); + ck_assert_msg(check_msg->rle_list[165] == 212, + "incorrect value for rle_list[165], expected 212, is %d", + check_msg->rle_list[165]); + ck_assert_msg(check_msg->rle_list[166] == 182, + "incorrect value for rle_list[166], expected 182, is %d", + check_msg->rle_list[166]); + ck_assert_msg(check_msg->rle_list[167] == 88, + "incorrect value for rle_list[167], expected 88, is %d", + check_msg->rle_list[167]); + ck_assert_msg(check_msg->rle_list[168] == 15, + "incorrect value for rle_list[168], expected 15, is %d", + check_msg->rle_list[168]); + ck_assert_msg(check_msg->rle_list[169] == 151, + "incorrect value for rle_list[169], expected 151, is %d", + check_msg->rle_list[169]); + ck_assert_msg(check_msg->rle_list[170] == 5, + "incorrect value for rle_list[170], expected 5, is %d", + check_msg->rle_list[170]); + ck_assert_msg(check_msg->rle_list[171] == 93, + "incorrect value for rle_list[171], expected 93, is %d", + check_msg->rle_list[171]); + ck_assert_msg(check_msg->rle_list[172] == 251, + "incorrect value for rle_list[172], expected 251, is %d", + check_msg->rle_list[172]); + ck_assert_msg(check_msg->rle_list[173] == 164, + "incorrect value for rle_list[173], expected 164, is %d", + check_msg->rle_list[173]); + ck_assert_msg(check_msg->rle_list[174] == 18, + "incorrect value for rle_list[174], expected 18, is %d", + check_msg->rle_list[174]); + ck_assert_msg(check_msg->rle_list[175] == 228, + "incorrect value for rle_list[175], expected 228, is %d", + check_msg->rle_list[175]); + ck_assert_msg(check_msg->rle_list[176] == 168, + "incorrect value for rle_list[176], expected 168, is %d", + check_msg->rle_list[176]); + ck_assert_msg(check_msg->rle_list[177] == 226, + "incorrect value for rle_list[177], expected 226, is %d", + check_msg->rle_list[177]); + ck_assert_msg(check_msg->rle_list[178] == 195, + "incorrect value for rle_list[178], expected 195, is %d", + check_msg->rle_list[178]); + ck_assert_msg(check_msg->rle_list[179] == 44, + "incorrect value for rle_list[179], expected 44, is %d", + check_msg->rle_list[179]); + ck_assert_msg(check_msg->rle_list[180] == 170, + "incorrect value for rle_list[180], expected 170, is %d", + check_msg->rle_list[180]); + ck_assert_msg(check_msg->rle_list[181] == 145, + "incorrect value for rle_list[181], expected 145, is %d", + check_msg->rle_list[181]); + ck_assert_msg(check_msg->rle_list[182] == 36, + "incorrect value for rle_list[182], expected 36, is %d", + check_msg->rle_list[182]); + ck_assert_msg(check_msg->rle_list[183] == 58, + "incorrect value for rle_list[183], expected 58, is %d", + check_msg->rle_list[183]); + ck_assert_msg(check_msg->rle_list[184] == 96, + "incorrect value for rle_list[184], expected 96, is %d", + check_msg->rle_list[184]); + ck_assert_msg(check_msg->rle_list[185] == 107, + "incorrect value for rle_list[185], expected 107, is %d", + check_msg->rle_list[185]); + ck_assert_msg(check_msg->rle_list[186] == 144, + "incorrect value for rle_list[186], expected 144, is %d", + check_msg->rle_list[186]); + ck_assert_msg(check_msg->rle_list[187] == 11, + "incorrect value for rle_list[187], expected 11, is %d", + check_msg->rle_list[187]); + ck_assert_msg(check_msg->rle_list[188] == 228, + "incorrect value for rle_list[188], expected 228, is %d", + check_msg->rle_list[188]); + ck_assert_msg(check_msg->rle_list[189] == 12, + "incorrect value for rle_list[189], expected 12, is %d", + check_msg->rle_list[189]); + ck_assert_msg(check_msg->rle_list[190] == 163, + "incorrect value for rle_list[190], expected 163, is %d", + check_msg->rle_list[190]); + ck_assert_msg(check_msg->rle_list[191] == 238, + "incorrect value for rle_list[191], expected 238, is %d", + check_msg->rle_list[191]); + ck_assert_msg(check_msg->rle_list[192] == 247, + "incorrect value for rle_list[192], expected 247, is %d", + check_msg->rle_list[192]); + ck_assert_msg(check_msg->rle_list[193] == 159, + "incorrect value for rle_list[193], expected 159, is %d", + check_msg->rle_list[193]); + ck_assert_msg(check_msg->rle_list[194] == 189, + "incorrect value for rle_list[194], expected 189, is %d", + check_msg->rle_list[194]); + ck_assert_msg(check_msg->rle_list[195] == 1, + "incorrect value for rle_list[195], expected 1, is %d", + check_msg->rle_list[195]); + ck_assert_msg(check_msg->rle_list[196] == 115, + "incorrect value for rle_list[196], expected 115, is %d", + check_msg->rle_list[196]); + ck_assert_msg(check_msg->rle_list[197] == 65, + "incorrect value for rle_list[197], expected 65, is %d", + check_msg->rle_list[197]); + ck_assert_msg(check_msg->rle_list[198] == 202, + "incorrect value for rle_list[198], expected 202, is %d", + check_msg->rle_list[198]); + ck_assert_msg(check_msg->rle_list[199] == 121, + "incorrect value for rle_list[199], expected 121, is %d", + check_msg->rle_list[199]); + ck_assert_msg(check_msg->rle_list[200] == 47, + "incorrect value for rle_list[200], expected 47, is %d", + check_msg->rle_list[200]); + ck_assert_msg(check_msg->rle_list[201] == 193, + "incorrect value for rle_list[201], expected 193, is %d", + check_msg->rle_list[201]); + ck_assert_msg(check_msg->rle_list[202] == 11, + "incorrect value for rle_list[202], expected 11, is %d", + check_msg->rle_list[202]); + ck_assert_msg(check_msg->rle_list[203] == 96, + "incorrect value for rle_list[203], expected 96, is %d", + check_msg->rle_list[203]); + ck_assert_msg(check_msg->rle_list[204] == 93, + "incorrect value for rle_list[204], expected 93, is %d", + check_msg->rle_list[204]); + ck_assert_msg(check_msg->rle_list[205] == 72, + "incorrect value for rle_list[205], expected 72, is %d", + check_msg->rle_list[205]); + ck_assert_msg(check_msg->rle_list[206] == 81, + "incorrect value for rle_list[206], expected 81, is %d", + check_msg->rle_list[206]); + ck_assert_msg(check_msg->rle_list[207] == 207, + "incorrect value for rle_list[207], expected 207, is %d", + check_msg->rle_list[207]); + ck_assert_msg(check_msg->rle_list[208] == 121, + "incorrect value for rle_list[208], expected 121, is %d", + check_msg->rle_list[208]); + ck_assert_msg(check_msg->rle_list[209] == 19, + "incorrect value for rle_list[209], expected 19, is %d", + check_msg->rle_list[209]); + ck_assert_msg(check_msg->rle_list[210] == 151, + "incorrect value for rle_list[210], expected 151, is %d", + check_msg->rle_list[210]); + ck_assert_msg(check_msg->rle_list[211] == 136, + "incorrect value for rle_list[211], expected 136, is %d", + check_msg->rle_list[211]); + ck_assert_msg(check_msg->rle_list[212] == 233, + "incorrect value for rle_list[212], expected 233, is %d", + check_msg->rle_list[212]); + ck_assert_msg(check_msg->rle_list[213] == 51, + "incorrect value for rle_list[213], expected 51, is %d", + check_msg->rle_list[213]); + ck_assert_msg(check_msg->rle_list[214] == 133, + "incorrect value for rle_list[214], expected 133, is %d", + check_msg->rle_list[214]); + ck_assert_msg(check_msg->rle_list[215] == 195, + "incorrect value for rle_list[215], expected 195, is %d", + check_msg->rle_list[215]); + ck_assert_msg(check_msg->rle_list[216] == 77, + "incorrect value for rle_list[216], expected 77, is %d", + check_msg->rle_list[216]); + ck_assert_msg(check_msg->rle_list[217] == 44, + "incorrect value for rle_list[217], expected 44, is %d", + check_msg->rle_list[217]); + ck_assert_msg(check_msg->rle_list[218] == 147, + "incorrect value for rle_list[218], expected 147, is %d", + check_msg->rle_list[218]); + ck_assert_msg(check_msg->rle_list[219] == 206, + "incorrect value for rle_list[219], expected 206, is %d", + check_msg->rle_list[219]); + ck_assert_msg(check_msg->rle_list[220] == 120, + "incorrect value for rle_list[220], expected 120, is %d", + check_msg->rle_list[220]); + ck_assert_msg(check_msg->rle_list[221] == 252, + "incorrect value for rle_list[221], expected 252, is %d", + check_msg->rle_list[221]); + ck_assert_msg(check_msg->rle_list[222] == 77, + "incorrect value for rle_list[222], expected 77, is %d", + check_msg->rle_list[222]); + ck_assert_msg(check_msg->rle_list[223] == 212, + "incorrect value for rle_list[223], expected 212, is %d", + check_msg->rle_list[223]); + ck_assert_msg(check_msg->rle_list[224] == 68, + "incorrect value for rle_list[224], expected 68, is %d", + check_msg->rle_list[224]); + ck_assert_msg(check_msg->rle_list[225] == 60, + "incorrect value for rle_list[225], expected 60, is %d", + check_msg->rle_list[225]); + ck_assert_msg(check_msg->rle_list[226] == 206, + "incorrect value for rle_list[226], expected 206, is %d", + check_msg->rle_list[226]); + ck_assert_msg(check_msg->rle_list[227] == 106, + "incorrect value for rle_list[227], expected 106, is %d", + check_msg->rle_list[227]); + ck_assert_msg(check_msg->rle_list[228] == 207, + "incorrect value for rle_list[228], expected 207, is %d", + check_msg->rle_list[228]); + ck_assert_msg(check_msg->rle_list[229] == 243, + "incorrect value for rle_list[229], expected 243, is %d", + check_msg->rle_list[229]); + ck_assert_msg(check_msg->rle_list[230] == 158, + "incorrect value for rle_list[230], expected 158, is %d", + check_msg->rle_list[230]); + ck_assert_msg(check_msg->rle_list[231] == 94, + "incorrect value for rle_list[231], expected 94, is %d", + check_msg->rle_list[231]); + ck_assert_msg(check_msg->rle_list[232] == 6, + "incorrect value for rle_list[232], expected 6, is %d", + check_msg->rle_list[232]); + ck_assert_msg(check_msg->rle_list[233] == 3, + "incorrect value for rle_list[233], expected 3, is %d", + check_msg->rle_list[233]); + ck_assert_msg(check_msg->rle_list[234] == 205, + "incorrect value for rle_list[234], expected 205, is %d", + check_msg->rle_list[234]); + ck_assert_msg(check_msg->rle_list[235] == 92, + "incorrect value for rle_list[235], expected 92, is %d", + check_msg->rle_list[235]); + ck_assert_msg(check_msg->rle_list[236] == 84, + "incorrect value for rle_list[236], expected 84, is %d", + check_msg->rle_list[236]); + ck_assert_msg(check_msg->rle_list[237] == 2, + "incorrect value for rle_list[237], expected 2, is %d", + check_msg->rle_list[237]); + ck_assert_msg(check_msg->rle_list[238] == 220, + "incorrect value for rle_list[238], expected 220, is %d", + check_msg->rle_list[238]); + ck_assert_msg(check_msg->rle_list[239] == 50, + "incorrect value for rle_list[239], expected 50, is %d", + check_msg->rle_list[239]); + ck_assert_msg(check_msg->rle_list[240] == 61, + "incorrect value for rle_list[240], expected 61, is %d", + check_msg->rle_list[240]); + ck_assert_msg(check_msg->rle_list[241] == 38, + "incorrect value for rle_list[241], expected 38, is %d", + check_msg->rle_list[241]); + ck_assert_msg(check_msg->rle_list[242] == 141, + "incorrect value for rle_list[242], expected 141, is %d", + check_msg->rle_list[242]); + ck_assert_msg(check_msg->rle_list[243] == 117, + "incorrect value for rle_list[243], expected 117, is %d", + check_msg->rle_list[243]); + ck_assert_msg(check_msg->rle_list[244] == 108, + "incorrect value for rle_list[244], expected 108, is %d", + check_msg->rle_list[244]); + ck_assert_msg(check_msg->rle_list[245] == 101, + "incorrect value for rle_list[245], expected 101, is %d", + check_msg->rle_list[245]); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA); +Suite *legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrection.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrection.c index 21dee28ed..7b2e3045f 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrection.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrection.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrection.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrection.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,40 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x5fc, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x5fc, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x5fc, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x5fc, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,252,5,196,249,253,21,14,151,50,120,133,29,151,174,229,151,189,204,196,105,170,120,149,169,37,244,78,72,140,101,2,173,88,70,180,54,152,115,78,201,161,23,135,152,98,61,75,178,120,229,146,55,58,169,234,230,69,172,191,127,146,89,150,91,111,225,41,17,119,52,166,166,120,57,221,12,3,156,70,156,35,127,8,127,58,128,55,115,80,157,122,153,124,27,128,98,103,204,75,238,128,226,148,248,61,216,208,149,167,224,40,144,186,157,227,72,240,100,35,12,212,7,59,176,81,86,27,24,155,67,43,132,45,203,44,6,112,183,231,176,79,194,253,247,103,91,226,116,148,23,62,227,240,29,219,205,18,242,207,72,71,79,37,42,176,201,202,91,105,115,146,59,110,44,109,128,183,185,67,31,165,92,79,189,180,94,7,162,121,156,210,47,7,7,205,174,41,241,129,210,43,101,186,208,195,226,247,187,219,160,120,192,102,166,42,246,173,94,102,156,222,30,35,247,64,189,137,204,220,32,71,222,222,201,246,3,25,45,251,239,115,88,218,10,209,120,65,175,131,194,41,174,137,17,68,28,253,42,178,35, }; + u8 encoded_frame[] = { + 85, 252, 5, 196, 249, 253, 21, 14, 151, 50, 120, 133, 29, 151, + 174, 229, 151, 189, 204, 196, 105, 170, 120, 149, 169, 37, 244, 78, + 72, 140, 101, 2, 173, 88, 70, 180, 54, 152, 115, 78, 201, 161, + 23, 135, 152, 98, 61, 75, 178, 120, 229, 146, 55, 58, 169, 234, + 230, 69, 172, 191, 127, 146, 89, 150, 91, 111, 225, 41, 17, 119, + 52, 166, 166, 120, 57, 221, 12, 3, 156, 70, 156, 35, 127, 8, + 127, 58, 128, 55, 115, 80, 157, 122, 153, 124, 27, 128, 98, 103, + 204, 75, 238, 128, 226, 148, 248, 61, 216, 208, 149, 167, 224, 40, + 144, 186, 157, 227, 72, 240, 100, 35, 12, 212, 7, 59, 176, 81, + 86, 27, 24, 155, 67, 43, 132, 45, 203, 44, 6, 112, 183, 231, + 176, 79, 194, 253, 247, 103, 91, 226, 116, 148, 23, 62, 227, 240, + 29, 219, 205, 18, 242, 207, 72, 71, 79, 37, 42, 176, 201, 202, + 91, 105, 115, 146, 59, 110, 44, 109, 128, 183, 185, 67, 31, 165, + 92, 79, 189, 180, 94, 7, 162, 121, 156, 210, 47, 7, 7, 205, + 174, 41, 241, 129, 210, 43, 101, 186, 208, 195, 226, 247, 187, 219, + 160, 120, 192, 102, 166, 42, 246, 173, 94, 102, 156, 222, 30, 35, + 247, 64, 189, 137, 204, 220, 32, 71, 222, 222, 201, 246, 3, 25, + 45, 251, 239, 115, 88, 218, 10, 209, 120, 65, 175, 131, 194, 41, + 174, 137, 17, 68, 28, 253, 42, 178, 35, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_gridded_correction_t* test_msg = ( msg_ssr_gridded_correction_t* )test_msg_storage; + msg_ssr_gridded_correction_t *test_msg = + (msg_ssr_gridded_correction_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.iod_atmo = 170; test_msg->header.num_msgs = 48535; @@ -524,260 +544,855 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection ) test_msg->tropo_delay_correction.hydro = -3035; test_msg->tropo_delay_correction.stddev = 72; test_msg->tropo_delay_correction.wet = 78; - sbp_payload_send(&sbp_state, 0x5fc, 63940, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x5fc, 63940, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 63940, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 63940, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x5fc, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_gridded_correction_t* check_msg = ( msg_ssr_gridded_correction_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_gridded_correction_t *check_msg = + (msg_ssr_gridded_correction_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.iod_atmo == 170, "incorrect value for header.iod_atmo, expected 170, is %d", check_msg->header.iod_atmo); - ck_assert_msg(check_msg->header.num_msgs == 48535, "incorrect value for header.num_msgs, expected 48535, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.seq_num == 50380, "incorrect value for header.seq_num, expected 50380, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->header.tile_id == 12951, "incorrect value for header.tile_id, expected 12951, is %d", check_msg->header.tile_id); - ck_assert_msg(check_msg->header.tile_set_id == 3605, "incorrect value for header.tile_set_id, expected 3605, is %d", check_msg->header.tile_set_id); - ck_assert_msg(check_msg->header.time.tow == 2535294328, "incorrect value for header.time.tow, expected 2535294328, is %d", check_msg->header.time.tow); - ck_assert_msg(check_msg->header.time.wn == 58798, "incorrect value for header.time.wn, expected 58798, is %d", check_msg->header.time.wn); - ck_assert_msg(check_msg->header.tropo_quality_indicator == 120, "incorrect value for header.tropo_quality_indicator, expected 120, is %d", check_msg->header.tropo_quality_indicator); - ck_assert_msg(check_msg->header.update_interval == 105, "incorrect value for header.update_interval, expected 105, is %d", check_msg->header.update_interval); - ck_assert_msg(check_msg->index == 43413, "incorrect value for index, expected 43413, is %d", check_msg->index); - ck_assert_msg(check_msg->stec_residuals[0].residual == -21246, "incorrect value for stec_residuals[0].residual, expected -21246, is %d", check_msg->stec_residuals[0].residual); - ck_assert_msg(check_msg->stec_residuals[0].stddev == 88, "incorrect value for stec_residuals[0].stddev, expected 88, is %d", check_msg->stec_residuals[0].stddev); - ck_assert_msg(check_msg->stec_residuals[0].sv_id.constellation == 101, "incorrect value for stec_residuals[0].sv_id.constellation, expected 101, is %d", check_msg->stec_residuals[0].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[0].sv_id.satId == 140, "incorrect value for stec_residuals[0].sv_id.satId, expected 140, is %d", check_msg->stec_residuals[0].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[1].residual == -26570, "incorrect value for stec_residuals[1].residual, expected -26570, is %d", check_msg->stec_residuals[1].residual); - ck_assert_msg(check_msg->stec_residuals[1].stddev == 115, "incorrect value for stec_residuals[1].stddev, expected 115, is %d", check_msg->stec_residuals[1].stddev); - ck_assert_msg(check_msg->stec_residuals[1].sv_id.constellation == 180, "incorrect value for stec_residuals[1].sv_id.constellation, expected 180, is %d", check_msg->stec_residuals[1].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[1].sv_id.satId == 70, "incorrect value for stec_residuals[1].sv_id.satId, expected 70, is %d", check_msg->stec_residuals[1].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[2].residual == 6049, "incorrect value for stec_residuals[2].residual, expected 6049, is %d", check_msg->stec_residuals[2].residual); - ck_assert_msg(check_msg->stec_residuals[2].stddev == 135, "incorrect value for stec_residuals[2].stddev, expected 135, is %d", check_msg->stec_residuals[2].stddev); - ck_assert_msg(check_msg->stec_residuals[2].sv_id.constellation == 201, "incorrect value for stec_residuals[2].sv_id.constellation, expected 201, is %d", check_msg->stec_residuals[2].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[2].sv_id.satId == 78, "incorrect value for stec_residuals[2].sv_id.satId, expected 78, is %d", check_msg->stec_residuals[2].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[3].residual == 19261, "incorrect value for stec_residuals[3].residual, expected 19261, is %d", check_msg->stec_residuals[3].residual); - ck_assert_msg(check_msg->stec_residuals[3].stddev == 178, "incorrect value for stec_residuals[3].stddev, expected 178, is %d", check_msg->stec_residuals[3].stddev); - ck_assert_msg(check_msg->stec_residuals[3].sv_id.constellation == 98, "incorrect value for stec_residuals[3].sv_id.constellation, expected 98, is %d", check_msg->stec_residuals[3].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[3].sv_id.satId == 152, "incorrect value for stec_residuals[3].sv_id.satId, expected 152, is %d", check_msg->stec_residuals[3].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[4].residual == 14226, "incorrect value for stec_residuals[4].residual, expected 14226, is %d", check_msg->stec_residuals[4].residual); - ck_assert_msg(check_msg->stec_residuals[4].stddev == 58, "incorrect value for stec_residuals[4].stddev, expected 58, is %d", check_msg->stec_residuals[4].stddev); - ck_assert_msg(check_msg->stec_residuals[4].sv_id.constellation == 229, "incorrect value for stec_residuals[4].sv_id.constellation, expected 229, is %d", check_msg->stec_residuals[4].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[4].sv_id.satId == 120, "incorrect value for stec_residuals[4].sv_id.satId, expected 120, is %d", check_msg->stec_residuals[4].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[5].residual == 17894, "incorrect value for stec_residuals[5].residual, expected 17894, is %d", check_msg->stec_residuals[5].residual); - ck_assert_msg(check_msg->stec_residuals[5].stddev == 172, "incorrect value for stec_residuals[5].stddev, expected 172, is %d", check_msg->stec_residuals[5].stddev); - ck_assert_msg(check_msg->stec_residuals[5].sv_id.constellation == 234, "incorrect value for stec_residuals[5].sv_id.constellation, expected 234, is %d", check_msg->stec_residuals[5].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[5].sv_id.satId == 169, "incorrect value for stec_residuals[5].sv_id.satId, expected 169, is %d", check_msg->stec_residuals[5].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[6].residual == 22930, "incorrect value for stec_residuals[6].residual, expected 22930, is %d", check_msg->stec_residuals[6].residual); - ck_assert_msg(check_msg->stec_residuals[6].stddev == 150, "incorrect value for stec_residuals[6].stddev, expected 150, is %d", check_msg->stec_residuals[6].stddev); - ck_assert_msg(check_msg->stec_residuals[6].sv_id.constellation == 127, "incorrect value for stec_residuals[6].sv_id.constellation, expected 127, is %d", check_msg->stec_residuals[6].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[6].sv_id.satId == 191, "incorrect value for stec_residuals[6].sv_id.satId, expected 191, is %d", check_msg->stec_residuals[6].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[7].residual == 10721, "incorrect value for stec_residuals[7].residual, expected 10721, is %d", check_msg->stec_residuals[7].residual); - ck_assert_msg(check_msg->stec_residuals[7].stddev == 17, "incorrect value for stec_residuals[7].stddev, expected 17, is %d", check_msg->stec_residuals[7].stddev); - ck_assert_msg(check_msg->stec_residuals[7].sv_id.constellation == 111, "incorrect value for stec_residuals[7].sv_id.constellation, expected 111, is %d", check_msg->stec_residuals[7].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[7].sv_id.satId == 91, "incorrect value for stec_residuals[7].sv_id.satId, expected 91, is %d", check_msg->stec_residuals[7].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[8].residual == -22874, "incorrect value for stec_residuals[8].residual, expected -22874, is %d", check_msg->stec_residuals[8].residual); - ck_assert_msg(check_msg->stec_residuals[8].stddev == 120, "incorrect value for stec_residuals[8].stddev, expected 120, is %d", check_msg->stec_residuals[8].stddev); - ck_assert_msg(check_msg->stec_residuals[8].sv_id.constellation == 52, "incorrect value for stec_residuals[8].sv_id.constellation, expected 52, is %d", check_msg->stec_residuals[8].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[8].sv_id.satId == 119, "incorrect value for stec_residuals[8].sv_id.satId, expected 119, is %d", check_msg->stec_residuals[8].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[9].residual == 780, "incorrect value for stec_residuals[9].residual, expected 780, is %d", check_msg->stec_residuals[9].residual); - ck_assert_msg(check_msg->stec_residuals[9].stddev == 156, "incorrect value for stec_residuals[9].stddev, expected 156, is %d", check_msg->stec_residuals[9].stddev); - ck_assert_msg(check_msg->stec_residuals[9].sv_id.constellation == 221, "incorrect value for stec_residuals[9].sv_id.constellation, expected 221, is %d", check_msg->stec_residuals[9].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[9].sv_id.satId == 57, "incorrect value for stec_residuals[9].sv_id.satId, expected 57, is %d", check_msg->stec_residuals[9].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[10].residual == 32547, "incorrect value for stec_residuals[10].residual, expected 32547, is %d", check_msg->stec_residuals[10].residual); - ck_assert_msg(check_msg->stec_residuals[10].stddev == 8, "incorrect value for stec_residuals[10].stddev, expected 8, is %d", check_msg->stec_residuals[10].stddev); - ck_assert_msg(check_msg->stec_residuals[10].sv_id.constellation == 156, "incorrect value for stec_residuals[10].sv_id.constellation, expected 156, is %d", check_msg->stec_residuals[10].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[10].sv_id.satId == 70, "incorrect value for stec_residuals[10].sv_id.satId, expected 70, is %d", check_msg->stec_residuals[10].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[11].residual == 14208, "incorrect value for stec_residuals[11].residual, expected 14208, is %d", check_msg->stec_residuals[11].residual); - ck_assert_msg(check_msg->stec_residuals[11].stddev == 115, "incorrect value for stec_residuals[11].stddev, expected 115, is %d", check_msg->stec_residuals[11].stddev); - ck_assert_msg(check_msg->stec_residuals[11].sv_id.constellation == 58, "incorrect value for stec_residuals[11].sv_id.constellation, expected 58, is %d", check_msg->stec_residuals[11].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[11].sv_id.satId == 127, "incorrect value for stec_residuals[11].sv_id.satId, expected 127, is %d", check_msg->stec_residuals[11].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[12].residual == -26246, "incorrect value for stec_residuals[12].residual, expected -26246, is %d", check_msg->stec_residuals[12].residual); - ck_assert_msg(check_msg->stec_residuals[12].stddev == 124, "incorrect value for stec_residuals[12].stddev, expected 124, is %d", check_msg->stec_residuals[12].stddev); - ck_assert_msg(check_msg->stec_residuals[12].sv_id.constellation == 157, "incorrect value for stec_residuals[12].sv_id.constellation, expected 157, is %d", check_msg->stec_residuals[12].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[12].sv_id.satId == 80, "incorrect value for stec_residuals[12].sv_id.satId, expected 80, is %d", check_msg->stec_residuals[12].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[13].residual == 26466, "incorrect value for stec_residuals[13].residual, expected 26466, is %d", check_msg->stec_residuals[13].residual); - ck_assert_msg(check_msg->stec_residuals[13].stddev == 204, "incorrect value for stec_residuals[13].stddev, expected 204, is %d", check_msg->stec_residuals[13].stddev); - ck_assert_msg(check_msg->stec_residuals[13].sv_id.constellation == 128, "incorrect value for stec_residuals[13].sv_id.constellation, expected 128, is %d", check_msg->stec_residuals[13].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[13].sv_id.satId == 27, "incorrect value for stec_residuals[13].sv_id.satId, expected 27, is %d", check_msg->stec_residuals[13].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[14].residual == -7552, "incorrect value for stec_residuals[14].residual, expected -7552, is %d", check_msg->stec_residuals[14].residual); - ck_assert_msg(check_msg->stec_residuals[14].stddev == 148, "incorrect value for stec_residuals[14].stddev, expected 148, is %d", check_msg->stec_residuals[14].stddev); - ck_assert_msg(check_msg->stec_residuals[14].sv_id.constellation == 238, "incorrect value for stec_residuals[14].sv_id.constellation, expected 238, is %d", check_msg->stec_residuals[14].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[14].sv_id.satId == 75, "incorrect value for stec_residuals[14].sv_id.satId, expected 75, is %d", check_msg->stec_residuals[14].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[15].residual == -12072, "incorrect value for stec_residuals[15].residual, expected -12072, is %d", check_msg->stec_residuals[15].residual); - ck_assert_msg(check_msg->stec_residuals[15].stddev == 149, "incorrect value for stec_residuals[15].stddev, expected 149, is %d", check_msg->stec_residuals[15].stddev); - ck_assert_msg(check_msg->stec_residuals[15].sv_id.constellation == 61, "incorrect value for stec_residuals[15].sv_id.constellation, expected 61, is %d", check_msg->stec_residuals[15].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[15].sv_id.satId == 248, "incorrect value for stec_residuals[15].sv_id.satId, expected 248, is %d", check_msg->stec_residuals[15].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[16].residual == -28632, "incorrect value for stec_residuals[16].residual, expected -28632, is %d", check_msg->stec_residuals[16].residual); - ck_assert_msg(check_msg->stec_residuals[16].stddev == 186, "incorrect value for stec_residuals[16].stddev, expected 186, is %d", check_msg->stec_residuals[16].stddev); - ck_assert_msg(check_msg->stec_residuals[16].sv_id.constellation == 224, "incorrect value for stec_residuals[16].sv_id.constellation, expected 224, is %d", check_msg->stec_residuals[16].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[16].sv_id.satId == 167, "incorrect value for stec_residuals[16].sv_id.satId, expected 167, is %d", check_msg->stec_residuals[16].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[17].residual == -4024, "incorrect value for stec_residuals[17].residual, expected -4024, is %d", check_msg->stec_residuals[17].residual); - ck_assert_msg(check_msg->stec_residuals[17].stddev == 100, "incorrect value for stec_residuals[17].stddev, expected 100, is %d", check_msg->stec_residuals[17].stddev); - ck_assert_msg(check_msg->stec_residuals[17].sv_id.constellation == 227, "incorrect value for stec_residuals[17].sv_id.constellation, expected 227, is %d", check_msg->stec_residuals[17].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[17].sv_id.satId == 157, "incorrect value for stec_residuals[17].sv_id.satId, expected 157, is %d", check_msg->stec_residuals[17].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[18].residual == 2004, "incorrect value for stec_residuals[18].residual, expected 2004, is %d", check_msg->stec_residuals[18].residual); - ck_assert_msg(check_msg->stec_residuals[18].stddev == 59, "incorrect value for stec_residuals[18].stddev, expected 59, is %d", check_msg->stec_residuals[18].stddev); - ck_assert_msg(check_msg->stec_residuals[18].sv_id.constellation == 12, "incorrect value for stec_residuals[18].sv_id.constellation, expected 12, is %d", check_msg->stec_residuals[18].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[18].sv_id.satId == 35, "incorrect value for stec_residuals[18].sv_id.satId, expected 35, is %d", check_msg->stec_residuals[18].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[19].residual == 6998, "incorrect value for stec_residuals[19].residual, expected 6998, is %d", check_msg->stec_residuals[19].residual); - ck_assert_msg(check_msg->stec_residuals[19].stddev == 24, "incorrect value for stec_residuals[19].stddev, expected 24, is %d", check_msg->stec_residuals[19].stddev); - ck_assert_msg(check_msg->stec_residuals[19].sv_id.constellation == 81, "incorrect value for stec_residuals[19].sv_id.constellation, expected 81, is %d", check_msg->stec_residuals[19].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[19].sv_id.satId == 176, "incorrect value for stec_residuals[19].sv_id.satId, expected 176, is %d", check_msg->stec_residuals[19].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[20].residual == -31701, "incorrect value for stec_residuals[20].residual, expected -31701, is %d", check_msg->stec_residuals[20].residual); - ck_assert_msg(check_msg->stec_residuals[20].stddev == 45, "incorrect value for stec_residuals[20].stddev, expected 45, is %d", check_msg->stec_residuals[20].stddev); - ck_assert_msg(check_msg->stec_residuals[20].sv_id.constellation == 67, "incorrect value for stec_residuals[20].sv_id.constellation, expected 67, is %d", check_msg->stec_residuals[20].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[20].sv_id.satId == 155, "incorrect value for stec_residuals[20].sv_id.satId, expected 155, is %d", check_msg->stec_residuals[20].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[21].residual == 28678, "incorrect value for stec_residuals[21].residual, expected 28678, is %d", check_msg->stec_residuals[21].residual); - ck_assert_msg(check_msg->stec_residuals[21].stddev == 183, "incorrect value for stec_residuals[21].stddev, expected 183, is %d", check_msg->stec_residuals[21].stddev); - ck_assert_msg(check_msg->stec_residuals[21].sv_id.constellation == 44, "incorrect value for stec_residuals[21].sv_id.constellation, expected 44, is %d", check_msg->stec_residuals[21].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[21].sv_id.satId == 203, "incorrect value for stec_residuals[21].sv_id.satId, expected 203, is %d", check_msg->stec_residuals[21].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[22].residual == -15793, "incorrect value for stec_residuals[22].residual, expected -15793, is %d", check_msg->stec_residuals[22].residual); - ck_assert_msg(check_msg->stec_residuals[22].stddev == 253, "incorrect value for stec_residuals[22].stddev, expected 253, is %d", check_msg->stec_residuals[22].stddev); - ck_assert_msg(check_msg->stec_residuals[22].sv_id.constellation == 176, "incorrect value for stec_residuals[22].sv_id.constellation, expected 176, is %d", check_msg->stec_residuals[22].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[22].sv_id.satId == 231, "incorrect value for stec_residuals[22].sv_id.satId, expected 231, is %d", check_msg->stec_residuals[22].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[23].residual == -7589, "incorrect value for stec_residuals[23].residual, expected -7589, is %d", check_msg->stec_residuals[23].residual); - ck_assert_msg(check_msg->stec_residuals[23].stddev == 116, "incorrect value for stec_residuals[23].stddev, expected 116, is %d", check_msg->stec_residuals[23].stddev); - ck_assert_msg(check_msg->stec_residuals[23].sv_id.constellation == 103, "incorrect value for stec_residuals[23].sv_id.constellation, expected 103, is %d", check_msg->stec_residuals[23].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[23].sv_id.satId == 247, "incorrect value for stec_residuals[23].sv_id.satId, expected 247, is %d", check_msg->stec_residuals[23].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[24].residual == -7362, "incorrect value for stec_residuals[24].residual, expected -7362, is %d", check_msg->stec_residuals[24].residual); - ck_assert_msg(check_msg->stec_residuals[24].stddev == 240, "incorrect value for stec_residuals[24].stddev, expected 240, is %d", check_msg->stec_residuals[24].stddev); - ck_assert_msg(check_msg->stec_residuals[24].sv_id.constellation == 23, "incorrect value for stec_residuals[24].sv_id.constellation, expected 23, is %d", check_msg->stec_residuals[24].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[24].sv_id.satId == 148, "incorrect value for stec_residuals[24].sv_id.satId, expected 148, is %d", check_msg->stec_residuals[24].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[25].residual == 4813, "incorrect value for stec_residuals[25].residual, expected 4813, is %d", check_msg->stec_residuals[25].residual); - ck_assert_msg(check_msg->stec_residuals[25].stddev == 242, "incorrect value for stec_residuals[25].stddev, expected 242, is %d", check_msg->stec_residuals[25].stddev); - ck_assert_msg(check_msg->stec_residuals[25].sv_id.constellation == 219, "incorrect value for stec_residuals[25].sv_id.constellation, expected 219, is %d", check_msg->stec_residuals[25].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[25].sv_id.satId == 29, "incorrect value for stec_residuals[25].sv_id.satId, expected 29, is %d", check_msg->stec_residuals[25].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[26].residual == 20295, "incorrect value for stec_residuals[26].residual, expected 20295, is %d", check_msg->stec_residuals[26].residual); - ck_assert_msg(check_msg->stec_residuals[26].stddev == 37, "incorrect value for stec_residuals[26].stddev, expected 37, is %d", check_msg->stec_residuals[26].stddev); - ck_assert_msg(check_msg->stec_residuals[26].sv_id.constellation == 72, "incorrect value for stec_residuals[26].sv_id.constellation, expected 72, is %d", check_msg->stec_residuals[26].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[26].sv_id.satId == 207, "incorrect value for stec_residuals[26].sv_id.satId, expected 207, is %d", check_msg->stec_residuals[26].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[27].residual == -13623, "incorrect value for stec_residuals[27].residual, expected -13623, is %d", check_msg->stec_residuals[27].residual); - ck_assert_msg(check_msg->stec_residuals[27].stddev == 91, "incorrect value for stec_residuals[27].stddev, expected 91, is %d", check_msg->stec_residuals[27].stddev); - ck_assert_msg(check_msg->stec_residuals[27].sv_id.constellation == 176, "incorrect value for stec_residuals[27].sv_id.constellation, expected 176, is %d", check_msg->stec_residuals[27].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[27].sv_id.satId == 42, "incorrect value for stec_residuals[27].sv_id.satId, expected 42, is %d", check_msg->stec_residuals[27].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[28].residual == 15250, "incorrect value for stec_residuals[28].residual, expected 15250, is %d", check_msg->stec_residuals[28].residual); - ck_assert_msg(check_msg->stec_residuals[28].stddev == 110, "incorrect value for stec_residuals[28].stddev, expected 110, is %d", check_msg->stec_residuals[28].stddev); - ck_assert_msg(check_msg->stec_residuals[28].sv_id.constellation == 115, "incorrect value for stec_residuals[28].sv_id.constellation, expected 115, is %d", check_msg->stec_residuals[28].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[28].sv_id.satId == 105, "incorrect value for stec_residuals[28].sv_id.satId, expected 105, is %d", check_msg->stec_residuals[28].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[29].residual == -18560, "incorrect value for stec_residuals[29].residual, expected -18560, is %d", check_msg->stec_residuals[29].residual); - ck_assert_msg(check_msg->stec_residuals[29].stddev == 185, "incorrect value for stec_residuals[29].stddev, expected 185, is %d", check_msg->stec_residuals[29].stddev); - ck_assert_msg(check_msg->stec_residuals[29].sv_id.constellation == 109, "incorrect value for stec_residuals[29].sv_id.constellation, expected 109, is %d", check_msg->stec_residuals[29].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[29].sv_id.satId == 44, "incorrect value for stec_residuals[29].sv_id.satId, expected 44, is %d", check_msg->stec_residuals[29].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[30].residual == 23717, "incorrect value for stec_residuals[30].residual, expected 23717, is %d", check_msg->stec_residuals[30].residual); - ck_assert_msg(check_msg->stec_residuals[30].stddev == 79, "incorrect value for stec_residuals[30].stddev, expected 79, is %d", check_msg->stec_residuals[30].stddev); - ck_assert_msg(check_msg->stec_residuals[30].sv_id.constellation == 31, "incorrect value for stec_residuals[30].sv_id.constellation, expected 31, is %d", check_msg->stec_residuals[30].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[30].sv_id.satId == 67, "incorrect value for stec_residuals[30].sv_id.satId, expected 67, is %d", check_msg->stec_residuals[30].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[31].residual == 1886, "incorrect value for stec_residuals[31].residual, expected 1886, is %d", check_msg->stec_residuals[31].residual); - ck_assert_msg(check_msg->stec_residuals[31].stddev == 162, "incorrect value for stec_residuals[31].stddev, expected 162, is %d", check_msg->stec_residuals[31].stddev); - ck_assert_msg(check_msg->stec_residuals[31].sv_id.constellation == 180, "incorrect value for stec_residuals[31].sv_id.constellation, expected 180, is %d", check_msg->stec_residuals[31].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[31].sv_id.satId == 189, "incorrect value for stec_residuals[31].sv_id.satId, expected 189, is %d", check_msg->stec_residuals[31].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[32].residual == 12242, "incorrect value for stec_residuals[32].residual, expected 12242, is %d", check_msg->stec_residuals[32].residual); - ck_assert_msg(check_msg->stec_residuals[32].stddev == 7, "incorrect value for stec_residuals[32].stddev, expected 7, is %d", check_msg->stec_residuals[32].stddev); - ck_assert_msg(check_msg->stec_residuals[32].sv_id.constellation == 156, "incorrect value for stec_residuals[32].sv_id.constellation, expected 156, is %d", check_msg->stec_residuals[32].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[32].sv_id.satId == 121, "incorrect value for stec_residuals[32].sv_id.satId, expected 121, is %d", check_msg->stec_residuals[32].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[33].residual == 10670, "incorrect value for stec_residuals[33].residual, expected 10670, is %d", check_msg->stec_residuals[33].residual); - ck_assert_msg(check_msg->stec_residuals[33].stddev == 241, "incorrect value for stec_residuals[33].stddev, expected 241, is %d", check_msg->stec_residuals[33].stddev); - ck_assert_msg(check_msg->stec_residuals[33].sv_id.constellation == 205, "incorrect value for stec_residuals[33].sv_id.constellation, expected 205, is %d", check_msg->stec_residuals[33].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[33].sv_id.satId == 7, "incorrect value for stec_residuals[33].sv_id.satId, expected 7, is %d", check_msg->stec_residuals[33].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[34].residual == 25899, "incorrect value for stec_residuals[34].residual, expected 25899, is %d", check_msg->stec_residuals[34].residual); - ck_assert_msg(check_msg->stec_residuals[34].stddev == 186, "incorrect value for stec_residuals[34].stddev, expected 186, is %d", check_msg->stec_residuals[34].stddev); - ck_assert_msg(check_msg->stec_residuals[34].sv_id.constellation == 210, "incorrect value for stec_residuals[34].sv_id.constellation, expected 210, is %d", check_msg->stec_residuals[34].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[34].sv_id.satId == 129, "incorrect value for stec_residuals[34].sv_id.satId, expected 129, is %d", check_msg->stec_residuals[34].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[35].residual == -2078, "incorrect value for stec_residuals[35].residual, expected -2078, is %d", check_msg->stec_residuals[35].residual); - ck_assert_msg(check_msg->stec_residuals[35].stddev == 187, "incorrect value for stec_residuals[35].stddev, expected 187, is %d", check_msg->stec_residuals[35].stddev); - ck_assert_msg(check_msg->stec_residuals[35].sv_id.constellation == 195, "incorrect value for stec_residuals[35].sv_id.constellation, expected 195, is %d", check_msg->stec_residuals[35].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[35].sv_id.satId == 208, "incorrect value for stec_residuals[35].sv_id.satId, expected 208, is %d", check_msg->stec_residuals[35].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[36].residual == -16264, "incorrect value for stec_residuals[36].residual, expected -16264, is %d", check_msg->stec_residuals[36].residual); - ck_assert_msg(check_msg->stec_residuals[36].stddev == 102, "incorrect value for stec_residuals[36].stddev, expected 102, is %d", check_msg->stec_residuals[36].stddev); - ck_assert_msg(check_msg->stec_residuals[36].sv_id.constellation == 160, "incorrect value for stec_residuals[36].sv_id.constellation, expected 160, is %d", check_msg->stec_residuals[36].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[36].sv_id.satId == 219, "incorrect value for stec_residuals[36].sv_id.satId, expected 219, is %d", check_msg->stec_residuals[36].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[37].residual == -21002, "incorrect value for stec_residuals[37].residual, expected -21002, is %d", check_msg->stec_residuals[37].residual); - ck_assert_msg(check_msg->stec_residuals[37].stddev == 94, "incorrect value for stec_residuals[37].stddev, expected 94, is %d", check_msg->stec_residuals[37].stddev); - ck_assert_msg(check_msg->stec_residuals[37].sv_id.constellation == 42, "incorrect value for stec_residuals[37].sv_id.constellation, expected 42, is %d", check_msg->stec_residuals[37].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[37].sv_id.satId == 166, "incorrect value for stec_residuals[37].sv_id.satId, expected 166, is %d", check_msg->stec_residuals[37].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[38].residual == 7902, "incorrect value for stec_residuals[38].residual, expected 7902, is %d", check_msg->stec_residuals[38].residual); - ck_assert_msg(check_msg->stec_residuals[38].stddev == 35, "incorrect value for stec_residuals[38].stddev, expected 35, is %d", check_msg->stec_residuals[38].stddev); - ck_assert_msg(check_msg->stec_residuals[38].sv_id.constellation == 156, "incorrect value for stec_residuals[38].sv_id.constellation, expected 156, is %d", check_msg->stec_residuals[38].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[38].sv_id.satId == 102, "incorrect value for stec_residuals[38].sv_id.satId, expected 102, is %d", check_msg->stec_residuals[38].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[39].residual == -30275, "incorrect value for stec_residuals[39].residual, expected -30275, is %d", check_msg->stec_residuals[39].residual); - ck_assert_msg(check_msg->stec_residuals[39].stddev == 204, "incorrect value for stec_residuals[39].stddev, expected 204, is %d", check_msg->stec_residuals[39].stddev); - ck_assert_msg(check_msg->stec_residuals[39].sv_id.constellation == 64, "incorrect value for stec_residuals[39].sv_id.constellation, expected 64, is %d", check_msg->stec_residuals[39].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[39].sv_id.satId == 247, "incorrect value for stec_residuals[39].sv_id.satId, expected 247, is %d", check_msg->stec_residuals[39].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[40].residual == -8633, "incorrect value for stec_residuals[40].residual, expected -8633, is %d", check_msg->stec_residuals[40].residual); - ck_assert_msg(check_msg->stec_residuals[40].stddev == 222, "incorrect value for stec_residuals[40].stddev, expected 222, is %d", check_msg->stec_residuals[40].stddev); - ck_assert_msg(check_msg->stec_residuals[40].sv_id.constellation == 32, "incorrect value for stec_residuals[40].sv_id.constellation, expected 32, is %d", check_msg->stec_residuals[40].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[40].sv_id.satId == 220, "incorrect value for stec_residuals[40].sv_id.satId, expected 220, is %d", check_msg->stec_residuals[40].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[41].residual == 6403, "incorrect value for stec_residuals[41].residual, expected 6403, is %d", check_msg->stec_residuals[41].residual); - ck_assert_msg(check_msg->stec_residuals[41].stddev == 45, "incorrect value for stec_residuals[41].stddev, expected 45, is %d", check_msg->stec_residuals[41].stddev); - ck_assert_msg(check_msg->stec_residuals[41].sv_id.constellation == 246, "incorrect value for stec_residuals[41].sv_id.constellation, expected 246, is %d", check_msg->stec_residuals[41].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[41].sv_id.satId == 201, "incorrect value for stec_residuals[41].sv_id.satId, expected 201, is %d", check_msg->stec_residuals[41].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[42].residual == 22643, "incorrect value for stec_residuals[42].residual, expected 22643, is %d", check_msg->stec_residuals[42].residual); - ck_assert_msg(check_msg->stec_residuals[42].stddev == 218, "incorrect value for stec_residuals[42].stddev, expected 218, is %d", check_msg->stec_residuals[42].stddev); - ck_assert_msg(check_msg->stec_residuals[42].sv_id.constellation == 239, "incorrect value for stec_residuals[42].sv_id.constellation, expected 239, is %d", check_msg->stec_residuals[42].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[42].sv_id.satId == 251, "incorrect value for stec_residuals[42].sv_id.satId, expected 251, is %d", check_msg->stec_residuals[42].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[43].residual == 16760, "incorrect value for stec_residuals[43].residual, expected 16760, is %d", check_msg->stec_residuals[43].residual); - ck_assert_msg(check_msg->stec_residuals[43].stddev == 175, "incorrect value for stec_residuals[43].stddev, expected 175, is %d", check_msg->stec_residuals[43].stddev); - ck_assert_msg(check_msg->stec_residuals[43].sv_id.constellation == 209, "incorrect value for stec_residuals[43].sv_id.constellation, expected 209, is %d", check_msg->stec_residuals[43].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[43].sv_id.satId == 10, "incorrect value for stec_residuals[43].sv_id.satId, expected 10, is %d", check_msg->stec_residuals[43].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[44].residual == -20951, "incorrect value for stec_residuals[44].residual, expected -20951, is %d", check_msg->stec_residuals[44].residual); - ck_assert_msg(check_msg->stec_residuals[44].stddev == 137, "incorrect value for stec_residuals[44].stddev, expected 137, is %d", check_msg->stec_residuals[44].stddev); - ck_assert_msg(check_msg->stec_residuals[44].sv_id.constellation == 194, "incorrect value for stec_residuals[44].sv_id.constellation, expected 194, is %d", check_msg->stec_residuals[44].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[44].sv_id.satId == 131, "incorrect value for stec_residuals[44].sv_id.satId, expected 131, is %d", check_msg->stec_residuals[44].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[45].residual == -740, "incorrect value for stec_residuals[45].residual, expected -740, is %d", check_msg->stec_residuals[45].residual); - ck_assert_msg(check_msg->stec_residuals[45].stddev == 42, "incorrect value for stec_residuals[45].stddev, expected 42, is %d", check_msg->stec_residuals[45].stddev); - ck_assert_msg(check_msg->stec_residuals[45].sv_id.constellation == 68, "incorrect value for stec_residuals[45].sv_id.constellation, expected 68, is %d", check_msg->stec_residuals[45].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[45].sv_id.satId == 17, "incorrect value for stec_residuals[45].sv_id.satId, expected 17, is %d", check_msg->stec_residuals[45].sv_id.satId); - ck_assert_msg(check_msg->tropo_delay_correction.hydro == -3035, "incorrect value for tropo_delay_correction.hydro, expected -3035, is %d", check_msg->tropo_delay_correction.hydro); - ck_assert_msg(check_msg->tropo_delay_correction.stddev == 72, "incorrect value for tropo_delay_correction.stddev, expected 72, is %d", check_msg->tropo_delay_correction.stddev); - ck_assert_msg(check_msg->tropo_delay_correction.wet == 78, "incorrect value for tropo_delay_correction.wet, expected 78, is %d", check_msg->tropo_delay_correction.wet); + ck_assert_msg(check_msg->header.iod_atmo == 170, + "incorrect value for header.iod_atmo, expected 170, is %d", + check_msg->header.iod_atmo); + ck_assert_msg(check_msg->header.num_msgs == 48535, + "incorrect value for header.num_msgs, expected 48535, is %d", + check_msg->header.num_msgs); + ck_assert_msg(check_msg->header.seq_num == 50380, + "incorrect value for header.seq_num, expected 50380, is %d", + check_msg->header.seq_num); + ck_assert_msg(check_msg->header.tile_id == 12951, + "incorrect value for header.tile_id, expected 12951, is %d", + check_msg->header.tile_id); + ck_assert_msg( + check_msg->header.tile_set_id == 3605, + "incorrect value for header.tile_set_id, expected 3605, is %d", + check_msg->header.tile_set_id); + ck_assert_msg( + check_msg->header.time.tow == 2535294328, + "incorrect value for header.time.tow, expected 2535294328, is %d", + check_msg->header.time.tow); + ck_assert_msg(check_msg->header.time.wn == 58798, + "incorrect value for header.time.wn, expected 58798, is %d", + check_msg->header.time.wn); + ck_assert_msg(check_msg->header.tropo_quality_indicator == 120, + "incorrect value for header.tropo_quality_indicator, " + "expected 120, is %d", + check_msg->header.tropo_quality_indicator); + ck_assert_msg( + check_msg->header.update_interval == 105, + "incorrect value for header.update_interval, expected 105, is %d", + check_msg->header.update_interval); + ck_assert_msg(check_msg->index == 43413, + "incorrect value for index, expected 43413, is %d", + check_msg->index); + ck_assert_msg(check_msg->stec_residuals[0].residual == -21246, + "incorrect value for stec_residuals[0].residual, expected " + "-21246, is %d", + check_msg->stec_residuals[0].residual); + ck_assert_msg( + check_msg->stec_residuals[0].stddev == 88, + "incorrect value for stec_residuals[0].stddev, expected 88, is %d", + check_msg->stec_residuals[0].stddev); + ck_assert_msg(check_msg->stec_residuals[0].sv_id.constellation == 101, + "incorrect value for stec_residuals[0].sv_id.constellation, " + "expected 101, is %d", + check_msg->stec_residuals[0].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[0].sv_id.satId == 140, + "incorrect value for stec_residuals[0].sv_id.satId, expected " + "140, is %d", + check_msg->stec_residuals[0].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[1].residual == -26570, + "incorrect value for stec_residuals[1].residual, expected " + "-26570, is %d", + check_msg->stec_residuals[1].residual); + ck_assert_msg( + check_msg->stec_residuals[1].stddev == 115, + "incorrect value for stec_residuals[1].stddev, expected 115, is %d", + check_msg->stec_residuals[1].stddev); + ck_assert_msg(check_msg->stec_residuals[1].sv_id.constellation == 180, + "incorrect value for stec_residuals[1].sv_id.constellation, " + "expected 180, is %d", + check_msg->stec_residuals[1].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[1].sv_id.satId == 70, + "incorrect value for stec_residuals[1].sv_id.satId, expected 70, is %d", + check_msg->stec_residuals[1].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[2].residual == 6049, + "incorrect value for stec_residuals[2].residual, expected 6049, is %d", + check_msg->stec_residuals[2].residual); + ck_assert_msg( + check_msg->stec_residuals[2].stddev == 135, + "incorrect value for stec_residuals[2].stddev, expected 135, is %d", + check_msg->stec_residuals[2].stddev); + ck_assert_msg(check_msg->stec_residuals[2].sv_id.constellation == 201, + "incorrect value for stec_residuals[2].sv_id.constellation, " + "expected 201, is %d", + check_msg->stec_residuals[2].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[2].sv_id.satId == 78, + "incorrect value for stec_residuals[2].sv_id.satId, expected 78, is %d", + check_msg->stec_residuals[2].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[3].residual == 19261, + "incorrect value for stec_residuals[3].residual, expected 19261, is %d", + check_msg->stec_residuals[3].residual); + ck_assert_msg( + check_msg->stec_residuals[3].stddev == 178, + "incorrect value for stec_residuals[3].stddev, expected 178, is %d", + check_msg->stec_residuals[3].stddev); + ck_assert_msg(check_msg->stec_residuals[3].sv_id.constellation == 98, + "incorrect value for stec_residuals[3].sv_id.constellation, " + "expected 98, is %d", + check_msg->stec_residuals[3].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[3].sv_id.satId == 152, + "incorrect value for stec_residuals[3].sv_id.satId, expected " + "152, is %d", + check_msg->stec_residuals[3].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[4].residual == 14226, + "incorrect value for stec_residuals[4].residual, expected 14226, is %d", + check_msg->stec_residuals[4].residual); + ck_assert_msg( + check_msg->stec_residuals[4].stddev == 58, + "incorrect value for stec_residuals[4].stddev, expected 58, is %d", + check_msg->stec_residuals[4].stddev); + ck_assert_msg(check_msg->stec_residuals[4].sv_id.constellation == 229, + "incorrect value for stec_residuals[4].sv_id.constellation, " + "expected 229, is %d", + check_msg->stec_residuals[4].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[4].sv_id.satId == 120, + "incorrect value for stec_residuals[4].sv_id.satId, expected " + "120, is %d", + check_msg->stec_residuals[4].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[5].residual == 17894, + "incorrect value for stec_residuals[5].residual, expected 17894, is %d", + check_msg->stec_residuals[5].residual); + ck_assert_msg( + check_msg->stec_residuals[5].stddev == 172, + "incorrect value for stec_residuals[5].stddev, expected 172, is %d", + check_msg->stec_residuals[5].stddev); + ck_assert_msg(check_msg->stec_residuals[5].sv_id.constellation == 234, + "incorrect value for stec_residuals[5].sv_id.constellation, " + "expected 234, is %d", + check_msg->stec_residuals[5].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[5].sv_id.satId == 169, + "incorrect value for stec_residuals[5].sv_id.satId, expected " + "169, is %d", + check_msg->stec_residuals[5].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[6].residual == 22930, + "incorrect value for stec_residuals[6].residual, expected 22930, is %d", + check_msg->stec_residuals[6].residual); + ck_assert_msg( + check_msg->stec_residuals[6].stddev == 150, + "incorrect value for stec_residuals[6].stddev, expected 150, is %d", + check_msg->stec_residuals[6].stddev); + ck_assert_msg(check_msg->stec_residuals[6].sv_id.constellation == 127, + "incorrect value for stec_residuals[6].sv_id.constellation, " + "expected 127, is %d", + check_msg->stec_residuals[6].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[6].sv_id.satId == 191, + "incorrect value for stec_residuals[6].sv_id.satId, expected " + "191, is %d", + check_msg->stec_residuals[6].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[7].residual == 10721, + "incorrect value for stec_residuals[7].residual, expected 10721, is %d", + check_msg->stec_residuals[7].residual); + ck_assert_msg( + check_msg->stec_residuals[7].stddev == 17, + "incorrect value for stec_residuals[7].stddev, expected 17, is %d", + check_msg->stec_residuals[7].stddev); + ck_assert_msg(check_msg->stec_residuals[7].sv_id.constellation == 111, + "incorrect value for stec_residuals[7].sv_id.constellation, " + "expected 111, is %d", + check_msg->stec_residuals[7].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[7].sv_id.satId == 91, + "incorrect value for stec_residuals[7].sv_id.satId, expected 91, is %d", + check_msg->stec_residuals[7].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[8].residual == -22874, + "incorrect value for stec_residuals[8].residual, expected " + "-22874, is %d", + check_msg->stec_residuals[8].residual); + ck_assert_msg( + check_msg->stec_residuals[8].stddev == 120, + "incorrect value for stec_residuals[8].stddev, expected 120, is %d", + check_msg->stec_residuals[8].stddev); + ck_assert_msg(check_msg->stec_residuals[8].sv_id.constellation == 52, + "incorrect value for stec_residuals[8].sv_id.constellation, " + "expected 52, is %d", + check_msg->stec_residuals[8].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[8].sv_id.satId == 119, + "incorrect value for stec_residuals[8].sv_id.satId, expected " + "119, is %d", + check_msg->stec_residuals[8].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[9].residual == 780, + "incorrect value for stec_residuals[9].residual, expected 780, is %d", + check_msg->stec_residuals[9].residual); + ck_assert_msg( + check_msg->stec_residuals[9].stddev == 156, + "incorrect value for stec_residuals[9].stddev, expected 156, is %d", + check_msg->stec_residuals[9].stddev); + ck_assert_msg(check_msg->stec_residuals[9].sv_id.constellation == 221, + "incorrect value for stec_residuals[9].sv_id.constellation, " + "expected 221, is %d", + check_msg->stec_residuals[9].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[9].sv_id.satId == 57, + "incorrect value for stec_residuals[9].sv_id.satId, expected 57, is %d", + check_msg->stec_residuals[9].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[10].residual == 32547, + "incorrect value for stec_residuals[10].residual, expected " + "32547, is %d", + check_msg->stec_residuals[10].residual); + ck_assert_msg( + check_msg->stec_residuals[10].stddev == 8, + "incorrect value for stec_residuals[10].stddev, expected 8, is %d", + check_msg->stec_residuals[10].stddev); + ck_assert_msg(check_msg->stec_residuals[10].sv_id.constellation == 156, + "incorrect value for stec_residuals[10].sv_id.constellation, " + "expected 156, is %d", + check_msg->stec_residuals[10].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[10].sv_id.satId == 70, + "incorrect value for stec_residuals[10].sv_id.satId, " + "expected 70, is %d", + check_msg->stec_residuals[10].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[11].residual == 14208, + "incorrect value for stec_residuals[11].residual, expected " + "14208, is %d", + check_msg->stec_residuals[11].residual); + ck_assert_msg( + check_msg->stec_residuals[11].stddev == 115, + "incorrect value for stec_residuals[11].stddev, expected 115, is %d", + check_msg->stec_residuals[11].stddev); + ck_assert_msg(check_msg->stec_residuals[11].sv_id.constellation == 58, + "incorrect value for stec_residuals[11].sv_id.constellation, " + "expected 58, is %d", + check_msg->stec_residuals[11].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[11].sv_id.satId == 127, + "incorrect value for stec_residuals[11].sv_id.satId, " + "expected 127, is %d", + check_msg->stec_residuals[11].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[12].residual == -26246, + "incorrect value for stec_residuals[12].residual, expected " + "-26246, is %d", + check_msg->stec_residuals[12].residual); + ck_assert_msg( + check_msg->stec_residuals[12].stddev == 124, + "incorrect value for stec_residuals[12].stddev, expected 124, is %d", + check_msg->stec_residuals[12].stddev); + ck_assert_msg(check_msg->stec_residuals[12].sv_id.constellation == 157, + "incorrect value for stec_residuals[12].sv_id.constellation, " + "expected 157, is %d", + check_msg->stec_residuals[12].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[12].sv_id.satId == 80, + "incorrect value for stec_residuals[12].sv_id.satId, " + "expected 80, is %d", + check_msg->stec_residuals[12].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[13].residual == 26466, + "incorrect value for stec_residuals[13].residual, expected " + "26466, is %d", + check_msg->stec_residuals[13].residual); + ck_assert_msg( + check_msg->stec_residuals[13].stddev == 204, + "incorrect value for stec_residuals[13].stddev, expected 204, is %d", + check_msg->stec_residuals[13].stddev); + ck_assert_msg(check_msg->stec_residuals[13].sv_id.constellation == 128, + "incorrect value for stec_residuals[13].sv_id.constellation, " + "expected 128, is %d", + check_msg->stec_residuals[13].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[13].sv_id.satId == 27, + "incorrect value for stec_residuals[13].sv_id.satId, " + "expected 27, is %d", + check_msg->stec_residuals[13].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[14].residual == -7552, + "incorrect value for stec_residuals[14].residual, expected " + "-7552, is %d", + check_msg->stec_residuals[14].residual); + ck_assert_msg( + check_msg->stec_residuals[14].stddev == 148, + "incorrect value for stec_residuals[14].stddev, expected 148, is %d", + check_msg->stec_residuals[14].stddev); + ck_assert_msg(check_msg->stec_residuals[14].sv_id.constellation == 238, + "incorrect value for stec_residuals[14].sv_id.constellation, " + "expected 238, is %d", + check_msg->stec_residuals[14].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[14].sv_id.satId == 75, + "incorrect value for stec_residuals[14].sv_id.satId, " + "expected 75, is %d", + check_msg->stec_residuals[14].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[15].residual == -12072, + "incorrect value for stec_residuals[15].residual, expected " + "-12072, is %d", + check_msg->stec_residuals[15].residual); + ck_assert_msg( + check_msg->stec_residuals[15].stddev == 149, + "incorrect value for stec_residuals[15].stddev, expected 149, is %d", + check_msg->stec_residuals[15].stddev); + ck_assert_msg(check_msg->stec_residuals[15].sv_id.constellation == 61, + "incorrect value for stec_residuals[15].sv_id.constellation, " + "expected 61, is %d", + check_msg->stec_residuals[15].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[15].sv_id.satId == 248, + "incorrect value for stec_residuals[15].sv_id.satId, " + "expected 248, is %d", + check_msg->stec_residuals[15].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[16].residual == -28632, + "incorrect value for stec_residuals[16].residual, expected " + "-28632, is %d", + check_msg->stec_residuals[16].residual); + ck_assert_msg( + check_msg->stec_residuals[16].stddev == 186, + "incorrect value for stec_residuals[16].stddev, expected 186, is %d", + check_msg->stec_residuals[16].stddev); + ck_assert_msg(check_msg->stec_residuals[16].sv_id.constellation == 224, + "incorrect value for stec_residuals[16].sv_id.constellation, " + "expected 224, is %d", + check_msg->stec_residuals[16].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[16].sv_id.satId == 167, + "incorrect value for stec_residuals[16].sv_id.satId, " + "expected 167, is %d", + check_msg->stec_residuals[16].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[17].residual == -4024, + "incorrect value for stec_residuals[17].residual, expected " + "-4024, is %d", + check_msg->stec_residuals[17].residual); + ck_assert_msg( + check_msg->stec_residuals[17].stddev == 100, + "incorrect value for stec_residuals[17].stddev, expected 100, is %d", + check_msg->stec_residuals[17].stddev); + ck_assert_msg(check_msg->stec_residuals[17].sv_id.constellation == 227, + "incorrect value for stec_residuals[17].sv_id.constellation, " + "expected 227, is %d", + check_msg->stec_residuals[17].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[17].sv_id.satId == 157, + "incorrect value for stec_residuals[17].sv_id.satId, " + "expected 157, is %d", + check_msg->stec_residuals[17].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[18].residual == 2004, + "incorrect value for stec_residuals[18].residual, expected 2004, is %d", + check_msg->stec_residuals[18].residual); + ck_assert_msg( + check_msg->stec_residuals[18].stddev == 59, + "incorrect value for stec_residuals[18].stddev, expected 59, is %d", + check_msg->stec_residuals[18].stddev); + ck_assert_msg(check_msg->stec_residuals[18].sv_id.constellation == 12, + "incorrect value for stec_residuals[18].sv_id.constellation, " + "expected 12, is %d", + check_msg->stec_residuals[18].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[18].sv_id.satId == 35, + "incorrect value for stec_residuals[18].sv_id.satId, " + "expected 35, is %d", + check_msg->stec_residuals[18].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[19].residual == 6998, + "incorrect value for stec_residuals[19].residual, expected 6998, is %d", + check_msg->stec_residuals[19].residual); + ck_assert_msg( + check_msg->stec_residuals[19].stddev == 24, + "incorrect value for stec_residuals[19].stddev, expected 24, is %d", + check_msg->stec_residuals[19].stddev); + ck_assert_msg(check_msg->stec_residuals[19].sv_id.constellation == 81, + "incorrect value for stec_residuals[19].sv_id.constellation, " + "expected 81, is %d", + check_msg->stec_residuals[19].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[19].sv_id.satId == 176, + "incorrect value for stec_residuals[19].sv_id.satId, " + "expected 176, is %d", + check_msg->stec_residuals[19].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[20].residual == -31701, + "incorrect value for stec_residuals[20].residual, expected " + "-31701, is %d", + check_msg->stec_residuals[20].residual); + ck_assert_msg( + check_msg->stec_residuals[20].stddev == 45, + "incorrect value for stec_residuals[20].stddev, expected 45, is %d", + check_msg->stec_residuals[20].stddev); + ck_assert_msg(check_msg->stec_residuals[20].sv_id.constellation == 67, + "incorrect value for stec_residuals[20].sv_id.constellation, " + "expected 67, is %d", + check_msg->stec_residuals[20].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[20].sv_id.satId == 155, + "incorrect value for stec_residuals[20].sv_id.satId, " + "expected 155, is %d", + check_msg->stec_residuals[20].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[21].residual == 28678, + "incorrect value for stec_residuals[21].residual, expected " + "28678, is %d", + check_msg->stec_residuals[21].residual); + ck_assert_msg( + check_msg->stec_residuals[21].stddev == 183, + "incorrect value for stec_residuals[21].stddev, expected 183, is %d", + check_msg->stec_residuals[21].stddev); + ck_assert_msg(check_msg->stec_residuals[21].sv_id.constellation == 44, + "incorrect value for stec_residuals[21].sv_id.constellation, " + "expected 44, is %d", + check_msg->stec_residuals[21].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[21].sv_id.satId == 203, + "incorrect value for stec_residuals[21].sv_id.satId, " + "expected 203, is %d", + check_msg->stec_residuals[21].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[22].residual == -15793, + "incorrect value for stec_residuals[22].residual, expected " + "-15793, is %d", + check_msg->stec_residuals[22].residual); + ck_assert_msg( + check_msg->stec_residuals[22].stddev == 253, + "incorrect value for stec_residuals[22].stddev, expected 253, is %d", + check_msg->stec_residuals[22].stddev); + ck_assert_msg(check_msg->stec_residuals[22].sv_id.constellation == 176, + "incorrect value for stec_residuals[22].sv_id.constellation, " + "expected 176, is %d", + check_msg->stec_residuals[22].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[22].sv_id.satId == 231, + "incorrect value for stec_residuals[22].sv_id.satId, " + "expected 231, is %d", + check_msg->stec_residuals[22].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[23].residual == -7589, + "incorrect value for stec_residuals[23].residual, expected " + "-7589, is %d", + check_msg->stec_residuals[23].residual); + ck_assert_msg( + check_msg->stec_residuals[23].stddev == 116, + "incorrect value for stec_residuals[23].stddev, expected 116, is %d", + check_msg->stec_residuals[23].stddev); + ck_assert_msg(check_msg->stec_residuals[23].sv_id.constellation == 103, + "incorrect value for stec_residuals[23].sv_id.constellation, " + "expected 103, is %d", + check_msg->stec_residuals[23].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[23].sv_id.satId == 247, + "incorrect value for stec_residuals[23].sv_id.satId, " + "expected 247, is %d", + check_msg->stec_residuals[23].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[24].residual == -7362, + "incorrect value for stec_residuals[24].residual, expected " + "-7362, is %d", + check_msg->stec_residuals[24].residual); + ck_assert_msg( + check_msg->stec_residuals[24].stddev == 240, + "incorrect value for stec_residuals[24].stddev, expected 240, is %d", + check_msg->stec_residuals[24].stddev); + ck_assert_msg(check_msg->stec_residuals[24].sv_id.constellation == 23, + "incorrect value for stec_residuals[24].sv_id.constellation, " + "expected 23, is %d", + check_msg->stec_residuals[24].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[24].sv_id.satId == 148, + "incorrect value for stec_residuals[24].sv_id.satId, " + "expected 148, is %d", + check_msg->stec_residuals[24].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[25].residual == 4813, + "incorrect value for stec_residuals[25].residual, expected 4813, is %d", + check_msg->stec_residuals[25].residual); + ck_assert_msg( + check_msg->stec_residuals[25].stddev == 242, + "incorrect value for stec_residuals[25].stddev, expected 242, is %d", + check_msg->stec_residuals[25].stddev); + ck_assert_msg(check_msg->stec_residuals[25].sv_id.constellation == 219, + "incorrect value for stec_residuals[25].sv_id.constellation, " + "expected 219, is %d", + check_msg->stec_residuals[25].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[25].sv_id.satId == 29, + "incorrect value for stec_residuals[25].sv_id.satId, " + "expected 29, is %d", + check_msg->stec_residuals[25].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[26].residual == 20295, + "incorrect value for stec_residuals[26].residual, expected " + "20295, is %d", + check_msg->stec_residuals[26].residual); + ck_assert_msg( + check_msg->stec_residuals[26].stddev == 37, + "incorrect value for stec_residuals[26].stddev, expected 37, is %d", + check_msg->stec_residuals[26].stddev); + ck_assert_msg(check_msg->stec_residuals[26].sv_id.constellation == 72, + "incorrect value for stec_residuals[26].sv_id.constellation, " + "expected 72, is %d", + check_msg->stec_residuals[26].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[26].sv_id.satId == 207, + "incorrect value for stec_residuals[26].sv_id.satId, " + "expected 207, is %d", + check_msg->stec_residuals[26].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[27].residual == -13623, + "incorrect value for stec_residuals[27].residual, expected " + "-13623, is %d", + check_msg->stec_residuals[27].residual); + ck_assert_msg( + check_msg->stec_residuals[27].stddev == 91, + "incorrect value for stec_residuals[27].stddev, expected 91, is %d", + check_msg->stec_residuals[27].stddev); + ck_assert_msg(check_msg->stec_residuals[27].sv_id.constellation == 176, + "incorrect value for stec_residuals[27].sv_id.constellation, " + "expected 176, is %d", + check_msg->stec_residuals[27].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[27].sv_id.satId == 42, + "incorrect value for stec_residuals[27].sv_id.satId, " + "expected 42, is %d", + check_msg->stec_residuals[27].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[28].residual == 15250, + "incorrect value for stec_residuals[28].residual, expected " + "15250, is %d", + check_msg->stec_residuals[28].residual); + ck_assert_msg( + check_msg->stec_residuals[28].stddev == 110, + "incorrect value for stec_residuals[28].stddev, expected 110, is %d", + check_msg->stec_residuals[28].stddev); + ck_assert_msg(check_msg->stec_residuals[28].sv_id.constellation == 115, + "incorrect value for stec_residuals[28].sv_id.constellation, " + "expected 115, is %d", + check_msg->stec_residuals[28].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[28].sv_id.satId == 105, + "incorrect value for stec_residuals[28].sv_id.satId, " + "expected 105, is %d", + check_msg->stec_residuals[28].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[29].residual == -18560, + "incorrect value for stec_residuals[29].residual, expected " + "-18560, is %d", + check_msg->stec_residuals[29].residual); + ck_assert_msg( + check_msg->stec_residuals[29].stddev == 185, + "incorrect value for stec_residuals[29].stddev, expected 185, is %d", + check_msg->stec_residuals[29].stddev); + ck_assert_msg(check_msg->stec_residuals[29].sv_id.constellation == 109, + "incorrect value for stec_residuals[29].sv_id.constellation, " + "expected 109, is %d", + check_msg->stec_residuals[29].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[29].sv_id.satId == 44, + "incorrect value for stec_residuals[29].sv_id.satId, " + "expected 44, is %d", + check_msg->stec_residuals[29].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[30].residual == 23717, + "incorrect value for stec_residuals[30].residual, expected " + "23717, is %d", + check_msg->stec_residuals[30].residual); + ck_assert_msg( + check_msg->stec_residuals[30].stddev == 79, + "incorrect value for stec_residuals[30].stddev, expected 79, is %d", + check_msg->stec_residuals[30].stddev); + ck_assert_msg(check_msg->stec_residuals[30].sv_id.constellation == 31, + "incorrect value for stec_residuals[30].sv_id.constellation, " + "expected 31, is %d", + check_msg->stec_residuals[30].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[30].sv_id.satId == 67, + "incorrect value for stec_residuals[30].sv_id.satId, " + "expected 67, is %d", + check_msg->stec_residuals[30].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[31].residual == 1886, + "incorrect value for stec_residuals[31].residual, expected 1886, is %d", + check_msg->stec_residuals[31].residual); + ck_assert_msg( + check_msg->stec_residuals[31].stddev == 162, + "incorrect value for stec_residuals[31].stddev, expected 162, is %d", + check_msg->stec_residuals[31].stddev); + ck_assert_msg(check_msg->stec_residuals[31].sv_id.constellation == 180, + "incorrect value for stec_residuals[31].sv_id.constellation, " + "expected 180, is %d", + check_msg->stec_residuals[31].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[31].sv_id.satId == 189, + "incorrect value for stec_residuals[31].sv_id.satId, " + "expected 189, is %d", + check_msg->stec_residuals[31].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[32].residual == 12242, + "incorrect value for stec_residuals[32].residual, expected " + "12242, is %d", + check_msg->stec_residuals[32].residual); + ck_assert_msg( + check_msg->stec_residuals[32].stddev == 7, + "incorrect value for stec_residuals[32].stddev, expected 7, is %d", + check_msg->stec_residuals[32].stddev); + ck_assert_msg(check_msg->stec_residuals[32].sv_id.constellation == 156, + "incorrect value for stec_residuals[32].sv_id.constellation, " + "expected 156, is %d", + check_msg->stec_residuals[32].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[32].sv_id.satId == 121, + "incorrect value for stec_residuals[32].sv_id.satId, " + "expected 121, is %d", + check_msg->stec_residuals[32].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[33].residual == 10670, + "incorrect value for stec_residuals[33].residual, expected " + "10670, is %d", + check_msg->stec_residuals[33].residual); + ck_assert_msg( + check_msg->stec_residuals[33].stddev == 241, + "incorrect value for stec_residuals[33].stddev, expected 241, is %d", + check_msg->stec_residuals[33].stddev); + ck_assert_msg(check_msg->stec_residuals[33].sv_id.constellation == 205, + "incorrect value for stec_residuals[33].sv_id.constellation, " + "expected 205, is %d", + check_msg->stec_residuals[33].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[33].sv_id.satId == 7, + "incorrect value for stec_residuals[33].sv_id.satId, expected 7, is %d", + check_msg->stec_residuals[33].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[34].residual == 25899, + "incorrect value for stec_residuals[34].residual, expected " + "25899, is %d", + check_msg->stec_residuals[34].residual); + ck_assert_msg( + check_msg->stec_residuals[34].stddev == 186, + "incorrect value for stec_residuals[34].stddev, expected 186, is %d", + check_msg->stec_residuals[34].stddev); + ck_assert_msg(check_msg->stec_residuals[34].sv_id.constellation == 210, + "incorrect value for stec_residuals[34].sv_id.constellation, " + "expected 210, is %d", + check_msg->stec_residuals[34].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[34].sv_id.satId == 129, + "incorrect value for stec_residuals[34].sv_id.satId, " + "expected 129, is %d", + check_msg->stec_residuals[34].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[35].residual == -2078, + "incorrect value for stec_residuals[35].residual, expected " + "-2078, is %d", + check_msg->stec_residuals[35].residual); + ck_assert_msg( + check_msg->stec_residuals[35].stddev == 187, + "incorrect value for stec_residuals[35].stddev, expected 187, is %d", + check_msg->stec_residuals[35].stddev); + ck_assert_msg(check_msg->stec_residuals[35].sv_id.constellation == 195, + "incorrect value for stec_residuals[35].sv_id.constellation, " + "expected 195, is %d", + check_msg->stec_residuals[35].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[35].sv_id.satId == 208, + "incorrect value for stec_residuals[35].sv_id.satId, " + "expected 208, is %d", + check_msg->stec_residuals[35].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[36].residual == -16264, + "incorrect value for stec_residuals[36].residual, expected " + "-16264, is %d", + check_msg->stec_residuals[36].residual); + ck_assert_msg( + check_msg->stec_residuals[36].stddev == 102, + "incorrect value for stec_residuals[36].stddev, expected 102, is %d", + check_msg->stec_residuals[36].stddev); + ck_assert_msg(check_msg->stec_residuals[36].sv_id.constellation == 160, + "incorrect value for stec_residuals[36].sv_id.constellation, " + "expected 160, is %d", + check_msg->stec_residuals[36].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[36].sv_id.satId == 219, + "incorrect value for stec_residuals[36].sv_id.satId, " + "expected 219, is %d", + check_msg->stec_residuals[36].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[37].residual == -21002, + "incorrect value for stec_residuals[37].residual, expected " + "-21002, is %d", + check_msg->stec_residuals[37].residual); + ck_assert_msg( + check_msg->stec_residuals[37].stddev == 94, + "incorrect value for stec_residuals[37].stddev, expected 94, is %d", + check_msg->stec_residuals[37].stddev); + ck_assert_msg(check_msg->stec_residuals[37].sv_id.constellation == 42, + "incorrect value for stec_residuals[37].sv_id.constellation, " + "expected 42, is %d", + check_msg->stec_residuals[37].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[37].sv_id.satId == 166, + "incorrect value for stec_residuals[37].sv_id.satId, " + "expected 166, is %d", + check_msg->stec_residuals[37].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[38].residual == 7902, + "incorrect value for stec_residuals[38].residual, expected 7902, is %d", + check_msg->stec_residuals[38].residual); + ck_assert_msg( + check_msg->stec_residuals[38].stddev == 35, + "incorrect value for stec_residuals[38].stddev, expected 35, is %d", + check_msg->stec_residuals[38].stddev); + ck_assert_msg(check_msg->stec_residuals[38].sv_id.constellation == 156, + "incorrect value for stec_residuals[38].sv_id.constellation, " + "expected 156, is %d", + check_msg->stec_residuals[38].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[38].sv_id.satId == 102, + "incorrect value for stec_residuals[38].sv_id.satId, " + "expected 102, is %d", + check_msg->stec_residuals[38].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[39].residual == -30275, + "incorrect value for stec_residuals[39].residual, expected " + "-30275, is %d", + check_msg->stec_residuals[39].residual); + ck_assert_msg( + check_msg->stec_residuals[39].stddev == 204, + "incorrect value for stec_residuals[39].stddev, expected 204, is %d", + check_msg->stec_residuals[39].stddev); + ck_assert_msg(check_msg->stec_residuals[39].sv_id.constellation == 64, + "incorrect value for stec_residuals[39].sv_id.constellation, " + "expected 64, is %d", + check_msg->stec_residuals[39].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[39].sv_id.satId == 247, + "incorrect value for stec_residuals[39].sv_id.satId, " + "expected 247, is %d", + check_msg->stec_residuals[39].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[40].residual == -8633, + "incorrect value for stec_residuals[40].residual, expected " + "-8633, is %d", + check_msg->stec_residuals[40].residual); + ck_assert_msg( + check_msg->stec_residuals[40].stddev == 222, + "incorrect value for stec_residuals[40].stddev, expected 222, is %d", + check_msg->stec_residuals[40].stddev); + ck_assert_msg(check_msg->stec_residuals[40].sv_id.constellation == 32, + "incorrect value for stec_residuals[40].sv_id.constellation, " + "expected 32, is %d", + check_msg->stec_residuals[40].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[40].sv_id.satId == 220, + "incorrect value for stec_residuals[40].sv_id.satId, " + "expected 220, is %d", + check_msg->stec_residuals[40].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[41].residual == 6403, + "incorrect value for stec_residuals[41].residual, expected 6403, is %d", + check_msg->stec_residuals[41].residual); + ck_assert_msg( + check_msg->stec_residuals[41].stddev == 45, + "incorrect value for stec_residuals[41].stddev, expected 45, is %d", + check_msg->stec_residuals[41].stddev); + ck_assert_msg(check_msg->stec_residuals[41].sv_id.constellation == 246, + "incorrect value for stec_residuals[41].sv_id.constellation, " + "expected 246, is %d", + check_msg->stec_residuals[41].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[41].sv_id.satId == 201, + "incorrect value for stec_residuals[41].sv_id.satId, " + "expected 201, is %d", + check_msg->stec_residuals[41].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[42].residual == 22643, + "incorrect value for stec_residuals[42].residual, expected " + "22643, is %d", + check_msg->stec_residuals[42].residual); + ck_assert_msg( + check_msg->stec_residuals[42].stddev == 218, + "incorrect value for stec_residuals[42].stddev, expected 218, is %d", + check_msg->stec_residuals[42].stddev); + ck_assert_msg(check_msg->stec_residuals[42].sv_id.constellation == 239, + "incorrect value for stec_residuals[42].sv_id.constellation, " + "expected 239, is %d", + check_msg->stec_residuals[42].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[42].sv_id.satId == 251, + "incorrect value for stec_residuals[42].sv_id.satId, " + "expected 251, is %d", + check_msg->stec_residuals[42].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[43].residual == 16760, + "incorrect value for stec_residuals[43].residual, expected " + "16760, is %d", + check_msg->stec_residuals[43].residual); + ck_assert_msg( + check_msg->stec_residuals[43].stddev == 175, + "incorrect value for stec_residuals[43].stddev, expected 175, is %d", + check_msg->stec_residuals[43].stddev); + ck_assert_msg(check_msg->stec_residuals[43].sv_id.constellation == 209, + "incorrect value for stec_residuals[43].sv_id.constellation, " + "expected 209, is %d", + check_msg->stec_residuals[43].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[43].sv_id.satId == 10, + "incorrect value for stec_residuals[43].sv_id.satId, " + "expected 10, is %d", + check_msg->stec_residuals[43].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[44].residual == -20951, + "incorrect value for stec_residuals[44].residual, expected " + "-20951, is %d", + check_msg->stec_residuals[44].residual); + ck_assert_msg( + check_msg->stec_residuals[44].stddev == 137, + "incorrect value for stec_residuals[44].stddev, expected 137, is %d", + check_msg->stec_residuals[44].stddev); + ck_assert_msg(check_msg->stec_residuals[44].sv_id.constellation == 194, + "incorrect value for stec_residuals[44].sv_id.constellation, " + "expected 194, is %d", + check_msg->stec_residuals[44].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[44].sv_id.satId == 131, + "incorrect value for stec_residuals[44].sv_id.satId, " + "expected 131, is %d", + check_msg->stec_residuals[44].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[45].residual == -740, + "incorrect value for stec_residuals[45].residual, expected -740, is %d", + check_msg->stec_residuals[45].residual); + ck_assert_msg( + check_msg->stec_residuals[45].stddev == 42, + "incorrect value for stec_residuals[45].stddev, expected 42, is %d", + check_msg->stec_residuals[45].stddev); + ck_assert_msg(check_msg->stec_residuals[45].sv_id.constellation == 68, + "incorrect value for stec_residuals[45].sv_id.constellation, " + "expected 68, is %d", + check_msg->stec_residuals[45].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[45].sv_id.satId == 17, + "incorrect value for stec_residuals[45].sv_id.satId, " + "expected 17, is %d", + check_msg->stec_residuals[45].sv_id.satId); + ck_assert_msg(check_msg->tropo_delay_correction.hydro == -3035, + "incorrect value for tropo_delay_correction.hydro, expected " + "-3035, is %d", + check_msg->tropo_delay_correction.hydro); + ck_assert_msg( + check_msg->tropo_delay_correction.stddev == 72, + "incorrect value for tropo_delay_correction.stddev, expected 72, is %d", + check_msg->tropo_delay_correction.stddev); + ck_assert_msg( + check_msg->tropo_delay_correction.wet == 78, + "incorrect value for tropo_delay_correction.wet, expected 78, is %d", + check_msg->tropo_delay_correction.wet); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection); +Suite *legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.c index 6a6646903..5061d4480 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionBounds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionBounds.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,25 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 1534, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 1534, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 1534, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 1534, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,254,5,66,0,45,180,0,0,0,3,0,1,0,10,0,15,1,0,10,0,39,232,3,244,1,100,200,150,100,150,100,2,5,10,16,0,17,18,19,20,21,6,10,22,0,23,24,25,26,27,236,182, }; + u8 encoded_frame[] = { + 85, 254, 5, 66, 0, 45, 180, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 15, 1, 0, 10, 0, 39, 232, 3, 244, 1, 100, 200, + 150, 100, 150, 100, 2, 5, 10, 16, 0, 17, 18, 19, 20, 21, + 6, 10, 22, 0, 23, 24, 25, 26, 27, 236, 182, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_gridded_correction_bounds_t* test_msg = ( msg_ssr_gridded_correction_bounds_t* )test_msg_storage; + msg_ssr_gridded_correction_bounds_t* test_msg = + (msg_ssr_gridded_correction_bounds_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->grid_point_id = 1000; test_msg->header.num_msgs = 1; @@ -186,94 +191,202 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds ) test_msg->tropo_v_hydro_bound_sig = 100; test_msg->tropo_v_wet_bound_mu = 150; test_msg->tropo_v_wet_bound_sig = 100; - sbp_payload_send(&sbp_state, 1534, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 1534, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 1534, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_gridded_correction_bounds_t* check_msg = ( msg_ssr_gridded_correction_bounds_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_gridded_correction_bounds_t* check_msg = + (msg_ssr_gridded_correction_bounds_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->grid_point_id == 1000, "incorrect value for grid_point_id, expected 1000, is %d", check_msg->grid_point_id); - ck_assert_msg(check_msg->header.num_msgs == 1, "incorrect value for header.num_msgs, expected 1, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.seq_num == 0, "incorrect value for header.seq_num, expected 0, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->header.sol_id == 0, "incorrect value for header.sol_id, expected 0, is %d", check_msg->header.sol_id); - ck_assert_msg(check_msg->header.time.tow == 180, "incorrect value for header.time.tow, expected 180, is %d", check_msg->header.time.tow); - ck_assert_msg(check_msg->header.time.wn == 3, "incorrect value for header.time.wn, expected 3, is %d", check_msg->header.time.wn); - ck_assert_msg(check_msg->header.update_interval == 10, "incorrect value for header.update_interval, expected 10, is %d", check_msg->header.update_interval); - ck_assert_msg(check_msg->n_sats == 2, "incorrect value for n_sats, expected 2, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->ssr_iod_atmo == 15, "incorrect value for ssr_iod_atmo, expected 15, is %d", check_msg->ssr_iod_atmo); - ck_assert_msg(check_msg->stec_sat_list[0].stec_bound_mu == 18, "incorrect value for stec_sat_list[0].stec_bound_mu, expected 18, is %d", check_msg->stec_sat_list[0].stec_bound_mu); - ck_assert_msg(check_msg->stec_sat_list[0].stec_bound_mu_dot == 20, "incorrect value for stec_sat_list[0].stec_bound_mu_dot, expected 20, is %d", check_msg->stec_sat_list[0].stec_bound_mu_dot); - ck_assert_msg(check_msg->stec_sat_list[0].stec_bound_sig == 19, "incorrect value for stec_sat_list[0].stec_bound_sig, expected 19, is %d", check_msg->stec_sat_list[0].stec_bound_sig); - ck_assert_msg(check_msg->stec_sat_list[0].stec_bound_sig_dot == 21, "incorrect value for stec_sat_list[0].stec_bound_sig_dot, expected 21, is %d", check_msg->stec_sat_list[0].stec_bound_sig_dot); - ck_assert_msg(check_msg->stec_sat_list[0].stec_residual.residual == 16, "incorrect value for stec_sat_list[0].stec_residual.residual, expected 16, is %d", check_msg->stec_sat_list[0].stec_residual.residual); - ck_assert_msg(check_msg->stec_sat_list[0].stec_residual.stddev == 17, "incorrect value for stec_sat_list[0].stec_residual.stddev, expected 17, is %d", check_msg->stec_sat_list[0].stec_residual.stddev); - ck_assert_msg(check_msg->stec_sat_list[0].stec_residual.sv_id.constellation == 10, "incorrect value for stec_sat_list[0].stec_residual.sv_id.constellation, expected 10, is %d", check_msg->stec_sat_list[0].stec_residual.sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[0].stec_residual.sv_id.satId == 5, "incorrect value for stec_sat_list[0].stec_residual.sv_id.satId, expected 5, is %d", check_msg->stec_sat_list[0].stec_residual.sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[1].stec_bound_mu == 24, "incorrect value for stec_sat_list[1].stec_bound_mu, expected 24, is %d", check_msg->stec_sat_list[1].stec_bound_mu); - ck_assert_msg(check_msg->stec_sat_list[1].stec_bound_mu_dot == 26, "incorrect value for stec_sat_list[1].stec_bound_mu_dot, expected 26, is %d", check_msg->stec_sat_list[1].stec_bound_mu_dot); - ck_assert_msg(check_msg->stec_sat_list[1].stec_bound_sig == 25, "incorrect value for stec_sat_list[1].stec_bound_sig, expected 25, is %d", check_msg->stec_sat_list[1].stec_bound_sig); - ck_assert_msg(check_msg->stec_sat_list[1].stec_bound_sig_dot == 27, "incorrect value for stec_sat_list[1].stec_bound_sig_dot, expected 27, is %d", check_msg->stec_sat_list[1].stec_bound_sig_dot); - ck_assert_msg(check_msg->stec_sat_list[1].stec_residual.residual == 22, "incorrect value for stec_sat_list[1].stec_residual.residual, expected 22, is %d", check_msg->stec_sat_list[1].stec_residual.residual); - ck_assert_msg(check_msg->stec_sat_list[1].stec_residual.stddev == 23, "incorrect value for stec_sat_list[1].stec_residual.stddev, expected 23, is %d", check_msg->stec_sat_list[1].stec_residual.stddev); - ck_assert_msg(check_msg->stec_sat_list[1].stec_residual.sv_id.constellation == 10, "incorrect value for stec_sat_list[1].stec_residual.sv_id.constellation, expected 10, is %d", check_msg->stec_sat_list[1].stec_residual.sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[1].stec_residual.sv_id.satId == 6, "incorrect value for stec_sat_list[1].stec_residual.sv_id.satId, expected 6, is %d", check_msg->stec_sat_list[1].stec_residual.sv_id.satId); - ck_assert_msg(check_msg->tile_id == 10, "incorrect value for tile_id, expected 10, is %d", check_msg->tile_id); - ck_assert_msg(check_msg->tile_set_id == 1, "incorrect value for tile_set_id, expected 1, is %d", check_msg->tile_set_id); - ck_assert_msg(check_msg->tropo_delay_correction.hydro == 500, "incorrect value for tropo_delay_correction.hydro, expected 500, is %d", check_msg->tropo_delay_correction.hydro); - ck_assert_msg(check_msg->tropo_delay_correction.stddev == 200, "incorrect value for tropo_delay_correction.stddev, expected 200, is %d", check_msg->tropo_delay_correction.stddev); - ck_assert_msg(check_msg->tropo_delay_correction.wet == 100, "incorrect value for tropo_delay_correction.wet, expected 100, is %d", check_msg->tropo_delay_correction.wet); - ck_assert_msg(check_msg->tropo_qi == 39, "incorrect value for tropo_qi, expected 39, is %d", check_msg->tropo_qi); - ck_assert_msg(check_msg->tropo_v_hydro_bound_mu == 150, "incorrect value for tropo_v_hydro_bound_mu, expected 150, is %d", check_msg->tropo_v_hydro_bound_mu); - ck_assert_msg(check_msg->tropo_v_hydro_bound_sig == 100, "incorrect value for tropo_v_hydro_bound_sig, expected 100, is %d", check_msg->tropo_v_hydro_bound_sig); - ck_assert_msg(check_msg->tropo_v_wet_bound_mu == 150, "incorrect value for tropo_v_wet_bound_mu, expected 150, is %d", check_msg->tropo_v_wet_bound_mu); - ck_assert_msg(check_msg->tropo_v_wet_bound_sig == 100, "incorrect value for tropo_v_wet_bound_sig, expected 100, is %d", check_msg->tropo_v_wet_bound_sig); + ck_assert_msg(check_msg->grid_point_id == 1000, + "incorrect value for grid_point_id, expected 1000, is %d", + check_msg->grid_point_id); + ck_assert_msg(check_msg->header.num_msgs == 1, + "incorrect value for header.num_msgs, expected 1, is %d", + check_msg->header.num_msgs); + ck_assert_msg(check_msg->header.seq_num == 0, + "incorrect value for header.seq_num, expected 0, is %d", + check_msg->header.seq_num); + ck_assert_msg(check_msg->header.sol_id == 0, + "incorrect value for header.sol_id, expected 0, is %d", + check_msg->header.sol_id); + ck_assert_msg(check_msg->header.time.tow == 180, + "incorrect value for header.time.tow, expected 180, is %d", + check_msg->header.time.tow); + ck_assert_msg(check_msg->header.time.wn == 3, + "incorrect value for header.time.wn, expected 3, is %d", + check_msg->header.time.wn); + ck_assert_msg( + check_msg->header.update_interval == 10, + "incorrect value for header.update_interval, expected 10, is %d", + check_msg->header.update_interval); + ck_assert_msg(check_msg->n_sats == 2, + "incorrect value for n_sats, expected 2, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->ssr_iod_atmo == 15, + "incorrect value for ssr_iod_atmo, expected 15, is %d", + check_msg->ssr_iod_atmo); + ck_assert_msg(check_msg->stec_sat_list[0].stec_bound_mu == 18, + "incorrect value for stec_sat_list[0].stec_bound_mu, " + "expected 18, is %d", + check_msg->stec_sat_list[0].stec_bound_mu); + ck_assert_msg(check_msg->stec_sat_list[0].stec_bound_mu_dot == 20, + "incorrect value for stec_sat_list[0].stec_bound_mu_dot, " + "expected 20, is %d", + check_msg->stec_sat_list[0].stec_bound_mu_dot); + ck_assert_msg(check_msg->stec_sat_list[0].stec_bound_sig == 19, + "incorrect value for stec_sat_list[0].stec_bound_sig, " + "expected 19, is %d", + check_msg->stec_sat_list[0].stec_bound_sig); + ck_assert_msg(check_msg->stec_sat_list[0].stec_bound_sig_dot == 21, + "incorrect value for stec_sat_list[0].stec_bound_sig_dot, " + "expected 21, is %d", + check_msg->stec_sat_list[0].stec_bound_sig_dot); + ck_assert_msg(check_msg->stec_sat_list[0].stec_residual.residual == 16, + "incorrect value for " + "stec_sat_list[0].stec_residual.residual, expected 16, is %d", + check_msg->stec_sat_list[0].stec_residual.residual); + ck_assert_msg(check_msg->stec_sat_list[0].stec_residual.stddev == 17, + "incorrect value for stec_sat_list[0].stec_residual.stddev, " + "expected 17, is %d", + check_msg->stec_sat_list[0].stec_residual.stddev); + ck_assert_msg( + check_msg->stec_sat_list[0].stec_residual.sv_id.constellation == 10, + "incorrect value for " + "stec_sat_list[0].stec_residual.sv_id.constellation, expected 10, is " + "%d", + check_msg->stec_sat_list[0].stec_residual.sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[0].stec_residual.sv_id.satId == 5, + "incorrect value for stec_sat_list[0].stec_residual.sv_id.satId, " + "expected 5, is %d", + check_msg->stec_sat_list[0].stec_residual.sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[1].stec_bound_mu == 24, + "incorrect value for stec_sat_list[1].stec_bound_mu, " + "expected 24, is %d", + check_msg->stec_sat_list[1].stec_bound_mu); + ck_assert_msg(check_msg->stec_sat_list[1].stec_bound_mu_dot == 26, + "incorrect value for stec_sat_list[1].stec_bound_mu_dot, " + "expected 26, is %d", + check_msg->stec_sat_list[1].stec_bound_mu_dot); + ck_assert_msg(check_msg->stec_sat_list[1].stec_bound_sig == 25, + "incorrect value for stec_sat_list[1].stec_bound_sig, " + "expected 25, is %d", + check_msg->stec_sat_list[1].stec_bound_sig); + ck_assert_msg(check_msg->stec_sat_list[1].stec_bound_sig_dot == 27, + "incorrect value for stec_sat_list[1].stec_bound_sig_dot, " + "expected 27, is %d", + check_msg->stec_sat_list[1].stec_bound_sig_dot); + ck_assert_msg(check_msg->stec_sat_list[1].stec_residual.residual == 22, + "incorrect value for " + "stec_sat_list[1].stec_residual.residual, expected 22, is %d", + check_msg->stec_sat_list[1].stec_residual.residual); + ck_assert_msg(check_msg->stec_sat_list[1].stec_residual.stddev == 23, + "incorrect value for stec_sat_list[1].stec_residual.stddev, " + "expected 23, is %d", + check_msg->stec_sat_list[1].stec_residual.stddev); + ck_assert_msg( + check_msg->stec_sat_list[1].stec_residual.sv_id.constellation == 10, + "incorrect value for " + "stec_sat_list[1].stec_residual.sv_id.constellation, expected 10, is " + "%d", + check_msg->stec_sat_list[1].stec_residual.sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[1].stec_residual.sv_id.satId == 6, + "incorrect value for stec_sat_list[1].stec_residual.sv_id.satId, " + "expected 6, is %d", + check_msg->stec_sat_list[1].stec_residual.sv_id.satId); + ck_assert_msg(check_msg->tile_id == 10, + "incorrect value for tile_id, expected 10, is %d", + check_msg->tile_id); + ck_assert_msg(check_msg->tile_set_id == 1, + "incorrect value for tile_set_id, expected 1, is %d", + check_msg->tile_set_id); + ck_assert_msg( + check_msg->tropo_delay_correction.hydro == 500, + "incorrect value for tropo_delay_correction.hydro, expected 500, is %d", + check_msg->tropo_delay_correction.hydro); + ck_assert_msg(check_msg->tropo_delay_correction.stddev == 200, + "incorrect value for tropo_delay_correction.stddev, expected " + "200, is %d", + check_msg->tropo_delay_correction.stddev); + ck_assert_msg( + check_msg->tropo_delay_correction.wet == 100, + "incorrect value for tropo_delay_correction.wet, expected 100, is %d", + check_msg->tropo_delay_correction.wet); + ck_assert_msg(check_msg->tropo_qi == 39, + "incorrect value for tropo_qi, expected 39, is %d", + check_msg->tropo_qi); + ck_assert_msg( + check_msg->tropo_v_hydro_bound_mu == 150, + "incorrect value for tropo_v_hydro_bound_mu, expected 150, is %d", + check_msg->tropo_v_hydro_bound_mu); + ck_assert_msg( + check_msg->tropo_v_hydro_bound_sig == 100, + "incorrect value for tropo_v_hydro_bound_sig, expected 100, is %d", + check_msg->tropo_v_hydro_bound_sig); + ck_assert_msg( + check_msg->tropo_v_wet_bound_mu == 150, + "incorrect value for tropo_v_wet_bound_mu, expected 150, is %d", + check_msg->tropo_v_wet_bound_mu); + ck_assert_msg( + check_msg->tropo_v_wet_bound_sig == 100, + "incorrect value for tropo_v_wet_bound_sig, expected 100, is %d", + check_msg->tropo_v_wet_bound_sig); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -281,17 +394,24 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 1534, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 1534, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 1534, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 1534, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,254,5,66,0,27,180,0,0,0,3,0,1,0,10,0,15,1,0,10,0,39,232,3,244,1,100,200,150,100,150,100,0,155,36, }; + u8 encoded_frame[] = { + 85, 254, 5, 66, 0, 27, 180, 0, 0, 0, 3, 0, + 1, 0, 10, 0, 15, 1, 0, 10, 0, 39, 232, 3, + 244, 1, 100, 200, 150, 100, 150, 100, 0, 155, 36, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_gridded_correction_bounds_t* test_msg = ( msg_ssr_gridded_correction_bounds_t* )test_msg_storage; + msg_ssr_gridded_correction_bounds_t* test_msg = + (msg_ssr_gridded_correction_bounds_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->grid_point_id = 1000; test_msg->header.num_msgs = 1; @@ -312,82 +432,139 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds ) test_msg->tropo_v_hydro_bound_sig = 100; test_msg->tropo_v_wet_bound_mu = 150; test_msg->tropo_v_wet_bound_sig = 100; - sbp_payload_send(&sbp_state, 1534, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 1534, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 1534, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_gridded_correction_bounds_t* check_msg = ( msg_ssr_gridded_correction_bounds_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_gridded_correction_bounds_t* check_msg = + (msg_ssr_gridded_correction_bounds_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->grid_point_id == 1000, "incorrect value for grid_point_id, expected 1000, is %d", check_msg->grid_point_id); - ck_assert_msg(check_msg->header.num_msgs == 1, "incorrect value for header.num_msgs, expected 1, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.seq_num == 0, "incorrect value for header.seq_num, expected 0, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->header.sol_id == 0, "incorrect value for header.sol_id, expected 0, is %d", check_msg->header.sol_id); - ck_assert_msg(check_msg->header.time.tow == 180, "incorrect value for header.time.tow, expected 180, is %d", check_msg->header.time.tow); - ck_assert_msg(check_msg->header.time.wn == 3, "incorrect value for header.time.wn, expected 3, is %d", check_msg->header.time.wn); - ck_assert_msg(check_msg->header.update_interval == 10, "incorrect value for header.update_interval, expected 10, is %d", check_msg->header.update_interval); - ck_assert_msg(check_msg->n_sats == 0, "incorrect value for n_sats, expected 0, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->ssr_iod_atmo == 15, "incorrect value for ssr_iod_atmo, expected 15, is %d", check_msg->ssr_iod_atmo); - ck_assert_msg(check_msg->tile_id == 10, "incorrect value for tile_id, expected 10, is %d", check_msg->tile_id); - ck_assert_msg(check_msg->tile_set_id == 1, "incorrect value for tile_set_id, expected 1, is %d", check_msg->tile_set_id); - ck_assert_msg(check_msg->tropo_delay_correction.hydro == 500, "incorrect value for tropo_delay_correction.hydro, expected 500, is %d", check_msg->tropo_delay_correction.hydro); - ck_assert_msg(check_msg->tropo_delay_correction.stddev == 200, "incorrect value for tropo_delay_correction.stddev, expected 200, is %d", check_msg->tropo_delay_correction.stddev); - ck_assert_msg(check_msg->tropo_delay_correction.wet == 100, "incorrect value for tropo_delay_correction.wet, expected 100, is %d", check_msg->tropo_delay_correction.wet); - ck_assert_msg(check_msg->tropo_qi == 39, "incorrect value for tropo_qi, expected 39, is %d", check_msg->tropo_qi); - ck_assert_msg(check_msg->tropo_v_hydro_bound_mu == 150, "incorrect value for tropo_v_hydro_bound_mu, expected 150, is %d", check_msg->tropo_v_hydro_bound_mu); - ck_assert_msg(check_msg->tropo_v_hydro_bound_sig == 100, "incorrect value for tropo_v_hydro_bound_sig, expected 100, is %d", check_msg->tropo_v_hydro_bound_sig); - ck_assert_msg(check_msg->tropo_v_wet_bound_mu == 150, "incorrect value for tropo_v_wet_bound_mu, expected 150, is %d", check_msg->tropo_v_wet_bound_mu); - ck_assert_msg(check_msg->tropo_v_wet_bound_sig == 100, "incorrect value for tropo_v_wet_bound_sig, expected 100, is %d", check_msg->tropo_v_wet_bound_sig); + ck_assert_msg(check_msg->grid_point_id == 1000, + "incorrect value for grid_point_id, expected 1000, is %d", + check_msg->grid_point_id); + ck_assert_msg(check_msg->header.num_msgs == 1, + "incorrect value for header.num_msgs, expected 1, is %d", + check_msg->header.num_msgs); + ck_assert_msg(check_msg->header.seq_num == 0, + "incorrect value for header.seq_num, expected 0, is %d", + check_msg->header.seq_num); + ck_assert_msg(check_msg->header.sol_id == 0, + "incorrect value for header.sol_id, expected 0, is %d", + check_msg->header.sol_id); + ck_assert_msg(check_msg->header.time.tow == 180, + "incorrect value for header.time.tow, expected 180, is %d", + check_msg->header.time.tow); + ck_assert_msg(check_msg->header.time.wn == 3, + "incorrect value for header.time.wn, expected 3, is %d", + check_msg->header.time.wn); + ck_assert_msg( + check_msg->header.update_interval == 10, + "incorrect value for header.update_interval, expected 10, is %d", + check_msg->header.update_interval); + ck_assert_msg(check_msg->n_sats == 0, + "incorrect value for n_sats, expected 0, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->ssr_iod_atmo == 15, + "incorrect value for ssr_iod_atmo, expected 15, is %d", + check_msg->ssr_iod_atmo); + ck_assert_msg(check_msg->tile_id == 10, + "incorrect value for tile_id, expected 10, is %d", + check_msg->tile_id); + ck_assert_msg(check_msg->tile_set_id == 1, + "incorrect value for tile_set_id, expected 1, is %d", + check_msg->tile_set_id); + ck_assert_msg( + check_msg->tropo_delay_correction.hydro == 500, + "incorrect value for tropo_delay_correction.hydro, expected 500, is %d", + check_msg->tropo_delay_correction.hydro); + ck_assert_msg(check_msg->tropo_delay_correction.stddev == 200, + "incorrect value for tropo_delay_correction.stddev, expected " + "200, is %d", + check_msg->tropo_delay_correction.stddev); + ck_assert_msg( + check_msg->tropo_delay_correction.wet == 100, + "incorrect value for tropo_delay_correction.wet, expected 100, is %d", + check_msg->tropo_delay_correction.wet); + ck_assert_msg(check_msg->tropo_qi == 39, + "incorrect value for tropo_qi, expected 39, is %d", + check_msg->tropo_qi); + ck_assert_msg( + check_msg->tropo_v_hydro_bound_mu == 150, + "incorrect value for tropo_v_hydro_bound_mu, expected 150, is %d", + check_msg->tropo_v_hydro_bound_mu); + ck_assert_msg( + check_msg->tropo_v_hydro_bound_sig == 100, + "incorrect value for tropo_v_hydro_bound_sig, expected 100, is %d", + check_msg->tropo_v_hydro_bound_sig); + ck_assert_msg( + check_msg->tropo_v_wet_bound_mu == 150, + "incorrect value for tropo_v_wet_bound_mu, expected 150, is %d", + check_msg->tropo_v_wet_bound_mu); + ck_assert_msg( + check_msg->tropo_v_wet_bound_sig == 100, + "incorrect value for tropo_v_wet_bound_sig, expected 100, is %d", + check_msg->tropo_v_wet_bound_sig); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds); +Suite* legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_" + "MsgSsrGriddedCorrectionBounds"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.c index 76e1e131f..d8dcdb53a 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,40 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x5fa, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x5fa, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x5fa, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x5fa, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,250,5,108,106,254,164,217,44,53,98,93,63,147,104,252,133,245,28,95,100,147,41,33,92,87,25,142,151,74,151,95,94,7,146,237,45,167,86,42,116,224,169,234,220,23,176,18,13,178,79,160,160,110,15,53,206,151,158,22,117,184,48,170,82,40,53,122,69,180,110,38,65,104,244,19,238,227,88,169,164,146,63,37,183,85,71,235,168,114,211,105,221,156,60,18,230,2,142,172,16,39,33,126,106,99,188,234,41,162,197,138,227,80,12,54,67,238,5,93,1,207,129,13,46,115,49,58,185,127,156,200,96,217,202,15,245,55,198,81,218,132,70,73,82,147,26,255,14,134,96,138,55,214,83,156,170,163,79,173,228,115,51,241,107,245,112,168,210,10,5,117,1,57,108,248,212,145,119,226,165,5,141,202,106,0,60,36,61,243,203,216,215,12,137,16,28,247,115,152,181,119,208,228,203,236,34,167,196,32,109,1,17,101,200,25,94,125,168,137,157,4,164,29,31,48,132,72,229,126,186,68,76,133,21,0,180,139,164,148,119,149,214,120,177,201,80,80,105,10,136,118,77,46,233,233,227,11,158,103,167,216, }; + u8 encoded_frame[] = { + 85, 250, 5, 108, 106, 254, 164, 217, 44, 53, 98, 93, 63, 147, + 104, 252, 133, 245, 28, 95, 100, 147, 41, 33, 92, 87, 25, 142, + 151, 74, 151, 95, 94, 7, 146, 237, 45, 167, 86, 42, 116, 224, + 169, 234, 220, 23, 176, 18, 13, 178, 79, 160, 160, 110, 15, 53, + 206, 151, 158, 22, 117, 184, 48, 170, 82, 40, 53, 122, 69, 180, + 110, 38, 65, 104, 244, 19, 238, 227, 88, 169, 164, 146, 63, 37, + 183, 85, 71, 235, 168, 114, 211, 105, 221, 156, 60, 18, 230, 2, + 142, 172, 16, 39, 33, 126, 106, 99, 188, 234, 41, 162, 197, 138, + 227, 80, 12, 54, 67, 238, 5, 93, 1, 207, 129, 13, 46, 115, + 49, 58, 185, 127, 156, 200, 96, 217, 202, 15, 245, 55, 198, 81, + 218, 132, 70, 73, 82, 147, 26, 255, 14, 134, 96, 138, 55, 214, + 83, 156, 170, 163, 79, 173, 228, 115, 51, 241, 107, 245, 112, 168, + 210, 10, 5, 117, 1, 57, 108, 248, 212, 145, 119, 226, 165, 5, + 141, 202, 106, 0, 60, 36, 61, 243, 203, 216, 215, 12, 137, 16, + 28, 247, 115, 152, 181, 119, 208, 228, 203, 236, 34, 167, 196, 32, + 109, 1, 17, 101, 200, 25, 94, 125, 168, 137, 157, 4, 164, 29, + 31, 48, 132, 72, 229, 126, 186, 68, 76, 133, 21, 0, 180, 139, + 164, 148, 119, 149, 214, 120, 177, 201, 80, 80, 105, 10, 136, 118, + 77, 46, 233, 233, 227, 11, 158, 103, 167, 216, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_gridded_correction_dep_a_t* test_msg = ( msg_ssr_gridded_correction_dep_a_t* )test_msg_storage; + msg_ssr_gridded_correction_dep_a_t *test_msg = + (msg_ssr_gridded_correction_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.iod_atmo = 245; test_msg->header.num_msgs = 37695; @@ -530,262 +550,864 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA ) test_msg->tropo_delay_correction.hydro = 10643; test_msg->tropo_delay_correction.stddev = 92; test_msg->tropo_delay_correction.wet = 33; - sbp_payload_send(&sbp_state, 0x5fa, 27244, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x5fa, 27244, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 27244, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 27244, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x5fa, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_gridded_correction_dep_a_t* check_msg = ( msg_ssr_gridded_correction_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_gridded_correction_dep_a_t *check_msg = + (msg_ssr_gridded_correction_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.iod_atmo == 245, "incorrect value for header.iod_atmo, expected 245, is %d", check_msg->header.iod_atmo); - ck_assert_msg(check_msg->header.num_msgs == 37695, "incorrect value for header.num_msgs, expected 37695, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.seq_num == 64616, "incorrect value for header.seq_num, expected 64616, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->header.time.tow == 892131748, "incorrect value for header.time.tow, expected 892131748, is %d", check_msg->header.time.tow); - ck_assert_msg(check_msg->header.time.wn == 23906, "incorrect value for header.time.wn, expected 23906, is %d", check_msg->header.time.wn); - ck_assert_msg(check_msg->header.tropo_quality_indicator == 28, "incorrect value for header.tropo_quality_indicator, expected 28, is %d", check_msg->header.tropo_quality_indicator); - ck_assert_msg(check_msg->header.update_interval == 133, "incorrect value for header.update_interval, expected 133, is %d", check_msg->header.update_interval); - ck_assert_msg(check_msg->index == 25695, "incorrect value for index, expected 25695, is %d", check_msg->index); - ck_assert_msg(check_msg->stec_residuals[0].residual == -26738, "incorrect value for stec_residuals[0].residual, expected -26738, is %d", check_msg->stec_residuals[0].residual); - ck_assert_msg(check_msg->stec_residuals[0].stddev == 74, "incorrect value for stec_residuals[0].stddev, expected 74, is %d", check_msg->stec_residuals[0].stddev); - ck_assert_msg(check_msg->stec_residuals[0].sv_id.constellation == 25, "incorrect value for stec_residuals[0].sv_id.constellation, expected 25, is %d", check_msg->stec_residuals[0].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[0].sv_id.satId == 87, "incorrect value for stec_residuals[0].sv_id.satId, expected 87, is %d", check_msg->stec_residuals[0].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[1].residual == 1886, "incorrect value for stec_residuals[1].residual, expected 1886, is %d", check_msg->stec_residuals[1].residual); - ck_assert_msg(check_msg->stec_residuals[1].stddev == 146, "incorrect value for stec_residuals[1].stddev, expected 146, is %d", check_msg->stec_residuals[1].stddev); - ck_assert_msg(check_msg->stec_residuals[1].sv_id.constellation == 95, "incorrect value for stec_residuals[1].sv_id.constellation, expected 95, is %d", check_msg->stec_residuals[1].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[1].sv_id.satId == 151, "incorrect value for stec_residuals[1].sv_id.satId, expected 151, is %d", check_msg->stec_residuals[1].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[2].residual == 22183, "incorrect value for stec_residuals[2].residual, expected 22183, is %d", check_msg->stec_residuals[2].residual); - ck_assert_msg(check_msg->stec_residuals[2].stddev == 42, "incorrect value for stec_residuals[2].stddev, expected 42, is %d", check_msg->stec_residuals[2].stddev); - ck_assert_msg(check_msg->stec_residuals[2].sv_id.constellation == 45, "incorrect value for stec_residuals[2].sv_id.constellation, expected 45, is %d", check_msg->stec_residuals[2].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[2].sv_id.satId == 237, "incorrect value for stec_residuals[2].sv_id.satId, expected 237, is %d", check_msg->stec_residuals[2].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[3].residual == -5463, "incorrect value for stec_residuals[3].residual, expected -5463, is %d", check_msg->stec_residuals[3].residual); - ck_assert_msg(check_msg->stec_residuals[3].stddev == 220, "incorrect value for stec_residuals[3].stddev, expected 220, is %d", check_msg->stec_residuals[3].stddev); - ck_assert_msg(check_msg->stec_residuals[3].sv_id.constellation == 224, "incorrect value for stec_residuals[3].sv_id.constellation, expected 224, is %d", check_msg->stec_residuals[3].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[3].sv_id.satId == 116, "incorrect value for stec_residuals[3].sv_id.satId, expected 116, is %d", check_msg->stec_residuals[3].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[4].residual == 3346, "incorrect value for stec_residuals[4].residual, expected 3346, is %d", check_msg->stec_residuals[4].residual); - ck_assert_msg(check_msg->stec_residuals[4].stddev == 178, "incorrect value for stec_residuals[4].stddev, expected 178, is %d", check_msg->stec_residuals[4].stddev); - ck_assert_msg(check_msg->stec_residuals[4].sv_id.constellation == 176, "incorrect value for stec_residuals[4].sv_id.constellation, expected 176, is %d", check_msg->stec_residuals[4].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[4].sv_id.satId == 23, "incorrect value for stec_residuals[4].sv_id.satId, expected 23, is %d", check_msg->stec_residuals[4].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[5].residual == 28320, "incorrect value for stec_residuals[5].residual, expected 28320, is %d", check_msg->stec_residuals[5].residual); - ck_assert_msg(check_msg->stec_residuals[5].stddev == 15, "incorrect value for stec_residuals[5].stddev, expected 15, is %d", check_msg->stec_residuals[5].stddev); - ck_assert_msg(check_msg->stec_residuals[5].sv_id.constellation == 160, "incorrect value for stec_residuals[5].sv_id.constellation, expected 160, is %d", check_msg->stec_residuals[5].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[5].sv_id.satId == 79, "incorrect value for stec_residuals[5].sv_id.satId, expected 79, is %d", check_msg->stec_residuals[5].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[6].residual == -24937, "incorrect value for stec_residuals[6].residual, expected -24937, is %d", check_msg->stec_residuals[6].residual); - ck_assert_msg(check_msg->stec_residuals[6].stddev == 22, "incorrect value for stec_residuals[6].stddev, expected 22, is %d", check_msg->stec_residuals[6].stddev); - ck_assert_msg(check_msg->stec_residuals[6].sv_id.constellation == 206, "incorrect value for stec_residuals[6].sv_id.constellation, expected 206, is %d", check_msg->stec_residuals[6].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[6].sv_id.satId == 53, "incorrect value for stec_residuals[6].sv_id.satId, expected 53, is %d", check_msg->stec_residuals[6].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[7].residual == -21968, "incorrect value for stec_residuals[7].residual, expected -21968, is %d", check_msg->stec_residuals[7].residual); - ck_assert_msg(check_msg->stec_residuals[7].stddev == 82, "incorrect value for stec_residuals[7].stddev, expected 82, is %d", check_msg->stec_residuals[7].stddev); - ck_assert_msg(check_msg->stec_residuals[7].sv_id.constellation == 184, "incorrect value for stec_residuals[7].sv_id.constellation, expected 184, is %d", check_msg->stec_residuals[7].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[7].sv_id.satId == 117, "incorrect value for stec_residuals[7].sv_id.satId, expected 117, is %d", check_msg->stec_residuals[7].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[8].residual == 17786, "incorrect value for stec_residuals[8].residual, expected 17786, is %d", check_msg->stec_residuals[8].residual); - ck_assert_msg(check_msg->stec_residuals[8].stddev == 180, "incorrect value for stec_residuals[8].stddev, expected 180, is %d", check_msg->stec_residuals[8].stddev); - ck_assert_msg(check_msg->stec_residuals[8].sv_id.constellation == 53, "incorrect value for stec_residuals[8].sv_id.constellation, expected 53, is %d", check_msg->stec_residuals[8].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[8].sv_id.satId == 40, "incorrect value for stec_residuals[8].sv_id.satId, expected 40, is %d", check_msg->stec_residuals[8].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[9].residual == 26689, "incorrect value for stec_residuals[9].residual, expected 26689, is %d", check_msg->stec_residuals[9].residual); - ck_assert_msg(check_msg->stec_residuals[9].stddev == 244, "incorrect value for stec_residuals[9].stddev, expected 244, is %d", check_msg->stec_residuals[9].stddev); - ck_assert_msg(check_msg->stec_residuals[9].sv_id.constellation == 38, "incorrect value for stec_residuals[9].sv_id.constellation, expected 38, is %d", check_msg->stec_residuals[9].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[9].sv_id.satId == 110, "incorrect value for stec_residuals[9].sv_id.satId, expected 110, is %d", check_msg->stec_residuals[9].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[10].residual == 22755, "incorrect value for stec_residuals[10].residual, expected 22755, is %d", check_msg->stec_residuals[10].residual); - ck_assert_msg(check_msg->stec_residuals[10].stddev == 169, "incorrect value for stec_residuals[10].stddev, expected 169, is %d", check_msg->stec_residuals[10].stddev); - ck_assert_msg(check_msg->stec_residuals[10].sv_id.constellation == 238, "incorrect value for stec_residuals[10].sv_id.constellation, expected 238, is %d", check_msg->stec_residuals[10].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[10].sv_id.satId == 19, "incorrect value for stec_residuals[10].sv_id.satId, expected 19, is %d", check_msg->stec_residuals[10].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[11].residual == 9535, "incorrect value for stec_residuals[11].residual, expected 9535, is %d", check_msg->stec_residuals[11].residual); - ck_assert_msg(check_msg->stec_residuals[11].stddev == 183, "incorrect value for stec_residuals[11].stddev, expected 183, is %d", check_msg->stec_residuals[11].stddev); - ck_assert_msg(check_msg->stec_residuals[11].sv_id.constellation == 146, "incorrect value for stec_residuals[11].sv_id.constellation, expected 146, is %d", check_msg->stec_residuals[11].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[11].sv_id.satId == 164, "incorrect value for stec_residuals[11].sv_id.satId, expected 164, is %d", check_msg->stec_residuals[11].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[12].residual == -22293, "incorrect value for stec_residuals[12].residual, expected -22293, is %d", check_msg->stec_residuals[12].residual); - ck_assert_msg(check_msg->stec_residuals[12].stddev == 114, "incorrect value for stec_residuals[12].stddev, expected 114, is %d", check_msg->stec_residuals[12].stddev); - ck_assert_msg(check_msg->stec_residuals[12].sv_id.constellation == 71, "incorrect value for stec_residuals[12].sv_id.constellation, expected 71, is %d", check_msg->stec_residuals[12].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[12].sv_id.satId == 85, "incorrect value for stec_residuals[12].sv_id.satId, expected 85, is %d", check_msg->stec_residuals[12].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[13].residual == -25379, "incorrect value for stec_residuals[13].residual, expected -25379, is %d", check_msg->stec_residuals[13].residual); - ck_assert_msg(check_msg->stec_residuals[13].stddev == 60, "incorrect value for stec_residuals[13].stddev, expected 60, is %d", check_msg->stec_residuals[13].stddev); - ck_assert_msg(check_msg->stec_residuals[13].sv_id.constellation == 105, "incorrect value for stec_residuals[13].sv_id.constellation, expected 105, is %d", check_msg->stec_residuals[13].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[13].sv_id.satId == 211, "incorrect value for stec_residuals[13].sv_id.satId, expected 211, is %d", check_msg->stec_residuals[13].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[14].residual == -29182, "incorrect value for stec_residuals[14].residual, expected -29182, is %d", check_msg->stec_residuals[14].residual); - ck_assert_msg(check_msg->stec_residuals[14].stddev == 172, "incorrect value for stec_residuals[14].stddev, expected 172, is %d", check_msg->stec_residuals[14].stddev); - ck_assert_msg(check_msg->stec_residuals[14].sv_id.constellation == 230, "incorrect value for stec_residuals[14].sv_id.constellation, expected 230, is %d", check_msg->stec_residuals[14].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[14].sv_id.satId == 18, "incorrect value for stec_residuals[14].sv_id.satId, expected 18, is %d", check_msg->stec_residuals[14].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[15].residual == 32289, "incorrect value for stec_residuals[15].residual, expected 32289, is %d", check_msg->stec_residuals[15].residual); - ck_assert_msg(check_msg->stec_residuals[15].stddev == 106, "incorrect value for stec_residuals[15].stddev, expected 106, is %d", check_msg->stec_residuals[15].stddev); - ck_assert_msg(check_msg->stec_residuals[15].sv_id.constellation == 39, "incorrect value for stec_residuals[15].sv_id.constellation, expected 39, is %d", check_msg->stec_residuals[15].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[15].sv_id.satId == 16, "incorrect value for stec_residuals[15].sv_id.satId, expected 16, is %d", check_msg->stec_residuals[15].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[16].residual == 10730, "incorrect value for stec_residuals[16].residual, expected 10730, is %d", check_msg->stec_residuals[16].residual); - ck_assert_msg(check_msg->stec_residuals[16].stddev == 162, "incorrect value for stec_residuals[16].stddev, expected 162, is %d", check_msg->stec_residuals[16].stddev); - ck_assert_msg(check_msg->stec_residuals[16].sv_id.constellation == 188, "incorrect value for stec_residuals[16].sv_id.constellation, expected 188, is %d", check_msg->stec_residuals[16].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[16].sv_id.satId == 99, "incorrect value for stec_residuals[16].sv_id.satId, expected 99, is %d", check_msg->stec_residuals[16].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[17].residual == 20707, "incorrect value for stec_residuals[17].residual, expected 20707, is %d", check_msg->stec_residuals[17].residual); - ck_assert_msg(check_msg->stec_residuals[17].stddev == 12, "incorrect value for stec_residuals[17].stddev, expected 12, is %d", check_msg->stec_residuals[17].stddev); - ck_assert_msg(check_msg->stec_residuals[17].sv_id.constellation == 138, "incorrect value for stec_residuals[17].sv_id.constellation, expected 138, is %d", check_msg->stec_residuals[17].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[17].sv_id.satId == 197, "incorrect value for stec_residuals[17].sv_id.satId, expected 197, is %d", check_msg->stec_residuals[17].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[18].residual == 1518, "incorrect value for stec_residuals[18].residual, expected 1518, is %d", check_msg->stec_residuals[18].residual); - ck_assert_msg(check_msg->stec_residuals[18].stddev == 93, "incorrect value for stec_residuals[18].stddev, expected 93, is %d", check_msg->stec_residuals[18].stddev); - ck_assert_msg(check_msg->stec_residuals[18].sv_id.constellation == 67, "incorrect value for stec_residuals[18].sv_id.constellation, expected 67, is %d", check_msg->stec_residuals[18].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[18].sv_id.satId == 54, "incorrect value for stec_residuals[18].sv_id.satId, expected 54, is %d", check_msg->stec_residuals[18].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[19].residual == 3457, "incorrect value for stec_residuals[19].residual, expected 3457, is %d", check_msg->stec_residuals[19].residual); - ck_assert_msg(check_msg->stec_residuals[19].stddev == 46, "incorrect value for stec_residuals[19].stddev, expected 46, is %d", check_msg->stec_residuals[19].stddev); - ck_assert_msg(check_msg->stec_residuals[19].sv_id.constellation == 207, "incorrect value for stec_residuals[19].sv_id.constellation, expected 207, is %d", check_msg->stec_residuals[19].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[19].sv_id.satId == 1, "incorrect value for stec_residuals[19].sv_id.satId, expected 1, is %d", check_msg->stec_residuals[19].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[20].residual == -18118, "incorrect value for stec_residuals[20].residual, expected -18118, is %d", check_msg->stec_residuals[20].residual); - ck_assert_msg(check_msg->stec_residuals[20].stddev == 127, "incorrect value for stec_residuals[20].stddev, expected 127, is %d", check_msg->stec_residuals[20].stddev); - ck_assert_msg(check_msg->stec_residuals[20].sv_id.constellation == 49, "incorrect value for stec_residuals[20].sv_id.constellation, expected 49, is %d", check_msg->stec_residuals[20].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[20].sv_id.satId == 115, "incorrect value for stec_residuals[20].sv_id.satId, expected 115, is %d", check_msg->stec_residuals[20].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[21].residual == -9888, "incorrect value for stec_residuals[21].residual, expected -9888, is %d", check_msg->stec_residuals[21].residual); - ck_assert_msg(check_msg->stec_residuals[21].stddev == 202, "incorrect value for stec_residuals[21].stddev, expected 202, is %d", check_msg->stec_residuals[21].stddev); - ck_assert_msg(check_msg->stec_residuals[21].sv_id.constellation == 200, "incorrect value for stec_residuals[21].sv_id.constellation, expected 200, is %d", check_msg->stec_residuals[21].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[21].sv_id.satId == 156, "incorrect value for stec_residuals[21].sv_id.satId, expected 156, is %d", check_msg->stec_residuals[21].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[22].residual == -14793, "incorrect value for stec_residuals[22].residual, expected -14793, is %d", check_msg->stec_residuals[22].residual); - ck_assert_msg(check_msg->stec_residuals[22].stddev == 81, "incorrect value for stec_residuals[22].stddev, expected 81, is %d", check_msg->stec_residuals[22].stddev); - ck_assert_msg(check_msg->stec_residuals[22].sv_id.constellation == 245, "incorrect value for stec_residuals[22].sv_id.constellation, expected 245, is %d", check_msg->stec_residuals[22].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[22].sv_id.satId == 15, "incorrect value for stec_residuals[22].sv_id.satId, expected 15, is %d", check_msg->stec_residuals[22].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[23].residual == 18758, "incorrect value for stec_residuals[23].residual, expected 18758, is %d", check_msg->stec_residuals[23].residual); - ck_assert_msg(check_msg->stec_residuals[23].stddev == 82, "incorrect value for stec_residuals[23].stddev, expected 82, is %d", check_msg->stec_residuals[23].stddev); - ck_assert_msg(check_msg->stec_residuals[23].sv_id.constellation == 132, "incorrect value for stec_residuals[23].sv_id.constellation, expected 132, is %d", check_msg->stec_residuals[23].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[23].sv_id.satId == 218, "incorrect value for stec_residuals[23].sv_id.satId, expected 218, is %d", check_msg->stec_residuals[23].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[24].residual == 3839, "incorrect value for stec_residuals[24].residual, expected 3839, is %d", check_msg->stec_residuals[24].residual); - ck_assert_msg(check_msg->stec_residuals[24].stddev == 134, "incorrect value for stec_residuals[24].stddev, expected 134, is %d", check_msg->stec_residuals[24].stddev); - ck_assert_msg(check_msg->stec_residuals[24].sv_id.constellation == 26, "incorrect value for stec_residuals[24].sv_id.constellation, expected 26, is %d", check_msg->stec_residuals[24].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[24].sv_id.satId == 147, "incorrect value for stec_residuals[24].sv_id.satId, expected 147, is %d", check_msg->stec_residuals[24].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[25].residual == -10697, "incorrect value for stec_residuals[25].residual, expected -10697, is %d", check_msg->stec_residuals[25].residual); - ck_assert_msg(check_msg->stec_residuals[25].stddev == 83, "incorrect value for stec_residuals[25].stddev, expected 83, is %d", check_msg->stec_residuals[25].stddev); - ck_assert_msg(check_msg->stec_residuals[25].sv_id.constellation == 138, "incorrect value for stec_residuals[25].sv_id.constellation, expected 138, is %d", check_msg->stec_residuals[25].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[25].sv_id.satId == 96, "incorrect value for stec_residuals[25].sv_id.satId, expected 96, is %d", check_msg->stec_residuals[25].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[26].residual == 20387, "incorrect value for stec_residuals[26].residual, expected 20387, is %d", check_msg->stec_residuals[26].residual); - ck_assert_msg(check_msg->stec_residuals[26].stddev == 173, "incorrect value for stec_residuals[26].stddev, expected 173, is %d", check_msg->stec_residuals[26].stddev); - ck_assert_msg(check_msg->stec_residuals[26].sv_id.constellation == 170, "incorrect value for stec_residuals[26].sv_id.constellation, expected 170, is %d", check_msg->stec_residuals[26].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[26].sv_id.satId == 156, "incorrect value for stec_residuals[26].sv_id.satId, expected 156, is %d", check_msg->stec_residuals[26].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[27].residual == -3789, "incorrect value for stec_residuals[27].residual, expected -3789, is %d", check_msg->stec_residuals[27].residual); - ck_assert_msg(check_msg->stec_residuals[27].stddev == 107, "incorrect value for stec_residuals[27].stddev, expected 107, is %d", check_msg->stec_residuals[27].stddev); - ck_assert_msg(check_msg->stec_residuals[27].sv_id.constellation == 115, "incorrect value for stec_residuals[27].sv_id.constellation, expected 115, is %d", check_msg->stec_residuals[27].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[27].sv_id.satId == 228, "incorrect value for stec_residuals[27].sv_id.satId, expected 228, is %d", check_msg->stec_residuals[27].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[28].residual == -11608, "incorrect value for stec_residuals[28].residual, expected -11608, is %d", check_msg->stec_residuals[28].residual); - ck_assert_msg(check_msg->stec_residuals[28].stddev == 10, "incorrect value for stec_residuals[28].stddev, expected 10, is %d", check_msg->stec_residuals[28].stddev); - ck_assert_msg(check_msg->stec_residuals[28].sv_id.constellation == 112, "incorrect value for stec_residuals[28].sv_id.constellation, expected 112, is %d", check_msg->stec_residuals[28].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[28].sv_id.satId == 245, "incorrect value for stec_residuals[28].sv_id.satId, expected 245, is %d", check_msg->stec_residuals[28].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[29].residual == 14593, "incorrect value for stec_residuals[29].residual, expected 14593, is %d", check_msg->stec_residuals[29].residual); - ck_assert_msg(check_msg->stec_residuals[29].stddev == 108, "incorrect value for stec_residuals[29].stddev, expected 108, is %d", check_msg->stec_residuals[29].stddev); - ck_assert_msg(check_msg->stec_residuals[29].sv_id.constellation == 117, "incorrect value for stec_residuals[29].sv_id.constellation, expected 117, is %d", check_msg->stec_residuals[29].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[29].sv_id.satId == 5, "incorrect value for stec_residuals[29].sv_id.satId, expected 5, is %d", check_msg->stec_residuals[29].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[30].residual == 30609, "incorrect value for stec_residuals[30].residual, expected 30609, is %d", check_msg->stec_residuals[30].residual); - ck_assert_msg(check_msg->stec_residuals[30].stddev == 226, "incorrect value for stec_residuals[30].stddev, expected 226, is %d", check_msg->stec_residuals[30].stddev); - ck_assert_msg(check_msg->stec_residuals[30].sv_id.constellation == 212, "incorrect value for stec_residuals[30].sv_id.constellation, expected 212, is %d", check_msg->stec_residuals[30].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[30].sv_id.satId == 248, "incorrect value for stec_residuals[30].sv_id.satId, expected 248, is %d", check_msg->stec_residuals[30].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[31].residual == -13683, "incorrect value for stec_residuals[31].residual, expected -13683, is %d", check_msg->stec_residuals[31].residual); - ck_assert_msg(check_msg->stec_residuals[31].stddev == 106, "incorrect value for stec_residuals[31].stddev, expected 106, is %d", check_msg->stec_residuals[31].stddev); - ck_assert_msg(check_msg->stec_residuals[31].sv_id.constellation == 5, "incorrect value for stec_residuals[31].sv_id.constellation, expected 5, is %d", check_msg->stec_residuals[31].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[31].sv_id.satId == 165, "incorrect value for stec_residuals[31].sv_id.satId, expected 165, is %d", check_msg->stec_residuals[31].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[32].residual == 15652, "incorrect value for stec_residuals[32].residual, expected 15652, is %d", check_msg->stec_residuals[32].residual); - ck_assert_msg(check_msg->stec_residuals[32].stddev == 243, "incorrect value for stec_residuals[32].stddev, expected 243, is %d", check_msg->stec_residuals[32].stddev); - ck_assert_msg(check_msg->stec_residuals[32].sv_id.constellation == 60, "incorrect value for stec_residuals[32].sv_id.constellation, expected 60, is %d", check_msg->stec_residuals[32].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[32].sv_id.satId == 0, "incorrect value for stec_residuals[32].sv_id.satId, expected 0, is %d", check_msg->stec_residuals[32].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[33].residual == 3287, "incorrect value for stec_residuals[33].residual, expected 3287, is %d", check_msg->stec_residuals[33].residual); - ck_assert_msg(check_msg->stec_residuals[33].stddev == 137, "incorrect value for stec_residuals[33].stddev, expected 137, is %d", check_msg->stec_residuals[33].stddev); - ck_assert_msg(check_msg->stec_residuals[33].sv_id.constellation == 216, "incorrect value for stec_residuals[33].sv_id.constellation, expected 216, is %d", check_msg->stec_residuals[33].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[33].sv_id.satId == 203, "incorrect value for stec_residuals[33].sv_id.satId, expected 203, is %d", check_msg->stec_residuals[33].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[34].residual == 29687, "incorrect value for stec_residuals[34].residual, expected 29687, is %d", check_msg->stec_residuals[34].residual); - ck_assert_msg(check_msg->stec_residuals[34].stddev == 152, "incorrect value for stec_residuals[34].stddev, expected 152, is %d", check_msg->stec_residuals[34].stddev); - ck_assert_msg(check_msg->stec_residuals[34].sv_id.constellation == 28, "incorrect value for stec_residuals[34].sv_id.constellation, expected 28, is %d", check_msg->stec_residuals[34].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[34].sv_id.satId == 16, "incorrect value for stec_residuals[34].sv_id.satId, expected 16, is %d", check_msg->stec_residuals[34].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[35].residual == -6960, "incorrect value for stec_residuals[35].residual, expected -6960, is %d", check_msg->stec_residuals[35].residual); - ck_assert_msg(check_msg->stec_residuals[35].stddev == 203, "incorrect value for stec_residuals[35].stddev, expected 203, is %d", check_msg->stec_residuals[35].stddev); - ck_assert_msg(check_msg->stec_residuals[35].sv_id.constellation == 119, "incorrect value for stec_residuals[35].sv_id.constellation, expected 119, is %d", check_msg->stec_residuals[35].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[35].sv_id.satId == 181, "incorrect value for stec_residuals[35].sv_id.satId, expected 181, is %d", check_msg->stec_residuals[35].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[36].residual == -15193, "incorrect value for stec_residuals[36].residual, expected -15193, is %d", check_msg->stec_residuals[36].residual); - ck_assert_msg(check_msg->stec_residuals[36].stddev == 32, "incorrect value for stec_residuals[36].stddev, expected 32, is %d", check_msg->stec_residuals[36].stddev); - ck_assert_msg(check_msg->stec_residuals[36].sv_id.constellation == 34, "incorrect value for stec_residuals[36].sv_id.constellation, expected 34, is %d", check_msg->stec_residuals[36].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[36].sv_id.satId == 236, "incorrect value for stec_residuals[36].sv_id.satId, expected 236, is %d", check_msg->stec_residuals[36].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[37].residual == 25873, "incorrect value for stec_residuals[37].residual, expected 25873, is %d", check_msg->stec_residuals[37].residual); - ck_assert_msg(check_msg->stec_residuals[37].stddev == 200, "incorrect value for stec_residuals[37].stddev, expected 200, is %d", check_msg->stec_residuals[37].stddev); - ck_assert_msg(check_msg->stec_residuals[37].sv_id.constellation == 1, "incorrect value for stec_residuals[37].sv_id.constellation, expected 1, is %d", check_msg->stec_residuals[37].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[37].sv_id.satId == 109, "incorrect value for stec_residuals[37].sv_id.satId, expected 109, is %d", check_msg->stec_residuals[37].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[38].residual == -22403, "incorrect value for stec_residuals[38].residual, expected -22403, is %d", check_msg->stec_residuals[38].residual); - ck_assert_msg(check_msg->stec_residuals[38].stddev == 137, "incorrect value for stec_residuals[38].stddev, expected 137, is %d", check_msg->stec_residuals[38].stddev); - ck_assert_msg(check_msg->stec_residuals[38].sv_id.constellation == 94, "incorrect value for stec_residuals[38].sv_id.constellation, expected 94, is %d", check_msg->stec_residuals[38].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[38].sv_id.satId == 25, "incorrect value for stec_residuals[38].sv_id.satId, expected 25, is %d", check_msg->stec_residuals[38].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[39].residual == 7588, "incorrect value for stec_residuals[39].residual, expected 7588, is %d", check_msg->stec_residuals[39].residual); - ck_assert_msg(check_msg->stec_residuals[39].stddev == 31, "incorrect value for stec_residuals[39].stddev, expected 31, is %d", check_msg->stec_residuals[39].stddev); - ck_assert_msg(check_msg->stec_residuals[39].sv_id.constellation == 4, "incorrect value for stec_residuals[39].sv_id.constellation, expected 4, is %d", check_msg->stec_residuals[39].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[39].sv_id.satId == 157, "incorrect value for stec_residuals[39].sv_id.satId, expected 157, is %d", check_msg->stec_residuals[39].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[40].residual == -6840, "incorrect value for stec_residuals[40].residual, expected -6840, is %d", check_msg->stec_residuals[40].residual); - ck_assert_msg(check_msg->stec_residuals[40].stddev == 126, "incorrect value for stec_residuals[40].stddev, expected 126, is %d", check_msg->stec_residuals[40].stddev); - ck_assert_msg(check_msg->stec_residuals[40].sv_id.constellation == 132, "incorrect value for stec_residuals[40].sv_id.constellation, expected 132, is %d", check_msg->stec_residuals[40].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[40].sv_id.satId == 48, "incorrect value for stec_residuals[40].sv_id.satId, expected 48, is %d", check_msg->stec_residuals[40].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[41].residual == -31412, "incorrect value for stec_residuals[41].residual, expected -31412, is %d", check_msg->stec_residuals[41].residual); - ck_assert_msg(check_msg->stec_residuals[41].stddev == 21, "incorrect value for stec_residuals[41].stddev, expected 21, is %d", check_msg->stec_residuals[41].stddev); - ck_assert_msg(check_msg->stec_residuals[41].sv_id.constellation == 68, "incorrect value for stec_residuals[41].sv_id.constellation, expected 68, is %d", check_msg->stec_residuals[41].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[41].sv_id.satId == 186, "incorrect value for stec_residuals[41].sv_id.satId, expected 186, is %d", check_msg->stec_residuals[41].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[42].residual == -23413, "incorrect value for stec_residuals[42].residual, expected -23413, is %d", check_msg->stec_residuals[42].residual); - ck_assert_msg(check_msg->stec_residuals[42].stddev == 148, "incorrect value for stec_residuals[42].stddev, expected 148, is %d", check_msg->stec_residuals[42].stddev); - ck_assert_msg(check_msg->stec_residuals[42].sv_id.constellation == 180, "incorrect value for stec_residuals[42].sv_id.constellation, expected 180, is %d", check_msg->stec_residuals[42].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[42].sv_id.satId == 0, "incorrect value for stec_residuals[42].sv_id.satId, expected 0, is %d", check_msg->stec_residuals[42].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[43].residual == 30934, "incorrect value for stec_residuals[43].residual, expected 30934, is %d", check_msg->stec_residuals[43].residual); - ck_assert_msg(check_msg->stec_residuals[43].stddev == 177, "incorrect value for stec_residuals[43].stddev, expected 177, is %d", check_msg->stec_residuals[43].stddev); - ck_assert_msg(check_msg->stec_residuals[43].sv_id.constellation == 149, "incorrect value for stec_residuals[43].sv_id.constellation, expected 149, is %d", check_msg->stec_residuals[43].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[43].sv_id.satId == 119, "incorrect value for stec_residuals[43].sv_id.satId, expected 119, is %d", check_msg->stec_residuals[43].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[44].residual == 26960, "incorrect value for stec_residuals[44].residual, expected 26960, is %d", check_msg->stec_residuals[44].residual); - ck_assert_msg(check_msg->stec_residuals[44].stddev == 10, "incorrect value for stec_residuals[44].stddev, expected 10, is %d", check_msg->stec_residuals[44].stddev); - ck_assert_msg(check_msg->stec_residuals[44].sv_id.constellation == 80, "incorrect value for stec_residuals[44].sv_id.constellation, expected 80, is %d", check_msg->stec_residuals[44].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[44].sv_id.satId == 201, "incorrect value for stec_residuals[44].sv_id.satId, expected 201, is %d", check_msg->stec_residuals[44].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[45].residual == 11853, "incorrect value for stec_residuals[45].residual, expected 11853, is %d", check_msg->stec_residuals[45].residual); - ck_assert_msg(check_msg->stec_residuals[45].stddev == 233, "incorrect value for stec_residuals[45].stddev, expected 233, is %d", check_msg->stec_residuals[45].stddev); - ck_assert_msg(check_msg->stec_residuals[45].sv_id.constellation == 118, "incorrect value for stec_residuals[45].sv_id.constellation, expected 118, is %d", check_msg->stec_residuals[45].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[45].sv_id.satId == 136, "incorrect value for stec_residuals[45].sv_id.satId, expected 136, is %d", check_msg->stec_residuals[45].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[46].residual == -25077, "incorrect value for stec_residuals[46].residual, expected -25077, is %d", check_msg->stec_residuals[46].residual); - ck_assert_msg(check_msg->stec_residuals[46].stddev == 103, "incorrect value for stec_residuals[46].stddev, expected 103, is %d", check_msg->stec_residuals[46].stddev); - ck_assert_msg(check_msg->stec_residuals[46].sv_id.constellation == 227, "incorrect value for stec_residuals[46].sv_id.constellation, expected 227, is %d", check_msg->stec_residuals[46].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[46].sv_id.satId == 233, "incorrect value for stec_residuals[46].sv_id.satId, expected 233, is %d", check_msg->stec_residuals[46].sv_id.satId); - ck_assert_msg(check_msg->tropo_delay_correction.hydro == 10643, "incorrect value for tropo_delay_correction.hydro, expected 10643, is %d", check_msg->tropo_delay_correction.hydro); - ck_assert_msg(check_msg->tropo_delay_correction.stddev == 92, "incorrect value for tropo_delay_correction.stddev, expected 92, is %d", check_msg->tropo_delay_correction.stddev); - ck_assert_msg(check_msg->tropo_delay_correction.wet == 33, "incorrect value for tropo_delay_correction.wet, expected 33, is %d", check_msg->tropo_delay_correction.wet); + ck_assert_msg(check_msg->header.iod_atmo == 245, + "incorrect value for header.iod_atmo, expected 245, is %d", + check_msg->header.iod_atmo); + ck_assert_msg(check_msg->header.num_msgs == 37695, + "incorrect value for header.num_msgs, expected 37695, is %d", + check_msg->header.num_msgs); + ck_assert_msg(check_msg->header.seq_num == 64616, + "incorrect value for header.seq_num, expected 64616, is %d", + check_msg->header.seq_num); + ck_assert_msg( + check_msg->header.time.tow == 892131748, + "incorrect value for header.time.tow, expected 892131748, is %d", + check_msg->header.time.tow); + ck_assert_msg(check_msg->header.time.wn == 23906, + "incorrect value for header.time.wn, expected 23906, is %d", + check_msg->header.time.wn); + ck_assert_msg(check_msg->header.tropo_quality_indicator == 28, + "incorrect value for header.tropo_quality_indicator, " + "expected 28, is %d", + check_msg->header.tropo_quality_indicator); + ck_assert_msg( + check_msg->header.update_interval == 133, + "incorrect value for header.update_interval, expected 133, is %d", + check_msg->header.update_interval); + ck_assert_msg(check_msg->index == 25695, + "incorrect value for index, expected 25695, is %d", + check_msg->index); + ck_assert_msg(check_msg->stec_residuals[0].residual == -26738, + "incorrect value for stec_residuals[0].residual, expected " + "-26738, is %d", + check_msg->stec_residuals[0].residual); + ck_assert_msg( + check_msg->stec_residuals[0].stddev == 74, + "incorrect value for stec_residuals[0].stddev, expected 74, is %d", + check_msg->stec_residuals[0].stddev); + ck_assert_msg(check_msg->stec_residuals[0].sv_id.constellation == 25, + "incorrect value for stec_residuals[0].sv_id.constellation, " + "expected 25, is %d", + check_msg->stec_residuals[0].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[0].sv_id.satId == 87, + "incorrect value for stec_residuals[0].sv_id.satId, expected 87, is %d", + check_msg->stec_residuals[0].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[1].residual == 1886, + "incorrect value for stec_residuals[1].residual, expected 1886, is %d", + check_msg->stec_residuals[1].residual); + ck_assert_msg( + check_msg->stec_residuals[1].stddev == 146, + "incorrect value for stec_residuals[1].stddev, expected 146, is %d", + check_msg->stec_residuals[1].stddev); + ck_assert_msg(check_msg->stec_residuals[1].sv_id.constellation == 95, + "incorrect value for stec_residuals[1].sv_id.constellation, " + "expected 95, is %d", + check_msg->stec_residuals[1].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[1].sv_id.satId == 151, + "incorrect value for stec_residuals[1].sv_id.satId, expected " + "151, is %d", + check_msg->stec_residuals[1].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[2].residual == 22183, + "incorrect value for stec_residuals[2].residual, expected 22183, is %d", + check_msg->stec_residuals[2].residual); + ck_assert_msg( + check_msg->stec_residuals[2].stddev == 42, + "incorrect value for stec_residuals[2].stddev, expected 42, is %d", + check_msg->stec_residuals[2].stddev); + ck_assert_msg(check_msg->stec_residuals[2].sv_id.constellation == 45, + "incorrect value for stec_residuals[2].sv_id.constellation, " + "expected 45, is %d", + check_msg->stec_residuals[2].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[2].sv_id.satId == 237, + "incorrect value for stec_residuals[2].sv_id.satId, expected " + "237, is %d", + check_msg->stec_residuals[2].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[3].residual == -5463, + "incorrect value for stec_residuals[3].residual, expected -5463, is %d", + check_msg->stec_residuals[3].residual); + ck_assert_msg( + check_msg->stec_residuals[3].stddev == 220, + "incorrect value for stec_residuals[3].stddev, expected 220, is %d", + check_msg->stec_residuals[3].stddev); + ck_assert_msg(check_msg->stec_residuals[3].sv_id.constellation == 224, + "incorrect value for stec_residuals[3].sv_id.constellation, " + "expected 224, is %d", + check_msg->stec_residuals[3].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[3].sv_id.satId == 116, + "incorrect value for stec_residuals[3].sv_id.satId, expected " + "116, is %d", + check_msg->stec_residuals[3].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[4].residual == 3346, + "incorrect value for stec_residuals[4].residual, expected 3346, is %d", + check_msg->stec_residuals[4].residual); + ck_assert_msg( + check_msg->stec_residuals[4].stddev == 178, + "incorrect value for stec_residuals[4].stddev, expected 178, is %d", + check_msg->stec_residuals[4].stddev); + ck_assert_msg(check_msg->stec_residuals[4].sv_id.constellation == 176, + "incorrect value for stec_residuals[4].sv_id.constellation, " + "expected 176, is %d", + check_msg->stec_residuals[4].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[4].sv_id.satId == 23, + "incorrect value for stec_residuals[4].sv_id.satId, expected 23, is %d", + check_msg->stec_residuals[4].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[5].residual == 28320, + "incorrect value for stec_residuals[5].residual, expected 28320, is %d", + check_msg->stec_residuals[5].residual); + ck_assert_msg( + check_msg->stec_residuals[5].stddev == 15, + "incorrect value for stec_residuals[5].stddev, expected 15, is %d", + check_msg->stec_residuals[5].stddev); + ck_assert_msg(check_msg->stec_residuals[5].sv_id.constellation == 160, + "incorrect value for stec_residuals[5].sv_id.constellation, " + "expected 160, is %d", + check_msg->stec_residuals[5].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[5].sv_id.satId == 79, + "incorrect value for stec_residuals[5].sv_id.satId, expected 79, is %d", + check_msg->stec_residuals[5].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[6].residual == -24937, + "incorrect value for stec_residuals[6].residual, expected " + "-24937, is %d", + check_msg->stec_residuals[6].residual); + ck_assert_msg( + check_msg->stec_residuals[6].stddev == 22, + "incorrect value for stec_residuals[6].stddev, expected 22, is %d", + check_msg->stec_residuals[6].stddev); + ck_assert_msg(check_msg->stec_residuals[6].sv_id.constellation == 206, + "incorrect value for stec_residuals[6].sv_id.constellation, " + "expected 206, is %d", + check_msg->stec_residuals[6].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[6].sv_id.satId == 53, + "incorrect value for stec_residuals[6].sv_id.satId, expected 53, is %d", + check_msg->stec_residuals[6].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[7].residual == -21968, + "incorrect value for stec_residuals[7].residual, expected " + "-21968, is %d", + check_msg->stec_residuals[7].residual); + ck_assert_msg( + check_msg->stec_residuals[7].stddev == 82, + "incorrect value for stec_residuals[7].stddev, expected 82, is %d", + check_msg->stec_residuals[7].stddev); + ck_assert_msg(check_msg->stec_residuals[7].sv_id.constellation == 184, + "incorrect value for stec_residuals[7].sv_id.constellation, " + "expected 184, is %d", + check_msg->stec_residuals[7].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[7].sv_id.satId == 117, + "incorrect value for stec_residuals[7].sv_id.satId, expected " + "117, is %d", + check_msg->stec_residuals[7].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[8].residual == 17786, + "incorrect value for stec_residuals[8].residual, expected 17786, is %d", + check_msg->stec_residuals[8].residual); + ck_assert_msg( + check_msg->stec_residuals[8].stddev == 180, + "incorrect value for stec_residuals[8].stddev, expected 180, is %d", + check_msg->stec_residuals[8].stddev); + ck_assert_msg(check_msg->stec_residuals[8].sv_id.constellation == 53, + "incorrect value for stec_residuals[8].sv_id.constellation, " + "expected 53, is %d", + check_msg->stec_residuals[8].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[8].sv_id.satId == 40, + "incorrect value for stec_residuals[8].sv_id.satId, expected 40, is %d", + check_msg->stec_residuals[8].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[9].residual == 26689, + "incorrect value for stec_residuals[9].residual, expected 26689, is %d", + check_msg->stec_residuals[9].residual); + ck_assert_msg( + check_msg->stec_residuals[9].stddev == 244, + "incorrect value for stec_residuals[9].stddev, expected 244, is %d", + check_msg->stec_residuals[9].stddev); + ck_assert_msg(check_msg->stec_residuals[9].sv_id.constellation == 38, + "incorrect value for stec_residuals[9].sv_id.constellation, " + "expected 38, is %d", + check_msg->stec_residuals[9].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[9].sv_id.satId == 110, + "incorrect value for stec_residuals[9].sv_id.satId, expected " + "110, is %d", + check_msg->stec_residuals[9].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[10].residual == 22755, + "incorrect value for stec_residuals[10].residual, expected " + "22755, is %d", + check_msg->stec_residuals[10].residual); + ck_assert_msg( + check_msg->stec_residuals[10].stddev == 169, + "incorrect value for stec_residuals[10].stddev, expected 169, is %d", + check_msg->stec_residuals[10].stddev); + ck_assert_msg(check_msg->stec_residuals[10].sv_id.constellation == 238, + "incorrect value for stec_residuals[10].sv_id.constellation, " + "expected 238, is %d", + check_msg->stec_residuals[10].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[10].sv_id.satId == 19, + "incorrect value for stec_residuals[10].sv_id.satId, " + "expected 19, is %d", + check_msg->stec_residuals[10].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[11].residual == 9535, + "incorrect value for stec_residuals[11].residual, expected 9535, is %d", + check_msg->stec_residuals[11].residual); + ck_assert_msg( + check_msg->stec_residuals[11].stddev == 183, + "incorrect value for stec_residuals[11].stddev, expected 183, is %d", + check_msg->stec_residuals[11].stddev); + ck_assert_msg(check_msg->stec_residuals[11].sv_id.constellation == 146, + "incorrect value for stec_residuals[11].sv_id.constellation, " + "expected 146, is %d", + check_msg->stec_residuals[11].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[11].sv_id.satId == 164, + "incorrect value for stec_residuals[11].sv_id.satId, " + "expected 164, is %d", + check_msg->stec_residuals[11].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[12].residual == -22293, + "incorrect value for stec_residuals[12].residual, expected " + "-22293, is %d", + check_msg->stec_residuals[12].residual); + ck_assert_msg( + check_msg->stec_residuals[12].stddev == 114, + "incorrect value for stec_residuals[12].stddev, expected 114, is %d", + check_msg->stec_residuals[12].stddev); + ck_assert_msg(check_msg->stec_residuals[12].sv_id.constellation == 71, + "incorrect value for stec_residuals[12].sv_id.constellation, " + "expected 71, is %d", + check_msg->stec_residuals[12].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[12].sv_id.satId == 85, + "incorrect value for stec_residuals[12].sv_id.satId, " + "expected 85, is %d", + check_msg->stec_residuals[12].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[13].residual == -25379, + "incorrect value for stec_residuals[13].residual, expected " + "-25379, is %d", + check_msg->stec_residuals[13].residual); + ck_assert_msg( + check_msg->stec_residuals[13].stddev == 60, + "incorrect value for stec_residuals[13].stddev, expected 60, is %d", + check_msg->stec_residuals[13].stddev); + ck_assert_msg(check_msg->stec_residuals[13].sv_id.constellation == 105, + "incorrect value for stec_residuals[13].sv_id.constellation, " + "expected 105, is %d", + check_msg->stec_residuals[13].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[13].sv_id.satId == 211, + "incorrect value for stec_residuals[13].sv_id.satId, " + "expected 211, is %d", + check_msg->stec_residuals[13].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[14].residual == -29182, + "incorrect value for stec_residuals[14].residual, expected " + "-29182, is %d", + check_msg->stec_residuals[14].residual); + ck_assert_msg( + check_msg->stec_residuals[14].stddev == 172, + "incorrect value for stec_residuals[14].stddev, expected 172, is %d", + check_msg->stec_residuals[14].stddev); + ck_assert_msg(check_msg->stec_residuals[14].sv_id.constellation == 230, + "incorrect value for stec_residuals[14].sv_id.constellation, " + "expected 230, is %d", + check_msg->stec_residuals[14].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[14].sv_id.satId == 18, + "incorrect value for stec_residuals[14].sv_id.satId, " + "expected 18, is %d", + check_msg->stec_residuals[14].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[15].residual == 32289, + "incorrect value for stec_residuals[15].residual, expected " + "32289, is %d", + check_msg->stec_residuals[15].residual); + ck_assert_msg( + check_msg->stec_residuals[15].stddev == 106, + "incorrect value for stec_residuals[15].stddev, expected 106, is %d", + check_msg->stec_residuals[15].stddev); + ck_assert_msg(check_msg->stec_residuals[15].sv_id.constellation == 39, + "incorrect value for stec_residuals[15].sv_id.constellation, " + "expected 39, is %d", + check_msg->stec_residuals[15].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[15].sv_id.satId == 16, + "incorrect value for stec_residuals[15].sv_id.satId, " + "expected 16, is %d", + check_msg->stec_residuals[15].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[16].residual == 10730, + "incorrect value for stec_residuals[16].residual, expected " + "10730, is %d", + check_msg->stec_residuals[16].residual); + ck_assert_msg( + check_msg->stec_residuals[16].stddev == 162, + "incorrect value for stec_residuals[16].stddev, expected 162, is %d", + check_msg->stec_residuals[16].stddev); + ck_assert_msg(check_msg->stec_residuals[16].sv_id.constellation == 188, + "incorrect value for stec_residuals[16].sv_id.constellation, " + "expected 188, is %d", + check_msg->stec_residuals[16].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[16].sv_id.satId == 99, + "incorrect value for stec_residuals[16].sv_id.satId, " + "expected 99, is %d", + check_msg->stec_residuals[16].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[17].residual == 20707, + "incorrect value for stec_residuals[17].residual, expected " + "20707, is %d", + check_msg->stec_residuals[17].residual); + ck_assert_msg( + check_msg->stec_residuals[17].stddev == 12, + "incorrect value for stec_residuals[17].stddev, expected 12, is %d", + check_msg->stec_residuals[17].stddev); + ck_assert_msg(check_msg->stec_residuals[17].sv_id.constellation == 138, + "incorrect value for stec_residuals[17].sv_id.constellation, " + "expected 138, is %d", + check_msg->stec_residuals[17].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[17].sv_id.satId == 197, + "incorrect value for stec_residuals[17].sv_id.satId, " + "expected 197, is %d", + check_msg->stec_residuals[17].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[18].residual == 1518, + "incorrect value for stec_residuals[18].residual, expected 1518, is %d", + check_msg->stec_residuals[18].residual); + ck_assert_msg( + check_msg->stec_residuals[18].stddev == 93, + "incorrect value for stec_residuals[18].stddev, expected 93, is %d", + check_msg->stec_residuals[18].stddev); + ck_assert_msg(check_msg->stec_residuals[18].sv_id.constellation == 67, + "incorrect value for stec_residuals[18].sv_id.constellation, " + "expected 67, is %d", + check_msg->stec_residuals[18].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[18].sv_id.satId == 54, + "incorrect value for stec_residuals[18].sv_id.satId, " + "expected 54, is %d", + check_msg->stec_residuals[18].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[19].residual == 3457, + "incorrect value for stec_residuals[19].residual, expected 3457, is %d", + check_msg->stec_residuals[19].residual); + ck_assert_msg( + check_msg->stec_residuals[19].stddev == 46, + "incorrect value for stec_residuals[19].stddev, expected 46, is %d", + check_msg->stec_residuals[19].stddev); + ck_assert_msg(check_msg->stec_residuals[19].sv_id.constellation == 207, + "incorrect value for stec_residuals[19].sv_id.constellation, " + "expected 207, is %d", + check_msg->stec_residuals[19].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[19].sv_id.satId == 1, + "incorrect value for stec_residuals[19].sv_id.satId, expected 1, is %d", + check_msg->stec_residuals[19].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[20].residual == -18118, + "incorrect value for stec_residuals[20].residual, expected " + "-18118, is %d", + check_msg->stec_residuals[20].residual); + ck_assert_msg( + check_msg->stec_residuals[20].stddev == 127, + "incorrect value for stec_residuals[20].stddev, expected 127, is %d", + check_msg->stec_residuals[20].stddev); + ck_assert_msg(check_msg->stec_residuals[20].sv_id.constellation == 49, + "incorrect value for stec_residuals[20].sv_id.constellation, " + "expected 49, is %d", + check_msg->stec_residuals[20].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[20].sv_id.satId == 115, + "incorrect value for stec_residuals[20].sv_id.satId, " + "expected 115, is %d", + check_msg->stec_residuals[20].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[21].residual == -9888, + "incorrect value for stec_residuals[21].residual, expected " + "-9888, is %d", + check_msg->stec_residuals[21].residual); + ck_assert_msg( + check_msg->stec_residuals[21].stddev == 202, + "incorrect value for stec_residuals[21].stddev, expected 202, is %d", + check_msg->stec_residuals[21].stddev); + ck_assert_msg(check_msg->stec_residuals[21].sv_id.constellation == 200, + "incorrect value for stec_residuals[21].sv_id.constellation, " + "expected 200, is %d", + check_msg->stec_residuals[21].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[21].sv_id.satId == 156, + "incorrect value for stec_residuals[21].sv_id.satId, " + "expected 156, is %d", + check_msg->stec_residuals[21].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[22].residual == -14793, + "incorrect value for stec_residuals[22].residual, expected " + "-14793, is %d", + check_msg->stec_residuals[22].residual); + ck_assert_msg( + check_msg->stec_residuals[22].stddev == 81, + "incorrect value for stec_residuals[22].stddev, expected 81, is %d", + check_msg->stec_residuals[22].stddev); + ck_assert_msg(check_msg->stec_residuals[22].sv_id.constellation == 245, + "incorrect value for stec_residuals[22].sv_id.constellation, " + "expected 245, is %d", + check_msg->stec_residuals[22].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[22].sv_id.satId == 15, + "incorrect value for stec_residuals[22].sv_id.satId, " + "expected 15, is %d", + check_msg->stec_residuals[22].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[23].residual == 18758, + "incorrect value for stec_residuals[23].residual, expected " + "18758, is %d", + check_msg->stec_residuals[23].residual); + ck_assert_msg( + check_msg->stec_residuals[23].stddev == 82, + "incorrect value for stec_residuals[23].stddev, expected 82, is %d", + check_msg->stec_residuals[23].stddev); + ck_assert_msg(check_msg->stec_residuals[23].sv_id.constellation == 132, + "incorrect value for stec_residuals[23].sv_id.constellation, " + "expected 132, is %d", + check_msg->stec_residuals[23].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[23].sv_id.satId == 218, + "incorrect value for stec_residuals[23].sv_id.satId, " + "expected 218, is %d", + check_msg->stec_residuals[23].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[24].residual == 3839, + "incorrect value for stec_residuals[24].residual, expected 3839, is %d", + check_msg->stec_residuals[24].residual); + ck_assert_msg( + check_msg->stec_residuals[24].stddev == 134, + "incorrect value for stec_residuals[24].stddev, expected 134, is %d", + check_msg->stec_residuals[24].stddev); + ck_assert_msg(check_msg->stec_residuals[24].sv_id.constellation == 26, + "incorrect value for stec_residuals[24].sv_id.constellation, " + "expected 26, is %d", + check_msg->stec_residuals[24].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[24].sv_id.satId == 147, + "incorrect value for stec_residuals[24].sv_id.satId, " + "expected 147, is %d", + check_msg->stec_residuals[24].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[25].residual == -10697, + "incorrect value for stec_residuals[25].residual, expected " + "-10697, is %d", + check_msg->stec_residuals[25].residual); + ck_assert_msg( + check_msg->stec_residuals[25].stddev == 83, + "incorrect value for stec_residuals[25].stddev, expected 83, is %d", + check_msg->stec_residuals[25].stddev); + ck_assert_msg(check_msg->stec_residuals[25].sv_id.constellation == 138, + "incorrect value for stec_residuals[25].sv_id.constellation, " + "expected 138, is %d", + check_msg->stec_residuals[25].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[25].sv_id.satId == 96, + "incorrect value for stec_residuals[25].sv_id.satId, " + "expected 96, is %d", + check_msg->stec_residuals[25].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[26].residual == 20387, + "incorrect value for stec_residuals[26].residual, expected " + "20387, is %d", + check_msg->stec_residuals[26].residual); + ck_assert_msg( + check_msg->stec_residuals[26].stddev == 173, + "incorrect value for stec_residuals[26].stddev, expected 173, is %d", + check_msg->stec_residuals[26].stddev); + ck_assert_msg(check_msg->stec_residuals[26].sv_id.constellation == 170, + "incorrect value for stec_residuals[26].sv_id.constellation, " + "expected 170, is %d", + check_msg->stec_residuals[26].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[26].sv_id.satId == 156, + "incorrect value for stec_residuals[26].sv_id.satId, " + "expected 156, is %d", + check_msg->stec_residuals[26].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[27].residual == -3789, + "incorrect value for stec_residuals[27].residual, expected " + "-3789, is %d", + check_msg->stec_residuals[27].residual); + ck_assert_msg( + check_msg->stec_residuals[27].stddev == 107, + "incorrect value for stec_residuals[27].stddev, expected 107, is %d", + check_msg->stec_residuals[27].stddev); + ck_assert_msg(check_msg->stec_residuals[27].sv_id.constellation == 115, + "incorrect value for stec_residuals[27].sv_id.constellation, " + "expected 115, is %d", + check_msg->stec_residuals[27].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[27].sv_id.satId == 228, + "incorrect value for stec_residuals[27].sv_id.satId, " + "expected 228, is %d", + check_msg->stec_residuals[27].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[28].residual == -11608, + "incorrect value for stec_residuals[28].residual, expected " + "-11608, is %d", + check_msg->stec_residuals[28].residual); + ck_assert_msg( + check_msg->stec_residuals[28].stddev == 10, + "incorrect value for stec_residuals[28].stddev, expected 10, is %d", + check_msg->stec_residuals[28].stddev); + ck_assert_msg(check_msg->stec_residuals[28].sv_id.constellation == 112, + "incorrect value for stec_residuals[28].sv_id.constellation, " + "expected 112, is %d", + check_msg->stec_residuals[28].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[28].sv_id.satId == 245, + "incorrect value for stec_residuals[28].sv_id.satId, " + "expected 245, is %d", + check_msg->stec_residuals[28].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[29].residual == 14593, + "incorrect value for stec_residuals[29].residual, expected " + "14593, is %d", + check_msg->stec_residuals[29].residual); + ck_assert_msg( + check_msg->stec_residuals[29].stddev == 108, + "incorrect value for stec_residuals[29].stddev, expected 108, is %d", + check_msg->stec_residuals[29].stddev); + ck_assert_msg(check_msg->stec_residuals[29].sv_id.constellation == 117, + "incorrect value for stec_residuals[29].sv_id.constellation, " + "expected 117, is %d", + check_msg->stec_residuals[29].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[29].sv_id.satId == 5, + "incorrect value for stec_residuals[29].sv_id.satId, expected 5, is %d", + check_msg->stec_residuals[29].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[30].residual == 30609, + "incorrect value for stec_residuals[30].residual, expected " + "30609, is %d", + check_msg->stec_residuals[30].residual); + ck_assert_msg( + check_msg->stec_residuals[30].stddev == 226, + "incorrect value for stec_residuals[30].stddev, expected 226, is %d", + check_msg->stec_residuals[30].stddev); + ck_assert_msg(check_msg->stec_residuals[30].sv_id.constellation == 212, + "incorrect value for stec_residuals[30].sv_id.constellation, " + "expected 212, is %d", + check_msg->stec_residuals[30].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[30].sv_id.satId == 248, + "incorrect value for stec_residuals[30].sv_id.satId, " + "expected 248, is %d", + check_msg->stec_residuals[30].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[31].residual == -13683, + "incorrect value for stec_residuals[31].residual, expected " + "-13683, is %d", + check_msg->stec_residuals[31].residual); + ck_assert_msg( + check_msg->stec_residuals[31].stddev == 106, + "incorrect value for stec_residuals[31].stddev, expected 106, is %d", + check_msg->stec_residuals[31].stddev); + ck_assert_msg(check_msg->stec_residuals[31].sv_id.constellation == 5, + "incorrect value for stec_residuals[31].sv_id.constellation, " + "expected 5, is %d", + check_msg->stec_residuals[31].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[31].sv_id.satId == 165, + "incorrect value for stec_residuals[31].sv_id.satId, " + "expected 165, is %d", + check_msg->stec_residuals[31].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[32].residual == 15652, + "incorrect value for stec_residuals[32].residual, expected " + "15652, is %d", + check_msg->stec_residuals[32].residual); + ck_assert_msg( + check_msg->stec_residuals[32].stddev == 243, + "incorrect value for stec_residuals[32].stddev, expected 243, is %d", + check_msg->stec_residuals[32].stddev); + ck_assert_msg(check_msg->stec_residuals[32].sv_id.constellation == 60, + "incorrect value for stec_residuals[32].sv_id.constellation, " + "expected 60, is %d", + check_msg->stec_residuals[32].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[32].sv_id.satId == 0, + "incorrect value for stec_residuals[32].sv_id.satId, expected 0, is %d", + check_msg->stec_residuals[32].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[33].residual == 3287, + "incorrect value for stec_residuals[33].residual, expected 3287, is %d", + check_msg->stec_residuals[33].residual); + ck_assert_msg( + check_msg->stec_residuals[33].stddev == 137, + "incorrect value for stec_residuals[33].stddev, expected 137, is %d", + check_msg->stec_residuals[33].stddev); + ck_assert_msg(check_msg->stec_residuals[33].sv_id.constellation == 216, + "incorrect value for stec_residuals[33].sv_id.constellation, " + "expected 216, is %d", + check_msg->stec_residuals[33].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[33].sv_id.satId == 203, + "incorrect value for stec_residuals[33].sv_id.satId, " + "expected 203, is %d", + check_msg->stec_residuals[33].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[34].residual == 29687, + "incorrect value for stec_residuals[34].residual, expected " + "29687, is %d", + check_msg->stec_residuals[34].residual); + ck_assert_msg( + check_msg->stec_residuals[34].stddev == 152, + "incorrect value for stec_residuals[34].stddev, expected 152, is %d", + check_msg->stec_residuals[34].stddev); + ck_assert_msg(check_msg->stec_residuals[34].sv_id.constellation == 28, + "incorrect value for stec_residuals[34].sv_id.constellation, " + "expected 28, is %d", + check_msg->stec_residuals[34].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[34].sv_id.satId == 16, + "incorrect value for stec_residuals[34].sv_id.satId, " + "expected 16, is %d", + check_msg->stec_residuals[34].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[35].residual == -6960, + "incorrect value for stec_residuals[35].residual, expected " + "-6960, is %d", + check_msg->stec_residuals[35].residual); + ck_assert_msg( + check_msg->stec_residuals[35].stddev == 203, + "incorrect value for stec_residuals[35].stddev, expected 203, is %d", + check_msg->stec_residuals[35].stddev); + ck_assert_msg(check_msg->stec_residuals[35].sv_id.constellation == 119, + "incorrect value for stec_residuals[35].sv_id.constellation, " + "expected 119, is %d", + check_msg->stec_residuals[35].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[35].sv_id.satId == 181, + "incorrect value for stec_residuals[35].sv_id.satId, " + "expected 181, is %d", + check_msg->stec_residuals[35].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[36].residual == -15193, + "incorrect value for stec_residuals[36].residual, expected " + "-15193, is %d", + check_msg->stec_residuals[36].residual); + ck_assert_msg( + check_msg->stec_residuals[36].stddev == 32, + "incorrect value for stec_residuals[36].stddev, expected 32, is %d", + check_msg->stec_residuals[36].stddev); + ck_assert_msg(check_msg->stec_residuals[36].sv_id.constellation == 34, + "incorrect value for stec_residuals[36].sv_id.constellation, " + "expected 34, is %d", + check_msg->stec_residuals[36].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[36].sv_id.satId == 236, + "incorrect value for stec_residuals[36].sv_id.satId, " + "expected 236, is %d", + check_msg->stec_residuals[36].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[37].residual == 25873, + "incorrect value for stec_residuals[37].residual, expected " + "25873, is %d", + check_msg->stec_residuals[37].residual); + ck_assert_msg( + check_msg->stec_residuals[37].stddev == 200, + "incorrect value for stec_residuals[37].stddev, expected 200, is %d", + check_msg->stec_residuals[37].stddev); + ck_assert_msg(check_msg->stec_residuals[37].sv_id.constellation == 1, + "incorrect value for stec_residuals[37].sv_id.constellation, " + "expected 1, is %d", + check_msg->stec_residuals[37].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[37].sv_id.satId == 109, + "incorrect value for stec_residuals[37].sv_id.satId, " + "expected 109, is %d", + check_msg->stec_residuals[37].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[38].residual == -22403, + "incorrect value for stec_residuals[38].residual, expected " + "-22403, is %d", + check_msg->stec_residuals[38].residual); + ck_assert_msg( + check_msg->stec_residuals[38].stddev == 137, + "incorrect value for stec_residuals[38].stddev, expected 137, is %d", + check_msg->stec_residuals[38].stddev); + ck_assert_msg(check_msg->stec_residuals[38].sv_id.constellation == 94, + "incorrect value for stec_residuals[38].sv_id.constellation, " + "expected 94, is %d", + check_msg->stec_residuals[38].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[38].sv_id.satId == 25, + "incorrect value for stec_residuals[38].sv_id.satId, " + "expected 25, is %d", + check_msg->stec_residuals[38].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[39].residual == 7588, + "incorrect value for stec_residuals[39].residual, expected 7588, is %d", + check_msg->stec_residuals[39].residual); + ck_assert_msg( + check_msg->stec_residuals[39].stddev == 31, + "incorrect value for stec_residuals[39].stddev, expected 31, is %d", + check_msg->stec_residuals[39].stddev); + ck_assert_msg(check_msg->stec_residuals[39].sv_id.constellation == 4, + "incorrect value for stec_residuals[39].sv_id.constellation, " + "expected 4, is %d", + check_msg->stec_residuals[39].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[39].sv_id.satId == 157, + "incorrect value for stec_residuals[39].sv_id.satId, " + "expected 157, is %d", + check_msg->stec_residuals[39].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[40].residual == -6840, + "incorrect value for stec_residuals[40].residual, expected " + "-6840, is %d", + check_msg->stec_residuals[40].residual); + ck_assert_msg( + check_msg->stec_residuals[40].stddev == 126, + "incorrect value for stec_residuals[40].stddev, expected 126, is %d", + check_msg->stec_residuals[40].stddev); + ck_assert_msg(check_msg->stec_residuals[40].sv_id.constellation == 132, + "incorrect value for stec_residuals[40].sv_id.constellation, " + "expected 132, is %d", + check_msg->stec_residuals[40].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[40].sv_id.satId == 48, + "incorrect value for stec_residuals[40].sv_id.satId, " + "expected 48, is %d", + check_msg->stec_residuals[40].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[41].residual == -31412, + "incorrect value for stec_residuals[41].residual, expected " + "-31412, is %d", + check_msg->stec_residuals[41].residual); + ck_assert_msg( + check_msg->stec_residuals[41].stddev == 21, + "incorrect value for stec_residuals[41].stddev, expected 21, is %d", + check_msg->stec_residuals[41].stddev); + ck_assert_msg(check_msg->stec_residuals[41].sv_id.constellation == 68, + "incorrect value for stec_residuals[41].sv_id.constellation, " + "expected 68, is %d", + check_msg->stec_residuals[41].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[41].sv_id.satId == 186, + "incorrect value for stec_residuals[41].sv_id.satId, " + "expected 186, is %d", + check_msg->stec_residuals[41].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[42].residual == -23413, + "incorrect value for stec_residuals[42].residual, expected " + "-23413, is %d", + check_msg->stec_residuals[42].residual); + ck_assert_msg( + check_msg->stec_residuals[42].stddev == 148, + "incorrect value for stec_residuals[42].stddev, expected 148, is %d", + check_msg->stec_residuals[42].stddev); + ck_assert_msg(check_msg->stec_residuals[42].sv_id.constellation == 180, + "incorrect value for stec_residuals[42].sv_id.constellation, " + "expected 180, is %d", + check_msg->stec_residuals[42].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[42].sv_id.satId == 0, + "incorrect value for stec_residuals[42].sv_id.satId, expected 0, is %d", + check_msg->stec_residuals[42].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[43].residual == 30934, + "incorrect value for stec_residuals[43].residual, expected " + "30934, is %d", + check_msg->stec_residuals[43].residual); + ck_assert_msg( + check_msg->stec_residuals[43].stddev == 177, + "incorrect value for stec_residuals[43].stddev, expected 177, is %d", + check_msg->stec_residuals[43].stddev); + ck_assert_msg(check_msg->stec_residuals[43].sv_id.constellation == 149, + "incorrect value for stec_residuals[43].sv_id.constellation, " + "expected 149, is %d", + check_msg->stec_residuals[43].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[43].sv_id.satId == 119, + "incorrect value for stec_residuals[43].sv_id.satId, " + "expected 119, is %d", + check_msg->stec_residuals[43].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[44].residual == 26960, + "incorrect value for stec_residuals[44].residual, expected " + "26960, is %d", + check_msg->stec_residuals[44].residual); + ck_assert_msg( + check_msg->stec_residuals[44].stddev == 10, + "incorrect value for stec_residuals[44].stddev, expected 10, is %d", + check_msg->stec_residuals[44].stddev); + ck_assert_msg(check_msg->stec_residuals[44].sv_id.constellation == 80, + "incorrect value for stec_residuals[44].sv_id.constellation, " + "expected 80, is %d", + check_msg->stec_residuals[44].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[44].sv_id.satId == 201, + "incorrect value for stec_residuals[44].sv_id.satId, " + "expected 201, is %d", + check_msg->stec_residuals[44].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[45].residual == 11853, + "incorrect value for stec_residuals[45].residual, expected " + "11853, is %d", + check_msg->stec_residuals[45].residual); + ck_assert_msg( + check_msg->stec_residuals[45].stddev == 233, + "incorrect value for stec_residuals[45].stddev, expected 233, is %d", + check_msg->stec_residuals[45].stddev); + ck_assert_msg(check_msg->stec_residuals[45].sv_id.constellation == 118, + "incorrect value for stec_residuals[45].sv_id.constellation, " + "expected 118, is %d", + check_msg->stec_residuals[45].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[45].sv_id.satId == 136, + "incorrect value for stec_residuals[45].sv_id.satId, " + "expected 136, is %d", + check_msg->stec_residuals[45].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[46].residual == -25077, + "incorrect value for stec_residuals[46].residual, expected " + "-25077, is %d", + check_msg->stec_residuals[46].residual); + ck_assert_msg( + check_msg->stec_residuals[46].stddev == 103, + "incorrect value for stec_residuals[46].stddev, expected 103, is %d", + check_msg->stec_residuals[46].stddev); + ck_assert_msg(check_msg->stec_residuals[46].sv_id.constellation == 227, + "incorrect value for stec_residuals[46].sv_id.constellation, " + "expected 227, is %d", + check_msg->stec_residuals[46].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[46].sv_id.satId == 233, + "incorrect value for stec_residuals[46].sv_id.satId, " + "expected 233, is %d", + check_msg->stec_residuals[46].sv_id.satId); + ck_assert_msg(check_msg->tropo_delay_correction.hydro == 10643, + "incorrect value for tropo_delay_correction.hydro, expected " + "10643, is %d", + check_msg->tropo_delay_correction.hydro); + ck_assert_msg( + check_msg->tropo_delay_correction.stddev == 92, + "incorrect value for tropo_delay_correction.stddev, expected 92, is %d", + check_msg->tropo_delay_correction.stddev); + ck_assert_msg( + check_msg->tropo_delay_correction.wet == 33, + "incorrect value for tropo_delay_correction.wet, expected 33, is %d", + check_msg->tropo_delay_correction.wet); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA); +Suite *legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.c index 0419cd12d..898231de0 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionNoStdDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionNoStdDepA.yaml +// by generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,40 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x5f0, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x5f0, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x5f0, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x5f0, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,240,5,102,28,254,179,240,33,169,236,34,117,245,67,248,233,236,230,230,103,122,63,101,231,157,115,162,197,146,35,107,222,109,52,41,86,12,237,184,65,204,137,148,171,183,11,0,180,203,172,53,196,85,186,115,203,92,166,30,42,13,200,71,98,137,219,160,95,216,95,250,99,196,92,214,159,253,195,222,233,146,233,63,76,24,106,40,253,65,9,183,40,215,188,59,117,69,97,115,60,56,0,141,207,171,54,161,23,61,0,87,230,123,87,36,184,255,14,163,187,224,43,151,151,104,39,57,5,54,48,224,181,129,60,92,171,114,109,109,12,23,118,8,64,159,54,216,33,20,24,68,160,36,38,222,145,190,92,99,108,159,232,240,227,221,253,15,62,23,121,185,168,116,4,147,123,72,223,119,226,242,161,204,180,202,137,166,58,24,124,19,181,188,16,107,66,231,63,1,64,252,115,62,233,97,250,86,156,221,49,178,32,73,198,67,249,253,74,56,38,165,119,92,99,44,95,131,89,192,225,55,95,171,88,205,21,116,231,83,71,71,100,110,217,254,152,212,18,8,40,157,244,54,72,240,231,189,111,195,205,81, }; + u8 encoded_frame[] = { + 85, 240, 5, 102, 28, 254, 179, 240, 33, 169, 236, 34, 117, 245, + 67, 248, 233, 236, 230, 230, 103, 122, 63, 101, 231, 157, 115, 162, + 197, 146, 35, 107, 222, 109, 52, 41, 86, 12, 237, 184, 65, 204, + 137, 148, 171, 183, 11, 0, 180, 203, 172, 53, 196, 85, 186, 115, + 203, 92, 166, 30, 42, 13, 200, 71, 98, 137, 219, 160, 95, 216, + 95, 250, 99, 196, 92, 214, 159, 253, 195, 222, 233, 146, 233, 63, + 76, 24, 106, 40, 253, 65, 9, 183, 40, 215, 188, 59, 117, 69, + 97, 115, 60, 56, 0, 141, 207, 171, 54, 161, 23, 61, 0, 87, + 230, 123, 87, 36, 184, 255, 14, 163, 187, 224, 43, 151, 151, 104, + 39, 57, 5, 54, 48, 224, 181, 129, 60, 92, 171, 114, 109, 109, + 12, 23, 118, 8, 64, 159, 54, 216, 33, 20, 24, 68, 160, 36, + 38, 222, 145, 190, 92, 99, 108, 159, 232, 240, 227, 221, 253, 15, + 62, 23, 121, 185, 168, 116, 4, 147, 123, 72, 223, 119, 226, 242, + 161, 204, 180, 202, 137, 166, 58, 24, 124, 19, 181, 188, 16, 107, + 66, 231, 63, 1, 64, 252, 115, 62, 233, 97, 250, 86, 156, 221, + 49, 178, 32, 73, 198, 67, 249, 253, 74, 56, 38, 165, 119, 92, + 99, 44, 95, 131, 89, 192, 225, 55, 95, 171, 88, 205, 21, 116, + 231, 83, 71, 71, 100, 110, 217, 254, 152, 212, 18, 8, 40, 157, + 244, 54, 72, 240, 231, 189, 111, 195, 205, 81, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_gridded_correction_no_std_dep_a_t* test_msg = ( msg_ssr_gridded_correction_no_std_dep_a_t* )test_msg_storage; + msg_ssr_gridded_correction_no_std_dep_a_t *test_msg = + (msg_ssr_gridded_correction_no_std_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.iod_atmo = 236; test_msg->header.num_msgs = 62837; @@ -566,250 +586,817 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA ) test_msg->stec_residuals[58].sv_id.satId = 231; test_msg->tropo_delay_correction.hydro = 16250; test_msg->tropo_delay_correction.wet = 101; - sbp_payload_send(&sbp_state, 0x5f0, 7270, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x5f0, 7270, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 7270, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 7270, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x5f0, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_gridded_correction_no_std_dep_a_t* check_msg = ( msg_ssr_gridded_correction_no_std_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_gridded_correction_no_std_dep_a_t *check_msg = + (msg_ssr_gridded_correction_no_std_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.iod_atmo == 236, "incorrect value for header.iod_atmo, expected 236, is %d", check_msg->header.iod_atmo); - ck_assert_msg(check_msg->header.num_msgs == 62837, "incorrect value for header.num_msgs, expected 62837, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.seq_num == 63555, "incorrect value for header.seq_num, expected 63555, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->header.time.tow == 2837573811, "incorrect value for header.time.tow, expected 2837573811, is %d", check_msg->header.time.tow); - ck_assert_msg(check_msg->header.time.wn == 8940, "incorrect value for header.time.wn, expected 8940, is %d", check_msg->header.time.wn); - ck_assert_msg(check_msg->header.tropo_quality_indicator == 230, "incorrect value for header.tropo_quality_indicator, expected 230, is %d", check_msg->header.tropo_quality_indicator); - ck_assert_msg(check_msg->header.update_interval == 233, "incorrect value for header.update_interval, expected 233, is %d", check_msg->header.update_interval); - ck_assert_msg(check_msg->index == 26598, "incorrect value for index, expected 26598, is %d", check_msg->index); - ck_assert_msg(check_msg->stec_residuals[0].residual == -23949, "incorrect value for stec_residuals[0].residual, expected -23949, is %d", check_msg->stec_residuals[0].residual); - ck_assert_msg(check_msg->stec_residuals[0].sv_id.constellation == 157, "incorrect value for stec_residuals[0].sv_id.constellation, expected 157, is %d", check_msg->stec_residuals[0].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[0].sv_id.satId == 231, "incorrect value for stec_residuals[0].sv_id.satId, expected 231, is %d", check_msg->stec_residuals[0].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[1].residual == 27427, "incorrect value for stec_residuals[1].residual, expected 27427, is %d", check_msg->stec_residuals[1].residual); - ck_assert_msg(check_msg->stec_residuals[1].sv_id.constellation == 146, "incorrect value for stec_residuals[1].sv_id.constellation, expected 146, is %d", check_msg->stec_residuals[1].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[1].sv_id.satId == 197, "incorrect value for stec_residuals[1].sv_id.satId, expected 197, is %d", check_msg->stec_residuals[1].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[2].residual == 10548, "incorrect value for stec_residuals[2].residual, expected 10548, is %d", check_msg->stec_residuals[2].residual); - ck_assert_msg(check_msg->stec_residuals[2].sv_id.constellation == 109, "incorrect value for stec_residuals[2].sv_id.constellation, expected 109, is %d", check_msg->stec_residuals[2].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[2].sv_id.satId == 222, "incorrect value for stec_residuals[2].sv_id.satId, expected 222, is %d", check_msg->stec_residuals[2].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[3].residual == -18195, "incorrect value for stec_residuals[3].residual, expected -18195, is %d", check_msg->stec_residuals[3].residual); - ck_assert_msg(check_msg->stec_residuals[3].sv_id.constellation == 12, "incorrect value for stec_residuals[3].sv_id.constellation, expected 12, is %d", check_msg->stec_residuals[3].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[3].sv_id.satId == 86, "incorrect value for stec_residuals[3].sv_id.satId, expected 86, is %d", check_msg->stec_residuals[3].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[4].residual == -27511, "incorrect value for stec_residuals[4].residual, expected -27511, is %d", check_msg->stec_residuals[4].residual); - ck_assert_msg(check_msg->stec_residuals[4].sv_id.constellation == 204, "incorrect value for stec_residuals[4].sv_id.constellation, expected 204, is %d", check_msg->stec_residuals[4].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[4].sv_id.satId == 65, "incorrect value for stec_residuals[4].sv_id.satId, expected 65, is %d", check_msg->stec_residuals[4].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[5].residual == 11, "incorrect value for stec_residuals[5].residual, expected 11, is %d", check_msg->stec_residuals[5].residual); - ck_assert_msg(check_msg->stec_residuals[5].sv_id.constellation == 183, "incorrect value for stec_residuals[5].sv_id.constellation, expected 183, is %d", check_msg->stec_residuals[5].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[5].sv_id.satId == 171, "incorrect value for stec_residuals[5].sv_id.satId, expected 171, is %d", check_msg->stec_residuals[5].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[6].residual == 13740, "incorrect value for stec_residuals[6].residual, expected 13740, is %d", check_msg->stec_residuals[6].residual); - ck_assert_msg(check_msg->stec_residuals[6].sv_id.constellation == 203, "incorrect value for stec_residuals[6].sv_id.constellation, expected 203, is %d", check_msg->stec_residuals[6].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[6].sv_id.satId == 180, "incorrect value for stec_residuals[6].sv_id.satId, expected 180, is %d", check_msg->stec_residuals[6].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[7].residual == 29626, "incorrect value for stec_residuals[7].residual, expected 29626, is %d", check_msg->stec_residuals[7].residual); - ck_assert_msg(check_msg->stec_residuals[7].sv_id.constellation == 85, "incorrect value for stec_residuals[7].sv_id.constellation, expected 85, is %d", check_msg->stec_residuals[7].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[7].sv_id.satId == 196, "incorrect value for stec_residuals[7].sv_id.satId, expected 196, is %d", check_msg->stec_residuals[7].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[8].residual == 7846, "incorrect value for stec_residuals[8].residual, expected 7846, is %d", check_msg->stec_residuals[8].residual); - ck_assert_msg(check_msg->stec_residuals[8].sv_id.constellation == 92, "incorrect value for stec_residuals[8].sv_id.constellation, expected 92, is %d", check_msg->stec_residuals[8].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[8].sv_id.satId == 203, "incorrect value for stec_residuals[8].sv_id.satId, expected 203, is %d", check_msg->stec_residuals[8].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[9].residual == 18376, "incorrect value for stec_residuals[9].residual, expected 18376, is %d", check_msg->stec_residuals[9].residual); - ck_assert_msg(check_msg->stec_residuals[9].sv_id.constellation == 13, "incorrect value for stec_residuals[9].sv_id.constellation, expected 13, is %d", check_msg->stec_residuals[9].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[9].sv_id.satId == 42, "incorrect value for stec_residuals[9].sv_id.satId, expected 42, is %d", check_msg->stec_residuals[9].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[10].residual == -24357, "incorrect value for stec_residuals[10].residual, expected -24357, is %d", check_msg->stec_residuals[10].residual); - ck_assert_msg(check_msg->stec_residuals[10].sv_id.constellation == 137, "incorrect value for stec_residuals[10].sv_id.constellation, expected 137, is %d", check_msg->stec_residuals[10].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[10].sv_id.satId == 98, "incorrect value for stec_residuals[10].sv_id.satId, expected 98, is %d", check_msg->stec_residuals[10].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[11].residual == -1441, "incorrect value for stec_residuals[11].residual, expected -1441, is %d", check_msg->stec_residuals[11].residual); - ck_assert_msg(check_msg->stec_residuals[11].sv_id.constellation == 216, "incorrect value for stec_residuals[11].sv_id.constellation, expected 216, is %d", check_msg->stec_residuals[11].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[11].sv_id.satId == 95, "incorrect value for stec_residuals[11].sv_id.satId, expected 95, is %d", check_msg->stec_residuals[11].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[12].residual == -10660, "incorrect value for stec_residuals[12].residual, expected -10660, is %d", check_msg->stec_residuals[12].residual); - ck_assert_msg(check_msg->stec_residuals[12].sv_id.constellation == 196, "incorrect value for stec_residuals[12].sv_id.constellation, expected 196, is %d", check_msg->stec_residuals[12].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[12].sv_id.satId == 99, "incorrect value for stec_residuals[12].sv_id.satId, expected 99, is %d", check_msg->stec_residuals[12].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[13].residual == -8509, "incorrect value for stec_residuals[13].residual, expected -8509, is %d", check_msg->stec_residuals[13].residual); - ck_assert_msg(check_msg->stec_residuals[13].sv_id.constellation == 253, "incorrect value for stec_residuals[13].sv_id.constellation, expected 253, is %d", check_msg->stec_residuals[13].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[13].sv_id.satId == 159, "incorrect value for stec_residuals[13].sv_id.satId, expected 159, is %d", check_msg->stec_residuals[13].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[14].residual == 16361, "incorrect value for stec_residuals[14].residual, expected 16361, is %d", check_msg->stec_residuals[14].residual); - ck_assert_msg(check_msg->stec_residuals[14].sv_id.constellation == 146, "incorrect value for stec_residuals[14].sv_id.constellation, expected 146, is %d", check_msg->stec_residuals[14].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[14].sv_id.satId == 233, "incorrect value for stec_residuals[14].sv_id.satId, expected 233, is %d", check_msg->stec_residuals[14].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[15].residual == 10346, "incorrect value for stec_residuals[15].residual, expected 10346, is %d", check_msg->stec_residuals[15].residual); - ck_assert_msg(check_msg->stec_residuals[15].sv_id.constellation == 24, "incorrect value for stec_residuals[15].sv_id.constellation, expected 24, is %d", check_msg->stec_residuals[15].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[15].sv_id.satId == 76, "incorrect value for stec_residuals[15].sv_id.satId, expected 76, is %d", check_msg->stec_residuals[15].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[16].residual == -18679, "incorrect value for stec_residuals[16].residual, expected -18679, is %d", check_msg->stec_residuals[16].residual); - ck_assert_msg(check_msg->stec_residuals[16].sv_id.constellation == 65, "incorrect value for stec_residuals[16].sv_id.constellation, expected 65, is %d", check_msg->stec_residuals[16].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[16].sv_id.satId == 253, "incorrect value for stec_residuals[16].sv_id.satId, expected 253, is %d", check_msg->stec_residuals[16].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[17].residual == 15292, "incorrect value for stec_residuals[17].residual, expected 15292, is %d", check_msg->stec_residuals[17].residual); - ck_assert_msg(check_msg->stec_residuals[17].sv_id.constellation == 215, "incorrect value for stec_residuals[17].sv_id.constellation, expected 215, is %d", check_msg->stec_residuals[17].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[17].sv_id.satId == 40, "incorrect value for stec_residuals[17].sv_id.satId, expected 40, is %d", check_msg->stec_residuals[17].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[18].residual == 29537, "incorrect value for stec_residuals[18].residual, expected 29537, is %d", check_msg->stec_residuals[18].residual); - ck_assert_msg(check_msg->stec_residuals[18].sv_id.constellation == 69, "incorrect value for stec_residuals[18].sv_id.constellation, expected 69, is %d", check_msg->stec_residuals[18].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[18].sv_id.satId == 117, "incorrect value for stec_residuals[18].sv_id.satId, expected 117, is %d", check_msg->stec_residuals[18].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[19].residual == -29440, "incorrect value for stec_residuals[19].residual, expected -29440, is %d", check_msg->stec_residuals[19].residual); - ck_assert_msg(check_msg->stec_residuals[19].sv_id.constellation == 56, "incorrect value for stec_residuals[19].sv_id.constellation, expected 56, is %d", check_msg->stec_residuals[19].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[19].sv_id.satId == 60, "incorrect value for stec_residuals[19].sv_id.satId, expected 60, is %d", check_msg->stec_residuals[19].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[20].residual == -24266, "incorrect value for stec_residuals[20].residual, expected -24266, is %d", check_msg->stec_residuals[20].residual); - ck_assert_msg(check_msg->stec_residuals[20].sv_id.constellation == 171, "incorrect value for stec_residuals[20].sv_id.constellation, expected 171, is %d", check_msg->stec_residuals[20].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[20].sv_id.satId == 207, "incorrect value for stec_residuals[20].sv_id.satId, expected 207, is %d", check_msg->stec_residuals[20].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[21].residual == 22272, "incorrect value for stec_residuals[21].residual, expected 22272, is %d", check_msg->stec_residuals[21].residual); - ck_assert_msg(check_msg->stec_residuals[21].sv_id.constellation == 61, "incorrect value for stec_residuals[21].sv_id.constellation, expected 61, is %d", check_msg->stec_residuals[21].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[21].sv_id.satId == 23, "incorrect value for stec_residuals[21].sv_id.satId, expected 23, is %d", check_msg->stec_residuals[21].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[22].residual == 9303, "incorrect value for stec_residuals[22].residual, expected 9303, is %d", check_msg->stec_residuals[22].residual); - ck_assert_msg(check_msg->stec_residuals[22].sv_id.constellation == 123, "incorrect value for stec_residuals[22].sv_id.constellation, expected 123, is %d", check_msg->stec_residuals[22].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[22].sv_id.satId == 230, "incorrect value for stec_residuals[22].sv_id.satId, expected 230, is %d", check_msg->stec_residuals[22].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[23].residual == -23794, "incorrect value for stec_residuals[23].residual, expected -23794, is %d", check_msg->stec_residuals[23].residual); - ck_assert_msg(check_msg->stec_residuals[23].sv_id.constellation == 255, "incorrect value for stec_residuals[23].sv_id.constellation, expected 255, is %d", check_msg->stec_residuals[23].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[23].sv_id.satId == 184, "incorrect value for stec_residuals[23].sv_id.satId, expected 184, is %d", check_msg->stec_residuals[23].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[24].residual == -26837, "incorrect value for stec_residuals[24].residual, expected -26837, is %d", check_msg->stec_residuals[24].residual); - ck_assert_msg(check_msg->stec_residuals[24].sv_id.constellation == 224, "incorrect value for stec_residuals[24].sv_id.constellation, expected 224, is %d", check_msg->stec_residuals[24].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[24].sv_id.satId == 187, "incorrect value for stec_residuals[24].sv_id.satId, expected 187, is %d", check_msg->stec_residuals[24].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[25].residual == 14631, "incorrect value for stec_residuals[25].residual, expected 14631, is %d", check_msg->stec_residuals[25].residual); - ck_assert_msg(check_msg->stec_residuals[25].sv_id.constellation == 104, "incorrect value for stec_residuals[25].sv_id.constellation, expected 104, is %d", check_msg->stec_residuals[25].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[25].sv_id.satId == 151, "incorrect value for stec_residuals[25].sv_id.satId, expected 151, is %d", check_msg->stec_residuals[25].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[26].residual == -8144, "incorrect value for stec_residuals[26].residual, expected -8144, is %d", check_msg->stec_residuals[26].residual); - ck_assert_msg(check_msg->stec_residuals[26].sv_id.constellation == 54, "incorrect value for stec_residuals[26].sv_id.constellation, expected 54, is %d", check_msg->stec_residuals[26].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[26].sv_id.satId == 5, "incorrect value for stec_residuals[26].sv_id.satId, expected 5, is %d", check_msg->stec_residuals[26].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[27].residual == 23612, "incorrect value for stec_residuals[27].residual, expected 23612, is %d", check_msg->stec_residuals[27].residual); - ck_assert_msg(check_msg->stec_residuals[27].sv_id.constellation == 129, "incorrect value for stec_residuals[27].sv_id.constellation, expected 129, is %d", check_msg->stec_residuals[27].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[27].sv_id.satId == 181, "incorrect value for stec_residuals[27].sv_id.satId, expected 181, is %d", check_msg->stec_residuals[27].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[28].residual == 28013, "incorrect value for stec_residuals[28].residual, expected 28013, is %d", check_msg->stec_residuals[28].residual); - ck_assert_msg(check_msg->stec_residuals[28].sv_id.constellation == 114, "incorrect value for stec_residuals[28].sv_id.constellation, expected 114, is %d", check_msg->stec_residuals[28].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[28].sv_id.satId == 171, "incorrect value for stec_residuals[28].sv_id.satId, expected 171, is %d", check_msg->stec_residuals[28].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[29].residual == 2166, "incorrect value for stec_residuals[29].residual, expected 2166, is %d", check_msg->stec_residuals[29].residual); - ck_assert_msg(check_msg->stec_residuals[29].sv_id.constellation == 23, "incorrect value for stec_residuals[29].sv_id.constellation, expected 23, is %d", check_msg->stec_residuals[29].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[29].sv_id.satId == 12, "incorrect value for stec_residuals[29].sv_id.satId, expected 12, is %d", check_msg->stec_residuals[29].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[30].residual == -10186, "incorrect value for stec_residuals[30].residual, expected -10186, is %d", check_msg->stec_residuals[30].residual); - ck_assert_msg(check_msg->stec_residuals[30].sv_id.constellation == 159, "incorrect value for stec_residuals[30].sv_id.constellation, expected 159, is %d", check_msg->stec_residuals[30].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[30].sv_id.satId == 64, "incorrect value for stec_residuals[30].sv_id.satId, expected 64, is %d", check_msg->stec_residuals[30].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[31].residual == 17432, "incorrect value for stec_residuals[31].residual, expected 17432, is %d", check_msg->stec_residuals[31].residual); - ck_assert_msg(check_msg->stec_residuals[31].sv_id.constellation == 20, "incorrect value for stec_residuals[31].sv_id.constellation, expected 20, is %d", check_msg->stec_residuals[31].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[31].sv_id.satId == 33, "incorrect value for stec_residuals[31].sv_id.satId, expected 33, is %d", check_msg->stec_residuals[31].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[32].residual == -8666, "incorrect value for stec_residuals[32].residual, expected -8666, is %d", check_msg->stec_residuals[32].residual); - ck_assert_msg(check_msg->stec_residuals[32].sv_id.constellation == 36, "incorrect value for stec_residuals[32].sv_id.constellation, expected 36, is %d", check_msg->stec_residuals[32].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[32].sv_id.satId == 160, "incorrect value for stec_residuals[32].sv_id.satId, expected 160, is %d", check_msg->stec_residuals[32].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[33].residual == 25436, "incorrect value for stec_residuals[33].residual, expected 25436, is %d", check_msg->stec_residuals[33].residual); - ck_assert_msg(check_msg->stec_residuals[33].sv_id.constellation == 190, "incorrect value for stec_residuals[33].sv_id.constellation, expected 190, is %d", check_msg->stec_residuals[33].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[33].sv_id.satId == 145, "incorrect value for stec_residuals[33].sv_id.satId, expected 145, is %d", check_msg->stec_residuals[33].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[34].residual == -3864, "incorrect value for stec_residuals[34].residual, expected -3864, is %d", check_msg->stec_residuals[34].residual); - ck_assert_msg(check_msg->stec_residuals[34].sv_id.constellation == 159, "incorrect value for stec_residuals[34].sv_id.constellation, expected 159, is %d", check_msg->stec_residuals[34].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[34].sv_id.satId == 108, "incorrect value for stec_residuals[34].sv_id.satId, expected 108, is %d", check_msg->stec_residuals[34].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[35].residual == 4093, "incorrect value for stec_residuals[35].residual, expected 4093, is %d", check_msg->stec_residuals[35].residual); - ck_assert_msg(check_msg->stec_residuals[35].sv_id.constellation == 221, "incorrect value for stec_residuals[35].sv_id.constellation, expected 221, is %d", check_msg->stec_residuals[35].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[35].sv_id.satId == 227, "incorrect value for stec_residuals[35].sv_id.satId, expected 227, is %d", check_msg->stec_residuals[35].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[36].residual == -18055, "incorrect value for stec_residuals[36].residual, expected -18055, is %d", check_msg->stec_residuals[36].residual); - ck_assert_msg(check_msg->stec_residuals[36].sv_id.constellation == 23, "incorrect value for stec_residuals[36].sv_id.constellation, expected 23, is %d", check_msg->stec_residuals[36].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[36].sv_id.satId == 62, "incorrect value for stec_residuals[36].sv_id.satId, expected 62, is %d", check_msg->stec_residuals[36].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[37].residual == -27900, "incorrect value for stec_residuals[37].residual, expected -27900, is %d", check_msg->stec_residuals[37].residual); - ck_assert_msg(check_msg->stec_residuals[37].sv_id.constellation == 116, "incorrect value for stec_residuals[37].sv_id.constellation, expected 116, is %d", check_msg->stec_residuals[37].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[37].sv_id.satId == 168, "incorrect value for stec_residuals[37].sv_id.satId, expected 168, is %d", check_msg->stec_residuals[37].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[38].residual == 30687, "incorrect value for stec_residuals[38].residual, expected 30687, is %d", check_msg->stec_residuals[38].residual); - ck_assert_msg(check_msg->stec_residuals[38].sv_id.constellation == 72, "incorrect value for stec_residuals[38].sv_id.constellation, expected 72, is %d", check_msg->stec_residuals[38].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[38].sv_id.satId == 123, "incorrect value for stec_residuals[38].sv_id.satId, expected 123, is %d", check_msg->stec_residuals[38].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[39].residual == -13151, "incorrect value for stec_residuals[39].residual, expected -13151, is %d", check_msg->stec_residuals[39].residual); - ck_assert_msg(check_msg->stec_residuals[39].sv_id.constellation == 242, "incorrect value for stec_residuals[39].sv_id.constellation, expected 242, is %d", check_msg->stec_residuals[39].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[39].sv_id.satId == 226, "incorrect value for stec_residuals[39].sv_id.satId, expected 226, is %d", check_msg->stec_residuals[39].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[40].residual == -22903, "incorrect value for stec_residuals[40].residual, expected -22903, is %d", check_msg->stec_residuals[40].residual); - ck_assert_msg(check_msg->stec_residuals[40].sv_id.constellation == 202, "incorrect value for stec_residuals[40].sv_id.constellation, expected 202, is %d", check_msg->stec_residuals[40].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[40].sv_id.satId == 180, "incorrect value for stec_residuals[40].sv_id.satId, expected 180, is %d", check_msg->stec_residuals[40].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[41].residual == 4988, "incorrect value for stec_residuals[41].residual, expected 4988, is %d", check_msg->stec_residuals[41].residual); - ck_assert_msg(check_msg->stec_residuals[41].sv_id.constellation == 24, "incorrect value for stec_residuals[41].sv_id.constellation, expected 24, is %d", check_msg->stec_residuals[41].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[41].sv_id.satId == 58, "incorrect value for stec_residuals[41].sv_id.satId, expected 58, is %d", check_msg->stec_residuals[41].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[42].residual == 27408, "incorrect value for stec_residuals[42].residual, expected 27408, is %d", check_msg->stec_residuals[42].residual); - ck_assert_msg(check_msg->stec_residuals[42].sv_id.constellation == 188, "incorrect value for stec_residuals[42].sv_id.constellation, expected 188, is %d", check_msg->stec_residuals[42].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[42].sv_id.satId == 181, "incorrect value for stec_residuals[42].sv_id.satId, expected 181, is %d", check_msg->stec_residuals[42].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[43].residual == 319, "incorrect value for stec_residuals[43].residual, expected 319, is %d", check_msg->stec_residuals[43].residual); - ck_assert_msg(check_msg->stec_residuals[43].sv_id.constellation == 231, "incorrect value for stec_residuals[43].sv_id.constellation, expected 231, is %d", check_msg->stec_residuals[43].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[43].sv_id.satId == 66, "incorrect value for stec_residuals[43].sv_id.satId, expected 66, is %d", check_msg->stec_residuals[43].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[44].residual == 15987, "incorrect value for stec_residuals[44].residual, expected 15987, is %d", check_msg->stec_residuals[44].residual); - ck_assert_msg(check_msg->stec_residuals[44].sv_id.constellation == 252, "incorrect value for stec_residuals[44].sv_id.constellation, expected 252, is %d", check_msg->stec_residuals[44].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[44].sv_id.satId == 64, "incorrect value for stec_residuals[44].sv_id.satId, expected 64, is %d", check_msg->stec_residuals[44].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[45].residual == 22266, "incorrect value for stec_residuals[45].residual, expected 22266, is %d", check_msg->stec_residuals[45].residual); - ck_assert_msg(check_msg->stec_residuals[45].sv_id.constellation == 97, "incorrect value for stec_residuals[45].sv_id.constellation, expected 97, is %d", check_msg->stec_residuals[45].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[45].sv_id.satId == 233, "incorrect value for stec_residuals[45].sv_id.satId, expected 233, is %d", check_msg->stec_residuals[45].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[46].residual == -19919, "incorrect value for stec_residuals[46].residual, expected -19919, is %d", check_msg->stec_residuals[46].residual); - ck_assert_msg(check_msg->stec_residuals[46].sv_id.constellation == 221, "incorrect value for stec_residuals[46].sv_id.constellation, expected 221, is %d", check_msg->stec_residuals[46].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[46].sv_id.satId == 156, "incorrect value for stec_residuals[46].sv_id.satId, expected 156, is %d", check_msg->stec_residuals[46].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[47].residual == 17350, "incorrect value for stec_residuals[47].residual, expected 17350, is %d", check_msg->stec_residuals[47].residual); - ck_assert_msg(check_msg->stec_residuals[47].sv_id.constellation == 73, "incorrect value for stec_residuals[47].sv_id.constellation, expected 73, is %d", check_msg->stec_residuals[47].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[47].sv_id.satId == 32, "incorrect value for stec_residuals[47].sv_id.satId, expected 32, is %d", check_msg->stec_residuals[47].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[48].residual == 14410, "incorrect value for stec_residuals[48].residual, expected 14410, is %d", check_msg->stec_residuals[48].residual); - ck_assert_msg(check_msg->stec_residuals[48].sv_id.constellation == 253, "incorrect value for stec_residuals[48].sv_id.constellation, expected 253, is %d", check_msg->stec_residuals[48].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[48].sv_id.satId == 249, "incorrect value for stec_residuals[48].sv_id.satId, expected 249, is %d", check_msg->stec_residuals[48].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[49].residual == 23671, "incorrect value for stec_residuals[49].residual, expected 23671, is %d", check_msg->stec_residuals[49].residual); - ck_assert_msg(check_msg->stec_residuals[49].sv_id.constellation == 165, "incorrect value for stec_residuals[49].sv_id.constellation, expected 165, is %d", check_msg->stec_residuals[49].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[49].sv_id.satId == 38, "incorrect value for stec_residuals[49].sv_id.satId, expected 38, is %d", check_msg->stec_residuals[49].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[50].residual == -31905, "incorrect value for stec_residuals[50].residual, expected -31905, is %d", check_msg->stec_residuals[50].residual); - ck_assert_msg(check_msg->stec_residuals[50].sv_id.constellation == 44, "incorrect value for stec_residuals[50].sv_id.constellation, expected 44, is %d", check_msg->stec_residuals[50].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[50].sv_id.satId == 99, "incorrect value for stec_residuals[50].sv_id.satId, expected 99, is %d", check_msg->stec_residuals[50].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[51].residual == 14305, "incorrect value for stec_residuals[51].residual, expected 14305, is %d", check_msg->stec_residuals[51].residual); - ck_assert_msg(check_msg->stec_residuals[51].sv_id.constellation == 192, "incorrect value for stec_residuals[51].sv_id.constellation, expected 192, is %d", check_msg->stec_residuals[51].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[51].sv_id.satId == 89, "incorrect value for stec_residuals[51].sv_id.satId, expected 89, is %d", check_msg->stec_residuals[51].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[52].residual == -12968, "incorrect value for stec_residuals[52].residual, expected -12968, is %d", check_msg->stec_residuals[52].residual); - ck_assert_msg(check_msg->stec_residuals[52].sv_id.constellation == 171, "incorrect value for stec_residuals[52].sv_id.constellation, expected 171, is %d", check_msg->stec_residuals[52].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[52].sv_id.satId == 95, "incorrect value for stec_residuals[52].sv_id.satId, expected 95, is %d", check_msg->stec_residuals[52].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[53].residual == 21479, "incorrect value for stec_residuals[53].residual, expected 21479, is %d", check_msg->stec_residuals[53].residual); - ck_assert_msg(check_msg->stec_residuals[53].sv_id.constellation == 116, "incorrect value for stec_residuals[53].sv_id.constellation, expected 116, is %d", check_msg->stec_residuals[53].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[53].sv_id.satId == 21, "incorrect value for stec_residuals[53].sv_id.satId, expected 21, is %d", check_msg->stec_residuals[53].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[54].residual == 28260, "incorrect value for stec_residuals[54].residual, expected 28260, is %d", check_msg->stec_residuals[54].residual); - ck_assert_msg(check_msg->stec_residuals[54].sv_id.constellation == 71, "incorrect value for stec_residuals[54].sv_id.constellation, expected 71, is %d", check_msg->stec_residuals[54].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[54].sv_id.satId == 71, "incorrect value for stec_residuals[54].sv_id.satId, expected 71, is %d", check_msg->stec_residuals[54].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[55].residual == -11112, "incorrect value for stec_residuals[55].residual, expected -11112, is %d", check_msg->stec_residuals[55].residual); - ck_assert_msg(check_msg->stec_residuals[55].sv_id.constellation == 254, "incorrect value for stec_residuals[55].sv_id.constellation, expected 254, is %d", check_msg->stec_residuals[55].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[55].sv_id.satId == 217, "incorrect value for stec_residuals[55].sv_id.satId, expected 217, is %d", check_msg->stec_residuals[55].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[56].residual == -25304, "incorrect value for stec_residuals[56].residual, expected -25304, is %d", check_msg->stec_residuals[56].residual); - ck_assert_msg(check_msg->stec_residuals[56].sv_id.constellation == 8, "incorrect value for stec_residuals[56].sv_id.constellation, expected 8, is %d", check_msg->stec_residuals[56].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[56].sv_id.satId == 18, "incorrect value for stec_residuals[56].sv_id.satId, expected 18, is %d", check_msg->stec_residuals[56].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[57].residual == -4024, "incorrect value for stec_residuals[57].residual, expected -4024, is %d", check_msg->stec_residuals[57].residual); - ck_assert_msg(check_msg->stec_residuals[57].sv_id.constellation == 54, "incorrect value for stec_residuals[57].sv_id.constellation, expected 54, is %d", check_msg->stec_residuals[57].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[57].sv_id.satId == 244, "incorrect value for stec_residuals[57].sv_id.satId, expected 244, is %d", check_msg->stec_residuals[57].sv_id.satId); - ck_assert_msg(check_msg->stec_residuals[58].residual == -15505, "incorrect value for stec_residuals[58].residual, expected -15505, is %d", check_msg->stec_residuals[58].residual); - ck_assert_msg(check_msg->stec_residuals[58].sv_id.constellation == 189, "incorrect value for stec_residuals[58].sv_id.constellation, expected 189, is %d", check_msg->stec_residuals[58].sv_id.constellation); - ck_assert_msg(check_msg->stec_residuals[58].sv_id.satId == 231, "incorrect value for stec_residuals[58].sv_id.satId, expected 231, is %d", check_msg->stec_residuals[58].sv_id.satId); - ck_assert_msg(check_msg->tropo_delay_correction.hydro == 16250, "incorrect value for tropo_delay_correction.hydro, expected 16250, is %d", check_msg->tropo_delay_correction.hydro); - ck_assert_msg(check_msg->tropo_delay_correction.wet == 101, "incorrect value for tropo_delay_correction.wet, expected 101, is %d", check_msg->tropo_delay_correction.wet); + ck_assert_msg(check_msg->header.iod_atmo == 236, + "incorrect value for header.iod_atmo, expected 236, is %d", + check_msg->header.iod_atmo); + ck_assert_msg(check_msg->header.num_msgs == 62837, + "incorrect value for header.num_msgs, expected 62837, is %d", + check_msg->header.num_msgs); + ck_assert_msg(check_msg->header.seq_num == 63555, + "incorrect value for header.seq_num, expected 63555, is %d", + check_msg->header.seq_num); + ck_assert_msg( + check_msg->header.time.tow == 2837573811, + "incorrect value for header.time.tow, expected 2837573811, is %d", + check_msg->header.time.tow); + ck_assert_msg(check_msg->header.time.wn == 8940, + "incorrect value for header.time.wn, expected 8940, is %d", + check_msg->header.time.wn); + ck_assert_msg(check_msg->header.tropo_quality_indicator == 230, + "incorrect value for header.tropo_quality_indicator, " + "expected 230, is %d", + check_msg->header.tropo_quality_indicator); + ck_assert_msg( + check_msg->header.update_interval == 233, + "incorrect value for header.update_interval, expected 233, is %d", + check_msg->header.update_interval); + ck_assert_msg(check_msg->index == 26598, + "incorrect value for index, expected 26598, is %d", + check_msg->index); + ck_assert_msg(check_msg->stec_residuals[0].residual == -23949, + "incorrect value for stec_residuals[0].residual, expected " + "-23949, is %d", + check_msg->stec_residuals[0].residual); + ck_assert_msg(check_msg->stec_residuals[0].sv_id.constellation == 157, + "incorrect value for stec_residuals[0].sv_id.constellation, " + "expected 157, is %d", + check_msg->stec_residuals[0].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[0].sv_id.satId == 231, + "incorrect value for stec_residuals[0].sv_id.satId, expected " + "231, is %d", + check_msg->stec_residuals[0].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[1].residual == 27427, + "incorrect value for stec_residuals[1].residual, expected 27427, is %d", + check_msg->stec_residuals[1].residual); + ck_assert_msg(check_msg->stec_residuals[1].sv_id.constellation == 146, + "incorrect value for stec_residuals[1].sv_id.constellation, " + "expected 146, is %d", + check_msg->stec_residuals[1].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[1].sv_id.satId == 197, + "incorrect value for stec_residuals[1].sv_id.satId, expected " + "197, is %d", + check_msg->stec_residuals[1].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[2].residual == 10548, + "incorrect value for stec_residuals[2].residual, expected 10548, is %d", + check_msg->stec_residuals[2].residual); + ck_assert_msg(check_msg->stec_residuals[2].sv_id.constellation == 109, + "incorrect value for stec_residuals[2].sv_id.constellation, " + "expected 109, is %d", + check_msg->stec_residuals[2].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[2].sv_id.satId == 222, + "incorrect value for stec_residuals[2].sv_id.satId, expected " + "222, is %d", + check_msg->stec_residuals[2].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[3].residual == -18195, + "incorrect value for stec_residuals[3].residual, expected " + "-18195, is %d", + check_msg->stec_residuals[3].residual); + ck_assert_msg(check_msg->stec_residuals[3].sv_id.constellation == 12, + "incorrect value for stec_residuals[3].sv_id.constellation, " + "expected 12, is %d", + check_msg->stec_residuals[3].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[3].sv_id.satId == 86, + "incorrect value for stec_residuals[3].sv_id.satId, expected 86, is %d", + check_msg->stec_residuals[3].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[4].residual == -27511, + "incorrect value for stec_residuals[4].residual, expected " + "-27511, is %d", + check_msg->stec_residuals[4].residual); + ck_assert_msg(check_msg->stec_residuals[4].sv_id.constellation == 204, + "incorrect value for stec_residuals[4].sv_id.constellation, " + "expected 204, is %d", + check_msg->stec_residuals[4].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[4].sv_id.satId == 65, + "incorrect value for stec_residuals[4].sv_id.satId, expected 65, is %d", + check_msg->stec_residuals[4].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[5].residual == 11, + "incorrect value for stec_residuals[5].residual, expected 11, is %d", + check_msg->stec_residuals[5].residual); + ck_assert_msg(check_msg->stec_residuals[5].sv_id.constellation == 183, + "incorrect value for stec_residuals[5].sv_id.constellation, " + "expected 183, is %d", + check_msg->stec_residuals[5].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[5].sv_id.satId == 171, + "incorrect value for stec_residuals[5].sv_id.satId, expected " + "171, is %d", + check_msg->stec_residuals[5].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[6].residual == 13740, + "incorrect value for stec_residuals[6].residual, expected 13740, is %d", + check_msg->stec_residuals[6].residual); + ck_assert_msg(check_msg->stec_residuals[6].sv_id.constellation == 203, + "incorrect value for stec_residuals[6].sv_id.constellation, " + "expected 203, is %d", + check_msg->stec_residuals[6].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[6].sv_id.satId == 180, + "incorrect value for stec_residuals[6].sv_id.satId, expected " + "180, is %d", + check_msg->stec_residuals[6].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[7].residual == 29626, + "incorrect value for stec_residuals[7].residual, expected 29626, is %d", + check_msg->stec_residuals[7].residual); + ck_assert_msg(check_msg->stec_residuals[7].sv_id.constellation == 85, + "incorrect value for stec_residuals[7].sv_id.constellation, " + "expected 85, is %d", + check_msg->stec_residuals[7].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[7].sv_id.satId == 196, + "incorrect value for stec_residuals[7].sv_id.satId, expected " + "196, is %d", + check_msg->stec_residuals[7].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[8].residual == 7846, + "incorrect value for stec_residuals[8].residual, expected 7846, is %d", + check_msg->stec_residuals[8].residual); + ck_assert_msg(check_msg->stec_residuals[8].sv_id.constellation == 92, + "incorrect value for stec_residuals[8].sv_id.constellation, " + "expected 92, is %d", + check_msg->stec_residuals[8].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[8].sv_id.satId == 203, + "incorrect value for stec_residuals[8].sv_id.satId, expected " + "203, is %d", + check_msg->stec_residuals[8].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[9].residual == 18376, + "incorrect value for stec_residuals[9].residual, expected 18376, is %d", + check_msg->stec_residuals[9].residual); + ck_assert_msg(check_msg->stec_residuals[9].sv_id.constellation == 13, + "incorrect value for stec_residuals[9].sv_id.constellation, " + "expected 13, is %d", + check_msg->stec_residuals[9].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[9].sv_id.satId == 42, + "incorrect value for stec_residuals[9].sv_id.satId, expected 42, is %d", + check_msg->stec_residuals[9].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[10].residual == -24357, + "incorrect value for stec_residuals[10].residual, expected " + "-24357, is %d", + check_msg->stec_residuals[10].residual); + ck_assert_msg(check_msg->stec_residuals[10].sv_id.constellation == 137, + "incorrect value for stec_residuals[10].sv_id.constellation, " + "expected 137, is %d", + check_msg->stec_residuals[10].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[10].sv_id.satId == 98, + "incorrect value for stec_residuals[10].sv_id.satId, " + "expected 98, is %d", + check_msg->stec_residuals[10].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[11].residual == -1441, + "incorrect value for stec_residuals[11].residual, expected " + "-1441, is %d", + check_msg->stec_residuals[11].residual); + ck_assert_msg(check_msg->stec_residuals[11].sv_id.constellation == 216, + "incorrect value for stec_residuals[11].sv_id.constellation, " + "expected 216, is %d", + check_msg->stec_residuals[11].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[11].sv_id.satId == 95, + "incorrect value for stec_residuals[11].sv_id.satId, " + "expected 95, is %d", + check_msg->stec_residuals[11].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[12].residual == -10660, + "incorrect value for stec_residuals[12].residual, expected " + "-10660, is %d", + check_msg->stec_residuals[12].residual); + ck_assert_msg(check_msg->stec_residuals[12].sv_id.constellation == 196, + "incorrect value for stec_residuals[12].sv_id.constellation, " + "expected 196, is %d", + check_msg->stec_residuals[12].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[12].sv_id.satId == 99, + "incorrect value for stec_residuals[12].sv_id.satId, " + "expected 99, is %d", + check_msg->stec_residuals[12].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[13].residual == -8509, + "incorrect value for stec_residuals[13].residual, expected " + "-8509, is %d", + check_msg->stec_residuals[13].residual); + ck_assert_msg(check_msg->stec_residuals[13].sv_id.constellation == 253, + "incorrect value for stec_residuals[13].sv_id.constellation, " + "expected 253, is %d", + check_msg->stec_residuals[13].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[13].sv_id.satId == 159, + "incorrect value for stec_residuals[13].sv_id.satId, " + "expected 159, is %d", + check_msg->stec_residuals[13].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[14].residual == 16361, + "incorrect value for stec_residuals[14].residual, expected " + "16361, is %d", + check_msg->stec_residuals[14].residual); + ck_assert_msg(check_msg->stec_residuals[14].sv_id.constellation == 146, + "incorrect value for stec_residuals[14].sv_id.constellation, " + "expected 146, is %d", + check_msg->stec_residuals[14].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[14].sv_id.satId == 233, + "incorrect value for stec_residuals[14].sv_id.satId, " + "expected 233, is %d", + check_msg->stec_residuals[14].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[15].residual == 10346, + "incorrect value for stec_residuals[15].residual, expected " + "10346, is %d", + check_msg->stec_residuals[15].residual); + ck_assert_msg(check_msg->stec_residuals[15].sv_id.constellation == 24, + "incorrect value for stec_residuals[15].sv_id.constellation, " + "expected 24, is %d", + check_msg->stec_residuals[15].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[15].sv_id.satId == 76, + "incorrect value for stec_residuals[15].sv_id.satId, " + "expected 76, is %d", + check_msg->stec_residuals[15].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[16].residual == -18679, + "incorrect value for stec_residuals[16].residual, expected " + "-18679, is %d", + check_msg->stec_residuals[16].residual); + ck_assert_msg(check_msg->stec_residuals[16].sv_id.constellation == 65, + "incorrect value for stec_residuals[16].sv_id.constellation, " + "expected 65, is %d", + check_msg->stec_residuals[16].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[16].sv_id.satId == 253, + "incorrect value for stec_residuals[16].sv_id.satId, " + "expected 253, is %d", + check_msg->stec_residuals[16].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[17].residual == 15292, + "incorrect value for stec_residuals[17].residual, expected " + "15292, is %d", + check_msg->stec_residuals[17].residual); + ck_assert_msg(check_msg->stec_residuals[17].sv_id.constellation == 215, + "incorrect value for stec_residuals[17].sv_id.constellation, " + "expected 215, is %d", + check_msg->stec_residuals[17].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[17].sv_id.satId == 40, + "incorrect value for stec_residuals[17].sv_id.satId, " + "expected 40, is %d", + check_msg->stec_residuals[17].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[18].residual == 29537, + "incorrect value for stec_residuals[18].residual, expected " + "29537, is %d", + check_msg->stec_residuals[18].residual); + ck_assert_msg(check_msg->stec_residuals[18].sv_id.constellation == 69, + "incorrect value for stec_residuals[18].sv_id.constellation, " + "expected 69, is %d", + check_msg->stec_residuals[18].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[18].sv_id.satId == 117, + "incorrect value for stec_residuals[18].sv_id.satId, " + "expected 117, is %d", + check_msg->stec_residuals[18].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[19].residual == -29440, + "incorrect value for stec_residuals[19].residual, expected " + "-29440, is %d", + check_msg->stec_residuals[19].residual); + ck_assert_msg(check_msg->stec_residuals[19].sv_id.constellation == 56, + "incorrect value for stec_residuals[19].sv_id.constellation, " + "expected 56, is %d", + check_msg->stec_residuals[19].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[19].sv_id.satId == 60, + "incorrect value for stec_residuals[19].sv_id.satId, " + "expected 60, is %d", + check_msg->stec_residuals[19].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[20].residual == -24266, + "incorrect value for stec_residuals[20].residual, expected " + "-24266, is %d", + check_msg->stec_residuals[20].residual); + ck_assert_msg(check_msg->stec_residuals[20].sv_id.constellation == 171, + "incorrect value for stec_residuals[20].sv_id.constellation, " + "expected 171, is %d", + check_msg->stec_residuals[20].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[20].sv_id.satId == 207, + "incorrect value for stec_residuals[20].sv_id.satId, " + "expected 207, is %d", + check_msg->stec_residuals[20].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[21].residual == 22272, + "incorrect value for stec_residuals[21].residual, expected " + "22272, is %d", + check_msg->stec_residuals[21].residual); + ck_assert_msg(check_msg->stec_residuals[21].sv_id.constellation == 61, + "incorrect value for stec_residuals[21].sv_id.constellation, " + "expected 61, is %d", + check_msg->stec_residuals[21].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[21].sv_id.satId == 23, + "incorrect value for stec_residuals[21].sv_id.satId, " + "expected 23, is %d", + check_msg->stec_residuals[21].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[22].residual == 9303, + "incorrect value for stec_residuals[22].residual, expected 9303, is %d", + check_msg->stec_residuals[22].residual); + ck_assert_msg(check_msg->stec_residuals[22].sv_id.constellation == 123, + "incorrect value for stec_residuals[22].sv_id.constellation, " + "expected 123, is %d", + check_msg->stec_residuals[22].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[22].sv_id.satId == 230, + "incorrect value for stec_residuals[22].sv_id.satId, " + "expected 230, is %d", + check_msg->stec_residuals[22].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[23].residual == -23794, + "incorrect value for stec_residuals[23].residual, expected " + "-23794, is %d", + check_msg->stec_residuals[23].residual); + ck_assert_msg(check_msg->stec_residuals[23].sv_id.constellation == 255, + "incorrect value for stec_residuals[23].sv_id.constellation, " + "expected 255, is %d", + check_msg->stec_residuals[23].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[23].sv_id.satId == 184, + "incorrect value for stec_residuals[23].sv_id.satId, " + "expected 184, is %d", + check_msg->stec_residuals[23].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[24].residual == -26837, + "incorrect value for stec_residuals[24].residual, expected " + "-26837, is %d", + check_msg->stec_residuals[24].residual); + ck_assert_msg(check_msg->stec_residuals[24].sv_id.constellation == 224, + "incorrect value for stec_residuals[24].sv_id.constellation, " + "expected 224, is %d", + check_msg->stec_residuals[24].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[24].sv_id.satId == 187, + "incorrect value for stec_residuals[24].sv_id.satId, " + "expected 187, is %d", + check_msg->stec_residuals[24].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[25].residual == 14631, + "incorrect value for stec_residuals[25].residual, expected " + "14631, is %d", + check_msg->stec_residuals[25].residual); + ck_assert_msg(check_msg->stec_residuals[25].sv_id.constellation == 104, + "incorrect value for stec_residuals[25].sv_id.constellation, " + "expected 104, is %d", + check_msg->stec_residuals[25].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[25].sv_id.satId == 151, + "incorrect value for stec_residuals[25].sv_id.satId, " + "expected 151, is %d", + check_msg->stec_residuals[25].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[26].residual == -8144, + "incorrect value for stec_residuals[26].residual, expected " + "-8144, is %d", + check_msg->stec_residuals[26].residual); + ck_assert_msg(check_msg->stec_residuals[26].sv_id.constellation == 54, + "incorrect value for stec_residuals[26].sv_id.constellation, " + "expected 54, is %d", + check_msg->stec_residuals[26].sv_id.constellation); + ck_assert_msg( + check_msg->stec_residuals[26].sv_id.satId == 5, + "incorrect value for stec_residuals[26].sv_id.satId, expected 5, is %d", + check_msg->stec_residuals[26].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[27].residual == 23612, + "incorrect value for stec_residuals[27].residual, expected " + "23612, is %d", + check_msg->stec_residuals[27].residual); + ck_assert_msg(check_msg->stec_residuals[27].sv_id.constellation == 129, + "incorrect value for stec_residuals[27].sv_id.constellation, " + "expected 129, is %d", + check_msg->stec_residuals[27].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[27].sv_id.satId == 181, + "incorrect value for stec_residuals[27].sv_id.satId, " + "expected 181, is %d", + check_msg->stec_residuals[27].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[28].residual == 28013, + "incorrect value for stec_residuals[28].residual, expected " + "28013, is %d", + check_msg->stec_residuals[28].residual); + ck_assert_msg(check_msg->stec_residuals[28].sv_id.constellation == 114, + "incorrect value for stec_residuals[28].sv_id.constellation, " + "expected 114, is %d", + check_msg->stec_residuals[28].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[28].sv_id.satId == 171, + "incorrect value for stec_residuals[28].sv_id.satId, " + "expected 171, is %d", + check_msg->stec_residuals[28].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[29].residual == 2166, + "incorrect value for stec_residuals[29].residual, expected 2166, is %d", + check_msg->stec_residuals[29].residual); + ck_assert_msg(check_msg->stec_residuals[29].sv_id.constellation == 23, + "incorrect value for stec_residuals[29].sv_id.constellation, " + "expected 23, is %d", + check_msg->stec_residuals[29].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[29].sv_id.satId == 12, + "incorrect value for stec_residuals[29].sv_id.satId, " + "expected 12, is %d", + check_msg->stec_residuals[29].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[30].residual == -10186, + "incorrect value for stec_residuals[30].residual, expected " + "-10186, is %d", + check_msg->stec_residuals[30].residual); + ck_assert_msg(check_msg->stec_residuals[30].sv_id.constellation == 159, + "incorrect value for stec_residuals[30].sv_id.constellation, " + "expected 159, is %d", + check_msg->stec_residuals[30].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[30].sv_id.satId == 64, + "incorrect value for stec_residuals[30].sv_id.satId, " + "expected 64, is %d", + check_msg->stec_residuals[30].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[31].residual == 17432, + "incorrect value for stec_residuals[31].residual, expected " + "17432, is %d", + check_msg->stec_residuals[31].residual); + ck_assert_msg(check_msg->stec_residuals[31].sv_id.constellation == 20, + "incorrect value for stec_residuals[31].sv_id.constellation, " + "expected 20, is %d", + check_msg->stec_residuals[31].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[31].sv_id.satId == 33, + "incorrect value for stec_residuals[31].sv_id.satId, " + "expected 33, is %d", + check_msg->stec_residuals[31].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[32].residual == -8666, + "incorrect value for stec_residuals[32].residual, expected " + "-8666, is %d", + check_msg->stec_residuals[32].residual); + ck_assert_msg(check_msg->stec_residuals[32].sv_id.constellation == 36, + "incorrect value for stec_residuals[32].sv_id.constellation, " + "expected 36, is %d", + check_msg->stec_residuals[32].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[32].sv_id.satId == 160, + "incorrect value for stec_residuals[32].sv_id.satId, " + "expected 160, is %d", + check_msg->stec_residuals[32].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[33].residual == 25436, + "incorrect value for stec_residuals[33].residual, expected " + "25436, is %d", + check_msg->stec_residuals[33].residual); + ck_assert_msg(check_msg->stec_residuals[33].sv_id.constellation == 190, + "incorrect value for stec_residuals[33].sv_id.constellation, " + "expected 190, is %d", + check_msg->stec_residuals[33].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[33].sv_id.satId == 145, + "incorrect value for stec_residuals[33].sv_id.satId, " + "expected 145, is %d", + check_msg->stec_residuals[33].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[34].residual == -3864, + "incorrect value for stec_residuals[34].residual, expected " + "-3864, is %d", + check_msg->stec_residuals[34].residual); + ck_assert_msg(check_msg->stec_residuals[34].sv_id.constellation == 159, + "incorrect value for stec_residuals[34].sv_id.constellation, " + "expected 159, is %d", + check_msg->stec_residuals[34].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[34].sv_id.satId == 108, + "incorrect value for stec_residuals[34].sv_id.satId, " + "expected 108, is %d", + check_msg->stec_residuals[34].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[35].residual == 4093, + "incorrect value for stec_residuals[35].residual, expected 4093, is %d", + check_msg->stec_residuals[35].residual); + ck_assert_msg(check_msg->stec_residuals[35].sv_id.constellation == 221, + "incorrect value for stec_residuals[35].sv_id.constellation, " + "expected 221, is %d", + check_msg->stec_residuals[35].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[35].sv_id.satId == 227, + "incorrect value for stec_residuals[35].sv_id.satId, " + "expected 227, is %d", + check_msg->stec_residuals[35].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[36].residual == -18055, + "incorrect value for stec_residuals[36].residual, expected " + "-18055, is %d", + check_msg->stec_residuals[36].residual); + ck_assert_msg(check_msg->stec_residuals[36].sv_id.constellation == 23, + "incorrect value for stec_residuals[36].sv_id.constellation, " + "expected 23, is %d", + check_msg->stec_residuals[36].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[36].sv_id.satId == 62, + "incorrect value for stec_residuals[36].sv_id.satId, " + "expected 62, is %d", + check_msg->stec_residuals[36].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[37].residual == -27900, + "incorrect value for stec_residuals[37].residual, expected " + "-27900, is %d", + check_msg->stec_residuals[37].residual); + ck_assert_msg(check_msg->stec_residuals[37].sv_id.constellation == 116, + "incorrect value for stec_residuals[37].sv_id.constellation, " + "expected 116, is %d", + check_msg->stec_residuals[37].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[37].sv_id.satId == 168, + "incorrect value for stec_residuals[37].sv_id.satId, " + "expected 168, is %d", + check_msg->stec_residuals[37].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[38].residual == 30687, + "incorrect value for stec_residuals[38].residual, expected " + "30687, is %d", + check_msg->stec_residuals[38].residual); + ck_assert_msg(check_msg->stec_residuals[38].sv_id.constellation == 72, + "incorrect value for stec_residuals[38].sv_id.constellation, " + "expected 72, is %d", + check_msg->stec_residuals[38].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[38].sv_id.satId == 123, + "incorrect value for stec_residuals[38].sv_id.satId, " + "expected 123, is %d", + check_msg->stec_residuals[38].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[39].residual == -13151, + "incorrect value for stec_residuals[39].residual, expected " + "-13151, is %d", + check_msg->stec_residuals[39].residual); + ck_assert_msg(check_msg->stec_residuals[39].sv_id.constellation == 242, + "incorrect value for stec_residuals[39].sv_id.constellation, " + "expected 242, is %d", + check_msg->stec_residuals[39].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[39].sv_id.satId == 226, + "incorrect value for stec_residuals[39].sv_id.satId, " + "expected 226, is %d", + check_msg->stec_residuals[39].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[40].residual == -22903, + "incorrect value for stec_residuals[40].residual, expected " + "-22903, is %d", + check_msg->stec_residuals[40].residual); + ck_assert_msg(check_msg->stec_residuals[40].sv_id.constellation == 202, + "incorrect value for stec_residuals[40].sv_id.constellation, " + "expected 202, is %d", + check_msg->stec_residuals[40].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[40].sv_id.satId == 180, + "incorrect value for stec_residuals[40].sv_id.satId, " + "expected 180, is %d", + check_msg->stec_residuals[40].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[41].residual == 4988, + "incorrect value for stec_residuals[41].residual, expected 4988, is %d", + check_msg->stec_residuals[41].residual); + ck_assert_msg(check_msg->stec_residuals[41].sv_id.constellation == 24, + "incorrect value for stec_residuals[41].sv_id.constellation, " + "expected 24, is %d", + check_msg->stec_residuals[41].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[41].sv_id.satId == 58, + "incorrect value for stec_residuals[41].sv_id.satId, " + "expected 58, is %d", + check_msg->stec_residuals[41].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[42].residual == 27408, + "incorrect value for stec_residuals[42].residual, expected " + "27408, is %d", + check_msg->stec_residuals[42].residual); + ck_assert_msg(check_msg->stec_residuals[42].sv_id.constellation == 188, + "incorrect value for stec_residuals[42].sv_id.constellation, " + "expected 188, is %d", + check_msg->stec_residuals[42].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[42].sv_id.satId == 181, + "incorrect value for stec_residuals[42].sv_id.satId, " + "expected 181, is %d", + check_msg->stec_residuals[42].sv_id.satId); + ck_assert_msg( + check_msg->stec_residuals[43].residual == 319, + "incorrect value for stec_residuals[43].residual, expected 319, is %d", + check_msg->stec_residuals[43].residual); + ck_assert_msg(check_msg->stec_residuals[43].sv_id.constellation == 231, + "incorrect value for stec_residuals[43].sv_id.constellation, " + "expected 231, is %d", + check_msg->stec_residuals[43].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[43].sv_id.satId == 66, + "incorrect value for stec_residuals[43].sv_id.satId, " + "expected 66, is %d", + check_msg->stec_residuals[43].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[44].residual == 15987, + "incorrect value for stec_residuals[44].residual, expected " + "15987, is %d", + check_msg->stec_residuals[44].residual); + ck_assert_msg(check_msg->stec_residuals[44].sv_id.constellation == 252, + "incorrect value for stec_residuals[44].sv_id.constellation, " + "expected 252, is %d", + check_msg->stec_residuals[44].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[44].sv_id.satId == 64, + "incorrect value for stec_residuals[44].sv_id.satId, " + "expected 64, is %d", + check_msg->stec_residuals[44].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[45].residual == 22266, + "incorrect value for stec_residuals[45].residual, expected " + "22266, is %d", + check_msg->stec_residuals[45].residual); + ck_assert_msg(check_msg->stec_residuals[45].sv_id.constellation == 97, + "incorrect value for stec_residuals[45].sv_id.constellation, " + "expected 97, is %d", + check_msg->stec_residuals[45].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[45].sv_id.satId == 233, + "incorrect value for stec_residuals[45].sv_id.satId, " + "expected 233, is %d", + check_msg->stec_residuals[45].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[46].residual == -19919, + "incorrect value for stec_residuals[46].residual, expected " + "-19919, is %d", + check_msg->stec_residuals[46].residual); + ck_assert_msg(check_msg->stec_residuals[46].sv_id.constellation == 221, + "incorrect value for stec_residuals[46].sv_id.constellation, " + "expected 221, is %d", + check_msg->stec_residuals[46].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[46].sv_id.satId == 156, + "incorrect value for stec_residuals[46].sv_id.satId, " + "expected 156, is %d", + check_msg->stec_residuals[46].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[47].residual == 17350, + "incorrect value for stec_residuals[47].residual, expected " + "17350, is %d", + check_msg->stec_residuals[47].residual); + ck_assert_msg(check_msg->stec_residuals[47].sv_id.constellation == 73, + "incorrect value for stec_residuals[47].sv_id.constellation, " + "expected 73, is %d", + check_msg->stec_residuals[47].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[47].sv_id.satId == 32, + "incorrect value for stec_residuals[47].sv_id.satId, " + "expected 32, is %d", + check_msg->stec_residuals[47].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[48].residual == 14410, + "incorrect value for stec_residuals[48].residual, expected " + "14410, is %d", + check_msg->stec_residuals[48].residual); + ck_assert_msg(check_msg->stec_residuals[48].sv_id.constellation == 253, + "incorrect value for stec_residuals[48].sv_id.constellation, " + "expected 253, is %d", + check_msg->stec_residuals[48].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[48].sv_id.satId == 249, + "incorrect value for stec_residuals[48].sv_id.satId, " + "expected 249, is %d", + check_msg->stec_residuals[48].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[49].residual == 23671, + "incorrect value for stec_residuals[49].residual, expected " + "23671, is %d", + check_msg->stec_residuals[49].residual); + ck_assert_msg(check_msg->stec_residuals[49].sv_id.constellation == 165, + "incorrect value for stec_residuals[49].sv_id.constellation, " + "expected 165, is %d", + check_msg->stec_residuals[49].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[49].sv_id.satId == 38, + "incorrect value for stec_residuals[49].sv_id.satId, " + "expected 38, is %d", + check_msg->stec_residuals[49].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[50].residual == -31905, + "incorrect value for stec_residuals[50].residual, expected " + "-31905, is %d", + check_msg->stec_residuals[50].residual); + ck_assert_msg(check_msg->stec_residuals[50].sv_id.constellation == 44, + "incorrect value for stec_residuals[50].sv_id.constellation, " + "expected 44, is %d", + check_msg->stec_residuals[50].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[50].sv_id.satId == 99, + "incorrect value for stec_residuals[50].sv_id.satId, " + "expected 99, is %d", + check_msg->stec_residuals[50].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[51].residual == 14305, + "incorrect value for stec_residuals[51].residual, expected " + "14305, is %d", + check_msg->stec_residuals[51].residual); + ck_assert_msg(check_msg->stec_residuals[51].sv_id.constellation == 192, + "incorrect value for stec_residuals[51].sv_id.constellation, " + "expected 192, is %d", + check_msg->stec_residuals[51].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[51].sv_id.satId == 89, + "incorrect value for stec_residuals[51].sv_id.satId, " + "expected 89, is %d", + check_msg->stec_residuals[51].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[52].residual == -12968, + "incorrect value for stec_residuals[52].residual, expected " + "-12968, is %d", + check_msg->stec_residuals[52].residual); + ck_assert_msg(check_msg->stec_residuals[52].sv_id.constellation == 171, + "incorrect value for stec_residuals[52].sv_id.constellation, " + "expected 171, is %d", + check_msg->stec_residuals[52].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[52].sv_id.satId == 95, + "incorrect value for stec_residuals[52].sv_id.satId, " + "expected 95, is %d", + check_msg->stec_residuals[52].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[53].residual == 21479, + "incorrect value for stec_residuals[53].residual, expected " + "21479, is %d", + check_msg->stec_residuals[53].residual); + ck_assert_msg(check_msg->stec_residuals[53].sv_id.constellation == 116, + "incorrect value for stec_residuals[53].sv_id.constellation, " + "expected 116, is %d", + check_msg->stec_residuals[53].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[53].sv_id.satId == 21, + "incorrect value for stec_residuals[53].sv_id.satId, " + "expected 21, is %d", + check_msg->stec_residuals[53].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[54].residual == 28260, + "incorrect value for stec_residuals[54].residual, expected " + "28260, is %d", + check_msg->stec_residuals[54].residual); + ck_assert_msg(check_msg->stec_residuals[54].sv_id.constellation == 71, + "incorrect value for stec_residuals[54].sv_id.constellation, " + "expected 71, is %d", + check_msg->stec_residuals[54].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[54].sv_id.satId == 71, + "incorrect value for stec_residuals[54].sv_id.satId, " + "expected 71, is %d", + check_msg->stec_residuals[54].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[55].residual == -11112, + "incorrect value for stec_residuals[55].residual, expected " + "-11112, is %d", + check_msg->stec_residuals[55].residual); + ck_assert_msg(check_msg->stec_residuals[55].sv_id.constellation == 254, + "incorrect value for stec_residuals[55].sv_id.constellation, " + "expected 254, is %d", + check_msg->stec_residuals[55].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[55].sv_id.satId == 217, + "incorrect value for stec_residuals[55].sv_id.satId, " + "expected 217, is %d", + check_msg->stec_residuals[55].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[56].residual == -25304, + "incorrect value for stec_residuals[56].residual, expected " + "-25304, is %d", + check_msg->stec_residuals[56].residual); + ck_assert_msg(check_msg->stec_residuals[56].sv_id.constellation == 8, + "incorrect value for stec_residuals[56].sv_id.constellation, " + "expected 8, is %d", + check_msg->stec_residuals[56].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[56].sv_id.satId == 18, + "incorrect value for stec_residuals[56].sv_id.satId, " + "expected 18, is %d", + check_msg->stec_residuals[56].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[57].residual == -4024, + "incorrect value for stec_residuals[57].residual, expected " + "-4024, is %d", + check_msg->stec_residuals[57].residual); + ck_assert_msg(check_msg->stec_residuals[57].sv_id.constellation == 54, + "incorrect value for stec_residuals[57].sv_id.constellation, " + "expected 54, is %d", + check_msg->stec_residuals[57].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[57].sv_id.satId == 244, + "incorrect value for stec_residuals[57].sv_id.satId, " + "expected 244, is %d", + check_msg->stec_residuals[57].sv_id.satId); + ck_assert_msg(check_msg->stec_residuals[58].residual == -15505, + "incorrect value for stec_residuals[58].residual, expected " + "-15505, is %d", + check_msg->stec_residuals[58].residual); + ck_assert_msg(check_msg->stec_residuals[58].sv_id.constellation == 189, + "incorrect value for stec_residuals[58].sv_id.constellation, " + "expected 189, is %d", + check_msg->stec_residuals[58].sv_id.constellation); + ck_assert_msg(check_msg->stec_residuals[58].sv_id.satId == 231, + "incorrect value for stec_residuals[58].sv_id.satId, " + "expected 231, is %d", + check_msg->stec_residuals[58].sv_id.satId); + ck_assert_msg(check_msg->tropo_delay_correction.hydro == 16250, + "incorrect value for tropo_delay_correction.hydro, expected " + "16250, is %d", + check_msg->tropo_delay_correction.hydro); + ck_assert_msg( + check_msg->tropo_delay_correction.wet == 101, + "incorrect value for tropo_delay_correction.wet, expected 101, is %d", + check_msg->tropo_delay_correction.wet); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA); +Suite *legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_" + "MsgSsrGriddedCorrectionNoStdDepA"); + tcase_add_test( + tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClock.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClock.c index d7b4cd1ee..a41c5ed59 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClock.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClock.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClock.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClock.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClock ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClock) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClock ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,25 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClock ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x5dd, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x5dd, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x5dd, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x5dd, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,221,5,53,229,50,83,208,102,207,164,29,203,212,236,255,152,233,207,55,94,54,58,128,68,27,117,176,110,251,61,244,122,50,95,52,144,232,24,10,37,127,163,66,177,105,156,245,10,249,107,218,17,186,56,72,14,22, }; + u8 encoded_frame[] = { + 85, 221, 5, 53, 229, 50, 83, 208, 102, 207, 164, 29, + 203, 212, 236, 255, 152, 233, 207, 55, 94, 54, 58, 128, + 68, 27, 117, 176, 110, 251, 61, 244, 122, 50, 95, 52, + 144, 232, 24, 10, 37, 127, 163, 66, 177, 105, 156, 245, + 10, 249, 107, 218, 17, 186, 56, 72, 14, 22, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_orbit_clock_t* test_msg = ( msg_ssr_orbit_clock_t* )test_msg_storage; + msg_ssr_orbit_clock_t *test_msg = (msg_ssr_orbit_clock_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->along = -1334502588; test_msg->c0 = -174298703; @@ -159,78 +164,118 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClock ) test_msg->time.tow = 3479621715; test_msg->time.wn = 7588; test_msg->update_interval = 236; - sbp_payload_send(&sbp_state, 0x5dd, 58677, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x5dd, 58677, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 58677, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 58677, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x5dd, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_orbit_clock_t* check_msg = ( msg_ssr_orbit_clock_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_orbit_clock_t *check_msg = + (msg_ssr_orbit_clock_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->along == -1334502588, "incorrect value for along, expected -1334502588, is %d", check_msg->along); - ck_assert_msg(check_msg->c0 == -174298703, "incorrect value for c0, expected -174298703, is %d", check_msg->c0); - ck_assert_msg(check_msg->c1 == -630458102, "incorrect value for c1, expected -630458102, is %d", check_msg->c1); - ck_assert_msg(check_msg->c2 == 1211677201, "incorrect value for c2, expected 1211677201, is %d", check_msg->c2); - ck_assert_msg(check_msg->cross == -197264530, "incorrect value for cross, expected -197264530, is %d", check_msg->cross); - ck_assert_msg(check_msg->dot_along == 169404560, "incorrect value for dot_along, expected 169404560, is %d", check_msg->dot_along); - ck_assert_msg(check_msg->dot_cross == 1118011173, "incorrect value for dot_cross, expected 1118011173, is %d", check_msg->dot_cross); - ck_assert_msg(check_msg->dot_radial == 878654074, "incorrect value for dot_radial, expected 878654074, is %d", check_msg->dot_radial); - ck_assert_msg(check_msg->iod == 936372632, "incorrect value for iod, expected 936372632, is %d", check_msg->iod); - ck_assert_msg(check_msg->iod_ssr == 255, "incorrect value for iod_ssr, expected 255, is %d", check_msg->iod_ssr); - ck_assert_msg(check_msg->radial == -2143668642, "incorrect value for radial, expected -2143668642, is %d", check_msg->radial); - ck_assert_msg(check_msg->sid.code == 212, "incorrect value for sid.code, expected 212, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.sat == 203, "incorrect value for sid.sat, expected 203, is %d", check_msg->sid.sat); - ck_assert_msg(check_msg->time.tow == 3479621715, "incorrect value for time.tow, expected 3479621715, is %d", check_msg->time.tow); - ck_assert_msg(check_msg->time.wn == 7588, "incorrect value for time.wn, expected 7588, is %d", check_msg->time.wn); - ck_assert_msg(check_msg->update_interval == 236, "incorrect value for update_interval, expected 236, is %d", check_msg->update_interval); + ck_assert_msg(check_msg->along == -1334502588, + "incorrect value for along, expected -1334502588, is %d", + check_msg->along); + ck_assert_msg(check_msg->c0 == -174298703, + "incorrect value for c0, expected -174298703, is %d", + check_msg->c0); + ck_assert_msg(check_msg->c1 == -630458102, + "incorrect value for c1, expected -630458102, is %d", + check_msg->c1); + ck_assert_msg(check_msg->c2 == 1211677201, + "incorrect value for c2, expected 1211677201, is %d", + check_msg->c2); + ck_assert_msg(check_msg->cross == -197264530, + "incorrect value for cross, expected -197264530, is %d", + check_msg->cross); + ck_assert_msg(check_msg->dot_along == 169404560, + "incorrect value for dot_along, expected 169404560, is %d", + check_msg->dot_along); + ck_assert_msg(check_msg->dot_cross == 1118011173, + "incorrect value for dot_cross, expected 1118011173, is %d", + check_msg->dot_cross); + ck_assert_msg(check_msg->dot_radial == 878654074, + "incorrect value for dot_radial, expected 878654074, is %d", + check_msg->dot_radial); + ck_assert_msg(check_msg->iod == 936372632, + "incorrect value for iod, expected 936372632, is %d", + check_msg->iod); + ck_assert_msg(check_msg->iod_ssr == 255, + "incorrect value for iod_ssr, expected 255, is %d", + check_msg->iod_ssr); + ck_assert_msg(check_msg->radial == -2143668642, + "incorrect value for radial, expected -2143668642, is %d", + check_msg->radial); + ck_assert_msg(check_msg->sid.code == 212, + "incorrect value for sid.code, expected 212, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.sat == 203, + "incorrect value for sid.sat, expected 203, is %d", + check_msg->sid.sat); + ck_assert_msg(check_msg->time.tow == 3479621715, + "incorrect value for time.tow, expected 3479621715, is %d", + check_msg->time.tow); + ck_assert_msg(check_msg->time.wn == 7588, + "incorrect value for time.wn, expected 7588, is %d", + check_msg->time.wn); + ck_assert_msg(check_msg->update_interval == 236, + "incorrect value for update_interval, expected 236, is %d", + check_msg->update_interval); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrOrbitClock_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrOrbitClock"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrOrbitClock"); +Suite *legacy_auto_check_sbp_ssr_MsgSsrOrbitClock_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrOrbitClock"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrOrbitClock"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClock); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.c index 3256db75b..198c564b3 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBounds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBounds.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,24 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 1502, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 1502, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 1502, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 1502, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,222,5,66,0,31,180,0,0,0,3,0,1,2,3,48,15,1,2,24,39,38,37,1,2,3,39,1,3,39,38,37,1,2,3,39,1,21,85, }; + u8 encoded_frame[] = { + 85, 222, 5, 66, 0, 31, 180, 0, 0, 0, 3, 0, 1, + 2, 3, 48, 15, 1, 2, 24, 39, 38, 37, 1, 2, 3, + 39, 1, 3, 39, 38, 37, 1, 2, 3, 39, 1, 21, 85, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_orbit_clock_bounds_t* test_msg = ( msg_ssr_orbit_clock_bounds_t* )test_msg_storage; + msg_ssr_orbit_clock_bounds_t *test_msg = + (msg_ssr_orbit_clock_bounds_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->const_id = 1; test_msg->header.num_msgs = 1; @@ -178,89 +182,183 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds ) test_msg->orbit_clock_bounds[1].orb_radial_bound_sig = 1; test_msg->orbit_clock_bounds[1].sat_id = 3; test_msg->ssr_iod = 15; - sbp_payload_send(&sbp_state, 1502, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 1502, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 1502, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_orbit_clock_bounds_t* check_msg = ( msg_ssr_orbit_clock_bounds_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_orbit_clock_bounds_t *check_msg = + (msg_ssr_orbit_clock_bounds_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->const_id == 1, "incorrect value for const_id, expected 1, is %d", check_msg->const_id); - ck_assert_msg(check_msg->header.num_msgs == 1, "incorrect value for header.num_msgs, expected 1, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.seq_num == 2, "incorrect value for header.seq_num, expected 2, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->header.sol_id == 48, "incorrect value for header.sol_id, expected 48, is %d", check_msg->header.sol_id); - ck_assert_msg(check_msg->header.time.tow == 180, "incorrect value for header.time.tow, expected 180, is %d", check_msg->header.time.tow); - ck_assert_msg(check_msg->header.time.wn == 3, "incorrect value for header.time.wn, expected 3, is %d", check_msg->header.time.wn); - ck_assert_msg(check_msg->header.update_interval == 3, "incorrect value for header.update_interval, expected 3, is %d", check_msg->header.update_interval); - ck_assert_msg(check_msg->n_sats == 2, "incorrect value for n_sats, expected 2, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->orbit_clock_bounds[0].clock_bound_mu == 39, "incorrect value for orbit_clock_bounds[0].clock_bound_mu, expected 39, is %d", check_msg->orbit_clock_bounds[0].clock_bound_mu); - ck_assert_msg(check_msg->orbit_clock_bounds[0].clock_bound_sig == 1, "incorrect value for orbit_clock_bounds[0].clock_bound_sig, expected 1, is %d", check_msg->orbit_clock_bounds[0].clock_bound_sig); - ck_assert_msg(check_msg->orbit_clock_bounds[0].orb_along_bound_mu == 38, "incorrect value for orbit_clock_bounds[0].orb_along_bound_mu, expected 38, is %d", check_msg->orbit_clock_bounds[0].orb_along_bound_mu); - ck_assert_msg(check_msg->orbit_clock_bounds[0].orb_along_bound_sig == 2, "incorrect value for orbit_clock_bounds[0].orb_along_bound_sig, expected 2, is %d", check_msg->orbit_clock_bounds[0].orb_along_bound_sig); - ck_assert_msg(check_msg->orbit_clock_bounds[0].orb_cross_bound_mu == 37, "incorrect value for orbit_clock_bounds[0].orb_cross_bound_mu, expected 37, is %d", check_msg->orbit_clock_bounds[0].orb_cross_bound_mu); - ck_assert_msg(check_msg->orbit_clock_bounds[0].orb_cross_bound_sig == 3, "incorrect value for orbit_clock_bounds[0].orb_cross_bound_sig, expected 3, is %d", check_msg->orbit_clock_bounds[0].orb_cross_bound_sig); - ck_assert_msg(check_msg->orbit_clock_bounds[0].orb_radial_bound_mu == 39, "incorrect value for orbit_clock_bounds[0].orb_radial_bound_mu, expected 39, is %d", check_msg->orbit_clock_bounds[0].orb_radial_bound_mu); - ck_assert_msg(check_msg->orbit_clock_bounds[0].orb_radial_bound_sig == 1, "incorrect value for orbit_clock_bounds[0].orb_radial_bound_sig, expected 1, is %d", check_msg->orbit_clock_bounds[0].orb_radial_bound_sig); - ck_assert_msg(check_msg->orbit_clock_bounds[0].sat_id == 24, "incorrect value for orbit_clock_bounds[0].sat_id, expected 24, is %d", check_msg->orbit_clock_bounds[0].sat_id); - ck_assert_msg(check_msg->orbit_clock_bounds[1].clock_bound_mu == 39, "incorrect value for orbit_clock_bounds[1].clock_bound_mu, expected 39, is %d", check_msg->orbit_clock_bounds[1].clock_bound_mu); - ck_assert_msg(check_msg->orbit_clock_bounds[1].clock_bound_sig == 1, "incorrect value for orbit_clock_bounds[1].clock_bound_sig, expected 1, is %d", check_msg->orbit_clock_bounds[1].clock_bound_sig); - ck_assert_msg(check_msg->orbit_clock_bounds[1].orb_along_bound_mu == 38, "incorrect value for orbit_clock_bounds[1].orb_along_bound_mu, expected 38, is %d", check_msg->orbit_clock_bounds[1].orb_along_bound_mu); - ck_assert_msg(check_msg->orbit_clock_bounds[1].orb_along_bound_sig == 2, "incorrect value for orbit_clock_bounds[1].orb_along_bound_sig, expected 2, is %d", check_msg->orbit_clock_bounds[1].orb_along_bound_sig); - ck_assert_msg(check_msg->orbit_clock_bounds[1].orb_cross_bound_mu == 37, "incorrect value for orbit_clock_bounds[1].orb_cross_bound_mu, expected 37, is %d", check_msg->orbit_clock_bounds[1].orb_cross_bound_mu); - ck_assert_msg(check_msg->orbit_clock_bounds[1].orb_cross_bound_sig == 3, "incorrect value for orbit_clock_bounds[1].orb_cross_bound_sig, expected 3, is %d", check_msg->orbit_clock_bounds[1].orb_cross_bound_sig); - ck_assert_msg(check_msg->orbit_clock_bounds[1].orb_radial_bound_mu == 39, "incorrect value for orbit_clock_bounds[1].orb_radial_bound_mu, expected 39, is %d", check_msg->orbit_clock_bounds[1].orb_radial_bound_mu); - ck_assert_msg(check_msg->orbit_clock_bounds[1].orb_radial_bound_sig == 1, "incorrect value for orbit_clock_bounds[1].orb_radial_bound_sig, expected 1, is %d", check_msg->orbit_clock_bounds[1].orb_radial_bound_sig); - ck_assert_msg(check_msg->orbit_clock_bounds[1].sat_id == 3, "incorrect value for orbit_clock_bounds[1].sat_id, expected 3, is %d", check_msg->orbit_clock_bounds[1].sat_id); - ck_assert_msg(check_msg->ssr_iod == 15, "incorrect value for ssr_iod, expected 15, is %d", check_msg->ssr_iod); + ck_assert_msg(check_msg->const_id == 1, + "incorrect value for const_id, expected 1, is %d", + check_msg->const_id); + ck_assert_msg(check_msg->header.num_msgs == 1, + "incorrect value for header.num_msgs, expected 1, is %d", + check_msg->header.num_msgs); + ck_assert_msg(check_msg->header.seq_num == 2, + "incorrect value for header.seq_num, expected 2, is %d", + check_msg->header.seq_num); + ck_assert_msg(check_msg->header.sol_id == 48, + "incorrect value for header.sol_id, expected 48, is %d", + check_msg->header.sol_id); + ck_assert_msg(check_msg->header.time.tow == 180, + "incorrect value for header.time.tow, expected 180, is %d", + check_msg->header.time.tow); + ck_assert_msg(check_msg->header.time.wn == 3, + "incorrect value for header.time.wn, expected 3, is %d", + check_msg->header.time.wn); + ck_assert_msg( + check_msg->header.update_interval == 3, + "incorrect value for header.update_interval, expected 3, is %d", + check_msg->header.update_interval); + ck_assert_msg(check_msg->n_sats == 2, + "incorrect value for n_sats, expected 2, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->orbit_clock_bounds[0].clock_bound_mu == 39, + "incorrect value for orbit_clock_bounds[0].clock_bound_mu, " + "expected 39, is %d", + check_msg->orbit_clock_bounds[0].clock_bound_mu); + ck_assert_msg(check_msg->orbit_clock_bounds[0].clock_bound_sig == 1, + "incorrect value for orbit_clock_bounds[0].clock_bound_sig, " + "expected 1, is %d", + check_msg->orbit_clock_bounds[0].clock_bound_sig); + ck_assert_msg( + check_msg->orbit_clock_bounds[0].orb_along_bound_mu == 38, + "incorrect value for orbit_clock_bounds[0].orb_along_bound_mu, " + "expected 38, is %d", + check_msg->orbit_clock_bounds[0].orb_along_bound_mu); + ck_assert_msg( + check_msg->orbit_clock_bounds[0].orb_along_bound_sig == 2, + "incorrect value for orbit_clock_bounds[0].orb_along_bound_sig, " + "expected 2, is %d", + check_msg->orbit_clock_bounds[0].orb_along_bound_sig); + ck_assert_msg( + check_msg->orbit_clock_bounds[0].orb_cross_bound_mu == 37, + "incorrect value for orbit_clock_bounds[0].orb_cross_bound_mu, " + "expected 37, is %d", + check_msg->orbit_clock_bounds[0].orb_cross_bound_mu); + ck_assert_msg( + check_msg->orbit_clock_bounds[0].orb_cross_bound_sig == 3, + "incorrect value for orbit_clock_bounds[0].orb_cross_bound_sig, " + "expected 3, is %d", + check_msg->orbit_clock_bounds[0].orb_cross_bound_sig); + ck_assert_msg( + check_msg->orbit_clock_bounds[0].orb_radial_bound_mu == 39, + "incorrect value for orbit_clock_bounds[0].orb_radial_bound_mu, " + "expected 39, is %d", + check_msg->orbit_clock_bounds[0].orb_radial_bound_mu); + ck_assert_msg( + check_msg->orbit_clock_bounds[0].orb_radial_bound_sig == 1, + "incorrect value for orbit_clock_bounds[0].orb_radial_bound_sig, " + "expected 1, is %d", + check_msg->orbit_clock_bounds[0].orb_radial_bound_sig); + ck_assert_msg( + check_msg->orbit_clock_bounds[0].sat_id == 24, + "incorrect value for orbit_clock_bounds[0].sat_id, expected 24, is %d", + check_msg->orbit_clock_bounds[0].sat_id); + ck_assert_msg(check_msg->orbit_clock_bounds[1].clock_bound_mu == 39, + "incorrect value for orbit_clock_bounds[1].clock_bound_mu, " + "expected 39, is %d", + check_msg->orbit_clock_bounds[1].clock_bound_mu); + ck_assert_msg(check_msg->orbit_clock_bounds[1].clock_bound_sig == 1, + "incorrect value for orbit_clock_bounds[1].clock_bound_sig, " + "expected 1, is %d", + check_msg->orbit_clock_bounds[1].clock_bound_sig); + ck_assert_msg( + check_msg->orbit_clock_bounds[1].orb_along_bound_mu == 38, + "incorrect value for orbit_clock_bounds[1].orb_along_bound_mu, " + "expected 38, is %d", + check_msg->orbit_clock_bounds[1].orb_along_bound_mu); + ck_assert_msg( + check_msg->orbit_clock_bounds[1].orb_along_bound_sig == 2, + "incorrect value for orbit_clock_bounds[1].orb_along_bound_sig, " + "expected 2, is %d", + check_msg->orbit_clock_bounds[1].orb_along_bound_sig); + ck_assert_msg( + check_msg->orbit_clock_bounds[1].orb_cross_bound_mu == 37, + "incorrect value for orbit_clock_bounds[1].orb_cross_bound_mu, " + "expected 37, is %d", + check_msg->orbit_clock_bounds[1].orb_cross_bound_mu); + ck_assert_msg( + check_msg->orbit_clock_bounds[1].orb_cross_bound_sig == 3, + "incorrect value for orbit_clock_bounds[1].orb_cross_bound_sig, " + "expected 3, is %d", + check_msg->orbit_clock_bounds[1].orb_cross_bound_sig); + ck_assert_msg( + check_msg->orbit_clock_bounds[1].orb_radial_bound_mu == 39, + "incorrect value for orbit_clock_bounds[1].orb_radial_bound_mu, " + "expected 39, is %d", + check_msg->orbit_clock_bounds[1].orb_radial_bound_mu); + ck_assert_msg( + check_msg->orbit_clock_bounds[1].orb_radial_bound_sig == 1, + "incorrect value for orbit_clock_bounds[1].orb_radial_bound_sig, " + "expected 1, is %d", + check_msg->orbit_clock_bounds[1].orb_radial_bound_sig); + ck_assert_msg( + check_msg->orbit_clock_bounds[1].sat_id == 3, + "incorrect value for orbit_clock_bounds[1].sat_id, expected 3, is %d", + check_msg->orbit_clock_bounds[1].sat_id); + ck_assert_msg(check_msg->ssr_iod == 15, + "incorrect value for ssr_iod, expected 15, is %d", + check_msg->ssr_iod); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds"); +Suite *legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.c index e02430a1f..39b12c29d 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBoundsDegradation.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBoundsDegradation.yaml +// by generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,24 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 1503, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 1503, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 1503, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 1503, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,223,5,66,0,28,180,0,0,0,3,0,1,2,3,48,15,1,10,0,0,0,0,0,0,0,200,199,198,197,196,195,194,193,200,117, }; + u8 encoded_frame[] = { + 85, 223, 5, 66, 0, 28, 180, 0, 0, 0, 3, 0, + 1, 2, 3, 48, 15, 1, 10, 0, 0, 0, 0, 0, + 0, 0, 200, 199, 198, 197, 196, 195, 194, 193, 200, 117, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_orbit_clock_bounds_degradation_t* test_msg = ( msg_ssr_orbit_clock_bounds_degradation_t* )test_msg_storage; + msg_ssr_orbit_clock_bounds_degradation_t *test_msg = + (msg_ssr_orbit_clock_bounds_degradation_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->const_id = 1; test_msg->header.num_msgs = 1; @@ -160,80 +164,154 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation ) test_msg->orbit_clock_bounds_degradation.orb_radial_bound_sig_dot = 197; test_msg->sat_bitmask = 10; test_msg->ssr_iod = 15; - sbp_payload_send(&sbp_state, 1503, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 1503, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 1503, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_orbit_clock_bounds_degradation_t* check_msg = ( msg_ssr_orbit_clock_bounds_degradation_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_orbit_clock_bounds_degradation_t *check_msg = + (msg_ssr_orbit_clock_bounds_degradation_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->const_id == 1, "incorrect value for const_id, expected 1, is %d", check_msg->const_id); - ck_assert_msg(check_msg->header.num_msgs == 1, "incorrect value for header.num_msgs, expected 1, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.seq_num == 2, "incorrect value for header.seq_num, expected 2, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->header.sol_id == 48, "incorrect value for header.sol_id, expected 48, is %d", check_msg->header.sol_id); - ck_assert_msg(check_msg->header.time.tow == 180, "incorrect value for header.time.tow, expected 180, is %d", check_msg->header.time.tow); - ck_assert_msg(check_msg->header.time.wn == 3, "incorrect value for header.time.wn, expected 3, is %d", check_msg->header.time.wn); - ck_assert_msg(check_msg->header.update_interval == 3, "incorrect value for header.update_interval, expected 3, is %d", check_msg->header.update_interval); - ck_assert_msg(check_msg->orbit_clock_bounds_degradation.clock_bound_mu_dot == 194, "incorrect value for orbit_clock_bounds_degradation.clock_bound_mu_dot, expected 194, is %d", check_msg->orbit_clock_bounds_degradation.clock_bound_mu_dot); - ck_assert_msg(check_msg->orbit_clock_bounds_degradation.clock_bound_sig_dot == 193, "incorrect value for orbit_clock_bounds_degradation.clock_bound_sig_dot, expected 193, is %d", check_msg->orbit_clock_bounds_degradation.clock_bound_sig_dot); - ck_assert_msg(check_msg->orbit_clock_bounds_degradation.orb_along_bound_mu_dot == 199, "incorrect value for orbit_clock_bounds_degradation.orb_along_bound_mu_dot, expected 199, is %d", check_msg->orbit_clock_bounds_degradation.orb_along_bound_mu_dot); - ck_assert_msg(check_msg->orbit_clock_bounds_degradation.orb_along_bound_sig_dot == 196, "incorrect value for orbit_clock_bounds_degradation.orb_along_bound_sig_dot, expected 196, is %d", check_msg->orbit_clock_bounds_degradation.orb_along_bound_sig_dot); - ck_assert_msg(check_msg->orbit_clock_bounds_degradation.orb_cross_bound_mu_dot == 198, "incorrect value for orbit_clock_bounds_degradation.orb_cross_bound_mu_dot, expected 198, is %d", check_msg->orbit_clock_bounds_degradation.orb_cross_bound_mu_dot); - ck_assert_msg(check_msg->orbit_clock_bounds_degradation.orb_cross_bound_sig_dot == 195, "incorrect value for orbit_clock_bounds_degradation.orb_cross_bound_sig_dot, expected 195, is %d", check_msg->orbit_clock_bounds_degradation.orb_cross_bound_sig_dot); - ck_assert_msg(check_msg->orbit_clock_bounds_degradation.orb_radial_bound_mu_dot == 200, "incorrect value for orbit_clock_bounds_degradation.orb_radial_bound_mu_dot, expected 200, is %d", check_msg->orbit_clock_bounds_degradation.orb_radial_bound_mu_dot); - ck_assert_msg(check_msg->orbit_clock_bounds_degradation.orb_radial_bound_sig_dot == 197, "incorrect value for orbit_clock_bounds_degradation.orb_radial_bound_sig_dot, expected 197, is %d", check_msg->orbit_clock_bounds_degradation.orb_radial_bound_sig_dot); - ck_assert_msg(check_msg->sat_bitmask == 10, "incorrect value for sat_bitmask, expected 10, is %d", check_msg->sat_bitmask); - ck_assert_msg(check_msg->ssr_iod == 15, "incorrect value for ssr_iod, expected 15, is %d", check_msg->ssr_iod); + ck_assert_msg(check_msg->const_id == 1, + "incorrect value for const_id, expected 1, is %d", + check_msg->const_id); + ck_assert_msg(check_msg->header.num_msgs == 1, + "incorrect value for header.num_msgs, expected 1, is %d", + check_msg->header.num_msgs); + ck_assert_msg(check_msg->header.seq_num == 2, + "incorrect value for header.seq_num, expected 2, is %d", + check_msg->header.seq_num); + ck_assert_msg(check_msg->header.sol_id == 48, + "incorrect value for header.sol_id, expected 48, is %d", + check_msg->header.sol_id); + ck_assert_msg(check_msg->header.time.tow == 180, + "incorrect value for header.time.tow, expected 180, is %d", + check_msg->header.time.tow); + ck_assert_msg(check_msg->header.time.wn == 3, + "incorrect value for header.time.wn, expected 3, is %d", + check_msg->header.time.wn); + ck_assert_msg( + check_msg->header.update_interval == 3, + "incorrect value for header.update_interval, expected 3, is %d", + check_msg->header.update_interval); + ck_assert_msg( + check_msg->orbit_clock_bounds_degradation.clock_bound_mu_dot == 194, + "incorrect value for " + "orbit_clock_bounds_degradation.clock_bound_mu_dot, expected 194, is " + "%d", + check_msg->orbit_clock_bounds_degradation.clock_bound_mu_dot); + ck_assert_msg( + check_msg->orbit_clock_bounds_degradation.clock_bound_sig_dot == 193, + "incorrect value for " + "orbit_clock_bounds_degradation.clock_bound_sig_dot, expected 193, is " + "%d", + check_msg->orbit_clock_bounds_degradation.clock_bound_sig_dot); + ck_assert_msg( + check_msg->orbit_clock_bounds_degradation.orb_along_bound_mu_dot == 199, + "incorrect value for " + "orbit_clock_bounds_degradation.orb_along_bound_mu_dot, expected 199, " + "is %d", + check_msg->orbit_clock_bounds_degradation.orb_along_bound_mu_dot); + ck_assert_msg( + check_msg->orbit_clock_bounds_degradation.orb_along_bound_sig_dot == + 196, + "incorrect value for " + "orbit_clock_bounds_degradation.orb_along_bound_sig_dot, expected 196, " + "is %d", + check_msg->orbit_clock_bounds_degradation.orb_along_bound_sig_dot); + ck_assert_msg( + check_msg->orbit_clock_bounds_degradation.orb_cross_bound_mu_dot == 198, + "incorrect value for " + "orbit_clock_bounds_degradation.orb_cross_bound_mu_dot, expected 198, " + "is %d", + check_msg->orbit_clock_bounds_degradation.orb_cross_bound_mu_dot); + ck_assert_msg( + check_msg->orbit_clock_bounds_degradation.orb_cross_bound_sig_dot == + 195, + "incorrect value for " + "orbit_clock_bounds_degradation.orb_cross_bound_sig_dot, expected 195, " + "is %d", + check_msg->orbit_clock_bounds_degradation.orb_cross_bound_sig_dot); + ck_assert_msg( + check_msg->orbit_clock_bounds_degradation.orb_radial_bound_mu_dot == + 200, + "incorrect value for " + "orbit_clock_bounds_degradation.orb_radial_bound_mu_dot, expected 200, " + "is %d", + check_msg->orbit_clock_bounds_degradation.orb_radial_bound_mu_dot); + ck_assert_msg( + check_msg->orbit_clock_bounds_degradation.orb_radial_bound_sig_dot == + 197, + "incorrect value for " + "orbit_clock_bounds_degradation.orb_radial_bound_sig_dot, expected " + "197, is %d", + check_msg->orbit_clock_bounds_degradation.orb_radial_bound_sig_dot); + ck_assert_msg(check_msg->sat_bitmask == 10, + "incorrect value for sat_bitmask, expected 10, is %d", + check_msg->sat_bitmask); + ck_assert_msg(check_msg->ssr_iod == 15, + "incorrect value for ssr_iod, expected 15, is %d", + check_msg->ssr_iod); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation); +Suite *legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_" + "MsgSsrOrbitClockBoundsDegradation"); + tcase_add_test( + tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.c index ae2ce97c2..9372208cc 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,25 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x5dc, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x5dc, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x5dc, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x5dc, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,220,5,33,166,47,225,114,31,189,43,30,1,30,194,211,193,175,161,143,254,56,63,232,7,216,69,1,110,165,124,196,189,27,116,88,4,61,3,151,18,171,147,46,198,85,243,245,225,235,123,181,210,157,252, }; + u8 encoded_frame[] = { + 85, 220, 5, 33, 166, 47, 225, 114, 31, 189, 43, 30, 1, 30, + 194, 211, 193, 175, 161, 143, 254, 56, 63, 232, 7, 216, 69, 1, + 110, 165, 124, 196, 189, 27, 116, 88, 4, 61, 3, 151, 18, 171, + 147, 46, 198, 85, 243, 245, 225, 235, 123, 181, 210, 157, 252, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_orbit_clock_dep_a_t* test_msg = ( msg_ssr_orbit_clock_dep_a_t* )test_msg_storage; + msg_ssr_orbit_clock_dep_a_t *test_msg = + (msg_ssr_orbit_clock_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->along = 132661048; test_msg->c0 = -970026069; @@ -159,78 +164,119 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA ) test_msg->time.tow = 3172954849; test_msg->time.wn = 7723; test_msg->update_interval = 194; - sbp_payload_send(&sbp_state, 0x5dc, 42529, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x5dc, 42529, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 42529, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 42529, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x5dc, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_orbit_clock_dep_a_t* check_msg = ( msg_ssr_orbit_clock_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_orbit_clock_dep_a_t *check_msg = + (msg_ssr_orbit_clock_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->along == 132661048, "incorrect value for along, expected 132661048, is %d", check_msg->along); - ck_assert_msg(check_msg->c0 == -970026069, "incorrect value for c0, expected -970026069, is %d", check_msg->c0); - ck_assert_msg(check_msg->c1 == -503975083, "incorrect value for c1, expected -503975083, is %d", check_msg->c1); - ck_assert_msg(check_msg->c2 == -759858197, "incorrect value for c2, expected -759858197, is %d", check_msg->c2); - ck_assert_msg(check_msg->cross == 1845577176, "incorrect value for cross, expected 1845577176, is %d", check_msg->cross); - ck_assert_msg(check_msg->dot_along == 72905755, "incorrect value for dot_along, expected 72905755, is %d", check_msg->dot_along); - ck_assert_msg(check_msg->dot_cross == 311886653, "incorrect value for dot_cross, expected 311886653, is %d", check_msg->dot_cross); - ck_assert_msg(check_msg->dot_radial == -1111196507, "incorrect value for dot_radial, expected -1111196507, is %d", check_msg->dot_radial); - ck_assert_msg(check_msg->iod == 193, "incorrect value for iod, expected 193, is %d", check_msg->iod); - ck_assert_msg(check_msg->iod_ssr == 211, "incorrect value for iod_ssr, expected 211, is %d", check_msg->iod_ssr); - ck_assert_msg(check_msg->radial == -24141393, "incorrect value for radial, expected -24141393, is %d", check_msg->radial); - ck_assert_msg(check_msg->sid.code == 30, "incorrect value for sid.code, expected 30, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.sat == 1, "incorrect value for sid.sat, expected 1, is %d", check_msg->sid.sat); - ck_assert_msg(check_msg->time.tow == 3172954849, "incorrect value for time.tow, expected 3172954849, is %d", check_msg->time.tow); - ck_assert_msg(check_msg->time.wn == 7723, "incorrect value for time.wn, expected 7723, is %d", check_msg->time.wn); - ck_assert_msg(check_msg->update_interval == 194, "incorrect value for update_interval, expected 194, is %d", check_msg->update_interval); + ck_assert_msg(check_msg->along == 132661048, + "incorrect value for along, expected 132661048, is %d", + check_msg->along); + ck_assert_msg(check_msg->c0 == -970026069, + "incorrect value for c0, expected -970026069, is %d", + check_msg->c0); + ck_assert_msg(check_msg->c1 == -503975083, + "incorrect value for c1, expected -503975083, is %d", + check_msg->c1); + ck_assert_msg(check_msg->c2 == -759858197, + "incorrect value for c2, expected -759858197, is %d", + check_msg->c2); + ck_assert_msg(check_msg->cross == 1845577176, + "incorrect value for cross, expected 1845577176, is %d", + check_msg->cross); + ck_assert_msg(check_msg->dot_along == 72905755, + "incorrect value for dot_along, expected 72905755, is %d", + check_msg->dot_along); + ck_assert_msg(check_msg->dot_cross == 311886653, + "incorrect value for dot_cross, expected 311886653, is %d", + check_msg->dot_cross); + ck_assert_msg(check_msg->dot_radial == -1111196507, + "incorrect value for dot_radial, expected -1111196507, is %d", + check_msg->dot_radial); + ck_assert_msg(check_msg->iod == 193, + "incorrect value for iod, expected 193, is %d", + check_msg->iod); + ck_assert_msg(check_msg->iod_ssr == 211, + "incorrect value for iod_ssr, expected 211, is %d", + check_msg->iod_ssr); + ck_assert_msg(check_msg->radial == -24141393, + "incorrect value for radial, expected -24141393, is %d", + check_msg->radial); + ck_assert_msg(check_msg->sid.code == 30, + "incorrect value for sid.code, expected 30, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.sat == 1, + "incorrect value for sid.sat, expected 1, is %d", + check_msg->sid.sat); + ck_assert_msg(check_msg->time.tow == 3172954849, + "incorrect value for time.tow, expected 3172954849, is %d", + check_msg->time.tow); + ck_assert_msg(check_msg->time.wn == 7723, + "incorrect value for time.wn, expected 7723, is %d", + check_msg->time.wn); + ck_assert_msg(check_msg->update_interval == 194, + "incorrect value for update_interval, expected 194, is %d", + check_msg->update_interval); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA"); +Suite *legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrPhaseBiases.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrPhaseBiases.c index d9f7010e3..a2e0667c0 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrPhaseBiases.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrPhaseBiases.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrPhaseBiases.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrPhaseBiases.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,40 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x5e6, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x5e6, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x5e6, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x5e6, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,230,5,219,206,255,209,154,144,12,213,164,169,82,177,230,98,209,249,22,17,29,250,245,193,219,30,212,177,207,187,33,146,58,204,164,65,114,49,248,52,8,161,44,252,166,168,232,124,134,86,173,241,174,44,142,155,129,143,184,161,211,15,36,189,208,194,221,152,16,203,87,34,188,141,104,189,102,156,252,22,251,136,49,188,157,222,245,49,132,16,34,142,228,85,139,221,197,235,98,74,107,70,36,38,239,251,112,188,124,246,141,164,150,104,7,213,44,21,244,192,4,143,24,42,21,84,136,7,42,118,45,23,174,175,129,54,169,14,213,2,197,98,60,13,207,105,100,129,72,136,240,140,129,9,114,172,151,150,17,210,127,115,151,3,242,254,215,14,5,34,126,2,215,65,38,176,23,210,201,97,36,207,92,224,26,116,155,211,165,47,102,38,67,199,55,117,36,169,33,1,230,201,183,21,42,62,147,173,173,155,98,146,231,167,138,82,167,127,229,1,2,127,237,207,116,90,115,159,3,42,66,145,250,201,7,251,2,75,230,26,213,181,56,64,97,88,255,6,147,16,89,203,27,68,243,230,55,242,167,169,219,240, }; + u8 encoded_frame[] = { + 85, 230, 5, 219, 206, 255, 209, 154, 144, 12, 213, 164, 169, 82, + 177, 230, 98, 209, 249, 22, 17, 29, 250, 245, 193, 219, 30, 212, + 177, 207, 187, 33, 146, 58, 204, 164, 65, 114, 49, 248, 52, 8, + 161, 44, 252, 166, 168, 232, 124, 134, 86, 173, 241, 174, 44, 142, + 155, 129, 143, 184, 161, 211, 15, 36, 189, 208, 194, 221, 152, 16, + 203, 87, 34, 188, 141, 104, 189, 102, 156, 252, 22, 251, 136, 49, + 188, 157, 222, 245, 49, 132, 16, 34, 142, 228, 85, 139, 221, 197, + 235, 98, 74, 107, 70, 36, 38, 239, 251, 112, 188, 124, 246, 141, + 164, 150, 104, 7, 213, 44, 21, 244, 192, 4, 143, 24, 42, 21, + 84, 136, 7, 42, 118, 45, 23, 174, 175, 129, 54, 169, 14, 213, + 2, 197, 98, 60, 13, 207, 105, 100, 129, 72, 136, 240, 140, 129, + 9, 114, 172, 151, 150, 17, 210, 127, 115, 151, 3, 242, 254, 215, + 14, 5, 34, 126, 2, 215, 65, 38, 176, 23, 210, 201, 97, 36, + 207, 92, 224, 26, 116, 155, 211, 165, 47, 102, 38, 67, 199, 55, + 117, 36, 169, 33, 1, 230, 201, 183, 21, 42, 62, 147, 173, 173, + 155, 98, 146, 231, 167, 138, 82, 167, 127, 229, 1, 2, 127, 237, + 207, 116, 90, 115, 159, 3, 42, 66, 145, 250, 201, 7, 251, 2, + 75, 230, 26, 213, 181, 56, 64, 97, 88, 255, 6, 147, 16, 89, + 203, 27, 68, 243, 230, 55, 242, 167, 169, 219, 240, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_phase_biases_t* test_msg = ( msg_ssr_phase_biases_t* )test_msg_storage; + msg_ssr_phase_biases_t *test_msg = + (msg_ssr_phase_biases_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->biases) == 0) { // Cope with variable length arrays @@ -423,222 +443,670 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases ) test_msg->update_interval = 177; test_msg->yaw = 5881; test_msg->yaw_rate = 17; - sbp_payload_send(&sbp_state, 0x5e6, 52955, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x5e6, 52955, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 52955, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 52955, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x5e6, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_phase_biases_t* check_msg = ( msg_ssr_phase_biases_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_phase_biases_t *check_msg = + (msg_ssr_phase_biases_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->biases[0].bias == -1311498533, "incorrect value for biases[0].bias, expected -1311498533, is %d", check_msg->biases[0].bias); - ck_assert_msg(check_msg->biases[0].code == 29, "incorrect value for biases[0].code, expected 29, is %d", check_msg->biases[0].code); - ck_assert_msg(check_msg->biases[0].discontinuity_counter == 193, "incorrect value for biases[0].discontinuity_counter, expected 193, is %d", check_msg->biases[0].discontinuity_counter); - ck_assert_msg(check_msg->biases[0].integer_indicator == 250, "incorrect value for biases[0].integer_indicator, expected 250, is %d", check_msg->biases[0].integer_indicator); - ck_assert_msg(check_msg->biases[0].widelane_integer_indicator == 245, "incorrect value for biases[0].widelane_integer_indicator, expected 245, is %d", check_msg->biases[0].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[1].bias == 1101319226, "incorrect value for biases[1].bias, expected 1101319226, is %d", check_msg->biases[1].bias); - ck_assert_msg(check_msg->biases[1].code == 207, "incorrect value for biases[1].code, expected 207, is %d", check_msg->biases[1].code); - ck_assert_msg(check_msg->biases[1].discontinuity_counter == 146, "incorrect value for biases[1].discontinuity_counter, expected 146, is %d", check_msg->biases[1].discontinuity_counter); - ck_assert_msg(check_msg->biases[1].integer_indicator == 187, "incorrect value for biases[1].integer_indicator, expected 187, is %d", check_msg->biases[1].integer_indicator); - ck_assert_msg(check_msg->biases[1].widelane_integer_indicator == 33, "incorrect value for biases[1].widelane_integer_indicator, expected 33, is %d", check_msg->biases[1].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[2].bias == -64184056, "incorrect value for biases[2].bias, expected -64184056, is %d", check_msg->biases[2].bias); - ck_assert_msg(check_msg->biases[2].code == 114, "incorrect value for biases[2].code, expected 114, is %d", check_msg->biases[2].code); - ck_assert_msg(check_msg->biases[2].discontinuity_counter == 52, "incorrect value for biases[2].discontinuity_counter, expected 52, is %d", check_msg->biases[2].discontinuity_counter); - ck_assert_msg(check_msg->biases[2].integer_indicator == 49, "incorrect value for biases[2].integer_indicator, expected 49, is %d", check_msg->biases[2].integer_indicator); - ck_assert_msg(check_msg->biases[2].widelane_integer_indicator == 248, "incorrect value for biases[2].widelane_integer_indicator, expected 248, is %d", check_msg->biases[2].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[3].bias == -240298362, "incorrect value for biases[3].bias, expected -240298362, is %d", check_msg->biases[3].bias); - ck_assert_msg(check_msg->biases[3].code == 166, "incorrect value for biases[3].code, expected 166, is %d", check_msg->biases[3].code); - ck_assert_msg(check_msg->biases[3].discontinuity_counter == 124, "incorrect value for biases[3].discontinuity_counter, expected 124, is %d", check_msg->biases[3].discontinuity_counter); - ck_assert_msg(check_msg->biases[3].integer_indicator == 168, "incorrect value for biases[3].integer_indicator, expected 168, is %d", check_msg->biases[3].integer_indicator); - ck_assert_msg(check_msg->biases[3].widelane_integer_indicator == 232, "incorrect value for biases[3].widelane_integer_indicator, expected 232, is %d", check_msg->biases[3].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[4].bias == -1581740159, "incorrect value for biases[4].bias, expected -1581740159, is %d", check_msg->biases[4].bias); - ck_assert_msg(check_msg->biases[4].code == 174, "incorrect value for biases[4].code, expected 174, is %d", check_msg->biases[4].code); - ck_assert_msg(check_msg->biases[4].discontinuity_counter == 155, "incorrect value for biases[4].discontinuity_counter, expected 155, is %d", check_msg->biases[4].discontinuity_counter); - ck_assert_msg(check_msg->biases[4].integer_indicator == 44, "incorrect value for biases[4].integer_indicator, expected 44, is %d", check_msg->biases[4].integer_indicator); - ck_assert_msg(check_msg->biases[4].widelane_integer_indicator == 142, "incorrect value for biases[4].widelane_integer_indicator, expected 142, is %d", check_msg->biases[4].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[5].bias == -1730297136, "incorrect value for biases[5].bias, expected -1730297136, is %d", check_msg->biases[5].bias); - ck_assert_msg(check_msg->biases[5].code == 211, "incorrect value for biases[5].code, expected 211, is %d", check_msg->biases[5].code); - ck_assert_msg(check_msg->biases[5].discontinuity_counter == 189, "incorrect value for biases[5].discontinuity_counter, expected 189, is %d", check_msg->biases[5].discontinuity_counter); - ck_assert_msg(check_msg->biases[5].integer_indicator == 15, "incorrect value for biases[5].integer_indicator, expected 15, is %d", check_msg->biases[5].integer_indicator); - ck_assert_msg(check_msg->biases[5].widelane_integer_indicator == 36, "incorrect value for biases[5].widelane_integer_indicator, expected 36, is %d", check_msg->biases[5].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[6].bias == -1117221444, "incorrect value for biases[6].bias, expected -1117221444, is %d", check_msg->biases[6].bias); - ck_assert_msg(check_msg->biases[6].code == 16, "incorrect value for biases[6].code, expected 16, is %d", check_msg->biases[6].code); - ck_assert_msg(check_msg->biases[6].discontinuity_counter == 34, "incorrect value for biases[6].discontinuity_counter, expected 34, is %d", check_msg->biases[6].discontinuity_counter); - ck_assert_msg(check_msg->biases[6].integer_indicator == 203, "incorrect value for biases[6].integer_indicator, expected 203, is %d", check_msg->biases[6].integer_indicator); - ck_assert_msg(check_msg->biases[6].widelane_integer_indicator == 87, "incorrect value for biases[6].widelane_integer_indicator, expected 87, is %d", check_msg->biases[6].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[7].bias == -1137604357, "incorrect value for biases[7].bias, expected -1137604357, is %d", check_msg->biases[7].bias); - ck_assert_msg(check_msg->biases[7].code == 102, "incorrect value for biases[7].code, expected 102, is %d", check_msg->biases[7].code); - ck_assert_msg(check_msg->biases[7].discontinuity_counter == 22, "incorrect value for biases[7].discontinuity_counter, expected 22, is %d", check_msg->biases[7].discontinuity_counter); - ck_assert_msg(check_msg->biases[7].integer_indicator == 156, "incorrect value for biases[7].integer_indicator, expected 156, is %d", check_msg->biases[7].integer_indicator); - ck_assert_msg(check_msg->biases[7].widelane_integer_indicator == 252, "incorrect value for biases[7].widelane_integer_indicator, expected 252, is %d", check_msg->biases[7].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[8].bias == -1910370172, "incorrect value for biases[8].bias, expected -1910370172, is %d", check_msg->biases[8].bias); - ck_assert_msg(check_msg->biases[8].code == 157, "incorrect value for biases[8].code, expected 157, is %d", check_msg->biases[8].code); - ck_assert_msg(check_msg->biases[8].discontinuity_counter == 49, "incorrect value for biases[8].discontinuity_counter, expected 49, is %d", check_msg->biases[8].discontinuity_counter); - ck_assert_msg(check_msg->biases[8].integer_indicator == 222, "incorrect value for biases[8].integer_indicator, expected 222, is %d", check_msg->biases[8].integer_indicator); - ck_assert_msg(check_msg->biases[8].widelane_integer_indicator == 245, "incorrect value for biases[8].widelane_integer_indicator, expected 245, is %d", check_msg->biases[8].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[9].bias == 1247996869, "incorrect value for biases[9].bias, expected 1247996869, is %d", check_msg->biases[9].bias); - ck_assert_msg(check_msg->biases[9].code == 228, "incorrect value for biases[9].code, expected 228, is %d", check_msg->biases[9].code); - ck_assert_msg(check_msg->biases[9].discontinuity_counter == 221, "incorrect value for biases[9].discontinuity_counter, expected 221, is %d", check_msg->biases[9].discontinuity_counter); - ck_assert_msg(check_msg->biases[9].integer_indicator == 85, "incorrect value for biases[9].integer_indicator, expected 85, is %d", check_msg->biases[9].integer_indicator); - ck_assert_msg(check_msg->biases[9].widelane_integer_indicator == 139, "incorrect value for biases[9].widelane_integer_indicator, expected 139, is %d", check_msg->biases[9].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[10].bias == -1133446161, "incorrect value for biases[10].bias, expected -1133446161, is %d", check_msg->biases[10].bias); - ck_assert_msg(check_msg->biases[10].code == 107, "incorrect value for biases[10].code, expected 107, is %d", check_msg->biases[10].code); - ck_assert_msg(check_msg->biases[10].discontinuity_counter == 38, "incorrect value for biases[10].discontinuity_counter, expected 38, is %d", check_msg->biases[10].discontinuity_counter); - ck_assert_msg(check_msg->biases[10].integer_indicator == 70, "incorrect value for biases[10].integer_indicator, expected 70, is %d", check_msg->biases[10].integer_indicator); - ck_assert_msg(check_msg->biases[10].widelane_integer_indicator == 36, "incorrect value for biases[10].widelane_integer_indicator, expected 36, is %d", check_msg->biases[10].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[11].bias == -720934762, "incorrect value for biases[11].bias, expected -720934762, is %d", check_msg->biases[11].bias); - ck_assert_msg(check_msg->biases[11].code == 124, "incorrect value for biases[11].code, expected 124, is %d", check_msg->biases[11].code); - ck_assert_msg(check_msg->biases[11].discontinuity_counter == 164, "incorrect value for biases[11].discontinuity_counter, expected 164, is %d", check_msg->biases[11].discontinuity_counter); - ck_assert_msg(check_msg->biases[11].integer_indicator == 246, "incorrect value for biases[11].integer_indicator, expected 246, is %d", check_msg->biases[11].integer_indicator); - ck_assert_msg(check_msg->biases[11].widelane_integer_indicator == 141, "incorrect value for biases[11].widelane_integer_indicator, expected 141, is %d", check_msg->biases[11].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[12].bias == 706252548, "incorrect value for biases[12].bias, expected 706252548, is %d", check_msg->biases[12].bias); - ck_assert_msg(check_msg->biases[12].code == 44, "incorrect value for biases[12].code, expected 44, is %d", check_msg->biases[12].code); - ck_assert_msg(check_msg->biases[12].discontinuity_counter == 192, "incorrect value for biases[12].discontinuity_counter, expected 192, is %d", check_msg->biases[12].discontinuity_counter); - ck_assert_msg(check_msg->biases[12].integer_indicator == 21, "incorrect value for biases[12].integer_indicator, expected 21, is %d", check_msg->biases[12].integer_indicator); - ck_assert_msg(check_msg->biases[12].widelane_integer_indicator == 244, "incorrect value for biases[12].widelane_integer_indicator, expected 244, is %d", check_msg->biases[12].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[13].bias == 388855338, "incorrect value for biases[13].bias, expected 388855338, is %d", check_msg->biases[13].bias); - ck_assert_msg(check_msg->biases[13].code == 21, "incorrect value for biases[13].code, expected 21, is %d", check_msg->biases[13].code); - ck_assert_msg(check_msg->biases[13].discontinuity_counter == 7, "incorrect value for biases[13].discontinuity_counter, expected 7, is %d", check_msg->biases[13].discontinuity_counter); - ck_assert_msg(check_msg->biases[13].integer_indicator == 84, "incorrect value for biases[13].integer_indicator, expected 84, is %d", check_msg->biases[13].integer_indicator); - ck_assert_msg(check_msg->biases[13].widelane_integer_indicator == 136, "incorrect value for biases[13].widelane_integer_indicator, expected 136, is %d", check_msg->biases[13].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[14].bias == 47517353, "incorrect value for biases[14].bias, expected 47517353, is %d", check_msg->biases[14].bias); - ck_assert_msg(check_msg->biases[14].code == 174, "incorrect value for biases[14].code, expected 174, is %d", check_msg->biases[14].code); - ck_assert_msg(check_msg->biases[14].discontinuity_counter == 54, "incorrect value for biases[14].discontinuity_counter, expected 54, is %d", check_msg->biases[14].discontinuity_counter); - ck_assert_msg(check_msg->biases[14].integer_indicator == 175, "incorrect value for biases[14].integer_indicator, expected 175, is %d", check_msg->biases[14].integer_indicator); - ck_assert_msg(check_msg->biases[14].widelane_integer_indicator == 129, "incorrect value for biases[14].widelane_integer_indicator, expected 129, is %d", check_msg->biases[14].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[15].bias == -2124125745, "incorrect value for biases[15].bias, expected -2124125745, is %d", check_msg->biases[15].bias); - ck_assert_msg(check_msg->biases[15].code == 197, "incorrect value for biases[15].code, expected 197, is %d", check_msg->biases[15].code); - ck_assert_msg(check_msg->biases[15].discontinuity_counter == 13, "incorrect value for biases[15].discontinuity_counter, expected 13, is %d", check_msg->biases[15].discontinuity_counter); - ck_assert_msg(check_msg->biases[15].integer_indicator == 98, "incorrect value for biases[15].integer_indicator, expected 98, is %d", check_msg->biases[15].integer_indicator); - ck_assert_msg(check_msg->biases[15].widelane_integer_indicator == 60, "incorrect value for biases[15].widelane_integer_indicator, expected 60, is %d", check_msg->biases[15].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[16].bias == -1401812607, "incorrect value for biases[16].bias, expected -1401812607, is %d", check_msg->biases[16].bias); - ck_assert_msg(check_msg->biases[16].code == 72, "incorrect value for biases[16].code, expected 72, is %d", check_msg->biases[16].code); - ck_assert_msg(check_msg->biases[16].discontinuity_counter == 140, "incorrect value for biases[16].discontinuity_counter, expected 140, is %d", check_msg->biases[16].discontinuity_counter); - ck_assert_msg(check_msg->biases[16].integer_indicator == 136, "incorrect value for biases[16].integer_indicator, expected 136, is %d", check_msg->biases[16].integer_indicator); - ck_assert_msg(check_msg->biases[16].widelane_integer_indicator == 240, "incorrect value for biases[16].widelane_integer_indicator, expected 240, is %d", check_msg->biases[16].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[17].bias == 60257151, "incorrect value for biases[17].bias, expected 60257151, is %d", check_msg->biases[17].bias); - ck_assert_msg(check_msg->biases[17].code == 151, "incorrect value for biases[17].code, expected 151, is %d", check_msg->biases[17].code); - ck_assert_msg(check_msg->biases[17].discontinuity_counter == 210, "incorrect value for biases[17].discontinuity_counter, expected 210, is %d", check_msg->biases[17].discontinuity_counter); - ck_assert_msg(check_msg->biases[17].integer_indicator == 150, "incorrect value for biases[17].integer_indicator, expected 150, is %d", check_msg->biases[17].integer_indicator); - ck_assert_msg(check_msg->biases[17].widelane_integer_indicator == 17, "incorrect value for biases[17].widelane_integer_indicator, expected 17, is %d", check_msg->biases[17].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[18].bias == 41820677, "incorrect value for biases[18].bias, expected 41820677, is %d", check_msg->biases[18].bias); - ck_assert_msg(check_msg->biases[18].code == 242, "incorrect value for biases[18].code, expected 242, is %d", check_msg->biases[18].code); - ck_assert_msg(check_msg->biases[18].discontinuity_counter == 14, "incorrect value for biases[18].discontinuity_counter, expected 14, is %d", check_msg->biases[18].discontinuity_counter); - ck_assert_msg(check_msg->biases[18].integer_indicator == 254, "incorrect value for biases[18].integer_indicator, expected 254, is %d", check_msg->biases[18].integer_indicator); - ck_assert_msg(check_msg->biases[18].widelane_integer_indicator == 215, "incorrect value for biases[18].widelane_integer_indicator, expected 215, is %d", check_msg->biases[18].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[19].bias == 1640616471, "incorrect value for biases[19].bias, expected 1640616471, is %d", check_msg->biases[19].bias); - ck_assert_msg(check_msg->biases[19].code == 215, "incorrect value for biases[19].code, expected 215, is %d", check_msg->biases[19].code); - ck_assert_msg(check_msg->biases[19].discontinuity_counter == 176, "incorrect value for biases[19].discontinuity_counter, expected 176, is %d", check_msg->biases[19].discontinuity_counter); - ck_assert_msg(check_msg->biases[19].integer_indicator == 65, "incorrect value for biases[19].integer_indicator, expected 65, is %d", check_msg->biases[19].integer_indicator); - ck_assert_msg(check_msg->biases[19].widelane_integer_indicator == 38, "incorrect value for biases[19].widelane_integer_indicator, expected 38, is %d", check_msg->biases[19].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[20].bias == -744786918, "incorrect value for biases[20].bias, expected -744786918, is %d", check_msg->biases[20].bias); - ck_assert_msg(check_msg->biases[20].code == 36, "incorrect value for biases[20].code, expected 36, is %d", check_msg->biases[20].code); - ck_assert_msg(check_msg->biases[20].discontinuity_counter == 224, "incorrect value for biases[20].discontinuity_counter, expected 224, is %d", check_msg->biases[20].discontinuity_counter); - ck_assert_msg(check_msg->biases[20].integer_indicator == 207, "incorrect value for biases[20].integer_indicator, expected 207, is %d", check_msg->biases[20].integer_indicator); - ck_assert_msg(check_msg->biases[20].widelane_integer_indicator == 92, "incorrect value for biases[20].widelane_integer_indicator, expected 92, is %d", check_msg->biases[20].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[21].bias == 1966589763, "incorrect value for biases[21].bias, expected 1966589763, is %d", check_msg->biases[21].bias); - ck_assert_msg(check_msg->biases[21].code == 165, "incorrect value for biases[21].code, expected 165, is %d", check_msg->biases[21].code); - ck_assert_msg(check_msg->biases[21].discontinuity_counter == 38, "incorrect value for biases[21].discontinuity_counter, expected 38, is %d", check_msg->biases[21].discontinuity_counter); - ck_assert_msg(check_msg->biases[21].integer_indicator == 47, "incorrect value for biases[21].integer_indicator, expected 47, is %d", check_msg->biases[21].integer_indicator); - ck_assert_msg(check_msg->biases[21].widelane_integer_indicator == 102, "incorrect value for biases[21].widelane_integer_indicator, expected 102, is %d", check_msg->biases[21].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[22].bias == 364366310, "incorrect value for biases[22].bias, expected 364366310, is %d", check_msg->biases[22].bias); - ck_assert_msg(check_msg->biases[22].code == 36, "incorrect value for biases[22].code, expected 36, is %d", check_msg->biases[22].code); - ck_assert_msg(check_msg->biases[22].discontinuity_counter == 1, "incorrect value for biases[22].discontinuity_counter, expected 1, is %d", check_msg->biases[22].discontinuity_counter); - ck_assert_msg(check_msg->biases[22].integer_indicator == 169, "incorrect value for biases[22].integer_indicator, expected 169, is %d", check_msg->biases[22].integer_indicator); - ck_assert_msg(check_msg->biases[22].widelane_integer_indicator == 33, "incorrect value for biases[22].widelane_integer_indicator, expected 33, is %d", check_msg->biases[22].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[23].bias == -1839031379, "incorrect value for biases[23].bias, expected -1839031379, is %d", check_msg->biases[23].bias); - ck_assert_msg(check_msg->biases[23].code == 42, "incorrect value for biases[23].code, expected 42, is %d", check_msg->biases[23].code); - ck_assert_msg(check_msg->biases[23].discontinuity_counter == 173, "incorrect value for biases[23].discontinuity_counter, expected 173, is %d", check_msg->biases[23].discontinuity_counter); - ck_assert_msg(check_msg->biases[23].integer_indicator == 62, "incorrect value for biases[23].integer_indicator, expected 62, is %d", check_msg->biases[23].integer_indicator); - ck_assert_msg(check_msg->biases[23].widelane_integer_indicator == 147, "incorrect value for biases[23].widelane_integer_indicator, expected 147, is %d", check_msg->biases[23].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[24].bias == 31817639, "incorrect value for biases[24].bias, expected 31817639, is %d", check_msg->biases[24].bias); - ck_assert_msg(check_msg->biases[24].code == 231, "incorrect value for biases[24].code, expected 231, is %d", check_msg->biases[24].code); - ck_assert_msg(check_msg->biases[24].discontinuity_counter == 82, "incorrect value for biases[24].discontinuity_counter, expected 82, is %d", check_msg->biases[24].discontinuity_counter); - ck_assert_msg(check_msg->biases[24].integer_indicator == 167, "incorrect value for biases[24].integer_indicator, expected 167, is %d", check_msg->biases[24].integer_indicator); - ck_assert_msg(check_msg->biases[24].widelane_integer_indicator == 138, "incorrect value for biases[24].widelane_integer_indicator, expected 138, is %d", check_msg->biases[24].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[25].bias == -1619830156, "incorrect value for biases[25].bias, expected -1619830156, is %d", check_msg->biases[25].bias); - ck_assert_msg(check_msg->biases[25].code == 2, "incorrect value for biases[25].code, expected 2, is %d", check_msg->biases[25].code); - ck_assert_msg(check_msg->biases[25].discontinuity_counter == 207, "incorrect value for biases[25].discontinuity_counter, expected 207, is %d", check_msg->biases[25].discontinuity_counter); - ck_assert_msg(check_msg->biases[25].integer_indicator == 127, "incorrect value for biases[25].integer_indicator, expected 127, is %d", check_msg->biases[25].integer_indicator); - ck_assert_msg(check_msg->biases[25].widelane_integer_indicator == 237, "incorrect value for biases[25].widelane_integer_indicator, expected 237, is %d", check_msg->biases[25].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[26].bias == -83375622, "incorrect value for biases[26].bias, expected -83375622, is %d", check_msg->biases[26].bias); - ck_assert_msg(check_msg->biases[26].code == 3, "incorrect value for biases[26].code, expected 3, is %d", check_msg->biases[26].code); - ck_assert_msg(check_msg->biases[26].discontinuity_counter == 145, "incorrect value for biases[26].discontinuity_counter, expected 145, is %d", check_msg->biases[26].discontinuity_counter); - ck_assert_msg(check_msg->biases[26].integer_indicator == 42, "incorrect value for biases[26].integer_indicator, expected 42, is %d", check_msg->biases[26].integer_indicator); - ck_assert_msg(check_msg->biases[26].widelane_integer_indicator == 66, "incorrect value for biases[26].widelane_integer_indicator, expected 66, is %d", check_msg->biases[26].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[27].bias == 1077458389, "incorrect value for biases[27].bias, expected 1077458389, is %d", check_msg->biases[27].bias); - ck_assert_msg(check_msg->biases[27].code == 2, "incorrect value for biases[27].code, expected 2, is %d", check_msg->biases[27].code); - ck_assert_msg(check_msg->biases[27].discontinuity_counter == 26, "incorrect value for biases[27].discontinuity_counter, expected 26, is %d", check_msg->biases[27].discontinuity_counter); - ck_assert_msg(check_msg->biases[27].integer_indicator == 75, "incorrect value for biases[27].integer_indicator, expected 75, is %d", check_msg->biases[27].integer_indicator); - ck_assert_msg(check_msg->biases[27].widelane_integer_indicator == 230, "incorrect value for biases[27].widelane_integer_indicator, expected 230, is %d", check_msg->biases[27].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[28].bias == -883355501, "incorrect value for biases[28].bias, expected -883355501, is %d", check_msg->biases[28].bias); - ck_assert_msg(check_msg->biases[28].code == 97, "incorrect value for biases[28].code, expected 97, is %d", check_msg->biases[28].code); - ck_assert_msg(check_msg->biases[28].discontinuity_counter == 6, "incorrect value for biases[28].discontinuity_counter, expected 6, is %d", check_msg->biases[28].discontinuity_counter); - ck_assert_msg(check_msg->biases[28].integer_indicator == 88, "incorrect value for biases[28].integer_indicator, expected 88, is %d", check_msg->biases[28].integer_indicator); - ck_assert_msg(check_msg->biases[28].widelane_integer_indicator == 255, "incorrect value for biases[28].widelane_integer_indicator, expected 255, is %d", check_msg->biases[28].widelane_integer_indicator); - ck_assert_msg(check_msg->biases[29].bias == -1448611273, "incorrect value for biases[29].bias, expected -1448611273, is %d", check_msg->biases[29].bias); - ck_assert_msg(check_msg->biases[29].code == 27, "incorrect value for biases[29].code, expected 27, is %d", check_msg->biases[29].code); - ck_assert_msg(check_msg->biases[29].discontinuity_counter == 230, "incorrect value for biases[29].discontinuity_counter, expected 230, is %d", check_msg->biases[29].discontinuity_counter); - ck_assert_msg(check_msg->biases[29].integer_indicator == 68, "incorrect value for biases[29].integer_indicator, expected 68, is %d", check_msg->biases[29].integer_indicator); - ck_assert_msg(check_msg->biases[29].widelane_integer_indicator == 243, "incorrect value for biases[29].widelane_integer_indicator, expected 243, is %d", check_msg->biases[29].widelane_integer_indicator); - ck_assert_msg(check_msg->dispersive_bias == 98, "incorrect value for dispersive_bias, expected 98, is %d", check_msg->dispersive_bias); - ck_assert_msg(check_msg->iod_ssr == 230, "incorrect value for iod_ssr, expected 230, is %d", check_msg->iod_ssr); - ck_assert_msg(check_msg->mw_consistency == 209, "incorrect value for mw_consistency, expected 209, is %d", check_msg->mw_consistency); - ck_assert_msg(check_msg->sid.code == 82, "incorrect value for sid.code, expected 82, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.sat == 169, "incorrect value for sid.sat, expected 169, is %d", check_msg->sid.sat); - ck_assert_msg(check_msg->time.tow == 210803409, "incorrect value for time.tow, expected 210803409, is %d", check_msg->time.tow); - ck_assert_msg(check_msg->time.wn == 42197, "incorrect value for time.wn, expected 42197, is %d", check_msg->time.wn); - ck_assert_msg(check_msg->update_interval == 177, "incorrect value for update_interval, expected 177, is %d", check_msg->update_interval); - ck_assert_msg(check_msg->yaw == 5881, "incorrect value for yaw, expected 5881, is %d", check_msg->yaw); - ck_assert_msg(check_msg->yaw_rate == 17, "incorrect value for yaw_rate, expected 17, is %d", check_msg->yaw_rate); + ck_assert_msg( + check_msg->biases[0].bias == -1311498533, + "incorrect value for biases[0].bias, expected -1311498533, is %d", + check_msg->biases[0].bias); + ck_assert_msg(check_msg->biases[0].code == 29, + "incorrect value for biases[0].code, expected 29, is %d", + check_msg->biases[0].code); + ck_assert_msg(check_msg->biases[0].discontinuity_counter == 193, + "incorrect value for biases[0].discontinuity_counter, " + "expected 193, is %d", + check_msg->biases[0].discontinuity_counter); + ck_assert_msg( + check_msg->biases[0].integer_indicator == 250, + "incorrect value for biases[0].integer_indicator, expected 250, is %d", + check_msg->biases[0].integer_indicator); + ck_assert_msg(check_msg->biases[0].widelane_integer_indicator == 245, + "incorrect value for biases[0].widelane_integer_indicator, " + "expected 245, is %d", + check_msg->biases[0].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[1].bias == 1101319226, + "incorrect value for biases[1].bias, expected 1101319226, is %d", + check_msg->biases[1].bias); + ck_assert_msg(check_msg->biases[1].code == 207, + "incorrect value for biases[1].code, expected 207, is %d", + check_msg->biases[1].code); + ck_assert_msg(check_msg->biases[1].discontinuity_counter == 146, + "incorrect value for biases[1].discontinuity_counter, " + "expected 146, is %d", + check_msg->biases[1].discontinuity_counter); + ck_assert_msg( + check_msg->biases[1].integer_indicator == 187, + "incorrect value for biases[1].integer_indicator, expected 187, is %d", + check_msg->biases[1].integer_indicator); + ck_assert_msg(check_msg->biases[1].widelane_integer_indicator == 33, + "incorrect value for biases[1].widelane_integer_indicator, " + "expected 33, is %d", + check_msg->biases[1].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[2].bias == -64184056, + "incorrect value for biases[2].bias, expected -64184056, is %d", + check_msg->biases[2].bias); + ck_assert_msg(check_msg->biases[2].code == 114, + "incorrect value for biases[2].code, expected 114, is %d", + check_msg->biases[2].code); + ck_assert_msg(check_msg->biases[2].discontinuity_counter == 52, + "incorrect value for biases[2].discontinuity_counter, " + "expected 52, is %d", + check_msg->biases[2].discontinuity_counter); + ck_assert_msg( + check_msg->biases[2].integer_indicator == 49, + "incorrect value for biases[2].integer_indicator, expected 49, is %d", + check_msg->biases[2].integer_indicator); + ck_assert_msg(check_msg->biases[2].widelane_integer_indicator == 248, + "incorrect value for biases[2].widelane_integer_indicator, " + "expected 248, is %d", + check_msg->biases[2].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[3].bias == -240298362, + "incorrect value for biases[3].bias, expected -240298362, is %d", + check_msg->biases[3].bias); + ck_assert_msg(check_msg->biases[3].code == 166, + "incorrect value for biases[3].code, expected 166, is %d", + check_msg->biases[3].code); + ck_assert_msg(check_msg->biases[3].discontinuity_counter == 124, + "incorrect value for biases[3].discontinuity_counter, " + "expected 124, is %d", + check_msg->biases[3].discontinuity_counter); + ck_assert_msg( + check_msg->biases[3].integer_indicator == 168, + "incorrect value for biases[3].integer_indicator, expected 168, is %d", + check_msg->biases[3].integer_indicator); + ck_assert_msg(check_msg->biases[3].widelane_integer_indicator == 232, + "incorrect value for biases[3].widelane_integer_indicator, " + "expected 232, is %d", + check_msg->biases[3].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[4].bias == -1581740159, + "incorrect value for biases[4].bias, expected -1581740159, is %d", + check_msg->biases[4].bias); + ck_assert_msg(check_msg->biases[4].code == 174, + "incorrect value for biases[4].code, expected 174, is %d", + check_msg->biases[4].code); + ck_assert_msg(check_msg->biases[4].discontinuity_counter == 155, + "incorrect value for biases[4].discontinuity_counter, " + "expected 155, is %d", + check_msg->biases[4].discontinuity_counter); + ck_assert_msg( + check_msg->biases[4].integer_indicator == 44, + "incorrect value for biases[4].integer_indicator, expected 44, is %d", + check_msg->biases[4].integer_indicator); + ck_assert_msg(check_msg->biases[4].widelane_integer_indicator == 142, + "incorrect value for biases[4].widelane_integer_indicator, " + "expected 142, is %d", + check_msg->biases[4].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[5].bias == -1730297136, + "incorrect value for biases[5].bias, expected -1730297136, is %d", + check_msg->biases[5].bias); + ck_assert_msg(check_msg->biases[5].code == 211, + "incorrect value for biases[5].code, expected 211, is %d", + check_msg->biases[5].code); + ck_assert_msg(check_msg->biases[5].discontinuity_counter == 189, + "incorrect value for biases[5].discontinuity_counter, " + "expected 189, is %d", + check_msg->biases[5].discontinuity_counter); + ck_assert_msg( + check_msg->biases[5].integer_indicator == 15, + "incorrect value for biases[5].integer_indicator, expected 15, is %d", + check_msg->biases[5].integer_indicator); + ck_assert_msg(check_msg->biases[5].widelane_integer_indicator == 36, + "incorrect value for biases[5].widelane_integer_indicator, " + "expected 36, is %d", + check_msg->biases[5].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[6].bias == -1117221444, + "incorrect value for biases[6].bias, expected -1117221444, is %d", + check_msg->biases[6].bias); + ck_assert_msg(check_msg->biases[6].code == 16, + "incorrect value for biases[6].code, expected 16, is %d", + check_msg->biases[6].code); + ck_assert_msg(check_msg->biases[6].discontinuity_counter == 34, + "incorrect value for biases[6].discontinuity_counter, " + "expected 34, is %d", + check_msg->biases[6].discontinuity_counter); + ck_assert_msg( + check_msg->biases[6].integer_indicator == 203, + "incorrect value for biases[6].integer_indicator, expected 203, is %d", + check_msg->biases[6].integer_indicator); + ck_assert_msg(check_msg->biases[6].widelane_integer_indicator == 87, + "incorrect value for biases[6].widelane_integer_indicator, " + "expected 87, is %d", + check_msg->biases[6].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[7].bias == -1137604357, + "incorrect value for biases[7].bias, expected -1137604357, is %d", + check_msg->biases[7].bias); + ck_assert_msg(check_msg->biases[7].code == 102, + "incorrect value for biases[7].code, expected 102, is %d", + check_msg->biases[7].code); + ck_assert_msg(check_msg->biases[7].discontinuity_counter == 22, + "incorrect value for biases[7].discontinuity_counter, " + "expected 22, is %d", + check_msg->biases[7].discontinuity_counter); + ck_assert_msg( + check_msg->biases[7].integer_indicator == 156, + "incorrect value for biases[7].integer_indicator, expected 156, is %d", + check_msg->biases[7].integer_indicator); + ck_assert_msg(check_msg->biases[7].widelane_integer_indicator == 252, + "incorrect value for biases[7].widelane_integer_indicator, " + "expected 252, is %d", + check_msg->biases[7].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[8].bias == -1910370172, + "incorrect value for biases[8].bias, expected -1910370172, is %d", + check_msg->biases[8].bias); + ck_assert_msg(check_msg->biases[8].code == 157, + "incorrect value for biases[8].code, expected 157, is %d", + check_msg->biases[8].code); + ck_assert_msg(check_msg->biases[8].discontinuity_counter == 49, + "incorrect value for biases[8].discontinuity_counter, " + "expected 49, is %d", + check_msg->biases[8].discontinuity_counter); + ck_assert_msg( + check_msg->biases[8].integer_indicator == 222, + "incorrect value for biases[8].integer_indicator, expected 222, is %d", + check_msg->biases[8].integer_indicator); + ck_assert_msg(check_msg->biases[8].widelane_integer_indicator == 245, + "incorrect value for biases[8].widelane_integer_indicator, " + "expected 245, is %d", + check_msg->biases[8].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[9].bias == 1247996869, + "incorrect value for biases[9].bias, expected 1247996869, is %d", + check_msg->biases[9].bias); + ck_assert_msg(check_msg->biases[9].code == 228, + "incorrect value for biases[9].code, expected 228, is %d", + check_msg->biases[9].code); + ck_assert_msg(check_msg->biases[9].discontinuity_counter == 221, + "incorrect value for biases[9].discontinuity_counter, " + "expected 221, is %d", + check_msg->biases[9].discontinuity_counter); + ck_assert_msg( + check_msg->biases[9].integer_indicator == 85, + "incorrect value for biases[9].integer_indicator, expected 85, is %d", + check_msg->biases[9].integer_indicator); + ck_assert_msg(check_msg->biases[9].widelane_integer_indicator == 139, + "incorrect value for biases[9].widelane_integer_indicator, " + "expected 139, is %d", + check_msg->biases[9].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[10].bias == -1133446161, + "incorrect value for biases[10].bias, expected -1133446161, is %d", + check_msg->biases[10].bias); + ck_assert_msg(check_msg->biases[10].code == 107, + "incorrect value for biases[10].code, expected 107, is %d", + check_msg->biases[10].code); + ck_assert_msg(check_msg->biases[10].discontinuity_counter == 38, + "incorrect value for biases[10].discontinuity_counter, " + "expected 38, is %d", + check_msg->biases[10].discontinuity_counter); + ck_assert_msg( + check_msg->biases[10].integer_indicator == 70, + "incorrect value for biases[10].integer_indicator, expected 70, is %d", + check_msg->biases[10].integer_indicator); + ck_assert_msg(check_msg->biases[10].widelane_integer_indicator == 36, + "incorrect value for biases[10].widelane_integer_indicator, " + "expected 36, is %d", + check_msg->biases[10].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[11].bias == -720934762, + "incorrect value for biases[11].bias, expected -720934762, is %d", + check_msg->biases[11].bias); + ck_assert_msg(check_msg->biases[11].code == 124, + "incorrect value for biases[11].code, expected 124, is %d", + check_msg->biases[11].code); + ck_assert_msg(check_msg->biases[11].discontinuity_counter == 164, + "incorrect value for biases[11].discontinuity_counter, " + "expected 164, is %d", + check_msg->biases[11].discontinuity_counter); + ck_assert_msg( + check_msg->biases[11].integer_indicator == 246, + "incorrect value for biases[11].integer_indicator, expected 246, is %d", + check_msg->biases[11].integer_indicator); + ck_assert_msg(check_msg->biases[11].widelane_integer_indicator == 141, + "incorrect value for biases[11].widelane_integer_indicator, " + "expected 141, is %d", + check_msg->biases[11].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[12].bias == 706252548, + "incorrect value for biases[12].bias, expected 706252548, is %d", + check_msg->biases[12].bias); + ck_assert_msg(check_msg->biases[12].code == 44, + "incorrect value for biases[12].code, expected 44, is %d", + check_msg->biases[12].code); + ck_assert_msg(check_msg->biases[12].discontinuity_counter == 192, + "incorrect value for biases[12].discontinuity_counter, " + "expected 192, is %d", + check_msg->biases[12].discontinuity_counter); + ck_assert_msg( + check_msg->biases[12].integer_indicator == 21, + "incorrect value for biases[12].integer_indicator, expected 21, is %d", + check_msg->biases[12].integer_indicator); + ck_assert_msg(check_msg->biases[12].widelane_integer_indicator == 244, + "incorrect value for biases[12].widelane_integer_indicator, " + "expected 244, is %d", + check_msg->biases[12].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[13].bias == 388855338, + "incorrect value for biases[13].bias, expected 388855338, is %d", + check_msg->biases[13].bias); + ck_assert_msg(check_msg->biases[13].code == 21, + "incorrect value for biases[13].code, expected 21, is %d", + check_msg->biases[13].code); + ck_assert_msg(check_msg->biases[13].discontinuity_counter == 7, + "incorrect value for biases[13].discontinuity_counter, " + "expected 7, is %d", + check_msg->biases[13].discontinuity_counter); + ck_assert_msg( + check_msg->biases[13].integer_indicator == 84, + "incorrect value for biases[13].integer_indicator, expected 84, is %d", + check_msg->biases[13].integer_indicator); + ck_assert_msg(check_msg->biases[13].widelane_integer_indicator == 136, + "incorrect value for biases[13].widelane_integer_indicator, " + "expected 136, is %d", + check_msg->biases[13].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[14].bias == 47517353, + "incorrect value for biases[14].bias, expected 47517353, is %d", + check_msg->biases[14].bias); + ck_assert_msg(check_msg->biases[14].code == 174, + "incorrect value for biases[14].code, expected 174, is %d", + check_msg->biases[14].code); + ck_assert_msg(check_msg->biases[14].discontinuity_counter == 54, + "incorrect value for biases[14].discontinuity_counter, " + "expected 54, is %d", + check_msg->biases[14].discontinuity_counter); + ck_assert_msg( + check_msg->biases[14].integer_indicator == 175, + "incorrect value for biases[14].integer_indicator, expected 175, is %d", + check_msg->biases[14].integer_indicator); + ck_assert_msg(check_msg->biases[14].widelane_integer_indicator == 129, + "incorrect value for biases[14].widelane_integer_indicator, " + "expected 129, is %d", + check_msg->biases[14].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[15].bias == -2124125745, + "incorrect value for biases[15].bias, expected -2124125745, is %d", + check_msg->biases[15].bias); + ck_assert_msg(check_msg->biases[15].code == 197, + "incorrect value for biases[15].code, expected 197, is %d", + check_msg->biases[15].code); + ck_assert_msg(check_msg->biases[15].discontinuity_counter == 13, + "incorrect value for biases[15].discontinuity_counter, " + "expected 13, is %d", + check_msg->biases[15].discontinuity_counter); + ck_assert_msg( + check_msg->biases[15].integer_indicator == 98, + "incorrect value for biases[15].integer_indicator, expected 98, is %d", + check_msg->biases[15].integer_indicator); + ck_assert_msg(check_msg->biases[15].widelane_integer_indicator == 60, + "incorrect value for biases[15].widelane_integer_indicator, " + "expected 60, is %d", + check_msg->biases[15].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[16].bias == -1401812607, + "incorrect value for biases[16].bias, expected -1401812607, is %d", + check_msg->biases[16].bias); + ck_assert_msg(check_msg->biases[16].code == 72, + "incorrect value for biases[16].code, expected 72, is %d", + check_msg->biases[16].code); + ck_assert_msg(check_msg->biases[16].discontinuity_counter == 140, + "incorrect value for biases[16].discontinuity_counter, " + "expected 140, is %d", + check_msg->biases[16].discontinuity_counter); + ck_assert_msg( + check_msg->biases[16].integer_indicator == 136, + "incorrect value for biases[16].integer_indicator, expected 136, is %d", + check_msg->biases[16].integer_indicator); + ck_assert_msg(check_msg->biases[16].widelane_integer_indicator == 240, + "incorrect value for biases[16].widelane_integer_indicator, " + "expected 240, is %d", + check_msg->biases[16].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[17].bias == 60257151, + "incorrect value for biases[17].bias, expected 60257151, is %d", + check_msg->biases[17].bias); + ck_assert_msg(check_msg->biases[17].code == 151, + "incorrect value for biases[17].code, expected 151, is %d", + check_msg->biases[17].code); + ck_assert_msg(check_msg->biases[17].discontinuity_counter == 210, + "incorrect value for biases[17].discontinuity_counter, " + "expected 210, is %d", + check_msg->biases[17].discontinuity_counter); + ck_assert_msg( + check_msg->biases[17].integer_indicator == 150, + "incorrect value for biases[17].integer_indicator, expected 150, is %d", + check_msg->biases[17].integer_indicator); + ck_assert_msg(check_msg->biases[17].widelane_integer_indicator == 17, + "incorrect value for biases[17].widelane_integer_indicator, " + "expected 17, is %d", + check_msg->biases[17].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[18].bias == 41820677, + "incorrect value for biases[18].bias, expected 41820677, is %d", + check_msg->biases[18].bias); + ck_assert_msg(check_msg->biases[18].code == 242, + "incorrect value for biases[18].code, expected 242, is %d", + check_msg->biases[18].code); + ck_assert_msg(check_msg->biases[18].discontinuity_counter == 14, + "incorrect value for biases[18].discontinuity_counter, " + "expected 14, is %d", + check_msg->biases[18].discontinuity_counter); + ck_assert_msg( + check_msg->biases[18].integer_indicator == 254, + "incorrect value for biases[18].integer_indicator, expected 254, is %d", + check_msg->biases[18].integer_indicator); + ck_assert_msg(check_msg->biases[18].widelane_integer_indicator == 215, + "incorrect value for biases[18].widelane_integer_indicator, " + "expected 215, is %d", + check_msg->biases[18].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[19].bias == 1640616471, + "incorrect value for biases[19].bias, expected 1640616471, is %d", + check_msg->biases[19].bias); + ck_assert_msg(check_msg->biases[19].code == 215, + "incorrect value for biases[19].code, expected 215, is %d", + check_msg->biases[19].code); + ck_assert_msg(check_msg->biases[19].discontinuity_counter == 176, + "incorrect value for biases[19].discontinuity_counter, " + "expected 176, is %d", + check_msg->biases[19].discontinuity_counter); + ck_assert_msg( + check_msg->biases[19].integer_indicator == 65, + "incorrect value for biases[19].integer_indicator, expected 65, is %d", + check_msg->biases[19].integer_indicator); + ck_assert_msg(check_msg->biases[19].widelane_integer_indicator == 38, + "incorrect value for biases[19].widelane_integer_indicator, " + "expected 38, is %d", + check_msg->biases[19].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[20].bias == -744786918, + "incorrect value for biases[20].bias, expected -744786918, is %d", + check_msg->biases[20].bias); + ck_assert_msg(check_msg->biases[20].code == 36, + "incorrect value for biases[20].code, expected 36, is %d", + check_msg->biases[20].code); + ck_assert_msg(check_msg->biases[20].discontinuity_counter == 224, + "incorrect value for biases[20].discontinuity_counter, " + "expected 224, is %d", + check_msg->biases[20].discontinuity_counter); + ck_assert_msg( + check_msg->biases[20].integer_indicator == 207, + "incorrect value for biases[20].integer_indicator, expected 207, is %d", + check_msg->biases[20].integer_indicator); + ck_assert_msg(check_msg->biases[20].widelane_integer_indicator == 92, + "incorrect value for biases[20].widelane_integer_indicator, " + "expected 92, is %d", + check_msg->biases[20].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[21].bias == 1966589763, + "incorrect value for biases[21].bias, expected 1966589763, is %d", + check_msg->biases[21].bias); + ck_assert_msg(check_msg->biases[21].code == 165, + "incorrect value for biases[21].code, expected 165, is %d", + check_msg->biases[21].code); + ck_assert_msg(check_msg->biases[21].discontinuity_counter == 38, + "incorrect value for biases[21].discontinuity_counter, " + "expected 38, is %d", + check_msg->biases[21].discontinuity_counter); + ck_assert_msg( + check_msg->biases[21].integer_indicator == 47, + "incorrect value for biases[21].integer_indicator, expected 47, is %d", + check_msg->biases[21].integer_indicator); + ck_assert_msg(check_msg->biases[21].widelane_integer_indicator == 102, + "incorrect value for biases[21].widelane_integer_indicator, " + "expected 102, is %d", + check_msg->biases[21].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[22].bias == 364366310, + "incorrect value for biases[22].bias, expected 364366310, is %d", + check_msg->biases[22].bias); + ck_assert_msg(check_msg->biases[22].code == 36, + "incorrect value for biases[22].code, expected 36, is %d", + check_msg->biases[22].code); + ck_assert_msg(check_msg->biases[22].discontinuity_counter == 1, + "incorrect value for biases[22].discontinuity_counter, " + "expected 1, is %d", + check_msg->biases[22].discontinuity_counter); + ck_assert_msg( + check_msg->biases[22].integer_indicator == 169, + "incorrect value for biases[22].integer_indicator, expected 169, is %d", + check_msg->biases[22].integer_indicator); + ck_assert_msg(check_msg->biases[22].widelane_integer_indicator == 33, + "incorrect value for biases[22].widelane_integer_indicator, " + "expected 33, is %d", + check_msg->biases[22].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[23].bias == -1839031379, + "incorrect value for biases[23].bias, expected -1839031379, is %d", + check_msg->biases[23].bias); + ck_assert_msg(check_msg->biases[23].code == 42, + "incorrect value for biases[23].code, expected 42, is %d", + check_msg->biases[23].code); + ck_assert_msg(check_msg->biases[23].discontinuity_counter == 173, + "incorrect value for biases[23].discontinuity_counter, " + "expected 173, is %d", + check_msg->biases[23].discontinuity_counter); + ck_assert_msg( + check_msg->biases[23].integer_indicator == 62, + "incorrect value for biases[23].integer_indicator, expected 62, is %d", + check_msg->biases[23].integer_indicator); + ck_assert_msg(check_msg->biases[23].widelane_integer_indicator == 147, + "incorrect value for biases[23].widelane_integer_indicator, " + "expected 147, is %d", + check_msg->biases[23].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[24].bias == 31817639, + "incorrect value for biases[24].bias, expected 31817639, is %d", + check_msg->biases[24].bias); + ck_assert_msg(check_msg->biases[24].code == 231, + "incorrect value for biases[24].code, expected 231, is %d", + check_msg->biases[24].code); + ck_assert_msg(check_msg->biases[24].discontinuity_counter == 82, + "incorrect value for biases[24].discontinuity_counter, " + "expected 82, is %d", + check_msg->biases[24].discontinuity_counter); + ck_assert_msg( + check_msg->biases[24].integer_indicator == 167, + "incorrect value for biases[24].integer_indicator, expected 167, is %d", + check_msg->biases[24].integer_indicator); + ck_assert_msg(check_msg->biases[24].widelane_integer_indicator == 138, + "incorrect value for biases[24].widelane_integer_indicator, " + "expected 138, is %d", + check_msg->biases[24].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[25].bias == -1619830156, + "incorrect value for biases[25].bias, expected -1619830156, is %d", + check_msg->biases[25].bias); + ck_assert_msg(check_msg->biases[25].code == 2, + "incorrect value for biases[25].code, expected 2, is %d", + check_msg->biases[25].code); + ck_assert_msg(check_msg->biases[25].discontinuity_counter == 207, + "incorrect value for biases[25].discontinuity_counter, " + "expected 207, is %d", + check_msg->biases[25].discontinuity_counter); + ck_assert_msg( + check_msg->biases[25].integer_indicator == 127, + "incorrect value for biases[25].integer_indicator, expected 127, is %d", + check_msg->biases[25].integer_indicator); + ck_assert_msg(check_msg->biases[25].widelane_integer_indicator == 237, + "incorrect value for biases[25].widelane_integer_indicator, " + "expected 237, is %d", + check_msg->biases[25].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[26].bias == -83375622, + "incorrect value for biases[26].bias, expected -83375622, is %d", + check_msg->biases[26].bias); + ck_assert_msg(check_msg->biases[26].code == 3, + "incorrect value for biases[26].code, expected 3, is %d", + check_msg->biases[26].code); + ck_assert_msg(check_msg->biases[26].discontinuity_counter == 145, + "incorrect value for biases[26].discontinuity_counter, " + "expected 145, is %d", + check_msg->biases[26].discontinuity_counter); + ck_assert_msg( + check_msg->biases[26].integer_indicator == 42, + "incorrect value for biases[26].integer_indicator, expected 42, is %d", + check_msg->biases[26].integer_indicator); + ck_assert_msg(check_msg->biases[26].widelane_integer_indicator == 66, + "incorrect value for biases[26].widelane_integer_indicator, " + "expected 66, is %d", + check_msg->biases[26].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[27].bias == 1077458389, + "incorrect value for biases[27].bias, expected 1077458389, is %d", + check_msg->biases[27].bias); + ck_assert_msg(check_msg->biases[27].code == 2, + "incorrect value for biases[27].code, expected 2, is %d", + check_msg->biases[27].code); + ck_assert_msg(check_msg->biases[27].discontinuity_counter == 26, + "incorrect value for biases[27].discontinuity_counter, " + "expected 26, is %d", + check_msg->biases[27].discontinuity_counter); + ck_assert_msg( + check_msg->biases[27].integer_indicator == 75, + "incorrect value for biases[27].integer_indicator, expected 75, is %d", + check_msg->biases[27].integer_indicator); + ck_assert_msg(check_msg->biases[27].widelane_integer_indicator == 230, + "incorrect value for biases[27].widelane_integer_indicator, " + "expected 230, is %d", + check_msg->biases[27].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[28].bias == -883355501, + "incorrect value for biases[28].bias, expected -883355501, is %d", + check_msg->biases[28].bias); + ck_assert_msg(check_msg->biases[28].code == 97, + "incorrect value for biases[28].code, expected 97, is %d", + check_msg->biases[28].code); + ck_assert_msg(check_msg->biases[28].discontinuity_counter == 6, + "incorrect value for biases[28].discontinuity_counter, " + "expected 6, is %d", + check_msg->biases[28].discontinuity_counter); + ck_assert_msg( + check_msg->biases[28].integer_indicator == 88, + "incorrect value for biases[28].integer_indicator, expected 88, is %d", + check_msg->biases[28].integer_indicator); + ck_assert_msg(check_msg->biases[28].widelane_integer_indicator == 255, + "incorrect value for biases[28].widelane_integer_indicator, " + "expected 255, is %d", + check_msg->biases[28].widelane_integer_indicator); + ck_assert_msg( + check_msg->biases[29].bias == -1448611273, + "incorrect value for biases[29].bias, expected -1448611273, is %d", + check_msg->biases[29].bias); + ck_assert_msg(check_msg->biases[29].code == 27, + "incorrect value for biases[29].code, expected 27, is %d", + check_msg->biases[29].code); + ck_assert_msg(check_msg->biases[29].discontinuity_counter == 230, + "incorrect value for biases[29].discontinuity_counter, " + "expected 230, is %d", + check_msg->biases[29].discontinuity_counter); + ck_assert_msg( + check_msg->biases[29].integer_indicator == 68, + "incorrect value for biases[29].integer_indicator, expected 68, is %d", + check_msg->biases[29].integer_indicator); + ck_assert_msg(check_msg->biases[29].widelane_integer_indicator == 243, + "incorrect value for biases[29].widelane_integer_indicator, " + "expected 243, is %d", + check_msg->biases[29].widelane_integer_indicator); + ck_assert_msg(check_msg->dispersive_bias == 98, + "incorrect value for dispersive_bias, expected 98, is %d", + check_msg->dispersive_bias); + ck_assert_msg(check_msg->iod_ssr == 230, + "incorrect value for iod_ssr, expected 230, is %d", + check_msg->iod_ssr); + ck_assert_msg(check_msg->mw_consistency == 209, + "incorrect value for mw_consistency, expected 209, is %d", + check_msg->mw_consistency); + ck_assert_msg(check_msg->sid.code == 82, + "incorrect value for sid.code, expected 82, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.sat == 169, + "incorrect value for sid.sat, expected 169, is %d", + check_msg->sid.sat); + ck_assert_msg(check_msg->time.tow == 210803409, + "incorrect value for time.tow, expected 210803409, is %d", + check_msg->time.tow); + ck_assert_msg(check_msg->time.wn == 42197, + "incorrect value for time.wn, expected 42197, is %d", + check_msg->time.wn); + ck_assert_msg(check_msg->update_interval == 177, + "incorrect value for update_interval, expected 177, is %d", + check_msg->update_interval); + ck_assert_msg(check_msg->yaw == 5881, + "incorrect value for yaw, expected 5881, is %d", + check_msg->yaw); + ck_assert_msg(check_msg->yaw_rate == 17, + "incorrect value for yaw_rate, expected 17, is %d", + check_msg->yaw_rate); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases"); +Suite *legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrSatelliteApc.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrSatelliteApc.c index 632d347d7..93293766e 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrSatelliteApc.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrSatelliteApc.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApc.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApc.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,25 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x605, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x605, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x605, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x605, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,6,0,0,41,127,58,9,0,174,8,1,2,3,2,0,4,61,0,1,0,255,255,217,2,11,10,8,5,1,252,248,246,246,246,249,252,0,6,12,22,30,41,41,41,41,144,161, }; + u8 encoded_frame[] = { + 85, 5, 6, 0, 0, 41, 127, 58, 9, 0, 174, 8, 1, + 2, 3, 2, 0, 4, 61, 0, 1, 0, 255, 255, 217, 2, + 11, 10, 8, 5, 1, 252, 248, 246, 246, 246, 249, 252, 0, + 6, 12, 22, 30, 41, 41, 41, 41, 144, 161, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_satellite_apc_t* test_msg = ( msg_ssr_satellite_apc_t* )test_msg_storage; + msg_ssr_satellite_apc_t *test_msg = + (msg_ssr_satellite_apc_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->apc) == 0) { // Cope with variable length arrays @@ -276,95 +281,169 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc ) test_msg->time.tow = 604799; test_msg->time.wn = 2222; test_msg->update_interval = 1; - sbp_payload_send(&sbp_state, 0x605, 0, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x605, 0, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 0, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x605, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_satellite_apc_t* check_msg = ( msg_ssr_satellite_apc_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_satellite_apc_t *check_msg = + (msg_ssr_satellite_apc_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->apc[0].pco[0] == 1, "incorrect value for apc[0].pco[0], expected 1, is %d", check_msg->apc[0].pco[0]); - ck_assert_msg(check_msg->apc[0].pco[1] == -1, "incorrect value for apc[0].pco[1], expected -1, is %d", check_msg->apc[0].pco[1]); - ck_assert_msg(check_msg->apc[0].pco[2] == 729, "incorrect value for apc[0].pco[2], expected 729, is %d", check_msg->apc[0].pco[2]); - ck_assert_msg(check_msg->apc[0].pcv[0] == 11, "incorrect value for apc[0].pcv[0], expected 11, is %d", check_msg->apc[0].pcv[0]); - ck_assert_msg(check_msg->apc[0].pcv[1] == 10, "incorrect value for apc[0].pcv[1], expected 10, is %d", check_msg->apc[0].pcv[1]); - ck_assert_msg(check_msg->apc[0].pcv[2] == 8, "incorrect value for apc[0].pcv[2], expected 8, is %d", check_msg->apc[0].pcv[2]); - ck_assert_msg(check_msg->apc[0].pcv[3] == 5, "incorrect value for apc[0].pcv[3], expected 5, is %d", check_msg->apc[0].pcv[3]); - ck_assert_msg(check_msg->apc[0].pcv[4] == 1, "incorrect value for apc[0].pcv[4], expected 1, is %d", check_msg->apc[0].pcv[4]); - ck_assert_msg(check_msg->apc[0].pcv[5] == -4, "incorrect value for apc[0].pcv[5], expected -4, is %d", check_msg->apc[0].pcv[5]); - ck_assert_msg(check_msg->apc[0].pcv[6] == -8, "incorrect value for apc[0].pcv[6], expected -8, is %d", check_msg->apc[0].pcv[6]); - ck_assert_msg(check_msg->apc[0].pcv[7] == -10, "incorrect value for apc[0].pcv[7], expected -10, is %d", check_msg->apc[0].pcv[7]); - ck_assert_msg(check_msg->apc[0].pcv[8] == -10, "incorrect value for apc[0].pcv[8], expected -10, is %d", check_msg->apc[0].pcv[8]); - ck_assert_msg(check_msg->apc[0].pcv[9] == -10, "incorrect value for apc[0].pcv[9], expected -10, is %d", check_msg->apc[0].pcv[9]); - ck_assert_msg(check_msg->apc[0].pcv[10] == -7, "incorrect value for apc[0].pcv[10], expected -7, is %d", check_msg->apc[0].pcv[10]); - ck_assert_msg(check_msg->apc[0].pcv[11] == -4, "incorrect value for apc[0].pcv[11], expected -4, is %d", check_msg->apc[0].pcv[11]); - ck_assert_msg(check_msg->apc[0].pcv[12] == 0, "incorrect value for apc[0].pcv[12], expected 0, is %d", check_msg->apc[0].pcv[12]); - ck_assert_msg(check_msg->apc[0].pcv[13] == 6, "incorrect value for apc[0].pcv[13], expected 6, is %d", check_msg->apc[0].pcv[13]); - ck_assert_msg(check_msg->apc[0].pcv[14] == 12, "incorrect value for apc[0].pcv[14], expected 12, is %d", check_msg->apc[0].pcv[14]); - ck_assert_msg(check_msg->apc[0].pcv[15] == 22, "incorrect value for apc[0].pcv[15], expected 22, is %d", check_msg->apc[0].pcv[15]); - ck_assert_msg(check_msg->apc[0].pcv[16] == 30, "incorrect value for apc[0].pcv[16], expected 30, is %d", check_msg->apc[0].pcv[16]); - ck_assert_msg(check_msg->apc[0].pcv[17] == 41, "incorrect value for apc[0].pcv[17], expected 41, is %d", check_msg->apc[0].pcv[17]); - ck_assert_msg(check_msg->apc[0].pcv[18] == 41, "incorrect value for apc[0].pcv[18], expected 41, is %d", check_msg->apc[0].pcv[18]); - ck_assert_msg(check_msg->apc[0].pcv[19] == 41, "incorrect value for apc[0].pcv[19], expected 41, is %d", check_msg->apc[0].pcv[19]); - ck_assert_msg(check_msg->apc[0].pcv[20] == 41, "incorrect value for apc[0].pcv[20], expected 41, is %d", check_msg->apc[0].pcv[20]); - ck_assert_msg(check_msg->apc[0].sat_info == 4, "incorrect value for apc[0].sat_info, expected 4, is %d", check_msg->apc[0].sat_info); - ck_assert_msg(check_msg->apc[0].sid.code == 0, "incorrect value for apc[0].sid.code, expected 0, is %d", check_msg->apc[0].sid.code); - ck_assert_msg(check_msg->apc[0].sid.sat == 2, "incorrect value for apc[0].sid.sat, expected 2, is %d", check_msg->apc[0].sid.sat); - ck_assert_msg(check_msg->apc[0].svn == 61, "incorrect value for apc[0].svn, expected 61, is %d", check_msg->apc[0].svn); - ck_assert_msg(check_msg->iod_ssr == 3, "incorrect value for iod_ssr, expected 3, is %d", check_msg->iod_ssr); - ck_assert_msg(check_msg->sol_id == 2, "incorrect value for sol_id, expected 2, is %d", check_msg->sol_id); - ck_assert_msg(check_msg->time.tow == 604799, "incorrect value for time.tow, expected 604799, is %d", check_msg->time.tow); - ck_assert_msg(check_msg->time.wn == 2222, "incorrect value for time.wn, expected 2222, is %d", check_msg->time.wn); - ck_assert_msg(check_msg->update_interval == 1, "incorrect value for update_interval, expected 1, is %d", check_msg->update_interval); + ck_assert_msg(check_msg->apc[0].pco[0] == 1, + "incorrect value for apc[0].pco[0], expected 1, is %d", + check_msg->apc[0].pco[0]); + ck_assert_msg(check_msg->apc[0].pco[1] == -1, + "incorrect value for apc[0].pco[1], expected -1, is %d", + check_msg->apc[0].pco[1]); + ck_assert_msg(check_msg->apc[0].pco[2] == 729, + "incorrect value for apc[0].pco[2], expected 729, is %d", + check_msg->apc[0].pco[2]); + ck_assert_msg(check_msg->apc[0].pcv[0] == 11, + "incorrect value for apc[0].pcv[0], expected 11, is %d", + check_msg->apc[0].pcv[0]); + ck_assert_msg(check_msg->apc[0].pcv[1] == 10, + "incorrect value for apc[0].pcv[1], expected 10, is %d", + check_msg->apc[0].pcv[1]); + ck_assert_msg(check_msg->apc[0].pcv[2] == 8, + "incorrect value for apc[0].pcv[2], expected 8, is %d", + check_msg->apc[0].pcv[2]); + ck_assert_msg(check_msg->apc[0].pcv[3] == 5, + "incorrect value for apc[0].pcv[3], expected 5, is %d", + check_msg->apc[0].pcv[3]); + ck_assert_msg(check_msg->apc[0].pcv[4] == 1, + "incorrect value for apc[0].pcv[4], expected 1, is %d", + check_msg->apc[0].pcv[4]); + ck_assert_msg(check_msg->apc[0].pcv[5] == -4, + "incorrect value for apc[0].pcv[5], expected -4, is %d", + check_msg->apc[0].pcv[5]); + ck_assert_msg(check_msg->apc[0].pcv[6] == -8, + "incorrect value for apc[0].pcv[6], expected -8, is %d", + check_msg->apc[0].pcv[6]); + ck_assert_msg(check_msg->apc[0].pcv[7] == -10, + "incorrect value for apc[0].pcv[7], expected -10, is %d", + check_msg->apc[0].pcv[7]); + ck_assert_msg(check_msg->apc[0].pcv[8] == -10, + "incorrect value for apc[0].pcv[8], expected -10, is %d", + check_msg->apc[0].pcv[8]); + ck_assert_msg(check_msg->apc[0].pcv[9] == -10, + "incorrect value for apc[0].pcv[9], expected -10, is %d", + check_msg->apc[0].pcv[9]); + ck_assert_msg(check_msg->apc[0].pcv[10] == -7, + "incorrect value for apc[0].pcv[10], expected -7, is %d", + check_msg->apc[0].pcv[10]); + ck_assert_msg(check_msg->apc[0].pcv[11] == -4, + "incorrect value for apc[0].pcv[11], expected -4, is %d", + check_msg->apc[0].pcv[11]); + ck_assert_msg(check_msg->apc[0].pcv[12] == 0, + "incorrect value for apc[0].pcv[12], expected 0, is %d", + check_msg->apc[0].pcv[12]); + ck_assert_msg(check_msg->apc[0].pcv[13] == 6, + "incorrect value for apc[0].pcv[13], expected 6, is %d", + check_msg->apc[0].pcv[13]); + ck_assert_msg(check_msg->apc[0].pcv[14] == 12, + "incorrect value for apc[0].pcv[14], expected 12, is %d", + check_msg->apc[0].pcv[14]); + ck_assert_msg(check_msg->apc[0].pcv[15] == 22, + "incorrect value for apc[0].pcv[15], expected 22, is %d", + check_msg->apc[0].pcv[15]); + ck_assert_msg(check_msg->apc[0].pcv[16] == 30, + "incorrect value for apc[0].pcv[16], expected 30, is %d", + check_msg->apc[0].pcv[16]); + ck_assert_msg(check_msg->apc[0].pcv[17] == 41, + "incorrect value for apc[0].pcv[17], expected 41, is %d", + check_msg->apc[0].pcv[17]); + ck_assert_msg(check_msg->apc[0].pcv[18] == 41, + "incorrect value for apc[0].pcv[18], expected 41, is %d", + check_msg->apc[0].pcv[18]); + ck_assert_msg(check_msg->apc[0].pcv[19] == 41, + "incorrect value for apc[0].pcv[19], expected 41, is %d", + check_msg->apc[0].pcv[19]); + ck_assert_msg(check_msg->apc[0].pcv[20] == 41, + "incorrect value for apc[0].pcv[20], expected 41, is %d", + check_msg->apc[0].pcv[20]); + ck_assert_msg(check_msg->apc[0].sat_info == 4, + "incorrect value for apc[0].sat_info, expected 4, is %d", + check_msg->apc[0].sat_info); + ck_assert_msg(check_msg->apc[0].sid.code == 0, + "incorrect value for apc[0].sid.code, expected 0, is %d", + check_msg->apc[0].sid.code); + ck_assert_msg(check_msg->apc[0].sid.sat == 2, + "incorrect value for apc[0].sid.sat, expected 2, is %d", + check_msg->apc[0].sid.sat); + ck_assert_msg(check_msg->apc[0].svn == 61, + "incorrect value for apc[0].svn, expected 61, is %d", + check_msg->apc[0].svn); + ck_assert_msg(check_msg->iod_ssr == 3, + "incorrect value for iod_ssr, expected 3, is %d", + check_msg->iod_ssr); + ck_assert_msg(check_msg->sol_id == 2, + "incorrect value for sol_id, expected 2, is %d", + check_msg->sol_id); + ck_assert_msg(check_msg->time.tow == 604799, + "incorrect value for time.tow, expected 604799, is %d", + check_msg->time.tow); + ck_assert_msg(check_msg->time.wn == 2222, + "incorrect value for time.wn, expected 2222, is %d", + check_msg->time.wn); + ck_assert_msg(check_msg->update_interval == 1, + "incorrect value for update_interval, expected 1, is %d", + check_msg->update_interval); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc"); +Suite *legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.c index 5a456f4cc..5528b6547 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApcDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApcDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,38 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x604, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x604, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x604, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x604, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,6,56,19,224,203,169,240,78,4,213,171,254,214,212,4,8,33,31,80,21,4,105,225,39,139,124,149,48,15,214,197,141,32,33,135,150,148,123,49,135,97,39,90,20,169,239,47,153,175,35,145,145,123,194,2,102,74,149,95,171,238,249,7,237,170,125,106,158,83,188,181,194,27,84,226,142,123,77,217,248,67,215,129,114,138,25,240,10,56,76,61,161,216,22,181,174,33,13,252,236,230,196,128,215,239,234,179,220,44,212,57,44,173,49,36,137,248,235,97,112,157,139,26,115,192,31,85,127,228,81,252,219,249,110,147,8,161,215,212,180,25,83,144,247,12,27,199,173,74,23,4,239,103,223,220,139,91,127,214,86,48,203,228,99,45,83,159,11,250,135,170,42,217,199,233,42,170,78,206,41,43,81,247,99,198,144,2,132,2,224,220,148,58,85,138,210,200,158,7,158,67,46,200,132,118,241,13,37,62,107,253,190,136,66,9,84,155,86,180,41,196,40,119,101,252,223,144,153,50,13, }; + u8 encoded_frame[] = { + 85, 4, 6, 56, 19, 224, 203, 169, 240, 78, 4, 213, 171, 254, + 214, 212, 4, 8, 33, 31, 80, 21, 4, 105, 225, 39, 139, 124, + 149, 48, 15, 214, 197, 141, 32, 33, 135, 150, 148, 123, 49, 135, + 97, 39, 90, 20, 169, 239, 47, 153, 175, 35, 145, 145, 123, 194, + 2, 102, 74, 149, 95, 171, 238, 249, 7, 237, 170, 125, 106, 158, + 83, 188, 181, 194, 27, 84, 226, 142, 123, 77, 217, 248, 67, 215, + 129, 114, 138, 25, 240, 10, 56, 76, 61, 161, 216, 22, 181, 174, + 33, 13, 252, 236, 230, 196, 128, 215, 239, 234, 179, 220, 44, 212, + 57, 44, 173, 49, 36, 137, 248, 235, 97, 112, 157, 139, 26, 115, + 192, 31, 85, 127, 228, 81, 252, 219, 249, 110, 147, 8, 161, 215, + 212, 180, 25, 83, 144, 247, 12, 27, 199, 173, 74, 23, 4, 239, + 103, 223, 220, 139, 91, 127, 214, 86, 48, 203, 228, 99, 45, 83, + 159, 11, 250, 135, 170, 42, 217, 199, 233, 42, 170, 78, 206, 41, + 43, 81, 247, 99, 198, 144, 2, 132, 2, 224, 220, 148, 58, 85, + 138, 210, 200, 158, 7, 158, 67, 46, 200, 132, 118, 241, 13, 37, + 62, 107, 253, 190, 136, 66, 9, 84, 155, 86, 180, 41, 196, 40, + 119, 101, 252, 223, 144, 153, 50, 13, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_satellite_apc_dep_t* test_msg = ( msg_ssr_satellite_apc_dep_t* )test_msg_storage; + msg_ssr_satellite_apc_dep_t *test_msg = + (msg_ssr_satellite_apc_dep_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->apc) == 0) { // Cope with variable length arrays @@ -1039,258 +1057,659 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA ) test_msg->apc[6].sid.code = 158; test_msg->apc[6].sid.sat = 200; test_msg->apc[6].svn = 17310; - sbp_payload_send(&sbp_state, 0x604, 4920, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x604, 4920, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 4920, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 4920, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x604, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_satellite_apc_dep_t* check_msg = ( msg_ssr_satellite_apc_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_satellite_apc_dep_t *check_msg = + (msg_ssr_satellite_apc_dep_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->apc[0].pco[0] == -21547, "incorrect value for apc[0].pco[0], expected -21547, is %d", check_msg->apc[0].pco[0]); - ck_assert_msg(check_msg->apc[0].pco[1] == -10498, "incorrect value for apc[0].pco[1], expected -10498, is %d", check_msg->apc[0].pco[1]); - ck_assert_msg(check_msg->apc[0].pco[2] == 1236, "incorrect value for apc[0].pco[2], expected 1236, is %d", check_msg->apc[0].pco[2]); - ck_assert_msg(check_msg->apc[0].pcv[0] == 8, "incorrect value for apc[0].pcv[0], expected 8, is %d", check_msg->apc[0].pcv[0]); - ck_assert_msg(check_msg->apc[0].pcv[1] == 33, "incorrect value for apc[0].pcv[1], expected 33, is %d", check_msg->apc[0].pcv[1]); - ck_assert_msg(check_msg->apc[0].pcv[2] == 31, "incorrect value for apc[0].pcv[2], expected 31, is %d", check_msg->apc[0].pcv[2]); - ck_assert_msg(check_msg->apc[0].pcv[3] == 80, "incorrect value for apc[0].pcv[3], expected 80, is %d", check_msg->apc[0].pcv[3]); - ck_assert_msg(check_msg->apc[0].pcv[4] == 21, "incorrect value for apc[0].pcv[4], expected 21, is %d", check_msg->apc[0].pcv[4]); - ck_assert_msg(check_msg->apc[0].pcv[5] == 4, "incorrect value for apc[0].pcv[5], expected 4, is %d", check_msg->apc[0].pcv[5]); - ck_assert_msg(check_msg->apc[0].pcv[6] == 105, "incorrect value for apc[0].pcv[6], expected 105, is %d", check_msg->apc[0].pcv[6]); - ck_assert_msg(check_msg->apc[0].pcv[7] == -31, "incorrect value for apc[0].pcv[7], expected -31, is %d", check_msg->apc[0].pcv[7]); - ck_assert_msg(check_msg->apc[0].pcv[8] == 39, "incorrect value for apc[0].pcv[8], expected 39, is %d", check_msg->apc[0].pcv[8]); - ck_assert_msg(check_msg->apc[0].pcv[9] == -117, "incorrect value for apc[0].pcv[9], expected -117, is %d", check_msg->apc[0].pcv[9]); - ck_assert_msg(check_msg->apc[0].pcv[10] == 124, "incorrect value for apc[0].pcv[10], expected 124, is %d", check_msg->apc[0].pcv[10]); - ck_assert_msg(check_msg->apc[0].pcv[11] == -107, "incorrect value for apc[0].pcv[11], expected -107, is %d", check_msg->apc[0].pcv[11]); - ck_assert_msg(check_msg->apc[0].pcv[12] == 48, "incorrect value for apc[0].pcv[12], expected 48, is %d", check_msg->apc[0].pcv[12]); - ck_assert_msg(check_msg->apc[0].pcv[13] == 15, "incorrect value for apc[0].pcv[13], expected 15, is %d", check_msg->apc[0].pcv[13]); - ck_assert_msg(check_msg->apc[0].pcv[14] == -42, "incorrect value for apc[0].pcv[14], expected -42, is %d", check_msg->apc[0].pcv[14]); - ck_assert_msg(check_msg->apc[0].pcv[15] == -59, "incorrect value for apc[0].pcv[15], expected -59, is %d", check_msg->apc[0].pcv[15]); - ck_assert_msg(check_msg->apc[0].pcv[16] == -115, "incorrect value for apc[0].pcv[16], expected -115, is %d", check_msg->apc[0].pcv[16]); - ck_assert_msg(check_msg->apc[0].pcv[17] == 32, "incorrect value for apc[0].pcv[17], expected 32, is %d", check_msg->apc[0].pcv[17]); - ck_assert_msg(check_msg->apc[0].pcv[18] == 33, "incorrect value for apc[0].pcv[18], expected 33, is %d", check_msg->apc[0].pcv[18]); - ck_assert_msg(check_msg->apc[0].pcv[19] == -121, "incorrect value for apc[0].pcv[19], expected -121, is %d", check_msg->apc[0].pcv[19]); - ck_assert_msg(check_msg->apc[0].pcv[20] == -106, "incorrect value for apc[0].pcv[20], expected -106, is %d", check_msg->apc[0].pcv[20]); - ck_assert_msg(check_msg->apc[0].sat_info == 240, "incorrect value for apc[0].sat_info, expected 240, is %d", check_msg->apc[0].sat_info); - ck_assert_msg(check_msg->apc[0].sid.code == 169, "incorrect value for apc[0].sid.code, expected 169, is %d", check_msg->apc[0].sid.code); - ck_assert_msg(check_msg->apc[0].sid.sat == 203, "incorrect value for apc[0].sid.sat, expected 203, is %d", check_msg->apc[0].sid.sat); - ck_assert_msg(check_msg->apc[0].svn == 1102, "incorrect value for apc[0].svn, expected 1102, is %d", check_msg->apc[0].svn); - ck_assert_msg(check_msg->apc[1].pco[0] == 23079, "incorrect value for apc[1].pco[0], expected 23079, is %d", check_msg->apc[1].pco[0]); - ck_assert_msg(check_msg->apc[1].pco[1] == -22252, "incorrect value for apc[1].pco[1], expected -22252, is %d", check_msg->apc[1].pco[1]); - ck_assert_msg(check_msg->apc[1].pco[2] == 12271, "incorrect value for apc[1].pco[2], expected 12271, is %d", check_msg->apc[1].pco[2]); - ck_assert_msg(check_msg->apc[1].pcv[0] == -103, "incorrect value for apc[1].pcv[0], expected -103, is %d", check_msg->apc[1].pcv[0]); - ck_assert_msg(check_msg->apc[1].pcv[1] == -81, "incorrect value for apc[1].pcv[1], expected -81, is %d", check_msg->apc[1].pcv[1]); - ck_assert_msg(check_msg->apc[1].pcv[2] == 35, "incorrect value for apc[1].pcv[2], expected 35, is %d", check_msg->apc[1].pcv[2]); - ck_assert_msg(check_msg->apc[1].pcv[3] == -111, "incorrect value for apc[1].pcv[3], expected -111, is %d", check_msg->apc[1].pcv[3]); - ck_assert_msg(check_msg->apc[1].pcv[4] == -111, "incorrect value for apc[1].pcv[4], expected -111, is %d", check_msg->apc[1].pcv[4]); - ck_assert_msg(check_msg->apc[1].pcv[5] == 123, "incorrect value for apc[1].pcv[5], expected 123, is %d", check_msg->apc[1].pcv[5]); - ck_assert_msg(check_msg->apc[1].pcv[6] == -62, "incorrect value for apc[1].pcv[6], expected -62, is %d", check_msg->apc[1].pcv[6]); - ck_assert_msg(check_msg->apc[1].pcv[7] == 2, "incorrect value for apc[1].pcv[7], expected 2, is %d", check_msg->apc[1].pcv[7]); - ck_assert_msg(check_msg->apc[1].pcv[8] == 102, "incorrect value for apc[1].pcv[8], expected 102, is %d", check_msg->apc[1].pcv[8]); - ck_assert_msg(check_msg->apc[1].pcv[9] == 74, "incorrect value for apc[1].pcv[9], expected 74, is %d", check_msg->apc[1].pcv[9]); - ck_assert_msg(check_msg->apc[1].pcv[10] == -107, "incorrect value for apc[1].pcv[10], expected -107, is %d", check_msg->apc[1].pcv[10]); - ck_assert_msg(check_msg->apc[1].pcv[11] == 95, "incorrect value for apc[1].pcv[11], expected 95, is %d", check_msg->apc[1].pcv[11]); - ck_assert_msg(check_msg->apc[1].pcv[12] == -85, "incorrect value for apc[1].pcv[12], expected -85, is %d", check_msg->apc[1].pcv[12]); - ck_assert_msg(check_msg->apc[1].pcv[13] == -18, "incorrect value for apc[1].pcv[13], expected -18, is %d", check_msg->apc[1].pcv[13]); - ck_assert_msg(check_msg->apc[1].pcv[14] == -7, "incorrect value for apc[1].pcv[14], expected -7, is %d", check_msg->apc[1].pcv[14]); - ck_assert_msg(check_msg->apc[1].pcv[15] == 7, "incorrect value for apc[1].pcv[15], expected 7, is %d", check_msg->apc[1].pcv[15]); - ck_assert_msg(check_msg->apc[1].pcv[16] == -19, "incorrect value for apc[1].pcv[16], expected -19, is %d", check_msg->apc[1].pcv[16]); - ck_assert_msg(check_msg->apc[1].pcv[17] == -86, "incorrect value for apc[1].pcv[17], expected -86, is %d", check_msg->apc[1].pcv[17]); - ck_assert_msg(check_msg->apc[1].pcv[18] == 125, "incorrect value for apc[1].pcv[18], expected 125, is %d", check_msg->apc[1].pcv[18]); - ck_assert_msg(check_msg->apc[1].pcv[19] == 106, "incorrect value for apc[1].pcv[19], expected 106, is %d", check_msg->apc[1].pcv[19]); - ck_assert_msg(check_msg->apc[1].pcv[20] == -98, "incorrect value for apc[1].pcv[20], expected -98, is %d", check_msg->apc[1].pcv[20]); - ck_assert_msg(check_msg->apc[1].sat_info == 49, "incorrect value for apc[1].sat_info, expected 49, is %d", check_msg->apc[1].sat_info); - ck_assert_msg(check_msg->apc[1].sid.code == 123, "incorrect value for apc[1].sid.code, expected 123, is %d", check_msg->apc[1].sid.code); - ck_assert_msg(check_msg->apc[1].sid.sat == 148, "incorrect value for apc[1].sid.sat, expected 148, is %d", check_msg->apc[1].sid.sat); - ck_assert_msg(check_msg->apc[1].svn == 24967, "incorrect value for apc[1].svn, expected 24967, is %d", check_msg->apc[1].svn); - ck_assert_msg(check_msg->apc[2].pco[0] == -7596, "incorrect value for apc[2].pco[0], expected -7596, is %d", check_msg->apc[2].pco[0]); - ck_assert_msg(check_msg->apc[2].pco[1] == 31630, "incorrect value for apc[2].pco[1], expected 31630, is %d", check_msg->apc[2].pco[1]); - ck_assert_msg(check_msg->apc[2].pco[2] == -9907, "incorrect value for apc[2].pco[2], expected -9907, is %d", check_msg->apc[2].pco[2]); - ck_assert_msg(check_msg->apc[2].pcv[0] == -8, "incorrect value for apc[2].pcv[0], expected -8, is %d", check_msg->apc[2].pcv[0]); - ck_assert_msg(check_msg->apc[2].pcv[1] == 67, "incorrect value for apc[2].pcv[1], expected 67, is %d", check_msg->apc[2].pcv[1]); - ck_assert_msg(check_msg->apc[2].pcv[2] == -41, "incorrect value for apc[2].pcv[2], expected -41, is %d", check_msg->apc[2].pcv[2]); - ck_assert_msg(check_msg->apc[2].pcv[3] == -127, "incorrect value for apc[2].pcv[3], expected -127, is %d", check_msg->apc[2].pcv[3]); - ck_assert_msg(check_msg->apc[2].pcv[4] == 114, "incorrect value for apc[2].pcv[4], expected 114, is %d", check_msg->apc[2].pcv[4]); - ck_assert_msg(check_msg->apc[2].pcv[5] == -118, "incorrect value for apc[2].pcv[5], expected -118, is %d", check_msg->apc[2].pcv[5]); - ck_assert_msg(check_msg->apc[2].pcv[6] == 25, "incorrect value for apc[2].pcv[6], expected 25, is %d", check_msg->apc[2].pcv[6]); - ck_assert_msg(check_msg->apc[2].pcv[7] == -16, "incorrect value for apc[2].pcv[7], expected -16, is %d", check_msg->apc[2].pcv[7]); - ck_assert_msg(check_msg->apc[2].pcv[8] == 10, "incorrect value for apc[2].pcv[8], expected 10, is %d", check_msg->apc[2].pcv[8]); - ck_assert_msg(check_msg->apc[2].pcv[9] == 56, "incorrect value for apc[2].pcv[9], expected 56, is %d", check_msg->apc[2].pcv[9]); - ck_assert_msg(check_msg->apc[2].pcv[10] == 76, "incorrect value for apc[2].pcv[10], expected 76, is %d", check_msg->apc[2].pcv[10]); - ck_assert_msg(check_msg->apc[2].pcv[11] == 61, "incorrect value for apc[2].pcv[11], expected 61, is %d", check_msg->apc[2].pcv[11]); - ck_assert_msg(check_msg->apc[2].pcv[12] == -95, "incorrect value for apc[2].pcv[12], expected -95, is %d", check_msg->apc[2].pcv[12]); - ck_assert_msg(check_msg->apc[2].pcv[13] == -40, "incorrect value for apc[2].pcv[13], expected -40, is %d", check_msg->apc[2].pcv[13]); - ck_assert_msg(check_msg->apc[2].pcv[14] == 22, "incorrect value for apc[2].pcv[14], expected 22, is %d", check_msg->apc[2].pcv[14]); - ck_assert_msg(check_msg->apc[2].pcv[15] == -75, "incorrect value for apc[2].pcv[15], expected -75, is %d", check_msg->apc[2].pcv[15]); - ck_assert_msg(check_msg->apc[2].pcv[16] == -82, "incorrect value for apc[2].pcv[16], expected -82, is %d", check_msg->apc[2].pcv[16]); - ck_assert_msg(check_msg->apc[2].pcv[17] == 33, "incorrect value for apc[2].pcv[17], expected 33, is %d", check_msg->apc[2].pcv[17]); - ck_assert_msg(check_msg->apc[2].pcv[18] == 13, "incorrect value for apc[2].pcv[18], expected 13, is %d", check_msg->apc[2].pcv[18]); - ck_assert_msg(check_msg->apc[2].pcv[19] == -4, "incorrect value for apc[2].pcv[19], expected -4, is %d", check_msg->apc[2].pcv[19]); - ck_assert_msg(check_msg->apc[2].pcv[20] == -20, "incorrect value for apc[2].pcv[20], expected -20, is %d", check_msg->apc[2].pcv[20]); - ck_assert_msg(check_msg->apc[2].sat_info == 181, "incorrect value for apc[2].sat_info, expected 181, is %d", check_msg->apc[2].sat_info); - ck_assert_msg(check_msg->apc[2].sid.code == 188, "incorrect value for apc[2].sid.code, expected 188, is %d", check_msg->apc[2].sid.code); - ck_assert_msg(check_msg->apc[2].sid.sat == 83, "incorrect value for apc[2].sid.sat, expected 83, is %d", check_msg->apc[2].sid.sat); - ck_assert_msg(check_msg->apc[2].svn == 7106, "incorrect value for apc[2].svn, expected 7106, is %d", check_msg->apc[2].svn); - ck_assert_msg(check_msg->apc[3].pco[0] == -19478, "incorrect value for apc[3].pco[0], expected -19478, is %d", check_msg->apc[3].pco[0]); - ck_assert_msg(check_msg->apc[3].pco[1] == 11484, "incorrect value for apc[3].pco[1], expected 11484, is %d", check_msg->apc[3].pco[1]); - ck_assert_msg(check_msg->apc[3].pco[2] == 14804, "incorrect value for apc[3].pco[2], expected 14804, is %d", check_msg->apc[3].pco[2]); - ck_assert_msg(check_msg->apc[3].pcv[0] == 44, "incorrect value for apc[3].pcv[0], expected 44, is %d", check_msg->apc[3].pcv[0]); - ck_assert_msg(check_msg->apc[3].pcv[1] == -83, "incorrect value for apc[3].pcv[1], expected -83, is %d", check_msg->apc[3].pcv[1]); - ck_assert_msg(check_msg->apc[3].pcv[2] == 49, "incorrect value for apc[3].pcv[2], expected 49, is %d", check_msg->apc[3].pcv[2]); - ck_assert_msg(check_msg->apc[3].pcv[3] == 36, "incorrect value for apc[3].pcv[3], expected 36, is %d", check_msg->apc[3].pcv[3]); - ck_assert_msg(check_msg->apc[3].pcv[4] == -119, "incorrect value for apc[3].pcv[4], expected -119, is %d", check_msg->apc[3].pcv[4]); - ck_assert_msg(check_msg->apc[3].pcv[5] == -8, "incorrect value for apc[3].pcv[5], expected -8, is %d", check_msg->apc[3].pcv[5]); - ck_assert_msg(check_msg->apc[3].pcv[6] == -21, "incorrect value for apc[3].pcv[6], expected -21, is %d", check_msg->apc[3].pcv[6]); - ck_assert_msg(check_msg->apc[3].pcv[7] == 97, "incorrect value for apc[3].pcv[7], expected 97, is %d", check_msg->apc[3].pcv[7]); - ck_assert_msg(check_msg->apc[3].pcv[8] == 112, "incorrect value for apc[3].pcv[8], expected 112, is %d", check_msg->apc[3].pcv[8]); - ck_assert_msg(check_msg->apc[3].pcv[9] == -99, "incorrect value for apc[3].pcv[9], expected -99, is %d", check_msg->apc[3].pcv[9]); - ck_assert_msg(check_msg->apc[3].pcv[10] == -117, "incorrect value for apc[3].pcv[10], expected -117, is %d", check_msg->apc[3].pcv[10]); - ck_assert_msg(check_msg->apc[3].pcv[11] == 26, "incorrect value for apc[3].pcv[11], expected 26, is %d", check_msg->apc[3].pcv[11]); - ck_assert_msg(check_msg->apc[3].pcv[12] == 115, "incorrect value for apc[3].pcv[12], expected 115, is %d", check_msg->apc[3].pcv[12]); - ck_assert_msg(check_msg->apc[3].pcv[13] == -64, "incorrect value for apc[3].pcv[13], expected -64, is %d", check_msg->apc[3].pcv[13]); - ck_assert_msg(check_msg->apc[3].pcv[14] == 31, "incorrect value for apc[3].pcv[14], expected 31, is %d", check_msg->apc[3].pcv[14]); - ck_assert_msg(check_msg->apc[3].pcv[15] == 85, "incorrect value for apc[3].pcv[15], expected 85, is %d", check_msg->apc[3].pcv[15]); - ck_assert_msg(check_msg->apc[3].pcv[16] == 127, "incorrect value for apc[3].pcv[16], expected 127, is %d", check_msg->apc[3].pcv[16]); - ck_assert_msg(check_msg->apc[3].pcv[17] == -28, "incorrect value for apc[3].pcv[17], expected -28, is %d", check_msg->apc[3].pcv[17]); - ck_assert_msg(check_msg->apc[3].pcv[18] == 81, "incorrect value for apc[3].pcv[18], expected 81, is %d", check_msg->apc[3].pcv[18]); - ck_assert_msg(check_msg->apc[3].pcv[19] == -4, "incorrect value for apc[3].pcv[19], expected -4, is %d", check_msg->apc[3].pcv[19]); - ck_assert_msg(check_msg->apc[3].pcv[20] == -37, "incorrect value for apc[3].pcv[20], expected -37, is %d", check_msg->apc[3].pcv[20]); - ck_assert_msg(check_msg->apc[3].sat_info == 128, "incorrect value for apc[3].sat_info, expected 128, is %d", check_msg->apc[3].sat_info); - ck_assert_msg(check_msg->apc[3].sid.code == 196, "incorrect value for apc[3].sid.code, expected 196, is %d", check_msg->apc[3].sid.code); - ck_assert_msg(check_msg->apc[3].sid.sat == 230, "incorrect value for apc[3].sid.sat, expected 230, is %d", check_msg->apc[3].sid.sat); - ck_assert_msg(check_msg->apc[3].svn == 61399, "incorrect value for apc[3].svn, expected 61399, is %d", check_msg->apc[3].svn); - ck_assert_msg(check_msg->apc[4].pco[0] == -11049, "incorrect value for apc[4].pco[0], expected -11049, is %d", check_msg->apc[4].pco[0]); - ck_assert_msg(check_msg->apc[4].pco[1] == 6580, "incorrect value for apc[4].pco[1], expected 6580, is %d", check_msg->apc[4].pco[1]); - ck_assert_msg(check_msg->apc[4].pco[2] == -28589, "incorrect value for apc[4].pco[2], expected -28589, is %d", check_msg->apc[4].pco[2]); - ck_assert_msg(check_msg->apc[4].pcv[0] == -9, "incorrect value for apc[4].pcv[0], expected -9, is %d", check_msg->apc[4].pcv[0]); - ck_assert_msg(check_msg->apc[4].pcv[1] == 12, "incorrect value for apc[4].pcv[1], expected 12, is %d", check_msg->apc[4].pcv[1]); - ck_assert_msg(check_msg->apc[4].pcv[2] == 27, "incorrect value for apc[4].pcv[2], expected 27, is %d", check_msg->apc[4].pcv[2]); - ck_assert_msg(check_msg->apc[4].pcv[3] == -57, "incorrect value for apc[4].pcv[3], expected -57, is %d", check_msg->apc[4].pcv[3]); - ck_assert_msg(check_msg->apc[4].pcv[4] == -83, "incorrect value for apc[4].pcv[4], expected -83, is %d", check_msg->apc[4].pcv[4]); - ck_assert_msg(check_msg->apc[4].pcv[5] == 74, "incorrect value for apc[4].pcv[5], expected 74, is %d", check_msg->apc[4].pcv[5]); - ck_assert_msg(check_msg->apc[4].pcv[6] == 23, "incorrect value for apc[4].pcv[6], expected 23, is %d", check_msg->apc[4].pcv[6]); - ck_assert_msg(check_msg->apc[4].pcv[7] == 4, "incorrect value for apc[4].pcv[7], expected 4, is %d", check_msg->apc[4].pcv[7]); - ck_assert_msg(check_msg->apc[4].pcv[8] == -17, "incorrect value for apc[4].pcv[8], expected -17, is %d", check_msg->apc[4].pcv[8]); - ck_assert_msg(check_msg->apc[4].pcv[9] == 103, "incorrect value for apc[4].pcv[9], expected 103, is %d", check_msg->apc[4].pcv[9]); - ck_assert_msg(check_msg->apc[4].pcv[10] == -33, "incorrect value for apc[4].pcv[10], expected -33, is %d", check_msg->apc[4].pcv[10]); - ck_assert_msg(check_msg->apc[4].pcv[11] == -36, "incorrect value for apc[4].pcv[11], expected -36, is %d", check_msg->apc[4].pcv[11]); - ck_assert_msg(check_msg->apc[4].pcv[12] == -117, "incorrect value for apc[4].pcv[12], expected -117, is %d", check_msg->apc[4].pcv[12]); - ck_assert_msg(check_msg->apc[4].pcv[13] == 91, "incorrect value for apc[4].pcv[13], expected 91, is %d", check_msg->apc[4].pcv[13]); - ck_assert_msg(check_msg->apc[4].pcv[14] == 127, "incorrect value for apc[4].pcv[14], expected 127, is %d", check_msg->apc[4].pcv[14]); - ck_assert_msg(check_msg->apc[4].pcv[15] == -42, "incorrect value for apc[4].pcv[15], expected -42, is %d", check_msg->apc[4].pcv[15]); - ck_assert_msg(check_msg->apc[4].pcv[16] == 86, "incorrect value for apc[4].pcv[16], expected 86, is %d", check_msg->apc[4].pcv[16]); - ck_assert_msg(check_msg->apc[4].pcv[17] == 48, "incorrect value for apc[4].pcv[17], expected 48, is %d", check_msg->apc[4].pcv[17]); - ck_assert_msg(check_msg->apc[4].pcv[18] == -53, "incorrect value for apc[4].pcv[18], expected -53, is %d", check_msg->apc[4].pcv[18]); - ck_assert_msg(check_msg->apc[4].pcv[19] == -28, "incorrect value for apc[4].pcv[19], expected -28, is %d", check_msg->apc[4].pcv[19]); - ck_assert_msg(check_msg->apc[4].pcv[20] == 99, "incorrect value for apc[4].pcv[20], expected 99, is %d", check_msg->apc[4].pcv[20]); - ck_assert_msg(check_msg->apc[4].sat_info == 147, "incorrect value for apc[4].sat_info, expected 147, is %d", check_msg->apc[4].sat_info); - ck_assert_msg(check_msg->apc[4].sid.code == 110, "incorrect value for apc[4].sid.code, expected 110, is %d", check_msg->apc[4].sid.code); - ck_assert_msg(check_msg->apc[4].sid.sat == 249, "incorrect value for apc[4].sid.sat, expected 249, is %d", check_msg->apc[4].sid.sat); - ck_assert_msg(check_msg->apc[4].svn == 41224, "incorrect value for apc[4].svn, expected 41224, is %d", check_msg->apc[4].svn); - ck_assert_msg(check_msg->apc[5].pco[0] == -21881, "incorrect value for apc[5].pco[0], expected -21881, is %d", check_msg->apc[5].pco[0]); - ck_assert_msg(check_msg->apc[5].pco[1] == -9942, "incorrect value for apc[5].pco[1], expected -9942, is %d", check_msg->apc[5].pco[1]); - ck_assert_msg(check_msg->apc[5].pco[2] == -5689, "incorrect value for apc[5].pco[2], expected -5689, is %d", check_msg->apc[5].pco[2]); - ck_assert_msg(check_msg->apc[5].pcv[0] == 42, "incorrect value for apc[5].pcv[0], expected 42, is %d", check_msg->apc[5].pcv[0]); - ck_assert_msg(check_msg->apc[5].pcv[1] == -86, "incorrect value for apc[5].pcv[1], expected -86, is %d", check_msg->apc[5].pcv[1]); - ck_assert_msg(check_msg->apc[5].pcv[2] == 78, "incorrect value for apc[5].pcv[2], expected 78, is %d", check_msg->apc[5].pcv[2]); - ck_assert_msg(check_msg->apc[5].pcv[3] == -50, "incorrect value for apc[5].pcv[3], expected -50, is %d", check_msg->apc[5].pcv[3]); - ck_assert_msg(check_msg->apc[5].pcv[4] == 41, "incorrect value for apc[5].pcv[4], expected 41, is %d", check_msg->apc[5].pcv[4]); - ck_assert_msg(check_msg->apc[5].pcv[5] == 43, "incorrect value for apc[5].pcv[5], expected 43, is %d", check_msg->apc[5].pcv[5]); - ck_assert_msg(check_msg->apc[5].pcv[6] == 81, "incorrect value for apc[5].pcv[6], expected 81, is %d", check_msg->apc[5].pcv[6]); - ck_assert_msg(check_msg->apc[5].pcv[7] == -9, "incorrect value for apc[5].pcv[7], expected -9, is %d", check_msg->apc[5].pcv[7]); - ck_assert_msg(check_msg->apc[5].pcv[8] == 99, "incorrect value for apc[5].pcv[8], expected 99, is %d", check_msg->apc[5].pcv[8]); - ck_assert_msg(check_msg->apc[5].pcv[9] == -58, "incorrect value for apc[5].pcv[9], expected -58, is %d", check_msg->apc[5].pcv[9]); - ck_assert_msg(check_msg->apc[5].pcv[10] == -112, "incorrect value for apc[5].pcv[10], expected -112, is %d", check_msg->apc[5].pcv[10]); - ck_assert_msg(check_msg->apc[5].pcv[11] == 2, "incorrect value for apc[5].pcv[11], expected 2, is %d", check_msg->apc[5].pcv[11]); - ck_assert_msg(check_msg->apc[5].pcv[12] == -124, "incorrect value for apc[5].pcv[12], expected -124, is %d", check_msg->apc[5].pcv[12]); - ck_assert_msg(check_msg->apc[5].pcv[13] == 2, "incorrect value for apc[5].pcv[13], expected 2, is %d", check_msg->apc[5].pcv[13]); - ck_assert_msg(check_msg->apc[5].pcv[14] == -32, "incorrect value for apc[5].pcv[14], expected -32, is %d", check_msg->apc[5].pcv[14]); - ck_assert_msg(check_msg->apc[5].pcv[15] == -36, "incorrect value for apc[5].pcv[15], expected -36, is %d", check_msg->apc[5].pcv[15]); - ck_assert_msg(check_msg->apc[5].pcv[16] == -108, "incorrect value for apc[5].pcv[16], expected -108, is %d", check_msg->apc[5].pcv[16]); - ck_assert_msg(check_msg->apc[5].pcv[17] == 58, "incorrect value for apc[5].pcv[17], expected 58, is %d", check_msg->apc[5].pcv[17]); - ck_assert_msg(check_msg->apc[5].pcv[18] == 85, "incorrect value for apc[5].pcv[18], expected 85, is %d", check_msg->apc[5].pcv[18]); - ck_assert_msg(check_msg->apc[5].pcv[19] == -118, "incorrect value for apc[5].pcv[19], expected -118, is %d", check_msg->apc[5].pcv[19]); - ck_assert_msg(check_msg->apc[5].pcv[20] == -46, "incorrect value for apc[5].pcv[20], expected -46, is %d", check_msg->apc[5].pcv[20]); - ck_assert_msg(check_msg->apc[5].sat_info == 159, "incorrect value for apc[5].sat_info, expected 159, is %d", check_msg->apc[5].sat_info); - ck_assert_msg(check_msg->apc[5].sid.code == 83, "incorrect value for apc[5].sid.code, expected 83, is %d", check_msg->apc[5].sid.code); - ck_assert_msg(check_msg->apc[5].sid.sat == 45, "incorrect value for apc[5].sid.sat, expected 45, is %d", check_msg->apc[5].sid.sat); - ck_assert_msg(check_msg->apc[5].svn == 64011, "incorrect value for apc[5].svn, expected 64011, is %d", check_msg->apc[5].svn); - ck_assert_msg(check_msg->apc[6].pco[0] == -14290, "incorrect value for apc[6].pco[0], expected -14290, is %d", check_msg->apc[6].pco[0]); - ck_assert_msg(check_msg->apc[6].pco[1] == 30340, "incorrect value for apc[6].pco[1], expected 30340, is %d", check_msg->apc[6].pco[1]); - ck_assert_msg(check_msg->apc[6].pco[2] == 3569, "incorrect value for apc[6].pco[2], expected 3569, is %d", check_msg->apc[6].pco[2]); - ck_assert_msg(check_msg->apc[6].pcv[0] == 37, "incorrect value for apc[6].pcv[0], expected 37, is %d", check_msg->apc[6].pcv[0]); - ck_assert_msg(check_msg->apc[6].pcv[1] == 62, "incorrect value for apc[6].pcv[1], expected 62, is %d", check_msg->apc[6].pcv[1]); - ck_assert_msg(check_msg->apc[6].pcv[2] == 107, "incorrect value for apc[6].pcv[2], expected 107, is %d", check_msg->apc[6].pcv[2]); - ck_assert_msg(check_msg->apc[6].pcv[3] == -3, "incorrect value for apc[6].pcv[3], expected -3, is %d", check_msg->apc[6].pcv[3]); - ck_assert_msg(check_msg->apc[6].pcv[4] == -66, "incorrect value for apc[6].pcv[4], expected -66, is %d", check_msg->apc[6].pcv[4]); - ck_assert_msg(check_msg->apc[6].pcv[5] == -120, "incorrect value for apc[6].pcv[5], expected -120, is %d", check_msg->apc[6].pcv[5]); - ck_assert_msg(check_msg->apc[6].pcv[6] == 66, "incorrect value for apc[6].pcv[6], expected 66, is %d", check_msg->apc[6].pcv[6]); - ck_assert_msg(check_msg->apc[6].pcv[7] == 9, "incorrect value for apc[6].pcv[7], expected 9, is %d", check_msg->apc[6].pcv[7]); - ck_assert_msg(check_msg->apc[6].pcv[8] == 84, "incorrect value for apc[6].pcv[8], expected 84, is %d", check_msg->apc[6].pcv[8]); - ck_assert_msg(check_msg->apc[6].pcv[9] == -101, "incorrect value for apc[6].pcv[9], expected -101, is %d", check_msg->apc[6].pcv[9]); - ck_assert_msg(check_msg->apc[6].pcv[10] == 86, "incorrect value for apc[6].pcv[10], expected 86, is %d", check_msg->apc[6].pcv[10]); - ck_assert_msg(check_msg->apc[6].pcv[11] == -76, "incorrect value for apc[6].pcv[11], expected -76, is %d", check_msg->apc[6].pcv[11]); - ck_assert_msg(check_msg->apc[6].pcv[12] == 41, "incorrect value for apc[6].pcv[12], expected 41, is %d", check_msg->apc[6].pcv[12]); - ck_assert_msg(check_msg->apc[6].pcv[13] == -60, "incorrect value for apc[6].pcv[13], expected -60, is %d", check_msg->apc[6].pcv[13]); - ck_assert_msg(check_msg->apc[6].pcv[14] == 40, "incorrect value for apc[6].pcv[14], expected 40, is %d", check_msg->apc[6].pcv[14]); - ck_assert_msg(check_msg->apc[6].pcv[15] == 119, "incorrect value for apc[6].pcv[15], expected 119, is %d", check_msg->apc[6].pcv[15]); - ck_assert_msg(check_msg->apc[6].pcv[16] == 101, "incorrect value for apc[6].pcv[16], expected 101, is %d", check_msg->apc[6].pcv[16]); - ck_assert_msg(check_msg->apc[6].pcv[17] == -4, "incorrect value for apc[6].pcv[17], expected -4, is %d", check_msg->apc[6].pcv[17]); - ck_assert_msg(check_msg->apc[6].pcv[18] == -33, "incorrect value for apc[6].pcv[18], expected -33, is %d", check_msg->apc[6].pcv[18]); - ck_assert_msg(check_msg->apc[6].pcv[19] == -112, "incorrect value for apc[6].pcv[19], expected -112, is %d", check_msg->apc[6].pcv[19]); - ck_assert_msg(check_msg->apc[6].pcv[20] == -103, "incorrect value for apc[6].pcv[20], expected -103, is %d", check_msg->apc[6].pcv[20]); - ck_assert_msg(check_msg->apc[6].sat_info == 7, "incorrect value for apc[6].sat_info, expected 7, is %d", check_msg->apc[6].sat_info); - ck_assert_msg(check_msg->apc[6].sid.code == 158, "incorrect value for apc[6].sid.code, expected 158, is %d", check_msg->apc[6].sid.code); - ck_assert_msg(check_msg->apc[6].sid.sat == 200, "incorrect value for apc[6].sid.sat, expected 200, is %d", check_msg->apc[6].sid.sat); - ck_assert_msg(check_msg->apc[6].svn == 17310, "incorrect value for apc[6].svn, expected 17310, is %d", check_msg->apc[6].svn); + ck_assert_msg(check_msg->apc[0].pco[0] == -21547, + "incorrect value for apc[0].pco[0], expected -21547, is %d", + check_msg->apc[0].pco[0]); + ck_assert_msg(check_msg->apc[0].pco[1] == -10498, + "incorrect value for apc[0].pco[1], expected -10498, is %d", + check_msg->apc[0].pco[1]); + ck_assert_msg(check_msg->apc[0].pco[2] == 1236, + "incorrect value for apc[0].pco[2], expected 1236, is %d", + check_msg->apc[0].pco[2]); + ck_assert_msg(check_msg->apc[0].pcv[0] == 8, + "incorrect value for apc[0].pcv[0], expected 8, is %d", + check_msg->apc[0].pcv[0]); + ck_assert_msg(check_msg->apc[0].pcv[1] == 33, + "incorrect value for apc[0].pcv[1], expected 33, is %d", + check_msg->apc[0].pcv[1]); + ck_assert_msg(check_msg->apc[0].pcv[2] == 31, + "incorrect value for apc[0].pcv[2], expected 31, is %d", + check_msg->apc[0].pcv[2]); + ck_assert_msg(check_msg->apc[0].pcv[3] == 80, + "incorrect value for apc[0].pcv[3], expected 80, is %d", + check_msg->apc[0].pcv[3]); + ck_assert_msg(check_msg->apc[0].pcv[4] == 21, + "incorrect value for apc[0].pcv[4], expected 21, is %d", + check_msg->apc[0].pcv[4]); + ck_assert_msg(check_msg->apc[0].pcv[5] == 4, + "incorrect value for apc[0].pcv[5], expected 4, is %d", + check_msg->apc[0].pcv[5]); + ck_assert_msg(check_msg->apc[0].pcv[6] == 105, + "incorrect value for apc[0].pcv[6], expected 105, is %d", + check_msg->apc[0].pcv[6]); + ck_assert_msg(check_msg->apc[0].pcv[7] == -31, + "incorrect value for apc[0].pcv[7], expected -31, is %d", + check_msg->apc[0].pcv[7]); + ck_assert_msg(check_msg->apc[0].pcv[8] == 39, + "incorrect value for apc[0].pcv[8], expected 39, is %d", + check_msg->apc[0].pcv[8]); + ck_assert_msg(check_msg->apc[0].pcv[9] == -117, + "incorrect value for apc[0].pcv[9], expected -117, is %d", + check_msg->apc[0].pcv[9]); + ck_assert_msg(check_msg->apc[0].pcv[10] == 124, + "incorrect value for apc[0].pcv[10], expected 124, is %d", + check_msg->apc[0].pcv[10]); + ck_assert_msg(check_msg->apc[0].pcv[11] == -107, + "incorrect value for apc[0].pcv[11], expected -107, is %d", + check_msg->apc[0].pcv[11]); + ck_assert_msg(check_msg->apc[0].pcv[12] == 48, + "incorrect value for apc[0].pcv[12], expected 48, is %d", + check_msg->apc[0].pcv[12]); + ck_assert_msg(check_msg->apc[0].pcv[13] == 15, + "incorrect value for apc[0].pcv[13], expected 15, is %d", + check_msg->apc[0].pcv[13]); + ck_assert_msg(check_msg->apc[0].pcv[14] == -42, + "incorrect value for apc[0].pcv[14], expected -42, is %d", + check_msg->apc[0].pcv[14]); + ck_assert_msg(check_msg->apc[0].pcv[15] == -59, + "incorrect value for apc[0].pcv[15], expected -59, is %d", + check_msg->apc[0].pcv[15]); + ck_assert_msg(check_msg->apc[0].pcv[16] == -115, + "incorrect value for apc[0].pcv[16], expected -115, is %d", + check_msg->apc[0].pcv[16]); + ck_assert_msg(check_msg->apc[0].pcv[17] == 32, + "incorrect value for apc[0].pcv[17], expected 32, is %d", + check_msg->apc[0].pcv[17]); + ck_assert_msg(check_msg->apc[0].pcv[18] == 33, + "incorrect value for apc[0].pcv[18], expected 33, is %d", + check_msg->apc[0].pcv[18]); + ck_assert_msg(check_msg->apc[0].pcv[19] == -121, + "incorrect value for apc[0].pcv[19], expected -121, is %d", + check_msg->apc[0].pcv[19]); + ck_assert_msg(check_msg->apc[0].pcv[20] == -106, + "incorrect value for apc[0].pcv[20], expected -106, is %d", + check_msg->apc[0].pcv[20]); + ck_assert_msg(check_msg->apc[0].sat_info == 240, + "incorrect value for apc[0].sat_info, expected 240, is %d", + check_msg->apc[0].sat_info); + ck_assert_msg(check_msg->apc[0].sid.code == 169, + "incorrect value for apc[0].sid.code, expected 169, is %d", + check_msg->apc[0].sid.code); + ck_assert_msg(check_msg->apc[0].sid.sat == 203, + "incorrect value for apc[0].sid.sat, expected 203, is %d", + check_msg->apc[0].sid.sat); + ck_assert_msg(check_msg->apc[0].svn == 1102, + "incorrect value for apc[0].svn, expected 1102, is %d", + check_msg->apc[0].svn); + ck_assert_msg(check_msg->apc[1].pco[0] == 23079, + "incorrect value for apc[1].pco[0], expected 23079, is %d", + check_msg->apc[1].pco[0]); + ck_assert_msg(check_msg->apc[1].pco[1] == -22252, + "incorrect value for apc[1].pco[1], expected -22252, is %d", + check_msg->apc[1].pco[1]); + ck_assert_msg(check_msg->apc[1].pco[2] == 12271, + "incorrect value for apc[1].pco[2], expected 12271, is %d", + check_msg->apc[1].pco[2]); + ck_assert_msg(check_msg->apc[1].pcv[0] == -103, + "incorrect value for apc[1].pcv[0], expected -103, is %d", + check_msg->apc[1].pcv[0]); + ck_assert_msg(check_msg->apc[1].pcv[1] == -81, + "incorrect value for apc[1].pcv[1], expected -81, is %d", + check_msg->apc[1].pcv[1]); + ck_assert_msg(check_msg->apc[1].pcv[2] == 35, + "incorrect value for apc[1].pcv[2], expected 35, is %d", + check_msg->apc[1].pcv[2]); + ck_assert_msg(check_msg->apc[1].pcv[3] == -111, + "incorrect value for apc[1].pcv[3], expected -111, is %d", + check_msg->apc[1].pcv[3]); + ck_assert_msg(check_msg->apc[1].pcv[4] == -111, + "incorrect value for apc[1].pcv[4], expected -111, is %d", + check_msg->apc[1].pcv[4]); + ck_assert_msg(check_msg->apc[1].pcv[5] == 123, + "incorrect value for apc[1].pcv[5], expected 123, is %d", + check_msg->apc[1].pcv[5]); + ck_assert_msg(check_msg->apc[1].pcv[6] == -62, + "incorrect value for apc[1].pcv[6], expected -62, is %d", + check_msg->apc[1].pcv[6]); + ck_assert_msg(check_msg->apc[1].pcv[7] == 2, + "incorrect value for apc[1].pcv[7], expected 2, is %d", + check_msg->apc[1].pcv[7]); + ck_assert_msg(check_msg->apc[1].pcv[8] == 102, + "incorrect value for apc[1].pcv[8], expected 102, is %d", + check_msg->apc[1].pcv[8]); + ck_assert_msg(check_msg->apc[1].pcv[9] == 74, + "incorrect value for apc[1].pcv[9], expected 74, is %d", + check_msg->apc[1].pcv[9]); + ck_assert_msg(check_msg->apc[1].pcv[10] == -107, + "incorrect value for apc[1].pcv[10], expected -107, is %d", + check_msg->apc[1].pcv[10]); + ck_assert_msg(check_msg->apc[1].pcv[11] == 95, + "incorrect value for apc[1].pcv[11], expected 95, is %d", + check_msg->apc[1].pcv[11]); + ck_assert_msg(check_msg->apc[1].pcv[12] == -85, + "incorrect value for apc[1].pcv[12], expected -85, is %d", + check_msg->apc[1].pcv[12]); + ck_assert_msg(check_msg->apc[1].pcv[13] == -18, + "incorrect value for apc[1].pcv[13], expected -18, is %d", + check_msg->apc[1].pcv[13]); + ck_assert_msg(check_msg->apc[1].pcv[14] == -7, + "incorrect value for apc[1].pcv[14], expected -7, is %d", + check_msg->apc[1].pcv[14]); + ck_assert_msg(check_msg->apc[1].pcv[15] == 7, + "incorrect value for apc[1].pcv[15], expected 7, is %d", + check_msg->apc[1].pcv[15]); + ck_assert_msg(check_msg->apc[1].pcv[16] == -19, + "incorrect value for apc[1].pcv[16], expected -19, is %d", + check_msg->apc[1].pcv[16]); + ck_assert_msg(check_msg->apc[1].pcv[17] == -86, + "incorrect value for apc[1].pcv[17], expected -86, is %d", + check_msg->apc[1].pcv[17]); + ck_assert_msg(check_msg->apc[1].pcv[18] == 125, + "incorrect value for apc[1].pcv[18], expected 125, is %d", + check_msg->apc[1].pcv[18]); + ck_assert_msg(check_msg->apc[1].pcv[19] == 106, + "incorrect value for apc[1].pcv[19], expected 106, is %d", + check_msg->apc[1].pcv[19]); + ck_assert_msg(check_msg->apc[1].pcv[20] == -98, + "incorrect value for apc[1].pcv[20], expected -98, is %d", + check_msg->apc[1].pcv[20]); + ck_assert_msg(check_msg->apc[1].sat_info == 49, + "incorrect value for apc[1].sat_info, expected 49, is %d", + check_msg->apc[1].sat_info); + ck_assert_msg(check_msg->apc[1].sid.code == 123, + "incorrect value for apc[1].sid.code, expected 123, is %d", + check_msg->apc[1].sid.code); + ck_assert_msg(check_msg->apc[1].sid.sat == 148, + "incorrect value for apc[1].sid.sat, expected 148, is %d", + check_msg->apc[1].sid.sat); + ck_assert_msg(check_msg->apc[1].svn == 24967, + "incorrect value for apc[1].svn, expected 24967, is %d", + check_msg->apc[1].svn); + ck_assert_msg(check_msg->apc[2].pco[0] == -7596, + "incorrect value for apc[2].pco[0], expected -7596, is %d", + check_msg->apc[2].pco[0]); + ck_assert_msg(check_msg->apc[2].pco[1] == 31630, + "incorrect value for apc[2].pco[1], expected 31630, is %d", + check_msg->apc[2].pco[1]); + ck_assert_msg(check_msg->apc[2].pco[2] == -9907, + "incorrect value for apc[2].pco[2], expected -9907, is %d", + check_msg->apc[2].pco[2]); + ck_assert_msg(check_msg->apc[2].pcv[0] == -8, + "incorrect value for apc[2].pcv[0], expected -8, is %d", + check_msg->apc[2].pcv[0]); + ck_assert_msg(check_msg->apc[2].pcv[1] == 67, + "incorrect value for apc[2].pcv[1], expected 67, is %d", + check_msg->apc[2].pcv[1]); + ck_assert_msg(check_msg->apc[2].pcv[2] == -41, + "incorrect value for apc[2].pcv[2], expected -41, is %d", + check_msg->apc[2].pcv[2]); + ck_assert_msg(check_msg->apc[2].pcv[3] == -127, + "incorrect value for apc[2].pcv[3], expected -127, is %d", + check_msg->apc[2].pcv[3]); + ck_assert_msg(check_msg->apc[2].pcv[4] == 114, + "incorrect value for apc[2].pcv[4], expected 114, is %d", + check_msg->apc[2].pcv[4]); + ck_assert_msg(check_msg->apc[2].pcv[5] == -118, + "incorrect value for apc[2].pcv[5], expected -118, is %d", + check_msg->apc[2].pcv[5]); + ck_assert_msg(check_msg->apc[2].pcv[6] == 25, + "incorrect value for apc[2].pcv[6], expected 25, is %d", + check_msg->apc[2].pcv[6]); + ck_assert_msg(check_msg->apc[2].pcv[7] == -16, + "incorrect value for apc[2].pcv[7], expected -16, is %d", + check_msg->apc[2].pcv[7]); + ck_assert_msg(check_msg->apc[2].pcv[8] == 10, + "incorrect value for apc[2].pcv[8], expected 10, is %d", + check_msg->apc[2].pcv[8]); + ck_assert_msg(check_msg->apc[2].pcv[9] == 56, + "incorrect value for apc[2].pcv[9], expected 56, is %d", + check_msg->apc[2].pcv[9]); + ck_assert_msg(check_msg->apc[2].pcv[10] == 76, + "incorrect value for apc[2].pcv[10], expected 76, is %d", + check_msg->apc[2].pcv[10]); + ck_assert_msg(check_msg->apc[2].pcv[11] == 61, + "incorrect value for apc[2].pcv[11], expected 61, is %d", + check_msg->apc[2].pcv[11]); + ck_assert_msg(check_msg->apc[2].pcv[12] == -95, + "incorrect value for apc[2].pcv[12], expected -95, is %d", + check_msg->apc[2].pcv[12]); + ck_assert_msg(check_msg->apc[2].pcv[13] == -40, + "incorrect value for apc[2].pcv[13], expected -40, is %d", + check_msg->apc[2].pcv[13]); + ck_assert_msg(check_msg->apc[2].pcv[14] == 22, + "incorrect value for apc[2].pcv[14], expected 22, is %d", + check_msg->apc[2].pcv[14]); + ck_assert_msg(check_msg->apc[2].pcv[15] == -75, + "incorrect value for apc[2].pcv[15], expected -75, is %d", + check_msg->apc[2].pcv[15]); + ck_assert_msg(check_msg->apc[2].pcv[16] == -82, + "incorrect value for apc[2].pcv[16], expected -82, is %d", + check_msg->apc[2].pcv[16]); + ck_assert_msg(check_msg->apc[2].pcv[17] == 33, + "incorrect value for apc[2].pcv[17], expected 33, is %d", + check_msg->apc[2].pcv[17]); + ck_assert_msg(check_msg->apc[2].pcv[18] == 13, + "incorrect value for apc[2].pcv[18], expected 13, is %d", + check_msg->apc[2].pcv[18]); + ck_assert_msg(check_msg->apc[2].pcv[19] == -4, + "incorrect value for apc[2].pcv[19], expected -4, is %d", + check_msg->apc[2].pcv[19]); + ck_assert_msg(check_msg->apc[2].pcv[20] == -20, + "incorrect value for apc[2].pcv[20], expected -20, is %d", + check_msg->apc[2].pcv[20]); + ck_assert_msg(check_msg->apc[2].sat_info == 181, + "incorrect value for apc[2].sat_info, expected 181, is %d", + check_msg->apc[2].sat_info); + ck_assert_msg(check_msg->apc[2].sid.code == 188, + "incorrect value for apc[2].sid.code, expected 188, is %d", + check_msg->apc[2].sid.code); + ck_assert_msg(check_msg->apc[2].sid.sat == 83, + "incorrect value for apc[2].sid.sat, expected 83, is %d", + check_msg->apc[2].sid.sat); + ck_assert_msg(check_msg->apc[2].svn == 7106, + "incorrect value for apc[2].svn, expected 7106, is %d", + check_msg->apc[2].svn); + ck_assert_msg(check_msg->apc[3].pco[0] == -19478, + "incorrect value for apc[3].pco[0], expected -19478, is %d", + check_msg->apc[3].pco[0]); + ck_assert_msg(check_msg->apc[3].pco[1] == 11484, + "incorrect value for apc[3].pco[1], expected 11484, is %d", + check_msg->apc[3].pco[1]); + ck_assert_msg(check_msg->apc[3].pco[2] == 14804, + "incorrect value for apc[3].pco[2], expected 14804, is %d", + check_msg->apc[3].pco[2]); + ck_assert_msg(check_msg->apc[3].pcv[0] == 44, + "incorrect value for apc[3].pcv[0], expected 44, is %d", + check_msg->apc[3].pcv[0]); + ck_assert_msg(check_msg->apc[3].pcv[1] == -83, + "incorrect value for apc[3].pcv[1], expected -83, is %d", + check_msg->apc[3].pcv[1]); + ck_assert_msg(check_msg->apc[3].pcv[2] == 49, + "incorrect value for apc[3].pcv[2], expected 49, is %d", + check_msg->apc[3].pcv[2]); + ck_assert_msg(check_msg->apc[3].pcv[3] == 36, + "incorrect value for apc[3].pcv[3], expected 36, is %d", + check_msg->apc[3].pcv[3]); + ck_assert_msg(check_msg->apc[3].pcv[4] == -119, + "incorrect value for apc[3].pcv[4], expected -119, is %d", + check_msg->apc[3].pcv[4]); + ck_assert_msg(check_msg->apc[3].pcv[5] == -8, + "incorrect value for apc[3].pcv[5], expected -8, is %d", + check_msg->apc[3].pcv[5]); + ck_assert_msg(check_msg->apc[3].pcv[6] == -21, + "incorrect value for apc[3].pcv[6], expected -21, is %d", + check_msg->apc[3].pcv[6]); + ck_assert_msg(check_msg->apc[3].pcv[7] == 97, + "incorrect value for apc[3].pcv[7], expected 97, is %d", + check_msg->apc[3].pcv[7]); + ck_assert_msg(check_msg->apc[3].pcv[8] == 112, + "incorrect value for apc[3].pcv[8], expected 112, is %d", + check_msg->apc[3].pcv[8]); + ck_assert_msg(check_msg->apc[3].pcv[9] == -99, + "incorrect value for apc[3].pcv[9], expected -99, is %d", + check_msg->apc[3].pcv[9]); + ck_assert_msg(check_msg->apc[3].pcv[10] == -117, + "incorrect value for apc[3].pcv[10], expected -117, is %d", + check_msg->apc[3].pcv[10]); + ck_assert_msg(check_msg->apc[3].pcv[11] == 26, + "incorrect value for apc[3].pcv[11], expected 26, is %d", + check_msg->apc[3].pcv[11]); + ck_assert_msg(check_msg->apc[3].pcv[12] == 115, + "incorrect value for apc[3].pcv[12], expected 115, is %d", + check_msg->apc[3].pcv[12]); + ck_assert_msg(check_msg->apc[3].pcv[13] == -64, + "incorrect value for apc[3].pcv[13], expected -64, is %d", + check_msg->apc[3].pcv[13]); + ck_assert_msg(check_msg->apc[3].pcv[14] == 31, + "incorrect value for apc[3].pcv[14], expected 31, is %d", + check_msg->apc[3].pcv[14]); + ck_assert_msg(check_msg->apc[3].pcv[15] == 85, + "incorrect value for apc[3].pcv[15], expected 85, is %d", + check_msg->apc[3].pcv[15]); + ck_assert_msg(check_msg->apc[3].pcv[16] == 127, + "incorrect value for apc[3].pcv[16], expected 127, is %d", + check_msg->apc[3].pcv[16]); + ck_assert_msg(check_msg->apc[3].pcv[17] == -28, + "incorrect value for apc[3].pcv[17], expected -28, is %d", + check_msg->apc[3].pcv[17]); + ck_assert_msg(check_msg->apc[3].pcv[18] == 81, + "incorrect value for apc[3].pcv[18], expected 81, is %d", + check_msg->apc[3].pcv[18]); + ck_assert_msg(check_msg->apc[3].pcv[19] == -4, + "incorrect value for apc[3].pcv[19], expected -4, is %d", + check_msg->apc[3].pcv[19]); + ck_assert_msg(check_msg->apc[3].pcv[20] == -37, + "incorrect value for apc[3].pcv[20], expected -37, is %d", + check_msg->apc[3].pcv[20]); + ck_assert_msg(check_msg->apc[3].sat_info == 128, + "incorrect value for apc[3].sat_info, expected 128, is %d", + check_msg->apc[3].sat_info); + ck_assert_msg(check_msg->apc[3].sid.code == 196, + "incorrect value for apc[3].sid.code, expected 196, is %d", + check_msg->apc[3].sid.code); + ck_assert_msg(check_msg->apc[3].sid.sat == 230, + "incorrect value for apc[3].sid.sat, expected 230, is %d", + check_msg->apc[3].sid.sat); + ck_assert_msg(check_msg->apc[3].svn == 61399, + "incorrect value for apc[3].svn, expected 61399, is %d", + check_msg->apc[3].svn); + ck_assert_msg(check_msg->apc[4].pco[0] == -11049, + "incorrect value for apc[4].pco[0], expected -11049, is %d", + check_msg->apc[4].pco[0]); + ck_assert_msg(check_msg->apc[4].pco[1] == 6580, + "incorrect value for apc[4].pco[1], expected 6580, is %d", + check_msg->apc[4].pco[1]); + ck_assert_msg(check_msg->apc[4].pco[2] == -28589, + "incorrect value for apc[4].pco[2], expected -28589, is %d", + check_msg->apc[4].pco[2]); + ck_assert_msg(check_msg->apc[4].pcv[0] == -9, + "incorrect value for apc[4].pcv[0], expected -9, is %d", + check_msg->apc[4].pcv[0]); + ck_assert_msg(check_msg->apc[4].pcv[1] == 12, + "incorrect value for apc[4].pcv[1], expected 12, is %d", + check_msg->apc[4].pcv[1]); + ck_assert_msg(check_msg->apc[4].pcv[2] == 27, + "incorrect value for apc[4].pcv[2], expected 27, is %d", + check_msg->apc[4].pcv[2]); + ck_assert_msg(check_msg->apc[4].pcv[3] == -57, + "incorrect value for apc[4].pcv[3], expected -57, is %d", + check_msg->apc[4].pcv[3]); + ck_assert_msg(check_msg->apc[4].pcv[4] == -83, + "incorrect value for apc[4].pcv[4], expected -83, is %d", + check_msg->apc[4].pcv[4]); + ck_assert_msg(check_msg->apc[4].pcv[5] == 74, + "incorrect value for apc[4].pcv[5], expected 74, is %d", + check_msg->apc[4].pcv[5]); + ck_assert_msg(check_msg->apc[4].pcv[6] == 23, + "incorrect value for apc[4].pcv[6], expected 23, is %d", + check_msg->apc[4].pcv[6]); + ck_assert_msg(check_msg->apc[4].pcv[7] == 4, + "incorrect value for apc[4].pcv[7], expected 4, is %d", + check_msg->apc[4].pcv[7]); + ck_assert_msg(check_msg->apc[4].pcv[8] == -17, + "incorrect value for apc[4].pcv[8], expected -17, is %d", + check_msg->apc[4].pcv[8]); + ck_assert_msg(check_msg->apc[4].pcv[9] == 103, + "incorrect value for apc[4].pcv[9], expected 103, is %d", + check_msg->apc[4].pcv[9]); + ck_assert_msg(check_msg->apc[4].pcv[10] == -33, + "incorrect value for apc[4].pcv[10], expected -33, is %d", + check_msg->apc[4].pcv[10]); + ck_assert_msg(check_msg->apc[4].pcv[11] == -36, + "incorrect value for apc[4].pcv[11], expected -36, is %d", + check_msg->apc[4].pcv[11]); + ck_assert_msg(check_msg->apc[4].pcv[12] == -117, + "incorrect value for apc[4].pcv[12], expected -117, is %d", + check_msg->apc[4].pcv[12]); + ck_assert_msg(check_msg->apc[4].pcv[13] == 91, + "incorrect value for apc[4].pcv[13], expected 91, is %d", + check_msg->apc[4].pcv[13]); + ck_assert_msg(check_msg->apc[4].pcv[14] == 127, + "incorrect value for apc[4].pcv[14], expected 127, is %d", + check_msg->apc[4].pcv[14]); + ck_assert_msg(check_msg->apc[4].pcv[15] == -42, + "incorrect value for apc[4].pcv[15], expected -42, is %d", + check_msg->apc[4].pcv[15]); + ck_assert_msg(check_msg->apc[4].pcv[16] == 86, + "incorrect value for apc[4].pcv[16], expected 86, is %d", + check_msg->apc[4].pcv[16]); + ck_assert_msg(check_msg->apc[4].pcv[17] == 48, + "incorrect value for apc[4].pcv[17], expected 48, is %d", + check_msg->apc[4].pcv[17]); + ck_assert_msg(check_msg->apc[4].pcv[18] == -53, + "incorrect value for apc[4].pcv[18], expected -53, is %d", + check_msg->apc[4].pcv[18]); + ck_assert_msg(check_msg->apc[4].pcv[19] == -28, + "incorrect value for apc[4].pcv[19], expected -28, is %d", + check_msg->apc[4].pcv[19]); + ck_assert_msg(check_msg->apc[4].pcv[20] == 99, + "incorrect value for apc[4].pcv[20], expected 99, is %d", + check_msg->apc[4].pcv[20]); + ck_assert_msg(check_msg->apc[4].sat_info == 147, + "incorrect value for apc[4].sat_info, expected 147, is %d", + check_msg->apc[4].sat_info); + ck_assert_msg(check_msg->apc[4].sid.code == 110, + "incorrect value for apc[4].sid.code, expected 110, is %d", + check_msg->apc[4].sid.code); + ck_assert_msg(check_msg->apc[4].sid.sat == 249, + "incorrect value for apc[4].sid.sat, expected 249, is %d", + check_msg->apc[4].sid.sat); + ck_assert_msg(check_msg->apc[4].svn == 41224, + "incorrect value for apc[4].svn, expected 41224, is %d", + check_msg->apc[4].svn); + ck_assert_msg(check_msg->apc[5].pco[0] == -21881, + "incorrect value for apc[5].pco[0], expected -21881, is %d", + check_msg->apc[5].pco[0]); + ck_assert_msg(check_msg->apc[5].pco[1] == -9942, + "incorrect value for apc[5].pco[1], expected -9942, is %d", + check_msg->apc[5].pco[1]); + ck_assert_msg(check_msg->apc[5].pco[2] == -5689, + "incorrect value for apc[5].pco[2], expected -5689, is %d", + check_msg->apc[5].pco[2]); + ck_assert_msg(check_msg->apc[5].pcv[0] == 42, + "incorrect value for apc[5].pcv[0], expected 42, is %d", + check_msg->apc[5].pcv[0]); + ck_assert_msg(check_msg->apc[5].pcv[1] == -86, + "incorrect value for apc[5].pcv[1], expected -86, is %d", + check_msg->apc[5].pcv[1]); + ck_assert_msg(check_msg->apc[5].pcv[2] == 78, + "incorrect value for apc[5].pcv[2], expected 78, is %d", + check_msg->apc[5].pcv[2]); + ck_assert_msg(check_msg->apc[5].pcv[3] == -50, + "incorrect value for apc[5].pcv[3], expected -50, is %d", + check_msg->apc[5].pcv[3]); + ck_assert_msg(check_msg->apc[5].pcv[4] == 41, + "incorrect value for apc[5].pcv[4], expected 41, is %d", + check_msg->apc[5].pcv[4]); + ck_assert_msg(check_msg->apc[5].pcv[5] == 43, + "incorrect value for apc[5].pcv[5], expected 43, is %d", + check_msg->apc[5].pcv[5]); + ck_assert_msg(check_msg->apc[5].pcv[6] == 81, + "incorrect value for apc[5].pcv[6], expected 81, is %d", + check_msg->apc[5].pcv[6]); + ck_assert_msg(check_msg->apc[5].pcv[7] == -9, + "incorrect value for apc[5].pcv[7], expected -9, is %d", + check_msg->apc[5].pcv[7]); + ck_assert_msg(check_msg->apc[5].pcv[8] == 99, + "incorrect value for apc[5].pcv[8], expected 99, is %d", + check_msg->apc[5].pcv[8]); + ck_assert_msg(check_msg->apc[5].pcv[9] == -58, + "incorrect value for apc[5].pcv[9], expected -58, is %d", + check_msg->apc[5].pcv[9]); + ck_assert_msg(check_msg->apc[5].pcv[10] == -112, + "incorrect value for apc[5].pcv[10], expected -112, is %d", + check_msg->apc[5].pcv[10]); + ck_assert_msg(check_msg->apc[5].pcv[11] == 2, + "incorrect value for apc[5].pcv[11], expected 2, is %d", + check_msg->apc[5].pcv[11]); + ck_assert_msg(check_msg->apc[5].pcv[12] == -124, + "incorrect value for apc[5].pcv[12], expected -124, is %d", + check_msg->apc[5].pcv[12]); + ck_assert_msg(check_msg->apc[5].pcv[13] == 2, + "incorrect value for apc[5].pcv[13], expected 2, is %d", + check_msg->apc[5].pcv[13]); + ck_assert_msg(check_msg->apc[5].pcv[14] == -32, + "incorrect value for apc[5].pcv[14], expected -32, is %d", + check_msg->apc[5].pcv[14]); + ck_assert_msg(check_msg->apc[5].pcv[15] == -36, + "incorrect value for apc[5].pcv[15], expected -36, is %d", + check_msg->apc[5].pcv[15]); + ck_assert_msg(check_msg->apc[5].pcv[16] == -108, + "incorrect value for apc[5].pcv[16], expected -108, is %d", + check_msg->apc[5].pcv[16]); + ck_assert_msg(check_msg->apc[5].pcv[17] == 58, + "incorrect value for apc[5].pcv[17], expected 58, is %d", + check_msg->apc[5].pcv[17]); + ck_assert_msg(check_msg->apc[5].pcv[18] == 85, + "incorrect value for apc[5].pcv[18], expected 85, is %d", + check_msg->apc[5].pcv[18]); + ck_assert_msg(check_msg->apc[5].pcv[19] == -118, + "incorrect value for apc[5].pcv[19], expected -118, is %d", + check_msg->apc[5].pcv[19]); + ck_assert_msg(check_msg->apc[5].pcv[20] == -46, + "incorrect value for apc[5].pcv[20], expected -46, is %d", + check_msg->apc[5].pcv[20]); + ck_assert_msg(check_msg->apc[5].sat_info == 159, + "incorrect value for apc[5].sat_info, expected 159, is %d", + check_msg->apc[5].sat_info); + ck_assert_msg(check_msg->apc[5].sid.code == 83, + "incorrect value for apc[5].sid.code, expected 83, is %d", + check_msg->apc[5].sid.code); + ck_assert_msg(check_msg->apc[5].sid.sat == 45, + "incorrect value for apc[5].sid.sat, expected 45, is %d", + check_msg->apc[5].sid.sat); + ck_assert_msg(check_msg->apc[5].svn == 64011, + "incorrect value for apc[5].svn, expected 64011, is %d", + check_msg->apc[5].svn); + ck_assert_msg(check_msg->apc[6].pco[0] == -14290, + "incorrect value for apc[6].pco[0], expected -14290, is %d", + check_msg->apc[6].pco[0]); + ck_assert_msg(check_msg->apc[6].pco[1] == 30340, + "incorrect value for apc[6].pco[1], expected 30340, is %d", + check_msg->apc[6].pco[1]); + ck_assert_msg(check_msg->apc[6].pco[2] == 3569, + "incorrect value for apc[6].pco[2], expected 3569, is %d", + check_msg->apc[6].pco[2]); + ck_assert_msg(check_msg->apc[6].pcv[0] == 37, + "incorrect value for apc[6].pcv[0], expected 37, is %d", + check_msg->apc[6].pcv[0]); + ck_assert_msg(check_msg->apc[6].pcv[1] == 62, + "incorrect value for apc[6].pcv[1], expected 62, is %d", + check_msg->apc[6].pcv[1]); + ck_assert_msg(check_msg->apc[6].pcv[2] == 107, + "incorrect value for apc[6].pcv[2], expected 107, is %d", + check_msg->apc[6].pcv[2]); + ck_assert_msg(check_msg->apc[6].pcv[3] == -3, + "incorrect value for apc[6].pcv[3], expected -3, is %d", + check_msg->apc[6].pcv[3]); + ck_assert_msg(check_msg->apc[6].pcv[4] == -66, + "incorrect value for apc[6].pcv[4], expected -66, is %d", + check_msg->apc[6].pcv[4]); + ck_assert_msg(check_msg->apc[6].pcv[5] == -120, + "incorrect value for apc[6].pcv[5], expected -120, is %d", + check_msg->apc[6].pcv[5]); + ck_assert_msg(check_msg->apc[6].pcv[6] == 66, + "incorrect value for apc[6].pcv[6], expected 66, is %d", + check_msg->apc[6].pcv[6]); + ck_assert_msg(check_msg->apc[6].pcv[7] == 9, + "incorrect value for apc[6].pcv[7], expected 9, is %d", + check_msg->apc[6].pcv[7]); + ck_assert_msg(check_msg->apc[6].pcv[8] == 84, + "incorrect value for apc[6].pcv[8], expected 84, is %d", + check_msg->apc[6].pcv[8]); + ck_assert_msg(check_msg->apc[6].pcv[9] == -101, + "incorrect value for apc[6].pcv[9], expected -101, is %d", + check_msg->apc[6].pcv[9]); + ck_assert_msg(check_msg->apc[6].pcv[10] == 86, + "incorrect value for apc[6].pcv[10], expected 86, is %d", + check_msg->apc[6].pcv[10]); + ck_assert_msg(check_msg->apc[6].pcv[11] == -76, + "incorrect value for apc[6].pcv[11], expected -76, is %d", + check_msg->apc[6].pcv[11]); + ck_assert_msg(check_msg->apc[6].pcv[12] == 41, + "incorrect value for apc[6].pcv[12], expected 41, is %d", + check_msg->apc[6].pcv[12]); + ck_assert_msg(check_msg->apc[6].pcv[13] == -60, + "incorrect value for apc[6].pcv[13], expected -60, is %d", + check_msg->apc[6].pcv[13]); + ck_assert_msg(check_msg->apc[6].pcv[14] == 40, + "incorrect value for apc[6].pcv[14], expected 40, is %d", + check_msg->apc[6].pcv[14]); + ck_assert_msg(check_msg->apc[6].pcv[15] == 119, + "incorrect value for apc[6].pcv[15], expected 119, is %d", + check_msg->apc[6].pcv[15]); + ck_assert_msg(check_msg->apc[6].pcv[16] == 101, + "incorrect value for apc[6].pcv[16], expected 101, is %d", + check_msg->apc[6].pcv[16]); + ck_assert_msg(check_msg->apc[6].pcv[17] == -4, + "incorrect value for apc[6].pcv[17], expected -4, is %d", + check_msg->apc[6].pcv[17]); + ck_assert_msg(check_msg->apc[6].pcv[18] == -33, + "incorrect value for apc[6].pcv[18], expected -33, is %d", + check_msg->apc[6].pcv[18]); + ck_assert_msg(check_msg->apc[6].pcv[19] == -112, + "incorrect value for apc[6].pcv[19], expected -112, is %d", + check_msg->apc[6].pcv[19]); + ck_assert_msg(check_msg->apc[6].pcv[20] == -103, + "incorrect value for apc[6].pcv[20], expected -103, is %d", + check_msg->apc[6].pcv[20]); + ck_assert_msg(check_msg->apc[6].sat_info == 7, + "incorrect value for apc[6].sat_info, expected 7, is %d", + check_msg->apc[6].sat_info); + ck_assert_msg(check_msg->apc[6].sid.code == 158, + "incorrect value for apc[6].sid.code, expected 158, is %d", + check_msg->apc[6].sid.code); + ck_assert_msg(check_msg->apc[6].sid.sat == 200, + "incorrect value for apc[6].sid.sat, expected 200, is %d", + check_msg->apc[6].sid.sat); + ck_assert_msg(check_msg->apc[6].svn == 17310, + "incorrect value for apc[6].svn, expected 17310, is %d", + check_msg->apc[6].svn); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA"); +Suite *legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrStecCorrection.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrStecCorrection.c index 4a5b058c0..13f25b02b 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrStecCorrection.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrStecCorrection.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrection.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrection.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrection ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrection) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrection ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,24 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrection ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 1533, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 1533, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 1533, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 1533, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,253,5,66,0,38,180,0,0,0,3,0,1,1,10,0,15,1,0,10,0,2,1,1,1,63,0,62,0,61,0,60,0,31,15,5,63,0,64,0,65,0,66,0,119,50, }; + u8 encoded_frame[] = { + 85, 253, 5, 66, 0, 38, 180, 0, 0, 0, 3, 0, 1, 1, 10, 0, + 15, 1, 0, 10, 0, 2, 1, 1, 1, 63, 0, 62, 0, 61, 0, 60, + 0, 31, 15, 5, 63, 0, 64, 0, 65, 0, 66, 0, 119, 50, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_stec_correction_t* test_msg = ( msg_ssr_stec_correction_t* )test_msg_storage; + msg_ssr_stec_correction_t *test_msg = + (msg_ssr_stec_correction_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.num_msgs = 1; test_msg->header.seq_num = 1; @@ -207,86 +211,158 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrection ) test_msg->stec_sat_list[1].sv_id.satId = 31; test_msg->tile_id = 10; test_msg->tile_set_id = 1; - sbp_payload_send(&sbp_state, 1533, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 1533, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 1533, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_stec_correction_t* check_msg = ( msg_ssr_stec_correction_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_stec_correction_t *check_msg = + (msg_ssr_stec_correction_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.num_msgs == 1, "incorrect value for header.num_msgs, expected 1, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.seq_num == 1, "incorrect value for header.seq_num, expected 1, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->header.sol_id == 0, "incorrect value for header.sol_id, expected 0, is %d", check_msg->header.sol_id); - ck_assert_msg(check_msg->header.time.tow == 180, "incorrect value for header.time.tow, expected 180, is %d", check_msg->header.time.tow); - ck_assert_msg(check_msg->header.time.wn == 3, "incorrect value for header.time.wn, expected 3, is %d", check_msg->header.time.wn); - ck_assert_msg(check_msg->header.update_interval == 10, "incorrect value for header.update_interval, expected 10, is %d", check_msg->header.update_interval); - ck_assert_msg(check_msg->n_sats == 2, "incorrect value for n_sats, expected 2, is %d", check_msg->n_sats); - ck_assert_msg(check_msg->ssr_iod_atmo == 15, "incorrect value for ssr_iod_atmo, expected 15, is %d", check_msg->ssr_iod_atmo); - ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[0] == 63, "incorrect value for stec_sat_list[0].stec_coeff[0], expected 63, is %d", check_msg->stec_sat_list[0].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[1] == 62, "incorrect value for stec_sat_list[0].stec_coeff[1], expected 62, is %d", check_msg->stec_sat_list[0].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[2] == 61, "incorrect value for stec_sat_list[0].stec_coeff[2], expected 61, is %d", check_msg->stec_sat_list[0].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[3] == 60, "incorrect value for stec_sat_list[0].stec_coeff[3], expected 60, is %d", check_msg->stec_sat_list[0].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[0].stec_quality_indicator == 1, "incorrect value for stec_sat_list[0].stec_quality_indicator, expected 1, is %d", check_msg->stec_sat_list[0].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[0].sv_id.constellation == 1, "incorrect value for stec_sat_list[0].sv_id.constellation, expected 1, is %d", check_msg->stec_sat_list[0].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[0].sv_id.satId == 1, "incorrect value for stec_sat_list[0].sv_id.satId, expected 1, is %d", check_msg->stec_sat_list[0].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[0] == 63, "incorrect value for stec_sat_list[1].stec_coeff[0], expected 63, is %d", check_msg->stec_sat_list[1].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[1] == 64, "incorrect value for stec_sat_list[1].stec_coeff[1], expected 64, is %d", check_msg->stec_sat_list[1].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[2] == 65, "incorrect value for stec_sat_list[1].stec_coeff[2], expected 65, is %d", check_msg->stec_sat_list[1].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[3] == 66, "incorrect value for stec_sat_list[1].stec_coeff[3], expected 66, is %d", check_msg->stec_sat_list[1].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[1].stec_quality_indicator == 5, "incorrect value for stec_sat_list[1].stec_quality_indicator, expected 5, is %d", check_msg->stec_sat_list[1].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[1].sv_id.constellation == 15, "incorrect value for stec_sat_list[1].sv_id.constellation, expected 15, is %d", check_msg->stec_sat_list[1].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[1].sv_id.satId == 31, "incorrect value for stec_sat_list[1].sv_id.satId, expected 31, is %d", check_msg->stec_sat_list[1].sv_id.satId); - ck_assert_msg(check_msg->tile_id == 10, "incorrect value for tile_id, expected 10, is %d", check_msg->tile_id); - ck_assert_msg(check_msg->tile_set_id == 1, "incorrect value for tile_set_id, expected 1, is %d", check_msg->tile_set_id); + ck_assert_msg(check_msg->header.num_msgs == 1, + "incorrect value for header.num_msgs, expected 1, is %d", + check_msg->header.num_msgs); + ck_assert_msg(check_msg->header.seq_num == 1, + "incorrect value for header.seq_num, expected 1, is %d", + check_msg->header.seq_num); + ck_assert_msg(check_msg->header.sol_id == 0, + "incorrect value for header.sol_id, expected 0, is %d", + check_msg->header.sol_id); + ck_assert_msg(check_msg->header.time.tow == 180, + "incorrect value for header.time.tow, expected 180, is %d", + check_msg->header.time.tow); + ck_assert_msg(check_msg->header.time.wn == 3, + "incorrect value for header.time.wn, expected 3, is %d", + check_msg->header.time.wn); + ck_assert_msg( + check_msg->header.update_interval == 10, + "incorrect value for header.update_interval, expected 10, is %d", + check_msg->header.update_interval); + ck_assert_msg(check_msg->n_sats == 2, + "incorrect value for n_sats, expected 2, is %d", + check_msg->n_sats); + ck_assert_msg(check_msg->ssr_iod_atmo == 15, + "incorrect value for ssr_iod_atmo, expected 15, is %d", + check_msg->ssr_iod_atmo); + ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[0] == 63, + "incorrect value for stec_sat_list[0].stec_coeff[0], " + "expected 63, is %d", + check_msg->stec_sat_list[0].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[1] == 62, + "incorrect value for stec_sat_list[0].stec_coeff[1], " + "expected 62, is %d", + check_msg->stec_sat_list[0].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[2] == 61, + "incorrect value for stec_sat_list[0].stec_coeff[2], " + "expected 61, is %d", + check_msg->stec_sat_list[0].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[3] == 60, + "incorrect value for stec_sat_list[0].stec_coeff[3], " + "expected 60, is %d", + check_msg->stec_sat_list[0].stec_coeff[3]); + ck_assert_msg(check_msg->stec_sat_list[0].stec_quality_indicator == 1, + "incorrect value for " + "stec_sat_list[0].stec_quality_indicator, expected 1, is %d", + check_msg->stec_sat_list[0].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[0].sv_id.constellation == 1, + "incorrect value for stec_sat_list[0].sv_id.constellation, " + "expected 1, is %d", + check_msg->stec_sat_list[0].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[0].sv_id.satId == 1, + "incorrect value for stec_sat_list[0].sv_id.satId, expected 1, is %d", + check_msg->stec_sat_list[0].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[0] == 63, + "incorrect value for stec_sat_list[1].stec_coeff[0], " + "expected 63, is %d", + check_msg->stec_sat_list[1].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[1] == 64, + "incorrect value for stec_sat_list[1].stec_coeff[1], " + "expected 64, is %d", + check_msg->stec_sat_list[1].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[2] == 65, + "incorrect value for stec_sat_list[1].stec_coeff[2], " + "expected 65, is %d", + check_msg->stec_sat_list[1].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[3] == 66, + "incorrect value for stec_sat_list[1].stec_coeff[3], " + "expected 66, is %d", + check_msg->stec_sat_list[1].stec_coeff[3]); + ck_assert_msg(check_msg->stec_sat_list[1].stec_quality_indicator == 5, + "incorrect value for " + "stec_sat_list[1].stec_quality_indicator, expected 5, is %d", + check_msg->stec_sat_list[1].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[1].sv_id.constellation == 15, + "incorrect value for stec_sat_list[1].sv_id.constellation, " + "expected 15, is %d", + check_msg->stec_sat_list[1].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[1].sv_id.satId == 31, + "incorrect value for stec_sat_list[1].sv_id.satId, expected 31, is %d", + check_msg->stec_sat_list[1].sv_id.satId); + ck_assert_msg(check_msg->tile_id == 10, + "incorrect value for tile_id, expected 10, is %d", + check_msg->tile_id); + ck_assert_msg(check_msg->tile_set_id == 1, + "incorrect value for tile_set_id, expected 1, is %d", + check_msg->tile_set_id); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrStecCorrection_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrStecCorrection"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrStecCorrection"); +Suite *legacy_auto_check_sbp_ssr_MsgSsrStecCorrection_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrStecCorrection"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrStecCorrection"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrection); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.c index 98bf475aa..8bb03ec3c 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDep.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,40 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x5fb, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x5fb, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x5fb, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x5fb, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,251,5,204,151,245,158,228,114,117,50,158,156,42,119,156,157,112,47,60,132,40,70,87,235,83,177,198,3,14,8,70,12,44,53,181,90,174,247,150,58,172,247,179,119,176,125,4,177,229,113,14,77,153,185,23,53,222,187,146,250,91,212,215,14,107,250,94,107,33,91,234,0,213,139,95,179,50,21,74,174,169,61,86,91,142,51,108,9,38,225,146,101,73,139,56,117,82,37,213,108,205,93,18,19,195,33,202,87,206,178,125,188,119,56,69,150,150,76,3,131,18,73,208,72,232,8,250,203,178,170,163,252,86,49,247,178,166,56,31,10,119,213,241,212,164,1,162,42,18,124,169,121,158,26,56,23,142,125,40,120,67,45,126,235,110,23,12,241,88,69,239,252,57,93,44,201,216,173,242,178,17,5,223,169,192,3,77,107,2,144,233,14,88,32,209,1,17,123,155,41,183,244,158,82,53,103,14,202,185,35,181,21,118,254,250,50,184,50,31,45,56,163,177,126,217,79,171,239,237,188,238,112,201,118,141,18,163,103,35,63,21,82,129,18,117,85,190,79,210,215,227,177, }; + u8 encoded_frame[] = { + 85, 251, 5, 204, 151, 245, 158, 228, 114, 117, 50, 158, 156, 42, + 119, 156, 157, 112, 47, 60, 132, 40, 70, 87, 235, 83, 177, 198, + 3, 14, 8, 70, 12, 44, 53, 181, 90, 174, 247, 150, 58, 172, + 247, 179, 119, 176, 125, 4, 177, 229, 113, 14, 77, 153, 185, 23, + 53, 222, 187, 146, 250, 91, 212, 215, 14, 107, 250, 94, 107, 33, + 91, 234, 0, 213, 139, 95, 179, 50, 21, 74, 174, 169, 61, 86, + 91, 142, 51, 108, 9, 38, 225, 146, 101, 73, 139, 56, 117, 82, + 37, 213, 108, 205, 93, 18, 19, 195, 33, 202, 87, 206, 178, 125, + 188, 119, 56, 69, 150, 150, 76, 3, 131, 18, 73, 208, 72, 232, + 8, 250, 203, 178, 170, 163, 252, 86, 49, 247, 178, 166, 56, 31, + 10, 119, 213, 241, 212, 164, 1, 162, 42, 18, 124, 169, 121, 158, + 26, 56, 23, 142, 125, 40, 120, 67, 45, 126, 235, 110, 23, 12, + 241, 88, 69, 239, 252, 57, 93, 44, 201, 216, 173, 242, 178, 17, + 5, 223, 169, 192, 3, 77, 107, 2, 144, 233, 14, 88, 32, 209, + 1, 17, 123, 155, 41, 183, 244, 158, 82, 53, 103, 14, 202, 185, + 35, 181, 21, 118, 254, 250, 50, 184, 50, 31, 45, 56, 163, 177, + 126, 217, 79, 171, 239, 237, 188, 238, 112, 201, 118, 141, 18, 163, + 103, 35, 63, 21, 82, 129, 18, 117, 85, 190, 79, 210, 215, 227, + 177, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_stec_correction_dep_t* test_msg = ( msg_ssr_stec_correction_dep_t* )test_msg_storage; + msg_ssr_stec_correction_dep_t *test_msg = + (msg_ssr_stec_correction_dep_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.iod_atmo = 60; test_msg->header.num_msgs = 157; @@ -718,218 +738,703 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep ) test_msg->stec_sat_list[20].stec_quality_indicator = 82; test_msg->stec_sat_list[20].sv_id.constellation = 21; test_msg->stec_sat_list[20].sv_id.satId = 63; - sbp_payload_send(&sbp_state, 0x5fb, 38860, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x5fb, 38860, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 38860, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 38860, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x5fb, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_stec_correction_dep_t* check_msg = ( msg_ssr_stec_correction_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_stec_correction_dep_t *check_msg = + (msg_ssr_stec_correction_dep_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.iod_atmo == 60, "incorrect value for header.iod_atmo, expected 60, is %d", check_msg->header.iod_atmo); - ck_assert_msg(check_msg->header.num_msgs == 157, "incorrect value for header.num_msgs, expected 157, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.seq_num == 112, "incorrect value for header.seq_num, expected 112, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->header.tile_id == 30066, "incorrect value for header.tile_id, expected 30066, is %d", check_msg->header.tile_id); - ck_assert_msg(check_msg->header.tile_set_id == 58526, "incorrect value for header.tile_set_id, expected 58526, is %d", check_msg->header.tile_set_id); - ck_assert_msg(check_msg->header.time.tow == 714907186, "incorrect value for header.time.tow, expected 714907186, is %d", check_msg->header.time.tow); - ck_assert_msg(check_msg->header.time.wn == 40055, "incorrect value for header.time.wn, expected 40055, is %d", check_msg->header.time.wn); - ck_assert_msg(check_msg->header.update_interval == 47, "incorrect value for header.update_interval, expected 47, is %d", check_msg->header.update_interval); - ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[0] == -5289, "incorrect value for stec_sat_list[0].stec_coeff[0], expected -5289, is %d", check_msg->stec_sat_list[0].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[1] == -20141, "incorrect value for stec_sat_list[0].stec_coeff[1], expected -20141, is %d", check_msg->stec_sat_list[0].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[2] == 966, "incorrect value for stec_sat_list[0].stec_coeff[2], expected 966, is %d", check_msg->stec_sat_list[0].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[3] == 2062, "incorrect value for stec_sat_list[0].stec_coeff[3], expected 2062, is %d", check_msg->stec_sat_list[0].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[0].stec_quality_indicator == 70, "incorrect value for stec_sat_list[0].stec_quality_indicator, expected 70, is %d", check_msg->stec_sat_list[0].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[0].sv_id.constellation == 40, "incorrect value for stec_sat_list[0].sv_id.constellation, expected 40, is %d", check_msg->stec_sat_list[0].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[0].sv_id.satId == 132, "incorrect value for stec_sat_list[0].sv_id.satId, expected 132, is %d", check_msg->stec_sat_list[0].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[0] == -19147, "incorrect value for stec_sat_list[1].stec_coeff[0], expected -19147, is %d", check_msg->stec_sat_list[1].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[1] == -20902, "incorrect value for stec_sat_list[1].stec_coeff[1], expected -20902, is %d", check_msg->stec_sat_list[1].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[2] == -26889, "incorrect value for stec_sat_list[1].stec_coeff[2], expected -26889, is %d", check_msg->stec_sat_list[1].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[3] == -21446, "incorrect value for stec_sat_list[1].stec_coeff[3], expected -21446, is %d", check_msg->stec_sat_list[1].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[1].stec_quality_indicator == 44, "incorrect value for stec_sat_list[1].stec_quality_indicator, expected 44, is %d", check_msg->stec_sat_list[1].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[1].sv_id.constellation == 12, "incorrect value for stec_sat_list[1].sv_id.constellation, expected 12, is %d", check_msg->stec_sat_list[1].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[1].sv_id.satId == 70, "incorrect value for stec_sat_list[1].sv_id.satId, expected 70, is %d", check_msg->stec_sat_list[1].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[0] == 32176, "incorrect value for stec_sat_list[2].stec_coeff[0], expected 32176, is %d", check_msg->stec_sat_list[2].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[1] == -20220, "incorrect value for stec_sat_list[2].stec_coeff[1], expected -20220, is %d", check_msg->stec_sat_list[2].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[2] == 29157, "incorrect value for stec_sat_list[2].stec_coeff[2], expected 29157, is %d", check_msg->stec_sat_list[2].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[3] == 19726, "incorrect value for stec_sat_list[2].stec_coeff[3], expected 19726, is %d", check_msg->stec_sat_list[2].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[2].stec_quality_indicator == 119, "incorrect value for stec_sat_list[2].stec_quality_indicator, expected 119, is %d", check_msg->stec_sat_list[2].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[2].sv_id.constellation == 179, "incorrect value for stec_sat_list[2].sv_id.constellation, expected 179, is %d", check_msg->stec_sat_list[2].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[2].sv_id.satId == 247, "incorrect value for stec_sat_list[2].sv_id.satId, expected 247, is %d", check_msg->stec_sat_list[2].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[0] == -8651, "incorrect value for stec_sat_list[3].stec_coeff[0], expected -8651, is %d", check_msg->stec_sat_list[3].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[1] == -27973, "incorrect value for stec_sat_list[3].stec_coeff[1], expected -27973, is %d", check_msg->stec_sat_list[3].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[2] == 23546, "incorrect value for stec_sat_list[3].stec_coeff[2], expected 23546, is %d", check_msg->stec_sat_list[3].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[3] == -10284, "incorrect value for stec_sat_list[3].stec_coeff[3], expected -10284, is %d", check_msg->stec_sat_list[3].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[3].stec_quality_indicator == 23, "incorrect value for stec_sat_list[3].stec_quality_indicator, expected 23, is %d", check_msg->stec_sat_list[3].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[3].sv_id.constellation == 185, "incorrect value for stec_sat_list[3].sv_id.constellation, expected 185, is %d", check_msg->stec_sat_list[3].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[3].sv_id.satId == 153, "incorrect value for stec_sat_list[3].sv_id.satId, expected 153, is %d", check_msg->stec_sat_list[3].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[0] == 27486, "incorrect value for stec_sat_list[4].stec_coeff[0], expected 27486, is %d", check_msg->stec_sat_list[4].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[1] == 23329, "incorrect value for stec_sat_list[4].stec_coeff[1], expected 23329, is %d", check_msg->stec_sat_list[4].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[2] == 234, "incorrect value for stec_sat_list[4].stec_coeff[2], expected 234, is %d", check_msg->stec_sat_list[4].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[3] == -29739, "incorrect value for stec_sat_list[4].stec_coeff[3], expected -29739, is %d", check_msg->stec_sat_list[4].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[4].stec_quality_indicator == 250, "incorrect value for stec_sat_list[4].stec_quality_indicator, expected 250, is %d", check_msg->stec_sat_list[4].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[4].sv_id.constellation == 107, "incorrect value for stec_sat_list[4].sv_id.constellation, expected 107, is %d", check_msg->stec_sat_list[4].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[4].sv_id.satId == 14, "incorrect value for stec_sat_list[4].sv_id.satId, expected 14, is %d", check_msg->stec_sat_list[4].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[0] == 18965, "incorrect value for stec_sat_list[5].stec_coeff[0], expected 18965, is %d", check_msg->stec_sat_list[5].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[1] == -22098, "incorrect value for stec_sat_list[5].stec_coeff[1], expected -22098, is %d", check_msg->stec_sat_list[5].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[2] == 22077, "incorrect value for stec_sat_list[5].stec_coeff[2], expected 22077, is %d", check_msg->stec_sat_list[5].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[3] == -29093, "incorrect value for stec_sat_list[5].stec_coeff[3], expected -29093, is %d", check_msg->stec_sat_list[5].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[5].stec_quality_indicator == 50, "incorrect value for stec_sat_list[5].stec_quality_indicator, expected 50, is %d", check_msg->stec_sat_list[5].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[5].sv_id.constellation == 179, "incorrect value for stec_sat_list[5].sv_id.constellation, expected 179, is %d", check_msg->stec_sat_list[5].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[5].sv_id.satId == 95, "incorrect value for stec_sat_list[5].sv_id.satId, expected 95, is %d", check_msg->stec_sat_list[5].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[0] == -7898, "incorrect value for stec_sat_list[6].stec_coeff[0], expected -7898, is %d", check_msg->stec_sat_list[6].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[1] == 26002, "incorrect value for stec_sat_list[6].stec_coeff[1], expected 26002, is %d", check_msg->stec_sat_list[6].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[2] == -29879, "incorrect value for stec_sat_list[6].stec_coeff[2], expected -29879, is %d", check_msg->stec_sat_list[6].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[3] == 30008, "incorrect value for stec_sat_list[6].stec_coeff[3], expected 30008, is %d", check_msg->stec_sat_list[6].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[6].stec_quality_indicator == 9, "incorrect value for stec_sat_list[6].stec_quality_indicator, expected 9, is %d", check_msg->stec_sat_list[6].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[6].sv_id.constellation == 108, "incorrect value for stec_sat_list[6].sv_id.constellation, expected 108, is %d", check_msg->stec_sat_list[6].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[6].sv_id.satId == 51, "incorrect value for stec_sat_list[6].sv_id.satId, expected 51, is %d", check_msg->stec_sat_list[6].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[0] == -12948, "incorrect value for stec_sat_list[7].stec_coeff[0], expected -12948, is %d", check_msg->stec_sat_list[7].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[1] == 4701, "incorrect value for stec_sat_list[7].stec_coeff[1], expected 4701, is %d", check_msg->stec_sat_list[7].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[2] == -15597, "incorrect value for stec_sat_list[7].stec_coeff[2], expected -15597, is %d", check_msg->stec_sat_list[7].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[3] == -13791, "incorrect value for stec_sat_list[7].stec_coeff[3], expected -13791, is %d", check_msg->stec_sat_list[7].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[7].stec_quality_indicator == 213, "incorrect value for stec_sat_list[7].stec_quality_indicator, expected 213, is %d", check_msg->stec_sat_list[7].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[7].sv_id.constellation == 37, "incorrect value for stec_sat_list[7].sv_id.constellation, expected 37, is %d", check_msg->stec_sat_list[7].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[7].sv_id.satId == 82, "incorrect value for stec_sat_list[7].sv_id.satId, expected 82, is %d", check_msg->stec_sat_list[7].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[0] == -17283, "incorrect value for stec_sat_list[8].stec_coeff[0], expected -17283, is %d", check_msg->stec_sat_list[8].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[1] == 14455, "incorrect value for stec_sat_list[8].stec_coeff[1], expected 14455, is %d", check_msg->stec_sat_list[8].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[2] == -27067, "incorrect value for stec_sat_list[8].stec_coeff[2], expected -27067, is %d", check_msg->stec_sat_list[8].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[3] == 19606, "incorrect value for stec_sat_list[8].stec_coeff[3], expected 19606, is %d", check_msg->stec_sat_list[8].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[8].stec_quality_indicator == 178, "incorrect value for stec_sat_list[8].stec_quality_indicator, expected 178, is %d", check_msg->stec_sat_list[8].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[8].sv_id.constellation == 206, "incorrect value for stec_sat_list[8].sv_id.constellation, expected 206, is %d", check_msg->stec_sat_list[8].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[8].sv_id.satId == 87, "incorrect value for stec_sat_list[8].sv_id.satId, expected 87, is %d", check_msg->stec_sat_list[8].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[0] == -12215, "incorrect value for stec_sat_list[9].stec_coeff[0], expected -12215, is %d", check_msg->stec_sat_list[9].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[1] == -6072, "incorrect value for stec_sat_list[9].stec_coeff[1], expected -6072, is %d", check_msg->stec_sat_list[9].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[2] == -1528, "incorrect value for stec_sat_list[9].stec_coeff[2], expected -1528, is %d", check_msg->stec_sat_list[9].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[3] == -19765, "incorrect value for stec_sat_list[9].stec_coeff[3], expected -19765, is %d", check_msg->stec_sat_list[9].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[9].stec_quality_indicator == 18, "incorrect value for stec_sat_list[9].stec_quality_indicator, expected 18, is %d", check_msg->stec_sat_list[9].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[9].sv_id.constellation == 131, "incorrect value for stec_sat_list[9].sv_id.constellation, expected 131, is %d", check_msg->stec_sat_list[9].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[9].sv_id.satId == 3, "incorrect value for stec_sat_list[9].sv_id.satId, expected 3, is %d", check_msg->stec_sat_list[9].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[0] == 12630, "incorrect value for stec_sat_list[10].stec_coeff[0], expected 12630, is %d", check_msg->stec_sat_list[10].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[1] == -19721, "incorrect value for stec_sat_list[10].stec_coeff[1], expected -19721, is %d", check_msg->stec_sat_list[10].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[2] == 14502, "incorrect value for stec_sat_list[10].stec_coeff[2], expected 14502, is %d", check_msg->stec_sat_list[10].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[3] == 2591, "incorrect value for stec_sat_list[10].stec_coeff[3], expected 2591, is %d", check_msg->stec_sat_list[10].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[10].stec_quality_indicator == 252, "incorrect value for stec_sat_list[10].stec_quality_indicator, expected 252, is %d", check_msg->stec_sat_list[10].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[10].sv_id.constellation == 163, "incorrect value for stec_sat_list[10].sv_id.constellation, expected 163, is %d", check_msg->stec_sat_list[10].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[10].sv_id.satId == 170, "incorrect value for stec_sat_list[10].sv_id.satId, expected 170, is %d", check_msg->stec_sat_list[10].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[0] == -23340, "incorrect value for stec_sat_list[11].stec_coeff[0], expected -23340, is %d", check_msg->stec_sat_list[11].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[1] == -24063, "incorrect value for stec_sat_list[11].stec_coeff[1], expected -24063, is %d", check_msg->stec_sat_list[11].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[2] == 4650, "incorrect value for stec_sat_list[11].stec_coeff[2], expected 4650, is %d", check_msg->stec_sat_list[11].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[3] == -22148, "incorrect value for stec_sat_list[11].stec_coeff[3], expected -22148, is %d", check_msg->stec_sat_list[11].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[11].stec_quality_indicator == 241, "incorrect value for stec_sat_list[11].stec_quality_indicator, expected 241, is %d", check_msg->stec_sat_list[11].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[11].sv_id.constellation == 213, "incorrect value for stec_sat_list[11].sv_id.constellation, expected 213, is %d", check_msg->stec_sat_list[11].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[11].sv_id.satId == 119, "incorrect value for stec_sat_list[11].sv_id.satId, expected 119, is %d", check_msg->stec_sat_list[11].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[0] == 5944, "incorrect value for stec_sat_list[12].stec_coeff[0], expected 5944, is %d", check_msg->stec_sat_list[12].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[1] == 32142, "incorrect value for stec_sat_list[12].stec_coeff[1], expected 32142, is %d", check_msg->stec_sat_list[12].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[2] == 30760, "incorrect value for stec_sat_list[12].stec_coeff[2], expected 30760, is %d", check_msg->stec_sat_list[12].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[3] == 11587, "incorrect value for stec_sat_list[12].stec_coeff[3], expected 11587, is %d", check_msg->stec_sat_list[12].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[12].stec_quality_indicator == 26, "incorrect value for stec_sat_list[12].stec_quality_indicator, expected 26, is %d", check_msg->stec_sat_list[12].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[12].sv_id.constellation == 158, "incorrect value for stec_sat_list[12].sv_id.constellation, expected 158, is %d", check_msg->stec_sat_list[12].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[12].sv_id.satId == 121, "incorrect value for stec_sat_list[12].sv_id.satId, expected 121, is %d", check_msg->stec_sat_list[12].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[0] == 3095, "incorrect value for stec_sat_list[13].stec_coeff[0], expected 3095, is %d", check_msg->stec_sat_list[13].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[1] == 22769, "incorrect value for stec_sat_list[13].stec_coeff[1], expected 22769, is %d", check_msg->stec_sat_list[13].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[2] == -4283, "incorrect value for stec_sat_list[13].stec_coeff[2], expected -4283, is %d", check_msg->stec_sat_list[13].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[3] == 14844, "incorrect value for stec_sat_list[13].stec_coeff[3], expected 14844, is %d", check_msg->stec_sat_list[13].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[13].stec_quality_indicator == 110, "incorrect value for stec_sat_list[13].stec_quality_indicator, expected 110, is %d", check_msg->stec_sat_list[13].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[13].sv_id.constellation == 235, "incorrect value for stec_sat_list[13].sv_id.constellation, expected 235, is %d", check_msg->stec_sat_list[13].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[13].sv_id.satId == 126, "incorrect value for stec_sat_list[13].sv_id.satId, expected 126, is %d", check_msg->stec_sat_list[13].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[0] == -21032, "incorrect value for stec_sat_list[14].stec_coeff[0], expected -21032, is %d", check_msg->stec_sat_list[14].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[1] == -19726, "incorrect value for stec_sat_list[14].stec_coeff[1], expected -19726, is %d", check_msg->stec_sat_list[14].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[2] == 1297, "incorrect value for stec_sat_list[14].stec_coeff[2], expected 1297, is %d", check_msg->stec_sat_list[14].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[3] == -22049, "incorrect value for stec_sat_list[14].stec_coeff[3], expected -22049, is %d", check_msg->stec_sat_list[14].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[14].stec_quality_indicator == 201, "incorrect value for stec_sat_list[14].stec_quality_indicator, expected 201, is %d", check_msg->stec_sat_list[14].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[14].sv_id.constellation == 44, "incorrect value for stec_sat_list[14].sv_id.constellation, expected 44, is %d", check_msg->stec_sat_list[14].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[14].sv_id.satId == 93, "incorrect value for stec_sat_list[14].sv_id.satId, expected 93, is %d", check_msg->stec_sat_list[14].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[0] == 619, "incorrect value for stec_sat_list[15].stec_coeff[0], expected 619, is %d", check_msg->stec_sat_list[15].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[1] == -5744, "incorrect value for stec_sat_list[15].stec_coeff[1], expected -5744, is %d", check_msg->stec_sat_list[15].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[2] == 22542, "incorrect value for stec_sat_list[15].stec_coeff[2], expected 22542, is %d", check_msg->stec_sat_list[15].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[3] == -12000, "incorrect value for stec_sat_list[15].stec_coeff[3], expected -12000, is %d", check_msg->stec_sat_list[15].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[15].stec_quality_indicator == 77, "incorrect value for stec_sat_list[15].stec_quality_indicator, expected 77, is %d", check_msg->stec_sat_list[15].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[15].sv_id.constellation == 3, "incorrect value for stec_sat_list[15].sv_id.constellation, expected 3, is %d", check_msg->stec_sat_list[15].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[15].sv_id.satId == 192, "incorrect value for stec_sat_list[15].sv_id.satId, expected 192, is %d", check_msg->stec_sat_list[15].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[0] == 10651, "incorrect value for stec_sat_list[16].stec_coeff[0], expected 10651, is %d", check_msg->stec_sat_list[16].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[1] == -2889, "incorrect value for stec_sat_list[16].stec_coeff[1], expected -2889, is %d", check_msg->stec_sat_list[16].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[2] == 21150, "incorrect value for stec_sat_list[16].stec_coeff[2], expected 21150, is %d", check_msg->stec_sat_list[16].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[3] == 26421, "incorrect value for stec_sat_list[16].stec_coeff[3], expected 26421, is %d", check_msg->stec_sat_list[16].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[16].stec_quality_indicator == 123, "incorrect value for stec_sat_list[16].stec_quality_indicator, expected 123, is %d", check_msg->stec_sat_list[16].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[16].sv_id.constellation == 17, "incorrect value for stec_sat_list[16].sv_id.constellation, expected 17, is %d", check_msg->stec_sat_list[16].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[16].sv_id.satId == 1, "incorrect value for stec_sat_list[16].sv_id.satId, expected 1, is %d", check_msg->stec_sat_list[16].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[0] == -19165, "incorrect value for stec_sat_list[17].stec_coeff[0], expected -19165, is %d", check_msg->stec_sat_list[17].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[1] == 30229, "incorrect value for stec_sat_list[17].stec_coeff[1], expected 30229, is %d", check_msg->stec_sat_list[17].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[2] == -1282, "incorrect value for stec_sat_list[17].stec_coeff[2], expected -1282, is %d", check_msg->stec_sat_list[17].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[3] == -18382, "incorrect value for stec_sat_list[17].stec_coeff[3], expected -18382, is %d", check_msg->stec_sat_list[17].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[17].stec_quality_indicator == 185, "incorrect value for stec_sat_list[17].stec_quality_indicator, expected 185, is %d", check_msg->stec_sat_list[17].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[17].sv_id.constellation == 202, "incorrect value for stec_sat_list[17].sv_id.constellation, expected 202, is %d", check_msg->stec_sat_list[17].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[17].sv_id.satId == 14, "incorrect value for stec_sat_list[17].sv_id.satId, expected 14, is %d", check_msg->stec_sat_list[17].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[0] == -23752, "incorrect value for stec_sat_list[18].stec_coeff[0], expected -23752, is %d", check_msg->stec_sat_list[18].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[1] == 32433, "incorrect value for stec_sat_list[18].stec_coeff[1], expected 32433, is %d", check_msg->stec_sat_list[18].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[2] == 20441, "incorrect value for stec_sat_list[18].stec_coeff[2], expected 20441, is %d", check_msg->stec_sat_list[18].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[3] == -4181, "incorrect value for stec_sat_list[18].stec_coeff[3], expected -4181, is %d", check_msg->stec_sat_list[18].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[18].stec_quality_indicator == 45, "incorrect value for stec_sat_list[18].stec_quality_indicator, expected 45, is %d", check_msg->stec_sat_list[18].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[18].sv_id.constellation == 31, "incorrect value for stec_sat_list[18].sv_id.constellation, expected 31, is %d", check_msg->stec_sat_list[18].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[18].sv_id.satId == 50, "incorrect value for stec_sat_list[18].sv_id.satId, expected 50, is %d", check_msg->stec_sat_list[18].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[0] == -13968, "incorrect value for stec_sat_list[19].stec_coeff[0], expected -13968, is %d", check_msg->stec_sat_list[19].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[1] == -29322, "incorrect value for stec_sat_list[19].stec_coeff[1], expected -29322, is %d", check_msg->stec_sat_list[19].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[2] == -23790, "incorrect value for stec_sat_list[19].stec_coeff[2], expected -23790, is %d", check_msg->stec_sat_list[19].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[3] == 9063, "incorrect value for stec_sat_list[19].stec_coeff[3], expected 9063, is %d", check_msg->stec_sat_list[19].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[19].stec_quality_indicator == 238, "incorrect value for stec_sat_list[19].stec_quality_indicator, expected 238, is %d", check_msg->stec_sat_list[19].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[19].sv_id.constellation == 188, "incorrect value for stec_sat_list[19].sv_id.constellation, expected 188, is %d", check_msg->stec_sat_list[19].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[19].sv_id.satId == 237, "incorrect value for stec_sat_list[19].sv_id.satId, expected 237, is %d", check_msg->stec_sat_list[19].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[0] == 4737, "incorrect value for stec_sat_list[20].stec_coeff[0], expected 4737, is %d", check_msg->stec_sat_list[20].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[1] == 21877, "incorrect value for stec_sat_list[20].stec_coeff[1], expected 21877, is %d", check_msg->stec_sat_list[20].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[2] == 20414, "incorrect value for stec_sat_list[20].stec_coeff[2], expected 20414, is %d", check_msg->stec_sat_list[20].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[3] == -10286, "incorrect value for stec_sat_list[20].stec_coeff[3], expected -10286, is %d", check_msg->stec_sat_list[20].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[20].stec_quality_indicator == 82, "incorrect value for stec_sat_list[20].stec_quality_indicator, expected 82, is %d", check_msg->stec_sat_list[20].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[20].sv_id.constellation == 21, "incorrect value for stec_sat_list[20].sv_id.constellation, expected 21, is %d", check_msg->stec_sat_list[20].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[20].sv_id.satId == 63, "incorrect value for stec_sat_list[20].sv_id.satId, expected 63, is %d", check_msg->stec_sat_list[20].sv_id.satId); + ck_assert_msg(check_msg->header.iod_atmo == 60, + "incorrect value for header.iod_atmo, expected 60, is %d", + check_msg->header.iod_atmo); + ck_assert_msg(check_msg->header.num_msgs == 157, + "incorrect value for header.num_msgs, expected 157, is %d", + check_msg->header.num_msgs); + ck_assert_msg(check_msg->header.seq_num == 112, + "incorrect value for header.seq_num, expected 112, is %d", + check_msg->header.seq_num); + ck_assert_msg(check_msg->header.tile_id == 30066, + "incorrect value for header.tile_id, expected 30066, is %d", + check_msg->header.tile_id); + ck_assert_msg( + check_msg->header.tile_set_id == 58526, + "incorrect value for header.tile_set_id, expected 58526, is %d", + check_msg->header.tile_set_id); + ck_assert_msg( + check_msg->header.time.tow == 714907186, + "incorrect value for header.time.tow, expected 714907186, is %d", + check_msg->header.time.tow); + ck_assert_msg(check_msg->header.time.wn == 40055, + "incorrect value for header.time.wn, expected 40055, is %d", + check_msg->header.time.wn); + ck_assert_msg( + check_msg->header.update_interval == 47, + "incorrect value for header.update_interval, expected 47, is %d", + check_msg->header.update_interval); + ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[0] == -5289, + "incorrect value for stec_sat_list[0].stec_coeff[0], " + "expected -5289, is %d", + check_msg->stec_sat_list[0].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[1] == -20141, + "incorrect value for stec_sat_list[0].stec_coeff[1], " + "expected -20141, is %d", + check_msg->stec_sat_list[0].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[2] == 966, + "incorrect value for stec_sat_list[0].stec_coeff[2], " + "expected 966, is %d", + check_msg->stec_sat_list[0].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[3] == 2062, + "incorrect value for stec_sat_list[0].stec_coeff[3], " + "expected 2062, is %d", + check_msg->stec_sat_list[0].stec_coeff[3]); + ck_assert_msg(check_msg->stec_sat_list[0].stec_quality_indicator == 70, + "incorrect value for " + "stec_sat_list[0].stec_quality_indicator, expected 70, is %d", + check_msg->stec_sat_list[0].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[0].sv_id.constellation == 40, + "incorrect value for stec_sat_list[0].sv_id.constellation, " + "expected 40, is %d", + check_msg->stec_sat_list[0].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[0].sv_id.satId == 132, + "incorrect value for stec_sat_list[0].sv_id.satId, expected 132, is %d", + check_msg->stec_sat_list[0].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[0] == -19147, + "incorrect value for stec_sat_list[1].stec_coeff[0], " + "expected -19147, is %d", + check_msg->stec_sat_list[1].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[1] == -20902, + "incorrect value for stec_sat_list[1].stec_coeff[1], " + "expected -20902, is %d", + check_msg->stec_sat_list[1].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[2] == -26889, + "incorrect value for stec_sat_list[1].stec_coeff[2], " + "expected -26889, is %d", + check_msg->stec_sat_list[1].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[3] == -21446, + "incorrect value for stec_sat_list[1].stec_coeff[3], " + "expected -21446, is %d", + check_msg->stec_sat_list[1].stec_coeff[3]); + ck_assert_msg(check_msg->stec_sat_list[1].stec_quality_indicator == 44, + "incorrect value for " + "stec_sat_list[1].stec_quality_indicator, expected 44, is %d", + check_msg->stec_sat_list[1].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[1].sv_id.constellation == 12, + "incorrect value for stec_sat_list[1].sv_id.constellation, " + "expected 12, is %d", + check_msg->stec_sat_list[1].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[1].sv_id.satId == 70, + "incorrect value for stec_sat_list[1].sv_id.satId, expected 70, is %d", + check_msg->stec_sat_list[1].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[0] == 32176, + "incorrect value for stec_sat_list[2].stec_coeff[0], " + "expected 32176, is %d", + check_msg->stec_sat_list[2].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[1] == -20220, + "incorrect value for stec_sat_list[2].stec_coeff[1], " + "expected -20220, is %d", + check_msg->stec_sat_list[2].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[2] == 29157, + "incorrect value for stec_sat_list[2].stec_coeff[2], " + "expected 29157, is %d", + check_msg->stec_sat_list[2].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[3] == 19726, + "incorrect value for stec_sat_list[2].stec_coeff[3], " + "expected 19726, is %d", + check_msg->stec_sat_list[2].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[2].stec_quality_indicator == 119, + "incorrect value for stec_sat_list[2].stec_quality_indicator, expected " + "119, is %d", + check_msg->stec_sat_list[2].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[2].sv_id.constellation == 179, + "incorrect value for stec_sat_list[2].sv_id.constellation, " + "expected 179, is %d", + check_msg->stec_sat_list[2].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[2].sv_id.satId == 247, + "incorrect value for stec_sat_list[2].sv_id.satId, expected 247, is %d", + check_msg->stec_sat_list[2].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[0] == -8651, + "incorrect value for stec_sat_list[3].stec_coeff[0], " + "expected -8651, is %d", + check_msg->stec_sat_list[3].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[1] == -27973, + "incorrect value for stec_sat_list[3].stec_coeff[1], " + "expected -27973, is %d", + check_msg->stec_sat_list[3].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[2] == 23546, + "incorrect value for stec_sat_list[3].stec_coeff[2], " + "expected 23546, is %d", + check_msg->stec_sat_list[3].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[3] == -10284, + "incorrect value for stec_sat_list[3].stec_coeff[3], " + "expected -10284, is %d", + check_msg->stec_sat_list[3].stec_coeff[3]); + ck_assert_msg(check_msg->stec_sat_list[3].stec_quality_indicator == 23, + "incorrect value for " + "stec_sat_list[3].stec_quality_indicator, expected 23, is %d", + check_msg->stec_sat_list[3].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[3].sv_id.constellation == 185, + "incorrect value for stec_sat_list[3].sv_id.constellation, " + "expected 185, is %d", + check_msg->stec_sat_list[3].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[3].sv_id.satId == 153, + "incorrect value for stec_sat_list[3].sv_id.satId, expected 153, is %d", + check_msg->stec_sat_list[3].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[0] == 27486, + "incorrect value for stec_sat_list[4].stec_coeff[0], " + "expected 27486, is %d", + check_msg->stec_sat_list[4].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[1] == 23329, + "incorrect value for stec_sat_list[4].stec_coeff[1], " + "expected 23329, is %d", + check_msg->stec_sat_list[4].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[2] == 234, + "incorrect value for stec_sat_list[4].stec_coeff[2], " + "expected 234, is %d", + check_msg->stec_sat_list[4].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[3] == -29739, + "incorrect value for stec_sat_list[4].stec_coeff[3], " + "expected -29739, is %d", + check_msg->stec_sat_list[4].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[4].stec_quality_indicator == 250, + "incorrect value for stec_sat_list[4].stec_quality_indicator, expected " + "250, is %d", + check_msg->stec_sat_list[4].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[4].sv_id.constellation == 107, + "incorrect value for stec_sat_list[4].sv_id.constellation, " + "expected 107, is %d", + check_msg->stec_sat_list[4].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[4].sv_id.satId == 14, + "incorrect value for stec_sat_list[4].sv_id.satId, expected 14, is %d", + check_msg->stec_sat_list[4].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[0] == 18965, + "incorrect value for stec_sat_list[5].stec_coeff[0], " + "expected 18965, is %d", + check_msg->stec_sat_list[5].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[1] == -22098, + "incorrect value for stec_sat_list[5].stec_coeff[1], " + "expected -22098, is %d", + check_msg->stec_sat_list[5].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[2] == 22077, + "incorrect value for stec_sat_list[5].stec_coeff[2], " + "expected 22077, is %d", + check_msg->stec_sat_list[5].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[3] == -29093, + "incorrect value for stec_sat_list[5].stec_coeff[3], " + "expected -29093, is %d", + check_msg->stec_sat_list[5].stec_coeff[3]); + ck_assert_msg(check_msg->stec_sat_list[5].stec_quality_indicator == 50, + "incorrect value for " + "stec_sat_list[5].stec_quality_indicator, expected 50, is %d", + check_msg->stec_sat_list[5].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[5].sv_id.constellation == 179, + "incorrect value for stec_sat_list[5].sv_id.constellation, " + "expected 179, is %d", + check_msg->stec_sat_list[5].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[5].sv_id.satId == 95, + "incorrect value for stec_sat_list[5].sv_id.satId, expected 95, is %d", + check_msg->stec_sat_list[5].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[0] == -7898, + "incorrect value for stec_sat_list[6].stec_coeff[0], " + "expected -7898, is %d", + check_msg->stec_sat_list[6].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[1] == 26002, + "incorrect value for stec_sat_list[6].stec_coeff[1], " + "expected 26002, is %d", + check_msg->stec_sat_list[6].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[2] == -29879, + "incorrect value for stec_sat_list[6].stec_coeff[2], " + "expected -29879, is %d", + check_msg->stec_sat_list[6].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[3] == 30008, + "incorrect value for stec_sat_list[6].stec_coeff[3], " + "expected 30008, is %d", + check_msg->stec_sat_list[6].stec_coeff[3]); + ck_assert_msg(check_msg->stec_sat_list[6].stec_quality_indicator == 9, + "incorrect value for " + "stec_sat_list[6].stec_quality_indicator, expected 9, is %d", + check_msg->stec_sat_list[6].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[6].sv_id.constellation == 108, + "incorrect value for stec_sat_list[6].sv_id.constellation, " + "expected 108, is %d", + check_msg->stec_sat_list[6].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[6].sv_id.satId == 51, + "incorrect value for stec_sat_list[6].sv_id.satId, expected 51, is %d", + check_msg->stec_sat_list[6].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[0] == -12948, + "incorrect value for stec_sat_list[7].stec_coeff[0], " + "expected -12948, is %d", + check_msg->stec_sat_list[7].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[1] == 4701, + "incorrect value for stec_sat_list[7].stec_coeff[1], " + "expected 4701, is %d", + check_msg->stec_sat_list[7].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[2] == -15597, + "incorrect value for stec_sat_list[7].stec_coeff[2], " + "expected -15597, is %d", + check_msg->stec_sat_list[7].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[3] == -13791, + "incorrect value for stec_sat_list[7].stec_coeff[3], " + "expected -13791, is %d", + check_msg->stec_sat_list[7].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[7].stec_quality_indicator == 213, + "incorrect value for stec_sat_list[7].stec_quality_indicator, expected " + "213, is %d", + check_msg->stec_sat_list[7].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[7].sv_id.constellation == 37, + "incorrect value for stec_sat_list[7].sv_id.constellation, " + "expected 37, is %d", + check_msg->stec_sat_list[7].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[7].sv_id.satId == 82, + "incorrect value for stec_sat_list[7].sv_id.satId, expected 82, is %d", + check_msg->stec_sat_list[7].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[0] == -17283, + "incorrect value for stec_sat_list[8].stec_coeff[0], " + "expected -17283, is %d", + check_msg->stec_sat_list[8].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[1] == 14455, + "incorrect value for stec_sat_list[8].stec_coeff[1], " + "expected 14455, is %d", + check_msg->stec_sat_list[8].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[2] == -27067, + "incorrect value for stec_sat_list[8].stec_coeff[2], " + "expected -27067, is %d", + check_msg->stec_sat_list[8].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[3] == 19606, + "incorrect value for stec_sat_list[8].stec_coeff[3], " + "expected 19606, is %d", + check_msg->stec_sat_list[8].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[8].stec_quality_indicator == 178, + "incorrect value for stec_sat_list[8].stec_quality_indicator, expected " + "178, is %d", + check_msg->stec_sat_list[8].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[8].sv_id.constellation == 206, + "incorrect value for stec_sat_list[8].sv_id.constellation, " + "expected 206, is %d", + check_msg->stec_sat_list[8].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[8].sv_id.satId == 87, + "incorrect value for stec_sat_list[8].sv_id.satId, expected 87, is %d", + check_msg->stec_sat_list[8].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[0] == -12215, + "incorrect value for stec_sat_list[9].stec_coeff[0], " + "expected -12215, is %d", + check_msg->stec_sat_list[9].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[1] == -6072, + "incorrect value for stec_sat_list[9].stec_coeff[1], " + "expected -6072, is %d", + check_msg->stec_sat_list[9].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[2] == -1528, + "incorrect value for stec_sat_list[9].stec_coeff[2], " + "expected -1528, is %d", + check_msg->stec_sat_list[9].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[3] == -19765, + "incorrect value for stec_sat_list[9].stec_coeff[3], " + "expected -19765, is %d", + check_msg->stec_sat_list[9].stec_coeff[3]); + ck_assert_msg(check_msg->stec_sat_list[9].stec_quality_indicator == 18, + "incorrect value for " + "stec_sat_list[9].stec_quality_indicator, expected 18, is %d", + check_msg->stec_sat_list[9].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[9].sv_id.constellation == 131, + "incorrect value for stec_sat_list[9].sv_id.constellation, " + "expected 131, is %d", + check_msg->stec_sat_list[9].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[9].sv_id.satId == 3, + "incorrect value for stec_sat_list[9].sv_id.satId, expected 3, is %d", + check_msg->stec_sat_list[9].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[0] == 12630, + "incorrect value for stec_sat_list[10].stec_coeff[0], " + "expected 12630, is %d", + check_msg->stec_sat_list[10].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[1] == -19721, + "incorrect value for stec_sat_list[10].stec_coeff[1], " + "expected -19721, is %d", + check_msg->stec_sat_list[10].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[2] == 14502, + "incorrect value for stec_sat_list[10].stec_coeff[2], " + "expected 14502, is %d", + check_msg->stec_sat_list[10].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[3] == 2591, + "incorrect value for stec_sat_list[10].stec_coeff[3], " + "expected 2591, is %d", + check_msg->stec_sat_list[10].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[10].stec_quality_indicator == 252, + "incorrect value for stec_sat_list[10].stec_quality_indicator, " + "expected 252, is %d", + check_msg->stec_sat_list[10].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[10].sv_id.constellation == 163, + "incorrect value for stec_sat_list[10].sv_id.constellation, " + "expected 163, is %d", + check_msg->stec_sat_list[10].sv_id.constellation); + ck_assert_msg(check_msg->stec_sat_list[10].sv_id.satId == 170, + "incorrect value for stec_sat_list[10].sv_id.satId, expected " + "170, is %d", + check_msg->stec_sat_list[10].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[0] == -23340, + "incorrect value for stec_sat_list[11].stec_coeff[0], " + "expected -23340, is %d", + check_msg->stec_sat_list[11].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[1] == -24063, + "incorrect value for stec_sat_list[11].stec_coeff[1], " + "expected -24063, is %d", + check_msg->stec_sat_list[11].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[2] == 4650, + "incorrect value for stec_sat_list[11].stec_coeff[2], " + "expected 4650, is %d", + check_msg->stec_sat_list[11].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[3] == -22148, + "incorrect value for stec_sat_list[11].stec_coeff[3], " + "expected -22148, is %d", + check_msg->stec_sat_list[11].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[11].stec_quality_indicator == 241, + "incorrect value for stec_sat_list[11].stec_quality_indicator, " + "expected 241, is %d", + check_msg->stec_sat_list[11].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[11].sv_id.constellation == 213, + "incorrect value for stec_sat_list[11].sv_id.constellation, " + "expected 213, is %d", + check_msg->stec_sat_list[11].sv_id.constellation); + ck_assert_msg(check_msg->stec_sat_list[11].sv_id.satId == 119, + "incorrect value for stec_sat_list[11].sv_id.satId, expected " + "119, is %d", + check_msg->stec_sat_list[11].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[0] == 5944, + "incorrect value for stec_sat_list[12].stec_coeff[0], " + "expected 5944, is %d", + check_msg->stec_sat_list[12].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[1] == 32142, + "incorrect value for stec_sat_list[12].stec_coeff[1], " + "expected 32142, is %d", + check_msg->stec_sat_list[12].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[2] == 30760, + "incorrect value for stec_sat_list[12].stec_coeff[2], " + "expected 30760, is %d", + check_msg->stec_sat_list[12].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[3] == 11587, + "incorrect value for stec_sat_list[12].stec_coeff[3], " + "expected 11587, is %d", + check_msg->stec_sat_list[12].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[12].stec_quality_indicator == 26, + "incorrect value for stec_sat_list[12].stec_quality_indicator, " + "expected 26, is %d", + check_msg->stec_sat_list[12].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[12].sv_id.constellation == 158, + "incorrect value for stec_sat_list[12].sv_id.constellation, " + "expected 158, is %d", + check_msg->stec_sat_list[12].sv_id.constellation); + ck_assert_msg(check_msg->stec_sat_list[12].sv_id.satId == 121, + "incorrect value for stec_sat_list[12].sv_id.satId, expected " + "121, is %d", + check_msg->stec_sat_list[12].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[0] == 3095, + "incorrect value for stec_sat_list[13].stec_coeff[0], " + "expected 3095, is %d", + check_msg->stec_sat_list[13].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[1] == 22769, + "incorrect value for stec_sat_list[13].stec_coeff[1], " + "expected 22769, is %d", + check_msg->stec_sat_list[13].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[2] == -4283, + "incorrect value for stec_sat_list[13].stec_coeff[2], " + "expected -4283, is %d", + check_msg->stec_sat_list[13].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[3] == 14844, + "incorrect value for stec_sat_list[13].stec_coeff[3], " + "expected 14844, is %d", + check_msg->stec_sat_list[13].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[13].stec_quality_indicator == 110, + "incorrect value for stec_sat_list[13].stec_quality_indicator, " + "expected 110, is %d", + check_msg->stec_sat_list[13].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[13].sv_id.constellation == 235, + "incorrect value for stec_sat_list[13].sv_id.constellation, " + "expected 235, is %d", + check_msg->stec_sat_list[13].sv_id.constellation); + ck_assert_msg(check_msg->stec_sat_list[13].sv_id.satId == 126, + "incorrect value for stec_sat_list[13].sv_id.satId, expected " + "126, is %d", + check_msg->stec_sat_list[13].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[0] == -21032, + "incorrect value for stec_sat_list[14].stec_coeff[0], " + "expected -21032, is %d", + check_msg->stec_sat_list[14].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[1] == -19726, + "incorrect value for stec_sat_list[14].stec_coeff[1], " + "expected -19726, is %d", + check_msg->stec_sat_list[14].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[2] == 1297, + "incorrect value for stec_sat_list[14].stec_coeff[2], " + "expected 1297, is %d", + check_msg->stec_sat_list[14].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[3] == -22049, + "incorrect value for stec_sat_list[14].stec_coeff[3], " + "expected -22049, is %d", + check_msg->stec_sat_list[14].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[14].stec_quality_indicator == 201, + "incorrect value for stec_sat_list[14].stec_quality_indicator, " + "expected 201, is %d", + check_msg->stec_sat_list[14].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[14].sv_id.constellation == 44, + "incorrect value for stec_sat_list[14].sv_id.constellation, " + "expected 44, is %d", + check_msg->stec_sat_list[14].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[14].sv_id.satId == 93, + "incorrect value for stec_sat_list[14].sv_id.satId, expected 93, is %d", + check_msg->stec_sat_list[14].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[0] == 619, + "incorrect value for stec_sat_list[15].stec_coeff[0], " + "expected 619, is %d", + check_msg->stec_sat_list[15].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[1] == -5744, + "incorrect value for stec_sat_list[15].stec_coeff[1], " + "expected -5744, is %d", + check_msg->stec_sat_list[15].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[2] == 22542, + "incorrect value for stec_sat_list[15].stec_coeff[2], " + "expected 22542, is %d", + check_msg->stec_sat_list[15].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[3] == -12000, + "incorrect value for stec_sat_list[15].stec_coeff[3], " + "expected -12000, is %d", + check_msg->stec_sat_list[15].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[15].stec_quality_indicator == 77, + "incorrect value for stec_sat_list[15].stec_quality_indicator, " + "expected 77, is %d", + check_msg->stec_sat_list[15].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[15].sv_id.constellation == 3, + "incorrect value for stec_sat_list[15].sv_id.constellation, " + "expected 3, is %d", + check_msg->stec_sat_list[15].sv_id.constellation); + ck_assert_msg(check_msg->stec_sat_list[15].sv_id.satId == 192, + "incorrect value for stec_sat_list[15].sv_id.satId, expected " + "192, is %d", + check_msg->stec_sat_list[15].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[0] == 10651, + "incorrect value for stec_sat_list[16].stec_coeff[0], " + "expected 10651, is %d", + check_msg->stec_sat_list[16].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[1] == -2889, + "incorrect value for stec_sat_list[16].stec_coeff[1], " + "expected -2889, is %d", + check_msg->stec_sat_list[16].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[2] == 21150, + "incorrect value for stec_sat_list[16].stec_coeff[2], " + "expected 21150, is %d", + check_msg->stec_sat_list[16].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[3] == 26421, + "incorrect value for stec_sat_list[16].stec_coeff[3], " + "expected 26421, is %d", + check_msg->stec_sat_list[16].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[16].stec_quality_indicator == 123, + "incorrect value for stec_sat_list[16].stec_quality_indicator, " + "expected 123, is %d", + check_msg->stec_sat_list[16].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[16].sv_id.constellation == 17, + "incorrect value for stec_sat_list[16].sv_id.constellation, " + "expected 17, is %d", + check_msg->stec_sat_list[16].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[16].sv_id.satId == 1, + "incorrect value for stec_sat_list[16].sv_id.satId, expected 1, is %d", + check_msg->stec_sat_list[16].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[0] == -19165, + "incorrect value for stec_sat_list[17].stec_coeff[0], " + "expected -19165, is %d", + check_msg->stec_sat_list[17].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[1] == 30229, + "incorrect value for stec_sat_list[17].stec_coeff[1], " + "expected 30229, is %d", + check_msg->stec_sat_list[17].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[2] == -1282, + "incorrect value for stec_sat_list[17].stec_coeff[2], " + "expected -1282, is %d", + check_msg->stec_sat_list[17].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[3] == -18382, + "incorrect value for stec_sat_list[17].stec_coeff[3], " + "expected -18382, is %d", + check_msg->stec_sat_list[17].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[17].stec_quality_indicator == 185, + "incorrect value for stec_sat_list[17].stec_quality_indicator, " + "expected 185, is %d", + check_msg->stec_sat_list[17].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[17].sv_id.constellation == 202, + "incorrect value for stec_sat_list[17].sv_id.constellation, " + "expected 202, is %d", + check_msg->stec_sat_list[17].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[17].sv_id.satId == 14, + "incorrect value for stec_sat_list[17].sv_id.satId, expected 14, is %d", + check_msg->stec_sat_list[17].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[0] == -23752, + "incorrect value for stec_sat_list[18].stec_coeff[0], " + "expected -23752, is %d", + check_msg->stec_sat_list[18].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[1] == 32433, + "incorrect value for stec_sat_list[18].stec_coeff[1], " + "expected 32433, is %d", + check_msg->stec_sat_list[18].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[2] == 20441, + "incorrect value for stec_sat_list[18].stec_coeff[2], " + "expected 20441, is %d", + check_msg->stec_sat_list[18].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[3] == -4181, + "incorrect value for stec_sat_list[18].stec_coeff[3], " + "expected -4181, is %d", + check_msg->stec_sat_list[18].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[18].stec_quality_indicator == 45, + "incorrect value for stec_sat_list[18].stec_quality_indicator, " + "expected 45, is %d", + check_msg->stec_sat_list[18].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[18].sv_id.constellation == 31, + "incorrect value for stec_sat_list[18].sv_id.constellation, " + "expected 31, is %d", + check_msg->stec_sat_list[18].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[18].sv_id.satId == 50, + "incorrect value for stec_sat_list[18].sv_id.satId, expected 50, is %d", + check_msg->stec_sat_list[18].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[0] == -13968, + "incorrect value for stec_sat_list[19].stec_coeff[0], " + "expected -13968, is %d", + check_msg->stec_sat_list[19].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[1] == -29322, + "incorrect value for stec_sat_list[19].stec_coeff[1], " + "expected -29322, is %d", + check_msg->stec_sat_list[19].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[2] == -23790, + "incorrect value for stec_sat_list[19].stec_coeff[2], " + "expected -23790, is %d", + check_msg->stec_sat_list[19].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[3] == 9063, + "incorrect value for stec_sat_list[19].stec_coeff[3], " + "expected 9063, is %d", + check_msg->stec_sat_list[19].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[19].stec_quality_indicator == 238, + "incorrect value for stec_sat_list[19].stec_quality_indicator, " + "expected 238, is %d", + check_msg->stec_sat_list[19].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[19].sv_id.constellation == 188, + "incorrect value for stec_sat_list[19].sv_id.constellation, " + "expected 188, is %d", + check_msg->stec_sat_list[19].sv_id.constellation); + ck_assert_msg(check_msg->stec_sat_list[19].sv_id.satId == 237, + "incorrect value for stec_sat_list[19].sv_id.satId, expected " + "237, is %d", + check_msg->stec_sat_list[19].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[0] == 4737, + "incorrect value for stec_sat_list[20].stec_coeff[0], " + "expected 4737, is %d", + check_msg->stec_sat_list[20].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[1] == 21877, + "incorrect value for stec_sat_list[20].stec_coeff[1], " + "expected 21877, is %d", + check_msg->stec_sat_list[20].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[2] == 20414, + "incorrect value for stec_sat_list[20].stec_coeff[2], " + "expected 20414, is %d", + check_msg->stec_sat_list[20].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[3] == -10286, + "incorrect value for stec_sat_list[20].stec_coeff[3], " + "expected -10286, is %d", + check_msg->stec_sat_list[20].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[20].stec_quality_indicator == 82, + "incorrect value for stec_sat_list[20].stec_quality_indicator, " + "expected 82, is %d", + check_msg->stec_sat_list[20].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[20].sv_id.constellation == 21, + "incorrect value for stec_sat_list[20].sv_id.constellation, " + "expected 21, is %d", + check_msg->stec_sat_list[20].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[20].sv_id.satId == 63, + "incorrect value for stec_sat_list[20].sv_id.satId, expected 63, is %d", + check_msg->stec_sat_list[20].sv_id.satId); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep); +Suite *legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.c index a0e7d73c3..da411fdc5 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,40 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x5eb, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x5eb, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x5eb, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x5eb, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,235,5,39,7,252,70,81,196,232,185,43,147,123,39,4,126,19,111,97,248,130,217,217,106,58,12,65,230,171,81,95,86,16,39,84,228,208,201,81,219,99,203,61,182,66,125,203,3,193,44,100,220,125,60,21,93,218,247,158,207,93,129,134,14,209,48,14,215,153,148,147,72,225,180,236,205,201,33,3,246,204,19,3,98,4,194,191,246,76,219,31,191,113,79,177,15,251,33,19,96,54,58,146,210,100,249,72,21,161,211,198,21,238,111,107,36,227,225,213,3,71,243,63,65,236,92,77,0,169,15,182,5,240,180,9,122,86,232,6,103,104,254,189,81,110,2,49,202,84,216,55,50,181,5,123,80,49,244,224,188,125,164,230,56,66,124,168,59,139,106,118,51,187,216,191,158,77,92,58,253,132,150,165,9,154,189,218,61,209,1,82,181,196,23,53,182,112,192,206,167,157,244,35,1,189,217,61,88,97,201,201,74,251,217,14,104,184,54,52,74,238,10,129,22,178,226,109,88,157,30,196,175,26,76,34,116,220,154,232,12,179,244,15,155,196,202,72,70,115,10,214,114,39,245,28,237,68,136,155, }; + u8 encoded_frame[] = { + 85, 235, 5, 39, 7, 252, 70, 81, 196, 232, 185, 43, 147, 123, + 39, 4, 126, 19, 111, 97, 248, 130, 217, 217, 106, 58, 12, 65, + 230, 171, 81, 95, 86, 16, 39, 84, 228, 208, 201, 81, 219, 99, + 203, 61, 182, 66, 125, 203, 3, 193, 44, 100, 220, 125, 60, 21, + 93, 218, 247, 158, 207, 93, 129, 134, 14, 209, 48, 14, 215, 153, + 148, 147, 72, 225, 180, 236, 205, 201, 33, 3, 246, 204, 19, 3, + 98, 4, 194, 191, 246, 76, 219, 31, 191, 113, 79, 177, 15, 251, + 33, 19, 96, 54, 58, 146, 210, 100, 249, 72, 21, 161, 211, 198, + 21, 238, 111, 107, 36, 227, 225, 213, 3, 71, 243, 63, 65, 236, + 92, 77, 0, 169, 15, 182, 5, 240, 180, 9, 122, 86, 232, 6, + 103, 104, 254, 189, 81, 110, 2, 49, 202, 84, 216, 55, 50, 181, + 5, 123, 80, 49, 244, 224, 188, 125, 164, 230, 56, 66, 124, 168, + 59, 139, 106, 118, 51, 187, 216, 191, 158, 77, 92, 58, 253, 132, + 150, 165, 9, 154, 189, 218, 61, 209, 1, 82, 181, 196, 23, 53, + 182, 112, 192, 206, 167, 157, 244, 35, 1, 189, 217, 61, 88, 97, + 201, 201, 74, 251, 217, 14, 104, 184, 54, 52, 74, 238, 10, 129, + 22, 178, 226, 109, 88, 157, 30, 196, 175, 26, 76, 34, 116, 220, + 154, 232, 12, 179, 244, 15, 155, 196, 202, 72, 70, 115, 10, 214, + 114, 39, 245, 28, 237, 68, 136, 155, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_stec_correction_dep_a_t* test_msg = ( msg_ssr_stec_correction_dep_a_t* )test_msg_storage; + msg_ssr_stec_correction_dep_a_t *test_msg = + (msg_ssr_stec_correction_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->header.iod_atmo = 4; test_msg->header.num_msgs = 147; @@ -743,223 +763,728 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA ) test_msg->stec_sat_list[21].stec_quality_indicator = 115; test_msg->stec_sat_list[21].sv_id.constellation = 70; test_msg->stec_sat_list[21].sv_id.satId = 72; - sbp_payload_send(&sbp_state, 0x5eb, 1831, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x5eb, 1831, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1831, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1831, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x5eb, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_stec_correction_dep_a_t* check_msg = ( msg_ssr_stec_correction_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_stec_correction_dep_a_t *check_msg = + (msg_ssr_stec_correction_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->header.iod_atmo == 4, "incorrect value for header.iod_atmo, expected 4, is %d", check_msg->header.iod_atmo); - ck_assert_msg(check_msg->header.num_msgs == 147, "incorrect value for header.num_msgs, expected 147, is %d", check_msg->header.num_msgs); - ck_assert_msg(check_msg->header.seq_num == 123, "incorrect value for header.seq_num, expected 123, is %d", check_msg->header.seq_num); - ck_assert_msg(check_msg->header.time.tow == 3905179974, "incorrect value for header.time.tow, expected 3905179974, is %d", check_msg->header.time.tow); - ck_assert_msg(check_msg->header.time.wn == 11193, "incorrect value for header.time.wn, expected 11193, is %d", check_msg->header.time.wn); - ck_assert_msg(check_msg->header.update_interval == 39, "incorrect value for header.update_interval, expected 39, is %d", check_msg->header.update_interval); - ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[0] == -1951, "incorrect value for stec_sat_list[0].stec_coeff[0], expected -1951, is %d", check_msg->stec_sat_list[0].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[1] == -9854, "incorrect value for stec_sat_list[0].stec_coeff[1], expected -9854, is %d", check_msg->stec_sat_list[0].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[2] == 27353, "incorrect value for stec_sat_list[0].stec_coeff[2], expected 27353, is %d", check_msg->stec_sat_list[0].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[3] == 3130, "incorrect value for stec_sat_list[0].stec_coeff[3], expected 3130, is %d", check_msg->stec_sat_list[0].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[0].stec_quality_indicator == 111, "incorrect value for stec_sat_list[0].stec_quality_indicator, expected 111, is %d", check_msg->stec_sat_list[0].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[0].sv_id.constellation == 19, "incorrect value for stec_sat_list[0].sv_id.constellation, expected 19, is %d", check_msg->stec_sat_list[0].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[0].sv_id.satId == 126, "incorrect value for stec_sat_list[0].sv_id.satId, expected 126, is %d", check_msg->stec_sat_list[0].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[0] == 24401, "incorrect value for stec_sat_list[1].stec_coeff[0], expected 24401, is %d", check_msg->stec_sat_list[1].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[1] == 4182, "incorrect value for stec_sat_list[1].stec_coeff[1], expected 4182, is %d", check_msg->stec_sat_list[1].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[2] == 21543, "incorrect value for stec_sat_list[1].stec_coeff[2], expected 21543, is %d", check_msg->stec_sat_list[1].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[3] == -12060, "incorrect value for stec_sat_list[1].stec_coeff[3], expected -12060, is %d", check_msg->stec_sat_list[1].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[1].stec_quality_indicator == 171, "incorrect value for stec_sat_list[1].stec_quality_indicator, expected 171, is %d", check_msg->stec_sat_list[1].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[1].sv_id.constellation == 230, "incorrect value for stec_sat_list[1].sv_id.constellation, expected 230, is %d", check_msg->stec_sat_list[1].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[1].sv_id.satId == 65, "incorrect value for stec_sat_list[1].sv_id.satId, expected 65, is %d", check_msg->stec_sat_list[1].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[0] == -13469, "incorrect value for stec_sat_list[2].stec_coeff[0], expected -13469, is %d", check_msg->stec_sat_list[2].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[1] == -18883, "incorrect value for stec_sat_list[2].stec_coeff[1], expected -18883, is %d", check_msg->stec_sat_list[2].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[2] == 32066, "incorrect value for stec_sat_list[2].stec_coeff[2], expected 32066, is %d", check_msg->stec_sat_list[2].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[3] == 971, "incorrect value for stec_sat_list[2].stec_coeff[3], expected 971, is %d", check_msg->stec_sat_list[2].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[2].stec_quality_indicator == 219, "incorrect value for stec_sat_list[2].stec_quality_indicator, expected 219, is %d", check_msg->stec_sat_list[2].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[2].sv_id.constellation == 81, "incorrect value for stec_sat_list[2].sv_id.constellation, expected 81, is %d", check_msg->stec_sat_list[2].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[2].sv_id.satId == 201, "incorrect value for stec_sat_list[2].sv_id.satId, expected 201, is %d", check_msg->stec_sat_list[2].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[0] == 32220, "incorrect value for stec_sat_list[3].stec_coeff[0], expected 32220, is %d", check_msg->stec_sat_list[3].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[1] == 5436, "incorrect value for stec_sat_list[3].stec_coeff[1], expected 5436, is %d", check_msg->stec_sat_list[3].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[2] == -9635, "incorrect value for stec_sat_list[3].stec_coeff[2], expected -9635, is %d", check_msg->stec_sat_list[3].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[3] == -24841, "incorrect value for stec_sat_list[3].stec_coeff[3], expected -24841, is %d", check_msg->stec_sat_list[3].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[3].stec_quality_indicator == 100, "incorrect value for stec_sat_list[3].stec_quality_indicator, expected 100, is %d", check_msg->stec_sat_list[3].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[3].sv_id.constellation == 44, "incorrect value for stec_sat_list[3].sv_id.constellation, expected 44, is %d", check_msg->stec_sat_list[3].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[3].sv_id.satId == 193, "incorrect value for stec_sat_list[3].sv_id.satId, expected 193, is %d", check_msg->stec_sat_list[3].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[0] == 3718, "incorrect value for stec_sat_list[4].stec_coeff[0], expected 3718, is %d", check_msg->stec_sat_list[4].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[1] == 12497, "incorrect value for stec_sat_list[4].stec_coeff[1], expected 12497, is %d", check_msg->stec_sat_list[4].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[2] == -10482, "incorrect value for stec_sat_list[4].stec_coeff[2], expected -10482, is %d", check_msg->stec_sat_list[4].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[3] == -27495, "incorrect value for stec_sat_list[4].stec_coeff[3], expected -27495, is %d", check_msg->stec_sat_list[4].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[4].stec_quality_indicator == 129, "incorrect value for stec_sat_list[4].stec_quality_indicator, expected 129, is %d", check_msg->stec_sat_list[4].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[4].sv_id.constellation == 93, "incorrect value for stec_sat_list[4].sv_id.constellation, expected 93, is %d", check_msg->stec_sat_list[4].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[4].sv_id.satId == 207, "incorrect value for stec_sat_list[4].sv_id.satId, expected 207, is %d", check_msg->stec_sat_list[4].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[0] == -4940, "incorrect value for stec_sat_list[5].stec_coeff[0], expected -4940, is %d", check_msg->stec_sat_list[5].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[1] == -13875, "incorrect value for stec_sat_list[5].stec_coeff[1], expected -13875, is %d", check_msg->stec_sat_list[5].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[2] == 801, "incorrect value for stec_sat_list[5].stec_coeff[2], expected 801, is %d", check_msg->stec_sat_list[5].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[3] == -13066, "incorrect value for stec_sat_list[5].stec_coeff[3], expected -13066, is %d", check_msg->stec_sat_list[5].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[5].stec_quality_indicator == 225, "incorrect value for stec_sat_list[5].stec_quality_indicator, expected 225, is %d", check_msg->stec_sat_list[5].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[5].sv_id.constellation == 72, "incorrect value for stec_sat_list[5].sv_id.constellation, expected 72, is %d", check_msg->stec_sat_list[5].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[5].sv_id.satId == 147, "incorrect value for stec_sat_list[5].sv_id.satId, expected 147, is %d", check_msg->stec_sat_list[5].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[0] == -15868, "incorrect value for stec_sat_list[6].stec_coeff[0], expected -15868, is %d", check_msg->stec_sat_list[6].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[1] == -2369, "incorrect value for stec_sat_list[6].stec_coeff[1], expected -2369, is %d", check_msg->stec_sat_list[6].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[2] == -9396, "incorrect value for stec_sat_list[6].stec_coeff[2], expected -9396, is %d", check_msg->stec_sat_list[6].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[3] == -16609, "incorrect value for stec_sat_list[6].stec_coeff[3], expected -16609, is %d", check_msg->stec_sat_list[6].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[6].stec_quality_indicator == 98, "incorrect value for stec_sat_list[6].stec_quality_indicator, expected 98, is %d", check_msg->stec_sat_list[6].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[6].sv_id.constellation == 3, "incorrect value for stec_sat_list[6].sv_id.constellation, expected 3, is %d", check_msg->stec_sat_list[6].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[6].sv_id.satId == 19, "incorrect value for stec_sat_list[6].sv_id.satId, expected 19, is %d", check_msg->stec_sat_list[6].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[0] == -1265, "incorrect value for stec_sat_list[7].stec_coeff[0], expected -1265, is %d", check_msg->stec_sat_list[7].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[1] == 4897, "incorrect value for stec_sat_list[7].stec_coeff[1], expected 4897, is %d", check_msg->stec_sat_list[7].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[2] == 13920, "incorrect value for stec_sat_list[7].stec_coeff[2], expected 13920, is %d", check_msg->stec_sat_list[7].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[3] == -28102, "incorrect value for stec_sat_list[7].stec_coeff[3], expected -28102, is %d", check_msg->stec_sat_list[7].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[7].stec_quality_indicator == 177, "incorrect value for stec_sat_list[7].stec_quality_indicator, expected 177, is %d", check_msg->stec_sat_list[7].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[7].sv_id.constellation == 79, "incorrect value for stec_sat_list[7].sv_id.constellation, expected 79, is %d", check_msg->stec_sat_list[7].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[7].sv_id.satId == 113, "incorrect value for stec_sat_list[7].sv_id.satId, expected 113, is %d", check_msg->stec_sat_list[7].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[0] == 5448, "incorrect value for stec_sat_list[8].stec_coeff[0], expected 5448, is %d", check_msg->stec_sat_list[8].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[1] == -11359, "incorrect value for stec_sat_list[8].stec_coeff[1], expected -11359, is %d", check_msg->stec_sat_list[8].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[2] == 5574, "incorrect value for stec_sat_list[8].stec_coeff[2], expected 5574, is %d", check_msg->stec_sat_list[8].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[3] == 28654, "incorrect value for stec_sat_list[8].stec_coeff[3], expected 28654, is %d", check_msg->stec_sat_list[8].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[8].stec_quality_indicator == 249, "incorrect value for stec_sat_list[8].stec_quality_indicator, expected 249, is %d", check_msg->stec_sat_list[8].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[8].sv_id.constellation == 100, "incorrect value for stec_sat_list[8].sv_id.constellation, expected 100, is %d", check_msg->stec_sat_list[8].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[8].sv_id.satId == 210, "incorrect value for stec_sat_list[8].sv_id.satId, expected 210, is %d", check_msg->stec_sat_list[8].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[0] == -10783, "incorrect value for stec_sat_list[9].stec_coeff[0], expected -10783, is %d", check_msg->stec_sat_list[9].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[1] == 18179, "incorrect value for stec_sat_list[9].stec_coeff[1], expected 18179, is %d", check_msg->stec_sat_list[9].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[2] == 16371, "incorrect value for stec_sat_list[9].stec_coeff[2], expected 16371, is %d", check_msg->stec_sat_list[9].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[3] == -5055, "incorrect value for stec_sat_list[9].stec_coeff[3], expected -5055, is %d", check_msg->stec_sat_list[9].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[9].stec_quality_indicator == 227, "incorrect value for stec_sat_list[9].stec_quality_indicator, expected 227, is %d", check_msg->stec_sat_list[9].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[9].sv_id.constellation == 36, "incorrect value for stec_sat_list[9].sv_id.constellation, expected 36, is %d", check_msg->stec_sat_list[9].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[9].sv_id.satId == 107, "incorrect value for stec_sat_list[9].sv_id.satId, expected 107, is %d", check_msg->stec_sat_list[9].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[0] == 4009, "incorrect value for stec_sat_list[10].stec_coeff[0], expected 4009, is %d", check_msg->stec_sat_list[10].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[1] == 1462, "incorrect value for stec_sat_list[10].stec_coeff[1], expected 1462, is %d", check_msg->stec_sat_list[10].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[2] == -19216, "incorrect value for stec_sat_list[10].stec_coeff[2], expected -19216, is %d", check_msg->stec_sat_list[10].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[3] == 31241, "incorrect value for stec_sat_list[10].stec_coeff[3], expected 31241, is %d", check_msg->stec_sat_list[10].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[10].stec_quality_indicator == 0, "incorrect value for stec_sat_list[10].stec_quality_indicator, expected 0, is %d", check_msg->stec_sat_list[10].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[10].sv_id.constellation == 77, "incorrect value for stec_sat_list[10].sv_id.constellation, expected 77, is %d", check_msg->stec_sat_list[10].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[10].sv_id.satId == 92, "incorrect value for stec_sat_list[10].sv_id.satId, expected 92, is %d", check_msg->stec_sat_list[10].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[0] == 26727, "incorrect value for stec_sat_list[11].stec_coeff[0], expected 26727, is %d", check_msg->stec_sat_list[11].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[1] == -16898, "incorrect value for stec_sat_list[11].stec_coeff[1], expected -16898, is %d", check_msg->stec_sat_list[11].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[2] == 28241, "incorrect value for stec_sat_list[11].stec_coeff[2], expected 28241, is %d", check_msg->stec_sat_list[11].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[3] == 12546, "incorrect value for stec_sat_list[11].stec_coeff[3], expected 12546, is %d", check_msg->stec_sat_list[11].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[11].stec_quality_indicator == 6, "incorrect value for stec_sat_list[11].stec_quality_indicator, expected 6, is %d", check_msg->stec_sat_list[11].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[11].sv_id.constellation == 232, "incorrect value for stec_sat_list[11].sv_id.constellation, expected 232, is %d", check_msg->stec_sat_list[11].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[11].sv_id.satId == 86, "incorrect value for stec_sat_list[11].sv_id.satId, expected 86, is %d", check_msg->stec_sat_list[11].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[0] == 12855, "incorrect value for stec_sat_list[12].stec_coeff[0], expected 12855, is %d", check_msg->stec_sat_list[12].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[1] == 1461, "incorrect value for stec_sat_list[12].stec_coeff[1], expected 1461, is %d", check_msg->stec_sat_list[12].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[2] == 20603, "incorrect value for stec_sat_list[12].stec_coeff[2], expected 20603, is %d", check_msg->stec_sat_list[12].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[3] == -3023, "incorrect value for stec_sat_list[12].stec_coeff[3], expected -3023, is %d", check_msg->stec_sat_list[12].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[12].stec_quality_indicator == 216, "incorrect value for stec_sat_list[12].stec_quality_indicator, expected 216, is %d", check_msg->stec_sat_list[12].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[12].sv_id.constellation == 84, "incorrect value for stec_sat_list[12].sv_id.constellation, expected 84, is %d", check_msg->stec_sat_list[12].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[12].sv_id.satId == 202, "incorrect value for stec_sat_list[12].sv_id.satId, expected 202, is %d", check_msg->stec_sat_list[12].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[0] == -6492, "incorrect value for stec_sat_list[13].stec_coeff[0], expected -6492, is %d", check_msg->stec_sat_list[13].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[1] == 16952, "incorrect value for stec_sat_list[13].stec_coeff[1], expected 16952, is %d", check_msg->stec_sat_list[13].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[2] == -22404, "incorrect value for stec_sat_list[13].stec_coeff[2], expected -22404, is %d", check_msg->stec_sat_list[13].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[3] == -29893, "incorrect value for stec_sat_list[13].stec_coeff[3], expected -29893, is %d", check_msg->stec_sat_list[13].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[13].stec_quality_indicator == 125, "incorrect value for stec_sat_list[13].stec_quality_indicator, expected 125, is %d", check_msg->stec_sat_list[13].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[13].sv_id.constellation == 188, "incorrect value for stec_sat_list[13].sv_id.constellation, expected 188, is %d", check_msg->stec_sat_list[13].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[13].sv_id.satId == 224, "incorrect value for stec_sat_list[13].sv_id.satId, expected 224, is %d", check_msg->stec_sat_list[13].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[0] == -10053, "incorrect value for stec_sat_list[14].stec_coeff[0], expected -10053, is %d", check_msg->stec_sat_list[14].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[1] == -24897, "incorrect value for stec_sat_list[14].stec_coeff[1], expected -24897, is %d", check_msg->stec_sat_list[14].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[2] == 23629, "incorrect value for stec_sat_list[14].stec_coeff[2], expected 23629, is %d", check_msg->stec_sat_list[14].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[3] == -710, "incorrect value for stec_sat_list[14].stec_coeff[3], expected -710, is %d", check_msg->stec_sat_list[14].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[14].stec_quality_indicator == 51, "incorrect value for stec_sat_list[14].stec_quality_indicator, expected 51, is %d", check_msg->stec_sat_list[14].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[14].sv_id.constellation == 118, "incorrect value for stec_sat_list[14].sv_id.constellation, expected 118, is %d", check_msg->stec_sat_list[14].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[14].sv_id.satId == 106, "incorrect value for stec_sat_list[14].sv_id.satId, expected 106, is %d", check_msg->stec_sat_list[14].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[0] == -26103, "incorrect value for stec_sat_list[15].stec_coeff[0], expected -26103, is %d", check_msg->stec_sat_list[15].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[1] == -9539, "incorrect value for stec_sat_list[15].stec_coeff[1], expected -9539, is %d", check_msg->stec_sat_list[15].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[2] == -11971, "incorrect value for stec_sat_list[15].stec_coeff[2], expected -11971, is %d", check_msg->stec_sat_list[15].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[3] == 20993, "incorrect value for stec_sat_list[15].stec_coeff[3], expected 20993, is %d", check_msg->stec_sat_list[15].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[15].stec_quality_indicator == 165, "incorrect value for stec_sat_list[15].stec_quality_indicator, expected 165, is %d", check_msg->stec_sat_list[15].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[15].sv_id.constellation == 150, "incorrect value for stec_sat_list[15].sv_id.constellation, expected 150, is %d", check_msg->stec_sat_list[15].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[15].sv_id.satId == 132, "incorrect value for stec_sat_list[15].sv_id.satId, expected 132, is %d", check_msg->stec_sat_list[15].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[0] == -18891, "incorrect value for stec_sat_list[16].stec_coeff[0], expected -18891, is %d", check_msg->stec_sat_list[16].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[1] == -16272, "incorrect value for stec_sat_list[16].stec_coeff[1], expected -16272, is %d", check_msg->stec_sat_list[16].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[2] == -22578, "incorrect value for stec_sat_list[16].stec_coeff[2], expected -22578, is %d", check_msg->stec_sat_list[16].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[3] == -2915, "incorrect value for stec_sat_list[16].stec_coeff[3], expected -2915, is %d", check_msg->stec_sat_list[16].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[16].stec_quality_indicator == 23, "incorrect value for stec_sat_list[16].stec_quality_indicator, expected 23, is %d", check_msg->stec_sat_list[16].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[16].sv_id.constellation == 196, "incorrect value for stec_sat_list[16].sv_id.constellation, expected 196, is %d", check_msg->stec_sat_list[16].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[16].sv_id.satId == 181, "incorrect value for stec_sat_list[16].sv_id.satId, expected 181, is %d", check_msg->stec_sat_list[16].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[0] == 15833, "incorrect value for stec_sat_list[17].stec_coeff[0], expected 15833, is %d", check_msg->stec_sat_list[17].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[1] == 24920, "incorrect value for stec_sat_list[17].stec_coeff[1], expected 24920, is %d", check_msg->stec_sat_list[17].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[2] == -13879, "incorrect value for stec_sat_list[17].stec_coeff[2], expected -13879, is %d", check_msg->stec_sat_list[17].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[3] == -1206, "incorrect value for stec_sat_list[17].stec_coeff[3], expected -1206, is %d", check_msg->stec_sat_list[17].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[17].stec_quality_indicator == 189, "incorrect value for stec_sat_list[17].stec_quality_indicator, expected 189, is %d", check_msg->stec_sat_list[17].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[17].sv_id.constellation == 1, "incorrect value for stec_sat_list[17].sv_id.constellation, expected 1, is %d", check_msg->stec_sat_list[17].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[17].sv_id.satId == 35, "incorrect value for stec_sat_list[17].sv_id.satId, expected 35, is %d", check_msg->stec_sat_list[17].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[0] == 14008, "incorrect value for stec_sat_list[18].stec_coeff[0], expected 14008, is %d", check_msg->stec_sat_list[18].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[1] == 18996, "incorrect value for stec_sat_list[18].stec_coeff[1], expected 18996, is %d", check_msg->stec_sat_list[18].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[2] == 2798, "incorrect value for stec_sat_list[18].stec_coeff[2], expected 2798, is %d", check_msg->stec_sat_list[18].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[3] == 5761, "incorrect value for stec_sat_list[18].stec_coeff[3], expected 5761, is %d", check_msg->stec_sat_list[18].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[18].stec_quality_indicator == 104, "incorrect value for stec_sat_list[18].stec_quality_indicator, expected 104, is %d", check_msg->stec_sat_list[18].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[18].sv_id.constellation == 14, "incorrect value for stec_sat_list[18].sv_id.constellation, expected 14, is %d", check_msg->stec_sat_list[18].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[18].sv_id.satId == 217, "incorrect value for stec_sat_list[18].sv_id.satId, expected 217, is %d", check_msg->stec_sat_list[18].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[0] == -25256, "incorrect value for stec_sat_list[19].stec_coeff[0], expected -25256, is %d", check_msg->stec_sat_list[19].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[1] == -15330, "incorrect value for stec_sat_list[19].stec_coeff[1], expected -15330, is %d", check_msg->stec_sat_list[19].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[2] == 6831, "incorrect value for stec_sat_list[19].stec_coeff[2], expected 6831, is %d", check_msg->stec_sat_list[19].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[3] == 8780, "incorrect value for stec_sat_list[19].stec_coeff[3], expected 8780, is %d", check_msg->stec_sat_list[19].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[19].stec_quality_indicator == 109, "incorrect value for stec_sat_list[19].stec_quality_indicator, expected 109, is %d", check_msg->stec_sat_list[19].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[19].sv_id.constellation == 226, "incorrect value for stec_sat_list[19].sv_id.constellation, expected 226, is %d", check_msg->stec_sat_list[19].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[19].sv_id.satId == 178, "incorrect value for stec_sat_list[19].sv_id.satId, expected 178, is %d", check_msg->stec_sat_list[19].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[0] == 3304, "incorrect value for stec_sat_list[20].stec_coeff[0], expected 3304, is %d", check_msg->stec_sat_list[20].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[1] == -2893, "incorrect value for stec_sat_list[20].stec_coeff[1], expected -2893, is %d", check_msg->stec_sat_list[20].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[2] == -25841, "incorrect value for stec_sat_list[20].stec_coeff[2], expected -25841, is %d", check_msg->stec_sat_list[20].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[3] == -13628, "incorrect value for stec_sat_list[20].stec_coeff[3], expected -13628, is %d", check_msg->stec_sat_list[20].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[20].stec_quality_indicator == 154, "incorrect value for stec_sat_list[20].stec_quality_indicator, expected 154, is %d", check_msg->stec_sat_list[20].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[20].sv_id.constellation == 220, "incorrect value for stec_sat_list[20].sv_id.constellation, expected 220, is %d", check_msg->stec_sat_list[20].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[20].sv_id.satId == 116, "incorrect value for stec_sat_list[20].sv_id.satId, expected 116, is %d", check_msg->stec_sat_list[20].sv_id.satId); - ck_assert_msg(check_msg->stec_sat_list[21].stec_coeff[0] == -10742, "incorrect value for stec_sat_list[21].stec_coeff[0], expected -10742, is %d", check_msg->stec_sat_list[21].stec_coeff[0]); - ck_assert_msg(check_msg->stec_sat_list[21].stec_coeff[1] == 10098, "incorrect value for stec_sat_list[21].stec_coeff[1], expected 10098, is %d", check_msg->stec_sat_list[21].stec_coeff[1]); - ck_assert_msg(check_msg->stec_sat_list[21].stec_coeff[2] == 7413, "incorrect value for stec_sat_list[21].stec_coeff[2], expected 7413, is %d", check_msg->stec_sat_list[21].stec_coeff[2]); - ck_assert_msg(check_msg->stec_sat_list[21].stec_coeff[3] == 17645, "incorrect value for stec_sat_list[21].stec_coeff[3], expected 17645, is %d", check_msg->stec_sat_list[21].stec_coeff[3]); - ck_assert_msg(check_msg->stec_sat_list[21].stec_quality_indicator == 115, "incorrect value for stec_sat_list[21].stec_quality_indicator, expected 115, is %d", check_msg->stec_sat_list[21].stec_quality_indicator); - ck_assert_msg(check_msg->stec_sat_list[21].sv_id.constellation == 70, "incorrect value for stec_sat_list[21].sv_id.constellation, expected 70, is %d", check_msg->stec_sat_list[21].sv_id.constellation); - ck_assert_msg(check_msg->stec_sat_list[21].sv_id.satId == 72, "incorrect value for stec_sat_list[21].sv_id.satId, expected 72, is %d", check_msg->stec_sat_list[21].sv_id.satId); + ck_assert_msg(check_msg->header.iod_atmo == 4, + "incorrect value for header.iod_atmo, expected 4, is %d", + check_msg->header.iod_atmo); + ck_assert_msg(check_msg->header.num_msgs == 147, + "incorrect value for header.num_msgs, expected 147, is %d", + check_msg->header.num_msgs); + ck_assert_msg(check_msg->header.seq_num == 123, + "incorrect value for header.seq_num, expected 123, is %d", + check_msg->header.seq_num); + ck_assert_msg( + check_msg->header.time.tow == 3905179974, + "incorrect value for header.time.tow, expected 3905179974, is %d", + check_msg->header.time.tow); + ck_assert_msg(check_msg->header.time.wn == 11193, + "incorrect value for header.time.wn, expected 11193, is %d", + check_msg->header.time.wn); + ck_assert_msg( + check_msg->header.update_interval == 39, + "incorrect value for header.update_interval, expected 39, is %d", + check_msg->header.update_interval); + ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[0] == -1951, + "incorrect value for stec_sat_list[0].stec_coeff[0], " + "expected -1951, is %d", + check_msg->stec_sat_list[0].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[1] == -9854, + "incorrect value for stec_sat_list[0].stec_coeff[1], " + "expected -9854, is %d", + check_msg->stec_sat_list[0].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[2] == 27353, + "incorrect value for stec_sat_list[0].stec_coeff[2], " + "expected 27353, is %d", + check_msg->stec_sat_list[0].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[0].stec_coeff[3] == 3130, + "incorrect value for stec_sat_list[0].stec_coeff[3], " + "expected 3130, is %d", + check_msg->stec_sat_list[0].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[0].stec_quality_indicator == 111, + "incorrect value for stec_sat_list[0].stec_quality_indicator, expected " + "111, is %d", + check_msg->stec_sat_list[0].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[0].sv_id.constellation == 19, + "incorrect value for stec_sat_list[0].sv_id.constellation, " + "expected 19, is %d", + check_msg->stec_sat_list[0].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[0].sv_id.satId == 126, + "incorrect value for stec_sat_list[0].sv_id.satId, expected 126, is %d", + check_msg->stec_sat_list[0].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[0] == 24401, + "incorrect value for stec_sat_list[1].stec_coeff[0], " + "expected 24401, is %d", + check_msg->stec_sat_list[1].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[1] == 4182, + "incorrect value for stec_sat_list[1].stec_coeff[1], " + "expected 4182, is %d", + check_msg->stec_sat_list[1].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[2] == 21543, + "incorrect value for stec_sat_list[1].stec_coeff[2], " + "expected 21543, is %d", + check_msg->stec_sat_list[1].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[1].stec_coeff[3] == -12060, + "incorrect value for stec_sat_list[1].stec_coeff[3], " + "expected -12060, is %d", + check_msg->stec_sat_list[1].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[1].stec_quality_indicator == 171, + "incorrect value for stec_sat_list[1].stec_quality_indicator, expected " + "171, is %d", + check_msg->stec_sat_list[1].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[1].sv_id.constellation == 230, + "incorrect value for stec_sat_list[1].sv_id.constellation, " + "expected 230, is %d", + check_msg->stec_sat_list[1].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[1].sv_id.satId == 65, + "incorrect value for stec_sat_list[1].sv_id.satId, expected 65, is %d", + check_msg->stec_sat_list[1].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[0] == -13469, + "incorrect value for stec_sat_list[2].stec_coeff[0], " + "expected -13469, is %d", + check_msg->stec_sat_list[2].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[1] == -18883, + "incorrect value for stec_sat_list[2].stec_coeff[1], " + "expected -18883, is %d", + check_msg->stec_sat_list[2].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[2] == 32066, + "incorrect value for stec_sat_list[2].stec_coeff[2], " + "expected 32066, is %d", + check_msg->stec_sat_list[2].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[2].stec_coeff[3] == 971, + "incorrect value for stec_sat_list[2].stec_coeff[3], " + "expected 971, is %d", + check_msg->stec_sat_list[2].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[2].stec_quality_indicator == 219, + "incorrect value for stec_sat_list[2].stec_quality_indicator, expected " + "219, is %d", + check_msg->stec_sat_list[2].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[2].sv_id.constellation == 81, + "incorrect value for stec_sat_list[2].sv_id.constellation, " + "expected 81, is %d", + check_msg->stec_sat_list[2].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[2].sv_id.satId == 201, + "incorrect value for stec_sat_list[2].sv_id.satId, expected 201, is %d", + check_msg->stec_sat_list[2].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[0] == 32220, + "incorrect value for stec_sat_list[3].stec_coeff[0], " + "expected 32220, is %d", + check_msg->stec_sat_list[3].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[1] == 5436, + "incorrect value for stec_sat_list[3].stec_coeff[1], " + "expected 5436, is %d", + check_msg->stec_sat_list[3].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[2] == -9635, + "incorrect value for stec_sat_list[3].stec_coeff[2], " + "expected -9635, is %d", + check_msg->stec_sat_list[3].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[3].stec_coeff[3] == -24841, + "incorrect value for stec_sat_list[3].stec_coeff[3], " + "expected -24841, is %d", + check_msg->stec_sat_list[3].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[3].stec_quality_indicator == 100, + "incorrect value for stec_sat_list[3].stec_quality_indicator, expected " + "100, is %d", + check_msg->stec_sat_list[3].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[3].sv_id.constellation == 44, + "incorrect value for stec_sat_list[3].sv_id.constellation, " + "expected 44, is %d", + check_msg->stec_sat_list[3].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[3].sv_id.satId == 193, + "incorrect value for stec_sat_list[3].sv_id.satId, expected 193, is %d", + check_msg->stec_sat_list[3].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[0] == 3718, + "incorrect value for stec_sat_list[4].stec_coeff[0], " + "expected 3718, is %d", + check_msg->stec_sat_list[4].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[1] == 12497, + "incorrect value for stec_sat_list[4].stec_coeff[1], " + "expected 12497, is %d", + check_msg->stec_sat_list[4].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[2] == -10482, + "incorrect value for stec_sat_list[4].stec_coeff[2], " + "expected -10482, is %d", + check_msg->stec_sat_list[4].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[4].stec_coeff[3] == -27495, + "incorrect value for stec_sat_list[4].stec_coeff[3], " + "expected -27495, is %d", + check_msg->stec_sat_list[4].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[4].stec_quality_indicator == 129, + "incorrect value for stec_sat_list[4].stec_quality_indicator, expected " + "129, is %d", + check_msg->stec_sat_list[4].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[4].sv_id.constellation == 93, + "incorrect value for stec_sat_list[4].sv_id.constellation, " + "expected 93, is %d", + check_msg->stec_sat_list[4].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[4].sv_id.satId == 207, + "incorrect value for stec_sat_list[4].sv_id.satId, expected 207, is %d", + check_msg->stec_sat_list[4].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[0] == -4940, + "incorrect value for stec_sat_list[5].stec_coeff[0], " + "expected -4940, is %d", + check_msg->stec_sat_list[5].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[1] == -13875, + "incorrect value for stec_sat_list[5].stec_coeff[1], " + "expected -13875, is %d", + check_msg->stec_sat_list[5].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[2] == 801, + "incorrect value for stec_sat_list[5].stec_coeff[2], " + "expected 801, is %d", + check_msg->stec_sat_list[5].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[5].stec_coeff[3] == -13066, + "incorrect value for stec_sat_list[5].stec_coeff[3], " + "expected -13066, is %d", + check_msg->stec_sat_list[5].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[5].stec_quality_indicator == 225, + "incorrect value for stec_sat_list[5].stec_quality_indicator, expected " + "225, is %d", + check_msg->stec_sat_list[5].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[5].sv_id.constellation == 72, + "incorrect value for stec_sat_list[5].sv_id.constellation, " + "expected 72, is %d", + check_msg->stec_sat_list[5].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[5].sv_id.satId == 147, + "incorrect value for stec_sat_list[5].sv_id.satId, expected 147, is %d", + check_msg->stec_sat_list[5].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[0] == -15868, + "incorrect value for stec_sat_list[6].stec_coeff[0], " + "expected -15868, is %d", + check_msg->stec_sat_list[6].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[1] == -2369, + "incorrect value for stec_sat_list[6].stec_coeff[1], " + "expected -2369, is %d", + check_msg->stec_sat_list[6].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[2] == -9396, + "incorrect value for stec_sat_list[6].stec_coeff[2], " + "expected -9396, is %d", + check_msg->stec_sat_list[6].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[6].stec_coeff[3] == -16609, + "incorrect value for stec_sat_list[6].stec_coeff[3], " + "expected -16609, is %d", + check_msg->stec_sat_list[6].stec_coeff[3]); + ck_assert_msg(check_msg->stec_sat_list[6].stec_quality_indicator == 98, + "incorrect value for " + "stec_sat_list[6].stec_quality_indicator, expected 98, is %d", + check_msg->stec_sat_list[6].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[6].sv_id.constellation == 3, + "incorrect value for stec_sat_list[6].sv_id.constellation, " + "expected 3, is %d", + check_msg->stec_sat_list[6].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[6].sv_id.satId == 19, + "incorrect value for stec_sat_list[6].sv_id.satId, expected 19, is %d", + check_msg->stec_sat_list[6].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[0] == -1265, + "incorrect value for stec_sat_list[7].stec_coeff[0], " + "expected -1265, is %d", + check_msg->stec_sat_list[7].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[1] == 4897, + "incorrect value for stec_sat_list[7].stec_coeff[1], " + "expected 4897, is %d", + check_msg->stec_sat_list[7].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[2] == 13920, + "incorrect value for stec_sat_list[7].stec_coeff[2], " + "expected 13920, is %d", + check_msg->stec_sat_list[7].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[7].stec_coeff[3] == -28102, + "incorrect value for stec_sat_list[7].stec_coeff[3], " + "expected -28102, is %d", + check_msg->stec_sat_list[7].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[7].stec_quality_indicator == 177, + "incorrect value for stec_sat_list[7].stec_quality_indicator, expected " + "177, is %d", + check_msg->stec_sat_list[7].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[7].sv_id.constellation == 79, + "incorrect value for stec_sat_list[7].sv_id.constellation, " + "expected 79, is %d", + check_msg->stec_sat_list[7].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[7].sv_id.satId == 113, + "incorrect value for stec_sat_list[7].sv_id.satId, expected 113, is %d", + check_msg->stec_sat_list[7].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[0] == 5448, + "incorrect value for stec_sat_list[8].stec_coeff[0], " + "expected 5448, is %d", + check_msg->stec_sat_list[8].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[1] == -11359, + "incorrect value for stec_sat_list[8].stec_coeff[1], " + "expected -11359, is %d", + check_msg->stec_sat_list[8].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[2] == 5574, + "incorrect value for stec_sat_list[8].stec_coeff[2], " + "expected 5574, is %d", + check_msg->stec_sat_list[8].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[8].stec_coeff[3] == 28654, + "incorrect value for stec_sat_list[8].stec_coeff[3], " + "expected 28654, is %d", + check_msg->stec_sat_list[8].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[8].stec_quality_indicator == 249, + "incorrect value for stec_sat_list[8].stec_quality_indicator, expected " + "249, is %d", + check_msg->stec_sat_list[8].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[8].sv_id.constellation == 100, + "incorrect value for stec_sat_list[8].sv_id.constellation, " + "expected 100, is %d", + check_msg->stec_sat_list[8].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[8].sv_id.satId == 210, + "incorrect value for stec_sat_list[8].sv_id.satId, expected 210, is %d", + check_msg->stec_sat_list[8].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[0] == -10783, + "incorrect value for stec_sat_list[9].stec_coeff[0], " + "expected -10783, is %d", + check_msg->stec_sat_list[9].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[1] == 18179, + "incorrect value for stec_sat_list[9].stec_coeff[1], " + "expected 18179, is %d", + check_msg->stec_sat_list[9].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[2] == 16371, + "incorrect value for stec_sat_list[9].stec_coeff[2], " + "expected 16371, is %d", + check_msg->stec_sat_list[9].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[9].stec_coeff[3] == -5055, + "incorrect value for stec_sat_list[9].stec_coeff[3], " + "expected -5055, is %d", + check_msg->stec_sat_list[9].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[9].stec_quality_indicator == 227, + "incorrect value for stec_sat_list[9].stec_quality_indicator, expected " + "227, is %d", + check_msg->stec_sat_list[9].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[9].sv_id.constellation == 36, + "incorrect value for stec_sat_list[9].sv_id.constellation, " + "expected 36, is %d", + check_msg->stec_sat_list[9].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[9].sv_id.satId == 107, + "incorrect value for stec_sat_list[9].sv_id.satId, expected 107, is %d", + check_msg->stec_sat_list[9].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[0] == 4009, + "incorrect value for stec_sat_list[10].stec_coeff[0], " + "expected 4009, is %d", + check_msg->stec_sat_list[10].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[1] == 1462, + "incorrect value for stec_sat_list[10].stec_coeff[1], " + "expected 1462, is %d", + check_msg->stec_sat_list[10].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[2] == -19216, + "incorrect value for stec_sat_list[10].stec_coeff[2], " + "expected -19216, is %d", + check_msg->stec_sat_list[10].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[10].stec_coeff[3] == 31241, + "incorrect value for stec_sat_list[10].stec_coeff[3], " + "expected 31241, is %d", + check_msg->stec_sat_list[10].stec_coeff[3]); + ck_assert_msg(check_msg->stec_sat_list[10].stec_quality_indicator == 0, + "incorrect value for " + "stec_sat_list[10].stec_quality_indicator, expected 0, is %d", + check_msg->stec_sat_list[10].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[10].sv_id.constellation == 77, + "incorrect value for stec_sat_list[10].sv_id.constellation, " + "expected 77, is %d", + check_msg->stec_sat_list[10].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[10].sv_id.satId == 92, + "incorrect value for stec_sat_list[10].sv_id.satId, expected 92, is %d", + check_msg->stec_sat_list[10].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[0] == 26727, + "incorrect value for stec_sat_list[11].stec_coeff[0], " + "expected 26727, is %d", + check_msg->stec_sat_list[11].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[1] == -16898, + "incorrect value for stec_sat_list[11].stec_coeff[1], " + "expected -16898, is %d", + check_msg->stec_sat_list[11].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[2] == 28241, + "incorrect value for stec_sat_list[11].stec_coeff[2], " + "expected 28241, is %d", + check_msg->stec_sat_list[11].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[11].stec_coeff[3] == 12546, + "incorrect value for stec_sat_list[11].stec_coeff[3], " + "expected 12546, is %d", + check_msg->stec_sat_list[11].stec_coeff[3]); + ck_assert_msg(check_msg->stec_sat_list[11].stec_quality_indicator == 6, + "incorrect value for " + "stec_sat_list[11].stec_quality_indicator, expected 6, is %d", + check_msg->stec_sat_list[11].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[11].sv_id.constellation == 232, + "incorrect value for stec_sat_list[11].sv_id.constellation, " + "expected 232, is %d", + check_msg->stec_sat_list[11].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[11].sv_id.satId == 86, + "incorrect value for stec_sat_list[11].sv_id.satId, expected 86, is %d", + check_msg->stec_sat_list[11].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[0] == 12855, + "incorrect value for stec_sat_list[12].stec_coeff[0], " + "expected 12855, is %d", + check_msg->stec_sat_list[12].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[1] == 1461, + "incorrect value for stec_sat_list[12].stec_coeff[1], " + "expected 1461, is %d", + check_msg->stec_sat_list[12].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[2] == 20603, + "incorrect value for stec_sat_list[12].stec_coeff[2], " + "expected 20603, is %d", + check_msg->stec_sat_list[12].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[12].stec_coeff[3] == -3023, + "incorrect value for stec_sat_list[12].stec_coeff[3], " + "expected -3023, is %d", + check_msg->stec_sat_list[12].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[12].stec_quality_indicator == 216, + "incorrect value for stec_sat_list[12].stec_quality_indicator, " + "expected 216, is %d", + check_msg->stec_sat_list[12].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[12].sv_id.constellation == 84, + "incorrect value for stec_sat_list[12].sv_id.constellation, " + "expected 84, is %d", + check_msg->stec_sat_list[12].sv_id.constellation); + ck_assert_msg(check_msg->stec_sat_list[12].sv_id.satId == 202, + "incorrect value for stec_sat_list[12].sv_id.satId, expected " + "202, is %d", + check_msg->stec_sat_list[12].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[0] == -6492, + "incorrect value for stec_sat_list[13].stec_coeff[0], " + "expected -6492, is %d", + check_msg->stec_sat_list[13].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[1] == 16952, + "incorrect value for stec_sat_list[13].stec_coeff[1], " + "expected 16952, is %d", + check_msg->stec_sat_list[13].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[2] == -22404, + "incorrect value for stec_sat_list[13].stec_coeff[2], " + "expected -22404, is %d", + check_msg->stec_sat_list[13].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[13].stec_coeff[3] == -29893, + "incorrect value for stec_sat_list[13].stec_coeff[3], " + "expected -29893, is %d", + check_msg->stec_sat_list[13].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[13].stec_quality_indicator == 125, + "incorrect value for stec_sat_list[13].stec_quality_indicator, " + "expected 125, is %d", + check_msg->stec_sat_list[13].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[13].sv_id.constellation == 188, + "incorrect value for stec_sat_list[13].sv_id.constellation, " + "expected 188, is %d", + check_msg->stec_sat_list[13].sv_id.constellation); + ck_assert_msg(check_msg->stec_sat_list[13].sv_id.satId == 224, + "incorrect value for stec_sat_list[13].sv_id.satId, expected " + "224, is %d", + check_msg->stec_sat_list[13].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[0] == -10053, + "incorrect value for stec_sat_list[14].stec_coeff[0], " + "expected -10053, is %d", + check_msg->stec_sat_list[14].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[1] == -24897, + "incorrect value for stec_sat_list[14].stec_coeff[1], " + "expected -24897, is %d", + check_msg->stec_sat_list[14].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[2] == 23629, + "incorrect value for stec_sat_list[14].stec_coeff[2], " + "expected 23629, is %d", + check_msg->stec_sat_list[14].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[14].stec_coeff[3] == -710, + "incorrect value for stec_sat_list[14].stec_coeff[3], " + "expected -710, is %d", + check_msg->stec_sat_list[14].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[14].stec_quality_indicator == 51, + "incorrect value for stec_sat_list[14].stec_quality_indicator, " + "expected 51, is %d", + check_msg->stec_sat_list[14].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[14].sv_id.constellation == 118, + "incorrect value for stec_sat_list[14].sv_id.constellation, " + "expected 118, is %d", + check_msg->stec_sat_list[14].sv_id.constellation); + ck_assert_msg(check_msg->stec_sat_list[14].sv_id.satId == 106, + "incorrect value for stec_sat_list[14].sv_id.satId, expected " + "106, is %d", + check_msg->stec_sat_list[14].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[0] == -26103, + "incorrect value for stec_sat_list[15].stec_coeff[0], " + "expected -26103, is %d", + check_msg->stec_sat_list[15].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[1] == -9539, + "incorrect value for stec_sat_list[15].stec_coeff[1], " + "expected -9539, is %d", + check_msg->stec_sat_list[15].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[2] == -11971, + "incorrect value for stec_sat_list[15].stec_coeff[2], " + "expected -11971, is %d", + check_msg->stec_sat_list[15].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[15].stec_coeff[3] == 20993, + "incorrect value for stec_sat_list[15].stec_coeff[3], " + "expected 20993, is %d", + check_msg->stec_sat_list[15].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[15].stec_quality_indicator == 165, + "incorrect value for stec_sat_list[15].stec_quality_indicator, " + "expected 165, is %d", + check_msg->stec_sat_list[15].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[15].sv_id.constellation == 150, + "incorrect value for stec_sat_list[15].sv_id.constellation, " + "expected 150, is %d", + check_msg->stec_sat_list[15].sv_id.constellation); + ck_assert_msg(check_msg->stec_sat_list[15].sv_id.satId == 132, + "incorrect value for stec_sat_list[15].sv_id.satId, expected " + "132, is %d", + check_msg->stec_sat_list[15].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[0] == -18891, + "incorrect value for stec_sat_list[16].stec_coeff[0], " + "expected -18891, is %d", + check_msg->stec_sat_list[16].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[1] == -16272, + "incorrect value for stec_sat_list[16].stec_coeff[1], " + "expected -16272, is %d", + check_msg->stec_sat_list[16].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[2] == -22578, + "incorrect value for stec_sat_list[16].stec_coeff[2], " + "expected -22578, is %d", + check_msg->stec_sat_list[16].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[16].stec_coeff[3] == -2915, + "incorrect value for stec_sat_list[16].stec_coeff[3], " + "expected -2915, is %d", + check_msg->stec_sat_list[16].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[16].stec_quality_indicator == 23, + "incorrect value for stec_sat_list[16].stec_quality_indicator, " + "expected 23, is %d", + check_msg->stec_sat_list[16].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[16].sv_id.constellation == 196, + "incorrect value for stec_sat_list[16].sv_id.constellation, " + "expected 196, is %d", + check_msg->stec_sat_list[16].sv_id.constellation); + ck_assert_msg(check_msg->stec_sat_list[16].sv_id.satId == 181, + "incorrect value for stec_sat_list[16].sv_id.satId, expected " + "181, is %d", + check_msg->stec_sat_list[16].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[0] == 15833, + "incorrect value for stec_sat_list[17].stec_coeff[0], " + "expected 15833, is %d", + check_msg->stec_sat_list[17].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[1] == 24920, + "incorrect value for stec_sat_list[17].stec_coeff[1], " + "expected 24920, is %d", + check_msg->stec_sat_list[17].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[2] == -13879, + "incorrect value for stec_sat_list[17].stec_coeff[2], " + "expected -13879, is %d", + check_msg->stec_sat_list[17].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[17].stec_coeff[3] == -1206, + "incorrect value for stec_sat_list[17].stec_coeff[3], " + "expected -1206, is %d", + check_msg->stec_sat_list[17].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[17].stec_quality_indicator == 189, + "incorrect value for stec_sat_list[17].stec_quality_indicator, " + "expected 189, is %d", + check_msg->stec_sat_list[17].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[17].sv_id.constellation == 1, + "incorrect value for stec_sat_list[17].sv_id.constellation, " + "expected 1, is %d", + check_msg->stec_sat_list[17].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[17].sv_id.satId == 35, + "incorrect value for stec_sat_list[17].sv_id.satId, expected 35, is %d", + check_msg->stec_sat_list[17].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[0] == 14008, + "incorrect value for stec_sat_list[18].stec_coeff[0], " + "expected 14008, is %d", + check_msg->stec_sat_list[18].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[1] == 18996, + "incorrect value for stec_sat_list[18].stec_coeff[1], " + "expected 18996, is %d", + check_msg->stec_sat_list[18].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[2] == 2798, + "incorrect value for stec_sat_list[18].stec_coeff[2], " + "expected 2798, is %d", + check_msg->stec_sat_list[18].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[18].stec_coeff[3] == 5761, + "incorrect value for stec_sat_list[18].stec_coeff[3], " + "expected 5761, is %d", + check_msg->stec_sat_list[18].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[18].stec_quality_indicator == 104, + "incorrect value for stec_sat_list[18].stec_quality_indicator, " + "expected 104, is %d", + check_msg->stec_sat_list[18].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[18].sv_id.constellation == 14, + "incorrect value for stec_sat_list[18].sv_id.constellation, " + "expected 14, is %d", + check_msg->stec_sat_list[18].sv_id.constellation); + ck_assert_msg(check_msg->stec_sat_list[18].sv_id.satId == 217, + "incorrect value for stec_sat_list[18].sv_id.satId, expected " + "217, is %d", + check_msg->stec_sat_list[18].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[0] == -25256, + "incorrect value for stec_sat_list[19].stec_coeff[0], " + "expected -25256, is %d", + check_msg->stec_sat_list[19].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[1] == -15330, + "incorrect value for stec_sat_list[19].stec_coeff[1], " + "expected -15330, is %d", + check_msg->stec_sat_list[19].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[2] == 6831, + "incorrect value for stec_sat_list[19].stec_coeff[2], " + "expected 6831, is %d", + check_msg->stec_sat_list[19].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[19].stec_coeff[3] == 8780, + "incorrect value for stec_sat_list[19].stec_coeff[3], " + "expected 8780, is %d", + check_msg->stec_sat_list[19].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[19].stec_quality_indicator == 109, + "incorrect value for stec_sat_list[19].stec_quality_indicator, " + "expected 109, is %d", + check_msg->stec_sat_list[19].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[19].sv_id.constellation == 226, + "incorrect value for stec_sat_list[19].sv_id.constellation, " + "expected 226, is %d", + check_msg->stec_sat_list[19].sv_id.constellation); + ck_assert_msg(check_msg->stec_sat_list[19].sv_id.satId == 178, + "incorrect value for stec_sat_list[19].sv_id.satId, expected " + "178, is %d", + check_msg->stec_sat_list[19].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[0] == 3304, + "incorrect value for stec_sat_list[20].stec_coeff[0], " + "expected 3304, is %d", + check_msg->stec_sat_list[20].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[1] == -2893, + "incorrect value for stec_sat_list[20].stec_coeff[1], " + "expected -2893, is %d", + check_msg->stec_sat_list[20].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[2] == -25841, + "incorrect value for stec_sat_list[20].stec_coeff[2], " + "expected -25841, is %d", + check_msg->stec_sat_list[20].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[20].stec_coeff[3] == -13628, + "incorrect value for stec_sat_list[20].stec_coeff[3], " + "expected -13628, is %d", + check_msg->stec_sat_list[20].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[20].stec_quality_indicator == 154, + "incorrect value for stec_sat_list[20].stec_quality_indicator, " + "expected 154, is %d", + check_msg->stec_sat_list[20].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[20].sv_id.constellation == 220, + "incorrect value for stec_sat_list[20].sv_id.constellation, " + "expected 220, is %d", + check_msg->stec_sat_list[20].sv_id.constellation); + ck_assert_msg(check_msg->stec_sat_list[20].sv_id.satId == 116, + "incorrect value for stec_sat_list[20].sv_id.satId, expected " + "116, is %d", + check_msg->stec_sat_list[20].sv_id.satId); + ck_assert_msg(check_msg->stec_sat_list[21].stec_coeff[0] == -10742, + "incorrect value for stec_sat_list[21].stec_coeff[0], " + "expected -10742, is %d", + check_msg->stec_sat_list[21].stec_coeff[0]); + ck_assert_msg(check_msg->stec_sat_list[21].stec_coeff[1] == 10098, + "incorrect value for stec_sat_list[21].stec_coeff[1], " + "expected 10098, is %d", + check_msg->stec_sat_list[21].stec_coeff[1]); + ck_assert_msg(check_msg->stec_sat_list[21].stec_coeff[2] == 7413, + "incorrect value for stec_sat_list[21].stec_coeff[2], " + "expected 7413, is %d", + check_msg->stec_sat_list[21].stec_coeff[2]); + ck_assert_msg(check_msg->stec_sat_list[21].stec_coeff[3] == 17645, + "incorrect value for stec_sat_list[21].stec_coeff[3], " + "expected 17645, is %d", + check_msg->stec_sat_list[21].stec_coeff[3]); + ck_assert_msg( + check_msg->stec_sat_list[21].stec_quality_indicator == 115, + "incorrect value for stec_sat_list[21].stec_quality_indicator, " + "expected 115, is %d", + check_msg->stec_sat_list[21].stec_quality_indicator); + ck_assert_msg(check_msg->stec_sat_list[21].sv_id.constellation == 70, + "incorrect value for stec_sat_list[21].sv_id.constellation, " + "expected 70, is %d", + check_msg->stec_sat_list[21].sv_id.constellation); + ck_assert_msg( + check_msg->stec_sat_list[21].sv_id.satId == 72, + "incorrect value for stec_sat_list[21].sv_id.satId, expected 72, is %d", + check_msg->stec_sat_list[21].sv_id.satId); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA); +Suite *legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrTileDefinition.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrTileDefinition.c index d2b4f4659..fb41b5bad 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrTileDefinition.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrTileDefinition.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinition.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinition.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinition ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinition) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinition ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,24 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinition ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x5F8, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x5F8, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x5F8, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x5F8, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,248,5,0,0,33,127,58,9,0,174,8,1,2,3,4,0,5,0,186,28,59,167,100,0,100,0,6,0,6,0,210,2,150,73,0,0,0,0,204,94, }; + u8 encoded_frame[] = { + 85, 248, 5, 0, 0, 33, 127, 58, 9, 0, 174, 8, 1, 2, + 3, 4, 0, 5, 0, 186, 28, 59, 167, 100, 0, 100, 0, 6, + 0, 6, 0, 210, 2, 150, 73, 0, 0, 0, 0, 204, 94, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_tile_definition_t* test_msg = ( msg_ssr_tile_definition_t* )test_msg_storage; + msg_ssr_tile_definition_t *test_msg = + (msg_ssr_tile_definition_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->bitmask = 1234567890; test_msg->cols = 6; @@ -157,76 +161,113 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinition ) test_msg->time.tow = 604799; test_msg->time.wn = 2222; test_msg->update_interval = 1; - sbp_payload_send(&sbp_state, 0x5F8, 0, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x5F8, 0, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 0, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 0, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x5F8, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_tile_definition_t* check_msg = ( msg_ssr_tile_definition_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_tile_definition_t *check_msg = + (msg_ssr_tile_definition_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->bitmask == 1234567890, "incorrect value for bitmask, expected 1234567890, is %d", check_msg->bitmask); - ck_assert_msg(check_msg->cols == 6, "incorrect value for cols, expected 6, is %d", check_msg->cols); - ck_assert_msg(check_msg->corner_nw_lat == 7354, "incorrect value for corner_nw_lat, expected 7354, is %d", check_msg->corner_nw_lat); - ck_assert_msg(check_msg->corner_nw_lon == -22725, "incorrect value for corner_nw_lon, expected -22725, is %d", check_msg->corner_nw_lon); - ck_assert_msg(check_msg->iod_atmo == 3, "incorrect value for iod_atmo, expected 3, is %d", check_msg->iod_atmo); - ck_assert_msg(check_msg->rows == 6, "incorrect value for rows, expected 6, is %d", check_msg->rows); - ck_assert_msg(check_msg->sol_id == 2, "incorrect value for sol_id, expected 2, is %d", check_msg->sol_id); - ck_assert_msg(check_msg->spacing_lat == 100, "incorrect value for spacing_lat, expected 100, is %d", check_msg->spacing_lat); - ck_assert_msg(check_msg->spacing_lon == 100, "incorrect value for spacing_lon, expected 100, is %d", check_msg->spacing_lon); - ck_assert_msg(check_msg->tile_id == 5, "incorrect value for tile_id, expected 5, is %d", check_msg->tile_id); - ck_assert_msg(check_msg->tile_set_id == 4, "incorrect value for tile_set_id, expected 4, is %d", check_msg->tile_set_id); - ck_assert_msg(check_msg->time.tow == 604799, "incorrect value for time.tow, expected 604799, is %d", check_msg->time.tow); - ck_assert_msg(check_msg->time.wn == 2222, "incorrect value for time.wn, expected 2222, is %d", check_msg->time.wn); - ck_assert_msg(check_msg->update_interval == 1, "incorrect value for update_interval, expected 1, is %d", check_msg->update_interval); + ck_assert_msg(check_msg->bitmask == 1234567890, + "incorrect value for bitmask, expected 1234567890, is %d", + check_msg->bitmask); + ck_assert_msg(check_msg->cols == 6, + "incorrect value for cols, expected 6, is %d", + check_msg->cols); + ck_assert_msg(check_msg->corner_nw_lat == 7354, + "incorrect value for corner_nw_lat, expected 7354, is %d", + check_msg->corner_nw_lat); + ck_assert_msg(check_msg->corner_nw_lon == -22725, + "incorrect value for corner_nw_lon, expected -22725, is %d", + check_msg->corner_nw_lon); + ck_assert_msg(check_msg->iod_atmo == 3, + "incorrect value for iod_atmo, expected 3, is %d", + check_msg->iod_atmo); + ck_assert_msg(check_msg->rows == 6, + "incorrect value for rows, expected 6, is %d", + check_msg->rows); + ck_assert_msg(check_msg->sol_id == 2, + "incorrect value for sol_id, expected 2, is %d", + check_msg->sol_id); + ck_assert_msg(check_msg->spacing_lat == 100, + "incorrect value for spacing_lat, expected 100, is %d", + check_msg->spacing_lat); + ck_assert_msg(check_msg->spacing_lon == 100, + "incorrect value for spacing_lon, expected 100, is %d", + check_msg->spacing_lon); + ck_assert_msg(check_msg->tile_id == 5, + "incorrect value for tile_id, expected 5, is %d", + check_msg->tile_id); + ck_assert_msg(check_msg->tile_set_id == 4, + "incorrect value for tile_set_id, expected 4, is %d", + check_msg->tile_set_id); + ck_assert_msg(check_msg->time.tow == 604799, + "incorrect value for time.tow, expected 604799, is %d", + check_msg->time.tow); + ck_assert_msg(check_msg->time.wn == 2222, + "incorrect value for time.wn, expected 2222, is %d", + check_msg->time.wn); + ck_assert_msg(check_msg->update_interval == 1, + "incorrect value for update_interval, expected 1, is %d", + check_msg->update_interval); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrTileDefinition_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrTileDefinition"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrTileDefinition"); +Suite *legacy_auto_check_sbp_ssr_MsgSsrTileDefinition_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrTileDefinition"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrTileDefinition"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinition); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.c index d273bd544..10ec825c1 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,24 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x5f6, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x5f6, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x5f6, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x5f6, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,246,5,200,133,24,57,190,178,247,8,185,9,181,162,240,65,19,255,143,21,191,239,205,171,0,0,0,0,0,65,154, }; + u8 encoded_frame[] = { + 85, 246, 5, 200, 133, 24, 57, 190, 178, 247, 8, + 185, 9, 181, 162, 240, 65, 19, 255, 143, 21, 191, + 239, 205, 171, 0, 0, 0, 0, 0, 65, 154, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_tile_definition_dep_a_t* test_msg = ( msg_ssr_tile_definition_dep_a_t* )test_msg_storage; + msg_ssr_tile_definition_dep_a_t *test_msg = + (msg_ssr_tile_definition_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->bitmask = 11259375; test_msg->cols = 48917; @@ -152,72 +156,100 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA ) test_msg->spacing_lon = 4929; test_msg->tile_id = 63410; test_msg->tile_set_id = 48697; - sbp_payload_send(&sbp_state, 0x5f6, 34248, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x5f6, 34248, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 34248, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 34248, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x5f6, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_tile_definition_dep_a_t* check_msg = ( msg_ssr_tile_definition_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_tile_definition_dep_a_t *check_msg = + (msg_ssr_tile_definition_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->bitmask == 11259375, "incorrect value for bitmask, expected 11259375, is %d", check_msg->bitmask); - ck_assert_msg(check_msg->cols == 48917, "incorrect value for cols, expected 48917, is %d", check_msg->cols); - ck_assert_msg(check_msg->corner_nw_lat == -18168, "incorrect value for corner_nw_lat, expected -18168, is %d", check_msg->corner_nw_lat); - ck_assert_msg(check_msg->corner_nw_lon == -19191, "incorrect value for corner_nw_lon, expected -19191, is %d", check_msg->corner_nw_lon); - ck_assert_msg(check_msg->rows == 36863, "incorrect value for rows, expected 36863, is %d", check_msg->rows); - ck_assert_msg(check_msg->spacing_lat == 61602, "incorrect value for spacing_lat, expected 61602, is %d", check_msg->spacing_lat); - ck_assert_msg(check_msg->spacing_lon == 4929, "incorrect value for spacing_lon, expected 4929, is %d", check_msg->spacing_lon); - ck_assert_msg(check_msg->tile_id == 63410, "incorrect value for tile_id, expected 63410, is %d", check_msg->tile_id); - ck_assert_msg(check_msg->tile_set_id == 48697, "incorrect value for tile_set_id, expected 48697, is %d", check_msg->tile_set_id); + ck_assert_msg(check_msg->bitmask == 11259375, + "incorrect value for bitmask, expected 11259375, is %d", + check_msg->bitmask); + ck_assert_msg(check_msg->cols == 48917, + "incorrect value for cols, expected 48917, is %d", + check_msg->cols); + ck_assert_msg(check_msg->corner_nw_lat == -18168, + "incorrect value for corner_nw_lat, expected -18168, is %d", + check_msg->corner_nw_lat); + ck_assert_msg(check_msg->corner_nw_lon == -19191, + "incorrect value for corner_nw_lon, expected -19191, is %d", + check_msg->corner_nw_lon); + ck_assert_msg(check_msg->rows == 36863, + "incorrect value for rows, expected 36863, is %d", + check_msg->rows); + ck_assert_msg(check_msg->spacing_lat == 61602, + "incorrect value for spacing_lat, expected 61602, is %d", + check_msg->spacing_lat); + ck_assert_msg(check_msg->spacing_lon == 4929, + "incorrect value for spacing_lon, expected 4929, is %d", + check_msg->spacing_lon); + ck_assert_msg(check_msg->tile_id == 63410, + "incorrect value for tile_id, expected 63410, is %d", + check_msg->tile_id); + ck_assert_msg(check_msg->tile_set_id == 48697, + "incorrect value for tile_set_id, expected 48697, is %d", + check_msg->tile_set_id); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA); +Suite *legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.c b/c/test/legacy/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.c index eecc24cdd..bfcaeb694 100644 --- a/c/test/legacy/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.c +++ b/c/test/legacy/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB ) -{ +START_TEST(test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 1527, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 1527, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 1527, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 1527, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,247,5,66,0,25,31,0,1,0,2,0,4,0,8,0,16,0,32,0,64,0,128,210,2,150,73,0,0,0,0,214,71, }; + u8 encoded_frame[] = { + 85, 247, 5, 66, 0, 25, 31, 0, 1, 0, 2, 0, 4, 0, 8, 0, 16, + 0, 32, 0, 64, 0, 128, 210, 2, 150, 73, 0, 0, 0, 0, 214, 71, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ssr_tile_definition_dep_b_t* test_msg = ( msg_ssr_tile_definition_dep_b_t* )test_msg_storage; + msg_ssr_tile_definition_dep_b_t *test_msg = + (msg_ssr_tile_definition_dep_b_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->bitmask = 1234567890; test_msg->cols = 32768; @@ -153,73 +156,103 @@ START_TEST( test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB ) test_msg->ssr_sol_id = 31; test_msg->tile_id = 512; test_msg->tile_set_id = 256; - sbp_payload_send(&sbp_state, 1527, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 1527, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 1527, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ssr_tile_definition_dep_b_t* check_msg = ( msg_ssr_tile_definition_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ssr_tile_definition_dep_b_t *check_msg = + (msg_ssr_tile_definition_dep_b_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->bitmask == 1234567890, "incorrect value for bitmask, expected 1234567890, is %d", check_msg->bitmask); - ck_assert_msg(check_msg->cols == 32768, "incorrect value for cols, expected 32768, is %d", check_msg->cols); - ck_assert_msg(check_msg->corner_nw_lat == 1024, "incorrect value for corner_nw_lat, expected 1024, is %d", check_msg->corner_nw_lat); - ck_assert_msg(check_msg->corner_nw_lon == 2048, "incorrect value for corner_nw_lon, expected 2048, is %d", check_msg->corner_nw_lon); - ck_assert_msg(check_msg->rows == 16384, "incorrect value for rows, expected 16384, is %d", check_msg->rows); - ck_assert_msg(check_msg->spacing_lat == 4096, "incorrect value for spacing_lat, expected 4096, is %d", check_msg->spacing_lat); - ck_assert_msg(check_msg->spacing_lon == 8192, "incorrect value for spacing_lon, expected 8192, is %d", check_msg->spacing_lon); - ck_assert_msg(check_msg->ssr_sol_id == 31, "incorrect value for ssr_sol_id, expected 31, is %d", check_msg->ssr_sol_id); - ck_assert_msg(check_msg->tile_id == 512, "incorrect value for tile_id, expected 512, is %d", check_msg->tile_id); - ck_assert_msg(check_msg->tile_set_id == 256, "incorrect value for tile_set_id, expected 256, is %d", check_msg->tile_set_id); + ck_assert_msg(check_msg->bitmask == 1234567890, + "incorrect value for bitmask, expected 1234567890, is %d", + check_msg->bitmask); + ck_assert_msg(check_msg->cols == 32768, + "incorrect value for cols, expected 32768, is %d", + check_msg->cols); + ck_assert_msg(check_msg->corner_nw_lat == 1024, + "incorrect value for corner_nw_lat, expected 1024, is %d", + check_msg->corner_nw_lat); + ck_assert_msg(check_msg->corner_nw_lon == 2048, + "incorrect value for corner_nw_lon, expected 2048, is %d", + check_msg->corner_nw_lon); + ck_assert_msg(check_msg->rows == 16384, + "incorrect value for rows, expected 16384, is %d", + check_msg->rows); + ck_assert_msg(check_msg->spacing_lat == 4096, + "incorrect value for spacing_lat, expected 4096, is %d", + check_msg->spacing_lat); + ck_assert_msg(check_msg->spacing_lon == 8192, + "incorrect value for spacing_lon, expected 8192, is %d", + check_msg->spacing_lon); + ck_assert_msg(check_msg->ssr_sol_id == 31, + "incorrect value for ssr_sol_id, expected 31, is %d", + check_msg->ssr_sol_id); + ck_assert_msg(check_msg->tile_id == 512, + "incorrect value for tile_id, expected 512, is %d", + check_msg->tile_id); + ck_assert_msg(check_msg->tile_set_id == 256, + "incorrect value for tile_set_id, expected 256, is %d", + check_msg->tile_set_id); } } END_TEST -Suite* legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB); +Suite *legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_system_MsgCsacTelemetry.c b/c/test/legacy/auto_check_sbp_system_MsgCsacTelemetry.c index 42817eefb..5a0862248 100644 --- a/c/test/legacy/auto_check_sbp_system_MsgCsacTelemetry.c +++ b/c/test/legacy/auto_check_sbp_system_MsgCsacTelemetry.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetry.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetry.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_system_MsgCsacTelemetry ) -{ +START_TEST(test_legacy_auto_check_sbp_system_MsgCsacTelemetry) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgCsacTelemetry ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,87 +128,110 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgCsacTelemetry ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xff04, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xff04, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xff04, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xff04, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,255,244,169,10,105,115,111,109,101,32,100,97,116,97,229,94, }; + u8 encoded_frame[] = { + 85, 4, 255, 244, 169, 10, 105, 115, 111, + 109, 101, 32, 100, 97, 116, 97, 229, 94, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_csac_telemetry_t* test_msg = ( msg_csac_telemetry_t* )test_msg_storage; + msg_csac_telemetry_t *test_msg = (msg_csac_telemetry_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->id = 105; { - const char assign_string[] = { (char)115,(char)111,(char)109,(char)101,(char)32,(char)100,(char)97,(char)116,(char)97 }; + const char assign_string[] = {(char)115, (char)111, (char)109, + (char)101, (char)32, (char)100, + (char)97, (char)116, (char)97}; memcpy(test_msg->telemetry, assign_string, sizeof(assign_string)); if (sizeof(test_msg->telemetry) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0xff04, 43508, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xff04, 43508, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 43508, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 43508, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xff04, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_csac_telemetry_t* check_msg = ( msg_csac_telemetry_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_csac_telemetry_t *check_msg = + (msg_csac_telemetry_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->id == 105, "incorrect value for id, expected 105, is %d", check_msg->id); + ck_assert_msg(check_msg->id == 105, + "incorrect value for id, expected 105, is %d", check_msg->id); { - const char check_string[] = { (char)115,(char)111,(char)109,(char)101,(char)32,(char)100,(char)97,(char)116,(char)97 }; - ck_assert_msg(memcmp(check_msg->telemetry, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->telemetry, expected string '%s', is '%s'", check_string, check_msg->telemetry); + const char check_string[] = {(char)115, (char)111, (char)109, + (char)101, (char)32, (char)100, + (char)97, (char)116, (char)97}; + ck_assert_msg( + memcmp(check_msg->telemetry, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->telemetry, expected string '%s', is " + "'%s'", + check_string, check_msg->telemetry); } } } END_TEST -Suite* legacy_auto_check_sbp_system_MsgCsacTelemetry_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_system_MsgCsacTelemetry"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgCsacTelemetry"); +Suite *legacy_auto_check_sbp_system_MsgCsacTelemetry_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_system_MsgCsacTelemetry"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_system_MsgCsacTelemetry"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_system_MsgCsacTelemetry); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_system_MsgCsacTelemetryLabels.c b/c/test/legacy/auto_check_sbp_system_MsgCsacTelemetryLabels.c index 70e029647..54dad63dd 100644 --- a/c/test/legacy/auto_check_sbp_system_MsgCsacTelemetryLabels.c +++ b/c/test/legacy/auto_check_sbp_system_MsgCsacTelemetryLabels.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetryLabels.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetryLabels.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_system_MsgCsacTelemetryLabels ) -{ +START_TEST(test_legacy_auto_check_sbp_system_MsgCsacTelemetryLabels) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgCsacTelemetryLabels ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,88 +128,113 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgCsacTelemetryLabels ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xff05, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xff05, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xff05, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xff05, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,5,255,91,200,12,186,115,111,109,101,32,108,97,98,101,108,115,86,236, }; + u8 encoded_frame[] = { + 85, 5, 255, 91, 200, 12, 186, 115, 111, 109, + 101, 32, 108, 97, 98, 101, 108, 115, 86, 236, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_csac_telemetry_labels_t* test_msg = ( msg_csac_telemetry_labels_t* )test_msg_storage; + msg_csac_telemetry_labels_t *test_msg = + (msg_csac_telemetry_labels_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->id = 186; { - const char assign_string[] = { (char)115,(char)111,(char)109,(char)101,(char)32,(char)108,(char)97,(char)98,(char)101,(char)108,(char)115 }; + const char assign_string[] = {(char)115, (char)111, (char)109, (char)101, + (char)32, (char)108, (char)97, (char)98, + (char)101, (char)108, (char)115}; memcpy(test_msg->telemetry_labels, assign_string, sizeof(assign_string)); if (sizeof(test_msg->telemetry_labels) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0xff05, 51291, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xff05, 51291, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 51291, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 51291, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xff05, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_csac_telemetry_labels_t* check_msg = ( msg_csac_telemetry_labels_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_csac_telemetry_labels_t *check_msg = + (msg_csac_telemetry_labels_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->id == 186, "incorrect value for id, expected 186, is %d", check_msg->id); + ck_assert_msg(check_msg->id == 186, + "incorrect value for id, expected 186, is %d", check_msg->id); { - const char check_string[] = { (char)115,(char)111,(char)109,(char)101,(char)32,(char)108,(char)97,(char)98,(char)101,(char)108,(char)115 }; - ck_assert_msg(memcmp(check_msg->telemetry_labels, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->telemetry_labels, expected string '%s', is '%s'", check_string, check_msg->telemetry_labels); + const char check_string[] = {(char)115, (char)111, (char)109, (char)101, + (char)32, (char)108, (char)97, (char)98, + (char)101, (char)108, (char)115}; + ck_assert_msg(memcmp(check_msg->telemetry_labels, check_string, + sizeof(check_string)) == 0, + "incorrect value for check_msg->telemetry_labels, expected " + "string '%s', is '%s'", + check_string, check_msg->telemetry_labels); } } } END_TEST -Suite* legacy_auto_check_sbp_system_MsgCsacTelemetryLabels_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_system_MsgCsacTelemetryLabels"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgCsacTelemetryLabels"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_system_MsgCsacTelemetryLabels); +Suite *legacy_auto_check_sbp_system_MsgCsacTelemetryLabels_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_system_MsgCsacTelemetryLabels"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_system_MsgCsacTelemetryLabels"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_system_MsgCsacTelemetryLabels); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_system_MsgDgnssStatus.c b/c/test/legacy/auto_check_sbp_system_MsgDgnssStatus.c index 165a155c7..0cec53c3b 100644 --- a/c/test/legacy/auto_check_sbp_system_MsgDgnssStatus.c +++ b/c/test/legacy/auto_check_sbp_system_MsgDgnssStatus.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgDgnssStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgDgnssStatus.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_system_MsgDgnssStatus ) -{ +START_TEST(test_legacy_auto_check_sbp_system_MsgDgnssStatus) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgDgnssStatus ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,91 +128,116 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgDgnssStatus ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xff02, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xff02, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xff02, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xff02, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,2,255,66,0,11,0,50,0,12,83,107,121,108,97,114,107,202,1, }; + u8 encoded_frame[] = { + 85, 2, 255, 66, 0, 11, 0, 50, 0, 12, + 83, 107, 121, 108, 97, 114, 107, 202, 1, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_dgnss_status_t* test_msg = ( msg_dgnss_status_t* )test_msg_storage; + msg_dgnss_status_t *test_msg = (msg_dgnss_status_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->latency = 50; test_msg->num_signals = 12; { - const char assign_string[] = { (char)83,(char)107,(char)121,(char)108,(char)97,(char)114,(char)107 }; + const char assign_string[] = {(char)83, (char)107, (char)121, (char)108, + (char)97, (char)114, (char)107}; memcpy(test_msg->source, assign_string, sizeof(assign_string)); if (sizeof(test_msg->source) == 0) { test_msg_len += sizeof(assign_string); } } - sbp_payload_send(&sbp_state, 0xff02, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xff02, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xff02, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_dgnss_status_t* check_msg = ( msg_dgnss_status_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_dgnss_status_t *check_msg = + (msg_dgnss_status_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->latency == 50, "incorrect value for latency, expected 50, is %d", check_msg->latency); - ck_assert_msg(check_msg->num_signals == 12, "incorrect value for num_signals, expected 12, is %d", check_msg->num_signals); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->latency == 50, + "incorrect value for latency, expected 50, is %d", + check_msg->latency); + ck_assert_msg(check_msg->num_signals == 12, + "incorrect value for num_signals, expected 12, is %d", + check_msg->num_signals); { - const char check_string[] = { (char)83,(char)107,(char)121,(char)108,(char)97,(char)114,(char)107 }; - ck_assert_msg(memcmp(check_msg->source, check_string, sizeof(check_string)) == 0, "incorrect value for check_msg->source, expected string '%s', is '%s'", check_string, check_msg->source); + const char check_string[] = {(char)83, (char)107, (char)121, (char)108, + (char)97, (char)114, (char)107}; + ck_assert_msg( + memcmp(check_msg->source, check_string, sizeof(check_string)) == 0, + "incorrect value for check_msg->source, expected string '%s', is " + "'%s'", + check_string, check_msg->source); } } } END_TEST -Suite* legacy_auto_check_sbp_system_MsgDgnssStatus_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_system_MsgDgnssStatus"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgDgnssStatus"); +Suite *legacy_auto_check_sbp_system_MsgDgnssStatus_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_system_MsgDgnssStatus"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_system_MsgDgnssStatus"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_system_MsgDgnssStatus); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_system_MsgGnssTimeOffset.c b/c/test/legacy/auto_check_sbp_system_MsgGnssTimeOffset.c index 37cdc6515..0aee4f1e6 100644 --- a/c/test/legacy/auto_check_sbp_system_MsgGnssTimeOffset.c +++ b/c/test/legacy/auto_check_sbp_system_MsgGnssTimeOffset.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgGnssTimeOffset.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgGnssTimeOffset.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_system_MsgGnssTimeOffset ) -{ +START_TEST(test_legacy_auto_check_sbp_system_MsgGnssTimeOffset) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgGnssTimeOffset ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,82 +128,105 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgGnssTimeOffset ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xff07, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xff07, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xff07, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xff07, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,7,255,22,15,9,9,58,82,83,9,103,22,37,221,84,100, }; + u8 encoded_frame[] = { + 85, 7, 255, 22, 15, 9, 9, 58, 82, 83, 9, 103, 22, 37, 221, 84, 100, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_gnss_time_offset_t* test_msg = ( msg_gnss_time_offset_t* )test_msg_storage; + msg_gnss_time_offset_t *test_msg = + (msg_gnss_time_offset_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 221; test_msg->microseconds = 9494; test_msg->milliseconds = 1728664402; test_msg->weeks = 14857; - sbp_payload_send(&sbp_state, 0xff07, 3862, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xff07, 3862, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 3862, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 3862, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xff07, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_gnss_time_offset_t* check_msg = ( msg_gnss_time_offset_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_gnss_time_offset_t *check_msg = + (msg_gnss_time_offset_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 221, "incorrect value for flags, expected 221, is %d", check_msg->flags); - ck_assert_msg(check_msg->microseconds == 9494, "incorrect value for microseconds, expected 9494, is %d", check_msg->microseconds); - ck_assert_msg(check_msg->milliseconds == 1728664402, "incorrect value for milliseconds, expected 1728664402, is %d", check_msg->milliseconds); - ck_assert_msg(check_msg->weeks == 14857, "incorrect value for weeks, expected 14857, is %d", check_msg->weeks); + ck_assert_msg(check_msg->flags == 221, + "incorrect value for flags, expected 221, is %d", + check_msg->flags); + ck_assert_msg(check_msg->microseconds == 9494, + "incorrect value for microseconds, expected 9494, is %d", + check_msg->microseconds); + ck_assert_msg( + check_msg->milliseconds == 1728664402, + "incorrect value for milliseconds, expected 1728664402, is %d", + check_msg->milliseconds); + ck_assert_msg(check_msg->weeks == 14857, + "incorrect value for weeks, expected 14857, is %d", + check_msg->weeks); } } END_TEST -Suite* legacy_auto_check_sbp_system_MsgGnssTimeOffset_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_system_MsgGnssTimeOffset"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgGnssTimeOffset"); +Suite *legacy_auto_check_sbp_system_MsgGnssTimeOffset_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_system_MsgGnssTimeOffset"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_system_MsgGnssTimeOffset"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_system_MsgGnssTimeOffset); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_system_MsgGroupMeta.c b/c/test/legacy/auto_check_sbp_system_MsgGroupMeta.c index d4310db9f..b26814152 100644 --- a/c/test/legacy/auto_check_sbp_system_MsgGroupMeta.c +++ b/c/test/legacy/auto_check_sbp_system_MsgGroupMeta.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgGroupMeta.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgGroupMeta.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_system_MsgGroupMeta ) -{ +START_TEST(test_legacy_auto_check_sbp_system_MsgGroupMeta) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgGroupMeta ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,21 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgGroupMeta ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xFF0A, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xFF0A, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xFF0A, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xFF0A, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,10,255,238,238,9,1,2,3,10,255,10,2,2,255,2,14, }; + u8 encoded_frame[] = { + 85, 10, 255, 238, 238, 9, 1, 2, 3, 10, 255, 10, 2, 2, 255, 2, 14, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_group_meta_t* test_msg = ( msg_group_meta_t* )test_msg_storage; + msg_group_meta_t* test_msg = (msg_group_meta_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 2; test_msg->group_id = 1; @@ -161,65 +162,84 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgGroupMeta ) } test_msg->group_msgs[2] = 65282; test_msg->n_group_msgs = 3; - sbp_payload_send(&sbp_state, 0xFF0A, 61166, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xFF0A, 61166, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61166, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 61166, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xFF0A, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_group_meta_t* check_msg = ( msg_group_meta_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_group_meta_t* check_msg = (msg_group_meta_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 2, "incorrect value for flags, expected 2, is %d", check_msg->flags); - ck_assert_msg(check_msg->group_id == 1, "incorrect value for group_id, expected 1, is %d", check_msg->group_id); - ck_assert_msg(check_msg->group_msgs[0] == 65290, "incorrect value for group_msgs[0], expected 65290, is %d", check_msg->group_msgs[0]); - ck_assert_msg(check_msg->group_msgs[1] == 522, "incorrect value for group_msgs[1], expected 522, is %d", check_msg->group_msgs[1]); - ck_assert_msg(check_msg->group_msgs[2] == 65282, "incorrect value for group_msgs[2], expected 65282, is %d", check_msg->group_msgs[2]); - ck_assert_msg(check_msg->n_group_msgs == 3, "incorrect value for n_group_msgs, expected 3, is %d", check_msg->n_group_msgs); + ck_assert_msg(check_msg->flags == 2, + "incorrect value for flags, expected 2, is %d", + check_msg->flags); + ck_assert_msg(check_msg->group_id == 1, + "incorrect value for group_id, expected 1, is %d", + check_msg->group_id); + ck_assert_msg(check_msg->group_msgs[0] == 65290, + "incorrect value for group_msgs[0], expected 65290, is %d", + check_msg->group_msgs[0]); + ck_assert_msg(check_msg->group_msgs[1] == 522, + "incorrect value for group_msgs[1], expected 522, is %d", + check_msg->group_msgs[1]); + ck_assert_msg(check_msg->group_msgs[2] == 65282, + "incorrect value for group_msgs[2], expected 65282, is %d", + check_msg->group_msgs[2]); + ck_assert_msg(check_msg->n_group_msgs == 3, + "incorrect value for n_group_msgs, expected 3, is %d", + check_msg->n_group_msgs); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -227,17 +247,23 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgGroupMeta ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xFF0A, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xFF0A, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xFF0A, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xFF0A, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,10,255,21,3,31,1,1,14,2,1,3,1,10,2,17,2,9,2,20,2,14,2,18,2,13,2,21,2,33,2,3,255,6,255,14,255,82,154, }; + u8 encoded_frame[] = { + 85, 10, 255, 21, 3, 31, 1, 1, 14, 2, 1, 3, 1, + 10, 2, 17, 2, 9, 2, 20, 2, 14, 2, 18, 2, 13, + 2, 21, 2, 33, 2, 3, 255, 6, 255, 14, 255, 82, 154, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_group_meta_t* test_msg = ( msg_group_meta_t* )test_msg_storage; + msg_group_meta_t* test_msg = (msg_group_meta_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 1; test_msg->group_id = 1; @@ -312,79 +338,120 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgGroupMeta ) } test_msg->group_msgs[13] = 65294; test_msg->n_group_msgs = 14; - sbp_payload_send(&sbp_state, 0xFF0A, 789, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xFF0A, 789, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 789, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 789, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xFF0A, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_group_meta_t* check_msg = ( msg_group_meta_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_group_meta_t* check_msg = (msg_group_meta_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->group_id == 1, "incorrect value for group_id, expected 1, is %d", check_msg->group_id); - ck_assert_msg(check_msg->group_msgs[0] == 258, "incorrect value for group_msgs[0], expected 258, is %d", check_msg->group_msgs[0]); - ck_assert_msg(check_msg->group_msgs[1] == 259, "incorrect value for group_msgs[1], expected 259, is %d", check_msg->group_msgs[1]); - ck_assert_msg(check_msg->group_msgs[2] == 522, "incorrect value for group_msgs[2], expected 522, is %d", check_msg->group_msgs[2]); - ck_assert_msg(check_msg->group_msgs[3] == 529, "incorrect value for group_msgs[3], expected 529, is %d", check_msg->group_msgs[3]); - ck_assert_msg(check_msg->group_msgs[4] == 521, "incorrect value for group_msgs[4], expected 521, is %d", check_msg->group_msgs[4]); - ck_assert_msg(check_msg->group_msgs[5] == 532, "incorrect value for group_msgs[5], expected 532, is %d", check_msg->group_msgs[5]); - ck_assert_msg(check_msg->group_msgs[6] == 526, "incorrect value for group_msgs[6], expected 526, is %d", check_msg->group_msgs[6]); - ck_assert_msg(check_msg->group_msgs[7] == 530, "incorrect value for group_msgs[7], expected 530, is %d", check_msg->group_msgs[7]); - ck_assert_msg(check_msg->group_msgs[8] == 525, "incorrect value for group_msgs[8], expected 525, is %d", check_msg->group_msgs[8]); - ck_assert_msg(check_msg->group_msgs[9] == 533, "incorrect value for group_msgs[9], expected 533, is %d", check_msg->group_msgs[9]); - ck_assert_msg(check_msg->group_msgs[10] == 545, "incorrect value for group_msgs[10], expected 545, is %d", check_msg->group_msgs[10]); - ck_assert_msg(check_msg->group_msgs[11] == 65283, "incorrect value for group_msgs[11], expected 65283, is %d", check_msg->group_msgs[11]); - ck_assert_msg(check_msg->group_msgs[12] == 65286, "incorrect value for group_msgs[12], expected 65286, is %d", check_msg->group_msgs[12]); - ck_assert_msg(check_msg->group_msgs[13] == 65294, "incorrect value for group_msgs[13], expected 65294, is %d", check_msg->group_msgs[13]); - ck_assert_msg(check_msg->n_group_msgs == 14, "incorrect value for n_group_msgs, expected 14, is %d", check_msg->n_group_msgs); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->group_id == 1, + "incorrect value for group_id, expected 1, is %d", + check_msg->group_id); + ck_assert_msg(check_msg->group_msgs[0] == 258, + "incorrect value for group_msgs[0], expected 258, is %d", + check_msg->group_msgs[0]); + ck_assert_msg(check_msg->group_msgs[1] == 259, + "incorrect value for group_msgs[1], expected 259, is %d", + check_msg->group_msgs[1]); + ck_assert_msg(check_msg->group_msgs[2] == 522, + "incorrect value for group_msgs[2], expected 522, is %d", + check_msg->group_msgs[2]); + ck_assert_msg(check_msg->group_msgs[3] == 529, + "incorrect value for group_msgs[3], expected 529, is %d", + check_msg->group_msgs[3]); + ck_assert_msg(check_msg->group_msgs[4] == 521, + "incorrect value for group_msgs[4], expected 521, is %d", + check_msg->group_msgs[4]); + ck_assert_msg(check_msg->group_msgs[5] == 532, + "incorrect value for group_msgs[5], expected 532, is %d", + check_msg->group_msgs[5]); + ck_assert_msg(check_msg->group_msgs[6] == 526, + "incorrect value for group_msgs[6], expected 526, is %d", + check_msg->group_msgs[6]); + ck_assert_msg(check_msg->group_msgs[7] == 530, + "incorrect value for group_msgs[7], expected 530, is %d", + check_msg->group_msgs[7]); + ck_assert_msg(check_msg->group_msgs[8] == 525, + "incorrect value for group_msgs[8], expected 525, is %d", + check_msg->group_msgs[8]); + ck_assert_msg(check_msg->group_msgs[9] == 533, + "incorrect value for group_msgs[9], expected 533, is %d", + check_msg->group_msgs[9]); + ck_assert_msg(check_msg->group_msgs[10] == 545, + "incorrect value for group_msgs[10], expected 545, is %d", + check_msg->group_msgs[10]); + ck_assert_msg(check_msg->group_msgs[11] == 65283, + "incorrect value for group_msgs[11], expected 65283, is %d", + check_msg->group_msgs[11]); + ck_assert_msg(check_msg->group_msgs[12] == 65286, + "incorrect value for group_msgs[12], expected 65286, is %d", + check_msg->group_msgs[12]); + ck_assert_msg(check_msg->group_msgs[13] == 65294, + "incorrect value for group_msgs[13], expected 65294, is %d", + check_msg->group_msgs[13]); + ck_assert_msg(check_msg->n_group_msgs == 14, + "incorrect value for n_group_msgs, expected 14, is %d", + check_msg->n_group_msgs); } } END_TEST -Suite* legacy_auto_check_sbp_system_MsgGroupMeta_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_system_MsgGroupMeta"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgGroupMeta"); +Suite* legacy_auto_check_sbp_system_MsgGroupMeta_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_system_MsgGroupMeta"); + TCase* tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgGroupMeta"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_system_MsgGroupMeta); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_system_MsgHeartbeat.c b/c/test/legacy/auto_check_sbp_system_MsgHeartbeat.c index 1bc22d14d..accc12acf 100644 --- a/c/test/legacy/auto_check_sbp_system_MsgHeartbeat.c +++ b/c/test/legacy/auto_check_sbp_system_MsgHeartbeat.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgHeartbeat.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgHeartbeat.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_system_MsgHeartbeat ) -{ +START_TEST(test_legacy_auto_check_sbp_system_MsgHeartbeat) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgHeartbeat ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,73 +128,86 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgHeartbeat ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xffff, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xffff, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xffff, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xffff, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,255,255,246,215,4,0,50,0,0,249,216, }; + u8 encoded_frame[] = { + 85, 255, 255, 246, 215, 4, 0, 50, 0, 0, 249, 216, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_heartbeat_t* test_msg = ( msg_heartbeat_t* )test_msg_storage; + msg_heartbeat_t* test_msg = (msg_heartbeat_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 12800; - sbp_payload_send(&sbp_state, 0xffff, 55286, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xffff, 55286, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 55286, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 55286, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xffff, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_heartbeat_t* check_msg = ( msg_heartbeat_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_heartbeat_t* check_msg = (msg_heartbeat_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 12800, "incorrect value for flags, expected 12800, is %d", check_msg->flags); + ck_assert_msg(check_msg->flags == 12800, + "incorrect value for flags, expected 12800, is %d", + check_msg->flags); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -205,76 +215,89 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgHeartbeat ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xffff, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xffff, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xffff, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xffff, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,255,255,195,4,4,0,0,0,0,66,57, }; + u8 encoded_frame[] = { + 85, 255, 255, 195, 4, 4, 0, 0, 0, 0, 66, 57, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_heartbeat_t* test_msg = ( msg_heartbeat_t* )test_msg_storage; + msg_heartbeat_t* test_msg = (msg_heartbeat_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; - sbp_payload_send(&sbp_state, 0xffff, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xffff, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xffff, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_heartbeat_t* check_msg = ( msg_heartbeat_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_heartbeat_t* check_msg = (msg_heartbeat_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); } } END_TEST -Suite* legacy_auto_check_sbp_system_MsgHeartbeat_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_system_MsgHeartbeat"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgHeartbeat"); +Suite* legacy_auto_check_sbp_system_MsgHeartbeat_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_system_MsgHeartbeat"); + TCase* tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgHeartbeat"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_system_MsgHeartbeat); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_system_MsgInsStatus.c b/c/test/legacy/auto_check_sbp_system_MsgInsStatus.c index 2ab92f123..26c3c8edf 100644 --- a/c/test/legacy/auto_check_sbp_system_MsgInsStatus.c +++ b/c/test/legacy/auto_check_sbp_system_MsgInsStatus.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgInsStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgInsStatus.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_system_MsgInsStatus ) -{ +START_TEST(test_legacy_auto_check_sbp_system_MsgInsStatus) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgInsStatus ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,76 +128,89 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgInsStatus ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xff03, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xff03, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xff03, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xff03, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,255,21,3,4,9,0,0,32,36,103, }; + u8 encoded_frame[] = { + 85, 3, 255, 21, 3, 4, 9, 0, 0, 32, 36, 103, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ins_status_t* test_msg = ( msg_ins_status_t* )test_msg_storage; + msg_ins_status_t *test_msg = (msg_ins_status_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 536870921; - sbp_payload_send(&sbp_state, 0xff03, 789, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xff03, 789, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 789, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 789, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xff03, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ins_status_t* check_msg = ( msg_ins_status_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ins_status_t *check_msg = (msg_ins_status_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 536870921, "incorrect value for flags, expected 536870921, is %d", check_msg->flags); + ck_assert_msg(check_msg->flags == 536870921, + "incorrect value for flags, expected 536870921, is %d", + check_msg->flags); } } END_TEST -Suite* legacy_auto_check_sbp_system_MsgInsStatus_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_system_MsgInsStatus"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgInsStatus"); +Suite *legacy_auto_check_sbp_system_MsgInsStatus_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_system_MsgInsStatus"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgInsStatus"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_system_MsgInsStatus); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_system_MsgInsUpdates.c b/c/test/legacy/auto_check_sbp_system_MsgInsUpdates.c index bfc40c4de..6d35f1ce7 100644 --- a/c/test/legacy/auto_check_sbp_system_MsgInsUpdates.c +++ b/c/test/legacy/auto_check_sbp_system_MsgInsUpdates.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgInsUpdates.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgInsUpdates.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_system_MsgInsUpdates ) -{ +START_TEST(test_legacy_auto_check_sbp_system_MsgInsUpdates) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgInsUpdates ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,21 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgInsUpdates ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xff06, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xff06, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xff06, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xff06, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,6,255,21,3,10,84,229,17,30,0,0,0,0,0,0,81,63, }; + u8 encoded_frame[] = { + 85, 6, 255, 21, 3, 10, 84, 229, 17, 30, 0, 0, 0, 0, 0, 0, 81, 63, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ins_updates_t* test_msg = ( msg_ins_updates_t* )test_msg_storage; + msg_ins_updates_t *test_msg = (msg_ins_updates_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->gnsspos = 0; test_msg->gnssvel = 0; @@ -150,69 +151,89 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgInsUpdates ) test_msg->tow = 504489300; test_msg->wheelticks = 0; test_msg->zerovel = 0; - sbp_payload_send(&sbp_state, 0xff06, 789, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xff06, 789, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 789, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 789, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xff06, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_ins_updates_t* check_msg = ( msg_ins_updates_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ins_updates_t *check_msg = (msg_ins_updates_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->gnsspos == 0, "incorrect value for gnsspos, expected 0, is %d", check_msg->gnsspos); - ck_assert_msg(check_msg->gnssvel == 0, "incorrect value for gnssvel, expected 0, is %d", check_msg->gnssvel); - ck_assert_msg(check_msg->nhc == 0, "incorrect value for nhc, expected 0, is %d", check_msg->nhc); - ck_assert_msg(check_msg->speed == 0, "incorrect value for speed, expected 0, is %d", check_msg->speed); - ck_assert_msg(check_msg->tow == 504489300, "incorrect value for tow, expected 504489300, is %d", check_msg->tow); - ck_assert_msg(check_msg->wheelticks == 0, "incorrect value for wheelticks, expected 0, is %d", check_msg->wheelticks); - ck_assert_msg(check_msg->zerovel == 0, "incorrect value for zerovel, expected 0, is %d", check_msg->zerovel); + ck_assert_msg(check_msg->gnsspos == 0, + "incorrect value for gnsspos, expected 0, is %d", + check_msg->gnsspos); + ck_assert_msg(check_msg->gnssvel == 0, + "incorrect value for gnssvel, expected 0, is %d", + check_msg->gnssvel); + ck_assert_msg(check_msg->nhc == 0, + "incorrect value for nhc, expected 0, is %d", check_msg->nhc); + ck_assert_msg(check_msg->speed == 0, + "incorrect value for speed, expected 0, is %d", + check_msg->speed); + ck_assert_msg(check_msg->tow == 504489300, + "incorrect value for tow, expected 504489300, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wheelticks == 0, + "incorrect value for wheelticks, expected 0, is %d", + check_msg->wheelticks); + ck_assert_msg(check_msg->zerovel == 0, + "incorrect value for zerovel, expected 0, is %d", + check_msg->zerovel); } } END_TEST -Suite* legacy_auto_check_sbp_system_MsgInsUpdates_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_system_MsgInsUpdates"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgInsUpdates"); +Suite *legacy_auto_check_sbp_system_MsgInsUpdates_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_system_MsgInsUpdates"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_system_MsgInsUpdates"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_system_MsgInsUpdates); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_system_MsgPpsTime.c b/c/test/legacy/auto_check_sbp_system_MsgPpsTime.c index 0de8114c3..9cc1e3356 100644 --- a/c/test/legacy/auto_check_sbp_system_MsgPpsTime.c +++ b/c/test/legacy/auto_check_sbp_system_MsgPpsTime.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgPpsTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgPpsTime.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_system_MsgPpsTime ) -{ +START_TEST(test_legacy_auto_check_sbp_system_MsgPpsTime) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgPpsTime ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,78 +128,94 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgPpsTime ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xff08, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xff08, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xff08, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xff08, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,8,255,222,209,9,140,146,133,197,160,0,0,0,255,125,149, }; + u8 encoded_frame[] = { + 85, 8, 255, 222, 209, 9, 140, 146, 133, + 197, 160, 0, 0, 0, 255, 125, 149, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_pps_time_t* test_msg = ( msg_pps_time_t* )test_msg_storage; + msg_pps_time_t *test_msg = (msg_pps_time_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 255; test_msg->time = 690508632716; - sbp_payload_send(&sbp_state, 0xff08, 53726, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xff08, 53726, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 53726, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 53726, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xff08, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_pps_time_t* check_msg = ( msg_pps_time_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_pps_time_t *check_msg = (msg_pps_time_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 255, "incorrect value for flags, expected 255, is %d", check_msg->flags); - ck_assert_msg(check_msg->time == 690508632716, "incorrect value for time, expected 690508632716, is %d", check_msg->time); + ck_assert_msg(check_msg->flags == 255, + "incorrect value for flags, expected 255, is %d", + check_msg->flags); + ck_assert_msg(check_msg->time == 690508632716, + "incorrect value for time, expected 690508632716, is %d", + check_msg->time); } } END_TEST -Suite* legacy_auto_check_sbp_system_MsgPpsTime_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_system_MsgPpsTime"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgPpsTime"); +Suite *legacy_auto_check_sbp_system_MsgPpsTime_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_system_MsgPpsTime"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgPpsTime"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_system_MsgPpsTime); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_system_MsgSensorAidEvent.c b/c/test/legacy/auto_check_sbp_system_MsgSensorAidEvent.c index e59c3b3a6..2170e6028 100644 --- a/c/test/legacy/auto_check_sbp_system_MsgSensorAidEvent.c +++ b/c/test/legacy/auto_check_sbp_system_MsgSensorAidEvent.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgSensorAidEvent.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgSensorAidEvent.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_system_MsgSensorAidEvent ) -{ +START_TEST(test_legacy_auto_check_sbp_system_MsgSensorAidEvent) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgSensorAidEvent ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgSensorAidEvent ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xFF09, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xFF09, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xFF09, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xFF09, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,9,255,211,136,15,48,246,122,19,0,0,0,0,0,0,0,0,0,0,0,33,236, }; + u8 encoded_frame[] = { + 85, 9, 255, 211, 136, 15, 48, 246, 122, 19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 236, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_sensor_aid_event_t* test_msg = ( msg_sensor_aid_event_t* )test_msg_storage; + msg_sensor_aid_event_t *test_msg = + (msg_sensor_aid_event_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 0; test_msg->n_accepted_meas = 0; @@ -151,70 +154,95 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgSensorAidEvent ) test_msg->sensor_state = 0; test_msg->sensor_type = 0; test_msg->time = 326825520; - sbp_payload_send(&sbp_state, 0xFF09, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xFF09, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xFF09, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_sensor_aid_event_t* check_msg = ( msg_sensor_aid_event_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_sensor_aid_event_t *check_msg = + (msg_sensor_aid_event_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_accepted_meas == 0, "incorrect value for n_accepted_meas, expected 0, is %d", check_msg->n_accepted_meas); - ck_assert_msg(check_msg->n_attempted_meas == 0, "incorrect value for n_attempted_meas, expected 0, is %d", check_msg->n_attempted_meas); - ck_assert_msg(check_msg->n_available_meas == 0, "incorrect value for n_available_meas, expected 0, is %d", check_msg->n_available_meas); - ck_assert_msg(check_msg->sensor_id == 0, "incorrect value for sensor_id, expected 0, is %d", check_msg->sensor_id); - ck_assert_msg(check_msg->sensor_state == 0, "incorrect value for sensor_state, expected 0, is %d", check_msg->sensor_state); - ck_assert_msg(check_msg->sensor_type == 0, "incorrect value for sensor_type, expected 0, is %d", check_msg->sensor_type); - ck_assert_msg(check_msg->time == 326825520, "incorrect value for time, expected 326825520, is %d", check_msg->time); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_accepted_meas == 0, + "incorrect value for n_accepted_meas, expected 0, is %d", + check_msg->n_accepted_meas); + ck_assert_msg(check_msg->n_attempted_meas == 0, + "incorrect value for n_attempted_meas, expected 0, is %d", + check_msg->n_attempted_meas); + ck_assert_msg(check_msg->n_available_meas == 0, + "incorrect value for n_available_meas, expected 0, is %d", + check_msg->n_available_meas); + ck_assert_msg(check_msg->sensor_id == 0, + "incorrect value for sensor_id, expected 0, is %d", + check_msg->sensor_id); + ck_assert_msg(check_msg->sensor_state == 0, + "incorrect value for sensor_state, expected 0, is %d", + check_msg->sensor_state); + ck_assert_msg(check_msg->sensor_type == 0, + "incorrect value for sensor_type, expected 0, is %d", + check_msg->sensor_type); + ck_assert_msg(check_msg->time == 326825520, + "incorrect value for time, expected 326825520, is %d", + check_msg->time); } } END_TEST -Suite* legacy_auto_check_sbp_system_MsgSensorAidEvent_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_system_MsgSensorAidEvent"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgSensorAidEvent"); +Suite *legacy_auto_check_sbp_system_MsgSensorAidEvent_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_system_MsgSensorAidEvent"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_system_MsgSensorAidEvent"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_system_MsgSensorAidEvent); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_system_MsgStartup.c b/c/test/legacy/auto_check_sbp_system_MsgStartup.c index 97e4e218b..0dbed8559 100644 --- a/c/test/legacy/auto_check_sbp_system_MsgStartup.c +++ b/c/test/legacy/auto_check_sbp_system_MsgStartup.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgStartup.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgStartup.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_system_MsgStartup ) -{ +START_TEST(test_legacy_auto_check_sbp_system_MsgStartup) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgStartup ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,77 +128,94 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgStartup ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xff00, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xff00, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xff00, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xff00, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,255,66,0,4,0,0,0,0,70,160, }; + u8 encoded_frame[] = { + 85, 0, 255, 66, 0, 4, 0, 0, 0, 0, 70, 160, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_startup_t* test_msg = ( msg_startup_t* )test_msg_storage; + msg_startup_t* test_msg = (msg_startup_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cause = 0; test_msg->reserved = 0; test_msg->startup_type = 0; - sbp_payload_send(&sbp_state, 0xff00, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xff00, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xff00, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_startup_t* check_msg = ( msg_startup_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_startup_t* check_msg = (msg_startup_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cause == 0, "incorrect value for cause, expected 0, is %d", check_msg->cause); - ck_assert_msg(check_msg->reserved == 0, "incorrect value for reserved, expected 0, is %d", check_msg->reserved); - ck_assert_msg(check_msg->startup_type == 0, "incorrect value for startup_type, expected 0, is %d", check_msg->startup_type); + ck_assert_msg(check_msg->cause == 0, + "incorrect value for cause, expected 0, is %d", + check_msg->cause); + ck_assert_msg(check_msg->reserved == 0, + "incorrect value for reserved, expected 0, is %d", + check_msg->reserved); + ck_assert_msg(check_msg->startup_type == 0, + "incorrect value for startup_type, expected 0, is %d", + check_msg->startup_type); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -209,80 +223,97 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgStartup ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xff00, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xff00, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xff00, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xff00, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,255,195,4,4,0,0,0,0,127,181, }; + u8 encoded_frame[] = { + 85, 0, 255, 195, 4, 4, 0, 0, 0, 0, 127, 181, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_startup_t* test_msg = ( msg_startup_t* )test_msg_storage; + msg_startup_t* test_msg = (msg_startup_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->cause = 0; test_msg->reserved = 0; test_msg->startup_type = 0; - sbp_payload_send(&sbp_state, 0xff00, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xff00, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xff00, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_startup_t* check_msg = ( msg_startup_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_startup_t* check_msg = (msg_startup_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->cause == 0, "incorrect value for cause, expected 0, is %d", check_msg->cause); - ck_assert_msg(check_msg->reserved == 0, "incorrect value for reserved, expected 0, is %d", check_msg->reserved); - ck_assert_msg(check_msg->startup_type == 0, "incorrect value for startup_type, expected 0, is %d", check_msg->startup_type); + ck_assert_msg(check_msg->cause == 0, + "incorrect value for cause, expected 0, is %d", + check_msg->cause); + ck_assert_msg(check_msg->reserved == 0, + "incorrect value for reserved, expected 0, is %d", + check_msg->reserved); + ck_assert_msg(check_msg->startup_type == 0, + "incorrect value for startup_type, expected 0, is %d", + check_msg->startup_type); } } END_TEST -Suite* legacy_auto_check_sbp_system_MsgStartup_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_system_MsgStartup"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgStartup"); +Suite* legacy_auto_check_sbp_system_MsgStartup_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_system_MsgStartup"); + TCase* tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgStartup"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_system_MsgStartup); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_system_MsgStatusJournal.c b/c/test/legacy/auto_check_sbp_system_MsgStatusJournal.c index b7f9bc481..7ca837472 100644 --- a/c/test/legacy/auto_check_sbp_system_MsgStatusJournal.c +++ b/c/test/legacy/auto_check_sbp_system_MsgStatusJournal.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusJournal.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusJournal.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_system_MsgStatusJournal ) -{ +START_TEST(test_legacy_auto_check_sbp_system_MsgStatusJournal) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgStatusJournal ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,23 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgStatusJournal ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xFFFD, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xFFFD, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xFFFD, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xFFFD, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,253,255,211,136,33,1,0,1,4,100,0,0,0,16,146,16,0,0,6,0,1,13,186,19,0,0,6,0,1,14,184,34,0,0,6,0,1,15,113,119, }; + u8 encoded_frame[] = { + 85, 253, 255, 211, 136, 33, 1, 0, 1, 4, 100, 0, 0, 0, + 16, 146, 16, 0, 0, 6, 0, 1, 13, 186, 19, 0, 0, 6, + 0, 1, 14, 184, 34, 0, 0, 6, 0, 1, 15, 113, 119, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_status_journal_t* test_msg = ( msg_status_journal_t* )test_msg_storage; + msg_status_journal_t* test_msg = (msg_status_journal_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->journal) == 0) { // Cope with variable length arrays @@ -171,75 +174,125 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgStatusJournal ) test_msg->sbp_version = 1025; test_msg->sequence_descriptor = 16; test_msg->total_status_reports = 100; - sbp_payload_send(&sbp_state, 0xFFFD, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xFFFD, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xFFFD, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_status_journal_t* check_msg = ( msg_status_journal_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_status_journal_t* check_msg = + (msg_status_journal_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->journal[0].report.component == 6, "incorrect value for journal[0].report.component, expected 6, is %d", check_msg->journal[0].report.component); - ck_assert_msg(check_msg->journal[0].report.generic == 1, "incorrect value for journal[0].report.generic, expected 1, is %d", check_msg->journal[0].report.generic); - ck_assert_msg(check_msg->journal[0].report.specific == 13, "incorrect value for journal[0].report.specific, expected 13, is %d", check_msg->journal[0].report.specific); - ck_assert_msg(check_msg->journal[0].uptime == 4242, "incorrect value for journal[0].uptime, expected 4242, is %d", check_msg->journal[0].uptime); - ck_assert_msg(check_msg->journal[1].report.component == 6, "incorrect value for journal[1].report.component, expected 6, is %d", check_msg->journal[1].report.component); - ck_assert_msg(check_msg->journal[1].report.generic == 1, "incorrect value for journal[1].report.generic, expected 1, is %d", check_msg->journal[1].report.generic); - ck_assert_msg(check_msg->journal[1].report.specific == 14, "incorrect value for journal[1].report.specific, expected 14, is %d", check_msg->journal[1].report.specific); - ck_assert_msg(check_msg->journal[1].uptime == 5050, "incorrect value for journal[1].uptime, expected 5050, is %d", check_msg->journal[1].uptime); - ck_assert_msg(check_msg->journal[2].report.component == 6, "incorrect value for journal[2].report.component, expected 6, is %d", check_msg->journal[2].report.component); - ck_assert_msg(check_msg->journal[2].report.generic == 1, "incorrect value for journal[2].report.generic, expected 1, is %d", check_msg->journal[2].report.generic); - ck_assert_msg(check_msg->journal[2].report.specific == 15, "incorrect value for journal[2].report.specific, expected 15, is %d", check_msg->journal[2].report.specific); - ck_assert_msg(check_msg->journal[2].uptime == 8888, "incorrect value for journal[2].uptime, expected 8888, is %d", check_msg->journal[2].uptime); - ck_assert_msg(check_msg->reporting_system == 1, "incorrect value for reporting_system, expected 1, is %d", check_msg->reporting_system); - ck_assert_msg(check_msg->sbp_version == 1025, "incorrect value for sbp_version, expected 1025, is %d", check_msg->sbp_version); - ck_assert_msg(check_msg->sequence_descriptor == 16, "incorrect value for sequence_descriptor, expected 16, is %d", check_msg->sequence_descriptor); - ck_assert_msg(check_msg->total_status_reports == 100, "incorrect value for total_status_reports, expected 100, is %d", check_msg->total_status_reports); + ck_assert_msg( + check_msg->journal[0].report.component == 6, + "incorrect value for journal[0].report.component, expected 6, is %d", + check_msg->journal[0].report.component); + ck_assert_msg( + check_msg->journal[0].report.generic == 1, + "incorrect value for journal[0].report.generic, expected 1, is %d", + check_msg->journal[0].report.generic); + ck_assert_msg( + check_msg->journal[0].report.specific == 13, + "incorrect value for journal[0].report.specific, expected 13, is %d", + check_msg->journal[0].report.specific); + ck_assert_msg(check_msg->journal[0].uptime == 4242, + "incorrect value for journal[0].uptime, expected 4242, is %d", + check_msg->journal[0].uptime); + ck_assert_msg( + check_msg->journal[1].report.component == 6, + "incorrect value for journal[1].report.component, expected 6, is %d", + check_msg->journal[1].report.component); + ck_assert_msg( + check_msg->journal[1].report.generic == 1, + "incorrect value for journal[1].report.generic, expected 1, is %d", + check_msg->journal[1].report.generic); + ck_assert_msg( + check_msg->journal[1].report.specific == 14, + "incorrect value for journal[1].report.specific, expected 14, is %d", + check_msg->journal[1].report.specific); + ck_assert_msg(check_msg->journal[1].uptime == 5050, + "incorrect value for journal[1].uptime, expected 5050, is %d", + check_msg->journal[1].uptime); + ck_assert_msg( + check_msg->journal[2].report.component == 6, + "incorrect value for journal[2].report.component, expected 6, is %d", + check_msg->journal[2].report.component); + ck_assert_msg( + check_msg->journal[2].report.generic == 1, + "incorrect value for journal[2].report.generic, expected 1, is %d", + check_msg->journal[2].report.generic); + ck_assert_msg( + check_msg->journal[2].report.specific == 15, + "incorrect value for journal[2].report.specific, expected 15, is %d", + check_msg->journal[2].report.specific); + ck_assert_msg(check_msg->journal[2].uptime == 8888, + "incorrect value for journal[2].uptime, expected 8888, is %d", + check_msg->journal[2].uptime); + ck_assert_msg(check_msg->reporting_system == 1, + "incorrect value for reporting_system, expected 1, is %d", + check_msg->reporting_system); + ck_assert_msg(check_msg->sbp_version == 1025, + "incorrect value for sbp_version, expected 1025, is %d", + check_msg->sbp_version); + ck_assert_msg(check_msg->sequence_descriptor == 16, + "incorrect value for sequence_descriptor, expected 16, is %d", + check_msg->sequence_descriptor); + ck_assert_msg( + check_msg->total_status_reports == 100, + "incorrect value for total_status_reports, expected 100, is %d", + check_msg->total_status_reports); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -247,17 +300,22 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgStatusJournal ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xFFFD, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xFFFD, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xFFFD, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xFFFD, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,253,255,211,136,17,1,0,1,4,100,0,0,0,16,146,16,0,0,6,0,1,13,144,121, }; + u8 encoded_frame[] = { + 85, 253, 255, 211, 136, 17, 1, 0, 1, 4, 100, 0, 0, + 0, 16, 146, 16, 0, 0, 6, 0, 1, 13, 144, 121, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_status_journal_t* test_msg = ( msg_status_journal_t* )test_msg_storage; + msg_status_journal_t* test_msg = (msg_status_journal_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->journal) == 0) { // Cope with variable length arrays @@ -271,70 +329,99 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgStatusJournal ) test_msg->sbp_version = 1025; test_msg->sequence_descriptor = 16; test_msg->total_status_reports = 100; - sbp_payload_send(&sbp_state, 0xFFFD, 35027, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xFFFD, 35027, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 35027, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 35027, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xFFFD, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_status_journal_t* check_msg = ( msg_status_journal_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_status_journal_t* check_msg = + (msg_status_journal_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->journal[0].report.component == 6, "incorrect value for journal[0].report.component, expected 6, is %d", check_msg->journal[0].report.component); - ck_assert_msg(check_msg->journal[0].report.generic == 1, "incorrect value for journal[0].report.generic, expected 1, is %d", check_msg->journal[0].report.generic); - ck_assert_msg(check_msg->journal[0].report.specific == 13, "incorrect value for journal[0].report.specific, expected 13, is %d", check_msg->journal[0].report.specific); - ck_assert_msg(check_msg->journal[0].uptime == 4242, "incorrect value for journal[0].uptime, expected 4242, is %d", check_msg->journal[0].uptime); - ck_assert_msg(check_msg->reporting_system == 1, "incorrect value for reporting_system, expected 1, is %d", check_msg->reporting_system); - ck_assert_msg(check_msg->sbp_version == 1025, "incorrect value for sbp_version, expected 1025, is %d", check_msg->sbp_version); - ck_assert_msg(check_msg->sequence_descriptor == 16, "incorrect value for sequence_descriptor, expected 16, is %d", check_msg->sequence_descriptor); - ck_assert_msg(check_msg->total_status_reports == 100, "incorrect value for total_status_reports, expected 100, is %d", check_msg->total_status_reports); + ck_assert_msg( + check_msg->journal[0].report.component == 6, + "incorrect value for journal[0].report.component, expected 6, is %d", + check_msg->journal[0].report.component); + ck_assert_msg( + check_msg->journal[0].report.generic == 1, + "incorrect value for journal[0].report.generic, expected 1, is %d", + check_msg->journal[0].report.generic); + ck_assert_msg( + check_msg->journal[0].report.specific == 13, + "incorrect value for journal[0].report.specific, expected 13, is %d", + check_msg->journal[0].report.specific); + ck_assert_msg(check_msg->journal[0].uptime == 4242, + "incorrect value for journal[0].uptime, expected 4242, is %d", + check_msg->journal[0].uptime); + ck_assert_msg(check_msg->reporting_system == 1, + "incorrect value for reporting_system, expected 1, is %d", + check_msg->reporting_system); + ck_assert_msg(check_msg->sbp_version == 1025, + "incorrect value for sbp_version, expected 1025, is %d", + check_msg->sbp_version); + ck_assert_msg(check_msg->sequence_descriptor == 16, + "incorrect value for sequence_descriptor, expected 16, is %d", + check_msg->sequence_descriptor); + ck_assert_msg( + check_msg->total_status_reports == 100, + "incorrect value for total_status_reports, expected 100, is %d", + check_msg->total_status_reports); } } END_TEST -Suite* legacy_auto_check_sbp_system_MsgStatusJournal_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_system_MsgStatusJournal"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgStatusJournal"); +Suite* legacy_auto_check_sbp_system_MsgStatusJournal_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_system_MsgStatusJournal"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_system_MsgStatusJournal"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_system_MsgStatusJournal); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_system_MsgStatusReport.c b/c/test/legacy/auto_check_sbp_system_MsgStatusReport.c index 75d23b9d8..f18b814c1 100644 --- a/c/test/legacy/auto_check_sbp_system_MsgStatusReport.c +++ b/c/test/legacy/auto_check_sbp_system_MsgStatusReport.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusReport.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusReport.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_system_MsgStatusReport ) -{ +START_TEST(test_legacy_auto_check_sbp_system_MsgStatusReport) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgStatusReport ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,39 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgStatusReport ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xfffe, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xfffe, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0xfffe, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xfffe, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,254,255,6,84,252,82,253,177,95,3,60,143,90,233,21,208,98,247,203,221,198,156,207,217,238,162,136,154,11,114,236,134,235,12,133,9,30,175,145,26,114,215,20,146,249,54,54,133,193,106,186,210,183,0,129,5,248,225,149,135,127,2,26,88,92,10,103,73,3,103,68,76,184,33,206,194,163,123,30,151,176,149,172,184,231,118,230,200,168,100,109,10,233,4,60,247,82,215,166,28,138,110,45,98,218,244,179,126,107,92,124,94,157,42,187,124,6,97,247,160,188,110,120,254,214,110,51,240,164,147,18,74,178,67,4,27,73,190,64,179,146,125,153,192,46,202,66,248,46,40,161,173,242,214,3,11,1,118,70,162,61,178,27,156,40,191,113,230,200,72,8,215,245,78,59,222,250,115,32,33,30,211,170,145,92,157,75,24,169,6,55,62,8,107,82,140,49,179,122,90,71,28,88,103,51,177,72,93,39,148,11,202,42,34,92,204,102,29,98,249,91,134,95,23,248,192,20,83,195,95,180,54,36,186,75,64,20,157,133,12,149,28,14,185,129,101,239,74,248,245,30,228,88,142,212,53,224,158,166, }; + u8 encoded_frame[] = { + 85, 254, 255, 6, 84, 252, 82, 253, 177, 95, 3, 60, 143, 90, + 233, 21, 208, 98, 247, 203, 221, 198, 156, 207, 217, 238, 162, 136, + 154, 11, 114, 236, 134, 235, 12, 133, 9, 30, 175, 145, 26, 114, + 215, 20, 146, 249, 54, 54, 133, 193, 106, 186, 210, 183, 0, 129, + 5, 248, 225, 149, 135, 127, 2, 26, 88, 92, 10, 103, 73, 3, + 103, 68, 76, 184, 33, 206, 194, 163, 123, 30, 151, 176, 149, 172, + 184, 231, 118, 230, 200, 168, 100, 109, 10, 233, 4, 60, 247, 82, + 215, 166, 28, 138, 110, 45, 98, 218, 244, 179, 126, 107, 92, 124, + 94, 157, 42, 187, 124, 6, 97, 247, 160, 188, 110, 120, 254, 214, + 110, 51, 240, 164, 147, 18, 74, 178, 67, 4, 27, 73, 190, 64, + 179, 146, 125, 153, 192, 46, 202, 66, 248, 46, 40, 161, 173, 242, + 214, 3, 11, 1, 118, 70, 162, 61, 178, 27, 156, 40, 191, 113, + 230, 200, 72, 8, 215, 245, 78, 59, 222, 250, 115, 32, 33, 30, + 211, 170, 145, 92, 157, 75, 24, 169, 6, 55, 62, 8, 107, 82, + 140, 49, 179, 122, 90, 71, 28, 88, 103, 51, 177, 72, 93, 39, + 148, 11, 202, 42, 34, 92, 204, 102, 29, 98, 249, 91, 134, 95, + 23, 248, 192, 20, 83, 195, 95, 180, 54, 36, 186, 75, 64, 20, + 157, 133, 12, 149, 28, 14, 185, 129, 101, 239, 74, 248, 245, 30, + 228, 88, 142, 212, 53, 224, 158, 166, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_status_report_t* test_msg = ( msg_status_report_t* )test_msg_storage; + msg_status_report_t *test_msg = (msg_status_report_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->reporting_system = 64850; test_msg->sbp_version = 24497; @@ -567,246 +586,710 @@ START_TEST( test_legacy_auto_check_sbp_system_MsgStatusReport ) test_msg->status[59].generic = 53; test_msg->status[59].specific = 224; test_msg->uptime = 1657804265; - sbp_payload_send(&sbp_state, 0xfffe, 21510, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0xfffe, 21510, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 21510, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 21510, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0xfffe, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_status_report_t* check_msg = ( msg_status_report_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_status_report_t *check_msg = + (msg_status_report_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->reporting_system == 64850, "incorrect value for reporting_system, expected 64850, is %d", check_msg->reporting_system); - ck_assert_msg(check_msg->sbp_version == 24497, "incorrect value for sbp_version, expected 24497, is %d", check_msg->sbp_version); - ck_assert_msg(check_msg->sequence == 1519336451, "incorrect value for sequence, expected 1519336451, is %d", check_msg->sequence); - ck_assert_msg(check_msg->status[0].component == 52215, "incorrect value for status[0].component, expected 52215, is %d", check_msg->status[0].component); - ck_assert_msg(check_msg->status[0].generic == 221, "incorrect value for status[0].generic, expected 221, is %d", check_msg->status[0].generic); - ck_assert_msg(check_msg->status[0].specific == 198, "incorrect value for status[0].specific, expected 198, is %d", check_msg->status[0].specific); - ck_assert_msg(check_msg->status[1].component == 53148, "incorrect value for status[1].component, expected 53148, is %d", check_msg->status[1].component); - ck_assert_msg(check_msg->status[1].generic == 217, "incorrect value for status[1].generic, expected 217, is %d", check_msg->status[1].generic); - ck_assert_msg(check_msg->status[1].specific == 238, "incorrect value for status[1].specific, expected 238, is %d", check_msg->status[1].specific); - ck_assert_msg(check_msg->status[2].component == 34978, "incorrect value for status[2].component, expected 34978, is %d", check_msg->status[2].component); - ck_assert_msg(check_msg->status[2].generic == 154, "incorrect value for status[2].generic, expected 154, is %d", check_msg->status[2].generic); - ck_assert_msg(check_msg->status[2].specific == 11, "incorrect value for status[2].specific, expected 11, is %d", check_msg->status[2].specific); - ck_assert_msg(check_msg->status[3].component == 60530, "incorrect value for status[3].component, expected 60530, is %d", check_msg->status[3].component); - ck_assert_msg(check_msg->status[3].generic == 134, "incorrect value for status[3].generic, expected 134, is %d", check_msg->status[3].generic); - ck_assert_msg(check_msg->status[3].specific == 235, "incorrect value for status[3].specific, expected 235, is %d", check_msg->status[3].specific); - ck_assert_msg(check_msg->status[4].component == 34060, "incorrect value for status[4].component, expected 34060, is %d", check_msg->status[4].component); - ck_assert_msg(check_msg->status[4].generic == 9, "incorrect value for status[4].generic, expected 9, is %d", check_msg->status[4].generic); - ck_assert_msg(check_msg->status[4].specific == 30, "incorrect value for status[4].specific, expected 30, is %d", check_msg->status[4].specific); - ck_assert_msg(check_msg->status[5].component == 37295, "incorrect value for status[5].component, expected 37295, is %d", check_msg->status[5].component); - ck_assert_msg(check_msg->status[5].generic == 26, "incorrect value for status[5].generic, expected 26, is %d", check_msg->status[5].generic); - ck_assert_msg(check_msg->status[5].specific == 114, "incorrect value for status[5].specific, expected 114, is %d", check_msg->status[5].specific); - ck_assert_msg(check_msg->status[6].component == 5335, "incorrect value for status[6].component, expected 5335, is %d", check_msg->status[6].component); - ck_assert_msg(check_msg->status[6].generic == 146, "incorrect value for status[6].generic, expected 146, is %d", check_msg->status[6].generic); - ck_assert_msg(check_msg->status[6].specific == 249, "incorrect value for status[6].specific, expected 249, is %d", check_msg->status[6].specific); - ck_assert_msg(check_msg->status[7].component == 13878, "incorrect value for status[7].component, expected 13878, is %d", check_msg->status[7].component); - ck_assert_msg(check_msg->status[7].generic == 133, "incorrect value for status[7].generic, expected 133, is %d", check_msg->status[7].generic); - ck_assert_msg(check_msg->status[7].specific == 193, "incorrect value for status[7].specific, expected 193, is %d", check_msg->status[7].specific); - ck_assert_msg(check_msg->status[8].component == 47722, "incorrect value for status[8].component, expected 47722, is %d", check_msg->status[8].component); - ck_assert_msg(check_msg->status[8].generic == 210, "incorrect value for status[8].generic, expected 210, is %d", check_msg->status[8].generic); - ck_assert_msg(check_msg->status[8].specific == 183, "incorrect value for status[8].specific, expected 183, is %d", check_msg->status[8].specific); - ck_assert_msg(check_msg->status[9].component == 33024, "incorrect value for status[9].component, expected 33024, is %d", check_msg->status[9].component); - ck_assert_msg(check_msg->status[9].generic == 5, "incorrect value for status[9].generic, expected 5, is %d", check_msg->status[9].generic); - ck_assert_msg(check_msg->status[9].specific == 248, "incorrect value for status[9].specific, expected 248, is %d", check_msg->status[9].specific); - ck_assert_msg(check_msg->status[10].component == 38369, "incorrect value for status[10].component, expected 38369, is %d", check_msg->status[10].component); - ck_assert_msg(check_msg->status[10].generic == 135, "incorrect value for status[10].generic, expected 135, is %d", check_msg->status[10].generic); - ck_assert_msg(check_msg->status[10].specific == 127, "incorrect value for status[10].specific, expected 127, is %d", check_msg->status[10].specific); - ck_assert_msg(check_msg->status[11].component == 6658, "incorrect value for status[11].component, expected 6658, is %d", check_msg->status[11].component); - ck_assert_msg(check_msg->status[11].generic == 88, "incorrect value for status[11].generic, expected 88, is %d", check_msg->status[11].generic); - ck_assert_msg(check_msg->status[11].specific == 92, "incorrect value for status[11].specific, expected 92, is %d", check_msg->status[11].specific); - ck_assert_msg(check_msg->status[12].component == 26378, "incorrect value for status[12].component, expected 26378, is %d", check_msg->status[12].component); - ck_assert_msg(check_msg->status[12].generic == 73, "incorrect value for status[12].generic, expected 73, is %d", check_msg->status[12].generic); - ck_assert_msg(check_msg->status[12].specific == 3, "incorrect value for status[12].specific, expected 3, is %d", check_msg->status[12].specific); - ck_assert_msg(check_msg->status[13].component == 17511, "incorrect value for status[13].component, expected 17511, is %d", check_msg->status[13].component); - ck_assert_msg(check_msg->status[13].generic == 76, "incorrect value for status[13].generic, expected 76, is %d", check_msg->status[13].generic); - ck_assert_msg(check_msg->status[13].specific == 184, "incorrect value for status[13].specific, expected 184, is %d", check_msg->status[13].specific); - ck_assert_msg(check_msg->status[14].component == 52769, "incorrect value for status[14].component, expected 52769, is %d", check_msg->status[14].component); - ck_assert_msg(check_msg->status[14].generic == 194, "incorrect value for status[14].generic, expected 194, is %d", check_msg->status[14].generic); - ck_assert_msg(check_msg->status[14].specific == 163, "incorrect value for status[14].specific, expected 163, is %d", check_msg->status[14].specific); - ck_assert_msg(check_msg->status[15].component == 7803, "incorrect value for status[15].component, expected 7803, is %d", check_msg->status[15].component); - ck_assert_msg(check_msg->status[15].generic == 151, "incorrect value for status[15].generic, expected 151, is %d", check_msg->status[15].generic); - ck_assert_msg(check_msg->status[15].specific == 176, "incorrect value for status[15].specific, expected 176, is %d", check_msg->status[15].specific); - ck_assert_msg(check_msg->status[16].component == 44181, "incorrect value for status[16].component, expected 44181, is %d", check_msg->status[16].component); - ck_assert_msg(check_msg->status[16].generic == 184, "incorrect value for status[16].generic, expected 184, is %d", check_msg->status[16].generic); - ck_assert_msg(check_msg->status[16].specific == 231, "incorrect value for status[16].specific, expected 231, is %d", check_msg->status[16].specific); - ck_assert_msg(check_msg->status[17].component == 58998, "incorrect value for status[17].component, expected 58998, is %d", check_msg->status[17].component); - ck_assert_msg(check_msg->status[17].generic == 200, "incorrect value for status[17].generic, expected 200, is %d", check_msg->status[17].generic); - ck_assert_msg(check_msg->status[17].specific == 168, "incorrect value for status[17].specific, expected 168, is %d", check_msg->status[17].specific); - ck_assert_msg(check_msg->status[18].component == 28004, "incorrect value for status[18].component, expected 28004, is %d", check_msg->status[18].component); - ck_assert_msg(check_msg->status[18].generic == 10, "incorrect value for status[18].generic, expected 10, is %d", check_msg->status[18].generic); - ck_assert_msg(check_msg->status[18].specific == 233, "incorrect value for status[18].specific, expected 233, is %d", check_msg->status[18].specific); - ck_assert_msg(check_msg->status[19].component == 15364, "incorrect value for status[19].component, expected 15364, is %d", check_msg->status[19].component); - ck_assert_msg(check_msg->status[19].generic == 247, "incorrect value for status[19].generic, expected 247, is %d", check_msg->status[19].generic); - ck_assert_msg(check_msg->status[19].specific == 82, "incorrect value for status[19].specific, expected 82, is %d", check_msg->status[19].specific); - ck_assert_msg(check_msg->status[20].component == 42711, "incorrect value for status[20].component, expected 42711, is %d", check_msg->status[20].component); - ck_assert_msg(check_msg->status[20].generic == 28, "incorrect value for status[20].generic, expected 28, is %d", check_msg->status[20].generic); - ck_assert_msg(check_msg->status[20].specific == 138, "incorrect value for status[20].specific, expected 138, is %d", check_msg->status[20].specific); - ck_assert_msg(check_msg->status[21].component == 11630, "incorrect value for status[21].component, expected 11630, is %d", check_msg->status[21].component); - ck_assert_msg(check_msg->status[21].generic == 98, "incorrect value for status[21].generic, expected 98, is %d", check_msg->status[21].generic); - ck_assert_msg(check_msg->status[21].specific == 218, "incorrect value for status[21].specific, expected 218, is %d", check_msg->status[21].specific); - ck_assert_msg(check_msg->status[22].component == 46068, "incorrect value for status[22].component, expected 46068, is %d", check_msg->status[22].component); - ck_assert_msg(check_msg->status[22].generic == 126, "incorrect value for status[22].generic, expected 126, is %d", check_msg->status[22].generic); - ck_assert_msg(check_msg->status[22].specific == 107, "incorrect value for status[22].specific, expected 107, is %d", check_msg->status[22].specific); - ck_assert_msg(check_msg->status[23].component == 31836, "incorrect value for status[23].component, expected 31836, is %d", check_msg->status[23].component); - ck_assert_msg(check_msg->status[23].generic == 94, "incorrect value for status[23].generic, expected 94, is %d", check_msg->status[23].generic); - ck_assert_msg(check_msg->status[23].specific == 157, "incorrect value for status[23].specific, expected 157, is %d", check_msg->status[23].specific); - ck_assert_msg(check_msg->status[24].component == 47914, "incorrect value for status[24].component, expected 47914, is %d", check_msg->status[24].component); - ck_assert_msg(check_msg->status[24].generic == 124, "incorrect value for status[24].generic, expected 124, is %d", check_msg->status[24].generic); - ck_assert_msg(check_msg->status[24].specific == 6, "incorrect value for status[24].specific, expected 6, is %d", check_msg->status[24].specific); - ck_assert_msg(check_msg->status[25].component == 63329, "incorrect value for status[25].component, expected 63329, is %d", check_msg->status[25].component); - ck_assert_msg(check_msg->status[25].generic == 160, "incorrect value for status[25].generic, expected 160, is %d", check_msg->status[25].generic); - ck_assert_msg(check_msg->status[25].specific == 188, "incorrect value for status[25].specific, expected 188, is %d", check_msg->status[25].specific); - ck_assert_msg(check_msg->status[26].component == 30830, "incorrect value for status[26].component, expected 30830, is %d", check_msg->status[26].component); - ck_assert_msg(check_msg->status[26].generic == 254, "incorrect value for status[26].generic, expected 254, is %d", check_msg->status[26].generic); - ck_assert_msg(check_msg->status[26].specific == 214, "incorrect value for status[26].specific, expected 214, is %d", check_msg->status[26].specific); - ck_assert_msg(check_msg->status[27].component == 13166, "incorrect value for status[27].component, expected 13166, is %d", check_msg->status[27].component); - ck_assert_msg(check_msg->status[27].generic == 240, "incorrect value for status[27].generic, expected 240, is %d", check_msg->status[27].generic); - ck_assert_msg(check_msg->status[27].specific == 164, "incorrect value for status[27].specific, expected 164, is %d", check_msg->status[27].specific); - ck_assert_msg(check_msg->status[28].component == 4755, "incorrect value for status[28].component, expected 4755, is %d", check_msg->status[28].component); - ck_assert_msg(check_msg->status[28].generic == 74, "incorrect value for status[28].generic, expected 74, is %d", check_msg->status[28].generic); - ck_assert_msg(check_msg->status[28].specific == 178, "incorrect value for status[28].specific, expected 178, is %d", check_msg->status[28].specific); - ck_assert_msg(check_msg->status[29].component == 1091, "incorrect value for status[29].component, expected 1091, is %d", check_msg->status[29].component); - ck_assert_msg(check_msg->status[29].generic == 27, "incorrect value for status[29].generic, expected 27, is %d", check_msg->status[29].generic); - ck_assert_msg(check_msg->status[29].specific == 73, "incorrect value for status[29].specific, expected 73, is %d", check_msg->status[29].specific); - ck_assert_msg(check_msg->status[30].component == 16574, "incorrect value for status[30].component, expected 16574, is %d", check_msg->status[30].component); - ck_assert_msg(check_msg->status[30].generic == 179, "incorrect value for status[30].generic, expected 179, is %d", check_msg->status[30].generic); - ck_assert_msg(check_msg->status[30].specific == 146, "incorrect value for status[30].specific, expected 146, is %d", check_msg->status[30].specific); - ck_assert_msg(check_msg->status[31].component == 39293, "incorrect value for status[31].component, expected 39293, is %d", check_msg->status[31].component); - ck_assert_msg(check_msg->status[31].generic == 192, "incorrect value for status[31].generic, expected 192, is %d", check_msg->status[31].generic); - ck_assert_msg(check_msg->status[31].specific == 46, "incorrect value for status[31].specific, expected 46, is %d", check_msg->status[31].specific); - ck_assert_msg(check_msg->status[32].component == 17098, "incorrect value for status[32].component, expected 17098, is %d", check_msg->status[32].component); - ck_assert_msg(check_msg->status[32].generic == 248, "incorrect value for status[32].generic, expected 248, is %d", check_msg->status[32].generic); - ck_assert_msg(check_msg->status[32].specific == 46, "incorrect value for status[32].specific, expected 46, is %d", check_msg->status[32].specific); - ck_assert_msg(check_msg->status[33].component == 41256, "incorrect value for status[33].component, expected 41256, is %d", check_msg->status[33].component); - ck_assert_msg(check_msg->status[33].generic == 173, "incorrect value for status[33].generic, expected 173, is %d", check_msg->status[33].generic); - ck_assert_msg(check_msg->status[33].specific == 242, "incorrect value for status[33].specific, expected 242, is %d", check_msg->status[33].specific); - ck_assert_msg(check_msg->status[34].component == 982, "incorrect value for status[34].component, expected 982, is %d", check_msg->status[34].component); - ck_assert_msg(check_msg->status[34].generic == 11, "incorrect value for status[34].generic, expected 11, is %d", check_msg->status[34].generic); - ck_assert_msg(check_msg->status[34].specific == 1, "incorrect value for status[34].specific, expected 1, is %d", check_msg->status[34].specific); - ck_assert_msg(check_msg->status[35].component == 18038, "incorrect value for status[35].component, expected 18038, is %d", check_msg->status[35].component); - ck_assert_msg(check_msg->status[35].generic == 162, "incorrect value for status[35].generic, expected 162, is %d", check_msg->status[35].generic); - ck_assert_msg(check_msg->status[35].specific == 61, "incorrect value for status[35].specific, expected 61, is %d", check_msg->status[35].specific); - ck_assert_msg(check_msg->status[36].component == 7090, "incorrect value for status[36].component, expected 7090, is %d", check_msg->status[36].component); - ck_assert_msg(check_msg->status[36].generic == 156, "incorrect value for status[36].generic, expected 156, is %d", check_msg->status[36].generic); - ck_assert_msg(check_msg->status[36].specific == 40, "incorrect value for status[36].specific, expected 40, is %d", check_msg->status[36].specific); - ck_assert_msg(check_msg->status[37].component == 29119, "incorrect value for status[37].component, expected 29119, is %d", check_msg->status[37].component); - ck_assert_msg(check_msg->status[37].generic == 230, "incorrect value for status[37].generic, expected 230, is %d", check_msg->status[37].generic); - ck_assert_msg(check_msg->status[37].specific == 200, "incorrect value for status[37].specific, expected 200, is %d", check_msg->status[37].specific); - ck_assert_msg(check_msg->status[38].component == 2120, "incorrect value for status[38].component, expected 2120, is %d", check_msg->status[38].component); - ck_assert_msg(check_msg->status[38].generic == 215, "incorrect value for status[38].generic, expected 215, is %d", check_msg->status[38].generic); - ck_assert_msg(check_msg->status[38].specific == 245, "incorrect value for status[38].specific, expected 245, is %d", check_msg->status[38].specific); - ck_assert_msg(check_msg->status[39].component == 15182, "incorrect value for status[39].component, expected 15182, is %d", check_msg->status[39].component); - ck_assert_msg(check_msg->status[39].generic == 222, "incorrect value for status[39].generic, expected 222, is %d", check_msg->status[39].generic); - ck_assert_msg(check_msg->status[39].specific == 250, "incorrect value for status[39].specific, expected 250, is %d", check_msg->status[39].specific); - ck_assert_msg(check_msg->status[40].component == 8307, "incorrect value for status[40].component, expected 8307, is %d", check_msg->status[40].component); - ck_assert_msg(check_msg->status[40].generic == 33, "incorrect value for status[40].generic, expected 33, is %d", check_msg->status[40].generic); - ck_assert_msg(check_msg->status[40].specific == 30, "incorrect value for status[40].specific, expected 30, is %d", check_msg->status[40].specific); - ck_assert_msg(check_msg->status[41].component == 43731, "incorrect value for status[41].component, expected 43731, is %d", check_msg->status[41].component); - ck_assert_msg(check_msg->status[41].generic == 145, "incorrect value for status[41].generic, expected 145, is %d", check_msg->status[41].generic); - ck_assert_msg(check_msg->status[41].specific == 92, "incorrect value for status[41].specific, expected 92, is %d", check_msg->status[41].specific); - ck_assert_msg(check_msg->status[42].component == 19357, "incorrect value for status[42].component, expected 19357, is %d", check_msg->status[42].component); - ck_assert_msg(check_msg->status[42].generic == 24, "incorrect value for status[42].generic, expected 24, is %d", check_msg->status[42].generic); - ck_assert_msg(check_msg->status[42].specific == 169, "incorrect value for status[42].specific, expected 169, is %d", check_msg->status[42].specific); - ck_assert_msg(check_msg->status[43].component == 14086, "incorrect value for status[43].component, expected 14086, is %d", check_msg->status[43].component); - ck_assert_msg(check_msg->status[43].generic == 62, "incorrect value for status[43].generic, expected 62, is %d", check_msg->status[43].generic); - ck_assert_msg(check_msg->status[43].specific == 8, "incorrect value for status[43].specific, expected 8, is %d", check_msg->status[43].specific); - ck_assert_msg(check_msg->status[44].component == 21099, "incorrect value for status[44].component, expected 21099, is %d", check_msg->status[44].component); - ck_assert_msg(check_msg->status[44].generic == 140, "incorrect value for status[44].generic, expected 140, is %d", check_msg->status[44].generic); - ck_assert_msg(check_msg->status[44].specific == 49, "incorrect value for status[44].specific, expected 49, is %d", check_msg->status[44].specific); - ck_assert_msg(check_msg->status[45].component == 31411, "incorrect value for status[45].component, expected 31411, is %d", check_msg->status[45].component); - ck_assert_msg(check_msg->status[45].generic == 90, "incorrect value for status[45].generic, expected 90, is %d", check_msg->status[45].generic); - ck_assert_msg(check_msg->status[45].specific == 71, "incorrect value for status[45].specific, expected 71, is %d", check_msg->status[45].specific); - ck_assert_msg(check_msg->status[46].component == 22556, "incorrect value for status[46].component, expected 22556, is %d", check_msg->status[46].component); - ck_assert_msg(check_msg->status[46].generic == 103, "incorrect value for status[46].generic, expected 103, is %d", check_msg->status[46].generic); - ck_assert_msg(check_msg->status[46].specific == 51, "incorrect value for status[46].specific, expected 51, is %d", check_msg->status[46].specific); - ck_assert_msg(check_msg->status[47].component == 18609, "incorrect value for status[47].component, expected 18609, is %d", check_msg->status[47].component); - ck_assert_msg(check_msg->status[47].generic == 93, "incorrect value for status[47].generic, expected 93, is %d", check_msg->status[47].generic); - ck_assert_msg(check_msg->status[47].specific == 39, "incorrect value for status[47].specific, expected 39, is %d", check_msg->status[47].specific); - ck_assert_msg(check_msg->status[48].component == 2964, "incorrect value for status[48].component, expected 2964, is %d", check_msg->status[48].component); - ck_assert_msg(check_msg->status[48].generic == 202, "incorrect value for status[48].generic, expected 202, is %d", check_msg->status[48].generic); - ck_assert_msg(check_msg->status[48].specific == 42, "incorrect value for status[48].specific, expected 42, is %d", check_msg->status[48].specific); - ck_assert_msg(check_msg->status[49].component == 23586, "incorrect value for status[49].component, expected 23586, is %d", check_msg->status[49].component); - ck_assert_msg(check_msg->status[49].generic == 204, "incorrect value for status[49].generic, expected 204, is %d", check_msg->status[49].generic); - ck_assert_msg(check_msg->status[49].specific == 102, "incorrect value for status[49].specific, expected 102, is %d", check_msg->status[49].specific); - ck_assert_msg(check_msg->status[50].component == 25117, "incorrect value for status[50].component, expected 25117, is %d", check_msg->status[50].component); - ck_assert_msg(check_msg->status[50].generic == 249, "incorrect value for status[50].generic, expected 249, is %d", check_msg->status[50].generic); - ck_assert_msg(check_msg->status[50].specific == 91, "incorrect value for status[50].specific, expected 91, is %d", check_msg->status[50].specific); - ck_assert_msg(check_msg->status[51].component == 24454, "incorrect value for status[51].component, expected 24454, is %d", check_msg->status[51].component); - ck_assert_msg(check_msg->status[51].generic == 23, "incorrect value for status[51].generic, expected 23, is %d", check_msg->status[51].generic); - ck_assert_msg(check_msg->status[51].specific == 248, "incorrect value for status[51].specific, expected 248, is %d", check_msg->status[51].specific); - ck_assert_msg(check_msg->status[52].component == 5312, "incorrect value for status[52].component, expected 5312, is %d", check_msg->status[52].component); - ck_assert_msg(check_msg->status[52].generic == 83, "incorrect value for status[52].generic, expected 83, is %d", check_msg->status[52].generic); - ck_assert_msg(check_msg->status[52].specific == 195, "incorrect value for status[52].specific, expected 195, is %d", check_msg->status[52].specific); - ck_assert_msg(check_msg->status[53].component == 46175, "incorrect value for status[53].component, expected 46175, is %d", check_msg->status[53].component); - ck_assert_msg(check_msg->status[53].generic == 54, "incorrect value for status[53].generic, expected 54, is %d", check_msg->status[53].generic); - ck_assert_msg(check_msg->status[53].specific == 36, "incorrect value for status[53].specific, expected 36, is %d", check_msg->status[53].specific); - ck_assert_msg(check_msg->status[54].component == 19386, "incorrect value for status[54].component, expected 19386, is %d", check_msg->status[54].component); - ck_assert_msg(check_msg->status[54].generic == 64, "incorrect value for status[54].generic, expected 64, is %d", check_msg->status[54].generic); - ck_assert_msg(check_msg->status[54].specific == 20, "incorrect value for status[54].specific, expected 20, is %d", check_msg->status[54].specific); - ck_assert_msg(check_msg->status[55].component == 34205, "incorrect value for status[55].component, expected 34205, is %d", check_msg->status[55].component); - ck_assert_msg(check_msg->status[55].generic == 12, "incorrect value for status[55].generic, expected 12, is %d", check_msg->status[55].generic); - ck_assert_msg(check_msg->status[55].specific == 149, "incorrect value for status[55].specific, expected 149, is %d", check_msg->status[55].specific); - ck_assert_msg(check_msg->status[56].component == 3612, "incorrect value for status[56].component, expected 3612, is %d", check_msg->status[56].component); - ck_assert_msg(check_msg->status[56].generic == 185, "incorrect value for status[56].generic, expected 185, is %d", check_msg->status[56].generic); - ck_assert_msg(check_msg->status[56].specific == 129, "incorrect value for status[56].specific, expected 129, is %d", check_msg->status[56].specific); - ck_assert_msg(check_msg->status[57].component == 61285, "incorrect value for status[57].component, expected 61285, is %d", check_msg->status[57].component); - ck_assert_msg(check_msg->status[57].generic == 74, "incorrect value for status[57].generic, expected 74, is %d", check_msg->status[57].generic); - ck_assert_msg(check_msg->status[57].specific == 248, "incorrect value for status[57].specific, expected 248, is %d", check_msg->status[57].specific); - ck_assert_msg(check_msg->status[58].component == 7925, "incorrect value for status[58].component, expected 7925, is %d", check_msg->status[58].component); - ck_assert_msg(check_msg->status[58].generic == 228, "incorrect value for status[58].generic, expected 228, is %d", check_msg->status[58].generic); - ck_assert_msg(check_msg->status[58].specific == 88, "incorrect value for status[58].specific, expected 88, is %d", check_msg->status[58].specific); - ck_assert_msg(check_msg->status[59].component == 54414, "incorrect value for status[59].component, expected 54414, is %d", check_msg->status[59].component); - ck_assert_msg(check_msg->status[59].generic == 53, "incorrect value for status[59].generic, expected 53, is %d", check_msg->status[59].generic); - ck_assert_msg(check_msg->status[59].specific == 224, "incorrect value for status[59].specific, expected 224, is %d", check_msg->status[59].specific); - ck_assert_msg(check_msg->uptime == 1657804265, "incorrect value for uptime, expected 1657804265, is %d", check_msg->uptime); + ck_assert_msg(check_msg->reporting_system == 64850, + "incorrect value for reporting_system, expected 64850, is %d", + check_msg->reporting_system); + ck_assert_msg(check_msg->sbp_version == 24497, + "incorrect value for sbp_version, expected 24497, is %d", + check_msg->sbp_version); + ck_assert_msg(check_msg->sequence == 1519336451, + "incorrect value for sequence, expected 1519336451, is %d", + check_msg->sequence); + ck_assert_msg( + check_msg->status[0].component == 52215, + "incorrect value for status[0].component, expected 52215, is %d", + check_msg->status[0].component); + ck_assert_msg(check_msg->status[0].generic == 221, + "incorrect value for status[0].generic, expected 221, is %d", + check_msg->status[0].generic); + ck_assert_msg(check_msg->status[0].specific == 198, + "incorrect value for status[0].specific, expected 198, is %d", + check_msg->status[0].specific); + ck_assert_msg( + check_msg->status[1].component == 53148, + "incorrect value for status[1].component, expected 53148, is %d", + check_msg->status[1].component); + ck_assert_msg(check_msg->status[1].generic == 217, + "incorrect value for status[1].generic, expected 217, is %d", + check_msg->status[1].generic); + ck_assert_msg(check_msg->status[1].specific == 238, + "incorrect value for status[1].specific, expected 238, is %d", + check_msg->status[1].specific); + ck_assert_msg( + check_msg->status[2].component == 34978, + "incorrect value for status[2].component, expected 34978, is %d", + check_msg->status[2].component); + ck_assert_msg(check_msg->status[2].generic == 154, + "incorrect value for status[2].generic, expected 154, is %d", + check_msg->status[2].generic); + ck_assert_msg(check_msg->status[2].specific == 11, + "incorrect value for status[2].specific, expected 11, is %d", + check_msg->status[2].specific); + ck_assert_msg( + check_msg->status[3].component == 60530, + "incorrect value for status[3].component, expected 60530, is %d", + check_msg->status[3].component); + ck_assert_msg(check_msg->status[3].generic == 134, + "incorrect value for status[3].generic, expected 134, is %d", + check_msg->status[3].generic); + ck_assert_msg(check_msg->status[3].specific == 235, + "incorrect value for status[3].specific, expected 235, is %d", + check_msg->status[3].specific); + ck_assert_msg( + check_msg->status[4].component == 34060, + "incorrect value for status[4].component, expected 34060, is %d", + check_msg->status[4].component); + ck_assert_msg(check_msg->status[4].generic == 9, + "incorrect value for status[4].generic, expected 9, is %d", + check_msg->status[4].generic); + ck_assert_msg(check_msg->status[4].specific == 30, + "incorrect value for status[4].specific, expected 30, is %d", + check_msg->status[4].specific); + ck_assert_msg( + check_msg->status[5].component == 37295, + "incorrect value for status[5].component, expected 37295, is %d", + check_msg->status[5].component); + ck_assert_msg(check_msg->status[5].generic == 26, + "incorrect value for status[5].generic, expected 26, is %d", + check_msg->status[5].generic); + ck_assert_msg(check_msg->status[5].specific == 114, + "incorrect value for status[5].specific, expected 114, is %d", + check_msg->status[5].specific); + ck_assert_msg( + check_msg->status[6].component == 5335, + "incorrect value for status[6].component, expected 5335, is %d", + check_msg->status[6].component); + ck_assert_msg(check_msg->status[6].generic == 146, + "incorrect value for status[6].generic, expected 146, is %d", + check_msg->status[6].generic); + ck_assert_msg(check_msg->status[6].specific == 249, + "incorrect value for status[6].specific, expected 249, is %d", + check_msg->status[6].specific); + ck_assert_msg( + check_msg->status[7].component == 13878, + "incorrect value for status[7].component, expected 13878, is %d", + check_msg->status[7].component); + ck_assert_msg(check_msg->status[7].generic == 133, + "incorrect value for status[7].generic, expected 133, is %d", + check_msg->status[7].generic); + ck_assert_msg(check_msg->status[7].specific == 193, + "incorrect value for status[7].specific, expected 193, is %d", + check_msg->status[7].specific); + ck_assert_msg( + check_msg->status[8].component == 47722, + "incorrect value for status[8].component, expected 47722, is %d", + check_msg->status[8].component); + ck_assert_msg(check_msg->status[8].generic == 210, + "incorrect value for status[8].generic, expected 210, is %d", + check_msg->status[8].generic); + ck_assert_msg(check_msg->status[8].specific == 183, + "incorrect value for status[8].specific, expected 183, is %d", + check_msg->status[8].specific); + ck_assert_msg( + check_msg->status[9].component == 33024, + "incorrect value for status[9].component, expected 33024, is %d", + check_msg->status[9].component); + ck_assert_msg(check_msg->status[9].generic == 5, + "incorrect value for status[9].generic, expected 5, is %d", + check_msg->status[9].generic); + ck_assert_msg(check_msg->status[9].specific == 248, + "incorrect value for status[9].specific, expected 248, is %d", + check_msg->status[9].specific); + ck_assert_msg( + check_msg->status[10].component == 38369, + "incorrect value for status[10].component, expected 38369, is %d", + check_msg->status[10].component); + ck_assert_msg(check_msg->status[10].generic == 135, + "incorrect value for status[10].generic, expected 135, is %d", + check_msg->status[10].generic); + ck_assert_msg( + check_msg->status[10].specific == 127, + "incorrect value for status[10].specific, expected 127, is %d", + check_msg->status[10].specific); + ck_assert_msg( + check_msg->status[11].component == 6658, + "incorrect value for status[11].component, expected 6658, is %d", + check_msg->status[11].component); + ck_assert_msg(check_msg->status[11].generic == 88, + "incorrect value for status[11].generic, expected 88, is %d", + check_msg->status[11].generic); + ck_assert_msg(check_msg->status[11].specific == 92, + "incorrect value for status[11].specific, expected 92, is %d", + check_msg->status[11].specific); + ck_assert_msg( + check_msg->status[12].component == 26378, + "incorrect value for status[12].component, expected 26378, is %d", + check_msg->status[12].component); + ck_assert_msg(check_msg->status[12].generic == 73, + "incorrect value for status[12].generic, expected 73, is %d", + check_msg->status[12].generic); + ck_assert_msg(check_msg->status[12].specific == 3, + "incorrect value for status[12].specific, expected 3, is %d", + check_msg->status[12].specific); + ck_assert_msg( + check_msg->status[13].component == 17511, + "incorrect value for status[13].component, expected 17511, is %d", + check_msg->status[13].component); + ck_assert_msg(check_msg->status[13].generic == 76, + "incorrect value for status[13].generic, expected 76, is %d", + check_msg->status[13].generic); + ck_assert_msg( + check_msg->status[13].specific == 184, + "incorrect value for status[13].specific, expected 184, is %d", + check_msg->status[13].specific); + ck_assert_msg( + check_msg->status[14].component == 52769, + "incorrect value for status[14].component, expected 52769, is %d", + check_msg->status[14].component); + ck_assert_msg(check_msg->status[14].generic == 194, + "incorrect value for status[14].generic, expected 194, is %d", + check_msg->status[14].generic); + ck_assert_msg( + check_msg->status[14].specific == 163, + "incorrect value for status[14].specific, expected 163, is %d", + check_msg->status[14].specific); + ck_assert_msg( + check_msg->status[15].component == 7803, + "incorrect value for status[15].component, expected 7803, is %d", + check_msg->status[15].component); + ck_assert_msg(check_msg->status[15].generic == 151, + "incorrect value for status[15].generic, expected 151, is %d", + check_msg->status[15].generic); + ck_assert_msg( + check_msg->status[15].specific == 176, + "incorrect value for status[15].specific, expected 176, is %d", + check_msg->status[15].specific); + ck_assert_msg( + check_msg->status[16].component == 44181, + "incorrect value for status[16].component, expected 44181, is %d", + check_msg->status[16].component); + ck_assert_msg(check_msg->status[16].generic == 184, + "incorrect value for status[16].generic, expected 184, is %d", + check_msg->status[16].generic); + ck_assert_msg( + check_msg->status[16].specific == 231, + "incorrect value for status[16].specific, expected 231, is %d", + check_msg->status[16].specific); + ck_assert_msg( + check_msg->status[17].component == 58998, + "incorrect value for status[17].component, expected 58998, is %d", + check_msg->status[17].component); + ck_assert_msg(check_msg->status[17].generic == 200, + "incorrect value for status[17].generic, expected 200, is %d", + check_msg->status[17].generic); + ck_assert_msg( + check_msg->status[17].specific == 168, + "incorrect value for status[17].specific, expected 168, is %d", + check_msg->status[17].specific); + ck_assert_msg( + check_msg->status[18].component == 28004, + "incorrect value for status[18].component, expected 28004, is %d", + check_msg->status[18].component); + ck_assert_msg(check_msg->status[18].generic == 10, + "incorrect value for status[18].generic, expected 10, is %d", + check_msg->status[18].generic); + ck_assert_msg( + check_msg->status[18].specific == 233, + "incorrect value for status[18].specific, expected 233, is %d", + check_msg->status[18].specific); + ck_assert_msg( + check_msg->status[19].component == 15364, + "incorrect value for status[19].component, expected 15364, is %d", + check_msg->status[19].component); + ck_assert_msg(check_msg->status[19].generic == 247, + "incorrect value for status[19].generic, expected 247, is %d", + check_msg->status[19].generic); + ck_assert_msg(check_msg->status[19].specific == 82, + "incorrect value for status[19].specific, expected 82, is %d", + check_msg->status[19].specific); + ck_assert_msg( + check_msg->status[20].component == 42711, + "incorrect value for status[20].component, expected 42711, is %d", + check_msg->status[20].component); + ck_assert_msg(check_msg->status[20].generic == 28, + "incorrect value for status[20].generic, expected 28, is %d", + check_msg->status[20].generic); + ck_assert_msg( + check_msg->status[20].specific == 138, + "incorrect value for status[20].specific, expected 138, is %d", + check_msg->status[20].specific); + ck_assert_msg( + check_msg->status[21].component == 11630, + "incorrect value for status[21].component, expected 11630, is %d", + check_msg->status[21].component); + ck_assert_msg(check_msg->status[21].generic == 98, + "incorrect value for status[21].generic, expected 98, is %d", + check_msg->status[21].generic); + ck_assert_msg( + check_msg->status[21].specific == 218, + "incorrect value for status[21].specific, expected 218, is %d", + check_msg->status[21].specific); + ck_assert_msg( + check_msg->status[22].component == 46068, + "incorrect value for status[22].component, expected 46068, is %d", + check_msg->status[22].component); + ck_assert_msg(check_msg->status[22].generic == 126, + "incorrect value for status[22].generic, expected 126, is %d", + check_msg->status[22].generic); + ck_assert_msg( + check_msg->status[22].specific == 107, + "incorrect value for status[22].specific, expected 107, is %d", + check_msg->status[22].specific); + ck_assert_msg( + check_msg->status[23].component == 31836, + "incorrect value for status[23].component, expected 31836, is %d", + check_msg->status[23].component); + ck_assert_msg(check_msg->status[23].generic == 94, + "incorrect value for status[23].generic, expected 94, is %d", + check_msg->status[23].generic); + ck_assert_msg( + check_msg->status[23].specific == 157, + "incorrect value for status[23].specific, expected 157, is %d", + check_msg->status[23].specific); + ck_assert_msg( + check_msg->status[24].component == 47914, + "incorrect value for status[24].component, expected 47914, is %d", + check_msg->status[24].component); + ck_assert_msg(check_msg->status[24].generic == 124, + "incorrect value for status[24].generic, expected 124, is %d", + check_msg->status[24].generic); + ck_assert_msg(check_msg->status[24].specific == 6, + "incorrect value for status[24].specific, expected 6, is %d", + check_msg->status[24].specific); + ck_assert_msg( + check_msg->status[25].component == 63329, + "incorrect value for status[25].component, expected 63329, is %d", + check_msg->status[25].component); + ck_assert_msg(check_msg->status[25].generic == 160, + "incorrect value for status[25].generic, expected 160, is %d", + check_msg->status[25].generic); + ck_assert_msg( + check_msg->status[25].specific == 188, + "incorrect value for status[25].specific, expected 188, is %d", + check_msg->status[25].specific); + ck_assert_msg( + check_msg->status[26].component == 30830, + "incorrect value for status[26].component, expected 30830, is %d", + check_msg->status[26].component); + ck_assert_msg(check_msg->status[26].generic == 254, + "incorrect value for status[26].generic, expected 254, is %d", + check_msg->status[26].generic); + ck_assert_msg( + check_msg->status[26].specific == 214, + "incorrect value for status[26].specific, expected 214, is %d", + check_msg->status[26].specific); + ck_assert_msg( + check_msg->status[27].component == 13166, + "incorrect value for status[27].component, expected 13166, is %d", + check_msg->status[27].component); + ck_assert_msg(check_msg->status[27].generic == 240, + "incorrect value for status[27].generic, expected 240, is %d", + check_msg->status[27].generic); + ck_assert_msg( + check_msg->status[27].specific == 164, + "incorrect value for status[27].specific, expected 164, is %d", + check_msg->status[27].specific); + ck_assert_msg( + check_msg->status[28].component == 4755, + "incorrect value for status[28].component, expected 4755, is %d", + check_msg->status[28].component); + ck_assert_msg(check_msg->status[28].generic == 74, + "incorrect value for status[28].generic, expected 74, is %d", + check_msg->status[28].generic); + ck_assert_msg( + check_msg->status[28].specific == 178, + "incorrect value for status[28].specific, expected 178, is %d", + check_msg->status[28].specific); + ck_assert_msg( + check_msg->status[29].component == 1091, + "incorrect value for status[29].component, expected 1091, is %d", + check_msg->status[29].component); + ck_assert_msg(check_msg->status[29].generic == 27, + "incorrect value for status[29].generic, expected 27, is %d", + check_msg->status[29].generic); + ck_assert_msg(check_msg->status[29].specific == 73, + "incorrect value for status[29].specific, expected 73, is %d", + check_msg->status[29].specific); + ck_assert_msg( + check_msg->status[30].component == 16574, + "incorrect value for status[30].component, expected 16574, is %d", + check_msg->status[30].component); + ck_assert_msg(check_msg->status[30].generic == 179, + "incorrect value for status[30].generic, expected 179, is %d", + check_msg->status[30].generic); + ck_assert_msg( + check_msg->status[30].specific == 146, + "incorrect value for status[30].specific, expected 146, is %d", + check_msg->status[30].specific); + ck_assert_msg( + check_msg->status[31].component == 39293, + "incorrect value for status[31].component, expected 39293, is %d", + check_msg->status[31].component); + ck_assert_msg(check_msg->status[31].generic == 192, + "incorrect value for status[31].generic, expected 192, is %d", + check_msg->status[31].generic); + ck_assert_msg(check_msg->status[31].specific == 46, + "incorrect value for status[31].specific, expected 46, is %d", + check_msg->status[31].specific); + ck_assert_msg( + check_msg->status[32].component == 17098, + "incorrect value for status[32].component, expected 17098, is %d", + check_msg->status[32].component); + ck_assert_msg(check_msg->status[32].generic == 248, + "incorrect value for status[32].generic, expected 248, is %d", + check_msg->status[32].generic); + ck_assert_msg(check_msg->status[32].specific == 46, + "incorrect value for status[32].specific, expected 46, is %d", + check_msg->status[32].specific); + ck_assert_msg( + check_msg->status[33].component == 41256, + "incorrect value for status[33].component, expected 41256, is %d", + check_msg->status[33].component); + ck_assert_msg(check_msg->status[33].generic == 173, + "incorrect value for status[33].generic, expected 173, is %d", + check_msg->status[33].generic); + ck_assert_msg( + check_msg->status[33].specific == 242, + "incorrect value for status[33].specific, expected 242, is %d", + check_msg->status[33].specific); + ck_assert_msg( + check_msg->status[34].component == 982, + "incorrect value for status[34].component, expected 982, is %d", + check_msg->status[34].component); + ck_assert_msg(check_msg->status[34].generic == 11, + "incorrect value for status[34].generic, expected 11, is %d", + check_msg->status[34].generic); + ck_assert_msg(check_msg->status[34].specific == 1, + "incorrect value for status[34].specific, expected 1, is %d", + check_msg->status[34].specific); + ck_assert_msg( + check_msg->status[35].component == 18038, + "incorrect value for status[35].component, expected 18038, is %d", + check_msg->status[35].component); + ck_assert_msg(check_msg->status[35].generic == 162, + "incorrect value for status[35].generic, expected 162, is %d", + check_msg->status[35].generic); + ck_assert_msg(check_msg->status[35].specific == 61, + "incorrect value for status[35].specific, expected 61, is %d", + check_msg->status[35].specific); + ck_assert_msg( + check_msg->status[36].component == 7090, + "incorrect value for status[36].component, expected 7090, is %d", + check_msg->status[36].component); + ck_assert_msg(check_msg->status[36].generic == 156, + "incorrect value for status[36].generic, expected 156, is %d", + check_msg->status[36].generic); + ck_assert_msg(check_msg->status[36].specific == 40, + "incorrect value for status[36].specific, expected 40, is %d", + check_msg->status[36].specific); + ck_assert_msg( + check_msg->status[37].component == 29119, + "incorrect value for status[37].component, expected 29119, is %d", + check_msg->status[37].component); + ck_assert_msg(check_msg->status[37].generic == 230, + "incorrect value for status[37].generic, expected 230, is %d", + check_msg->status[37].generic); + ck_assert_msg( + check_msg->status[37].specific == 200, + "incorrect value for status[37].specific, expected 200, is %d", + check_msg->status[37].specific); + ck_assert_msg( + check_msg->status[38].component == 2120, + "incorrect value for status[38].component, expected 2120, is %d", + check_msg->status[38].component); + ck_assert_msg(check_msg->status[38].generic == 215, + "incorrect value for status[38].generic, expected 215, is %d", + check_msg->status[38].generic); + ck_assert_msg( + check_msg->status[38].specific == 245, + "incorrect value for status[38].specific, expected 245, is %d", + check_msg->status[38].specific); + ck_assert_msg( + check_msg->status[39].component == 15182, + "incorrect value for status[39].component, expected 15182, is %d", + check_msg->status[39].component); + ck_assert_msg(check_msg->status[39].generic == 222, + "incorrect value for status[39].generic, expected 222, is %d", + check_msg->status[39].generic); + ck_assert_msg( + check_msg->status[39].specific == 250, + "incorrect value for status[39].specific, expected 250, is %d", + check_msg->status[39].specific); + ck_assert_msg( + check_msg->status[40].component == 8307, + "incorrect value for status[40].component, expected 8307, is %d", + check_msg->status[40].component); + ck_assert_msg(check_msg->status[40].generic == 33, + "incorrect value for status[40].generic, expected 33, is %d", + check_msg->status[40].generic); + ck_assert_msg(check_msg->status[40].specific == 30, + "incorrect value for status[40].specific, expected 30, is %d", + check_msg->status[40].specific); + ck_assert_msg( + check_msg->status[41].component == 43731, + "incorrect value for status[41].component, expected 43731, is %d", + check_msg->status[41].component); + ck_assert_msg(check_msg->status[41].generic == 145, + "incorrect value for status[41].generic, expected 145, is %d", + check_msg->status[41].generic); + ck_assert_msg(check_msg->status[41].specific == 92, + "incorrect value for status[41].specific, expected 92, is %d", + check_msg->status[41].specific); + ck_assert_msg( + check_msg->status[42].component == 19357, + "incorrect value for status[42].component, expected 19357, is %d", + check_msg->status[42].component); + ck_assert_msg(check_msg->status[42].generic == 24, + "incorrect value for status[42].generic, expected 24, is %d", + check_msg->status[42].generic); + ck_assert_msg( + check_msg->status[42].specific == 169, + "incorrect value for status[42].specific, expected 169, is %d", + check_msg->status[42].specific); + ck_assert_msg( + check_msg->status[43].component == 14086, + "incorrect value for status[43].component, expected 14086, is %d", + check_msg->status[43].component); + ck_assert_msg(check_msg->status[43].generic == 62, + "incorrect value for status[43].generic, expected 62, is %d", + check_msg->status[43].generic); + ck_assert_msg(check_msg->status[43].specific == 8, + "incorrect value for status[43].specific, expected 8, is %d", + check_msg->status[43].specific); + ck_assert_msg( + check_msg->status[44].component == 21099, + "incorrect value for status[44].component, expected 21099, is %d", + check_msg->status[44].component); + ck_assert_msg(check_msg->status[44].generic == 140, + "incorrect value for status[44].generic, expected 140, is %d", + check_msg->status[44].generic); + ck_assert_msg(check_msg->status[44].specific == 49, + "incorrect value for status[44].specific, expected 49, is %d", + check_msg->status[44].specific); + ck_assert_msg( + check_msg->status[45].component == 31411, + "incorrect value for status[45].component, expected 31411, is %d", + check_msg->status[45].component); + ck_assert_msg(check_msg->status[45].generic == 90, + "incorrect value for status[45].generic, expected 90, is %d", + check_msg->status[45].generic); + ck_assert_msg(check_msg->status[45].specific == 71, + "incorrect value for status[45].specific, expected 71, is %d", + check_msg->status[45].specific); + ck_assert_msg( + check_msg->status[46].component == 22556, + "incorrect value for status[46].component, expected 22556, is %d", + check_msg->status[46].component); + ck_assert_msg(check_msg->status[46].generic == 103, + "incorrect value for status[46].generic, expected 103, is %d", + check_msg->status[46].generic); + ck_assert_msg(check_msg->status[46].specific == 51, + "incorrect value for status[46].specific, expected 51, is %d", + check_msg->status[46].specific); + ck_assert_msg( + check_msg->status[47].component == 18609, + "incorrect value for status[47].component, expected 18609, is %d", + check_msg->status[47].component); + ck_assert_msg(check_msg->status[47].generic == 93, + "incorrect value for status[47].generic, expected 93, is %d", + check_msg->status[47].generic); + ck_assert_msg(check_msg->status[47].specific == 39, + "incorrect value for status[47].specific, expected 39, is %d", + check_msg->status[47].specific); + ck_assert_msg( + check_msg->status[48].component == 2964, + "incorrect value for status[48].component, expected 2964, is %d", + check_msg->status[48].component); + ck_assert_msg(check_msg->status[48].generic == 202, + "incorrect value for status[48].generic, expected 202, is %d", + check_msg->status[48].generic); + ck_assert_msg(check_msg->status[48].specific == 42, + "incorrect value for status[48].specific, expected 42, is %d", + check_msg->status[48].specific); + ck_assert_msg( + check_msg->status[49].component == 23586, + "incorrect value for status[49].component, expected 23586, is %d", + check_msg->status[49].component); + ck_assert_msg(check_msg->status[49].generic == 204, + "incorrect value for status[49].generic, expected 204, is %d", + check_msg->status[49].generic); + ck_assert_msg( + check_msg->status[49].specific == 102, + "incorrect value for status[49].specific, expected 102, is %d", + check_msg->status[49].specific); + ck_assert_msg( + check_msg->status[50].component == 25117, + "incorrect value for status[50].component, expected 25117, is %d", + check_msg->status[50].component); + ck_assert_msg(check_msg->status[50].generic == 249, + "incorrect value for status[50].generic, expected 249, is %d", + check_msg->status[50].generic); + ck_assert_msg(check_msg->status[50].specific == 91, + "incorrect value for status[50].specific, expected 91, is %d", + check_msg->status[50].specific); + ck_assert_msg( + check_msg->status[51].component == 24454, + "incorrect value for status[51].component, expected 24454, is %d", + check_msg->status[51].component); + ck_assert_msg(check_msg->status[51].generic == 23, + "incorrect value for status[51].generic, expected 23, is %d", + check_msg->status[51].generic); + ck_assert_msg( + check_msg->status[51].specific == 248, + "incorrect value for status[51].specific, expected 248, is %d", + check_msg->status[51].specific); + ck_assert_msg( + check_msg->status[52].component == 5312, + "incorrect value for status[52].component, expected 5312, is %d", + check_msg->status[52].component); + ck_assert_msg(check_msg->status[52].generic == 83, + "incorrect value for status[52].generic, expected 83, is %d", + check_msg->status[52].generic); + ck_assert_msg( + check_msg->status[52].specific == 195, + "incorrect value for status[52].specific, expected 195, is %d", + check_msg->status[52].specific); + ck_assert_msg( + check_msg->status[53].component == 46175, + "incorrect value for status[53].component, expected 46175, is %d", + check_msg->status[53].component); + ck_assert_msg(check_msg->status[53].generic == 54, + "incorrect value for status[53].generic, expected 54, is %d", + check_msg->status[53].generic); + ck_assert_msg(check_msg->status[53].specific == 36, + "incorrect value for status[53].specific, expected 36, is %d", + check_msg->status[53].specific); + ck_assert_msg( + check_msg->status[54].component == 19386, + "incorrect value for status[54].component, expected 19386, is %d", + check_msg->status[54].component); + ck_assert_msg(check_msg->status[54].generic == 64, + "incorrect value for status[54].generic, expected 64, is %d", + check_msg->status[54].generic); + ck_assert_msg(check_msg->status[54].specific == 20, + "incorrect value for status[54].specific, expected 20, is %d", + check_msg->status[54].specific); + ck_assert_msg( + check_msg->status[55].component == 34205, + "incorrect value for status[55].component, expected 34205, is %d", + check_msg->status[55].component); + ck_assert_msg(check_msg->status[55].generic == 12, + "incorrect value for status[55].generic, expected 12, is %d", + check_msg->status[55].generic); + ck_assert_msg( + check_msg->status[55].specific == 149, + "incorrect value for status[55].specific, expected 149, is %d", + check_msg->status[55].specific); + ck_assert_msg( + check_msg->status[56].component == 3612, + "incorrect value for status[56].component, expected 3612, is %d", + check_msg->status[56].component); + ck_assert_msg(check_msg->status[56].generic == 185, + "incorrect value for status[56].generic, expected 185, is %d", + check_msg->status[56].generic); + ck_assert_msg( + check_msg->status[56].specific == 129, + "incorrect value for status[56].specific, expected 129, is %d", + check_msg->status[56].specific); + ck_assert_msg( + check_msg->status[57].component == 61285, + "incorrect value for status[57].component, expected 61285, is %d", + check_msg->status[57].component); + ck_assert_msg(check_msg->status[57].generic == 74, + "incorrect value for status[57].generic, expected 74, is %d", + check_msg->status[57].generic); + ck_assert_msg( + check_msg->status[57].specific == 248, + "incorrect value for status[57].specific, expected 248, is %d", + check_msg->status[57].specific); + ck_assert_msg( + check_msg->status[58].component == 7925, + "incorrect value for status[58].component, expected 7925, is %d", + check_msg->status[58].component); + ck_assert_msg(check_msg->status[58].generic == 228, + "incorrect value for status[58].generic, expected 228, is %d", + check_msg->status[58].generic); + ck_assert_msg(check_msg->status[58].specific == 88, + "incorrect value for status[58].specific, expected 88, is %d", + check_msg->status[58].specific); + ck_assert_msg( + check_msg->status[59].component == 54414, + "incorrect value for status[59].component, expected 54414, is %d", + check_msg->status[59].component); + ck_assert_msg(check_msg->status[59].generic == 53, + "incorrect value for status[59].generic, expected 53, is %d", + check_msg->status[59].generic); + ck_assert_msg( + check_msg->status[59].specific == 224, + "incorrect value for status[59].specific, expected 224, is %d", + check_msg->status[59].specific); + ck_assert_msg(check_msg->uptime == 1657804265, + "incorrect value for uptime, expected 1657804265, is %d", + check_msg->uptime); } } END_TEST -Suite* legacy_auto_check_sbp_system_MsgStatusReport_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_system_MsgStatusReport"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_system_MsgStatusReport"); +Suite *legacy_auto_check_sbp_system_MsgStatusReport_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_system_MsgStatusReport"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_system_MsgStatusReport"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_system_MsgStatusReport); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_telemetry_MsgTelSv.c b/c/test/legacy/auto_check_sbp_telemetry_MsgTelSv.c index 9a40c1ad8..70a013b2d 100644 --- a/c/test/legacy/auto_check_sbp_telemetry_MsgTelSv.c +++ b/c/test/legacy/auto_check_sbp_telemetry_MsgTelSv.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/telemetry/test_MsgTelSv.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/telemetry/test_MsgTelSv.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_telemetry_MsgTelSv ) -{ +START_TEST(test_legacy_auto_check_sbp_telemetry_MsgTelSv) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_telemetry_MsgTelSv ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_telemetry_MsgTelSv ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x120, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x120, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x120, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x120, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,32,1,148,38,20,175,8,208,221,62,24,16,1,40,50,5,226,255,1,0,1,1,1,33,12,39,105, }; + u8 encoded_frame[] = { + 85, 32, 1, 148, 38, 20, 175, 8, 208, 221, 62, 24, 16, 1, + 40, 50, 5, 226, 255, 1, 0, 1, 1, 1, 33, 12, 39, 105, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tel_sv_t* test_msg = ( msg_tel_sv_t* )test_msg_storage; + msg_tel_sv_t *test_msg = (msg_tel_sv_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->n_obs = 16; test_msg->origin_flags = 1; @@ -161,76 +163,117 @@ START_TEST( test_legacy_auto_check_sbp_telemetry_MsgTelSv ) test_msg->sv_tel[0].sid.sat = 33; test_msg->tow = 406773200; test_msg->wn = 2223; - sbp_payload_send(&sbp_state, 0x120, 9876, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x120, 9876, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 9876, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 9876, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x120, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tel_sv_t* check_msg = ( msg_tel_sv_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tel_sv_t *check_msg = (msg_tel_sv_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->n_obs == 16, "incorrect value for n_obs, expected 16, is %d", check_msg->n_obs); - ck_assert_msg(check_msg->origin_flags == 1, "incorrect value for origin_flags, expected 1, is %d", check_msg->origin_flags); - ck_assert_msg(check_msg->sv_tel[0].availability_flags == 5, "incorrect value for sv_tel[0].availability_flags, expected 5, is %d", check_msg->sv_tel[0].availability_flags); - ck_assert_msg(check_msg->sv_tel[0].az == 40, "incorrect value for sv_tel[0].az, expected 40, is %d", check_msg->sv_tel[0].az); - ck_assert_msg(check_msg->sv_tel[0].correction_flags == 1, "incorrect value for sv_tel[0].correction_flags, expected 1, is %d", check_msg->sv_tel[0].correction_flags); - ck_assert_msg(check_msg->sv_tel[0].el == 50, "incorrect value for sv_tel[0].el, expected 50, is %d", check_msg->sv_tel[0].el); - ck_assert_msg(check_msg->sv_tel[0].ephemeris_flags == 1, "incorrect value for sv_tel[0].ephemeris_flags, expected 1, is %d", check_msg->sv_tel[0].ephemeris_flags); - ck_assert_msg(check_msg->sv_tel[0].outlier_flags == 1, "incorrect value for sv_tel[0].outlier_flags, expected 1, is %d", check_msg->sv_tel[0].outlier_flags); - ck_assert_msg(check_msg->sv_tel[0].phase_residual == 1, "incorrect value for sv_tel[0].phase_residual, expected 1, is %d", check_msg->sv_tel[0].phase_residual); - ck_assert_msg(check_msg->sv_tel[0].pseudorange_residual == -30, "incorrect value for sv_tel[0].pseudorange_residual, expected -30, is %d", check_msg->sv_tel[0].pseudorange_residual); - ck_assert_msg(check_msg->sv_tel[0].sid.code == 12, "incorrect value for sv_tel[0].sid.code, expected 12, is %d", check_msg->sv_tel[0].sid.code); - ck_assert_msg(check_msg->sv_tel[0].sid.sat == 33, "incorrect value for sv_tel[0].sid.sat, expected 33, is %d", check_msg->sv_tel[0].sid.sat); - ck_assert_msg(check_msg->tow == 406773200, "incorrect value for tow, expected 406773200, is %d", check_msg->tow); - ck_assert_msg(check_msg->wn == 2223, "incorrect value for wn, expected 2223, is %d", check_msg->wn); + ck_assert_msg(check_msg->n_obs == 16, + "incorrect value for n_obs, expected 16, is %d", + check_msg->n_obs); + ck_assert_msg(check_msg->origin_flags == 1, + "incorrect value for origin_flags, expected 1, is %d", + check_msg->origin_flags); + ck_assert_msg( + check_msg->sv_tel[0].availability_flags == 5, + "incorrect value for sv_tel[0].availability_flags, expected 5, is %d", + check_msg->sv_tel[0].availability_flags); + ck_assert_msg(check_msg->sv_tel[0].az == 40, + "incorrect value for sv_tel[0].az, expected 40, is %d", + check_msg->sv_tel[0].az); + ck_assert_msg( + check_msg->sv_tel[0].correction_flags == 1, + "incorrect value for sv_tel[0].correction_flags, expected 1, is %d", + check_msg->sv_tel[0].correction_flags); + ck_assert_msg(check_msg->sv_tel[0].el == 50, + "incorrect value for sv_tel[0].el, expected 50, is %d", + check_msg->sv_tel[0].el); + ck_assert_msg( + check_msg->sv_tel[0].ephemeris_flags == 1, + "incorrect value for sv_tel[0].ephemeris_flags, expected 1, is %d", + check_msg->sv_tel[0].ephemeris_flags); + ck_assert_msg( + check_msg->sv_tel[0].outlier_flags == 1, + "incorrect value for sv_tel[0].outlier_flags, expected 1, is %d", + check_msg->sv_tel[0].outlier_flags); + ck_assert_msg( + check_msg->sv_tel[0].phase_residual == 1, + "incorrect value for sv_tel[0].phase_residual, expected 1, is %d", + check_msg->sv_tel[0].phase_residual); + ck_assert_msg(check_msg->sv_tel[0].pseudorange_residual == -30, + "incorrect value for sv_tel[0].pseudorange_residual, " + "expected -30, is %d", + check_msg->sv_tel[0].pseudorange_residual); + ck_assert_msg(check_msg->sv_tel[0].sid.code == 12, + "incorrect value for sv_tel[0].sid.code, expected 12, is %d", + check_msg->sv_tel[0].sid.code); + ck_assert_msg(check_msg->sv_tel[0].sid.sat == 33, + "incorrect value for sv_tel[0].sid.sat, expected 33, is %d", + check_msg->sv_tel[0].sid.sat); + ck_assert_msg(check_msg->tow == 406773200, + "incorrect value for tow, expected 406773200, is %d", + check_msg->tow); + ck_assert_msg(check_msg->wn == 2223, + "incorrect value for wn, expected 2223, is %d", + check_msg->wn); } } END_TEST -Suite* legacy_auto_check_sbp_telemetry_MsgTelSv_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_telemetry_MsgTelSv"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_telemetry_MsgTelSv"); +Suite *legacy_auto_check_sbp_telemetry_MsgTelSv_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_telemetry_MsgTelSv"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_telemetry_MsgTelSv"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_telemetry_MsgTelSv); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_tracking_MsgMeasurementState.c b/c/test/legacy/auto_check_sbp_tracking_MsgMeasurementState.c index b8444ea99..2cddbd7e8 100644 --- a/c/test/legacy/auto_check_sbp_tracking_MsgMeasurementState.c +++ b/c/test/legacy/auto_check_sbp_tracking_MsgMeasurementState.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgMeasurementState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgMeasurementState.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_tracking_MsgMeasurementState ) -{ +START_TEST(test_legacy_auto_check_sbp_tracking_MsgMeasurementState) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgMeasurementState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,38 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgMeasurementState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x61, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x61, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x61, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x61, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,97,0,207,121,237,29,0,162,0,0,0,0,0,0,27,0,201,20,0,168,32,0,184,15,0,187,0,0,0,18,0,210,16,0,167,0,0,0,23,0,213,10,0,223,0,0,0,0,0,0,0,0,0,0,0,0,131,2,202,27,1,192,15,1,165,29,1,146,32,1,170,18,1,201,0,0,0,0,0,0,0,0,0,23,1,212,10,1,205,0,0,0,96,3,230,0,0,0,101,3,214,103,3,212,104,3,209,106,3,157,102,3,230,0,0,0,0,0,0,101,4,189,96,4,207,106,4,164,104,4,193,0,0,0,102,4,208,0,0,0,27,12,212,29,12,161,32,12,216,30,12,216,20,12,178,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,14,203,0,0,0,5,14,158,4,14,194,11,14,192,9,14,207,0,0,0,0,0,0,0,0,0,9,20,218,5,20,176,36,20,217,11,20,200,4,20,205,0,0,0,0,0,0,35,54, }; + u8 encoded_frame[] = { + 85, 97, 0, 207, 121, 237, 29, 0, 162, 0, 0, 0, 0, 0, 0, + 27, 0, 201, 20, 0, 168, 32, 0, 184, 15, 0, 187, 0, 0, 0, + 18, 0, 210, 16, 0, 167, 0, 0, 0, 23, 0, 213, 10, 0, 223, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 2, 202, + 27, 1, 192, 15, 1, 165, 29, 1, 146, 32, 1, 170, 18, 1, 201, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 1, 212, 10, 1, 205, + 0, 0, 0, 96, 3, 230, 0, 0, 0, 101, 3, 214, 103, 3, 212, + 104, 3, 209, 106, 3, 157, 102, 3, 230, 0, 0, 0, 0, 0, 0, + 101, 4, 189, 96, 4, 207, 106, 4, 164, 104, 4, 193, 0, 0, 0, + 102, 4, 208, 0, 0, 0, 27, 12, 212, 29, 12, 161, 32, 12, 216, + 30, 12, 216, 20, 12, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 36, 14, 203, 0, 0, 0, 5, 14, 158, 4, 14, 194, 11, 14, 192, + 9, 14, 207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 20, 218, + 5, 20, 176, 36, 20, 217, 11, 20, 200, 4, 20, 205, 0, 0, 0, + 0, 0, 0, 35, 54, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_measurement_state_t* test_msg = ( msg_measurement_state_t* )test_msg_storage; + msg_measurement_state_t *test_msg = + (msg_measurement_state_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->states) == 0) { // Cope with variable length arrays @@ -696,300 +714,883 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgMeasurementState ) test_msg->states[78].cn0 = 0; test_msg->states[78].mesid.code = 0; test_msg->states[78].mesid.sat = 0; - sbp_payload_send(&sbp_state, 0x61, 31183, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x61, 31183, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 31183, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 31183, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x61, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_measurement_state_t* check_msg = ( msg_measurement_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_measurement_state_t *check_msg = + (msg_measurement_state_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->states[0].cn0 == 162, "incorrect value for states[0].cn0, expected 162, is %d", check_msg->states[0].cn0); - ck_assert_msg(check_msg->states[0].mesid.code == 0, "incorrect value for states[0].mesid.code, expected 0, is %d", check_msg->states[0].mesid.code); - ck_assert_msg(check_msg->states[0].mesid.sat == 29, "incorrect value for states[0].mesid.sat, expected 29, is %d", check_msg->states[0].mesid.sat); - ck_assert_msg(check_msg->states[1].cn0 == 0, "incorrect value for states[1].cn0, expected 0, is %d", check_msg->states[1].cn0); - ck_assert_msg(check_msg->states[1].mesid.code == 0, "incorrect value for states[1].mesid.code, expected 0, is %d", check_msg->states[1].mesid.code); - ck_assert_msg(check_msg->states[1].mesid.sat == 0, "incorrect value for states[1].mesid.sat, expected 0, is %d", check_msg->states[1].mesid.sat); - ck_assert_msg(check_msg->states[2].cn0 == 0, "incorrect value for states[2].cn0, expected 0, is %d", check_msg->states[2].cn0); - ck_assert_msg(check_msg->states[2].mesid.code == 0, "incorrect value for states[2].mesid.code, expected 0, is %d", check_msg->states[2].mesid.code); - ck_assert_msg(check_msg->states[2].mesid.sat == 0, "incorrect value for states[2].mesid.sat, expected 0, is %d", check_msg->states[2].mesid.sat); - ck_assert_msg(check_msg->states[3].cn0 == 201, "incorrect value for states[3].cn0, expected 201, is %d", check_msg->states[3].cn0); - ck_assert_msg(check_msg->states[3].mesid.code == 0, "incorrect value for states[3].mesid.code, expected 0, is %d", check_msg->states[3].mesid.code); - ck_assert_msg(check_msg->states[3].mesid.sat == 27, "incorrect value for states[3].mesid.sat, expected 27, is %d", check_msg->states[3].mesid.sat); - ck_assert_msg(check_msg->states[4].cn0 == 168, "incorrect value for states[4].cn0, expected 168, is %d", check_msg->states[4].cn0); - ck_assert_msg(check_msg->states[4].mesid.code == 0, "incorrect value for states[4].mesid.code, expected 0, is %d", check_msg->states[4].mesid.code); - ck_assert_msg(check_msg->states[4].mesid.sat == 20, "incorrect value for states[4].mesid.sat, expected 20, is %d", check_msg->states[4].mesid.sat); - ck_assert_msg(check_msg->states[5].cn0 == 184, "incorrect value for states[5].cn0, expected 184, is %d", check_msg->states[5].cn0); - ck_assert_msg(check_msg->states[5].mesid.code == 0, "incorrect value for states[5].mesid.code, expected 0, is %d", check_msg->states[5].mesid.code); - ck_assert_msg(check_msg->states[5].mesid.sat == 32, "incorrect value for states[5].mesid.sat, expected 32, is %d", check_msg->states[5].mesid.sat); - ck_assert_msg(check_msg->states[6].cn0 == 187, "incorrect value for states[6].cn0, expected 187, is %d", check_msg->states[6].cn0); - ck_assert_msg(check_msg->states[6].mesid.code == 0, "incorrect value for states[6].mesid.code, expected 0, is %d", check_msg->states[6].mesid.code); - ck_assert_msg(check_msg->states[6].mesid.sat == 15, "incorrect value for states[6].mesid.sat, expected 15, is %d", check_msg->states[6].mesid.sat); - ck_assert_msg(check_msg->states[7].cn0 == 0, "incorrect value for states[7].cn0, expected 0, is %d", check_msg->states[7].cn0); - ck_assert_msg(check_msg->states[7].mesid.code == 0, "incorrect value for states[7].mesid.code, expected 0, is %d", check_msg->states[7].mesid.code); - ck_assert_msg(check_msg->states[7].mesid.sat == 0, "incorrect value for states[7].mesid.sat, expected 0, is %d", check_msg->states[7].mesid.sat); - ck_assert_msg(check_msg->states[8].cn0 == 210, "incorrect value for states[8].cn0, expected 210, is %d", check_msg->states[8].cn0); - ck_assert_msg(check_msg->states[8].mesid.code == 0, "incorrect value for states[8].mesid.code, expected 0, is %d", check_msg->states[8].mesid.code); - ck_assert_msg(check_msg->states[8].mesid.sat == 18, "incorrect value for states[8].mesid.sat, expected 18, is %d", check_msg->states[8].mesid.sat); - ck_assert_msg(check_msg->states[9].cn0 == 167, "incorrect value for states[9].cn0, expected 167, is %d", check_msg->states[9].cn0); - ck_assert_msg(check_msg->states[9].mesid.code == 0, "incorrect value for states[9].mesid.code, expected 0, is %d", check_msg->states[9].mesid.code); - ck_assert_msg(check_msg->states[9].mesid.sat == 16, "incorrect value for states[9].mesid.sat, expected 16, is %d", check_msg->states[9].mesid.sat); - ck_assert_msg(check_msg->states[10].cn0 == 0, "incorrect value for states[10].cn0, expected 0, is %d", check_msg->states[10].cn0); - ck_assert_msg(check_msg->states[10].mesid.code == 0, "incorrect value for states[10].mesid.code, expected 0, is %d", check_msg->states[10].mesid.code); - ck_assert_msg(check_msg->states[10].mesid.sat == 0, "incorrect value for states[10].mesid.sat, expected 0, is %d", check_msg->states[10].mesid.sat); - ck_assert_msg(check_msg->states[11].cn0 == 213, "incorrect value for states[11].cn0, expected 213, is %d", check_msg->states[11].cn0); - ck_assert_msg(check_msg->states[11].mesid.code == 0, "incorrect value for states[11].mesid.code, expected 0, is %d", check_msg->states[11].mesid.code); - ck_assert_msg(check_msg->states[11].mesid.sat == 23, "incorrect value for states[11].mesid.sat, expected 23, is %d", check_msg->states[11].mesid.sat); - ck_assert_msg(check_msg->states[12].cn0 == 223, "incorrect value for states[12].cn0, expected 223, is %d", check_msg->states[12].cn0); - ck_assert_msg(check_msg->states[12].mesid.code == 0, "incorrect value for states[12].mesid.code, expected 0, is %d", check_msg->states[12].mesid.code); - ck_assert_msg(check_msg->states[12].mesid.sat == 10, "incorrect value for states[12].mesid.sat, expected 10, is %d", check_msg->states[12].mesid.sat); - ck_assert_msg(check_msg->states[13].cn0 == 0, "incorrect value for states[13].cn0, expected 0, is %d", check_msg->states[13].cn0); - ck_assert_msg(check_msg->states[13].mesid.code == 0, "incorrect value for states[13].mesid.code, expected 0, is %d", check_msg->states[13].mesid.code); - ck_assert_msg(check_msg->states[13].mesid.sat == 0, "incorrect value for states[13].mesid.sat, expected 0, is %d", check_msg->states[13].mesid.sat); - ck_assert_msg(check_msg->states[14].cn0 == 0, "incorrect value for states[14].cn0, expected 0, is %d", check_msg->states[14].cn0); - ck_assert_msg(check_msg->states[14].mesid.code == 0, "incorrect value for states[14].mesid.code, expected 0, is %d", check_msg->states[14].mesid.code); - ck_assert_msg(check_msg->states[14].mesid.sat == 0, "incorrect value for states[14].mesid.sat, expected 0, is %d", check_msg->states[14].mesid.sat); - ck_assert_msg(check_msg->states[15].cn0 == 0, "incorrect value for states[15].cn0, expected 0, is %d", check_msg->states[15].cn0); - ck_assert_msg(check_msg->states[15].mesid.code == 0, "incorrect value for states[15].mesid.code, expected 0, is %d", check_msg->states[15].mesid.code); - ck_assert_msg(check_msg->states[15].mesid.sat == 0, "incorrect value for states[15].mesid.sat, expected 0, is %d", check_msg->states[15].mesid.sat); - ck_assert_msg(check_msg->states[16].cn0 == 0, "incorrect value for states[16].cn0, expected 0, is %d", check_msg->states[16].cn0); - ck_assert_msg(check_msg->states[16].mesid.code == 0, "incorrect value for states[16].mesid.code, expected 0, is %d", check_msg->states[16].mesid.code); - ck_assert_msg(check_msg->states[16].mesid.sat == 0, "incorrect value for states[16].mesid.sat, expected 0, is %d", check_msg->states[16].mesid.sat); - ck_assert_msg(check_msg->states[17].cn0 == 202, "incorrect value for states[17].cn0, expected 202, is %d", check_msg->states[17].cn0); - ck_assert_msg(check_msg->states[17].mesid.code == 2, "incorrect value for states[17].mesid.code, expected 2, is %d", check_msg->states[17].mesid.code); - ck_assert_msg(check_msg->states[17].mesid.sat == 131, "incorrect value for states[17].mesid.sat, expected 131, is %d", check_msg->states[17].mesid.sat); - ck_assert_msg(check_msg->states[18].cn0 == 192, "incorrect value for states[18].cn0, expected 192, is %d", check_msg->states[18].cn0); - ck_assert_msg(check_msg->states[18].mesid.code == 1, "incorrect value for states[18].mesid.code, expected 1, is %d", check_msg->states[18].mesid.code); - ck_assert_msg(check_msg->states[18].mesid.sat == 27, "incorrect value for states[18].mesid.sat, expected 27, is %d", check_msg->states[18].mesid.sat); - ck_assert_msg(check_msg->states[19].cn0 == 165, "incorrect value for states[19].cn0, expected 165, is %d", check_msg->states[19].cn0); - ck_assert_msg(check_msg->states[19].mesid.code == 1, "incorrect value for states[19].mesid.code, expected 1, is %d", check_msg->states[19].mesid.code); - ck_assert_msg(check_msg->states[19].mesid.sat == 15, "incorrect value for states[19].mesid.sat, expected 15, is %d", check_msg->states[19].mesid.sat); - ck_assert_msg(check_msg->states[20].cn0 == 146, "incorrect value for states[20].cn0, expected 146, is %d", check_msg->states[20].cn0); - ck_assert_msg(check_msg->states[20].mesid.code == 1, "incorrect value for states[20].mesid.code, expected 1, is %d", check_msg->states[20].mesid.code); - ck_assert_msg(check_msg->states[20].mesid.sat == 29, "incorrect value for states[20].mesid.sat, expected 29, is %d", check_msg->states[20].mesid.sat); - ck_assert_msg(check_msg->states[21].cn0 == 170, "incorrect value for states[21].cn0, expected 170, is %d", check_msg->states[21].cn0); - ck_assert_msg(check_msg->states[21].mesid.code == 1, "incorrect value for states[21].mesid.code, expected 1, is %d", check_msg->states[21].mesid.code); - ck_assert_msg(check_msg->states[21].mesid.sat == 32, "incorrect value for states[21].mesid.sat, expected 32, is %d", check_msg->states[21].mesid.sat); - ck_assert_msg(check_msg->states[22].cn0 == 201, "incorrect value for states[22].cn0, expected 201, is %d", check_msg->states[22].cn0); - ck_assert_msg(check_msg->states[22].mesid.code == 1, "incorrect value for states[22].mesid.code, expected 1, is %d", check_msg->states[22].mesid.code); - ck_assert_msg(check_msg->states[22].mesid.sat == 18, "incorrect value for states[22].mesid.sat, expected 18, is %d", check_msg->states[22].mesid.sat); - ck_assert_msg(check_msg->states[23].cn0 == 0, "incorrect value for states[23].cn0, expected 0, is %d", check_msg->states[23].cn0); - ck_assert_msg(check_msg->states[23].mesid.code == 0, "incorrect value for states[23].mesid.code, expected 0, is %d", check_msg->states[23].mesid.code); - ck_assert_msg(check_msg->states[23].mesid.sat == 0, "incorrect value for states[23].mesid.sat, expected 0, is %d", check_msg->states[23].mesid.sat); - ck_assert_msg(check_msg->states[24].cn0 == 0, "incorrect value for states[24].cn0, expected 0, is %d", check_msg->states[24].cn0); - ck_assert_msg(check_msg->states[24].mesid.code == 0, "incorrect value for states[24].mesid.code, expected 0, is %d", check_msg->states[24].mesid.code); - ck_assert_msg(check_msg->states[24].mesid.sat == 0, "incorrect value for states[24].mesid.sat, expected 0, is %d", check_msg->states[24].mesid.sat); - ck_assert_msg(check_msg->states[25].cn0 == 0, "incorrect value for states[25].cn0, expected 0, is %d", check_msg->states[25].cn0); - ck_assert_msg(check_msg->states[25].mesid.code == 0, "incorrect value for states[25].mesid.code, expected 0, is %d", check_msg->states[25].mesid.code); - ck_assert_msg(check_msg->states[25].mesid.sat == 0, "incorrect value for states[25].mesid.sat, expected 0, is %d", check_msg->states[25].mesid.sat); - ck_assert_msg(check_msg->states[26].cn0 == 212, "incorrect value for states[26].cn0, expected 212, is %d", check_msg->states[26].cn0); - ck_assert_msg(check_msg->states[26].mesid.code == 1, "incorrect value for states[26].mesid.code, expected 1, is %d", check_msg->states[26].mesid.code); - ck_assert_msg(check_msg->states[26].mesid.sat == 23, "incorrect value for states[26].mesid.sat, expected 23, is %d", check_msg->states[26].mesid.sat); - ck_assert_msg(check_msg->states[27].cn0 == 205, "incorrect value for states[27].cn0, expected 205, is %d", check_msg->states[27].cn0); - ck_assert_msg(check_msg->states[27].mesid.code == 1, "incorrect value for states[27].mesid.code, expected 1, is %d", check_msg->states[27].mesid.code); - ck_assert_msg(check_msg->states[27].mesid.sat == 10, "incorrect value for states[27].mesid.sat, expected 10, is %d", check_msg->states[27].mesid.sat); - ck_assert_msg(check_msg->states[28].cn0 == 0, "incorrect value for states[28].cn0, expected 0, is %d", check_msg->states[28].cn0); - ck_assert_msg(check_msg->states[28].mesid.code == 0, "incorrect value for states[28].mesid.code, expected 0, is %d", check_msg->states[28].mesid.code); - ck_assert_msg(check_msg->states[28].mesid.sat == 0, "incorrect value for states[28].mesid.sat, expected 0, is %d", check_msg->states[28].mesid.sat); - ck_assert_msg(check_msg->states[29].cn0 == 230, "incorrect value for states[29].cn0, expected 230, is %d", check_msg->states[29].cn0); - ck_assert_msg(check_msg->states[29].mesid.code == 3, "incorrect value for states[29].mesid.code, expected 3, is %d", check_msg->states[29].mesid.code); - ck_assert_msg(check_msg->states[29].mesid.sat == 96, "incorrect value for states[29].mesid.sat, expected 96, is %d", check_msg->states[29].mesid.sat); - ck_assert_msg(check_msg->states[30].cn0 == 0, "incorrect value for states[30].cn0, expected 0, is %d", check_msg->states[30].cn0); - ck_assert_msg(check_msg->states[30].mesid.code == 0, "incorrect value for states[30].mesid.code, expected 0, is %d", check_msg->states[30].mesid.code); - ck_assert_msg(check_msg->states[30].mesid.sat == 0, "incorrect value for states[30].mesid.sat, expected 0, is %d", check_msg->states[30].mesid.sat); - ck_assert_msg(check_msg->states[31].cn0 == 214, "incorrect value for states[31].cn0, expected 214, is %d", check_msg->states[31].cn0); - ck_assert_msg(check_msg->states[31].mesid.code == 3, "incorrect value for states[31].mesid.code, expected 3, is %d", check_msg->states[31].mesid.code); - ck_assert_msg(check_msg->states[31].mesid.sat == 101, "incorrect value for states[31].mesid.sat, expected 101, is %d", check_msg->states[31].mesid.sat); - ck_assert_msg(check_msg->states[32].cn0 == 212, "incorrect value for states[32].cn0, expected 212, is %d", check_msg->states[32].cn0); - ck_assert_msg(check_msg->states[32].mesid.code == 3, "incorrect value for states[32].mesid.code, expected 3, is %d", check_msg->states[32].mesid.code); - ck_assert_msg(check_msg->states[32].mesid.sat == 103, "incorrect value for states[32].mesid.sat, expected 103, is %d", check_msg->states[32].mesid.sat); - ck_assert_msg(check_msg->states[33].cn0 == 209, "incorrect value for states[33].cn0, expected 209, is %d", check_msg->states[33].cn0); - ck_assert_msg(check_msg->states[33].mesid.code == 3, "incorrect value for states[33].mesid.code, expected 3, is %d", check_msg->states[33].mesid.code); - ck_assert_msg(check_msg->states[33].mesid.sat == 104, "incorrect value for states[33].mesid.sat, expected 104, is %d", check_msg->states[33].mesid.sat); - ck_assert_msg(check_msg->states[34].cn0 == 157, "incorrect value for states[34].cn0, expected 157, is %d", check_msg->states[34].cn0); - ck_assert_msg(check_msg->states[34].mesid.code == 3, "incorrect value for states[34].mesid.code, expected 3, is %d", check_msg->states[34].mesid.code); - ck_assert_msg(check_msg->states[34].mesid.sat == 106, "incorrect value for states[34].mesid.sat, expected 106, is %d", check_msg->states[34].mesid.sat); - ck_assert_msg(check_msg->states[35].cn0 == 230, "incorrect value for states[35].cn0, expected 230, is %d", check_msg->states[35].cn0); - ck_assert_msg(check_msg->states[35].mesid.code == 3, "incorrect value for states[35].mesid.code, expected 3, is %d", check_msg->states[35].mesid.code); - ck_assert_msg(check_msg->states[35].mesid.sat == 102, "incorrect value for states[35].mesid.sat, expected 102, is %d", check_msg->states[35].mesid.sat); - ck_assert_msg(check_msg->states[36].cn0 == 0, "incorrect value for states[36].cn0, expected 0, is %d", check_msg->states[36].cn0); - ck_assert_msg(check_msg->states[36].mesid.code == 0, "incorrect value for states[36].mesid.code, expected 0, is %d", check_msg->states[36].mesid.code); - ck_assert_msg(check_msg->states[36].mesid.sat == 0, "incorrect value for states[36].mesid.sat, expected 0, is %d", check_msg->states[36].mesid.sat); - ck_assert_msg(check_msg->states[37].cn0 == 0, "incorrect value for states[37].cn0, expected 0, is %d", check_msg->states[37].cn0); - ck_assert_msg(check_msg->states[37].mesid.code == 0, "incorrect value for states[37].mesid.code, expected 0, is %d", check_msg->states[37].mesid.code); - ck_assert_msg(check_msg->states[37].mesid.sat == 0, "incorrect value for states[37].mesid.sat, expected 0, is %d", check_msg->states[37].mesid.sat); - ck_assert_msg(check_msg->states[38].cn0 == 189, "incorrect value for states[38].cn0, expected 189, is %d", check_msg->states[38].cn0); - ck_assert_msg(check_msg->states[38].mesid.code == 4, "incorrect value for states[38].mesid.code, expected 4, is %d", check_msg->states[38].mesid.code); - ck_assert_msg(check_msg->states[38].mesid.sat == 101, "incorrect value for states[38].mesid.sat, expected 101, is %d", check_msg->states[38].mesid.sat); - ck_assert_msg(check_msg->states[39].cn0 == 207, "incorrect value for states[39].cn0, expected 207, is %d", check_msg->states[39].cn0); - ck_assert_msg(check_msg->states[39].mesid.code == 4, "incorrect value for states[39].mesid.code, expected 4, is %d", check_msg->states[39].mesid.code); - ck_assert_msg(check_msg->states[39].mesid.sat == 96, "incorrect value for states[39].mesid.sat, expected 96, is %d", check_msg->states[39].mesid.sat); - ck_assert_msg(check_msg->states[40].cn0 == 164, "incorrect value for states[40].cn0, expected 164, is %d", check_msg->states[40].cn0); - ck_assert_msg(check_msg->states[40].mesid.code == 4, "incorrect value for states[40].mesid.code, expected 4, is %d", check_msg->states[40].mesid.code); - ck_assert_msg(check_msg->states[40].mesid.sat == 106, "incorrect value for states[40].mesid.sat, expected 106, is %d", check_msg->states[40].mesid.sat); - ck_assert_msg(check_msg->states[41].cn0 == 193, "incorrect value for states[41].cn0, expected 193, is %d", check_msg->states[41].cn0); - ck_assert_msg(check_msg->states[41].mesid.code == 4, "incorrect value for states[41].mesid.code, expected 4, is %d", check_msg->states[41].mesid.code); - ck_assert_msg(check_msg->states[41].mesid.sat == 104, "incorrect value for states[41].mesid.sat, expected 104, is %d", check_msg->states[41].mesid.sat); - ck_assert_msg(check_msg->states[42].cn0 == 0, "incorrect value for states[42].cn0, expected 0, is %d", check_msg->states[42].cn0); - ck_assert_msg(check_msg->states[42].mesid.code == 0, "incorrect value for states[42].mesid.code, expected 0, is %d", check_msg->states[42].mesid.code); - ck_assert_msg(check_msg->states[42].mesid.sat == 0, "incorrect value for states[42].mesid.sat, expected 0, is %d", check_msg->states[42].mesid.sat); - ck_assert_msg(check_msg->states[43].cn0 == 208, "incorrect value for states[43].cn0, expected 208, is %d", check_msg->states[43].cn0); - ck_assert_msg(check_msg->states[43].mesid.code == 4, "incorrect value for states[43].mesid.code, expected 4, is %d", check_msg->states[43].mesid.code); - ck_assert_msg(check_msg->states[43].mesid.sat == 102, "incorrect value for states[43].mesid.sat, expected 102, is %d", check_msg->states[43].mesid.sat); - ck_assert_msg(check_msg->states[44].cn0 == 0, "incorrect value for states[44].cn0, expected 0, is %d", check_msg->states[44].cn0); - ck_assert_msg(check_msg->states[44].mesid.code == 0, "incorrect value for states[44].mesid.code, expected 0, is %d", check_msg->states[44].mesid.code); - ck_assert_msg(check_msg->states[44].mesid.sat == 0, "incorrect value for states[44].mesid.sat, expected 0, is %d", check_msg->states[44].mesid.sat); - ck_assert_msg(check_msg->states[45].cn0 == 212, "incorrect value for states[45].cn0, expected 212, is %d", check_msg->states[45].cn0); - ck_assert_msg(check_msg->states[45].mesid.code == 12, "incorrect value for states[45].mesid.code, expected 12, is %d", check_msg->states[45].mesid.code); - ck_assert_msg(check_msg->states[45].mesid.sat == 27, "incorrect value for states[45].mesid.sat, expected 27, is %d", check_msg->states[45].mesid.sat); - ck_assert_msg(check_msg->states[46].cn0 == 161, "incorrect value for states[46].cn0, expected 161, is %d", check_msg->states[46].cn0); - ck_assert_msg(check_msg->states[46].mesid.code == 12, "incorrect value for states[46].mesid.code, expected 12, is %d", check_msg->states[46].mesid.code); - ck_assert_msg(check_msg->states[46].mesid.sat == 29, "incorrect value for states[46].mesid.sat, expected 29, is %d", check_msg->states[46].mesid.sat); - ck_assert_msg(check_msg->states[47].cn0 == 216, "incorrect value for states[47].cn0, expected 216, is %d", check_msg->states[47].cn0); - ck_assert_msg(check_msg->states[47].mesid.code == 12, "incorrect value for states[47].mesid.code, expected 12, is %d", check_msg->states[47].mesid.code); - ck_assert_msg(check_msg->states[47].mesid.sat == 32, "incorrect value for states[47].mesid.sat, expected 32, is %d", check_msg->states[47].mesid.sat); - ck_assert_msg(check_msg->states[48].cn0 == 216, "incorrect value for states[48].cn0, expected 216, is %d", check_msg->states[48].cn0); - ck_assert_msg(check_msg->states[48].mesid.code == 12, "incorrect value for states[48].mesid.code, expected 12, is %d", check_msg->states[48].mesid.code); - ck_assert_msg(check_msg->states[48].mesid.sat == 30, "incorrect value for states[48].mesid.sat, expected 30, is %d", check_msg->states[48].mesid.sat); - ck_assert_msg(check_msg->states[49].cn0 == 178, "incorrect value for states[49].cn0, expected 178, is %d", check_msg->states[49].cn0); - ck_assert_msg(check_msg->states[49].mesid.code == 12, "incorrect value for states[49].mesid.code, expected 12, is %d", check_msg->states[49].mesid.code); - ck_assert_msg(check_msg->states[49].mesid.sat == 20, "incorrect value for states[49].mesid.sat, expected 20, is %d", check_msg->states[49].mesid.sat); - ck_assert_msg(check_msg->states[50].cn0 == 0, "incorrect value for states[50].cn0, expected 0, is %d", check_msg->states[50].cn0); - ck_assert_msg(check_msg->states[50].mesid.code == 0, "incorrect value for states[50].mesid.code, expected 0, is %d", check_msg->states[50].mesid.code); - ck_assert_msg(check_msg->states[50].mesid.sat == 0, "incorrect value for states[50].mesid.sat, expected 0, is %d", check_msg->states[50].mesid.sat); - ck_assert_msg(check_msg->states[51].cn0 == 0, "incorrect value for states[51].cn0, expected 0, is %d", check_msg->states[51].cn0); - ck_assert_msg(check_msg->states[51].mesid.code == 0, "incorrect value for states[51].mesid.code, expected 0, is %d", check_msg->states[51].mesid.code); - ck_assert_msg(check_msg->states[51].mesid.sat == 0, "incorrect value for states[51].mesid.sat, expected 0, is %d", check_msg->states[51].mesid.sat); - ck_assert_msg(check_msg->states[52].cn0 == 0, "incorrect value for states[52].cn0, expected 0, is %d", check_msg->states[52].cn0); - ck_assert_msg(check_msg->states[52].mesid.code == 0, "incorrect value for states[52].mesid.code, expected 0, is %d", check_msg->states[52].mesid.code); - ck_assert_msg(check_msg->states[52].mesid.sat == 0, "incorrect value for states[52].mesid.sat, expected 0, is %d", check_msg->states[52].mesid.sat); - ck_assert_msg(check_msg->states[53].cn0 == 0, "incorrect value for states[53].cn0, expected 0, is %d", check_msg->states[53].cn0); - ck_assert_msg(check_msg->states[53].mesid.code == 0, "incorrect value for states[53].mesid.code, expected 0, is %d", check_msg->states[53].mesid.code); - ck_assert_msg(check_msg->states[53].mesid.sat == 0, "incorrect value for states[53].mesid.sat, expected 0, is %d", check_msg->states[53].mesid.sat); - ck_assert_msg(check_msg->states[54].cn0 == 0, "incorrect value for states[54].cn0, expected 0, is %d", check_msg->states[54].cn0); - ck_assert_msg(check_msg->states[54].mesid.code == 0, "incorrect value for states[54].mesid.code, expected 0, is %d", check_msg->states[54].mesid.code); - ck_assert_msg(check_msg->states[54].mesid.sat == 0, "incorrect value for states[54].mesid.sat, expected 0, is %d", check_msg->states[54].mesid.sat); - ck_assert_msg(check_msg->states[55].cn0 == 0, "incorrect value for states[55].cn0, expected 0, is %d", check_msg->states[55].cn0); - ck_assert_msg(check_msg->states[55].mesid.code == 0, "incorrect value for states[55].mesid.code, expected 0, is %d", check_msg->states[55].mesid.code); - ck_assert_msg(check_msg->states[55].mesid.sat == 0, "incorrect value for states[55].mesid.sat, expected 0, is %d", check_msg->states[55].mesid.sat); - ck_assert_msg(check_msg->states[56].cn0 == 0, "incorrect value for states[56].cn0, expected 0, is %d", check_msg->states[56].cn0); - ck_assert_msg(check_msg->states[56].mesid.code == 0, "incorrect value for states[56].mesid.code, expected 0, is %d", check_msg->states[56].mesid.code); - ck_assert_msg(check_msg->states[56].mesid.sat == 0, "incorrect value for states[56].mesid.sat, expected 0, is %d", check_msg->states[56].mesid.sat); - ck_assert_msg(check_msg->states[57].cn0 == 0, "incorrect value for states[57].cn0, expected 0, is %d", check_msg->states[57].cn0); - ck_assert_msg(check_msg->states[57].mesid.code == 0, "incorrect value for states[57].mesid.code, expected 0, is %d", check_msg->states[57].mesid.code); - ck_assert_msg(check_msg->states[57].mesid.sat == 0, "incorrect value for states[57].mesid.sat, expected 0, is %d", check_msg->states[57].mesid.sat); - ck_assert_msg(check_msg->states[58].cn0 == 0, "incorrect value for states[58].cn0, expected 0, is %d", check_msg->states[58].cn0); - ck_assert_msg(check_msg->states[58].mesid.code == 0, "incorrect value for states[58].mesid.code, expected 0, is %d", check_msg->states[58].mesid.code); - ck_assert_msg(check_msg->states[58].mesid.sat == 0, "incorrect value for states[58].mesid.sat, expected 0, is %d", check_msg->states[58].mesid.sat); - ck_assert_msg(check_msg->states[59].cn0 == 0, "incorrect value for states[59].cn0, expected 0, is %d", check_msg->states[59].cn0); - ck_assert_msg(check_msg->states[59].mesid.code == 0, "incorrect value for states[59].mesid.code, expected 0, is %d", check_msg->states[59].mesid.code); - ck_assert_msg(check_msg->states[59].mesid.sat == 0, "incorrect value for states[59].mesid.sat, expected 0, is %d", check_msg->states[59].mesid.sat); - ck_assert_msg(check_msg->states[60].cn0 == 0, "incorrect value for states[60].cn0, expected 0, is %d", check_msg->states[60].cn0); - ck_assert_msg(check_msg->states[60].mesid.code == 0, "incorrect value for states[60].mesid.code, expected 0, is %d", check_msg->states[60].mesid.code); - ck_assert_msg(check_msg->states[60].mesid.sat == 0, "incorrect value for states[60].mesid.sat, expected 0, is %d", check_msg->states[60].mesid.sat); - ck_assert_msg(check_msg->states[61].cn0 == 0, "incorrect value for states[61].cn0, expected 0, is %d", check_msg->states[61].cn0); - ck_assert_msg(check_msg->states[61].mesid.code == 0, "incorrect value for states[61].mesid.code, expected 0, is %d", check_msg->states[61].mesid.code); - ck_assert_msg(check_msg->states[61].mesid.sat == 0, "incorrect value for states[61].mesid.sat, expected 0, is %d", check_msg->states[61].mesid.sat); - ck_assert_msg(check_msg->states[62].cn0 == 0, "incorrect value for states[62].cn0, expected 0, is %d", check_msg->states[62].cn0); - ck_assert_msg(check_msg->states[62].mesid.code == 0, "incorrect value for states[62].mesid.code, expected 0, is %d", check_msg->states[62].mesid.code); - ck_assert_msg(check_msg->states[62].mesid.sat == 0, "incorrect value for states[62].mesid.sat, expected 0, is %d", check_msg->states[62].mesid.sat); - ck_assert_msg(check_msg->states[63].cn0 == 203, "incorrect value for states[63].cn0, expected 203, is %d", check_msg->states[63].cn0); - ck_assert_msg(check_msg->states[63].mesid.code == 14, "incorrect value for states[63].mesid.code, expected 14, is %d", check_msg->states[63].mesid.code); - ck_assert_msg(check_msg->states[63].mesid.sat == 36, "incorrect value for states[63].mesid.sat, expected 36, is %d", check_msg->states[63].mesid.sat); - ck_assert_msg(check_msg->states[64].cn0 == 0, "incorrect value for states[64].cn0, expected 0, is %d", check_msg->states[64].cn0); - ck_assert_msg(check_msg->states[64].mesid.code == 0, "incorrect value for states[64].mesid.code, expected 0, is %d", check_msg->states[64].mesid.code); - ck_assert_msg(check_msg->states[64].mesid.sat == 0, "incorrect value for states[64].mesid.sat, expected 0, is %d", check_msg->states[64].mesid.sat); - ck_assert_msg(check_msg->states[65].cn0 == 158, "incorrect value for states[65].cn0, expected 158, is %d", check_msg->states[65].cn0); - ck_assert_msg(check_msg->states[65].mesid.code == 14, "incorrect value for states[65].mesid.code, expected 14, is %d", check_msg->states[65].mesid.code); - ck_assert_msg(check_msg->states[65].mesid.sat == 5, "incorrect value for states[65].mesid.sat, expected 5, is %d", check_msg->states[65].mesid.sat); - ck_assert_msg(check_msg->states[66].cn0 == 194, "incorrect value for states[66].cn0, expected 194, is %d", check_msg->states[66].cn0); - ck_assert_msg(check_msg->states[66].mesid.code == 14, "incorrect value for states[66].mesid.code, expected 14, is %d", check_msg->states[66].mesid.code); - ck_assert_msg(check_msg->states[66].mesid.sat == 4, "incorrect value for states[66].mesid.sat, expected 4, is %d", check_msg->states[66].mesid.sat); - ck_assert_msg(check_msg->states[67].cn0 == 192, "incorrect value for states[67].cn0, expected 192, is %d", check_msg->states[67].cn0); - ck_assert_msg(check_msg->states[67].mesid.code == 14, "incorrect value for states[67].mesid.code, expected 14, is %d", check_msg->states[67].mesid.code); - ck_assert_msg(check_msg->states[67].mesid.sat == 11, "incorrect value for states[67].mesid.sat, expected 11, is %d", check_msg->states[67].mesid.sat); - ck_assert_msg(check_msg->states[68].cn0 == 207, "incorrect value for states[68].cn0, expected 207, is %d", check_msg->states[68].cn0); - ck_assert_msg(check_msg->states[68].mesid.code == 14, "incorrect value for states[68].mesid.code, expected 14, is %d", check_msg->states[68].mesid.code); - ck_assert_msg(check_msg->states[68].mesid.sat == 9, "incorrect value for states[68].mesid.sat, expected 9, is %d", check_msg->states[68].mesid.sat); - ck_assert_msg(check_msg->states[69].cn0 == 0, "incorrect value for states[69].cn0, expected 0, is %d", check_msg->states[69].cn0); - ck_assert_msg(check_msg->states[69].mesid.code == 0, "incorrect value for states[69].mesid.code, expected 0, is %d", check_msg->states[69].mesid.code); - ck_assert_msg(check_msg->states[69].mesid.sat == 0, "incorrect value for states[69].mesid.sat, expected 0, is %d", check_msg->states[69].mesid.sat); - ck_assert_msg(check_msg->states[70].cn0 == 0, "incorrect value for states[70].cn0, expected 0, is %d", check_msg->states[70].cn0); - ck_assert_msg(check_msg->states[70].mesid.code == 0, "incorrect value for states[70].mesid.code, expected 0, is %d", check_msg->states[70].mesid.code); - ck_assert_msg(check_msg->states[70].mesid.sat == 0, "incorrect value for states[70].mesid.sat, expected 0, is %d", check_msg->states[70].mesid.sat); - ck_assert_msg(check_msg->states[71].cn0 == 0, "incorrect value for states[71].cn0, expected 0, is %d", check_msg->states[71].cn0); - ck_assert_msg(check_msg->states[71].mesid.code == 0, "incorrect value for states[71].mesid.code, expected 0, is %d", check_msg->states[71].mesid.code); - ck_assert_msg(check_msg->states[71].mesid.sat == 0, "incorrect value for states[71].mesid.sat, expected 0, is %d", check_msg->states[71].mesid.sat); - ck_assert_msg(check_msg->states[72].cn0 == 218, "incorrect value for states[72].cn0, expected 218, is %d", check_msg->states[72].cn0); - ck_assert_msg(check_msg->states[72].mesid.code == 20, "incorrect value for states[72].mesid.code, expected 20, is %d", check_msg->states[72].mesid.code); - ck_assert_msg(check_msg->states[72].mesid.sat == 9, "incorrect value for states[72].mesid.sat, expected 9, is %d", check_msg->states[72].mesid.sat); - ck_assert_msg(check_msg->states[73].cn0 == 176, "incorrect value for states[73].cn0, expected 176, is %d", check_msg->states[73].cn0); - ck_assert_msg(check_msg->states[73].mesid.code == 20, "incorrect value for states[73].mesid.code, expected 20, is %d", check_msg->states[73].mesid.code); - ck_assert_msg(check_msg->states[73].mesid.sat == 5, "incorrect value for states[73].mesid.sat, expected 5, is %d", check_msg->states[73].mesid.sat); - ck_assert_msg(check_msg->states[74].cn0 == 217, "incorrect value for states[74].cn0, expected 217, is %d", check_msg->states[74].cn0); - ck_assert_msg(check_msg->states[74].mesid.code == 20, "incorrect value for states[74].mesid.code, expected 20, is %d", check_msg->states[74].mesid.code); - ck_assert_msg(check_msg->states[74].mesid.sat == 36, "incorrect value for states[74].mesid.sat, expected 36, is %d", check_msg->states[74].mesid.sat); - ck_assert_msg(check_msg->states[75].cn0 == 200, "incorrect value for states[75].cn0, expected 200, is %d", check_msg->states[75].cn0); - ck_assert_msg(check_msg->states[75].mesid.code == 20, "incorrect value for states[75].mesid.code, expected 20, is %d", check_msg->states[75].mesid.code); - ck_assert_msg(check_msg->states[75].mesid.sat == 11, "incorrect value for states[75].mesid.sat, expected 11, is %d", check_msg->states[75].mesid.sat); - ck_assert_msg(check_msg->states[76].cn0 == 205, "incorrect value for states[76].cn0, expected 205, is %d", check_msg->states[76].cn0); - ck_assert_msg(check_msg->states[76].mesid.code == 20, "incorrect value for states[76].mesid.code, expected 20, is %d", check_msg->states[76].mesid.code); - ck_assert_msg(check_msg->states[76].mesid.sat == 4, "incorrect value for states[76].mesid.sat, expected 4, is %d", check_msg->states[76].mesid.sat); - ck_assert_msg(check_msg->states[77].cn0 == 0, "incorrect value for states[77].cn0, expected 0, is %d", check_msg->states[77].cn0); - ck_assert_msg(check_msg->states[77].mesid.code == 0, "incorrect value for states[77].mesid.code, expected 0, is %d", check_msg->states[77].mesid.code); - ck_assert_msg(check_msg->states[77].mesid.sat == 0, "incorrect value for states[77].mesid.sat, expected 0, is %d", check_msg->states[77].mesid.sat); - ck_assert_msg(check_msg->states[78].cn0 == 0, "incorrect value for states[78].cn0, expected 0, is %d", check_msg->states[78].cn0); - ck_assert_msg(check_msg->states[78].mesid.code == 0, "incorrect value for states[78].mesid.code, expected 0, is %d", check_msg->states[78].mesid.code); - ck_assert_msg(check_msg->states[78].mesid.sat == 0, "incorrect value for states[78].mesid.sat, expected 0, is %d", check_msg->states[78].mesid.sat); + ck_assert_msg(check_msg->states[0].cn0 == 162, + "incorrect value for states[0].cn0, expected 162, is %d", + check_msg->states[0].cn0); + ck_assert_msg(check_msg->states[0].mesid.code == 0, + "incorrect value for states[0].mesid.code, expected 0, is %d", + check_msg->states[0].mesid.code); + ck_assert_msg(check_msg->states[0].mesid.sat == 29, + "incorrect value for states[0].mesid.sat, expected 29, is %d", + check_msg->states[0].mesid.sat); + ck_assert_msg(check_msg->states[1].cn0 == 0, + "incorrect value for states[1].cn0, expected 0, is %d", + check_msg->states[1].cn0); + ck_assert_msg(check_msg->states[1].mesid.code == 0, + "incorrect value for states[1].mesid.code, expected 0, is %d", + check_msg->states[1].mesid.code); + ck_assert_msg(check_msg->states[1].mesid.sat == 0, + "incorrect value for states[1].mesid.sat, expected 0, is %d", + check_msg->states[1].mesid.sat); + ck_assert_msg(check_msg->states[2].cn0 == 0, + "incorrect value for states[2].cn0, expected 0, is %d", + check_msg->states[2].cn0); + ck_assert_msg(check_msg->states[2].mesid.code == 0, + "incorrect value for states[2].mesid.code, expected 0, is %d", + check_msg->states[2].mesid.code); + ck_assert_msg(check_msg->states[2].mesid.sat == 0, + "incorrect value for states[2].mesid.sat, expected 0, is %d", + check_msg->states[2].mesid.sat); + ck_assert_msg(check_msg->states[3].cn0 == 201, + "incorrect value for states[3].cn0, expected 201, is %d", + check_msg->states[3].cn0); + ck_assert_msg(check_msg->states[3].mesid.code == 0, + "incorrect value for states[3].mesid.code, expected 0, is %d", + check_msg->states[3].mesid.code); + ck_assert_msg(check_msg->states[3].mesid.sat == 27, + "incorrect value for states[3].mesid.sat, expected 27, is %d", + check_msg->states[3].mesid.sat); + ck_assert_msg(check_msg->states[4].cn0 == 168, + "incorrect value for states[4].cn0, expected 168, is %d", + check_msg->states[4].cn0); + ck_assert_msg(check_msg->states[4].mesid.code == 0, + "incorrect value for states[4].mesid.code, expected 0, is %d", + check_msg->states[4].mesid.code); + ck_assert_msg(check_msg->states[4].mesid.sat == 20, + "incorrect value for states[4].mesid.sat, expected 20, is %d", + check_msg->states[4].mesid.sat); + ck_assert_msg(check_msg->states[5].cn0 == 184, + "incorrect value for states[5].cn0, expected 184, is %d", + check_msg->states[5].cn0); + ck_assert_msg(check_msg->states[5].mesid.code == 0, + "incorrect value for states[5].mesid.code, expected 0, is %d", + check_msg->states[5].mesid.code); + ck_assert_msg(check_msg->states[5].mesid.sat == 32, + "incorrect value for states[5].mesid.sat, expected 32, is %d", + check_msg->states[5].mesid.sat); + ck_assert_msg(check_msg->states[6].cn0 == 187, + "incorrect value for states[6].cn0, expected 187, is %d", + check_msg->states[6].cn0); + ck_assert_msg(check_msg->states[6].mesid.code == 0, + "incorrect value for states[6].mesid.code, expected 0, is %d", + check_msg->states[6].mesid.code); + ck_assert_msg(check_msg->states[6].mesid.sat == 15, + "incorrect value for states[6].mesid.sat, expected 15, is %d", + check_msg->states[6].mesid.sat); + ck_assert_msg(check_msg->states[7].cn0 == 0, + "incorrect value for states[7].cn0, expected 0, is %d", + check_msg->states[7].cn0); + ck_assert_msg(check_msg->states[7].mesid.code == 0, + "incorrect value for states[7].mesid.code, expected 0, is %d", + check_msg->states[7].mesid.code); + ck_assert_msg(check_msg->states[7].mesid.sat == 0, + "incorrect value for states[7].mesid.sat, expected 0, is %d", + check_msg->states[7].mesid.sat); + ck_assert_msg(check_msg->states[8].cn0 == 210, + "incorrect value for states[8].cn0, expected 210, is %d", + check_msg->states[8].cn0); + ck_assert_msg(check_msg->states[8].mesid.code == 0, + "incorrect value for states[8].mesid.code, expected 0, is %d", + check_msg->states[8].mesid.code); + ck_assert_msg(check_msg->states[8].mesid.sat == 18, + "incorrect value for states[8].mesid.sat, expected 18, is %d", + check_msg->states[8].mesid.sat); + ck_assert_msg(check_msg->states[9].cn0 == 167, + "incorrect value for states[9].cn0, expected 167, is %d", + check_msg->states[9].cn0); + ck_assert_msg(check_msg->states[9].mesid.code == 0, + "incorrect value for states[9].mesid.code, expected 0, is %d", + check_msg->states[9].mesid.code); + ck_assert_msg(check_msg->states[9].mesid.sat == 16, + "incorrect value for states[9].mesid.sat, expected 16, is %d", + check_msg->states[9].mesid.sat); + ck_assert_msg(check_msg->states[10].cn0 == 0, + "incorrect value for states[10].cn0, expected 0, is %d", + check_msg->states[10].cn0); + ck_assert_msg( + check_msg->states[10].mesid.code == 0, + "incorrect value for states[10].mesid.code, expected 0, is %d", + check_msg->states[10].mesid.code); + ck_assert_msg(check_msg->states[10].mesid.sat == 0, + "incorrect value for states[10].mesid.sat, expected 0, is %d", + check_msg->states[10].mesid.sat); + ck_assert_msg(check_msg->states[11].cn0 == 213, + "incorrect value for states[11].cn0, expected 213, is %d", + check_msg->states[11].cn0); + ck_assert_msg( + check_msg->states[11].mesid.code == 0, + "incorrect value for states[11].mesid.code, expected 0, is %d", + check_msg->states[11].mesid.code); + ck_assert_msg( + check_msg->states[11].mesid.sat == 23, + "incorrect value for states[11].mesid.sat, expected 23, is %d", + check_msg->states[11].mesid.sat); + ck_assert_msg(check_msg->states[12].cn0 == 223, + "incorrect value for states[12].cn0, expected 223, is %d", + check_msg->states[12].cn0); + ck_assert_msg( + check_msg->states[12].mesid.code == 0, + "incorrect value for states[12].mesid.code, expected 0, is %d", + check_msg->states[12].mesid.code); + ck_assert_msg( + check_msg->states[12].mesid.sat == 10, + "incorrect value for states[12].mesid.sat, expected 10, is %d", + check_msg->states[12].mesid.sat); + ck_assert_msg(check_msg->states[13].cn0 == 0, + "incorrect value for states[13].cn0, expected 0, is %d", + check_msg->states[13].cn0); + ck_assert_msg( + check_msg->states[13].mesid.code == 0, + "incorrect value for states[13].mesid.code, expected 0, is %d", + check_msg->states[13].mesid.code); + ck_assert_msg(check_msg->states[13].mesid.sat == 0, + "incorrect value for states[13].mesid.sat, expected 0, is %d", + check_msg->states[13].mesid.sat); + ck_assert_msg(check_msg->states[14].cn0 == 0, + "incorrect value for states[14].cn0, expected 0, is %d", + check_msg->states[14].cn0); + ck_assert_msg( + check_msg->states[14].mesid.code == 0, + "incorrect value for states[14].mesid.code, expected 0, is %d", + check_msg->states[14].mesid.code); + ck_assert_msg(check_msg->states[14].mesid.sat == 0, + "incorrect value for states[14].mesid.sat, expected 0, is %d", + check_msg->states[14].mesid.sat); + ck_assert_msg(check_msg->states[15].cn0 == 0, + "incorrect value for states[15].cn0, expected 0, is %d", + check_msg->states[15].cn0); + ck_assert_msg( + check_msg->states[15].mesid.code == 0, + "incorrect value for states[15].mesid.code, expected 0, is %d", + check_msg->states[15].mesid.code); + ck_assert_msg(check_msg->states[15].mesid.sat == 0, + "incorrect value for states[15].mesid.sat, expected 0, is %d", + check_msg->states[15].mesid.sat); + ck_assert_msg(check_msg->states[16].cn0 == 0, + "incorrect value for states[16].cn0, expected 0, is %d", + check_msg->states[16].cn0); + ck_assert_msg( + check_msg->states[16].mesid.code == 0, + "incorrect value for states[16].mesid.code, expected 0, is %d", + check_msg->states[16].mesid.code); + ck_assert_msg(check_msg->states[16].mesid.sat == 0, + "incorrect value for states[16].mesid.sat, expected 0, is %d", + check_msg->states[16].mesid.sat); + ck_assert_msg(check_msg->states[17].cn0 == 202, + "incorrect value for states[17].cn0, expected 202, is %d", + check_msg->states[17].cn0); + ck_assert_msg( + check_msg->states[17].mesid.code == 2, + "incorrect value for states[17].mesid.code, expected 2, is %d", + check_msg->states[17].mesid.code); + ck_assert_msg( + check_msg->states[17].mesid.sat == 131, + "incorrect value for states[17].mesid.sat, expected 131, is %d", + check_msg->states[17].mesid.sat); + ck_assert_msg(check_msg->states[18].cn0 == 192, + "incorrect value for states[18].cn0, expected 192, is %d", + check_msg->states[18].cn0); + ck_assert_msg( + check_msg->states[18].mesid.code == 1, + "incorrect value for states[18].mesid.code, expected 1, is %d", + check_msg->states[18].mesid.code); + ck_assert_msg( + check_msg->states[18].mesid.sat == 27, + "incorrect value for states[18].mesid.sat, expected 27, is %d", + check_msg->states[18].mesid.sat); + ck_assert_msg(check_msg->states[19].cn0 == 165, + "incorrect value for states[19].cn0, expected 165, is %d", + check_msg->states[19].cn0); + ck_assert_msg( + check_msg->states[19].mesid.code == 1, + "incorrect value for states[19].mesid.code, expected 1, is %d", + check_msg->states[19].mesid.code); + ck_assert_msg( + check_msg->states[19].mesid.sat == 15, + "incorrect value for states[19].mesid.sat, expected 15, is %d", + check_msg->states[19].mesid.sat); + ck_assert_msg(check_msg->states[20].cn0 == 146, + "incorrect value for states[20].cn0, expected 146, is %d", + check_msg->states[20].cn0); + ck_assert_msg( + check_msg->states[20].mesid.code == 1, + "incorrect value for states[20].mesid.code, expected 1, is %d", + check_msg->states[20].mesid.code); + ck_assert_msg( + check_msg->states[20].mesid.sat == 29, + "incorrect value for states[20].mesid.sat, expected 29, is %d", + check_msg->states[20].mesid.sat); + ck_assert_msg(check_msg->states[21].cn0 == 170, + "incorrect value for states[21].cn0, expected 170, is %d", + check_msg->states[21].cn0); + ck_assert_msg( + check_msg->states[21].mesid.code == 1, + "incorrect value for states[21].mesid.code, expected 1, is %d", + check_msg->states[21].mesid.code); + ck_assert_msg( + check_msg->states[21].mesid.sat == 32, + "incorrect value for states[21].mesid.sat, expected 32, is %d", + check_msg->states[21].mesid.sat); + ck_assert_msg(check_msg->states[22].cn0 == 201, + "incorrect value for states[22].cn0, expected 201, is %d", + check_msg->states[22].cn0); + ck_assert_msg( + check_msg->states[22].mesid.code == 1, + "incorrect value for states[22].mesid.code, expected 1, is %d", + check_msg->states[22].mesid.code); + ck_assert_msg( + check_msg->states[22].mesid.sat == 18, + "incorrect value for states[22].mesid.sat, expected 18, is %d", + check_msg->states[22].mesid.sat); + ck_assert_msg(check_msg->states[23].cn0 == 0, + "incorrect value for states[23].cn0, expected 0, is %d", + check_msg->states[23].cn0); + ck_assert_msg( + check_msg->states[23].mesid.code == 0, + "incorrect value for states[23].mesid.code, expected 0, is %d", + check_msg->states[23].mesid.code); + ck_assert_msg(check_msg->states[23].mesid.sat == 0, + "incorrect value for states[23].mesid.sat, expected 0, is %d", + check_msg->states[23].mesid.sat); + ck_assert_msg(check_msg->states[24].cn0 == 0, + "incorrect value for states[24].cn0, expected 0, is %d", + check_msg->states[24].cn0); + ck_assert_msg( + check_msg->states[24].mesid.code == 0, + "incorrect value for states[24].mesid.code, expected 0, is %d", + check_msg->states[24].mesid.code); + ck_assert_msg(check_msg->states[24].mesid.sat == 0, + "incorrect value for states[24].mesid.sat, expected 0, is %d", + check_msg->states[24].mesid.sat); + ck_assert_msg(check_msg->states[25].cn0 == 0, + "incorrect value for states[25].cn0, expected 0, is %d", + check_msg->states[25].cn0); + ck_assert_msg( + check_msg->states[25].mesid.code == 0, + "incorrect value for states[25].mesid.code, expected 0, is %d", + check_msg->states[25].mesid.code); + ck_assert_msg(check_msg->states[25].mesid.sat == 0, + "incorrect value for states[25].mesid.sat, expected 0, is %d", + check_msg->states[25].mesid.sat); + ck_assert_msg(check_msg->states[26].cn0 == 212, + "incorrect value for states[26].cn0, expected 212, is %d", + check_msg->states[26].cn0); + ck_assert_msg( + check_msg->states[26].mesid.code == 1, + "incorrect value for states[26].mesid.code, expected 1, is %d", + check_msg->states[26].mesid.code); + ck_assert_msg( + check_msg->states[26].mesid.sat == 23, + "incorrect value for states[26].mesid.sat, expected 23, is %d", + check_msg->states[26].mesid.sat); + ck_assert_msg(check_msg->states[27].cn0 == 205, + "incorrect value for states[27].cn0, expected 205, is %d", + check_msg->states[27].cn0); + ck_assert_msg( + check_msg->states[27].mesid.code == 1, + "incorrect value for states[27].mesid.code, expected 1, is %d", + check_msg->states[27].mesid.code); + ck_assert_msg( + check_msg->states[27].mesid.sat == 10, + "incorrect value for states[27].mesid.sat, expected 10, is %d", + check_msg->states[27].mesid.sat); + ck_assert_msg(check_msg->states[28].cn0 == 0, + "incorrect value for states[28].cn0, expected 0, is %d", + check_msg->states[28].cn0); + ck_assert_msg( + check_msg->states[28].mesid.code == 0, + "incorrect value for states[28].mesid.code, expected 0, is %d", + check_msg->states[28].mesid.code); + ck_assert_msg(check_msg->states[28].mesid.sat == 0, + "incorrect value for states[28].mesid.sat, expected 0, is %d", + check_msg->states[28].mesid.sat); + ck_assert_msg(check_msg->states[29].cn0 == 230, + "incorrect value for states[29].cn0, expected 230, is %d", + check_msg->states[29].cn0); + ck_assert_msg( + check_msg->states[29].mesid.code == 3, + "incorrect value for states[29].mesid.code, expected 3, is %d", + check_msg->states[29].mesid.code); + ck_assert_msg( + check_msg->states[29].mesid.sat == 96, + "incorrect value for states[29].mesid.sat, expected 96, is %d", + check_msg->states[29].mesid.sat); + ck_assert_msg(check_msg->states[30].cn0 == 0, + "incorrect value for states[30].cn0, expected 0, is %d", + check_msg->states[30].cn0); + ck_assert_msg( + check_msg->states[30].mesid.code == 0, + "incorrect value for states[30].mesid.code, expected 0, is %d", + check_msg->states[30].mesid.code); + ck_assert_msg(check_msg->states[30].mesid.sat == 0, + "incorrect value for states[30].mesid.sat, expected 0, is %d", + check_msg->states[30].mesid.sat); + ck_assert_msg(check_msg->states[31].cn0 == 214, + "incorrect value for states[31].cn0, expected 214, is %d", + check_msg->states[31].cn0); + ck_assert_msg( + check_msg->states[31].mesid.code == 3, + "incorrect value for states[31].mesid.code, expected 3, is %d", + check_msg->states[31].mesid.code); + ck_assert_msg( + check_msg->states[31].mesid.sat == 101, + "incorrect value for states[31].mesid.sat, expected 101, is %d", + check_msg->states[31].mesid.sat); + ck_assert_msg(check_msg->states[32].cn0 == 212, + "incorrect value for states[32].cn0, expected 212, is %d", + check_msg->states[32].cn0); + ck_assert_msg( + check_msg->states[32].mesid.code == 3, + "incorrect value for states[32].mesid.code, expected 3, is %d", + check_msg->states[32].mesid.code); + ck_assert_msg( + check_msg->states[32].mesid.sat == 103, + "incorrect value for states[32].mesid.sat, expected 103, is %d", + check_msg->states[32].mesid.sat); + ck_assert_msg(check_msg->states[33].cn0 == 209, + "incorrect value for states[33].cn0, expected 209, is %d", + check_msg->states[33].cn0); + ck_assert_msg( + check_msg->states[33].mesid.code == 3, + "incorrect value for states[33].mesid.code, expected 3, is %d", + check_msg->states[33].mesid.code); + ck_assert_msg( + check_msg->states[33].mesid.sat == 104, + "incorrect value for states[33].mesid.sat, expected 104, is %d", + check_msg->states[33].mesid.sat); + ck_assert_msg(check_msg->states[34].cn0 == 157, + "incorrect value for states[34].cn0, expected 157, is %d", + check_msg->states[34].cn0); + ck_assert_msg( + check_msg->states[34].mesid.code == 3, + "incorrect value for states[34].mesid.code, expected 3, is %d", + check_msg->states[34].mesid.code); + ck_assert_msg( + check_msg->states[34].mesid.sat == 106, + "incorrect value for states[34].mesid.sat, expected 106, is %d", + check_msg->states[34].mesid.sat); + ck_assert_msg(check_msg->states[35].cn0 == 230, + "incorrect value for states[35].cn0, expected 230, is %d", + check_msg->states[35].cn0); + ck_assert_msg( + check_msg->states[35].mesid.code == 3, + "incorrect value for states[35].mesid.code, expected 3, is %d", + check_msg->states[35].mesid.code); + ck_assert_msg( + check_msg->states[35].mesid.sat == 102, + "incorrect value for states[35].mesid.sat, expected 102, is %d", + check_msg->states[35].mesid.sat); + ck_assert_msg(check_msg->states[36].cn0 == 0, + "incorrect value for states[36].cn0, expected 0, is %d", + check_msg->states[36].cn0); + ck_assert_msg( + check_msg->states[36].mesid.code == 0, + "incorrect value for states[36].mesid.code, expected 0, is %d", + check_msg->states[36].mesid.code); + ck_assert_msg(check_msg->states[36].mesid.sat == 0, + "incorrect value for states[36].mesid.sat, expected 0, is %d", + check_msg->states[36].mesid.sat); + ck_assert_msg(check_msg->states[37].cn0 == 0, + "incorrect value for states[37].cn0, expected 0, is %d", + check_msg->states[37].cn0); + ck_assert_msg( + check_msg->states[37].mesid.code == 0, + "incorrect value for states[37].mesid.code, expected 0, is %d", + check_msg->states[37].mesid.code); + ck_assert_msg(check_msg->states[37].mesid.sat == 0, + "incorrect value for states[37].mesid.sat, expected 0, is %d", + check_msg->states[37].mesid.sat); + ck_assert_msg(check_msg->states[38].cn0 == 189, + "incorrect value for states[38].cn0, expected 189, is %d", + check_msg->states[38].cn0); + ck_assert_msg( + check_msg->states[38].mesid.code == 4, + "incorrect value for states[38].mesid.code, expected 4, is %d", + check_msg->states[38].mesid.code); + ck_assert_msg( + check_msg->states[38].mesid.sat == 101, + "incorrect value for states[38].mesid.sat, expected 101, is %d", + check_msg->states[38].mesid.sat); + ck_assert_msg(check_msg->states[39].cn0 == 207, + "incorrect value for states[39].cn0, expected 207, is %d", + check_msg->states[39].cn0); + ck_assert_msg( + check_msg->states[39].mesid.code == 4, + "incorrect value for states[39].mesid.code, expected 4, is %d", + check_msg->states[39].mesid.code); + ck_assert_msg( + check_msg->states[39].mesid.sat == 96, + "incorrect value for states[39].mesid.sat, expected 96, is %d", + check_msg->states[39].mesid.sat); + ck_assert_msg(check_msg->states[40].cn0 == 164, + "incorrect value for states[40].cn0, expected 164, is %d", + check_msg->states[40].cn0); + ck_assert_msg( + check_msg->states[40].mesid.code == 4, + "incorrect value for states[40].mesid.code, expected 4, is %d", + check_msg->states[40].mesid.code); + ck_assert_msg( + check_msg->states[40].mesid.sat == 106, + "incorrect value for states[40].mesid.sat, expected 106, is %d", + check_msg->states[40].mesid.sat); + ck_assert_msg(check_msg->states[41].cn0 == 193, + "incorrect value for states[41].cn0, expected 193, is %d", + check_msg->states[41].cn0); + ck_assert_msg( + check_msg->states[41].mesid.code == 4, + "incorrect value for states[41].mesid.code, expected 4, is %d", + check_msg->states[41].mesid.code); + ck_assert_msg( + check_msg->states[41].mesid.sat == 104, + "incorrect value for states[41].mesid.sat, expected 104, is %d", + check_msg->states[41].mesid.sat); + ck_assert_msg(check_msg->states[42].cn0 == 0, + "incorrect value for states[42].cn0, expected 0, is %d", + check_msg->states[42].cn0); + ck_assert_msg( + check_msg->states[42].mesid.code == 0, + "incorrect value for states[42].mesid.code, expected 0, is %d", + check_msg->states[42].mesid.code); + ck_assert_msg(check_msg->states[42].mesid.sat == 0, + "incorrect value for states[42].mesid.sat, expected 0, is %d", + check_msg->states[42].mesid.sat); + ck_assert_msg(check_msg->states[43].cn0 == 208, + "incorrect value for states[43].cn0, expected 208, is %d", + check_msg->states[43].cn0); + ck_assert_msg( + check_msg->states[43].mesid.code == 4, + "incorrect value for states[43].mesid.code, expected 4, is %d", + check_msg->states[43].mesid.code); + ck_assert_msg( + check_msg->states[43].mesid.sat == 102, + "incorrect value for states[43].mesid.sat, expected 102, is %d", + check_msg->states[43].mesid.sat); + ck_assert_msg(check_msg->states[44].cn0 == 0, + "incorrect value for states[44].cn0, expected 0, is %d", + check_msg->states[44].cn0); + ck_assert_msg( + check_msg->states[44].mesid.code == 0, + "incorrect value for states[44].mesid.code, expected 0, is %d", + check_msg->states[44].mesid.code); + ck_assert_msg(check_msg->states[44].mesid.sat == 0, + "incorrect value for states[44].mesid.sat, expected 0, is %d", + check_msg->states[44].mesid.sat); + ck_assert_msg(check_msg->states[45].cn0 == 212, + "incorrect value for states[45].cn0, expected 212, is %d", + check_msg->states[45].cn0); + ck_assert_msg( + check_msg->states[45].mesid.code == 12, + "incorrect value for states[45].mesid.code, expected 12, is %d", + check_msg->states[45].mesid.code); + ck_assert_msg( + check_msg->states[45].mesid.sat == 27, + "incorrect value for states[45].mesid.sat, expected 27, is %d", + check_msg->states[45].mesid.sat); + ck_assert_msg(check_msg->states[46].cn0 == 161, + "incorrect value for states[46].cn0, expected 161, is %d", + check_msg->states[46].cn0); + ck_assert_msg( + check_msg->states[46].mesid.code == 12, + "incorrect value for states[46].mesid.code, expected 12, is %d", + check_msg->states[46].mesid.code); + ck_assert_msg( + check_msg->states[46].mesid.sat == 29, + "incorrect value for states[46].mesid.sat, expected 29, is %d", + check_msg->states[46].mesid.sat); + ck_assert_msg(check_msg->states[47].cn0 == 216, + "incorrect value for states[47].cn0, expected 216, is %d", + check_msg->states[47].cn0); + ck_assert_msg( + check_msg->states[47].mesid.code == 12, + "incorrect value for states[47].mesid.code, expected 12, is %d", + check_msg->states[47].mesid.code); + ck_assert_msg( + check_msg->states[47].mesid.sat == 32, + "incorrect value for states[47].mesid.sat, expected 32, is %d", + check_msg->states[47].mesid.sat); + ck_assert_msg(check_msg->states[48].cn0 == 216, + "incorrect value for states[48].cn0, expected 216, is %d", + check_msg->states[48].cn0); + ck_assert_msg( + check_msg->states[48].mesid.code == 12, + "incorrect value for states[48].mesid.code, expected 12, is %d", + check_msg->states[48].mesid.code); + ck_assert_msg( + check_msg->states[48].mesid.sat == 30, + "incorrect value for states[48].mesid.sat, expected 30, is %d", + check_msg->states[48].mesid.sat); + ck_assert_msg(check_msg->states[49].cn0 == 178, + "incorrect value for states[49].cn0, expected 178, is %d", + check_msg->states[49].cn0); + ck_assert_msg( + check_msg->states[49].mesid.code == 12, + "incorrect value for states[49].mesid.code, expected 12, is %d", + check_msg->states[49].mesid.code); + ck_assert_msg( + check_msg->states[49].mesid.sat == 20, + "incorrect value for states[49].mesid.sat, expected 20, is %d", + check_msg->states[49].mesid.sat); + ck_assert_msg(check_msg->states[50].cn0 == 0, + "incorrect value for states[50].cn0, expected 0, is %d", + check_msg->states[50].cn0); + ck_assert_msg( + check_msg->states[50].mesid.code == 0, + "incorrect value for states[50].mesid.code, expected 0, is %d", + check_msg->states[50].mesid.code); + ck_assert_msg(check_msg->states[50].mesid.sat == 0, + "incorrect value for states[50].mesid.sat, expected 0, is %d", + check_msg->states[50].mesid.sat); + ck_assert_msg(check_msg->states[51].cn0 == 0, + "incorrect value for states[51].cn0, expected 0, is %d", + check_msg->states[51].cn0); + ck_assert_msg( + check_msg->states[51].mesid.code == 0, + "incorrect value for states[51].mesid.code, expected 0, is %d", + check_msg->states[51].mesid.code); + ck_assert_msg(check_msg->states[51].mesid.sat == 0, + "incorrect value for states[51].mesid.sat, expected 0, is %d", + check_msg->states[51].mesid.sat); + ck_assert_msg(check_msg->states[52].cn0 == 0, + "incorrect value for states[52].cn0, expected 0, is %d", + check_msg->states[52].cn0); + ck_assert_msg( + check_msg->states[52].mesid.code == 0, + "incorrect value for states[52].mesid.code, expected 0, is %d", + check_msg->states[52].mesid.code); + ck_assert_msg(check_msg->states[52].mesid.sat == 0, + "incorrect value for states[52].mesid.sat, expected 0, is %d", + check_msg->states[52].mesid.sat); + ck_assert_msg(check_msg->states[53].cn0 == 0, + "incorrect value for states[53].cn0, expected 0, is %d", + check_msg->states[53].cn0); + ck_assert_msg( + check_msg->states[53].mesid.code == 0, + "incorrect value for states[53].mesid.code, expected 0, is %d", + check_msg->states[53].mesid.code); + ck_assert_msg(check_msg->states[53].mesid.sat == 0, + "incorrect value for states[53].mesid.sat, expected 0, is %d", + check_msg->states[53].mesid.sat); + ck_assert_msg(check_msg->states[54].cn0 == 0, + "incorrect value for states[54].cn0, expected 0, is %d", + check_msg->states[54].cn0); + ck_assert_msg( + check_msg->states[54].mesid.code == 0, + "incorrect value for states[54].mesid.code, expected 0, is %d", + check_msg->states[54].mesid.code); + ck_assert_msg(check_msg->states[54].mesid.sat == 0, + "incorrect value for states[54].mesid.sat, expected 0, is %d", + check_msg->states[54].mesid.sat); + ck_assert_msg(check_msg->states[55].cn0 == 0, + "incorrect value for states[55].cn0, expected 0, is %d", + check_msg->states[55].cn0); + ck_assert_msg( + check_msg->states[55].mesid.code == 0, + "incorrect value for states[55].mesid.code, expected 0, is %d", + check_msg->states[55].mesid.code); + ck_assert_msg(check_msg->states[55].mesid.sat == 0, + "incorrect value for states[55].mesid.sat, expected 0, is %d", + check_msg->states[55].mesid.sat); + ck_assert_msg(check_msg->states[56].cn0 == 0, + "incorrect value for states[56].cn0, expected 0, is %d", + check_msg->states[56].cn0); + ck_assert_msg( + check_msg->states[56].mesid.code == 0, + "incorrect value for states[56].mesid.code, expected 0, is %d", + check_msg->states[56].mesid.code); + ck_assert_msg(check_msg->states[56].mesid.sat == 0, + "incorrect value for states[56].mesid.sat, expected 0, is %d", + check_msg->states[56].mesid.sat); + ck_assert_msg(check_msg->states[57].cn0 == 0, + "incorrect value for states[57].cn0, expected 0, is %d", + check_msg->states[57].cn0); + ck_assert_msg( + check_msg->states[57].mesid.code == 0, + "incorrect value for states[57].mesid.code, expected 0, is %d", + check_msg->states[57].mesid.code); + ck_assert_msg(check_msg->states[57].mesid.sat == 0, + "incorrect value for states[57].mesid.sat, expected 0, is %d", + check_msg->states[57].mesid.sat); + ck_assert_msg(check_msg->states[58].cn0 == 0, + "incorrect value for states[58].cn0, expected 0, is %d", + check_msg->states[58].cn0); + ck_assert_msg( + check_msg->states[58].mesid.code == 0, + "incorrect value for states[58].mesid.code, expected 0, is %d", + check_msg->states[58].mesid.code); + ck_assert_msg(check_msg->states[58].mesid.sat == 0, + "incorrect value for states[58].mesid.sat, expected 0, is %d", + check_msg->states[58].mesid.sat); + ck_assert_msg(check_msg->states[59].cn0 == 0, + "incorrect value for states[59].cn0, expected 0, is %d", + check_msg->states[59].cn0); + ck_assert_msg( + check_msg->states[59].mesid.code == 0, + "incorrect value for states[59].mesid.code, expected 0, is %d", + check_msg->states[59].mesid.code); + ck_assert_msg(check_msg->states[59].mesid.sat == 0, + "incorrect value for states[59].mesid.sat, expected 0, is %d", + check_msg->states[59].mesid.sat); + ck_assert_msg(check_msg->states[60].cn0 == 0, + "incorrect value for states[60].cn0, expected 0, is %d", + check_msg->states[60].cn0); + ck_assert_msg( + check_msg->states[60].mesid.code == 0, + "incorrect value for states[60].mesid.code, expected 0, is %d", + check_msg->states[60].mesid.code); + ck_assert_msg(check_msg->states[60].mesid.sat == 0, + "incorrect value for states[60].mesid.sat, expected 0, is %d", + check_msg->states[60].mesid.sat); + ck_assert_msg(check_msg->states[61].cn0 == 0, + "incorrect value for states[61].cn0, expected 0, is %d", + check_msg->states[61].cn0); + ck_assert_msg( + check_msg->states[61].mesid.code == 0, + "incorrect value for states[61].mesid.code, expected 0, is %d", + check_msg->states[61].mesid.code); + ck_assert_msg(check_msg->states[61].mesid.sat == 0, + "incorrect value for states[61].mesid.sat, expected 0, is %d", + check_msg->states[61].mesid.sat); + ck_assert_msg(check_msg->states[62].cn0 == 0, + "incorrect value for states[62].cn0, expected 0, is %d", + check_msg->states[62].cn0); + ck_assert_msg( + check_msg->states[62].mesid.code == 0, + "incorrect value for states[62].mesid.code, expected 0, is %d", + check_msg->states[62].mesid.code); + ck_assert_msg(check_msg->states[62].mesid.sat == 0, + "incorrect value for states[62].mesid.sat, expected 0, is %d", + check_msg->states[62].mesid.sat); + ck_assert_msg(check_msg->states[63].cn0 == 203, + "incorrect value for states[63].cn0, expected 203, is %d", + check_msg->states[63].cn0); + ck_assert_msg( + check_msg->states[63].mesid.code == 14, + "incorrect value for states[63].mesid.code, expected 14, is %d", + check_msg->states[63].mesid.code); + ck_assert_msg( + check_msg->states[63].mesid.sat == 36, + "incorrect value for states[63].mesid.sat, expected 36, is %d", + check_msg->states[63].mesid.sat); + ck_assert_msg(check_msg->states[64].cn0 == 0, + "incorrect value for states[64].cn0, expected 0, is %d", + check_msg->states[64].cn0); + ck_assert_msg( + check_msg->states[64].mesid.code == 0, + "incorrect value for states[64].mesid.code, expected 0, is %d", + check_msg->states[64].mesid.code); + ck_assert_msg(check_msg->states[64].mesid.sat == 0, + "incorrect value for states[64].mesid.sat, expected 0, is %d", + check_msg->states[64].mesid.sat); + ck_assert_msg(check_msg->states[65].cn0 == 158, + "incorrect value for states[65].cn0, expected 158, is %d", + check_msg->states[65].cn0); + ck_assert_msg( + check_msg->states[65].mesid.code == 14, + "incorrect value for states[65].mesid.code, expected 14, is %d", + check_msg->states[65].mesid.code); + ck_assert_msg(check_msg->states[65].mesid.sat == 5, + "incorrect value for states[65].mesid.sat, expected 5, is %d", + check_msg->states[65].mesid.sat); + ck_assert_msg(check_msg->states[66].cn0 == 194, + "incorrect value for states[66].cn0, expected 194, is %d", + check_msg->states[66].cn0); + ck_assert_msg( + check_msg->states[66].mesid.code == 14, + "incorrect value for states[66].mesid.code, expected 14, is %d", + check_msg->states[66].mesid.code); + ck_assert_msg(check_msg->states[66].mesid.sat == 4, + "incorrect value for states[66].mesid.sat, expected 4, is %d", + check_msg->states[66].mesid.sat); + ck_assert_msg(check_msg->states[67].cn0 == 192, + "incorrect value for states[67].cn0, expected 192, is %d", + check_msg->states[67].cn0); + ck_assert_msg( + check_msg->states[67].mesid.code == 14, + "incorrect value for states[67].mesid.code, expected 14, is %d", + check_msg->states[67].mesid.code); + ck_assert_msg( + check_msg->states[67].mesid.sat == 11, + "incorrect value for states[67].mesid.sat, expected 11, is %d", + check_msg->states[67].mesid.sat); + ck_assert_msg(check_msg->states[68].cn0 == 207, + "incorrect value for states[68].cn0, expected 207, is %d", + check_msg->states[68].cn0); + ck_assert_msg( + check_msg->states[68].mesid.code == 14, + "incorrect value for states[68].mesid.code, expected 14, is %d", + check_msg->states[68].mesid.code); + ck_assert_msg(check_msg->states[68].mesid.sat == 9, + "incorrect value for states[68].mesid.sat, expected 9, is %d", + check_msg->states[68].mesid.sat); + ck_assert_msg(check_msg->states[69].cn0 == 0, + "incorrect value for states[69].cn0, expected 0, is %d", + check_msg->states[69].cn0); + ck_assert_msg( + check_msg->states[69].mesid.code == 0, + "incorrect value for states[69].mesid.code, expected 0, is %d", + check_msg->states[69].mesid.code); + ck_assert_msg(check_msg->states[69].mesid.sat == 0, + "incorrect value for states[69].mesid.sat, expected 0, is %d", + check_msg->states[69].mesid.sat); + ck_assert_msg(check_msg->states[70].cn0 == 0, + "incorrect value for states[70].cn0, expected 0, is %d", + check_msg->states[70].cn0); + ck_assert_msg( + check_msg->states[70].mesid.code == 0, + "incorrect value for states[70].mesid.code, expected 0, is %d", + check_msg->states[70].mesid.code); + ck_assert_msg(check_msg->states[70].mesid.sat == 0, + "incorrect value for states[70].mesid.sat, expected 0, is %d", + check_msg->states[70].mesid.sat); + ck_assert_msg(check_msg->states[71].cn0 == 0, + "incorrect value for states[71].cn0, expected 0, is %d", + check_msg->states[71].cn0); + ck_assert_msg( + check_msg->states[71].mesid.code == 0, + "incorrect value for states[71].mesid.code, expected 0, is %d", + check_msg->states[71].mesid.code); + ck_assert_msg(check_msg->states[71].mesid.sat == 0, + "incorrect value for states[71].mesid.sat, expected 0, is %d", + check_msg->states[71].mesid.sat); + ck_assert_msg(check_msg->states[72].cn0 == 218, + "incorrect value for states[72].cn0, expected 218, is %d", + check_msg->states[72].cn0); + ck_assert_msg( + check_msg->states[72].mesid.code == 20, + "incorrect value for states[72].mesid.code, expected 20, is %d", + check_msg->states[72].mesid.code); + ck_assert_msg(check_msg->states[72].mesid.sat == 9, + "incorrect value for states[72].mesid.sat, expected 9, is %d", + check_msg->states[72].mesid.sat); + ck_assert_msg(check_msg->states[73].cn0 == 176, + "incorrect value for states[73].cn0, expected 176, is %d", + check_msg->states[73].cn0); + ck_assert_msg( + check_msg->states[73].mesid.code == 20, + "incorrect value for states[73].mesid.code, expected 20, is %d", + check_msg->states[73].mesid.code); + ck_assert_msg(check_msg->states[73].mesid.sat == 5, + "incorrect value for states[73].mesid.sat, expected 5, is %d", + check_msg->states[73].mesid.sat); + ck_assert_msg(check_msg->states[74].cn0 == 217, + "incorrect value for states[74].cn0, expected 217, is %d", + check_msg->states[74].cn0); + ck_assert_msg( + check_msg->states[74].mesid.code == 20, + "incorrect value for states[74].mesid.code, expected 20, is %d", + check_msg->states[74].mesid.code); + ck_assert_msg( + check_msg->states[74].mesid.sat == 36, + "incorrect value for states[74].mesid.sat, expected 36, is %d", + check_msg->states[74].mesid.sat); + ck_assert_msg(check_msg->states[75].cn0 == 200, + "incorrect value for states[75].cn0, expected 200, is %d", + check_msg->states[75].cn0); + ck_assert_msg( + check_msg->states[75].mesid.code == 20, + "incorrect value for states[75].mesid.code, expected 20, is %d", + check_msg->states[75].mesid.code); + ck_assert_msg( + check_msg->states[75].mesid.sat == 11, + "incorrect value for states[75].mesid.sat, expected 11, is %d", + check_msg->states[75].mesid.sat); + ck_assert_msg(check_msg->states[76].cn0 == 205, + "incorrect value for states[76].cn0, expected 205, is %d", + check_msg->states[76].cn0); + ck_assert_msg( + check_msg->states[76].mesid.code == 20, + "incorrect value for states[76].mesid.code, expected 20, is %d", + check_msg->states[76].mesid.code); + ck_assert_msg(check_msg->states[76].mesid.sat == 4, + "incorrect value for states[76].mesid.sat, expected 4, is %d", + check_msg->states[76].mesid.sat); + ck_assert_msg(check_msg->states[77].cn0 == 0, + "incorrect value for states[77].cn0, expected 0, is %d", + check_msg->states[77].cn0); + ck_assert_msg( + check_msg->states[77].mesid.code == 0, + "incorrect value for states[77].mesid.code, expected 0, is %d", + check_msg->states[77].mesid.code); + ck_assert_msg(check_msg->states[77].mesid.sat == 0, + "incorrect value for states[77].mesid.sat, expected 0, is %d", + check_msg->states[77].mesid.sat); + ck_assert_msg(check_msg->states[78].cn0 == 0, + "incorrect value for states[78].cn0, expected 0, is %d", + check_msg->states[78].cn0); + ck_assert_msg( + check_msg->states[78].mesid.code == 0, + "incorrect value for states[78].mesid.code, expected 0, is %d", + check_msg->states[78].mesid.code); + ck_assert_msg(check_msg->states[78].mesid.sat == 0, + "incorrect value for states[78].mesid.sat, expected 0, is %d", + check_msg->states[78].mesid.sat); } } END_TEST -Suite* legacy_auto_check_sbp_tracking_MsgMeasurementState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_tracking_MsgMeasurementState"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_tracking_MsgMeasurementState"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_tracking_MsgMeasurementState); +Suite *legacy_auto_check_sbp_tracking_MsgMeasurementState_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_tracking_MsgMeasurementState"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_tracking_MsgMeasurementState"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_tracking_MsgMeasurementState); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_tracking_MsgTrackingIq.c b/c/test/legacy/auto_check_sbp_tracking_MsgTrackingIq.c index 9de2006dd..d72eb3d49 100644 --- a/c/test/legacy/auto_check_sbp_tracking_MsgTrackingIq.c +++ b/c/test/legacy/auto_check_sbp_tracking_MsgTrackingIq.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIq.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingIq ) -{ +START_TEST(test_legacy_auto_check_sbp_tracking_MsgTrackingIq) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingIq ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,22 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingIq ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x2d, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x2d, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x2d, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x2d, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,45,0,2,80,15,145,121,203,47,217,239,55,45,38,189,88,159,19,208,12,97,167, }; + u8 encoded_frame[] = { + 85, 45, 0, 2, 80, 15, 145, 121, 203, 47, 217, 239, + 55, 45, 38, 189, 88, 159, 19, 208, 12, 97, 167, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_iq_t* test_msg = ( msg_tracking_iq_t* )test_msg_storage; + msg_tracking_iq_t *test_msg = (msg_tracking_iq_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->channel = 145; if (sizeof(test_msg->corrs) == 0) { @@ -164,71 +166,96 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingIq ) test_msg->corrs[2].Q = 3280; test_msg->sid.code = 203; test_msg->sid.sat = 121; - sbp_payload_send(&sbp_state, 0x2d, 20482, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x2d, 20482, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 20482, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 20482, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x2d, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_iq_t* check_msg = ( msg_tracking_iq_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_iq_t *check_msg = (msg_tracking_iq_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->channel == 145, "incorrect value for channel, expected 145, is %d", check_msg->channel); - ck_assert_msg(check_msg->corrs[0].I == -9937, "incorrect value for corrs[0].I, expected -9937, is %d", check_msg->corrs[0].I); - ck_assert_msg(check_msg->corrs[0].Q == 14319, "incorrect value for corrs[0].Q, expected 14319, is %d", check_msg->corrs[0].Q); - ck_assert_msg(check_msg->corrs[1].I == 9773, "incorrect value for corrs[1].I, expected 9773, is %d", check_msg->corrs[1].I); - ck_assert_msg(check_msg->corrs[1].Q == 22717, "incorrect value for corrs[1].Q, expected 22717, is %d", check_msg->corrs[1].Q); - ck_assert_msg(check_msg->corrs[2].I == 5023, "incorrect value for corrs[2].I, expected 5023, is %d", check_msg->corrs[2].I); - ck_assert_msg(check_msg->corrs[2].Q == 3280, "incorrect value for corrs[2].Q, expected 3280, is %d", check_msg->corrs[2].Q); - ck_assert_msg(check_msg->sid.code == 203, "incorrect value for sid.code, expected 203, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.sat == 121, "incorrect value for sid.sat, expected 121, is %d", check_msg->sid.sat); + ck_assert_msg(check_msg->channel == 145, + "incorrect value for channel, expected 145, is %d", + check_msg->channel); + ck_assert_msg(check_msg->corrs[0].I == -9937, + "incorrect value for corrs[0].I, expected -9937, is %d", + check_msg->corrs[0].I); + ck_assert_msg(check_msg->corrs[0].Q == 14319, + "incorrect value for corrs[0].Q, expected 14319, is %d", + check_msg->corrs[0].Q); + ck_assert_msg(check_msg->corrs[1].I == 9773, + "incorrect value for corrs[1].I, expected 9773, is %d", + check_msg->corrs[1].I); + ck_assert_msg(check_msg->corrs[1].Q == 22717, + "incorrect value for corrs[1].Q, expected 22717, is %d", + check_msg->corrs[1].Q); + ck_assert_msg(check_msg->corrs[2].I == 5023, + "incorrect value for corrs[2].I, expected 5023, is %d", + check_msg->corrs[2].I); + ck_assert_msg(check_msg->corrs[2].Q == 3280, + "incorrect value for corrs[2].Q, expected 3280, is %d", + check_msg->corrs[2].Q); + ck_assert_msg(check_msg->sid.code == 203, + "incorrect value for sid.code, expected 203, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.sat == 121, + "incorrect value for sid.sat, expected 121, is %d", + check_msg->sid.sat); } } END_TEST -Suite* legacy_auto_check_sbp_tracking_MsgTrackingIq_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_tracking_MsgTrackingIq"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_tracking_MsgTrackingIq"); +Suite *legacy_auto_check_sbp_tracking_MsgTrackingIq_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_tracking_MsgTrackingIq"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_tracking_MsgTrackingIq"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_tracking_MsgTrackingIq); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_tracking_MsgTrackingIqDepA.c b/c/test/legacy/auto_check_sbp_tracking_MsgTrackingIqDepA.c index 2255b3eaa..f5cec444c 100644 --- a/c/test/legacy/auto_check_sbp_tracking_MsgTrackingIqDepA.c +++ b/c/test/legacy/auto_check_sbp_tracking_MsgTrackingIqDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,24 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x1c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x1c, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x1c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x1c, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,28,0,184,67,29,139,28,250,15,0,99,90,170,96,71,121,33,161,52,211,162,101,41,36,226,99,71,75,14,240,134,82,175,83,17,34, }; + u8 encoded_frame[] = { + 85, 28, 0, 184, 67, 29, 139, 28, 250, 15, 0, 99, 90, + 170, 96, 71, 121, 33, 161, 52, 211, 162, 101, 41, 36, 226, + 99, 71, 75, 14, 240, 134, 82, 175, 83, 17, 34, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_iq_dep_a_t* test_msg = ( msg_tracking_iq_dep_a_t* )test_msg_storage; + msg_tracking_iq_dep_a_t *test_msg = + (msg_tracking_iq_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->channel = 139; if (sizeof(test_msg->corrs) == 0) { @@ -165,72 +169,101 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepA ) test_msg->sid.code = 15; test_msg->sid.reserved = 0; test_msg->sid.sat = 64028; - sbp_payload_send(&sbp_state, 0x1c, 17336, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x1c, 17336, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 17336, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 17336, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x1c, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_iq_dep_a_t* check_msg = ( msg_tracking_iq_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_iq_dep_a_t *check_msg = + (msg_tracking_iq_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->channel == 139, "incorrect value for channel, expected 139, is %d", check_msg->channel); - ck_assert_msg(check_msg->corrs[0].I == 1621776995, "incorrect value for corrs[0].I, expected 1621776995, is %d", check_msg->corrs[0].I); - ck_assert_msg(check_msg->corrs[0].Q == -1591641785, "incorrect value for corrs[0].Q, expected -1591641785, is %d", check_msg->corrs[0].Q); - ck_assert_msg(check_msg->corrs[1].I == 1705169716, "incorrect value for corrs[1].I, expected 1705169716, is %d", check_msg->corrs[1].I); - ck_assert_msg(check_msg->corrs[1].Q == 1675764777, "incorrect value for corrs[1].Q, expected 1675764777, is %d", check_msg->corrs[1].Q); - ck_assert_msg(check_msg->corrs[2].I == -267498681, "incorrect value for corrs[2].I, expected -267498681, is %d", check_msg->corrs[2].I); - ck_assert_msg(check_msg->corrs[2].Q == 1403998854, "incorrect value for corrs[2].Q, expected 1403998854, is %d", check_msg->corrs[2].Q); - ck_assert_msg(check_msg->sid.code == 15, "incorrect value for sid.code, expected 15, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 64028, "incorrect value for sid.sat, expected 64028, is %d", check_msg->sid.sat); + ck_assert_msg(check_msg->channel == 139, + "incorrect value for channel, expected 139, is %d", + check_msg->channel); + ck_assert_msg(check_msg->corrs[0].I == 1621776995, + "incorrect value for corrs[0].I, expected 1621776995, is %d", + check_msg->corrs[0].I); + ck_assert_msg(check_msg->corrs[0].Q == -1591641785, + "incorrect value for corrs[0].Q, expected -1591641785, is %d", + check_msg->corrs[0].Q); + ck_assert_msg(check_msg->corrs[1].I == 1705169716, + "incorrect value for corrs[1].I, expected 1705169716, is %d", + check_msg->corrs[1].I); + ck_assert_msg(check_msg->corrs[1].Q == 1675764777, + "incorrect value for corrs[1].Q, expected 1675764777, is %d", + check_msg->corrs[1].Q); + ck_assert_msg(check_msg->corrs[2].I == -267498681, + "incorrect value for corrs[2].I, expected -267498681, is %d", + check_msg->corrs[2].I); + ck_assert_msg(check_msg->corrs[2].Q == 1403998854, + "incorrect value for corrs[2].Q, expected 1403998854, is %d", + check_msg->corrs[2].Q); + ck_assert_msg(check_msg->sid.code == 15, + "incorrect value for sid.code, expected 15, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 64028, + "incorrect value for sid.sat, expected 64028, is %d", + check_msg->sid.sat); } } END_TEST -Suite* legacy_auto_check_sbp_tracking_MsgTrackingIqDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_tracking_MsgTrackingIqDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_tracking_MsgTrackingIqDepA"); +Suite *legacy_auto_check_sbp_tracking_MsgTrackingIqDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_tracking_MsgTrackingIqDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_tracking_MsgTrackingIqDepA"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepA); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_tracking_MsgTrackingIqDepB.c b/c/test/legacy/auto_check_sbp_tracking_MsgTrackingIqDepB.c index 3e30a5152..59427492d 100644 --- a/c/test/legacy/auto_check_sbp_tracking_MsgTrackingIqDepB.c +++ b/c/test/legacy/auto_check_sbp_tracking_MsgTrackingIqDepB.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepB ) -{ +START_TEST(test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepB) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,24 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x2c, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x2c, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x2c, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x2c, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,44,0,39,101,27,45,188,183,72,185,157,15,187,249,101,24,135,146,180,224,123,235,142,208,102,112,25,21,177,96,116,68,246,153, }; + u8 encoded_frame[] = { + 85, 44, 0, 39, 101, 27, 45, 188, 183, 72, 185, 157, + 15, 187, 249, 101, 24, 135, 146, 180, 224, 123, 235, 142, + 208, 102, 112, 25, 21, 177, 96, 116, 68, 246, 153, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_iq_dep_b_t* test_msg = ( msg_tracking_iq_dep_b_t* )test_msg_storage; + msg_tracking_iq_dep_b_t *test_msg = + (msg_tracking_iq_dep_b_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->channel = 45; if (sizeof(test_msg->corrs) == 0) { @@ -164,71 +168,98 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepB ) test_msg->corrs[2].Q = 1148477617; test_msg->sid.code = 183; test_msg->sid.sat = 188; - sbp_payload_send(&sbp_state, 0x2c, 25895, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x2c, 25895, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 25895, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 25895, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x2c, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_iq_dep_b_t* check_msg = ( msg_tracking_iq_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_iq_dep_b_t *check_msg = + (msg_tracking_iq_dep_b_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->channel == 45, "incorrect value for channel, expected 45, is %d", check_msg->channel); - ck_assert_msg(check_msg->corrs[0].I == 261994824, "incorrect value for corrs[0].I, expected 261994824, is %d", check_msg->corrs[0].I); - ck_assert_msg(check_msg->corrs[0].Q == 409336251, "incorrect value for corrs[0].Q, expected 409336251, is %d", check_msg->corrs[0].Q); - ck_assert_msg(check_msg->corrs[1].I == -525036921, "incorrect value for corrs[1].I, expected -525036921, is %d", check_msg->corrs[1].I); - ck_assert_msg(check_msg->corrs[1].Q == -795939973, "incorrect value for corrs[1].Q, expected -795939973, is %d", check_msg->corrs[1].Q); - ck_assert_msg(check_msg->corrs[2].I == 353988710, "incorrect value for corrs[2].I, expected 353988710, is %d", check_msg->corrs[2].I); - ck_assert_msg(check_msg->corrs[2].Q == 1148477617, "incorrect value for corrs[2].Q, expected 1148477617, is %d", check_msg->corrs[2].Q); - ck_assert_msg(check_msg->sid.code == 183, "incorrect value for sid.code, expected 183, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.sat == 188, "incorrect value for sid.sat, expected 188, is %d", check_msg->sid.sat); + ck_assert_msg(check_msg->channel == 45, + "incorrect value for channel, expected 45, is %d", + check_msg->channel); + ck_assert_msg(check_msg->corrs[0].I == 261994824, + "incorrect value for corrs[0].I, expected 261994824, is %d", + check_msg->corrs[0].I); + ck_assert_msg(check_msg->corrs[0].Q == 409336251, + "incorrect value for corrs[0].Q, expected 409336251, is %d", + check_msg->corrs[0].Q); + ck_assert_msg(check_msg->corrs[1].I == -525036921, + "incorrect value for corrs[1].I, expected -525036921, is %d", + check_msg->corrs[1].I); + ck_assert_msg(check_msg->corrs[1].Q == -795939973, + "incorrect value for corrs[1].Q, expected -795939973, is %d", + check_msg->corrs[1].Q); + ck_assert_msg(check_msg->corrs[2].I == 353988710, + "incorrect value for corrs[2].I, expected 353988710, is %d", + check_msg->corrs[2].I); + ck_assert_msg(check_msg->corrs[2].Q == 1148477617, + "incorrect value for corrs[2].Q, expected 1148477617, is %d", + check_msg->corrs[2].Q); + ck_assert_msg(check_msg->sid.code == 183, + "incorrect value for sid.code, expected 183, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.sat == 188, + "incorrect value for sid.sat, expected 188, is %d", + check_msg->sid.sat); } } END_TEST -Suite* legacy_auto_check_sbp_tracking_MsgTrackingIqDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_tracking_MsgTrackingIqDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_tracking_MsgTrackingIqDepB"); +Suite *legacy_auto_check_sbp_tracking_MsgTrackingIqDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_tracking_MsgTrackingIqDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_tracking_MsgTrackingIqDepB"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepB); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_tracking_MsgTrackingState.c b/c/test/legacy/auto_check_sbp_tracking_MsgTrackingState.c index a8f224779..eda94d66c 100644 --- a/c/test/legacy/auto_check_sbp_tracking_MsgTrackingState.c +++ b/c/test/legacy/auto_check_sbp_tracking_MsgTrackingState.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingState.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingState ) -{ +START_TEST(test_legacy_auto_check_sbp_tracking_MsgTrackingState) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingState ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,39 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingState ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x41, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x41, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x41, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x41, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,65,0,55,129,252,117,184,3,102,38,106,140,141,25,4,90,195,246,108,75,82,137,127,45,163,32,46,187,93,153,60,201,147,23,29,5,208,181,30,219,69,254,136,3,121,33,98,144,215,133,182,14,56,169,77,218,62,242,84,171,249,152,137,131,130,193,21,42,68,253,227,216,227,24,26,210,179,19,15,227,255,122,75,187,200,217,48,218,122,187,238,142,149,238,55,251,212,128,160,194,104,113,255,141,62,43,69,245,39,100,230,108,56,247,68,149,143,137,101,233,70,49,165,38,110,218,230,80,213,196,179,139,128,15,178,196,171,8,212,97,194,83,233,79,99,55,90,31,180,5,25,105,186,22,224,80,111,8,48,106,166,4,48,156,49,86,19,142,146,91,124,115,64,28,230,115,178,190,131,16,242,105,59,182,113,192,180,48,179,166,31,172,211,77,228,140,49,128,77,240,194,134,194,41,58,18,53,129,55,91,72,134,92,33,224,157,56,186,54,224,174,82,84,148,190,236,54,62,67,52,215,57,254,16,133,36,174,219,172,145,17,192,179,111,97,207,56,208,134,180,17,43,226,255,182,140,113,141,111, }; + u8 encoded_frame[] = { + 85, 65, 0, 55, 129, 252, 117, 184, 3, 102, 38, 106, 140, 141, + 25, 4, 90, 195, 246, 108, 75, 82, 137, 127, 45, 163, 32, 46, + 187, 93, 153, 60, 201, 147, 23, 29, 5, 208, 181, 30, 219, 69, + 254, 136, 3, 121, 33, 98, 144, 215, 133, 182, 14, 56, 169, 77, + 218, 62, 242, 84, 171, 249, 152, 137, 131, 130, 193, 21, 42, 68, + 253, 227, 216, 227, 24, 26, 210, 179, 19, 15, 227, 255, 122, 75, + 187, 200, 217, 48, 218, 122, 187, 238, 142, 149, 238, 55, 251, 212, + 128, 160, 194, 104, 113, 255, 141, 62, 43, 69, 245, 39, 100, 230, + 108, 56, 247, 68, 149, 143, 137, 101, 233, 70, 49, 165, 38, 110, + 218, 230, 80, 213, 196, 179, 139, 128, 15, 178, 196, 171, 8, 212, + 97, 194, 83, 233, 79, 99, 55, 90, 31, 180, 5, 25, 105, 186, + 22, 224, 80, 111, 8, 48, 106, 166, 4, 48, 156, 49, 86, 19, + 142, 146, 91, 124, 115, 64, 28, 230, 115, 178, 190, 131, 16, 242, + 105, 59, 182, 113, 192, 180, 48, 179, 166, 31, 172, 211, 77, 228, + 140, 49, 128, 77, 240, 194, 134, 194, 41, 58, 18, 53, 129, 55, + 91, 72, 134, 92, 33, 224, 157, 56, 186, 54, 224, 174, 82, 84, + 148, 190, 236, 54, 62, 67, 52, 215, 57, 254, 16, 133, 36, 174, + 219, 172, 145, 17, 192, 179, 111, 97, 207, 56, 208, 134, 180, 17, + 43, 226, 255, 182, 140, 113, 141, 111, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_state_t* test_msg = ( msg_tracking_state_t* )test_msg_storage; + msg_tracking_state_t *test_msg = (msg_tracking_state_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->states) == 0) { // Cope with variable length arrays @@ -647,314 +666,854 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingState ) test_msg->states[62].fcn = 140; test_msg->states[62].sid.code = 182; test_msg->states[62].sid.sat = 255; - sbp_payload_send(&sbp_state, 0x41, 33079, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x41, 33079, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 33079, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 33079, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x41, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_state_t* check_msg = ( msg_tracking_state_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_state_t *check_msg = + (msg_tracking_state_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->states[0].cn0 == 102, "incorrect value for states[0].cn0, expected 102, is %d", check_msg->states[0].cn0); - ck_assert_msg(check_msg->states[0].fcn == 3, "incorrect value for states[0].fcn, expected 3, is %d", check_msg->states[0].fcn); - ck_assert_msg(check_msg->states[0].sid.code == 184, "incorrect value for states[0].sid.code, expected 184, is %d", check_msg->states[0].sid.code); - ck_assert_msg(check_msg->states[0].sid.sat == 117, "incorrect value for states[0].sid.sat, expected 117, is %d", check_msg->states[0].sid.sat); - ck_assert_msg(check_msg->states[1].cn0 == 141, "incorrect value for states[1].cn0, expected 141, is %d", check_msg->states[1].cn0); - ck_assert_msg(check_msg->states[1].fcn == 140, "incorrect value for states[1].fcn, expected 140, is %d", check_msg->states[1].fcn); - ck_assert_msg(check_msg->states[1].sid.code == 106, "incorrect value for states[1].sid.code, expected 106, is %d", check_msg->states[1].sid.code); - ck_assert_msg(check_msg->states[1].sid.sat == 38, "incorrect value for states[1].sid.sat, expected 38, is %d", check_msg->states[1].sid.sat); - ck_assert_msg(check_msg->states[2].cn0 == 195, "incorrect value for states[2].cn0, expected 195, is %d", check_msg->states[2].cn0); - ck_assert_msg(check_msg->states[2].fcn == 90, "incorrect value for states[2].fcn, expected 90, is %d", check_msg->states[2].fcn); - ck_assert_msg(check_msg->states[2].sid.code == 4, "incorrect value for states[2].sid.code, expected 4, is %d", check_msg->states[2].sid.code); - ck_assert_msg(check_msg->states[2].sid.sat == 25, "incorrect value for states[2].sid.sat, expected 25, is %d", check_msg->states[2].sid.sat); - ck_assert_msg(check_msg->states[3].cn0 == 82, "incorrect value for states[3].cn0, expected 82, is %d", check_msg->states[3].cn0); - ck_assert_msg(check_msg->states[3].fcn == 75, "incorrect value for states[3].fcn, expected 75, is %d", check_msg->states[3].fcn); - ck_assert_msg(check_msg->states[3].sid.code == 108, "incorrect value for states[3].sid.code, expected 108, is %d", check_msg->states[3].sid.code); - ck_assert_msg(check_msg->states[3].sid.sat == 246, "incorrect value for states[3].sid.sat, expected 246, is %d", check_msg->states[3].sid.sat); - ck_assert_msg(check_msg->states[4].cn0 == 163, "incorrect value for states[4].cn0, expected 163, is %d", check_msg->states[4].cn0); - ck_assert_msg(check_msg->states[4].fcn == 45, "incorrect value for states[4].fcn, expected 45, is %d", check_msg->states[4].fcn); - ck_assert_msg(check_msg->states[4].sid.code == 127, "incorrect value for states[4].sid.code, expected 127, is %d", check_msg->states[4].sid.code); - ck_assert_msg(check_msg->states[4].sid.sat == 137, "incorrect value for states[4].sid.sat, expected 137, is %d", check_msg->states[4].sid.sat); - ck_assert_msg(check_msg->states[5].cn0 == 93, "incorrect value for states[5].cn0, expected 93, is %d", check_msg->states[5].cn0); - ck_assert_msg(check_msg->states[5].fcn == 187, "incorrect value for states[5].fcn, expected 187, is %d", check_msg->states[5].fcn); - ck_assert_msg(check_msg->states[5].sid.code == 46, "incorrect value for states[5].sid.code, expected 46, is %d", check_msg->states[5].sid.code); - ck_assert_msg(check_msg->states[5].sid.sat == 32, "incorrect value for states[5].sid.sat, expected 32, is %d", check_msg->states[5].sid.sat); - ck_assert_msg(check_msg->states[6].cn0 == 147, "incorrect value for states[6].cn0, expected 147, is %d", check_msg->states[6].cn0); - ck_assert_msg(check_msg->states[6].fcn == 201, "incorrect value for states[6].fcn, expected 201, is %d", check_msg->states[6].fcn); - ck_assert_msg(check_msg->states[6].sid.code == 60, "incorrect value for states[6].sid.code, expected 60, is %d", check_msg->states[6].sid.code); - ck_assert_msg(check_msg->states[6].sid.sat == 153, "incorrect value for states[6].sid.sat, expected 153, is %d", check_msg->states[6].sid.sat); - ck_assert_msg(check_msg->states[7].cn0 == 208, "incorrect value for states[7].cn0, expected 208, is %d", check_msg->states[7].cn0); - ck_assert_msg(check_msg->states[7].fcn == 5, "incorrect value for states[7].fcn, expected 5, is %d", check_msg->states[7].fcn); - ck_assert_msg(check_msg->states[7].sid.code == 29, "incorrect value for states[7].sid.code, expected 29, is %d", check_msg->states[7].sid.code); - ck_assert_msg(check_msg->states[7].sid.sat == 23, "incorrect value for states[7].sid.sat, expected 23, is %d", check_msg->states[7].sid.sat); - ck_assert_msg(check_msg->states[8].cn0 == 69, "incorrect value for states[8].cn0, expected 69, is %d", check_msg->states[8].cn0); - ck_assert_msg(check_msg->states[8].fcn == 219, "incorrect value for states[8].fcn, expected 219, is %d", check_msg->states[8].fcn); - ck_assert_msg(check_msg->states[8].sid.code == 30, "incorrect value for states[8].sid.code, expected 30, is %d", check_msg->states[8].sid.code); - ck_assert_msg(check_msg->states[8].sid.sat == 181, "incorrect value for states[8].sid.sat, expected 181, is %d", check_msg->states[8].sid.sat); - ck_assert_msg(check_msg->states[9].cn0 == 121, "incorrect value for states[9].cn0, expected 121, is %d", check_msg->states[9].cn0); - ck_assert_msg(check_msg->states[9].fcn == 3, "incorrect value for states[9].fcn, expected 3, is %d", check_msg->states[9].fcn); - ck_assert_msg(check_msg->states[9].sid.code == 136, "incorrect value for states[9].sid.code, expected 136, is %d", check_msg->states[9].sid.code); - ck_assert_msg(check_msg->states[9].sid.sat == 254, "incorrect value for states[9].sid.sat, expected 254, is %d", check_msg->states[9].sid.sat); - ck_assert_msg(check_msg->states[10].cn0 == 215, "incorrect value for states[10].cn0, expected 215, is %d", check_msg->states[10].cn0); - ck_assert_msg(check_msg->states[10].fcn == 144, "incorrect value for states[10].fcn, expected 144, is %d", check_msg->states[10].fcn); - ck_assert_msg(check_msg->states[10].sid.code == 98, "incorrect value for states[10].sid.code, expected 98, is %d", check_msg->states[10].sid.code); - ck_assert_msg(check_msg->states[10].sid.sat == 33, "incorrect value for states[10].sid.sat, expected 33, is %d", check_msg->states[10].sid.sat); - ck_assert_msg(check_msg->states[11].cn0 == 56, "incorrect value for states[11].cn0, expected 56, is %d", check_msg->states[11].cn0); - ck_assert_msg(check_msg->states[11].fcn == 14, "incorrect value for states[11].fcn, expected 14, is %d", check_msg->states[11].fcn); - ck_assert_msg(check_msg->states[11].sid.code == 182, "incorrect value for states[11].sid.code, expected 182, is %d", check_msg->states[11].sid.code); - ck_assert_msg(check_msg->states[11].sid.sat == 133, "incorrect value for states[11].sid.sat, expected 133, is %d", check_msg->states[11].sid.sat); - ck_assert_msg(check_msg->states[12].cn0 == 62, "incorrect value for states[12].cn0, expected 62, is %d", check_msg->states[12].cn0); - ck_assert_msg(check_msg->states[12].fcn == 218, "incorrect value for states[12].fcn, expected 218, is %d", check_msg->states[12].fcn); - ck_assert_msg(check_msg->states[12].sid.code == 77, "incorrect value for states[12].sid.code, expected 77, is %d", check_msg->states[12].sid.code); - ck_assert_msg(check_msg->states[12].sid.sat == 169, "incorrect value for states[12].sid.sat, expected 169, is %d", check_msg->states[12].sid.sat); - ck_assert_msg(check_msg->states[13].cn0 == 249, "incorrect value for states[13].cn0, expected 249, is %d", check_msg->states[13].cn0); - ck_assert_msg(check_msg->states[13].fcn == 171, "incorrect value for states[13].fcn, expected 171, is %d", check_msg->states[13].fcn); - ck_assert_msg(check_msg->states[13].sid.code == 84, "incorrect value for states[13].sid.code, expected 84, is %d", check_msg->states[13].sid.code); - ck_assert_msg(check_msg->states[13].sid.sat == 242, "incorrect value for states[13].sid.sat, expected 242, is %d", check_msg->states[13].sid.sat); - ck_assert_msg(check_msg->states[14].cn0 == 130, "incorrect value for states[14].cn0, expected 130, is %d", check_msg->states[14].cn0); - ck_assert_msg(check_msg->states[14].fcn == 131, "incorrect value for states[14].fcn, expected 131, is %d", check_msg->states[14].fcn); - ck_assert_msg(check_msg->states[14].sid.code == 137, "incorrect value for states[14].sid.code, expected 137, is %d", check_msg->states[14].sid.code); - ck_assert_msg(check_msg->states[14].sid.sat == 152, "incorrect value for states[14].sid.sat, expected 152, is %d", check_msg->states[14].sid.sat); - ck_assert_msg(check_msg->states[15].cn0 == 68, "incorrect value for states[15].cn0, expected 68, is %d", check_msg->states[15].cn0); - ck_assert_msg(check_msg->states[15].fcn == 42, "incorrect value for states[15].fcn, expected 42, is %d", check_msg->states[15].fcn); - ck_assert_msg(check_msg->states[15].sid.code == 21, "incorrect value for states[15].sid.code, expected 21, is %d", check_msg->states[15].sid.code); - ck_assert_msg(check_msg->states[15].sid.sat == 193, "incorrect value for states[15].sid.sat, expected 193, is %d", check_msg->states[15].sid.sat); - ck_assert_msg(check_msg->states[16].cn0 == 227, "incorrect value for states[16].cn0, expected 227, is %d", check_msg->states[16].cn0); - ck_assert_msg(check_msg->states[16].fcn == 216, "incorrect value for states[16].fcn, expected 216, is %d", check_msg->states[16].fcn); - ck_assert_msg(check_msg->states[16].sid.code == 227, "incorrect value for states[16].sid.code, expected 227, is %d", check_msg->states[16].sid.code); - ck_assert_msg(check_msg->states[16].sid.sat == 253, "incorrect value for states[16].sid.sat, expected 253, is %d", check_msg->states[16].sid.sat); - ck_assert_msg(check_msg->states[17].cn0 == 179, "incorrect value for states[17].cn0, expected 179, is %d", check_msg->states[17].cn0); - ck_assert_msg(check_msg->states[17].fcn == 210, "incorrect value for states[17].fcn, expected 210, is %d", check_msg->states[17].fcn); - ck_assert_msg(check_msg->states[17].sid.code == 26, "incorrect value for states[17].sid.code, expected 26, is %d", check_msg->states[17].sid.code); - ck_assert_msg(check_msg->states[17].sid.sat == 24, "incorrect value for states[17].sid.sat, expected 24, is %d", check_msg->states[17].sid.sat); - ck_assert_msg(check_msg->states[18].cn0 == 255, "incorrect value for states[18].cn0, expected 255, is %d", check_msg->states[18].cn0); - ck_assert_msg(check_msg->states[18].fcn == 227, "incorrect value for states[18].fcn, expected 227, is %d", check_msg->states[18].fcn); - ck_assert_msg(check_msg->states[18].sid.code == 15, "incorrect value for states[18].sid.code, expected 15, is %d", check_msg->states[18].sid.code); - ck_assert_msg(check_msg->states[18].sid.sat == 19, "incorrect value for states[18].sid.sat, expected 19, is %d", check_msg->states[18].sid.sat); - ck_assert_msg(check_msg->states[19].cn0 == 200, "incorrect value for states[19].cn0, expected 200, is %d", check_msg->states[19].cn0); - ck_assert_msg(check_msg->states[19].fcn == 187, "incorrect value for states[19].fcn, expected 187, is %d", check_msg->states[19].fcn); - ck_assert_msg(check_msg->states[19].sid.code == 75, "incorrect value for states[19].sid.code, expected 75, is %d", check_msg->states[19].sid.code); - ck_assert_msg(check_msg->states[19].sid.sat == 122, "incorrect value for states[19].sid.sat, expected 122, is %d", check_msg->states[19].sid.sat); - ck_assert_msg(check_msg->states[20].cn0 == 122, "incorrect value for states[20].cn0, expected 122, is %d", check_msg->states[20].cn0); - ck_assert_msg(check_msg->states[20].fcn == 218, "incorrect value for states[20].fcn, expected 218, is %d", check_msg->states[20].fcn); - ck_assert_msg(check_msg->states[20].sid.code == 48, "incorrect value for states[20].sid.code, expected 48, is %d", check_msg->states[20].sid.code); - ck_assert_msg(check_msg->states[20].sid.sat == 217, "incorrect value for states[20].sid.sat, expected 217, is %d", check_msg->states[20].sid.sat); - ck_assert_msg(check_msg->states[21].cn0 == 149, "incorrect value for states[21].cn0, expected 149, is %d", check_msg->states[21].cn0); - ck_assert_msg(check_msg->states[21].fcn == 142, "incorrect value for states[21].fcn, expected 142, is %d", check_msg->states[21].fcn); - ck_assert_msg(check_msg->states[21].sid.code == 238, "incorrect value for states[21].sid.code, expected 238, is %d", check_msg->states[21].sid.code); - ck_assert_msg(check_msg->states[21].sid.sat == 187, "incorrect value for states[21].sid.sat, expected 187, is %d", check_msg->states[21].sid.sat); - ck_assert_msg(check_msg->states[22].cn0 == 212, "incorrect value for states[22].cn0, expected 212, is %d", check_msg->states[22].cn0); - ck_assert_msg(check_msg->states[22].fcn == 251, "incorrect value for states[22].fcn, expected 251, is %d", check_msg->states[22].fcn); - ck_assert_msg(check_msg->states[22].sid.code == 55, "incorrect value for states[22].sid.code, expected 55, is %d", check_msg->states[22].sid.code); - ck_assert_msg(check_msg->states[22].sid.sat == 238, "incorrect value for states[22].sid.sat, expected 238, is %d", check_msg->states[22].sid.sat); - ck_assert_msg(check_msg->states[23].cn0 == 104, "incorrect value for states[23].cn0, expected 104, is %d", check_msg->states[23].cn0); - ck_assert_msg(check_msg->states[23].fcn == 194, "incorrect value for states[23].fcn, expected 194, is %d", check_msg->states[23].fcn); - ck_assert_msg(check_msg->states[23].sid.code == 160, "incorrect value for states[23].sid.code, expected 160, is %d", check_msg->states[23].sid.code); - ck_assert_msg(check_msg->states[23].sid.sat == 128, "incorrect value for states[23].sid.sat, expected 128, is %d", check_msg->states[23].sid.sat); - ck_assert_msg(check_msg->states[24].cn0 == 62, "incorrect value for states[24].cn0, expected 62, is %d", check_msg->states[24].cn0); - ck_assert_msg(check_msg->states[24].fcn == 141, "incorrect value for states[24].fcn, expected 141, is %d", check_msg->states[24].fcn); - ck_assert_msg(check_msg->states[24].sid.code == 255, "incorrect value for states[24].sid.code, expected 255, is %d", check_msg->states[24].sid.code); - ck_assert_msg(check_msg->states[24].sid.sat == 113, "incorrect value for states[24].sid.sat, expected 113, is %d", check_msg->states[24].sid.sat); - ck_assert_msg(check_msg->states[25].cn0 == 39, "incorrect value for states[25].cn0, expected 39, is %d", check_msg->states[25].cn0); - ck_assert_msg(check_msg->states[25].fcn == 245, "incorrect value for states[25].fcn, expected 245, is %d", check_msg->states[25].fcn); - ck_assert_msg(check_msg->states[25].sid.code == 69, "incorrect value for states[25].sid.code, expected 69, is %d", check_msg->states[25].sid.code); - ck_assert_msg(check_msg->states[25].sid.sat == 43, "incorrect value for states[25].sid.sat, expected 43, is %d", check_msg->states[25].sid.sat); - ck_assert_msg(check_msg->states[26].cn0 == 56, "incorrect value for states[26].cn0, expected 56, is %d", check_msg->states[26].cn0); - ck_assert_msg(check_msg->states[26].fcn == 108, "incorrect value for states[26].fcn, expected 108, is %d", check_msg->states[26].fcn); - ck_assert_msg(check_msg->states[26].sid.code == 230, "incorrect value for states[26].sid.code, expected 230, is %d", check_msg->states[26].sid.code); - ck_assert_msg(check_msg->states[26].sid.sat == 100, "incorrect value for states[26].sid.sat, expected 100, is %d", check_msg->states[26].sid.sat); - ck_assert_msg(check_msg->states[27].cn0 == 143, "incorrect value for states[27].cn0, expected 143, is %d", check_msg->states[27].cn0); - ck_assert_msg(check_msg->states[27].fcn == 149, "incorrect value for states[27].fcn, expected 149, is %d", check_msg->states[27].fcn); - ck_assert_msg(check_msg->states[27].sid.code == 68, "incorrect value for states[27].sid.code, expected 68, is %d", check_msg->states[27].sid.code); - ck_assert_msg(check_msg->states[27].sid.sat == 247, "incorrect value for states[27].sid.sat, expected 247, is %d", check_msg->states[27].sid.sat); - ck_assert_msg(check_msg->states[28].cn0 == 70, "incorrect value for states[28].cn0, expected 70, is %d", check_msg->states[28].cn0); - ck_assert_msg(check_msg->states[28].fcn == 233, "incorrect value for states[28].fcn, expected 233, is %d", check_msg->states[28].fcn); - ck_assert_msg(check_msg->states[28].sid.code == 101, "incorrect value for states[28].sid.code, expected 101, is %d", check_msg->states[28].sid.code); - ck_assert_msg(check_msg->states[28].sid.sat == 137, "incorrect value for states[28].sid.sat, expected 137, is %d", check_msg->states[28].sid.sat); - ck_assert_msg(check_msg->states[29].cn0 == 110, "incorrect value for states[29].cn0, expected 110, is %d", check_msg->states[29].cn0); - ck_assert_msg(check_msg->states[29].fcn == 38, "incorrect value for states[29].fcn, expected 38, is %d", check_msg->states[29].fcn); - ck_assert_msg(check_msg->states[29].sid.code == 165, "incorrect value for states[29].sid.code, expected 165, is %d", check_msg->states[29].sid.code); - ck_assert_msg(check_msg->states[29].sid.sat == 49, "incorrect value for states[29].sid.sat, expected 49, is %d", check_msg->states[29].sid.sat); - ck_assert_msg(check_msg->states[30].cn0 == 213, "incorrect value for states[30].cn0, expected 213, is %d", check_msg->states[30].cn0); - ck_assert_msg(check_msg->states[30].fcn == 80, "incorrect value for states[30].fcn, expected 80, is %d", check_msg->states[30].fcn); - ck_assert_msg(check_msg->states[30].sid.code == 230, "incorrect value for states[30].sid.code, expected 230, is %d", check_msg->states[30].sid.code); - ck_assert_msg(check_msg->states[30].sid.sat == 218, "incorrect value for states[30].sid.sat, expected 218, is %d", check_msg->states[30].sid.sat); - ck_assert_msg(check_msg->states[31].cn0 == 128, "incorrect value for states[31].cn0, expected 128, is %d", check_msg->states[31].cn0); - ck_assert_msg(check_msg->states[31].fcn == 139, "incorrect value for states[31].fcn, expected 139, is %d", check_msg->states[31].fcn); - ck_assert_msg(check_msg->states[31].sid.code == 179, "incorrect value for states[31].sid.code, expected 179, is %d", check_msg->states[31].sid.code); - ck_assert_msg(check_msg->states[31].sid.sat == 196, "incorrect value for states[31].sid.sat, expected 196, is %d", check_msg->states[31].sid.sat); - ck_assert_msg(check_msg->states[32].cn0 == 171, "incorrect value for states[32].cn0, expected 171, is %d", check_msg->states[32].cn0); - ck_assert_msg(check_msg->states[32].fcn == 196, "incorrect value for states[32].fcn, expected 196, is %d", check_msg->states[32].fcn); - ck_assert_msg(check_msg->states[32].sid.code == 178, "incorrect value for states[32].sid.code, expected 178, is %d", check_msg->states[32].sid.code); - ck_assert_msg(check_msg->states[32].sid.sat == 15, "incorrect value for states[32].sid.sat, expected 15, is %d", check_msg->states[32].sid.sat); - ck_assert_msg(check_msg->states[33].cn0 == 194, "incorrect value for states[33].cn0, expected 194, is %d", check_msg->states[33].cn0); - ck_assert_msg(check_msg->states[33].fcn == 97, "incorrect value for states[33].fcn, expected 97, is %d", check_msg->states[33].fcn); - ck_assert_msg(check_msg->states[33].sid.code == 212, "incorrect value for states[33].sid.code, expected 212, is %d", check_msg->states[33].sid.code); - ck_assert_msg(check_msg->states[33].sid.sat == 8, "incorrect value for states[33].sid.sat, expected 8, is %d", check_msg->states[33].sid.sat); - ck_assert_msg(check_msg->states[34].cn0 == 99, "incorrect value for states[34].cn0, expected 99, is %d", check_msg->states[34].cn0); - ck_assert_msg(check_msg->states[34].fcn == 79, "incorrect value for states[34].fcn, expected 79, is %d", check_msg->states[34].fcn); - ck_assert_msg(check_msg->states[34].sid.code == 233, "incorrect value for states[34].sid.code, expected 233, is %d", check_msg->states[34].sid.code); - ck_assert_msg(check_msg->states[34].sid.sat == 83, "incorrect value for states[34].sid.sat, expected 83, is %d", check_msg->states[34].sid.sat); - ck_assert_msg(check_msg->states[35].cn0 == 180, "incorrect value for states[35].cn0, expected 180, is %d", check_msg->states[35].cn0); - ck_assert_msg(check_msg->states[35].fcn == 31, "incorrect value for states[35].fcn, expected 31, is %d", check_msg->states[35].fcn); - ck_assert_msg(check_msg->states[35].sid.code == 90, "incorrect value for states[35].sid.code, expected 90, is %d", check_msg->states[35].sid.code); - ck_assert_msg(check_msg->states[35].sid.sat == 55, "incorrect value for states[35].sid.sat, expected 55, is %d", check_msg->states[35].sid.sat); - ck_assert_msg(check_msg->states[36].cn0 == 186, "incorrect value for states[36].cn0, expected 186, is %d", check_msg->states[36].cn0); - ck_assert_msg(check_msg->states[36].fcn == 105, "incorrect value for states[36].fcn, expected 105, is %d", check_msg->states[36].fcn); - ck_assert_msg(check_msg->states[36].sid.code == 25, "incorrect value for states[36].sid.code, expected 25, is %d", check_msg->states[36].sid.code); - ck_assert_msg(check_msg->states[36].sid.sat == 5, "incorrect value for states[36].sid.sat, expected 5, is %d", check_msg->states[36].sid.sat); - ck_assert_msg(check_msg->states[37].cn0 == 111, "incorrect value for states[37].cn0, expected 111, is %d", check_msg->states[37].cn0); - ck_assert_msg(check_msg->states[37].fcn == 80, "incorrect value for states[37].fcn, expected 80, is %d", check_msg->states[37].fcn); - ck_assert_msg(check_msg->states[37].sid.code == 224, "incorrect value for states[37].sid.code, expected 224, is %d", check_msg->states[37].sid.code); - ck_assert_msg(check_msg->states[37].sid.sat == 22, "incorrect value for states[37].sid.sat, expected 22, is %d", check_msg->states[37].sid.sat); - ck_assert_msg(check_msg->states[38].cn0 == 166, "incorrect value for states[38].cn0, expected 166, is %d", check_msg->states[38].cn0); - ck_assert_msg(check_msg->states[38].fcn == 106, "incorrect value for states[38].fcn, expected 106, is %d", check_msg->states[38].fcn); - ck_assert_msg(check_msg->states[38].sid.code == 48, "incorrect value for states[38].sid.code, expected 48, is %d", check_msg->states[38].sid.code); - ck_assert_msg(check_msg->states[38].sid.sat == 8, "incorrect value for states[38].sid.sat, expected 8, is %d", check_msg->states[38].sid.sat); - ck_assert_msg(check_msg->states[39].cn0 == 49, "incorrect value for states[39].cn0, expected 49, is %d", check_msg->states[39].cn0); - ck_assert_msg(check_msg->states[39].fcn == 156, "incorrect value for states[39].fcn, expected 156, is %d", check_msg->states[39].fcn); - ck_assert_msg(check_msg->states[39].sid.code == 48, "incorrect value for states[39].sid.code, expected 48, is %d", check_msg->states[39].sid.code); - ck_assert_msg(check_msg->states[39].sid.sat == 4, "incorrect value for states[39].sid.sat, expected 4, is %d", check_msg->states[39].sid.sat); - ck_assert_msg(check_msg->states[40].cn0 == 146, "incorrect value for states[40].cn0, expected 146, is %d", check_msg->states[40].cn0); - ck_assert_msg(check_msg->states[40].fcn == 142, "incorrect value for states[40].fcn, expected 142, is %d", check_msg->states[40].fcn); - ck_assert_msg(check_msg->states[40].sid.code == 19, "incorrect value for states[40].sid.code, expected 19, is %d", check_msg->states[40].sid.code); - ck_assert_msg(check_msg->states[40].sid.sat == 86, "incorrect value for states[40].sid.sat, expected 86, is %d", check_msg->states[40].sid.sat); - ck_assert_msg(check_msg->states[41].cn0 == 64, "incorrect value for states[41].cn0, expected 64, is %d", check_msg->states[41].cn0); - ck_assert_msg(check_msg->states[41].fcn == 115, "incorrect value for states[41].fcn, expected 115, is %d", check_msg->states[41].fcn); - ck_assert_msg(check_msg->states[41].sid.code == 124, "incorrect value for states[41].sid.code, expected 124, is %d", check_msg->states[41].sid.code); - ck_assert_msg(check_msg->states[41].sid.sat == 91, "incorrect value for states[41].sid.sat, expected 91, is %d", check_msg->states[41].sid.sat); - ck_assert_msg(check_msg->states[42].cn0 == 178, "incorrect value for states[42].cn0, expected 178, is %d", check_msg->states[42].cn0); - ck_assert_msg(check_msg->states[42].fcn == 115, "incorrect value for states[42].fcn, expected 115, is %d", check_msg->states[42].fcn); - ck_assert_msg(check_msg->states[42].sid.code == 230, "incorrect value for states[42].sid.code, expected 230, is %d", check_msg->states[42].sid.code); - ck_assert_msg(check_msg->states[42].sid.sat == 28, "incorrect value for states[42].sid.sat, expected 28, is %d", check_msg->states[42].sid.sat); - ck_assert_msg(check_msg->states[43].cn0 == 242, "incorrect value for states[43].cn0, expected 242, is %d", check_msg->states[43].cn0); - ck_assert_msg(check_msg->states[43].fcn == 16, "incorrect value for states[43].fcn, expected 16, is %d", check_msg->states[43].fcn); - ck_assert_msg(check_msg->states[43].sid.code == 131, "incorrect value for states[43].sid.code, expected 131, is %d", check_msg->states[43].sid.code); - ck_assert_msg(check_msg->states[43].sid.sat == 190, "incorrect value for states[43].sid.sat, expected 190, is %d", check_msg->states[43].sid.sat); - ck_assert_msg(check_msg->states[44].cn0 == 113, "incorrect value for states[44].cn0, expected 113, is %d", check_msg->states[44].cn0); - ck_assert_msg(check_msg->states[44].fcn == 182, "incorrect value for states[44].fcn, expected 182, is %d", check_msg->states[44].fcn); - ck_assert_msg(check_msg->states[44].sid.code == 59, "incorrect value for states[44].sid.code, expected 59, is %d", check_msg->states[44].sid.code); - ck_assert_msg(check_msg->states[44].sid.sat == 105, "incorrect value for states[44].sid.sat, expected 105, is %d", check_msg->states[44].sid.sat); - ck_assert_msg(check_msg->states[45].cn0 == 179, "incorrect value for states[45].cn0, expected 179, is %d", check_msg->states[45].cn0); - ck_assert_msg(check_msg->states[45].fcn == 48, "incorrect value for states[45].fcn, expected 48, is %d", check_msg->states[45].fcn); - ck_assert_msg(check_msg->states[45].sid.code == 180, "incorrect value for states[45].sid.code, expected 180, is %d", check_msg->states[45].sid.code); - ck_assert_msg(check_msg->states[45].sid.sat == 192, "incorrect value for states[45].sid.sat, expected 192, is %d", check_msg->states[45].sid.sat); - ck_assert_msg(check_msg->states[46].cn0 == 211, "incorrect value for states[46].cn0, expected 211, is %d", check_msg->states[46].cn0); - ck_assert_msg(check_msg->states[46].fcn == 172, "incorrect value for states[46].fcn, expected 172, is %d", check_msg->states[46].fcn); - ck_assert_msg(check_msg->states[46].sid.code == 31, "incorrect value for states[46].sid.code, expected 31, is %d", check_msg->states[46].sid.code); - ck_assert_msg(check_msg->states[46].sid.sat == 166, "incorrect value for states[46].sid.sat, expected 166, is %d", check_msg->states[46].sid.sat); - ck_assert_msg(check_msg->states[47].cn0 == 49, "incorrect value for states[47].cn0, expected 49, is %d", check_msg->states[47].cn0); - ck_assert_msg(check_msg->states[47].fcn == 140, "incorrect value for states[47].fcn, expected 140, is %d", check_msg->states[47].fcn); - ck_assert_msg(check_msg->states[47].sid.code == 228, "incorrect value for states[47].sid.code, expected 228, is %d", check_msg->states[47].sid.code); - ck_assert_msg(check_msg->states[47].sid.sat == 77, "incorrect value for states[47].sid.sat, expected 77, is %d", check_msg->states[47].sid.sat); - ck_assert_msg(check_msg->states[48].cn0 == 194, "incorrect value for states[48].cn0, expected 194, is %d", check_msg->states[48].cn0); - ck_assert_msg(check_msg->states[48].fcn == 240, "incorrect value for states[48].fcn, expected 240, is %d", check_msg->states[48].fcn); - ck_assert_msg(check_msg->states[48].sid.code == 77, "incorrect value for states[48].sid.code, expected 77, is %d", check_msg->states[48].sid.code); - ck_assert_msg(check_msg->states[48].sid.sat == 128, "incorrect value for states[48].sid.sat, expected 128, is %d", check_msg->states[48].sid.sat); - ck_assert_msg(check_msg->states[49].cn0 == 58, "incorrect value for states[49].cn0, expected 58, is %d", check_msg->states[49].cn0); - ck_assert_msg(check_msg->states[49].fcn == 41, "incorrect value for states[49].fcn, expected 41, is %d", check_msg->states[49].fcn); - ck_assert_msg(check_msg->states[49].sid.code == 194, "incorrect value for states[49].sid.code, expected 194, is %d", check_msg->states[49].sid.code); - ck_assert_msg(check_msg->states[49].sid.sat == 134, "incorrect value for states[49].sid.sat, expected 134, is %d", check_msg->states[49].sid.sat); - ck_assert_msg(check_msg->states[50].cn0 == 55, "incorrect value for states[50].cn0, expected 55, is %d", check_msg->states[50].cn0); - ck_assert_msg(check_msg->states[50].fcn == 129, "incorrect value for states[50].fcn, expected 129, is %d", check_msg->states[50].fcn); - ck_assert_msg(check_msg->states[50].sid.code == 53, "incorrect value for states[50].sid.code, expected 53, is %d", check_msg->states[50].sid.code); - ck_assert_msg(check_msg->states[50].sid.sat == 18, "incorrect value for states[50].sid.sat, expected 18, is %d", check_msg->states[50].sid.sat); - ck_assert_msg(check_msg->states[51].cn0 == 92, "incorrect value for states[51].cn0, expected 92, is %d", check_msg->states[51].cn0); - ck_assert_msg(check_msg->states[51].fcn == 134, "incorrect value for states[51].fcn, expected 134, is %d", check_msg->states[51].fcn); - ck_assert_msg(check_msg->states[51].sid.code == 72, "incorrect value for states[51].sid.code, expected 72, is %d", check_msg->states[51].sid.code); - ck_assert_msg(check_msg->states[51].sid.sat == 91, "incorrect value for states[51].sid.sat, expected 91, is %d", check_msg->states[51].sid.sat); - ck_assert_msg(check_msg->states[52].cn0 == 56, "incorrect value for states[52].cn0, expected 56, is %d", check_msg->states[52].cn0); - ck_assert_msg(check_msg->states[52].fcn == 157, "incorrect value for states[52].fcn, expected 157, is %d", check_msg->states[52].fcn); - ck_assert_msg(check_msg->states[52].sid.code == 224, "incorrect value for states[52].sid.code, expected 224, is %d", check_msg->states[52].sid.code); - ck_assert_msg(check_msg->states[52].sid.sat == 33, "incorrect value for states[52].sid.sat, expected 33, is %d", check_msg->states[52].sid.sat); - ck_assert_msg(check_msg->states[53].cn0 == 174, "incorrect value for states[53].cn0, expected 174, is %d", check_msg->states[53].cn0); - ck_assert_msg(check_msg->states[53].fcn == 224, "incorrect value for states[53].fcn, expected 224, is %d", check_msg->states[53].fcn); - ck_assert_msg(check_msg->states[53].sid.code == 54, "incorrect value for states[53].sid.code, expected 54, is %d", check_msg->states[53].sid.code); - ck_assert_msg(check_msg->states[53].sid.sat == 186, "incorrect value for states[53].sid.sat, expected 186, is %d", check_msg->states[53].sid.sat); - ck_assert_msg(check_msg->states[54].cn0 == 190, "incorrect value for states[54].cn0, expected 190, is %d", check_msg->states[54].cn0); - ck_assert_msg(check_msg->states[54].fcn == 148, "incorrect value for states[54].fcn, expected 148, is %d", check_msg->states[54].fcn); - ck_assert_msg(check_msg->states[54].sid.code == 84, "incorrect value for states[54].sid.code, expected 84, is %d", check_msg->states[54].sid.code); - ck_assert_msg(check_msg->states[54].sid.sat == 82, "incorrect value for states[54].sid.sat, expected 82, is %d", check_msg->states[54].sid.sat); - ck_assert_msg(check_msg->states[55].cn0 == 67, "incorrect value for states[55].cn0, expected 67, is %d", check_msg->states[55].cn0); - ck_assert_msg(check_msg->states[55].fcn == 62, "incorrect value for states[55].fcn, expected 62, is %d", check_msg->states[55].fcn); - ck_assert_msg(check_msg->states[55].sid.code == 54, "incorrect value for states[55].sid.code, expected 54, is %d", check_msg->states[55].sid.code); - ck_assert_msg(check_msg->states[55].sid.sat == 236, "incorrect value for states[55].sid.sat, expected 236, is %d", check_msg->states[55].sid.sat); - ck_assert_msg(check_msg->states[56].cn0 == 254, "incorrect value for states[56].cn0, expected 254, is %d", check_msg->states[56].cn0); - ck_assert_msg(check_msg->states[56].fcn == 57, "incorrect value for states[56].fcn, expected 57, is %d", check_msg->states[56].fcn); - ck_assert_msg(check_msg->states[56].sid.code == 215, "incorrect value for states[56].sid.code, expected 215, is %d", check_msg->states[56].sid.code); - ck_assert_msg(check_msg->states[56].sid.sat == 52, "incorrect value for states[56].sid.sat, expected 52, is %d", check_msg->states[56].sid.sat); - ck_assert_msg(check_msg->states[57].cn0 == 174, "incorrect value for states[57].cn0, expected 174, is %d", check_msg->states[57].cn0); - ck_assert_msg(check_msg->states[57].fcn == 36, "incorrect value for states[57].fcn, expected 36, is %d", check_msg->states[57].fcn); - ck_assert_msg(check_msg->states[57].sid.code == 133, "incorrect value for states[57].sid.code, expected 133, is %d", check_msg->states[57].sid.code); - ck_assert_msg(check_msg->states[57].sid.sat == 16, "incorrect value for states[57].sid.sat, expected 16, is %d", check_msg->states[57].sid.sat); - ck_assert_msg(check_msg->states[58].cn0 == 17, "incorrect value for states[58].cn0, expected 17, is %d", check_msg->states[58].cn0); - ck_assert_msg(check_msg->states[58].fcn == 145, "incorrect value for states[58].fcn, expected 145, is %d", check_msg->states[58].fcn); - ck_assert_msg(check_msg->states[58].sid.code == 172, "incorrect value for states[58].sid.code, expected 172, is %d", check_msg->states[58].sid.code); - ck_assert_msg(check_msg->states[58].sid.sat == 219, "incorrect value for states[58].sid.sat, expected 219, is %d", check_msg->states[58].sid.sat); - ck_assert_msg(check_msg->states[59].cn0 == 97, "incorrect value for states[59].cn0, expected 97, is %d", check_msg->states[59].cn0); - ck_assert_msg(check_msg->states[59].fcn == 111, "incorrect value for states[59].fcn, expected 111, is %d", check_msg->states[59].fcn); - ck_assert_msg(check_msg->states[59].sid.code == 179, "incorrect value for states[59].sid.code, expected 179, is %d", check_msg->states[59].sid.code); - ck_assert_msg(check_msg->states[59].sid.sat == 192, "incorrect value for states[59].sid.sat, expected 192, is %d", check_msg->states[59].sid.sat); - ck_assert_msg(check_msg->states[60].cn0 == 134, "incorrect value for states[60].cn0, expected 134, is %d", check_msg->states[60].cn0); - ck_assert_msg(check_msg->states[60].fcn == 208, "incorrect value for states[60].fcn, expected 208, is %d", check_msg->states[60].fcn); - ck_assert_msg(check_msg->states[60].sid.code == 56, "incorrect value for states[60].sid.code, expected 56, is %d", check_msg->states[60].sid.code); - ck_assert_msg(check_msg->states[60].sid.sat == 207, "incorrect value for states[60].sid.sat, expected 207, is %d", check_msg->states[60].sid.sat); - ck_assert_msg(check_msg->states[61].cn0 == 226, "incorrect value for states[61].cn0, expected 226, is %d", check_msg->states[61].cn0); - ck_assert_msg(check_msg->states[61].fcn == 43, "incorrect value for states[61].fcn, expected 43, is %d", check_msg->states[61].fcn); - ck_assert_msg(check_msg->states[61].sid.code == 17, "incorrect value for states[61].sid.code, expected 17, is %d", check_msg->states[61].sid.code); - ck_assert_msg(check_msg->states[61].sid.sat == 180, "incorrect value for states[61].sid.sat, expected 180, is %d", check_msg->states[61].sid.sat); - ck_assert_msg(check_msg->states[62].cn0 == 113, "incorrect value for states[62].cn0, expected 113, is %d", check_msg->states[62].cn0); - ck_assert_msg(check_msg->states[62].fcn == 140, "incorrect value for states[62].fcn, expected 140, is %d", check_msg->states[62].fcn); - ck_assert_msg(check_msg->states[62].sid.code == 182, "incorrect value for states[62].sid.code, expected 182, is %d", check_msg->states[62].sid.code); - ck_assert_msg(check_msg->states[62].sid.sat == 255, "incorrect value for states[62].sid.sat, expected 255, is %d", check_msg->states[62].sid.sat); + ck_assert_msg(check_msg->states[0].cn0 == 102, + "incorrect value for states[0].cn0, expected 102, is %d", + check_msg->states[0].cn0); + ck_assert_msg(check_msg->states[0].fcn == 3, + "incorrect value for states[0].fcn, expected 3, is %d", + check_msg->states[0].fcn); + ck_assert_msg(check_msg->states[0].sid.code == 184, + "incorrect value for states[0].sid.code, expected 184, is %d", + check_msg->states[0].sid.code); + ck_assert_msg(check_msg->states[0].sid.sat == 117, + "incorrect value for states[0].sid.sat, expected 117, is %d", + check_msg->states[0].sid.sat); + ck_assert_msg(check_msg->states[1].cn0 == 141, + "incorrect value for states[1].cn0, expected 141, is %d", + check_msg->states[1].cn0); + ck_assert_msg(check_msg->states[1].fcn == 140, + "incorrect value for states[1].fcn, expected 140, is %d", + check_msg->states[1].fcn); + ck_assert_msg(check_msg->states[1].sid.code == 106, + "incorrect value for states[1].sid.code, expected 106, is %d", + check_msg->states[1].sid.code); + ck_assert_msg(check_msg->states[1].sid.sat == 38, + "incorrect value for states[1].sid.sat, expected 38, is %d", + check_msg->states[1].sid.sat); + ck_assert_msg(check_msg->states[2].cn0 == 195, + "incorrect value for states[2].cn0, expected 195, is %d", + check_msg->states[2].cn0); + ck_assert_msg(check_msg->states[2].fcn == 90, + "incorrect value for states[2].fcn, expected 90, is %d", + check_msg->states[2].fcn); + ck_assert_msg(check_msg->states[2].sid.code == 4, + "incorrect value for states[2].sid.code, expected 4, is %d", + check_msg->states[2].sid.code); + ck_assert_msg(check_msg->states[2].sid.sat == 25, + "incorrect value for states[2].sid.sat, expected 25, is %d", + check_msg->states[2].sid.sat); + ck_assert_msg(check_msg->states[3].cn0 == 82, + "incorrect value for states[3].cn0, expected 82, is %d", + check_msg->states[3].cn0); + ck_assert_msg(check_msg->states[3].fcn == 75, + "incorrect value for states[3].fcn, expected 75, is %d", + check_msg->states[3].fcn); + ck_assert_msg(check_msg->states[3].sid.code == 108, + "incorrect value for states[3].sid.code, expected 108, is %d", + check_msg->states[3].sid.code); + ck_assert_msg(check_msg->states[3].sid.sat == 246, + "incorrect value for states[3].sid.sat, expected 246, is %d", + check_msg->states[3].sid.sat); + ck_assert_msg(check_msg->states[4].cn0 == 163, + "incorrect value for states[4].cn0, expected 163, is %d", + check_msg->states[4].cn0); + ck_assert_msg(check_msg->states[4].fcn == 45, + "incorrect value for states[4].fcn, expected 45, is %d", + check_msg->states[4].fcn); + ck_assert_msg(check_msg->states[4].sid.code == 127, + "incorrect value for states[4].sid.code, expected 127, is %d", + check_msg->states[4].sid.code); + ck_assert_msg(check_msg->states[4].sid.sat == 137, + "incorrect value for states[4].sid.sat, expected 137, is %d", + check_msg->states[4].sid.sat); + ck_assert_msg(check_msg->states[5].cn0 == 93, + "incorrect value for states[5].cn0, expected 93, is %d", + check_msg->states[5].cn0); + ck_assert_msg(check_msg->states[5].fcn == 187, + "incorrect value for states[5].fcn, expected 187, is %d", + check_msg->states[5].fcn); + ck_assert_msg(check_msg->states[5].sid.code == 46, + "incorrect value for states[5].sid.code, expected 46, is %d", + check_msg->states[5].sid.code); + ck_assert_msg(check_msg->states[5].sid.sat == 32, + "incorrect value for states[5].sid.sat, expected 32, is %d", + check_msg->states[5].sid.sat); + ck_assert_msg(check_msg->states[6].cn0 == 147, + "incorrect value for states[6].cn0, expected 147, is %d", + check_msg->states[6].cn0); + ck_assert_msg(check_msg->states[6].fcn == 201, + "incorrect value for states[6].fcn, expected 201, is %d", + check_msg->states[6].fcn); + ck_assert_msg(check_msg->states[6].sid.code == 60, + "incorrect value for states[6].sid.code, expected 60, is %d", + check_msg->states[6].sid.code); + ck_assert_msg(check_msg->states[6].sid.sat == 153, + "incorrect value for states[6].sid.sat, expected 153, is %d", + check_msg->states[6].sid.sat); + ck_assert_msg(check_msg->states[7].cn0 == 208, + "incorrect value for states[7].cn0, expected 208, is %d", + check_msg->states[7].cn0); + ck_assert_msg(check_msg->states[7].fcn == 5, + "incorrect value for states[7].fcn, expected 5, is %d", + check_msg->states[7].fcn); + ck_assert_msg(check_msg->states[7].sid.code == 29, + "incorrect value for states[7].sid.code, expected 29, is %d", + check_msg->states[7].sid.code); + ck_assert_msg(check_msg->states[7].sid.sat == 23, + "incorrect value for states[7].sid.sat, expected 23, is %d", + check_msg->states[7].sid.sat); + ck_assert_msg(check_msg->states[8].cn0 == 69, + "incorrect value for states[8].cn0, expected 69, is %d", + check_msg->states[8].cn0); + ck_assert_msg(check_msg->states[8].fcn == 219, + "incorrect value for states[8].fcn, expected 219, is %d", + check_msg->states[8].fcn); + ck_assert_msg(check_msg->states[8].sid.code == 30, + "incorrect value for states[8].sid.code, expected 30, is %d", + check_msg->states[8].sid.code); + ck_assert_msg(check_msg->states[8].sid.sat == 181, + "incorrect value for states[8].sid.sat, expected 181, is %d", + check_msg->states[8].sid.sat); + ck_assert_msg(check_msg->states[9].cn0 == 121, + "incorrect value for states[9].cn0, expected 121, is %d", + check_msg->states[9].cn0); + ck_assert_msg(check_msg->states[9].fcn == 3, + "incorrect value for states[9].fcn, expected 3, is %d", + check_msg->states[9].fcn); + ck_assert_msg(check_msg->states[9].sid.code == 136, + "incorrect value for states[9].sid.code, expected 136, is %d", + check_msg->states[9].sid.code); + ck_assert_msg(check_msg->states[9].sid.sat == 254, + "incorrect value for states[9].sid.sat, expected 254, is %d", + check_msg->states[9].sid.sat); + ck_assert_msg(check_msg->states[10].cn0 == 215, + "incorrect value for states[10].cn0, expected 215, is %d", + check_msg->states[10].cn0); + ck_assert_msg(check_msg->states[10].fcn == 144, + "incorrect value for states[10].fcn, expected 144, is %d", + check_msg->states[10].fcn); + ck_assert_msg(check_msg->states[10].sid.code == 98, + "incorrect value for states[10].sid.code, expected 98, is %d", + check_msg->states[10].sid.code); + ck_assert_msg(check_msg->states[10].sid.sat == 33, + "incorrect value for states[10].sid.sat, expected 33, is %d", + check_msg->states[10].sid.sat); + ck_assert_msg(check_msg->states[11].cn0 == 56, + "incorrect value for states[11].cn0, expected 56, is %d", + check_msg->states[11].cn0); + ck_assert_msg(check_msg->states[11].fcn == 14, + "incorrect value for states[11].fcn, expected 14, is %d", + check_msg->states[11].fcn); + ck_assert_msg( + check_msg->states[11].sid.code == 182, + "incorrect value for states[11].sid.code, expected 182, is %d", + check_msg->states[11].sid.code); + ck_assert_msg(check_msg->states[11].sid.sat == 133, + "incorrect value for states[11].sid.sat, expected 133, is %d", + check_msg->states[11].sid.sat); + ck_assert_msg(check_msg->states[12].cn0 == 62, + "incorrect value for states[12].cn0, expected 62, is %d", + check_msg->states[12].cn0); + ck_assert_msg(check_msg->states[12].fcn == 218, + "incorrect value for states[12].fcn, expected 218, is %d", + check_msg->states[12].fcn); + ck_assert_msg(check_msg->states[12].sid.code == 77, + "incorrect value for states[12].sid.code, expected 77, is %d", + check_msg->states[12].sid.code); + ck_assert_msg(check_msg->states[12].sid.sat == 169, + "incorrect value for states[12].sid.sat, expected 169, is %d", + check_msg->states[12].sid.sat); + ck_assert_msg(check_msg->states[13].cn0 == 249, + "incorrect value for states[13].cn0, expected 249, is %d", + check_msg->states[13].cn0); + ck_assert_msg(check_msg->states[13].fcn == 171, + "incorrect value for states[13].fcn, expected 171, is %d", + check_msg->states[13].fcn); + ck_assert_msg(check_msg->states[13].sid.code == 84, + "incorrect value for states[13].sid.code, expected 84, is %d", + check_msg->states[13].sid.code); + ck_assert_msg(check_msg->states[13].sid.sat == 242, + "incorrect value for states[13].sid.sat, expected 242, is %d", + check_msg->states[13].sid.sat); + ck_assert_msg(check_msg->states[14].cn0 == 130, + "incorrect value for states[14].cn0, expected 130, is %d", + check_msg->states[14].cn0); + ck_assert_msg(check_msg->states[14].fcn == 131, + "incorrect value for states[14].fcn, expected 131, is %d", + check_msg->states[14].fcn); + ck_assert_msg( + check_msg->states[14].sid.code == 137, + "incorrect value for states[14].sid.code, expected 137, is %d", + check_msg->states[14].sid.code); + ck_assert_msg(check_msg->states[14].sid.sat == 152, + "incorrect value for states[14].sid.sat, expected 152, is %d", + check_msg->states[14].sid.sat); + ck_assert_msg(check_msg->states[15].cn0 == 68, + "incorrect value for states[15].cn0, expected 68, is %d", + check_msg->states[15].cn0); + ck_assert_msg(check_msg->states[15].fcn == 42, + "incorrect value for states[15].fcn, expected 42, is %d", + check_msg->states[15].fcn); + ck_assert_msg(check_msg->states[15].sid.code == 21, + "incorrect value for states[15].sid.code, expected 21, is %d", + check_msg->states[15].sid.code); + ck_assert_msg(check_msg->states[15].sid.sat == 193, + "incorrect value for states[15].sid.sat, expected 193, is %d", + check_msg->states[15].sid.sat); + ck_assert_msg(check_msg->states[16].cn0 == 227, + "incorrect value for states[16].cn0, expected 227, is %d", + check_msg->states[16].cn0); + ck_assert_msg(check_msg->states[16].fcn == 216, + "incorrect value for states[16].fcn, expected 216, is %d", + check_msg->states[16].fcn); + ck_assert_msg( + check_msg->states[16].sid.code == 227, + "incorrect value for states[16].sid.code, expected 227, is %d", + check_msg->states[16].sid.code); + ck_assert_msg(check_msg->states[16].sid.sat == 253, + "incorrect value for states[16].sid.sat, expected 253, is %d", + check_msg->states[16].sid.sat); + ck_assert_msg(check_msg->states[17].cn0 == 179, + "incorrect value for states[17].cn0, expected 179, is %d", + check_msg->states[17].cn0); + ck_assert_msg(check_msg->states[17].fcn == 210, + "incorrect value for states[17].fcn, expected 210, is %d", + check_msg->states[17].fcn); + ck_assert_msg(check_msg->states[17].sid.code == 26, + "incorrect value for states[17].sid.code, expected 26, is %d", + check_msg->states[17].sid.code); + ck_assert_msg(check_msg->states[17].sid.sat == 24, + "incorrect value for states[17].sid.sat, expected 24, is %d", + check_msg->states[17].sid.sat); + ck_assert_msg(check_msg->states[18].cn0 == 255, + "incorrect value for states[18].cn0, expected 255, is %d", + check_msg->states[18].cn0); + ck_assert_msg(check_msg->states[18].fcn == 227, + "incorrect value for states[18].fcn, expected 227, is %d", + check_msg->states[18].fcn); + ck_assert_msg(check_msg->states[18].sid.code == 15, + "incorrect value for states[18].sid.code, expected 15, is %d", + check_msg->states[18].sid.code); + ck_assert_msg(check_msg->states[18].sid.sat == 19, + "incorrect value for states[18].sid.sat, expected 19, is %d", + check_msg->states[18].sid.sat); + ck_assert_msg(check_msg->states[19].cn0 == 200, + "incorrect value for states[19].cn0, expected 200, is %d", + check_msg->states[19].cn0); + ck_assert_msg(check_msg->states[19].fcn == 187, + "incorrect value for states[19].fcn, expected 187, is %d", + check_msg->states[19].fcn); + ck_assert_msg(check_msg->states[19].sid.code == 75, + "incorrect value for states[19].sid.code, expected 75, is %d", + check_msg->states[19].sid.code); + ck_assert_msg(check_msg->states[19].sid.sat == 122, + "incorrect value for states[19].sid.sat, expected 122, is %d", + check_msg->states[19].sid.sat); + ck_assert_msg(check_msg->states[20].cn0 == 122, + "incorrect value for states[20].cn0, expected 122, is %d", + check_msg->states[20].cn0); + ck_assert_msg(check_msg->states[20].fcn == 218, + "incorrect value for states[20].fcn, expected 218, is %d", + check_msg->states[20].fcn); + ck_assert_msg(check_msg->states[20].sid.code == 48, + "incorrect value for states[20].sid.code, expected 48, is %d", + check_msg->states[20].sid.code); + ck_assert_msg(check_msg->states[20].sid.sat == 217, + "incorrect value for states[20].sid.sat, expected 217, is %d", + check_msg->states[20].sid.sat); + ck_assert_msg(check_msg->states[21].cn0 == 149, + "incorrect value for states[21].cn0, expected 149, is %d", + check_msg->states[21].cn0); + ck_assert_msg(check_msg->states[21].fcn == 142, + "incorrect value for states[21].fcn, expected 142, is %d", + check_msg->states[21].fcn); + ck_assert_msg( + check_msg->states[21].sid.code == 238, + "incorrect value for states[21].sid.code, expected 238, is %d", + check_msg->states[21].sid.code); + ck_assert_msg(check_msg->states[21].sid.sat == 187, + "incorrect value for states[21].sid.sat, expected 187, is %d", + check_msg->states[21].sid.sat); + ck_assert_msg(check_msg->states[22].cn0 == 212, + "incorrect value for states[22].cn0, expected 212, is %d", + check_msg->states[22].cn0); + ck_assert_msg(check_msg->states[22].fcn == 251, + "incorrect value for states[22].fcn, expected 251, is %d", + check_msg->states[22].fcn); + ck_assert_msg(check_msg->states[22].sid.code == 55, + "incorrect value for states[22].sid.code, expected 55, is %d", + check_msg->states[22].sid.code); + ck_assert_msg(check_msg->states[22].sid.sat == 238, + "incorrect value for states[22].sid.sat, expected 238, is %d", + check_msg->states[22].sid.sat); + ck_assert_msg(check_msg->states[23].cn0 == 104, + "incorrect value for states[23].cn0, expected 104, is %d", + check_msg->states[23].cn0); + ck_assert_msg(check_msg->states[23].fcn == 194, + "incorrect value for states[23].fcn, expected 194, is %d", + check_msg->states[23].fcn); + ck_assert_msg( + check_msg->states[23].sid.code == 160, + "incorrect value for states[23].sid.code, expected 160, is %d", + check_msg->states[23].sid.code); + ck_assert_msg(check_msg->states[23].sid.sat == 128, + "incorrect value for states[23].sid.sat, expected 128, is %d", + check_msg->states[23].sid.sat); + ck_assert_msg(check_msg->states[24].cn0 == 62, + "incorrect value for states[24].cn0, expected 62, is %d", + check_msg->states[24].cn0); + ck_assert_msg(check_msg->states[24].fcn == 141, + "incorrect value for states[24].fcn, expected 141, is %d", + check_msg->states[24].fcn); + ck_assert_msg( + check_msg->states[24].sid.code == 255, + "incorrect value for states[24].sid.code, expected 255, is %d", + check_msg->states[24].sid.code); + ck_assert_msg(check_msg->states[24].sid.sat == 113, + "incorrect value for states[24].sid.sat, expected 113, is %d", + check_msg->states[24].sid.sat); + ck_assert_msg(check_msg->states[25].cn0 == 39, + "incorrect value for states[25].cn0, expected 39, is %d", + check_msg->states[25].cn0); + ck_assert_msg(check_msg->states[25].fcn == 245, + "incorrect value for states[25].fcn, expected 245, is %d", + check_msg->states[25].fcn); + ck_assert_msg(check_msg->states[25].sid.code == 69, + "incorrect value for states[25].sid.code, expected 69, is %d", + check_msg->states[25].sid.code); + ck_assert_msg(check_msg->states[25].sid.sat == 43, + "incorrect value for states[25].sid.sat, expected 43, is %d", + check_msg->states[25].sid.sat); + ck_assert_msg(check_msg->states[26].cn0 == 56, + "incorrect value for states[26].cn0, expected 56, is %d", + check_msg->states[26].cn0); + ck_assert_msg(check_msg->states[26].fcn == 108, + "incorrect value for states[26].fcn, expected 108, is %d", + check_msg->states[26].fcn); + ck_assert_msg( + check_msg->states[26].sid.code == 230, + "incorrect value for states[26].sid.code, expected 230, is %d", + check_msg->states[26].sid.code); + ck_assert_msg(check_msg->states[26].sid.sat == 100, + "incorrect value for states[26].sid.sat, expected 100, is %d", + check_msg->states[26].sid.sat); + ck_assert_msg(check_msg->states[27].cn0 == 143, + "incorrect value for states[27].cn0, expected 143, is %d", + check_msg->states[27].cn0); + ck_assert_msg(check_msg->states[27].fcn == 149, + "incorrect value for states[27].fcn, expected 149, is %d", + check_msg->states[27].fcn); + ck_assert_msg(check_msg->states[27].sid.code == 68, + "incorrect value for states[27].sid.code, expected 68, is %d", + check_msg->states[27].sid.code); + ck_assert_msg(check_msg->states[27].sid.sat == 247, + "incorrect value for states[27].sid.sat, expected 247, is %d", + check_msg->states[27].sid.sat); + ck_assert_msg(check_msg->states[28].cn0 == 70, + "incorrect value for states[28].cn0, expected 70, is %d", + check_msg->states[28].cn0); + ck_assert_msg(check_msg->states[28].fcn == 233, + "incorrect value for states[28].fcn, expected 233, is %d", + check_msg->states[28].fcn); + ck_assert_msg( + check_msg->states[28].sid.code == 101, + "incorrect value for states[28].sid.code, expected 101, is %d", + check_msg->states[28].sid.code); + ck_assert_msg(check_msg->states[28].sid.sat == 137, + "incorrect value for states[28].sid.sat, expected 137, is %d", + check_msg->states[28].sid.sat); + ck_assert_msg(check_msg->states[29].cn0 == 110, + "incorrect value for states[29].cn0, expected 110, is %d", + check_msg->states[29].cn0); + ck_assert_msg(check_msg->states[29].fcn == 38, + "incorrect value for states[29].fcn, expected 38, is %d", + check_msg->states[29].fcn); + ck_assert_msg( + check_msg->states[29].sid.code == 165, + "incorrect value for states[29].sid.code, expected 165, is %d", + check_msg->states[29].sid.code); + ck_assert_msg(check_msg->states[29].sid.sat == 49, + "incorrect value for states[29].sid.sat, expected 49, is %d", + check_msg->states[29].sid.sat); + ck_assert_msg(check_msg->states[30].cn0 == 213, + "incorrect value for states[30].cn0, expected 213, is %d", + check_msg->states[30].cn0); + ck_assert_msg(check_msg->states[30].fcn == 80, + "incorrect value for states[30].fcn, expected 80, is %d", + check_msg->states[30].fcn); + ck_assert_msg( + check_msg->states[30].sid.code == 230, + "incorrect value for states[30].sid.code, expected 230, is %d", + check_msg->states[30].sid.code); + ck_assert_msg(check_msg->states[30].sid.sat == 218, + "incorrect value for states[30].sid.sat, expected 218, is %d", + check_msg->states[30].sid.sat); + ck_assert_msg(check_msg->states[31].cn0 == 128, + "incorrect value for states[31].cn0, expected 128, is %d", + check_msg->states[31].cn0); + ck_assert_msg(check_msg->states[31].fcn == 139, + "incorrect value for states[31].fcn, expected 139, is %d", + check_msg->states[31].fcn); + ck_assert_msg( + check_msg->states[31].sid.code == 179, + "incorrect value for states[31].sid.code, expected 179, is %d", + check_msg->states[31].sid.code); + ck_assert_msg(check_msg->states[31].sid.sat == 196, + "incorrect value for states[31].sid.sat, expected 196, is %d", + check_msg->states[31].sid.sat); + ck_assert_msg(check_msg->states[32].cn0 == 171, + "incorrect value for states[32].cn0, expected 171, is %d", + check_msg->states[32].cn0); + ck_assert_msg(check_msg->states[32].fcn == 196, + "incorrect value for states[32].fcn, expected 196, is %d", + check_msg->states[32].fcn); + ck_assert_msg( + check_msg->states[32].sid.code == 178, + "incorrect value for states[32].sid.code, expected 178, is %d", + check_msg->states[32].sid.code); + ck_assert_msg(check_msg->states[32].sid.sat == 15, + "incorrect value for states[32].sid.sat, expected 15, is %d", + check_msg->states[32].sid.sat); + ck_assert_msg(check_msg->states[33].cn0 == 194, + "incorrect value for states[33].cn0, expected 194, is %d", + check_msg->states[33].cn0); + ck_assert_msg(check_msg->states[33].fcn == 97, + "incorrect value for states[33].fcn, expected 97, is %d", + check_msg->states[33].fcn); + ck_assert_msg( + check_msg->states[33].sid.code == 212, + "incorrect value for states[33].sid.code, expected 212, is %d", + check_msg->states[33].sid.code); + ck_assert_msg(check_msg->states[33].sid.sat == 8, + "incorrect value for states[33].sid.sat, expected 8, is %d", + check_msg->states[33].sid.sat); + ck_assert_msg(check_msg->states[34].cn0 == 99, + "incorrect value for states[34].cn0, expected 99, is %d", + check_msg->states[34].cn0); + ck_assert_msg(check_msg->states[34].fcn == 79, + "incorrect value for states[34].fcn, expected 79, is %d", + check_msg->states[34].fcn); + ck_assert_msg( + check_msg->states[34].sid.code == 233, + "incorrect value for states[34].sid.code, expected 233, is %d", + check_msg->states[34].sid.code); + ck_assert_msg(check_msg->states[34].sid.sat == 83, + "incorrect value for states[34].sid.sat, expected 83, is %d", + check_msg->states[34].sid.sat); + ck_assert_msg(check_msg->states[35].cn0 == 180, + "incorrect value for states[35].cn0, expected 180, is %d", + check_msg->states[35].cn0); + ck_assert_msg(check_msg->states[35].fcn == 31, + "incorrect value for states[35].fcn, expected 31, is %d", + check_msg->states[35].fcn); + ck_assert_msg(check_msg->states[35].sid.code == 90, + "incorrect value for states[35].sid.code, expected 90, is %d", + check_msg->states[35].sid.code); + ck_assert_msg(check_msg->states[35].sid.sat == 55, + "incorrect value for states[35].sid.sat, expected 55, is %d", + check_msg->states[35].sid.sat); + ck_assert_msg(check_msg->states[36].cn0 == 186, + "incorrect value for states[36].cn0, expected 186, is %d", + check_msg->states[36].cn0); + ck_assert_msg(check_msg->states[36].fcn == 105, + "incorrect value for states[36].fcn, expected 105, is %d", + check_msg->states[36].fcn); + ck_assert_msg(check_msg->states[36].sid.code == 25, + "incorrect value for states[36].sid.code, expected 25, is %d", + check_msg->states[36].sid.code); + ck_assert_msg(check_msg->states[36].sid.sat == 5, + "incorrect value for states[36].sid.sat, expected 5, is %d", + check_msg->states[36].sid.sat); + ck_assert_msg(check_msg->states[37].cn0 == 111, + "incorrect value for states[37].cn0, expected 111, is %d", + check_msg->states[37].cn0); + ck_assert_msg(check_msg->states[37].fcn == 80, + "incorrect value for states[37].fcn, expected 80, is %d", + check_msg->states[37].fcn); + ck_assert_msg( + check_msg->states[37].sid.code == 224, + "incorrect value for states[37].sid.code, expected 224, is %d", + check_msg->states[37].sid.code); + ck_assert_msg(check_msg->states[37].sid.sat == 22, + "incorrect value for states[37].sid.sat, expected 22, is %d", + check_msg->states[37].sid.sat); + ck_assert_msg(check_msg->states[38].cn0 == 166, + "incorrect value for states[38].cn0, expected 166, is %d", + check_msg->states[38].cn0); + ck_assert_msg(check_msg->states[38].fcn == 106, + "incorrect value for states[38].fcn, expected 106, is %d", + check_msg->states[38].fcn); + ck_assert_msg(check_msg->states[38].sid.code == 48, + "incorrect value for states[38].sid.code, expected 48, is %d", + check_msg->states[38].sid.code); + ck_assert_msg(check_msg->states[38].sid.sat == 8, + "incorrect value for states[38].sid.sat, expected 8, is %d", + check_msg->states[38].sid.sat); + ck_assert_msg(check_msg->states[39].cn0 == 49, + "incorrect value for states[39].cn0, expected 49, is %d", + check_msg->states[39].cn0); + ck_assert_msg(check_msg->states[39].fcn == 156, + "incorrect value for states[39].fcn, expected 156, is %d", + check_msg->states[39].fcn); + ck_assert_msg(check_msg->states[39].sid.code == 48, + "incorrect value for states[39].sid.code, expected 48, is %d", + check_msg->states[39].sid.code); + ck_assert_msg(check_msg->states[39].sid.sat == 4, + "incorrect value for states[39].sid.sat, expected 4, is %d", + check_msg->states[39].sid.sat); + ck_assert_msg(check_msg->states[40].cn0 == 146, + "incorrect value for states[40].cn0, expected 146, is %d", + check_msg->states[40].cn0); + ck_assert_msg(check_msg->states[40].fcn == 142, + "incorrect value for states[40].fcn, expected 142, is %d", + check_msg->states[40].fcn); + ck_assert_msg(check_msg->states[40].sid.code == 19, + "incorrect value for states[40].sid.code, expected 19, is %d", + check_msg->states[40].sid.code); + ck_assert_msg(check_msg->states[40].sid.sat == 86, + "incorrect value for states[40].sid.sat, expected 86, is %d", + check_msg->states[40].sid.sat); + ck_assert_msg(check_msg->states[41].cn0 == 64, + "incorrect value for states[41].cn0, expected 64, is %d", + check_msg->states[41].cn0); + ck_assert_msg(check_msg->states[41].fcn == 115, + "incorrect value for states[41].fcn, expected 115, is %d", + check_msg->states[41].fcn); + ck_assert_msg( + check_msg->states[41].sid.code == 124, + "incorrect value for states[41].sid.code, expected 124, is %d", + check_msg->states[41].sid.code); + ck_assert_msg(check_msg->states[41].sid.sat == 91, + "incorrect value for states[41].sid.sat, expected 91, is %d", + check_msg->states[41].sid.sat); + ck_assert_msg(check_msg->states[42].cn0 == 178, + "incorrect value for states[42].cn0, expected 178, is %d", + check_msg->states[42].cn0); + ck_assert_msg(check_msg->states[42].fcn == 115, + "incorrect value for states[42].fcn, expected 115, is %d", + check_msg->states[42].fcn); + ck_assert_msg( + check_msg->states[42].sid.code == 230, + "incorrect value for states[42].sid.code, expected 230, is %d", + check_msg->states[42].sid.code); + ck_assert_msg(check_msg->states[42].sid.sat == 28, + "incorrect value for states[42].sid.sat, expected 28, is %d", + check_msg->states[42].sid.sat); + ck_assert_msg(check_msg->states[43].cn0 == 242, + "incorrect value for states[43].cn0, expected 242, is %d", + check_msg->states[43].cn0); + ck_assert_msg(check_msg->states[43].fcn == 16, + "incorrect value for states[43].fcn, expected 16, is %d", + check_msg->states[43].fcn); + ck_assert_msg( + check_msg->states[43].sid.code == 131, + "incorrect value for states[43].sid.code, expected 131, is %d", + check_msg->states[43].sid.code); + ck_assert_msg(check_msg->states[43].sid.sat == 190, + "incorrect value for states[43].sid.sat, expected 190, is %d", + check_msg->states[43].sid.sat); + ck_assert_msg(check_msg->states[44].cn0 == 113, + "incorrect value for states[44].cn0, expected 113, is %d", + check_msg->states[44].cn0); + ck_assert_msg(check_msg->states[44].fcn == 182, + "incorrect value for states[44].fcn, expected 182, is %d", + check_msg->states[44].fcn); + ck_assert_msg(check_msg->states[44].sid.code == 59, + "incorrect value for states[44].sid.code, expected 59, is %d", + check_msg->states[44].sid.code); + ck_assert_msg(check_msg->states[44].sid.sat == 105, + "incorrect value for states[44].sid.sat, expected 105, is %d", + check_msg->states[44].sid.sat); + ck_assert_msg(check_msg->states[45].cn0 == 179, + "incorrect value for states[45].cn0, expected 179, is %d", + check_msg->states[45].cn0); + ck_assert_msg(check_msg->states[45].fcn == 48, + "incorrect value for states[45].fcn, expected 48, is %d", + check_msg->states[45].fcn); + ck_assert_msg( + check_msg->states[45].sid.code == 180, + "incorrect value for states[45].sid.code, expected 180, is %d", + check_msg->states[45].sid.code); + ck_assert_msg(check_msg->states[45].sid.sat == 192, + "incorrect value for states[45].sid.sat, expected 192, is %d", + check_msg->states[45].sid.sat); + ck_assert_msg(check_msg->states[46].cn0 == 211, + "incorrect value for states[46].cn0, expected 211, is %d", + check_msg->states[46].cn0); + ck_assert_msg(check_msg->states[46].fcn == 172, + "incorrect value for states[46].fcn, expected 172, is %d", + check_msg->states[46].fcn); + ck_assert_msg(check_msg->states[46].sid.code == 31, + "incorrect value for states[46].sid.code, expected 31, is %d", + check_msg->states[46].sid.code); + ck_assert_msg(check_msg->states[46].sid.sat == 166, + "incorrect value for states[46].sid.sat, expected 166, is %d", + check_msg->states[46].sid.sat); + ck_assert_msg(check_msg->states[47].cn0 == 49, + "incorrect value for states[47].cn0, expected 49, is %d", + check_msg->states[47].cn0); + ck_assert_msg(check_msg->states[47].fcn == 140, + "incorrect value for states[47].fcn, expected 140, is %d", + check_msg->states[47].fcn); + ck_assert_msg( + check_msg->states[47].sid.code == 228, + "incorrect value for states[47].sid.code, expected 228, is %d", + check_msg->states[47].sid.code); + ck_assert_msg(check_msg->states[47].sid.sat == 77, + "incorrect value for states[47].sid.sat, expected 77, is %d", + check_msg->states[47].sid.sat); + ck_assert_msg(check_msg->states[48].cn0 == 194, + "incorrect value for states[48].cn0, expected 194, is %d", + check_msg->states[48].cn0); + ck_assert_msg(check_msg->states[48].fcn == 240, + "incorrect value for states[48].fcn, expected 240, is %d", + check_msg->states[48].fcn); + ck_assert_msg(check_msg->states[48].sid.code == 77, + "incorrect value for states[48].sid.code, expected 77, is %d", + check_msg->states[48].sid.code); + ck_assert_msg(check_msg->states[48].sid.sat == 128, + "incorrect value for states[48].sid.sat, expected 128, is %d", + check_msg->states[48].sid.sat); + ck_assert_msg(check_msg->states[49].cn0 == 58, + "incorrect value for states[49].cn0, expected 58, is %d", + check_msg->states[49].cn0); + ck_assert_msg(check_msg->states[49].fcn == 41, + "incorrect value for states[49].fcn, expected 41, is %d", + check_msg->states[49].fcn); + ck_assert_msg( + check_msg->states[49].sid.code == 194, + "incorrect value for states[49].sid.code, expected 194, is %d", + check_msg->states[49].sid.code); + ck_assert_msg(check_msg->states[49].sid.sat == 134, + "incorrect value for states[49].sid.sat, expected 134, is %d", + check_msg->states[49].sid.sat); + ck_assert_msg(check_msg->states[50].cn0 == 55, + "incorrect value for states[50].cn0, expected 55, is %d", + check_msg->states[50].cn0); + ck_assert_msg(check_msg->states[50].fcn == 129, + "incorrect value for states[50].fcn, expected 129, is %d", + check_msg->states[50].fcn); + ck_assert_msg(check_msg->states[50].sid.code == 53, + "incorrect value for states[50].sid.code, expected 53, is %d", + check_msg->states[50].sid.code); + ck_assert_msg(check_msg->states[50].sid.sat == 18, + "incorrect value for states[50].sid.sat, expected 18, is %d", + check_msg->states[50].sid.sat); + ck_assert_msg(check_msg->states[51].cn0 == 92, + "incorrect value for states[51].cn0, expected 92, is %d", + check_msg->states[51].cn0); + ck_assert_msg(check_msg->states[51].fcn == 134, + "incorrect value for states[51].fcn, expected 134, is %d", + check_msg->states[51].fcn); + ck_assert_msg(check_msg->states[51].sid.code == 72, + "incorrect value for states[51].sid.code, expected 72, is %d", + check_msg->states[51].sid.code); + ck_assert_msg(check_msg->states[51].sid.sat == 91, + "incorrect value for states[51].sid.sat, expected 91, is %d", + check_msg->states[51].sid.sat); + ck_assert_msg(check_msg->states[52].cn0 == 56, + "incorrect value for states[52].cn0, expected 56, is %d", + check_msg->states[52].cn0); + ck_assert_msg(check_msg->states[52].fcn == 157, + "incorrect value for states[52].fcn, expected 157, is %d", + check_msg->states[52].fcn); + ck_assert_msg( + check_msg->states[52].sid.code == 224, + "incorrect value for states[52].sid.code, expected 224, is %d", + check_msg->states[52].sid.code); + ck_assert_msg(check_msg->states[52].sid.sat == 33, + "incorrect value for states[52].sid.sat, expected 33, is %d", + check_msg->states[52].sid.sat); + ck_assert_msg(check_msg->states[53].cn0 == 174, + "incorrect value for states[53].cn0, expected 174, is %d", + check_msg->states[53].cn0); + ck_assert_msg(check_msg->states[53].fcn == 224, + "incorrect value for states[53].fcn, expected 224, is %d", + check_msg->states[53].fcn); + ck_assert_msg(check_msg->states[53].sid.code == 54, + "incorrect value for states[53].sid.code, expected 54, is %d", + check_msg->states[53].sid.code); + ck_assert_msg(check_msg->states[53].sid.sat == 186, + "incorrect value for states[53].sid.sat, expected 186, is %d", + check_msg->states[53].sid.sat); + ck_assert_msg(check_msg->states[54].cn0 == 190, + "incorrect value for states[54].cn0, expected 190, is %d", + check_msg->states[54].cn0); + ck_assert_msg(check_msg->states[54].fcn == 148, + "incorrect value for states[54].fcn, expected 148, is %d", + check_msg->states[54].fcn); + ck_assert_msg(check_msg->states[54].sid.code == 84, + "incorrect value for states[54].sid.code, expected 84, is %d", + check_msg->states[54].sid.code); + ck_assert_msg(check_msg->states[54].sid.sat == 82, + "incorrect value for states[54].sid.sat, expected 82, is %d", + check_msg->states[54].sid.sat); + ck_assert_msg(check_msg->states[55].cn0 == 67, + "incorrect value for states[55].cn0, expected 67, is %d", + check_msg->states[55].cn0); + ck_assert_msg(check_msg->states[55].fcn == 62, + "incorrect value for states[55].fcn, expected 62, is %d", + check_msg->states[55].fcn); + ck_assert_msg(check_msg->states[55].sid.code == 54, + "incorrect value for states[55].sid.code, expected 54, is %d", + check_msg->states[55].sid.code); + ck_assert_msg(check_msg->states[55].sid.sat == 236, + "incorrect value for states[55].sid.sat, expected 236, is %d", + check_msg->states[55].sid.sat); + ck_assert_msg(check_msg->states[56].cn0 == 254, + "incorrect value for states[56].cn0, expected 254, is %d", + check_msg->states[56].cn0); + ck_assert_msg(check_msg->states[56].fcn == 57, + "incorrect value for states[56].fcn, expected 57, is %d", + check_msg->states[56].fcn); + ck_assert_msg( + check_msg->states[56].sid.code == 215, + "incorrect value for states[56].sid.code, expected 215, is %d", + check_msg->states[56].sid.code); + ck_assert_msg(check_msg->states[56].sid.sat == 52, + "incorrect value for states[56].sid.sat, expected 52, is %d", + check_msg->states[56].sid.sat); + ck_assert_msg(check_msg->states[57].cn0 == 174, + "incorrect value for states[57].cn0, expected 174, is %d", + check_msg->states[57].cn0); + ck_assert_msg(check_msg->states[57].fcn == 36, + "incorrect value for states[57].fcn, expected 36, is %d", + check_msg->states[57].fcn); + ck_assert_msg( + check_msg->states[57].sid.code == 133, + "incorrect value for states[57].sid.code, expected 133, is %d", + check_msg->states[57].sid.code); + ck_assert_msg(check_msg->states[57].sid.sat == 16, + "incorrect value for states[57].sid.sat, expected 16, is %d", + check_msg->states[57].sid.sat); + ck_assert_msg(check_msg->states[58].cn0 == 17, + "incorrect value for states[58].cn0, expected 17, is %d", + check_msg->states[58].cn0); + ck_assert_msg(check_msg->states[58].fcn == 145, + "incorrect value for states[58].fcn, expected 145, is %d", + check_msg->states[58].fcn); + ck_assert_msg( + check_msg->states[58].sid.code == 172, + "incorrect value for states[58].sid.code, expected 172, is %d", + check_msg->states[58].sid.code); + ck_assert_msg(check_msg->states[58].sid.sat == 219, + "incorrect value for states[58].sid.sat, expected 219, is %d", + check_msg->states[58].sid.sat); + ck_assert_msg(check_msg->states[59].cn0 == 97, + "incorrect value for states[59].cn0, expected 97, is %d", + check_msg->states[59].cn0); + ck_assert_msg(check_msg->states[59].fcn == 111, + "incorrect value for states[59].fcn, expected 111, is %d", + check_msg->states[59].fcn); + ck_assert_msg( + check_msg->states[59].sid.code == 179, + "incorrect value for states[59].sid.code, expected 179, is %d", + check_msg->states[59].sid.code); + ck_assert_msg(check_msg->states[59].sid.sat == 192, + "incorrect value for states[59].sid.sat, expected 192, is %d", + check_msg->states[59].sid.sat); + ck_assert_msg(check_msg->states[60].cn0 == 134, + "incorrect value for states[60].cn0, expected 134, is %d", + check_msg->states[60].cn0); + ck_assert_msg(check_msg->states[60].fcn == 208, + "incorrect value for states[60].fcn, expected 208, is %d", + check_msg->states[60].fcn); + ck_assert_msg(check_msg->states[60].sid.code == 56, + "incorrect value for states[60].sid.code, expected 56, is %d", + check_msg->states[60].sid.code); + ck_assert_msg(check_msg->states[60].sid.sat == 207, + "incorrect value for states[60].sid.sat, expected 207, is %d", + check_msg->states[60].sid.sat); + ck_assert_msg(check_msg->states[61].cn0 == 226, + "incorrect value for states[61].cn0, expected 226, is %d", + check_msg->states[61].cn0); + ck_assert_msg(check_msg->states[61].fcn == 43, + "incorrect value for states[61].fcn, expected 43, is %d", + check_msg->states[61].fcn); + ck_assert_msg(check_msg->states[61].sid.code == 17, + "incorrect value for states[61].sid.code, expected 17, is %d", + check_msg->states[61].sid.code); + ck_assert_msg(check_msg->states[61].sid.sat == 180, + "incorrect value for states[61].sid.sat, expected 180, is %d", + check_msg->states[61].sid.sat); + ck_assert_msg(check_msg->states[62].cn0 == 113, + "incorrect value for states[62].cn0, expected 113, is %d", + check_msg->states[62].cn0); + ck_assert_msg(check_msg->states[62].fcn == 140, + "incorrect value for states[62].fcn, expected 140, is %d", + check_msg->states[62].fcn); + ck_assert_msg( + check_msg->states[62].sid.code == 182, + "incorrect value for states[62].sid.code, expected 182, is %d", + check_msg->states[62].sid.code); + ck_assert_msg(check_msg->states[62].sid.sat == 255, + "incorrect value for states[62].sid.sat, expected 255, is %d", + check_msg->states[62].sid.sat); } } END_TEST -Suite* legacy_auto_check_sbp_tracking_MsgTrackingState_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_tracking_MsgTrackingState"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_tracking_MsgTrackingState"); +Suite *legacy_auto_check_sbp_tracking_MsgTrackingState_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_tracking_MsgTrackingState"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_tracking_MsgTrackingState"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_tracking_MsgTrackingState); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_tracking_MsgTrackingStateDepB.c b/c/test/legacy/auto_check_sbp_tracking_MsgTrackingStateDepB.c index 742d89fe9..10a844755 100644 --- a/c/test/legacy/auto_check_sbp_tracking_MsgTrackingStateDepB.c +++ b/c/test/legacy/auto_check_sbp_tracking_MsgTrackingStateDepB.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB ) -{ +START_TEST(test_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,40 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x13, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x13, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x13, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x13, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,19,0,242,241,252,115,183,227,63,68,154,1,183,69,255,175,121,43,222,51,67,35,69,78,240,5,53,20,51,211,54,69,153,130,237,66,155,51,227,71,69,53,242,136,161,190,205,188,6,70,153,125,255,142,149,154,217,184,69,248,102,95,31,76,154,33,169,69,131,115,141,27,12,154,225,200,69,208,44,147,39,23,51,3,66,69,237,159,251,49,203,51,99,102,69,70,214,87,128,206,154,121,186,69,14,206,111,218,19,154,121,169,69,216,98,209,54,2,154,25,219,67,200,133,99,7,34,102,198,232,68,155,43,85,135,46,154,177,170,69,155,3,83,171,201,154,241,232,69,121,43,197,16,19,154,241,222,69,128,245,53,63,176,51,115,66,69,36,20,61,153,51,154,73,134,69,46,82,116,140,22,51,147,37,69,177,67,146,96,143,205,76,107,68,220,51,160,201,251,102,102,192,68,168,194,2,161,220,102,102,180,68,69,8,9,125,178,102,70,134,68,185,20,135,186,171,51,163,4,69,18,124,155,85,170,205,208,13,70,57,244,206,255,186,154,105,149,69,165,199,93,181,175,51,67,64,69,6,28, }; + u8 encoded_frame[] = { + 85, 19, 0, 242, 241, 252, 115, 183, 227, 63, 68, 154, 1, 183, + 69, 255, 175, 121, 43, 222, 51, 67, 35, 69, 78, 240, 5, 53, + 20, 51, 211, 54, 69, 153, 130, 237, 66, 155, 51, 227, 71, 69, + 53, 242, 136, 161, 190, 205, 188, 6, 70, 153, 125, 255, 142, 149, + 154, 217, 184, 69, 248, 102, 95, 31, 76, 154, 33, 169, 69, 131, + 115, 141, 27, 12, 154, 225, 200, 69, 208, 44, 147, 39, 23, 51, + 3, 66, 69, 237, 159, 251, 49, 203, 51, 99, 102, 69, 70, 214, + 87, 128, 206, 154, 121, 186, 69, 14, 206, 111, 218, 19, 154, 121, + 169, 69, 216, 98, 209, 54, 2, 154, 25, 219, 67, 200, 133, 99, + 7, 34, 102, 198, 232, 68, 155, 43, 85, 135, 46, 154, 177, 170, + 69, 155, 3, 83, 171, 201, 154, 241, 232, 69, 121, 43, 197, 16, + 19, 154, 241, 222, 69, 128, 245, 53, 63, 176, 51, 115, 66, 69, + 36, 20, 61, 153, 51, 154, 73, 134, 69, 46, 82, 116, 140, 22, + 51, 147, 37, 69, 177, 67, 146, 96, 143, 205, 76, 107, 68, 220, + 51, 160, 201, 251, 102, 102, 192, 68, 168, 194, 2, 161, 220, 102, + 102, 180, 68, 69, 8, 9, 125, 178, 102, 70, 134, 68, 185, 20, + 135, 186, 171, 51, 163, 4, 69, 18, 124, 155, 85, 170, 205, 208, + 13, 70, 57, 244, 206, 255, 186, 154, 105, 149, 69, 165, 199, 93, + 181, 175, 51, 67, 64, 69, 6, 28, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_state_dep_b_t* test_msg = ( msg_tracking_state_dep_b_t* )test_msg_storage; + msg_tracking_state_dep_b_t *test_msg = + (msg_tracking_state_dep_b_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->states) == 0) { // Cope with variable length arrays @@ -395,203 +415,587 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB ) test_msg->states[27].sid.reserved = 175; test_msg->states[27].sid.sat = 24007; test_msg->states[27].state = 165; - sbp_payload_send(&sbp_state, 0x13, 61938, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x13, 61938, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 61938, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 61938, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x13, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_state_dep_b_t* check_msg = ( msg_tracking_state_dep_b_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_state_dep_b_t *check_msg = + (msg_tracking_state_dep_b_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->states[0].cn0*100 - 5856.20019531*100) < 0.05, "incorrect value for states[0].cn0, expected 5856.20019531, is %f", check_msg->states[0].cn0); - ck_assert_msg(check_msg->states[0].sid.code == 63, "incorrect value for states[0].sid.code, expected 63, is %d", check_msg->states[0].sid.code); - ck_assert_msg(check_msg->states[0].sid.reserved == 68, "incorrect value for states[0].sid.reserved, expected 68, is %d", check_msg->states[0].sid.reserved); - ck_assert_msg(check_msg->states[0].sid.sat == 58295, "incorrect value for states[0].sid.sat, expected 58295, is %d", check_msg->states[0].sid.sat); - ck_assert_msg(check_msg->states[0].state == 115, "incorrect value for states[0].state, expected 115, is %d", check_msg->states[0].state); - ck_assert_msg((check_msg->states[1].cn0*100 - 2612.19995117*100) < 0.05, "incorrect value for states[1].cn0, expected 2612.19995117, is %f", check_msg->states[1].cn0); - ck_assert_msg(check_msg->states[1].sid.code == 43, "incorrect value for states[1].sid.code, expected 43, is %d", check_msg->states[1].sid.code); - ck_assert_msg(check_msg->states[1].sid.reserved == 222, "incorrect value for states[1].sid.reserved, expected 222, is %d", check_msg->states[1].sid.reserved); - ck_assert_msg(check_msg->states[1].sid.sat == 31151, "incorrect value for states[1].sid.sat, expected 31151, is %d", check_msg->states[1].sid.sat); - ck_assert_msg(check_msg->states[1].state == 255, "incorrect value for states[1].state, expected 255, is %d", check_msg->states[1].state); - ck_assert_msg((check_msg->states[2].cn0*100 - 2925.19995117*100) < 0.05, "incorrect value for states[2].cn0, expected 2925.19995117, is %f", check_msg->states[2].cn0); - ck_assert_msg(check_msg->states[2].sid.code == 53, "incorrect value for states[2].sid.code, expected 53, is %d", check_msg->states[2].sid.code); - ck_assert_msg(check_msg->states[2].sid.reserved == 20, "incorrect value for states[2].sid.reserved, expected 20, is %d", check_msg->states[2].sid.reserved); - ck_assert_msg(check_msg->states[2].sid.sat == 1520, "incorrect value for states[2].sid.sat, expected 1520, is %d", check_msg->states[2].sid.sat); - ck_assert_msg(check_msg->states[2].state == 78, "incorrect value for states[2].state, expected 78, is %d", check_msg->states[2].state); - ck_assert_msg((check_msg->states[3].cn0*100 - 3198.19995117*100) < 0.05, "incorrect value for states[3].cn0, expected 3198.19995117, is %f", check_msg->states[3].cn0); - ck_assert_msg(check_msg->states[3].sid.code == 66, "incorrect value for states[3].sid.code, expected 66, is %d", check_msg->states[3].sid.code); - ck_assert_msg(check_msg->states[3].sid.reserved == 155, "incorrect value for states[3].sid.reserved, expected 155, is %d", check_msg->states[3].sid.reserved); - ck_assert_msg(check_msg->states[3].sid.sat == 60802, "incorrect value for states[3].sid.sat, expected 60802, is %d", check_msg->states[3].sid.sat); - ck_assert_msg(check_msg->states[3].state == 153, "incorrect value for states[3].state, expected 153, is %d", check_msg->states[3].state); - ck_assert_msg((check_msg->states[4].cn0*100 - 8623.20019531*100) < 0.05, "incorrect value for states[4].cn0, expected 8623.20019531, is %f", check_msg->states[4].cn0); - ck_assert_msg(check_msg->states[4].sid.code == 161, "incorrect value for states[4].sid.code, expected 161, is %d", check_msg->states[4].sid.code); - ck_assert_msg(check_msg->states[4].sid.reserved == 190, "incorrect value for states[4].sid.reserved, expected 190, is %d", check_msg->states[4].sid.reserved); - ck_assert_msg(check_msg->states[4].sid.sat == 35058, "incorrect value for states[4].sid.sat, expected 35058, is %d", check_msg->states[4].sid.sat); - ck_assert_msg(check_msg->states[4].state == 53, "incorrect value for states[4].state, expected 53, is %d", check_msg->states[4].state); - ck_assert_msg((check_msg->states[5].cn0*100 - 5915.20019531*100) < 0.05, "incorrect value for states[5].cn0, expected 5915.20019531, is %f", check_msg->states[5].cn0); - ck_assert_msg(check_msg->states[5].sid.code == 142, "incorrect value for states[5].sid.code, expected 142, is %d", check_msg->states[5].sid.code); - ck_assert_msg(check_msg->states[5].sid.reserved == 149, "incorrect value for states[5].sid.reserved, expected 149, is %d", check_msg->states[5].sid.reserved); - ck_assert_msg(check_msg->states[5].sid.sat == 65405, "incorrect value for states[5].sid.sat, expected 65405, is %d", check_msg->states[5].sid.sat); - ck_assert_msg(check_msg->states[5].state == 153, "incorrect value for states[5].state, expected 153, is %d", check_msg->states[5].state); - ck_assert_msg((check_msg->states[6].cn0*100 - 5412.20019531*100) < 0.05, "incorrect value for states[6].cn0, expected 5412.20019531, is %f", check_msg->states[6].cn0); - ck_assert_msg(check_msg->states[6].sid.code == 31, "incorrect value for states[6].sid.code, expected 31, is %d", check_msg->states[6].sid.code); - ck_assert_msg(check_msg->states[6].sid.reserved == 76, "incorrect value for states[6].sid.reserved, expected 76, is %d", check_msg->states[6].sid.reserved); - ck_assert_msg(check_msg->states[6].sid.sat == 24422, "incorrect value for states[6].sid.sat, expected 24422, is %d", check_msg->states[6].sid.sat); - ck_assert_msg(check_msg->states[6].state == 248, "incorrect value for states[6].state, expected 248, is %d", check_msg->states[6].state); - ck_assert_msg((check_msg->states[7].cn0*100 - 6428.20019531*100) < 0.05, "incorrect value for states[7].cn0, expected 6428.20019531, is %f", check_msg->states[7].cn0); - ck_assert_msg(check_msg->states[7].sid.code == 27, "incorrect value for states[7].sid.code, expected 27, is %d", check_msg->states[7].sid.code); - ck_assert_msg(check_msg->states[7].sid.reserved == 12, "incorrect value for states[7].sid.reserved, expected 12, is %d", check_msg->states[7].sid.reserved); - ck_assert_msg(check_msg->states[7].sid.sat == 36211, "incorrect value for states[7].sid.sat, expected 36211, is %d", check_msg->states[7].sid.sat); - ck_assert_msg(check_msg->states[7].state == 131, "incorrect value for states[7].state, expected 131, is %d", check_msg->states[7].state); - ck_assert_msg((check_msg->states[8].cn0*100 - 3104.19995117*100) < 0.05, "incorrect value for states[8].cn0, expected 3104.19995117, is %f", check_msg->states[8].cn0); - ck_assert_msg(check_msg->states[8].sid.code == 39, "incorrect value for states[8].sid.code, expected 39, is %d", check_msg->states[8].sid.code); - ck_assert_msg(check_msg->states[8].sid.reserved == 23, "incorrect value for states[8].sid.reserved, expected 23, is %d", check_msg->states[8].sid.reserved); - ck_assert_msg(check_msg->states[8].sid.sat == 37676, "incorrect value for states[8].sid.sat, expected 37676, is %d", check_msg->states[8].sid.sat); - ck_assert_msg(check_msg->states[8].state == 208, "incorrect value for states[8].state, expected 208, is %d", check_msg->states[8].state); - ck_assert_msg((check_msg->states[9].cn0*100 - 3686.19995117*100) < 0.05, "incorrect value for states[9].cn0, expected 3686.19995117, is %f", check_msg->states[9].cn0); - ck_assert_msg(check_msg->states[9].sid.code == 49, "incorrect value for states[9].sid.code, expected 49, is %d", check_msg->states[9].sid.code); - ck_assert_msg(check_msg->states[9].sid.reserved == 203, "incorrect value for states[9].sid.reserved, expected 203, is %d", check_msg->states[9].sid.reserved); - ck_assert_msg(check_msg->states[9].sid.sat == 64415, "incorrect value for states[9].sid.sat, expected 64415, is %d", check_msg->states[9].sid.sat); - ck_assert_msg(check_msg->states[9].state == 237, "incorrect value for states[9].state, expected 237, is %d", check_msg->states[9].state); - ck_assert_msg((check_msg->states[10].cn0*100 - 5967.20019531*100) < 0.05, "incorrect value for states[10].cn0, expected 5967.20019531, is %f", check_msg->states[10].cn0); - ck_assert_msg(check_msg->states[10].sid.code == 128, "incorrect value for states[10].sid.code, expected 128, is %d", check_msg->states[10].sid.code); - ck_assert_msg(check_msg->states[10].sid.reserved == 206, "incorrect value for states[10].sid.reserved, expected 206, is %d", check_msg->states[10].sid.reserved); - ck_assert_msg(check_msg->states[10].sid.sat == 22486, "incorrect value for states[10].sid.sat, expected 22486, is %d", check_msg->states[10].sid.sat); - ck_assert_msg(check_msg->states[10].state == 70, "incorrect value for states[10].state, expected 70, is %d", check_msg->states[10].state); - ck_assert_msg((check_msg->states[11].cn0*100 - 5423.20019531*100) < 0.05, "incorrect value for states[11].cn0, expected 5423.20019531, is %f", check_msg->states[11].cn0); - ck_assert_msg(check_msg->states[11].sid.code == 218, "incorrect value for states[11].sid.code, expected 218, is %d", check_msg->states[11].sid.code); - ck_assert_msg(check_msg->states[11].sid.reserved == 19, "incorrect value for states[11].sid.reserved, expected 19, is %d", check_msg->states[11].sid.reserved); - ck_assert_msg(check_msg->states[11].sid.sat == 28622, "incorrect value for states[11].sid.sat, expected 28622, is %d", check_msg->states[11].sid.sat); - ck_assert_msg(check_msg->states[11].state == 14, "incorrect value for states[11].state, expected 14, is %d", check_msg->states[11].state); - ck_assert_msg((check_msg->states[12].cn0*100 - 438.200012207*100) < 0.05, "incorrect value for states[12].cn0, expected 438.200012207, is %f", check_msg->states[12].cn0); - ck_assert_msg(check_msg->states[12].sid.code == 54, "incorrect value for states[12].sid.code, expected 54, is %d", check_msg->states[12].sid.code); - ck_assert_msg(check_msg->states[12].sid.reserved == 2, "incorrect value for states[12].sid.reserved, expected 2, is %d", check_msg->states[12].sid.reserved); - ck_assert_msg(check_msg->states[12].sid.sat == 53602, "incorrect value for states[12].sid.sat, expected 53602, is %d", check_msg->states[12].sid.sat); - ck_assert_msg(check_msg->states[12].state == 216, "incorrect value for states[12].state, expected 216, is %d", check_msg->states[12].state); - ck_assert_msg((check_msg->states[13].cn0*100 - 1862.19995117*100) < 0.05, "incorrect value for states[13].cn0, expected 1862.19995117, is %f", check_msg->states[13].cn0); - ck_assert_msg(check_msg->states[13].sid.code == 7, "incorrect value for states[13].sid.code, expected 7, is %d", check_msg->states[13].sid.code); - ck_assert_msg(check_msg->states[13].sid.reserved == 34, "incorrect value for states[13].sid.reserved, expected 34, is %d", check_msg->states[13].sid.reserved); - ck_assert_msg(check_msg->states[13].sid.sat == 25477, "incorrect value for states[13].sid.sat, expected 25477, is %d", check_msg->states[13].sid.sat); - ck_assert_msg(check_msg->states[13].state == 200, "incorrect value for states[13].state, expected 200, is %d", check_msg->states[13].state); - ck_assert_msg((check_msg->states[14].cn0*100 - 5462.20019531*100) < 0.05, "incorrect value for states[14].cn0, expected 5462.20019531, is %f", check_msg->states[14].cn0); - ck_assert_msg(check_msg->states[14].sid.code == 135, "incorrect value for states[14].sid.code, expected 135, is %d", check_msg->states[14].sid.code); - ck_assert_msg(check_msg->states[14].sid.reserved == 46, "incorrect value for states[14].sid.reserved, expected 46, is %d", check_msg->states[14].sid.reserved); - ck_assert_msg(check_msg->states[14].sid.sat == 21803, "incorrect value for states[14].sid.sat, expected 21803, is %d", check_msg->states[14].sid.sat); - ck_assert_msg(check_msg->states[14].state == 155, "incorrect value for states[14].state, expected 155, is %d", check_msg->states[14].state); - ck_assert_msg((check_msg->states[15].cn0*100 - 7454.20019531*100) < 0.05, "incorrect value for states[15].cn0, expected 7454.20019531, is %f", check_msg->states[15].cn0); - ck_assert_msg(check_msg->states[15].sid.code == 171, "incorrect value for states[15].sid.code, expected 171, is %d", check_msg->states[15].sid.code); - ck_assert_msg(check_msg->states[15].sid.reserved == 201, "incorrect value for states[15].sid.reserved, expected 201, is %d", check_msg->states[15].sid.reserved); - ck_assert_msg(check_msg->states[15].sid.sat == 21251, "incorrect value for states[15].sid.sat, expected 21251, is %d", check_msg->states[15].sid.sat); - ck_assert_msg(check_msg->states[15].state == 155, "incorrect value for states[15].state, expected 155, is %d", check_msg->states[15].state); - ck_assert_msg((check_msg->states[16].cn0*100 - 7134.20019531*100) < 0.05, "incorrect value for states[16].cn0, expected 7134.20019531, is %f", check_msg->states[16].cn0); - ck_assert_msg(check_msg->states[16].sid.code == 16, "incorrect value for states[16].sid.code, expected 16, is %d", check_msg->states[16].sid.code); - ck_assert_msg(check_msg->states[16].sid.reserved == 19, "incorrect value for states[16].sid.reserved, expected 19, is %d", check_msg->states[16].sid.reserved); - ck_assert_msg(check_msg->states[16].sid.sat == 50475, "incorrect value for states[16].sid.sat, expected 50475, is %d", check_msg->states[16].sid.sat); - ck_assert_msg(check_msg->states[16].state == 121, "incorrect value for states[16].state, expected 121, is %d", check_msg->states[16].state); - ck_assert_msg((check_msg->states[17].cn0*100 - 3111.19995117*100) < 0.05, "incorrect value for states[17].cn0, expected 3111.19995117, is %f", check_msg->states[17].cn0); - ck_assert_msg(check_msg->states[17].sid.code == 63, "incorrect value for states[17].sid.code, expected 63, is %d", check_msg->states[17].sid.code); - ck_assert_msg(check_msg->states[17].sid.reserved == 176, "incorrect value for states[17].sid.reserved, expected 176, is %d", check_msg->states[17].sid.reserved); - ck_assert_msg(check_msg->states[17].sid.sat == 13813, "incorrect value for states[17].sid.sat, expected 13813, is %d", check_msg->states[17].sid.sat); - ck_assert_msg(check_msg->states[17].state == 128, "incorrect value for states[17].state, expected 128, is %d", check_msg->states[17].state); - ck_assert_msg((check_msg->states[18].cn0*100 - 4297.20019531*100) < 0.05, "incorrect value for states[18].cn0, expected 4297.20019531, is %f", check_msg->states[18].cn0); - ck_assert_msg(check_msg->states[18].sid.code == 153, "incorrect value for states[18].sid.code, expected 153, is %d", check_msg->states[18].sid.code); - ck_assert_msg(check_msg->states[18].sid.reserved == 51, "incorrect value for states[18].sid.reserved, expected 51, is %d", check_msg->states[18].sid.reserved); - ck_assert_msg(check_msg->states[18].sid.sat == 15636, "incorrect value for states[18].sid.sat, expected 15636, is %d", check_msg->states[18].sid.sat); - ck_assert_msg(check_msg->states[18].state == 36, "incorrect value for states[18].state, expected 36, is %d", check_msg->states[18].state); - ck_assert_msg((check_msg->states[19].cn0*100 - 2649.19995117*100) < 0.05, "incorrect value for states[19].cn0, expected 2649.19995117, is %f", check_msg->states[19].cn0); - ck_assert_msg(check_msg->states[19].sid.code == 140, "incorrect value for states[19].sid.code, expected 140, is %d", check_msg->states[19].sid.code); - ck_assert_msg(check_msg->states[19].sid.reserved == 22, "incorrect value for states[19].sid.reserved, expected 22, is %d", check_msg->states[19].sid.reserved); - ck_assert_msg(check_msg->states[19].sid.sat == 29778, "incorrect value for states[19].sid.sat, expected 29778, is %d", check_msg->states[19].sid.sat); - ck_assert_msg(check_msg->states[19].state == 46, "incorrect value for states[19].state, expected 46, is %d", check_msg->states[19].state); - ck_assert_msg((check_msg->states[20].cn0*100 - 941.200012207*100) < 0.05, "incorrect value for states[20].cn0, expected 941.200012207, is %f", check_msg->states[20].cn0); - ck_assert_msg(check_msg->states[20].sid.code == 96, "incorrect value for states[20].sid.code, expected 96, is %d", check_msg->states[20].sid.code); - ck_assert_msg(check_msg->states[20].sid.reserved == 143, "incorrect value for states[20].sid.reserved, expected 143, is %d", check_msg->states[20].sid.reserved); - ck_assert_msg(check_msg->states[20].sid.sat == 37443, "incorrect value for states[20].sid.sat, expected 37443, is %d", check_msg->states[20].sid.sat); - ck_assert_msg(check_msg->states[20].state == 177, "incorrect value for states[20].state, expected 177, is %d", check_msg->states[20].state); - ck_assert_msg((check_msg->states[21].cn0*100 - 1539.19995117*100) < 0.05, "incorrect value for states[21].cn0, expected 1539.19995117, is %f", check_msg->states[21].cn0); - ck_assert_msg(check_msg->states[21].sid.code == 201, "incorrect value for states[21].sid.code, expected 201, is %d", check_msg->states[21].sid.code); - ck_assert_msg(check_msg->states[21].sid.reserved == 251, "incorrect value for states[21].sid.reserved, expected 251, is %d", check_msg->states[21].sid.reserved); - ck_assert_msg(check_msg->states[21].sid.sat == 41011, "incorrect value for states[21].sid.sat, expected 41011, is %d", check_msg->states[21].sid.sat); - ck_assert_msg(check_msg->states[21].state == 220, "incorrect value for states[21].state, expected 220, is %d", check_msg->states[21].state); - ck_assert_msg((check_msg->states[22].cn0*100 - 1443.19995117*100) < 0.05, "incorrect value for states[22].cn0, expected 1443.19995117, is %f", check_msg->states[22].cn0); - ck_assert_msg(check_msg->states[22].sid.code == 161, "incorrect value for states[22].sid.code, expected 161, is %d", check_msg->states[22].sid.code); - ck_assert_msg(check_msg->states[22].sid.reserved == 220, "incorrect value for states[22].sid.reserved, expected 220, is %d", check_msg->states[22].sid.reserved); - ck_assert_msg(check_msg->states[22].sid.sat == 706, "incorrect value for states[22].sid.sat, expected 706, is %d", check_msg->states[22].sid.sat); - ck_assert_msg(check_msg->states[22].state == 168, "incorrect value for states[22].state, expected 168, is %d", check_msg->states[22].state); - ck_assert_msg((check_msg->states[23].cn0*100 - 1074.19995117*100) < 0.05, "incorrect value for states[23].cn0, expected 1074.19995117, is %f", check_msg->states[23].cn0); - ck_assert_msg(check_msg->states[23].sid.code == 125, "incorrect value for states[23].sid.code, expected 125, is %d", check_msg->states[23].sid.code); - ck_assert_msg(check_msg->states[23].sid.reserved == 178, "incorrect value for states[23].sid.reserved, expected 178, is %d", check_msg->states[23].sid.reserved); - ck_assert_msg(check_msg->states[23].sid.sat == 2312, "incorrect value for states[23].sid.sat, expected 2312, is %d", check_msg->states[23].sid.sat); - ck_assert_msg(check_msg->states[23].state == 69, "incorrect value for states[23].state, expected 69, is %d", check_msg->states[23].state); - ck_assert_msg((check_msg->states[24].cn0*100 - 2122.19995117*100) < 0.05, "incorrect value for states[24].cn0, expected 2122.19995117, is %f", check_msg->states[24].cn0); - ck_assert_msg(check_msg->states[24].sid.code == 186, "incorrect value for states[24].sid.code, expected 186, is %d", check_msg->states[24].sid.code); - ck_assert_msg(check_msg->states[24].sid.reserved == 171, "incorrect value for states[24].sid.reserved, expected 171, is %d", check_msg->states[24].sid.reserved); - ck_assert_msg(check_msg->states[24].sid.sat == 34580, "incorrect value for states[24].sid.sat, expected 34580, is %d", check_msg->states[24].sid.sat); - ck_assert_msg(check_msg->states[24].state == 185, "incorrect value for states[24].state, expected 185, is %d", check_msg->states[24].state); - ck_assert_msg((check_msg->states[25].cn0*100 - 9076.20019531*100) < 0.05, "incorrect value for states[25].cn0, expected 9076.20019531, is %f", check_msg->states[25].cn0); - ck_assert_msg(check_msg->states[25].sid.code == 85, "incorrect value for states[25].sid.code, expected 85, is %d", check_msg->states[25].sid.code); - ck_assert_msg(check_msg->states[25].sid.reserved == 170, "incorrect value for states[25].sid.reserved, expected 170, is %d", check_msg->states[25].sid.reserved); - ck_assert_msg(check_msg->states[25].sid.sat == 39804, "incorrect value for states[25].sid.sat, expected 39804, is %d", check_msg->states[25].sid.sat); - ck_assert_msg(check_msg->states[25].state == 18, "incorrect value for states[25].state, expected 18, is %d", check_msg->states[25].state); - ck_assert_msg((check_msg->states[26].cn0*100 - 4781.20019531*100) < 0.05, "incorrect value for states[26].cn0, expected 4781.20019531, is %f", check_msg->states[26].cn0); - ck_assert_msg(check_msg->states[26].sid.code == 255, "incorrect value for states[26].sid.code, expected 255, is %d", check_msg->states[26].sid.code); - ck_assert_msg(check_msg->states[26].sid.reserved == 186, "incorrect value for states[26].sid.reserved, expected 186, is %d", check_msg->states[26].sid.reserved); - ck_assert_msg(check_msg->states[26].sid.sat == 52980, "incorrect value for states[26].sid.sat, expected 52980, is %d", check_msg->states[26].sid.sat); - ck_assert_msg(check_msg->states[26].state == 57, "incorrect value for states[26].state, expected 57, is %d", check_msg->states[26].state); - ck_assert_msg((check_msg->states[27].cn0*100 - 3076.19995117*100) < 0.05, "incorrect value for states[27].cn0, expected 3076.19995117, is %f", check_msg->states[27].cn0); - ck_assert_msg(check_msg->states[27].sid.code == 181, "incorrect value for states[27].sid.code, expected 181, is %d", check_msg->states[27].sid.code); - ck_assert_msg(check_msg->states[27].sid.reserved == 175, "incorrect value for states[27].sid.reserved, expected 175, is %d", check_msg->states[27].sid.reserved); - ck_assert_msg(check_msg->states[27].sid.sat == 24007, "incorrect value for states[27].sid.sat, expected 24007, is %d", check_msg->states[27].sid.sat); - ck_assert_msg(check_msg->states[27].state == 165, "incorrect value for states[27].state, expected 165, is %d", check_msg->states[27].state); + ck_assert_msg( + (check_msg->states[0].cn0 * 100 - 5856.20019531 * 100) < 0.05, + "incorrect value for states[0].cn0, expected 5856.20019531, is %f", + check_msg->states[0].cn0); + ck_assert_msg(check_msg->states[0].sid.code == 63, + "incorrect value for states[0].sid.code, expected 63, is %d", + check_msg->states[0].sid.code); + ck_assert_msg( + check_msg->states[0].sid.reserved == 68, + "incorrect value for states[0].sid.reserved, expected 68, is %d", + check_msg->states[0].sid.reserved); + ck_assert_msg( + check_msg->states[0].sid.sat == 58295, + "incorrect value for states[0].sid.sat, expected 58295, is %d", + check_msg->states[0].sid.sat); + ck_assert_msg(check_msg->states[0].state == 115, + "incorrect value for states[0].state, expected 115, is %d", + check_msg->states[0].state); + ck_assert_msg( + (check_msg->states[1].cn0 * 100 - 2612.19995117 * 100) < 0.05, + "incorrect value for states[1].cn0, expected 2612.19995117, is %f", + check_msg->states[1].cn0); + ck_assert_msg(check_msg->states[1].sid.code == 43, + "incorrect value for states[1].sid.code, expected 43, is %d", + check_msg->states[1].sid.code); + ck_assert_msg( + check_msg->states[1].sid.reserved == 222, + "incorrect value for states[1].sid.reserved, expected 222, is %d", + check_msg->states[1].sid.reserved); + ck_assert_msg( + check_msg->states[1].sid.sat == 31151, + "incorrect value for states[1].sid.sat, expected 31151, is %d", + check_msg->states[1].sid.sat); + ck_assert_msg(check_msg->states[1].state == 255, + "incorrect value for states[1].state, expected 255, is %d", + check_msg->states[1].state); + ck_assert_msg( + (check_msg->states[2].cn0 * 100 - 2925.19995117 * 100) < 0.05, + "incorrect value for states[2].cn0, expected 2925.19995117, is %f", + check_msg->states[2].cn0); + ck_assert_msg(check_msg->states[2].sid.code == 53, + "incorrect value for states[2].sid.code, expected 53, is %d", + check_msg->states[2].sid.code); + ck_assert_msg( + check_msg->states[2].sid.reserved == 20, + "incorrect value for states[2].sid.reserved, expected 20, is %d", + check_msg->states[2].sid.reserved); + ck_assert_msg(check_msg->states[2].sid.sat == 1520, + "incorrect value for states[2].sid.sat, expected 1520, is %d", + check_msg->states[2].sid.sat); + ck_assert_msg(check_msg->states[2].state == 78, + "incorrect value for states[2].state, expected 78, is %d", + check_msg->states[2].state); + ck_assert_msg( + (check_msg->states[3].cn0 * 100 - 3198.19995117 * 100) < 0.05, + "incorrect value for states[3].cn0, expected 3198.19995117, is %f", + check_msg->states[3].cn0); + ck_assert_msg(check_msg->states[3].sid.code == 66, + "incorrect value for states[3].sid.code, expected 66, is %d", + check_msg->states[3].sid.code); + ck_assert_msg( + check_msg->states[3].sid.reserved == 155, + "incorrect value for states[3].sid.reserved, expected 155, is %d", + check_msg->states[3].sid.reserved); + ck_assert_msg( + check_msg->states[3].sid.sat == 60802, + "incorrect value for states[3].sid.sat, expected 60802, is %d", + check_msg->states[3].sid.sat); + ck_assert_msg(check_msg->states[3].state == 153, + "incorrect value for states[3].state, expected 153, is %d", + check_msg->states[3].state); + ck_assert_msg( + (check_msg->states[4].cn0 * 100 - 8623.20019531 * 100) < 0.05, + "incorrect value for states[4].cn0, expected 8623.20019531, is %f", + check_msg->states[4].cn0); + ck_assert_msg(check_msg->states[4].sid.code == 161, + "incorrect value for states[4].sid.code, expected 161, is %d", + check_msg->states[4].sid.code); + ck_assert_msg( + check_msg->states[4].sid.reserved == 190, + "incorrect value for states[4].sid.reserved, expected 190, is %d", + check_msg->states[4].sid.reserved); + ck_assert_msg( + check_msg->states[4].sid.sat == 35058, + "incorrect value for states[4].sid.sat, expected 35058, is %d", + check_msg->states[4].sid.sat); + ck_assert_msg(check_msg->states[4].state == 53, + "incorrect value for states[4].state, expected 53, is %d", + check_msg->states[4].state); + ck_assert_msg( + (check_msg->states[5].cn0 * 100 - 5915.20019531 * 100) < 0.05, + "incorrect value for states[5].cn0, expected 5915.20019531, is %f", + check_msg->states[5].cn0); + ck_assert_msg(check_msg->states[5].sid.code == 142, + "incorrect value for states[5].sid.code, expected 142, is %d", + check_msg->states[5].sid.code); + ck_assert_msg( + check_msg->states[5].sid.reserved == 149, + "incorrect value for states[5].sid.reserved, expected 149, is %d", + check_msg->states[5].sid.reserved); + ck_assert_msg( + check_msg->states[5].sid.sat == 65405, + "incorrect value for states[5].sid.sat, expected 65405, is %d", + check_msg->states[5].sid.sat); + ck_assert_msg(check_msg->states[5].state == 153, + "incorrect value for states[5].state, expected 153, is %d", + check_msg->states[5].state); + ck_assert_msg( + (check_msg->states[6].cn0 * 100 - 5412.20019531 * 100) < 0.05, + "incorrect value for states[6].cn0, expected 5412.20019531, is %f", + check_msg->states[6].cn0); + ck_assert_msg(check_msg->states[6].sid.code == 31, + "incorrect value for states[6].sid.code, expected 31, is %d", + check_msg->states[6].sid.code); + ck_assert_msg( + check_msg->states[6].sid.reserved == 76, + "incorrect value for states[6].sid.reserved, expected 76, is %d", + check_msg->states[6].sid.reserved); + ck_assert_msg( + check_msg->states[6].sid.sat == 24422, + "incorrect value for states[6].sid.sat, expected 24422, is %d", + check_msg->states[6].sid.sat); + ck_assert_msg(check_msg->states[6].state == 248, + "incorrect value for states[6].state, expected 248, is %d", + check_msg->states[6].state); + ck_assert_msg( + (check_msg->states[7].cn0 * 100 - 6428.20019531 * 100) < 0.05, + "incorrect value for states[7].cn0, expected 6428.20019531, is %f", + check_msg->states[7].cn0); + ck_assert_msg(check_msg->states[7].sid.code == 27, + "incorrect value for states[7].sid.code, expected 27, is %d", + check_msg->states[7].sid.code); + ck_assert_msg( + check_msg->states[7].sid.reserved == 12, + "incorrect value for states[7].sid.reserved, expected 12, is %d", + check_msg->states[7].sid.reserved); + ck_assert_msg( + check_msg->states[7].sid.sat == 36211, + "incorrect value for states[7].sid.sat, expected 36211, is %d", + check_msg->states[7].sid.sat); + ck_assert_msg(check_msg->states[7].state == 131, + "incorrect value for states[7].state, expected 131, is %d", + check_msg->states[7].state); + ck_assert_msg( + (check_msg->states[8].cn0 * 100 - 3104.19995117 * 100) < 0.05, + "incorrect value for states[8].cn0, expected 3104.19995117, is %f", + check_msg->states[8].cn0); + ck_assert_msg(check_msg->states[8].sid.code == 39, + "incorrect value for states[8].sid.code, expected 39, is %d", + check_msg->states[8].sid.code); + ck_assert_msg( + check_msg->states[8].sid.reserved == 23, + "incorrect value for states[8].sid.reserved, expected 23, is %d", + check_msg->states[8].sid.reserved); + ck_assert_msg( + check_msg->states[8].sid.sat == 37676, + "incorrect value for states[8].sid.sat, expected 37676, is %d", + check_msg->states[8].sid.sat); + ck_assert_msg(check_msg->states[8].state == 208, + "incorrect value for states[8].state, expected 208, is %d", + check_msg->states[8].state); + ck_assert_msg( + (check_msg->states[9].cn0 * 100 - 3686.19995117 * 100) < 0.05, + "incorrect value for states[9].cn0, expected 3686.19995117, is %f", + check_msg->states[9].cn0); + ck_assert_msg(check_msg->states[9].sid.code == 49, + "incorrect value for states[9].sid.code, expected 49, is %d", + check_msg->states[9].sid.code); + ck_assert_msg( + check_msg->states[9].sid.reserved == 203, + "incorrect value for states[9].sid.reserved, expected 203, is %d", + check_msg->states[9].sid.reserved); + ck_assert_msg( + check_msg->states[9].sid.sat == 64415, + "incorrect value for states[9].sid.sat, expected 64415, is %d", + check_msg->states[9].sid.sat); + ck_assert_msg(check_msg->states[9].state == 237, + "incorrect value for states[9].state, expected 237, is %d", + check_msg->states[9].state); + ck_assert_msg( + (check_msg->states[10].cn0 * 100 - 5967.20019531 * 100) < 0.05, + "incorrect value for states[10].cn0, expected 5967.20019531, is %f", + check_msg->states[10].cn0); + ck_assert_msg( + check_msg->states[10].sid.code == 128, + "incorrect value for states[10].sid.code, expected 128, is %d", + check_msg->states[10].sid.code); + ck_assert_msg( + check_msg->states[10].sid.reserved == 206, + "incorrect value for states[10].sid.reserved, expected 206, is %d", + check_msg->states[10].sid.reserved); + ck_assert_msg( + check_msg->states[10].sid.sat == 22486, + "incorrect value for states[10].sid.sat, expected 22486, is %d", + check_msg->states[10].sid.sat); + ck_assert_msg(check_msg->states[10].state == 70, + "incorrect value for states[10].state, expected 70, is %d", + check_msg->states[10].state); + ck_assert_msg( + (check_msg->states[11].cn0 * 100 - 5423.20019531 * 100) < 0.05, + "incorrect value for states[11].cn0, expected 5423.20019531, is %f", + check_msg->states[11].cn0); + ck_assert_msg( + check_msg->states[11].sid.code == 218, + "incorrect value for states[11].sid.code, expected 218, is %d", + check_msg->states[11].sid.code); + ck_assert_msg( + check_msg->states[11].sid.reserved == 19, + "incorrect value for states[11].sid.reserved, expected 19, is %d", + check_msg->states[11].sid.reserved); + ck_assert_msg( + check_msg->states[11].sid.sat == 28622, + "incorrect value for states[11].sid.sat, expected 28622, is %d", + check_msg->states[11].sid.sat); + ck_assert_msg(check_msg->states[11].state == 14, + "incorrect value for states[11].state, expected 14, is %d", + check_msg->states[11].state); + ck_assert_msg( + (check_msg->states[12].cn0 * 100 - 438.200012207 * 100) < 0.05, + "incorrect value for states[12].cn0, expected 438.200012207, is %f", + check_msg->states[12].cn0); + ck_assert_msg(check_msg->states[12].sid.code == 54, + "incorrect value for states[12].sid.code, expected 54, is %d", + check_msg->states[12].sid.code); + ck_assert_msg( + check_msg->states[12].sid.reserved == 2, + "incorrect value for states[12].sid.reserved, expected 2, is %d", + check_msg->states[12].sid.reserved); + ck_assert_msg( + check_msg->states[12].sid.sat == 53602, + "incorrect value for states[12].sid.sat, expected 53602, is %d", + check_msg->states[12].sid.sat); + ck_assert_msg(check_msg->states[12].state == 216, + "incorrect value for states[12].state, expected 216, is %d", + check_msg->states[12].state); + ck_assert_msg( + (check_msg->states[13].cn0 * 100 - 1862.19995117 * 100) < 0.05, + "incorrect value for states[13].cn0, expected 1862.19995117, is %f", + check_msg->states[13].cn0); + ck_assert_msg(check_msg->states[13].sid.code == 7, + "incorrect value for states[13].sid.code, expected 7, is %d", + check_msg->states[13].sid.code); + ck_assert_msg( + check_msg->states[13].sid.reserved == 34, + "incorrect value for states[13].sid.reserved, expected 34, is %d", + check_msg->states[13].sid.reserved); + ck_assert_msg( + check_msg->states[13].sid.sat == 25477, + "incorrect value for states[13].sid.sat, expected 25477, is %d", + check_msg->states[13].sid.sat); + ck_assert_msg(check_msg->states[13].state == 200, + "incorrect value for states[13].state, expected 200, is %d", + check_msg->states[13].state); + ck_assert_msg( + (check_msg->states[14].cn0 * 100 - 5462.20019531 * 100) < 0.05, + "incorrect value for states[14].cn0, expected 5462.20019531, is %f", + check_msg->states[14].cn0); + ck_assert_msg( + check_msg->states[14].sid.code == 135, + "incorrect value for states[14].sid.code, expected 135, is %d", + check_msg->states[14].sid.code); + ck_assert_msg( + check_msg->states[14].sid.reserved == 46, + "incorrect value for states[14].sid.reserved, expected 46, is %d", + check_msg->states[14].sid.reserved); + ck_assert_msg( + check_msg->states[14].sid.sat == 21803, + "incorrect value for states[14].sid.sat, expected 21803, is %d", + check_msg->states[14].sid.sat); + ck_assert_msg(check_msg->states[14].state == 155, + "incorrect value for states[14].state, expected 155, is %d", + check_msg->states[14].state); + ck_assert_msg( + (check_msg->states[15].cn0 * 100 - 7454.20019531 * 100) < 0.05, + "incorrect value for states[15].cn0, expected 7454.20019531, is %f", + check_msg->states[15].cn0); + ck_assert_msg( + check_msg->states[15].sid.code == 171, + "incorrect value for states[15].sid.code, expected 171, is %d", + check_msg->states[15].sid.code); + ck_assert_msg( + check_msg->states[15].sid.reserved == 201, + "incorrect value for states[15].sid.reserved, expected 201, is %d", + check_msg->states[15].sid.reserved); + ck_assert_msg( + check_msg->states[15].sid.sat == 21251, + "incorrect value for states[15].sid.sat, expected 21251, is %d", + check_msg->states[15].sid.sat); + ck_assert_msg(check_msg->states[15].state == 155, + "incorrect value for states[15].state, expected 155, is %d", + check_msg->states[15].state); + ck_assert_msg( + (check_msg->states[16].cn0 * 100 - 7134.20019531 * 100) < 0.05, + "incorrect value for states[16].cn0, expected 7134.20019531, is %f", + check_msg->states[16].cn0); + ck_assert_msg(check_msg->states[16].sid.code == 16, + "incorrect value for states[16].sid.code, expected 16, is %d", + check_msg->states[16].sid.code); + ck_assert_msg( + check_msg->states[16].sid.reserved == 19, + "incorrect value for states[16].sid.reserved, expected 19, is %d", + check_msg->states[16].sid.reserved); + ck_assert_msg( + check_msg->states[16].sid.sat == 50475, + "incorrect value for states[16].sid.sat, expected 50475, is %d", + check_msg->states[16].sid.sat); + ck_assert_msg(check_msg->states[16].state == 121, + "incorrect value for states[16].state, expected 121, is %d", + check_msg->states[16].state); + ck_assert_msg( + (check_msg->states[17].cn0 * 100 - 3111.19995117 * 100) < 0.05, + "incorrect value for states[17].cn0, expected 3111.19995117, is %f", + check_msg->states[17].cn0); + ck_assert_msg(check_msg->states[17].sid.code == 63, + "incorrect value for states[17].sid.code, expected 63, is %d", + check_msg->states[17].sid.code); + ck_assert_msg( + check_msg->states[17].sid.reserved == 176, + "incorrect value for states[17].sid.reserved, expected 176, is %d", + check_msg->states[17].sid.reserved); + ck_assert_msg( + check_msg->states[17].sid.sat == 13813, + "incorrect value for states[17].sid.sat, expected 13813, is %d", + check_msg->states[17].sid.sat); + ck_assert_msg(check_msg->states[17].state == 128, + "incorrect value for states[17].state, expected 128, is %d", + check_msg->states[17].state); + ck_assert_msg( + (check_msg->states[18].cn0 * 100 - 4297.20019531 * 100) < 0.05, + "incorrect value for states[18].cn0, expected 4297.20019531, is %f", + check_msg->states[18].cn0); + ck_assert_msg( + check_msg->states[18].sid.code == 153, + "incorrect value for states[18].sid.code, expected 153, is %d", + check_msg->states[18].sid.code); + ck_assert_msg( + check_msg->states[18].sid.reserved == 51, + "incorrect value for states[18].sid.reserved, expected 51, is %d", + check_msg->states[18].sid.reserved); + ck_assert_msg( + check_msg->states[18].sid.sat == 15636, + "incorrect value for states[18].sid.sat, expected 15636, is %d", + check_msg->states[18].sid.sat); + ck_assert_msg(check_msg->states[18].state == 36, + "incorrect value for states[18].state, expected 36, is %d", + check_msg->states[18].state); + ck_assert_msg( + (check_msg->states[19].cn0 * 100 - 2649.19995117 * 100) < 0.05, + "incorrect value for states[19].cn0, expected 2649.19995117, is %f", + check_msg->states[19].cn0); + ck_assert_msg( + check_msg->states[19].sid.code == 140, + "incorrect value for states[19].sid.code, expected 140, is %d", + check_msg->states[19].sid.code); + ck_assert_msg( + check_msg->states[19].sid.reserved == 22, + "incorrect value for states[19].sid.reserved, expected 22, is %d", + check_msg->states[19].sid.reserved); + ck_assert_msg( + check_msg->states[19].sid.sat == 29778, + "incorrect value for states[19].sid.sat, expected 29778, is %d", + check_msg->states[19].sid.sat); + ck_assert_msg(check_msg->states[19].state == 46, + "incorrect value for states[19].state, expected 46, is %d", + check_msg->states[19].state); + ck_assert_msg( + (check_msg->states[20].cn0 * 100 - 941.200012207 * 100) < 0.05, + "incorrect value for states[20].cn0, expected 941.200012207, is %f", + check_msg->states[20].cn0); + ck_assert_msg(check_msg->states[20].sid.code == 96, + "incorrect value for states[20].sid.code, expected 96, is %d", + check_msg->states[20].sid.code); + ck_assert_msg( + check_msg->states[20].sid.reserved == 143, + "incorrect value for states[20].sid.reserved, expected 143, is %d", + check_msg->states[20].sid.reserved); + ck_assert_msg( + check_msg->states[20].sid.sat == 37443, + "incorrect value for states[20].sid.sat, expected 37443, is %d", + check_msg->states[20].sid.sat); + ck_assert_msg(check_msg->states[20].state == 177, + "incorrect value for states[20].state, expected 177, is %d", + check_msg->states[20].state); + ck_assert_msg( + (check_msg->states[21].cn0 * 100 - 1539.19995117 * 100) < 0.05, + "incorrect value for states[21].cn0, expected 1539.19995117, is %f", + check_msg->states[21].cn0); + ck_assert_msg( + check_msg->states[21].sid.code == 201, + "incorrect value for states[21].sid.code, expected 201, is %d", + check_msg->states[21].sid.code); + ck_assert_msg( + check_msg->states[21].sid.reserved == 251, + "incorrect value for states[21].sid.reserved, expected 251, is %d", + check_msg->states[21].sid.reserved); + ck_assert_msg( + check_msg->states[21].sid.sat == 41011, + "incorrect value for states[21].sid.sat, expected 41011, is %d", + check_msg->states[21].sid.sat); + ck_assert_msg(check_msg->states[21].state == 220, + "incorrect value for states[21].state, expected 220, is %d", + check_msg->states[21].state); + ck_assert_msg( + (check_msg->states[22].cn0 * 100 - 1443.19995117 * 100) < 0.05, + "incorrect value for states[22].cn0, expected 1443.19995117, is %f", + check_msg->states[22].cn0); + ck_assert_msg( + check_msg->states[22].sid.code == 161, + "incorrect value for states[22].sid.code, expected 161, is %d", + check_msg->states[22].sid.code); + ck_assert_msg( + check_msg->states[22].sid.reserved == 220, + "incorrect value for states[22].sid.reserved, expected 220, is %d", + check_msg->states[22].sid.reserved); + ck_assert_msg(check_msg->states[22].sid.sat == 706, + "incorrect value for states[22].sid.sat, expected 706, is %d", + check_msg->states[22].sid.sat); + ck_assert_msg(check_msg->states[22].state == 168, + "incorrect value for states[22].state, expected 168, is %d", + check_msg->states[22].state); + ck_assert_msg( + (check_msg->states[23].cn0 * 100 - 1074.19995117 * 100) < 0.05, + "incorrect value for states[23].cn0, expected 1074.19995117, is %f", + check_msg->states[23].cn0); + ck_assert_msg( + check_msg->states[23].sid.code == 125, + "incorrect value for states[23].sid.code, expected 125, is %d", + check_msg->states[23].sid.code); + ck_assert_msg( + check_msg->states[23].sid.reserved == 178, + "incorrect value for states[23].sid.reserved, expected 178, is %d", + check_msg->states[23].sid.reserved); + ck_assert_msg( + check_msg->states[23].sid.sat == 2312, + "incorrect value for states[23].sid.sat, expected 2312, is %d", + check_msg->states[23].sid.sat); + ck_assert_msg(check_msg->states[23].state == 69, + "incorrect value for states[23].state, expected 69, is %d", + check_msg->states[23].state); + ck_assert_msg( + (check_msg->states[24].cn0 * 100 - 2122.19995117 * 100) < 0.05, + "incorrect value for states[24].cn0, expected 2122.19995117, is %f", + check_msg->states[24].cn0); + ck_assert_msg( + check_msg->states[24].sid.code == 186, + "incorrect value for states[24].sid.code, expected 186, is %d", + check_msg->states[24].sid.code); + ck_assert_msg( + check_msg->states[24].sid.reserved == 171, + "incorrect value for states[24].sid.reserved, expected 171, is %d", + check_msg->states[24].sid.reserved); + ck_assert_msg( + check_msg->states[24].sid.sat == 34580, + "incorrect value for states[24].sid.sat, expected 34580, is %d", + check_msg->states[24].sid.sat); + ck_assert_msg(check_msg->states[24].state == 185, + "incorrect value for states[24].state, expected 185, is %d", + check_msg->states[24].state); + ck_assert_msg( + (check_msg->states[25].cn0 * 100 - 9076.20019531 * 100) < 0.05, + "incorrect value for states[25].cn0, expected 9076.20019531, is %f", + check_msg->states[25].cn0); + ck_assert_msg(check_msg->states[25].sid.code == 85, + "incorrect value for states[25].sid.code, expected 85, is %d", + check_msg->states[25].sid.code); + ck_assert_msg( + check_msg->states[25].sid.reserved == 170, + "incorrect value for states[25].sid.reserved, expected 170, is %d", + check_msg->states[25].sid.reserved); + ck_assert_msg( + check_msg->states[25].sid.sat == 39804, + "incorrect value for states[25].sid.sat, expected 39804, is %d", + check_msg->states[25].sid.sat); + ck_assert_msg(check_msg->states[25].state == 18, + "incorrect value for states[25].state, expected 18, is %d", + check_msg->states[25].state); + ck_assert_msg( + (check_msg->states[26].cn0 * 100 - 4781.20019531 * 100) < 0.05, + "incorrect value for states[26].cn0, expected 4781.20019531, is %f", + check_msg->states[26].cn0); + ck_assert_msg( + check_msg->states[26].sid.code == 255, + "incorrect value for states[26].sid.code, expected 255, is %d", + check_msg->states[26].sid.code); + ck_assert_msg( + check_msg->states[26].sid.reserved == 186, + "incorrect value for states[26].sid.reserved, expected 186, is %d", + check_msg->states[26].sid.reserved); + ck_assert_msg( + check_msg->states[26].sid.sat == 52980, + "incorrect value for states[26].sid.sat, expected 52980, is %d", + check_msg->states[26].sid.sat); + ck_assert_msg(check_msg->states[26].state == 57, + "incorrect value for states[26].state, expected 57, is %d", + check_msg->states[26].state); + ck_assert_msg( + (check_msg->states[27].cn0 * 100 - 3076.19995117 * 100) < 0.05, + "incorrect value for states[27].cn0, expected 3076.19995117, is %f", + check_msg->states[27].cn0); + ck_assert_msg( + check_msg->states[27].sid.code == 181, + "incorrect value for states[27].sid.code, expected 181, is %d", + check_msg->states[27].sid.code); + ck_assert_msg( + check_msg->states[27].sid.reserved == 175, + "incorrect value for states[27].sid.reserved, expected 175, is %d", + check_msg->states[27].sid.reserved); + ck_assert_msg( + check_msg->states[27].sid.sat == 24007, + "incorrect value for states[27].sid.sat, expected 24007, is %d", + check_msg->states[27].sid.sat); + ck_assert_msg(check_msg->states[27].state == 165, + "incorrect value for states[27].state, expected 165, is %d", + check_msg->states[27].state); } } END_TEST -Suite* legacy_auto_check_sbp_tracking_MsgTrackingStateDepB_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_tracking_MsgTrackingStateDepB"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB); +Suite *legacy_auto_check_sbp_tracking_MsgTrackingStateDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_tracking_MsgTrackingStateDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.c b/c/test/legacy/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.c index d6297338a..e01a2cb0e 100644 --- a/c/test/legacy/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.c +++ b/c/test/legacy/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDep.yaml +// by generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) -{ +START_TEST(test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,25 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x11, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x11, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x11, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x11, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,17,0,59,103,55,163,151,112,215,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,5,0,0,169,177,208,54,15,0,0,0,85,61,0,0,39,0,1,0,0,0,0,0,0,0,40,0,108,1,0,11,0,0,9,166,214, }; + u8 encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 163, 151, 112, 215, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 5, 0, 0, 169, 177, + 208, 54, 15, 0, 0, 0, 85, 61, 0, 0, 39, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 108, 1, 0, 11, 0, 0, 9, 166, 214, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_state_detailed_dep_t* test_msg = ( msg_tracking_state_detailed_dep_t* )test_msg_storage; + msg_tracking_state_detailed_dep_t* test_msg = + (msg_tracking_state_detailed_dep_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->L.f = 169; test_msg->L.i = 1319; @@ -168,84 +173,141 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) test_msg->tow_flags = 0; test_msg->track_flags = 11; test_msg->uptime = 1; - sbp_payload_send(&sbp_state, 0x11, 26427, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x11, 26427, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 26427, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 26427, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x11, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_state_detailed_dep_t* check_msg = ( msg_tracking_state_detailed_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_state_detailed_dep_t* check_msg = + (msg_tracking_state_detailed_dep_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->L.f == 169, "incorrect value for L.f, expected 169, is %d", check_msg->L.f); - ck_assert_msg(check_msg->L.i == 1319, "incorrect value for L.i, expected 1319, is %d", check_msg->L.i); - ck_assert_msg(check_msg->P == 0, "incorrect value for P, expected 0, is %d", check_msg->P); - ck_assert_msg(check_msg->P_std == 0, "incorrect value for P_std, expected 0, is %d", check_msg->P_std); - ck_assert_msg(check_msg->acceleration == 108, "incorrect value for acceleration, expected 108, is %d", check_msg->acceleration); - ck_assert_msg(check_msg->clock_drift == 0, "incorrect value for clock_drift, expected 0, is %d", check_msg->clock_drift); - ck_assert_msg(check_msg->clock_offset == 0, "incorrect value for clock_offset, expected 0, is %d", check_msg->clock_offset); - ck_assert_msg(check_msg->cn0 == 177, "incorrect value for cn0, expected 177, is %d", check_msg->cn0); - ck_assert_msg(check_msg->corr_spacing == 40, "incorrect value for corr_spacing, expected 40, is %d", check_msg->corr_spacing); - ck_assert_msg(check_msg->doppler == 15701, "incorrect value for doppler, expected 15701, is %d", check_msg->doppler); - ck_assert_msg(check_msg->doppler_std == 39, "incorrect value for doppler_std, expected 39, is %d", check_msg->doppler_std); - ck_assert_msg(check_msg->lock == 14032, "incorrect value for lock, expected 14032, is %d", check_msg->lock); - ck_assert_msg(check_msg->misc_flags == 9, "incorrect value for misc_flags, expected 9, is %d", check_msg->misc_flags); - ck_assert_msg(check_msg->nav_flags == 0, "incorrect value for nav_flags, expected 0, is %d", check_msg->nav_flags); - ck_assert_msg(check_msg->pset_flags == 0, "incorrect value for pset_flags, expected 0, is %d", check_msg->pset_flags); - ck_assert_msg(check_msg->recv_time == 7909447587, "incorrect value for recv_time, expected 7909447587, is %d", check_msg->recv_time); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 15, "incorrect value for sid.sat, expected 15, is %d", check_msg->sid.sat); - ck_assert_msg(check_msg->sync_flags == 1, "incorrect value for sync_flags, expected 1, is %d", check_msg->sync_flags); - ck_assert_msg(check_msg->tot.tow == 0, "incorrect value for tot.tow, expected 0, is %d", check_msg->tot.tow); - ck_assert_msg(check_msg->tot.wn == 0, "incorrect value for tot.wn, expected 0, is %d", check_msg->tot.wn); - ck_assert_msg(check_msg->tow_flags == 0, "incorrect value for tow_flags, expected 0, is %d", check_msg->tow_flags); - ck_assert_msg(check_msg->track_flags == 11, "incorrect value for track_flags, expected 11, is %d", check_msg->track_flags); - ck_assert_msg(check_msg->uptime == 1, "incorrect value for uptime, expected 1, is %d", check_msg->uptime); + ck_assert_msg(check_msg->L.f == 169, + "incorrect value for L.f, expected 169, is %d", + check_msg->L.f); + ck_assert_msg(check_msg->L.i == 1319, + "incorrect value for L.i, expected 1319, is %d", + check_msg->L.i); + ck_assert_msg(check_msg->P == 0, "incorrect value for P, expected 0, is %d", + check_msg->P); + ck_assert_msg(check_msg->P_std == 0, + "incorrect value for P_std, expected 0, is %d", + check_msg->P_std); + ck_assert_msg(check_msg->acceleration == 108, + "incorrect value for acceleration, expected 108, is %d", + check_msg->acceleration); + ck_assert_msg(check_msg->clock_drift == 0, + "incorrect value for clock_drift, expected 0, is %d", + check_msg->clock_drift); + ck_assert_msg(check_msg->clock_offset == 0, + "incorrect value for clock_offset, expected 0, is %d", + check_msg->clock_offset); + ck_assert_msg(check_msg->cn0 == 177, + "incorrect value for cn0, expected 177, is %d", + check_msg->cn0); + ck_assert_msg(check_msg->corr_spacing == 40, + "incorrect value for corr_spacing, expected 40, is %d", + check_msg->corr_spacing); + ck_assert_msg(check_msg->doppler == 15701, + "incorrect value for doppler, expected 15701, is %d", + check_msg->doppler); + ck_assert_msg(check_msg->doppler_std == 39, + "incorrect value for doppler_std, expected 39, is %d", + check_msg->doppler_std); + ck_assert_msg(check_msg->lock == 14032, + "incorrect value for lock, expected 14032, is %d", + check_msg->lock); + ck_assert_msg(check_msg->misc_flags == 9, + "incorrect value for misc_flags, expected 9, is %d", + check_msg->misc_flags); + ck_assert_msg(check_msg->nav_flags == 0, + "incorrect value for nav_flags, expected 0, is %d", + check_msg->nav_flags); + ck_assert_msg(check_msg->pset_flags == 0, + "incorrect value for pset_flags, expected 0, is %d", + check_msg->pset_flags); + ck_assert_msg(check_msg->recv_time == 7909447587, + "incorrect value for recv_time, expected 7909447587, is %d", + check_msg->recv_time); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 15, + "incorrect value for sid.sat, expected 15, is %d", + check_msg->sid.sat); + ck_assert_msg(check_msg->sync_flags == 1, + "incorrect value for sync_flags, expected 1, is %d", + check_msg->sync_flags); + ck_assert_msg(check_msg->tot.tow == 0, + "incorrect value for tot.tow, expected 0, is %d", + check_msg->tot.tow); + ck_assert_msg(check_msg->tot.wn == 0, + "incorrect value for tot.wn, expected 0, is %d", + check_msg->tot.wn); + ck_assert_msg(check_msg->tow_flags == 0, + "incorrect value for tow_flags, expected 0, is %d", + check_msg->tow_flags); + ck_assert_msg(check_msg->track_flags == 11, + "incorrect value for track_flags, expected 11, is %d", + check_msg->track_flags); + ck_assert_msg(check_msg->uptime == 1, + "incorrect value for uptime, expected 1, is %d", + check_msg->uptime); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -253,17 +315,25 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x11, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x11, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x11, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x11, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,17,0,59,103,55,97,251,61,245,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,7,0,0,14,175,208,54,15,0,0,0,51,61,0,0,30,0,1,0,0,0,0,0,0,0,40,0,224,1,0,11,0,0,9,136,179, }; + u8 encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 97, 251, 61, 245, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 7, 0, 0, 14, 175, + 208, 54, 15, 0, 0, 0, 51, 61, 0, 0, 30, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 224, 1, 0, 11, 0, 0, 9, 136, 179, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_state_detailed_dep_t* test_msg = ( msg_tracking_state_detailed_dep_t* )test_msg_storage; + msg_tracking_state_detailed_dep_t* test_msg = + (msg_tracking_state_detailed_dep_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->L.f = 14; test_msg->L.i = 1810; @@ -290,84 +360,141 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) test_msg->tow_flags = 0; test_msg->track_flags = 11; test_msg->uptime = 1; - sbp_payload_send(&sbp_state, 0x11, 26427, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x11, 26427, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 26427, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 26427, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x11, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_state_detailed_dep_t* check_msg = ( msg_tracking_state_detailed_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_state_detailed_dep_t* check_msg = + (msg_tracking_state_detailed_dep_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->L.f == 14, "incorrect value for L.f, expected 14, is %d", check_msg->L.f); - ck_assert_msg(check_msg->L.i == 1810, "incorrect value for L.i, expected 1810, is %d", check_msg->L.i); - ck_assert_msg(check_msg->P == 0, "incorrect value for P, expected 0, is %d", check_msg->P); - ck_assert_msg(check_msg->P_std == 0, "incorrect value for P_std, expected 0, is %d", check_msg->P_std); - ck_assert_msg(check_msg->acceleration == -32, "incorrect value for acceleration, expected -32, is %d", check_msg->acceleration); - ck_assert_msg(check_msg->clock_drift == 0, "incorrect value for clock_drift, expected 0, is %d", check_msg->clock_drift); - ck_assert_msg(check_msg->clock_offset == 0, "incorrect value for clock_offset, expected 0, is %d", check_msg->clock_offset); - ck_assert_msg(check_msg->cn0 == 175, "incorrect value for cn0, expected 175, is %d", check_msg->cn0); - ck_assert_msg(check_msg->corr_spacing == 40, "incorrect value for corr_spacing, expected 40, is %d", check_msg->corr_spacing); - ck_assert_msg(check_msg->doppler == 15667, "incorrect value for doppler, expected 15667, is %d", check_msg->doppler); - ck_assert_msg(check_msg->doppler_std == 30, "incorrect value for doppler_std, expected 30, is %d", check_msg->doppler_std); - ck_assert_msg(check_msg->lock == 14032, "incorrect value for lock, expected 14032, is %d", check_msg->lock); - ck_assert_msg(check_msg->misc_flags == 9, "incorrect value for misc_flags, expected 9, is %d", check_msg->misc_flags); - ck_assert_msg(check_msg->nav_flags == 0, "incorrect value for nav_flags, expected 0, is %d", check_msg->nav_flags); - ck_assert_msg(check_msg->pset_flags == 0, "incorrect value for pset_flags, expected 0, is %d", check_msg->pset_flags); - ck_assert_msg(check_msg->recv_time == 8409447265, "incorrect value for recv_time, expected 8409447265, is %d", check_msg->recv_time); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 15, "incorrect value for sid.sat, expected 15, is %d", check_msg->sid.sat); - ck_assert_msg(check_msg->sync_flags == 1, "incorrect value for sync_flags, expected 1, is %d", check_msg->sync_flags); - ck_assert_msg(check_msg->tot.tow == 0, "incorrect value for tot.tow, expected 0, is %d", check_msg->tot.tow); - ck_assert_msg(check_msg->tot.wn == 0, "incorrect value for tot.wn, expected 0, is %d", check_msg->tot.wn); - ck_assert_msg(check_msg->tow_flags == 0, "incorrect value for tow_flags, expected 0, is %d", check_msg->tow_flags); - ck_assert_msg(check_msg->track_flags == 11, "incorrect value for track_flags, expected 11, is %d", check_msg->track_flags); - ck_assert_msg(check_msg->uptime == 1, "incorrect value for uptime, expected 1, is %d", check_msg->uptime); + ck_assert_msg(check_msg->L.f == 14, + "incorrect value for L.f, expected 14, is %d", + check_msg->L.f); + ck_assert_msg(check_msg->L.i == 1810, + "incorrect value for L.i, expected 1810, is %d", + check_msg->L.i); + ck_assert_msg(check_msg->P == 0, "incorrect value for P, expected 0, is %d", + check_msg->P); + ck_assert_msg(check_msg->P_std == 0, + "incorrect value for P_std, expected 0, is %d", + check_msg->P_std); + ck_assert_msg(check_msg->acceleration == -32, + "incorrect value for acceleration, expected -32, is %d", + check_msg->acceleration); + ck_assert_msg(check_msg->clock_drift == 0, + "incorrect value for clock_drift, expected 0, is %d", + check_msg->clock_drift); + ck_assert_msg(check_msg->clock_offset == 0, + "incorrect value for clock_offset, expected 0, is %d", + check_msg->clock_offset); + ck_assert_msg(check_msg->cn0 == 175, + "incorrect value for cn0, expected 175, is %d", + check_msg->cn0); + ck_assert_msg(check_msg->corr_spacing == 40, + "incorrect value for corr_spacing, expected 40, is %d", + check_msg->corr_spacing); + ck_assert_msg(check_msg->doppler == 15667, + "incorrect value for doppler, expected 15667, is %d", + check_msg->doppler); + ck_assert_msg(check_msg->doppler_std == 30, + "incorrect value for doppler_std, expected 30, is %d", + check_msg->doppler_std); + ck_assert_msg(check_msg->lock == 14032, + "incorrect value for lock, expected 14032, is %d", + check_msg->lock); + ck_assert_msg(check_msg->misc_flags == 9, + "incorrect value for misc_flags, expected 9, is %d", + check_msg->misc_flags); + ck_assert_msg(check_msg->nav_flags == 0, + "incorrect value for nav_flags, expected 0, is %d", + check_msg->nav_flags); + ck_assert_msg(check_msg->pset_flags == 0, + "incorrect value for pset_flags, expected 0, is %d", + check_msg->pset_flags); + ck_assert_msg(check_msg->recv_time == 8409447265, + "incorrect value for recv_time, expected 8409447265, is %d", + check_msg->recv_time); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 15, + "incorrect value for sid.sat, expected 15, is %d", + check_msg->sid.sat); + ck_assert_msg(check_msg->sync_flags == 1, + "incorrect value for sync_flags, expected 1, is %d", + check_msg->sync_flags); + ck_assert_msg(check_msg->tot.tow == 0, + "incorrect value for tot.tow, expected 0, is %d", + check_msg->tot.tow); + ck_assert_msg(check_msg->tot.wn == 0, + "incorrect value for tot.wn, expected 0, is %d", + check_msg->tot.wn); + ck_assert_msg(check_msg->tow_flags == 0, + "incorrect value for tow_flags, expected 0, is %d", + check_msg->tow_flags); + ck_assert_msg(check_msg->track_flags == 11, + "incorrect value for track_flags, expected 11, is %d", + check_msg->track_flags); + ck_assert_msg(check_msg->uptime == 1, + "incorrect value for uptime, expected 1, is %d", + check_msg->uptime); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -375,17 +502,25 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x11, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x11, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x11, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x11, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,17,0,59,103,55,139,218,236,18,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,8,0,0,8,179,208,54,15,0,0,0,67,61,0,0,22,0,2,0,0,0,0,0,0,0,40,0,27,1,0,11,0,2,9,217,159, }; + u8 encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 139, 218, 236, 18, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 8, 0, 0, 8, 179, + 208, 54, 15, 0, 0, 0, 67, 61, 0, 0, 22, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 27, 1, 0, 11, 0, 2, 9, 217, 159, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_state_detailed_dep_t* test_msg = ( msg_tracking_state_detailed_dep_t* )test_msg_storage; + msg_tracking_state_detailed_dep_t* test_msg = + (msg_tracking_state_detailed_dep_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->L.f = 8; test_msg->L.i = 2298; @@ -412,84 +547,140 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) test_msg->tow_flags = 0; test_msg->track_flags = 11; test_msg->uptime = 2; - sbp_payload_send(&sbp_state, 0x11, 26427, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x11, 26427, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 26427, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 26427, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x11, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_state_detailed_dep_t* check_msg = ( msg_tracking_state_detailed_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_state_detailed_dep_t* check_msg = + (msg_tracking_state_detailed_dep_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->L.f == 8, "incorrect value for L.f, expected 8, is %d", check_msg->L.f); - ck_assert_msg(check_msg->L.i == 2298, "incorrect value for L.i, expected 2298, is %d", check_msg->L.i); - ck_assert_msg(check_msg->P == 0, "incorrect value for P, expected 0, is %d", check_msg->P); - ck_assert_msg(check_msg->P_std == 0, "incorrect value for P_std, expected 0, is %d", check_msg->P_std); - ck_assert_msg(check_msg->acceleration == 27, "incorrect value for acceleration, expected 27, is %d", check_msg->acceleration); - ck_assert_msg(check_msg->clock_drift == 0, "incorrect value for clock_drift, expected 0, is %d", check_msg->clock_drift); - ck_assert_msg(check_msg->clock_offset == 0, "incorrect value for clock_offset, expected 0, is %d", check_msg->clock_offset); - ck_assert_msg(check_msg->cn0 == 179, "incorrect value for cn0, expected 179, is %d", check_msg->cn0); - ck_assert_msg(check_msg->corr_spacing == 40, "incorrect value for corr_spacing, expected 40, is %d", check_msg->corr_spacing); - ck_assert_msg(check_msg->doppler == 15683, "incorrect value for doppler, expected 15683, is %d", check_msg->doppler); - ck_assert_msg(check_msg->doppler_std == 22, "incorrect value for doppler_std, expected 22, is %d", check_msg->doppler_std); - ck_assert_msg(check_msg->lock == 14032, "incorrect value for lock, expected 14032, is %d", check_msg->lock); - ck_assert_msg(check_msg->misc_flags == 9, "incorrect value for misc_flags, expected 9, is %d", check_msg->misc_flags); - ck_assert_msg(check_msg->nav_flags == 0, "incorrect value for nav_flags, expected 0, is %d", check_msg->nav_flags); - ck_assert_msg(check_msg->pset_flags == 2, "incorrect value for pset_flags, expected 2, is %d", check_msg->pset_flags); - ck_assert_msg(check_msg->recv_time == 8907446923, "incorrect value for recv_time, expected 8907446923, is %d", check_msg->recv_time); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 15, "incorrect value for sid.sat, expected 15, is %d", check_msg->sid.sat); - ck_assert_msg(check_msg->sync_flags == 1, "incorrect value for sync_flags, expected 1, is %d", check_msg->sync_flags); - ck_assert_msg(check_msg->tot.tow == 0, "incorrect value for tot.tow, expected 0, is %d", check_msg->tot.tow); - ck_assert_msg(check_msg->tot.wn == 0, "incorrect value for tot.wn, expected 0, is %d", check_msg->tot.wn); - ck_assert_msg(check_msg->tow_flags == 0, "incorrect value for tow_flags, expected 0, is %d", check_msg->tow_flags); - ck_assert_msg(check_msg->track_flags == 11, "incorrect value for track_flags, expected 11, is %d", check_msg->track_flags); - ck_assert_msg(check_msg->uptime == 2, "incorrect value for uptime, expected 2, is %d", check_msg->uptime); + ck_assert_msg(check_msg->L.f == 8, + "incorrect value for L.f, expected 8, is %d", check_msg->L.f); + ck_assert_msg(check_msg->L.i == 2298, + "incorrect value for L.i, expected 2298, is %d", + check_msg->L.i); + ck_assert_msg(check_msg->P == 0, "incorrect value for P, expected 0, is %d", + check_msg->P); + ck_assert_msg(check_msg->P_std == 0, + "incorrect value for P_std, expected 0, is %d", + check_msg->P_std); + ck_assert_msg(check_msg->acceleration == 27, + "incorrect value for acceleration, expected 27, is %d", + check_msg->acceleration); + ck_assert_msg(check_msg->clock_drift == 0, + "incorrect value for clock_drift, expected 0, is %d", + check_msg->clock_drift); + ck_assert_msg(check_msg->clock_offset == 0, + "incorrect value for clock_offset, expected 0, is %d", + check_msg->clock_offset); + ck_assert_msg(check_msg->cn0 == 179, + "incorrect value for cn0, expected 179, is %d", + check_msg->cn0); + ck_assert_msg(check_msg->corr_spacing == 40, + "incorrect value for corr_spacing, expected 40, is %d", + check_msg->corr_spacing); + ck_assert_msg(check_msg->doppler == 15683, + "incorrect value for doppler, expected 15683, is %d", + check_msg->doppler); + ck_assert_msg(check_msg->doppler_std == 22, + "incorrect value for doppler_std, expected 22, is %d", + check_msg->doppler_std); + ck_assert_msg(check_msg->lock == 14032, + "incorrect value for lock, expected 14032, is %d", + check_msg->lock); + ck_assert_msg(check_msg->misc_flags == 9, + "incorrect value for misc_flags, expected 9, is %d", + check_msg->misc_flags); + ck_assert_msg(check_msg->nav_flags == 0, + "incorrect value for nav_flags, expected 0, is %d", + check_msg->nav_flags); + ck_assert_msg(check_msg->pset_flags == 2, + "incorrect value for pset_flags, expected 2, is %d", + check_msg->pset_flags); + ck_assert_msg(check_msg->recv_time == 8907446923, + "incorrect value for recv_time, expected 8907446923, is %d", + check_msg->recv_time); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 15, + "incorrect value for sid.sat, expected 15, is %d", + check_msg->sid.sat); + ck_assert_msg(check_msg->sync_flags == 1, + "incorrect value for sync_flags, expected 1, is %d", + check_msg->sync_flags); + ck_assert_msg(check_msg->tot.tow == 0, + "incorrect value for tot.tow, expected 0, is %d", + check_msg->tot.tow); + ck_assert_msg(check_msg->tot.wn == 0, + "incorrect value for tot.wn, expected 0, is %d", + check_msg->tot.wn); + ck_assert_msg(check_msg->tow_flags == 0, + "incorrect value for tow_flags, expected 0, is %d", + check_msg->tow_flags); + ck_assert_msg(check_msg->track_flags == 11, + "incorrect value for track_flags, expected 11, is %d", + check_msg->track_flags); + ck_assert_msg(check_msg->uptime == 2, + "incorrect value for uptime, expected 2, is %d", + check_msg->uptime); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -497,17 +688,25 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x11, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x11, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x11, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x11, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,17,0,59,103,55,255,251,170,48,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,226,10,0,0,125,181,208,54,15,0,0,0,29,61,0,0,10,0,2,0,0,0,0,0,0,0,40,0,220,1,0,11,0,3,9,66,95, }; + u8 encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 255, 251, 170, 48, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 226, 10, 0, 0, 125, 181, + 208, 54, 15, 0, 0, 0, 29, 61, 0, 0, 10, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 220, 1, 0, 11, 0, 3, 9, 66, 95, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_state_detailed_dep_t* test_msg = ( msg_tracking_state_detailed_dep_t* )test_msg_storage; + msg_tracking_state_detailed_dep_t* test_msg = + (msg_tracking_state_detailed_dep_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->L.f = 125; test_msg->L.i = 2786; @@ -534,84 +733,141 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) test_msg->tow_flags = 0; test_msg->track_flags = 11; test_msg->uptime = 2; - sbp_payload_send(&sbp_state, 0x11, 26427, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x11, 26427, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 26427, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 26427, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x11, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_state_detailed_dep_t* check_msg = ( msg_tracking_state_detailed_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_state_detailed_dep_t* check_msg = + (msg_tracking_state_detailed_dep_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->L.f == 125, "incorrect value for L.f, expected 125, is %d", check_msg->L.f); - ck_assert_msg(check_msg->L.i == 2786, "incorrect value for L.i, expected 2786, is %d", check_msg->L.i); - ck_assert_msg(check_msg->P == 0, "incorrect value for P, expected 0, is %d", check_msg->P); - ck_assert_msg(check_msg->P_std == 0, "incorrect value for P_std, expected 0, is %d", check_msg->P_std); - ck_assert_msg(check_msg->acceleration == -36, "incorrect value for acceleration, expected -36, is %d", check_msg->acceleration); - ck_assert_msg(check_msg->clock_drift == 0, "incorrect value for clock_drift, expected 0, is %d", check_msg->clock_drift); - ck_assert_msg(check_msg->clock_offset == 0, "incorrect value for clock_offset, expected 0, is %d", check_msg->clock_offset); - ck_assert_msg(check_msg->cn0 == 181, "incorrect value for cn0, expected 181, is %d", check_msg->cn0); - ck_assert_msg(check_msg->corr_spacing == 40, "incorrect value for corr_spacing, expected 40, is %d", check_msg->corr_spacing); - ck_assert_msg(check_msg->doppler == 15645, "incorrect value for doppler, expected 15645, is %d", check_msg->doppler); - ck_assert_msg(check_msg->doppler_std == 10, "incorrect value for doppler_std, expected 10, is %d", check_msg->doppler_std); - ck_assert_msg(check_msg->lock == 14032, "incorrect value for lock, expected 14032, is %d", check_msg->lock); - ck_assert_msg(check_msg->misc_flags == 9, "incorrect value for misc_flags, expected 9, is %d", check_msg->misc_flags); - ck_assert_msg(check_msg->nav_flags == 0, "incorrect value for nav_flags, expected 0, is %d", check_msg->nav_flags); - ck_assert_msg(check_msg->pset_flags == 3, "incorrect value for pset_flags, expected 3, is %d", check_msg->pset_flags); - ck_assert_msg(check_msg->recv_time == 9406446591, "incorrect value for recv_time, expected 9406446591, is %d", check_msg->recv_time); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 15, "incorrect value for sid.sat, expected 15, is %d", check_msg->sid.sat); - ck_assert_msg(check_msg->sync_flags == 1, "incorrect value for sync_flags, expected 1, is %d", check_msg->sync_flags); - ck_assert_msg(check_msg->tot.tow == 0, "incorrect value for tot.tow, expected 0, is %d", check_msg->tot.tow); - ck_assert_msg(check_msg->tot.wn == 0, "incorrect value for tot.wn, expected 0, is %d", check_msg->tot.wn); - ck_assert_msg(check_msg->tow_flags == 0, "incorrect value for tow_flags, expected 0, is %d", check_msg->tow_flags); - ck_assert_msg(check_msg->track_flags == 11, "incorrect value for track_flags, expected 11, is %d", check_msg->track_flags); - ck_assert_msg(check_msg->uptime == 2, "incorrect value for uptime, expected 2, is %d", check_msg->uptime); + ck_assert_msg(check_msg->L.f == 125, + "incorrect value for L.f, expected 125, is %d", + check_msg->L.f); + ck_assert_msg(check_msg->L.i == 2786, + "incorrect value for L.i, expected 2786, is %d", + check_msg->L.i); + ck_assert_msg(check_msg->P == 0, "incorrect value for P, expected 0, is %d", + check_msg->P); + ck_assert_msg(check_msg->P_std == 0, + "incorrect value for P_std, expected 0, is %d", + check_msg->P_std); + ck_assert_msg(check_msg->acceleration == -36, + "incorrect value for acceleration, expected -36, is %d", + check_msg->acceleration); + ck_assert_msg(check_msg->clock_drift == 0, + "incorrect value for clock_drift, expected 0, is %d", + check_msg->clock_drift); + ck_assert_msg(check_msg->clock_offset == 0, + "incorrect value for clock_offset, expected 0, is %d", + check_msg->clock_offset); + ck_assert_msg(check_msg->cn0 == 181, + "incorrect value for cn0, expected 181, is %d", + check_msg->cn0); + ck_assert_msg(check_msg->corr_spacing == 40, + "incorrect value for corr_spacing, expected 40, is %d", + check_msg->corr_spacing); + ck_assert_msg(check_msg->doppler == 15645, + "incorrect value for doppler, expected 15645, is %d", + check_msg->doppler); + ck_assert_msg(check_msg->doppler_std == 10, + "incorrect value for doppler_std, expected 10, is %d", + check_msg->doppler_std); + ck_assert_msg(check_msg->lock == 14032, + "incorrect value for lock, expected 14032, is %d", + check_msg->lock); + ck_assert_msg(check_msg->misc_flags == 9, + "incorrect value for misc_flags, expected 9, is %d", + check_msg->misc_flags); + ck_assert_msg(check_msg->nav_flags == 0, + "incorrect value for nav_flags, expected 0, is %d", + check_msg->nav_flags); + ck_assert_msg(check_msg->pset_flags == 3, + "incorrect value for pset_flags, expected 3, is %d", + check_msg->pset_flags); + ck_assert_msg(check_msg->recv_time == 9406446591, + "incorrect value for recv_time, expected 9406446591, is %d", + check_msg->recv_time); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 15, + "incorrect value for sid.sat, expected 15, is %d", + check_msg->sid.sat); + ck_assert_msg(check_msg->sync_flags == 1, + "incorrect value for sync_flags, expected 1, is %d", + check_msg->sync_flags); + ck_assert_msg(check_msg->tot.tow == 0, + "incorrect value for tot.tow, expected 0, is %d", + check_msg->tot.tow); + ck_assert_msg(check_msg->tot.wn == 0, + "incorrect value for tot.wn, expected 0, is %d", + check_msg->tot.wn); + ck_assert_msg(check_msg->tow_flags == 0, + "incorrect value for tow_flags, expected 0, is %d", + check_msg->tow_flags); + ck_assert_msg(check_msg->track_flags == 11, + "incorrect value for track_flags, expected 11, is %d", + check_msg->track_flags); + ck_assert_msg(check_msg->uptime == 2, + "incorrect value for uptime, expected 2, is %d", + check_msg->uptime); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -619,17 +875,25 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x11, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x11, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x11, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x11, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,17,0,59,103,55,189,95,120,78,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,12,0,0,64,184,208,54,15,0,0,0,24,61,0,0,4,0,3,0,0,0,0,0,0,0,40,0,2,1,0,11,0,3,9,194,206, }; + u8 encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 189, 95, 120, 78, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 203, 12, 0, 0, 64, 184, + 208, 54, 15, 0, 0, 0, 24, 61, 0, 0, 4, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 2, 1, 0, 11, 0, 3, 9, 194, 206, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_state_detailed_dep_t* test_msg = ( msg_tracking_state_detailed_dep_t* )test_msg_storage; + msg_tracking_state_detailed_dep_t* test_msg = + (msg_tracking_state_detailed_dep_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->L.f = 64; test_msg->L.i = 3275; @@ -656,88 +920,148 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep ) test_msg->tow_flags = 0; test_msg->track_flags = 11; test_msg->uptime = 3; - sbp_payload_send(&sbp_state, 0x11, 26427, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x11, 26427, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 26427, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 26427, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x11, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_state_detailed_dep_t* check_msg = ( msg_tracking_state_detailed_dep_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_state_detailed_dep_t* check_msg = + (msg_tracking_state_detailed_dep_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->L.f == 64, "incorrect value for L.f, expected 64, is %d", check_msg->L.f); - ck_assert_msg(check_msg->L.i == 3275, "incorrect value for L.i, expected 3275, is %d", check_msg->L.i); - ck_assert_msg(check_msg->P == 0, "incorrect value for P, expected 0, is %d", check_msg->P); - ck_assert_msg(check_msg->P_std == 0, "incorrect value for P_std, expected 0, is %d", check_msg->P_std); - ck_assert_msg(check_msg->acceleration == 2, "incorrect value for acceleration, expected 2, is %d", check_msg->acceleration); - ck_assert_msg(check_msg->clock_drift == 0, "incorrect value for clock_drift, expected 0, is %d", check_msg->clock_drift); - ck_assert_msg(check_msg->clock_offset == 0, "incorrect value for clock_offset, expected 0, is %d", check_msg->clock_offset); - ck_assert_msg(check_msg->cn0 == 184, "incorrect value for cn0, expected 184, is %d", check_msg->cn0); - ck_assert_msg(check_msg->corr_spacing == 40, "incorrect value for corr_spacing, expected 40, is %d", check_msg->corr_spacing); - ck_assert_msg(check_msg->doppler == 15640, "incorrect value for doppler, expected 15640, is %d", check_msg->doppler); - ck_assert_msg(check_msg->doppler_std == 4, "incorrect value for doppler_std, expected 4, is %d", check_msg->doppler_std); - ck_assert_msg(check_msg->lock == 14032, "incorrect value for lock, expected 14032, is %d", check_msg->lock); - ck_assert_msg(check_msg->misc_flags == 9, "incorrect value for misc_flags, expected 9, is %d", check_msg->misc_flags); - ck_assert_msg(check_msg->nav_flags == 0, "incorrect value for nav_flags, expected 0, is %d", check_msg->nav_flags); - ck_assert_msg(check_msg->pset_flags == 3, "incorrect value for pset_flags, expected 3, is %d", check_msg->pset_flags); - ck_assert_msg(check_msg->recv_time == 9906446269, "incorrect value for recv_time, expected 9906446269, is %d", check_msg->recv_time); - ck_assert_msg(check_msg->sid.code == 0, "incorrect value for sid.code, expected 0, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.reserved == 0, "incorrect value for sid.reserved, expected 0, is %d", check_msg->sid.reserved); - ck_assert_msg(check_msg->sid.sat == 15, "incorrect value for sid.sat, expected 15, is %d", check_msg->sid.sat); - ck_assert_msg(check_msg->sync_flags == 1, "incorrect value for sync_flags, expected 1, is %d", check_msg->sync_flags); - ck_assert_msg(check_msg->tot.tow == 0, "incorrect value for tot.tow, expected 0, is %d", check_msg->tot.tow); - ck_assert_msg(check_msg->tot.wn == 0, "incorrect value for tot.wn, expected 0, is %d", check_msg->tot.wn); - ck_assert_msg(check_msg->tow_flags == 0, "incorrect value for tow_flags, expected 0, is %d", check_msg->tow_flags); - ck_assert_msg(check_msg->track_flags == 11, "incorrect value for track_flags, expected 11, is %d", check_msg->track_flags); - ck_assert_msg(check_msg->uptime == 3, "incorrect value for uptime, expected 3, is %d", check_msg->uptime); + ck_assert_msg(check_msg->L.f == 64, + "incorrect value for L.f, expected 64, is %d", + check_msg->L.f); + ck_assert_msg(check_msg->L.i == 3275, + "incorrect value for L.i, expected 3275, is %d", + check_msg->L.i); + ck_assert_msg(check_msg->P == 0, "incorrect value for P, expected 0, is %d", + check_msg->P); + ck_assert_msg(check_msg->P_std == 0, + "incorrect value for P_std, expected 0, is %d", + check_msg->P_std); + ck_assert_msg(check_msg->acceleration == 2, + "incorrect value for acceleration, expected 2, is %d", + check_msg->acceleration); + ck_assert_msg(check_msg->clock_drift == 0, + "incorrect value for clock_drift, expected 0, is %d", + check_msg->clock_drift); + ck_assert_msg(check_msg->clock_offset == 0, + "incorrect value for clock_offset, expected 0, is %d", + check_msg->clock_offset); + ck_assert_msg(check_msg->cn0 == 184, + "incorrect value for cn0, expected 184, is %d", + check_msg->cn0); + ck_assert_msg(check_msg->corr_spacing == 40, + "incorrect value for corr_spacing, expected 40, is %d", + check_msg->corr_spacing); + ck_assert_msg(check_msg->doppler == 15640, + "incorrect value for doppler, expected 15640, is %d", + check_msg->doppler); + ck_assert_msg(check_msg->doppler_std == 4, + "incorrect value for doppler_std, expected 4, is %d", + check_msg->doppler_std); + ck_assert_msg(check_msg->lock == 14032, + "incorrect value for lock, expected 14032, is %d", + check_msg->lock); + ck_assert_msg(check_msg->misc_flags == 9, + "incorrect value for misc_flags, expected 9, is %d", + check_msg->misc_flags); + ck_assert_msg(check_msg->nav_flags == 0, + "incorrect value for nav_flags, expected 0, is %d", + check_msg->nav_flags); + ck_assert_msg(check_msg->pset_flags == 3, + "incorrect value for pset_flags, expected 3, is %d", + check_msg->pset_flags); + ck_assert_msg(check_msg->recv_time == 9906446269, + "incorrect value for recv_time, expected 9906446269, is %d", + check_msg->recv_time); + ck_assert_msg(check_msg->sid.code == 0, + "incorrect value for sid.code, expected 0, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.reserved == 0, + "incorrect value for sid.reserved, expected 0, is %d", + check_msg->sid.reserved); + ck_assert_msg(check_msg->sid.sat == 15, + "incorrect value for sid.sat, expected 15, is %d", + check_msg->sid.sat); + ck_assert_msg(check_msg->sync_flags == 1, + "incorrect value for sync_flags, expected 1, is %d", + check_msg->sync_flags); + ck_assert_msg(check_msg->tot.tow == 0, + "incorrect value for tot.tow, expected 0, is %d", + check_msg->tot.tow); + ck_assert_msg(check_msg->tot.wn == 0, + "incorrect value for tot.wn, expected 0, is %d", + check_msg->tot.wn); + ck_assert_msg(check_msg->tow_flags == 0, + "incorrect value for tow_flags, expected 0, is %d", + check_msg->tow_flags); + ck_assert_msg(check_msg->track_flags == 11, + "incorrect value for track_flags, expected 11, is %d", + check_msg->track_flags); + ck_assert_msg(check_msg->uptime == 3, + "incorrect value for uptime, expected 3, is %d", + check_msg->uptime); } } END_TEST -Suite* legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep); +Suite* legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_tracking_" + "MsgTrackingStateDetailedDep"); + tcase_add_test( + tc_acq, test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.c b/c/test/legacy/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.c index a17e16296..7bc10aaf4 100644 --- a/c/test/legacy/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.c +++ b/c/test/legacy/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDepA.yaml +// by generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,26 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x21, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x21, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x21, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x21, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,33,0,155,110,57,46,31,180,38,219,0,0,0,133,100,71,94,192,2,160,207,212,255,135,139,62,62,179,83,227,245,134,160,204,78,95,255,38,59,161,15,255,86,189,248,31,191,136,194,124,23,15,91,249,117,142,90,219,67,25,83,62,122,100, }; + u8 encoded_frame[] = { + 85, 33, 0, 155, 110, 57, 46, 31, 180, 38, 219, 0, 0, + 0, 133, 100, 71, 94, 192, 2, 160, 207, 212, 255, 135, 139, + 62, 62, 179, 83, 227, 245, 134, 160, 204, 78, 95, 255, 38, + 59, 161, 15, 255, 86, 189, 248, 31, 191, 136, 194, 124, 23, + 15, 91, 249, 117, 142, 90, 219, 67, 25, 83, 62, 122, 100, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_state_detailed_dep_a_t* test_msg = ( msg_tracking_state_detailed_dep_a_t* )test_msg_storage; + msg_tracking_state_detailed_dep_a_t *test_msg = + (msg_tracking_state_detailed_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->L.f = 204; test_msg->L.i = -1601767965; @@ -168,88 +174,150 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA ) test_msg->tow_flags = 219; test_msg->track_flags = 67; test_msg->uptime = 3263741727; - sbp_payload_send(&sbp_state, 0x21, 28315, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x21, 28315, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 28315, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 28315, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x21, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_state_detailed_dep_a_t* check_msg = ( msg_tracking_state_detailed_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_state_detailed_dep_a_t *check_msg = + (msg_tracking_state_detailed_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->L.f == 204, "incorrect value for L.f, expected 204, is %d", check_msg->L.f); - ck_assert_msg(check_msg->L.i == -1601767965, "incorrect value for L.i, expected -1601767965, is %d", check_msg->L.i); - ck_assert_msg(check_msg->P == 1044286343, "incorrect value for P, expected 1044286343, is %d", check_msg->P); - ck_assert_msg(check_msg->P_std == 21427, "incorrect value for P_std, expected 21427, is %d", check_msg->P_std); - ck_assert_msg(check_msg->acceleration == -114, "incorrect value for acceleration, expected -114, is %d", check_msg->acceleration); - ck_assert_msg(check_msg->clock_drift == 23311, "incorrect value for clock_drift, expected 23311, is %d", check_msg->clock_drift); - ck_assert_msg(check_msg->clock_offset == 6012, "incorrect value for clock_offset, expected 6012, is %d", check_msg->clock_offset); - ck_assert_msg(check_msg->cn0 == 78, "incorrect value for cn0, expected 78, is %d", check_msg->cn0); - ck_assert_msg(check_msg->corr_spacing == 30201, "incorrect value for corr_spacing, expected 30201, is %d", check_msg->corr_spacing); - ck_assert_msg(check_msg->doppler == 1459556257, "incorrect value for doppler, expected 1459556257, is %d", check_msg->doppler); - ck_assert_msg(check_msg->doppler_std == 63677, "incorrect value for doppler_std, expected 63677, is %d", check_msg->doppler_std); - ck_assert_msg(check_msg->lock == 65375, "incorrect value for lock, expected 65375, is %d", check_msg->lock); - ck_assert_msg(check_msg->misc_flags == 62, "incorrect value for misc_flags, expected 62, is %d", check_msg->misc_flags); - ck_assert_msg(check_msg->nav_flags == 25, "incorrect value for nav_flags, expected 25, is %d", check_msg->nav_flags); - ck_assert_msg(check_msg->pset_flags == 83, "incorrect value for pset_flags, expected 83, is %d", check_msg->pset_flags); - ck_assert_msg(check_msg->recv_time == 941247176494, "incorrect value for recv_time, expected 941247176494, is %d", check_msg->recv_time); - ck_assert_msg(check_msg->sid.code == 59, "incorrect value for sid.code, expected 59, is %d", check_msg->sid.code); - ck_assert_msg(check_msg->sid.sat == 38, "incorrect value for sid.sat, expected 38, is %d", check_msg->sid.sat); - ck_assert_msg(check_msg->sync_flags == 90, "incorrect value for sync_flags, expected 90, is %d", check_msg->sync_flags); - ck_assert_msg(check_msg->tot.ns_residual == -811597120, "incorrect value for tot.ns_residual, expected -811597120, is %d", check_msg->tot.ns_residual); - ck_assert_msg(check_msg->tot.tow == 1581737093, "incorrect value for tot.tow, expected 1581737093, is %d", check_msg->tot.tow); - ck_assert_msg(check_msg->tot.wn == 65492, "incorrect value for tot.wn, expected 65492, is %d", check_msg->tot.wn); - ck_assert_msg(check_msg->tow_flags == 219, "incorrect value for tow_flags, expected 219, is %d", check_msg->tow_flags); - ck_assert_msg(check_msg->track_flags == 67, "incorrect value for track_flags, expected 67, is %d", check_msg->track_flags); - ck_assert_msg(check_msg->uptime == 3263741727, "incorrect value for uptime, expected 3263741727, is %d", check_msg->uptime); + ck_assert_msg(check_msg->L.f == 204, + "incorrect value for L.f, expected 204, is %d", + check_msg->L.f); + ck_assert_msg(check_msg->L.i == -1601767965, + "incorrect value for L.i, expected -1601767965, is %d", + check_msg->L.i); + ck_assert_msg(check_msg->P == 1044286343, + "incorrect value for P, expected 1044286343, is %d", + check_msg->P); + ck_assert_msg(check_msg->P_std == 21427, + "incorrect value for P_std, expected 21427, is %d", + check_msg->P_std); + ck_assert_msg(check_msg->acceleration == -114, + "incorrect value for acceleration, expected -114, is %d", + check_msg->acceleration); + ck_assert_msg(check_msg->clock_drift == 23311, + "incorrect value for clock_drift, expected 23311, is %d", + check_msg->clock_drift); + ck_assert_msg(check_msg->clock_offset == 6012, + "incorrect value for clock_offset, expected 6012, is %d", + check_msg->clock_offset); + ck_assert_msg(check_msg->cn0 == 78, + "incorrect value for cn0, expected 78, is %d", + check_msg->cn0); + ck_assert_msg(check_msg->corr_spacing == 30201, + "incorrect value for corr_spacing, expected 30201, is %d", + check_msg->corr_spacing); + ck_assert_msg(check_msg->doppler == 1459556257, + "incorrect value for doppler, expected 1459556257, is %d", + check_msg->doppler); + ck_assert_msg(check_msg->doppler_std == 63677, + "incorrect value for doppler_std, expected 63677, is %d", + check_msg->doppler_std); + ck_assert_msg(check_msg->lock == 65375, + "incorrect value for lock, expected 65375, is %d", + check_msg->lock); + ck_assert_msg(check_msg->misc_flags == 62, + "incorrect value for misc_flags, expected 62, is %d", + check_msg->misc_flags); + ck_assert_msg(check_msg->nav_flags == 25, + "incorrect value for nav_flags, expected 25, is %d", + check_msg->nav_flags); + ck_assert_msg(check_msg->pset_flags == 83, + "incorrect value for pset_flags, expected 83, is %d", + check_msg->pset_flags); + ck_assert_msg(check_msg->recv_time == 941247176494, + "incorrect value for recv_time, expected 941247176494, is %d", + check_msg->recv_time); + ck_assert_msg(check_msg->sid.code == 59, + "incorrect value for sid.code, expected 59, is %d", + check_msg->sid.code); + ck_assert_msg(check_msg->sid.sat == 38, + "incorrect value for sid.sat, expected 38, is %d", + check_msg->sid.sat); + ck_assert_msg(check_msg->sync_flags == 90, + "incorrect value for sync_flags, expected 90, is %d", + check_msg->sync_flags); + ck_assert_msg( + check_msg->tot.ns_residual == -811597120, + "incorrect value for tot.ns_residual, expected -811597120, is %d", + check_msg->tot.ns_residual); + ck_assert_msg(check_msg->tot.tow == 1581737093, + "incorrect value for tot.tow, expected 1581737093, is %d", + check_msg->tot.tow); + ck_assert_msg(check_msg->tot.wn == 65492, + "incorrect value for tot.wn, expected 65492, is %d", + check_msg->tot.wn); + ck_assert_msg(check_msg->tow_flags == 219, + "incorrect value for tow_flags, expected 219, is %d", + check_msg->tow_flags); + ck_assert_msg(check_msg->track_flags == 67, + "incorrect value for track_flags, expected 67, is %d", + check_msg->track_flags); + ck_assert_msg(check_msg->uptime == 3263741727, + "incorrect value for uptime, expected 3263741727, is %d", + check_msg->uptime); } } END_TEST -Suite* legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA); +Suite *legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_tracking_" + "MsgTrackingStateDetailedDepA"); + tcase_add_test( + tc_acq, test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_tracking_MsgtrackingStateDepA.c b/c/test/legacy/auto_check_sbp_tracking_MsgtrackingStateDepA.c index 7e1ac7a21..66bd71395 100644 --- a/c/test/legacy/auto_check_sbp_tracking_MsgtrackingStateDepA.c +++ b/c/test/legacy/auto_check_sbp_tracking_MsgtrackingStateDepA.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgtrackingStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgtrackingStateDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,18 +26,18 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; u16 sender_id; u8 len; u8 msg[SBP_MAX_PAYLOAD_LEN]; - void *context; + void* context; } last_msg; static struct { @@ -46,7 +48,7 @@ static struct { u8 msg[SBP_MAX_PAYLOAD_LEN]; u16 frame_len; u8 frame[SBP_MAX_FRAME_LEN]; - void *context; + void* context; } last_frame; static u32 dummy_wr = 0; @@ -57,38 +59,33 @@ static void* last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8* buff, u32 n, void* context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void* context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA ) -{ +START_TEST(test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,27 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x16, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x16, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x16, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x16, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,22,0,195,4,66,1,0,204,177,51,65,1,2,198,4,39,65,1,3,219,182,27,65,1,7,132,120,101,65,1,10,91,91,251,64,1,13,42,37,163,64,1,22,130,184,215,64,1,30,115,53,75,65,1,31,16,74,126,65,1,25,132,196,135,64,1,6,100,59,223,64,17,225, }; + u8 encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 204, 177, 51, 65, 1, + 2, 198, 4, 39, 65, 1, 3, 219, 182, 27, 65, 1, 7, + 132, 120, 101, 65, 1, 10, 91, 91, 251, 64, 1, 13, 42, + 37, 163, 64, 1, 22, 130, 184, 215, 64, 1, 30, 115, 53, + 75, 65, 1, 31, 16, 74, 126, 65, 1, 25, 132, 196, 135, + 64, 1, 6, 100, 59, 223, 64, 17, 225, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_state_dep_a_t* test_msg = ( msg_tracking_state_dep_a_t* )test_msg_storage; + msg_tracking_state_dep_a_t* test_msg = + (msg_tracking_state_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->states) == 0) { // Cope with variable length arrays @@ -220,92 +227,177 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA ) test_msg->states[10].cn0 = 6.97599983215332; test_msg->states[10].prn = 6; test_msg->states[10].state = 1; - sbp_payload_send(&sbp_state, 0x16, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x16, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x16, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_state_dep_a_t* check_msg = ( msg_tracking_state_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_state_dep_a_t* check_msg = + (msg_tracking_state_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->states[0].cn0*100 - 11.2309074402*100) < 0.05, "incorrect value for states[0].cn0, expected 11.2309074402, is %f", check_msg->states[0].cn0); - ck_assert_msg(check_msg->states[0].prn == 0, "incorrect value for states[0].prn, expected 0, is %d", check_msg->states[0].prn); - ck_assert_msg(check_msg->states[0].state == 1, "incorrect value for states[0].state, expected 1, is %d", check_msg->states[0].state); - ck_assert_msg((check_msg->states[1].cn0*100 - 10.43866539*100) < 0.05, "incorrect value for states[1].cn0, expected 10.43866539, is %f", check_msg->states[1].cn0); - ck_assert_msg(check_msg->states[1].prn == 2, "incorrect value for states[1].prn, expected 2, is %d", check_msg->states[1].prn); - ck_assert_msg(check_msg->states[1].state == 1, "incorrect value for states[1].state, expected 1, is %d", check_msg->states[1].state); - ck_assert_msg((check_msg->states[2].cn0*100 - 9.73214244843*100) < 0.05, "incorrect value for states[2].cn0, expected 9.73214244843, is %f", check_msg->states[2].cn0); - ck_assert_msg(check_msg->states[2].prn == 3, "incorrect value for states[2].prn, expected 3, is %d", check_msg->states[2].prn); - ck_assert_msg(check_msg->states[2].state == 1, "incorrect value for states[2].state, expected 1, is %d", check_msg->states[2].state); - ck_assert_msg((check_msg->states[3].cn0*100 - 14.34192276*100) < 0.05, "incorrect value for states[3].cn0, expected 14.34192276, is %f", check_msg->states[3].cn0); - ck_assert_msg(check_msg->states[3].prn == 7, "incorrect value for states[3].prn, expected 7, is %d", check_msg->states[3].prn); - ck_assert_msg(check_msg->states[3].state == 1, "incorrect value for states[3].state, expected 1, is %d", check_msg->states[3].state); - ck_assert_msg((check_msg->states[4].cn0*100 - 7.85490179062*100) < 0.05, "incorrect value for states[4].cn0, expected 7.85490179062, is %f", check_msg->states[4].cn0); - ck_assert_msg(check_msg->states[4].prn == 10, "incorrect value for states[4].prn, expected 10, is %d", check_msg->states[4].prn); - ck_assert_msg(check_msg->states[4].state == 1, "incorrect value for states[4].state, expected 1, is %d", check_msg->states[4].state); - ck_assert_msg((check_msg->states[5].cn0*100 - 5.09828662872*100) < 0.05, "incorrect value for states[5].cn0, expected 5.09828662872, is %f", check_msg->states[5].cn0); - ck_assert_msg(check_msg->states[5].prn == 13, "incorrect value for states[5].prn, expected 13, is %d", check_msg->states[5].prn); - ck_assert_msg(check_msg->states[5].state == 1, "incorrect value for states[5].state, expected 1, is %d", check_msg->states[5].state); - ck_assert_msg((check_msg->states[6].cn0*100 - 6.74127292633*100) < 0.05, "incorrect value for states[6].cn0, expected 6.74127292633, is %f", check_msg->states[6].cn0); - ck_assert_msg(check_msg->states[6].prn == 22, "incorrect value for states[6].prn, expected 22, is %d", check_msg->states[6].prn); - ck_assert_msg(check_msg->states[6].state == 1, "incorrect value for states[6].state, expected 1, is %d", check_msg->states[6].state); - ck_assert_msg((check_msg->states[7].cn0*100 - 12.7005491257*100) < 0.05, "incorrect value for states[7].cn0, expected 12.7005491257, is %f", check_msg->states[7].cn0); - ck_assert_msg(check_msg->states[7].prn == 30, "incorrect value for states[7].prn, expected 30, is %d", check_msg->states[7].prn); - ck_assert_msg(check_msg->states[7].state == 1, "incorrect value for states[7].state, expected 1, is %d", check_msg->states[7].state); - ck_assert_msg((check_msg->states[8].cn0*100 - 15.893081665*100) < 0.05, "incorrect value for states[8].cn0, expected 15.893081665, is %f", check_msg->states[8].cn0); - ck_assert_msg(check_msg->states[8].prn == 31, "incorrect value for states[8].prn, expected 31, is %d", check_msg->states[8].prn); - ck_assert_msg(check_msg->states[8].state == 1, "incorrect value for states[8].state, expected 1, is %d", check_msg->states[8].state); - ck_assert_msg((check_msg->states[9].cn0*100 - 4.24273872375*100) < 0.05, "incorrect value for states[9].cn0, expected 4.24273872375, is %f", check_msg->states[9].cn0); - ck_assert_msg(check_msg->states[9].prn == 25, "incorrect value for states[9].prn, expected 25, is %d", check_msg->states[9].prn); - ck_assert_msg(check_msg->states[9].state == 1, "incorrect value for states[9].state, expected 1, is %d", check_msg->states[9].state); - ck_assert_msg((check_msg->states[10].cn0*100 - 6.97599983215*100) < 0.05, "incorrect value for states[10].cn0, expected 6.97599983215, is %f", check_msg->states[10].cn0); - ck_assert_msg(check_msg->states[10].prn == 6, "incorrect value for states[10].prn, expected 6, is %d", check_msg->states[10].prn); - ck_assert_msg(check_msg->states[10].state == 1, "incorrect value for states[10].state, expected 1, is %d", check_msg->states[10].state); + ck_assert_msg( + (check_msg->states[0].cn0 * 100 - 11.2309074402 * 100) < 0.05, + "incorrect value for states[0].cn0, expected 11.2309074402, is %f", + check_msg->states[0].cn0); + ck_assert_msg(check_msg->states[0].prn == 0, + "incorrect value for states[0].prn, expected 0, is %d", + check_msg->states[0].prn); + ck_assert_msg(check_msg->states[0].state == 1, + "incorrect value for states[0].state, expected 1, is %d", + check_msg->states[0].state); + ck_assert_msg( + (check_msg->states[1].cn0 * 100 - 10.43866539 * 100) < 0.05, + "incorrect value for states[1].cn0, expected 10.43866539, is %f", + check_msg->states[1].cn0); + ck_assert_msg(check_msg->states[1].prn == 2, + "incorrect value for states[1].prn, expected 2, is %d", + check_msg->states[1].prn); + ck_assert_msg(check_msg->states[1].state == 1, + "incorrect value for states[1].state, expected 1, is %d", + check_msg->states[1].state); + ck_assert_msg( + (check_msg->states[2].cn0 * 100 - 9.73214244843 * 100) < 0.05, + "incorrect value for states[2].cn0, expected 9.73214244843, is %f", + check_msg->states[2].cn0); + ck_assert_msg(check_msg->states[2].prn == 3, + "incorrect value for states[2].prn, expected 3, is %d", + check_msg->states[2].prn); + ck_assert_msg(check_msg->states[2].state == 1, + "incorrect value for states[2].state, expected 1, is %d", + check_msg->states[2].state); + ck_assert_msg( + (check_msg->states[3].cn0 * 100 - 14.34192276 * 100) < 0.05, + "incorrect value for states[3].cn0, expected 14.34192276, is %f", + check_msg->states[3].cn0); + ck_assert_msg(check_msg->states[3].prn == 7, + "incorrect value for states[3].prn, expected 7, is %d", + check_msg->states[3].prn); + ck_assert_msg(check_msg->states[3].state == 1, + "incorrect value for states[3].state, expected 1, is %d", + check_msg->states[3].state); + ck_assert_msg( + (check_msg->states[4].cn0 * 100 - 7.85490179062 * 100) < 0.05, + "incorrect value for states[4].cn0, expected 7.85490179062, is %f", + check_msg->states[4].cn0); + ck_assert_msg(check_msg->states[4].prn == 10, + "incorrect value for states[4].prn, expected 10, is %d", + check_msg->states[4].prn); + ck_assert_msg(check_msg->states[4].state == 1, + "incorrect value for states[4].state, expected 1, is %d", + check_msg->states[4].state); + ck_assert_msg( + (check_msg->states[5].cn0 * 100 - 5.09828662872 * 100) < 0.05, + "incorrect value for states[5].cn0, expected 5.09828662872, is %f", + check_msg->states[5].cn0); + ck_assert_msg(check_msg->states[5].prn == 13, + "incorrect value for states[5].prn, expected 13, is %d", + check_msg->states[5].prn); + ck_assert_msg(check_msg->states[5].state == 1, + "incorrect value for states[5].state, expected 1, is %d", + check_msg->states[5].state); + ck_assert_msg( + (check_msg->states[6].cn0 * 100 - 6.74127292633 * 100) < 0.05, + "incorrect value for states[6].cn0, expected 6.74127292633, is %f", + check_msg->states[6].cn0); + ck_assert_msg(check_msg->states[6].prn == 22, + "incorrect value for states[6].prn, expected 22, is %d", + check_msg->states[6].prn); + ck_assert_msg(check_msg->states[6].state == 1, + "incorrect value for states[6].state, expected 1, is %d", + check_msg->states[6].state); + ck_assert_msg( + (check_msg->states[7].cn0 * 100 - 12.7005491257 * 100) < 0.05, + "incorrect value for states[7].cn0, expected 12.7005491257, is %f", + check_msg->states[7].cn0); + ck_assert_msg(check_msg->states[7].prn == 30, + "incorrect value for states[7].prn, expected 30, is %d", + check_msg->states[7].prn); + ck_assert_msg(check_msg->states[7].state == 1, + "incorrect value for states[7].state, expected 1, is %d", + check_msg->states[7].state); + ck_assert_msg( + (check_msg->states[8].cn0 * 100 - 15.893081665 * 100) < 0.05, + "incorrect value for states[8].cn0, expected 15.893081665, is %f", + check_msg->states[8].cn0); + ck_assert_msg(check_msg->states[8].prn == 31, + "incorrect value for states[8].prn, expected 31, is %d", + check_msg->states[8].prn); + ck_assert_msg(check_msg->states[8].state == 1, + "incorrect value for states[8].state, expected 1, is %d", + check_msg->states[8].state); + ck_assert_msg( + (check_msg->states[9].cn0 * 100 - 4.24273872375 * 100) < 0.05, + "incorrect value for states[9].cn0, expected 4.24273872375, is %f", + check_msg->states[9].cn0); + ck_assert_msg(check_msg->states[9].prn == 25, + "incorrect value for states[9].prn, expected 25, is %d", + check_msg->states[9].prn); + ck_assert_msg(check_msg->states[9].state == 1, + "incorrect value for states[9].state, expected 1, is %d", + check_msg->states[9].state); + ck_assert_msg( + (check_msg->states[10].cn0 * 100 - 6.97599983215 * 100) < 0.05, + "incorrect value for states[10].cn0, expected 6.97599983215, is %f", + check_msg->states[10].cn0); + ck_assert_msg(check_msg->states[10].prn == 6, + "incorrect value for states[10].prn, expected 6, is %d", + check_msg->states[10].prn); + ck_assert_msg(check_msg->states[10].state == 1, + "incorrect value for states[10].state, expected 1, is %d", + check_msg->states[10].state); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -313,17 +405,26 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x16, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x16, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x16, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x16, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,22,0,195,4,66,1,0,216,57,48,65,1,2,145,41,46,65,1,3,4,26,34,65,1,7,177,67,109,65,1,10,61,80,249,64,1,13,250,199,155,64,1,22,55,19,215,64,1,30,138,138,79,65,1,31,214,179,119,65,1,25,53,138,120,64,1,6,183,247,129,64,168,173, }; + u8 encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 216, 57, 48, 65, 1, 2, 145, + 41, 46, 65, 1, 3, 4, 26, 34, 65, 1, 7, 177, 67, 109, 65, + 1, 10, 61, 80, 249, 64, 1, 13, 250, 199, 155, 64, 1, 22, 55, + 19, 215, 64, 1, 30, 138, 138, 79, 65, 1, 31, 214, 179, 119, 65, + 1, 25, 53, 138, 120, 64, 1, 6, 183, 247, 129, 64, 168, 173, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_state_dep_a_t* test_msg = ( msg_tracking_state_dep_a_t* )test_msg_storage; + msg_tracking_state_dep_a_t* test_msg = + (msg_tracking_state_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->states) == 0) { // Cope with variable length arrays @@ -402,92 +503,177 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA ) test_msg->states[10].cn0 = 4.061488628387451; test_msg->states[10].prn = 6; test_msg->states[10].state = 1; - sbp_payload_send(&sbp_state, 0x16, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x16, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x16, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_state_dep_a_t* check_msg = ( msg_tracking_state_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_state_dep_a_t* check_msg = + (msg_tracking_state_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->states[0].cn0*100 - 11.0141220093*100) < 0.05, "incorrect value for states[0].cn0, expected 11.0141220093, is %f", check_msg->states[0].cn0); - ck_assert_msg(check_msg->states[0].prn == 0, "incorrect value for states[0].prn, expected 0, is %d", check_msg->states[0].prn); - ck_assert_msg(check_msg->states[0].state == 1, "incorrect value for states[0].state, expected 1, is %d", check_msg->states[0].state); - ck_assert_msg((check_msg->states[1].cn0*100 - 10.8851480484*100) < 0.05, "incorrect value for states[1].cn0, expected 10.8851480484, is %f", check_msg->states[1].cn0); - ck_assert_msg(check_msg->states[1].prn == 2, "incorrect value for states[1].prn, expected 2, is %d", check_msg->states[1].prn); - ck_assert_msg(check_msg->states[1].state == 1, "incorrect value for states[1].state, expected 1, is %d", check_msg->states[1].state); - ck_assert_msg((check_msg->states[2].cn0*100 - 10.1313514709*100) < 0.05, "incorrect value for states[2].cn0, expected 10.1313514709, is %f", check_msg->states[2].cn0); - ck_assert_msg(check_msg->states[2].prn == 3, "incorrect value for states[2].prn, expected 3, is %d", check_msg->states[2].prn); - ck_assert_msg(check_msg->states[2].state == 1, "incorrect value for states[2].state, expected 1, is %d", check_msg->states[2].state); - ck_assert_msg((check_msg->states[3].cn0*100 - 14.8290262222*100) < 0.05, "incorrect value for states[3].cn0, expected 14.8290262222, is %f", check_msg->states[3].cn0); - ck_assert_msg(check_msg->states[3].prn == 7, "incorrect value for states[3].prn, expected 7, is %d", check_msg->states[3].prn); - ck_assert_msg(check_msg->states[3].state == 1, "incorrect value for states[3].state, expected 1, is %d", check_msg->states[3].state); - ck_assert_msg((check_msg->states[4].cn0*100 - 7.79104471207*100) < 0.05, "incorrect value for states[4].cn0, expected 7.79104471207, is %f", check_msg->states[4].cn0); - ck_assert_msg(check_msg->states[4].prn == 10, "incorrect value for states[4].prn, expected 10, is %d", check_msg->states[4].prn); - ck_assert_msg(check_msg->states[4].state == 1, "incorrect value for states[4].state, expected 1, is %d", check_msg->states[4].state); - ck_assert_msg((check_msg->states[5].cn0*100 - 4.86816120148*100) < 0.05, "incorrect value for states[5].cn0, expected 4.86816120148, is %f", check_msg->states[5].cn0); - ck_assert_msg(check_msg->states[5].prn == 13, "incorrect value for states[5].prn, expected 13, is %d", check_msg->states[5].prn); - ck_assert_msg(check_msg->states[5].state == 1, "incorrect value for states[5].state, expected 1, is %d", check_msg->states[5].state); - ck_assert_msg((check_msg->states[6].cn0*100 - 6.72109556198*100) < 0.05, "incorrect value for states[6].cn0, expected 6.72109556198, is %f", check_msg->states[6].cn0); - ck_assert_msg(check_msg->states[6].prn == 22, "incorrect value for states[6].prn, expected 22, is %d", check_msg->states[6].prn); - ck_assert_msg(check_msg->states[6].state == 1, "incorrect value for states[6].state, expected 1, is %d", check_msg->states[6].state); - ck_assert_msg((check_msg->states[7].cn0*100 - 12.9713230133*100) < 0.05, "incorrect value for states[7].cn0, expected 12.9713230133, is %f", check_msg->states[7].cn0); - ck_assert_msg(check_msg->states[7].prn == 30, "incorrect value for states[7].prn, expected 30, is %d", check_msg->states[7].prn); - ck_assert_msg(check_msg->states[7].state == 1, "incorrect value for states[7].state, expected 1, is %d", check_msg->states[7].state); - ck_assert_msg((check_msg->states[8].cn0*100 - 15.4814052582*100) < 0.05, "incorrect value for states[8].cn0, expected 15.4814052582, is %f", check_msg->states[8].cn0); - ck_assert_msg(check_msg->states[8].prn == 31, "incorrect value for states[8].prn, expected 31, is %d", check_msg->states[8].prn); - ck_assert_msg(check_msg->states[8].state == 1, "incorrect value for states[8].state, expected 1, is %d", check_msg->states[8].state); - ck_assert_msg((check_msg->states[9].cn0*100 - 3.88343548775*100) < 0.05, "incorrect value for states[9].cn0, expected 3.88343548775, is %f", check_msg->states[9].cn0); - ck_assert_msg(check_msg->states[9].prn == 25, "incorrect value for states[9].prn, expected 25, is %d", check_msg->states[9].prn); - ck_assert_msg(check_msg->states[9].state == 1, "incorrect value for states[9].state, expected 1, is %d", check_msg->states[9].state); - ck_assert_msg((check_msg->states[10].cn0*100 - 4.06148862839*100) < 0.05, "incorrect value for states[10].cn0, expected 4.06148862839, is %f", check_msg->states[10].cn0); - ck_assert_msg(check_msg->states[10].prn == 6, "incorrect value for states[10].prn, expected 6, is %d", check_msg->states[10].prn); - ck_assert_msg(check_msg->states[10].state == 1, "incorrect value for states[10].state, expected 1, is %d", check_msg->states[10].state); + ck_assert_msg( + (check_msg->states[0].cn0 * 100 - 11.0141220093 * 100) < 0.05, + "incorrect value for states[0].cn0, expected 11.0141220093, is %f", + check_msg->states[0].cn0); + ck_assert_msg(check_msg->states[0].prn == 0, + "incorrect value for states[0].prn, expected 0, is %d", + check_msg->states[0].prn); + ck_assert_msg(check_msg->states[0].state == 1, + "incorrect value for states[0].state, expected 1, is %d", + check_msg->states[0].state); + ck_assert_msg( + (check_msg->states[1].cn0 * 100 - 10.8851480484 * 100) < 0.05, + "incorrect value for states[1].cn0, expected 10.8851480484, is %f", + check_msg->states[1].cn0); + ck_assert_msg(check_msg->states[1].prn == 2, + "incorrect value for states[1].prn, expected 2, is %d", + check_msg->states[1].prn); + ck_assert_msg(check_msg->states[1].state == 1, + "incorrect value for states[1].state, expected 1, is %d", + check_msg->states[1].state); + ck_assert_msg( + (check_msg->states[2].cn0 * 100 - 10.1313514709 * 100) < 0.05, + "incorrect value for states[2].cn0, expected 10.1313514709, is %f", + check_msg->states[2].cn0); + ck_assert_msg(check_msg->states[2].prn == 3, + "incorrect value for states[2].prn, expected 3, is %d", + check_msg->states[2].prn); + ck_assert_msg(check_msg->states[2].state == 1, + "incorrect value for states[2].state, expected 1, is %d", + check_msg->states[2].state); + ck_assert_msg( + (check_msg->states[3].cn0 * 100 - 14.8290262222 * 100) < 0.05, + "incorrect value for states[3].cn0, expected 14.8290262222, is %f", + check_msg->states[3].cn0); + ck_assert_msg(check_msg->states[3].prn == 7, + "incorrect value for states[3].prn, expected 7, is %d", + check_msg->states[3].prn); + ck_assert_msg(check_msg->states[3].state == 1, + "incorrect value for states[3].state, expected 1, is %d", + check_msg->states[3].state); + ck_assert_msg( + (check_msg->states[4].cn0 * 100 - 7.79104471207 * 100) < 0.05, + "incorrect value for states[4].cn0, expected 7.79104471207, is %f", + check_msg->states[4].cn0); + ck_assert_msg(check_msg->states[4].prn == 10, + "incorrect value for states[4].prn, expected 10, is %d", + check_msg->states[4].prn); + ck_assert_msg(check_msg->states[4].state == 1, + "incorrect value for states[4].state, expected 1, is %d", + check_msg->states[4].state); + ck_assert_msg( + (check_msg->states[5].cn0 * 100 - 4.86816120148 * 100) < 0.05, + "incorrect value for states[5].cn0, expected 4.86816120148, is %f", + check_msg->states[5].cn0); + ck_assert_msg(check_msg->states[5].prn == 13, + "incorrect value for states[5].prn, expected 13, is %d", + check_msg->states[5].prn); + ck_assert_msg(check_msg->states[5].state == 1, + "incorrect value for states[5].state, expected 1, is %d", + check_msg->states[5].state); + ck_assert_msg( + (check_msg->states[6].cn0 * 100 - 6.72109556198 * 100) < 0.05, + "incorrect value for states[6].cn0, expected 6.72109556198, is %f", + check_msg->states[6].cn0); + ck_assert_msg(check_msg->states[6].prn == 22, + "incorrect value for states[6].prn, expected 22, is %d", + check_msg->states[6].prn); + ck_assert_msg(check_msg->states[6].state == 1, + "incorrect value for states[6].state, expected 1, is %d", + check_msg->states[6].state); + ck_assert_msg( + (check_msg->states[7].cn0 * 100 - 12.9713230133 * 100) < 0.05, + "incorrect value for states[7].cn0, expected 12.9713230133, is %f", + check_msg->states[7].cn0); + ck_assert_msg(check_msg->states[7].prn == 30, + "incorrect value for states[7].prn, expected 30, is %d", + check_msg->states[7].prn); + ck_assert_msg(check_msg->states[7].state == 1, + "incorrect value for states[7].state, expected 1, is %d", + check_msg->states[7].state); + ck_assert_msg( + (check_msg->states[8].cn0 * 100 - 15.4814052582 * 100) < 0.05, + "incorrect value for states[8].cn0, expected 15.4814052582, is %f", + check_msg->states[8].cn0); + ck_assert_msg(check_msg->states[8].prn == 31, + "incorrect value for states[8].prn, expected 31, is %d", + check_msg->states[8].prn); + ck_assert_msg(check_msg->states[8].state == 1, + "incorrect value for states[8].state, expected 1, is %d", + check_msg->states[8].state); + ck_assert_msg( + (check_msg->states[9].cn0 * 100 - 3.88343548775 * 100) < 0.05, + "incorrect value for states[9].cn0, expected 3.88343548775, is %f", + check_msg->states[9].cn0); + ck_assert_msg(check_msg->states[9].prn == 25, + "incorrect value for states[9].prn, expected 25, is %d", + check_msg->states[9].prn); + ck_assert_msg(check_msg->states[9].state == 1, + "incorrect value for states[9].state, expected 1, is %d", + check_msg->states[9].state); + ck_assert_msg( + (check_msg->states[10].cn0 * 100 - 4.06148862839 * 100) < 0.05, + "incorrect value for states[10].cn0, expected 4.06148862839, is %f", + check_msg->states[10].cn0); + ck_assert_msg(check_msg->states[10].prn == 6, + "incorrect value for states[10].prn, expected 6, is %d", + check_msg->states[10].prn); + ck_assert_msg(check_msg->states[10].state == 1, + "incorrect value for states[10].state, expected 1, is %d", + check_msg->states[10].state); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -495,17 +681,26 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x16, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x16, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x16, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x16, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,22,0,195,4,66,1,0,141,76,60,65,1,2,69,139,46,65,1,3,146,27,30,65,1,7,235,56,97,65,1,10,141,213,243,64,1,13,250,170,166,64,1,22,17,101,201,64,1,30,172,183,83,65,1,31,238,193,120,65,1,25,220,48,132,64,1,6,49,214,54,64,110,179, }; + u8 encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 141, 76, 60, 65, 1, 2, 69, + 139, 46, 65, 1, 3, 146, 27, 30, 65, 1, 7, 235, 56, 97, 65, + 1, 10, 141, 213, 243, 64, 1, 13, 250, 170, 166, 64, 1, 22, 17, + 101, 201, 64, 1, 30, 172, 183, 83, 65, 1, 31, 238, 193, 120, 65, + 1, 25, 220, 48, 132, 64, 1, 6, 49, 214, 54, 64, 110, 179, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_state_dep_a_t* test_msg = ( msg_tracking_state_dep_a_t* )test_msg_storage; + msg_tracking_state_dep_a_t* test_msg = + (msg_tracking_state_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->states) == 0) { // Cope with variable length arrays @@ -584,92 +779,177 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA ) test_msg->states[10].cn0 = 2.856823205947876; test_msg->states[10].prn = 6; test_msg->states[10].state = 1; - sbp_payload_send(&sbp_state, 0x16, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x16, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x16, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_state_dep_a_t* check_msg = ( msg_tracking_state_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_state_dep_a_t* check_msg = + (msg_tracking_state_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->states[0].cn0*100 - 11.7686891556*100) < 0.05, "incorrect value for states[0].cn0, expected 11.7686891556, is %f", check_msg->states[0].cn0); - ck_assert_msg(check_msg->states[0].prn == 0, "incorrect value for states[0].prn, expected 0, is %d", check_msg->states[0].prn); - ck_assert_msg(check_msg->states[0].state == 1, "incorrect value for states[0].state, expected 1, is %d", check_msg->states[0].state); - ck_assert_msg((check_msg->states[1].cn0*100 - 10.9090013504*100) < 0.05, "incorrect value for states[1].cn0, expected 10.9090013504, is %f", check_msg->states[1].cn0); - ck_assert_msg(check_msg->states[1].prn == 2, "incorrect value for states[1].prn, expected 2, is %d", check_msg->states[1].prn); - ck_assert_msg(check_msg->states[1].state == 1, "incorrect value for states[1].state, expected 1, is %d", check_msg->states[1].state); - ck_assert_msg((check_msg->states[2].cn0*100 - 9.88173103333*100) < 0.05, "incorrect value for states[2].cn0, expected 9.88173103333, is %f", check_msg->states[2].cn0); - ck_assert_msg(check_msg->states[2].prn == 3, "incorrect value for states[2].prn, expected 3, is %d", check_msg->states[2].prn); - ck_assert_msg(check_msg->states[2].state == 1, "incorrect value for states[2].state, expected 1, is %d", check_msg->states[2].state); - ck_assert_msg((check_msg->states[3].cn0*100 - 14.0763959885*100) < 0.05, "incorrect value for states[3].cn0, expected 14.0763959885, is %f", check_msg->states[3].cn0); - ck_assert_msg(check_msg->states[3].prn == 7, "incorrect value for states[3].prn, expected 7, is %d", check_msg->states[3].prn); - ck_assert_msg(check_msg->states[3].state == 1, "incorrect value for states[3].state, expected 1, is %d", check_msg->states[3].state); - ck_assert_msg((check_msg->states[4].cn0*100 - 7.6198182106*100) < 0.05, "incorrect value for states[4].cn0, expected 7.6198182106, is %f", check_msg->states[4].cn0); - ck_assert_msg(check_msg->states[4].prn == 10, "incorrect value for states[4].prn, expected 10, is %d", check_msg->states[4].prn); - ck_assert_msg(check_msg->states[4].state == 1, "incorrect value for states[4].state, expected 1, is %d", check_msg->states[4].state); - ck_assert_msg((check_msg->states[5].cn0*100 - 5.20837116241*100) < 0.05, "incorrect value for states[5].cn0, expected 5.20837116241, is %f", check_msg->states[5].cn0); - ck_assert_msg(check_msg->states[5].prn == 13, "incorrect value for states[5].prn, expected 13, is %d", check_msg->states[5].prn); - ck_assert_msg(check_msg->states[5].state == 1, "incorrect value for states[5].state, expected 1, is %d", check_msg->states[5].state); - ck_assert_msg((check_msg->states[6].cn0*100 - 6.29358720779*100) < 0.05, "incorrect value for states[6].cn0, expected 6.29358720779, is %f", check_msg->states[6].cn0); - ck_assert_msg(check_msg->states[6].prn == 22, "incorrect value for states[6].prn, expected 22, is %d", check_msg->states[6].prn); - ck_assert_msg(check_msg->states[6].state == 1, "incorrect value for states[6].state, expected 1, is %d", check_msg->states[6].state); - ck_assert_msg((check_msg->states[7].cn0*100 - 13.2323417664*100) < 0.05, "incorrect value for states[7].cn0, expected 13.2323417664, is %f", check_msg->states[7].cn0); - ck_assert_msg(check_msg->states[7].prn == 30, "incorrect value for states[7].prn, expected 30, is %d", check_msg->states[7].prn); - ck_assert_msg(check_msg->states[7].state == 1, "incorrect value for states[7].state, expected 1, is %d", check_msg->states[7].state); - ck_assert_msg((check_msg->states[8].cn0*100 - 15.5473461151*100) < 0.05, "incorrect value for states[8].cn0, expected 15.5473461151, is %f", check_msg->states[8].cn0); - ck_assert_msg(check_msg->states[8].prn == 31, "incorrect value for states[8].prn, expected 31, is %d", check_msg->states[8].prn); - ck_assert_msg(check_msg->states[8].state == 1, "incorrect value for states[8].state, expected 1, is %d", check_msg->states[8].state); - ck_assert_msg((check_msg->states[9].cn0*100 - 4.13096427917*100) < 0.05, "incorrect value for states[9].cn0, expected 4.13096427917, is %f", check_msg->states[9].cn0); - ck_assert_msg(check_msg->states[9].prn == 25, "incorrect value for states[9].prn, expected 25, is %d", check_msg->states[9].prn); - ck_assert_msg(check_msg->states[9].state == 1, "incorrect value for states[9].state, expected 1, is %d", check_msg->states[9].state); - ck_assert_msg((check_msg->states[10].cn0*100 - 2.85682320595*100) < 0.05, "incorrect value for states[10].cn0, expected 2.85682320595, is %f", check_msg->states[10].cn0); - ck_assert_msg(check_msg->states[10].prn == 6, "incorrect value for states[10].prn, expected 6, is %d", check_msg->states[10].prn); - ck_assert_msg(check_msg->states[10].state == 1, "incorrect value for states[10].state, expected 1, is %d", check_msg->states[10].state); + ck_assert_msg( + (check_msg->states[0].cn0 * 100 - 11.7686891556 * 100) < 0.05, + "incorrect value for states[0].cn0, expected 11.7686891556, is %f", + check_msg->states[0].cn0); + ck_assert_msg(check_msg->states[0].prn == 0, + "incorrect value for states[0].prn, expected 0, is %d", + check_msg->states[0].prn); + ck_assert_msg(check_msg->states[0].state == 1, + "incorrect value for states[0].state, expected 1, is %d", + check_msg->states[0].state); + ck_assert_msg( + (check_msg->states[1].cn0 * 100 - 10.9090013504 * 100) < 0.05, + "incorrect value for states[1].cn0, expected 10.9090013504, is %f", + check_msg->states[1].cn0); + ck_assert_msg(check_msg->states[1].prn == 2, + "incorrect value for states[1].prn, expected 2, is %d", + check_msg->states[1].prn); + ck_assert_msg(check_msg->states[1].state == 1, + "incorrect value for states[1].state, expected 1, is %d", + check_msg->states[1].state); + ck_assert_msg( + (check_msg->states[2].cn0 * 100 - 9.88173103333 * 100) < 0.05, + "incorrect value for states[2].cn0, expected 9.88173103333, is %f", + check_msg->states[2].cn0); + ck_assert_msg(check_msg->states[2].prn == 3, + "incorrect value for states[2].prn, expected 3, is %d", + check_msg->states[2].prn); + ck_assert_msg(check_msg->states[2].state == 1, + "incorrect value for states[2].state, expected 1, is %d", + check_msg->states[2].state); + ck_assert_msg( + (check_msg->states[3].cn0 * 100 - 14.0763959885 * 100) < 0.05, + "incorrect value for states[3].cn0, expected 14.0763959885, is %f", + check_msg->states[3].cn0); + ck_assert_msg(check_msg->states[3].prn == 7, + "incorrect value for states[3].prn, expected 7, is %d", + check_msg->states[3].prn); + ck_assert_msg(check_msg->states[3].state == 1, + "incorrect value for states[3].state, expected 1, is %d", + check_msg->states[3].state); + ck_assert_msg( + (check_msg->states[4].cn0 * 100 - 7.6198182106 * 100) < 0.05, + "incorrect value for states[4].cn0, expected 7.6198182106, is %f", + check_msg->states[4].cn0); + ck_assert_msg(check_msg->states[4].prn == 10, + "incorrect value for states[4].prn, expected 10, is %d", + check_msg->states[4].prn); + ck_assert_msg(check_msg->states[4].state == 1, + "incorrect value for states[4].state, expected 1, is %d", + check_msg->states[4].state); + ck_assert_msg( + (check_msg->states[5].cn0 * 100 - 5.20837116241 * 100) < 0.05, + "incorrect value for states[5].cn0, expected 5.20837116241, is %f", + check_msg->states[5].cn0); + ck_assert_msg(check_msg->states[5].prn == 13, + "incorrect value for states[5].prn, expected 13, is %d", + check_msg->states[5].prn); + ck_assert_msg(check_msg->states[5].state == 1, + "incorrect value for states[5].state, expected 1, is %d", + check_msg->states[5].state); + ck_assert_msg( + (check_msg->states[6].cn0 * 100 - 6.29358720779 * 100) < 0.05, + "incorrect value for states[6].cn0, expected 6.29358720779, is %f", + check_msg->states[6].cn0); + ck_assert_msg(check_msg->states[6].prn == 22, + "incorrect value for states[6].prn, expected 22, is %d", + check_msg->states[6].prn); + ck_assert_msg(check_msg->states[6].state == 1, + "incorrect value for states[6].state, expected 1, is %d", + check_msg->states[6].state); + ck_assert_msg( + (check_msg->states[7].cn0 * 100 - 13.2323417664 * 100) < 0.05, + "incorrect value for states[7].cn0, expected 13.2323417664, is %f", + check_msg->states[7].cn0); + ck_assert_msg(check_msg->states[7].prn == 30, + "incorrect value for states[7].prn, expected 30, is %d", + check_msg->states[7].prn); + ck_assert_msg(check_msg->states[7].state == 1, + "incorrect value for states[7].state, expected 1, is %d", + check_msg->states[7].state); + ck_assert_msg( + (check_msg->states[8].cn0 * 100 - 15.5473461151 * 100) < 0.05, + "incorrect value for states[8].cn0, expected 15.5473461151, is %f", + check_msg->states[8].cn0); + ck_assert_msg(check_msg->states[8].prn == 31, + "incorrect value for states[8].prn, expected 31, is %d", + check_msg->states[8].prn); + ck_assert_msg(check_msg->states[8].state == 1, + "incorrect value for states[8].state, expected 1, is %d", + check_msg->states[8].state); + ck_assert_msg( + (check_msg->states[9].cn0 * 100 - 4.13096427917 * 100) < 0.05, + "incorrect value for states[9].cn0, expected 4.13096427917, is %f", + check_msg->states[9].cn0); + ck_assert_msg(check_msg->states[9].prn == 25, + "incorrect value for states[9].prn, expected 25, is %d", + check_msg->states[9].prn); + ck_assert_msg(check_msg->states[9].state == 1, + "incorrect value for states[9].state, expected 1, is %d", + check_msg->states[9].state); + ck_assert_msg( + (check_msg->states[10].cn0 * 100 - 2.85682320595 * 100) < 0.05, + "incorrect value for states[10].cn0, expected 2.85682320595, is %f", + check_msg->states[10].cn0); + ck_assert_msg(check_msg->states[10].prn == 6, + "incorrect value for states[10].prn, expected 6, is %d", + check_msg->states[10].prn); + ck_assert_msg(check_msg->states[10].state == 1, + "incorrect value for states[10].state, expected 1, is %d", + check_msg->states[10].state); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -677,17 +957,26 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x16, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x16, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x16, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x16, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,22,0,195,4,66,1,0,55,143,120,66,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,248,89, }; + u8 encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 55, 143, 120, 66, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 248, 89, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_state_dep_a_t* test_msg = ( msg_tracking_state_dep_a_t* )test_msg_storage; + msg_tracking_state_dep_a_t* test_msg = + (msg_tracking_state_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->states) == 0) { // Cope with variable length arrays @@ -766,92 +1055,167 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA ) test_msg->states[10].cn0 = -1.0; test_msg->states[10].prn = 0; test_msg->states[10].state = 0; - sbp_payload_send(&sbp_state, 0x16, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x16, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x16, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_state_dep_a_t* check_msg = ( msg_tracking_state_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_state_dep_a_t* check_msg = + (msg_tracking_state_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->states[0].cn0*100 - 62.1398582458*100) < 0.05, "incorrect value for states[0].cn0, expected 62.1398582458, is %f", check_msg->states[0].cn0); - ck_assert_msg(check_msg->states[0].prn == 0, "incorrect value for states[0].prn, expected 0, is %d", check_msg->states[0].prn); - ck_assert_msg(check_msg->states[0].state == 1, "incorrect value for states[0].state, expected 1, is %d", check_msg->states[0].state); - ck_assert_msg((check_msg->states[1].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[1].cn0, expected -1.0, is %f", check_msg->states[1].cn0); - ck_assert_msg(check_msg->states[1].prn == 0, "incorrect value for states[1].prn, expected 0, is %d", check_msg->states[1].prn); - ck_assert_msg(check_msg->states[1].state == 0, "incorrect value for states[1].state, expected 0, is %d", check_msg->states[1].state); - ck_assert_msg((check_msg->states[2].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[2].cn0, expected -1.0, is %f", check_msg->states[2].cn0); - ck_assert_msg(check_msg->states[2].prn == 0, "incorrect value for states[2].prn, expected 0, is %d", check_msg->states[2].prn); - ck_assert_msg(check_msg->states[2].state == 0, "incorrect value for states[2].state, expected 0, is %d", check_msg->states[2].state); - ck_assert_msg((check_msg->states[3].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[3].cn0, expected -1.0, is %f", check_msg->states[3].cn0); - ck_assert_msg(check_msg->states[3].prn == 0, "incorrect value for states[3].prn, expected 0, is %d", check_msg->states[3].prn); - ck_assert_msg(check_msg->states[3].state == 0, "incorrect value for states[3].state, expected 0, is %d", check_msg->states[3].state); - ck_assert_msg((check_msg->states[4].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[4].cn0, expected -1.0, is %f", check_msg->states[4].cn0); - ck_assert_msg(check_msg->states[4].prn == 0, "incorrect value for states[4].prn, expected 0, is %d", check_msg->states[4].prn); - ck_assert_msg(check_msg->states[4].state == 0, "incorrect value for states[4].state, expected 0, is %d", check_msg->states[4].state); - ck_assert_msg((check_msg->states[5].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[5].cn0, expected -1.0, is %f", check_msg->states[5].cn0); - ck_assert_msg(check_msg->states[5].prn == 0, "incorrect value for states[5].prn, expected 0, is %d", check_msg->states[5].prn); - ck_assert_msg(check_msg->states[5].state == 0, "incorrect value for states[5].state, expected 0, is %d", check_msg->states[5].state); - ck_assert_msg((check_msg->states[6].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[6].cn0, expected -1.0, is %f", check_msg->states[6].cn0); - ck_assert_msg(check_msg->states[6].prn == 0, "incorrect value for states[6].prn, expected 0, is %d", check_msg->states[6].prn); - ck_assert_msg(check_msg->states[6].state == 0, "incorrect value for states[6].state, expected 0, is %d", check_msg->states[6].state); - ck_assert_msg((check_msg->states[7].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[7].cn0, expected -1.0, is %f", check_msg->states[7].cn0); - ck_assert_msg(check_msg->states[7].prn == 0, "incorrect value for states[7].prn, expected 0, is %d", check_msg->states[7].prn); - ck_assert_msg(check_msg->states[7].state == 0, "incorrect value for states[7].state, expected 0, is %d", check_msg->states[7].state); - ck_assert_msg((check_msg->states[8].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[8].cn0, expected -1.0, is %f", check_msg->states[8].cn0); - ck_assert_msg(check_msg->states[8].prn == 0, "incorrect value for states[8].prn, expected 0, is %d", check_msg->states[8].prn); - ck_assert_msg(check_msg->states[8].state == 0, "incorrect value for states[8].state, expected 0, is %d", check_msg->states[8].state); - ck_assert_msg((check_msg->states[9].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[9].cn0, expected -1.0, is %f", check_msg->states[9].cn0); - ck_assert_msg(check_msg->states[9].prn == 0, "incorrect value for states[9].prn, expected 0, is %d", check_msg->states[9].prn); - ck_assert_msg(check_msg->states[9].state == 0, "incorrect value for states[9].state, expected 0, is %d", check_msg->states[9].state); - ck_assert_msg((check_msg->states[10].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[10].cn0, expected -1.0, is %f", check_msg->states[10].cn0); - ck_assert_msg(check_msg->states[10].prn == 0, "incorrect value for states[10].prn, expected 0, is %d", check_msg->states[10].prn); - ck_assert_msg(check_msg->states[10].state == 0, "incorrect value for states[10].state, expected 0, is %d", check_msg->states[10].state); + ck_assert_msg( + (check_msg->states[0].cn0 * 100 - 62.1398582458 * 100) < 0.05, + "incorrect value for states[0].cn0, expected 62.1398582458, is %f", + check_msg->states[0].cn0); + ck_assert_msg(check_msg->states[0].prn == 0, + "incorrect value for states[0].prn, expected 0, is %d", + check_msg->states[0].prn); + ck_assert_msg(check_msg->states[0].state == 1, + "incorrect value for states[0].state, expected 1, is %d", + check_msg->states[0].state); + ck_assert_msg((check_msg->states[1].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[1].cn0, expected -1.0, is %f", + check_msg->states[1].cn0); + ck_assert_msg(check_msg->states[1].prn == 0, + "incorrect value for states[1].prn, expected 0, is %d", + check_msg->states[1].prn); + ck_assert_msg(check_msg->states[1].state == 0, + "incorrect value for states[1].state, expected 0, is %d", + check_msg->states[1].state); + ck_assert_msg((check_msg->states[2].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[2].cn0, expected -1.0, is %f", + check_msg->states[2].cn0); + ck_assert_msg(check_msg->states[2].prn == 0, + "incorrect value for states[2].prn, expected 0, is %d", + check_msg->states[2].prn); + ck_assert_msg(check_msg->states[2].state == 0, + "incorrect value for states[2].state, expected 0, is %d", + check_msg->states[2].state); + ck_assert_msg((check_msg->states[3].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[3].cn0, expected -1.0, is %f", + check_msg->states[3].cn0); + ck_assert_msg(check_msg->states[3].prn == 0, + "incorrect value for states[3].prn, expected 0, is %d", + check_msg->states[3].prn); + ck_assert_msg(check_msg->states[3].state == 0, + "incorrect value for states[3].state, expected 0, is %d", + check_msg->states[3].state); + ck_assert_msg((check_msg->states[4].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[4].cn0, expected -1.0, is %f", + check_msg->states[4].cn0); + ck_assert_msg(check_msg->states[4].prn == 0, + "incorrect value for states[4].prn, expected 0, is %d", + check_msg->states[4].prn); + ck_assert_msg(check_msg->states[4].state == 0, + "incorrect value for states[4].state, expected 0, is %d", + check_msg->states[4].state); + ck_assert_msg((check_msg->states[5].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[5].cn0, expected -1.0, is %f", + check_msg->states[5].cn0); + ck_assert_msg(check_msg->states[5].prn == 0, + "incorrect value for states[5].prn, expected 0, is %d", + check_msg->states[5].prn); + ck_assert_msg(check_msg->states[5].state == 0, + "incorrect value for states[5].state, expected 0, is %d", + check_msg->states[5].state); + ck_assert_msg((check_msg->states[6].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[6].cn0, expected -1.0, is %f", + check_msg->states[6].cn0); + ck_assert_msg(check_msg->states[6].prn == 0, + "incorrect value for states[6].prn, expected 0, is %d", + check_msg->states[6].prn); + ck_assert_msg(check_msg->states[6].state == 0, + "incorrect value for states[6].state, expected 0, is %d", + check_msg->states[6].state); + ck_assert_msg((check_msg->states[7].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[7].cn0, expected -1.0, is %f", + check_msg->states[7].cn0); + ck_assert_msg(check_msg->states[7].prn == 0, + "incorrect value for states[7].prn, expected 0, is %d", + check_msg->states[7].prn); + ck_assert_msg(check_msg->states[7].state == 0, + "incorrect value for states[7].state, expected 0, is %d", + check_msg->states[7].state); + ck_assert_msg((check_msg->states[8].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[8].cn0, expected -1.0, is %f", + check_msg->states[8].cn0); + ck_assert_msg(check_msg->states[8].prn == 0, + "incorrect value for states[8].prn, expected 0, is %d", + check_msg->states[8].prn); + ck_assert_msg(check_msg->states[8].state == 0, + "incorrect value for states[8].state, expected 0, is %d", + check_msg->states[8].state); + ck_assert_msg((check_msg->states[9].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[9].cn0, expected -1.0, is %f", + check_msg->states[9].cn0); + ck_assert_msg(check_msg->states[9].prn == 0, + "incorrect value for states[9].prn, expected 0, is %d", + check_msg->states[9].prn); + ck_assert_msg(check_msg->states[9].state == 0, + "incorrect value for states[9].state, expected 0, is %d", + check_msg->states[9].state); + ck_assert_msg((check_msg->states[10].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[10].cn0, expected -1.0, is %f", + check_msg->states[10].cn0); + ck_assert_msg(check_msg->states[10].prn == 0, + "incorrect value for states[10].prn, expected 0, is %d", + check_msg->states[10].prn); + ck_assert_msg(check_msg->states[10].state == 0, + "incorrect value for states[10].state, expected 0, is %d", + check_msg->states[10].state); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -859,17 +1223,26 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x16, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x16, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x16, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x16, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,22,0,195,4,66,1,0,218,14,19,66,1,2,210,3,21,65,1,3,234,214,134,65,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,84,101, }; + u8 encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 218, 14, 19, 66, 1, 2, 210, + 3, 21, 65, 1, 3, 234, 214, 134, 65, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 84, 101, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_state_dep_a_t* test_msg = ( msg_tracking_state_dep_a_t* )test_msg_storage; + msg_tracking_state_dep_a_t* test_msg = + (msg_tracking_state_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->states) == 0) { // Cope with variable length arrays @@ -948,92 +1321,169 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA ) test_msg->states[10].cn0 = -1.0; test_msg->states[10].prn = 0; test_msg->states[10].state = 0; - sbp_payload_send(&sbp_state, 0x16, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x16, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x16, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_state_dep_a_t* check_msg = ( msg_tracking_state_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_state_dep_a_t* check_msg = + (msg_tracking_state_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->states[0].cn0*100 - 36.764503479*100) < 0.05, "incorrect value for states[0].cn0, expected 36.764503479, is %f", check_msg->states[0].cn0); - ck_assert_msg(check_msg->states[0].prn == 0, "incorrect value for states[0].prn, expected 0, is %d", check_msg->states[0].prn); - ck_assert_msg(check_msg->states[0].state == 1, "incorrect value for states[0].state, expected 1, is %d", check_msg->states[0].state); - ck_assert_msg((check_msg->states[1].cn0*100 - 9.31343269348*100) < 0.05, "incorrect value for states[1].cn0, expected 9.31343269348, is %f", check_msg->states[1].cn0); - ck_assert_msg(check_msg->states[1].prn == 2, "incorrect value for states[1].prn, expected 2, is %d", check_msg->states[1].prn); - ck_assert_msg(check_msg->states[1].state == 1, "incorrect value for states[1].state, expected 1, is %d", check_msg->states[1].state); - ck_assert_msg((check_msg->states[2].cn0*100 - 16.8549385071*100) < 0.05, "incorrect value for states[2].cn0, expected 16.8549385071, is %f", check_msg->states[2].cn0); - ck_assert_msg(check_msg->states[2].prn == 3, "incorrect value for states[2].prn, expected 3, is %d", check_msg->states[2].prn); - ck_assert_msg(check_msg->states[2].state == 1, "incorrect value for states[2].state, expected 1, is %d", check_msg->states[2].state); - ck_assert_msg((check_msg->states[3].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[3].cn0, expected -1.0, is %f", check_msg->states[3].cn0); - ck_assert_msg(check_msg->states[3].prn == 0, "incorrect value for states[3].prn, expected 0, is %d", check_msg->states[3].prn); - ck_assert_msg(check_msg->states[3].state == 0, "incorrect value for states[3].state, expected 0, is %d", check_msg->states[3].state); - ck_assert_msg((check_msg->states[4].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[4].cn0, expected -1.0, is %f", check_msg->states[4].cn0); - ck_assert_msg(check_msg->states[4].prn == 0, "incorrect value for states[4].prn, expected 0, is %d", check_msg->states[4].prn); - ck_assert_msg(check_msg->states[4].state == 0, "incorrect value for states[4].state, expected 0, is %d", check_msg->states[4].state); - ck_assert_msg((check_msg->states[5].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[5].cn0, expected -1.0, is %f", check_msg->states[5].cn0); - ck_assert_msg(check_msg->states[5].prn == 0, "incorrect value for states[5].prn, expected 0, is %d", check_msg->states[5].prn); - ck_assert_msg(check_msg->states[5].state == 0, "incorrect value for states[5].state, expected 0, is %d", check_msg->states[5].state); - ck_assert_msg((check_msg->states[6].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[6].cn0, expected -1.0, is %f", check_msg->states[6].cn0); - ck_assert_msg(check_msg->states[6].prn == 0, "incorrect value for states[6].prn, expected 0, is %d", check_msg->states[6].prn); - ck_assert_msg(check_msg->states[6].state == 0, "incorrect value for states[6].state, expected 0, is %d", check_msg->states[6].state); - ck_assert_msg((check_msg->states[7].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[7].cn0, expected -1.0, is %f", check_msg->states[7].cn0); - ck_assert_msg(check_msg->states[7].prn == 0, "incorrect value for states[7].prn, expected 0, is %d", check_msg->states[7].prn); - ck_assert_msg(check_msg->states[7].state == 0, "incorrect value for states[7].state, expected 0, is %d", check_msg->states[7].state); - ck_assert_msg((check_msg->states[8].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[8].cn0, expected -1.0, is %f", check_msg->states[8].cn0); - ck_assert_msg(check_msg->states[8].prn == 0, "incorrect value for states[8].prn, expected 0, is %d", check_msg->states[8].prn); - ck_assert_msg(check_msg->states[8].state == 0, "incorrect value for states[8].state, expected 0, is %d", check_msg->states[8].state); - ck_assert_msg((check_msg->states[9].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[9].cn0, expected -1.0, is %f", check_msg->states[9].cn0); - ck_assert_msg(check_msg->states[9].prn == 0, "incorrect value for states[9].prn, expected 0, is %d", check_msg->states[9].prn); - ck_assert_msg(check_msg->states[9].state == 0, "incorrect value for states[9].state, expected 0, is %d", check_msg->states[9].state); - ck_assert_msg((check_msg->states[10].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[10].cn0, expected -1.0, is %f", check_msg->states[10].cn0); - ck_assert_msg(check_msg->states[10].prn == 0, "incorrect value for states[10].prn, expected 0, is %d", check_msg->states[10].prn); - ck_assert_msg(check_msg->states[10].state == 0, "incorrect value for states[10].state, expected 0, is %d", check_msg->states[10].state); + ck_assert_msg( + (check_msg->states[0].cn0 * 100 - 36.764503479 * 100) < 0.05, + "incorrect value for states[0].cn0, expected 36.764503479, is %f", + check_msg->states[0].cn0); + ck_assert_msg(check_msg->states[0].prn == 0, + "incorrect value for states[0].prn, expected 0, is %d", + check_msg->states[0].prn); + ck_assert_msg(check_msg->states[0].state == 1, + "incorrect value for states[0].state, expected 1, is %d", + check_msg->states[0].state); + ck_assert_msg( + (check_msg->states[1].cn0 * 100 - 9.31343269348 * 100) < 0.05, + "incorrect value for states[1].cn0, expected 9.31343269348, is %f", + check_msg->states[1].cn0); + ck_assert_msg(check_msg->states[1].prn == 2, + "incorrect value for states[1].prn, expected 2, is %d", + check_msg->states[1].prn); + ck_assert_msg(check_msg->states[1].state == 1, + "incorrect value for states[1].state, expected 1, is %d", + check_msg->states[1].state); + ck_assert_msg( + (check_msg->states[2].cn0 * 100 - 16.8549385071 * 100) < 0.05, + "incorrect value for states[2].cn0, expected 16.8549385071, is %f", + check_msg->states[2].cn0); + ck_assert_msg(check_msg->states[2].prn == 3, + "incorrect value for states[2].prn, expected 3, is %d", + check_msg->states[2].prn); + ck_assert_msg(check_msg->states[2].state == 1, + "incorrect value for states[2].state, expected 1, is %d", + check_msg->states[2].state); + ck_assert_msg((check_msg->states[3].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[3].cn0, expected -1.0, is %f", + check_msg->states[3].cn0); + ck_assert_msg(check_msg->states[3].prn == 0, + "incorrect value for states[3].prn, expected 0, is %d", + check_msg->states[3].prn); + ck_assert_msg(check_msg->states[3].state == 0, + "incorrect value for states[3].state, expected 0, is %d", + check_msg->states[3].state); + ck_assert_msg((check_msg->states[4].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[4].cn0, expected -1.0, is %f", + check_msg->states[4].cn0); + ck_assert_msg(check_msg->states[4].prn == 0, + "incorrect value for states[4].prn, expected 0, is %d", + check_msg->states[4].prn); + ck_assert_msg(check_msg->states[4].state == 0, + "incorrect value for states[4].state, expected 0, is %d", + check_msg->states[4].state); + ck_assert_msg((check_msg->states[5].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[5].cn0, expected -1.0, is %f", + check_msg->states[5].cn0); + ck_assert_msg(check_msg->states[5].prn == 0, + "incorrect value for states[5].prn, expected 0, is %d", + check_msg->states[5].prn); + ck_assert_msg(check_msg->states[5].state == 0, + "incorrect value for states[5].state, expected 0, is %d", + check_msg->states[5].state); + ck_assert_msg((check_msg->states[6].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[6].cn0, expected -1.0, is %f", + check_msg->states[6].cn0); + ck_assert_msg(check_msg->states[6].prn == 0, + "incorrect value for states[6].prn, expected 0, is %d", + check_msg->states[6].prn); + ck_assert_msg(check_msg->states[6].state == 0, + "incorrect value for states[6].state, expected 0, is %d", + check_msg->states[6].state); + ck_assert_msg((check_msg->states[7].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[7].cn0, expected -1.0, is %f", + check_msg->states[7].cn0); + ck_assert_msg(check_msg->states[7].prn == 0, + "incorrect value for states[7].prn, expected 0, is %d", + check_msg->states[7].prn); + ck_assert_msg(check_msg->states[7].state == 0, + "incorrect value for states[7].state, expected 0, is %d", + check_msg->states[7].state); + ck_assert_msg((check_msg->states[8].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[8].cn0, expected -1.0, is %f", + check_msg->states[8].cn0); + ck_assert_msg(check_msg->states[8].prn == 0, + "incorrect value for states[8].prn, expected 0, is %d", + check_msg->states[8].prn); + ck_assert_msg(check_msg->states[8].state == 0, + "incorrect value for states[8].state, expected 0, is %d", + check_msg->states[8].state); + ck_assert_msg((check_msg->states[9].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[9].cn0, expected -1.0, is %f", + check_msg->states[9].cn0); + ck_assert_msg(check_msg->states[9].prn == 0, + "incorrect value for states[9].prn, expected 0, is %d", + check_msg->states[9].prn); + ck_assert_msg(check_msg->states[9].state == 0, + "incorrect value for states[9].state, expected 0, is %d", + check_msg->states[9].state); + ck_assert_msg((check_msg->states[10].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[10].cn0, expected -1.0, is %f", + check_msg->states[10].cn0); + ck_assert_msg(check_msg->states[10].prn == 0, + "incorrect value for states[10].prn, expected 0, is %d", + check_msg->states[10].prn); + ck_assert_msg(check_msg->states[10].state == 0, + "incorrect value for states[10].state, expected 0, is %d", + check_msg->states[10].state); } // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -1041,17 +1491,26 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x16, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x16, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x16, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x16, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,22,0,195,4,66,1,0,98,39,219,65,1,2,0,0,56,64,1,3,121,123,7,65,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,37,123, }; + u8 encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 98, 39, 219, 65, 1, 2, 0, + 0, 56, 64, 1, 3, 121, 123, 7, 65, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 37, 123, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_tracking_state_dep_a_t* test_msg = ( msg_tracking_state_dep_a_t* )test_msg_storage; + msg_tracking_state_dep_a_t* test_msg = + (msg_tracking_state_dep_a_t*)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->states) == 0) { // Cope with variable length arrays @@ -1130,96 +1589,174 @@ START_TEST( test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA ) test_msg->states[10].cn0 = -1.0; test_msg->states[10].prn = 0; test_msg->states[10].state = 0; - sbp_payload_send(&sbp_state, 0x16, 1219, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x16, 1219, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 1219, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 1219, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x16, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_tracking_state_dep_a_t* check_msg = ( msg_tracking_state_dep_a_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_tracking_state_dep_a_t* check_msg = + (msg_tracking_state_dep_a_t*)((void*)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg((check_msg->states[0].cn0*100 - 27.3942298889*100) < 0.05, "incorrect value for states[0].cn0, expected 27.3942298889, is %f", check_msg->states[0].cn0); - ck_assert_msg(check_msg->states[0].prn == 0, "incorrect value for states[0].prn, expected 0, is %d", check_msg->states[0].prn); - ck_assert_msg(check_msg->states[0].state == 1, "incorrect value for states[0].state, expected 1, is %d", check_msg->states[0].state); - ck_assert_msg((check_msg->states[1].cn0*100 - 2.875*100) < 0.05, "incorrect value for states[1].cn0, expected 2.875, is %f", check_msg->states[1].cn0); - ck_assert_msg(check_msg->states[1].prn == 2, "incorrect value for states[1].prn, expected 2, is %d", check_msg->states[1].prn); - ck_assert_msg(check_msg->states[1].state == 1, "incorrect value for states[1].state, expected 1, is %d", check_msg->states[1].state); - ck_assert_msg((check_msg->states[2].cn0*100 - 8.46764469147*100) < 0.05, "incorrect value for states[2].cn0, expected 8.46764469147, is %f", check_msg->states[2].cn0); - ck_assert_msg(check_msg->states[2].prn == 3, "incorrect value for states[2].prn, expected 3, is %d", check_msg->states[2].prn); - ck_assert_msg(check_msg->states[2].state == 1, "incorrect value for states[2].state, expected 1, is %d", check_msg->states[2].state); - ck_assert_msg((check_msg->states[3].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[3].cn0, expected -1.0, is %f", check_msg->states[3].cn0); - ck_assert_msg(check_msg->states[3].prn == 0, "incorrect value for states[3].prn, expected 0, is %d", check_msg->states[3].prn); - ck_assert_msg(check_msg->states[3].state == 0, "incorrect value for states[3].state, expected 0, is %d", check_msg->states[3].state); - ck_assert_msg((check_msg->states[4].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[4].cn0, expected -1.0, is %f", check_msg->states[4].cn0); - ck_assert_msg(check_msg->states[4].prn == 0, "incorrect value for states[4].prn, expected 0, is %d", check_msg->states[4].prn); - ck_assert_msg(check_msg->states[4].state == 0, "incorrect value for states[4].state, expected 0, is %d", check_msg->states[4].state); - ck_assert_msg((check_msg->states[5].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[5].cn0, expected -1.0, is %f", check_msg->states[5].cn0); - ck_assert_msg(check_msg->states[5].prn == 0, "incorrect value for states[5].prn, expected 0, is %d", check_msg->states[5].prn); - ck_assert_msg(check_msg->states[5].state == 0, "incorrect value for states[5].state, expected 0, is %d", check_msg->states[5].state); - ck_assert_msg((check_msg->states[6].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[6].cn0, expected -1.0, is %f", check_msg->states[6].cn0); - ck_assert_msg(check_msg->states[6].prn == 0, "incorrect value for states[6].prn, expected 0, is %d", check_msg->states[6].prn); - ck_assert_msg(check_msg->states[6].state == 0, "incorrect value for states[6].state, expected 0, is %d", check_msg->states[6].state); - ck_assert_msg((check_msg->states[7].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[7].cn0, expected -1.0, is %f", check_msg->states[7].cn0); - ck_assert_msg(check_msg->states[7].prn == 0, "incorrect value for states[7].prn, expected 0, is %d", check_msg->states[7].prn); - ck_assert_msg(check_msg->states[7].state == 0, "incorrect value for states[7].state, expected 0, is %d", check_msg->states[7].state); - ck_assert_msg((check_msg->states[8].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[8].cn0, expected -1.0, is %f", check_msg->states[8].cn0); - ck_assert_msg(check_msg->states[8].prn == 0, "incorrect value for states[8].prn, expected 0, is %d", check_msg->states[8].prn); - ck_assert_msg(check_msg->states[8].state == 0, "incorrect value for states[8].state, expected 0, is %d", check_msg->states[8].state); - ck_assert_msg((check_msg->states[9].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[9].cn0, expected -1.0, is %f", check_msg->states[9].cn0); - ck_assert_msg(check_msg->states[9].prn == 0, "incorrect value for states[9].prn, expected 0, is %d", check_msg->states[9].prn); - ck_assert_msg(check_msg->states[9].state == 0, "incorrect value for states[9].state, expected 0, is %d", check_msg->states[9].state); - ck_assert_msg((check_msg->states[10].cn0*100 - -1.0*100) < 0.05, "incorrect value for states[10].cn0, expected -1.0, is %f", check_msg->states[10].cn0); - ck_assert_msg(check_msg->states[10].prn == 0, "incorrect value for states[10].prn, expected 0, is %d", check_msg->states[10].prn); - ck_assert_msg(check_msg->states[10].state == 0, "incorrect value for states[10].state, expected 0, is %d", check_msg->states[10].state); + ck_assert_msg( + (check_msg->states[0].cn0 * 100 - 27.3942298889 * 100) < 0.05, + "incorrect value for states[0].cn0, expected 27.3942298889, is %f", + check_msg->states[0].cn0); + ck_assert_msg(check_msg->states[0].prn == 0, + "incorrect value for states[0].prn, expected 0, is %d", + check_msg->states[0].prn); + ck_assert_msg(check_msg->states[0].state == 1, + "incorrect value for states[0].state, expected 1, is %d", + check_msg->states[0].state); + ck_assert_msg((check_msg->states[1].cn0 * 100 - 2.875 * 100) < 0.05, + "incorrect value for states[1].cn0, expected 2.875, is %f", + check_msg->states[1].cn0); + ck_assert_msg(check_msg->states[1].prn == 2, + "incorrect value for states[1].prn, expected 2, is %d", + check_msg->states[1].prn); + ck_assert_msg(check_msg->states[1].state == 1, + "incorrect value for states[1].state, expected 1, is %d", + check_msg->states[1].state); + ck_assert_msg( + (check_msg->states[2].cn0 * 100 - 8.46764469147 * 100) < 0.05, + "incorrect value for states[2].cn0, expected 8.46764469147, is %f", + check_msg->states[2].cn0); + ck_assert_msg(check_msg->states[2].prn == 3, + "incorrect value for states[2].prn, expected 3, is %d", + check_msg->states[2].prn); + ck_assert_msg(check_msg->states[2].state == 1, + "incorrect value for states[2].state, expected 1, is %d", + check_msg->states[2].state); + ck_assert_msg((check_msg->states[3].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[3].cn0, expected -1.0, is %f", + check_msg->states[3].cn0); + ck_assert_msg(check_msg->states[3].prn == 0, + "incorrect value for states[3].prn, expected 0, is %d", + check_msg->states[3].prn); + ck_assert_msg(check_msg->states[3].state == 0, + "incorrect value for states[3].state, expected 0, is %d", + check_msg->states[3].state); + ck_assert_msg((check_msg->states[4].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[4].cn0, expected -1.0, is %f", + check_msg->states[4].cn0); + ck_assert_msg(check_msg->states[4].prn == 0, + "incorrect value for states[4].prn, expected 0, is %d", + check_msg->states[4].prn); + ck_assert_msg(check_msg->states[4].state == 0, + "incorrect value for states[4].state, expected 0, is %d", + check_msg->states[4].state); + ck_assert_msg((check_msg->states[5].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[5].cn0, expected -1.0, is %f", + check_msg->states[5].cn0); + ck_assert_msg(check_msg->states[5].prn == 0, + "incorrect value for states[5].prn, expected 0, is %d", + check_msg->states[5].prn); + ck_assert_msg(check_msg->states[5].state == 0, + "incorrect value for states[5].state, expected 0, is %d", + check_msg->states[5].state); + ck_assert_msg((check_msg->states[6].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[6].cn0, expected -1.0, is %f", + check_msg->states[6].cn0); + ck_assert_msg(check_msg->states[6].prn == 0, + "incorrect value for states[6].prn, expected 0, is %d", + check_msg->states[6].prn); + ck_assert_msg(check_msg->states[6].state == 0, + "incorrect value for states[6].state, expected 0, is %d", + check_msg->states[6].state); + ck_assert_msg((check_msg->states[7].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[7].cn0, expected -1.0, is %f", + check_msg->states[7].cn0); + ck_assert_msg(check_msg->states[7].prn == 0, + "incorrect value for states[7].prn, expected 0, is %d", + check_msg->states[7].prn); + ck_assert_msg(check_msg->states[7].state == 0, + "incorrect value for states[7].state, expected 0, is %d", + check_msg->states[7].state); + ck_assert_msg((check_msg->states[8].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[8].cn0, expected -1.0, is %f", + check_msg->states[8].cn0); + ck_assert_msg(check_msg->states[8].prn == 0, + "incorrect value for states[8].prn, expected 0, is %d", + check_msg->states[8].prn); + ck_assert_msg(check_msg->states[8].state == 0, + "incorrect value for states[8].state, expected 0, is %d", + check_msg->states[8].state); + ck_assert_msg((check_msg->states[9].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[9].cn0, expected -1.0, is %f", + check_msg->states[9].cn0); + ck_assert_msg(check_msg->states[9].prn == 0, + "incorrect value for states[9].prn, expected 0, is %d", + check_msg->states[9].prn); + ck_assert_msg(check_msg->states[9].state == 0, + "incorrect value for states[9].state, expected 0, is %d", + check_msg->states[9].state); + ck_assert_msg((check_msg->states[10].cn0 * 100 - -1.0 * 100) < 0.05, + "incorrect value for states[10].cn0, expected -1.0, is %f", + check_msg->states[10].cn0); + ck_assert_msg(check_msg->states[10].prn == 0, + "incorrect value for states[10].prn, expected 0, is %d", + check_msg->states[10].prn); + ck_assert_msg(check_msg->states[10].state == 0, + "incorrect value for states[10].state, expected 0, is %d", + check_msg->states[10].state); } } END_TEST -Suite* legacy_auto_check_sbp_tracking_MsgtrackingStateDepA_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_tracking_MsgtrackingStateDepA"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA"); - tcase_add_test(tc_acq, test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA); +Suite* legacy_auto_check_sbp_tracking_MsgtrackingStateDepA_suite(void) { + Suite* s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_tracking_MsgtrackingStateDepA"); + TCase* tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_user_MsgUserData.c b/c/test/legacy/auto_check_sbp_user_MsgUserData.c index f356699f1..f14f5789c 100644 --- a/c/test/legacy/auto_check_sbp_user_MsgUserData.c +++ b/c/test/legacy/auto_check_sbp_user_MsgUserData.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/user/test_MsgUserData.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/user/test_MsgUserData.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_user_MsgUserData ) -{ +START_TEST(test_legacy_auto_check_sbp_user_MsgUserData) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_user_MsgUserData ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,17 +128,39 @@ START_TEST( test_legacy_auto_check_sbp_user_MsgUserData ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x800, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x800, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x800, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x800, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,0,8,126,33,255,53,5,172,138,50,49,206,234,149,204,113,31,108,188,179,154,156,167,145,139,42,207,126,242,193,9,58,75,8,135,11,92,131,245,24,90,255,30,58,31,109,148,56,178,140,30,159,70,17,170,50,148,1,99,112,88,217,36,84,34,234,82,144,144,97,96,75,174,58,219,180,148,247,59,2,116,214,114,55,134,54,119,108,128,73,181,20,233,23,23,73,119,136,231,189,26,174,128,93,30,76,45,109,134,81,0,116,158,127,40,133,208,134,127,140,232,183,184,108,6,228,54,238,59,220,30,228,212,50,182,97,20,41,76,227,88,12,95,112,209,183,127,4,165,189,44,239,232,132,9,114,184,249,208,246,194,250,2,97,173,157,202,172,180,150,213,193,177,209,156,20,174,18,73,132,215,115,128,175,169,116,132,100,72,45,25,14,205,213,145,68,137,249,54,40,174,215,148,166,190,63,118,6,165,212,74,68,200,38,139,212,112,45,167,236,255,106,92,132,59,61,233,3,246,158,83,134,246,154,17,0,6,56,216,19,216,70,71,161,184,5,177,45,37,98,56,149,0,73,221,105,239,168,205,85,81,245, }; + u8 encoded_frame[] = { + 85, 0, 8, 126, 33, 255, 53, 5, 172, 138, 50, 49, 206, 234, + 149, 204, 113, 31, 108, 188, 179, 154, 156, 167, 145, 139, 42, 207, + 126, 242, 193, 9, 58, 75, 8, 135, 11, 92, 131, 245, 24, 90, + 255, 30, 58, 31, 109, 148, 56, 178, 140, 30, 159, 70, 17, 170, + 50, 148, 1, 99, 112, 88, 217, 36, 84, 34, 234, 82, 144, 144, + 97, 96, 75, 174, 58, 219, 180, 148, 247, 59, 2, 116, 214, 114, + 55, 134, 54, 119, 108, 128, 73, 181, 20, 233, 23, 23, 73, 119, + 136, 231, 189, 26, 174, 128, 93, 30, 76, 45, 109, 134, 81, 0, + 116, 158, 127, 40, 133, 208, 134, 127, 140, 232, 183, 184, 108, 6, + 228, 54, 238, 59, 220, 30, 228, 212, 50, 182, 97, 20, 41, 76, + 227, 88, 12, 95, 112, 209, 183, 127, 4, 165, 189, 44, 239, 232, + 132, 9, 114, 184, 249, 208, 246, 194, 250, 2, 97, 173, 157, 202, + 172, 180, 150, 213, 193, 177, 209, 156, 20, 174, 18, 73, 132, 215, + 115, 128, 175, 169, 116, 132, 100, 72, 45, 25, 14, 205, 213, 145, + 68, 137, 249, 54, 40, 174, 215, 148, 166, 190, 63, 118, 6, 165, + 212, 74, 68, 200, 38, 139, 212, 112, 45, 167, 236, 255, 106, 92, + 132, 59, 61, 233, 3, 246, 158, 83, 134, 246, 154, 17, 0, 6, + 56, 216, 19, 216, 70, 71, 161, 184, 5, 177, 45, 37, 98, 56, + 149, 0, 73, 221, 105, 239, 168, 205, 85, 81, 245, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_user_data_t* test_msg = ( msg_user_data_t* )test_msg_storage; + msg_user_data_t *test_msg = (msg_user_data_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->contents) == 0) { // Cope with variable length arrays @@ -1418,317 +1437,834 @@ START_TEST( test_legacy_auto_check_sbp_user_MsgUserData ) test_msg_len += sizeof(test_msg->contents[0]); } test_msg->contents[254] = 85; - sbp_payload_send(&sbp_state, 0x800, 8574, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x800, 8574, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 8574, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 8574, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x800, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_user_data_t* check_msg = ( msg_user_data_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_user_data_t *check_msg = (msg_user_data_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->contents[0] == 53, "incorrect value for contents[0], expected 53, is %d", check_msg->contents[0]); - ck_assert_msg(check_msg->contents[1] == 5, "incorrect value for contents[1], expected 5, is %d", check_msg->contents[1]); - ck_assert_msg(check_msg->contents[2] == 172, "incorrect value for contents[2], expected 172, is %d", check_msg->contents[2]); - ck_assert_msg(check_msg->contents[3] == 138, "incorrect value for contents[3], expected 138, is %d", check_msg->contents[3]); - ck_assert_msg(check_msg->contents[4] == 50, "incorrect value for contents[4], expected 50, is %d", check_msg->contents[4]); - ck_assert_msg(check_msg->contents[5] == 49, "incorrect value for contents[5], expected 49, is %d", check_msg->contents[5]); - ck_assert_msg(check_msg->contents[6] == 206, "incorrect value for contents[6], expected 206, is %d", check_msg->contents[6]); - ck_assert_msg(check_msg->contents[7] == 234, "incorrect value for contents[7], expected 234, is %d", check_msg->contents[7]); - ck_assert_msg(check_msg->contents[8] == 149, "incorrect value for contents[8], expected 149, is %d", check_msg->contents[8]); - ck_assert_msg(check_msg->contents[9] == 204, "incorrect value for contents[9], expected 204, is %d", check_msg->contents[9]); - ck_assert_msg(check_msg->contents[10] == 113, "incorrect value for contents[10], expected 113, is %d", check_msg->contents[10]); - ck_assert_msg(check_msg->contents[11] == 31, "incorrect value for contents[11], expected 31, is %d", check_msg->contents[11]); - ck_assert_msg(check_msg->contents[12] == 108, "incorrect value for contents[12], expected 108, is %d", check_msg->contents[12]); - ck_assert_msg(check_msg->contents[13] == 188, "incorrect value for contents[13], expected 188, is %d", check_msg->contents[13]); - ck_assert_msg(check_msg->contents[14] == 179, "incorrect value for contents[14], expected 179, is %d", check_msg->contents[14]); - ck_assert_msg(check_msg->contents[15] == 154, "incorrect value for contents[15], expected 154, is %d", check_msg->contents[15]); - ck_assert_msg(check_msg->contents[16] == 156, "incorrect value for contents[16], expected 156, is %d", check_msg->contents[16]); - ck_assert_msg(check_msg->contents[17] == 167, "incorrect value for contents[17], expected 167, is %d", check_msg->contents[17]); - ck_assert_msg(check_msg->contents[18] == 145, "incorrect value for contents[18], expected 145, is %d", check_msg->contents[18]); - ck_assert_msg(check_msg->contents[19] == 139, "incorrect value for contents[19], expected 139, is %d", check_msg->contents[19]); - ck_assert_msg(check_msg->contents[20] == 42, "incorrect value for contents[20], expected 42, is %d", check_msg->contents[20]); - ck_assert_msg(check_msg->contents[21] == 207, "incorrect value for contents[21], expected 207, is %d", check_msg->contents[21]); - ck_assert_msg(check_msg->contents[22] == 126, "incorrect value for contents[22], expected 126, is %d", check_msg->contents[22]); - ck_assert_msg(check_msg->contents[23] == 242, "incorrect value for contents[23], expected 242, is %d", check_msg->contents[23]); - ck_assert_msg(check_msg->contents[24] == 193, "incorrect value for contents[24], expected 193, is %d", check_msg->contents[24]); - ck_assert_msg(check_msg->contents[25] == 9, "incorrect value for contents[25], expected 9, is %d", check_msg->contents[25]); - ck_assert_msg(check_msg->contents[26] == 58, "incorrect value for contents[26], expected 58, is %d", check_msg->contents[26]); - ck_assert_msg(check_msg->contents[27] == 75, "incorrect value for contents[27], expected 75, is %d", check_msg->contents[27]); - ck_assert_msg(check_msg->contents[28] == 8, "incorrect value for contents[28], expected 8, is %d", check_msg->contents[28]); - ck_assert_msg(check_msg->contents[29] == 135, "incorrect value for contents[29], expected 135, is %d", check_msg->contents[29]); - ck_assert_msg(check_msg->contents[30] == 11, "incorrect value for contents[30], expected 11, is %d", check_msg->contents[30]); - ck_assert_msg(check_msg->contents[31] == 92, "incorrect value for contents[31], expected 92, is %d", check_msg->contents[31]); - ck_assert_msg(check_msg->contents[32] == 131, "incorrect value for contents[32], expected 131, is %d", check_msg->contents[32]); - ck_assert_msg(check_msg->contents[33] == 245, "incorrect value for contents[33], expected 245, is %d", check_msg->contents[33]); - ck_assert_msg(check_msg->contents[34] == 24, "incorrect value for contents[34], expected 24, is %d", check_msg->contents[34]); - ck_assert_msg(check_msg->contents[35] == 90, "incorrect value for contents[35], expected 90, is %d", check_msg->contents[35]); - ck_assert_msg(check_msg->contents[36] == 255, "incorrect value for contents[36], expected 255, is %d", check_msg->contents[36]); - ck_assert_msg(check_msg->contents[37] == 30, "incorrect value for contents[37], expected 30, is %d", check_msg->contents[37]); - ck_assert_msg(check_msg->contents[38] == 58, "incorrect value for contents[38], expected 58, is %d", check_msg->contents[38]); - ck_assert_msg(check_msg->contents[39] == 31, "incorrect value for contents[39], expected 31, is %d", check_msg->contents[39]); - ck_assert_msg(check_msg->contents[40] == 109, "incorrect value for contents[40], expected 109, is %d", check_msg->contents[40]); - ck_assert_msg(check_msg->contents[41] == 148, "incorrect value for contents[41], expected 148, is %d", check_msg->contents[41]); - ck_assert_msg(check_msg->contents[42] == 56, "incorrect value for contents[42], expected 56, is %d", check_msg->contents[42]); - ck_assert_msg(check_msg->contents[43] == 178, "incorrect value for contents[43], expected 178, is %d", check_msg->contents[43]); - ck_assert_msg(check_msg->contents[44] == 140, "incorrect value for contents[44], expected 140, is %d", check_msg->contents[44]); - ck_assert_msg(check_msg->contents[45] == 30, "incorrect value for contents[45], expected 30, is %d", check_msg->contents[45]); - ck_assert_msg(check_msg->contents[46] == 159, "incorrect value for contents[46], expected 159, is %d", check_msg->contents[46]); - ck_assert_msg(check_msg->contents[47] == 70, "incorrect value for contents[47], expected 70, is %d", check_msg->contents[47]); - ck_assert_msg(check_msg->contents[48] == 17, "incorrect value for contents[48], expected 17, is %d", check_msg->contents[48]); - ck_assert_msg(check_msg->contents[49] == 170, "incorrect value for contents[49], expected 170, is %d", check_msg->contents[49]); - ck_assert_msg(check_msg->contents[50] == 50, "incorrect value for contents[50], expected 50, is %d", check_msg->contents[50]); - ck_assert_msg(check_msg->contents[51] == 148, "incorrect value for contents[51], expected 148, is %d", check_msg->contents[51]); - ck_assert_msg(check_msg->contents[52] == 1, "incorrect value for contents[52], expected 1, is %d", check_msg->contents[52]); - ck_assert_msg(check_msg->contents[53] == 99, "incorrect value for contents[53], expected 99, is %d", check_msg->contents[53]); - ck_assert_msg(check_msg->contents[54] == 112, "incorrect value for contents[54], expected 112, is %d", check_msg->contents[54]); - ck_assert_msg(check_msg->contents[55] == 88, "incorrect value for contents[55], expected 88, is %d", check_msg->contents[55]); - ck_assert_msg(check_msg->contents[56] == 217, "incorrect value for contents[56], expected 217, is %d", check_msg->contents[56]); - ck_assert_msg(check_msg->contents[57] == 36, "incorrect value for contents[57], expected 36, is %d", check_msg->contents[57]); - ck_assert_msg(check_msg->contents[58] == 84, "incorrect value for contents[58], expected 84, is %d", check_msg->contents[58]); - ck_assert_msg(check_msg->contents[59] == 34, "incorrect value for contents[59], expected 34, is %d", check_msg->contents[59]); - ck_assert_msg(check_msg->contents[60] == 234, "incorrect value for contents[60], expected 234, is %d", check_msg->contents[60]); - ck_assert_msg(check_msg->contents[61] == 82, "incorrect value for contents[61], expected 82, is %d", check_msg->contents[61]); - ck_assert_msg(check_msg->contents[62] == 144, "incorrect value for contents[62], expected 144, is %d", check_msg->contents[62]); - ck_assert_msg(check_msg->contents[63] == 144, "incorrect value for contents[63], expected 144, is %d", check_msg->contents[63]); - ck_assert_msg(check_msg->contents[64] == 97, "incorrect value for contents[64], expected 97, is %d", check_msg->contents[64]); - ck_assert_msg(check_msg->contents[65] == 96, "incorrect value for contents[65], expected 96, is %d", check_msg->contents[65]); - ck_assert_msg(check_msg->contents[66] == 75, "incorrect value for contents[66], expected 75, is %d", check_msg->contents[66]); - ck_assert_msg(check_msg->contents[67] == 174, "incorrect value for contents[67], expected 174, is %d", check_msg->contents[67]); - ck_assert_msg(check_msg->contents[68] == 58, "incorrect value for contents[68], expected 58, is %d", check_msg->contents[68]); - ck_assert_msg(check_msg->contents[69] == 219, "incorrect value for contents[69], expected 219, is %d", check_msg->contents[69]); - ck_assert_msg(check_msg->contents[70] == 180, "incorrect value for contents[70], expected 180, is %d", check_msg->contents[70]); - ck_assert_msg(check_msg->contents[71] == 148, "incorrect value for contents[71], expected 148, is %d", check_msg->contents[71]); - ck_assert_msg(check_msg->contents[72] == 247, "incorrect value for contents[72], expected 247, is %d", check_msg->contents[72]); - ck_assert_msg(check_msg->contents[73] == 59, "incorrect value for contents[73], expected 59, is %d", check_msg->contents[73]); - ck_assert_msg(check_msg->contents[74] == 2, "incorrect value for contents[74], expected 2, is %d", check_msg->contents[74]); - ck_assert_msg(check_msg->contents[75] == 116, "incorrect value for contents[75], expected 116, is %d", check_msg->contents[75]); - ck_assert_msg(check_msg->contents[76] == 214, "incorrect value for contents[76], expected 214, is %d", check_msg->contents[76]); - ck_assert_msg(check_msg->contents[77] == 114, "incorrect value for contents[77], expected 114, is %d", check_msg->contents[77]); - ck_assert_msg(check_msg->contents[78] == 55, "incorrect value for contents[78], expected 55, is %d", check_msg->contents[78]); - ck_assert_msg(check_msg->contents[79] == 134, "incorrect value for contents[79], expected 134, is %d", check_msg->contents[79]); - ck_assert_msg(check_msg->contents[80] == 54, "incorrect value for contents[80], expected 54, is %d", check_msg->contents[80]); - ck_assert_msg(check_msg->contents[81] == 119, "incorrect value for contents[81], expected 119, is %d", check_msg->contents[81]); - ck_assert_msg(check_msg->contents[82] == 108, "incorrect value for contents[82], expected 108, is %d", check_msg->contents[82]); - ck_assert_msg(check_msg->contents[83] == 128, "incorrect value for contents[83], expected 128, is %d", check_msg->contents[83]); - ck_assert_msg(check_msg->contents[84] == 73, "incorrect value for contents[84], expected 73, is %d", check_msg->contents[84]); - ck_assert_msg(check_msg->contents[85] == 181, "incorrect value for contents[85], expected 181, is %d", check_msg->contents[85]); - ck_assert_msg(check_msg->contents[86] == 20, "incorrect value for contents[86], expected 20, is %d", check_msg->contents[86]); - ck_assert_msg(check_msg->contents[87] == 233, "incorrect value for contents[87], expected 233, is %d", check_msg->contents[87]); - ck_assert_msg(check_msg->contents[88] == 23, "incorrect value for contents[88], expected 23, is %d", check_msg->contents[88]); - ck_assert_msg(check_msg->contents[89] == 23, "incorrect value for contents[89], expected 23, is %d", check_msg->contents[89]); - ck_assert_msg(check_msg->contents[90] == 73, "incorrect value for contents[90], expected 73, is %d", check_msg->contents[90]); - ck_assert_msg(check_msg->contents[91] == 119, "incorrect value for contents[91], expected 119, is %d", check_msg->contents[91]); - ck_assert_msg(check_msg->contents[92] == 136, "incorrect value for contents[92], expected 136, is %d", check_msg->contents[92]); - ck_assert_msg(check_msg->contents[93] == 231, "incorrect value for contents[93], expected 231, is %d", check_msg->contents[93]); - ck_assert_msg(check_msg->contents[94] == 189, "incorrect value for contents[94], expected 189, is %d", check_msg->contents[94]); - ck_assert_msg(check_msg->contents[95] == 26, "incorrect value for contents[95], expected 26, is %d", check_msg->contents[95]); - ck_assert_msg(check_msg->contents[96] == 174, "incorrect value for contents[96], expected 174, is %d", check_msg->contents[96]); - ck_assert_msg(check_msg->contents[97] == 128, "incorrect value for contents[97], expected 128, is %d", check_msg->contents[97]); - ck_assert_msg(check_msg->contents[98] == 93, "incorrect value for contents[98], expected 93, is %d", check_msg->contents[98]); - ck_assert_msg(check_msg->contents[99] == 30, "incorrect value for contents[99], expected 30, is %d", check_msg->contents[99]); - ck_assert_msg(check_msg->contents[100] == 76, "incorrect value for contents[100], expected 76, is %d", check_msg->contents[100]); - ck_assert_msg(check_msg->contents[101] == 45, "incorrect value for contents[101], expected 45, is %d", check_msg->contents[101]); - ck_assert_msg(check_msg->contents[102] == 109, "incorrect value for contents[102], expected 109, is %d", check_msg->contents[102]); - ck_assert_msg(check_msg->contents[103] == 134, "incorrect value for contents[103], expected 134, is %d", check_msg->contents[103]); - ck_assert_msg(check_msg->contents[104] == 81, "incorrect value for contents[104], expected 81, is %d", check_msg->contents[104]); - ck_assert_msg(check_msg->contents[105] == 0, "incorrect value for contents[105], expected 0, is %d", check_msg->contents[105]); - ck_assert_msg(check_msg->contents[106] == 116, "incorrect value for contents[106], expected 116, is %d", check_msg->contents[106]); - ck_assert_msg(check_msg->contents[107] == 158, "incorrect value for contents[107], expected 158, is %d", check_msg->contents[107]); - ck_assert_msg(check_msg->contents[108] == 127, "incorrect value for contents[108], expected 127, is %d", check_msg->contents[108]); - ck_assert_msg(check_msg->contents[109] == 40, "incorrect value for contents[109], expected 40, is %d", check_msg->contents[109]); - ck_assert_msg(check_msg->contents[110] == 133, "incorrect value for contents[110], expected 133, is %d", check_msg->contents[110]); - ck_assert_msg(check_msg->contents[111] == 208, "incorrect value for contents[111], expected 208, is %d", check_msg->contents[111]); - ck_assert_msg(check_msg->contents[112] == 134, "incorrect value for contents[112], expected 134, is %d", check_msg->contents[112]); - ck_assert_msg(check_msg->contents[113] == 127, "incorrect value for contents[113], expected 127, is %d", check_msg->contents[113]); - ck_assert_msg(check_msg->contents[114] == 140, "incorrect value for contents[114], expected 140, is %d", check_msg->contents[114]); - ck_assert_msg(check_msg->contents[115] == 232, "incorrect value for contents[115], expected 232, is %d", check_msg->contents[115]); - ck_assert_msg(check_msg->contents[116] == 183, "incorrect value for contents[116], expected 183, is %d", check_msg->contents[116]); - ck_assert_msg(check_msg->contents[117] == 184, "incorrect value for contents[117], expected 184, is %d", check_msg->contents[117]); - ck_assert_msg(check_msg->contents[118] == 108, "incorrect value for contents[118], expected 108, is %d", check_msg->contents[118]); - ck_assert_msg(check_msg->contents[119] == 6, "incorrect value for contents[119], expected 6, is %d", check_msg->contents[119]); - ck_assert_msg(check_msg->contents[120] == 228, "incorrect value for contents[120], expected 228, is %d", check_msg->contents[120]); - ck_assert_msg(check_msg->contents[121] == 54, "incorrect value for contents[121], expected 54, is %d", check_msg->contents[121]); - ck_assert_msg(check_msg->contents[122] == 238, "incorrect value for contents[122], expected 238, is %d", check_msg->contents[122]); - ck_assert_msg(check_msg->contents[123] == 59, "incorrect value for contents[123], expected 59, is %d", check_msg->contents[123]); - ck_assert_msg(check_msg->contents[124] == 220, "incorrect value for contents[124], expected 220, is %d", check_msg->contents[124]); - ck_assert_msg(check_msg->contents[125] == 30, "incorrect value for contents[125], expected 30, is %d", check_msg->contents[125]); - ck_assert_msg(check_msg->contents[126] == 228, "incorrect value for contents[126], expected 228, is %d", check_msg->contents[126]); - ck_assert_msg(check_msg->contents[127] == 212, "incorrect value for contents[127], expected 212, is %d", check_msg->contents[127]); - ck_assert_msg(check_msg->contents[128] == 50, "incorrect value for contents[128], expected 50, is %d", check_msg->contents[128]); - ck_assert_msg(check_msg->contents[129] == 182, "incorrect value for contents[129], expected 182, is %d", check_msg->contents[129]); - ck_assert_msg(check_msg->contents[130] == 97, "incorrect value for contents[130], expected 97, is %d", check_msg->contents[130]); - ck_assert_msg(check_msg->contents[131] == 20, "incorrect value for contents[131], expected 20, is %d", check_msg->contents[131]); - ck_assert_msg(check_msg->contents[132] == 41, "incorrect value for contents[132], expected 41, is %d", check_msg->contents[132]); - ck_assert_msg(check_msg->contents[133] == 76, "incorrect value for contents[133], expected 76, is %d", check_msg->contents[133]); - ck_assert_msg(check_msg->contents[134] == 227, "incorrect value for contents[134], expected 227, is %d", check_msg->contents[134]); - ck_assert_msg(check_msg->contents[135] == 88, "incorrect value for contents[135], expected 88, is %d", check_msg->contents[135]); - ck_assert_msg(check_msg->contents[136] == 12, "incorrect value for contents[136], expected 12, is %d", check_msg->contents[136]); - ck_assert_msg(check_msg->contents[137] == 95, "incorrect value for contents[137], expected 95, is %d", check_msg->contents[137]); - ck_assert_msg(check_msg->contents[138] == 112, "incorrect value for contents[138], expected 112, is %d", check_msg->contents[138]); - ck_assert_msg(check_msg->contents[139] == 209, "incorrect value for contents[139], expected 209, is %d", check_msg->contents[139]); - ck_assert_msg(check_msg->contents[140] == 183, "incorrect value for contents[140], expected 183, is %d", check_msg->contents[140]); - ck_assert_msg(check_msg->contents[141] == 127, "incorrect value for contents[141], expected 127, is %d", check_msg->contents[141]); - ck_assert_msg(check_msg->contents[142] == 4, "incorrect value for contents[142], expected 4, is %d", check_msg->contents[142]); - ck_assert_msg(check_msg->contents[143] == 165, "incorrect value for contents[143], expected 165, is %d", check_msg->contents[143]); - ck_assert_msg(check_msg->contents[144] == 189, "incorrect value for contents[144], expected 189, is %d", check_msg->contents[144]); - ck_assert_msg(check_msg->contents[145] == 44, "incorrect value for contents[145], expected 44, is %d", check_msg->contents[145]); - ck_assert_msg(check_msg->contents[146] == 239, "incorrect value for contents[146], expected 239, is %d", check_msg->contents[146]); - ck_assert_msg(check_msg->contents[147] == 232, "incorrect value for contents[147], expected 232, is %d", check_msg->contents[147]); - ck_assert_msg(check_msg->contents[148] == 132, "incorrect value for contents[148], expected 132, is %d", check_msg->contents[148]); - ck_assert_msg(check_msg->contents[149] == 9, "incorrect value for contents[149], expected 9, is %d", check_msg->contents[149]); - ck_assert_msg(check_msg->contents[150] == 114, "incorrect value for contents[150], expected 114, is %d", check_msg->contents[150]); - ck_assert_msg(check_msg->contents[151] == 184, "incorrect value for contents[151], expected 184, is %d", check_msg->contents[151]); - ck_assert_msg(check_msg->contents[152] == 249, "incorrect value for contents[152], expected 249, is %d", check_msg->contents[152]); - ck_assert_msg(check_msg->contents[153] == 208, "incorrect value for contents[153], expected 208, is %d", check_msg->contents[153]); - ck_assert_msg(check_msg->contents[154] == 246, "incorrect value for contents[154], expected 246, is %d", check_msg->contents[154]); - ck_assert_msg(check_msg->contents[155] == 194, "incorrect value for contents[155], expected 194, is %d", check_msg->contents[155]); - ck_assert_msg(check_msg->contents[156] == 250, "incorrect value for contents[156], expected 250, is %d", check_msg->contents[156]); - ck_assert_msg(check_msg->contents[157] == 2, "incorrect value for contents[157], expected 2, is %d", check_msg->contents[157]); - ck_assert_msg(check_msg->contents[158] == 97, "incorrect value for contents[158], expected 97, is %d", check_msg->contents[158]); - ck_assert_msg(check_msg->contents[159] == 173, "incorrect value for contents[159], expected 173, is %d", check_msg->contents[159]); - ck_assert_msg(check_msg->contents[160] == 157, "incorrect value for contents[160], expected 157, is %d", check_msg->contents[160]); - ck_assert_msg(check_msg->contents[161] == 202, "incorrect value for contents[161], expected 202, is %d", check_msg->contents[161]); - ck_assert_msg(check_msg->contents[162] == 172, "incorrect value for contents[162], expected 172, is %d", check_msg->contents[162]); - ck_assert_msg(check_msg->contents[163] == 180, "incorrect value for contents[163], expected 180, is %d", check_msg->contents[163]); - ck_assert_msg(check_msg->contents[164] == 150, "incorrect value for contents[164], expected 150, is %d", check_msg->contents[164]); - ck_assert_msg(check_msg->contents[165] == 213, "incorrect value for contents[165], expected 213, is %d", check_msg->contents[165]); - ck_assert_msg(check_msg->contents[166] == 193, "incorrect value for contents[166], expected 193, is %d", check_msg->contents[166]); - ck_assert_msg(check_msg->contents[167] == 177, "incorrect value for contents[167], expected 177, is %d", check_msg->contents[167]); - ck_assert_msg(check_msg->contents[168] == 209, "incorrect value for contents[168], expected 209, is %d", check_msg->contents[168]); - ck_assert_msg(check_msg->contents[169] == 156, "incorrect value for contents[169], expected 156, is %d", check_msg->contents[169]); - ck_assert_msg(check_msg->contents[170] == 20, "incorrect value for contents[170], expected 20, is %d", check_msg->contents[170]); - ck_assert_msg(check_msg->contents[171] == 174, "incorrect value for contents[171], expected 174, is %d", check_msg->contents[171]); - ck_assert_msg(check_msg->contents[172] == 18, "incorrect value for contents[172], expected 18, is %d", check_msg->contents[172]); - ck_assert_msg(check_msg->contents[173] == 73, "incorrect value for contents[173], expected 73, is %d", check_msg->contents[173]); - ck_assert_msg(check_msg->contents[174] == 132, "incorrect value for contents[174], expected 132, is %d", check_msg->contents[174]); - ck_assert_msg(check_msg->contents[175] == 215, "incorrect value for contents[175], expected 215, is %d", check_msg->contents[175]); - ck_assert_msg(check_msg->contents[176] == 115, "incorrect value for contents[176], expected 115, is %d", check_msg->contents[176]); - ck_assert_msg(check_msg->contents[177] == 128, "incorrect value for contents[177], expected 128, is %d", check_msg->contents[177]); - ck_assert_msg(check_msg->contents[178] == 175, "incorrect value for contents[178], expected 175, is %d", check_msg->contents[178]); - ck_assert_msg(check_msg->contents[179] == 169, "incorrect value for contents[179], expected 169, is %d", check_msg->contents[179]); - ck_assert_msg(check_msg->contents[180] == 116, "incorrect value for contents[180], expected 116, is %d", check_msg->contents[180]); - ck_assert_msg(check_msg->contents[181] == 132, "incorrect value for contents[181], expected 132, is %d", check_msg->contents[181]); - ck_assert_msg(check_msg->contents[182] == 100, "incorrect value for contents[182], expected 100, is %d", check_msg->contents[182]); - ck_assert_msg(check_msg->contents[183] == 72, "incorrect value for contents[183], expected 72, is %d", check_msg->contents[183]); - ck_assert_msg(check_msg->contents[184] == 45, "incorrect value for contents[184], expected 45, is %d", check_msg->contents[184]); - ck_assert_msg(check_msg->contents[185] == 25, "incorrect value for contents[185], expected 25, is %d", check_msg->contents[185]); - ck_assert_msg(check_msg->contents[186] == 14, "incorrect value for contents[186], expected 14, is %d", check_msg->contents[186]); - ck_assert_msg(check_msg->contents[187] == 205, "incorrect value for contents[187], expected 205, is %d", check_msg->contents[187]); - ck_assert_msg(check_msg->contents[188] == 213, "incorrect value for contents[188], expected 213, is %d", check_msg->contents[188]); - ck_assert_msg(check_msg->contents[189] == 145, "incorrect value for contents[189], expected 145, is %d", check_msg->contents[189]); - ck_assert_msg(check_msg->contents[190] == 68, "incorrect value for contents[190], expected 68, is %d", check_msg->contents[190]); - ck_assert_msg(check_msg->contents[191] == 137, "incorrect value for contents[191], expected 137, is %d", check_msg->contents[191]); - ck_assert_msg(check_msg->contents[192] == 249, "incorrect value for contents[192], expected 249, is %d", check_msg->contents[192]); - ck_assert_msg(check_msg->contents[193] == 54, "incorrect value for contents[193], expected 54, is %d", check_msg->contents[193]); - ck_assert_msg(check_msg->contents[194] == 40, "incorrect value for contents[194], expected 40, is %d", check_msg->contents[194]); - ck_assert_msg(check_msg->contents[195] == 174, "incorrect value for contents[195], expected 174, is %d", check_msg->contents[195]); - ck_assert_msg(check_msg->contents[196] == 215, "incorrect value for contents[196], expected 215, is %d", check_msg->contents[196]); - ck_assert_msg(check_msg->contents[197] == 148, "incorrect value for contents[197], expected 148, is %d", check_msg->contents[197]); - ck_assert_msg(check_msg->contents[198] == 166, "incorrect value for contents[198], expected 166, is %d", check_msg->contents[198]); - ck_assert_msg(check_msg->contents[199] == 190, "incorrect value for contents[199], expected 190, is %d", check_msg->contents[199]); - ck_assert_msg(check_msg->contents[200] == 63, "incorrect value for contents[200], expected 63, is %d", check_msg->contents[200]); - ck_assert_msg(check_msg->contents[201] == 118, "incorrect value for contents[201], expected 118, is %d", check_msg->contents[201]); - ck_assert_msg(check_msg->contents[202] == 6, "incorrect value for contents[202], expected 6, is %d", check_msg->contents[202]); - ck_assert_msg(check_msg->contents[203] == 165, "incorrect value for contents[203], expected 165, is %d", check_msg->contents[203]); - ck_assert_msg(check_msg->contents[204] == 212, "incorrect value for contents[204], expected 212, is %d", check_msg->contents[204]); - ck_assert_msg(check_msg->contents[205] == 74, "incorrect value for contents[205], expected 74, is %d", check_msg->contents[205]); - ck_assert_msg(check_msg->contents[206] == 68, "incorrect value for contents[206], expected 68, is %d", check_msg->contents[206]); - ck_assert_msg(check_msg->contents[207] == 200, "incorrect value for contents[207], expected 200, is %d", check_msg->contents[207]); - ck_assert_msg(check_msg->contents[208] == 38, "incorrect value for contents[208], expected 38, is %d", check_msg->contents[208]); - ck_assert_msg(check_msg->contents[209] == 139, "incorrect value for contents[209], expected 139, is %d", check_msg->contents[209]); - ck_assert_msg(check_msg->contents[210] == 212, "incorrect value for contents[210], expected 212, is %d", check_msg->contents[210]); - ck_assert_msg(check_msg->contents[211] == 112, "incorrect value for contents[211], expected 112, is %d", check_msg->contents[211]); - ck_assert_msg(check_msg->contents[212] == 45, "incorrect value for contents[212], expected 45, is %d", check_msg->contents[212]); - ck_assert_msg(check_msg->contents[213] == 167, "incorrect value for contents[213], expected 167, is %d", check_msg->contents[213]); - ck_assert_msg(check_msg->contents[214] == 236, "incorrect value for contents[214], expected 236, is %d", check_msg->contents[214]); - ck_assert_msg(check_msg->contents[215] == 255, "incorrect value for contents[215], expected 255, is %d", check_msg->contents[215]); - ck_assert_msg(check_msg->contents[216] == 106, "incorrect value for contents[216], expected 106, is %d", check_msg->contents[216]); - ck_assert_msg(check_msg->contents[217] == 92, "incorrect value for contents[217], expected 92, is %d", check_msg->contents[217]); - ck_assert_msg(check_msg->contents[218] == 132, "incorrect value for contents[218], expected 132, is %d", check_msg->contents[218]); - ck_assert_msg(check_msg->contents[219] == 59, "incorrect value for contents[219], expected 59, is %d", check_msg->contents[219]); - ck_assert_msg(check_msg->contents[220] == 61, "incorrect value for contents[220], expected 61, is %d", check_msg->contents[220]); - ck_assert_msg(check_msg->contents[221] == 233, "incorrect value for contents[221], expected 233, is %d", check_msg->contents[221]); - ck_assert_msg(check_msg->contents[222] == 3, "incorrect value for contents[222], expected 3, is %d", check_msg->contents[222]); - ck_assert_msg(check_msg->contents[223] == 246, "incorrect value for contents[223], expected 246, is %d", check_msg->contents[223]); - ck_assert_msg(check_msg->contents[224] == 158, "incorrect value for contents[224], expected 158, is %d", check_msg->contents[224]); - ck_assert_msg(check_msg->contents[225] == 83, "incorrect value for contents[225], expected 83, is %d", check_msg->contents[225]); - ck_assert_msg(check_msg->contents[226] == 134, "incorrect value for contents[226], expected 134, is %d", check_msg->contents[226]); - ck_assert_msg(check_msg->contents[227] == 246, "incorrect value for contents[227], expected 246, is %d", check_msg->contents[227]); - ck_assert_msg(check_msg->contents[228] == 154, "incorrect value for contents[228], expected 154, is %d", check_msg->contents[228]); - ck_assert_msg(check_msg->contents[229] == 17, "incorrect value for contents[229], expected 17, is %d", check_msg->contents[229]); - ck_assert_msg(check_msg->contents[230] == 0, "incorrect value for contents[230], expected 0, is %d", check_msg->contents[230]); - ck_assert_msg(check_msg->contents[231] == 6, "incorrect value for contents[231], expected 6, is %d", check_msg->contents[231]); - ck_assert_msg(check_msg->contents[232] == 56, "incorrect value for contents[232], expected 56, is %d", check_msg->contents[232]); - ck_assert_msg(check_msg->contents[233] == 216, "incorrect value for contents[233], expected 216, is %d", check_msg->contents[233]); - ck_assert_msg(check_msg->contents[234] == 19, "incorrect value for contents[234], expected 19, is %d", check_msg->contents[234]); - ck_assert_msg(check_msg->contents[235] == 216, "incorrect value for contents[235], expected 216, is %d", check_msg->contents[235]); - ck_assert_msg(check_msg->contents[236] == 70, "incorrect value for contents[236], expected 70, is %d", check_msg->contents[236]); - ck_assert_msg(check_msg->contents[237] == 71, "incorrect value for contents[237], expected 71, is %d", check_msg->contents[237]); - ck_assert_msg(check_msg->contents[238] == 161, "incorrect value for contents[238], expected 161, is %d", check_msg->contents[238]); - ck_assert_msg(check_msg->contents[239] == 184, "incorrect value for contents[239], expected 184, is %d", check_msg->contents[239]); - ck_assert_msg(check_msg->contents[240] == 5, "incorrect value for contents[240], expected 5, is %d", check_msg->contents[240]); - ck_assert_msg(check_msg->contents[241] == 177, "incorrect value for contents[241], expected 177, is %d", check_msg->contents[241]); - ck_assert_msg(check_msg->contents[242] == 45, "incorrect value for contents[242], expected 45, is %d", check_msg->contents[242]); - ck_assert_msg(check_msg->contents[243] == 37, "incorrect value for contents[243], expected 37, is %d", check_msg->contents[243]); - ck_assert_msg(check_msg->contents[244] == 98, "incorrect value for contents[244], expected 98, is %d", check_msg->contents[244]); - ck_assert_msg(check_msg->contents[245] == 56, "incorrect value for contents[245], expected 56, is %d", check_msg->contents[245]); - ck_assert_msg(check_msg->contents[246] == 149, "incorrect value for contents[246], expected 149, is %d", check_msg->contents[246]); - ck_assert_msg(check_msg->contents[247] == 0, "incorrect value for contents[247], expected 0, is %d", check_msg->contents[247]); - ck_assert_msg(check_msg->contents[248] == 73, "incorrect value for contents[248], expected 73, is %d", check_msg->contents[248]); - ck_assert_msg(check_msg->contents[249] == 221, "incorrect value for contents[249], expected 221, is %d", check_msg->contents[249]); - ck_assert_msg(check_msg->contents[250] == 105, "incorrect value for contents[250], expected 105, is %d", check_msg->contents[250]); - ck_assert_msg(check_msg->contents[251] == 239, "incorrect value for contents[251], expected 239, is %d", check_msg->contents[251]); - ck_assert_msg(check_msg->contents[252] == 168, "incorrect value for contents[252], expected 168, is %d", check_msg->contents[252]); - ck_assert_msg(check_msg->contents[253] == 205, "incorrect value for contents[253], expected 205, is %d", check_msg->contents[253]); - ck_assert_msg(check_msg->contents[254] == 85, "incorrect value for contents[254], expected 85, is %d", check_msg->contents[254]); + ck_assert_msg(check_msg->contents[0] == 53, + "incorrect value for contents[0], expected 53, is %d", + check_msg->contents[0]); + ck_assert_msg(check_msg->contents[1] == 5, + "incorrect value for contents[1], expected 5, is %d", + check_msg->contents[1]); + ck_assert_msg(check_msg->contents[2] == 172, + "incorrect value for contents[2], expected 172, is %d", + check_msg->contents[2]); + ck_assert_msg(check_msg->contents[3] == 138, + "incorrect value for contents[3], expected 138, is %d", + check_msg->contents[3]); + ck_assert_msg(check_msg->contents[4] == 50, + "incorrect value for contents[4], expected 50, is %d", + check_msg->contents[4]); + ck_assert_msg(check_msg->contents[5] == 49, + "incorrect value for contents[5], expected 49, is %d", + check_msg->contents[5]); + ck_assert_msg(check_msg->contents[6] == 206, + "incorrect value for contents[6], expected 206, is %d", + check_msg->contents[6]); + ck_assert_msg(check_msg->contents[7] == 234, + "incorrect value for contents[7], expected 234, is %d", + check_msg->contents[7]); + ck_assert_msg(check_msg->contents[8] == 149, + "incorrect value for contents[8], expected 149, is %d", + check_msg->contents[8]); + ck_assert_msg(check_msg->contents[9] == 204, + "incorrect value for contents[9], expected 204, is %d", + check_msg->contents[9]); + ck_assert_msg(check_msg->contents[10] == 113, + "incorrect value for contents[10], expected 113, is %d", + check_msg->contents[10]); + ck_assert_msg(check_msg->contents[11] == 31, + "incorrect value for contents[11], expected 31, is %d", + check_msg->contents[11]); + ck_assert_msg(check_msg->contents[12] == 108, + "incorrect value for contents[12], expected 108, is %d", + check_msg->contents[12]); + ck_assert_msg(check_msg->contents[13] == 188, + "incorrect value for contents[13], expected 188, is %d", + check_msg->contents[13]); + ck_assert_msg(check_msg->contents[14] == 179, + "incorrect value for contents[14], expected 179, is %d", + check_msg->contents[14]); + ck_assert_msg(check_msg->contents[15] == 154, + "incorrect value for contents[15], expected 154, is %d", + check_msg->contents[15]); + ck_assert_msg(check_msg->contents[16] == 156, + "incorrect value for contents[16], expected 156, is %d", + check_msg->contents[16]); + ck_assert_msg(check_msg->contents[17] == 167, + "incorrect value for contents[17], expected 167, is %d", + check_msg->contents[17]); + ck_assert_msg(check_msg->contents[18] == 145, + "incorrect value for contents[18], expected 145, is %d", + check_msg->contents[18]); + ck_assert_msg(check_msg->contents[19] == 139, + "incorrect value for contents[19], expected 139, is %d", + check_msg->contents[19]); + ck_assert_msg(check_msg->contents[20] == 42, + "incorrect value for contents[20], expected 42, is %d", + check_msg->contents[20]); + ck_assert_msg(check_msg->contents[21] == 207, + "incorrect value for contents[21], expected 207, is %d", + check_msg->contents[21]); + ck_assert_msg(check_msg->contents[22] == 126, + "incorrect value for contents[22], expected 126, is %d", + check_msg->contents[22]); + ck_assert_msg(check_msg->contents[23] == 242, + "incorrect value for contents[23], expected 242, is %d", + check_msg->contents[23]); + ck_assert_msg(check_msg->contents[24] == 193, + "incorrect value for contents[24], expected 193, is %d", + check_msg->contents[24]); + ck_assert_msg(check_msg->contents[25] == 9, + "incorrect value for contents[25], expected 9, is %d", + check_msg->contents[25]); + ck_assert_msg(check_msg->contents[26] == 58, + "incorrect value for contents[26], expected 58, is %d", + check_msg->contents[26]); + ck_assert_msg(check_msg->contents[27] == 75, + "incorrect value for contents[27], expected 75, is %d", + check_msg->contents[27]); + ck_assert_msg(check_msg->contents[28] == 8, + "incorrect value for contents[28], expected 8, is %d", + check_msg->contents[28]); + ck_assert_msg(check_msg->contents[29] == 135, + "incorrect value for contents[29], expected 135, is %d", + check_msg->contents[29]); + ck_assert_msg(check_msg->contents[30] == 11, + "incorrect value for contents[30], expected 11, is %d", + check_msg->contents[30]); + ck_assert_msg(check_msg->contents[31] == 92, + "incorrect value for contents[31], expected 92, is %d", + check_msg->contents[31]); + ck_assert_msg(check_msg->contents[32] == 131, + "incorrect value for contents[32], expected 131, is %d", + check_msg->contents[32]); + ck_assert_msg(check_msg->contents[33] == 245, + "incorrect value for contents[33], expected 245, is %d", + check_msg->contents[33]); + ck_assert_msg(check_msg->contents[34] == 24, + "incorrect value for contents[34], expected 24, is %d", + check_msg->contents[34]); + ck_assert_msg(check_msg->contents[35] == 90, + "incorrect value for contents[35], expected 90, is %d", + check_msg->contents[35]); + ck_assert_msg(check_msg->contents[36] == 255, + "incorrect value for contents[36], expected 255, is %d", + check_msg->contents[36]); + ck_assert_msg(check_msg->contents[37] == 30, + "incorrect value for contents[37], expected 30, is %d", + check_msg->contents[37]); + ck_assert_msg(check_msg->contents[38] == 58, + "incorrect value for contents[38], expected 58, is %d", + check_msg->contents[38]); + ck_assert_msg(check_msg->contents[39] == 31, + "incorrect value for contents[39], expected 31, is %d", + check_msg->contents[39]); + ck_assert_msg(check_msg->contents[40] == 109, + "incorrect value for contents[40], expected 109, is %d", + check_msg->contents[40]); + ck_assert_msg(check_msg->contents[41] == 148, + "incorrect value for contents[41], expected 148, is %d", + check_msg->contents[41]); + ck_assert_msg(check_msg->contents[42] == 56, + "incorrect value for contents[42], expected 56, is %d", + check_msg->contents[42]); + ck_assert_msg(check_msg->contents[43] == 178, + "incorrect value for contents[43], expected 178, is %d", + check_msg->contents[43]); + ck_assert_msg(check_msg->contents[44] == 140, + "incorrect value for contents[44], expected 140, is %d", + check_msg->contents[44]); + ck_assert_msg(check_msg->contents[45] == 30, + "incorrect value for contents[45], expected 30, is %d", + check_msg->contents[45]); + ck_assert_msg(check_msg->contents[46] == 159, + "incorrect value for contents[46], expected 159, is %d", + check_msg->contents[46]); + ck_assert_msg(check_msg->contents[47] == 70, + "incorrect value for contents[47], expected 70, is %d", + check_msg->contents[47]); + ck_assert_msg(check_msg->contents[48] == 17, + "incorrect value for contents[48], expected 17, is %d", + check_msg->contents[48]); + ck_assert_msg(check_msg->contents[49] == 170, + "incorrect value for contents[49], expected 170, is %d", + check_msg->contents[49]); + ck_assert_msg(check_msg->contents[50] == 50, + "incorrect value for contents[50], expected 50, is %d", + check_msg->contents[50]); + ck_assert_msg(check_msg->contents[51] == 148, + "incorrect value for contents[51], expected 148, is %d", + check_msg->contents[51]); + ck_assert_msg(check_msg->contents[52] == 1, + "incorrect value for contents[52], expected 1, is %d", + check_msg->contents[52]); + ck_assert_msg(check_msg->contents[53] == 99, + "incorrect value for contents[53], expected 99, is %d", + check_msg->contents[53]); + ck_assert_msg(check_msg->contents[54] == 112, + "incorrect value for contents[54], expected 112, is %d", + check_msg->contents[54]); + ck_assert_msg(check_msg->contents[55] == 88, + "incorrect value for contents[55], expected 88, is %d", + check_msg->contents[55]); + ck_assert_msg(check_msg->contents[56] == 217, + "incorrect value for contents[56], expected 217, is %d", + check_msg->contents[56]); + ck_assert_msg(check_msg->contents[57] == 36, + "incorrect value for contents[57], expected 36, is %d", + check_msg->contents[57]); + ck_assert_msg(check_msg->contents[58] == 84, + "incorrect value for contents[58], expected 84, is %d", + check_msg->contents[58]); + ck_assert_msg(check_msg->contents[59] == 34, + "incorrect value for contents[59], expected 34, is %d", + check_msg->contents[59]); + ck_assert_msg(check_msg->contents[60] == 234, + "incorrect value for contents[60], expected 234, is %d", + check_msg->contents[60]); + ck_assert_msg(check_msg->contents[61] == 82, + "incorrect value for contents[61], expected 82, is %d", + check_msg->contents[61]); + ck_assert_msg(check_msg->contents[62] == 144, + "incorrect value for contents[62], expected 144, is %d", + check_msg->contents[62]); + ck_assert_msg(check_msg->contents[63] == 144, + "incorrect value for contents[63], expected 144, is %d", + check_msg->contents[63]); + ck_assert_msg(check_msg->contents[64] == 97, + "incorrect value for contents[64], expected 97, is %d", + check_msg->contents[64]); + ck_assert_msg(check_msg->contents[65] == 96, + "incorrect value for contents[65], expected 96, is %d", + check_msg->contents[65]); + ck_assert_msg(check_msg->contents[66] == 75, + "incorrect value for contents[66], expected 75, is %d", + check_msg->contents[66]); + ck_assert_msg(check_msg->contents[67] == 174, + "incorrect value for contents[67], expected 174, is %d", + check_msg->contents[67]); + ck_assert_msg(check_msg->contents[68] == 58, + "incorrect value for contents[68], expected 58, is %d", + check_msg->contents[68]); + ck_assert_msg(check_msg->contents[69] == 219, + "incorrect value for contents[69], expected 219, is %d", + check_msg->contents[69]); + ck_assert_msg(check_msg->contents[70] == 180, + "incorrect value for contents[70], expected 180, is %d", + check_msg->contents[70]); + ck_assert_msg(check_msg->contents[71] == 148, + "incorrect value for contents[71], expected 148, is %d", + check_msg->contents[71]); + ck_assert_msg(check_msg->contents[72] == 247, + "incorrect value for contents[72], expected 247, is %d", + check_msg->contents[72]); + ck_assert_msg(check_msg->contents[73] == 59, + "incorrect value for contents[73], expected 59, is %d", + check_msg->contents[73]); + ck_assert_msg(check_msg->contents[74] == 2, + "incorrect value for contents[74], expected 2, is %d", + check_msg->contents[74]); + ck_assert_msg(check_msg->contents[75] == 116, + "incorrect value for contents[75], expected 116, is %d", + check_msg->contents[75]); + ck_assert_msg(check_msg->contents[76] == 214, + "incorrect value for contents[76], expected 214, is %d", + check_msg->contents[76]); + ck_assert_msg(check_msg->contents[77] == 114, + "incorrect value for contents[77], expected 114, is %d", + check_msg->contents[77]); + ck_assert_msg(check_msg->contents[78] == 55, + "incorrect value for contents[78], expected 55, is %d", + check_msg->contents[78]); + ck_assert_msg(check_msg->contents[79] == 134, + "incorrect value for contents[79], expected 134, is %d", + check_msg->contents[79]); + ck_assert_msg(check_msg->contents[80] == 54, + "incorrect value for contents[80], expected 54, is %d", + check_msg->contents[80]); + ck_assert_msg(check_msg->contents[81] == 119, + "incorrect value for contents[81], expected 119, is %d", + check_msg->contents[81]); + ck_assert_msg(check_msg->contents[82] == 108, + "incorrect value for contents[82], expected 108, is %d", + check_msg->contents[82]); + ck_assert_msg(check_msg->contents[83] == 128, + "incorrect value for contents[83], expected 128, is %d", + check_msg->contents[83]); + ck_assert_msg(check_msg->contents[84] == 73, + "incorrect value for contents[84], expected 73, is %d", + check_msg->contents[84]); + ck_assert_msg(check_msg->contents[85] == 181, + "incorrect value for contents[85], expected 181, is %d", + check_msg->contents[85]); + ck_assert_msg(check_msg->contents[86] == 20, + "incorrect value for contents[86], expected 20, is %d", + check_msg->contents[86]); + ck_assert_msg(check_msg->contents[87] == 233, + "incorrect value for contents[87], expected 233, is %d", + check_msg->contents[87]); + ck_assert_msg(check_msg->contents[88] == 23, + "incorrect value for contents[88], expected 23, is %d", + check_msg->contents[88]); + ck_assert_msg(check_msg->contents[89] == 23, + "incorrect value for contents[89], expected 23, is %d", + check_msg->contents[89]); + ck_assert_msg(check_msg->contents[90] == 73, + "incorrect value for contents[90], expected 73, is %d", + check_msg->contents[90]); + ck_assert_msg(check_msg->contents[91] == 119, + "incorrect value for contents[91], expected 119, is %d", + check_msg->contents[91]); + ck_assert_msg(check_msg->contents[92] == 136, + "incorrect value for contents[92], expected 136, is %d", + check_msg->contents[92]); + ck_assert_msg(check_msg->contents[93] == 231, + "incorrect value for contents[93], expected 231, is %d", + check_msg->contents[93]); + ck_assert_msg(check_msg->contents[94] == 189, + "incorrect value for contents[94], expected 189, is %d", + check_msg->contents[94]); + ck_assert_msg(check_msg->contents[95] == 26, + "incorrect value for contents[95], expected 26, is %d", + check_msg->contents[95]); + ck_assert_msg(check_msg->contents[96] == 174, + "incorrect value for contents[96], expected 174, is %d", + check_msg->contents[96]); + ck_assert_msg(check_msg->contents[97] == 128, + "incorrect value for contents[97], expected 128, is %d", + check_msg->contents[97]); + ck_assert_msg(check_msg->contents[98] == 93, + "incorrect value for contents[98], expected 93, is %d", + check_msg->contents[98]); + ck_assert_msg(check_msg->contents[99] == 30, + "incorrect value for contents[99], expected 30, is %d", + check_msg->contents[99]); + ck_assert_msg(check_msg->contents[100] == 76, + "incorrect value for contents[100], expected 76, is %d", + check_msg->contents[100]); + ck_assert_msg(check_msg->contents[101] == 45, + "incorrect value for contents[101], expected 45, is %d", + check_msg->contents[101]); + ck_assert_msg(check_msg->contents[102] == 109, + "incorrect value for contents[102], expected 109, is %d", + check_msg->contents[102]); + ck_assert_msg(check_msg->contents[103] == 134, + "incorrect value for contents[103], expected 134, is %d", + check_msg->contents[103]); + ck_assert_msg(check_msg->contents[104] == 81, + "incorrect value for contents[104], expected 81, is %d", + check_msg->contents[104]); + ck_assert_msg(check_msg->contents[105] == 0, + "incorrect value for contents[105], expected 0, is %d", + check_msg->contents[105]); + ck_assert_msg(check_msg->contents[106] == 116, + "incorrect value for contents[106], expected 116, is %d", + check_msg->contents[106]); + ck_assert_msg(check_msg->contents[107] == 158, + "incorrect value for contents[107], expected 158, is %d", + check_msg->contents[107]); + ck_assert_msg(check_msg->contents[108] == 127, + "incorrect value for contents[108], expected 127, is %d", + check_msg->contents[108]); + ck_assert_msg(check_msg->contents[109] == 40, + "incorrect value for contents[109], expected 40, is %d", + check_msg->contents[109]); + ck_assert_msg(check_msg->contents[110] == 133, + "incorrect value for contents[110], expected 133, is %d", + check_msg->contents[110]); + ck_assert_msg(check_msg->contents[111] == 208, + "incorrect value for contents[111], expected 208, is %d", + check_msg->contents[111]); + ck_assert_msg(check_msg->contents[112] == 134, + "incorrect value for contents[112], expected 134, is %d", + check_msg->contents[112]); + ck_assert_msg(check_msg->contents[113] == 127, + "incorrect value for contents[113], expected 127, is %d", + check_msg->contents[113]); + ck_assert_msg(check_msg->contents[114] == 140, + "incorrect value for contents[114], expected 140, is %d", + check_msg->contents[114]); + ck_assert_msg(check_msg->contents[115] == 232, + "incorrect value for contents[115], expected 232, is %d", + check_msg->contents[115]); + ck_assert_msg(check_msg->contents[116] == 183, + "incorrect value for contents[116], expected 183, is %d", + check_msg->contents[116]); + ck_assert_msg(check_msg->contents[117] == 184, + "incorrect value for contents[117], expected 184, is %d", + check_msg->contents[117]); + ck_assert_msg(check_msg->contents[118] == 108, + "incorrect value for contents[118], expected 108, is %d", + check_msg->contents[118]); + ck_assert_msg(check_msg->contents[119] == 6, + "incorrect value for contents[119], expected 6, is %d", + check_msg->contents[119]); + ck_assert_msg(check_msg->contents[120] == 228, + "incorrect value for contents[120], expected 228, is %d", + check_msg->contents[120]); + ck_assert_msg(check_msg->contents[121] == 54, + "incorrect value for contents[121], expected 54, is %d", + check_msg->contents[121]); + ck_assert_msg(check_msg->contents[122] == 238, + "incorrect value for contents[122], expected 238, is %d", + check_msg->contents[122]); + ck_assert_msg(check_msg->contents[123] == 59, + "incorrect value for contents[123], expected 59, is %d", + check_msg->contents[123]); + ck_assert_msg(check_msg->contents[124] == 220, + "incorrect value for contents[124], expected 220, is %d", + check_msg->contents[124]); + ck_assert_msg(check_msg->contents[125] == 30, + "incorrect value for contents[125], expected 30, is %d", + check_msg->contents[125]); + ck_assert_msg(check_msg->contents[126] == 228, + "incorrect value for contents[126], expected 228, is %d", + check_msg->contents[126]); + ck_assert_msg(check_msg->contents[127] == 212, + "incorrect value for contents[127], expected 212, is %d", + check_msg->contents[127]); + ck_assert_msg(check_msg->contents[128] == 50, + "incorrect value for contents[128], expected 50, is %d", + check_msg->contents[128]); + ck_assert_msg(check_msg->contents[129] == 182, + "incorrect value for contents[129], expected 182, is %d", + check_msg->contents[129]); + ck_assert_msg(check_msg->contents[130] == 97, + "incorrect value for contents[130], expected 97, is %d", + check_msg->contents[130]); + ck_assert_msg(check_msg->contents[131] == 20, + "incorrect value for contents[131], expected 20, is %d", + check_msg->contents[131]); + ck_assert_msg(check_msg->contents[132] == 41, + "incorrect value for contents[132], expected 41, is %d", + check_msg->contents[132]); + ck_assert_msg(check_msg->contents[133] == 76, + "incorrect value for contents[133], expected 76, is %d", + check_msg->contents[133]); + ck_assert_msg(check_msg->contents[134] == 227, + "incorrect value for contents[134], expected 227, is %d", + check_msg->contents[134]); + ck_assert_msg(check_msg->contents[135] == 88, + "incorrect value for contents[135], expected 88, is %d", + check_msg->contents[135]); + ck_assert_msg(check_msg->contents[136] == 12, + "incorrect value for contents[136], expected 12, is %d", + check_msg->contents[136]); + ck_assert_msg(check_msg->contents[137] == 95, + "incorrect value for contents[137], expected 95, is %d", + check_msg->contents[137]); + ck_assert_msg(check_msg->contents[138] == 112, + "incorrect value for contents[138], expected 112, is %d", + check_msg->contents[138]); + ck_assert_msg(check_msg->contents[139] == 209, + "incorrect value for contents[139], expected 209, is %d", + check_msg->contents[139]); + ck_assert_msg(check_msg->contents[140] == 183, + "incorrect value for contents[140], expected 183, is %d", + check_msg->contents[140]); + ck_assert_msg(check_msg->contents[141] == 127, + "incorrect value for contents[141], expected 127, is %d", + check_msg->contents[141]); + ck_assert_msg(check_msg->contents[142] == 4, + "incorrect value for contents[142], expected 4, is %d", + check_msg->contents[142]); + ck_assert_msg(check_msg->contents[143] == 165, + "incorrect value for contents[143], expected 165, is %d", + check_msg->contents[143]); + ck_assert_msg(check_msg->contents[144] == 189, + "incorrect value for contents[144], expected 189, is %d", + check_msg->contents[144]); + ck_assert_msg(check_msg->contents[145] == 44, + "incorrect value for contents[145], expected 44, is %d", + check_msg->contents[145]); + ck_assert_msg(check_msg->contents[146] == 239, + "incorrect value for contents[146], expected 239, is %d", + check_msg->contents[146]); + ck_assert_msg(check_msg->contents[147] == 232, + "incorrect value for contents[147], expected 232, is %d", + check_msg->contents[147]); + ck_assert_msg(check_msg->contents[148] == 132, + "incorrect value for contents[148], expected 132, is %d", + check_msg->contents[148]); + ck_assert_msg(check_msg->contents[149] == 9, + "incorrect value for contents[149], expected 9, is %d", + check_msg->contents[149]); + ck_assert_msg(check_msg->contents[150] == 114, + "incorrect value for contents[150], expected 114, is %d", + check_msg->contents[150]); + ck_assert_msg(check_msg->contents[151] == 184, + "incorrect value for contents[151], expected 184, is %d", + check_msg->contents[151]); + ck_assert_msg(check_msg->contents[152] == 249, + "incorrect value for contents[152], expected 249, is %d", + check_msg->contents[152]); + ck_assert_msg(check_msg->contents[153] == 208, + "incorrect value for contents[153], expected 208, is %d", + check_msg->contents[153]); + ck_assert_msg(check_msg->contents[154] == 246, + "incorrect value for contents[154], expected 246, is %d", + check_msg->contents[154]); + ck_assert_msg(check_msg->contents[155] == 194, + "incorrect value for contents[155], expected 194, is %d", + check_msg->contents[155]); + ck_assert_msg(check_msg->contents[156] == 250, + "incorrect value for contents[156], expected 250, is %d", + check_msg->contents[156]); + ck_assert_msg(check_msg->contents[157] == 2, + "incorrect value for contents[157], expected 2, is %d", + check_msg->contents[157]); + ck_assert_msg(check_msg->contents[158] == 97, + "incorrect value for contents[158], expected 97, is %d", + check_msg->contents[158]); + ck_assert_msg(check_msg->contents[159] == 173, + "incorrect value for contents[159], expected 173, is %d", + check_msg->contents[159]); + ck_assert_msg(check_msg->contents[160] == 157, + "incorrect value for contents[160], expected 157, is %d", + check_msg->contents[160]); + ck_assert_msg(check_msg->contents[161] == 202, + "incorrect value for contents[161], expected 202, is %d", + check_msg->contents[161]); + ck_assert_msg(check_msg->contents[162] == 172, + "incorrect value for contents[162], expected 172, is %d", + check_msg->contents[162]); + ck_assert_msg(check_msg->contents[163] == 180, + "incorrect value for contents[163], expected 180, is %d", + check_msg->contents[163]); + ck_assert_msg(check_msg->contents[164] == 150, + "incorrect value for contents[164], expected 150, is %d", + check_msg->contents[164]); + ck_assert_msg(check_msg->contents[165] == 213, + "incorrect value for contents[165], expected 213, is %d", + check_msg->contents[165]); + ck_assert_msg(check_msg->contents[166] == 193, + "incorrect value for contents[166], expected 193, is %d", + check_msg->contents[166]); + ck_assert_msg(check_msg->contents[167] == 177, + "incorrect value for contents[167], expected 177, is %d", + check_msg->contents[167]); + ck_assert_msg(check_msg->contents[168] == 209, + "incorrect value for contents[168], expected 209, is %d", + check_msg->contents[168]); + ck_assert_msg(check_msg->contents[169] == 156, + "incorrect value for contents[169], expected 156, is %d", + check_msg->contents[169]); + ck_assert_msg(check_msg->contents[170] == 20, + "incorrect value for contents[170], expected 20, is %d", + check_msg->contents[170]); + ck_assert_msg(check_msg->contents[171] == 174, + "incorrect value for contents[171], expected 174, is %d", + check_msg->contents[171]); + ck_assert_msg(check_msg->contents[172] == 18, + "incorrect value for contents[172], expected 18, is %d", + check_msg->contents[172]); + ck_assert_msg(check_msg->contents[173] == 73, + "incorrect value for contents[173], expected 73, is %d", + check_msg->contents[173]); + ck_assert_msg(check_msg->contents[174] == 132, + "incorrect value for contents[174], expected 132, is %d", + check_msg->contents[174]); + ck_assert_msg(check_msg->contents[175] == 215, + "incorrect value for contents[175], expected 215, is %d", + check_msg->contents[175]); + ck_assert_msg(check_msg->contents[176] == 115, + "incorrect value for contents[176], expected 115, is %d", + check_msg->contents[176]); + ck_assert_msg(check_msg->contents[177] == 128, + "incorrect value for contents[177], expected 128, is %d", + check_msg->contents[177]); + ck_assert_msg(check_msg->contents[178] == 175, + "incorrect value for contents[178], expected 175, is %d", + check_msg->contents[178]); + ck_assert_msg(check_msg->contents[179] == 169, + "incorrect value for contents[179], expected 169, is %d", + check_msg->contents[179]); + ck_assert_msg(check_msg->contents[180] == 116, + "incorrect value for contents[180], expected 116, is %d", + check_msg->contents[180]); + ck_assert_msg(check_msg->contents[181] == 132, + "incorrect value for contents[181], expected 132, is %d", + check_msg->contents[181]); + ck_assert_msg(check_msg->contents[182] == 100, + "incorrect value for contents[182], expected 100, is %d", + check_msg->contents[182]); + ck_assert_msg(check_msg->contents[183] == 72, + "incorrect value for contents[183], expected 72, is %d", + check_msg->contents[183]); + ck_assert_msg(check_msg->contents[184] == 45, + "incorrect value for contents[184], expected 45, is %d", + check_msg->contents[184]); + ck_assert_msg(check_msg->contents[185] == 25, + "incorrect value for contents[185], expected 25, is %d", + check_msg->contents[185]); + ck_assert_msg(check_msg->contents[186] == 14, + "incorrect value for contents[186], expected 14, is %d", + check_msg->contents[186]); + ck_assert_msg(check_msg->contents[187] == 205, + "incorrect value for contents[187], expected 205, is %d", + check_msg->contents[187]); + ck_assert_msg(check_msg->contents[188] == 213, + "incorrect value for contents[188], expected 213, is %d", + check_msg->contents[188]); + ck_assert_msg(check_msg->contents[189] == 145, + "incorrect value for contents[189], expected 145, is %d", + check_msg->contents[189]); + ck_assert_msg(check_msg->contents[190] == 68, + "incorrect value for contents[190], expected 68, is %d", + check_msg->contents[190]); + ck_assert_msg(check_msg->contents[191] == 137, + "incorrect value for contents[191], expected 137, is %d", + check_msg->contents[191]); + ck_assert_msg(check_msg->contents[192] == 249, + "incorrect value for contents[192], expected 249, is %d", + check_msg->contents[192]); + ck_assert_msg(check_msg->contents[193] == 54, + "incorrect value for contents[193], expected 54, is %d", + check_msg->contents[193]); + ck_assert_msg(check_msg->contents[194] == 40, + "incorrect value for contents[194], expected 40, is %d", + check_msg->contents[194]); + ck_assert_msg(check_msg->contents[195] == 174, + "incorrect value for contents[195], expected 174, is %d", + check_msg->contents[195]); + ck_assert_msg(check_msg->contents[196] == 215, + "incorrect value for contents[196], expected 215, is %d", + check_msg->contents[196]); + ck_assert_msg(check_msg->contents[197] == 148, + "incorrect value for contents[197], expected 148, is %d", + check_msg->contents[197]); + ck_assert_msg(check_msg->contents[198] == 166, + "incorrect value for contents[198], expected 166, is %d", + check_msg->contents[198]); + ck_assert_msg(check_msg->contents[199] == 190, + "incorrect value for contents[199], expected 190, is %d", + check_msg->contents[199]); + ck_assert_msg(check_msg->contents[200] == 63, + "incorrect value for contents[200], expected 63, is %d", + check_msg->contents[200]); + ck_assert_msg(check_msg->contents[201] == 118, + "incorrect value for contents[201], expected 118, is %d", + check_msg->contents[201]); + ck_assert_msg(check_msg->contents[202] == 6, + "incorrect value for contents[202], expected 6, is %d", + check_msg->contents[202]); + ck_assert_msg(check_msg->contents[203] == 165, + "incorrect value for contents[203], expected 165, is %d", + check_msg->contents[203]); + ck_assert_msg(check_msg->contents[204] == 212, + "incorrect value for contents[204], expected 212, is %d", + check_msg->contents[204]); + ck_assert_msg(check_msg->contents[205] == 74, + "incorrect value for contents[205], expected 74, is %d", + check_msg->contents[205]); + ck_assert_msg(check_msg->contents[206] == 68, + "incorrect value for contents[206], expected 68, is %d", + check_msg->contents[206]); + ck_assert_msg(check_msg->contents[207] == 200, + "incorrect value for contents[207], expected 200, is %d", + check_msg->contents[207]); + ck_assert_msg(check_msg->contents[208] == 38, + "incorrect value for contents[208], expected 38, is %d", + check_msg->contents[208]); + ck_assert_msg(check_msg->contents[209] == 139, + "incorrect value for contents[209], expected 139, is %d", + check_msg->contents[209]); + ck_assert_msg(check_msg->contents[210] == 212, + "incorrect value for contents[210], expected 212, is %d", + check_msg->contents[210]); + ck_assert_msg(check_msg->contents[211] == 112, + "incorrect value for contents[211], expected 112, is %d", + check_msg->contents[211]); + ck_assert_msg(check_msg->contents[212] == 45, + "incorrect value for contents[212], expected 45, is %d", + check_msg->contents[212]); + ck_assert_msg(check_msg->contents[213] == 167, + "incorrect value for contents[213], expected 167, is %d", + check_msg->contents[213]); + ck_assert_msg(check_msg->contents[214] == 236, + "incorrect value for contents[214], expected 236, is %d", + check_msg->contents[214]); + ck_assert_msg(check_msg->contents[215] == 255, + "incorrect value for contents[215], expected 255, is %d", + check_msg->contents[215]); + ck_assert_msg(check_msg->contents[216] == 106, + "incorrect value for contents[216], expected 106, is %d", + check_msg->contents[216]); + ck_assert_msg(check_msg->contents[217] == 92, + "incorrect value for contents[217], expected 92, is %d", + check_msg->contents[217]); + ck_assert_msg(check_msg->contents[218] == 132, + "incorrect value for contents[218], expected 132, is %d", + check_msg->contents[218]); + ck_assert_msg(check_msg->contents[219] == 59, + "incorrect value for contents[219], expected 59, is %d", + check_msg->contents[219]); + ck_assert_msg(check_msg->contents[220] == 61, + "incorrect value for contents[220], expected 61, is %d", + check_msg->contents[220]); + ck_assert_msg(check_msg->contents[221] == 233, + "incorrect value for contents[221], expected 233, is %d", + check_msg->contents[221]); + ck_assert_msg(check_msg->contents[222] == 3, + "incorrect value for contents[222], expected 3, is %d", + check_msg->contents[222]); + ck_assert_msg(check_msg->contents[223] == 246, + "incorrect value for contents[223], expected 246, is %d", + check_msg->contents[223]); + ck_assert_msg(check_msg->contents[224] == 158, + "incorrect value for contents[224], expected 158, is %d", + check_msg->contents[224]); + ck_assert_msg(check_msg->contents[225] == 83, + "incorrect value for contents[225], expected 83, is %d", + check_msg->contents[225]); + ck_assert_msg(check_msg->contents[226] == 134, + "incorrect value for contents[226], expected 134, is %d", + check_msg->contents[226]); + ck_assert_msg(check_msg->contents[227] == 246, + "incorrect value for contents[227], expected 246, is %d", + check_msg->contents[227]); + ck_assert_msg(check_msg->contents[228] == 154, + "incorrect value for contents[228], expected 154, is %d", + check_msg->contents[228]); + ck_assert_msg(check_msg->contents[229] == 17, + "incorrect value for contents[229], expected 17, is %d", + check_msg->contents[229]); + ck_assert_msg(check_msg->contents[230] == 0, + "incorrect value for contents[230], expected 0, is %d", + check_msg->contents[230]); + ck_assert_msg(check_msg->contents[231] == 6, + "incorrect value for contents[231], expected 6, is %d", + check_msg->contents[231]); + ck_assert_msg(check_msg->contents[232] == 56, + "incorrect value for contents[232], expected 56, is %d", + check_msg->contents[232]); + ck_assert_msg(check_msg->contents[233] == 216, + "incorrect value for contents[233], expected 216, is %d", + check_msg->contents[233]); + ck_assert_msg(check_msg->contents[234] == 19, + "incorrect value for contents[234], expected 19, is %d", + check_msg->contents[234]); + ck_assert_msg(check_msg->contents[235] == 216, + "incorrect value for contents[235], expected 216, is %d", + check_msg->contents[235]); + ck_assert_msg(check_msg->contents[236] == 70, + "incorrect value for contents[236], expected 70, is %d", + check_msg->contents[236]); + ck_assert_msg(check_msg->contents[237] == 71, + "incorrect value for contents[237], expected 71, is %d", + check_msg->contents[237]); + ck_assert_msg(check_msg->contents[238] == 161, + "incorrect value for contents[238], expected 161, is %d", + check_msg->contents[238]); + ck_assert_msg(check_msg->contents[239] == 184, + "incorrect value for contents[239], expected 184, is %d", + check_msg->contents[239]); + ck_assert_msg(check_msg->contents[240] == 5, + "incorrect value for contents[240], expected 5, is %d", + check_msg->contents[240]); + ck_assert_msg(check_msg->contents[241] == 177, + "incorrect value for contents[241], expected 177, is %d", + check_msg->contents[241]); + ck_assert_msg(check_msg->contents[242] == 45, + "incorrect value for contents[242], expected 45, is %d", + check_msg->contents[242]); + ck_assert_msg(check_msg->contents[243] == 37, + "incorrect value for contents[243], expected 37, is %d", + check_msg->contents[243]); + ck_assert_msg(check_msg->contents[244] == 98, + "incorrect value for contents[244], expected 98, is %d", + check_msg->contents[244]); + ck_assert_msg(check_msg->contents[245] == 56, + "incorrect value for contents[245], expected 56, is %d", + check_msg->contents[245]); + ck_assert_msg(check_msg->contents[246] == 149, + "incorrect value for contents[246], expected 149, is %d", + check_msg->contents[246]); + ck_assert_msg(check_msg->contents[247] == 0, + "incorrect value for contents[247], expected 0, is %d", + check_msg->contents[247]); + ck_assert_msg(check_msg->contents[248] == 73, + "incorrect value for contents[248], expected 73, is %d", + check_msg->contents[248]); + ck_assert_msg(check_msg->contents[249] == 221, + "incorrect value for contents[249], expected 221, is %d", + check_msg->contents[249]); + ck_assert_msg(check_msg->contents[250] == 105, + "incorrect value for contents[250], expected 105, is %d", + check_msg->contents[250]); + ck_assert_msg(check_msg->contents[251] == 239, + "incorrect value for contents[251], expected 239, is %d", + check_msg->contents[251]); + ck_assert_msg(check_msg->contents[252] == 168, + "incorrect value for contents[252], expected 168, is %d", + check_msg->contents[252]); + ck_assert_msg(check_msg->contents[253] == 205, + "incorrect value for contents[253], expected 205, is %d", + check_msg->contents[253]); + ck_assert_msg(check_msg->contents[254] == 85, + "incorrect value for contents[254], expected 85, is %d", + check_msg->contents[254]); } } END_TEST -Suite* legacy_auto_check_sbp_user_MsgUserData_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_user_MsgUserData"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_user_MsgUserData"); +Suite *legacy_auto_check_sbp_user_MsgUserData_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_user_MsgUserData"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_user_MsgUserData"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_user_MsgUserData); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_vehicle_MsgOdometry.c b/c/test/legacy/auto_check_sbp_vehicle_MsgOdometry.c index c3bea6edd..e2499b0d4 100644 --- a/c/test/legacy/auto_check_sbp_vehicle_MsgOdometry.c +++ b/c/test/legacy/auto_check_sbp_vehicle_MsgOdometry.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgOdometry.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgOdometry.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_vehicle_MsgOdometry ) -{ +START_TEST(test_legacy_auto_check_sbp_vehicle_MsgOdometry) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_vehicle_MsgOdometry ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,80 +128,96 @@ START_TEST( test_legacy_auto_check_sbp_vehicle_MsgOdometry ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x903, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x903, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x903, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x903, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,3,9,66,0,9,8,0,0,0,7,0,0,0,1,52,99, }; + u8 encoded_frame[] = { + 85, 3, 9, 66, 0, 9, 8, 0, 0, 0, 7, 0, 0, 0, 1, 52, 99, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_odometry_t* test_msg = ( msg_odometry_t* )test_msg_storage; + msg_odometry_t *test_msg = (msg_odometry_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 1; test_msg->tow = 8; test_msg->velocity = 7; - sbp_payload_send(&sbp_state, 0x903, 66, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x903, 66, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x903, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_odometry_t* check_msg = ( msg_odometry_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_odometry_t *check_msg = (msg_odometry_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->tow == 8, "incorrect value for tow, expected 8, is %d", check_msg->tow); - ck_assert_msg(check_msg->velocity == 7, "incorrect value for velocity, expected 7, is %d", check_msg->velocity); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->tow == 8, + "incorrect value for tow, expected 8, is %d", check_msg->tow); + ck_assert_msg(check_msg->velocity == 7, + "incorrect value for velocity, expected 7, is %d", + check_msg->velocity); } } END_TEST -Suite* legacy_auto_check_sbp_vehicle_MsgOdometry_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_vehicle_MsgOdometry"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_vehicle_MsgOdometry"); +Suite *legacy_auto_check_sbp_vehicle_MsgOdometry_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_vehicle_MsgOdometry"); + TCase *tc_acq = + tcase_create("Automated_Suite_legacy_auto_check_sbp_vehicle_MsgOdometry"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_vehicle_MsgOdometry); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/auto_check_sbp_vehicle_MsgWheeltick.c b/c/test/legacy/auto_check_sbp_vehicle_MsgWheeltick.c index 694017f0c..274b040aa 100644 --- a/c/test/legacy/auto_check_sbp_vehicle_MsgWheeltick.c +++ b/c/test/legacy/auto_check_sbp_vehicle_MsgWheeltick.c @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgWheeltick.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgWheeltick.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -24,11 +26,11 @@ #endif #include -#include // for debugging -#include // for malloc -#include -#include #include +#include +#include +#include // for debugging +#include // for malloc static struct { u32 n_callbacks_logged; @@ -52,43 +54,38 @@ static struct { static u32 dummy_wr = 0; static u32 dummy_rd = 0; static u8 dummy_buff[1024]; -static void* last_io_context; +static void *last_io_context; static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; static int DUMMY_MEMORY_FOR_IO = 0xdead0000; -static void dummy_reset() -{ +static void dummy_reset() { dummy_rd = dummy_wr = 0; memset(dummy_buff, 0, sizeof(dummy_buff)); } -static s32 dummy_write(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return real_n; +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; } -static s32 dummy_read(u8 *buff, u32 n, void* context) -{ - last_io_context = context; - u32 real_n = n;//(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return real_n; +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; } -static void logging_reset() -{ +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); memset(&last_frame, 0, sizeof(last_frame)); } -static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) -{ +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { last_msg.n_callbacks_logged++; last_msg.sender_id = sender_id; last_msg.len = len; @@ -96,8 +93,8 @@ static void msg_callback(u16 sender_id, u8 len, u8 msg[], void* context) memcpy(last_msg.msg, msg, len); } -static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u16 frame_len, u8 frame[], void *context) -{ +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { last_frame.n_callbacks_logged++; last_frame.sender_id = sender_id; last_frame.msg_type = msg_type; @@ -108,8 +105,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], u1 last_frame.context = context; } -START_TEST( test_legacy_auto_check_sbp_vehicle_MsgWheeltick ) -{ +START_TEST(test_legacy_auto_check_sbp_vehicle_MsgWheeltick) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -123,7 +119,8 @@ START_TEST( test_legacy_auto_check_sbp_vehicle_MsgWheeltick ) // Test successful parsing of a message { // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message types can be + // We re-initialize before every test so that callbacks for the same message + // types can be // allocated multiple times across different tests. sbp_state_init(&sbp_state); @@ -131,82 +128,102 @@ START_TEST( test_legacy_auto_check_sbp_vehicle_MsgWheeltick ) logging_reset(); - sbp_payload_callback_register(&sbp_state, 0x904, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0x904, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + sbp_payload_callback_register(&sbp_state, 0x904, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0x904, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); - u8 encoded_frame[] = {85,4,9,107,69,14,254,27,114,44,26,0,0,0,1,146,225,51,9,210,36,56, }; + u8 encoded_frame[] = { + 85, 4, 9, 107, 69, 14, 254, 27, 114, 44, 26, + 0, 0, 0, 1, 146, 225, 51, 9, 210, 36, 56, + }; dummy_reset(); u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_wheeltick_t* test_msg = ( msg_wheeltick_t* )test_msg_storage; + msg_wheeltick_t *test_msg = (msg_wheeltick_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); test_msg->flags = 1; test_msg->source = 146; test_msg->ticks = -771148831; test_msg->time = 112414825470; - sbp_payload_send(&sbp_state, 0x904, 17771, test_msg_len, test_msg_storage, &dummy_write); + sbp_payload_send(&sbp_state, 0x904, 17771, test_msg_len, test_msg_storage, + &dummy_write); - ck_assert_msg(test_msg_len == sizeof(encoded_frame) - 8, - "Test message has not been generated correctly, or the encoded frame from the spec is badly defined. Check your test spec"); + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff"); + "not enough data was written to dummy_buff"); ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); + "frame was not encoded properly"); while (dummy_rd < dummy_wr) { ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); + "sbp_process threw an error!"); } ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); + "msg_callback: one callback should have been logged"); ck_assert_msg(last_msg.sender_id == 17771, - "msg_callback: sender_id decoded incorrectly"); + "msg_callback: sender_id decoded incorrectly"); ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, - "msg_callback: len decoded incorrectly"); - ck_assert_msg(memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) - == 0, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, "msg_callback: test data decoded incorrectly"); ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); ck_assert_msg(last_frame.n_callbacks_logged == 1, - "frame_callback: one callback should have been logged"); + "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 17771, - "frame_callback: sender_id decoded incorrectly"); + "frame_callback: sender_id decoded incorrectly"); ck_assert_msg(last_frame.msg_type == 0x904, - "frame_callback: msg_type decoded incorrectly"); + "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, - "frame_callback: msg_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, - "frame_callback: test data decoded incorrectly"); + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), - "frame_callback: frame_len decoded incorrectly"); - ck_assert_msg(memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, "frame_callback: frame decoded incorrectly"); ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, - "frame_callback: context pointer incorrectly passed"); + "frame_callback: context pointer incorrectly passed"); - // Cast to expected message type - the +6 byte offset is where the payload starts - msg_wheeltick_t* check_msg = ( msg_wheeltick_t *)((void *)last_msg.msg); + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_wheeltick_t *check_msg = (msg_wheeltick_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); - ck_assert_msg(check_msg->flags == 1, "incorrect value for flags, expected 1, is %d", check_msg->flags); - ck_assert_msg(check_msg->source == 146, "incorrect value for source, expected 146, is %d", check_msg->source); - ck_assert_msg(check_msg->ticks == -771148831, "incorrect value for ticks, expected -771148831, is %d", check_msg->ticks); - ck_assert_msg(check_msg->time == 112414825470, "incorrect value for time, expected 112414825470, is %d", check_msg->time); + ck_assert_msg(check_msg->flags == 1, + "incorrect value for flags, expected 1, is %d", + check_msg->flags); + ck_assert_msg(check_msg->source == 146, + "incorrect value for source, expected 146, is %d", + check_msg->source); + ck_assert_msg(check_msg->ticks == -771148831, + "incorrect value for ticks, expected -771148831, is %d", + check_msg->ticks); + ck_assert_msg(check_msg->time == 112414825470, + "incorrect value for time, expected 112414825470, is %d", + check_msg->time); } } END_TEST -Suite* legacy_auto_check_sbp_vehicle_MsgWheeltick_suite(void) -{ - Suite *s = suite_create("SBP generated test suite: legacy_auto_check_sbp_vehicle_MsgWheeltick"); - TCase *tc_acq = tcase_create("Automated_Suite_legacy_auto_check_sbp_vehicle_MsgWheeltick"); +Suite *legacy_auto_check_sbp_vehicle_MsgWheeltick_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: legacy_auto_check_sbp_vehicle_MsgWheeltick"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_vehicle_MsgWheeltick"); tcase_add_test(tc_acq, test_legacy_auto_check_sbp_vehicle_MsgWheeltick); suite_add_tcase(s, tc_acq); return s; diff --git a/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResult.cc b/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResult.cc index 1a92b687a..d15eb7248 100644 --- a/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResult.cc +++ b/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResult.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResult.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResult.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResult0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResult0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResult0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResult0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,43 +81,49 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResult0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResult0, Test) -{ +}; - uint8_t encoded_frame[] = {85,47,0,195,4,14,0,0,104,65,102,102,144,66,205,196,0,70,8,0,207,189, }; +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResult0, Test) { + uint8_t encoded_frame[] = { + 85, 47, 0, 195, 4, 14, 0, 0, 104, 65, 102, + 102, 144, 66, 205, 196, 0, 70, 8, 0, 207, 189, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_t* test_msg = ( msg_acq_result_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = 8241.2001953125; - test_msg->cn0 = 14.5; - test_msg->cp = 72.19999694824219; - test_msg->sid.code = 0; - test_msg->sid.sat = 8; - - EXPECT_EQ(send_message( 0x2f, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_t *test_msg = (msg_acq_result_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = 8241.2001953125; + test_msg->cn0 = 14.5; + test_msg->cp = 72.19999694824219; + test_msg->sid.code = 0; + test_msg->sid.sat = 8; + + EXPECT_EQ(send_message(0x2f, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - 8241.20019531*100), 0.05) << "incorrect value for cf, expected 8241.20019531, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cn0*100 - 14.5*100), 0.05) << "incorrect value for cn0, expected 14.5, is " << last_msg_->cn0; - EXPECT_LT((last_msg_->cp*100 - 72.1999969482*100), 0.05) << "incorrect value for cp, expected 72.1999969482, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.sat, 8) << "incorrect value for sid.sat, expected 8, is " << last_msg_->sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - 8241.20019531 * 100), 0.05) + << "incorrect value for cf, expected 8241.20019531, is " << last_msg_->cf; + EXPECT_LT((last_msg_->cn0 * 100 - 14.5 * 100), 0.05) + << "incorrect value for cn0, expected 14.5, is " << last_msg_->cn0; + EXPECT_LT((last_msg_->cp * 100 - 72.1999969482 * 100), 0.05) + << "incorrect value for cp, expected 72.1999969482, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.sat, 8) + << "incorrect value for sid.sat, expected 8, is " << last_msg_->sid.sat; } diff --git a/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResultDepA.cc b/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResultDepA.cc index c33b8b0f4..a202c06bd 100644 --- a/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResultDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResultDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,92 +82,92 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,21,0,195,4,13,0,0,104,65,0,192,53,68,198,199,0,70,8,2,68, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_a_t* test_msg = ( msg_acq_result_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = 8241.943359375; - test_msg->cp = 727.0; - test_msg->prn = 8; - test_msg->snr = 14.5; - - EXPECT_EQ(send_message( 0x15, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - 8241.94335938*100), 0.05) << "incorrect value for cf, expected 8241.94335938, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cp*100 - 727.0*100), 0.05) << "incorrect value for cp, expected 727.0, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->prn, 8) << "incorrect value for prn, expected 8, is " << last_msg_->prn; - EXPECT_LT((last_msg_->snr*100 - 14.5*100), 0.05) << "incorrect value for snr, expected 14.5, is " << last_msg_->snr; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 0, 0, 104, 65, 0, + 192, 53, 68, 198, 199, 0, 70, 8, 2, 68, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_a_t *test_msg = (msg_acq_result_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = 8241.943359375; + test_msg->cp = 727.0; + test_msg->prn = 8; + test_msg->snr = 14.5; + + EXPECT_EQ(send_message(0x15, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - 8241.94335938 * 100), 0.05) + << "incorrect value for cf, expected 8241.94335938, is " << last_msg_->cf; + EXPECT_LT((last_msg_->cp * 100 - 727.0 * 100), 0.05) + << "incorrect value for cp, expected 727.0, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->prn, 8) + << "incorrect value for prn, expected 8, is " << last_msg_->prn; + EXPECT_LT((last_msg_->snr * 100 - 14.5 * 100), 0.05) + << "incorrect value for snr, expected 14.5, is " << last_msg_->snr; } -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -180,92 +177,93 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,21,0,195,4,13,205,204,116,65,0,192,179,67,33,81,59,68,9,219,27, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_a_t* test_msg = ( msg_acq_result_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = 749.2676391601562; - test_msg->cp = 359.5; - test_msg->prn = 9; - test_msg->snr = 15.300000190734863; - - EXPECT_EQ(send_message( 0x15, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - 749.26763916*100), 0.05) << "incorrect value for cf, expected 749.26763916, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cp*100 - 359.5*100), 0.05) << "incorrect value for cp, expected 359.5, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->prn, 9) << "incorrect value for prn, expected 9, is " << last_msg_->prn; - EXPECT_LT((last_msg_->snr*100 - 15.3000001907*100), 0.05) << "incorrect value for snr, expected 15.3000001907, is " << last_msg_->snr; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 116, 65, 0, + 192, 179, 67, 33, 81, 59, 68, 9, 219, 27, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_a_t *test_msg = (msg_acq_result_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = 749.2676391601562; + test_msg->cp = 359.5; + test_msg->prn = 9; + test_msg->snr = 15.300000190734863; + + EXPECT_EQ(send_message(0x15, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - 749.26763916 * 100), 0.05) + << "incorrect value for cf, expected 749.26763916, is " << last_msg_->cf; + EXPECT_LT((last_msg_->cp * 100 - 359.5 * 100), 0.05) + << "incorrect value for cp, expected 359.5, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->prn, 9) + << "incorrect value for prn, expected 9, is " << last_msg_->prn; + EXPECT_LT((last_msg_->snr * 100 - 15.3000001907 * 100), 0.05) + << "incorrect value for snr, expected 15.3000001907, is " + << last_msg_->snr; } -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -275,92 +273,94 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,21,0,195,4,13,205,204,144,65,0,0,34,66,57,237,202,197,11,150,35, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_a_t* test_msg = ( msg_acq_result_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = -6493.65283203125; - test_msg->cp = 40.5; - test_msg->prn = 11; - test_msg->snr = 18.100000381469727; - - EXPECT_EQ(send_message( 0x15, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - -6493.65283203*100), 0.05) << "incorrect value for cf, expected -6493.65283203, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cp*100 - 40.5*100), 0.05) << "incorrect value for cp, expected 40.5, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->prn, 11) << "incorrect value for prn, expected 11, is " << last_msg_->prn; - EXPECT_LT((last_msg_->snr*100 - 18.1000003815*100), 0.05) << "incorrect value for snr, expected 18.1000003815, is " << last_msg_->snr; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 144, 65, 0, + 0, 34, 66, 57, 237, 202, 197, 11, 150, 35, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_a_t *test_msg = (msg_acq_result_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = -6493.65283203125; + test_msg->cp = 40.5; + test_msg->prn = 11; + test_msg->snr = 18.100000381469727; + + EXPECT_EQ(send_message(0x15, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - -6493.65283203 * 100), 0.05) + << "incorrect value for cf, expected -6493.65283203, is " + << last_msg_->cf; + EXPECT_LT((last_msg_->cp * 100 - 40.5 * 100), 0.05) + << "incorrect value for cp, expected 40.5, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->prn, 11) + << "incorrect value for prn, expected 11, is " << last_msg_->prn; + EXPECT_LT((last_msg_->snr * 100 - 18.1000003815 * 100), 0.05) + << "incorrect value for snr, expected 18.1000003815, is " + << last_msg_->snr; } -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -370,92 +370,94 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,21,0,195,4,13,205,204,116,65,0,32,9,68,129,193,121,196,12,146,118, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_a_t* test_msg = ( msg_acq_result_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = -999.0234985351562; - test_msg->cp = 548.5; - test_msg->prn = 12; - test_msg->snr = 15.300000190734863; - - EXPECT_EQ(send_message( 0x15, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - -999.023498535*100), 0.05) << "incorrect value for cf, expected -999.023498535, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cp*100 - 548.5*100), 0.05) << "incorrect value for cp, expected 548.5, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->prn, 12) << "incorrect value for prn, expected 12, is " << last_msg_->prn; - EXPECT_LT((last_msg_->snr*100 - 15.3000001907*100), 0.05) << "incorrect value for snr, expected 15.3000001907, is " << last_msg_->snr; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 116, 65, 0, + 32, 9, 68, 129, 193, 121, 196, 12, 146, 118, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_a_t *test_msg = (msg_acq_result_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = -999.0234985351562; + test_msg->cp = 548.5; + test_msg->prn = 12; + test_msg->snr = 15.300000190734863; + + EXPECT_EQ(send_message(0x15, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - -999.023498535 * 100), 0.05) + << "incorrect value for cf, expected -999.023498535, is " + << last_msg_->cf; + EXPECT_LT((last_msg_->cp * 100 - 548.5 * 100), 0.05) + << "incorrect value for cp, expected 548.5, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->prn, 12) + << "incorrect value for prn, expected 12, is " << last_msg_->prn; + EXPECT_LT((last_msg_->snr * 100 - 15.3000001907 * 100), 0.05) + << "incorrect value for snr, expected 15.3000001907, is " + << last_msg_->snr; } -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -465,92 +467,93 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,21,0,195,4,13,205,204,116,65,0,32,67,68,228,74,148,69,14,23,75, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_a_t* test_msg = ( msg_acq_result_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = 4745.361328125; - test_msg->cp = 780.5; - test_msg->prn = 14; - test_msg->snr = 15.300000190734863; - - EXPECT_EQ(send_message( 0x15, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - 4745.36132812*100), 0.05) << "incorrect value for cf, expected 4745.36132812, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cp*100 - 780.5*100), 0.05) << "incorrect value for cp, expected 780.5, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->prn, 14) << "incorrect value for prn, expected 14, is " << last_msg_->prn; - EXPECT_LT((last_msg_->snr*100 - 15.3000001907*100), 0.05) << "incorrect value for snr, expected 15.3000001907, is " << last_msg_->snr; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 205, 204, 116, 65, 0, + 32, 67, 68, 228, 74, 148, 69, 14, 23, 75, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_a_t *test_msg = (msg_acq_result_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = 4745.361328125; + test_msg->cp = 780.5; + test_msg->prn = 14; + test_msg->snr = 15.300000190734863; + + EXPECT_EQ(send_message(0x15, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - 4745.36132812 * 100), 0.05) + << "incorrect value for cf, expected 4745.36132812, is " << last_msg_->cf; + EXPECT_LT((last_msg_->cp * 100 - 780.5 * 100), 0.05) + << "incorrect value for cp, expected 780.5, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->prn, 14) + << "incorrect value for prn, expected 14, is " << last_msg_->prn; + EXPECT_LT((last_msg_->snr * 100 - 15.3000001907 * 100), 0.05) + << "incorrect value for snr, expected 15.3000001907, is " + << last_msg_->snr; } -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -560,41 +563,48 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,21,0,195,4,13,228,56,35,67,0,32,18,68,129,193,249,195,0,204,207, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_a_t* test_msg = ( msg_acq_result_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = -499.5117492675781; - test_msg->cp = 584.5; - test_msg->prn = 0; - test_msg->snr = 163.22222900390625; - - EXPECT_EQ(send_message( 0x15, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - -499.511749268*100), 0.05) << "incorrect value for cf, expected -499.511749268, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cp*100 - 584.5*100), 0.05) << "incorrect value for cp, expected 584.5, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->prn, 0) << "incorrect value for prn, expected 0, is " << last_msg_->prn; - EXPECT_LT((last_msg_->snr*100 - 163.222229004*100), 0.05) << "incorrect value for snr, expected 163.222229004, is " << last_msg_->snr; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 21, 0, 195, 4, 13, 228, 56, 35, 67, 0, + 32, 18, 68, 129, 193, 249, 195, 0, 204, 207, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_a_t *test_msg = (msg_acq_result_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = -499.5117492675781; + test_msg->cp = 584.5; + test_msg->prn = 0; + test_msg->snr = 163.22222900390625; + + EXPECT_EQ(send_message(0x15, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - -499.511749268 * 100), 0.05) + << "incorrect value for cf, expected -499.511749268, is " + << last_msg_->cf; + EXPECT_LT((last_msg_->cp * 100 - 584.5 * 100), 0.05) + << "incorrect value for cp, expected 584.5, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->prn, 0) + << "incorrect value for prn, expected 0, is " << last_msg_->prn; + EXPECT_LT((last_msg_->snr * 100 - 163.222229004 * 100), 0.05) + << "incorrect value for snr, expected 163.222229004, is " + << last_msg_->snr; } diff --git a/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResultDepB.cc b/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResultDepB.cc index c74939e1d..524a44768 100644 --- a/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResultDepB.cc +++ b/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResultDepB.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,96 +82,100 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB0, Test) -{ - - uint8_t encoded_frame[] = {85,20,0,246,215,16,137,167,18,66,0,0,161,67,240,24,156,69,9,0,0,0,80,195, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_b_t* test_msg = ( msg_acq_result_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = 4995.1171875; - test_msg->cp = 322.0; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 9; - test_msg->snr = 36.66360855102539; - - EXPECT_EQ(send_message( 0x14, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - 4995.1171875*100), 0.05) << "incorrect value for cf, expected 4995.1171875, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cp*100 - 322.0*100), 0.05) << "incorrect value for cp, expected 322.0, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 9) << "incorrect value for sid.sat, expected 9, is " << last_msg_->sid.sat; - EXPECT_LT((last_msg_->snr*100 - 36.663608551*100), 0.05) << "incorrect value for snr, expected 36.663608551, is " << last_msg_->snr; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 137, 167, 18, 66, 0, 0, + 161, 67, 240, 24, 156, 69, 9, 0, 0, 0, 80, 195, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_b_t *test_msg = (msg_acq_result_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = 4995.1171875; + test_msg->cp = 322.0; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 9; + test_msg->snr = 36.66360855102539; + + EXPECT_EQ(send_message(0x14, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - 4995.1171875 * 100), 0.05) + << "incorrect value for cf, expected 4995.1171875, is " << last_msg_->cf; + EXPECT_LT((last_msg_->cp * 100 - 322.0 * 100), 0.05) + << "incorrect value for cp, expected 322.0, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 9) + << "incorrect value for sid.sat, expected 9, is " << last_msg_->sid.sat; + EXPECT_LT((last_msg_->snr * 100 - 36.663608551 * 100), 0.05) + << "incorrect value for snr, expected 36.663608551, is " + << last_msg_->snr; } -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -184,96 +185,101 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB1, Test) -{ - - uint8_t encoded_frame[] = {85,20,0,246,215,16,206,172,16,66,0,192,82,68,198,199,0,198,3,0,0,0,149,143, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_b_t* test_msg = ( msg_acq_result_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = -8241.943359375; - test_msg->cp = 843.0; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 3; - test_msg->snr = 36.16875457763672; - - EXPECT_EQ(send_message( 0x14, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - -8241.94335938*100), 0.05) << "incorrect value for cf, expected -8241.94335938, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cp*100 - 843.0*100), 0.05) << "incorrect value for cp, expected 843.0, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 3) << "incorrect value for sid.sat, expected 3, is " << last_msg_->sid.sat; - EXPECT_LT((last_msg_->snr*100 - 36.1687545776*100), 0.05) << "incorrect value for snr, expected 36.1687545776, is " << last_msg_->snr; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB1, Test) { + uint8_t encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 206, 172, 16, 66, 0, 192, + 82, 68, 198, 199, 0, 198, 3, 0, 0, 0, 149, 143, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_b_t *test_msg = (msg_acq_result_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = -8241.943359375; + test_msg->cp = 843.0; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 3; + test_msg->snr = 36.16875457763672; + + EXPECT_EQ(send_message(0x14, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - -8241.94335938 * 100), 0.05) + << "incorrect value for cf, expected -8241.94335938, is " + << last_msg_->cf; + EXPECT_LT((last_msg_->cp * 100 - 843.0 * 100), 0.05) + << "incorrect value for cp, expected 843.0, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 3) + << "incorrect value for sid.sat, expected 3, is " << last_msg_->sid.sat; + EXPECT_LT((last_msg_->snr * 100 - 36.1687545776 * 100), 0.05) + << "incorrect value for snr, expected 36.1687545776, is " + << last_msg_->snr; } -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -283,96 +289,100 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB2, Test) -{ - - uint8_t encoded_frame[] = {85,20,0,246,215,16,228,27,15,66,0,128,70,68,228,74,148,69,18,0,0,0,179,155, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_b_t* test_msg = ( msg_acq_result_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = 4745.361328125; - test_msg->cp = 794.0; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 18; - test_msg->snr = 35.77723693847656; - - EXPECT_EQ(send_message( 0x14, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - 4745.36132812*100), 0.05) << "incorrect value for cf, expected 4745.36132812, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cp*100 - 794.0*100), 0.05) << "incorrect value for cp, expected 794.0, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 18) << "incorrect value for sid.sat, expected 18, is " << last_msg_->sid.sat; - EXPECT_LT((last_msg_->snr*100 - 35.7772369385*100), 0.05) << "incorrect value for snr, expected 35.7772369385, is " << last_msg_->snr; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB2, Test) { + uint8_t encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 228, 27, 15, 66, 0, 128, + 70, 68, 228, 74, 148, 69, 18, 0, 0, 0, 179, 155, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_b_t *test_msg = (msg_acq_result_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = 4745.361328125; + test_msg->cp = 794.0; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 18; + test_msg->snr = 35.77723693847656; + + EXPECT_EQ(send_message(0x14, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - 4745.36132812 * 100), 0.05) + << "incorrect value for cf, expected 4745.36132812, is " << last_msg_->cf; + EXPECT_LT((last_msg_->cp * 100 - 794.0 * 100), 0.05) + << "incorrect value for cp, expected 794.0, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 18) + << "incorrect value for sid.sat, expected 18, is " << last_msg_->sid.sat; + EXPECT_LT((last_msg_->snr * 100 - 35.7772369385 * 100), 0.05) + << "incorrect value for snr, expected 35.7772369385, is " + << last_msg_->snr; } -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -382,96 +392,100 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB3, Test) -{ - - uint8_t encoded_frame[] = {85,20,0,246,215,16,46,199,14,66,0,64,129,67,240,24,28,69,17,0,0,0,18,181, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_b_t* test_msg = ( msg_acq_result_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = 2497.55859375; - test_msg->cp = 258.5; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 17; - test_msg->snr = 35.69451141357422; - - EXPECT_EQ(send_message( 0x14, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - 2497.55859375*100), 0.05) << "incorrect value for cf, expected 2497.55859375, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cp*100 - 258.5*100), 0.05) << "incorrect value for cp, expected 258.5, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 17) << "incorrect value for sid.sat, expected 17, is " << last_msg_->sid.sat; - EXPECT_LT((last_msg_->snr*100 - 35.6945114136*100), 0.05) << "incorrect value for snr, expected 35.6945114136, is " << last_msg_->snr; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB3, Test) { + uint8_t encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 46, 199, 14, 66, 0, 64, + 129, 67, 240, 24, 28, 69, 17, 0, 0, 0, 18, 181, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_b_t *test_msg = (msg_acq_result_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = 2497.55859375; + test_msg->cp = 258.5; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 17; + test_msg->snr = 35.69451141357422; + + EXPECT_EQ(send_message(0x14, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - 2497.55859375 * 100), 0.05) + << "incorrect value for cf, expected 2497.55859375, is " << last_msg_->cf; + EXPECT_LT((last_msg_->cp * 100 - 258.5 * 100), 0.05) + << "incorrect value for cp, expected 258.5, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 17) + << "incorrect value for sid.sat, expected 17, is " << last_msg_->sid.sat; + EXPECT_LT((last_msg_->snr * 100 - 35.6945114136 * 100), 0.05) + << "incorrect value for snr, expected 35.6945114136, is " + << last_msg_->snr; } -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -481,45 +495,55 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB4, Test) -{ - - uint8_t encoded_frame[] = {85,20,0,246,215,16,194,24,14,66,0,128,2,68,129,193,249,195,5,0,0,0,35,203, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_b_t* test_msg = ( msg_acq_result_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = -499.5117492675781; - test_msg->cp = 522.0; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 5; - test_msg->snr = 35.52417755126953; - - EXPECT_EQ(send_message( 0x14, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - -499.511749268*100), 0.05) << "incorrect value for cf, expected -499.511749268, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cp*100 - 522.0*100), 0.05) << "incorrect value for cp, expected 522.0, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 5) << "incorrect value for sid.sat, expected 5, is " << last_msg_->sid.sat; - EXPECT_LT((last_msg_->snr*100 - 35.5241775513*100), 0.05) << "incorrect value for snr, expected 35.5241775513, is " << last_msg_->snr; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepB4, Test) { + uint8_t encoded_frame[] = { + 85, 20, 0, 246, 215, 16, 194, 24, 14, 66, 0, 128, + 2, 68, 129, 193, 249, 195, 5, 0, 0, 0, 35, 203, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_b_t *test_msg = (msg_acq_result_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = -499.5117492675781; + test_msg->cp = 522.0; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 5; + test_msg->snr = 35.52417755126953; + + EXPECT_EQ(send_message(0x14, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - -499.511749268 * 100), 0.05) + << "incorrect value for cf, expected -499.511749268, is " + << last_msg_->cf; + EXPECT_LT((last_msg_->cp * 100 - 522.0 * 100), 0.05) + << "incorrect value for cp, expected 522.0, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 5) + << "incorrect value for sid.sat, expected 5, is " << last_msg_->sid.sat; + EXPECT_LT((last_msg_->snr * 100 - 35.5241775513 * 100), 0.05) + << "incorrect value for snr, expected 35.5241775513, is " + << last_msg_->snr; } diff --git a/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResultDepC.cc b/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResultDepC.cc index f3023e9d8..7561b4a35 100644 --- a/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResultDepC.cc +++ b/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqResultDepC.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqResultDepC.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_c_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,96 +82,100 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_c_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC0, Test) -{ - - uint8_t encoded_frame[] = {85,31,0,40,12,16,72,9,34,66,155,152,228,67,28,34,221,68,10,0,0,0,9,189, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_c_t* test_msg = ( msg_acq_result_dep_c_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = 1769.06591796875; - test_msg->cn0 = 40.509063720703125; - test_msg->cp = 457.1922302246094; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 10; - - EXPECT_EQ(send_message( 0x1f, 3112, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 3112); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - 1769.06591797*100), 0.05) << "incorrect value for cf, expected 1769.06591797, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cn0*100 - 40.5090637207*100), 0.05) << "incorrect value for cn0, expected 40.5090637207, is " << last_msg_->cn0; - EXPECT_LT((last_msg_->cp*100 - 457.192230225*100), 0.05) << "incorrect value for cp, expected 457.192230225, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 10) << "incorrect value for sid.sat, expected 10, is " << last_msg_->sid.sat; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC0, Test) { + uint8_t encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 72, 9, 34, 66, 155, 152, + 228, 67, 28, 34, 221, 68, 10, 0, 0, 0, 9, 189, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_c_t *test_msg = (msg_acq_result_dep_c_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = 1769.06591796875; + test_msg->cn0 = 40.509063720703125; + test_msg->cp = 457.1922302246094; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 10; + + EXPECT_EQ(send_message(0x1f, 3112, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 3112); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - 1769.06591797 * 100), 0.05) + << "incorrect value for cf, expected 1769.06591797, is " << last_msg_->cf; + EXPECT_LT((last_msg_->cn0 * 100 - 40.5090637207 * 100), 0.05) + << "incorrect value for cn0, expected 40.5090637207, is " + << last_msg_->cn0; + EXPECT_LT((last_msg_->cp * 100 - 457.192230225 * 100), 0.05) + << "incorrect value for cp, expected 457.192230225, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 10) + << "incorrect value for sid.sat, expected 10, is " << last_msg_->sid.sat; } -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_c_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -184,96 +185,101 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_c_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC1, Test) -{ - - uint8_t encoded_frame[] = {85,31,0,40,12,16,132,250,45,66,207,93,88,68,68,185,252,195,6,0,0,0,136,185, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_c_t* test_msg = ( msg_acq_result_dep_c_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = -505.4473876953125; - test_msg->cn0 = 43.49464416503906; - test_msg->cp = 865.4657592773438; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 6; - - EXPECT_EQ(send_message( 0x1f, 3112, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 3112); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - -505.447387695*100), 0.05) << "incorrect value for cf, expected -505.447387695, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cn0*100 - 43.494644165*100), 0.05) << "incorrect value for cn0, expected 43.494644165, is " << last_msg_->cn0; - EXPECT_LT((last_msg_->cp*100 - 865.465759277*100), 0.05) << "incorrect value for cp, expected 865.465759277, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 6) << "incorrect value for sid.sat, expected 6, is " << last_msg_->sid.sat; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC1, Test) { + uint8_t encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 132, 250, 45, 66, 207, 93, + 88, 68, 68, 185, 252, 195, 6, 0, 0, 0, 136, 185, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_c_t *test_msg = (msg_acq_result_dep_c_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = -505.4473876953125; + test_msg->cn0 = 43.49464416503906; + test_msg->cp = 865.4657592773438; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 6; + + EXPECT_EQ(send_message(0x1f, 3112, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 3112); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - -505.447387695 * 100), 0.05) + << "incorrect value for cf, expected -505.447387695, is " + << last_msg_->cf; + EXPECT_LT((last_msg_->cn0 * 100 - 43.494644165 * 100), 0.05) + << "incorrect value for cn0, expected 43.494644165, is " + << last_msg_->cn0; + EXPECT_LT((last_msg_->cp * 100 - 865.465759277 * 100), 0.05) + << "incorrect value for cp, expected 865.465759277, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 6) + << "incorrect value for sid.sat, expected 6, is " << last_msg_->sid.sat; } -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_c_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -283,96 +289,100 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_c_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC2, Test) -{ - - uint8_t encoded_frame[] = {85,31,0,40,12,16,163,223,24,66,64,91,102,67,202,243,157,196,13,0,0,0,150,161, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_c_t* test_msg = ( msg_acq_result_dep_c_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = -1263.618408203125; - test_msg->cn0 = 38.2183952331543; - test_msg->cp = 230.3564453125; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 13; - - EXPECT_EQ(send_message( 0x1f, 3112, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 3112); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - -1263.6184082*100), 0.05) << "incorrect value for cf, expected -1263.6184082, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cn0*100 - 38.2183952332*100), 0.05) << "incorrect value for cn0, expected 38.2183952332, is " << last_msg_->cn0; - EXPECT_LT((last_msg_->cp*100 - 230.356445312*100), 0.05) << "incorrect value for cp, expected 230.356445312, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 13) << "incorrect value for sid.sat, expected 13, is " << last_msg_->sid.sat; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC2, Test) { + uint8_t encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 163, 223, 24, 66, 64, 91, + 102, 67, 202, 243, 157, 196, 13, 0, 0, 0, 150, 161, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_c_t *test_msg = (msg_acq_result_dep_c_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = -1263.618408203125; + test_msg->cn0 = 38.2183952331543; + test_msg->cp = 230.3564453125; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 13; + + EXPECT_EQ(send_message(0x1f, 3112, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 3112); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - -1263.6184082 * 100), 0.05) + << "incorrect value for cf, expected -1263.6184082, is " << last_msg_->cf; + EXPECT_LT((last_msg_->cn0 * 100 - 38.2183952332 * 100), 0.05) + << "incorrect value for cn0, expected 38.2183952332, is " + << last_msg_->cn0; + EXPECT_LT((last_msg_->cp * 100 - 230.356445312 * 100), 0.05) + << "incorrect value for cp, expected 230.356445312, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 13) + << "incorrect value for sid.sat, expected 13, is " << last_msg_->sid.sat; } -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_c_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -382,96 +392,100 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_c_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC3, Test) -{ - - uint8_t encoded_frame[] = {85,31,0,40,12,16,129,65,21,66,224,214,124,67,243,138,61,69,1,0,0,0,109,209, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_c_t* test_msg = ( msg_acq_result_dep_c_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = 3032.684326171875; - test_msg->cn0 = 37.313968658447266; - test_msg->cp = 252.83935546875; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 1; - - EXPECT_EQ(send_message( 0x1f, 3112, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 3112); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - 3032.68432617*100), 0.05) << "incorrect value for cf, expected 3032.68432617, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cn0*100 - 37.3139686584*100), 0.05) << "incorrect value for cn0, expected 37.3139686584, is " << last_msg_->cn0; - EXPECT_LT((last_msg_->cp*100 - 252.839355469*100), 0.05) << "incorrect value for cp, expected 252.839355469, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 1) << "incorrect value for sid.sat, expected 1, is " << last_msg_->sid.sat; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC3, Test) { + uint8_t encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 129, 65, 21, 66, 224, 214, + 124, 67, 243, 138, 61, 69, 1, 0, 0, 0, 109, 209, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_c_t *test_msg = (msg_acq_result_dep_c_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = 3032.684326171875; + test_msg->cn0 = 37.313968658447266; + test_msg->cp = 252.83935546875; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 1; + + EXPECT_EQ(send_message(0x1f, 3112, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 3112); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - 3032.68432617 * 100), 0.05) + << "incorrect value for cf, expected 3032.68432617, is " << last_msg_->cf; + EXPECT_LT((last_msg_->cn0 * 100 - 37.3139686584 * 100), 0.05) + << "incorrect value for cn0, expected 37.3139686584, is " + << last_msg_->cn0; + EXPECT_LT((last_msg_->cp * 100 - 252.839355469 * 100), 0.05) + << "incorrect value for cp, expected 252.839355469, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 1) + << "incorrect value for sid.sat, expected 1, is " << last_msg_->sid.sat; } -class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_result_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_result_dep_c_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -481,45 +495,54 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_result_dep_c_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC4, Test) -{ - - uint8_t encoded_frame[] = {85,31,0,40,12,16,126,35,62,66,226,37,102,68,202,243,29,69,27,0,0,0,91,67, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_result_dep_c_t* test_msg = ( msg_acq_result_dep_c_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cf = 2527.23681640625; - test_msg->cn0 = 47.53466033935547; - test_msg->cp = 920.5919189453125; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 27; - - EXPECT_EQ(send_message( 0x1f, 3112, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 3112); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cf*100 - 2527.23681641*100), 0.05) << "incorrect value for cf, expected 2527.23681641, is " << last_msg_->cf; - EXPECT_LT((last_msg_->cn0*100 - 47.5346603394*100), 0.05) << "incorrect value for cn0, expected 47.5346603394, is " << last_msg_->cn0; - EXPECT_LT((last_msg_->cp*100 - 920.591918945*100), 0.05) << "incorrect value for cp, expected 920.591918945, is " << last_msg_->cp; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 27) << "incorrect value for sid.sat, expected 27, is " << last_msg_->sid.sat; +}; + +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqResultDepC4, Test) { + uint8_t encoded_frame[] = { + 85, 31, 0, 40, 12, 16, 126, 35, 62, 66, 226, 37, + 102, 68, 202, 243, 29, 69, 27, 0, 0, 0, 91, 67, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_result_dep_c_t *test_msg = (msg_acq_result_dep_c_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cf = 2527.23681640625; + test_msg->cn0 = 47.53466033935547; + test_msg->cp = 920.5919189453125; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 27; + + EXPECT_EQ(send_message(0x1f, 3112, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 3112); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cf * 100 - 2527.23681641 * 100), 0.05) + << "incorrect value for cf, expected 2527.23681641, is " << last_msg_->cf; + EXPECT_LT((last_msg_->cn0 * 100 - 47.5346603394 * 100), 0.05) + << "incorrect value for cn0, expected 47.5346603394, is " + << last_msg_->cn0; + EXPECT_LT((last_msg_->cp * 100 - 920.591918945 * 100), 0.05) + << "incorrect value for cp, expected 920.591918945, is " << last_msg_->cp; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 27) + << "incorrect value for sid.sat, expected 27, is " << last_msg_->sid.sat; } diff --git a/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqSvProfile.cc b/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqSvProfile.cc index ac8601313..4622b9993 100644 --- a/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqSvProfile.cc +++ b/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqSvProfile.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfile.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfile.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_sv_profile_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_sv_profile_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,123 +81,210 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_sv_profile_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile0, Test) -{ +}; - uint8_t encoded_frame[] = {85,46,0,195,4,99,7,13,38,0,97,22,0,174,0,52,0,0,0,49,0,0,0,61,0,0,0,147,0,0,0,47,0,0,0,140,0,0,0,166,210,59,0,253,23,1,121,0,190,0,0,0,175,0,0,0,175,0,0,0,142,0,0,0,237,0,0,0,12,0,0,0,126,88,21,0,153,24,0,8,0,130,0,0,0,172,0,0,0,91,0,0,0,191,0,0,0,84,0,0,0,82,0,0,0,168,177, }; +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfile0, Test) { + uint8_t encoded_frame[] = { + 85, 46, 0, 195, 4, 99, 7, 13, 38, 0, 97, 22, 0, 174, 0, 52, + 0, 0, 0, 49, 0, 0, 0, 61, 0, 0, 0, 147, 0, 0, 0, 47, + 0, 0, 0, 140, 0, 0, 0, 166, 210, 59, 0, 253, 23, 1, 121, 0, + 190, 0, 0, 0, 175, 0, 0, 0, 175, 0, 0, 0, 142, 0, 0, 0, + 237, 0, 0, 0, 12, 0, 0, 0, 126, 88, 21, 0, 153, 24, 0, 8, + 0, 130, 0, 0, 0, 172, 0, 0, 0, 91, 0, 0, 0, 191, 0, 0, + 0, 84, 0, 0, 0, 82, 0, 0, 0, 168, 177, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_sv_profile_t* test_msg = ( msg_acq_sv_profile_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->acq_sv_profile) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acq_sv_profile[0])); - } - test_msg->acq_sv_profile[0].bin_width = 174; - test_msg->acq_sv_profile[0].cf = 47; - test_msg->acq_sv_profile[0].cf_max = 147; - test_msg->acq_sv_profile[0].cf_min = 61; - test_msg->acq_sv_profile[0].cn0 = 38; - test_msg->acq_sv_profile[0].cp = 140; - test_msg->acq_sv_profile[0].int_time = 97; - test_msg->acq_sv_profile[0].job_type = 7; - test_msg->acq_sv_profile[0].sid.code = 0; - test_msg->acq_sv_profile[0].sid.sat = 22; - test_msg->acq_sv_profile[0].status = 13; - test_msg->acq_sv_profile[0].time_spent = 49; - test_msg->acq_sv_profile[0].timestamp = 52; - if (sizeof(test_msg->acq_sv_profile) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acq_sv_profile[0])); - } - test_msg->acq_sv_profile[1].bin_width = 121; - test_msg->acq_sv_profile[1].cf = 237; - test_msg->acq_sv_profile[1].cf_max = 142; - test_msg->acq_sv_profile[1].cf_min = 175; - test_msg->acq_sv_profile[1].cn0 = 59; - test_msg->acq_sv_profile[1].cp = 12; - test_msg->acq_sv_profile[1].int_time = 253; - test_msg->acq_sv_profile[1].job_type = 166; - test_msg->acq_sv_profile[1].sid.code = 1; - test_msg->acq_sv_profile[1].sid.sat = 23; - test_msg->acq_sv_profile[1].status = 210; - test_msg->acq_sv_profile[1].time_spent = 175; - test_msg->acq_sv_profile[1].timestamp = 190; - if (sizeof(test_msg->acq_sv_profile) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acq_sv_profile[0])); - } - test_msg->acq_sv_profile[2].bin_width = 8; - test_msg->acq_sv_profile[2].cf = 84; - test_msg->acq_sv_profile[2].cf_max = 191; - test_msg->acq_sv_profile[2].cf_min = 91; - test_msg->acq_sv_profile[2].cn0 = 21; - test_msg->acq_sv_profile[2].cp = 82; - test_msg->acq_sv_profile[2].int_time = 153; - test_msg->acq_sv_profile[2].job_type = 126; - test_msg->acq_sv_profile[2].sid.code = 0; - test_msg->acq_sv_profile[2].sid.sat = 24; - test_msg->acq_sv_profile[2].status = 88; - test_msg->acq_sv_profile[2].time_spent = 172; - test_msg->acq_sv_profile[2].timestamp = 130; - - EXPECT_EQ(send_message( 0x2e, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_sv_profile_t *test_msg = (msg_acq_sv_profile_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->acq_sv_profile) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->acq_sv_profile[0])); + } + test_msg->acq_sv_profile[0].bin_width = 174; + test_msg->acq_sv_profile[0].cf = 47; + test_msg->acq_sv_profile[0].cf_max = 147; + test_msg->acq_sv_profile[0].cf_min = 61; + test_msg->acq_sv_profile[0].cn0 = 38; + test_msg->acq_sv_profile[0].cp = 140; + test_msg->acq_sv_profile[0].int_time = 97; + test_msg->acq_sv_profile[0].job_type = 7; + test_msg->acq_sv_profile[0].sid.code = 0; + test_msg->acq_sv_profile[0].sid.sat = 22; + test_msg->acq_sv_profile[0].status = 13; + test_msg->acq_sv_profile[0].time_spent = 49; + test_msg->acq_sv_profile[0].timestamp = 52; + if (sizeof(test_msg->acq_sv_profile) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->acq_sv_profile[0])); + } + test_msg->acq_sv_profile[1].bin_width = 121; + test_msg->acq_sv_profile[1].cf = 237; + test_msg->acq_sv_profile[1].cf_max = 142; + test_msg->acq_sv_profile[1].cf_min = 175; + test_msg->acq_sv_profile[1].cn0 = 59; + test_msg->acq_sv_profile[1].cp = 12; + test_msg->acq_sv_profile[1].int_time = 253; + test_msg->acq_sv_profile[1].job_type = 166; + test_msg->acq_sv_profile[1].sid.code = 1; + test_msg->acq_sv_profile[1].sid.sat = 23; + test_msg->acq_sv_profile[1].status = 210; + test_msg->acq_sv_profile[1].time_spent = 175; + test_msg->acq_sv_profile[1].timestamp = 190; + if (sizeof(test_msg->acq_sv_profile) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->acq_sv_profile[0])); + } + test_msg->acq_sv_profile[2].bin_width = 8; + test_msg->acq_sv_profile[2].cf = 84; + test_msg->acq_sv_profile[2].cf_max = 191; + test_msg->acq_sv_profile[2].cf_min = 91; + test_msg->acq_sv_profile[2].cn0 = 21; + test_msg->acq_sv_profile[2].cp = 82; + test_msg->acq_sv_profile[2].int_time = 153; + test_msg->acq_sv_profile[2].job_type = 126; + test_msg->acq_sv_profile[2].sid.code = 0; + test_msg->acq_sv_profile[2].sid.sat = 24; + test_msg->acq_sv_profile[2].status = 88; + test_msg->acq_sv_profile[2].time_spent = 172; + test_msg->acq_sv_profile[2].timestamp = 130; + + EXPECT_EQ(send_message(0x2e, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->acq_sv_profile[0].bin_width, 174) << "incorrect value for acq_sv_profile[0].bin_width, expected 174, is " << last_msg_->acq_sv_profile[0].bin_width; - EXPECT_EQ(last_msg_->acq_sv_profile[0].cf, 47) << "incorrect value for acq_sv_profile[0].cf, expected 47, is " << last_msg_->acq_sv_profile[0].cf; - EXPECT_EQ(last_msg_->acq_sv_profile[0].cf_max, 147) << "incorrect value for acq_sv_profile[0].cf_max, expected 147, is " << last_msg_->acq_sv_profile[0].cf_max; - EXPECT_EQ(last_msg_->acq_sv_profile[0].cf_min, 61) << "incorrect value for acq_sv_profile[0].cf_min, expected 61, is " << last_msg_->acq_sv_profile[0].cf_min; - EXPECT_EQ(last_msg_->acq_sv_profile[0].cn0, 38) << "incorrect value for acq_sv_profile[0].cn0, expected 38, is " << last_msg_->acq_sv_profile[0].cn0; - EXPECT_EQ(last_msg_->acq_sv_profile[0].cp, 140) << "incorrect value for acq_sv_profile[0].cp, expected 140, is " << last_msg_->acq_sv_profile[0].cp; - EXPECT_EQ(last_msg_->acq_sv_profile[0].int_time, 97) << "incorrect value for acq_sv_profile[0].int_time, expected 97, is " << last_msg_->acq_sv_profile[0].int_time; - EXPECT_EQ(last_msg_->acq_sv_profile[0].job_type, 7) << "incorrect value for acq_sv_profile[0].job_type, expected 7, is " << last_msg_->acq_sv_profile[0].job_type; - EXPECT_EQ(last_msg_->acq_sv_profile[0].sid.code, 0) << "incorrect value for acq_sv_profile[0].sid.code, expected 0, is " << last_msg_->acq_sv_profile[0].sid.code; - EXPECT_EQ(last_msg_->acq_sv_profile[0].sid.sat, 22) << "incorrect value for acq_sv_profile[0].sid.sat, expected 22, is " << last_msg_->acq_sv_profile[0].sid.sat; - EXPECT_EQ(last_msg_->acq_sv_profile[0].status, 13) << "incorrect value for acq_sv_profile[0].status, expected 13, is " << last_msg_->acq_sv_profile[0].status; - EXPECT_EQ(last_msg_->acq_sv_profile[0].time_spent, 49) << "incorrect value for acq_sv_profile[0].time_spent, expected 49, is " << last_msg_->acq_sv_profile[0].time_spent; - EXPECT_EQ(last_msg_->acq_sv_profile[0].timestamp, 52) << "incorrect value for acq_sv_profile[0].timestamp, expected 52, is " << last_msg_->acq_sv_profile[0].timestamp; - EXPECT_EQ(last_msg_->acq_sv_profile[1].bin_width, 121) << "incorrect value for acq_sv_profile[1].bin_width, expected 121, is " << last_msg_->acq_sv_profile[1].bin_width; - EXPECT_EQ(last_msg_->acq_sv_profile[1].cf, 237) << "incorrect value for acq_sv_profile[1].cf, expected 237, is " << last_msg_->acq_sv_profile[1].cf; - EXPECT_EQ(last_msg_->acq_sv_profile[1].cf_max, 142) << "incorrect value for acq_sv_profile[1].cf_max, expected 142, is " << last_msg_->acq_sv_profile[1].cf_max; - EXPECT_EQ(last_msg_->acq_sv_profile[1].cf_min, 175) << "incorrect value for acq_sv_profile[1].cf_min, expected 175, is " << last_msg_->acq_sv_profile[1].cf_min; - EXPECT_EQ(last_msg_->acq_sv_profile[1].cn0, 59) << "incorrect value for acq_sv_profile[1].cn0, expected 59, is " << last_msg_->acq_sv_profile[1].cn0; - EXPECT_EQ(last_msg_->acq_sv_profile[1].cp, 12) << "incorrect value for acq_sv_profile[1].cp, expected 12, is " << last_msg_->acq_sv_profile[1].cp; - EXPECT_EQ(last_msg_->acq_sv_profile[1].int_time, 253) << "incorrect value for acq_sv_profile[1].int_time, expected 253, is " << last_msg_->acq_sv_profile[1].int_time; - EXPECT_EQ(last_msg_->acq_sv_profile[1].job_type, 166) << "incorrect value for acq_sv_profile[1].job_type, expected 166, is " << last_msg_->acq_sv_profile[1].job_type; - EXPECT_EQ(last_msg_->acq_sv_profile[1].sid.code, 1) << "incorrect value for acq_sv_profile[1].sid.code, expected 1, is " << last_msg_->acq_sv_profile[1].sid.code; - EXPECT_EQ(last_msg_->acq_sv_profile[1].sid.sat, 23) << "incorrect value for acq_sv_profile[1].sid.sat, expected 23, is " << last_msg_->acq_sv_profile[1].sid.sat; - EXPECT_EQ(last_msg_->acq_sv_profile[1].status, 210) << "incorrect value for acq_sv_profile[1].status, expected 210, is " << last_msg_->acq_sv_profile[1].status; - EXPECT_EQ(last_msg_->acq_sv_profile[1].time_spent, 175) << "incorrect value for acq_sv_profile[1].time_spent, expected 175, is " << last_msg_->acq_sv_profile[1].time_spent; - EXPECT_EQ(last_msg_->acq_sv_profile[1].timestamp, 190) << "incorrect value for acq_sv_profile[1].timestamp, expected 190, is " << last_msg_->acq_sv_profile[1].timestamp; - EXPECT_EQ(last_msg_->acq_sv_profile[2].bin_width, 8) << "incorrect value for acq_sv_profile[2].bin_width, expected 8, is " << last_msg_->acq_sv_profile[2].bin_width; - EXPECT_EQ(last_msg_->acq_sv_profile[2].cf, 84) << "incorrect value for acq_sv_profile[2].cf, expected 84, is " << last_msg_->acq_sv_profile[2].cf; - EXPECT_EQ(last_msg_->acq_sv_profile[2].cf_max, 191) << "incorrect value for acq_sv_profile[2].cf_max, expected 191, is " << last_msg_->acq_sv_profile[2].cf_max; - EXPECT_EQ(last_msg_->acq_sv_profile[2].cf_min, 91) << "incorrect value for acq_sv_profile[2].cf_min, expected 91, is " << last_msg_->acq_sv_profile[2].cf_min; - EXPECT_EQ(last_msg_->acq_sv_profile[2].cn0, 21) << "incorrect value for acq_sv_profile[2].cn0, expected 21, is " << last_msg_->acq_sv_profile[2].cn0; - EXPECT_EQ(last_msg_->acq_sv_profile[2].cp, 82) << "incorrect value for acq_sv_profile[2].cp, expected 82, is " << last_msg_->acq_sv_profile[2].cp; - EXPECT_EQ(last_msg_->acq_sv_profile[2].int_time, 153) << "incorrect value for acq_sv_profile[2].int_time, expected 153, is " << last_msg_->acq_sv_profile[2].int_time; - EXPECT_EQ(last_msg_->acq_sv_profile[2].job_type, 126) << "incorrect value for acq_sv_profile[2].job_type, expected 126, is " << last_msg_->acq_sv_profile[2].job_type; - EXPECT_EQ(last_msg_->acq_sv_profile[2].sid.code, 0) << "incorrect value for acq_sv_profile[2].sid.code, expected 0, is " << last_msg_->acq_sv_profile[2].sid.code; - EXPECT_EQ(last_msg_->acq_sv_profile[2].sid.sat, 24) << "incorrect value for acq_sv_profile[2].sid.sat, expected 24, is " << last_msg_->acq_sv_profile[2].sid.sat; - EXPECT_EQ(last_msg_->acq_sv_profile[2].status, 88) << "incorrect value for acq_sv_profile[2].status, expected 88, is " << last_msg_->acq_sv_profile[2].status; - EXPECT_EQ(last_msg_->acq_sv_profile[2].time_spent, 172) << "incorrect value for acq_sv_profile[2].time_spent, expected 172, is " << last_msg_->acq_sv_profile[2].time_spent; - EXPECT_EQ(last_msg_->acq_sv_profile[2].timestamp, 130) << "incorrect value for acq_sv_profile[2].timestamp, expected 130, is " << last_msg_->acq_sv_profile[2].timestamp; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->acq_sv_profile[0].bin_width, 174) + << "incorrect value for acq_sv_profile[0].bin_width, expected 174, is " + << last_msg_->acq_sv_profile[0].bin_width; + EXPECT_EQ(last_msg_->acq_sv_profile[0].cf, 47) + << "incorrect value for acq_sv_profile[0].cf, expected 47, is " + << last_msg_->acq_sv_profile[0].cf; + EXPECT_EQ(last_msg_->acq_sv_profile[0].cf_max, 147) + << "incorrect value for acq_sv_profile[0].cf_max, expected 147, is " + << last_msg_->acq_sv_profile[0].cf_max; + EXPECT_EQ(last_msg_->acq_sv_profile[0].cf_min, 61) + << "incorrect value for acq_sv_profile[0].cf_min, expected 61, is " + << last_msg_->acq_sv_profile[0].cf_min; + EXPECT_EQ(last_msg_->acq_sv_profile[0].cn0, 38) + << "incorrect value for acq_sv_profile[0].cn0, expected 38, is " + << last_msg_->acq_sv_profile[0].cn0; + EXPECT_EQ(last_msg_->acq_sv_profile[0].cp, 140) + << "incorrect value for acq_sv_profile[0].cp, expected 140, is " + << last_msg_->acq_sv_profile[0].cp; + EXPECT_EQ(last_msg_->acq_sv_profile[0].int_time, 97) + << "incorrect value for acq_sv_profile[0].int_time, expected 97, is " + << last_msg_->acq_sv_profile[0].int_time; + EXPECT_EQ(last_msg_->acq_sv_profile[0].job_type, 7) + << "incorrect value for acq_sv_profile[0].job_type, expected 7, is " + << last_msg_->acq_sv_profile[0].job_type; + EXPECT_EQ(last_msg_->acq_sv_profile[0].sid.code, 0) + << "incorrect value for acq_sv_profile[0].sid.code, expected 0, is " + << last_msg_->acq_sv_profile[0].sid.code; + EXPECT_EQ(last_msg_->acq_sv_profile[0].sid.sat, 22) + << "incorrect value for acq_sv_profile[0].sid.sat, expected 22, is " + << last_msg_->acq_sv_profile[0].sid.sat; + EXPECT_EQ(last_msg_->acq_sv_profile[0].status, 13) + << "incorrect value for acq_sv_profile[0].status, expected 13, is " + << last_msg_->acq_sv_profile[0].status; + EXPECT_EQ(last_msg_->acq_sv_profile[0].time_spent, 49) + << "incorrect value for acq_sv_profile[0].time_spent, expected 49, is " + << last_msg_->acq_sv_profile[0].time_spent; + EXPECT_EQ(last_msg_->acq_sv_profile[0].timestamp, 52) + << "incorrect value for acq_sv_profile[0].timestamp, expected 52, is " + << last_msg_->acq_sv_profile[0].timestamp; + EXPECT_EQ(last_msg_->acq_sv_profile[1].bin_width, 121) + << "incorrect value for acq_sv_profile[1].bin_width, expected 121, is " + << last_msg_->acq_sv_profile[1].bin_width; + EXPECT_EQ(last_msg_->acq_sv_profile[1].cf, 237) + << "incorrect value for acq_sv_profile[1].cf, expected 237, is " + << last_msg_->acq_sv_profile[1].cf; + EXPECT_EQ(last_msg_->acq_sv_profile[1].cf_max, 142) + << "incorrect value for acq_sv_profile[1].cf_max, expected 142, is " + << last_msg_->acq_sv_profile[1].cf_max; + EXPECT_EQ(last_msg_->acq_sv_profile[1].cf_min, 175) + << "incorrect value for acq_sv_profile[1].cf_min, expected 175, is " + << last_msg_->acq_sv_profile[1].cf_min; + EXPECT_EQ(last_msg_->acq_sv_profile[1].cn0, 59) + << "incorrect value for acq_sv_profile[1].cn0, expected 59, is " + << last_msg_->acq_sv_profile[1].cn0; + EXPECT_EQ(last_msg_->acq_sv_profile[1].cp, 12) + << "incorrect value for acq_sv_profile[1].cp, expected 12, is " + << last_msg_->acq_sv_profile[1].cp; + EXPECT_EQ(last_msg_->acq_sv_profile[1].int_time, 253) + << "incorrect value for acq_sv_profile[1].int_time, expected 253, is " + << last_msg_->acq_sv_profile[1].int_time; + EXPECT_EQ(last_msg_->acq_sv_profile[1].job_type, 166) + << "incorrect value for acq_sv_profile[1].job_type, expected 166, is " + << last_msg_->acq_sv_profile[1].job_type; + EXPECT_EQ(last_msg_->acq_sv_profile[1].sid.code, 1) + << "incorrect value for acq_sv_profile[1].sid.code, expected 1, is " + << last_msg_->acq_sv_profile[1].sid.code; + EXPECT_EQ(last_msg_->acq_sv_profile[1].sid.sat, 23) + << "incorrect value for acq_sv_profile[1].sid.sat, expected 23, is " + << last_msg_->acq_sv_profile[1].sid.sat; + EXPECT_EQ(last_msg_->acq_sv_profile[1].status, 210) + << "incorrect value for acq_sv_profile[1].status, expected 210, is " + << last_msg_->acq_sv_profile[1].status; + EXPECT_EQ(last_msg_->acq_sv_profile[1].time_spent, 175) + << "incorrect value for acq_sv_profile[1].time_spent, expected 175, is " + << last_msg_->acq_sv_profile[1].time_spent; + EXPECT_EQ(last_msg_->acq_sv_profile[1].timestamp, 190) + << "incorrect value for acq_sv_profile[1].timestamp, expected 190, is " + << last_msg_->acq_sv_profile[1].timestamp; + EXPECT_EQ(last_msg_->acq_sv_profile[2].bin_width, 8) + << "incorrect value for acq_sv_profile[2].bin_width, expected 8, is " + << last_msg_->acq_sv_profile[2].bin_width; + EXPECT_EQ(last_msg_->acq_sv_profile[2].cf, 84) + << "incorrect value for acq_sv_profile[2].cf, expected 84, is " + << last_msg_->acq_sv_profile[2].cf; + EXPECT_EQ(last_msg_->acq_sv_profile[2].cf_max, 191) + << "incorrect value for acq_sv_profile[2].cf_max, expected 191, is " + << last_msg_->acq_sv_profile[2].cf_max; + EXPECT_EQ(last_msg_->acq_sv_profile[2].cf_min, 91) + << "incorrect value for acq_sv_profile[2].cf_min, expected 91, is " + << last_msg_->acq_sv_profile[2].cf_min; + EXPECT_EQ(last_msg_->acq_sv_profile[2].cn0, 21) + << "incorrect value for acq_sv_profile[2].cn0, expected 21, is " + << last_msg_->acq_sv_profile[2].cn0; + EXPECT_EQ(last_msg_->acq_sv_profile[2].cp, 82) + << "incorrect value for acq_sv_profile[2].cp, expected 82, is " + << last_msg_->acq_sv_profile[2].cp; + EXPECT_EQ(last_msg_->acq_sv_profile[2].int_time, 153) + << "incorrect value for acq_sv_profile[2].int_time, expected 153, is " + << last_msg_->acq_sv_profile[2].int_time; + EXPECT_EQ(last_msg_->acq_sv_profile[2].job_type, 126) + << "incorrect value for acq_sv_profile[2].job_type, expected 126, is " + << last_msg_->acq_sv_profile[2].job_type; + EXPECT_EQ(last_msg_->acq_sv_profile[2].sid.code, 0) + << "incorrect value for acq_sv_profile[2].sid.code, expected 0, is " + << last_msg_->acq_sv_profile[2].sid.code; + EXPECT_EQ(last_msg_->acq_sv_profile[2].sid.sat, 24) + << "incorrect value for acq_sv_profile[2].sid.sat, expected 24, is " + << last_msg_->acq_sv_profile[2].sid.sat; + EXPECT_EQ(last_msg_->acq_sv_profile[2].status, 88) + << "incorrect value for acq_sv_profile[2].status, expected 88, is " + << last_msg_->acq_sv_profile[2].status; + EXPECT_EQ(last_msg_->acq_sv_profile[2].time_spent, 172) + << "incorrect value for acq_sv_profile[2].time_spent, expected 172, is " + << last_msg_->acq_sv_profile[2].time_spent; + EXPECT_EQ(last_msg_->acq_sv_profile[2].timestamp, 130) + << "incorrect value for acq_sv_profile[2].timestamp, expected 130, is " + << last_msg_->acq_sv_profile[2].timestamp; } diff --git a/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqSvProfileDep.cc b/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqSvProfileDep.cc index 2953ca0b4..9af781b7a 100644 --- a/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqSvProfileDep.cc +++ b/c/test/legacy/cpp/auto_check_sbp_acquisition_MsgAcqSvProfileDep.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfileDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/acquisition/test_MsgAcqSvProfileDep.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acq_sv_profile_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acq_sv_profile_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,129 +82,224 @@ class Test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acq_sv_profile_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep0, Test) -{ +}; - uint8_t encoded_frame[] = {85,30,0,195,4,105,67,103,151,0,12,22,0,0,0,187,0,91,0,0,0,75,0,0,0,132,0,0,0,36,0,0,0,60,0,0,0,241,0,0,0,238,38,111,0,179,23,0,1,0,176,0,166,0,0,0,234,0,0,0,155,0,0,0,24,0,0,0,212,0,0,0,247,0,0,0,142,213,68,0,53,24,0,0,0,52,0,49,0,0,0,245,0,0,0,76,0,0,0,248,0,0,0,212,0,0,0,101,0,0,0,67,132, }; +TEST_F(Test_legacy_auto_check_sbp_acquisition_MsgAcqSvProfileDep0, Test) { + uint8_t encoded_frame[] = { + 85, 30, 0, 195, 4, 105, 67, 103, 151, 0, 12, 22, 0, 0, 0, + 187, 0, 91, 0, 0, 0, 75, 0, 0, 0, 132, 0, 0, 0, 36, + 0, 0, 0, 60, 0, 0, 0, 241, 0, 0, 0, 238, 38, 111, 0, + 179, 23, 0, 1, 0, 176, 0, 166, 0, 0, 0, 234, 0, 0, 0, + 155, 0, 0, 0, 24, 0, 0, 0, 212, 0, 0, 0, 247, 0, 0, + 0, 142, 213, 68, 0, 53, 24, 0, 0, 0, 52, 0, 49, 0, 0, + 0, 245, 0, 0, 0, 76, 0, 0, 0, 248, 0, 0, 0, 212, 0, + 0, 0, 101, 0, 0, 0, 67, 132, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acq_sv_profile_dep_t* test_msg = ( msg_acq_sv_profile_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->acq_sv_profile) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acq_sv_profile[0])); - } - test_msg->acq_sv_profile[0].bin_width = 187; - test_msg->acq_sv_profile[0].cf = 60; - test_msg->acq_sv_profile[0].cf_max = 36; - test_msg->acq_sv_profile[0].cf_min = 132; - test_msg->acq_sv_profile[0].cn0 = 151; - test_msg->acq_sv_profile[0].cp = 241; - test_msg->acq_sv_profile[0].int_time = 12; - test_msg->acq_sv_profile[0].job_type = 67; - test_msg->acq_sv_profile[0].sid.code = 0; - test_msg->acq_sv_profile[0].sid.reserved = 0; - test_msg->acq_sv_profile[0].sid.sat = 22; - test_msg->acq_sv_profile[0].status = 103; - test_msg->acq_sv_profile[0].time_spent = 75; - test_msg->acq_sv_profile[0].timestamp = 91; - if (sizeof(test_msg->acq_sv_profile) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acq_sv_profile[0])); - } - test_msg->acq_sv_profile[1].bin_width = 176; - test_msg->acq_sv_profile[1].cf = 212; - test_msg->acq_sv_profile[1].cf_max = 24; - test_msg->acq_sv_profile[1].cf_min = 155; - test_msg->acq_sv_profile[1].cn0 = 111; - test_msg->acq_sv_profile[1].cp = 247; - test_msg->acq_sv_profile[1].int_time = 179; - test_msg->acq_sv_profile[1].job_type = 238; - test_msg->acq_sv_profile[1].sid.code = 1; - test_msg->acq_sv_profile[1].sid.reserved = 0; - test_msg->acq_sv_profile[1].sid.sat = 23; - test_msg->acq_sv_profile[1].status = 38; - test_msg->acq_sv_profile[1].time_spent = 234; - test_msg->acq_sv_profile[1].timestamp = 166; - if (sizeof(test_msg->acq_sv_profile) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acq_sv_profile[0])); - } - test_msg->acq_sv_profile[2].bin_width = 52; - test_msg->acq_sv_profile[2].cf = 212; - test_msg->acq_sv_profile[2].cf_max = 248; - test_msg->acq_sv_profile[2].cf_min = 76; - test_msg->acq_sv_profile[2].cn0 = 68; - test_msg->acq_sv_profile[2].cp = 101; - test_msg->acq_sv_profile[2].int_time = 53; - test_msg->acq_sv_profile[2].job_type = 142; - test_msg->acq_sv_profile[2].sid.code = 0; - test_msg->acq_sv_profile[2].sid.reserved = 0; - test_msg->acq_sv_profile[2].sid.sat = 24; - test_msg->acq_sv_profile[2].status = 213; - test_msg->acq_sv_profile[2].time_spent = 245; - test_msg->acq_sv_profile[2].timestamp = 49; - - EXPECT_EQ(send_message( 0x1e, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acq_sv_profile_dep_t *test_msg = + (msg_acq_sv_profile_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->acq_sv_profile) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->acq_sv_profile[0])); + } + test_msg->acq_sv_profile[0].bin_width = 187; + test_msg->acq_sv_profile[0].cf = 60; + test_msg->acq_sv_profile[0].cf_max = 36; + test_msg->acq_sv_profile[0].cf_min = 132; + test_msg->acq_sv_profile[0].cn0 = 151; + test_msg->acq_sv_profile[0].cp = 241; + test_msg->acq_sv_profile[0].int_time = 12; + test_msg->acq_sv_profile[0].job_type = 67; + test_msg->acq_sv_profile[0].sid.code = 0; + test_msg->acq_sv_profile[0].sid.reserved = 0; + test_msg->acq_sv_profile[0].sid.sat = 22; + test_msg->acq_sv_profile[0].status = 103; + test_msg->acq_sv_profile[0].time_spent = 75; + test_msg->acq_sv_profile[0].timestamp = 91; + if (sizeof(test_msg->acq_sv_profile) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->acq_sv_profile[0])); + } + test_msg->acq_sv_profile[1].bin_width = 176; + test_msg->acq_sv_profile[1].cf = 212; + test_msg->acq_sv_profile[1].cf_max = 24; + test_msg->acq_sv_profile[1].cf_min = 155; + test_msg->acq_sv_profile[1].cn0 = 111; + test_msg->acq_sv_profile[1].cp = 247; + test_msg->acq_sv_profile[1].int_time = 179; + test_msg->acq_sv_profile[1].job_type = 238; + test_msg->acq_sv_profile[1].sid.code = 1; + test_msg->acq_sv_profile[1].sid.reserved = 0; + test_msg->acq_sv_profile[1].sid.sat = 23; + test_msg->acq_sv_profile[1].status = 38; + test_msg->acq_sv_profile[1].time_spent = 234; + test_msg->acq_sv_profile[1].timestamp = 166; + if (sizeof(test_msg->acq_sv_profile) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->acq_sv_profile[0])); + } + test_msg->acq_sv_profile[2].bin_width = 52; + test_msg->acq_sv_profile[2].cf = 212; + test_msg->acq_sv_profile[2].cf_max = 248; + test_msg->acq_sv_profile[2].cf_min = 76; + test_msg->acq_sv_profile[2].cn0 = 68; + test_msg->acq_sv_profile[2].cp = 101; + test_msg->acq_sv_profile[2].int_time = 53; + test_msg->acq_sv_profile[2].job_type = 142; + test_msg->acq_sv_profile[2].sid.code = 0; + test_msg->acq_sv_profile[2].sid.reserved = 0; + test_msg->acq_sv_profile[2].sid.sat = 24; + test_msg->acq_sv_profile[2].status = 213; + test_msg->acq_sv_profile[2].time_spent = 245; + test_msg->acq_sv_profile[2].timestamp = 49; + + EXPECT_EQ(send_message(0x1e, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->acq_sv_profile[0].bin_width, 187) << "incorrect value for acq_sv_profile[0].bin_width, expected 187, is " << last_msg_->acq_sv_profile[0].bin_width; - EXPECT_EQ(last_msg_->acq_sv_profile[0].cf, 60) << "incorrect value for acq_sv_profile[0].cf, expected 60, is " << last_msg_->acq_sv_profile[0].cf; - EXPECT_EQ(last_msg_->acq_sv_profile[0].cf_max, 36) << "incorrect value for acq_sv_profile[0].cf_max, expected 36, is " << last_msg_->acq_sv_profile[0].cf_max; - EXPECT_EQ(last_msg_->acq_sv_profile[0].cf_min, 132) << "incorrect value for acq_sv_profile[0].cf_min, expected 132, is " << last_msg_->acq_sv_profile[0].cf_min; - EXPECT_EQ(last_msg_->acq_sv_profile[0].cn0, 151) << "incorrect value for acq_sv_profile[0].cn0, expected 151, is " << last_msg_->acq_sv_profile[0].cn0; - EXPECT_EQ(last_msg_->acq_sv_profile[0].cp, 241) << "incorrect value for acq_sv_profile[0].cp, expected 241, is " << last_msg_->acq_sv_profile[0].cp; - EXPECT_EQ(last_msg_->acq_sv_profile[0].int_time, 12) << "incorrect value for acq_sv_profile[0].int_time, expected 12, is " << last_msg_->acq_sv_profile[0].int_time; - EXPECT_EQ(last_msg_->acq_sv_profile[0].job_type, 67) << "incorrect value for acq_sv_profile[0].job_type, expected 67, is " << last_msg_->acq_sv_profile[0].job_type; - EXPECT_EQ(last_msg_->acq_sv_profile[0].sid.code, 0) << "incorrect value for acq_sv_profile[0].sid.code, expected 0, is " << last_msg_->acq_sv_profile[0].sid.code; - EXPECT_EQ(last_msg_->acq_sv_profile[0].sid.reserved, 0) << "incorrect value for acq_sv_profile[0].sid.reserved, expected 0, is " << last_msg_->acq_sv_profile[0].sid.reserved; - EXPECT_EQ(last_msg_->acq_sv_profile[0].sid.sat, 22) << "incorrect value for acq_sv_profile[0].sid.sat, expected 22, is " << last_msg_->acq_sv_profile[0].sid.sat; - EXPECT_EQ(last_msg_->acq_sv_profile[0].status, 103) << "incorrect value for acq_sv_profile[0].status, expected 103, is " << last_msg_->acq_sv_profile[0].status; - EXPECT_EQ(last_msg_->acq_sv_profile[0].time_spent, 75) << "incorrect value for acq_sv_profile[0].time_spent, expected 75, is " << last_msg_->acq_sv_profile[0].time_spent; - EXPECT_EQ(last_msg_->acq_sv_profile[0].timestamp, 91) << "incorrect value for acq_sv_profile[0].timestamp, expected 91, is " << last_msg_->acq_sv_profile[0].timestamp; - EXPECT_EQ(last_msg_->acq_sv_profile[1].bin_width, 176) << "incorrect value for acq_sv_profile[1].bin_width, expected 176, is " << last_msg_->acq_sv_profile[1].bin_width; - EXPECT_EQ(last_msg_->acq_sv_profile[1].cf, 212) << "incorrect value for acq_sv_profile[1].cf, expected 212, is " << last_msg_->acq_sv_profile[1].cf; - EXPECT_EQ(last_msg_->acq_sv_profile[1].cf_max, 24) << "incorrect value for acq_sv_profile[1].cf_max, expected 24, is " << last_msg_->acq_sv_profile[1].cf_max; - EXPECT_EQ(last_msg_->acq_sv_profile[1].cf_min, 155) << "incorrect value for acq_sv_profile[1].cf_min, expected 155, is " << last_msg_->acq_sv_profile[1].cf_min; - EXPECT_EQ(last_msg_->acq_sv_profile[1].cn0, 111) << "incorrect value for acq_sv_profile[1].cn0, expected 111, is " << last_msg_->acq_sv_profile[1].cn0; - EXPECT_EQ(last_msg_->acq_sv_profile[1].cp, 247) << "incorrect value for acq_sv_profile[1].cp, expected 247, is " << last_msg_->acq_sv_profile[1].cp; - EXPECT_EQ(last_msg_->acq_sv_profile[1].int_time, 179) << "incorrect value for acq_sv_profile[1].int_time, expected 179, is " << last_msg_->acq_sv_profile[1].int_time; - EXPECT_EQ(last_msg_->acq_sv_profile[1].job_type, 238) << "incorrect value for acq_sv_profile[1].job_type, expected 238, is " << last_msg_->acq_sv_profile[1].job_type; - EXPECT_EQ(last_msg_->acq_sv_profile[1].sid.code, 1) << "incorrect value for acq_sv_profile[1].sid.code, expected 1, is " << last_msg_->acq_sv_profile[1].sid.code; - EXPECT_EQ(last_msg_->acq_sv_profile[1].sid.reserved, 0) << "incorrect value for acq_sv_profile[1].sid.reserved, expected 0, is " << last_msg_->acq_sv_profile[1].sid.reserved; - EXPECT_EQ(last_msg_->acq_sv_profile[1].sid.sat, 23) << "incorrect value for acq_sv_profile[1].sid.sat, expected 23, is " << last_msg_->acq_sv_profile[1].sid.sat; - EXPECT_EQ(last_msg_->acq_sv_profile[1].status, 38) << "incorrect value for acq_sv_profile[1].status, expected 38, is " << last_msg_->acq_sv_profile[1].status; - EXPECT_EQ(last_msg_->acq_sv_profile[1].time_spent, 234) << "incorrect value for acq_sv_profile[1].time_spent, expected 234, is " << last_msg_->acq_sv_profile[1].time_spent; - EXPECT_EQ(last_msg_->acq_sv_profile[1].timestamp, 166) << "incorrect value for acq_sv_profile[1].timestamp, expected 166, is " << last_msg_->acq_sv_profile[1].timestamp; - EXPECT_EQ(last_msg_->acq_sv_profile[2].bin_width, 52) << "incorrect value for acq_sv_profile[2].bin_width, expected 52, is " << last_msg_->acq_sv_profile[2].bin_width; - EXPECT_EQ(last_msg_->acq_sv_profile[2].cf, 212) << "incorrect value for acq_sv_profile[2].cf, expected 212, is " << last_msg_->acq_sv_profile[2].cf; - EXPECT_EQ(last_msg_->acq_sv_profile[2].cf_max, 248) << "incorrect value for acq_sv_profile[2].cf_max, expected 248, is " << last_msg_->acq_sv_profile[2].cf_max; - EXPECT_EQ(last_msg_->acq_sv_profile[2].cf_min, 76) << "incorrect value for acq_sv_profile[2].cf_min, expected 76, is " << last_msg_->acq_sv_profile[2].cf_min; - EXPECT_EQ(last_msg_->acq_sv_profile[2].cn0, 68) << "incorrect value for acq_sv_profile[2].cn0, expected 68, is " << last_msg_->acq_sv_profile[2].cn0; - EXPECT_EQ(last_msg_->acq_sv_profile[2].cp, 101) << "incorrect value for acq_sv_profile[2].cp, expected 101, is " << last_msg_->acq_sv_profile[2].cp; - EXPECT_EQ(last_msg_->acq_sv_profile[2].int_time, 53) << "incorrect value for acq_sv_profile[2].int_time, expected 53, is " << last_msg_->acq_sv_profile[2].int_time; - EXPECT_EQ(last_msg_->acq_sv_profile[2].job_type, 142) << "incorrect value for acq_sv_profile[2].job_type, expected 142, is " << last_msg_->acq_sv_profile[2].job_type; - EXPECT_EQ(last_msg_->acq_sv_profile[2].sid.code, 0) << "incorrect value for acq_sv_profile[2].sid.code, expected 0, is " << last_msg_->acq_sv_profile[2].sid.code; - EXPECT_EQ(last_msg_->acq_sv_profile[2].sid.reserved, 0) << "incorrect value for acq_sv_profile[2].sid.reserved, expected 0, is " << last_msg_->acq_sv_profile[2].sid.reserved; - EXPECT_EQ(last_msg_->acq_sv_profile[2].sid.sat, 24) << "incorrect value for acq_sv_profile[2].sid.sat, expected 24, is " << last_msg_->acq_sv_profile[2].sid.sat; - EXPECT_EQ(last_msg_->acq_sv_profile[2].status, 213) << "incorrect value for acq_sv_profile[2].status, expected 213, is " << last_msg_->acq_sv_profile[2].status; - EXPECT_EQ(last_msg_->acq_sv_profile[2].time_spent, 245) << "incorrect value for acq_sv_profile[2].time_spent, expected 245, is " << last_msg_->acq_sv_profile[2].time_spent; - EXPECT_EQ(last_msg_->acq_sv_profile[2].timestamp, 49) << "incorrect value for acq_sv_profile[2].timestamp, expected 49, is " << last_msg_->acq_sv_profile[2].timestamp; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->acq_sv_profile[0].bin_width, 187) + << "incorrect value for acq_sv_profile[0].bin_width, expected 187, is " + << last_msg_->acq_sv_profile[0].bin_width; + EXPECT_EQ(last_msg_->acq_sv_profile[0].cf, 60) + << "incorrect value for acq_sv_profile[0].cf, expected 60, is " + << last_msg_->acq_sv_profile[0].cf; + EXPECT_EQ(last_msg_->acq_sv_profile[0].cf_max, 36) + << "incorrect value for acq_sv_profile[0].cf_max, expected 36, is " + << last_msg_->acq_sv_profile[0].cf_max; + EXPECT_EQ(last_msg_->acq_sv_profile[0].cf_min, 132) + << "incorrect value for acq_sv_profile[0].cf_min, expected 132, is " + << last_msg_->acq_sv_profile[0].cf_min; + EXPECT_EQ(last_msg_->acq_sv_profile[0].cn0, 151) + << "incorrect value for acq_sv_profile[0].cn0, expected 151, is " + << last_msg_->acq_sv_profile[0].cn0; + EXPECT_EQ(last_msg_->acq_sv_profile[0].cp, 241) + << "incorrect value for acq_sv_profile[0].cp, expected 241, is " + << last_msg_->acq_sv_profile[0].cp; + EXPECT_EQ(last_msg_->acq_sv_profile[0].int_time, 12) + << "incorrect value for acq_sv_profile[0].int_time, expected 12, is " + << last_msg_->acq_sv_profile[0].int_time; + EXPECT_EQ(last_msg_->acq_sv_profile[0].job_type, 67) + << "incorrect value for acq_sv_profile[0].job_type, expected 67, is " + << last_msg_->acq_sv_profile[0].job_type; + EXPECT_EQ(last_msg_->acq_sv_profile[0].sid.code, 0) + << "incorrect value for acq_sv_profile[0].sid.code, expected 0, is " + << last_msg_->acq_sv_profile[0].sid.code; + EXPECT_EQ(last_msg_->acq_sv_profile[0].sid.reserved, 0) + << "incorrect value for acq_sv_profile[0].sid.reserved, expected 0, is " + << last_msg_->acq_sv_profile[0].sid.reserved; + EXPECT_EQ(last_msg_->acq_sv_profile[0].sid.sat, 22) + << "incorrect value for acq_sv_profile[0].sid.sat, expected 22, is " + << last_msg_->acq_sv_profile[0].sid.sat; + EXPECT_EQ(last_msg_->acq_sv_profile[0].status, 103) + << "incorrect value for acq_sv_profile[0].status, expected 103, is " + << last_msg_->acq_sv_profile[0].status; + EXPECT_EQ(last_msg_->acq_sv_profile[0].time_spent, 75) + << "incorrect value for acq_sv_profile[0].time_spent, expected 75, is " + << last_msg_->acq_sv_profile[0].time_spent; + EXPECT_EQ(last_msg_->acq_sv_profile[0].timestamp, 91) + << "incorrect value for acq_sv_profile[0].timestamp, expected 91, is " + << last_msg_->acq_sv_profile[0].timestamp; + EXPECT_EQ(last_msg_->acq_sv_profile[1].bin_width, 176) + << "incorrect value for acq_sv_profile[1].bin_width, expected 176, is " + << last_msg_->acq_sv_profile[1].bin_width; + EXPECT_EQ(last_msg_->acq_sv_profile[1].cf, 212) + << "incorrect value for acq_sv_profile[1].cf, expected 212, is " + << last_msg_->acq_sv_profile[1].cf; + EXPECT_EQ(last_msg_->acq_sv_profile[1].cf_max, 24) + << "incorrect value for acq_sv_profile[1].cf_max, expected 24, is " + << last_msg_->acq_sv_profile[1].cf_max; + EXPECT_EQ(last_msg_->acq_sv_profile[1].cf_min, 155) + << "incorrect value for acq_sv_profile[1].cf_min, expected 155, is " + << last_msg_->acq_sv_profile[1].cf_min; + EXPECT_EQ(last_msg_->acq_sv_profile[1].cn0, 111) + << "incorrect value for acq_sv_profile[1].cn0, expected 111, is " + << last_msg_->acq_sv_profile[1].cn0; + EXPECT_EQ(last_msg_->acq_sv_profile[1].cp, 247) + << "incorrect value for acq_sv_profile[1].cp, expected 247, is " + << last_msg_->acq_sv_profile[1].cp; + EXPECT_EQ(last_msg_->acq_sv_profile[1].int_time, 179) + << "incorrect value for acq_sv_profile[1].int_time, expected 179, is " + << last_msg_->acq_sv_profile[1].int_time; + EXPECT_EQ(last_msg_->acq_sv_profile[1].job_type, 238) + << "incorrect value for acq_sv_profile[1].job_type, expected 238, is " + << last_msg_->acq_sv_profile[1].job_type; + EXPECT_EQ(last_msg_->acq_sv_profile[1].sid.code, 1) + << "incorrect value for acq_sv_profile[1].sid.code, expected 1, is " + << last_msg_->acq_sv_profile[1].sid.code; + EXPECT_EQ(last_msg_->acq_sv_profile[1].sid.reserved, 0) + << "incorrect value for acq_sv_profile[1].sid.reserved, expected 0, is " + << last_msg_->acq_sv_profile[1].sid.reserved; + EXPECT_EQ(last_msg_->acq_sv_profile[1].sid.sat, 23) + << "incorrect value for acq_sv_profile[1].sid.sat, expected 23, is " + << last_msg_->acq_sv_profile[1].sid.sat; + EXPECT_EQ(last_msg_->acq_sv_profile[1].status, 38) + << "incorrect value for acq_sv_profile[1].status, expected 38, is " + << last_msg_->acq_sv_profile[1].status; + EXPECT_EQ(last_msg_->acq_sv_profile[1].time_spent, 234) + << "incorrect value for acq_sv_profile[1].time_spent, expected 234, is " + << last_msg_->acq_sv_profile[1].time_spent; + EXPECT_EQ(last_msg_->acq_sv_profile[1].timestamp, 166) + << "incorrect value for acq_sv_profile[1].timestamp, expected 166, is " + << last_msg_->acq_sv_profile[1].timestamp; + EXPECT_EQ(last_msg_->acq_sv_profile[2].bin_width, 52) + << "incorrect value for acq_sv_profile[2].bin_width, expected 52, is " + << last_msg_->acq_sv_profile[2].bin_width; + EXPECT_EQ(last_msg_->acq_sv_profile[2].cf, 212) + << "incorrect value for acq_sv_profile[2].cf, expected 212, is " + << last_msg_->acq_sv_profile[2].cf; + EXPECT_EQ(last_msg_->acq_sv_profile[2].cf_max, 248) + << "incorrect value for acq_sv_profile[2].cf_max, expected 248, is " + << last_msg_->acq_sv_profile[2].cf_max; + EXPECT_EQ(last_msg_->acq_sv_profile[2].cf_min, 76) + << "incorrect value for acq_sv_profile[2].cf_min, expected 76, is " + << last_msg_->acq_sv_profile[2].cf_min; + EXPECT_EQ(last_msg_->acq_sv_profile[2].cn0, 68) + << "incorrect value for acq_sv_profile[2].cn0, expected 68, is " + << last_msg_->acq_sv_profile[2].cn0; + EXPECT_EQ(last_msg_->acq_sv_profile[2].cp, 101) + << "incorrect value for acq_sv_profile[2].cp, expected 101, is " + << last_msg_->acq_sv_profile[2].cp; + EXPECT_EQ(last_msg_->acq_sv_profile[2].int_time, 53) + << "incorrect value for acq_sv_profile[2].int_time, expected 53, is " + << last_msg_->acq_sv_profile[2].int_time; + EXPECT_EQ(last_msg_->acq_sv_profile[2].job_type, 142) + << "incorrect value for acq_sv_profile[2].job_type, expected 142, is " + << last_msg_->acq_sv_profile[2].job_type; + EXPECT_EQ(last_msg_->acq_sv_profile[2].sid.code, 0) + << "incorrect value for acq_sv_profile[2].sid.code, expected 0, is " + << last_msg_->acq_sv_profile[2].sid.code; + EXPECT_EQ(last_msg_->acq_sv_profile[2].sid.reserved, 0) + << "incorrect value for acq_sv_profile[2].sid.reserved, expected 0, is " + << last_msg_->acq_sv_profile[2].sid.reserved; + EXPECT_EQ(last_msg_->acq_sv_profile[2].sid.sat, 24) + << "incorrect value for acq_sv_profile[2].sid.sat, expected 24, is " + << last_msg_->acq_sv_profile[2].sid.sat; + EXPECT_EQ(last_msg_->acq_sv_profile[2].status, 213) + << "incorrect value for acq_sv_profile[2].status, expected 213, is " + << last_msg_->acq_sv_profile[2].status; + EXPECT_EQ(last_msg_->acq_sv_profile[2].time_spent, 245) + << "incorrect value for acq_sv_profile[2].time_spent, expected 245, is " + << last_msg_->acq_sv_profile[2].time_spent; + EXPECT_EQ(last_msg_->acq_sv_profile[2].timestamp, 49) + << "incorrect value for acq_sv_profile[2].timestamp, expected 49, is " + << last_msg_->acq_sv_profile[2].timestamp; } diff --git a/c/test/legacy/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.cc b/c/test/legacy/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.cc index 2cf25c12a..3276c0fd3 100644 --- a/c/test/legacy/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.cc +++ b/c/test/legacy/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeReq.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,6 +27,6 @@ #include #include +#include #include #include -#include diff --git a/c/test/legacy/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.cc b/c/test/legacy/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.cc index 406cd1c86..0fb9581c8 100644 --- a/c/test/legacy/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.cc +++ b/c/test/legacy/cpp/auto_check_sbp_bootload_MsgBootloaderHandshakeResp.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderHandshakeResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_bootloader_handshake_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_bootloader_handshake_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,97 +82,98 @@ class Test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_bootloader_handshake_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp0, Test) -{ - - uint8_t encoded_frame[] = {85,180,0,0,0,9,0,0,0,0,118,49,46,50,10,201,1, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_bootloader_handshake_resp_t* test_msg = ( msg_bootloader_handshake_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - { - const char assign_string[] = { (char)118,(char)49,(char)46,(char)50,(char)10 }; - memcpy(test_msg->version, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->version) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0xb4, 0, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp0, Test) { + uint8_t encoded_frame[] = { + 85, 180, 0, 0, 0, 9, 0, 0, 0, 0, 118, 49, 46, 50, 10, 201, 1, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_bootloader_handshake_resp_t *test_msg = + (msg_bootloader_handshake_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + { + const char assign_string[] = {(char)118, (char)49, (char)46, (char)50, + (char)10}; + memcpy(test_msg->version, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->version) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - { - const char check_string[] = { (char)118,(char)49,(char)46,(char)50,(char)10 }; - EXPECT_EQ(memcmp(last_msg_->version, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->version, expected string '" << check_string << "', is '" << last_msg_->version << "'"; - } + EXPECT_EQ(send_message(0xb4, 0, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + { + const char check_string[] = {(char)118, (char)49, (char)46, (char)50, + (char)10}; + EXPECT_EQ(memcmp(last_msg_->version, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->version, expected string '" + << check_string << "', is '" << last_msg_->version << "'"; + } } -class Test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_bootloader_handshake_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_bootloader_handshake_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -185,57 +183,66 @@ class Test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_bootloader_handshake_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp1, Test) -{ - - uint8_t encoded_frame[] = {85,176,0,195,4,4,118,49,46,50,1,206, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_bootloader_handshake_dep_a_t* test_msg = ( msg_bootloader_handshake_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->handshake) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->handshake[0])); - } - test_msg->handshake[0] = 118; - if (sizeof(test_msg->handshake) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->handshake[0])); - } - test_msg->handshake[1] = 49; - if (sizeof(test_msg->handshake) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->handshake[0])); - } - test_msg->handshake[2] = 46; - if (sizeof(test_msg->handshake) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->handshake[0])); - } - test_msg->handshake[3] = 50; - - EXPECT_EQ(send_message( 0xb0, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } +}; + +TEST_F(Test_legacy_auto_check_sbp_bootload_MsgBootloaderHandshakeResp1, Test) { + uint8_t encoded_frame[] = { + 85, 176, 0, 195, 4, 4, 118, 49, 46, 50, 1, 206, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_bootloader_handshake_dep_a_t *test_msg = + (msg_bootloader_handshake_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->handshake) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->handshake[0])); + } + test_msg->handshake[0] = 118; + if (sizeof(test_msg->handshake) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->handshake[0])); + } + test_msg->handshake[1] = 49; + if (sizeof(test_msg->handshake) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->handshake[0])); + } + test_msg->handshake[2] = 46; + if (sizeof(test_msg->handshake) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->handshake[0])); + } + test_msg->handshake[3] = 50; + + EXPECT_EQ(send_message(0xb0, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->handshake[0], 118) << "incorrect value for handshake[0], expected 118, is " << last_msg_->handshake[0]; - EXPECT_EQ(last_msg_->handshake[1], 49) << "incorrect value for handshake[1], expected 49, is " << last_msg_->handshake[1]; - EXPECT_EQ(last_msg_->handshake[2], 46) << "incorrect value for handshake[2], expected 46, is " << last_msg_->handshake[2]; - EXPECT_EQ(last_msg_->handshake[3], 50) << "incorrect value for handshake[3], expected 50, is " << last_msg_->handshake[3]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->handshake[0], 118) + << "incorrect value for handshake[0], expected 118, is " + << last_msg_->handshake[0]; + EXPECT_EQ(last_msg_->handshake[1], 49) + << "incorrect value for handshake[1], expected 49, is " + << last_msg_->handshake[1]; + EXPECT_EQ(last_msg_->handshake[2], 46) + << "incorrect value for handshake[2], expected 46, is " + << last_msg_->handshake[2]; + EXPECT_EQ(last_msg_->handshake[3], 50) + << "incorrect value for handshake[3], expected 50, is " + << last_msg_->handshake[3]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_bootload_MsgBootloaderJumptoApp.cc b/c/test/legacy/cpp/auto_check_sbp_bootload_MsgBootloaderJumptoApp.cc index 18a408e6a..ef35768de 100644 --- a/c/test/legacy/cpp/auto_check_sbp_bootload_MsgBootloaderJumptoApp.cc +++ b/c/test/legacy/cpp/auto_check_sbp_bootload_MsgBootloaderJumptoApp.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderJumptoApp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgBootloaderJumptoApp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_bootloader_jump_to_app_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_bootloader_jump_to_app_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,35 +82,37 @@ class Test_legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_bootloader_jump_to_app_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp0, Test) -{ +}; - uint8_t encoded_frame[] = {85,177,0,205,18,1,216,105,96, }; +TEST_F(Test_legacy_auto_check_sbp_bootload_MsgBootloaderJumptoApp0, Test) { + uint8_t encoded_frame[] = { + 85, 177, 0, 205, 18, 1, 216, 105, 96, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_bootloader_jump_to_app_t* test_msg = ( msg_bootloader_jump_to_app_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->jump = 216; - - EXPECT_EQ(send_message( 0xb1, 4813, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_bootloader_jump_to_app_t *test_msg = + (msg_bootloader_jump_to_app_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->jump = 216; + + EXPECT_EQ(send_message(0xb1, 4813, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4813); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->jump, 216) << "incorrect value for jump, expected 216, is " << last_msg_->jump; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4813); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->jump, 216) + << "incorrect value for jump, expected 216, is " << last_msg_->jump; } diff --git a/c/test/legacy/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaReq.cc b/c/test/legacy/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaReq.cc index 464489585..fa9dd148a 100644 --- a/c/test/legacy/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaReq.cc +++ b/c/test/legacy/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaReq.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,6 +27,6 @@ #include #include +#include #include #include -#include diff --git a/c/test/legacy/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaResp.cc b/c/test/legacy/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaResp.cc index 815da7913..d1ea87453 100644 --- a/c/test/legacy/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaResp.cc +++ b/c/test/legacy/cpp/auto_check_sbp_bootload_MsgNapDeviceDnaResp.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/bootload/test_MsgNapDeviceDnaResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_nap_device_dna_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_nap_device_dna_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,81 +82,90 @@ class Test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_nap_device_dna_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_bootload_MsgNapDeviceDnaResp0, Test) { + uint8_t encoded_frame[] = { + 85, 221, 0, 169, 56, 8, 2, 187, 1, 130, 173, 244, 67, 122, 70, 91, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_nap_device_dna_resp_t *test_msg = + (msg_nap_device_dna_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->dna) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); + } + test_msg->dna[0] = 2; + if (sizeof(test_msg->dna) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); + } + test_msg->dna[1] = 187; + if (sizeof(test_msg->dna) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); + } + test_msg->dna[2] = 1; + if (sizeof(test_msg->dna) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); + } + test_msg->dna[3] = 130; + if (sizeof(test_msg->dna) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); + } + test_msg->dna[4] = 173; + if (sizeof(test_msg->dna) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); + } + test_msg->dna[5] = 244; + if (sizeof(test_msg->dna) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); + } + test_msg->dna[6] = 67; + if (sizeof(test_msg->dna) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); + } + test_msg->dna[7] = 122; - uint8_t encoded_frame[] = {85,221,0,169,56,8,2,187,1,130,173,244,67,122,70,91, }; + EXPECT_EQ(send_message(0xdd, 14505, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_nap_device_dna_resp_t* test_msg = ( msg_nap_device_dna_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->dna) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); - } - test_msg->dna[0] = 2; - if (sizeof(test_msg->dna) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); - } - test_msg->dna[1] = 187; - if (sizeof(test_msg->dna) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); - } - test_msg->dna[2] = 1; - if (sizeof(test_msg->dna) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); - } - test_msg->dna[3] = 130; - if (sizeof(test_msg->dna) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); - } - test_msg->dna[4] = 173; - if (sizeof(test_msg->dna) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); - } - test_msg->dna[5] = 244; - if (sizeof(test_msg->dna) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); - } - test_msg->dna[6] = 67; - if (sizeof(test_msg->dna) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->dna[0])); - } - test_msg->dna[7] = 122; - - EXPECT_EQ(send_message( 0xdd, 14505, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 14505); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->dna[0], 2) << "incorrect value for dna[0], expected 2, is " << last_msg_->dna[0]; - EXPECT_EQ(last_msg_->dna[1], 187) << "incorrect value for dna[1], expected 187, is " << last_msg_->dna[1]; - EXPECT_EQ(last_msg_->dna[2], 1) << "incorrect value for dna[2], expected 1, is " << last_msg_->dna[2]; - EXPECT_EQ(last_msg_->dna[3], 130) << "incorrect value for dna[3], expected 130, is " << last_msg_->dna[3]; - EXPECT_EQ(last_msg_->dna[4], 173) << "incorrect value for dna[4], expected 173, is " << last_msg_->dna[4]; - EXPECT_EQ(last_msg_->dna[5], 244) << "incorrect value for dna[5], expected 244, is " << last_msg_->dna[5]; - EXPECT_EQ(last_msg_->dna[6], 67) << "incorrect value for dna[6], expected 67, is " << last_msg_->dna[6]; - EXPECT_EQ(last_msg_->dna[7], 122) << "incorrect value for dna[7], expected 122, is " << last_msg_->dna[7]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 14505); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->dna[0], 2) + << "incorrect value for dna[0], expected 2, is " << last_msg_->dna[0]; + EXPECT_EQ(last_msg_->dna[1], 187) + << "incorrect value for dna[1], expected 187, is " << last_msg_->dna[1]; + EXPECT_EQ(last_msg_->dna[2], 1) + << "incorrect value for dna[2], expected 1, is " << last_msg_->dna[2]; + EXPECT_EQ(last_msg_->dna[3], 130) + << "incorrect value for dna[3], expected 130, is " << last_msg_->dna[3]; + EXPECT_EQ(last_msg_->dna[4], 173) + << "incorrect value for dna[4], expected 173, is " << last_msg_->dna[4]; + EXPECT_EQ(last_msg_->dna[5], 244) + << "incorrect value for dna[5], expected 244, is " << last_msg_->dna[5]; + EXPECT_EQ(last_msg_->dna[6], 67) + << "incorrect value for dna[6], expected 67, is " << last_msg_->dna[6]; + EXPECT_EQ(last_msg_->dna[7], 122) + << "incorrect value for dna[7], expected 122, is " << last_msg_->dna[7]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ext_events_MsgExtEvent.cc b/c/test/legacy/cpp/auto_check_sbp_ext_events_MsgExtEvent.cc index dcdb378c8..801d29348 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ext_events_MsgExtEvent.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ext_events_MsgExtEvent.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ext_events/test_MsgExtEvent.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ext_events/test_MsgExtEvent.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ext_events_MsgExtEvent0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ext_events_MsgExtEvent0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ext_events_MsgExtEvent0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ext_events_MsgExtEvent0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ext_event_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ext_event_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,43 +81,50 @@ class Test_legacy_auto_check_sbp_ext_events_MsgExtEvent0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ext_event_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ext_events_MsgExtEvent0, Test) -{ +}; - uint8_t encoded_frame[] = {85,1,1,245,6,12,48,7,199,216,49,15,202,65,15,0,3,0,62,204, }; +TEST_F(Test_legacy_auto_check_sbp_ext_events_MsgExtEvent0, Test) { + uint8_t encoded_frame[] = { + 85, 1, 1, 245, 6, 12, 48, 7, 199, 216, + 49, 15, 202, 65, 15, 0, 3, 0, 62, 204, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ext_event_t* test_msg = ( msg_ext_event_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 3; - test_msg->ns_residual = 999882; - test_msg->pin = 0; - test_msg->tow = 254924999; - test_msg->wn = 1840; - - EXPECT_EQ(send_message( 0x101, 1781, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ext_event_t *test_msg = (msg_ext_event_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 3; + test_msg->ns_residual = 999882; + test_msg->pin = 0; + test_msg->tow = 254924999; + test_msg->wn = 1840; + + EXPECT_EQ(send_message(0x101, 1781, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1781); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 3) << "incorrect value for flags, expected 3, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 999882) << "incorrect value for ns_residual, expected 999882, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->pin, 0) << "incorrect value for pin, expected 0, is " << last_msg_->pin; - EXPECT_EQ(last_msg_->tow, 254924999) << "incorrect value for tow, expected 254924999, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1840) << "incorrect value for wn, expected 1840, is " << last_msg_->wn; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1781); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 3) + << "incorrect value for flags, expected 3, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 999882) + << "incorrect value for ns_residual, expected 999882, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->pin, 0) + << "incorrect value for pin, expected 0, is " << last_msg_->pin; + EXPECT_EQ(last_msg_->tow, 254924999) + << "incorrect value for tow, expected 254924999, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1840) + << "incorrect value for wn, expected 1840, is " << last_msg_->wn; } diff --git a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioConfigReq.cc b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioConfigReq.cc index 8d121cd04..28c255f26 100644 --- a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioConfigReq.cc +++ b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioConfigReq.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_file_io_MsgFileioConfigReq0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_file_io_MsgFileioConfigReq0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_file_io_MsgFileioConfigReq0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_file_io_MsgFileioConfigReq0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_fileio_config_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_fileio_config_req_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,35 +82,38 @@ class Test_legacy_auto_check_sbp_file_io_MsgFileioConfigReq0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_fileio_config_req_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioConfigReq0, Test) -{ +}; - uint8_t encoded_frame[] = {85,1,16,195,4,4,107,218,69,90,185,27, }; +TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioConfigReq0, Test) { + uint8_t encoded_frame[] = { + 85, 1, 16, 195, 4, 4, 107, 218, 69, 90, 185, 27, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_fileio_config_req_t* test_msg = ( msg_fileio_config_req_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->sequence = 1514527339; - - EXPECT_EQ(send_message( 0x1001, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_fileio_config_req_t *test_msg = + (msg_fileio_config_req_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->sequence = 1514527339; + + EXPECT_EQ(send_message(0x1001, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->sequence, 1514527339) << "incorrect value for sequence, expected 1514527339, is " << last_msg_->sequence; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->sequence, 1514527339) + << "incorrect value for sequence, expected 1514527339, is " + << last_msg_->sequence; } diff --git a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioConfigResp.cc b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioConfigResp.cc index 65c621fd9..af3d8246b 100644 --- a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioConfigResp.cc +++ b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioConfigResp.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioConfigResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_file_io_MsgFileioConfigResp0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_file_io_MsgFileioConfigResp0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_file_io_MsgFileioConfigResp0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_file_io_MsgFileioConfigResp0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_fileio_config_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_fileio_config_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,41 +82,51 @@ class Test_legacy_auto_check_sbp_file_io_MsgFileioConfigResp0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_fileio_config_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioConfigResp0, Test) -{ +}; - uint8_t encoded_frame[] = {85,2,16,195,4,16,170,76,52,91,149,186,44,3,216,151,255,61,12,97,66,144,239,115, }; +TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioConfigResp0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 16, 195, 4, 16, 170, 76, 52, 91, 149, 186, + 44, 3, 216, 151, 255, 61, 12, 97, 66, 144, 239, 115, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_fileio_config_resp_t* test_msg = ( msg_fileio_config_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->batch_size = 1040160728; - test_msg->fileio_version = 2420269324; - test_msg->sequence = 1530154154; - test_msg->window_size = 53262997; - - EXPECT_EQ(send_message( 0x1002, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_fileio_config_resp_t *test_msg = + (msg_fileio_config_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->batch_size = 1040160728; + test_msg->fileio_version = 2420269324; + test_msg->sequence = 1530154154; + test_msg->window_size = 53262997; + + EXPECT_EQ(send_message(0x1002, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->batch_size, 1040160728) << "incorrect value for batch_size, expected 1040160728, is " << last_msg_->batch_size; - EXPECT_EQ(last_msg_->fileio_version, 2420269324) << "incorrect value for fileio_version, expected 2420269324, is " << last_msg_->fileio_version; - EXPECT_EQ(last_msg_->sequence, 1530154154) << "incorrect value for sequence, expected 1530154154, is " << last_msg_->sequence; - EXPECT_EQ(last_msg_->window_size, 53262997) << "incorrect value for window_size, expected 53262997, is " << last_msg_->window_size; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->batch_size, 1040160728) + << "incorrect value for batch_size, expected 1040160728, is " + << last_msg_->batch_size; + EXPECT_EQ(last_msg_->fileio_version, 2420269324) + << "incorrect value for fileio_version, expected 2420269324, is " + << last_msg_->fileio_version; + EXPECT_EQ(last_msg_->sequence, 1530154154) + << "incorrect value for sequence, expected 1530154154, is " + << last_msg_->sequence; + EXPECT_EQ(last_msg_->window_size, 53262997) + << "incorrect value for window_size, expected 53262997, is " + << last_msg_->window_size; } diff --git a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadDirReq.cc b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadDirReq.cc index 8a55df0ed..0735f7136 100644 --- a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadDirReq.cc +++ b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadDirReq.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_fileio_read_dir_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_fileio_read_dir_req_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,48 +82,63 @@ class Test_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_fileio_read_dir_req_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq0, Test) -{ +}; - uint8_t encoded_frame[] = {85,169,0,195,4,26,130,231,255,90,196,134,47,134,47,115,111,109,101,47,114,97,110,100,111,109,47,112,97,116,104,0,26,186, }; +TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioReadDirReq0, Test) { + uint8_t encoded_frame[] = { + 85, 169, 0, 195, 4, 26, 130, 231, 255, 90, 196, 134, + 47, 134, 47, 115, 111, 109, 101, 47, 114, 97, 110, 100, + 111, 109, 47, 112, 97, 116, 104, 0, 26, 186, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_fileio_read_dir_req_t* test_msg = ( msg_fileio_read_dir_req_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)47,(char)115,(char)111,(char)109,(char)101,(char)47,(char)114,(char)97,(char)110,(char)100,(char)111,(char)109,(char)47,(char)112,(char)97,(char)116,(char)104,(char)0 }; - memcpy(test_msg->dirname, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->dirname) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->offset = 2251261636; - test_msg->sequence = 1526720386; - - EXPECT_EQ(send_message( 0xa9, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_fileio_read_dir_req_t *test_msg = + (msg_fileio_read_dir_req_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)47, (char)115, (char)111, (char)109, (char)101, (char)47, + (char)114, (char)97, (char)110, (char)100, (char)111, (char)109, + (char)47, (char)112, (char)97, (char)116, (char)104, (char)0}; + memcpy(test_msg->dirname, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->dirname) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->offset = 2251261636; + test_msg->sequence = 1526720386; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)47,(char)115,(char)111,(char)109,(char)101,(char)47,(char)114,(char)97,(char)110,(char)100,(char)111,(char)109,(char)47,(char)112,(char)97,(char)116,(char)104,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->dirname, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->dirname, expected string '" << check_string << "', is '" << last_msg_->dirname << "'"; - } - EXPECT_EQ(last_msg_->offset, 2251261636) << "incorrect value for offset, expected 2251261636, is " << last_msg_->offset; - EXPECT_EQ(last_msg_->sequence, 1526720386) << "incorrect value for sequence, expected 1526720386, is " << last_msg_->sequence; + EXPECT_EQ(send_message(0xa9, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)47, (char)115, (char)111, (char)109, (char)101, (char)47, + (char)114, (char)97, (char)110, (char)100, (char)111, (char)109, + (char)47, (char)112, (char)97, (char)116, (char)104, (char)0}; + EXPECT_EQ(memcmp(last_msg_->dirname, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->dirname, expected string '" + << check_string << "', is '" << last_msg_->dirname << "'"; + } + EXPECT_EQ(last_msg_->offset, 2251261636) + << "incorrect value for offset, expected 2251261636, is " + << last_msg_->offset; + EXPECT_EQ(last_msg_->sequence, 1526720386) + << "incorrect value for sequence, expected 1526720386, is " + << last_msg_->sequence; } diff --git a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadDirResp.cc b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadDirResp.cc index 1314f8470..8914dffe2 100644 --- a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadDirResp.cc +++ b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadDirResp.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadDirResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_file_io_MsgFileioReadDirResp0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_file_io_MsgFileioReadDirResp0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_file_io_MsgFileioReadDirResp0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_file_io_MsgFileioReadDirResp0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_fileio_read_dir_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_fileio_read_dir_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,46 +82,69 @@ class Test_legacy_auto_check_sbp_file_io_MsgFileioReadDirResp0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_fileio_read_dir_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioReadDirResp0, Test) -{ +}; - uint8_t encoded_frame[] = {85,170,0,195,4,45,78,253,224,235,102,105,108,101,49,0,97,110,111,116,104,101,114,32,102,105,108,101,0,100,101,102,105,110,105,116,101,108,121,32,110,111,116,32,97,32,102,105,108,101,0,186,137, }; +TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioReadDirResp0, Test) { + uint8_t encoded_frame[] = { + 85, 170, 0, 195, 4, 45, 78, 253, 224, 235, 102, 105, 108, 101, + 49, 0, 97, 110, 111, 116, 104, 101, 114, 32, 102, 105, 108, 101, + 0, 100, 101, 102, 105, 110, 105, 116, 101, 108, 121, 32, 110, 111, + 116, 32, 97, 32, 102, 105, 108, 101, 0, 186, 137, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_fileio_read_dir_resp_t* test_msg = ( msg_fileio_read_dir_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)102,(char)105,(char)108,(char)101,(char)49,(char)0,(char)97,(char)110,(char)111,(char)116,(char)104,(char)101,(char)114,(char)32,(char)102,(char)105,(char)108,(char)101,(char)0,(char)100,(char)101,(char)102,(char)105,(char)110,(char)105,(char)116,(char)101,(char)108,(char)121,(char)32,(char)110,(char)111,(char)116,(char)32,(char)97,(char)32,(char)102,(char)105,(char)108,(char)101,(char)0 }; - memcpy(test_msg->contents, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->contents) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->sequence = 3957390670; - - EXPECT_EQ(send_message( 0xaa, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_fileio_read_dir_resp_t *test_msg = + (msg_fileio_read_dir_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)102, (char)105, (char)108, (char)101, (char)49, (char)0, + (char)97, (char)110, (char)111, (char)116, (char)104, (char)101, + (char)114, (char)32, (char)102, (char)105, (char)108, (char)101, + (char)0, (char)100, (char)101, (char)102, (char)105, (char)110, + (char)105, (char)116, (char)101, (char)108, (char)121, (char)32, + (char)110, (char)111, (char)116, (char)32, (char)97, (char)32, + (char)102, (char)105, (char)108, (char)101, (char)0}; + memcpy(test_msg->contents, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->contents) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->sequence = 3957390670; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)102,(char)105,(char)108,(char)101,(char)49,(char)0,(char)97,(char)110,(char)111,(char)116,(char)104,(char)101,(char)114,(char)32,(char)102,(char)105,(char)108,(char)101,(char)0,(char)100,(char)101,(char)102,(char)105,(char)110,(char)105,(char)116,(char)101,(char)108,(char)121,(char)32,(char)110,(char)111,(char)116,(char)32,(char)97,(char)32,(char)102,(char)105,(char)108,(char)101,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->contents, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->contents, expected string '" << check_string << "', is '" << last_msg_->contents << "'"; - } - EXPECT_EQ(last_msg_->sequence, 3957390670) << "incorrect value for sequence, expected 3957390670, is " << last_msg_->sequence; + EXPECT_EQ(send_message(0xaa, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)102, (char)105, (char)108, (char)101, (char)49, (char)0, + (char)97, (char)110, (char)111, (char)116, (char)104, (char)101, + (char)114, (char)32, (char)102, (char)105, (char)108, (char)101, + (char)0, (char)100, (char)101, (char)102, (char)105, (char)110, + (char)105, (char)116, (char)101, (char)108, (char)121, (char)32, + (char)110, (char)111, (char)116, (char)32, (char)97, (char)32, + (char)102, (char)105, (char)108, (char)101, (char)0}; + EXPECT_EQ(memcmp(last_msg_->contents, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_->contents, expected string '" + << check_string << "', is '" << last_msg_->contents << "'"; + } + EXPECT_EQ(last_msg_->sequence, 3957390670) + << "incorrect value for sequence, expected 3957390670, is " + << last_msg_->sequence; } diff --git a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadReq.cc b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadReq.cc index 1f3565fe3..de6691945 100644 --- a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadReq.cc +++ b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadReq.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_file_io_MsgFileioReadReq0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_file_io_MsgFileioReadReq0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_file_io_MsgFileioReadReq0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_file_io_MsgFileioReadReq0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_fileio_read_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_fileio_read_req_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,50 +81,69 @@ class Test_legacy_auto_check_sbp_file_io_MsgFileioReadReq0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_fileio_read_req_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioReadReq0, Test) -{ +}; - uint8_t encoded_frame[] = {85,168,0,195,4,28,34,156,130,40,98,178,190,23,53,47,112,97,116,104,47,116,111,47,115,111,109,101,47,102,105,108,101,0,86,100, }; +TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioReadReq0, Test) { + uint8_t encoded_frame[] = { + 85, 168, 0, 195, 4, 28, 34, 156, 130, 40, 98, 178, + 190, 23, 53, 47, 112, 97, 116, 104, 47, 116, 111, 47, + 115, 111, 109, 101, 47, 102, 105, 108, 101, 0, 86, 100, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_fileio_read_req_t* test_msg = ( msg_fileio_read_req_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->chunk_size = 53; - { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)115,(char)111,(char)109,(char)101,(char)47,(char)102,(char)105,(char)108,(char)101,(char)0 }; - memcpy(test_msg->filename, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->filename) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->offset = 398373474; - test_msg->sequence = 679648290; - - EXPECT_EQ(send_message( 0xa8, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_fileio_read_req_t *test_msg = (msg_fileio_read_req_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->chunk_size = 53; + { + const char assign_string[] = {(char)47, (char)112, (char)97, (char)116, + (char)104, (char)47, (char)116, (char)111, + (char)47, (char)115, (char)111, (char)109, + (char)101, (char)47, (char)102, (char)105, + (char)108, (char)101, (char)0}; + memcpy(test_msg->filename, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->filename) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->offset = 398373474; + test_msg->sequence = 679648290; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->chunk_size, 53) << "incorrect value for chunk_size, expected 53, is " << last_msg_->chunk_size; - { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)115,(char)111,(char)109,(char)101,(char)47,(char)102,(char)105,(char)108,(char)101,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->filename, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->filename, expected string '" << check_string << "', is '" << last_msg_->filename << "'"; - } - EXPECT_EQ(last_msg_->offset, 398373474) << "incorrect value for offset, expected 398373474, is " << last_msg_->offset; - EXPECT_EQ(last_msg_->sequence, 679648290) << "incorrect value for sequence, expected 679648290, is " << last_msg_->sequence; + EXPECT_EQ(send_message(0xa8, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->chunk_size, 53) + << "incorrect value for chunk_size, expected 53, is " + << last_msg_->chunk_size; + { + const char check_string[] = {(char)47, (char)112, (char)97, (char)116, + (char)104, (char)47, (char)116, (char)111, + (char)47, (char)115, (char)111, (char)109, + (char)101, (char)47, (char)102, (char)105, + (char)108, (char)101, (char)0}; + EXPECT_EQ(memcmp(last_msg_->filename, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_->filename, expected string '" + << check_string << "', is '" << last_msg_->filename << "'"; + } + EXPECT_EQ(last_msg_->offset, 398373474) + << "incorrect value for offset, expected 398373474, is " + << last_msg_->offset; + EXPECT_EQ(last_msg_->sequence, 679648290) + << "incorrect value for sequence, expected 679648290, is " + << last_msg_->sequence; } diff --git a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadResp.cc b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadResp.cc index 084e03ef0..866b91109 100644 --- a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadResp.cc +++ b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioReadResp.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioReadResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_file_io_MsgFileioReadResp0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_file_io_MsgFileioReadResp0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_file_io_MsgFileioReadResp0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_file_io_MsgFileioReadResp0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_fileio_read_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_fileio_read_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,1541 +82,2062 @@ class Test_legacy_auto_check_sbp_file_io_MsgFileioReadResp0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_fileio_read_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioReadResp0, Test) -{ +}; - uint8_t encoded_frame[] = {85,163,0,195,4,255,67,183,115,15,73,231,227,179,18,76,68,229,216,21,98,183,69,190,5,252,176,55,32,78,8,52,127,50,71,106,61,79,191,106,46,79,118,248,118,207,206,210,91,73,251,81,131,205,193,146,206,185,140,249,163,231,65,67,94,250,109,152,95,123,77,224,124,238,205,65,103,35,104,209,5,191,47,249,176,166,213,46,192,86,32,103,146,252,4,16,54,161,60,6,13,191,116,182,42,191,213,20,217,8,142,187,238,120,184,250,31,151,37,51,177,130,190,155,71,68,56,238,92,130,37,137,146,246,114,116,138,165,217,79,10,189,128,189,2,240,92,28,126,105,236,228,194,0,51,61,74,41,10,239,133,106,190,30,27,3,240,205,253,113,25,28,187,81,101,216,121,41,179,120,152,18,116,53,212,100,2,114,198,200,10,147,25,33,115,208,113,60,179,183,0,41,217,206,255,211,225,142,191,133,81,15,248,193,66,191,244,221,248,199,241,112,51,1,180,180,125,97,145,25,72,210,215,208,15,126,56,38,65,4,64,19,74,223,111,109,52,43,167,186,202,111,11,91,21,236,234,196,36,171,147,10,240, }; +TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioReadResp0, Test) { + uint8_t encoded_frame[] = { + 85, 163, 0, 195, 4, 255, 67, 183, 115, 15, 73, 231, 227, 179, 18, + 76, 68, 229, 216, 21, 98, 183, 69, 190, 5, 252, 176, 55, 32, 78, + 8, 52, 127, 50, 71, 106, 61, 79, 191, 106, 46, 79, 118, 248, 118, + 207, 206, 210, 91, 73, 251, 81, 131, 205, 193, 146, 206, 185, 140, 249, + 163, 231, 65, 67, 94, 250, 109, 152, 95, 123, 77, 224, 124, 238, 205, + 65, 103, 35, 104, 209, 5, 191, 47, 249, 176, 166, 213, 46, 192, 86, + 32, 103, 146, 252, 4, 16, 54, 161, 60, 6, 13, 191, 116, 182, 42, + 191, 213, 20, 217, 8, 142, 187, 238, 120, 184, 250, 31, 151, 37, 51, + 177, 130, 190, 155, 71, 68, 56, 238, 92, 130, 37, 137, 146, 246, 114, + 116, 138, 165, 217, 79, 10, 189, 128, 189, 2, 240, 92, 28, 126, 105, + 236, 228, 194, 0, 51, 61, 74, 41, 10, 239, 133, 106, 190, 30, 27, + 3, 240, 205, 253, 113, 25, 28, 187, 81, 101, 216, 121, 41, 179, 120, + 152, 18, 116, 53, 212, 100, 2, 114, 198, 200, 10, 147, 25, 33, 115, + 208, 113, 60, 179, 183, 0, 41, 217, 206, 255, 211, 225, 142, 191, 133, + 81, 15, 248, 193, 66, 191, 244, 221, 248, 199, 241, 112, 51, 1, 180, + 180, 125, 97, 145, 25, 72, 210, 215, 208, 15, 126, 56, 38, 65, 4, + 64, 19, 74, 223, 111, 109, 52, 43, 167, 186, 202, 111, 11, 91, 21, + 236, 234, 196, 36, 171, 147, 10, 240, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_fileio_read_resp_t* test_msg = ( msg_fileio_read_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[0] = 73; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[1] = 231; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[2] = 227; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[3] = 179; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[4] = 18; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[5] = 76; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[6] = 68; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[7] = 229; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[8] = 216; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[9] = 21; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[10] = 98; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[11] = 183; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[12] = 69; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[13] = 190; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[14] = 5; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[15] = 252; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[16] = 176; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[17] = 55; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[18] = 32; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[19] = 78; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[20] = 8; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[21] = 52; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[22] = 127; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[23] = 50; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[24] = 71; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[25] = 106; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[26] = 61; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[27] = 79; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[28] = 191; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[29] = 106; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[30] = 46; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[31] = 79; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[32] = 118; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[33] = 248; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[34] = 118; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[35] = 207; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[36] = 206; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[37] = 210; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[38] = 91; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[39] = 73; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[40] = 251; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[41] = 81; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[42] = 131; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[43] = 205; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[44] = 193; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[45] = 146; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[46] = 206; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[47] = 185; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[48] = 140; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[49] = 249; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[50] = 163; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[51] = 231; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[52] = 65; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[53] = 67; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[54] = 94; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[55] = 250; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[56] = 109; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[57] = 152; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[58] = 95; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[59] = 123; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[60] = 77; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[61] = 224; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[62] = 124; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[63] = 238; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[64] = 205; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[65] = 65; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[66] = 103; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[67] = 35; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[68] = 104; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[69] = 209; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[70] = 5; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[71] = 191; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[72] = 47; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[73] = 249; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[74] = 176; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[75] = 166; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[76] = 213; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[77] = 46; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[78] = 192; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[79] = 86; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[80] = 32; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[81] = 103; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[82] = 146; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[83] = 252; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[84] = 4; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[85] = 16; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[86] = 54; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[87] = 161; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[88] = 60; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[89] = 6; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[90] = 13; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[91] = 191; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[92] = 116; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[93] = 182; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[94] = 42; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[95] = 191; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[96] = 213; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[97] = 20; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[98] = 217; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[99] = 8; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[100] = 142; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[101] = 187; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[102] = 238; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[103] = 120; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[104] = 184; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[105] = 250; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[106] = 31; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[107] = 151; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[108] = 37; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[109] = 51; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[110] = 177; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[111] = 130; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[112] = 190; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[113] = 155; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[114] = 71; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[115] = 68; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[116] = 56; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[117] = 238; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[118] = 92; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[119] = 130; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[120] = 37; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[121] = 137; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[122] = 146; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[123] = 246; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[124] = 114; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[125] = 116; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[126] = 138; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[127] = 165; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[128] = 217; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[129] = 79; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[130] = 10; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[131] = 189; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[132] = 128; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[133] = 189; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[134] = 2; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[135] = 240; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[136] = 92; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[137] = 28; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[138] = 126; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[139] = 105; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[140] = 236; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[141] = 228; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[142] = 194; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[143] = 0; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[144] = 51; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[145] = 61; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[146] = 74; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[147] = 41; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[148] = 10; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[149] = 239; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[150] = 133; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[151] = 106; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[152] = 190; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[153] = 30; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[154] = 27; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[155] = 3; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[156] = 240; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[157] = 205; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[158] = 253; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[159] = 113; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[160] = 25; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[161] = 28; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[162] = 187; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[163] = 81; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[164] = 101; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[165] = 216; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[166] = 121; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[167] = 41; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[168] = 179; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[169] = 120; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[170] = 152; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[171] = 18; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[172] = 116; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[173] = 53; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[174] = 212; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[175] = 100; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[176] = 2; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[177] = 114; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[178] = 198; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[179] = 200; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[180] = 10; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[181] = 147; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[182] = 25; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[183] = 33; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[184] = 115; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[185] = 208; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[186] = 113; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[187] = 60; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[188] = 179; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[189] = 183; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[190] = 0; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[191] = 41; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[192] = 217; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[193] = 206; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[194] = 255; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[195] = 211; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[196] = 225; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[197] = 142; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[198] = 191; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[199] = 133; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[200] = 81; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[201] = 15; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[202] = 248; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[203] = 193; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[204] = 66; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[205] = 191; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[206] = 244; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[207] = 221; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[208] = 248; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[209] = 199; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[210] = 241; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[211] = 112; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[212] = 51; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[213] = 1; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[214] = 180; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[215] = 180; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[216] = 125; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[217] = 97; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[218] = 145; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[219] = 25; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[220] = 72; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[221] = 210; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[222] = 215; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[223] = 208; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[224] = 15; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[225] = 126; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[226] = 56; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[227] = 38; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[228] = 65; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[229] = 4; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[230] = 64; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[231] = 19; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[232] = 74; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[233] = 223; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[234] = 111; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[235] = 109; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[236] = 52; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[237] = 43; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[238] = 167; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[239] = 186; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[240] = 202; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[241] = 111; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[242] = 11; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[243] = 91; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[244] = 21; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[245] = 236; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[246] = 234; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[247] = 196; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[248] = 36; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[249] = 171; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[250] = 147; - test_msg->sequence = 259241795; - - EXPECT_EQ(send_message( 0xa3, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_fileio_read_resp_t *test_msg = (msg_fileio_read_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[0] = 73; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[1] = 231; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[2] = 227; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[3] = 179; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[4] = 18; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[5] = 76; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[6] = 68; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[7] = 229; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[8] = 216; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[9] = 21; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[10] = 98; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[11] = 183; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[12] = 69; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[13] = 190; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[14] = 5; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[15] = 252; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[16] = 176; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[17] = 55; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[18] = 32; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[19] = 78; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[20] = 8; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[21] = 52; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[22] = 127; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[23] = 50; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[24] = 71; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[25] = 106; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[26] = 61; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[27] = 79; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[28] = 191; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[29] = 106; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[30] = 46; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[31] = 79; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[32] = 118; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[33] = 248; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[34] = 118; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[35] = 207; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[36] = 206; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[37] = 210; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[38] = 91; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[39] = 73; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[40] = 251; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[41] = 81; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[42] = 131; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[43] = 205; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[44] = 193; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[45] = 146; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[46] = 206; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[47] = 185; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[48] = 140; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[49] = 249; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[50] = 163; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[51] = 231; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[52] = 65; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[53] = 67; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[54] = 94; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[55] = 250; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[56] = 109; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[57] = 152; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[58] = 95; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[59] = 123; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[60] = 77; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[61] = 224; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[62] = 124; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[63] = 238; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[64] = 205; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[65] = 65; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[66] = 103; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[67] = 35; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[68] = 104; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[69] = 209; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[70] = 5; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[71] = 191; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[72] = 47; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[73] = 249; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[74] = 176; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[75] = 166; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[76] = 213; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[77] = 46; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[78] = 192; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[79] = 86; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[80] = 32; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[81] = 103; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[82] = 146; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[83] = 252; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[84] = 4; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[85] = 16; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[86] = 54; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[87] = 161; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[88] = 60; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[89] = 6; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[90] = 13; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[91] = 191; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[92] = 116; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[93] = 182; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[94] = 42; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[95] = 191; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[96] = 213; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[97] = 20; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[98] = 217; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[99] = 8; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[100] = 142; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[101] = 187; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[102] = 238; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[103] = 120; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[104] = 184; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[105] = 250; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[106] = 31; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[107] = 151; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[108] = 37; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[109] = 51; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[110] = 177; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[111] = 130; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[112] = 190; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[113] = 155; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[114] = 71; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[115] = 68; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[116] = 56; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[117] = 238; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[118] = 92; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[119] = 130; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[120] = 37; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[121] = 137; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[122] = 146; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[123] = 246; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[124] = 114; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[125] = 116; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[126] = 138; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[127] = 165; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[128] = 217; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[129] = 79; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[130] = 10; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[131] = 189; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[132] = 128; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[133] = 189; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[134] = 2; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[135] = 240; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[136] = 92; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[137] = 28; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[138] = 126; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[139] = 105; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[140] = 236; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[141] = 228; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[142] = 194; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[143] = 0; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[144] = 51; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[145] = 61; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[146] = 74; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[147] = 41; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[148] = 10; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[149] = 239; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[150] = 133; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[151] = 106; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[152] = 190; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[153] = 30; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[154] = 27; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[155] = 3; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[156] = 240; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[157] = 205; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[158] = 253; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[159] = 113; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[160] = 25; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[161] = 28; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[162] = 187; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[163] = 81; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[164] = 101; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[165] = 216; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[166] = 121; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[167] = 41; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[168] = 179; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[169] = 120; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[170] = 152; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[171] = 18; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[172] = 116; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[173] = 53; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[174] = 212; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[175] = 100; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[176] = 2; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[177] = 114; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[178] = 198; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[179] = 200; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[180] = 10; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[181] = 147; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[182] = 25; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[183] = 33; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[184] = 115; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[185] = 208; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[186] = 113; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[187] = 60; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[188] = 179; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[189] = 183; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[190] = 0; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[191] = 41; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[192] = 217; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[193] = 206; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[194] = 255; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[195] = 211; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[196] = 225; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[197] = 142; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[198] = 191; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[199] = 133; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[200] = 81; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[201] = 15; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[202] = 248; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[203] = 193; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[204] = 66; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[205] = 191; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[206] = 244; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[207] = 221; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[208] = 248; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[209] = 199; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[210] = 241; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[211] = 112; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[212] = 51; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[213] = 1; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[214] = 180; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[215] = 180; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[216] = 125; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[217] = 97; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[218] = 145; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[219] = 25; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[220] = 72; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[221] = 210; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[222] = 215; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[223] = 208; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[224] = 15; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[225] = 126; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[226] = 56; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[227] = 38; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[228] = 65; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[229] = 4; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[230] = 64; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[231] = 19; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[232] = 74; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[233] = 223; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[234] = 111; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[235] = 109; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[236] = 52; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[237] = 43; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[238] = 167; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[239] = 186; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[240] = 202; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[241] = 111; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[242] = 11; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[243] = 91; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[244] = 21; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[245] = 236; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[246] = 234; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[247] = 196; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[248] = 36; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[249] = 171; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[250] = 147; + test_msg->sequence = 259241795; + + EXPECT_EQ(send_message(0xa3, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->contents[0], 73) << "incorrect value for contents[0], expected 73, is " << last_msg_->contents[0]; - EXPECT_EQ(last_msg_->contents[1], 231) << "incorrect value for contents[1], expected 231, is " << last_msg_->contents[1]; - EXPECT_EQ(last_msg_->contents[2], 227) << "incorrect value for contents[2], expected 227, is " << last_msg_->contents[2]; - EXPECT_EQ(last_msg_->contents[3], 179) << "incorrect value for contents[3], expected 179, is " << last_msg_->contents[3]; - EXPECT_EQ(last_msg_->contents[4], 18) << "incorrect value for contents[4], expected 18, is " << last_msg_->contents[4]; - EXPECT_EQ(last_msg_->contents[5], 76) << "incorrect value for contents[5], expected 76, is " << last_msg_->contents[5]; - EXPECT_EQ(last_msg_->contents[6], 68) << "incorrect value for contents[6], expected 68, is " << last_msg_->contents[6]; - EXPECT_EQ(last_msg_->contents[7], 229) << "incorrect value for contents[7], expected 229, is " << last_msg_->contents[7]; - EXPECT_EQ(last_msg_->contents[8], 216) << "incorrect value for contents[8], expected 216, is " << last_msg_->contents[8]; - EXPECT_EQ(last_msg_->contents[9], 21) << "incorrect value for contents[9], expected 21, is " << last_msg_->contents[9]; - EXPECT_EQ(last_msg_->contents[10], 98) << "incorrect value for contents[10], expected 98, is " << last_msg_->contents[10]; - EXPECT_EQ(last_msg_->contents[11], 183) << "incorrect value for contents[11], expected 183, is " << last_msg_->contents[11]; - EXPECT_EQ(last_msg_->contents[12], 69) << "incorrect value for contents[12], expected 69, is " << last_msg_->contents[12]; - EXPECT_EQ(last_msg_->contents[13], 190) << "incorrect value for contents[13], expected 190, is " << last_msg_->contents[13]; - EXPECT_EQ(last_msg_->contents[14], 5) << "incorrect value for contents[14], expected 5, is " << last_msg_->contents[14]; - EXPECT_EQ(last_msg_->contents[15], 252) << "incorrect value for contents[15], expected 252, is " << last_msg_->contents[15]; - EXPECT_EQ(last_msg_->contents[16], 176) << "incorrect value for contents[16], expected 176, is " << last_msg_->contents[16]; - EXPECT_EQ(last_msg_->contents[17], 55) << "incorrect value for contents[17], expected 55, is " << last_msg_->contents[17]; - EXPECT_EQ(last_msg_->contents[18], 32) << "incorrect value for contents[18], expected 32, is " << last_msg_->contents[18]; - EXPECT_EQ(last_msg_->contents[19], 78) << "incorrect value for contents[19], expected 78, is " << last_msg_->contents[19]; - EXPECT_EQ(last_msg_->contents[20], 8) << "incorrect value for contents[20], expected 8, is " << last_msg_->contents[20]; - EXPECT_EQ(last_msg_->contents[21], 52) << "incorrect value for contents[21], expected 52, is " << last_msg_->contents[21]; - EXPECT_EQ(last_msg_->contents[22], 127) << "incorrect value for contents[22], expected 127, is " << last_msg_->contents[22]; - EXPECT_EQ(last_msg_->contents[23], 50) << "incorrect value for contents[23], expected 50, is " << last_msg_->contents[23]; - EXPECT_EQ(last_msg_->contents[24], 71) << "incorrect value for contents[24], expected 71, is " << last_msg_->contents[24]; - EXPECT_EQ(last_msg_->contents[25], 106) << "incorrect value for contents[25], expected 106, is " << last_msg_->contents[25]; - EXPECT_EQ(last_msg_->contents[26], 61) << "incorrect value for contents[26], expected 61, is " << last_msg_->contents[26]; - EXPECT_EQ(last_msg_->contents[27], 79) << "incorrect value for contents[27], expected 79, is " << last_msg_->contents[27]; - EXPECT_EQ(last_msg_->contents[28], 191) << "incorrect value for contents[28], expected 191, is " << last_msg_->contents[28]; - EXPECT_EQ(last_msg_->contents[29], 106) << "incorrect value for contents[29], expected 106, is " << last_msg_->contents[29]; - EXPECT_EQ(last_msg_->contents[30], 46) << "incorrect value for contents[30], expected 46, is " << last_msg_->contents[30]; - EXPECT_EQ(last_msg_->contents[31], 79) << "incorrect value for contents[31], expected 79, is " << last_msg_->contents[31]; - EXPECT_EQ(last_msg_->contents[32], 118) << "incorrect value for contents[32], expected 118, is " << last_msg_->contents[32]; - EXPECT_EQ(last_msg_->contents[33], 248) << "incorrect value for contents[33], expected 248, is " << last_msg_->contents[33]; - EXPECT_EQ(last_msg_->contents[34], 118) << "incorrect value for contents[34], expected 118, is " << last_msg_->contents[34]; - EXPECT_EQ(last_msg_->contents[35], 207) << "incorrect value for contents[35], expected 207, is " << last_msg_->contents[35]; - EXPECT_EQ(last_msg_->contents[36], 206) << "incorrect value for contents[36], expected 206, is " << last_msg_->contents[36]; - EXPECT_EQ(last_msg_->contents[37], 210) << "incorrect value for contents[37], expected 210, is " << last_msg_->contents[37]; - EXPECT_EQ(last_msg_->contents[38], 91) << "incorrect value for contents[38], expected 91, is " << last_msg_->contents[38]; - EXPECT_EQ(last_msg_->contents[39], 73) << "incorrect value for contents[39], expected 73, is " << last_msg_->contents[39]; - EXPECT_EQ(last_msg_->contents[40], 251) << "incorrect value for contents[40], expected 251, is " << last_msg_->contents[40]; - EXPECT_EQ(last_msg_->contents[41], 81) << "incorrect value for contents[41], expected 81, is " << last_msg_->contents[41]; - EXPECT_EQ(last_msg_->contents[42], 131) << "incorrect value for contents[42], expected 131, is " << last_msg_->contents[42]; - EXPECT_EQ(last_msg_->contents[43], 205) << "incorrect value for contents[43], expected 205, is " << last_msg_->contents[43]; - EXPECT_EQ(last_msg_->contents[44], 193) << "incorrect value for contents[44], expected 193, is " << last_msg_->contents[44]; - EXPECT_EQ(last_msg_->contents[45], 146) << "incorrect value for contents[45], expected 146, is " << last_msg_->contents[45]; - EXPECT_EQ(last_msg_->contents[46], 206) << "incorrect value for contents[46], expected 206, is " << last_msg_->contents[46]; - EXPECT_EQ(last_msg_->contents[47], 185) << "incorrect value for contents[47], expected 185, is " << last_msg_->contents[47]; - EXPECT_EQ(last_msg_->contents[48], 140) << "incorrect value for contents[48], expected 140, is " << last_msg_->contents[48]; - EXPECT_EQ(last_msg_->contents[49], 249) << "incorrect value for contents[49], expected 249, is " << last_msg_->contents[49]; - EXPECT_EQ(last_msg_->contents[50], 163) << "incorrect value for contents[50], expected 163, is " << last_msg_->contents[50]; - EXPECT_EQ(last_msg_->contents[51], 231) << "incorrect value for contents[51], expected 231, is " << last_msg_->contents[51]; - EXPECT_EQ(last_msg_->contents[52], 65) << "incorrect value for contents[52], expected 65, is " << last_msg_->contents[52]; - EXPECT_EQ(last_msg_->contents[53], 67) << "incorrect value for contents[53], expected 67, is " << last_msg_->contents[53]; - EXPECT_EQ(last_msg_->contents[54], 94) << "incorrect value for contents[54], expected 94, is " << last_msg_->contents[54]; - EXPECT_EQ(last_msg_->contents[55], 250) << "incorrect value for contents[55], expected 250, is " << last_msg_->contents[55]; - EXPECT_EQ(last_msg_->contents[56], 109) << "incorrect value for contents[56], expected 109, is " << last_msg_->contents[56]; - EXPECT_EQ(last_msg_->contents[57], 152) << "incorrect value for contents[57], expected 152, is " << last_msg_->contents[57]; - EXPECT_EQ(last_msg_->contents[58], 95) << "incorrect value for contents[58], expected 95, is " << last_msg_->contents[58]; - EXPECT_EQ(last_msg_->contents[59], 123) << "incorrect value for contents[59], expected 123, is " << last_msg_->contents[59]; - EXPECT_EQ(last_msg_->contents[60], 77) << "incorrect value for contents[60], expected 77, is " << last_msg_->contents[60]; - EXPECT_EQ(last_msg_->contents[61], 224) << "incorrect value for contents[61], expected 224, is " << last_msg_->contents[61]; - EXPECT_EQ(last_msg_->contents[62], 124) << "incorrect value for contents[62], expected 124, is " << last_msg_->contents[62]; - EXPECT_EQ(last_msg_->contents[63], 238) << "incorrect value for contents[63], expected 238, is " << last_msg_->contents[63]; - EXPECT_EQ(last_msg_->contents[64], 205) << "incorrect value for contents[64], expected 205, is " << last_msg_->contents[64]; - EXPECT_EQ(last_msg_->contents[65], 65) << "incorrect value for contents[65], expected 65, is " << last_msg_->contents[65]; - EXPECT_EQ(last_msg_->contents[66], 103) << "incorrect value for contents[66], expected 103, is " << last_msg_->contents[66]; - EXPECT_EQ(last_msg_->contents[67], 35) << "incorrect value for contents[67], expected 35, is " << last_msg_->contents[67]; - EXPECT_EQ(last_msg_->contents[68], 104) << "incorrect value for contents[68], expected 104, is " << last_msg_->contents[68]; - EXPECT_EQ(last_msg_->contents[69], 209) << "incorrect value for contents[69], expected 209, is " << last_msg_->contents[69]; - EXPECT_EQ(last_msg_->contents[70], 5) << "incorrect value for contents[70], expected 5, is " << last_msg_->contents[70]; - EXPECT_EQ(last_msg_->contents[71], 191) << "incorrect value for contents[71], expected 191, is " << last_msg_->contents[71]; - EXPECT_EQ(last_msg_->contents[72], 47) << "incorrect value for contents[72], expected 47, is " << last_msg_->contents[72]; - EXPECT_EQ(last_msg_->contents[73], 249) << "incorrect value for contents[73], expected 249, is " << last_msg_->contents[73]; - EXPECT_EQ(last_msg_->contents[74], 176) << "incorrect value for contents[74], expected 176, is " << last_msg_->contents[74]; - EXPECT_EQ(last_msg_->contents[75], 166) << "incorrect value for contents[75], expected 166, is " << last_msg_->contents[75]; - EXPECT_EQ(last_msg_->contents[76], 213) << "incorrect value for contents[76], expected 213, is " << last_msg_->contents[76]; - EXPECT_EQ(last_msg_->contents[77], 46) << "incorrect value for contents[77], expected 46, is " << last_msg_->contents[77]; - EXPECT_EQ(last_msg_->contents[78], 192) << "incorrect value for contents[78], expected 192, is " << last_msg_->contents[78]; - EXPECT_EQ(last_msg_->contents[79], 86) << "incorrect value for contents[79], expected 86, is " << last_msg_->contents[79]; - EXPECT_EQ(last_msg_->contents[80], 32) << "incorrect value for contents[80], expected 32, is " << last_msg_->contents[80]; - EXPECT_EQ(last_msg_->contents[81], 103) << "incorrect value for contents[81], expected 103, is " << last_msg_->contents[81]; - EXPECT_EQ(last_msg_->contents[82], 146) << "incorrect value for contents[82], expected 146, is " << last_msg_->contents[82]; - EXPECT_EQ(last_msg_->contents[83], 252) << "incorrect value for contents[83], expected 252, is " << last_msg_->contents[83]; - EXPECT_EQ(last_msg_->contents[84], 4) << "incorrect value for contents[84], expected 4, is " << last_msg_->contents[84]; - EXPECT_EQ(last_msg_->contents[85], 16) << "incorrect value for contents[85], expected 16, is " << last_msg_->contents[85]; - EXPECT_EQ(last_msg_->contents[86], 54) << "incorrect value for contents[86], expected 54, is " << last_msg_->contents[86]; - EXPECT_EQ(last_msg_->contents[87], 161) << "incorrect value for contents[87], expected 161, is " << last_msg_->contents[87]; - EXPECT_EQ(last_msg_->contents[88], 60) << "incorrect value for contents[88], expected 60, is " << last_msg_->contents[88]; - EXPECT_EQ(last_msg_->contents[89], 6) << "incorrect value for contents[89], expected 6, is " << last_msg_->contents[89]; - EXPECT_EQ(last_msg_->contents[90], 13) << "incorrect value for contents[90], expected 13, is " << last_msg_->contents[90]; - EXPECT_EQ(last_msg_->contents[91], 191) << "incorrect value for contents[91], expected 191, is " << last_msg_->contents[91]; - EXPECT_EQ(last_msg_->contents[92], 116) << "incorrect value for contents[92], expected 116, is " << last_msg_->contents[92]; - EXPECT_EQ(last_msg_->contents[93], 182) << "incorrect value for contents[93], expected 182, is " << last_msg_->contents[93]; - EXPECT_EQ(last_msg_->contents[94], 42) << "incorrect value for contents[94], expected 42, is " << last_msg_->contents[94]; - EXPECT_EQ(last_msg_->contents[95], 191) << "incorrect value for contents[95], expected 191, is " << last_msg_->contents[95]; - EXPECT_EQ(last_msg_->contents[96], 213) << "incorrect value for contents[96], expected 213, is " << last_msg_->contents[96]; - EXPECT_EQ(last_msg_->contents[97], 20) << "incorrect value for contents[97], expected 20, is " << last_msg_->contents[97]; - EXPECT_EQ(last_msg_->contents[98], 217) << "incorrect value for contents[98], expected 217, is " << last_msg_->contents[98]; - EXPECT_EQ(last_msg_->contents[99], 8) << "incorrect value for contents[99], expected 8, is " << last_msg_->contents[99]; - EXPECT_EQ(last_msg_->contents[100], 142) << "incorrect value for contents[100], expected 142, is " << last_msg_->contents[100]; - EXPECT_EQ(last_msg_->contents[101], 187) << "incorrect value for contents[101], expected 187, is " << last_msg_->contents[101]; - EXPECT_EQ(last_msg_->contents[102], 238) << "incorrect value for contents[102], expected 238, is " << last_msg_->contents[102]; - EXPECT_EQ(last_msg_->contents[103], 120) << "incorrect value for contents[103], expected 120, is " << last_msg_->contents[103]; - EXPECT_EQ(last_msg_->contents[104], 184) << "incorrect value for contents[104], expected 184, is " << last_msg_->contents[104]; - EXPECT_EQ(last_msg_->contents[105], 250) << "incorrect value for contents[105], expected 250, is " << last_msg_->contents[105]; - EXPECT_EQ(last_msg_->contents[106], 31) << "incorrect value for contents[106], expected 31, is " << last_msg_->contents[106]; - EXPECT_EQ(last_msg_->contents[107], 151) << "incorrect value for contents[107], expected 151, is " << last_msg_->contents[107]; - EXPECT_EQ(last_msg_->contents[108], 37) << "incorrect value for contents[108], expected 37, is " << last_msg_->contents[108]; - EXPECT_EQ(last_msg_->contents[109], 51) << "incorrect value for contents[109], expected 51, is " << last_msg_->contents[109]; - EXPECT_EQ(last_msg_->contents[110], 177) << "incorrect value for contents[110], expected 177, is " << last_msg_->contents[110]; - EXPECT_EQ(last_msg_->contents[111], 130) << "incorrect value for contents[111], expected 130, is " << last_msg_->contents[111]; - EXPECT_EQ(last_msg_->contents[112], 190) << "incorrect value for contents[112], expected 190, is " << last_msg_->contents[112]; - EXPECT_EQ(last_msg_->contents[113], 155) << "incorrect value for contents[113], expected 155, is " << last_msg_->contents[113]; - EXPECT_EQ(last_msg_->contents[114], 71) << "incorrect value for contents[114], expected 71, is " << last_msg_->contents[114]; - EXPECT_EQ(last_msg_->contents[115], 68) << "incorrect value for contents[115], expected 68, is " << last_msg_->contents[115]; - EXPECT_EQ(last_msg_->contents[116], 56) << "incorrect value for contents[116], expected 56, is " << last_msg_->contents[116]; - EXPECT_EQ(last_msg_->contents[117], 238) << "incorrect value for contents[117], expected 238, is " << last_msg_->contents[117]; - EXPECT_EQ(last_msg_->contents[118], 92) << "incorrect value for contents[118], expected 92, is " << last_msg_->contents[118]; - EXPECT_EQ(last_msg_->contents[119], 130) << "incorrect value for contents[119], expected 130, is " << last_msg_->contents[119]; - EXPECT_EQ(last_msg_->contents[120], 37) << "incorrect value for contents[120], expected 37, is " << last_msg_->contents[120]; - EXPECT_EQ(last_msg_->contents[121], 137) << "incorrect value for contents[121], expected 137, is " << last_msg_->contents[121]; - EXPECT_EQ(last_msg_->contents[122], 146) << "incorrect value for contents[122], expected 146, is " << last_msg_->contents[122]; - EXPECT_EQ(last_msg_->contents[123], 246) << "incorrect value for contents[123], expected 246, is " << last_msg_->contents[123]; - EXPECT_EQ(last_msg_->contents[124], 114) << "incorrect value for contents[124], expected 114, is " << last_msg_->contents[124]; - EXPECT_EQ(last_msg_->contents[125], 116) << "incorrect value for contents[125], expected 116, is " << last_msg_->contents[125]; - EXPECT_EQ(last_msg_->contents[126], 138) << "incorrect value for contents[126], expected 138, is " << last_msg_->contents[126]; - EXPECT_EQ(last_msg_->contents[127], 165) << "incorrect value for contents[127], expected 165, is " << last_msg_->contents[127]; - EXPECT_EQ(last_msg_->contents[128], 217) << "incorrect value for contents[128], expected 217, is " << last_msg_->contents[128]; - EXPECT_EQ(last_msg_->contents[129], 79) << "incorrect value for contents[129], expected 79, is " << last_msg_->contents[129]; - EXPECT_EQ(last_msg_->contents[130], 10) << "incorrect value for contents[130], expected 10, is " << last_msg_->contents[130]; - EXPECT_EQ(last_msg_->contents[131], 189) << "incorrect value for contents[131], expected 189, is " << last_msg_->contents[131]; - EXPECT_EQ(last_msg_->contents[132], 128) << "incorrect value for contents[132], expected 128, is " << last_msg_->contents[132]; - EXPECT_EQ(last_msg_->contents[133], 189) << "incorrect value for contents[133], expected 189, is " << last_msg_->contents[133]; - EXPECT_EQ(last_msg_->contents[134], 2) << "incorrect value for contents[134], expected 2, is " << last_msg_->contents[134]; - EXPECT_EQ(last_msg_->contents[135], 240) << "incorrect value for contents[135], expected 240, is " << last_msg_->contents[135]; - EXPECT_EQ(last_msg_->contents[136], 92) << "incorrect value for contents[136], expected 92, is " << last_msg_->contents[136]; - EXPECT_EQ(last_msg_->contents[137], 28) << "incorrect value for contents[137], expected 28, is " << last_msg_->contents[137]; - EXPECT_EQ(last_msg_->contents[138], 126) << "incorrect value for contents[138], expected 126, is " << last_msg_->contents[138]; - EXPECT_EQ(last_msg_->contents[139], 105) << "incorrect value for contents[139], expected 105, is " << last_msg_->contents[139]; - EXPECT_EQ(last_msg_->contents[140], 236) << "incorrect value for contents[140], expected 236, is " << last_msg_->contents[140]; - EXPECT_EQ(last_msg_->contents[141], 228) << "incorrect value for contents[141], expected 228, is " << last_msg_->contents[141]; - EXPECT_EQ(last_msg_->contents[142], 194) << "incorrect value for contents[142], expected 194, is " << last_msg_->contents[142]; - EXPECT_EQ(last_msg_->contents[143], 0) << "incorrect value for contents[143], expected 0, is " << last_msg_->contents[143]; - EXPECT_EQ(last_msg_->contents[144], 51) << "incorrect value for contents[144], expected 51, is " << last_msg_->contents[144]; - EXPECT_EQ(last_msg_->contents[145], 61) << "incorrect value for contents[145], expected 61, is " << last_msg_->contents[145]; - EXPECT_EQ(last_msg_->contents[146], 74) << "incorrect value for contents[146], expected 74, is " << last_msg_->contents[146]; - EXPECT_EQ(last_msg_->contents[147], 41) << "incorrect value for contents[147], expected 41, is " << last_msg_->contents[147]; - EXPECT_EQ(last_msg_->contents[148], 10) << "incorrect value for contents[148], expected 10, is " << last_msg_->contents[148]; - EXPECT_EQ(last_msg_->contents[149], 239) << "incorrect value for contents[149], expected 239, is " << last_msg_->contents[149]; - EXPECT_EQ(last_msg_->contents[150], 133) << "incorrect value for contents[150], expected 133, is " << last_msg_->contents[150]; - EXPECT_EQ(last_msg_->contents[151], 106) << "incorrect value for contents[151], expected 106, is " << last_msg_->contents[151]; - EXPECT_EQ(last_msg_->contents[152], 190) << "incorrect value for contents[152], expected 190, is " << last_msg_->contents[152]; - EXPECT_EQ(last_msg_->contents[153], 30) << "incorrect value for contents[153], expected 30, is " << last_msg_->contents[153]; - EXPECT_EQ(last_msg_->contents[154], 27) << "incorrect value for contents[154], expected 27, is " << last_msg_->contents[154]; - EXPECT_EQ(last_msg_->contents[155], 3) << "incorrect value for contents[155], expected 3, is " << last_msg_->contents[155]; - EXPECT_EQ(last_msg_->contents[156], 240) << "incorrect value for contents[156], expected 240, is " << last_msg_->contents[156]; - EXPECT_EQ(last_msg_->contents[157], 205) << "incorrect value for contents[157], expected 205, is " << last_msg_->contents[157]; - EXPECT_EQ(last_msg_->contents[158], 253) << "incorrect value for contents[158], expected 253, is " << last_msg_->contents[158]; - EXPECT_EQ(last_msg_->contents[159], 113) << "incorrect value for contents[159], expected 113, is " << last_msg_->contents[159]; - EXPECT_EQ(last_msg_->contents[160], 25) << "incorrect value for contents[160], expected 25, is " << last_msg_->contents[160]; - EXPECT_EQ(last_msg_->contents[161], 28) << "incorrect value for contents[161], expected 28, is " << last_msg_->contents[161]; - EXPECT_EQ(last_msg_->contents[162], 187) << "incorrect value for contents[162], expected 187, is " << last_msg_->contents[162]; - EXPECT_EQ(last_msg_->contents[163], 81) << "incorrect value for contents[163], expected 81, is " << last_msg_->contents[163]; - EXPECT_EQ(last_msg_->contents[164], 101) << "incorrect value for contents[164], expected 101, is " << last_msg_->contents[164]; - EXPECT_EQ(last_msg_->contents[165], 216) << "incorrect value for contents[165], expected 216, is " << last_msg_->contents[165]; - EXPECT_EQ(last_msg_->contents[166], 121) << "incorrect value for contents[166], expected 121, is " << last_msg_->contents[166]; - EXPECT_EQ(last_msg_->contents[167], 41) << "incorrect value for contents[167], expected 41, is " << last_msg_->contents[167]; - EXPECT_EQ(last_msg_->contents[168], 179) << "incorrect value for contents[168], expected 179, is " << last_msg_->contents[168]; - EXPECT_EQ(last_msg_->contents[169], 120) << "incorrect value for contents[169], expected 120, is " << last_msg_->contents[169]; - EXPECT_EQ(last_msg_->contents[170], 152) << "incorrect value for contents[170], expected 152, is " << last_msg_->contents[170]; - EXPECT_EQ(last_msg_->contents[171], 18) << "incorrect value for contents[171], expected 18, is " << last_msg_->contents[171]; - EXPECT_EQ(last_msg_->contents[172], 116) << "incorrect value for contents[172], expected 116, is " << last_msg_->contents[172]; - EXPECT_EQ(last_msg_->contents[173], 53) << "incorrect value for contents[173], expected 53, is " << last_msg_->contents[173]; - EXPECT_EQ(last_msg_->contents[174], 212) << "incorrect value for contents[174], expected 212, is " << last_msg_->contents[174]; - EXPECT_EQ(last_msg_->contents[175], 100) << "incorrect value for contents[175], expected 100, is " << last_msg_->contents[175]; - EXPECT_EQ(last_msg_->contents[176], 2) << "incorrect value for contents[176], expected 2, is " << last_msg_->contents[176]; - EXPECT_EQ(last_msg_->contents[177], 114) << "incorrect value for contents[177], expected 114, is " << last_msg_->contents[177]; - EXPECT_EQ(last_msg_->contents[178], 198) << "incorrect value for contents[178], expected 198, is " << last_msg_->contents[178]; - EXPECT_EQ(last_msg_->contents[179], 200) << "incorrect value for contents[179], expected 200, is " << last_msg_->contents[179]; - EXPECT_EQ(last_msg_->contents[180], 10) << "incorrect value for contents[180], expected 10, is " << last_msg_->contents[180]; - EXPECT_EQ(last_msg_->contents[181], 147) << "incorrect value for contents[181], expected 147, is " << last_msg_->contents[181]; - EXPECT_EQ(last_msg_->contents[182], 25) << "incorrect value for contents[182], expected 25, is " << last_msg_->contents[182]; - EXPECT_EQ(last_msg_->contents[183], 33) << "incorrect value for contents[183], expected 33, is " << last_msg_->contents[183]; - EXPECT_EQ(last_msg_->contents[184], 115) << "incorrect value for contents[184], expected 115, is " << last_msg_->contents[184]; - EXPECT_EQ(last_msg_->contents[185], 208) << "incorrect value for contents[185], expected 208, is " << last_msg_->contents[185]; - EXPECT_EQ(last_msg_->contents[186], 113) << "incorrect value for contents[186], expected 113, is " << last_msg_->contents[186]; - EXPECT_EQ(last_msg_->contents[187], 60) << "incorrect value for contents[187], expected 60, is " << last_msg_->contents[187]; - EXPECT_EQ(last_msg_->contents[188], 179) << "incorrect value for contents[188], expected 179, is " << last_msg_->contents[188]; - EXPECT_EQ(last_msg_->contents[189], 183) << "incorrect value for contents[189], expected 183, is " << last_msg_->contents[189]; - EXPECT_EQ(last_msg_->contents[190], 0) << "incorrect value for contents[190], expected 0, is " << last_msg_->contents[190]; - EXPECT_EQ(last_msg_->contents[191], 41) << "incorrect value for contents[191], expected 41, is " << last_msg_->contents[191]; - EXPECT_EQ(last_msg_->contents[192], 217) << "incorrect value for contents[192], expected 217, is " << last_msg_->contents[192]; - EXPECT_EQ(last_msg_->contents[193], 206) << "incorrect value for contents[193], expected 206, is " << last_msg_->contents[193]; - EXPECT_EQ(last_msg_->contents[194], 255) << "incorrect value for contents[194], expected 255, is " << last_msg_->contents[194]; - EXPECT_EQ(last_msg_->contents[195], 211) << "incorrect value for contents[195], expected 211, is " << last_msg_->contents[195]; - EXPECT_EQ(last_msg_->contents[196], 225) << "incorrect value for contents[196], expected 225, is " << last_msg_->contents[196]; - EXPECT_EQ(last_msg_->contents[197], 142) << "incorrect value for contents[197], expected 142, is " << last_msg_->contents[197]; - EXPECT_EQ(last_msg_->contents[198], 191) << "incorrect value for contents[198], expected 191, is " << last_msg_->contents[198]; - EXPECT_EQ(last_msg_->contents[199], 133) << "incorrect value for contents[199], expected 133, is " << last_msg_->contents[199]; - EXPECT_EQ(last_msg_->contents[200], 81) << "incorrect value for contents[200], expected 81, is " << last_msg_->contents[200]; - EXPECT_EQ(last_msg_->contents[201], 15) << "incorrect value for contents[201], expected 15, is " << last_msg_->contents[201]; - EXPECT_EQ(last_msg_->contents[202], 248) << "incorrect value for contents[202], expected 248, is " << last_msg_->contents[202]; - EXPECT_EQ(last_msg_->contents[203], 193) << "incorrect value for contents[203], expected 193, is " << last_msg_->contents[203]; - EXPECT_EQ(last_msg_->contents[204], 66) << "incorrect value for contents[204], expected 66, is " << last_msg_->contents[204]; - EXPECT_EQ(last_msg_->contents[205], 191) << "incorrect value for contents[205], expected 191, is " << last_msg_->contents[205]; - EXPECT_EQ(last_msg_->contents[206], 244) << "incorrect value for contents[206], expected 244, is " << last_msg_->contents[206]; - EXPECT_EQ(last_msg_->contents[207], 221) << "incorrect value for contents[207], expected 221, is " << last_msg_->contents[207]; - EXPECT_EQ(last_msg_->contents[208], 248) << "incorrect value for contents[208], expected 248, is " << last_msg_->contents[208]; - EXPECT_EQ(last_msg_->contents[209], 199) << "incorrect value for contents[209], expected 199, is " << last_msg_->contents[209]; - EXPECT_EQ(last_msg_->contents[210], 241) << "incorrect value for contents[210], expected 241, is " << last_msg_->contents[210]; - EXPECT_EQ(last_msg_->contents[211], 112) << "incorrect value for contents[211], expected 112, is " << last_msg_->contents[211]; - EXPECT_EQ(last_msg_->contents[212], 51) << "incorrect value for contents[212], expected 51, is " << last_msg_->contents[212]; - EXPECT_EQ(last_msg_->contents[213], 1) << "incorrect value for contents[213], expected 1, is " << last_msg_->contents[213]; - EXPECT_EQ(last_msg_->contents[214], 180) << "incorrect value for contents[214], expected 180, is " << last_msg_->contents[214]; - EXPECT_EQ(last_msg_->contents[215], 180) << "incorrect value for contents[215], expected 180, is " << last_msg_->contents[215]; - EXPECT_EQ(last_msg_->contents[216], 125) << "incorrect value for contents[216], expected 125, is " << last_msg_->contents[216]; - EXPECT_EQ(last_msg_->contents[217], 97) << "incorrect value for contents[217], expected 97, is " << last_msg_->contents[217]; - EXPECT_EQ(last_msg_->contents[218], 145) << "incorrect value for contents[218], expected 145, is " << last_msg_->contents[218]; - EXPECT_EQ(last_msg_->contents[219], 25) << "incorrect value for contents[219], expected 25, is " << last_msg_->contents[219]; - EXPECT_EQ(last_msg_->contents[220], 72) << "incorrect value for contents[220], expected 72, is " << last_msg_->contents[220]; - EXPECT_EQ(last_msg_->contents[221], 210) << "incorrect value for contents[221], expected 210, is " << last_msg_->contents[221]; - EXPECT_EQ(last_msg_->contents[222], 215) << "incorrect value for contents[222], expected 215, is " << last_msg_->contents[222]; - EXPECT_EQ(last_msg_->contents[223], 208) << "incorrect value for contents[223], expected 208, is " << last_msg_->contents[223]; - EXPECT_EQ(last_msg_->contents[224], 15) << "incorrect value for contents[224], expected 15, is " << last_msg_->contents[224]; - EXPECT_EQ(last_msg_->contents[225], 126) << "incorrect value for contents[225], expected 126, is " << last_msg_->contents[225]; - EXPECT_EQ(last_msg_->contents[226], 56) << "incorrect value for contents[226], expected 56, is " << last_msg_->contents[226]; - EXPECT_EQ(last_msg_->contents[227], 38) << "incorrect value for contents[227], expected 38, is " << last_msg_->contents[227]; - EXPECT_EQ(last_msg_->contents[228], 65) << "incorrect value for contents[228], expected 65, is " << last_msg_->contents[228]; - EXPECT_EQ(last_msg_->contents[229], 4) << "incorrect value for contents[229], expected 4, is " << last_msg_->contents[229]; - EXPECT_EQ(last_msg_->contents[230], 64) << "incorrect value for contents[230], expected 64, is " << last_msg_->contents[230]; - EXPECT_EQ(last_msg_->contents[231], 19) << "incorrect value for contents[231], expected 19, is " << last_msg_->contents[231]; - EXPECT_EQ(last_msg_->contents[232], 74) << "incorrect value for contents[232], expected 74, is " << last_msg_->contents[232]; - EXPECT_EQ(last_msg_->contents[233], 223) << "incorrect value for contents[233], expected 223, is " << last_msg_->contents[233]; - EXPECT_EQ(last_msg_->contents[234], 111) << "incorrect value for contents[234], expected 111, is " << last_msg_->contents[234]; - EXPECT_EQ(last_msg_->contents[235], 109) << "incorrect value for contents[235], expected 109, is " << last_msg_->contents[235]; - EXPECT_EQ(last_msg_->contents[236], 52) << "incorrect value for contents[236], expected 52, is " << last_msg_->contents[236]; - EXPECT_EQ(last_msg_->contents[237], 43) << "incorrect value for contents[237], expected 43, is " << last_msg_->contents[237]; - EXPECT_EQ(last_msg_->contents[238], 167) << "incorrect value for contents[238], expected 167, is " << last_msg_->contents[238]; - EXPECT_EQ(last_msg_->contents[239], 186) << "incorrect value for contents[239], expected 186, is " << last_msg_->contents[239]; - EXPECT_EQ(last_msg_->contents[240], 202) << "incorrect value for contents[240], expected 202, is " << last_msg_->contents[240]; - EXPECT_EQ(last_msg_->contents[241], 111) << "incorrect value for contents[241], expected 111, is " << last_msg_->contents[241]; - EXPECT_EQ(last_msg_->contents[242], 11) << "incorrect value for contents[242], expected 11, is " << last_msg_->contents[242]; - EXPECT_EQ(last_msg_->contents[243], 91) << "incorrect value for contents[243], expected 91, is " << last_msg_->contents[243]; - EXPECT_EQ(last_msg_->contents[244], 21) << "incorrect value for contents[244], expected 21, is " << last_msg_->contents[244]; - EXPECT_EQ(last_msg_->contents[245], 236) << "incorrect value for contents[245], expected 236, is " << last_msg_->contents[245]; - EXPECT_EQ(last_msg_->contents[246], 234) << "incorrect value for contents[246], expected 234, is " << last_msg_->contents[246]; - EXPECT_EQ(last_msg_->contents[247], 196) << "incorrect value for contents[247], expected 196, is " << last_msg_->contents[247]; - EXPECT_EQ(last_msg_->contents[248], 36) << "incorrect value for contents[248], expected 36, is " << last_msg_->contents[248]; - EXPECT_EQ(last_msg_->contents[249], 171) << "incorrect value for contents[249], expected 171, is " << last_msg_->contents[249]; - EXPECT_EQ(last_msg_->contents[250], 147) << "incorrect value for contents[250], expected 147, is " << last_msg_->contents[250]; - EXPECT_EQ(last_msg_->sequence, 259241795) << "incorrect value for sequence, expected 259241795, is " << last_msg_->sequence; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->contents[0], 73) + << "incorrect value for contents[0], expected 73, is " + << last_msg_->contents[0]; + EXPECT_EQ(last_msg_->contents[1], 231) + << "incorrect value for contents[1], expected 231, is " + << last_msg_->contents[1]; + EXPECT_EQ(last_msg_->contents[2], 227) + << "incorrect value for contents[2], expected 227, is " + << last_msg_->contents[2]; + EXPECT_EQ(last_msg_->contents[3], 179) + << "incorrect value for contents[3], expected 179, is " + << last_msg_->contents[3]; + EXPECT_EQ(last_msg_->contents[4], 18) + << "incorrect value for contents[4], expected 18, is " + << last_msg_->contents[4]; + EXPECT_EQ(last_msg_->contents[5], 76) + << "incorrect value for contents[5], expected 76, is " + << last_msg_->contents[5]; + EXPECT_EQ(last_msg_->contents[6], 68) + << "incorrect value for contents[6], expected 68, is " + << last_msg_->contents[6]; + EXPECT_EQ(last_msg_->contents[7], 229) + << "incorrect value for contents[7], expected 229, is " + << last_msg_->contents[7]; + EXPECT_EQ(last_msg_->contents[8], 216) + << "incorrect value for contents[8], expected 216, is " + << last_msg_->contents[8]; + EXPECT_EQ(last_msg_->contents[9], 21) + << "incorrect value for contents[9], expected 21, is " + << last_msg_->contents[9]; + EXPECT_EQ(last_msg_->contents[10], 98) + << "incorrect value for contents[10], expected 98, is " + << last_msg_->contents[10]; + EXPECT_EQ(last_msg_->contents[11], 183) + << "incorrect value for contents[11], expected 183, is " + << last_msg_->contents[11]; + EXPECT_EQ(last_msg_->contents[12], 69) + << "incorrect value for contents[12], expected 69, is " + << last_msg_->contents[12]; + EXPECT_EQ(last_msg_->contents[13], 190) + << "incorrect value for contents[13], expected 190, is " + << last_msg_->contents[13]; + EXPECT_EQ(last_msg_->contents[14], 5) + << "incorrect value for contents[14], expected 5, is " + << last_msg_->contents[14]; + EXPECT_EQ(last_msg_->contents[15], 252) + << "incorrect value for contents[15], expected 252, is " + << last_msg_->contents[15]; + EXPECT_EQ(last_msg_->contents[16], 176) + << "incorrect value for contents[16], expected 176, is " + << last_msg_->contents[16]; + EXPECT_EQ(last_msg_->contents[17], 55) + << "incorrect value for contents[17], expected 55, is " + << last_msg_->contents[17]; + EXPECT_EQ(last_msg_->contents[18], 32) + << "incorrect value for contents[18], expected 32, is " + << last_msg_->contents[18]; + EXPECT_EQ(last_msg_->contents[19], 78) + << "incorrect value for contents[19], expected 78, is " + << last_msg_->contents[19]; + EXPECT_EQ(last_msg_->contents[20], 8) + << "incorrect value for contents[20], expected 8, is " + << last_msg_->contents[20]; + EXPECT_EQ(last_msg_->contents[21], 52) + << "incorrect value for contents[21], expected 52, is " + << last_msg_->contents[21]; + EXPECT_EQ(last_msg_->contents[22], 127) + << "incorrect value for contents[22], expected 127, is " + << last_msg_->contents[22]; + EXPECT_EQ(last_msg_->contents[23], 50) + << "incorrect value for contents[23], expected 50, is " + << last_msg_->contents[23]; + EXPECT_EQ(last_msg_->contents[24], 71) + << "incorrect value for contents[24], expected 71, is " + << last_msg_->contents[24]; + EXPECT_EQ(last_msg_->contents[25], 106) + << "incorrect value for contents[25], expected 106, is " + << last_msg_->contents[25]; + EXPECT_EQ(last_msg_->contents[26], 61) + << "incorrect value for contents[26], expected 61, is " + << last_msg_->contents[26]; + EXPECT_EQ(last_msg_->contents[27], 79) + << "incorrect value for contents[27], expected 79, is " + << last_msg_->contents[27]; + EXPECT_EQ(last_msg_->contents[28], 191) + << "incorrect value for contents[28], expected 191, is " + << last_msg_->contents[28]; + EXPECT_EQ(last_msg_->contents[29], 106) + << "incorrect value for contents[29], expected 106, is " + << last_msg_->contents[29]; + EXPECT_EQ(last_msg_->contents[30], 46) + << "incorrect value for contents[30], expected 46, is " + << last_msg_->contents[30]; + EXPECT_EQ(last_msg_->contents[31], 79) + << "incorrect value for contents[31], expected 79, is " + << last_msg_->contents[31]; + EXPECT_EQ(last_msg_->contents[32], 118) + << "incorrect value for contents[32], expected 118, is " + << last_msg_->contents[32]; + EXPECT_EQ(last_msg_->contents[33], 248) + << "incorrect value for contents[33], expected 248, is " + << last_msg_->contents[33]; + EXPECT_EQ(last_msg_->contents[34], 118) + << "incorrect value for contents[34], expected 118, is " + << last_msg_->contents[34]; + EXPECT_EQ(last_msg_->contents[35], 207) + << "incorrect value for contents[35], expected 207, is " + << last_msg_->contents[35]; + EXPECT_EQ(last_msg_->contents[36], 206) + << "incorrect value for contents[36], expected 206, is " + << last_msg_->contents[36]; + EXPECT_EQ(last_msg_->contents[37], 210) + << "incorrect value for contents[37], expected 210, is " + << last_msg_->contents[37]; + EXPECT_EQ(last_msg_->contents[38], 91) + << "incorrect value for contents[38], expected 91, is " + << last_msg_->contents[38]; + EXPECT_EQ(last_msg_->contents[39], 73) + << "incorrect value for contents[39], expected 73, is " + << last_msg_->contents[39]; + EXPECT_EQ(last_msg_->contents[40], 251) + << "incorrect value for contents[40], expected 251, is " + << last_msg_->contents[40]; + EXPECT_EQ(last_msg_->contents[41], 81) + << "incorrect value for contents[41], expected 81, is " + << last_msg_->contents[41]; + EXPECT_EQ(last_msg_->contents[42], 131) + << "incorrect value for contents[42], expected 131, is " + << last_msg_->contents[42]; + EXPECT_EQ(last_msg_->contents[43], 205) + << "incorrect value for contents[43], expected 205, is " + << last_msg_->contents[43]; + EXPECT_EQ(last_msg_->contents[44], 193) + << "incorrect value for contents[44], expected 193, is " + << last_msg_->contents[44]; + EXPECT_EQ(last_msg_->contents[45], 146) + << "incorrect value for contents[45], expected 146, is " + << last_msg_->contents[45]; + EXPECT_EQ(last_msg_->contents[46], 206) + << "incorrect value for contents[46], expected 206, is " + << last_msg_->contents[46]; + EXPECT_EQ(last_msg_->contents[47], 185) + << "incorrect value for contents[47], expected 185, is " + << last_msg_->contents[47]; + EXPECT_EQ(last_msg_->contents[48], 140) + << "incorrect value for contents[48], expected 140, is " + << last_msg_->contents[48]; + EXPECT_EQ(last_msg_->contents[49], 249) + << "incorrect value for contents[49], expected 249, is " + << last_msg_->contents[49]; + EXPECT_EQ(last_msg_->contents[50], 163) + << "incorrect value for contents[50], expected 163, is " + << last_msg_->contents[50]; + EXPECT_EQ(last_msg_->contents[51], 231) + << "incorrect value for contents[51], expected 231, is " + << last_msg_->contents[51]; + EXPECT_EQ(last_msg_->contents[52], 65) + << "incorrect value for contents[52], expected 65, is " + << last_msg_->contents[52]; + EXPECT_EQ(last_msg_->contents[53], 67) + << "incorrect value for contents[53], expected 67, is " + << last_msg_->contents[53]; + EXPECT_EQ(last_msg_->contents[54], 94) + << "incorrect value for contents[54], expected 94, is " + << last_msg_->contents[54]; + EXPECT_EQ(last_msg_->contents[55], 250) + << "incorrect value for contents[55], expected 250, is " + << last_msg_->contents[55]; + EXPECT_EQ(last_msg_->contents[56], 109) + << "incorrect value for contents[56], expected 109, is " + << last_msg_->contents[56]; + EXPECT_EQ(last_msg_->contents[57], 152) + << "incorrect value for contents[57], expected 152, is " + << last_msg_->contents[57]; + EXPECT_EQ(last_msg_->contents[58], 95) + << "incorrect value for contents[58], expected 95, is " + << last_msg_->contents[58]; + EXPECT_EQ(last_msg_->contents[59], 123) + << "incorrect value for contents[59], expected 123, is " + << last_msg_->contents[59]; + EXPECT_EQ(last_msg_->contents[60], 77) + << "incorrect value for contents[60], expected 77, is " + << last_msg_->contents[60]; + EXPECT_EQ(last_msg_->contents[61], 224) + << "incorrect value for contents[61], expected 224, is " + << last_msg_->contents[61]; + EXPECT_EQ(last_msg_->contents[62], 124) + << "incorrect value for contents[62], expected 124, is " + << last_msg_->contents[62]; + EXPECT_EQ(last_msg_->contents[63], 238) + << "incorrect value for contents[63], expected 238, is " + << last_msg_->contents[63]; + EXPECT_EQ(last_msg_->contents[64], 205) + << "incorrect value for contents[64], expected 205, is " + << last_msg_->contents[64]; + EXPECT_EQ(last_msg_->contents[65], 65) + << "incorrect value for contents[65], expected 65, is " + << last_msg_->contents[65]; + EXPECT_EQ(last_msg_->contents[66], 103) + << "incorrect value for contents[66], expected 103, is " + << last_msg_->contents[66]; + EXPECT_EQ(last_msg_->contents[67], 35) + << "incorrect value for contents[67], expected 35, is " + << last_msg_->contents[67]; + EXPECT_EQ(last_msg_->contents[68], 104) + << "incorrect value for contents[68], expected 104, is " + << last_msg_->contents[68]; + EXPECT_EQ(last_msg_->contents[69], 209) + << "incorrect value for contents[69], expected 209, is " + << last_msg_->contents[69]; + EXPECT_EQ(last_msg_->contents[70], 5) + << "incorrect value for contents[70], expected 5, is " + << last_msg_->contents[70]; + EXPECT_EQ(last_msg_->contents[71], 191) + << "incorrect value for contents[71], expected 191, is " + << last_msg_->contents[71]; + EXPECT_EQ(last_msg_->contents[72], 47) + << "incorrect value for contents[72], expected 47, is " + << last_msg_->contents[72]; + EXPECT_EQ(last_msg_->contents[73], 249) + << "incorrect value for contents[73], expected 249, is " + << last_msg_->contents[73]; + EXPECT_EQ(last_msg_->contents[74], 176) + << "incorrect value for contents[74], expected 176, is " + << last_msg_->contents[74]; + EXPECT_EQ(last_msg_->contents[75], 166) + << "incorrect value for contents[75], expected 166, is " + << last_msg_->contents[75]; + EXPECT_EQ(last_msg_->contents[76], 213) + << "incorrect value for contents[76], expected 213, is " + << last_msg_->contents[76]; + EXPECT_EQ(last_msg_->contents[77], 46) + << "incorrect value for contents[77], expected 46, is " + << last_msg_->contents[77]; + EXPECT_EQ(last_msg_->contents[78], 192) + << "incorrect value for contents[78], expected 192, is " + << last_msg_->contents[78]; + EXPECT_EQ(last_msg_->contents[79], 86) + << "incorrect value for contents[79], expected 86, is " + << last_msg_->contents[79]; + EXPECT_EQ(last_msg_->contents[80], 32) + << "incorrect value for contents[80], expected 32, is " + << last_msg_->contents[80]; + EXPECT_EQ(last_msg_->contents[81], 103) + << "incorrect value for contents[81], expected 103, is " + << last_msg_->contents[81]; + EXPECT_EQ(last_msg_->contents[82], 146) + << "incorrect value for contents[82], expected 146, is " + << last_msg_->contents[82]; + EXPECT_EQ(last_msg_->contents[83], 252) + << "incorrect value for contents[83], expected 252, is " + << last_msg_->contents[83]; + EXPECT_EQ(last_msg_->contents[84], 4) + << "incorrect value for contents[84], expected 4, is " + << last_msg_->contents[84]; + EXPECT_EQ(last_msg_->contents[85], 16) + << "incorrect value for contents[85], expected 16, is " + << last_msg_->contents[85]; + EXPECT_EQ(last_msg_->contents[86], 54) + << "incorrect value for contents[86], expected 54, is " + << last_msg_->contents[86]; + EXPECT_EQ(last_msg_->contents[87], 161) + << "incorrect value for contents[87], expected 161, is " + << last_msg_->contents[87]; + EXPECT_EQ(last_msg_->contents[88], 60) + << "incorrect value for contents[88], expected 60, is " + << last_msg_->contents[88]; + EXPECT_EQ(last_msg_->contents[89], 6) + << "incorrect value for contents[89], expected 6, is " + << last_msg_->contents[89]; + EXPECT_EQ(last_msg_->contents[90], 13) + << "incorrect value for contents[90], expected 13, is " + << last_msg_->contents[90]; + EXPECT_EQ(last_msg_->contents[91], 191) + << "incorrect value for contents[91], expected 191, is " + << last_msg_->contents[91]; + EXPECT_EQ(last_msg_->contents[92], 116) + << "incorrect value for contents[92], expected 116, is " + << last_msg_->contents[92]; + EXPECT_EQ(last_msg_->contents[93], 182) + << "incorrect value for contents[93], expected 182, is " + << last_msg_->contents[93]; + EXPECT_EQ(last_msg_->contents[94], 42) + << "incorrect value for contents[94], expected 42, is " + << last_msg_->contents[94]; + EXPECT_EQ(last_msg_->contents[95], 191) + << "incorrect value for contents[95], expected 191, is " + << last_msg_->contents[95]; + EXPECT_EQ(last_msg_->contents[96], 213) + << "incorrect value for contents[96], expected 213, is " + << last_msg_->contents[96]; + EXPECT_EQ(last_msg_->contents[97], 20) + << "incorrect value for contents[97], expected 20, is " + << last_msg_->contents[97]; + EXPECT_EQ(last_msg_->contents[98], 217) + << "incorrect value for contents[98], expected 217, is " + << last_msg_->contents[98]; + EXPECT_EQ(last_msg_->contents[99], 8) + << "incorrect value for contents[99], expected 8, is " + << last_msg_->contents[99]; + EXPECT_EQ(last_msg_->contents[100], 142) + << "incorrect value for contents[100], expected 142, is " + << last_msg_->contents[100]; + EXPECT_EQ(last_msg_->contents[101], 187) + << "incorrect value for contents[101], expected 187, is " + << last_msg_->contents[101]; + EXPECT_EQ(last_msg_->contents[102], 238) + << "incorrect value for contents[102], expected 238, is " + << last_msg_->contents[102]; + EXPECT_EQ(last_msg_->contents[103], 120) + << "incorrect value for contents[103], expected 120, is " + << last_msg_->contents[103]; + EXPECT_EQ(last_msg_->contents[104], 184) + << "incorrect value for contents[104], expected 184, is " + << last_msg_->contents[104]; + EXPECT_EQ(last_msg_->contents[105], 250) + << "incorrect value for contents[105], expected 250, is " + << last_msg_->contents[105]; + EXPECT_EQ(last_msg_->contents[106], 31) + << "incorrect value for contents[106], expected 31, is " + << last_msg_->contents[106]; + EXPECT_EQ(last_msg_->contents[107], 151) + << "incorrect value for contents[107], expected 151, is " + << last_msg_->contents[107]; + EXPECT_EQ(last_msg_->contents[108], 37) + << "incorrect value for contents[108], expected 37, is " + << last_msg_->contents[108]; + EXPECT_EQ(last_msg_->contents[109], 51) + << "incorrect value for contents[109], expected 51, is " + << last_msg_->contents[109]; + EXPECT_EQ(last_msg_->contents[110], 177) + << "incorrect value for contents[110], expected 177, is " + << last_msg_->contents[110]; + EXPECT_EQ(last_msg_->contents[111], 130) + << "incorrect value for contents[111], expected 130, is " + << last_msg_->contents[111]; + EXPECT_EQ(last_msg_->contents[112], 190) + << "incorrect value for contents[112], expected 190, is " + << last_msg_->contents[112]; + EXPECT_EQ(last_msg_->contents[113], 155) + << "incorrect value for contents[113], expected 155, is " + << last_msg_->contents[113]; + EXPECT_EQ(last_msg_->contents[114], 71) + << "incorrect value for contents[114], expected 71, is " + << last_msg_->contents[114]; + EXPECT_EQ(last_msg_->contents[115], 68) + << "incorrect value for contents[115], expected 68, is " + << last_msg_->contents[115]; + EXPECT_EQ(last_msg_->contents[116], 56) + << "incorrect value for contents[116], expected 56, is " + << last_msg_->contents[116]; + EXPECT_EQ(last_msg_->contents[117], 238) + << "incorrect value for contents[117], expected 238, is " + << last_msg_->contents[117]; + EXPECT_EQ(last_msg_->contents[118], 92) + << "incorrect value for contents[118], expected 92, is " + << last_msg_->contents[118]; + EXPECT_EQ(last_msg_->contents[119], 130) + << "incorrect value for contents[119], expected 130, is " + << last_msg_->contents[119]; + EXPECT_EQ(last_msg_->contents[120], 37) + << "incorrect value for contents[120], expected 37, is " + << last_msg_->contents[120]; + EXPECT_EQ(last_msg_->contents[121], 137) + << "incorrect value for contents[121], expected 137, is " + << last_msg_->contents[121]; + EXPECT_EQ(last_msg_->contents[122], 146) + << "incorrect value for contents[122], expected 146, is " + << last_msg_->contents[122]; + EXPECT_EQ(last_msg_->contents[123], 246) + << "incorrect value for contents[123], expected 246, is " + << last_msg_->contents[123]; + EXPECT_EQ(last_msg_->contents[124], 114) + << "incorrect value for contents[124], expected 114, is " + << last_msg_->contents[124]; + EXPECT_EQ(last_msg_->contents[125], 116) + << "incorrect value for contents[125], expected 116, is " + << last_msg_->contents[125]; + EXPECT_EQ(last_msg_->contents[126], 138) + << "incorrect value for contents[126], expected 138, is " + << last_msg_->contents[126]; + EXPECT_EQ(last_msg_->contents[127], 165) + << "incorrect value for contents[127], expected 165, is " + << last_msg_->contents[127]; + EXPECT_EQ(last_msg_->contents[128], 217) + << "incorrect value for contents[128], expected 217, is " + << last_msg_->contents[128]; + EXPECT_EQ(last_msg_->contents[129], 79) + << "incorrect value for contents[129], expected 79, is " + << last_msg_->contents[129]; + EXPECT_EQ(last_msg_->contents[130], 10) + << "incorrect value for contents[130], expected 10, is " + << last_msg_->contents[130]; + EXPECT_EQ(last_msg_->contents[131], 189) + << "incorrect value for contents[131], expected 189, is " + << last_msg_->contents[131]; + EXPECT_EQ(last_msg_->contents[132], 128) + << "incorrect value for contents[132], expected 128, is " + << last_msg_->contents[132]; + EXPECT_EQ(last_msg_->contents[133], 189) + << "incorrect value for contents[133], expected 189, is " + << last_msg_->contents[133]; + EXPECT_EQ(last_msg_->contents[134], 2) + << "incorrect value for contents[134], expected 2, is " + << last_msg_->contents[134]; + EXPECT_EQ(last_msg_->contents[135], 240) + << "incorrect value for contents[135], expected 240, is " + << last_msg_->contents[135]; + EXPECT_EQ(last_msg_->contents[136], 92) + << "incorrect value for contents[136], expected 92, is " + << last_msg_->contents[136]; + EXPECT_EQ(last_msg_->contents[137], 28) + << "incorrect value for contents[137], expected 28, is " + << last_msg_->contents[137]; + EXPECT_EQ(last_msg_->contents[138], 126) + << "incorrect value for contents[138], expected 126, is " + << last_msg_->contents[138]; + EXPECT_EQ(last_msg_->contents[139], 105) + << "incorrect value for contents[139], expected 105, is " + << last_msg_->contents[139]; + EXPECT_EQ(last_msg_->contents[140], 236) + << "incorrect value for contents[140], expected 236, is " + << last_msg_->contents[140]; + EXPECT_EQ(last_msg_->contents[141], 228) + << "incorrect value for contents[141], expected 228, is " + << last_msg_->contents[141]; + EXPECT_EQ(last_msg_->contents[142], 194) + << "incorrect value for contents[142], expected 194, is " + << last_msg_->contents[142]; + EXPECT_EQ(last_msg_->contents[143], 0) + << "incorrect value for contents[143], expected 0, is " + << last_msg_->contents[143]; + EXPECT_EQ(last_msg_->contents[144], 51) + << "incorrect value for contents[144], expected 51, is " + << last_msg_->contents[144]; + EXPECT_EQ(last_msg_->contents[145], 61) + << "incorrect value for contents[145], expected 61, is " + << last_msg_->contents[145]; + EXPECT_EQ(last_msg_->contents[146], 74) + << "incorrect value for contents[146], expected 74, is " + << last_msg_->contents[146]; + EXPECT_EQ(last_msg_->contents[147], 41) + << "incorrect value for contents[147], expected 41, is " + << last_msg_->contents[147]; + EXPECT_EQ(last_msg_->contents[148], 10) + << "incorrect value for contents[148], expected 10, is " + << last_msg_->contents[148]; + EXPECT_EQ(last_msg_->contents[149], 239) + << "incorrect value for contents[149], expected 239, is " + << last_msg_->contents[149]; + EXPECT_EQ(last_msg_->contents[150], 133) + << "incorrect value for contents[150], expected 133, is " + << last_msg_->contents[150]; + EXPECT_EQ(last_msg_->contents[151], 106) + << "incorrect value for contents[151], expected 106, is " + << last_msg_->contents[151]; + EXPECT_EQ(last_msg_->contents[152], 190) + << "incorrect value for contents[152], expected 190, is " + << last_msg_->contents[152]; + EXPECT_EQ(last_msg_->contents[153], 30) + << "incorrect value for contents[153], expected 30, is " + << last_msg_->contents[153]; + EXPECT_EQ(last_msg_->contents[154], 27) + << "incorrect value for contents[154], expected 27, is " + << last_msg_->contents[154]; + EXPECT_EQ(last_msg_->contents[155], 3) + << "incorrect value for contents[155], expected 3, is " + << last_msg_->contents[155]; + EXPECT_EQ(last_msg_->contents[156], 240) + << "incorrect value for contents[156], expected 240, is " + << last_msg_->contents[156]; + EXPECT_EQ(last_msg_->contents[157], 205) + << "incorrect value for contents[157], expected 205, is " + << last_msg_->contents[157]; + EXPECT_EQ(last_msg_->contents[158], 253) + << "incorrect value for contents[158], expected 253, is " + << last_msg_->contents[158]; + EXPECT_EQ(last_msg_->contents[159], 113) + << "incorrect value for contents[159], expected 113, is " + << last_msg_->contents[159]; + EXPECT_EQ(last_msg_->contents[160], 25) + << "incorrect value for contents[160], expected 25, is " + << last_msg_->contents[160]; + EXPECT_EQ(last_msg_->contents[161], 28) + << "incorrect value for contents[161], expected 28, is " + << last_msg_->contents[161]; + EXPECT_EQ(last_msg_->contents[162], 187) + << "incorrect value for contents[162], expected 187, is " + << last_msg_->contents[162]; + EXPECT_EQ(last_msg_->contents[163], 81) + << "incorrect value for contents[163], expected 81, is " + << last_msg_->contents[163]; + EXPECT_EQ(last_msg_->contents[164], 101) + << "incorrect value for contents[164], expected 101, is " + << last_msg_->contents[164]; + EXPECT_EQ(last_msg_->contents[165], 216) + << "incorrect value for contents[165], expected 216, is " + << last_msg_->contents[165]; + EXPECT_EQ(last_msg_->contents[166], 121) + << "incorrect value for contents[166], expected 121, is " + << last_msg_->contents[166]; + EXPECT_EQ(last_msg_->contents[167], 41) + << "incorrect value for contents[167], expected 41, is " + << last_msg_->contents[167]; + EXPECT_EQ(last_msg_->contents[168], 179) + << "incorrect value for contents[168], expected 179, is " + << last_msg_->contents[168]; + EXPECT_EQ(last_msg_->contents[169], 120) + << "incorrect value for contents[169], expected 120, is " + << last_msg_->contents[169]; + EXPECT_EQ(last_msg_->contents[170], 152) + << "incorrect value for contents[170], expected 152, is " + << last_msg_->contents[170]; + EXPECT_EQ(last_msg_->contents[171], 18) + << "incorrect value for contents[171], expected 18, is " + << last_msg_->contents[171]; + EXPECT_EQ(last_msg_->contents[172], 116) + << "incorrect value for contents[172], expected 116, is " + << last_msg_->contents[172]; + EXPECT_EQ(last_msg_->contents[173], 53) + << "incorrect value for contents[173], expected 53, is " + << last_msg_->contents[173]; + EXPECT_EQ(last_msg_->contents[174], 212) + << "incorrect value for contents[174], expected 212, is " + << last_msg_->contents[174]; + EXPECT_EQ(last_msg_->contents[175], 100) + << "incorrect value for contents[175], expected 100, is " + << last_msg_->contents[175]; + EXPECT_EQ(last_msg_->contents[176], 2) + << "incorrect value for contents[176], expected 2, is " + << last_msg_->contents[176]; + EXPECT_EQ(last_msg_->contents[177], 114) + << "incorrect value for contents[177], expected 114, is " + << last_msg_->contents[177]; + EXPECT_EQ(last_msg_->contents[178], 198) + << "incorrect value for contents[178], expected 198, is " + << last_msg_->contents[178]; + EXPECT_EQ(last_msg_->contents[179], 200) + << "incorrect value for contents[179], expected 200, is " + << last_msg_->contents[179]; + EXPECT_EQ(last_msg_->contents[180], 10) + << "incorrect value for contents[180], expected 10, is " + << last_msg_->contents[180]; + EXPECT_EQ(last_msg_->contents[181], 147) + << "incorrect value for contents[181], expected 147, is " + << last_msg_->contents[181]; + EXPECT_EQ(last_msg_->contents[182], 25) + << "incorrect value for contents[182], expected 25, is " + << last_msg_->contents[182]; + EXPECT_EQ(last_msg_->contents[183], 33) + << "incorrect value for contents[183], expected 33, is " + << last_msg_->contents[183]; + EXPECT_EQ(last_msg_->contents[184], 115) + << "incorrect value for contents[184], expected 115, is " + << last_msg_->contents[184]; + EXPECT_EQ(last_msg_->contents[185], 208) + << "incorrect value for contents[185], expected 208, is " + << last_msg_->contents[185]; + EXPECT_EQ(last_msg_->contents[186], 113) + << "incorrect value for contents[186], expected 113, is " + << last_msg_->contents[186]; + EXPECT_EQ(last_msg_->contents[187], 60) + << "incorrect value for contents[187], expected 60, is " + << last_msg_->contents[187]; + EXPECT_EQ(last_msg_->contents[188], 179) + << "incorrect value for contents[188], expected 179, is " + << last_msg_->contents[188]; + EXPECT_EQ(last_msg_->contents[189], 183) + << "incorrect value for contents[189], expected 183, is " + << last_msg_->contents[189]; + EXPECT_EQ(last_msg_->contents[190], 0) + << "incorrect value for contents[190], expected 0, is " + << last_msg_->contents[190]; + EXPECT_EQ(last_msg_->contents[191], 41) + << "incorrect value for contents[191], expected 41, is " + << last_msg_->contents[191]; + EXPECT_EQ(last_msg_->contents[192], 217) + << "incorrect value for contents[192], expected 217, is " + << last_msg_->contents[192]; + EXPECT_EQ(last_msg_->contents[193], 206) + << "incorrect value for contents[193], expected 206, is " + << last_msg_->contents[193]; + EXPECT_EQ(last_msg_->contents[194], 255) + << "incorrect value for contents[194], expected 255, is " + << last_msg_->contents[194]; + EXPECT_EQ(last_msg_->contents[195], 211) + << "incorrect value for contents[195], expected 211, is " + << last_msg_->contents[195]; + EXPECT_EQ(last_msg_->contents[196], 225) + << "incorrect value for contents[196], expected 225, is " + << last_msg_->contents[196]; + EXPECT_EQ(last_msg_->contents[197], 142) + << "incorrect value for contents[197], expected 142, is " + << last_msg_->contents[197]; + EXPECT_EQ(last_msg_->contents[198], 191) + << "incorrect value for contents[198], expected 191, is " + << last_msg_->contents[198]; + EXPECT_EQ(last_msg_->contents[199], 133) + << "incorrect value for contents[199], expected 133, is " + << last_msg_->contents[199]; + EXPECT_EQ(last_msg_->contents[200], 81) + << "incorrect value for contents[200], expected 81, is " + << last_msg_->contents[200]; + EXPECT_EQ(last_msg_->contents[201], 15) + << "incorrect value for contents[201], expected 15, is " + << last_msg_->contents[201]; + EXPECT_EQ(last_msg_->contents[202], 248) + << "incorrect value for contents[202], expected 248, is " + << last_msg_->contents[202]; + EXPECT_EQ(last_msg_->contents[203], 193) + << "incorrect value for contents[203], expected 193, is " + << last_msg_->contents[203]; + EXPECT_EQ(last_msg_->contents[204], 66) + << "incorrect value for contents[204], expected 66, is " + << last_msg_->contents[204]; + EXPECT_EQ(last_msg_->contents[205], 191) + << "incorrect value for contents[205], expected 191, is " + << last_msg_->contents[205]; + EXPECT_EQ(last_msg_->contents[206], 244) + << "incorrect value for contents[206], expected 244, is " + << last_msg_->contents[206]; + EXPECT_EQ(last_msg_->contents[207], 221) + << "incorrect value for contents[207], expected 221, is " + << last_msg_->contents[207]; + EXPECT_EQ(last_msg_->contents[208], 248) + << "incorrect value for contents[208], expected 248, is " + << last_msg_->contents[208]; + EXPECT_EQ(last_msg_->contents[209], 199) + << "incorrect value for contents[209], expected 199, is " + << last_msg_->contents[209]; + EXPECT_EQ(last_msg_->contents[210], 241) + << "incorrect value for contents[210], expected 241, is " + << last_msg_->contents[210]; + EXPECT_EQ(last_msg_->contents[211], 112) + << "incorrect value for contents[211], expected 112, is " + << last_msg_->contents[211]; + EXPECT_EQ(last_msg_->contents[212], 51) + << "incorrect value for contents[212], expected 51, is " + << last_msg_->contents[212]; + EXPECT_EQ(last_msg_->contents[213], 1) + << "incorrect value for contents[213], expected 1, is " + << last_msg_->contents[213]; + EXPECT_EQ(last_msg_->contents[214], 180) + << "incorrect value for contents[214], expected 180, is " + << last_msg_->contents[214]; + EXPECT_EQ(last_msg_->contents[215], 180) + << "incorrect value for contents[215], expected 180, is " + << last_msg_->contents[215]; + EXPECT_EQ(last_msg_->contents[216], 125) + << "incorrect value for contents[216], expected 125, is " + << last_msg_->contents[216]; + EXPECT_EQ(last_msg_->contents[217], 97) + << "incorrect value for contents[217], expected 97, is " + << last_msg_->contents[217]; + EXPECT_EQ(last_msg_->contents[218], 145) + << "incorrect value for contents[218], expected 145, is " + << last_msg_->contents[218]; + EXPECT_EQ(last_msg_->contents[219], 25) + << "incorrect value for contents[219], expected 25, is " + << last_msg_->contents[219]; + EXPECT_EQ(last_msg_->contents[220], 72) + << "incorrect value for contents[220], expected 72, is " + << last_msg_->contents[220]; + EXPECT_EQ(last_msg_->contents[221], 210) + << "incorrect value for contents[221], expected 210, is " + << last_msg_->contents[221]; + EXPECT_EQ(last_msg_->contents[222], 215) + << "incorrect value for contents[222], expected 215, is " + << last_msg_->contents[222]; + EXPECT_EQ(last_msg_->contents[223], 208) + << "incorrect value for contents[223], expected 208, is " + << last_msg_->contents[223]; + EXPECT_EQ(last_msg_->contents[224], 15) + << "incorrect value for contents[224], expected 15, is " + << last_msg_->contents[224]; + EXPECT_EQ(last_msg_->contents[225], 126) + << "incorrect value for contents[225], expected 126, is " + << last_msg_->contents[225]; + EXPECT_EQ(last_msg_->contents[226], 56) + << "incorrect value for contents[226], expected 56, is " + << last_msg_->contents[226]; + EXPECT_EQ(last_msg_->contents[227], 38) + << "incorrect value for contents[227], expected 38, is " + << last_msg_->contents[227]; + EXPECT_EQ(last_msg_->contents[228], 65) + << "incorrect value for contents[228], expected 65, is " + << last_msg_->contents[228]; + EXPECT_EQ(last_msg_->contents[229], 4) + << "incorrect value for contents[229], expected 4, is " + << last_msg_->contents[229]; + EXPECT_EQ(last_msg_->contents[230], 64) + << "incorrect value for contents[230], expected 64, is " + << last_msg_->contents[230]; + EXPECT_EQ(last_msg_->contents[231], 19) + << "incorrect value for contents[231], expected 19, is " + << last_msg_->contents[231]; + EXPECT_EQ(last_msg_->contents[232], 74) + << "incorrect value for contents[232], expected 74, is " + << last_msg_->contents[232]; + EXPECT_EQ(last_msg_->contents[233], 223) + << "incorrect value for contents[233], expected 223, is " + << last_msg_->contents[233]; + EXPECT_EQ(last_msg_->contents[234], 111) + << "incorrect value for contents[234], expected 111, is " + << last_msg_->contents[234]; + EXPECT_EQ(last_msg_->contents[235], 109) + << "incorrect value for contents[235], expected 109, is " + << last_msg_->contents[235]; + EXPECT_EQ(last_msg_->contents[236], 52) + << "incorrect value for contents[236], expected 52, is " + << last_msg_->contents[236]; + EXPECT_EQ(last_msg_->contents[237], 43) + << "incorrect value for contents[237], expected 43, is " + << last_msg_->contents[237]; + EXPECT_EQ(last_msg_->contents[238], 167) + << "incorrect value for contents[238], expected 167, is " + << last_msg_->contents[238]; + EXPECT_EQ(last_msg_->contents[239], 186) + << "incorrect value for contents[239], expected 186, is " + << last_msg_->contents[239]; + EXPECT_EQ(last_msg_->contents[240], 202) + << "incorrect value for contents[240], expected 202, is " + << last_msg_->contents[240]; + EXPECT_EQ(last_msg_->contents[241], 111) + << "incorrect value for contents[241], expected 111, is " + << last_msg_->contents[241]; + EXPECT_EQ(last_msg_->contents[242], 11) + << "incorrect value for contents[242], expected 11, is " + << last_msg_->contents[242]; + EXPECT_EQ(last_msg_->contents[243], 91) + << "incorrect value for contents[243], expected 91, is " + << last_msg_->contents[243]; + EXPECT_EQ(last_msg_->contents[244], 21) + << "incorrect value for contents[244], expected 21, is " + << last_msg_->contents[244]; + EXPECT_EQ(last_msg_->contents[245], 236) + << "incorrect value for contents[245], expected 236, is " + << last_msg_->contents[245]; + EXPECT_EQ(last_msg_->contents[246], 234) + << "incorrect value for contents[246], expected 234, is " + << last_msg_->contents[246]; + EXPECT_EQ(last_msg_->contents[247], 196) + << "incorrect value for contents[247], expected 196, is " + << last_msg_->contents[247]; + EXPECT_EQ(last_msg_->contents[248], 36) + << "incorrect value for contents[248], expected 36, is " + << last_msg_->contents[248]; + EXPECT_EQ(last_msg_->contents[249], 171) + << "incorrect value for contents[249], expected 171, is " + << last_msg_->contents[249]; + EXPECT_EQ(last_msg_->contents[250], 147) + << "incorrect value for contents[250], expected 147, is " + << last_msg_->contents[250]; + EXPECT_EQ(last_msg_->sequence, 259241795) + << "incorrect value for sequence, expected 259241795, is " + << last_msg_->sequence; } diff --git a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioRemove.cc b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioRemove.cc index d69101540..41cfbfe6f 100644 --- a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioRemove.cc +++ b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioRemove.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioRemove.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioRemove.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_file_io_MsgFileioRemove0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_file_io_MsgFileioRemove0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_file_io_MsgFileioRemove0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_file_io_MsgFileioRemove0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_fileio_remove_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_fileio_remove_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,44 +81,54 @@ class Test_legacy_auto_check_sbp_file_io_MsgFileioRemove0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_fileio_remove_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioRemove0, Test) -{ +}; - uint8_t encoded_frame[] = {85,172,0,195,4,14,47,112,97,116,104,47,116,111,47,102,105,108,101,0,46,243, }; +TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioRemove0, Test) { + uint8_t encoded_frame[] = { + 85, 172, 0, 195, 4, 14, 47, 112, 97, 116, 104, + 47, 116, 111, 47, 102, 105, 108, 101, 0, 46, 243, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_fileio_remove_t* test_msg = ( msg_fileio_remove_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)102,(char)105,(char)108,(char)101,(char)0 }; - memcpy(test_msg->filename, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->filename) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0xac, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_fileio_remove_t *test_msg = (msg_fileio_remove_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = {(char)47, (char)112, (char)97, (char)116, + (char)104, (char)47, (char)116, (char)111, + (char)47, (char)102, (char)105, (char)108, + (char)101, (char)0}; + memcpy(test_msg->filename, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->filename) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)102,(char)105,(char)108,(char)101,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->filename, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->filename, expected string '" << check_string << "', is '" << last_msg_->filename << "'"; - } + EXPECT_EQ(send_message(0xac, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = {(char)47, (char)112, (char)97, (char)116, + (char)104, (char)47, (char)116, (char)111, + (char)47, (char)102, (char)105, (char)108, + (char)101, (char)0}; + EXPECT_EQ(memcmp(last_msg_->filename, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_->filename, expected string '" + << check_string << "', is '" << last_msg_->filename << "'"; + } } diff --git a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioWriteResp.cc b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioWriteResp.cc index b0f646778..5a3782052 100644 --- a/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioWriteResp.cc +++ b/c/test/legacy/cpp/auto_check_sbp_file_io_MsgFileioWriteResp.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioWriteResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/file_io/test_MsgFileioWriteResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_file_io_MsgFileioWriteResp0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_file_io_MsgFileioWriteResp0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_file_io_MsgFileioWriteResp0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_file_io_MsgFileioWriteResp0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_fileio_write_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_fileio_write_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,35 +82,38 @@ class Test_legacy_auto_check_sbp_file_io_MsgFileioWriteResp0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_fileio_write_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioWriteResp0, Test) -{ +}; - uint8_t encoded_frame[] = {85,171,0,66,0,4,202,0,0,0,243,243, }; +TEST_F(Test_legacy_auto_check_sbp_file_io_MsgFileioWriteResp0, Test) { + uint8_t encoded_frame[] = { + 85, 171, 0, 66, 0, 4, 202, 0, 0, 0, 243, 243, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_fileio_write_resp_t* test_msg = ( msg_fileio_write_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->sequence = 202; - - EXPECT_EQ(send_message( 0xab, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_fileio_write_resp_t *test_msg = + (msg_fileio_write_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->sequence = 202; + + EXPECT_EQ(send_message(0xab, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->sequence, 202) << "incorrect value for sequence, expected 202, is " << last_msg_->sequence; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->sequence, 202) + << "incorrect value for sequence, expected 202, is " + << last_msg_->sequence; } diff --git a/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashDone.cc b/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashDone.cc index ee423e182..14ab5a406 100644 --- a/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashDone.cc +++ b/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashDone.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashDone.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashDone.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_flash_MsgFlashDone0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_flash_MsgFlashDone0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_flash_MsgFlashDone0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_flash_MsgFlashDone0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_flash_done_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_flash_done_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,35 +81,37 @@ class Test_legacy_auto_check_sbp_flash_MsgFlashDone0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_flash_done_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_flash_MsgFlashDone0, Test) -{ +}; - uint8_t encoded_frame[] = {85,224,0,195,4,1,82,6,54, }; +TEST_F(Test_legacy_auto_check_sbp_flash_MsgFlashDone0, Test) { + uint8_t encoded_frame[] = { + 85, 224, 0, 195, 4, 1, 82, 6, 54, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_flash_done_t* test_msg = ( msg_flash_done_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->response = 82; - - EXPECT_EQ(send_message( 0xe0, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_flash_done_t *test_msg = (msg_flash_done_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->response = 82; + + EXPECT_EQ(send_message(0xe0, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->response, 82) << "incorrect value for response, expected 82, is " << last_msg_->response; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->response, 82) + << "incorrect value for response, expected 82, is " + << last_msg_->response; } diff --git a/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashErase.cc b/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashErase.cc index 12756ac1c..f3bf9a0a5 100644 --- a/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashErase.cc +++ b/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashErase.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashErase.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashErase.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_flash_MsgFlashErase0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_flash_MsgFlashErase0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_flash_MsgFlashErase0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_flash_MsgFlashErase0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_flash_erase_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_flash_erase_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,37 +81,40 @@ class Test_legacy_auto_check_sbp_flash_MsgFlashErase0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_flash_erase_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_flash_MsgFlashErase0, Test) -{ +}; - uint8_t encoded_frame[] = {85,226,0,195,4,5,74,238,177,118,132,0,251, }; +TEST_F(Test_legacy_auto_check_sbp_flash_MsgFlashErase0, Test) { + uint8_t encoded_frame[] = { + 85, 226, 0, 195, 4, 5, 74, 238, 177, 118, 132, 0, 251, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_flash_erase_t* test_msg = ( msg_flash_erase_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->sector_num = 2222371310; - test_msg->target = 74; - - EXPECT_EQ(send_message( 0xe2, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_flash_erase_t *test_msg = (msg_flash_erase_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->sector_num = 2222371310; + test_msg->target = 74; + + EXPECT_EQ(send_message(0xe2, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->sector_num, 2222371310) << "incorrect value for sector_num, expected 2222371310, is " << last_msg_->sector_num; - EXPECT_EQ(last_msg_->target, 74) << "incorrect value for target, expected 74, is " << last_msg_->target; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->sector_num, 2222371310) + << "incorrect value for sector_num, expected 2222371310, is " + << last_msg_->sector_num; + EXPECT_EQ(last_msg_->target, 74) + << "incorrect value for target, expected 74, is " << last_msg_->target; } diff --git a/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashProgram.cc b/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashProgram.cc index 059dc45c9..2279096b6 100644 --- a/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashProgram.cc +++ b/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashProgram.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashProgram.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashProgram.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_flash_MsgFlashProgram0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_flash_MsgFlashProgram0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_flash_MsgFlashProgram0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_flash_MsgFlashProgram0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_flash_program_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_flash_program_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,1555 +81,2066 @@ class Test_legacy_auto_check_sbp_flash_MsgFlashProgram0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_flash_program_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_flash_MsgFlashProgram0, Test) -{ +}; - uint8_t encoded_frame[] = {85,230,0,195,4,255,212,87,52,244,250,176,222,235,106,144,29,141,255,3,16,192,237,172,254,213,4,220,98,34,222,230,214,6,217,172,122,46,13,38,240,236,60,121,47,252,163,141,222,29,168,214,118,55,201,233,21,214,57,245,246,19,3,121,49,231,37,186,58,238,98,39,70,232,133,25,10,134,129,69,228,134,9,88,183,133,171,255,166,100,152,231,92,9,196,106,246,29,145,156,151,32,67,188,63,233,142,174,139,154,127,35,60,56,187,121,103,135,152,182,88,160,255,227,240,54,100,91,31,141,102,130,254,54,227,229,62,53,225,143,88,139,126,235,235,35,54,134,163,92,57,87,130,178,22,158,18,237,209,187,226,1,46,64,226,235,213,186,159,221,186,25,115,84,131,167,201,104,1,200,13,50,71,73,193,201,250,172,193,13,20,238,130,243,68,4,72,46,194,113,255,238,15,230,64,178,127,217,92,160,201,118,163,144,58,28,174,65,73,45,123,118,83,107,239,168,32,212,191,81,93,186,223,32,19,58,137,72,217,151,251,83,20,113,37,151,34,37,71,95,105,235,144,164,83,197,254,183,223,91,19,45,227, }; +TEST_F(Test_legacy_auto_check_sbp_flash_MsgFlashProgram0, Test) { + uint8_t encoded_frame[] = { + 85, 230, 0, 195, 4, 255, 212, 87, 52, 244, 250, 176, 222, 235, 106, + 144, 29, 141, 255, 3, 16, 192, 237, 172, 254, 213, 4, 220, 98, 34, + 222, 230, 214, 6, 217, 172, 122, 46, 13, 38, 240, 236, 60, 121, 47, + 252, 163, 141, 222, 29, 168, 214, 118, 55, 201, 233, 21, 214, 57, 245, + 246, 19, 3, 121, 49, 231, 37, 186, 58, 238, 98, 39, 70, 232, 133, + 25, 10, 134, 129, 69, 228, 134, 9, 88, 183, 133, 171, 255, 166, 100, + 152, 231, 92, 9, 196, 106, 246, 29, 145, 156, 151, 32, 67, 188, 63, + 233, 142, 174, 139, 154, 127, 35, 60, 56, 187, 121, 103, 135, 152, 182, + 88, 160, 255, 227, 240, 54, 100, 91, 31, 141, 102, 130, 254, 54, 227, + 229, 62, 53, 225, 143, 88, 139, 126, 235, 235, 35, 54, 134, 163, 92, + 57, 87, 130, 178, 22, 158, 18, 237, 209, 187, 226, 1, 46, 64, 226, + 235, 213, 186, 159, 221, 186, 25, 115, 84, 131, 167, 201, 104, 1, 200, + 13, 50, 71, 73, 193, 201, 250, 172, 193, 13, 20, 238, 130, 243, 68, + 4, 72, 46, 194, 113, 255, 238, 15, 230, 64, 178, 127, 217, 92, 160, + 201, 118, 163, 144, 58, 28, 174, 65, 73, 45, 123, 118, 83, 107, 239, + 168, 32, 212, 191, 81, 93, 186, 223, 32, 19, 58, 137, 72, 217, 151, + 251, 83, 20, 113, 37, 151, 34, 37, 71, 95, 105, 235, 144, 164, 83, + 197, 254, 183, 223, 91, 19, 45, 227, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_flash_program_t* test_msg = ( msg_flash_program_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->addr_len = 250; - if (sizeof(test_msg->addr_start) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); - } - test_msg->addr_start[0] = 87; - if (sizeof(test_msg->addr_start) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); - } - test_msg->addr_start[1] = 52; - if (sizeof(test_msg->addr_start) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); - } - test_msg->addr_start[2] = 244; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[0] = 176; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[1] = 222; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[2] = 235; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[3] = 106; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[4] = 144; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[5] = 29; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[6] = 141; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[7] = 255; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[8] = 3; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[9] = 16; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[10] = 192; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[11] = 237; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[12] = 172; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[13] = 254; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[14] = 213; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[15] = 4; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[16] = 220; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[17] = 98; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[18] = 34; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[19] = 222; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[20] = 230; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[21] = 214; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[22] = 6; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[23] = 217; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[24] = 172; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[25] = 122; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[26] = 46; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[27] = 13; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[28] = 38; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[29] = 240; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[30] = 236; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[31] = 60; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[32] = 121; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[33] = 47; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[34] = 252; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[35] = 163; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[36] = 141; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[37] = 222; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[38] = 29; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[39] = 168; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[40] = 214; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[41] = 118; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[42] = 55; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[43] = 201; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[44] = 233; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[45] = 21; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[46] = 214; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[47] = 57; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[48] = 245; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[49] = 246; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[50] = 19; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[51] = 3; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[52] = 121; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[53] = 49; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[54] = 231; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[55] = 37; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[56] = 186; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[57] = 58; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[58] = 238; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[59] = 98; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[60] = 39; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[61] = 70; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[62] = 232; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[63] = 133; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[64] = 25; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[65] = 10; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[66] = 134; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[67] = 129; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[68] = 69; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[69] = 228; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[70] = 134; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[71] = 9; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[72] = 88; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[73] = 183; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[74] = 133; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[75] = 171; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[76] = 255; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[77] = 166; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[78] = 100; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[79] = 152; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[80] = 231; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[81] = 92; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[82] = 9; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[83] = 196; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[84] = 106; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[85] = 246; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[86] = 29; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[87] = 145; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[88] = 156; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[89] = 151; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[90] = 32; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[91] = 67; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[92] = 188; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[93] = 63; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[94] = 233; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[95] = 142; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[96] = 174; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[97] = 139; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[98] = 154; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[99] = 127; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[100] = 35; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[101] = 60; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[102] = 56; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[103] = 187; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[104] = 121; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[105] = 103; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[106] = 135; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[107] = 152; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[108] = 182; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[109] = 88; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[110] = 160; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[111] = 255; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[112] = 227; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[113] = 240; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[114] = 54; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[115] = 100; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[116] = 91; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[117] = 31; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[118] = 141; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[119] = 102; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[120] = 130; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[121] = 254; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[122] = 54; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[123] = 227; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[124] = 229; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[125] = 62; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[126] = 53; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[127] = 225; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[128] = 143; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[129] = 88; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[130] = 139; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[131] = 126; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[132] = 235; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[133] = 235; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[134] = 35; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[135] = 54; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[136] = 134; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[137] = 163; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[138] = 92; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[139] = 57; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[140] = 87; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[141] = 130; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[142] = 178; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[143] = 22; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[144] = 158; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[145] = 18; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[146] = 237; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[147] = 209; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[148] = 187; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[149] = 226; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[150] = 1; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[151] = 46; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[152] = 64; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[153] = 226; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[154] = 235; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[155] = 213; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[156] = 186; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[157] = 159; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[158] = 221; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[159] = 186; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[160] = 25; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[161] = 115; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[162] = 84; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[163] = 131; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[164] = 167; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[165] = 201; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[166] = 104; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[167] = 1; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[168] = 200; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[169] = 13; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[170] = 50; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[171] = 71; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[172] = 73; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[173] = 193; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[174] = 201; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[175] = 250; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[176] = 172; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[177] = 193; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[178] = 13; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[179] = 20; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[180] = 238; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[181] = 130; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[182] = 243; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[183] = 68; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[184] = 4; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[185] = 72; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[186] = 46; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[187] = 194; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[188] = 113; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[189] = 255; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[190] = 238; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[191] = 15; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[192] = 230; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[193] = 64; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[194] = 178; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[195] = 127; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[196] = 217; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[197] = 92; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[198] = 160; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[199] = 201; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[200] = 118; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[201] = 163; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[202] = 144; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[203] = 58; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[204] = 28; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[205] = 174; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[206] = 65; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[207] = 73; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[208] = 45; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[209] = 123; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[210] = 118; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[211] = 83; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[212] = 107; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[213] = 239; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[214] = 168; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[215] = 32; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[216] = 212; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[217] = 191; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[218] = 81; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[219] = 93; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[220] = 186; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[221] = 223; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[222] = 32; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[223] = 19; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[224] = 58; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[225] = 137; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[226] = 72; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[227] = 217; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[228] = 151; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[229] = 251; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[230] = 83; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[231] = 20; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[232] = 113; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[233] = 37; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[234] = 151; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[235] = 34; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[236] = 37; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[237] = 71; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[238] = 95; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[239] = 105; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[240] = 235; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[241] = 144; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[242] = 164; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[243] = 83; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[244] = 197; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[245] = 254; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[246] = 183; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[247] = 223; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[248] = 91; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[249] = 19; - test_msg->target = 212; - - EXPECT_EQ(send_message( 0xe6, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_flash_program_t *test_msg = (msg_flash_program_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->addr_len = 250; + if (sizeof(test_msg->addr_start) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); + } + test_msg->addr_start[0] = 87; + if (sizeof(test_msg->addr_start) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); + } + test_msg->addr_start[1] = 52; + if (sizeof(test_msg->addr_start) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); + } + test_msg->addr_start[2] = 244; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[0] = 176; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[1] = 222; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[2] = 235; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[3] = 106; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[4] = 144; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[5] = 29; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[6] = 141; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[7] = 255; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[8] = 3; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[9] = 16; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[10] = 192; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[11] = 237; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[12] = 172; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[13] = 254; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[14] = 213; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[15] = 4; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[16] = 220; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[17] = 98; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[18] = 34; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[19] = 222; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[20] = 230; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[21] = 214; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[22] = 6; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[23] = 217; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[24] = 172; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[25] = 122; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[26] = 46; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[27] = 13; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[28] = 38; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[29] = 240; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[30] = 236; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[31] = 60; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[32] = 121; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[33] = 47; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[34] = 252; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[35] = 163; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[36] = 141; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[37] = 222; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[38] = 29; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[39] = 168; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[40] = 214; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[41] = 118; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[42] = 55; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[43] = 201; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[44] = 233; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[45] = 21; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[46] = 214; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[47] = 57; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[48] = 245; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[49] = 246; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[50] = 19; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[51] = 3; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[52] = 121; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[53] = 49; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[54] = 231; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[55] = 37; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[56] = 186; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[57] = 58; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[58] = 238; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[59] = 98; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[60] = 39; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[61] = 70; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[62] = 232; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[63] = 133; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[64] = 25; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[65] = 10; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[66] = 134; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[67] = 129; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[68] = 69; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[69] = 228; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[70] = 134; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[71] = 9; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[72] = 88; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[73] = 183; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[74] = 133; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[75] = 171; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[76] = 255; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[77] = 166; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[78] = 100; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[79] = 152; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[80] = 231; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[81] = 92; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[82] = 9; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[83] = 196; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[84] = 106; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[85] = 246; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[86] = 29; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[87] = 145; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[88] = 156; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[89] = 151; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[90] = 32; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[91] = 67; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[92] = 188; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[93] = 63; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[94] = 233; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[95] = 142; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[96] = 174; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[97] = 139; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[98] = 154; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[99] = 127; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[100] = 35; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[101] = 60; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[102] = 56; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[103] = 187; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[104] = 121; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[105] = 103; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[106] = 135; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[107] = 152; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[108] = 182; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[109] = 88; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[110] = 160; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[111] = 255; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[112] = 227; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[113] = 240; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[114] = 54; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[115] = 100; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[116] = 91; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[117] = 31; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[118] = 141; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[119] = 102; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[120] = 130; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[121] = 254; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[122] = 54; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[123] = 227; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[124] = 229; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[125] = 62; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[126] = 53; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[127] = 225; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[128] = 143; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[129] = 88; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[130] = 139; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[131] = 126; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[132] = 235; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[133] = 235; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[134] = 35; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[135] = 54; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[136] = 134; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[137] = 163; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[138] = 92; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[139] = 57; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[140] = 87; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[141] = 130; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[142] = 178; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[143] = 22; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[144] = 158; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[145] = 18; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[146] = 237; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[147] = 209; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[148] = 187; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[149] = 226; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[150] = 1; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[151] = 46; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[152] = 64; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[153] = 226; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[154] = 235; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[155] = 213; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[156] = 186; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[157] = 159; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[158] = 221; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[159] = 186; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[160] = 25; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[161] = 115; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[162] = 84; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[163] = 131; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[164] = 167; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[165] = 201; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[166] = 104; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[167] = 1; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[168] = 200; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[169] = 13; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[170] = 50; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[171] = 71; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[172] = 73; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[173] = 193; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[174] = 201; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[175] = 250; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[176] = 172; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[177] = 193; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[178] = 13; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[179] = 20; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[180] = 238; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[181] = 130; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[182] = 243; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[183] = 68; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[184] = 4; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[185] = 72; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[186] = 46; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[187] = 194; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[188] = 113; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[189] = 255; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[190] = 238; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[191] = 15; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[192] = 230; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[193] = 64; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[194] = 178; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[195] = 127; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[196] = 217; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[197] = 92; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[198] = 160; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[199] = 201; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[200] = 118; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[201] = 163; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[202] = 144; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[203] = 58; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[204] = 28; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[205] = 174; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[206] = 65; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[207] = 73; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[208] = 45; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[209] = 123; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[210] = 118; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[211] = 83; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[212] = 107; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[213] = 239; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[214] = 168; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[215] = 32; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[216] = 212; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[217] = 191; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[218] = 81; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[219] = 93; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[220] = 186; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[221] = 223; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[222] = 32; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[223] = 19; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[224] = 58; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[225] = 137; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[226] = 72; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[227] = 217; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[228] = 151; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[229] = 251; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[230] = 83; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[231] = 20; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[232] = 113; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[233] = 37; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[234] = 151; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[235] = 34; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[236] = 37; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[237] = 71; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[238] = 95; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[239] = 105; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[240] = 235; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[241] = 144; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[242] = 164; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[243] = 83; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[244] = 197; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[245] = 254; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[246] = 183; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[247] = 223; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[248] = 91; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[249] = 19; + test_msg->target = 212; + + EXPECT_EQ(send_message(0xe6, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->addr_len, 250) << "incorrect value for addr_len, expected 250, is " << last_msg_->addr_len; - EXPECT_EQ(last_msg_->addr_start[0], 87) << "incorrect value for addr_start[0], expected 87, is " << last_msg_->addr_start[0]; - EXPECT_EQ(last_msg_->addr_start[1], 52) << "incorrect value for addr_start[1], expected 52, is " << last_msg_->addr_start[1]; - EXPECT_EQ(last_msg_->addr_start[2], 244) << "incorrect value for addr_start[2], expected 244, is " << last_msg_->addr_start[2]; - EXPECT_EQ(last_msg_->data[0], 176) << "incorrect value for data[0], expected 176, is " << last_msg_->data[0]; - EXPECT_EQ(last_msg_->data[1], 222) << "incorrect value for data[1], expected 222, is " << last_msg_->data[1]; - EXPECT_EQ(last_msg_->data[2], 235) << "incorrect value for data[2], expected 235, is " << last_msg_->data[2]; - EXPECT_EQ(last_msg_->data[3], 106) << "incorrect value for data[3], expected 106, is " << last_msg_->data[3]; - EXPECT_EQ(last_msg_->data[4], 144) << "incorrect value for data[4], expected 144, is " << last_msg_->data[4]; - EXPECT_EQ(last_msg_->data[5], 29) << "incorrect value for data[5], expected 29, is " << last_msg_->data[5]; - EXPECT_EQ(last_msg_->data[6], 141) << "incorrect value for data[6], expected 141, is " << last_msg_->data[6]; - EXPECT_EQ(last_msg_->data[7], 255) << "incorrect value for data[7], expected 255, is " << last_msg_->data[7]; - EXPECT_EQ(last_msg_->data[8], 3) << "incorrect value for data[8], expected 3, is " << last_msg_->data[8]; - EXPECT_EQ(last_msg_->data[9], 16) << "incorrect value for data[9], expected 16, is " << last_msg_->data[9]; - EXPECT_EQ(last_msg_->data[10], 192) << "incorrect value for data[10], expected 192, is " << last_msg_->data[10]; - EXPECT_EQ(last_msg_->data[11], 237) << "incorrect value for data[11], expected 237, is " << last_msg_->data[11]; - EXPECT_EQ(last_msg_->data[12], 172) << "incorrect value for data[12], expected 172, is " << last_msg_->data[12]; - EXPECT_EQ(last_msg_->data[13], 254) << "incorrect value for data[13], expected 254, is " << last_msg_->data[13]; - EXPECT_EQ(last_msg_->data[14], 213) << "incorrect value for data[14], expected 213, is " << last_msg_->data[14]; - EXPECT_EQ(last_msg_->data[15], 4) << "incorrect value for data[15], expected 4, is " << last_msg_->data[15]; - EXPECT_EQ(last_msg_->data[16], 220) << "incorrect value for data[16], expected 220, is " << last_msg_->data[16]; - EXPECT_EQ(last_msg_->data[17], 98) << "incorrect value for data[17], expected 98, is " << last_msg_->data[17]; - EXPECT_EQ(last_msg_->data[18], 34) << "incorrect value for data[18], expected 34, is " << last_msg_->data[18]; - EXPECT_EQ(last_msg_->data[19], 222) << "incorrect value for data[19], expected 222, is " << last_msg_->data[19]; - EXPECT_EQ(last_msg_->data[20], 230) << "incorrect value for data[20], expected 230, is " << last_msg_->data[20]; - EXPECT_EQ(last_msg_->data[21], 214) << "incorrect value for data[21], expected 214, is " << last_msg_->data[21]; - EXPECT_EQ(last_msg_->data[22], 6) << "incorrect value for data[22], expected 6, is " << last_msg_->data[22]; - EXPECT_EQ(last_msg_->data[23], 217) << "incorrect value for data[23], expected 217, is " << last_msg_->data[23]; - EXPECT_EQ(last_msg_->data[24], 172) << "incorrect value for data[24], expected 172, is " << last_msg_->data[24]; - EXPECT_EQ(last_msg_->data[25], 122) << "incorrect value for data[25], expected 122, is " << last_msg_->data[25]; - EXPECT_EQ(last_msg_->data[26], 46) << "incorrect value for data[26], expected 46, is " << last_msg_->data[26]; - EXPECT_EQ(last_msg_->data[27], 13) << "incorrect value for data[27], expected 13, is " << last_msg_->data[27]; - EXPECT_EQ(last_msg_->data[28], 38) << "incorrect value for data[28], expected 38, is " << last_msg_->data[28]; - EXPECT_EQ(last_msg_->data[29], 240) << "incorrect value for data[29], expected 240, is " << last_msg_->data[29]; - EXPECT_EQ(last_msg_->data[30], 236) << "incorrect value for data[30], expected 236, is " << last_msg_->data[30]; - EXPECT_EQ(last_msg_->data[31], 60) << "incorrect value for data[31], expected 60, is " << last_msg_->data[31]; - EXPECT_EQ(last_msg_->data[32], 121) << "incorrect value for data[32], expected 121, is " << last_msg_->data[32]; - EXPECT_EQ(last_msg_->data[33], 47) << "incorrect value for data[33], expected 47, is " << last_msg_->data[33]; - EXPECT_EQ(last_msg_->data[34], 252) << "incorrect value for data[34], expected 252, is " << last_msg_->data[34]; - EXPECT_EQ(last_msg_->data[35], 163) << "incorrect value for data[35], expected 163, is " << last_msg_->data[35]; - EXPECT_EQ(last_msg_->data[36], 141) << "incorrect value for data[36], expected 141, is " << last_msg_->data[36]; - EXPECT_EQ(last_msg_->data[37], 222) << "incorrect value for data[37], expected 222, is " << last_msg_->data[37]; - EXPECT_EQ(last_msg_->data[38], 29) << "incorrect value for data[38], expected 29, is " << last_msg_->data[38]; - EXPECT_EQ(last_msg_->data[39], 168) << "incorrect value for data[39], expected 168, is " << last_msg_->data[39]; - EXPECT_EQ(last_msg_->data[40], 214) << "incorrect value for data[40], expected 214, is " << last_msg_->data[40]; - EXPECT_EQ(last_msg_->data[41], 118) << "incorrect value for data[41], expected 118, is " << last_msg_->data[41]; - EXPECT_EQ(last_msg_->data[42], 55) << "incorrect value for data[42], expected 55, is " << last_msg_->data[42]; - EXPECT_EQ(last_msg_->data[43], 201) << "incorrect value for data[43], expected 201, is " << last_msg_->data[43]; - EXPECT_EQ(last_msg_->data[44], 233) << "incorrect value for data[44], expected 233, is " << last_msg_->data[44]; - EXPECT_EQ(last_msg_->data[45], 21) << "incorrect value for data[45], expected 21, is " << last_msg_->data[45]; - EXPECT_EQ(last_msg_->data[46], 214) << "incorrect value for data[46], expected 214, is " << last_msg_->data[46]; - EXPECT_EQ(last_msg_->data[47], 57) << "incorrect value for data[47], expected 57, is " << last_msg_->data[47]; - EXPECT_EQ(last_msg_->data[48], 245) << "incorrect value for data[48], expected 245, is " << last_msg_->data[48]; - EXPECT_EQ(last_msg_->data[49], 246) << "incorrect value for data[49], expected 246, is " << last_msg_->data[49]; - EXPECT_EQ(last_msg_->data[50], 19) << "incorrect value for data[50], expected 19, is " << last_msg_->data[50]; - EXPECT_EQ(last_msg_->data[51], 3) << "incorrect value for data[51], expected 3, is " << last_msg_->data[51]; - EXPECT_EQ(last_msg_->data[52], 121) << "incorrect value for data[52], expected 121, is " << last_msg_->data[52]; - EXPECT_EQ(last_msg_->data[53], 49) << "incorrect value for data[53], expected 49, is " << last_msg_->data[53]; - EXPECT_EQ(last_msg_->data[54], 231) << "incorrect value for data[54], expected 231, is " << last_msg_->data[54]; - EXPECT_EQ(last_msg_->data[55], 37) << "incorrect value for data[55], expected 37, is " << last_msg_->data[55]; - EXPECT_EQ(last_msg_->data[56], 186) << "incorrect value for data[56], expected 186, is " << last_msg_->data[56]; - EXPECT_EQ(last_msg_->data[57], 58) << "incorrect value for data[57], expected 58, is " << last_msg_->data[57]; - EXPECT_EQ(last_msg_->data[58], 238) << "incorrect value for data[58], expected 238, is " << last_msg_->data[58]; - EXPECT_EQ(last_msg_->data[59], 98) << "incorrect value for data[59], expected 98, is " << last_msg_->data[59]; - EXPECT_EQ(last_msg_->data[60], 39) << "incorrect value for data[60], expected 39, is " << last_msg_->data[60]; - EXPECT_EQ(last_msg_->data[61], 70) << "incorrect value for data[61], expected 70, is " << last_msg_->data[61]; - EXPECT_EQ(last_msg_->data[62], 232) << "incorrect value for data[62], expected 232, is " << last_msg_->data[62]; - EXPECT_EQ(last_msg_->data[63], 133) << "incorrect value for data[63], expected 133, is " << last_msg_->data[63]; - EXPECT_EQ(last_msg_->data[64], 25) << "incorrect value for data[64], expected 25, is " << last_msg_->data[64]; - EXPECT_EQ(last_msg_->data[65], 10) << "incorrect value for data[65], expected 10, is " << last_msg_->data[65]; - EXPECT_EQ(last_msg_->data[66], 134) << "incorrect value for data[66], expected 134, is " << last_msg_->data[66]; - EXPECT_EQ(last_msg_->data[67], 129) << "incorrect value for data[67], expected 129, is " << last_msg_->data[67]; - EXPECT_EQ(last_msg_->data[68], 69) << "incorrect value for data[68], expected 69, is " << last_msg_->data[68]; - EXPECT_EQ(last_msg_->data[69], 228) << "incorrect value for data[69], expected 228, is " << last_msg_->data[69]; - EXPECT_EQ(last_msg_->data[70], 134) << "incorrect value for data[70], expected 134, is " << last_msg_->data[70]; - EXPECT_EQ(last_msg_->data[71], 9) << "incorrect value for data[71], expected 9, is " << last_msg_->data[71]; - EXPECT_EQ(last_msg_->data[72], 88) << "incorrect value for data[72], expected 88, is " << last_msg_->data[72]; - EXPECT_EQ(last_msg_->data[73], 183) << "incorrect value for data[73], expected 183, is " << last_msg_->data[73]; - EXPECT_EQ(last_msg_->data[74], 133) << "incorrect value for data[74], expected 133, is " << last_msg_->data[74]; - EXPECT_EQ(last_msg_->data[75], 171) << "incorrect value for data[75], expected 171, is " << last_msg_->data[75]; - EXPECT_EQ(last_msg_->data[76], 255) << "incorrect value for data[76], expected 255, is " << last_msg_->data[76]; - EXPECT_EQ(last_msg_->data[77], 166) << "incorrect value for data[77], expected 166, is " << last_msg_->data[77]; - EXPECT_EQ(last_msg_->data[78], 100) << "incorrect value for data[78], expected 100, is " << last_msg_->data[78]; - EXPECT_EQ(last_msg_->data[79], 152) << "incorrect value for data[79], expected 152, is " << last_msg_->data[79]; - EXPECT_EQ(last_msg_->data[80], 231) << "incorrect value for data[80], expected 231, is " << last_msg_->data[80]; - EXPECT_EQ(last_msg_->data[81], 92) << "incorrect value for data[81], expected 92, is " << last_msg_->data[81]; - EXPECT_EQ(last_msg_->data[82], 9) << "incorrect value for data[82], expected 9, is " << last_msg_->data[82]; - EXPECT_EQ(last_msg_->data[83], 196) << "incorrect value for data[83], expected 196, is " << last_msg_->data[83]; - EXPECT_EQ(last_msg_->data[84], 106) << "incorrect value for data[84], expected 106, is " << last_msg_->data[84]; - EXPECT_EQ(last_msg_->data[85], 246) << "incorrect value for data[85], expected 246, is " << last_msg_->data[85]; - EXPECT_EQ(last_msg_->data[86], 29) << "incorrect value for data[86], expected 29, is " << last_msg_->data[86]; - EXPECT_EQ(last_msg_->data[87], 145) << "incorrect value for data[87], expected 145, is " << last_msg_->data[87]; - EXPECT_EQ(last_msg_->data[88], 156) << "incorrect value for data[88], expected 156, is " << last_msg_->data[88]; - EXPECT_EQ(last_msg_->data[89], 151) << "incorrect value for data[89], expected 151, is " << last_msg_->data[89]; - EXPECT_EQ(last_msg_->data[90], 32) << "incorrect value for data[90], expected 32, is " << last_msg_->data[90]; - EXPECT_EQ(last_msg_->data[91], 67) << "incorrect value for data[91], expected 67, is " << last_msg_->data[91]; - EXPECT_EQ(last_msg_->data[92], 188) << "incorrect value for data[92], expected 188, is " << last_msg_->data[92]; - EXPECT_EQ(last_msg_->data[93], 63) << "incorrect value for data[93], expected 63, is " << last_msg_->data[93]; - EXPECT_EQ(last_msg_->data[94], 233) << "incorrect value for data[94], expected 233, is " << last_msg_->data[94]; - EXPECT_EQ(last_msg_->data[95], 142) << "incorrect value for data[95], expected 142, is " << last_msg_->data[95]; - EXPECT_EQ(last_msg_->data[96], 174) << "incorrect value for data[96], expected 174, is " << last_msg_->data[96]; - EXPECT_EQ(last_msg_->data[97], 139) << "incorrect value for data[97], expected 139, is " << last_msg_->data[97]; - EXPECT_EQ(last_msg_->data[98], 154) << "incorrect value for data[98], expected 154, is " << last_msg_->data[98]; - EXPECT_EQ(last_msg_->data[99], 127) << "incorrect value for data[99], expected 127, is " << last_msg_->data[99]; - EXPECT_EQ(last_msg_->data[100], 35) << "incorrect value for data[100], expected 35, is " << last_msg_->data[100]; - EXPECT_EQ(last_msg_->data[101], 60) << "incorrect value for data[101], expected 60, is " << last_msg_->data[101]; - EXPECT_EQ(last_msg_->data[102], 56) << "incorrect value for data[102], expected 56, is " << last_msg_->data[102]; - EXPECT_EQ(last_msg_->data[103], 187) << "incorrect value for data[103], expected 187, is " << last_msg_->data[103]; - EXPECT_EQ(last_msg_->data[104], 121) << "incorrect value for data[104], expected 121, is " << last_msg_->data[104]; - EXPECT_EQ(last_msg_->data[105], 103) << "incorrect value for data[105], expected 103, is " << last_msg_->data[105]; - EXPECT_EQ(last_msg_->data[106], 135) << "incorrect value for data[106], expected 135, is " << last_msg_->data[106]; - EXPECT_EQ(last_msg_->data[107], 152) << "incorrect value for data[107], expected 152, is " << last_msg_->data[107]; - EXPECT_EQ(last_msg_->data[108], 182) << "incorrect value for data[108], expected 182, is " << last_msg_->data[108]; - EXPECT_EQ(last_msg_->data[109], 88) << "incorrect value for data[109], expected 88, is " << last_msg_->data[109]; - EXPECT_EQ(last_msg_->data[110], 160) << "incorrect value for data[110], expected 160, is " << last_msg_->data[110]; - EXPECT_EQ(last_msg_->data[111], 255) << "incorrect value for data[111], expected 255, is " << last_msg_->data[111]; - EXPECT_EQ(last_msg_->data[112], 227) << "incorrect value for data[112], expected 227, is " << last_msg_->data[112]; - EXPECT_EQ(last_msg_->data[113], 240) << "incorrect value for data[113], expected 240, is " << last_msg_->data[113]; - EXPECT_EQ(last_msg_->data[114], 54) << "incorrect value for data[114], expected 54, is " << last_msg_->data[114]; - EXPECT_EQ(last_msg_->data[115], 100) << "incorrect value for data[115], expected 100, is " << last_msg_->data[115]; - EXPECT_EQ(last_msg_->data[116], 91) << "incorrect value for data[116], expected 91, is " << last_msg_->data[116]; - EXPECT_EQ(last_msg_->data[117], 31) << "incorrect value for data[117], expected 31, is " << last_msg_->data[117]; - EXPECT_EQ(last_msg_->data[118], 141) << "incorrect value for data[118], expected 141, is " << last_msg_->data[118]; - EXPECT_EQ(last_msg_->data[119], 102) << "incorrect value for data[119], expected 102, is " << last_msg_->data[119]; - EXPECT_EQ(last_msg_->data[120], 130) << "incorrect value for data[120], expected 130, is " << last_msg_->data[120]; - EXPECT_EQ(last_msg_->data[121], 254) << "incorrect value for data[121], expected 254, is " << last_msg_->data[121]; - EXPECT_EQ(last_msg_->data[122], 54) << "incorrect value for data[122], expected 54, is " << last_msg_->data[122]; - EXPECT_EQ(last_msg_->data[123], 227) << "incorrect value for data[123], expected 227, is " << last_msg_->data[123]; - EXPECT_EQ(last_msg_->data[124], 229) << "incorrect value for data[124], expected 229, is " << last_msg_->data[124]; - EXPECT_EQ(last_msg_->data[125], 62) << "incorrect value for data[125], expected 62, is " << last_msg_->data[125]; - EXPECT_EQ(last_msg_->data[126], 53) << "incorrect value for data[126], expected 53, is " << last_msg_->data[126]; - EXPECT_EQ(last_msg_->data[127], 225) << "incorrect value for data[127], expected 225, is " << last_msg_->data[127]; - EXPECT_EQ(last_msg_->data[128], 143) << "incorrect value for data[128], expected 143, is " << last_msg_->data[128]; - EXPECT_EQ(last_msg_->data[129], 88) << "incorrect value for data[129], expected 88, is " << last_msg_->data[129]; - EXPECT_EQ(last_msg_->data[130], 139) << "incorrect value for data[130], expected 139, is " << last_msg_->data[130]; - EXPECT_EQ(last_msg_->data[131], 126) << "incorrect value for data[131], expected 126, is " << last_msg_->data[131]; - EXPECT_EQ(last_msg_->data[132], 235) << "incorrect value for data[132], expected 235, is " << last_msg_->data[132]; - EXPECT_EQ(last_msg_->data[133], 235) << "incorrect value for data[133], expected 235, is " << last_msg_->data[133]; - EXPECT_EQ(last_msg_->data[134], 35) << "incorrect value for data[134], expected 35, is " << last_msg_->data[134]; - EXPECT_EQ(last_msg_->data[135], 54) << "incorrect value for data[135], expected 54, is " << last_msg_->data[135]; - EXPECT_EQ(last_msg_->data[136], 134) << "incorrect value for data[136], expected 134, is " << last_msg_->data[136]; - EXPECT_EQ(last_msg_->data[137], 163) << "incorrect value for data[137], expected 163, is " << last_msg_->data[137]; - EXPECT_EQ(last_msg_->data[138], 92) << "incorrect value for data[138], expected 92, is " << last_msg_->data[138]; - EXPECT_EQ(last_msg_->data[139], 57) << "incorrect value for data[139], expected 57, is " << last_msg_->data[139]; - EXPECT_EQ(last_msg_->data[140], 87) << "incorrect value for data[140], expected 87, is " << last_msg_->data[140]; - EXPECT_EQ(last_msg_->data[141], 130) << "incorrect value for data[141], expected 130, is " << last_msg_->data[141]; - EXPECT_EQ(last_msg_->data[142], 178) << "incorrect value for data[142], expected 178, is " << last_msg_->data[142]; - EXPECT_EQ(last_msg_->data[143], 22) << "incorrect value for data[143], expected 22, is " << last_msg_->data[143]; - EXPECT_EQ(last_msg_->data[144], 158) << "incorrect value for data[144], expected 158, is " << last_msg_->data[144]; - EXPECT_EQ(last_msg_->data[145], 18) << "incorrect value for data[145], expected 18, is " << last_msg_->data[145]; - EXPECT_EQ(last_msg_->data[146], 237) << "incorrect value for data[146], expected 237, is " << last_msg_->data[146]; - EXPECT_EQ(last_msg_->data[147], 209) << "incorrect value for data[147], expected 209, is " << last_msg_->data[147]; - EXPECT_EQ(last_msg_->data[148], 187) << "incorrect value for data[148], expected 187, is " << last_msg_->data[148]; - EXPECT_EQ(last_msg_->data[149], 226) << "incorrect value for data[149], expected 226, is " << last_msg_->data[149]; - EXPECT_EQ(last_msg_->data[150], 1) << "incorrect value for data[150], expected 1, is " << last_msg_->data[150]; - EXPECT_EQ(last_msg_->data[151], 46) << "incorrect value for data[151], expected 46, is " << last_msg_->data[151]; - EXPECT_EQ(last_msg_->data[152], 64) << "incorrect value for data[152], expected 64, is " << last_msg_->data[152]; - EXPECT_EQ(last_msg_->data[153], 226) << "incorrect value for data[153], expected 226, is " << last_msg_->data[153]; - EXPECT_EQ(last_msg_->data[154], 235) << "incorrect value for data[154], expected 235, is " << last_msg_->data[154]; - EXPECT_EQ(last_msg_->data[155], 213) << "incorrect value for data[155], expected 213, is " << last_msg_->data[155]; - EXPECT_EQ(last_msg_->data[156], 186) << "incorrect value for data[156], expected 186, is " << last_msg_->data[156]; - EXPECT_EQ(last_msg_->data[157], 159) << "incorrect value for data[157], expected 159, is " << last_msg_->data[157]; - EXPECT_EQ(last_msg_->data[158], 221) << "incorrect value for data[158], expected 221, is " << last_msg_->data[158]; - EXPECT_EQ(last_msg_->data[159], 186) << "incorrect value for data[159], expected 186, is " << last_msg_->data[159]; - EXPECT_EQ(last_msg_->data[160], 25) << "incorrect value for data[160], expected 25, is " << last_msg_->data[160]; - EXPECT_EQ(last_msg_->data[161], 115) << "incorrect value for data[161], expected 115, is " << last_msg_->data[161]; - EXPECT_EQ(last_msg_->data[162], 84) << "incorrect value for data[162], expected 84, is " << last_msg_->data[162]; - EXPECT_EQ(last_msg_->data[163], 131) << "incorrect value for data[163], expected 131, is " << last_msg_->data[163]; - EXPECT_EQ(last_msg_->data[164], 167) << "incorrect value for data[164], expected 167, is " << last_msg_->data[164]; - EXPECT_EQ(last_msg_->data[165], 201) << "incorrect value for data[165], expected 201, is " << last_msg_->data[165]; - EXPECT_EQ(last_msg_->data[166], 104) << "incorrect value for data[166], expected 104, is " << last_msg_->data[166]; - EXPECT_EQ(last_msg_->data[167], 1) << "incorrect value for data[167], expected 1, is " << last_msg_->data[167]; - EXPECT_EQ(last_msg_->data[168], 200) << "incorrect value for data[168], expected 200, is " << last_msg_->data[168]; - EXPECT_EQ(last_msg_->data[169], 13) << "incorrect value for data[169], expected 13, is " << last_msg_->data[169]; - EXPECT_EQ(last_msg_->data[170], 50) << "incorrect value for data[170], expected 50, is " << last_msg_->data[170]; - EXPECT_EQ(last_msg_->data[171], 71) << "incorrect value for data[171], expected 71, is " << last_msg_->data[171]; - EXPECT_EQ(last_msg_->data[172], 73) << "incorrect value for data[172], expected 73, is " << last_msg_->data[172]; - EXPECT_EQ(last_msg_->data[173], 193) << "incorrect value for data[173], expected 193, is " << last_msg_->data[173]; - EXPECT_EQ(last_msg_->data[174], 201) << "incorrect value for data[174], expected 201, is " << last_msg_->data[174]; - EXPECT_EQ(last_msg_->data[175], 250) << "incorrect value for data[175], expected 250, is " << last_msg_->data[175]; - EXPECT_EQ(last_msg_->data[176], 172) << "incorrect value for data[176], expected 172, is " << last_msg_->data[176]; - EXPECT_EQ(last_msg_->data[177], 193) << "incorrect value for data[177], expected 193, is " << last_msg_->data[177]; - EXPECT_EQ(last_msg_->data[178], 13) << "incorrect value for data[178], expected 13, is " << last_msg_->data[178]; - EXPECT_EQ(last_msg_->data[179], 20) << "incorrect value for data[179], expected 20, is " << last_msg_->data[179]; - EXPECT_EQ(last_msg_->data[180], 238) << "incorrect value for data[180], expected 238, is " << last_msg_->data[180]; - EXPECT_EQ(last_msg_->data[181], 130) << "incorrect value for data[181], expected 130, is " << last_msg_->data[181]; - EXPECT_EQ(last_msg_->data[182], 243) << "incorrect value for data[182], expected 243, is " << last_msg_->data[182]; - EXPECT_EQ(last_msg_->data[183], 68) << "incorrect value for data[183], expected 68, is " << last_msg_->data[183]; - EXPECT_EQ(last_msg_->data[184], 4) << "incorrect value for data[184], expected 4, is " << last_msg_->data[184]; - EXPECT_EQ(last_msg_->data[185], 72) << "incorrect value for data[185], expected 72, is " << last_msg_->data[185]; - EXPECT_EQ(last_msg_->data[186], 46) << "incorrect value for data[186], expected 46, is " << last_msg_->data[186]; - EXPECT_EQ(last_msg_->data[187], 194) << "incorrect value for data[187], expected 194, is " << last_msg_->data[187]; - EXPECT_EQ(last_msg_->data[188], 113) << "incorrect value for data[188], expected 113, is " << last_msg_->data[188]; - EXPECT_EQ(last_msg_->data[189], 255) << "incorrect value for data[189], expected 255, is " << last_msg_->data[189]; - EXPECT_EQ(last_msg_->data[190], 238) << "incorrect value for data[190], expected 238, is " << last_msg_->data[190]; - EXPECT_EQ(last_msg_->data[191], 15) << "incorrect value for data[191], expected 15, is " << last_msg_->data[191]; - EXPECT_EQ(last_msg_->data[192], 230) << "incorrect value for data[192], expected 230, is " << last_msg_->data[192]; - EXPECT_EQ(last_msg_->data[193], 64) << "incorrect value for data[193], expected 64, is " << last_msg_->data[193]; - EXPECT_EQ(last_msg_->data[194], 178) << "incorrect value for data[194], expected 178, is " << last_msg_->data[194]; - EXPECT_EQ(last_msg_->data[195], 127) << "incorrect value for data[195], expected 127, is " << last_msg_->data[195]; - EXPECT_EQ(last_msg_->data[196], 217) << "incorrect value for data[196], expected 217, is " << last_msg_->data[196]; - EXPECT_EQ(last_msg_->data[197], 92) << "incorrect value for data[197], expected 92, is " << last_msg_->data[197]; - EXPECT_EQ(last_msg_->data[198], 160) << "incorrect value for data[198], expected 160, is " << last_msg_->data[198]; - EXPECT_EQ(last_msg_->data[199], 201) << "incorrect value for data[199], expected 201, is " << last_msg_->data[199]; - EXPECT_EQ(last_msg_->data[200], 118) << "incorrect value for data[200], expected 118, is " << last_msg_->data[200]; - EXPECT_EQ(last_msg_->data[201], 163) << "incorrect value for data[201], expected 163, is " << last_msg_->data[201]; - EXPECT_EQ(last_msg_->data[202], 144) << "incorrect value for data[202], expected 144, is " << last_msg_->data[202]; - EXPECT_EQ(last_msg_->data[203], 58) << "incorrect value for data[203], expected 58, is " << last_msg_->data[203]; - EXPECT_EQ(last_msg_->data[204], 28) << "incorrect value for data[204], expected 28, is " << last_msg_->data[204]; - EXPECT_EQ(last_msg_->data[205], 174) << "incorrect value for data[205], expected 174, is " << last_msg_->data[205]; - EXPECT_EQ(last_msg_->data[206], 65) << "incorrect value for data[206], expected 65, is " << last_msg_->data[206]; - EXPECT_EQ(last_msg_->data[207], 73) << "incorrect value for data[207], expected 73, is " << last_msg_->data[207]; - EXPECT_EQ(last_msg_->data[208], 45) << "incorrect value for data[208], expected 45, is " << last_msg_->data[208]; - EXPECT_EQ(last_msg_->data[209], 123) << "incorrect value for data[209], expected 123, is " << last_msg_->data[209]; - EXPECT_EQ(last_msg_->data[210], 118) << "incorrect value for data[210], expected 118, is " << last_msg_->data[210]; - EXPECT_EQ(last_msg_->data[211], 83) << "incorrect value for data[211], expected 83, is " << last_msg_->data[211]; - EXPECT_EQ(last_msg_->data[212], 107) << "incorrect value for data[212], expected 107, is " << last_msg_->data[212]; - EXPECT_EQ(last_msg_->data[213], 239) << "incorrect value for data[213], expected 239, is " << last_msg_->data[213]; - EXPECT_EQ(last_msg_->data[214], 168) << "incorrect value for data[214], expected 168, is " << last_msg_->data[214]; - EXPECT_EQ(last_msg_->data[215], 32) << "incorrect value for data[215], expected 32, is " << last_msg_->data[215]; - EXPECT_EQ(last_msg_->data[216], 212) << "incorrect value for data[216], expected 212, is " << last_msg_->data[216]; - EXPECT_EQ(last_msg_->data[217], 191) << "incorrect value for data[217], expected 191, is " << last_msg_->data[217]; - EXPECT_EQ(last_msg_->data[218], 81) << "incorrect value for data[218], expected 81, is " << last_msg_->data[218]; - EXPECT_EQ(last_msg_->data[219], 93) << "incorrect value for data[219], expected 93, is " << last_msg_->data[219]; - EXPECT_EQ(last_msg_->data[220], 186) << "incorrect value for data[220], expected 186, is " << last_msg_->data[220]; - EXPECT_EQ(last_msg_->data[221], 223) << "incorrect value for data[221], expected 223, is " << last_msg_->data[221]; - EXPECT_EQ(last_msg_->data[222], 32) << "incorrect value for data[222], expected 32, is " << last_msg_->data[222]; - EXPECT_EQ(last_msg_->data[223], 19) << "incorrect value for data[223], expected 19, is " << last_msg_->data[223]; - EXPECT_EQ(last_msg_->data[224], 58) << "incorrect value for data[224], expected 58, is " << last_msg_->data[224]; - EXPECT_EQ(last_msg_->data[225], 137) << "incorrect value for data[225], expected 137, is " << last_msg_->data[225]; - EXPECT_EQ(last_msg_->data[226], 72) << "incorrect value for data[226], expected 72, is " << last_msg_->data[226]; - EXPECT_EQ(last_msg_->data[227], 217) << "incorrect value for data[227], expected 217, is " << last_msg_->data[227]; - EXPECT_EQ(last_msg_->data[228], 151) << "incorrect value for data[228], expected 151, is " << last_msg_->data[228]; - EXPECT_EQ(last_msg_->data[229], 251) << "incorrect value for data[229], expected 251, is " << last_msg_->data[229]; - EXPECT_EQ(last_msg_->data[230], 83) << "incorrect value for data[230], expected 83, is " << last_msg_->data[230]; - EXPECT_EQ(last_msg_->data[231], 20) << "incorrect value for data[231], expected 20, is " << last_msg_->data[231]; - EXPECT_EQ(last_msg_->data[232], 113) << "incorrect value for data[232], expected 113, is " << last_msg_->data[232]; - EXPECT_EQ(last_msg_->data[233], 37) << "incorrect value for data[233], expected 37, is " << last_msg_->data[233]; - EXPECT_EQ(last_msg_->data[234], 151) << "incorrect value for data[234], expected 151, is " << last_msg_->data[234]; - EXPECT_EQ(last_msg_->data[235], 34) << "incorrect value for data[235], expected 34, is " << last_msg_->data[235]; - EXPECT_EQ(last_msg_->data[236], 37) << "incorrect value for data[236], expected 37, is " << last_msg_->data[236]; - EXPECT_EQ(last_msg_->data[237], 71) << "incorrect value for data[237], expected 71, is " << last_msg_->data[237]; - EXPECT_EQ(last_msg_->data[238], 95) << "incorrect value for data[238], expected 95, is " << last_msg_->data[238]; - EXPECT_EQ(last_msg_->data[239], 105) << "incorrect value for data[239], expected 105, is " << last_msg_->data[239]; - EXPECT_EQ(last_msg_->data[240], 235) << "incorrect value for data[240], expected 235, is " << last_msg_->data[240]; - EXPECT_EQ(last_msg_->data[241], 144) << "incorrect value for data[241], expected 144, is " << last_msg_->data[241]; - EXPECT_EQ(last_msg_->data[242], 164) << "incorrect value for data[242], expected 164, is " << last_msg_->data[242]; - EXPECT_EQ(last_msg_->data[243], 83) << "incorrect value for data[243], expected 83, is " << last_msg_->data[243]; - EXPECT_EQ(last_msg_->data[244], 197) << "incorrect value for data[244], expected 197, is " << last_msg_->data[244]; - EXPECT_EQ(last_msg_->data[245], 254) << "incorrect value for data[245], expected 254, is " << last_msg_->data[245]; - EXPECT_EQ(last_msg_->data[246], 183) << "incorrect value for data[246], expected 183, is " << last_msg_->data[246]; - EXPECT_EQ(last_msg_->data[247], 223) << "incorrect value for data[247], expected 223, is " << last_msg_->data[247]; - EXPECT_EQ(last_msg_->data[248], 91) << "incorrect value for data[248], expected 91, is " << last_msg_->data[248]; - EXPECT_EQ(last_msg_->data[249], 19) << "incorrect value for data[249], expected 19, is " << last_msg_->data[249]; - EXPECT_EQ(last_msg_->target, 212) << "incorrect value for target, expected 212, is " << last_msg_->target; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->addr_len, 250) + << "incorrect value for addr_len, expected 250, is " + << last_msg_->addr_len; + EXPECT_EQ(last_msg_->addr_start[0], 87) + << "incorrect value for addr_start[0], expected 87, is " + << last_msg_->addr_start[0]; + EXPECT_EQ(last_msg_->addr_start[1], 52) + << "incorrect value for addr_start[1], expected 52, is " + << last_msg_->addr_start[1]; + EXPECT_EQ(last_msg_->addr_start[2], 244) + << "incorrect value for addr_start[2], expected 244, is " + << last_msg_->addr_start[2]; + EXPECT_EQ(last_msg_->data[0], 176) + << "incorrect value for data[0], expected 176, is " << last_msg_->data[0]; + EXPECT_EQ(last_msg_->data[1], 222) + << "incorrect value for data[1], expected 222, is " << last_msg_->data[1]; + EXPECT_EQ(last_msg_->data[2], 235) + << "incorrect value for data[2], expected 235, is " << last_msg_->data[2]; + EXPECT_EQ(last_msg_->data[3], 106) + << "incorrect value for data[3], expected 106, is " << last_msg_->data[3]; + EXPECT_EQ(last_msg_->data[4], 144) + << "incorrect value for data[4], expected 144, is " << last_msg_->data[4]; + EXPECT_EQ(last_msg_->data[5], 29) + << "incorrect value for data[5], expected 29, is " << last_msg_->data[5]; + EXPECT_EQ(last_msg_->data[6], 141) + << "incorrect value for data[6], expected 141, is " << last_msg_->data[6]; + EXPECT_EQ(last_msg_->data[7], 255) + << "incorrect value for data[7], expected 255, is " << last_msg_->data[7]; + EXPECT_EQ(last_msg_->data[8], 3) + << "incorrect value for data[8], expected 3, is " << last_msg_->data[8]; + EXPECT_EQ(last_msg_->data[9], 16) + << "incorrect value for data[9], expected 16, is " << last_msg_->data[9]; + EXPECT_EQ(last_msg_->data[10], 192) + << "incorrect value for data[10], expected 192, is " + << last_msg_->data[10]; + EXPECT_EQ(last_msg_->data[11], 237) + << "incorrect value for data[11], expected 237, is " + << last_msg_->data[11]; + EXPECT_EQ(last_msg_->data[12], 172) + << "incorrect value for data[12], expected 172, is " + << last_msg_->data[12]; + EXPECT_EQ(last_msg_->data[13], 254) + << "incorrect value for data[13], expected 254, is " + << last_msg_->data[13]; + EXPECT_EQ(last_msg_->data[14], 213) + << "incorrect value for data[14], expected 213, is " + << last_msg_->data[14]; + EXPECT_EQ(last_msg_->data[15], 4) + << "incorrect value for data[15], expected 4, is " << last_msg_->data[15]; + EXPECT_EQ(last_msg_->data[16], 220) + << "incorrect value for data[16], expected 220, is " + << last_msg_->data[16]; + EXPECT_EQ(last_msg_->data[17], 98) + << "incorrect value for data[17], expected 98, is " + << last_msg_->data[17]; + EXPECT_EQ(last_msg_->data[18], 34) + << "incorrect value for data[18], expected 34, is " + << last_msg_->data[18]; + EXPECT_EQ(last_msg_->data[19], 222) + << "incorrect value for data[19], expected 222, is " + << last_msg_->data[19]; + EXPECT_EQ(last_msg_->data[20], 230) + << "incorrect value for data[20], expected 230, is " + << last_msg_->data[20]; + EXPECT_EQ(last_msg_->data[21], 214) + << "incorrect value for data[21], expected 214, is " + << last_msg_->data[21]; + EXPECT_EQ(last_msg_->data[22], 6) + << "incorrect value for data[22], expected 6, is " << last_msg_->data[22]; + EXPECT_EQ(last_msg_->data[23], 217) + << "incorrect value for data[23], expected 217, is " + << last_msg_->data[23]; + EXPECT_EQ(last_msg_->data[24], 172) + << "incorrect value for data[24], expected 172, is " + << last_msg_->data[24]; + EXPECT_EQ(last_msg_->data[25], 122) + << "incorrect value for data[25], expected 122, is " + << last_msg_->data[25]; + EXPECT_EQ(last_msg_->data[26], 46) + << "incorrect value for data[26], expected 46, is " + << last_msg_->data[26]; + EXPECT_EQ(last_msg_->data[27], 13) + << "incorrect value for data[27], expected 13, is " + << last_msg_->data[27]; + EXPECT_EQ(last_msg_->data[28], 38) + << "incorrect value for data[28], expected 38, is " + << last_msg_->data[28]; + EXPECT_EQ(last_msg_->data[29], 240) + << "incorrect value for data[29], expected 240, is " + << last_msg_->data[29]; + EXPECT_EQ(last_msg_->data[30], 236) + << "incorrect value for data[30], expected 236, is " + << last_msg_->data[30]; + EXPECT_EQ(last_msg_->data[31], 60) + << "incorrect value for data[31], expected 60, is " + << last_msg_->data[31]; + EXPECT_EQ(last_msg_->data[32], 121) + << "incorrect value for data[32], expected 121, is " + << last_msg_->data[32]; + EXPECT_EQ(last_msg_->data[33], 47) + << "incorrect value for data[33], expected 47, is " + << last_msg_->data[33]; + EXPECT_EQ(last_msg_->data[34], 252) + << "incorrect value for data[34], expected 252, is " + << last_msg_->data[34]; + EXPECT_EQ(last_msg_->data[35], 163) + << "incorrect value for data[35], expected 163, is " + << last_msg_->data[35]; + EXPECT_EQ(last_msg_->data[36], 141) + << "incorrect value for data[36], expected 141, is " + << last_msg_->data[36]; + EXPECT_EQ(last_msg_->data[37], 222) + << "incorrect value for data[37], expected 222, is " + << last_msg_->data[37]; + EXPECT_EQ(last_msg_->data[38], 29) + << "incorrect value for data[38], expected 29, is " + << last_msg_->data[38]; + EXPECT_EQ(last_msg_->data[39], 168) + << "incorrect value for data[39], expected 168, is " + << last_msg_->data[39]; + EXPECT_EQ(last_msg_->data[40], 214) + << "incorrect value for data[40], expected 214, is " + << last_msg_->data[40]; + EXPECT_EQ(last_msg_->data[41], 118) + << "incorrect value for data[41], expected 118, is " + << last_msg_->data[41]; + EXPECT_EQ(last_msg_->data[42], 55) + << "incorrect value for data[42], expected 55, is " + << last_msg_->data[42]; + EXPECT_EQ(last_msg_->data[43], 201) + << "incorrect value for data[43], expected 201, is " + << last_msg_->data[43]; + EXPECT_EQ(last_msg_->data[44], 233) + << "incorrect value for data[44], expected 233, is " + << last_msg_->data[44]; + EXPECT_EQ(last_msg_->data[45], 21) + << "incorrect value for data[45], expected 21, is " + << last_msg_->data[45]; + EXPECT_EQ(last_msg_->data[46], 214) + << "incorrect value for data[46], expected 214, is " + << last_msg_->data[46]; + EXPECT_EQ(last_msg_->data[47], 57) + << "incorrect value for data[47], expected 57, is " + << last_msg_->data[47]; + EXPECT_EQ(last_msg_->data[48], 245) + << "incorrect value for data[48], expected 245, is " + << last_msg_->data[48]; + EXPECT_EQ(last_msg_->data[49], 246) + << "incorrect value for data[49], expected 246, is " + << last_msg_->data[49]; + EXPECT_EQ(last_msg_->data[50], 19) + << "incorrect value for data[50], expected 19, is " + << last_msg_->data[50]; + EXPECT_EQ(last_msg_->data[51], 3) + << "incorrect value for data[51], expected 3, is " << last_msg_->data[51]; + EXPECT_EQ(last_msg_->data[52], 121) + << "incorrect value for data[52], expected 121, is " + << last_msg_->data[52]; + EXPECT_EQ(last_msg_->data[53], 49) + << "incorrect value for data[53], expected 49, is " + << last_msg_->data[53]; + EXPECT_EQ(last_msg_->data[54], 231) + << "incorrect value for data[54], expected 231, is " + << last_msg_->data[54]; + EXPECT_EQ(last_msg_->data[55], 37) + << "incorrect value for data[55], expected 37, is " + << last_msg_->data[55]; + EXPECT_EQ(last_msg_->data[56], 186) + << "incorrect value for data[56], expected 186, is " + << last_msg_->data[56]; + EXPECT_EQ(last_msg_->data[57], 58) + << "incorrect value for data[57], expected 58, is " + << last_msg_->data[57]; + EXPECT_EQ(last_msg_->data[58], 238) + << "incorrect value for data[58], expected 238, is " + << last_msg_->data[58]; + EXPECT_EQ(last_msg_->data[59], 98) + << "incorrect value for data[59], expected 98, is " + << last_msg_->data[59]; + EXPECT_EQ(last_msg_->data[60], 39) + << "incorrect value for data[60], expected 39, is " + << last_msg_->data[60]; + EXPECT_EQ(last_msg_->data[61], 70) + << "incorrect value for data[61], expected 70, is " + << last_msg_->data[61]; + EXPECT_EQ(last_msg_->data[62], 232) + << "incorrect value for data[62], expected 232, is " + << last_msg_->data[62]; + EXPECT_EQ(last_msg_->data[63], 133) + << "incorrect value for data[63], expected 133, is " + << last_msg_->data[63]; + EXPECT_EQ(last_msg_->data[64], 25) + << "incorrect value for data[64], expected 25, is " + << last_msg_->data[64]; + EXPECT_EQ(last_msg_->data[65], 10) + << "incorrect value for data[65], expected 10, is " + << last_msg_->data[65]; + EXPECT_EQ(last_msg_->data[66], 134) + << "incorrect value for data[66], expected 134, is " + << last_msg_->data[66]; + EXPECT_EQ(last_msg_->data[67], 129) + << "incorrect value for data[67], expected 129, is " + << last_msg_->data[67]; + EXPECT_EQ(last_msg_->data[68], 69) + << "incorrect value for data[68], expected 69, is " + << last_msg_->data[68]; + EXPECT_EQ(last_msg_->data[69], 228) + << "incorrect value for data[69], expected 228, is " + << last_msg_->data[69]; + EXPECT_EQ(last_msg_->data[70], 134) + << "incorrect value for data[70], expected 134, is " + << last_msg_->data[70]; + EXPECT_EQ(last_msg_->data[71], 9) + << "incorrect value for data[71], expected 9, is " << last_msg_->data[71]; + EXPECT_EQ(last_msg_->data[72], 88) + << "incorrect value for data[72], expected 88, is " + << last_msg_->data[72]; + EXPECT_EQ(last_msg_->data[73], 183) + << "incorrect value for data[73], expected 183, is " + << last_msg_->data[73]; + EXPECT_EQ(last_msg_->data[74], 133) + << "incorrect value for data[74], expected 133, is " + << last_msg_->data[74]; + EXPECT_EQ(last_msg_->data[75], 171) + << "incorrect value for data[75], expected 171, is " + << last_msg_->data[75]; + EXPECT_EQ(last_msg_->data[76], 255) + << "incorrect value for data[76], expected 255, is " + << last_msg_->data[76]; + EXPECT_EQ(last_msg_->data[77], 166) + << "incorrect value for data[77], expected 166, is " + << last_msg_->data[77]; + EXPECT_EQ(last_msg_->data[78], 100) + << "incorrect value for data[78], expected 100, is " + << last_msg_->data[78]; + EXPECT_EQ(last_msg_->data[79], 152) + << "incorrect value for data[79], expected 152, is " + << last_msg_->data[79]; + EXPECT_EQ(last_msg_->data[80], 231) + << "incorrect value for data[80], expected 231, is " + << last_msg_->data[80]; + EXPECT_EQ(last_msg_->data[81], 92) + << "incorrect value for data[81], expected 92, is " + << last_msg_->data[81]; + EXPECT_EQ(last_msg_->data[82], 9) + << "incorrect value for data[82], expected 9, is " << last_msg_->data[82]; + EXPECT_EQ(last_msg_->data[83], 196) + << "incorrect value for data[83], expected 196, is " + << last_msg_->data[83]; + EXPECT_EQ(last_msg_->data[84], 106) + << "incorrect value for data[84], expected 106, is " + << last_msg_->data[84]; + EXPECT_EQ(last_msg_->data[85], 246) + << "incorrect value for data[85], expected 246, is " + << last_msg_->data[85]; + EXPECT_EQ(last_msg_->data[86], 29) + << "incorrect value for data[86], expected 29, is " + << last_msg_->data[86]; + EXPECT_EQ(last_msg_->data[87], 145) + << "incorrect value for data[87], expected 145, is " + << last_msg_->data[87]; + EXPECT_EQ(last_msg_->data[88], 156) + << "incorrect value for data[88], expected 156, is " + << last_msg_->data[88]; + EXPECT_EQ(last_msg_->data[89], 151) + << "incorrect value for data[89], expected 151, is " + << last_msg_->data[89]; + EXPECT_EQ(last_msg_->data[90], 32) + << "incorrect value for data[90], expected 32, is " + << last_msg_->data[90]; + EXPECT_EQ(last_msg_->data[91], 67) + << "incorrect value for data[91], expected 67, is " + << last_msg_->data[91]; + EXPECT_EQ(last_msg_->data[92], 188) + << "incorrect value for data[92], expected 188, is " + << last_msg_->data[92]; + EXPECT_EQ(last_msg_->data[93], 63) + << "incorrect value for data[93], expected 63, is " + << last_msg_->data[93]; + EXPECT_EQ(last_msg_->data[94], 233) + << "incorrect value for data[94], expected 233, is " + << last_msg_->data[94]; + EXPECT_EQ(last_msg_->data[95], 142) + << "incorrect value for data[95], expected 142, is " + << last_msg_->data[95]; + EXPECT_EQ(last_msg_->data[96], 174) + << "incorrect value for data[96], expected 174, is " + << last_msg_->data[96]; + EXPECT_EQ(last_msg_->data[97], 139) + << "incorrect value for data[97], expected 139, is " + << last_msg_->data[97]; + EXPECT_EQ(last_msg_->data[98], 154) + << "incorrect value for data[98], expected 154, is " + << last_msg_->data[98]; + EXPECT_EQ(last_msg_->data[99], 127) + << "incorrect value for data[99], expected 127, is " + << last_msg_->data[99]; + EXPECT_EQ(last_msg_->data[100], 35) + << "incorrect value for data[100], expected 35, is " + << last_msg_->data[100]; + EXPECT_EQ(last_msg_->data[101], 60) + << "incorrect value for data[101], expected 60, is " + << last_msg_->data[101]; + EXPECT_EQ(last_msg_->data[102], 56) + << "incorrect value for data[102], expected 56, is " + << last_msg_->data[102]; + EXPECT_EQ(last_msg_->data[103], 187) + << "incorrect value for data[103], expected 187, is " + << last_msg_->data[103]; + EXPECT_EQ(last_msg_->data[104], 121) + << "incorrect value for data[104], expected 121, is " + << last_msg_->data[104]; + EXPECT_EQ(last_msg_->data[105], 103) + << "incorrect value for data[105], expected 103, is " + << last_msg_->data[105]; + EXPECT_EQ(last_msg_->data[106], 135) + << "incorrect value for data[106], expected 135, is " + << last_msg_->data[106]; + EXPECT_EQ(last_msg_->data[107], 152) + << "incorrect value for data[107], expected 152, is " + << last_msg_->data[107]; + EXPECT_EQ(last_msg_->data[108], 182) + << "incorrect value for data[108], expected 182, is " + << last_msg_->data[108]; + EXPECT_EQ(last_msg_->data[109], 88) + << "incorrect value for data[109], expected 88, is " + << last_msg_->data[109]; + EXPECT_EQ(last_msg_->data[110], 160) + << "incorrect value for data[110], expected 160, is " + << last_msg_->data[110]; + EXPECT_EQ(last_msg_->data[111], 255) + << "incorrect value for data[111], expected 255, is " + << last_msg_->data[111]; + EXPECT_EQ(last_msg_->data[112], 227) + << "incorrect value for data[112], expected 227, is " + << last_msg_->data[112]; + EXPECT_EQ(last_msg_->data[113], 240) + << "incorrect value for data[113], expected 240, is " + << last_msg_->data[113]; + EXPECT_EQ(last_msg_->data[114], 54) + << "incorrect value for data[114], expected 54, is " + << last_msg_->data[114]; + EXPECT_EQ(last_msg_->data[115], 100) + << "incorrect value for data[115], expected 100, is " + << last_msg_->data[115]; + EXPECT_EQ(last_msg_->data[116], 91) + << "incorrect value for data[116], expected 91, is " + << last_msg_->data[116]; + EXPECT_EQ(last_msg_->data[117], 31) + << "incorrect value for data[117], expected 31, is " + << last_msg_->data[117]; + EXPECT_EQ(last_msg_->data[118], 141) + << "incorrect value for data[118], expected 141, is " + << last_msg_->data[118]; + EXPECT_EQ(last_msg_->data[119], 102) + << "incorrect value for data[119], expected 102, is " + << last_msg_->data[119]; + EXPECT_EQ(last_msg_->data[120], 130) + << "incorrect value for data[120], expected 130, is " + << last_msg_->data[120]; + EXPECT_EQ(last_msg_->data[121], 254) + << "incorrect value for data[121], expected 254, is " + << last_msg_->data[121]; + EXPECT_EQ(last_msg_->data[122], 54) + << "incorrect value for data[122], expected 54, is " + << last_msg_->data[122]; + EXPECT_EQ(last_msg_->data[123], 227) + << "incorrect value for data[123], expected 227, is " + << last_msg_->data[123]; + EXPECT_EQ(last_msg_->data[124], 229) + << "incorrect value for data[124], expected 229, is " + << last_msg_->data[124]; + EXPECT_EQ(last_msg_->data[125], 62) + << "incorrect value for data[125], expected 62, is " + << last_msg_->data[125]; + EXPECT_EQ(last_msg_->data[126], 53) + << "incorrect value for data[126], expected 53, is " + << last_msg_->data[126]; + EXPECT_EQ(last_msg_->data[127], 225) + << "incorrect value for data[127], expected 225, is " + << last_msg_->data[127]; + EXPECT_EQ(last_msg_->data[128], 143) + << "incorrect value for data[128], expected 143, is " + << last_msg_->data[128]; + EXPECT_EQ(last_msg_->data[129], 88) + << "incorrect value for data[129], expected 88, is " + << last_msg_->data[129]; + EXPECT_EQ(last_msg_->data[130], 139) + << "incorrect value for data[130], expected 139, is " + << last_msg_->data[130]; + EXPECT_EQ(last_msg_->data[131], 126) + << "incorrect value for data[131], expected 126, is " + << last_msg_->data[131]; + EXPECT_EQ(last_msg_->data[132], 235) + << "incorrect value for data[132], expected 235, is " + << last_msg_->data[132]; + EXPECT_EQ(last_msg_->data[133], 235) + << "incorrect value for data[133], expected 235, is " + << last_msg_->data[133]; + EXPECT_EQ(last_msg_->data[134], 35) + << "incorrect value for data[134], expected 35, is " + << last_msg_->data[134]; + EXPECT_EQ(last_msg_->data[135], 54) + << "incorrect value for data[135], expected 54, is " + << last_msg_->data[135]; + EXPECT_EQ(last_msg_->data[136], 134) + << "incorrect value for data[136], expected 134, is " + << last_msg_->data[136]; + EXPECT_EQ(last_msg_->data[137], 163) + << "incorrect value for data[137], expected 163, is " + << last_msg_->data[137]; + EXPECT_EQ(last_msg_->data[138], 92) + << "incorrect value for data[138], expected 92, is " + << last_msg_->data[138]; + EXPECT_EQ(last_msg_->data[139], 57) + << "incorrect value for data[139], expected 57, is " + << last_msg_->data[139]; + EXPECT_EQ(last_msg_->data[140], 87) + << "incorrect value for data[140], expected 87, is " + << last_msg_->data[140]; + EXPECT_EQ(last_msg_->data[141], 130) + << "incorrect value for data[141], expected 130, is " + << last_msg_->data[141]; + EXPECT_EQ(last_msg_->data[142], 178) + << "incorrect value for data[142], expected 178, is " + << last_msg_->data[142]; + EXPECT_EQ(last_msg_->data[143], 22) + << "incorrect value for data[143], expected 22, is " + << last_msg_->data[143]; + EXPECT_EQ(last_msg_->data[144], 158) + << "incorrect value for data[144], expected 158, is " + << last_msg_->data[144]; + EXPECT_EQ(last_msg_->data[145], 18) + << "incorrect value for data[145], expected 18, is " + << last_msg_->data[145]; + EXPECT_EQ(last_msg_->data[146], 237) + << "incorrect value for data[146], expected 237, is " + << last_msg_->data[146]; + EXPECT_EQ(last_msg_->data[147], 209) + << "incorrect value for data[147], expected 209, is " + << last_msg_->data[147]; + EXPECT_EQ(last_msg_->data[148], 187) + << "incorrect value for data[148], expected 187, is " + << last_msg_->data[148]; + EXPECT_EQ(last_msg_->data[149], 226) + << "incorrect value for data[149], expected 226, is " + << last_msg_->data[149]; + EXPECT_EQ(last_msg_->data[150], 1) + << "incorrect value for data[150], expected 1, is " + << last_msg_->data[150]; + EXPECT_EQ(last_msg_->data[151], 46) + << "incorrect value for data[151], expected 46, is " + << last_msg_->data[151]; + EXPECT_EQ(last_msg_->data[152], 64) + << "incorrect value for data[152], expected 64, is " + << last_msg_->data[152]; + EXPECT_EQ(last_msg_->data[153], 226) + << "incorrect value for data[153], expected 226, is " + << last_msg_->data[153]; + EXPECT_EQ(last_msg_->data[154], 235) + << "incorrect value for data[154], expected 235, is " + << last_msg_->data[154]; + EXPECT_EQ(last_msg_->data[155], 213) + << "incorrect value for data[155], expected 213, is " + << last_msg_->data[155]; + EXPECT_EQ(last_msg_->data[156], 186) + << "incorrect value for data[156], expected 186, is " + << last_msg_->data[156]; + EXPECT_EQ(last_msg_->data[157], 159) + << "incorrect value for data[157], expected 159, is " + << last_msg_->data[157]; + EXPECT_EQ(last_msg_->data[158], 221) + << "incorrect value for data[158], expected 221, is " + << last_msg_->data[158]; + EXPECT_EQ(last_msg_->data[159], 186) + << "incorrect value for data[159], expected 186, is " + << last_msg_->data[159]; + EXPECT_EQ(last_msg_->data[160], 25) + << "incorrect value for data[160], expected 25, is " + << last_msg_->data[160]; + EXPECT_EQ(last_msg_->data[161], 115) + << "incorrect value for data[161], expected 115, is " + << last_msg_->data[161]; + EXPECT_EQ(last_msg_->data[162], 84) + << "incorrect value for data[162], expected 84, is " + << last_msg_->data[162]; + EXPECT_EQ(last_msg_->data[163], 131) + << "incorrect value for data[163], expected 131, is " + << last_msg_->data[163]; + EXPECT_EQ(last_msg_->data[164], 167) + << "incorrect value for data[164], expected 167, is " + << last_msg_->data[164]; + EXPECT_EQ(last_msg_->data[165], 201) + << "incorrect value for data[165], expected 201, is " + << last_msg_->data[165]; + EXPECT_EQ(last_msg_->data[166], 104) + << "incorrect value for data[166], expected 104, is " + << last_msg_->data[166]; + EXPECT_EQ(last_msg_->data[167], 1) + << "incorrect value for data[167], expected 1, is " + << last_msg_->data[167]; + EXPECT_EQ(last_msg_->data[168], 200) + << "incorrect value for data[168], expected 200, is " + << last_msg_->data[168]; + EXPECT_EQ(last_msg_->data[169], 13) + << "incorrect value for data[169], expected 13, is " + << last_msg_->data[169]; + EXPECT_EQ(last_msg_->data[170], 50) + << "incorrect value for data[170], expected 50, is " + << last_msg_->data[170]; + EXPECT_EQ(last_msg_->data[171], 71) + << "incorrect value for data[171], expected 71, is " + << last_msg_->data[171]; + EXPECT_EQ(last_msg_->data[172], 73) + << "incorrect value for data[172], expected 73, is " + << last_msg_->data[172]; + EXPECT_EQ(last_msg_->data[173], 193) + << "incorrect value for data[173], expected 193, is " + << last_msg_->data[173]; + EXPECT_EQ(last_msg_->data[174], 201) + << "incorrect value for data[174], expected 201, is " + << last_msg_->data[174]; + EXPECT_EQ(last_msg_->data[175], 250) + << "incorrect value for data[175], expected 250, is " + << last_msg_->data[175]; + EXPECT_EQ(last_msg_->data[176], 172) + << "incorrect value for data[176], expected 172, is " + << last_msg_->data[176]; + EXPECT_EQ(last_msg_->data[177], 193) + << "incorrect value for data[177], expected 193, is " + << last_msg_->data[177]; + EXPECT_EQ(last_msg_->data[178], 13) + << "incorrect value for data[178], expected 13, is " + << last_msg_->data[178]; + EXPECT_EQ(last_msg_->data[179], 20) + << "incorrect value for data[179], expected 20, is " + << last_msg_->data[179]; + EXPECT_EQ(last_msg_->data[180], 238) + << "incorrect value for data[180], expected 238, is " + << last_msg_->data[180]; + EXPECT_EQ(last_msg_->data[181], 130) + << "incorrect value for data[181], expected 130, is " + << last_msg_->data[181]; + EXPECT_EQ(last_msg_->data[182], 243) + << "incorrect value for data[182], expected 243, is " + << last_msg_->data[182]; + EXPECT_EQ(last_msg_->data[183], 68) + << "incorrect value for data[183], expected 68, is " + << last_msg_->data[183]; + EXPECT_EQ(last_msg_->data[184], 4) + << "incorrect value for data[184], expected 4, is " + << last_msg_->data[184]; + EXPECT_EQ(last_msg_->data[185], 72) + << "incorrect value for data[185], expected 72, is " + << last_msg_->data[185]; + EXPECT_EQ(last_msg_->data[186], 46) + << "incorrect value for data[186], expected 46, is " + << last_msg_->data[186]; + EXPECT_EQ(last_msg_->data[187], 194) + << "incorrect value for data[187], expected 194, is " + << last_msg_->data[187]; + EXPECT_EQ(last_msg_->data[188], 113) + << "incorrect value for data[188], expected 113, is " + << last_msg_->data[188]; + EXPECT_EQ(last_msg_->data[189], 255) + << "incorrect value for data[189], expected 255, is " + << last_msg_->data[189]; + EXPECT_EQ(last_msg_->data[190], 238) + << "incorrect value for data[190], expected 238, is " + << last_msg_->data[190]; + EXPECT_EQ(last_msg_->data[191], 15) + << "incorrect value for data[191], expected 15, is " + << last_msg_->data[191]; + EXPECT_EQ(last_msg_->data[192], 230) + << "incorrect value for data[192], expected 230, is " + << last_msg_->data[192]; + EXPECT_EQ(last_msg_->data[193], 64) + << "incorrect value for data[193], expected 64, is " + << last_msg_->data[193]; + EXPECT_EQ(last_msg_->data[194], 178) + << "incorrect value for data[194], expected 178, is " + << last_msg_->data[194]; + EXPECT_EQ(last_msg_->data[195], 127) + << "incorrect value for data[195], expected 127, is " + << last_msg_->data[195]; + EXPECT_EQ(last_msg_->data[196], 217) + << "incorrect value for data[196], expected 217, is " + << last_msg_->data[196]; + EXPECT_EQ(last_msg_->data[197], 92) + << "incorrect value for data[197], expected 92, is " + << last_msg_->data[197]; + EXPECT_EQ(last_msg_->data[198], 160) + << "incorrect value for data[198], expected 160, is " + << last_msg_->data[198]; + EXPECT_EQ(last_msg_->data[199], 201) + << "incorrect value for data[199], expected 201, is " + << last_msg_->data[199]; + EXPECT_EQ(last_msg_->data[200], 118) + << "incorrect value for data[200], expected 118, is " + << last_msg_->data[200]; + EXPECT_EQ(last_msg_->data[201], 163) + << "incorrect value for data[201], expected 163, is " + << last_msg_->data[201]; + EXPECT_EQ(last_msg_->data[202], 144) + << "incorrect value for data[202], expected 144, is " + << last_msg_->data[202]; + EXPECT_EQ(last_msg_->data[203], 58) + << "incorrect value for data[203], expected 58, is " + << last_msg_->data[203]; + EXPECT_EQ(last_msg_->data[204], 28) + << "incorrect value for data[204], expected 28, is " + << last_msg_->data[204]; + EXPECT_EQ(last_msg_->data[205], 174) + << "incorrect value for data[205], expected 174, is " + << last_msg_->data[205]; + EXPECT_EQ(last_msg_->data[206], 65) + << "incorrect value for data[206], expected 65, is " + << last_msg_->data[206]; + EXPECT_EQ(last_msg_->data[207], 73) + << "incorrect value for data[207], expected 73, is " + << last_msg_->data[207]; + EXPECT_EQ(last_msg_->data[208], 45) + << "incorrect value for data[208], expected 45, is " + << last_msg_->data[208]; + EXPECT_EQ(last_msg_->data[209], 123) + << "incorrect value for data[209], expected 123, is " + << last_msg_->data[209]; + EXPECT_EQ(last_msg_->data[210], 118) + << "incorrect value for data[210], expected 118, is " + << last_msg_->data[210]; + EXPECT_EQ(last_msg_->data[211], 83) + << "incorrect value for data[211], expected 83, is " + << last_msg_->data[211]; + EXPECT_EQ(last_msg_->data[212], 107) + << "incorrect value for data[212], expected 107, is " + << last_msg_->data[212]; + EXPECT_EQ(last_msg_->data[213], 239) + << "incorrect value for data[213], expected 239, is " + << last_msg_->data[213]; + EXPECT_EQ(last_msg_->data[214], 168) + << "incorrect value for data[214], expected 168, is " + << last_msg_->data[214]; + EXPECT_EQ(last_msg_->data[215], 32) + << "incorrect value for data[215], expected 32, is " + << last_msg_->data[215]; + EXPECT_EQ(last_msg_->data[216], 212) + << "incorrect value for data[216], expected 212, is " + << last_msg_->data[216]; + EXPECT_EQ(last_msg_->data[217], 191) + << "incorrect value for data[217], expected 191, is " + << last_msg_->data[217]; + EXPECT_EQ(last_msg_->data[218], 81) + << "incorrect value for data[218], expected 81, is " + << last_msg_->data[218]; + EXPECT_EQ(last_msg_->data[219], 93) + << "incorrect value for data[219], expected 93, is " + << last_msg_->data[219]; + EXPECT_EQ(last_msg_->data[220], 186) + << "incorrect value for data[220], expected 186, is " + << last_msg_->data[220]; + EXPECT_EQ(last_msg_->data[221], 223) + << "incorrect value for data[221], expected 223, is " + << last_msg_->data[221]; + EXPECT_EQ(last_msg_->data[222], 32) + << "incorrect value for data[222], expected 32, is " + << last_msg_->data[222]; + EXPECT_EQ(last_msg_->data[223], 19) + << "incorrect value for data[223], expected 19, is " + << last_msg_->data[223]; + EXPECT_EQ(last_msg_->data[224], 58) + << "incorrect value for data[224], expected 58, is " + << last_msg_->data[224]; + EXPECT_EQ(last_msg_->data[225], 137) + << "incorrect value for data[225], expected 137, is " + << last_msg_->data[225]; + EXPECT_EQ(last_msg_->data[226], 72) + << "incorrect value for data[226], expected 72, is " + << last_msg_->data[226]; + EXPECT_EQ(last_msg_->data[227], 217) + << "incorrect value for data[227], expected 217, is " + << last_msg_->data[227]; + EXPECT_EQ(last_msg_->data[228], 151) + << "incorrect value for data[228], expected 151, is " + << last_msg_->data[228]; + EXPECT_EQ(last_msg_->data[229], 251) + << "incorrect value for data[229], expected 251, is " + << last_msg_->data[229]; + EXPECT_EQ(last_msg_->data[230], 83) + << "incorrect value for data[230], expected 83, is " + << last_msg_->data[230]; + EXPECT_EQ(last_msg_->data[231], 20) + << "incorrect value for data[231], expected 20, is " + << last_msg_->data[231]; + EXPECT_EQ(last_msg_->data[232], 113) + << "incorrect value for data[232], expected 113, is " + << last_msg_->data[232]; + EXPECT_EQ(last_msg_->data[233], 37) + << "incorrect value for data[233], expected 37, is " + << last_msg_->data[233]; + EXPECT_EQ(last_msg_->data[234], 151) + << "incorrect value for data[234], expected 151, is " + << last_msg_->data[234]; + EXPECT_EQ(last_msg_->data[235], 34) + << "incorrect value for data[235], expected 34, is " + << last_msg_->data[235]; + EXPECT_EQ(last_msg_->data[236], 37) + << "incorrect value for data[236], expected 37, is " + << last_msg_->data[236]; + EXPECT_EQ(last_msg_->data[237], 71) + << "incorrect value for data[237], expected 71, is " + << last_msg_->data[237]; + EXPECT_EQ(last_msg_->data[238], 95) + << "incorrect value for data[238], expected 95, is " + << last_msg_->data[238]; + EXPECT_EQ(last_msg_->data[239], 105) + << "incorrect value for data[239], expected 105, is " + << last_msg_->data[239]; + EXPECT_EQ(last_msg_->data[240], 235) + << "incorrect value for data[240], expected 235, is " + << last_msg_->data[240]; + EXPECT_EQ(last_msg_->data[241], 144) + << "incorrect value for data[241], expected 144, is " + << last_msg_->data[241]; + EXPECT_EQ(last_msg_->data[242], 164) + << "incorrect value for data[242], expected 164, is " + << last_msg_->data[242]; + EXPECT_EQ(last_msg_->data[243], 83) + << "incorrect value for data[243], expected 83, is " + << last_msg_->data[243]; + EXPECT_EQ(last_msg_->data[244], 197) + << "incorrect value for data[244], expected 197, is " + << last_msg_->data[244]; + EXPECT_EQ(last_msg_->data[245], 254) + << "incorrect value for data[245], expected 254, is " + << last_msg_->data[245]; + EXPECT_EQ(last_msg_->data[246], 183) + << "incorrect value for data[246], expected 183, is " + << last_msg_->data[246]; + EXPECT_EQ(last_msg_->data[247], 223) + << "incorrect value for data[247], expected 223, is " + << last_msg_->data[247]; + EXPECT_EQ(last_msg_->data[248], 91) + << "incorrect value for data[248], expected 91, is " + << last_msg_->data[248]; + EXPECT_EQ(last_msg_->data[249], 19) + << "incorrect value for data[249], expected 19, is " + << last_msg_->data[249]; + EXPECT_EQ(last_msg_->target, 212) + << "incorrect value for target, expected 212, is " << last_msg_->target; } diff --git a/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashReadReq.cc b/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashReadReq.cc index cb078f221..1ba268849 100644 --- a/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashReadReq.cc +++ b/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashReadReq.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadReq.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_flash_MsgFlashReadReq0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_flash_MsgFlashReadReq0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_flash_MsgFlashReadReq0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_flash_MsgFlashReadReq0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_flash_read_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_flash_read_req_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,55 +81,64 @@ class Test_legacy_auto_check_sbp_flash_MsgFlashReadReq0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_flash_read_req_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_flash_MsgFlashReadReq0, Test) -{ +}; - uint8_t encoded_frame[] = {85,231,0,195,4,5,241,28,75,244,71,210,57, }; +TEST_F(Test_legacy_auto_check_sbp_flash_MsgFlashReadReq0, Test) { + uint8_t encoded_frame[] = { + 85, 231, 0, 195, 4, 5, 241, 28, 75, 244, 71, 210, 57, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_flash_read_req_t* test_msg = ( msg_flash_read_req_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->addr_len = 71; - if (sizeof(test_msg->addr_start) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); - } - test_msg->addr_start[0] = 28; - if (sizeof(test_msg->addr_start) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); - } - test_msg->addr_start[1] = 75; - if (sizeof(test_msg->addr_start) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); - } - test_msg->addr_start[2] = 244; - test_msg->target = 241; - - EXPECT_EQ(send_message( 0xe7, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_flash_read_req_t *test_msg = (msg_flash_read_req_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->addr_len = 71; + if (sizeof(test_msg->addr_start) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); + } + test_msg->addr_start[0] = 28; + if (sizeof(test_msg->addr_start) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); + } + test_msg->addr_start[1] = 75; + if (sizeof(test_msg->addr_start) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); + } + test_msg->addr_start[2] = 244; + test_msg->target = 241; + + EXPECT_EQ(send_message(0xe7, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->addr_len, 71) << "incorrect value for addr_len, expected 71, is " << last_msg_->addr_len; - EXPECT_EQ(last_msg_->addr_start[0], 28) << "incorrect value for addr_start[0], expected 28, is " << last_msg_->addr_start[0]; - EXPECT_EQ(last_msg_->addr_start[1], 75) << "incorrect value for addr_start[1], expected 75, is " << last_msg_->addr_start[1]; - EXPECT_EQ(last_msg_->addr_start[2], 244) << "incorrect value for addr_start[2], expected 244, is " << last_msg_->addr_start[2]; - EXPECT_EQ(last_msg_->target, 241) << "incorrect value for target, expected 241, is " << last_msg_->target; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->addr_len, 71) + << "incorrect value for addr_len, expected 71, is " + << last_msg_->addr_len; + EXPECT_EQ(last_msg_->addr_start[0], 28) + << "incorrect value for addr_start[0], expected 28, is " + << last_msg_->addr_start[0]; + EXPECT_EQ(last_msg_->addr_start[1], 75) + << "incorrect value for addr_start[1], expected 75, is " + << last_msg_->addr_start[1]; + EXPECT_EQ(last_msg_->addr_start[2], 244) + << "incorrect value for addr_start[2], expected 244, is " + << last_msg_->addr_start[2]; + EXPECT_EQ(last_msg_->target, 241) + << "incorrect value for target, expected 241, is " << last_msg_->target; } diff --git a/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashReadResp.cc b/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashReadResp.cc index 0e0015ced..53bd1a873 100644 --- a/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashReadResp.cc +++ b/c/test/legacy/cpp/auto_check_sbp_flash_MsgFlashReadResp.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgFlashReadResp.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_flash_MsgFlashReadResp0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_flash_MsgFlashReadResp0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_flash_MsgFlashReadResp0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_flash_MsgFlashReadResp0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_flash_read_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_flash_read_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,55 +81,64 @@ class Test_legacy_auto_check_sbp_flash_MsgFlashReadResp0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_flash_read_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_flash_MsgFlashReadResp0, Test) -{ +}; - uint8_t encoded_frame[] = {85,225,0,195,4,5,136,155,52,172,124,149,135, }; +TEST_F(Test_legacy_auto_check_sbp_flash_MsgFlashReadResp0, Test) { + uint8_t encoded_frame[] = { + 85, 225, 0, 195, 4, 5, 136, 155, 52, 172, 124, 149, 135, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_flash_read_resp_t* test_msg = ( msg_flash_read_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->addr_len = 124; - if (sizeof(test_msg->addr_start) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); - } - test_msg->addr_start[0] = 155; - if (sizeof(test_msg->addr_start) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); - } - test_msg->addr_start[1] = 52; - if (sizeof(test_msg->addr_start) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); - } - test_msg->addr_start[2] = 172; - test_msg->target = 136; - - EXPECT_EQ(send_message( 0xe1, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_flash_read_resp_t *test_msg = (msg_flash_read_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->addr_len = 124; + if (sizeof(test_msg->addr_start) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); + } + test_msg->addr_start[0] = 155; + if (sizeof(test_msg->addr_start) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); + } + test_msg->addr_start[1] = 52; + if (sizeof(test_msg->addr_start) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->addr_start[0])); + } + test_msg->addr_start[2] = 172; + test_msg->target = 136; + + EXPECT_EQ(send_message(0xe1, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->addr_len, 124) << "incorrect value for addr_len, expected 124, is " << last_msg_->addr_len; - EXPECT_EQ(last_msg_->addr_start[0], 155) << "incorrect value for addr_start[0], expected 155, is " << last_msg_->addr_start[0]; - EXPECT_EQ(last_msg_->addr_start[1], 52) << "incorrect value for addr_start[1], expected 52, is " << last_msg_->addr_start[1]; - EXPECT_EQ(last_msg_->addr_start[2], 172) << "incorrect value for addr_start[2], expected 172, is " << last_msg_->addr_start[2]; - EXPECT_EQ(last_msg_->target, 136) << "incorrect value for target, expected 136, is " << last_msg_->target; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->addr_len, 124) + << "incorrect value for addr_len, expected 124, is " + << last_msg_->addr_len; + EXPECT_EQ(last_msg_->addr_start[0], 155) + << "incorrect value for addr_start[0], expected 155, is " + << last_msg_->addr_start[0]; + EXPECT_EQ(last_msg_->addr_start[1], 52) + << "incorrect value for addr_start[1], expected 52, is " + << last_msg_->addr_start[1]; + EXPECT_EQ(last_msg_->addr_start[2], 172) + << "incorrect value for addr_start[2], expected 172, is " + << last_msg_->addr_start[2]; + EXPECT_EQ(last_msg_->target, 136) + << "incorrect value for target, expected 136, is " << last_msg_->target; } diff --git a/c/test/legacy/cpp/auto_check_sbp_flash_MsgM25FlashWriteStatus.cc b/c/test/legacy/cpp/auto_check_sbp_flash_MsgM25FlashWriteStatus.cc index a18d9ede7..fbfa7feb9 100644 --- a/c/test/legacy/cpp/auto_check_sbp_flash_MsgM25FlashWriteStatus.cc +++ b/c/test/legacy/cpp/auto_check_sbp_flash_MsgM25FlashWriteStatus.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgM25FlashWriteStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgM25FlashWriteStatus.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_m25_flash_write_status_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_m25_flash_write_status_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,39 +82,42 @@ class Test_legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_m25_flash_write_status_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus0, Test) -{ +}; - uint8_t encoded_frame[] = {85,243,0,195,4,1,5,112,200, }; +TEST_F(Test_legacy_auto_check_sbp_flash_MsgM25FlashWriteStatus0, Test) { + uint8_t encoded_frame[] = { + 85, 243, 0, 195, 4, 1, 5, 112, 200, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_m25_flash_write_status_t* test_msg = ( msg_m25_flash_write_status_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[0] = 5; - - EXPECT_EQ(send_message( 0xf3, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_m25_flash_write_status_t *test_msg = + (msg_m25_flash_write_status_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[0] = 5; + + EXPECT_EQ(send_message(0xf3, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->status[0], 5) << "incorrect value for status[0], expected 5, is " << last_msg_->status[0]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->status[0], 5) + << "incorrect value for status[0], expected 5, is " + << last_msg_->status[0]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmFlashLockSector.cc b/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmFlashLockSector.cc index 86bf8020f..77eec47a5 100644 --- a/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmFlashLockSector.cc +++ b/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmFlashLockSector.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashLockSector.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashLockSector.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_flash_MsgStmFlashLockSector0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_flash_MsgStmFlashLockSector0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_flash_MsgStmFlashLockSector0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_flash_MsgStmFlashLockSector0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_stm_flash_lock_sector_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_stm_flash_lock_sector_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,35 +82,38 @@ class Test_legacy_auto_check_sbp_flash_MsgStmFlashLockSector0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_stm_flash_lock_sector_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_flash_MsgStmFlashLockSector0, Test) -{ +}; - uint8_t encoded_frame[] = {85,227,0,195,4,4,161,247,197,67,229,32, }; +TEST_F(Test_legacy_auto_check_sbp_flash_MsgStmFlashLockSector0, Test) { + uint8_t encoded_frame[] = { + 85, 227, 0, 195, 4, 4, 161, 247, 197, 67, 229, 32, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_stm_flash_lock_sector_t* test_msg = ( msg_stm_flash_lock_sector_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->sector = 1137047457; - - EXPECT_EQ(send_message( 0xe3, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_stm_flash_lock_sector_t *test_msg = + (msg_stm_flash_lock_sector_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->sector = 1137047457; + + EXPECT_EQ(send_message(0xe3, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->sector, 1137047457) << "incorrect value for sector, expected 1137047457, is " << last_msg_->sector; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->sector, 1137047457) + << "incorrect value for sector, expected 1137047457, is " + << last_msg_->sector; } diff --git a/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmFlashUnlockSector.cc b/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmFlashUnlockSector.cc index d9959bc0e..8e3dfcc98 100644 --- a/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmFlashUnlockSector.cc +++ b/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmFlashUnlockSector.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashUnlockSector.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmFlashUnlockSector.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_stm_flash_unlock_sector_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_stm_flash_unlock_sector_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,35 +82,38 @@ class Test_legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_stm_flash_unlock_sector_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector0, Test) -{ +}; - uint8_t encoded_frame[] = {85,228,0,195,4,4,31,16,231,49,53,217, }; +TEST_F(Test_legacy_auto_check_sbp_flash_MsgStmFlashUnlockSector0, Test) { + uint8_t encoded_frame[] = { + 85, 228, 0, 195, 4, 4, 31, 16, 231, 49, 53, 217, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_stm_flash_unlock_sector_t* test_msg = ( msg_stm_flash_unlock_sector_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->sector = 837226527; - - EXPECT_EQ(send_message( 0xe4, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_stm_flash_unlock_sector_t *test_msg = + (msg_stm_flash_unlock_sector_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->sector = 837226527; + + EXPECT_EQ(send_message(0xe4, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->sector, 837226527) << "incorrect value for sector, expected 837226527, is " << last_msg_->sector; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->sector, 837226527) + << "incorrect value for sector, expected 837226527, is " + << last_msg_->sector; } diff --git a/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmUniqueIdReq.cc b/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmUniqueIdReq.cc index 0f1800d6a..e68bd9af5 100644 --- a/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmUniqueIdReq.cc +++ b/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmUniqueIdReq.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,6 +27,6 @@ #include #include +#include #include #include -#include diff --git a/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmUniqueIdResp.cc b/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmUniqueIdResp.cc index 7a4a20cf6..03ad00424 100644 --- a/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmUniqueIdResp.cc +++ b/c/test/legacy/cpp/auto_check_sbp_flash_MsgStmUniqueIdResp.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/flash/test_MsgStmUniqueIdResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_flash_MsgStmUniqueIdResp0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_flash_MsgStmUniqueIdResp0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_flash_MsgStmUniqueIdResp0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_flash_MsgStmUniqueIdResp0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_stm_unique_id_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_stm_unique_id_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,105 +82,131 @@ class Test_legacy_auto_check_sbp_flash_MsgStmUniqueIdResp0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_stm_unique_id_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_flash_MsgStmUniqueIdResp0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_flash_MsgStmUniqueIdResp0, Test) { + uint8_t encoded_frame[] = { + 85, 229, 0, 195, 4, 12, 196, 16, 15, 163, + 85, 221, 119, 102, 32, 194, 56, 144, 221, 196, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_stm_unique_id_resp_t *test_msg = + (msg_stm_unique_id_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->stm_id) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); + } + test_msg->stm_id[0] = 196; + if (sizeof(test_msg->stm_id) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); + } + test_msg->stm_id[1] = 16; + if (sizeof(test_msg->stm_id) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); + } + test_msg->stm_id[2] = 15; + if (sizeof(test_msg->stm_id) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); + } + test_msg->stm_id[3] = 163; + if (sizeof(test_msg->stm_id) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); + } + test_msg->stm_id[4] = 85; + if (sizeof(test_msg->stm_id) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); + } + test_msg->stm_id[5] = 221; + if (sizeof(test_msg->stm_id) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); + } + test_msg->stm_id[6] = 119; + if (sizeof(test_msg->stm_id) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); + } + test_msg->stm_id[7] = 102; + if (sizeof(test_msg->stm_id) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); + } + test_msg->stm_id[8] = 32; + if (sizeof(test_msg->stm_id) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); + } + test_msg->stm_id[9] = 194; + if (sizeof(test_msg->stm_id) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); + } + test_msg->stm_id[10] = 56; + if (sizeof(test_msg->stm_id) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); + } + test_msg->stm_id[11] = 144; - uint8_t encoded_frame[] = {85,229,0,195,4,12,196,16,15,163,85,221,119,102,32,194,56,144,221,196, }; + EXPECT_EQ(send_message(0xe5, 1219, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_stm_unique_id_resp_t* test_msg = ( msg_stm_unique_id_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->stm_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); - } - test_msg->stm_id[0] = 196; - if (sizeof(test_msg->stm_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); - } - test_msg->stm_id[1] = 16; - if (sizeof(test_msg->stm_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); - } - test_msg->stm_id[2] = 15; - if (sizeof(test_msg->stm_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); - } - test_msg->stm_id[3] = 163; - if (sizeof(test_msg->stm_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); - } - test_msg->stm_id[4] = 85; - if (sizeof(test_msg->stm_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); - } - test_msg->stm_id[5] = 221; - if (sizeof(test_msg->stm_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); - } - test_msg->stm_id[6] = 119; - if (sizeof(test_msg->stm_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); - } - test_msg->stm_id[7] = 102; - if (sizeof(test_msg->stm_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); - } - test_msg->stm_id[8] = 32; - if (sizeof(test_msg->stm_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); - } - test_msg->stm_id[9] = 194; - if (sizeof(test_msg->stm_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); - } - test_msg->stm_id[10] = 56; - if (sizeof(test_msg->stm_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stm_id[0])); - } - test_msg->stm_id[11] = 144; - - EXPECT_EQ(send_message( 0xe5, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->stm_id[0], 196) << "incorrect value for stm_id[0], expected 196, is " << last_msg_->stm_id[0]; - EXPECT_EQ(last_msg_->stm_id[1], 16) << "incorrect value for stm_id[1], expected 16, is " << last_msg_->stm_id[1]; - EXPECT_EQ(last_msg_->stm_id[2], 15) << "incorrect value for stm_id[2], expected 15, is " << last_msg_->stm_id[2]; - EXPECT_EQ(last_msg_->stm_id[3], 163) << "incorrect value for stm_id[3], expected 163, is " << last_msg_->stm_id[3]; - EXPECT_EQ(last_msg_->stm_id[4], 85) << "incorrect value for stm_id[4], expected 85, is " << last_msg_->stm_id[4]; - EXPECT_EQ(last_msg_->stm_id[5], 221) << "incorrect value for stm_id[5], expected 221, is " << last_msg_->stm_id[5]; - EXPECT_EQ(last_msg_->stm_id[6], 119) << "incorrect value for stm_id[6], expected 119, is " << last_msg_->stm_id[6]; - EXPECT_EQ(last_msg_->stm_id[7], 102) << "incorrect value for stm_id[7], expected 102, is " << last_msg_->stm_id[7]; - EXPECT_EQ(last_msg_->stm_id[8], 32) << "incorrect value for stm_id[8], expected 32, is " << last_msg_->stm_id[8]; - EXPECT_EQ(last_msg_->stm_id[9], 194) << "incorrect value for stm_id[9], expected 194, is " << last_msg_->stm_id[9]; - EXPECT_EQ(last_msg_->stm_id[10], 56) << "incorrect value for stm_id[10], expected 56, is " << last_msg_->stm_id[10]; - EXPECT_EQ(last_msg_->stm_id[11], 144) << "incorrect value for stm_id[11], expected 144, is " << last_msg_->stm_id[11]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->stm_id[0], 196) + << "incorrect value for stm_id[0], expected 196, is " + << last_msg_->stm_id[0]; + EXPECT_EQ(last_msg_->stm_id[1], 16) + << "incorrect value for stm_id[1], expected 16, is " + << last_msg_->stm_id[1]; + EXPECT_EQ(last_msg_->stm_id[2], 15) + << "incorrect value for stm_id[2], expected 15, is " + << last_msg_->stm_id[2]; + EXPECT_EQ(last_msg_->stm_id[3], 163) + << "incorrect value for stm_id[3], expected 163, is " + << last_msg_->stm_id[3]; + EXPECT_EQ(last_msg_->stm_id[4], 85) + << "incorrect value for stm_id[4], expected 85, is " + << last_msg_->stm_id[4]; + EXPECT_EQ(last_msg_->stm_id[5], 221) + << "incorrect value for stm_id[5], expected 221, is " + << last_msg_->stm_id[5]; + EXPECT_EQ(last_msg_->stm_id[6], 119) + << "incorrect value for stm_id[6], expected 119, is " + << last_msg_->stm_id[6]; + EXPECT_EQ(last_msg_->stm_id[7], 102) + << "incorrect value for stm_id[7], expected 102, is " + << last_msg_->stm_id[7]; + EXPECT_EQ(last_msg_->stm_id[8], 32) + << "incorrect value for stm_id[8], expected 32, is " + << last_msg_->stm_id[8]; + EXPECT_EQ(last_msg_->stm_id[9], 194) + << "incorrect value for stm_id[9], expected 194, is " + << last_msg_->stm_id[9]; + EXPECT_EQ(last_msg_->stm_id[10], 56) + << "incorrect value for stm_id[10], expected 56, is " + << last_msg_->stm_id[10]; + EXPECT_EQ(last_msg_->stm_id[11], 144) + << "incorrect value for stm_id[11], expected 144, is " + << last_msg_->stm_id[11]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_imu_MsgImuAux.cc b/c/test/legacy/cpp/auto_check_sbp_imu_MsgImuAux.cc index 0a04ce4d2..772505f61 100644 --- a/c/test/legacy/cpp/auto_check_sbp_imu_MsgImuAux.cc +++ b/c/test/legacy/cpp/auto_check_sbp_imu_MsgImuAux.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuAux.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuAux.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_imu_MsgImuAux0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_imu_MsgImuAux0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_imu_MsgImuAux0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_imu_MsgImuAux0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_imu_aux_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_imu_aux_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,39 +81,43 @@ class Test_legacy_auto_check_sbp_imu_MsgImuAux0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_imu_aux_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_imu_MsgImuAux0, Test) -{ +}; - uint8_t encoded_frame[] = {85,1,9,52,18,4,1,244,10,66,200,252, }; +TEST_F(Test_legacy_auto_check_sbp_imu_MsgImuAux0, Test) { + uint8_t encoded_frame[] = { + 85, 1, 9, 52, 18, 4, 1, 244, 10, 66, 200, 252, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_imu_aux_t* test_msg = ( msg_imu_aux_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->imu_conf = 66; - test_msg->imu_type = 1; - test_msg->temp = 2804; - - EXPECT_EQ(send_message( 0x901, 4660, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_imu_aux_t *test_msg = (msg_imu_aux_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->imu_conf = 66; + test_msg->imu_type = 1; + test_msg->temp = 2804; + + EXPECT_EQ(send_message(0x901, 4660, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4660); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->imu_conf, 66) << "incorrect value for imu_conf, expected 66, is " << last_msg_->imu_conf; - EXPECT_EQ(last_msg_->imu_type, 1) << "incorrect value for imu_type, expected 1, is " << last_msg_->imu_type; - EXPECT_EQ(last_msg_->temp, 2804) << "incorrect value for temp, expected 2804, is " << last_msg_->temp; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4660); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->imu_conf, 66) + << "incorrect value for imu_conf, expected 66, is " + << last_msg_->imu_conf; + EXPECT_EQ(last_msg_->imu_type, 1) + << "incorrect value for imu_type, expected 1, is " << last_msg_->imu_type; + EXPECT_EQ(last_msg_->temp, 2804) + << "incorrect value for temp, expected 2804, is " << last_msg_->temp; } diff --git a/c/test/legacy/cpp/auto_check_sbp_imu_MsgImuRaw.cc b/c/test/legacy/cpp/auto_check_sbp_imu_MsgImuRaw.cc index 5112b46c2..37ec19ffc 100644 --- a/c/test/legacy/cpp/auto_check_sbp_imu_MsgImuRaw.cc +++ b/c/test/legacy/cpp/auto_check_sbp_imu_MsgImuRaw.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuRaw.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/imu/test_MsgImuRaw.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_imu_MsgImuRaw0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_imu_MsgImuRaw0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_imu_MsgImuRaw0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_imu_MsgImuRaw0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_imu_raw_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_imu_raw_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,49 +81,58 @@ class Test_legacy_auto_check_sbp_imu_MsgImuRaw0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_imu_raw_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_imu_MsgImuRaw0, Test) -{ +}; - uint8_t encoded_frame[] = {85,0,9,52,18,17,26,1,0,192,206,96,0,223,255,44,16,60,0,208,254,238,255,70,135, }; +TEST_F(Test_legacy_auto_check_sbp_imu_MsgImuRaw0, Test) { + uint8_t encoded_frame[] = { + 85, 0, 9, 52, 18, 17, 26, 1, 0, 192, 206, 96, 0, + 223, 255, 44, 16, 60, 0, 208, 254, 238, 255, 70, 135, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_imu_raw_t* test_msg = ( msg_imu_raw_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->acc_x = 96; - test_msg->acc_y = -33; - test_msg->acc_z = 4140; - test_msg->gyr_x = 60; - test_msg->gyr_y = -304; - test_msg->gyr_z = -18; - test_msg->tow = 3221225754; - test_msg->tow_f = 206; - - EXPECT_EQ(send_message( 0x900, 4660, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_imu_raw_t *test_msg = (msg_imu_raw_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->acc_x = 96; + test_msg->acc_y = -33; + test_msg->acc_z = 4140; + test_msg->gyr_x = 60; + test_msg->gyr_y = -304; + test_msg->gyr_z = -18; + test_msg->tow = 3221225754; + test_msg->tow_f = 206; + + EXPECT_EQ(send_message(0x900, 4660, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4660); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->acc_x, 96) << "incorrect value for acc_x, expected 96, is " << last_msg_->acc_x; - EXPECT_EQ(last_msg_->acc_y, -33) << "incorrect value for acc_y, expected -33, is " << last_msg_->acc_y; - EXPECT_EQ(last_msg_->acc_z, 4140) << "incorrect value for acc_z, expected 4140, is " << last_msg_->acc_z; - EXPECT_EQ(last_msg_->gyr_x, 60) << "incorrect value for gyr_x, expected 60, is " << last_msg_->gyr_x; - EXPECT_EQ(last_msg_->gyr_y, -304) << "incorrect value for gyr_y, expected -304, is " << last_msg_->gyr_y; - EXPECT_EQ(last_msg_->gyr_z, -18) << "incorrect value for gyr_z, expected -18, is " << last_msg_->gyr_z; - EXPECT_EQ(last_msg_->tow, 3221225754) << "incorrect value for tow, expected 3221225754, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->tow_f, 206) << "incorrect value for tow_f, expected 206, is " << last_msg_->tow_f; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4660); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->acc_x, 96) + << "incorrect value for acc_x, expected 96, is " << last_msg_->acc_x; + EXPECT_EQ(last_msg_->acc_y, -33) + << "incorrect value for acc_y, expected -33, is " << last_msg_->acc_y; + EXPECT_EQ(last_msg_->acc_z, 4140) + << "incorrect value for acc_z, expected 4140, is " << last_msg_->acc_z; + EXPECT_EQ(last_msg_->gyr_x, 60) + << "incorrect value for gyr_x, expected 60, is " << last_msg_->gyr_x; + EXPECT_EQ(last_msg_->gyr_y, -304) + << "incorrect value for gyr_y, expected -304, is " << last_msg_->gyr_y; + EXPECT_EQ(last_msg_->gyr_z, -18) + << "incorrect value for gyr_z, expected -18, is " << last_msg_->gyr_z; + EXPECT_EQ(last_msg_->tow, 3221225754) + << "incorrect value for tow, expected 3221225754, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->tow_f, 206) + << "incorrect value for tow_f, expected 206, is " << last_msg_->tow_f; } diff --git a/c/test/legacy/cpp/auto_check_sbp_integrity_MsgAcknowledge.cc b/c/test/legacy/cpp/auto_check_sbp_integrity_MsgAcknowledge.cc index a658651d5..ac92bceb2 100644 --- a/c/test/legacy/cpp/auto_check_sbp_integrity_MsgAcknowledge.cc +++ b/c/test/legacy/cpp/auto_check_sbp_integrity_MsgAcknowledge.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgAcknowledge.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgAcknowledge.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_integrity_MsgAcknowledge0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_integrity_MsgAcknowledge0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_integrity_MsgAcknowledge0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_integrity_MsgAcknowledge0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_acknowledge_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_acknowledge_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,45 +81,57 @@ class Test_legacy_auto_check_sbp_integrity_MsgAcknowledge0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_acknowledge_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_integrity_MsgAcknowledge0, Test) -{ +}; - uint8_t encoded_frame[] = {85,210,11,42,0,11,30,64,226,1,0,0,1,0,1,0,2,86,178, }; +TEST_F(Test_legacy_auto_check_sbp_integrity_MsgAcknowledge0, Test) { + uint8_t encoded_frame[] = { + 85, 210, 11, 42, 0, 11, 30, 64, 226, 1, 0, 0, 1, 0, 1, 0, 2, 86, 178, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_acknowledge_t* test_msg = ( msg_acknowledge_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->area_id = 123456; - test_msg->correction_mask_on_demand = 1; - test_msg->correction_mask_stream = 1; - test_msg->request_id = 30; - test_msg->response_code = 0; - test_msg->solution_id = 2; - - EXPECT_EQ(send_message( 0xBD2, 42, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_acknowledge_t *test_msg = (msg_acknowledge_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->area_id = 123456; + test_msg->correction_mask_on_demand = 1; + test_msg->correction_mask_stream = 1; + test_msg->request_id = 30; + test_msg->response_code = 0; + test_msg->solution_id = 2; + + EXPECT_EQ(send_message(0xBD2, 42, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 42); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->area_id, 123456) << "incorrect value for area_id, expected 123456, is " << last_msg_->area_id; - EXPECT_EQ(last_msg_->correction_mask_on_demand, 1) << "incorrect value for correction_mask_on_demand, expected 1, is " << last_msg_->correction_mask_on_demand; - EXPECT_EQ(last_msg_->correction_mask_stream, 1) << "incorrect value for correction_mask_stream, expected 1, is " << last_msg_->correction_mask_stream; - EXPECT_EQ(last_msg_->request_id, 30) << "incorrect value for request_id, expected 30, is " << last_msg_->request_id; - EXPECT_EQ(last_msg_->response_code, 0) << "incorrect value for response_code, expected 0, is " << last_msg_->response_code; - EXPECT_EQ(last_msg_->solution_id, 2) << "incorrect value for solution_id, expected 2, is " << last_msg_->solution_id; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 42); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->area_id, 123456) + << "incorrect value for area_id, expected 123456, is " + << last_msg_->area_id; + EXPECT_EQ(last_msg_->correction_mask_on_demand, 1) + << "incorrect value for correction_mask_on_demand, expected 1, is " + << last_msg_->correction_mask_on_demand; + EXPECT_EQ(last_msg_->correction_mask_stream, 1) + << "incorrect value for correction_mask_stream, expected 1, is " + << last_msg_->correction_mask_stream; + EXPECT_EQ(last_msg_->request_id, 30) + << "incorrect value for request_id, expected 30, is " + << last_msg_->request_id; + EXPECT_EQ(last_msg_->response_code, 0) + << "incorrect value for response_code, expected 0, is " + << last_msg_->response_code; + EXPECT_EQ(last_msg_->solution_id, 2) + << "incorrect value for solution_id, expected 2, is " + << last_msg_->solution_id; } diff --git a/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagHighLevel.cc b/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagHighLevel.cc index f8940dd1d..bdce576ce 100644 --- a/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagHighLevel.cc +++ b/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagHighLevel.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagHighLevel.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagHighLevel.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_flag_high_level_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_flag_high_level_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,99 +82,142 @@ class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_flag_high_level_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_integrity_MsgSsrFlagHighLevel0, Test) { + uint8_t encoded_frame[] = { + 85, 185, 11, 66, 0, 31, 180, 0, 0, 0, 3, 0, 104, 1, 0, 0, 6, 0, 10, 20, + 0, 30, 0, 40, 1, 2, 3, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7, 102, 67, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_flag_high_level_t *test_msg = + (msg_ssr_flag_high_level_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->chain_id = 40; + test_msg->corr_time.tow = 360; + test_msg->corr_time.wn = 6; + test_msg->obs_time.tow = 180; + test_msg->obs_time.wn = 3; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[0] = 0; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[1] = 0; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[2] = 0; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[3] = 0; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[4] = 0; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[5] = 0; + test_msg->ssr_sol_id = 10; + test_msg->tile_id = 30; + test_msg->tile_set_id = 20; + test_msg->use_bds_sat = 3; + test_msg->use_gal_sat = 2; + test_msg->use_gps_sat = 1; + test_msg->use_iono_grid_point_sat_los = 7; + test_msg->use_iono_grid_points = 5; + test_msg->use_iono_tile_sat_los = 6; + test_msg->use_tropo_grid_points = 4; + + EXPECT_EQ(send_message(3001, 66, test_msg_len, test_msg_storage), SBP_OK); - uint8_t encoded_frame[] = {85,185,11,66,0,31,180,0,0,0,3,0,104,1,0,0,6,0,10,20,0,30,0,40,1,2,3,0,0,0,0,0,0,4,5,6,7,102,67, }; + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_flag_high_level_t* test_msg = ( msg_ssr_flag_high_level_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->chain_id = 40; - test_msg->corr_time.tow = 360; - test_msg->corr_time.wn = 6; - test_msg->obs_time.tow = 180; - test_msg->obs_time.wn = 3; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[0] = 0; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[1] = 0; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[2] = 0; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[3] = 0; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[4] = 0; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[5] = 0; - test_msg->ssr_sol_id = 10; - test_msg->tile_id = 30; - test_msg->tile_set_id = 20; - test_msg->use_bds_sat = 3; - test_msg->use_gal_sat = 2; - test_msg->use_gps_sat = 1; - test_msg->use_iono_grid_point_sat_los = 7; - test_msg->use_iono_grid_points = 5; - test_msg->use_iono_tile_sat_los = 6; - test_msg->use_tropo_grid_points = 4; - - EXPECT_EQ(send_message( 3001, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->chain_id, 40) << "incorrect value for chain_id, expected 40, is " << last_msg_->chain_id; - EXPECT_EQ(last_msg_->corr_time.tow, 360) << "incorrect value for corr_time.tow, expected 360, is " << last_msg_->corr_time.tow; - EXPECT_EQ(last_msg_->corr_time.wn, 6) << "incorrect value for corr_time.wn, expected 6, is " << last_msg_->corr_time.wn; - EXPECT_EQ(last_msg_->obs_time.tow, 180) << "incorrect value for obs_time.tow, expected 180, is " << last_msg_->obs_time.tow; - EXPECT_EQ(last_msg_->obs_time.wn, 3) << "incorrect value for obs_time.wn, expected 3, is " << last_msg_->obs_time.wn; - EXPECT_EQ(last_msg_->reserved[0], 0) << "incorrect value for reserved[0], expected 0, is " << last_msg_->reserved[0]; - EXPECT_EQ(last_msg_->reserved[1], 0) << "incorrect value for reserved[1], expected 0, is " << last_msg_->reserved[1]; - EXPECT_EQ(last_msg_->reserved[2], 0) << "incorrect value for reserved[2], expected 0, is " << last_msg_->reserved[2]; - EXPECT_EQ(last_msg_->reserved[3], 0) << "incorrect value for reserved[3], expected 0, is " << last_msg_->reserved[3]; - EXPECT_EQ(last_msg_->reserved[4], 0) << "incorrect value for reserved[4], expected 0, is " << last_msg_->reserved[4]; - EXPECT_EQ(last_msg_->reserved[5], 0) << "incorrect value for reserved[5], expected 0, is " << last_msg_->reserved[5]; - EXPECT_EQ(last_msg_->ssr_sol_id, 10) << "incorrect value for ssr_sol_id, expected 10, is " << last_msg_->ssr_sol_id; - EXPECT_EQ(last_msg_->tile_id, 30) << "incorrect value for tile_id, expected 30, is " << last_msg_->tile_id; - EXPECT_EQ(last_msg_->tile_set_id, 20) << "incorrect value for tile_set_id, expected 20, is " << last_msg_->tile_set_id; - EXPECT_EQ(last_msg_->use_bds_sat, 3) << "incorrect value for use_bds_sat, expected 3, is " << last_msg_->use_bds_sat; - EXPECT_EQ(last_msg_->use_gal_sat, 2) << "incorrect value for use_gal_sat, expected 2, is " << last_msg_->use_gal_sat; - EXPECT_EQ(last_msg_->use_gps_sat, 1) << "incorrect value for use_gps_sat, expected 1, is " << last_msg_->use_gps_sat; - EXPECT_EQ(last_msg_->use_iono_grid_point_sat_los, 7) << "incorrect value for use_iono_grid_point_sat_los, expected 7, is " << last_msg_->use_iono_grid_point_sat_los; - EXPECT_EQ(last_msg_->use_iono_grid_points, 5) << "incorrect value for use_iono_grid_points, expected 5, is " << last_msg_->use_iono_grid_points; - EXPECT_EQ(last_msg_->use_iono_tile_sat_los, 6) << "incorrect value for use_iono_tile_sat_los, expected 6, is " << last_msg_->use_iono_tile_sat_los; - EXPECT_EQ(last_msg_->use_tropo_grid_points, 4) << "incorrect value for use_tropo_grid_points, expected 4, is " << last_msg_->use_tropo_grid_points; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->chain_id, 40) + << "incorrect value for chain_id, expected 40, is " + << last_msg_->chain_id; + EXPECT_EQ(last_msg_->corr_time.tow, 360) + << "incorrect value for corr_time.tow, expected 360, is " + << last_msg_->corr_time.tow; + EXPECT_EQ(last_msg_->corr_time.wn, 6) + << "incorrect value for corr_time.wn, expected 6, is " + << last_msg_->corr_time.wn; + EXPECT_EQ(last_msg_->obs_time.tow, 180) + << "incorrect value for obs_time.tow, expected 180, is " + << last_msg_->obs_time.tow; + EXPECT_EQ(last_msg_->obs_time.wn, 3) + << "incorrect value for obs_time.wn, expected 3, is " + << last_msg_->obs_time.wn; + EXPECT_EQ(last_msg_->reserved[0], 0) + << "incorrect value for reserved[0], expected 0, is " + << last_msg_->reserved[0]; + EXPECT_EQ(last_msg_->reserved[1], 0) + << "incorrect value for reserved[1], expected 0, is " + << last_msg_->reserved[1]; + EXPECT_EQ(last_msg_->reserved[2], 0) + << "incorrect value for reserved[2], expected 0, is " + << last_msg_->reserved[2]; + EXPECT_EQ(last_msg_->reserved[3], 0) + << "incorrect value for reserved[3], expected 0, is " + << last_msg_->reserved[3]; + EXPECT_EQ(last_msg_->reserved[4], 0) + << "incorrect value for reserved[4], expected 0, is " + << last_msg_->reserved[4]; + EXPECT_EQ(last_msg_->reserved[5], 0) + << "incorrect value for reserved[5], expected 0, is " + << last_msg_->reserved[5]; + EXPECT_EQ(last_msg_->ssr_sol_id, 10) + << "incorrect value for ssr_sol_id, expected 10, is " + << last_msg_->ssr_sol_id; + EXPECT_EQ(last_msg_->tile_id, 30) + << "incorrect value for tile_id, expected 30, is " << last_msg_->tile_id; + EXPECT_EQ(last_msg_->tile_set_id, 20) + << "incorrect value for tile_set_id, expected 20, is " + << last_msg_->tile_set_id; + EXPECT_EQ(last_msg_->use_bds_sat, 3) + << "incorrect value for use_bds_sat, expected 3, is " + << last_msg_->use_bds_sat; + EXPECT_EQ(last_msg_->use_gal_sat, 2) + << "incorrect value for use_gal_sat, expected 2, is " + << last_msg_->use_gal_sat; + EXPECT_EQ(last_msg_->use_gps_sat, 1) + << "incorrect value for use_gps_sat, expected 1, is " + << last_msg_->use_gps_sat; + EXPECT_EQ(last_msg_->use_iono_grid_point_sat_los, 7) + << "incorrect value for use_iono_grid_point_sat_los, expected 7, is " + << last_msg_->use_iono_grid_point_sat_los; + EXPECT_EQ(last_msg_->use_iono_grid_points, 5) + << "incorrect value for use_iono_grid_points, expected 5, is " + << last_msg_->use_iono_grid_points; + EXPECT_EQ(last_msg_->use_iono_tile_sat_los, 6) + << "incorrect value for use_iono_tile_sat_los, expected 6, is " + << last_msg_->use_iono_tile_sat_los; + EXPECT_EQ(last_msg_->use_tropo_grid_points, 4) + << "incorrect value for use_tropo_grid_points, expected 4, is " + << last_msg_->use_tropo_grid_points; } diff --git a/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.cc b/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.cc index f059a0369..af944240e 100644 --- a/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.cc +++ b/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPointSatLos.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPointSatLos.yaml +// by generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,53 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_flag_iono_grid_point_sat_los_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, uint8_t message_length, + const msg_ssr_flag_iono_grid_point_sat_los_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,69 +83,100 @@ class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_flag_iono_grid_point_sat_los_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPointSatLos0, + Test) { + uint8_t encoded_frame[] = { + 85, 209, 11, 66, 0, 21, 180, 0, 0, 0, 3, 0, 1, 2, 3, + 4, 0, 5, 0, 6, 30, 0, 2, 10, 11, 15, 14, 98, 148, + }; - uint8_t encoded_frame[] = {85,209,11,66,0,21,180,0,0,0,3,0,1,2,3,4,0,5,0,6,30,0,2,10,11,15,14,98,148, }; + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_flag_iono_grid_point_sat_los_t *test_msg = + (msg_ssr_flag_iono_grid_point_sat_los_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->faulty_los) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_los[0])); + } + test_msg->faulty_los[0].constellation = 11; + test_msg->faulty_los[0].satId = 10; + if (sizeof(test_msg->faulty_los) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_los[0])); + } + test_msg->faulty_los[1].constellation = 14; + test_msg->faulty_los[1].satId = 15; + test_msg->grid_point_id = 30; + test_msg->header.chain_id = 6; + test_msg->header.num_msgs = 1; + test_msg->header.obs_time.tow = 180; + test_msg->header.obs_time.wn = 3; + test_msg->header.seq_num = 2; + test_msg->header.ssr_sol_id = 3; + test_msg->header.tile_id = 5; + test_msg->header.tile_set_id = 4; + test_msg->n_faulty_los = 2; + + EXPECT_EQ(send_message(3025, 66, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_flag_iono_grid_point_sat_los_t* test_msg = ( msg_ssr_flag_iono_grid_point_sat_los_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->faulty_los) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_los[0])); - } - test_msg->faulty_los[0].constellation = 11; - test_msg->faulty_los[0].satId = 10; - if (sizeof(test_msg->faulty_los) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_los[0])); - } - test_msg->faulty_los[1].constellation = 14; - test_msg->faulty_los[1].satId = 15; - test_msg->grid_point_id = 30; - test_msg->header.chain_id = 6; - test_msg->header.num_msgs = 1; - test_msg->header.obs_time.tow = 180; - test_msg->header.obs_time.wn = 3; - test_msg->header.seq_num = 2; - test_msg->header.ssr_sol_id = 3; - test_msg->header.tile_id = 5; - test_msg->header.tile_set_id = 4; - test_msg->n_faulty_los = 2; - - EXPECT_EQ(send_message( 3025, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->faulty_los[0].constellation, 11) << "incorrect value for faulty_los[0].constellation, expected 11, is " << last_msg_->faulty_los[0].constellation; - EXPECT_EQ(last_msg_->faulty_los[0].satId, 10) << "incorrect value for faulty_los[0].satId, expected 10, is " << last_msg_->faulty_los[0].satId; - EXPECT_EQ(last_msg_->faulty_los[1].constellation, 14) << "incorrect value for faulty_los[1].constellation, expected 14, is " << last_msg_->faulty_los[1].constellation; - EXPECT_EQ(last_msg_->faulty_los[1].satId, 15) << "incorrect value for faulty_los[1].satId, expected 15, is " << last_msg_->faulty_los[1].satId; - EXPECT_EQ(last_msg_->grid_point_id, 30) << "incorrect value for grid_point_id, expected 30, is " << last_msg_->grid_point_id; - EXPECT_EQ(last_msg_->header.chain_id, 6) << "incorrect value for header.chain_id, expected 6, is " << last_msg_->header.chain_id; - EXPECT_EQ(last_msg_->header.num_msgs, 1) << "incorrect value for header.num_msgs, expected 1, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.obs_time.tow, 180) << "incorrect value for header.obs_time.tow, expected 180, is " << last_msg_->header.obs_time.tow; - EXPECT_EQ(last_msg_->header.obs_time.wn, 3) << "incorrect value for header.obs_time.wn, expected 3, is " << last_msg_->header.obs_time.wn; - EXPECT_EQ(last_msg_->header.seq_num, 2) << "incorrect value for header.seq_num, expected 2, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->header.ssr_sol_id, 3) << "incorrect value for header.ssr_sol_id, expected 3, is " << last_msg_->header.ssr_sol_id; - EXPECT_EQ(last_msg_->header.tile_id, 5) << "incorrect value for header.tile_id, expected 5, is " << last_msg_->header.tile_id; - EXPECT_EQ(last_msg_->header.tile_set_id, 4) << "incorrect value for header.tile_set_id, expected 4, is " << last_msg_->header.tile_set_id; - EXPECT_EQ(last_msg_->n_faulty_los, 2) << "incorrect value for n_faulty_los, expected 2, is " << last_msg_->n_faulty_los; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->faulty_los[0].constellation, 11) + << "incorrect value for faulty_los[0].constellation, expected 11, is " + << last_msg_->faulty_los[0].constellation; + EXPECT_EQ(last_msg_->faulty_los[0].satId, 10) + << "incorrect value for faulty_los[0].satId, expected 10, is " + << last_msg_->faulty_los[0].satId; + EXPECT_EQ(last_msg_->faulty_los[1].constellation, 14) + << "incorrect value for faulty_los[1].constellation, expected 14, is " + << last_msg_->faulty_los[1].constellation; + EXPECT_EQ(last_msg_->faulty_los[1].satId, 15) + << "incorrect value for faulty_los[1].satId, expected 15, is " + << last_msg_->faulty_los[1].satId; + EXPECT_EQ(last_msg_->grid_point_id, 30) + << "incorrect value for grid_point_id, expected 30, is " + << last_msg_->grid_point_id; + EXPECT_EQ(last_msg_->header.chain_id, 6) + << "incorrect value for header.chain_id, expected 6, is " + << last_msg_->header.chain_id; + EXPECT_EQ(last_msg_->header.num_msgs, 1) + << "incorrect value for header.num_msgs, expected 1, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.obs_time.tow, 180) + << "incorrect value for header.obs_time.tow, expected 180, is " + << last_msg_->header.obs_time.tow; + EXPECT_EQ(last_msg_->header.obs_time.wn, 3) + << "incorrect value for header.obs_time.wn, expected 3, is " + << last_msg_->header.obs_time.wn; + EXPECT_EQ(last_msg_->header.seq_num, 2) + << "incorrect value for header.seq_num, expected 2, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->header.ssr_sol_id, 3) + << "incorrect value for header.ssr_sol_id, expected 3, is " + << last_msg_->header.ssr_sol_id; + EXPECT_EQ(last_msg_->header.tile_id, 5) + << "incorrect value for header.tile_id, expected 5, is " + << last_msg_->header.tile_id; + EXPECT_EQ(last_msg_->header.tile_set_id, 4) + << "incorrect value for header.tile_set_id, expected 4, is " + << last_msg_->header.tile_set_id; + EXPECT_EQ(last_msg_->n_faulty_los, 2) + << "incorrect value for n_faulty_los, expected 2, is " + << last_msg_->n_faulty_los; } diff --git a/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.cc b/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.cc index d2dec4068..236ef6e33 100644 --- a/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.cc +++ b/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPoints.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoGridPoints.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_flag_iono_grid_points_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_flag_iono_grid_points_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,69 +82,95 @@ class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_flag_iono_grid_points_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints0, Test) -{ +}; - uint8_t encoded_frame[] = {85,199,11,66,0,21,180,0,0,0,3,0,1,2,3,4,0,5,0,6,3,10,0,11,0,12,0,53,7, }; +TEST_F(Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoGridPoints0, Test) { + uint8_t encoded_frame[] = { + 85, 199, 11, 66, 0, 21, 180, 0, 0, 0, 3, 0, 1, 2, 3, + 4, 0, 5, 0, 6, 3, 10, 0, 11, 0, 12, 0, 53, 7, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_flag_iono_grid_points_t* test_msg = ( msg_ssr_flag_iono_grid_points_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->faulty_points) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_points[0])); - } - test_msg->faulty_points[0] = 10; - if (sizeof(test_msg->faulty_points) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_points[0])); - } - test_msg->faulty_points[1] = 11; - if (sizeof(test_msg->faulty_points) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_points[0])); - } - test_msg->faulty_points[2] = 12; - test_msg->header.chain_id = 6; - test_msg->header.num_msgs = 1; - test_msg->header.obs_time.tow = 180; - test_msg->header.obs_time.wn = 3; - test_msg->header.seq_num = 2; - test_msg->header.ssr_sol_id = 3; - test_msg->header.tile_id = 5; - test_msg->header.tile_set_id = 4; - test_msg->n_faulty_points = 3; - - EXPECT_EQ(send_message( 3015, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_flag_iono_grid_points_t *test_msg = + (msg_ssr_flag_iono_grid_points_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->faulty_points) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_points[0])); + } + test_msg->faulty_points[0] = 10; + if (sizeof(test_msg->faulty_points) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_points[0])); + } + test_msg->faulty_points[1] = 11; + if (sizeof(test_msg->faulty_points) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_points[0])); + } + test_msg->faulty_points[2] = 12; + test_msg->header.chain_id = 6; + test_msg->header.num_msgs = 1; + test_msg->header.obs_time.tow = 180; + test_msg->header.obs_time.wn = 3; + test_msg->header.seq_num = 2; + test_msg->header.ssr_sol_id = 3; + test_msg->header.tile_id = 5; + test_msg->header.tile_set_id = 4; + test_msg->n_faulty_points = 3; + + EXPECT_EQ(send_message(3015, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->faulty_points[0], 10) << "incorrect value for faulty_points[0], expected 10, is " << last_msg_->faulty_points[0]; - EXPECT_EQ(last_msg_->faulty_points[1], 11) << "incorrect value for faulty_points[1], expected 11, is " << last_msg_->faulty_points[1]; - EXPECT_EQ(last_msg_->faulty_points[2], 12) << "incorrect value for faulty_points[2], expected 12, is " << last_msg_->faulty_points[2]; - EXPECT_EQ(last_msg_->header.chain_id, 6) << "incorrect value for header.chain_id, expected 6, is " << last_msg_->header.chain_id; - EXPECT_EQ(last_msg_->header.num_msgs, 1) << "incorrect value for header.num_msgs, expected 1, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.obs_time.tow, 180) << "incorrect value for header.obs_time.tow, expected 180, is " << last_msg_->header.obs_time.tow; - EXPECT_EQ(last_msg_->header.obs_time.wn, 3) << "incorrect value for header.obs_time.wn, expected 3, is " << last_msg_->header.obs_time.wn; - EXPECT_EQ(last_msg_->header.seq_num, 2) << "incorrect value for header.seq_num, expected 2, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->header.ssr_sol_id, 3) << "incorrect value for header.ssr_sol_id, expected 3, is " << last_msg_->header.ssr_sol_id; - EXPECT_EQ(last_msg_->header.tile_id, 5) << "incorrect value for header.tile_id, expected 5, is " << last_msg_->header.tile_id; - EXPECT_EQ(last_msg_->header.tile_set_id, 4) << "incorrect value for header.tile_set_id, expected 4, is " << last_msg_->header.tile_set_id; - EXPECT_EQ(last_msg_->n_faulty_points, 3) << "incorrect value for n_faulty_points, expected 3, is " << last_msg_->n_faulty_points; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->faulty_points[0], 10) + << "incorrect value for faulty_points[0], expected 10, is " + << last_msg_->faulty_points[0]; + EXPECT_EQ(last_msg_->faulty_points[1], 11) + << "incorrect value for faulty_points[1], expected 11, is " + << last_msg_->faulty_points[1]; + EXPECT_EQ(last_msg_->faulty_points[2], 12) + << "incorrect value for faulty_points[2], expected 12, is " + << last_msg_->faulty_points[2]; + EXPECT_EQ(last_msg_->header.chain_id, 6) + << "incorrect value for header.chain_id, expected 6, is " + << last_msg_->header.chain_id; + EXPECT_EQ(last_msg_->header.num_msgs, 1) + << "incorrect value for header.num_msgs, expected 1, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.obs_time.tow, 180) + << "incorrect value for header.obs_time.tow, expected 180, is " + << last_msg_->header.obs_time.tow; + EXPECT_EQ(last_msg_->header.obs_time.wn, 3) + << "incorrect value for header.obs_time.wn, expected 3, is " + << last_msg_->header.obs_time.wn; + EXPECT_EQ(last_msg_->header.seq_num, 2) + << "incorrect value for header.seq_num, expected 2, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->header.ssr_sol_id, 3) + << "incorrect value for header.ssr_sol_id, expected 3, is " + << last_msg_->header.ssr_sol_id; + EXPECT_EQ(last_msg_->header.tile_id, 5) + << "incorrect value for header.tile_id, expected 5, is " + << last_msg_->header.tile_id; + EXPECT_EQ(last_msg_->header.tile_set_id, 4) + << "incorrect value for header.tile_set_id, expected 4, is " + << last_msg_->header.tile_set_id; + EXPECT_EQ(last_msg_->n_faulty_points, 3) + << "incorrect value for n_faulty_points, expected 3, is " + << last_msg_->n_faulty_points; } diff --git a/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.cc b/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.cc index c0c5b21a8..4f1232da5 100644 --- a/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.cc +++ b/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoTileSatLos.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagIonoTileSatLos.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_flag_iono_tile_sat_los_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_flag_iono_tile_sat_los_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,67 +82,95 @@ class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_flag_iono_tile_sat_los_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_integrity_MsgSsrFlagIonoTileSatLos0, Test) { + uint8_t encoded_frame[] = { + 85, 205, 11, 66, 0, 19, 180, 0, 0, 0, 3, 0, 1, 2, + 3, 4, 0, 5, 0, 6, 2, 10, 11, 15, 14, 239, 235, + }; - uint8_t encoded_frame[] = {85,205,11,66,0,19,180,0,0,0,3,0,1,2,3,4,0,5,0,6,2,10,11,15,14,239,235, }; + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_flag_iono_tile_sat_los_t *test_msg = + (msg_ssr_flag_iono_tile_sat_los_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->faulty_los) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_los[0])); + } + test_msg->faulty_los[0].constellation = 11; + test_msg->faulty_los[0].satId = 10; + if (sizeof(test_msg->faulty_los) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_los[0])); + } + test_msg->faulty_los[1].constellation = 14; + test_msg->faulty_los[1].satId = 15; + test_msg->header.chain_id = 6; + test_msg->header.num_msgs = 1; + test_msg->header.obs_time.tow = 180; + test_msg->header.obs_time.wn = 3; + test_msg->header.seq_num = 2; + test_msg->header.ssr_sol_id = 3; + test_msg->header.tile_id = 5; + test_msg->header.tile_set_id = 4; + test_msg->n_faulty_los = 2; + + EXPECT_EQ(send_message(3021, 66, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_flag_iono_tile_sat_los_t* test_msg = ( msg_ssr_flag_iono_tile_sat_los_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->faulty_los) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_los[0])); - } - test_msg->faulty_los[0].constellation = 11; - test_msg->faulty_los[0].satId = 10; - if (sizeof(test_msg->faulty_los) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_los[0])); - } - test_msg->faulty_los[1].constellation = 14; - test_msg->faulty_los[1].satId = 15; - test_msg->header.chain_id = 6; - test_msg->header.num_msgs = 1; - test_msg->header.obs_time.tow = 180; - test_msg->header.obs_time.wn = 3; - test_msg->header.seq_num = 2; - test_msg->header.ssr_sol_id = 3; - test_msg->header.tile_id = 5; - test_msg->header.tile_set_id = 4; - test_msg->n_faulty_los = 2; - - EXPECT_EQ(send_message( 3021, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->faulty_los[0].constellation, 11) << "incorrect value for faulty_los[0].constellation, expected 11, is " << last_msg_->faulty_los[0].constellation; - EXPECT_EQ(last_msg_->faulty_los[0].satId, 10) << "incorrect value for faulty_los[0].satId, expected 10, is " << last_msg_->faulty_los[0].satId; - EXPECT_EQ(last_msg_->faulty_los[1].constellation, 14) << "incorrect value for faulty_los[1].constellation, expected 14, is " << last_msg_->faulty_los[1].constellation; - EXPECT_EQ(last_msg_->faulty_los[1].satId, 15) << "incorrect value for faulty_los[1].satId, expected 15, is " << last_msg_->faulty_los[1].satId; - EXPECT_EQ(last_msg_->header.chain_id, 6) << "incorrect value for header.chain_id, expected 6, is " << last_msg_->header.chain_id; - EXPECT_EQ(last_msg_->header.num_msgs, 1) << "incorrect value for header.num_msgs, expected 1, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.obs_time.tow, 180) << "incorrect value for header.obs_time.tow, expected 180, is " << last_msg_->header.obs_time.tow; - EXPECT_EQ(last_msg_->header.obs_time.wn, 3) << "incorrect value for header.obs_time.wn, expected 3, is " << last_msg_->header.obs_time.wn; - EXPECT_EQ(last_msg_->header.seq_num, 2) << "incorrect value for header.seq_num, expected 2, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->header.ssr_sol_id, 3) << "incorrect value for header.ssr_sol_id, expected 3, is " << last_msg_->header.ssr_sol_id; - EXPECT_EQ(last_msg_->header.tile_id, 5) << "incorrect value for header.tile_id, expected 5, is " << last_msg_->header.tile_id; - EXPECT_EQ(last_msg_->header.tile_set_id, 4) << "incorrect value for header.tile_set_id, expected 4, is " << last_msg_->header.tile_set_id; - EXPECT_EQ(last_msg_->n_faulty_los, 2) << "incorrect value for n_faulty_los, expected 2, is " << last_msg_->n_faulty_los; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->faulty_los[0].constellation, 11) + << "incorrect value for faulty_los[0].constellation, expected 11, is " + << last_msg_->faulty_los[0].constellation; + EXPECT_EQ(last_msg_->faulty_los[0].satId, 10) + << "incorrect value for faulty_los[0].satId, expected 10, is " + << last_msg_->faulty_los[0].satId; + EXPECT_EQ(last_msg_->faulty_los[1].constellation, 14) + << "incorrect value for faulty_los[1].constellation, expected 14, is " + << last_msg_->faulty_los[1].constellation; + EXPECT_EQ(last_msg_->faulty_los[1].satId, 15) + << "incorrect value for faulty_los[1].satId, expected 15, is " + << last_msg_->faulty_los[1].satId; + EXPECT_EQ(last_msg_->header.chain_id, 6) + << "incorrect value for header.chain_id, expected 6, is " + << last_msg_->header.chain_id; + EXPECT_EQ(last_msg_->header.num_msgs, 1) + << "incorrect value for header.num_msgs, expected 1, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.obs_time.tow, 180) + << "incorrect value for header.obs_time.tow, expected 180, is " + << last_msg_->header.obs_time.tow; + EXPECT_EQ(last_msg_->header.obs_time.wn, 3) + << "incorrect value for header.obs_time.wn, expected 3, is " + << last_msg_->header.obs_time.wn; + EXPECT_EQ(last_msg_->header.seq_num, 2) + << "incorrect value for header.seq_num, expected 2, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->header.ssr_sol_id, 3) + << "incorrect value for header.ssr_sol_id, expected 3, is " + << last_msg_->header.ssr_sol_id; + EXPECT_EQ(last_msg_->header.tile_id, 5) + << "incorrect value for header.tile_id, expected 5, is " + << last_msg_->header.tile_id; + EXPECT_EQ(last_msg_->header.tile_set_id, 4) + << "incorrect value for header.tile_set_id, expected 4, is " + << last_msg_->header.tile_set_id; + EXPECT_EQ(last_msg_->n_faulty_los, 2) + << "incorrect value for n_faulty_los, expected 2, is " + << last_msg_->n_faulty_los; } diff --git a/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagSatellites.cc b/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagSatellites.cc index cffa1531a..7574372f6 100644 --- a/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagSatellites.cc +++ b/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagSatellites.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagSatellites.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagSatellites.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_flag_satellites_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_flag_satellites_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,67 +82,87 @@ class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_flag_satellites_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites0, Test) -{ +}; - uint8_t encoded_frame[] = {85,189,11,66,0,15,180,0,0,0,3,0,1,2,3,4,5,3,10,11,12,110,165, }; +TEST_F(Test_legacy_auto_check_sbp_integrity_MsgSsrFlagSatellites0, Test) { + uint8_t encoded_frame[] = { + 85, 189, 11, 66, 0, 15, 180, 0, 0, 0, 3, 0, + 1, 2, 3, 4, 5, 3, 10, 11, 12, 110, 165, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_flag_satellites_t* test_msg = ( msg_ssr_flag_satellites_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->chain_id = 4; - test_msg->const_id = 5; - if (sizeof(test_msg->faulty_sats) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_sats[0])); - } - test_msg->faulty_sats[0] = 10; - if (sizeof(test_msg->faulty_sats) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_sats[0])); - } - test_msg->faulty_sats[1] = 11; - if (sizeof(test_msg->faulty_sats) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_sats[0])); - } - test_msg->faulty_sats[2] = 12; - test_msg->n_faulty_sats = 3; - test_msg->num_msgs = 1; - test_msg->obs_time.tow = 180; - test_msg->obs_time.wn = 3; - test_msg->seq_num = 2; - test_msg->ssr_sol_id = 3; - - EXPECT_EQ(send_message( 3005, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_flag_satellites_t *test_msg = + (msg_ssr_flag_satellites_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->chain_id = 4; + test_msg->const_id = 5; + if (sizeof(test_msg->faulty_sats) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_sats[0])); + } + test_msg->faulty_sats[0] = 10; + if (sizeof(test_msg->faulty_sats) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_sats[0])); + } + test_msg->faulty_sats[1] = 11; + if (sizeof(test_msg->faulty_sats) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_sats[0])); + } + test_msg->faulty_sats[2] = 12; + test_msg->n_faulty_sats = 3; + test_msg->num_msgs = 1; + test_msg->obs_time.tow = 180; + test_msg->obs_time.wn = 3; + test_msg->seq_num = 2; + test_msg->ssr_sol_id = 3; + + EXPECT_EQ(send_message(3005, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->chain_id, 4) << "incorrect value for chain_id, expected 4, is " << last_msg_->chain_id; - EXPECT_EQ(last_msg_->const_id, 5) << "incorrect value for const_id, expected 5, is " << last_msg_->const_id; - EXPECT_EQ(last_msg_->faulty_sats[0], 10) << "incorrect value for faulty_sats[0], expected 10, is " << last_msg_->faulty_sats[0]; - EXPECT_EQ(last_msg_->faulty_sats[1], 11) << "incorrect value for faulty_sats[1], expected 11, is " << last_msg_->faulty_sats[1]; - EXPECT_EQ(last_msg_->faulty_sats[2], 12) << "incorrect value for faulty_sats[2], expected 12, is " << last_msg_->faulty_sats[2]; - EXPECT_EQ(last_msg_->n_faulty_sats, 3) << "incorrect value for n_faulty_sats, expected 3, is " << last_msg_->n_faulty_sats; - EXPECT_EQ(last_msg_->num_msgs, 1) << "incorrect value for num_msgs, expected 1, is " << last_msg_->num_msgs; - EXPECT_EQ(last_msg_->obs_time.tow, 180) << "incorrect value for obs_time.tow, expected 180, is " << last_msg_->obs_time.tow; - EXPECT_EQ(last_msg_->obs_time.wn, 3) << "incorrect value for obs_time.wn, expected 3, is " << last_msg_->obs_time.wn; - EXPECT_EQ(last_msg_->seq_num, 2) << "incorrect value for seq_num, expected 2, is " << last_msg_->seq_num; - EXPECT_EQ(last_msg_->ssr_sol_id, 3) << "incorrect value for ssr_sol_id, expected 3, is " << last_msg_->ssr_sol_id; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->chain_id, 4) + << "incorrect value for chain_id, expected 4, is " << last_msg_->chain_id; + EXPECT_EQ(last_msg_->const_id, 5) + << "incorrect value for const_id, expected 5, is " << last_msg_->const_id; + EXPECT_EQ(last_msg_->faulty_sats[0], 10) + << "incorrect value for faulty_sats[0], expected 10, is " + << last_msg_->faulty_sats[0]; + EXPECT_EQ(last_msg_->faulty_sats[1], 11) + << "incorrect value for faulty_sats[1], expected 11, is " + << last_msg_->faulty_sats[1]; + EXPECT_EQ(last_msg_->faulty_sats[2], 12) + << "incorrect value for faulty_sats[2], expected 12, is " + << last_msg_->faulty_sats[2]; + EXPECT_EQ(last_msg_->n_faulty_sats, 3) + << "incorrect value for n_faulty_sats, expected 3, is " + << last_msg_->n_faulty_sats; + EXPECT_EQ(last_msg_->num_msgs, 1) + << "incorrect value for num_msgs, expected 1, is " << last_msg_->num_msgs; + EXPECT_EQ(last_msg_->obs_time.tow, 180) + << "incorrect value for obs_time.tow, expected 180, is " + << last_msg_->obs_time.tow; + EXPECT_EQ(last_msg_->obs_time.wn, 3) + << "incorrect value for obs_time.wn, expected 3, is " + << last_msg_->obs_time.wn; + EXPECT_EQ(last_msg_->seq_num, 2) + << "incorrect value for seq_num, expected 2, is " << last_msg_->seq_num; + EXPECT_EQ(last_msg_->ssr_sol_id, 3) + << "incorrect value for ssr_sol_id, expected 3, is " + << last_msg_->ssr_sol_id; } diff --git a/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.cc b/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.cc index 6386f083a..16c81fb37 100644 --- a/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.cc +++ b/c/test/legacy/cpp/auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagTropoGridPoints.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/integrity/test_MsgSsrFlagTropoGridPoints.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_flag_tropo_grid_points_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_flag_tropo_grid_points_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,69 +82,95 @@ class Test_legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_flag_tropo_grid_points_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints0, Test) -{ +}; - uint8_t encoded_frame[] = {85,195,11,66,0,21,180,0,0,0,3,0,1,2,3,4,0,5,0,6,3,10,0,11,0,12,0,243,150, }; +TEST_F(Test_legacy_auto_check_sbp_integrity_MsgSsrFlagTropoGridPoints0, Test) { + uint8_t encoded_frame[] = { + 85, 195, 11, 66, 0, 21, 180, 0, 0, 0, 3, 0, 1, 2, 3, + 4, 0, 5, 0, 6, 3, 10, 0, 11, 0, 12, 0, 243, 150, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_flag_tropo_grid_points_t* test_msg = ( msg_ssr_flag_tropo_grid_points_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->faulty_points) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_points[0])); - } - test_msg->faulty_points[0] = 10; - if (sizeof(test_msg->faulty_points) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_points[0])); - } - test_msg->faulty_points[1] = 11; - if (sizeof(test_msg->faulty_points) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_points[0])); - } - test_msg->faulty_points[2] = 12; - test_msg->header.chain_id = 6; - test_msg->header.num_msgs = 1; - test_msg->header.obs_time.tow = 180; - test_msg->header.obs_time.wn = 3; - test_msg->header.seq_num = 2; - test_msg->header.ssr_sol_id = 3; - test_msg->header.tile_id = 5; - test_msg->header.tile_set_id = 4; - test_msg->n_faulty_points = 3; - - EXPECT_EQ(send_message( 3011, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_flag_tropo_grid_points_t *test_msg = + (msg_ssr_flag_tropo_grid_points_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->faulty_points) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_points[0])); + } + test_msg->faulty_points[0] = 10; + if (sizeof(test_msg->faulty_points) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_points[0])); + } + test_msg->faulty_points[1] = 11; + if (sizeof(test_msg->faulty_points) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->faulty_points[0])); + } + test_msg->faulty_points[2] = 12; + test_msg->header.chain_id = 6; + test_msg->header.num_msgs = 1; + test_msg->header.obs_time.tow = 180; + test_msg->header.obs_time.wn = 3; + test_msg->header.seq_num = 2; + test_msg->header.ssr_sol_id = 3; + test_msg->header.tile_id = 5; + test_msg->header.tile_set_id = 4; + test_msg->n_faulty_points = 3; + + EXPECT_EQ(send_message(3011, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->faulty_points[0], 10) << "incorrect value for faulty_points[0], expected 10, is " << last_msg_->faulty_points[0]; - EXPECT_EQ(last_msg_->faulty_points[1], 11) << "incorrect value for faulty_points[1], expected 11, is " << last_msg_->faulty_points[1]; - EXPECT_EQ(last_msg_->faulty_points[2], 12) << "incorrect value for faulty_points[2], expected 12, is " << last_msg_->faulty_points[2]; - EXPECT_EQ(last_msg_->header.chain_id, 6) << "incorrect value for header.chain_id, expected 6, is " << last_msg_->header.chain_id; - EXPECT_EQ(last_msg_->header.num_msgs, 1) << "incorrect value for header.num_msgs, expected 1, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.obs_time.tow, 180) << "incorrect value for header.obs_time.tow, expected 180, is " << last_msg_->header.obs_time.tow; - EXPECT_EQ(last_msg_->header.obs_time.wn, 3) << "incorrect value for header.obs_time.wn, expected 3, is " << last_msg_->header.obs_time.wn; - EXPECT_EQ(last_msg_->header.seq_num, 2) << "incorrect value for header.seq_num, expected 2, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->header.ssr_sol_id, 3) << "incorrect value for header.ssr_sol_id, expected 3, is " << last_msg_->header.ssr_sol_id; - EXPECT_EQ(last_msg_->header.tile_id, 5) << "incorrect value for header.tile_id, expected 5, is " << last_msg_->header.tile_id; - EXPECT_EQ(last_msg_->header.tile_set_id, 4) << "incorrect value for header.tile_set_id, expected 4, is " << last_msg_->header.tile_set_id; - EXPECT_EQ(last_msg_->n_faulty_points, 3) << "incorrect value for n_faulty_points, expected 3, is " << last_msg_->n_faulty_points; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->faulty_points[0], 10) + << "incorrect value for faulty_points[0], expected 10, is " + << last_msg_->faulty_points[0]; + EXPECT_EQ(last_msg_->faulty_points[1], 11) + << "incorrect value for faulty_points[1], expected 11, is " + << last_msg_->faulty_points[1]; + EXPECT_EQ(last_msg_->faulty_points[2], 12) + << "incorrect value for faulty_points[2], expected 12, is " + << last_msg_->faulty_points[2]; + EXPECT_EQ(last_msg_->header.chain_id, 6) + << "incorrect value for header.chain_id, expected 6, is " + << last_msg_->header.chain_id; + EXPECT_EQ(last_msg_->header.num_msgs, 1) + << "incorrect value for header.num_msgs, expected 1, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.obs_time.tow, 180) + << "incorrect value for header.obs_time.tow, expected 180, is " + << last_msg_->header.obs_time.tow; + EXPECT_EQ(last_msg_->header.obs_time.wn, 3) + << "incorrect value for header.obs_time.wn, expected 3, is " + << last_msg_->header.obs_time.wn; + EXPECT_EQ(last_msg_->header.seq_num, 2) + << "incorrect value for header.seq_num, expected 2, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->header.ssr_sol_id, 3) + << "incorrect value for header.ssr_sol_id, expected 3, is " + << last_msg_->header.ssr_sol_id; + EXPECT_EQ(last_msg_->header.tile_id, 5) + << "incorrect value for header.tile_id, expected 5, is " + << last_msg_->header.tile_id; + EXPECT_EQ(last_msg_->header.tile_set_id, 4) + << "incorrect value for header.tile_set_id, expected 4, is " + << last_msg_->header.tile_set_id; + EXPECT_EQ(last_msg_->n_faulty_points, 3) + << "incorrect value for n_faulty_points, expected 3, is " + << last_msg_->n_faulty_points; } diff --git a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxCpuState.cc b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxCpuState.cc index 33fedc97c..dac8e0d43 100644 --- a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxCpuState.cc +++ b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxCpuState.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuState.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_linux_MsgLinuxCpuState0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_linux_MsgLinuxCpuState0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_linux_MsgLinuxCpuState0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_linux_MsgLinuxCpuState0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_linux_cpu_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_linux_cpu_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,65 +81,103 @@ class Test_legacy_auto_check_sbp_linux_MsgLinuxCpuState0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_linux_cpu_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxCpuState0, Test) -{ +}; - uint8_t encoded_frame[] = {85,8,127,148,133,70,101,122,195,98,215,35,94,235,20,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,68,229, }; +TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxCpuState0, Test) { + uint8_t encoded_frame[] = { + 85, 8, 127, 148, 133, 70, 101, 122, 195, 98, 215, 35, 94, + 235, 20, 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, + 101, 0, 0, 0, 47, 112, 97, 116, 104, 47, 116, 111, 47, + 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, + 97, 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, + 50, 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 68, 229, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_linux_cpu_state_t* test_msg = ( msg_linux_cpu_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->cmdline) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->flags = 20; - test_msg->index = 101; - test_msg->pcpu = 98; - test_msg->pid = 50042; - test_msg->time = 3948815319; - { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - memcpy(test_msg->tname, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->tname) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_linux_cpu_state_t *test_msg = (msg_linux_cpu_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->cmdline) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } - - EXPECT_EQ(send_message( 0x7f08, 34196, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + } + test_msg->flags = 20; + test_msg->index = 101; + test_msg->pcpu = 98; + test_msg->pid = 50042; + test_msg->time = 3948815319; + { + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + memcpy(test_msg->tname, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->tname) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 34196); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - EXPECT_EQ(memcmp(last_msg_->cmdline, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->cmdline, expected string '" << check_string << "', is '" << last_msg_->cmdline << "'"; - } - EXPECT_EQ(last_msg_->flags, 20) << "incorrect value for flags, expected 20, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->index, 101) << "incorrect value for index, expected 101, is " << last_msg_->index; - EXPECT_EQ(last_msg_->pcpu, 98) << "incorrect value for pcpu, expected 98, is " << last_msg_->pcpu; - EXPECT_EQ(last_msg_->pid, 50042) << "incorrect value for pid, expected 50042, is " << last_msg_->pid; - EXPECT_EQ(last_msg_->time, 3948815319) << "incorrect value for time, expected 3948815319, is " << last_msg_->time; - { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->tname, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->tname, expected string '" << check_string << "', is '" << last_msg_->tname << "'"; - } + EXPECT_EQ(send_message(0x7f08, 34196, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 34196); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + EXPECT_EQ(memcmp(last_msg_->cmdline, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->cmdline, expected string '" + << check_string << "', is '" << last_msg_->cmdline << "'"; + } + EXPECT_EQ(last_msg_->flags, 20) + << "incorrect value for flags, expected 20, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->index, 101) + << "incorrect value for index, expected 101, is " << last_msg_->index; + EXPECT_EQ(last_msg_->pcpu, 98) + << "incorrect value for pcpu, expected 98, is " << last_msg_->pcpu; + EXPECT_EQ(last_msg_->pid, 50042) + << "incorrect value for pid, expected 50042, is " << last_msg_->pid; + EXPECT_EQ(last_msg_->time, 3948815319) + << "incorrect value for time, expected 3948815319, is " + << last_msg_->time; + { + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->tname, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->tname, expected string '" + << check_string << "', is '" << last_msg_->tname << "'"; + } } diff --git a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxCpuStateDepA.cc b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxCpuStateDepA.cc index ea9d27891..fc9af56d6 100644 --- a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxCpuStateDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxCpuStateDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxCpuStateDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_linux_cpu_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_linux_cpu_state_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,61 +82,96 @@ class Test_legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_linux_cpu_state_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,0,127,12,91,65,51,240,250,178,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,80,48, }; +TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxCpuStateDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 0, 127, 12, 91, 65, 51, 240, 250, 178, 112, 114, 111, 99, 101, + 115, 115, 45, 110, 97, 109, 101, 0, 0, 0, 47, 112, 97, 116, 104, + 47, 116, 111, 47, 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, + 101, 32, 97, 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, + 50, 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 80, 48, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_linux_cpu_state_dep_a_t* test_msg = ( msg_linux_cpu_state_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->cmdline) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->index = 51; - test_msg->pcpu = 178; - test_msg->pid = 64240; - { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - memcpy(test_msg->tname, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->tname) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_linux_cpu_state_dep_a_t *test_msg = + (msg_linux_cpu_state_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->cmdline) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } - - EXPECT_EQ(send_message( 0x7f00, 23308, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + } + test_msg->index = 51; + test_msg->pcpu = 178; + test_msg->pid = 64240; + { + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + memcpy(test_msg->tname, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->tname) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 23308); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - EXPECT_EQ(memcmp(last_msg_->cmdline, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->cmdline, expected string '" << check_string << "', is '" << last_msg_->cmdline << "'"; - } - EXPECT_EQ(last_msg_->index, 51) << "incorrect value for index, expected 51, is " << last_msg_->index; - EXPECT_EQ(last_msg_->pcpu, 178) << "incorrect value for pcpu, expected 178, is " << last_msg_->pcpu; - EXPECT_EQ(last_msg_->pid, 64240) << "incorrect value for pid, expected 64240, is " << last_msg_->pid; - { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->tname, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->tname, expected string '" << check_string << "', is '" << last_msg_->tname << "'"; - } + EXPECT_EQ(send_message(0x7f00, 23308, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 23308); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + EXPECT_EQ(memcmp(last_msg_->cmdline, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->cmdline, expected string '" + << check_string << "', is '" << last_msg_->cmdline << "'"; + } + EXPECT_EQ(last_msg_->index, 51) + << "incorrect value for index, expected 51, is " << last_msg_->index; + EXPECT_EQ(last_msg_->pcpu, 178) + << "incorrect value for pcpu, expected 178, is " << last_msg_->pcpu; + EXPECT_EQ(last_msg_->pid, 64240) + << "incorrect value for pid, expected 64240, is " << last_msg_->pid; + { + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->tname, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->tname, expected string '" + << check_string << "', is '" << last_msg_->tname << "'"; + } } diff --git a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxMemState.cc b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxMemState.cc index 6aedb134e..f64bb4941 100644 --- a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxMemState.cc +++ b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxMemState.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemState.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_linux_MsgLinuxMemState0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_linux_MsgLinuxMemState0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_linux_MsgLinuxMemState0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_linux_MsgLinuxMemState0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_linux_mem_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_linux_mem_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,65 +81,103 @@ class Test_legacy_auto_check_sbp_linux_MsgLinuxMemState0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_linux_mem_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxMemState0, Test) -{ +}; - uint8_t encoded_frame[] = {85,9,127,95,253,70,154,191,223,19,247,53,26,187,76,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,3,181, }; +TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxMemState0, Test) { + uint8_t encoded_frame[] = { + 85, 9, 127, 95, 253, 70, 154, 191, 223, 19, 247, 53, 26, + 187, 76, 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, + 101, 0, 0, 0, 47, 112, 97, 116, 104, 47, 116, 111, 47, + 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, + 97, 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, + 50, 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 3, 181, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_linux_mem_state_t* test_msg = ( msg_linux_mem_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->cmdline) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->flags = 76; - test_msg->index = 154; - test_msg->pid = 57279; - test_msg->pmem = 19; - test_msg->time = 3139057143; - { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - memcpy(test_msg->tname, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->tname) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_linux_mem_state_t *test_msg = (msg_linux_mem_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->cmdline) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } - - EXPECT_EQ(send_message( 0x7f09, 64863, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + } + test_msg->flags = 76; + test_msg->index = 154; + test_msg->pid = 57279; + test_msg->pmem = 19; + test_msg->time = 3139057143; + { + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + memcpy(test_msg->tname, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->tname) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 64863); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - EXPECT_EQ(memcmp(last_msg_->cmdline, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->cmdline, expected string '" << check_string << "', is '" << last_msg_->cmdline << "'"; - } - EXPECT_EQ(last_msg_->flags, 76) << "incorrect value for flags, expected 76, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->index, 154) << "incorrect value for index, expected 154, is " << last_msg_->index; - EXPECT_EQ(last_msg_->pid, 57279) << "incorrect value for pid, expected 57279, is " << last_msg_->pid; - EXPECT_EQ(last_msg_->pmem, 19) << "incorrect value for pmem, expected 19, is " << last_msg_->pmem; - EXPECT_EQ(last_msg_->time, 3139057143) << "incorrect value for time, expected 3139057143, is " << last_msg_->time; - { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->tname, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->tname, expected string '" << check_string << "', is '" << last_msg_->tname << "'"; - } + EXPECT_EQ(send_message(0x7f09, 64863, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 64863); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + EXPECT_EQ(memcmp(last_msg_->cmdline, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->cmdline, expected string '" + << check_string << "', is '" << last_msg_->cmdline << "'"; + } + EXPECT_EQ(last_msg_->flags, 76) + << "incorrect value for flags, expected 76, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->index, 154) + << "incorrect value for index, expected 154, is " << last_msg_->index; + EXPECT_EQ(last_msg_->pid, 57279) + << "incorrect value for pid, expected 57279, is " << last_msg_->pid; + EXPECT_EQ(last_msg_->pmem, 19) + << "incorrect value for pmem, expected 19, is " << last_msg_->pmem; + EXPECT_EQ(last_msg_->time, 3139057143) + << "incorrect value for time, expected 3139057143, is " + << last_msg_->time; + { + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->tname, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->tname, expected string '" + << check_string << "', is '" << last_msg_->tname << "'"; + } } diff --git a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxMemStateDepA.cc b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxMemStateDepA.cc index b359fe13d..8f322d4b9 100644 --- a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxMemStateDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxMemStateDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxMemStateDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_linux_mem_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_linux_mem_state_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,61 +82,96 @@ class Test_legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_linux_mem_state_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,1,127,185,109,65,247,93,48,193,112,114,111,99,101,115,115,45,110,97,109,101,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,17,137, }; +TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxMemStateDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 1, 127, 185, 109, 65, 247, 93, 48, 193, 112, 114, 111, 99, 101, + 115, 115, 45, 110, 97, 109, 101, 0, 0, 0, 47, 112, 97, 116, 104, + 47, 116, 111, 47, 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, + 101, 32, 97, 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, + 50, 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 17, 137, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_linux_mem_state_dep_a_t* test_msg = ( msg_linux_mem_state_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->cmdline) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->index = 247; - test_msg->pid = 12381; - test_msg->pmem = 193; - { - const char assign_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - memcpy(test_msg->tname, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->tname) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_linux_mem_state_dep_a_t *test_msg = + (msg_linux_mem_state_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->cmdline) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } - - EXPECT_EQ(send_message( 0x7f01, 28089, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + } + test_msg->index = 247; + test_msg->pid = 12381; + test_msg->pmem = 193; + { + const char assign_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + memcpy(test_msg->tname, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->tname) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 28089); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - EXPECT_EQ(memcmp(last_msg_->cmdline, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->cmdline, expected string '" << check_string << "', is '" << last_msg_->cmdline << "'"; - } - EXPECT_EQ(last_msg_->index, 247) << "incorrect value for index, expected 247, is " << last_msg_->index; - EXPECT_EQ(last_msg_->pid, 12381) << "incorrect value for pid, expected 12381, is " << last_msg_->pid; - EXPECT_EQ(last_msg_->pmem, 193) << "incorrect value for pmem, expected 193, is " << last_msg_->pmem; - { - const char check_string[] = { (char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->tname, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->tname, expected string '" << check_string << "', is '" << last_msg_->tname << "'"; - } + EXPECT_EQ(send_message(0x7f01, 28089, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 28089); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + EXPECT_EQ(memcmp(last_msg_->cmdline, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->cmdline, expected string '" + << check_string << "', is '" << last_msg_->cmdline << "'"; + } + EXPECT_EQ(last_msg_->index, 247) + << "incorrect value for index, expected 247, is " << last_msg_->index; + EXPECT_EQ(last_msg_->pid, 12381) + << "incorrect value for pid, expected 12381, is " << last_msg_->pid; + EXPECT_EQ(last_msg_->pmem, 193) + << "incorrect value for pmem, expected 193, is " << last_msg_->pmem; + { + const char check_string[] = {(char)112, (char)114, (char)111, (char)99, + (char)101, (char)115, (char)115, (char)45, + (char)110, (char)97, (char)109, (char)101, + (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->tname, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->tname, expected string '" + << check_string << "', is '" << last_msg_->tname << "'"; + } } diff --git a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessFdCount.cc b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessFdCount.cc index bb80afa97..79de6f7ff 100644 --- a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessFdCount.cc +++ b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessFdCount.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdCount.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdCount.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_linux_process_fd_count_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_linux_process_fd_count_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,50 +82,77 @@ class Test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_linux_process_fd_count_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount0, Test) -{ +}; - uint8_t encoded_frame[] = {85,6,127,30,195,51,164,189,165,5,139,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,2,94, }; +TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdCount0, Test) { + uint8_t encoded_frame[] = { + 85, 6, 127, 30, 195, 51, 164, 189, 165, 5, 139, 47, 112, 97, 116, + 104, 47, 116, 111, 47, 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, + 109, 101, 32, 97, 114, 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, + 103, 50, 32, 97, 114, 103, 51, 32, 97, 114, 103, 52, 2, 94, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_linux_process_fd_count_t* test_msg = ( msg_linux_process_fd_count_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->cmdline) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->fd_count = 35589; - test_msg->index = 164; - test_msg->pid = 42429; - - EXPECT_EQ(send_message( 0x7f06, 49950, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_linux_process_fd_count_t *test_msg = + (msg_linux_process_fd_count_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->cmdline) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->fd_count = 35589; + test_msg->index = 164; + test_msg->pid = 42429; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 49950); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - EXPECT_EQ(memcmp(last_msg_->cmdline, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->cmdline, expected string '" << check_string << "', is '" << last_msg_->cmdline << "'"; - } - EXPECT_EQ(last_msg_->fd_count, 35589) << "incorrect value for fd_count, expected 35589, is " << last_msg_->fd_count; - EXPECT_EQ(last_msg_->index, 164) << "incorrect value for index, expected 164, is " << last_msg_->index; - EXPECT_EQ(last_msg_->pid, 42429) << "incorrect value for pid, expected 42429, is " << last_msg_->pid; + EXPECT_EQ(send_message(0x7f06, 49950, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 49950); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + EXPECT_EQ(memcmp(last_msg_->cmdline, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->cmdline, expected string '" + << check_string << "', is '" << last_msg_->cmdline << "'"; + } + EXPECT_EQ(last_msg_->fd_count, 35589) + << "incorrect value for fd_count, expected 35589, is " + << last_msg_->fd_count; + EXPECT_EQ(last_msg_->index, 164) + << "incorrect value for index, expected 164, is " << last_msg_->index; + EXPECT_EQ(last_msg_->pid, 42429) + << "incorrect value for pid, expected 42429, is " << last_msg_->pid; } diff --git a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessFdSummary.cc b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessFdSummary.cc index d39e640f4..a20562e74 100644 --- a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessFdSummary.cc +++ b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessFdSummary.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdSummary.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessFdSummary.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_linux_process_fd_summary_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_linux_process_fd_summary_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,46 +82,65 @@ class Test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_linux_process_fd_summary_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary0, Test) -{ +}; - uint8_t encoded_frame[] = {85,7,127,103,248,29,19,131,200,77,102,100,49,0,102,100,50,0,102,100,51,0,102,100,52,0,102,100,53,0,102,100,54,0,0,129,80, }; +TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxProcessFdSummary0, Test) { + uint8_t encoded_frame[] = { + 85, 7, 127, 103, 248, 29, 19, 131, 200, 77, 102, 100, 49, + 0, 102, 100, 50, 0, 102, 100, 51, 0, 102, 100, 52, 0, + 102, 100, 53, 0, 102, 100, 54, 0, 0, 129, 80, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_linux_process_fd_summary_t* test_msg = ( msg_linux_process_fd_summary_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)102,(char)100,(char)49,(char)0,(char)102,(char)100,(char)50,(char)0,(char)102,(char)100,(char)51,(char)0,(char)102,(char)100,(char)52,(char)0,(char)102,(char)100,(char)53,(char)0,(char)102,(char)100,(char)54,(char)0,(char)0 }; - memcpy(test_msg->most_opened, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->most_opened) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->sys_fd_count = 1304986387; - - EXPECT_EQ(send_message( 0x7f07, 63591, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_linux_process_fd_summary_t *test_msg = + (msg_linux_process_fd_summary_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)102, (char)100, (char)49, (char)0, (char)102, + (char)100, (char)50, (char)0, (char)102, (char)100, + (char)51, (char)0, (char)102, (char)100, (char)52, + (char)0, (char)102, (char)100, (char)53, (char)0, + (char)102, (char)100, (char)54, (char)0, (char)0}; + memcpy(test_msg->most_opened, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->most_opened) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->sys_fd_count = 1304986387; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 63591); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)102,(char)100,(char)49,(char)0,(char)102,(char)100,(char)50,(char)0,(char)102,(char)100,(char)51,(char)0,(char)102,(char)100,(char)52,(char)0,(char)102,(char)100,(char)53,(char)0,(char)102,(char)100,(char)54,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->most_opened, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->most_opened, expected string '" << check_string << "', is '" << last_msg_->most_opened << "'"; - } - EXPECT_EQ(last_msg_->sys_fd_count, 1304986387) << "incorrect value for sys_fd_count, expected 1304986387, is " << last_msg_->sys_fd_count; + EXPECT_EQ(send_message(0x7f07, 63591, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 63591); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)102, (char)100, (char)49, (char)0, (char)102, + (char)100, (char)50, (char)0, (char)102, (char)100, + (char)51, (char)0, (char)102, (char)100, (char)52, + (char)0, (char)102, (char)100, (char)53, (char)0, + (char)102, (char)100, (char)54, (char)0, (char)0}; + EXPECT_EQ( + memcmp(last_msg_->most_opened, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->most_opened, expected string '" + << check_string << "', is '" << last_msg_->most_opened << "'"; + } + EXPECT_EQ(last_msg_->sys_fd_count, 1304986387) + << "incorrect value for sys_fd_count, expected 1304986387, is " + << last_msg_->sys_fd_count; } diff --git a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.cc b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.cc index 4f29db064..056394b96 100644 --- a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.cc +++ b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketCounts.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketCounts.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketCounts.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_linux_process_socket_counts_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_linux_process_socket_counts_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,54 +82,85 @@ class Test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_linux_process_socket_counts_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts0, Test) -{ +}; - uint8_t encoded_frame[] = {85,3,127,108,9,55,51,137,111,79,118,3,140,114,115,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,180,131, }; +TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketCounts0, Test) { + uint8_t encoded_frame[] = { + 85, 3, 127, 108, 9, 55, 51, 137, 111, 79, 118, 3, 140, + 114, 115, 47, 112, 97, 116, 104, 47, 116, 111, 47, 112, 114, + 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, 97, 114, + 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, 50, 32, + 97, 114, 103, 51, 32, 97, 114, 103, 52, 180, 131, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_linux_process_socket_counts_t* test_msg = ( msg_linux_process_socket_counts_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->cmdline) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->index = 51; - test_msg->pid = 28553; - test_msg->socket_count = 30287; - test_msg->socket_states = 29554; - test_msg->socket_types = 35843; - - EXPECT_EQ(send_message( 0x7f03, 2412, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_linux_process_socket_counts_t *test_msg = + (msg_linux_process_socket_counts_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->cmdline) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->index = 51; + test_msg->pid = 28553; + test_msg->socket_count = 30287; + test_msg->socket_states = 29554; + test_msg->socket_types = 35843; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 2412); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - EXPECT_EQ(memcmp(last_msg_->cmdline, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->cmdline, expected string '" << check_string << "', is '" << last_msg_->cmdline << "'"; - } - EXPECT_EQ(last_msg_->index, 51) << "incorrect value for index, expected 51, is " << last_msg_->index; - EXPECT_EQ(last_msg_->pid, 28553) << "incorrect value for pid, expected 28553, is " << last_msg_->pid; - EXPECT_EQ(last_msg_->socket_count, 30287) << "incorrect value for socket_count, expected 30287, is " << last_msg_->socket_count; - EXPECT_EQ(last_msg_->socket_states, 29554) << "incorrect value for socket_states, expected 29554, is " << last_msg_->socket_states; - EXPECT_EQ(last_msg_->socket_types, 35843) << "incorrect value for socket_types, expected 35843, is " << last_msg_->socket_types; + EXPECT_EQ(send_message(0x7f03, 2412, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 2412); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + EXPECT_EQ(memcmp(last_msg_->cmdline, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->cmdline, expected string '" + << check_string << "', is '" << last_msg_->cmdline << "'"; + } + EXPECT_EQ(last_msg_->index, 51) + << "incorrect value for index, expected 51, is " << last_msg_->index; + EXPECT_EQ(last_msg_->pid, 28553) + << "incorrect value for pid, expected 28553, is " << last_msg_->pid; + EXPECT_EQ(last_msg_->socket_count, 30287) + << "incorrect value for socket_count, expected 30287, is " + << last_msg_->socket_count; + EXPECT_EQ(last_msg_->socket_states, 29554) + << "incorrect value for socket_states, expected 29554, is " + << last_msg_->socket_states; + EXPECT_EQ(last_msg_->socket_types, 35843) + << "incorrect value for socket_types, expected 35843, is " + << last_msg_->socket_types; } diff --git a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.cc b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.cc index 7564ffdc3..44b2f6f24 100644 --- a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.cc +++ b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxProcessSocketQueues.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketQueues.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxProcessSocketQueues.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_linux_process_socket_queues_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_linux_process_socket_queues_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,67 +82,132 @@ class Test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_linux_process_socket_queues_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues0, Test) -{ +}; - uint8_t encoded_frame[] = {85,4,127,187,232,121,181,135,75,249,211,35,252,80,109,15,223,97,100,100,114,101,115,115,32,111,102,32,108,97,114,103,101,115,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,112,97,116,104,47,116,111,47,112,114,111,99,101,115,115,45,110,97,109,101,32,97,114,103,48,32,97,114,103,49,32,97,114,103,50,32,97,114,103,51,32,97,114,103,52,2,247, }; +TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxProcessSocketQueues0, Test) { + uint8_t encoded_frame[] = { + 85, 4, 127, 187, 232, 121, 181, 135, 75, 249, 211, 35, 252, 80, 109, + 15, 223, 97, 100, 100, 114, 101, 115, 115, 32, 111, 102, 32, 108, 97, + 114, 103, 101, 115, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 47, 112, 97, 116, 104, 47, 116, 111, 47, + 112, 114, 111, 99, 101, 115, 115, 45, 110, 97, 109, 101, 32, 97, 114, + 103, 48, 32, 97, 114, 103, 49, 32, 97, 114, 103, 50, 32, 97, 114, + 103, 51, 32, 97, 114, 103, 52, 2, 247, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_linux_process_socket_queues_t* test_msg = ( msg_linux_process_socket_queues_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)97,(char)100,(char)100,(char)114,(char)101,(char)115,(char)115,(char)32,(char)111,(char)102,(char)32,(char)108,(char)97,(char)114,(char)103,(char)101,(char)115,(char)116,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->address_of_largest, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->address_of_largest) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->cmdline) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_linux_process_socket_queues_t *test_msg = + (msg_linux_process_socket_queues_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)97, (char)100, (char)100, (char)114, (char)101, (char)115, + (char)115, (char)32, (char)111, (char)102, (char)32, (char)108, + (char)97, (char)114, (char)103, (char)101, (char)115, (char)116, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->address_of_largest, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->address_of_largest) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } - test_msg->index = 181; - test_msg->pid = 19335; - test_msg->recv_queued = 54265; - test_msg->send_queued = 64547; - test_msg->socket_states = 57103; - test_msg->socket_types = 27984; - - EXPECT_EQ(send_message( 0x7f04, 59579, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + } + { + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + memcpy(test_msg->cmdline, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->cmdline) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->index = 181; + test_msg->pid = 19335; + test_msg->recv_queued = 54265; + test_msg->send_queued = 64547; + test_msg->socket_states = 57103; + test_msg->socket_types = 27984; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 59579); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)97,(char)100,(char)100,(char)114,(char)101,(char)115,(char)115,(char)32,(char)111,(char)102,(char)32,(char)108,(char)97,(char)114,(char)103,(char)101,(char)115,(char)116,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->address_of_largest, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->address_of_largest, expected string '" << check_string << "', is '" << last_msg_->address_of_largest << "'"; - } - { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)112,(char)114,(char)111,(char)99,(char)101,(char)115,(char)115,(char)45,(char)110,(char)97,(char)109,(char)101,(char)32,(char)97,(char)114,(char)103,(char)48,(char)32,(char)97,(char)114,(char)103,(char)49,(char)32,(char)97,(char)114,(char)103,(char)50,(char)32,(char)97,(char)114,(char)103,(char)51,(char)32,(char)97,(char)114,(char)103,(char)52 }; - EXPECT_EQ(memcmp(last_msg_->cmdline, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->cmdline, expected string '" << check_string << "', is '" << last_msg_->cmdline << "'"; - } - EXPECT_EQ(last_msg_->index, 181) << "incorrect value for index, expected 181, is " << last_msg_->index; - EXPECT_EQ(last_msg_->pid, 19335) << "incorrect value for pid, expected 19335, is " << last_msg_->pid; - EXPECT_EQ(last_msg_->recv_queued, 54265) << "incorrect value for recv_queued, expected 54265, is " << last_msg_->recv_queued; - EXPECT_EQ(last_msg_->send_queued, 64547) << "incorrect value for send_queued, expected 64547, is " << last_msg_->send_queued; - EXPECT_EQ(last_msg_->socket_states, 57103) << "incorrect value for socket_states, expected 57103, is " << last_msg_->socket_states; - EXPECT_EQ(last_msg_->socket_types, 27984) << "incorrect value for socket_types, expected 27984, is " << last_msg_->socket_types; + EXPECT_EQ(send_message(0x7f04, 59579, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 59579); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)97, (char)100, (char)100, (char)114, (char)101, (char)115, + (char)115, (char)32, (char)111, (char)102, (char)32, (char)108, + (char)97, (char)114, (char)103, (char)101, (char)115, (char)116, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->address_of_largest, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_->address_of_largest, expected string " + "'" + << check_string << "', is '" << last_msg_->address_of_largest << "'"; + } + { + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)112, (char)114, (char)111, + (char)99, (char)101, (char)115, (char)115, (char)45, (char)110, + (char)97, (char)109, (char)101, (char)32, (char)97, (char)114, + (char)103, (char)48, (char)32, (char)97, (char)114, (char)103, + (char)49, (char)32, (char)97, (char)114, (char)103, (char)50, + (char)32, (char)97, (char)114, (char)103, (char)51, (char)32, + (char)97, (char)114, (char)103, (char)52}; + EXPECT_EQ(memcmp(last_msg_->cmdline, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->cmdline, expected string '" + << check_string << "', is '" << last_msg_->cmdline << "'"; + } + EXPECT_EQ(last_msg_->index, 181) + << "incorrect value for index, expected 181, is " << last_msg_->index; + EXPECT_EQ(last_msg_->pid, 19335) + << "incorrect value for pid, expected 19335, is " << last_msg_->pid; + EXPECT_EQ(last_msg_->recv_queued, 54265) + << "incorrect value for recv_queued, expected 54265, is " + << last_msg_->recv_queued; + EXPECT_EQ(last_msg_->send_queued, 64547) + << "incorrect value for send_queued, expected 64547, is " + << last_msg_->send_queued; + EXPECT_EQ(last_msg_->socket_states, 57103) + << "incorrect value for socket_states, expected 57103, is " + << last_msg_->socket_states; + EXPECT_EQ(last_msg_->socket_types, 27984) + << "incorrect value for socket_types, expected 27984, is " + << last_msg_->socket_types; } diff --git a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxSocketUsage.cc b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxSocketUsage.cc index 63ea2971f..8e1b04934 100644 --- a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxSocketUsage.cc +++ b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxSocketUsage.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSocketUsage.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSocketUsage.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_linux_MsgLinuxSocketUsage0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_linux_MsgLinuxSocketUsage0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_linux_MsgLinuxSocketUsage0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_linux_MsgLinuxSocketUsage0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_linux_socket_usage_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_linux_socket_usage_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,229 +82,336 @@ class Test_legacy_auto_check_sbp_linux_MsgLinuxSocketUsage0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_linux_socket_usage_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxSocketUsage0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxSocketUsage0, Test) { + uint8_t encoded_frame[] = { + 85, 5, 127, 114, 138, 72, 13, 196, 69, 173, 67, 222, 186, 181, + 246, 154, 251, 17, 224, 179, 26, 169, 177, 90, 149, 213, 214, 6, + 126, 64, 120, 185, 84, 131, 200, 111, 32, 141, 217, 209, 52, 14, + 190, 147, 159, 246, 141, 122, 212, 119, 131, 30, 120, 47, 25, 109, + 154, 65, 132, 164, 39, 30, 30, 175, 8, 44, 28, 111, 236, 240, + 176, 74, 159, 129, 154, 153, 162, 229, 130, 154, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_linux_socket_usage_t *test_msg = + (msg_linux_socket_usage_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->avg_queue_depth = 2907030541; + test_msg->max_queue_depth = 3048922691; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[0] = 39670; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[1] = 4603; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[2] = 46048; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[3] = 43290; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[4] = 23217; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[5] = 54677; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[6] = 1750; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[7] = 16510; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[8] = 47480; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[9] = 33620; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[10] = 28616; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[11] = 36128; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[12] = 53721; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[13] = 3636; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[14] = 37822; + if (sizeof(test_msg->socket_state_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); + } + test_msg->socket_state_counts[15] = 63135; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[0] = 31373; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[1] = 30676; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[2] = 7811; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[3] = 12152; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[4] = 27929; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[5] = 16794; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[6] = 42116; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[7] = 7719; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[8] = 44830; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[9] = 11272; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[10] = 28444; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[11] = 61676; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[12] = 19120; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[13] = 33183; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[14] = 39322; + if (sizeof(test_msg->socket_type_counts) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); + } + test_msg->socket_type_counts[15] = 58786; - uint8_t encoded_frame[] = {85,5,127,114,138,72,13,196,69,173,67,222,186,181,246,154,251,17,224,179,26,169,177,90,149,213,214,6,126,64,120,185,84,131,200,111,32,141,217,209,52,14,190,147,159,246,141,122,212,119,131,30,120,47,25,109,154,65,132,164,39,30,30,175,8,44,28,111,236,240,176,74,159,129,154,153,162,229,130,154, }; + EXPECT_EQ(send_message(0x7f05, 35442, test_msg_len, test_msg_storage), + SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_linux_socket_usage_t* test_msg = ( msg_linux_socket_usage_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->avg_queue_depth = 2907030541; - test_msg->max_queue_depth = 3048922691; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[0] = 39670; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[1] = 4603; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[2] = 46048; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[3] = 43290; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[4] = 23217; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[5] = 54677; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[6] = 1750; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[7] = 16510; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[8] = 47480; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[9] = 33620; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[10] = 28616; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[11] = 36128; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[12] = 53721; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[13] = 3636; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[14] = 37822; - if (sizeof(test_msg->socket_state_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_state_counts[0])); - } - test_msg->socket_state_counts[15] = 63135; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[0] = 31373; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[1] = 30676; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[2] = 7811; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[3] = 12152; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[4] = 27929; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[5] = 16794; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[6] = 42116; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[7] = 7719; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[8] = 44830; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[9] = 11272; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[10] = 28444; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[11] = 61676; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[12] = 19120; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[13] = 33183; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[14] = 39322; - if (sizeof(test_msg->socket_type_counts) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->socket_type_counts[0])); - } - test_msg->socket_type_counts[15] = 58786; - - EXPECT_EQ(send_message( 0x7f05, 35442, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35442); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->avg_queue_depth, 2907030541) << "incorrect value for avg_queue_depth, expected 2907030541, is " << last_msg_->avg_queue_depth; - EXPECT_EQ(last_msg_->max_queue_depth, 3048922691) << "incorrect value for max_queue_depth, expected 3048922691, is " << last_msg_->max_queue_depth; - EXPECT_EQ(last_msg_->socket_state_counts[0], 39670) << "incorrect value for socket_state_counts[0], expected 39670, is " << last_msg_->socket_state_counts[0]; - EXPECT_EQ(last_msg_->socket_state_counts[1], 4603) << "incorrect value for socket_state_counts[1], expected 4603, is " << last_msg_->socket_state_counts[1]; - EXPECT_EQ(last_msg_->socket_state_counts[2], 46048) << "incorrect value for socket_state_counts[2], expected 46048, is " << last_msg_->socket_state_counts[2]; - EXPECT_EQ(last_msg_->socket_state_counts[3], 43290) << "incorrect value for socket_state_counts[3], expected 43290, is " << last_msg_->socket_state_counts[3]; - EXPECT_EQ(last_msg_->socket_state_counts[4], 23217) << "incorrect value for socket_state_counts[4], expected 23217, is " << last_msg_->socket_state_counts[4]; - EXPECT_EQ(last_msg_->socket_state_counts[5], 54677) << "incorrect value for socket_state_counts[5], expected 54677, is " << last_msg_->socket_state_counts[5]; - EXPECT_EQ(last_msg_->socket_state_counts[6], 1750) << "incorrect value for socket_state_counts[6], expected 1750, is " << last_msg_->socket_state_counts[6]; - EXPECT_EQ(last_msg_->socket_state_counts[7], 16510) << "incorrect value for socket_state_counts[7], expected 16510, is " << last_msg_->socket_state_counts[7]; - EXPECT_EQ(last_msg_->socket_state_counts[8], 47480) << "incorrect value for socket_state_counts[8], expected 47480, is " << last_msg_->socket_state_counts[8]; - EXPECT_EQ(last_msg_->socket_state_counts[9], 33620) << "incorrect value for socket_state_counts[9], expected 33620, is " << last_msg_->socket_state_counts[9]; - EXPECT_EQ(last_msg_->socket_state_counts[10], 28616) << "incorrect value for socket_state_counts[10], expected 28616, is " << last_msg_->socket_state_counts[10]; - EXPECT_EQ(last_msg_->socket_state_counts[11], 36128) << "incorrect value for socket_state_counts[11], expected 36128, is " << last_msg_->socket_state_counts[11]; - EXPECT_EQ(last_msg_->socket_state_counts[12], 53721) << "incorrect value for socket_state_counts[12], expected 53721, is " << last_msg_->socket_state_counts[12]; - EXPECT_EQ(last_msg_->socket_state_counts[13], 3636) << "incorrect value for socket_state_counts[13], expected 3636, is " << last_msg_->socket_state_counts[13]; - EXPECT_EQ(last_msg_->socket_state_counts[14], 37822) << "incorrect value for socket_state_counts[14], expected 37822, is " << last_msg_->socket_state_counts[14]; - EXPECT_EQ(last_msg_->socket_state_counts[15], 63135) << "incorrect value for socket_state_counts[15], expected 63135, is " << last_msg_->socket_state_counts[15]; - EXPECT_EQ(last_msg_->socket_type_counts[0], 31373) << "incorrect value for socket_type_counts[0], expected 31373, is " << last_msg_->socket_type_counts[0]; - EXPECT_EQ(last_msg_->socket_type_counts[1], 30676) << "incorrect value for socket_type_counts[1], expected 30676, is " << last_msg_->socket_type_counts[1]; - EXPECT_EQ(last_msg_->socket_type_counts[2], 7811) << "incorrect value for socket_type_counts[2], expected 7811, is " << last_msg_->socket_type_counts[2]; - EXPECT_EQ(last_msg_->socket_type_counts[3], 12152) << "incorrect value for socket_type_counts[3], expected 12152, is " << last_msg_->socket_type_counts[3]; - EXPECT_EQ(last_msg_->socket_type_counts[4], 27929) << "incorrect value for socket_type_counts[4], expected 27929, is " << last_msg_->socket_type_counts[4]; - EXPECT_EQ(last_msg_->socket_type_counts[5], 16794) << "incorrect value for socket_type_counts[5], expected 16794, is " << last_msg_->socket_type_counts[5]; - EXPECT_EQ(last_msg_->socket_type_counts[6], 42116) << "incorrect value for socket_type_counts[6], expected 42116, is " << last_msg_->socket_type_counts[6]; - EXPECT_EQ(last_msg_->socket_type_counts[7], 7719) << "incorrect value for socket_type_counts[7], expected 7719, is " << last_msg_->socket_type_counts[7]; - EXPECT_EQ(last_msg_->socket_type_counts[8], 44830) << "incorrect value for socket_type_counts[8], expected 44830, is " << last_msg_->socket_type_counts[8]; - EXPECT_EQ(last_msg_->socket_type_counts[9], 11272) << "incorrect value for socket_type_counts[9], expected 11272, is " << last_msg_->socket_type_counts[9]; - EXPECT_EQ(last_msg_->socket_type_counts[10], 28444) << "incorrect value for socket_type_counts[10], expected 28444, is " << last_msg_->socket_type_counts[10]; - EXPECT_EQ(last_msg_->socket_type_counts[11], 61676) << "incorrect value for socket_type_counts[11], expected 61676, is " << last_msg_->socket_type_counts[11]; - EXPECT_EQ(last_msg_->socket_type_counts[12], 19120) << "incorrect value for socket_type_counts[12], expected 19120, is " << last_msg_->socket_type_counts[12]; - EXPECT_EQ(last_msg_->socket_type_counts[13], 33183) << "incorrect value for socket_type_counts[13], expected 33183, is " << last_msg_->socket_type_counts[13]; - EXPECT_EQ(last_msg_->socket_type_counts[14], 39322) << "incorrect value for socket_type_counts[14], expected 39322, is " << last_msg_->socket_type_counts[14]; - EXPECT_EQ(last_msg_->socket_type_counts[15], 58786) << "incorrect value for socket_type_counts[15], expected 58786, is " << last_msg_->socket_type_counts[15]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35442); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->avg_queue_depth, 2907030541) + << "incorrect value for avg_queue_depth, expected 2907030541, is " + << last_msg_->avg_queue_depth; + EXPECT_EQ(last_msg_->max_queue_depth, 3048922691) + << "incorrect value for max_queue_depth, expected 3048922691, is " + << last_msg_->max_queue_depth; + EXPECT_EQ(last_msg_->socket_state_counts[0], 39670) + << "incorrect value for socket_state_counts[0], expected 39670, is " + << last_msg_->socket_state_counts[0]; + EXPECT_EQ(last_msg_->socket_state_counts[1], 4603) + << "incorrect value for socket_state_counts[1], expected 4603, is " + << last_msg_->socket_state_counts[1]; + EXPECT_EQ(last_msg_->socket_state_counts[2], 46048) + << "incorrect value for socket_state_counts[2], expected 46048, is " + << last_msg_->socket_state_counts[2]; + EXPECT_EQ(last_msg_->socket_state_counts[3], 43290) + << "incorrect value for socket_state_counts[3], expected 43290, is " + << last_msg_->socket_state_counts[3]; + EXPECT_EQ(last_msg_->socket_state_counts[4], 23217) + << "incorrect value for socket_state_counts[4], expected 23217, is " + << last_msg_->socket_state_counts[4]; + EXPECT_EQ(last_msg_->socket_state_counts[5], 54677) + << "incorrect value for socket_state_counts[5], expected 54677, is " + << last_msg_->socket_state_counts[5]; + EXPECT_EQ(last_msg_->socket_state_counts[6], 1750) + << "incorrect value for socket_state_counts[6], expected 1750, is " + << last_msg_->socket_state_counts[6]; + EXPECT_EQ(last_msg_->socket_state_counts[7], 16510) + << "incorrect value for socket_state_counts[7], expected 16510, is " + << last_msg_->socket_state_counts[7]; + EXPECT_EQ(last_msg_->socket_state_counts[8], 47480) + << "incorrect value for socket_state_counts[8], expected 47480, is " + << last_msg_->socket_state_counts[8]; + EXPECT_EQ(last_msg_->socket_state_counts[9], 33620) + << "incorrect value for socket_state_counts[9], expected 33620, is " + << last_msg_->socket_state_counts[9]; + EXPECT_EQ(last_msg_->socket_state_counts[10], 28616) + << "incorrect value for socket_state_counts[10], expected 28616, is " + << last_msg_->socket_state_counts[10]; + EXPECT_EQ(last_msg_->socket_state_counts[11], 36128) + << "incorrect value for socket_state_counts[11], expected 36128, is " + << last_msg_->socket_state_counts[11]; + EXPECT_EQ(last_msg_->socket_state_counts[12], 53721) + << "incorrect value for socket_state_counts[12], expected 53721, is " + << last_msg_->socket_state_counts[12]; + EXPECT_EQ(last_msg_->socket_state_counts[13], 3636) + << "incorrect value for socket_state_counts[13], expected 3636, is " + << last_msg_->socket_state_counts[13]; + EXPECT_EQ(last_msg_->socket_state_counts[14], 37822) + << "incorrect value for socket_state_counts[14], expected 37822, is " + << last_msg_->socket_state_counts[14]; + EXPECT_EQ(last_msg_->socket_state_counts[15], 63135) + << "incorrect value for socket_state_counts[15], expected 63135, is " + << last_msg_->socket_state_counts[15]; + EXPECT_EQ(last_msg_->socket_type_counts[0], 31373) + << "incorrect value for socket_type_counts[0], expected 31373, is " + << last_msg_->socket_type_counts[0]; + EXPECT_EQ(last_msg_->socket_type_counts[1], 30676) + << "incorrect value for socket_type_counts[1], expected 30676, is " + << last_msg_->socket_type_counts[1]; + EXPECT_EQ(last_msg_->socket_type_counts[2], 7811) + << "incorrect value for socket_type_counts[2], expected 7811, is " + << last_msg_->socket_type_counts[2]; + EXPECT_EQ(last_msg_->socket_type_counts[3], 12152) + << "incorrect value for socket_type_counts[3], expected 12152, is " + << last_msg_->socket_type_counts[3]; + EXPECT_EQ(last_msg_->socket_type_counts[4], 27929) + << "incorrect value for socket_type_counts[4], expected 27929, is " + << last_msg_->socket_type_counts[4]; + EXPECT_EQ(last_msg_->socket_type_counts[5], 16794) + << "incorrect value for socket_type_counts[5], expected 16794, is " + << last_msg_->socket_type_counts[5]; + EXPECT_EQ(last_msg_->socket_type_counts[6], 42116) + << "incorrect value for socket_type_counts[6], expected 42116, is " + << last_msg_->socket_type_counts[6]; + EXPECT_EQ(last_msg_->socket_type_counts[7], 7719) + << "incorrect value for socket_type_counts[7], expected 7719, is " + << last_msg_->socket_type_counts[7]; + EXPECT_EQ(last_msg_->socket_type_counts[8], 44830) + << "incorrect value for socket_type_counts[8], expected 44830, is " + << last_msg_->socket_type_counts[8]; + EXPECT_EQ(last_msg_->socket_type_counts[9], 11272) + << "incorrect value for socket_type_counts[9], expected 11272, is " + << last_msg_->socket_type_counts[9]; + EXPECT_EQ(last_msg_->socket_type_counts[10], 28444) + << "incorrect value for socket_type_counts[10], expected 28444, is " + << last_msg_->socket_type_counts[10]; + EXPECT_EQ(last_msg_->socket_type_counts[11], 61676) + << "incorrect value for socket_type_counts[11], expected 61676, is " + << last_msg_->socket_type_counts[11]; + EXPECT_EQ(last_msg_->socket_type_counts[12], 19120) + << "incorrect value for socket_type_counts[12], expected 19120, is " + << last_msg_->socket_type_counts[12]; + EXPECT_EQ(last_msg_->socket_type_counts[13], 33183) + << "incorrect value for socket_type_counts[13], expected 33183, is " + << last_msg_->socket_type_counts[13]; + EXPECT_EQ(last_msg_->socket_type_counts[14], 39322) + << "incorrect value for socket_type_counts[14], expected 39322, is " + << last_msg_->socket_type_counts[14]; + EXPECT_EQ(last_msg_->socket_type_counts[15], 58786) + << "incorrect value for socket_type_counts[15], expected 58786, is " + << last_msg_->socket_type_counts[15]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxSysState.cc b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxSysState.cc index ed3dfccaf..c008b5401 100644 --- a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxSysState.cc +++ b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxSysState.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysState.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_linux_MsgLinuxSysState0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_linux_MsgLinuxSysState0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_linux_MsgLinuxSysState0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_linux_MsgLinuxSysState0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_linux_sys_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_linux_sys_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,49 +81,63 @@ class Test_legacy_auto_check_sbp_linux_MsgLinuxSysState0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_linux_sys_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxSysState0, Test) -{ +}; - uint8_t encoded_frame[] = {85,10,127,85,167,15,20,207,125,215,196,71,161,229,250,186,108,30,106,5,9,229,242, }; +TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxSysState0, Test) { + uint8_t encoded_frame[] = { + 85, 10, 127, 85, 167, 15, 20, 207, 125, 215, 196, 71, + 161, 229, 250, 186, 108, 30, 106, 5, 9, 229, 242, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_linux_sys_state_t* test_msg = ( msg_linux_sys_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 9; - test_msg->mem_total = 53012; - test_msg->pcpu = 125; - test_msg->pid_count = 47866; - test_msg->pmem = 215; - test_msg->procs_starting = 18372; - test_msg->procs_stopping = 58785; - test_msg->time = 90840684; - - EXPECT_EQ(send_message( 0x7f0a, 42837, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_linux_sys_state_t *test_msg = (msg_linux_sys_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 9; + test_msg->mem_total = 53012; + test_msg->pcpu = 125; + test_msg->pid_count = 47866; + test_msg->pmem = 215; + test_msg->procs_starting = 18372; + test_msg->procs_stopping = 58785; + test_msg->time = 90840684; + + EXPECT_EQ(send_message(0x7f0a, 42837, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 42837); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 9) << "incorrect value for flags, expected 9, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->mem_total, 53012) << "incorrect value for mem_total, expected 53012, is " << last_msg_->mem_total; - EXPECT_EQ(last_msg_->pcpu, 125) << "incorrect value for pcpu, expected 125, is " << last_msg_->pcpu; - EXPECT_EQ(last_msg_->pid_count, 47866) << "incorrect value for pid_count, expected 47866, is " << last_msg_->pid_count; - EXPECT_EQ(last_msg_->pmem, 215) << "incorrect value for pmem, expected 215, is " << last_msg_->pmem; - EXPECT_EQ(last_msg_->procs_starting, 18372) << "incorrect value for procs_starting, expected 18372, is " << last_msg_->procs_starting; - EXPECT_EQ(last_msg_->procs_stopping, 58785) << "incorrect value for procs_stopping, expected 58785, is " << last_msg_->procs_stopping; - EXPECT_EQ(last_msg_->time, 90840684) << "incorrect value for time, expected 90840684, is " << last_msg_->time; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 42837); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 9) + << "incorrect value for flags, expected 9, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->mem_total, 53012) + << "incorrect value for mem_total, expected 53012, is " + << last_msg_->mem_total; + EXPECT_EQ(last_msg_->pcpu, 125) + << "incorrect value for pcpu, expected 125, is " << last_msg_->pcpu; + EXPECT_EQ(last_msg_->pid_count, 47866) + << "incorrect value for pid_count, expected 47866, is " + << last_msg_->pid_count; + EXPECT_EQ(last_msg_->pmem, 215) + << "incorrect value for pmem, expected 215, is " << last_msg_->pmem; + EXPECT_EQ(last_msg_->procs_starting, 18372) + << "incorrect value for procs_starting, expected 18372, is " + << last_msg_->procs_starting; + EXPECT_EQ(last_msg_->procs_stopping, 58785) + << "incorrect value for procs_stopping, expected 58785, is " + << last_msg_->procs_stopping; + EXPECT_EQ(last_msg_->time, 90840684) + << "incorrect value for time, expected 90840684, is " << last_msg_->time; } diff --git a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxSysStateDepA.cc b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxSysStateDepA.cc index 10d6b8503..8edbdcedc 100644 --- a/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxSysStateDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_linux_MsgLinuxSysStateDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/linux/test_MsgLinuxSysStateDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_linux_sys_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_linux_sys_state_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,45 +82,58 @@ class Test_legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_linux_sys_state_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,2,127,84,56,10,188,163,211,194,115,71,101,103,124,201,223,223, }; +TEST_F(Test_legacy_auto_check_sbp_linux_MsgLinuxSysStateDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 127, 84, 56, 10, 188, 163, 211, + 194, 115, 71, 101, 103, 124, 201, 223, 223, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_linux_sys_state_dep_a_t* test_msg = ( msg_linux_sys_state_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->mem_total = 41916; - test_msg->pcpu = 211; - test_msg->pid_count = 51580; - test_msg->pmem = 194; - test_msg->procs_starting = 18291; - test_msg->procs_stopping = 26469; - - EXPECT_EQ(send_message( 0x7f02, 14420, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_linux_sys_state_dep_a_t *test_msg = + (msg_linux_sys_state_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->mem_total = 41916; + test_msg->pcpu = 211; + test_msg->pid_count = 51580; + test_msg->pmem = 194; + test_msg->procs_starting = 18291; + test_msg->procs_stopping = 26469; + + EXPECT_EQ(send_message(0x7f02, 14420, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 14420); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->mem_total, 41916) << "incorrect value for mem_total, expected 41916, is " << last_msg_->mem_total; - EXPECT_EQ(last_msg_->pcpu, 211) << "incorrect value for pcpu, expected 211, is " << last_msg_->pcpu; - EXPECT_EQ(last_msg_->pid_count, 51580) << "incorrect value for pid_count, expected 51580, is " << last_msg_->pid_count; - EXPECT_EQ(last_msg_->pmem, 194) << "incorrect value for pmem, expected 194, is " << last_msg_->pmem; - EXPECT_EQ(last_msg_->procs_starting, 18291) << "incorrect value for procs_starting, expected 18291, is " << last_msg_->procs_starting; - EXPECT_EQ(last_msg_->procs_stopping, 26469) << "incorrect value for procs_stopping, expected 26469, is " << last_msg_->procs_stopping; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 14420); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->mem_total, 41916) + << "incorrect value for mem_total, expected 41916, is " + << last_msg_->mem_total; + EXPECT_EQ(last_msg_->pcpu, 211) + << "incorrect value for pcpu, expected 211, is " << last_msg_->pcpu; + EXPECT_EQ(last_msg_->pid_count, 51580) + << "incorrect value for pid_count, expected 51580, is " + << last_msg_->pid_count; + EXPECT_EQ(last_msg_->pmem, 194) + << "incorrect value for pmem, expected 194, is " << last_msg_->pmem; + EXPECT_EQ(last_msg_->procs_starting, 18291) + << "incorrect value for procs_starting, expected 18291, is " + << last_msg_->procs_starting; + EXPECT_EQ(last_msg_->procs_stopping, 26469) + << "incorrect value for procs_stopping, expected 26469, is " + << last_msg_->procs_stopping; } diff --git a/c/test/legacy/cpp/auto_check_sbp_logging_MsgFwd.cc b/c/test/legacy/cpp/auto_check_sbp_logging_MsgFwd.cc index 2501f2a56..53f1cbb5a 100644 --- a/c/test/legacy/cpp/auto_check_sbp_logging_MsgFwd.cc +++ b/c/test/legacy/cpp/auto_check_sbp_logging_MsgFwd.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/logging/test_MsgFwd.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/logging/test_MsgFwd.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_logging_MsgFwd0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_logging_MsgFwd0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_logging_MsgFwd0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_logging_MsgFwd0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_fwd_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_fwd_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,133 +81,168 @@ class Test_legacy_auto_check_sbp_logging_MsgFwd0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_fwd_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_logging_MsgFwd0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_logging_MsgFwd0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 4, 66, 0, 18, 0, 0, 86, 81, 68, 47, 81, + 103, 65, 69, 65, 65, 65, 65, 65, 69, 97, 103, 125, 95, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_fwd_t *test_msg = (msg_fwd_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[0] = 86; + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[1] = 81; + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[2] = 68; + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[3] = 47; + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[4] = 81; + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[5] = 103; + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[6] = 65; + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[7] = 69; + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[8] = 65; + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[9] = 65; + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[10] = 65; + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[11] = 65; + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[12] = 65; + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[13] = 69; + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[14] = 97; + if (sizeof(test_msg->fwd_payload) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); + } + test_msg->fwd_payload[15] = 103; + test_msg->protocol = 0; + test_msg->source = 0; + + EXPECT_EQ(send_message(0x402, 66, test_msg_len, test_msg_storage), SBP_OK); - uint8_t encoded_frame[] = {85,2,4,66,0,18,0,0,86,81,68,47,81,103,65,69,65,65,65,65,65,69,97,103,125,95, }; + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_fwd_t* test_msg = ( msg_fwd_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[0] = 86; - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[1] = 81; - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[2] = 68; - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[3] = 47; - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[4] = 81; - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[5] = 103; - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[6] = 65; - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[7] = 69; - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[8] = 65; - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[9] = 65; - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[10] = 65; - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[11] = 65; - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[12] = 65; - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[13] = 69; - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[14] = 97; - if (sizeof(test_msg->fwd_payload) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fwd_payload[0])); - } - test_msg->fwd_payload[15] = 103; - test_msg->protocol = 0; - test_msg->source = 0; - - EXPECT_EQ(send_message( 0x402, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->fwd_payload[0], 86) << "incorrect value for fwd_payload[0], expected 86, is " << last_msg_->fwd_payload[0]; - EXPECT_EQ(last_msg_->fwd_payload[1], 81) << "incorrect value for fwd_payload[1], expected 81, is " << last_msg_->fwd_payload[1]; - EXPECT_EQ(last_msg_->fwd_payload[2], 68) << "incorrect value for fwd_payload[2], expected 68, is " << last_msg_->fwd_payload[2]; - EXPECT_EQ(last_msg_->fwd_payload[3], 47) << "incorrect value for fwd_payload[3], expected 47, is " << last_msg_->fwd_payload[3]; - EXPECT_EQ(last_msg_->fwd_payload[4], 81) << "incorrect value for fwd_payload[4], expected 81, is " << last_msg_->fwd_payload[4]; - EXPECT_EQ(last_msg_->fwd_payload[5], 103) << "incorrect value for fwd_payload[5], expected 103, is " << last_msg_->fwd_payload[5]; - EXPECT_EQ(last_msg_->fwd_payload[6], 65) << "incorrect value for fwd_payload[6], expected 65, is " << last_msg_->fwd_payload[6]; - EXPECT_EQ(last_msg_->fwd_payload[7], 69) << "incorrect value for fwd_payload[7], expected 69, is " << last_msg_->fwd_payload[7]; - EXPECT_EQ(last_msg_->fwd_payload[8], 65) << "incorrect value for fwd_payload[8], expected 65, is " << last_msg_->fwd_payload[8]; - EXPECT_EQ(last_msg_->fwd_payload[9], 65) << "incorrect value for fwd_payload[9], expected 65, is " << last_msg_->fwd_payload[9]; - EXPECT_EQ(last_msg_->fwd_payload[10], 65) << "incorrect value for fwd_payload[10], expected 65, is " << last_msg_->fwd_payload[10]; - EXPECT_EQ(last_msg_->fwd_payload[11], 65) << "incorrect value for fwd_payload[11], expected 65, is " << last_msg_->fwd_payload[11]; - EXPECT_EQ(last_msg_->fwd_payload[12], 65) << "incorrect value for fwd_payload[12], expected 65, is " << last_msg_->fwd_payload[12]; - EXPECT_EQ(last_msg_->fwd_payload[13], 69) << "incorrect value for fwd_payload[13], expected 69, is " << last_msg_->fwd_payload[13]; - EXPECT_EQ(last_msg_->fwd_payload[14], 97) << "incorrect value for fwd_payload[14], expected 97, is " << last_msg_->fwd_payload[14]; - EXPECT_EQ(last_msg_->fwd_payload[15], 103) << "incorrect value for fwd_payload[15], expected 103, is " << last_msg_->fwd_payload[15]; - EXPECT_EQ(last_msg_->protocol, 0) << "incorrect value for protocol, expected 0, is " << last_msg_->protocol; - EXPECT_EQ(last_msg_->source, 0) << "incorrect value for source, expected 0, is " << last_msg_->source; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->fwd_payload[0], 86) + << "incorrect value for fwd_payload[0], expected 86, is " + << last_msg_->fwd_payload[0]; + EXPECT_EQ(last_msg_->fwd_payload[1], 81) + << "incorrect value for fwd_payload[1], expected 81, is " + << last_msg_->fwd_payload[1]; + EXPECT_EQ(last_msg_->fwd_payload[2], 68) + << "incorrect value for fwd_payload[2], expected 68, is " + << last_msg_->fwd_payload[2]; + EXPECT_EQ(last_msg_->fwd_payload[3], 47) + << "incorrect value for fwd_payload[3], expected 47, is " + << last_msg_->fwd_payload[3]; + EXPECT_EQ(last_msg_->fwd_payload[4], 81) + << "incorrect value for fwd_payload[4], expected 81, is " + << last_msg_->fwd_payload[4]; + EXPECT_EQ(last_msg_->fwd_payload[5], 103) + << "incorrect value for fwd_payload[5], expected 103, is " + << last_msg_->fwd_payload[5]; + EXPECT_EQ(last_msg_->fwd_payload[6], 65) + << "incorrect value for fwd_payload[6], expected 65, is " + << last_msg_->fwd_payload[6]; + EXPECT_EQ(last_msg_->fwd_payload[7], 69) + << "incorrect value for fwd_payload[7], expected 69, is " + << last_msg_->fwd_payload[7]; + EXPECT_EQ(last_msg_->fwd_payload[8], 65) + << "incorrect value for fwd_payload[8], expected 65, is " + << last_msg_->fwd_payload[8]; + EXPECT_EQ(last_msg_->fwd_payload[9], 65) + << "incorrect value for fwd_payload[9], expected 65, is " + << last_msg_->fwd_payload[9]; + EXPECT_EQ(last_msg_->fwd_payload[10], 65) + << "incorrect value for fwd_payload[10], expected 65, is " + << last_msg_->fwd_payload[10]; + EXPECT_EQ(last_msg_->fwd_payload[11], 65) + << "incorrect value for fwd_payload[11], expected 65, is " + << last_msg_->fwd_payload[11]; + EXPECT_EQ(last_msg_->fwd_payload[12], 65) + << "incorrect value for fwd_payload[12], expected 65, is " + << last_msg_->fwd_payload[12]; + EXPECT_EQ(last_msg_->fwd_payload[13], 69) + << "incorrect value for fwd_payload[13], expected 69, is " + << last_msg_->fwd_payload[13]; + EXPECT_EQ(last_msg_->fwd_payload[14], 97) + << "incorrect value for fwd_payload[14], expected 97, is " + << last_msg_->fwd_payload[14]; + EXPECT_EQ(last_msg_->fwd_payload[15], 103) + << "incorrect value for fwd_payload[15], expected 103, is " + << last_msg_->fwd_payload[15]; + EXPECT_EQ(last_msg_->protocol, 0) + << "incorrect value for protocol, expected 0, is " << last_msg_->protocol; + EXPECT_EQ(last_msg_->source, 0) + << "incorrect value for source, expected 0, is " << last_msg_->source; } diff --git a/c/test/legacy/cpp/auto_check_sbp_logging_MsgLog.cc b/c/test/legacy/cpp/auto_check_sbp_logging_MsgLog.cc index 8b26478cc..03079ea3d 100644 --- a/c/test/legacy/cpp/auto_check_sbp_logging_MsgLog.cc +++ b/c/test/legacy/cpp/auto_check_sbp_logging_MsgLog.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/logging/test_MsgLog.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/logging/test_MsgLog.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_logging_MsgLog0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_logging_MsgLog0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_logging_MsgLog0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_logging_MsgLog0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_log_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_log_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,46 +81,68 @@ class Test_legacy_auto_check_sbp_logging_MsgLog0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_log_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_logging_MsgLog0, Test) -{ +}; - uint8_t encoded_frame[] = {85,1,4,10,9,44,6,70,105,108,116,101,114,101,100,32,97,108,108,32,111,98,115,32,102,114,111,109,32,50,51,49,52,32,97,116,32,116,111,119,32,56,51,46,53,51,57,48,49,57,177,163, }; +TEST_F(Test_legacy_auto_check_sbp_logging_MsgLog0, Test) { + uint8_t encoded_frame[] = { + 85, 1, 4, 10, 9, 44, 6, 70, 105, 108, 116, 101, 114, + 101, 100, 32, 97, 108, 108, 32, 111, 98, 115, 32, 102, 114, + 111, 109, 32, 50, 51, 49, 52, 32, 97, 116, 32, 116, 111, + 119, 32, 56, 51, 46, 53, 51, 57, 48, 49, 57, 177, 163, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_log_t* test_msg = ( msg_log_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->level = 6; - { - const char assign_string[] = { (char)70,(char)105,(char)108,(char)116,(char)101,(char)114,(char)101,(char)100,(char)32,(char)97,(char)108,(char)108,(char)32,(char)111,(char)98,(char)115,(char)32,(char)102,(char)114,(char)111,(char)109,(char)32,(char)50,(char)51,(char)49,(char)52,(char)32,(char)97,(char)116,(char)32,(char)116,(char)111,(char)119,(char)32,(char)56,(char)51,(char)46,(char)53,(char)51,(char)57,(char)48,(char)49,(char)57 }; - memcpy(test_msg->text, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->text) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0x0401, 2314, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_log_t *test_msg = (msg_log_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->level = 6; + { + const char assign_string[] = { + (char)70, (char)105, (char)108, (char)116, (char)101, (char)114, + (char)101, (char)100, (char)32, (char)97, (char)108, (char)108, + (char)32, (char)111, (char)98, (char)115, (char)32, (char)102, + (char)114, (char)111, (char)109, (char)32, (char)50, (char)51, + (char)49, (char)52, (char)32, (char)97, (char)116, (char)32, + (char)116, (char)111, (char)119, (char)32, (char)56, (char)51, + (char)46, (char)53, (char)51, (char)57, (char)48, (char)49, + (char)57}; + memcpy(test_msg->text, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->text) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 2314); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->level, 6) << "incorrect value for level, expected 6, is " << last_msg_->level; - { - const char check_string[] = { (char)70,(char)105,(char)108,(char)116,(char)101,(char)114,(char)101,(char)100,(char)32,(char)97,(char)108,(char)108,(char)32,(char)111,(char)98,(char)115,(char)32,(char)102,(char)114,(char)111,(char)109,(char)32,(char)50,(char)51,(char)49,(char)52,(char)32,(char)97,(char)116,(char)32,(char)116,(char)111,(char)119,(char)32,(char)56,(char)51,(char)46,(char)53,(char)51,(char)57,(char)48,(char)49,(char)57 }; - EXPECT_EQ(memcmp(last_msg_->text, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->text, expected string '" << check_string << "', is '" << last_msg_->text << "'"; - } + EXPECT_EQ(send_message(0x0401, 2314, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 2314); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->level, 6) + << "incorrect value for level, expected 6, is " << last_msg_->level; + { + const char check_string[] = { + (char)70, (char)105, (char)108, (char)116, (char)101, (char)114, + (char)101, (char)100, (char)32, (char)97, (char)108, (char)108, + (char)32, (char)111, (char)98, (char)115, (char)32, (char)102, + (char)114, (char)111, (char)109, (char)32, (char)50, (char)51, + (char)49, (char)52, (char)32, (char)97, (char)116, (char)32, + (char)116, (char)111, (char)119, (char)32, (char)56, (char)51, + (char)46, (char)53, (char)51, (char)57, (char)48, (char)49, + (char)57}; + EXPECT_EQ(memcmp(last_msg_->text, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->text, expected string '" + << check_string << "', is '" << last_msg_->text << "'"; + } } diff --git a/c/test/legacy/cpp/auto_check_sbp_logging_MsgPrintDep.cc b/c/test/legacy/cpp/auto_check_sbp_logging_MsgPrintDep.cc index 1e3405868..db6420009 100644 --- a/c/test/legacy/cpp/auto_check_sbp_logging_MsgPrintDep.cc +++ b/c/test/legacy/cpp/auto_check_sbp_logging_MsgPrintDep.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/logging/test_MsgPrintDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/logging/test_MsgPrintDep.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_logging_MsgPrintDep0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_logging_MsgPrintDep0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_logging_MsgPrintDep0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_logging_MsgPrintDep0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_print_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_print_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,95 +81,110 @@ class Test_legacy_auto_check_sbp_logging_MsgPrintDep0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_print_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_logging_MsgPrintDep0, Test) -{ - - uint8_t encoded_frame[] = {85,16,0,34,34,43,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,49,53,32,102,111,117,110,100,32,64,32,45,50,52,57,55,32,72,122,44,32,50,48,32,83,78,82,10,116,103, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_print_dep_t* test_msg = ( msg_print_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)49,(char)53,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)45,(char)50,(char)52,(char)57,(char)55,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)48,(char)32,(char)83,(char)78,(char)82,(char)10 }; - memcpy(test_msg->text, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->text) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0x10, 8738, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_logging_MsgPrintDep0, Test) { + uint8_t encoded_frame[] = { + 85, 16, 0, 34, 34, 43, 73, 78, 70, 79, 58, 32, 97, + 99, 113, 58, 32, 80, 82, 78, 32, 49, 53, 32, 102, 111, + 117, 110, 100, 32, 64, 32, 45, 50, 52, 57, 55, 32, 72, + 122, 44, 32, 50, 48, 32, 83, 78, 82, 10, 116, 103, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_print_dep_t *test_msg = (msg_print_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)49, (char)53, (char)32, + (char)102, (char)111, (char)117, (char)110, (char)100, (char)32, + (char)64, (char)32, (char)45, (char)50, (char)52, (char)57, + (char)55, (char)32, (char)72, (char)122, (char)44, (char)32, + (char)50, (char)48, (char)32, (char)83, (char)78, (char)82, + (char)10}; + memcpy(test_msg->text, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->text) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 8738); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)49,(char)53,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)45,(char)50,(char)52,(char)57,(char)55,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)48,(char)32,(char)83,(char)78,(char)82,(char)10 }; - EXPECT_EQ(memcmp(last_msg_->text, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->text, expected string '" << check_string << "', is '" << last_msg_->text << "'"; - } + EXPECT_EQ(send_message(0x10, 8738, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 8738); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)49, (char)53, (char)32, + (char)102, (char)111, (char)117, (char)110, (char)100, (char)32, + (char)64, (char)32, (char)45, (char)50, (char)52, (char)57, + (char)55, (char)32, (char)72, (char)122, (char)44, (char)32, + (char)50, (char)48, (char)32, (char)83, (char)78, (char)82, + (char)10}; + EXPECT_EQ(memcmp(last_msg_->text, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->text, expected string '" + << check_string << "', is '" << last_msg_->text << "'"; + } } -class Test_legacy_auto_check_sbp_logging_MsgPrintDep1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_logging_MsgPrintDep1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_logging_MsgPrintDep1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_logging_MsgPrintDep1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_print_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_print_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -183,95 +194,107 @@ class Test_legacy_auto_check_sbp_logging_MsgPrintDep1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_print_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_logging_MsgPrintDep1, Test) -{ - - uint8_t encoded_frame[] = {85,16,0,34,34,42,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,51,49,32,102,111,117,110,100,32,64,32,52,50,52,53,32,72,122,44,32,50,49,32,83,78,82,10,140,43, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_print_dep_t* test_msg = ( msg_print_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)51,(char)49,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)52,(char)50,(char)52,(char)53,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)49,(char)32,(char)83,(char)78,(char)82,(char)10 }; - memcpy(test_msg->text, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->text) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0x10, 8738, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_logging_MsgPrintDep1, Test) { + uint8_t encoded_frame[] = { + 85, 16, 0, 34, 34, 42, 73, 78, 70, 79, 58, 32, 97, 99, 113, 58, 32, + 80, 82, 78, 32, 51, 49, 32, 102, 111, 117, 110, 100, 32, 64, 32, 52, 50, + 52, 53, 32, 72, 122, 44, 32, 50, 49, 32, 83, 78, 82, 10, 140, 43, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_print_dep_t *test_msg = (msg_print_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)51, (char)49, (char)32, + (char)102, (char)111, (char)117, (char)110, (char)100, (char)32, + (char)64, (char)32, (char)52, (char)50, (char)52, (char)53, + (char)32, (char)72, (char)122, (char)44, (char)32, (char)50, + (char)49, (char)32, (char)83, (char)78, (char)82, (char)10}; + memcpy(test_msg->text, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->text) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 8738); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)51,(char)49,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)52,(char)50,(char)52,(char)53,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)49,(char)32,(char)83,(char)78,(char)82,(char)10 }; - EXPECT_EQ(memcmp(last_msg_->text, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->text, expected string '" << check_string << "', is '" << last_msg_->text << "'"; - } + EXPECT_EQ(send_message(0x10, 8738, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 8738); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)51, (char)49, (char)32, + (char)102, (char)111, (char)117, (char)110, (char)100, (char)32, + (char)64, (char)32, (char)52, (char)50, (char)52, (char)53, + (char)32, (char)72, (char)122, (char)44, (char)32, (char)50, + (char)49, (char)32, (char)83, (char)78, (char)82, (char)10}; + EXPECT_EQ(memcmp(last_msg_->text, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->text, expected string '" + << check_string << "', is '" << last_msg_->text << "'"; + } } -class Test_legacy_auto_check_sbp_logging_MsgPrintDep2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_logging_MsgPrintDep2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_logging_MsgPrintDep2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_logging_MsgPrintDep2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_print_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_print_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -281,95 +304,105 @@ class Test_legacy_auto_check_sbp_logging_MsgPrintDep2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_print_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_logging_MsgPrintDep2, Test) -{ - - uint8_t encoded_frame[] = {85,16,0,34,34,35,73,78,70,79,58,32,68,105,115,97,98,108,105,110,103,32,99,104,97,110,110,101,108,32,48,32,40,80,82,78,32,49,49,41,10,23,143, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_print_dep_t* test_msg = ( msg_print_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)68,(char)105,(char)115,(char)97,(char)98,(char)108,(char)105,(char)110,(char)103,(char)32,(char)99,(char)104,(char)97,(char)110,(char)110,(char)101,(char)108,(char)32,(char)48,(char)32,(char)40,(char)80,(char)82,(char)78,(char)32,(char)49,(char)49,(char)41,(char)10 }; - memcpy(test_msg->text, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->text) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0x10, 8738, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_logging_MsgPrintDep2, Test) { + uint8_t encoded_frame[] = { + 85, 16, 0, 34, 34, 35, 73, 78, 70, 79, 58, 32, 68, 105, 115, + 97, 98, 108, 105, 110, 103, 32, 99, 104, 97, 110, 110, 101, 108, 32, + 48, 32, 40, 80, 82, 78, 32, 49, 49, 41, 10, 23, 143, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_print_dep_t *test_msg = (msg_print_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)68, (char)105, (char)115, (char)97, (char)98, (char)108, + (char)105, (char)110, (char)103, (char)32, (char)99, (char)104, + (char)97, (char)110, (char)110, (char)101, (char)108, (char)32, + (char)48, (char)32, (char)40, (char)80, (char)82, (char)78, + (char)32, (char)49, (char)49, (char)41, (char)10}; + memcpy(test_msg->text, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->text) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 8738); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)68,(char)105,(char)115,(char)97,(char)98,(char)108,(char)105,(char)110,(char)103,(char)32,(char)99,(char)104,(char)97,(char)110,(char)110,(char)101,(char)108,(char)32,(char)48,(char)32,(char)40,(char)80,(char)82,(char)78,(char)32,(char)49,(char)49,(char)41,(char)10 }; - EXPECT_EQ(memcmp(last_msg_->text, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->text, expected string '" << check_string << "', is '" << last_msg_->text << "'"; - } + EXPECT_EQ(send_message(0x10, 8738, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 8738); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)68, (char)105, (char)115, (char)97, (char)98, (char)108, + (char)105, (char)110, (char)103, (char)32, (char)99, (char)104, + (char)97, (char)110, (char)110, (char)101, (char)108, (char)32, + (char)48, (char)32, (char)40, (char)80, (char)82, (char)78, + (char)32, (char)49, (char)49, (char)41, (char)10}; + EXPECT_EQ(memcmp(last_msg_->text, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->text, expected string '" + << check_string << "', is '" << last_msg_->text << "'"; + } } -class Test_legacy_auto_check_sbp_logging_MsgPrintDep3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_logging_MsgPrintDep3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_logging_MsgPrintDep3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_logging_MsgPrintDep3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_print_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_print_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -379,95 +412,108 @@ class Test_legacy_auto_check_sbp_logging_MsgPrintDep3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_print_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_logging_MsgPrintDep3, Test) -{ - - uint8_t encoded_frame[] = {85,16,0,34,34,41,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,50,32,102,111,117,110,100,32,64,32,51,57,57,54,32,72,122,44,32,50,48,32,83,78,82,10,239,48, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_print_dep_t* test_msg = ( msg_print_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)50,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)51,(char)57,(char)57,(char)54,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)48,(char)32,(char)83,(char)78,(char)82,(char)10 }; - memcpy(test_msg->text, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->text) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0x10, 8738, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_logging_MsgPrintDep3, Test) { + uint8_t encoded_frame[] = { + 85, 16, 0, 34, 34, 41, 73, 78, 70, 79, 58, 32, 97, + 99, 113, 58, 32, 80, 82, 78, 32, 50, 32, 102, 111, 117, + 110, 100, 32, 64, 32, 51, 57, 57, 54, 32, 72, 122, 44, + 32, 50, 48, 32, 83, 78, 82, 10, 239, 48, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_print_dep_t *test_msg = (msg_print_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)50, (char)32, (char)102, + (char)111, (char)117, (char)110, (char)100, (char)32, (char)64, + (char)32, (char)51, (char)57, (char)57, (char)54, (char)32, + (char)72, (char)122, (char)44, (char)32, (char)50, (char)48, + (char)32, (char)83, (char)78, (char)82, (char)10}; + memcpy(test_msg->text, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->text) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 8738); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)50,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)51,(char)57,(char)57,(char)54,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)48,(char)32,(char)83,(char)78,(char)82,(char)10 }; - EXPECT_EQ(memcmp(last_msg_->text, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->text, expected string '" << check_string << "', is '" << last_msg_->text << "'"; - } + EXPECT_EQ(send_message(0x10, 8738, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 8738); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)50, (char)32, (char)102, + (char)111, (char)117, (char)110, (char)100, (char)32, (char)64, + (char)32, (char)51, (char)57, (char)57, (char)54, (char)32, + (char)72, (char)122, (char)44, (char)32, (char)50, (char)48, + (char)32, (char)83, (char)78, (char)82, (char)10}; + EXPECT_EQ(memcmp(last_msg_->text, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->text, expected string '" + << check_string << "', is '" << last_msg_->text << "'"; + } } -class Test_legacy_auto_check_sbp_logging_MsgPrintDep4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_logging_MsgPrintDep4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_logging_MsgPrintDep4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_logging_MsgPrintDep4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_print_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_print_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -477,95 +523,108 @@ class Test_legacy_auto_check_sbp_logging_MsgPrintDep4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_print_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_logging_MsgPrintDep4, Test) -{ - - uint8_t encoded_frame[] = {85,16,0,34,34,42,73,78,70,79,58,32,97,99,113,58,32,80,82,78,32,52,32,102,111,117,110,100,32,64,32,45,55,52,57,50,32,72,122,44,32,50,48,32,83,78,82,10,47,248, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_print_dep_t* test_msg = ( msg_print_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)52,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)45,(char)55,(char)52,(char)57,(char)50,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)48,(char)32,(char)83,(char)78,(char)82,(char)10 }; - memcpy(test_msg->text, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->text) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0x10, 8738, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_logging_MsgPrintDep4, Test) { + uint8_t encoded_frame[] = { + 85, 16, 0, 34, 34, 42, 73, 78, 70, 79, 58, 32, 97, + 99, 113, 58, 32, 80, 82, 78, 32, 52, 32, 102, 111, 117, + 110, 100, 32, 64, 32, 45, 55, 52, 57, 50, 32, 72, 122, + 44, 32, 50, 48, 32, 83, 78, 82, 10, 47, 248, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_print_dep_t *test_msg = (msg_print_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)52, (char)32, (char)102, + (char)111, (char)117, (char)110, (char)100, (char)32, (char)64, + (char)32, (char)45, (char)55, (char)52, (char)57, (char)50, + (char)32, (char)72, (char)122, (char)44, (char)32, (char)50, + (char)48, (char)32, (char)83, (char)78, (char)82, (char)10}; + memcpy(test_msg->text, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->text) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 8738); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)97,(char)99,(char)113,(char)58,(char)32,(char)80,(char)82,(char)78,(char)32,(char)52,(char)32,(char)102,(char)111,(char)117,(char)110,(char)100,(char)32,(char)64,(char)32,(char)45,(char)55,(char)52,(char)57,(char)50,(char)32,(char)72,(char)122,(char)44,(char)32,(char)50,(char)48,(char)32,(char)83,(char)78,(char)82,(char)10 }; - EXPECT_EQ(memcmp(last_msg_->text, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->text, expected string '" << check_string << "', is '" << last_msg_->text << "'"; - } + EXPECT_EQ(send_message(0x10, 8738, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 8738); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)97, (char)99, (char)113, (char)58, (char)32, (char)80, + (char)82, (char)78, (char)32, (char)52, (char)32, (char)102, + (char)111, (char)117, (char)110, (char)100, (char)32, (char)64, + (char)32, (char)45, (char)55, (char)52, (char)57, (char)50, + (char)32, (char)72, (char)122, (char)44, (char)32, (char)50, + (char)48, (char)32, (char)83, (char)78, (char)82, (char)10}; + EXPECT_EQ(memcmp(last_msg_->text, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->text, expected string '" + << check_string << "', is '" << last_msg_->text << "'"; + } } -class Test_legacy_auto_check_sbp_logging_MsgPrintDep5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_logging_MsgPrintDep5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_logging_MsgPrintDep5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_logging_MsgPrintDep5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_print_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_print_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -575,44 +634,60 @@ class Test_legacy_auto_check_sbp_logging_MsgPrintDep5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_print_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_logging_MsgPrintDep5, Test) -{ - - uint8_t encoded_frame[] = {85,16,0,34,34,35,73,78,70,79,58,32,68,105,115,97,98,108,105,110,103,32,99,104,97,110,110,101,108,32,49,32,40,80,82,78,32,49,53,41,10,158,139, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_print_dep_t* test_msg = ( msg_print_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)68,(char)105,(char)115,(char)97,(char)98,(char)108,(char)105,(char)110,(char)103,(char)32,(char)99,(char)104,(char)97,(char)110,(char)110,(char)101,(char)108,(char)32,(char)49,(char)32,(char)40,(char)80,(char)82,(char)78,(char)32,(char)49,(char)53,(char)41,(char)10 }; - memcpy(test_msg->text, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->text) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0x10, 8738, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_logging_MsgPrintDep5, Test) { + uint8_t encoded_frame[] = { + 85, 16, 0, 34, 34, 35, 73, 78, 70, 79, 58, 32, 68, 105, 115, + 97, 98, 108, 105, 110, 103, 32, 99, 104, 97, 110, 110, 101, 108, 32, + 49, 32, 40, 80, 82, 78, 32, 49, 53, 41, 10, 158, 139, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_print_dep_t *test_msg = (msg_print_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)68, (char)105, (char)115, (char)97, (char)98, (char)108, + (char)105, (char)110, (char)103, (char)32, (char)99, (char)104, + (char)97, (char)110, (char)110, (char)101, (char)108, (char)32, + (char)49, (char)32, (char)40, (char)80, (char)82, (char)78, + (char)32, (char)49, (char)53, (char)41, (char)10}; + memcpy(test_msg->text, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->text) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 8738); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)73,(char)78,(char)70,(char)79,(char)58,(char)32,(char)68,(char)105,(char)115,(char)97,(char)98,(char)108,(char)105,(char)110,(char)103,(char)32,(char)99,(char)104,(char)97,(char)110,(char)110,(char)101,(char)108,(char)32,(char)49,(char)32,(char)40,(char)80,(char)82,(char)78,(char)32,(char)49,(char)53,(char)41,(char)10 }; - EXPECT_EQ(memcmp(last_msg_->text, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->text, expected string '" << check_string << "', is '" << last_msg_->text << "'"; - } + EXPECT_EQ(send_message(0x10, 8738, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 8738); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)73, (char)78, (char)70, (char)79, (char)58, (char)32, + (char)68, (char)105, (char)115, (char)97, (char)98, (char)108, + (char)105, (char)110, (char)103, (char)32, (char)99, (char)104, + (char)97, (char)110, (char)110, (char)101, (char)108, (char)32, + (char)49, (char)32, (char)40, (char)80, (char)82, (char)78, + (char)32, (char)49, (char)53, (char)41, (char)10}; + EXPECT_EQ(memcmp(last_msg_->text, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->text, expected string '" + << check_string << "', is '" << last_msg_->text << "'"; + } } diff --git a/c/test/legacy/cpp/auto_check_sbp_mag_MsgMagRaw.cc b/c/test/legacy/cpp/auto_check_sbp_mag_MsgMagRaw.cc index 4a131c0ba..df7b85555 100644 --- a/c/test/legacy/cpp/auto_check_sbp_mag_MsgMagRaw.cc +++ b/c/test/legacy/cpp/auto_check_sbp_mag_MsgMagRaw.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/mag/test_MsgMagRaw.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/mag/test_MsgMagRaw.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_mag_MsgMagRaw0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_mag_MsgMagRaw0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_mag_MsgMagRaw0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_mag_MsgMagRaw0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_mag_raw_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_mag_raw_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,43 +81,49 @@ class Test_legacy_auto_check_sbp_mag_MsgMagRaw0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_mag_raw_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_mag_MsgMagRaw0, Test) -{ +}; - uint8_t encoded_frame[] = {85,2,9,195,4,11,173,227,158,198,206,98,3,230,2,110,229,159,23, }; +TEST_F(Test_legacy_auto_check_sbp_mag_MsgMagRaw0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 9, 195, 4, 11, 173, 227, 158, 198, + 206, 98, 3, 230, 2, 110, 229, 159, 23, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_mag_raw_t* test_msg = ( msg_mag_raw_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->mag_x = 866; - test_msg->mag_y = 742; - test_msg->mag_z = -6802; - test_msg->tow = 3332301741; - test_msg->tow_f = 206; - - EXPECT_EQ(send_message( 0x902, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_mag_raw_t *test_msg = (msg_mag_raw_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->mag_x = 866; + test_msg->mag_y = 742; + test_msg->mag_z = -6802; + test_msg->tow = 3332301741; + test_msg->tow_f = 206; + + EXPECT_EQ(send_message(0x902, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->mag_x, 866) << "incorrect value for mag_x, expected 866, is " << last_msg_->mag_x; - EXPECT_EQ(last_msg_->mag_y, 742) << "incorrect value for mag_y, expected 742, is " << last_msg_->mag_y; - EXPECT_EQ(last_msg_->mag_z, -6802) << "incorrect value for mag_z, expected -6802, is " << last_msg_->mag_z; - EXPECT_EQ(last_msg_->tow, 3332301741) << "incorrect value for tow, expected 3332301741, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->tow_f, 206) << "incorrect value for tow_f, expected 206, is " << last_msg_->tow_f; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->mag_x, 866) + << "incorrect value for mag_x, expected 866, is " << last_msg_->mag_x; + EXPECT_EQ(last_msg_->mag_y, 742) + << "incorrect value for mag_y, expected 742, is " << last_msg_->mag_y; + EXPECT_EQ(last_msg_->mag_z, -6802) + << "incorrect value for mag_z, expected -6802, is " << last_msg_->mag_z; + EXPECT_EQ(last_msg_->tow, 3332301741) + << "incorrect value for tow, expected 3332301741, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->tow_f, 206) + << "incorrect value for tow_f, expected 206, is " << last_msg_->tow_f; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgAgeCorrections.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgAgeCorrections.cc index 11bd20d9a..1100978cd 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgAgeCorrections.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgAgeCorrections.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgAgeCorrections.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgAgeCorrections.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgAgeCorrections0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgAgeCorrections0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgAgeCorrections0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgAgeCorrections0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_age_corrections_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_age_corrections_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,37 +81,39 @@ class Test_legacy_auto_check_sbp_navigation_MsgAgeCorrections0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_age_corrections_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgAgeCorrections0, Test) -{ +}; - uint8_t encoded_frame[] = {85,16,2,66,0,6,100,0,0,0,30,0,233,202, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgAgeCorrections0, Test) { + uint8_t encoded_frame[] = { + 85, 16, 2, 66, 0, 6, 100, 0, 0, 0, 30, 0, 233, 202, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_age_corrections_t* test_msg = ( msg_age_corrections_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->age = 30; - test_msg->tow = 100; - - EXPECT_EQ(send_message( 0x210, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_age_corrections_t *test_msg = (msg_age_corrections_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->age = 30; + test_msg->tow = 100; + + EXPECT_EQ(send_message(0x210, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->age, 30) << "incorrect value for age, expected 30, is " << last_msg_->age; - EXPECT_EQ(last_msg_->tow, 100) << "incorrect value for tow, expected 100, is " << last_msg_->tow; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->age, 30) + << "incorrect value for age, expected 30, is " << last_msg_->age; + EXPECT_EQ(last_msg_->tow, 100) + << "incorrect value for tow, expected 100, is " << last_msg_->tow; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineECEF.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineECEF.cc index a0906b121..813a50430 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineECEF.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineECEF.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEF.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,98 +81,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF0, Test) -{ - - uint8_t encoded_frame[] = {85,11,2,211,136,20,40,244,122,19,150,98,238,255,190,64,20,0,246,163,9,0,0,0,14,0,219,191, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_t* test_msg = ( msg_baseline_ecef_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 14; - test_msg->tow = 326825000; - test_msg->x = -1154410; - test_msg->y = 1327294; - test_msg->z = 631798; - - EXPECT_EQ(send_message( 0x20b, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 14) << "incorrect value for n_sats, expected 14, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326825000) << "incorrect value for tow, expected 326825000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -1154410) << "incorrect value for x, expected -1154410, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, 1327294) << "incorrect value for y, expected 1327294, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 631798) << "incorrect value for z, expected 631798, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF0, Test) { + uint8_t encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 40, 244, 122, 19, 150, 98, 238, 255, + 190, 64, 20, 0, 246, 163, 9, 0, 0, 0, 14, 0, 219, 191, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_t *test_msg = (msg_baseline_ecef_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 14; + test_msg->tow = 326825000; + test_msg->x = -1154410; + test_msg->y = 1327294; + test_msg->z = 631798; + + EXPECT_EQ(send_message(0x20b, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 14) + << "incorrect value for n_sats, expected 14, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326825000) + << "incorrect value for tow, expected 326825000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -1154410) + << "incorrect value for x, expected -1154410, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, 1327294) + << "incorrect value for y, expected 1327294, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 631798) + << "incorrect value for z, expected 631798, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -186,98 +184,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF1, Test) -{ - - uint8_t encoded_frame[] = {85,11,2,211,136,20,16,248,122,19,72,99,238,255,191,65,20,0,138,162,9,0,0,0,15,0,240,78, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_t* test_msg = ( msg_baseline_ecef_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 15; - test_msg->tow = 326826000; - test_msg->x = -1154232; - test_msg->y = 1327551; - test_msg->z = 631434; - - EXPECT_EQ(send_message( 0x20b, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326826000) << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -1154232) << "incorrect value for x, expected -1154232, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, 1327551) << "incorrect value for y, expected 1327551, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 631434) << "incorrect value for z, expected 631434, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF1, Test) { + uint8_t encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 16, 248, 122, 19, 72, 99, 238, 255, + 191, 65, 20, 0, 138, 162, 9, 0, 0, 0, 15, 0, 240, 78, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_t *test_msg = (msg_baseline_ecef_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 15; + test_msg->tow = 326826000; + test_msg->x = -1154232; + test_msg->y = 1327551; + test_msg->z = 631434; + + EXPECT_EQ(send_message(0x20b, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326826000) + << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -1154232) + << "incorrect value for x, expected -1154232, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, 1327551) + << "incorrect value for y, expected 1327551, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 631434) + << "incorrect value for z, expected 631434, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -287,98 +287,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF2, Test) -{ - - uint8_t encoded_frame[] = {85,11,2,211,136,20,248,251,122,19,41,99,238,255,181,65,20,0,148,161,9,0,0,0,15,0,4,132, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_t* test_msg = ( msg_baseline_ecef_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 15; - test_msg->tow = 326827000; - test_msg->x = -1154263; - test_msg->y = 1327541; - test_msg->z = 631188; - - EXPECT_EQ(send_message( 0x20b, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326827000) << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -1154263) << "incorrect value for x, expected -1154263, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, 1327541) << "incorrect value for y, expected 1327541, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 631188) << "incorrect value for z, expected 631188, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF2, Test) { + uint8_t encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 248, 251, 122, 19, 41, 99, 238, 255, + 181, 65, 20, 0, 148, 161, 9, 0, 0, 0, 15, 0, 4, 132, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_t *test_msg = (msg_baseline_ecef_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 15; + test_msg->tow = 326827000; + test_msg->x = -1154263; + test_msg->y = 1327541; + test_msg->z = 631188; + + EXPECT_EQ(send_message(0x20b, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326827000) + << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -1154263) + << "incorrect value for x, expected -1154263, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, 1327541) + << "incorrect value for y, expected 1327541, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 631188) + << "incorrect value for z, expected 631188, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -388,98 +390,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF3, Test) -{ - - uint8_t encoded_frame[] = {85,11,2,211,136,20,224,255,122,19,188,97,238,255,81,64,20,0,65,160,9,0,0,0,15,0,67,94, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_t* test_msg = ( msg_baseline_ecef_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 15; - test_msg->tow = 326828000; - test_msg->x = -1154628; - test_msg->y = 1327185; - test_msg->z = 630849; - - EXPECT_EQ(send_message( 0x20b, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326828000) << "incorrect value for tow, expected 326828000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -1154628) << "incorrect value for x, expected -1154628, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, 1327185) << "incorrect value for y, expected 1327185, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 630849) << "incorrect value for z, expected 630849, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF3, Test) { + uint8_t encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 224, 255, 122, 19, 188, 97, 238, 255, + 81, 64, 20, 0, 65, 160, 9, 0, 0, 0, 15, 0, 67, 94, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_t *test_msg = (msg_baseline_ecef_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 15; + test_msg->tow = 326828000; + test_msg->x = -1154628; + test_msg->y = 1327185; + test_msg->z = 630849; + + EXPECT_EQ(send_message(0x20b, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326828000) + << "incorrect value for tow, expected 326828000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -1154628) + << "incorrect value for x, expected -1154628, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, 1327185) + << "incorrect value for y, expected 1327185, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 630849) + << "incorrect value for z, expected 630849, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -489,47 +493,55 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF4, Test) -{ - - uint8_t encoded_frame[] = {85,11,2,211,136,20,200,3,123,19,189,96,238,255,93,63,20,0,98,159,9,0,0,0,15,0,106,94, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_t* test_msg = ( msg_baseline_ecef_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 15; - test_msg->tow = 326829000; - test_msg->x = -1154883; - test_msg->y = 1326941; - test_msg->z = 630626; - - EXPECT_EQ(send_message( 0x20b, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326829000) << "incorrect value for tow, expected 326829000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -1154883) << "incorrect value for x, expected -1154883, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, 1326941) << "incorrect value for y, expected 1326941, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 630626) << "incorrect value for z, expected 630626, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEF4, Test) { + uint8_t encoded_frame[] = { + 85, 11, 2, 211, 136, 20, 200, 3, 123, 19, 189, 96, 238, 255, + 93, 63, 20, 0, 98, 159, 9, 0, 0, 0, 15, 0, 106, 94, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_t *test_msg = (msg_baseline_ecef_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 15; + test_msg->tow = 326829000; + test_msg->x = -1154883; + test_msg->y = 1326941; + test_msg->z = 630626; + + EXPECT_EQ(send_message(0x20b, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326829000) + << "incorrect value for tow, expected 326829000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -1154883) + << "incorrect value for x, expected -1154883, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, 1326941) + << "incorrect value for y, expected 1326941, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 630626) + << "incorrect value for z, expected 630626, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineECEFDepA.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineECEFDepA.cc index 998f72e7b..88a08cd8f 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineECEFDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineECEFDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEFDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineECEFDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,98 +82,102 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,246,215,20,20,46,39,0,21,48,255,255,52,117,255,255,216,211,254,255,0,0,9,1,50,137, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 1; - test_msg->n_sats = 9; - test_msg->tow = 2567700; - test_msg->x = -53227; - test_msg->y = -35532; - test_msg->z = -76840; - - EXPECT_EQ(send_message( 0x202, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567700) << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -53227) << "incorrect value for x, expected -53227, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -35532) << "incorrect value for y, expected -35532, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, -76840) << "incorrect value for z, expected -76840, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 20, 46, 39, 0, 21, 48, 255, 255, + 52, 117, 255, 255, 216, 211, 254, 255, 0, 0, 9, 1, 50, 137, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_dep_a_t *test_msg = + (msg_baseline_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 1; + test_msg->n_sats = 9; + test_msg->tow = 2567700; + test_msg->x = -53227; + test_msg->y = -35532; + test_msg->z = -76840; + + EXPECT_EQ(send_message(0x202, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567700) + << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -53227) + << "incorrect value for x, expected -53227, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -35532) + << "incorrect value for y, expected -35532, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, -76840) + << "incorrect value for z, expected -76840, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -186,98 +187,102 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,246,215,20,120,46,39,0,58,49,255,255,49,116,255,255,134,211,254,255,0,0,9,1,227,155, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 1; - test_msg->n_sats = 9; - test_msg->tow = 2567800; - test_msg->x = -52934; - test_msg->y = -35791; - test_msg->z = -76922; - - EXPECT_EQ(send_message( 0x202, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567800) << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -52934) << "incorrect value for x, expected -52934, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -35791) << "incorrect value for y, expected -35791, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, -76922) << "incorrect value for z, expected -76922, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 120, 46, 39, 0, 58, 49, 255, 255, + 49, 116, 255, 255, 134, 211, 254, 255, 0, 0, 9, 1, 227, 155, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_dep_a_t *test_msg = + (msg_baseline_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 1; + test_msg->n_sats = 9; + test_msg->tow = 2567800; + test_msg->x = -52934; + test_msg->y = -35791; + test_msg->z = -76922; + + EXPECT_EQ(send_message(0x202, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567800) + << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -52934) + << "incorrect value for x, expected -52934, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -35791) + << "incorrect value for y, expected -35791, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, -76922) + << "incorrect value for z, expected -76922, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -287,98 +292,102 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,246,215,20,220,46,39,0,97,50,255,255,47,115,255,255,52,211,254,255,0,0,9,1,61,126, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 1; - test_msg->n_sats = 9; - test_msg->tow = 2567900; - test_msg->x = -52639; - test_msg->y = -36049; - test_msg->z = -77004; - - EXPECT_EQ(send_message( 0x202, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567900) << "incorrect value for tow, expected 2567900, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -52639) << "incorrect value for x, expected -52639, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -36049) << "incorrect value for y, expected -36049, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, -77004) << "incorrect value for z, expected -77004, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 220, 46, 39, 0, 97, 50, 255, 255, + 47, 115, 255, 255, 52, 211, 254, 255, 0, 0, 9, 1, 61, 126, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_dep_a_t *test_msg = + (msg_baseline_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 1; + test_msg->n_sats = 9; + test_msg->tow = 2567900; + test_msg->x = -52639; + test_msg->y = -36049; + test_msg->z = -77004; + + EXPECT_EQ(send_message(0x202, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567900) + << "incorrect value for tow, expected 2567900, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -52639) + << "incorrect value for x, expected -52639, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -36049) + << "incorrect value for y, expected -36049, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, -77004) + << "incorrect value for z, expected -77004, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -388,98 +397,102 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,246,215,20,64,47,39,0,136,51,255,255,45,114,255,255,228,210,254,255,0,0,9,1,200,79, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 1; - test_msg->n_sats = 9; - test_msg->tow = 2568000; - test_msg->x = -52344; - test_msg->y = -36307; - test_msg->z = -77084; - - EXPECT_EQ(send_message( 0x202, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2568000) << "incorrect value for tow, expected 2568000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -52344) << "incorrect value for x, expected -52344, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -36307) << "incorrect value for y, expected -36307, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, -77084) << "incorrect value for z, expected -77084, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 64, 47, 39, 0, 136, 51, 255, 255, + 45, 114, 255, 255, 228, 210, 254, 255, 0, 0, 9, 1, 200, 79, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_dep_a_t *test_msg = + (msg_baseline_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 1; + test_msg->n_sats = 9; + test_msg->tow = 2568000; + test_msg->x = -52344; + test_msg->y = -36307; + test_msg->z = -77084; + + EXPECT_EQ(send_message(0x202, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2568000) + << "incorrect value for tow, expected 2568000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -52344) + << "incorrect value for x, expected -52344, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -36307) + << "incorrect value for y, expected -36307, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, -77084) + << "incorrect value for z, expected -77084, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -489,98 +502,102 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,246,215,20,164,47,39,0,176,52,255,255,44,113,255,255,149,210,254,255,0,0,9,1,104,24, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 1; - test_msg->n_sats = 9; - test_msg->tow = 2568100; - test_msg->x = -52048; - test_msg->y = -36564; - test_msg->z = -77163; - - EXPECT_EQ(send_message( 0x202, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2568100) << "incorrect value for tow, expected 2568100, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -52048) << "incorrect value for x, expected -52048, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -36564) << "incorrect value for y, expected -36564, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, -77163) << "incorrect value for z, expected -77163, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 246, 215, 20, 164, 47, 39, 0, 176, 52, 255, 255, + 44, 113, 255, 255, 149, 210, 254, 255, 0, 0, 9, 1, 104, 24, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_dep_a_t *test_msg = + (msg_baseline_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 1; + test_msg->n_sats = 9; + test_msg->tow = 2568100; + test_msg->x = -52048; + test_msg->y = -36564; + test_msg->z = -77163; + + EXPECT_EQ(send_message(0x202, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2568100) + << "incorrect value for tow, expected 2568100, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -52048) + << "incorrect value for x, expected -52048, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -36564) + << "incorrect value for y, expected -36564, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, -77163) + << "incorrect value for z, expected -77163, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -590,98 +607,102 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,195,4,20,156,21,69,24,169,231,255,255,102,208,255,255,251,28,0,0,0,0,6,0,146,168, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 6; - test_msg->tow = 407180700; - test_msg->x = -6231; - test_msg->y = -12186; - test_msg->z = 7419; - - EXPECT_EQ(send_message( 0x202, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 6) << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407180700) << "incorrect value for tow, expected 407180700, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -6231) << "incorrect value for x, expected -6231, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -12186) << "incorrect value for y, expected -12186, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 7419) << "incorrect value for z, expected 7419, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 156, 21, 69, 24, 169, 231, 255, 255, + 102, 208, 255, 255, 251, 28, 0, 0, 0, 0, 6, 0, 146, 168, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_dep_a_t *test_msg = + (msg_baseline_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 6; + test_msg->tow = 407180700; + test_msg->x = -6231; + test_msg->y = -12186; + test_msg->z = 7419; + + EXPECT_EQ(send_message(0x202, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 6) + << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407180700) + << "incorrect value for tow, expected 407180700, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -6231) + << "incorrect value for x, expected -6231, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -12186) + << "incorrect value for y, expected -12186, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 7419) + << "incorrect value for z, expected 7419, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA6 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA6() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA6 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA6() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -691,98 +712,102 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA6 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,195,4,20,0,22,69,24,169,231,255,255,103,208,255,255,252,28,0,0,0,0,6,0,34,116, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 6; - test_msg->tow = 407180800; - test_msg->x = -6231; - test_msg->y = -12185; - test_msg->z = 7420; - - EXPECT_EQ(send_message( 0x202, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 6) << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407180800) << "incorrect value for tow, expected 407180800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -6231) << "incorrect value for x, expected -6231, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -12185) << "incorrect value for y, expected -12185, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 7420) << "incorrect value for z, expected 7420, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 0, 22, 69, 24, 169, 231, 255, 255, + 103, 208, 255, 255, 252, 28, 0, 0, 0, 0, 6, 0, 34, 116, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_dep_a_t *test_msg = + (msg_baseline_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 6; + test_msg->tow = 407180800; + test_msg->x = -6231; + test_msg->y = -12185; + test_msg->z = 7420; + + EXPECT_EQ(send_message(0x202, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 6) + << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407180800) + << "incorrect value for tow, expected 407180800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -6231) + << "incorrect value for x, expected -6231, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -12185) + << "incorrect value for y, expected -12185, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 7420) + << "incorrect value for z, expected 7420, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA7 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA7() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA7 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA7() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -792,98 +817,102 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA7 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,195,4,20,100,22,69,24,30,224,255,255,192,183,255,255,239,53,0,0,0,0,6,0,225,15, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 6; - test_msg->tow = 407180900; - test_msg->x = -8162; - test_msg->y = -18496; - test_msg->z = 13807; - - EXPECT_EQ(send_message( 0x202, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 6) << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407180900) << "incorrect value for tow, expected 407180900, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -8162) << "incorrect value for x, expected -8162, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -18496) << "incorrect value for y, expected -18496, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 13807) << "incorrect value for z, expected 13807, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 100, 22, 69, 24, 30, 224, 255, 255, + 192, 183, 255, 255, 239, 53, 0, 0, 0, 0, 6, 0, 225, 15, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_dep_a_t *test_msg = + (msg_baseline_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 6; + test_msg->tow = 407180900; + test_msg->x = -8162; + test_msg->y = -18496; + test_msg->z = 13807; + + EXPECT_EQ(send_message(0x202, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 6) + << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407180900) + << "incorrect value for tow, expected 407180900, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -8162) + << "incorrect value for x, expected -8162, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -18496) + << "incorrect value for y, expected -18496, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 13807) + << "incorrect value for z, expected 13807, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA8 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA8() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA8 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA8() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -893,98 +922,102 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA8 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,195,4,20,200,22,69,24,28,224,255,255,191,183,255,255,242,53,0,0,0,0,6,0,35,100, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 6; - test_msg->tow = 407181000; - test_msg->x = -8164; - test_msg->y = -18497; - test_msg->z = 13810; - - EXPECT_EQ(send_message( 0x202, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 6) << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407181000) << "incorrect value for tow, expected 407181000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -8164) << "incorrect value for x, expected -8164, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -18497) << "incorrect value for y, expected -18497, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 13810) << "incorrect value for z, expected 13810, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 200, 22, 69, 24, 28, 224, 255, 255, + 191, 183, 255, 255, 242, 53, 0, 0, 0, 0, 6, 0, 35, 100, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_dep_a_t *test_msg = + (msg_baseline_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 6; + test_msg->tow = 407181000; + test_msg->x = -8164; + test_msg->y = -18497; + test_msg->z = 13810; + + EXPECT_EQ(send_message(0x202, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 6) + << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407181000) + << "incorrect value for tow, expected 407181000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -8164) + << "incorrect value for x, expected -8164, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -18497) + << "incorrect value for y, expected -18497, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 13810) + << "incorrect value for z, expected 13810, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA9 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA9() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA9 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA9() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -994,98 +1027,102 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA9 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA9, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,195,4,20,44,23,69,24,24,227,255,255,25,195,255,255,153,59,0,0,0,0,6,0,66,66, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 6; - test_msg->tow = 407181100; - test_msg->x = -7400; - test_msg->y = -15591; - test_msg->z = 15257; - - EXPECT_EQ(send_message( 0x202, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 6) << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407181100) << "incorrect value for tow, expected 407181100, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -7400) << "incorrect value for x, expected -7400, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -15591) << "incorrect value for y, expected -15591, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 15257) << "incorrect value for z, expected 15257, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA9, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 44, 23, 69, 24, 24, 227, 255, 255, + 25, 195, 255, 255, 153, 59, 0, 0, 0, 0, 6, 0, 66, 66, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_dep_a_t *test_msg = + (msg_baseline_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 6; + test_msg->tow = 407181100; + test_msg->x = -7400; + test_msg->y = -15591; + test_msg->z = 15257; + + EXPECT_EQ(send_message(0x202, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 6) + << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407181100) + << "incorrect value for tow, expected 407181100, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -7400) + << "incorrect value for x, expected -7400, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -15591) + << "incorrect value for y, expected -15591, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 15257) + << "incorrect value for z, expected 15257, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA10 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA10() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA10 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA10() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -1095,47 +1132,56 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA10 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA10, Test) -{ - - uint8_t encoded_frame[] = {85,2,2,195,4,20,144,23,69,24,23,227,255,255,25,195,255,255,153,59,0,0,0,0,6,0,35,135, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ecef_dep_a_t* test_msg = ( msg_baseline_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 6; - test_msg->tow = 407181200; - test_msg->x = -7401; - test_msg->y = -15591; - test_msg->z = 15257; - - EXPECT_EQ(send_message( 0x202, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 6) << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407181200) << "incorrect value for tow, expected 407181200, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -7401) << "incorrect value for x, expected -7401, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -15591) << "incorrect value for y, expected -15591, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 15257) << "incorrect value for z, expected 15257, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineECEFDepA10, Test) { + uint8_t encoded_frame[] = { + 85, 2, 2, 195, 4, 20, 144, 23, 69, 24, 23, 227, 255, 255, + 25, 195, 255, 255, 153, 59, 0, 0, 0, 0, 6, 0, 35, 135, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ecef_dep_a_t *test_msg = + (msg_baseline_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 6; + test_msg->tow = 407181200; + test_msg->x = -7401; + test_msg->y = -15591; + test_msg->z = 15257; + + EXPECT_EQ(send_message(0x202, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 6) + << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407181200) + << "incorrect value for tow, expected 407181200, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -7401) + << "incorrect value for x, expected -7401, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -15591) + << "incorrect value for y, expected -15591, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 15257) + << "incorrect value for z, expected 15257, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineHeadingDepA.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineHeadingDepA.cc index 14dd17074..a455717df 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineHeadingDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineHeadingDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineHeadingDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineHeadingDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_heading_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_heading_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,41 +82,48 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_heading_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,7,2,124,206,10,82,109,88,176,68,14,82,203,186,58,173,182, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineHeadingDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 7, 2, 124, 206, 10, 82, 109, 88, + 176, 68, 14, 82, 203, 186, 58, 173, 182, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_heading_dep_a_t* test_msg = ( msg_baseline_heading_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 58; - test_msg->heading = 3411152452; - test_msg->n_sats = 186; - test_msg->tow = 2958585170; - - EXPECT_EQ(send_message( 0x207, 52860, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_heading_dep_a_t *test_msg = + (msg_baseline_heading_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 58; + test_msg->heading = 3411152452; + test_msg->n_sats = 186; + test_msg->tow = 2958585170; + + EXPECT_EQ(send_message(0x207, 52860, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 52860); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 58) << "incorrect value for flags, expected 58, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->heading, 3411152452) << "incorrect value for heading, expected 3411152452, is " << last_msg_->heading; - EXPECT_EQ(last_msg_->n_sats, 186) << "incorrect value for n_sats, expected 186, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2958585170) << "incorrect value for tow, expected 2958585170, is " << last_msg_->tow; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 52860); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 58) + << "incorrect value for flags, expected 58, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->heading, 3411152452) + << "incorrect value for heading, expected 3411152452, is " + << last_msg_->heading; + EXPECT_EQ(last_msg_->n_sats, 186) + << "incorrect value for n_sats, expected 186, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2958585170) + << "incorrect value for tow, expected 2958585170, is " << last_msg_->tow; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineNED.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineNED.cc index 2604909cf..2749bbee6 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineNED.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineNED.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNED.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNED.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNED0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNED0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNED0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNED0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,100 +81,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNED0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNED0, Test) -{ - - uint8_t encoded_frame[] = {85,12,2,211,136,22,40,244,122,19,201,115,12,0,179,88,230,255,153,125,0,0,0,0,0,0,14,0,226,70, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_t* test_msg = ( msg_baseline_ned_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 32153; - test_msg->e = -1681229; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = 816073; - test_msg->n_sats = 14; - test_msg->tow = 326825000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x20c, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 32153) << "incorrect value for d, expected 32153, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -1681229) << "incorrect value for e, expected -1681229, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, 816073) << "incorrect value for n, expected 816073, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 14) << "incorrect value for n_sats, expected 14, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326825000) << "incorrect value for tow, expected 326825000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNED0, Test) { + uint8_t encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 40, 244, 122, 19, 201, 115, 12, 0, 179, + 88, 230, 255, 153, 125, 0, 0, 0, 0, 0, 0, 14, 0, 226, 70, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_t *test_msg = (msg_baseline_ned_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 32153; + test_msg->e = -1681229; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = 816073; + test_msg->n_sats = 14; + test_msg->tow = 326825000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x20c, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 32153) + << "incorrect value for d, expected 32153, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -1681229) + << "incorrect value for e, expected -1681229, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, 816073) + << "incorrect value for n, expected 816073, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 14) + << "incorrect value for n_sats, expected 14, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326825000) + << "incorrect value for tow, expected 326825000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNED1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNED1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNED1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNED1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -188,100 +189,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNED1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNED1, Test) -{ - - uint8_t encoded_frame[] = {85,12,2,211,136,22,16,248,122,19,98,115,12,0,194,88,230,255,110,127,0,0,0,0,0,0,15,0,69,93, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_t* test_msg = ( msg_baseline_ned_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 32622; - test_msg->e = -1681214; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = 815970; - test_msg->n_sats = 15; - test_msg->tow = 326826000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x20c, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 32622) << "incorrect value for d, expected 32622, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -1681214) << "incorrect value for e, expected -1681214, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, 815970) << "incorrect value for n, expected 815970, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326826000) << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNED1, Test) { + uint8_t encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 16, 248, 122, 19, 98, 115, 12, 0, 194, + 88, 230, 255, 110, 127, 0, 0, 0, 0, 0, 0, 15, 0, 69, 93, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_t *test_msg = (msg_baseline_ned_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 32622; + test_msg->e = -1681214; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = 815970; + test_msg->n_sats = 15; + test_msg->tow = 326826000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x20c, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 32622) + << "incorrect value for d, expected 32622, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -1681214) + << "incorrect value for e, expected -1681214, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, 815970) + << "incorrect value for n, expected 815970, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326826000) + << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNED2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNED2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNED2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNED2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -291,100 +297,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNED2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNED2, Test) -{ - - uint8_t encoded_frame[] = {85,12,2,211,136,22,248,251,122,19,143,114,12,0,173,88,230,255,238,127,0,0,0,0,0,0,15,0,210,169, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_t* test_msg = ( msg_baseline_ned_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 32750; - test_msg->e = -1681235; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = 815759; - test_msg->n_sats = 15; - test_msg->tow = 326827000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x20c, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 32750) << "incorrect value for d, expected 32750, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -1681235) << "incorrect value for e, expected -1681235, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, 815759) << "incorrect value for n, expected 815759, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326827000) << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNED2, Test) { + uint8_t encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 248, 251, 122, 19, 143, 114, 12, 0, 173, + 88, 230, 255, 238, 127, 0, 0, 0, 0, 0, 0, 15, 0, 210, 169, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_t *test_msg = (msg_baseline_ned_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 32750; + test_msg->e = -1681235; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = 815759; + test_msg->n_sats = 15; + test_msg->tow = 326827000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x20c, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 32750) + << "incorrect value for d, expected 32750, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -1681235) + << "incorrect value for e, expected -1681235, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, 815759) + << "incorrect value for n, expected 815759, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326827000) + << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNED3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNED3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNED3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNED3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -394,100 +405,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNED3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNED3, Test) -{ - - uint8_t encoded_frame[] = {85,12,2,211,136,22,224,255,122,19,86,112,12,0,51,88,230,255,47,127,0,0,0,0,0,0,15,0,135,107, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_t* test_msg = ( msg_baseline_ned_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 32559; - test_msg->e = -1681357; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = 815190; - test_msg->n_sats = 15; - test_msg->tow = 326828000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x20c, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 32559) << "incorrect value for d, expected 32559, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -1681357) << "incorrect value for e, expected -1681357, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, 815190) << "incorrect value for n, expected 815190, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326828000) << "incorrect value for tow, expected 326828000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNED3, Test) { + uint8_t encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 224, 255, 122, 19, 86, 112, 12, 0, 51, + 88, 230, 255, 47, 127, 0, 0, 0, 0, 0, 0, 15, 0, 135, 107, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_t *test_msg = (msg_baseline_ned_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 32559; + test_msg->e = -1681357; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = 815190; + test_msg->n_sats = 15; + test_msg->tow = 326828000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x20c, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 32559) + << "incorrect value for d, expected 32559, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -1681357) + << "incorrect value for e, expected -1681357, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, 815190) + << "incorrect value for n, expected 815190, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326828000) + << "incorrect value for tow, expected 326828000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNED4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNED4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNED4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNED4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -497,49 +513,60 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNED4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNED4, Test) -{ - - uint8_t encoded_frame[] = {85,12,2,211,136,22,200,3,123,19,214,110,12,0,220,87,230,255,165,126,0,0,0,0,0,0,15,0,190,80, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_t* test_msg = ( msg_baseline_ned_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 32421; - test_msg->e = -1681444; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = 814806; - test_msg->n_sats = 15; - test_msg->tow = 326829000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x20c, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 32421) << "incorrect value for d, expected 32421, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -1681444) << "incorrect value for e, expected -1681444, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, 814806) << "incorrect value for n, expected 814806, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326829000) << "incorrect value for tow, expected 326829000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNED4, Test) { + uint8_t encoded_frame[] = { + 85, 12, 2, 211, 136, 22, 200, 3, 123, 19, 214, 110, 12, 0, 220, + 87, 230, 255, 165, 126, 0, 0, 0, 0, 0, 0, 15, 0, 190, 80, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_t *test_msg = (msg_baseline_ned_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 32421; + test_msg->e = -1681444; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = 814806; + test_msg->n_sats = 15; + test_msg->tow = 326829000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x20c, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 32421) + << "incorrect value for d, expected 32421, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -1681444) + << "incorrect value for e, expected -1681444, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, 814806) + << "incorrect value for n, expected 814806, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326829000) + << "incorrect value for tow, expected 326829000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineNEDDepA.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineNEDDepA.cc index c4d6f9c37..600742c12 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineNEDDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgBaselineNEDDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNEDDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgBaselineNEDDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,100 +82,107 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,246,215,22,20,46,39,0,243,134,254,255,234,153,255,255,0,0,0,0,0,0,0,0,9,1,93,193, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 0; - test_msg->e = -26134; - test_msg->flags = 1; - test_msg->h_accuracy = 0; - test_msg->n = -96525; - test_msg->n_sats = 9; - test_msg->tow = 2567700; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x203, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 0) << "incorrect value for d, expected 0, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -26134) << "incorrect value for e, expected -26134, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -96525) << "incorrect value for n, expected -96525, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567700) << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 20, 46, 39, 0, 243, 134, 254, 255, 234, + 153, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 93, 193, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_dep_a_t *test_msg = + (msg_baseline_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 0; + test_msg->e = -26134; + test_msg->flags = 1; + test_msg->h_accuracy = 0; + test_msg->n = -96525; + test_msg->n_sats = 9; + test_msg->tow = 2567700; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x203, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 0) + << "incorrect value for d, expected 0, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -26134) + << "incorrect value for e, expected -26134, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -96525) + << "incorrect value for n, expected -96525, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567700) + << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -188,100 +192,107 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,246,215,22,120,46,39,0,139,134,254,255,109,155,255,255,0,0,0,0,0,0,0,0,9,1,38,39, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 0; - test_msg->e = -25747; - test_msg->flags = 1; - test_msg->h_accuracy = 0; - test_msg->n = -96629; - test_msg->n_sats = 9; - test_msg->tow = 2567800; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x203, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 0) << "incorrect value for d, expected 0, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -25747) << "incorrect value for e, expected -25747, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -96629) << "incorrect value for n, expected -96629, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567800) << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 120, 46, 39, 0, 139, 134, 254, 255, 109, + 155, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 38, 39, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_dep_a_t *test_msg = + (msg_baseline_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 0; + test_msg->e = -25747; + test_msg->flags = 1; + test_msg->h_accuracy = 0; + test_msg->n = -96629; + test_msg->n_sats = 9; + test_msg->tow = 2567800; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x203, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 0) + << "incorrect value for d, expected 0, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -25747) + << "incorrect value for e, expected -25747, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -96629) + << "incorrect value for n, expected -96629, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567800) + << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -291,100 +302,107 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,246,215,22,220,46,39,0,37,134,254,255,240,156,255,255,0,0,0,0,0,0,0,0,9,1,58,133, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 0; - test_msg->e = -25360; - test_msg->flags = 1; - test_msg->h_accuracy = 0; - test_msg->n = -96731; - test_msg->n_sats = 9; - test_msg->tow = 2567900; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x203, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 0) << "incorrect value for d, expected 0, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -25360) << "incorrect value for e, expected -25360, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -96731) << "incorrect value for n, expected -96731, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567900) << "incorrect value for tow, expected 2567900, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 220, 46, 39, 0, 37, 134, 254, 255, 240, + 156, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 58, 133, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_dep_a_t *test_msg = + (msg_baseline_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 0; + test_msg->e = -25360; + test_msg->flags = 1; + test_msg->h_accuracy = 0; + test_msg->n = -96731; + test_msg->n_sats = 9; + test_msg->tow = 2567900; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x203, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 0) + << "incorrect value for d, expected 0, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -25360) + << "incorrect value for e, expected -25360, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -96731) + << "incorrect value for n, expected -96731, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567900) + << "incorrect value for tow, expected 2567900, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -394,100 +412,107 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,246,215,22,64,47,39,0,193,133,254,255,115,158,255,255,0,0,0,0,0,0,0,0,9,1,56,214, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 0; - test_msg->e = -24973; - test_msg->flags = 1; - test_msg->h_accuracy = 0; - test_msg->n = -96831; - test_msg->n_sats = 9; - test_msg->tow = 2568000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x203, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 0) << "incorrect value for d, expected 0, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -24973) << "incorrect value for e, expected -24973, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -96831) << "incorrect value for n, expected -96831, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2568000) << "incorrect value for tow, expected 2568000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 64, 47, 39, 0, 193, 133, 254, 255, 115, + 158, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 56, 214, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_dep_a_t *test_msg = + (msg_baseline_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 0; + test_msg->e = -24973; + test_msg->flags = 1; + test_msg->h_accuracy = 0; + test_msg->n = -96831; + test_msg->n_sats = 9; + test_msg->tow = 2568000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x203, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 0) + << "incorrect value for d, expected 0, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -24973) + << "incorrect value for e, expected -24973, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -96831) + << "incorrect value for n, expected -96831, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2568000) + << "incorrect value for tow, expected 2568000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -497,100 +522,107 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,246,215,22,164,47,39,0,93,133,254,255,246,159,255,255,0,0,0,0,0,0,0,0,9,1,234,244, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 0; - test_msg->e = -24586; - test_msg->flags = 1; - test_msg->h_accuracy = 0; - test_msg->n = -96931; - test_msg->n_sats = 9; - test_msg->tow = 2568100; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x203, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 0) << "incorrect value for d, expected 0, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -24586) << "incorrect value for e, expected -24586, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -96931) << "incorrect value for n, expected -96931, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2568100) << "incorrect value for tow, expected 2568100, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 246, 215, 22, 164, 47, 39, 0, 93, 133, 254, 255, 246, + 159, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 234, 244, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_dep_a_t *test_msg = + (msg_baseline_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 0; + test_msg->e = -24586; + test_msg->flags = 1; + test_msg->h_accuracy = 0; + test_msg->n = -96931; + test_msg->n_sats = 9; + test_msg->tow = 2568100; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x203, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 0) + << "incorrect value for d, expected 0, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -24586) + << "incorrect value for e, expected -24586, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -96931) + << "incorrect value for n, expected -96931, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2568100) + << "incorrect value for tow, expected 2568100, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -600,100 +632,107 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,195,4,22,156,21,69,24,130,246,255,255,241,4,0,0,35,196,255,255,0,0,0,0,6,0,250,21, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -15325; - test_msg->e = 1265; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = -2430; - test_msg->n_sats = 6; - test_msg->tow = 407180700; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x203, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -15325) << "incorrect value for d, expected -15325, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 1265) << "incorrect value for e, expected 1265, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -2430) << "incorrect value for n, expected -2430, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 6) << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407180700) << "incorrect value for tow, expected 407180700, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 156, 21, 69, 24, 130, 246, 255, 255, 241, + 4, 0, 0, 35, 196, 255, 255, 0, 0, 0, 0, 6, 0, 250, 21, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_dep_a_t *test_msg = + (msg_baseline_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -15325; + test_msg->e = 1265; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = -2430; + test_msg->n_sats = 6; + test_msg->tow = 407180700; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x203, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -15325) + << "incorrect value for d, expected -15325, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 1265) + << "incorrect value for e, expected 1265, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -2430) + << "incorrect value for n, expected -2430, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 6) + << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407180700) + << "incorrect value for tow, expected 407180700, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA6 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA6() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA6 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA6() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -703,100 +742,107 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA6 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,195,4,22,0,22,69,24,130,246,255,255,241,4,0,0,35,196,255,255,0,0,0,0,6,0,240,133, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -15325; - test_msg->e = 1265; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = -2430; - test_msg->n_sats = 6; - test_msg->tow = 407180800; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x203, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -15325) << "incorrect value for d, expected -15325, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 1265) << "incorrect value for e, expected 1265, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -2430) << "incorrect value for n, expected -2430, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 6) << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407180800) << "incorrect value for tow, expected 407180800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 0, 22, 69, 24, 130, 246, 255, 255, 241, + 4, 0, 0, 35, 196, 255, 255, 0, 0, 0, 0, 6, 0, 240, 133, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_dep_a_t *test_msg = + (msg_baseline_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -15325; + test_msg->e = 1265; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = -2430; + test_msg->n_sats = 6; + test_msg->tow = 407180800; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x203, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -15325) + << "incorrect value for d, expected -15325, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 1265) + << "incorrect value for e, expected 1265, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -2430) + << "incorrect value for n, expected -2430, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 6) + << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407180800) + << "incorrect value for tow, expected 407180800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA7 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA7() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA7 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA7() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -806,100 +852,107 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA7 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,195,4,22,100,22,69,24,32,251,255,255,199,11,0,0,57,161,255,255,0,0,0,0,6,0,12,181, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -24263; - test_msg->e = 3015; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = -1248; - test_msg->n_sats = 6; - test_msg->tow = 407180900; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x203, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -24263) << "incorrect value for d, expected -24263, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 3015) << "incorrect value for e, expected 3015, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -1248) << "incorrect value for n, expected -1248, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 6) << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407180900) << "incorrect value for tow, expected 407180900, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 100, 22, 69, 24, 32, 251, 255, 255, 199, + 11, 0, 0, 57, 161, 255, 255, 0, 0, 0, 0, 6, 0, 12, 181, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_dep_a_t *test_msg = + (msg_baseline_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -24263; + test_msg->e = 3015; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = -1248; + test_msg->n_sats = 6; + test_msg->tow = 407180900; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x203, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -24263) + << "incorrect value for d, expected -24263, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 3015) + << "incorrect value for e, expected 3015, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -1248) + << "incorrect value for n, expected -1248, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 6) + << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407180900) + << "incorrect value for tow, expected 407180900, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA8 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA8() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA8 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA8() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -909,100 +962,107 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA8 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,195,4,22,200,22,69,24,33,251,255,255,199,11,0,0,54,161,255,255,0,0,0,0,6,0,86,58, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -24266; - test_msg->e = 3015; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = -1247; - test_msg->n_sats = 6; - test_msg->tow = 407181000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x203, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -24266) << "incorrect value for d, expected -24266, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 3015) << "incorrect value for e, expected 3015, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -1247) << "incorrect value for n, expected -1247, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 6) << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407181000) << "incorrect value for tow, expected 407181000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 200, 22, 69, 24, 33, 251, 255, 255, 199, + 11, 0, 0, 54, 161, 255, 255, 0, 0, 0, 0, 6, 0, 86, 58, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_dep_a_t *test_msg = + (msg_baseline_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -24266; + test_msg->e = 3015; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = -1247; + test_msg->n_sats = 6; + test_msg->tow = 407181000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x203, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -24266) + << "incorrect value for d, expected -24266, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 3015) + << "incorrect value for e, expected 3015, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -1247) + << "incorrect value for n, expected -1247, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 6) + << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407181000) + << "incorrect value for tow, expected 407181000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA9 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA9() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA9 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA9() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -1012,100 +1072,107 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA9 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA9, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,195,4,22,44,23,69,24,110,6,0,0,55,8,0,0,160,166,255,255,0,0,0,0,6,0,51,249, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -22880; - test_msg->e = 2103; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = 1646; - test_msg->n_sats = 6; - test_msg->tow = 407181100; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x203, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -22880) << "incorrect value for d, expected -22880, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 2103) << "incorrect value for e, expected 2103, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, 1646) << "incorrect value for n, expected 1646, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 6) << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407181100) << "incorrect value for tow, expected 407181100, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA9, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 44, 23, 69, 24, 110, 6, 0, 0, 55, + 8, 0, 0, 160, 166, 255, 255, 0, 0, 0, 0, 6, 0, 51, 249, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_dep_a_t *test_msg = + (msg_baseline_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -22880; + test_msg->e = 2103; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = 1646; + test_msg->n_sats = 6; + test_msg->tow = 407181100; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x203, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -22880) + << "incorrect value for d, expected -22880, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 2103) + << "incorrect value for e, expected 2103, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, 1646) + << "incorrect value for n, expected 1646, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 6) + << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407181100) + << "incorrect value for tow, expected 407181100, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA10 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA10() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA10 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA10() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -1115,49 +1182,61 @@ class Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA10 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA10, Test) -{ - - uint8_t encoded_frame[] = {85,3,2,195,4,22,144,23,69,24,110,6,0,0,54,8,0,0,160,166,255,255,0,0,0,0,6,0,206,22, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_ned_dep_a_t* test_msg = ( msg_baseline_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -22880; - test_msg->e = 2102; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = 1646; - test_msg->n_sats = 6; - test_msg->tow = 407181200; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x203, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -22880) << "incorrect value for d, expected -22880, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 2102) << "incorrect value for e, expected 2102, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, 1646) << "incorrect value for n, expected 1646, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 6) << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407181200) << "incorrect value for tow, expected 407181200, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgBaselineNEDDepA10, Test) { + uint8_t encoded_frame[] = { + 85, 3, 2, 195, 4, 22, 144, 23, 69, 24, 110, 6, 0, 0, 54, + 8, 0, 0, 160, 166, 255, 255, 0, 0, 0, 0, 6, 0, 206, 22, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_ned_dep_a_t *test_msg = + (msg_baseline_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -22880; + test_msg->e = 2102; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = 1646; + test_msg->n_sats = 6; + test_msg->tow = 407181200; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x203, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -22880) + << "incorrect value for d, expected -22880, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 2102) + << "incorrect value for e, expected 2102, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, 1646) + << "incorrect value for n, expected 1646, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 6) + << "incorrect value for n_sats, expected 6, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407181200) + << "incorrect value for tow, expected 407181200, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgDops.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgDops.cc index 18952ac4b..696c60d65 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgDops.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgDops.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDops.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDops.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgDops0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgDops0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgDops0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgDops0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_dops_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_dops_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,47 +81,55 @@ class Test_legacy_auto_check_sbp_navigation_MsgDops0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_dops_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDops0, Test) -{ +}; - uint8_t encoded_frame[] = {85,8,2,66,0,15,100,0,0,0,2,0,6,0,5,0,5,0,5,0,0,244,4, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDops0, Test) { + uint8_t encoded_frame[] = { + 85, 8, 2, 66, 0, 15, 100, 0, 0, 0, 2, 0, + 6, 0, 5, 0, 5, 0, 5, 0, 0, 244, 4, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_dops_t* test_msg = ( msg_dops_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->gdop = 2; - test_msg->hdop = 5; - test_msg->pdop = 6; - test_msg->tdop = 5; - test_msg->tow = 100; - test_msg->vdop = 5; - - EXPECT_EQ(send_message( 0x208, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_dops_t *test_msg = (msg_dops_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->gdop = 2; + test_msg->hdop = 5; + test_msg->pdop = 6; + test_msg->tdop = 5; + test_msg->tow = 100; + test_msg->vdop = 5; + + EXPECT_EQ(send_message(0x208, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->gdop, 2) << "incorrect value for gdop, expected 2, is " << last_msg_->gdop; - EXPECT_EQ(last_msg_->hdop, 5) << "incorrect value for hdop, expected 5, is " << last_msg_->hdop; - EXPECT_EQ(last_msg_->pdop, 6) << "incorrect value for pdop, expected 6, is " << last_msg_->pdop; - EXPECT_EQ(last_msg_->tdop, 5) << "incorrect value for tdop, expected 5, is " << last_msg_->tdop; - EXPECT_EQ(last_msg_->tow, 100) << "incorrect value for tow, expected 100, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->vdop, 5) << "incorrect value for vdop, expected 5, is " << last_msg_->vdop; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->gdop, 2) + << "incorrect value for gdop, expected 2, is " << last_msg_->gdop; + EXPECT_EQ(last_msg_->hdop, 5) + << "incorrect value for hdop, expected 5, is " << last_msg_->hdop; + EXPECT_EQ(last_msg_->pdop, 6) + << "incorrect value for pdop, expected 6, is " << last_msg_->pdop; + EXPECT_EQ(last_msg_->tdop, 5) + << "incorrect value for tdop, expected 5, is " << last_msg_->tdop; + EXPECT_EQ(last_msg_->tow, 100) + << "incorrect value for tow, expected 100, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->vdop, 5) + << "incorrect value for vdop, expected 5, is " << last_msg_->vdop; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgDopsDepA.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgDopsDepA.cc index 5b0024b40..f862d8014 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgDopsDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgDopsDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDopsDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgDopsDepA.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgDopsDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgDopsDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_dops_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,96 +81,97 @@ class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_dops_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,246,215,14,8,48,39,0,180,0,190,0,170,0,160,0,150,0,121,170, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->gdop = 180; - test_msg->hdop = 160; - test_msg->pdop = 190; - test_msg->tdop = 170; - test_msg->tow = 2568200; - test_msg->vdop = 150; - - EXPECT_EQ(send_message( 0x206, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->gdop, 180) << "incorrect value for gdop, expected 180, is " << last_msg_->gdop; - EXPECT_EQ(last_msg_->hdop, 160) << "incorrect value for hdop, expected 160, is " << last_msg_->hdop; - EXPECT_EQ(last_msg_->pdop, 190) << "incorrect value for pdop, expected 190, is " << last_msg_->pdop; - EXPECT_EQ(last_msg_->tdop, 170) << "incorrect value for tdop, expected 170, is " << last_msg_->tdop; - EXPECT_EQ(last_msg_->tow, 2568200) << "incorrect value for tow, expected 2568200, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->vdop, 150) << "incorrect value for vdop, expected 150, is " << last_msg_->vdop; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 246, 215, 14, 8, 48, 39, 0, 180, + 0, 190, 0, 170, 0, 160, 0, 150, 0, 121, 170, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_dops_dep_a_t *test_msg = (msg_dops_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->gdop = 180; + test_msg->hdop = 160; + test_msg->pdop = 190; + test_msg->tdop = 170; + test_msg->tow = 2568200; + test_msg->vdop = 150; + + EXPECT_EQ(send_message(0x206, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->gdop, 180) + << "incorrect value for gdop, expected 180, is " << last_msg_->gdop; + EXPECT_EQ(last_msg_->hdop, 160) + << "incorrect value for hdop, expected 160, is " << last_msg_->hdop; + EXPECT_EQ(last_msg_->pdop, 190) + << "incorrect value for pdop, expected 190, is " << last_msg_->pdop; + EXPECT_EQ(last_msg_->tdop, 170) + << "incorrect value for tdop, expected 170, is " << last_msg_->tdop; + EXPECT_EQ(last_msg_->tow, 2568200) + << "incorrect value for tow, expected 2568200, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->vdop, 150) + << "incorrect value for vdop, expected 150, is " << last_msg_->vdop; } -class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgDopsDepA1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgDopsDepA1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_dops_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -184,96 +181,97 @@ class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_dops_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,246,215,14,240,51,39,0,180,0,190,0,170,0,160,0,150,0,78,169, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->gdop = 180; - test_msg->hdop = 160; - test_msg->pdop = 190; - test_msg->tdop = 170; - test_msg->tow = 2569200; - test_msg->vdop = 150; - - EXPECT_EQ(send_message( 0x206, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->gdop, 180) << "incorrect value for gdop, expected 180, is " << last_msg_->gdop; - EXPECT_EQ(last_msg_->hdop, 160) << "incorrect value for hdop, expected 160, is " << last_msg_->hdop; - EXPECT_EQ(last_msg_->pdop, 190) << "incorrect value for pdop, expected 190, is " << last_msg_->pdop; - EXPECT_EQ(last_msg_->tdop, 170) << "incorrect value for tdop, expected 170, is " << last_msg_->tdop; - EXPECT_EQ(last_msg_->tow, 2569200) << "incorrect value for tow, expected 2569200, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->vdop, 150) << "incorrect value for vdop, expected 150, is " << last_msg_->vdop; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 246, 215, 14, 240, 51, 39, 0, 180, + 0, 190, 0, 170, 0, 160, 0, 150, 0, 78, 169, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_dops_dep_a_t *test_msg = (msg_dops_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->gdop = 180; + test_msg->hdop = 160; + test_msg->pdop = 190; + test_msg->tdop = 170; + test_msg->tow = 2569200; + test_msg->vdop = 150; + + EXPECT_EQ(send_message(0x206, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->gdop, 180) + << "incorrect value for gdop, expected 180, is " << last_msg_->gdop; + EXPECT_EQ(last_msg_->hdop, 160) + << "incorrect value for hdop, expected 160, is " << last_msg_->hdop; + EXPECT_EQ(last_msg_->pdop, 190) + << "incorrect value for pdop, expected 190, is " << last_msg_->pdop; + EXPECT_EQ(last_msg_->tdop, 170) + << "incorrect value for tdop, expected 170, is " << last_msg_->tdop; + EXPECT_EQ(last_msg_->tow, 2569200) + << "incorrect value for tow, expected 2569200, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->vdop, 150) + << "incorrect value for vdop, expected 150, is " << last_msg_->vdop; } -class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgDopsDepA2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgDopsDepA2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_dops_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -283,96 +281,97 @@ class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_dops_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,246,215,14,216,55,39,0,180,0,190,0,170,0,160,0,150,0,71,218, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->gdop = 180; - test_msg->hdop = 160; - test_msg->pdop = 190; - test_msg->tdop = 170; - test_msg->tow = 2570200; - test_msg->vdop = 150; - - EXPECT_EQ(send_message( 0x206, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->gdop, 180) << "incorrect value for gdop, expected 180, is " << last_msg_->gdop; - EXPECT_EQ(last_msg_->hdop, 160) << "incorrect value for hdop, expected 160, is " << last_msg_->hdop; - EXPECT_EQ(last_msg_->pdop, 190) << "incorrect value for pdop, expected 190, is " << last_msg_->pdop; - EXPECT_EQ(last_msg_->tdop, 170) << "incorrect value for tdop, expected 170, is " << last_msg_->tdop; - EXPECT_EQ(last_msg_->tow, 2570200) << "incorrect value for tow, expected 2570200, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->vdop, 150) << "incorrect value for vdop, expected 150, is " << last_msg_->vdop; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 246, 215, 14, 216, 55, 39, 0, 180, + 0, 190, 0, 170, 0, 160, 0, 150, 0, 71, 218, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_dops_dep_a_t *test_msg = (msg_dops_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->gdop = 180; + test_msg->hdop = 160; + test_msg->pdop = 190; + test_msg->tdop = 170; + test_msg->tow = 2570200; + test_msg->vdop = 150; + + EXPECT_EQ(send_message(0x206, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->gdop, 180) + << "incorrect value for gdop, expected 180, is " << last_msg_->gdop; + EXPECT_EQ(last_msg_->hdop, 160) + << "incorrect value for hdop, expected 160, is " << last_msg_->hdop; + EXPECT_EQ(last_msg_->pdop, 190) + << "incorrect value for pdop, expected 190, is " << last_msg_->pdop; + EXPECT_EQ(last_msg_->tdop, 170) + << "incorrect value for tdop, expected 170, is " << last_msg_->tdop; + EXPECT_EQ(last_msg_->tow, 2570200) + << "incorrect value for tow, expected 2570200, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->vdop, 150) + << "incorrect value for vdop, expected 150, is " << last_msg_->vdop; } -class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgDopsDepA3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgDopsDepA3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_dops_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -382,96 +381,97 @@ class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_dops_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,195,4,14,212,157,67,24,247,0,215,0,123,0,17,1,44,0,206,21, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->gdop = 247; - test_msg->hdop = 273; - test_msg->pdop = 215; - test_msg->tdop = 123; - test_msg->tow = 407084500; - test_msg->vdop = 44; - - EXPECT_EQ(send_message( 0x206, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->gdop, 247) << "incorrect value for gdop, expected 247, is " << last_msg_->gdop; - EXPECT_EQ(last_msg_->hdop, 273) << "incorrect value for hdop, expected 273, is " << last_msg_->hdop; - EXPECT_EQ(last_msg_->pdop, 215) << "incorrect value for pdop, expected 215, is " << last_msg_->pdop; - EXPECT_EQ(last_msg_->tdop, 123) << "incorrect value for tdop, expected 123, is " << last_msg_->tdop; - EXPECT_EQ(last_msg_->tow, 407084500) << "incorrect value for tow, expected 407084500, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->vdop, 44) << "incorrect value for vdop, expected 44, is " << last_msg_->vdop; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 212, 157, 67, 24, 247, + 0, 215, 0, 123, 0, 17, 1, 44, 0, 206, 21, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_dops_dep_a_t *test_msg = (msg_dops_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->gdop = 247; + test_msg->hdop = 273; + test_msg->pdop = 215; + test_msg->tdop = 123; + test_msg->tow = 407084500; + test_msg->vdop = 44; + + EXPECT_EQ(send_message(0x206, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->gdop, 247) + << "incorrect value for gdop, expected 247, is " << last_msg_->gdop; + EXPECT_EQ(last_msg_->hdop, 273) + << "incorrect value for hdop, expected 273, is " << last_msg_->hdop; + EXPECT_EQ(last_msg_->pdop, 215) + << "incorrect value for pdop, expected 215, is " << last_msg_->pdop; + EXPECT_EQ(last_msg_->tdop, 123) + << "incorrect value for tdop, expected 123, is " << last_msg_->tdop; + EXPECT_EQ(last_msg_->tow, 407084500) + << "incorrect value for tow, expected 407084500, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->vdop, 44) + << "incorrect value for vdop, expected 44, is " << last_msg_->vdop; } -class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgDopsDepA4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgDopsDepA4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_dops_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -481,96 +481,97 @@ class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_dops_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,195,4,14,0,0,0,0,255,255,255,255,0,0,0,0,0,0,146,12, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->gdop = 65535; - test_msg->hdop = 0; - test_msg->pdop = 65535; - test_msg->tdop = 0; - test_msg->tow = 0; - test_msg->vdop = 0; - - EXPECT_EQ(send_message( 0x206, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->gdop, 65535) << "incorrect value for gdop, expected 65535, is " << last_msg_->gdop; - EXPECT_EQ(last_msg_->hdop, 0) << "incorrect value for hdop, expected 0, is " << last_msg_->hdop; - EXPECT_EQ(last_msg_->pdop, 65535) << "incorrect value for pdop, expected 65535, is " << last_msg_->pdop; - EXPECT_EQ(last_msg_->tdop, 0) << "incorrect value for tdop, expected 0, is " << last_msg_->tdop; - EXPECT_EQ(last_msg_->tow, 0) << "incorrect value for tow, expected 0, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->vdop, 0) << "incorrect value for vdop, expected 0, is " << last_msg_->vdop; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 0, 0, 0, 0, 255, + 255, 255, 255, 0, 0, 0, 0, 0, 0, 146, 12, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_dops_dep_a_t *test_msg = (msg_dops_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->gdop = 65535; + test_msg->hdop = 0; + test_msg->pdop = 65535; + test_msg->tdop = 0; + test_msg->tow = 0; + test_msg->vdop = 0; + + EXPECT_EQ(send_message(0x206, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->gdop, 65535) + << "incorrect value for gdop, expected 65535, is " << last_msg_->gdop; + EXPECT_EQ(last_msg_->hdop, 0) + << "incorrect value for hdop, expected 0, is " << last_msg_->hdop; + EXPECT_EQ(last_msg_->pdop, 65535) + << "incorrect value for pdop, expected 65535, is " << last_msg_->pdop; + EXPECT_EQ(last_msg_->tdop, 0) + << "incorrect value for tdop, expected 0, is " << last_msg_->tdop; + EXPECT_EQ(last_msg_->tow, 0) + << "incorrect value for tow, expected 0, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->vdop, 0) + << "incorrect value for vdop, expected 0, is " << last_msg_->vdop; } -class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgDopsDepA5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgDopsDepA5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_dops_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -580,96 +581,97 @@ class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_dops_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,195,4,14,128,165,68,24,92,1,56,1,155,0,125,2,113,0,129,93, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->gdop = 348; - test_msg->hdop = 637; - test_msg->pdop = 312; - test_msg->tdop = 155; - test_msg->tow = 407152000; - test_msg->vdop = 113; - - EXPECT_EQ(send_message( 0x206, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->gdop, 348) << "incorrect value for gdop, expected 348, is " << last_msg_->gdop; - EXPECT_EQ(last_msg_->hdop, 637) << "incorrect value for hdop, expected 637, is " << last_msg_->hdop; - EXPECT_EQ(last_msg_->pdop, 312) << "incorrect value for pdop, expected 312, is " << last_msg_->pdop; - EXPECT_EQ(last_msg_->tdop, 155) << "incorrect value for tdop, expected 155, is " << last_msg_->tdop; - EXPECT_EQ(last_msg_->tow, 407152000) << "incorrect value for tow, expected 407152000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->vdop, 113) << "incorrect value for vdop, expected 113, is " << last_msg_->vdop; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 128, 165, 68, 24, 92, + 1, 56, 1, 155, 0, 125, 2, 113, 0, 129, 93, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_dops_dep_a_t *test_msg = (msg_dops_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->gdop = 348; + test_msg->hdop = 637; + test_msg->pdop = 312; + test_msg->tdop = 155; + test_msg->tow = 407152000; + test_msg->vdop = 113; + + EXPECT_EQ(send_message(0x206, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->gdop, 348) + << "incorrect value for gdop, expected 348, is " << last_msg_->gdop; + EXPECT_EQ(last_msg_->hdop, 637) + << "incorrect value for hdop, expected 637, is " << last_msg_->hdop; + EXPECT_EQ(last_msg_->pdop, 312) + << "incorrect value for pdop, expected 312, is " << last_msg_->pdop; + EXPECT_EQ(last_msg_->tdop, 155) + << "incorrect value for tdop, expected 155, is " << last_msg_->tdop; + EXPECT_EQ(last_msg_->tow, 407152000) + << "incorrect value for tow, expected 407152000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->vdop, 113) + << "incorrect value for vdop, expected 113, is " << last_msg_->vdop; } -class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA6 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgDopsDepA6() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA6 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgDopsDepA6() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_dops_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -679,96 +681,97 @@ class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA6 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_dops_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,195,4,14,104,169,68,24,92,1,55,1,155,0,125,2,113,0,209,128, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->gdop = 348; - test_msg->hdop = 637; - test_msg->pdop = 311; - test_msg->tdop = 155; - test_msg->tow = 407153000; - test_msg->vdop = 113; - - EXPECT_EQ(send_message( 0x206, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->gdop, 348) << "incorrect value for gdop, expected 348, is " << last_msg_->gdop; - EXPECT_EQ(last_msg_->hdop, 637) << "incorrect value for hdop, expected 637, is " << last_msg_->hdop; - EXPECT_EQ(last_msg_->pdop, 311) << "incorrect value for pdop, expected 311, is " << last_msg_->pdop; - EXPECT_EQ(last_msg_->tdop, 155) << "incorrect value for tdop, expected 155, is " << last_msg_->tdop; - EXPECT_EQ(last_msg_->tow, 407153000) << "incorrect value for tow, expected 407153000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->vdop, 113) << "incorrect value for vdop, expected 113, is " << last_msg_->vdop; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 104, 169, 68, 24, 92, + 1, 55, 1, 155, 0, 125, 2, 113, 0, 209, 128, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_dops_dep_a_t *test_msg = (msg_dops_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->gdop = 348; + test_msg->hdop = 637; + test_msg->pdop = 311; + test_msg->tdop = 155; + test_msg->tow = 407153000; + test_msg->vdop = 113; + + EXPECT_EQ(send_message(0x206, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->gdop, 348) + << "incorrect value for gdop, expected 348, is " << last_msg_->gdop; + EXPECT_EQ(last_msg_->hdop, 637) + << "incorrect value for hdop, expected 637, is " << last_msg_->hdop; + EXPECT_EQ(last_msg_->pdop, 311) + << "incorrect value for pdop, expected 311, is " << last_msg_->pdop; + EXPECT_EQ(last_msg_->tdop, 155) + << "incorrect value for tdop, expected 155, is " << last_msg_->tdop; + EXPECT_EQ(last_msg_->tow, 407153000) + << "incorrect value for tow, expected 407153000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->vdop, 113) + << "incorrect value for vdop, expected 113, is " << last_msg_->vdop; } -class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA7 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgDopsDepA7() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA7 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgDopsDepA7() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_dops_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -778,96 +781,97 @@ class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA7 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_dops_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,195,4,14,80,173,68,24,92,1,55,1,155,0,125,2,112,0,30,6, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->gdop = 348; - test_msg->hdop = 637; - test_msg->pdop = 311; - test_msg->tdop = 155; - test_msg->tow = 407154000; - test_msg->vdop = 112; - - EXPECT_EQ(send_message( 0x206, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->gdop, 348) << "incorrect value for gdop, expected 348, is " << last_msg_->gdop; - EXPECT_EQ(last_msg_->hdop, 637) << "incorrect value for hdop, expected 637, is " << last_msg_->hdop; - EXPECT_EQ(last_msg_->pdop, 311) << "incorrect value for pdop, expected 311, is " << last_msg_->pdop; - EXPECT_EQ(last_msg_->tdop, 155) << "incorrect value for tdop, expected 155, is " << last_msg_->tdop; - EXPECT_EQ(last_msg_->tow, 407154000) << "incorrect value for tow, expected 407154000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->vdop, 112) << "incorrect value for vdop, expected 112, is " << last_msg_->vdop; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 80, 173, 68, 24, 92, + 1, 55, 1, 155, 0, 125, 2, 112, 0, 30, 6, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_dops_dep_a_t *test_msg = (msg_dops_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->gdop = 348; + test_msg->hdop = 637; + test_msg->pdop = 311; + test_msg->tdop = 155; + test_msg->tow = 407154000; + test_msg->vdop = 112; + + EXPECT_EQ(send_message(0x206, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->gdop, 348) + << "incorrect value for gdop, expected 348, is " << last_msg_->gdop; + EXPECT_EQ(last_msg_->hdop, 637) + << "incorrect value for hdop, expected 637, is " << last_msg_->hdop; + EXPECT_EQ(last_msg_->pdop, 311) + << "incorrect value for pdop, expected 311, is " << last_msg_->pdop; + EXPECT_EQ(last_msg_->tdop, 155) + << "incorrect value for tdop, expected 155, is " << last_msg_->tdop; + EXPECT_EQ(last_msg_->tow, 407154000) + << "incorrect value for tow, expected 407154000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->vdop, 112) + << "incorrect value for vdop, expected 112, is " << last_msg_->vdop; } -class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA8 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgDopsDepA8() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA8 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgDopsDepA8() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_dops_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_dops_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -877,45 +881,52 @@ class Test_legacy_auto_check_sbp_navigation_MsgDopsDepA8 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_dops_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,6,2,195,4,14,56,177,68,24,92,1,55,1,155,0,125,2,112,0,70,67, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_dops_dep_a_t* test_msg = ( msg_dops_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->gdop = 348; - test_msg->hdop = 637; - test_msg->pdop = 311; - test_msg->tdop = 155; - test_msg->tow = 407155000; - test_msg->vdop = 112; - - EXPECT_EQ(send_message( 0x206, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->gdop, 348) << "incorrect value for gdop, expected 348, is " << last_msg_->gdop; - EXPECT_EQ(last_msg_->hdop, 637) << "incorrect value for hdop, expected 637, is " << last_msg_->hdop; - EXPECT_EQ(last_msg_->pdop, 311) << "incorrect value for pdop, expected 311, is " << last_msg_->pdop; - EXPECT_EQ(last_msg_->tdop, 155) << "incorrect value for tdop, expected 155, is " << last_msg_->tdop; - EXPECT_EQ(last_msg_->tow, 407155000) << "incorrect value for tow, expected 407155000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->vdop, 112) << "incorrect value for vdop, expected 112, is " << last_msg_->vdop; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgDopsDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 6, 2, 195, 4, 14, 56, 177, 68, 24, 92, + 1, 55, 1, 155, 0, 125, 2, 112, 0, 70, 67, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_dops_dep_a_t *test_msg = (msg_dops_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->gdop = 348; + test_msg->hdop = 637; + test_msg->pdop = 311; + test_msg->tdop = 155; + test_msg->tow = 407155000; + test_msg->vdop = 112; + + EXPECT_EQ(send_message(0x206, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->gdop, 348) + << "incorrect value for gdop, expected 348, is " << last_msg_->gdop; + EXPECT_EQ(last_msg_->hdop, 637) + << "incorrect value for hdop, expected 637, is " << last_msg_->hdop; + EXPECT_EQ(last_msg_->pdop, 311) + << "incorrect value for pdop, expected 311, is " << last_msg_->pdop; + EXPECT_EQ(last_msg_->tdop, 155) + << "incorrect value for tdop, expected 155, is " << last_msg_->tdop; + EXPECT_EQ(last_msg_->tow, 407155000) + << "incorrect value for tow, expected 407155000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->vdop, 112) + << "incorrect value for vdop, expected 112, is " << last_msg_->vdop; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgGPSTime.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgGPSTime.cc index ad5e45a46..484dbe2dd 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgGPSTime.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgGPSTime.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTime.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgGPSTime0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTime0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTime0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTime0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,92 +81,92 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTime0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTime0, Test) -{ - - uint8_t encoded_frame[] = {85,2,1,211,136,11,128,7,40,244,122,19,244,139,2,0,0,34,152, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_t* test_msg = ( msg_gps_time_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 166900; - test_msg->tow = 326825000; - test_msg->wn = 1920; - - EXPECT_EQ(send_message( 0x102, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 166900) << "incorrect value for ns_residual, expected 166900, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 326825000) << "incorrect value for tow, expected 326825000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1920) << "incorrect value for wn, expected 1920, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTime0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 40, 244, + 122, 19, 244, 139, 2, 0, 0, 34, 152, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_t *test_msg = (msg_gps_time_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 166900; + test_msg->tow = 326825000; + test_msg->wn = 1920; + + EXPECT_EQ(send_message(0x102, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 166900) + << "incorrect value for ns_residual, expected 166900, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 326825000) + << "incorrect value for tow, expected 326825000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1920) + << "incorrect value for wn, expected 1920, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTime1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTime1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTime1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTime1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -180,92 +176,92 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTime1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTime1, Test) -{ - - uint8_t encoded_frame[] = {85,2,1,211,136,11,128,7,28,246,122,19,126,234,3,0,0,65,3, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_t* test_msg = ( msg_gps_time_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 256638; - test_msg->tow = 326825500; - test_msg->wn = 1920; - - EXPECT_EQ(send_message( 0x102, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 256638) << "incorrect value for ns_residual, expected 256638, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 326825500) << "incorrect value for tow, expected 326825500, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1920) << "incorrect value for wn, expected 1920, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTime1, Test) { + uint8_t encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 28, 246, + 122, 19, 126, 234, 3, 0, 0, 65, 3, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_t *test_msg = (msg_gps_time_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 256638; + test_msg->tow = 326825500; + test_msg->wn = 1920; + + EXPECT_EQ(send_message(0x102, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 256638) + << "incorrect value for ns_residual, expected 256638, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 326825500) + << "incorrect value for tow, expected 326825500, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1920) + << "incorrect value for wn, expected 1920, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTime2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTime2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTime2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTime2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -275,92 +271,92 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTime2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTime2, Test) -{ - - uint8_t encoded_frame[] = {85,2,1,211,136,11,128,7,16,248,122,19,129,12,4,0,0,12,84, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_t* test_msg = ( msg_gps_time_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 265345; - test_msg->tow = 326826000; - test_msg->wn = 1920; - - EXPECT_EQ(send_message( 0x102, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 265345) << "incorrect value for ns_residual, expected 265345, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 326826000) << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1920) << "incorrect value for wn, expected 1920, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTime2, Test) { + uint8_t encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 16, 248, + 122, 19, 129, 12, 4, 0, 0, 12, 84, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_t *test_msg = (msg_gps_time_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 265345; + test_msg->tow = 326826000; + test_msg->wn = 1920; + + EXPECT_EQ(send_message(0x102, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 265345) + << "incorrect value for ns_residual, expected 265345, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 326826000) + << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1920) + << "incorrect value for wn, expected 1920, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTime3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTime3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTime3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTime3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -370,92 +366,92 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTime3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTime3, Test) -{ - - uint8_t encoded_frame[] = {85,2,1,211,136,11,128,7,4,250,122,19,137,204,4,0,0,50,165, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_t* test_msg = ( msg_gps_time_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 314505; - test_msg->tow = 326826500; - test_msg->wn = 1920; - - EXPECT_EQ(send_message( 0x102, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 314505) << "incorrect value for ns_residual, expected 314505, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 326826500) << "incorrect value for tow, expected 326826500, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1920) << "incorrect value for wn, expected 1920, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTime3, Test) { + uint8_t encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 4, 250, + 122, 19, 137, 204, 4, 0, 0, 50, 165, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_t *test_msg = (msg_gps_time_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 314505; + test_msg->tow = 326826500; + test_msg->wn = 1920; + + EXPECT_EQ(send_message(0x102, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 314505) + << "incorrect value for ns_residual, expected 314505, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 326826500) + << "incorrect value for tow, expected 326826500, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1920) + << "incorrect value for wn, expected 1920, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTime4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTime4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTime4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTime4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -465,41 +461,47 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTime4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTime4, Test) -{ - - uint8_t encoded_frame[] = {85,2,1,211,136,11,128,7,248,251,122,19,181,137,5,0,0,180,33, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_t* test_msg = ( msg_gps_time_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 362933; - test_msg->tow = 326827000; - test_msg->wn = 1920; - - EXPECT_EQ(send_message( 0x102, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 362933) << "incorrect value for ns_residual, expected 362933, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 326827000) << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1920) << "incorrect value for wn, expected 1920, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTime4, Test) { + uint8_t encoded_frame[] = { + 85, 2, 1, 211, 136, 11, 128, 7, 248, 251, + 122, 19, 181, 137, 5, 0, 0, 180, 33, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_t *test_msg = (msg_gps_time_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 362933; + test_msg->tow = 326827000; + test_msg->wn = 1920; + + EXPECT_EQ(send_message(0x102, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 362933) + << "incorrect value for ns_residual, expected 362933, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 326827000) + << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1920) + << "incorrect value for wn, expected 1920, is " << last_msg_->wn; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgGPSTimeDepA.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgGPSTimeDepA.cc index c0ebea553..1d1dc763c 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgGPSTimeDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgGPSTimeDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,92 +81,91 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,246,215,11,251,6,120,46,39,0,0,0,0,0,0,133,36, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 0; - test_msg->tow = 2567800; - test_msg->wn = 1787; - - EXPECT_EQ(send_message( 0x100, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 0) << "incorrect value for ns_residual, expected 0, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 2567800) << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1787) << "incorrect value for wn, expected 1787, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 120, 46, 39, 0, 0, 0, 0, 0, 0, 133, 36, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_dep_a_t *test_msg = (msg_gps_time_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 0; + test_msg->tow = 2567800; + test_msg->wn = 1787; + + EXPECT_EQ(send_message(0x100, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 0) + << "incorrect value for ns_residual, expected 0, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 2567800) + << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1787) + << "incorrect value for wn, expected 1787, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -180,92 +175,91 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,246,215,11,251,6,220,46,39,0,0,0,0,0,0,36,160, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 0; - test_msg->tow = 2567900; - test_msg->wn = 1787; - - EXPECT_EQ(send_message( 0x100, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 0) << "incorrect value for ns_residual, expected 0, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 2567900) << "incorrect value for tow, expected 2567900, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1787) << "incorrect value for wn, expected 1787, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 220, 46, 39, 0, 0, 0, 0, 0, 0, 36, 160, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_dep_a_t *test_msg = (msg_gps_time_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 0; + test_msg->tow = 2567900; + test_msg->wn = 1787; + + EXPECT_EQ(send_message(0x100, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 0) + << "incorrect value for ns_residual, expected 0, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 2567900) + << "incorrect value for tow, expected 2567900, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1787) + << "incorrect value for wn, expected 1787, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -275,92 +269,91 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,246,215,11,251,6,64,47,39,0,0,0,0,0,0,171,190, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 0; - test_msg->tow = 2568000; - test_msg->wn = 1787; - - EXPECT_EQ(send_message( 0x100, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 0) << "incorrect value for ns_residual, expected 0, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 2568000) << "incorrect value for tow, expected 2568000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1787) << "incorrect value for wn, expected 1787, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 64, 47, 39, 0, 0, 0, 0, 0, 0, 171, 190, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_dep_a_t *test_msg = (msg_gps_time_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 0; + test_msg->tow = 2568000; + test_msg->wn = 1787; + + EXPECT_EQ(send_message(0x100, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 0) + << "incorrect value for ns_residual, expected 0, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 2568000) + << "incorrect value for tow, expected 2568000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1787) + << "incorrect value for wn, expected 1787, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -370,92 +363,91 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,246,215,11,251,6,164,47,39,0,0,0,0,0,0,211,101, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 0; - test_msg->tow = 2568100; - test_msg->wn = 1787; - - EXPECT_EQ(send_message( 0x100, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 0) << "incorrect value for ns_residual, expected 0, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 2568100) << "incorrect value for tow, expected 2568100, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1787) << "incorrect value for wn, expected 1787, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 164, 47, 39, 0, 0, 0, 0, 0, 0, 211, 101, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_dep_a_t *test_msg = (msg_gps_time_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 0; + test_msg->tow = 2568100; + test_msg->wn = 1787; + + EXPECT_EQ(send_message(0x100, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 0) + << "incorrect value for ns_residual, expected 0, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 2568100) + << "incorrect value for tow, expected 2568100, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1787) + << "incorrect value for wn, expected 1787, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -465,92 +457,91 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,246,215,11,251,6,8,48,39,0,0,0,0,0,0,251,44, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 0; - test_msg->tow = 2568200; - test_msg->wn = 1787; - - EXPECT_EQ(send_message( 0x100, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 0) << "incorrect value for ns_residual, expected 0, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 2568200) << "incorrect value for tow, expected 2568200, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1787) << "incorrect value for wn, expected 1787, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 246, 215, 11, 251, 6, 8, 48, 39, 0, 0, 0, 0, 0, 0, 251, 44, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_dep_a_t *test_msg = (msg_gps_time_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 0; + test_msg->tow = 2568200; + test_msg->wn = 1787; + + EXPECT_EQ(send_message(0x100, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 0) + << "incorrect value for ns_residual, expected 0, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 2568200) + << "incorrect value for tow, expected 2568200, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1787) + << "incorrect value for wn, expected 1787, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -560,92 +551,92 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,195,4,11,46,7,212,157,67,24,111,147,252,255,0,215,190, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = -224401; - test_msg->tow = 407084500; - test_msg->wn = 1838; - - EXPECT_EQ(send_message( 0x100, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, -224401) << "incorrect value for ns_residual, expected -224401, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 407084500) << "incorrect value for tow, expected 407084500, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1838) << "incorrect value for wn, expected 1838, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 212, 157, + 67, 24, 111, 147, 252, 255, 0, 215, 190, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_dep_a_t *test_msg = (msg_gps_time_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = -224401; + test_msg->tow = 407084500; + test_msg->wn = 1838; + + EXPECT_EQ(send_message(0x100, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, -224401) + << "incorrect value for ns_residual, expected -224401, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 407084500) + << "incorrect value for tow, expected 407084500, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1838) + << "incorrect value for wn, expected 1838, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA6 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA6() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA6 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA6() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -655,92 +646,91 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA6 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,195,4,11,46,7,56,158,67,24,109,103,3,0,0,134,89, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 223085; - test_msg->tow = 407084600; - test_msg->wn = 1838; - - EXPECT_EQ(send_message( 0x100, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 223085) << "incorrect value for ns_residual, expected 223085, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 407084600) << "incorrect value for tow, expected 407084600, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1838) << "incorrect value for wn, expected 1838, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 56, 158, 67, 24, 109, 103, 3, 0, 0, 134, 89, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_dep_a_t *test_msg = (msg_gps_time_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 223085; + test_msg->tow = 407084600; + test_msg->wn = 1838; + + EXPECT_EQ(send_message(0x100, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 223085) + << "incorrect value for ns_residual, expected 223085, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 407084600) + << "incorrect value for tow, expected 407084600, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1838) + << "incorrect value for wn, expected 1838, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA7 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA7() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA7 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA7() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -750,92 +740,92 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA7 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,195,4,11,46,7,156,158,67,24,233,152,252,255,0,206,241, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = -222999; - test_msg->tow = 407084700; - test_msg->wn = 1838; - - EXPECT_EQ(send_message( 0x100, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, -222999) << "incorrect value for ns_residual, expected -222999, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 407084700) << "incorrect value for tow, expected 407084700, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1838) << "incorrect value for wn, expected 1838, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 156, 158, + 67, 24, 233, 152, 252, 255, 0, 206, 241, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_dep_a_t *test_msg = (msg_gps_time_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = -222999; + test_msg->tow = 407084700; + test_msg->wn = 1838; + + EXPECT_EQ(send_message(0x100, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, -222999) + << "incorrect value for ns_residual, expected -222999, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 407084700) + << "incorrect value for tow, expected 407084700, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1838) + << "incorrect value for wn, expected 1838, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA8 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA8() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA8 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA8() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -845,92 +835,91 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA8 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,195,4,11,46,7,0,159,67,24,240,154,3,0,0,147,98, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 236272; - test_msg->tow = 407084800; - test_msg->wn = 1838; - - EXPECT_EQ(send_message( 0x100, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 236272) << "incorrect value for ns_residual, expected 236272, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 407084800) << "incorrect value for tow, expected 407084800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1838) << "incorrect value for wn, expected 1838, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 0, 159, 67, 24, 240, 154, 3, 0, 0, 147, 98, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_dep_a_t *test_msg = (msg_gps_time_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 236272; + test_msg->tow = 407084800; + test_msg->wn = 1838; + + EXPECT_EQ(send_message(0x100, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 236272) + << "incorrect value for ns_residual, expected 236272, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 407084800) + << "incorrect value for tow, expected 407084800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1838) + << "incorrect value for wn, expected 1838, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA9 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA9() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA9 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA9() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -940,92 +929,92 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA9 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA9, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,195,4,11,46,7,100,159,67,24,144,101,252,255,0,186,152, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = -236144; - test_msg->tow = 407084900; - test_msg->wn = 1838; - - EXPECT_EQ(send_message( 0x100, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, -236144) << "incorrect value for ns_residual, expected -236144, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 407084900) << "incorrect value for tow, expected 407084900, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1838) << "incorrect value for wn, expected 1838, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA9, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 100, 159, + 67, 24, 144, 101, 252, 255, 0, 186, 152, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_dep_a_t *test_msg = (msg_gps_time_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = -236144; + test_msg->tow = 407084900; + test_msg->wn = 1838; + + EXPECT_EQ(send_message(0x100, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, -236144) + << "incorrect value for ns_residual, expected -236144, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 407084900) + << "incorrect value for tow, expected 407084900, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1838) + << "incorrect value for wn, expected 1838, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA10 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA10() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA10 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA10() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -1035,41 +1024,47 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA10 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA10, Test) -{ - - uint8_t encoded_frame[] = {85,0,1,195,4,11,46,7,46,162,68,24,205,230,250,255,0,11,225, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_dep_a_t* test_msg = ( msg_gps_time_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = -334131; - test_msg->tow = 407151150; - test_msg->wn = 1838; - - EXPECT_EQ(send_message( 0x100, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, -334131) << "incorrect value for ns_residual, expected -334131, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 407151150) << "incorrect value for tow, expected 407151150, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1838) << "incorrect value for wn, expected 1838, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeDepA10, Test) { + uint8_t encoded_frame[] = { + 85, 0, 1, 195, 4, 11, 46, 7, 46, 162, + 68, 24, 205, 230, 250, 255, 0, 11, 225, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_dep_a_t *test_msg = (msg_gps_time_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = -334131; + test_msg->tow = 407151150; + test_msg->wn = 1838; + + EXPECT_EQ(send_message(0x100, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, -334131) + << "incorrect value for ns_residual, expected -334131, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 407151150) + << "incorrect value for tow, expected 407151150, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1838) + << "incorrect value for wn, expected 1838, is " << last_msg_->wn; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgGPSTimeGNSS.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgGPSTimeGNSS.cc index 710a66306..0d4192609 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgGPSTimeGNSS.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgGPSTimeGNSS.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgGPSTimeGNSS.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_gnss_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,92 +81,92 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_gnss_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS0, Test) -{ - - uint8_t encoded_frame[] = {85,4,1,211,136,11,128,7,40,244,122,19,244,139,2,0,0,153,88, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_gnss_t* test_msg = ( msg_gps_time_gnss_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 166900; - test_msg->tow = 326825000; - test_msg->wn = 1920; - - EXPECT_EQ(send_message( 0x104, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 166900) << "incorrect value for ns_residual, expected 166900, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 326825000) << "incorrect value for tow, expected 326825000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1920) << "incorrect value for wn, expected 1920, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS0, Test) { + uint8_t encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 40, 244, + 122, 19, 244, 139, 2, 0, 0, 153, 88, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_gnss_t *test_msg = (msg_gps_time_gnss_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 166900; + test_msg->tow = 326825000; + test_msg->wn = 1920; + + EXPECT_EQ(send_message(0x104, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 166900) + << "incorrect value for ns_residual, expected 166900, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 326825000) + << "incorrect value for tow, expected 326825000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1920) + << "incorrect value for wn, expected 1920, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_gnss_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -180,92 +176,92 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_gnss_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS1, Test) -{ - - uint8_t encoded_frame[] = {85,4,1,211,136,11,128,7,28,246,122,19,126,234,3,0,0,250,195, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_gnss_t* test_msg = ( msg_gps_time_gnss_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 256638; - test_msg->tow = 326825500; - test_msg->wn = 1920; - - EXPECT_EQ(send_message( 0x104, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 256638) << "incorrect value for ns_residual, expected 256638, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 326825500) << "incorrect value for tow, expected 326825500, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1920) << "incorrect value for wn, expected 1920, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS1, Test) { + uint8_t encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 28, 246, + 122, 19, 126, 234, 3, 0, 0, 250, 195, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_gnss_t *test_msg = (msg_gps_time_gnss_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 256638; + test_msg->tow = 326825500; + test_msg->wn = 1920; + + EXPECT_EQ(send_message(0x104, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 256638) + << "incorrect value for ns_residual, expected 256638, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 326825500) + << "incorrect value for tow, expected 326825500, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1920) + << "incorrect value for wn, expected 1920, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_gnss_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -275,92 +271,92 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_gnss_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS2, Test) -{ - - uint8_t encoded_frame[] = {85,4,1,211,136,11,128,7,16,248,122,19,129,12,4,0,0,183,148, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_gnss_t* test_msg = ( msg_gps_time_gnss_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 265345; - test_msg->tow = 326826000; - test_msg->wn = 1920; - - EXPECT_EQ(send_message( 0x104, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 265345) << "incorrect value for ns_residual, expected 265345, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 326826000) << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1920) << "incorrect value for wn, expected 1920, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS2, Test) { + uint8_t encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 16, 248, + 122, 19, 129, 12, 4, 0, 0, 183, 148, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_gnss_t *test_msg = (msg_gps_time_gnss_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 265345; + test_msg->tow = 326826000; + test_msg->wn = 1920; + + EXPECT_EQ(send_message(0x104, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 265345) + << "incorrect value for ns_residual, expected 265345, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 326826000) + << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1920) + << "incorrect value for wn, expected 1920, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_gnss_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -370,92 +366,92 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_gnss_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS3, Test) -{ - - uint8_t encoded_frame[] = {85,4,1,211,136,11,128,7,4,250,122,19,137,204,4,0,0,137,101, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_gnss_t* test_msg = ( msg_gps_time_gnss_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 314505; - test_msg->tow = 326826500; - test_msg->wn = 1920; - - EXPECT_EQ(send_message( 0x104, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 314505) << "incorrect value for ns_residual, expected 314505, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 326826500) << "incorrect value for tow, expected 326826500, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1920) << "incorrect value for wn, expected 1920, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS3, Test) { + uint8_t encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 4, 250, + 122, 19, 137, 204, 4, 0, 0, 137, 101, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_gnss_t *test_msg = (msg_gps_time_gnss_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 314505; + test_msg->tow = 326826500; + test_msg->wn = 1920; + + EXPECT_EQ(send_message(0x104, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 314505) + << "incorrect value for ns_residual, expected 314505, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 326826500) + << "incorrect value for tow, expected 326826500, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1920) + << "incorrect value for wn, expected 1920, is " << last_msg_->wn; } -class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gps_time_gnss_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -465,41 +461,47 @@ class Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gps_time_gnss_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS4, Test) -{ - - uint8_t encoded_frame[] = {85,4,1,211,136,11,128,7,248,251,122,19,181,137,5,0,0,15,225, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gps_time_gnss_t* test_msg = ( msg_gps_time_gnss_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->ns_residual = 362933; - test_msg->tow = 326827000; - test_msg->wn = 1920; - - EXPECT_EQ(send_message( 0x104, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->ns_residual, 362933) << "incorrect value for ns_residual, expected 362933, is " << last_msg_->ns_residual; - EXPECT_EQ(last_msg_->tow, 326827000) << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 1920) << "incorrect value for wn, expected 1920, is " << last_msg_->wn; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgGPSTimeGNSS4, Test) { + uint8_t encoded_frame[] = { + 85, 4, 1, 211, 136, 11, 128, 7, 248, 251, + 122, 19, 181, 137, 5, 0, 0, 15, 225, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gps_time_gnss_t *test_msg = (msg_gps_time_gnss_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->ns_residual = 362933; + test_msg->tow = 326827000; + test_msg->wn = 1920; + + EXPECT_EQ(send_message(0x104, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->ns_residual, 362933) + << "incorrect value for ns_residual, expected 362933, is " + << last_msg_->ns_residual; + EXPECT_EQ(last_msg_->tow, 326827000) + << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 1920) + << "incorrect value for wn, expected 1920, is " << last_msg_->wn; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEF.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEF.cc index bcd02211b..93846fc91 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEF.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEF.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEF.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgPosECEF0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEF0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEF0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEF0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,98 +81,101 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEF0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEF0, Test) -{ - - uint8_t encoded_frame[] = {85,9,2,211,136,32,16,248,122,19,73,29,46,132,182,122,68,193,219,192,29,176,121,119,80,193,83,11,210,90,79,75,77,65,0,0,15,2,84,6, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_t* test_msg = ( msg_pos_ecef_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 2; - test_msg->n_sats = 15; - test_msg->tow = 326826000; - test_msg->x = -2684269.0326572997; - test_msg->y = -4316646.751816; - test_msg->z = 3839646.7095350414; - - EXPECT_EQ(send_message( 0x209, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 2) << "incorrect value for flags, expected 2, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326826000) << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2684269.03266*100), 0.05) << "incorrect value for x, expected -2684269.03266, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4316646.75182*100), 0.05) << "incorrect value for y, expected -4316646.75182, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3839646.70954*100), 0.05) << "incorrect value for z, expected 3839646.70954, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEF0, Test) { + uint8_t encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 16, 248, 122, 19, 73, 29, 46, 132, + 182, 122, 68, 193, 219, 192, 29, 176, 121, 119, 80, 193, 83, 11, + 210, 90, 79, 75, 77, 65, 0, 0, 15, 2, 84, 6, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_t *test_msg = (msg_pos_ecef_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 2; + test_msg->n_sats = 15; + test_msg->tow = 326826000; + test_msg->x = -2684269.0326572997; + test_msg->y = -4316646.751816; + test_msg->z = 3839646.7095350414; + + EXPECT_EQ(send_message(0x209, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 2) + << "incorrect value for flags, expected 2, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326826000) + << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2684269.03266 * 100), 0.05) + << "incorrect value for x, expected -2684269.03266, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4316646.75182 * 100), 0.05) + << "incorrect value for y, expected -4316646.75182, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3839646.70954 * 100), 0.05) + << "incorrect value for z, expected 3839646.70954, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgPosECEF1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEF1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEF1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEF1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -186,98 +185,101 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEF1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEF1, Test) -{ - - uint8_t encoded_frame[] = {85,9,2,211,136,32,248,251,122,19,103,106,57,136,182,122,68,193,176,242,200,176,121,119,80,193,244,135,97,59,79,75,77,65,0,0,15,2,147,216, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_t* test_msg = ( msg_pos_ecef_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 2; - test_msg->n_sats = 15; - test_msg->tow = 326827000; - test_msg->x = -2684269.064252186; - test_msg->y = -4316646.762264892; - test_msg->z = 3839646.463913912; - - EXPECT_EQ(send_message( 0x209, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 2) << "incorrect value for flags, expected 2, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326827000) << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2684269.06425*100), 0.05) << "incorrect value for x, expected -2684269.06425, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4316646.76226*100), 0.05) << "incorrect value for y, expected -4316646.76226, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3839646.46391*100), 0.05) << "incorrect value for z, expected 3839646.46391, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEF1, Test) { + uint8_t encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 248, 251, 122, 19, 103, 106, 57, 136, + 182, 122, 68, 193, 176, 242, 200, 176, 121, 119, 80, 193, 244, 135, + 97, 59, 79, 75, 77, 65, 0, 0, 15, 2, 147, 216, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_t *test_msg = (msg_pos_ecef_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 2; + test_msg->n_sats = 15; + test_msg->tow = 326827000; + test_msg->x = -2684269.064252186; + test_msg->y = -4316646.762264892; + test_msg->z = 3839646.463913912; + + EXPECT_EQ(send_message(0x209, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 2) + << "incorrect value for flags, expected 2, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326827000) + << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2684269.06425 * 100), 0.05) + << "incorrect value for x, expected -2684269.06425, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4316646.76226 * 100), 0.05) + << "incorrect value for y, expected -4316646.76226, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3839646.46391 * 100), 0.05) + << "incorrect value for z, expected 3839646.46391, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgPosECEF2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEF2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEF2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEF2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -287,98 +289,101 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEF2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEF2, Test) -{ - - uint8_t encoded_frame[] = {85,9,2,211,136,32,224,255,122,19,101,179,242,182,182,122,68,193,130,196,145,199,121,119,80,193,212,10,253,15,79,75,77,65,0,0,15,2,40,201, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_t* test_msg = ( msg_pos_ecef_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 2; - test_msg->n_sats = 15; - test_msg->tow = 326828000; - test_msg->x = -2684269.4292816394; - test_msg->y = -4316647.118271949; - test_msg->z = 3839646.124909738; - - EXPECT_EQ(send_message( 0x209, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 2) << "incorrect value for flags, expected 2, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326828000) << "incorrect value for tow, expected 326828000, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2684269.42928*100), 0.05) << "incorrect value for x, expected -2684269.42928, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4316647.11827*100), 0.05) << "incorrect value for y, expected -4316647.11827, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3839646.12491*100), 0.05) << "incorrect value for z, expected 3839646.12491, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEF2, Test) { + uint8_t encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 224, 255, 122, 19, 101, 179, 242, 182, + 182, 122, 68, 193, 130, 196, 145, 199, 121, 119, 80, 193, 212, 10, + 253, 15, 79, 75, 77, 65, 0, 0, 15, 2, 40, 201, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_t *test_msg = (msg_pos_ecef_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 2; + test_msg->n_sats = 15; + test_msg->tow = 326828000; + test_msg->x = -2684269.4292816394; + test_msg->y = -4316647.118271949; + test_msg->z = 3839646.124909738; + + EXPECT_EQ(send_message(0x209, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 2) + << "incorrect value for flags, expected 2, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326828000) + << "incorrect value for tow, expected 326828000, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2684269.42928 * 100), 0.05) + << "incorrect value for x, expected -2684269.42928, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4316647.11827 * 100), 0.05) + << "incorrect value for y, expected -4316647.11827, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3839646.12491 * 100), 0.05) + << "incorrect value for z, expected 3839646.12491, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgPosECEF3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEF3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEF3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEF3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -388,47 +393,56 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEF3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEF3, Test) -{ - - uint8_t encoded_frame[] = {85,9,2,211,136,32,200,3,123,19,146,214,132,215,182,122,68,193,213,68,49,215,121,119,80,193,71,34,110,243,78,75,77,65,0,0,15,2,187,86, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_t* test_msg = ( msg_pos_ecef_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 2; - test_msg->n_sats = 15; - test_msg->tow = 326829000; - test_msg->x = -2684269.683741399; - test_msg->y = -4316647.3623821335; - test_msg->z = 3839645.90179852; - - EXPECT_EQ(send_message( 0x209, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 2) << "incorrect value for flags, expected 2, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326829000) << "incorrect value for tow, expected 326829000, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2684269.68374*100), 0.05) << "incorrect value for x, expected -2684269.68374, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4316647.36238*100), 0.05) << "incorrect value for y, expected -4316647.36238, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3839645.9018*100), 0.05) << "incorrect value for z, expected 3839645.9018, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEF3, Test) { + uint8_t encoded_frame[] = { + 85, 9, 2, 211, 136, 32, 200, 3, 123, 19, 146, 214, 132, 215, + 182, 122, 68, 193, 213, 68, 49, 215, 121, 119, 80, 193, 71, 34, + 110, 243, 78, 75, 77, 65, 0, 0, 15, 2, 187, 86, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_t *test_msg = (msg_pos_ecef_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 2; + test_msg->n_sats = 15; + test_msg->tow = 326829000; + test_msg->x = -2684269.683741399; + test_msg->y = -4316647.3623821335; + test_msg->z = 3839645.90179852; + + EXPECT_EQ(send_message(0x209, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 2) + << "incorrect value for flags, expected 2, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326829000) + << "incorrect value for tow, expected 326829000, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2684269.68374 * 100), 0.05) + << "incorrect value for x, expected -2684269.68374, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4316647.36238 * 100), 0.05) + << "incorrect value for y, expected -4316647.36238, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3839645.9018 * 100), 0.05) + << "incorrect value for z, expected 3839645.9018, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFCov.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFCov.cc index bff238740..b047bfdc9 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFCov.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFCov.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCov.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCov.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgPosECEFCov0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEFCov0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEFCov0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEFCov0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_cov_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_cov_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,57 +81,72 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEFCov0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_cov_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFCov0, Test) -{ +}; - uint8_t encoded_frame[] = {85,20,2,66,0,54,7,0,0,0,0,0,0,0,0,0,24,64,0,0,0,0,0,0,240,63,0,0,0,0,0,0,16,64,0,0,0,65,0,0,224,64,0,0,0,64,0,0,192,64,0,0,0,65,0,0,160,64,4,5,249,167, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFCov0, Test) { + uint8_t encoded_frame[] = { + 85, 20, 2, 66, 0, 54, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 24, 64, 0, 0, 0, 0, 0, 0, 240, 63, 0, 0, 0, 0, 0, 0, + 16, 64, 0, 0, 0, 65, 0, 0, 224, 64, 0, 0, 0, 64, 0, 0, + 192, 64, 0, 0, 0, 65, 0, 0, 160, 64, 4, 5, 249, 167, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_cov_t* test_msg = ( msg_pos_ecef_cov_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cov_x_x = 8.0; - test_msg->cov_x_y = 7.0; - test_msg->cov_x_z = 2.0; - test_msg->cov_y_y = 6.0; - test_msg->cov_y_z = 8.0; - test_msg->cov_z_z = 5.0; - test_msg->flags = 5; - test_msg->n_sats = 4; - test_msg->tow = 7; - test_msg->x = 6.0; - test_msg->y = 1.0; - test_msg->z = 4.0; - - EXPECT_EQ(send_message( 0x214, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_cov_t *test_msg = (msg_pos_ecef_cov_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cov_x_x = 8.0; + test_msg->cov_x_y = 7.0; + test_msg->cov_x_z = 2.0; + test_msg->cov_y_y = 6.0; + test_msg->cov_y_z = 8.0; + test_msg->cov_z_z = 5.0; + test_msg->flags = 5; + test_msg->n_sats = 4; + test_msg->tow = 7; + test_msg->x = 6.0; + test_msg->y = 1.0; + test_msg->z = 4.0; + + EXPECT_EQ(send_message(0x214, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cov_x_x*100 - 8.0*100), 0.05) << "incorrect value for cov_x_x, expected 8.0, is " << last_msg_->cov_x_x; - EXPECT_LT((last_msg_->cov_x_y*100 - 7.0*100), 0.05) << "incorrect value for cov_x_y, expected 7.0, is " << last_msg_->cov_x_y; - EXPECT_LT((last_msg_->cov_x_z*100 - 2.0*100), 0.05) << "incorrect value for cov_x_z, expected 2.0, is " << last_msg_->cov_x_z; - EXPECT_LT((last_msg_->cov_y_y*100 - 6.0*100), 0.05) << "incorrect value for cov_y_y, expected 6.0, is " << last_msg_->cov_y_y; - EXPECT_LT((last_msg_->cov_y_z*100 - 8.0*100), 0.05) << "incorrect value for cov_y_z, expected 8.0, is " << last_msg_->cov_y_z; - EXPECT_LT((last_msg_->cov_z_z*100 - 5.0*100), 0.05) << "incorrect value for cov_z_z, expected 5.0, is " << last_msg_->cov_z_z; - EXPECT_EQ(last_msg_->flags, 5) << "incorrect value for flags, expected 5, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 4) << "incorrect value for n_sats, expected 4, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 7) << "incorrect value for tow, expected 7, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - 6.0*100), 0.05) << "incorrect value for x, expected 6.0, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - 1.0*100), 0.05) << "incorrect value for y, expected 1.0, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 4.0*100), 0.05) << "incorrect value for z, expected 4.0, is " << last_msg_->z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cov_x_x * 100 - 8.0 * 100), 0.05) + << "incorrect value for cov_x_x, expected 8.0, is " << last_msg_->cov_x_x; + EXPECT_LT((last_msg_->cov_x_y * 100 - 7.0 * 100), 0.05) + << "incorrect value for cov_x_y, expected 7.0, is " << last_msg_->cov_x_y; + EXPECT_LT((last_msg_->cov_x_z * 100 - 2.0 * 100), 0.05) + << "incorrect value for cov_x_z, expected 2.0, is " << last_msg_->cov_x_z; + EXPECT_LT((last_msg_->cov_y_y * 100 - 6.0 * 100), 0.05) + << "incorrect value for cov_y_y, expected 6.0, is " << last_msg_->cov_y_y; + EXPECT_LT((last_msg_->cov_y_z * 100 - 8.0 * 100), 0.05) + << "incorrect value for cov_y_z, expected 8.0, is " << last_msg_->cov_y_z; + EXPECT_LT((last_msg_->cov_z_z * 100 - 5.0 * 100), 0.05) + << "incorrect value for cov_z_z, expected 5.0, is " << last_msg_->cov_z_z; + EXPECT_EQ(last_msg_->flags, 5) + << "incorrect value for flags, expected 5, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 4) + << "incorrect value for n_sats, expected 4, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 7) + << "incorrect value for tow, expected 7, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - 6.0 * 100), 0.05) + << "incorrect value for x, expected 6.0, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - 1.0 * 100), 0.05) + << "incorrect value for y, expected 1.0, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 4.0 * 100), 0.05) + << "incorrect value for z, expected 4.0, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFCovGNSS.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFCovGNSS.cc index e177a78bf..5758a7b13 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFCovGNSS.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFCovGNSS.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCovGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFCovGNSS.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_cov_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_cov_gnss_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,57 +82,80 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_cov_gnss_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS0, Test) -{ +}; - uint8_t encoded_frame[] = {85,52,2,0,16,54,24,229,233,29,52,254,158,218,42,142,68,193,69,162,89,91,34,68,80,193,131,21,176,129,239,174,77,65,158,232,30,60,218,221,20,60,129,136,198,187,205,120,166,60,5,166,35,188,122,177,115,60,18,4,159,102, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFCovGNSS0, Test) { + uint8_t encoded_frame[] = { + 85, 52, 2, 0, 16, 54, 24, 229, 233, 29, 52, 254, 158, + 218, 42, 142, 68, 193, 69, 162, 89, 91, 34, 68, 80, 193, + 131, 21, 176, 129, 239, 174, 77, 65, 158, 232, 30, 60, 218, + 221, 20, 60, 129, 136, 198, 187, 205, 120, 166, 60, 5, 166, + 35, 188, 122, 177, 115, 60, 18, 4, 159, 102, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_cov_gnss_t* test_msg = ( msg_pos_ecef_cov_gnss_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cov_x_x = 0.009699014946818352; - test_msg->cov_x_y = 0.009086096659302711; - test_msg->cov_x_z = -0.006058753002434969; - test_msg->cov_y_y = 0.020321274176239967; - test_msg->cov_y_z = -0.009988312609493732; - test_msg->cov_z_z = 0.01487385667860508; - test_msg->flags = 4; - test_msg->n_sats = 18; - test_msg->tow = 501867800; - test_msg->x = -2694229.7079770807; - test_msg->y = -4264073.427345817; - test_msg->z = 3890655.013186158; - - EXPECT_EQ(send_message( 0x234, 4096, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_cov_gnss_t *test_msg = + (msg_pos_ecef_cov_gnss_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cov_x_x = 0.009699014946818352; + test_msg->cov_x_y = 0.009086096659302711; + test_msg->cov_x_z = -0.006058753002434969; + test_msg->cov_y_y = 0.020321274176239967; + test_msg->cov_y_z = -0.009988312609493732; + test_msg->cov_z_z = 0.01487385667860508; + test_msg->flags = 4; + test_msg->n_sats = 18; + test_msg->tow = 501867800; + test_msg->x = -2694229.7079770807; + test_msg->y = -4264073.427345817; + test_msg->z = 3890655.013186158; + + EXPECT_EQ(send_message(0x234, 4096, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cov_x_x*100 - 0.00969901494682*100), 0.05) << "incorrect value for cov_x_x, expected 0.00969901494682, is " << last_msg_->cov_x_x; - EXPECT_LT((last_msg_->cov_x_y*100 - 0.0090860966593*100), 0.05) << "incorrect value for cov_x_y, expected 0.0090860966593, is " << last_msg_->cov_x_y; - EXPECT_LT((last_msg_->cov_x_z*100 - -0.00605875300243*100), 0.05) << "incorrect value for cov_x_z, expected -0.00605875300243, is " << last_msg_->cov_x_z; - EXPECT_LT((last_msg_->cov_y_y*100 - 0.0203212741762*100), 0.05) << "incorrect value for cov_y_y, expected 0.0203212741762, is " << last_msg_->cov_y_y; - EXPECT_LT((last_msg_->cov_y_z*100 - -0.00998831260949*100), 0.05) << "incorrect value for cov_y_z, expected -0.00998831260949, is " << last_msg_->cov_y_z; - EXPECT_LT((last_msg_->cov_z_z*100 - 0.0148738566786*100), 0.05) << "incorrect value for cov_z_z, expected 0.0148738566786, is " << last_msg_->cov_z_z; - EXPECT_EQ(last_msg_->flags, 4) << "incorrect value for flags, expected 4, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 18) << "incorrect value for n_sats, expected 18, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 501867800) << "incorrect value for tow, expected 501867800, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2694229.70798*100), 0.05) << "incorrect value for x, expected -2694229.70798, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4264073.42735*100), 0.05) << "incorrect value for y, expected -4264073.42735, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3890655.01319*100), 0.05) << "incorrect value for z, expected 3890655.01319, is " << last_msg_->z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cov_x_x * 100 - 0.00969901494682 * 100), 0.05) + << "incorrect value for cov_x_x, expected 0.00969901494682, is " + << last_msg_->cov_x_x; + EXPECT_LT((last_msg_->cov_x_y * 100 - 0.0090860966593 * 100), 0.05) + << "incorrect value for cov_x_y, expected 0.0090860966593, is " + << last_msg_->cov_x_y; + EXPECT_LT((last_msg_->cov_x_z * 100 - -0.00605875300243 * 100), 0.05) + << "incorrect value for cov_x_z, expected -0.00605875300243, is " + << last_msg_->cov_x_z; + EXPECT_LT((last_msg_->cov_y_y * 100 - 0.0203212741762 * 100), 0.05) + << "incorrect value for cov_y_y, expected 0.0203212741762, is " + << last_msg_->cov_y_y; + EXPECT_LT((last_msg_->cov_y_z * 100 - -0.00998831260949 * 100), 0.05) + << "incorrect value for cov_y_z, expected -0.00998831260949, is " + << last_msg_->cov_y_z; + EXPECT_LT((last_msg_->cov_z_z * 100 - 0.0148738566786 * 100), 0.05) + << "incorrect value for cov_z_z, expected 0.0148738566786, is " + << last_msg_->cov_z_z; + EXPECT_EQ(last_msg_->flags, 4) + << "incorrect value for flags, expected 4, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 18) + << "incorrect value for n_sats, expected 18, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 501867800) + << "incorrect value for tow, expected 501867800, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2694229.70798 * 100), 0.05) + << "incorrect value for x, expected -2694229.70798, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4264073.42735 * 100), 0.05) + << "incorrect value for y, expected -4264073.42735, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3890655.01319 * 100), 0.05) + << "incorrect value for z, expected 3890655.01319, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFDepA.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFDepA.cc index 67272646f..64a774f05 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,98 +81,101 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,246,215,32,20,46,39,0,195,122,175,75,33,154,68,193,164,14,230,176,231,95,80,193,78,220,22,253,254,105,77,65,0,0,9,0,13,86, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 9; - test_msg->tow = 2567700; - test_msg->x = -2700354.5912927105; - test_msg->y = -4292510.764041577; - test_msg->z = 3855357.977260149; - - EXPECT_EQ(send_message( 0x200, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567700) << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2700354.59129*100), 0.05) << "incorrect value for x, expected -2700354.59129, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4292510.76404*100), 0.05) << "incorrect value for y, expected -4292510.76404, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3855357.97726*100), 0.05) << "incorrect value for z, expected 3855357.97726, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 20, 46, 39, 0, 195, 122, 175, 75, + 33, 154, 68, 193, 164, 14, 230, 176, 231, 95, 80, 193, 78, 220, + 22, 253, 254, 105, 77, 65, 0, 0, 9, 0, 13, 86, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_dep_a_t *test_msg = (msg_pos_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 9; + test_msg->tow = 2567700; + test_msg->x = -2700354.5912927105; + test_msg->y = -4292510.764041577; + test_msg->z = 3855357.977260149; + + EXPECT_EQ(send_message(0x200, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567700) + << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2700354.59129 * 100), 0.05) + << "incorrect value for x, expected -2700354.59129, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4292510.76404 * 100), 0.05) + << "incorrect value for y, expected -4292510.76404, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3855357.97726 * 100), 0.05) + << "incorrect value for z, expected 3855357.97726, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -186,98 +185,101 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,246,215,32,20,46,39,0,212,196,12,42,34,154,68,193,9,113,112,123,231,95,80,193,54,97,38,192,254,105,77,65,0,0,9,1,75,143, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 1; - test_msg->n_sats = 9; - test_msg->tow = 2567700; - test_msg->x = -2700356.3285146747; - test_msg->y = -4292509.928737887; - test_msg->z = 3855357.5011712564; - - EXPECT_EQ(send_message( 0x200, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567700) << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2700356.32851*100), 0.05) << "incorrect value for x, expected -2700356.32851, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4292509.92874*100), 0.05) << "incorrect value for y, expected -4292509.92874, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3855357.50117*100), 0.05) << "incorrect value for z, expected 3855357.50117, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 20, 46, 39, 0, 212, 196, 12, 42, + 34, 154, 68, 193, 9, 113, 112, 123, 231, 95, 80, 193, 54, 97, + 38, 192, 254, 105, 77, 65, 0, 0, 9, 1, 75, 143, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_dep_a_t *test_msg = (msg_pos_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 1; + test_msg->n_sats = 9; + test_msg->tow = 2567700; + test_msg->x = -2700356.3285146747; + test_msg->y = -4292509.928737887; + test_msg->z = 3855357.5011712564; + + EXPECT_EQ(send_message(0x200, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567700) + << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2700356.32851 * 100), 0.05) + << "incorrect value for x, expected -2700356.32851, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4292509.92874 * 100), 0.05) + << "incorrect value for y, expected -4292509.92874, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3855357.50117 * 100), 0.05) + << "incorrect value for z, expected 3855357.50117, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -287,98 +289,101 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,246,215,32,120,46,39,0,112,97,39,190,34,154,68,193,230,43,119,115,231,95,80,193,50,199,76,66,254,105,77,65,0,0,9,0,204,113, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 9; - test_msg->tow = 2567800; - test_msg->x = -2700357.485576801; - test_msg->y = -4292509.80414865; - test_msg->z = 3855356.517968082; - - EXPECT_EQ(send_message( 0x200, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567800) << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2700357.48558*100), 0.05) << "incorrect value for x, expected -2700357.48558, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4292509.80415*100), 0.05) << "incorrect value for y, expected -4292509.80415, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3855356.51797*100), 0.05) << "incorrect value for z, expected 3855356.51797, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 120, 46, 39, 0, 112, 97, 39, 190, + 34, 154, 68, 193, 230, 43, 119, 115, 231, 95, 80, 193, 50, 199, + 76, 66, 254, 105, 77, 65, 0, 0, 9, 0, 204, 113, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_dep_a_t *test_msg = (msg_pos_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 9; + test_msg->tow = 2567800; + test_msg->x = -2700357.485576801; + test_msg->y = -4292509.80414865; + test_msg->z = 3855356.517968082; + + EXPECT_EQ(send_message(0x200, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567800) + << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2700357.48558 * 100), 0.05) + << "incorrect value for x, expected -2700357.48558, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4292509.80415 * 100), 0.05) + << "incorrect value for y, expected -4292509.80415, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3855356.51797 * 100), 0.05) + << "incorrect value for z, expected 3855356.51797, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -388,98 +393,101 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,246,215,32,120,46,39,0,194,82,121,4,34,154,68,193,223,186,1,140,231,95,80,193,176,152,147,181,254,105,77,65,0,0,9,1,97,71, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 1; - test_msg->n_sats = 9; - test_msg->tow = 2567800; - test_msg->x = -2700356.0349524925; - test_msg->y = -4292510.187605589; - test_msg->z = 3855357.4185667858; - - EXPECT_EQ(send_message( 0x200, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567800) << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2700356.03495*100), 0.05) << "incorrect value for x, expected -2700356.03495, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4292510.18761*100), 0.05) << "incorrect value for y, expected -4292510.18761, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3855357.41857*100), 0.05) << "incorrect value for z, expected 3855357.41857, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 120, 46, 39, 0, 194, 82, 121, 4, + 34, 154, 68, 193, 223, 186, 1, 140, 231, 95, 80, 193, 176, 152, + 147, 181, 254, 105, 77, 65, 0, 0, 9, 1, 97, 71, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_dep_a_t *test_msg = (msg_pos_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 1; + test_msg->n_sats = 9; + test_msg->tow = 2567800; + test_msg->x = -2700356.0349524925; + test_msg->y = -4292510.187605589; + test_msg->z = 3855357.4185667858; + + EXPECT_EQ(send_message(0x200, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567800) + << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2700356.03495 * 100), 0.05) + << "incorrect value for x, expected -2700356.03495, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4292510.18761 * 100), 0.05) + << "incorrect value for y, expected -4292510.18761, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3855357.41857 * 100), 0.05) + << "incorrect value for z, expected 3855357.41857, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -489,98 +497,101 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,246,215,32,220,46,39,0,216,41,227,254,33,154,68,193,9,151,154,124,231,95,80,193,1,183,214,139,255,105,77,65,0,0,9,0,7,98, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 9; - test_msg->tow = 2567900; - test_msg->x = -2700355.9913074784; - test_msg->y = -4292509.946935424; - test_msg->z = 3855359.0924900775; - - EXPECT_EQ(send_message( 0x200, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567900) << "incorrect value for tow, expected 2567900, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2700355.99131*100), 0.05) << "incorrect value for x, expected -2700355.99131, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4292509.94694*100), 0.05) << "incorrect value for y, expected -4292509.94694, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3855359.09249*100), 0.05) << "incorrect value for z, expected 3855359.09249, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 246, 215, 32, 220, 46, 39, 0, 216, 41, 227, 254, + 33, 154, 68, 193, 9, 151, 154, 124, 231, 95, 80, 193, 1, 183, + 214, 139, 255, 105, 77, 65, 0, 0, 9, 0, 7, 98, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_dep_a_t *test_msg = (msg_pos_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 9; + test_msg->tow = 2567900; + test_msg->x = -2700355.9913074784; + test_msg->y = -4292509.946935424; + test_msg->z = 3855359.0924900775; + + EXPECT_EQ(send_message(0x200, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567900) + << "incorrect value for tow, expected 2567900, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2700355.99131 * 100), 0.05) + << "incorrect value for x, expected -2700355.99131, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4292509.94694 * 100), 0.05) + << "incorrect value for y, expected -4292509.94694, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3855359.09249 * 100), 0.05) + << "incorrect value for z, expected 3855359.09249, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -590,98 +601,101 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,195,4,32,212,157,67,24,153,222,105,1,252,161,68,193,254,247,52,112,74,67,80,193,164,207,47,146,44,163,77,65,0,0,8,0,145,4, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 8; - test_msg->tow = 407084500; - test_msg->x = -2704376.0110433814; - test_msg->y = -4263209.753232954; - test_msg->z = 3884633.142084079; - - EXPECT_EQ(send_message( 0x200, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084500) << "incorrect value for tow, expected 407084500, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2704376.01104*100), 0.05) << "incorrect value for x, expected -2704376.01104, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4263209.75323*100), 0.05) << "incorrect value for y, expected -4263209.75323, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3884633.14208*100), 0.05) << "incorrect value for z, expected 3884633.14208, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 212, 157, 67, 24, 153, 222, 105, 1, + 252, 161, 68, 193, 254, 247, 52, 112, 74, 67, 80, 193, 164, 207, + 47, 146, 44, 163, 77, 65, 0, 0, 8, 0, 145, 4, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_dep_a_t *test_msg = (msg_pos_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 8; + test_msg->tow = 407084500; + test_msg->x = -2704376.0110433814; + test_msg->y = -4263209.753232954; + test_msg->z = 3884633.142084079; + + EXPECT_EQ(send_message(0x200, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084500) + << "incorrect value for tow, expected 407084500, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2704376.01104 * 100), 0.05) + << "incorrect value for x, expected -2704376.01104, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4263209.75323 * 100), 0.05) + << "incorrect value for y, expected -4263209.75323, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3884633.14208 * 100), 0.05) + << "incorrect value for z, expected 3884633.14208, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA6 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA6() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA6 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA6() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -691,98 +705,101 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA6 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,195,4,32,56,158,67,24,215,184,223,246,251,161,68,193,36,126,17,39,74,67,80,193,19,179,70,80,44,163,77,65,0,0,8,0,245,66, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 8; - test_msg->tow = 407084600; - test_msg->x = -2704375.9287024545; - test_msg->y = -4263208.610442672; - test_msg->z = 3884632.627157578; - - EXPECT_EQ(send_message( 0x200, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084600) << "incorrect value for tow, expected 407084600, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2704375.9287*100), 0.05) << "incorrect value for x, expected -2704375.9287, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4263208.61044*100), 0.05) << "incorrect value for y, expected -4263208.61044, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3884632.62716*100), 0.05) << "incorrect value for z, expected 3884632.62716, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 56, 158, 67, 24, 215, 184, 223, 246, + 251, 161, 68, 193, 36, 126, 17, 39, 74, 67, 80, 193, 19, 179, + 70, 80, 44, 163, 77, 65, 0, 0, 8, 0, 245, 66, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_dep_a_t *test_msg = (msg_pos_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 8; + test_msg->tow = 407084600; + test_msg->x = -2704375.9287024545; + test_msg->y = -4263208.610442672; + test_msg->z = 3884632.627157578; + + EXPECT_EQ(send_message(0x200, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084600) + << "incorrect value for tow, expected 407084600, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2704375.9287 * 100), 0.05) + << "incorrect value for x, expected -2704375.9287, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4263208.61044 * 100), 0.05) + << "incorrect value for y, expected -4263208.61044, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3884632.62716 * 100), 0.05) + << "incorrect value for z, expected 3884632.62716, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA7 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA7() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA7 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA7() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -792,98 +809,101 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA7 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,195,4,32,156,158,67,24,73,74,214,148,251,161,68,193,213,151,184,215,73,67,80,193,110,99,38,164,43,163,77,65,0,0,8,0,5,223, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 8; - test_msg->tow = 407084700; - test_msg->x = -2704375.162789617; - test_msg->y = -4263207.370641668; - test_msg->z = 3884631.282421521; - - EXPECT_EQ(send_message( 0x200, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084700) << "incorrect value for tow, expected 407084700, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2704375.16279*100), 0.05) << "incorrect value for x, expected -2704375.16279, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4263207.37064*100), 0.05) << "incorrect value for y, expected -4263207.37064, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3884631.28242*100), 0.05) << "incorrect value for z, expected 3884631.28242, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 156, 158, 67, 24, 73, 74, 214, 148, + 251, 161, 68, 193, 213, 151, 184, 215, 73, 67, 80, 193, 110, 99, + 38, 164, 43, 163, 77, 65, 0, 0, 8, 0, 5, 223, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_dep_a_t *test_msg = (msg_pos_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 8; + test_msg->tow = 407084700; + test_msg->x = -2704375.162789617; + test_msg->y = -4263207.370641668; + test_msg->z = 3884631.282421521; + + EXPECT_EQ(send_message(0x200, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084700) + << "incorrect value for tow, expected 407084700, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2704375.16279 * 100), 0.05) + << "incorrect value for x, expected -2704375.16279, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4263207.37064 * 100), 0.05) + << "incorrect value for y, expected -4263207.37064, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3884631.28242 * 100), 0.05) + << "incorrect value for z, expected 3884631.28242, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA8 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA8() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA8 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA8() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -893,98 +913,101 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA8 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,195,4,32,0,159,67,24,177,111,112,45,252,161,68,193,213,168,198,253,73,67,80,193,245,12,228,12,44,163,77,65,0,0,8,0,143,212, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 8; - test_msg->tow = 407084800; - test_msg->x = -2704376.3549937834; - test_msg->y = -4263207.965250214; - test_msg->z = 3884632.1007095524; - - EXPECT_EQ(send_message( 0x200, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084800) << "incorrect value for tow, expected 407084800, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2704376.35499*100), 0.05) << "incorrect value for x, expected -2704376.35499, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4263207.96525*100), 0.05) << "incorrect value for y, expected -4263207.96525, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3884632.10071*100), 0.05) << "incorrect value for z, expected 3884632.10071, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 0, 159, 67, 24, 177, 111, 112, 45, + 252, 161, 68, 193, 213, 168, 198, 253, 73, 67, 80, 193, 245, 12, + 228, 12, 44, 163, 77, 65, 0, 0, 8, 0, 143, 212, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_dep_a_t *test_msg = (msg_pos_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 8; + test_msg->tow = 407084800; + test_msg->x = -2704376.3549937834; + test_msg->y = -4263207.965250214; + test_msg->z = 3884632.1007095524; + + EXPECT_EQ(send_message(0x200, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084800) + << "incorrect value for tow, expected 407084800, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2704376.35499 * 100), 0.05) + << "incorrect value for x, expected -2704376.35499, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4263207.96525 * 100), 0.05) + << "incorrect value for y, expected -4263207.96525, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3884632.10071 * 100), 0.05) + << "incorrect value for z, expected 3884632.10071, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA9 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA9() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA9 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA9() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -994,98 +1017,101 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA9 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA9, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,195,4,32,100,159,67,24,67,231,72,165,251,161,68,193,150,210,36,212,73,67,80,193,234,33,25,189,43,163,77,65,0,0,8,0,70,221, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 8; - test_msg->tow = 407084900; - test_msg->x = -2704375.291287334; - test_msg->y = -4263207.314747473; - test_msg->z = 3884631.4773294823; - - EXPECT_EQ(send_message( 0x200, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084900) << "incorrect value for tow, expected 407084900, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2704375.29129*100), 0.05) << "incorrect value for x, expected -2704375.29129, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4263207.31475*100), 0.05) << "incorrect value for y, expected -4263207.31475, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3884631.47733*100), 0.05) << "incorrect value for z, expected 3884631.47733, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA9, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 100, 159, 67, 24, 67, 231, 72, 165, + 251, 161, 68, 193, 150, 210, 36, 212, 73, 67, 80, 193, 234, 33, + 25, 189, 43, 163, 77, 65, 0, 0, 8, 0, 70, 221, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_dep_a_t *test_msg = (msg_pos_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 8; + test_msg->tow = 407084900; + test_msg->x = -2704375.291287334; + test_msg->y = -4263207.314747473; + test_msg->z = 3884631.4773294823; + + EXPECT_EQ(send_message(0x200, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084900) + << "incorrect value for tow, expected 407084900, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2704375.29129 * 100), 0.05) + << "incorrect value for x, expected -2704375.29129, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4263207.31475 * 100), 0.05) + << "incorrect value for y, expected -4263207.31475, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3884631.47733 * 100), 0.05) + << "incorrect value for z, expected 3884631.47733, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA10 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA10() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA10 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA10() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -1095,47 +1121,56 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA10 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA10, Test) -{ - - uint8_t encoded_frame[] = {85,0,2,195,4,32,46,162,68,24,224,72,131,215,251,161,68,193,180,123,222,94,74,67,80,193,191,3,131,193,45,163,77,65,0,0,5,0,17,221, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_dep_a_t* test_msg = ( msg_pos_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 5; - test_msg->tow = 407151150; - test_msg->x = -2704375.68369399; - test_msg->y = -4263209.482329298; - test_msg->z = 3884635.5118107493; - - EXPECT_EQ(send_message( 0x200, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 5) << "incorrect value for n_sats, expected 5, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407151150) << "incorrect value for tow, expected 407151150, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2704375.68369*100), 0.05) << "incorrect value for x, expected -2704375.68369, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4263209.48233*100), 0.05) << "incorrect value for y, expected -4263209.48233, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3884635.51181*100), 0.05) << "incorrect value for z, expected 3884635.51181, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFDepA10, Test) { + uint8_t encoded_frame[] = { + 85, 0, 2, 195, 4, 32, 46, 162, 68, 24, 224, 72, 131, 215, + 251, 161, 68, 193, 180, 123, 222, 94, 74, 67, 80, 193, 191, 3, + 131, 193, 45, 163, 77, 65, 0, 0, 5, 0, 17, 221, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_dep_a_t *test_msg = (msg_pos_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 5; + test_msg->tow = 407151150; + test_msg->x = -2704375.68369399; + test_msg->y = -4263209.482329298; + test_msg->z = 3884635.5118107493; + + EXPECT_EQ(send_message(0x200, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 5) + << "incorrect value for n_sats, expected 5, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407151150) + << "incorrect value for tow, expected 407151150, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2704375.68369 * 100), 0.05) + << "incorrect value for x, expected -2704375.68369, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4263209.48233 * 100), 0.05) + << "incorrect value for y, expected -4263209.48233, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3884635.51181 * 100), 0.05) + << "incorrect value for z, expected 3884635.51181, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFGNSS.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFGNSS.cc index 310c32401..124430c33 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFGNSS.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosECEFGNSS.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosECEFGNSS.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgPosECEFGNSS0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosECEFGNSS0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosECEFGNSS0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosECEFGNSS0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_ecef_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_ecef_gnss_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,47 +81,57 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosECEFGNSS0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_ecef_gnss_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFGNSS0, Test) -{ +}; - uint8_t encoded_frame[] = {85,41,2,0,16,32,24,229,233,29,52,254,158,218,42,142,68,193,69,162,89,91,34,68,80,193,131,21,176,129,239,174,77,65,182,0,18,4,135,2, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosECEFGNSS0, Test) { + uint8_t encoded_frame[] = { + 85, 41, 2, 0, 16, 32, 24, 229, 233, 29, 52, 254, 158, 218, + 42, 142, 68, 193, 69, 162, 89, 91, 34, 68, 80, 193, 131, 21, + 176, 129, 239, 174, 77, 65, 182, 0, 18, 4, 135, 2, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_ecef_gnss_t* test_msg = ( msg_pos_ecef_gnss_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 182; - test_msg->flags = 4; - test_msg->n_sats = 18; - test_msg->tow = 501867800; - test_msg->x = -2694229.7079770807; - test_msg->y = -4264073.427345817; - test_msg->z = 3890655.013186158; - - EXPECT_EQ(send_message( 0x229, 4096, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_ecef_gnss_t *test_msg = (msg_pos_ecef_gnss_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 182; + test_msg->flags = 4; + test_msg->n_sats = 18; + test_msg->tow = 501867800; + test_msg->x = -2694229.7079770807; + test_msg->y = -4264073.427345817; + test_msg->z = 3890655.013186158; + + EXPECT_EQ(send_message(0x229, 4096, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 182) << "incorrect value for accuracy, expected 182, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 4) << "incorrect value for flags, expected 4, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 18) << "incorrect value for n_sats, expected 18, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 501867800) << "incorrect value for tow, expected 501867800, is " << last_msg_->tow; - EXPECT_LT((last_msg_->x*100 - -2694229.70798*100), 0.05) << "incorrect value for x, expected -2694229.70798, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4264073.42735*100), 0.05) << "incorrect value for y, expected -4264073.42735, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3890655.01319*100), 0.05) << "incorrect value for z, expected 3890655.01319, is " << last_msg_->z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 182) + << "incorrect value for accuracy, expected 182, is " + << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 4) + << "incorrect value for flags, expected 4, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 18) + << "incorrect value for n_sats, expected 18, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 501867800) + << "incorrect value for tow, expected 501867800, is " << last_msg_->tow; + EXPECT_LT((last_msg_->x * 100 - -2694229.70798 * 100), 0.05) + << "incorrect value for x, expected -2694229.70798, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4264073.42735 * 100), 0.05) + << "incorrect value for y, expected -4264073.42735, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3890655.01319 * 100), 0.05) + << "incorrect value for z, expected 3890655.01319, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLLH.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLLH.cc index f158385ac..0ec9387a9 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLLH.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLLH.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLH.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLH.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgPosLLH0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLH0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLH0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLH0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,100 +81,109 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLH0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLH0, Test) -{ - - uint8_t encoded_frame[] = {85,10,2,211,136,34,40,244,122,19,201,106,155,186,42,160,66,64,168,109,26,225,0,120,94,192,130,102,237,230,43,54,60,64,0,0,0,0,14,2,175,162, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_t* test_msg = ( msg_pos_llh_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 2; - test_msg->h_accuracy = 0; - test_msg->height = 28.21160739227208; - test_msg->lat = 37.25130398358085; - test_msg->lon = -121.87505366879361; - test_msg->n_sats = 14; - test_msg->tow = 326825000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x20a, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 2) << "incorrect value for flags, expected 2, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 28.2116073923*100), 0.05) << "incorrect value for height, expected 28.2116073923, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.2513039836*100), 0.05) << "incorrect value for lat, expected 37.2513039836, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -121.875053669*100), 0.05) << "incorrect value for lon, expected -121.875053669, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 14) << "incorrect value for n_sats, expected 14, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326825000) << "incorrect value for tow, expected 326825000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLH0, Test) { + uint8_t encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 40, 244, 122, 19, 201, 106, 155, 186, + 42, 160, 66, 64, 168, 109, 26, 225, 0, 120, 94, 192, 130, 102, + 237, 230, 43, 54, 60, 64, 0, 0, 0, 0, 14, 2, 175, 162, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_t *test_msg = (msg_pos_llh_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 2; + test_msg->h_accuracy = 0; + test_msg->height = 28.21160739227208; + test_msg->lat = 37.25130398358085; + test_msg->lon = -121.87505366879361; + test_msg->n_sats = 14; + test_msg->tow = 326825000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x20a, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 2) + << "incorrect value for flags, expected 2, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 28.2116073923 * 100), 0.05) + << "incorrect value for height, expected 28.2116073923, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.2513039836 * 100), 0.05) + << "incorrect value for lat, expected 37.2513039836, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -121.875053669 * 100), 0.05) + << "incorrect value for lon, expected -121.875053669, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 14) + << "incorrect value for n_sats, expected 14, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326825000) + << "incorrect value for tow, expected 326825000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgPosLLH1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLH1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLH1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLH1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -188,100 +193,109 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLH1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLH1, Test) -{ - - uint8_t encoded_frame[] = {85,10,2,211,136,34,16,248,122,19,52,177,251,178,42,160,66,64,237,22,97,224,0,120,94,192,107,188,109,90,247,189,59,64,0,0,0,0,15,2,38,177, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_t* test_msg = ( msg_pos_llh_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 2; - test_msg->h_accuracy = 0; - test_msg->height = 27.742055560866373; - test_msg->lat = 37.251303074738104; - test_msg->lon = -121.87505349618341; - test_msg->n_sats = 15; - test_msg->tow = 326826000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x20a, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 2) << "incorrect value for flags, expected 2, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 27.7420555609*100), 0.05) << "incorrect value for height, expected 27.7420555609, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.2513030747*100), 0.05) << "incorrect value for lat, expected 37.2513030747, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -121.875053496*100), 0.05) << "incorrect value for lon, expected -121.875053496, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326826000) << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLH1, Test) { + uint8_t encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 16, 248, 122, 19, 52, 177, 251, 178, + 42, 160, 66, 64, 237, 22, 97, 224, 0, 120, 94, 192, 107, 188, + 109, 90, 247, 189, 59, 64, 0, 0, 0, 0, 15, 2, 38, 177, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_t *test_msg = (msg_pos_llh_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 2; + test_msg->h_accuracy = 0; + test_msg->height = 27.742055560866373; + test_msg->lat = 37.251303074738104; + test_msg->lon = -121.87505349618341; + test_msg->n_sats = 15; + test_msg->tow = 326826000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x20a, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 2) + << "incorrect value for flags, expected 2, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 27.7420555609 * 100), 0.05) + << "incorrect value for height, expected 27.7420555609, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.2513030747 * 100), 0.05) + << "incorrect value for lat, expected 37.2513030747, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -121.875053496 * 100), 0.05) + << "incorrect value for lon, expected -121.875053496, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326826000) + << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgPosLLH2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLH2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLH2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLH2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -291,100 +305,109 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLH2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLH2, Test) -{ - - uint8_t encoded_frame[] = {85,10,2,211,136,34,248,251,122,19,135,66,9,163,42,160,66,64,146,8,99,225,0,120,94,192,45,181,143,219,28,157,59,64,0,0,0,0,15,2,51,40, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_t* test_msg = ( msg_pos_llh_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 2; - test_msg->h_accuracy = 0; - test_msg->height = 27.613721582970516; - test_msg->lat = 37.25130117370741; - test_msg->lon = -121.87505373641241; - test_msg->n_sats = 15; - test_msg->tow = 326827000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x20a, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 2) << "incorrect value for flags, expected 2, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 27.613721583*100), 0.05) << "incorrect value for height, expected 27.613721583, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.2513011737*100), 0.05) << "incorrect value for lat, expected 37.2513011737, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -121.875053736*100), 0.05) << "incorrect value for lon, expected -121.875053736, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326827000) << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLH2, Test) { + uint8_t encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 248, 251, 122, 19, 135, 66, 9, 163, + 42, 160, 66, 64, 146, 8, 99, 225, 0, 120, 94, 192, 45, 181, + 143, 219, 28, 157, 59, 64, 0, 0, 0, 0, 15, 2, 51, 40, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_t *test_msg = (msg_pos_llh_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 2; + test_msg->h_accuracy = 0; + test_msg->height = 27.613721582970516; + test_msg->lat = 37.25130117370741; + test_msg->lon = -121.87505373641241; + test_msg->n_sats = 15; + test_msg->tow = 326827000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x20a, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 2) + << "incorrect value for flags, expected 2, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 27.613721583 * 100), 0.05) + << "incorrect value for height, expected 27.613721583, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.2513011737 * 100), 0.05) + << "incorrect value for lat, expected 37.2513011737, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -121.875053736 * 100), 0.05) + << "incorrect value for lon, expected -121.875053736, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326827000) + << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgPosLLH3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLH3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLH3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLH3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -394,100 +417,109 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLH3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLH3, Test) -{ - - uint8_t encoded_frame[] = {85,10,2,211,136,34,224,255,122,19,18,44,253,119,42,160,66,64,48,109,39,231,0,120,94,192,185,76,48,17,119,205,59,64,0,0,0,0,15,2,12,194, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_t* test_msg = ( msg_pos_llh_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 2; - test_msg->h_accuracy = 0; - test_msg->height = 27.80259807042305; - test_msg->lat = 37.251296042079176; - test_msg->lon = -121.87505511141057; - test_msg->n_sats = 15; - test_msg->tow = 326828000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x20a, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 2) << "incorrect value for flags, expected 2, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 27.8025980704*100), 0.05) << "incorrect value for height, expected 27.8025980704, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.2512960421*100), 0.05) << "incorrect value for lat, expected 37.2512960421, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -121.875055111*100), 0.05) << "incorrect value for lon, expected -121.875055111, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326828000) << "incorrect value for tow, expected 326828000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLH3, Test) { + uint8_t encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 224, 255, 122, 19, 18, 44, 253, 119, + 42, 160, 66, 64, 48, 109, 39, 231, 0, 120, 94, 192, 185, 76, + 48, 17, 119, 205, 59, 64, 0, 0, 0, 0, 15, 2, 12, 194, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_t *test_msg = (msg_pos_llh_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 2; + test_msg->h_accuracy = 0; + test_msg->height = 27.80259807042305; + test_msg->lat = 37.251296042079176; + test_msg->lon = -121.87505511141057; + test_msg->n_sats = 15; + test_msg->tow = 326828000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x20a, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 2) + << "incorrect value for flags, expected 2, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 27.8025980704 * 100), 0.05) + << "incorrect value for height, expected 27.8025980704, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.2512960421 * 100), 0.05) + << "incorrect value for lat, expected 37.2512960421, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -121.875055111 * 100), 0.05) + << "incorrect value for lon, expected -121.875055111, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326828000) + << "incorrect value for tow, expected 326828000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgPosLLH4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLH4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLH4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLH4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -497,49 +529,64 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLH4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLH4, Test) -{ - - uint8_t encoded_frame[] = {85,10,2,211,136,34,200,3,123,19,225,237,238,90,42,160,66,64,59,143,70,235,0,120,94,192,101,106,249,224,131,240,59,64,0,0,0,0,15,2,34,103, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_t* test_msg = ( msg_pos_llh_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 2; - test_msg->h_accuracy = 0; - test_msg->height = 27.939512310879213; - test_msg->lat = 37.251292578377395; - test_msg->lon = -121.87505609407974; - test_msg->n_sats = 15; - test_msg->tow = 326829000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x20a, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 2) << "incorrect value for flags, expected 2, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 27.9395123109*100), 0.05) << "incorrect value for height, expected 27.9395123109, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.2512925784*100), 0.05) << "incorrect value for lat, expected 37.2512925784, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -121.875056094*100), 0.05) << "incorrect value for lon, expected -121.875056094, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326829000) << "incorrect value for tow, expected 326829000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLH4, Test) { + uint8_t encoded_frame[] = { + 85, 10, 2, 211, 136, 34, 200, 3, 123, 19, 225, 237, 238, 90, + 42, 160, 66, 64, 59, 143, 70, 235, 0, 120, 94, 192, 101, 106, + 249, 224, 131, 240, 59, 64, 0, 0, 0, 0, 15, 2, 34, 103, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_t *test_msg = (msg_pos_llh_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 2; + test_msg->h_accuracy = 0; + test_msg->height = 27.939512310879213; + test_msg->lat = 37.251292578377395; + test_msg->lon = -121.87505609407974; + test_msg->n_sats = 15; + test_msg->tow = 326829000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x20a, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 2) + << "incorrect value for flags, expected 2, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 27.9395123109 * 100), 0.05) + << "incorrect value for height, expected 27.9395123109, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.2512925784 * 100), 0.05) + << "incorrect value for lat, expected 37.2512925784, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -121.875056094 * 100), 0.05) + << "incorrect value for lon, expected -121.875056094, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326829000) + << "incorrect value for tow, expected 326829000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLLHCov.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLLHCov.cc index 9b84623f5..028172bc4 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLLHCov.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLLHCov.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHCov.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHCov.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgPosLLHCov0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLHCov0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLHCov0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLHCov0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_cov_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_cov_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,57 +81,72 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLHCov0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_cov_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHCov0, Test) -{ +}; - uint8_t encoded_frame[] = {85,17,2,66,0,54,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,64,0,0,0,0,0,0,0,0,0,0,224,64,0,0,160,64,0,0,0,65,0,0,192,64,0,0,128,63,0,0,0,64,5,5,151,98, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHCov0, Test) { + uint8_t encoded_frame[] = { + 85, 17, 2, 66, 0, 54, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 28, 64, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 224, 64, 0, 0, 160, 64, 0, 0, 0, 65, 0, 0, + 192, 64, 0, 0, 128, 63, 0, 0, 0, 64, 5, 5, 151, 98, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_cov_t* test_msg = ( msg_pos_llh_cov_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cov_d_d = 2.0; - test_msg->cov_e_d = 1.0; - test_msg->cov_e_e = 6.0; - test_msg->cov_n_d = 8.0; - test_msg->cov_n_e = 5.0; - test_msg->cov_n_n = 7.0; - test_msg->flags = 5; - test_msg->height = 0.0; - test_msg->lat = 0.0; - test_msg->lon = 7.0; - test_msg->n_sats = 5; - test_msg->tow = 7; - - EXPECT_EQ(send_message( 0x211, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_cov_t *test_msg = (msg_pos_llh_cov_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cov_d_d = 2.0; + test_msg->cov_e_d = 1.0; + test_msg->cov_e_e = 6.0; + test_msg->cov_n_d = 8.0; + test_msg->cov_n_e = 5.0; + test_msg->cov_n_n = 7.0; + test_msg->flags = 5; + test_msg->height = 0.0; + test_msg->lat = 0.0; + test_msg->lon = 7.0; + test_msg->n_sats = 5; + test_msg->tow = 7; + + EXPECT_EQ(send_message(0x211, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cov_d_d*100 - 2.0*100), 0.05) << "incorrect value for cov_d_d, expected 2.0, is " << last_msg_->cov_d_d; - EXPECT_LT((last_msg_->cov_e_d*100 - 1.0*100), 0.05) << "incorrect value for cov_e_d, expected 1.0, is " << last_msg_->cov_e_d; - EXPECT_LT((last_msg_->cov_e_e*100 - 6.0*100), 0.05) << "incorrect value for cov_e_e, expected 6.0, is " << last_msg_->cov_e_e; - EXPECT_LT((last_msg_->cov_n_d*100 - 8.0*100), 0.05) << "incorrect value for cov_n_d, expected 8.0, is " << last_msg_->cov_n_d; - EXPECT_LT((last_msg_->cov_n_e*100 - 5.0*100), 0.05) << "incorrect value for cov_n_e, expected 5.0, is " << last_msg_->cov_n_e; - EXPECT_LT((last_msg_->cov_n_n*100 - 7.0*100), 0.05) << "incorrect value for cov_n_n, expected 7.0, is " << last_msg_->cov_n_n; - EXPECT_EQ(last_msg_->flags, 5) << "incorrect value for flags, expected 5, is " << last_msg_->flags; - EXPECT_LT((last_msg_->height*100 - 0.0*100), 0.05) << "incorrect value for height, expected 0.0, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 0.0*100), 0.05) << "incorrect value for lat, expected 0.0, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - 7.0*100), 0.05) << "incorrect value for lon, expected 7.0, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 5) << "incorrect value for n_sats, expected 5, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 7) << "incorrect value for tow, expected 7, is " << last_msg_->tow; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cov_d_d * 100 - 2.0 * 100), 0.05) + << "incorrect value for cov_d_d, expected 2.0, is " << last_msg_->cov_d_d; + EXPECT_LT((last_msg_->cov_e_d * 100 - 1.0 * 100), 0.05) + << "incorrect value for cov_e_d, expected 1.0, is " << last_msg_->cov_e_d; + EXPECT_LT((last_msg_->cov_e_e * 100 - 6.0 * 100), 0.05) + << "incorrect value for cov_e_e, expected 6.0, is " << last_msg_->cov_e_e; + EXPECT_LT((last_msg_->cov_n_d * 100 - 8.0 * 100), 0.05) + << "incorrect value for cov_n_d, expected 8.0, is " << last_msg_->cov_n_d; + EXPECT_LT((last_msg_->cov_n_e * 100 - 5.0 * 100), 0.05) + << "incorrect value for cov_n_e, expected 5.0, is " << last_msg_->cov_n_e; + EXPECT_LT((last_msg_->cov_n_n * 100 - 7.0 * 100), 0.05) + << "incorrect value for cov_n_n, expected 7.0, is " << last_msg_->cov_n_n; + EXPECT_EQ(last_msg_->flags, 5) + << "incorrect value for flags, expected 5, is " << last_msg_->flags; + EXPECT_LT((last_msg_->height * 100 - 0.0 * 100), 0.05) + << "incorrect value for height, expected 0.0, is " << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 0.0 * 100), 0.05) + << "incorrect value for lat, expected 0.0, is " << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - 7.0 * 100), 0.05) + << "incorrect value for lon, expected 7.0, is " << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 5) + << "incorrect value for n_sats, expected 5, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 7) + << "incorrect value for tow, expected 7, is " << last_msg_->tow; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLLHDepA.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLLHDepA.cc index a0e355102..4175f59e3 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLLHDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLLHDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLLHDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,100 +81,109 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,246,215,34,20,46,39,0,250,29,226,186,235,182,66,64,19,203,51,196,24,139,94,192,31,157,160,232,122,115,81,64,0,0,0,0,9,0,236,139, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->height = 69.80437675175607; - test_msg->lat = 37.42906890908121; - test_msg->lon = -122.17338662202773; - test_msg->n_sats = 9; - test_msg->tow = 2567700; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x201, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 69.8043767518*100), 0.05) << "incorrect value for height, expected 69.8043767518, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.4290689091*100), 0.05) << "incorrect value for lat, expected 37.4290689091, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -122.173386622*100), 0.05) << "incorrect value for lon, expected -122.173386622, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567700) << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 20, 46, 39, 0, 250, 29, 226, 186, + 235, 182, 66, 64, 19, 203, 51, 196, 24, 139, 94, 192, 31, 157, + 160, 232, 122, 115, 81, 64, 0, 0, 0, 0, 9, 0, 236, 139, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_dep_a_t *test_msg = (msg_pos_llh_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->height = 69.80437675175607; + test_msg->lat = 37.42906890908121; + test_msg->lon = -122.17338662202773; + test_msg->n_sats = 9; + test_msg->tow = 2567700; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x201, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 69.8043767518 * 100), 0.05) + << "incorrect value for height, expected 69.8043767518, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.4290689091 * 100), 0.05) + << "incorrect value for lat, expected 37.4290689091, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -122.173386622 * 100), 0.05) + << "incorrect value for lon, expected -122.173386622, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567700) + << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -188,100 +193,109 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,246,215,34,20,46,39,0,161,51,75,148,235,182,66,64,36,41,246,30,25,139,94,192,254,218,49,127,10,108,81,64,0,0,0,0,9,1,25,117, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 1; - test_msg->h_accuracy = 0; - test_msg->height = 69.68814067715354; - test_msg->lat = 37.42906430885274; - test_msg->lon = -122.17340826071865; - test_msg->n_sats = 9; - test_msg->tow = 2567700; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x201, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 69.6881406772*100), 0.05) << "incorrect value for height, expected 69.6881406772, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.4290643089*100), 0.05) << "incorrect value for lat, expected 37.4290643089, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -122.173408261*100), 0.05) << "incorrect value for lon, expected -122.173408261, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567700) << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 20, 46, 39, 0, 161, 51, 75, 148, + 235, 182, 66, 64, 36, 41, 246, 30, 25, 139, 94, 192, 254, 218, + 49, 127, 10, 108, 81, 64, 0, 0, 0, 0, 9, 1, 25, 117, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_dep_a_t *test_msg = (msg_pos_llh_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 1; + test_msg->h_accuracy = 0; + test_msg->height = 69.68814067715354; + test_msg->lat = 37.42906430885274; + test_msg->lon = -122.17340826071865; + test_msg->n_sats = 9; + test_msg->tow = 2567700; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x201, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 69.6881406772 * 100), 0.05) + << "incorrect value for height, expected 69.6881406772, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.4290643089 * 100), 0.05) + << "incorrect value for lat, expected 37.4290643089, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -122.173408261 * 100), 0.05) + << "incorrect value for lon, expected -122.173408261, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567700) + << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -291,100 +305,109 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,246,215,34,120,46,39,0,56,214,210,65,235,182,66,64,13,46,132,80,25,139,94,192,22,143,46,234,191,95,81,64,0,0,0,0,9,0,174,105, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->height = 69.49608854815264; - test_msg->lat = 37.42905447764173; - test_msg->lon = -122.17342007549469; - test_msg->n_sats = 9; - test_msg->tow = 2567800; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x201, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 69.4960885482*100), 0.05) << "incorrect value for height, expected 69.4960885482, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.4290544776*100), 0.05) << "incorrect value for lat, expected 37.4290544776, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -122.173420075*100), 0.05) << "incorrect value for lon, expected -122.173420075, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567800) << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 120, 46, 39, 0, 56, 214, 210, 65, + 235, 182, 66, 64, 13, 46, 132, 80, 25, 139, 94, 192, 22, 143, + 46, 234, 191, 95, 81, 64, 0, 0, 0, 0, 9, 0, 174, 105, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_dep_a_t *test_msg = (msg_pos_llh_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->height = 69.49608854815264; + test_msg->lat = 37.42905447764173; + test_msg->lon = -122.17342007549469; + test_msg->n_sats = 9; + test_msg->tow = 2567800; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x201, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 69.4960885482 * 100), 0.05) + << "incorrect value for height, expected 69.4960885482, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.4290544776 * 100), 0.05) + << "incorrect value for lat, expected 37.4290544776, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -122.173420075 * 100), 0.05) + << "incorrect value for lon, expected -122.173420075, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567800) + << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -394,100 +417,109 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,246,215,34,120,46,39,0,251,117,115,140,235,182,66,64,152,134,167,12,25,139,94,192,160,22,137,253,4,108,81,64,0,0,0,0,9,1,122,127, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 1; - test_msg->h_accuracy = 0; - test_msg->height = 69.68780458819901; - test_msg->lat = 37.429063373925565; - test_msg->lon = -122.17340389594972; - test_msg->n_sats = 9; - test_msg->tow = 2567800; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x201, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 69.6878045882*100), 0.05) << "incorrect value for height, expected 69.6878045882, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.4290633739*100), 0.05) << "incorrect value for lat, expected 37.4290633739, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -122.173403896*100), 0.05) << "incorrect value for lon, expected -122.173403896, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567800) << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 120, 46, 39, 0, 251, 117, 115, 140, + 235, 182, 66, 64, 152, 134, 167, 12, 25, 139, 94, 192, 160, 22, + 137, 253, 4, 108, 81, 64, 0, 0, 0, 0, 9, 1, 122, 127, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_dep_a_t *test_msg = (msg_pos_llh_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 1; + test_msg->h_accuracy = 0; + test_msg->height = 69.68780458819901; + test_msg->lat = 37.429063373925565; + test_msg->lon = -122.17340389594972; + test_msg->n_sats = 9; + test_msg->tow = 2567800; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x201, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 69.6878045882 * 100), 0.05) + << "incorrect value for height, expected 69.6878045882, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.4290633739 * 100), 0.05) + << "incorrect value for lat, expected 37.4290633739, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -122.173403896 * 100), 0.05) + << "incorrect value for lon, expected -122.173403896, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567800) + << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -497,100 +529,109 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,246,215,34,220,46,39,0,51,124,88,251,235,182,66,64,153,5,250,16,25,139,94,192,146,60,187,219,152,161,81,64,0,0,0,0,9,0,194,158, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->height = 70.5249547317965; - test_msg->lat = 37.42907659359516; - test_msg->lon = -122.17340492645452; - test_msg->n_sats = 9; - test_msg->tow = 2567900; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x201, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 70.5249547318*100), 0.05) << "incorrect value for height, expected 70.5249547318, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.4290765936*100), 0.05) << "incorrect value for lat, expected 37.4290765936, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -122.173404926*100), 0.05) << "incorrect value for lon, expected -122.173404926, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567900) << "incorrect value for tow, expected 2567900, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 246, 215, 34, 220, 46, 39, 0, 51, 124, 88, 251, + 235, 182, 66, 64, 153, 5, 250, 16, 25, 139, 94, 192, 146, 60, + 187, 219, 152, 161, 81, 64, 0, 0, 0, 0, 9, 0, 194, 158, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_dep_a_t *test_msg = (msg_pos_llh_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->height = 70.5249547317965; + test_msg->lat = 37.42907659359516; + test_msg->lon = -122.17340492645452; + test_msg->n_sats = 9; + test_msg->tow = 2567900; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x201, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 70.5249547318 * 100), 0.05) + << "incorrect value for height, expected 70.5249547318, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.4290765936 * 100), 0.05) + << "incorrect value for lat, expected 37.4290765936, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -122.173404926 * 100), 0.05) + << "incorrect value for lon, expected -122.173404926, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567900) + << "incorrect value for tow, expected 2567900, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -600,100 +641,109 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,195,4,34,212,157,67,24,8,23,228,8,151,225,66,64,156,174,42,194,230,152,94,192,153,23,72,47,196,40,16,64,0,0,0,0,8,0,237,169, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->height = 4.039810885214956; - test_msg->lat = 37.76242171418386; - test_msg->lon = -122.38908437889262; - test_msg->n_sats = 8; - test_msg->tow = 407084500; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x201, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 4.03981088521*100), 0.05) << "incorrect value for height, expected 4.03981088521, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.7624217142*100), 0.05) << "incorrect value for lat, expected 37.7624217142, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -122.389084379*100), 0.05) << "incorrect value for lon, expected -122.389084379, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084500) << "incorrect value for tow, expected 407084500, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 212, 157, 67, 24, 8, 23, 228, 8, + 151, 225, 66, 64, 156, 174, 42, 194, 230, 152, 94, 192, 153, 23, + 72, 47, 196, 40, 16, 64, 0, 0, 0, 0, 8, 0, 237, 169, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_dep_a_t *test_msg = (msg_pos_llh_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->height = 4.039810885214956; + test_msg->lat = 37.76242171418386; + test_msg->lon = -122.38908437889262; + test_msg->n_sats = 8; + test_msg->tow = 407084500; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x201, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 4.03981088521 * 100), 0.05) + << "incorrect value for height, expected 4.03981088521, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.7624217142 * 100), 0.05) + << "incorrect value for lat, expected 37.7624217142, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -122.389084379 * 100), 0.05) + << "incorrect value for lon, expected -122.389084379, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084500) + << "incorrect value for tow, expected 407084500, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA6 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA6() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA6 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA6() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -703,100 +753,109 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA6 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,195,4,34,56,158,67,24,220,109,212,24,151,225,66,64,159,231,254,219,230,152,94,192,128,151,67,19,233,105,7,64,0,0,0,0,8,0,152,11, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->height = 2.926714087009657; - test_msg->lat = 37.76242361423985; - test_msg->lon = -122.38909053700489; - test_msg->n_sats = 8; - test_msg->tow = 407084600; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x201, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 2.92671408701*100), 0.05) << "incorrect value for height, expected 2.92671408701, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.7624236142*100), 0.05) << "incorrect value for lat, expected 37.7624236142, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -122.389090537*100), 0.05) << "incorrect value for lon, expected -122.389090537, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084600) << "incorrect value for tow, expected 407084600, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 56, 158, 67, 24, 220, 109, 212, 24, + 151, 225, 66, 64, 159, 231, 254, 219, 230, 152, 94, 192, 128, 151, + 67, 19, 233, 105, 7, 64, 0, 0, 0, 0, 8, 0, 152, 11, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_dep_a_t *test_msg = (msg_pos_llh_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->height = 2.926714087009657; + test_msg->lat = 37.76242361423985; + test_msg->lon = -122.38909053700489; + test_msg->n_sats = 8; + test_msg->tow = 407084600; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x201, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 2.92671408701 * 100), 0.05) + << "incorrect value for height, expected 2.92671408701, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.7624236142 * 100), 0.05) + << "incorrect value for lat, expected 37.7624236142, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -122.389090537 * 100), 0.05) + << "incorrect value for lon, expected -122.389090537, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084600) + << "incorrect value for tow, expected 407084600, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA7 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA7() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA7 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA7() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -806,100 +865,109 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA7 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,195,4,34,156,158,67,24,13,91,237,11,151,225,66,64,75,113,210,220,230,152,94,192,37,6,145,188,89,112,238,63,0,0,0,0,8,0,221,155, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->height = 0.9512146647395566; - test_msg->lat = 37.762422076126406; - test_msg->lon = -122.3890907340148; - test_msg->n_sats = 8; - test_msg->tow = 407084700; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x201, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 0.95121466474*100), 0.05) << "incorrect value for height, expected 0.95121466474, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.7624220761*100), 0.05) << "incorrect value for lat, expected 37.7624220761, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -122.389090734*100), 0.05) << "incorrect value for lon, expected -122.389090734, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084700) << "incorrect value for tow, expected 407084700, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 156, 158, 67, 24, 13, 91, 237, 11, + 151, 225, 66, 64, 75, 113, 210, 220, 230, 152, 94, 192, 37, 6, + 145, 188, 89, 112, 238, 63, 0, 0, 0, 0, 8, 0, 221, 155, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_dep_a_t *test_msg = (msg_pos_llh_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->height = 0.9512146647395566; + test_msg->lat = 37.762422076126406; + test_msg->lon = -122.3890907340148; + test_msg->n_sats = 8; + test_msg->tow = 407084700; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x201, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 0.95121466474 * 100), 0.05) + << "incorrect value for height, expected 0.95121466474, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.7624220761 * 100), 0.05) + << "incorrect value for lat, expected 37.7624220761, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -122.389090734 * 100), 0.05) + << "incorrect value for lon, expected -122.389090734, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084700) + << "incorrect value for tow, expected 407084700, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA8 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA8() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA8 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA8() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -909,100 +977,109 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA8 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,195,4,34,0,159,67,24,51,183,5,8,151,225,66,64,13,226,148,253,230,152,94,192,187,27,11,32,69,213,2,64,0,0,0,0,8,0,82,94, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->height = 2.354135752047538; - test_msg->lat = 37.762421610632735; - test_msg->lon = -122.38909854449612; - test_msg->n_sats = 8; - test_msg->tow = 407084800; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x201, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 2.35413575205*100), 0.05) << "incorrect value for height, expected 2.35413575205, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.7624216106*100), 0.05) << "incorrect value for lat, expected 37.7624216106, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -122.389098544*100), 0.05) << "incorrect value for lon, expected -122.389098544, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084800) << "incorrect value for tow, expected 407084800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 0, 159, 67, 24, 51, 183, 5, 8, + 151, 225, 66, 64, 13, 226, 148, 253, 230, 152, 94, 192, 187, 27, + 11, 32, 69, 213, 2, 64, 0, 0, 0, 0, 8, 0, 82, 94, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_dep_a_t *test_msg = (msg_pos_llh_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->height = 2.354135752047538; + test_msg->lat = 37.762421610632735; + test_msg->lon = -122.38909854449612; + test_msg->n_sats = 8; + test_msg->tow = 407084800; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x201, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 2.35413575205 * 100), 0.05) + << "incorrect value for height, expected 2.35413575205, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.7624216106 * 100), 0.05) + << "incorrect value for lat, expected 37.7624216106, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -122.389098544 * 100), 0.05) + << "incorrect value for lon, expected -122.389098544, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084800) + << "incorrect value for tow, expected 407084800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA9 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA9() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA9 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA9() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -1012,100 +1089,109 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA9 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA9, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,195,4,34,100,159,67,24,22,77,146,22,151,225,66,64,64,134,105,227,230,152,94,192,37,99,114,72,31,103,241,63,0,0,0,0,8,0,70,60, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->height = 1.0876763181642641; - test_msg->lat = 37.76242334502801; - test_msg->lon = -122.38909230523223; - test_msg->n_sats = 8; - test_msg->tow = 407084900; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x201, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 1.08767631816*100), 0.05) << "incorrect value for height, expected 1.08767631816, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.762423345*100), 0.05) << "incorrect value for lat, expected 37.762423345, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -122.389092305*100), 0.05) << "incorrect value for lon, expected -122.389092305, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084900) << "incorrect value for tow, expected 407084900, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA9, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 100, 159, 67, 24, 22, 77, 146, 22, + 151, 225, 66, 64, 64, 134, 105, 227, 230, 152, 94, 192, 37, 99, + 114, 72, 31, 103, 241, 63, 0, 0, 0, 0, 8, 0, 70, 60, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_dep_a_t *test_msg = (msg_pos_llh_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->height = 1.0876763181642641; + test_msg->lat = 37.76242334502801; + test_msg->lon = -122.38909230523223; + test_msg->n_sats = 8; + test_msg->tow = 407084900; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x201, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 1.08767631816 * 100), 0.05) + << "incorrect value for height, expected 1.08767631816, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.762423345 * 100), 0.05) + << "incorrect value for lat, expected 37.762423345, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -122.389092305 * 100), 0.05) + << "incorrect value for lon, expected -122.389092305, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084900) + << "incorrect value for tow, expected 407084900, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA10 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA10() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA10 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA10() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -1115,49 +1201,64 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA10 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA10, Test) -{ - - uint8_t encoded_frame[] = {85,1,2,195,4,34,46,162,68,24,124,245,46,169,151,225,66,64,135,149,234,187,230,152,94,192,194,201,115,145,166,175,20,64,0,0,0,0,5,0,212,121, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_dep_a_t* test_msg = ( msg_pos_llh_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->height = 5.171533844654222; - test_msg->lat = 37.76244082253376; - test_msg->lon = -122.38908288868525; - test_msg->n_sats = 5; - test_msg->tow = 407151150; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x201, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - 5.17153384465*100), 0.05) << "incorrect value for height, expected 5.17153384465, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.7624408225*100), 0.05) << "incorrect value for lat, expected 37.7624408225, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -122.389082889*100), 0.05) << "incorrect value for lon, expected -122.389082889, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 5) << "incorrect value for n_sats, expected 5, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407151150) << "incorrect value for tow, expected 407151150, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLLHDepA10, Test) { + uint8_t encoded_frame[] = { + 85, 1, 2, 195, 4, 34, 46, 162, 68, 24, 124, 245, 46, 169, + 151, 225, 66, 64, 135, 149, 234, 187, 230, 152, 94, 192, 194, 201, + 115, 145, 166, 175, 20, 64, 0, 0, 0, 0, 5, 0, 212, 121, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_dep_a_t *test_msg = (msg_pos_llh_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->height = 5.171533844654222; + test_msg->lat = 37.76244082253376; + test_msg->lon = -122.38908288868525; + test_msg->n_sats = 5; + test_msg->tow = 407151150; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x201, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - 5.17153384465 * 100), 0.05) + << "incorrect value for height, expected 5.17153384465, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.7624408225 * 100), 0.05) + << "incorrect value for lat, expected 37.7624408225, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -122.389082889 * 100), 0.05) + << "incorrect value for lon, expected -122.389082889, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 5) + << "incorrect value for n_sats, expected 5, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407151150) + << "incorrect value for tow, expected 407151150, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLlhAcc.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLlhAcc.cc index 091b21cb0..899d91f8f 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLlhAcc.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLlhAcc.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhAcc.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhAcc.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgPosLlhAcc0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLlhAcc0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLlhAcc0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLlhAcc0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_acc_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_acc_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,63 +81,94 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLlhAcc0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_acc_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLlhAcc0, Test) -{ +}; - uint8_t encoded_frame[] = {85,24,2,2,28,67,39,120,110,18,51,51,51,51,51,139,189,64,154,153,153,153,25,151,192,64,51,51,51,51,51,161,176,64,51,51,51,51,51,101,179,64,51,163,22,69,154,25,173,69,102,134,243,68,154,201,196,69,205,224,0,70,51,35,72,69,51,99,31,69,95,27,72,220,177, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLlhAcc0, Test) { + uint8_t encoded_frame[] = { + 85, 24, 2, 2, 28, 67, 39, 120, 110, 18, 51, 51, 51, 51, 51, + 139, 189, 64, 154, 153, 153, 153, 25, 151, 192, 64, 51, 51, 51, 51, + 51, 161, 176, 64, 51, 51, 51, 51, 51, 101, 179, 64, 51, 163, 22, + 69, 154, 25, 173, 69, 102, 134, 243, 68, 154, 201, 196, 69, 205, 224, + 0, 70, 51, 35, 72, 69, 51, 99, 31, 69, 95, 27, 72, 220, 177, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_acc_t* test_msg = ( msg_pos_llh_acc_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->at_accuracy = 6297.2001953125; - test_msg->confidence_and_geoid = 95; - test_msg->ct_accuracy = 1948.199951171875; - test_msg->flags = 72; - test_msg->h_accuracy = 2410.199951171875; - test_msg->h_ellipse.orientation = 2550.199951171875; - test_msg->h_ellipse.semi_major = 8248.2001953125; - test_msg->h_ellipse.semi_minor = 3202.199951171875; - test_msg->height = 4257.2; - test_msg->lat = 7563.2; - test_msg->lon = 8494.2; - test_msg->n_sats = 27; - test_msg->orthometric_height = 4965.2; - test_msg->tow = 309229607; - test_msg->v_accuracy = 5539.2001953125; - - EXPECT_EQ(send_message( 0x218, 7170, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_acc_t *test_msg = (msg_pos_llh_acc_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->at_accuracy = 6297.2001953125; + test_msg->confidence_and_geoid = 95; + test_msg->ct_accuracy = 1948.199951171875; + test_msg->flags = 72; + test_msg->h_accuracy = 2410.199951171875; + test_msg->h_ellipse.orientation = 2550.199951171875; + test_msg->h_ellipse.semi_major = 8248.2001953125; + test_msg->h_ellipse.semi_minor = 3202.199951171875; + test_msg->height = 4257.2; + test_msg->lat = 7563.2; + test_msg->lon = 8494.2; + test_msg->n_sats = 27; + test_msg->orthometric_height = 4965.2; + test_msg->tow = 309229607; + test_msg->v_accuracy = 5539.2001953125; + + EXPECT_EQ(send_message(0x218, 7170, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 7170); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->at_accuracy*100 - 6297.20019531*100), 0.05) << "incorrect value for at_accuracy, expected 6297.20019531, is " << last_msg_->at_accuracy; - EXPECT_EQ(last_msg_->confidence_and_geoid, 95) << "incorrect value for confidence_and_geoid, expected 95, is " << last_msg_->confidence_and_geoid; - EXPECT_LT((last_msg_->ct_accuracy*100 - 1948.19995117*100), 0.05) << "incorrect value for ct_accuracy, expected 1948.19995117, is " << last_msg_->ct_accuracy; - EXPECT_EQ(last_msg_->flags, 72) << "incorrect value for flags, expected 72, is " << last_msg_->flags; - EXPECT_LT((last_msg_->h_accuracy*100 - 2410.19995117*100), 0.05) << "incorrect value for h_accuracy, expected 2410.19995117, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->h_ellipse.orientation*100 - 2550.19995117*100), 0.05) << "incorrect value for h_ellipse.orientation, expected 2550.19995117, is " << last_msg_->h_ellipse.orientation; - EXPECT_LT((last_msg_->h_ellipse.semi_major*100 - 8248.20019531*100), 0.05) << "incorrect value for h_ellipse.semi_major, expected 8248.20019531, is " << last_msg_->h_ellipse.semi_major; - EXPECT_LT((last_msg_->h_ellipse.semi_minor*100 - 3202.19995117*100), 0.05) << "incorrect value for h_ellipse.semi_minor, expected 3202.19995117, is " << last_msg_->h_ellipse.semi_minor; - EXPECT_LT((last_msg_->height*100 - 4257.2*100), 0.05) << "incorrect value for height, expected 4257.2, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 7563.2*100), 0.05) << "incorrect value for lat, expected 7563.2, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - 8494.2*100), 0.05) << "incorrect value for lon, expected 8494.2, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 27) << "incorrect value for n_sats, expected 27, is " << last_msg_->n_sats; - EXPECT_LT((last_msg_->orthometric_height*100 - 4965.2*100), 0.05) << "incorrect value for orthometric_height, expected 4965.2, is " << last_msg_->orthometric_height; - EXPECT_EQ(last_msg_->tow, 309229607) << "incorrect value for tow, expected 309229607, is " << last_msg_->tow; - EXPECT_LT((last_msg_->v_accuracy*100 - 5539.20019531*100), 0.05) << "incorrect value for v_accuracy, expected 5539.20019531, is " << last_msg_->v_accuracy; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 7170); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->at_accuracy * 100 - 6297.20019531 * 100), 0.05) + << "incorrect value for at_accuracy, expected 6297.20019531, is " + << last_msg_->at_accuracy; + EXPECT_EQ(last_msg_->confidence_and_geoid, 95) + << "incorrect value for confidence_and_geoid, expected 95, is " + << last_msg_->confidence_and_geoid; + EXPECT_LT((last_msg_->ct_accuracy * 100 - 1948.19995117 * 100), 0.05) + << "incorrect value for ct_accuracy, expected 1948.19995117, is " + << last_msg_->ct_accuracy; + EXPECT_EQ(last_msg_->flags, 72) + << "incorrect value for flags, expected 72, is " << last_msg_->flags; + EXPECT_LT((last_msg_->h_accuracy * 100 - 2410.19995117 * 100), 0.05) + << "incorrect value for h_accuracy, expected 2410.19995117, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->h_ellipse.orientation * 100 - 2550.19995117 * 100), + 0.05) + << "incorrect value for h_ellipse.orientation, expected 2550.19995117, " + "is " + << last_msg_->h_ellipse.orientation; + EXPECT_LT((last_msg_->h_ellipse.semi_major * 100 - 8248.20019531 * 100), 0.05) + << "incorrect value for h_ellipse.semi_major, expected 8248.20019531, is " + << last_msg_->h_ellipse.semi_major; + EXPECT_LT((last_msg_->h_ellipse.semi_minor * 100 - 3202.19995117 * 100), 0.05) + << "incorrect value for h_ellipse.semi_minor, expected 3202.19995117, is " + << last_msg_->h_ellipse.semi_minor; + EXPECT_LT((last_msg_->height * 100 - 4257.2 * 100), 0.05) + << "incorrect value for height, expected 4257.2, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 7563.2 * 100), 0.05) + << "incorrect value for lat, expected 7563.2, is " << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - 8494.2 * 100), 0.05) + << "incorrect value for lon, expected 8494.2, is " << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 27) + << "incorrect value for n_sats, expected 27, is " << last_msg_->n_sats; + EXPECT_LT((last_msg_->orthometric_height * 100 - 4965.2 * 100), 0.05) + << "incorrect value for orthometric_height, expected 4965.2, is " + << last_msg_->orthometric_height; + EXPECT_EQ(last_msg_->tow, 309229607) + << "incorrect value for tow, expected 309229607, is " << last_msg_->tow; + EXPECT_LT((last_msg_->v_accuracy * 100 - 5539.20019531 * 100), 0.05) + << "incorrect value for v_accuracy, expected 5539.20019531, is " + << last_msg_->v_accuracy; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLlhCovGnss.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLlhCovGnss.cc index a9b6c2f42..8031cbb3f 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLlhCovGnss.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLlhCovGnss.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhCovGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhCovGnss.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_cov_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_cov_gnss_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,57 +82,82 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_cov_gnss_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss0, Test) -{ +}; - uint8_t encoded_frame[] = {85,49,2,0,16,54,24,229,233,29,73,123,28,207,101,234,66,64,100,168,19,20,86,146,94,192,214,198,35,120,209,100,49,192,12,102,245,59,6,181,192,185,168,79,243,58,96,60,148,59,253,58,93,186,159,174,6,61,18,4,10,196, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLlhCovGnss0, Test) { + uint8_t encoded_frame[] = { + 85, 49, 2, 0, 16, 54, 24, 229, 233, 29, 73, 123, 28, + 207, 101, 234, 66, 64, 100, 168, 19, 20, 86, 146, 94, 192, + 214, 198, 35, 120, 209, 100, 49, 192, 12, 102, 245, 59, 6, + 181, 192, 185, 168, 79, 243, 58, 96, 60, 148, 59, 253, 58, + 93, 186, 159, 174, 6, 61, 18, 4, 10, 196, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_cov_gnss_t* test_msg = ( msg_pos_llh_cov_gnss_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cov_d_d = 0.03288137540221214; - test_msg->cov_e_d = -0.0008439270895905793; - test_msg->cov_e_e = 0.004523798823356628; - test_msg->cov_n_d = 0.0018563168123364449; - test_msg->cov_n_e = -0.00036755966721102595; - test_msg->cov_n_n = 0.007488971576094627; - test_msg->flags = 4; - test_msg->height = -17.39382124780135; - test_msg->lat = 37.83123196497633; - test_msg->lon = -122.28650381011681; - test_msg->n_sats = 18; - test_msg->tow = 501867800; - - EXPECT_EQ(send_message( 0x231, 4096, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_cov_gnss_t *test_msg = (msg_pos_llh_cov_gnss_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cov_d_d = 0.03288137540221214; + test_msg->cov_e_d = -0.0008439270895905793; + test_msg->cov_e_e = 0.004523798823356628; + test_msg->cov_n_d = 0.0018563168123364449; + test_msg->cov_n_e = -0.00036755966721102595; + test_msg->cov_n_n = 0.007488971576094627; + test_msg->flags = 4; + test_msg->height = -17.39382124780135; + test_msg->lat = 37.83123196497633; + test_msg->lon = -122.28650381011681; + test_msg->n_sats = 18; + test_msg->tow = 501867800; + + EXPECT_EQ(send_message(0x231, 4096, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cov_d_d*100 - 0.0328813754022*100), 0.05) << "incorrect value for cov_d_d, expected 0.0328813754022, is " << last_msg_->cov_d_d; - EXPECT_LT((last_msg_->cov_e_d*100 - -0.000843927089591*100), 0.05) << "incorrect value for cov_e_d, expected -0.000843927089591, is " << last_msg_->cov_e_d; - EXPECT_LT((last_msg_->cov_e_e*100 - 0.00452379882336*100), 0.05) << "incorrect value for cov_e_e, expected 0.00452379882336, is " << last_msg_->cov_e_e; - EXPECT_LT((last_msg_->cov_n_d*100 - 0.00185631681234*100), 0.05) << "incorrect value for cov_n_d, expected 0.00185631681234, is " << last_msg_->cov_n_d; - EXPECT_LT((last_msg_->cov_n_e*100 - -0.000367559667211*100), 0.05) << "incorrect value for cov_n_e, expected -0.000367559667211, is " << last_msg_->cov_n_e; - EXPECT_LT((last_msg_->cov_n_n*100 - 0.00748897157609*100), 0.05) << "incorrect value for cov_n_n, expected 0.00748897157609, is " << last_msg_->cov_n_n; - EXPECT_EQ(last_msg_->flags, 4) << "incorrect value for flags, expected 4, is " << last_msg_->flags; - EXPECT_LT((last_msg_->height*100 - -17.3938212478*100), 0.05) << "incorrect value for height, expected -17.3938212478, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.831231965*100), 0.05) << "incorrect value for lat, expected 37.831231965, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -122.28650381*100), 0.05) << "incorrect value for lon, expected -122.28650381, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 18) << "incorrect value for n_sats, expected 18, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 501867800) << "incorrect value for tow, expected 501867800, is " << last_msg_->tow; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cov_d_d * 100 - 0.0328813754022 * 100), 0.05) + << "incorrect value for cov_d_d, expected 0.0328813754022, is " + << last_msg_->cov_d_d; + EXPECT_LT((last_msg_->cov_e_d * 100 - -0.000843927089591 * 100), 0.05) + << "incorrect value for cov_e_d, expected -0.000843927089591, is " + << last_msg_->cov_e_d; + EXPECT_LT((last_msg_->cov_e_e * 100 - 0.00452379882336 * 100), 0.05) + << "incorrect value for cov_e_e, expected 0.00452379882336, is " + << last_msg_->cov_e_e; + EXPECT_LT((last_msg_->cov_n_d * 100 - 0.00185631681234 * 100), 0.05) + << "incorrect value for cov_n_d, expected 0.00185631681234, is " + << last_msg_->cov_n_d; + EXPECT_LT((last_msg_->cov_n_e * 100 - -0.000367559667211 * 100), 0.05) + << "incorrect value for cov_n_e, expected -0.000367559667211, is " + << last_msg_->cov_n_e; + EXPECT_LT((last_msg_->cov_n_n * 100 - 0.00748897157609 * 100), 0.05) + << "incorrect value for cov_n_n, expected 0.00748897157609, is " + << last_msg_->cov_n_n; + EXPECT_EQ(last_msg_->flags, 4) + << "incorrect value for flags, expected 4, is " << last_msg_->flags; + EXPECT_LT((last_msg_->height * 100 - -17.3938212478 * 100), 0.05) + << "incorrect value for height, expected -17.3938212478, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.831231965 * 100), 0.05) + << "incorrect value for lat, expected 37.831231965, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -122.28650381 * 100), 0.05) + << "incorrect value for lon, expected -122.28650381, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 18) + << "incorrect value for n_sats, expected 18, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 501867800) + << "incorrect value for tow, expected 501867800, is " << last_msg_->tow; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLlhGnss.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLlhGnss.cc index 5e756c377..c92ba3924 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLlhGnss.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPosLlhGnss.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPosLlhGnss.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgPosLlhGnss0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPosLlhGnss0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPosLlhGnss0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPosLlhGnss0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pos_llh_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pos_llh_gnss_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,49 +81,64 @@ class Test_legacy_auto_check_sbp_navigation_MsgPosLlhGnss0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pos_llh_gnss_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLlhGnss0, Test) -{ +}; - uint8_t encoded_frame[] = {85,42,2,0,16,34,24,229,233,29,73,123,28,207,101,234,66,64,100,168,19,20,86,146,94,192,214,198,35,120,209,100,49,192,87,0,181,0,18,4,105,55, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPosLlhGnss0, Test) { + uint8_t encoded_frame[] = { + 85, 42, 2, 0, 16, 34, 24, 229, 233, 29, 73, 123, 28, 207, + 101, 234, 66, 64, 100, 168, 19, 20, 86, 146, 94, 192, 214, 198, + 35, 120, 209, 100, 49, 192, 87, 0, 181, 0, 18, 4, 105, 55, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pos_llh_gnss_t* test_msg = ( msg_pos_llh_gnss_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 4; - test_msg->h_accuracy = 87; - test_msg->height = -17.39382124780135; - test_msg->lat = 37.83123196497633; - test_msg->lon = -122.28650381011681; - test_msg->n_sats = 18; - test_msg->tow = 501867800; - test_msg->v_accuracy = 181; - - EXPECT_EQ(send_message( 0x22a, 4096, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pos_llh_gnss_t *test_msg = (msg_pos_llh_gnss_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 4; + test_msg->h_accuracy = 87; + test_msg->height = -17.39382124780135; + test_msg->lat = 37.83123196497633; + test_msg->lon = -122.28650381011681; + test_msg->n_sats = 18; + test_msg->tow = 501867800; + test_msg->v_accuracy = 181; + + EXPECT_EQ(send_message(0x22a, 4096, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 4) << "incorrect value for flags, expected 4, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 87) << "incorrect value for h_accuracy, expected 87, is " << last_msg_->h_accuracy; - EXPECT_LT((last_msg_->height*100 - -17.3938212478*100), 0.05) << "incorrect value for height, expected -17.3938212478, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.831231965*100), 0.05) << "incorrect value for lat, expected 37.831231965, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -122.28650381*100), 0.05) << "incorrect value for lon, expected -122.28650381, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->n_sats, 18) << "incorrect value for n_sats, expected 18, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 501867800) << "incorrect value for tow, expected 501867800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 181) << "incorrect value for v_accuracy, expected 181, is " << last_msg_->v_accuracy; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 4) + << "incorrect value for flags, expected 4, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 87) + << "incorrect value for h_accuracy, expected 87, is " + << last_msg_->h_accuracy; + EXPECT_LT((last_msg_->height * 100 - -17.3938212478 * 100), 0.05) + << "incorrect value for height, expected -17.3938212478, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.831231965 * 100), 0.05) + << "incorrect value for lat, expected 37.831231965, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -122.28650381 * 100), 0.05) + << "incorrect value for lon, expected -122.28650381, is " + << last_msg_->lon; + EXPECT_EQ(last_msg_->n_sats, 18) + << "incorrect value for n_sats, expected 18, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 501867800) + << "incorrect value for tow, expected 501867800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 181) + << "incorrect value for v_accuracy, expected 181, is " + << last_msg_->v_accuracy; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPoseRelative.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPoseRelative.cc index 4d9622f2c..344941696 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPoseRelative.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgPoseRelative.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPoseRelative.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgPoseRelative.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgPoseRelative0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgPoseRelative0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgPoseRelative0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgPoseRelative0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pose_relative_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pose_relative_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,93 +81,141 @@ class Test_legacy_auto_check_sbp_navigation_MsgPoseRelative0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pose_relative_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPoseRelative0, Test) -{ +}; - uint8_t encoded_frame[] = {85,69,2,66,0,90,86,4,0,0,0,86,4,0,0,172,8,0,0,76,4,0,0,38,2,0,0,100,0,0,0,100,3,200,204,252,168,157,255,115,53,186,144,190,48,34,37,0,0,128,63,0,0,0,0,0,0,0,0,0,0,128,63,0,0,0,0,0,0,128,63,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,64,5,171,187, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgPoseRelative0, Test) { + uint8_t encoded_frame[] = { + 85, 69, 2, 66, 0, 90, 86, 4, 0, 0, 0, 86, 4, 0, + 0, 172, 8, 0, 0, 76, 4, 0, 0, 38, 2, 0, 0, 100, + 0, 0, 0, 100, 3, 200, 204, 252, 168, 157, 255, 115, 53, 186, + 144, 190, 48, 34, 37, 0, 0, 128, 63, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 128, + 63, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 64, 5, 171, 187, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pose_relative_t* test_msg = ( msg_pose_relative_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cov_c_x_x = 2.0; - test_msg->cov_c_x_y = 0.0; - test_msg->cov_c_x_z = 0.0; - test_msg->cov_c_y_y = 2.0; - test_msg->cov_c_y_z = 0.0; - test_msg->cov_c_z_z = 2.0; - test_msg->cov_r_x_x = 1.0; - test_msg->cov_r_x_y = 0.0; - test_msg->cov_r_x_z = 0.0; - test_msg->cov_r_y_y = 1.0; - test_msg->cov_r_y_z = 0.0; - test_msg->cov_r_z_z = 1.0; - test_msg->flags = 5; - test_msg->sensor_id = 0; - test_msg->timestamp_1 = 1110; - test_msg->timestamp_2 = 2220; - test_msg->tow = 1110; - if (sizeof(test_msg->trans) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->trans[0])); - } - test_msg->trans[0] = 1100; - if (sizeof(test_msg->trans) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->trans[0])); - } - test_msg->trans[1] = 550; - if (sizeof(test_msg->trans) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->trans[0])); - } - test_msg->trans[2] = 100; - test_msg->w = -859307164; - test_msg->x = -6444804; - test_msg->y = -1866844813; - test_msg->z = 622997694; - - EXPECT_EQ(send_message( 0x245, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pose_relative_t *test_msg = (msg_pose_relative_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cov_c_x_x = 2.0; + test_msg->cov_c_x_y = 0.0; + test_msg->cov_c_x_z = 0.0; + test_msg->cov_c_y_y = 2.0; + test_msg->cov_c_y_z = 0.0; + test_msg->cov_c_z_z = 2.0; + test_msg->cov_r_x_x = 1.0; + test_msg->cov_r_x_y = 0.0; + test_msg->cov_r_x_z = 0.0; + test_msg->cov_r_y_y = 1.0; + test_msg->cov_r_y_z = 0.0; + test_msg->cov_r_z_z = 1.0; + test_msg->flags = 5; + test_msg->sensor_id = 0; + test_msg->timestamp_1 = 1110; + test_msg->timestamp_2 = 2220; + test_msg->tow = 1110; + if (sizeof(test_msg->trans) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->trans[0])); + } + test_msg->trans[0] = 1100; + if (sizeof(test_msg->trans) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->trans[0])); + } + test_msg->trans[1] = 550; + if (sizeof(test_msg->trans) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->trans[0])); + } + test_msg->trans[2] = 100; + test_msg->w = -859307164; + test_msg->x = -6444804; + test_msg->y = -1866844813; + test_msg->z = 622997694; + + EXPECT_EQ(send_message(0x245, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cov_c_x_x*100 - 2.0*100), 0.05) << "incorrect value for cov_c_x_x, expected 2.0, is " << last_msg_->cov_c_x_x; - EXPECT_LT((last_msg_->cov_c_x_y*100 - 0.0*100), 0.05) << "incorrect value for cov_c_x_y, expected 0.0, is " << last_msg_->cov_c_x_y; - EXPECT_LT((last_msg_->cov_c_x_z*100 - 0.0*100), 0.05) << "incorrect value for cov_c_x_z, expected 0.0, is " << last_msg_->cov_c_x_z; - EXPECT_LT((last_msg_->cov_c_y_y*100 - 2.0*100), 0.05) << "incorrect value for cov_c_y_y, expected 2.0, is " << last_msg_->cov_c_y_y; - EXPECT_LT((last_msg_->cov_c_y_z*100 - 0.0*100), 0.05) << "incorrect value for cov_c_y_z, expected 0.0, is " << last_msg_->cov_c_y_z; - EXPECT_LT((last_msg_->cov_c_z_z*100 - 2.0*100), 0.05) << "incorrect value for cov_c_z_z, expected 2.0, is " << last_msg_->cov_c_z_z; - EXPECT_LT((last_msg_->cov_r_x_x*100 - 1.0*100), 0.05) << "incorrect value for cov_r_x_x, expected 1.0, is " << last_msg_->cov_r_x_x; - EXPECT_LT((last_msg_->cov_r_x_y*100 - 0.0*100), 0.05) << "incorrect value for cov_r_x_y, expected 0.0, is " << last_msg_->cov_r_x_y; - EXPECT_LT((last_msg_->cov_r_x_z*100 - 0.0*100), 0.05) << "incorrect value for cov_r_x_z, expected 0.0, is " << last_msg_->cov_r_x_z; - EXPECT_LT((last_msg_->cov_r_y_y*100 - 1.0*100), 0.05) << "incorrect value for cov_r_y_y, expected 1.0, is " << last_msg_->cov_r_y_y; - EXPECT_LT((last_msg_->cov_r_y_z*100 - 0.0*100), 0.05) << "incorrect value for cov_r_y_z, expected 0.0, is " << last_msg_->cov_r_y_z; - EXPECT_LT((last_msg_->cov_r_z_z*100 - 1.0*100), 0.05) << "incorrect value for cov_r_z_z, expected 1.0, is " << last_msg_->cov_r_z_z; - EXPECT_EQ(last_msg_->flags, 5) << "incorrect value for flags, expected 5, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->sensor_id, 0) << "incorrect value for sensor_id, expected 0, is " << last_msg_->sensor_id; - EXPECT_EQ(last_msg_->timestamp_1, 1110) << "incorrect value for timestamp_1, expected 1110, is " << last_msg_->timestamp_1; - EXPECT_EQ(last_msg_->timestamp_2, 2220) << "incorrect value for timestamp_2, expected 2220, is " << last_msg_->timestamp_2; - EXPECT_EQ(last_msg_->tow, 1110) << "incorrect value for tow, expected 1110, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->trans[0], 1100) << "incorrect value for trans[0], expected 1100, is " << last_msg_->trans[0]; - EXPECT_EQ(last_msg_->trans[1], 550) << "incorrect value for trans[1], expected 550, is " << last_msg_->trans[1]; - EXPECT_EQ(last_msg_->trans[2], 100) << "incorrect value for trans[2], expected 100, is " << last_msg_->trans[2]; - EXPECT_EQ(last_msg_->w, -859307164) << "incorrect value for w, expected -859307164, is " << last_msg_->w; - EXPECT_EQ(last_msg_->x, -6444804) << "incorrect value for x, expected -6444804, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -1866844813) << "incorrect value for y, expected -1866844813, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 622997694) << "incorrect value for z, expected 622997694, is " << last_msg_->z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cov_c_x_x * 100 - 2.0 * 100), 0.05) + << "incorrect value for cov_c_x_x, expected 2.0, is " + << last_msg_->cov_c_x_x; + EXPECT_LT((last_msg_->cov_c_x_y * 100 - 0.0 * 100), 0.05) + << "incorrect value for cov_c_x_y, expected 0.0, is " + << last_msg_->cov_c_x_y; + EXPECT_LT((last_msg_->cov_c_x_z * 100 - 0.0 * 100), 0.05) + << "incorrect value for cov_c_x_z, expected 0.0, is " + << last_msg_->cov_c_x_z; + EXPECT_LT((last_msg_->cov_c_y_y * 100 - 2.0 * 100), 0.05) + << "incorrect value for cov_c_y_y, expected 2.0, is " + << last_msg_->cov_c_y_y; + EXPECT_LT((last_msg_->cov_c_y_z * 100 - 0.0 * 100), 0.05) + << "incorrect value for cov_c_y_z, expected 0.0, is " + << last_msg_->cov_c_y_z; + EXPECT_LT((last_msg_->cov_c_z_z * 100 - 2.0 * 100), 0.05) + << "incorrect value for cov_c_z_z, expected 2.0, is " + << last_msg_->cov_c_z_z; + EXPECT_LT((last_msg_->cov_r_x_x * 100 - 1.0 * 100), 0.05) + << "incorrect value for cov_r_x_x, expected 1.0, is " + << last_msg_->cov_r_x_x; + EXPECT_LT((last_msg_->cov_r_x_y * 100 - 0.0 * 100), 0.05) + << "incorrect value for cov_r_x_y, expected 0.0, is " + << last_msg_->cov_r_x_y; + EXPECT_LT((last_msg_->cov_r_x_z * 100 - 0.0 * 100), 0.05) + << "incorrect value for cov_r_x_z, expected 0.0, is " + << last_msg_->cov_r_x_z; + EXPECT_LT((last_msg_->cov_r_y_y * 100 - 1.0 * 100), 0.05) + << "incorrect value for cov_r_y_y, expected 1.0, is " + << last_msg_->cov_r_y_y; + EXPECT_LT((last_msg_->cov_r_y_z * 100 - 0.0 * 100), 0.05) + << "incorrect value for cov_r_y_z, expected 0.0, is " + << last_msg_->cov_r_y_z; + EXPECT_LT((last_msg_->cov_r_z_z * 100 - 1.0 * 100), 0.05) + << "incorrect value for cov_r_z_z, expected 1.0, is " + << last_msg_->cov_r_z_z; + EXPECT_EQ(last_msg_->flags, 5) + << "incorrect value for flags, expected 5, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->sensor_id, 0) + << "incorrect value for sensor_id, expected 0, is " + << last_msg_->sensor_id; + EXPECT_EQ(last_msg_->timestamp_1, 1110) + << "incorrect value for timestamp_1, expected 1110, is " + << last_msg_->timestamp_1; + EXPECT_EQ(last_msg_->timestamp_2, 2220) + << "incorrect value for timestamp_2, expected 2220, is " + << last_msg_->timestamp_2; + EXPECT_EQ(last_msg_->tow, 1110) + << "incorrect value for tow, expected 1110, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->trans[0], 1100) + << "incorrect value for trans[0], expected 1100, is " + << last_msg_->trans[0]; + EXPECT_EQ(last_msg_->trans[1], 550) + << "incorrect value for trans[1], expected 550, is " + << last_msg_->trans[1]; + EXPECT_EQ(last_msg_->trans[2], 100) + << "incorrect value for trans[2], expected 100, is " + << last_msg_->trans[2]; + EXPECT_EQ(last_msg_->w, -859307164) + << "incorrect value for w, expected -859307164, is " << last_msg_->w; + EXPECT_EQ(last_msg_->x, -6444804) + << "incorrect value for x, expected -6444804, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -1866844813) + << "incorrect value for y, expected -1866844813, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 622997694) + << "incorrect value for z, expected 622997694, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgProtectionLevel.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgProtectionLevel.cc index 2f3f5ecaf..0a1019dd6 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgProtectionLevel.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgProtectionLevel.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevel.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevel.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgProtectionLevel0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgProtectionLevel0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgProtectionLevel0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgProtectionLevel0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_protection_level_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_protection_level_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,75 +82,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgProtectionLevel0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_protection_level_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgProtectionLevel0, Test) -{ +}; - uint8_t encoded_frame[] = {85,23,2,45,3,76,110,84,4,242,46,51,53,160,89,84,167,41,57,21,217,244,61,161,83,104,140,137,90,246,51,51,51,51,51,170,180,64,154,153,153,153,25,88,195,64,51,51,51,51,51,195,121,64,231,251,38,221,208,183,167,80,223,26,97,164,45,46,186,60,235,227,183,160,187,93,116,224,105,40,32,33,133,188, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgProtectionLevel0, Test) { + uint8_t encoded_frame[] = { + 85, 23, 2, 45, 3, 76, 110, 84, 4, 242, 46, 51, 53, 160, + 89, 84, 167, 41, 57, 21, 217, 244, 61, 161, 83, 104, 140, 137, + 90, 246, 51, 51, 51, 51, 51, 170, 180, 64, 154, 153, 153, 153, + 25, 88, 195, 64, 51, 51, 51, 51, 51, 195, 121, 64, 231, 251, + 38, 221, 208, 183, 167, 80, 223, 26, 97, 164, 45, 46, 186, 60, + 235, 227, 183, 160, 187, 93, 116, 224, 105, 40, 32, 33, 133, 188, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_protection_level_t* test_msg = ( msg_protection_level_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->atpl = 10663; - test_msg->ctpl = 5433; - test_msg->flags = 555755625; - test_msg->heading = -529244741; - test_msg->height = 412.2; - test_msg->hopl = 26707; - test_msg->hpl = 41013; - test_msg->hvpl = 62681; - test_msg->lat = 5290.2; - test_msg->lon = 9904.2; - test_msg->pitch = -1598561301; - test_msg->popl = 35212; - test_msg->roll = 1018834477; - test_msg->ropl = 63066; - test_msg->tow = 4060370030; - test_msg->v_x = -584647705; - test_msg->v_y = 1353168848; - test_msg->v_z = -1537140001; - test_msg->vpl = 21593; - test_msg->vvpl = 41277; - test_msg->wn = 13102; - - EXPECT_EQ(send_message( 0x217, 813, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_protection_level_t *test_msg = (msg_protection_level_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->atpl = 10663; + test_msg->ctpl = 5433; + test_msg->flags = 555755625; + test_msg->heading = -529244741; + test_msg->height = 412.2; + test_msg->hopl = 26707; + test_msg->hpl = 41013; + test_msg->hvpl = 62681; + test_msg->lat = 5290.2; + test_msg->lon = 9904.2; + test_msg->pitch = -1598561301; + test_msg->popl = 35212; + test_msg->roll = 1018834477; + test_msg->ropl = 63066; + test_msg->tow = 4060370030; + test_msg->v_x = -584647705; + test_msg->v_y = 1353168848; + test_msg->v_z = -1537140001; + test_msg->vpl = 21593; + test_msg->vvpl = 41277; + test_msg->wn = 13102; + + EXPECT_EQ(send_message(0x217, 813, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 813); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->atpl, 10663) << "incorrect value for atpl, expected 10663, is " << last_msg_->atpl; - EXPECT_EQ(last_msg_->ctpl, 5433) << "incorrect value for ctpl, expected 5433, is " << last_msg_->ctpl; - EXPECT_EQ(last_msg_->flags, 555755625) << "incorrect value for flags, expected 555755625, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->heading, -529244741) << "incorrect value for heading, expected -529244741, is " << last_msg_->heading; - EXPECT_LT((last_msg_->height*100 - 412.2*100), 0.05) << "incorrect value for height, expected 412.2, is " << last_msg_->height; - EXPECT_EQ(last_msg_->hopl, 26707) << "incorrect value for hopl, expected 26707, is " << last_msg_->hopl; - EXPECT_EQ(last_msg_->hpl, 41013) << "incorrect value for hpl, expected 41013, is " << last_msg_->hpl; - EXPECT_EQ(last_msg_->hvpl, 62681) << "incorrect value for hvpl, expected 62681, is " << last_msg_->hvpl; - EXPECT_LT((last_msg_->lat*100 - 5290.2*100), 0.05) << "incorrect value for lat, expected 5290.2, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - 9904.2*100), 0.05) << "incorrect value for lon, expected 9904.2, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->pitch, -1598561301) << "incorrect value for pitch, expected -1598561301, is " << last_msg_->pitch; - EXPECT_EQ(last_msg_->popl, 35212) << "incorrect value for popl, expected 35212, is " << last_msg_->popl; - EXPECT_EQ(last_msg_->roll, 1018834477) << "incorrect value for roll, expected 1018834477, is " << last_msg_->roll; - EXPECT_EQ(last_msg_->ropl, 63066) << "incorrect value for ropl, expected 63066, is " << last_msg_->ropl; - EXPECT_EQ(last_msg_->tow, 4060370030) << "incorrect value for tow, expected 4060370030, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_x, -584647705) << "incorrect value for v_x, expected -584647705, is " << last_msg_->v_x; - EXPECT_EQ(last_msg_->v_y, 1353168848) << "incorrect value for v_y, expected 1353168848, is " << last_msg_->v_y; - EXPECT_EQ(last_msg_->v_z, -1537140001) << "incorrect value for v_z, expected -1537140001, is " << last_msg_->v_z; - EXPECT_EQ(last_msg_->vpl, 21593) << "incorrect value for vpl, expected 21593, is " << last_msg_->vpl; - EXPECT_EQ(last_msg_->vvpl, 41277) << "incorrect value for vvpl, expected 41277, is " << last_msg_->vvpl; - EXPECT_EQ(last_msg_->wn, 13102) << "incorrect value for wn, expected 13102, is " << last_msg_->wn; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 813); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->atpl, 10663) + << "incorrect value for atpl, expected 10663, is " << last_msg_->atpl; + EXPECT_EQ(last_msg_->ctpl, 5433) + << "incorrect value for ctpl, expected 5433, is " << last_msg_->ctpl; + EXPECT_EQ(last_msg_->flags, 555755625) + << "incorrect value for flags, expected 555755625, is " + << last_msg_->flags; + EXPECT_EQ(last_msg_->heading, -529244741) + << "incorrect value for heading, expected -529244741, is " + << last_msg_->heading; + EXPECT_LT((last_msg_->height * 100 - 412.2 * 100), 0.05) + << "incorrect value for height, expected 412.2, is " << last_msg_->height; + EXPECT_EQ(last_msg_->hopl, 26707) + << "incorrect value for hopl, expected 26707, is " << last_msg_->hopl; + EXPECT_EQ(last_msg_->hpl, 41013) + << "incorrect value for hpl, expected 41013, is " << last_msg_->hpl; + EXPECT_EQ(last_msg_->hvpl, 62681) + << "incorrect value for hvpl, expected 62681, is " << last_msg_->hvpl; + EXPECT_LT((last_msg_->lat * 100 - 5290.2 * 100), 0.05) + << "incorrect value for lat, expected 5290.2, is " << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - 9904.2 * 100), 0.05) + << "incorrect value for lon, expected 9904.2, is " << last_msg_->lon; + EXPECT_EQ(last_msg_->pitch, -1598561301) + << "incorrect value for pitch, expected -1598561301, is " + << last_msg_->pitch; + EXPECT_EQ(last_msg_->popl, 35212) + << "incorrect value for popl, expected 35212, is " << last_msg_->popl; + EXPECT_EQ(last_msg_->roll, 1018834477) + << "incorrect value for roll, expected 1018834477, is " + << last_msg_->roll; + EXPECT_EQ(last_msg_->ropl, 63066) + << "incorrect value for ropl, expected 63066, is " << last_msg_->ropl; + EXPECT_EQ(last_msg_->tow, 4060370030) + << "incorrect value for tow, expected 4060370030, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_x, -584647705) + << "incorrect value for v_x, expected -584647705, is " << last_msg_->v_x; + EXPECT_EQ(last_msg_->v_y, 1353168848) + << "incorrect value for v_y, expected 1353168848, is " << last_msg_->v_y; + EXPECT_EQ(last_msg_->v_z, -1537140001) + << "incorrect value for v_z, expected -1537140001, is " << last_msg_->v_z; + EXPECT_EQ(last_msg_->vpl, 21593) + << "incorrect value for vpl, expected 21593, is " << last_msg_->vpl; + EXPECT_EQ(last_msg_->vvpl, 41277) + << "incorrect value for vvpl, expected 41277, is " << last_msg_->vvpl; + EXPECT_EQ(last_msg_->wn, 13102) + << "incorrect value for wn, expected 13102, is " << last_msg_->wn; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgProtectionLevelDepA.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgProtectionLevelDepA.cc index 267a26d90..1de85ccbb 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgProtectionLevelDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgProtectionLevelDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevelDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgProtectionLevelDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_protection_level_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_protection_level_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,47 +82,58 @@ class Test_legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_protection_level_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,22,2,148,22,33,52,126,69,185,47,85,4,139,51,51,51,51,51,244,190,64,102,102,102,102,102,204,168,64,154,153,153,153,25,39,192,64,248,81,104, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgProtectionLevelDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 22, 2, 148, 22, 33, 52, 126, 69, 185, 47, 85, 4, 139, + 51, 51, 51, 51, 51, 244, 190, 64, 102, 102, 102, 102, 102, 204, + 168, 64, 154, 153, 153, 153, 25, 39, 192, 64, 248, 81, 104, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_protection_level_dep_a_t* test_msg = ( msg_protection_level_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 248; - test_msg->height = 8270.2; - test_msg->hpl = 35588; - test_msg->lat = 7924.2; - test_msg->lon = 3174.2; - test_msg->tow = 3108339252; - test_msg->vpl = 21807; - - EXPECT_EQ(send_message( 0x216, 5780, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_protection_level_dep_a_t *test_msg = + (msg_protection_level_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 248; + test_msg->height = 8270.2; + test_msg->hpl = 35588; + test_msg->lat = 7924.2; + test_msg->lon = 3174.2; + test_msg->tow = 3108339252; + test_msg->vpl = 21807; + + EXPECT_EQ(send_message(0x216, 5780, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 5780); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 248) << "incorrect value for flags, expected 248, is " << last_msg_->flags; - EXPECT_LT((last_msg_->height*100 - 8270.2*100), 0.05) << "incorrect value for height, expected 8270.2, is " << last_msg_->height; - EXPECT_EQ(last_msg_->hpl, 35588) << "incorrect value for hpl, expected 35588, is " << last_msg_->hpl; - EXPECT_LT((last_msg_->lat*100 - 7924.2*100), 0.05) << "incorrect value for lat, expected 7924.2, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - 3174.2*100), 0.05) << "incorrect value for lon, expected 3174.2, is " << last_msg_->lon; - EXPECT_EQ(last_msg_->tow, 3108339252) << "incorrect value for tow, expected 3108339252, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->vpl, 21807) << "incorrect value for vpl, expected 21807, is " << last_msg_->vpl; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 5780); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 248) + << "incorrect value for flags, expected 248, is " << last_msg_->flags; + EXPECT_LT((last_msg_->height * 100 - 8270.2 * 100), 0.05) + << "incorrect value for height, expected 8270.2, is " + << last_msg_->height; + EXPECT_EQ(last_msg_->hpl, 35588) + << "incorrect value for hpl, expected 35588, is " << last_msg_->hpl; + EXPECT_LT((last_msg_->lat * 100 - 7924.2 * 100), 0.05) + << "incorrect value for lat, expected 7924.2, is " << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - 3174.2 * 100), 0.05) + << "incorrect value for lon, expected 3174.2, is " << last_msg_->lon; + EXPECT_EQ(last_msg_->tow, 3108339252) + << "incorrect value for tow, expected 3108339252, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->vpl, 21807) + << "incorrect value for vpl, expected 21807, is " << last_msg_->vpl; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgReferenceFrameParam.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgReferenceFrameParam.cc index d74709a0a..d12969624 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgReferenceFrameParam.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgReferenceFrameParam.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgReferenceFrameParam.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgReferenceFrameParam.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_reference_frame_param_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_reference_frame_param_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,91 +82,151 @@ class Test_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_reference_frame_param_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam0, Test) -{ +}; - uint8_t encoded_frame[] = {85,68,2,66,0,124,1,102,111,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,98,97,114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,0,6,0,7,0,0,0,8,0,0,0,9,0,0,0,10,0,0,0,11,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,17,0,0,0,18,0,0,0,19,0,0,0,20,0,6,161, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgReferenceFrameParam0, Test) { + uint8_t encoded_frame[] = { + 85, 68, 2, 66, 0, 124, 1, 102, 111, 111, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 98, 97, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 4, 5, 0, 6, 0, 7, 0, 0, 0, 8, 0, 0, 0, 9, + 0, 0, 0, 10, 0, 0, 0, 11, 0, 0, 0, 12, 0, 0, 0, 13, 0, + 0, 0, 14, 0, 0, 0, 15, 0, 0, 0, 16, 0, 0, 0, 17, 0, 0, + 0, 18, 0, 0, 0, 19, 0, 0, 0, 20, 0, 6, 161, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_reference_frame_param_t* test_msg = ( msg_reference_frame_param_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->delta_X0 = 7; - test_msg->delta_Y0 = 8; - test_msg->delta_Z0 = 9; - test_msg->dot_delta_X0 = 14; - test_msg->dot_delta_Y0 = 15; - test_msg->dot_delta_Z0 = 16; - test_msg->dot_scale = 20; - test_msg->dot_theta_01 = 17; - test_msg->dot_theta_02 = 18; - test_msg->dot_theta_03 = 19; - test_msg->re_t0 = 6; - test_msg->scale = 13; - test_msg->sin = 4; - { - const char assign_string[] = { (char)102,(char)111,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->sn, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->sn) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->ssr_iod = 1; - test_msg->theta_01 = 10; - test_msg->theta_02 = 11; - test_msg->theta_03 = 12; - { - const char assign_string[] = { (char)98,(char)97,(char)114,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->tn, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->tn) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_reference_frame_param_t *test_msg = + (msg_reference_frame_param_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->delta_X0 = 7; + test_msg->delta_Y0 = 8; + test_msg->delta_Z0 = 9; + test_msg->dot_delta_X0 = 14; + test_msg->dot_delta_Y0 = 15; + test_msg->dot_delta_Z0 = 16; + test_msg->dot_scale = 20; + test_msg->dot_theta_01 = 17; + test_msg->dot_theta_02 = 18; + test_msg->dot_theta_03 = 19; + test_msg->re_t0 = 6; + test_msg->scale = 13; + test_msg->sin = 4; + { + const char assign_string[] = { + (char)102, (char)111, (char)111, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->sn, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->sn) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } - test_msg->utn = 5; - - EXPECT_EQ(send_message( 580, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + } + test_msg->ssr_iod = 1; + test_msg->theta_01 = 10; + test_msg->theta_02 = 11; + test_msg->theta_03 = 12; + { + const char assign_string[] = { + (char)98, (char)97, (char)114, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->tn, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->tn) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->utn = 5; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->delta_X0, 7) << "incorrect value for delta_X0, expected 7, is " << last_msg_->delta_X0; - EXPECT_EQ(last_msg_->delta_Y0, 8) << "incorrect value for delta_Y0, expected 8, is " << last_msg_->delta_Y0; - EXPECT_EQ(last_msg_->delta_Z0, 9) << "incorrect value for delta_Z0, expected 9, is " << last_msg_->delta_Z0; - EXPECT_EQ(last_msg_->dot_delta_X0, 14) << "incorrect value for dot_delta_X0, expected 14, is " << last_msg_->dot_delta_X0; - EXPECT_EQ(last_msg_->dot_delta_Y0, 15) << "incorrect value for dot_delta_Y0, expected 15, is " << last_msg_->dot_delta_Y0; - EXPECT_EQ(last_msg_->dot_delta_Z0, 16) << "incorrect value for dot_delta_Z0, expected 16, is " << last_msg_->dot_delta_Z0; - EXPECT_EQ(last_msg_->dot_scale, 20) << "incorrect value for dot_scale, expected 20, is " << last_msg_->dot_scale; - EXPECT_EQ(last_msg_->dot_theta_01, 17) << "incorrect value for dot_theta_01, expected 17, is " << last_msg_->dot_theta_01; - EXPECT_EQ(last_msg_->dot_theta_02, 18) << "incorrect value for dot_theta_02, expected 18, is " << last_msg_->dot_theta_02; - EXPECT_EQ(last_msg_->dot_theta_03, 19) << "incorrect value for dot_theta_03, expected 19, is " << last_msg_->dot_theta_03; - EXPECT_EQ(last_msg_->re_t0, 6) << "incorrect value for re_t0, expected 6, is " << last_msg_->re_t0; - EXPECT_EQ(last_msg_->scale, 13) << "incorrect value for scale, expected 13, is " << last_msg_->scale; - EXPECT_EQ(last_msg_->sin, 4) << "incorrect value for sin, expected 4, is " << last_msg_->sin; - { - const char check_string[] = { (char)102,(char)111,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->sn, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->sn, expected string '" << check_string << "', is '" << last_msg_->sn << "'"; - } - EXPECT_EQ(last_msg_->ssr_iod, 1) << "incorrect value for ssr_iod, expected 1, is " << last_msg_->ssr_iod; - EXPECT_EQ(last_msg_->theta_01, 10) << "incorrect value for theta_01, expected 10, is " << last_msg_->theta_01; - EXPECT_EQ(last_msg_->theta_02, 11) << "incorrect value for theta_02, expected 11, is " << last_msg_->theta_02; - EXPECT_EQ(last_msg_->theta_03, 12) << "incorrect value for theta_03, expected 12, is " << last_msg_->theta_03; - { - const char check_string[] = { (char)98,(char)97,(char)114,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->tn, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->tn, expected string '" << check_string << "', is '" << last_msg_->tn << "'"; - } - EXPECT_EQ(last_msg_->utn, 5) << "incorrect value for utn, expected 5, is " << last_msg_->utn; + EXPECT_EQ(send_message(580, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->delta_X0, 7) + << "incorrect value for delta_X0, expected 7, is " << last_msg_->delta_X0; + EXPECT_EQ(last_msg_->delta_Y0, 8) + << "incorrect value for delta_Y0, expected 8, is " << last_msg_->delta_Y0; + EXPECT_EQ(last_msg_->delta_Z0, 9) + << "incorrect value for delta_Z0, expected 9, is " << last_msg_->delta_Z0; + EXPECT_EQ(last_msg_->dot_delta_X0, 14) + << "incorrect value for dot_delta_X0, expected 14, is " + << last_msg_->dot_delta_X0; + EXPECT_EQ(last_msg_->dot_delta_Y0, 15) + << "incorrect value for dot_delta_Y0, expected 15, is " + << last_msg_->dot_delta_Y0; + EXPECT_EQ(last_msg_->dot_delta_Z0, 16) + << "incorrect value for dot_delta_Z0, expected 16, is " + << last_msg_->dot_delta_Z0; + EXPECT_EQ(last_msg_->dot_scale, 20) + << "incorrect value for dot_scale, expected 20, is " + << last_msg_->dot_scale; + EXPECT_EQ(last_msg_->dot_theta_01, 17) + << "incorrect value for dot_theta_01, expected 17, is " + << last_msg_->dot_theta_01; + EXPECT_EQ(last_msg_->dot_theta_02, 18) + << "incorrect value for dot_theta_02, expected 18, is " + << last_msg_->dot_theta_02; + EXPECT_EQ(last_msg_->dot_theta_03, 19) + << "incorrect value for dot_theta_03, expected 19, is " + << last_msg_->dot_theta_03; + EXPECT_EQ(last_msg_->re_t0, 6) + << "incorrect value for re_t0, expected 6, is " << last_msg_->re_t0; + EXPECT_EQ(last_msg_->scale, 13) + << "incorrect value for scale, expected 13, is " << last_msg_->scale; + EXPECT_EQ(last_msg_->sin, 4) + << "incorrect value for sin, expected 4, is " << last_msg_->sin; + { + const char check_string[] = { + (char)102, (char)111, (char)111, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->sn, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->sn, expected string '" + << check_string << "', is '" << last_msg_->sn << "'"; + } + EXPECT_EQ(last_msg_->ssr_iod, 1) + << "incorrect value for ssr_iod, expected 1, is " << last_msg_->ssr_iod; + EXPECT_EQ(last_msg_->theta_01, 10) + << "incorrect value for theta_01, expected 10, is " + << last_msg_->theta_01; + EXPECT_EQ(last_msg_->theta_02, 11) + << "incorrect value for theta_02, expected 11, is " + << last_msg_->theta_02; + EXPECT_EQ(last_msg_->theta_03, 12) + << "incorrect value for theta_03, expected 12, is " + << last_msg_->theta_03; + { + const char check_string[] = { + (char)98, (char)97, (char)114, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->tn, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->tn, expected string '" + << check_string << "', is '" << last_msg_->tn << "'"; + } + EXPECT_EQ(last_msg_->utn, 5) + << "incorrect value for utn, expected 5, is " << last_msg_->utn; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgUTCLeapSecond.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgUTCLeapSecond.cc index c5c8c71e8..13529f740 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgUTCLeapSecond.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgUTCLeapSecond.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCLeapSecond.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCLeapSecond.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_utc_leap_second_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_utc_leap_second_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,51 +81,67 @@ class Test_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_utc_leap_second_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond0, Test) -{ +}; - uint8_t encoded_frame[] = {85,58,2,66,0,14,1,0,2,0,3,4,5,0,6,0,7,0,8,9,50,232, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgUTCLeapSecond0, Test) { + uint8_t encoded_frame[] = { + 85, 58, 2, 66, 0, 14, 1, 0, 2, 0, 3, 4, 5, 0, 6, 0, 7, 0, 8, 9, 50, 232, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_utc_leap_second_t* test_msg = ( msg_utc_leap_second_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->count_after = 9; - test_msg->count_before = 4; - test_msg->ref_dn = 8; - test_msg->ref_wn = 7; - test_msg->reserved_0 = 1; - test_msg->reserved_1 = 2; - test_msg->reserved_2 = 3; - test_msg->reserved_3 = 5; - test_msg->reserved_4 = 6; - - EXPECT_EQ(send_message( 570, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_utc_leap_second_t *test_msg = (msg_utc_leap_second_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->count_after = 9; + test_msg->count_before = 4; + test_msg->ref_dn = 8; + test_msg->ref_wn = 7; + test_msg->reserved_0 = 1; + test_msg->reserved_1 = 2; + test_msg->reserved_2 = 3; + test_msg->reserved_3 = 5; + test_msg->reserved_4 = 6; + + EXPECT_EQ(send_message(570, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->count_after, 9) << "incorrect value for count_after, expected 9, is " << last_msg_->count_after; - EXPECT_EQ(last_msg_->count_before, 4) << "incorrect value for count_before, expected 4, is " << last_msg_->count_before; - EXPECT_EQ(last_msg_->ref_dn, 8) << "incorrect value for ref_dn, expected 8, is " << last_msg_->ref_dn; - EXPECT_EQ(last_msg_->ref_wn, 7) << "incorrect value for ref_wn, expected 7, is " << last_msg_->ref_wn; - EXPECT_EQ(last_msg_->reserved_0, 1) << "incorrect value for reserved_0, expected 1, is " << last_msg_->reserved_0; - EXPECT_EQ(last_msg_->reserved_1, 2) << "incorrect value for reserved_1, expected 2, is " << last_msg_->reserved_1; - EXPECT_EQ(last_msg_->reserved_2, 3) << "incorrect value for reserved_2, expected 3, is " << last_msg_->reserved_2; - EXPECT_EQ(last_msg_->reserved_3, 5) << "incorrect value for reserved_3, expected 5, is " << last_msg_->reserved_3; - EXPECT_EQ(last_msg_->reserved_4, 6) << "incorrect value for reserved_4, expected 6, is " << last_msg_->reserved_4; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->count_after, 9) + << "incorrect value for count_after, expected 9, is " + << last_msg_->count_after; + EXPECT_EQ(last_msg_->count_before, 4) + << "incorrect value for count_before, expected 4, is " + << last_msg_->count_before; + EXPECT_EQ(last_msg_->ref_dn, 8) + << "incorrect value for ref_dn, expected 8, is " << last_msg_->ref_dn; + EXPECT_EQ(last_msg_->ref_wn, 7) + << "incorrect value for ref_wn, expected 7, is " << last_msg_->ref_wn; + EXPECT_EQ(last_msg_->reserved_0, 1) + << "incorrect value for reserved_0, expected 1, is " + << last_msg_->reserved_0; + EXPECT_EQ(last_msg_->reserved_1, 2) + << "incorrect value for reserved_1, expected 2, is " + << last_msg_->reserved_1; + EXPECT_EQ(last_msg_->reserved_2, 3) + << "incorrect value for reserved_2, expected 3, is " + << last_msg_->reserved_2; + EXPECT_EQ(last_msg_->reserved_3, 5) + << "incorrect value for reserved_3, expected 5, is " + << last_msg_->reserved_3; + EXPECT_EQ(last_msg_->reserved_4, 6) + << "incorrect value for reserved_4, expected 6, is " + << last_msg_->reserved_4; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgUTCTime.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgUTCTime.cc index 64bb848e3..f1bf135b4 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgUTCTime.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgUTCTime.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTime.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgUTCTime0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgUTCTime0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgUTCTime0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgUTCTime0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_utc_time_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_utc_time_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,51 +81,61 @@ class Test_legacy_auto_check_sbp_navigation_MsgUTCTime0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_utc_time_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgUTCTime0, Test) -{ +}; - uint8_t encoded_frame[] = {85,3,1,21,3,16,1,24,229,233,29,229,7,4,9,19,24,9,0,8,175,47,199,253, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgUTCTime0, Test) { + uint8_t encoded_frame[] = { + 85, 3, 1, 21, 3, 16, 1, 24, 229, 233, 29, 229, + 7, 4, 9, 19, 24, 9, 0, 8, 175, 47, 199, 253, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_utc_time_t* test_msg = ( msg_utc_time_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->day = 9; - test_msg->flags = 1; - test_msg->hours = 19; - test_msg->minutes = 24; - test_msg->month = 4; - test_msg->ns = 800000000; - test_msg->seconds = 9; - test_msg->tow = 501867800; - test_msg->year = 2021; - - EXPECT_EQ(send_message( 0x103, 789, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_utc_time_t *test_msg = (msg_utc_time_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->day = 9; + test_msg->flags = 1; + test_msg->hours = 19; + test_msg->minutes = 24; + test_msg->month = 4; + test_msg->ns = 800000000; + test_msg->seconds = 9; + test_msg->tow = 501867800; + test_msg->year = 2021; + + EXPECT_EQ(send_message(0x103, 789, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 789); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->day, 9) << "incorrect value for day, expected 9, is " << last_msg_->day; - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->hours, 19) << "incorrect value for hours, expected 19, is " << last_msg_->hours; - EXPECT_EQ(last_msg_->minutes, 24) << "incorrect value for minutes, expected 24, is " << last_msg_->minutes; - EXPECT_EQ(last_msg_->month, 4) << "incorrect value for month, expected 4, is " << last_msg_->month; - EXPECT_EQ(last_msg_->ns, 800000000) << "incorrect value for ns, expected 800000000, is " << last_msg_->ns; - EXPECT_EQ(last_msg_->seconds, 9) << "incorrect value for seconds, expected 9, is " << last_msg_->seconds; - EXPECT_EQ(last_msg_->tow, 501867800) << "incorrect value for tow, expected 501867800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->year, 2021) << "incorrect value for year, expected 2021, is " << last_msg_->year; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 789); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->day, 9) + << "incorrect value for day, expected 9, is " << last_msg_->day; + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->hours, 19) + << "incorrect value for hours, expected 19, is " << last_msg_->hours; + EXPECT_EQ(last_msg_->minutes, 24) + << "incorrect value for minutes, expected 24, is " << last_msg_->minutes; + EXPECT_EQ(last_msg_->month, 4) + << "incorrect value for month, expected 4, is " << last_msg_->month; + EXPECT_EQ(last_msg_->ns, 800000000) + << "incorrect value for ns, expected 800000000, is " << last_msg_->ns; + EXPECT_EQ(last_msg_->seconds, 9) + << "incorrect value for seconds, expected 9, is " << last_msg_->seconds; + EXPECT_EQ(last_msg_->tow, 501867800) + << "incorrect value for tow, expected 501867800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->year, 2021) + << "incorrect value for year, expected 2021, is " << last_msg_->year; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgUTCTimeGNSS.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgUTCTimeGNSS.cc index b2c1848a3..40c001a9b 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgUTCTimeGNSS.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgUTCTimeGNSS.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTimeGNSS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgUTCTimeGNSS.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_utc_time_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_utc_time_gnss_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,51 +81,61 @@ class Test_legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_utc_time_gnss_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS0, Test) -{ +}; - uint8_t encoded_frame[] = {85,5,1,21,3,16,1,24,229,233,29,229,7,4,9,19,24,9,0,8,175,47,177,33, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgUTCTimeGNSS0, Test) { + uint8_t encoded_frame[] = { + 85, 5, 1, 21, 3, 16, 1, 24, 229, 233, 29, 229, + 7, 4, 9, 19, 24, 9, 0, 8, 175, 47, 177, 33, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_utc_time_gnss_t* test_msg = ( msg_utc_time_gnss_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->day = 9; - test_msg->flags = 1; - test_msg->hours = 19; - test_msg->minutes = 24; - test_msg->month = 4; - test_msg->ns = 800000000; - test_msg->seconds = 9; - test_msg->tow = 501867800; - test_msg->year = 2021; - - EXPECT_EQ(send_message( 0x105, 789, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_utc_time_gnss_t *test_msg = (msg_utc_time_gnss_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->day = 9; + test_msg->flags = 1; + test_msg->hours = 19; + test_msg->minutes = 24; + test_msg->month = 4; + test_msg->ns = 800000000; + test_msg->seconds = 9; + test_msg->tow = 501867800; + test_msg->year = 2021; + + EXPECT_EQ(send_message(0x105, 789, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 789); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->day, 9) << "incorrect value for day, expected 9, is " << last_msg_->day; - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->hours, 19) << "incorrect value for hours, expected 19, is " << last_msg_->hours; - EXPECT_EQ(last_msg_->minutes, 24) << "incorrect value for minutes, expected 24, is " << last_msg_->minutes; - EXPECT_EQ(last_msg_->month, 4) << "incorrect value for month, expected 4, is " << last_msg_->month; - EXPECT_EQ(last_msg_->ns, 800000000) << "incorrect value for ns, expected 800000000, is " << last_msg_->ns; - EXPECT_EQ(last_msg_->seconds, 9) << "incorrect value for seconds, expected 9, is " << last_msg_->seconds; - EXPECT_EQ(last_msg_->tow, 501867800) << "incorrect value for tow, expected 501867800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->year, 2021) << "incorrect value for year, expected 2021, is " << last_msg_->year; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 789); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->day, 9) + << "incorrect value for day, expected 9, is " << last_msg_->day; + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->hours, 19) + << "incorrect value for hours, expected 19, is " << last_msg_->hours; + EXPECT_EQ(last_msg_->minutes, 24) + << "incorrect value for minutes, expected 24, is " << last_msg_->minutes; + EXPECT_EQ(last_msg_->month, 4) + << "incorrect value for month, expected 4, is " << last_msg_->month; + EXPECT_EQ(last_msg_->ns, 800000000) + << "incorrect value for ns, expected 800000000, is " << last_msg_->ns; + EXPECT_EQ(last_msg_->seconds, 9) + << "incorrect value for seconds, expected 9, is " << last_msg_->seconds; + EXPECT_EQ(last_msg_->tow, 501867800) + << "incorrect value for tow, expected 501867800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->year, 2021) + << "incorrect value for year, expected 2021, is " << last_msg_->year; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelBody.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelBody.cc index bb97ef5f6..9b3dd89ce 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelBody.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelBody.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelBody.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelBody.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgVelBody0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelBody0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelBody0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelBody0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_body_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_body_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,57 +81,71 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelBody0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_body_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelBody0, Test) -{ +}; - uint8_t encoded_frame[] = {85,19,2,66,0,42,1,0,0,0,4,0,0,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,160,64,0,0,224,64,0,0,224,64,0,0,64,64,0,0,0,64,3,8,120,144, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelBody0, Test) { + uint8_t encoded_frame[] = { + 85, 19, 2, 66, 0, 42, 1, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 224, 64, + 0, 0, 224, 64, 0, 0, 64, 64, 0, 0, 0, 64, 3, 8, 120, 144, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_body_t* test_msg = ( msg_vel_body_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cov_x_x = 0.0; - test_msg->cov_x_y = 5.0; - test_msg->cov_x_z = 7.0; - test_msg->cov_y_y = 7.0; - test_msg->cov_y_z = 3.0; - test_msg->cov_z_z = 2.0; - test_msg->flags = 8; - test_msg->n_sats = 3; - test_msg->tow = 1; - test_msg->x = 4; - test_msg->y = 2; - test_msg->z = 1; - - EXPECT_EQ(send_message( 0x213, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_body_t *test_msg = (msg_vel_body_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cov_x_x = 0.0; + test_msg->cov_x_y = 5.0; + test_msg->cov_x_z = 7.0; + test_msg->cov_y_y = 7.0; + test_msg->cov_y_z = 3.0; + test_msg->cov_z_z = 2.0; + test_msg->flags = 8; + test_msg->n_sats = 3; + test_msg->tow = 1; + test_msg->x = 4; + test_msg->y = 2; + test_msg->z = 1; + + EXPECT_EQ(send_message(0x213, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cov_x_x*100 - 0.0*100), 0.05) << "incorrect value for cov_x_x, expected 0.0, is " << last_msg_->cov_x_x; - EXPECT_LT((last_msg_->cov_x_y*100 - 5.0*100), 0.05) << "incorrect value for cov_x_y, expected 5.0, is " << last_msg_->cov_x_y; - EXPECT_LT((last_msg_->cov_x_z*100 - 7.0*100), 0.05) << "incorrect value for cov_x_z, expected 7.0, is " << last_msg_->cov_x_z; - EXPECT_LT((last_msg_->cov_y_y*100 - 7.0*100), 0.05) << "incorrect value for cov_y_y, expected 7.0, is " << last_msg_->cov_y_y; - EXPECT_LT((last_msg_->cov_y_z*100 - 3.0*100), 0.05) << "incorrect value for cov_y_z, expected 3.0, is " << last_msg_->cov_y_z; - EXPECT_LT((last_msg_->cov_z_z*100 - 2.0*100), 0.05) << "incorrect value for cov_z_z, expected 2.0, is " << last_msg_->cov_z_z; - EXPECT_EQ(last_msg_->flags, 8) << "incorrect value for flags, expected 8, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 3) << "incorrect value for n_sats, expected 3, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 1) << "incorrect value for tow, expected 1, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, 4) << "incorrect value for x, expected 4, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, 2) << "incorrect value for y, expected 2, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 1) << "incorrect value for z, expected 1, is " << last_msg_->z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cov_x_x * 100 - 0.0 * 100), 0.05) + << "incorrect value for cov_x_x, expected 0.0, is " << last_msg_->cov_x_x; + EXPECT_LT((last_msg_->cov_x_y * 100 - 5.0 * 100), 0.05) + << "incorrect value for cov_x_y, expected 5.0, is " << last_msg_->cov_x_y; + EXPECT_LT((last_msg_->cov_x_z * 100 - 7.0 * 100), 0.05) + << "incorrect value for cov_x_z, expected 7.0, is " << last_msg_->cov_x_z; + EXPECT_LT((last_msg_->cov_y_y * 100 - 7.0 * 100), 0.05) + << "incorrect value for cov_y_y, expected 7.0, is " << last_msg_->cov_y_y; + EXPECT_LT((last_msg_->cov_y_z * 100 - 3.0 * 100), 0.05) + << "incorrect value for cov_y_z, expected 3.0, is " << last_msg_->cov_y_z; + EXPECT_LT((last_msg_->cov_z_z * 100 - 2.0 * 100), 0.05) + << "incorrect value for cov_z_z, expected 2.0, is " << last_msg_->cov_z_z; + EXPECT_EQ(last_msg_->flags, 8) + << "incorrect value for flags, expected 8, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 3) + << "incorrect value for n_sats, expected 3, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 1) + << "incorrect value for tow, expected 1, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, 4) + << "incorrect value for x, expected 4, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, 2) + << "incorrect value for y, expected 2, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 1) + << "incorrect value for z, expected 1, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelCog.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelCog.cc index 592e60288..da422b299 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelCog.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelCog.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelCog.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelCog.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgVelCog0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelCog0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelCog0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelCog0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_cog_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_cog_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,100 +81,107 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelCog0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_cog_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelCog0, Test) -{ - - uint8_t encoded_frame[] = {85,28,2,211,136,30,48,246,122,19,232,3,0,0,208,7,0,0,184,11,0,0,160,15,0,0,136,19,0,0,112,23,0,0,62,0,212,193, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_cog_t* test_msg = ( msg_vel_cog_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cog = 1000; - test_msg->cog_accuracy = 4000; - test_msg->flags = 62; - test_msg->sog = 2000; - test_msg->sog_accuracy = 5000; - test_msg->tow = 326825520; - test_msg->v_up = 3000; - test_msg->v_up_accuracy = 6000; - - EXPECT_EQ(send_message( 0x21C, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cog, 1000) << "incorrect value for cog, expected 1000, is " << last_msg_->cog; - EXPECT_EQ(last_msg_->cog_accuracy, 4000) << "incorrect value for cog_accuracy, expected 4000, is " << last_msg_->cog_accuracy; - EXPECT_EQ(last_msg_->flags, 62) << "incorrect value for flags, expected 62, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->sog, 2000) << "incorrect value for sog, expected 2000, is " << last_msg_->sog; - EXPECT_EQ(last_msg_->sog_accuracy, 5000) << "incorrect value for sog_accuracy, expected 5000, is " << last_msg_->sog_accuracy; - EXPECT_EQ(last_msg_->tow, 326825520) << "incorrect value for tow, expected 326825520, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_up, 3000) << "incorrect value for v_up, expected 3000, is " << last_msg_->v_up; - EXPECT_EQ(last_msg_->v_up_accuracy, 6000) << "incorrect value for v_up_accuracy, expected 6000, is " << last_msg_->v_up_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelCog0, Test) { + uint8_t encoded_frame[] = { + 85, 28, 2, 211, 136, 30, 48, 246, 122, 19, 232, 3, 0, + 0, 208, 7, 0, 0, 184, 11, 0, 0, 160, 15, 0, 0, + 136, 19, 0, 0, 112, 23, 0, 0, 62, 0, 212, 193, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_cog_t *test_msg = (msg_vel_cog_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cog = 1000; + test_msg->cog_accuracy = 4000; + test_msg->flags = 62; + test_msg->sog = 2000; + test_msg->sog_accuracy = 5000; + test_msg->tow = 326825520; + test_msg->v_up = 3000; + test_msg->v_up_accuracy = 6000; + + EXPECT_EQ(send_message(0x21C, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cog, 1000) + << "incorrect value for cog, expected 1000, is " << last_msg_->cog; + EXPECT_EQ(last_msg_->cog_accuracy, 4000) + << "incorrect value for cog_accuracy, expected 4000, is " + << last_msg_->cog_accuracy; + EXPECT_EQ(last_msg_->flags, 62) + << "incorrect value for flags, expected 62, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->sog, 2000) + << "incorrect value for sog, expected 2000, is " << last_msg_->sog; + EXPECT_EQ(last_msg_->sog_accuracy, 5000) + << "incorrect value for sog_accuracy, expected 5000, is " + << last_msg_->sog_accuracy; + EXPECT_EQ(last_msg_->tow, 326825520) + << "incorrect value for tow, expected 326825520, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_up, 3000) + << "incorrect value for v_up, expected 3000, is " << last_msg_->v_up; + EXPECT_EQ(last_msg_->v_up_accuracy, 6000) + << "incorrect value for v_up_accuracy, expected 6000, is " + << last_msg_->v_up_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelCog1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelCog1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelCog1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelCog1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_cog_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_cog_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -188,100 +191,107 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelCog1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_cog_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelCog1, Test) -{ - - uint8_t encoded_frame[] = {85,28,2,211,136,30,48,246,122,19,123,0,0,0,200,1,0,0,24,252,255,255,0,149,186,10,100,0,0,0,100,0,0,0,0,0,90,114, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_cog_t* test_msg = ( msg_vel_cog_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cog = 123; - test_msg->cog_accuracy = 180000000; - test_msg->flags = 0; - test_msg->sog = 456; - test_msg->sog_accuracy = 100; - test_msg->tow = 326825520; - test_msg->v_up = -1000; - test_msg->v_up_accuracy = 100; - - EXPECT_EQ(send_message( 0x21C, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cog, 123) << "incorrect value for cog, expected 123, is " << last_msg_->cog; - EXPECT_EQ(last_msg_->cog_accuracy, 180000000) << "incorrect value for cog_accuracy, expected 180000000, is " << last_msg_->cog_accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->sog, 456) << "incorrect value for sog, expected 456, is " << last_msg_->sog; - EXPECT_EQ(last_msg_->sog_accuracy, 100) << "incorrect value for sog_accuracy, expected 100, is " << last_msg_->sog_accuracy; - EXPECT_EQ(last_msg_->tow, 326825520) << "incorrect value for tow, expected 326825520, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_up, -1000) << "incorrect value for v_up, expected -1000, is " << last_msg_->v_up; - EXPECT_EQ(last_msg_->v_up_accuracy, 100) << "incorrect value for v_up_accuracy, expected 100, is " << last_msg_->v_up_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelCog1, Test) { + uint8_t encoded_frame[] = { + 85, 28, 2, 211, 136, 30, 48, 246, 122, 19, 123, 0, 0, + 0, 200, 1, 0, 0, 24, 252, 255, 255, 0, 149, 186, 10, + 100, 0, 0, 0, 100, 0, 0, 0, 0, 0, 90, 114, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_cog_t *test_msg = (msg_vel_cog_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cog = 123; + test_msg->cog_accuracy = 180000000; + test_msg->flags = 0; + test_msg->sog = 456; + test_msg->sog_accuracy = 100; + test_msg->tow = 326825520; + test_msg->v_up = -1000; + test_msg->v_up_accuracy = 100; + + EXPECT_EQ(send_message(0x21C, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cog, 123) + << "incorrect value for cog, expected 123, is " << last_msg_->cog; + EXPECT_EQ(last_msg_->cog_accuracy, 180000000) + << "incorrect value for cog_accuracy, expected 180000000, is " + << last_msg_->cog_accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->sog, 456) + << "incorrect value for sog, expected 456, is " << last_msg_->sog; + EXPECT_EQ(last_msg_->sog_accuracy, 100) + << "incorrect value for sog_accuracy, expected 100, is " + << last_msg_->sog_accuracy; + EXPECT_EQ(last_msg_->tow, 326825520) + << "incorrect value for tow, expected 326825520, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_up, -1000) + << "incorrect value for v_up, expected -1000, is " << last_msg_->v_up; + EXPECT_EQ(last_msg_->v_up_accuracy, 100) + << "incorrect value for v_up_accuracy, expected 100, is " + << last_msg_->v_up_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelCog2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelCog2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelCog2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelCog2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_cog_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_cog_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -291,49 +301,61 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelCog2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_cog_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelCog2, Test) -{ - - uint8_t encoded_frame[] = {85,28,2,211,136,30,48,246,122,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,210, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_cog_t* test_msg = ( msg_vel_cog_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cog = 0; - test_msg->cog_accuracy = 0; - test_msg->flags = 0; - test_msg->sog = 0; - test_msg->sog_accuracy = 0; - test_msg->tow = 326825520; - test_msg->v_up = 0; - test_msg->v_up_accuracy = 0; - - EXPECT_EQ(send_message( 0x21C, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cog, 0) << "incorrect value for cog, expected 0, is " << last_msg_->cog; - EXPECT_EQ(last_msg_->cog_accuracy, 0) << "incorrect value for cog_accuracy, expected 0, is " << last_msg_->cog_accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->sog, 0) << "incorrect value for sog, expected 0, is " << last_msg_->sog; - EXPECT_EQ(last_msg_->sog_accuracy, 0) << "incorrect value for sog_accuracy, expected 0, is " << last_msg_->sog_accuracy; - EXPECT_EQ(last_msg_->tow, 326825520) << "incorrect value for tow, expected 326825520, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_up, 0) << "incorrect value for v_up, expected 0, is " << last_msg_->v_up; - EXPECT_EQ(last_msg_->v_up_accuracy, 0) << "incorrect value for v_up_accuracy, expected 0, is " << last_msg_->v_up_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelCog2, Test) { + uint8_t encoded_frame[] = { + 85, 28, 2, 211, 136, 30, 48, 246, 122, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 210, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_cog_t *test_msg = (msg_vel_cog_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cog = 0; + test_msg->cog_accuracy = 0; + test_msg->flags = 0; + test_msg->sog = 0; + test_msg->sog_accuracy = 0; + test_msg->tow = 326825520; + test_msg->v_up = 0; + test_msg->v_up_accuracy = 0; + + EXPECT_EQ(send_message(0x21C, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cog, 0) + << "incorrect value for cog, expected 0, is " << last_msg_->cog; + EXPECT_EQ(last_msg_->cog_accuracy, 0) + << "incorrect value for cog_accuracy, expected 0, is " + << last_msg_->cog_accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->sog, 0) + << "incorrect value for sog, expected 0, is " << last_msg_->sog; + EXPECT_EQ(last_msg_->sog_accuracy, 0) + << "incorrect value for sog_accuracy, expected 0, is " + << last_msg_->sog_accuracy; + EXPECT_EQ(last_msg_->tow, 326825520) + << "incorrect value for tow, expected 326825520, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_up, 0) + << "incorrect value for v_up, expected 0, is " << last_msg_->v_up; + EXPECT_EQ(last_msg_->v_up_accuracy, 0) + << "incorrect value for v_up_accuracy, expected 0, is " + << last_msg_->v_up_accuracy; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelECEF.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelECEF.cc index 1be158852..65a622d73 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelECEF.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelECEF.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEF.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgVelECEF0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEF0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEF0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEF0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,98 +81,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEF0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEF0, Test) -{ - - uint8_t encoded_frame[] = {85,13,2,211,136,20,40,244,122,19,248,255,255,255,251,255,255,255,10,0,0,0,0,0,14,0,181,99, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_t* test_msg = ( msg_vel_ecef_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 14; - test_msg->tow = 326825000; - test_msg->x = -8; - test_msg->y = -5; - test_msg->z = 10; - - EXPECT_EQ(send_message( 0x20d, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 14) << "incorrect value for n_sats, expected 14, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326825000) << "incorrect value for tow, expected 326825000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -8) << "incorrect value for x, expected -8, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -5) << "incorrect value for y, expected -5, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 10) << "incorrect value for z, expected 10, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEF0, Test) { + uint8_t encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 40, 244, 122, 19, 248, 255, 255, 255, + 251, 255, 255, 255, 10, 0, 0, 0, 0, 0, 14, 0, 181, 99, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_t *test_msg = (msg_vel_ecef_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 14; + test_msg->tow = 326825000; + test_msg->x = -8; + test_msg->y = -5; + test_msg->z = 10; + + EXPECT_EQ(send_message(0x20d, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 14) + << "incorrect value for n_sats, expected 14, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326825000) + << "incorrect value for tow, expected 326825000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -8) + << "incorrect value for x, expected -8, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -5) + << "incorrect value for y, expected -5, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 10) + << "incorrect value for z, expected 10, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgVelECEF1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEF1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEF1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEF1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -186,98 +184,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEF1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEF1, Test) -{ - - uint8_t encoded_frame[] = {85,13,2,211,136,20,28,246,122,19,244,255,255,255,238,255,255,255,11,0,0,0,0,0,15,0,215,120, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_t* test_msg = ( msg_vel_ecef_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 15; - test_msg->tow = 326825500; - test_msg->x = -12; - test_msg->y = -18; - test_msg->z = 11; - - EXPECT_EQ(send_message( 0x20d, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326825500) << "incorrect value for tow, expected 326825500, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -12) << "incorrect value for x, expected -12, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -18) << "incorrect value for y, expected -18, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 11) << "incorrect value for z, expected 11, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEF1, Test) { + uint8_t encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 28, 246, 122, 19, 244, 255, 255, 255, + 238, 255, 255, 255, 11, 0, 0, 0, 0, 0, 15, 0, 215, 120, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_t *test_msg = (msg_vel_ecef_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 15; + test_msg->tow = 326825500; + test_msg->x = -12; + test_msg->y = -18; + test_msg->z = 11; + + EXPECT_EQ(send_message(0x20d, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326825500) + << "incorrect value for tow, expected 326825500, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -12) + << "incorrect value for x, expected -12, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -18) + << "incorrect value for y, expected -18, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 11) + << "incorrect value for z, expected 11, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgVelECEF2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEF2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEF2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEF2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -287,98 +287,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEF2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEF2, Test) -{ - - uint8_t encoded_frame[] = {85,13,2,211,136,20,16,248,122,19,248,255,255,255,250,255,255,255,7,0,0,0,0,0,15,0,248,221, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_t* test_msg = ( msg_vel_ecef_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 15; - test_msg->tow = 326826000; - test_msg->x = -8; - test_msg->y = -6; - test_msg->z = 7; - - EXPECT_EQ(send_message( 0x20d, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326826000) << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -8) << "incorrect value for x, expected -8, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -6) << "incorrect value for y, expected -6, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 7) << "incorrect value for z, expected 7, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEF2, Test) { + uint8_t encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 16, 248, 122, 19, 248, 255, 255, 255, + 250, 255, 255, 255, 7, 0, 0, 0, 0, 0, 15, 0, 248, 221, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_t *test_msg = (msg_vel_ecef_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 15; + test_msg->tow = 326826000; + test_msg->x = -8; + test_msg->y = -6; + test_msg->z = 7; + + EXPECT_EQ(send_message(0x20d, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326826000) + << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -8) + << "incorrect value for x, expected -8, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -6) + << "incorrect value for y, expected -6, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 7) + << "incorrect value for z, expected 7, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgVelECEF3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEF3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEF3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEF3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -388,98 +390,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEF3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEF3, Test) -{ - - uint8_t encoded_frame[] = {85,13,2,211,136,20,4,250,122,19,249,255,255,255,239,255,255,255,16,0,0,0,0,0,15,0,1,167, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_t* test_msg = ( msg_vel_ecef_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 15; - test_msg->tow = 326826500; - test_msg->x = -7; - test_msg->y = -17; - test_msg->z = 16; - - EXPECT_EQ(send_message( 0x20d, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326826500) << "incorrect value for tow, expected 326826500, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -7) << "incorrect value for x, expected -7, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -17) << "incorrect value for y, expected -17, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 16) << "incorrect value for z, expected 16, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEF3, Test) { + uint8_t encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 4, 250, 122, 19, 249, 255, 255, 255, + 239, 255, 255, 255, 16, 0, 0, 0, 0, 0, 15, 0, 1, 167, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_t *test_msg = (msg_vel_ecef_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 15; + test_msg->tow = 326826500; + test_msg->x = -7; + test_msg->y = -17; + test_msg->z = 16; + + EXPECT_EQ(send_message(0x20d, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326826500) + << "incorrect value for tow, expected 326826500, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -7) + << "incorrect value for x, expected -7, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -17) + << "incorrect value for y, expected -17, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 16) + << "incorrect value for z, expected 16, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgVelECEF4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEF4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEF4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEF4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -489,47 +493,55 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEF4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEF4, Test) -{ - - uint8_t encoded_frame[] = {85,13,2,211,136,20,248,251,122,19,247,255,255,255,243,255,255,255,14,0,0,0,0,0,15,0,191,43, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_t* test_msg = ( msg_vel_ecef_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 15; - test_msg->tow = 326827000; - test_msg->x = -9; - test_msg->y = -13; - test_msg->z = 14; - - EXPECT_EQ(send_message( 0x20d, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326827000) << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -9) << "incorrect value for x, expected -9, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -13) << "incorrect value for y, expected -13, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 14) << "incorrect value for z, expected 14, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEF4, Test) { + uint8_t encoded_frame[] = { + 85, 13, 2, 211, 136, 20, 248, 251, 122, 19, 247, 255, 255, 255, + 243, 255, 255, 255, 14, 0, 0, 0, 0, 0, 15, 0, 191, 43, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_t *test_msg = (msg_vel_ecef_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 15; + test_msg->tow = 326827000; + test_msg->x = -9; + test_msg->y = -13; + test_msg->z = 14; + + EXPECT_EQ(send_message(0x20d, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326827000) + << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -9) + << "incorrect value for x, expected -9, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -13) + << "incorrect value for y, expected -13, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 14) + << "incorrect value for z, expected 14, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelECEFCov.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelECEFCov.cc index 52cb1a871..617f10c01 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelECEFCov.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelECEFCov.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFCov.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFCov.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgVelECEFCov0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEFCov0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEFCov0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEFCov0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_cov_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_cov_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,57 +81,71 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEFCov0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_cov_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFCov0, Test) -{ +}; - uint8_t encoded_frame[] = {85,21,2,66,0,42,2,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,64,0,0,0,64,0,0,0,64,0,0,0,64,0,0,128,63,0,0,64,64,3,4,91,254, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFCov0, Test) { + uint8_t encoded_frame[] = { + 85, 21, 2, 66, 0, 42, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 64, 0, 0, 0, 64, + 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 64, 64, 3, 4, 91, 254, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_cov_t* test_msg = ( msg_vel_ecef_cov_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cov_x_x = 2.0; - test_msg->cov_x_y = 2.0; - test_msg->cov_x_z = 2.0; - test_msg->cov_y_y = 2.0; - test_msg->cov_y_z = 1.0; - test_msg->cov_z_z = 3.0; - test_msg->flags = 4; - test_msg->n_sats = 3; - test_msg->tow = 2; - test_msg->x = 0; - test_msg->y = 0; - test_msg->z = 6; - - EXPECT_EQ(send_message( 0x215, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_cov_t *test_msg = (msg_vel_ecef_cov_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cov_x_x = 2.0; + test_msg->cov_x_y = 2.0; + test_msg->cov_x_z = 2.0; + test_msg->cov_y_y = 2.0; + test_msg->cov_y_z = 1.0; + test_msg->cov_z_z = 3.0; + test_msg->flags = 4; + test_msg->n_sats = 3; + test_msg->tow = 2; + test_msg->x = 0; + test_msg->y = 0; + test_msg->z = 6; + + EXPECT_EQ(send_message(0x215, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cov_x_x*100 - 2.0*100), 0.05) << "incorrect value for cov_x_x, expected 2.0, is " << last_msg_->cov_x_x; - EXPECT_LT((last_msg_->cov_x_y*100 - 2.0*100), 0.05) << "incorrect value for cov_x_y, expected 2.0, is " << last_msg_->cov_x_y; - EXPECT_LT((last_msg_->cov_x_z*100 - 2.0*100), 0.05) << "incorrect value for cov_x_z, expected 2.0, is " << last_msg_->cov_x_z; - EXPECT_LT((last_msg_->cov_y_y*100 - 2.0*100), 0.05) << "incorrect value for cov_y_y, expected 2.0, is " << last_msg_->cov_y_y; - EXPECT_LT((last_msg_->cov_y_z*100 - 1.0*100), 0.05) << "incorrect value for cov_y_z, expected 1.0, is " << last_msg_->cov_y_z; - EXPECT_LT((last_msg_->cov_z_z*100 - 3.0*100), 0.05) << "incorrect value for cov_z_z, expected 3.0, is " << last_msg_->cov_z_z; - EXPECT_EQ(last_msg_->flags, 4) << "incorrect value for flags, expected 4, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 3) << "incorrect value for n_sats, expected 3, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2) << "incorrect value for tow, expected 2, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, 0) << "incorrect value for x, expected 0, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, 0) << "incorrect value for y, expected 0, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 6) << "incorrect value for z, expected 6, is " << last_msg_->z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cov_x_x * 100 - 2.0 * 100), 0.05) + << "incorrect value for cov_x_x, expected 2.0, is " << last_msg_->cov_x_x; + EXPECT_LT((last_msg_->cov_x_y * 100 - 2.0 * 100), 0.05) + << "incorrect value for cov_x_y, expected 2.0, is " << last_msg_->cov_x_y; + EXPECT_LT((last_msg_->cov_x_z * 100 - 2.0 * 100), 0.05) + << "incorrect value for cov_x_z, expected 2.0, is " << last_msg_->cov_x_z; + EXPECT_LT((last_msg_->cov_y_y * 100 - 2.0 * 100), 0.05) + << "incorrect value for cov_y_y, expected 2.0, is " << last_msg_->cov_y_y; + EXPECT_LT((last_msg_->cov_y_z * 100 - 1.0 * 100), 0.05) + << "incorrect value for cov_y_z, expected 1.0, is " << last_msg_->cov_y_z; + EXPECT_LT((last_msg_->cov_z_z * 100 - 3.0 * 100), 0.05) + << "incorrect value for cov_z_z, expected 3.0, is " << last_msg_->cov_z_z; + EXPECT_EQ(last_msg_->flags, 4) + << "incorrect value for flags, expected 4, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 3) + << "incorrect value for n_sats, expected 3, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2) + << "incorrect value for tow, expected 2, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, 0) + << "incorrect value for x, expected 0, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, 0) + << "incorrect value for y, expected 0, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 6) + << "incorrect value for z, expected 6, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelECEFDepA.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelECEFDepA.cc index a492d1605..ea216e6ac 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelECEFDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelECEFDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelECEFDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,98 +81,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,246,215,20,20,46,39,0,218,11,0,0,134,245,255,255,163,252,255,255,0,0,9,0,80,236, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 9; - test_msg->tow = 2567700; - test_msg->x = 3034; - test_msg->y = -2682; - test_msg->z = -861; - - EXPECT_EQ(send_message( 0x204, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567700) << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, 3034) << "incorrect value for x, expected 3034, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -2682) << "incorrect value for y, expected -2682, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, -861) << "incorrect value for z, expected -861, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 20, 46, 39, 0, 218, 11, 0, 0, + 134, 245, 255, 255, 163, 252, 255, 255, 0, 0, 9, 0, 80, 236, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_dep_a_t *test_msg = (msg_vel_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 9; + test_msg->tow = 2567700; + test_msg->x = 3034; + test_msg->y = -2682; + test_msg->z = -861; + + EXPECT_EQ(send_message(0x204, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567700) + << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, 3034) + << "incorrect value for x, expected 3034, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -2682) + << "incorrect value for y, expected -2682, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, -861) + << "incorrect value for z, expected -861, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -186,98 +184,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,246,215,20,120,46,39,0,68,11,0,0,24,246,255,255,220,252,255,255,0,0,9,0,248,138, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 9; - test_msg->tow = 2567800; - test_msg->x = 2884; - test_msg->y = -2536; - test_msg->z = -804; - - EXPECT_EQ(send_message( 0x204, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567800) << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, 2884) << "incorrect value for x, expected 2884, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -2536) << "incorrect value for y, expected -2536, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, -804) << "incorrect value for z, expected -804, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 120, 46, 39, 0, 68, 11, 0, 0, + 24, 246, 255, 255, 220, 252, 255, 255, 0, 0, 9, 0, 248, 138, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_dep_a_t *test_msg = (msg_vel_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 9; + test_msg->tow = 2567800; + test_msg->x = 2884; + test_msg->y = -2536; + test_msg->z = -804; + + EXPECT_EQ(send_message(0x204, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567800) + << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, 2884) + << "incorrect value for x, expected 2884, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -2536) + << "incorrect value for y, expected -2536, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, -804) + << "incorrect value for z, expected -804, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -287,98 +287,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,246,215,20,220,46,39,0,21,11,0,0,77,246,255,255,247,252,255,255,0,0,9,0,25,174, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 9; - test_msg->tow = 2567900; - test_msg->x = 2837; - test_msg->y = -2483; - test_msg->z = -777; - - EXPECT_EQ(send_message( 0x204, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567900) << "incorrect value for tow, expected 2567900, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, 2837) << "incorrect value for x, expected 2837, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -2483) << "incorrect value for y, expected -2483, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, -777) << "incorrect value for z, expected -777, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 220, 46, 39, 0, 21, 11, 0, 0, + 77, 246, 255, 255, 247, 252, 255, 255, 0, 0, 9, 0, 25, 174, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_dep_a_t *test_msg = (msg_vel_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 9; + test_msg->tow = 2567900; + test_msg->x = 2837; + test_msg->y = -2483; + test_msg->z = -777; + + EXPECT_EQ(send_message(0x204, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567900) + << "incorrect value for tow, expected 2567900, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, 2837) + << "incorrect value for x, expected 2837, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -2483) + << "incorrect value for y, expected -2483, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, -777) + << "incorrect value for z, expected -777, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -388,98 +390,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,246,215,20,64,47,39,0,121,11,0,0,2,246,255,255,234,252,255,255,0,0,9,0,195,228, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 9; - test_msg->tow = 2568000; - test_msg->x = 2937; - test_msg->y = -2558; - test_msg->z = -790; - - EXPECT_EQ(send_message( 0x204, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2568000) << "incorrect value for tow, expected 2568000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, 2937) << "incorrect value for x, expected 2937, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -2558) << "incorrect value for y, expected -2558, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, -790) << "incorrect value for z, expected -790, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 64, 47, 39, 0, 121, 11, 0, 0, + 2, 246, 255, 255, 234, 252, 255, 255, 0, 0, 9, 0, 195, 228, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_dep_a_t *test_msg = (msg_vel_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 9; + test_msg->tow = 2568000; + test_msg->x = 2937; + test_msg->y = -2558; + test_msg->z = -790; + + EXPECT_EQ(send_message(0x204, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2568000) + << "incorrect value for tow, expected 2568000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, 2937) + << "incorrect value for x, expected 2937, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -2558) + << "incorrect value for y, expected -2558, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, -790) + << "incorrect value for z, expected -790, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -489,98 +493,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,246,215,20,164,47,39,0,31,11,0,0,93,246,255,255,16,253,255,255,0,0,9,0,219,164, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 9; - test_msg->tow = 2568100; - test_msg->x = 2847; - test_msg->y = -2467; - test_msg->z = -752; - - EXPECT_EQ(send_message( 0x204, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2568100) << "incorrect value for tow, expected 2568100, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, 2847) << "incorrect value for x, expected 2847, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -2467) << "incorrect value for y, expected -2467, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, -752) << "incorrect value for z, expected -752, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 246, 215, 20, 164, 47, 39, 0, 31, 11, 0, 0, + 93, 246, 255, 255, 16, 253, 255, 255, 0, 0, 9, 0, 219, 164, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_dep_a_t *test_msg = (msg_vel_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 9; + test_msg->tow = 2568100; + test_msg->x = 2847; + test_msg->y = -2467; + test_msg->z = -752; + + EXPECT_EQ(send_message(0x204, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2568100) + << "incorrect value for tow, expected 2568100, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, 2847) + << "incorrect value for x, expected 2847, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -2467) + << "incorrect value for y, expected -2467, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, -752) + << "incorrect value for z, expected -752, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -590,98 +596,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,195,4,20,212,157,67,24,24,0,0,0,245,255,255,255,219,255,255,255,0,0,8,0,68,255, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 8; - test_msg->tow = 407084500; - test_msg->x = 24; - test_msg->y = -11; - test_msg->z = -37; - - EXPECT_EQ(send_message( 0x204, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084500) << "incorrect value for tow, expected 407084500, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, 24) << "incorrect value for x, expected 24, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -11) << "incorrect value for y, expected -11, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, -37) << "incorrect value for z, expected -37, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 212, 157, 67, 24, 24, 0, 0, 0, + 245, 255, 255, 255, 219, 255, 255, 255, 0, 0, 8, 0, 68, 255, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_dep_a_t *test_msg = (msg_vel_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 8; + test_msg->tow = 407084500; + test_msg->x = 24; + test_msg->y = -11; + test_msg->z = -37; + + EXPECT_EQ(send_message(0x204, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084500) + << "incorrect value for tow, expected 407084500, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, 24) + << "incorrect value for x, expected 24, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -11) + << "incorrect value for y, expected -11, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, -37) + << "incorrect value for z, expected -37, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA6 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA6() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA6 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA6() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -691,98 +699,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA6 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,195,4,20,56,158,67,24,4,0,0,0,234,255,255,255,18,0,0,0,0,0,8,0,214,136, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 8; - test_msg->tow = 407084600; - test_msg->x = 4; - test_msg->y = -22; - test_msg->z = 18; - - EXPECT_EQ(send_message( 0x204, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084600) << "incorrect value for tow, expected 407084600, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, 4) << "incorrect value for x, expected 4, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -22) << "incorrect value for y, expected -22, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 18) << "incorrect value for z, expected 18, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 56, 158, 67, 24, 4, 0, 0, 0, + 234, 255, 255, 255, 18, 0, 0, 0, 0, 0, 8, 0, 214, 136, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_dep_a_t *test_msg = (msg_vel_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 8; + test_msg->tow = 407084600; + test_msg->x = 4; + test_msg->y = -22; + test_msg->z = 18; + + EXPECT_EQ(send_message(0x204, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084600) + << "incorrect value for tow, expected 407084600, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, 4) + << "incorrect value for x, expected 4, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -22) + << "incorrect value for y, expected -22, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 18) + << "incorrect value for z, expected 18, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA7 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA7() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA7 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA7() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -792,98 +802,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA7 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,195,4,20,156,158,67,24,230,255,255,255,4,0,0,0,1,0,0,0,0,0,8,0,122,159, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 8; - test_msg->tow = 407084700; - test_msg->x = -26; - test_msg->y = 4; - test_msg->z = 1; - - EXPECT_EQ(send_message( 0x204, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084700) << "incorrect value for tow, expected 407084700, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -26) << "incorrect value for x, expected -26, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, 4) << "incorrect value for y, expected 4, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 1) << "incorrect value for z, expected 1, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 156, 158, 67, 24, 230, 255, 255, 255, + 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8, 0, 122, 159, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_dep_a_t *test_msg = (msg_vel_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 8; + test_msg->tow = 407084700; + test_msg->x = -26; + test_msg->y = 4; + test_msg->z = 1; + + EXPECT_EQ(send_message(0x204, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084700) + << "incorrect value for tow, expected 407084700, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -26) + << "incorrect value for x, expected -26, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, 4) + << "incorrect value for y, expected 4, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 1) + << "incorrect value for z, expected 1, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA8 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA8() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA8 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA8() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -893,98 +905,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA8 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,195,4,20,0,159,67,24,247,255,255,255,237,255,255,255,28,0,0,0,0,0,8,0,232,146, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 8; - test_msg->tow = 407084800; - test_msg->x = -9; - test_msg->y = -19; - test_msg->z = 28; - - EXPECT_EQ(send_message( 0x204, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084800) << "incorrect value for tow, expected 407084800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -9) << "incorrect value for x, expected -9, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -19) << "incorrect value for y, expected -19, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 28) << "incorrect value for z, expected 28, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 0, 159, 67, 24, 247, 255, 255, 255, + 237, 255, 255, 255, 28, 0, 0, 0, 0, 0, 8, 0, 232, 146, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_dep_a_t *test_msg = (msg_vel_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 8; + test_msg->tow = 407084800; + test_msg->x = -9; + test_msg->y = -19; + test_msg->z = 28; + + EXPECT_EQ(send_message(0x204, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084800) + << "incorrect value for tow, expected 407084800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -9) + << "incorrect value for x, expected -9, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -19) + << "incorrect value for y, expected -19, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 28) + << "incorrect value for z, expected 28, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA9 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA9() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA9 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA9() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -994,98 +1008,100 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA9 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA9, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,195,4,20,100,159,67,24,255,255,255,255,2,0,0,0,245,255,255,255,0,0,8,0,171,238, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 8; - test_msg->tow = 407084900; - test_msg->x = -1; - test_msg->y = 2; - test_msg->z = -11; - - EXPECT_EQ(send_message( 0x204, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084900) << "incorrect value for tow, expected 407084900, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -1) << "incorrect value for x, expected -1, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, 2) << "incorrect value for y, expected 2, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, -11) << "incorrect value for z, expected -11, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA9, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 100, 159, 67, 24, 255, 255, 255, 255, + 2, 0, 0, 0, 245, 255, 255, 255, 0, 0, 8, 0, 171, 238, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_dep_a_t *test_msg = (msg_vel_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 8; + test_msg->tow = 407084900; + test_msg->x = -1; + test_msg->y = 2; + test_msg->z = -11; + + EXPECT_EQ(send_message(0x204, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084900) + << "incorrect value for tow, expected 407084900, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -1) + << "incorrect value for x, expected -1, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, 2) + << "incorrect value for y, expected 2, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, -11) + << "incorrect value for z, expected -11, is " << last_msg_->z; } -class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA10 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA10() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA10 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA10() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -1095,47 +1111,55 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA10 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA10, Test) -{ - - uint8_t encoded_frame[] = {85,4,2,195,4,20,46,162,68,24,207,255,255,255,185,255,255,255,65,0,0,0,0,0,5,0,82,154, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_dep_a_t* test_msg = ( msg_vel_ecef_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 0; - test_msg->flags = 0; - test_msg->n_sats = 5; - test_msg->tow = 407151150; - test_msg->x = -49; - test_msg->y = -71; - test_msg->z = 65; - - EXPECT_EQ(send_message( 0x204, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 0) << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 5) << "incorrect value for n_sats, expected 5, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407151150) << "incorrect value for tow, expected 407151150, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -49) << "incorrect value for x, expected -49, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, -71) << "incorrect value for y, expected -71, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 65) << "incorrect value for z, expected 65, is " << last_msg_->z; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelECEFDepA10, Test) { + uint8_t encoded_frame[] = { + 85, 4, 2, 195, 4, 20, 46, 162, 68, 24, 207, 255, 255, 255, + 185, 255, 255, 255, 65, 0, 0, 0, 0, 0, 5, 0, 82, 154, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_dep_a_t *test_msg = (msg_vel_ecef_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 0; + test_msg->flags = 0; + test_msg->n_sats = 5; + test_msg->tow = 407151150; + test_msg->x = -49; + test_msg->y = -71; + test_msg->z = 65; + + EXPECT_EQ(send_message(0x204, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 0) + << "incorrect value for accuracy, expected 0, is " << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 5) + << "incorrect value for n_sats, expected 5, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407151150) + << "incorrect value for tow, expected 407151150, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -49) + << "incorrect value for x, expected -49, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, -71) + << "incorrect value for y, expected -71, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 65) + << "incorrect value for z, expected 65, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelEcefCovGnss.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelEcefCovGnss.cc index aedc10dd1..910417fdb 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelEcefCovGnss.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelEcefCovGnss.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefCovGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefCovGnss.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_cov_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_cov_gnss_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,57 +82,79 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_cov_gnss_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss0, Test) -{ +}; - uint8_t encoded_frame[] = {85,53,2,0,16,42,224,229,233,29,253,255,255,255,1,0,0,0,4,0,0,0,46,224,32,59,32,214,14,59,150,147,220,186,19,63,138,59,26,150,35,187,11,193,119,59,21,2,22,230, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelEcefCovGnss0, Test) { + uint8_t encoded_frame[] = { + 85, 53, 2, 0, 16, 42, 224, 229, 233, 29, 253, 255, 255, + 255, 1, 0, 0, 0, 4, 0, 0, 0, 46, 224, 32, 59, + 32, 214, 14, 59, 150, 147, 220, 186, 19, 63, 138, 59, 26, + 150, 35, 187, 11, 193, 119, 59, 21, 2, 22, 230, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_cov_gnss_t* test_msg = ( msg_vel_ecef_cov_gnss_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cov_x_x = 0.0024547684006392956; - test_msg->cov_x_y = 0.0021795108914375305; - test_msg->cov_x_z = -0.0016828652005642653; - test_msg->cov_y_y = 0.004218944814056158; - test_msg->cov_y_z = -0.0024961293675005436; - test_msg->cov_z_z = 0.0037804271560162306; - test_msg->flags = 2; - test_msg->n_sats = 21; - test_msg->tow = 501868000; - test_msg->x = -3; - test_msg->y = 1; - test_msg->z = 4; - - EXPECT_EQ(send_message( 0x235, 4096, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_cov_gnss_t *test_msg = + (msg_vel_ecef_cov_gnss_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cov_x_x = 0.0024547684006392956; + test_msg->cov_x_y = 0.0021795108914375305; + test_msg->cov_x_z = -0.0016828652005642653; + test_msg->cov_y_y = 0.004218944814056158; + test_msg->cov_y_z = -0.0024961293675005436; + test_msg->cov_z_z = 0.0037804271560162306; + test_msg->flags = 2; + test_msg->n_sats = 21; + test_msg->tow = 501868000; + test_msg->x = -3; + test_msg->y = 1; + test_msg->z = 4; + + EXPECT_EQ(send_message(0x235, 4096, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cov_x_x*100 - 0.00245476840064*100), 0.05) << "incorrect value for cov_x_x, expected 0.00245476840064, is " << last_msg_->cov_x_x; - EXPECT_LT((last_msg_->cov_x_y*100 - 0.00217951089144*100), 0.05) << "incorrect value for cov_x_y, expected 0.00217951089144, is " << last_msg_->cov_x_y; - EXPECT_LT((last_msg_->cov_x_z*100 - -0.00168286520056*100), 0.05) << "incorrect value for cov_x_z, expected -0.00168286520056, is " << last_msg_->cov_x_z; - EXPECT_LT((last_msg_->cov_y_y*100 - 0.00421894481406*100), 0.05) << "incorrect value for cov_y_y, expected 0.00421894481406, is " << last_msg_->cov_y_y; - EXPECT_LT((last_msg_->cov_y_z*100 - -0.0024961293675*100), 0.05) << "incorrect value for cov_y_z, expected -0.0024961293675, is " << last_msg_->cov_y_z; - EXPECT_LT((last_msg_->cov_z_z*100 - 0.00378042715602*100), 0.05) << "incorrect value for cov_z_z, expected 0.00378042715602, is " << last_msg_->cov_z_z; - EXPECT_EQ(last_msg_->flags, 2) << "incorrect value for flags, expected 2, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 21) << "incorrect value for n_sats, expected 21, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 501868000) << "incorrect value for tow, expected 501868000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -3) << "incorrect value for x, expected -3, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, 1) << "incorrect value for y, expected 1, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 4) << "incorrect value for z, expected 4, is " << last_msg_->z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cov_x_x * 100 - 0.00245476840064 * 100), 0.05) + << "incorrect value for cov_x_x, expected 0.00245476840064, is " + << last_msg_->cov_x_x; + EXPECT_LT((last_msg_->cov_x_y * 100 - 0.00217951089144 * 100), 0.05) + << "incorrect value for cov_x_y, expected 0.00217951089144, is " + << last_msg_->cov_x_y; + EXPECT_LT((last_msg_->cov_x_z * 100 - -0.00168286520056 * 100), 0.05) + << "incorrect value for cov_x_z, expected -0.00168286520056, is " + << last_msg_->cov_x_z; + EXPECT_LT((last_msg_->cov_y_y * 100 - 0.00421894481406 * 100), 0.05) + << "incorrect value for cov_y_y, expected 0.00421894481406, is " + << last_msg_->cov_y_y; + EXPECT_LT((last_msg_->cov_y_z * 100 - -0.0024961293675 * 100), 0.05) + << "incorrect value for cov_y_z, expected -0.0024961293675, is " + << last_msg_->cov_y_z; + EXPECT_LT((last_msg_->cov_z_z * 100 - 0.00378042715602 * 100), 0.05) + << "incorrect value for cov_z_z, expected 0.00378042715602, is " + << last_msg_->cov_z_z; + EXPECT_EQ(last_msg_->flags, 2) + << "incorrect value for flags, expected 2, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 21) + << "incorrect value for n_sats, expected 21, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 501868000) + << "incorrect value for tow, expected 501868000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -3) + << "incorrect value for x, expected -3, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, 1) + << "incorrect value for y, expected 1, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 4) + << "incorrect value for z, expected 4, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelEcefGnss.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelEcefGnss.cc index 5cd96257c..50d000ba9 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelEcefGnss.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelEcefGnss.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelEcefGnss.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgVelEcefGnss0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelEcefGnss0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelEcefGnss0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelEcefGnss0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ecef_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ecef_gnss_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,47 +81,56 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelEcefGnss0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ecef_gnss_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelEcefGnss0, Test) -{ +}; - uint8_t encoded_frame[] = {85,45,2,0,16,20,224,229,233,29,253,255,255,255,1,0,0,0,4,0,0,0,89,0,21,2,205,16, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelEcefGnss0, Test) { + uint8_t encoded_frame[] = { + 85, 45, 2, 0, 16, 20, 224, 229, 233, 29, 253, 255, 255, 255, + 1, 0, 0, 0, 4, 0, 0, 0, 89, 0, 21, 2, 205, 16, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ecef_gnss_t* test_msg = ( msg_vel_ecef_gnss_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->accuracy = 89; - test_msg->flags = 2; - test_msg->n_sats = 21; - test_msg->tow = 501868000; - test_msg->x = -3; - test_msg->y = 1; - test_msg->z = 4; - - EXPECT_EQ(send_message( 0x22d, 4096, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ecef_gnss_t *test_msg = (msg_vel_ecef_gnss_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->accuracy = 89; + test_msg->flags = 2; + test_msg->n_sats = 21; + test_msg->tow = 501868000; + test_msg->x = -3; + test_msg->y = 1; + test_msg->z = 4; + + EXPECT_EQ(send_message(0x22d, 4096, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->accuracy, 89) << "incorrect value for accuracy, expected 89, is " << last_msg_->accuracy; - EXPECT_EQ(last_msg_->flags, 2) << "incorrect value for flags, expected 2, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_sats, 21) << "incorrect value for n_sats, expected 21, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 501868000) << "incorrect value for tow, expected 501868000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, -3) << "incorrect value for x, expected -3, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, 1) << "incorrect value for y, expected 1, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 4) << "incorrect value for z, expected 4, is " << last_msg_->z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->accuracy, 89) + << "incorrect value for accuracy, expected 89, is " + << last_msg_->accuracy; + EXPECT_EQ(last_msg_->flags, 2) + << "incorrect value for flags, expected 2, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_sats, 21) + << "incorrect value for n_sats, expected 21, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 501868000) + << "incorrect value for tow, expected 501868000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, -3) + << "incorrect value for x, expected -3, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, 1) + << "incorrect value for y, expected 1, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 4) + << "incorrect value for z, expected 4, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNED.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNED.cc index 58db9cc20..5f97d09b4 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNED.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNED.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNED.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNED.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgVelNED0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNED0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNED0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNED0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,100 +81,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNED0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNED0, Test) -{ - - uint8_t encoded_frame[] = {85,14,2,211,136,22,40,244,122,19,3,0,0,0,252,255,255,255,243,255,255,255,0,0,0,0,14,0,86,209, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_t* test_msg = ( msg_vel_ned_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -13; - test_msg->e = -4; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = 3; - test_msg->n_sats = 14; - test_msg->tow = 326825000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x20e, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -13) << "incorrect value for d, expected -13, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -4) << "incorrect value for e, expected -4, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, 3) << "incorrect value for n, expected 3, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 14) << "incorrect value for n_sats, expected 14, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326825000) << "incorrect value for tow, expected 326825000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNED0, Test) { + uint8_t encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 40, 244, 122, 19, 3, 0, 0, 0, 252, + 255, 255, 255, 243, 255, 255, 255, 0, 0, 0, 0, 14, 0, 86, 209, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_t *test_msg = (msg_vel_ned_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -13; + test_msg->e = -4; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = 3; + test_msg->n_sats = 14; + test_msg->tow = 326825000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x20e, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -13) + << "incorrect value for d, expected -13, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -4) + << "incorrect value for e, expected -4, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, 3) + << "incorrect value for n, expected 3, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 14) + << "incorrect value for n_sats, expected 14, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326825000) + << "incorrect value for tow, expected 326825000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelNED1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNED1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNED1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNED1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -188,100 +189,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNED1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNED1, Test) -{ - - uint8_t encoded_frame[] = {85,14,2,211,136,22,28,246,122,19,252,255,255,255,255,255,255,255,232,255,255,255,0,0,0,0,15,0,16,228, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_t* test_msg = ( msg_vel_ned_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -24; - test_msg->e = -1; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = -4; - test_msg->n_sats = 15; - test_msg->tow = 326825500; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x20e, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -24) << "incorrect value for d, expected -24, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -1) << "incorrect value for e, expected -1, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -4) << "incorrect value for n, expected -4, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326825500) << "incorrect value for tow, expected 326825500, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNED1, Test) { + uint8_t encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 28, 246, 122, 19, 252, 255, 255, 255, 255, + 255, 255, 255, 232, 255, 255, 255, 0, 0, 0, 0, 15, 0, 16, 228, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_t *test_msg = (msg_vel_ned_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -24; + test_msg->e = -1; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = -4; + test_msg->n_sats = 15; + test_msg->tow = 326825500; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x20e, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -24) + << "incorrect value for d, expected -24, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -1) + << "incorrect value for e, expected -1, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -4) + << "incorrect value for n, expected -4, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326825500) + << "incorrect value for tow, expected 326825500, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelNED2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNED2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNED2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNED2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -291,100 +297,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNED2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNED2, Test) -{ - - uint8_t encoded_frame[] = {85,14,2,211,136,22,16,248,122,19,0,0,0,0,253,255,255,255,244,255,255,255,0,0,0,0,15,0,11,164, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_t* test_msg = ( msg_vel_ned_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -12; - test_msg->e = -3; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = 0; - test_msg->n_sats = 15; - test_msg->tow = 326826000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x20e, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -12) << "incorrect value for d, expected -12, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -3) << "incorrect value for e, expected -3, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, 0) << "incorrect value for n, expected 0, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326826000) << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNED2, Test) { + uint8_t encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 16, 248, 122, 19, 0, 0, 0, 0, 253, + 255, 255, 255, 244, 255, 255, 255, 0, 0, 0, 0, 15, 0, 11, 164, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_t *test_msg = (msg_vel_ned_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -12; + test_msg->e = -3; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = 0; + test_msg->n_sats = 15; + test_msg->tow = 326826000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x20e, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -12) + << "incorrect value for d, expected -12, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -3) + << "incorrect value for e, expected -3, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, 0) + << "incorrect value for n, expected 0, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326826000) + << "incorrect value for tow, expected 326826000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelNED3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNED3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNED3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNED3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -394,100 +405,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNED3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNED3, Test) -{ - - uint8_t encoded_frame[] = {85,14,2,211,136,22,4,250,122,19,2,0,0,0,3,0,0,0,232,255,255,255,0,0,0,0,15,0,152,208, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_t* test_msg = ( msg_vel_ned_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -24; - test_msg->e = 3; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = 2; - test_msg->n_sats = 15; - test_msg->tow = 326826500; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x20e, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -24) << "incorrect value for d, expected -24, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 3) << "incorrect value for e, expected 3, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, 2) << "incorrect value for n, expected 2, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326826500) << "incorrect value for tow, expected 326826500, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNED3, Test) { + uint8_t encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 4, 250, 122, 19, 2, 0, 0, 0, 3, + 0, 0, 0, 232, 255, 255, 255, 0, 0, 0, 0, 15, 0, 152, 208, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_t *test_msg = (msg_vel_ned_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -24; + test_msg->e = 3; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = 2; + test_msg->n_sats = 15; + test_msg->tow = 326826500; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x20e, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -24) + << "incorrect value for d, expected -24, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 3) + << "incorrect value for e, expected 3, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, 2) + << "incorrect value for n, expected 2, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326826500) + << "incorrect value for tow, expected 326826500, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelNED4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNED4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNED4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNED4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -497,49 +513,60 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNED4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNED4, Test) -{ - - uint8_t encoded_frame[] = {85,14,2,211,136,22,248,251,122,19,1,0,0,0,0,0,0,0,235,255,255,255,0,0,0,0,15,0,182,120, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_t* test_msg = ( msg_vel_ned_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -21; - test_msg->e = 0; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = 1; - test_msg->n_sats = 15; - test_msg->tow = 326827000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x20e, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -21) << "incorrect value for d, expected -21, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 0) << "incorrect value for e, expected 0, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, 1) << "incorrect value for n, expected 1, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 15) << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 326827000) << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNED4, Test) { + uint8_t encoded_frame[] = { + 85, 14, 2, 211, 136, 22, 248, 251, 122, 19, 1, 0, 0, 0, 0, + 0, 0, 0, 235, 255, 255, 255, 0, 0, 0, 0, 15, 0, 182, 120, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_t *test_msg = (msg_vel_ned_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -21; + test_msg->e = 0; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = 1; + test_msg->n_sats = 15; + test_msg->tow = 326827000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x20e, 35027, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -21) + << "incorrect value for d, expected -21, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 0) + << "incorrect value for e, expected 0, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, 1) + << "incorrect value for n, expected 1, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 15) + << "incorrect value for n_sats, expected 15, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 326827000) + << "incorrect value for tow, expected 326827000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNEDCOV.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNEDCOV.cc index ea575af05..c8350aca6 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNEDCOV.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNEDCOV.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDCOV.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDCOV.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgVelNEDCOV0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNEDCOV0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNEDCOV0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNEDCOV0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_cov_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_cov_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,57 +81,71 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNEDCOV0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_cov_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDCOV0, Test) -{ +}; - uint8_t encoded_frame[] = {85,18,2,66,0,42,100,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,0,0,128,63,10,0,88,205, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDCOV0, Test) { + uint8_t encoded_frame[] = { + 85, 18, 2, 66, 0, 42, 100, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, 10, 0, 88, 205, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_cov_t* test_msg = ( msg_vel_ned_cov_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cov_d_d = 1.0; - test_msg->cov_e_d = 1.0; - test_msg->cov_e_e = 1.0; - test_msg->cov_n_d = 1.0; - test_msg->cov_n_e = 1.0; - test_msg->cov_n_n = 1.0; - test_msg->d = 1; - test_msg->e = 1; - test_msg->flags = 0; - test_msg->n = 1; - test_msg->n_sats = 10; - test_msg->tow = 100; - - EXPECT_EQ(send_message( 0x212, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_cov_t *test_msg = (msg_vel_ned_cov_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cov_d_d = 1.0; + test_msg->cov_e_d = 1.0; + test_msg->cov_e_e = 1.0; + test_msg->cov_n_d = 1.0; + test_msg->cov_n_e = 1.0; + test_msg->cov_n_n = 1.0; + test_msg->d = 1; + test_msg->e = 1; + test_msg->flags = 0; + test_msg->n = 1; + test_msg->n_sats = 10; + test_msg->tow = 100; + + EXPECT_EQ(send_message(0x212, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cov_d_d*100 - 1.0*100), 0.05) << "incorrect value for cov_d_d, expected 1.0, is " << last_msg_->cov_d_d; - EXPECT_LT((last_msg_->cov_e_d*100 - 1.0*100), 0.05) << "incorrect value for cov_e_d, expected 1.0, is " << last_msg_->cov_e_d; - EXPECT_LT((last_msg_->cov_e_e*100 - 1.0*100), 0.05) << "incorrect value for cov_e_e, expected 1.0, is " << last_msg_->cov_e_e; - EXPECT_LT((last_msg_->cov_n_d*100 - 1.0*100), 0.05) << "incorrect value for cov_n_d, expected 1.0, is " << last_msg_->cov_n_d; - EXPECT_LT((last_msg_->cov_n_e*100 - 1.0*100), 0.05) << "incorrect value for cov_n_e, expected 1.0, is " << last_msg_->cov_n_e; - EXPECT_LT((last_msg_->cov_n_n*100 - 1.0*100), 0.05) << "incorrect value for cov_n_n, expected 1.0, is " << last_msg_->cov_n_n; - EXPECT_EQ(last_msg_->d, 1) << "incorrect value for d, expected 1, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 1) << "incorrect value for e, expected 1, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n, 1) << "incorrect value for n, expected 1, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 10) << "incorrect value for n_sats, expected 10, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 100) << "incorrect value for tow, expected 100, is " << last_msg_->tow; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cov_d_d * 100 - 1.0 * 100), 0.05) + << "incorrect value for cov_d_d, expected 1.0, is " << last_msg_->cov_d_d; + EXPECT_LT((last_msg_->cov_e_d * 100 - 1.0 * 100), 0.05) + << "incorrect value for cov_e_d, expected 1.0, is " << last_msg_->cov_e_d; + EXPECT_LT((last_msg_->cov_e_e * 100 - 1.0 * 100), 0.05) + << "incorrect value for cov_e_e, expected 1.0, is " << last_msg_->cov_e_e; + EXPECT_LT((last_msg_->cov_n_d * 100 - 1.0 * 100), 0.05) + << "incorrect value for cov_n_d, expected 1.0, is " << last_msg_->cov_n_d; + EXPECT_LT((last_msg_->cov_n_e * 100 - 1.0 * 100), 0.05) + << "incorrect value for cov_n_e, expected 1.0, is " << last_msg_->cov_n_e; + EXPECT_LT((last_msg_->cov_n_n * 100 - 1.0 * 100), 0.05) + << "incorrect value for cov_n_n, expected 1.0, is " << last_msg_->cov_n_n; + EXPECT_EQ(last_msg_->d, 1) + << "incorrect value for d, expected 1, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 1) + << "incorrect value for e, expected 1, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n, 1) + << "incorrect value for n, expected 1, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 10) + << "incorrect value for n_sats, expected 10, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 100) + << "incorrect value for tow, expected 100, is " << last_msg_->tow; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNEDDepA.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNEDDepA.cc index 5229d6c8f..336dff9b2 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNEDDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNEDDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNEDDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,100 +81,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,246,215,22,20,46,39,0,198,251,255,255,156,15,0,0,0,0,0,0,0,0,0,0,9,0,161,92, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 0; - test_msg->e = 3996; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = -1082; - test_msg->n_sats = 9; - test_msg->tow = 2567700; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x205, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 0) << "incorrect value for d, expected 0, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 3996) << "incorrect value for e, expected 3996, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -1082) << "incorrect value for n, expected -1082, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567700) << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 20, 46, 39, 0, 198, 251, 255, 255, 156, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 161, 92, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_dep_a_t *test_msg = (msg_vel_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 0; + test_msg->e = 3996; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = -1082; + test_msg->n_sats = 9; + test_msg->tow = 2567700; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x205, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 0) + << "incorrect value for d, expected 0, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 3996) + << "incorrect value for e, expected 3996, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -1082) + << "incorrect value for n, expected -1082, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567700) + << "incorrect value for tow, expected 2567700, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -188,100 +189,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,246,215,22,120,46,39,0,14,252,255,255,207,14,0,0,0,0,0,0,0,0,0,0,9,0,125,160, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 0; - test_msg->e = 3791; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = -1010; - test_msg->n_sats = 9; - test_msg->tow = 2567800; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x205, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 0) << "incorrect value for d, expected 0, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 3791) << "incorrect value for e, expected 3791, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -1010) << "incorrect value for n, expected -1010, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567800) << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 120, 46, 39, 0, 14, 252, 255, 255, 207, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 125, 160, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_dep_a_t *test_msg = (msg_vel_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 0; + test_msg->e = 3791; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = -1010; + test_msg->n_sats = 9; + test_msg->tow = 2567800; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x205, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 0) + << "incorrect value for d, expected 0, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 3791) + << "incorrect value for e, expected 3791, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -1010) + << "incorrect value for n, expected -1010, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567800) + << "incorrect value for tow, expected 2567800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -291,100 +297,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,246,215,22,220,46,39,0,48,252,255,255,140,14,0,0,0,0,0,0,0,0,0,0,9,0,179,135, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 0; - test_msg->e = 3724; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = -976; - test_msg->n_sats = 9; - test_msg->tow = 2567900; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x205, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 0) << "incorrect value for d, expected 0, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 3724) << "incorrect value for e, expected 3724, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -976) << "incorrect value for n, expected -976, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2567900) << "incorrect value for tow, expected 2567900, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 220, 46, 39, 0, 48, 252, 255, 255, 140, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 179, 135, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_dep_a_t *test_msg = (msg_vel_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 0; + test_msg->e = 3724; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = -976; + test_msg->n_sats = 9; + test_msg->tow = 2567900; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x205, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 0) + << "incorrect value for d, expected 0, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 3724) + << "incorrect value for e, expected 3724, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -976) + << "incorrect value for n, expected -976, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2567900) + << "incorrect value for tow, expected 2567900, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -394,100 +405,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,246,215,22,64,47,39,0,32,252,255,255,8,15,0,0,0,0,0,0,0,0,0,0,9,0,51,177, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 0; - test_msg->e = 3848; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = -992; - test_msg->n_sats = 9; - test_msg->tow = 2568000; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x205, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 0) << "incorrect value for d, expected 0, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 3848) << "incorrect value for e, expected 3848, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -992) << "incorrect value for n, expected -992, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2568000) << "incorrect value for tow, expected 2568000, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 64, 47, 39, 0, 32, 252, 255, 255, 8, + 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 51, 177, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_dep_a_t *test_msg = (msg_vel_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 0; + test_msg->e = 3848; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = -992; + test_msg->n_sats = 9; + test_msg->tow = 2568000; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x205, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 0) + << "incorrect value for d, expected 0, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 3848) + << "incorrect value for e, expected 3848, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -992) + << "incorrect value for n, expected -992, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2568000) + << "incorrect value for tow, expected 2568000, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -497,100 +513,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,246,215,22,164,47,39,0,80,252,255,255,140,14,0,0,0,0,0,0,0,0,0,0,9,0,23,0, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 0; - test_msg->e = 3724; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = -944; - test_msg->n_sats = 9; - test_msg->tow = 2568100; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x205, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 0) << "incorrect value for d, expected 0, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 3724) << "incorrect value for e, expected 3724, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -944) << "incorrect value for n, expected -944, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 9) << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 2568100) << "incorrect value for tow, expected 2568100, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 246, 215, 22, 164, 47, 39, 0, 80, 252, 255, 255, 140, + 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 23, 0, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_dep_a_t *test_msg = (msg_vel_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 0; + test_msg->e = 3724; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = -944; + test_msg->n_sats = 9; + test_msg->tow = 2568100; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x205, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 0) + << "incorrect value for d, expected 0, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 3724) + << "incorrect value for e, expected 3724, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -944) + << "incorrect value for n, expected -944, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 9) + << "incorrect value for n_sats, expected 9, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 2568100) + << "incorrect value for tow, expected 2568100, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -600,100 +621,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,195,4,22,212,157,67,24,229,255,255,255,26,0,0,0,25,0,0,0,0,0,0,0,8,0,132,25, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 25; - test_msg->e = 26; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = -27; - test_msg->n_sats = 8; - test_msg->tow = 407084500; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x205, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 25) << "incorrect value for d, expected 25, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 26) << "incorrect value for e, expected 26, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -27) << "incorrect value for n, expected -27, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084500) << "incorrect value for tow, expected 407084500, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 212, 157, 67, 24, 229, 255, 255, 255, 26, + 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 8, 0, 132, 25, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_dep_a_t *test_msg = (msg_vel_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 25; + test_msg->e = 26; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = -27; + test_msg->n_sats = 8; + test_msg->tow = 407084500; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x205, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 25) + << "incorrect value for d, expected 25, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 26) + << "incorrect value for e, expected 26, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -27) + << "incorrect value for n, expected -27, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084500) + << "incorrect value for tow, expected 407084500, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA6 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA6() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA6 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA6() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -703,100 +729,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA6 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA6, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,195,4,22,56,158,67,24,4,0,0,0,15,0,0,0,232,255,255,255,0,0,0,0,8,0,42,14, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -24; - test_msg->e = 15; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = 4; - test_msg->n_sats = 8; - test_msg->tow = 407084600; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x205, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -24) << "incorrect value for d, expected -24, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 15) << "incorrect value for e, expected 15, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, 4) << "incorrect value for n, expected 4, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084600) << "incorrect value for tow, expected 407084600, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA6, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 56, 158, 67, 24, 4, 0, 0, 0, 15, + 0, 0, 0, 232, 255, 255, 255, 0, 0, 0, 0, 8, 0, 42, 14, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_dep_a_t *test_msg = (msg_vel_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -24; + test_msg->e = 15; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = 4; + test_msg->n_sats = 8; + test_msg->tow = 407084600; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x205, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -24) + << "incorrect value for d, expected -24, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 15) + << "incorrect value for e, expected 15, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, 4) + << "incorrect value for n, expected 4, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084600) + << "incorrect value for tow, expected 407084600, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA7 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA7() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA7 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA7() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -806,100 +837,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA7 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA7, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,195,4,22,156,158,67,24,251,255,255,255,232,255,255,255,247,255,255,255,0,0,0,0,8,0,218,148, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -9; - test_msg->e = -24; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = -5; - test_msg->n_sats = 8; - test_msg->tow = 407084700; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x205, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -9) << "incorrect value for d, expected -9, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -24) << "incorrect value for e, expected -24, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -5) << "incorrect value for n, expected -5, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084700) << "incorrect value for tow, expected 407084700, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA7, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 156, 158, 67, 24, 251, 255, 255, 255, 232, + 255, 255, 255, 247, 255, 255, 255, 0, 0, 0, 0, 8, 0, 218, 148, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_dep_a_t *test_msg = (msg_vel_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -9; + test_msg->e = -24; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = -5; + test_msg->n_sats = 8; + test_msg->tow = 407084700; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x205, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -9) + << "incorrect value for d, expected -9, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -24) + << "incorrect value for e, expected -24, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -5) + << "incorrect value for n, expected -5, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084700) + << "incorrect value for tow, expected 407084700, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA8 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA8() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA8 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA8() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -909,100 +945,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA8 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA8, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,195,4,22,0,159,67,24,10,0,0,0,2,0,0,0,222,255,255,255,0,0,0,0,8,0,148,16, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -34; - test_msg->e = 2; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = 10; - test_msg->n_sats = 8; - test_msg->tow = 407084800; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x205, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -34) << "incorrect value for d, expected -34, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 2) << "incorrect value for e, expected 2, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, 10) << "incorrect value for n, expected 10, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084800) << "incorrect value for tow, expected 407084800, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA8, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 0, 159, 67, 24, 10, 0, 0, 0, 2, + 0, 0, 0, 222, 255, 255, 255, 0, 0, 0, 0, 8, 0, 148, 16, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_dep_a_t *test_msg = (msg_vel_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -34; + test_msg->e = 2; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = 10; + test_msg->n_sats = 8; + test_msg->tow = 407084800; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x205, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -34) + << "incorrect value for d, expected -34, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 2) + << "incorrect value for e, expected 2, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, 10) + << "incorrect value for n, expected 10, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084800) + << "incorrect value for tow, expected 407084800, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA9 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA9() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA9 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA9() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -1012,100 +1053,105 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA9 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA9, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,195,4,22,100,159,67,24,248,255,255,255,254,255,255,255,7,0,0,0,0,0,0,0,8,0,255,236, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = 7; - test_msg->e = -2; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = -8; - test_msg->n_sats = 8; - test_msg->tow = 407084900; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x205, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, 7) << "incorrect value for d, expected 7, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -2) << "incorrect value for e, expected -2, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -8) << "incorrect value for n, expected -8, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 8) << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407084900) << "incorrect value for tow, expected 407084900, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA9, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 100, 159, 67, 24, 248, 255, 255, 255, 254, + 255, 255, 255, 7, 0, 0, 0, 0, 0, 0, 0, 8, 0, 255, 236, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_dep_a_t *test_msg = (msg_vel_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = 7; + test_msg->e = -2; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = -8; + test_msg->n_sats = 8; + test_msg->tow = 407084900; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x205, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, 7) + << "incorrect value for d, expected 7, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -2) + << "incorrect value for e, expected -2, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -8) + << "incorrect value for n, expected -8, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 8) + << "incorrect value for n_sats, expected 8, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407084900) + << "incorrect value for tow, expected 407084900, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } -class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA10 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA10() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA10 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA10() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -1115,49 +1161,60 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA10 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA10, Test) -{ - - uint8_t encoded_frame[] = {85,5,2,195,4,22,46,162,68,24,255,255,255,255,253,255,255,255,148,255,255,255,0,0,0,0,5,0,166,189, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_dep_a_t* test_msg = ( msg_vel_ned_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -108; - test_msg->e = -3; - test_msg->flags = 0; - test_msg->h_accuracy = 0; - test_msg->n = -1; - test_msg->n_sats = 5; - test_msg->tow = 407151150; - test_msg->v_accuracy = 0; - - EXPECT_EQ(send_message( 0x205, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -108) << "incorrect value for d, expected -108, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, -3) << "incorrect value for e, expected -3, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 0) << "incorrect value for h_accuracy, expected 0, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -1) << "incorrect value for n, expected -1, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 5) << "incorrect value for n_sats, expected 5, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 407151150) << "incorrect value for tow, expected 407151150, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 0) << "incorrect value for v_accuracy, expected 0, is " << last_msg_->v_accuracy; +}; + +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNEDDepA10, Test) { + uint8_t encoded_frame[] = { + 85, 5, 2, 195, 4, 22, 46, 162, 68, 24, 255, 255, 255, 255, 253, + 255, 255, 255, 148, 255, 255, 255, 0, 0, 0, 0, 5, 0, 166, 189, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_dep_a_t *test_msg = (msg_vel_ned_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -108; + test_msg->e = -3; + test_msg->flags = 0; + test_msg->h_accuracy = 0; + test_msg->n = -1; + test_msg->n_sats = 5; + test_msg->tow = 407151150; + test_msg->v_accuracy = 0; + + EXPECT_EQ(send_message(0x205, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -108) + << "incorrect value for d, expected -108, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, -3) + << "incorrect value for e, expected -3, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 0) + << "incorrect value for h_accuracy, expected 0, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -1) + << "incorrect value for n, expected -1, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 5) + << "incorrect value for n_sats, expected 5, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 407151150) + << "incorrect value for tow, expected 407151150, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 0) + << "incorrect value for v_accuracy, expected 0, is " + << last_msg_->v_accuracy; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNedCovGnss.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNedCovGnss.cc index 08b57e10f..7fd424fb6 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNedCovGnss.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNedCovGnss.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedCovGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedCovGnss.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_cov_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_cov_gnss_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,57 +82,78 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_cov_gnss_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss0, Test) -{ +}; - uint8_t encoded_frame[] = {85,50,2,0,16,42,168,230,233,29,251,255,255,255,0,0,0,0,246,255,255,255,15,58,207,58,248,139,116,55,103,197,57,57,203,186,129,58,109,171,44,57,135,39,1,60,21,2,155,3, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNedCovGnss0, Test) { + uint8_t encoded_frame[] = { + 85, 50, 2, 0, 16, 42, 168, 230, 233, 29, 251, 255, 255, + 255, 0, 0, 0, 0, 246, 255, 255, 255, 15, 58, 207, 58, + 248, 139, 116, 55, 103, 197, 57, 57, 203, 186, 129, 58, 109, + 171, 44, 57, 135, 39, 1, 60, 21, 2, 155, 3, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_cov_gnss_t* test_msg = ( msg_vel_ned_cov_gnss_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cov_d_d = 0.007882959209382534; - test_msg->cov_e_d = 0.00016467059322167188; - test_msg->cov_e_e = 0.0009897587588056922; - test_msg->cov_n_d = 0.00017716512957122177; - test_msg->cov_n_e = 1.457612233934924e-05; - test_msg->cov_n_n = 0.0015810149488970637; - test_msg->d = -10; - test_msg->e = 0; - test_msg->flags = 2; - test_msg->n = -5; - test_msg->n_sats = 21; - test_msg->tow = 501868200; - - EXPECT_EQ(send_message( 0x232, 4096, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_cov_gnss_t *test_msg = (msg_vel_ned_cov_gnss_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cov_d_d = 0.007882959209382534; + test_msg->cov_e_d = 0.00016467059322167188; + test_msg->cov_e_e = 0.0009897587588056922; + test_msg->cov_n_d = 0.00017716512957122177; + test_msg->cov_n_e = 1.457612233934924e-05; + test_msg->cov_n_n = 0.0015810149488970637; + test_msg->d = -10; + test_msg->e = 0; + test_msg->flags = 2; + test_msg->n = -5; + test_msg->n_sats = 21; + test_msg->tow = 501868200; + + EXPECT_EQ(send_message(0x232, 4096, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->cov_d_d*100 - 0.00788295920938*100), 0.05) << "incorrect value for cov_d_d, expected 0.00788295920938, is " << last_msg_->cov_d_d; - EXPECT_LT((last_msg_->cov_e_d*100 - 0.000164670593222*100), 0.05) << "incorrect value for cov_e_d, expected 0.000164670593222, is " << last_msg_->cov_e_d; - EXPECT_LT((last_msg_->cov_e_e*100 - 0.000989758758806*100), 0.05) << "incorrect value for cov_e_e, expected 0.000989758758806, is " << last_msg_->cov_e_e; - EXPECT_LT((last_msg_->cov_n_d*100 - 0.000177165129571*100), 0.05) << "incorrect value for cov_n_d, expected 0.000177165129571, is " << last_msg_->cov_n_d; - EXPECT_LT((last_msg_->cov_n_e*100 - 1.45761223393e-05*100), 0.05) << "incorrect value for cov_n_e, expected 1.45761223393e-05, is " << last_msg_->cov_n_e; - EXPECT_LT((last_msg_->cov_n_n*100 - 0.0015810149489*100), 0.05) << "incorrect value for cov_n_n, expected 0.0015810149489, is " << last_msg_->cov_n_n; - EXPECT_EQ(last_msg_->d, -10) << "incorrect value for d, expected -10, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 0) << "incorrect value for e, expected 0, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 2) << "incorrect value for flags, expected 2, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n, -5) << "incorrect value for n, expected -5, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 21) << "incorrect value for n_sats, expected 21, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 501868200) << "incorrect value for tow, expected 501868200, is " << last_msg_->tow; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->cov_d_d * 100 - 0.00788295920938 * 100), 0.05) + << "incorrect value for cov_d_d, expected 0.00788295920938, is " + << last_msg_->cov_d_d; + EXPECT_LT((last_msg_->cov_e_d * 100 - 0.000164670593222 * 100), 0.05) + << "incorrect value for cov_e_d, expected 0.000164670593222, is " + << last_msg_->cov_e_d; + EXPECT_LT((last_msg_->cov_e_e * 100 - 0.000989758758806 * 100), 0.05) + << "incorrect value for cov_e_e, expected 0.000989758758806, is " + << last_msg_->cov_e_e; + EXPECT_LT((last_msg_->cov_n_d * 100 - 0.000177165129571 * 100), 0.05) + << "incorrect value for cov_n_d, expected 0.000177165129571, is " + << last_msg_->cov_n_d; + EXPECT_LT((last_msg_->cov_n_e * 100 - 1.45761223393e-05 * 100), 0.05) + << "incorrect value for cov_n_e, expected 1.45761223393e-05, is " + << last_msg_->cov_n_e; + EXPECT_LT((last_msg_->cov_n_n * 100 - 0.0015810149489 * 100), 0.05) + << "incorrect value for cov_n_n, expected 0.0015810149489, is " + << last_msg_->cov_n_n; + EXPECT_EQ(last_msg_->d, -10) + << "incorrect value for d, expected -10, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 0) + << "incorrect value for e, expected 0, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 2) + << "incorrect value for flags, expected 2, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n, -5) + << "incorrect value for n, expected -5, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 21) + << "incorrect value for n_sats, expected 21, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 501868200) + << "incorrect value for tow, expected 501868200, is " << last_msg_->tow; } diff --git a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNedGnss.cc b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNedGnss.cc index 5389a1d0d..5573c2a18 100644 --- a/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNedGnss.cc +++ b/c/test/legacy/cpp/auto_check_sbp_navigation_MsgVelNedGnss.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedGnss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/navigation/test_MsgVelNedGnss.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_navigation_MsgVelNedGnss0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_navigation_MsgVelNedGnss0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_navigation_MsgVelNedGnss0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_navigation_MsgVelNedGnss0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_vel_ned_gnss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_vel_ned_gnss_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,49 +81,60 @@ class Test_legacy_auto_check_sbp_navigation_MsgVelNedGnss0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_vel_ned_gnss_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNedGnss0, Test) -{ +}; - uint8_t encoded_frame[] = {85,46,2,0,16,22,168,230,233,29,251,255,255,255,0,0,0,0,246,255,255,255,40,0,89,0,21,2,99,171, }; +TEST_F(Test_legacy_auto_check_sbp_navigation_MsgVelNedGnss0, Test) { + uint8_t encoded_frame[] = { + 85, 46, 2, 0, 16, 22, 168, 230, 233, 29, 251, 255, 255, 255, 0, + 0, 0, 0, 246, 255, 255, 255, 40, 0, 89, 0, 21, 2, 99, 171, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_vel_ned_gnss_t* test_msg = ( msg_vel_ned_gnss_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->d = -10; - test_msg->e = 0; - test_msg->flags = 2; - test_msg->h_accuracy = 40; - test_msg->n = -5; - test_msg->n_sats = 21; - test_msg->tow = 501868200; - test_msg->v_accuracy = 89; - - EXPECT_EQ(send_message( 0x22e, 4096, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_vel_ned_gnss_t *test_msg = (msg_vel_ned_gnss_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->d = -10; + test_msg->e = 0; + test_msg->flags = 2; + test_msg->h_accuracy = 40; + test_msg->n = -5; + test_msg->n_sats = 21; + test_msg->tow = 501868200; + test_msg->v_accuracy = 89; + + EXPECT_EQ(send_message(0x22e, 4096, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4096); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->d, -10) << "incorrect value for d, expected -10, is " << last_msg_->d; - EXPECT_EQ(last_msg_->e, 0) << "incorrect value for e, expected 0, is " << last_msg_->e; - EXPECT_EQ(last_msg_->flags, 2) << "incorrect value for flags, expected 2, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->h_accuracy, 40) << "incorrect value for h_accuracy, expected 40, is " << last_msg_->h_accuracy; - EXPECT_EQ(last_msg_->n, -5) << "incorrect value for n, expected -5, is " << last_msg_->n; - EXPECT_EQ(last_msg_->n_sats, 21) << "incorrect value for n_sats, expected 21, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 501868200) << "incorrect value for tow, expected 501868200, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->v_accuracy, 89) << "incorrect value for v_accuracy, expected 89, is " << last_msg_->v_accuracy; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4096); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->d, -10) + << "incorrect value for d, expected -10, is " << last_msg_->d; + EXPECT_EQ(last_msg_->e, 0) + << "incorrect value for e, expected 0, is " << last_msg_->e; + EXPECT_EQ(last_msg_->flags, 2) + << "incorrect value for flags, expected 2, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->h_accuracy, 40) + << "incorrect value for h_accuracy, expected 40, is " + << last_msg_->h_accuracy; + EXPECT_EQ(last_msg_->n, -5) + << "incorrect value for n, expected -5, is " << last_msg_->n; + EXPECT_EQ(last_msg_->n_sats, 21) + << "incorrect value for n_sats, expected 21, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 501868200) + << "incorrect value for tow, expected 501868200, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->v_accuracy, 89) + << "incorrect value for v_accuracy, expected 89, is " + << last_msg_->v_accuracy; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ndb_MsgNdbEvent.cc b/c/test/legacy/cpp/auto_check_sbp_ndb_MsgNdbEvent.cc index 846726b9c..c9e1fb0a6 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ndb_MsgNdbEvent.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ndb_MsgNdbEvent.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ndb/test_MsgNdbEvent.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ndb/test_MsgNdbEvent.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ndb_MsgNdbEvent0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ndb_MsgNdbEvent0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ndb_MsgNdbEvent0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ndb_MsgNdbEvent0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ndb_event_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ndb_event_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,53 +81,72 @@ class Test_legacy_auto_check_sbp_ndb_MsgNdbEvent0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ndb_event_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ndb_MsgNdbEvent0, Test) -{ +}; - uint8_t encoded_frame[] = {85,0,4,164,174,18,254,188,70,185,69,0,0,0,249,73,205,115,238,74,98,66,182,148,16,166, }; +TEST_F(Test_legacy_auto_check_sbp_ndb_MsgNdbEvent0, Test) { + uint8_t encoded_frame[] = { + 85, 0, 4, 164, 174, 18, 254, 188, 70, 185, 69, 0, 0, + 0, 249, 73, 205, 115, 238, 74, 98, 66, 182, 148, 16, 166, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ndb_event_t* test_msg = ( msg_ndb_event_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->data_source = 115; - test_msg->event = 249; - test_msg->object_sid.code = 74; - test_msg->object_sid.sat = 238; - test_msg->object_type = 73; - test_msg->original_sender = 38070; - test_msg->recv_time = 299461164286; - test_msg->result = 205; - test_msg->src_sid.code = 66; - test_msg->src_sid.sat = 98; - - EXPECT_EQ(send_message( 0x400, 44708, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ndb_event_t *test_msg = (msg_ndb_event_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->data_source = 115; + test_msg->event = 249; + test_msg->object_sid.code = 74; + test_msg->object_sid.sat = 238; + test_msg->object_type = 73; + test_msg->original_sender = 38070; + test_msg->recv_time = 299461164286; + test_msg->result = 205; + test_msg->src_sid.code = 66; + test_msg->src_sid.sat = 98; + + EXPECT_EQ(send_message(0x400, 44708, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 44708); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->data_source, 115) << "incorrect value for data_source, expected 115, is " << last_msg_->data_source; - EXPECT_EQ(last_msg_->event, 249) << "incorrect value for event, expected 249, is " << last_msg_->event; - EXPECT_EQ(last_msg_->object_sid.code, 74) << "incorrect value for object_sid.code, expected 74, is " << last_msg_->object_sid.code; - EXPECT_EQ(last_msg_->object_sid.sat, 238) << "incorrect value for object_sid.sat, expected 238, is " << last_msg_->object_sid.sat; - EXPECT_EQ(last_msg_->object_type, 73) << "incorrect value for object_type, expected 73, is " << last_msg_->object_type; - EXPECT_EQ(last_msg_->original_sender, 38070) << "incorrect value for original_sender, expected 38070, is " << last_msg_->original_sender; - EXPECT_EQ(last_msg_->recv_time, 299461164286) << "incorrect value for recv_time, expected 299461164286, is " << last_msg_->recv_time; - EXPECT_EQ(last_msg_->result, 205) << "incorrect value for result, expected 205, is " << last_msg_->result; - EXPECT_EQ(last_msg_->src_sid.code, 66) << "incorrect value for src_sid.code, expected 66, is " << last_msg_->src_sid.code; - EXPECT_EQ(last_msg_->src_sid.sat, 98) << "incorrect value for src_sid.sat, expected 98, is " << last_msg_->src_sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 44708); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->data_source, 115) + << "incorrect value for data_source, expected 115, is " + << last_msg_->data_source; + EXPECT_EQ(last_msg_->event, 249) + << "incorrect value for event, expected 249, is " << last_msg_->event; + EXPECT_EQ(last_msg_->object_sid.code, 74) + << "incorrect value for object_sid.code, expected 74, is " + << last_msg_->object_sid.code; + EXPECT_EQ(last_msg_->object_sid.sat, 238) + << "incorrect value for object_sid.sat, expected 238, is " + << last_msg_->object_sid.sat; + EXPECT_EQ(last_msg_->object_type, 73) + << "incorrect value for object_type, expected 73, is " + << last_msg_->object_type; + EXPECT_EQ(last_msg_->original_sender, 38070) + << "incorrect value for original_sender, expected 38070, is " + << last_msg_->original_sender; + EXPECT_EQ(last_msg_->recv_time, 299461164286) + << "incorrect value for recv_time, expected 299461164286, is " + << last_msg_->recv_time; + EXPECT_EQ(last_msg_->result, 205) + << "incorrect value for result, expected 205, is " << last_msg_->result; + EXPECT_EQ(last_msg_->src_sid.code, 66) + << "incorrect value for src_sid.code, expected 66, is " + << last_msg_->src_sid.code; + EXPECT_EQ(last_msg_->src_sid.sat, 98) + << "incorrect value for src_sid.sat, expected 98, is " + << last_msg_->src_sid.sat; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGLO.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGLO.cc index a13b3232c..aa39cb454 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGLO.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGLO.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLO.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLO.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgAlmanacGLO0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgAlmanacGLO0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgAlmanacGLO0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgAlmanacGLO0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_almanac_glo_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_almanac_glo_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,63 +81,96 @@ class Test_legacy_auto_check_sbp_observation_MsgAlmanacGLO0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_almanac_glo_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgAlmanacGLO0, Test) -{ +}; - uint8_t encoded_frame[] = {85,115,0,195,4,78,22,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,155,87, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgAlmanacGLO0, Test) { + uint8_t encoded_frame[] = { + 85, 115, 0, 195, 4, 78, 22, 0, 176, 207, 6, 0, 106, 8, 154, + 153, 153, 153, 153, 153, 1, 64, 64, 56, 0, 0, 1, 0, 142, 41, + 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, 63, 0, + 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, + 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, + 191, 71, 11, 217, 147, 145, 228, 237, 63, 155, 87, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_almanac_glo_t* test_msg = ( msg_almanac_glo_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->common.fit_interval = 14400; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 0; - test_msg->common.sid.sat = 22; - test_msg->common.toa.tow = 446384; - test_msg->common.toa.wn = 2154; - test_msg->common.ura = 2.2; - test_msg->common.valid = 1; - test_msg->epsilon = -0.9893036629599647; - test_msg->i = 5153.550029754639; - test_msg->lambda_na = -0.02200078842114688; - test_msg->omega = 0.9341514480259797; - test_msg->t = -1.8731818448797617; - test_msg->t_dot = -8.903585155774196e-09; - test_msg->t_lambda_na = 0.007072207052260637; - - EXPECT_EQ(send_message( 0x73, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_almanac_glo_t *test_msg = (msg_almanac_glo_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->common.fit_interval = 14400; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 0; + test_msg->common.sid.sat = 22; + test_msg->common.toa.tow = 446384; + test_msg->common.toa.wn = 2154; + test_msg->common.ura = 2.2; + test_msg->common.valid = 1; + test_msg->epsilon = -0.9893036629599647; + test_msg->i = 5153.550029754639; + test_msg->lambda_na = -0.02200078842114688; + test_msg->omega = 0.9341514480259797; + test_msg->t = -1.8731818448797617; + test_msg->t_dot = -8.903585155774196e-09; + test_msg->t_lambda_na = 0.007072207052260637; + + EXPECT_EQ(send_message(0x73, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->common.fit_interval, 14400) << "incorrect value for common.fit_interval, expected 14400, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 0) << "incorrect value for common.sid.code, expected 0, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.sat, 22) << "incorrect value for common.sid.sat, expected 22, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toa.tow, 446384) << "incorrect value for common.toa.tow, expected 446384, is " << last_msg_->common.toa.tow; - EXPECT_EQ(last_msg_->common.toa.wn, 2154) << "incorrect value for common.toa.wn, expected 2154, is " << last_msg_->common.toa.wn; - EXPECT_LT((last_msg_->common.ura*100 - 2.2*100), 0.05) << "incorrect value for common.ura, expected 2.2, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->epsilon*100 - -0.98930366296*100), 0.05) << "incorrect value for epsilon, expected -0.98930366296, is " << last_msg_->epsilon; - EXPECT_LT((last_msg_->i*100 - 5153.55002975*100), 0.05) << "incorrect value for i, expected 5153.55002975, is " << last_msg_->i; - EXPECT_LT((last_msg_->lambda_na*100 - -0.0220007884211*100), 0.05) << "incorrect value for lambda_na, expected -0.0220007884211, is " << last_msg_->lambda_na; - EXPECT_LT((last_msg_->omega*100 - 0.934151448026*100), 0.05) << "incorrect value for omega, expected 0.934151448026, is " << last_msg_->omega; - EXPECT_LT((last_msg_->t*100 - -1.87318184488*100), 0.05) << "incorrect value for t, expected -1.87318184488, is " << last_msg_->t; - EXPECT_LT((last_msg_->t_dot*100 - -8.90358515577e-09*100), 0.05) << "incorrect value for t_dot, expected -8.90358515577e-09, is " << last_msg_->t_dot; - EXPECT_LT((last_msg_->t_lambda_na*100 - 0.00707220705226*100), 0.05) << "incorrect value for t_lambda_na, expected 0.00707220705226, is " << last_msg_->t_lambda_na; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->common.fit_interval, 14400) + << "incorrect value for common.fit_interval, expected 14400, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 0) + << "incorrect value for common.sid.code, expected 0, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.sat, 22) + << "incorrect value for common.sid.sat, expected 22, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toa.tow, 446384) + << "incorrect value for common.toa.tow, expected 446384, is " + << last_msg_->common.toa.tow; + EXPECT_EQ(last_msg_->common.toa.wn, 2154) + << "incorrect value for common.toa.wn, expected 2154, is " + << last_msg_->common.toa.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 2.2 * 100), 0.05) + << "incorrect value for common.ura, expected 2.2, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->epsilon * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for epsilon, expected -0.98930366296, is " + << last_msg_->epsilon; + EXPECT_LT((last_msg_->i * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for i, expected 5153.55002975, is " << last_msg_->i; + EXPECT_LT((last_msg_->lambda_na * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for lambda_na, expected -0.0220007884211, is " + << last_msg_->lambda_na; + EXPECT_LT((last_msg_->omega * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for omega, expected 0.934151448026, is " + << last_msg_->omega; + EXPECT_LT((last_msg_->t * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for t, expected -1.87318184488, is " << last_msg_->t; + EXPECT_LT((last_msg_->t_dot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for t_dot, expected -8.90358515577e-09, is " + << last_msg_->t_dot; + EXPECT_LT((last_msg_->t_lambda_na * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for t_lambda_na, expected 0.00707220705226, is " + << last_msg_->t_lambda_na; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGLODep.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGLODep.cc index 4f3b111a4..ef134b6fe 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGLODep.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGLODep.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLODep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGLODep.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgAlmanacGLODep0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgAlmanacGLODep0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgAlmanacGLODep0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgAlmanacGLODep0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_almanac_glo_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_almanac_glo_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,65 +81,100 @@ class Test_legacy_auto_check_sbp_observation_MsgAlmanacGLODep0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_almanac_glo_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgAlmanacGLODep0, Test) -{ +}; - uint8_t encoded_frame[] = {85,113,0,195,4,80,22,0,0,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,203,178, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgAlmanacGLODep0, Test) { + uint8_t encoded_frame[] = { + 85, 113, 0, 195, 4, 80, 22, 0, 0, 0, 176, 207, 6, 0, 106, + 8, 154, 153, 153, 153, 153, 153, 1, 64, 64, 56, 0, 0, 1, 0, + 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, + 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, + 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, + 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, 203, 178, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_almanac_glo_dep_t* test_msg = ( msg_almanac_glo_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->common.fit_interval = 14400; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 0; - test_msg->common.sid.reserved = 0; - test_msg->common.sid.sat = 22; - test_msg->common.toa.tow = 446384; - test_msg->common.toa.wn = 2154; - test_msg->common.ura = 2.2; - test_msg->common.valid = 1; - test_msg->epsilon = -0.9893036629599647; - test_msg->i = 5153.550029754639; - test_msg->lambda_na = -0.02200078842114688; - test_msg->omega = 0.9341514480259797; - test_msg->t = -1.8731818448797617; - test_msg->t_dot = -8.903585155774196e-09; - test_msg->t_lambda_na = 0.007072207052260637; - - EXPECT_EQ(send_message( 0x71, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_almanac_glo_dep_t *test_msg = (msg_almanac_glo_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->common.fit_interval = 14400; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 0; + test_msg->common.sid.reserved = 0; + test_msg->common.sid.sat = 22; + test_msg->common.toa.tow = 446384; + test_msg->common.toa.wn = 2154; + test_msg->common.ura = 2.2; + test_msg->common.valid = 1; + test_msg->epsilon = -0.9893036629599647; + test_msg->i = 5153.550029754639; + test_msg->lambda_na = -0.02200078842114688; + test_msg->omega = 0.9341514480259797; + test_msg->t = -1.8731818448797617; + test_msg->t_dot = -8.903585155774196e-09; + test_msg->t_lambda_na = 0.007072207052260637; + + EXPECT_EQ(send_message(0x71, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->common.fit_interval, 14400) << "incorrect value for common.fit_interval, expected 14400, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 0) << "incorrect value for common.sid.code, expected 0, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.reserved, 0) << "incorrect value for common.sid.reserved, expected 0, is " << last_msg_->common.sid.reserved; - EXPECT_EQ(last_msg_->common.sid.sat, 22) << "incorrect value for common.sid.sat, expected 22, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toa.tow, 446384) << "incorrect value for common.toa.tow, expected 446384, is " << last_msg_->common.toa.tow; - EXPECT_EQ(last_msg_->common.toa.wn, 2154) << "incorrect value for common.toa.wn, expected 2154, is " << last_msg_->common.toa.wn; - EXPECT_LT((last_msg_->common.ura*100 - 2.2*100), 0.05) << "incorrect value for common.ura, expected 2.2, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->epsilon*100 - -0.98930366296*100), 0.05) << "incorrect value for epsilon, expected -0.98930366296, is " << last_msg_->epsilon; - EXPECT_LT((last_msg_->i*100 - 5153.55002975*100), 0.05) << "incorrect value for i, expected 5153.55002975, is " << last_msg_->i; - EXPECT_LT((last_msg_->lambda_na*100 - -0.0220007884211*100), 0.05) << "incorrect value for lambda_na, expected -0.0220007884211, is " << last_msg_->lambda_na; - EXPECT_LT((last_msg_->omega*100 - 0.934151448026*100), 0.05) << "incorrect value for omega, expected 0.934151448026, is " << last_msg_->omega; - EXPECT_LT((last_msg_->t*100 - -1.87318184488*100), 0.05) << "incorrect value for t, expected -1.87318184488, is " << last_msg_->t; - EXPECT_LT((last_msg_->t_dot*100 - -8.90358515577e-09*100), 0.05) << "incorrect value for t_dot, expected -8.90358515577e-09, is " << last_msg_->t_dot; - EXPECT_LT((last_msg_->t_lambda_na*100 - 0.00707220705226*100), 0.05) << "incorrect value for t_lambda_na, expected 0.00707220705226, is " << last_msg_->t_lambda_na; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->common.fit_interval, 14400) + << "incorrect value for common.fit_interval, expected 14400, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 0) + << "incorrect value for common.sid.code, expected 0, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.reserved, 0) + << "incorrect value for common.sid.reserved, expected 0, is " + << last_msg_->common.sid.reserved; + EXPECT_EQ(last_msg_->common.sid.sat, 22) + << "incorrect value for common.sid.sat, expected 22, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toa.tow, 446384) + << "incorrect value for common.toa.tow, expected 446384, is " + << last_msg_->common.toa.tow; + EXPECT_EQ(last_msg_->common.toa.wn, 2154) + << "incorrect value for common.toa.wn, expected 2154, is " + << last_msg_->common.toa.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 2.2 * 100), 0.05) + << "incorrect value for common.ura, expected 2.2, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->epsilon * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for epsilon, expected -0.98930366296, is " + << last_msg_->epsilon; + EXPECT_LT((last_msg_->i * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for i, expected 5153.55002975, is " << last_msg_->i; + EXPECT_LT((last_msg_->lambda_na * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for lambda_na, expected -0.0220007884211, is " + << last_msg_->lambda_na; + EXPECT_LT((last_msg_->omega * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for omega, expected 0.934151448026, is " + << last_msg_->omega; + EXPECT_LT((last_msg_->t * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for t, expected -1.87318184488, is " << last_msg_->t; + EXPECT_LT((last_msg_->t_dot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for t_dot, expected -8.90358515577e-09, is " + << last_msg_->t_dot; + EXPECT_LT((last_msg_->t_lambda_na * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for t_lambda_na, expected 0.00707220705226, is " + << last_msg_->t_lambda_na; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGPS.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGPS.cc index 48eff13a1..17b381185 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGPS.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGPS.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPS.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgAlmanacGPS0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgAlmanacGPS0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgAlmanacGPS0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgAlmanacGPS0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_almanac_gps_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_almanac_gps_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,67 +81,106 @@ class Test_legacy_auto_check_sbp_observation_MsgAlmanacGPS0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_almanac_gps_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgAlmanacGPS0, Test) -{ +}; - uint8_t encoded_frame[] = {85,114,0,195,4,94,22,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,190,45, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgAlmanacGPS0, Test) { + uint8_t encoded_frame[] = { + 85, 114, 0, 195, 4, 94, 22, 0, 176, 207, 6, 0, 106, 8, 154, + 153, 153, 153, 153, 153, 1, 64, 64, 56, 0, 0, 1, 0, 142, 41, + 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, 63, 0, + 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, + 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, + 191, 71, 11, 217, 147, 145, 228, 237, 63, 0, 0, 0, 0, 108, 177, + 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 190, 45, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_almanac_gps_t* test_msg = ( msg_almanac_gps_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = -0.0006315018981695175; - test_msg->af1 = 8.981260180007666e-12; - test_msg->common.fit_interval = 14400; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 0; - test_msg->common.sid.sat = 22; - test_msg->common.toa.tow = 446384; - test_msg->common.toa.wn = 2154; - test_msg->common.ura = 2.2; - test_msg->common.valid = 1; - test_msg->ecc = 0.007072207052260637; - test_msg->inc = 0.9341514480259797; - test_msg->m0 = -0.02200078842114688; - test_msg->omega0 = -1.8731818448797617; - test_msg->omegadot = -8.903585155774196e-09; - test_msg->sqrta = 5153.550029754639; - test_msg->w = -0.9893036629599647; - - EXPECT_EQ(send_message( 0x72, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_almanac_gps_t *test_msg = (msg_almanac_gps_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = -0.0006315018981695175; + test_msg->af1 = 8.981260180007666e-12; + test_msg->common.fit_interval = 14400; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 0; + test_msg->common.sid.sat = 22; + test_msg->common.toa.tow = 446384; + test_msg->common.toa.wn = 2154; + test_msg->common.ura = 2.2; + test_msg->common.valid = 1; + test_msg->ecc = 0.007072207052260637; + test_msg->inc = 0.9341514480259797; + test_msg->m0 = -0.02200078842114688; + test_msg->omega0 = -1.8731818448797617; + test_msg->omegadot = -8.903585155774196e-09; + test_msg->sqrta = 5153.550029754639; + test_msg->w = -0.9893036629599647; + + EXPECT_EQ(send_message(0x72, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - -0.00063150189817*100), 0.05) << "incorrect value for af0, expected -0.00063150189817, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - 8.98126018001e-12*100), 0.05) << "incorrect value for af1, expected 8.98126018001e-12, is " << last_msg_->af1; - EXPECT_EQ(last_msg_->common.fit_interval, 14400) << "incorrect value for common.fit_interval, expected 14400, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 0) << "incorrect value for common.sid.code, expected 0, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.sat, 22) << "incorrect value for common.sid.sat, expected 22, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toa.tow, 446384) << "incorrect value for common.toa.tow, expected 446384, is " << last_msg_->common.toa.tow; - EXPECT_EQ(last_msg_->common.toa.wn, 2154) << "incorrect value for common.toa.wn, expected 2154, is " << last_msg_->common.toa.wn; - EXPECT_LT((last_msg_->common.ura*100 - 2.2*100), 0.05) << "incorrect value for common.ura, expected 2.2, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->ecc*100 - 0.00707220705226*100), 0.05) << "incorrect value for ecc, expected 0.00707220705226, is " << last_msg_->ecc; - EXPECT_LT((last_msg_->inc*100 - 0.934151448026*100), 0.05) << "incorrect value for inc, expected 0.934151448026, is " << last_msg_->inc; - EXPECT_LT((last_msg_->m0*100 - -0.0220007884211*100), 0.05) << "incorrect value for m0, expected -0.0220007884211, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - -1.87318184488*100), 0.05) << "incorrect value for omega0, expected -1.87318184488, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -8.90358515577e-09*100), 0.05) << "incorrect value for omegadot, expected -8.90358515577e-09, is " << last_msg_->omegadot; - EXPECT_LT((last_msg_->sqrta*100 - 5153.55002975*100), 0.05) << "incorrect value for sqrta, expected 5153.55002975, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->w*100 - -0.98930366296*100), 0.05) << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for af0, expected -0.00063150189817, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for af1, expected 8.98126018001e-12, is " + << last_msg_->af1; + EXPECT_EQ(last_msg_->common.fit_interval, 14400) + << "incorrect value for common.fit_interval, expected 14400, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 0) + << "incorrect value for common.sid.code, expected 0, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.sat, 22) + << "incorrect value for common.sid.sat, expected 22, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toa.tow, 446384) + << "incorrect value for common.toa.tow, expected 446384, is " + << last_msg_->common.toa.tow; + EXPECT_EQ(last_msg_->common.toa.wn, 2154) + << "incorrect value for common.toa.wn, expected 2154, is " + << last_msg_->common.toa.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 2.2 * 100), 0.05) + << "incorrect value for common.ura, expected 2.2, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for ecc, expected 0.00707220705226, is " + << last_msg_->ecc; + EXPECT_LT((last_msg_->inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for inc, expected 0.934151448026, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for m0, expected -0.0220007884211, is " + << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for omega0, expected -1.87318184488, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -8.90358515577e-09, is " + << last_msg_->omegadot; + EXPECT_LT((last_msg_->sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for sqrta, expected 5153.55002975, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGPSDep.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGPSDep.cc index eeb40d53e..5313cce1b 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGPSDep.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgAlmanacGPSDep.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPSDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgAlmanacGPSDep.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_almanac_gps_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_almanac_gps_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,69 +81,110 @@ class Test_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_almanac_gps_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep0, Test) -{ +}; - uint8_t encoded_frame[] = {85,112,0,195,4,96,22,0,0,0,176,207,6,0,106,8,154,153,153,153,153,153,1,64,64,56,0,0,1,0,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,144,232, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgAlmanacGPSDep0, Test) { + uint8_t encoded_frame[] = { + 85, 112, 0, 195, 4, 96, 22, 0, 0, 0, 176, 207, 6, 0, 106, + 8, 154, 153, 153, 153, 153, 153, 1, 64, 64, 56, 0, 0, 1, 0, + 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, + 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, + 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, + 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, 0, 0, 0, 0, + 108, 177, 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 144, 232, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_almanac_gps_dep_t* test_msg = ( msg_almanac_gps_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = -0.0006315018981695175; - test_msg->af1 = 8.981260180007666e-12; - test_msg->common.fit_interval = 14400; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 0; - test_msg->common.sid.reserved = 0; - test_msg->common.sid.sat = 22; - test_msg->common.toa.tow = 446384; - test_msg->common.toa.wn = 2154; - test_msg->common.ura = 2.2; - test_msg->common.valid = 1; - test_msg->ecc = 0.007072207052260637; - test_msg->inc = 0.9341514480259797; - test_msg->m0 = -0.02200078842114688; - test_msg->omega0 = -1.8731818448797617; - test_msg->omegadot = -8.903585155774196e-09; - test_msg->sqrta = 5153.550029754639; - test_msg->w = -0.9893036629599647; - - EXPECT_EQ(send_message( 0x70, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_almanac_gps_dep_t *test_msg = (msg_almanac_gps_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = -0.0006315018981695175; + test_msg->af1 = 8.981260180007666e-12; + test_msg->common.fit_interval = 14400; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 0; + test_msg->common.sid.reserved = 0; + test_msg->common.sid.sat = 22; + test_msg->common.toa.tow = 446384; + test_msg->common.toa.wn = 2154; + test_msg->common.ura = 2.2; + test_msg->common.valid = 1; + test_msg->ecc = 0.007072207052260637; + test_msg->inc = 0.9341514480259797; + test_msg->m0 = -0.02200078842114688; + test_msg->omega0 = -1.8731818448797617; + test_msg->omegadot = -8.903585155774196e-09; + test_msg->sqrta = 5153.550029754639; + test_msg->w = -0.9893036629599647; + + EXPECT_EQ(send_message(0x70, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - -0.00063150189817*100), 0.05) << "incorrect value for af0, expected -0.00063150189817, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - 8.98126018001e-12*100), 0.05) << "incorrect value for af1, expected 8.98126018001e-12, is " << last_msg_->af1; - EXPECT_EQ(last_msg_->common.fit_interval, 14400) << "incorrect value for common.fit_interval, expected 14400, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 0) << "incorrect value for common.sid.code, expected 0, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.reserved, 0) << "incorrect value for common.sid.reserved, expected 0, is " << last_msg_->common.sid.reserved; - EXPECT_EQ(last_msg_->common.sid.sat, 22) << "incorrect value for common.sid.sat, expected 22, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toa.tow, 446384) << "incorrect value for common.toa.tow, expected 446384, is " << last_msg_->common.toa.tow; - EXPECT_EQ(last_msg_->common.toa.wn, 2154) << "incorrect value for common.toa.wn, expected 2154, is " << last_msg_->common.toa.wn; - EXPECT_LT((last_msg_->common.ura*100 - 2.2*100), 0.05) << "incorrect value for common.ura, expected 2.2, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->ecc*100 - 0.00707220705226*100), 0.05) << "incorrect value for ecc, expected 0.00707220705226, is " << last_msg_->ecc; - EXPECT_LT((last_msg_->inc*100 - 0.934151448026*100), 0.05) << "incorrect value for inc, expected 0.934151448026, is " << last_msg_->inc; - EXPECT_LT((last_msg_->m0*100 - -0.0220007884211*100), 0.05) << "incorrect value for m0, expected -0.0220007884211, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - -1.87318184488*100), 0.05) << "incorrect value for omega0, expected -1.87318184488, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -8.90358515577e-09*100), 0.05) << "incorrect value for omegadot, expected -8.90358515577e-09, is " << last_msg_->omegadot; - EXPECT_LT((last_msg_->sqrta*100 - 5153.55002975*100), 0.05) << "incorrect value for sqrta, expected 5153.55002975, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->w*100 - -0.98930366296*100), 0.05) << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for af0, expected -0.00063150189817, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for af1, expected 8.98126018001e-12, is " + << last_msg_->af1; + EXPECT_EQ(last_msg_->common.fit_interval, 14400) + << "incorrect value for common.fit_interval, expected 14400, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 0) + << "incorrect value for common.sid.code, expected 0, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.reserved, 0) + << "incorrect value for common.sid.reserved, expected 0, is " + << last_msg_->common.sid.reserved; + EXPECT_EQ(last_msg_->common.sid.sat, 22) + << "incorrect value for common.sid.sat, expected 22, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toa.tow, 446384) + << "incorrect value for common.toa.tow, expected 446384, is " + << last_msg_->common.toa.tow; + EXPECT_EQ(last_msg_->common.toa.wn, 2154) + << "incorrect value for common.toa.wn, expected 2154, is " + << last_msg_->common.toa.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 2.2 * 100), 0.05) + << "incorrect value for common.ura, expected 2.2, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for ecc, expected 0.00707220705226, is " + << last_msg_->ecc; + EXPECT_LT((last_msg_->inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for inc, expected 0.934151448026, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for m0, expected -0.0220007884211, is " + << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for omega0, expected -1.87318184488, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -8.90358515577e-09, is " + << last_msg_->omegadot; + EXPECT_LT((last_msg_->sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for sqrta, expected 5153.55002975, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgBasePosEcef.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgBasePosEcef.cc index 679d37d9c..b7894aa6e 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgBasePosEcef.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgBasePosEcef.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosEcef.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosEcef.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgBasePosEcef0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgBasePosEcef0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgBasePosEcef0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgBasePosEcef0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_base_pos_ecef_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_base_pos_ecef_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,39 +81,44 @@ class Test_legacy_auto_check_sbp_observation_MsgBasePosEcef0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_base_pos_ecef_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgBasePosEcef0, Test) -{ +}; - uint8_t encoded_frame[] = {85,72,0,0,0,24,228,131,158,245,87,205,68,193,66,62,232,209,32,118,80,193,213,231,106,251,63,20,77,65,194,125, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgBasePosEcef0, Test) { + uint8_t encoded_frame[] = { + 85, 72, 0, 0, 0, 24, 228, 131, 158, 245, 87, + 205, 68, 193, 66, 62, 232, 209, 32, 118, 80, 193, + 213, 231, 106, 251, 63, 20, 77, 65, 194, 125, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_base_pos_ecef_t* test_msg = ( msg_base_pos_ecef_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->x = -2726575.9189; - test_msg->y = -4315267.2798; - test_msg->z = 3811455.9642; - - EXPECT_EQ(send_message( 0x48, 0, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_base_pos_ecef_t *test_msg = (msg_base_pos_ecef_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->x = -2726575.9189; + test_msg->y = -4315267.2798; + test_msg->z = 3811455.9642; + + EXPECT_EQ(send_message(0x48, 0, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->x*100 - -2726575.9189*100), 0.05) << "incorrect value for x, expected -2726575.9189, is " << last_msg_->x; - EXPECT_LT((last_msg_->y*100 - -4315267.2798*100), 0.05) << "incorrect value for y, expected -4315267.2798, is " << last_msg_->y; - EXPECT_LT((last_msg_->z*100 - 3811455.9642*100), 0.05) << "incorrect value for z, expected 3811455.9642, is " << last_msg_->z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->x * 100 - -2726575.9189 * 100), 0.05) + << "incorrect value for x, expected -2726575.9189, is " << last_msg_->x; + EXPECT_LT((last_msg_->y * 100 - -4315267.2798 * 100), 0.05) + << "incorrect value for y, expected -4315267.2798, is " << last_msg_->y; + EXPECT_LT((last_msg_->z * 100 - 3811455.9642 * 100), 0.05) + << "incorrect value for z, expected 3811455.9642, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgBasePosLLH.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgBasePosLLH.cc index 71fe239c8..eebbc9dc6 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgBasePosLLH.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgBasePosLLH.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosLLH.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgBasePosLLH.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgBasePosLLH0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgBasePosLLH0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgBasePosLLH0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgBasePosLLH0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_base_pos_llh_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_base_pos_llh_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,39 +81,46 @@ class Test_legacy_auto_check_sbp_observation_MsgBasePosLLH0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_base_pos_llh_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgBasePosLLH0, Test) -{ +}; - uint8_t encoded_frame[] = {85,68,0,123,0,24,225,237,238,90,42,160,66,64,59,143,70,235,0,120,94,192,51,181,124,240,65,248,66,64,82,230, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgBasePosLLH0, Test) { + uint8_t encoded_frame[] = { + 85, 68, 0, 123, 0, 24, 225, 237, 238, 90, 42, 160, 66, 64, 59, 143, + 70, 235, 0, 120, 94, 192, 51, 181, 124, 240, 65, 248, 66, 64, 82, 230, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_base_pos_llh_t* test_msg = ( msg_base_pos_llh_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->height = 37.939512310879216; - test_msg->lat = 37.251292578377395; - test_msg->lon = -121.87505609407974; - - EXPECT_EQ(send_message( 0x44, 123, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_base_pos_llh_t *test_msg = (msg_base_pos_llh_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->height = 37.939512310879216; + test_msg->lat = 37.251292578377395; + test_msg->lon = -121.87505609407974; + + EXPECT_EQ(send_message(0x44, 123, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->height*100 - 37.9395123109*100), 0.05) << "incorrect value for height, expected 37.9395123109, is " << last_msg_->height; - EXPECT_LT((last_msg_->lat*100 - 37.2512925784*100), 0.05) << "incorrect value for lat, expected 37.2512925784, is " << last_msg_->lat; - EXPECT_LT((last_msg_->lon*100 - -121.875056094*100), 0.05) << "incorrect value for lon, expected -121.875056094, is " << last_msg_->lon; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->height * 100 - 37.9395123109 * 100), 0.05) + << "incorrect value for height, expected 37.9395123109, is " + << last_msg_->height; + EXPECT_LT((last_msg_->lat * 100 - 37.2512925784 * 100), 0.05) + << "incorrect value for lat, expected 37.2512925784, is " + << last_msg_->lat; + EXPECT_LT((last_msg_->lon * 100 - -121.875056094 * 100), 0.05) + << "incorrect value for lon, expected -121.875056094, is " + << last_msg_->lon; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisBds.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisBds.cc index 5c7f7f38f..5bde8c1d2 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisBds.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisBds.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisBds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisBds.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisBds0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisBds0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisBds0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisBds0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_bds_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_bds_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,97 +81,165 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisBds0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_bds_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisBds0, Test) -{ +}; - uint8_t encoded_frame[] = {85,137,0,128,240,147,8,12,174,179,6,0,106,8,0,0,0,64,48,42,0,0,1,0,125,99,52,50,207,46,151,176,0,112,96,67,0,164,106,67,0,60,255,54,0,224,47,53,0,0,143,179,0,192,190,52,146,101,162,196,109,104,19,62,253,87,86,202,62,28,251,63,0,0,0,96,151,60,117,63,0,0,128,154,127,93,185,64,151,193,64,0,10,166,4,192,160,75,174,98,8,201,35,190,205,29,12,71,189,150,5,192,176,72,249,189,193,172,240,63,72,249,188,180,160,203,9,62,0,0,0,0,92,51,77,191,0,128,174,43,0,0,88,161,174,179,6,0,106,8,6,5,0,157,249, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisBds0, Test) { + uint8_t encoded_frame[] = { + 85, 137, 0, 128, 240, 147, 8, 12, 174, 179, 6, 0, 106, 8, 0, + 0, 0, 64, 48, 42, 0, 0, 1, 0, 125, 99, 52, 50, 207, 46, + 151, 176, 0, 112, 96, 67, 0, 164, 106, 67, 0, 60, 255, 54, 0, + 224, 47, 53, 0, 0, 143, 179, 0, 192, 190, 52, 146, 101, 162, 196, + 109, 104, 19, 62, 253, 87, 86, 202, 62, 28, 251, 63, 0, 0, 0, + 96, 151, 60, 117, 63, 0, 0, 128, 154, 127, 93, 185, 64, 151, 193, + 64, 0, 10, 166, 4, 192, 160, 75, 174, 98, 8, 201, 35, 190, 205, + 29, 12, 71, 189, 150, 5, 192, 176, 72, 249, 189, 193, 172, 240, 63, + 72, 249, 188, 180, 160, 203, 9, 62, 0, 0, 0, 0, 92, 51, 77, + 191, 0, 128, 174, 43, 0, 0, 88, 161, 174, 179, 6, 0, 106, 8, + 6, 5, 0, 157, 249, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_bds_t* test_msg = ( msg_ephemeris_bds_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = -0.0008911322802305222; - test_msg->af1 = 1.2398970739013748e-12; - test_msg->af2 = -7.318364664277155e-19; - test_msg->c_ic = -6.658956408500671e-08; - test_msg->c_is = 3.5529956221580505e-07; - test_msg->c_rc = 234.640625; - test_msg->c_rs = 224.4375; - test_msg->c_uc = 7.606577128171921e-06; - test_msg->c_us = 6.551854312419891e-07; - test_msg->common.fit_interval = 10800; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 12; - test_msg->common.sid.sat = 8; - test_msg->common.toe.tow = 439214; - test_msg->common.toe.wn = 2154; - test_msg->common.ura = 2.0; - test_msg->common.valid = 1; - test_msg->dn = 1.1296899132622133e-09; - test_msg->ecc = 0.005184737499803305; - test_msg->inc = 1.0421769543504915; - test_msg->inc_dot = 7.507455572801683e-10; - test_msg->iodc = 5; - test_msg->iode = 6; - test_msg->m0 = 1.6943958190727237; - test_msg->omega0 = -2.581073762870982; - test_msg->omegadot = -2.303310227830545e-09; - test_msg->sqrta = 6493.49845123291; - test_msg->tgd1 = 1.0499999980595476e-08; - test_msg->tgd2 = -1.0999999799921056e-09; - test_msg->toc.tow = 439214; - test_msg->toc.wn = 2154; - test_msg->w = -2.698603205735458; - - EXPECT_EQ(send_message( 0x89, 61568, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_bds_t *test_msg = (msg_ephemeris_bds_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = -0.0008911322802305222; + test_msg->af1 = 1.2398970739013748e-12; + test_msg->af2 = -7.318364664277155e-19; + test_msg->c_ic = -6.658956408500671e-08; + test_msg->c_is = 3.5529956221580505e-07; + test_msg->c_rc = 234.640625; + test_msg->c_rs = 224.4375; + test_msg->c_uc = 7.606577128171921e-06; + test_msg->c_us = 6.551854312419891e-07; + test_msg->common.fit_interval = 10800; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 12; + test_msg->common.sid.sat = 8; + test_msg->common.toe.tow = 439214; + test_msg->common.toe.wn = 2154; + test_msg->common.ura = 2.0; + test_msg->common.valid = 1; + test_msg->dn = 1.1296899132622133e-09; + test_msg->ecc = 0.005184737499803305; + test_msg->inc = 1.0421769543504915; + test_msg->inc_dot = 7.507455572801683e-10; + test_msg->iodc = 5; + test_msg->iode = 6; + test_msg->m0 = 1.6943958190727237; + test_msg->omega0 = -2.581073762870982; + test_msg->omegadot = -2.303310227830545e-09; + test_msg->sqrta = 6493.49845123291; + test_msg->tgd1 = 1.0499999980595476e-08; + test_msg->tgd2 = -1.0999999799921056e-09; + test_msg->toc.tow = 439214; + test_msg->toc.wn = 2154; + test_msg->w = -2.698603205735458; + + EXPECT_EQ(send_message(0x89, 61568, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61568); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - -0.000891132280231*100), 0.05) << "incorrect value for af0, expected -0.000891132280231, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - 1.2398970739e-12*100), 0.05) << "incorrect value for af1, expected 1.2398970739e-12, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - -7.31836466428e-19*100), 0.05) << "incorrect value for af2, expected -7.31836466428e-19, is " << last_msg_->af2; - EXPECT_LT((last_msg_->c_ic*100 - -6.6589564085e-08*100), 0.05) << "incorrect value for c_ic, expected -6.6589564085e-08, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - 3.55299562216e-07*100), 0.05) << "incorrect value for c_is, expected 3.55299562216e-07, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - 234.640625*100), 0.05) << "incorrect value for c_rc, expected 234.640625, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - 224.4375*100), 0.05) << "incorrect value for c_rs, expected 224.4375, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - 7.60657712817e-06*100), 0.05) << "incorrect value for c_uc, expected 7.60657712817e-06, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 6.55185431242e-07*100), 0.05) << "incorrect value for c_us, expected 6.55185431242e-07, is " << last_msg_->c_us; - EXPECT_EQ(last_msg_->common.fit_interval, 10800) << "incorrect value for common.fit_interval, expected 10800, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 12) << "incorrect value for common.sid.code, expected 12, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.sat, 8) << "incorrect value for common.sid.sat, expected 8, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toe.tow, 439214) << "incorrect value for common.toe.tow, expected 439214, is " << last_msg_->common.toe.tow; - EXPECT_EQ(last_msg_->common.toe.wn, 2154) << "incorrect value for common.toe.wn, expected 2154, is " << last_msg_->common.toe.wn; - EXPECT_LT((last_msg_->common.ura*100 - 2.0*100), 0.05) << "incorrect value for common.ura, expected 2.0, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->dn*100 - 1.12968991326e-09*100), 0.05) << "incorrect value for dn, expected 1.12968991326e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.0051847374998*100), 0.05) << "incorrect value for ecc, expected 0.0051847374998, is " << last_msg_->ecc; - EXPECT_LT((last_msg_->inc*100 - 1.04217695435*100), 0.05) << "incorrect value for inc, expected 1.04217695435, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - 7.5074555728e-10*100), 0.05) << "incorrect value for inc_dot, expected 7.5074555728e-10, is " << last_msg_->inc_dot; - EXPECT_EQ(last_msg_->iodc, 5) << "incorrect value for iodc, expected 5, is " << last_msg_->iodc; - EXPECT_EQ(last_msg_->iode, 6) << "incorrect value for iode, expected 6, is " << last_msg_->iode; - EXPECT_LT((last_msg_->m0*100 - 1.69439581907*100), 0.05) << "incorrect value for m0, expected 1.69439581907, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - -2.58107376287*100), 0.05) << "incorrect value for omega0, expected -2.58107376287, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -2.30331022783e-09*100), 0.05) << "incorrect value for omegadot, expected -2.30331022783e-09, is " << last_msg_->omegadot; - EXPECT_LT((last_msg_->sqrta*100 - 6493.49845123*100), 0.05) << "incorrect value for sqrta, expected 6493.49845123, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->tgd1*100 - 1.04999999806e-08*100), 0.05) << "incorrect value for tgd1, expected 1.04999999806e-08, is " << last_msg_->tgd1; - EXPECT_LT((last_msg_->tgd2*100 - -1.09999997999e-09*100), 0.05) << "incorrect value for tgd2, expected -1.09999997999e-09, is " << last_msg_->tgd2; - EXPECT_EQ(last_msg_->toc.tow, 439214) << "incorrect value for toc.tow, expected 439214, is " << last_msg_->toc.tow; - EXPECT_EQ(last_msg_->toc.wn, 2154) << "incorrect value for toc.wn, expected 2154, is " << last_msg_->toc.wn; - EXPECT_LT((last_msg_->w*100 - -2.69860320574*100), 0.05) << "incorrect value for w, expected -2.69860320574, is " << last_msg_->w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61568); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - -0.000891132280231 * 100), 0.05) + << "incorrect value for af0, expected -0.000891132280231, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - 1.2398970739e-12 * 100), 0.05) + << "incorrect value for af1, expected 1.2398970739e-12, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - -7.31836466428e-19 * 100), 0.05) + << "incorrect value for af2, expected -7.31836466428e-19, is " + << last_msg_->af2; + EXPECT_LT((last_msg_->c_ic * 100 - -6.6589564085e-08 * 100), 0.05) + << "incorrect value for c_ic, expected -6.6589564085e-08, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - 3.55299562216e-07 * 100), 0.05) + << "incorrect value for c_is, expected 3.55299562216e-07, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - 234.640625 * 100), 0.05) + << "incorrect value for c_rc, expected 234.640625, is " + << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - 224.4375 * 100), 0.05) + << "incorrect value for c_rs, expected 224.4375, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - 7.60657712817e-06 * 100), 0.05) + << "incorrect value for c_uc, expected 7.60657712817e-06, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 6.55185431242e-07 * 100), 0.05) + << "incorrect value for c_us, expected 6.55185431242e-07, is " + << last_msg_->c_us; + EXPECT_EQ(last_msg_->common.fit_interval, 10800) + << "incorrect value for common.fit_interval, expected 10800, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 12) + << "incorrect value for common.sid.code, expected 12, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.sat, 8) + << "incorrect value for common.sid.sat, expected 8, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toe.tow, 439214) + << "incorrect value for common.toe.tow, expected 439214, is " + << last_msg_->common.toe.tow; + EXPECT_EQ(last_msg_->common.toe.wn, 2154) + << "incorrect value for common.toe.wn, expected 2154, is " + << last_msg_->common.toe.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 2.0 * 100), 0.05) + << "incorrect value for common.ura, expected 2.0, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->dn * 100 - 1.12968991326e-09 * 100), 0.05) + << "incorrect value for dn, expected 1.12968991326e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.0051847374998 * 100), 0.05) + << "incorrect value for ecc, expected 0.0051847374998, is " + << last_msg_->ecc; + EXPECT_LT((last_msg_->inc * 100 - 1.04217695435 * 100), 0.05) + << "incorrect value for inc, expected 1.04217695435, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - 7.5074555728e-10 * 100), 0.05) + << "incorrect value for inc_dot, expected 7.5074555728e-10, is " + << last_msg_->inc_dot; + EXPECT_EQ(last_msg_->iodc, 5) + << "incorrect value for iodc, expected 5, is " << last_msg_->iodc; + EXPECT_EQ(last_msg_->iode, 6) + << "incorrect value for iode, expected 6, is " << last_msg_->iode; + EXPECT_LT((last_msg_->m0 * 100 - 1.69439581907 * 100), 0.05) + << "incorrect value for m0, expected 1.69439581907, is " << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - -2.58107376287 * 100), 0.05) + << "incorrect value for omega0, expected -2.58107376287, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -2.30331022783e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -2.30331022783e-09, is " + << last_msg_->omegadot; + EXPECT_LT((last_msg_->sqrta * 100 - 6493.49845123 * 100), 0.05) + << "incorrect value for sqrta, expected 6493.49845123, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->tgd1 * 100 - 1.04999999806e-08 * 100), 0.05) + << "incorrect value for tgd1, expected 1.04999999806e-08, is " + << last_msg_->tgd1; + EXPECT_LT((last_msg_->tgd2 * 100 - -1.09999997999e-09 * 100), 0.05) + << "incorrect value for tgd2, expected -1.09999997999e-09, is " + << last_msg_->tgd2; + EXPECT_EQ(last_msg_->toc.tow, 439214) + << "incorrect value for toc.tow, expected 439214, is " + << last_msg_->toc.tow; + EXPECT_EQ(last_msg_->toc.wn, 2154) + << "incorrect value for toc.wn, expected 2154, is " << last_msg_->toc.wn; + EXPECT_LT((last_msg_->w * 100 - -2.69860320574 * 100), 0.05) + << "incorrect value for w, expected -2.69860320574, is " << last_msg_->w; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisDepA.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisDepA.cc index 949b665b4..8977da7a4 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,85 +81,140 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,26,0,195,4,175,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,154,153,153,153,153,153,201,63,205,204,204,204,192,62,27,65,106,8,205,204,204,204,192,62,27,65,106,8,1,0,22,242,84, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 26, 0, 195, 4, 175, 0, 0, 0, 0, 0, 0, 83, 190, 0, + 0, 0, 0, 0, 40, 74, 192, 0, 0, 0, 0, 0, 74, 115, 64, + 0, 0, 0, 0, 0, 4, 199, 190, 0, 0, 0, 0, 0, 80, 202, + 62, 0, 0, 0, 0, 0, 0, 64, 62, 0, 0, 0, 0, 0, 0, + 127, 190, 114, 216, 96, 180, 49, 117, 56, 62, 142, 41, 5, 235, 95, + 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, 63, 0, 0, 192, 206, + 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, + 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, 71, 11, + 217, 147, 145, 228, 237, 63, 221, 47, 100, 224, 255, 47, 198, 189, 0, + 0, 0, 0, 108, 177, 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, + 154, 153, 153, 153, 153, 153, 201, 63, 205, 204, 204, 204, 192, 62, 27, + 65, 106, 8, 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, 1, 0, + 22, 242, 84, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_dep_a_t* test_msg = ( msg_ephemeris_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = -0.0006315018981695175; - test_msg->af1 = 8.981260180007666e-12; - test_msg->af2 = 0.2; - test_msg->c_ic = 7.450580596923828e-09; - test_msg->c_is = -1.1548399925231934e-07; - test_msg->c_rc = 308.625; - test_msg->c_rs = -52.3125; - test_msg->c_uc = -2.7436763048171997e-06; - test_msg->c_us = 3.1366944313049316e-06; - test_msg->dn = 5.694522914022375e-09; - test_msg->ecc = 0.007072207052260637; - test_msg->healthy = 0; - test_msg->inc = 0.9341514480259797; - test_msg->inc_dot = -4.035882396415757e-11; - test_msg->m0 = -0.02200078842114688; - test_msg->omega0 = -1.8731818448797617; - test_msg->omegadot = -8.903585155774196e-09; - test_msg->prn = 22; - test_msg->sqrta = 5153.550029754639; - test_msg->tgd = -1.7695128917694092e-08; - test_msg->toc_tow = 446384.2; - test_msg->toc_wn = 2154; - test_msg->toe_tow = 446384.2; - test_msg->toe_wn = 2154; - test_msg->valid = 1; - test_msg->w = -0.9893036629599647; - - EXPECT_EQ(send_message( 0x1a, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_dep_a_t *test_msg = (msg_ephemeris_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = -0.0006315018981695175; + test_msg->af1 = 8.981260180007666e-12; + test_msg->af2 = 0.2; + test_msg->c_ic = 7.450580596923828e-09; + test_msg->c_is = -1.1548399925231934e-07; + test_msg->c_rc = 308.625; + test_msg->c_rs = -52.3125; + test_msg->c_uc = -2.7436763048171997e-06; + test_msg->c_us = 3.1366944313049316e-06; + test_msg->dn = 5.694522914022375e-09; + test_msg->ecc = 0.007072207052260637; + test_msg->healthy = 0; + test_msg->inc = 0.9341514480259797; + test_msg->inc_dot = -4.035882396415757e-11; + test_msg->m0 = -0.02200078842114688; + test_msg->omega0 = -1.8731818448797617; + test_msg->omegadot = -8.903585155774196e-09; + test_msg->prn = 22; + test_msg->sqrta = 5153.550029754639; + test_msg->tgd = -1.7695128917694092e-08; + test_msg->toc_tow = 446384.2; + test_msg->toc_wn = 2154; + test_msg->toe_tow = 446384.2; + test_msg->toe_wn = 2154; + test_msg->valid = 1; + test_msg->w = -0.9893036629599647; + + EXPECT_EQ(send_message(0x1a, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - -0.00063150189817*100), 0.05) << "incorrect value for af0, expected -0.00063150189817, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - 8.98126018001e-12*100), 0.05) << "incorrect value for af1, expected 8.98126018001e-12, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - 0.2*100), 0.05) << "incorrect value for af2, expected 0.2, is " << last_msg_->af2; - EXPECT_LT((last_msg_->c_ic*100 - 7.45058059692e-09*100), 0.05) << "incorrect value for c_ic, expected 7.45058059692e-09, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - -1.15483999252e-07*100), 0.05) << "incorrect value for c_is, expected -1.15483999252e-07, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - 308.625*100), 0.05) << "incorrect value for c_rc, expected 308.625, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - -52.3125*100), 0.05) << "incorrect value for c_rs, expected -52.3125, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - -2.74367630482e-06*100), 0.05) << "incorrect value for c_uc, expected -2.74367630482e-06, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 3.1366944313e-06*100), 0.05) << "incorrect value for c_us, expected 3.1366944313e-06, is " << last_msg_->c_us; - EXPECT_LT((last_msg_->dn*100 - 5.69452291402e-09*100), 0.05) << "incorrect value for dn, expected 5.69452291402e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.00707220705226*100), 0.05) << "incorrect value for ecc, expected 0.00707220705226, is " << last_msg_->ecc; - EXPECT_EQ(last_msg_->healthy, 0) << "incorrect value for healthy, expected 0, is " << last_msg_->healthy; - EXPECT_LT((last_msg_->inc*100 - 0.934151448026*100), 0.05) << "incorrect value for inc, expected 0.934151448026, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - -4.03588239642e-11*100), 0.05) << "incorrect value for inc_dot, expected -4.03588239642e-11, is " << last_msg_->inc_dot; - EXPECT_LT((last_msg_->m0*100 - -0.0220007884211*100), 0.05) << "incorrect value for m0, expected -0.0220007884211, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - -1.87318184488*100), 0.05) << "incorrect value for omega0, expected -1.87318184488, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -8.90358515577e-09*100), 0.05) << "incorrect value for omegadot, expected -8.90358515577e-09, is " << last_msg_->omegadot; - EXPECT_EQ(last_msg_->prn, 22) << "incorrect value for prn, expected 22, is " << last_msg_->prn; - EXPECT_LT((last_msg_->sqrta*100 - 5153.55002975*100), 0.05) << "incorrect value for sqrta, expected 5153.55002975, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->tgd*100 - -1.76951289177e-08*100), 0.05) << "incorrect value for tgd, expected -1.76951289177e-08, is " << last_msg_->tgd; - EXPECT_LT((last_msg_->toc_tow*100 - 446384.2*100), 0.05) << "incorrect value for toc_tow, expected 446384.2, is " << last_msg_->toc_tow; - EXPECT_EQ(last_msg_->toc_wn, 2154) << "incorrect value for toc_wn, expected 2154, is " << last_msg_->toc_wn; - EXPECT_LT((last_msg_->toe_tow*100 - 446384.2*100), 0.05) << "incorrect value for toe_tow, expected 446384.2, is " << last_msg_->toe_tow; - EXPECT_EQ(last_msg_->toe_wn, 2154) << "incorrect value for toe_wn, expected 2154, is " << last_msg_->toe_wn; - EXPECT_EQ(last_msg_->valid, 1) << "incorrect value for valid, expected 1, is " << last_msg_->valid; - EXPECT_LT((last_msg_->w*100 - -0.98930366296*100), 0.05) << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for af0, expected -0.00063150189817, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for af1, expected 8.98126018001e-12, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - 0.2 * 100), 0.05) + << "incorrect value for af2, expected 0.2, is " << last_msg_->af2; + EXPECT_LT((last_msg_->c_ic * 100 - 7.45058059692e-09 * 100), 0.05) + << "incorrect value for c_ic, expected 7.45058059692e-09, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - -1.15483999252e-07 * 100), 0.05) + << "incorrect value for c_is, expected -1.15483999252e-07, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - 308.625 * 100), 0.05) + << "incorrect value for c_rc, expected 308.625, is " << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - -52.3125 * 100), 0.05) + << "incorrect value for c_rs, expected -52.3125, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - -2.74367630482e-06 * 100), 0.05) + << "incorrect value for c_uc, expected -2.74367630482e-06, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 3.1366944313e-06 * 100), 0.05) + << "incorrect value for c_us, expected 3.1366944313e-06, is " + << last_msg_->c_us; + EXPECT_LT((last_msg_->dn * 100 - 5.69452291402e-09 * 100), 0.05) + << "incorrect value for dn, expected 5.69452291402e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for ecc, expected 0.00707220705226, is " + << last_msg_->ecc; + EXPECT_EQ(last_msg_->healthy, 0) + << "incorrect value for healthy, expected 0, is " << last_msg_->healthy; + EXPECT_LT((last_msg_->inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for inc, expected 0.934151448026, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) + << "incorrect value for inc_dot, expected -4.03588239642e-11, is " + << last_msg_->inc_dot; + EXPECT_LT((last_msg_->m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for m0, expected -0.0220007884211, is " + << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for omega0, expected -1.87318184488, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -8.90358515577e-09, is " + << last_msg_->omegadot; + EXPECT_EQ(last_msg_->prn, 22) + << "incorrect value for prn, expected 22, is " << last_msg_->prn; + EXPECT_LT((last_msg_->sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for sqrta, expected 5153.55002975, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->tgd * 100 - -1.76951289177e-08 * 100), 0.05) + << "incorrect value for tgd, expected -1.76951289177e-08, is " + << last_msg_->tgd; + EXPECT_LT((last_msg_->toc_tow * 100 - 446384.2 * 100), 0.05) + << "incorrect value for toc_tow, expected 446384.2, is " + << last_msg_->toc_tow; + EXPECT_EQ(last_msg_->toc_wn, 2154) + << "incorrect value for toc_wn, expected 2154, is " << last_msg_->toc_wn; + EXPECT_LT((last_msg_->toe_tow * 100 - 446384.2 * 100), 0.05) + << "incorrect value for toe_tow, expected 446384.2, is " + << last_msg_->toe_tow; + EXPECT_EQ(last_msg_->toe_wn, 2154) + << "incorrect value for toe_wn, expected 2154, is " << last_msg_->toe_wn; + EXPECT_EQ(last_msg_->valid, 1) + << "incorrect value for valid, expected 1, is " << last_msg_->valid; + EXPECT_LT((last_msg_->w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisDepC.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisDepC.cc index ea5ee8303..cb6c1c57a 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisDepC.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisDepC.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepC.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisDepC0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisDepC0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisDepC0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisDepC0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_dep_c_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,95 +81,156 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisDepC0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_dep_c_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisDepC0, Test) -{ +}; - uint8_t encoded_frame[] = {85,71,0,195,4,185,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,154,153,153,153,153,153,201,63,205,204,204,204,192,62,27,65,106,8,205,204,204,204,192,62,27,65,106,8,1,0,22,0,0,0,45,45,0,0,0,0,0,23,170, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisDepC0, Test) { + uint8_t encoded_frame[] = { + 85, 71, 0, 195, 4, 185, 0, 0, 0, 0, 0, 0, 83, 190, 0, + 0, 0, 0, 0, 40, 74, 192, 0, 0, 0, 0, 0, 74, 115, 64, + 0, 0, 0, 0, 0, 4, 199, 190, 0, 0, 0, 0, 0, 80, 202, + 62, 0, 0, 0, 0, 0, 0, 64, 62, 0, 0, 0, 0, 0, 0, + 127, 190, 114, 216, 96, 180, 49, 117, 56, 62, 142, 41, 5, 235, 95, + 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, 63, 0, 0, 192, 206, + 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, + 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, 71, 11, + 217, 147, 145, 228, 237, 63, 221, 47, 100, 224, 255, 47, 198, 189, 0, + 0, 0, 0, 108, 177, 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, + 154, 153, 153, 153, 153, 153, 201, 63, 205, 204, 204, 204, 192, 62, 27, + 65, 106, 8, 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, 1, 0, + 22, 0, 0, 0, 45, 45, 0, 0, 0, 0, 0, 23, 170, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_dep_c_t* test_msg = ( msg_ephemeris_dep_c_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = -0.0006315018981695175; - test_msg->af1 = 8.981260180007666e-12; - test_msg->af2 = 0.2; - test_msg->c_ic = 7.450580596923828e-09; - test_msg->c_is = -1.1548399925231934e-07; - test_msg->c_rc = 308.625; - test_msg->c_rs = -52.3125; - test_msg->c_uc = -2.7436763048171997e-06; - test_msg->c_us = 3.1366944313049316e-06; - test_msg->dn = 5.694522914022375e-09; - test_msg->ecc = 0.007072207052260637; - test_msg->healthy = 0; - test_msg->inc = 0.9341514480259797; - test_msg->inc_dot = -4.035882396415757e-11; - test_msg->iodc = 45; - test_msg->iode = 45; - test_msg->m0 = -0.02200078842114688; - test_msg->omega0 = -1.8731818448797617; - test_msg->omegadot = -8.903585155774196e-09; - test_msg->reserved = 0; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 22; - test_msg->sqrta = 5153.550029754639; - test_msg->tgd = -1.7695128917694092e-08; - test_msg->toc_tow = 446384.2; - test_msg->toc_wn = 2154; - test_msg->toe_tow = 446384.2; - test_msg->toe_wn = 2154; - test_msg->valid = 1; - test_msg->w = -0.9893036629599647; - - EXPECT_EQ(send_message( 0x47, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_dep_c_t *test_msg = (msg_ephemeris_dep_c_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = -0.0006315018981695175; + test_msg->af1 = 8.981260180007666e-12; + test_msg->af2 = 0.2; + test_msg->c_ic = 7.450580596923828e-09; + test_msg->c_is = -1.1548399925231934e-07; + test_msg->c_rc = 308.625; + test_msg->c_rs = -52.3125; + test_msg->c_uc = -2.7436763048171997e-06; + test_msg->c_us = 3.1366944313049316e-06; + test_msg->dn = 5.694522914022375e-09; + test_msg->ecc = 0.007072207052260637; + test_msg->healthy = 0; + test_msg->inc = 0.9341514480259797; + test_msg->inc_dot = -4.035882396415757e-11; + test_msg->iodc = 45; + test_msg->iode = 45; + test_msg->m0 = -0.02200078842114688; + test_msg->omega0 = -1.8731818448797617; + test_msg->omegadot = -8.903585155774196e-09; + test_msg->reserved = 0; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 22; + test_msg->sqrta = 5153.550029754639; + test_msg->tgd = -1.7695128917694092e-08; + test_msg->toc_tow = 446384.2; + test_msg->toc_wn = 2154; + test_msg->toe_tow = 446384.2; + test_msg->toe_wn = 2154; + test_msg->valid = 1; + test_msg->w = -0.9893036629599647; + + EXPECT_EQ(send_message(0x47, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - -0.00063150189817*100), 0.05) << "incorrect value for af0, expected -0.00063150189817, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - 8.98126018001e-12*100), 0.05) << "incorrect value for af1, expected 8.98126018001e-12, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - 0.2*100), 0.05) << "incorrect value for af2, expected 0.2, is " << last_msg_->af2; - EXPECT_LT((last_msg_->c_ic*100 - 7.45058059692e-09*100), 0.05) << "incorrect value for c_ic, expected 7.45058059692e-09, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - -1.15483999252e-07*100), 0.05) << "incorrect value for c_is, expected -1.15483999252e-07, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - 308.625*100), 0.05) << "incorrect value for c_rc, expected 308.625, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - -52.3125*100), 0.05) << "incorrect value for c_rs, expected -52.3125, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - -2.74367630482e-06*100), 0.05) << "incorrect value for c_uc, expected -2.74367630482e-06, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 3.1366944313e-06*100), 0.05) << "incorrect value for c_us, expected 3.1366944313e-06, is " << last_msg_->c_us; - EXPECT_LT((last_msg_->dn*100 - 5.69452291402e-09*100), 0.05) << "incorrect value for dn, expected 5.69452291402e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.00707220705226*100), 0.05) << "incorrect value for ecc, expected 0.00707220705226, is " << last_msg_->ecc; - EXPECT_EQ(last_msg_->healthy, 0) << "incorrect value for healthy, expected 0, is " << last_msg_->healthy; - EXPECT_LT((last_msg_->inc*100 - 0.934151448026*100), 0.05) << "incorrect value for inc, expected 0.934151448026, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - -4.03588239642e-11*100), 0.05) << "incorrect value for inc_dot, expected -4.03588239642e-11, is " << last_msg_->inc_dot; - EXPECT_EQ(last_msg_->iodc, 45) << "incorrect value for iodc, expected 45, is " << last_msg_->iodc; - EXPECT_EQ(last_msg_->iode, 45) << "incorrect value for iode, expected 45, is " << last_msg_->iode; - EXPECT_LT((last_msg_->m0*100 - -0.0220007884211*100), 0.05) << "incorrect value for m0, expected -0.0220007884211, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - -1.87318184488*100), 0.05) << "incorrect value for omega0, expected -1.87318184488, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -8.90358515577e-09*100), 0.05) << "incorrect value for omegadot, expected -8.90358515577e-09, is " << last_msg_->omegadot; - EXPECT_EQ(last_msg_->reserved, 0) << "incorrect value for reserved, expected 0, is " << last_msg_->reserved; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 22) << "incorrect value for sid.sat, expected 22, is " << last_msg_->sid.sat; - EXPECT_LT((last_msg_->sqrta*100 - 5153.55002975*100), 0.05) << "incorrect value for sqrta, expected 5153.55002975, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->tgd*100 - -1.76951289177e-08*100), 0.05) << "incorrect value for tgd, expected -1.76951289177e-08, is " << last_msg_->tgd; - EXPECT_LT((last_msg_->toc_tow*100 - 446384.2*100), 0.05) << "incorrect value for toc_tow, expected 446384.2, is " << last_msg_->toc_tow; - EXPECT_EQ(last_msg_->toc_wn, 2154) << "incorrect value for toc_wn, expected 2154, is " << last_msg_->toc_wn; - EXPECT_LT((last_msg_->toe_tow*100 - 446384.2*100), 0.05) << "incorrect value for toe_tow, expected 446384.2, is " << last_msg_->toe_tow; - EXPECT_EQ(last_msg_->toe_wn, 2154) << "incorrect value for toe_wn, expected 2154, is " << last_msg_->toe_wn; - EXPECT_EQ(last_msg_->valid, 1) << "incorrect value for valid, expected 1, is " << last_msg_->valid; - EXPECT_LT((last_msg_->w*100 - -0.98930366296*100), 0.05) << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for af0, expected -0.00063150189817, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for af1, expected 8.98126018001e-12, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - 0.2 * 100), 0.05) + << "incorrect value for af2, expected 0.2, is " << last_msg_->af2; + EXPECT_LT((last_msg_->c_ic * 100 - 7.45058059692e-09 * 100), 0.05) + << "incorrect value for c_ic, expected 7.45058059692e-09, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - -1.15483999252e-07 * 100), 0.05) + << "incorrect value for c_is, expected -1.15483999252e-07, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - 308.625 * 100), 0.05) + << "incorrect value for c_rc, expected 308.625, is " << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - -52.3125 * 100), 0.05) + << "incorrect value for c_rs, expected -52.3125, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - -2.74367630482e-06 * 100), 0.05) + << "incorrect value for c_uc, expected -2.74367630482e-06, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 3.1366944313e-06 * 100), 0.05) + << "incorrect value for c_us, expected 3.1366944313e-06, is " + << last_msg_->c_us; + EXPECT_LT((last_msg_->dn * 100 - 5.69452291402e-09 * 100), 0.05) + << "incorrect value for dn, expected 5.69452291402e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for ecc, expected 0.00707220705226, is " + << last_msg_->ecc; + EXPECT_EQ(last_msg_->healthy, 0) + << "incorrect value for healthy, expected 0, is " << last_msg_->healthy; + EXPECT_LT((last_msg_->inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for inc, expected 0.934151448026, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) + << "incorrect value for inc_dot, expected -4.03588239642e-11, is " + << last_msg_->inc_dot; + EXPECT_EQ(last_msg_->iodc, 45) + << "incorrect value for iodc, expected 45, is " << last_msg_->iodc; + EXPECT_EQ(last_msg_->iode, 45) + << "incorrect value for iode, expected 45, is " << last_msg_->iode; + EXPECT_LT((last_msg_->m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for m0, expected -0.0220007884211, is " + << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for omega0, expected -1.87318184488, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -8.90358515577e-09, is " + << last_msg_->omegadot; + EXPECT_EQ(last_msg_->reserved, 0) + << "incorrect value for reserved, expected 0, is " << last_msg_->reserved; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 22) + << "incorrect value for sid.sat, expected 22, is " << last_msg_->sid.sat; + EXPECT_LT((last_msg_->sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for sqrta, expected 5153.55002975, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->tgd * 100 - -1.76951289177e-08 * 100), 0.05) + << "incorrect value for tgd, expected -1.76951289177e-08, is " + << last_msg_->tgd; + EXPECT_LT((last_msg_->toc_tow * 100 - 446384.2 * 100), 0.05) + << "incorrect value for toc_tow, expected 446384.2, is " + << last_msg_->toc_tow; + EXPECT_EQ(last_msg_->toc_wn, 2154) + << "incorrect value for toc_wn, expected 2154, is " << last_msg_->toc_wn; + EXPECT_LT((last_msg_->toe_tow * 100 - 446384.2 * 100), 0.05) + << "incorrect value for toe_tow, expected 446384.2, is " + << last_msg_->toe_tow; + EXPECT_EQ(last_msg_->toe_wn, 2154) + << "incorrect value for toe_wn, expected 2154, is " << last_msg_->toe_wn; + EXPECT_EQ(last_msg_->valid, 1) + << "incorrect value for valid, expected 1, is " << last_msg_->valid; + EXPECT_LT((last_msg_->w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisDepD.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisDepD.cc index 5230cfcc7..113844c3c 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisDepD.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisDepD.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepD.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisDepD.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisDepD0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisDepD0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisDepD0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisDepD0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_dep_d_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_dep_d_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,95 +81,156 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisDepD0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_dep_d_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisDepD0, Test) -{ +}; - uint8_t encoded_frame[] = {85,128,0,195,4,185,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,154,153,153,153,153,153,201,63,205,204,204,204,192,62,27,65,106,8,205,204,204,204,192,62,27,65,106,8,1,0,22,0,0,0,45,45,0,0,0,0,0,95,7, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisDepD0, Test) { + uint8_t encoded_frame[] = { + 85, 128, 0, 195, 4, 185, 0, 0, 0, 0, 0, 0, 83, 190, 0, + 0, 0, 0, 0, 40, 74, 192, 0, 0, 0, 0, 0, 74, 115, 64, + 0, 0, 0, 0, 0, 4, 199, 190, 0, 0, 0, 0, 0, 80, 202, + 62, 0, 0, 0, 0, 0, 0, 64, 62, 0, 0, 0, 0, 0, 0, + 127, 190, 114, 216, 96, 180, 49, 117, 56, 62, 142, 41, 5, 235, 95, + 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, 63, 0, 0, 192, 206, + 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, 253, 191, 227, 133, 81, + 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, 168, 239, 191, 71, 11, + 217, 147, 145, 228, 237, 63, 221, 47, 100, 224, 255, 47, 198, 189, 0, + 0, 0, 0, 108, 177, 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, + 154, 153, 153, 153, 153, 153, 201, 63, 205, 204, 204, 204, 192, 62, 27, + 65, 106, 8, 205, 204, 204, 204, 192, 62, 27, 65, 106, 8, 1, 0, + 22, 0, 0, 0, 45, 45, 0, 0, 0, 0, 0, 95, 7, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_dep_d_t* test_msg = ( msg_ephemeris_dep_d_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = -0.0006315018981695175; - test_msg->af1 = 8.981260180007666e-12; - test_msg->af2 = 0.2; - test_msg->c_ic = 7.450580596923828e-09; - test_msg->c_is = -1.1548399925231934e-07; - test_msg->c_rc = 308.625; - test_msg->c_rs = -52.3125; - test_msg->c_uc = -2.7436763048171997e-06; - test_msg->c_us = 3.1366944313049316e-06; - test_msg->dn = 5.694522914022375e-09; - test_msg->ecc = 0.007072207052260637; - test_msg->healthy = 0; - test_msg->inc = 0.9341514480259797; - test_msg->inc_dot = -4.035882396415757e-11; - test_msg->iodc = 45; - test_msg->iode = 45; - test_msg->m0 = -0.02200078842114688; - test_msg->omega0 = -1.8731818448797617; - test_msg->omegadot = -8.903585155774196e-09; - test_msg->reserved = 0; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 22; - test_msg->sqrta = 5153.550029754639; - test_msg->tgd = -1.7695128917694092e-08; - test_msg->toc_tow = 446384.2; - test_msg->toc_wn = 2154; - test_msg->toe_tow = 446384.2; - test_msg->toe_wn = 2154; - test_msg->valid = 1; - test_msg->w = -0.9893036629599647; - - EXPECT_EQ(send_message( 0x80, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_dep_d_t *test_msg = (msg_ephemeris_dep_d_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = -0.0006315018981695175; + test_msg->af1 = 8.981260180007666e-12; + test_msg->af2 = 0.2; + test_msg->c_ic = 7.450580596923828e-09; + test_msg->c_is = -1.1548399925231934e-07; + test_msg->c_rc = 308.625; + test_msg->c_rs = -52.3125; + test_msg->c_uc = -2.7436763048171997e-06; + test_msg->c_us = 3.1366944313049316e-06; + test_msg->dn = 5.694522914022375e-09; + test_msg->ecc = 0.007072207052260637; + test_msg->healthy = 0; + test_msg->inc = 0.9341514480259797; + test_msg->inc_dot = -4.035882396415757e-11; + test_msg->iodc = 45; + test_msg->iode = 45; + test_msg->m0 = -0.02200078842114688; + test_msg->omega0 = -1.8731818448797617; + test_msg->omegadot = -8.903585155774196e-09; + test_msg->reserved = 0; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 22; + test_msg->sqrta = 5153.550029754639; + test_msg->tgd = -1.7695128917694092e-08; + test_msg->toc_tow = 446384.2; + test_msg->toc_wn = 2154; + test_msg->toe_tow = 446384.2; + test_msg->toe_wn = 2154; + test_msg->valid = 1; + test_msg->w = -0.9893036629599647; + + EXPECT_EQ(send_message(0x80, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - -0.00063150189817*100), 0.05) << "incorrect value for af0, expected -0.00063150189817, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - 8.98126018001e-12*100), 0.05) << "incorrect value for af1, expected 8.98126018001e-12, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - 0.2*100), 0.05) << "incorrect value for af2, expected 0.2, is " << last_msg_->af2; - EXPECT_LT((last_msg_->c_ic*100 - 7.45058059692e-09*100), 0.05) << "incorrect value for c_ic, expected 7.45058059692e-09, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - -1.15483999252e-07*100), 0.05) << "incorrect value for c_is, expected -1.15483999252e-07, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - 308.625*100), 0.05) << "incorrect value for c_rc, expected 308.625, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - -52.3125*100), 0.05) << "incorrect value for c_rs, expected -52.3125, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - -2.74367630482e-06*100), 0.05) << "incorrect value for c_uc, expected -2.74367630482e-06, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 3.1366944313e-06*100), 0.05) << "incorrect value for c_us, expected 3.1366944313e-06, is " << last_msg_->c_us; - EXPECT_LT((last_msg_->dn*100 - 5.69452291402e-09*100), 0.05) << "incorrect value for dn, expected 5.69452291402e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.00707220705226*100), 0.05) << "incorrect value for ecc, expected 0.00707220705226, is " << last_msg_->ecc; - EXPECT_EQ(last_msg_->healthy, 0) << "incorrect value for healthy, expected 0, is " << last_msg_->healthy; - EXPECT_LT((last_msg_->inc*100 - 0.934151448026*100), 0.05) << "incorrect value for inc, expected 0.934151448026, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - -4.03588239642e-11*100), 0.05) << "incorrect value for inc_dot, expected -4.03588239642e-11, is " << last_msg_->inc_dot; - EXPECT_EQ(last_msg_->iodc, 45) << "incorrect value for iodc, expected 45, is " << last_msg_->iodc; - EXPECT_EQ(last_msg_->iode, 45) << "incorrect value for iode, expected 45, is " << last_msg_->iode; - EXPECT_LT((last_msg_->m0*100 - -0.0220007884211*100), 0.05) << "incorrect value for m0, expected -0.0220007884211, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - -1.87318184488*100), 0.05) << "incorrect value for omega0, expected -1.87318184488, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -8.90358515577e-09*100), 0.05) << "incorrect value for omegadot, expected -8.90358515577e-09, is " << last_msg_->omegadot; - EXPECT_EQ(last_msg_->reserved, 0) << "incorrect value for reserved, expected 0, is " << last_msg_->reserved; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 22) << "incorrect value for sid.sat, expected 22, is " << last_msg_->sid.sat; - EXPECT_LT((last_msg_->sqrta*100 - 5153.55002975*100), 0.05) << "incorrect value for sqrta, expected 5153.55002975, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->tgd*100 - -1.76951289177e-08*100), 0.05) << "incorrect value for tgd, expected -1.76951289177e-08, is " << last_msg_->tgd; - EXPECT_LT((last_msg_->toc_tow*100 - 446384.2*100), 0.05) << "incorrect value for toc_tow, expected 446384.2, is " << last_msg_->toc_tow; - EXPECT_EQ(last_msg_->toc_wn, 2154) << "incorrect value for toc_wn, expected 2154, is " << last_msg_->toc_wn; - EXPECT_LT((last_msg_->toe_tow*100 - 446384.2*100), 0.05) << "incorrect value for toe_tow, expected 446384.2, is " << last_msg_->toe_tow; - EXPECT_EQ(last_msg_->toe_wn, 2154) << "incorrect value for toe_wn, expected 2154, is " << last_msg_->toe_wn; - EXPECT_EQ(last_msg_->valid, 1) << "incorrect value for valid, expected 1, is " << last_msg_->valid; - EXPECT_LT((last_msg_->w*100 - -0.98930366296*100), 0.05) << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for af0, expected -0.00063150189817, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for af1, expected 8.98126018001e-12, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - 0.2 * 100), 0.05) + << "incorrect value for af2, expected 0.2, is " << last_msg_->af2; + EXPECT_LT((last_msg_->c_ic * 100 - 7.45058059692e-09 * 100), 0.05) + << "incorrect value for c_ic, expected 7.45058059692e-09, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - -1.15483999252e-07 * 100), 0.05) + << "incorrect value for c_is, expected -1.15483999252e-07, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - 308.625 * 100), 0.05) + << "incorrect value for c_rc, expected 308.625, is " << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - -52.3125 * 100), 0.05) + << "incorrect value for c_rs, expected -52.3125, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - -2.74367630482e-06 * 100), 0.05) + << "incorrect value for c_uc, expected -2.74367630482e-06, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 3.1366944313e-06 * 100), 0.05) + << "incorrect value for c_us, expected 3.1366944313e-06, is " + << last_msg_->c_us; + EXPECT_LT((last_msg_->dn * 100 - 5.69452291402e-09 * 100), 0.05) + << "incorrect value for dn, expected 5.69452291402e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for ecc, expected 0.00707220705226, is " + << last_msg_->ecc; + EXPECT_EQ(last_msg_->healthy, 0) + << "incorrect value for healthy, expected 0, is " << last_msg_->healthy; + EXPECT_LT((last_msg_->inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for inc, expected 0.934151448026, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) + << "incorrect value for inc_dot, expected -4.03588239642e-11, is " + << last_msg_->inc_dot; + EXPECT_EQ(last_msg_->iodc, 45) + << "incorrect value for iodc, expected 45, is " << last_msg_->iodc; + EXPECT_EQ(last_msg_->iode, 45) + << "incorrect value for iode, expected 45, is " << last_msg_->iode; + EXPECT_LT((last_msg_->m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for m0, expected -0.0220007884211, is " + << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for omega0, expected -1.87318184488, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -8.90358515577e-09, is " + << last_msg_->omegadot; + EXPECT_EQ(last_msg_->reserved, 0) + << "incorrect value for reserved, expected 0, is " << last_msg_->reserved; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 22) + << "incorrect value for sid.sat, expected 22, is " << last_msg_->sid.sat; + EXPECT_LT((last_msg_->sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for sqrta, expected 5153.55002975, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->tgd * 100 - -1.76951289177e-08 * 100), 0.05) + << "incorrect value for tgd, expected -1.76951289177e-08, is " + << last_msg_->tgd; + EXPECT_LT((last_msg_->toc_tow * 100 - 446384.2 * 100), 0.05) + << "incorrect value for toc_tow, expected 446384.2, is " + << last_msg_->toc_tow; + EXPECT_EQ(last_msg_->toc_wn, 2154) + << "incorrect value for toc_wn, expected 2154, is " << last_msg_->toc_wn; + EXPECT_LT((last_msg_->toe_tow * 100 - 446384.2 * 100), 0.05) + << "incorrect value for toe_tow, expected 446384.2, is " + << last_msg_->toe_tow; + EXPECT_EQ(last_msg_->toe_wn, 2154) + << "incorrect value for toe_wn, expected 2154, is " << last_msg_->toe_wn; + EXPECT_EQ(last_msg_->valid, 1) + << "incorrect value for valid, expected 1, is " << last_msg_->valid; + EXPECT_LT((last_msg_->w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLO.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLO.cc index 689f3ac5e..dec6eb7bb 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLO.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLO.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLO.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLO.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisGLO0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisGLO0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisGLO0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisGLO0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_glo_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_glo_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,113 +81,161 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisGLO0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_glo_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGLO0, Test) -{ +}; - uint8_t encoded_frame[] = {85,139,0,10,9,92,4,3,70,197,6,0,106,8,0,0,160,64,96,9,0,0,1,0,0,0,128,43,128,97,175,184,0,0,64,177,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,122,53,0,0,122,53,0,128,59,54,14,100,89,149, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGLO0, Test) { + uint8_t encoded_frame[] = { + 85, 139, 0, 10, 9, 92, 4, 3, 70, 197, 6, 0, 106, 8, 0, + 0, 160, 64, 96, 9, 0, 0, 1, 0, 0, 0, 128, 43, 128, 97, + 175, 184, 0, 0, 64, 177, 0, 0, 128, 66, 246, 57, 103, 193, 0, + 0, 0, 34, 170, 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, + 0, 0, 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, + 192, 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 122, 53, 0, 0, + 122, 53, 0, 128, 59, 54, 14, 100, 89, 149, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_glo_t* test_msg = ( msg_ephemeris_glo_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[0] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[1] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[2] = 2.7939677238464355e-06; - test_msg->common.fit_interval = 2400; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 3; - test_msg->common.sid.sat = 4; - test_msg->common.toe.tow = 443718; - test_msg->common.toe.wn = 2154; - test_msg->common.ura = 5.0; - test_msg->common.valid = 1; - test_msg->d_tau = -2.7939677238464355e-09; - test_msg->fcn = 14; - test_msg->gamma = 9.094947017729282e-13; - test_msg->iod = 100; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[0] = -12177330.078125; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[1] = 599893.06640625; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[2] = -22373708.49609375; - test_msg->tau = -8.36281105875969e-05; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[0] = -1726.506233215332; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[1] = -2542.6149368286133; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[2] = 869.8177337646484; - - EXPECT_EQ(send_message( 0x8b, 2314, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_glo_t *test_msg = (msg_ephemeris_glo_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[0] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[1] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[2] = 2.7939677238464355e-06; + test_msg->common.fit_interval = 2400; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 3; + test_msg->common.sid.sat = 4; + test_msg->common.toe.tow = 443718; + test_msg->common.toe.wn = 2154; + test_msg->common.ura = 5.0; + test_msg->common.valid = 1; + test_msg->d_tau = -2.7939677238464355e-09; + test_msg->fcn = 14; + test_msg->gamma = 9.094947017729282e-13; + test_msg->iod = 100; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[0] = -12177330.078125; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[1] = 599893.06640625; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[2] = -22373708.49609375; + test_msg->tau = -8.36281105875969e-05; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[0] = -1726.506233215332; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[1] = -2542.6149368286133; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[2] = 869.8177337646484; + + EXPECT_EQ(send_message(0x8b, 2314, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 2314); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->acc[0]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[0], expected 9.31322574615e-07, is " << last_msg_->acc[0]; - EXPECT_LT((last_msg_->acc[1]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[1], expected 9.31322574615e-07, is " << last_msg_->acc[1]; - EXPECT_LT((last_msg_->acc[2]*100 - 2.79396772385e-06*100), 0.05) << "incorrect value for acc[2], expected 2.79396772385e-06, is " << last_msg_->acc[2]; - EXPECT_EQ(last_msg_->common.fit_interval, 2400) << "incorrect value for common.fit_interval, expected 2400, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 3) << "incorrect value for common.sid.code, expected 3, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.sat, 4) << "incorrect value for common.sid.sat, expected 4, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toe.tow, 443718) << "incorrect value for common.toe.tow, expected 443718, is " << last_msg_->common.toe.tow; - EXPECT_EQ(last_msg_->common.toe.wn, 2154) << "incorrect value for common.toe.wn, expected 2154, is " << last_msg_->common.toe.wn; - EXPECT_LT((last_msg_->common.ura*100 - 5.0*100), 0.05) << "incorrect value for common.ura, expected 5.0, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->d_tau*100 - -2.79396772385e-09*100), 0.05) << "incorrect value for d_tau, expected -2.79396772385e-09, is " << last_msg_->d_tau; - EXPECT_EQ(last_msg_->fcn, 14) << "incorrect value for fcn, expected 14, is " << last_msg_->fcn; - EXPECT_LT((last_msg_->gamma*100 - 9.09494701773e-13*100), 0.05) << "incorrect value for gamma, expected 9.09494701773e-13, is " << last_msg_->gamma; - EXPECT_EQ(last_msg_->iod, 100) << "incorrect value for iod, expected 100, is " << last_msg_->iod; - EXPECT_LT((last_msg_->pos[0]*100 - -12177330.0781*100), 0.05) << "incorrect value for pos[0], expected -12177330.0781, is " << last_msg_->pos[0]; - EXPECT_LT((last_msg_->pos[1]*100 - 599893.066406*100), 0.05) << "incorrect value for pos[1], expected 599893.066406, is " << last_msg_->pos[1]; - EXPECT_LT((last_msg_->pos[2]*100 - -22373708.4961*100), 0.05) << "incorrect value for pos[2], expected -22373708.4961, is " << last_msg_->pos[2]; - EXPECT_LT((last_msg_->tau*100 - -8.36281105876e-05*100), 0.05) << "incorrect value for tau, expected -8.36281105876e-05, is " << last_msg_->tau; - EXPECT_LT((last_msg_->vel[0]*100 - -1726.50623322*100), 0.05) << "incorrect value for vel[0], expected -1726.50623322, is " << last_msg_->vel[0]; - EXPECT_LT((last_msg_->vel[1]*100 - -2542.61493683*100), 0.05) << "incorrect value for vel[1], expected -2542.61493683, is " << last_msg_->vel[1]; - EXPECT_LT((last_msg_->vel[2]*100 - 869.817733765*100), 0.05) << "incorrect value for vel[2], expected 869.817733765, is " << last_msg_->vel[2]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 2314); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[0], expected 9.31322574615e-07, is " + << last_msg_->acc[0]; + EXPECT_LT((last_msg_->acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[1], expected 9.31322574615e-07, is " + << last_msg_->acc[1]; + EXPECT_LT((last_msg_->acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for acc[2], expected 2.79396772385e-06, is " + << last_msg_->acc[2]; + EXPECT_EQ(last_msg_->common.fit_interval, 2400) + << "incorrect value for common.fit_interval, expected 2400, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 3) + << "incorrect value for common.sid.code, expected 3, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.sat, 4) + << "incorrect value for common.sid.sat, expected 4, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toe.tow, 443718) + << "incorrect value for common.toe.tow, expected 443718, is " + << last_msg_->common.toe.tow; + EXPECT_EQ(last_msg_->common.toe.wn, 2154) + << "incorrect value for common.toe.wn, expected 2154, is " + << last_msg_->common.toe.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 5.0 * 100), 0.05) + << "incorrect value for common.ura, expected 5.0, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->d_tau * 100 - -2.79396772385e-09 * 100), 0.05) + << "incorrect value for d_tau, expected -2.79396772385e-09, is " + << last_msg_->d_tau; + EXPECT_EQ(last_msg_->fcn, 14) + << "incorrect value for fcn, expected 14, is " << last_msg_->fcn; + EXPECT_LT((last_msg_->gamma * 100 - 9.09494701773e-13 * 100), 0.05) + << "incorrect value for gamma, expected 9.09494701773e-13, is " + << last_msg_->gamma; + EXPECT_EQ(last_msg_->iod, 100) + << "incorrect value for iod, expected 100, is " << last_msg_->iod; + EXPECT_LT((last_msg_->pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for pos[0], expected -12177330.0781, is " + << last_msg_->pos[0]; + EXPECT_LT((last_msg_->pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for pos[1], expected 599893.066406, is " + << last_msg_->pos[1]; + EXPECT_LT((last_msg_->pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for pos[2], expected -22373708.4961, is " + << last_msg_->pos[2]; + EXPECT_LT((last_msg_->tau * 100 - -8.36281105876e-05 * 100), 0.05) + << "incorrect value for tau, expected -8.36281105876e-05, is " + << last_msg_->tau; + EXPECT_LT((last_msg_->vel[0] * 100 - -1726.50623322 * 100), 0.05) + << "incorrect value for vel[0], expected -1726.50623322, is " + << last_msg_->vel[0]; + EXPECT_LT((last_msg_->vel[1] * 100 - -2542.61493683 * 100), 0.05) + << "incorrect value for vel[1], expected -2542.61493683, is " + << last_msg_->vel[1]; + EXPECT_LT((last_msg_->vel[2] * 100 - 869.817733765 * 100), 0.05) + << "incorrect value for vel[2], expected 869.817733765, is " + << last_msg_->vel[2]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepA.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepA.cc index 91baee919..4cb7d98b6 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_glo_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_glo_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,109 +82,157 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_glo_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,131,0,195,4,112,4,0,3,0,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,202,238, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepA0, Test) { + uint8_t encoded_frame[] = { + 85, 131, 0, 195, 4, 112, 4, 0, 3, 0, 70, 197, 6, 0, 106, + 8, 205, 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 112, 61, 0, 0, 0, 0, 48, 236, 21, + 191, 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, + 34, 65, 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, 0, 98, 6, + 250, 154, 192, 0, 0, 0, 217, 58, 221, 163, 192, 0, 0, 0, 184, + 138, 46, 139, 64, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, + 0, 0, 64, 175, 62, 0, 0, 0, 0, 0, 112, 199, 62, 202, 238, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_glo_dep_a_t* test_msg = ( msg_ephemeris_glo_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[0] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[1] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[2] = 2.7939677238464355e-06; - test_msg->common.fit_interval = 2400; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 3; - test_msg->common.sid.reserved = 0; - test_msg->common.sid.sat = 4; - test_msg->common.toe.tow = 443718; - test_msg->common.toe.wn = 2154; - test_msg->common.ura = 5.2; - test_msg->common.valid = 1; - test_msg->gamma = 9.094947017729282e-13; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[0] = -12177330.078125; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[1] = 599893.06640625; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[2] = -22373708.49609375; - test_msg->tau = -8.36281105875969e-05; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[0] = -1726.506233215332; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[1] = -2542.6149368286133; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[2] = 869.8177337646484; - - EXPECT_EQ(send_message( 0x83, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_glo_dep_a_t *test_msg = + (msg_ephemeris_glo_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[0] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[1] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[2] = 2.7939677238464355e-06; + test_msg->common.fit_interval = 2400; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 3; + test_msg->common.sid.reserved = 0; + test_msg->common.sid.sat = 4; + test_msg->common.toe.tow = 443718; + test_msg->common.toe.wn = 2154; + test_msg->common.ura = 5.2; + test_msg->common.valid = 1; + test_msg->gamma = 9.094947017729282e-13; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[0] = -12177330.078125; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[1] = 599893.06640625; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[2] = -22373708.49609375; + test_msg->tau = -8.36281105875969e-05; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[0] = -1726.506233215332; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[1] = -2542.6149368286133; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[2] = 869.8177337646484; + + EXPECT_EQ(send_message(0x83, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->acc[0]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[0], expected 9.31322574615e-07, is " << last_msg_->acc[0]; - EXPECT_LT((last_msg_->acc[1]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[1], expected 9.31322574615e-07, is " << last_msg_->acc[1]; - EXPECT_LT((last_msg_->acc[2]*100 - 2.79396772385e-06*100), 0.05) << "incorrect value for acc[2], expected 2.79396772385e-06, is " << last_msg_->acc[2]; - EXPECT_EQ(last_msg_->common.fit_interval, 2400) << "incorrect value for common.fit_interval, expected 2400, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 3) << "incorrect value for common.sid.code, expected 3, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.reserved, 0) << "incorrect value for common.sid.reserved, expected 0, is " << last_msg_->common.sid.reserved; - EXPECT_EQ(last_msg_->common.sid.sat, 4) << "incorrect value for common.sid.sat, expected 4, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toe.tow, 443718) << "incorrect value for common.toe.tow, expected 443718, is " << last_msg_->common.toe.tow; - EXPECT_EQ(last_msg_->common.toe.wn, 2154) << "incorrect value for common.toe.wn, expected 2154, is " << last_msg_->common.toe.wn; - EXPECT_LT((last_msg_->common.ura*100 - 5.2*100), 0.05) << "incorrect value for common.ura, expected 5.2, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->gamma*100 - 9.09494701773e-13*100), 0.05) << "incorrect value for gamma, expected 9.09494701773e-13, is " << last_msg_->gamma; - EXPECT_LT((last_msg_->pos[0]*100 - -12177330.0781*100), 0.05) << "incorrect value for pos[0], expected -12177330.0781, is " << last_msg_->pos[0]; - EXPECT_LT((last_msg_->pos[1]*100 - 599893.066406*100), 0.05) << "incorrect value for pos[1], expected 599893.066406, is " << last_msg_->pos[1]; - EXPECT_LT((last_msg_->pos[2]*100 - -22373708.4961*100), 0.05) << "incorrect value for pos[2], expected -22373708.4961, is " << last_msg_->pos[2]; - EXPECT_LT((last_msg_->tau*100 - -8.36281105876e-05*100), 0.05) << "incorrect value for tau, expected -8.36281105876e-05, is " << last_msg_->tau; - EXPECT_LT((last_msg_->vel[0]*100 - -1726.50623322*100), 0.05) << "incorrect value for vel[0], expected -1726.50623322, is " << last_msg_->vel[0]; - EXPECT_LT((last_msg_->vel[1]*100 - -2542.61493683*100), 0.05) << "incorrect value for vel[1], expected -2542.61493683, is " << last_msg_->vel[1]; - EXPECT_LT((last_msg_->vel[2]*100 - 869.817733765*100), 0.05) << "incorrect value for vel[2], expected 869.817733765, is " << last_msg_->vel[2]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[0], expected 9.31322574615e-07, is " + << last_msg_->acc[0]; + EXPECT_LT((last_msg_->acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[1], expected 9.31322574615e-07, is " + << last_msg_->acc[1]; + EXPECT_LT((last_msg_->acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for acc[2], expected 2.79396772385e-06, is " + << last_msg_->acc[2]; + EXPECT_EQ(last_msg_->common.fit_interval, 2400) + << "incorrect value for common.fit_interval, expected 2400, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 3) + << "incorrect value for common.sid.code, expected 3, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.reserved, 0) + << "incorrect value for common.sid.reserved, expected 0, is " + << last_msg_->common.sid.reserved; + EXPECT_EQ(last_msg_->common.sid.sat, 4) + << "incorrect value for common.sid.sat, expected 4, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toe.tow, 443718) + << "incorrect value for common.toe.tow, expected 443718, is " + << last_msg_->common.toe.tow; + EXPECT_EQ(last_msg_->common.toe.wn, 2154) + << "incorrect value for common.toe.wn, expected 2154, is " + << last_msg_->common.toe.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 5.2 * 100), 0.05) + << "incorrect value for common.ura, expected 5.2, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->gamma * 100 - 9.09494701773e-13 * 100), 0.05) + << "incorrect value for gamma, expected 9.09494701773e-13, is " + << last_msg_->gamma; + EXPECT_LT((last_msg_->pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for pos[0], expected -12177330.0781, is " + << last_msg_->pos[0]; + EXPECT_LT((last_msg_->pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for pos[1], expected 599893.066406, is " + << last_msg_->pos[1]; + EXPECT_LT((last_msg_->pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for pos[2], expected -22373708.4961, is " + << last_msg_->pos[2]; + EXPECT_LT((last_msg_->tau * 100 - -8.36281105876e-05 * 100), 0.05) + << "incorrect value for tau, expected -8.36281105876e-05, is " + << last_msg_->tau; + EXPECT_LT((last_msg_->vel[0] * 100 - -1726.50623322 * 100), 0.05) + << "incorrect value for vel[0], expected -1726.50623322, is " + << last_msg_->vel[0]; + EXPECT_LT((last_msg_->vel[1] * 100 - -2542.61493683 * 100), 0.05) + << "incorrect value for vel[1], expected -2542.61493683, is " + << last_msg_->vel[1]; + EXPECT_LT((last_msg_->vel[2] * 100 - 869.817733765 * 100), 0.05) + << "incorrect value for vel[2], expected 869.817733765, is " + << last_msg_->vel[2]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepB.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepB.cc index 433fd4bfd..f46769d2b 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepB.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepB.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_glo_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_glo_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,107 +82,153 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_glo_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB0, Test) -{ +}; - uint8_t encoded_frame[] = {85,133,0,195,4,110,4,3,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,122,127, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepB0, Test) { + uint8_t encoded_frame[] = { + 85, 133, 0, 195, 4, 110, 4, 3, 70, 197, 6, 0, 106, 8, 205, + 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 112, 61, 0, 0, 0, 0, 48, 236, 21, 191, 0, + 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, 34, 65, + 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, 0, 98, 6, 250, 154, + 192, 0, 0, 0, 217, 58, 221, 163, 192, 0, 0, 0, 184, 138, 46, + 139, 64, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, 0, + 64, 175, 62, 0, 0, 0, 0, 0, 112, 199, 62, 122, 127, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_glo_dep_b_t* test_msg = ( msg_ephemeris_glo_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[0] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[1] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[2] = 2.7939677238464355e-06; - test_msg->common.fit_interval = 2400; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 3; - test_msg->common.sid.sat = 4; - test_msg->common.toe.tow = 443718; - test_msg->common.toe.wn = 2154; - test_msg->common.ura = 5.2; - test_msg->common.valid = 1; - test_msg->gamma = 9.094947017729282e-13; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[0] = -12177330.078125; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[1] = 599893.06640625; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[2] = -22373708.49609375; - test_msg->tau = -8.36281105875969e-05; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[0] = -1726.506233215332; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[1] = -2542.6149368286133; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[2] = 869.8177337646484; - - EXPECT_EQ(send_message( 0x85, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_glo_dep_b_t *test_msg = + (msg_ephemeris_glo_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[0] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[1] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[2] = 2.7939677238464355e-06; + test_msg->common.fit_interval = 2400; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 3; + test_msg->common.sid.sat = 4; + test_msg->common.toe.tow = 443718; + test_msg->common.toe.wn = 2154; + test_msg->common.ura = 5.2; + test_msg->common.valid = 1; + test_msg->gamma = 9.094947017729282e-13; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[0] = -12177330.078125; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[1] = 599893.06640625; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[2] = -22373708.49609375; + test_msg->tau = -8.36281105875969e-05; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[0] = -1726.506233215332; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[1] = -2542.6149368286133; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[2] = 869.8177337646484; + + EXPECT_EQ(send_message(0x85, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->acc[0]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[0], expected 9.31322574615e-07, is " << last_msg_->acc[0]; - EXPECT_LT((last_msg_->acc[1]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[1], expected 9.31322574615e-07, is " << last_msg_->acc[1]; - EXPECT_LT((last_msg_->acc[2]*100 - 2.79396772385e-06*100), 0.05) << "incorrect value for acc[2], expected 2.79396772385e-06, is " << last_msg_->acc[2]; - EXPECT_EQ(last_msg_->common.fit_interval, 2400) << "incorrect value for common.fit_interval, expected 2400, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 3) << "incorrect value for common.sid.code, expected 3, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.sat, 4) << "incorrect value for common.sid.sat, expected 4, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toe.tow, 443718) << "incorrect value for common.toe.tow, expected 443718, is " << last_msg_->common.toe.tow; - EXPECT_EQ(last_msg_->common.toe.wn, 2154) << "incorrect value for common.toe.wn, expected 2154, is " << last_msg_->common.toe.wn; - EXPECT_LT((last_msg_->common.ura*100 - 5.2*100), 0.05) << "incorrect value for common.ura, expected 5.2, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->gamma*100 - 9.09494701773e-13*100), 0.05) << "incorrect value for gamma, expected 9.09494701773e-13, is " << last_msg_->gamma; - EXPECT_LT((last_msg_->pos[0]*100 - -12177330.0781*100), 0.05) << "incorrect value for pos[0], expected -12177330.0781, is " << last_msg_->pos[0]; - EXPECT_LT((last_msg_->pos[1]*100 - 599893.066406*100), 0.05) << "incorrect value for pos[1], expected 599893.066406, is " << last_msg_->pos[1]; - EXPECT_LT((last_msg_->pos[2]*100 - -22373708.4961*100), 0.05) << "incorrect value for pos[2], expected -22373708.4961, is " << last_msg_->pos[2]; - EXPECT_LT((last_msg_->tau*100 - -8.36281105876e-05*100), 0.05) << "incorrect value for tau, expected -8.36281105876e-05, is " << last_msg_->tau; - EXPECT_LT((last_msg_->vel[0]*100 - -1726.50623322*100), 0.05) << "incorrect value for vel[0], expected -1726.50623322, is " << last_msg_->vel[0]; - EXPECT_LT((last_msg_->vel[1]*100 - -2542.61493683*100), 0.05) << "incorrect value for vel[1], expected -2542.61493683, is " << last_msg_->vel[1]; - EXPECT_LT((last_msg_->vel[2]*100 - 869.817733765*100), 0.05) << "incorrect value for vel[2], expected 869.817733765, is " << last_msg_->vel[2]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[0], expected 9.31322574615e-07, is " + << last_msg_->acc[0]; + EXPECT_LT((last_msg_->acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[1], expected 9.31322574615e-07, is " + << last_msg_->acc[1]; + EXPECT_LT((last_msg_->acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for acc[2], expected 2.79396772385e-06, is " + << last_msg_->acc[2]; + EXPECT_EQ(last_msg_->common.fit_interval, 2400) + << "incorrect value for common.fit_interval, expected 2400, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 3) + << "incorrect value for common.sid.code, expected 3, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.sat, 4) + << "incorrect value for common.sid.sat, expected 4, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toe.tow, 443718) + << "incorrect value for common.toe.tow, expected 443718, is " + << last_msg_->common.toe.tow; + EXPECT_EQ(last_msg_->common.toe.wn, 2154) + << "incorrect value for common.toe.wn, expected 2154, is " + << last_msg_->common.toe.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 5.2 * 100), 0.05) + << "incorrect value for common.ura, expected 5.2, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->gamma * 100 - 9.09494701773e-13 * 100), 0.05) + << "incorrect value for gamma, expected 9.09494701773e-13, is " + << last_msg_->gamma; + EXPECT_LT((last_msg_->pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for pos[0], expected -12177330.0781, is " + << last_msg_->pos[0]; + EXPECT_LT((last_msg_->pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for pos[1], expected 599893.066406, is " + << last_msg_->pos[1]; + EXPECT_LT((last_msg_->pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for pos[2], expected -22373708.4961, is " + << last_msg_->pos[2]; + EXPECT_LT((last_msg_->tau * 100 - -8.36281105876e-05 * 100), 0.05) + << "incorrect value for tau, expected -8.36281105876e-05, is " + << last_msg_->tau; + EXPECT_LT((last_msg_->vel[0] * 100 - -1726.50623322 * 100), 0.05) + << "incorrect value for vel[0], expected -1726.50623322, is " + << last_msg_->vel[0]; + EXPECT_LT((last_msg_->vel[1] * 100 - -2542.61493683 * 100), 0.05) + << "incorrect value for vel[1], expected -2542.61493683, is " + << last_msg_->vel[1]; + EXPECT_LT((last_msg_->vel[2] * 100 - 869.817733765 * 100), 0.05) + << "incorrect value for vel[2], expected 869.817733765, is " + << last_msg_->vel[2]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepC.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepC.cc index ab7a7d48e..ae9c84494 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepC.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepC.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepC.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_glo_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_glo_dep_c_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,111 +82,161 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_glo_dep_c_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC0, Test) -{ +}; - uint8_t encoded_frame[] = {85,135,0,195,4,119,4,3,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,0,0,0,0,40,190,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,14,151,65, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepC0, Test) { + uint8_t encoded_frame[] = { + 85, 135, 0, 195, 4, 119, 4, 3, 70, 197, 6, 0, 106, 8, 205, + 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 112, 61, 0, 0, 0, 0, 48, 236, 21, 191, 0, + 0, 0, 0, 0, 0, 40, 190, 0, 0, 128, 66, 246, 57, 103, 193, + 0, 0, 0, 34, 170, 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, + 193, 0, 0, 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, + 163, 192, 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, 0, + 64, 175, 62, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, + 0, 112, 199, 62, 14, 151, 65, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_glo_dep_c_t* test_msg = ( msg_ephemeris_glo_dep_c_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[0] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[1] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[2] = 2.7939677238464355e-06; - test_msg->common.fit_interval = 2400; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 3; - test_msg->common.sid.sat = 4; - test_msg->common.toe.tow = 443718; - test_msg->common.toe.wn = 2154; - test_msg->common.ura = 5.2; - test_msg->common.valid = 1; - test_msg->d_tau = -2.7939677238464355e-09; - test_msg->fcn = 14; - test_msg->gamma = 9.094947017729282e-13; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[0] = -12177330.078125; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[1] = 599893.06640625; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[2] = -22373708.49609375; - test_msg->tau = -8.36281105875969e-05; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[0] = -1726.506233215332; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[1] = -2542.6149368286133; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[2] = 869.8177337646484; - - EXPECT_EQ(send_message( 0x87, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_glo_dep_c_t *test_msg = + (msg_ephemeris_glo_dep_c_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[0] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[1] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[2] = 2.7939677238464355e-06; + test_msg->common.fit_interval = 2400; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 3; + test_msg->common.sid.sat = 4; + test_msg->common.toe.tow = 443718; + test_msg->common.toe.wn = 2154; + test_msg->common.ura = 5.2; + test_msg->common.valid = 1; + test_msg->d_tau = -2.7939677238464355e-09; + test_msg->fcn = 14; + test_msg->gamma = 9.094947017729282e-13; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[0] = -12177330.078125; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[1] = 599893.06640625; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[2] = -22373708.49609375; + test_msg->tau = -8.36281105875969e-05; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[0] = -1726.506233215332; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[1] = -2542.6149368286133; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[2] = 869.8177337646484; + + EXPECT_EQ(send_message(0x87, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->acc[0]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[0], expected 9.31322574615e-07, is " << last_msg_->acc[0]; - EXPECT_LT((last_msg_->acc[1]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[1], expected 9.31322574615e-07, is " << last_msg_->acc[1]; - EXPECT_LT((last_msg_->acc[2]*100 - 2.79396772385e-06*100), 0.05) << "incorrect value for acc[2], expected 2.79396772385e-06, is " << last_msg_->acc[2]; - EXPECT_EQ(last_msg_->common.fit_interval, 2400) << "incorrect value for common.fit_interval, expected 2400, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 3) << "incorrect value for common.sid.code, expected 3, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.sat, 4) << "incorrect value for common.sid.sat, expected 4, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toe.tow, 443718) << "incorrect value for common.toe.tow, expected 443718, is " << last_msg_->common.toe.tow; - EXPECT_EQ(last_msg_->common.toe.wn, 2154) << "incorrect value for common.toe.wn, expected 2154, is " << last_msg_->common.toe.wn; - EXPECT_LT((last_msg_->common.ura*100 - 5.2*100), 0.05) << "incorrect value for common.ura, expected 5.2, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->d_tau*100 - -2.79396772385e-09*100), 0.05) << "incorrect value for d_tau, expected -2.79396772385e-09, is " << last_msg_->d_tau; - EXPECT_EQ(last_msg_->fcn, 14) << "incorrect value for fcn, expected 14, is " << last_msg_->fcn; - EXPECT_LT((last_msg_->gamma*100 - 9.09494701773e-13*100), 0.05) << "incorrect value for gamma, expected 9.09494701773e-13, is " << last_msg_->gamma; - EXPECT_LT((last_msg_->pos[0]*100 - -12177330.0781*100), 0.05) << "incorrect value for pos[0], expected -12177330.0781, is " << last_msg_->pos[0]; - EXPECT_LT((last_msg_->pos[1]*100 - 599893.066406*100), 0.05) << "incorrect value for pos[1], expected 599893.066406, is " << last_msg_->pos[1]; - EXPECT_LT((last_msg_->pos[2]*100 - -22373708.4961*100), 0.05) << "incorrect value for pos[2], expected -22373708.4961, is " << last_msg_->pos[2]; - EXPECT_LT((last_msg_->tau*100 - -8.36281105876e-05*100), 0.05) << "incorrect value for tau, expected -8.36281105876e-05, is " << last_msg_->tau; - EXPECT_LT((last_msg_->vel[0]*100 - -1726.50623322*100), 0.05) << "incorrect value for vel[0], expected -1726.50623322, is " << last_msg_->vel[0]; - EXPECT_LT((last_msg_->vel[1]*100 - -2542.61493683*100), 0.05) << "incorrect value for vel[1], expected -2542.61493683, is " << last_msg_->vel[1]; - EXPECT_LT((last_msg_->vel[2]*100 - 869.817733765*100), 0.05) << "incorrect value for vel[2], expected 869.817733765, is " << last_msg_->vel[2]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[0], expected 9.31322574615e-07, is " + << last_msg_->acc[0]; + EXPECT_LT((last_msg_->acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[1], expected 9.31322574615e-07, is " + << last_msg_->acc[1]; + EXPECT_LT((last_msg_->acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for acc[2], expected 2.79396772385e-06, is " + << last_msg_->acc[2]; + EXPECT_EQ(last_msg_->common.fit_interval, 2400) + << "incorrect value for common.fit_interval, expected 2400, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 3) + << "incorrect value for common.sid.code, expected 3, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.sat, 4) + << "incorrect value for common.sid.sat, expected 4, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toe.tow, 443718) + << "incorrect value for common.toe.tow, expected 443718, is " + << last_msg_->common.toe.tow; + EXPECT_EQ(last_msg_->common.toe.wn, 2154) + << "incorrect value for common.toe.wn, expected 2154, is " + << last_msg_->common.toe.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 5.2 * 100), 0.05) + << "incorrect value for common.ura, expected 5.2, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->d_tau * 100 - -2.79396772385e-09 * 100), 0.05) + << "incorrect value for d_tau, expected -2.79396772385e-09, is " + << last_msg_->d_tau; + EXPECT_EQ(last_msg_->fcn, 14) + << "incorrect value for fcn, expected 14, is " << last_msg_->fcn; + EXPECT_LT((last_msg_->gamma * 100 - 9.09494701773e-13 * 100), 0.05) + << "incorrect value for gamma, expected 9.09494701773e-13, is " + << last_msg_->gamma; + EXPECT_LT((last_msg_->pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for pos[0], expected -12177330.0781, is " + << last_msg_->pos[0]; + EXPECT_LT((last_msg_->pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for pos[1], expected 599893.066406, is " + << last_msg_->pos[1]; + EXPECT_LT((last_msg_->pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for pos[2], expected -22373708.4961, is " + << last_msg_->pos[2]; + EXPECT_LT((last_msg_->tau * 100 - -8.36281105876e-05 * 100), 0.05) + << "incorrect value for tau, expected -8.36281105876e-05, is " + << last_msg_->tau; + EXPECT_LT((last_msg_->vel[0] * 100 - -1726.50623322 * 100), 0.05) + << "incorrect value for vel[0], expected -1726.50623322, is " + << last_msg_->vel[0]; + EXPECT_LT((last_msg_->vel[1] * 100 - -2542.61493683 * 100), 0.05) + << "incorrect value for vel[1], expected -2542.61493683, is " + << last_msg_->vel[1]; + EXPECT_LT((last_msg_->vel[2] * 100 - 869.817733765 * 100), 0.05) + << "incorrect value for vel[2], expected 869.817733765, is " + << last_msg_->vel[2]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepD.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepD.cc index d6d581e07..94d9775d5 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepD.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGLODepD.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepD.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGLODepD.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_glo_dep_d_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_glo_dep_d_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,113 +82,164 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_glo_dep_d_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD0, Test) -{ +}; - uint8_t encoded_frame[] = {85,136,0,195,4,120,4,3,70,197,6,0,106,8,205,204,204,204,204,204,20,64,96,9,0,0,1,0,0,0,0,0,0,0,112,61,0,0,0,0,48,236,21,191,0,0,0,0,0,0,40,190,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,14,100,82,64, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGLODepD0, Test) { + uint8_t encoded_frame[] = { + 85, 136, 0, 195, 4, 120, 4, 3, 70, 197, 6, 0, 106, 8, 205, + 204, 204, 204, 204, 204, 20, 64, 96, 9, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 112, 61, 0, 0, 0, 0, 48, 236, 21, 191, 0, + 0, 0, 0, 0, 0, 40, 190, 0, 0, 128, 66, 246, 57, 103, 193, + 0, 0, 0, 34, 170, 78, 34, 65, 0, 0, 240, 199, 84, 86, 117, + 193, 0, 0, 0, 98, 6, 250, 154, 192, 0, 0, 0, 217, 58, 221, + 163, 192, 0, 0, 0, 184, 138, 46, 139, 64, 0, 0, 0, 0, 0, + 64, 175, 62, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, + 0, 112, 199, 62, 14, 100, 82, 64, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_glo_dep_d_t* test_msg = ( msg_ephemeris_glo_dep_d_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[0] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[1] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[2] = 2.7939677238464355e-06; - test_msg->common.fit_interval = 2400; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 3; - test_msg->common.sid.sat = 4; - test_msg->common.toe.tow = 443718; - test_msg->common.toe.wn = 2154; - test_msg->common.ura = 5.2; - test_msg->common.valid = 1; - test_msg->d_tau = -2.7939677238464355e-09; - test_msg->fcn = 14; - test_msg->gamma = 9.094947017729282e-13; - test_msg->iod = 100; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[0] = -12177330.078125; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[1] = 599893.06640625; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[2] = -22373708.49609375; - test_msg->tau = -8.36281105875969e-05; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[0] = -1726.506233215332; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[1] = -2542.6149368286133; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[2] = 869.8177337646484; - - EXPECT_EQ(send_message( 0x88, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_glo_dep_d_t *test_msg = + (msg_ephemeris_glo_dep_d_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[0] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[1] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[2] = 2.7939677238464355e-06; + test_msg->common.fit_interval = 2400; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 3; + test_msg->common.sid.sat = 4; + test_msg->common.toe.tow = 443718; + test_msg->common.toe.wn = 2154; + test_msg->common.ura = 5.2; + test_msg->common.valid = 1; + test_msg->d_tau = -2.7939677238464355e-09; + test_msg->fcn = 14; + test_msg->gamma = 9.094947017729282e-13; + test_msg->iod = 100; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[0] = -12177330.078125; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[1] = 599893.06640625; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[2] = -22373708.49609375; + test_msg->tau = -8.36281105875969e-05; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[0] = -1726.506233215332; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[1] = -2542.6149368286133; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[2] = 869.8177337646484; + + EXPECT_EQ(send_message(0x88, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->acc[0]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[0], expected 9.31322574615e-07, is " << last_msg_->acc[0]; - EXPECT_LT((last_msg_->acc[1]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[1], expected 9.31322574615e-07, is " << last_msg_->acc[1]; - EXPECT_LT((last_msg_->acc[2]*100 - 2.79396772385e-06*100), 0.05) << "incorrect value for acc[2], expected 2.79396772385e-06, is " << last_msg_->acc[2]; - EXPECT_EQ(last_msg_->common.fit_interval, 2400) << "incorrect value for common.fit_interval, expected 2400, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 3) << "incorrect value for common.sid.code, expected 3, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.sat, 4) << "incorrect value for common.sid.sat, expected 4, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toe.tow, 443718) << "incorrect value for common.toe.tow, expected 443718, is " << last_msg_->common.toe.tow; - EXPECT_EQ(last_msg_->common.toe.wn, 2154) << "incorrect value for common.toe.wn, expected 2154, is " << last_msg_->common.toe.wn; - EXPECT_LT((last_msg_->common.ura*100 - 5.2*100), 0.05) << "incorrect value for common.ura, expected 5.2, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->d_tau*100 - -2.79396772385e-09*100), 0.05) << "incorrect value for d_tau, expected -2.79396772385e-09, is " << last_msg_->d_tau; - EXPECT_EQ(last_msg_->fcn, 14) << "incorrect value for fcn, expected 14, is " << last_msg_->fcn; - EXPECT_LT((last_msg_->gamma*100 - 9.09494701773e-13*100), 0.05) << "incorrect value for gamma, expected 9.09494701773e-13, is " << last_msg_->gamma; - EXPECT_EQ(last_msg_->iod, 100) << "incorrect value for iod, expected 100, is " << last_msg_->iod; - EXPECT_LT((last_msg_->pos[0]*100 - -12177330.0781*100), 0.05) << "incorrect value for pos[0], expected -12177330.0781, is " << last_msg_->pos[0]; - EXPECT_LT((last_msg_->pos[1]*100 - 599893.066406*100), 0.05) << "incorrect value for pos[1], expected 599893.066406, is " << last_msg_->pos[1]; - EXPECT_LT((last_msg_->pos[2]*100 - -22373708.4961*100), 0.05) << "incorrect value for pos[2], expected -22373708.4961, is " << last_msg_->pos[2]; - EXPECT_LT((last_msg_->tau*100 - -8.36281105876e-05*100), 0.05) << "incorrect value for tau, expected -8.36281105876e-05, is " << last_msg_->tau; - EXPECT_LT((last_msg_->vel[0]*100 - -1726.50623322*100), 0.05) << "incorrect value for vel[0], expected -1726.50623322, is " << last_msg_->vel[0]; - EXPECT_LT((last_msg_->vel[1]*100 - -2542.61493683*100), 0.05) << "incorrect value for vel[1], expected -2542.61493683, is " << last_msg_->vel[1]; - EXPECT_LT((last_msg_->vel[2]*100 - 869.817733765*100), 0.05) << "incorrect value for vel[2], expected 869.817733765, is " << last_msg_->vel[2]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[0], expected 9.31322574615e-07, is " + << last_msg_->acc[0]; + EXPECT_LT((last_msg_->acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[1], expected 9.31322574615e-07, is " + << last_msg_->acc[1]; + EXPECT_LT((last_msg_->acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for acc[2], expected 2.79396772385e-06, is " + << last_msg_->acc[2]; + EXPECT_EQ(last_msg_->common.fit_interval, 2400) + << "incorrect value for common.fit_interval, expected 2400, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 3) + << "incorrect value for common.sid.code, expected 3, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.sat, 4) + << "incorrect value for common.sid.sat, expected 4, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toe.tow, 443718) + << "incorrect value for common.toe.tow, expected 443718, is " + << last_msg_->common.toe.tow; + EXPECT_EQ(last_msg_->common.toe.wn, 2154) + << "incorrect value for common.toe.wn, expected 2154, is " + << last_msg_->common.toe.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 5.2 * 100), 0.05) + << "incorrect value for common.ura, expected 5.2, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->d_tau * 100 - -2.79396772385e-09 * 100), 0.05) + << "incorrect value for d_tau, expected -2.79396772385e-09, is " + << last_msg_->d_tau; + EXPECT_EQ(last_msg_->fcn, 14) + << "incorrect value for fcn, expected 14, is " << last_msg_->fcn; + EXPECT_LT((last_msg_->gamma * 100 - 9.09494701773e-13 * 100), 0.05) + << "incorrect value for gamma, expected 9.09494701773e-13, is " + << last_msg_->gamma; + EXPECT_EQ(last_msg_->iod, 100) + << "incorrect value for iod, expected 100, is " << last_msg_->iod; + EXPECT_LT((last_msg_->pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for pos[0], expected -12177330.0781, is " + << last_msg_->pos[0]; + EXPECT_LT((last_msg_->pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for pos[1], expected 599893.066406, is " + << last_msg_->pos[1]; + EXPECT_LT((last_msg_->pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for pos[2], expected -22373708.4961, is " + << last_msg_->pos[2]; + EXPECT_LT((last_msg_->tau * 100 - -8.36281105876e-05 * 100), 0.05) + << "incorrect value for tau, expected -8.36281105876e-05, is " + << last_msg_->tau; + EXPECT_LT((last_msg_->vel[0] * 100 - -1726.50623322 * 100), 0.05) + << "incorrect value for vel[0], expected -1726.50623322, is " + << last_msg_->vel[0]; + EXPECT_LT((last_msg_->vel[1] * 100 - -2542.61493683 * 100), 0.05) + << "incorrect value for vel[1], expected -2542.61493683, is " + << last_msg_->vel[1]; + EXPECT_LT((last_msg_->vel[2] * 100 - 869.817733765 * 100), 0.05) + << "incorrect value for vel[2], expected 869.817733765, is " + << last_msg_->vel[2]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGPS.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGPS.cc index 42910c335..f381b413e 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGPS.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGPS.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPS.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPS.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisGPS0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisGPS0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisGPS0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisGPS0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_gps_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_gps_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,95 +81,159 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisGPS0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_gps_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGPS0, Test) -{ +}; - uint8_t encoded_frame[] = {85,138,0,10,9,139,22,0,176,207,6,0,106,8,0,0,0,64,64,56,0,0,1,0,0,0,152,178,0,64,81,194,0,80,154,67,0,32,56,182,0,128,82,54,0,0,0,50,0,0,248,179,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,96,139,37,186,0,0,30,45,0,0,0,0,176,207,6,0,106,8,45,45,0,170,4, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGPS0, Test) { + uint8_t encoded_frame[] = { + 85, 138, 0, 10, 9, 139, 22, 0, 176, 207, 6, 0, 106, 8, 0, + 0, 0, 64, 64, 56, 0, 0, 1, 0, 0, 0, 152, 178, 0, 64, + 81, 194, 0, 80, 154, 67, 0, 32, 56, 182, 0, 128, 82, 54, 0, + 0, 0, 50, 0, 0, 248, 179, 114, 216, 96, 180, 49, 117, 56, 62, + 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, 247, 124, + 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, 141, 248, + 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, 199, 39, 96, + 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, 221, 47, 100, 224, + 255, 47, 198, 189, 96, 139, 37, 186, 0, 0, 30, 45, 0, 0, 0, + 0, 176, 207, 6, 0, 106, 8, 45, 45, 0, 170, 4, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_gps_t* test_msg = ( msg_ephemeris_gps_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = -0.0006315018981695175; - test_msg->af1 = 8.981260180007666e-12; - test_msg->af2 = 0.0; - test_msg->c_ic = 7.450580596923828e-09; - test_msg->c_is = -1.1548399925231934e-07; - test_msg->c_rc = 308.625; - test_msg->c_rs = -52.3125; - test_msg->c_uc = -2.7436763048171997e-06; - test_msg->c_us = 3.1366944313049316e-06; - test_msg->common.fit_interval = 14400; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 0; - test_msg->common.sid.sat = 22; - test_msg->common.toe.tow = 446384; - test_msg->common.toe.wn = 2154; - test_msg->common.ura = 2.0; - test_msg->common.valid = 1; - test_msg->dn = 5.694522914022375e-09; - test_msg->ecc = 0.007072207052260637; - test_msg->inc = 0.9341514480259797; - test_msg->inc_dot = -4.035882396415757e-11; - test_msg->iodc = 45; - test_msg->iode = 45; - test_msg->m0 = -0.02200078842114688; - test_msg->omega0 = -1.8731818448797617; - test_msg->omegadot = -8.903585155774196e-09; - test_msg->sqrta = 5153.550029754639; - test_msg->tgd = -1.7695128917694092e-08; - test_msg->toc.tow = 446384; - test_msg->toc.wn = 2154; - test_msg->w = -0.9893036629599647; - - EXPECT_EQ(send_message( 0x8a, 2314, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_gps_t *test_msg = (msg_ephemeris_gps_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = -0.0006315018981695175; + test_msg->af1 = 8.981260180007666e-12; + test_msg->af2 = 0.0; + test_msg->c_ic = 7.450580596923828e-09; + test_msg->c_is = -1.1548399925231934e-07; + test_msg->c_rc = 308.625; + test_msg->c_rs = -52.3125; + test_msg->c_uc = -2.7436763048171997e-06; + test_msg->c_us = 3.1366944313049316e-06; + test_msg->common.fit_interval = 14400; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 0; + test_msg->common.sid.sat = 22; + test_msg->common.toe.tow = 446384; + test_msg->common.toe.wn = 2154; + test_msg->common.ura = 2.0; + test_msg->common.valid = 1; + test_msg->dn = 5.694522914022375e-09; + test_msg->ecc = 0.007072207052260637; + test_msg->inc = 0.9341514480259797; + test_msg->inc_dot = -4.035882396415757e-11; + test_msg->iodc = 45; + test_msg->iode = 45; + test_msg->m0 = -0.02200078842114688; + test_msg->omega0 = -1.8731818448797617; + test_msg->omegadot = -8.903585155774196e-09; + test_msg->sqrta = 5153.550029754639; + test_msg->tgd = -1.7695128917694092e-08; + test_msg->toc.tow = 446384; + test_msg->toc.wn = 2154; + test_msg->w = -0.9893036629599647; + + EXPECT_EQ(send_message(0x8a, 2314, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 2314); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - -0.00063150189817*100), 0.05) << "incorrect value for af0, expected -0.00063150189817, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - 8.98126018001e-12*100), 0.05) << "incorrect value for af1, expected 8.98126018001e-12, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - 0.0*100), 0.05) << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; - EXPECT_LT((last_msg_->c_ic*100 - 7.45058059692e-09*100), 0.05) << "incorrect value for c_ic, expected 7.45058059692e-09, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - -1.15483999252e-07*100), 0.05) << "incorrect value for c_is, expected -1.15483999252e-07, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - 308.625*100), 0.05) << "incorrect value for c_rc, expected 308.625, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - -52.3125*100), 0.05) << "incorrect value for c_rs, expected -52.3125, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - -2.74367630482e-06*100), 0.05) << "incorrect value for c_uc, expected -2.74367630482e-06, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 3.1366944313e-06*100), 0.05) << "incorrect value for c_us, expected 3.1366944313e-06, is " << last_msg_->c_us; - EXPECT_EQ(last_msg_->common.fit_interval, 14400) << "incorrect value for common.fit_interval, expected 14400, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 0) << "incorrect value for common.sid.code, expected 0, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.sat, 22) << "incorrect value for common.sid.sat, expected 22, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toe.tow, 446384) << "incorrect value for common.toe.tow, expected 446384, is " << last_msg_->common.toe.tow; - EXPECT_EQ(last_msg_->common.toe.wn, 2154) << "incorrect value for common.toe.wn, expected 2154, is " << last_msg_->common.toe.wn; - EXPECT_LT((last_msg_->common.ura*100 - 2.0*100), 0.05) << "incorrect value for common.ura, expected 2.0, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->dn*100 - 5.69452291402e-09*100), 0.05) << "incorrect value for dn, expected 5.69452291402e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.00707220705226*100), 0.05) << "incorrect value for ecc, expected 0.00707220705226, is " << last_msg_->ecc; - EXPECT_LT((last_msg_->inc*100 - 0.934151448026*100), 0.05) << "incorrect value for inc, expected 0.934151448026, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - -4.03588239642e-11*100), 0.05) << "incorrect value for inc_dot, expected -4.03588239642e-11, is " << last_msg_->inc_dot; - EXPECT_EQ(last_msg_->iodc, 45) << "incorrect value for iodc, expected 45, is " << last_msg_->iodc; - EXPECT_EQ(last_msg_->iode, 45) << "incorrect value for iode, expected 45, is " << last_msg_->iode; - EXPECT_LT((last_msg_->m0*100 - -0.0220007884211*100), 0.05) << "incorrect value for m0, expected -0.0220007884211, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - -1.87318184488*100), 0.05) << "incorrect value for omega0, expected -1.87318184488, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -8.90358515577e-09*100), 0.05) << "incorrect value for omegadot, expected -8.90358515577e-09, is " << last_msg_->omegadot; - EXPECT_LT((last_msg_->sqrta*100 - 5153.55002975*100), 0.05) << "incorrect value for sqrta, expected 5153.55002975, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->tgd*100 - -1.76951289177e-08*100), 0.05) << "incorrect value for tgd, expected -1.76951289177e-08, is " << last_msg_->tgd; - EXPECT_EQ(last_msg_->toc.tow, 446384) << "incorrect value for toc.tow, expected 446384, is " << last_msg_->toc.tow; - EXPECT_EQ(last_msg_->toc.wn, 2154) << "incorrect value for toc.wn, expected 2154, is " << last_msg_->toc.wn; - EXPECT_LT((last_msg_->w*100 - -0.98930366296*100), 0.05) << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 2314); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for af0, expected -0.00063150189817, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for af1, expected 8.98126018001e-12, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; + EXPECT_LT((last_msg_->c_ic * 100 - 7.45058059692e-09 * 100), 0.05) + << "incorrect value for c_ic, expected 7.45058059692e-09, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - -1.15483999252e-07 * 100), 0.05) + << "incorrect value for c_is, expected -1.15483999252e-07, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - 308.625 * 100), 0.05) + << "incorrect value for c_rc, expected 308.625, is " << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - -52.3125 * 100), 0.05) + << "incorrect value for c_rs, expected -52.3125, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - -2.74367630482e-06 * 100), 0.05) + << "incorrect value for c_uc, expected -2.74367630482e-06, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 3.1366944313e-06 * 100), 0.05) + << "incorrect value for c_us, expected 3.1366944313e-06, is " + << last_msg_->c_us; + EXPECT_EQ(last_msg_->common.fit_interval, 14400) + << "incorrect value for common.fit_interval, expected 14400, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 0) + << "incorrect value for common.sid.code, expected 0, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.sat, 22) + << "incorrect value for common.sid.sat, expected 22, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toe.tow, 446384) + << "incorrect value for common.toe.tow, expected 446384, is " + << last_msg_->common.toe.tow; + EXPECT_EQ(last_msg_->common.toe.wn, 2154) + << "incorrect value for common.toe.wn, expected 2154, is " + << last_msg_->common.toe.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 2.0 * 100), 0.05) + << "incorrect value for common.ura, expected 2.0, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->dn * 100 - 5.69452291402e-09 * 100), 0.05) + << "incorrect value for dn, expected 5.69452291402e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for ecc, expected 0.00707220705226, is " + << last_msg_->ecc; + EXPECT_LT((last_msg_->inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for inc, expected 0.934151448026, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) + << "incorrect value for inc_dot, expected -4.03588239642e-11, is " + << last_msg_->inc_dot; + EXPECT_EQ(last_msg_->iodc, 45) + << "incorrect value for iodc, expected 45, is " << last_msg_->iodc; + EXPECT_EQ(last_msg_->iode, 45) + << "incorrect value for iode, expected 45, is " << last_msg_->iode; + EXPECT_LT((last_msg_->m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for m0, expected -0.0220007884211, is " + << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for omega0, expected -1.87318184488, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -8.90358515577e-09, is " + << last_msg_->omegadot; + EXPECT_LT((last_msg_->sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for sqrta, expected 5153.55002975, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->tgd * 100 - -1.76951289177e-08 * 100), 0.05) + << "incorrect value for tgd, expected -1.76951289177e-08, is " + << last_msg_->tgd; + EXPECT_EQ(last_msg_->toc.tow, 446384) + << "incorrect value for toc.tow, expected 446384, is " + << last_msg_->toc.tow; + EXPECT_EQ(last_msg_->toc.wn, 2154) + << "incorrect value for toc.wn, expected 2154, is " << last_msg_->toc.wn; + EXPECT_LT((last_msg_->w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepE.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepE.cc index 83bba11e8..5abc367e9 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepE.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepE.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepE.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepE.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_gps_dep_e_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_gps_dep_e_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,97 +82,167 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_gps_dep_e_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE0, Test) -{ +}; - uint8_t encoded_frame[] = {85,129,0,123,0,185,22,0,0,0,176,207,6,0,106,8,0,0,0,0,0,0,0,64,64,56,0,0,1,0,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,0,0,0,0,0,0,0,0,176,207,6,0,106,8,45,45,0,6,238, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepE0, Test) { + uint8_t encoded_frame[] = { + 85, 129, 0, 123, 0, 185, 22, 0, 0, 0, 176, 207, 6, 0, 106, + 8, 0, 0, 0, 0, 0, 0, 0, 64, 64, 56, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 83, 190, 0, 0, 0, 0, 0, 40, 74, + 192, 0, 0, 0, 0, 0, 74, 115, 64, 0, 0, 0, 0, 0, 4, + 199, 190, 0, 0, 0, 0, 0, 80, 202, 62, 0, 0, 0, 0, 0, + 0, 64, 62, 0, 0, 0, 0, 0, 0, 127, 190, 114, 216, 96, 180, + 49, 117, 56, 62, 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, + 32, 191, 247, 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, + 179, 134, 141, 248, 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, + 59, 199, 39, 96, 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, + 221, 47, 100, 224, 255, 47, 198, 189, 0, 0, 0, 0, 108, 177, 68, + 191, 0, 0, 0, 0, 0, 192, 163, 61, 0, 0, 0, 0, 0, 0, + 0, 0, 176, 207, 6, 0, 106, 8, 45, 45, 0, 6, 238, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_gps_dep_e_t* test_msg = ( msg_ephemeris_gps_dep_e_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = -0.0006315018981695175; - test_msg->af1 = 8.981260180007666e-12; - test_msg->af2 = 0.0; - test_msg->c_ic = 7.450580596923828e-09; - test_msg->c_is = -1.1548399925231934e-07; - test_msg->c_rc = 308.625; - test_msg->c_rs = -52.3125; - test_msg->c_uc = -2.7436763048171997e-06; - test_msg->c_us = 3.1366944313049316e-06; - test_msg->common.fit_interval = 14400; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 0; - test_msg->common.sid.reserved = 0; - test_msg->common.sid.sat = 22; - test_msg->common.toe.tow = 446384; - test_msg->common.toe.wn = 2154; - test_msg->common.ura = 2.0; - test_msg->common.valid = 1; - test_msg->dn = 5.694522914022375e-09; - test_msg->ecc = 0.007072207052260637; - test_msg->inc = 0.9341514480259797; - test_msg->inc_dot = -4.035882396415757e-11; - test_msg->iodc = 45; - test_msg->iode = 45; - test_msg->m0 = -0.02200078842114688; - test_msg->omega0 = -1.8731818448797617; - test_msg->omegadot = -8.903585155774196e-09; - test_msg->sqrta = 5153.550029754639; - test_msg->tgd = -1.7695128917694092e-08; - test_msg->toc.tow = 446384; - test_msg->toc.wn = 2154; - test_msg->w = -0.9893036629599647; - - EXPECT_EQ(send_message( 0x81, 123, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_gps_dep_e_t *test_msg = + (msg_ephemeris_gps_dep_e_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = -0.0006315018981695175; + test_msg->af1 = 8.981260180007666e-12; + test_msg->af2 = 0.0; + test_msg->c_ic = 7.450580596923828e-09; + test_msg->c_is = -1.1548399925231934e-07; + test_msg->c_rc = 308.625; + test_msg->c_rs = -52.3125; + test_msg->c_uc = -2.7436763048171997e-06; + test_msg->c_us = 3.1366944313049316e-06; + test_msg->common.fit_interval = 14400; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 0; + test_msg->common.sid.reserved = 0; + test_msg->common.sid.sat = 22; + test_msg->common.toe.tow = 446384; + test_msg->common.toe.wn = 2154; + test_msg->common.ura = 2.0; + test_msg->common.valid = 1; + test_msg->dn = 5.694522914022375e-09; + test_msg->ecc = 0.007072207052260637; + test_msg->inc = 0.9341514480259797; + test_msg->inc_dot = -4.035882396415757e-11; + test_msg->iodc = 45; + test_msg->iode = 45; + test_msg->m0 = -0.02200078842114688; + test_msg->omega0 = -1.8731818448797617; + test_msg->omegadot = -8.903585155774196e-09; + test_msg->sqrta = 5153.550029754639; + test_msg->tgd = -1.7695128917694092e-08; + test_msg->toc.tow = 446384; + test_msg->toc.wn = 2154; + test_msg->w = -0.9893036629599647; + + EXPECT_EQ(send_message(0x81, 123, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - -0.00063150189817*100), 0.05) << "incorrect value for af0, expected -0.00063150189817, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - 8.98126018001e-12*100), 0.05) << "incorrect value for af1, expected 8.98126018001e-12, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - 0.0*100), 0.05) << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; - EXPECT_LT((last_msg_->c_ic*100 - 7.45058059692e-09*100), 0.05) << "incorrect value for c_ic, expected 7.45058059692e-09, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - -1.15483999252e-07*100), 0.05) << "incorrect value for c_is, expected -1.15483999252e-07, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - 308.625*100), 0.05) << "incorrect value for c_rc, expected 308.625, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - -52.3125*100), 0.05) << "incorrect value for c_rs, expected -52.3125, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - -2.74367630482e-06*100), 0.05) << "incorrect value for c_uc, expected -2.74367630482e-06, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 3.1366944313e-06*100), 0.05) << "incorrect value for c_us, expected 3.1366944313e-06, is " << last_msg_->c_us; - EXPECT_EQ(last_msg_->common.fit_interval, 14400) << "incorrect value for common.fit_interval, expected 14400, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 0) << "incorrect value for common.sid.code, expected 0, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.reserved, 0) << "incorrect value for common.sid.reserved, expected 0, is " << last_msg_->common.sid.reserved; - EXPECT_EQ(last_msg_->common.sid.sat, 22) << "incorrect value for common.sid.sat, expected 22, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toe.tow, 446384) << "incorrect value for common.toe.tow, expected 446384, is " << last_msg_->common.toe.tow; - EXPECT_EQ(last_msg_->common.toe.wn, 2154) << "incorrect value for common.toe.wn, expected 2154, is " << last_msg_->common.toe.wn; - EXPECT_LT((last_msg_->common.ura*100 - 2.0*100), 0.05) << "incorrect value for common.ura, expected 2.0, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->dn*100 - 5.69452291402e-09*100), 0.05) << "incorrect value for dn, expected 5.69452291402e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.00707220705226*100), 0.05) << "incorrect value for ecc, expected 0.00707220705226, is " << last_msg_->ecc; - EXPECT_LT((last_msg_->inc*100 - 0.934151448026*100), 0.05) << "incorrect value for inc, expected 0.934151448026, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - -4.03588239642e-11*100), 0.05) << "incorrect value for inc_dot, expected -4.03588239642e-11, is " << last_msg_->inc_dot; - EXPECT_EQ(last_msg_->iodc, 45) << "incorrect value for iodc, expected 45, is " << last_msg_->iodc; - EXPECT_EQ(last_msg_->iode, 45) << "incorrect value for iode, expected 45, is " << last_msg_->iode; - EXPECT_LT((last_msg_->m0*100 - -0.0220007884211*100), 0.05) << "incorrect value for m0, expected -0.0220007884211, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - -1.87318184488*100), 0.05) << "incorrect value for omega0, expected -1.87318184488, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -8.90358515577e-09*100), 0.05) << "incorrect value for omegadot, expected -8.90358515577e-09, is " << last_msg_->omegadot; - EXPECT_LT((last_msg_->sqrta*100 - 5153.55002975*100), 0.05) << "incorrect value for sqrta, expected 5153.55002975, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->tgd*100 - -1.76951289177e-08*100), 0.05) << "incorrect value for tgd, expected -1.76951289177e-08, is " << last_msg_->tgd; - EXPECT_EQ(last_msg_->toc.tow, 446384) << "incorrect value for toc.tow, expected 446384, is " << last_msg_->toc.tow; - EXPECT_EQ(last_msg_->toc.wn, 2154) << "incorrect value for toc.wn, expected 2154, is " << last_msg_->toc.wn; - EXPECT_LT((last_msg_->w*100 - -0.98930366296*100), 0.05) << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for af0, expected -0.00063150189817, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for af1, expected 8.98126018001e-12, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; + EXPECT_LT((last_msg_->c_ic * 100 - 7.45058059692e-09 * 100), 0.05) + << "incorrect value for c_ic, expected 7.45058059692e-09, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - -1.15483999252e-07 * 100), 0.05) + << "incorrect value for c_is, expected -1.15483999252e-07, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - 308.625 * 100), 0.05) + << "incorrect value for c_rc, expected 308.625, is " << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - -52.3125 * 100), 0.05) + << "incorrect value for c_rs, expected -52.3125, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - -2.74367630482e-06 * 100), 0.05) + << "incorrect value for c_uc, expected -2.74367630482e-06, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 3.1366944313e-06 * 100), 0.05) + << "incorrect value for c_us, expected 3.1366944313e-06, is " + << last_msg_->c_us; + EXPECT_EQ(last_msg_->common.fit_interval, 14400) + << "incorrect value for common.fit_interval, expected 14400, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 0) + << "incorrect value for common.sid.code, expected 0, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.reserved, 0) + << "incorrect value for common.sid.reserved, expected 0, is " + << last_msg_->common.sid.reserved; + EXPECT_EQ(last_msg_->common.sid.sat, 22) + << "incorrect value for common.sid.sat, expected 22, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toe.tow, 446384) + << "incorrect value for common.toe.tow, expected 446384, is " + << last_msg_->common.toe.tow; + EXPECT_EQ(last_msg_->common.toe.wn, 2154) + << "incorrect value for common.toe.wn, expected 2154, is " + << last_msg_->common.toe.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 2.0 * 100), 0.05) + << "incorrect value for common.ura, expected 2.0, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->dn * 100 - 5.69452291402e-09 * 100), 0.05) + << "incorrect value for dn, expected 5.69452291402e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for ecc, expected 0.00707220705226, is " + << last_msg_->ecc; + EXPECT_LT((last_msg_->inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for inc, expected 0.934151448026, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) + << "incorrect value for inc_dot, expected -4.03588239642e-11, is " + << last_msg_->inc_dot; + EXPECT_EQ(last_msg_->iodc, 45) + << "incorrect value for iodc, expected 45, is " << last_msg_->iodc; + EXPECT_EQ(last_msg_->iode, 45) + << "incorrect value for iode, expected 45, is " << last_msg_->iode; + EXPECT_LT((last_msg_->m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for m0, expected -0.0220007884211, is " + << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for omega0, expected -1.87318184488, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -8.90358515577e-09, is " + << last_msg_->omegadot; + EXPECT_LT((last_msg_->sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for sqrta, expected 5153.55002975, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->tgd * 100 - -1.76951289177e-08 * 100), 0.05) + << "incorrect value for tgd, expected -1.76951289177e-08, is " + << last_msg_->tgd; + EXPECT_EQ(last_msg_->toc.tow, 446384) + << "incorrect value for toc.tow, expected 446384, is " + << last_msg_->toc.tow; + EXPECT_EQ(last_msg_->toc.wn, 2154) + << "incorrect value for toc.wn, expected 2154, is " << last_msg_->toc.wn; + EXPECT_LT((last_msg_->w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepF.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepF.cc index b2b7a584d..682623f61 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepF.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGPSDepF.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepF.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGPSDepF.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_gps_dep_f_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_gps_dep_f_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,95 +82,163 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_gps_dep_f_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF0, Test) -{ +}; - uint8_t encoded_frame[] = {85,134,0,123,0,183,22,0,176,207,6,0,106,8,0,0,0,0,0,0,0,64,64,56,0,0,1,0,0,0,0,0,0,0,83,190,0,0,0,0,0,40,74,192,0,0,0,0,0,74,115,64,0,0,0,0,0,4,199,190,0,0,0,0,0,80,202,62,0,0,0,0,0,0,64,62,0,0,0,0,0,0,127,190,114,216,96,180,49,117,56,62,142,41,5,235,95,135,150,191,0,0,0,32,191,247,124,63,0,0,192,206,140,33,180,64,41,131,179,134,141,248,253,191,227,133,81,54,204,30,67,190,216,59,199,39,96,168,239,191,71,11,217,147,145,228,237,63,221,47,100,224,255,47,198,189,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,0,0,0,0,0,0,0,0,176,207,6,0,106,8,45,45,0,115,254, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGPSDepF0, Test) { + uint8_t encoded_frame[] = { + 85, 134, 0, 123, 0, 183, 22, 0, 176, 207, 6, 0, 106, 8, 0, + 0, 0, 0, 0, 0, 0, 64, 64, 56, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 83, 190, 0, 0, 0, 0, 0, 40, 74, 192, 0, + 0, 0, 0, 0, 74, 115, 64, 0, 0, 0, 0, 0, 4, 199, 190, + 0, 0, 0, 0, 0, 80, 202, 62, 0, 0, 0, 0, 0, 0, 64, + 62, 0, 0, 0, 0, 0, 0, 127, 190, 114, 216, 96, 180, 49, 117, + 56, 62, 142, 41, 5, 235, 95, 135, 150, 191, 0, 0, 0, 32, 191, + 247, 124, 63, 0, 0, 192, 206, 140, 33, 180, 64, 41, 131, 179, 134, + 141, 248, 253, 191, 227, 133, 81, 54, 204, 30, 67, 190, 216, 59, 199, + 39, 96, 168, 239, 191, 71, 11, 217, 147, 145, 228, 237, 63, 221, 47, + 100, 224, 255, 47, 198, 189, 0, 0, 0, 0, 108, 177, 68, 191, 0, + 0, 0, 0, 0, 192, 163, 61, 0, 0, 0, 0, 0, 0, 0, 0, + 176, 207, 6, 0, 106, 8, 45, 45, 0, 115, 254, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_gps_dep_f_t* test_msg = ( msg_ephemeris_gps_dep_f_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = -0.0006315018981695175; - test_msg->af1 = 8.981260180007666e-12; - test_msg->af2 = 0.0; - test_msg->c_ic = 7.450580596923828e-09; - test_msg->c_is = -1.1548399925231934e-07; - test_msg->c_rc = 308.625; - test_msg->c_rs = -52.3125; - test_msg->c_uc = -2.7436763048171997e-06; - test_msg->c_us = 3.1366944313049316e-06; - test_msg->common.fit_interval = 14400; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 0; - test_msg->common.sid.sat = 22; - test_msg->common.toe.tow = 446384; - test_msg->common.toe.wn = 2154; - test_msg->common.ura = 2.0; - test_msg->common.valid = 1; - test_msg->dn = 5.694522914022375e-09; - test_msg->ecc = 0.007072207052260637; - test_msg->inc = 0.9341514480259797; - test_msg->inc_dot = -4.035882396415757e-11; - test_msg->iodc = 45; - test_msg->iode = 45; - test_msg->m0 = -0.02200078842114688; - test_msg->omega0 = -1.8731818448797617; - test_msg->omegadot = -8.903585155774196e-09; - test_msg->sqrta = 5153.550029754639; - test_msg->tgd = -1.7695128917694092e-08; - test_msg->toc.tow = 446384; - test_msg->toc.wn = 2154; - test_msg->w = -0.9893036629599647; - - EXPECT_EQ(send_message( 0x86, 123, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_gps_dep_f_t *test_msg = + (msg_ephemeris_gps_dep_f_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = -0.0006315018981695175; + test_msg->af1 = 8.981260180007666e-12; + test_msg->af2 = 0.0; + test_msg->c_ic = 7.450580596923828e-09; + test_msg->c_is = -1.1548399925231934e-07; + test_msg->c_rc = 308.625; + test_msg->c_rs = -52.3125; + test_msg->c_uc = -2.7436763048171997e-06; + test_msg->c_us = 3.1366944313049316e-06; + test_msg->common.fit_interval = 14400; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 0; + test_msg->common.sid.sat = 22; + test_msg->common.toe.tow = 446384; + test_msg->common.toe.wn = 2154; + test_msg->common.ura = 2.0; + test_msg->common.valid = 1; + test_msg->dn = 5.694522914022375e-09; + test_msg->ecc = 0.007072207052260637; + test_msg->inc = 0.9341514480259797; + test_msg->inc_dot = -4.035882396415757e-11; + test_msg->iodc = 45; + test_msg->iode = 45; + test_msg->m0 = -0.02200078842114688; + test_msg->omega0 = -1.8731818448797617; + test_msg->omegadot = -8.903585155774196e-09; + test_msg->sqrta = 5153.550029754639; + test_msg->tgd = -1.7695128917694092e-08; + test_msg->toc.tow = 446384; + test_msg->toc.wn = 2154; + test_msg->w = -0.9893036629599647; + + EXPECT_EQ(send_message(0x86, 123, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - -0.00063150189817*100), 0.05) << "incorrect value for af0, expected -0.00063150189817, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - 8.98126018001e-12*100), 0.05) << "incorrect value for af1, expected 8.98126018001e-12, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - 0.0*100), 0.05) << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; - EXPECT_LT((last_msg_->c_ic*100 - 7.45058059692e-09*100), 0.05) << "incorrect value for c_ic, expected 7.45058059692e-09, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - -1.15483999252e-07*100), 0.05) << "incorrect value for c_is, expected -1.15483999252e-07, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - 308.625*100), 0.05) << "incorrect value for c_rc, expected 308.625, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - -52.3125*100), 0.05) << "incorrect value for c_rs, expected -52.3125, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - -2.74367630482e-06*100), 0.05) << "incorrect value for c_uc, expected -2.74367630482e-06, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 3.1366944313e-06*100), 0.05) << "incorrect value for c_us, expected 3.1366944313e-06, is " << last_msg_->c_us; - EXPECT_EQ(last_msg_->common.fit_interval, 14400) << "incorrect value for common.fit_interval, expected 14400, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 0) << "incorrect value for common.sid.code, expected 0, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.sat, 22) << "incorrect value for common.sid.sat, expected 22, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toe.tow, 446384) << "incorrect value for common.toe.tow, expected 446384, is " << last_msg_->common.toe.tow; - EXPECT_EQ(last_msg_->common.toe.wn, 2154) << "incorrect value for common.toe.wn, expected 2154, is " << last_msg_->common.toe.wn; - EXPECT_LT((last_msg_->common.ura*100 - 2.0*100), 0.05) << "incorrect value for common.ura, expected 2.0, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->dn*100 - 5.69452291402e-09*100), 0.05) << "incorrect value for dn, expected 5.69452291402e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.00707220705226*100), 0.05) << "incorrect value for ecc, expected 0.00707220705226, is " << last_msg_->ecc; - EXPECT_LT((last_msg_->inc*100 - 0.934151448026*100), 0.05) << "incorrect value for inc, expected 0.934151448026, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - -4.03588239642e-11*100), 0.05) << "incorrect value for inc_dot, expected -4.03588239642e-11, is " << last_msg_->inc_dot; - EXPECT_EQ(last_msg_->iodc, 45) << "incorrect value for iodc, expected 45, is " << last_msg_->iodc; - EXPECT_EQ(last_msg_->iode, 45) << "incorrect value for iode, expected 45, is " << last_msg_->iode; - EXPECT_LT((last_msg_->m0*100 - -0.0220007884211*100), 0.05) << "incorrect value for m0, expected -0.0220007884211, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - -1.87318184488*100), 0.05) << "incorrect value for omega0, expected -1.87318184488, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -8.90358515577e-09*100), 0.05) << "incorrect value for omegadot, expected -8.90358515577e-09, is " << last_msg_->omegadot; - EXPECT_LT((last_msg_->sqrta*100 - 5153.55002975*100), 0.05) << "incorrect value for sqrta, expected 5153.55002975, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->tgd*100 - -1.76951289177e-08*100), 0.05) << "incorrect value for tgd, expected -1.76951289177e-08, is " << last_msg_->tgd; - EXPECT_EQ(last_msg_->toc.tow, 446384) << "incorrect value for toc.tow, expected 446384, is " << last_msg_->toc.tow; - EXPECT_EQ(last_msg_->toc.wn, 2154) << "incorrect value for toc.wn, expected 2154, is " << last_msg_->toc.wn; - EXPECT_LT((last_msg_->w*100 - -0.98930366296*100), 0.05) << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for af0, expected -0.00063150189817, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for af1, expected 8.98126018001e-12, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; + EXPECT_LT((last_msg_->c_ic * 100 - 7.45058059692e-09 * 100), 0.05) + << "incorrect value for c_ic, expected 7.45058059692e-09, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - -1.15483999252e-07 * 100), 0.05) + << "incorrect value for c_is, expected -1.15483999252e-07, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - 308.625 * 100), 0.05) + << "incorrect value for c_rc, expected 308.625, is " << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - -52.3125 * 100), 0.05) + << "incorrect value for c_rs, expected -52.3125, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - -2.74367630482e-06 * 100), 0.05) + << "incorrect value for c_uc, expected -2.74367630482e-06, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 3.1366944313e-06 * 100), 0.05) + << "incorrect value for c_us, expected 3.1366944313e-06, is " + << last_msg_->c_us; + EXPECT_EQ(last_msg_->common.fit_interval, 14400) + << "incorrect value for common.fit_interval, expected 14400, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 0) + << "incorrect value for common.sid.code, expected 0, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.sat, 22) + << "incorrect value for common.sid.sat, expected 22, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toe.tow, 446384) + << "incorrect value for common.toe.tow, expected 446384, is " + << last_msg_->common.toe.tow; + EXPECT_EQ(last_msg_->common.toe.wn, 2154) + << "incorrect value for common.toe.wn, expected 2154, is " + << last_msg_->common.toe.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 2.0 * 100), 0.05) + << "incorrect value for common.ura, expected 2.0, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->dn * 100 - 5.69452291402e-09 * 100), 0.05) + << "incorrect value for dn, expected 5.69452291402e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.00707220705226 * 100), 0.05) + << "incorrect value for ecc, expected 0.00707220705226, is " + << last_msg_->ecc; + EXPECT_LT((last_msg_->inc * 100 - 0.934151448026 * 100), 0.05) + << "incorrect value for inc, expected 0.934151448026, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - -4.03588239642e-11 * 100), 0.05) + << "incorrect value for inc_dot, expected -4.03588239642e-11, is " + << last_msg_->inc_dot; + EXPECT_EQ(last_msg_->iodc, 45) + << "incorrect value for iodc, expected 45, is " << last_msg_->iodc; + EXPECT_EQ(last_msg_->iode, 45) + << "incorrect value for iode, expected 45, is " << last_msg_->iode; + EXPECT_LT((last_msg_->m0 * 100 - -0.0220007884211 * 100), 0.05) + << "incorrect value for m0, expected -0.0220007884211, is " + << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - -1.87318184488 * 100), 0.05) + << "incorrect value for omega0, expected -1.87318184488, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -8.90358515577e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -8.90358515577e-09, is " + << last_msg_->omegadot; + EXPECT_LT((last_msg_->sqrta * 100 - 5153.55002975 * 100), 0.05) + << "incorrect value for sqrta, expected 5153.55002975, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->tgd * 100 - -1.76951289177e-08 * 100), 0.05) + << "incorrect value for tgd, expected -1.76951289177e-08, is " + << last_msg_->tgd; + EXPECT_EQ(last_msg_->toc.tow, 446384) + << "incorrect value for toc.tow, expected 446384, is " + << last_msg_->toc.tow; + EXPECT_EQ(last_msg_->toc.wn, 2154) + << "incorrect value for toc.wn, expected 2154, is " << last_msg_->toc.wn; + EXPECT_LT((last_msg_->w * 100 - -0.98930366296 * 100), 0.05) + << "incorrect value for w, expected -0.98930366296, is " << last_msg_->w; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGal.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGal.cc index cb7e7afa5..b5ce1bc7e 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGal.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGal.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGal.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGal.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisGal0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisGal0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisGal0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisGal0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_gal_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_gal_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,99 +81,167 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisGal0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_gal_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGal0, Test) -{ +}; - uint8_t encoded_frame[] = {85,141,0,128,240,153,27,14,32,217,6,0,106,8,20,174,71,64,64,56,0,0,1,0,0,0,16,49,0,0,16,49,0,0,34,65,0,184,132,67,0,0,16,53,0,0,134,54,0,0,8,179,0,0,8,179,217,204,130,105,128,182,43,62,248,106,31,220,8,136,253,191,0,0,0,0,151,92,38,63,0,0,0,55,154,64,181,64,56,38,1,141,255,182,242,63,222,147,136,39,79,186,56,190,80,114,204,251,193,92,191,63,237,55,19,41,177,73,239,63,49,65,189,240,8,216,245,189,255,255,255,255,67,235,241,190,255,255,255,255,255,255,161,189,0,0,0,0,32,217,6,0,106,8,108,0,108,0,0,71,208, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGal0, Test) { + uint8_t encoded_frame[] = { + 85, 141, 0, 128, 240, 153, 27, 14, 32, 217, 6, 0, 106, 8, 20, + 174, 71, 64, 64, 56, 0, 0, 1, 0, 0, 0, 16, 49, 0, 0, + 16, 49, 0, 0, 34, 65, 0, 184, 132, 67, 0, 0, 16, 53, 0, + 0, 134, 54, 0, 0, 8, 179, 0, 0, 8, 179, 217, 204, 130, 105, + 128, 182, 43, 62, 248, 106, 31, 220, 8, 136, 253, 191, 0, 0, 0, + 0, 151, 92, 38, 63, 0, 0, 0, 55, 154, 64, 181, 64, 56, 38, + 1, 141, 255, 182, 242, 63, 222, 147, 136, 39, 79, 186, 56, 190, 80, + 114, 204, 251, 193, 92, 191, 63, 237, 55, 19, 41, 177, 73, 239, 63, + 49, 65, 189, 240, 8, 216, 245, 189, 255, 255, 255, 255, 67, 235, 241, + 190, 255, 255, 255, 255, 255, 255, 161, 189, 0, 0, 0, 0, 32, 217, + 6, 0, 106, 8, 108, 0, 108, 0, 0, 71, 208, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_gal_t* test_msg = ( msg_ephemeris_gal_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = -1.7088896129280325e-05; - test_msg->af1 = -8.185452315956353e-12; - test_msg->af2 = 0.0; - test_msg->bgd_e1e5a = 2.0954757928848267e-09; - test_msg->bgd_e1e5b = 2.0954757928848267e-09; - test_msg->c_ic = -3.166496753692627e-08; - test_msg->c_is = -3.166496753692627e-08; - test_msg->c_rc = 265.4375; - test_msg->c_rs = 10.125; - test_msg->c_uc = 5.364418029785156e-07; - test_msg->c_us = 3.993511199951172e-06; - test_msg->common.fit_interval = 14400; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 14; - test_msg->common.sid.sat = 27; - test_msg->common.toe.tow = 448800; - test_msg->common.toe.wn = 2154; - test_msg->common.ura = 3.119999885559082; - test_msg->common.valid = 1; - test_msg->dn = 3.2262058129932258e-09; - test_msg->ecc = 0.00017060607206076384; - test_msg->inc = 0.9777456094977858; - test_msg->inc_dot = -3.1787038343451465e-10; - test_msg->iodc = 108; - test_msg->iode = 108; - test_msg->m0 = -1.8457115744155868; - test_msg->omega0 = 1.16967730598334; - test_msg->omegadot = -5.757382675240872e-09; - test_msg->source = 0; - test_msg->sqrta = 5440.602401733398; - test_msg->toc.tow = 448800; - test_msg->toc.wn = 2154; - test_msg->w = 0.12250912091662625; - - EXPECT_EQ(send_message( 0x8d, 61568, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_gal_t *test_msg = (msg_ephemeris_gal_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = -1.7088896129280325e-05; + test_msg->af1 = -8.185452315956353e-12; + test_msg->af2 = 0.0; + test_msg->bgd_e1e5a = 2.0954757928848267e-09; + test_msg->bgd_e1e5b = 2.0954757928848267e-09; + test_msg->c_ic = -3.166496753692627e-08; + test_msg->c_is = -3.166496753692627e-08; + test_msg->c_rc = 265.4375; + test_msg->c_rs = 10.125; + test_msg->c_uc = 5.364418029785156e-07; + test_msg->c_us = 3.993511199951172e-06; + test_msg->common.fit_interval = 14400; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 14; + test_msg->common.sid.sat = 27; + test_msg->common.toe.tow = 448800; + test_msg->common.toe.wn = 2154; + test_msg->common.ura = 3.119999885559082; + test_msg->common.valid = 1; + test_msg->dn = 3.2262058129932258e-09; + test_msg->ecc = 0.00017060607206076384; + test_msg->inc = 0.9777456094977858; + test_msg->inc_dot = -3.1787038343451465e-10; + test_msg->iodc = 108; + test_msg->iode = 108; + test_msg->m0 = -1.8457115744155868; + test_msg->omega0 = 1.16967730598334; + test_msg->omegadot = -5.757382675240872e-09; + test_msg->source = 0; + test_msg->sqrta = 5440.602401733398; + test_msg->toc.tow = 448800; + test_msg->toc.wn = 2154; + test_msg->w = 0.12250912091662625; + + EXPECT_EQ(send_message(0x8d, 61568, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61568); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - -1.70888961293e-05*100), 0.05) << "incorrect value for af0, expected -1.70888961293e-05, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - -8.18545231596e-12*100), 0.05) << "incorrect value for af1, expected -8.18545231596e-12, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - 0.0*100), 0.05) << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; - EXPECT_LT((last_msg_->bgd_e1e5a*100 - 2.09547579288e-09*100), 0.05) << "incorrect value for bgd_e1e5a, expected 2.09547579288e-09, is " << last_msg_->bgd_e1e5a; - EXPECT_LT((last_msg_->bgd_e1e5b*100 - 2.09547579288e-09*100), 0.05) << "incorrect value for bgd_e1e5b, expected 2.09547579288e-09, is " << last_msg_->bgd_e1e5b; - EXPECT_LT((last_msg_->c_ic*100 - -3.16649675369e-08*100), 0.05) << "incorrect value for c_ic, expected -3.16649675369e-08, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - -3.16649675369e-08*100), 0.05) << "incorrect value for c_is, expected -3.16649675369e-08, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - 265.4375*100), 0.05) << "incorrect value for c_rc, expected 265.4375, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - 10.125*100), 0.05) << "incorrect value for c_rs, expected 10.125, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - 5.36441802979e-07*100), 0.05) << "incorrect value for c_uc, expected 5.36441802979e-07, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 3.99351119995e-06*100), 0.05) << "incorrect value for c_us, expected 3.99351119995e-06, is " << last_msg_->c_us; - EXPECT_EQ(last_msg_->common.fit_interval, 14400) << "incorrect value for common.fit_interval, expected 14400, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 14) << "incorrect value for common.sid.code, expected 14, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.sat, 27) << "incorrect value for common.sid.sat, expected 27, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toe.tow, 448800) << "incorrect value for common.toe.tow, expected 448800, is " << last_msg_->common.toe.tow; - EXPECT_EQ(last_msg_->common.toe.wn, 2154) << "incorrect value for common.toe.wn, expected 2154, is " << last_msg_->common.toe.wn; - EXPECT_LT((last_msg_->common.ura*100 - 3.11999988556*100), 0.05) << "incorrect value for common.ura, expected 3.11999988556, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->dn*100 - 3.22620581299e-09*100), 0.05) << "incorrect value for dn, expected 3.22620581299e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.000170606072061*100), 0.05) << "incorrect value for ecc, expected 0.000170606072061, is " << last_msg_->ecc; - EXPECT_LT((last_msg_->inc*100 - 0.977745609498*100), 0.05) << "incorrect value for inc, expected 0.977745609498, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - -3.17870383435e-10*100), 0.05) << "incorrect value for inc_dot, expected -3.17870383435e-10, is " << last_msg_->inc_dot; - EXPECT_EQ(last_msg_->iodc, 108) << "incorrect value for iodc, expected 108, is " << last_msg_->iodc; - EXPECT_EQ(last_msg_->iode, 108) << "incorrect value for iode, expected 108, is " << last_msg_->iode; - EXPECT_LT((last_msg_->m0*100 - -1.84571157442*100), 0.05) << "incorrect value for m0, expected -1.84571157442, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - 1.16967730598*100), 0.05) << "incorrect value for omega0, expected 1.16967730598, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -5.75738267524e-09*100), 0.05) << "incorrect value for omegadot, expected -5.75738267524e-09, is " << last_msg_->omegadot; - EXPECT_EQ(last_msg_->source, 0) << "incorrect value for source, expected 0, is " << last_msg_->source; - EXPECT_LT((last_msg_->sqrta*100 - 5440.60240173*100), 0.05) << "incorrect value for sqrta, expected 5440.60240173, is " << last_msg_->sqrta; - EXPECT_EQ(last_msg_->toc.tow, 448800) << "incorrect value for toc.tow, expected 448800, is " << last_msg_->toc.tow; - EXPECT_EQ(last_msg_->toc.wn, 2154) << "incorrect value for toc.wn, expected 2154, is " << last_msg_->toc.wn; - EXPECT_LT((last_msg_->w*100 - 0.122509120917*100), 0.05) << "incorrect value for w, expected 0.122509120917, is " << last_msg_->w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61568); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - -1.70888961293e-05 * 100), 0.05) + << "incorrect value for af0, expected -1.70888961293e-05, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - -8.18545231596e-12 * 100), 0.05) + << "incorrect value for af1, expected -8.18545231596e-12, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; + EXPECT_LT((last_msg_->bgd_e1e5a * 100 - 2.09547579288e-09 * 100), 0.05) + << "incorrect value for bgd_e1e5a, expected 2.09547579288e-09, is " + << last_msg_->bgd_e1e5a; + EXPECT_LT((last_msg_->bgd_e1e5b * 100 - 2.09547579288e-09 * 100), 0.05) + << "incorrect value for bgd_e1e5b, expected 2.09547579288e-09, is " + << last_msg_->bgd_e1e5b; + EXPECT_LT((last_msg_->c_ic * 100 - -3.16649675369e-08 * 100), 0.05) + << "incorrect value for c_ic, expected -3.16649675369e-08, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - -3.16649675369e-08 * 100), 0.05) + << "incorrect value for c_is, expected -3.16649675369e-08, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - 265.4375 * 100), 0.05) + << "incorrect value for c_rc, expected 265.4375, is " << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - 10.125 * 100), 0.05) + << "incorrect value for c_rs, expected 10.125, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - 5.36441802979e-07 * 100), 0.05) + << "incorrect value for c_uc, expected 5.36441802979e-07, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 3.99351119995e-06 * 100), 0.05) + << "incorrect value for c_us, expected 3.99351119995e-06, is " + << last_msg_->c_us; + EXPECT_EQ(last_msg_->common.fit_interval, 14400) + << "incorrect value for common.fit_interval, expected 14400, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 14) + << "incorrect value for common.sid.code, expected 14, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.sat, 27) + << "incorrect value for common.sid.sat, expected 27, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toe.tow, 448800) + << "incorrect value for common.toe.tow, expected 448800, is " + << last_msg_->common.toe.tow; + EXPECT_EQ(last_msg_->common.toe.wn, 2154) + << "incorrect value for common.toe.wn, expected 2154, is " + << last_msg_->common.toe.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 3.11999988556 * 100), 0.05) + << "incorrect value for common.ura, expected 3.11999988556, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->dn * 100 - 3.22620581299e-09 * 100), 0.05) + << "incorrect value for dn, expected 3.22620581299e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.000170606072061 * 100), 0.05) + << "incorrect value for ecc, expected 0.000170606072061, is " + << last_msg_->ecc; + EXPECT_LT((last_msg_->inc * 100 - 0.977745609498 * 100), 0.05) + << "incorrect value for inc, expected 0.977745609498, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - -3.17870383435e-10 * 100), 0.05) + << "incorrect value for inc_dot, expected -3.17870383435e-10, is " + << last_msg_->inc_dot; + EXPECT_EQ(last_msg_->iodc, 108) + << "incorrect value for iodc, expected 108, is " << last_msg_->iodc; + EXPECT_EQ(last_msg_->iode, 108) + << "incorrect value for iode, expected 108, is " << last_msg_->iode; + EXPECT_LT((last_msg_->m0 * 100 - -1.84571157442 * 100), 0.05) + << "incorrect value for m0, expected -1.84571157442, is " + << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - 1.16967730598 * 100), 0.05) + << "incorrect value for omega0, expected 1.16967730598, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -5.75738267524e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -5.75738267524e-09, is " + << last_msg_->omegadot; + EXPECT_EQ(last_msg_->source, 0) + << "incorrect value for source, expected 0, is " << last_msg_->source; + EXPECT_LT((last_msg_->sqrta * 100 - 5440.60240173 * 100), 0.05) + << "incorrect value for sqrta, expected 5440.60240173, is " + << last_msg_->sqrta; + EXPECT_EQ(last_msg_->toc.tow, 448800) + << "incorrect value for toc.tow, expected 448800, is " + << last_msg_->toc.tow; + EXPECT_EQ(last_msg_->toc.wn, 2154) + << "incorrect value for toc.wn, expected 2154, is " << last_msg_->toc.wn; + EXPECT_LT((last_msg_->w * 100 - 0.122509120917 * 100), 0.05) + << "incorrect value for w, expected 0.122509120917, is " << last_msg_->w; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGalDepA.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGalDepA.cc index f56c05dde..f8094e362 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGalDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisGalDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGalDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisGalDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_gal_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_gal_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,97 +82,166 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_gal_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,149,0,195,4,152,27,14,32,217,6,0,106,8,102,102,230,64,64,56,0,0,1,0,154,153,153,63,205,204,12,64,0,0,34,65,0,184,132,67,102,102,166,64,102,102,198,64,205,204,76,64,102,102,134,64,217,204,130,105,128,182,43,62,248,106,31,220,8,136,253,191,0,0,0,0,151,92,38,63,0,0,0,55,154,64,181,64,56,38,1,141,255,182,242,63,222,147,136,39,79,186,56,190,80,114,204,251,193,92,191,63,237,55,19,41,177,73,239,63,49,65,189,240,8,216,245,189,255,255,255,255,67,235,241,190,255,255,255,255,255,255,161,189,205,204,76,62,32,217,6,0,106,8,108,0,108,0,168,49, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisGalDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 149, 0, 195, 4, 152, 27, 14, 32, 217, 6, 0, 106, 8, 102, + 102, 230, 64, 64, 56, 0, 0, 1, 0, 154, 153, 153, 63, 205, 204, + 12, 64, 0, 0, 34, 65, 0, 184, 132, 67, 102, 102, 166, 64, 102, + 102, 198, 64, 205, 204, 76, 64, 102, 102, 134, 64, 217, 204, 130, 105, + 128, 182, 43, 62, 248, 106, 31, 220, 8, 136, 253, 191, 0, 0, 0, + 0, 151, 92, 38, 63, 0, 0, 0, 55, 154, 64, 181, 64, 56, 38, + 1, 141, 255, 182, 242, 63, 222, 147, 136, 39, 79, 186, 56, 190, 80, + 114, 204, 251, 193, 92, 191, 63, 237, 55, 19, 41, 177, 73, 239, 63, + 49, 65, 189, 240, 8, 216, 245, 189, 255, 255, 255, 255, 67, 235, 241, + 190, 255, 255, 255, 255, 255, 255, 161, 189, 205, 204, 76, 62, 32, 217, + 6, 0, 106, 8, 108, 0, 108, 0, 168, 49, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_gal_dep_a_t* test_msg = ( msg_ephemeris_gal_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = -1.7088896129280325e-05; - test_msg->af1 = -8.185452315956353e-12; - test_msg->af2 = 0.20000000298023224; - test_msg->bgd_e1e5a = 1.2000000476837158; - test_msg->bgd_e1e5b = 2.200000047683716; - test_msg->c_ic = 3.200000047683716; - test_msg->c_is = 4.199999809265137; - test_msg->c_rc = 265.4375; - test_msg->c_rs = 10.125; - test_msg->c_uc = 5.199999809265137; - test_msg->c_us = 6.199999809265137; - test_msg->common.fit_interval = 14400; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 14; - test_msg->common.sid.sat = 27; - test_msg->common.toe.tow = 448800; - test_msg->common.toe.wn = 2154; - test_msg->common.ura = 7.199999809265137; - test_msg->common.valid = 1; - test_msg->dn = 3.2262058129932258e-09; - test_msg->ecc = 0.00017060607206076384; - test_msg->inc = 0.9777456094977858; - test_msg->inc_dot = -3.1787038343451465e-10; - test_msg->iodc = 108; - test_msg->iode = 108; - test_msg->m0 = -1.8457115744155868; - test_msg->omega0 = 1.16967730598334; - test_msg->omegadot = -5.757382675240872e-09; - test_msg->sqrta = 5440.602401733398; - test_msg->toc.tow = 448800; - test_msg->toc.wn = 2154; - test_msg->w = 0.12250912091662625; - - EXPECT_EQ(send_message( 0x95, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_gal_dep_a_t *test_msg = + (msg_ephemeris_gal_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = -1.7088896129280325e-05; + test_msg->af1 = -8.185452315956353e-12; + test_msg->af2 = 0.20000000298023224; + test_msg->bgd_e1e5a = 1.2000000476837158; + test_msg->bgd_e1e5b = 2.200000047683716; + test_msg->c_ic = 3.200000047683716; + test_msg->c_is = 4.199999809265137; + test_msg->c_rc = 265.4375; + test_msg->c_rs = 10.125; + test_msg->c_uc = 5.199999809265137; + test_msg->c_us = 6.199999809265137; + test_msg->common.fit_interval = 14400; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 14; + test_msg->common.sid.sat = 27; + test_msg->common.toe.tow = 448800; + test_msg->common.toe.wn = 2154; + test_msg->common.ura = 7.199999809265137; + test_msg->common.valid = 1; + test_msg->dn = 3.2262058129932258e-09; + test_msg->ecc = 0.00017060607206076384; + test_msg->inc = 0.9777456094977858; + test_msg->inc_dot = -3.1787038343451465e-10; + test_msg->iodc = 108; + test_msg->iode = 108; + test_msg->m0 = -1.8457115744155868; + test_msg->omega0 = 1.16967730598334; + test_msg->omegadot = -5.757382675240872e-09; + test_msg->sqrta = 5440.602401733398; + test_msg->toc.tow = 448800; + test_msg->toc.wn = 2154; + test_msg->w = 0.12250912091662625; + + EXPECT_EQ(send_message(0x95, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - -1.70888961293e-05*100), 0.05) << "incorrect value for af0, expected -1.70888961293e-05, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - -8.18545231596e-12*100), 0.05) << "incorrect value for af1, expected -8.18545231596e-12, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - 0.20000000298*100), 0.05) << "incorrect value for af2, expected 0.20000000298, is " << last_msg_->af2; - EXPECT_LT((last_msg_->bgd_e1e5a*100 - 1.20000004768*100), 0.05) << "incorrect value for bgd_e1e5a, expected 1.20000004768, is " << last_msg_->bgd_e1e5a; - EXPECT_LT((last_msg_->bgd_e1e5b*100 - 2.20000004768*100), 0.05) << "incorrect value for bgd_e1e5b, expected 2.20000004768, is " << last_msg_->bgd_e1e5b; - EXPECT_LT((last_msg_->c_ic*100 - 3.20000004768*100), 0.05) << "incorrect value for c_ic, expected 3.20000004768, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - 4.19999980927*100), 0.05) << "incorrect value for c_is, expected 4.19999980927, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - 265.4375*100), 0.05) << "incorrect value for c_rc, expected 265.4375, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - 10.125*100), 0.05) << "incorrect value for c_rs, expected 10.125, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - 5.19999980927*100), 0.05) << "incorrect value for c_uc, expected 5.19999980927, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 6.19999980927*100), 0.05) << "incorrect value for c_us, expected 6.19999980927, is " << last_msg_->c_us; - EXPECT_EQ(last_msg_->common.fit_interval, 14400) << "incorrect value for common.fit_interval, expected 14400, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 14) << "incorrect value for common.sid.code, expected 14, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.sat, 27) << "incorrect value for common.sid.sat, expected 27, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toe.tow, 448800) << "incorrect value for common.toe.tow, expected 448800, is " << last_msg_->common.toe.tow; - EXPECT_EQ(last_msg_->common.toe.wn, 2154) << "incorrect value for common.toe.wn, expected 2154, is " << last_msg_->common.toe.wn; - EXPECT_LT((last_msg_->common.ura*100 - 7.19999980927*100), 0.05) << "incorrect value for common.ura, expected 7.19999980927, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->dn*100 - 3.22620581299e-09*100), 0.05) << "incorrect value for dn, expected 3.22620581299e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.000170606072061*100), 0.05) << "incorrect value for ecc, expected 0.000170606072061, is " << last_msg_->ecc; - EXPECT_LT((last_msg_->inc*100 - 0.977745609498*100), 0.05) << "incorrect value for inc, expected 0.977745609498, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - -3.17870383435e-10*100), 0.05) << "incorrect value for inc_dot, expected -3.17870383435e-10, is " << last_msg_->inc_dot; - EXPECT_EQ(last_msg_->iodc, 108) << "incorrect value for iodc, expected 108, is " << last_msg_->iodc; - EXPECT_EQ(last_msg_->iode, 108) << "incorrect value for iode, expected 108, is " << last_msg_->iode; - EXPECT_LT((last_msg_->m0*100 - -1.84571157442*100), 0.05) << "incorrect value for m0, expected -1.84571157442, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - 1.16967730598*100), 0.05) << "incorrect value for omega0, expected 1.16967730598, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -5.75738267524e-09*100), 0.05) << "incorrect value for omegadot, expected -5.75738267524e-09, is " << last_msg_->omegadot; - EXPECT_LT((last_msg_->sqrta*100 - 5440.60240173*100), 0.05) << "incorrect value for sqrta, expected 5440.60240173, is " << last_msg_->sqrta; - EXPECT_EQ(last_msg_->toc.tow, 448800) << "incorrect value for toc.tow, expected 448800, is " << last_msg_->toc.tow; - EXPECT_EQ(last_msg_->toc.wn, 2154) << "incorrect value for toc.wn, expected 2154, is " << last_msg_->toc.wn; - EXPECT_LT((last_msg_->w*100 - 0.122509120917*100), 0.05) << "incorrect value for w, expected 0.122509120917, is " << last_msg_->w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - -1.70888961293e-05 * 100), 0.05) + << "incorrect value for af0, expected -1.70888961293e-05, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - -8.18545231596e-12 * 100), 0.05) + << "incorrect value for af1, expected -8.18545231596e-12, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - 0.20000000298 * 100), 0.05) + << "incorrect value for af2, expected 0.20000000298, is " + << last_msg_->af2; + EXPECT_LT((last_msg_->bgd_e1e5a * 100 - 1.20000004768 * 100), 0.05) + << "incorrect value for bgd_e1e5a, expected 1.20000004768, is " + << last_msg_->bgd_e1e5a; + EXPECT_LT((last_msg_->bgd_e1e5b * 100 - 2.20000004768 * 100), 0.05) + << "incorrect value for bgd_e1e5b, expected 2.20000004768, is " + << last_msg_->bgd_e1e5b; + EXPECT_LT((last_msg_->c_ic * 100 - 3.20000004768 * 100), 0.05) + << "incorrect value for c_ic, expected 3.20000004768, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - 4.19999980927 * 100), 0.05) + << "incorrect value for c_is, expected 4.19999980927, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - 265.4375 * 100), 0.05) + << "incorrect value for c_rc, expected 265.4375, is " << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - 10.125 * 100), 0.05) + << "incorrect value for c_rs, expected 10.125, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - 5.19999980927 * 100), 0.05) + << "incorrect value for c_uc, expected 5.19999980927, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 6.19999980927 * 100), 0.05) + << "incorrect value for c_us, expected 6.19999980927, is " + << last_msg_->c_us; + EXPECT_EQ(last_msg_->common.fit_interval, 14400) + << "incorrect value for common.fit_interval, expected 14400, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 14) + << "incorrect value for common.sid.code, expected 14, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.sat, 27) + << "incorrect value for common.sid.sat, expected 27, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toe.tow, 448800) + << "incorrect value for common.toe.tow, expected 448800, is " + << last_msg_->common.toe.tow; + EXPECT_EQ(last_msg_->common.toe.wn, 2154) + << "incorrect value for common.toe.wn, expected 2154, is " + << last_msg_->common.toe.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 7.19999980927 * 100), 0.05) + << "incorrect value for common.ura, expected 7.19999980927, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->dn * 100 - 3.22620581299e-09 * 100), 0.05) + << "incorrect value for dn, expected 3.22620581299e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.000170606072061 * 100), 0.05) + << "incorrect value for ecc, expected 0.000170606072061, is " + << last_msg_->ecc; + EXPECT_LT((last_msg_->inc * 100 - 0.977745609498 * 100), 0.05) + << "incorrect value for inc, expected 0.977745609498, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - -3.17870383435e-10 * 100), 0.05) + << "incorrect value for inc_dot, expected -3.17870383435e-10, is " + << last_msg_->inc_dot; + EXPECT_EQ(last_msg_->iodc, 108) + << "incorrect value for iodc, expected 108, is " << last_msg_->iodc; + EXPECT_EQ(last_msg_->iode, 108) + << "incorrect value for iode, expected 108, is " << last_msg_->iode; + EXPECT_LT((last_msg_->m0 * 100 - -1.84571157442 * 100), 0.05) + << "incorrect value for m0, expected -1.84571157442, is " + << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - 1.16967730598 * 100), 0.05) + << "incorrect value for omega0, expected 1.16967730598, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -5.75738267524e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -5.75738267524e-09, is " + << last_msg_->omegadot; + EXPECT_LT((last_msg_->sqrta * 100 - 5440.60240173 * 100), 0.05) + << "incorrect value for sqrta, expected 5440.60240173, is " + << last_msg_->sqrta; + EXPECT_EQ(last_msg_->toc.tow, 448800) + << "incorrect value for toc.tow, expected 448800, is " + << last_msg_->toc.tow; + EXPECT_EQ(last_msg_->toc.wn, 2154) + << "incorrect value for toc.wn, expected 2154, is " << last_msg_->toc.wn; + EXPECT_LT((last_msg_->w * 100 - 0.122509120917 * 100), 0.05) + << "incorrect value for w, expected 0.122509120917, is " << last_msg_->w; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisSbas.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisSbas.cc index d84fe1dad..685b16337 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisSbas.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisSbas.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbas.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbas.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisSbas0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisSbas0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisSbas0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisSbas0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_sbas_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_sbas_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,107 +81,150 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisSbas0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_sbas_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisSbas0, Test) -{ +}; - uint8_t encoded_frame[] = {85,140,0,195,4,74,22,6,176,207,6,0,106,8,0,0,64,177,0,0,0,0,1,0,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,51,208,215,196,215,233,30,197,86,116,89,68,0,0,122,53,0,0,122,53,0,128,59,54,96,139,37,186,0,0,30,45,192,147, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisSbas0, Test) { + uint8_t encoded_frame[] = { + 85, 140, 0, 195, 4, 74, 22, 6, 176, 207, 6, 0, 106, 8, + 0, 0, 64, 177, 0, 0, 0, 0, 1, 0, 0, 0, 128, 66, + 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, 34, 65, 0, 0, + 240, 199, 84, 86, 117, 193, 51, 208, 215, 196, 215, 233, 30, 197, + 86, 116, 89, 68, 0, 0, 122, 53, 0, 0, 122, 53, 0, 128, + 59, 54, 96, 139, 37, 186, 0, 0, 30, 45, 192, 147, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_sbas_t* test_msg = ( msg_ephemeris_sbas_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->a_gf0 = -0.0006315018981695175; - test_msg->a_gf1 = 8.981260180007666e-12; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[0] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[1] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[2] = 2.7939677238464355e-06; - test_msg->common.fit_interval = 0; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 6; - test_msg->common.sid.sat = 22; - test_msg->common.toe.tow = 446384; - test_msg->common.toe.wn = 2154; - test_msg->common.ura = -2.7939677238464355e-09; - test_msg->common.valid = 1; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[0] = -12177330.078125; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[1] = 599893.06640625; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[2] = -22373708.49609375; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[0] = -1726.5062255859375; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[1] = -2542.614990234375; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[2] = 869.8177490234375; - - EXPECT_EQ(send_message( 0x8c, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_sbas_t *test_msg = (msg_ephemeris_sbas_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->a_gf0 = -0.0006315018981695175; + test_msg->a_gf1 = 8.981260180007666e-12; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[0] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[1] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[2] = 2.7939677238464355e-06; + test_msg->common.fit_interval = 0; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 6; + test_msg->common.sid.sat = 22; + test_msg->common.toe.tow = 446384; + test_msg->common.toe.wn = 2154; + test_msg->common.ura = -2.7939677238464355e-09; + test_msg->common.valid = 1; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[0] = -12177330.078125; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[1] = 599893.06640625; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[2] = -22373708.49609375; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[0] = -1726.5062255859375; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[1] = -2542.614990234375; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[2] = 869.8177490234375; + + EXPECT_EQ(send_message(0x8c, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->a_gf0*100 - -0.00063150189817*100), 0.05) << "incorrect value for a_gf0, expected -0.00063150189817, is " << last_msg_->a_gf0; - EXPECT_LT((last_msg_->a_gf1*100 - 8.98126018001e-12*100), 0.05) << "incorrect value for a_gf1, expected 8.98126018001e-12, is " << last_msg_->a_gf1; - EXPECT_LT((last_msg_->acc[0]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[0], expected 9.31322574615e-07, is " << last_msg_->acc[0]; - EXPECT_LT((last_msg_->acc[1]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[1], expected 9.31322574615e-07, is " << last_msg_->acc[1]; - EXPECT_LT((last_msg_->acc[2]*100 - 2.79396772385e-06*100), 0.05) << "incorrect value for acc[2], expected 2.79396772385e-06, is " << last_msg_->acc[2]; - EXPECT_EQ(last_msg_->common.fit_interval, 0) << "incorrect value for common.fit_interval, expected 0, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 6) << "incorrect value for common.sid.code, expected 6, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.sat, 22) << "incorrect value for common.sid.sat, expected 22, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toe.tow, 446384) << "incorrect value for common.toe.tow, expected 446384, is " << last_msg_->common.toe.tow; - EXPECT_EQ(last_msg_->common.toe.wn, 2154) << "incorrect value for common.toe.wn, expected 2154, is " << last_msg_->common.toe.wn; - EXPECT_LT((last_msg_->common.ura*100 - -2.79396772385e-09*100), 0.05) << "incorrect value for common.ura, expected -2.79396772385e-09, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->pos[0]*100 - -12177330.0781*100), 0.05) << "incorrect value for pos[0], expected -12177330.0781, is " << last_msg_->pos[0]; - EXPECT_LT((last_msg_->pos[1]*100 - 599893.066406*100), 0.05) << "incorrect value for pos[1], expected 599893.066406, is " << last_msg_->pos[1]; - EXPECT_LT((last_msg_->pos[2]*100 - -22373708.4961*100), 0.05) << "incorrect value for pos[2], expected -22373708.4961, is " << last_msg_->pos[2]; - EXPECT_LT((last_msg_->vel[0]*100 - -1726.50622559*100), 0.05) << "incorrect value for vel[0], expected -1726.50622559, is " << last_msg_->vel[0]; - EXPECT_LT((last_msg_->vel[1]*100 - -2542.61499023*100), 0.05) << "incorrect value for vel[1], expected -2542.61499023, is " << last_msg_->vel[1]; - EXPECT_LT((last_msg_->vel[2]*100 - 869.817749023*100), 0.05) << "incorrect value for vel[2], expected 869.817749023, is " << last_msg_->vel[2]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->a_gf0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for a_gf0, expected -0.00063150189817, is " + << last_msg_->a_gf0; + EXPECT_LT((last_msg_->a_gf1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for a_gf1, expected 8.98126018001e-12, is " + << last_msg_->a_gf1; + EXPECT_LT((last_msg_->acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[0], expected 9.31322574615e-07, is " + << last_msg_->acc[0]; + EXPECT_LT((last_msg_->acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[1], expected 9.31322574615e-07, is " + << last_msg_->acc[1]; + EXPECT_LT((last_msg_->acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for acc[2], expected 2.79396772385e-06, is " + << last_msg_->acc[2]; + EXPECT_EQ(last_msg_->common.fit_interval, 0) + << "incorrect value for common.fit_interval, expected 0, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 6) + << "incorrect value for common.sid.code, expected 6, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.sat, 22) + << "incorrect value for common.sid.sat, expected 22, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toe.tow, 446384) + << "incorrect value for common.toe.tow, expected 446384, is " + << last_msg_->common.toe.tow; + EXPECT_EQ(last_msg_->common.toe.wn, 2154) + << "incorrect value for common.toe.wn, expected 2154, is " + << last_msg_->common.toe.wn; + EXPECT_LT((last_msg_->common.ura * 100 - -2.79396772385e-09 * 100), 0.05) + << "incorrect value for common.ura, expected -2.79396772385e-09, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for pos[0], expected -12177330.0781, is " + << last_msg_->pos[0]; + EXPECT_LT((last_msg_->pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for pos[1], expected 599893.066406, is " + << last_msg_->pos[1]; + EXPECT_LT((last_msg_->pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for pos[2], expected -22373708.4961, is " + << last_msg_->pos[2]; + EXPECT_LT((last_msg_->vel[0] * 100 - -1726.50622559 * 100), 0.05) + << "incorrect value for vel[0], expected -1726.50622559, is " + << last_msg_->vel[0]; + EXPECT_LT((last_msg_->vel[1] * 100 - -2542.61499023 * 100), 0.05) + << "incorrect value for vel[1], expected -2542.61499023, is " + << last_msg_->vel[1]; + EXPECT_LT((last_msg_->vel[2] * 100 - 869.817749023 * 100), 0.05) + << "incorrect value for vel[2], expected 869.817749023, is " + << last_msg_->vel[2]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepA.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepA.cc index 49b4f01ed..116f21e42 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_sbas_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_sbas_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,109 +82,157 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_sbas_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,130,0,123,0,112,22,0,6,0,176,207,6,0,106,8,0,0,0,0,0,0,0,64,0,0,0,0,1,0,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,178,180, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 130, 0, 123, 0, 112, 22, 0, 6, 0, 176, 207, 6, 0, 106, + 8, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 1, 0, + 0, 0, 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, 34, + 65, 0, 0, 240, 199, 84, 86, 117, 193, 0, 0, 0, 98, 6, 250, + 154, 192, 0, 0, 0, 217, 58, 221, 163, 192, 0, 0, 0, 184, 138, + 46, 139, 64, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, + 0, 64, 175, 62, 0, 0, 0, 0, 0, 112, 199, 62, 0, 0, 0, + 0, 108, 177, 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 178, 180, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_sbas_dep_a_t* test_msg = ( msg_ephemeris_sbas_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->a_gf0 = -0.0006315018981695175; - test_msg->a_gf1 = 8.981260180007666e-12; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[0] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[1] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[2] = 2.7939677238464355e-06; - test_msg->common.fit_interval = 0; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 6; - test_msg->common.sid.reserved = 0; - test_msg->common.sid.sat = 22; - test_msg->common.toe.tow = 446384; - test_msg->common.toe.wn = 2154; - test_msg->common.ura = 2.0; - test_msg->common.valid = 1; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[0] = -12177330.078125; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[1] = 599893.06640625; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[2] = -22373708.49609375; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[0] = -1726.506233215332; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[1] = -2542.6149368286133; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[2] = 869.8177337646484; - - EXPECT_EQ(send_message( 0x82, 123, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_sbas_dep_a_t *test_msg = + (msg_ephemeris_sbas_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->a_gf0 = -0.0006315018981695175; + test_msg->a_gf1 = 8.981260180007666e-12; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[0] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[1] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[2] = 2.7939677238464355e-06; + test_msg->common.fit_interval = 0; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 6; + test_msg->common.sid.reserved = 0; + test_msg->common.sid.sat = 22; + test_msg->common.toe.tow = 446384; + test_msg->common.toe.wn = 2154; + test_msg->common.ura = 2.0; + test_msg->common.valid = 1; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[0] = -12177330.078125; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[1] = 599893.06640625; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[2] = -22373708.49609375; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[0] = -1726.506233215332; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[1] = -2542.6149368286133; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[2] = 869.8177337646484; + + EXPECT_EQ(send_message(0x82, 123, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->a_gf0*100 - -0.00063150189817*100), 0.05) << "incorrect value for a_gf0, expected -0.00063150189817, is " << last_msg_->a_gf0; - EXPECT_LT((last_msg_->a_gf1*100 - 8.98126018001e-12*100), 0.05) << "incorrect value for a_gf1, expected 8.98126018001e-12, is " << last_msg_->a_gf1; - EXPECT_LT((last_msg_->acc[0]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[0], expected 9.31322574615e-07, is " << last_msg_->acc[0]; - EXPECT_LT((last_msg_->acc[1]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[1], expected 9.31322574615e-07, is " << last_msg_->acc[1]; - EXPECT_LT((last_msg_->acc[2]*100 - 2.79396772385e-06*100), 0.05) << "incorrect value for acc[2], expected 2.79396772385e-06, is " << last_msg_->acc[2]; - EXPECT_EQ(last_msg_->common.fit_interval, 0) << "incorrect value for common.fit_interval, expected 0, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 6) << "incorrect value for common.sid.code, expected 6, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.reserved, 0) << "incorrect value for common.sid.reserved, expected 0, is " << last_msg_->common.sid.reserved; - EXPECT_EQ(last_msg_->common.sid.sat, 22) << "incorrect value for common.sid.sat, expected 22, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toe.tow, 446384) << "incorrect value for common.toe.tow, expected 446384, is " << last_msg_->common.toe.tow; - EXPECT_EQ(last_msg_->common.toe.wn, 2154) << "incorrect value for common.toe.wn, expected 2154, is " << last_msg_->common.toe.wn; - EXPECT_LT((last_msg_->common.ura*100 - 2.0*100), 0.05) << "incorrect value for common.ura, expected 2.0, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->pos[0]*100 - -12177330.0781*100), 0.05) << "incorrect value for pos[0], expected -12177330.0781, is " << last_msg_->pos[0]; - EXPECT_LT((last_msg_->pos[1]*100 - 599893.066406*100), 0.05) << "incorrect value for pos[1], expected 599893.066406, is " << last_msg_->pos[1]; - EXPECT_LT((last_msg_->pos[2]*100 - -22373708.4961*100), 0.05) << "incorrect value for pos[2], expected -22373708.4961, is " << last_msg_->pos[2]; - EXPECT_LT((last_msg_->vel[0]*100 - -1726.50623322*100), 0.05) << "incorrect value for vel[0], expected -1726.50623322, is " << last_msg_->vel[0]; - EXPECT_LT((last_msg_->vel[1]*100 - -2542.61493683*100), 0.05) << "incorrect value for vel[1], expected -2542.61493683, is " << last_msg_->vel[1]; - EXPECT_LT((last_msg_->vel[2]*100 - 869.817733765*100), 0.05) << "incorrect value for vel[2], expected 869.817733765, is " << last_msg_->vel[2]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->a_gf0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for a_gf0, expected -0.00063150189817, is " + << last_msg_->a_gf0; + EXPECT_LT((last_msg_->a_gf1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for a_gf1, expected 8.98126018001e-12, is " + << last_msg_->a_gf1; + EXPECT_LT((last_msg_->acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[0], expected 9.31322574615e-07, is " + << last_msg_->acc[0]; + EXPECT_LT((last_msg_->acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[1], expected 9.31322574615e-07, is " + << last_msg_->acc[1]; + EXPECT_LT((last_msg_->acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for acc[2], expected 2.79396772385e-06, is " + << last_msg_->acc[2]; + EXPECT_EQ(last_msg_->common.fit_interval, 0) + << "incorrect value for common.fit_interval, expected 0, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 6) + << "incorrect value for common.sid.code, expected 6, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.reserved, 0) + << "incorrect value for common.sid.reserved, expected 0, is " + << last_msg_->common.sid.reserved; + EXPECT_EQ(last_msg_->common.sid.sat, 22) + << "incorrect value for common.sid.sat, expected 22, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toe.tow, 446384) + << "incorrect value for common.toe.tow, expected 446384, is " + << last_msg_->common.toe.tow; + EXPECT_EQ(last_msg_->common.toe.wn, 2154) + << "incorrect value for common.toe.wn, expected 2154, is " + << last_msg_->common.toe.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 2.0 * 100), 0.05) + << "incorrect value for common.ura, expected 2.0, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for pos[0], expected -12177330.0781, is " + << last_msg_->pos[0]; + EXPECT_LT((last_msg_->pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for pos[1], expected 599893.066406, is " + << last_msg_->pos[1]; + EXPECT_LT((last_msg_->pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for pos[2], expected -22373708.4961, is " + << last_msg_->pos[2]; + EXPECT_LT((last_msg_->vel[0] * 100 - -1726.50623322 * 100), 0.05) + << "incorrect value for vel[0], expected -1726.50623322, is " + << last_msg_->vel[0]; + EXPECT_LT((last_msg_->vel[1] * 100 - -2542.61493683 * 100), 0.05) + << "incorrect value for vel[1], expected -2542.61493683, is " + << last_msg_->vel[1]; + EXPECT_LT((last_msg_->vel[2] * 100 - 869.817733765 * 100), 0.05) + << "incorrect value for vel[2], expected 869.817733765, is " + << last_msg_->vel[2]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepB.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepB.cc index aeae0be6e..ee68acaa1 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepB.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgEphemerisSbasDepB.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgEphemerisSbasDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_sbas_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_sbas_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,107 +82,153 @@ class Test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_sbas_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB0, Test) -{ +}; - uint8_t encoded_frame[] = {85,132,0,123,0,110,22,6,176,207,6,0,106,8,0,0,0,0,0,0,0,64,0,0,0,0,1,0,0,0,128,66,246,57,103,193,0,0,0,34,170,78,34,65,0,0,240,199,84,86,117,193,0,0,0,98,6,250,154,192,0,0,0,217,58,221,163,192,0,0,0,184,138,46,139,64,0,0,0,0,0,64,175,62,0,0,0,0,0,64,175,62,0,0,0,0,0,112,199,62,0,0,0,0,108,177,68,191,0,0,0,0,0,192,163,61,145,104, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgEphemerisSbasDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 132, 0, 123, 0, 110, 22, 6, 176, 207, 6, 0, 106, 8, 0, + 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 1, 0, 0, 0, + 128, 66, 246, 57, 103, 193, 0, 0, 0, 34, 170, 78, 34, 65, 0, + 0, 240, 199, 84, 86, 117, 193, 0, 0, 0, 98, 6, 250, 154, 192, + 0, 0, 0, 217, 58, 221, 163, 192, 0, 0, 0, 184, 138, 46, 139, + 64, 0, 0, 0, 0, 0, 64, 175, 62, 0, 0, 0, 0, 0, 64, + 175, 62, 0, 0, 0, 0, 0, 112, 199, 62, 0, 0, 0, 0, 108, + 177, 68, 191, 0, 0, 0, 0, 0, 192, 163, 61, 145, 104, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_sbas_dep_b_t* test_msg = ( msg_ephemeris_sbas_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->a_gf0 = -0.0006315018981695175; - test_msg->a_gf1 = 8.981260180007666e-12; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[0] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[1] = 9.313225746154785e-07; - if (sizeof(test_msg->acc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); - } - test_msg->acc[2] = 2.7939677238464355e-06; - test_msg->common.fit_interval = 0; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 6; - test_msg->common.sid.sat = 22; - test_msg->common.toe.tow = 446384; - test_msg->common.toe.wn = 2154; - test_msg->common.ura = 2.0; - test_msg->common.valid = 1; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[0] = -12177330.078125; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[1] = 599893.06640625; - if (sizeof(test_msg->pos) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); - } - test_msg->pos[2] = -22373708.49609375; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[0] = -1726.506233215332; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[1] = -2542.6149368286133; - if (sizeof(test_msg->vel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); - } - test_msg->vel[2] = 869.8177337646484; - - EXPECT_EQ(send_message( 0x84, 123, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_sbas_dep_b_t *test_msg = + (msg_ephemeris_sbas_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->a_gf0 = -0.0006315018981695175; + test_msg->a_gf1 = 8.981260180007666e-12; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[0] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[1] = 9.313225746154785e-07; + if (sizeof(test_msg->acc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->acc[0])); + } + test_msg->acc[2] = 2.7939677238464355e-06; + test_msg->common.fit_interval = 0; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 6; + test_msg->common.sid.sat = 22; + test_msg->common.toe.tow = 446384; + test_msg->common.toe.wn = 2154; + test_msg->common.ura = 2.0; + test_msg->common.valid = 1; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[0] = -12177330.078125; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[1] = 599893.06640625; + if (sizeof(test_msg->pos) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->pos[0])); + } + test_msg->pos[2] = -22373708.49609375; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[0] = -1726.506233215332; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[1] = -2542.6149368286133; + if (sizeof(test_msg->vel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->vel[0])); + } + test_msg->vel[2] = 869.8177337646484; + + EXPECT_EQ(send_message(0x84, 123, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->a_gf0*100 - -0.00063150189817*100), 0.05) << "incorrect value for a_gf0, expected -0.00063150189817, is " << last_msg_->a_gf0; - EXPECT_LT((last_msg_->a_gf1*100 - 8.98126018001e-12*100), 0.05) << "incorrect value for a_gf1, expected 8.98126018001e-12, is " << last_msg_->a_gf1; - EXPECT_LT((last_msg_->acc[0]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[0], expected 9.31322574615e-07, is " << last_msg_->acc[0]; - EXPECT_LT((last_msg_->acc[1]*100 - 9.31322574615e-07*100), 0.05) << "incorrect value for acc[1], expected 9.31322574615e-07, is " << last_msg_->acc[1]; - EXPECT_LT((last_msg_->acc[2]*100 - 2.79396772385e-06*100), 0.05) << "incorrect value for acc[2], expected 2.79396772385e-06, is " << last_msg_->acc[2]; - EXPECT_EQ(last_msg_->common.fit_interval, 0) << "incorrect value for common.fit_interval, expected 0, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 6) << "incorrect value for common.sid.code, expected 6, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.sat, 22) << "incorrect value for common.sid.sat, expected 22, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toe.tow, 446384) << "incorrect value for common.toe.tow, expected 446384, is " << last_msg_->common.toe.tow; - EXPECT_EQ(last_msg_->common.toe.wn, 2154) << "incorrect value for common.toe.wn, expected 2154, is " << last_msg_->common.toe.wn; - EXPECT_LT((last_msg_->common.ura*100 - 2.0*100), 0.05) << "incorrect value for common.ura, expected 2.0, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 1) << "incorrect value for common.valid, expected 1, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->pos[0]*100 - -12177330.0781*100), 0.05) << "incorrect value for pos[0], expected -12177330.0781, is " << last_msg_->pos[0]; - EXPECT_LT((last_msg_->pos[1]*100 - 599893.066406*100), 0.05) << "incorrect value for pos[1], expected 599893.066406, is " << last_msg_->pos[1]; - EXPECT_LT((last_msg_->pos[2]*100 - -22373708.4961*100), 0.05) << "incorrect value for pos[2], expected -22373708.4961, is " << last_msg_->pos[2]; - EXPECT_LT((last_msg_->vel[0]*100 - -1726.50623322*100), 0.05) << "incorrect value for vel[0], expected -1726.50623322, is " << last_msg_->vel[0]; - EXPECT_LT((last_msg_->vel[1]*100 - -2542.61493683*100), 0.05) << "incorrect value for vel[1], expected -2542.61493683, is " << last_msg_->vel[1]; - EXPECT_LT((last_msg_->vel[2]*100 - 869.817733765*100), 0.05) << "incorrect value for vel[2], expected 869.817733765, is " << last_msg_->vel[2]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->a_gf0 * 100 - -0.00063150189817 * 100), 0.05) + << "incorrect value for a_gf0, expected -0.00063150189817, is " + << last_msg_->a_gf0; + EXPECT_LT((last_msg_->a_gf1 * 100 - 8.98126018001e-12 * 100), 0.05) + << "incorrect value for a_gf1, expected 8.98126018001e-12, is " + << last_msg_->a_gf1; + EXPECT_LT((last_msg_->acc[0] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[0], expected 9.31322574615e-07, is " + << last_msg_->acc[0]; + EXPECT_LT((last_msg_->acc[1] * 100 - 9.31322574615e-07 * 100), 0.05) + << "incorrect value for acc[1], expected 9.31322574615e-07, is " + << last_msg_->acc[1]; + EXPECT_LT((last_msg_->acc[2] * 100 - 2.79396772385e-06 * 100), 0.05) + << "incorrect value for acc[2], expected 2.79396772385e-06, is " + << last_msg_->acc[2]; + EXPECT_EQ(last_msg_->common.fit_interval, 0) + << "incorrect value for common.fit_interval, expected 0, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 6) + << "incorrect value for common.sid.code, expected 6, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.sat, 22) + << "incorrect value for common.sid.sat, expected 22, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toe.tow, 446384) + << "incorrect value for common.toe.tow, expected 446384, is " + << last_msg_->common.toe.tow; + EXPECT_EQ(last_msg_->common.toe.wn, 2154) + << "incorrect value for common.toe.wn, expected 2154, is " + << last_msg_->common.toe.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 2.0 * 100), 0.05) + << "incorrect value for common.ura, expected 2.0, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 1) + << "incorrect value for common.valid, expected 1, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->pos[0] * 100 - -12177330.0781 * 100), 0.05) + << "incorrect value for pos[0], expected -12177330.0781, is " + << last_msg_->pos[0]; + EXPECT_LT((last_msg_->pos[1] * 100 - 599893.066406 * 100), 0.05) + << "incorrect value for pos[1], expected 599893.066406, is " + << last_msg_->pos[1]; + EXPECT_LT((last_msg_->pos[2] * 100 - -22373708.4961 * 100), 0.05) + << "incorrect value for pos[2], expected -22373708.4961, is " + << last_msg_->pos[2]; + EXPECT_LT((last_msg_->vel[0] * 100 - -1726.50623322 * 100), 0.05) + << "incorrect value for vel[0], expected -1726.50623322, is " + << last_msg_->vel[0]; + EXPECT_LT((last_msg_->vel[1] * 100 - -2542.61493683 * 100), 0.05) + << "incorrect value for vel[1], expected -2542.61493683, is " + << last_msg_->vel[1]; + EXPECT_LT((last_msg_->vel[2] * 100 - 869.817733765 * 100), 0.05) + << "incorrect value for vel[2], expected 869.817733765, is " + << last_msg_->vel[2]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgGloBiases.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgGloBiases.cc index bcf946d6f..d695ad3bd 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgGloBiases.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgGloBiases.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGloBiases.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGloBiases.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgGloBiases0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgGloBiases0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgGloBiases0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgGloBiases0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_glo_biases_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_glo_biases_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,43 +81,50 @@ class Test_legacy_auto_check_sbp_observation_MsgGloBiases0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_glo_biases_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgGloBiases0, Test) -{ +}; - uint8_t encoded_frame[] = {85,117,0,0,0,9,0,0,0,0,0,0,0,0,0,77,211, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgGloBiases0, Test) { + uint8_t encoded_frame[] = { + 85, 117, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 211, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_glo_biases_t* test_msg = ( msg_glo_biases_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->l1ca_bias = 0; - test_msg->l1p_bias = 0; - test_msg->l2ca_bias = 0; - test_msg->l2p_bias = 0; - test_msg->mask = 0; - - EXPECT_EQ(send_message( 0x75, 0, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_glo_biases_t *test_msg = (msg_glo_biases_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->l1ca_bias = 0; + test_msg->l1p_bias = 0; + test_msg->l2ca_bias = 0; + test_msg->l2p_bias = 0; + test_msg->mask = 0; + + EXPECT_EQ(send_message(0x75, 0, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->l1ca_bias, 0) << "incorrect value for l1ca_bias, expected 0, is " << last_msg_->l1ca_bias; - EXPECT_EQ(last_msg_->l1p_bias, 0) << "incorrect value for l1p_bias, expected 0, is " << last_msg_->l1p_bias; - EXPECT_EQ(last_msg_->l2ca_bias, 0) << "incorrect value for l2ca_bias, expected 0, is " << last_msg_->l2ca_bias; - EXPECT_EQ(last_msg_->l2p_bias, 0) << "incorrect value for l2p_bias, expected 0, is " << last_msg_->l2p_bias; - EXPECT_EQ(last_msg_->mask, 0) << "incorrect value for mask, expected 0, is " << last_msg_->mask; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->l1ca_bias, 0) + << "incorrect value for l1ca_bias, expected 0, is " + << last_msg_->l1ca_bias; + EXPECT_EQ(last_msg_->l1p_bias, 0) + << "incorrect value for l1p_bias, expected 0, is " << last_msg_->l1p_bias; + EXPECT_EQ(last_msg_->l2ca_bias, 0) + << "incorrect value for l2ca_bias, expected 0, is " + << last_msg_->l2ca_bias; + EXPECT_EQ(last_msg_->l2p_bias, 0) + << "incorrect value for l2p_bias, expected 0, is " << last_msg_->l2p_bias; + EXPECT_EQ(last_msg_->mask, 0) + << "incorrect value for mask, expected 0, is " << last_msg_->mask; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgGnssCapb.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgGnssCapb.cc index 2a5543508..3206b2c5c 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgGnssCapb.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgGnssCapb.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGnssCapb.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGnssCapb.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgGnssCapb0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgGnssCapb0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgGnssCapb0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgGnssCapb0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gnss_capb_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gnss_capb_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,67 +81,108 @@ class Test_legacy_auto_check_sbp_observation_MsgGnssCapb0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gnss_capb_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgGnssCapb0, Test) -{ +}; - uint8_t encoded_frame[] = {85,150,0,123,0,110,176,207,6,0,106,8,26,171,80,64,0,0,0,0,81,173,144,46,0,0,0,0,209,139,93,108,0,0,0,0,252,204,200,0,205,92,30,49,240,203,21,24,212,93,182,32,0,0,0,0,105,32,192,27,0,0,0,0,40,75,250,114,0,0,0,0,119,147,123,81,0,0,0,0,85,89,4,2,0,0,0,0,233,116,137,22,0,0,0,0,199,109,219,11,221,171,248,82,0,0,0,0,252,62,221,28,0,0,0,0,163,90, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgGnssCapb0, Test) { + uint8_t encoded_frame[] = { + 85, 150, 0, 123, 0, 110, 176, 207, 6, 0, 106, 8, 26, 171, 80, + 64, 0, 0, 0, 0, 81, 173, 144, 46, 0, 0, 0, 0, 209, 139, + 93, 108, 0, 0, 0, 0, 252, 204, 200, 0, 205, 92, 30, 49, 240, + 203, 21, 24, 212, 93, 182, 32, 0, 0, 0, 0, 105, 32, 192, 27, + 0, 0, 0, 0, 40, 75, 250, 114, 0, 0, 0, 0, 119, 147, 123, + 81, 0, 0, 0, 0, 85, 89, 4, 2, 0, 0, 0, 0, 233, 116, + 137, 22, 0, 0, 0, 0, 199, 109, 219, 11, 221, 171, 248, 82, 0, + 0, 0, 0, 252, 62, 221, 28, 0, 0, 0, 0, 163, 90, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gnss_capb_t* test_msg = ( msg_gnss_capb_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->gc.bds_active = 1929005864; - test_msg->gc.bds_b2 = 33839445; - test_msg->gc.bds_b2a = 378107113; - test_msg->gc.bds_d2nav = 1367053175; - test_msg->gc.gal_active = 1392028637; - test_msg->gc.gal_e5 = 484261628; - test_msg->gc.glo_active = 13159676; - test_msg->gc.glo_l2of = 824073421; - test_msg->gc.glo_l3 = 404081648; - test_msg->gc.gps_active = 1079028506; - test_msg->gc.gps_l2c = 781233489; - test_msg->gc.gps_l5 = 1818069969; - test_msg->gc.qzss_active = 198929863; - test_msg->gc.sbas_active = 548822484; - test_msg->gc.sbas_l5 = 465576041; - test_msg->t_nmct.tow = 446384; - test_msg->t_nmct.wn = 2154; - - EXPECT_EQ(send_message( 0x96, 123, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gnss_capb_t *test_msg = (msg_gnss_capb_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->gc.bds_active = 1929005864; + test_msg->gc.bds_b2 = 33839445; + test_msg->gc.bds_b2a = 378107113; + test_msg->gc.bds_d2nav = 1367053175; + test_msg->gc.gal_active = 1392028637; + test_msg->gc.gal_e5 = 484261628; + test_msg->gc.glo_active = 13159676; + test_msg->gc.glo_l2of = 824073421; + test_msg->gc.glo_l3 = 404081648; + test_msg->gc.gps_active = 1079028506; + test_msg->gc.gps_l2c = 781233489; + test_msg->gc.gps_l5 = 1818069969; + test_msg->gc.qzss_active = 198929863; + test_msg->gc.sbas_active = 548822484; + test_msg->gc.sbas_l5 = 465576041; + test_msg->t_nmct.tow = 446384; + test_msg->t_nmct.wn = 2154; + + EXPECT_EQ(send_message(0x96, 123, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->gc.bds_active, 1929005864) << "incorrect value for gc.bds_active, expected 1929005864, is " << last_msg_->gc.bds_active; - EXPECT_EQ(last_msg_->gc.bds_b2, 33839445) << "incorrect value for gc.bds_b2, expected 33839445, is " << last_msg_->gc.bds_b2; - EXPECT_EQ(last_msg_->gc.bds_b2a, 378107113) << "incorrect value for gc.bds_b2a, expected 378107113, is " << last_msg_->gc.bds_b2a; - EXPECT_EQ(last_msg_->gc.bds_d2nav, 1367053175) << "incorrect value for gc.bds_d2nav, expected 1367053175, is " << last_msg_->gc.bds_d2nav; - EXPECT_EQ(last_msg_->gc.gal_active, 1392028637) << "incorrect value for gc.gal_active, expected 1392028637, is " << last_msg_->gc.gal_active; - EXPECT_EQ(last_msg_->gc.gal_e5, 484261628) << "incorrect value for gc.gal_e5, expected 484261628, is " << last_msg_->gc.gal_e5; - EXPECT_EQ(last_msg_->gc.glo_active, 13159676) << "incorrect value for gc.glo_active, expected 13159676, is " << last_msg_->gc.glo_active; - EXPECT_EQ(last_msg_->gc.glo_l2of, 824073421) << "incorrect value for gc.glo_l2of, expected 824073421, is " << last_msg_->gc.glo_l2of; - EXPECT_EQ(last_msg_->gc.glo_l3, 404081648) << "incorrect value for gc.glo_l3, expected 404081648, is " << last_msg_->gc.glo_l3; - EXPECT_EQ(last_msg_->gc.gps_active, 1079028506) << "incorrect value for gc.gps_active, expected 1079028506, is " << last_msg_->gc.gps_active; - EXPECT_EQ(last_msg_->gc.gps_l2c, 781233489) << "incorrect value for gc.gps_l2c, expected 781233489, is " << last_msg_->gc.gps_l2c; - EXPECT_EQ(last_msg_->gc.gps_l5, 1818069969) << "incorrect value for gc.gps_l5, expected 1818069969, is " << last_msg_->gc.gps_l5; - EXPECT_EQ(last_msg_->gc.qzss_active, 198929863) << "incorrect value for gc.qzss_active, expected 198929863, is " << last_msg_->gc.qzss_active; - EXPECT_EQ(last_msg_->gc.sbas_active, 548822484) << "incorrect value for gc.sbas_active, expected 548822484, is " << last_msg_->gc.sbas_active; - EXPECT_EQ(last_msg_->gc.sbas_l5, 465576041) << "incorrect value for gc.sbas_l5, expected 465576041, is " << last_msg_->gc.sbas_l5; - EXPECT_EQ(last_msg_->t_nmct.tow, 446384) << "incorrect value for t_nmct.tow, expected 446384, is " << last_msg_->t_nmct.tow; - EXPECT_EQ(last_msg_->t_nmct.wn, 2154) << "incorrect value for t_nmct.wn, expected 2154, is " << last_msg_->t_nmct.wn; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->gc.bds_active, 1929005864) + << "incorrect value for gc.bds_active, expected 1929005864, is " + << last_msg_->gc.bds_active; + EXPECT_EQ(last_msg_->gc.bds_b2, 33839445) + << "incorrect value for gc.bds_b2, expected 33839445, is " + << last_msg_->gc.bds_b2; + EXPECT_EQ(last_msg_->gc.bds_b2a, 378107113) + << "incorrect value for gc.bds_b2a, expected 378107113, is " + << last_msg_->gc.bds_b2a; + EXPECT_EQ(last_msg_->gc.bds_d2nav, 1367053175) + << "incorrect value for gc.bds_d2nav, expected 1367053175, is " + << last_msg_->gc.bds_d2nav; + EXPECT_EQ(last_msg_->gc.gal_active, 1392028637) + << "incorrect value for gc.gal_active, expected 1392028637, is " + << last_msg_->gc.gal_active; + EXPECT_EQ(last_msg_->gc.gal_e5, 484261628) + << "incorrect value for gc.gal_e5, expected 484261628, is " + << last_msg_->gc.gal_e5; + EXPECT_EQ(last_msg_->gc.glo_active, 13159676) + << "incorrect value for gc.glo_active, expected 13159676, is " + << last_msg_->gc.glo_active; + EXPECT_EQ(last_msg_->gc.glo_l2of, 824073421) + << "incorrect value for gc.glo_l2of, expected 824073421, is " + << last_msg_->gc.glo_l2of; + EXPECT_EQ(last_msg_->gc.glo_l3, 404081648) + << "incorrect value for gc.glo_l3, expected 404081648, is " + << last_msg_->gc.glo_l3; + EXPECT_EQ(last_msg_->gc.gps_active, 1079028506) + << "incorrect value for gc.gps_active, expected 1079028506, is " + << last_msg_->gc.gps_active; + EXPECT_EQ(last_msg_->gc.gps_l2c, 781233489) + << "incorrect value for gc.gps_l2c, expected 781233489, is " + << last_msg_->gc.gps_l2c; + EXPECT_EQ(last_msg_->gc.gps_l5, 1818069969) + << "incorrect value for gc.gps_l5, expected 1818069969, is " + << last_msg_->gc.gps_l5; + EXPECT_EQ(last_msg_->gc.qzss_active, 198929863) + << "incorrect value for gc.qzss_active, expected 198929863, is " + << last_msg_->gc.qzss_active; + EXPECT_EQ(last_msg_->gc.sbas_active, 548822484) + << "incorrect value for gc.sbas_active, expected 548822484, is " + << last_msg_->gc.sbas_active; + EXPECT_EQ(last_msg_->gc.sbas_l5, 465576041) + << "incorrect value for gc.sbas_l5, expected 465576041, is " + << last_msg_->gc.sbas_l5; + EXPECT_EQ(last_msg_->t_nmct.tow, 446384) + << "incorrect value for t_nmct.tow, expected 446384, is " + << last_msg_->t_nmct.tow; + EXPECT_EQ(last_msg_->t_nmct.wn, 2154) + << "incorrect value for t_nmct.wn, expected 2154, is " + << last_msg_->t_nmct.wn; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgGroupDelay.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgGroupDelay.cc index 5dc79ea31..62c40a147 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgGroupDelay.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgGroupDelay.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelay.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelay.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgGroupDelay0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgGroupDelay0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgGroupDelay0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgGroupDelay0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_group_delay_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_group_delay_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,49 +81,62 @@ class Test_legacy_auto_check_sbp_observation_MsgGroupDelay0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_group_delay_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgGroupDelay0, Test) -{ +}; - uint8_t encoded_frame[] = {85,148,0,123,0,15,176,207,6,0,106,8,22,0,1,254,253,165,255,237,23,2,201, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgGroupDelay0, Test) { + uint8_t encoded_frame[] = { + 85, 148, 0, 123, 0, 15, 176, 207, 6, 0, 106, 8, + 22, 0, 1, 254, 253, 165, 255, 237, 23, 2, 201, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_group_delay_t* test_msg = ( msg_group_delay_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->isc_l1ca = -91; - test_msg->isc_l2c = 6125; - test_msg->sid.code = 0; - test_msg->sid.sat = 22; - test_msg->t_op.tow = 446384; - test_msg->t_op.wn = 2154; - test_msg->tgd = -514; - test_msg->valid = 1; - - EXPECT_EQ(send_message( 0x94, 123, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_group_delay_t *test_msg = (msg_group_delay_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->isc_l1ca = -91; + test_msg->isc_l2c = 6125; + test_msg->sid.code = 0; + test_msg->sid.sat = 22; + test_msg->t_op.tow = 446384; + test_msg->t_op.wn = 2154; + test_msg->tgd = -514; + test_msg->valid = 1; + + EXPECT_EQ(send_message(0x94, 123, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->isc_l1ca, -91) << "incorrect value for isc_l1ca, expected -91, is " << last_msg_->isc_l1ca; - EXPECT_EQ(last_msg_->isc_l2c, 6125) << "incorrect value for isc_l2c, expected 6125, is " << last_msg_->isc_l2c; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.sat, 22) << "incorrect value for sid.sat, expected 22, is " << last_msg_->sid.sat; - EXPECT_EQ(last_msg_->t_op.tow, 446384) << "incorrect value for t_op.tow, expected 446384, is " << last_msg_->t_op.tow; - EXPECT_EQ(last_msg_->t_op.wn, 2154) << "incorrect value for t_op.wn, expected 2154, is " << last_msg_->t_op.wn; - EXPECT_EQ(last_msg_->tgd, -514) << "incorrect value for tgd, expected -514, is " << last_msg_->tgd; - EXPECT_EQ(last_msg_->valid, 1) << "incorrect value for valid, expected 1, is " << last_msg_->valid; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->isc_l1ca, -91) + << "incorrect value for isc_l1ca, expected -91, is " + << last_msg_->isc_l1ca; + EXPECT_EQ(last_msg_->isc_l2c, 6125) + << "incorrect value for isc_l2c, expected 6125, is " + << last_msg_->isc_l2c; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.sat, 22) + << "incorrect value for sid.sat, expected 22, is " << last_msg_->sid.sat; + EXPECT_EQ(last_msg_->t_op.tow, 446384) + << "incorrect value for t_op.tow, expected 446384, is " + << last_msg_->t_op.tow; + EXPECT_EQ(last_msg_->t_op.wn, 2154) + << "incorrect value for t_op.wn, expected 2154, is " + << last_msg_->t_op.wn; + EXPECT_EQ(last_msg_->tgd, -514) + << "incorrect value for tgd, expected -514, is " << last_msg_->tgd; + EXPECT_EQ(last_msg_->valid, 1) + << "incorrect value for valid, expected 1, is " << last_msg_->valid; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgGroupDelayDepA.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgGroupDelayDepA.cc index c0d5bc8d6..ee3294224 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgGroupDelayDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgGroupDelayDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgGroupDelayDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgGroupDelayDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgGroupDelayDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgGroupDelayDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_group_delay_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_group_delay_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,47 +82,60 @@ class Test_legacy_auto_check_sbp_observation_MsgGroupDelayDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_group_delay_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgGroupDelayDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,146,0,123,0,14,176,207,6,0,106,8,22,1,254,253,165,255,237,23,162,91, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgGroupDelayDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 146, 0, 123, 0, 14, 176, 207, 6, 0, 106, + 8, 22, 1, 254, 253, 165, 255, 237, 23, 162, 91, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_group_delay_dep_a_t* test_msg = ( msg_group_delay_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->isc_l1ca = -91; - test_msg->isc_l2c = 6125; - test_msg->prn = 22; - test_msg->t_op.tow = 446384; - test_msg->t_op.wn = 2154; - test_msg->tgd = -514; - test_msg->valid = 1; - - EXPECT_EQ(send_message( 0x92, 123, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_group_delay_dep_a_t *test_msg = + (msg_group_delay_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->isc_l1ca = -91; + test_msg->isc_l2c = 6125; + test_msg->prn = 22; + test_msg->t_op.tow = 446384; + test_msg->t_op.wn = 2154; + test_msg->tgd = -514; + test_msg->valid = 1; + + EXPECT_EQ(send_message(0x92, 123, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->isc_l1ca, -91) << "incorrect value for isc_l1ca, expected -91, is " << last_msg_->isc_l1ca; - EXPECT_EQ(last_msg_->isc_l2c, 6125) << "incorrect value for isc_l2c, expected 6125, is " << last_msg_->isc_l2c; - EXPECT_EQ(last_msg_->prn, 22) << "incorrect value for prn, expected 22, is " << last_msg_->prn; - EXPECT_EQ(last_msg_->t_op.tow, 446384) << "incorrect value for t_op.tow, expected 446384, is " << last_msg_->t_op.tow; - EXPECT_EQ(last_msg_->t_op.wn, 2154) << "incorrect value for t_op.wn, expected 2154, is " << last_msg_->t_op.wn; - EXPECT_EQ(last_msg_->tgd, -514) << "incorrect value for tgd, expected -514, is " << last_msg_->tgd; - EXPECT_EQ(last_msg_->valid, 1) << "incorrect value for valid, expected 1, is " << last_msg_->valid; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->isc_l1ca, -91) + << "incorrect value for isc_l1ca, expected -91, is " + << last_msg_->isc_l1ca; + EXPECT_EQ(last_msg_->isc_l2c, 6125) + << "incorrect value for isc_l2c, expected 6125, is " + << last_msg_->isc_l2c; + EXPECT_EQ(last_msg_->prn, 22) + << "incorrect value for prn, expected 22, is " << last_msg_->prn; + EXPECT_EQ(last_msg_->t_op.tow, 446384) + << "incorrect value for t_op.tow, expected 446384, is " + << last_msg_->t_op.tow; + EXPECT_EQ(last_msg_->t_op.wn, 2154) + << "incorrect value for t_op.wn, expected 2154, is " + << last_msg_->t_op.wn; + EXPECT_EQ(last_msg_->tgd, -514) + << "incorrect value for tgd, expected -514, is " << last_msg_->tgd; + EXPECT_EQ(last_msg_->valid, 1) + << "incorrect value for valid, expected 1, is " << last_msg_->valid; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgGroupDelayDepB.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgGroupDelayDepB.cc index 144bf5724..b9da6c710 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgGroupDelayDepB.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgGroupDelayDepB.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgGroupDelayDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgGroupDelayDepB0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgGroupDelayDepB0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgGroupDelayDepB0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgGroupDelayDepB0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_group_delay_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_group_delay_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,51 +82,67 @@ class Test_legacy_auto_check_sbp_observation_MsgGroupDelayDepB0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_group_delay_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgGroupDelayDepB0, Test) -{ +}; - uint8_t encoded_frame[] = {85,147,0,123,0,17,176,207,6,0,106,8,22,0,0,0,1,254,253,165,255,237,23,221,202, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgGroupDelayDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 147, 0, 123, 0, 17, 176, 207, 6, 0, 106, 8, 22, + 0, 0, 0, 1, 254, 253, 165, 255, 237, 23, 221, 202, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_group_delay_dep_b_t* test_msg = ( msg_group_delay_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->isc_l1ca = -91; - test_msg->isc_l2c = 6125; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 22; - test_msg->t_op.tow = 446384; - test_msg->t_op.wn = 2154; - test_msg->tgd = -514; - test_msg->valid = 1; - - EXPECT_EQ(send_message( 0x93, 123, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_group_delay_dep_b_t *test_msg = + (msg_group_delay_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->isc_l1ca = -91; + test_msg->isc_l2c = 6125; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 22; + test_msg->t_op.tow = 446384; + test_msg->t_op.wn = 2154; + test_msg->tgd = -514; + test_msg->valid = 1; + + EXPECT_EQ(send_message(0x93, 123, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->isc_l1ca, -91) << "incorrect value for isc_l1ca, expected -91, is " << last_msg_->isc_l1ca; - EXPECT_EQ(last_msg_->isc_l2c, 6125) << "incorrect value for isc_l2c, expected 6125, is " << last_msg_->isc_l2c; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 22) << "incorrect value for sid.sat, expected 22, is " << last_msg_->sid.sat; - EXPECT_EQ(last_msg_->t_op.tow, 446384) << "incorrect value for t_op.tow, expected 446384, is " << last_msg_->t_op.tow; - EXPECT_EQ(last_msg_->t_op.wn, 2154) << "incorrect value for t_op.wn, expected 2154, is " << last_msg_->t_op.wn; - EXPECT_EQ(last_msg_->tgd, -514) << "incorrect value for tgd, expected -514, is " << last_msg_->tgd; - EXPECT_EQ(last_msg_->valid, 1) << "incorrect value for valid, expected 1, is " << last_msg_->valid; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->isc_l1ca, -91) + << "incorrect value for isc_l1ca, expected -91, is " + << last_msg_->isc_l1ca; + EXPECT_EQ(last_msg_->isc_l2c, 6125) + << "incorrect value for isc_l2c, expected 6125, is " + << last_msg_->isc_l2c; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 22) + << "incorrect value for sid.sat, expected 22, is " << last_msg_->sid.sat; + EXPECT_EQ(last_msg_->t_op.tow, 446384) + << "incorrect value for t_op.tow, expected 446384, is " + << last_msg_->t_op.tow; + EXPECT_EQ(last_msg_->t_op.wn, 2154) + << "incorrect value for t_op.wn, expected 2154, is " + << last_msg_->t_op.wn; + EXPECT_EQ(last_msg_->tgd, -514) + << "incorrect value for tgd, expected -514, is " << last_msg_->tgd; + EXPECT_EQ(last_msg_->valid, 1) + << "incorrect value for valid, expected 1, is " << last_msg_->valid; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgIono.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgIono.cc index 5340ad552..6b3193c63 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgIono.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgIono.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgIono.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgIono.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgIono0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgIono0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgIono0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgIono0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_iono_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_iono_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,53 +81,73 @@ class Test_legacy_auto_check_sbp_observation_MsgIono0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_iono_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgIono0, Test) -{ +}; - uint8_t encoded_frame[] = {85,144,0,123,0,70,0,0,0,0,0,0,0,0,0,0,0,0,52,62,0,0,0,0,0,0,80,62,0,0,0,0,0,0,112,190,0,0,0,0,0,0,112,190,0,0,0,0,0,0,243,64,0,0,0,0,0,0,232,64,0,0,0,0,0,0,240,192,0,0,0,0,0,0,20,193,101,31, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgIono0, Test) { + uint8_t encoded_frame[] = { + 85, 144, 0, 123, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 62, 0, 0, 0, 0, 0, 0, 80, 62, 0, 0, 0, 0, + 0, 0, 112, 190, 0, 0, 0, 0, 0, 0, 112, 190, 0, 0, 0, 0, + 0, 0, 243, 64, 0, 0, 0, 0, 0, 0, 232, 64, 0, 0, 0, 0, + 0, 0, 240, 192, 0, 0, 0, 0, 0, 0, 20, 193, 101, 31, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_iono_t* test_msg = ( msg_iono_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->a0 = 4.6566128730773926e-09; - test_msg->a1 = 1.4901161193847656e-08; - test_msg->a2 = -5.960464477539063e-08; - test_msg->a3 = -5.960464477539063e-08; - test_msg->b0 = 77824.0; - test_msg->b1 = 49152.0; - test_msg->b2 = -65536.0; - test_msg->b3 = -327680.0; - test_msg->t_nmct.tow = 0; - test_msg->t_nmct.wn = 0; - - EXPECT_EQ(send_message( 0x90, 123, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_iono_t *test_msg = (msg_iono_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->a0 = 4.6566128730773926e-09; + test_msg->a1 = 1.4901161193847656e-08; + test_msg->a2 = -5.960464477539063e-08; + test_msg->a3 = -5.960464477539063e-08; + test_msg->b0 = 77824.0; + test_msg->b1 = 49152.0; + test_msg->b2 = -65536.0; + test_msg->b3 = -327680.0; + test_msg->t_nmct.tow = 0; + test_msg->t_nmct.wn = 0; + + EXPECT_EQ(send_message(0x90, 123, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->a0*100 - 4.65661287308e-09*100), 0.05) << "incorrect value for a0, expected 4.65661287308e-09, is " << last_msg_->a0; - EXPECT_LT((last_msg_->a1*100 - 1.49011611938e-08*100), 0.05) << "incorrect value for a1, expected 1.49011611938e-08, is " << last_msg_->a1; - EXPECT_LT((last_msg_->a2*100 - -5.96046447754e-08*100), 0.05) << "incorrect value for a2, expected -5.96046447754e-08, is " << last_msg_->a2; - EXPECT_LT((last_msg_->a3*100 - -5.96046447754e-08*100), 0.05) << "incorrect value for a3, expected -5.96046447754e-08, is " << last_msg_->a3; - EXPECT_LT((last_msg_->b0*100 - 77824.0*100), 0.05) << "incorrect value for b0, expected 77824.0, is " << last_msg_->b0; - EXPECT_LT((last_msg_->b1*100 - 49152.0*100), 0.05) << "incorrect value for b1, expected 49152.0, is " << last_msg_->b1; - EXPECT_LT((last_msg_->b2*100 - -65536.0*100), 0.05) << "incorrect value for b2, expected -65536.0, is " << last_msg_->b2; - EXPECT_LT((last_msg_->b3*100 - -327680.0*100), 0.05) << "incorrect value for b3, expected -327680.0, is " << last_msg_->b3; - EXPECT_EQ(last_msg_->t_nmct.tow, 0) << "incorrect value for t_nmct.tow, expected 0, is " << last_msg_->t_nmct.tow; - EXPECT_EQ(last_msg_->t_nmct.wn, 0) << "incorrect value for t_nmct.wn, expected 0, is " << last_msg_->t_nmct.wn; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->a0 * 100 - 4.65661287308e-09 * 100), 0.05) + << "incorrect value for a0, expected 4.65661287308e-09, is " + << last_msg_->a0; + EXPECT_LT((last_msg_->a1 * 100 - 1.49011611938e-08 * 100), 0.05) + << "incorrect value for a1, expected 1.49011611938e-08, is " + << last_msg_->a1; + EXPECT_LT((last_msg_->a2 * 100 - -5.96046447754e-08 * 100), 0.05) + << "incorrect value for a2, expected -5.96046447754e-08, is " + << last_msg_->a2; + EXPECT_LT((last_msg_->a3 * 100 - -5.96046447754e-08 * 100), 0.05) + << "incorrect value for a3, expected -5.96046447754e-08, is " + << last_msg_->a3; + EXPECT_LT((last_msg_->b0 * 100 - 77824.0 * 100), 0.05) + << "incorrect value for b0, expected 77824.0, is " << last_msg_->b0; + EXPECT_LT((last_msg_->b1 * 100 - 49152.0 * 100), 0.05) + << "incorrect value for b1, expected 49152.0, is " << last_msg_->b1; + EXPECT_LT((last_msg_->b2 * 100 - -65536.0 * 100), 0.05) + << "incorrect value for b2, expected -65536.0, is " << last_msg_->b2; + EXPECT_LT((last_msg_->b3 * 100 - -327680.0 * 100), 0.05) + << "incorrect value for b3, expected -327680.0, is " << last_msg_->b3; + EXPECT_EQ(last_msg_->t_nmct.tow, 0) + << "incorrect value for t_nmct.tow, expected 0, is " + << last_msg_->t_nmct.tow; + EXPECT_EQ(last_msg_->t_nmct.wn, 0) + << "incorrect value for t_nmct.wn, expected 0, is " + << last_msg_->t_nmct.wn; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgObs.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgObs.cc index f22f6e17f..1e5a4682b 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgObs.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgObs.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgObs.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgObs.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgObs0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgObs0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgObs0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgObs0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,428 +81,727 @@ class Test_legacy_auto_check_sbp_observation_MsgObs0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgObs0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_MsgObs0, Test) { + uint8_t encoded_frame[] = { + 85, 74, 0, 129, 240, 249, 152, 202, 226, 25, 0, 0, 0, 0, 106, + 8, 32, 49, 227, 254, 62, 121, 242, 158, 6, 146, 0, 250, 172, 182, + 10, 15, 10, 0, 30, 228, 254, 62, 12, 189, 40, 5, 59, 83, 251, + 172, 178, 10, 15, 10, 1, 215, 205, 144, 72, 106, 111, 160, 7, 243, + 109, 243, 119, 158, 10, 15, 18, 0, 25, 207, 144, 72, 223, 96, 241, + 5, 12, 52, 246, 27, 125, 9, 11, 18, 1, 34, 184, 223, 74, 150, + 138, 222, 7, 53, 13, 11, 245, 114, 9, 15, 22, 0, 113, 80, 6, + 69, 162, 41, 65, 7, 70, 127, 246, 246, 189, 9, 15, 23, 0, 247, + 80, 6, 69, 213, 35, 167, 5, 221, 152, 248, 231, 158, 9, 11, 23, + 1, 8, 146, 166, 64, 12, 122, 203, 6, 114, 51, 248, 67, 93, 3, + 11, 27, 0, 221, 172, 173, 75, 217, 47, 244, 7, 232, 225, 11, 237, + 123, 5, 15, 31, 0, 250, 174, 173, 75, 216, 163, 50, 6, 40, 70, + 9, 62, 120, 3, 11, 31, 1, 135, 16, 6, 66, 99, 218, 11, 7, + 7, 138, 242, 96, 176, 10, 15, 2, 3, 148, 130, 6, 58, 217, 88, + 54, 6, 203, 21, 252, 96, 170, 10, 15, 3, 3, 186, 108, 197, 63, + 127, 54, 211, 6, 80, 4, 241, 219, 200, 10, 15, 17, 3, 167, 195, + 8, 57, 19, 204, 22, 6, 105, 51, 254, 182, 152, 10, 15, 18, 3, + 237, 248, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_t *test_msg = (msg_obs_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 32; + test_msg->header.t.ns_residual = 0; + test_msg->header.t.tow = 434293400; + test_msg->header.t.wn = 2154; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].D.f = 172; + test_msg->obs[0].D.i = -1536; + test_msg->obs[0].L.f = 146; + test_msg->obs[0].L.i = 111080057; + test_msg->obs[0].P = 1056891697; + test_msg->obs[0].cn0 = 182; + test_msg->obs[0].flags = 15; + test_msg->obs[0].lock = 10; + test_msg->obs[0].sid.code = 0; + test_msg->obs[0].sid.sat = 10; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].D.f = 172; + test_msg->obs[1].D.i = -1197; + test_msg->obs[1].L.f = 59; + test_msg->obs[1].L.i = 86555916; + test_msg->obs[1].P = 1056891934; + test_msg->obs[1].cn0 = 178; + test_msg->obs[1].flags = 15; + test_msg->obs[1].lock = 10; + test_msg->obs[1].sid.code = 1; + test_msg->obs[1].sid.sat = 10; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].D.f = 119; + test_msg->obs[2].D.i = -3219; + test_msg->obs[2].L.f = 243; + test_msg->obs[2].L.i = 127954794; + test_msg->obs[2].P = 1217449431; + test_msg->obs[2].cn0 = 158; + test_msg->obs[2].flags = 15; + test_msg->obs[2].lock = 10; + test_msg->obs[2].sid.code = 0; + test_msg->obs[2].sid.sat = 18; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[3].D.f = 27; + test_msg->obs[3].D.i = -2508; + test_msg->obs[3].L.f = 12; + test_msg->obs[3].L.i = 99705055; + test_msg->obs[3].P = 1217449753; + test_msg->obs[3].cn0 = 125; + test_msg->obs[3].flags = 11; + test_msg->obs[3].lock = 9; + test_msg->obs[3].sid.code = 1; + test_msg->obs[3].sid.sat = 18; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[4].D.f = 245; + test_msg->obs[4].D.i = 2829; + test_msg->obs[4].L.f = 53; + test_msg->obs[4].L.i = 132024982; + test_msg->obs[4].P = 1256175650; + test_msg->obs[4].cn0 = 114; + test_msg->obs[4].flags = 15; + test_msg->obs[4].lock = 9; + test_msg->obs[4].sid.code = 0; + test_msg->obs[4].sid.sat = 22; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[5].D.f = 246; + test_msg->obs[5].D.i = -2433; + test_msg->obs[5].L.f = 70; + test_msg->obs[5].L.i = 121711010; + test_msg->obs[5].P = 1158041713; + test_msg->obs[5].cn0 = 189; + test_msg->obs[5].flags = 15; + test_msg->obs[5].lock = 9; + test_msg->obs[5].sid.code = 0; + test_msg->obs[5].sid.sat = 23; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[6].D.f = 231; + test_msg->obs[6].D.i = -1896; + test_msg->obs[6].L.f = 221; + test_msg->obs[6].L.i = 94839765; + test_msg->obs[6].P = 1158041847; + test_msg->obs[6].cn0 = 158; + test_msg->obs[6].flags = 11; + test_msg->obs[6].lock = 9; + test_msg->obs[6].sid.code = 1; + test_msg->obs[6].sid.sat = 23; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[7].D.f = 67; + test_msg->obs[7].D.i = -1997; + test_msg->obs[7].L.f = 114; + test_msg->obs[7].L.i = 113998348; + test_msg->obs[7].P = 1084658184; + test_msg->obs[7].cn0 = 93; + test_msg->obs[7].flags = 11; + test_msg->obs[7].lock = 3; + test_msg->obs[7].sid.code = 0; + test_msg->obs[7].sid.sat = 27; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[8].D.f = 237; + test_msg->obs[8].D.i = 3041; + test_msg->obs[8].L.f = 232; + test_msg->obs[8].L.i = 133443545; + test_msg->obs[8].P = 1269673181; + test_msg->obs[8].cn0 = 123; + test_msg->obs[8].flags = 15; + test_msg->obs[8].lock = 5; + test_msg->obs[8].sid.code = 0; + test_msg->obs[8].sid.sat = 31; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[9].D.f = 62; + test_msg->obs[9].D.i = 2374; + test_msg->obs[9].L.f = 40; + test_msg->obs[9].L.i = 103982040; + test_msg->obs[9].P = 1269673722; + test_msg->obs[9].cn0 = 120; + test_msg->obs[9].flags = 11; + test_msg->obs[9].lock = 3; + test_msg->obs[9].sid.code = 1; + test_msg->obs[9].sid.sat = 31; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[10].D.f = 96; + test_msg->obs[10].D.i = -3446; + test_msg->obs[10].L.f = 7; + test_msg->obs[10].L.i = 118217315; + test_msg->obs[10].P = 1107693703; + test_msg->obs[10].cn0 = 176; + test_msg->obs[10].flags = 15; + test_msg->obs[10].lock = 10; + test_msg->obs[10].sid.code = 3; + test_msg->obs[10].sid.sat = 2; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[11].D.f = 96; + test_msg->obs[11].D.i = -1003; + test_msg->obs[11].L.f = 203; + test_msg->obs[11].L.i = 104224985; + test_msg->obs[11].P = 973505172; + test_msg->obs[11].cn0 = 170; + test_msg->obs[11].flags = 15; + test_msg->obs[11].lock = 10; + test_msg->obs[11].sid.code = 3; + test_msg->obs[11].sid.sat = 3; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[12].D.f = 219; + test_msg->obs[12].D.i = -3836; + test_msg->obs[12].L.f = 80; + test_msg->obs[12].L.i = 114505343; + test_msg->obs[12].P = 1069903034; + test_msg->obs[12].cn0 = 200; + test_msg->obs[12].flags = 15; + test_msg->obs[12].lock = 10; + test_msg->obs[12].sid.code = 3; + test_msg->obs[12].sid.sat = 17; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[13].D.f = 182; + test_msg->obs[13].D.i = -461; + test_msg->obs[13].L.f = 105; + test_msg->obs[13].L.i = 102157331; + test_msg->obs[13].P = 956875687; + test_msg->obs[13].cn0 = 152; + test_msg->obs[13].flags = 15; + test_msg->obs[13].lock = 10; + test_msg->obs[13].sid.code = 3; + test_msg->obs[13].sid.sat = 18; + + EXPECT_EQ(send_message(0x4a, 61569, test_msg_len, test_msg_storage), SBP_OK); - uint8_t encoded_frame[] = {85,74,0,129,240,249,152,202,226,25,0,0,0,0,106,8,32,49,227,254,62,121,242,158,6,146,0,250,172,182,10,15,10,0,30,228,254,62,12,189,40,5,59,83,251,172,178,10,15,10,1,215,205,144,72,106,111,160,7,243,109,243,119,158,10,15,18,0,25,207,144,72,223,96,241,5,12,52,246,27,125,9,11,18,1,34,184,223,74,150,138,222,7,53,13,11,245,114,9,15,22,0,113,80,6,69,162,41,65,7,70,127,246,246,189,9,15,23,0,247,80,6,69,213,35,167,5,221,152,248,231,158,9,11,23,1,8,146,166,64,12,122,203,6,114,51,248,67,93,3,11,27,0,221,172,173,75,217,47,244,7,232,225,11,237,123,5,15,31,0,250,174,173,75,216,163,50,6,40,70,9,62,120,3,11,31,1,135,16,6,66,99,218,11,7,7,138,242,96,176,10,15,2,3,148,130,6,58,217,88,54,6,203,21,252,96,170,10,15,3,3,186,108,197,63,127,54,211,6,80,4,241,219,200,10,15,17,3,167,195,8,57,19,204,22,6,105,51,254,182,152,10,15,18,3,237,248, }; + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_t* test_msg = ( msg_obs_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 32; - test_msg->header.t.ns_residual = 0; - test_msg->header.t.tow = 434293400; - test_msg->header.t.wn = 2154; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].D.f = 172; - test_msg->obs[0].D.i = -1536; - test_msg->obs[0].L.f = 146; - test_msg->obs[0].L.i = 111080057; - test_msg->obs[0].P = 1056891697; - test_msg->obs[0].cn0 = 182; - test_msg->obs[0].flags = 15; - test_msg->obs[0].lock = 10; - test_msg->obs[0].sid.code = 0; - test_msg->obs[0].sid.sat = 10; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].D.f = 172; - test_msg->obs[1].D.i = -1197; - test_msg->obs[1].L.f = 59; - test_msg->obs[1].L.i = 86555916; - test_msg->obs[1].P = 1056891934; - test_msg->obs[1].cn0 = 178; - test_msg->obs[1].flags = 15; - test_msg->obs[1].lock = 10; - test_msg->obs[1].sid.code = 1; - test_msg->obs[1].sid.sat = 10; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].D.f = 119; - test_msg->obs[2].D.i = -3219; - test_msg->obs[2].L.f = 243; - test_msg->obs[2].L.i = 127954794; - test_msg->obs[2].P = 1217449431; - test_msg->obs[2].cn0 = 158; - test_msg->obs[2].flags = 15; - test_msg->obs[2].lock = 10; - test_msg->obs[2].sid.code = 0; - test_msg->obs[2].sid.sat = 18; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[3].D.f = 27; - test_msg->obs[3].D.i = -2508; - test_msg->obs[3].L.f = 12; - test_msg->obs[3].L.i = 99705055; - test_msg->obs[3].P = 1217449753; - test_msg->obs[3].cn0 = 125; - test_msg->obs[3].flags = 11; - test_msg->obs[3].lock = 9; - test_msg->obs[3].sid.code = 1; - test_msg->obs[3].sid.sat = 18; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[4].D.f = 245; - test_msg->obs[4].D.i = 2829; - test_msg->obs[4].L.f = 53; - test_msg->obs[4].L.i = 132024982; - test_msg->obs[4].P = 1256175650; - test_msg->obs[4].cn0 = 114; - test_msg->obs[4].flags = 15; - test_msg->obs[4].lock = 9; - test_msg->obs[4].sid.code = 0; - test_msg->obs[4].sid.sat = 22; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[5].D.f = 246; - test_msg->obs[5].D.i = -2433; - test_msg->obs[5].L.f = 70; - test_msg->obs[5].L.i = 121711010; - test_msg->obs[5].P = 1158041713; - test_msg->obs[5].cn0 = 189; - test_msg->obs[5].flags = 15; - test_msg->obs[5].lock = 9; - test_msg->obs[5].sid.code = 0; - test_msg->obs[5].sid.sat = 23; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[6].D.f = 231; - test_msg->obs[6].D.i = -1896; - test_msg->obs[6].L.f = 221; - test_msg->obs[6].L.i = 94839765; - test_msg->obs[6].P = 1158041847; - test_msg->obs[6].cn0 = 158; - test_msg->obs[6].flags = 11; - test_msg->obs[6].lock = 9; - test_msg->obs[6].sid.code = 1; - test_msg->obs[6].sid.sat = 23; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[7].D.f = 67; - test_msg->obs[7].D.i = -1997; - test_msg->obs[7].L.f = 114; - test_msg->obs[7].L.i = 113998348; - test_msg->obs[7].P = 1084658184; - test_msg->obs[7].cn0 = 93; - test_msg->obs[7].flags = 11; - test_msg->obs[7].lock = 3; - test_msg->obs[7].sid.code = 0; - test_msg->obs[7].sid.sat = 27; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[8].D.f = 237; - test_msg->obs[8].D.i = 3041; - test_msg->obs[8].L.f = 232; - test_msg->obs[8].L.i = 133443545; - test_msg->obs[8].P = 1269673181; - test_msg->obs[8].cn0 = 123; - test_msg->obs[8].flags = 15; - test_msg->obs[8].lock = 5; - test_msg->obs[8].sid.code = 0; - test_msg->obs[8].sid.sat = 31; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[9].D.f = 62; - test_msg->obs[9].D.i = 2374; - test_msg->obs[9].L.f = 40; - test_msg->obs[9].L.i = 103982040; - test_msg->obs[9].P = 1269673722; - test_msg->obs[9].cn0 = 120; - test_msg->obs[9].flags = 11; - test_msg->obs[9].lock = 3; - test_msg->obs[9].sid.code = 1; - test_msg->obs[9].sid.sat = 31; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[10].D.f = 96; - test_msg->obs[10].D.i = -3446; - test_msg->obs[10].L.f = 7; - test_msg->obs[10].L.i = 118217315; - test_msg->obs[10].P = 1107693703; - test_msg->obs[10].cn0 = 176; - test_msg->obs[10].flags = 15; - test_msg->obs[10].lock = 10; - test_msg->obs[10].sid.code = 3; - test_msg->obs[10].sid.sat = 2; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[11].D.f = 96; - test_msg->obs[11].D.i = -1003; - test_msg->obs[11].L.f = 203; - test_msg->obs[11].L.i = 104224985; - test_msg->obs[11].P = 973505172; - test_msg->obs[11].cn0 = 170; - test_msg->obs[11].flags = 15; - test_msg->obs[11].lock = 10; - test_msg->obs[11].sid.code = 3; - test_msg->obs[11].sid.sat = 3; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[12].D.f = 219; - test_msg->obs[12].D.i = -3836; - test_msg->obs[12].L.f = 80; - test_msg->obs[12].L.i = 114505343; - test_msg->obs[12].P = 1069903034; - test_msg->obs[12].cn0 = 200; - test_msg->obs[12].flags = 15; - test_msg->obs[12].lock = 10; - test_msg->obs[12].sid.code = 3; - test_msg->obs[12].sid.sat = 17; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[13].D.f = 182; - test_msg->obs[13].D.i = -461; - test_msg->obs[13].L.f = 105; - test_msg->obs[13].L.i = 102157331; - test_msg->obs[13].P = 956875687; - test_msg->obs[13].cn0 = 152; - test_msg->obs[13].flags = 15; - test_msg->obs[13].lock = 10; - test_msg->obs[13].sid.code = 3; - test_msg->obs[13].sid.sat = 18; - - EXPECT_EQ(send_message( 0x4a, 61569, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61569); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 32) << "incorrect value for header.n_obs, expected 32, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.ns_residual, 0) << "incorrect value for header.t.ns_residual, expected 0, is " << last_msg_->header.t.ns_residual; - EXPECT_EQ(last_msg_->header.t.tow, 434293400) << "incorrect value for header.t.tow, expected 434293400, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 2154) << "incorrect value for header.t.wn, expected 2154, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].D.f, 172) << "incorrect value for obs[0].D.f, expected 172, is " << last_msg_->obs[0].D.f; - EXPECT_EQ(last_msg_->obs[0].D.i, -1536) << "incorrect value for obs[0].D.i, expected -1536, is " << last_msg_->obs[0].D.i; - EXPECT_EQ(last_msg_->obs[0].L.f, 146) << "incorrect value for obs[0].L.f, expected 146, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, 111080057) << "incorrect value for obs[0].L.i, expected 111080057, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 1056891697) << "incorrect value for obs[0].P, expected 1056891697, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 182) << "incorrect value for obs[0].cn0, expected 182, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].flags, 15) << "incorrect value for obs[0].flags, expected 15, is " << last_msg_->obs[0].flags; - EXPECT_EQ(last_msg_->obs[0].lock, 10) << "incorrect value for obs[0].lock, expected 10, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].sid.code, 0) << "incorrect value for obs[0].sid.code, expected 0, is " << last_msg_->obs[0].sid.code; - EXPECT_EQ(last_msg_->obs[0].sid.sat, 10) << "incorrect value for obs[0].sid.sat, expected 10, is " << last_msg_->obs[0].sid.sat; - EXPECT_EQ(last_msg_->obs[1].D.f, 172) << "incorrect value for obs[1].D.f, expected 172, is " << last_msg_->obs[1].D.f; - EXPECT_EQ(last_msg_->obs[1].D.i, -1197) << "incorrect value for obs[1].D.i, expected -1197, is " << last_msg_->obs[1].D.i; - EXPECT_EQ(last_msg_->obs[1].L.f, 59) << "incorrect value for obs[1].L.f, expected 59, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, 86555916) << "incorrect value for obs[1].L.i, expected 86555916, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 1056891934) << "incorrect value for obs[1].P, expected 1056891934, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].cn0, 178) << "incorrect value for obs[1].cn0, expected 178, is " << last_msg_->obs[1].cn0; - EXPECT_EQ(last_msg_->obs[1].flags, 15) << "incorrect value for obs[1].flags, expected 15, is " << last_msg_->obs[1].flags; - EXPECT_EQ(last_msg_->obs[1].lock, 10) << "incorrect value for obs[1].lock, expected 10, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].sid.code, 1) << "incorrect value for obs[1].sid.code, expected 1, is " << last_msg_->obs[1].sid.code; - EXPECT_EQ(last_msg_->obs[1].sid.sat, 10) << "incorrect value for obs[1].sid.sat, expected 10, is " << last_msg_->obs[1].sid.sat; - EXPECT_EQ(last_msg_->obs[2].D.f, 119) << "incorrect value for obs[2].D.f, expected 119, is " << last_msg_->obs[2].D.f; - EXPECT_EQ(last_msg_->obs[2].D.i, -3219) << "incorrect value for obs[2].D.i, expected -3219, is " << last_msg_->obs[2].D.i; - EXPECT_EQ(last_msg_->obs[2].L.f, 243) << "incorrect value for obs[2].L.f, expected 243, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, 127954794) << "incorrect value for obs[2].L.i, expected 127954794, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 1217449431) << "incorrect value for obs[2].P, expected 1217449431, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].cn0, 158) << "incorrect value for obs[2].cn0, expected 158, is " << last_msg_->obs[2].cn0; - EXPECT_EQ(last_msg_->obs[2].flags, 15) << "incorrect value for obs[2].flags, expected 15, is " << last_msg_->obs[2].flags; - EXPECT_EQ(last_msg_->obs[2].lock, 10) << "incorrect value for obs[2].lock, expected 10, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].sid.code, 0) << "incorrect value for obs[2].sid.code, expected 0, is " << last_msg_->obs[2].sid.code; - EXPECT_EQ(last_msg_->obs[2].sid.sat, 18) << "incorrect value for obs[2].sid.sat, expected 18, is " << last_msg_->obs[2].sid.sat; - EXPECT_EQ(last_msg_->obs[3].D.f, 27) << "incorrect value for obs[3].D.f, expected 27, is " << last_msg_->obs[3].D.f; - EXPECT_EQ(last_msg_->obs[3].D.i, -2508) << "incorrect value for obs[3].D.i, expected -2508, is " << last_msg_->obs[3].D.i; - EXPECT_EQ(last_msg_->obs[3].L.f, 12) << "incorrect value for obs[3].L.f, expected 12, is " << last_msg_->obs[3].L.f; - EXPECT_EQ(last_msg_->obs[3].L.i, 99705055) << "incorrect value for obs[3].L.i, expected 99705055, is " << last_msg_->obs[3].L.i; - EXPECT_EQ(last_msg_->obs[3].P, 1217449753) << "incorrect value for obs[3].P, expected 1217449753, is " << last_msg_->obs[3].P; - EXPECT_EQ(last_msg_->obs[3].cn0, 125) << "incorrect value for obs[3].cn0, expected 125, is " << last_msg_->obs[3].cn0; - EXPECT_EQ(last_msg_->obs[3].flags, 11) << "incorrect value for obs[3].flags, expected 11, is " << last_msg_->obs[3].flags; - EXPECT_EQ(last_msg_->obs[3].lock, 9) << "incorrect value for obs[3].lock, expected 9, is " << last_msg_->obs[3].lock; - EXPECT_EQ(last_msg_->obs[3].sid.code, 1) << "incorrect value for obs[3].sid.code, expected 1, is " << last_msg_->obs[3].sid.code; - EXPECT_EQ(last_msg_->obs[3].sid.sat, 18) << "incorrect value for obs[3].sid.sat, expected 18, is " << last_msg_->obs[3].sid.sat; - EXPECT_EQ(last_msg_->obs[4].D.f, 245) << "incorrect value for obs[4].D.f, expected 245, is " << last_msg_->obs[4].D.f; - EXPECT_EQ(last_msg_->obs[4].D.i, 2829) << "incorrect value for obs[4].D.i, expected 2829, is " << last_msg_->obs[4].D.i; - EXPECT_EQ(last_msg_->obs[4].L.f, 53) << "incorrect value for obs[4].L.f, expected 53, is " << last_msg_->obs[4].L.f; - EXPECT_EQ(last_msg_->obs[4].L.i, 132024982) << "incorrect value for obs[4].L.i, expected 132024982, is " << last_msg_->obs[4].L.i; - EXPECT_EQ(last_msg_->obs[4].P, 1256175650) << "incorrect value for obs[4].P, expected 1256175650, is " << last_msg_->obs[4].P; - EXPECT_EQ(last_msg_->obs[4].cn0, 114) << "incorrect value for obs[4].cn0, expected 114, is " << last_msg_->obs[4].cn0; - EXPECT_EQ(last_msg_->obs[4].flags, 15) << "incorrect value for obs[4].flags, expected 15, is " << last_msg_->obs[4].flags; - EXPECT_EQ(last_msg_->obs[4].lock, 9) << "incorrect value for obs[4].lock, expected 9, is " << last_msg_->obs[4].lock; - EXPECT_EQ(last_msg_->obs[4].sid.code, 0) << "incorrect value for obs[4].sid.code, expected 0, is " << last_msg_->obs[4].sid.code; - EXPECT_EQ(last_msg_->obs[4].sid.sat, 22) << "incorrect value for obs[4].sid.sat, expected 22, is " << last_msg_->obs[4].sid.sat; - EXPECT_EQ(last_msg_->obs[5].D.f, 246) << "incorrect value for obs[5].D.f, expected 246, is " << last_msg_->obs[5].D.f; - EXPECT_EQ(last_msg_->obs[5].D.i, -2433) << "incorrect value for obs[5].D.i, expected -2433, is " << last_msg_->obs[5].D.i; - EXPECT_EQ(last_msg_->obs[5].L.f, 70) << "incorrect value for obs[5].L.f, expected 70, is " << last_msg_->obs[5].L.f; - EXPECT_EQ(last_msg_->obs[5].L.i, 121711010) << "incorrect value for obs[5].L.i, expected 121711010, is " << last_msg_->obs[5].L.i; - EXPECT_EQ(last_msg_->obs[5].P, 1158041713) << "incorrect value for obs[5].P, expected 1158041713, is " << last_msg_->obs[5].P; - EXPECT_EQ(last_msg_->obs[5].cn0, 189) << "incorrect value for obs[5].cn0, expected 189, is " << last_msg_->obs[5].cn0; - EXPECT_EQ(last_msg_->obs[5].flags, 15) << "incorrect value for obs[5].flags, expected 15, is " << last_msg_->obs[5].flags; - EXPECT_EQ(last_msg_->obs[5].lock, 9) << "incorrect value for obs[5].lock, expected 9, is " << last_msg_->obs[5].lock; - EXPECT_EQ(last_msg_->obs[5].sid.code, 0) << "incorrect value for obs[5].sid.code, expected 0, is " << last_msg_->obs[5].sid.code; - EXPECT_EQ(last_msg_->obs[5].sid.sat, 23) << "incorrect value for obs[5].sid.sat, expected 23, is " << last_msg_->obs[5].sid.sat; - EXPECT_EQ(last_msg_->obs[6].D.f, 231) << "incorrect value for obs[6].D.f, expected 231, is " << last_msg_->obs[6].D.f; - EXPECT_EQ(last_msg_->obs[6].D.i, -1896) << "incorrect value for obs[6].D.i, expected -1896, is " << last_msg_->obs[6].D.i; - EXPECT_EQ(last_msg_->obs[6].L.f, 221) << "incorrect value for obs[6].L.f, expected 221, is " << last_msg_->obs[6].L.f; - EXPECT_EQ(last_msg_->obs[6].L.i, 94839765) << "incorrect value for obs[6].L.i, expected 94839765, is " << last_msg_->obs[6].L.i; - EXPECT_EQ(last_msg_->obs[6].P, 1158041847) << "incorrect value for obs[6].P, expected 1158041847, is " << last_msg_->obs[6].P; - EXPECT_EQ(last_msg_->obs[6].cn0, 158) << "incorrect value for obs[6].cn0, expected 158, is " << last_msg_->obs[6].cn0; - EXPECT_EQ(last_msg_->obs[6].flags, 11) << "incorrect value for obs[6].flags, expected 11, is " << last_msg_->obs[6].flags; - EXPECT_EQ(last_msg_->obs[6].lock, 9) << "incorrect value for obs[6].lock, expected 9, is " << last_msg_->obs[6].lock; - EXPECT_EQ(last_msg_->obs[6].sid.code, 1) << "incorrect value for obs[6].sid.code, expected 1, is " << last_msg_->obs[6].sid.code; - EXPECT_EQ(last_msg_->obs[6].sid.sat, 23) << "incorrect value for obs[6].sid.sat, expected 23, is " << last_msg_->obs[6].sid.sat; - EXPECT_EQ(last_msg_->obs[7].D.f, 67) << "incorrect value for obs[7].D.f, expected 67, is " << last_msg_->obs[7].D.f; - EXPECT_EQ(last_msg_->obs[7].D.i, -1997) << "incorrect value for obs[7].D.i, expected -1997, is " << last_msg_->obs[7].D.i; - EXPECT_EQ(last_msg_->obs[7].L.f, 114) << "incorrect value for obs[7].L.f, expected 114, is " << last_msg_->obs[7].L.f; - EXPECT_EQ(last_msg_->obs[7].L.i, 113998348) << "incorrect value for obs[7].L.i, expected 113998348, is " << last_msg_->obs[7].L.i; - EXPECT_EQ(last_msg_->obs[7].P, 1084658184) << "incorrect value for obs[7].P, expected 1084658184, is " << last_msg_->obs[7].P; - EXPECT_EQ(last_msg_->obs[7].cn0, 93) << "incorrect value for obs[7].cn0, expected 93, is " << last_msg_->obs[7].cn0; - EXPECT_EQ(last_msg_->obs[7].flags, 11) << "incorrect value for obs[7].flags, expected 11, is " << last_msg_->obs[7].flags; - EXPECT_EQ(last_msg_->obs[7].lock, 3) << "incorrect value for obs[7].lock, expected 3, is " << last_msg_->obs[7].lock; - EXPECT_EQ(last_msg_->obs[7].sid.code, 0) << "incorrect value for obs[7].sid.code, expected 0, is " << last_msg_->obs[7].sid.code; - EXPECT_EQ(last_msg_->obs[7].sid.sat, 27) << "incorrect value for obs[7].sid.sat, expected 27, is " << last_msg_->obs[7].sid.sat; - EXPECT_EQ(last_msg_->obs[8].D.f, 237) << "incorrect value for obs[8].D.f, expected 237, is " << last_msg_->obs[8].D.f; - EXPECT_EQ(last_msg_->obs[8].D.i, 3041) << "incorrect value for obs[8].D.i, expected 3041, is " << last_msg_->obs[8].D.i; - EXPECT_EQ(last_msg_->obs[8].L.f, 232) << "incorrect value for obs[8].L.f, expected 232, is " << last_msg_->obs[8].L.f; - EXPECT_EQ(last_msg_->obs[8].L.i, 133443545) << "incorrect value for obs[8].L.i, expected 133443545, is " << last_msg_->obs[8].L.i; - EXPECT_EQ(last_msg_->obs[8].P, 1269673181) << "incorrect value for obs[8].P, expected 1269673181, is " << last_msg_->obs[8].P; - EXPECT_EQ(last_msg_->obs[8].cn0, 123) << "incorrect value for obs[8].cn0, expected 123, is " << last_msg_->obs[8].cn0; - EXPECT_EQ(last_msg_->obs[8].flags, 15) << "incorrect value for obs[8].flags, expected 15, is " << last_msg_->obs[8].flags; - EXPECT_EQ(last_msg_->obs[8].lock, 5) << "incorrect value for obs[8].lock, expected 5, is " << last_msg_->obs[8].lock; - EXPECT_EQ(last_msg_->obs[8].sid.code, 0) << "incorrect value for obs[8].sid.code, expected 0, is " << last_msg_->obs[8].sid.code; - EXPECT_EQ(last_msg_->obs[8].sid.sat, 31) << "incorrect value for obs[8].sid.sat, expected 31, is " << last_msg_->obs[8].sid.sat; - EXPECT_EQ(last_msg_->obs[9].D.f, 62) << "incorrect value for obs[9].D.f, expected 62, is " << last_msg_->obs[9].D.f; - EXPECT_EQ(last_msg_->obs[9].D.i, 2374) << "incorrect value for obs[9].D.i, expected 2374, is " << last_msg_->obs[9].D.i; - EXPECT_EQ(last_msg_->obs[9].L.f, 40) << "incorrect value for obs[9].L.f, expected 40, is " << last_msg_->obs[9].L.f; - EXPECT_EQ(last_msg_->obs[9].L.i, 103982040) << "incorrect value for obs[9].L.i, expected 103982040, is " << last_msg_->obs[9].L.i; - EXPECT_EQ(last_msg_->obs[9].P, 1269673722) << "incorrect value for obs[9].P, expected 1269673722, is " << last_msg_->obs[9].P; - EXPECT_EQ(last_msg_->obs[9].cn0, 120) << "incorrect value for obs[9].cn0, expected 120, is " << last_msg_->obs[9].cn0; - EXPECT_EQ(last_msg_->obs[9].flags, 11) << "incorrect value for obs[9].flags, expected 11, is " << last_msg_->obs[9].flags; - EXPECT_EQ(last_msg_->obs[9].lock, 3) << "incorrect value for obs[9].lock, expected 3, is " << last_msg_->obs[9].lock; - EXPECT_EQ(last_msg_->obs[9].sid.code, 1) << "incorrect value for obs[9].sid.code, expected 1, is " << last_msg_->obs[9].sid.code; - EXPECT_EQ(last_msg_->obs[9].sid.sat, 31) << "incorrect value for obs[9].sid.sat, expected 31, is " << last_msg_->obs[9].sid.sat; - EXPECT_EQ(last_msg_->obs[10].D.f, 96) << "incorrect value for obs[10].D.f, expected 96, is " << last_msg_->obs[10].D.f; - EXPECT_EQ(last_msg_->obs[10].D.i, -3446) << "incorrect value for obs[10].D.i, expected -3446, is " << last_msg_->obs[10].D.i; - EXPECT_EQ(last_msg_->obs[10].L.f, 7) << "incorrect value for obs[10].L.f, expected 7, is " << last_msg_->obs[10].L.f; - EXPECT_EQ(last_msg_->obs[10].L.i, 118217315) << "incorrect value for obs[10].L.i, expected 118217315, is " << last_msg_->obs[10].L.i; - EXPECT_EQ(last_msg_->obs[10].P, 1107693703) << "incorrect value for obs[10].P, expected 1107693703, is " << last_msg_->obs[10].P; - EXPECT_EQ(last_msg_->obs[10].cn0, 176) << "incorrect value for obs[10].cn0, expected 176, is " << last_msg_->obs[10].cn0; - EXPECT_EQ(last_msg_->obs[10].flags, 15) << "incorrect value for obs[10].flags, expected 15, is " << last_msg_->obs[10].flags; - EXPECT_EQ(last_msg_->obs[10].lock, 10) << "incorrect value for obs[10].lock, expected 10, is " << last_msg_->obs[10].lock; - EXPECT_EQ(last_msg_->obs[10].sid.code, 3) << "incorrect value for obs[10].sid.code, expected 3, is " << last_msg_->obs[10].sid.code; - EXPECT_EQ(last_msg_->obs[10].sid.sat, 2) << "incorrect value for obs[10].sid.sat, expected 2, is " << last_msg_->obs[10].sid.sat; - EXPECT_EQ(last_msg_->obs[11].D.f, 96) << "incorrect value for obs[11].D.f, expected 96, is " << last_msg_->obs[11].D.f; - EXPECT_EQ(last_msg_->obs[11].D.i, -1003) << "incorrect value for obs[11].D.i, expected -1003, is " << last_msg_->obs[11].D.i; - EXPECT_EQ(last_msg_->obs[11].L.f, 203) << "incorrect value for obs[11].L.f, expected 203, is " << last_msg_->obs[11].L.f; - EXPECT_EQ(last_msg_->obs[11].L.i, 104224985) << "incorrect value for obs[11].L.i, expected 104224985, is " << last_msg_->obs[11].L.i; - EXPECT_EQ(last_msg_->obs[11].P, 973505172) << "incorrect value for obs[11].P, expected 973505172, is " << last_msg_->obs[11].P; - EXPECT_EQ(last_msg_->obs[11].cn0, 170) << "incorrect value for obs[11].cn0, expected 170, is " << last_msg_->obs[11].cn0; - EXPECT_EQ(last_msg_->obs[11].flags, 15) << "incorrect value for obs[11].flags, expected 15, is " << last_msg_->obs[11].flags; - EXPECT_EQ(last_msg_->obs[11].lock, 10) << "incorrect value for obs[11].lock, expected 10, is " << last_msg_->obs[11].lock; - EXPECT_EQ(last_msg_->obs[11].sid.code, 3) << "incorrect value for obs[11].sid.code, expected 3, is " << last_msg_->obs[11].sid.code; - EXPECT_EQ(last_msg_->obs[11].sid.sat, 3) << "incorrect value for obs[11].sid.sat, expected 3, is " << last_msg_->obs[11].sid.sat; - EXPECT_EQ(last_msg_->obs[12].D.f, 219) << "incorrect value for obs[12].D.f, expected 219, is " << last_msg_->obs[12].D.f; - EXPECT_EQ(last_msg_->obs[12].D.i, -3836) << "incorrect value for obs[12].D.i, expected -3836, is " << last_msg_->obs[12].D.i; - EXPECT_EQ(last_msg_->obs[12].L.f, 80) << "incorrect value for obs[12].L.f, expected 80, is " << last_msg_->obs[12].L.f; - EXPECT_EQ(last_msg_->obs[12].L.i, 114505343) << "incorrect value for obs[12].L.i, expected 114505343, is " << last_msg_->obs[12].L.i; - EXPECT_EQ(last_msg_->obs[12].P, 1069903034) << "incorrect value for obs[12].P, expected 1069903034, is " << last_msg_->obs[12].P; - EXPECT_EQ(last_msg_->obs[12].cn0, 200) << "incorrect value for obs[12].cn0, expected 200, is " << last_msg_->obs[12].cn0; - EXPECT_EQ(last_msg_->obs[12].flags, 15) << "incorrect value for obs[12].flags, expected 15, is " << last_msg_->obs[12].flags; - EXPECT_EQ(last_msg_->obs[12].lock, 10) << "incorrect value for obs[12].lock, expected 10, is " << last_msg_->obs[12].lock; - EXPECT_EQ(last_msg_->obs[12].sid.code, 3) << "incorrect value for obs[12].sid.code, expected 3, is " << last_msg_->obs[12].sid.code; - EXPECT_EQ(last_msg_->obs[12].sid.sat, 17) << "incorrect value for obs[12].sid.sat, expected 17, is " << last_msg_->obs[12].sid.sat; - EXPECT_EQ(last_msg_->obs[13].D.f, 182) << "incorrect value for obs[13].D.f, expected 182, is " << last_msg_->obs[13].D.f; - EXPECT_EQ(last_msg_->obs[13].D.i, -461) << "incorrect value for obs[13].D.i, expected -461, is " << last_msg_->obs[13].D.i; - EXPECT_EQ(last_msg_->obs[13].L.f, 105) << "incorrect value for obs[13].L.f, expected 105, is " << last_msg_->obs[13].L.f; - EXPECT_EQ(last_msg_->obs[13].L.i, 102157331) << "incorrect value for obs[13].L.i, expected 102157331, is " << last_msg_->obs[13].L.i; - EXPECT_EQ(last_msg_->obs[13].P, 956875687) << "incorrect value for obs[13].P, expected 956875687, is " << last_msg_->obs[13].P; - EXPECT_EQ(last_msg_->obs[13].cn0, 152) << "incorrect value for obs[13].cn0, expected 152, is " << last_msg_->obs[13].cn0; - EXPECT_EQ(last_msg_->obs[13].flags, 15) << "incorrect value for obs[13].flags, expected 15, is " << last_msg_->obs[13].flags; - EXPECT_EQ(last_msg_->obs[13].lock, 10) << "incorrect value for obs[13].lock, expected 10, is " << last_msg_->obs[13].lock; - EXPECT_EQ(last_msg_->obs[13].sid.code, 3) << "incorrect value for obs[13].sid.code, expected 3, is " << last_msg_->obs[13].sid.code; - EXPECT_EQ(last_msg_->obs[13].sid.sat, 18) << "incorrect value for obs[13].sid.sat, expected 18, is " << last_msg_->obs[13].sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61569); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 32) + << "incorrect value for header.n_obs, expected 32, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.ns_residual, 0) + << "incorrect value for header.t.ns_residual, expected 0, is " + << last_msg_->header.t.ns_residual; + EXPECT_EQ(last_msg_->header.t.tow, 434293400) + << "incorrect value for header.t.tow, expected 434293400, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 2154) + << "incorrect value for header.t.wn, expected 2154, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].D.f, 172) + << "incorrect value for obs[0].D.f, expected 172, is " + << last_msg_->obs[0].D.f; + EXPECT_EQ(last_msg_->obs[0].D.i, -1536) + << "incorrect value for obs[0].D.i, expected -1536, is " + << last_msg_->obs[0].D.i; + EXPECT_EQ(last_msg_->obs[0].L.f, 146) + << "incorrect value for obs[0].L.f, expected 146, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, 111080057) + << "incorrect value for obs[0].L.i, expected 111080057, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 1056891697) + << "incorrect value for obs[0].P, expected 1056891697, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 182) + << "incorrect value for obs[0].cn0, expected 182, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].flags, 15) + << "incorrect value for obs[0].flags, expected 15, is " + << last_msg_->obs[0].flags; + EXPECT_EQ(last_msg_->obs[0].lock, 10) + << "incorrect value for obs[0].lock, expected 10, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].sid.code, 0) + << "incorrect value for obs[0].sid.code, expected 0, is " + << last_msg_->obs[0].sid.code; + EXPECT_EQ(last_msg_->obs[0].sid.sat, 10) + << "incorrect value for obs[0].sid.sat, expected 10, is " + << last_msg_->obs[0].sid.sat; + EXPECT_EQ(last_msg_->obs[1].D.f, 172) + << "incorrect value for obs[1].D.f, expected 172, is " + << last_msg_->obs[1].D.f; + EXPECT_EQ(last_msg_->obs[1].D.i, -1197) + << "incorrect value for obs[1].D.i, expected -1197, is " + << last_msg_->obs[1].D.i; + EXPECT_EQ(last_msg_->obs[1].L.f, 59) + << "incorrect value for obs[1].L.f, expected 59, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, 86555916) + << "incorrect value for obs[1].L.i, expected 86555916, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 1056891934) + << "incorrect value for obs[1].P, expected 1056891934, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].cn0, 178) + << "incorrect value for obs[1].cn0, expected 178, is " + << last_msg_->obs[1].cn0; + EXPECT_EQ(last_msg_->obs[1].flags, 15) + << "incorrect value for obs[1].flags, expected 15, is " + << last_msg_->obs[1].flags; + EXPECT_EQ(last_msg_->obs[1].lock, 10) + << "incorrect value for obs[1].lock, expected 10, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].sid.code, 1) + << "incorrect value for obs[1].sid.code, expected 1, is " + << last_msg_->obs[1].sid.code; + EXPECT_EQ(last_msg_->obs[1].sid.sat, 10) + << "incorrect value for obs[1].sid.sat, expected 10, is " + << last_msg_->obs[1].sid.sat; + EXPECT_EQ(last_msg_->obs[2].D.f, 119) + << "incorrect value for obs[2].D.f, expected 119, is " + << last_msg_->obs[2].D.f; + EXPECT_EQ(last_msg_->obs[2].D.i, -3219) + << "incorrect value for obs[2].D.i, expected -3219, is " + << last_msg_->obs[2].D.i; + EXPECT_EQ(last_msg_->obs[2].L.f, 243) + << "incorrect value for obs[2].L.f, expected 243, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, 127954794) + << "incorrect value for obs[2].L.i, expected 127954794, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 1217449431) + << "incorrect value for obs[2].P, expected 1217449431, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].cn0, 158) + << "incorrect value for obs[2].cn0, expected 158, is " + << last_msg_->obs[2].cn0; + EXPECT_EQ(last_msg_->obs[2].flags, 15) + << "incorrect value for obs[2].flags, expected 15, is " + << last_msg_->obs[2].flags; + EXPECT_EQ(last_msg_->obs[2].lock, 10) + << "incorrect value for obs[2].lock, expected 10, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].sid.code, 0) + << "incorrect value for obs[2].sid.code, expected 0, is " + << last_msg_->obs[2].sid.code; + EXPECT_EQ(last_msg_->obs[2].sid.sat, 18) + << "incorrect value for obs[2].sid.sat, expected 18, is " + << last_msg_->obs[2].sid.sat; + EXPECT_EQ(last_msg_->obs[3].D.f, 27) + << "incorrect value for obs[3].D.f, expected 27, is " + << last_msg_->obs[3].D.f; + EXPECT_EQ(last_msg_->obs[3].D.i, -2508) + << "incorrect value for obs[3].D.i, expected -2508, is " + << last_msg_->obs[3].D.i; + EXPECT_EQ(last_msg_->obs[3].L.f, 12) + << "incorrect value for obs[3].L.f, expected 12, is " + << last_msg_->obs[3].L.f; + EXPECT_EQ(last_msg_->obs[3].L.i, 99705055) + << "incorrect value for obs[3].L.i, expected 99705055, is " + << last_msg_->obs[3].L.i; + EXPECT_EQ(last_msg_->obs[3].P, 1217449753) + << "incorrect value for obs[3].P, expected 1217449753, is " + << last_msg_->obs[3].P; + EXPECT_EQ(last_msg_->obs[3].cn0, 125) + << "incorrect value for obs[3].cn0, expected 125, is " + << last_msg_->obs[3].cn0; + EXPECT_EQ(last_msg_->obs[3].flags, 11) + << "incorrect value for obs[3].flags, expected 11, is " + << last_msg_->obs[3].flags; + EXPECT_EQ(last_msg_->obs[3].lock, 9) + << "incorrect value for obs[3].lock, expected 9, is " + << last_msg_->obs[3].lock; + EXPECT_EQ(last_msg_->obs[3].sid.code, 1) + << "incorrect value for obs[3].sid.code, expected 1, is " + << last_msg_->obs[3].sid.code; + EXPECT_EQ(last_msg_->obs[3].sid.sat, 18) + << "incorrect value for obs[3].sid.sat, expected 18, is " + << last_msg_->obs[3].sid.sat; + EXPECT_EQ(last_msg_->obs[4].D.f, 245) + << "incorrect value for obs[4].D.f, expected 245, is " + << last_msg_->obs[4].D.f; + EXPECT_EQ(last_msg_->obs[4].D.i, 2829) + << "incorrect value for obs[4].D.i, expected 2829, is " + << last_msg_->obs[4].D.i; + EXPECT_EQ(last_msg_->obs[4].L.f, 53) + << "incorrect value for obs[4].L.f, expected 53, is " + << last_msg_->obs[4].L.f; + EXPECT_EQ(last_msg_->obs[4].L.i, 132024982) + << "incorrect value for obs[4].L.i, expected 132024982, is " + << last_msg_->obs[4].L.i; + EXPECT_EQ(last_msg_->obs[4].P, 1256175650) + << "incorrect value for obs[4].P, expected 1256175650, is " + << last_msg_->obs[4].P; + EXPECT_EQ(last_msg_->obs[4].cn0, 114) + << "incorrect value for obs[4].cn0, expected 114, is " + << last_msg_->obs[4].cn0; + EXPECT_EQ(last_msg_->obs[4].flags, 15) + << "incorrect value for obs[4].flags, expected 15, is " + << last_msg_->obs[4].flags; + EXPECT_EQ(last_msg_->obs[4].lock, 9) + << "incorrect value for obs[4].lock, expected 9, is " + << last_msg_->obs[4].lock; + EXPECT_EQ(last_msg_->obs[4].sid.code, 0) + << "incorrect value for obs[4].sid.code, expected 0, is " + << last_msg_->obs[4].sid.code; + EXPECT_EQ(last_msg_->obs[4].sid.sat, 22) + << "incorrect value for obs[4].sid.sat, expected 22, is " + << last_msg_->obs[4].sid.sat; + EXPECT_EQ(last_msg_->obs[5].D.f, 246) + << "incorrect value for obs[5].D.f, expected 246, is " + << last_msg_->obs[5].D.f; + EXPECT_EQ(last_msg_->obs[5].D.i, -2433) + << "incorrect value for obs[5].D.i, expected -2433, is " + << last_msg_->obs[5].D.i; + EXPECT_EQ(last_msg_->obs[5].L.f, 70) + << "incorrect value for obs[5].L.f, expected 70, is " + << last_msg_->obs[5].L.f; + EXPECT_EQ(last_msg_->obs[5].L.i, 121711010) + << "incorrect value for obs[5].L.i, expected 121711010, is " + << last_msg_->obs[5].L.i; + EXPECT_EQ(last_msg_->obs[5].P, 1158041713) + << "incorrect value for obs[5].P, expected 1158041713, is " + << last_msg_->obs[5].P; + EXPECT_EQ(last_msg_->obs[5].cn0, 189) + << "incorrect value for obs[5].cn0, expected 189, is " + << last_msg_->obs[5].cn0; + EXPECT_EQ(last_msg_->obs[5].flags, 15) + << "incorrect value for obs[5].flags, expected 15, is " + << last_msg_->obs[5].flags; + EXPECT_EQ(last_msg_->obs[5].lock, 9) + << "incorrect value for obs[5].lock, expected 9, is " + << last_msg_->obs[5].lock; + EXPECT_EQ(last_msg_->obs[5].sid.code, 0) + << "incorrect value for obs[5].sid.code, expected 0, is " + << last_msg_->obs[5].sid.code; + EXPECT_EQ(last_msg_->obs[5].sid.sat, 23) + << "incorrect value for obs[5].sid.sat, expected 23, is " + << last_msg_->obs[5].sid.sat; + EXPECT_EQ(last_msg_->obs[6].D.f, 231) + << "incorrect value for obs[6].D.f, expected 231, is " + << last_msg_->obs[6].D.f; + EXPECT_EQ(last_msg_->obs[6].D.i, -1896) + << "incorrect value for obs[6].D.i, expected -1896, is " + << last_msg_->obs[6].D.i; + EXPECT_EQ(last_msg_->obs[6].L.f, 221) + << "incorrect value for obs[6].L.f, expected 221, is " + << last_msg_->obs[6].L.f; + EXPECT_EQ(last_msg_->obs[6].L.i, 94839765) + << "incorrect value for obs[6].L.i, expected 94839765, is " + << last_msg_->obs[6].L.i; + EXPECT_EQ(last_msg_->obs[6].P, 1158041847) + << "incorrect value for obs[6].P, expected 1158041847, is " + << last_msg_->obs[6].P; + EXPECT_EQ(last_msg_->obs[6].cn0, 158) + << "incorrect value for obs[6].cn0, expected 158, is " + << last_msg_->obs[6].cn0; + EXPECT_EQ(last_msg_->obs[6].flags, 11) + << "incorrect value for obs[6].flags, expected 11, is " + << last_msg_->obs[6].flags; + EXPECT_EQ(last_msg_->obs[6].lock, 9) + << "incorrect value for obs[6].lock, expected 9, is " + << last_msg_->obs[6].lock; + EXPECT_EQ(last_msg_->obs[6].sid.code, 1) + << "incorrect value for obs[6].sid.code, expected 1, is " + << last_msg_->obs[6].sid.code; + EXPECT_EQ(last_msg_->obs[6].sid.sat, 23) + << "incorrect value for obs[6].sid.sat, expected 23, is " + << last_msg_->obs[6].sid.sat; + EXPECT_EQ(last_msg_->obs[7].D.f, 67) + << "incorrect value for obs[7].D.f, expected 67, is " + << last_msg_->obs[7].D.f; + EXPECT_EQ(last_msg_->obs[7].D.i, -1997) + << "incorrect value for obs[7].D.i, expected -1997, is " + << last_msg_->obs[7].D.i; + EXPECT_EQ(last_msg_->obs[7].L.f, 114) + << "incorrect value for obs[7].L.f, expected 114, is " + << last_msg_->obs[7].L.f; + EXPECT_EQ(last_msg_->obs[7].L.i, 113998348) + << "incorrect value for obs[7].L.i, expected 113998348, is " + << last_msg_->obs[7].L.i; + EXPECT_EQ(last_msg_->obs[7].P, 1084658184) + << "incorrect value for obs[7].P, expected 1084658184, is " + << last_msg_->obs[7].P; + EXPECT_EQ(last_msg_->obs[7].cn0, 93) + << "incorrect value for obs[7].cn0, expected 93, is " + << last_msg_->obs[7].cn0; + EXPECT_EQ(last_msg_->obs[7].flags, 11) + << "incorrect value for obs[7].flags, expected 11, is " + << last_msg_->obs[7].flags; + EXPECT_EQ(last_msg_->obs[7].lock, 3) + << "incorrect value for obs[7].lock, expected 3, is " + << last_msg_->obs[7].lock; + EXPECT_EQ(last_msg_->obs[7].sid.code, 0) + << "incorrect value for obs[7].sid.code, expected 0, is " + << last_msg_->obs[7].sid.code; + EXPECT_EQ(last_msg_->obs[7].sid.sat, 27) + << "incorrect value for obs[7].sid.sat, expected 27, is " + << last_msg_->obs[7].sid.sat; + EXPECT_EQ(last_msg_->obs[8].D.f, 237) + << "incorrect value for obs[8].D.f, expected 237, is " + << last_msg_->obs[8].D.f; + EXPECT_EQ(last_msg_->obs[8].D.i, 3041) + << "incorrect value for obs[8].D.i, expected 3041, is " + << last_msg_->obs[8].D.i; + EXPECT_EQ(last_msg_->obs[8].L.f, 232) + << "incorrect value for obs[8].L.f, expected 232, is " + << last_msg_->obs[8].L.f; + EXPECT_EQ(last_msg_->obs[8].L.i, 133443545) + << "incorrect value for obs[8].L.i, expected 133443545, is " + << last_msg_->obs[8].L.i; + EXPECT_EQ(last_msg_->obs[8].P, 1269673181) + << "incorrect value for obs[8].P, expected 1269673181, is " + << last_msg_->obs[8].P; + EXPECT_EQ(last_msg_->obs[8].cn0, 123) + << "incorrect value for obs[8].cn0, expected 123, is " + << last_msg_->obs[8].cn0; + EXPECT_EQ(last_msg_->obs[8].flags, 15) + << "incorrect value for obs[8].flags, expected 15, is " + << last_msg_->obs[8].flags; + EXPECT_EQ(last_msg_->obs[8].lock, 5) + << "incorrect value for obs[8].lock, expected 5, is " + << last_msg_->obs[8].lock; + EXPECT_EQ(last_msg_->obs[8].sid.code, 0) + << "incorrect value for obs[8].sid.code, expected 0, is " + << last_msg_->obs[8].sid.code; + EXPECT_EQ(last_msg_->obs[8].sid.sat, 31) + << "incorrect value for obs[8].sid.sat, expected 31, is " + << last_msg_->obs[8].sid.sat; + EXPECT_EQ(last_msg_->obs[9].D.f, 62) + << "incorrect value for obs[9].D.f, expected 62, is " + << last_msg_->obs[9].D.f; + EXPECT_EQ(last_msg_->obs[9].D.i, 2374) + << "incorrect value for obs[9].D.i, expected 2374, is " + << last_msg_->obs[9].D.i; + EXPECT_EQ(last_msg_->obs[9].L.f, 40) + << "incorrect value for obs[9].L.f, expected 40, is " + << last_msg_->obs[9].L.f; + EXPECT_EQ(last_msg_->obs[9].L.i, 103982040) + << "incorrect value for obs[9].L.i, expected 103982040, is " + << last_msg_->obs[9].L.i; + EXPECT_EQ(last_msg_->obs[9].P, 1269673722) + << "incorrect value for obs[9].P, expected 1269673722, is " + << last_msg_->obs[9].P; + EXPECT_EQ(last_msg_->obs[9].cn0, 120) + << "incorrect value for obs[9].cn0, expected 120, is " + << last_msg_->obs[9].cn0; + EXPECT_EQ(last_msg_->obs[9].flags, 11) + << "incorrect value for obs[9].flags, expected 11, is " + << last_msg_->obs[9].flags; + EXPECT_EQ(last_msg_->obs[9].lock, 3) + << "incorrect value for obs[9].lock, expected 3, is " + << last_msg_->obs[9].lock; + EXPECT_EQ(last_msg_->obs[9].sid.code, 1) + << "incorrect value for obs[9].sid.code, expected 1, is " + << last_msg_->obs[9].sid.code; + EXPECT_EQ(last_msg_->obs[9].sid.sat, 31) + << "incorrect value for obs[9].sid.sat, expected 31, is " + << last_msg_->obs[9].sid.sat; + EXPECT_EQ(last_msg_->obs[10].D.f, 96) + << "incorrect value for obs[10].D.f, expected 96, is " + << last_msg_->obs[10].D.f; + EXPECT_EQ(last_msg_->obs[10].D.i, -3446) + << "incorrect value for obs[10].D.i, expected -3446, is " + << last_msg_->obs[10].D.i; + EXPECT_EQ(last_msg_->obs[10].L.f, 7) + << "incorrect value for obs[10].L.f, expected 7, is " + << last_msg_->obs[10].L.f; + EXPECT_EQ(last_msg_->obs[10].L.i, 118217315) + << "incorrect value for obs[10].L.i, expected 118217315, is " + << last_msg_->obs[10].L.i; + EXPECT_EQ(last_msg_->obs[10].P, 1107693703) + << "incorrect value for obs[10].P, expected 1107693703, is " + << last_msg_->obs[10].P; + EXPECT_EQ(last_msg_->obs[10].cn0, 176) + << "incorrect value for obs[10].cn0, expected 176, is " + << last_msg_->obs[10].cn0; + EXPECT_EQ(last_msg_->obs[10].flags, 15) + << "incorrect value for obs[10].flags, expected 15, is " + << last_msg_->obs[10].flags; + EXPECT_EQ(last_msg_->obs[10].lock, 10) + << "incorrect value for obs[10].lock, expected 10, is " + << last_msg_->obs[10].lock; + EXPECT_EQ(last_msg_->obs[10].sid.code, 3) + << "incorrect value for obs[10].sid.code, expected 3, is " + << last_msg_->obs[10].sid.code; + EXPECT_EQ(last_msg_->obs[10].sid.sat, 2) + << "incorrect value for obs[10].sid.sat, expected 2, is " + << last_msg_->obs[10].sid.sat; + EXPECT_EQ(last_msg_->obs[11].D.f, 96) + << "incorrect value for obs[11].D.f, expected 96, is " + << last_msg_->obs[11].D.f; + EXPECT_EQ(last_msg_->obs[11].D.i, -1003) + << "incorrect value for obs[11].D.i, expected -1003, is " + << last_msg_->obs[11].D.i; + EXPECT_EQ(last_msg_->obs[11].L.f, 203) + << "incorrect value for obs[11].L.f, expected 203, is " + << last_msg_->obs[11].L.f; + EXPECT_EQ(last_msg_->obs[11].L.i, 104224985) + << "incorrect value for obs[11].L.i, expected 104224985, is " + << last_msg_->obs[11].L.i; + EXPECT_EQ(last_msg_->obs[11].P, 973505172) + << "incorrect value for obs[11].P, expected 973505172, is " + << last_msg_->obs[11].P; + EXPECT_EQ(last_msg_->obs[11].cn0, 170) + << "incorrect value for obs[11].cn0, expected 170, is " + << last_msg_->obs[11].cn0; + EXPECT_EQ(last_msg_->obs[11].flags, 15) + << "incorrect value for obs[11].flags, expected 15, is " + << last_msg_->obs[11].flags; + EXPECT_EQ(last_msg_->obs[11].lock, 10) + << "incorrect value for obs[11].lock, expected 10, is " + << last_msg_->obs[11].lock; + EXPECT_EQ(last_msg_->obs[11].sid.code, 3) + << "incorrect value for obs[11].sid.code, expected 3, is " + << last_msg_->obs[11].sid.code; + EXPECT_EQ(last_msg_->obs[11].sid.sat, 3) + << "incorrect value for obs[11].sid.sat, expected 3, is " + << last_msg_->obs[11].sid.sat; + EXPECT_EQ(last_msg_->obs[12].D.f, 219) + << "incorrect value for obs[12].D.f, expected 219, is " + << last_msg_->obs[12].D.f; + EXPECT_EQ(last_msg_->obs[12].D.i, -3836) + << "incorrect value for obs[12].D.i, expected -3836, is " + << last_msg_->obs[12].D.i; + EXPECT_EQ(last_msg_->obs[12].L.f, 80) + << "incorrect value for obs[12].L.f, expected 80, is " + << last_msg_->obs[12].L.f; + EXPECT_EQ(last_msg_->obs[12].L.i, 114505343) + << "incorrect value for obs[12].L.i, expected 114505343, is " + << last_msg_->obs[12].L.i; + EXPECT_EQ(last_msg_->obs[12].P, 1069903034) + << "incorrect value for obs[12].P, expected 1069903034, is " + << last_msg_->obs[12].P; + EXPECT_EQ(last_msg_->obs[12].cn0, 200) + << "incorrect value for obs[12].cn0, expected 200, is " + << last_msg_->obs[12].cn0; + EXPECT_EQ(last_msg_->obs[12].flags, 15) + << "incorrect value for obs[12].flags, expected 15, is " + << last_msg_->obs[12].flags; + EXPECT_EQ(last_msg_->obs[12].lock, 10) + << "incorrect value for obs[12].lock, expected 10, is " + << last_msg_->obs[12].lock; + EXPECT_EQ(last_msg_->obs[12].sid.code, 3) + << "incorrect value for obs[12].sid.code, expected 3, is " + << last_msg_->obs[12].sid.code; + EXPECT_EQ(last_msg_->obs[12].sid.sat, 17) + << "incorrect value for obs[12].sid.sat, expected 17, is " + << last_msg_->obs[12].sid.sat; + EXPECT_EQ(last_msg_->obs[13].D.f, 182) + << "incorrect value for obs[13].D.f, expected 182, is " + << last_msg_->obs[13].D.f; + EXPECT_EQ(last_msg_->obs[13].D.i, -461) + << "incorrect value for obs[13].D.i, expected -461, is " + << last_msg_->obs[13].D.i; + EXPECT_EQ(last_msg_->obs[13].L.f, 105) + << "incorrect value for obs[13].L.f, expected 105, is " + << last_msg_->obs[13].L.f; + EXPECT_EQ(last_msg_->obs[13].L.i, 102157331) + << "incorrect value for obs[13].L.i, expected 102157331, is " + << last_msg_->obs[13].L.i; + EXPECT_EQ(last_msg_->obs[13].P, 956875687) + << "incorrect value for obs[13].P, expected 956875687, is " + << last_msg_->obs[13].P; + EXPECT_EQ(last_msg_->obs[13].cn0, 152) + << "incorrect value for obs[13].cn0, expected 152, is " + << last_msg_->obs[13].cn0; + EXPECT_EQ(last_msg_->obs[13].flags, 15) + << "incorrect value for obs[13].flags, expected 15, is " + << last_msg_->obs[13].flags; + EXPECT_EQ(last_msg_->obs[13].lock, 10) + << "incorrect value for obs[13].lock, expected 10, is " + << last_msg_->obs[13].lock; + EXPECT_EQ(last_msg_->obs[13].sid.code, 3) + << "incorrect value for obs[13].sid.code, expected 3, is " + << last_msg_->obs[13].sid.code; + EXPECT_EQ(last_msg_->obs[13].sid.sat, 18) + << "incorrect value for obs[13].sid.sat, expected 18, is " + << last_msg_->obs[13].sid.sat; } -class Test_legacy_auto_check_sbp_observation_MsgObs1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgObs1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgObs1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgObs1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -516,41 +811,50 @@ class Test_legacy_auto_check_sbp_observation_MsgObs1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgObs1, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_MsgObs1, Test) { + uint8_t encoded_frame[] = { + 85, 74, 0, 129, 240, 11, 152, 202, 226, 25, + 0, 0, 0, 0, 106, 8, 16, 201, 101, + }; - uint8_t encoded_frame[] = {85,74,0,129,240,11,152,202,226,25,0,0,0,0,106,8,16,201,101, }; + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_t *test_msg = (msg_obs_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 16; + test_msg->header.t.ns_residual = 0; + test_msg->header.t.tow = 434293400; + test_msg->header.t.wn = 2154; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_t* test_msg = ( msg_obs_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 16; - test_msg->header.t.ns_residual = 0; - test_msg->header.t.tow = 434293400; - test_msg->header.t.wn = 2154; - - EXPECT_EQ(send_message( 0x4a, 61569, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(send_message(0x4a, 61569, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61569); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 16) << "incorrect value for header.n_obs, expected 16, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.ns_residual, 0) << "incorrect value for header.t.ns_residual, expected 0, is " << last_msg_->header.t.ns_residual; - EXPECT_EQ(last_msg_->header.t.tow, 434293400) << "incorrect value for header.t.tow, expected 434293400, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 2154) << "incorrect value for header.t.wn, expected 2154, is " << last_msg_->header.t.wn; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61569); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 16) + << "incorrect value for header.n_obs, expected 16, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.ns_residual, 0) + << "incorrect value for header.t.ns_residual, expected 0, is " + << last_msg_->header.t.ns_residual; + EXPECT_EQ(last_msg_->header.t.tow, 434293400) + << "incorrect value for header.t.tow, expected 434293400, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 2154) + << "incorrect value for header.t.wn, expected 2154, is " + << last_msg_->header.t.wn; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgObsDepB.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgObsDepB.cc index 1e259da10..b4d1a4089 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgObsDepB.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgObsDepB.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepB.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgObsDepB0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgObsDepB0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgObsDepB0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgObsDepB0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,210 +81,312 @@ class Test_legacy_auto_check_sbp_observation_MsgObsDepB0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepB0, Test) -{ - - uint8_t encoded_frame[] = {85,67,0,246,215,103,120,46,39,0,251,6,32,180,175,187,133,223,53,7,7,27,157,0,0,202,0,0,0,58,140,85,147,88,28,190,7,175,144,0,0,203,0,0,0,220,140,248,138,208,172,77,7,135,151,0,0,208,0,0,0,173,194,72,135,115,18,28,7,242,156,0,0,212,0,0,0,164,144,105,124,18,196,137,6,120,168,0,0,217,0,0,0,30,232,228,139,210,7,90,7,87,150,0,0,218,0,0,0,169,85, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_b_t* test_msg = ( msg_obs_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 32; - test_msg->header.t.tow = 2567800; - test_msg->header.t.wn = 1787; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 27; - test_msg->obs[0].L.i = 117913055; - test_msg->obs[0].P = 2243669940; - test_msg->obs[0].cn0 = 157; - test_msg->obs[0].lock = 0; - test_msg->obs[0].sid.code = 0; - test_msg->obs[0].sid.reserved = 0; - test_msg->obs[0].sid.sat = 202; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].L.f = 175; - test_msg->obs[1].L.i = 129899608; - test_msg->obs[1].P = 2471857210; - test_msg->obs[1].cn0 = 144; - test_msg->obs[1].lock = 0; - test_msg->obs[1].sid.code = 0; - test_msg->obs[1].sid.reserved = 0; - test_msg->obs[1].sid.sat = 203; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].L.f = 135; - test_msg->obs[2].L.i = 122531024; - test_msg->obs[2].P = 2331544796; - test_msg->obs[2].cn0 = 151; - test_msg->obs[2].lock = 0; - test_msg->obs[2].sid.code = 0; - test_msg->obs[2].sid.reserved = 0; - test_msg->obs[2].sid.sat = 208; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[3].L.f = 242; - test_msg->obs[3].L.i = 119280243; - test_msg->obs[3].P = 2269692589; - test_msg->obs[3].cn0 = 156; - test_msg->obs[3].lock = 0; - test_msg->obs[3].sid.code = 0; - test_msg->obs[3].sid.reserved = 0; - test_msg->obs[3].sid.sat = 212; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[4].L.f = 120; - test_msg->obs[4].L.i = 109691922; - test_msg->obs[4].P = 2087293092; - test_msg->obs[4].cn0 = 168; - test_msg->obs[4].lock = 0; - test_msg->obs[4].sid.code = 0; - test_msg->obs[4].sid.reserved = 0; - test_msg->obs[4].sid.sat = 217; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[5].L.f = 87; - test_msg->obs[5].L.i = 123340754; - test_msg->obs[5].P = 2347034654; - test_msg->obs[5].cn0 = 150; - test_msg->obs[5].lock = 0; - test_msg->obs[5].sid.code = 0; - test_msg->obs[5].sid.reserved = 0; - test_msg->obs[5].sid.sat = 218; - - EXPECT_EQ(send_message( 0x43, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 32) << "incorrect value for header.n_obs, expected 32, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 2567800) << "incorrect value for header.t.tow, expected 2567800, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1787) << "incorrect value for header.t.wn, expected 1787, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 27) << "incorrect value for obs[0].L.f, expected 27, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, 117913055) << "incorrect value for obs[0].L.i, expected 117913055, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 2243669940) << "incorrect value for obs[0].P, expected 2243669940, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 157) << "incorrect value for obs[0].cn0, expected 157, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 0) << "incorrect value for obs[0].lock, expected 0, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].sid.code, 0) << "incorrect value for obs[0].sid.code, expected 0, is " << last_msg_->obs[0].sid.code; - EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) << "incorrect value for obs[0].sid.reserved, expected 0, is " << last_msg_->obs[0].sid.reserved; - EXPECT_EQ(last_msg_->obs[0].sid.sat, 202) << "incorrect value for obs[0].sid.sat, expected 202, is " << last_msg_->obs[0].sid.sat; - EXPECT_EQ(last_msg_->obs[1].L.f, 175) << "incorrect value for obs[1].L.f, expected 175, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, 129899608) << "incorrect value for obs[1].L.i, expected 129899608, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 2471857210) << "incorrect value for obs[1].P, expected 2471857210, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].cn0, 144) << "incorrect value for obs[1].cn0, expected 144, is " << last_msg_->obs[1].cn0; - EXPECT_EQ(last_msg_->obs[1].lock, 0) << "incorrect value for obs[1].lock, expected 0, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].sid.code, 0) << "incorrect value for obs[1].sid.code, expected 0, is " << last_msg_->obs[1].sid.code; - EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) << "incorrect value for obs[1].sid.reserved, expected 0, is " << last_msg_->obs[1].sid.reserved; - EXPECT_EQ(last_msg_->obs[1].sid.sat, 203) << "incorrect value for obs[1].sid.sat, expected 203, is " << last_msg_->obs[1].sid.sat; - EXPECT_EQ(last_msg_->obs[2].L.f, 135) << "incorrect value for obs[2].L.f, expected 135, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, 122531024) << "incorrect value for obs[2].L.i, expected 122531024, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 2331544796) << "incorrect value for obs[2].P, expected 2331544796, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].cn0, 151) << "incorrect value for obs[2].cn0, expected 151, is " << last_msg_->obs[2].cn0; - EXPECT_EQ(last_msg_->obs[2].lock, 0) << "incorrect value for obs[2].lock, expected 0, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].sid.code, 0) << "incorrect value for obs[2].sid.code, expected 0, is " << last_msg_->obs[2].sid.code; - EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) << "incorrect value for obs[2].sid.reserved, expected 0, is " << last_msg_->obs[2].sid.reserved; - EXPECT_EQ(last_msg_->obs[2].sid.sat, 208) << "incorrect value for obs[2].sid.sat, expected 208, is " << last_msg_->obs[2].sid.sat; - EXPECT_EQ(last_msg_->obs[3].L.f, 242) << "incorrect value for obs[3].L.f, expected 242, is " << last_msg_->obs[3].L.f; - EXPECT_EQ(last_msg_->obs[3].L.i, 119280243) << "incorrect value for obs[3].L.i, expected 119280243, is " << last_msg_->obs[3].L.i; - EXPECT_EQ(last_msg_->obs[3].P, 2269692589) << "incorrect value for obs[3].P, expected 2269692589, is " << last_msg_->obs[3].P; - EXPECT_EQ(last_msg_->obs[3].cn0, 156) << "incorrect value for obs[3].cn0, expected 156, is " << last_msg_->obs[3].cn0; - EXPECT_EQ(last_msg_->obs[3].lock, 0) << "incorrect value for obs[3].lock, expected 0, is " << last_msg_->obs[3].lock; - EXPECT_EQ(last_msg_->obs[3].sid.code, 0) << "incorrect value for obs[3].sid.code, expected 0, is " << last_msg_->obs[3].sid.code; - EXPECT_EQ(last_msg_->obs[3].sid.reserved, 0) << "incorrect value for obs[3].sid.reserved, expected 0, is " << last_msg_->obs[3].sid.reserved; - EXPECT_EQ(last_msg_->obs[3].sid.sat, 212) << "incorrect value for obs[3].sid.sat, expected 212, is " << last_msg_->obs[3].sid.sat; - EXPECT_EQ(last_msg_->obs[4].L.f, 120) << "incorrect value for obs[4].L.f, expected 120, is " << last_msg_->obs[4].L.f; - EXPECT_EQ(last_msg_->obs[4].L.i, 109691922) << "incorrect value for obs[4].L.i, expected 109691922, is " << last_msg_->obs[4].L.i; - EXPECT_EQ(last_msg_->obs[4].P, 2087293092) << "incorrect value for obs[4].P, expected 2087293092, is " << last_msg_->obs[4].P; - EXPECT_EQ(last_msg_->obs[4].cn0, 168) << "incorrect value for obs[4].cn0, expected 168, is " << last_msg_->obs[4].cn0; - EXPECT_EQ(last_msg_->obs[4].lock, 0) << "incorrect value for obs[4].lock, expected 0, is " << last_msg_->obs[4].lock; - EXPECT_EQ(last_msg_->obs[4].sid.code, 0) << "incorrect value for obs[4].sid.code, expected 0, is " << last_msg_->obs[4].sid.code; - EXPECT_EQ(last_msg_->obs[4].sid.reserved, 0) << "incorrect value for obs[4].sid.reserved, expected 0, is " << last_msg_->obs[4].sid.reserved; - EXPECT_EQ(last_msg_->obs[4].sid.sat, 217) << "incorrect value for obs[4].sid.sat, expected 217, is " << last_msg_->obs[4].sid.sat; - EXPECT_EQ(last_msg_->obs[5].L.f, 87) << "incorrect value for obs[5].L.f, expected 87, is " << last_msg_->obs[5].L.f; - EXPECT_EQ(last_msg_->obs[5].L.i, 123340754) << "incorrect value for obs[5].L.i, expected 123340754, is " << last_msg_->obs[5].L.i; - EXPECT_EQ(last_msg_->obs[5].P, 2347034654) << "incorrect value for obs[5].P, expected 2347034654, is " << last_msg_->obs[5].P; - EXPECT_EQ(last_msg_->obs[5].cn0, 150) << "incorrect value for obs[5].cn0, expected 150, is " << last_msg_->obs[5].cn0; - EXPECT_EQ(last_msg_->obs[5].lock, 0) << "incorrect value for obs[5].lock, expected 0, is " << last_msg_->obs[5].lock; - EXPECT_EQ(last_msg_->obs[5].sid.code, 0) << "incorrect value for obs[5].sid.code, expected 0, is " << last_msg_->obs[5].sid.code; - EXPECT_EQ(last_msg_->obs[5].sid.reserved, 0) << "incorrect value for obs[5].sid.reserved, expected 0, is " << last_msg_->obs[5].sid.reserved; - EXPECT_EQ(last_msg_->obs[5].sid.sat, 218) << "incorrect value for obs[5].sid.sat, expected 218, is " << last_msg_->obs[5].sid.sat; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 67, 0, 246, 215, 103, 120, 46, 39, 0, 251, 6, 32, 180, 175, 187, + 133, 223, 53, 7, 7, 27, 157, 0, 0, 202, 0, 0, 0, 58, 140, 85, + 147, 88, 28, 190, 7, 175, 144, 0, 0, 203, 0, 0, 0, 220, 140, 248, + 138, 208, 172, 77, 7, 135, 151, 0, 0, 208, 0, 0, 0, 173, 194, 72, + 135, 115, 18, 28, 7, 242, 156, 0, 0, 212, 0, 0, 0, 164, 144, 105, + 124, 18, 196, 137, 6, 120, 168, 0, 0, 217, 0, 0, 0, 30, 232, 228, + 139, 210, 7, 90, 7, 87, 150, 0, 0, 218, 0, 0, 0, 169, 85, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_b_t *test_msg = (msg_obs_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 32; + test_msg->header.t.tow = 2567800; + test_msg->header.t.wn = 1787; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 27; + test_msg->obs[0].L.i = 117913055; + test_msg->obs[0].P = 2243669940; + test_msg->obs[0].cn0 = 157; + test_msg->obs[0].lock = 0; + test_msg->obs[0].sid.code = 0; + test_msg->obs[0].sid.reserved = 0; + test_msg->obs[0].sid.sat = 202; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].L.f = 175; + test_msg->obs[1].L.i = 129899608; + test_msg->obs[1].P = 2471857210; + test_msg->obs[1].cn0 = 144; + test_msg->obs[1].lock = 0; + test_msg->obs[1].sid.code = 0; + test_msg->obs[1].sid.reserved = 0; + test_msg->obs[1].sid.sat = 203; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].L.f = 135; + test_msg->obs[2].L.i = 122531024; + test_msg->obs[2].P = 2331544796; + test_msg->obs[2].cn0 = 151; + test_msg->obs[2].lock = 0; + test_msg->obs[2].sid.code = 0; + test_msg->obs[2].sid.reserved = 0; + test_msg->obs[2].sid.sat = 208; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[3].L.f = 242; + test_msg->obs[3].L.i = 119280243; + test_msg->obs[3].P = 2269692589; + test_msg->obs[3].cn0 = 156; + test_msg->obs[3].lock = 0; + test_msg->obs[3].sid.code = 0; + test_msg->obs[3].sid.reserved = 0; + test_msg->obs[3].sid.sat = 212; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[4].L.f = 120; + test_msg->obs[4].L.i = 109691922; + test_msg->obs[4].P = 2087293092; + test_msg->obs[4].cn0 = 168; + test_msg->obs[4].lock = 0; + test_msg->obs[4].sid.code = 0; + test_msg->obs[4].sid.reserved = 0; + test_msg->obs[4].sid.sat = 217; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[5].L.f = 87; + test_msg->obs[5].L.i = 123340754; + test_msg->obs[5].P = 2347034654; + test_msg->obs[5].cn0 = 150; + test_msg->obs[5].lock = 0; + test_msg->obs[5].sid.code = 0; + test_msg->obs[5].sid.reserved = 0; + test_msg->obs[5].sid.sat = 218; + + EXPECT_EQ(send_message(0x43, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 32) + << "incorrect value for header.n_obs, expected 32, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 2567800) + << "incorrect value for header.t.tow, expected 2567800, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1787) + << "incorrect value for header.t.wn, expected 1787, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 27) + << "incorrect value for obs[0].L.f, expected 27, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, 117913055) + << "incorrect value for obs[0].L.i, expected 117913055, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 2243669940) + << "incorrect value for obs[0].P, expected 2243669940, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 157) + << "incorrect value for obs[0].cn0, expected 157, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 0) + << "incorrect value for obs[0].lock, expected 0, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].sid.code, 0) + << "incorrect value for obs[0].sid.code, expected 0, is " + << last_msg_->obs[0].sid.code; + EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) + << "incorrect value for obs[0].sid.reserved, expected 0, is " + << last_msg_->obs[0].sid.reserved; + EXPECT_EQ(last_msg_->obs[0].sid.sat, 202) + << "incorrect value for obs[0].sid.sat, expected 202, is " + << last_msg_->obs[0].sid.sat; + EXPECT_EQ(last_msg_->obs[1].L.f, 175) + << "incorrect value for obs[1].L.f, expected 175, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, 129899608) + << "incorrect value for obs[1].L.i, expected 129899608, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 2471857210) + << "incorrect value for obs[1].P, expected 2471857210, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].cn0, 144) + << "incorrect value for obs[1].cn0, expected 144, is " + << last_msg_->obs[1].cn0; + EXPECT_EQ(last_msg_->obs[1].lock, 0) + << "incorrect value for obs[1].lock, expected 0, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].sid.code, 0) + << "incorrect value for obs[1].sid.code, expected 0, is " + << last_msg_->obs[1].sid.code; + EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) + << "incorrect value for obs[1].sid.reserved, expected 0, is " + << last_msg_->obs[1].sid.reserved; + EXPECT_EQ(last_msg_->obs[1].sid.sat, 203) + << "incorrect value for obs[1].sid.sat, expected 203, is " + << last_msg_->obs[1].sid.sat; + EXPECT_EQ(last_msg_->obs[2].L.f, 135) + << "incorrect value for obs[2].L.f, expected 135, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, 122531024) + << "incorrect value for obs[2].L.i, expected 122531024, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 2331544796) + << "incorrect value for obs[2].P, expected 2331544796, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].cn0, 151) + << "incorrect value for obs[2].cn0, expected 151, is " + << last_msg_->obs[2].cn0; + EXPECT_EQ(last_msg_->obs[2].lock, 0) + << "incorrect value for obs[2].lock, expected 0, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].sid.code, 0) + << "incorrect value for obs[2].sid.code, expected 0, is " + << last_msg_->obs[2].sid.code; + EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) + << "incorrect value for obs[2].sid.reserved, expected 0, is " + << last_msg_->obs[2].sid.reserved; + EXPECT_EQ(last_msg_->obs[2].sid.sat, 208) + << "incorrect value for obs[2].sid.sat, expected 208, is " + << last_msg_->obs[2].sid.sat; + EXPECT_EQ(last_msg_->obs[3].L.f, 242) + << "incorrect value for obs[3].L.f, expected 242, is " + << last_msg_->obs[3].L.f; + EXPECT_EQ(last_msg_->obs[3].L.i, 119280243) + << "incorrect value for obs[3].L.i, expected 119280243, is " + << last_msg_->obs[3].L.i; + EXPECT_EQ(last_msg_->obs[3].P, 2269692589) + << "incorrect value for obs[3].P, expected 2269692589, is " + << last_msg_->obs[3].P; + EXPECT_EQ(last_msg_->obs[3].cn0, 156) + << "incorrect value for obs[3].cn0, expected 156, is " + << last_msg_->obs[3].cn0; + EXPECT_EQ(last_msg_->obs[3].lock, 0) + << "incorrect value for obs[3].lock, expected 0, is " + << last_msg_->obs[3].lock; + EXPECT_EQ(last_msg_->obs[3].sid.code, 0) + << "incorrect value for obs[3].sid.code, expected 0, is " + << last_msg_->obs[3].sid.code; + EXPECT_EQ(last_msg_->obs[3].sid.reserved, 0) + << "incorrect value for obs[3].sid.reserved, expected 0, is " + << last_msg_->obs[3].sid.reserved; + EXPECT_EQ(last_msg_->obs[3].sid.sat, 212) + << "incorrect value for obs[3].sid.sat, expected 212, is " + << last_msg_->obs[3].sid.sat; + EXPECT_EQ(last_msg_->obs[4].L.f, 120) + << "incorrect value for obs[4].L.f, expected 120, is " + << last_msg_->obs[4].L.f; + EXPECT_EQ(last_msg_->obs[4].L.i, 109691922) + << "incorrect value for obs[4].L.i, expected 109691922, is " + << last_msg_->obs[4].L.i; + EXPECT_EQ(last_msg_->obs[4].P, 2087293092) + << "incorrect value for obs[4].P, expected 2087293092, is " + << last_msg_->obs[4].P; + EXPECT_EQ(last_msg_->obs[4].cn0, 168) + << "incorrect value for obs[4].cn0, expected 168, is " + << last_msg_->obs[4].cn0; + EXPECT_EQ(last_msg_->obs[4].lock, 0) + << "incorrect value for obs[4].lock, expected 0, is " + << last_msg_->obs[4].lock; + EXPECT_EQ(last_msg_->obs[4].sid.code, 0) + << "incorrect value for obs[4].sid.code, expected 0, is " + << last_msg_->obs[4].sid.code; + EXPECT_EQ(last_msg_->obs[4].sid.reserved, 0) + << "incorrect value for obs[4].sid.reserved, expected 0, is " + << last_msg_->obs[4].sid.reserved; + EXPECT_EQ(last_msg_->obs[4].sid.sat, 217) + << "incorrect value for obs[4].sid.sat, expected 217, is " + << last_msg_->obs[4].sid.sat; + EXPECT_EQ(last_msg_->obs[5].L.f, 87) + << "incorrect value for obs[5].L.f, expected 87, is " + << last_msg_->obs[5].L.f; + EXPECT_EQ(last_msg_->obs[5].L.i, 123340754) + << "incorrect value for obs[5].L.i, expected 123340754, is " + << last_msg_->obs[5].L.i; + EXPECT_EQ(last_msg_->obs[5].P, 2347034654) + << "incorrect value for obs[5].P, expected 2347034654, is " + << last_msg_->obs[5].P; + EXPECT_EQ(last_msg_->obs[5].cn0, 150) + << "incorrect value for obs[5].cn0, expected 150, is " + << last_msg_->obs[5].cn0; + EXPECT_EQ(last_msg_->obs[5].lock, 0) + << "incorrect value for obs[5].lock, expected 0, is " + << last_msg_->obs[5].lock; + EXPECT_EQ(last_msg_->obs[5].sid.code, 0) + << "incorrect value for obs[5].sid.code, expected 0, is " + << last_msg_->obs[5].sid.code; + EXPECT_EQ(last_msg_->obs[5].sid.reserved, 0) + << "incorrect value for obs[5].sid.reserved, expected 0, is " + << last_msg_->obs[5].sid.reserved; + EXPECT_EQ(last_msg_->obs[5].sid.sat, 218) + << "incorrect value for obs[5].sid.sat, expected 218, is " + << last_msg_->obs[5].sid.sat; } -class Test_legacy_auto_check_sbp_observation_MsgObsDepB1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgObsDepB1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgObsDepB1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgObsDepB1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -298,150 +396,201 @@ class Test_legacy_auto_check_sbp_observation_MsgObsDepB1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepB1, Test) -{ - - uint8_t encoded_frame[] = {85,67,0,246,215,55,120,46,39,0,251,6,33,68,199,101,136,133,247,42,7,219,154,0,0,220,0,0,0,219,14,123,133,96,215,3,7,235,156,0,0,222,0,0,0,87,166,81,122,5,173,109,6,174,170,0,0,225,0,0,0,11,233, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_b_t* test_msg = ( msg_obs_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 33; - test_msg->header.t.tow = 2567800; - test_msg->header.t.wn = 1787; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 219; - test_msg->obs[0].L.i = 120256389; - test_msg->obs[0].P = 2288371524; - test_msg->obs[0].cn0 = 154; - test_msg->obs[0].lock = 0; - test_msg->obs[0].sid.code = 0; - test_msg->obs[0].sid.reserved = 0; - test_msg->obs[0].sid.sat = 220; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].L.f = 235; - test_msg->obs[1].L.i = 117692256; - test_msg->obs[1].P = 2239434459; - test_msg->obs[1].cn0 = 156; - test_msg->obs[1].lock = 0; - test_msg->obs[1].sid.code = 0; - test_msg->obs[1].sid.reserved = 0; - test_msg->obs[1].sid.sat = 222; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].L.f = 174; - test_msg->obs[2].L.i = 107851013; - test_msg->obs[2].P = 2052171351; - test_msg->obs[2].cn0 = 170; - test_msg->obs[2].lock = 0; - test_msg->obs[2].sid.code = 0; - test_msg->obs[2].sid.reserved = 0; - test_msg->obs[2].sid.sat = 225; - - EXPECT_EQ(send_message( 0x43, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 33) << "incorrect value for header.n_obs, expected 33, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 2567800) << "incorrect value for header.t.tow, expected 2567800, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1787) << "incorrect value for header.t.wn, expected 1787, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 219) << "incorrect value for obs[0].L.f, expected 219, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, 120256389) << "incorrect value for obs[0].L.i, expected 120256389, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 2288371524) << "incorrect value for obs[0].P, expected 2288371524, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 154) << "incorrect value for obs[0].cn0, expected 154, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 0) << "incorrect value for obs[0].lock, expected 0, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].sid.code, 0) << "incorrect value for obs[0].sid.code, expected 0, is " << last_msg_->obs[0].sid.code; - EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) << "incorrect value for obs[0].sid.reserved, expected 0, is " << last_msg_->obs[0].sid.reserved; - EXPECT_EQ(last_msg_->obs[0].sid.sat, 220) << "incorrect value for obs[0].sid.sat, expected 220, is " << last_msg_->obs[0].sid.sat; - EXPECT_EQ(last_msg_->obs[1].L.f, 235) << "incorrect value for obs[1].L.f, expected 235, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, 117692256) << "incorrect value for obs[1].L.i, expected 117692256, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 2239434459) << "incorrect value for obs[1].P, expected 2239434459, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].cn0, 156) << "incorrect value for obs[1].cn0, expected 156, is " << last_msg_->obs[1].cn0; - EXPECT_EQ(last_msg_->obs[1].lock, 0) << "incorrect value for obs[1].lock, expected 0, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].sid.code, 0) << "incorrect value for obs[1].sid.code, expected 0, is " << last_msg_->obs[1].sid.code; - EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) << "incorrect value for obs[1].sid.reserved, expected 0, is " << last_msg_->obs[1].sid.reserved; - EXPECT_EQ(last_msg_->obs[1].sid.sat, 222) << "incorrect value for obs[1].sid.sat, expected 222, is " << last_msg_->obs[1].sid.sat; - EXPECT_EQ(last_msg_->obs[2].L.f, 174) << "incorrect value for obs[2].L.f, expected 174, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, 107851013) << "incorrect value for obs[2].L.i, expected 107851013, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 2052171351) << "incorrect value for obs[2].P, expected 2052171351, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].cn0, 170) << "incorrect value for obs[2].cn0, expected 170, is " << last_msg_->obs[2].cn0; - EXPECT_EQ(last_msg_->obs[2].lock, 0) << "incorrect value for obs[2].lock, expected 0, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].sid.code, 0) << "incorrect value for obs[2].sid.code, expected 0, is " << last_msg_->obs[2].sid.code; - EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) << "incorrect value for obs[2].sid.reserved, expected 0, is " << last_msg_->obs[2].sid.reserved; - EXPECT_EQ(last_msg_->obs[2].sid.sat, 225) << "incorrect value for obs[2].sid.sat, expected 225, is " << last_msg_->obs[2].sid.sat; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepB1, Test) { + uint8_t encoded_frame[] = { + 85, 67, 0, 246, 215, 55, 120, 46, 39, 0, 251, 6, 33, 68, 199, 101, + 136, 133, 247, 42, 7, 219, 154, 0, 0, 220, 0, 0, 0, 219, 14, 123, + 133, 96, 215, 3, 7, 235, 156, 0, 0, 222, 0, 0, 0, 87, 166, 81, + 122, 5, 173, 109, 6, 174, 170, 0, 0, 225, 0, 0, 0, 11, 233, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_b_t *test_msg = (msg_obs_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 33; + test_msg->header.t.tow = 2567800; + test_msg->header.t.wn = 1787; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 219; + test_msg->obs[0].L.i = 120256389; + test_msg->obs[0].P = 2288371524; + test_msg->obs[0].cn0 = 154; + test_msg->obs[0].lock = 0; + test_msg->obs[0].sid.code = 0; + test_msg->obs[0].sid.reserved = 0; + test_msg->obs[0].sid.sat = 220; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].L.f = 235; + test_msg->obs[1].L.i = 117692256; + test_msg->obs[1].P = 2239434459; + test_msg->obs[1].cn0 = 156; + test_msg->obs[1].lock = 0; + test_msg->obs[1].sid.code = 0; + test_msg->obs[1].sid.reserved = 0; + test_msg->obs[1].sid.sat = 222; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].L.f = 174; + test_msg->obs[2].L.i = 107851013; + test_msg->obs[2].P = 2052171351; + test_msg->obs[2].cn0 = 170; + test_msg->obs[2].lock = 0; + test_msg->obs[2].sid.code = 0; + test_msg->obs[2].sid.reserved = 0; + test_msg->obs[2].sid.sat = 225; + + EXPECT_EQ(send_message(0x43, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 33) + << "incorrect value for header.n_obs, expected 33, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 2567800) + << "incorrect value for header.t.tow, expected 2567800, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1787) + << "incorrect value for header.t.wn, expected 1787, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 219) + << "incorrect value for obs[0].L.f, expected 219, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, 120256389) + << "incorrect value for obs[0].L.i, expected 120256389, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 2288371524) + << "incorrect value for obs[0].P, expected 2288371524, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 154) + << "incorrect value for obs[0].cn0, expected 154, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 0) + << "incorrect value for obs[0].lock, expected 0, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].sid.code, 0) + << "incorrect value for obs[0].sid.code, expected 0, is " + << last_msg_->obs[0].sid.code; + EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) + << "incorrect value for obs[0].sid.reserved, expected 0, is " + << last_msg_->obs[0].sid.reserved; + EXPECT_EQ(last_msg_->obs[0].sid.sat, 220) + << "incorrect value for obs[0].sid.sat, expected 220, is " + << last_msg_->obs[0].sid.sat; + EXPECT_EQ(last_msg_->obs[1].L.f, 235) + << "incorrect value for obs[1].L.f, expected 235, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, 117692256) + << "incorrect value for obs[1].L.i, expected 117692256, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 2239434459) + << "incorrect value for obs[1].P, expected 2239434459, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].cn0, 156) + << "incorrect value for obs[1].cn0, expected 156, is " + << last_msg_->obs[1].cn0; + EXPECT_EQ(last_msg_->obs[1].lock, 0) + << "incorrect value for obs[1].lock, expected 0, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].sid.code, 0) + << "incorrect value for obs[1].sid.code, expected 0, is " + << last_msg_->obs[1].sid.code; + EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) + << "incorrect value for obs[1].sid.reserved, expected 0, is " + << last_msg_->obs[1].sid.reserved; + EXPECT_EQ(last_msg_->obs[1].sid.sat, 222) + << "incorrect value for obs[1].sid.sat, expected 222, is " + << last_msg_->obs[1].sid.sat; + EXPECT_EQ(last_msg_->obs[2].L.f, 174) + << "incorrect value for obs[2].L.f, expected 174, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, 107851013) + << "incorrect value for obs[2].L.i, expected 107851013, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 2052171351) + << "incorrect value for obs[2].P, expected 2052171351, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].cn0, 170) + << "incorrect value for obs[2].cn0, expected 170, is " + << last_msg_->obs[2].cn0; + EXPECT_EQ(last_msg_->obs[2].lock, 0) + << "incorrect value for obs[2].lock, expected 0, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].sid.code, 0) + << "incorrect value for obs[2].sid.code, expected 0, is " + << last_msg_->obs[2].sid.code; + EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) + << "incorrect value for obs[2].sid.reserved, expected 0, is " + << last_msg_->obs[2].sid.reserved; + EXPECT_EQ(last_msg_->obs[2].sid.sat, 225) + << "incorrect value for obs[2].sid.sat, expected 225, is " + << last_msg_->obs[2].sid.sat; } -class Test_legacy_auto_check_sbp_observation_MsgObsDepB2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgObsDepB2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgObsDepB2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgObsDepB2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -451,210 +600,312 @@ class Test_legacy_auto_check_sbp_observation_MsgObsDepB2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepB2, Test) -{ - - uint8_t encoded_frame[] = {85,67,0,246,215,103,64,47,39,0,251,6,32,100,132,187,133,236,51,7,7,94,156,0,0,202,0,0,0,97,184,85,147,178,30,190,7,40,140,0,0,203,0,0,0,135,111,248,138,90,171,77,7,2,150,0,0,208,0,0,0,180,238,72,135,190,20,28,7,241,155,0,0,212,0,0,0,15,153,105,124,92,196,137,6,153,168,0,0,217,0,0,0,49,185,228,139,144,5,90,7,41,150,0,0,218,0,0,0,241,98, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_b_t* test_msg = ( msg_obs_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 32; - test_msg->header.t.tow = 2568000; - test_msg->header.t.wn = 1787; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 94; - test_msg->obs[0].L.i = 117912556; - test_msg->obs[0].P = 2243658852; - test_msg->obs[0].cn0 = 156; - test_msg->obs[0].lock = 0; - test_msg->obs[0].sid.code = 0; - test_msg->obs[0].sid.reserved = 0; - test_msg->obs[0].sid.sat = 202; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].L.f = 40; - test_msg->obs[1].L.i = 129900210; - test_msg->obs[1].P = 2471868513; - test_msg->obs[1].cn0 = 140; - test_msg->obs[1].lock = 0; - test_msg->obs[1].sid.code = 0; - test_msg->obs[1].sid.reserved = 0; - test_msg->obs[1].sid.sat = 203; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].L.f = 2; - test_msg->obs[2].L.i = 122530650; - test_msg->obs[2].P = 2331537287; - test_msg->obs[2].cn0 = 150; - test_msg->obs[2].lock = 0; - test_msg->obs[2].sid.code = 0; - test_msg->obs[2].sid.reserved = 0; - test_msg->obs[2].sid.sat = 208; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[3].L.f = 241; - test_msg->obs[3].L.i = 119280830; - test_msg->obs[3].P = 2269703860; - test_msg->obs[3].cn0 = 155; - test_msg->obs[3].lock = 0; - test_msg->obs[3].sid.code = 0; - test_msg->obs[3].sid.reserved = 0; - test_msg->obs[3].sid.sat = 212; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[4].L.f = 153; - test_msg->obs[4].L.i = 109691996; - test_msg->obs[4].P = 2087295247; - test_msg->obs[4].cn0 = 168; - test_msg->obs[4].lock = 0; - test_msg->obs[4].sid.code = 0; - test_msg->obs[4].sid.reserved = 0; - test_msg->obs[4].sid.sat = 217; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[5].L.f = 41; - test_msg->obs[5].L.i = 123340176; - test_msg->obs[5].P = 2347022641; - test_msg->obs[5].cn0 = 150; - test_msg->obs[5].lock = 0; - test_msg->obs[5].sid.code = 0; - test_msg->obs[5].sid.reserved = 0; - test_msg->obs[5].sid.sat = 218; - - EXPECT_EQ(send_message( 0x43, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 32) << "incorrect value for header.n_obs, expected 32, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 2568000) << "incorrect value for header.t.tow, expected 2568000, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1787) << "incorrect value for header.t.wn, expected 1787, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 94) << "incorrect value for obs[0].L.f, expected 94, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, 117912556) << "incorrect value for obs[0].L.i, expected 117912556, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 2243658852) << "incorrect value for obs[0].P, expected 2243658852, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 156) << "incorrect value for obs[0].cn0, expected 156, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 0) << "incorrect value for obs[0].lock, expected 0, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].sid.code, 0) << "incorrect value for obs[0].sid.code, expected 0, is " << last_msg_->obs[0].sid.code; - EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) << "incorrect value for obs[0].sid.reserved, expected 0, is " << last_msg_->obs[0].sid.reserved; - EXPECT_EQ(last_msg_->obs[0].sid.sat, 202) << "incorrect value for obs[0].sid.sat, expected 202, is " << last_msg_->obs[0].sid.sat; - EXPECT_EQ(last_msg_->obs[1].L.f, 40) << "incorrect value for obs[1].L.f, expected 40, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, 129900210) << "incorrect value for obs[1].L.i, expected 129900210, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 2471868513) << "incorrect value for obs[1].P, expected 2471868513, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].cn0, 140) << "incorrect value for obs[1].cn0, expected 140, is " << last_msg_->obs[1].cn0; - EXPECT_EQ(last_msg_->obs[1].lock, 0) << "incorrect value for obs[1].lock, expected 0, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].sid.code, 0) << "incorrect value for obs[1].sid.code, expected 0, is " << last_msg_->obs[1].sid.code; - EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) << "incorrect value for obs[1].sid.reserved, expected 0, is " << last_msg_->obs[1].sid.reserved; - EXPECT_EQ(last_msg_->obs[1].sid.sat, 203) << "incorrect value for obs[1].sid.sat, expected 203, is " << last_msg_->obs[1].sid.sat; - EXPECT_EQ(last_msg_->obs[2].L.f, 2) << "incorrect value for obs[2].L.f, expected 2, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, 122530650) << "incorrect value for obs[2].L.i, expected 122530650, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 2331537287) << "incorrect value for obs[2].P, expected 2331537287, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].cn0, 150) << "incorrect value for obs[2].cn0, expected 150, is " << last_msg_->obs[2].cn0; - EXPECT_EQ(last_msg_->obs[2].lock, 0) << "incorrect value for obs[2].lock, expected 0, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].sid.code, 0) << "incorrect value for obs[2].sid.code, expected 0, is " << last_msg_->obs[2].sid.code; - EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) << "incorrect value for obs[2].sid.reserved, expected 0, is " << last_msg_->obs[2].sid.reserved; - EXPECT_EQ(last_msg_->obs[2].sid.sat, 208) << "incorrect value for obs[2].sid.sat, expected 208, is " << last_msg_->obs[2].sid.sat; - EXPECT_EQ(last_msg_->obs[3].L.f, 241) << "incorrect value for obs[3].L.f, expected 241, is " << last_msg_->obs[3].L.f; - EXPECT_EQ(last_msg_->obs[3].L.i, 119280830) << "incorrect value for obs[3].L.i, expected 119280830, is " << last_msg_->obs[3].L.i; - EXPECT_EQ(last_msg_->obs[3].P, 2269703860) << "incorrect value for obs[3].P, expected 2269703860, is " << last_msg_->obs[3].P; - EXPECT_EQ(last_msg_->obs[3].cn0, 155) << "incorrect value for obs[3].cn0, expected 155, is " << last_msg_->obs[3].cn0; - EXPECT_EQ(last_msg_->obs[3].lock, 0) << "incorrect value for obs[3].lock, expected 0, is " << last_msg_->obs[3].lock; - EXPECT_EQ(last_msg_->obs[3].sid.code, 0) << "incorrect value for obs[3].sid.code, expected 0, is " << last_msg_->obs[3].sid.code; - EXPECT_EQ(last_msg_->obs[3].sid.reserved, 0) << "incorrect value for obs[3].sid.reserved, expected 0, is " << last_msg_->obs[3].sid.reserved; - EXPECT_EQ(last_msg_->obs[3].sid.sat, 212) << "incorrect value for obs[3].sid.sat, expected 212, is " << last_msg_->obs[3].sid.sat; - EXPECT_EQ(last_msg_->obs[4].L.f, 153) << "incorrect value for obs[4].L.f, expected 153, is " << last_msg_->obs[4].L.f; - EXPECT_EQ(last_msg_->obs[4].L.i, 109691996) << "incorrect value for obs[4].L.i, expected 109691996, is " << last_msg_->obs[4].L.i; - EXPECT_EQ(last_msg_->obs[4].P, 2087295247) << "incorrect value for obs[4].P, expected 2087295247, is " << last_msg_->obs[4].P; - EXPECT_EQ(last_msg_->obs[4].cn0, 168) << "incorrect value for obs[4].cn0, expected 168, is " << last_msg_->obs[4].cn0; - EXPECT_EQ(last_msg_->obs[4].lock, 0) << "incorrect value for obs[4].lock, expected 0, is " << last_msg_->obs[4].lock; - EXPECT_EQ(last_msg_->obs[4].sid.code, 0) << "incorrect value for obs[4].sid.code, expected 0, is " << last_msg_->obs[4].sid.code; - EXPECT_EQ(last_msg_->obs[4].sid.reserved, 0) << "incorrect value for obs[4].sid.reserved, expected 0, is " << last_msg_->obs[4].sid.reserved; - EXPECT_EQ(last_msg_->obs[4].sid.sat, 217) << "incorrect value for obs[4].sid.sat, expected 217, is " << last_msg_->obs[4].sid.sat; - EXPECT_EQ(last_msg_->obs[5].L.f, 41) << "incorrect value for obs[5].L.f, expected 41, is " << last_msg_->obs[5].L.f; - EXPECT_EQ(last_msg_->obs[5].L.i, 123340176) << "incorrect value for obs[5].L.i, expected 123340176, is " << last_msg_->obs[5].L.i; - EXPECT_EQ(last_msg_->obs[5].P, 2347022641) << "incorrect value for obs[5].P, expected 2347022641, is " << last_msg_->obs[5].P; - EXPECT_EQ(last_msg_->obs[5].cn0, 150) << "incorrect value for obs[5].cn0, expected 150, is " << last_msg_->obs[5].cn0; - EXPECT_EQ(last_msg_->obs[5].lock, 0) << "incorrect value for obs[5].lock, expected 0, is " << last_msg_->obs[5].lock; - EXPECT_EQ(last_msg_->obs[5].sid.code, 0) << "incorrect value for obs[5].sid.code, expected 0, is " << last_msg_->obs[5].sid.code; - EXPECT_EQ(last_msg_->obs[5].sid.reserved, 0) << "incorrect value for obs[5].sid.reserved, expected 0, is " << last_msg_->obs[5].sid.reserved; - EXPECT_EQ(last_msg_->obs[5].sid.sat, 218) << "incorrect value for obs[5].sid.sat, expected 218, is " << last_msg_->obs[5].sid.sat; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepB2, Test) { + uint8_t encoded_frame[] = { + 85, 67, 0, 246, 215, 103, 64, 47, 39, 0, 251, 6, 32, 100, 132, 187, + 133, 236, 51, 7, 7, 94, 156, 0, 0, 202, 0, 0, 0, 97, 184, 85, + 147, 178, 30, 190, 7, 40, 140, 0, 0, 203, 0, 0, 0, 135, 111, 248, + 138, 90, 171, 77, 7, 2, 150, 0, 0, 208, 0, 0, 0, 180, 238, 72, + 135, 190, 20, 28, 7, 241, 155, 0, 0, 212, 0, 0, 0, 15, 153, 105, + 124, 92, 196, 137, 6, 153, 168, 0, 0, 217, 0, 0, 0, 49, 185, 228, + 139, 144, 5, 90, 7, 41, 150, 0, 0, 218, 0, 0, 0, 241, 98, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_b_t *test_msg = (msg_obs_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 32; + test_msg->header.t.tow = 2568000; + test_msg->header.t.wn = 1787; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 94; + test_msg->obs[0].L.i = 117912556; + test_msg->obs[0].P = 2243658852; + test_msg->obs[0].cn0 = 156; + test_msg->obs[0].lock = 0; + test_msg->obs[0].sid.code = 0; + test_msg->obs[0].sid.reserved = 0; + test_msg->obs[0].sid.sat = 202; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].L.f = 40; + test_msg->obs[1].L.i = 129900210; + test_msg->obs[1].P = 2471868513; + test_msg->obs[1].cn0 = 140; + test_msg->obs[1].lock = 0; + test_msg->obs[1].sid.code = 0; + test_msg->obs[1].sid.reserved = 0; + test_msg->obs[1].sid.sat = 203; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].L.f = 2; + test_msg->obs[2].L.i = 122530650; + test_msg->obs[2].P = 2331537287; + test_msg->obs[2].cn0 = 150; + test_msg->obs[2].lock = 0; + test_msg->obs[2].sid.code = 0; + test_msg->obs[2].sid.reserved = 0; + test_msg->obs[2].sid.sat = 208; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[3].L.f = 241; + test_msg->obs[3].L.i = 119280830; + test_msg->obs[3].P = 2269703860; + test_msg->obs[3].cn0 = 155; + test_msg->obs[3].lock = 0; + test_msg->obs[3].sid.code = 0; + test_msg->obs[3].sid.reserved = 0; + test_msg->obs[3].sid.sat = 212; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[4].L.f = 153; + test_msg->obs[4].L.i = 109691996; + test_msg->obs[4].P = 2087295247; + test_msg->obs[4].cn0 = 168; + test_msg->obs[4].lock = 0; + test_msg->obs[4].sid.code = 0; + test_msg->obs[4].sid.reserved = 0; + test_msg->obs[4].sid.sat = 217; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[5].L.f = 41; + test_msg->obs[5].L.i = 123340176; + test_msg->obs[5].P = 2347022641; + test_msg->obs[5].cn0 = 150; + test_msg->obs[5].lock = 0; + test_msg->obs[5].sid.code = 0; + test_msg->obs[5].sid.reserved = 0; + test_msg->obs[5].sid.sat = 218; + + EXPECT_EQ(send_message(0x43, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 32) + << "incorrect value for header.n_obs, expected 32, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 2568000) + << "incorrect value for header.t.tow, expected 2568000, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1787) + << "incorrect value for header.t.wn, expected 1787, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 94) + << "incorrect value for obs[0].L.f, expected 94, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, 117912556) + << "incorrect value for obs[0].L.i, expected 117912556, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 2243658852) + << "incorrect value for obs[0].P, expected 2243658852, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 156) + << "incorrect value for obs[0].cn0, expected 156, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 0) + << "incorrect value for obs[0].lock, expected 0, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].sid.code, 0) + << "incorrect value for obs[0].sid.code, expected 0, is " + << last_msg_->obs[0].sid.code; + EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) + << "incorrect value for obs[0].sid.reserved, expected 0, is " + << last_msg_->obs[0].sid.reserved; + EXPECT_EQ(last_msg_->obs[0].sid.sat, 202) + << "incorrect value for obs[0].sid.sat, expected 202, is " + << last_msg_->obs[0].sid.sat; + EXPECT_EQ(last_msg_->obs[1].L.f, 40) + << "incorrect value for obs[1].L.f, expected 40, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, 129900210) + << "incorrect value for obs[1].L.i, expected 129900210, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 2471868513) + << "incorrect value for obs[1].P, expected 2471868513, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].cn0, 140) + << "incorrect value for obs[1].cn0, expected 140, is " + << last_msg_->obs[1].cn0; + EXPECT_EQ(last_msg_->obs[1].lock, 0) + << "incorrect value for obs[1].lock, expected 0, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].sid.code, 0) + << "incorrect value for obs[1].sid.code, expected 0, is " + << last_msg_->obs[1].sid.code; + EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) + << "incorrect value for obs[1].sid.reserved, expected 0, is " + << last_msg_->obs[1].sid.reserved; + EXPECT_EQ(last_msg_->obs[1].sid.sat, 203) + << "incorrect value for obs[1].sid.sat, expected 203, is " + << last_msg_->obs[1].sid.sat; + EXPECT_EQ(last_msg_->obs[2].L.f, 2) + << "incorrect value for obs[2].L.f, expected 2, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, 122530650) + << "incorrect value for obs[2].L.i, expected 122530650, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 2331537287) + << "incorrect value for obs[2].P, expected 2331537287, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].cn0, 150) + << "incorrect value for obs[2].cn0, expected 150, is " + << last_msg_->obs[2].cn0; + EXPECT_EQ(last_msg_->obs[2].lock, 0) + << "incorrect value for obs[2].lock, expected 0, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].sid.code, 0) + << "incorrect value for obs[2].sid.code, expected 0, is " + << last_msg_->obs[2].sid.code; + EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) + << "incorrect value for obs[2].sid.reserved, expected 0, is " + << last_msg_->obs[2].sid.reserved; + EXPECT_EQ(last_msg_->obs[2].sid.sat, 208) + << "incorrect value for obs[2].sid.sat, expected 208, is " + << last_msg_->obs[2].sid.sat; + EXPECT_EQ(last_msg_->obs[3].L.f, 241) + << "incorrect value for obs[3].L.f, expected 241, is " + << last_msg_->obs[3].L.f; + EXPECT_EQ(last_msg_->obs[3].L.i, 119280830) + << "incorrect value for obs[3].L.i, expected 119280830, is " + << last_msg_->obs[3].L.i; + EXPECT_EQ(last_msg_->obs[3].P, 2269703860) + << "incorrect value for obs[3].P, expected 2269703860, is " + << last_msg_->obs[3].P; + EXPECT_EQ(last_msg_->obs[3].cn0, 155) + << "incorrect value for obs[3].cn0, expected 155, is " + << last_msg_->obs[3].cn0; + EXPECT_EQ(last_msg_->obs[3].lock, 0) + << "incorrect value for obs[3].lock, expected 0, is " + << last_msg_->obs[3].lock; + EXPECT_EQ(last_msg_->obs[3].sid.code, 0) + << "incorrect value for obs[3].sid.code, expected 0, is " + << last_msg_->obs[3].sid.code; + EXPECT_EQ(last_msg_->obs[3].sid.reserved, 0) + << "incorrect value for obs[3].sid.reserved, expected 0, is " + << last_msg_->obs[3].sid.reserved; + EXPECT_EQ(last_msg_->obs[3].sid.sat, 212) + << "incorrect value for obs[3].sid.sat, expected 212, is " + << last_msg_->obs[3].sid.sat; + EXPECT_EQ(last_msg_->obs[4].L.f, 153) + << "incorrect value for obs[4].L.f, expected 153, is " + << last_msg_->obs[4].L.f; + EXPECT_EQ(last_msg_->obs[4].L.i, 109691996) + << "incorrect value for obs[4].L.i, expected 109691996, is " + << last_msg_->obs[4].L.i; + EXPECT_EQ(last_msg_->obs[4].P, 2087295247) + << "incorrect value for obs[4].P, expected 2087295247, is " + << last_msg_->obs[4].P; + EXPECT_EQ(last_msg_->obs[4].cn0, 168) + << "incorrect value for obs[4].cn0, expected 168, is " + << last_msg_->obs[4].cn0; + EXPECT_EQ(last_msg_->obs[4].lock, 0) + << "incorrect value for obs[4].lock, expected 0, is " + << last_msg_->obs[4].lock; + EXPECT_EQ(last_msg_->obs[4].sid.code, 0) + << "incorrect value for obs[4].sid.code, expected 0, is " + << last_msg_->obs[4].sid.code; + EXPECT_EQ(last_msg_->obs[4].sid.reserved, 0) + << "incorrect value for obs[4].sid.reserved, expected 0, is " + << last_msg_->obs[4].sid.reserved; + EXPECT_EQ(last_msg_->obs[4].sid.sat, 217) + << "incorrect value for obs[4].sid.sat, expected 217, is " + << last_msg_->obs[4].sid.sat; + EXPECT_EQ(last_msg_->obs[5].L.f, 41) + << "incorrect value for obs[5].L.f, expected 41, is " + << last_msg_->obs[5].L.f; + EXPECT_EQ(last_msg_->obs[5].L.i, 123340176) + << "incorrect value for obs[5].L.i, expected 123340176, is " + << last_msg_->obs[5].L.i; + EXPECT_EQ(last_msg_->obs[5].P, 2347022641) + << "incorrect value for obs[5].P, expected 2347022641, is " + << last_msg_->obs[5].P; + EXPECT_EQ(last_msg_->obs[5].cn0, 150) + << "incorrect value for obs[5].cn0, expected 150, is " + << last_msg_->obs[5].cn0; + EXPECT_EQ(last_msg_->obs[5].lock, 0) + << "incorrect value for obs[5].lock, expected 0, is " + << last_msg_->obs[5].lock; + EXPECT_EQ(last_msg_->obs[5].sid.code, 0) + << "incorrect value for obs[5].sid.code, expected 0, is " + << last_msg_->obs[5].sid.code; + EXPECT_EQ(last_msg_->obs[5].sid.reserved, 0) + << "incorrect value for obs[5].sid.reserved, expected 0, is " + << last_msg_->obs[5].sid.reserved; + EXPECT_EQ(last_msg_->obs[5].sid.sat, 218) + << "incorrect value for obs[5].sid.sat, expected 218, is " + << last_msg_->obs[5].sid.sat; } -class Test_legacy_auto_check_sbp_observation_MsgObsDepB3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgObsDepB3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgObsDepB3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgObsDepB3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -664,150 +915,201 @@ class Test_legacy_auto_check_sbp_observation_MsgObsDepB3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepB3, Test) -{ - - uint8_t encoded_frame[] = {85,67,0,246,215,55,64,47,39,0,251,6,33,234,148,101,136,15,245,42,7,20,154,0,0,220,0,0,0,208,247,122,133,16,214,3,7,38,156,0,0,222,0,0,0,15,150,81,122,22,172,109,6,7,172,0,0,225,0,0,0,201,13, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_b_t* test_msg = ( msg_obs_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 33; - test_msg->header.t.tow = 2568000; - test_msg->header.t.wn = 1787; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 20; - test_msg->obs[0].L.i = 120255759; - test_msg->obs[0].P = 2288358634; - test_msg->obs[0].cn0 = 154; - test_msg->obs[0].lock = 0; - test_msg->obs[0].sid.code = 0; - test_msg->obs[0].sid.reserved = 0; - test_msg->obs[0].sid.sat = 220; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].L.f = 38; - test_msg->obs[1].L.i = 117691920; - test_msg->obs[1].P = 2239428560; - test_msg->obs[1].cn0 = 156; - test_msg->obs[1].lock = 0; - test_msg->obs[1].sid.code = 0; - test_msg->obs[1].sid.reserved = 0; - test_msg->obs[1].sid.sat = 222; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].L.f = 7; - test_msg->obs[2].L.i = 107850774; - test_msg->obs[2].P = 2052167183; - test_msg->obs[2].cn0 = 172; - test_msg->obs[2].lock = 0; - test_msg->obs[2].sid.code = 0; - test_msg->obs[2].sid.reserved = 0; - test_msg->obs[2].sid.sat = 225; - - EXPECT_EQ(send_message( 0x43, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 33) << "incorrect value for header.n_obs, expected 33, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 2568000) << "incorrect value for header.t.tow, expected 2568000, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1787) << "incorrect value for header.t.wn, expected 1787, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 20) << "incorrect value for obs[0].L.f, expected 20, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, 120255759) << "incorrect value for obs[0].L.i, expected 120255759, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 2288358634) << "incorrect value for obs[0].P, expected 2288358634, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 154) << "incorrect value for obs[0].cn0, expected 154, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 0) << "incorrect value for obs[0].lock, expected 0, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].sid.code, 0) << "incorrect value for obs[0].sid.code, expected 0, is " << last_msg_->obs[0].sid.code; - EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) << "incorrect value for obs[0].sid.reserved, expected 0, is " << last_msg_->obs[0].sid.reserved; - EXPECT_EQ(last_msg_->obs[0].sid.sat, 220) << "incorrect value for obs[0].sid.sat, expected 220, is " << last_msg_->obs[0].sid.sat; - EXPECT_EQ(last_msg_->obs[1].L.f, 38) << "incorrect value for obs[1].L.f, expected 38, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, 117691920) << "incorrect value for obs[1].L.i, expected 117691920, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 2239428560) << "incorrect value for obs[1].P, expected 2239428560, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].cn0, 156) << "incorrect value for obs[1].cn0, expected 156, is " << last_msg_->obs[1].cn0; - EXPECT_EQ(last_msg_->obs[1].lock, 0) << "incorrect value for obs[1].lock, expected 0, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].sid.code, 0) << "incorrect value for obs[1].sid.code, expected 0, is " << last_msg_->obs[1].sid.code; - EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) << "incorrect value for obs[1].sid.reserved, expected 0, is " << last_msg_->obs[1].sid.reserved; - EXPECT_EQ(last_msg_->obs[1].sid.sat, 222) << "incorrect value for obs[1].sid.sat, expected 222, is " << last_msg_->obs[1].sid.sat; - EXPECT_EQ(last_msg_->obs[2].L.f, 7) << "incorrect value for obs[2].L.f, expected 7, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, 107850774) << "incorrect value for obs[2].L.i, expected 107850774, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 2052167183) << "incorrect value for obs[2].P, expected 2052167183, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].cn0, 172) << "incorrect value for obs[2].cn0, expected 172, is " << last_msg_->obs[2].cn0; - EXPECT_EQ(last_msg_->obs[2].lock, 0) << "incorrect value for obs[2].lock, expected 0, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].sid.code, 0) << "incorrect value for obs[2].sid.code, expected 0, is " << last_msg_->obs[2].sid.code; - EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) << "incorrect value for obs[2].sid.reserved, expected 0, is " << last_msg_->obs[2].sid.reserved; - EXPECT_EQ(last_msg_->obs[2].sid.sat, 225) << "incorrect value for obs[2].sid.sat, expected 225, is " << last_msg_->obs[2].sid.sat; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepB3, Test) { + uint8_t encoded_frame[] = { + 85, 67, 0, 246, 215, 55, 64, 47, 39, 0, 251, 6, 33, 234, 148, 101, + 136, 15, 245, 42, 7, 20, 154, 0, 0, 220, 0, 0, 0, 208, 247, 122, + 133, 16, 214, 3, 7, 38, 156, 0, 0, 222, 0, 0, 0, 15, 150, 81, + 122, 22, 172, 109, 6, 7, 172, 0, 0, 225, 0, 0, 0, 201, 13, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_b_t *test_msg = (msg_obs_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 33; + test_msg->header.t.tow = 2568000; + test_msg->header.t.wn = 1787; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 20; + test_msg->obs[0].L.i = 120255759; + test_msg->obs[0].P = 2288358634; + test_msg->obs[0].cn0 = 154; + test_msg->obs[0].lock = 0; + test_msg->obs[0].sid.code = 0; + test_msg->obs[0].sid.reserved = 0; + test_msg->obs[0].sid.sat = 220; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].L.f = 38; + test_msg->obs[1].L.i = 117691920; + test_msg->obs[1].P = 2239428560; + test_msg->obs[1].cn0 = 156; + test_msg->obs[1].lock = 0; + test_msg->obs[1].sid.code = 0; + test_msg->obs[1].sid.reserved = 0; + test_msg->obs[1].sid.sat = 222; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].L.f = 7; + test_msg->obs[2].L.i = 107850774; + test_msg->obs[2].P = 2052167183; + test_msg->obs[2].cn0 = 172; + test_msg->obs[2].lock = 0; + test_msg->obs[2].sid.code = 0; + test_msg->obs[2].sid.reserved = 0; + test_msg->obs[2].sid.sat = 225; + + EXPECT_EQ(send_message(0x43, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 33) + << "incorrect value for header.n_obs, expected 33, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 2568000) + << "incorrect value for header.t.tow, expected 2568000, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1787) + << "incorrect value for header.t.wn, expected 1787, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 20) + << "incorrect value for obs[0].L.f, expected 20, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, 120255759) + << "incorrect value for obs[0].L.i, expected 120255759, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 2288358634) + << "incorrect value for obs[0].P, expected 2288358634, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 154) + << "incorrect value for obs[0].cn0, expected 154, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 0) + << "incorrect value for obs[0].lock, expected 0, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].sid.code, 0) + << "incorrect value for obs[0].sid.code, expected 0, is " + << last_msg_->obs[0].sid.code; + EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) + << "incorrect value for obs[0].sid.reserved, expected 0, is " + << last_msg_->obs[0].sid.reserved; + EXPECT_EQ(last_msg_->obs[0].sid.sat, 220) + << "incorrect value for obs[0].sid.sat, expected 220, is " + << last_msg_->obs[0].sid.sat; + EXPECT_EQ(last_msg_->obs[1].L.f, 38) + << "incorrect value for obs[1].L.f, expected 38, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, 117691920) + << "incorrect value for obs[1].L.i, expected 117691920, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 2239428560) + << "incorrect value for obs[1].P, expected 2239428560, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].cn0, 156) + << "incorrect value for obs[1].cn0, expected 156, is " + << last_msg_->obs[1].cn0; + EXPECT_EQ(last_msg_->obs[1].lock, 0) + << "incorrect value for obs[1].lock, expected 0, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].sid.code, 0) + << "incorrect value for obs[1].sid.code, expected 0, is " + << last_msg_->obs[1].sid.code; + EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) + << "incorrect value for obs[1].sid.reserved, expected 0, is " + << last_msg_->obs[1].sid.reserved; + EXPECT_EQ(last_msg_->obs[1].sid.sat, 222) + << "incorrect value for obs[1].sid.sat, expected 222, is " + << last_msg_->obs[1].sid.sat; + EXPECT_EQ(last_msg_->obs[2].L.f, 7) + << "incorrect value for obs[2].L.f, expected 7, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, 107850774) + << "incorrect value for obs[2].L.i, expected 107850774, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 2052167183) + << "incorrect value for obs[2].P, expected 2052167183, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].cn0, 172) + << "incorrect value for obs[2].cn0, expected 172, is " + << last_msg_->obs[2].cn0; + EXPECT_EQ(last_msg_->obs[2].lock, 0) + << "incorrect value for obs[2].lock, expected 0, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].sid.code, 0) + << "incorrect value for obs[2].sid.code, expected 0, is " + << last_msg_->obs[2].sid.code; + EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) + << "incorrect value for obs[2].sid.reserved, expected 0, is " + << last_msg_->obs[2].sid.reserved; + EXPECT_EQ(last_msg_->obs[2].sid.sat, 225) + << "incorrect value for obs[2].sid.sat, expected 225, is " + << last_msg_->obs[2].sid.sat; } -class Test_legacy_auto_check_sbp_observation_MsgObsDepB4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgObsDepB4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgObsDepB4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgObsDepB4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -817,159 +1119,267 @@ class Test_legacy_auto_check_sbp_observation_MsgObsDepB4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepB4, Test) -{ - - uint8_t encoded_frame[] = {85,67,0,246,215,103,8,48,39,0,251,6,32,254,96,187,133,249,49,7,7,165,156,0,0,202,0,0,0,113,229,85,147,11,33,190,7,106,143,0,0,203,0,0,0,182,85,248,138,227,169,77,7,159,150,0,0,208,0,0,0,17,24,73,135,10,23,28,7,7,156,0,0,212,0,0,0,108,155,105,124,166,196,137,6,186,170,0,0,217,0,0,0,214,142,228,139,77,3,90,7,236,151,0,0,218,0,0,0,59,118, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_b_t* test_msg = ( msg_obs_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 32; - test_msg->header.t.tow = 2568200; - test_msg->header.t.wn = 1787; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 165; - test_msg->obs[0].L.i = 117912057; - test_msg->obs[0].P = 2243649790; - test_msg->obs[0].cn0 = 156; - test_msg->obs[0].lock = 0; - test_msg->obs[0].sid.code = 0; - test_msg->obs[0].sid.reserved = 0; - test_msg->obs[0].sid.sat = 202; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].L.f = 106; - test_msg->obs[1].L.i = 129900811; - test_msg->obs[1].P = 2471880049; - test_msg->obs[1].cn0 = 143; - test_msg->obs[1].lock = 0; - test_msg->obs[1].sid.code = 0; - test_msg->obs[1].sid.reserved = 0; - test_msg->obs[1].sid.sat = 203; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].L.f = 159; - test_msg->obs[2].L.i = 122530275; - test_msg->obs[2].P = 2331530678; - test_msg->obs[2].cn0 = 150; - test_msg->obs[2].lock = 0; - test_msg->obs[2].sid.code = 0; - test_msg->obs[2].sid.reserved = 0; - test_msg->obs[2].sid.sat = 208; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[3].L.f = 7; - test_msg->obs[3].L.i = 119281418; - test_msg->obs[3].P = 2269714449; - test_msg->obs[3].cn0 = 156; - test_msg->obs[3].lock = 0; - test_msg->obs[3].sid.code = 0; - test_msg->obs[3].sid.reserved = 0; - test_msg->obs[3].sid.sat = 212; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[4].L.f = 186; - test_msg->obs[4].L.i = 109692070; - test_msg->obs[4].P = 2087295852; - test_msg->obs[4].cn0 = 170; - test_msg->obs[4].lock = 0; - test_msg->obs[4].sid.code = 0; - test_msg->obs[4].sid.reserved = 0; - test_msg->obs[4].sid.sat = 217; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[5].L.f = 236; - test_msg->obs[5].L.i = 123339597; - test_msg->obs[5].P = 2347011798; - test_msg->obs[5].cn0 = 151; - test_msg->obs[5].lock = 0; - test_msg->obs[5].sid.code = 0; - test_msg->obs[5].sid.reserved = 0; - test_msg->obs[5].sid.sat = 218; - - EXPECT_EQ(send_message( 0x43, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 32) << "incorrect value for header.n_obs, expected 32, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 2568200) << "incorrect value for header.t.tow, expected 2568200, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1787) << "incorrect value for header.t.wn, expected 1787, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 165) << "incorrect value for obs[0].L.f, expected 165, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, 117912057) << "incorrect value for obs[0].L.i, expected 117912057, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 2243649790) << "incorrect value for obs[0].P, expected 2243649790, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 156) << "incorrect value for obs[0].cn0, expected 156, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 0) << "incorrect value for obs[0].lock, expected 0, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].sid.code, 0) << "incorrect value for obs[0].sid.code, expected 0, is " << last_msg_->obs[0].sid.code; - EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) << "incorrect value for obs[0].sid.reserved, expected 0, is " << last_msg_->obs[0].sid.reserved; - EXPECT_EQ(last_msg_->obs[0].sid.sat, 202) << "incorrect value for obs[0].sid.sat, expected 202, is " << last_msg_->obs[0].sid.sat; - EXPECT_EQ(last_msg_->obs[1].L.f, 106) << "incorrect value for obs[1].L.f, expected 106, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, 129900811) << "incorrect value for obs[1].L.i, expected 129900811, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 2471880049) << "incorrect value for obs[1].P, expected 2471880049, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].cn0, 143) << "incorrect value for obs[1].cn0, expected 143, is " << last_msg_->obs[1].cn0; - EXPECT_EQ(last_msg_->obs[1].lock, 0) << "incorrect value for obs[1].lock, expected 0, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].sid.code, 0) << "incorrect value for obs[1].sid.code, expected 0, is " << last_msg_->obs[1].sid.code; - EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) << "incorrect value for obs[1].sid.reserved, expected 0, is " << last_msg_->obs[1].sid.reserved; - EXPECT_EQ(last_msg_->obs[1].sid.sat, 203) << "incorrect value for obs[1].sid.sat, expected 203, is " << last_msg_->obs[1].sid.sat; - EXPECT_EQ(last_msg_->obs[2].L.f, 159) << "incorrect value for obs[2].L.f, expected 159, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, 122530275) << "incorrect value for obs[2].L.i, expected 122530275, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 2331530678) << "incorrect value for obs[2].P, expected 2331530678, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].cn0, 150) << "incorrect value for obs[2].cn0, expected 150, is " << last_msg_->obs[2].cn0; - EXPECT_EQ(last_msg_->obs[2].lock, 0) << "incorrect value for obs[2].lock, expected 0, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].sid.code, 0) << "incorrect value for obs[2].sid.code, expected 0, is " << last_msg_->obs[2].sid.code; - EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) << "incorrect value for obs[2].sid.reserved, expected 0, is " << last_msg_->obs[2].sid.reserved; - EXPECT_EQ(last_msg_->obs[2].sid.sat, 208) << "incorrect value for obs[2].sid.sat, expected 208, is " << last_msg_->obs[2].sid.sat; - EXPECT_EQ(last_msg_->obs[3].L.f, 7) << "incorrect value for obs[3].L.f, expected 7, is " << last_msg_->obs[3].L.f; - EXPECT_EQ(last_msg_->obs[3].L.i, 119281418) << "incorrect value for obs[3].L.i, expected 119281418, is " << last_msg_->obs[3].L.i; - EXPECT_EQ(last_msg_->obs[3].P, 2269714449) << "incorrect value for obs[3].P, expected 2269714449, is " << last_msg_->obs[3].P; - EXPECT_EQ(last_msg_->obs[3].cn0, 156) << "incorrect value for obs[3].cn0, expected 156, is " << last_msg_->obs[3].cn0; - EXPECT_EQ(last_msg_->obs[3].lock, 0) << "incorrect value for obs[3].lock, expected 0, is " << last_msg_->obs[3].lock; - EXPECT_EQ(last_msg_->obs[3].sid.code, 0) << "incorrect value for obs[3].sid.code, expected 0, is " << last_msg_->obs[3].sid.code; - EXPECT_EQ(last_msg_->obs[3].sid.reserved, 0) << "incorrect value for obs[3].sid.reserved, expected 0, is " << last_msg_->obs[3].sid.reserved; - EXPECT_EQ(last_msg_->obs[3].sid.sat, 212) << "incorrect value for obs[3].sid.sat, expected 212, is " << last_msg_->obs[3].sid.sat; - EXPECT_EQ(last_msg_->obs[4].L.f, 186) << "incorrect value for obs[4].L.f, expected 186, is " << last_msg_->obs[4].L.f; - EXPECT_EQ(last_msg_->obs[4].L.i, 109692070) << "incorrect value for obs[4].L.i, expected 109692070, is " << last_msg_->obs[4].L.i; - EXPECT_EQ(last_msg_->obs[4].P, 2087295852) << "incorrect value for obs[4].P, expected 2087295852, is " << last_msg_->obs[4].P; - EXPECT_EQ(last_msg_->obs[4].cn0, 170) << "incorrect value for obs[4].cn0, expected 170, is " << last_msg_->obs[4].cn0; - EXPECT_EQ(last_msg_->obs[4].lock, 0) << "incorrect value for obs[4].lock, expected 0, is " << last_msg_->obs[4].lock; - EXPECT_EQ(last_msg_->obs[4].sid.code, 0) << "incorrect value for obs[4].sid.code, expected 0, is " << last_msg_->obs[4].sid.code; - EXPECT_EQ(last_msg_->obs[4].sid.reserved, 0) << "incorrect value for obs[4].sid.reserved, expected 0, is " << last_msg_->obs[4].sid.reserved; - EXPECT_EQ(last_msg_->obs[4].sid.sat, 217) << "incorrect value for obs[4].sid.sat, expected 217, is " << last_msg_->obs[4].sid.sat; - EXPECT_EQ(last_msg_->obs[5].L.f, 236) << "incorrect value for obs[5].L.f, expected 236, is " << last_msg_->obs[5].L.f; - EXPECT_EQ(last_msg_->obs[5].L.i, 123339597) << "incorrect value for obs[5].L.i, expected 123339597, is " << last_msg_->obs[5].L.i; - EXPECT_EQ(last_msg_->obs[5].P, 2347011798) << "incorrect value for obs[5].P, expected 2347011798, is " << last_msg_->obs[5].P; - EXPECT_EQ(last_msg_->obs[5].cn0, 151) << "incorrect value for obs[5].cn0, expected 151, is " << last_msg_->obs[5].cn0; - EXPECT_EQ(last_msg_->obs[5].lock, 0) << "incorrect value for obs[5].lock, expected 0, is " << last_msg_->obs[5].lock; - EXPECT_EQ(last_msg_->obs[5].sid.code, 0) << "incorrect value for obs[5].sid.code, expected 0, is " << last_msg_->obs[5].sid.code; - EXPECT_EQ(last_msg_->obs[5].sid.reserved, 0) << "incorrect value for obs[5].sid.reserved, expected 0, is " << last_msg_->obs[5].sid.reserved; - EXPECT_EQ(last_msg_->obs[5].sid.sat, 218) << "incorrect value for obs[5].sid.sat, expected 218, is " << last_msg_->obs[5].sid.sat; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepB4, Test) { + uint8_t encoded_frame[] = { + 85, 67, 0, 246, 215, 103, 8, 48, 39, 0, 251, 6, 32, 254, 96, 187, + 133, 249, 49, 7, 7, 165, 156, 0, 0, 202, 0, 0, 0, 113, 229, 85, + 147, 11, 33, 190, 7, 106, 143, 0, 0, 203, 0, 0, 0, 182, 85, 248, + 138, 227, 169, 77, 7, 159, 150, 0, 0, 208, 0, 0, 0, 17, 24, 73, + 135, 10, 23, 28, 7, 7, 156, 0, 0, 212, 0, 0, 0, 108, 155, 105, + 124, 166, 196, 137, 6, 186, 170, 0, 0, 217, 0, 0, 0, 214, 142, 228, + 139, 77, 3, 90, 7, 236, 151, 0, 0, 218, 0, 0, 0, 59, 118, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_b_t *test_msg = (msg_obs_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 32; + test_msg->header.t.tow = 2568200; + test_msg->header.t.wn = 1787; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 165; + test_msg->obs[0].L.i = 117912057; + test_msg->obs[0].P = 2243649790; + test_msg->obs[0].cn0 = 156; + test_msg->obs[0].lock = 0; + test_msg->obs[0].sid.code = 0; + test_msg->obs[0].sid.reserved = 0; + test_msg->obs[0].sid.sat = 202; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].L.f = 106; + test_msg->obs[1].L.i = 129900811; + test_msg->obs[1].P = 2471880049; + test_msg->obs[1].cn0 = 143; + test_msg->obs[1].lock = 0; + test_msg->obs[1].sid.code = 0; + test_msg->obs[1].sid.reserved = 0; + test_msg->obs[1].sid.sat = 203; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].L.f = 159; + test_msg->obs[2].L.i = 122530275; + test_msg->obs[2].P = 2331530678; + test_msg->obs[2].cn0 = 150; + test_msg->obs[2].lock = 0; + test_msg->obs[2].sid.code = 0; + test_msg->obs[2].sid.reserved = 0; + test_msg->obs[2].sid.sat = 208; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[3].L.f = 7; + test_msg->obs[3].L.i = 119281418; + test_msg->obs[3].P = 2269714449; + test_msg->obs[3].cn0 = 156; + test_msg->obs[3].lock = 0; + test_msg->obs[3].sid.code = 0; + test_msg->obs[3].sid.reserved = 0; + test_msg->obs[3].sid.sat = 212; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[4].L.f = 186; + test_msg->obs[4].L.i = 109692070; + test_msg->obs[4].P = 2087295852; + test_msg->obs[4].cn0 = 170; + test_msg->obs[4].lock = 0; + test_msg->obs[4].sid.code = 0; + test_msg->obs[4].sid.reserved = 0; + test_msg->obs[4].sid.sat = 217; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[5].L.f = 236; + test_msg->obs[5].L.i = 123339597; + test_msg->obs[5].P = 2347011798; + test_msg->obs[5].cn0 = 151; + test_msg->obs[5].lock = 0; + test_msg->obs[5].sid.code = 0; + test_msg->obs[5].sid.reserved = 0; + test_msg->obs[5].sid.sat = 218; + + EXPECT_EQ(send_message(0x43, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 32) + << "incorrect value for header.n_obs, expected 32, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 2568200) + << "incorrect value for header.t.tow, expected 2568200, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1787) + << "incorrect value for header.t.wn, expected 1787, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 165) + << "incorrect value for obs[0].L.f, expected 165, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, 117912057) + << "incorrect value for obs[0].L.i, expected 117912057, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 2243649790) + << "incorrect value for obs[0].P, expected 2243649790, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 156) + << "incorrect value for obs[0].cn0, expected 156, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 0) + << "incorrect value for obs[0].lock, expected 0, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].sid.code, 0) + << "incorrect value for obs[0].sid.code, expected 0, is " + << last_msg_->obs[0].sid.code; + EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) + << "incorrect value for obs[0].sid.reserved, expected 0, is " + << last_msg_->obs[0].sid.reserved; + EXPECT_EQ(last_msg_->obs[0].sid.sat, 202) + << "incorrect value for obs[0].sid.sat, expected 202, is " + << last_msg_->obs[0].sid.sat; + EXPECT_EQ(last_msg_->obs[1].L.f, 106) + << "incorrect value for obs[1].L.f, expected 106, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, 129900811) + << "incorrect value for obs[1].L.i, expected 129900811, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 2471880049) + << "incorrect value for obs[1].P, expected 2471880049, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].cn0, 143) + << "incorrect value for obs[1].cn0, expected 143, is " + << last_msg_->obs[1].cn0; + EXPECT_EQ(last_msg_->obs[1].lock, 0) + << "incorrect value for obs[1].lock, expected 0, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].sid.code, 0) + << "incorrect value for obs[1].sid.code, expected 0, is " + << last_msg_->obs[1].sid.code; + EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) + << "incorrect value for obs[1].sid.reserved, expected 0, is " + << last_msg_->obs[1].sid.reserved; + EXPECT_EQ(last_msg_->obs[1].sid.sat, 203) + << "incorrect value for obs[1].sid.sat, expected 203, is " + << last_msg_->obs[1].sid.sat; + EXPECT_EQ(last_msg_->obs[2].L.f, 159) + << "incorrect value for obs[2].L.f, expected 159, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, 122530275) + << "incorrect value for obs[2].L.i, expected 122530275, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 2331530678) + << "incorrect value for obs[2].P, expected 2331530678, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].cn0, 150) + << "incorrect value for obs[2].cn0, expected 150, is " + << last_msg_->obs[2].cn0; + EXPECT_EQ(last_msg_->obs[2].lock, 0) + << "incorrect value for obs[2].lock, expected 0, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].sid.code, 0) + << "incorrect value for obs[2].sid.code, expected 0, is " + << last_msg_->obs[2].sid.code; + EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) + << "incorrect value for obs[2].sid.reserved, expected 0, is " + << last_msg_->obs[2].sid.reserved; + EXPECT_EQ(last_msg_->obs[2].sid.sat, 208) + << "incorrect value for obs[2].sid.sat, expected 208, is " + << last_msg_->obs[2].sid.sat; + EXPECT_EQ(last_msg_->obs[3].L.f, 7) + << "incorrect value for obs[3].L.f, expected 7, is " + << last_msg_->obs[3].L.f; + EXPECT_EQ(last_msg_->obs[3].L.i, 119281418) + << "incorrect value for obs[3].L.i, expected 119281418, is " + << last_msg_->obs[3].L.i; + EXPECT_EQ(last_msg_->obs[3].P, 2269714449) + << "incorrect value for obs[3].P, expected 2269714449, is " + << last_msg_->obs[3].P; + EXPECT_EQ(last_msg_->obs[3].cn0, 156) + << "incorrect value for obs[3].cn0, expected 156, is " + << last_msg_->obs[3].cn0; + EXPECT_EQ(last_msg_->obs[3].lock, 0) + << "incorrect value for obs[3].lock, expected 0, is " + << last_msg_->obs[3].lock; + EXPECT_EQ(last_msg_->obs[3].sid.code, 0) + << "incorrect value for obs[3].sid.code, expected 0, is " + << last_msg_->obs[3].sid.code; + EXPECT_EQ(last_msg_->obs[3].sid.reserved, 0) + << "incorrect value for obs[3].sid.reserved, expected 0, is " + << last_msg_->obs[3].sid.reserved; + EXPECT_EQ(last_msg_->obs[3].sid.sat, 212) + << "incorrect value for obs[3].sid.sat, expected 212, is " + << last_msg_->obs[3].sid.sat; + EXPECT_EQ(last_msg_->obs[4].L.f, 186) + << "incorrect value for obs[4].L.f, expected 186, is " + << last_msg_->obs[4].L.f; + EXPECT_EQ(last_msg_->obs[4].L.i, 109692070) + << "incorrect value for obs[4].L.i, expected 109692070, is " + << last_msg_->obs[4].L.i; + EXPECT_EQ(last_msg_->obs[4].P, 2087295852) + << "incorrect value for obs[4].P, expected 2087295852, is " + << last_msg_->obs[4].P; + EXPECT_EQ(last_msg_->obs[4].cn0, 170) + << "incorrect value for obs[4].cn0, expected 170, is " + << last_msg_->obs[4].cn0; + EXPECT_EQ(last_msg_->obs[4].lock, 0) + << "incorrect value for obs[4].lock, expected 0, is " + << last_msg_->obs[4].lock; + EXPECT_EQ(last_msg_->obs[4].sid.code, 0) + << "incorrect value for obs[4].sid.code, expected 0, is " + << last_msg_->obs[4].sid.code; + EXPECT_EQ(last_msg_->obs[4].sid.reserved, 0) + << "incorrect value for obs[4].sid.reserved, expected 0, is " + << last_msg_->obs[4].sid.reserved; + EXPECT_EQ(last_msg_->obs[4].sid.sat, 217) + << "incorrect value for obs[4].sid.sat, expected 217, is " + << last_msg_->obs[4].sid.sat; + EXPECT_EQ(last_msg_->obs[5].L.f, 236) + << "incorrect value for obs[5].L.f, expected 236, is " + << last_msg_->obs[5].L.f; + EXPECT_EQ(last_msg_->obs[5].L.i, 123339597) + << "incorrect value for obs[5].L.i, expected 123339597, is " + << last_msg_->obs[5].L.i; + EXPECT_EQ(last_msg_->obs[5].P, 2347011798) + << "incorrect value for obs[5].P, expected 2347011798, is " + << last_msg_->obs[5].P; + EXPECT_EQ(last_msg_->obs[5].cn0, 151) + << "incorrect value for obs[5].cn0, expected 151, is " + << last_msg_->obs[5].cn0; + EXPECT_EQ(last_msg_->obs[5].lock, 0) + << "incorrect value for obs[5].lock, expected 0, is " + << last_msg_->obs[5].lock; + EXPECT_EQ(last_msg_->obs[5].sid.code, 0) + << "incorrect value for obs[5].sid.code, expected 0, is " + << last_msg_->obs[5].sid.code; + EXPECT_EQ(last_msg_->obs[5].sid.reserved, 0) + << "incorrect value for obs[5].sid.reserved, expected 0, is " + << last_msg_->obs[5].sid.reserved; + EXPECT_EQ(last_msg_->obs[5].sid.sat, 218) + << "incorrect value for obs[5].sid.sat, expected 218, is " + << last_msg_->obs[5].sid.sat; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgObsDepC.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgObsDepC.cc index 6dd771253..6db8f8c30 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgObsDepC.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgObsDepC.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepC.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgObsDepC.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgObsDepC0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgObsDepC0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgObsDepC0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgObsDepC0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_c_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,190 +81,275 @@ class Test_legacy_auto_check_sbp_observation_MsgObsDepC0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_c_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepC0, Test) -{ - - uint8_t encoded_frame[] = {85,73,0,70,152,87,8,95,183,24,106,7,32,126,250,73,80,113,94,247,255,231,163,229,229,4,0,0,0,60,220,96,70,81,147,250,255,196,208,20,28,6,0,0,0,248,61,62,77,28,60,242,255,110,171,180,178,7,0,0,0,237,84,190,77,172,37,13,0,41,170,233,164,10,0,0,0,36,85,9,75,240,188,21,0,19,182,196,209,12,0,0,0,190,175, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_c_t* test_msg = ( msg_obs_dep_c_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 32; - test_msg->header.t.tow = 414670600; - test_msg->header.t.wn = 1898; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 231; - test_msg->obs[0].L.i = -565647; - test_msg->obs[0].P = 1347025534; - test_msg->obs[0].cn0 = 163; - test_msg->obs[0].lock = 58853; - test_msg->obs[0].sid.code = 0; - test_msg->obs[0].sid.reserved = 0; - test_msg->obs[0].sid.sat = 4; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].L.f = 196; - test_msg->obs[1].L.i = -355503; - test_msg->obs[1].P = 1180752956; - test_msg->obs[1].cn0 = 208; - test_msg->obs[1].lock = 7188; - test_msg->obs[1].sid.code = 0; - test_msg->obs[1].sid.reserved = 0; - test_msg->obs[1].sid.sat = 6; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].L.f = 110; - test_msg->obs[2].L.i = -902116; - test_msg->obs[2].P = 1295924728; - test_msg->obs[2].cn0 = 171; - test_msg->obs[2].lock = 45748; - test_msg->obs[2].sid.code = 0; - test_msg->obs[2].sid.reserved = 0; - test_msg->obs[2].sid.sat = 7; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[3].L.f = 41; - test_msg->obs[3].L.i = 861612; - test_msg->obs[3].P = 1304319213; - test_msg->obs[3].cn0 = 170; - test_msg->obs[3].lock = 42217; - test_msg->obs[3].sid.code = 0; - test_msg->obs[3].sid.reserved = 0; - test_msg->obs[3].sid.sat = 10; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[4].L.f = 19; - test_msg->obs[4].L.i = 1424624; - test_msg->obs[4].P = 1258902820; - test_msg->obs[4].cn0 = 182; - test_msg->obs[4].lock = 53700; - test_msg->obs[4].sid.code = 0; - test_msg->obs[4].sid.reserved = 0; - test_msg->obs[4].sid.sat = 12; - - EXPECT_EQ(send_message( 0x49, 38982, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 38982); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 32) << "incorrect value for header.n_obs, expected 32, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 414670600) << "incorrect value for header.t.tow, expected 414670600, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1898) << "incorrect value for header.t.wn, expected 1898, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 231) << "incorrect value for obs[0].L.f, expected 231, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, -565647) << "incorrect value for obs[0].L.i, expected -565647, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 1347025534) << "incorrect value for obs[0].P, expected 1347025534, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 163) << "incorrect value for obs[0].cn0, expected 163, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 58853) << "incorrect value for obs[0].lock, expected 58853, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].sid.code, 0) << "incorrect value for obs[0].sid.code, expected 0, is " << last_msg_->obs[0].sid.code; - EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) << "incorrect value for obs[0].sid.reserved, expected 0, is " << last_msg_->obs[0].sid.reserved; - EXPECT_EQ(last_msg_->obs[0].sid.sat, 4) << "incorrect value for obs[0].sid.sat, expected 4, is " << last_msg_->obs[0].sid.sat; - EXPECT_EQ(last_msg_->obs[1].L.f, 196) << "incorrect value for obs[1].L.f, expected 196, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, -355503) << "incorrect value for obs[1].L.i, expected -355503, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 1180752956) << "incorrect value for obs[1].P, expected 1180752956, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].cn0, 208) << "incorrect value for obs[1].cn0, expected 208, is " << last_msg_->obs[1].cn0; - EXPECT_EQ(last_msg_->obs[1].lock, 7188) << "incorrect value for obs[1].lock, expected 7188, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].sid.code, 0) << "incorrect value for obs[1].sid.code, expected 0, is " << last_msg_->obs[1].sid.code; - EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) << "incorrect value for obs[1].sid.reserved, expected 0, is " << last_msg_->obs[1].sid.reserved; - EXPECT_EQ(last_msg_->obs[1].sid.sat, 6) << "incorrect value for obs[1].sid.sat, expected 6, is " << last_msg_->obs[1].sid.sat; - EXPECT_EQ(last_msg_->obs[2].L.f, 110) << "incorrect value for obs[2].L.f, expected 110, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, -902116) << "incorrect value for obs[2].L.i, expected -902116, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 1295924728) << "incorrect value for obs[2].P, expected 1295924728, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].cn0, 171) << "incorrect value for obs[2].cn0, expected 171, is " << last_msg_->obs[2].cn0; - EXPECT_EQ(last_msg_->obs[2].lock, 45748) << "incorrect value for obs[2].lock, expected 45748, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].sid.code, 0) << "incorrect value for obs[2].sid.code, expected 0, is " << last_msg_->obs[2].sid.code; - EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) << "incorrect value for obs[2].sid.reserved, expected 0, is " << last_msg_->obs[2].sid.reserved; - EXPECT_EQ(last_msg_->obs[2].sid.sat, 7) << "incorrect value for obs[2].sid.sat, expected 7, is " << last_msg_->obs[2].sid.sat; - EXPECT_EQ(last_msg_->obs[3].L.f, 41) << "incorrect value for obs[3].L.f, expected 41, is " << last_msg_->obs[3].L.f; - EXPECT_EQ(last_msg_->obs[3].L.i, 861612) << "incorrect value for obs[3].L.i, expected 861612, is " << last_msg_->obs[3].L.i; - EXPECT_EQ(last_msg_->obs[3].P, 1304319213) << "incorrect value for obs[3].P, expected 1304319213, is " << last_msg_->obs[3].P; - EXPECT_EQ(last_msg_->obs[3].cn0, 170) << "incorrect value for obs[3].cn0, expected 170, is " << last_msg_->obs[3].cn0; - EXPECT_EQ(last_msg_->obs[3].lock, 42217) << "incorrect value for obs[3].lock, expected 42217, is " << last_msg_->obs[3].lock; - EXPECT_EQ(last_msg_->obs[3].sid.code, 0) << "incorrect value for obs[3].sid.code, expected 0, is " << last_msg_->obs[3].sid.code; - EXPECT_EQ(last_msg_->obs[3].sid.reserved, 0) << "incorrect value for obs[3].sid.reserved, expected 0, is " << last_msg_->obs[3].sid.reserved; - EXPECT_EQ(last_msg_->obs[3].sid.sat, 10) << "incorrect value for obs[3].sid.sat, expected 10, is " << last_msg_->obs[3].sid.sat; - EXPECT_EQ(last_msg_->obs[4].L.f, 19) << "incorrect value for obs[4].L.f, expected 19, is " << last_msg_->obs[4].L.f; - EXPECT_EQ(last_msg_->obs[4].L.i, 1424624) << "incorrect value for obs[4].L.i, expected 1424624, is " << last_msg_->obs[4].L.i; - EXPECT_EQ(last_msg_->obs[4].P, 1258902820) << "incorrect value for obs[4].P, expected 1258902820, is " << last_msg_->obs[4].P; - EXPECT_EQ(last_msg_->obs[4].cn0, 182) << "incorrect value for obs[4].cn0, expected 182, is " << last_msg_->obs[4].cn0; - EXPECT_EQ(last_msg_->obs[4].lock, 53700) << "incorrect value for obs[4].lock, expected 53700, is " << last_msg_->obs[4].lock; - EXPECT_EQ(last_msg_->obs[4].sid.code, 0) << "incorrect value for obs[4].sid.code, expected 0, is " << last_msg_->obs[4].sid.code; - EXPECT_EQ(last_msg_->obs[4].sid.reserved, 0) << "incorrect value for obs[4].sid.reserved, expected 0, is " << last_msg_->obs[4].sid.reserved; - EXPECT_EQ(last_msg_->obs[4].sid.sat, 12) << "incorrect value for obs[4].sid.sat, expected 12, is " << last_msg_->obs[4].sid.sat; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepC0, Test) { + uint8_t encoded_frame[] = { + 85, 73, 0, 70, 152, 87, 8, 95, 183, 24, 106, 7, 32, 126, 250, 73, + 80, 113, 94, 247, 255, 231, 163, 229, 229, 4, 0, 0, 0, 60, 220, 96, + 70, 81, 147, 250, 255, 196, 208, 20, 28, 6, 0, 0, 0, 248, 61, 62, + 77, 28, 60, 242, 255, 110, 171, 180, 178, 7, 0, 0, 0, 237, 84, 190, + 77, 172, 37, 13, 0, 41, 170, 233, 164, 10, 0, 0, 0, 36, 85, 9, + 75, 240, 188, 21, 0, 19, 182, 196, 209, 12, 0, 0, 0, 190, 175, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_c_t *test_msg = (msg_obs_dep_c_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 32; + test_msg->header.t.tow = 414670600; + test_msg->header.t.wn = 1898; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 231; + test_msg->obs[0].L.i = -565647; + test_msg->obs[0].P = 1347025534; + test_msg->obs[0].cn0 = 163; + test_msg->obs[0].lock = 58853; + test_msg->obs[0].sid.code = 0; + test_msg->obs[0].sid.reserved = 0; + test_msg->obs[0].sid.sat = 4; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].L.f = 196; + test_msg->obs[1].L.i = -355503; + test_msg->obs[1].P = 1180752956; + test_msg->obs[1].cn0 = 208; + test_msg->obs[1].lock = 7188; + test_msg->obs[1].sid.code = 0; + test_msg->obs[1].sid.reserved = 0; + test_msg->obs[1].sid.sat = 6; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].L.f = 110; + test_msg->obs[2].L.i = -902116; + test_msg->obs[2].P = 1295924728; + test_msg->obs[2].cn0 = 171; + test_msg->obs[2].lock = 45748; + test_msg->obs[2].sid.code = 0; + test_msg->obs[2].sid.reserved = 0; + test_msg->obs[2].sid.sat = 7; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[3].L.f = 41; + test_msg->obs[3].L.i = 861612; + test_msg->obs[3].P = 1304319213; + test_msg->obs[3].cn0 = 170; + test_msg->obs[3].lock = 42217; + test_msg->obs[3].sid.code = 0; + test_msg->obs[3].sid.reserved = 0; + test_msg->obs[3].sid.sat = 10; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[4].L.f = 19; + test_msg->obs[4].L.i = 1424624; + test_msg->obs[4].P = 1258902820; + test_msg->obs[4].cn0 = 182; + test_msg->obs[4].lock = 53700; + test_msg->obs[4].sid.code = 0; + test_msg->obs[4].sid.reserved = 0; + test_msg->obs[4].sid.sat = 12; + + EXPECT_EQ(send_message(0x49, 38982, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 38982); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 32) + << "incorrect value for header.n_obs, expected 32, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 414670600) + << "incorrect value for header.t.tow, expected 414670600, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1898) + << "incorrect value for header.t.wn, expected 1898, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 231) + << "incorrect value for obs[0].L.f, expected 231, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, -565647) + << "incorrect value for obs[0].L.i, expected -565647, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 1347025534) + << "incorrect value for obs[0].P, expected 1347025534, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 163) + << "incorrect value for obs[0].cn0, expected 163, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 58853) + << "incorrect value for obs[0].lock, expected 58853, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].sid.code, 0) + << "incorrect value for obs[0].sid.code, expected 0, is " + << last_msg_->obs[0].sid.code; + EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) + << "incorrect value for obs[0].sid.reserved, expected 0, is " + << last_msg_->obs[0].sid.reserved; + EXPECT_EQ(last_msg_->obs[0].sid.sat, 4) + << "incorrect value for obs[0].sid.sat, expected 4, is " + << last_msg_->obs[0].sid.sat; + EXPECT_EQ(last_msg_->obs[1].L.f, 196) + << "incorrect value for obs[1].L.f, expected 196, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, -355503) + << "incorrect value for obs[1].L.i, expected -355503, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 1180752956) + << "incorrect value for obs[1].P, expected 1180752956, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].cn0, 208) + << "incorrect value for obs[1].cn0, expected 208, is " + << last_msg_->obs[1].cn0; + EXPECT_EQ(last_msg_->obs[1].lock, 7188) + << "incorrect value for obs[1].lock, expected 7188, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].sid.code, 0) + << "incorrect value for obs[1].sid.code, expected 0, is " + << last_msg_->obs[1].sid.code; + EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) + << "incorrect value for obs[1].sid.reserved, expected 0, is " + << last_msg_->obs[1].sid.reserved; + EXPECT_EQ(last_msg_->obs[1].sid.sat, 6) + << "incorrect value for obs[1].sid.sat, expected 6, is " + << last_msg_->obs[1].sid.sat; + EXPECT_EQ(last_msg_->obs[2].L.f, 110) + << "incorrect value for obs[2].L.f, expected 110, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, -902116) + << "incorrect value for obs[2].L.i, expected -902116, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 1295924728) + << "incorrect value for obs[2].P, expected 1295924728, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].cn0, 171) + << "incorrect value for obs[2].cn0, expected 171, is " + << last_msg_->obs[2].cn0; + EXPECT_EQ(last_msg_->obs[2].lock, 45748) + << "incorrect value for obs[2].lock, expected 45748, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].sid.code, 0) + << "incorrect value for obs[2].sid.code, expected 0, is " + << last_msg_->obs[2].sid.code; + EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) + << "incorrect value for obs[2].sid.reserved, expected 0, is " + << last_msg_->obs[2].sid.reserved; + EXPECT_EQ(last_msg_->obs[2].sid.sat, 7) + << "incorrect value for obs[2].sid.sat, expected 7, is " + << last_msg_->obs[2].sid.sat; + EXPECT_EQ(last_msg_->obs[3].L.f, 41) + << "incorrect value for obs[3].L.f, expected 41, is " + << last_msg_->obs[3].L.f; + EXPECT_EQ(last_msg_->obs[3].L.i, 861612) + << "incorrect value for obs[3].L.i, expected 861612, is " + << last_msg_->obs[3].L.i; + EXPECT_EQ(last_msg_->obs[3].P, 1304319213) + << "incorrect value for obs[3].P, expected 1304319213, is " + << last_msg_->obs[3].P; + EXPECT_EQ(last_msg_->obs[3].cn0, 170) + << "incorrect value for obs[3].cn0, expected 170, is " + << last_msg_->obs[3].cn0; + EXPECT_EQ(last_msg_->obs[3].lock, 42217) + << "incorrect value for obs[3].lock, expected 42217, is " + << last_msg_->obs[3].lock; + EXPECT_EQ(last_msg_->obs[3].sid.code, 0) + << "incorrect value for obs[3].sid.code, expected 0, is " + << last_msg_->obs[3].sid.code; + EXPECT_EQ(last_msg_->obs[3].sid.reserved, 0) + << "incorrect value for obs[3].sid.reserved, expected 0, is " + << last_msg_->obs[3].sid.reserved; + EXPECT_EQ(last_msg_->obs[3].sid.sat, 10) + << "incorrect value for obs[3].sid.sat, expected 10, is " + << last_msg_->obs[3].sid.sat; + EXPECT_EQ(last_msg_->obs[4].L.f, 19) + << "incorrect value for obs[4].L.f, expected 19, is " + << last_msg_->obs[4].L.f; + EXPECT_EQ(last_msg_->obs[4].L.i, 1424624) + << "incorrect value for obs[4].L.i, expected 1424624, is " + << last_msg_->obs[4].L.i; + EXPECT_EQ(last_msg_->obs[4].P, 1258902820) + << "incorrect value for obs[4].P, expected 1258902820, is " + << last_msg_->obs[4].P; + EXPECT_EQ(last_msg_->obs[4].cn0, 182) + << "incorrect value for obs[4].cn0, expected 182, is " + << last_msg_->obs[4].cn0; + EXPECT_EQ(last_msg_->obs[4].lock, 53700) + << "incorrect value for obs[4].lock, expected 53700, is " + << last_msg_->obs[4].lock; + EXPECT_EQ(last_msg_->obs[4].sid.code, 0) + << "incorrect value for obs[4].sid.code, expected 0, is " + << last_msg_->obs[4].sid.code; + EXPECT_EQ(last_msg_->obs[4].sid.reserved, 0) + << "incorrect value for obs[4].sid.reserved, expected 0, is " + << last_msg_->obs[4].sid.reserved; + EXPECT_EQ(last_msg_->obs[4].sid.sat, 12) + << "incorrect value for obs[4].sid.sat, expected 12, is " + << last_msg_->obs[4].sid.sat; } -class Test_legacy_auto_check_sbp_observation_MsgObsDepC1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgObsDepC1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgObsDepC1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgObsDepC1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_c_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -278,150 +359,201 @@ class Test_legacy_auto_check_sbp_observation_MsgObsDepC1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_c_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepC1, Test) -{ - - uint8_t encoded_frame[] = {85,73,0,70,152,55,8,95,183,24,106,7,33,68,166,75,77,186,230,24,0,101,186,162,102,16,0,0,0,87,255,155,69,74,158,5,0,26,190,206,30,27,0,0,0,64,89,124,68,26,22,3,0,114,217,225,73,29,0,0,0,37,179, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_c_t* test_msg = ( msg_obs_dep_c_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 33; - test_msg->header.t.tow = 414670600; - test_msg->header.t.wn = 1898; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 101; - test_msg->obs[0].L.i = 1631930; - test_msg->obs[0].P = 1296803396; - test_msg->obs[0].cn0 = 186; - test_msg->obs[0].lock = 26274; - test_msg->obs[0].sid.code = 0; - test_msg->obs[0].sid.reserved = 0; - test_msg->obs[0].sid.sat = 16; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].L.f = 26; - test_msg->obs[1].L.i = 368202; - test_msg->obs[1].P = 1167851351; - test_msg->obs[1].cn0 = 190; - test_msg->obs[1].lock = 7886; - test_msg->obs[1].sid.code = 0; - test_msg->obs[1].sid.reserved = 0; - test_msg->obs[1].sid.sat = 27; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].L.f = 114; - test_msg->obs[2].L.i = 202266; - test_msg->obs[2].P = 1149000000; - test_msg->obs[2].cn0 = 217; - test_msg->obs[2].lock = 18913; - test_msg->obs[2].sid.code = 0; - test_msg->obs[2].sid.reserved = 0; - test_msg->obs[2].sid.sat = 29; - - EXPECT_EQ(send_message( 0x49, 38982, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 38982); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 33) << "incorrect value for header.n_obs, expected 33, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 414670600) << "incorrect value for header.t.tow, expected 414670600, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1898) << "incorrect value for header.t.wn, expected 1898, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 101) << "incorrect value for obs[0].L.f, expected 101, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, 1631930) << "incorrect value for obs[0].L.i, expected 1631930, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 1296803396) << "incorrect value for obs[0].P, expected 1296803396, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 186) << "incorrect value for obs[0].cn0, expected 186, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 26274) << "incorrect value for obs[0].lock, expected 26274, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].sid.code, 0) << "incorrect value for obs[0].sid.code, expected 0, is " << last_msg_->obs[0].sid.code; - EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) << "incorrect value for obs[0].sid.reserved, expected 0, is " << last_msg_->obs[0].sid.reserved; - EXPECT_EQ(last_msg_->obs[0].sid.sat, 16) << "incorrect value for obs[0].sid.sat, expected 16, is " << last_msg_->obs[0].sid.sat; - EXPECT_EQ(last_msg_->obs[1].L.f, 26) << "incorrect value for obs[1].L.f, expected 26, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, 368202) << "incorrect value for obs[1].L.i, expected 368202, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 1167851351) << "incorrect value for obs[1].P, expected 1167851351, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].cn0, 190) << "incorrect value for obs[1].cn0, expected 190, is " << last_msg_->obs[1].cn0; - EXPECT_EQ(last_msg_->obs[1].lock, 7886) << "incorrect value for obs[1].lock, expected 7886, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].sid.code, 0) << "incorrect value for obs[1].sid.code, expected 0, is " << last_msg_->obs[1].sid.code; - EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) << "incorrect value for obs[1].sid.reserved, expected 0, is " << last_msg_->obs[1].sid.reserved; - EXPECT_EQ(last_msg_->obs[1].sid.sat, 27) << "incorrect value for obs[1].sid.sat, expected 27, is " << last_msg_->obs[1].sid.sat; - EXPECT_EQ(last_msg_->obs[2].L.f, 114) << "incorrect value for obs[2].L.f, expected 114, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, 202266) << "incorrect value for obs[2].L.i, expected 202266, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 1149000000) << "incorrect value for obs[2].P, expected 1149000000, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].cn0, 217) << "incorrect value for obs[2].cn0, expected 217, is " << last_msg_->obs[2].cn0; - EXPECT_EQ(last_msg_->obs[2].lock, 18913) << "incorrect value for obs[2].lock, expected 18913, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].sid.code, 0) << "incorrect value for obs[2].sid.code, expected 0, is " << last_msg_->obs[2].sid.code; - EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) << "incorrect value for obs[2].sid.reserved, expected 0, is " << last_msg_->obs[2].sid.reserved; - EXPECT_EQ(last_msg_->obs[2].sid.sat, 29) << "incorrect value for obs[2].sid.sat, expected 29, is " << last_msg_->obs[2].sid.sat; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepC1, Test) { + uint8_t encoded_frame[] = { + 85, 73, 0, 70, 152, 55, 8, 95, 183, 24, 106, 7, 33, 68, 166, 75, + 77, 186, 230, 24, 0, 101, 186, 162, 102, 16, 0, 0, 0, 87, 255, 155, + 69, 74, 158, 5, 0, 26, 190, 206, 30, 27, 0, 0, 0, 64, 89, 124, + 68, 26, 22, 3, 0, 114, 217, 225, 73, 29, 0, 0, 0, 37, 179, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_c_t *test_msg = (msg_obs_dep_c_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 33; + test_msg->header.t.tow = 414670600; + test_msg->header.t.wn = 1898; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 101; + test_msg->obs[0].L.i = 1631930; + test_msg->obs[0].P = 1296803396; + test_msg->obs[0].cn0 = 186; + test_msg->obs[0].lock = 26274; + test_msg->obs[0].sid.code = 0; + test_msg->obs[0].sid.reserved = 0; + test_msg->obs[0].sid.sat = 16; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].L.f = 26; + test_msg->obs[1].L.i = 368202; + test_msg->obs[1].P = 1167851351; + test_msg->obs[1].cn0 = 190; + test_msg->obs[1].lock = 7886; + test_msg->obs[1].sid.code = 0; + test_msg->obs[1].sid.reserved = 0; + test_msg->obs[1].sid.sat = 27; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].L.f = 114; + test_msg->obs[2].L.i = 202266; + test_msg->obs[2].P = 1149000000; + test_msg->obs[2].cn0 = 217; + test_msg->obs[2].lock = 18913; + test_msg->obs[2].sid.code = 0; + test_msg->obs[2].sid.reserved = 0; + test_msg->obs[2].sid.sat = 29; + + EXPECT_EQ(send_message(0x49, 38982, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 38982); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 33) + << "incorrect value for header.n_obs, expected 33, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 414670600) + << "incorrect value for header.t.tow, expected 414670600, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1898) + << "incorrect value for header.t.wn, expected 1898, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 101) + << "incorrect value for obs[0].L.f, expected 101, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, 1631930) + << "incorrect value for obs[0].L.i, expected 1631930, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 1296803396) + << "incorrect value for obs[0].P, expected 1296803396, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 186) + << "incorrect value for obs[0].cn0, expected 186, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 26274) + << "incorrect value for obs[0].lock, expected 26274, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].sid.code, 0) + << "incorrect value for obs[0].sid.code, expected 0, is " + << last_msg_->obs[0].sid.code; + EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) + << "incorrect value for obs[0].sid.reserved, expected 0, is " + << last_msg_->obs[0].sid.reserved; + EXPECT_EQ(last_msg_->obs[0].sid.sat, 16) + << "incorrect value for obs[0].sid.sat, expected 16, is " + << last_msg_->obs[0].sid.sat; + EXPECT_EQ(last_msg_->obs[1].L.f, 26) + << "incorrect value for obs[1].L.f, expected 26, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, 368202) + << "incorrect value for obs[1].L.i, expected 368202, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 1167851351) + << "incorrect value for obs[1].P, expected 1167851351, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].cn0, 190) + << "incorrect value for obs[1].cn0, expected 190, is " + << last_msg_->obs[1].cn0; + EXPECT_EQ(last_msg_->obs[1].lock, 7886) + << "incorrect value for obs[1].lock, expected 7886, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].sid.code, 0) + << "incorrect value for obs[1].sid.code, expected 0, is " + << last_msg_->obs[1].sid.code; + EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) + << "incorrect value for obs[1].sid.reserved, expected 0, is " + << last_msg_->obs[1].sid.reserved; + EXPECT_EQ(last_msg_->obs[1].sid.sat, 27) + << "incorrect value for obs[1].sid.sat, expected 27, is " + << last_msg_->obs[1].sid.sat; + EXPECT_EQ(last_msg_->obs[2].L.f, 114) + << "incorrect value for obs[2].L.f, expected 114, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, 202266) + << "incorrect value for obs[2].L.i, expected 202266, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 1149000000) + << "incorrect value for obs[2].P, expected 1149000000, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].cn0, 217) + << "incorrect value for obs[2].cn0, expected 217, is " + << last_msg_->obs[2].cn0; + EXPECT_EQ(last_msg_->obs[2].lock, 18913) + << "incorrect value for obs[2].lock, expected 18913, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].sid.code, 0) + << "incorrect value for obs[2].sid.code, expected 0, is " + << last_msg_->obs[2].sid.code; + EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) + << "incorrect value for obs[2].sid.reserved, expected 0, is " + << last_msg_->obs[2].sid.reserved; + EXPECT_EQ(last_msg_->obs[2].sid.sat, 29) + << "incorrect value for obs[2].sid.sat, expected 29, is " + << last_msg_->obs[2].sid.sat; } -class Test_legacy_auto_check_sbp_observation_MsgObsDepC2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgObsDepC2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgObsDepC2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgObsDepC2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_c_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -431,190 +563,275 @@ class Test_legacy_auto_check_sbp_observation_MsgObsDepC2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_c_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepC2, Test) -{ - - uint8_t encoded_frame[] = {85,73,0,0,0,87,8,95,183,24,106,7,32,217,251,73,80,9,72,248,255,30,168,113,81,4,0,0,0,211,220,96,70,198,107,251,255,115,195,53,144,6,0,0,0,77,61,62,77,40,161,243,255,130,176,93,142,7,0,0,0,1,86,190,77,88,77,12,0,116,199,229,213,10,0,0,0,93,85,9,75,64,139,20,0,120,177,196,194,12,0,0,0,141,161, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_c_t* test_msg = ( msg_obs_dep_c_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 32; - test_msg->header.t.tow = 414670600; - test_msg->header.t.wn = 1898; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 30; - test_msg->obs[0].L.i = -505847; - test_msg->obs[0].P = 1347025881; - test_msg->obs[0].cn0 = 168; - test_msg->obs[0].lock = 20849; - test_msg->obs[0].sid.code = 0; - test_msg->obs[0].sid.reserved = 0; - test_msg->obs[0].sid.sat = 4; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].L.f = 115; - test_msg->obs[1].L.i = -300090; - test_msg->obs[1].P = 1180753107; - test_msg->obs[1].cn0 = 195; - test_msg->obs[1].lock = 36917; - test_msg->obs[1].sid.code = 0; - test_msg->obs[1].sid.reserved = 0; - test_msg->obs[1].sid.sat = 6; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].L.f = 130; - test_msg->obs[2].L.i = -810712; - test_msg->obs[2].P = 1295924557; - test_msg->obs[2].cn0 = 176; - test_msg->obs[2].lock = 36445; - test_msg->obs[2].sid.code = 0; - test_msg->obs[2].sid.reserved = 0; - test_msg->obs[2].sid.sat = 7; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[3].L.f = 116; - test_msg->obs[3].L.i = 806232; - test_msg->obs[3].P = 1304319489; - test_msg->obs[3].cn0 = 199; - test_msg->obs[3].lock = 54757; - test_msg->obs[3].sid.code = 0; - test_msg->obs[3].sid.reserved = 0; - test_msg->obs[3].sid.sat = 10; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[4].L.f = 120; - test_msg->obs[4].L.i = 1346368; - test_msg->obs[4].P = 1258902877; - test_msg->obs[4].cn0 = 177; - test_msg->obs[4].lock = 49860; - test_msg->obs[4].sid.code = 0; - test_msg->obs[4].sid.reserved = 0; - test_msg->obs[4].sid.sat = 12; - - EXPECT_EQ(send_message( 0x49, 0, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 32) << "incorrect value for header.n_obs, expected 32, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 414670600) << "incorrect value for header.t.tow, expected 414670600, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1898) << "incorrect value for header.t.wn, expected 1898, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 30) << "incorrect value for obs[0].L.f, expected 30, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, -505847) << "incorrect value for obs[0].L.i, expected -505847, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 1347025881) << "incorrect value for obs[0].P, expected 1347025881, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 168) << "incorrect value for obs[0].cn0, expected 168, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 20849) << "incorrect value for obs[0].lock, expected 20849, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].sid.code, 0) << "incorrect value for obs[0].sid.code, expected 0, is " << last_msg_->obs[0].sid.code; - EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) << "incorrect value for obs[0].sid.reserved, expected 0, is " << last_msg_->obs[0].sid.reserved; - EXPECT_EQ(last_msg_->obs[0].sid.sat, 4) << "incorrect value for obs[0].sid.sat, expected 4, is " << last_msg_->obs[0].sid.sat; - EXPECT_EQ(last_msg_->obs[1].L.f, 115) << "incorrect value for obs[1].L.f, expected 115, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, -300090) << "incorrect value for obs[1].L.i, expected -300090, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 1180753107) << "incorrect value for obs[1].P, expected 1180753107, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].cn0, 195) << "incorrect value for obs[1].cn0, expected 195, is " << last_msg_->obs[1].cn0; - EXPECT_EQ(last_msg_->obs[1].lock, 36917) << "incorrect value for obs[1].lock, expected 36917, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].sid.code, 0) << "incorrect value for obs[1].sid.code, expected 0, is " << last_msg_->obs[1].sid.code; - EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) << "incorrect value for obs[1].sid.reserved, expected 0, is " << last_msg_->obs[1].sid.reserved; - EXPECT_EQ(last_msg_->obs[1].sid.sat, 6) << "incorrect value for obs[1].sid.sat, expected 6, is " << last_msg_->obs[1].sid.sat; - EXPECT_EQ(last_msg_->obs[2].L.f, 130) << "incorrect value for obs[2].L.f, expected 130, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, -810712) << "incorrect value for obs[2].L.i, expected -810712, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 1295924557) << "incorrect value for obs[2].P, expected 1295924557, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].cn0, 176) << "incorrect value for obs[2].cn0, expected 176, is " << last_msg_->obs[2].cn0; - EXPECT_EQ(last_msg_->obs[2].lock, 36445) << "incorrect value for obs[2].lock, expected 36445, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].sid.code, 0) << "incorrect value for obs[2].sid.code, expected 0, is " << last_msg_->obs[2].sid.code; - EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) << "incorrect value for obs[2].sid.reserved, expected 0, is " << last_msg_->obs[2].sid.reserved; - EXPECT_EQ(last_msg_->obs[2].sid.sat, 7) << "incorrect value for obs[2].sid.sat, expected 7, is " << last_msg_->obs[2].sid.sat; - EXPECT_EQ(last_msg_->obs[3].L.f, 116) << "incorrect value for obs[3].L.f, expected 116, is " << last_msg_->obs[3].L.f; - EXPECT_EQ(last_msg_->obs[3].L.i, 806232) << "incorrect value for obs[3].L.i, expected 806232, is " << last_msg_->obs[3].L.i; - EXPECT_EQ(last_msg_->obs[3].P, 1304319489) << "incorrect value for obs[3].P, expected 1304319489, is " << last_msg_->obs[3].P; - EXPECT_EQ(last_msg_->obs[3].cn0, 199) << "incorrect value for obs[3].cn0, expected 199, is " << last_msg_->obs[3].cn0; - EXPECT_EQ(last_msg_->obs[3].lock, 54757) << "incorrect value for obs[3].lock, expected 54757, is " << last_msg_->obs[3].lock; - EXPECT_EQ(last_msg_->obs[3].sid.code, 0) << "incorrect value for obs[3].sid.code, expected 0, is " << last_msg_->obs[3].sid.code; - EXPECT_EQ(last_msg_->obs[3].sid.reserved, 0) << "incorrect value for obs[3].sid.reserved, expected 0, is " << last_msg_->obs[3].sid.reserved; - EXPECT_EQ(last_msg_->obs[3].sid.sat, 10) << "incorrect value for obs[3].sid.sat, expected 10, is " << last_msg_->obs[3].sid.sat; - EXPECT_EQ(last_msg_->obs[4].L.f, 120) << "incorrect value for obs[4].L.f, expected 120, is " << last_msg_->obs[4].L.f; - EXPECT_EQ(last_msg_->obs[4].L.i, 1346368) << "incorrect value for obs[4].L.i, expected 1346368, is " << last_msg_->obs[4].L.i; - EXPECT_EQ(last_msg_->obs[4].P, 1258902877) << "incorrect value for obs[4].P, expected 1258902877, is " << last_msg_->obs[4].P; - EXPECT_EQ(last_msg_->obs[4].cn0, 177) << "incorrect value for obs[4].cn0, expected 177, is " << last_msg_->obs[4].cn0; - EXPECT_EQ(last_msg_->obs[4].lock, 49860) << "incorrect value for obs[4].lock, expected 49860, is " << last_msg_->obs[4].lock; - EXPECT_EQ(last_msg_->obs[4].sid.code, 0) << "incorrect value for obs[4].sid.code, expected 0, is " << last_msg_->obs[4].sid.code; - EXPECT_EQ(last_msg_->obs[4].sid.reserved, 0) << "incorrect value for obs[4].sid.reserved, expected 0, is " << last_msg_->obs[4].sid.reserved; - EXPECT_EQ(last_msg_->obs[4].sid.sat, 12) << "incorrect value for obs[4].sid.sat, expected 12, is " << last_msg_->obs[4].sid.sat; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepC2, Test) { + uint8_t encoded_frame[] = { + 85, 73, 0, 0, 0, 87, 8, 95, 183, 24, 106, 7, 32, 217, 251, 73, + 80, 9, 72, 248, 255, 30, 168, 113, 81, 4, 0, 0, 0, 211, 220, 96, + 70, 198, 107, 251, 255, 115, 195, 53, 144, 6, 0, 0, 0, 77, 61, 62, + 77, 40, 161, 243, 255, 130, 176, 93, 142, 7, 0, 0, 0, 1, 86, 190, + 77, 88, 77, 12, 0, 116, 199, 229, 213, 10, 0, 0, 0, 93, 85, 9, + 75, 64, 139, 20, 0, 120, 177, 196, 194, 12, 0, 0, 0, 141, 161, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_c_t *test_msg = (msg_obs_dep_c_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 32; + test_msg->header.t.tow = 414670600; + test_msg->header.t.wn = 1898; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 30; + test_msg->obs[0].L.i = -505847; + test_msg->obs[0].P = 1347025881; + test_msg->obs[0].cn0 = 168; + test_msg->obs[0].lock = 20849; + test_msg->obs[0].sid.code = 0; + test_msg->obs[0].sid.reserved = 0; + test_msg->obs[0].sid.sat = 4; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].L.f = 115; + test_msg->obs[1].L.i = -300090; + test_msg->obs[1].P = 1180753107; + test_msg->obs[1].cn0 = 195; + test_msg->obs[1].lock = 36917; + test_msg->obs[1].sid.code = 0; + test_msg->obs[1].sid.reserved = 0; + test_msg->obs[1].sid.sat = 6; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].L.f = 130; + test_msg->obs[2].L.i = -810712; + test_msg->obs[2].P = 1295924557; + test_msg->obs[2].cn0 = 176; + test_msg->obs[2].lock = 36445; + test_msg->obs[2].sid.code = 0; + test_msg->obs[2].sid.reserved = 0; + test_msg->obs[2].sid.sat = 7; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[3].L.f = 116; + test_msg->obs[3].L.i = 806232; + test_msg->obs[3].P = 1304319489; + test_msg->obs[3].cn0 = 199; + test_msg->obs[3].lock = 54757; + test_msg->obs[3].sid.code = 0; + test_msg->obs[3].sid.reserved = 0; + test_msg->obs[3].sid.sat = 10; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[4].L.f = 120; + test_msg->obs[4].L.i = 1346368; + test_msg->obs[4].P = 1258902877; + test_msg->obs[4].cn0 = 177; + test_msg->obs[4].lock = 49860; + test_msg->obs[4].sid.code = 0; + test_msg->obs[4].sid.reserved = 0; + test_msg->obs[4].sid.sat = 12; + + EXPECT_EQ(send_message(0x49, 0, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 32) + << "incorrect value for header.n_obs, expected 32, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 414670600) + << "incorrect value for header.t.tow, expected 414670600, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1898) + << "incorrect value for header.t.wn, expected 1898, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 30) + << "incorrect value for obs[0].L.f, expected 30, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, -505847) + << "incorrect value for obs[0].L.i, expected -505847, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 1347025881) + << "incorrect value for obs[0].P, expected 1347025881, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 168) + << "incorrect value for obs[0].cn0, expected 168, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 20849) + << "incorrect value for obs[0].lock, expected 20849, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].sid.code, 0) + << "incorrect value for obs[0].sid.code, expected 0, is " + << last_msg_->obs[0].sid.code; + EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) + << "incorrect value for obs[0].sid.reserved, expected 0, is " + << last_msg_->obs[0].sid.reserved; + EXPECT_EQ(last_msg_->obs[0].sid.sat, 4) + << "incorrect value for obs[0].sid.sat, expected 4, is " + << last_msg_->obs[0].sid.sat; + EXPECT_EQ(last_msg_->obs[1].L.f, 115) + << "incorrect value for obs[1].L.f, expected 115, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, -300090) + << "incorrect value for obs[1].L.i, expected -300090, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 1180753107) + << "incorrect value for obs[1].P, expected 1180753107, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].cn0, 195) + << "incorrect value for obs[1].cn0, expected 195, is " + << last_msg_->obs[1].cn0; + EXPECT_EQ(last_msg_->obs[1].lock, 36917) + << "incorrect value for obs[1].lock, expected 36917, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].sid.code, 0) + << "incorrect value for obs[1].sid.code, expected 0, is " + << last_msg_->obs[1].sid.code; + EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) + << "incorrect value for obs[1].sid.reserved, expected 0, is " + << last_msg_->obs[1].sid.reserved; + EXPECT_EQ(last_msg_->obs[1].sid.sat, 6) + << "incorrect value for obs[1].sid.sat, expected 6, is " + << last_msg_->obs[1].sid.sat; + EXPECT_EQ(last_msg_->obs[2].L.f, 130) + << "incorrect value for obs[2].L.f, expected 130, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, -810712) + << "incorrect value for obs[2].L.i, expected -810712, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 1295924557) + << "incorrect value for obs[2].P, expected 1295924557, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].cn0, 176) + << "incorrect value for obs[2].cn0, expected 176, is " + << last_msg_->obs[2].cn0; + EXPECT_EQ(last_msg_->obs[2].lock, 36445) + << "incorrect value for obs[2].lock, expected 36445, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].sid.code, 0) + << "incorrect value for obs[2].sid.code, expected 0, is " + << last_msg_->obs[2].sid.code; + EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) + << "incorrect value for obs[2].sid.reserved, expected 0, is " + << last_msg_->obs[2].sid.reserved; + EXPECT_EQ(last_msg_->obs[2].sid.sat, 7) + << "incorrect value for obs[2].sid.sat, expected 7, is " + << last_msg_->obs[2].sid.sat; + EXPECT_EQ(last_msg_->obs[3].L.f, 116) + << "incorrect value for obs[3].L.f, expected 116, is " + << last_msg_->obs[3].L.f; + EXPECT_EQ(last_msg_->obs[3].L.i, 806232) + << "incorrect value for obs[3].L.i, expected 806232, is " + << last_msg_->obs[3].L.i; + EXPECT_EQ(last_msg_->obs[3].P, 1304319489) + << "incorrect value for obs[3].P, expected 1304319489, is " + << last_msg_->obs[3].P; + EXPECT_EQ(last_msg_->obs[3].cn0, 199) + << "incorrect value for obs[3].cn0, expected 199, is " + << last_msg_->obs[3].cn0; + EXPECT_EQ(last_msg_->obs[3].lock, 54757) + << "incorrect value for obs[3].lock, expected 54757, is " + << last_msg_->obs[3].lock; + EXPECT_EQ(last_msg_->obs[3].sid.code, 0) + << "incorrect value for obs[3].sid.code, expected 0, is " + << last_msg_->obs[3].sid.code; + EXPECT_EQ(last_msg_->obs[3].sid.reserved, 0) + << "incorrect value for obs[3].sid.reserved, expected 0, is " + << last_msg_->obs[3].sid.reserved; + EXPECT_EQ(last_msg_->obs[3].sid.sat, 10) + << "incorrect value for obs[3].sid.sat, expected 10, is " + << last_msg_->obs[3].sid.sat; + EXPECT_EQ(last_msg_->obs[4].L.f, 120) + << "incorrect value for obs[4].L.f, expected 120, is " + << last_msg_->obs[4].L.f; + EXPECT_EQ(last_msg_->obs[4].L.i, 1346368) + << "incorrect value for obs[4].L.i, expected 1346368, is " + << last_msg_->obs[4].L.i; + EXPECT_EQ(last_msg_->obs[4].P, 1258902877) + << "incorrect value for obs[4].P, expected 1258902877, is " + << last_msg_->obs[4].P; + EXPECT_EQ(last_msg_->obs[4].cn0, 177) + << "incorrect value for obs[4].cn0, expected 177, is " + << last_msg_->obs[4].cn0; + EXPECT_EQ(last_msg_->obs[4].lock, 49860) + << "incorrect value for obs[4].lock, expected 49860, is " + << last_msg_->obs[4].lock; + EXPECT_EQ(last_msg_->obs[4].sid.code, 0) + << "incorrect value for obs[4].sid.code, expected 0, is " + << last_msg_->obs[4].sid.code; + EXPECT_EQ(last_msg_->obs[4].sid.reserved, 0) + << "incorrect value for obs[4].sid.reserved, expected 0, is " + << last_msg_->obs[4].sid.reserved; + EXPECT_EQ(last_msg_->obs[4].sid.sat, 12) + << "incorrect value for obs[4].sid.sat, expected 12, is " + << last_msg_->obs[4].sid.sat; } -class Test_legacy_auto_check_sbp_observation_MsgObsDepC3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgObsDepC3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgObsDepC3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgObsDepC3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_c_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -624,150 +841,201 @@ class Test_legacy_auto_check_sbp_observation_MsgObsDepC3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_c_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepC3, Test) -{ - - uint8_t encoded_frame[] = {85,73,0,0,0,55,8,95,183,24,106,7,33,70,167,75,77,140,136,23,0,90,187,158,129,16,0,0,0,232,255,155,69,45,175,5,0,17,208,175,56,27,0,0,0,64,89,124,68,45,96,3,0,75,185,73,206,29,0,0,0,220,158, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_c_t* test_msg = ( msg_obs_dep_c_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 33; - test_msg->header.t.tow = 414670600; - test_msg->header.t.wn = 1898; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 90; - test_msg->obs[0].L.i = 1542284; - test_msg->obs[0].P = 1296803654; - test_msg->obs[0].cn0 = 187; - test_msg->obs[0].lock = 33182; - test_msg->obs[0].sid.code = 0; - test_msg->obs[0].sid.reserved = 0; - test_msg->obs[0].sid.sat = 16; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].L.f = 17; - test_msg->obs[1].L.i = 372525; - test_msg->obs[1].P = 1167851496; - test_msg->obs[1].cn0 = 208; - test_msg->obs[1].lock = 14511; - test_msg->obs[1].sid.code = 0; - test_msg->obs[1].sid.reserved = 0; - test_msg->obs[1].sid.sat = 27; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].L.f = 75; - test_msg->obs[2].L.i = 221229; - test_msg->obs[2].P = 1149000000; - test_msg->obs[2].cn0 = 185; - test_msg->obs[2].lock = 52809; - test_msg->obs[2].sid.code = 0; - test_msg->obs[2].sid.reserved = 0; - test_msg->obs[2].sid.sat = 29; - - EXPECT_EQ(send_message( 0x49, 0, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 33) << "incorrect value for header.n_obs, expected 33, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 414670600) << "incorrect value for header.t.tow, expected 414670600, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1898) << "incorrect value for header.t.wn, expected 1898, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 90) << "incorrect value for obs[0].L.f, expected 90, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, 1542284) << "incorrect value for obs[0].L.i, expected 1542284, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 1296803654) << "incorrect value for obs[0].P, expected 1296803654, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 187) << "incorrect value for obs[0].cn0, expected 187, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 33182) << "incorrect value for obs[0].lock, expected 33182, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].sid.code, 0) << "incorrect value for obs[0].sid.code, expected 0, is " << last_msg_->obs[0].sid.code; - EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) << "incorrect value for obs[0].sid.reserved, expected 0, is " << last_msg_->obs[0].sid.reserved; - EXPECT_EQ(last_msg_->obs[0].sid.sat, 16) << "incorrect value for obs[0].sid.sat, expected 16, is " << last_msg_->obs[0].sid.sat; - EXPECT_EQ(last_msg_->obs[1].L.f, 17) << "incorrect value for obs[1].L.f, expected 17, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, 372525) << "incorrect value for obs[1].L.i, expected 372525, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 1167851496) << "incorrect value for obs[1].P, expected 1167851496, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].cn0, 208) << "incorrect value for obs[1].cn0, expected 208, is " << last_msg_->obs[1].cn0; - EXPECT_EQ(last_msg_->obs[1].lock, 14511) << "incorrect value for obs[1].lock, expected 14511, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].sid.code, 0) << "incorrect value for obs[1].sid.code, expected 0, is " << last_msg_->obs[1].sid.code; - EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) << "incorrect value for obs[1].sid.reserved, expected 0, is " << last_msg_->obs[1].sid.reserved; - EXPECT_EQ(last_msg_->obs[1].sid.sat, 27) << "incorrect value for obs[1].sid.sat, expected 27, is " << last_msg_->obs[1].sid.sat; - EXPECT_EQ(last_msg_->obs[2].L.f, 75) << "incorrect value for obs[2].L.f, expected 75, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, 221229) << "incorrect value for obs[2].L.i, expected 221229, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 1149000000) << "incorrect value for obs[2].P, expected 1149000000, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].cn0, 185) << "incorrect value for obs[2].cn0, expected 185, is " << last_msg_->obs[2].cn0; - EXPECT_EQ(last_msg_->obs[2].lock, 52809) << "incorrect value for obs[2].lock, expected 52809, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].sid.code, 0) << "incorrect value for obs[2].sid.code, expected 0, is " << last_msg_->obs[2].sid.code; - EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) << "incorrect value for obs[2].sid.reserved, expected 0, is " << last_msg_->obs[2].sid.reserved; - EXPECT_EQ(last_msg_->obs[2].sid.sat, 29) << "incorrect value for obs[2].sid.sat, expected 29, is " << last_msg_->obs[2].sid.sat; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepC3, Test) { + uint8_t encoded_frame[] = { + 85, 73, 0, 0, 0, 55, 8, 95, 183, 24, 106, 7, 33, 70, 167, 75, + 77, 140, 136, 23, 0, 90, 187, 158, 129, 16, 0, 0, 0, 232, 255, 155, + 69, 45, 175, 5, 0, 17, 208, 175, 56, 27, 0, 0, 0, 64, 89, 124, + 68, 45, 96, 3, 0, 75, 185, 73, 206, 29, 0, 0, 0, 220, 158, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_c_t *test_msg = (msg_obs_dep_c_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 33; + test_msg->header.t.tow = 414670600; + test_msg->header.t.wn = 1898; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 90; + test_msg->obs[0].L.i = 1542284; + test_msg->obs[0].P = 1296803654; + test_msg->obs[0].cn0 = 187; + test_msg->obs[0].lock = 33182; + test_msg->obs[0].sid.code = 0; + test_msg->obs[0].sid.reserved = 0; + test_msg->obs[0].sid.sat = 16; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].L.f = 17; + test_msg->obs[1].L.i = 372525; + test_msg->obs[1].P = 1167851496; + test_msg->obs[1].cn0 = 208; + test_msg->obs[1].lock = 14511; + test_msg->obs[1].sid.code = 0; + test_msg->obs[1].sid.reserved = 0; + test_msg->obs[1].sid.sat = 27; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].L.f = 75; + test_msg->obs[2].L.i = 221229; + test_msg->obs[2].P = 1149000000; + test_msg->obs[2].cn0 = 185; + test_msg->obs[2].lock = 52809; + test_msg->obs[2].sid.code = 0; + test_msg->obs[2].sid.reserved = 0; + test_msg->obs[2].sid.sat = 29; + + EXPECT_EQ(send_message(0x49, 0, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 33) + << "incorrect value for header.n_obs, expected 33, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 414670600) + << "incorrect value for header.t.tow, expected 414670600, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1898) + << "incorrect value for header.t.wn, expected 1898, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 90) + << "incorrect value for obs[0].L.f, expected 90, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, 1542284) + << "incorrect value for obs[0].L.i, expected 1542284, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 1296803654) + << "incorrect value for obs[0].P, expected 1296803654, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 187) + << "incorrect value for obs[0].cn0, expected 187, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 33182) + << "incorrect value for obs[0].lock, expected 33182, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].sid.code, 0) + << "incorrect value for obs[0].sid.code, expected 0, is " + << last_msg_->obs[0].sid.code; + EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) + << "incorrect value for obs[0].sid.reserved, expected 0, is " + << last_msg_->obs[0].sid.reserved; + EXPECT_EQ(last_msg_->obs[0].sid.sat, 16) + << "incorrect value for obs[0].sid.sat, expected 16, is " + << last_msg_->obs[0].sid.sat; + EXPECT_EQ(last_msg_->obs[1].L.f, 17) + << "incorrect value for obs[1].L.f, expected 17, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, 372525) + << "incorrect value for obs[1].L.i, expected 372525, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 1167851496) + << "incorrect value for obs[1].P, expected 1167851496, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].cn0, 208) + << "incorrect value for obs[1].cn0, expected 208, is " + << last_msg_->obs[1].cn0; + EXPECT_EQ(last_msg_->obs[1].lock, 14511) + << "incorrect value for obs[1].lock, expected 14511, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].sid.code, 0) + << "incorrect value for obs[1].sid.code, expected 0, is " + << last_msg_->obs[1].sid.code; + EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) + << "incorrect value for obs[1].sid.reserved, expected 0, is " + << last_msg_->obs[1].sid.reserved; + EXPECT_EQ(last_msg_->obs[1].sid.sat, 27) + << "incorrect value for obs[1].sid.sat, expected 27, is " + << last_msg_->obs[1].sid.sat; + EXPECT_EQ(last_msg_->obs[2].L.f, 75) + << "incorrect value for obs[2].L.f, expected 75, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, 221229) + << "incorrect value for obs[2].L.i, expected 221229, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 1149000000) + << "incorrect value for obs[2].P, expected 1149000000, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].cn0, 185) + << "incorrect value for obs[2].cn0, expected 185, is " + << last_msg_->obs[2].cn0; + EXPECT_EQ(last_msg_->obs[2].lock, 52809) + << "incorrect value for obs[2].lock, expected 52809, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].sid.code, 0) + << "incorrect value for obs[2].sid.code, expected 0, is " + << last_msg_->obs[2].sid.code; + EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) + << "incorrect value for obs[2].sid.reserved, expected 0, is " + << last_msg_->obs[2].sid.reserved; + EXPECT_EQ(last_msg_->obs[2].sid.sat, 29) + << "incorrect value for obs[2].sid.sat, expected 29, is " + << last_msg_->obs[2].sid.sat; } -class Test_legacy_auto_check_sbp_observation_MsgObsDepC4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgObsDepC4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgObsDepC4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgObsDepC4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_c_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_c_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -777,139 +1045,230 @@ class Test_legacy_auto_check_sbp_observation_MsgObsDepC4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_c_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepC4, Test) -{ - - uint8_t encoded_frame[] = {85,73,0,70,152,87,208,95,183,24,106,7,32,44,8,74,80,86,93,247,255,57,158,229,229,4,0,0,0,224,229,96,70,156,146,250,255,221,200,20,28,6,0,0,0,60,82,62,77,93,58,242,255,39,164,180,178,7,0,0,0,222,73,190,77,46,39,13,0,202,181,233,164,10,0,0,0,149,64,9,75,114,191,21,0,249,182,196,209,12,0,0,0,112,8, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_c_t* test_msg = ( msg_obs_dep_c_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 32; - test_msg->header.t.tow = 414670800; - test_msg->header.t.wn = 1898; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 57; - test_msg->obs[0].L.i = -565930; - test_msg->obs[0].P = 1347029036; - test_msg->obs[0].cn0 = 158; - test_msg->obs[0].lock = 58853; - test_msg->obs[0].sid.code = 0; - test_msg->obs[0].sid.reserved = 0; - test_msg->obs[0].sid.sat = 4; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].L.f = 221; - test_msg->obs[1].L.i = -355684; - test_msg->obs[1].P = 1180755424; - test_msg->obs[1].cn0 = 200; - test_msg->obs[1].lock = 7188; - test_msg->obs[1].sid.code = 0; - test_msg->obs[1].sid.reserved = 0; - test_msg->obs[1].sid.sat = 6; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].L.f = 39; - test_msg->obs[2].L.i = -902563; - test_msg->obs[2].P = 1295929916; - test_msg->obs[2].cn0 = 164; - test_msg->obs[2].lock = 45748; - test_msg->obs[2].sid.code = 0; - test_msg->obs[2].sid.reserved = 0; - test_msg->obs[2].sid.sat = 7; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[3].L.f = 202; - test_msg->obs[3].L.i = 861998; - test_msg->obs[3].P = 1304316382; - test_msg->obs[3].cn0 = 181; - test_msg->obs[3].lock = 42217; - test_msg->obs[3].sid.code = 0; - test_msg->obs[3].sid.reserved = 0; - test_msg->obs[3].sid.sat = 10; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[4].L.f = 249; - test_msg->obs[4].L.i = 1425266; - test_msg->obs[4].P = 1258897557; - test_msg->obs[4].cn0 = 182; - test_msg->obs[4].lock = 53700; - test_msg->obs[4].sid.code = 0; - test_msg->obs[4].sid.reserved = 0; - test_msg->obs[4].sid.sat = 12; - - EXPECT_EQ(send_message( 0x49, 38982, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 38982); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 32) << "incorrect value for header.n_obs, expected 32, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 414670800) << "incorrect value for header.t.tow, expected 414670800, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1898) << "incorrect value for header.t.wn, expected 1898, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 57) << "incorrect value for obs[0].L.f, expected 57, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, -565930) << "incorrect value for obs[0].L.i, expected -565930, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 1347029036) << "incorrect value for obs[0].P, expected 1347029036, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 158) << "incorrect value for obs[0].cn0, expected 158, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 58853) << "incorrect value for obs[0].lock, expected 58853, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].sid.code, 0) << "incorrect value for obs[0].sid.code, expected 0, is " << last_msg_->obs[0].sid.code; - EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) << "incorrect value for obs[0].sid.reserved, expected 0, is " << last_msg_->obs[0].sid.reserved; - EXPECT_EQ(last_msg_->obs[0].sid.sat, 4) << "incorrect value for obs[0].sid.sat, expected 4, is " << last_msg_->obs[0].sid.sat; - EXPECT_EQ(last_msg_->obs[1].L.f, 221) << "incorrect value for obs[1].L.f, expected 221, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, -355684) << "incorrect value for obs[1].L.i, expected -355684, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 1180755424) << "incorrect value for obs[1].P, expected 1180755424, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].cn0, 200) << "incorrect value for obs[1].cn0, expected 200, is " << last_msg_->obs[1].cn0; - EXPECT_EQ(last_msg_->obs[1].lock, 7188) << "incorrect value for obs[1].lock, expected 7188, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].sid.code, 0) << "incorrect value for obs[1].sid.code, expected 0, is " << last_msg_->obs[1].sid.code; - EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) << "incorrect value for obs[1].sid.reserved, expected 0, is " << last_msg_->obs[1].sid.reserved; - EXPECT_EQ(last_msg_->obs[1].sid.sat, 6) << "incorrect value for obs[1].sid.sat, expected 6, is " << last_msg_->obs[1].sid.sat; - EXPECT_EQ(last_msg_->obs[2].L.f, 39) << "incorrect value for obs[2].L.f, expected 39, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, -902563) << "incorrect value for obs[2].L.i, expected -902563, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 1295929916) << "incorrect value for obs[2].P, expected 1295929916, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].cn0, 164) << "incorrect value for obs[2].cn0, expected 164, is " << last_msg_->obs[2].cn0; - EXPECT_EQ(last_msg_->obs[2].lock, 45748) << "incorrect value for obs[2].lock, expected 45748, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].sid.code, 0) << "incorrect value for obs[2].sid.code, expected 0, is " << last_msg_->obs[2].sid.code; - EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) << "incorrect value for obs[2].sid.reserved, expected 0, is " << last_msg_->obs[2].sid.reserved; - EXPECT_EQ(last_msg_->obs[2].sid.sat, 7) << "incorrect value for obs[2].sid.sat, expected 7, is " << last_msg_->obs[2].sid.sat; - EXPECT_EQ(last_msg_->obs[3].L.f, 202) << "incorrect value for obs[3].L.f, expected 202, is " << last_msg_->obs[3].L.f; - EXPECT_EQ(last_msg_->obs[3].L.i, 861998) << "incorrect value for obs[3].L.i, expected 861998, is " << last_msg_->obs[3].L.i; - EXPECT_EQ(last_msg_->obs[3].P, 1304316382) << "incorrect value for obs[3].P, expected 1304316382, is " << last_msg_->obs[3].P; - EXPECT_EQ(last_msg_->obs[3].cn0, 181) << "incorrect value for obs[3].cn0, expected 181, is " << last_msg_->obs[3].cn0; - EXPECT_EQ(last_msg_->obs[3].lock, 42217) << "incorrect value for obs[3].lock, expected 42217, is " << last_msg_->obs[3].lock; - EXPECT_EQ(last_msg_->obs[3].sid.code, 0) << "incorrect value for obs[3].sid.code, expected 0, is " << last_msg_->obs[3].sid.code; - EXPECT_EQ(last_msg_->obs[3].sid.reserved, 0) << "incorrect value for obs[3].sid.reserved, expected 0, is " << last_msg_->obs[3].sid.reserved; - EXPECT_EQ(last_msg_->obs[3].sid.sat, 10) << "incorrect value for obs[3].sid.sat, expected 10, is " << last_msg_->obs[3].sid.sat; - EXPECT_EQ(last_msg_->obs[4].L.f, 249) << "incorrect value for obs[4].L.f, expected 249, is " << last_msg_->obs[4].L.f; - EXPECT_EQ(last_msg_->obs[4].L.i, 1425266) << "incorrect value for obs[4].L.i, expected 1425266, is " << last_msg_->obs[4].L.i; - EXPECT_EQ(last_msg_->obs[4].P, 1258897557) << "incorrect value for obs[4].P, expected 1258897557, is " << last_msg_->obs[4].P; - EXPECT_EQ(last_msg_->obs[4].cn0, 182) << "incorrect value for obs[4].cn0, expected 182, is " << last_msg_->obs[4].cn0; - EXPECT_EQ(last_msg_->obs[4].lock, 53700) << "incorrect value for obs[4].lock, expected 53700, is " << last_msg_->obs[4].lock; - EXPECT_EQ(last_msg_->obs[4].sid.code, 0) << "incorrect value for obs[4].sid.code, expected 0, is " << last_msg_->obs[4].sid.code; - EXPECT_EQ(last_msg_->obs[4].sid.reserved, 0) << "incorrect value for obs[4].sid.reserved, expected 0, is " << last_msg_->obs[4].sid.reserved; - EXPECT_EQ(last_msg_->obs[4].sid.sat, 12) << "incorrect value for obs[4].sid.sat, expected 12, is " << last_msg_->obs[4].sid.sat; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_MsgObsDepC4, Test) { + uint8_t encoded_frame[] = { + 85, 73, 0, 70, 152, 87, 208, 95, 183, 24, 106, 7, 32, 44, 8, 74, + 80, 86, 93, 247, 255, 57, 158, 229, 229, 4, 0, 0, 0, 224, 229, 96, + 70, 156, 146, 250, 255, 221, 200, 20, 28, 6, 0, 0, 0, 60, 82, 62, + 77, 93, 58, 242, 255, 39, 164, 180, 178, 7, 0, 0, 0, 222, 73, 190, + 77, 46, 39, 13, 0, 202, 181, 233, 164, 10, 0, 0, 0, 149, 64, 9, + 75, 114, 191, 21, 0, 249, 182, 196, 209, 12, 0, 0, 0, 112, 8, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_c_t *test_msg = (msg_obs_dep_c_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 32; + test_msg->header.t.tow = 414670800; + test_msg->header.t.wn = 1898; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 57; + test_msg->obs[0].L.i = -565930; + test_msg->obs[0].P = 1347029036; + test_msg->obs[0].cn0 = 158; + test_msg->obs[0].lock = 58853; + test_msg->obs[0].sid.code = 0; + test_msg->obs[0].sid.reserved = 0; + test_msg->obs[0].sid.sat = 4; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].L.f = 221; + test_msg->obs[1].L.i = -355684; + test_msg->obs[1].P = 1180755424; + test_msg->obs[1].cn0 = 200; + test_msg->obs[1].lock = 7188; + test_msg->obs[1].sid.code = 0; + test_msg->obs[1].sid.reserved = 0; + test_msg->obs[1].sid.sat = 6; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].L.f = 39; + test_msg->obs[2].L.i = -902563; + test_msg->obs[2].P = 1295929916; + test_msg->obs[2].cn0 = 164; + test_msg->obs[2].lock = 45748; + test_msg->obs[2].sid.code = 0; + test_msg->obs[2].sid.reserved = 0; + test_msg->obs[2].sid.sat = 7; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[3].L.f = 202; + test_msg->obs[3].L.i = 861998; + test_msg->obs[3].P = 1304316382; + test_msg->obs[3].cn0 = 181; + test_msg->obs[3].lock = 42217; + test_msg->obs[3].sid.code = 0; + test_msg->obs[3].sid.reserved = 0; + test_msg->obs[3].sid.sat = 10; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[4].L.f = 249; + test_msg->obs[4].L.i = 1425266; + test_msg->obs[4].P = 1258897557; + test_msg->obs[4].cn0 = 182; + test_msg->obs[4].lock = 53700; + test_msg->obs[4].sid.code = 0; + test_msg->obs[4].sid.reserved = 0; + test_msg->obs[4].sid.sat = 12; + + EXPECT_EQ(send_message(0x49, 38982, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 38982); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 32) + << "incorrect value for header.n_obs, expected 32, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 414670800) + << "incorrect value for header.t.tow, expected 414670800, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1898) + << "incorrect value for header.t.wn, expected 1898, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 57) + << "incorrect value for obs[0].L.f, expected 57, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, -565930) + << "incorrect value for obs[0].L.i, expected -565930, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 1347029036) + << "incorrect value for obs[0].P, expected 1347029036, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 158) + << "incorrect value for obs[0].cn0, expected 158, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 58853) + << "incorrect value for obs[0].lock, expected 58853, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].sid.code, 0) + << "incorrect value for obs[0].sid.code, expected 0, is " + << last_msg_->obs[0].sid.code; + EXPECT_EQ(last_msg_->obs[0].sid.reserved, 0) + << "incorrect value for obs[0].sid.reserved, expected 0, is " + << last_msg_->obs[0].sid.reserved; + EXPECT_EQ(last_msg_->obs[0].sid.sat, 4) + << "incorrect value for obs[0].sid.sat, expected 4, is " + << last_msg_->obs[0].sid.sat; + EXPECT_EQ(last_msg_->obs[1].L.f, 221) + << "incorrect value for obs[1].L.f, expected 221, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, -355684) + << "incorrect value for obs[1].L.i, expected -355684, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 1180755424) + << "incorrect value for obs[1].P, expected 1180755424, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].cn0, 200) + << "incorrect value for obs[1].cn0, expected 200, is " + << last_msg_->obs[1].cn0; + EXPECT_EQ(last_msg_->obs[1].lock, 7188) + << "incorrect value for obs[1].lock, expected 7188, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].sid.code, 0) + << "incorrect value for obs[1].sid.code, expected 0, is " + << last_msg_->obs[1].sid.code; + EXPECT_EQ(last_msg_->obs[1].sid.reserved, 0) + << "incorrect value for obs[1].sid.reserved, expected 0, is " + << last_msg_->obs[1].sid.reserved; + EXPECT_EQ(last_msg_->obs[1].sid.sat, 6) + << "incorrect value for obs[1].sid.sat, expected 6, is " + << last_msg_->obs[1].sid.sat; + EXPECT_EQ(last_msg_->obs[2].L.f, 39) + << "incorrect value for obs[2].L.f, expected 39, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, -902563) + << "incorrect value for obs[2].L.i, expected -902563, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 1295929916) + << "incorrect value for obs[2].P, expected 1295929916, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].cn0, 164) + << "incorrect value for obs[2].cn0, expected 164, is " + << last_msg_->obs[2].cn0; + EXPECT_EQ(last_msg_->obs[2].lock, 45748) + << "incorrect value for obs[2].lock, expected 45748, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].sid.code, 0) + << "incorrect value for obs[2].sid.code, expected 0, is " + << last_msg_->obs[2].sid.code; + EXPECT_EQ(last_msg_->obs[2].sid.reserved, 0) + << "incorrect value for obs[2].sid.reserved, expected 0, is " + << last_msg_->obs[2].sid.reserved; + EXPECT_EQ(last_msg_->obs[2].sid.sat, 7) + << "incorrect value for obs[2].sid.sat, expected 7, is " + << last_msg_->obs[2].sid.sat; + EXPECT_EQ(last_msg_->obs[3].L.f, 202) + << "incorrect value for obs[3].L.f, expected 202, is " + << last_msg_->obs[3].L.f; + EXPECT_EQ(last_msg_->obs[3].L.i, 861998) + << "incorrect value for obs[3].L.i, expected 861998, is " + << last_msg_->obs[3].L.i; + EXPECT_EQ(last_msg_->obs[3].P, 1304316382) + << "incorrect value for obs[3].P, expected 1304316382, is " + << last_msg_->obs[3].P; + EXPECT_EQ(last_msg_->obs[3].cn0, 181) + << "incorrect value for obs[3].cn0, expected 181, is " + << last_msg_->obs[3].cn0; + EXPECT_EQ(last_msg_->obs[3].lock, 42217) + << "incorrect value for obs[3].lock, expected 42217, is " + << last_msg_->obs[3].lock; + EXPECT_EQ(last_msg_->obs[3].sid.code, 0) + << "incorrect value for obs[3].sid.code, expected 0, is " + << last_msg_->obs[3].sid.code; + EXPECT_EQ(last_msg_->obs[3].sid.reserved, 0) + << "incorrect value for obs[3].sid.reserved, expected 0, is " + << last_msg_->obs[3].sid.reserved; + EXPECT_EQ(last_msg_->obs[3].sid.sat, 10) + << "incorrect value for obs[3].sid.sat, expected 10, is " + << last_msg_->obs[3].sid.sat; + EXPECT_EQ(last_msg_->obs[4].L.f, 249) + << "incorrect value for obs[4].L.f, expected 249, is " + << last_msg_->obs[4].L.f; + EXPECT_EQ(last_msg_->obs[4].L.i, 1425266) + << "incorrect value for obs[4].L.i, expected 1425266, is " + << last_msg_->obs[4].L.i; + EXPECT_EQ(last_msg_->obs[4].P, 1258897557) + << "incorrect value for obs[4].P, expected 1258897557, is " + << last_msg_->obs[4].P; + EXPECT_EQ(last_msg_->obs[4].cn0, 182) + << "incorrect value for obs[4].cn0, expected 182, is " + << last_msg_->obs[4].cn0; + EXPECT_EQ(last_msg_->obs[4].lock, 53700) + << "incorrect value for obs[4].lock, expected 53700, is " + << last_msg_->obs[4].lock; + EXPECT_EQ(last_msg_->obs[4].sid.code, 0) + << "incorrect value for obs[4].sid.code, expected 0, is " + << last_msg_->obs[4].sid.code; + EXPECT_EQ(last_msg_->obs[4].sid.reserved, 0) + << "incorrect value for obs[4].sid.reserved, expected 0, is " + << last_msg_->obs[4].sid.reserved; + EXPECT_EQ(last_msg_->obs[4].sid.sat, 12) + << "incorrect value for obs[4].sid.sat, expected 12, is " + << last_msg_->obs[4].sid.sat; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgOsr.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgOsr.cc index f5b0014cf..8235d9b7e 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgOsr.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgOsr.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgOsr.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgOsr.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgOsr0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgOsr0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgOsr0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgOsr0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_osr_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_osr_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,329 +81,593 @@ class Test_legacy_auto_check_sbp_observation_MsgOsr0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_osr_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgOsr0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_MsgOsr0, Test) { + uint8_t encoded_frame[] = { + 85, 64, 6, 0, 0, 239, 248, 225, 233, 29, 0, 0, 0, 0, 104, + 8, 64, 75, 143, 241, 68, 230, 250, 62, 7, 66, 15, 3, 1, 0, + 13, 0, 7, 0, 7, 0, 206, 232, 105, 63, 236, 49, 170, 6, 75, + 15, 3, 13, 0, 13, 0, 3, 0, 3, 0, 45, 145, 198, 62, 33, + 7, 153, 6, 128, 15, 3, 14, 0, 13, 0, 3, 0, 3, 0, 89, + 132, 204, 67, 143, 46, 32, 7, 127, 15, 3, 15, 0, 13, 0, 5, + 0, 5, 0, 244, 254, 164, 60, 22, 176, 95, 6, 55, 15, 3, 17, + 0, 0, 0, 2, 0, 2, 0, 106, 157, 101, 62, 151, 214, 142, 6, + 108, 15, 3, 19, 0, 13, 0, 3, 0, 3, 0, 81, 237, 60, 63, + 181, 119, 165, 6, 206, 15, 3, 28, 0, 13, 0, 3, 0, 3, 0, + 134, 228, 110, 64, 183, 159, 197, 6, 200, 15, 3, 30, 0, 13, 0, + 3, 0, 3, 0, 53, 144, 241, 68, 78, 112, 165, 5, 170, 15, 3, + 1, 6, 21, 0, 7, 0, 7, 0, 251, 232, 105, 63, 163, 128, 49, + 5, 129, 15, 3, 13, 6, 21, 0, 3, 0, 3, 0, 112, 145, 198, + 62, 37, 32, 36, 5, 46, 15, 3, 14, 6, 21, 0, 3, 0, 3, + 0, 166, 132, 204, 67, 184, 112, 141, 5, 95, 15, 3, 15, 6, 21, + 0, 5, 0, 5, 0, 121, 227, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_osr_t *test_msg = (msg_osr_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 64; + test_msg->header.t.ns_residual = 0; + test_msg->header.t.tow = 501867000; + test_msg->header.t.wn = 2152; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 66; + test_msg->obs[0].L.i = 121567974; + test_msg->obs[0].P = 1156681547; + test_msg->obs[0].flags = 3; + test_msg->obs[0].iono_std = 13; + test_msg->obs[0].lock = 15; + test_msg->obs[0].range_std = 7; + test_msg->obs[0].sid.code = 0; + test_msg->obs[0].sid.sat = 1; + test_msg->obs[0].tropo_std = 7; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].L.f = 75; + test_msg->obs[1].L.i = 111817196; + test_msg->obs[1].P = 1063905486; + test_msg->obs[1].flags = 3; + test_msg->obs[1].iono_std = 13; + test_msg->obs[1].lock = 15; + test_msg->obs[1].range_std = 3; + test_msg->obs[1].sid.code = 0; + test_msg->obs[1].sid.sat = 13; + test_msg->obs[1].tropo_std = 3; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].L.f = 128; + test_msg->obs[2].L.i = 110692129; + test_msg->obs[2].P = 1053200685; + test_msg->obs[2].flags = 3; + test_msg->obs[2].iono_std = 13; + test_msg->obs[2].lock = 15; + test_msg->obs[2].range_std = 3; + test_msg->obs[2].sid.code = 0; + test_msg->obs[2].sid.sat = 14; + test_msg->obs[2].tropo_std = 3; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[3].L.f = 127; + test_msg->obs[3].L.i = 119549583; + test_msg->obs[3].P = 1137476697; + test_msg->obs[3].flags = 3; + test_msg->obs[3].iono_std = 13; + test_msg->obs[3].lock = 15; + test_msg->obs[3].range_std = 5; + test_msg->obs[3].sid.code = 0; + test_msg->obs[3].sid.sat = 15; + test_msg->obs[3].tropo_std = 5; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[4].L.f = 55; + test_msg->obs[4].L.i = 106934294; + test_msg->obs[4].P = 1017446132; + test_msg->obs[4].flags = 3; + test_msg->obs[4].iono_std = 0; + test_msg->obs[4].lock = 15; + test_msg->obs[4].range_std = 2; + test_msg->obs[4].sid.code = 0; + test_msg->obs[4].sid.sat = 17; + test_msg->obs[4].tropo_std = 2; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[5].L.f = 108; + test_msg->obs[5].L.i = 110024343; + test_msg->obs[5].P = 1046846826; + test_msg->obs[5].flags = 3; + test_msg->obs[5].iono_std = 13; + test_msg->obs[5].lock = 15; + test_msg->obs[5].range_std = 3; + test_msg->obs[5].sid.code = 0; + test_msg->obs[5].sid.sat = 19; + test_msg->obs[5].tropo_std = 3; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[6].L.f = 206; + test_msg->obs[6].L.i = 111507381; + test_msg->obs[6].P = 1060957521; + test_msg->obs[6].flags = 3; + test_msg->obs[6].iono_std = 13; + test_msg->obs[6].lock = 15; + test_msg->obs[6].range_std = 3; + test_msg->obs[6].sid.code = 0; + test_msg->obs[6].sid.sat = 28; + test_msg->obs[6].tropo_std = 3; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[7].L.f = 200; + test_msg->obs[7].L.i = 113614775; + test_msg->obs[7].P = 1081009286; + test_msg->obs[7].flags = 3; + test_msg->obs[7].iono_std = 13; + test_msg->obs[7].lock = 15; + test_msg->obs[7].range_std = 3; + test_msg->obs[7].sid.code = 0; + test_msg->obs[7].sid.sat = 30; + test_msg->obs[7].tropo_std = 3; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[8].L.f = 170; + test_msg->obs[8].L.i = 94728270; + test_msg->obs[8].P = 1156681781; + test_msg->obs[8].flags = 3; + test_msg->obs[8].iono_std = 21; + test_msg->obs[8].lock = 15; + test_msg->obs[8].range_std = 7; + test_msg->obs[8].sid.code = 6; + test_msg->obs[8].sid.sat = 1; + test_msg->obs[8].tropo_std = 7; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[9].L.f = 129; + test_msg->obs[9].L.i = 87130275; + test_msg->obs[9].P = 1063905531; + test_msg->obs[9].flags = 3; + test_msg->obs[9].iono_std = 21; + test_msg->obs[9].lock = 15; + test_msg->obs[9].range_std = 3; + test_msg->obs[9].sid.code = 6; + test_msg->obs[9].sid.sat = 13; + test_msg->obs[9].tropo_std = 3; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[10].L.f = 46; + test_msg->obs[10].L.i = 86253605; + test_msg->obs[10].P = 1053200752; + test_msg->obs[10].flags = 3; + test_msg->obs[10].iono_std = 21; + test_msg->obs[10].lock = 15; + test_msg->obs[10].range_std = 3; + test_msg->obs[10].sid.code = 6; + test_msg->obs[10].sid.sat = 14; + test_msg->obs[10].tropo_std = 3; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[11].L.f = 95; + test_msg->obs[11].L.i = 93155512; + test_msg->obs[11].P = 1137476774; + test_msg->obs[11].flags = 3; + test_msg->obs[11].iono_std = 21; + test_msg->obs[11].lock = 15; + test_msg->obs[11].range_std = 5; + test_msg->obs[11].sid.code = 6; + test_msg->obs[11].sid.sat = 15; + test_msg->obs[11].tropo_std = 5; - uint8_t encoded_frame[] = {85,64,6,0,0,239,248,225,233,29,0,0,0,0,104,8,64,75,143,241,68,230,250,62,7,66,15,3,1,0,13,0,7,0,7,0,206,232,105,63,236,49,170,6,75,15,3,13,0,13,0,3,0,3,0,45,145,198,62,33,7,153,6,128,15,3,14,0,13,0,3,0,3,0,89,132,204,67,143,46,32,7,127,15,3,15,0,13,0,5,0,5,0,244,254,164,60,22,176,95,6,55,15,3,17,0,0,0,2,0,2,0,106,157,101,62,151,214,142,6,108,15,3,19,0,13,0,3,0,3,0,81,237,60,63,181,119,165,6,206,15,3,28,0,13,0,3,0,3,0,134,228,110,64,183,159,197,6,200,15,3,30,0,13,0,3,0,3,0,53,144,241,68,78,112,165,5,170,15,3,1,6,21,0,7,0,7,0,251,232,105,63,163,128,49,5,129,15,3,13,6,21,0,3,0,3,0,112,145,198,62,37,32,36,5,46,15,3,14,6,21,0,3,0,3,0,166,132,204,67,184,112,141,5,95,15,3,15,6,21,0,5,0,5,0,121,227, }; + EXPECT_EQ(send_message(0x640, 0, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_osr_t* test_msg = ( msg_osr_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 64; - test_msg->header.t.ns_residual = 0; - test_msg->header.t.tow = 501867000; - test_msg->header.t.wn = 2152; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 66; - test_msg->obs[0].L.i = 121567974; - test_msg->obs[0].P = 1156681547; - test_msg->obs[0].flags = 3; - test_msg->obs[0].iono_std = 13; - test_msg->obs[0].lock = 15; - test_msg->obs[0].range_std = 7; - test_msg->obs[0].sid.code = 0; - test_msg->obs[0].sid.sat = 1; - test_msg->obs[0].tropo_std = 7; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].L.f = 75; - test_msg->obs[1].L.i = 111817196; - test_msg->obs[1].P = 1063905486; - test_msg->obs[1].flags = 3; - test_msg->obs[1].iono_std = 13; - test_msg->obs[1].lock = 15; - test_msg->obs[1].range_std = 3; - test_msg->obs[1].sid.code = 0; - test_msg->obs[1].sid.sat = 13; - test_msg->obs[1].tropo_std = 3; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].L.f = 128; - test_msg->obs[2].L.i = 110692129; - test_msg->obs[2].P = 1053200685; - test_msg->obs[2].flags = 3; - test_msg->obs[2].iono_std = 13; - test_msg->obs[2].lock = 15; - test_msg->obs[2].range_std = 3; - test_msg->obs[2].sid.code = 0; - test_msg->obs[2].sid.sat = 14; - test_msg->obs[2].tropo_std = 3; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[3].L.f = 127; - test_msg->obs[3].L.i = 119549583; - test_msg->obs[3].P = 1137476697; - test_msg->obs[3].flags = 3; - test_msg->obs[3].iono_std = 13; - test_msg->obs[3].lock = 15; - test_msg->obs[3].range_std = 5; - test_msg->obs[3].sid.code = 0; - test_msg->obs[3].sid.sat = 15; - test_msg->obs[3].tropo_std = 5; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[4].L.f = 55; - test_msg->obs[4].L.i = 106934294; - test_msg->obs[4].P = 1017446132; - test_msg->obs[4].flags = 3; - test_msg->obs[4].iono_std = 0; - test_msg->obs[4].lock = 15; - test_msg->obs[4].range_std = 2; - test_msg->obs[4].sid.code = 0; - test_msg->obs[4].sid.sat = 17; - test_msg->obs[4].tropo_std = 2; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[5].L.f = 108; - test_msg->obs[5].L.i = 110024343; - test_msg->obs[5].P = 1046846826; - test_msg->obs[5].flags = 3; - test_msg->obs[5].iono_std = 13; - test_msg->obs[5].lock = 15; - test_msg->obs[5].range_std = 3; - test_msg->obs[5].sid.code = 0; - test_msg->obs[5].sid.sat = 19; - test_msg->obs[5].tropo_std = 3; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[6].L.f = 206; - test_msg->obs[6].L.i = 111507381; - test_msg->obs[6].P = 1060957521; - test_msg->obs[6].flags = 3; - test_msg->obs[6].iono_std = 13; - test_msg->obs[6].lock = 15; - test_msg->obs[6].range_std = 3; - test_msg->obs[6].sid.code = 0; - test_msg->obs[6].sid.sat = 28; - test_msg->obs[6].tropo_std = 3; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[7].L.f = 200; - test_msg->obs[7].L.i = 113614775; - test_msg->obs[7].P = 1081009286; - test_msg->obs[7].flags = 3; - test_msg->obs[7].iono_std = 13; - test_msg->obs[7].lock = 15; - test_msg->obs[7].range_std = 3; - test_msg->obs[7].sid.code = 0; - test_msg->obs[7].sid.sat = 30; - test_msg->obs[7].tropo_std = 3; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[8].L.f = 170; - test_msg->obs[8].L.i = 94728270; - test_msg->obs[8].P = 1156681781; - test_msg->obs[8].flags = 3; - test_msg->obs[8].iono_std = 21; - test_msg->obs[8].lock = 15; - test_msg->obs[8].range_std = 7; - test_msg->obs[8].sid.code = 6; - test_msg->obs[8].sid.sat = 1; - test_msg->obs[8].tropo_std = 7; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[9].L.f = 129; - test_msg->obs[9].L.i = 87130275; - test_msg->obs[9].P = 1063905531; - test_msg->obs[9].flags = 3; - test_msg->obs[9].iono_std = 21; - test_msg->obs[9].lock = 15; - test_msg->obs[9].range_std = 3; - test_msg->obs[9].sid.code = 6; - test_msg->obs[9].sid.sat = 13; - test_msg->obs[9].tropo_std = 3; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[10].L.f = 46; - test_msg->obs[10].L.i = 86253605; - test_msg->obs[10].P = 1053200752; - test_msg->obs[10].flags = 3; - test_msg->obs[10].iono_std = 21; - test_msg->obs[10].lock = 15; - test_msg->obs[10].range_std = 3; - test_msg->obs[10].sid.code = 6; - test_msg->obs[10].sid.sat = 14; - test_msg->obs[10].tropo_std = 3; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[11].L.f = 95; - test_msg->obs[11].L.i = 93155512; - test_msg->obs[11].P = 1137476774; - test_msg->obs[11].flags = 3; - test_msg->obs[11].iono_std = 21; - test_msg->obs[11].lock = 15; - test_msg->obs[11].range_std = 5; - test_msg->obs[11].sid.code = 6; - test_msg->obs[11].sid.sat = 15; - test_msg->obs[11].tropo_std = 5; - - EXPECT_EQ(send_message( 0x640, 0, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 64) << "incorrect value for header.n_obs, expected 64, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.ns_residual, 0) << "incorrect value for header.t.ns_residual, expected 0, is " << last_msg_->header.t.ns_residual; - EXPECT_EQ(last_msg_->header.t.tow, 501867000) << "incorrect value for header.t.tow, expected 501867000, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 2152) << "incorrect value for header.t.wn, expected 2152, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 66) << "incorrect value for obs[0].L.f, expected 66, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, 121567974) << "incorrect value for obs[0].L.i, expected 121567974, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 1156681547) << "incorrect value for obs[0].P, expected 1156681547, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].flags, 3) << "incorrect value for obs[0].flags, expected 3, is " << last_msg_->obs[0].flags; - EXPECT_EQ(last_msg_->obs[0].iono_std, 13) << "incorrect value for obs[0].iono_std, expected 13, is " << last_msg_->obs[0].iono_std; - EXPECT_EQ(last_msg_->obs[0].lock, 15) << "incorrect value for obs[0].lock, expected 15, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].range_std, 7) << "incorrect value for obs[0].range_std, expected 7, is " << last_msg_->obs[0].range_std; - EXPECT_EQ(last_msg_->obs[0].sid.code, 0) << "incorrect value for obs[0].sid.code, expected 0, is " << last_msg_->obs[0].sid.code; - EXPECT_EQ(last_msg_->obs[0].sid.sat, 1) << "incorrect value for obs[0].sid.sat, expected 1, is " << last_msg_->obs[0].sid.sat; - EXPECT_EQ(last_msg_->obs[0].tropo_std, 7) << "incorrect value for obs[0].tropo_std, expected 7, is " << last_msg_->obs[0].tropo_std; - EXPECT_EQ(last_msg_->obs[1].L.f, 75) << "incorrect value for obs[1].L.f, expected 75, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, 111817196) << "incorrect value for obs[1].L.i, expected 111817196, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 1063905486) << "incorrect value for obs[1].P, expected 1063905486, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].flags, 3) << "incorrect value for obs[1].flags, expected 3, is " << last_msg_->obs[1].flags; - EXPECT_EQ(last_msg_->obs[1].iono_std, 13) << "incorrect value for obs[1].iono_std, expected 13, is " << last_msg_->obs[1].iono_std; - EXPECT_EQ(last_msg_->obs[1].lock, 15) << "incorrect value for obs[1].lock, expected 15, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].range_std, 3) << "incorrect value for obs[1].range_std, expected 3, is " << last_msg_->obs[1].range_std; - EXPECT_EQ(last_msg_->obs[1].sid.code, 0) << "incorrect value for obs[1].sid.code, expected 0, is " << last_msg_->obs[1].sid.code; - EXPECT_EQ(last_msg_->obs[1].sid.sat, 13) << "incorrect value for obs[1].sid.sat, expected 13, is " << last_msg_->obs[1].sid.sat; - EXPECT_EQ(last_msg_->obs[1].tropo_std, 3) << "incorrect value for obs[1].tropo_std, expected 3, is " << last_msg_->obs[1].tropo_std; - EXPECT_EQ(last_msg_->obs[2].L.f, 128) << "incorrect value for obs[2].L.f, expected 128, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, 110692129) << "incorrect value for obs[2].L.i, expected 110692129, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 1053200685) << "incorrect value for obs[2].P, expected 1053200685, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].flags, 3) << "incorrect value for obs[2].flags, expected 3, is " << last_msg_->obs[2].flags; - EXPECT_EQ(last_msg_->obs[2].iono_std, 13) << "incorrect value for obs[2].iono_std, expected 13, is " << last_msg_->obs[2].iono_std; - EXPECT_EQ(last_msg_->obs[2].lock, 15) << "incorrect value for obs[2].lock, expected 15, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].range_std, 3) << "incorrect value for obs[2].range_std, expected 3, is " << last_msg_->obs[2].range_std; - EXPECT_EQ(last_msg_->obs[2].sid.code, 0) << "incorrect value for obs[2].sid.code, expected 0, is " << last_msg_->obs[2].sid.code; - EXPECT_EQ(last_msg_->obs[2].sid.sat, 14) << "incorrect value for obs[2].sid.sat, expected 14, is " << last_msg_->obs[2].sid.sat; - EXPECT_EQ(last_msg_->obs[2].tropo_std, 3) << "incorrect value for obs[2].tropo_std, expected 3, is " << last_msg_->obs[2].tropo_std; - EXPECT_EQ(last_msg_->obs[3].L.f, 127) << "incorrect value for obs[3].L.f, expected 127, is " << last_msg_->obs[3].L.f; - EXPECT_EQ(last_msg_->obs[3].L.i, 119549583) << "incorrect value for obs[3].L.i, expected 119549583, is " << last_msg_->obs[3].L.i; - EXPECT_EQ(last_msg_->obs[3].P, 1137476697) << "incorrect value for obs[3].P, expected 1137476697, is " << last_msg_->obs[3].P; - EXPECT_EQ(last_msg_->obs[3].flags, 3) << "incorrect value for obs[3].flags, expected 3, is " << last_msg_->obs[3].flags; - EXPECT_EQ(last_msg_->obs[3].iono_std, 13) << "incorrect value for obs[3].iono_std, expected 13, is " << last_msg_->obs[3].iono_std; - EXPECT_EQ(last_msg_->obs[3].lock, 15) << "incorrect value for obs[3].lock, expected 15, is " << last_msg_->obs[3].lock; - EXPECT_EQ(last_msg_->obs[3].range_std, 5) << "incorrect value for obs[3].range_std, expected 5, is " << last_msg_->obs[3].range_std; - EXPECT_EQ(last_msg_->obs[3].sid.code, 0) << "incorrect value for obs[3].sid.code, expected 0, is " << last_msg_->obs[3].sid.code; - EXPECT_EQ(last_msg_->obs[3].sid.sat, 15) << "incorrect value for obs[3].sid.sat, expected 15, is " << last_msg_->obs[3].sid.sat; - EXPECT_EQ(last_msg_->obs[3].tropo_std, 5) << "incorrect value for obs[3].tropo_std, expected 5, is " << last_msg_->obs[3].tropo_std; - EXPECT_EQ(last_msg_->obs[4].L.f, 55) << "incorrect value for obs[4].L.f, expected 55, is " << last_msg_->obs[4].L.f; - EXPECT_EQ(last_msg_->obs[4].L.i, 106934294) << "incorrect value for obs[4].L.i, expected 106934294, is " << last_msg_->obs[4].L.i; - EXPECT_EQ(last_msg_->obs[4].P, 1017446132) << "incorrect value for obs[4].P, expected 1017446132, is " << last_msg_->obs[4].P; - EXPECT_EQ(last_msg_->obs[4].flags, 3) << "incorrect value for obs[4].flags, expected 3, is " << last_msg_->obs[4].flags; - EXPECT_EQ(last_msg_->obs[4].iono_std, 0) << "incorrect value for obs[4].iono_std, expected 0, is " << last_msg_->obs[4].iono_std; - EXPECT_EQ(last_msg_->obs[4].lock, 15) << "incorrect value for obs[4].lock, expected 15, is " << last_msg_->obs[4].lock; - EXPECT_EQ(last_msg_->obs[4].range_std, 2) << "incorrect value for obs[4].range_std, expected 2, is " << last_msg_->obs[4].range_std; - EXPECT_EQ(last_msg_->obs[4].sid.code, 0) << "incorrect value for obs[4].sid.code, expected 0, is " << last_msg_->obs[4].sid.code; - EXPECT_EQ(last_msg_->obs[4].sid.sat, 17) << "incorrect value for obs[4].sid.sat, expected 17, is " << last_msg_->obs[4].sid.sat; - EXPECT_EQ(last_msg_->obs[4].tropo_std, 2) << "incorrect value for obs[4].tropo_std, expected 2, is " << last_msg_->obs[4].tropo_std; - EXPECT_EQ(last_msg_->obs[5].L.f, 108) << "incorrect value for obs[5].L.f, expected 108, is " << last_msg_->obs[5].L.f; - EXPECT_EQ(last_msg_->obs[5].L.i, 110024343) << "incorrect value for obs[5].L.i, expected 110024343, is " << last_msg_->obs[5].L.i; - EXPECT_EQ(last_msg_->obs[5].P, 1046846826) << "incorrect value for obs[5].P, expected 1046846826, is " << last_msg_->obs[5].P; - EXPECT_EQ(last_msg_->obs[5].flags, 3) << "incorrect value for obs[5].flags, expected 3, is " << last_msg_->obs[5].flags; - EXPECT_EQ(last_msg_->obs[5].iono_std, 13) << "incorrect value for obs[5].iono_std, expected 13, is " << last_msg_->obs[5].iono_std; - EXPECT_EQ(last_msg_->obs[5].lock, 15) << "incorrect value for obs[5].lock, expected 15, is " << last_msg_->obs[5].lock; - EXPECT_EQ(last_msg_->obs[5].range_std, 3) << "incorrect value for obs[5].range_std, expected 3, is " << last_msg_->obs[5].range_std; - EXPECT_EQ(last_msg_->obs[5].sid.code, 0) << "incorrect value for obs[5].sid.code, expected 0, is " << last_msg_->obs[5].sid.code; - EXPECT_EQ(last_msg_->obs[5].sid.sat, 19) << "incorrect value for obs[5].sid.sat, expected 19, is " << last_msg_->obs[5].sid.sat; - EXPECT_EQ(last_msg_->obs[5].tropo_std, 3) << "incorrect value for obs[5].tropo_std, expected 3, is " << last_msg_->obs[5].tropo_std; - EXPECT_EQ(last_msg_->obs[6].L.f, 206) << "incorrect value for obs[6].L.f, expected 206, is " << last_msg_->obs[6].L.f; - EXPECT_EQ(last_msg_->obs[6].L.i, 111507381) << "incorrect value for obs[6].L.i, expected 111507381, is " << last_msg_->obs[6].L.i; - EXPECT_EQ(last_msg_->obs[6].P, 1060957521) << "incorrect value for obs[6].P, expected 1060957521, is " << last_msg_->obs[6].P; - EXPECT_EQ(last_msg_->obs[6].flags, 3) << "incorrect value for obs[6].flags, expected 3, is " << last_msg_->obs[6].flags; - EXPECT_EQ(last_msg_->obs[6].iono_std, 13) << "incorrect value for obs[6].iono_std, expected 13, is " << last_msg_->obs[6].iono_std; - EXPECT_EQ(last_msg_->obs[6].lock, 15) << "incorrect value for obs[6].lock, expected 15, is " << last_msg_->obs[6].lock; - EXPECT_EQ(last_msg_->obs[6].range_std, 3) << "incorrect value for obs[6].range_std, expected 3, is " << last_msg_->obs[6].range_std; - EXPECT_EQ(last_msg_->obs[6].sid.code, 0) << "incorrect value for obs[6].sid.code, expected 0, is " << last_msg_->obs[6].sid.code; - EXPECT_EQ(last_msg_->obs[6].sid.sat, 28) << "incorrect value for obs[6].sid.sat, expected 28, is " << last_msg_->obs[6].sid.sat; - EXPECT_EQ(last_msg_->obs[6].tropo_std, 3) << "incorrect value for obs[6].tropo_std, expected 3, is " << last_msg_->obs[6].tropo_std; - EXPECT_EQ(last_msg_->obs[7].L.f, 200) << "incorrect value for obs[7].L.f, expected 200, is " << last_msg_->obs[7].L.f; - EXPECT_EQ(last_msg_->obs[7].L.i, 113614775) << "incorrect value for obs[7].L.i, expected 113614775, is " << last_msg_->obs[7].L.i; - EXPECT_EQ(last_msg_->obs[7].P, 1081009286) << "incorrect value for obs[7].P, expected 1081009286, is " << last_msg_->obs[7].P; - EXPECT_EQ(last_msg_->obs[7].flags, 3) << "incorrect value for obs[7].flags, expected 3, is " << last_msg_->obs[7].flags; - EXPECT_EQ(last_msg_->obs[7].iono_std, 13) << "incorrect value for obs[7].iono_std, expected 13, is " << last_msg_->obs[7].iono_std; - EXPECT_EQ(last_msg_->obs[7].lock, 15) << "incorrect value for obs[7].lock, expected 15, is " << last_msg_->obs[7].lock; - EXPECT_EQ(last_msg_->obs[7].range_std, 3) << "incorrect value for obs[7].range_std, expected 3, is " << last_msg_->obs[7].range_std; - EXPECT_EQ(last_msg_->obs[7].sid.code, 0) << "incorrect value for obs[7].sid.code, expected 0, is " << last_msg_->obs[7].sid.code; - EXPECT_EQ(last_msg_->obs[7].sid.sat, 30) << "incorrect value for obs[7].sid.sat, expected 30, is " << last_msg_->obs[7].sid.sat; - EXPECT_EQ(last_msg_->obs[7].tropo_std, 3) << "incorrect value for obs[7].tropo_std, expected 3, is " << last_msg_->obs[7].tropo_std; - EXPECT_EQ(last_msg_->obs[8].L.f, 170) << "incorrect value for obs[8].L.f, expected 170, is " << last_msg_->obs[8].L.f; - EXPECT_EQ(last_msg_->obs[8].L.i, 94728270) << "incorrect value for obs[8].L.i, expected 94728270, is " << last_msg_->obs[8].L.i; - EXPECT_EQ(last_msg_->obs[8].P, 1156681781) << "incorrect value for obs[8].P, expected 1156681781, is " << last_msg_->obs[8].P; - EXPECT_EQ(last_msg_->obs[8].flags, 3) << "incorrect value for obs[8].flags, expected 3, is " << last_msg_->obs[8].flags; - EXPECT_EQ(last_msg_->obs[8].iono_std, 21) << "incorrect value for obs[8].iono_std, expected 21, is " << last_msg_->obs[8].iono_std; - EXPECT_EQ(last_msg_->obs[8].lock, 15) << "incorrect value for obs[8].lock, expected 15, is " << last_msg_->obs[8].lock; - EXPECT_EQ(last_msg_->obs[8].range_std, 7) << "incorrect value for obs[8].range_std, expected 7, is " << last_msg_->obs[8].range_std; - EXPECT_EQ(last_msg_->obs[8].sid.code, 6) << "incorrect value for obs[8].sid.code, expected 6, is " << last_msg_->obs[8].sid.code; - EXPECT_EQ(last_msg_->obs[8].sid.sat, 1) << "incorrect value for obs[8].sid.sat, expected 1, is " << last_msg_->obs[8].sid.sat; - EXPECT_EQ(last_msg_->obs[8].tropo_std, 7) << "incorrect value for obs[8].tropo_std, expected 7, is " << last_msg_->obs[8].tropo_std; - EXPECT_EQ(last_msg_->obs[9].L.f, 129) << "incorrect value for obs[9].L.f, expected 129, is " << last_msg_->obs[9].L.f; - EXPECT_EQ(last_msg_->obs[9].L.i, 87130275) << "incorrect value for obs[9].L.i, expected 87130275, is " << last_msg_->obs[9].L.i; - EXPECT_EQ(last_msg_->obs[9].P, 1063905531) << "incorrect value for obs[9].P, expected 1063905531, is " << last_msg_->obs[9].P; - EXPECT_EQ(last_msg_->obs[9].flags, 3) << "incorrect value for obs[9].flags, expected 3, is " << last_msg_->obs[9].flags; - EXPECT_EQ(last_msg_->obs[9].iono_std, 21) << "incorrect value for obs[9].iono_std, expected 21, is " << last_msg_->obs[9].iono_std; - EXPECT_EQ(last_msg_->obs[9].lock, 15) << "incorrect value for obs[9].lock, expected 15, is " << last_msg_->obs[9].lock; - EXPECT_EQ(last_msg_->obs[9].range_std, 3) << "incorrect value for obs[9].range_std, expected 3, is " << last_msg_->obs[9].range_std; - EXPECT_EQ(last_msg_->obs[9].sid.code, 6) << "incorrect value for obs[9].sid.code, expected 6, is " << last_msg_->obs[9].sid.code; - EXPECT_EQ(last_msg_->obs[9].sid.sat, 13) << "incorrect value for obs[9].sid.sat, expected 13, is " << last_msg_->obs[9].sid.sat; - EXPECT_EQ(last_msg_->obs[9].tropo_std, 3) << "incorrect value for obs[9].tropo_std, expected 3, is " << last_msg_->obs[9].tropo_std; - EXPECT_EQ(last_msg_->obs[10].L.f, 46) << "incorrect value for obs[10].L.f, expected 46, is " << last_msg_->obs[10].L.f; - EXPECT_EQ(last_msg_->obs[10].L.i, 86253605) << "incorrect value for obs[10].L.i, expected 86253605, is " << last_msg_->obs[10].L.i; - EXPECT_EQ(last_msg_->obs[10].P, 1053200752) << "incorrect value for obs[10].P, expected 1053200752, is " << last_msg_->obs[10].P; - EXPECT_EQ(last_msg_->obs[10].flags, 3) << "incorrect value for obs[10].flags, expected 3, is " << last_msg_->obs[10].flags; - EXPECT_EQ(last_msg_->obs[10].iono_std, 21) << "incorrect value for obs[10].iono_std, expected 21, is " << last_msg_->obs[10].iono_std; - EXPECT_EQ(last_msg_->obs[10].lock, 15) << "incorrect value for obs[10].lock, expected 15, is " << last_msg_->obs[10].lock; - EXPECT_EQ(last_msg_->obs[10].range_std, 3) << "incorrect value for obs[10].range_std, expected 3, is " << last_msg_->obs[10].range_std; - EXPECT_EQ(last_msg_->obs[10].sid.code, 6) << "incorrect value for obs[10].sid.code, expected 6, is " << last_msg_->obs[10].sid.code; - EXPECT_EQ(last_msg_->obs[10].sid.sat, 14) << "incorrect value for obs[10].sid.sat, expected 14, is " << last_msg_->obs[10].sid.sat; - EXPECT_EQ(last_msg_->obs[10].tropo_std, 3) << "incorrect value for obs[10].tropo_std, expected 3, is " << last_msg_->obs[10].tropo_std; - EXPECT_EQ(last_msg_->obs[11].L.f, 95) << "incorrect value for obs[11].L.f, expected 95, is " << last_msg_->obs[11].L.f; - EXPECT_EQ(last_msg_->obs[11].L.i, 93155512) << "incorrect value for obs[11].L.i, expected 93155512, is " << last_msg_->obs[11].L.i; - EXPECT_EQ(last_msg_->obs[11].P, 1137476774) << "incorrect value for obs[11].P, expected 1137476774, is " << last_msg_->obs[11].P; - EXPECT_EQ(last_msg_->obs[11].flags, 3) << "incorrect value for obs[11].flags, expected 3, is " << last_msg_->obs[11].flags; - EXPECT_EQ(last_msg_->obs[11].iono_std, 21) << "incorrect value for obs[11].iono_std, expected 21, is " << last_msg_->obs[11].iono_std; - EXPECT_EQ(last_msg_->obs[11].lock, 15) << "incorrect value for obs[11].lock, expected 15, is " << last_msg_->obs[11].lock; - EXPECT_EQ(last_msg_->obs[11].range_std, 5) << "incorrect value for obs[11].range_std, expected 5, is " << last_msg_->obs[11].range_std; - EXPECT_EQ(last_msg_->obs[11].sid.code, 6) << "incorrect value for obs[11].sid.code, expected 6, is " << last_msg_->obs[11].sid.code; - EXPECT_EQ(last_msg_->obs[11].sid.sat, 15) << "incorrect value for obs[11].sid.sat, expected 15, is " << last_msg_->obs[11].sid.sat; - EXPECT_EQ(last_msg_->obs[11].tropo_std, 5) << "incorrect value for obs[11].tropo_std, expected 5, is " << last_msg_->obs[11].tropo_std; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 64) + << "incorrect value for header.n_obs, expected 64, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.ns_residual, 0) + << "incorrect value for header.t.ns_residual, expected 0, is " + << last_msg_->header.t.ns_residual; + EXPECT_EQ(last_msg_->header.t.tow, 501867000) + << "incorrect value for header.t.tow, expected 501867000, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 2152) + << "incorrect value for header.t.wn, expected 2152, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 66) + << "incorrect value for obs[0].L.f, expected 66, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, 121567974) + << "incorrect value for obs[0].L.i, expected 121567974, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 1156681547) + << "incorrect value for obs[0].P, expected 1156681547, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].flags, 3) + << "incorrect value for obs[0].flags, expected 3, is " + << last_msg_->obs[0].flags; + EXPECT_EQ(last_msg_->obs[0].iono_std, 13) + << "incorrect value for obs[0].iono_std, expected 13, is " + << last_msg_->obs[0].iono_std; + EXPECT_EQ(last_msg_->obs[0].lock, 15) + << "incorrect value for obs[0].lock, expected 15, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].range_std, 7) + << "incorrect value for obs[0].range_std, expected 7, is " + << last_msg_->obs[0].range_std; + EXPECT_EQ(last_msg_->obs[0].sid.code, 0) + << "incorrect value for obs[0].sid.code, expected 0, is " + << last_msg_->obs[0].sid.code; + EXPECT_EQ(last_msg_->obs[0].sid.sat, 1) + << "incorrect value for obs[0].sid.sat, expected 1, is " + << last_msg_->obs[0].sid.sat; + EXPECT_EQ(last_msg_->obs[0].tropo_std, 7) + << "incorrect value for obs[0].tropo_std, expected 7, is " + << last_msg_->obs[0].tropo_std; + EXPECT_EQ(last_msg_->obs[1].L.f, 75) + << "incorrect value for obs[1].L.f, expected 75, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, 111817196) + << "incorrect value for obs[1].L.i, expected 111817196, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 1063905486) + << "incorrect value for obs[1].P, expected 1063905486, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].flags, 3) + << "incorrect value for obs[1].flags, expected 3, is " + << last_msg_->obs[1].flags; + EXPECT_EQ(last_msg_->obs[1].iono_std, 13) + << "incorrect value for obs[1].iono_std, expected 13, is " + << last_msg_->obs[1].iono_std; + EXPECT_EQ(last_msg_->obs[1].lock, 15) + << "incorrect value for obs[1].lock, expected 15, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].range_std, 3) + << "incorrect value for obs[1].range_std, expected 3, is " + << last_msg_->obs[1].range_std; + EXPECT_EQ(last_msg_->obs[1].sid.code, 0) + << "incorrect value for obs[1].sid.code, expected 0, is " + << last_msg_->obs[1].sid.code; + EXPECT_EQ(last_msg_->obs[1].sid.sat, 13) + << "incorrect value for obs[1].sid.sat, expected 13, is " + << last_msg_->obs[1].sid.sat; + EXPECT_EQ(last_msg_->obs[1].tropo_std, 3) + << "incorrect value for obs[1].tropo_std, expected 3, is " + << last_msg_->obs[1].tropo_std; + EXPECT_EQ(last_msg_->obs[2].L.f, 128) + << "incorrect value for obs[2].L.f, expected 128, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, 110692129) + << "incorrect value for obs[2].L.i, expected 110692129, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 1053200685) + << "incorrect value for obs[2].P, expected 1053200685, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].flags, 3) + << "incorrect value for obs[2].flags, expected 3, is " + << last_msg_->obs[2].flags; + EXPECT_EQ(last_msg_->obs[2].iono_std, 13) + << "incorrect value for obs[2].iono_std, expected 13, is " + << last_msg_->obs[2].iono_std; + EXPECT_EQ(last_msg_->obs[2].lock, 15) + << "incorrect value for obs[2].lock, expected 15, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].range_std, 3) + << "incorrect value for obs[2].range_std, expected 3, is " + << last_msg_->obs[2].range_std; + EXPECT_EQ(last_msg_->obs[2].sid.code, 0) + << "incorrect value for obs[2].sid.code, expected 0, is " + << last_msg_->obs[2].sid.code; + EXPECT_EQ(last_msg_->obs[2].sid.sat, 14) + << "incorrect value for obs[2].sid.sat, expected 14, is " + << last_msg_->obs[2].sid.sat; + EXPECT_EQ(last_msg_->obs[2].tropo_std, 3) + << "incorrect value for obs[2].tropo_std, expected 3, is " + << last_msg_->obs[2].tropo_std; + EXPECT_EQ(last_msg_->obs[3].L.f, 127) + << "incorrect value for obs[3].L.f, expected 127, is " + << last_msg_->obs[3].L.f; + EXPECT_EQ(last_msg_->obs[3].L.i, 119549583) + << "incorrect value for obs[3].L.i, expected 119549583, is " + << last_msg_->obs[3].L.i; + EXPECT_EQ(last_msg_->obs[3].P, 1137476697) + << "incorrect value for obs[3].P, expected 1137476697, is " + << last_msg_->obs[3].P; + EXPECT_EQ(last_msg_->obs[3].flags, 3) + << "incorrect value for obs[3].flags, expected 3, is " + << last_msg_->obs[3].flags; + EXPECT_EQ(last_msg_->obs[3].iono_std, 13) + << "incorrect value for obs[3].iono_std, expected 13, is " + << last_msg_->obs[3].iono_std; + EXPECT_EQ(last_msg_->obs[3].lock, 15) + << "incorrect value for obs[3].lock, expected 15, is " + << last_msg_->obs[3].lock; + EXPECT_EQ(last_msg_->obs[3].range_std, 5) + << "incorrect value for obs[3].range_std, expected 5, is " + << last_msg_->obs[3].range_std; + EXPECT_EQ(last_msg_->obs[3].sid.code, 0) + << "incorrect value for obs[3].sid.code, expected 0, is " + << last_msg_->obs[3].sid.code; + EXPECT_EQ(last_msg_->obs[3].sid.sat, 15) + << "incorrect value for obs[3].sid.sat, expected 15, is " + << last_msg_->obs[3].sid.sat; + EXPECT_EQ(last_msg_->obs[3].tropo_std, 5) + << "incorrect value for obs[3].tropo_std, expected 5, is " + << last_msg_->obs[3].tropo_std; + EXPECT_EQ(last_msg_->obs[4].L.f, 55) + << "incorrect value for obs[4].L.f, expected 55, is " + << last_msg_->obs[4].L.f; + EXPECT_EQ(last_msg_->obs[4].L.i, 106934294) + << "incorrect value for obs[4].L.i, expected 106934294, is " + << last_msg_->obs[4].L.i; + EXPECT_EQ(last_msg_->obs[4].P, 1017446132) + << "incorrect value for obs[4].P, expected 1017446132, is " + << last_msg_->obs[4].P; + EXPECT_EQ(last_msg_->obs[4].flags, 3) + << "incorrect value for obs[4].flags, expected 3, is " + << last_msg_->obs[4].flags; + EXPECT_EQ(last_msg_->obs[4].iono_std, 0) + << "incorrect value for obs[4].iono_std, expected 0, is " + << last_msg_->obs[4].iono_std; + EXPECT_EQ(last_msg_->obs[4].lock, 15) + << "incorrect value for obs[4].lock, expected 15, is " + << last_msg_->obs[4].lock; + EXPECT_EQ(last_msg_->obs[4].range_std, 2) + << "incorrect value for obs[4].range_std, expected 2, is " + << last_msg_->obs[4].range_std; + EXPECT_EQ(last_msg_->obs[4].sid.code, 0) + << "incorrect value for obs[4].sid.code, expected 0, is " + << last_msg_->obs[4].sid.code; + EXPECT_EQ(last_msg_->obs[4].sid.sat, 17) + << "incorrect value for obs[4].sid.sat, expected 17, is " + << last_msg_->obs[4].sid.sat; + EXPECT_EQ(last_msg_->obs[4].tropo_std, 2) + << "incorrect value for obs[4].tropo_std, expected 2, is " + << last_msg_->obs[4].tropo_std; + EXPECT_EQ(last_msg_->obs[5].L.f, 108) + << "incorrect value for obs[5].L.f, expected 108, is " + << last_msg_->obs[5].L.f; + EXPECT_EQ(last_msg_->obs[5].L.i, 110024343) + << "incorrect value for obs[5].L.i, expected 110024343, is " + << last_msg_->obs[5].L.i; + EXPECT_EQ(last_msg_->obs[5].P, 1046846826) + << "incorrect value for obs[5].P, expected 1046846826, is " + << last_msg_->obs[5].P; + EXPECT_EQ(last_msg_->obs[5].flags, 3) + << "incorrect value for obs[5].flags, expected 3, is " + << last_msg_->obs[5].flags; + EXPECT_EQ(last_msg_->obs[5].iono_std, 13) + << "incorrect value for obs[5].iono_std, expected 13, is " + << last_msg_->obs[5].iono_std; + EXPECT_EQ(last_msg_->obs[5].lock, 15) + << "incorrect value for obs[5].lock, expected 15, is " + << last_msg_->obs[5].lock; + EXPECT_EQ(last_msg_->obs[5].range_std, 3) + << "incorrect value for obs[5].range_std, expected 3, is " + << last_msg_->obs[5].range_std; + EXPECT_EQ(last_msg_->obs[5].sid.code, 0) + << "incorrect value for obs[5].sid.code, expected 0, is " + << last_msg_->obs[5].sid.code; + EXPECT_EQ(last_msg_->obs[5].sid.sat, 19) + << "incorrect value for obs[5].sid.sat, expected 19, is " + << last_msg_->obs[5].sid.sat; + EXPECT_EQ(last_msg_->obs[5].tropo_std, 3) + << "incorrect value for obs[5].tropo_std, expected 3, is " + << last_msg_->obs[5].tropo_std; + EXPECT_EQ(last_msg_->obs[6].L.f, 206) + << "incorrect value for obs[6].L.f, expected 206, is " + << last_msg_->obs[6].L.f; + EXPECT_EQ(last_msg_->obs[6].L.i, 111507381) + << "incorrect value for obs[6].L.i, expected 111507381, is " + << last_msg_->obs[6].L.i; + EXPECT_EQ(last_msg_->obs[6].P, 1060957521) + << "incorrect value for obs[6].P, expected 1060957521, is " + << last_msg_->obs[6].P; + EXPECT_EQ(last_msg_->obs[6].flags, 3) + << "incorrect value for obs[6].flags, expected 3, is " + << last_msg_->obs[6].flags; + EXPECT_EQ(last_msg_->obs[6].iono_std, 13) + << "incorrect value for obs[6].iono_std, expected 13, is " + << last_msg_->obs[6].iono_std; + EXPECT_EQ(last_msg_->obs[6].lock, 15) + << "incorrect value for obs[6].lock, expected 15, is " + << last_msg_->obs[6].lock; + EXPECT_EQ(last_msg_->obs[6].range_std, 3) + << "incorrect value for obs[6].range_std, expected 3, is " + << last_msg_->obs[6].range_std; + EXPECT_EQ(last_msg_->obs[6].sid.code, 0) + << "incorrect value for obs[6].sid.code, expected 0, is " + << last_msg_->obs[6].sid.code; + EXPECT_EQ(last_msg_->obs[6].sid.sat, 28) + << "incorrect value for obs[6].sid.sat, expected 28, is " + << last_msg_->obs[6].sid.sat; + EXPECT_EQ(last_msg_->obs[6].tropo_std, 3) + << "incorrect value for obs[6].tropo_std, expected 3, is " + << last_msg_->obs[6].tropo_std; + EXPECT_EQ(last_msg_->obs[7].L.f, 200) + << "incorrect value for obs[7].L.f, expected 200, is " + << last_msg_->obs[7].L.f; + EXPECT_EQ(last_msg_->obs[7].L.i, 113614775) + << "incorrect value for obs[7].L.i, expected 113614775, is " + << last_msg_->obs[7].L.i; + EXPECT_EQ(last_msg_->obs[7].P, 1081009286) + << "incorrect value for obs[7].P, expected 1081009286, is " + << last_msg_->obs[7].P; + EXPECT_EQ(last_msg_->obs[7].flags, 3) + << "incorrect value for obs[7].flags, expected 3, is " + << last_msg_->obs[7].flags; + EXPECT_EQ(last_msg_->obs[7].iono_std, 13) + << "incorrect value for obs[7].iono_std, expected 13, is " + << last_msg_->obs[7].iono_std; + EXPECT_EQ(last_msg_->obs[7].lock, 15) + << "incorrect value for obs[7].lock, expected 15, is " + << last_msg_->obs[7].lock; + EXPECT_EQ(last_msg_->obs[7].range_std, 3) + << "incorrect value for obs[7].range_std, expected 3, is " + << last_msg_->obs[7].range_std; + EXPECT_EQ(last_msg_->obs[7].sid.code, 0) + << "incorrect value for obs[7].sid.code, expected 0, is " + << last_msg_->obs[7].sid.code; + EXPECT_EQ(last_msg_->obs[7].sid.sat, 30) + << "incorrect value for obs[7].sid.sat, expected 30, is " + << last_msg_->obs[7].sid.sat; + EXPECT_EQ(last_msg_->obs[7].tropo_std, 3) + << "incorrect value for obs[7].tropo_std, expected 3, is " + << last_msg_->obs[7].tropo_std; + EXPECT_EQ(last_msg_->obs[8].L.f, 170) + << "incorrect value for obs[8].L.f, expected 170, is " + << last_msg_->obs[8].L.f; + EXPECT_EQ(last_msg_->obs[8].L.i, 94728270) + << "incorrect value for obs[8].L.i, expected 94728270, is " + << last_msg_->obs[8].L.i; + EXPECT_EQ(last_msg_->obs[8].P, 1156681781) + << "incorrect value for obs[8].P, expected 1156681781, is " + << last_msg_->obs[8].P; + EXPECT_EQ(last_msg_->obs[8].flags, 3) + << "incorrect value for obs[8].flags, expected 3, is " + << last_msg_->obs[8].flags; + EXPECT_EQ(last_msg_->obs[8].iono_std, 21) + << "incorrect value for obs[8].iono_std, expected 21, is " + << last_msg_->obs[8].iono_std; + EXPECT_EQ(last_msg_->obs[8].lock, 15) + << "incorrect value for obs[8].lock, expected 15, is " + << last_msg_->obs[8].lock; + EXPECT_EQ(last_msg_->obs[8].range_std, 7) + << "incorrect value for obs[8].range_std, expected 7, is " + << last_msg_->obs[8].range_std; + EXPECT_EQ(last_msg_->obs[8].sid.code, 6) + << "incorrect value for obs[8].sid.code, expected 6, is " + << last_msg_->obs[8].sid.code; + EXPECT_EQ(last_msg_->obs[8].sid.sat, 1) + << "incorrect value for obs[8].sid.sat, expected 1, is " + << last_msg_->obs[8].sid.sat; + EXPECT_EQ(last_msg_->obs[8].tropo_std, 7) + << "incorrect value for obs[8].tropo_std, expected 7, is " + << last_msg_->obs[8].tropo_std; + EXPECT_EQ(last_msg_->obs[9].L.f, 129) + << "incorrect value for obs[9].L.f, expected 129, is " + << last_msg_->obs[9].L.f; + EXPECT_EQ(last_msg_->obs[9].L.i, 87130275) + << "incorrect value for obs[9].L.i, expected 87130275, is " + << last_msg_->obs[9].L.i; + EXPECT_EQ(last_msg_->obs[9].P, 1063905531) + << "incorrect value for obs[9].P, expected 1063905531, is " + << last_msg_->obs[9].P; + EXPECT_EQ(last_msg_->obs[9].flags, 3) + << "incorrect value for obs[9].flags, expected 3, is " + << last_msg_->obs[9].flags; + EXPECT_EQ(last_msg_->obs[9].iono_std, 21) + << "incorrect value for obs[9].iono_std, expected 21, is " + << last_msg_->obs[9].iono_std; + EXPECT_EQ(last_msg_->obs[9].lock, 15) + << "incorrect value for obs[9].lock, expected 15, is " + << last_msg_->obs[9].lock; + EXPECT_EQ(last_msg_->obs[9].range_std, 3) + << "incorrect value for obs[9].range_std, expected 3, is " + << last_msg_->obs[9].range_std; + EXPECT_EQ(last_msg_->obs[9].sid.code, 6) + << "incorrect value for obs[9].sid.code, expected 6, is " + << last_msg_->obs[9].sid.code; + EXPECT_EQ(last_msg_->obs[9].sid.sat, 13) + << "incorrect value for obs[9].sid.sat, expected 13, is " + << last_msg_->obs[9].sid.sat; + EXPECT_EQ(last_msg_->obs[9].tropo_std, 3) + << "incorrect value for obs[9].tropo_std, expected 3, is " + << last_msg_->obs[9].tropo_std; + EXPECT_EQ(last_msg_->obs[10].L.f, 46) + << "incorrect value for obs[10].L.f, expected 46, is " + << last_msg_->obs[10].L.f; + EXPECT_EQ(last_msg_->obs[10].L.i, 86253605) + << "incorrect value for obs[10].L.i, expected 86253605, is " + << last_msg_->obs[10].L.i; + EXPECT_EQ(last_msg_->obs[10].P, 1053200752) + << "incorrect value for obs[10].P, expected 1053200752, is " + << last_msg_->obs[10].P; + EXPECT_EQ(last_msg_->obs[10].flags, 3) + << "incorrect value for obs[10].flags, expected 3, is " + << last_msg_->obs[10].flags; + EXPECT_EQ(last_msg_->obs[10].iono_std, 21) + << "incorrect value for obs[10].iono_std, expected 21, is " + << last_msg_->obs[10].iono_std; + EXPECT_EQ(last_msg_->obs[10].lock, 15) + << "incorrect value for obs[10].lock, expected 15, is " + << last_msg_->obs[10].lock; + EXPECT_EQ(last_msg_->obs[10].range_std, 3) + << "incorrect value for obs[10].range_std, expected 3, is " + << last_msg_->obs[10].range_std; + EXPECT_EQ(last_msg_->obs[10].sid.code, 6) + << "incorrect value for obs[10].sid.code, expected 6, is " + << last_msg_->obs[10].sid.code; + EXPECT_EQ(last_msg_->obs[10].sid.sat, 14) + << "incorrect value for obs[10].sid.sat, expected 14, is " + << last_msg_->obs[10].sid.sat; + EXPECT_EQ(last_msg_->obs[10].tropo_std, 3) + << "incorrect value for obs[10].tropo_std, expected 3, is " + << last_msg_->obs[10].tropo_std; + EXPECT_EQ(last_msg_->obs[11].L.f, 95) + << "incorrect value for obs[11].L.f, expected 95, is " + << last_msg_->obs[11].L.f; + EXPECT_EQ(last_msg_->obs[11].L.i, 93155512) + << "incorrect value for obs[11].L.i, expected 93155512, is " + << last_msg_->obs[11].L.i; + EXPECT_EQ(last_msg_->obs[11].P, 1137476774) + << "incorrect value for obs[11].P, expected 1137476774, is " + << last_msg_->obs[11].P; + EXPECT_EQ(last_msg_->obs[11].flags, 3) + << "incorrect value for obs[11].flags, expected 3, is " + << last_msg_->obs[11].flags; + EXPECT_EQ(last_msg_->obs[11].iono_std, 21) + << "incorrect value for obs[11].iono_std, expected 21, is " + << last_msg_->obs[11].iono_std; + EXPECT_EQ(last_msg_->obs[11].lock, 15) + << "incorrect value for obs[11].lock, expected 15, is " + << last_msg_->obs[11].lock; + EXPECT_EQ(last_msg_->obs[11].range_std, 5) + << "incorrect value for obs[11].range_std, expected 5, is " + << last_msg_->obs[11].range_std; + EXPECT_EQ(last_msg_->obs[11].sid.code, 6) + << "incorrect value for obs[11].sid.code, expected 6, is " + << last_msg_->obs[11].sid.code; + EXPECT_EQ(last_msg_->obs[11].sid.sat, 15) + << "incorrect value for obs[11].sid.sat, expected 15, is " + << last_msg_->obs[11].sid.sat; + EXPECT_EQ(last_msg_->obs[11].tropo_std, 5) + << "incorrect value for obs[11].tropo_std, expected 5, is " + << last_msg_->obs[11].tropo_std; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgSvAzEl.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgSvAzEl.cc index 5afac2705..dd189917d 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgSvAzEl.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgSvAzEl.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvAzEl.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvAzEl.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgSvAzEl0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgSvAzEl0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgSvAzEl0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgSvAzEl0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_sv_az_el_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_sv_az_el_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,429 +81,701 @@ class Test_legacy_auto_check_sbp_observation_MsgSvAzEl0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_sv_az_el_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgSvAzEl0, Test) -{ +}; - uint8_t encoded_frame[] = {85,151,0,207,121,132,8,0,160,12,10,0,139,66,13,0,16,1,15,0,24,25,16,0,127,18,18,0,42,53,20,0,31,16,23,0,12,67,24,0,47,10,26,0,116,8,27,0,153,43,29,0,77,10,32,0,94,26,1,3,16,58,2,3,108,53,8,3,17,13,17,3,165,40,23,3,63,35,24,3,41,73,20,12,114,26,27,12,72,54,28,12,69,3,29,12,158,14,30,12,152,68,32,12,120,82,2,14,131,6,4,14,27,44,5,14,101,21,9,14,81,65,11,14,49,56,12,14,59,6,30,14,154,4,36,14,165,62,168,36, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgSvAzEl0, Test) { + uint8_t encoded_frame[] = { + 85, 151, 0, 207, 121, 132, 8, 0, 160, 12, 10, 0, 139, 66, 13, 0, + 16, 1, 15, 0, 24, 25, 16, 0, 127, 18, 18, 0, 42, 53, 20, 0, + 31, 16, 23, 0, 12, 67, 24, 0, 47, 10, 26, 0, 116, 8, 27, 0, + 153, 43, 29, 0, 77, 10, 32, 0, 94, 26, 1, 3, 16, 58, 2, 3, + 108, 53, 8, 3, 17, 13, 17, 3, 165, 40, 23, 3, 63, 35, 24, 3, + 41, 73, 20, 12, 114, 26, 27, 12, 72, 54, 28, 12, 69, 3, 29, 12, + 158, 14, 30, 12, 152, 68, 32, 12, 120, 82, 2, 14, 131, 6, 4, 14, + 27, 44, 5, 14, 101, 21, 9, 14, 81, 65, 11, 14, 49, 56, 12, 14, + 59, 6, 30, 14, 154, 4, 36, 14, 165, 62, 168, 36, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_sv_az_el_t* test_msg = ( msg_sv_az_el_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[0].az = 160; - test_msg->azel[0].el = 12; - test_msg->azel[0].sid.code = 0; - test_msg->azel[0].sid.sat = 8; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[1].az = 139; - test_msg->azel[1].el = 66; - test_msg->azel[1].sid.code = 0; - test_msg->azel[1].sid.sat = 10; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[2].az = 16; - test_msg->azel[2].el = 1; - test_msg->azel[2].sid.code = 0; - test_msg->azel[2].sid.sat = 13; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[3].az = 24; - test_msg->azel[3].el = 25; - test_msg->azel[3].sid.code = 0; - test_msg->azel[3].sid.sat = 15; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[4].az = 127; - test_msg->azel[4].el = 18; - test_msg->azel[4].sid.code = 0; - test_msg->azel[4].sid.sat = 16; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[5].az = 42; - test_msg->azel[5].el = 53; - test_msg->azel[5].sid.code = 0; - test_msg->azel[5].sid.sat = 18; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[6].az = 31; - test_msg->azel[6].el = 16; - test_msg->azel[6].sid.code = 0; - test_msg->azel[6].sid.sat = 20; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[7].az = 12; - test_msg->azel[7].el = 67; - test_msg->azel[7].sid.code = 0; - test_msg->azel[7].sid.sat = 23; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[8].az = 47; - test_msg->azel[8].el = 10; - test_msg->azel[8].sid.code = 0; - test_msg->azel[8].sid.sat = 24; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[9].az = 116; - test_msg->azel[9].el = 8; - test_msg->azel[9].sid.code = 0; - test_msg->azel[9].sid.sat = 26; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[10].az = 153; - test_msg->azel[10].el = 43; - test_msg->azel[10].sid.code = 0; - test_msg->azel[10].sid.sat = 27; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[11].az = 77; - test_msg->azel[11].el = 10; - test_msg->azel[11].sid.code = 0; - test_msg->azel[11].sid.sat = 29; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[12].az = 94; - test_msg->azel[12].el = 26; - test_msg->azel[12].sid.code = 0; - test_msg->azel[12].sid.sat = 32; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[13].az = 16; - test_msg->azel[13].el = 58; - test_msg->azel[13].sid.code = 3; - test_msg->azel[13].sid.sat = 1; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[14].az = 108; - test_msg->azel[14].el = 53; - test_msg->azel[14].sid.code = 3; - test_msg->azel[14].sid.sat = 2; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[15].az = 17; - test_msg->azel[15].el = 13; - test_msg->azel[15].sid.code = 3; - test_msg->azel[15].sid.sat = 8; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[16].az = 165; - test_msg->azel[16].el = 40; - test_msg->azel[16].sid.code = 3; - test_msg->azel[16].sid.sat = 17; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[17].az = 63; - test_msg->azel[17].el = 35; - test_msg->azel[17].sid.code = 3; - test_msg->azel[17].sid.sat = 23; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[18].az = 41; - test_msg->azel[18].el = 73; - test_msg->azel[18].sid.code = 3; - test_msg->azel[18].sid.sat = 24; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[19].az = 114; - test_msg->azel[19].el = 26; - test_msg->azel[19].sid.code = 12; - test_msg->azel[19].sid.sat = 20; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[20].az = 72; - test_msg->azel[20].el = 54; - test_msg->azel[20].sid.code = 12; - test_msg->azel[20].sid.sat = 27; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[21].az = 69; - test_msg->azel[21].el = 3; - test_msg->azel[21].sid.code = 12; - test_msg->azel[21].sid.sat = 28; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[22].az = 158; - test_msg->azel[22].el = 14; - test_msg->azel[22].sid.code = 12; - test_msg->azel[22].sid.sat = 29; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[23].az = 152; - test_msg->azel[23].el = 68; - test_msg->azel[23].sid.code = 12; - test_msg->azel[23].sid.sat = 30; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[24].az = 120; - test_msg->azel[24].el = 82; - test_msg->azel[24].sid.code = 12; - test_msg->azel[24].sid.sat = 32; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[25].az = 131; - test_msg->azel[25].el = 6; - test_msg->azel[25].sid.code = 14; - test_msg->azel[25].sid.sat = 2; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[26].az = 27; - test_msg->azel[26].el = 44; - test_msg->azel[26].sid.code = 14; - test_msg->azel[26].sid.sat = 4; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[27].az = 101; - test_msg->azel[27].el = 21; - test_msg->azel[27].sid.code = 14; - test_msg->azel[27].sid.sat = 5; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[28].az = 81; - test_msg->azel[28].el = 65; - test_msg->azel[28].sid.code = 14; - test_msg->azel[28].sid.sat = 9; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[29].az = 49; - test_msg->azel[29].el = 56; - test_msg->azel[29].sid.code = 14; - test_msg->azel[29].sid.sat = 11; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[30].az = 59; - test_msg->azel[30].el = 6; - test_msg->azel[30].sid.code = 14; - test_msg->azel[30].sid.sat = 12; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[31].az = 154; - test_msg->azel[31].el = 4; - test_msg->azel[31].sid.code = 14; - test_msg->azel[31].sid.sat = 30; - if (sizeof(test_msg->azel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); - } - test_msg->azel[32].az = 165; - test_msg->azel[32].el = 62; - test_msg->azel[32].sid.code = 14; - test_msg->azel[32].sid.sat = 36; - - EXPECT_EQ(send_message( 0x97, 31183, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_sv_az_el_t *test_msg = (msg_sv_az_el_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[0].az = 160; + test_msg->azel[0].el = 12; + test_msg->azel[0].sid.code = 0; + test_msg->azel[0].sid.sat = 8; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[1].az = 139; + test_msg->azel[1].el = 66; + test_msg->azel[1].sid.code = 0; + test_msg->azel[1].sid.sat = 10; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[2].az = 16; + test_msg->azel[2].el = 1; + test_msg->azel[2].sid.code = 0; + test_msg->azel[2].sid.sat = 13; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[3].az = 24; + test_msg->azel[3].el = 25; + test_msg->azel[3].sid.code = 0; + test_msg->azel[3].sid.sat = 15; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[4].az = 127; + test_msg->azel[4].el = 18; + test_msg->azel[4].sid.code = 0; + test_msg->azel[4].sid.sat = 16; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[5].az = 42; + test_msg->azel[5].el = 53; + test_msg->azel[5].sid.code = 0; + test_msg->azel[5].sid.sat = 18; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[6].az = 31; + test_msg->azel[6].el = 16; + test_msg->azel[6].sid.code = 0; + test_msg->azel[6].sid.sat = 20; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[7].az = 12; + test_msg->azel[7].el = 67; + test_msg->azel[7].sid.code = 0; + test_msg->azel[7].sid.sat = 23; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[8].az = 47; + test_msg->azel[8].el = 10; + test_msg->azel[8].sid.code = 0; + test_msg->azel[8].sid.sat = 24; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[9].az = 116; + test_msg->azel[9].el = 8; + test_msg->azel[9].sid.code = 0; + test_msg->azel[9].sid.sat = 26; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[10].az = 153; + test_msg->azel[10].el = 43; + test_msg->azel[10].sid.code = 0; + test_msg->azel[10].sid.sat = 27; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[11].az = 77; + test_msg->azel[11].el = 10; + test_msg->azel[11].sid.code = 0; + test_msg->azel[11].sid.sat = 29; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[12].az = 94; + test_msg->azel[12].el = 26; + test_msg->azel[12].sid.code = 0; + test_msg->azel[12].sid.sat = 32; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[13].az = 16; + test_msg->azel[13].el = 58; + test_msg->azel[13].sid.code = 3; + test_msg->azel[13].sid.sat = 1; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[14].az = 108; + test_msg->azel[14].el = 53; + test_msg->azel[14].sid.code = 3; + test_msg->azel[14].sid.sat = 2; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[15].az = 17; + test_msg->azel[15].el = 13; + test_msg->azel[15].sid.code = 3; + test_msg->azel[15].sid.sat = 8; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[16].az = 165; + test_msg->azel[16].el = 40; + test_msg->azel[16].sid.code = 3; + test_msg->azel[16].sid.sat = 17; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[17].az = 63; + test_msg->azel[17].el = 35; + test_msg->azel[17].sid.code = 3; + test_msg->azel[17].sid.sat = 23; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[18].az = 41; + test_msg->azel[18].el = 73; + test_msg->azel[18].sid.code = 3; + test_msg->azel[18].sid.sat = 24; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[19].az = 114; + test_msg->azel[19].el = 26; + test_msg->azel[19].sid.code = 12; + test_msg->azel[19].sid.sat = 20; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[20].az = 72; + test_msg->azel[20].el = 54; + test_msg->azel[20].sid.code = 12; + test_msg->azel[20].sid.sat = 27; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[21].az = 69; + test_msg->azel[21].el = 3; + test_msg->azel[21].sid.code = 12; + test_msg->azel[21].sid.sat = 28; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[22].az = 158; + test_msg->azel[22].el = 14; + test_msg->azel[22].sid.code = 12; + test_msg->azel[22].sid.sat = 29; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[23].az = 152; + test_msg->azel[23].el = 68; + test_msg->azel[23].sid.code = 12; + test_msg->azel[23].sid.sat = 30; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[24].az = 120; + test_msg->azel[24].el = 82; + test_msg->azel[24].sid.code = 12; + test_msg->azel[24].sid.sat = 32; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[25].az = 131; + test_msg->azel[25].el = 6; + test_msg->azel[25].sid.code = 14; + test_msg->azel[25].sid.sat = 2; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[26].az = 27; + test_msg->azel[26].el = 44; + test_msg->azel[26].sid.code = 14; + test_msg->azel[26].sid.sat = 4; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[27].az = 101; + test_msg->azel[27].el = 21; + test_msg->azel[27].sid.code = 14; + test_msg->azel[27].sid.sat = 5; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[28].az = 81; + test_msg->azel[28].el = 65; + test_msg->azel[28].sid.code = 14; + test_msg->azel[28].sid.sat = 9; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[29].az = 49; + test_msg->azel[29].el = 56; + test_msg->azel[29].sid.code = 14; + test_msg->azel[29].sid.sat = 11; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[30].az = 59; + test_msg->azel[30].el = 6; + test_msg->azel[30].sid.code = 14; + test_msg->azel[30].sid.sat = 12; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[31].az = 154; + test_msg->azel[31].el = 4; + test_msg->azel[31].sid.code = 14; + test_msg->azel[31].sid.sat = 30; + if (sizeof(test_msg->azel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->azel[0])); + } + test_msg->azel[32].az = 165; + test_msg->azel[32].el = 62; + test_msg->azel[32].sid.code = 14; + test_msg->azel[32].sid.sat = 36; + + EXPECT_EQ(send_message(0x97, 31183, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 31183); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->azel[0].az, 160) << "incorrect value for azel[0].az, expected 160, is " << last_msg_->azel[0].az; - EXPECT_EQ(last_msg_->azel[0].el, 12) << "incorrect value for azel[0].el, expected 12, is " << last_msg_->azel[0].el; - EXPECT_EQ(last_msg_->azel[0].sid.code, 0) << "incorrect value for azel[0].sid.code, expected 0, is " << last_msg_->azel[0].sid.code; - EXPECT_EQ(last_msg_->azel[0].sid.sat, 8) << "incorrect value for azel[0].sid.sat, expected 8, is " << last_msg_->azel[0].sid.sat; - EXPECT_EQ(last_msg_->azel[1].az, 139) << "incorrect value for azel[1].az, expected 139, is " << last_msg_->azel[1].az; - EXPECT_EQ(last_msg_->azel[1].el, 66) << "incorrect value for azel[1].el, expected 66, is " << last_msg_->azel[1].el; - EXPECT_EQ(last_msg_->azel[1].sid.code, 0) << "incorrect value for azel[1].sid.code, expected 0, is " << last_msg_->azel[1].sid.code; - EXPECT_EQ(last_msg_->azel[1].sid.sat, 10) << "incorrect value for azel[1].sid.sat, expected 10, is " << last_msg_->azel[1].sid.sat; - EXPECT_EQ(last_msg_->azel[2].az, 16) << "incorrect value for azel[2].az, expected 16, is " << last_msg_->azel[2].az; - EXPECT_EQ(last_msg_->azel[2].el, 1) << "incorrect value for azel[2].el, expected 1, is " << last_msg_->azel[2].el; - EXPECT_EQ(last_msg_->azel[2].sid.code, 0) << "incorrect value for azel[2].sid.code, expected 0, is " << last_msg_->azel[2].sid.code; - EXPECT_EQ(last_msg_->azel[2].sid.sat, 13) << "incorrect value for azel[2].sid.sat, expected 13, is " << last_msg_->azel[2].sid.sat; - EXPECT_EQ(last_msg_->azel[3].az, 24) << "incorrect value for azel[3].az, expected 24, is " << last_msg_->azel[3].az; - EXPECT_EQ(last_msg_->azel[3].el, 25) << "incorrect value for azel[3].el, expected 25, is " << last_msg_->azel[3].el; - EXPECT_EQ(last_msg_->azel[3].sid.code, 0) << "incorrect value for azel[3].sid.code, expected 0, is " << last_msg_->azel[3].sid.code; - EXPECT_EQ(last_msg_->azel[3].sid.sat, 15) << "incorrect value for azel[3].sid.sat, expected 15, is " << last_msg_->azel[3].sid.sat; - EXPECT_EQ(last_msg_->azel[4].az, 127) << "incorrect value for azel[4].az, expected 127, is " << last_msg_->azel[4].az; - EXPECT_EQ(last_msg_->azel[4].el, 18) << "incorrect value for azel[4].el, expected 18, is " << last_msg_->azel[4].el; - EXPECT_EQ(last_msg_->azel[4].sid.code, 0) << "incorrect value for azel[4].sid.code, expected 0, is " << last_msg_->azel[4].sid.code; - EXPECT_EQ(last_msg_->azel[4].sid.sat, 16) << "incorrect value for azel[4].sid.sat, expected 16, is " << last_msg_->azel[4].sid.sat; - EXPECT_EQ(last_msg_->azel[5].az, 42) << "incorrect value for azel[5].az, expected 42, is " << last_msg_->azel[5].az; - EXPECT_EQ(last_msg_->azel[5].el, 53) << "incorrect value for azel[5].el, expected 53, is " << last_msg_->azel[5].el; - EXPECT_EQ(last_msg_->azel[5].sid.code, 0) << "incorrect value for azel[5].sid.code, expected 0, is " << last_msg_->azel[5].sid.code; - EXPECT_EQ(last_msg_->azel[5].sid.sat, 18) << "incorrect value for azel[5].sid.sat, expected 18, is " << last_msg_->azel[5].sid.sat; - EXPECT_EQ(last_msg_->azel[6].az, 31) << "incorrect value for azel[6].az, expected 31, is " << last_msg_->azel[6].az; - EXPECT_EQ(last_msg_->azel[6].el, 16) << "incorrect value for azel[6].el, expected 16, is " << last_msg_->azel[6].el; - EXPECT_EQ(last_msg_->azel[6].sid.code, 0) << "incorrect value for azel[6].sid.code, expected 0, is " << last_msg_->azel[6].sid.code; - EXPECT_EQ(last_msg_->azel[6].sid.sat, 20) << "incorrect value for azel[6].sid.sat, expected 20, is " << last_msg_->azel[6].sid.sat; - EXPECT_EQ(last_msg_->azel[7].az, 12) << "incorrect value for azel[7].az, expected 12, is " << last_msg_->azel[7].az; - EXPECT_EQ(last_msg_->azel[7].el, 67) << "incorrect value for azel[7].el, expected 67, is " << last_msg_->azel[7].el; - EXPECT_EQ(last_msg_->azel[7].sid.code, 0) << "incorrect value for azel[7].sid.code, expected 0, is " << last_msg_->azel[7].sid.code; - EXPECT_EQ(last_msg_->azel[7].sid.sat, 23) << "incorrect value for azel[7].sid.sat, expected 23, is " << last_msg_->azel[7].sid.sat; - EXPECT_EQ(last_msg_->azel[8].az, 47) << "incorrect value for azel[8].az, expected 47, is " << last_msg_->azel[8].az; - EXPECT_EQ(last_msg_->azel[8].el, 10) << "incorrect value for azel[8].el, expected 10, is " << last_msg_->azel[8].el; - EXPECT_EQ(last_msg_->azel[8].sid.code, 0) << "incorrect value for azel[8].sid.code, expected 0, is " << last_msg_->azel[8].sid.code; - EXPECT_EQ(last_msg_->azel[8].sid.sat, 24) << "incorrect value for azel[8].sid.sat, expected 24, is " << last_msg_->azel[8].sid.sat; - EXPECT_EQ(last_msg_->azel[9].az, 116) << "incorrect value for azel[9].az, expected 116, is " << last_msg_->azel[9].az; - EXPECT_EQ(last_msg_->azel[9].el, 8) << "incorrect value for azel[9].el, expected 8, is " << last_msg_->azel[9].el; - EXPECT_EQ(last_msg_->azel[9].sid.code, 0) << "incorrect value for azel[9].sid.code, expected 0, is " << last_msg_->azel[9].sid.code; - EXPECT_EQ(last_msg_->azel[9].sid.sat, 26) << "incorrect value for azel[9].sid.sat, expected 26, is " << last_msg_->azel[9].sid.sat; - EXPECT_EQ(last_msg_->azel[10].az, 153) << "incorrect value for azel[10].az, expected 153, is " << last_msg_->azel[10].az; - EXPECT_EQ(last_msg_->azel[10].el, 43) << "incorrect value for azel[10].el, expected 43, is " << last_msg_->azel[10].el; - EXPECT_EQ(last_msg_->azel[10].sid.code, 0) << "incorrect value for azel[10].sid.code, expected 0, is " << last_msg_->azel[10].sid.code; - EXPECT_EQ(last_msg_->azel[10].sid.sat, 27) << "incorrect value for azel[10].sid.sat, expected 27, is " << last_msg_->azel[10].sid.sat; - EXPECT_EQ(last_msg_->azel[11].az, 77) << "incorrect value for azel[11].az, expected 77, is " << last_msg_->azel[11].az; - EXPECT_EQ(last_msg_->azel[11].el, 10) << "incorrect value for azel[11].el, expected 10, is " << last_msg_->azel[11].el; - EXPECT_EQ(last_msg_->azel[11].sid.code, 0) << "incorrect value for azel[11].sid.code, expected 0, is " << last_msg_->azel[11].sid.code; - EXPECT_EQ(last_msg_->azel[11].sid.sat, 29) << "incorrect value for azel[11].sid.sat, expected 29, is " << last_msg_->azel[11].sid.sat; - EXPECT_EQ(last_msg_->azel[12].az, 94) << "incorrect value for azel[12].az, expected 94, is " << last_msg_->azel[12].az; - EXPECT_EQ(last_msg_->azel[12].el, 26) << "incorrect value for azel[12].el, expected 26, is " << last_msg_->azel[12].el; - EXPECT_EQ(last_msg_->azel[12].sid.code, 0) << "incorrect value for azel[12].sid.code, expected 0, is " << last_msg_->azel[12].sid.code; - EXPECT_EQ(last_msg_->azel[12].sid.sat, 32) << "incorrect value for azel[12].sid.sat, expected 32, is " << last_msg_->azel[12].sid.sat; - EXPECT_EQ(last_msg_->azel[13].az, 16) << "incorrect value for azel[13].az, expected 16, is " << last_msg_->azel[13].az; - EXPECT_EQ(last_msg_->azel[13].el, 58) << "incorrect value for azel[13].el, expected 58, is " << last_msg_->azel[13].el; - EXPECT_EQ(last_msg_->azel[13].sid.code, 3) << "incorrect value for azel[13].sid.code, expected 3, is " << last_msg_->azel[13].sid.code; - EXPECT_EQ(last_msg_->azel[13].sid.sat, 1) << "incorrect value for azel[13].sid.sat, expected 1, is " << last_msg_->azel[13].sid.sat; - EXPECT_EQ(last_msg_->azel[14].az, 108) << "incorrect value for azel[14].az, expected 108, is " << last_msg_->azel[14].az; - EXPECT_EQ(last_msg_->azel[14].el, 53) << "incorrect value for azel[14].el, expected 53, is " << last_msg_->azel[14].el; - EXPECT_EQ(last_msg_->azel[14].sid.code, 3) << "incorrect value for azel[14].sid.code, expected 3, is " << last_msg_->azel[14].sid.code; - EXPECT_EQ(last_msg_->azel[14].sid.sat, 2) << "incorrect value for azel[14].sid.sat, expected 2, is " << last_msg_->azel[14].sid.sat; - EXPECT_EQ(last_msg_->azel[15].az, 17) << "incorrect value for azel[15].az, expected 17, is " << last_msg_->azel[15].az; - EXPECT_EQ(last_msg_->azel[15].el, 13) << "incorrect value for azel[15].el, expected 13, is " << last_msg_->azel[15].el; - EXPECT_EQ(last_msg_->azel[15].sid.code, 3) << "incorrect value for azel[15].sid.code, expected 3, is " << last_msg_->azel[15].sid.code; - EXPECT_EQ(last_msg_->azel[15].sid.sat, 8) << "incorrect value for azel[15].sid.sat, expected 8, is " << last_msg_->azel[15].sid.sat; - EXPECT_EQ(last_msg_->azel[16].az, 165) << "incorrect value for azel[16].az, expected 165, is " << last_msg_->azel[16].az; - EXPECT_EQ(last_msg_->azel[16].el, 40) << "incorrect value for azel[16].el, expected 40, is " << last_msg_->azel[16].el; - EXPECT_EQ(last_msg_->azel[16].sid.code, 3) << "incorrect value for azel[16].sid.code, expected 3, is " << last_msg_->azel[16].sid.code; - EXPECT_EQ(last_msg_->azel[16].sid.sat, 17) << "incorrect value for azel[16].sid.sat, expected 17, is " << last_msg_->azel[16].sid.sat; - EXPECT_EQ(last_msg_->azel[17].az, 63) << "incorrect value for azel[17].az, expected 63, is " << last_msg_->azel[17].az; - EXPECT_EQ(last_msg_->azel[17].el, 35) << "incorrect value for azel[17].el, expected 35, is " << last_msg_->azel[17].el; - EXPECT_EQ(last_msg_->azel[17].sid.code, 3) << "incorrect value for azel[17].sid.code, expected 3, is " << last_msg_->azel[17].sid.code; - EXPECT_EQ(last_msg_->azel[17].sid.sat, 23) << "incorrect value for azel[17].sid.sat, expected 23, is " << last_msg_->azel[17].sid.sat; - EXPECT_EQ(last_msg_->azel[18].az, 41) << "incorrect value for azel[18].az, expected 41, is " << last_msg_->azel[18].az; - EXPECT_EQ(last_msg_->azel[18].el, 73) << "incorrect value for azel[18].el, expected 73, is " << last_msg_->azel[18].el; - EXPECT_EQ(last_msg_->azel[18].sid.code, 3) << "incorrect value for azel[18].sid.code, expected 3, is " << last_msg_->azel[18].sid.code; - EXPECT_EQ(last_msg_->azel[18].sid.sat, 24) << "incorrect value for azel[18].sid.sat, expected 24, is " << last_msg_->azel[18].sid.sat; - EXPECT_EQ(last_msg_->azel[19].az, 114) << "incorrect value for azel[19].az, expected 114, is " << last_msg_->azel[19].az; - EXPECT_EQ(last_msg_->azel[19].el, 26) << "incorrect value for azel[19].el, expected 26, is " << last_msg_->azel[19].el; - EXPECT_EQ(last_msg_->azel[19].sid.code, 12) << "incorrect value for azel[19].sid.code, expected 12, is " << last_msg_->azel[19].sid.code; - EXPECT_EQ(last_msg_->azel[19].sid.sat, 20) << "incorrect value for azel[19].sid.sat, expected 20, is " << last_msg_->azel[19].sid.sat; - EXPECT_EQ(last_msg_->azel[20].az, 72) << "incorrect value for azel[20].az, expected 72, is " << last_msg_->azel[20].az; - EXPECT_EQ(last_msg_->azel[20].el, 54) << "incorrect value for azel[20].el, expected 54, is " << last_msg_->azel[20].el; - EXPECT_EQ(last_msg_->azel[20].sid.code, 12) << "incorrect value for azel[20].sid.code, expected 12, is " << last_msg_->azel[20].sid.code; - EXPECT_EQ(last_msg_->azel[20].sid.sat, 27) << "incorrect value for azel[20].sid.sat, expected 27, is " << last_msg_->azel[20].sid.sat; - EXPECT_EQ(last_msg_->azel[21].az, 69) << "incorrect value for azel[21].az, expected 69, is " << last_msg_->azel[21].az; - EXPECT_EQ(last_msg_->azel[21].el, 3) << "incorrect value for azel[21].el, expected 3, is " << last_msg_->azel[21].el; - EXPECT_EQ(last_msg_->azel[21].sid.code, 12) << "incorrect value for azel[21].sid.code, expected 12, is " << last_msg_->azel[21].sid.code; - EXPECT_EQ(last_msg_->azel[21].sid.sat, 28) << "incorrect value for azel[21].sid.sat, expected 28, is " << last_msg_->azel[21].sid.sat; - EXPECT_EQ(last_msg_->azel[22].az, 158) << "incorrect value for azel[22].az, expected 158, is " << last_msg_->azel[22].az; - EXPECT_EQ(last_msg_->azel[22].el, 14) << "incorrect value for azel[22].el, expected 14, is " << last_msg_->azel[22].el; - EXPECT_EQ(last_msg_->azel[22].sid.code, 12) << "incorrect value for azel[22].sid.code, expected 12, is " << last_msg_->azel[22].sid.code; - EXPECT_EQ(last_msg_->azel[22].sid.sat, 29) << "incorrect value for azel[22].sid.sat, expected 29, is " << last_msg_->azel[22].sid.sat; - EXPECT_EQ(last_msg_->azel[23].az, 152) << "incorrect value for azel[23].az, expected 152, is " << last_msg_->azel[23].az; - EXPECT_EQ(last_msg_->azel[23].el, 68) << "incorrect value for azel[23].el, expected 68, is " << last_msg_->azel[23].el; - EXPECT_EQ(last_msg_->azel[23].sid.code, 12) << "incorrect value for azel[23].sid.code, expected 12, is " << last_msg_->azel[23].sid.code; - EXPECT_EQ(last_msg_->azel[23].sid.sat, 30) << "incorrect value for azel[23].sid.sat, expected 30, is " << last_msg_->azel[23].sid.sat; - EXPECT_EQ(last_msg_->azel[24].az, 120) << "incorrect value for azel[24].az, expected 120, is " << last_msg_->azel[24].az; - EXPECT_EQ(last_msg_->azel[24].el, 82) << "incorrect value for azel[24].el, expected 82, is " << last_msg_->azel[24].el; - EXPECT_EQ(last_msg_->azel[24].sid.code, 12) << "incorrect value for azel[24].sid.code, expected 12, is " << last_msg_->azel[24].sid.code; - EXPECT_EQ(last_msg_->azel[24].sid.sat, 32) << "incorrect value for azel[24].sid.sat, expected 32, is " << last_msg_->azel[24].sid.sat; - EXPECT_EQ(last_msg_->azel[25].az, 131) << "incorrect value for azel[25].az, expected 131, is " << last_msg_->azel[25].az; - EXPECT_EQ(last_msg_->azel[25].el, 6) << "incorrect value for azel[25].el, expected 6, is " << last_msg_->azel[25].el; - EXPECT_EQ(last_msg_->azel[25].sid.code, 14) << "incorrect value for azel[25].sid.code, expected 14, is " << last_msg_->azel[25].sid.code; - EXPECT_EQ(last_msg_->azel[25].sid.sat, 2) << "incorrect value for azel[25].sid.sat, expected 2, is " << last_msg_->azel[25].sid.sat; - EXPECT_EQ(last_msg_->azel[26].az, 27) << "incorrect value for azel[26].az, expected 27, is " << last_msg_->azel[26].az; - EXPECT_EQ(last_msg_->azel[26].el, 44) << "incorrect value for azel[26].el, expected 44, is " << last_msg_->azel[26].el; - EXPECT_EQ(last_msg_->azel[26].sid.code, 14) << "incorrect value for azel[26].sid.code, expected 14, is " << last_msg_->azel[26].sid.code; - EXPECT_EQ(last_msg_->azel[26].sid.sat, 4) << "incorrect value for azel[26].sid.sat, expected 4, is " << last_msg_->azel[26].sid.sat; - EXPECT_EQ(last_msg_->azel[27].az, 101) << "incorrect value for azel[27].az, expected 101, is " << last_msg_->azel[27].az; - EXPECT_EQ(last_msg_->azel[27].el, 21) << "incorrect value for azel[27].el, expected 21, is " << last_msg_->azel[27].el; - EXPECT_EQ(last_msg_->azel[27].sid.code, 14) << "incorrect value for azel[27].sid.code, expected 14, is " << last_msg_->azel[27].sid.code; - EXPECT_EQ(last_msg_->azel[27].sid.sat, 5) << "incorrect value for azel[27].sid.sat, expected 5, is " << last_msg_->azel[27].sid.sat; - EXPECT_EQ(last_msg_->azel[28].az, 81) << "incorrect value for azel[28].az, expected 81, is " << last_msg_->azel[28].az; - EXPECT_EQ(last_msg_->azel[28].el, 65) << "incorrect value for azel[28].el, expected 65, is " << last_msg_->azel[28].el; - EXPECT_EQ(last_msg_->azel[28].sid.code, 14) << "incorrect value for azel[28].sid.code, expected 14, is " << last_msg_->azel[28].sid.code; - EXPECT_EQ(last_msg_->azel[28].sid.sat, 9) << "incorrect value for azel[28].sid.sat, expected 9, is " << last_msg_->azel[28].sid.sat; - EXPECT_EQ(last_msg_->azel[29].az, 49) << "incorrect value for azel[29].az, expected 49, is " << last_msg_->azel[29].az; - EXPECT_EQ(last_msg_->azel[29].el, 56) << "incorrect value for azel[29].el, expected 56, is " << last_msg_->azel[29].el; - EXPECT_EQ(last_msg_->azel[29].sid.code, 14) << "incorrect value for azel[29].sid.code, expected 14, is " << last_msg_->azel[29].sid.code; - EXPECT_EQ(last_msg_->azel[29].sid.sat, 11) << "incorrect value for azel[29].sid.sat, expected 11, is " << last_msg_->azel[29].sid.sat; - EXPECT_EQ(last_msg_->azel[30].az, 59) << "incorrect value for azel[30].az, expected 59, is " << last_msg_->azel[30].az; - EXPECT_EQ(last_msg_->azel[30].el, 6) << "incorrect value for azel[30].el, expected 6, is " << last_msg_->azel[30].el; - EXPECT_EQ(last_msg_->azel[30].sid.code, 14) << "incorrect value for azel[30].sid.code, expected 14, is " << last_msg_->azel[30].sid.code; - EXPECT_EQ(last_msg_->azel[30].sid.sat, 12) << "incorrect value for azel[30].sid.sat, expected 12, is " << last_msg_->azel[30].sid.sat; - EXPECT_EQ(last_msg_->azel[31].az, 154) << "incorrect value for azel[31].az, expected 154, is " << last_msg_->azel[31].az; - EXPECT_EQ(last_msg_->azel[31].el, 4) << "incorrect value for azel[31].el, expected 4, is " << last_msg_->azel[31].el; - EXPECT_EQ(last_msg_->azel[31].sid.code, 14) << "incorrect value for azel[31].sid.code, expected 14, is " << last_msg_->azel[31].sid.code; - EXPECT_EQ(last_msg_->azel[31].sid.sat, 30) << "incorrect value for azel[31].sid.sat, expected 30, is " << last_msg_->azel[31].sid.sat; - EXPECT_EQ(last_msg_->azel[32].az, 165) << "incorrect value for azel[32].az, expected 165, is " << last_msg_->azel[32].az; - EXPECT_EQ(last_msg_->azel[32].el, 62) << "incorrect value for azel[32].el, expected 62, is " << last_msg_->azel[32].el; - EXPECT_EQ(last_msg_->azel[32].sid.code, 14) << "incorrect value for azel[32].sid.code, expected 14, is " << last_msg_->azel[32].sid.code; - EXPECT_EQ(last_msg_->azel[32].sid.sat, 36) << "incorrect value for azel[32].sid.sat, expected 36, is " << last_msg_->azel[32].sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 31183); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->azel[0].az, 160) + << "incorrect value for azel[0].az, expected 160, is " + << last_msg_->azel[0].az; + EXPECT_EQ(last_msg_->azel[0].el, 12) + << "incorrect value for azel[0].el, expected 12, is " + << last_msg_->azel[0].el; + EXPECT_EQ(last_msg_->azel[0].sid.code, 0) + << "incorrect value for azel[0].sid.code, expected 0, is " + << last_msg_->azel[0].sid.code; + EXPECT_EQ(last_msg_->azel[0].sid.sat, 8) + << "incorrect value for azel[0].sid.sat, expected 8, is " + << last_msg_->azel[0].sid.sat; + EXPECT_EQ(last_msg_->azel[1].az, 139) + << "incorrect value for azel[1].az, expected 139, is " + << last_msg_->azel[1].az; + EXPECT_EQ(last_msg_->azel[1].el, 66) + << "incorrect value for azel[1].el, expected 66, is " + << last_msg_->azel[1].el; + EXPECT_EQ(last_msg_->azel[1].sid.code, 0) + << "incorrect value for azel[1].sid.code, expected 0, is " + << last_msg_->azel[1].sid.code; + EXPECT_EQ(last_msg_->azel[1].sid.sat, 10) + << "incorrect value for azel[1].sid.sat, expected 10, is " + << last_msg_->azel[1].sid.sat; + EXPECT_EQ(last_msg_->azel[2].az, 16) + << "incorrect value for azel[2].az, expected 16, is " + << last_msg_->azel[2].az; + EXPECT_EQ(last_msg_->azel[2].el, 1) + << "incorrect value for azel[2].el, expected 1, is " + << last_msg_->azel[2].el; + EXPECT_EQ(last_msg_->azel[2].sid.code, 0) + << "incorrect value for azel[2].sid.code, expected 0, is " + << last_msg_->azel[2].sid.code; + EXPECT_EQ(last_msg_->azel[2].sid.sat, 13) + << "incorrect value for azel[2].sid.sat, expected 13, is " + << last_msg_->azel[2].sid.sat; + EXPECT_EQ(last_msg_->azel[3].az, 24) + << "incorrect value for azel[3].az, expected 24, is " + << last_msg_->azel[3].az; + EXPECT_EQ(last_msg_->azel[3].el, 25) + << "incorrect value for azel[3].el, expected 25, is " + << last_msg_->azel[3].el; + EXPECT_EQ(last_msg_->azel[3].sid.code, 0) + << "incorrect value for azel[3].sid.code, expected 0, is " + << last_msg_->azel[3].sid.code; + EXPECT_EQ(last_msg_->azel[3].sid.sat, 15) + << "incorrect value for azel[3].sid.sat, expected 15, is " + << last_msg_->azel[3].sid.sat; + EXPECT_EQ(last_msg_->azel[4].az, 127) + << "incorrect value for azel[4].az, expected 127, is " + << last_msg_->azel[4].az; + EXPECT_EQ(last_msg_->azel[4].el, 18) + << "incorrect value for azel[4].el, expected 18, is " + << last_msg_->azel[4].el; + EXPECT_EQ(last_msg_->azel[4].sid.code, 0) + << "incorrect value for azel[4].sid.code, expected 0, is " + << last_msg_->azel[4].sid.code; + EXPECT_EQ(last_msg_->azel[4].sid.sat, 16) + << "incorrect value for azel[4].sid.sat, expected 16, is " + << last_msg_->azel[4].sid.sat; + EXPECT_EQ(last_msg_->azel[5].az, 42) + << "incorrect value for azel[5].az, expected 42, is " + << last_msg_->azel[5].az; + EXPECT_EQ(last_msg_->azel[5].el, 53) + << "incorrect value for azel[5].el, expected 53, is " + << last_msg_->azel[5].el; + EXPECT_EQ(last_msg_->azel[5].sid.code, 0) + << "incorrect value for azel[5].sid.code, expected 0, is " + << last_msg_->azel[5].sid.code; + EXPECT_EQ(last_msg_->azel[5].sid.sat, 18) + << "incorrect value for azel[5].sid.sat, expected 18, is " + << last_msg_->azel[5].sid.sat; + EXPECT_EQ(last_msg_->azel[6].az, 31) + << "incorrect value for azel[6].az, expected 31, is " + << last_msg_->azel[6].az; + EXPECT_EQ(last_msg_->azel[6].el, 16) + << "incorrect value for azel[6].el, expected 16, is " + << last_msg_->azel[6].el; + EXPECT_EQ(last_msg_->azel[6].sid.code, 0) + << "incorrect value for azel[6].sid.code, expected 0, is " + << last_msg_->azel[6].sid.code; + EXPECT_EQ(last_msg_->azel[6].sid.sat, 20) + << "incorrect value for azel[6].sid.sat, expected 20, is " + << last_msg_->azel[6].sid.sat; + EXPECT_EQ(last_msg_->azel[7].az, 12) + << "incorrect value for azel[7].az, expected 12, is " + << last_msg_->azel[7].az; + EXPECT_EQ(last_msg_->azel[7].el, 67) + << "incorrect value for azel[7].el, expected 67, is " + << last_msg_->azel[7].el; + EXPECT_EQ(last_msg_->azel[7].sid.code, 0) + << "incorrect value for azel[7].sid.code, expected 0, is " + << last_msg_->azel[7].sid.code; + EXPECT_EQ(last_msg_->azel[7].sid.sat, 23) + << "incorrect value for azel[7].sid.sat, expected 23, is " + << last_msg_->azel[7].sid.sat; + EXPECT_EQ(last_msg_->azel[8].az, 47) + << "incorrect value for azel[8].az, expected 47, is " + << last_msg_->azel[8].az; + EXPECT_EQ(last_msg_->azel[8].el, 10) + << "incorrect value for azel[8].el, expected 10, is " + << last_msg_->azel[8].el; + EXPECT_EQ(last_msg_->azel[8].sid.code, 0) + << "incorrect value for azel[8].sid.code, expected 0, is " + << last_msg_->azel[8].sid.code; + EXPECT_EQ(last_msg_->azel[8].sid.sat, 24) + << "incorrect value for azel[8].sid.sat, expected 24, is " + << last_msg_->azel[8].sid.sat; + EXPECT_EQ(last_msg_->azel[9].az, 116) + << "incorrect value for azel[9].az, expected 116, is " + << last_msg_->azel[9].az; + EXPECT_EQ(last_msg_->azel[9].el, 8) + << "incorrect value for azel[9].el, expected 8, is " + << last_msg_->azel[9].el; + EXPECT_EQ(last_msg_->azel[9].sid.code, 0) + << "incorrect value for azel[9].sid.code, expected 0, is " + << last_msg_->azel[9].sid.code; + EXPECT_EQ(last_msg_->azel[9].sid.sat, 26) + << "incorrect value for azel[9].sid.sat, expected 26, is " + << last_msg_->azel[9].sid.sat; + EXPECT_EQ(last_msg_->azel[10].az, 153) + << "incorrect value for azel[10].az, expected 153, is " + << last_msg_->azel[10].az; + EXPECT_EQ(last_msg_->azel[10].el, 43) + << "incorrect value for azel[10].el, expected 43, is " + << last_msg_->azel[10].el; + EXPECT_EQ(last_msg_->azel[10].sid.code, 0) + << "incorrect value for azel[10].sid.code, expected 0, is " + << last_msg_->azel[10].sid.code; + EXPECT_EQ(last_msg_->azel[10].sid.sat, 27) + << "incorrect value for azel[10].sid.sat, expected 27, is " + << last_msg_->azel[10].sid.sat; + EXPECT_EQ(last_msg_->azel[11].az, 77) + << "incorrect value for azel[11].az, expected 77, is " + << last_msg_->azel[11].az; + EXPECT_EQ(last_msg_->azel[11].el, 10) + << "incorrect value for azel[11].el, expected 10, is " + << last_msg_->azel[11].el; + EXPECT_EQ(last_msg_->azel[11].sid.code, 0) + << "incorrect value for azel[11].sid.code, expected 0, is " + << last_msg_->azel[11].sid.code; + EXPECT_EQ(last_msg_->azel[11].sid.sat, 29) + << "incorrect value for azel[11].sid.sat, expected 29, is " + << last_msg_->azel[11].sid.sat; + EXPECT_EQ(last_msg_->azel[12].az, 94) + << "incorrect value for azel[12].az, expected 94, is " + << last_msg_->azel[12].az; + EXPECT_EQ(last_msg_->azel[12].el, 26) + << "incorrect value for azel[12].el, expected 26, is " + << last_msg_->azel[12].el; + EXPECT_EQ(last_msg_->azel[12].sid.code, 0) + << "incorrect value for azel[12].sid.code, expected 0, is " + << last_msg_->azel[12].sid.code; + EXPECT_EQ(last_msg_->azel[12].sid.sat, 32) + << "incorrect value for azel[12].sid.sat, expected 32, is " + << last_msg_->azel[12].sid.sat; + EXPECT_EQ(last_msg_->azel[13].az, 16) + << "incorrect value for azel[13].az, expected 16, is " + << last_msg_->azel[13].az; + EXPECT_EQ(last_msg_->azel[13].el, 58) + << "incorrect value for azel[13].el, expected 58, is " + << last_msg_->azel[13].el; + EXPECT_EQ(last_msg_->azel[13].sid.code, 3) + << "incorrect value for azel[13].sid.code, expected 3, is " + << last_msg_->azel[13].sid.code; + EXPECT_EQ(last_msg_->azel[13].sid.sat, 1) + << "incorrect value for azel[13].sid.sat, expected 1, is " + << last_msg_->azel[13].sid.sat; + EXPECT_EQ(last_msg_->azel[14].az, 108) + << "incorrect value for azel[14].az, expected 108, is " + << last_msg_->azel[14].az; + EXPECT_EQ(last_msg_->azel[14].el, 53) + << "incorrect value for azel[14].el, expected 53, is " + << last_msg_->azel[14].el; + EXPECT_EQ(last_msg_->azel[14].sid.code, 3) + << "incorrect value for azel[14].sid.code, expected 3, is " + << last_msg_->azel[14].sid.code; + EXPECT_EQ(last_msg_->azel[14].sid.sat, 2) + << "incorrect value for azel[14].sid.sat, expected 2, is " + << last_msg_->azel[14].sid.sat; + EXPECT_EQ(last_msg_->azel[15].az, 17) + << "incorrect value for azel[15].az, expected 17, is " + << last_msg_->azel[15].az; + EXPECT_EQ(last_msg_->azel[15].el, 13) + << "incorrect value for azel[15].el, expected 13, is " + << last_msg_->azel[15].el; + EXPECT_EQ(last_msg_->azel[15].sid.code, 3) + << "incorrect value for azel[15].sid.code, expected 3, is " + << last_msg_->azel[15].sid.code; + EXPECT_EQ(last_msg_->azel[15].sid.sat, 8) + << "incorrect value for azel[15].sid.sat, expected 8, is " + << last_msg_->azel[15].sid.sat; + EXPECT_EQ(last_msg_->azel[16].az, 165) + << "incorrect value for azel[16].az, expected 165, is " + << last_msg_->azel[16].az; + EXPECT_EQ(last_msg_->azel[16].el, 40) + << "incorrect value for azel[16].el, expected 40, is " + << last_msg_->azel[16].el; + EXPECT_EQ(last_msg_->azel[16].sid.code, 3) + << "incorrect value for azel[16].sid.code, expected 3, is " + << last_msg_->azel[16].sid.code; + EXPECT_EQ(last_msg_->azel[16].sid.sat, 17) + << "incorrect value for azel[16].sid.sat, expected 17, is " + << last_msg_->azel[16].sid.sat; + EXPECT_EQ(last_msg_->azel[17].az, 63) + << "incorrect value for azel[17].az, expected 63, is " + << last_msg_->azel[17].az; + EXPECT_EQ(last_msg_->azel[17].el, 35) + << "incorrect value for azel[17].el, expected 35, is " + << last_msg_->azel[17].el; + EXPECT_EQ(last_msg_->azel[17].sid.code, 3) + << "incorrect value for azel[17].sid.code, expected 3, is " + << last_msg_->azel[17].sid.code; + EXPECT_EQ(last_msg_->azel[17].sid.sat, 23) + << "incorrect value for azel[17].sid.sat, expected 23, is " + << last_msg_->azel[17].sid.sat; + EXPECT_EQ(last_msg_->azel[18].az, 41) + << "incorrect value for azel[18].az, expected 41, is " + << last_msg_->azel[18].az; + EXPECT_EQ(last_msg_->azel[18].el, 73) + << "incorrect value for azel[18].el, expected 73, is " + << last_msg_->azel[18].el; + EXPECT_EQ(last_msg_->azel[18].sid.code, 3) + << "incorrect value for azel[18].sid.code, expected 3, is " + << last_msg_->azel[18].sid.code; + EXPECT_EQ(last_msg_->azel[18].sid.sat, 24) + << "incorrect value for azel[18].sid.sat, expected 24, is " + << last_msg_->azel[18].sid.sat; + EXPECT_EQ(last_msg_->azel[19].az, 114) + << "incorrect value for azel[19].az, expected 114, is " + << last_msg_->azel[19].az; + EXPECT_EQ(last_msg_->azel[19].el, 26) + << "incorrect value for azel[19].el, expected 26, is " + << last_msg_->azel[19].el; + EXPECT_EQ(last_msg_->azel[19].sid.code, 12) + << "incorrect value for azel[19].sid.code, expected 12, is " + << last_msg_->azel[19].sid.code; + EXPECT_EQ(last_msg_->azel[19].sid.sat, 20) + << "incorrect value for azel[19].sid.sat, expected 20, is " + << last_msg_->azel[19].sid.sat; + EXPECT_EQ(last_msg_->azel[20].az, 72) + << "incorrect value for azel[20].az, expected 72, is " + << last_msg_->azel[20].az; + EXPECT_EQ(last_msg_->azel[20].el, 54) + << "incorrect value for azel[20].el, expected 54, is " + << last_msg_->azel[20].el; + EXPECT_EQ(last_msg_->azel[20].sid.code, 12) + << "incorrect value for azel[20].sid.code, expected 12, is " + << last_msg_->azel[20].sid.code; + EXPECT_EQ(last_msg_->azel[20].sid.sat, 27) + << "incorrect value for azel[20].sid.sat, expected 27, is " + << last_msg_->azel[20].sid.sat; + EXPECT_EQ(last_msg_->azel[21].az, 69) + << "incorrect value for azel[21].az, expected 69, is " + << last_msg_->azel[21].az; + EXPECT_EQ(last_msg_->azel[21].el, 3) + << "incorrect value for azel[21].el, expected 3, is " + << last_msg_->azel[21].el; + EXPECT_EQ(last_msg_->azel[21].sid.code, 12) + << "incorrect value for azel[21].sid.code, expected 12, is " + << last_msg_->azel[21].sid.code; + EXPECT_EQ(last_msg_->azel[21].sid.sat, 28) + << "incorrect value for azel[21].sid.sat, expected 28, is " + << last_msg_->azel[21].sid.sat; + EXPECT_EQ(last_msg_->azel[22].az, 158) + << "incorrect value for azel[22].az, expected 158, is " + << last_msg_->azel[22].az; + EXPECT_EQ(last_msg_->azel[22].el, 14) + << "incorrect value for azel[22].el, expected 14, is " + << last_msg_->azel[22].el; + EXPECT_EQ(last_msg_->azel[22].sid.code, 12) + << "incorrect value for azel[22].sid.code, expected 12, is " + << last_msg_->azel[22].sid.code; + EXPECT_EQ(last_msg_->azel[22].sid.sat, 29) + << "incorrect value for azel[22].sid.sat, expected 29, is " + << last_msg_->azel[22].sid.sat; + EXPECT_EQ(last_msg_->azel[23].az, 152) + << "incorrect value for azel[23].az, expected 152, is " + << last_msg_->azel[23].az; + EXPECT_EQ(last_msg_->azel[23].el, 68) + << "incorrect value for azel[23].el, expected 68, is " + << last_msg_->azel[23].el; + EXPECT_EQ(last_msg_->azel[23].sid.code, 12) + << "incorrect value for azel[23].sid.code, expected 12, is " + << last_msg_->azel[23].sid.code; + EXPECT_EQ(last_msg_->azel[23].sid.sat, 30) + << "incorrect value for azel[23].sid.sat, expected 30, is " + << last_msg_->azel[23].sid.sat; + EXPECT_EQ(last_msg_->azel[24].az, 120) + << "incorrect value for azel[24].az, expected 120, is " + << last_msg_->azel[24].az; + EXPECT_EQ(last_msg_->azel[24].el, 82) + << "incorrect value for azel[24].el, expected 82, is " + << last_msg_->azel[24].el; + EXPECT_EQ(last_msg_->azel[24].sid.code, 12) + << "incorrect value for azel[24].sid.code, expected 12, is " + << last_msg_->azel[24].sid.code; + EXPECT_EQ(last_msg_->azel[24].sid.sat, 32) + << "incorrect value for azel[24].sid.sat, expected 32, is " + << last_msg_->azel[24].sid.sat; + EXPECT_EQ(last_msg_->azel[25].az, 131) + << "incorrect value for azel[25].az, expected 131, is " + << last_msg_->azel[25].az; + EXPECT_EQ(last_msg_->azel[25].el, 6) + << "incorrect value for azel[25].el, expected 6, is " + << last_msg_->azel[25].el; + EXPECT_EQ(last_msg_->azel[25].sid.code, 14) + << "incorrect value for azel[25].sid.code, expected 14, is " + << last_msg_->azel[25].sid.code; + EXPECT_EQ(last_msg_->azel[25].sid.sat, 2) + << "incorrect value for azel[25].sid.sat, expected 2, is " + << last_msg_->azel[25].sid.sat; + EXPECT_EQ(last_msg_->azel[26].az, 27) + << "incorrect value for azel[26].az, expected 27, is " + << last_msg_->azel[26].az; + EXPECT_EQ(last_msg_->azel[26].el, 44) + << "incorrect value for azel[26].el, expected 44, is " + << last_msg_->azel[26].el; + EXPECT_EQ(last_msg_->azel[26].sid.code, 14) + << "incorrect value for azel[26].sid.code, expected 14, is " + << last_msg_->azel[26].sid.code; + EXPECT_EQ(last_msg_->azel[26].sid.sat, 4) + << "incorrect value for azel[26].sid.sat, expected 4, is " + << last_msg_->azel[26].sid.sat; + EXPECT_EQ(last_msg_->azel[27].az, 101) + << "incorrect value for azel[27].az, expected 101, is " + << last_msg_->azel[27].az; + EXPECT_EQ(last_msg_->azel[27].el, 21) + << "incorrect value for azel[27].el, expected 21, is " + << last_msg_->azel[27].el; + EXPECT_EQ(last_msg_->azel[27].sid.code, 14) + << "incorrect value for azel[27].sid.code, expected 14, is " + << last_msg_->azel[27].sid.code; + EXPECT_EQ(last_msg_->azel[27].sid.sat, 5) + << "incorrect value for azel[27].sid.sat, expected 5, is " + << last_msg_->azel[27].sid.sat; + EXPECT_EQ(last_msg_->azel[28].az, 81) + << "incorrect value for azel[28].az, expected 81, is " + << last_msg_->azel[28].az; + EXPECT_EQ(last_msg_->azel[28].el, 65) + << "incorrect value for azel[28].el, expected 65, is " + << last_msg_->azel[28].el; + EXPECT_EQ(last_msg_->azel[28].sid.code, 14) + << "incorrect value for azel[28].sid.code, expected 14, is " + << last_msg_->azel[28].sid.code; + EXPECT_EQ(last_msg_->azel[28].sid.sat, 9) + << "incorrect value for azel[28].sid.sat, expected 9, is " + << last_msg_->azel[28].sid.sat; + EXPECT_EQ(last_msg_->azel[29].az, 49) + << "incorrect value for azel[29].az, expected 49, is " + << last_msg_->azel[29].az; + EXPECT_EQ(last_msg_->azel[29].el, 56) + << "incorrect value for azel[29].el, expected 56, is " + << last_msg_->azel[29].el; + EXPECT_EQ(last_msg_->azel[29].sid.code, 14) + << "incorrect value for azel[29].sid.code, expected 14, is " + << last_msg_->azel[29].sid.code; + EXPECT_EQ(last_msg_->azel[29].sid.sat, 11) + << "incorrect value for azel[29].sid.sat, expected 11, is " + << last_msg_->azel[29].sid.sat; + EXPECT_EQ(last_msg_->azel[30].az, 59) + << "incorrect value for azel[30].az, expected 59, is " + << last_msg_->azel[30].az; + EXPECT_EQ(last_msg_->azel[30].el, 6) + << "incorrect value for azel[30].el, expected 6, is " + << last_msg_->azel[30].el; + EXPECT_EQ(last_msg_->azel[30].sid.code, 14) + << "incorrect value for azel[30].sid.code, expected 14, is " + << last_msg_->azel[30].sid.code; + EXPECT_EQ(last_msg_->azel[30].sid.sat, 12) + << "incorrect value for azel[30].sid.sat, expected 12, is " + << last_msg_->azel[30].sid.sat; + EXPECT_EQ(last_msg_->azel[31].az, 154) + << "incorrect value for azel[31].az, expected 154, is " + << last_msg_->azel[31].az; + EXPECT_EQ(last_msg_->azel[31].el, 4) + << "incorrect value for azel[31].el, expected 4, is " + << last_msg_->azel[31].el; + EXPECT_EQ(last_msg_->azel[31].sid.code, 14) + << "incorrect value for azel[31].sid.code, expected 14, is " + << last_msg_->azel[31].sid.code; + EXPECT_EQ(last_msg_->azel[31].sid.sat, 30) + << "incorrect value for azel[31].sid.sat, expected 30, is " + << last_msg_->azel[31].sid.sat; + EXPECT_EQ(last_msg_->azel[32].az, 165) + << "incorrect value for azel[32].az, expected 165, is " + << last_msg_->azel[32].az; + EXPECT_EQ(last_msg_->azel[32].el, 62) + << "incorrect value for azel[32].el, expected 62, is " + << last_msg_->azel[32].el; + EXPECT_EQ(last_msg_->azel[32].sid.code, 14) + << "incorrect value for azel[32].sid.code, expected 14, is " + << last_msg_->azel[32].sid.code; + EXPECT_EQ(last_msg_->azel[32].sid.sat, 36) + << "incorrect value for azel[32].sid.sat, expected 36, is " + << last_msg_->azel[32].sid.sat; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_MsgSvConfigurationGpsDep.cc b/c/test/legacy/cpp/auto_check_sbp_observation_MsgSvConfigurationGpsDep.cc index 5cd08b673..f5ae340e2 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_MsgSvConfigurationGpsDep.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_MsgSvConfigurationGpsDep.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvConfigurationGpsDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_MsgSvConfigurationGpsDep.yaml +// by generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_sv_configuration_gps_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_sv_configuration_gps_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,39 +82,46 @@ class Test_legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_sv_configuration_gps_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep0, Test) -{ +}; - uint8_t encoded_frame[] = {85,145,0,123,0,10,0,0,0,0,0,0,66,188,101,167,18,42, }; +TEST_F(Test_legacy_auto_check_sbp_observation_MsgSvConfigurationGpsDep0, Test) { + uint8_t encoded_frame[] = { + 85, 145, 0, 123, 0, 10, 0, 0, 0, 0, 0, 0, 66, 188, 101, 167, 18, 42, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_sv_configuration_gps_dep_t* test_msg = ( msg_sv_configuration_gps_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->l2c_mask = 2808462402; - test_msg->t_nmct.tow = 0; - test_msg->t_nmct.wn = 0; - - EXPECT_EQ(send_message( 0x91, 123, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_sv_configuration_gps_dep_t *test_msg = + (msg_sv_configuration_gps_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->l2c_mask = 2808462402; + test_msg->t_nmct.tow = 0; + test_msg->t_nmct.wn = 0; + + EXPECT_EQ(send_message(0x91, 123, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->l2c_mask, 2808462402) << "incorrect value for l2c_mask, expected 2808462402, is " << last_msg_->l2c_mask; - EXPECT_EQ(last_msg_->t_nmct.tow, 0) << "incorrect value for t_nmct.tow, expected 0, is " << last_msg_->t_nmct.tow; - EXPECT_EQ(last_msg_->t_nmct.wn, 0) << "incorrect value for t_nmct.wn, expected 0, is " << last_msg_->t_nmct.wn; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->l2c_mask, 2808462402) + << "incorrect value for l2c_mask, expected 2808462402, is " + << last_msg_->l2c_mask; + EXPECT_EQ(last_msg_->t_nmct.tow, 0) + << "incorrect value for t_nmct.tow, expected 0, is " + << last_msg_->t_nmct.tow; + EXPECT_EQ(last_msg_->t_nmct.wn, 0) + << "incorrect value for t_nmct.wn, expected 0, is " + << last_msg_->t_nmct.wn; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_msgEphemerisDepB.cc b/c/test/legacy/cpp/auto_check_sbp_observation_msgEphemerisDepB.cc index 36cc6e6c4..eaf3a2332 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_msgEphemerisDepB.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_msgEphemerisDepB.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_msgEphemerisDepB0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_msgEphemerisDepB0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,138 +81,187 @@ class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_msgEphemerisDepB0, Test) -{ - - uint8_t encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,60,190,0,0,0,0,0,186,82,192,0,0,0,0,0,76,109,64,0,0,0,0,0,132,208,190,0,0,0,0,0,254,220,62,0,0,0,0,0,0,113,62,0,0,0,0,0,0,133,190,28,36,25,81,223,254,52,62,220,116,216,39,33,189,3,64,0,0,0,156,177,204,134,63,0,0,160,220,182,33,180,64,152,225,192,44,254,76,238,191,41,150,24,2,148,156,65,190,252,90,119,48,15,215,240,63,124,127,115,94,208,16,238,63,165,115,52,74,97,167,246,189,0,0,0,0,192,180,229,190,0,0,0,0,0,0,112,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,3,0,225,156, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_dep_b_t* test_msg = ( msg_ephemeris_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = -1.035025343298912e-05; - test_msg->af1 = -9.094947017729282e-13; - test_msg->af2 = 0.0; - test_msg->c_ic = 6.332993507385254e-08; - test_msg->c_is = -1.564621925354004e-07; - test_msg->c_rc = 234.375; - test_msg->c_rs = -74.90625; - test_msg->c_uc = -3.937631845474243e-06; - test_msg->c_us = 6.9122761487960815e-06; - test_msg->dn = 4.8884179079418005e-09; - test_msg->ecc = 0.011132609914056957; - test_msg->healthy = 1; - test_msg->inc = 0.9395524830579087; - test_msg->inc_dot = -3.296565886629854e-10; - test_msg->iode = 0; - test_msg->m0 = 2.467348395627239; - test_msg->omega0 = -0.9468985437479658; - test_msg->omegadot = -8.201055892610478e-09; - test_msg->prn = 3; - test_msg->sqrta = 5153.714303970337; - test_msg->tgd = -6.51925802230835e-09; - test_msg->toc_tow = 410400.0; - test_msg->toc_wn = 1838; - test_msg->toe_tow = 410400.0; - test_msg->toe_wn = 1838; - test_msg->valid = 1; - test_msg->w = 1.0525047200405302; - - EXPECT_EQ(send_message( 0x46, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - -1.0350253433e-05*100), 0.05) << "incorrect value for af0, expected -1.0350253433e-05, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - -9.09494701773e-13*100), 0.05) << "incorrect value for af1, expected -9.09494701773e-13, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - 0.0*100), 0.05) << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; - EXPECT_LT((last_msg_->c_ic*100 - 6.33299350739e-08*100), 0.05) << "incorrect value for c_ic, expected 6.33299350739e-08, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - -1.56462192535e-07*100), 0.05) << "incorrect value for c_is, expected -1.56462192535e-07, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - 234.375*100), 0.05) << "incorrect value for c_rc, expected 234.375, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - -74.90625*100), 0.05) << "incorrect value for c_rs, expected -74.90625, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - -3.93763184547e-06*100), 0.05) << "incorrect value for c_uc, expected -3.93763184547e-06, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 6.9122761488e-06*100), 0.05) << "incorrect value for c_us, expected 6.9122761488e-06, is " << last_msg_->c_us; - EXPECT_LT((last_msg_->dn*100 - 4.88841790794e-09*100), 0.05) << "incorrect value for dn, expected 4.88841790794e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.0111326099141*100), 0.05) << "incorrect value for ecc, expected 0.0111326099141, is " << last_msg_->ecc; - EXPECT_EQ(last_msg_->healthy, 1) << "incorrect value for healthy, expected 1, is " << last_msg_->healthy; - EXPECT_LT((last_msg_->inc*100 - 0.939552483058*100), 0.05) << "incorrect value for inc, expected 0.939552483058, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - -3.29656588663e-10*100), 0.05) << "incorrect value for inc_dot, expected -3.29656588663e-10, is " << last_msg_->inc_dot; - EXPECT_EQ(last_msg_->iode, 0) << "incorrect value for iode, expected 0, is " << last_msg_->iode; - EXPECT_LT((last_msg_->m0*100 - 2.46734839563*100), 0.05) << "incorrect value for m0, expected 2.46734839563, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - -0.946898543748*100), 0.05) << "incorrect value for omega0, expected -0.946898543748, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -8.20105589261e-09*100), 0.05) << "incorrect value for omegadot, expected -8.20105589261e-09, is " << last_msg_->omegadot; - EXPECT_EQ(last_msg_->prn, 3) << "incorrect value for prn, expected 3, is " << last_msg_->prn; - EXPECT_LT((last_msg_->sqrta*100 - 5153.71430397*100), 0.05) << "incorrect value for sqrta, expected 5153.71430397, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->tgd*100 - -6.51925802231e-09*100), 0.05) << "incorrect value for tgd, expected -6.51925802231e-09, is " << last_msg_->tgd; - EXPECT_LT((last_msg_->toc_tow*100 - 410400.0*100), 0.05) << "incorrect value for toc_tow, expected 410400.0, is " << last_msg_->toc_tow; - EXPECT_EQ(last_msg_->toc_wn, 1838) << "incorrect value for toc_wn, expected 1838, is " << last_msg_->toc_wn; - EXPECT_LT((last_msg_->toe_tow*100 - 410400.0*100), 0.05) << "incorrect value for toe_tow, expected 410400.0, is " << last_msg_->toe_tow; - EXPECT_EQ(last_msg_->toe_wn, 1838) << "incorrect value for toe_wn, expected 1838, is " << last_msg_->toe_wn; - EXPECT_EQ(last_msg_->valid, 1) << "incorrect value for valid, expected 1, is " << last_msg_->valid; - EXPECT_LT((last_msg_->w*100 - 1.05250472004*100), 0.05) << "incorrect value for w, expected 1.05250472004, is " << last_msg_->w; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_msgEphemerisDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 60, 190, 0, + 0, 0, 0, 0, 186, 82, 192, 0, 0, 0, 0, 0, 76, 109, 64, + 0, 0, 0, 0, 0, 132, 208, 190, 0, 0, 0, 0, 0, 254, 220, + 62, 0, 0, 0, 0, 0, 0, 113, 62, 0, 0, 0, 0, 0, 0, + 133, 190, 28, 36, 25, 81, 223, 254, 52, 62, 220, 116, 216, 39, 33, + 189, 3, 64, 0, 0, 0, 156, 177, 204, 134, 63, 0, 0, 160, 220, + 182, 33, 180, 64, 152, 225, 192, 44, 254, 76, 238, 191, 41, 150, 24, + 2, 148, 156, 65, 190, 252, 90, 119, 48, 15, 215, 240, 63, 124, 127, + 115, 94, 208, 16, 238, 63, 165, 115, 52, 74, 97, 167, 246, 189, 0, + 0, 0, 0, 192, 180, 229, 190, 0, 0, 0, 0, 0, 0, 112, 189, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, + 65, 46, 7, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, + 3, 0, 225, 156, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_dep_b_t *test_msg = (msg_ephemeris_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = -1.035025343298912e-05; + test_msg->af1 = -9.094947017729282e-13; + test_msg->af2 = 0.0; + test_msg->c_ic = 6.332993507385254e-08; + test_msg->c_is = -1.564621925354004e-07; + test_msg->c_rc = 234.375; + test_msg->c_rs = -74.90625; + test_msg->c_uc = -3.937631845474243e-06; + test_msg->c_us = 6.9122761487960815e-06; + test_msg->dn = 4.8884179079418005e-09; + test_msg->ecc = 0.011132609914056957; + test_msg->healthy = 1; + test_msg->inc = 0.9395524830579087; + test_msg->inc_dot = -3.296565886629854e-10; + test_msg->iode = 0; + test_msg->m0 = 2.467348395627239; + test_msg->omega0 = -0.9468985437479658; + test_msg->omegadot = -8.201055892610478e-09; + test_msg->prn = 3; + test_msg->sqrta = 5153.714303970337; + test_msg->tgd = -6.51925802230835e-09; + test_msg->toc_tow = 410400.0; + test_msg->toc_wn = 1838; + test_msg->toe_tow = 410400.0; + test_msg->toe_wn = 1838; + test_msg->valid = 1; + test_msg->w = 1.0525047200405302; + + EXPECT_EQ(send_message(0x46, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - -1.0350253433e-05 * 100), 0.05) + << "incorrect value for af0, expected -1.0350253433e-05, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - -9.09494701773e-13 * 100), 0.05) + << "incorrect value for af1, expected -9.09494701773e-13, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; + EXPECT_LT((last_msg_->c_ic * 100 - 6.33299350739e-08 * 100), 0.05) + << "incorrect value for c_ic, expected 6.33299350739e-08, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - -1.56462192535e-07 * 100), 0.05) + << "incorrect value for c_is, expected -1.56462192535e-07, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - 234.375 * 100), 0.05) + << "incorrect value for c_rc, expected 234.375, is " << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - -74.90625 * 100), 0.05) + << "incorrect value for c_rs, expected -74.90625, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - -3.93763184547e-06 * 100), 0.05) + << "incorrect value for c_uc, expected -3.93763184547e-06, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 6.9122761488e-06 * 100), 0.05) + << "incorrect value for c_us, expected 6.9122761488e-06, is " + << last_msg_->c_us; + EXPECT_LT((last_msg_->dn * 100 - 4.88841790794e-09 * 100), 0.05) + << "incorrect value for dn, expected 4.88841790794e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.0111326099141 * 100), 0.05) + << "incorrect value for ecc, expected 0.0111326099141, is " + << last_msg_->ecc; + EXPECT_EQ(last_msg_->healthy, 1) + << "incorrect value for healthy, expected 1, is " << last_msg_->healthy; + EXPECT_LT((last_msg_->inc * 100 - 0.939552483058 * 100), 0.05) + << "incorrect value for inc, expected 0.939552483058, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - -3.29656588663e-10 * 100), 0.05) + << "incorrect value for inc_dot, expected -3.29656588663e-10, is " + << last_msg_->inc_dot; + EXPECT_EQ(last_msg_->iode, 0) + << "incorrect value for iode, expected 0, is " << last_msg_->iode; + EXPECT_LT((last_msg_->m0 * 100 - 2.46734839563 * 100), 0.05) + << "incorrect value for m0, expected 2.46734839563, is " << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - -0.946898543748 * 100), 0.05) + << "incorrect value for omega0, expected -0.946898543748, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -8.20105589261e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -8.20105589261e-09, is " + << last_msg_->omegadot; + EXPECT_EQ(last_msg_->prn, 3) + << "incorrect value for prn, expected 3, is " << last_msg_->prn; + EXPECT_LT((last_msg_->sqrta * 100 - 5153.71430397 * 100), 0.05) + << "incorrect value for sqrta, expected 5153.71430397, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->tgd * 100 - -6.51925802231e-09 * 100), 0.05) + << "incorrect value for tgd, expected -6.51925802231e-09, is " + << last_msg_->tgd; + EXPECT_LT((last_msg_->toc_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for toc_tow, expected 410400.0, is " + << last_msg_->toc_tow; + EXPECT_EQ(last_msg_->toc_wn, 1838) + << "incorrect value for toc_wn, expected 1838, is " << last_msg_->toc_wn; + EXPECT_LT((last_msg_->toe_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for toe_tow, expected 410400.0, is " + << last_msg_->toe_tow; + EXPECT_EQ(last_msg_->toe_wn, 1838) + << "incorrect value for toe_wn, expected 1838, is " << last_msg_->toe_wn; + EXPECT_EQ(last_msg_->valid, 1) + << "incorrect value for valid, expected 1, is " << last_msg_->valid; + EXPECT_LT((last_msg_->w * 100 - 1.05250472004 * 100), 0.05) + << "incorrect value for w, expected 1.05250472004, is " << last_msg_->w; } -class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_msgEphemerisDepB1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_msgEphemerisDepB1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -226,138 +271,188 @@ class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_msgEphemerisDepB1, Test) -{ - - uint8_t encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,68,190,0,0,0,0,0,72,66,64,0,0,0,0,128,188,115,64,0,0,0,0,0,80,193,62,0,0,0,0,0,164,204,62,0,0,0,0,0,0,130,62,0,0,0,0,0,0,128,62,72,181,127,6,208,225,52,62,158,174,129,91,27,105,249,191,0,0,0,96,204,57,128,63,0,0,160,35,146,33,180,64,247,169,1,36,133,206,243,63,79,11,109,92,156,208,65,190,103,78,3,253,223,147,255,191,164,214,90,250,218,240,238,63,94,239,187,37,36,10,242,61,0,0,0,0,176,91,19,63,0,0,0,0,0,0,137,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,13,0,180,21, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_dep_b_t* test_msg = ( msg_ephemeris_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = 7.384549826383591e-05; - test_msg->af1 = -2.8421709430404007e-12; - test_msg->af2 = 0.0; - test_msg->c_ic = 1.341104507446289e-07; - test_msg->c_is = 1.1920928955078125e-07; - test_msg->c_rc = 315.78125; - test_msg->c_rs = 36.5625; - test_msg->c_uc = 2.0638108253479004e-06; - test_msg->c_us = 3.4142285585403442e-06; - test_msg->dn = 4.86198823561129e-09; - test_msg->ecc = 0.007922741584479809; - test_msg->healthy = 1; - test_msg->inc = 0.9669012918227122; - test_msg->inc_dot = 2.6251093463412166e-10; - test_msg->iode = 0; - test_msg->m0 = -1.588160855720083; - test_msg->omega0 = 1.237919941568746; - test_msg->omegadot = -8.295702692172441e-09; - test_msg->prn = 13; - test_msg->sqrta = 5153.57085609436; - test_msg->tgd = -9.313225746154785e-09; - test_msg->toc_tow = 410400.0; - test_msg->toc_wn = 1838; - test_msg->toe_tow = 410400.0; - test_msg->toe_wn = 1838; - test_msg->valid = 1; - test_msg->w = -1.9736022837941165; - - EXPECT_EQ(send_message( 0x46, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - 7.38454982638e-05*100), 0.05) << "incorrect value for af0, expected 7.38454982638e-05, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - -2.84217094304e-12*100), 0.05) << "incorrect value for af1, expected -2.84217094304e-12, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - 0.0*100), 0.05) << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; - EXPECT_LT((last_msg_->c_ic*100 - 1.34110450745e-07*100), 0.05) << "incorrect value for c_ic, expected 1.34110450745e-07, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - 1.19209289551e-07*100), 0.05) << "incorrect value for c_is, expected 1.19209289551e-07, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - 315.78125*100), 0.05) << "incorrect value for c_rc, expected 315.78125, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - 36.5625*100), 0.05) << "incorrect value for c_rs, expected 36.5625, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - 2.06381082535e-06*100), 0.05) << "incorrect value for c_uc, expected 2.06381082535e-06, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 3.41422855854e-06*100), 0.05) << "incorrect value for c_us, expected 3.41422855854e-06, is " << last_msg_->c_us; - EXPECT_LT((last_msg_->dn*100 - 4.86198823561e-09*100), 0.05) << "incorrect value for dn, expected 4.86198823561e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.00792274158448*100), 0.05) << "incorrect value for ecc, expected 0.00792274158448, is " << last_msg_->ecc; - EXPECT_EQ(last_msg_->healthy, 1) << "incorrect value for healthy, expected 1, is " << last_msg_->healthy; - EXPECT_LT((last_msg_->inc*100 - 0.966901291823*100), 0.05) << "incorrect value for inc, expected 0.966901291823, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - 2.62510934634e-10*100), 0.05) << "incorrect value for inc_dot, expected 2.62510934634e-10, is " << last_msg_->inc_dot; - EXPECT_EQ(last_msg_->iode, 0) << "incorrect value for iode, expected 0, is " << last_msg_->iode; - EXPECT_LT((last_msg_->m0*100 - -1.58816085572*100), 0.05) << "incorrect value for m0, expected -1.58816085572, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - 1.23791994157*100), 0.05) << "incorrect value for omega0, expected 1.23791994157, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -8.29570269217e-09*100), 0.05) << "incorrect value for omegadot, expected -8.29570269217e-09, is " << last_msg_->omegadot; - EXPECT_EQ(last_msg_->prn, 13) << "incorrect value for prn, expected 13, is " << last_msg_->prn; - EXPECT_LT((last_msg_->sqrta*100 - 5153.57085609*100), 0.05) << "incorrect value for sqrta, expected 5153.57085609, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->tgd*100 - -9.31322574615e-09*100), 0.05) << "incorrect value for tgd, expected -9.31322574615e-09, is " << last_msg_->tgd; - EXPECT_LT((last_msg_->toc_tow*100 - 410400.0*100), 0.05) << "incorrect value for toc_tow, expected 410400.0, is " << last_msg_->toc_tow; - EXPECT_EQ(last_msg_->toc_wn, 1838) << "incorrect value for toc_wn, expected 1838, is " << last_msg_->toc_wn; - EXPECT_LT((last_msg_->toe_tow*100 - 410400.0*100), 0.05) << "incorrect value for toe_tow, expected 410400.0, is " << last_msg_->toe_tow; - EXPECT_EQ(last_msg_->toe_wn, 1838) << "incorrect value for toe_wn, expected 1838, is " << last_msg_->toe_wn; - EXPECT_EQ(last_msg_->valid, 1) << "incorrect value for valid, expected 1, is " << last_msg_->valid; - EXPECT_LT((last_msg_->w*100 - -1.97360228379*100), 0.05) << "incorrect value for w, expected -1.97360228379, is " << last_msg_->w; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_msgEphemerisDepB1, Test) { + uint8_t encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 68, 190, 0, + 0, 0, 0, 0, 72, 66, 64, 0, 0, 0, 0, 128, 188, 115, 64, + 0, 0, 0, 0, 0, 80, 193, 62, 0, 0, 0, 0, 0, 164, 204, + 62, 0, 0, 0, 0, 0, 0, 130, 62, 0, 0, 0, 0, 0, 0, + 128, 62, 72, 181, 127, 6, 208, 225, 52, 62, 158, 174, 129, 91, 27, + 105, 249, 191, 0, 0, 0, 96, 204, 57, 128, 63, 0, 0, 160, 35, + 146, 33, 180, 64, 247, 169, 1, 36, 133, 206, 243, 63, 79, 11, 109, + 92, 156, 208, 65, 190, 103, 78, 3, 253, 223, 147, 255, 191, 164, 214, + 90, 250, 218, 240, 238, 63, 94, 239, 187, 37, 36, 10, 242, 61, 0, + 0, 0, 0, 176, 91, 19, 63, 0, 0, 0, 0, 0, 0, 137, 189, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, + 65, 46, 7, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, + 13, 0, 180, 21, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_dep_b_t *test_msg = (msg_ephemeris_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = 7.384549826383591e-05; + test_msg->af1 = -2.8421709430404007e-12; + test_msg->af2 = 0.0; + test_msg->c_ic = 1.341104507446289e-07; + test_msg->c_is = 1.1920928955078125e-07; + test_msg->c_rc = 315.78125; + test_msg->c_rs = 36.5625; + test_msg->c_uc = 2.0638108253479004e-06; + test_msg->c_us = 3.4142285585403442e-06; + test_msg->dn = 4.86198823561129e-09; + test_msg->ecc = 0.007922741584479809; + test_msg->healthy = 1; + test_msg->inc = 0.9669012918227122; + test_msg->inc_dot = 2.6251093463412166e-10; + test_msg->iode = 0; + test_msg->m0 = -1.588160855720083; + test_msg->omega0 = 1.237919941568746; + test_msg->omegadot = -8.295702692172441e-09; + test_msg->prn = 13; + test_msg->sqrta = 5153.57085609436; + test_msg->tgd = -9.313225746154785e-09; + test_msg->toc_tow = 410400.0; + test_msg->toc_wn = 1838; + test_msg->toe_tow = 410400.0; + test_msg->toe_wn = 1838; + test_msg->valid = 1; + test_msg->w = -1.9736022837941165; + + EXPECT_EQ(send_message(0x46, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - 7.38454982638e-05 * 100), 0.05) + << "incorrect value for af0, expected 7.38454982638e-05, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - -2.84217094304e-12 * 100), 0.05) + << "incorrect value for af1, expected -2.84217094304e-12, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; + EXPECT_LT((last_msg_->c_ic * 100 - 1.34110450745e-07 * 100), 0.05) + << "incorrect value for c_ic, expected 1.34110450745e-07, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - 1.19209289551e-07 * 100), 0.05) + << "incorrect value for c_is, expected 1.19209289551e-07, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - 315.78125 * 100), 0.05) + << "incorrect value for c_rc, expected 315.78125, is " << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - 36.5625 * 100), 0.05) + << "incorrect value for c_rs, expected 36.5625, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - 2.06381082535e-06 * 100), 0.05) + << "incorrect value for c_uc, expected 2.06381082535e-06, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 3.41422855854e-06 * 100), 0.05) + << "incorrect value for c_us, expected 3.41422855854e-06, is " + << last_msg_->c_us; + EXPECT_LT((last_msg_->dn * 100 - 4.86198823561e-09 * 100), 0.05) + << "incorrect value for dn, expected 4.86198823561e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.00792274158448 * 100), 0.05) + << "incorrect value for ecc, expected 0.00792274158448, is " + << last_msg_->ecc; + EXPECT_EQ(last_msg_->healthy, 1) + << "incorrect value for healthy, expected 1, is " << last_msg_->healthy; + EXPECT_LT((last_msg_->inc * 100 - 0.966901291823 * 100), 0.05) + << "incorrect value for inc, expected 0.966901291823, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - 2.62510934634e-10 * 100), 0.05) + << "incorrect value for inc_dot, expected 2.62510934634e-10, is " + << last_msg_->inc_dot; + EXPECT_EQ(last_msg_->iode, 0) + << "incorrect value for iode, expected 0, is " << last_msg_->iode; + EXPECT_LT((last_msg_->m0 * 100 - -1.58816085572 * 100), 0.05) + << "incorrect value for m0, expected -1.58816085572, is " + << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - 1.23791994157 * 100), 0.05) + << "incorrect value for omega0, expected 1.23791994157, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -8.29570269217e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -8.29570269217e-09, is " + << last_msg_->omegadot; + EXPECT_EQ(last_msg_->prn, 13) + << "incorrect value for prn, expected 13, is " << last_msg_->prn; + EXPECT_LT((last_msg_->sqrta * 100 - 5153.57085609 * 100), 0.05) + << "incorrect value for sqrta, expected 5153.57085609, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->tgd * 100 - -9.31322574615e-09 * 100), 0.05) + << "incorrect value for tgd, expected -9.31322574615e-09, is " + << last_msg_->tgd; + EXPECT_LT((last_msg_->toc_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for toc_tow, expected 410400.0, is " + << last_msg_->toc_tow; + EXPECT_EQ(last_msg_->toc_wn, 1838) + << "incorrect value for toc_wn, expected 1838, is " << last_msg_->toc_wn; + EXPECT_LT((last_msg_->toe_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for toe_tow, expected 410400.0, is " + << last_msg_->toe_tow; + EXPECT_EQ(last_msg_->toe_wn, 1838) + << "incorrect value for toe_wn, expected 1838, is " << last_msg_->toe_wn; + EXPECT_EQ(last_msg_->valid, 1) + << "incorrect value for valid, expected 1, is " << last_msg_->valid; + EXPECT_LT((last_msg_->w * 100 - -1.97360228379 * 100), 0.05) + << "incorrect value for w, expected -1.97360228379, is " << last_msg_->w; } -class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_msgEphemerisDepB2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_msgEphemerisDepB2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -367,138 +462,187 @@ class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_msgEphemerisDepB2, Test) -{ - - uint8_t encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,56,62,0,0,0,0,0,40,81,192,0,0,0,0,0,129,109,64,0,0,0,0,0,28,205,190,0,0,0,0,0,76,223,62,0,0,0,0,0,0,105,190,0,0,0,0,0,0,92,190,134,161,223,255,243,43,51,62,146,176,113,142,234,164,5,64,0,0,0,56,175,140,112,63,0,0,192,90,171,33,180,64,36,38,237,255,200,160,237,191,204,92,63,154,49,91,65,190,125,94,251,132,52,61,216,63,2,139,28,27,231,199,238,63,124,183,4,180,194,30,247,189,0,0,0,0,0,104,222,190,0,0,0,0,0,0,96,61,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,0,0,222,152, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_dep_b_t* test_msg = ( msg_ephemeris_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = -7.249414920806885e-06; - test_msg->af1 = 4.547473508864641e-13; - test_msg->af2 = 0.0; - test_msg->c_ic = -4.6566128730773926e-08; - test_msg->c_is = -2.60770320892334e-08; - test_msg->c_rc = 236.03125; - test_msg->c_rs = -68.625; - test_msg->c_uc = -3.470107913017273e-06; - test_msg->c_us = 7.461756467819214e-06; - test_msg->dn = 4.4637573619826565e-09; - test_msg->ecc = 0.004040417145006359; - test_msg->healthy = 1; - test_msg->inc = 0.9619021920701416; - test_msg->inc_dot = -3.3644258561271105e-10; - test_msg->iode = 0; - test_msg->m0 = 2.7055255058713295; - test_msg->omega0 = -0.9258770941316397; - test_msg->omegadot = -8.082122367123182e-09; - test_msg->prn = 0; - test_msg->sqrta = 5153.669353485107; - test_msg->tgd = 5.587935447692871e-09; - test_msg->toc_tow = 410400.0; - test_msg->toc_wn = 1838; - test_msg->toe_tow = 410400.0; - test_msg->toe_wn = 1838; - test_msg->valid = 1; - test_msg->w = 0.37873566614641857; - - EXPECT_EQ(send_message( 0x46, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - -7.24941492081e-06*100), 0.05) << "incorrect value for af0, expected -7.24941492081e-06, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - 4.54747350886e-13*100), 0.05) << "incorrect value for af1, expected 4.54747350886e-13, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - 0.0*100), 0.05) << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; - EXPECT_LT((last_msg_->c_ic*100 - -4.65661287308e-08*100), 0.05) << "incorrect value for c_ic, expected -4.65661287308e-08, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - -2.60770320892e-08*100), 0.05) << "incorrect value for c_is, expected -2.60770320892e-08, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - 236.03125*100), 0.05) << "incorrect value for c_rc, expected 236.03125, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - -68.625*100), 0.05) << "incorrect value for c_rs, expected -68.625, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - -3.47010791302e-06*100), 0.05) << "incorrect value for c_uc, expected -3.47010791302e-06, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 7.46175646782e-06*100), 0.05) << "incorrect value for c_us, expected 7.46175646782e-06, is " << last_msg_->c_us; - EXPECT_LT((last_msg_->dn*100 - 4.46375736198e-09*100), 0.05) << "incorrect value for dn, expected 4.46375736198e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.00404041714501*100), 0.05) << "incorrect value for ecc, expected 0.00404041714501, is " << last_msg_->ecc; - EXPECT_EQ(last_msg_->healthy, 1) << "incorrect value for healthy, expected 1, is " << last_msg_->healthy; - EXPECT_LT((last_msg_->inc*100 - 0.96190219207*100), 0.05) << "incorrect value for inc, expected 0.96190219207, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - -3.36442585613e-10*100), 0.05) << "incorrect value for inc_dot, expected -3.36442585613e-10, is " << last_msg_->inc_dot; - EXPECT_EQ(last_msg_->iode, 0) << "incorrect value for iode, expected 0, is " << last_msg_->iode; - EXPECT_LT((last_msg_->m0*100 - 2.70552550587*100), 0.05) << "incorrect value for m0, expected 2.70552550587, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - -0.925877094132*100), 0.05) << "incorrect value for omega0, expected -0.925877094132, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -8.08212236712e-09*100), 0.05) << "incorrect value for omegadot, expected -8.08212236712e-09, is " << last_msg_->omegadot; - EXPECT_EQ(last_msg_->prn, 0) << "incorrect value for prn, expected 0, is " << last_msg_->prn; - EXPECT_LT((last_msg_->sqrta*100 - 5153.66935349*100), 0.05) << "incorrect value for sqrta, expected 5153.66935349, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->tgd*100 - 5.58793544769e-09*100), 0.05) << "incorrect value for tgd, expected 5.58793544769e-09, is " << last_msg_->tgd; - EXPECT_LT((last_msg_->toc_tow*100 - 410400.0*100), 0.05) << "incorrect value for toc_tow, expected 410400.0, is " << last_msg_->toc_tow; - EXPECT_EQ(last_msg_->toc_wn, 1838) << "incorrect value for toc_wn, expected 1838, is " << last_msg_->toc_wn; - EXPECT_LT((last_msg_->toe_tow*100 - 410400.0*100), 0.05) << "incorrect value for toe_tow, expected 410400.0, is " << last_msg_->toe_tow; - EXPECT_EQ(last_msg_->toe_wn, 1838) << "incorrect value for toe_wn, expected 1838, is " << last_msg_->toe_wn; - EXPECT_EQ(last_msg_->valid, 1) << "incorrect value for valid, expected 1, is " << last_msg_->valid; - EXPECT_LT((last_msg_->w*100 - 0.378735666146*100), 0.05) << "incorrect value for w, expected 0.378735666146, is " << last_msg_->w; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_msgEphemerisDepB2, Test) { + uint8_t encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 56, 62, 0, + 0, 0, 0, 0, 40, 81, 192, 0, 0, 0, 0, 0, 129, 109, 64, + 0, 0, 0, 0, 0, 28, 205, 190, 0, 0, 0, 0, 0, 76, 223, + 62, 0, 0, 0, 0, 0, 0, 105, 190, 0, 0, 0, 0, 0, 0, + 92, 190, 134, 161, 223, 255, 243, 43, 51, 62, 146, 176, 113, 142, 234, + 164, 5, 64, 0, 0, 0, 56, 175, 140, 112, 63, 0, 0, 192, 90, + 171, 33, 180, 64, 36, 38, 237, 255, 200, 160, 237, 191, 204, 92, 63, + 154, 49, 91, 65, 190, 125, 94, 251, 132, 52, 61, 216, 63, 2, 139, + 28, 27, 231, 199, 238, 63, 124, 183, 4, 180, 194, 30, 247, 189, 0, + 0, 0, 0, 0, 104, 222, 190, 0, 0, 0, 0, 0, 0, 96, 61, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, + 65, 46, 7, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, + 0, 0, 222, 152, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_dep_b_t *test_msg = (msg_ephemeris_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = -7.249414920806885e-06; + test_msg->af1 = 4.547473508864641e-13; + test_msg->af2 = 0.0; + test_msg->c_ic = -4.6566128730773926e-08; + test_msg->c_is = -2.60770320892334e-08; + test_msg->c_rc = 236.03125; + test_msg->c_rs = -68.625; + test_msg->c_uc = -3.470107913017273e-06; + test_msg->c_us = 7.461756467819214e-06; + test_msg->dn = 4.4637573619826565e-09; + test_msg->ecc = 0.004040417145006359; + test_msg->healthy = 1; + test_msg->inc = 0.9619021920701416; + test_msg->inc_dot = -3.3644258561271105e-10; + test_msg->iode = 0; + test_msg->m0 = 2.7055255058713295; + test_msg->omega0 = -0.9258770941316397; + test_msg->omegadot = -8.082122367123182e-09; + test_msg->prn = 0; + test_msg->sqrta = 5153.669353485107; + test_msg->tgd = 5.587935447692871e-09; + test_msg->toc_tow = 410400.0; + test_msg->toc_wn = 1838; + test_msg->toe_tow = 410400.0; + test_msg->toe_wn = 1838; + test_msg->valid = 1; + test_msg->w = 0.37873566614641857; + + EXPECT_EQ(send_message(0x46, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - -7.24941492081e-06 * 100), 0.05) + << "incorrect value for af0, expected -7.24941492081e-06, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - 4.54747350886e-13 * 100), 0.05) + << "incorrect value for af1, expected 4.54747350886e-13, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; + EXPECT_LT((last_msg_->c_ic * 100 - -4.65661287308e-08 * 100), 0.05) + << "incorrect value for c_ic, expected -4.65661287308e-08, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - -2.60770320892e-08 * 100), 0.05) + << "incorrect value for c_is, expected -2.60770320892e-08, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - 236.03125 * 100), 0.05) + << "incorrect value for c_rc, expected 236.03125, is " << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - -68.625 * 100), 0.05) + << "incorrect value for c_rs, expected -68.625, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - -3.47010791302e-06 * 100), 0.05) + << "incorrect value for c_uc, expected -3.47010791302e-06, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 7.46175646782e-06 * 100), 0.05) + << "incorrect value for c_us, expected 7.46175646782e-06, is " + << last_msg_->c_us; + EXPECT_LT((last_msg_->dn * 100 - 4.46375736198e-09 * 100), 0.05) + << "incorrect value for dn, expected 4.46375736198e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.00404041714501 * 100), 0.05) + << "incorrect value for ecc, expected 0.00404041714501, is " + << last_msg_->ecc; + EXPECT_EQ(last_msg_->healthy, 1) + << "incorrect value for healthy, expected 1, is " << last_msg_->healthy; + EXPECT_LT((last_msg_->inc * 100 - 0.96190219207 * 100), 0.05) + << "incorrect value for inc, expected 0.96190219207, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - -3.36442585613e-10 * 100), 0.05) + << "incorrect value for inc_dot, expected -3.36442585613e-10, is " + << last_msg_->inc_dot; + EXPECT_EQ(last_msg_->iode, 0) + << "incorrect value for iode, expected 0, is " << last_msg_->iode; + EXPECT_LT((last_msg_->m0 * 100 - 2.70552550587 * 100), 0.05) + << "incorrect value for m0, expected 2.70552550587, is " << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - -0.925877094132 * 100), 0.05) + << "incorrect value for omega0, expected -0.925877094132, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -8.08212236712e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -8.08212236712e-09, is " + << last_msg_->omegadot; + EXPECT_EQ(last_msg_->prn, 0) + << "incorrect value for prn, expected 0, is " << last_msg_->prn; + EXPECT_LT((last_msg_->sqrta * 100 - 5153.66935349 * 100), 0.05) + << "incorrect value for sqrta, expected 5153.66935349, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->tgd * 100 - 5.58793544769e-09 * 100), 0.05) + << "incorrect value for tgd, expected 5.58793544769e-09, is " + << last_msg_->tgd; + EXPECT_LT((last_msg_->toc_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for toc_tow, expected 410400.0, is " + << last_msg_->toc_tow; + EXPECT_EQ(last_msg_->toc_wn, 1838) + << "incorrect value for toc_wn, expected 1838, is " << last_msg_->toc_wn; + EXPECT_LT((last_msg_->toe_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for toe_tow, expected 410400.0, is " + << last_msg_->toe_tow; + EXPECT_EQ(last_msg_->toe_wn, 1838) + << "incorrect value for toe_wn, expected 1838, is " << last_msg_->toe_wn; + EXPECT_EQ(last_msg_->valid, 1) + << "incorrect value for valid, expected 1, is " << last_msg_->valid; + EXPECT_LT((last_msg_->w * 100 - 0.378735666146 * 100), 0.05) + << "incorrect value for w, expected 0.378735666146, is " << last_msg_->w; } -class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_msgEphemerisDepB3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_msgEphemerisDepB3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -508,138 +652,188 @@ class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_msgEphemerisDepB3, Test) -{ - - uint8_t encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,68,190,0,0,0,0,0,72,66,64,0,0,0,0,128,188,115,64,0,0,0,0,0,80,193,62,0,0,0,0,0,164,204,62,0,0,0,0,0,0,130,62,0,0,0,0,0,0,128,62,72,181,127,6,208,225,52,62,158,174,129,91,27,105,249,191,0,0,0,96,204,57,128,63,0,0,160,35,146,33,180,64,247,169,1,36,133,206,243,63,79,11,109,92,156,208,65,190,103,78,3,253,223,147,255,191,164,214,90,250,218,240,238,63,94,239,187,37,36,10,242,61,0,0,0,0,176,91,19,63,0,0,0,0,0,0,137,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,13,0,180,21, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_dep_b_t* test_msg = ( msg_ephemeris_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = 7.384549826383591e-05; - test_msg->af1 = -2.8421709430404007e-12; - test_msg->af2 = 0.0; - test_msg->c_ic = 1.341104507446289e-07; - test_msg->c_is = 1.1920928955078125e-07; - test_msg->c_rc = 315.78125; - test_msg->c_rs = 36.5625; - test_msg->c_uc = 2.0638108253479004e-06; - test_msg->c_us = 3.4142285585403442e-06; - test_msg->dn = 4.86198823561129e-09; - test_msg->ecc = 0.007922741584479809; - test_msg->healthy = 1; - test_msg->inc = 0.9669012918227122; - test_msg->inc_dot = 2.6251093463412166e-10; - test_msg->iode = 0; - test_msg->m0 = -1.588160855720083; - test_msg->omega0 = 1.237919941568746; - test_msg->omegadot = -8.295702692172441e-09; - test_msg->prn = 13; - test_msg->sqrta = 5153.57085609436; - test_msg->tgd = -9.313225746154785e-09; - test_msg->toc_tow = 410400.0; - test_msg->toc_wn = 1838; - test_msg->toe_tow = 410400.0; - test_msg->toe_wn = 1838; - test_msg->valid = 1; - test_msg->w = -1.9736022837941165; - - EXPECT_EQ(send_message( 0x46, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - 7.38454982638e-05*100), 0.05) << "incorrect value for af0, expected 7.38454982638e-05, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - -2.84217094304e-12*100), 0.05) << "incorrect value for af1, expected -2.84217094304e-12, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - 0.0*100), 0.05) << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; - EXPECT_LT((last_msg_->c_ic*100 - 1.34110450745e-07*100), 0.05) << "incorrect value for c_ic, expected 1.34110450745e-07, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - 1.19209289551e-07*100), 0.05) << "incorrect value for c_is, expected 1.19209289551e-07, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - 315.78125*100), 0.05) << "incorrect value for c_rc, expected 315.78125, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - 36.5625*100), 0.05) << "incorrect value for c_rs, expected 36.5625, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - 2.06381082535e-06*100), 0.05) << "incorrect value for c_uc, expected 2.06381082535e-06, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 3.41422855854e-06*100), 0.05) << "incorrect value for c_us, expected 3.41422855854e-06, is " << last_msg_->c_us; - EXPECT_LT((last_msg_->dn*100 - 4.86198823561e-09*100), 0.05) << "incorrect value for dn, expected 4.86198823561e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.00792274158448*100), 0.05) << "incorrect value for ecc, expected 0.00792274158448, is " << last_msg_->ecc; - EXPECT_EQ(last_msg_->healthy, 1) << "incorrect value for healthy, expected 1, is " << last_msg_->healthy; - EXPECT_LT((last_msg_->inc*100 - 0.966901291823*100), 0.05) << "incorrect value for inc, expected 0.966901291823, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - 2.62510934634e-10*100), 0.05) << "incorrect value for inc_dot, expected 2.62510934634e-10, is " << last_msg_->inc_dot; - EXPECT_EQ(last_msg_->iode, 0) << "incorrect value for iode, expected 0, is " << last_msg_->iode; - EXPECT_LT((last_msg_->m0*100 - -1.58816085572*100), 0.05) << "incorrect value for m0, expected -1.58816085572, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - 1.23791994157*100), 0.05) << "incorrect value for omega0, expected 1.23791994157, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -8.29570269217e-09*100), 0.05) << "incorrect value for omegadot, expected -8.29570269217e-09, is " << last_msg_->omegadot; - EXPECT_EQ(last_msg_->prn, 13) << "incorrect value for prn, expected 13, is " << last_msg_->prn; - EXPECT_LT((last_msg_->sqrta*100 - 5153.57085609*100), 0.05) << "incorrect value for sqrta, expected 5153.57085609, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->tgd*100 - -9.31322574615e-09*100), 0.05) << "incorrect value for tgd, expected -9.31322574615e-09, is " << last_msg_->tgd; - EXPECT_LT((last_msg_->toc_tow*100 - 410400.0*100), 0.05) << "incorrect value for toc_tow, expected 410400.0, is " << last_msg_->toc_tow; - EXPECT_EQ(last_msg_->toc_wn, 1838) << "incorrect value for toc_wn, expected 1838, is " << last_msg_->toc_wn; - EXPECT_LT((last_msg_->toe_tow*100 - 410400.0*100), 0.05) << "incorrect value for toe_tow, expected 410400.0, is " << last_msg_->toe_tow; - EXPECT_EQ(last_msg_->toe_wn, 1838) << "incorrect value for toe_wn, expected 1838, is " << last_msg_->toe_wn; - EXPECT_EQ(last_msg_->valid, 1) << "incorrect value for valid, expected 1, is " << last_msg_->valid; - EXPECT_LT((last_msg_->w*100 - -1.97360228379*100), 0.05) << "incorrect value for w, expected -1.97360228379, is " << last_msg_->w; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_msgEphemerisDepB3, Test) { + uint8_t encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 68, 190, 0, + 0, 0, 0, 0, 72, 66, 64, 0, 0, 0, 0, 128, 188, 115, 64, + 0, 0, 0, 0, 0, 80, 193, 62, 0, 0, 0, 0, 0, 164, 204, + 62, 0, 0, 0, 0, 0, 0, 130, 62, 0, 0, 0, 0, 0, 0, + 128, 62, 72, 181, 127, 6, 208, 225, 52, 62, 158, 174, 129, 91, 27, + 105, 249, 191, 0, 0, 0, 96, 204, 57, 128, 63, 0, 0, 160, 35, + 146, 33, 180, 64, 247, 169, 1, 36, 133, 206, 243, 63, 79, 11, 109, + 92, 156, 208, 65, 190, 103, 78, 3, 253, 223, 147, 255, 191, 164, 214, + 90, 250, 218, 240, 238, 63, 94, 239, 187, 37, 36, 10, 242, 61, 0, + 0, 0, 0, 176, 91, 19, 63, 0, 0, 0, 0, 0, 0, 137, 189, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, + 65, 46, 7, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, + 13, 0, 180, 21, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_dep_b_t *test_msg = (msg_ephemeris_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = 7.384549826383591e-05; + test_msg->af1 = -2.8421709430404007e-12; + test_msg->af2 = 0.0; + test_msg->c_ic = 1.341104507446289e-07; + test_msg->c_is = 1.1920928955078125e-07; + test_msg->c_rc = 315.78125; + test_msg->c_rs = 36.5625; + test_msg->c_uc = 2.0638108253479004e-06; + test_msg->c_us = 3.4142285585403442e-06; + test_msg->dn = 4.86198823561129e-09; + test_msg->ecc = 0.007922741584479809; + test_msg->healthy = 1; + test_msg->inc = 0.9669012918227122; + test_msg->inc_dot = 2.6251093463412166e-10; + test_msg->iode = 0; + test_msg->m0 = -1.588160855720083; + test_msg->omega0 = 1.237919941568746; + test_msg->omegadot = -8.295702692172441e-09; + test_msg->prn = 13; + test_msg->sqrta = 5153.57085609436; + test_msg->tgd = -9.313225746154785e-09; + test_msg->toc_tow = 410400.0; + test_msg->toc_wn = 1838; + test_msg->toe_tow = 410400.0; + test_msg->toe_wn = 1838; + test_msg->valid = 1; + test_msg->w = -1.9736022837941165; + + EXPECT_EQ(send_message(0x46, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - 7.38454982638e-05 * 100), 0.05) + << "incorrect value for af0, expected 7.38454982638e-05, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - -2.84217094304e-12 * 100), 0.05) + << "incorrect value for af1, expected -2.84217094304e-12, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; + EXPECT_LT((last_msg_->c_ic * 100 - 1.34110450745e-07 * 100), 0.05) + << "incorrect value for c_ic, expected 1.34110450745e-07, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - 1.19209289551e-07 * 100), 0.05) + << "incorrect value for c_is, expected 1.19209289551e-07, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - 315.78125 * 100), 0.05) + << "incorrect value for c_rc, expected 315.78125, is " << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - 36.5625 * 100), 0.05) + << "incorrect value for c_rs, expected 36.5625, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - 2.06381082535e-06 * 100), 0.05) + << "incorrect value for c_uc, expected 2.06381082535e-06, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 3.41422855854e-06 * 100), 0.05) + << "incorrect value for c_us, expected 3.41422855854e-06, is " + << last_msg_->c_us; + EXPECT_LT((last_msg_->dn * 100 - 4.86198823561e-09 * 100), 0.05) + << "incorrect value for dn, expected 4.86198823561e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.00792274158448 * 100), 0.05) + << "incorrect value for ecc, expected 0.00792274158448, is " + << last_msg_->ecc; + EXPECT_EQ(last_msg_->healthy, 1) + << "incorrect value for healthy, expected 1, is " << last_msg_->healthy; + EXPECT_LT((last_msg_->inc * 100 - 0.966901291823 * 100), 0.05) + << "incorrect value for inc, expected 0.966901291823, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - 2.62510934634e-10 * 100), 0.05) + << "incorrect value for inc_dot, expected 2.62510934634e-10, is " + << last_msg_->inc_dot; + EXPECT_EQ(last_msg_->iode, 0) + << "incorrect value for iode, expected 0, is " << last_msg_->iode; + EXPECT_LT((last_msg_->m0 * 100 - -1.58816085572 * 100), 0.05) + << "incorrect value for m0, expected -1.58816085572, is " + << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - 1.23791994157 * 100), 0.05) + << "incorrect value for omega0, expected 1.23791994157, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -8.29570269217e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -8.29570269217e-09, is " + << last_msg_->omegadot; + EXPECT_EQ(last_msg_->prn, 13) + << "incorrect value for prn, expected 13, is " << last_msg_->prn; + EXPECT_LT((last_msg_->sqrta * 100 - 5153.57085609 * 100), 0.05) + << "incorrect value for sqrta, expected 5153.57085609, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->tgd * 100 - -9.31322574615e-09 * 100), 0.05) + << "incorrect value for tgd, expected -9.31322574615e-09, is " + << last_msg_->tgd; + EXPECT_LT((last_msg_->toc_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for toc_tow, expected 410400.0, is " + << last_msg_->toc_tow; + EXPECT_EQ(last_msg_->toc_wn, 1838) + << "incorrect value for toc_wn, expected 1838, is " << last_msg_->toc_wn; + EXPECT_LT((last_msg_->toe_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for toe_tow, expected 410400.0, is " + << last_msg_->toe_tow; + EXPECT_EQ(last_msg_->toe_wn, 1838) + << "incorrect value for toe_wn, expected 1838, is " << last_msg_->toe_wn; + EXPECT_EQ(last_msg_->valid, 1) + << "incorrect value for valid, expected 1, is " << last_msg_->valid; + EXPECT_LT((last_msg_->w * 100 - -1.97360228379 * 100), 0.05) + << "incorrect value for w, expected -1.97360228379, is " << last_msg_->w; } -class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_msgEphemerisDepB4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_msgEphemerisDepB4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -649,138 +843,188 @@ class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_msgEphemerisDepB4, Test) -{ - - uint8_t encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,128,85,190,0,0,0,0,0,156,69,64,0,0,0,0,128,19,115,64,0,0,0,0,0,160,193,62,0,0,0,0,0,152,207,62,0,0,0,0,0,0,97,190,0,0,0,0,0,192,139,190,26,26,13,149,16,152,54,62,104,7,46,214,75,84,5,192,0,0,0,128,230,82,132,63,0,0,160,252,162,33,180,64,73,6,130,54,217,171,242,63,81,224,163,123,238,42,66,190,206,43,141,67,243,157,5,192,113,179,153,187,43,92,238,63,254,236,31,43,224,157,244,61,0,0,0,0,232,4,26,191,0,0,0,0,0,0,134,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,22,0,99,61, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_dep_b_t* test_msg = ( msg_ephemeris_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = -9.925523772835732e-05; - test_msg->af1 = -2.5011104298755527e-12; - test_msg->af2 = 0.0; - test_msg->c_ic = -3.166496753692627e-08; - test_msg->c_is = -2.0675361156463623e-07; - test_msg->c_rc = 305.21875; - test_msg->c_rs = 43.21875; - test_msg->c_uc = 2.1010637283325195e-06; - test_msg->c_us = 3.766268491744995e-06; - test_msg->dn = 5.26057626697412e-09; - test_msg->ecc = 0.009923744946718216; - test_msg->healthy = 1; - test_msg->inc = 0.9487513221807672; - test_msg->inc_dot = 3.000124967247105e-10; - test_msg->iode = 0; - test_msg->m0 = -2.666160271911327; - test_msg->omega0 = 1.1669551972594425; - test_msg->omegadot = -8.45999524990264e-09; - test_msg->prn = 22; - test_msg->sqrta = 5153.636667251587; - test_msg->tgd = -2.0023435354232788e-08; - test_msg->toc_tow = 410400.0; - test_msg->toc_wn = 1838; - test_msg->toe_tow = 410400.0; - test_msg->toe_wn = 1838; - test_msg->valid = 1; - test_msg->w = -2.7021241452652935; - - EXPECT_EQ(send_message( 0x46, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - -9.92552377284e-05*100), 0.05) << "incorrect value for af0, expected -9.92552377284e-05, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - -2.50111042988e-12*100), 0.05) << "incorrect value for af1, expected -2.50111042988e-12, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - 0.0*100), 0.05) << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; - EXPECT_LT((last_msg_->c_ic*100 - -3.16649675369e-08*100), 0.05) << "incorrect value for c_ic, expected -3.16649675369e-08, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - -2.06753611565e-07*100), 0.05) << "incorrect value for c_is, expected -2.06753611565e-07, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - 305.21875*100), 0.05) << "incorrect value for c_rc, expected 305.21875, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - 43.21875*100), 0.05) << "incorrect value for c_rs, expected 43.21875, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - 2.10106372833e-06*100), 0.05) << "incorrect value for c_uc, expected 2.10106372833e-06, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 3.76626849174e-06*100), 0.05) << "incorrect value for c_us, expected 3.76626849174e-06, is " << last_msg_->c_us; - EXPECT_LT((last_msg_->dn*100 - 5.26057626697e-09*100), 0.05) << "incorrect value for dn, expected 5.26057626697e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.00992374494672*100), 0.05) << "incorrect value for ecc, expected 0.00992374494672, is " << last_msg_->ecc; - EXPECT_EQ(last_msg_->healthy, 1) << "incorrect value for healthy, expected 1, is " << last_msg_->healthy; - EXPECT_LT((last_msg_->inc*100 - 0.948751322181*100), 0.05) << "incorrect value for inc, expected 0.948751322181, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - 3.00012496725e-10*100), 0.05) << "incorrect value for inc_dot, expected 3.00012496725e-10, is " << last_msg_->inc_dot; - EXPECT_EQ(last_msg_->iode, 0) << "incorrect value for iode, expected 0, is " << last_msg_->iode; - EXPECT_LT((last_msg_->m0*100 - -2.66616027191*100), 0.05) << "incorrect value for m0, expected -2.66616027191, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - 1.16695519726*100), 0.05) << "incorrect value for omega0, expected 1.16695519726, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -8.4599952499e-09*100), 0.05) << "incorrect value for omegadot, expected -8.4599952499e-09, is " << last_msg_->omegadot; - EXPECT_EQ(last_msg_->prn, 22) << "incorrect value for prn, expected 22, is " << last_msg_->prn; - EXPECT_LT((last_msg_->sqrta*100 - 5153.63666725*100), 0.05) << "incorrect value for sqrta, expected 5153.63666725, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->tgd*100 - -2.00234353542e-08*100), 0.05) << "incorrect value for tgd, expected -2.00234353542e-08, is " << last_msg_->tgd; - EXPECT_LT((last_msg_->toc_tow*100 - 410400.0*100), 0.05) << "incorrect value for toc_tow, expected 410400.0, is " << last_msg_->toc_tow; - EXPECT_EQ(last_msg_->toc_wn, 1838) << "incorrect value for toc_wn, expected 1838, is " << last_msg_->toc_wn; - EXPECT_LT((last_msg_->toe_tow*100 - 410400.0*100), 0.05) << "incorrect value for toe_tow, expected 410400.0, is " << last_msg_->toe_tow; - EXPECT_EQ(last_msg_->toe_wn, 1838) << "incorrect value for toe_wn, expected 1838, is " << last_msg_->toe_wn; - EXPECT_EQ(last_msg_->valid, 1) << "incorrect value for valid, expected 1, is " << last_msg_->valid; - EXPECT_LT((last_msg_->w*100 - -2.70212414527*100), 0.05) << "incorrect value for w, expected -2.70212414527, is " << last_msg_->w; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_msgEphemerisDepB4, Test) { + uint8_t encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 128, 85, 190, 0, + 0, 0, 0, 0, 156, 69, 64, 0, 0, 0, 0, 128, 19, 115, 64, + 0, 0, 0, 0, 0, 160, 193, 62, 0, 0, 0, 0, 0, 152, 207, + 62, 0, 0, 0, 0, 0, 0, 97, 190, 0, 0, 0, 0, 0, 192, + 139, 190, 26, 26, 13, 149, 16, 152, 54, 62, 104, 7, 46, 214, 75, + 84, 5, 192, 0, 0, 0, 128, 230, 82, 132, 63, 0, 0, 160, 252, + 162, 33, 180, 64, 73, 6, 130, 54, 217, 171, 242, 63, 81, 224, 163, + 123, 238, 42, 66, 190, 206, 43, 141, 67, 243, 157, 5, 192, 113, 179, + 153, 187, 43, 92, 238, 63, 254, 236, 31, 43, 224, 157, 244, 61, 0, + 0, 0, 0, 232, 4, 26, 191, 0, 0, 0, 0, 0, 0, 134, 189, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, + 65, 46, 7, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, + 22, 0, 99, 61, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_dep_b_t *test_msg = (msg_ephemeris_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = -9.925523772835732e-05; + test_msg->af1 = -2.5011104298755527e-12; + test_msg->af2 = 0.0; + test_msg->c_ic = -3.166496753692627e-08; + test_msg->c_is = -2.0675361156463623e-07; + test_msg->c_rc = 305.21875; + test_msg->c_rs = 43.21875; + test_msg->c_uc = 2.1010637283325195e-06; + test_msg->c_us = 3.766268491744995e-06; + test_msg->dn = 5.26057626697412e-09; + test_msg->ecc = 0.009923744946718216; + test_msg->healthy = 1; + test_msg->inc = 0.9487513221807672; + test_msg->inc_dot = 3.000124967247105e-10; + test_msg->iode = 0; + test_msg->m0 = -2.666160271911327; + test_msg->omega0 = 1.1669551972594425; + test_msg->omegadot = -8.45999524990264e-09; + test_msg->prn = 22; + test_msg->sqrta = 5153.636667251587; + test_msg->tgd = -2.0023435354232788e-08; + test_msg->toc_tow = 410400.0; + test_msg->toc_wn = 1838; + test_msg->toe_tow = 410400.0; + test_msg->toe_wn = 1838; + test_msg->valid = 1; + test_msg->w = -2.7021241452652935; + + EXPECT_EQ(send_message(0x46, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - -9.92552377284e-05 * 100), 0.05) + << "incorrect value for af0, expected -9.92552377284e-05, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - -2.50111042988e-12 * 100), 0.05) + << "incorrect value for af1, expected -2.50111042988e-12, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; + EXPECT_LT((last_msg_->c_ic * 100 - -3.16649675369e-08 * 100), 0.05) + << "incorrect value for c_ic, expected -3.16649675369e-08, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - -2.06753611565e-07 * 100), 0.05) + << "incorrect value for c_is, expected -2.06753611565e-07, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - 305.21875 * 100), 0.05) + << "incorrect value for c_rc, expected 305.21875, is " << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - 43.21875 * 100), 0.05) + << "incorrect value for c_rs, expected 43.21875, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - 2.10106372833e-06 * 100), 0.05) + << "incorrect value for c_uc, expected 2.10106372833e-06, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 3.76626849174e-06 * 100), 0.05) + << "incorrect value for c_us, expected 3.76626849174e-06, is " + << last_msg_->c_us; + EXPECT_LT((last_msg_->dn * 100 - 5.26057626697e-09 * 100), 0.05) + << "incorrect value for dn, expected 5.26057626697e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.00992374494672 * 100), 0.05) + << "incorrect value for ecc, expected 0.00992374494672, is " + << last_msg_->ecc; + EXPECT_EQ(last_msg_->healthy, 1) + << "incorrect value for healthy, expected 1, is " << last_msg_->healthy; + EXPECT_LT((last_msg_->inc * 100 - 0.948751322181 * 100), 0.05) + << "incorrect value for inc, expected 0.948751322181, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - 3.00012496725e-10 * 100), 0.05) + << "incorrect value for inc_dot, expected 3.00012496725e-10, is " + << last_msg_->inc_dot; + EXPECT_EQ(last_msg_->iode, 0) + << "incorrect value for iode, expected 0, is " << last_msg_->iode; + EXPECT_LT((last_msg_->m0 * 100 - -2.66616027191 * 100), 0.05) + << "incorrect value for m0, expected -2.66616027191, is " + << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - 1.16695519726 * 100), 0.05) + << "incorrect value for omega0, expected 1.16695519726, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -8.4599952499e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -8.4599952499e-09, is " + << last_msg_->omegadot; + EXPECT_EQ(last_msg_->prn, 22) + << "incorrect value for prn, expected 22, is " << last_msg_->prn; + EXPECT_LT((last_msg_->sqrta * 100 - 5153.63666725 * 100), 0.05) + << "incorrect value for sqrta, expected 5153.63666725, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->tgd * 100 - -2.00234353542e-08 * 100), 0.05) + << "incorrect value for tgd, expected -2.00234353542e-08, is " + << last_msg_->tgd; + EXPECT_LT((last_msg_->toc_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for toc_tow, expected 410400.0, is " + << last_msg_->toc_tow; + EXPECT_EQ(last_msg_->toc_wn, 1838) + << "incorrect value for toc_wn, expected 1838, is " << last_msg_->toc_wn; + EXPECT_LT((last_msg_->toe_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for toe_tow, expected 410400.0, is " + << last_msg_->toe_tow; + EXPECT_EQ(last_msg_->toe_wn, 1838) + << "incorrect value for toe_wn, expected 1838, is " << last_msg_->toe_wn; + EXPECT_EQ(last_msg_->valid, 1) + << "incorrect value for valid, expected 1, is " << last_msg_->valid; + EXPECT_LT((last_msg_->w * 100 - -2.70212414527 * 100), 0.05) + << "incorrect value for w, expected -2.70212414527, is " << last_msg_->w; } -class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_msgEphemerisDepB5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_msgEphemerisDepB5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -790,87 +1034,142 @@ class Test_legacy_auto_check_sbp_observation_msgEphemerisDepB5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_msgEphemerisDepB5, Test) -{ - - uint8_t encoded_frame[] = {85,70,0,195,4,176,0,0,0,0,0,0,77,190,0,0,0,0,0,122,83,192,0,0,0,0,0,233,110,64,0,0,0,0,0,60,207,190,0,0,0,0,0,28,222,62,0,0,0,0,0,128,120,62,0,0,0,0,0,0,108,62,10,230,183,140,214,230,50,62,54,86,196,164,252,10,255,63,0,0,0,36,247,191,128,63,0,0,160,5,193,33,180,64,186,138,81,129,88,239,1,64,94,210,120,170,106,25,65,190,103,213,32,155,227,194,224,191,156,47,104,93,101,55,239,63,196,83,100,254,51,54,4,190,0,0,0,0,50,242,52,63,0,0,0,0,0,0,114,189,0,0,0,0,0,0,0,0,0,0,0,0,128,12,25,65,46,7,0,0,0,0,128,12,25,65,46,7,1,1,30,0,170,33, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_dep_b_t* test_msg = ( msg_ephemeris_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = 0.0003196117468178272; - test_msg->af1 = -1.0231815394945443e-12; - test_msg->af2 = 0.0; - test_msg->c_ic = 9.12696123123169e-08; - test_msg->c_is = 5.21540641784668e-08; - test_msg->c_rc = 247.28125; - test_msg->c_rs = -77.90625; - test_msg->c_uc = -3.723427653312683e-06; - test_msg->c_us = 7.178634405136108e-06; - test_msg->dn = 4.400897600764146e-09; - test_msg->ecc = 0.008178644930012524; - test_msg->healthy = 1; - test_msg->inc = 0.9755122017245301; - test_msg->inc_dot = -5.882387882209502e-10; - test_msg->iode = 0; - test_msg->m0 = 1.9401823459824192; - test_msg->omega0 = 2.241868028927766; - test_msg->omegadot = -7.962474526167494e-09; - test_msg->prn = 30; - test_msg->sqrta = 5153.7539920806885; - test_msg->tgd = -1.3504177331924438e-08; - test_msg->toc_tow = 410400.0; - test_msg->toc_wn = 1838; - test_msg->toe_tow = 410400.0; - test_msg->toe_wn = 1838; - test_msg->valid = 1; - test_msg->w = -0.5237901716088061; - - EXPECT_EQ(send_message( 0x46, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - 0.000319611746818*100), 0.05) << "incorrect value for af0, expected 0.000319611746818, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - -1.02318153949e-12*100), 0.05) << "incorrect value for af1, expected -1.02318153949e-12, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - 0.0*100), 0.05) << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; - EXPECT_LT((last_msg_->c_ic*100 - 9.12696123123e-08*100), 0.05) << "incorrect value for c_ic, expected 9.12696123123e-08, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - 5.21540641785e-08*100), 0.05) << "incorrect value for c_is, expected 5.21540641785e-08, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - 247.28125*100), 0.05) << "incorrect value for c_rc, expected 247.28125, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - -77.90625*100), 0.05) << "incorrect value for c_rs, expected -77.90625, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - -3.72342765331e-06*100), 0.05) << "incorrect value for c_uc, expected -3.72342765331e-06, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 7.17863440514e-06*100), 0.05) << "incorrect value for c_us, expected 7.17863440514e-06, is " << last_msg_->c_us; - EXPECT_LT((last_msg_->dn*100 - 4.40089760076e-09*100), 0.05) << "incorrect value for dn, expected 4.40089760076e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.00817864493001*100), 0.05) << "incorrect value for ecc, expected 0.00817864493001, is " << last_msg_->ecc; - EXPECT_EQ(last_msg_->healthy, 1) << "incorrect value for healthy, expected 1, is " << last_msg_->healthy; - EXPECT_LT((last_msg_->inc*100 - 0.975512201725*100), 0.05) << "incorrect value for inc, expected 0.975512201725, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - -5.88238788221e-10*100), 0.05) << "incorrect value for inc_dot, expected -5.88238788221e-10, is " << last_msg_->inc_dot; - EXPECT_EQ(last_msg_->iode, 0) << "incorrect value for iode, expected 0, is " << last_msg_->iode; - EXPECT_LT((last_msg_->m0*100 - 1.94018234598*100), 0.05) << "incorrect value for m0, expected 1.94018234598, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - 2.24186802893*100), 0.05) << "incorrect value for omega0, expected 2.24186802893, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -7.96247452617e-09*100), 0.05) << "incorrect value for omegadot, expected -7.96247452617e-09, is " << last_msg_->omegadot; - EXPECT_EQ(last_msg_->prn, 30) << "incorrect value for prn, expected 30, is " << last_msg_->prn; - EXPECT_LT((last_msg_->sqrta*100 - 5153.75399208*100), 0.05) << "incorrect value for sqrta, expected 5153.75399208, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->tgd*100 - -1.35041773319e-08*100), 0.05) << "incorrect value for tgd, expected -1.35041773319e-08, is " << last_msg_->tgd; - EXPECT_LT((last_msg_->toc_tow*100 - 410400.0*100), 0.05) << "incorrect value for toc_tow, expected 410400.0, is " << last_msg_->toc_tow; - EXPECT_EQ(last_msg_->toc_wn, 1838) << "incorrect value for toc_wn, expected 1838, is " << last_msg_->toc_wn; - EXPECT_LT((last_msg_->toe_tow*100 - 410400.0*100), 0.05) << "incorrect value for toe_tow, expected 410400.0, is " << last_msg_->toe_tow; - EXPECT_EQ(last_msg_->toe_wn, 1838) << "incorrect value for toe_wn, expected 1838, is " << last_msg_->toe_wn; - EXPECT_EQ(last_msg_->valid, 1) << "incorrect value for valid, expected 1, is " << last_msg_->valid; - EXPECT_LT((last_msg_->w*100 - -0.523790171609*100), 0.05) << "incorrect value for w, expected -0.523790171609, is " << last_msg_->w; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_msgEphemerisDepB5, Test) { + uint8_t encoded_frame[] = { + 85, 70, 0, 195, 4, 176, 0, 0, 0, 0, 0, 0, 77, 190, 0, + 0, 0, 0, 0, 122, 83, 192, 0, 0, 0, 0, 0, 233, 110, 64, + 0, 0, 0, 0, 0, 60, 207, 190, 0, 0, 0, 0, 0, 28, 222, + 62, 0, 0, 0, 0, 0, 128, 120, 62, 0, 0, 0, 0, 0, 0, + 108, 62, 10, 230, 183, 140, 214, 230, 50, 62, 54, 86, 196, 164, 252, + 10, 255, 63, 0, 0, 0, 36, 247, 191, 128, 63, 0, 0, 160, 5, + 193, 33, 180, 64, 186, 138, 81, 129, 88, 239, 1, 64, 94, 210, 120, + 170, 106, 25, 65, 190, 103, 213, 32, 155, 227, 194, 224, 191, 156, 47, + 104, 93, 101, 55, 239, 63, 196, 83, 100, 254, 51, 54, 4, 190, 0, + 0, 0, 0, 50, 242, 52, 63, 0, 0, 0, 0, 0, 0, 114, 189, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 12, 25, + 65, 46, 7, 0, 0, 0, 0, 128, 12, 25, 65, 46, 7, 1, 1, + 30, 0, 170, 33, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_dep_b_t *test_msg = (msg_ephemeris_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = 0.0003196117468178272; + test_msg->af1 = -1.0231815394945443e-12; + test_msg->af2 = 0.0; + test_msg->c_ic = 9.12696123123169e-08; + test_msg->c_is = 5.21540641784668e-08; + test_msg->c_rc = 247.28125; + test_msg->c_rs = -77.90625; + test_msg->c_uc = -3.723427653312683e-06; + test_msg->c_us = 7.178634405136108e-06; + test_msg->dn = 4.400897600764146e-09; + test_msg->ecc = 0.008178644930012524; + test_msg->healthy = 1; + test_msg->inc = 0.9755122017245301; + test_msg->inc_dot = -5.882387882209502e-10; + test_msg->iode = 0; + test_msg->m0 = 1.9401823459824192; + test_msg->omega0 = 2.241868028927766; + test_msg->omegadot = -7.962474526167494e-09; + test_msg->prn = 30; + test_msg->sqrta = 5153.7539920806885; + test_msg->tgd = -1.3504177331924438e-08; + test_msg->toc_tow = 410400.0; + test_msg->toc_wn = 1838; + test_msg->toe_tow = 410400.0; + test_msg->toe_wn = 1838; + test_msg->valid = 1; + test_msg->w = -0.5237901716088061; + + EXPECT_EQ(send_message(0x46, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - 0.000319611746818 * 100), 0.05) + << "incorrect value for af0, expected 0.000319611746818, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - -1.02318153949e-12 * 100), 0.05) + << "incorrect value for af1, expected -1.02318153949e-12, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; + EXPECT_LT((last_msg_->c_ic * 100 - 9.12696123123e-08 * 100), 0.05) + << "incorrect value for c_ic, expected 9.12696123123e-08, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - 5.21540641785e-08 * 100), 0.05) + << "incorrect value for c_is, expected 5.21540641785e-08, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - 247.28125 * 100), 0.05) + << "incorrect value for c_rc, expected 247.28125, is " << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - -77.90625 * 100), 0.05) + << "incorrect value for c_rs, expected -77.90625, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - -3.72342765331e-06 * 100), 0.05) + << "incorrect value for c_uc, expected -3.72342765331e-06, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 7.17863440514e-06 * 100), 0.05) + << "incorrect value for c_us, expected 7.17863440514e-06, is " + << last_msg_->c_us; + EXPECT_LT((last_msg_->dn * 100 - 4.40089760076e-09 * 100), 0.05) + << "incorrect value for dn, expected 4.40089760076e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.00817864493001 * 100), 0.05) + << "incorrect value for ecc, expected 0.00817864493001, is " + << last_msg_->ecc; + EXPECT_EQ(last_msg_->healthy, 1) + << "incorrect value for healthy, expected 1, is " << last_msg_->healthy; + EXPECT_LT((last_msg_->inc * 100 - 0.975512201725 * 100), 0.05) + << "incorrect value for inc, expected 0.975512201725, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - -5.88238788221e-10 * 100), 0.05) + << "incorrect value for inc_dot, expected -5.88238788221e-10, is " + << last_msg_->inc_dot; + EXPECT_EQ(last_msg_->iode, 0) + << "incorrect value for iode, expected 0, is " << last_msg_->iode; + EXPECT_LT((last_msg_->m0 * 100 - 1.94018234598 * 100), 0.05) + << "incorrect value for m0, expected 1.94018234598, is " << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - 2.24186802893 * 100), 0.05) + << "incorrect value for omega0, expected 2.24186802893, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -7.96247452617e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -7.96247452617e-09, is " + << last_msg_->omegadot; + EXPECT_EQ(last_msg_->prn, 30) + << "incorrect value for prn, expected 30, is " << last_msg_->prn; + EXPECT_LT((last_msg_->sqrta * 100 - 5153.75399208 * 100), 0.05) + << "incorrect value for sqrta, expected 5153.75399208, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->tgd * 100 - -1.35041773319e-08 * 100), 0.05) + << "incorrect value for tgd, expected -1.35041773319e-08, is " + << last_msg_->tgd; + EXPECT_LT((last_msg_->toc_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for toc_tow, expected 410400.0, is " + << last_msg_->toc_tow; + EXPECT_EQ(last_msg_->toc_wn, 1838) + << "incorrect value for toc_wn, expected 1838, is " << last_msg_->toc_wn; + EXPECT_LT((last_msg_->toe_tow * 100 - 410400.0 * 100), 0.05) + << "incorrect value for toe_tow, expected 410400.0, is " + << last_msg_->toe_tow; + EXPECT_EQ(last_msg_->toe_wn, 1838) + << "incorrect value for toe_wn, expected 1838, is " << last_msg_->toe_wn; + EXPECT_EQ(last_msg_->valid, 1) + << "incorrect value for valid, expected 1, is " << last_msg_->valid; + EXPECT_LT((last_msg_->w * 100 - -0.523790171609 * 100), 0.05) + << "incorrect value for w, expected -0.523790171609, is " << last_msg_->w; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_msgEphemerisQzss.cc b/c/test/legacy/cpp/auto_check_sbp_observation_msgEphemerisQzss.cc index e85a89d95..fbf34a842 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_msgEphemerisQzss.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_msgEphemerisQzss.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisQzss.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_msgEphemerisQzss.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_msgEphemerisQzss0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_msgEphemerisQzss0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_msgEphemerisQzss0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_msgEphemerisQzss0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ephemeris_qzss_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ephemeris_qzss_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,95 +81,158 @@ class Test_legacy_auto_check_sbp_observation_msgEphemerisQzss0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ephemeris_qzss_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_msgEphemerisQzss0, Test) -{ +}; - uint8_t encoded_frame[] = {85,142,0,128,240,139,193,31,208,221,6,0,106,8,0,0,0,64,64,56,0,0,0,0,0,0,192,177,0,232,228,195,0,160,19,194,0,224,135,183,0,96,10,55,0,192,157,181,0,0,46,52,167,72,107,105,179,1,39,62,15,224,158,211,241,164,211,63,0,0,0,24,251,83,179,63,0,0,0,34,44,93,185,64,143,62,206,232,193,181,242,191,207,216,69,106,98,255,39,190,65,132,95,22,48,15,249,191,249,82,67,94,30,100,231,63,117,167,187,233,187,253,181,61,160,129,193,185,0,0,168,172,0,0,0,0,208,221,6,0,106,8,49,49,3,126,23, }; +TEST_F(Test_legacy_auto_check_sbp_observation_msgEphemerisQzss0, Test) { + uint8_t encoded_frame[] = { + 85, 142, 0, 128, 240, 139, 193, 31, 208, 221, 6, 0, 106, 8, 0, + 0, 0, 64, 64, 56, 0, 0, 0, 0, 0, 0, 192, 177, 0, 232, + 228, 195, 0, 160, 19, 194, 0, 224, 135, 183, 0, 96, 10, 55, 0, + 192, 157, 181, 0, 0, 46, 52, 167, 72, 107, 105, 179, 1, 39, 62, + 15, 224, 158, 211, 241, 164, 211, 63, 0, 0, 0, 24, 251, 83, 179, + 63, 0, 0, 0, 34, 44, 93, 185, 64, 143, 62, 206, 232, 193, 181, + 242, 191, 207, 216, 69, 106, 98, 255, 39, 190, 65, 132, 95, 22, 48, + 15, 249, 191, 249, 82, 67, 94, 30, 100, 231, 63, 117, 167, 187, 233, + 187, 253, 181, 61, 160, 129, 193, 185, 0, 0, 168, 172, 0, 0, 0, + 0, 208, 221, 6, 0, 106, 8, 49, 49, 3, 126, 23, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ephemeris_qzss_t* test_msg = ( msg_ephemeris_qzss_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->af0 = -0.00036908406764268875; - test_msg->af1 = -4.774847184307873e-12; - test_msg->af2 = 0.0; - test_msg->c_ic = -1.1753290891647339e-06; - test_msg->c_is = 1.6205012798309326e-07; - test_msg->c_rc = -36.90625; - test_msg->c_rs = -457.8125; - test_msg->c_uc = -1.6197562217712402e-05; - test_msg->c_us = 8.247792720794678e-06; - test_msg->common.fit_interval = 14400; - test_msg->common.health_bits = 0; - test_msg->common.sid.code = 31; - test_msg->common.sid.sat = 193; - test_msg->common.toe.tow = 450000; - test_msg->common.toe.wn = 2154; - test_msg->common.ura = 2.0; - test_msg->common.valid = 0; - test_msg->dn = 2.678325848736433e-09; - test_msg->ecc = 0.07550019584596157; - test_msg->inc = 0.7309715119432375; - test_msg->inc_dot = 2.0000833114980698e-11; - test_msg->iodc = 817; - test_msg->iode = 49; - test_msg->m0 = 0.30694242158961144; - test_msg->omega0 = -1.1693743795366662; - test_msg->omegadot = -2.7936877968817684e-09; - test_msg->sqrta = 6493.172393798828; - test_msg->tgd = -5.587935447692871e-09; - test_msg->toc.tow = 450000; - test_msg->toc.wn = 2154; - test_msg->w = -1.5662079690885238; - - EXPECT_EQ(send_message( 0x8e, 61568, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ephemeris_qzss_t *test_msg = (msg_ephemeris_qzss_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->af0 = -0.00036908406764268875; + test_msg->af1 = -4.774847184307873e-12; + test_msg->af2 = 0.0; + test_msg->c_ic = -1.1753290891647339e-06; + test_msg->c_is = 1.6205012798309326e-07; + test_msg->c_rc = -36.90625; + test_msg->c_rs = -457.8125; + test_msg->c_uc = -1.6197562217712402e-05; + test_msg->c_us = 8.247792720794678e-06; + test_msg->common.fit_interval = 14400; + test_msg->common.health_bits = 0; + test_msg->common.sid.code = 31; + test_msg->common.sid.sat = 193; + test_msg->common.toe.tow = 450000; + test_msg->common.toe.wn = 2154; + test_msg->common.ura = 2.0; + test_msg->common.valid = 0; + test_msg->dn = 2.678325848736433e-09; + test_msg->ecc = 0.07550019584596157; + test_msg->inc = 0.7309715119432375; + test_msg->inc_dot = 2.0000833114980698e-11; + test_msg->iodc = 817; + test_msg->iode = 49; + test_msg->m0 = 0.30694242158961144; + test_msg->omega0 = -1.1693743795366662; + test_msg->omegadot = -2.7936877968817684e-09; + test_msg->sqrta = 6493.172393798828; + test_msg->tgd = -5.587935447692871e-09; + test_msg->toc.tow = 450000; + test_msg->toc.wn = 2154; + test_msg->w = -1.5662079690885238; + + EXPECT_EQ(send_message(0x8e, 61568, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61568); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->af0*100 - -0.000369084067643*100), 0.05) << "incorrect value for af0, expected -0.000369084067643, is " << last_msg_->af0; - EXPECT_LT((last_msg_->af1*100 - -4.77484718431e-12*100), 0.05) << "incorrect value for af1, expected -4.77484718431e-12, is " << last_msg_->af1; - EXPECT_LT((last_msg_->af2*100 - 0.0*100), 0.05) << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; - EXPECT_LT((last_msg_->c_ic*100 - -1.17532908916e-06*100), 0.05) << "incorrect value for c_ic, expected -1.17532908916e-06, is " << last_msg_->c_ic; - EXPECT_LT((last_msg_->c_is*100 - 1.62050127983e-07*100), 0.05) << "incorrect value for c_is, expected 1.62050127983e-07, is " << last_msg_->c_is; - EXPECT_LT((last_msg_->c_rc*100 - -36.90625*100), 0.05) << "incorrect value for c_rc, expected -36.90625, is " << last_msg_->c_rc; - EXPECT_LT((last_msg_->c_rs*100 - -457.8125*100), 0.05) << "incorrect value for c_rs, expected -457.8125, is " << last_msg_->c_rs; - EXPECT_LT((last_msg_->c_uc*100 - -1.61975622177e-05*100), 0.05) << "incorrect value for c_uc, expected -1.61975622177e-05, is " << last_msg_->c_uc; - EXPECT_LT((last_msg_->c_us*100 - 8.24779272079e-06*100), 0.05) << "incorrect value for c_us, expected 8.24779272079e-06, is " << last_msg_->c_us; - EXPECT_EQ(last_msg_->common.fit_interval, 14400) << "incorrect value for common.fit_interval, expected 14400, is " << last_msg_->common.fit_interval; - EXPECT_EQ(last_msg_->common.health_bits, 0) << "incorrect value for common.health_bits, expected 0, is " << last_msg_->common.health_bits; - EXPECT_EQ(last_msg_->common.sid.code, 31) << "incorrect value for common.sid.code, expected 31, is " << last_msg_->common.sid.code; - EXPECT_EQ(last_msg_->common.sid.sat, 193) << "incorrect value for common.sid.sat, expected 193, is " << last_msg_->common.sid.sat; - EXPECT_EQ(last_msg_->common.toe.tow, 450000) << "incorrect value for common.toe.tow, expected 450000, is " << last_msg_->common.toe.tow; - EXPECT_EQ(last_msg_->common.toe.wn, 2154) << "incorrect value for common.toe.wn, expected 2154, is " << last_msg_->common.toe.wn; - EXPECT_LT((last_msg_->common.ura*100 - 2.0*100), 0.05) << "incorrect value for common.ura, expected 2.0, is " << last_msg_->common.ura; - EXPECT_EQ(last_msg_->common.valid, 0) << "incorrect value for common.valid, expected 0, is " << last_msg_->common.valid; - EXPECT_LT((last_msg_->dn*100 - 2.67832584874e-09*100), 0.05) << "incorrect value for dn, expected 2.67832584874e-09, is " << last_msg_->dn; - EXPECT_LT((last_msg_->ecc*100 - 0.075500195846*100), 0.05) << "incorrect value for ecc, expected 0.075500195846, is " << last_msg_->ecc; - EXPECT_LT((last_msg_->inc*100 - 0.730971511943*100), 0.05) << "incorrect value for inc, expected 0.730971511943, is " << last_msg_->inc; - EXPECT_LT((last_msg_->inc_dot*100 - 2.0000833115e-11*100), 0.05) << "incorrect value for inc_dot, expected 2.0000833115e-11, is " << last_msg_->inc_dot; - EXPECT_EQ(last_msg_->iodc, 817) << "incorrect value for iodc, expected 817, is " << last_msg_->iodc; - EXPECT_EQ(last_msg_->iode, 49) << "incorrect value for iode, expected 49, is " << last_msg_->iode; - EXPECT_LT((last_msg_->m0*100 - 0.30694242159*100), 0.05) << "incorrect value for m0, expected 0.30694242159, is " << last_msg_->m0; - EXPECT_LT((last_msg_->omega0*100 - -1.16937437954*100), 0.05) << "incorrect value for omega0, expected -1.16937437954, is " << last_msg_->omega0; - EXPECT_LT((last_msg_->omegadot*100 - -2.79368779688e-09*100), 0.05) << "incorrect value for omegadot, expected -2.79368779688e-09, is " << last_msg_->omegadot; - EXPECT_LT((last_msg_->sqrta*100 - 6493.1723938*100), 0.05) << "incorrect value for sqrta, expected 6493.1723938, is " << last_msg_->sqrta; - EXPECT_LT((last_msg_->tgd*100 - -5.58793544769e-09*100), 0.05) << "incorrect value for tgd, expected -5.58793544769e-09, is " << last_msg_->tgd; - EXPECT_EQ(last_msg_->toc.tow, 450000) << "incorrect value for toc.tow, expected 450000, is " << last_msg_->toc.tow; - EXPECT_EQ(last_msg_->toc.wn, 2154) << "incorrect value for toc.wn, expected 2154, is " << last_msg_->toc.wn; - EXPECT_LT((last_msg_->w*100 - -1.56620796909*100), 0.05) << "incorrect value for w, expected -1.56620796909, is " << last_msg_->w; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61568); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->af0 * 100 - -0.000369084067643 * 100), 0.05) + << "incorrect value for af0, expected -0.000369084067643, is " + << last_msg_->af0; + EXPECT_LT((last_msg_->af1 * 100 - -4.77484718431e-12 * 100), 0.05) + << "incorrect value for af1, expected -4.77484718431e-12, is " + << last_msg_->af1; + EXPECT_LT((last_msg_->af2 * 100 - 0.0 * 100), 0.05) + << "incorrect value for af2, expected 0.0, is " << last_msg_->af2; + EXPECT_LT((last_msg_->c_ic * 100 - -1.17532908916e-06 * 100), 0.05) + << "incorrect value for c_ic, expected -1.17532908916e-06, is " + << last_msg_->c_ic; + EXPECT_LT((last_msg_->c_is * 100 - 1.62050127983e-07 * 100), 0.05) + << "incorrect value for c_is, expected 1.62050127983e-07, is " + << last_msg_->c_is; + EXPECT_LT((last_msg_->c_rc * 100 - -36.90625 * 100), 0.05) + << "incorrect value for c_rc, expected -36.90625, is " << last_msg_->c_rc; + EXPECT_LT((last_msg_->c_rs * 100 - -457.8125 * 100), 0.05) + << "incorrect value for c_rs, expected -457.8125, is " << last_msg_->c_rs; + EXPECT_LT((last_msg_->c_uc * 100 - -1.61975622177e-05 * 100), 0.05) + << "incorrect value for c_uc, expected -1.61975622177e-05, is " + << last_msg_->c_uc; + EXPECT_LT((last_msg_->c_us * 100 - 8.24779272079e-06 * 100), 0.05) + << "incorrect value for c_us, expected 8.24779272079e-06, is " + << last_msg_->c_us; + EXPECT_EQ(last_msg_->common.fit_interval, 14400) + << "incorrect value for common.fit_interval, expected 14400, is " + << last_msg_->common.fit_interval; + EXPECT_EQ(last_msg_->common.health_bits, 0) + << "incorrect value for common.health_bits, expected 0, is " + << last_msg_->common.health_bits; + EXPECT_EQ(last_msg_->common.sid.code, 31) + << "incorrect value for common.sid.code, expected 31, is " + << last_msg_->common.sid.code; + EXPECT_EQ(last_msg_->common.sid.sat, 193) + << "incorrect value for common.sid.sat, expected 193, is " + << last_msg_->common.sid.sat; + EXPECT_EQ(last_msg_->common.toe.tow, 450000) + << "incorrect value for common.toe.tow, expected 450000, is " + << last_msg_->common.toe.tow; + EXPECT_EQ(last_msg_->common.toe.wn, 2154) + << "incorrect value for common.toe.wn, expected 2154, is " + << last_msg_->common.toe.wn; + EXPECT_LT((last_msg_->common.ura * 100 - 2.0 * 100), 0.05) + << "incorrect value for common.ura, expected 2.0, is " + << last_msg_->common.ura; + EXPECT_EQ(last_msg_->common.valid, 0) + << "incorrect value for common.valid, expected 0, is " + << last_msg_->common.valid; + EXPECT_LT((last_msg_->dn * 100 - 2.67832584874e-09 * 100), 0.05) + << "incorrect value for dn, expected 2.67832584874e-09, is " + << last_msg_->dn; + EXPECT_LT((last_msg_->ecc * 100 - 0.075500195846 * 100), 0.05) + << "incorrect value for ecc, expected 0.075500195846, is " + << last_msg_->ecc; + EXPECT_LT((last_msg_->inc * 100 - 0.730971511943 * 100), 0.05) + << "incorrect value for inc, expected 0.730971511943, is " + << last_msg_->inc; + EXPECT_LT((last_msg_->inc_dot * 100 - 2.0000833115e-11 * 100), 0.05) + << "incorrect value for inc_dot, expected 2.0000833115e-11, is " + << last_msg_->inc_dot; + EXPECT_EQ(last_msg_->iodc, 817) + << "incorrect value for iodc, expected 817, is " << last_msg_->iodc; + EXPECT_EQ(last_msg_->iode, 49) + << "incorrect value for iode, expected 49, is " << last_msg_->iode; + EXPECT_LT((last_msg_->m0 * 100 - 0.30694242159 * 100), 0.05) + << "incorrect value for m0, expected 0.30694242159, is " << last_msg_->m0; + EXPECT_LT((last_msg_->omega0 * 100 - -1.16937437954 * 100), 0.05) + << "incorrect value for omega0, expected -1.16937437954, is " + << last_msg_->omega0; + EXPECT_LT((last_msg_->omegadot * 100 - -2.79368779688e-09 * 100), 0.05) + << "incorrect value for omegadot, expected -2.79368779688e-09, is " + << last_msg_->omegadot; + EXPECT_LT((last_msg_->sqrta * 100 - 6493.1723938 * 100), 0.05) + << "incorrect value for sqrta, expected 6493.1723938, is " + << last_msg_->sqrta; + EXPECT_LT((last_msg_->tgd * 100 - -5.58793544769e-09 * 100), 0.05) + << "incorrect value for tgd, expected -5.58793544769e-09, is " + << last_msg_->tgd; + EXPECT_EQ(last_msg_->toc.tow, 450000) + << "incorrect value for toc.tow, expected 450000, is " + << last_msg_->toc.tow; + EXPECT_EQ(last_msg_->toc.wn, 2154) + << "incorrect value for toc.wn, expected 2154, is " << last_msg_->toc.wn; + EXPECT_LT((last_msg_->w * 100 - -1.56620796909 * 100), 0.05) + << "incorrect value for w, expected -1.56620796909, is " << last_msg_->w; } diff --git a/c/test/legacy/cpp/auto_check_sbp_observation_msgObsDepA.cc b/c/test/legacy/cpp/auto_check_sbp_observation_msgObsDepA.cc index a94d21b46..f06cf65c6 100644 --- a/c/test/legacy/cpp/auto_check_sbp_observation_msgObsDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_observation_msgObsDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/observation/test_msgObsDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/observation/test_msgObsDepA.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_observation_msgObsDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_msgObsDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_msgObsDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_msgObsDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,202 +81,293 @@ class Test_legacy_auto_check_sbp_observation_msgObsDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_msgObsDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,69,0,195,4,98,56,158,67,24,46,7,32,56,235,249,121,244,114,255,255,33,46,67,218,0,238,203,70,124,22,25,3,0,98,43,184,157,2,176,133,197,125,126,71,253,255,185,39,68,55,3,60,173,162,131,98,231,253,255,139,30,33,16,10,128,178,248,136,42,113,253,255,40,20,42,71,13,246,246,17,135,255,51,3,0,64,27,108,249,22,210,41,114,118,131,48,255,255,31,52,226,58,30,23,217, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_a_t* test_msg = ( msg_obs_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 32; - test_msg->header.t.tow = 407084600; - test_msg->header.t.wn = 1838; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 33; - test_msg->obs[0].L.i = -36108; - test_msg->obs[0].P = 2046421816; - test_msg->obs[0].cn0 = 46; - test_msg->obs[0].lock = 55875; - test_msg->obs[0].prn = 0; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].L.f = 98; - test_msg->obs[1].L.i = 203030; - test_msg->obs[1].P = 2085014510; - test_msg->obs[1].cn0 = 43; - test_msg->obs[1].lock = 40376; - test_msg->obs[1].prn = 2; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].L.f = 185; - test_msg->obs[2].L.i = -178306; - test_msg->obs[2].P = 2110096816; - test_msg->obs[2].cn0 = 39; - test_msg->obs[2].lock = 14148; - test_msg->obs[2].prn = 3; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[3].L.f = 139; - test_msg->obs[3].L.i = -137374; - test_msg->obs[3].P = 2208476476; - test_msg->obs[3].cn0 = 30; - test_msg->obs[3].lock = 4129; - test_msg->obs[3].prn = 10; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[4].L.f = 40; - test_msg->obs[4].L.i = -167638; - test_msg->obs[4].P = 2298000000; - test_msg->obs[4].cn0 = 20; - test_msg->obs[4].lock = 18218; - test_msg->obs[4].prn = 13; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[5].L.f = 64; - test_msg->obs[5].L.i = 209919; - test_msg->obs[5].P = 2266101494; - test_msg->obs[5].cn0 = 27; - test_msg->obs[5].lock = 63852; - test_msg->obs[5].prn = 22; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[6].L.f = 31; - test_msg->obs[6].L.i = -53117; - test_msg->obs[6].P = 1987193298; - test_msg->obs[6].cn0 = 52; - test_msg->obs[6].lock = 15074; - test_msg->obs[6].prn = 30; - - EXPECT_EQ(send_message( 0x45, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 32) << "incorrect value for header.n_obs, expected 32, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 407084600) << "incorrect value for header.t.tow, expected 407084600, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1838) << "incorrect value for header.t.wn, expected 1838, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 33) << "incorrect value for obs[0].L.f, expected 33, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, -36108) << "incorrect value for obs[0].L.i, expected -36108, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 2046421816) << "incorrect value for obs[0].P, expected 2046421816, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 46) << "incorrect value for obs[0].cn0, expected 46, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 55875) << "incorrect value for obs[0].lock, expected 55875, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].prn, 0) << "incorrect value for obs[0].prn, expected 0, is " << last_msg_->obs[0].prn; - EXPECT_EQ(last_msg_->obs[1].L.f, 98) << "incorrect value for obs[1].L.f, expected 98, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, 203030) << "incorrect value for obs[1].L.i, expected 203030, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 2085014510) << "incorrect value for obs[1].P, expected 2085014510, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].cn0, 43) << "incorrect value for obs[1].cn0, expected 43, is " << last_msg_->obs[1].cn0; - EXPECT_EQ(last_msg_->obs[1].lock, 40376) << "incorrect value for obs[1].lock, expected 40376, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].prn, 2) << "incorrect value for obs[1].prn, expected 2, is " << last_msg_->obs[1].prn; - EXPECT_EQ(last_msg_->obs[2].L.f, 185) << "incorrect value for obs[2].L.f, expected 185, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, -178306) << "incorrect value for obs[2].L.i, expected -178306, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 2110096816) << "incorrect value for obs[2].P, expected 2110096816, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].cn0, 39) << "incorrect value for obs[2].cn0, expected 39, is " << last_msg_->obs[2].cn0; - EXPECT_EQ(last_msg_->obs[2].lock, 14148) << "incorrect value for obs[2].lock, expected 14148, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].prn, 3) << "incorrect value for obs[2].prn, expected 3, is " << last_msg_->obs[2].prn; - EXPECT_EQ(last_msg_->obs[3].L.f, 139) << "incorrect value for obs[3].L.f, expected 139, is " << last_msg_->obs[3].L.f; - EXPECT_EQ(last_msg_->obs[3].L.i, -137374) << "incorrect value for obs[3].L.i, expected -137374, is " << last_msg_->obs[3].L.i; - EXPECT_EQ(last_msg_->obs[3].P, 2208476476) << "incorrect value for obs[3].P, expected 2208476476, is " << last_msg_->obs[3].P; - EXPECT_EQ(last_msg_->obs[3].cn0, 30) << "incorrect value for obs[3].cn0, expected 30, is " << last_msg_->obs[3].cn0; - EXPECT_EQ(last_msg_->obs[3].lock, 4129) << "incorrect value for obs[3].lock, expected 4129, is " << last_msg_->obs[3].lock; - EXPECT_EQ(last_msg_->obs[3].prn, 10) << "incorrect value for obs[3].prn, expected 10, is " << last_msg_->obs[3].prn; - EXPECT_EQ(last_msg_->obs[4].L.f, 40) << "incorrect value for obs[4].L.f, expected 40, is " << last_msg_->obs[4].L.f; - EXPECT_EQ(last_msg_->obs[4].L.i, -167638) << "incorrect value for obs[4].L.i, expected -167638, is " << last_msg_->obs[4].L.i; - EXPECT_EQ(last_msg_->obs[4].P, 2298000000) << "incorrect value for obs[4].P, expected 2298000000, is " << last_msg_->obs[4].P; - EXPECT_EQ(last_msg_->obs[4].cn0, 20) << "incorrect value for obs[4].cn0, expected 20, is " << last_msg_->obs[4].cn0; - EXPECT_EQ(last_msg_->obs[4].lock, 18218) << "incorrect value for obs[4].lock, expected 18218, is " << last_msg_->obs[4].lock; - EXPECT_EQ(last_msg_->obs[4].prn, 13) << "incorrect value for obs[4].prn, expected 13, is " << last_msg_->obs[4].prn; - EXPECT_EQ(last_msg_->obs[5].L.f, 64) << "incorrect value for obs[5].L.f, expected 64, is " << last_msg_->obs[5].L.f; - EXPECT_EQ(last_msg_->obs[5].L.i, 209919) << "incorrect value for obs[5].L.i, expected 209919, is " << last_msg_->obs[5].L.i; - EXPECT_EQ(last_msg_->obs[5].P, 2266101494) << "incorrect value for obs[5].P, expected 2266101494, is " << last_msg_->obs[5].P; - EXPECT_EQ(last_msg_->obs[5].cn0, 27) << "incorrect value for obs[5].cn0, expected 27, is " << last_msg_->obs[5].cn0; - EXPECT_EQ(last_msg_->obs[5].lock, 63852) << "incorrect value for obs[5].lock, expected 63852, is " << last_msg_->obs[5].lock; - EXPECT_EQ(last_msg_->obs[5].prn, 22) << "incorrect value for obs[5].prn, expected 22, is " << last_msg_->obs[5].prn; - EXPECT_EQ(last_msg_->obs[6].L.f, 31) << "incorrect value for obs[6].L.f, expected 31, is " << last_msg_->obs[6].L.f; - EXPECT_EQ(last_msg_->obs[6].L.i, -53117) << "incorrect value for obs[6].L.i, expected -53117, is " << last_msg_->obs[6].L.i; - EXPECT_EQ(last_msg_->obs[6].P, 1987193298) << "incorrect value for obs[6].P, expected 1987193298, is " << last_msg_->obs[6].P; - EXPECT_EQ(last_msg_->obs[6].cn0, 52) << "incorrect value for obs[6].cn0, expected 52, is " << last_msg_->obs[6].cn0; - EXPECT_EQ(last_msg_->obs[6].lock, 15074) << "incorrect value for obs[6].lock, expected 15074, is " << last_msg_->obs[6].lock; - EXPECT_EQ(last_msg_->obs[6].prn, 30) << "incorrect value for obs[6].prn, expected 30, is " << last_msg_->obs[6].prn; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_msgObsDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 69, 0, 195, 4, 98, 56, 158, 67, 24, 46, 7, 32, 56, + 235, 249, 121, 244, 114, 255, 255, 33, 46, 67, 218, 0, 238, 203, + 70, 124, 22, 25, 3, 0, 98, 43, 184, 157, 2, 176, 133, 197, + 125, 126, 71, 253, 255, 185, 39, 68, 55, 3, 60, 173, 162, 131, + 98, 231, 253, 255, 139, 30, 33, 16, 10, 128, 178, 248, 136, 42, + 113, 253, 255, 40, 20, 42, 71, 13, 246, 246, 17, 135, 255, 51, + 3, 0, 64, 27, 108, 249, 22, 210, 41, 114, 118, 131, 48, 255, + 255, 31, 52, 226, 58, 30, 23, 217, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_a_t *test_msg = (msg_obs_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 32; + test_msg->header.t.tow = 407084600; + test_msg->header.t.wn = 1838; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 33; + test_msg->obs[0].L.i = -36108; + test_msg->obs[0].P = 2046421816; + test_msg->obs[0].cn0 = 46; + test_msg->obs[0].lock = 55875; + test_msg->obs[0].prn = 0; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].L.f = 98; + test_msg->obs[1].L.i = 203030; + test_msg->obs[1].P = 2085014510; + test_msg->obs[1].cn0 = 43; + test_msg->obs[1].lock = 40376; + test_msg->obs[1].prn = 2; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].L.f = 185; + test_msg->obs[2].L.i = -178306; + test_msg->obs[2].P = 2110096816; + test_msg->obs[2].cn0 = 39; + test_msg->obs[2].lock = 14148; + test_msg->obs[2].prn = 3; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[3].L.f = 139; + test_msg->obs[3].L.i = -137374; + test_msg->obs[3].P = 2208476476; + test_msg->obs[3].cn0 = 30; + test_msg->obs[3].lock = 4129; + test_msg->obs[3].prn = 10; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[4].L.f = 40; + test_msg->obs[4].L.i = -167638; + test_msg->obs[4].P = 2298000000; + test_msg->obs[4].cn0 = 20; + test_msg->obs[4].lock = 18218; + test_msg->obs[4].prn = 13; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[5].L.f = 64; + test_msg->obs[5].L.i = 209919; + test_msg->obs[5].P = 2266101494; + test_msg->obs[5].cn0 = 27; + test_msg->obs[5].lock = 63852; + test_msg->obs[5].prn = 22; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[6].L.f = 31; + test_msg->obs[6].L.i = -53117; + test_msg->obs[6].P = 1987193298; + test_msg->obs[6].cn0 = 52; + test_msg->obs[6].lock = 15074; + test_msg->obs[6].prn = 30; + + EXPECT_EQ(send_message(0x45, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 32) + << "incorrect value for header.n_obs, expected 32, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 407084600) + << "incorrect value for header.t.tow, expected 407084600, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1838) + << "incorrect value for header.t.wn, expected 1838, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 33) + << "incorrect value for obs[0].L.f, expected 33, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, -36108) + << "incorrect value for obs[0].L.i, expected -36108, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 2046421816) + << "incorrect value for obs[0].P, expected 2046421816, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 46) + << "incorrect value for obs[0].cn0, expected 46, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 55875) + << "incorrect value for obs[0].lock, expected 55875, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].prn, 0) + << "incorrect value for obs[0].prn, expected 0, is " + << last_msg_->obs[0].prn; + EXPECT_EQ(last_msg_->obs[1].L.f, 98) + << "incorrect value for obs[1].L.f, expected 98, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, 203030) + << "incorrect value for obs[1].L.i, expected 203030, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 2085014510) + << "incorrect value for obs[1].P, expected 2085014510, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].cn0, 43) + << "incorrect value for obs[1].cn0, expected 43, is " + << last_msg_->obs[1].cn0; + EXPECT_EQ(last_msg_->obs[1].lock, 40376) + << "incorrect value for obs[1].lock, expected 40376, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].prn, 2) + << "incorrect value for obs[1].prn, expected 2, is " + << last_msg_->obs[1].prn; + EXPECT_EQ(last_msg_->obs[2].L.f, 185) + << "incorrect value for obs[2].L.f, expected 185, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, -178306) + << "incorrect value for obs[2].L.i, expected -178306, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 2110096816) + << "incorrect value for obs[2].P, expected 2110096816, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].cn0, 39) + << "incorrect value for obs[2].cn0, expected 39, is " + << last_msg_->obs[2].cn0; + EXPECT_EQ(last_msg_->obs[2].lock, 14148) + << "incorrect value for obs[2].lock, expected 14148, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].prn, 3) + << "incorrect value for obs[2].prn, expected 3, is " + << last_msg_->obs[2].prn; + EXPECT_EQ(last_msg_->obs[3].L.f, 139) + << "incorrect value for obs[3].L.f, expected 139, is " + << last_msg_->obs[3].L.f; + EXPECT_EQ(last_msg_->obs[3].L.i, -137374) + << "incorrect value for obs[3].L.i, expected -137374, is " + << last_msg_->obs[3].L.i; + EXPECT_EQ(last_msg_->obs[3].P, 2208476476) + << "incorrect value for obs[3].P, expected 2208476476, is " + << last_msg_->obs[3].P; + EXPECT_EQ(last_msg_->obs[3].cn0, 30) + << "incorrect value for obs[3].cn0, expected 30, is " + << last_msg_->obs[3].cn0; + EXPECT_EQ(last_msg_->obs[3].lock, 4129) + << "incorrect value for obs[3].lock, expected 4129, is " + << last_msg_->obs[3].lock; + EXPECT_EQ(last_msg_->obs[3].prn, 10) + << "incorrect value for obs[3].prn, expected 10, is " + << last_msg_->obs[3].prn; + EXPECT_EQ(last_msg_->obs[4].L.f, 40) + << "incorrect value for obs[4].L.f, expected 40, is " + << last_msg_->obs[4].L.f; + EXPECT_EQ(last_msg_->obs[4].L.i, -167638) + << "incorrect value for obs[4].L.i, expected -167638, is " + << last_msg_->obs[4].L.i; + EXPECT_EQ(last_msg_->obs[4].P, 2298000000) + << "incorrect value for obs[4].P, expected 2298000000, is " + << last_msg_->obs[4].P; + EXPECT_EQ(last_msg_->obs[4].cn0, 20) + << "incorrect value for obs[4].cn0, expected 20, is " + << last_msg_->obs[4].cn0; + EXPECT_EQ(last_msg_->obs[4].lock, 18218) + << "incorrect value for obs[4].lock, expected 18218, is " + << last_msg_->obs[4].lock; + EXPECT_EQ(last_msg_->obs[4].prn, 13) + << "incorrect value for obs[4].prn, expected 13, is " + << last_msg_->obs[4].prn; + EXPECT_EQ(last_msg_->obs[5].L.f, 64) + << "incorrect value for obs[5].L.f, expected 64, is " + << last_msg_->obs[5].L.f; + EXPECT_EQ(last_msg_->obs[5].L.i, 209919) + << "incorrect value for obs[5].L.i, expected 209919, is " + << last_msg_->obs[5].L.i; + EXPECT_EQ(last_msg_->obs[5].P, 2266101494) + << "incorrect value for obs[5].P, expected 2266101494, is " + << last_msg_->obs[5].P; + EXPECT_EQ(last_msg_->obs[5].cn0, 27) + << "incorrect value for obs[5].cn0, expected 27, is " + << last_msg_->obs[5].cn0; + EXPECT_EQ(last_msg_->obs[5].lock, 63852) + << "incorrect value for obs[5].lock, expected 63852, is " + << last_msg_->obs[5].lock; + EXPECT_EQ(last_msg_->obs[5].prn, 22) + << "incorrect value for obs[5].prn, expected 22, is " + << last_msg_->obs[5].prn; + EXPECT_EQ(last_msg_->obs[6].L.f, 31) + << "incorrect value for obs[6].L.f, expected 31, is " + << last_msg_->obs[6].L.f; + EXPECT_EQ(last_msg_->obs[6].L.i, -53117) + << "incorrect value for obs[6].L.i, expected -53117, is " + << last_msg_->obs[6].L.i; + EXPECT_EQ(last_msg_->obs[6].P, 1987193298) + << "incorrect value for obs[6].P, expected 1987193298, is " + << last_msg_->obs[6].P; + EXPECT_EQ(last_msg_->obs[6].cn0, 52) + << "incorrect value for obs[6].cn0, expected 52, is " + << last_msg_->obs[6].cn0; + EXPECT_EQ(last_msg_->obs[6].lock, 15074) + << "incorrect value for obs[6].lock, expected 15074, is " + << last_msg_->obs[6].lock; + EXPECT_EQ(last_msg_->obs[6].prn, 30) + << "incorrect value for obs[6].prn, expected 30, is " + << last_msg_->obs[6].prn; } -class Test_legacy_auto_check_sbp_observation_msgObsDepA1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_msgObsDepA1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_msgObsDepA1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_msgObsDepA1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -290,106 +377,119 @@ class Test_legacy_auto_check_sbp_observation_msgObsDepA1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_msgObsDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,69,0,195,4,20,56,158,67,24,46,7,33,84,52,164,117,102,32,0,0,147,62,62,250,31,234,14, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_a_t* test_msg = ( msg_obs_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 33; - test_msg->header.t.tow = 407084600; - test_msg->header.t.wn = 1838; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 147; - test_msg->obs[0].L.i = 8294; - test_msg->obs[0].P = 1973695572; - test_msg->obs[0].cn0 = 62; - test_msg->obs[0].lock = 64062; - test_msg->obs[0].prn = 31; - - EXPECT_EQ(send_message( 0x45, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 33) << "incorrect value for header.n_obs, expected 33, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 407084600) << "incorrect value for header.t.tow, expected 407084600, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1838) << "incorrect value for header.t.wn, expected 1838, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 147) << "incorrect value for obs[0].L.f, expected 147, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, 8294) << "incorrect value for obs[0].L.i, expected 8294, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 1973695572) << "incorrect value for obs[0].P, expected 1973695572, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 62) << "incorrect value for obs[0].cn0, expected 62, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 64062) << "incorrect value for obs[0].lock, expected 64062, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].prn, 31) << "incorrect value for obs[0].prn, expected 31, is " << last_msg_->obs[0].prn; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_msgObsDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 69, 0, 195, 4, 20, 56, 158, 67, 24, 46, 7, 33, 84, + 52, 164, 117, 102, 32, 0, 0, 147, 62, 62, 250, 31, 234, 14, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_a_t *test_msg = (msg_obs_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 33; + test_msg->header.t.tow = 407084600; + test_msg->header.t.wn = 1838; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 147; + test_msg->obs[0].L.i = 8294; + test_msg->obs[0].P = 1973695572; + test_msg->obs[0].cn0 = 62; + test_msg->obs[0].lock = 64062; + test_msg->obs[0].prn = 31; + + EXPECT_EQ(send_message(0x45, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 33) + << "incorrect value for header.n_obs, expected 33, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 407084600) + << "incorrect value for header.t.tow, expected 407084600, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1838) + << "incorrect value for header.t.wn, expected 1838, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 147) + << "incorrect value for obs[0].L.f, expected 147, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, 8294) + << "incorrect value for obs[0].L.i, expected 8294, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 1973695572) + << "incorrect value for obs[0].P, expected 1973695572, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 62) + << "incorrect value for obs[0].cn0, expected 62, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 64062) + << "incorrect value for obs[0].lock, expected 64062, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].prn, 31) + << "incorrect value for obs[0].prn, expected 31, is " + << last_msg_->obs[0].prn; } -class Test_legacy_auto_check_sbp_observation_msgObsDepA2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_msgObsDepA2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_msgObsDepA2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_msgObsDepA2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -399,202 +499,293 @@ class Test_legacy_auto_check_sbp_observation_msgObsDepA2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_msgObsDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,69,0,195,4,98,0,159,67,24,46,7,32,32,209,249,121,145,114,255,255,141,45,67,218,0,177,128,70,124,79,27,3,0,159,44,184,157,2,59,135,197,125,175,69,253,255,77,40,68,55,3,211,172,162,131,177,229,253,255,20,31,33,16,10,128,178,248,136,116,111,253,255,94,21,42,71,13,182,173,17,135,37,54,3,0,214,27,108,249,22,91,20,114,118,240,47,255,255,129,52,226,58,30,200,119, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_a_t* test_msg = ( msg_obs_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 32; - test_msg->header.t.tow = 407084800; - test_msg->header.t.wn = 1838; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 141; - test_msg->obs[0].L.i = -36207; - test_msg->obs[0].P = 2046415136; - test_msg->obs[0].cn0 = 45; - test_msg->obs[0].lock = 55875; - test_msg->obs[0].prn = 0; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].L.f = 159; - test_msg->obs[1].L.i = 203599; - test_msg->obs[1].P = 2084995249; - test_msg->obs[1].cn0 = 44; - test_msg->obs[1].lock = 40376; - test_msg->obs[1].prn = 2; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].L.f = 77; - test_msg->obs[2].L.i = -178769; - test_msg->obs[2].P = 2110097211; - test_msg->obs[2].cn0 = 40; - test_msg->obs[2].lock = 14148; - test_msg->obs[2].prn = 3; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[3].L.f = 20; - test_msg->obs[3].L.i = -137807; - test_msg->obs[3].P = 2208476371; - test_msg->obs[3].cn0 = 31; - test_msg->obs[3].lock = 4129; - test_msg->obs[3].prn = 10; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[4].L.f = 94; - test_msg->obs[4].L.i = -168076; - test_msg->obs[4].P = 2298000000; - test_msg->obs[4].cn0 = 21; - test_msg->obs[4].lock = 18218; - test_msg->obs[4].prn = 13; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[5].L.f = 214; - test_msg->obs[5].L.i = 210469; - test_msg->obs[5].P = 2266082742; - test_msg->obs[5].cn0 = 27; - test_msg->obs[5].lock = 63852; - test_msg->obs[5].prn = 22; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[6].L.f = 129; - test_msg->obs[6].L.i = -53264; - test_msg->obs[6].P = 1987187803; - test_msg->obs[6].cn0 = 52; - test_msg->obs[6].lock = 15074; - test_msg->obs[6].prn = 30; - - EXPECT_EQ(send_message( 0x45, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 32) << "incorrect value for header.n_obs, expected 32, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 407084800) << "incorrect value for header.t.tow, expected 407084800, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1838) << "incorrect value for header.t.wn, expected 1838, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 141) << "incorrect value for obs[0].L.f, expected 141, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, -36207) << "incorrect value for obs[0].L.i, expected -36207, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 2046415136) << "incorrect value for obs[0].P, expected 2046415136, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 45) << "incorrect value for obs[0].cn0, expected 45, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 55875) << "incorrect value for obs[0].lock, expected 55875, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].prn, 0) << "incorrect value for obs[0].prn, expected 0, is " << last_msg_->obs[0].prn; - EXPECT_EQ(last_msg_->obs[1].L.f, 159) << "incorrect value for obs[1].L.f, expected 159, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, 203599) << "incorrect value for obs[1].L.i, expected 203599, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 2084995249) << "incorrect value for obs[1].P, expected 2084995249, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].cn0, 44) << "incorrect value for obs[1].cn0, expected 44, is " << last_msg_->obs[1].cn0; - EXPECT_EQ(last_msg_->obs[1].lock, 40376) << "incorrect value for obs[1].lock, expected 40376, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].prn, 2) << "incorrect value for obs[1].prn, expected 2, is " << last_msg_->obs[1].prn; - EXPECT_EQ(last_msg_->obs[2].L.f, 77) << "incorrect value for obs[2].L.f, expected 77, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, -178769) << "incorrect value for obs[2].L.i, expected -178769, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 2110097211) << "incorrect value for obs[2].P, expected 2110097211, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].cn0, 40) << "incorrect value for obs[2].cn0, expected 40, is " << last_msg_->obs[2].cn0; - EXPECT_EQ(last_msg_->obs[2].lock, 14148) << "incorrect value for obs[2].lock, expected 14148, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].prn, 3) << "incorrect value for obs[2].prn, expected 3, is " << last_msg_->obs[2].prn; - EXPECT_EQ(last_msg_->obs[3].L.f, 20) << "incorrect value for obs[3].L.f, expected 20, is " << last_msg_->obs[3].L.f; - EXPECT_EQ(last_msg_->obs[3].L.i, -137807) << "incorrect value for obs[3].L.i, expected -137807, is " << last_msg_->obs[3].L.i; - EXPECT_EQ(last_msg_->obs[3].P, 2208476371) << "incorrect value for obs[3].P, expected 2208476371, is " << last_msg_->obs[3].P; - EXPECT_EQ(last_msg_->obs[3].cn0, 31) << "incorrect value for obs[3].cn0, expected 31, is " << last_msg_->obs[3].cn0; - EXPECT_EQ(last_msg_->obs[3].lock, 4129) << "incorrect value for obs[3].lock, expected 4129, is " << last_msg_->obs[3].lock; - EXPECT_EQ(last_msg_->obs[3].prn, 10) << "incorrect value for obs[3].prn, expected 10, is " << last_msg_->obs[3].prn; - EXPECT_EQ(last_msg_->obs[4].L.f, 94) << "incorrect value for obs[4].L.f, expected 94, is " << last_msg_->obs[4].L.f; - EXPECT_EQ(last_msg_->obs[4].L.i, -168076) << "incorrect value for obs[4].L.i, expected -168076, is " << last_msg_->obs[4].L.i; - EXPECT_EQ(last_msg_->obs[4].P, 2298000000) << "incorrect value for obs[4].P, expected 2298000000, is " << last_msg_->obs[4].P; - EXPECT_EQ(last_msg_->obs[4].cn0, 21) << "incorrect value for obs[4].cn0, expected 21, is " << last_msg_->obs[4].cn0; - EXPECT_EQ(last_msg_->obs[4].lock, 18218) << "incorrect value for obs[4].lock, expected 18218, is " << last_msg_->obs[4].lock; - EXPECT_EQ(last_msg_->obs[4].prn, 13) << "incorrect value for obs[4].prn, expected 13, is " << last_msg_->obs[4].prn; - EXPECT_EQ(last_msg_->obs[5].L.f, 214) << "incorrect value for obs[5].L.f, expected 214, is " << last_msg_->obs[5].L.f; - EXPECT_EQ(last_msg_->obs[5].L.i, 210469) << "incorrect value for obs[5].L.i, expected 210469, is " << last_msg_->obs[5].L.i; - EXPECT_EQ(last_msg_->obs[5].P, 2266082742) << "incorrect value for obs[5].P, expected 2266082742, is " << last_msg_->obs[5].P; - EXPECT_EQ(last_msg_->obs[5].cn0, 27) << "incorrect value for obs[5].cn0, expected 27, is " << last_msg_->obs[5].cn0; - EXPECT_EQ(last_msg_->obs[5].lock, 63852) << "incorrect value for obs[5].lock, expected 63852, is " << last_msg_->obs[5].lock; - EXPECT_EQ(last_msg_->obs[5].prn, 22) << "incorrect value for obs[5].prn, expected 22, is " << last_msg_->obs[5].prn; - EXPECT_EQ(last_msg_->obs[6].L.f, 129) << "incorrect value for obs[6].L.f, expected 129, is " << last_msg_->obs[6].L.f; - EXPECT_EQ(last_msg_->obs[6].L.i, -53264) << "incorrect value for obs[6].L.i, expected -53264, is " << last_msg_->obs[6].L.i; - EXPECT_EQ(last_msg_->obs[6].P, 1987187803) << "incorrect value for obs[6].P, expected 1987187803, is " << last_msg_->obs[6].P; - EXPECT_EQ(last_msg_->obs[6].cn0, 52) << "incorrect value for obs[6].cn0, expected 52, is " << last_msg_->obs[6].cn0; - EXPECT_EQ(last_msg_->obs[6].lock, 15074) << "incorrect value for obs[6].lock, expected 15074, is " << last_msg_->obs[6].lock; - EXPECT_EQ(last_msg_->obs[6].prn, 30) << "incorrect value for obs[6].prn, expected 30, is " << last_msg_->obs[6].prn; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_msgObsDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 69, 0, 195, 4, 98, 0, 159, 67, 24, 46, 7, 32, 32, + 209, 249, 121, 145, 114, 255, 255, 141, 45, 67, 218, 0, 177, 128, + 70, 124, 79, 27, 3, 0, 159, 44, 184, 157, 2, 59, 135, 197, + 125, 175, 69, 253, 255, 77, 40, 68, 55, 3, 211, 172, 162, 131, + 177, 229, 253, 255, 20, 31, 33, 16, 10, 128, 178, 248, 136, 116, + 111, 253, 255, 94, 21, 42, 71, 13, 182, 173, 17, 135, 37, 54, + 3, 0, 214, 27, 108, 249, 22, 91, 20, 114, 118, 240, 47, 255, + 255, 129, 52, 226, 58, 30, 200, 119, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_a_t *test_msg = (msg_obs_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 32; + test_msg->header.t.tow = 407084800; + test_msg->header.t.wn = 1838; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 141; + test_msg->obs[0].L.i = -36207; + test_msg->obs[0].P = 2046415136; + test_msg->obs[0].cn0 = 45; + test_msg->obs[0].lock = 55875; + test_msg->obs[0].prn = 0; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].L.f = 159; + test_msg->obs[1].L.i = 203599; + test_msg->obs[1].P = 2084995249; + test_msg->obs[1].cn0 = 44; + test_msg->obs[1].lock = 40376; + test_msg->obs[1].prn = 2; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].L.f = 77; + test_msg->obs[2].L.i = -178769; + test_msg->obs[2].P = 2110097211; + test_msg->obs[2].cn0 = 40; + test_msg->obs[2].lock = 14148; + test_msg->obs[2].prn = 3; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[3].L.f = 20; + test_msg->obs[3].L.i = -137807; + test_msg->obs[3].P = 2208476371; + test_msg->obs[3].cn0 = 31; + test_msg->obs[3].lock = 4129; + test_msg->obs[3].prn = 10; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[4].L.f = 94; + test_msg->obs[4].L.i = -168076; + test_msg->obs[4].P = 2298000000; + test_msg->obs[4].cn0 = 21; + test_msg->obs[4].lock = 18218; + test_msg->obs[4].prn = 13; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[5].L.f = 214; + test_msg->obs[5].L.i = 210469; + test_msg->obs[5].P = 2266082742; + test_msg->obs[5].cn0 = 27; + test_msg->obs[5].lock = 63852; + test_msg->obs[5].prn = 22; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[6].L.f = 129; + test_msg->obs[6].L.i = -53264; + test_msg->obs[6].P = 1987187803; + test_msg->obs[6].cn0 = 52; + test_msg->obs[6].lock = 15074; + test_msg->obs[6].prn = 30; + + EXPECT_EQ(send_message(0x45, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 32) + << "incorrect value for header.n_obs, expected 32, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 407084800) + << "incorrect value for header.t.tow, expected 407084800, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1838) + << "incorrect value for header.t.wn, expected 1838, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 141) + << "incorrect value for obs[0].L.f, expected 141, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, -36207) + << "incorrect value for obs[0].L.i, expected -36207, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 2046415136) + << "incorrect value for obs[0].P, expected 2046415136, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 45) + << "incorrect value for obs[0].cn0, expected 45, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 55875) + << "incorrect value for obs[0].lock, expected 55875, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].prn, 0) + << "incorrect value for obs[0].prn, expected 0, is " + << last_msg_->obs[0].prn; + EXPECT_EQ(last_msg_->obs[1].L.f, 159) + << "incorrect value for obs[1].L.f, expected 159, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, 203599) + << "incorrect value for obs[1].L.i, expected 203599, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 2084995249) + << "incorrect value for obs[1].P, expected 2084995249, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].cn0, 44) + << "incorrect value for obs[1].cn0, expected 44, is " + << last_msg_->obs[1].cn0; + EXPECT_EQ(last_msg_->obs[1].lock, 40376) + << "incorrect value for obs[1].lock, expected 40376, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].prn, 2) + << "incorrect value for obs[1].prn, expected 2, is " + << last_msg_->obs[1].prn; + EXPECT_EQ(last_msg_->obs[2].L.f, 77) + << "incorrect value for obs[2].L.f, expected 77, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, -178769) + << "incorrect value for obs[2].L.i, expected -178769, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 2110097211) + << "incorrect value for obs[2].P, expected 2110097211, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].cn0, 40) + << "incorrect value for obs[2].cn0, expected 40, is " + << last_msg_->obs[2].cn0; + EXPECT_EQ(last_msg_->obs[2].lock, 14148) + << "incorrect value for obs[2].lock, expected 14148, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].prn, 3) + << "incorrect value for obs[2].prn, expected 3, is " + << last_msg_->obs[2].prn; + EXPECT_EQ(last_msg_->obs[3].L.f, 20) + << "incorrect value for obs[3].L.f, expected 20, is " + << last_msg_->obs[3].L.f; + EXPECT_EQ(last_msg_->obs[3].L.i, -137807) + << "incorrect value for obs[3].L.i, expected -137807, is " + << last_msg_->obs[3].L.i; + EXPECT_EQ(last_msg_->obs[3].P, 2208476371) + << "incorrect value for obs[3].P, expected 2208476371, is " + << last_msg_->obs[3].P; + EXPECT_EQ(last_msg_->obs[3].cn0, 31) + << "incorrect value for obs[3].cn0, expected 31, is " + << last_msg_->obs[3].cn0; + EXPECT_EQ(last_msg_->obs[3].lock, 4129) + << "incorrect value for obs[3].lock, expected 4129, is " + << last_msg_->obs[3].lock; + EXPECT_EQ(last_msg_->obs[3].prn, 10) + << "incorrect value for obs[3].prn, expected 10, is " + << last_msg_->obs[3].prn; + EXPECT_EQ(last_msg_->obs[4].L.f, 94) + << "incorrect value for obs[4].L.f, expected 94, is " + << last_msg_->obs[4].L.f; + EXPECT_EQ(last_msg_->obs[4].L.i, -168076) + << "incorrect value for obs[4].L.i, expected -168076, is " + << last_msg_->obs[4].L.i; + EXPECT_EQ(last_msg_->obs[4].P, 2298000000) + << "incorrect value for obs[4].P, expected 2298000000, is " + << last_msg_->obs[4].P; + EXPECT_EQ(last_msg_->obs[4].cn0, 21) + << "incorrect value for obs[4].cn0, expected 21, is " + << last_msg_->obs[4].cn0; + EXPECT_EQ(last_msg_->obs[4].lock, 18218) + << "incorrect value for obs[4].lock, expected 18218, is " + << last_msg_->obs[4].lock; + EXPECT_EQ(last_msg_->obs[4].prn, 13) + << "incorrect value for obs[4].prn, expected 13, is " + << last_msg_->obs[4].prn; + EXPECT_EQ(last_msg_->obs[5].L.f, 214) + << "incorrect value for obs[5].L.f, expected 214, is " + << last_msg_->obs[5].L.f; + EXPECT_EQ(last_msg_->obs[5].L.i, 210469) + << "incorrect value for obs[5].L.i, expected 210469, is " + << last_msg_->obs[5].L.i; + EXPECT_EQ(last_msg_->obs[5].P, 2266082742) + << "incorrect value for obs[5].P, expected 2266082742, is " + << last_msg_->obs[5].P; + EXPECT_EQ(last_msg_->obs[5].cn0, 27) + << "incorrect value for obs[5].cn0, expected 27, is " + << last_msg_->obs[5].cn0; + EXPECT_EQ(last_msg_->obs[5].lock, 63852) + << "incorrect value for obs[5].lock, expected 63852, is " + << last_msg_->obs[5].lock; + EXPECT_EQ(last_msg_->obs[5].prn, 22) + << "incorrect value for obs[5].prn, expected 22, is " + << last_msg_->obs[5].prn; + EXPECT_EQ(last_msg_->obs[6].L.f, 129) + << "incorrect value for obs[6].L.f, expected 129, is " + << last_msg_->obs[6].L.f; + EXPECT_EQ(last_msg_->obs[6].L.i, -53264) + << "incorrect value for obs[6].L.i, expected -53264, is " + << last_msg_->obs[6].L.i; + EXPECT_EQ(last_msg_->obs[6].P, 1987187803) + << "incorrect value for obs[6].P, expected 1987187803, is " + << last_msg_->obs[6].P; + EXPECT_EQ(last_msg_->obs[6].cn0, 52) + << "incorrect value for obs[6].cn0, expected 52, is " + << last_msg_->obs[6].cn0; + EXPECT_EQ(last_msg_->obs[6].lock, 15074) + << "incorrect value for obs[6].lock, expected 15074, is " + << last_msg_->obs[6].lock; + EXPECT_EQ(last_msg_->obs[6].prn, 30) + << "incorrect value for obs[6].prn, expected 30, is " + << last_msg_->obs[6].prn; } -class Test_legacy_auto_check_sbp_observation_msgObsDepA3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_msgObsDepA3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_msgObsDepA3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_msgObsDepA3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -604,106 +795,119 @@ class Test_legacy_auto_check_sbp_observation_msgObsDepA3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_msgObsDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,69,0,195,4,20,0,159,67,24,46,7,33,49,19,164,117,120,32,0,0,222,63,62,250,31,11,231, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_a_t* test_msg = ( msg_obs_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 33; - test_msg->header.t.tow = 407084800; - test_msg->header.t.wn = 1838; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 222; - test_msg->obs[0].L.i = 8312; - test_msg->obs[0].P = 1973687089; - test_msg->obs[0].cn0 = 63; - test_msg->obs[0].lock = 64062; - test_msg->obs[0].prn = 31; - - EXPECT_EQ(send_message( 0x45, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 33) << "incorrect value for header.n_obs, expected 33, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 407084800) << "incorrect value for header.t.tow, expected 407084800, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1838) << "incorrect value for header.t.wn, expected 1838, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 222) << "incorrect value for obs[0].L.f, expected 222, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, 8312) << "incorrect value for obs[0].L.i, expected 8312, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 1973687089) << "incorrect value for obs[0].P, expected 1973687089, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 63) << "incorrect value for obs[0].cn0, expected 63, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 64062) << "incorrect value for obs[0].lock, expected 64062, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].prn, 31) << "incorrect value for obs[0].prn, expected 31, is " << last_msg_->obs[0].prn; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_msgObsDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 69, 0, 195, 4, 20, 0, 159, 67, 24, 46, 7, 33, 49, + 19, 164, 117, 120, 32, 0, 0, 222, 63, 62, 250, 31, 11, 231, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_a_t *test_msg = (msg_obs_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 33; + test_msg->header.t.tow = 407084800; + test_msg->header.t.wn = 1838; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 222; + test_msg->obs[0].L.i = 8312; + test_msg->obs[0].P = 1973687089; + test_msg->obs[0].cn0 = 63; + test_msg->obs[0].lock = 64062; + test_msg->obs[0].prn = 31; + + EXPECT_EQ(send_message(0x45, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 33) + << "incorrect value for header.n_obs, expected 33, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 407084800) + << "incorrect value for header.t.tow, expected 407084800, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1838) + << "incorrect value for header.t.wn, expected 1838, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 222) + << "incorrect value for obs[0].L.f, expected 222, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, 8312) + << "incorrect value for obs[0].L.i, expected 8312, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 1973687089) + << "incorrect value for obs[0].P, expected 1973687089, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 63) + << "incorrect value for obs[0].cn0, expected 63, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 64062) + << "incorrect value for obs[0].lock, expected 64062, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].prn, 31) + << "incorrect value for obs[0].prn, expected 31, is " + << last_msg_->obs[0].prn; } -class Test_legacy_auto_check_sbp_observation_msgObsDepA4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_msgObsDepA4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_msgObsDepA4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_msgObsDepA4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -713,170 +917,235 @@ class Test_legacy_auto_check_sbp_observation_msgObsDepA4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_msgObsDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,69,0,195,4,72,96,162,68,24,46,7,16,87,132,217,121,121,148,255,255,189,43,175,147,0,132,64,200,125,106,31,254,255,1,41,14,177,3,128,178,248,136,70,68,254,255,166,18,184,133,13,24,127,178,134,6,25,2,0,249,28,33,96,22,170,104,86,118,67,112,255,255,203,56,208,88,30,43,107, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_a_t* test_msg = ( msg_obs_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 16; - test_msg->header.t.tow = 407151200; - test_msg->header.t.wn = 1838; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 189; - test_msg->obs[0].L.i = -27527; - test_msg->obs[0].P = 2044298327; - test_msg->obs[0].cn0 = 43; - test_msg->obs[0].lock = 37807; - test_msg->obs[0].prn = 0; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].L.f = 1; - test_msg->obs[1].L.i = -123030; - test_msg->obs[1].P = 2110275716; - test_msg->obs[1].cn0 = 41; - test_msg->obs[1].lock = 45326; - test_msg->obs[1].prn = 3; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].L.f = 166; - test_msg->obs[2].L.i = -113594; - test_msg->obs[2].P = 2298000000; - test_msg->obs[2].cn0 = 18; - test_msg->obs[2].lock = 34232; - test_msg->obs[2].prn = 13; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[3].L.f = 249; - test_msg->obs[3].L.i = 137478; - test_msg->obs[3].P = 2259844888; - test_msg->obs[3].cn0 = 28; - test_msg->obs[3].lock = 24609; - test_msg->obs[3].prn = 22; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[4].L.f = 203; - test_msg->obs[4].L.i = -36797; - test_msg->obs[4].P = 1985374378; - test_msg->obs[4].cn0 = 56; - test_msg->obs[4].lock = 22736; - test_msg->obs[4].prn = 30; - - EXPECT_EQ(send_message( 0x45, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 16) << "incorrect value for header.n_obs, expected 16, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 407151200) << "incorrect value for header.t.tow, expected 407151200, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1838) << "incorrect value for header.t.wn, expected 1838, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 189) << "incorrect value for obs[0].L.f, expected 189, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, -27527) << "incorrect value for obs[0].L.i, expected -27527, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 2044298327) << "incorrect value for obs[0].P, expected 2044298327, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 43) << "incorrect value for obs[0].cn0, expected 43, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 37807) << "incorrect value for obs[0].lock, expected 37807, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].prn, 0) << "incorrect value for obs[0].prn, expected 0, is " << last_msg_->obs[0].prn; - EXPECT_EQ(last_msg_->obs[1].L.f, 1) << "incorrect value for obs[1].L.f, expected 1, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, -123030) << "incorrect value for obs[1].L.i, expected -123030, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 2110275716) << "incorrect value for obs[1].P, expected 2110275716, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].cn0, 41) << "incorrect value for obs[1].cn0, expected 41, is " << last_msg_->obs[1].cn0; - EXPECT_EQ(last_msg_->obs[1].lock, 45326) << "incorrect value for obs[1].lock, expected 45326, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].prn, 3) << "incorrect value for obs[1].prn, expected 3, is " << last_msg_->obs[1].prn; - EXPECT_EQ(last_msg_->obs[2].L.f, 166) << "incorrect value for obs[2].L.f, expected 166, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, -113594) << "incorrect value for obs[2].L.i, expected -113594, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 2298000000) << "incorrect value for obs[2].P, expected 2298000000, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].cn0, 18) << "incorrect value for obs[2].cn0, expected 18, is " << last_msg_->obs[2].cn0; - EXPECT_EQ(last_msg_->obs[2].lock, 34232) << "incorrect value for obs[2].lock, expected 34232, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].prn, 13) << "incorrect value for obs[2].prn, expected 13, is " << last_msg_->obs[2].prn; - EXPECT_EQ(last_msg_->obs[3].L.f, 249) << "incorrect value for obs[3].L.f, expected 249, is " << last_msg_->obs[3].L.f; - EXPECT_EQ(last_msg_->obs[3].L.i, 137478) << "incorrect value for obs[3].L.i, expected 137478, is " << last_msg_->obs[3].L.i; - EXPECT_EQ(last_msg_->obs[3].P, 2259844888) << "incorrect value for obs[3].P, expected 2259844888, is " << last_msg_->obs[3].P; - EXPECT_EQ(last_msg_->obs[3].cn0, 28) << "incorrect value for obs[3].cn0, expected 28, is " << last_msg_->obs[3].cn0; - EXPECT_EQ(last_msg_->obs[3].lock, 24609) << "incorrect value for obs[3].lock, expected 24609, is " << last_msg_->obs[3].lock; - EXPECT_EQ(last_msg_->obs[3].prn, 22) << "incorrect value for obs[3].prn, expected 22, is " << last_msg_->obs[3].prn; - EXPECT_EQ(last_msg_->obs[4].L.f, 203) << "incorrect value for obs[4].L.f, expected 203, is " << last_msg_->obs[4].L.f; - EXPECT_EQ(last_msg_->obs[4].L.i, -36797) << "incorrect value for obs[4].L.i, expected -36797, is " << last_msg_->obs[4].L.i; - EXPECT_EQ(last_msg_->obs[4].P, 1985374378) << "incorrect value for obs[4].P, expected 1985374378, is " << last_msg_->obs[4].P; - EXPECT_EQ(last_msg_->obs[4].cn0, 56) << "incorrect value for obs[4].cn0, expected 56, is " << last_msg_->obs[4].cn0; - EXPECT_EQ(last_msg_->obs[4].lock, 22736) << "incorrect value for obs[4].lock, expected 22736, is " << last_msg_->obs[4].lock; - EXPECT_EQ(last_msg_->obs[4].prn, 30) << "incorrect value for obs[4].prn, expected 30, is " << last_msg_->obs[4].prn; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_msgObsDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 69, 0, 195, 4, 72, 96, 162, 68, 24, 46, 7, 16, 87, + 132, 217, 121, 121, 148, 255, 255, 189, 43, 175, 147, 0, 132, 64, + 200, 125, 106, 31, 254, 255, 1, 41, 14, 177, 3, 128, 178, 248, + 136, 70, 68, 254, 255, 166, 18, 184, 133, 13, 24, 127, 178, 134, + 6, 25, 2, 0, 249, 28, 33, 96, 22, 170, 104, 86, 118, 67, + 112, 255, 255, 203, 56, 208, 88, 30, 43, 107, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_a_t *test_msg = (msg_obs_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 16; + test_msg->header.t.tow = 407151200; + test_msg->header.t.wn = 1838; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 189; + test_msg->obs[0].L.i = -27527; + test_msg->obs[0].P = 2044298327; + test_msg->obs[0].cn0 = 43; + test_msg->obs[0].lock = 37807; + test_msg->obs[0].prn = 0; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].L.f = 1; + test_msg->obs[1].L.i = -123030; + test_msg->obs[1].P = 2110275716; + test_msg->obs[1].cn0 = 41; + test_msg->obs[1].lock = 45326; + test_msg->obs[1].prn = 3; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].L.f = 166; + test_msg->obs[2].L.i = -113594; + test_msg->obs[2].P = 2298000000; + test_msg->obs[2].cn0 = 18; + test_msg->obs[2].lock = 34232; + test_msg->obs[2].prn = 13; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[3].L.f = 249; + test_msg->obs[3].L.i = 137478; + test_msg->obs[3].P = 2259844888; + test_msg->obs[3].cn0 = 28; + test_msg->obs[3].lock = 24609; + test_msg->obs[3].prn = 22; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[4].L.f = 203; + test_msg->obs[4].L.i = -36797; + test_msg->obs[4].P = 1985374378; + test_msg->obs[4].cn0 = 56; + test_msg->obs[4].lock = 22736; + test_msg->obs[4].prn = 30; + + EXPECT_EQ(send_message(0x45, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 16) + << "incorrect value for header.n_obs, expected 16, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 407151200) + << "incorrect value for header.t.tow, expected 407151200, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1838) + << "incorrect value for header.t.wn, expected 1838, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 189) + << "incorrect value for obs[0].L.f, expected 189, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, -27527) + << "incorrect value for obs[0].L.i, expected -27527, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 2044298327) + << "incorrect value for obs[0].P, expected 2044298327, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 43) + << "incorrect value for obs[0].cn0, expected 43, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 37807) + << "incorrect value for obs[0].lock, expected 37807, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].prn, 0) + << "incorrect value for obs[0].prn, expected 0, is " + << last_msg_->obs[0].prn; + EXPECT_EQ(last_msg_->obs[1].L.f, 1) + << "incorrect value for obs[1].L.f, expected 1, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, -123030) + << "incorrect value for obs[1].L.i, expected -123030, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 2110275716) + << "incorrect value for obs[1].P, expected 2110275716, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].cn0, 41) + << "incorrect value for obs[1].cn0, expected 41, is " + << last_msg_->obs[1].cn0; + EXPECT_EQ(last_msg_->obs[1].lock, 45326) + << "incorrect value for obs[1].lock, expected 45326, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].prn, 3) + << "incorrect value for obs[1].prn, expected 3, is " + << last_msg_->obs[1].prn; + EXPECT_EQ(last_msg_->obs[2].L.f, 166) + << "incorrect value for obs[2].L.f, expected 166, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, -113594) + << "incorrect value for obs[2].L.i, expected -113594, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 2298000000) + << "incorrect value for obs[2].P, expected 2298000000, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].cn0, 18) + << "incorrect value for obs[2].cn0, expected 18, is " + << last_msg_->obs[2].cn0; + EXPECT_EQ(last_msg_->obs[2].lock, 34232) + << "incorrect value for obs[2].lock, expected 34232, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].prn, 13) + << "incorrect value for obs[2].prn, expected 13, is " + << last_msg_->obs[2].prn; + EXPECT_EQ(last_msg_->obs[3].L.f, 249) + << "incorrect value for obs[3].L.f, expected 249, is " + << last_msg_->obs[3].L.f; + EXPECT_EQ(last_msg_->obs[3].L.i, 137478) + << "incorrect value for obs[3].L.i, expected 137478, is " + << last_msg_->obs[3].L.i; + EXPECT_EQ(last_msg_->obs[3].P, 2259844888) + << "incorrect value for obs[3].P, expected 2259844888, is " + << last_msg_->obs[3].P; + EXPECT_EQ(last_msg_->obs[3].cn0, 28) + << "incorrect value for obs[3].cn0, expected 28, is " + << last_msg_->obs[3].cn0; + EXPECT_EQ(last_msg_->obs[3].lock, 24609) + << "incorrect value for obs[3].lock, expected 24609, is " + << last_msg_->obs[3].lock; + EXPECT_EQ(last_msg_->obs[3].prn, 22) + << "incorrect value for obs[3].prn, expected 22, is " + << last_msg_->obs[3].prn; + EXPECT_EQ(last_msg_->obs[4].L.f, 203) + << "incorrect value for obs[4].L.f, expected 203, is " + << last_msg_->obs[4].L.f; + EXPECT_EQ(last_msg_->obs[4].L.i, -36797) + << "incorrect value for obs[4].L.i, expected -36797, is " + << last_msg_->obs[4].L.i; + EXPECT_EQ(last_msg_->obs[4].P, 1985374378) + << "incorrect value for obs[4].P, expected 1985374378, is " + << last_msg_->obs[4].P; + EXPECT_EQ(last_msg_->obs[4].cn0, 56) + << "incorrect value for obs[4].cn0, expected 56, is " + << last_msg_->obs[4].cn0; + EXPECT_EQ(last_msg_->obs[4].lock, 22736) + << "incorrect value for obs[4].lock, expected 22736, is " + << last_msg_->obs[4].lock; + EXPECT_EQ(last_msg_->obs[4].prn, 30) + << "incorrect value for obs[4].prn, expected 30, is " + << last_msg_->obs[4].prn; } -class Test_legacy_auto_check_sbp_observation_msgObsDepA5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_observation_msgObsDepA5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_observation_msgObsDepA5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_observation_msgObsDepA5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_obs_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_obs_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -886,119 +1155,190 @@ class Test_legacy_auto_check_sbp_observation_msgObsDepA5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_obs_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_observation_msgObsDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,69,0,195,4,72,40,163,68,24,46,7,16,132,107,217,121,14,148,255,255,1,44,175,147,0,129,66,200,125,148,29,254,255,153,41,14,177,3,128,178,248,136,143,66,254,255,222,18,184,133,13,158,53,178,134,42,27,2,0,237,30,33,96,22,38,83,86,118,168,111,255,255,45,56,208,88,30,1,175, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_obs_dep_a_t* test_msg = ( msg_obs_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.n_obs = 16; - test_msg->header.t.tow = 407151400; - test_msg->header.t.wn = 1838; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[0].L.f = 1; - test_msg->obs[0].L.i = -27634; - test_msg->obs[0].P = 2044291972; - test_msg->obs[0].cn0 = 44; - test_msg->obs[0].lock = 37807; - test_msg->obs[0].prn = 0; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[1].L.f = 153; - test_msg->obs[1].L.i = -123500; - test_msg->obs[1].P = 2110276225; - test_msg->obs[1].cn0 = 41; - test_msg->obs[1].lock = 45326; - test_msg->obs[1].prn = 3; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[2].L.f = 222; - test_msg->obs[2].L.i = -114033; - test_msg->obs[2].P = 2298000000; - test_msg->obs[2].cn0 = 18; - test_msg->obs[2].lock = 34232; - test_msg->obs[2].prn = 13; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[3].L.f = 237; - test_msg->obs[3].L.i = 138026; - test_msg->obs[3].P = 2259826078; - test_msg->obs[3].cn0 = 30; - test_msg->obs[3].lock = 24609; - test_msg->obs[3].prn = 22; - if (sizeof(test_msg->obs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); - } - test_msg->obs[4].L.f = 45; - test_msg->obs[4].L.i = -36952; - test_msg->obs[4].P = 1985368870; - test_msg->obs[4].cn0 = 56; - test_msg->obs[4].lock = 22736; - test_msg->obs[4].prn = 30; - - EXPECT_EQ(send_message( 0x45, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.n_obs, 16) << "incorrect value for header.n_obs, expected 16, is " << last_msg_->header.n_obs; - EXPECT_EQ(last_msg_->header.t.tow, 407151400) << "incorrect value for header.t.tow, expected 407151400, is " << last_msg_->header.t.tow; - EXPECT_EQ(last_msg_->header.t.wn, 1838) << "incorrect value for header.t.wn, expected 1838, is " << last_msg_->header.t.wn; - EXPECT_EQ(last_msg_->obs[0].L.f, 1) << "incorrect value for obs[0].L.f, expected 1, is " << last_msg_->obs[0].L.f; - EXPECT_EQ(last_msg_->obs[0].L.i, -27634) << "incorrect value for obs[0].L.i, expected -27634, is " << last_msg_->obs[0].L.i; - EXPECT_EQ(last_msg_->obs[0].P, 2044291972) << "incorrect value for obs[0].P, expected 2044291972, is " << last_msg_->obs[0].P; - EXPECT_EQ(last_msg_->obs[0].cn0, 44) << "incorrect value for obs[0].cn0, expected 44, is " << last_msg_->obs[0].cn0; - EXPECT_EQ(last_msg_->obs[0].lock, 37807) << "incorrect value for obs[0].lock, expected 37807, is " << last_msg_->obs[0].lock; - EXPECT_EQ(last_msg_->obs[0].prn, 0) << "incorrect value for obs[0].prn, expected 0, is " << last_msg_->obs[0].prn; - EXPECT_EQ(last_msg_->obs[1].L.f, 153) << "incorrect value for obs[1].L.f, expected 153, is " << last_msg_->obs[1].L.f; - EXPECT_EQ(last_msg_->obs[1].L.i, -123500) << "incorrect value for obs[1].L.i, expected -123500, is " << last_msg_->obs[1].L.i; - EXPECT_EQ(last_msg_->obs[1].P, 2110276225) << "incorrect value for obs[1].P, expected 2110276225, is " << last_msg_->obs[1].P; - EXPECT_EQ(last_msg_->obs[1].cn0, 41) << "incorrect value for obs[1].cn0, expected 41, is " << last_msg_->obs[1].cn0; - EXPECT_EQ(last_msg_->obs[1].lock, 45326) << "incorrect value for obs[1].lock, expected 45326, is " << last_msg_->obs[1].lock; - EXPECT_EQ(last_msg_->obs[1].prn, 3) << "incorrect value for obs[1].prn, expected 3, is " << last_msg_->obs[1].prn; - EXPECT_EQ(last_msg_->obs[2].L.f, 222) << "incorrect value for obs[2].L.f, expected 222, is " << last_msg_->obs[2].L.f; - EXPECT_EQ(last_msg_->obs[2].L.i, -114033) << "incorrect value for obs[2].L.i, expected -114033, is " << last_msg_->obs[2].L.i; - EXPECT_EQ(last_msg_->obs[2].P, 2298000000) << "incorrect value for obs[2].P, expected 2298000000, is " << last_msg_->obs[2].P; - EXPECT_EQ(last_msg_->obs[2].cn0, 18) << "incorrect value for obs[2].cn0, expected 18, is " << last_msg_->obs[2].cn0; - EXPECT_EQ(last_msg_->obs[2].lock, 34232) << "incorrect value for obs[2].lock, expected 34232, is " << last_msg_->obs[2].lock; - EXPECT_EQ(last_msg_->obs[2].prn, 13) << "incorrect value for obs[2].prn, expected 13, is " << last_msg_->obs[2].prn; - EXPECT_EQ(last_msg_->obs[3].L.f, 237) << "incorrect value for obs[3].L.f, expected 237, is " << last_msg_->obs[3].L.f; - EXPECT_EQ(last_msg_->obs[3].L.i, 138026) << "incorrect value for obs[3].L.i, expected 138026, is " << last_msg_->obs[3].L.i; - EXPECT_EQ(last_msg_->obs[3].P, 2259826078) << "incorrect value for obs[3].P, expected 2259826078, is " << last_msg_->obs[3].P; - EXPECT_EQ(last_msg_->obs[3].cn0, 30) << "incorrect value for obs[3].cn0, expected 30, is " << last_msg_->obs[3].cn0; - EXPECT_EQ(last_msg_->obs[3].lock, 24609) << "incorrect value for obs[3].lock, expected 24609, is " << last_msg_->obs[3].lock; - EXPECT_EQ(last_msg_->obs[3].prn, 22) << "incorrect value for obs[3].prn, expected 22, is " << last_msg_->obs[3].prn; - EXPECT_EQ(last_msg_->obs[4].L.f, 45) << "incorrect value for obs[4].L.f, expected 45, is " << last_msg_->obs[4].L.f; - EXPECT_EQ(last_msg_->obs[4].L.i, -36952) << "incorrect value for obs[4].L.i, expected -36952, is " << last_msg_->obs[4].L.i; - EXPECT_EQ(last_msg_->obs[4].P, 1985368870) << "incorrect value for obs[4].P, expected 1985368870, is " << last_msg_->obs[4].P; - EXPECT_EQ(last_msg_->obs[4].cn0, 56) << "incorrect value for obs[4].cn0, expected 56, is " << last_msg_->obs[4].cn0; - EXPECT_EQ(last_msg_->obs[4].lock, 22736) << "incorrect value for obs[4].lock, expected 22736, is " << last_msg_->obs[4].lock; - EXPECT_EQ(last_msg_->obs[4].prn, 30) << "incorrect value for obs[4].prn, expected 30, is " << last_msg_->obs[4].prn; +}; + +TEST_F(Test_legacy_auto_check_sbp_observation_msgObsDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 69, 0, 195, 4, 72, 40, 163, 68, 24, 46, 7, 16, 132, + 107, 217, 121, 14, 148, 255, 255, 1, 44, 175, 147, 0, 129, 66, + 200, 125, 148, 29, 254, 255, 153, 41, 14, 177, 3, 128, 178, 248, + 136, 143, 66, 254, 255, 222, 18, 184, 133, 13, 158, 53, 178, 134, + 42, 27, 2, 0, 237, 30, 33, 96, 22, 38, 83, 86, 118, 168, + 111, 255, 255, 45, 56, 208, 88, 30, 1, 175, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_obs_dep_a_t *test_msg = (msg_obs_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.n_obs = 16; + test_msg->header.t.tow = 407151400; + test_msg->header.t.wn = 1838; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[0].L.f = 1; + test_msg->obs[0].L.i = -27634; + test_msg->obs[0].P = 2044291972; + test_msg->obs[0].cn0 = 44; + test_msg->obs[0].lock = 37807; + test_msg->obs[0].prn = 0; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[1].L.f = 153; + test_msg->obs[1].L.i = -123500; + test_msg->obs[1].P = 2110276225; + test_msg->obs[1].cn0 = 41; + test_msg->obs[1].lock = 45326; + test_msg->obs[1].prn = 3; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[2].L.f = 222; + test_msg->obs[2].L.i = -114033; + test_msg->obs[2].P = 2298000000; + test_msg->obs[2].cn0 = 18; + test_msg->obs[2].lock = 34232; + test_msg->obs[2].prn = 13; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[3].L.f = 237; + test_msg->obs[3].L.i = 138026; + test_msg->obs[3].P = 2259826078; + test_msg->obs[3].cn0 = 30; + test_msg->obs[3].lock = 24609; + test_msg->obs[3].prn = 22; + if (sizeof(test_msg->obs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->obs[0])); + } + test_msg->obs[4].L.f = 45; + test_msg->obs[4].L.i = -36952; + test_msg->obs[4].P = 1985368870; + test_msg->obs[4].cn0 = 56; + test_msg->obs[4].lock = 22736; + test_msg->obs[4].prn = 30; + + EXPECT_EQ(send_message(0x45, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.n_obs, 16) + << "incorrect value for header.n_obs, expected 16, is " + << last_msg_->header.n_obs; + EXPECT_EQ(last_msg_->header.t.tow, 407151400) + << "incorrect value for header.t.tow, expected 407151400, is " + << last_msg_->header.t.tow; + EXPECT_EQ(last_msg_->header.t.wn, 1838) + << "incorrect value for header.t.wn, expected 1838, is " + << last_msg_->header.t.wn; + EXPECT_EQ(last_msg_->obs[0].L.f, 1) + << "incorrect value for obs[0].L.f, expected 1, is " + << last_msg_->obs[0].L.f; + EXPECT_EQ(last_msg_->obs[0].L.i, -27634) + << "incorrect value for obs[0].L.i, expected -27634, is " + << last_msg_->obs[0].L.i; + EXPECT_EQ(last_msg_->obs[0].P, 2044291972) + << "incorrect value for obs[0].P, expected 2044291972, is " + << last_msg_->obs[0].P; + EXPECT_EQ(last_msg_->obs[0].cn0, 44) + << "incorrect value for obs[0].cn0, expected 44, is " + << last_msg_->obs[0].cn0; + EXPECT_EQ(last_msg_->obs[0].lock, 37807) + << "incorrect value for obs[0].lock, expected 37807, is " + << last_msg_->obs[0].lock; + EXPECT_EQ(last_msg_->obs[0].prn, 0) + << "incorrect value for obs[0].prn, expected 0, is " + << last_msg_->obs[0].prn; + EXPECT_EQ(last_msg_->obs[1].L.f, 153) + << "incorrect value for obs[1].L.f, expected 153, is " + << last_msg_->obs[1].L.f; + EXPECT_EQ(last_msg_->obs[1].L.i, -123500) + << "incorrect value for obs[1].L.i, expected -123500, is " + << last_msg_->obs[1].L.i; + EXPECT_EQ(last_msg_->obs[1].P, 2110276225) + << "incorrect value for obs[1].P, expected 2110276225, is " + << last_msg_->obs[1].P; + EXPECT_EQ(last_msg_->obs[1].cn0, 41) + << "incorrect value for obs[1].cn0, expected 41, is " + << last_msg_->obs[1].cn0; + EXPECT_EQ(last_msg_->obs[1].lock, 45326) + << "incorrect value for obs[1].lock, expected 45326, is " + << last_msg_->obs[1].lock; + EXPECT_EQ(last_msg_->obs[1].prn, 3) + << "incorrect value for obs[1].prn, expected 3, is " + << last_msg_->obs[1].prn; + EXPECT_EQ(last_msg_->obs[2].L.f, 222) + << "incorrect value for obs[2].L.f, expected 222, is " + << last_msg_->obs[2].L.f; + EXPECT_EQ(last_msg_->obs[2].L.i, -114033) + << "incorrect value for obs[2].L.i, expected -114033, is " + << last_msg_->obs[2].L.i; + EXPECT_EQ(last_msg_->obs[2].P, 2298000000) + << "incorrect value for obs[2].P, expected 2298000000, is " + << last_msg_->obs[2].P; + EXPECT_EQ(last_msg_->obs[2].cn0, 18) + << "incorrect value for obs[2].cn0, expected 18, is " + << last_msg_->obs[2].cn0; + EXPECT_EQ(last_msg_->obs[2].lock, 34232) + << "incorrect value for obs[2].lock, expected 34232, is " + << last_msg_->obs[2].lock; + EXPECT_EQ(last_msg_->obs[2].prn, 13) + << "incorrect value for obs[2].prn, expected 13, is " + << last_msg_->obs[2].prn; + EXPECT_EQ(last_msg_->obs[3].L.f, 237) + << "incorrect value for obs[3].L.f, expected 237, is " + << last_msg_->obs[3].L.f; + EXPECT_EQ(last_msg_->obs[3].L.i, 138026) + << "incorrect value for obs[3].L.i, expected 138026, is " + << last_msg_->obs[3].L.i; + EXPECT_EQ(last_msg_->obs[3].P, 2259826078) + << "incorrect value for obs[3].P, expected 2259826078, is " + << last_msg_->obs[3].P; + EXPECT_EQ(last_msg_->obs[3].cn0, 30) + << "incorrect value for obs[3].cn0, expected 30, is " + << last_msg_->obs[3].cn0; + EXPECT_EQ(last_msg_->obs[3].lock, 24609) + << "incorrect value for obs[3].lock, expected 24609, is " + << last_msg_->obs[3].lock; + EXPECT_EQ(last_msg_->obs[3].prn, 22) + << "incorrect value for obs[3].prn, expected 22, is " + << last_msg_->obs[3].prn; + EXPECT_EQ(last_msg_->obs[4].L.f, 45) + << "incorrect value for obs[4].L.f, expected 45, is " + << last_msg_->obs[4].L.f; + EXPECT_EQ(last_msg_->obs[4].L.i, -36952) + << "incorrect value for obs[4].L.i, expected -36952, is " + << last_msg_->obs[4].L.i; + EXPECT_EQ(last_msg_->obs[4].P, 1985368870) + << "incorrect value for obs[4].P, expected 1985368870, is " + << last_msg_->obs[4].P; + EXPECT_EQ(last_msg_->obs[4].cn0, 56) + << "incorrect value for obs[4].cn0, expected 56, is " + << last_msg_->obs[4].cn0; + EXPECT_EQ(last_msg_->obs[4].lock, 22736) + << "incorrect value for obs[4].lock, expected 22736, is " + << last_msg_->obs[4].lock; + EXPECT_EQ(last_msg_->obs[4].prn, 30) + << "incorrect value for obs[4].prn, expected 30, is " + << last_msg_->obs[4].prn; } diff --git a/c/test/legacy/cpp/auto_check_sbp_orientation_MsgAngularRate.cc b/c/test/legacy/cpp/auto_check_sbp_orientation_MsgAngularRate.cc index d380f0dbc..774953b4d 100644 --- a/c/test/legacy/cpp/auto_check_sbp_orientation_MsgAngularRate.cc +++ b/c/test/legacy/cpp/auto_check_sbp_orientation_MsgAngularRate.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgAngularRate.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgAngularRate.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_orientation_MsgAngularRate0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_orientation_MsgAngularRate0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_orientation_MsgAngularRate0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_orientation_MsgAngularRate0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_angular_rate_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_angular_rate_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,43 +81,49 @@ class Test_legacy_auto_check_sbp_orientation_MsgAngularRate0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_angular_rate_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_orientation_MsgAngularRate0, Test) -{ +}; - uint8_t encoded_frame[] = {85,34,2,66,0,17,2,0,0,0,2,0,0,0,5,0,0,0,2,0,0,0,0,88,70, }; +TEST_F(Test_legacy_auto_check_sbp_orientation_MsgAngularRate0, Test) { + uint8_t encoded_frame[] = { + 85, 34, 2, 66, 0, 17, 2, 0, 0, 0, 2, 0, 0, + 0, 5, 0, 0, 0, 2, 0, 0, 0, 0, 88, 70, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_angular_rate_t* test_msg = ( msg_angular_rate_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->tow = 2; - test_msg->x = 2; - test_msg->y = 5; - test_msg->z = 2; - - EXPECT_EQ(send_message( 0x222, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_angular_rate_t *test_msg = (msg_angular_rate_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->tow = 2; + test_msg->x = 2; + test_msg->y = 5; + test_msg->z = 2; + + EXPECT_EQ(send_message(0x222, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->tow, 2) << "incorrect value for tow, expected 2, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->x, 2) << "incorrect value for x, expected 2, is " << last_msg_->x; - EXPECT_EQ(last_msg_->y, 5) << "incorrect value for y, expected 5, is " << last_msg_->y; - EXPECT_EQ(last_msg_->z, 2) << "incorrect value for z, expected 2, is " << last_msg_->z; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->tow, 2) + << "incorrect value for tow, expected 2, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->x, 2) + << "incorrect value for x, expected 2, is " << last_msg_->x; + EXPECT_EQ(last_msg_->y, 5) + << "incorrect value for y, expected 5, is " << last_msg_->y; + EXPECT_EQ(last_msg_->z, 2) + << "incorrect value for z, expected 2, is " << last_msg_->z; } diff --git a/c/test/legacy/cpp/auto_check_sbp_orientation_MsgBaselineHeading.cc b/c/test/legacy/cpp/auto_check_sbp_orientation_MsgBaselineHeading.cc index 9ecb589a5..2a0d0495b 100644 --- a/c/test/legacy/cpp/auto_check_sbp_orientation_MsgBaselineHeading.cc +++ b/c/test/legacy/cpp/auto_check_sbp_orientation_MsgBaselineHeading.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgBaselineHeading.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgBaselineHeading.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_orientation_MsgBaselineHeading0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_orientation_MsgBaselineHeading0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_orientation_MsgBaselineHeading0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_orientation_MsgBaselineHeading0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_baseline_heading_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_baseline_heading_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,41 +82,47 @@ class Test_legacy_auto_check_sbp_orientation_MsgBaselineHeading0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_baseline_heading_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_orientation_MsgBaselineHeading0, Test) -{ +}; - uint8_t encoded_frame[] = {85,15,2,211,93,10,156,45,13,196,44,84,197,61,91,91,224,254, }; +TEST_F(Test_legacy_auto_check_sbp_orientation_MsgBaselineHeading0, Test) { + uint8_t encoded_frame[] = { + 85, 15, 2, 211, 93, 10, 156, 45, 13, + 196, 44, 84, 197, 61, 91, 91, 224, 254, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_baseline_heading_t* test_msg = ( msg_baseline_heading_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 91; - test_msg->heading = 1036342316; - test_msg->n_sats = 91; - test_msg->tow = 3289197980; - - EXPECT_EQ(send_message( 0x20f, 24019, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_baseline_heading_t *test_msg = (msg_baseline_heading_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 91; + test_msg->heading = 1036342316; + test_msg->n_sats = 91; + test_msg->tow = 3289197980; + + EXPECT_EQ(send_message(0x20f, 24019, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 24019); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 91) << "incorrect value for flags, expected 91, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->heading, 1036342316) << "incorrect value for heading, expected 1036342316, is " << last_msg_->heading; - EXPECT_EQ(last_msg_->n_sats, 91) << "incorrect value for n_sats, expected 91, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->tow, 3289197980) << "incorrect value for tow, expected 3289197980, is " << last_msg_->tow; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 24019); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 91) + << "incorrect value for flags, expected 91, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->heading, 1036342316) + << "incorrect value for heading, expected 1036342316, is " + << last_msg_->heading; + EXPECT_EQ(last_msg_->n_sats, 91) + << "incorrect value for n_sats, expected 91, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->tow, 3289197980) + << "incorrect value for tow, expected 3289197980, is " << last_msg_->tow; } diff --git a/c/test/legacy/cpp/auto_check_sbp_orientation_MsgOrientEuler.cc b/c/test/legacy/cpp/auto_check_sbp_orientation_MsgOrientEuler.cc index 31c7c7fdb..16001aabb 100644 --- a/c/test/legacy/cpp/auto_check_sbp_orientation_MsgOrientEuler.cc +++ b/c/test/legacy/cpp/auto_check_sbp_orientation_MsgOrientEuler.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientEuler.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientEuler.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_orientation_MsgOrientEuler0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_orientation_MsgOrientEuler0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_orientation_MsgOrientEuler0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_orientation_MsgOrientEuler0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_orient_euler_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_orient_euler_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,49 +81,61 @@ class Test_legacy_auto_check_sbp_orientation_MsgOrientEuler0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_orient_euler_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_orientation_MsgOrientEuler0, Test) -{ +}; - uint8_t encoded_frame[] = {85,33,2,66,0,29,1,0,0,0,1,0,0,0,2,0,0,0,8,0,0,0,0,0,224,64,0,0,64,64,0,0,224,64,3,44,226, }; +TEST_F(Test_legacy_auto_check_sbp_orientation_MsgOrientEuler0, Test) { + uint8_t encoded_frame[] = { + 85, 33, 2, 66, 0, 29, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 8, + 0, 0, 0, 0, 0, 224, 64, 0, 0, 64, 64, 0, 0, 224, 64, 3, 44, 226, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_orient_euler_t* test_msg = ( msg_orient_euler_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 3; - test_msg->pitch = 2; - test_msg->pitch_accuracy = 3.0; - test_msg->roll = 1; - test_msg->roll_accuracy = 7.0; - test_msg->tow = 1; - test_msg->yaw = 8; - test_msg->yaw_accuracy = 7.0; - - EXPECT_EQ(send_message( 0x221, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_orient_euler_t *test_msg = (msg_orient_euler_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 3; + test_msg->pitch = 2; + test_msg->pitch_accuracy = 3.0; + test_msg->roll = 1; + test_msg->roll_accuracy = 7.0; + test_msg->tow = 1; + test_msg->yaw = 8; + test_msg->yaw_accuracy = 7.0; + + EXPECT_EQ(send_message(0x221, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 3) << "incorrect value for flags, expected 3, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->pitch, 2) << "incorrect value for pitch, expected 2, is " << last_msg_->pitch; - EXPECT_LT((last_msg_->pitch_accuracy*100 - 3.0*100), 0.05) << "incorrect value for pitch_accuracy, expected 3.0, is " << last_msg_->pitch_accuracy; - EXPECT_EQ(last_msg_->roll, 1) << "incorrect value for roll, expected 1, is " << last_msg_->roll; - EXPECT_LT((last_msg_->roll_accuracy*100 - 7.0*100), 0.05) << "incorrect value for roll_accuracy, expected 7.0, is " << last_msg_->roll_accuracy; - EXPECT_EQ(last_msg_->tow, 1) << "incorrect value for tow, expected 1, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->yaw, 8) << "incorrect value for yaw, expected 8, is " << last_msg_->yaw; - EXPECT_LT((last_msg_->yaw_accuracy*100 - 7.0*100), 0.05) << "incorrect value for yaw_accuracy, expected 7.0, is " << last_msg_->yaw_accuracy; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 3) + << "incorrect value for flags, expected 3, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->pitch, 2) + << "incorrect value for pitch, expected 2, is " << last_msg_->pitch; + EXPECT_LT((last_msg_->pitch_accuracy * 100 - 3.0 * 100), 0.05) + << "incorrect value for pitch_accuracy, expected 3.0, is " + << last_msg_->pitch_accuracy; + EXPECT_EQ(last_msg_->roll, 1) + << "incorrect value for roll, expected 1, is " << last_msg_->roll; + EXPECT_LT((last_msg_->roll_accuracy * 100 - 7.0 * 100), 0.05) + << "incorrect value for roll_accuracy, expected 7.0, is " + << last_msg_->roll_accuracy; + EXPECT_EQ(last_msg_->tow, 1) + << "incorrect value for tow, expected 1, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->yaw, 8) + << "incorrect value for yaw, expected 8, is " << last_msg_->yaw; + EXPECT_LT((last_msg_->yaw_accuracy * 100 - 7.0 * 100), 0.05) + << "incorrect value for yaw_accuracy, expected 7.0, is " + << last_msg_->yaw_accuracy; } diff --git a/c/test/legacy/cpp/auto_check_sbp_orientation_MsgOrientQuat.cc b/c/test/legacy/cpp/auto_check_sbp_orientation_MsgOrientQuat.cc index b642d3319..3d55527d0 100644 --- a/c/test/legacy/cpp/auto_check_sbp_orientation_MsgOrientQuat.cc +++ b/c/test/legacy/cpp/auto_check_sbp_orientation_MsgOrientQuat.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientQuat.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/orientation/test_MsgOrientQuat.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_orientation_MsgOrientQuat0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_orientation_MsgOrientQuat0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_orientation_MsgOrientQuat0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_orientation_MsgOrientQuat0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_orient_quat_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_orient_quat_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,53 +81,69 @@ class Test_legacy_auto_check_sbp_orientation_MsgOrientQuat0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_orient_quat_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_orientation_MsgOrientQuat0, Test) -{ +}; - uint8_t encoded_frame[] = {85,32,2,66,0,37,0,0,0,0,3,0,0,0,7,0,0,0,8,0,0,0,4,0,0,0,0,0,64,64,0,0,128,64,0,0,0,65,0,0,64,64,1,186,6, }; +TEST_F(Test_legacy_auto_check_sbp_orientation_MsgOrientQuat0, Test) { + uint8_t encoded_frame[] = { + 85, 32, 2, 66, 0, 37, 0, 0, 0, 0, 3, 0, 0, 0, 7, + 0, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0, 0, 0, 64, 64, + 0, 0, 128, 64, 0, 0, 0, 65, 0, 0, 64, 64, 1, 186, 6, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_orient_quat_t* test_msg = ( msg_orient_quat_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 1; - test_msg->tow = 0; - test_msg->w = 3; - test_msg->w_accuracy = 3.0; - test_msg->x = 7; - test_msg->x_accuracy = 4.0; - test_msg->y = 8; - test_msg->y_accuracy = 8.0; - test_msg->z = 4; - test_msg->z_accuracy = 3.0; - - EXPECT_EQ(send_message( 0x220, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_orient_quat_t *test_msg = (msg_orient_quat_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 1; + test_msg->tow = 0; + test_msg->w = 3; + test_msg->w_accuracy = 3.0; + test_msg->x = 7; + test_msg->x_accuracy = 4.0; + test_msg->y = 8; + test_msg->y_accuracy = 8.0; + test_msg->z = 4; + test_msg->z_accuracy = 3.0; + + EXPECT_EQ(send_message(0x220, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->tow, 0) << "incorrect value for tow, expected 0, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->w, 3) << "incorrect value for w, expected 3, is " << last_msg_->w; - EXPECT_LT((last_msg_->w_accuracy*100 - 3.0*100), 0.05) << "incorrect value for w_accuracy, expected 3.0, is " << last_msg_->w_accuracy; - EXPECT_EQ(last_msg_->x, 7) << "incorrect value for x, expected 7, is " << last_msg_->x; - EXPECT_LT((last_msg_->x_accuracy*100 - 4.0*100), 0.05) << "incorrect value for x_accuracy, expected 4.0, is " << last_msg_->x_accuracy; - EXPECT_EQ(last_msg_->y, 8) << "incorrect value for y, expected 8, is " << last_msg_->y; - EXPECT_LT((last_msg_->y_accuracy*100 - 8.0*100), 0.05) << "incorrect value for y_accuracy, expected 8.0, is " << last_msg_->y_accuracy; - EXPECT_EQ(last_msg_->z, 4) << "incorrect value for z, expected 4, is " << last_msg_->z; - EXPECT_LT((last_msg_->z_accuracy*100 - 3.0*100), 0.05) << "incorrect value for z_accuracy, expected 3.0, is " << last_msg_->z_accuracy; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->tow, 0) + << "incorrect value for tow, expected 0, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->w, 3) + << "incorrect value for w, expected 3, is " << last_msg_->w; + EXPECT_LT((last_msg_->w_accuracy * 100 - 3.0 * 100), 0.05) + << "incorrect value for w_accuracy, expected 3.0, is " + << last_msg_->w_accuracy; + EXPECT_EQ(last_msg_->x, 7) + << "incorrect value for x, expected 7, is " << last_msg_->x; + EXPECT_LT((last_msg_->x_accuracy * 100 - 4.0 * 100), 0.05) + << "incorrect value for x_accuracy, expected 4.0, is " + << last_msg_->x_accuracy; + EXPECT_EQ(last_msg_->y, 8) + << "incorrect value for y, expected 8, is " << last_msg_->y; + EXPECT_LT((last_msg_->y_accuracy * 100 - 8.0 * 100), 0.05) + << "incorrect value for y_accuracy, expected 8.0, is " + << last_msg_->y_accuracy; + EXPECT_EQ(last_msg_->z, 4) + << "incorrect value for z, expected 4, is " << last_msg_->z; + EXPECT_LT((last_msg_->z_accuracy * 100 - 3.0 * 100), 0.05) + << "incorrect value for z_accuracy, expected 3.0, is " + << last_msg_->z_accuracy; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgAlmanac.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgAlmanac.cc index 38942cf1a..798d83f68 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgAlmanac.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgAlmanac.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgAlmanac.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgAlmanac.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,6 +27,6 @@ #include #include +#include #include #include -#include diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCellModemStatus.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCellModemStatus.cc index 10a7d744f..d1959a764 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCellModemStatus.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCellModemStatus.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCellModemStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCellModemStatus.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgCellModemStatus0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgCellModemStatus0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgCellModemStatus0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgCellModemStatus0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_cell_modem_status_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_cell_modem_status_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,1537 +82,2059 @@ class Test_legacy_auto_check_sbp_piksi_MsgCellModemStatus0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_cell_modem_status_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgCellModemStatus0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgCellModemStatus0, Test) { + uint8_t encoded_frame[] = { + 85, 190, 0, 19, 27, 255, 103, 205, 48, 6, 70, 123, 242, 46, 52, + 64, 176, 154, 98, 43, 132, 196, 89, 253, 161, 250, 174, 204, 110, 47, + 38, 187, 63, 102, 177, 162, 49, 80, 194, 37, 107, 60, 225, 52, 101, + 178, 142, 246, 21, 17, 93, 75, 169, 86, 16, 209, 80, 243, 30, 206, + 220, 206, 115, 47, 154, 91, 227, 88, 11, 1, 85, 146, 100, 190, 232, + 207, 61, 61, 201, 220, 31, 78, 34, 57, 82, 59, 104, 65, 221, 0, + 43, 210, 9, 32, 122, 29, 237, 11, 151, 223, 18, 81, 204, 172, 234, + 127, 3, 82, 133, 169, 12, 176, 193, 0, 24, 121, 85, 55, 214, 198, + 75, 234, 179, 214, 85, 94, 115, 21, 73, 121, 75, 46, 158, 63, 100, + 122, 213, 20, 85, 212, 131, 50, 224, 218, 215, 215, 149, 2, 19, 129, + 39, 164, 5, 175, 6, 62, 51, 78, 66, 248, 116, 88, 90, 128, 226, + 177, 0, 47, 140, 33, 126, 221, 110, 144, 97, 74, 250, 181, 199, 27, + 176, 65, 185, 110, 92, 34, 44, 131, 96, 178, 40, 176, 4, 90, 36, + 7, 180, 244, 244, 23, 108, 171, 204, 196, 61, 51, 179, 242, 156, 81, + 83, 16, 15, 134, 40, 245, 253, 150, 94, 150, 144, 197, 113, 5, 141, + 232, 33, 101, 231, 38, 75, 178, 243, 119, 1, 248, 218, 86, 7, 88, + 197, 148, 240, 227, 2, 65, 173, 122, 143, 251, 156, 217, 67, 239, 219, + 31, 224, 176, 129, 81, 80, 40, 230, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_cell_modem_status_t *test_msg = + (msg_cell_modem_status_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[0] = 123; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[1] = 242; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[2] = 46; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[3] = 52; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[4] = 64; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[5] = 176; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[6] = 154; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[7] = 98; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[8] = 43; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[9] = 132; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[10] = 196; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[11] = 89; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[12] = 253; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[13] = 161; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[14] = 250; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[15] = 174; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[16] = 204; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[17] = 110; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[18] = 47; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[19] = 38; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[20] = 187; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[21] = 63; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[22] = 102; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[23] = 177; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[24] = 162; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[25] = 49; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[26] = 80; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[27] = 194; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[28] = 37; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[29] = 107; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[30] = 60; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[31] = 225; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[32] = 52; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[33] = 101; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[34] = 178; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[35] = 142; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[36] = 246; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[37] = 21; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[38] = 17; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[39] = 93; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[40] = 75; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[41] = 169; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[42] = 86; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[43] = 16; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[44] = 209; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[45] = 80; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[46] = 243; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[47] = 30; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[48] = 206; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[49] = 220; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[50] = 206; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[51] = 115; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[52] = 47; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[53] = 154; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[54] = 91; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[55] = 227; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[56] = 88; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[57] = 11; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[58] = 1; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[59] = 85; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[60] = 146; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[61] = 100; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[62] = 190; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[63] = 232; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[64] = 207; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[65] = 61; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[66] = 61; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[67] = 201; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[68] = 220; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[69] = 31; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[70] = 78; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[71] = 34; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[72] = 57; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[73] = 82; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[74] = 59; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[75] = 104; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[76] = 65; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[77] = 221; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[78] = 0; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[79] = 43; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[80] = 210; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[81] = 9; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[82] = 32; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[83] = 122; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[84] = 29; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[85] = 237; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[86] = 11; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[87] = 151; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[88] = 223; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[89] = 18; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[90] = 81; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[91] = 204; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[92] = 172; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[93] = 234; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[94] = 127; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[95] = 3; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[96] = 82; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[97] = 133; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[98] = 169; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[99] = 12; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[100] = 176; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[101] = 193; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[102] = 0; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[103] = 24; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[104] = 121; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[105] = 85; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[106] = 55; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[107] = 214; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[108] = 198; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[109] = 75; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[110] = 234; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[111] = 179; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[112] = 214; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[113] = 85; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[114] = 94; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[115] = 115; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[116] = 21; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[117] = 73; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[118] = 121; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[119] = 75; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[120] = 46; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[121] = 158; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[122] = 63; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[123] = 100; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[124] = 122; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[125] = 213; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[126] = 20; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[127] = 85; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[128] = 212; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[129] = 131; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[130] = 50; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[131] = 224; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[132] = 218; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[133] = 215; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[134] = 215; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[135] = 149; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[136] = 2; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[137] = 19; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[138] = 129; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[139] = 39; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[140] = 164; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[141] = 5; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[142] = 175; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[143] = 6; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[144] = 62; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[145] = 51; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[146] = 78; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[147] = 66; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[148] = 248; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[149] = 116; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[150] = 88; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[151] = 90; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[152] = 128; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[153] = 226; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[154] = 177; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[155] = 0; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[156] = 47; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[157] = 140; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[158] = 33; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[159] = 126; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[160] = 221; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[161] = 110; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[162] = 144; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[163] = 97; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[164] = 74; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[165] = 250; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[166] = 181; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[167] = 199; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[168] = 27; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[169] = 176; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[170] = 65; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[171] = 185; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[172] = 110; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[173] = 92; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[174] = 34; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[175] = 44; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[176] = 131; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[177] = 96; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[178] = 178; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[179] = 40; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[180] = 176; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[181] = 4; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[182] = 90; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[183] = 36; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[184] = 7; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[185] = 180; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[186] = 244; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[187] = 244; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[188] = 23; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[189] = 108; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[190] = 171; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[191] = 204; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[192] = 196; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[193] = 61; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[194] = 51; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[195] = 179; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[196] = 242; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[197] = 156; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[198] = 81; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[199] = 83; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[200] = 16; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[201] = 15; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[202] = 134; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[203] = 40; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[204] = 245; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[205] = 253; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[206] = 150; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[207] = 94; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[208] = 150; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[209] = 144; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[210] = 197; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[211] = 113; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[212] = 5; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[213] = 141; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[214] = 232; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[215] = 33; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[216] = 101; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[217] = 231; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[218] = 38; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[219] = 75; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[220] = 178; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[221] = 243; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[222] = 119; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[223] = 1; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[224] = 248; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[225] = 218; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[226] = 86; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[227] = 7; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[228] = 88; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[229] = 197; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[230] = 148; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[231] = 240; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[232] = 227; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[233] = 2; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[234] = 65; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[235] = 173; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[236] = 122; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[237] = 143; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[238] = 251; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[239] = 156; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[240] = 217; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[241] = 67; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[242] = 239; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[243] = 219; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[244] = 31; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[245] = 224; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[246] = 176; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[247] = 129; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[248] = 81; + if (sizeof(test_msg->reserved) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); + } + test_msg->reserved[249] = 80; + test_msg->signal_error_rate = 8588.2001953125; + test_msg->signal_strength = 103; - uint8_t encoded_frame[] = {85,190,0,19,27,255,103,205,48,6,70,123,242,46,52,64,176,154,98,43,132,196,89,253,161,250,174,204,110,47,38,187,63,102,177,162,49,80,194,37,107,60,225,52,101,178,142,246,21,17,93,75,169,86,16,209,80,243,30,206,220,206,115,47,154,91,227,88,11,1,85,146,100,190,232,207,61,61,201,220,31,78,34,57,82,59,104,65,221,0,43,210,9,32,122,29,237,11,151,223,18,81,204,172,234,127,3,82,133,169,12,176,193,0,24,121,85,55,214,198,75,234,179,214,85,94,115,21,73,121,75,46,158,63,100,122,213,20,85,212,131,50,224,218,215,215,149,2,19,129,39,164,5,175,6,62,51,78,66,248,116,88,90,128,226,177,0,47,140,33,126,221,110,144,97,74,250,181,199,27,176,65,185,110,92,34,44,131,96,178,40,176,4,90,36,7,180,244,244,23,108,171,204,196,61,51,179,242,156,81,83,16,15,134,40,245,253,150,94,150,144,197,113,5,141,232,33,101,231,38,75,178,243,119,1,248,218,86,7,88,197,148,240,227,2,65,173,122,143,251,156,217,67,239,219,31,224,176,129,81,80,40,230, }; + EXPECT_EQ(send_message(0xbe, 6931, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_cell_modem_status_t* test_msg = ( msg_cell_modem_status_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[0] = 123; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[1] = 242; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[2] = 46; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[3] = 52; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[4] = 64; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[5] = 176; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[6] = 154; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[7] = 98; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[8] = 43; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[9] = 132; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[10] = 196; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[11] = 89; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[12] = 253; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[13] = 161; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[14] = 250; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[15] = 174; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[16] = 204; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[17] = 110; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[18] = 47; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[19] = 38; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[20] = 187; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[21] = 63; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[22] = 102; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[23] = 177; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[24] = 162; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[25] = 49; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[26] = 80; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[27] = 194; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[28] = 37; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[29] = 107; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[30] = 60; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[31] = 225; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[32] = 52; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[33] = 101; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[34] = 178; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[35] = 142; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[36] = 246; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[37] = 21; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[38] = 17; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[39] = 93; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[40] = 75; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[41] = 169; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[42] = 86; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[43] = 16; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[44] = 209; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[45] = 80; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[46] = 243; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[47] = 30; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[48] = 206; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[49] = 220; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[50] = 206; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[51] = 115; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[52] = 47; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[53] = 154; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[54] = 91; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[55] = 227; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[56] = 88; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[57] = 11; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[58] = 1; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[59] = 85; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[60] = 146; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[61] = 100; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[62] = 190; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[63] = 232; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[64] = 207; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[65] = 61; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[66] = 61; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[67] = 201; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[68] = 220; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[69] = 31; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[70] = 78; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[71] = 34; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[72] = 57; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[73] = 82; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[74] = 59; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[75] = 104; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[76] = 65; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[77] = 221; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[78] = 0; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[79] = 43; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[80] = 210; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[81] = 9; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[82] = 32; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[83] = 122; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[84] = 29; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[85] = 237; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[86] = 11; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[87] = 151; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[88] = 223; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[89] = 18; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[90] = 81; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[91] = 204; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[92] = 172; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[93] = 234; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[94] = 127; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[95] = 3; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[96] = 82; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[97] = 133; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[98] = 169; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[99] = 12; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[100] = 176; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[101] = 193; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[102] = 0; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[103] = 24; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[104] = 121; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[105] = 85; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[106] = 55; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[107] = 214; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[108] = 198; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[109] = 75; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[110] = 234; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[111] = 179; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[112] = 214; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[113] = 85; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[114] = 94; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[115] = 115; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[116] = 21; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[117] = 73; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[118] = 121; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[119] = 75; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[120] = 46; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[121] = 158; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[122] = 63; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[123] = 100; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[124] = 122; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[125] = 213; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[126] = 20; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[127] = 85; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[128] = 212; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[129] = 131; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[130] = 50; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[131] = 224; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[132] = 218; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[133] = 215; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[134] = 215; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[135] = 149; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[136] = 2; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[137] = 19; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[138] = 129; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[139] = 39; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[140] = 164; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[141] = 5; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[142] = 175; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[143] = 6; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[144] = 62; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[145] = 51; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[146] = 78; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[147] = 66; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[148] = 248; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[149] = 116; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[150] = 88; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[151] = 90; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[152] = 128; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[153] = 226; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[154] = 177; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[155] = 0; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[156] = 47; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[157] = 140; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[158] = 33; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[159] = 126; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[160] = 221; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[161] = 110; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[162] = 144; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[163] = 97; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[164] = 74; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[165] = 250; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[166] = 181; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[167] = 199; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[168] = 27; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[169] = 176; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[170] = 65; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[171] = 185; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[172] = 110; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[173] = 92; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[174] = 34; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[175] = 44; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[176] = 131; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[177] = 96; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[178] = 178; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[179] = 40; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[180] = 176; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[181] = 4; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[182] = 90; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[183] = 36; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[184] = 7; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[185] = 180; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[186] = 244; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[187] = 244; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[188] = 23; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[189] = 108; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[190] = 171; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[191] = 204; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[192] = 196; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[193] = 61; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[194] = 51; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[195] = 179; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[196] = 242; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[197] = 156; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[198] = 81; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[199] = 83; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[200] = 16; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[201] = 15; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[202] = 134; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[203] = 40; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[204] = 245; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[205] = 253; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[206] = 150; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[207] = 94; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[208] = 150; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[209] = 144; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[210] = 197; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[211] = 113; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[212] = 5; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[213] = 141; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[214] = 232; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[215] = 33; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[216] = 101; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[217] = 231; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[218] = 38; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[219] = 75; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[220] = 178; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[221] = 243; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[222] = 119; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[223] = 1; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[224] = 248; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[225] = 218; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[226] = 86; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[227] = 7; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[228] = 88; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[229] = 197; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[230] = 148; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[231] = 240; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[232] = 227; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[233] = 2; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[234] = 65; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[235] = 173; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[236] = 122; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[237] = 143; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[238] = 251; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[239] = 156; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[240] = 217; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[241] = 67; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[242] = 239; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[243] = 219; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[244] = 31; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[245] = 224; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[246] = 176; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[247] = 129; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[248] = 81; - if (sizeof(test_msg->reserved) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->reserved[0])); - } - test_msg->reserved[249] = 80; - test_msg->signal_error_rate = 8588.2001953125; - test_msg->signal_strength = 103; - - EXPECT_EQ(send_message( 0xbe, 6931, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 6931); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->reserved[0], 123) << "incorrect value for reserved[0], expected 123, is " << last_msg_->reserved[0]; - EXPECT_EQ(last_msg_->reserved[1], 242) << "incorrect value for reserved[1], expected 242, is " << last_msg_->reserved[1]; - EXPECT_EQ(last_msg_->reserved[2], 46) << "incorrect value for reserved[2], expected 46, is " << last_msg_->reserved[2]; - EXPECT_EQ(last_msg_->reserved[3], 52) << "incorrect value for reserved[3], expected 52, is " << last_msg_->reserved[3]; - EXPECT_EQ(last_msg_->reserved[4], 64) << "incorrect value for reserved[4], expected 64, is " << last_msg_->reserved[4]; - EXPECT_EQ(last_msg_->reserved[5], 176) << "incorrect value for reserved[5], expected 176, is " << last_msg_->reserved[5]; - EXPECT_EQ(last_msg_->reserved[6], 154) << "incorrect value for reserved[6], expected 154, is " << last_msg_->reserved[6]; - EXPECT_EQ(last_msg_->reserved[7], 98) << "incorrect value for reserved[7], expected 98, is " << last_msg_->reserved[7]; - EXPECT_EQ(last_msg_->reserved[8], 43) << "incorrect value for reserved[8], expected 43, is " << last_msg_->reserved[8]; - EXPECT_EQ(last_msg_->reserved[9], 132) << "incorrect value for reserved[9], expected 132, is " << last_msg_->reserved[9]; - EXPECT_EQ(last_msg_->reserved[10], 196) << "incorrect value for reserved[10], expected 196, is " << last_msg_->reserved[10]; - EXPECT_EQ(last_msg_->reserved[11], 89) << "incorrect value for reserved[11], expected 89, is " << last_msg_->reserved[11]; - EXPECT_EQ(last_msg_->reserved[12], 253) << "incorrect value for reserved[12], expected 253, is " << last_msg_->reserved[12]; - EXPECT_EQ(last_msg_->reserved[13], 161) << "incorrect value for reserved[13], expected 161, is " << last_msg_->reserved[13]; - EXPECT_EQ(last_msg_->reserved[14], 250) << "incorrect value for reserved[14], expected 250, is " << last_msg_->reserved[14]; - EXPECT_EQ(last_msg_->reserved[15], 174) << "incorrect value for reserved[15], expected 174, is " << last_msg_->reserved[15]; - EXPECT_EQ(last_msg_->reserved[16], 204) << "incorrect value for reserved[16], expected 204, is " << last_msg_->reserved[16]; - EXPECT_EQ(last_msg_->reserved[17], 110) << "incorrect value for reserved[17], expected 110, is " << last_msg_->reserved[17]; - EXPECT_EQ(last_msg_->reserved[18], 47) << "incorrect value for reserved[18], expected 47, is " << last_msg_->reserved[18]; - EXPECT_EQ(last_msg_->reserved[19], 38) << "incorrect value for reserved[19], expected 38, is " << last_msg_->reserved[19]; - EXPECT_EQ(last_msg_->reserved[20], 187) << "incorrect value for reserved[20], expected 187, is " << last_msg_->reserved[20]; - EXPECT_EQ(last_msg_->reserved[21], 63) << "incorrect value for reserved[21], expected 63, is " << last_msg_->reserved[21]; - EXPECT_EQ(last_msg_->reserved[22], 102) << "incorrect value for reserved[22], expected 102, is " << last_msg_->reserved[22]; - EXPECT_EQ(last_msg_->reserved[23], 177) << "incorrect value for reserved[23], expected 177, is " << last_msg_->reserved[23]; - EXPECT_EQ(last_msg_->reserved[24], 162) << "incorrect value for reserved[24], expected 162, is " << last_msg_->reserved[24]; - EXPECT_EQ(last_msg_->reserved[25], 49) << "incorrect value for reserved[25], expected 49, is " << last_msg_->reserved[25]; - EXPECT_EQ(last_msg_->reserved[26], 80) << "incorrect value for reserved[26], expected 80, is " << last_msg_->reserved[26]; - EXPECT_EQ(last_msg_->reserved[27], 194) << "incorrect value for reserved[27], expected 194, is " << last_msg_->reserved[27]; - EXPECT_EQ(last_msg_->reserved[28], 37) << "incorrect value for reserved[28], expected 37, is " << last_msg_->reserved[28]; - EXPECT_EQ(last_msg_->reserved[29], 107) << "incorrect value for reserved[29], expected 107, is " << last_msg_->reserved[29]; - EXPECT_EQ(last_msg_->reserved[30], 60) << "incorrect value for reserved[30], expected 60, is " << last_msg_->reserved[30]; - EXPECT_EQ(last_msg_->reserved[31], 225) << "incorrect value for reserved[31], expected 225, is " << last_msg_->reserved[31]; - EXPECT_EQ(last_msg_->reserved[32], 52) << "incorrect value for reserved[32], expected 52, is " << last_msg_->reserved[32]; - EXPECT_EQ(last_msg_->reserved[33], 101) << "incorrect value for reserved[33], expected 101, is " << last_msg_->reserved[33]; - EXPECT_EQ(last_msg_->reserved[34], 178) << "incorrect value for reserved[34], expected 178, is " << last_msg_->reserved[34]; - EXPECT_EQ(last_msg_->reserved[35], 142) << "incorrect value for reserved[35], expected 142, is " << last_msg_->reserved[35]; - EXPECT_EQ(last_msg_->reserved[36], 246) << "incorrect value for reserved[36], expected 246, is " << last_msg_->reserved[36]; - EXPECT_EQ(last_msg_->reserved[37], 21) << "incorrect value for reserved[37], expected 21, is " << last_msg_->reserved[37]; - EXPECT_EQ(last_msg_->reserved[38], 17) << "incorrect value for reserved[38], expected 17, is " << last_msg_->reserved[38]; - EXPECT_EQ(last_msg_->reserved[39], 93) << "incorrect value for reserved[39], expected 93, is " << last_msg_->reserved[39]; - EXPECT_EQ(last_msg_->reserved[40], 75) << "incorrect value for reserved[40], expected 75, is " << last_msg_->reserved[40]; - EXPECT_EQ(last_msg_->reserved[41], 169) << "incorrect value for reserved[41], expected 169, is " << last_msg_->reserved[41]; - EXPECT_EQ(last_msg_->reserved[42], 86) << "incorrect value for reserved[42], expected 86, is " << last_msg_->reserved[42]; - EXPECT_EQ(last_msg_->reserved[43], 16) << "incorrect value for reserved[43], expected 16, is " << last_msg_->reserved[43]; - EXPECT_EQ(last_msg_->reserved[44], 209) << "incorrect value for reserved[44], expected 209, is " << last_msg_->reserved[44]; - EXPECT_EQ(last_msg_->reserved[45], 80) << "incorrect value for reserved[45], expected 80, is " << last_msg_->reserved[45]; - EXPECT_EQ(last_msg_->reserved[46], 243) << "incorrect value for reserved[46], expected 243, is " << last_msg_->reserved[46]; - EXPECT_EQ(last_msg_->reserved[47], 30) << "incorrect value for reserved[47], expected 30, is " << last_msg_->reserved[47]; - EXPECT_EQ(last_msg_->reserved[48], 206) << "incorrect value for reserved[48], expected 206, is " << last_msg_->reserved[48]; - EXPECT_EQ(last_msg_->reserved[49], 220) << "incorrect value for reserved[49], expected 220, is " << last_msg_->reserved[49]; - EXPECT_EQ(last_msg_->reserved[50], 206) << "incorrect value for reserved[50], expected 206, is " << last_msg_->reserved[50]; - EXPECT_EQ(last_msg_->reserved[51], 115) << "incorrect value for reserved[51], expected 115, is " << last_msg_->reserved[51]; - EXPECT_EQ(last_msg_->reserved[52], 47) << "incorrect value for reserved[52], expected 47, is " << last_msg_->reserved[52]; - EXPECT_EQ(last_msg_->reserved[53], 154) << "incorrect value for reserved[53], expected 154, is " << last_msg_->reserved[53]; - EXPECT_EQ(last_msg_->reserved[54], 91) << "incorrect value for reserved[54], expected 91, is " << last_msg_->reserved[54]; - EXPECT_EQ(last_msg_->reserved[55], 227) << "incorrect value for reserved[55], expected 227, is " << last_msg_->reserved[55]; - EXPECT_EQ(last_msg_->reserved[56], 88) << "incorrect value for reserved[56], expected 88, is " << last_msg_->reserved[56]; - EXPECT_EQ(last_msg_->reserved[57], 11) << "incorrect value for reserved[57], expected 11, is " << last_msg_->reserved[57]; - EXPECT_EQ(last_msg_->reserved[58], 1) << "incorrect value for reserved[58], expected 1, is " << last_msg_->reserved[58]; - EXPECT_EQ(last_msg_->reserved[59], 85) << "incorrect value for reserved[59], expected 85, is " << last_msg_->reserved[59]; - EXPECT_EQ(last_msg_->reserved[60], 146) << "incorrect value for reserved[60], expected 146, is " << last_msg_->reserved[60]; - EXPECT_EQ(last_msg_->reserved[61], 100) << "incorrect value for reserved[61], expected 100, is " << last_msg_->reserved[61]; - EXPECT_EQ(last_msg_->reserved[62], 190) << "incorrect value for reserved[62], expected 190, is " << last_msg_->reserved[62]; - EXPECT_EQ(last_msg_->reserved[63], 232) << "incorrect value for reserved[63], expected 232, is " << last_msg_->reserved[63]; - EXPECT_EQ(last_msg_->reserved[64], 207) << "incorrect value for reserved[64], expected 207, is " << last_msg_->reserved[64]; - EXPECT_EQ(last_msg_->reserved[65], 61) << "incorrect value for reserved[65], expected 61, is " << last_msg_->reserved[65]; - EXPECT_EQ(last_msg_->reserved[66], 61) << "incorrect value for reserved[66], expected 61, is " << last_msg_->reserved[66]; - EXPECT_EQ(last_msg_->reserved[67], 201) << "incorrect value for reserved[67], expected 201, is " << last_msg_->reserved[67]; - EXPECT_EQ(last_msg_->reserved[68], 220) << "incorrect value for reserved[68], expected 220, is " << last_msg_->reserved[68]; - EXPECT_EQ(last_msg_->reserved[69], 31) << "incorrect value for reserved[69], expected 31, is " << last_msg_->reserved[69]; - EXPECT_EQ(last_msg_->reserved[70], 78) << "incorrect value for reserved[70], expected 78, is " << last_msg_->reserved[70]; - EXPECT_EQ(last_msg_->reserved[71], 34) << "incorrect value for reserved[71], expected 34, is " << last_msg_->reserved[71]; - EXPECT_EQ(last_msg_->reserved[72], 57) << "incorrect value for reserved[72], expected 57, is " << last_msg_->reserved[72]; - EXPECT_EQ(last_msg_->reserved[73], 82) << "incorrect value for reserved[73], expected 82, is " << last_msg_->reserved[73]; - EXPECT_EQ(last_msg_->reserved[74], 59) << "incorrect value for reserved[74], expected 59, is " << last_msg_->reserved[74]; - EXPECT_EQ(last_msg_->reserved[75], 104) << "incorrect value for reserved[75], expected 104, is " << last_msg_->reserved[75]; - EXPECT_EQ(last_msg_->reserved[76], 65) << "incorrect value for reserved[76], expected 65, is " << last_msg_->reserved[76]; - EXPECT_EQ(last_msg_->reserved[77], 221) << "incorrect value for reserved[77], expected 221, is " << last_msg_->reserved[77]; - EXPECT_EQ(last_msg_->reserved[78], 0) << "incorrect value for reserved[78], expected 0, is " << last_msg_->reserved[78]; - EXPECT_EQ(last_msg_->reserved[79], 43) << "incorrect value for reserved[79], expected 43, is " << last_msg_->reserved[79]; - EXPECT_EQ(last_msg_->reserved[80], 210) << "incorrect value for reserved[80], expected 210, is " << last_msg_->reserved[80]; - EXPECT_EQ(last_msg_->reserved[81], 9) << "incorrect value for reserved[81], expected 9, is " << last_msg_->reserved[81]; - EXPECT_EQ(last_msg_->reserved[82], 32) << "incorrect value for reserved[82], expected 32, is " << last_msg_->reserved[82]; - EXPECT_EQ(last_msg_->reserved[83], 122) << "incorrect value for reserved[83], expected 122, is " << last_msg_->reserved[83]; - EXPECT_EQ(last_msg_->reserved[84], 29) << "incorrect value for reserved[84], expected 29, is " << last_msg_->reserved[84]; - EXPECT_EQ(last_msg_->reserved[85], 237) << "incorrect value for reserved[85], expected 237, is " << last_msg_->reserved[85]; - EXPECT_EQ(last_msg_->reserved[86], 11) << "incorrect value for reserved[86], expected 11, is " << last_msg_->reserved[86]; - EXPECT_EQ(last_msg_->reserved[87], 151) << "incorrect value for reserved[87], expected 151, is " << last_msg_->reserved[87]; - EXPECT_EQ(last_msg_->reserved[88], 223) << "incorrect value for reserved[88], expected 223, is " << last_msg_->reserved[88]; - EXPECT_EQ(last_msg_->reserved[89], 18) << "incorrect value for reserved[89], expected 18, is " << last_msg_->reserved[89]; - EXPECT_EQ(last_msg_->reserved[90], 81) << "incorrect value for reserved[90], expected 81, is " << last_msg_->reserved[90]; - EXPECT_EQ(last_msg_->reserved[91], 204) << "incorrect value for reserved[91], expected 204, is " << last_msg_->reserved[91]; - EXPECT_EQ(last_msg_->reserved[92], 172) << "incorrect value for reserved[92], expected 172, is " << last_msg_->reserved[92]; - EXPECT_EQ(last_msg_->reserved[93], 234) << "incorrect value for reserved[93], expected 234, is " << last_msg_->reserved[93]; - EXPECT_EQ(last_msg_->reserved[94], 127) << "incorrect value for reserved[94], expected 127, is " << last_msg_->reserved[94]; - EXPECT_EQ(last_msg_->reserved[95], 3) << "incorrect value for reserved[95], expected 3, is " << last_msg_->reserved[95]; - EXPECT_EQ(last_msg_->reserved[96], 82) << "incorrect value for reserved[96], expected 82, is " << last_msg_->reserved[96]; - EXPECT_EQ(last_msg_->reserved[97], 133) << "incorrect value for reserved[97], expected 133, is " << last_msg_->reserved[97]; - EXPECT_EQ(last_msg_->reserved[98], 169) << "incorrect value for reserved[98], expected 169, is " << last_msg_->reserved[98]; - EXPECT_EQ(last_msg_->reserved[99], 12) << "incorrect value for reserved[99], expected 12, is " << last_msg_->reserved[99]; - EXPECT_EQ(last_msg_->reserved[100], 176) << "incorrect value for reserved[100], expected 176, is " << last_msg_->reserved[100]; - EXPECT_EQ(last_msg_->reserved[101], 193) << "incorrect value for reserved[101], expected 193, is " << last_msg_->reserved[101]; - EXPECT_EQ(last_msg_->reserved[102], 0) << "incorrect value for reserved[102], expected 0, is " << last_msg_->reserved[102]; - EXPECT_EQ(last_msg_->reserved[103], 24) << "incorrect value for reserved[103], expected 24, is " << last_msg_->reserved[103]; - EXPECT_EQ(last_msg_->reserved[104], 121) << "incorrect value for reserved[104], expected 121, is " << last_msg_->reserved[104]; - EXPECT_EQ(last_msg_->reserved[105], 85) << "incorrect value for reserved[105], expected 85, is " << last_msg_->reserved[105]; - EXPECT_EQ(last_msg_->reserved[106], 55) << "incorrect value for reserved[106], expected 55, is " << last_msg_->reserved[106]; - EXPECT_EQ(last_msg_->reserved[107], 214) << "incorrect value for reserved[107], expected 214, is " << last_msg_->reserved[107]; - EXPECT_EQ(last_msg_->reserved[108], 198) << "incorrect value for reserved[108], expected 198, is " << last_msg_->reserved[108]; - EXPECT_EQ(last_msg_->reserved[109], 75) << "incorrect value for reserved[109], expected 75, is " << last_msg_->reserved[109]; - EXPECT_EQ(last_msg_->reserved[110], 234) << "incorrect value for reserved[110], expected 234, is " << last_msg_->reserved[110]; - EXPECT_EQ(last_msg_->reserved[111], 179) << "incorrect value for reserved[111], expected 179, is " << last_msg_->reserved[111]; - EXPECT_EQ(last_msg_->reserved[112], 214) << "incorrect value for reserved[112], expected 214, is " << last_msg_->reserved[112]; - EXPECT_EQ(last_msg_->reserved[113], 85) << "incorrect value for reserved[113], expected 85, is " << last_msg_->reserved[113]; - EXPECT_EQ(last_msg_->reserved[114], 94) << "incorrect value for reserved[114], expected 94, is " << last_msg_->reserved[114]; - EXPECT_EQ(last_msg_->reserved[115], 115) << "incorrect value for reserved[115], expected 115, is " << last_msg_->reserved[115]; - EXPECT_EQ(last_msg_->reserved[116], 21) << "incorrect value for reserved[116], expected 21, is " << last_msg_->reserved[116]; - EXPECT_EQ(last_msg_->reserved[117], 73) << "incorrect value for reserved[117], expected 73, is " << last_msg_->reserved[117]; - EXPECT_EQ(last_msg_->reserved[118], 121) << "incorrect value for reserved[118], expected 121, is " << last_msg_->reserved[118]; - EXPECT_EQ(last_msg_->reserved[119], 75) << "incorrect value for reserved[119], expected 75, is " << last_msg_->reserved[119]; - EXPECT_EQ(last_msg_->reserved[120], 46) << "incorrect value for reserved[120], expected 46, is " << last_msg_->reserved[120]; - EXPECT_EQ(last_msg_->reserved[121], 158) << "incorrect value for reserved[121], expected 158, is " << last_msg_->reserved[121]; - EXPECT_EQ(last_msg_->reserved[122], 63) << "incorrect value for reserved[122], expected 63, is " << last_msg_->reserved[122]; - EXPECT_EQ(last_msg_->reserved[123], 100) << "incorrect value for reserved[123], expected 100, is " << last_msg_->reserved[123]; - EXPECT_EQ(last_msg_->reserved[124], 122) << "incorrect value for reserved[124], expected 122, is " << last_msg_->reserved[124]; - EXPECT_EQ(last_msg_->reserved[125], 213) << "incorrect value for reserved[125], expected 213, is " << last_msg_->reserved[125]; - EXPECT_EQ(last_msg_->reserved[126], 20) << "incorrect value for reserved[126], expected 20, is " << last_msg_->reserved[126]; - EXPECT_EQ(last_msg_->reserved[127], 85) << "incorrect value for reserved[127], expected 85, is " << last_msg_->reserved[127]; - EXPECT_EQ(last_msg_->reserved[128], 212) << "incorrect value for reserved[128], expected 212, is " << last_msg_->reserved[128]; - EXPECT_EQ(last_msg_->reserved[129], 131) << "incorrect value for reserved[129], expected 131, is " << last_msg_->reserved[129]; - EXPECT_EQ(last_msg_->reserved[130], 50) << "incorrect value for reserved[130], expected 50, is " << last_msg_->reserved[130]; - EXPECT_EQ(last_msg_->reserved[131], 224) << "incorrect value for reserved[131], expected 224, is " << last_msg_->reserved[131]; - EXPECT_EQ(last_msg_->reserved[132], 218) << "incorrect value for reserved[132], expected 218, is " << last_msg_->reserved[132]; - EXPECT_EQ(last_msg_->reserved[133], 215) << "incorrect value for reserved[133], expected 215, is " << last_msg_->reserved[133]; - EXPECT_EQ(last_msg_->reserved[134], 215) << "incorrect value for reserved[134], expected 215, is " << last_msg_->reserved[134]; - EXPECT_EQ(last_msg_->reserved[135], 149) << "incorrect value for reserved[135], expected 149, is " << last_msg_->reserved[135]; - EXPECT_EQ(last_msg_->reserved[136], 2) << "incorrect value for reserved[136], expected 2, is " << last_msg_->reserved[136]; - EXPECT_EQ(last_msg_->reserved[137], 19) << "incorrect value for reserved[137], expected 19, is " << last_msg_->reserved[137]; - EXPECT_EQ(last_msg_->reserved[138], 129) << "incorrect value for reserved[138], expected 129, is " << last_msg_->reserved[138]; - EXPECT_EQ(last_msg_->reserved[139], 39) << "incorrect value for reserved[139], expected 39, is " << last_msg_->reserved[139]; - EXPECT_EQ(last_msg_->reserved[140], 164) << "incorrect value for reserved[140], expected 164, is " << last_msg_->reserved[140]; - EXPECT_EQ(last_msg_->reserved[141], 5) << "incorrect value for reserved[141], expected 5, is " << last_msg_->reserved[141]; - EXPECT_EQ(last_msg_->reserved[142], 175) << "incorrect value for reserved[142], expected 175, is " << last_msg_->reserved[142]; - EXPECT_EQ(last_msg_->reserved[143], 6) << "incorrect value for reserved[143], expected 6, is " << last_msg_->reserved[143]; - EXPECT_EQ(last_msg_->reserved[144], 62) << "incorrect value for reserved[144], expected 62, is " << last_msg_->reserved[144]; - EXPECT_EQ(last_msg_->reserved[145], 51) << "incorrect value for reserved[145], expected 51, is " << last_msg_->reserved[145]; - EXPECT_EQ(last_msg_->reserved[146], 78) << "incorrect value for reserved[146], expected 78, is " << last_msg_->reserved[146]; - EXPECT_EQ(last_msg_->reserved[147], 66) << "incorrect value for reserved[147], expected 66, is " << last_msg_->reserved[147]; - EXPECT_EQ(last_msg_->reserved[148], 248) << "incorrect value for reserved[148], expected 248, is " << last_msg_->reserved[148]; - EXPECT_EQ(last_msg_->reserved[149], 116) << "incorrect value for reserved[149], expected 116, is " << last_msg_->reserved[149]; - EXPECT_EQ(last_msg_->reserved[150], 88) << "incorrect value for reserved[150], expected 88, is " << last_msg_->reserved[150]; - EXPECT_EQ(last_msg_->reserved[151], 90) << "incorrect value for reserved[151], expected 90, is " << last_msg_->reserved[151]; - EXPECT_EQ(last_msg_->reserved[152], 128) << "incorrect value for reserved[152], expected 128, is " << last_msg_->reserved[152]; - EXPECT_EQ(last_msg_->reserved[153], 226) << "incorrect value for reserved[153], expected 226, is " << last_msg_->reserved[153]; - EXPECT_EQ(last_msg_->reserved[154], 177) << "incorrect value for reserved[154], expected 177, is " << last_msg_->reserved[154]; - EXPECT_EQ(last_msg_->reserved[155], 0) << "incorrect value for reserved[155], expected 0, is " << last_msg_->reserved[155]; - EXPECT_EQ(last_msg_->reserved[156], 47) << "incorrect value for reserved[156], expected 47, is " << last_msg_->reserved[156]; - EXPECT_EQ(last_msg_->reserved[157], 140) << "incorrect value for reserved[157], expected 140, is " << last_msg_->reserved[157]; - EXPECT_EQ(last_msg_->reserved[158], 33) << "incorrect value for reserved[158], expected 33, is " << last_msg_->reserved[158]; - EXPECT_EQ(last_msg_->reserved[159], 126) << "incorrect value for reserved[159], expected 126, is " << last_msg_->reserved[159]; - EXPECT_EQ(last_msg_->reserved[160], 221) << "incorrect value for reserved[160], expected 221, is " << last_msg_->reserved[160]; - EXPECT_EQ(last_msg_->reserved[161], 110) << "incorrect value for reserved[161], expected 110, is " << last_msg_->reserved[161]; - EXPECT_EQ(last_msg_->reserved[162], 144) << "incorrect value for reserved[162], expected 144, is " << last_msg_->reserved[162]; - EXPECT_EQ(last_msg_->reserved[163], 97) << "incorrect value for reserved[163], expected 97, is " << last_msg_->reserved[163]; - EXPECT_EQ(last_msg_->reserved[164], 74) << "incorrect value for reserved[164], expected 74, is " << last_msg_->reserved[164]; - EXPECT_EQ(last_msg_->reserved[165], 250) << "incorrect value for reserved[165], expected 250, is " << last_msg_->reserved[165]; - EXPECT_EQ(last_msg_->reserved[166], 181) << "incorrect value for reserved[166], expected 181, is " << last_msg_->reserved[166]; - EXPECT_EQ(last_msg_->reserved[167], 199) << "incorrect value for reserved[167], expected 199, is " << last_msg_->reserved[167]; - EXPECT_EQ(last_msg_->reserved[168], 27) << "incorrect value for reserved[168], expected 27, is " << last_msg_->reserved[168]; - EXPECT_EQ(last_msg_->reserved[169], 176) << "incorrect value for reserved[169], expected 176, is " << last_msg_->reserved[169]; - EXPECT_EQ(last_msg_->reserved[170], 65) << "incorrect value for reserved[170], expected 65, is " << last_msg_->reserved[170]; - EXPECT_EQ(last_msg_->reserved[171], 185) << "incorrect value for reserved[171], expected 185, is " << last_msg_->reserved[171]; - EXPECT_EQ(last_msg_->reserved[172], 110) << "incorrect value for reserved[172], expected 110, is " << last_msg_->reserved[172]; - EXPECT_EQ(last_msg_->reserved[173], 92) << "incorrect value for reserved[173], expected 92, is " << last_msg_->reserved[173]; - EXPECT_EQ(last_msg_->reserved[174], 34) << "incorrect value for reserved[174], expected 34, is " << last_msg_->reserved[174]; - EXPECT_EQ(last_msg_->reserved[175], 44) << "incorrect value for reserved[175], expected 44, is " << last_msg_->reserved[175]; - EXPECT_EQ(last_msg_->reserved[176], 131) << "incorrect value for reserved[176], expected 131, is " << last_msg_->reserved[176]; - EXPECT_EQ(last_msg_->reserved[177], 96) << "incorrect value for reserved[177], expected 96, is " << last_msg_->reserved[177]; - EXPECT_EQ(last_msg_->reserved[178], 178) << "incorrect value for reserved[178], expected 178, is " << last_msg_->reserved[178]; - EXPECT_EQ(last_msg_->reserved[179], 40) << "incorrect value for reserved[179], expected 40, is " << last_msg_->reserved[179]; - EXPECT_EQ(last_msg_->reserved[180], 176) << "incorrect value for reserved[180], expected 176, is " << last_msg_->reserved[180]; - EXPECT_EQ(last_msg_->reserved[181], 4) << "incorrect value for reserved[181], expected 4, is " << last_msg_->reserved[181]; - EXPECT_EQ(last_msg_->reserved[182], 90) << "incorrect value for reserved[182], expected 90, is " << last_msg_->reserved[182]; - EXPECT_EQ(last_msg_->reserved[183], 36) << "incorrect value for reserved[183], expected 36, is " << last_msg_->reserved[183]; - EXPECT_EQ(last_msg_->reserved[184], 7) << "incorrect value for reserved[184], expected 7, is " << last_msg_->reserved[184]; - EXPECT_EQ(last_msg_->reserved[185], 180) << "incorrect value for reserved[185], expected 180, is " << last_msg_->reserved[185]; - EXPECT_EQ(last_msg_->reserved[186], 244) << "incorrect value for reserved[186], expected 244, is " << last_msg_->reserved[186]; - EXPECT_EQ(last_msg_->reserved[187], 244) << "incorrect value for reserved[187], expected 244, is " << last_msg_->reserved[187]; - EXPECT_EQ(last_msg_->reserved[188], 23) << "incorrect value for reserved[188], expected 23, is " << last_msg_->reserved[188]; - EXPECT_EQ(last_msg_->reserved[189], 108) << "incorrect value for reserved[189], expected 108, is " << last_msg_->reserved[189]; - EXPECT_EQ(last_msg_->reserved[190], 171) << "incorrect value for reserved[190], expected 171, is " << last_msg_->reserved[190]; - EXPECT_EQ(last_msg_->reserved[191], 204) << "incorrect value for reserved[191], expected 204, is " << last_msg_->reserved[191]; - EXPECT_EQ(last_msg_->reserved[192], 196) << "incorrect value for reserved[192], expected 196, is " << last_msg_->reserved[192]; - EXPECT_EQ(last_msg_->reserved[193], 61) << "incorrect value for reserved[193], expected 61, is " << last_msg_->reserved[193]; - EXPECT_EQ(last_msg_->reserved[194], 51) << "incorrect value for reserved[194], expected 51, is " << last_msg_->reserved[194]; - EXPECT_EQ(last_msg_->reserved[195], 179) << "incorrect value for reserved[195], expected 179, is " << last_msg_->reserved[195]; - EXPECT_EQ(last_msg_->reserved[196], 242) << "incorrect value for reserved[196], expected 242, is " << last_msg_->reserved[196]; - EXPECT_EQ(last_msg_->reserved[197], 156) << "incorrect value for reserved[197], expected 156, is " << last_msg_->reserved[197]; - EXPECT_EQ(last_msg_->reserved[198], 81) << "incorrect value for reserved[198], expected 81, is " << last_msg_->reserved[198]; - EXPECT_EQ(last_msg_->reserved[199], 83) << "incorrect value for reserved[199], expected 83, is " << last_msg_->reserved[199]; - EXPECT_EQ(last_msg_->reserved[200], 16) << "incorrect value for reserved[200], expected 16, is " << last_msg_->reserved[200]; - EXPECT_EQ(last_msg_->reserved[201], 15) << "incorrect value for reserved[201], expected 15, is " << last_msg_->reserved[201]; - EXPECT_EQ(last_msg_->reserved[202], 134) << "incorrect value for reserved[202], expected 134, is " << last_msg_->reserved[202]; - EXPECT_EQ(last_msg_->reserved[203], 40) << "incorrect value for reserved[203], expected 40, is " << last_msg_->reserved[203]; - EXPECT_EQ(last_msg_->reserved[204], 245) << "incorrect value for reserved[204], expected 245, is " << last_msg_->reserved[204]; - EXPECT_EQ(last_msg_->reserved[205], 253) << "incorrect value for reserved[205], expected 253, is " << last_msg_->reserved[205]; - EXPECT_EQ(last_msg_->reserved[206], 150) << "incorrect value for reserved[206], expected 150, is " << last_msg_->reserved[206]; - EXPECT_EQ(last_msg_->reserved[207], 94) << "incorrect value for reserved[207], expected 94, is " << last_msg_->reserved[207]; - EXPECT_EQ(last_msg_->reserved[208], 150) << "incorrect value for reserved[208], expected 150, is " << last_msg_->reserved[208]; - EXPECT_EQ(last_msg_->reserved[209], 144) << "incorrect value for reserved[209], expected 144, is " << last_msg_->reserved[209]; - EXPECT_EQ(last_msg_->reserved[210], 197) << "incorrect value for reserved[210], expected 197, is " << last_msg_->reserved[210]; - EXPECT_EQ(last_msg_->reserved[211], 113) << "incorrect value for reserved[211], expected 113, is " << last_msg_->reserved[211]; - EXPECT_EQ(last_msg_->reserved[212], 5) << "incorrect value for reserved[212], expected 5, is " << last_msg_->reserved[212]; - EXPECT_EQ(last_msg_->reserved[213], 141) << "incorrect value for reserved[213], expected 141, is " << last_msg_->reserved[213]; - EXPECT_EQ(last_msg_->reserved[214], 232) << "incorrect value for reserved[214], expected 232, is " << last_msg_->reserved[214]; - EXPECT_EQ(last_msg_->reserved[215], 33) << "incorrect value for reserved[215], expected 33, is " << last_msg_->reserved[215]; - EXPECT_EQ(last_msg_->reserved[216], 101) << "incorrect value for reserved[216], expected 101, is " << last_msg_->reserved[216]; - EXPECT_EQ(last_msg_->reserved[217], 231) << "incorrect value for reserved[217], expected 231, is " << last_msg_->reserved[217]; - EXPECT_EQ(last_msg_->reserved[218], 38) << "incorrect value for reserved[218], expected 38, is " << last_msg_->reserved[218]; - EXPECT_EQ(last_msg_->reserved[219], 75) << "incorrect value for reserved[219], expected 75, is " << last_msg_->reserved[219]; - EXPECT_EQ(last_msg_->reserved[220], 178) << "incorrect value for reserved[220], expected 178, is " << last_msg_->reserved[220]; - EXPECT_EQ(last_msg_->reserved[221], 243) << "incorrect value for reserved[221], expected 243, is " << last_msg_->reserved[221]; - EXPECT_EQ(last_msg_->reserved[222], 119) << "incorrect value for reserved[222], expected 119, is " << last_msg_->reserved[222]; - EXPECT_EQ(last_msg_->reserved[223], 1) << "incorrect value for reserved[223], expected 1, is " << last_msg_->reserved[223]; - EXPECT_EQ(last_msg_->reserved[224], 248) << "incorrect value for reserved[224], expected 248, is " << last_msg_->reserved[224]; - EXPECT_EQ(last_msg_->reserved[225], 218) << "incorrect value for reserved[225], expected 218, is " << last_msg_->reserved[225]; - EXPECT_EQ(last_msg_->reserved[226], 86) << "incorrect value for reserved[226], expected 86, is " << last_msg_->reserved[226]; - EXPECT_EQ(last_msg_->reserved[227], 7) << "incorrect value for reserved[227], expected 7, is " << last_msg_->reserved[227]; - EXPECT_EQ(last_msg_->reserved[228], 88) << "incorrect value for reserved[228], expected 88, is " << last_msg_->reserved[228]; - EXPECT_EQ(last_msg_->reserved[229], 197) << "incorrect value for reserved[229], expected 197, is " << last_msg_->reserved[229]; - EXPECT_EQ(last_msg_->reserved[230], 148) << "incorrect value for reserved[230], expected 148, is " << last_msg_->reserved[230]; - EXPECT_EQ(last_msg_->reserved[231], 240) << "incorrect value for reserved[231], expected 240, is " << last_msg_->reserved[231]; - EXPECT_EQ(last_msg_->reserved[232], 227) << "incorrect value for reserved[232], expected 227, is " << last_msg_->reserved[232]; - EXPECT_EQ(last_msg_->reserved[233], 2) << "incorrect value for reserved[233], expected 2, is " << last_msg_->reserved[233]; - EXPECT_EQ(last_msg_->reserved[234], 65) << "incorrect value for reserved[234], expected 65, is " << last_msg_->reserved[234]; - EXPECT_EQ(last_msg_->reserved[235], 173) << "incorrect value for reserved[235], expected 173, is " << last_msg_->reserved[235]; - EXPECT_EQ(last_msg_->reserved[236], 122) << "incorrect value for reserved[236], expected 122, is " << last_msg_->reserved[236]; - EXPECT_EQ(last_msg_->reserved[237], 143) << "incorrect value for reserved[237], expected 143, is " << last_msg_->reserved[237]; - EXPECT_EQ(last_msg_->reserved[238], 251) << "incorrect value for reserved[238], expected 251, is " << last_msg_->reserved[238]; - EXPECT_EQ(last_msg_->reserved[239], 156) << "incorrect value for reserved[239], expected 156, is " << last_msg_->reserved[239]; - EXPECT_EQ(last_msg_->reserved[240], 217) << "incorrect value for reserved[240], expected 217, is " << last_msg_->reserved[240]; - EXPECT_EQ(last_msg_->reserved[241], 67) << "incorrect value for reserved[241], expected 67, is " << last_msg_->reserved[241]; - EXPECT_EQ(last_msg_->reserved[242], 239) << "incorrect value for reserved[242], expected 239, is " << last_msg_->reserved[242]; - EXPECT_EQ(last_msg_->reserved[243], 219) << "incorrect value for reserved[243], expected 219, is " << last_msg_->reserved[243]; - EXPECT_EQ(last_msg_->reserved[244], 31) << "incorrect value for reserved[244], expected 31, is " << last_msg_->reserved[244]; - EXPECT_EQ(last_msg_->reserved[245], 224) << "incorrect value for reserved[245], expected 224, is " << last_msg_->reserved[245]; - EXPECT_EQ(last_msg_->reserved[246], 176) << "incorrect value for reserved[246], expected 176, is " << last_msg_->reserved[246]; - EXPECT_EQ(last_msg_->reserved[247], 129) << "incorrect value for reserved[247], expected 129, is " << last_msg_->reserved[247]; - EXPECT_EQ(last_msg_->reserved[248], 81) << "incorrect value for reserved[248], expected 81, is " << last_msg_->reserved[248]; - EXPECT_EQ(last_msg_->reserved[249], 80) << "incorrect value for reserved[249], expected 80, is " << last_msg_->reserved[249]; - EXPECT_LT((last_msg_->signal_error_rate*100 - 8588.20019531*100), 0.05) << "incorrect value for signal_error_rate, expected 8588.20019531, is " << last_msg_->signal_error_rate; - EXPECT_EQ(last_msg_->signal_strength, 103) << "incorrect value for signal_strength, expected 103, is " << last_msg_->signal_strength; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 6931); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->reserved[0], 123) + << "incorrect value for reserved[0], expected 123, is " + << last_msg_->reserved[0]; + EXPECT_EQ(last_msg_->reserved[1], 242) + << "incorrect value for reserved[1], expected 242, is " + << last_msg_->reserved[1]; + EXPECT_EQ(last_msg_->reserved[2], 46) + << "incorrect value for reserved[2], expected 46, is " + << last_msg_->reserved[2]; + EXPECT_EQ(last_msg_->reserved[3], 52) + << "incorrect value for reserved[3], expected 52, is " + << last_msg_->reserved[3]; + EXPECT_EQ(last_msg_->reserved[4], 64) + << "incorrect value for reserved[4], expected 64, is " + << last_msg_->reserved[4]; + EXPECT_EQ(last_msg_->reserved[5], 176) + << "incorrect value for reserved[5], expected 176, is " + << last_msg_->reserved[5]; + EXPECT_EQ(last_msg_->reserved[6], 154) + << "incorrect value for reserved[6], expected 154, is " + << last_msg_->reserved[6]; + EXPECT_EQ(last_msg_->reserved[7], 98) + << "incorrect value for reserved[7], expected 98, is " + << last_msg_->reserved[7]; + EXPECT_EQ(last_msg_->reserved[8], 43) + << "incorrect value for reserved[8], expected 43, is " + << last_msg_->reserved[8]; + EXPECT_EQ(last_msg_->reserved[9], 132) + << "incorrect value for reserved[9], expected 132, is " + << last_msg_->reserved[9]; + EXPECT_EQ(last_msg_->reserved[10], 196) + << "incorrect value for reserved[10], expected 196, is " + << last_msg_->reserved[10]; + EXPECT_EQ(last_msg_->reserved[11], 89) + << "incorrect value for reserved[11], expected 89, is " + << last_msg_->reserved[11]; + EXPECT_EQ(last_msg_->reserved[12], 253) + << "incorrect value for reserved[12], expected 253, is " + << last_msg_->reserved[12]; + EXPECT_EQ(last_msg_->reserved[13], 161) + << "incorrect value for reserved[13], expected 161, is " + << last_msg_->reserved[13]; + EXPECT_EQ(last_msg_->reserved[14], 250) + << "incorrect value for reserved[14], expected 250, is " + << last_msg_->reserved[14]; + EXPECT_EQ(last_msg_->reserved[15], 174) + << "incorrect value for reserved[15], expected 174, is " + << last_msg_->reserved[15]; + EXPECT_EQ(last_msg_->reserved[16], 204) + << "incorrect value for reserved[16], expected 204, is " + << last_msg_->reserved[16]; + EXPECT_EQ(last_msg_->reserved[17], 110) + << "incorrect value for reserved[17], expected 110, is " + << last_msg_->reserved[17]; + EXPECT_EQ(last_msg_->reserved[18], 47) + << "incorrect value for reserved[18], expected 47, is " + << last_msg_->reserved[18]; + EXPECT_EQ(last_msg_->reserved[19], 38) + << "incorrect value for reserved[19], expected 38, is " + << last_msg_->reserved[19]; + EXPECT_EQ(last_msg_->reserved[20], 187) + << "incorrect value for reserved[20], expected 187, is " + << last_msg_->reserved[20]; + EXPECT_EQ(last_msg_->reserved[21], 63) + << "incorrect value for reserved[21], expected 63, is " + << last_msg_->reserved[21]; + EXPECT_EQ(last_msg_->reserved[22], 102) + << "incorrect value for reserved[22], expected 102, is " + << last_msg_->reserved[22]; + EXPECT_EQ(last_msg_->reserved[23], 177) + << "incorrect value for reserved[23], expected 177, is " + << last_msg_->reserved[23]; + EXPECT_EQ(last_msg_->reserved[24], 162) + << "incorrect value for reserved[24], expected 162, is " + << last_msg_->reserved[24]; + EXPECT_EQ(last_msg_->reserved[25], 49) + << "incorrect value for reserved[25], expected 49, is " + << last_msg_->reserved[25]; + EXPECT_EQ(last_msg_->reserved[26], 80) + << "incorrect value for reserved[26], expected 80, is " + << last_msg_->reserved[26]; + EXPECT_EQ(last_msg_->reserved[27], 194) + << "incorrect value for reserved[27], expected 194, is " + << last_msg_->reserved[27]; + EXPECT_EQ(last_msg_->reserved[28], 37) + << "incorrect value for reserved[28], expected 37, is " + << last_msg_->reserved[28]; + EXPECT_EQ(last_msg_->reserved[29], 107) + << "incorrect value for reserved[29], expected 107, is " + << last_msg_->reserved[29]; + EXPECT_EQ(last_msg_->reserved[30], 60) + << "incorrect value for reserved[30], expected 60, is " + << last_msg_->reserved[30]; + EXPECT_EQ(last_msg_->reserved[31], 225) + << "incorrect value for reserved[31], expected 225, is " + << last_msg_->reserved[31]; + EXPECT_EQ(last_msg_->reserved[32], 52) + << "incorrect value for reserved[32], expected 52, is " + << last_msg_->reserved[32]; + EXPECT_EQ(last_msg_->reserved[33], 101) + << "incorrect value for reserved[33], expected 101, is " + << last_msg_->reserved[33]; + EXPECT_EQ(last_msg_->reserved[34], 178) + << "incorrect value for reserved[34], expected 178, is " + << last_msg_->reserved[34]; + EXPECT_EQ(last_msg_->reserved[35], 142) + << "incorrect value for reserved[35], expected 142, is " + << last_msg_->reserved[35]; + EXPECT_EQ(last_msg_->reserved[36], 246) + << "incorrect value for reserved[36], expected 246, is " + << last_msg_->reserved[36]; + EXPECT_EQ(last_msg_->reserved[37], 21) + << "incorrect value for reserved[37], expected 21, is " + << last_msg_->reserved[37]; + EXPECT_EQ(last_msg_->reserved[38], 17) + << "incorrect value for reserved[38], expected 17, is " + << last_msg_->reserved[38]; + EXPECT_EQ(last_msg_->reserved[39], 93) + << "incorrect value for reserved[39], expected 93, is " + << last_msg_->reserved[39]; + EXPECT_EQ(last_msg_->reserved[40], 75) + << "incorrect value for reserved[40], expected 75, is " + << last_msg_->reserved[40]; + EXPECT_EQ(last_msg_->reserved[41], 169) + << "incorrect value for reserved[41], expected 169, is " + << last_msg_->reserved[41]; + EXPECT_EQ(last_msg_->reserved[42], 86) + << "incorrect value for reserved[42], expected 86, is " + << last_msg_->reserved[42]; + EXPECT_EQ(last_msg_->reserved[43], 16) + << "incorrect value for reserved[43], expected 16, is " + << last_msg_->reserved[43]; + EXPECT_EQ(last_msg_->reserved[44], 209) + << "incorrect value for reserved[44], expected 209, is " + << last_msg_->reserved[44]; + EXPECT_EQ(last_msg_->reserved[45], 80) + << "incorrect value for reserved[45], expected 80, is " + << last_msg_->reserved[45]; + EXPECT_EQ(last_msg_->reserved[46], 243) + << "incorrect value for reserved[46], expected 243, is " + << last_msg_->reserved[46]; + EXPECT_EQ(last_msg_->reserved[47], 30) + << "incorrect value for reserved[47], expected 30, is " + << last_msg_->reserved[47]; + EXPECT_EQ(last_msg_->reserved[48], 206) + << "incorrect value for reserved[48], expected 206, is " + << last_msg_->reserved[48]; + EXPECT_EQ(last_msg_->reserved[49], 220) + << "incorrect value for reserved[49], expected 220, is " + << last_msg_->reserved[49]; + EXPECT_EQ(last_msg_->reserved[50], 206) + << "incorrect value for reserved[50], expected 206, is " + << last_msg_->reserved[50]; + EXPECT_EQ(last_msg_->reserved[51], 115) + << "incorrect value for reserved[51], expected 115, is " + << last_msg_->reserved[51]; + EXPECT_EQ(last_msg_->reserved[52], 47) + << "incorrect value for reserved[52], expected 47, is " + << last_msg_->reserved[52]; + EXPECT_EQ(last_msg_->reserved[53], 154) + << "incorrect value for reserved[53], expected 154, is " + << last_msg_->reserved[53]; + EXPECT_EQ(last_msg_->reserved[54], 91) + << "incorrect value for reserved[54], expected 91, is " + << last_msg_->reserved[54]; + EXPECT_EQ(last_msg_->reserved[55], 227) + << "incorrect value for reserved[55], expected 227, is " + << last_msg_->reserved[55]; + EXPECT_EQ(last_msg_->reserved[56], 88) + << "incorrect value for reserved[56], expected 88, is " + << last_msg_->reserved[56]; + EXPECT_EQ(last_msg_->reserved[57], 11) + << "incorrect value for reserved[57], expected 11, is " + << last_msg_->reserved[57]; + EXPECT_EQ(last_msg_->reserved[58], 1) + << "incorrect value for reserved[58], expected 1, is " + << last_msg_->reserved[58]; + EXPECT_EQ(last_msg_->reserved[59], 85) + << "incorrect value for reserved[59], expected 85, is " + << last_msg_->reserved[59]; + EXPECT_EQ(last_msg_->reserved[60], 146) + << "incorrect value for reserved[60], expected 146, is " + << last_msg_->reserved[60]; + EXPECT_EQ(last_msg_->reserved[61], 100) + << "incorrect value for reserved[61], expected 100, is " + << last_msg_->reserved[61]; + EXPECT_EQ(last_msg_->reserved[62], 190) + << "incorrect value for reserved[62], expected 190, is " + << last_msg_->reserved[62]; + EXPECT_EQ(last_msg_->reserved[63], 232) + << "incorrect value for reserved[63], expected 232, is " + << last_msg_->reserved[63]; + EXPECT_EQ(last_msg_->reserved[64], 207) + << "incorrect value for reserved[64], expected 207, is " + << last_msg_->reserved[64]; + EXPECT_EQ(last_msg_->reserved[65], 61) + << "incorrect value for reserved[65], expected 61, is " + << last_msg_->reserved[65]; + EXPECT_EQ(last_msg_->reserved[66], 61) + << "incorrect value for reserved[66], expected 61, is " + << last_msg_->reserved[66]; + EXPECT_EQ(last_msg_->reserved[67], 201) + << "incorrect value for reserved[67], expected 201, is " + << last_msg_->reserved[67]; + EXPECT_EQ(last_msg_->reserved[68], 220) + << "incorrect value for reserved[68], expected 220, is " + << last_msg_->reserved[68]; + EXPECT_EQ(last_msg_->reserved[69], 31) + << "incorrect value for reserved[69], expected 31, is " + << last_msg_->reserved[69]; + EXPECT_EQ(last_msg_->reserved[70], 78) + << "incorrect value for reserved[70], expected 78, is " + << last_msg_->reserved[70]; + EXPECT_EQ(last_msg_->reserved[71], 34) + << "incorrect value for reserved[71], expected 34, is " + << last_msg_->reserved[71]; + EXPECT_EQ(last_msg_->reserved[72], 57) + << "incorrect value for reserved[72], expected 57, is " + << last_msg_->reserved[72]; + EXPECT_EQ(last_msg_->reserved[73], 82) + << "incorrect value for reserved[73], expected 82, is " + << last_msg_->reserved[73]; + EXPECT_EQ(last_msg_->reserved[74], 59) + << "incorrect value for reserved[74], expected 59, is " + << last_msg_->reserved[74]; + EXPECT_EQ(last_msg_->reserved[75], 104) + << "incorrect value for reserved[75], expected 104, is " + << last_msg_->reserved[75]; + EXPECT_EQ(last_msg_->reserved[76], 65) + << "incorrect value for reserved[76], expected 65, is " + << last_msg_->reserved[76]; + EXPECT_EQ(last_msg_->reserved[77], 221) + << "incorrect value for reserved[77], expected 221, is " + << last_msg_->reserved[77]; + EXPECT_EQ(last_msg_->reserved[78], 0) + << "incorrect value for reserved[78], expected 0, is " + << last_msg_->reserved[78]; + EXPECT_EQ(last_msg_->reserved[79], 43) + << "incorrect value for reserved[79], expected 43, is " + << last_msg_->reserved[79]; + EXPECT_EQ(last_msg_->reserved[80], 210) + << "incorrect value for reserved[80], expected 210, is " + << last_msg_->reserved[80]; + EXPECT_EQ(last_msg_->reserved[81], 9) + << "incorrect value for reserved[81], expected 9, is " + << last_msg_->reserved[81]; + EXPECT_EQ(last_msg_->reserved[82], 32) + << "incorrect value for reserved[82], expected 32, is " + << last_msg_->reserved[82]; + EXPECT_EQ(last_msg_->reserved[83], 122) + << "incorrect value for reserved[83], expected 122, is " + << last_msg_->reserved[83]; + EXPECT_EQ(last_msg_->reserved[84], 29) + << "incorrect value for reserved[84], expected 29, is " + << last_msg_->reserved[84]; + EXPECT_EQ(last_msg_->reserved[85], 237) + << "incorrect value for reserved[85], expected 237, is " + << last_msg_->reserved[85]; + EXPECT_EQ(last_msg_->reserved[86], 11) + << "incorrect value for reserved[86], expected 11, is " + << last_msg_->reserved[86]; + EXPECT_EQ(last_msg_->reserved[87], 151) + << "incorrect value for reserved[87], expected 151, is " + << last_msg_->reserved[87]; + EXPECT_EQ(last_msg_->reserved[88], 223) + << "incorrect value for reserved[88], expected 223, is " + << last_msg_->reserved[88]; + EXPECT_EQ(last_msg_->reserved[89], 18) + << "incorrect value for reserved[89], expected 18, is " + << last_msg_->reserved[89]; + EXPECT_EQ(last_msg_->reserved[90], 81) + << "incorrect value for reserved[90], expected 81, is " + << last_msg_->reserved[90]; + EXPECT_EQ(last_msg_->reserved[91], 204) + << "incorrect value for reserved[91], expected 204, is " + << last_msg_->reserved[91]; + EXPECT_EQ(last_msg_->reserved[92], 172) + << "incorrect value for reserved[92], expected 172, is " + << last_msg_->reserved[92]; + EXPECT_EQ(last_msg_->reserved[93], 234) + << "incorrect value for reserved[93], expected 234, is " + << last_msg_->reserved[93]; + EXPECT_EQ(last_msg_->reserved[94], 127) + << "incorrect value for reserved[94], expected 127, is " + << last_msg_->reserved[94]; + EXPECT_EQ(last_msg_->reserved[95], 3) + << "incorrect value for reserved[95], expected 3, is " + << last_msg_->reserved[95]; + EXPECT_EQ(last_msg_->reserved[96], 82) + << "incorrect value for reserved[96], expected 82, is " + << last_msg_->reserved[96]; + EXPECT_EQ(last_msg_->reserved[97], 133) + << "incorrect value for reserved[97], expected 133, is " + << last_msg_->reserved[97]; + EXPECT_EQ(last_msg_->reserved[98], 169) + << "incorrect value for reserved[98], expected 169, is " + << last_msg_->reserved[98]; + EXPECT_EQ(last_msg_->reserved[99], 12) + << "incorrect value for reserved[99], expected 12, is " + << last_msg_->reserved[99]; + EXPECT_EQ(last_msg_->reserved[100], 176) + << "incorrect value for reserved[100], expected 176, is " + << last_msg_->reserved[100]; + EXPECT_EQ(last_msg_->reserved[101], 193) + << "incorrect value for reserved[101], expected 193, is " + << last_msg_->reserved[101]; + EXPECT_EQ(last_msg_->reserved[102], 0) + << "incorrect value for reserved[102], expected 0, is " + << last_msg_->reserved[102]; + EXPECT_EQ(last_msg_->reserved[103], 24) + << "incorrect value for reserved[103], expected 24, is " + << last_msg_->reserved[103]; + EXPECT_EQ(last_msg_->reserved[104], 121) + << "incorrect value for reserved[104], expected 121, is " + << last_msg_->reserved[104]; + EXPECT_EQ(last_msg_->reserved[105], 85) + << "incorrect value for reserved[105], expected 85, is " + << last_msg_->reserved[105]; + EXPECT_EQ(last_msg_->reserved[106], 55) + << "incorrect value for reserved[106], expected 55, is " + << last_msg_->reserved[106]; + EXPECT_EQ(last_msg_->reserved[107], 214) + << "incorrect value for reserved[107], expected 214, is " + << last_msg_->reserved[107]; + EXPECT_EQ(last_msg_->reserved[108], 198) + << "incorrect value for reserved[108], expected 198, is " + << last_msg_->reserved[108]; + EXPECT_EQ(last_msg_->reserved[109], 75) + << "incorrect value for reserved[109], expected 75, is " + << last_msg_->reserved[109]; + EXPECT_EQ(last_msg_->reserved[110], 234) + << "incorrect value for reserved[110], expected 234, is " + << last_msg_->reserved[110]; + EXPECT_EQ(last_msg_->reserved[111], 179) + << "incorrect value for reserved[111], expected 179, is " + << last_msg_->reserved[111]; + EXPECT_EQ(last_msg_->reserved[112], 214) + << "incorrect value for reserved[112], expected 214, is " + << last_msg_->reserved[112]; + EXPECT_EQ(last_msg_->reserved[113], 85) + << "incorrect value for reserved[113], expected 85, is " + << last_msg_->reserved[113]; + EXPECT_EQ(last_msg_->reserved[114], 94) + << "incorrect value for reserved[114], expected 94, is " + << last_msg_->reserved[114]; + EXPECT_EQ(last_msg_->reserved[115], 115) + << "incorrect value for reserved[115], expected 115, is " + << last_msg_->reserved[115]; + EXPECT_EQ(last_msg_->reserved[116], 21) + << "incorrect value for reserved[116], expected 21, is " + << last_msg_->reserved[116]; + EXPECT_EQ(last_msg_->reserved[117], 73) + << "incorrect value for reserved[117], expected 73, is " + << last_msg_->reserved[117]; + EXPECT_EQ(last_msg_->reserved[118], 121) + << "incorrect value for reserved[118], expected 121, is " + << last_msg_->reserved[118]; + EXPECT_EQ(last_msg_->reserved[119], 75) + << "incorrect value for reserved[119], expected 75, is " + << last_msg_->reserved[119]; + EXPECT_EQ(last_msg_->reserved[120], 46) + << "incorrect value for reserved[120], expected 46, is " + << last_msg_->reserved[120]; + EXPECT_EQ(last_msg_->reserved[121], 158) + << "incorrect value for reserved[121], expected 158, is " + << last_msg_->reserved[121]; + EXPECT_EQ(last_msg_->reserved[122], 63) + << "incorrect value for reserved[122], expected 63, is " + << last_msg_->reserved[122]; + EXPECT_EQ(last_msg_->reserved[123], 100) + << "incorrect value for reserved[123], expected 100, is " + << last_msg_->reserved[123]; + EXPECT_EQ(last_msg_->reserved[124], 122) + << "incorrect value for reserved[124], expected 122, is " + << last_msg_->reserved[124]; + EXPECT_EQ(last_msg_->reserved[125], 213) + << "incorrect value for reserved[125], expected 213, is " + << last_msg_->reserved[125]; + EXPECT_EQ(last_msg_->reserved[126], 20) + << "incorrect value for reserved[126], expected 20, is " + << last_msg_->reserved[126]; + EXPECT_EQ(last_msg_->reserved[127], 85) + << "incorrect value for reserved[127], expected 85, is " + << last_msg_->reserved[127]; + EXPECT_EQ(last_msg_->reserved[128], 212) + << "incorrect value for reserved[128], expected 212, is " + << last_msg_->reserved[128]; + EXPECT_EQ(last_msg_->reserved[129], 131) + << "incorrect value for reserved[129], expected 131, is " + << last_msg_->reserved[129]; + EXPECT_EQ(last_msg_->reserved[130], 50) + << "incorrect value for reserved[130], expected 50, is " + << last_msg_->reserved[130]; + EXPECT_EQ(last_msg_->reserved[131], 224) + << "incorrect value for reserved[131], expected 224, is " + << last_msg_->reserved[131]; + EXPECT_EQ(last_msg_->reserved[132], 218) + << "incorrect value for reserved[132], expected 218, is " + << last_msg_->reserved[132]; + EXPECT_EQ(last_msg_->reserved[133], 215) + << "incorrect value for reserved[133], expected 215, is " + << last_msg_->reserved[133]; + EXPECT_EQ(last_msg_->reserved[134], 215) + << "incorrect value for reserved[134], expected 215, is " + << last_msg_->reserved[134]; + EXPECT_EQ(last_msg_->reserved[135], 149) + << "incorrect value for reserved[135], expected 149, is " + << last_msg_->reserved[135]; + EXPECT_EQ(last_msg_->reserved[136], 2) + << "incorrect value for reserved[136], expected 2, is " + << last_msg_->reserved[136]; + EXPECT_EQ(last_msg_->reserved[137], 19) + << "incorrect value for reserved[137], expected 19, is " + << last_msg_->reserved[137]; + EXPECT_EQ(last_msg_->reserved[138], 129) + << "incorrect value for reserved[138], expected 129, is " + << last_msg_->reserved[138]; + EXPECT_EQ(last_msg_->reserved[139], 39) + << "incorrect value for reserved[139], expected 39, is " + << last_msg_->reserved[139]; + EXPECT_EQ(last_msg_->reserved[140], 164) + << "incorrect value for reserved[140], expected 164, is " + << last_msg_->reserved[140]; + EXPECT_EQ(last_msg_->reserved[141], 5) + << "incorrect value for reserved[141], expected 5, is " + << last_msg_->reserved[141]; + EXPECT_EQ(last_msg_->reserved[142], 175) + << "incorrect value for reserved[142], expected 175, is " + << last_msg_->reserved[142]; + EXPECT_EQ(last_msg_->reserved[143], 6) + << "incorrect value for reserved[143], expected 6, is " + << last_msg_->reserved[143]; + EXPECT_EQ(last_msg_->reserved[144], 62) + << "incorrect value for reserved[144], expected 62, is " + << last_msg_->reserved[144]; + EXPECT_EQ(last_msg_->reserved[145], 51) + << "incorrect value for reserved[145], expected 51, is " + << last_msg_->reserved[145]; + EXPECT_EQ(last_msg_->reserved[146], 78) + << "incorrect value for reserved[146], expected 78, is " + << last_msg_->reserved[146]; + EXPECT_EQ(last_msg_->reserved[147], 66) + << "incorrect value for reserved[147], expected 66, is " + << last_msg_->reserved[147]; + EXPECT_EQ(last_msg_->reserved[148], 248) + << "incorrect value for reserved[148], expected 248, is " + << last_msg_->reserved[148]; + EXPECT_EQ(last_msg_->reserved[149], 116) + << "incorrect value for reserved[149], expected 116, is " + << last_msg_->reserved[149]; + EXPECT_EQ(last_msg_->reserved[150], 88) + << "incorrect value for reserved[150], expected 88, is " + << last_msg_->reserved[150]; + EXPECT_EQ(last_msg_->reserved[151], 90) + << "incorrect value for reserved[151], expected 90, is " + << last_msg_->reserved[151]; + EXPECT_EQ(last_msg_->reserved[152], 128) + << "incorrect value for reserved[152], expected 128, is " + << last_msg_->reserved[152]; + EXPECT_EQ(last_msg_->reserved[153], 226) + << "incorrect value for reserved[153], expected 226, is " + << last_msg_->reserved[153]; + EXPECT_EQ(last_msg_->reserved[154], 177) + << "incorrect value for reserved[154], expected 177, is " + << last_msg_->reserved[154]; + EXPECT_EQ(last_msg_->reserved[155], 0) + << "incorrect value for reserved[155], expected 0, is " + << last_msg_->reserved[155]; + EXPECT_EQ(last_msg_->reserved[156], 47) + << "incorrect value for reserved[156], expected 47, is " + << last_msg_->reserved[156]; + EXPECT_EQ(last_msg_->reserved[157], 140) + << "incorrect value for reserved[157], expected 140, is " + << last_msg_->reserved[157]; + EXPECT_EQ(last_msg_->reserved[158], 33) + << "incorrect value for reserved[158], expected 33, is " + << last_msg_->reserved[158]; + EXPECT_EQ(last_msg_->reserved[159], 126) + << "incorrect value for reserved[159], expected 126, is " + << last_msg_->reserved[159]; + EXPECT_EQ(last_msg_->reserved[160], 221) + << "incorrect value for reserved[160], expected 221, is " + << last_msg_->reserved[160]; + EXPECT_EQ(last_msg_->reserved[161], 110) + << "incorrect value for reserved[161], expected 110, is " + << last_msg_->reserved[161]; + EXPECT_EQ(last_msg_->reserved[162], 144) + << "incorrect value for reserved[162], expected 144, is " + << last_msg_->reserved[162]; + EXPECT_EQ(last_msg_->reserved[163], 97) + << "incorrect value for reserved[163], expected 97, is " + << last_msg_->reserved[163]; + EXPECT_EQ(last_msg_->reserved[164], 74) + << "incorrect value for reserved[164], expected 74, is " + << last_msg_->reserved[164]; + EXPECT_EQ(last_msg_->reserved[165], 250) + << "incorrect value for reserved[165], expected 250, is " + << last_msg_->reserved[165]; + EXPECT_EQ(last_msg_->reserved[166], 181) + << "incorrect value for reserved[166], expected 181, is " + << last_msg_->reserved[166]; + EXPECT_EQ(last_msg_->reserved[167], 199) + << "incorrect value for reserved[167], expected 199, is " + << last_msg_->reserved[167]; + EXPECT_EQ(last_msg_->reserved[168], 27) + << "incorrect value for reserved[168], expected 27, is " + << last_msg_->reserved[168]; + EXPECT_EQ(last_msg_->reserved[169], 176) + << "incorrect value for reserved[169], expected 176, is " + << last_msg_->reserved[169]; + EXPECT_EQ(last_msg_->reserved[170], 65) + << "incorrect value for reserved[170], expected 65, is " + << last_msg_->reserved[170]; + EXPECT_EQ(last_msg_->reserved[171], 185) + << "incorrect value for reserved[171], expected 185, is " + << last_msg_->reserved[171]; + EXPECT_EQ(last_msg_->reserved[172], 110) + << "incorrect value for reserved[172], expected 110, is " + << last_msg_->reserved[172]; + EXPECT_EQ(last_msg_->reserved[173], 92) + << "incorrect value for reserved[173], expected 92, is " + << last_msg_->reserved[173]; + EXPECT_EQ(last_msg_->reserved[174], 34) + << "incorrect value for reserved[174], expected 34, is " + << last_msg_->reserved[174]; + EXPECT_EQ(last_msg_->reserved[175], 44) + << "incorrect value for reserved[175], expected 44, is " + << last_msg_->reserved[175]; + EXPECT_EQ(last_msg_->reserved[176], 131) + << "incorrect value for reserved[176], expected 131, is " + << last_msg_->reserved[176]; + EXPECT_EQ(last_msg_->reserved[177], 96) + << "incorrect value for reserved[177], expected 96, is " + << last_msg_->reserved[177]; + EXPECT_EQ(last_msg_->reserved[178], 178) + << "incorrect value for reserved[178], expected 178, is " + << last_msg_->reserved[178]; + EXPECT_EQ(last_msg_->reserved[179], 40) + << "incorrect value for reserved[179], expected 40, is " + << last_msg_->reserved[179]; + EXPECT_EQ(last_msg_->reserved[180], 176) + << "incorrect value for reserved[180], expected 176, is " + << last_msg_->reserved[180]; + EXPECT_EQ(last_msg_->reserved[181], 4) + << "incorrect value for reserved[181], expected 4, is " + << last_msg_->reserved[181]; + EXPECT_EQ(last_msg_->reserved[182], 90) + << "incorrect value for reserved[182], expected 90, is " + << last_msg_->reserved[182]; + EXPECT_EQ(last_msg_->reserved[183], 36) + << "incorrect value for reserved[183], expected 36, is " + << last_msg_->reserved[183]; + EXPECT_EQ(last_msg_->reserved[184], 7) + << "incorrect value for reserved[184], expected 7, is " + << last_msg_->reserved[184]; + EXPECT_EQ(last_msg_->reserved[185], 180) + << "incorrect value for reserved[185], expected 180, is " + << last_msg_->reserved[185]; + EXPECT_EQ(last_msg_->reserved[186], 244) + << "incorrect value for reserved[186], expected 244, is " + << last_msg_->reserved[186]; + EXPECT_EQ(last_msg_->reserved[187], 244) + << "incorrect value for reserved[187], expected 244, is " + << last_msg_->reserved[187]; + EXPECT_EQ(last_msg_->reserved[188], 23) + << "incorrect value for reserved[188], expected 23, is " + << last_msg_->reserved[188]; + EXPECT_EQ(last_msg_->reserved[189], 108) + << "incorrect value for reserved[189], expected 108, is " + << last_msg_->reserved[189]; + EXPECT_EQ(last_msg_->reserved[190], 171) + << "incorrect value for reserved[190], expected 171, is " + << last_msg_->reserved[190]; + EXPECT_EQ(last_msg_->reserved[191], 204) + << "incorrect value for reserved[191], expected 204, is " + << last_msg_->reserved[191]; + EXPECT_EQ(last_msg_->reserved[192], 196) + << "incorrect value for reserved[192], expected 196, is " + << last_msg_->reserved[192]; + EXPECT_EQ(last_msg_->reserved[193], 61) + << "incorrect value for reserved[193], expected 61, is " + << last_msg_->reserved[193]; + EXPECT_EQ(last_msg_->reserved[194], 51) + << "incorrect value for reserved[194], expected 51, is " + << last_msg_->reserved[194]; + EXPECT_EQ(last_msg_->reserved[195], 179) + << "incorrect value for reserved[195], expected 179, is " + << last_msg_->reserved[195]; + EXPECT_EQ(last_msg_->reserved[196], 242) + << "incorrect value for reserved[196], expected 242, is " + << last_msg_->reserved[196]; + EXPECT_EQ(last_msg_->reserved[197], 156) + << "incorrect value for reserved[197], expected 156, is " + << last_msg_->reserved[197]; + EXPECT_EQ(last_msg_->reserved[198], 81) + << "incorrect value for reserved[198], expected 81, is " + << last_msg_->reserved[198]; + EXPECT_EQ(last_msg_->reserved[199], 83) + << "incorrect value for reserved[199], expected 83, is " + << last_msg_->reserved[199]; + EXPECT_EQ(last_msg_->reserved[200], 16) + << "incorrect value for reserved[200], expected 16, is " + << last_msg_->reserved[200]; + EXPECT_EQ(last_msg_->reserved[201], 15) + << "incorrect value for reserved[201], expected 15, is " + << last_msg_->reserved[201]; + EXPECT_EQ(last_msg_->reserved[202], 134) + << "incorrect value for reserved[202], expected 134, is " + << last_msg_->reserved[202]; + EXPECT_EQ(last_msg_->reserved[203], 40) + << "incorrect value for reserved[203], expected 40, is " + << last_msg_->reserved[203]; + EXPECT_EQ(last_msg_->reserved[204], 245) + << "incorrect value for reserved[204], expected 245, is " + << last_msg_->reserved[204]; + EXPECT_EQ(last_msg_->reserved[205], 253) + << "incorrect value for reserved[205], expected 253, is " + << last_msg_->reserved[205]; + EXPECT_EQ(last_msg_->reserved[206], 150) + << "incorrect value for reserved[206], expected 150, is " + << last_msg_->reserved[206]; + EXPECT_EQ(last_msg_->reserved[207], 94) + << "incorrect value for reserved[207], expected 94, is " + << last_msg_->reserved[207]; + EXPECT_EQ(last_msg_->reserved[208], 150) + << "incorrect value for reserved[208], expected 150, is " + << last_msg_->reserved[208]; + EXPECT_EQ(last_msg_->reserved[209], 144) + << "incorrect value for reserved[209], expected 144, is " + << last_msg_->reserved[209]; + EXPECT_EQ(last_msg_->reserved[210], 197) + << "incorrect value for reserved[210], expected 197, is " + << last_msg_->reserved[210]; + EXPECT_EQ(last_msg_->reserved[211], 113) + << "incorrect value for reserved[211], expected 113, is " + << last_msg_->reserved[211]; + EXPECT_EQ(last_msg_->reserved[212], 5) + << "incorrect value for reserved[212], expected 5, is " + << last_msg_->reserved[212]; + EXPECT_EQ(last_msg_->reserved[213], 141) + << "incorrect value for reserved[213], expected 141, is " + << last_msg_->reserved[213]; + EXPECT_EQ(last_msg_->reserved[214], 232) + << "incorrect value for reserved[214], expected 232, is " + << last_msg_->reserved[214]; + EXPECT_EQ(last_msg_->reserved[215], 33) + << "incorrect value for reserved[215], expected 33, is " + << last_msg_->reserved[215]; + EXPECT_EQ(last_msg_->reserved[216], 101) + << "incorrect value for reserved[216], expected 101, is " + << last_msg_->reserved[216]; + EXPECT_EQ(last_msg_->reserved[217], 231) + << "incorrect value for reserved[217], expected 231, is " + << last_msg_->reserved[217]; + EXPECT_EQ(last_msg_->reserved[218], 38) + << "incorrect value for reserved[218], expected 38, is " + << last_msg_->reserved[218]; + EXPECT_EQ(last_msg_->reserved[219], 75) + << "incorrect value for reserved[219], expected 75, is " + << last_msg_->reserved[219]; + EXPECT_EQ(last_msg_->reserved[220], 178) + << "incorrect value for reserved[220], expected 178, is " + << last_msg_->reserved[220]; + EXPECT_EQ(last_msg_->reserved[221], 243) + << "incorrect value for reserved[221], expected 243, is " + << last_msg_->reserved[221]; + EXPECT_EQ(last_msg_->reserved[222], 119) + << "incorrect value for reserved[222], expected 119, is " + << last_msg_->reserved[222]; + EXPECT_EQ(last_msg_->reserved[223], 1) + << "incorrect value for reserved[223], expected 1, is " + << last_msg_->reserved[223]; + EXPECT_EQ(last_msg_->reserved[224], 248) + << "incorrect value for reserved[224], expected 248, is " + << last_msg_->reserved[224]; + EXPECT_EQ(last_msg_->reserved[225], 218) + << "incorrect value for reserved[225], expected 218, is " + << last_msg_->reserved[225]; + EXPECT_EQ(last_msg_->reserved[226], 86) + << "incorrect value for reserved[226], expected 86, is " + << last_msg_->reserved[226]; + EXPECT_EQ(last_msg_->reserved[227], 7) + << "incorrect value for reserved[227], expected 7, is " + << last_msg_->reserved[227]; + EXPECT_EQ(last_msg_->reserved[228], 88) + << "incorrect value for reserved[228], expected 88, is " + << last_msg_->reserved[228]; + EXPECT_EQ(last_msg_->reserved[229], 197) + << "incorrect value for reserved[229], expected 197, is " + << last_msg_->reserved[229]; + EXPECT_EQ(last_msg_->reserved[230], 148) + << "incorrect value for reserved[230], expected 148, is " + << last_msg_->reserved[230]; + EXPECT_EQ(last_msg_->reserved[231], 240) + << "incorrect value for reserved[231], expected 240, is " + << last_msg_->reserved[231]; + EXPECT_EQ(last_msg_->reserved[232], 227) + << "incorrect value for reserved[232], expected 227, is " + << last_msg_->reserved[232]; + EXPECT_EQ(last_msg_->reserved[233], 2) + << "incorrect value for reserved[233], expected 2, is " + << last_msg_->reserved[233]; + EXPECT_EQ(last_msg_->reserved[234], 65) + << "incorrect value for reserved[234], expected 65, is " + << last_msg_->reserved[234]; + EXPECT_EQ(last_msg_->reserved[235], 173) + << "incorrect value for reserved[235], expected 173, is " + << last_msg_->reserved[235]; + EXPECT_EQ(last_msg_->reserved[236], 122) + << "incorrect value for reserved[236], expected 122, is " + << last_msg_->reserved[236]; + EXPECT_EQ(last_msg_->reserved[237], 143) + << "incorrect value for reserved[237], expected 143, is " + << last_msg_->reserved[237]; + EXPECT_EQ(last_msg_->reserved[238], 251) + << "incorrect value for reserved[238], expected 251, is " + << last_msg_->reserved[238]; + EXPECT_EQ(last_msg_->reserved[239], 156) + << "incorrect value for reserved[239], expected 156, is " + << last_msg_->reserved[239]; + EXPECT_EQ(last_msg_->reserved[240], 217) + << "incorrect value for reserved[240], expected 217, is " + << last_msg_->reserved[240]; + EXPECT_EQ(last_msg_->reserved[241], 67) + << "incorrect value for reserved[241], expected 67, is " + << last_msg_->reserved[241]; + EXPECT_EQ(last_msg_->reserved[242], 239) + << "incorrect value for reserved[242], expected 239, is " + << last_msg_->reserved[242]; + EXPECT_EQ(last_msg_->reserved[243], 219) + << "incorrect value for reserved[243], expected 219, is " + << last_msg_->reserved[243]; + EXPECT_EQ(last_msg_->reserved[244], 31) + << "incorrect value for reserved[244], expected 31, is " + << last_msg_->reserved[244]; + EXPECT_EQ(last_msg_->reserved[245], 224) + << "incorrect value for reserved[245], expected 224, is " + << last_msg_->reserved[245]; + EXPECT_EQ(last_msg_->reserved[246], 176) + << "incorrect value for reserved[246], expected 176, is " + << last_msg_->reserved[246]; + EXPECT_EQ(last_msg_->reserved[247], 129) + << "incorrect value for reserved[247], expected 129, is " + << last_msg_->reserved[247]; + EXPECT_EQ(last_msg_->reserved[248], 81) + << "incorrect value for reserved[248], expected 81, is " + << last_msg_->reserved[248]; + EXPECT_EQ(last_msg_->reserved[249], 80) + << "incorrect value for reserved[249], expected 80, is " + << last_msg_->reserved[249]; + EXPECT_LT((last_msg_->signal_error_rate * 100 - 8588.20019531 * 100), 0.05) + << "incorrect value for signal_error_rate, expected 8588.20019531, is " + << last_msg_->signal_error_rate; + EXPECT_EQ(last_msg_->signal_strength, 103) + << "incorrect value for signal_strength, expected 103, is " + << last_msg_->signal_strength; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCommandOutput.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCommandOutput.cc index df46ab432..8f000c689 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCommandOutput.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCommandOutput.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandOutput.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandOutput.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgCommandOutput0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgCommandOutput0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgCommandOutput0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgCommandOutput0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_command_output_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_command_output_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,46 +81,57 @@ class Test_legacy_auto_check_sbp_piksi_MsgCommandOutput0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_command_output_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgCommandOutput0, Test) -{ +}; - uint8_t encoded_frame[] = {85,188,0,50,84,20,126,164,116,149,83,111,109,101,32,111,117,116,112,117,116,32,116,101,120,116,11,109, }; +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgCommandOutput0, Test) { + uint8_t encoded_frame[] = { + 85, 188, 0, 50, 84, 20, 126, 164, 116, 149, 83, 111, 109, 101, + 32, 111, 117, 116, 112, 117, 116, 32, 116, 101, 120, 116, 11, 109, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_command_output_t* test_msg = ( msg_command_output_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)83,(char)111,(char)109,(char)101,(char)32,(char)111,(char)117,(char)116,(char)112,(char)117,(char)116,(char)32,(char)116,(char)101,(char)120,(char)116 }; - memcpy(test_msg->line, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->line) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->sequence = 2507449470; - - EXPECT_EQ(send_message( 0xbc, 21554, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_command_output_t *test_msg = (msg_command_output_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = {(char)83, (char)111, (char)109, (char)101, + (char)32, (char)111, (char)117, (char)116, + (char)112, (char)117, (char)116, (char)32, + (char)116, (char)101, (char)120, (char)116}; + memcpy(test_msg->line, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->line) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->sequence = 2507449470; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 21554); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)83,(char)111,(char)109,(char)101,(char)32,(char)111,(char)117,(char)116,(char)112,(char)117,(char)116,(char)32,(char)116,(char)101,(char)120,(char)116 }; - EXPECT_EQ(memcmp(last_msg_->line, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->line, expected string '" << check_string << "', is '" << last_msg_->line << "'"; - } - EXPECT_EQ(last_msg_->sequence, 2507449470) << "incorrect value for sequence, expected 2507449470, is " << last_msg_->sequence; + EXPECT_EQ(send_message(0xbc, 21554, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 21554); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = {(char)83, (char)111, (char)109, (char)101, + (char)32, (char)111, (char)117, (char)116, + (char)112, (char)117, (char)116, (char)32, + (char)116, (char)101, (char)120, (char)116}; + EXPECT_EQ(memcmp(last_msg_->line, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->line, expected string '" + << check_string << "', is '" << last_msg_->line << "'"; + } + EXPECT_EQ(last_msg_->sequence, 2507449470) + << "incorrect value for sequence, expected 2507449470, is " + << last_msg_->sequence; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCommandReq.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCommandReq.cc index 888574599..dd35159f5 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCommandReq.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCommandReq.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandReq.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgCommandReq0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgCommandReq0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgCommandReq0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgCommandReq0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_command_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_command_req_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,46 +81,62 @@ class Test_legacy_auto_check_sbp_piksi_MsgCommandReq0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_command_req_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgCommandReq0, Test) -{ +}; - uint8_t encoded_frame[] = {85,184,0,170,184,31,51,77,163,104,47,112,97,116,104,47,116,111,47,99,111,109,109,97,110,100,32,119,105,116,104,32,97,114,103,115,0,38,24, }; +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgCommandReq0, Test) { + uint8_t encoded_frame[] = { + 85, 184, 0, 170, 184, 31, 51, 77, 163, 104, 47, 112, 97, + 116, 104, 47, 116, 111, 47, 99, 111, 109, 109, 97, 110, 100, + 32, 119, 105, 116, 104, 32, 97, 114, 103, 115, 0, 38, 24, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_command_req_t* test_msg = ( msg_command_req_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)99,(char)111,(char)109,(char)109,(char)97,(char)110,(char)100,(char)32,(char)119,(char)105,(char)116,(char)104,(char)32,(char)97,(char)114,(char)103,(char)115,(char)0 }; - memcpy(test_msg->command, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->command) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->sequence = 1755532595; - - EXPECT_EQ(send_message( 0xb8, 47274, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_command_req_t *test_msg = (msg_command_req_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)99, (char)111, (char)109, + (char)109, (char)97, (char)110, (char)100, (char)32, (char)119, + (char)105, (char)116, (char)104, (char)32, (char)97, (char)114, + (char)103, (char)115, (char)0}; + memcpy(test_msg->command, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->command) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->sequence = 1755532595; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 47274); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)47,(char)112,(char)97,(char)116,(char)104,(char)47,(char)116,(char)111,(char)47,(char)99,(char)111,(char)109,(char)109,(char)97,(char)110,(char)100,(char)32,(char)119,(char)105,(char)116,(char)104,(char)32,(char)97,(char)114,(char)103,(char)115,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->command, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->command, expected string '" << check_string << "', is '" << last_msg_->command << "'"; - } - EXPECT_EQ(last_msg_->sequence, 1755532595) << "incorrect value for sequence, expected 1755532595, is " << last_msg_->sequence; + EXPECT_EQ(send_message(0xb8, 47274, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 47274); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)47, (char)112, (char)97, (char)116, (char)104, (char)47, + (char)116, (char)111, (char)47, (char)99, (char)111, (char)109, + (char)109, (char)97, (char)110, (char)100, (char)32, (char)119, + (char)105, (char)116, (char)104, (char)32, (char)97, (char)114, + (char)103, (char)115, (char)0}; + EXPECT_EQ(memcmp(last_msg_->command, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->command, expected string '" + << check_string << "', is '" << last_msg_->command << "'"; + } + EXPECT_EQ(last_msg_->sequence, 1755532595) + << "incorrect value for sequence, expected 1755532595, is " + << last_msg_->sequence; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCommandResp.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCommandResp.cc index 9254a1af4..5c2226d9f 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCommandResp.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCommandResp.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCommandResp.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgCommandResp0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgCommandResp0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgCommandResp0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgCommandResp0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_command_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_command_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,37 +81,41 @@ class Test_legacy_auto_check_sbp_piksi_MsgCommandResp0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_command_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgCommandResp0, Test) -{ +}; - uint8_t encoded_frame[] = {85,185,0,57,206,8,118,215,131,160,210,110,150,103,164,240, }; +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgCommandResp0, Test) { + uint8_t encoded_frame[] = { + 85, 185, 0, 57, 206, 8, 118, 215, 131, 160, 210, 110, 150, 103, 164, 240, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_command_resp_t* test_msg = ( msg_command_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->code = 1737912018; - test_msg->sequence = 2692994934; - - EXPECT_EQ(send_message( 0xb9, 52793, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_command_resp_t *test_msg = (msg_command_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->code = 1737912018; + test_msg->sequence = 2692994934; + + EXPECT_EQ(send_message(0xb9, 52793, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 52793); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->code, 1737912018) << "incorrect value for code, expected 1737912018, is " << last_msg_->code; - EXPECT_EQ(last_msg_->sequence, 2692994934) << "incorrect value for sequence, expected 2692994934, is " << last_msg_->sequence; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 52793); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->code, 1737912018) + << "incorrect value for code, expected 1737912018, is " + << last_msg_->code; + EXPECT_EQ(last_msg_->sequence, 2692994934) + << "incorrect value for sequence, expected 2692994934, is " + << last_msg_->sequence; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCwResults.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCwResults.cc index 711589157..a46a8345d 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCwResults.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCwResults.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwResults.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwResults.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,6 +27,6 @@ #include #include +#include #include #include -#include diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCwStart.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCwStart.cc index 68e206c74..00c05558d 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCwStart.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgCwStart.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwStart.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgCwStart.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,6 +27,6 @@ #include #include +#include #include #include -#include diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgDeviceMonitor.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgDeviceMonitor.cc index 5788e25d6..c80276582 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgDeviceMonitor.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgDeviceMonitor.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgDeviceMonitor.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgDeviceMonitor.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_device_monitor_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_device_monitor_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,94 +81,99 @@ class Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_device_monitor_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor0, Test) -{ - - uint8_t encoded_frame[] = {85,181,0,95,66,10,241,216,219,3,253,6,21,24,168,18,207,233, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_device_monitor_t* test_msg = ( msg_device_monitor_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu_temperature = 6165; - test_msg->cpu_vaux = 1789; - test_msg->cpu_vint = 987; - test_msg->dev_vin = -9999; - test_msg->fe_temperature = 4776; - - EXPECT_EQ(send_message( 0xb5, 16991, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 16991); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu_temperature, 6165) << "incorrect value for cpu_temperature, expected 6165, is " << last_msg_->cpu_temperature; - EXPECT_EQ(last_msg_->cpu_vaux, 1789) << "incorrect value for cpu_vaux, expected 1789, is " << last_msg_->cpu_vaux; - EXPECT_EQ(last_msg_->cpu_vint, 987) << "incorrect value for cpu_vint, expected 987, is " << last_msg_->cpu_vint; - EXPECT_EQ(last_msg_->dev_vin, -9999) << "incorrect value for dev_vin, expected -9999, is " << last_msg_->dev_vin; - EXPECT_EQ(last_msg_->fe_temperature, 4776) << "incorrect value for fe_temperature, expected 4776, is " << last_msg_->fe_temperature; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor0, Test) { + uint8_t encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 219, + 3, 253, 6, 21, 24, 168, 18, 207, 233, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_device_monitor_t *test_msg = (msg_device_monitor_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu_temperature = 6165; + test_msg->cpu_vaux = 1789; + test_msg->cpu_vint = 987; + test_msg->dev_vin = -9999; + test_msg->fe_temperature = 4776; + + EXPECT_EQ(send_message(0xb5, 16991, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 16991); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu_temperature, 6165) + << "incorrect value for cpu_temperature, expected 6165, is " + << last_msg_->cpu_temperature; + EXPECT_EQ(last_msg_->cpu_vaux, 1789) + << "incorrect value for cpu_vaux, expected 1789, is " + << last_msg_->cpu_vaux; + EXPECT_EQ(last_msg_->cpu_vint, 987) + << "incorrect value for cpu_vint, expected 987, is " + << last_msg_->cpu_vint; + EXPECT_EQ(last_msg_->dev_vin, -9999) + << "incorrect value for dev_vin, expected -9999, is " + << last_msg_->dev_vin; + EXPECT_EQ(last_msg_->fe_temperature, 4776) + << "incorrect value for fe_temperature, expected 4776, is " + << last_msg_->fe_temperature; } -class Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_device_monitor_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_device_monitor_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -182,94 +183,99 @@ class Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_device_monitor_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor1, Test) -{ - - uint8_t encoded_frame[] = {85,181,0,95,66,10,241,216,219,3,254,6,24,24,168,18,169,30, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_device_monitor_t* test_msg = ( msg_device_monitor_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu_temperature = 6168; - test_msg->cpu_vaux = 1790; - test_msg->cpu_vint = 987; - test_msg->dev_vin = -9999; - test_msg->fe_temperature = 4776; - - EXPECT_EQ(send_message( 0xb5, 16991, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 16991); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu_temperature, 6168) << "incorrect value for cpu_temperature, expected 6168, is " << last_msg_->cpu_temperature; - EXPECT_EQ(last_msg_->cpu_vaux, 1790) << "incorrect value for cpu_vaux, expected 1790, is " << last_msg_->cpu_vaux; - EXPECT_EQ(last_msg_->cpu_vint, 987) << "incorrect value for cpu_vint, expected 987, is " << last_msg_->cpu_vint; - EXPECT_EQ(last_msg_->dev_vin, -9999) << "incorrect value for dev_vin, expected -9999, is " << last_msg_->dev_vin; - EXPECT_EQ(last_msg_->fe_temperature, 4776) << "incorrect value for fe_temperature, expected 4776, is " << last_msg_->fe_temperature; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor1, Test) { + uint8_t encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 219, + 3, 254, 6, 24, 24, 168, 18, 169, 30, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_device_monitor_t *test_msg = (msg_device_monitor_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu_temperature = 6168; + test_msg->cpu_vaux = 1790; + test_msg->cpu_vint = 987; + test_msg->dev_vin = -9999; + test_msg->fe_temperature = 4776; + + EXPECT_EQ(send_message(0xb5, 16991, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 16991); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu_temperature, 6168) + << "incorrect value for cpu_temperature, expected 6168, is " + << last_msg_->cpu_temperature; + EXPECT_EQ(last_msg_->cpu_vaux, 1790) + << "incorrect value for cpu_vaux, expected 1790, is " + << last_msg_->cpu_vaux; + EXPECT_EQ(last_msg_->cpu_vint, 987) + << "incorrect value for cpu_vint, expected 987, is " + << last_msg_->cpu_vint; + EXPECT_EQ(last_msg_->dev_vin, -9999) + << "incorrect value for dev_vin, expected -9999, is " + << last_msg_->dev_vin; + EXPECT_EQ(last_msg_->fe_temperature, 4776) + << "incorrect value for fe_temperature, expected 4776, is " + << last_msg_->fe_temperature; } -class Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_device_monitor_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_device_monitor_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -279,94 +285,99 @@ class Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_device_monitor_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor2, Test) -{ - - uint8_t encoded_frame[] = {85,181,0,95,66,10,241,216,219,3,253,6,22,24,168,18,19,114, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_device_monitor_t* test_msg = ( msg_device_monitor_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu_temperature = 6166; - test_msg->cpu_vaux = 1789; - test_msg->cpu_vint = 987; - test_msg->dev_vin = -9999; - test_msg->fe_temperature = 4776; - - EXPECT_EQ(send_message( 0xb5, 16991, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 16991); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu_temperature, 6166) << "incorrect value for cpu_temperature, expected 6166, is " << last_msg_->cpu_temperature; - EXPECT_EQ(last_msg_->cpu_vaux, 1789) << "incorrect value for cpu_vaux, expected 1789, is " << last_msg_->cpu_vaux; - EXPECT_EQ(last_msg_->cpu_vint, 987) << "incorrect value for cpu_vint, expected 987, is " << last_msg_->cpu_vint; - EXPECT_EQ(last_msg_->dev_vin, -9999) << "incorrect value for dev_vin, expected -9999, is " << last_msg_->dev_vin; - EXPECT_EQ(last_msg_->fe_temperature, 4776) << "incorrect value for fe_temperature, expected 4776, is " << last_msg_->fe_temperature; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor2, Test) { + uint8_t encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 219, + 3, 253, 6, 22, 24, 168, 18, 19, 114, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_device_monitor_t *test_msg = (msg_device_monitor_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu_temperature = 6166; + test_msg->cpu_vaux = 1789; + test_msg->cpu_vint = 987; + test_msg->dev_vin = -9999; + test_msg->fe_temperature = 4776; + + EXPECT_EQ(send_message(0xb5, 16991, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 16991); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu_temperature, 6166) + << "incorrect value for cpu_temperature, expected 6166, is " + << last_msg_->cpu_temperature; + EXPECT_EQ(last_msg_->cpu_vaux, 1789) + << "incorrect value for cpu_vaux, expected 1789, is " + << last_msg_->cpu_vaux; + EXPECT_EQ(last_msg_->cpu_vint, 987) + << "incorrect value for cpu_vint, expected 987, is " + << last_msg_->cpu_vint; + EXPECT_EQ(last_msg_->dev_vin, -9999) + << "incorrect value for dev_vin, expected -9999, is " + << last_msg_->dev_vin; + EXPECT_EQ(last_msg_->fe_temperature, 4776) + << "incorrect value for fe_temperature, expected 4776, is " + << last_msg_->fe_temperature; } -class Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_device_monitor_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_device_monitor_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -376,94 +387,99 @@ class Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_device_monitor_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor3, Test) -{ - - uint8_t encoded_frame[] = {85,181,0,95,66,10,241,216,218,3,252,6,6,24,168,18,199,107, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_device_monitor_t* test_msg = ( msg_device_monitor_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu_temperature = 6150; - test_msg->cpu_vaux = 1788; - test_msg->cpu_vint = 986; - test_msg->dev_vin = -9999; - test_msg->fe_temperature = 4776; - - EXPECT_EQ(send_message( 0xb5, 16991, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 16991); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu_temperature, 6150) << "incorrect value for cpu_temperature, expected 6150, is " << last_msg_->cpu_temperature; - EXPECT_EQ(last_msg_->cpu_vaux, 1788) << "incorrect value for cpu_vaux, expected 1788, is " << last_msg_->cpu_vaux; - EXPECT_EQ(last_msg_->cpu_vint, 986) << "incorrect value for cpu_vint, expected 986, is " << last_msg_->cpu_vint; - EXPECT_EQ(last_msg_->dev_vin, -9999) << "incorrect value for dev_vin, expected -9999, is " << last_msg_->dev_vin; - EXPECT_EQ(last_msg_->fe_temperature, 4776) << "incorrect value for fe_temperature, expected 4776, is " << last_msg_->fe_temperature; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor3, Test) { + uint8_t encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 218, + 3, 252, 6, 6, 24, 168, 18, 199, 107, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_device_monitor_t *test_msg = (msg_device_monitor_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu_temperature = 6150; + test_msg->cpu_vaux = 1788; + test_msg->cpu_vint = 986; + test_msg->dev_vin = -9999; + test_msg->fe_temperature = 4776; + + EXPECT_EQ(send_message(0xb5, 16991, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 16991); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu_temperature, 6150) + << "incorrect value for cpu_temperature, expected 6150, is " + << last_msg_->cpu_temperature; + EXPECT_EQ(last_msg_->cpu_vaux, 1788) + << "incorrect value for cpu_vaux, expected 1788, is " + << last_msg_->cpu_vaux; + EXPECT_EQ(last_msg_->cpu_vint, 986) + << "incorrect value for cpu_vint, expected 986, is " + << last_msg_->cpu_vint; + EXPECT_EQ(last_msg_->dev_vin, -9999) + << "incorrect value for dev_vin, expected -9999, is " + << last_msg_->dev_vin; + EXPECT_EQ(last_msg_->fe_temperature, 4776) + << "incorrect value for fe_temperature, expected 4776, is " + << last_msg_->fe_temperature; } -class Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_device_monitor_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_device_monitor_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -473,43 +489,54 @@ class Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_device_monitor_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor4, Test) -{ - - uint8_t encoded_frame[] = {85,181,0,95,66,10,241,216,220,3,253,6,235,23,168,18,241,63, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_device_monitor_t* test_msg = ( msg_device_monitor_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu_temperature = 6123; - test_msg->cpu_vaux = 1789; - test_msg->cpu_vint = 988; - test_msg->dev_vin = -9999; - test_msg->fe_temperature = 4776; - - EXPECT_EQ(send_message( 0xb5, 16991, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 16991); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu_temperature, 6123) << "incorrect value for cpu_temperature, expected 6123, is " << last_msg_->cpu_temperature; - EXPECT_EQ(last_msg_->cpu_vaux, 1789) << "incorrect value for cpu_vaux, expected 1789, is " << last_msg_->cpu_vaux; - EXPECT_EQ(last_msg_->cpu_vint, 988) << "incorrect value for cpu_vint, expected 988, is " << last_msg_->cpu_vint; - EXPECT_EQ(last_msg_->dev_vin, -9999) << "incorrect value for dev_vin, expected -9999, is " << last_msg_->dev_vin; - EXPECT_EQ(last_msg_->fe_temperature, 4776) << "incorrect value for fe_temperature, expected 4776, is " << last_msg_->fe_temperature; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgDeviceMonitor4, Test) { + uint8_t encoded_frame[] = { + 85, 181, 0, 95, 66, 10, 241, 216, 220, + 3, 253, 6, 235, 23, 168, 18, 241, 63, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_device_monitor_t *test_msg = (msg_device_monitor_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu_temperature = 6123; + test_msg->cpu_vaux = 1789; + test_msg->cpu_vint = 988; + test_msg->dev_vin = -9999; + test_msg->fe_temperature = 4776; + + EXPECT_EQ(send_message(0xb5, 16991, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 16991); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu_temperature, 6123) + << "incorrect value for cpu_temperature, expected 6123, is " + << last_msg_->cpu_temperature; + EXPECT_EQ(last_msg_->cpu_vaux, 1789) + << "incorrect value for cpu_vaux, expected 1789, is " + << last_msg_->cpu_vaux; + EXPECT_EQ(last_msg_->cpu_vint, 988) + << "incorrect value for cpu_vint, expected 988, is " + << last_msg_->cpu_vint; + EXPECT_EQ(last_msg_->dev_vin, -9999) + << "incorrect value for dev_vin, expected -9999, is " + << last_msg_->dev_vin; + EXPECT_EQ(last_msg_->fe_temperature, 4776) + << "incorrect value for fe_temperature, expected 4776, is " + << last_msg_->fe_temperature; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgFrontEndGain.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgFrontEndGain.cc index 72e7493fb..c3b6aab02 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgFrontEndGain.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgFrontEndGain.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgFrontEndGain.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgFrontEndGain.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgFrontEndGain0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgFrontEndGain0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgFrontEndGain0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgFrontEndGain0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_front_end_gain_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_front_end_gain_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,129 +81,162 @@ class Test_legacy_auto_check_sbp_piksi_MsgFrontEndGain0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_front_end_gain_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgFrontEndGain0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgFrontEndGain0, Test) { + uint8_t encoded_frame[] = { + 85, 191, 0, 175, 245, 16, 41, 133, 134, 10, 105, 20, + 38, 38, 246, 233, 216, 80, 187, 213, 85, 2, 235, 135, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_front_end_gain_t *test_msg = (msg_front_end_gain_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->if_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); + } + test_msg->if_gain[0] = -10; + if (sizeof(test_msg->if_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); + } + test_msg->if_gain[1] = -23; + if (sizeof(test_msg->if_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); + } + test_msg->if_gain[2] = -40; + if (sizeof(test_msg->if_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); + } + test_msg->if_gain[3] = 80; + if (sizeof(test_msg->if_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); + } + test_msg->if_gain[4] = -69; + if (sizeof(test_msg->if_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); + } + test_msg->if_gain[5] = -43; + if (sizeof(test_msg->if_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); + } + test_msg->if_gain[6] = 85; + if (sizeof(test_msg->if_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); + } + test_msg->if_gain[7] = 2; + if (sizeof(test_msg->rf_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); + } + test_msg->rf_gain[0] = 41; + if (sizeof(test_msg->rf_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); + } + test_msg->rf_gain[1] = -123; + if (sizeof(test_msg->rf_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); + } + test_msg->rf_gain[2] = -122; + if (sizeof(test_msg->rf_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); + } + test_msg->rf_gain[3] = 10; + if (sizeof(test_msg->rf_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); + } + test_msg->rf_gain[4] = 105; + if (sizeof(test_msg->rf_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); + } + test_msg->rf_gain[5] = 20; + if (sizeof(test_msg->rf_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); + } + test_msg->rf_gain[6] = 38; + if (sizeof(test_msg->rf_gain) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); + } + test_msg->rf_gain[7] = 38; + + EXPECT_EQ(send_message(0xbf, 62895, test_msg_len, test_msg_storage), SBP_OK); - uint8_t encoded_frame[] = {85,191,0,175,245,16,41,133,134,10,105,20,38,38,246,233,216,80,187,213,85,2,235,135, }; + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_front_end_gain_t* test_msg = ( msg_front_end_gain_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->if_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); - } - test_msg->if_gain[0] = -10; - if (sizeof(test_msg->if_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); - } - test_msg->if_gain[1] = -23; - if (sizeof(test_msg->if_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); - } - test_msg->if_gain[2] = -40; - if (sizeof(test_msg->if_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); - } - test_msg->if_gain[3] = 80; - if (sizeof(test_msg->if_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); - } - test_msg->if_gain[4] = -69; - if (sizeof(test_msg->if_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); - } - test_msg->if_gain[5] = -43; - if (sizeof(test_msg->if_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); - } - test_msg->if_gain[6] = 85; - if (sizeof(test_msg->if_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->if_gain[0])); - } - test_msg->if_gain[7] = 2; - if (sizeof(test_msg->rf_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); - } - test_msg->rf_gain[0] = 41; - if (sizeof(test_msg->rf_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); - } - test_msg->rf_gain[1] = -123; - if (sizeof(test_msg->rf_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); - } - test_msg->rf_gain[2] = -122; - if (sizeof(test_msg->rf_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); - } - test_msg->rf_gain[3] = 10; - if (sizeof(test_msg->rf_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); - } - test_msg->rf_gain[4] = 105; - if (sizeof(test_msg->rf_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); - } - test_msg->rf_gain[5] = 20; - if (sizeof(test_msg->rf_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); - } - test_msg->rf_gain[6] = 38; - if (sizeof(test_msg->rf_gain) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rf_gain[0])); - } - test_msg->rf_gain[7] = 38; - - EXPECT_EQ(send_message( 0xbf, 62895, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 62895); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->if_gain[0], -10) << "incorrect value for if_gain[0], expected -10, is " << last_msg_->if_gain[0]; - EXPECT_EQ(last_msg_->if_gain[1], -23) << "incorrect value for if_gain[1], expected -23, is " << last_msg_->if_gain[1]; - EXPECT_EQ(last_msg_->if_gain[2], -40) << "incorrect value for if_gain[2], expected -40, is " << last_msg_->if_gain[2]; - EXPECT_EQ(last_msg_->if_gain[3], 80) << "incorrect value for if_gain[3], expected 80, is " << last_msg_->if_gain[3]; - EXPECT_EQ(last_msg_->if_gain[4], -69) << "incorrect value for if_gain[4], expected -69, is " << last_msg_->if_gain[4]; - EXPECT_EQ(last_msg_->if_gain[5], -43) << "incorrect value for if_gain[5], expected -43, is " << last_msg_->if_gain[5]; - EXPECT_EQ(last_msg_->if_gain[6], 85) << "incorrect value for if_gain[6], expected 85, is " << last_msg_->if_gain[6]; - EXPECT_EQ(last_msg_->if_gain[7], 2) << "incorrect value for if_gain[7], expected 2, is " << last_msg_->if_gain[7]; - EXPECT_EQ(last_msg_->rf_gain[0], 41) << "incorrect value for rf_gain[0], expected 41, is " << last_msg_->rf_gain[0]; - EXPECT_EQ(last_msg_->rf_gain[1], -123) << "incorrect value for rf_gain[1], expected -123, is " << last_msg_->rf_gain[1]; - EXPECT_EQ(last_msg_->rf_gain[2], -122) << "incorrect value for rf_gain[2], expected -122, is " << last_msg_->rf_gain[2]; - EXPECT_EQ(last_msg_->rf_gain[3], 10) << "incorrect value for rf_gain[3], expected 10, is " << last_msg_->rf_gain[3]; - EXPECT_EQ(last_msg_->rf_gain[4], 105) << "incorrect value for rf_gain[4], expected 105, is " << last_msg_->rf_gain[4]; - EXPECT_EQ(last_msg_->rf_gain[5], 20) << "incorrect value for rf_gain[5], expected 20, is " << last_msg_->rf_gain[5]; - EXPECT_EQ(last_msg_->rf_gain[6], 38) << "incorrect value for rf_gain[6], expected 38, is " << last_msg_->rf_gain[6]; - EXPECT_EQ(last_msg_->rf_gain[7], 38) << "incorrect value for rf_gain[7], expected 38, is " << last_msg_->rf_gain[7]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 62895); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->if_gain[0], -10) + << "incorrect value for if_gain[0], expected -10, is " + << last_msg_->if_gain[0]; + EXPECT_EQ(last_msg_->if_gain[1], -23) + << "incorrect value for if_gain[1], expected -23, is " + << last_msg_->if_gain[1]; + EXPECT_EQ(last_msg_->if_gain[2], -40) + << "incorrect value for if_gain[2], expected -40, is " + << last_msg_->if_gain[2]; + EXPECT_EQ(last_msg_->if_gain[3], 80) + << "incorrect value for if_gain[3], expected 80, is " + << last_msg_->if_gain[3]; + EXPECT_EQ(last_msg_->if_gain[4], -69) + << "incorrect value for if_gain[4], expected -69, is " + << last_msg_->if_gain[4]; + EXPECT_EQ(last_msg_->if_gain[5], -43) + << "incorrect value for if_gain[5], expected -43, is " + << last_msg_->if_gain[5]; + EXPECT_EQ(last_msg_->if_gain[6], 85) + << "incorrect value for if_gain[6], expected 85, is " + << last_msg_->if_gain[6]; + EXPECT_EQ(last_msg_->if_gain[7], 2) + << "incorrect value for if_gain[7], expected 2, is " + << last_msg_->if_gain[7]; + EXPECT_EQ(last_msg_->rf_gain[0], 41) + << "incorrect value for rf_gain[0], expected 41, is " + << last_msg_->rf_gain[0]; + EXPECT_EQ(last_msg_->rf_gain[1], -123) + << "incorrect value for rf_gain[1], expected -123, is " + << last_msg_->rf_gain[1]; + EXPECT_EQ(last_msg_->rf_gain[2], -122) + << "incorrect value for rf_gain[2], expected -122, is " + << last_msg_->rf_gain[2]; + EXPECT_EQ(last_msg_->rf_gain[3], 10) + << "incorrect value for rf_gain[3], expected 10, is " + << last_msg_->rf_gain[3]; + EXPECT_EQ(last_msg_->rf_gain[4], 105) + << "incorrect value for rf_gain[4], expected 105, is " + << last_msg_->rf_gain[4]; + EXPECT_EQ(last_msg_->rf_gain[5], 20) + << "incorrect value for rf_gain[5], expected 20, is " + << last_msg_->rf_gain[5]; + EXPECT_EQ(last_msg_->rf_gain[6], 38) + << "incorrect value for rf_gain[6], expected 38, is " + << last_msg_->rf_gain[6]; + EXPECT_EQ(last_msg_->rf_gain[7], 38) + << "incorrect value for rf_gain[7], expected 38, is " + << last_msg_->rf_gain[7]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgIarState.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgIarState.cc index 6e4dd28c5..033154a4b 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgIarState.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgIarState.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgIarState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgIarState.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgIarState0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgIarState0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgIarState0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgIarState0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_iar_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_iar_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,86 +81,81 @@ class Test_legacy_auto_check_sbp_piksi_MsgIarState0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_iar_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgIarState0, Test) -{ - - uint8_t encoded_frame[] = {85,25,0,246,215,4,1,0,0,0,216,140, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_iar_state_t* test_msg = ( msg_iar_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->num_hyps = 1; - - EXPECT_EQ(send_message( 0x19, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->num_hyps, 1) << "incorrect value for num_hyps, expected 1, is " << last_msg_->num_hyps; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgIarState0, Test) { + uint8_t encoded_frame[] = { + 85, 25, 0, 246, 215, 4, 1, 0, 0, 0, 216, 140, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_iar_state_t *test_msg = (msg_iar_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->num_hyps = 1; + + EXPECT_EQ(send_message(0x19, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->num_hyps, 1) + << "incorrect value for num_hyps, expected 1, is " << last_msg_->num_hyps; } -class Test_legacy_auto_check_sbp_piksi_MsgIarState1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgIarState1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgIarState1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgIarState1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_iar_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_iar_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -174,86 +165,81 @@ class Test_legacy_auto_check_sbp_piksi_MsgIarState1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_iar_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgIarState1, Test) -{ - - uint8_t encoded_frame[] = {85,25,0,195,4,4,0,0,0,0,18,176, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_iar_state_t* test_msg = ( msg_iar_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->num_hyps = 0; - - EXPECT_EQ(send_message( 0x19, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->num_hyps, 0) << "incorrect value for num_hyps, expected 0, is " << last_msg_->num_hyps; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgIarState1, Test) { + uint8_t encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 0, 0, 0, 0, 18, 176, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_iar_state_t *test_msg = (msg_iar_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->num_hyps = 0; + + EXPECT_EQ(send_message(0x19, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->num_hyps, 0) + << "incorrect value for num_hyps, expected 0, is " << last_msg_->num_hyps; } -class Test_legacy_auto_check_sbp_piksi_MsgIarState2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgIarState2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgIarState2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgIarState2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_iar_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_iar_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -263,86 +249,81 @@ class Test_legacy_auto_check_sbp_piksi_MsgIarState2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_iar_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgIarState2, Test) -{ - - uint8_t encoded_frame[] = {85,25,0,195,4,4,1,0,0,0,166,198, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_iar_state_t* test_msg = ( msg_iar_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->num_hyps = 1; - - EXPECT_EQ(send_message( 0x19, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->num_hyps, 1) << "incorrect value for num_hyps, expected 1, is " << last_msg_->num_hyps; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgIarState2, Test) { + uint8_t encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 1, 0, 0, 0, 166, 198, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_iar_state_t *test_msg = (msg_iar_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->num_hyps = 1; + + EXPECT_EQ(send_message(0x19, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->num_hyps, 1) + << "incorrect value for num_hyps, expected 1, is " << last_msg_->num_hyps; } -class Test_legacy_auto_check_sbp_piksi_MsgIarState3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgIarState3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgIarState3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgIarState3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_iar_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_iar_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -352,86 +333,82 @@ class Test_legacy_auto_check_sbp_piksi_MsgIarState3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_iar_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgIarState3, Test) -{ - - uint8_t encoded_frame[] = {85,25,0,195,4,4,217,2,0,0,6,133, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_iar_state_t* test_msg = ( msg_iar_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->num_hyps = 729; - - EXPECT_EQ(send_message( 0x19, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->num_hyps, 729) << "incorrect value for num_hyps, expected 729, is " << last_msg_->num_hyps; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgIarState3, Test) { + uint8_t encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 217, 2, 0, 0, 6, 133, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_iar_state_t *test_msg = (msg_iar_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->num_hyps = 729; + + EXPECT_EQ(send_message(0x19, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->num_hyps, 729) + << "incorrect value for num_hyps, expected 729, is " + << last_msg_->num_hyps; } -class Test_legacy_auto_check_sbp_piksi_MsgIarState4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgIarState4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgIarState4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgIarState4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_iar_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_iar_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -441,86 +418,82 @@ class Test_legacy_auto_check_sbp_piksi_MsgIarState4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_iar_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgIarState4, Test) -{ - - uint8_t encoded_frame[] = {85,25,0,195,4,4,216,2,0,0,178,243, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_iar_state_t* test_msg = ( msg_iar_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->num_hyps = 728; - - EXPECT_EQ(send_message( 0x19, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->num_hyps, 728) << "incorrect value for num_hyps, expected 728, is " << last_msg_->num_hyps; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgIarState4, Test) { + uint8_t encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 216, 2, 0, 0, 178, 243, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_iar_state_t *test_msg = (msg_iar_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->num_hyps = 728; + + EXPECT_EQ(send_message(0x19, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->num_hyps, 728) + << "incorrect value for num_hyps, expected 728, is " + << last_msg_->num_hyps; } -class Test_legacy_auto_check_sbp_piksi_MsgIarState5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgIarState5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgIarState5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgIarState5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_iar_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_iar_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -530,86 +503,82 @@ class Test_legacy_auto_check_sbp_piksi_MsgIarState5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_iar_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgIarState5, Test) -{ - - uint8_t encoded_frame[] = {85,25,0,195,4,4,215,2,0,0,92,39, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_iar_state_t* test_msg = ( msg_iar_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->num_hyps = 727; - - EXPECT_EQ(send_message( 0x19, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->num_hyps, 727) << "incorrect value for num_hyps, expected 727, is " << last_msg_->num_hyps; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgIarState5, Test) { + uint8_t encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 215, 2, 0, 0, 92, 39, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_iar_state_t *test_msg = (msg_iar_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->num_hyps = 727; + + EXPECT_EQ(send_message(0x19, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->num_hyps, 727) + << "incorrect value for num_hyps, expected 727, is " + << last_msg_->num_hyps; } -class Test_legacy_auto_check_sbp_piksi_MsgIarState6 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgIarState6() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgIarState6 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgIarState6() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_iar_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_iar_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -619,35 +588,37 @@ class Test_legacy_auto_check_sbp_piksi_MsgIarState6 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_iar_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgIarState6, Test) -{ - - uint8_t encoded_frame[] = {85,25,0,195,4,4,211,2,0,0,173,237, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_iar_state_t* test_msg = ( msg_iar_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->num_hyps = 723; - - EXPECT_EQ(send_message( 0x19, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->num_hyps, 723) << "incorrect value for num_hyps, expected 723, is " << last_msg_->num_hyps; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgIarState6, Test) { + uint8_t encoded_frame[] = { + 85, 25, 0, 195, 4, 4, 211, 2, 0, 0, 173, 237, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_iar_state_t *test_msg = (msg_iar_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->num_hyps = 723; + + EXPECT_EQ(send_message(0x19, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->num_hyps, 723) + << "incorrect value for num_hyps, expected 723, is " + << last_msg_->num_hyps; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgInitBaseDep.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgInitBaseDep.cc index 99ef0f1ba..c9f39c357 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgInitBaseDep.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgInitBaseDep.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgInitBaseDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgInitBaseDep.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,6 +27,6 @@ #include #include +#include #include #include -#include diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgMaskSatellite.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgMaskSatellite.cc index 3fcd98354..a9bd86fb6 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgMaskSatellite.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgMaskSatellite.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatellite.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatellite.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgMaskSatellite0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgMaskSatellite0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgMaskSatellite0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgMaskSatellite0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_mask_satellite_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_mask_satellite_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,39 +81,43 @@ class Test_legacy_auto_check_sbp_piksi_MsgMaskSatellite0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_mask_satellite_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgMaskSatellite0, Test) -{ +}; - uint8_t encoded_frame[] = {85,43,0,173,151,3,183,87,57,19,147, }; +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgMaskSatellite0, Test) { + uint8_t encoded_frame[] = { + 85, 43, 0, 173, 151, 3, 183, 87, 57, 19, 147, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_mask_satellite_t* test_msg = ( msg_mask_satellite_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->mask = 183; - test_msg->sid.code = 57; - test_msg->sid.sat = 87; - - EXPECT_EQ(send_message( 0x2b, 38829, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_mask_satellite_t *test_msg = (msg_mask_satellite_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->mask = 183; + test_msg->sid.code = 57; + test_msg->sid.sat = 87; + + EXPECT_EQ(send_message(0x2b, 38829, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 38829); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->mask, 183) << "incorrect value for mask, expected 183, is " << last_msg_->mask; - EXPECT_EQ(last_msg_->sid.code, 57) << "incorrect value for sid.code, expected 57, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.sat, 87) << "incorrect value for sid.sat, expected 87, is " << last_msg_->sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 38829); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->mask, 183) + << "incorrect value for mask, expected 183, is " << last_msg_->mask; + EXPECT_EQ(last_msg_->sid.code, 57) + << "incorrect value for sid.code, expected 57, is " + << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.sat, 87) + << "incorrect value for sid.sat, expected 87, is " << last_msg_->sid.sat; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgMaskSatelliteDep.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgMaskSatelliteDep.cc index a5e8677c8..e3c11c785 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgMaskSatelliteDep.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgMaskSatelliteDep.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatelliteDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgMaskSatelliteDep.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_mask_satellite_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_mask_satellite_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,41 +82,49 @@ class Test_legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_mask_satellite_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep0, Test) -{ +}; - uint8_t encoded_frame[] = {85,27,0,187,134,5,33,2,153,95,4,29,188, }; +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgMaskSatelliteDep0, Test) { + uint8_t encoded_frame[] = { + 85, 27, 0, 187, 134, 5, 33, 2, 153, 95, 4, 29, 188, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_mask_satellite_dep_t* test_msg = ( msg_mask_satellite_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->mask = 33; - test_msg->sid.code = 95; - test_msg->sid.reserved = 4; - test_msg->sid.sat = 39170; - - EXPECT_EQ(send_message( 0x1b, 34491, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_mask_satellite_dep_t *test_msg = + (msg_mask_satellite_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->mask = 33; + test_msg->sid.code = 95; + test_msg->sid.reserved = 4; + test_msg->sid.sat = 39170; + + EXPECT_EQ(send_message(0x1b, 34491, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 34491); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->mask, 33) << "incorrect value for mask, expected 33, is " << last_msg_->mask; - EXPECT_EQ(last_msg_->sid.code, 95) << "incorrect value for sid.code, expected 95, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 4) << "incorrect value for sid.reserved, expected 4, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 39170) << "incorrect value for sid.sat, expected 39170, is " << last_msg_->sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 34491); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->mask, 33) + << "incorrect value for mask, expected 33, is " << last_msg_->mask; + EXPECT_EQ(last_msg_->sid.code, 95) + << "incorrect value for sid.code, expected 95, is " + << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 4) + << "incorrect value for sid.reserved, expected 4, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 39170) + << "incorrect value for sid.sat, expected 39170, is " + << last_msg_->sid.sat; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.cc index cdea6ba19..3063f808c 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgNetworkBandwidthUsage.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkBandwidthUsage.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkBandwidthUsage.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_network_bandwidth_usage_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_network_bandwidth_usage_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,148 +82,268 @@ class Test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_network_bandwidth_usage_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage0, Test) -{ +}; - uint8_t encoded_frame[] = {85,189,0,207,121,200,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,99,97,110,48,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,99,97,110,49,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,165,235,94,203,0,0,0,0,237,14,148,240,184,220,202,218,101,116,104,48,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,105,178,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,115,105,116,48,0,0,0,0,0,0,0,0,0,0,0,0,27,133, }; +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgNetworkBandwidthUsage0, Test) { + uint8_t encoded_frame[] = { + 85, 189, 0, 207, 121, 200, 94, 105, 178, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 110, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 94, 105, 178, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 97, 110, 49, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, 105, 178, 128, + 0, 0, 0, 0, 165, 235, 94, 203, 0, 0, 0, 0, 237, 14, 148, + 240, 184, 220, 202, 218, 101, 116, 104, 48, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 94, 105, 178, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 108, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 94, 105, 178, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, 105, 116, 48, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 133, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_network_bandwidth_usage_t* test_msg = ( msg_network_bandwidth_usage_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->interfaces) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->interfaces[0])); - } - test_msg->interfaces[0].duration = 2159176030; - { - const char assign_string[] = { (char)99,(char)97,(char)110,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->interfaces[0].interface_name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->interfaces[0].interface_name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->interfaces[0].rx_bytes = 0; - test_msg->interfaces[0].total_bytes = 0; - test_msg->interfaces[0].tx_bytes = 0; - if (sizeof(test_msg->interfaces) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->interfaces[0])); - } - test_msg->interfaces[1].duration = 2159176030; - { - const char assign_string[] = { (char)99,(char)97,(char)110,(char)49,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->interfaces[1].interface_name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->interfaces[1].interface_name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->interfaces[1].rx_bytes = 0; - test_msg->interfaces[1].total_bytes = 0; - test_msg->interfaces[1].tx_bytes = 0; - if (sizeof(test_msg->interfaces) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->interfaces[0])); - } - test_msg->interfaces[2].duration = 2159176030; - { - const char assign_string[] = { (char)101,(char)116,(char)104,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->interfaces[2].interface_name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->interfaces[2].interface_name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->interfaces[2].rx_bytes = 4036234989; - test_msg->interfaces[2].total_bytes = 3411995557; - test_msg->interfaces[2].tx_bytes = 3670727864; - if (sizeof(test_msg->interfaces) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->interfaces[0])); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_network_bandwidth_usage_t *test_msg = + (msg_network_bandwidth_usage_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->interfaces) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->interfaces[0])); + } + test_msg->interfaces[0].duration = 2159176030; + { + const char assign_string[] = {(char)99, (char)97, (char)110, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->interfaces[0].interface_name, assign_string, + sizeof(assign_string)); + if (sizeof(test_msg->interfaces[0].interface_name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } - test_msg->interfaces[3].duration = 2159176030; - { - const char assign_string[] = { (char)108,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->interfaces[3].interface_name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->interfaces[3].interface_name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } + } + test_msg->interfaces[0].rx_bytes = 0; + test_msg->interfaces[0].total_bytes = 0; + test_msg->interfaces[0].tx_bytes = 0; + if (sizeof(test_msg->interfaces) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->interfaces[0])); + } + test_msg->interfaces[1].duration = 2159176030; + { + const char assign_string[] = {(char)99, (char)97, (char)110, (char)49, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->interfaces[1].interface_name, assign_string, + sizeof(assign_string)); + if (sizeof(test_msg->interfaces[1].interface_name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } - test_msg->interfaces[3].rx_bytes = 0; - test_msg->interfaces[3].total_bytes = 0; - test_msg->interfaces[3].tx_bytes = 0; - if (sizeof(test_msg->interfaces) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->interfaces[0])); + } + test_msg->interfaces[1].rx_bytes = 0; + test_msg->interfaces[1].total_bytes = 0; + test_msg->interfaces[1].tx_bytes = 0; + if (sizeof(test_msg->interfaces) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->interfaces[0])); + } + test_msg->interfaces[2].duration = 2159176030; + { + const char assign_string[] = {(char)101, (char)116, (char)104, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->interfaces[2].interface_name, assign_string, + sizeof(assign_string)); + if (sizeof(test_msg->interfaces[2].interface_name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } - test_msg->interfaces[4].duration = 2159176030; - { - const char assign_string[] = { (char)115,(char)105,(char)116,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->interfaces[4].interface_name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->interfaces[4].interface_name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } + } + test_msg->interfaces[2].rx_bytes = 4036234989; + test_msg->interfaces[2].total_bytes = 3411995557; + test_msg->interfaces[2].tx_bytes = 3670727864; + if (sizeof(test_msg->interfaces) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->interfaces[0])); + } + test_msg->interfaces[3].duration = 2159176030; + { + const char assign_string[] = {(char)108, (char)111, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->interfaces[3].interface_name, assign_string, + sizeof(assign_string)); + if (sizeof(test_msg->interfaces[3].interface_name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } - test_msg->interfaces[4].rx_bytes = 0; - test_msg->interfaces[4].total_bytes = 0; - test_msg->interfaces[4].tx_bytes = 0; - - EXPECT_EQ(send_message( 0xBD, 31183, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + } + test_msg->interfaces[3].rx_bytes = 0; + test_msg->interfaces[3].total_bytes = 0; + test_msg->interfaces[3].tx_bytes = 0; + if (sizeof(test_msg->interfaces) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->interfaces[0])); + } + test_msg->interfaces[4].duration = 2159176030; + { + const char assign_string[] = {(char)115, (char)105, (char)116, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->interfaces[4].interface_name, assign_string, + sizeof(assign_string)); + if (sizeof(test_msg->interfaces[4].interface_name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->interfaces[4].rx_bytes = 0; + test_msg->interfaces[4].total_bytes = 0; + test_msg->interfaces[4].tx_bytes = 0; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 31183); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->interfaces[0].duration, 2159176030) << "incorrect value for interfaces[0].duration, expected 2159176030, is " << last_msg_->interfaces[0].duration; - { - const char check_string[] = { (char)99,(char)97,(char)110,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->interfaces[0].interface_name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->interfaces[0].interface_name, expected string '" << check_string << "', is '" << last_msg_->interfaces[0].interface_name << "'"; - } - EXPECT_EQ(last_msg_->interfaces[0].rx_bytes, 0) << "incorrect value for interfaces[0].rx_bytes, expected 0, is " << last_msg_->interfaces[0].rx_bytes; - EXPECT_EQ(last_msg_->interfaces[0].total_bytes, 0) << "incorrect value for interfaces[0].total_bytes, expected 0, is " << last_msg_->interfaces[0].total_bytes; - EXPECT_EQ(last_msg_->interfaces[0].tx_bytes, 0) << "incorrect value for interfaces[0].tx_bytes, expected 0, is " << last_msg_->interfaces[0].tx_bytes; - EXPECT_EQ(last_msg_->interfaces[1].duration, 2159176030) << "incorrect value for interfaces[1].duration, expected 2159176030, is " << last_msg_->interfaces[1].duration; - { - const char check_string[] = { (char)99,(char)97,(char)110,(char)49,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->interfaces[1].interface_name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->interfaces[1].interface_name, expected string '" << check_string << "', is '" << last_msg_->interfaces[1].interface_name << "'"; - } - EXPECT_EQ(last_msg_->interfaces[1].rx_bytes, 0) << "incorrect value for interfaces[1].rx_bytes, expected 0, is " << last_msg_->interfaces[1].rx_bytes; - EXPECT_EQ(last_msg_->interfaces[1].total_bytes, 0) << "incorrect value for interfaces[1].total_bytes, expected 0, is " << last_msg_->interfaces[1].total_bytes; - EXPECT_EQ(last_msg_->interfaces[1].tx_bytes, 0) << "incorrect value for interfaces[1].tx_bytes, expected 0, is " << last_msg_->interfaces[1].tx_bytes; - EXPECT_EQ(last_msg_->interfaces[2].duration, 2159176030) << "incorrect value for interfaces[2].duration, expected 2159176030, is " << last_msg_->interfaces[2].duration; - { - const char check_string[] = { (char)101,(char)116,(char)104,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->interfaces[2].interface_name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->interfaces[2].interface_name, expected string '" << check_string << "', is '" << last_msg_->interfaces[2].interface_name << "'"; - } - EXPECT_EQ(last_msg_->interfaces[2].rx_bytes, 4036234989) << "incorrect value for interfaces[2].rx_bytes, expected 4036234989, is " << last_msg_->interfaces[2].rx_bytes; - EXPECT_EQ(last_msg_->interfaces[2].total_bytes, 3411995557) << "incorrect value for interfaces[2].total_bytes, expected 3411995557, is " << last_msg_->interfaces[2].total_bytes; - EXPECT_EQ(last_msg_->interfaces[2].tx_bytes, 3670727864) << "incorrect value for interfaces[2].tx_bytes, expected 3670727864, is " << last_msg_->interfaces[2].tx_bytes; - EXPECT_EQ(last_msg_->interfaces[3].duration, 2159176030) << "incorrect value for interfaces[3].duration, expected 2159176030, is " << last_msg_->interfaces[3].duration; - { - const char check_string[] = { (char)108,(char)111,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->interfaces[3].interface_name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->interfaces[3].interface_name, expected string '" << check_string << "', is '" << last_msg_->interfaces[3].interface_name << "'"; - } - EXPECT_EQ(last_msg_->interfaces[3].rx_bytes, 0) << "incorrect value for interfaces[3].rx_bytes, expected 0, is " << last_msg_->interfaces[3].rx_bytes; - EXPECT_EQ(last_msg_->interfaces[3].total_bytes, 0) << "incorrect value for interfaces[3].total_bytes, expected 0, is " << last_msg_->interfaces[3].total_bytes; - EXPECT_EQ(last_msg_->interfaces[3].tx_bytes, 0) << "incorrect value for interfaces[3].tx_bytes, expected 0, is " << last_msg_->interfaces[3].tx_bytes; - EXPECT_EQ(last_msg_->interfaces[4].duration, 2159176030) << "incorrect value for interfaces[4].duration, expected 2159176030, is " << last_msg_->interfaces[4].duration; - { - const char check_string[] = { (char)115,(char)105,(char)116,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->interfaces[4].interface_name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->interfaces[4].interface_name, expected string '" << check_string << "', is '" << last_msg_->interfaces[4].interface_name << "'"; - } - EXPECT_EQ(last_msg_->interfaces[4].rx_bytes, 0) << "incorrect value for interfaces[4].rx_bytes, expected 0, is " << last_msg_->interfaces[4].rx_bytes; - EXPECT_EQ(last_msg_->interfaces[4].total_bytes, 0) << "incorrect value for interfaces[4].total_bytes, expected 0, is " << last_msg_->interfaces[4].total_bytes; - EXPECT_EQ(last_msg_->interfaces[4].tx_bytes, 0) << "incorrect value for interfaces[4].tx_bytes, expected 0, is " << last_msg_->interfaces[4].tx_bytes; + EXPECT_EQ(send_message(0xBD, 31183, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 31183); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->interfaces[0].duration, 2159176030) + << "incorrect value for interfaces[0].duration, expected 2159176030, is " + << last_msg_->interfaces[0].duration; + { + const char check_string[] = {(char)99, (char)97, (char)110, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->interfaces[0].interface_name, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_->interfaces[0].interface_name, " + "expected string '" + << check_string << "', is '" << last_msg_->interfaces[0].interface_name + << "'"; + } + EXPECT_EQ(last_msg_->interfaces[0].rx_bytes, 0) + << "incorrect value for interfaces[0].rx_bytes, expected 0, is " + << last_msg_->interfaces[0].rx_bytes; + EXPECT_EQ(last_msg_->interfaces[0].total_bytes, 0) + << "incorrect value for interfaces[0].total_bytes, expected 0, is " + << last_msg_->interfaces[0].total_bytes; + EXPECT_EQ(last_msg_->interfaces[0].tx_bytes, 0) + << "incorrect value for interfaces[0].tx_bytes, expected 0, is " + << last_msg_->interfaces[0].tx_bytes; + EXPECT_EQ(last_msg_->interfaces[1].duration, 2159176030) + << "incorrect value for interfaces[1].duration, expected 2159176030, is " + << last_msg_->interfaces[1].duration; + { + const char check_string[] = {(char)99, (char)97, (char)110, (char)49, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->interfaces[1].interface_name, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_->interfaces[1].interface_name, " + "expected string '" + << check_string << "', is '" << last_msg_->interfaces[1].interface_name + << "'"; + } + EXPECT_EQ(last_msg_->interfaces[1].rx_bytes, 0) + << "incorrect value for interfaces[1].rx_bytes, expected 0, is " + << last_msg_->interfaces[1].rx_bytes; + EXPECT_EQ(last_msg_->interfaces[1].total_bytes, 0) + << "incorrect value for interfaces[1].total_bytes, expected 0, is " + << last_msg_->interfaces[1].total_bytes; + EXPECT_EQ(last_msg_->interfaces[1].tx_bytes, 0) + << "incorrect value for interfaces[1].tx_bytes, expected 0, is " + << last_msg_->interfaces[1].tx_bytes; + EXPECT_EQ(last_msg_->interfaces[2].duration, 2159176030) + << "incorrect value for interfaces[2].duration, expected 2159176030, is " + << last_msg_->interfaces[2].duration; + { + const char check_string[] = {(char)101, (char)116, (char)104, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->interfaces[2].interface_name, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_->interfaces[2].interface_name, " + "expected string '" + << check_string << "', is '" << last_msg_->interfaces[2].interface_name + << "'"; + } + EXPECT_EQ(last_msg_->interfaces[2].rx_bytes, 4036234989) + << "incorrect value for interfaces[2].rx_bytes, expected 4036234989, is " + << last_msg_->interfaces[2].rx_bytes; + EXPECT_EQ(last_msg_->interfaces[2].total_bytes, 3411995557) + << "incorrect value for interfaces[2].total_bytes, expected 3411995557, " + "is " + << last_msg_->interfaces[2].total_bytes; + EXPECT_EQ(last_msg_->interfaces[2].tx_bytes, 3670727864) + << "incorrect value for interfaces[2].tx_bytes, expected 3670727864, is " + << last_msg_->interfaces[2].tx_bytes; + EXPECT_EQ(last_msg_->interfaces[3].duration, 2159176030) + << "incorrect value for interfaces[3].duration, expected 2159176030, is " + << last_msg_->interfaces[3].duration; + { + const char check_string[] = {(char)108, (char)111, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->interfaces[3].interface_name, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_->interfaces[3].interface_name, " + "expected string '" + << check_string << "', is '" << last_msg_->interfaces[3].interface_name + << "'"; + } + EXPECT_EQ(last_msg_->interfaces[3].rx_bytes, 0) + << "incorrect value for interfaces[3].rx_bytes, expected 0, is " + << last_msg_->interfaces[3].rx_bytes; + EXPECT_EQ(last_msg_->interfaces[3].total_bytes, 0) + << "incorrect value for interfaces[3].total_bytes, expected 0, is " + << last_msg_->interfaces[3].total_bytes; + EXPECT_EQ(last_msg_->interfaces[3].tx_bytes, 0) + << "incorrect value for interfaces[3].tx_bytes, expected 0, is " + << last_msg_->interfaces[3].tx_bytes; + EXPECT_EQ(last_msg_->interfaces[4].duration, 2159176030) + << "incorrect value for interfaces[4].duration, expected 2159176030, is " + << last_msg_->interfaces[4].duration; + { + const char check_string[] = {(char)115, (char)105, (char)116, (char)48, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->interfaces[4].interface_name, check_string, + sizeof(check_string)), + 0) + << "incorrect value for last_msg_->interfaces[4].interface_name, " + "expected string '" + << check_string << "', is '" << last_msg_->interfaces[4].interface_name + << "'"; + } + EXPECT_EQ(last_msg_->interfaces[4].rx_bytes, 0) + << "incorrect value for interfaces[4].rx_bytes, expected 0, is " + << last_msg_->interfaces[4].rx_bytes; + EXPECT_EQ(last_msg_->interfaces[4].total_bytes, 0) + << "incorrect value for interfaces[4].total_bytes, expected 0, is " + << last_msg_->interfaces[4].total_bytes; + EXPECT_EQ(last_msg_->interfaces[4].tx_bytes, 0) + << "incorrect value for interfaces[4].tx_bytes, expected 0, is " + << last_msg_->interfaces[4].tx_bytes; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgNetworkStateReq.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgNetworkStateReq.cc index 72713658f..186fe3eb0 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgNetworkStateReq.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgNetworkStateReq.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,6 +27,6 @@ #include #include +#include #include #include -#include diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgNetworkStateResp.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgNetworkStateResp.cc index 9f9293742..534598262 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgNetworkStateResp.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgNetworkStateResp.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgNetworkStateResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgNetworkStateResp0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgNetworkStateResp0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgNetworkStateResp0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgNetworkStateResp0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_network_state_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_network_state_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,174 +82,238 @@ class Test_legacy_auto_check_sbp_piksi_MsgNetworkStateResp0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_network_state_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgNetworkStateResp0, Test) -{ +}; - uint8_t encoded_frame[] = {85,187,0,40,15,50,143,241,84,180,152,194,137,32,44,114,147,68,222,92,192,78,235,63,208,114,53,183,24,244,231,26,105,25,136,3,105,102,48,0,0,0,0,0,0,0,0,0,0,0,0,0,195,229,80,147,118,193, }; +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgNetworkStateResp0, Test) { + uint8_t encoded_frame[] = { + 85, 187, 0, 40, 15, 50, 143, 241, 84, 180, 152, 194, 137, 32, 44, + 114, 147, 68, 222, 92, 192, 78, 235, 63, 208, 114, 53, 183, 24, 244, + 231, 26, 105, 25, 136, 3, 105, 102, 48, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 195, 229, 80, 147, 118, 193, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_network_state_resp_t* test_msg = ( msg_network_state_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 2471552451; - { - const char assign_string[] = { (char)105,(char)102,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->interface_name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->interface_name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - if (sizeof(test_msg->ipv4_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv4_address[0])); - } - test_msg->ipv4_address[0] = 143; - if (sizeof(test_msg->ipv4_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv4_address[0])); - } - test_msg->ipv4_address[1] = 241; - if (sizeof(test_msg->ipv4_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv4_address[0])); - } - test_msg->ipv4_address[2] = 84; - if (sizeof(test_msg->ipv4_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv4_address[0])); - } - test_msg->ipv4_address[3] = 180; - test_msg->ipv4_mask_size = 152; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[0] = 194; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[1] = 137; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[2] = 32; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[3] = 44; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[4] = 114; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[5] = 147; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[6] = 68; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[7] = 222; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[8] = 92; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[9] = 192; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[10] = 78; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[11] = 235; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[12] = 63; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[13] = 208; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[14] = 114; - if (sizeof(test_msg->ipv6_address) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); - } - test_msg->ipv6_address[15] = 53; - test_msg->ipv6_mask_size = 183; - test_msg->rx_bytes = 451408920; - test_msg->tx_bytes = 59251049; - - EXPECT_EQ(send_message( 0xbb, 3880, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_network_state_resp_t *test_msg = + (msg_network_state_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 2471552451; + { + const char assign_string[] = {(char)105, (char)102, (char)48, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->interface_name, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->interface_name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + if (sizeof(test_msg->ipv4_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv4_address[0])); + } + test_msg->ipv4_address[0] = 143; + if (sizeof(test_msg->ipv4_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv4_address[0])); + } + test_msg->ipv4_address[1] = 241; + if (sizeof(test_msg->ipv4_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv4_address[0])); + } + test_msg->ipv4_address[2] = 84; + if (sizeof(test_msg->ipv4_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv4_address[0])); + } + test_msg->ipv4_address[3] = 180; + test_msg->ipv4_mask_size = 152; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[0] = 194; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[1] = 137; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[2] = 32; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[3] = 44; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[4] = 114; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[5] = 147; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[6] = 68; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[7] = 222; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[8] = 92; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[9] = 192; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[10] = 78; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[11] = 235; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[12] = 63; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[13] = 208; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[14] = 114; + if (sizeof(test_msg->ipv6_address) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->ipv6_address[0])); + } + test_msg->ipv6_address[15] = 53; + test_msg->ipv6_mask_size = 183; + test_msg->rx_bytes = 451408920; + test_msg->tx_bytes = 59251049; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 3880); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 2471552451) << "incorrect value for flags, expected 2471552451, is " << last_msg_->flags; - { - const char check_string[] = { (char)105,(char)102,(char)48,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->interface_name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->interface_name, expected string '" << check_string << "', is '" << last_msg_->interface_name << "'"; - } - EXPECT_EQ(last_msg_->ipv4_address[0], 143) << "incorrect value for ipv4_address[0], expected 143, is " << last_msg_->ipv4_address[0]; - EXPECT_EQ(last_msg_->ipv4_address[1], 241) << "incorrect value for ipv4_address[1], expected 241, is " << last_msg_->ipv4_address[1]; - EXPECT_EQ(last_msg_->ipv4_address[2], 84) << "incorrect value for ipv4_address[2], expected 84, is " << last_msg_->ipv4_address[2]; - EXPECT_EQ(last_msg_->ipv4_address[3], 180) << "incorrect value for ipv4_address[3], expected 180, is " << last_msg_->ipv4_address[3]; - EXPECT_EQ(last_msg_->ipv4_mask_size, 152) << "incorrect value for ipv4_mask_size, expected 152, is " << last_msg_->ipv4_mask_size; - EXPECT_EQ(last_msg_->ipv6_address[0], 194) << "incorrect value for ipv6_address[0], expected 194, is " << last_msg_->ipv6_address[0]; - EXPECT_EQ(last_msg_->ipv6_address[1], 137) << "incorrect value for ipv6_address[1], expected 137, is " << last_msg_->ipv6_address[1]; - EXPECT_EQ(last_msg_->ipv6_address[2], 32) << "incorrect value for ipv6_address[2], expected 32, is " << last_msg_->ipv6_address[2]; - EXPECT_EQ(last_msg_->ipv6_address[3], 44) << "incorrect value for ipv6_address[3], expected 44, is " << last_msg_->ipv6_address[3]; - EXPECT_EQ(last_msg_->ipv6_address[4], 114) << "incorrect value for ipv6_address[4], expected 114, is " << last_msg_->ipv6_address[4]; - EXPECT_EQ(last_msg_->ipv6_address[5], 147) << "incorrect value for ipv6_address[5], expected 147, is " << last_msg_->ipv6_address[5]; - EXPECT_EQ(last_msg_->ipv6_address[6], 68) << "incorrect value for ipv6_address[6], expected 68, is " << last_msg_->ipv6_address[6]; - EXPECT_EQ(last_msg_->ipv6_address[7], 222) << "incorrect value for ipv6_address[7], expected 222, is " << last_msg_->ipv6_address[7]; - EXPECT_EQ(last_msg_->ipv6_address[8], 92) << "incorrect value for ipv6_address[8], expected 92, is " << last_msg_->ipv6_address[8]; - EXPECT_EQ(last_msg_->ipv6_address[9], 192) << "incorrect value for ipv6_address[9], expected 192, is " << last_msg_->ipv6_address[9]; - EXPECT_EQ(last_msg_->ipv6_address[10], 78) << "incorrect value for ipv6_address[10], expected 78, is " << last_msg_->ipv6_address[10]; - EXPECT_EQ(last_msg_->ipv6_address[11], 235) << "incorrect value for ipv6_address[11], expected 235, is " << last_msg_->ipv6_address[11]; - EXPECT_EQ(last_msg_->ipv6_address[12], 63) << "incorrect value for ipv6_address[12], expected 63, is " << last_msg_->ipv6_address[12]; - EXPECT_EQ(last_msg_->ipv6_address[13], 208) << "incorrect value for ipv6_address[13], expected 208, is " << last_msg_->ipv6_address[13]; - EXPECT_EQ(last_msg_->ipv6_address[14], 114) << "incorrect value for ipv6_address[14], expected 114, is " << last_msg_->ipv6_address[14]; - EXPECT_EQ(last_msg_->ipv6_address[15], 53) << "incorrect value for ipv6_address[15], expected 53, is " << last_msg_->ipv6_address[15]; - EXPECT_EQ(last_msg_->ipv6_mask_size, 183) << "incorrect value for ipv6_mask_size, expected 183, is " << last_msg_->ipv6_mask_size; - EXPECT_EQ(last_msg_->rx_bytes, 451408920) << "incorrect value for rx_bytes, expected 451408920, is " << last_msg_->rx_bytes; - EXPECT_EQ(last_msg_->tx_bytes, 59251049) << "incorrect value for tx_bytes, expected 59251049, is " << last_msg_->tx_bytes; + EXPECT_EQ(send_message(0xbb, 3880, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 3880); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 2471552451) + << "incorrect value for flags, expected 2471552451, is " + << last_msg_->flags; + { + const char check_string[] = {(char)105, (char)102, (char)48, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ( + memcmp(last_msg_->interface_name, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_->interface_name, expected string '" + << check_string << "', is '" << last_msg_->interface_name << "'"; + } + EXPECT_EQ(last_msg_->ipv4_address[0], 143) + << "incorrect value for ipv4_address[0], expected 143, is " + << last_msg_->ipv4_address[0]; + EXPECT_EQ(last_msg_->ipv4_address[1], 241) + << "incorrect value for ipv4_address[1], expected 241, is " + << last_msg_->ipv4_address[1]; + EXPECT_EQ(last_msg_->ipv4_address[2], 84) + << "incorrect value for ipv4_address[2], expected 84, is " + << last_msg_->ipv4_address[2]; + EXPECT_EQ(last_msg_->ipv4_address[3], 180) + << "incorrect value for ipv4_address[3], expected 180, is " + << last_msg_->ipv4_address[3]; + EXPECT_EQ(last_msg_->ipv4_mask_size, 152) + << "incorrect value for ipv4_mask_size, expected 152, is " + << last_msg_->ipv4_mask_size; + EXPECT_EQ(last_msg_->ipv6_address[0], 194) + << "incorrect value for ipv6_address[0], expected 194, is " + << last_msg_->ipv6_address[0]; + EXPECT_EQ(last_msg_->ipv6_address[1], 137) + << "incorrect value for ipv6_address[1], expected 137, is " + << last_msg_->ipv6_address[1]; + EXPECT_EQ(last_msg_->ipv6_address[2], 32) + << "incorrect value for ipv6_address[2], expected 32, is " + << last_msg_->ipv6_address[2]; + EXPECT_EQ(last_msg_->ipv6_address[3], 44) + << "incorrect value for ipv6_address[3], expected 44, is " + << last_msg_->ipv6_address[3]; + EXPECT_EQ(last_msg_->ipv6_address[4], 114) + << "incorrect value for ipv6_address[4], expected 114, is " + << last_msg_->ipv6_address[4]; + EXPECT_EQ(last_msg_->ipv6_address[5], 147) + << "incorrect value for ipv6_address[5], expected 147, is " + << last_msg_->ipv6_address[5]; + EXPECT_EQ(last_msg_->ipv6_address[6], 68) + << "incorrect value for ipv6_address[6], expected 68, is " + << last_msg_->ipv6_address[6]; + EXPECT_EQ(last_msg_->ipv6_address[7], 222) + << "incorrect value for ipv6_address[7], expected 222, is " + << last_msg_->ipv6_address[7]; + EXPECT_EQ(last_msg_->ipv6_address[8], 92) + << "incorrect value for ipv6_address[8], expected 92, is " + << last_msg_->ipv6_address[8]; + EXPECT_EQ(last_msg_->ipv6_address[9], 192) + << "incorrect value for ipv6_address[9], expected 192, is " + << last_msg_->ipv6_address[9]; + EXPECT_EQ(last_msg_->ipv6_address[10], 78) + << "incorrect value for ipv6_address[10], expected 78, is " + << last_msg_->ipv6_address[10]; + EXPECT_EQ(last_msg_->ipv6_address[11], 235) + << "incorrect value for ipv6_address[11], expected 235, is " + << last_msg_->ipv6_address[11]; + EXPECT_EQ(last_msg_->ipv6_address[12], 63) + << "incorrect value for ipv6_address[12], expected 63, is " + << last_msg_->ipv6_address[12]; + EXPECT_EQ(last_msg_->ipv6_address[13], 208) + << "incorrect value for ipv6_address[13], expected 208, is " + << last_msg_->ipv6_address[13]; + EXPECT_EQ(last_msg_->ipv6_address[14], 114) + << "incorrect value for ipv6_address[14], expected 114, is " + << last_msg_->ipv6_address[14]; + EXPECT_EQ(last_msg_->ipv6_address[15], 53) + << "incorrect value for ipv6_address[15], expected 53, is " + << last_msg_->ipv6_address[15]; + EXPECT_EQ(last_msg_->ipv6_mask_size, 183) + << "incorrect value for ipv6_mask_size, expected 183, is " + << last_msg_->ipv6_mask_size; + EXPECT_EQ(last_msg_->rx_bytes, 451408920) + << "incorrect value for rx_bytes, expected 451408920, is " + << last_msg_->rx_bytes; + EXPECT_EQ(last_msg_->tx_bytes, 59251049) + << "incorrect value for tx_bytes, expected 59251049, is " + << last_msg_->tx_bytes; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgReset.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgReset.cc index bd1c56ab8..4249c0c81 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgReset.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgReset.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgReset.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgReset.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgReset0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgReset0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgReset0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgReset0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_reset_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_reset_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,35 +81,37 @@ class Test_legacy_auto_check_sbp_piksi_MsgReset0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_reset_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgReset0, Test) -{ +}; - uint8_t encoded_frame[] = {85,182,0,63,210,4,88,248,238,19,74,207, }; +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgReset0, Test) { + uint8_t encoded_frame[] = { + 85, 182, 0, 63, 210, 4, 88, 248, 238, 19, 74, 207, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_reset_t* test_msg = ( msg_reset_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 334428248; - - EXPECT_EQ(send_message( 0xb6, 53823, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_reset_t *test_msg = (msg_reset_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 334428248; + + EXPECT_EQ(send_message(0xb6, 53823, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 53823); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 334428248) << "incorrect value for flags, expected 334428248, is " << last_msg_->flags; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 53823); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 334428248) + << "incorrect value for flags, expected 334428248, is " + << last_msg_->flags; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgResetDep.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgResetDep.cc index eeb2f7356..5508bb28d 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgResetDep.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgResetDep.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetDep.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,6 +27,6 @@ #include #include +#include #include #include -#include diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgResetFilters.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgResetFilters.cc index de088885b..8b90763c9 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgResetFilters.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgResetFilters.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetFilters.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgResetFilters.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgResetFilters0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgResetFilters0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgResetFilters0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgResetFilters0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_reset_filters_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_reset_filters_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,35 +81,36 @@ class Test_legacy_auto_check_sbp_piksi_MsgResetFilters0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_reset_filters_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgResetFilters0, Test) -{ +}; - uint8_t encoded_frame[] = {85,34,0,81,200,1,100,130,45, }; +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgResetFilters0, Test) { + uint8_t encoded_frame[] = { + 85, 34, 0, 81, 200, 1, 100, 130, 45, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_reset_filters_t* test_msg = ( msg_reset_filters_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->filter = 100; - - EXPECT_EQ(send_message( 0x22, 51281, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_reset_filters_t *test_msg = (msg_reset_filters_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->filter = 100; + + EXPECT_EQ(send_message(0x22, 51281, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 51281); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->filter, 100) << "incorrect value for filter, expected 100, is " << last_msg_->filter; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 51281); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->filter, 100) + << "incorrect value for filter, expected 100, is " << last_msg_->filter; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgSetTime.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgSetTime.cc index 4e40a8de7..80d64b399 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgSetTime.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgSetTime.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSetTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSetTime.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,6 +27,6 @@ #include #include +#include #include #include -#include diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgSpecan.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgSpecan.cc index 0a0443518..4a29fb80a 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgSpecan.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgSpecan.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecan.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecan.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgSpecan0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgSpecan0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgSpecan0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgSpecan0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_specan_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_specan_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,1411 +81,2124 @@ class Test_legacy_auto_check_sbp_piksi_MsgSpecan0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_specan_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgSpecan0, Test) -{ +}; - uint8_t encoded_frame[] = {85,81,0,28,212,255,74,137,71,245,34,73,12,221,215,167,211,19,154,201,241,69,205,136,0,70,51,67,108,69,102,38,166,68,100,179,185,17,175,49,193,228,228,47,33,24,141,177,18,99,246,121,61,40,91,145,223,167,174,9,116,11,247,84,49,153,205,2,230,194,218,241,101,107,45,137,93,114,230,43,224,23,74,209,199,211,130,89,220,163,68,20,253,7,206,50,129,116,194,23,31,226,217,157,205,221,5,224,92,82,109,223,195,233,165,1,82,141,157,177,169,244,131,96,109,111,253,149,28,225,225,72,158,158,210,196,206,70,63,225,184,150,174,240,45,146,59,82,194,4,179,148,66,254,115,77,30,46,4,204,37,200,121,18,17,171,102,163,175,50,66,101,69,13,223,172,160,233,220,101,237,156,62,117,47,143,94,135,22,155,113,110,15,243,141,227,46,143,227,209,249,2,153,168,131,249,160,88,38,117,129,57,40,109,209,177,38,47,12,15,16,9,175,69,70,182,239,117,135,6,71,99,230,115,2,71,165,228,123,210,168,90,124,20,7,220,144,168,69,22,72,162,69,111,91,251,72,220,28,119,150,95,2, }; +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgSpecan0, Test) { + uint8_t encoded_frame[] = { + 85, 81, 0, 28, 212, 255, 74, 137, 71, 245, 34, 73, 12, 221, 215, + 167, 211, 19, 154, 201, 241, 69, 205, 136, 0, 70, 51, 67, 108, 69, + 102, 38, 166, 68, 100, 179, 185, 17, 175, 49, 193, 228, 228, 47, 33, + 24, 141, 177, 18, 99, 246, 121, 61, 40, 91, 145, 223, 167, 174, 9, + 116, 11, 247, 84, 49, 153, 205, 2, 230, 194, 218, 241, 101, 107, 45, + 137, 93, 114, 230, 43, 224, 23, 74, 209, 199, 211, 130, 89, 220, 163, + 68, 20, 253, 7, 206, 50, 129, 116, 194, 23, 31, 226, 217, 157, 205, + 221, 5, 224, 92, 82, 109, 223, 195, 233, 165, 1, 82, 141, 157, 177, + 169, 244, 131, 96, 109, 111, 253, 149, 28, 225, 225, 72, 158, 158, 210, + 196, 206, 70, 63, 225, 184, 150, 174, 240, 45, 146, 59, 82, 194, 4, + 179, 148, 66, 254, 115, 77, 30, 46, 4, 204, 37, 200, 121, 18, 17, + 171, 102, 163, 175, 50, 66, 101, 69, 13, 223, 172, 160, 233, 220, 101, + 237, 156, 62, 117, 47, 143, 94, 135, 22, 155, 113, 110, 15, 243, 141, + 227, 46, 143, 227, 209, 249, 2, 153, 168, 131, 249, 160, 88, 38, 117, + 129, 57, 40, 109, 209, 177, 38, 47, 12, 15, 16, 9, 175, 69, 70, + 182, 239, 117, 135, 6, 71, 99, 230, 115, 2, 71, 165, 228, 123, 210, + 168, 90, 124, 20, 7, 220, 144, 168, 69, 22, 72, 162, 69, 111, 91, + 251, 72, 220, 28, 119, 150, 95, 2, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_specan_t* test_msg = ( msg_specan_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->amplitude_ref = 3780.199951171875; - test_msg->amplitude_unit = 1329.199951171875; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[0] = 100; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[1] = 179; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[2] = 185; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[3] = 17; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[4] = 175; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[5] = 49; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[6] = 193; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[7] = 228; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[8] = 228; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[9] = 47; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[10] = 33; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[11] = 24; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[12] = 141; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[13] = 177; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[14] = 18; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[15] = 99; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[16] = 246; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[17] = 121; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[18] = 61; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[19] = 40; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[20] = 91; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[21] = 145; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[22] = 223; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[23] = 167; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[24] = 174; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[25] = 9; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[26] = 116; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[27] = 11; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[28] = 247; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[29] = 84; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[30] = 49; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[31] = 153; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[32] = 205; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[33] = 2; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[34] = 230; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[35] = 194; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[36] = 218; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[37] = 241; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[38] = 101; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[39] = 107; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[40] = 45; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[41] = 137; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[42] = 93; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[43] = 114; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[44] = 230; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[45] = 43; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[46] = 224; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[47] = 23; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[48] = 74; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[49] = 209; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[50] = 199; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[51] = 211; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[52] = 130; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[53] = 89; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[54] = 220; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[55] = 163; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[56] = 68; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[57] = 20; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[58] = 253; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[59] = 7; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[60] = 206; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[61] = 50; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[62] = 129; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[63] = 116; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[64] = 194; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[65] = 23; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[66] = 31; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[67] = 226; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[68] = 217; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[69] = 157; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[70] = 205; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[71] = 221; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[72] = 5; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[73] = 224; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[74] = 92; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[75] = 82; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[76] = 109; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[77] = 223; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[78] = 195; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[79] = 233; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[80] = 165; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[81] = 1; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[82] = 82; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[83] = 141; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[84] = 157; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[85] = 177; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[86] = 169; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[87] = 244; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[88] = 131; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[89] = 96; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[90] = 109; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[91] = 111; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[92] = 253; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[93] = 149; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[94] = 28; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[95] = 225; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[96] = 225; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[97] = 72; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[98] = 158; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[99] = 158; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[100] = 210; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[101] = 196; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[102] = 206; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[103] = 70; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[104] = 63; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[105] = 225; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[106] = 184; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[107] = 150; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[108] = 174; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[109] = 240; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[110] = 45; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[111] = 146; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[112] = 59; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[113] = 82; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[114] = 194; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[115] = 4; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[116] = 179; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[117] = 148; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[118] = 66; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[119] = 254; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[120] = 115; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[121] = 77; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[122] = 30; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[123] = 46; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[124] = 4; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[125] = 204; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[126] = 37; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[127] = 200; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[128] = 121; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[129] = 18; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[130] = 17; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[131] = 171; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[132] = 102; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[133] = 163; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[134] = 175; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[135] = 50; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[136] = 66; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[137] = 101; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[138] = 69; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[139] = 13; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[140] = 223; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[141] = 172; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[142] = 160; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[143] = 233; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[144] = 220; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[145] = 101; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[146] = 237; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[147] = 156; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[148] = 62; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[149] = 117; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[150] = 47; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[151] = 143; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[152] = 94; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[153] = 135; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[154] = 22; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[155] = 155; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[156] = 113; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[157] = 110; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[158] = 15; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[159] = 243; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[160] = 141; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[161] = 227; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[162] = 46; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[163] = 143; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[164] = 227; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[165] = 209; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[166] = 249; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[167] = 2; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[168] = 153; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[169] = 168; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[170] = 131; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[171] = 249; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[172] = 160; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[173] = 88; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[174] = 38; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[175] = 117; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[176] = 129; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[177] = 57; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[178] = 40; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[179] = 109; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[180] = 209; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[181] = 177; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[182] = 38; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[183] = 47; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[184] = 12; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[185] = 15; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[186] = 16; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[187] = 9; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[188] = 175; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[189] = 69; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[190] = 70; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[191] = 182; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[192] = 239; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[193] = 117; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[194] = 135; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[195] = 6; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[196] = 71; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[197] = 99; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[198] = 230; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[199] = 115; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[200] = 2; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[201] = 71; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[202] = 165; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[203] = 228; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[204] = 123; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[205] = 210; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[206] = 168; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[207] = 90; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[208] = 124; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[209] = 20; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[210] = 7; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[211] = 220; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[212] = 144; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[213] = 168; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[214] = 69; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[215] = 22; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[216] = 72; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[217] = 162; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[218] = 69; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[219] = 111; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[220] = 91; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[221] = 251; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[222] = 72; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[223] = 220; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[224] = 28; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[225] = 119; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[226] = 150; - test_msg->channel_tag = 35146; - test_msg->freq_ref = 7737.2001953125; - test_msg->freq_step = 8226.2001953125; - test_msg->t.ns_residual = -1479025396; - test_msg->t.tow = 1227027783; - test_msg->t.wn = 5075; - - EXPECT_EQ(send_message( 0x51, 54300, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_specan_t *test_msg = (msg_specan_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->amplitude_ref = 3780.199951171875; + test_msg->amplitude_unit = 1329.199951171875; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[0] = 100; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[1] = 179; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[2] = 185; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[3] = 17; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[4] = 175; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[5] = 49; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[6] = 193; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[7] = 228; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[8] = 228; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[9] = 47; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[10] = 33; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[11] = 24; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[12] = 141; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[13] = 177; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[14] = 18; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[15] = 99; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[16] = 246; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[17] = 121; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[18] = 61; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[19] = 40; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[20] = 91; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[21] = 145; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[22] = 223; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[23] = 167; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[24] = 174; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[25] = 9; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[26] = 116; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[27] = 11; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[28] = 247; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[29] = 84; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[30] = 49; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[31] = 153; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[32] = 205; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[33] = 2; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[34] = 230; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[35] = 194; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[36] = 218; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[37] = 241; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[38] = 101; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[39] = 107; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[40] = 45; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[41] = 137; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[42] = 93; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[43] = 114; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[44] = 230; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[45] = 43; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[46] = 224; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[47] = 23; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[48] = 74; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[49] = 209; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[50] = 199; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[51] = 211; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[52] = 130; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[53] = 89; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[54] = 220; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[55] = 163; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[56] = 68; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[57] = 20; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[58] = 253; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[59] = 7; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[60] = 206; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[61] = 50; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[62] = 129; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[63] = 116; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[64] = 194; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[65] = 23; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[66] = 31; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[67] = 226; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[68] = 217; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[69] = 157; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[70] = 205; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[71] = 221; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[72] = 5; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[73] = 224; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[74] = 92; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[75] = 82; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[76] = 109; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[77] = 223; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[78] = 195; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[79] = 233; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[80] = 165; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[81] = 1; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[82] = 82; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[83] = 141; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[84] = 157; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[85] = 177; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[86] = 169; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[87] = 244; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[88] = 131; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[89] = 96; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[90] = 109; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[91] = 111; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[92] = 253; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[93] = 149; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[94] = 28; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[95] = 225; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[96] = 225; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[97] = 72; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[98] = 158; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[99] = 158; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[100] = 210; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[101] = 196; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[102] = 206; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[103] = 70; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[104] = 63; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[105] = 225; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[106] = 184; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[107] = 150; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[108] = 174; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[109] = 240; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[110] = 45; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[111] = 146; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[112] = 59; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[113] = 82; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[114] = 194; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[115] = 4; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[116] = 179; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[117] = 148; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[118] = 66; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[119] = 254; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[120] = 115; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[121] = 77; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[122] = 30; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[123] = 46; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[124] = 4; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[125] = 204; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[126] = 37; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[127] = 200; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[128] = 121; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[129] = 18; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[130] = 17; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[131] = 171; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[132] = 102; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[133] = 163; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[134] = 175; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[135] = 50; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[136] = 66; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[137] = 101; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[138] = 69; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[139] = 13; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[140] = 223; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[141] = 172; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[142] = 160; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[143] = 233; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[144] = 220; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[145] = 101; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[146] = 237; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[147] = 156; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[148] = 62; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[149] = 117; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[150] = 47; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[151] = 143; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[152] = 94; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[153] = 135; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[154] = 22; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[155] = 155; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[156] = 113; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[157] = 110; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[158] = 15; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[159] = 243; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[160] = 141; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[161] = 227; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[162] = 46; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[163] = 143; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[164] = 227; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[165] = 209; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[166] = 249; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[167] = 2; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[168] = 153; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[169] = 168; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[170] = 131; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[171] = 249; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[172] = 160; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[173] = 88; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[174] = 38; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[175] = 117; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[176] = 129; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[177] = 57; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[178] = 40; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[179] = 109; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[180] = 209; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[181] = 177; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[182] = 38; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[183] = 47; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[184] = 12; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[185] = 15; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[186] = 16; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[187] = 9; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[188] = 175; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[189] = 69; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[190] = 70; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[191] = 182; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[192] = 239; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[193] = 117; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[194] = 135; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[195] = 6; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[196] = 71; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[197] = 99; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[198] = 230; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[199] = 115; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[200] = 2; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[201] = 71; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[202] = 165; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[203] = 228; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[204] = 123; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[205] = 210; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[206] = 168; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[207] = 90; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[208] = 124; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[209] = 20; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[210] = 7; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[211] = 220; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[212] = 144; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[213] = 168; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[214] = 69; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[215] = 22; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[216] = 72; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[217] = 162; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[218] = 69; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[219] = 111; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[220] = 91; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[221] = 251; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[222] = 72; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[223] = 220; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[224] = 28; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[225] = 119; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[226] = 150; + test_msg->channel_tag = 35146; + test_msg->freq_ref = 7737.2001953125; + test_msg->freq_step = 8226.2001953125; + test_msg->t.ns_residual = -1479025396; + test_msg->t.tow = 1227027783; + test_msg->t.wn = 5075; + + EXPECT_EQ(send_message(0x51, 54300, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 54300); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->amplitude_ref*100 - 3780.19995117*100), 0.05) << "incorrect value for amplitude_ref, expected 3780.19995117, is " << last_msg_->amplitude_ref; - EXPECT_LT((last_msg_->amplitude_unit*100 - 1329.19995117*100), 0.05) << "incorrect value for amplitude_unit, expected 1329.19995117, is " << last_msg_->amplitude_unit; - EXPECT_EQ(last_msg_->amplitude_value[0], 100) << "incorrect value for amplitude_value[0], expected 100, is " << last_msg_->amplitude_value[0]; - EXPECT_EQ(last_msg_->amplitude_value[1], 179) << "incorrect value for amplitude_value[1], expected 179, is " << last_msg_->amplitude_value[1]; - EXPECT_EQ(last_msg_->amplitude_value[2], 185) << "incorrect value for amplitude_value[2], expected 185, is " << last_msg_->amplitude_value[2]; - EXPECT_EQ(last_msg_->amplitude_value[3], 17) << "incorrect value for amplitude_value[3], expected 17, is " << last_msg_->amplitude_value[3]; - EXPECT_EQ(last_msg_->amplitude_value[4], 175) << "incorrect value for amplitude_value[4], expected 175, is " << last_msg_->amplitude_value[4]; - EXPECT_EQ(last_msg_->amplitude_value[5], 49) << "incorrect value for amplitude_value[5], expected 49, is " << last_msg_->amplitude_value[5]; - EXPECT_EQ(last_msg_->amplitude_value[6], 193) << "incorrect value for amplitude_value[6], expected 193, is " << last_msg_->amplitude_value[6]; - EXPECT_EQ(last_msg_->amplitude_value[7], 228) << "incorrect value for amplitude_value[7], expected 228, is " << last_msg_->amplitude_value[7]; - EXPECT_EQ(last_msg_->amplitude_value[8], 228) << "incorrect value for amplitude_value[8], expected 228, is " << last_msg_->amplitude_value[8]; - EXPECT_EQ(last_msg_->amplitude_value[9], 47) << "incorrect value for amplitude_value[9], expected 47, is " << last_msg_->amplitude_value[9]; - EXPECT_EQ(last_msg_->amplitude_value[10], 33) << "incorrect value for amplitude_value[10], expected 33, is " << last_msg_->amplitude_value[10]; - EXPECT_EQ(last_msg_->amplitude_value[11], 24) << "incorrect value for amplitude_value[11], expected 24, is " << last_msg_->amplitude_value[11]; - EXPECT_EQ(last_msg_->amplitude_value[12], 141) << "incorrect value for amplitude_value[12], expected 141, is " << last_msg_->amplitude_value[12]; - EXPECT_EQ(last_msg_->amplitude_value[13], 177) << "incorrect value for amplitude_value[13], expected 177, is " << last_msg_->amplitude_value[13]; - EXPECT_EQ(last_msg_->amplitude_value[14], 18) << "incorrect value for amplitude_value[14], expected 18, is " << last_msg_->amplitude_value[14]; - EXPECT_EQ(last_msg_->amplitude_value[15], 99) << "incorrect value for amplitude_value[15], expected 99, is " << last_msg_->amplitude_value[15]; - EXPECT_EQ(last_msg_->amplitude_value[16], 246) << "incorrect value for amplitude_value[16], expected 246, is " << last_msg_->amplitude_value[16]; - EXPECT_EQ(last_msg_->amplitude_value[17], 121) << "incorrect value for amplitude_value[17], expected 121, is " << last_msg_->amplitude_value[17]; - EXPECT_EQ(last_msg_->amplitude_value[18], 61) << "incorrect value for amplitude_value[18], expected 61, is " << last_msg_->amplitude_value[18]; - EXPECT_EQ(last_msg_->amplitude_value[19], 40) << "incorrect value for amplitude_value[19], expected 40, is " << last_msg_->amplitude_value[19]; - EXPECT_EQ(last_msg_->amplitude_value[20], 91) << "incorrect value for amplitude_value[20], expected 91, is " << last_msg_->amplitude_value[20]; - EXPECT_EQ(last_msg_->amplitude_value[21], 145) << "incorrect value for amplitude_value[21], expected 145, is " << last_msg_->amplitude_value[21]; - EXPECT_EQ(last_msg_->amplitude_value[22], 223) << "incorrect value for amplitude_value[22], expected 223, is " << last_msg_->amplitude_value[22]; - EXPECT_EQ(last_msg_->amplitude_value[23], 167) << "incorrect value for amplitude_value[23], expected 167, is " << last_msg_->amplitude_value[23]; - EXPECT_EQ(last_msg_->amplitude_value[24], 174) << "incorrect value for amplitude_value[24], expected 174, is " << last_msg_->amplitude_value[24]; - EXPECT_EQ(last_msg_->amplitude_value[25], 9) << "incorrect value for amplitude_value[25], expected 9, is " << last_msg_->amplitude_value[25]; - EXPECT_EQ(last_msg_->amplitude_value[26], 116) << "incorrect value for amplitude_value[26], expected 116, is " << last_msg_->amplitude_value[26]; - EXPECT_EQ(last_msg_->amplitude_value[27], 11) << "incorrect value for amplitude_value[27], expected 11, is " << last_msg_->amplitude_value[27]; - EXPECT_EQ(last_msg_->amplitude_value[28], 247) << "incorrect value for amplitude_value[28], expected 247, is " << last_msg_->amplitude_value[28]; - EXPECT_EQ(last_msg_->amplitude_value[29], 84) << "incorrect value for amplitude_value[29], expected 84, is " << last_msg_->amplitude_value[29]; - EXPECT_EQ(last_msg_->amplitude_value[30], 49) << "incorrect value for amplitude_value[30], expected 49, is " << last_msg_->amplitude_value[30]; - EXPECT_EQ(last_msg_->amplitude_value[31], 153) << "incorrect value for amplitude_value[31], expected 153, is " << last_msg_->amplitude_value[31]; - EXPECT_EQ(last_msg_->amplitude_value[32], 205) << "incorrect value for amplitude_value[32], expected 205, is " << last_msg_->amplitude_value[32]; - EXPECT_EQ(last_msg_->amplitude_value[33], 2) << "incorrect value for amplitude_value[33], expected 2, is " << last_msg_->amplitude_value[33]; - EXPECT_EQ(last_msg_->amplitude_value[34], 230) << "incorrect value for amplitude_value[34], expected 230, is " << last_msg_->amplitude_value[34]; - EXPECT_EQ(last_msg_->amplitude_value[35], 194) << "incorrect value for amplitude_value[35], expected 194, is " << last_msg_->amplitude_value[35]; - EXPECT_EQ(last_msg_->amplitude_value[36], 218) << "incorrect value for amplitude_value[36], expected 218, is " << last_msg_->amplitude_value[36]; - EXPECT_EQ(last_msg_->amplitude_value[37], 241) << "incorrect value for amplitude_value[37], expected 241, is " << last_msg_->amplitude_value[37]; - EXPECT_EQ(last_msg_->amplitude_value[38], 101) << "incorrect value for amplitude_value[38], expected 101, is " << last_msg_->amplitude_value[38]; - EXPECT_EQ(last_msg_->amplitude_value[39], 107) << "incorrect value for amplitude_value[39], expected 107, is " << last_msg_->amplitude_value[39]; - EXPECT_EQ(last_msg_->amplitude_value[40], 45) << "incorrect value for amplitude_value[40], expected 45, is " << last_msg_->amplitude_value[40]; - EXPECT_EQ(last_msg_->amplitude_value[41], 137) << "incorrect value for amplitude_value[41], expected 137, is " << last_msg_->amplitude_value[41]; - EXPECT_EQ(last_msg_->amplitude_value[42], 93) << "incorrect value for amplitude_value[42], expected 93, is " << last_msg_->amplitude_value[42]; - EXPECT_EQ(last_msg_->amplitude_value[43], 114) << "incorrect value for amplitude_value[43], expected 114, is " << last_msg_->amplitude_value[43]; - EXPECT_EQ(last_msg_->amplitude_value[44], 230) << "incorrect value for amplitude_value[44], expected 230, is " << last_msg_->amplitude_value[44]; - EXPECT_EQ(last_msg_->amplitude_value[45], 43) << "incorrect value for amplitude_value[45], expected 43, is " << last_msg_->amplitude_value[45]; - EXPECT_EQ(last_msg_->amplitude_value[46], 224) << "incorrect value for amplitude_value[46], expected 224, is " << last_msg_->amplitude_value[46]; - EXPECT_EQ(last_msg_->amplitude_value[47], 23) << "incorrect value for amplitude_value[47], expected 23, is " << last_msg_->amplitude_value[47]; - EXPECT_EQ(last_msg_->amplitude_value[48], 74) << "incorrect value for amplitude_value[48], expected 74, is " << last_msg_->amplitude_value[48]; - EXPECT_EQ(last_msg_->amplitude_value[49], 209) << "incorrect value for amplitude_value[49], expected 209, is " << last_msg_->amplitude_value[49]; - EXPECT_EQ(last_msg_->amplitude_value[50], 199) << "incorrect value for amplitude_value[50], expected 199, is " << last_msg_->amplitude_value[50]; - EXPECT_EQ(last_msg_->amplitude_value[51], 211) << "incorrect value for amplitude_value[51], expected 211, is " << last_msg_->amplitude_value[51]; - EXPECT_EQ(last_msg_->amplitude_value[52], 130) << "incorrect value for amplitude_value[52], expected 130, is " << last_msg_->amplitude_value[52]; - EXPECT_EQ(last_msg_->amplitude_value[53], 89) << "incorrect value for amplitude_value[53], expected 89, is " << last_msg_->amplitude_value[53]; - EXPECT_EQ(last_msg_->amplitude_value[54], 220) << "incorrect value for amplitude_value[54], expected 220, is " << last_msg_->amplitude_value[54]; - EXPECT_EQ(last_msg_->amplitude_value[55], 163) << "incorrect value for amplitude_value[55], expected 163, is " << last_msg_->amplitude_value[55]; - EXPECT_EQ(last_msg_->amplitude_value[56], 68) << "incorrect value for amplitude_value[56], expected 68, is " << last_msg_->amplitude_value[56]; - EXPECT_EQ(last_msg_->amplitude_value[57], 20) << "incorrect value for amplitude_value[57], expected 20, is " << last_msg_->amplitude_value[57]; - EXPECT_EQ(last_msg_->amplitude_value[58], 253) << "incorrect value for amplitude_value[58], expected 253, is " << last_msg_->amplitude_value[58]; - EXPECT_EQ(last_msg_->amplitude_value[59], 7) << "incorrect value for amplitude_value[59], expected 7, is " << last_msg_->amplitude_value[59]; - EXPECT_EQ(last_msg_->amplitude_value[60], 206) << "incorrect value for amplitude_value[60], expected 206, is " << last_msg_->amplitude_value[60]; - EXPECT_EQ(last_msg_->amplitude_value[61], 50) << "incorrect value for amplitude_value[61], expected 50, is " << last_msg_->amplitude_value[61]; - EXPECT_EQ(last_msg_->amplitude_value[62], 129) << "incorrect value for amplitude_value[62], expected 129, is " << last_msg_->amplitude_value[62]; - EXPECT_EQ(last_msg_->amplitude_value[63], 116) << "incorrect value for amplitude_value[63], expected 116, is " << last_msg_->amplitude_value[63]; - EXPECT_EQ(last_msg_->amplitude_value[64], 194) << "incorrect value for amplitude_value[64], expected 194, is " << last_msg_->amplitude_value[64]; - EXPECT_EQ(last_msg_->amplitude_value[65], 23) << "incorrect value for amplitude_value[65], expected 23, is " << last_msg_->amplitude_value[65]; - EXPECT_EQ(last_msg_->amplitude_value[66], 31) << "incorrect value for amplitude_value[66], expected 31, is " << last_msg_->amplitude_value[66]; - EXPECT_EQ(last_msg_->amplitude_value[67], 226) << "incorrect value for amplitude_value[67], expected 226, is " << last_msg_->amplitude_value[67]; - EXPECT_EQ(last_msg_->amplitude_value[68], 217) << "incorrect value for amplitude_value[68], expected 217, is " << last_msg_->amplitude_value[68]; - EXPECT_EQ(last_msg_->amplitude_value[69], 157) << "incorrect value for amplitude_value[69], expected 157, is " << last_msg_->amplitude_value[69]; - EXPECT_EQ(last_msg_->amplitude_value[70], 205) << "incorrect value for amplitude_value[70], expected 205, is " << last_msg_->amplitude_value[70]; - EXPECT_EQ(last_msg_->amplitude_value[71], 221) << "incorrect value for amplitude_value[71], expected 221, is " << last_msg_->amplitude_value[71]; - EXPECT_EQ(last_msg_->amplitude_value[72], 5) << "incorrect value for amplitude_value[72], expected 5, is " << last_msg_->amplitude_value[72]; - EXPECT_EQ(last_msg_->amplitude_value[73], 224) << "incorrect value for amplitude_value[73], expected 224, is " << last_msg_->amplitude_value[73]; - EXPECT_EQ(last_msg_->amplitude_value[74], 92) << "incorrect value for amplitude_value[74], expected 92, is " << last_msg_->amplitude_value[74]; - EXPECT_EQ(last_msg_->amplitude_value[75], 82) << "incorrect value for amplitude_value[75], expected 82, is " << last_msg_->amplitude_value[75]; - EXPECT_EQ(last_msg_->amplitude_value[76], 109) << "incorrect value for amplitude_value[76], expected 109, is " << last_msg_->amplitude_value[76]; - EXPECT_EQ(last_msg_->amplitude_value[77], 223) << "incorrect value for amplitude_value[77], expected 223, is " << last_msg_->amplitude_value[77]; - EXPECT_EQ(last_msg_->amplitude_value[78], 195) << "incorrect value for amplitude_value[78], expected 195, is " << last_msg_->amplitude_value[78]; - EXPECT_EQ(last_msg_->amplitude_value[79], 233) << "incorrect value for amplitude_value[79], expected 233, is " << last_msg_->amplitude_value[79]; - EXPECT_EQ(last_msg_->amplitude_value[80], 165) << "incorrect value for amplitude_value[80], expected 165, is " << last_msg_->amplitude_value[80]; - EXPECT_EQ(last_msg_->amplitude_value[81], 1) << "incorrect value for amplitude_value[81], expected 1, is " << last_msg_->amplitude_value[81]; - EXPECT_EQ(last_msg_->amplitude_value[82], 82) << "incorrect value for amplitude_value[82], expected 82, is " << last_msg_->amplitude_value[82]; - EXPECT_EQ(last_msg_->amplitude_value[83], 141) << "incorrect value for amplitude_value[83], expected 141, is " << last_msg_->amplitude_value[83]; - EXPECT_EQ(last_msg_->amplitude_value[84], 157) << "incorrect value for amplitude_value[84], expected 157, is " << last_msg_->amplitude_value[84]; - EXPECT_EQ(last_msg_->amplitude_value[85], 177) << "incorrect value for amplitude_value[85], expected 177, is " << last_msg_->amplitude_value[85]; - EXPECT_EQ(last_msg_->amplitude_value[86], 169) << "incorrect value for amplitude_value[86], expected 169, is " << last_msg_->amplitude_value[86]; - EXPECT_EQ(last_msg_->amplitude_value[87], 244) << "incorrect value for amplitude_value[87], expected 244, is " << last_msg_->amplitude_value[87]; - EXPECT_EQ(last_msg_->amplitude_value[88], 131) << "incorrect value for amplitude_value[88], expected 131, is " << last_msg_->amplitude_value[88]; - EXPECT_EQ(last_msg_->amplitude_value[89], 96) << "incorrect value for amplitude_value[89], expected 96, is " << last_msg_->amplitude_value[89]; - EXPECT_EQ(last_msg_->amplitude_value[90], 109) << "incorrect value for amplitude_value[90], expected 109, is " << last_msg_->amplitude_value[90]; - EXPECT_EQ(last_msg_->amplitude_value[91], 111) << "incorrect value for amplitude_value[91], expected 111, is " << last_msg_->amplitude_value[91]; - EXPECT_EQ(last_msg_->amplitude_value[92], 253) << "incorrect value for amplitude_value[92], expected 253, is " << last_msg_->amplitude_value[92]; - EXPECT_EQ(last_msg_->amplitude_value[93], 149) << "incorrect value for amplitude_value[93], expected 149, is " << last_msg_->amplitude_value[93]; - EXPECT_EQ(last_msg_->amplitude_value[94], 28) << "incorrect value for amplitude_value[94], expected 28, is " << last_msg_->amplitude_value[94]; - EXPECT_EQ(last_msg_->amplitude_value[95], 225) << "incorrect value for amplitude_value[95], expected 225, is " << last_msg_->amplitude_value[95]; - EXPECT_EQ(last_msg_->amplitude_value[96], 225) << "incorrect value for amplitude_value[96], expected 225, is " << last_msg_->amplitude_value[96]; - EXPECT_EQ(last_msg_->amplitude_value[97], 72) << "incorrect value for amplitude_value[97], expected 72, is " << last_msg_->amplitude_value[97]; - EXPECT_EQ(last_msg_->amplitude_value[98], 158) << "incorrect value for amplitude_value[98], expected 158, is " << last_msg_->amplitude_value[98]; - EXPECT_EQ(last_msg_->amplitude_value[99], 158) << "incorrect value for amplitude_value[99], expected 158, is " << last_msg_->amplitude_value[99]; - EXPECT_EQ(last_msg_->amplitude_value[100], 210) << "incorrect value for amplitude_value[100], expected 210, is " << last_msg_->amplitude_value[100]; - EXPECT_EQ(last_msg_->amplitude_value[101], 196) << "incorrect value for amplitude_value[101], expected 196, is " << last_msg_->amplitude_value[101]; - EXPECT_EQ(last_msg_->amplitude_value[102], 206) << "incorrect value for amplitude_value[102], expected 206, is " << last_msg_->amplitude_value[102]; - EXPECT_EQ(last_msg_->amplitude_value[103], 70) << "incorrect value for amplitude_value[103], expected 70, is " << last_msg_->amplitude_value[103]; - EXPECT_EQ(last_msg_->amplitude_value[104], 63) << "incorrect value for amplitude_value[104], expected 63, is " << last_msg_->amplitude_value[104]; - EXPECT_EQ(last_msg_->amplitude_value[105], 225) << "incorrect value for amplitude_value[105], expected 225, is " << last_msg_->amplitude_value[105]; - EXPECT_EQ(last_msg_->amplitude_value[106], 184) << "incorrect value for amplitude_value[106], expected 184, is " << last_msg_->amplitude_value[106]; - EXPECT_EQ(last_msg_->amplitude_value[107], 150) << "incorrect value for amplitude_value[107], expected 150, is " << last_msg_->amplitude_value[107]; - EXPECT_EQ(last_msg_->amplitude_value[108], 174) << "incorrect value for amplitude_value[108], expected 174, is " << last_msg_->amplitude_value[108]; - EXPECT_EQ(last_msg_->amplitude_value[109], 240) << "incorrect value for amplitude_value[109], expected 240, is " << last_msg_->amplitude_value[109]; - EXPECT_EQ(last_msg_->amplitude_value[110], 45) << "incorrect value for amplitude_value[110], expected 45, is " << last_msg_->amplitude_value[110]; - EXPECT_EQ(last_msg_->amplitude_value[111], 146) << "incorrect value for amplitude_value[111], expected 146, is " << last_msg_->amplitude_value[111]; - EXPECT_EQ(last_msg_->amplitude_value[112], 59) << "incorrect value for amplitude_value[112], expected 59, is " << last_msg_->amplitude_value[112]; - EXPECT_EQ(last_msg_->amplitude_value[113], 82) << "incorrect value for amplitude_value[113], expected 82, is " << last_msg_->amplitude_value[113]; - EXPECT_EQ(last_msg_->amplitude_value[114], 194) << "incorrect value for amplitude_value[114], expected 194, is " << last_msg_->amplitude_value[114]; - EXPECT_EQ(last_msg_->amplitude_value[115], 4) << "incorrect value for amplitude_value[115], expected 4, is " << last_msg_->amplitude_value[115]; - EXPECT_EQ(last_msg_->amplitude_value[116], 179) << "incorrect value for amplitude_value[116], expected 179, is " << last_msg_->amplitude_value[116]; - EXPECT_EQ(last_msg_->amplitude_value[117], 148) << "incorrect value for amplitude_value[117], expected 148, is " << last_msg_->amplitude_value[117]; - EXPECT_EQ(last_msg_->amplitude_value[118], 66) << "incorrect value for amplitude_value[118], expected 66, is " << last_msg_->amplitude_value[118]; - EXPECT_EQ(last_msg_->amplitude_value[119], 254) << "incorrect value for amplitude_value[119], expected 254, is " << last_msg_->amplitude_value[119]; - EXPECT_EQ(last_msg_->amplitude_value[120], 115) << "incorrect value for amplitude_value[120], expected 115, is " << last_msg_->amplitude_value[120]; - EXPECT_EQ(last_msg_->amplitude_value[121], 77) << "incorrect value for amplitude_value[121], expected 77, is " << last_msg_->amplitude_value[121]; - EXPECT_EQ(last_msg_->amplitude_value[122], 30) << "incorrect value for amplitude_value[122], expected 30, is " << last_msg_->amplitude_value[122]; - EXPECT_EQ(last_msg_->amplitude_value[123], 46) << "incorrect value for amplitude_value[123], expected 46, is " << last_msg_->amplitude_value[123]; - EXPECT_EQ(last_msg_->amplitude_value[124], 4) << "incorrect value for amplitude_value[124], expected 4, is " << last_msg_->amplitude_value[124]; - EXPECT_EQ(last_msg_->amplitude_value[125], 204) << "incorrect value for amplitude_value[125], expected 204, is " << last_msg_->amplitude_value[125]; - EXPECT_EQ(last_msg_->amplitude_value[126], 37) << "incorrect value for amplitude_value[126], expected 37, is " << last_msg_->amplitude_value[126]; - EXPECT_EQ(last_msg_->amplitude_value[127], 200) << "incorrect value for amplitude_value[127], expected 200, is " << last_msg_->amplitude_value[127]; - EXPECT_EQ(last_msg_->amplitude_value[128], 121) << "incorrect value for amplitude_value[128], expected 121, is " << last_msg_->amplitude_value[128]; - EXPECT_EQ(last_msg_->amplitude_value[129], 18) << "incorrect value for amplitude_value[129], expected 18, is " << last_msg_->amplitude_value[129]; - EXPECT_EQ(last_msg_->amplitude_value[130], 17) << "incorrect value for amplitude_value[130], expected 17, is " << last_msg_->amplitude_value[130]; - EXPECT_EQ(last_msg_->amplitude_value[131], 171) << "incorrect value for amplitude_value[131], expected 171, is " << last_msg_->amplitude_value[131]; - EXPECT_EQ(last_msg_->amplitude_value[132], 102) << "incorrect value for amplitude_value[132], expected 102, is " << last_msg_->amplitude_value[132]; - EXPECT_EQ(last_msg_->amplitude_value[133], 163) << "incorrect value for amplitude_value[133], expected 163, is " << last_msg_->amplitude_value[133]; - EXPECT_EQ(last_msg_->amplitude_value[134], 175) << "incorrect value for amplitude_value[134], expected 175, is " << last_msg_->amplitude_value[134]; - EXPECT_EQ(last_msg_->amplitude_value[135], 50) << "incorrect value for amplitude_value[135], expected 50, is " << last_msg_->amplitude_value[135]; - EXPECT_EQ(last_msg_->amplitude_value[136], 66) << "incorrect value for amplitude_value[136], expected 66, is " << last_msg_->amplitude_value[136]; - EXPECT_EQ(last_msg_->amplitude_value[137], 101) << "incorrect value for amplitude_value[137], expected 101, is " << last_msg_->amplitude_value[137]; - EXPECT_EQ(last_msg_->amplitude_value[138], 69) << "incorrect value for amplitude_value[138], expected 69, is " << last_msg_->amplitude_value[138]; - EXPECT_EQ(last_msg_->amplitude_value[139], 13) << "incorrect value for amplitude_value[139], expected 13, is " << last_msg_->amplitude_value[139]; - EXPECT_EQ(last_msg_->amplitude_value[140], 223) << "incorrect value for amplitude_value[140], expected 223, is " << last_msg_->amplitude_value[140]; - EXPECT_EQ(last_msg_->amplitude_value[141], 172) << "incorrect value for amplitude_value[141], expected 172, is " << last_msg_->amplitude_value[141]; - EXPECT_EQ(last_msg_->amplitude_value[142], 160) << "incorrect value for amplitude_value[142], expected 160, is " << last_msg_->amplitude_value[142]; - EXPECT_EQ(last_msg_->amplitude_value[143], 233) << "incorrect value for amplitude_value[143], expected 233, is " << last_msg_->amplitude_value[143]; - EXPECT_EQ(last_msg_->amplitude_value[144], 220) << "incorrect value for amplitude_value[144], expected 220, is " << last_msg_->amplitude_value[144]; - EXPECT_EQ(last_msg_->amplitude_value[145], 101) << "incorrect value for amplitude_value[145], expected 101, is " << last_msg_->amplitude_value[145]; - EXPECT_EQ(last_msg_->amplitude_value[146], 237) << "incorrect value for amplitude_value[146], expected 237, is " << last_msg_->amplitude_value[146]; - EXPECT_EQ(last_msg_->amplitude_value[147], 156) << "incorrect value for amplitude_value[147], expected 156, is " << last_msg_->amplitude_value[147]; - EXPECT_EQ(last_msg_->amplitude_value[148], 62) << "incorrect value for amplitude_value[148], expected 62, is " << last_msg_->amplitude_value[148]; - EXPECT_EQ(last_msg_->amplitude_value[149], 117) << "incorrect value for amplitude_value[149], expected 117, is " << last_msg_->amplitude_value[149]; - EXPECT_EQ(last_msg_->amplitude_value[150], 47) << "incorrect value for amplitude_value[150], expected 47, is " << last_msg_->amplitude_value[150]; - EXPECT_EQ(last_msg_->amplitude_value[151], 143) << "incorrect value for amplitude_value[151], expected 143, is " << last_msg_->amplitude_value[151]; - EXPECT_EQ(last_msg_->amplitude_value[152], 94) << "incorrect value for amplitude_value[152], expected 94, is " << last_msg_->amplitude_value[152]; - EXPECT_EQ(last_msg_->amplitude_value[153], 135) << "incorrect value for amplitude_value[153], expected 135, is " << last_msg_->amplitude_value[153]; - EXPECT_EQ(last_msg_->amplitude_value[154], 22) << "incorrect value for amplitude_value[154], expected 22, is " << last_msg_->amplitude_value[154]; - EXPECT_EQ(last_msg_->amplitude_value[155], 155) << "incorrect value for amplitude_value[155], expected 155, is " << last_msg_->amplitude_value[155]; - EXPECT_EQ(last_msg_->amplitude_value[156], 113) << "incorrect value for amplitude_value[156], expected 113, is " << last_msg_->amplitude_value[156]; - EXPECT_EQ(last_msg_->amplitude_value[157], 110) << "incorrect value for amplitude_value[157], expected 110, is " << last_msg_->amplitude_value[157]; - EXPECT_EQ(last_msg_->amplitude_value[158], 15) << "incorrect value for amplitude_value[158], expected 15, is " << last_msg_->amplitude_value[158]; - EXPECT_EQ(last_msg_->amplitude_value[159], 243) << "incorrect value for amplitude_value[159], expected 243, is " << last_msg_->amplitude_value[159]; - EXPECT_EQ(last_msg_->amplitude_value[160], 141) << "incorrect value for amplitude_value[160], expected 141, is " << last_msg_->amplitude_value[160]; - EXPECT_EQ(last_msg_->amplitude_value[161], 227) << "incorrect value for amplitude_value[161], expected 227, is " << last_msg_->amplitude_value[161]; - EXPECT_EQ(last_msg_->amplitude_value[162], 46) << "incorrect value for amplitude_value[162], expected 46, is " << last_msg_->amplitude_value[162]; - EXPECT_EQ(last_msg_->amplitude_value[163], 143) << "incorrect value for amplitude_value[163], expected 143, is " << last_msg_->amplitude_value[163]; - EXPECT_EQ(last_msg_->amplitude_value[164], 227) << "incorrect value for amplitude_value[164], expected 227, is " << last_msg_->amplitude_value[164]; - EXPECT_EQ(last_msg_->amplitude_value[165], 209) << "incorrect value for amplitude_value[165], expected 209, is " << last_msg_->amplitude_value[165]; - EXPECT_EQ(last_msg_->amplitude_value[166], 249) << "incorrect value for amplitude_value[166], expected 249, is " << last_msg_->amplitude_value[166]; - EXPECT_EQ(last_msg_->amplitude_value[167], 2) << "incorrect value for amplitude_value[167], expected 2, is " << last_msg_->amplitude_value[167]; - EXPECT_EQ(last_msg_->amplitude_value[168], 153) << "incorrect value for amplitude_value[168], expected 153, is " << last_msg_->amplitude_value[168]; - EXPECT_EQ(last_msg_->amplitude_value[169], 168) << "incorrect value for amplitude_value[169], expected 168, is " << last_msg_->amplitude_value[169]; - EXPECT_EQ(last_msg_->amplitude_value[170], 131) << "incorrect value for amplitude_value[170], expected 131, is " << last_msg_->amplitude_value[170]; - EXPECT_EQ(last_msg_->amplitude_value[171], 249) << "incorrect value for amplitude_value[171], expected 249, is " << last_msg_->amplitude_value[171]; - EXPECT_EQ(last_msg_->amplitude_value[172], 160) << "incorrect value for amplitude_value[172], expected 160, is " << last_msg_->amplitude_value[172]; - EXPECT_EQ(last_msg_->amplitude_value[173], 88) << "incorrect value for amplitude_value[173], expected 88, is " << last_msg_->amplitude_value[173]; - EXPECT_EQ(last_msg_->amplitude_value[174], 38) << "incorrect value for amplitude_value[174], expected 38, is " << last_msg_->amplitude_value[174]; - EXPECT_EQ(last_msg_->amplitude_value[175], 117) << "incorrect value for amplitude_value[175], expected 117, is " << last_msg_->amplitude_value[175]; - EXPECT_EQ(last_msg_->amplitude_value[176], 129) << "incorrect value for amplitude_value[176], expected 129, is " << last_msg_->amplitude_value[176]; - EXPECT_EQ(last_msg_->amplitude_value[177], 57) << "incorrect value for amplitude_value[177], expected 57, is " << last_msg_->amplitude_value[177]; - EXPECT_EQ(last_msg_->amplitude_value[178], 40) << "incorrect value for amplitude_value[178], expected 40, is " << last_msg_->amplitude_value[178]; - EXPECT_EQ(last_msg_->amplitude_value[179], 109) << "incorrect value for amplitude_value[179], expected 109, is " << last_msg_->amplitude_value[179]; - EXPECT_EQ(last_msg_->amplitude_value[180], 209) << "incorrect value for amplitude_value[180], expected 209, is " << last_msg_->amplitude_value[180]; - EXPECT_EQ(last_msg_->amplitude_value[181], 177) << "incorrect value for amplitude_value[181], expected 177, is " << last_msg_->amplitude_value[181]; - EXPECT_EQ(last_msg_->amplitude_value[182], 38) << "incorrect value for amplitude_value[182], expected 38, is " << last_msg_->amplitude_value[182]; - EXPECT_EQ(last_msg_->amplitude_value[183], 47) << "incorrect value for amplitude_value[183], expected 47, is " << last_msg_->amplitude_value[183]; - EXPECT_EQ(last_msg_->amplitude_value[184], 12) << "incorrect value for amplitude_value[184], expected 12, is " << last_msg_->amplitude_value[184]; - EXPECT_EQ(last_msg_->amplitude_value[185], 15) << "incorrect value for amplitude_value[185], expected 15, is " << last_msg_->amplitude_value[185]; - EXPECT_EQ(last_msg_->amplitude_value[186], 16) << "incorrect value for amplitude_value[186], expected 16, is " << last_msg_->amplitude_value[186]; - EXPECT_EQ(last_msg_->amplitude_value[187], 9) << "incorrect value for amplitude_value[187], expected 9, is " << last_msg_->amplitude_value[187]; - EXPECT_EQ(last_msg_->amplitude_value[188], 175) << "incorrect value for amplitude_value[188], expected 175, is " << last_msg_->amplitude_value[188]; - EXPECT_EQ(last_msg_->amplitude_value[189], 69) << "incorrect value for amplitude_value[189], expected 69, is " << last_msg_->amplitude_value[189]; - EXPECT_EQ(last_msg_->amplitude_value[190], 70) << "incorrect value for amplitude_value[190], expected 70, is " << last_msg_->amplitude_value[190]; - EXPECT_EQ(last_msg_->amplitude_value[191], 182) << "incorrect value for amplitude_value[191], expected 182, is " << last_msg_->amplitude_value[191]; - EXPECT_EQ(last_msg_->amplitude_value[192], 239) << "incorrect value for amplitude_value[192], expected 239, is " << last_msg_->amplitude_value[192]; - EXPECT_EQ(last_msg_->amplitude_value[193], 117) << "incorrect value for amplitude_value[193], expected 117, is " << last_msg_->amplitude_value[193]; - EXPECT_EQ(last_msg_->amplitude_value[194], 135) << "incorrect value for amplitude_value[194], expected 135, is " << last_msg_->amplitude_value[194]; - EXPECT_EQ(last_msg_->amplitude_value[195], 6) << "incorrect value for amplitude_value[195], expected 6, is " << last_msg_->amplitude_value[195]; - EXPECT_EQ(last_msg_->amplitude_value[196], 71) << "incorrect value for amplitude_value[196], expected 71, is " << last_msg_->amplitude_value[196]; - EXPECT_EQ(last_msg_->amplitude_value[197], 99) << "incorrect value for amplitude_value[197], expected 99, is " << last_msg_->amplitude_value[197]; - EXPECT_EQ(last_msg_->amplitude_value[198], 230) << "incorrect value for amplitude_value[198], expected 230, is " << last_msg_->amplitude_value[198]; - EXPECT_EQ(last_msg_->amplitude_value[199], 115) << "incorrect value for amplitude_value[199], expected 115, is " << last_msg_->amplitude_value[199]; - EXPECT_EQ(last_msg_->amplitude_value[200], 2) << "incorrect value for amplitude_value[200], expected 2, is " << last_msg_->amplitude_value[200]; - EXPECT_EQ(last_msg_->amplitude_value[201], 71) << "incorrect value for amplitude_value[201], expected 71, is " << last_msg_->amplitude_value[201]; - EXPECT_EQ(last_msg_->amplitude_value[202], 165) << "incorrect value for amplitude_value[202], expected 165, is " << last_msg_->amplitude_value[202]; - EXPECT_EQ(last_msg_->amplitude_value[203], 228) << "incorrect value for amplitude_value[203], expected 228, is " << last_msg_->amplitude_value[203]; - EXPECT_EQ(last_msg_->amplitude_value[204], 123) << "incorrect value for amplitude_value[204], expected 123, is " << last_msg_->amplitude_value[204]; - EXPECT_EQ(last_msg_->amplitude_value[205], 210) << "incorrect value for amplitude_value[205], expected 210, is " << last_msg_->amplitude_value[205]; - EXPECT_EQ(last_msg_->amplitude_value[206], 168) << "incorrect value for amplitude_value[206], expected 168, is " << last_msg_->amplitude_value[206]; - EXPECT_EQ(last_msg_->amplitude_value[207], 90) << "incorrect value for amplitude_value[207], expected 90, is " << last_msg_->amplitude_value[207]; - EXPECT_EQ(last_msg_->amplitude_value[208], 124) << "incorrect value for amplitude_value[208], expected 124, is " << last_msg_->amplitude_value[208]; - EXPECT_EQ(last_msg_->amplitude_value[209], 20) << "incorrect value for amplitude_value[209], expected 20, is " << last_msg_->amplitude_value[209]; - EXPECT_EQ(last_msg_->amplitude_value[210], 7) << "incorrect value for amplitude_value[210], expected 7, is " << last_msg_->amplitude_value[210]; - EXPECT_EQ(last_msg_->amplitude_value[211], 220) << "incorrect value for amplitude_value[211], expected 220, is " << last_msg_->amplitude_value[211]; - EXPECT_EQ(last_msg_->amplitude_value[212], 144) << "incorrect value for amplitude_value[212], expected 144, is " << last_msg_->amplitude_value[212]; - EXPECT_EQ(last_msg_->amplitude_value[213], 168) << "incorrect value for amplitude_value[213], expected 168, is " << last_msg_->amplitude_value[213]; - EXPECT_EQ(last_msg_->amplitude_value[214], 69) << "incorrect value for amplitude_value[214], expected 69, is " << last_msg_->amplitude_value[214]; - EXPECT_EQ(last_msg_->amplitude_value[215], 22) << "incorrect value for amplitude_value[215], expected 22, is " << last_msg_->amplitude_value[215]; - EXPECT_EQ(last_msg_->amplitude_value[216], 72) << "incorrect value for amplitude_value[216], expected 72, is " << last_msg_->amplitude_value[216]; - EXPECT_EQ(last_msg_->amplitude_value[217], 162) << "incorrect value for amplitude_value[217], expected 162, is " << last_msg_->amplitude_value[217]; - EXPECT_EQ(last_msg_->amplitude_value[218], 69) << "incorrect value for amplitude_value[218], expected 69, is " << last_msg_->amplitude_value[218]; - EXPECT_EQ(last_msg_->amplitude_value[219], 111) << "incorrect value for amplitude_value[219], expected 111, is " << last_msg_->amplitude_value[219]; - EXPECT_EQ(last_msg_->amplitude_value[220], 91) << "incorrect value for amplitude_value[220], expected 91, is " << last_msg_->amplitude_value[220]; - EXPECT_EQ(last_msg_->amplitude_value[221], 251) << "incorrect value for amplitude_value[221], expected 251, is " << last_msg_->amplitude_value[221]; - EXPECT_EQ(last_msg_->amplitude_value[222], 72) << "incorrect value for amplitude_value[222], expected 72, is " << last_msg_->amplitude_value[222]; - EXPECT_EQ(last_msg_->amplitude_value[223], 220) << "incorrect value for amplitude_value[223], expected 220, is " << last_msg_->amplitude_value[223]; - EXPECT_EQ(last_msg_->amplitude_value[224], 28) << "incorrect value for amplitude_value[224], expected 28, is " << last_msg_->amplitude_value[224]; - EXPECT_EQ(last_msg_->amplitude_value[225], 119) << "incorrect value for amplitude_value[225], expected 119, is " << last_msg_->amplitude_value[225]; - EXPECT_EQ(last_msg_->amplitude_value[226], 150) << "incorrect value for amplitude_value[226], expected 150, is " << last_msg_->amplitude_value[226]; - EXPECT_EQ(last_msg_->channel_tag, 35146) << "incorrect value for channel_tag, expected 35146, is " << last_msg_->channel_tag; - EXPECT_LT((last_msg_->freq_ref*100 - 7737.20019531*100), 0.05) << "incorrect value for freq_ref, expected 7737.20019531, is " << last_msg_->freq_ref; - EXPECT_LT((last_msg_->freq_step*100 - 8226.20019531*100), 0.05) << "incorrect value for freq_step, expected 8226.20019531, is " << last_msg_->freq_step; - EXPECT_EQ(last_msg_->t.ns_residual, -1479025396) << "incorrect value for t.ns_residual, expected -1479025396, is " << last_msg_->t.ns_residual; - EXPECT_EQ(last_msg_->t.tow, 1227027783) << "incorrect value for t.tow, expected 1227027783, is " << last_msg_->t.tow; - EXPECT_EQ(last_msg_->t.wn, 5075) << "incorrect value for t.wn, expected 5075, is " << last_msg_->t.wn; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 54300); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->amplitude_ref * 100 - 3780.19995117 * 100), 0.05) + << "incorrect value for amplitude_ref, expected 3780.19995117, is " + << last_msg_->amplitude_ref; + EXPECT_LT((last_msg_->amplitude_unit * 100 - 1329.19995117 * 100), 0.05) + << "incorrect value for amplitude_unit, expected 1329.19995117, is " + << last_msg_->amplitude_unit; + EXPECT_EQ(last_msg_->amplitude_value[0], 100) + << "incorrect value for amplitude_value[0], expected 100, is " + << last_msg_->amplitude_value[0]; + EXPECT_EQ(last_msg_->amplitude_value[1], 179) + << "incorrect value for amplitude_value[1], expected 179, is " + << last_msg_->amplitude_value[1]; + EXPECT_EQ(last_msg_->amplitude_value[2], 185) + << "incorrect value for amplitude_value[2], expected 185, is " + << last_msg_->amplitude_value[2]; + EXPECT_EQ(last_msg_->amplitude_value[3], 17) + << "incorrect value for amplitude_value[3], expected 17, is " + << last_msg_->amplitude_value[3]; + EXPECT_EQ(last_msg_->amplitude_value[4], 175) + << "incorrect value for amplitude_value[4], expected 175, is " + << last_msg_->amplitude_value[4]; + EXPECT_EQ(last_msg_->amplitude_value[5], 49) + << "incorrect value for amplitude_value[5], expected 49, is " + << last_msg_->amplitude_value[5]; + EXPECT_EQ(last_msg_->amplitude_value[6], 193) + << "incorrect value for amplitude_value[6], expected 193, is " + << last_msg_->amplitude_value[6]; + EXPECT_EQ(last_msg_->amplitude_value[7], 228) + << "incorrect value for amplitude_value[7], expected 228, is " + << last_msg_->amplitude_value[7]; + EXPECT_EQ(last_msg_->amplitude_value[8], 228) + << "incorrect value for amplitude_value[8], expected 228, is " + << last_msg_->amplitude_value[8]; + EXPECT_EQ(last_msg_->amplitude_value[9], 47) + << "incorrect value for amplitude_value[9], expected 47, is " + << last_msg_->amplitude_value[9]; + EXPECT_EQ(last_msg_->amplitude_value[10], 33) + << "incorrect value for amplitude_value[10], expected 33, is " + << last_msg_->amplitude_value[10]; + EXPECT_EQ(last_msg_->amplitude_value[11], 24) + << "incorrect value for amplitude_value[11], expected 24, is " + << last_msg_->amplitude_value[11]; + EXPECT_EQ(last_msg_->amplitude_value[12], 141) + << "incorrect value for amplitude_value[12], expected 141, is " + << last_msg_->amplitude_value[12]; + EXPECT_EQ(last_msg_->amplitude_value[13], 177) + << "incorrect value for amplitude_value[13], expected 177, is " + << last_msg_->amplitude_value[13]; + EXPECT_EQ(last_msg_->amplitude_value[14], 18) + << "incorrect value for amplitude_value[14], expected 18, is " + << last_msg_->amplitude_value[14]; + EXPECT_EQ(last_msg_->amplitude_value[15], 99) + << "incorrect value for amplitude_value[15], expected 99, is " + << last_msg_->amplitude_value[15]; + EXPECT_EQ(last_msg_->amplitude_value[16], 246) + << "incorrect value for amplitude_value[16], expected 246, is " + << last_msg_->amplitude_value[16]; + EXPECT_EQ(last_msg_->amplitude_value[17], 121) + << "incorrect value for amplitude_value[17], expected 121, is " + << last_msg_->amplitude_value[17]; + EXPECT_EQ(last_msg_->amplitude_value[18], 61) + << "incorrect value for amplitude_value[18], expected 61, is " + << last_msg_->amplitude_value[18]; + EXPECT_EQ(last_msg_->amplitude_value[19], 40) + << "incorrect value for amplitude_value[19], expected 40, is " + << last_msg_->amplitude_value[19]; + EXPECT_EQ(last_msg_->amplitude_value[20], 91) + << "incorrect value for amplitude_value[20], expected 91, is " + << last_msg_->amplitude_value[20]; + EXPECT_EQ(last_msg_->amplitude_value[21], 145) + << "incorrect value for amplitude_value[21], expected 145, is " + << last_msg_->amplitude_value[21]; + EXPECT_EQ(last_msg_->amplitude_value[22], 223) + << "incorrect value for amplitude_value[22], expected 223, is " + << last_msg_->amplitude_value[22]; + EXPECT_EQ(last_msg_->amplitude_value[23], 167) + << "incorrect value for amplitude_value[23], expected 167, is " + << last_msg_->amplitude_value[23]; + EXPECT_EQ(last_msg_->amplitude_value[24], 174) + << "incorrect value for amplitude_value[24], expected 174, is " + << last_msg_->amplitude_value[24]; + EXPECT_EQ(last_msg_->amplitude_value[25], 9) + << "incorrect value for amplitude_value[25], expected 9, is " + << last_msg_->amplitude_value[25]; + EXPECT_EQ(last_msg_->amplitude_value[26], 116) + << "incorrect value for amplitude_value[26], expected 116, is " + << last_msg_->amplitude_value[26]; + EXPECT_EQ(last_msg_->amplitude_value[27], 11) + << "incorrect value for amplitude_value[27], expected 11, is " + << last_msg_->amplitude_value[27]; + EXPECT_EQ(last_msg_->amplitude_value[28], 247) + << "incorrect value for amplitude_value[28], expected 247, is " + << last_msg_->amplitude_value[28]; + EXPECT_EQ(last_msg_->amplitude_value[29], 84) + << "incorrect value for amplitude_value[29], expected 84, is " + << last_msg_->amplitude_value[29]; + EXPECT_EQ(last_msg_->amplitude_value[30], 49) + << "incorrect value for amplitude_value[30], expected 49, is " + << last_msg_->amplitude_value[30]; + EXPECT_EQ(last_msg_->amplitude_value[31], 153) + << "incorrect value for amplitude_value[31], expected 153, is " + << last_msg_->amplitude_value[31]; + EXPECT_EQ(last_msg_->amplitude_value[32], 205) + << "incorrect value for amplitude_value[32], expected 205, is " + << last_msg_->amplitude_value[32]; + EXPECT_EQ(last_msg_->amplitude_value[33], 2) + << "incorrect value for amplitude_value[33], expected 2, is " + << last_msg_->amplitude_value[33]; + EXPECT_EQ(last_msg_->amplitude_value[34], 230) + << "incorrect value for amplitude_value[34], expected 230, is " + << last_msg_->amplitude_value[34]; + EXPECT_EQ(last_msg_->amplitude_value[35], 194) + << "incorrect value for amplitude_value[35], expected 194, is " + << last_msg_->amplitude_value[35]; + EXPECT_EQ(last_msg_->amplitude_value[36], 218) + << "incorrect value for amplitude_value[36], expected 218, is " + << last_msg_->amplitude_value[36]; + EXPECT_EQ(last_msg_->amplitude_value[37], 241) + << "incorrect value for amplitude_value[37], expected 241, is " + << last_msg_->amplitude_value[37]; + EXPECT_EQ(last_msg_->amplitude_value[38], 101) + << "incorrect value for amplitude_value[38], expected 101, is " + << last_msg_->amplitude_value[38]; + EXPECT_EQ(last_msg_->amplitude_value[39], 107) + << "incorrect value for amplitude_value[39], expected 107, is " + << last_msg_->amplitude_value[39]; + EXPECT_EQ(last_msg_->amplitude_value[40], 45) + << "incorrect value for amplitude_value[40], expected 45, is " + << last_msg_->amplitude_value[40]; + EXPECT_EQ(last_msg_->amplitude_value[41], 137) + << "incorrect value for amplitude_value[41], expected 137, is " + << last_msg_->amplitude_value[41]; + EXPECT_EQ(last_msg_->amplitude_value[42], 93) + << "incorrect value for amplitude_value[42], expected 93, is " + << last_msg_->amplitude_value[42]; + EXPECT_EQ(last_msg_->amplitude_value[43], 114) + << "incorrect value for amplitude_value[43], expected 114, is " + << last_msg_->amplitude_value[43]; + EXPECT_EQ(last_msg_->amplitude_value[44], 230) + << "incorrect value for amplitude_value[44], expected 230, is " + << last_msg_->amplitude_value[44]; + EXPECT_EQ(last_msg_->amplitude_value[45], 43) + << "incorrect value for amplitude_value[45], expected 43, is " + << last_msg_->amplitude_value[45]; + EXPECT_EQ(last_msg_->amplitude_value[46], 224) + << "incorrect value for amplitude_value[46], expected 224, is " + << last_msg_->amplitude_value[46]; + EXPECT_EQ(last_msg_->amplitude_value[47], 23) + << "incorrect value for amplitude_value[47], expected 23, is " + << last_msg_->amplitude_value[47]; + EXPECT_EQ(last_msg_->amplitude_value[48], 74) + << "incorrect value for amplitude_value[48], expected 74, is " + << last_msg_->amplitude_value[48]; + EXPECT_EQ(last_msg_->amplitude_value[49], 209) + << "incorrect value for amplitude_value[49], expected 209, is " + << last_msg_->amplitude_value[49]; + EXPECT_EQ(last_msg_->amplitude_value[50], 199) + << "incorrect value for amplitude_value[50], expected 199, is " + << last_msg_->amplitude_value[50]; + EXPECT_EQ(last_msg_->amplitude_value[51], 211) + << "incorrect value for amplitude_value[51], expected 211, is " + << last_msg_->amplitude_value[51]; + EXPECT_EQ(last_msg_->amplitude_value[52], 130) + << "incorrect value for amplitude_value[52], expected 130, is " + << last_msg_->amplitude_value[52]; + EXPECT_EQ(last_msg_->amplitude_value[53], 89) + << "incorrect value for amplitude_value[53], expected 89, is " + << last_msg_->amplitude_value[53]; + EXPECT_EQ(last_msg_->amplitude_value[54], 220) + << "incorrect value for amplitude_value[54], expected 220, is " + << last_msg_->amplitude_value[54]; + EXPECT_EQ(last_msg_->amplitude_value[55], 163) + << "incorrect value for amplitude_value[55], expected 163, is " + << last_msg_->amplitude_value[55]; + EXPECT_EQ(last_msg_->amplitude_value[56], 68) + << "incorrect value for amplitude_value[56], expected 68, is " + << last_msg_->amplitude_value[56]; + EXPECT_EQ(last_msg_->amplitude_value[57], 20) + << "incorrect value for amplitude_value[57], expected 20, is " + << last_msg_->amplitude_value[57]; + EXPECT_EQ(last_msg_->amplitude_value[58], 253) + << "incorrect value for amplitude_value[58], expected 253, is " + << last_msg_->amplitude_value[58]; + EXPECT_EQ(last_msg_->amplitude_value[59], 7) + << "incorrect value for amplitude_value[59], expected 7, is " + << last_msg_->amplitude_value[59]; + EXPECT_EQ(last_msg_->amplitude_value[60], 206) + << "incorrect value for amplitude_value[60], expected 206, is " + << last_msg_->amplitude_value[60]; + EXPECT_EQ(last_msg_->amplitude_value[61], 50) + << "incorrect value for amplitude_value[61], expected 50, is " + << last_msg_->amplitude_value[61]; + EXPECT_EQ(last_msg_->amplitude_value[62], 129) + << "incorrect value for amplitude_value[62], expected 129, is " + << last_msg_->amplitude_value[62]; + EXPECT_EQ(last_msg_->amplitude_value[63], 116) + << "incorrect value for amplitude_value[63], expected 116, is " + << last_msg_->amplitude_value[63]; + EXPECT_EQ(last_msg_->amplitude_value[64], 194) + << "incorrect value for amplitude_value[64], expected 194, is " + << last_msg_->amplitude_value[64]; + EXPECT_EQ(last_msg_->amplitude_value[65], 23) + << "incorrect value for amplitude_value[65], expected 23, is " + << last_msg_->amplitude_value[65]; + EXPECT_EQ(last_msg_->amplitude_value[66], 31) + << "incorrect value for amplitude_value[66], expected 31, is " + << last_msg_->amplitude_value[66]; + EXPECT_EQ(last_msg_->amplitude_value[67], 226) + << "incorrect value for amplitude_value[67], expected 226, is " + << last_msg_->amplitude_value[67]; + EXPECT_EQ(last_msg_->amplitude_value[68], 217) + << "incorrect value for amplitude_value[68], expected 217, is " + << last_msg_->amplitude_value[68]; + EXPECT_EQ(last_msg_->amplitude_value[69], 157) + << "incorrect value for amplitude_value[69], expected 157, is " + << last_msg_->amplitude_value[69]; + EXPECT_EQ(last_msg_->amplitude_value[70], 205) + << "incorrect value for amplitude_value[70], expected 205, is " + << last_msg_->amplitude_value[70]; + EXPECT_EQ(last_msg_->amplitude_value[71], 221) + << "incorrect value for amplitude_value[71], expected 221, is " + << last_msg_->amplitude_value[71]; + EXPECT_EQ(last_msg_->amplitude_value[72], 5) + << "incorrect value for amplitude_value[72], expected 5, is " + << last_msg_->amplitude_value[72]; + EXPECT_EQ(last_msg_->amplitude_value[73], 224) + << "incorrect value for amplitude_value[73], expected 224, is " + << last_msg_->amplitude_value[73]; + EXPECT_EQ(last_msg_->amplitude_value[74], 92) + << "incorrect value for amplitude_value[74], expected 92, is " + << last_msg_->amplitude_value[74]; + EXPECT_EQ(last_msg_->amplitude_value[75], 82) + << "incorrect value for amplitude_value[75], expected 82, is " + << last_msg_->amplitude_value[75]; + EXPECT_EQ(last_msg_->amplitude_value[76], 109) + << "incorrect value for amplitude_value[76], expected 109, is " + << last_msg_->amplitude_value[76]; + EXPECT_EQ(last_msg_->amplitude_value[77], 223) + << "incorrect value for amplitude_value[77], expected 223, is " + << last_msg_->amplitude_value[77]; + EXPECT_EQ(last_msg_->amplitude_value[78], 195) + << "incorrect value for amplitude_value[78], expected 195, is " + << last_msg_->amplitude_value[78]; + EXPECT_EQ(last_msg_->amplitude_value[79], 233) + << "incorrect value for amplitude_value[79], expected 233, is " + << last_msg_->amplitude_value[79]; + EXPECT_EQ(last_msg_->amplitude_value[80], 165) + << "incorrect value for amplitude_value[80], expected 165, is " + << last_msg_->amplitude_value[80]; + EXPECT_EQ(last_msg_->amplitude_value[81], 1) + << "incorrect value for amplitude_value[81], expected 1, is " + << last_msg_->amplitude_value[81]; + EXPECT_EQ(last_msg_->amplitude_value[82], 82) + << "incorrect value for amplitude_value[82], expected 82, is " + << last_msg_->amplitude_value[82]; + EXPECT_EQ(last_msg_->amplitude_value[83], 141) + << "incorrect value for amplitude_value[83], expected 141, is " + << last_msg_->amplitude_value[83]; + EXPECT_EQ(last_msg_->amplitude_value[84], 157) + << "incorrect value for amplitude_value[84], expected 157, is " + << last_msg_->amplitude_value[84]; + EXPECT_EQ(last_msg_->amplitude_value[85], 177) + << "incorrect value for amplitude_value[85], expected 177, is " + << last_msg_->amplitude_value[85]; + EXPECT_EQ(last_msg_->amplitude_value[86], 169) + << "incorrect value for amplitude_value[86], expected 169, is " + << last_msg_->amplitude_value[86]; + EXPECT_EQ(last_msg_->amplitude_value[87], 244) + << "incorrect value for amplitude_value[87], expected 244, is " + << last_msg_->amplitude_value[87]; + EXPECT_EQ(last_msg_->amplitude_value[88], 131) + << "incorrect value for amplitude_value[88], expected 131, is " + << last_msg_->amplitude_value[88]; + EXPECT_EQ(last_msg_->amplitude_value[89], 96) + << "incorrect value for amplitude_value[89], expected 96, is " + << last_msg_->amplitude_value[89]; + EXPECT_EQ(last_msg_->amplitude_value[90], 109) + << "incorrect value for amplitude_value[90], expected 109, is " + << last_msg_->amplitude_value[90]; + EXPECT_EQ(last_msg_->amplitude_value[91], 111) + << "incorrect value for amplitude_value[91], expected 111, is " + << last_msg_->amplitude_value[91]; + EXPECT_EQ(last_msg_->amplitude_value[92], 253) + << "incorrect value for amplitude_value[92], expected 253, is " + << last_msg_->amplitude_value[92]; + EXPECT_EQ(last_msg_->amplitude_value[93], 149) + << "incorrect value for amplitude_value[93], expected 149, is " + << last_msg_->amplitude_value[93]; + EXPECT_EQ(last_msg_->amplitude_value[94], 28) + << "incorrect value for amplitude_value[94], expected 28, is " + << last_msg_->amplitude_value[94]; + EXPECT_EQ(last_msg_->amplitude_value[95], 225) + << "incorrect value for amplitude_value[95], expected 225, is " + << last_msg_->amplitude_value[95]; + EXPECT_EQ(last_msg_->amplitude_value[96], 225) + << "incorrect value for amplitude_value[96], expected 225, is " + << last_msg_->amplitude_value[96]; + EXPECT_EQ(last_msg_->amplitude_value[97], 72) + << "incorrect value for amplitude_value[97], expected 72, is " + << last_msg_->amplitude_value[97]; + EXPECT_EQ(last_msg_->amplitude_value[98], 158) + << "incorrect value for amplitude_value[98], expected 158, is " + << last_msg_->amplitude_value[98]; + EXPECT_EQ(last_msg_->amplitude_value[99], 158) + << "incorrect value for amplitude_value[99], expected 158, is " + << last_msg_->amplitude_value[99]; + EXPECT_EQ(last_msg_->amplitude_value[100], 210) + << "incorrect value for amplitude_value[100], expected 210, is " + << last_msg_->amplitude_value[100]; + EXPECT_EQ(last_msg_->amplitude_value[101], 196) + << "incorrect value for amplitude_value[101], expected 196, is " + << last_msg_->amplitude_value[101]; + EXPECT_EQ(last_msg_->amplitude_value[102], 206) + << "incorrect value for amplitude_value[102], expected 206, is " + << last_msg_->amplitude_value[102]; + EXPECT_EQ(last_msg_->amplitude_value[103], 70) + << "incorrect value for amplitude_value[103], expected 70, is " + << last_msg_->amplitude_value[103]; + EXPECT_EQ(last_msg_->amplitude_value[104], 63) + << "incorrect value for amplitude_value[104], expected 63, is " + << last_msg_->amplitude_value[104]; + EXPECT_EQ(last_msg_->amplitude_value[105], 225) + << "incorrect value for amplitude_value[105], expected 225, is " + << last_msg_->amplitude_value[105]; + EXPECT_EQ(last_msg_->amplitude_value[106], 184) + << "incorrect value for amplitude_value[106], expected 184, is " + << last_msg_->amplitude_value[106]; + EXPECT_EQ(last_msg_->amplitude_value[107], 150) + << "incorrect value for amplitude_value[107], expected 150, is " + << last_msg_->amplitude_value[107]; + EXPECT_EQ(last_msg_->amplitude_value[108], 174) + << "incorrect value for amplitude_value[108], expected 174, is " + << last_msg_->amplitude_value[108]; + EXPECT_EQ(last_msg_->amplitude_value[109], 240) + << "incorrect value for amplitude_value[109], expected 240, is " + << last_msg_->amplitude_value[109]; + EXPECT_EQ(last_msg_->amplitude_value[110], 45) + << "incorrect value for amplitude_value[110], expected 45, is " + << last_msg_->amplitude_value[110]; + EXPECT_EQ(last_msg_->amplitude_value[111], 146) + << "incorrect value for amplitude_value[111], expected 146, is " + << last_msg_->amplitude_value[111]; + EXPECT_EQ(last_msg_->amplitude_value[112], 59) + << "incorrect value for amplitude_value[112], expected 59, is " + << last_msg_->amplitude_value[112]; + EXPECT_EQ(last_msg_->amplitude_value[113], 82) + << "incorrect value for amplitude_value[113], expected 82, is " + << last_msg_->amplitude_value[113]; + EXPECT_EQ(last_msg_->amplitude_value[114], 194) + << "incorrect value for amplitude_value[114], expected 194, is " + << last_msg_->amplitude_value[114]; + EXPECT_EQ(last_msg_->amplitude_value[115], 4) + << "incorrect value for amplitude_value[115], expected 4, is " + << last_msg_->amplitude_value[115]; + EXPECT_EQ(last_msg_->amplitude_value[116], 179) + << "incorrect value for amplitude_value[116], expected 179, is " + << last_msg_->amplitude_value[116]; + EXPECT_EQ(last_msg_->amplitude_value[117], 148) + << "incorrect value for amplitude_value[117], expected 148, is " + << last_msg_->amplitude_value[117]; + EXPECT_EQ(last_msg_->amplitude_value[118], 66) + << "incorrect value for amplitude_value[118], expected 66, is " + << last_msg_->amplitude_value[118]; + EXPECT_EQ(last_msg_->amplitude_value[119], 254) + << "incorrect value for amplitude_value[119], expected 254, is " + << last_msg_->amplitude_value[119]; + EXPECT_EQ(last_msg_->amplitude_value[120], 115) + << "incorrect value for amplitude_value[120], expected 115, is " + << last_msg_->amplitude_value[120]; + EXPECT_EQ(last_msg_->amplitude_value[121], 77) + << "incorrect value for amplitude_value[121], expected 77, is " + << last_msg_->amplitude_value[121]; + EXPECT_EQ(last_msg_->amplitude_value[122], 30) + << "incorrect value for amplitude_value[122], expected 30, is " + << last_msg_->amplitude_value[122]; + EXPECT_EQ(last_msg_->amplitude_value[123], 46) + << "incorrect value for amplitude_value[123], expected 46, is " + << last_msg_->amplitude_value[123]; + EXPECT_EQ(last_msg_->amplitude_value[124], 4) + << "incorrect value for amplitude_value[124], expected 4, is " + << last_msg_->amplitude_value[124]; + EXPECT_EQ(last_msg_->amplitude_value[125], 204) + << "incorrect value for amplitude_value[125], expected 204, is " + << last_msg_->amplitude_value[125]; + EXPECT_EQ(last_msg_->amplitude_value[126], 37) + << "incorrect value for amplitude_value[126], expected 37, is " + << last_msg_->amplitude_value[126]; + EXPECT_EQ(last_msg_->amplitude_value[127], 200) + << "incorrect value for amplitude_value[127], expected 200, is " + << last_msg_->amplitude_value[127]; + EXPECT_EQ(last_msg_->amplitude_value[128], 121) + << "incorrect value for amplitude_value[128], expected 121, is " + << last_msg_->amplitude_value[128]; + EXPECT_EQ(last_msg_->amplitude_value[129], 18) + << "incorrect value for amplitude_value[129], expected 18, is " + << last_msg_->amplitude_value[129]; + EXPECT_EQ(last_msg_->amplitude_value[130], 17) + << "incorrect value for amplitude_value[130], expected 17, is " + << last_msg_->amplitude_value[130]; + EXPECT_EQ(last_msg_->amplitude_value[131], 171) + << "incorrect value for amplitude_value[131], expected 171, is " + << last_msg_->amplitude_value[131]; + EXPECT_EQ(last_msg_->amplitude_value[132], 102) + << "incorrect value for amplitude_value[132], expected 102, is " + << last_msg_->amplitude_value[132]; + EXPECT_EQ(last_msg_->amplitude_value[133], 163) + << "incorrect value for amplitude_value[133], expected 163, is " + << last_msg_->amplitude_value[133]; + EXPECT_EQ(last_msg_->amplitude_value[134], 175) + << "incorrect value for amplitude_value[134], expected 175, is " + << last_msg_->amplitude_value[134]; + EXPECT_EQ(last_msg_->amplitude_value[135], 50) + << "incorrect value for amplitude_value[135], expected 50, is " + << last_msg_->amplitude_value[135]; + EXPECT_EQ(last_msg_->amplitude_value[136], 66) + << "incorrect value for amplitude_value[136], expected 66, is " + << last_msg_->amplitude_value[136]; + EXPECT_EQ(last_msg_->amplitude_value[137], 101) + << "incorrect value for amplitude_value[137], expected 101, is " + << last_msg_->amplitude_value[137]; + EXPECT_EQ(last_msg_->amplitude_value[138], 69) + << "incorrect value for amplitude_value[138], expected 69, is " + << last_msg_->amplitude_value[138]; + EXPECT_EQ(last_msg_->amplitude_value[139], 13) + << "incorrect value for amplitude_value[139], expected 13, is " + << last_msg_->amplitude_value[139]; + EXPECT_EQ(last_msg_->amplitude_value[140], 223) + << "incorrect value for amplitude_value[140], expected 223, is " + << last_msg_->amplitude_value[140]; + EXPECT_EQ(last_msg_->amplitude_value[141], 172) + << "incorrect value for amplitude_value[141], expected 172, is " + << last_msg_->amplitude_value[141]; + EXPECT_EQ(last_msg_->amplitude_value[142], 160) + << "incorrect value for amplitude_value[142], expected 160, is " + << last_msg_->amplitude_value[142]; + EXPECT_EQ(last_msg_->amplitude_value[143], 233) + << "incorrect value for amplitude_value[143], expected 233, is " + << last_msg_->amplitude_value[143]; + EXPECT_EQ(last_msg_->amplitude_value[144], 220) + << "incorrect value for amplitude_value[144], expected 220, is " + << last_msg_->amplitude_value[144]; + EXPECT_EQ(last_msg_->amplitude_value[145], 101) + << "incorrect value for amplitude_value[145], expected 101, is " + << last_msg_->amplitude_value[145]; + EXPECT_EQ(last_msg_->amplitude_value[146], 237) + << "incorrect value for amplitude_value[146], expected 237, is " + << last_msg_->amplitude_value[146]; + EXPECT_EQ(last_msg_->amplitude_value[147], 156) + << "incorrect value for amplitude_value[147], expected 156, is " + << last_msg_->amplitude_value[147]; + EXPECT_EQ(last_msg_->amplitude_value[148], 62) + << "incorrect value for amplitude_value[148], expected 62, is " + << last_msg_->amplitude_value[148]; + EXPECT_EQ(last_msg_->amplitude_value[149], 117) + << "incorrect value for amplitude_value[149], expected 117, is " + << last_msg_->amplitude_value[149]; + EXPECT_EQ(last_msg_->amplitude_value[150], 47) + << "incorrect value for amplitude_value[150], expected 47, is " + << last_msg_->amplitude_value[150]; + EXPECT_EQ(last_msg_->amplitude_value[151], 143) + << "incorrect value for amplitude_value[151], expected 143, is " + << last_msg_->amplitude_value[151]; + EXPECT_EQ(last_msg_->amplitude_value[152], 94) + << "incorrect value for amplitude_value[152], expected 94, is " + << last_msg_->amplitude_value[152]; + EXPECT_EQ(last_msg_->amplitude_value[153], 135) + << "incorrect value for amplitude_value[153], expected 135, is " + << last_msg_->amplitude_value[153]; + EXPECT_EQ(last_msg_->amplitude_value[154], 22) + << "incorrect value for amplitude_value[154], expected 22, is " + << last_msg_->amplitude_value[154]; + EXPECT_EQ(last_msg_->amplitude_value[155], 155) + << "incorrect value for amplitude_value[155], expected 155, is " + << last_msg_->amplitude_value[155]; + EXPECT_EQ(last_msg_->amplitude_value[156], 113) + << "incorrect value for amplitude_value[156], expected 113, is " + << last_msg_->amplitude_value[156]; + EXPECT_EQ(last_msg_->amplitude_value[157], 110) + << "incorrect value for amplitude_value[157], expected 110, is " + << last_msg_->amplitude_value[157]; + EXPECT_EQ(last_msg_->amplitude_value[158], 15) + << "incorrect value for amplitude_value[158], expected 15, is " + << last_msg_->amplitude_value[158]; + EXPECT_EQ(last_msg_->amplitude_value[159], 243) + << "incorrect value for amplitude_value[159], expected 243, is " + << last_msg_->amplitude_value[159]; + EXPECT_EQ(last_msg_->amplitude_value[160], 141) + << "incorrect value for amplitude_value[160], expected 141, is " + << last_msg_->amplitude_value[160]; + EXPECT_EQ(last_msg_->amplitude_value[161], 227) + << "incorrect value for amplitude_value[161], expected 227, is " + << last_msg_->amplitude_value[161]; + EXPECT_EQ(last_msg_->amplitude_value[162], 46) + << "incorrect value for amplitude_value[162], expected 46, is " + << last_msg_->amplitude_value[162]; + EXPECT_EQ(last_msg_->amplitude_value[163], 143) + << "incorrect value for amplitude_value[163], expected 143, is " + << last_msg_->amplitude_value[163]; + EXPECT_EQ(last_msg_->amplitude_value[164], 227) + << "incorrect value for amplitude_value[164], expected 227, is " + << last_msg_->amplitude_value[164]; + EXPECT_EQ(last_msg_->amplitude_value[165], 209) + << "incorrect value for amplitude_value[165], expected 209, is " + << last_msg_->amplitude_value[165]; + EXPECT_EQ(last_msg_->amplitude_value[166], 249) + << "incorrect value for amplitude_value[166], expected 249, is " + << last_msg_->amplitude_value[166]; + EXPECT_EQ(last_msg_->amplitude_value[167], 2) + << "incorrect value for amplitude_value[167], expected 2, is " + << last_msg_->amplitude_value[167]; + EXPECT_EQ(last_msg_->amplitude_value[168], 153) + << "incorrect value for amplitude_value[168], expected 153, is " + << last_msg_->amplitude_value[168]; + EXPECT_EQ(last_msg_->amplitude_value[169], 168) + << "incorrect value for amplitude_value[169], expected 168, is " + << last_msg_->amplitude_value[169]; + EXPECT_EQ(last_msg_->amplitude_value[170], 131) + << "incorrect value for amplitude_value[170], expected 131, is " + << last_msg_->amplitude_value[170]; + EXPECT_EQ(last_msg_->amplitude_value[171], 249) + << "incorrect value for amplitude_value[171], expected 249, is " + << last_msg_->amplitude_value[171]; + EXPECT_EQ(last_msg_->amplitude_value[172], 160) + << "incorrect value for amplitude_value[172], expected 160, is " + << last_msg_->amplitude_value[172]; + EXPECT_EQ(last_msg_->amplitude_value[173], 88) + << "incorrect value for amplitude_value[173], expected 88, is " + << last_msg_->amplitude_value[173]; + EXPECT_EQ(last_msg_->amplitude_value[174], 38) + << "incorrect value for amplitude_value[174], expected 38, is " + << last_msg_->amplitude_value[174]; + EXPECT_EQ(last_msg_->amplitude_value[175], 117) + << "incorrect value for amplitude_value[175], expected 117, is " + << last_msg_->amplitude_value[175]; + EXPECT_EQ(last_msg_->amplitude_value[176], 129) + << "incorrect value for amplitude_value[176], expected 129, is " + << last_msg_->amplitude_value[176]; + EXPECT_EQ(last_msg_->amplitude_value[177], 57) + << "incorrect value for amplitude_value[177], expected 57, is " + << last_msg_->amplitude_value[177]; + EXPECT_EQ(last_msg_->amplitude_value[178], 40) + << "incorrect value for amplitude_value[178], expected 40, is " + << last_msg_->amplitude_value[178]; + EXPECT_EQ(last_msg_->amplitude_value[179], 109) + << "incorrect value for amplitude_value[179], expected 109, is " + << last_msg_->amplitude_value[179]; + EXPECT_EQ(last_msg_->amplitude_value[180], 209) + << "incorrect value for amplitude_value[180], expected 209, is " + << last_msg_->amplitude_value[180]; + EXPECT_EQ(last_msg_->amplitude_value[181], 177) + << "incorrect value for amplitude_value[181], expected 177, is " + << last_msg_->amplitude_value[181]; + EXPECT_EQ(last_msg_->amplitude_value[182], 38) + << "incorrect value for amplitude_value[182], expected 38, is " + << last_msg_->amplitude_value[182]; + EXPECT_EQ(last_msg_->amplitude_value[183], 47) + << "incorrect value for amplitude_value[183], expected 47, is " + << last_msg_->amplitude_value[183]; + EXPECT_EQ(last_msg_->amplitude_value[184], 12) + << "incorrect value for amplitude_value[184], expected 12, is " + << last_msg_->amplitude_value[184]; + EXPECT_EQ(last_msg_->amplitude_value[185], 15) + << "incorrect value for amplitude_value[185], expected 15, is " + << last_msg_->amplitude_value[185]; + EXPECT_EQ(last_msg_->amplitude_value[186], 16) + << "incorrect value for amplitude_value[186], expected 16, is " + << last_msg_->amplitude_value[186]; + EXPECT_EQ(last_msg_->amplitude_value[187], 9) + << "incorrect value for amplitude_value[187], expected 9, is " + << last_msg_->amplitude_value[187]; + EXPECT_EQ(last_msg_->amplitude_value[188], 175) + << "incorrect value for amplitude_value[188], expected 175, is " + << last_msg_->amplitude_value[188]; + EXPECT_EQ(last_msg_->amplitude_value[189], 69) + << "incorrect value for amplitude_value[189], expected 69, is " + << last_msg_->amplitude_value[189]; + EXPECT_EQ(last_msg_->amplitude_value[190], 70) + << "incorrect value for amplitude_value[190], expected 70, is " + << last_msg_->amplitude_value[190]; + EXPECT_EQ(last_msg_->amplitude_value[191], 182) + << "incorrect value for amplitude_value[191], expected 182, is " + << last_msg_->amplitude_value[191]; + EXPECT_EQ(last_msg_->amplitude_value[192], 239) + << "incorrect value for amplitude_value[192], expected 239, is " + << last_msg_->amplitude_value[192]; + EXPECT_EQ(last_msg_->amplitude_value[193], 117) + << "incorrect value for amplitude_value[193], expected 117, is " + << last_msg_->amplitude_value[193]; + EXPECT_EQ(last_msg_->amplitude_value[194], 135) + << "incorrect value for amplitude_value[194], expected 135, is " + << last_msg_->amplitude_value[194]; + EXPECT_EQ(last_msg_->amplitude_value[195], 6) + << "incorrect value for amplitude_value[195], expected 6, is " + << last_msg_->amplitude_value[195]; + EXPECT_EQ(last_msg_->amplitude_value[196], 71) + << "incorrect value for amplitude_value[196], expected 71, is " + << last_msg_->amplitude_value[196]; + EXPECT_EQ(last_msg_->amplitude_value[197], 99) + << "incorrect value for amplitude_value[197], expected 99, is " + << last_msg_->amplitude_value[197]; + EXPECT_EQ(last_msg_->amplitude_value[198], 230) + << "incorrect value for amplitude_value[198], expected 230, is " + << last_msg_->amplitude_value[198]; + EXPECT_EQ(last_msg_->amplitude_value[199], 115) + << "incorrect value for amplitude_value[199], expected 115, is " + << last_msg_->amplitude_value[199]; + EXPECT_EQ(last_msg_->amplitude_value[200], 2) + << "incorrect value for amplitude_value[200], expected 2, is " + << last_msg_->amplitude_value[200]; + EXPECT_EQ(last_msg_->amplitude_value[201], 71) + << "incorrect value for amplitude_value[201], expected 71, is " + << last_msg_->amplitude_value[201]; + EXPECT_EQ(last_msg_->amplitude_value[202], 165) + << "incorrect value for amplitude_value[202], expected 165, is " + << last_msg_->amplitude_value[202]; + EXPECT_EQ(last_msg_->amplitude_value[203], 228) + << "incorrect value for amplitude_value[203], expected 228, is " + << last_msg_->amplitude_value[203]; + EXPECT_EQ(last_msg_->amplitude_value[204], 123) + << "incorrect value for amplitude_value[204], expected 123, is " + << last_msg_->amplitude_value[204]; + EXPECT_EQ(last_msg_->amplitude_value[205], 210) + << "incorrect value for amplitude_value[205], expected 210, is " + << last_msg_->amplitude_value[205]; + EXPECT_EQ(last_msg_->amplitude_value[206], 168) + << "incorrect value for amplitude_value[206], expected 168, is " + << last_msg_->amplitude_value[206]; + EXPECT_EQ(last_msg_->amplitude_value[207], 90) + << "incorrect value for amplitude_value[207], expected 90, is " + << last_msg_->amplitude_value[207]; + EXPECT_EQ(last_msg_->amplitude_value[208], 124) + << "incorrect value for amplitude_value[208], expected 124, is " + << last_msg_->amplitude_value[208]; + EXPECT_EQ(last_msg_->amplitude_value[209], 20) + << "incorrect value for amplitude_value[209], expected 20, is " + << last_msg_->amplitude_value[209]; + EXPECT_EQ(last_msg_->amplitude_value[210], 7) + << "incorrect value for amplitude_value[210], expected 7, is " + << last_msg_->amplitude_value[210]; + EXPECT_EQ(last_msg_->amplitude_value[211], 220) + << "incorrect value for amplitude_value[211], expected 220, is " + << last_msg_->amplitude_value[211]; + EXPECT_EQ(last_msg_->amplitude_value[212], 144) + << "incorrect value for amplitude_value[212], expected 144, is " + << last_msg_->amplitude_value[212]; + EXPECT_EQ(last_msg_->amplitude_value[213], 168) + << "incorrect value for amplitude_value[213], expected 168, is " + << last_msg_->amplitude_value[213]; + EXPECT_EQ(last_msg_->amplitude_value[214], 69) + << "incorrect value for amplitude_value[214], expected 69, is " + << last_msg_->amplitude_value[214]; + EXPECT_EQ(last_msg_->amplitude_value[215], 22) + << "incorrect value for amplitude_value[215], expected 22, is " + << last_msg_->amplitude_value[215]; + EXPECT_EQ(last_msg_->amplitude_value[216], 72) + << "incorrect value for amplitude_value[216], expected 72, is " + << last_msg_->amplitude_value[216]; + EXPECT_EQ(last_msg_->amplitude_value[217], 162) + << "incorrect value for amplitude_value[217], expected 162, is " + << last_msg_->amplitude_value[217]; + EXPECT_EQ(last_msg_->amplitude_value[218], 69) + << "incorrect value for amplitude_value[218], expected 69, is " + << last_msg_->amplitude_value[218]; + EXPECT_EQ(last_msg_->amplitude_value[219], 111) + << "incorrect value for amplitude_value[219], expected 111, is " + << last_msg_->amplitude_value[219]; + EXPECT_EQ(last_msg_->amplitude_value[220], 91) + << "incorrect value for amplitude_value[220], expected 91, is " + << last_msg_->amplitude_value[220]; + EXPECT_EQ(last_msg_->amplitude_value[221], 251) + << "incorrect value for amplitude_value[221], expected 251, is " + << last_msg_->amplitude_value[221]; + EXPECT_EQ(last_msg_->amplitude_value[222], 72) + << "incorrect value for amplitude_value[222], expected 72, is " + << last_msg_->amplitude_value[222]; + EXPECT_EQ(last_msg_->amplitude_value[223], 220) + << "incorrect value for amplitude_value[223], expected 220, is " + << last_msg_->amplitude_value[223]; + EXPECT_EQ(last_msg_->amplitude_value[224], 28) + << "incorrect value for amplitude_value[224], expected 28, is " + << last_msg_->amplitude_value[224]; + EXPECT_EQ(last_msg_->amplitude_value[225], 119) + << "incorrect value for amplitude_value[225], expected 119, is " + << last_msg_->amplitude_value[225]; + EXPECT_EQ(last_msg_->amplitude_value[226], 150) + << "incorrect value for amplitude_value[226], expected 150, is " + << last_msg_->amplitude_value[226]; + EXPECT_EQ(last_msg_->channel_tag, 35146) + << "incorrect value for channel_tag, expected 35146, is " + << last_msg_->channel_tag; + EXPECT_LT((last_msg_->freq_ref * 100 - 7737.20019531 * 100), 0.05) + << "incorrect value for freq_ref, expected 7737.20019531, is " + << last_msg_->freq_ref; + EXPECT_LT((last_msg_->freq_step * 100 - 8226.20019531 * 100), 0.05) + << "incorrect value for freq_step, expected 8226.20019531, is " + << last_msg_->freq_step; + EXPECT_EQ(last_msg_->t.ns_residual, -1479025396) + << "incorrect value for t.ns_residual, expected -1479025396, is " + << last_msg_->t.ns_residual; + EXPECT_EQ(last_msg_->t.tow, 1227027783) + << "incorrect value for t.tow, expected 1227027783, is " + << last_msg_->t.tow; + EXPECT_EQ(last_msg_->t.wn, 5075) + << "incorrect value for t.wn, expected 5075, is " << last_msg_->t.wn; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgSpecanDep.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgSpecanDep.cc index 322d78a86..c7b16c6e0 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgSpecanDep.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgSpecanDep.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecanDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgSpecanDep.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgSpecanDep0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgSpecanDep0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgSpecanDep0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgSpecanDep0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_specan_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_specan_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,1433 +81,2156 @@ class Test_legacy_auto_check_sbp_piksi_MsgSpecanDep0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_specan_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgSpecanDep0, Test) -{ +}; - uint8_t encoded_frame[] = {85,80,0,112,217,255,246,22,221,56,37,59,45,27,154,97,198,69,154,1,144,69,205,20,18,70,51,211,89,69,240,14,179,186,227,244,173,240,182,71,166,117,196,13,44,27,33,28,67,254,3,249,92,44,122,169,77,186,68,135,63,168,162,89,36,186,99,63,105,116,216,44,67,212,156,75,81,53,250,225,23,205,26,34,119,50,101,64,7,231,124,183,203,102,234,84,83,208,23,68,54,179,98,96,116,244,246,94,104,94,13,56,210,18,191,22,133,81,153,159,161,219,59,21,164,121,145,203,171,132,57,180,102,101,11,229,175,145,73,72,124,4,184,228,61,234,218,62,226,217,193,7,109,44,83,201,20,101,9,140,186,162,81,91,30,231,161,81,216,114,60,231,163,163,49,237,244,185,240,89,143,174,165,211,241,13,16,61,141,101,89,37,117,189,86,118,176,228,12,14,119,135,129,243,50,29,207,198,117,100,225,6,139,110,39,210,68,199,43,132,64,17,51,173,181,12,140,16,247,84,183,105,39,157,77,30,205,194,59,64,241,183,238,105,181,170,45,8,166,164,238,83,148,173,108,228,67,89,189,67,26,39,216, }; +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgSpecanDep0, Test) { + uint8_t encoded_frame[] = { + 85, 80, 0, 112, 217, 255, 246, 22, 221, 56, 37, 59, 45, 27, 154, + 97, 198, 69, 154, 1, 144, 69, 205, 20, 18, 70, 51, 211, 89, 69, + 240, 14, 179, 186, 227, 244, 173, 240, 182, 71, 166, 117, 196, 13, 44, + 27, 33, 28, 67, 254, 3, 249, 92, 44, 122, 169, 77, 186, 68, 135, + 63, 168, 162, 89, 36, 186, 99, 63, 105, 116, 216, 44, 67, 212, 156, + 75, 81, 53, 250, 225, 23, 205, 26, 34, 119, 50, 101, 64, 7, 231, + 124, 183, 203, 102, 234, 84, 83, 208, 23, 68, 54, 179, 98, 96, 116, + 244, 246, 94, 104, 94, 13, 56, 210, 18, 191, 22, 133, 81, 153, 159, + 161, 219, 59, 21, 164, 121, 145, 203, 171, 132, 57, 180, 102, 101, 11, + 229, 175, 145, 73, 72, 124, 4, 184, 228, 61, 234, 218, 62, 226, 217, + 193, 7, 109, 44, 83, 201, 20, 101, 9, 140, 186, 162, 81, 91, 30, + 231, 161, 81, 216, 114, 60, 231, 163, 163, 49, 237, 244, 185, 240, 89, + 143, 174, 165, 211, 241, 13, 16, 61, 141, 101, 89, 37, 117, 189, 86, + 118, 176, 228, 12, 14, 119, 135, 129, 243, 50, 29, 207, 198, 117, 100, + 225, 6, 139, 110, 39, 210, 68, 199, 43, 132, 64, 17, 51, 173, 181, + 12, 140, 16, 247, 84, 183, 105, 39, 157, 77, 30, 205, 194, 59, 64, + 241, 183, 238, 105, 181, 170, 45, 8, 166, 164, 238, 83, 148, 173, 108, + 228, 67, 89, 189, 67, 26, 39, 216, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_specan_dep_t* test_msg = ( msg_specan_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->amplitude_ref = 9349.2001953125; - test_msg->amplitude_unit = 3485.199951171875; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[0] = 240; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[1] = 14; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[2] = 179; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[3] = 186; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[4] = 227; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[5] = 244; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[6] = 173; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[7] = 240; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[8] = 182; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[9] = 71; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[10] = 166; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[11] = 117; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[12] = 196; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[13] = 13; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[14] = 44; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[15] = 27; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[16] = 33; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[17] = 28; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[18] = 67; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[19] = 254; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[20] = 3; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[21] = 249; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[22] = 92; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[23] = 44; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[24] = 122; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[25] = 169; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[26] = 77; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[27] = 186; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[28] = 68; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[29] = 135; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[30] = 63; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[31] = 168; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[32] = 162; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[33] = 89; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[34] = 36; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[35] = 186; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[36] = 99; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[37] = 63; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[38] = 105; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[39] = 116; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[40] = 216; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[41] = 44; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[42] = 67; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[43] = 212; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[44] = 156; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[45] = 75; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[46] = 81; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[47] = 53; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[48] = 250; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[49] = 225; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[50] = 23; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[51] = 205; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[52] = 26; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[53] = 34; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[54] = 119; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[55] = 50; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[56] = 101; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[57] = 64; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[58] = 7; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[59] = 231; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[60] = 124; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[61] = 183; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[62] = 203; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[63] = 102; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[64] = 234; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[65] = 84; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[66] = 83; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[67] = 208; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[68] = 23; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[69] = 68; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[70] = 54; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[71] = 179; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[72] = 98; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[73] = 96; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[74] = 116; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[75] = 244; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[76] = 246; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[77] = 94; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[78] = 104; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[79] = 94; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[80] = 13; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[81] = 56; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[82] = 210; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[83] = 18; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[84] = 191; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[85] = 22; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[86] = 133; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[87] = 81; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[88] = 153; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[89] = 159; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[90] = 161; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[91] = 219; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[92] = 59; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[93] = 21; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[94] = 164; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[95] = 121; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[96] = 145; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[97] = 203; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[98] = 171; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[99] = 132; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[100] = 57; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[101] = 180; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[102] = 102; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[103] = 101; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[104] = 11; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[105] = 229; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[106] = 175; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[107] = 145; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[108] = 73; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[109] = 72; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[110] = 124; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[111] = 4; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[112] = 184; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[113] = 228; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[114] = 61; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[115] = 234; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[116] = 218; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[117] = 62; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[118] = 226; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[119] = 217; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[120] = 193; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[121] = 7; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[122] = 109; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[123] = 44; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[124] = 83; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[125] = 201; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[126] = 20; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[127] = 101; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[128] = 9; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[129] = 140; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[130] = 186; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[131] = 162; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[132] = 81; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[133] = 91; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[134] = 30; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[135] = 231; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[136] = 161; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[137] = 81; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[138] = 216; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[139] = 114; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[140] = 60; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[141] = 231; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[142] = 163; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[143] = 163; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[144] = 49; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[145] = 237; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[146] = 244; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[147] = 185; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[148] = 240; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[149] = 89; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[150] = 143; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[151] = 174; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[152] = 165; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[153] = 211; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[154] = 241; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[155] = 13; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[156] = 16; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[157] = 61; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[158] = 141; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[159] = 101; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[160] = 89; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[161] = 37; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[162] = 117; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[163] = 189; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[164] = 86; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[165] = 118; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[166] = 176; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[167] = 228; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[168] = 12; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[169] = 14; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[170] = 119; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[171] = 135; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[172] = 129; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[173] = 243; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[174] = 50; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[175] = 29; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[176] = 207; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[177] = 198; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[178] = 117; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[179] = 100; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[180] = 225; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[181] = 6; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[182] = 139; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[183] = 110; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[184] = 39; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[185] = 210; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[186] = 68; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[187] = 199; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[188] = 43; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[189] = 132; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[190] = 64; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[191] = 17; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[192] = 51; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[193] = 173; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[194] = 181; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[195] = 12; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[196] = 140; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[197] = 16; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[198] = 247; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[199] = 84; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[200] = 183; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[201] = 105; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[202] = 39; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[203] = 157; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[204] = 77; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[205] = 30; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[206] = 205; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[207] = 194; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[208] = 59; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[209] = 64; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[210] = 241; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[211] = 183; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[212] = 238; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[213] = 105; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[214] = 181; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[215] = 170; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[216] = 45; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[217] = 8; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[218] = 166; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[219] = 164; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[220] = 238; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[221] = 83; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[222] = 148; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[223] = 173; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[224] = 108; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[225] = 228; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[226] = 67; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[227] = 89; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[228] = 189; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[229] = 67; - if (sizeof(test_msg->amplitude_value) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); - } - test_msg->amplitude_value[230] = 26; - test_msg->channel_tag = 5878; - test_msg->freq_ref = 6348.2001953125; - test_msg->freq_step = 4608.2001953125; - test_msg->t.tow = 992295133; - test_msg->t.wn = 6957; - - EXPECT_EQ(send_message( 0x50, 55664, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_specan_dep_t *test_msg = (msg_specan_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->amplitude_ref = 9349.2001953125; + test_msg->amplitude_unit = 3485.199951171875; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[0] = 240; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[1] = 14; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[2] = 179; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[3] = 186; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[4] = 227; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[5] = 244; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[6] = 173; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[7] = 240; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[8] = 182; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[9] = 71; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[10] = 166; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[11] = 117; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[12] = 196; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[13] = 13; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[14] = 44; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[15] = 27; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[16] = 33; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[17] = 28; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[18] = 67; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[19] = 254; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[20] = 3; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[21] = 249; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[22] = 92; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[23] = 44; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[24] = 122; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[25] = 169; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[26] = 77; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[27] = 186; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[28] = 68; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[29] = 135; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[30] = 63; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[31] = 168; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[32] = 162; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[33] = 89; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[34] = 36; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[35] = 186; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[36] = 99; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[37] = 63; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[38] = 105; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[39] = 116; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[40] = 216; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[41] = 44; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[42] = 67; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[43] = 212; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[44] = 156; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[45] = 75; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[46] = 81; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[47] = 53; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[48] = 250; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[49] = 225; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[50] = 23; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[51] = 205; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[52] = 26; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[53] = 34; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[54] = 119; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[55] = 50; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[56] = 101; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[57] = 64; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[58] = 7; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[59] = 231; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[60] = 124; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[61] = 183; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[62] = 203; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[63] = 102; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[64] = 234; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[65] = 84; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[66] = 83; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[67] = 208; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[68] = 23; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[69] = 68; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[70] = 54; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[71] = 179; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[72] = 98; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[73] = 96; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[74] = 116; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[75] = 244; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[76] = 246; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[77] = 94; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[78] = 104; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[79] = 94; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[80] = 13; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[81] = 56; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[82] = 210; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[83] = 18; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[84] = 191; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[85] = 22; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[86] = 133; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[87] = 81; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[88] = 153; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[89] = 159; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[90] = 161; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[91] = 219; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[92] = 59; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[93] = 21; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[94] = 164; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[95] = 121; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[96] = 145; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[97] = 203; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[98] = 171; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[99] = 132; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[100] = 57; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[101] = 180; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[102] = 102; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[103] = 101; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[104] = 11; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[105] = 229; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[106] = 175; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[107] = 145; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[108] = 73; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[109] = 72; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[110] = 124; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[111] = 4; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[112] = 184; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[113] = 228; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[114] = 61; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[115] = 234; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[116] = 218; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[117] = 62; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[118] = 226; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[119] = 217; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[120] = 193; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[121] = 7; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[122] = 109; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[123] = 44; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[124] = 83; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[125] = 201; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[126] = 20; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[127] = 101; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[128] = 9; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[129] = 140; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[130] = 186; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[131] = 162; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[132] = 81; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[133] = 91; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[134] = 30; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[135] = 231; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[136] = 161; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[137] = 81; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[138] = 216; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[139] = 114; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[140] = 60; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[141] = 231; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[142] = 163; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[143] = 163; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[144] = 49; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[145] = 237; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[146] = 244; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[147] = 185; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[148] = 240; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[149] = 89; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[150] = 143; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[151] = 174; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[152] = 165; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[153] = 211; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[154] = 241; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[155] = 13; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[156] = 16; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[157] = 61; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[158] = 141; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[159] = 101; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[160] = 89; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[161] = 37; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[162] = 117; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[163] = 189; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[164] = 86; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[165] = 118; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[166] = 176; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[167] = 228; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[168] = 12; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[169] = 14; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[170] = 119; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[171] = 135; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[172] = 129; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[173] = 243; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[174] = 50; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[175] = 29; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[176] = 207; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[177] = 198; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[178] = 117; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[179] = 100; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[180] = 225; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[181] = 6; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[182] = 139; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[183] = 110; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[184] = 39; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[185] = 210; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[186] = 68; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[187] = 199; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[188] = 43; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[189] = 132; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[190] = 64; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[191] = 17; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[192] = 51; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[193] = 173; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[194] = 181; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[195] = 12; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[196] = 140; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[197] = 16; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[198] = 247; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[199] = 84; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[200] = 183; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[201] = 105; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[202] = 39; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[203] = 157; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[204] = 77; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[205] = 30; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[206] = 205; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[207] = 194; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[208] = 59; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[209] = 64; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[210] = 241; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[211] = 183; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[212] = 238; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[213] = 105; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[214] = 181; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[215] = 170; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[216] = 45; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[217] = 8; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[218] = 166; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[219] = 164; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[220] = 238; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[221] = 83; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[222] = 148; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[223] = 173; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[224] = 108; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[225] = 228; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[226] = 67; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[227] = 89; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[228] = 189; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[229] = 67; + if (sizeof(test_msg->amplitude_value) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->amplitude_value[0])); + } + test_msg->amplitude_value[230] = 26; + test_msg->channel_tag = 5878; + test_msg->freq_ref = 6348.2001953125; + test_msg->freq_step = 4608.2001953125; + test_msg->t.tow = 992295133; + test_msg->t.wn = 6957; + + EXPECT_EQ(send_message(0x50, 55664, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55664); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->amplitude_ref*100 - 9349.20019531*100), 0.05) << "incorrect value for amplitude_ref, expected 9349.20019531, is " << last_msg_->amplitude_ref; - EXPECT_LT((last_msg_->amplitude_unit*100 - 3485.19995117*100), 0.05) << "incorrect value for amplitude_unit, expected 3485.19995117, is " << last_msg_->amplitude_unit; - EXPECT_EQ(last_msg_->amplitude_value[0], 240) << "incorrect value for amplitude_value[0], expected 240, is " << last_msg_->amplitude_value[0]; - EXPECT_EQ(last_msg_->amplitude_value[1], 14) << "incorrect value for amplitude_value[1], expected 14, is " << last_msg_->amplitude_value[1]; - EXPECT_EQ(last_msg_->amplitude_value[2], 179) << "incorrect value for amplitude_value[2], expected 179, is " << last_msg_->amplitude_value[2]; - EXPECT_EQ(last_msg_->amplitude_value[3], 186) << "incorrect value for amplitude_value[3], expected 186, is " << last_msg_->amplitude_value[3]; - EXPECT_EQ(last_msg_->amplitude_value[4], 227) << "incorrect value for amplitude_value[4], expected 227, is " << last_msg_->amplitude_value[4]; - EXPECT_EQ(last_msg_->amplitude_value[5], 244) << "incorrect value for amplitude_value[5], expected 244, is " << last_msg_->amplitude_value[5]; - EXPECT_EQ(last_msg_->amplitude_value[6], 173) << "incorrect value for amplitude_value[6], expected 173, is " << last_msg_->amplitude_value[6]; - EXPECT_EQ(last_msg_->amplitude_value[7], 240) << "incorrect value for amplitude_value[7], expected 240, is " << last_msg_->amplitude_value[7]; - EXPECT_EQ(last_msg_->amplitude_value[8], 182) << "incorrect value for amplitude_value[8], expected 182, is " << last_msg_->amplitude_value[8]; - EXPECT_EQ(last_msg_->amplitude_value[9], 71) << "incorrect value for amplitude_value[9], expected 71, is " << last_msg_->amplitude_value[9]; - EXPECT_EQ(last_msg_->amplitude_value[10], 166) << "incorrect value for amplitude_value[10], expected 166, is " << last_msg_->amplitude_value[10]; - EXPECT_EQ(last_msg_->amplitude_value[11], 117) << "incorrect value for amplitude_value[11], expected 117, is " << last_msg_->amplitude_value[11]; - EXPECT_EQ(last_msg_->amplitude_value[12], 196) << "incorrect value for amplitude_value[12], expected 196, is " << last_msg_->amplitude_value[12]; - EXPECT_EQ(last_msg_->amplitude_value[13], 13) << "incorrect value for amplitude_value[13], expected 13, is " << last_msg_->amplitude_value[13]; - EXPECT_EQ(last_msg_->amplitude_value[14], 44) << "incorrect value for amplitude_value[14], expected 44, is " << last_msg_->amplitude_value[14]; - EXPECT_EQ(last_msg_->amplitude_value[15], 27) << "incorrect value for amplitude_value[15], expected 27, is " << last_msg_->amplitude_value[15]; - EXPECT_EQ(last_msg_->amplitude_value[16], 33) << "incorrect value for amplitude_value[16], expected 33, is " << last_msg_->amplitude_value[16]; - EXPECT_EQ(last_msg_->amplitude_value[17], 28) << "incorrect value for amplitude_value[17], expected 28, is " << last_msg_->amplitude_value[17]; - EXPECT_EQ(last_msg_->amplitude_value[18], 67) << "incorrect value for amplitude_value[18], expected 67, is " << last_msg_->amplitude_value[18]; - EXPECT_EQ(last_msg_->amplitude_value[19], 254) << "incorrect value for amplitude_value[19], expected 254, is " << last_msg_->amplitude_value[19]; - EXPECT_EQ(last_msg_->amplitude_value[20], 3) << "incorrect value for amplitude_value[20], expected 3, is " << last_msg_->amplitude_value[20]; - EXPECT_EQ(last_msg_->amplitude_value[21], 249) << "incorrect value for amplitude_value[21], expected 249, is " << last_msg_->amplitude_value[21]; - EXPECT_EQ(last_msg_->amplitude_value[22], 92) << "incorrect value for amplitude_value[22], expected 92, is " << last_msg_->amplitude_value[22]; - EXPECT_EQ(last_msg_->amplitude_value[23], 44) << "incorrect value for amplitude_value[23], expected 44, is " << last_msg_->amplitude_value[23]; - EXPECT_EQ(last_msg_->amplitude_value[24], 122) << "incorrect value for amplitude_value[24], expected 122, is " << last_msg_->amplitude_value[24]; - EXPECT_EQ(last_msg_->amplitude_value[25], 169) << "incorrect value for amplitude_value[25], expected 169, is " << last_msg_->amplitude_value[25]; - EXPECT_EQ(last_msg_->amplitude_value[26], 77) << "incorrect value for amplitude_value[26], expected 77, is " << last_msg_->amplitude_value[26]; - EXPECT_EQ(last_msg_->amplitude_value[27], 186) << "incorrect value for amplitude_value[27], expected 186, is " << last_msg_->amplitude_value[27]; - EXPECT_EQ(last_msg_->amplitude_value[28], 68) << "incorrect value for amplitude_value[28], expected 68, is " << last_msg_->amplitude_value[28]; - EXPECT_EQ(last_msg_->amplitude_value[29], 135) << "incorrect value for amplitude_value[29], expected 135, is " << last_msg_->amplitude_value[29]; - EXPECT_EQ(last_msg_->amplitude_value[30], 63) << "incorrect value for amplitude_value[30], expected 63, is " << last_msg_->amplitude_value[30]; - EXPECT_EQ(last_msg_->amplitude_value[31], 168) << "incorrect value for amplitude_value[31], expected 168, is " << last_msg_->amplitude_value[31]; - EXPECT_EQ(last_msg_->amplitude_value[32], 162) << "incorrect value for amplitude_value[32], expected 162, is " << last_msg_->amplitude_value[32]; - EXPECT_EQ(last_msg_->amplitude_value[33], 89) << "incorrect value for amplitude_value[33], expected 89, is " << last_msg_->amplitude_value[33]; - EXPECT_EQ(last_msg_->amplitude_value[34], 36) << "incorrect value for amplitude_value[34], expected 36, is " << last_msg_->amplitude_value[34]; - EXPECT_EQ(last_msg_->amplitude_value[35], 186) << "incorrect value for amplitude_value[35], expected 186, is " << last_msg_->amplitude_value[35]; - EXPECT_EQ(last_msg_->amplitude_value[36], 99) << "incorrect value for amplitude_value[36], expected 99, is " << last_msg_->amplitude_value[36]; - EXPECT_EQ(last_msg_->amplitude_value[37], 63) << "incorrect value for amplitude_value[37], expected 63, is " << last_msg_->amplitude_value[37]; - EXPECT_EQ(last_msg_->amplitude_value[38], 105) << "incorrect value for amplitude_value[38], expected 105, is " << last_msg_->amplitude_value[38]; - EXPECT_EQ(last_msg_->amplitude_value[39], 116) << "incorrect value for amplitude_value[39], expected 116, is " << last_msg_->amplitude_value[39]; - EXPECT_EQ(last_msg_->amplitude_value[40], 216) << "incorrect value for amplitude_value[40], expected 216, is " << last_msg_->amplitude_value[40]; - EXPECT_EQ(last_msg_->amplitude_value[41], 44) << "incorrect value for amplitude_value[41], expected 44, is " << last_msg_->amplitude_value[41]; - EXPECT_EQ(last_msg_->amplitude_value[42], 67) << "incorrect value for amplitude_value[42], expected 67, is " << last_msg_->amplitude_value[42]; - EXPECT_EQ(last_msg_->amplitude_value[43], 212) << "incorrect value for amplitude_value[43], expected 212, is " << last_msg_->amplitude_value[43]; - EXPECT_EQ(last_msg_->amplitude_value[44], 156) << "incorrect value for amplitude_value[44], expected 156, is " << last_msg_->amplitude_value[44]; - EXPECT_EQ(last_msg_->amplitude_value[45], 75) << "incorrect value for amplitude_value[45], expected 75, is " << last_msg_->amplitude_value[45]; - EXPECT_EQ(last_msg_->amplitude_value[46], 81) << "incorrect value for amplitude_value[46], expected 81, is " << last_msg_->amplitude_value[46]; - EXPECT_EQ(last_msg_->amplitude_value[47], 53) << "incorrect value for amplitude_value[47], expected 53, is " << last_msg_->amplitude_value[47]; - EXPECT_EQ(last_msg_->amplitude_value[48], 250) << "incorrect value for amplitude_value[48], expected 250, is " << last_msg_->amplitude_value[48]; - EXPECT_EQ(last_msg_->amplitude_value[49], 225) << "incorrect value for amplitude_value[49], expected 225, is " << last_msg_->amplitude_value[49]; - EXPECT_EQ(last_msg_->amplitude_value[50], 23) << "incorrect value for amplitude_value[50], expected 23, is " << last_msg_->amplitude_value[50]; - EXPECT_EQ(last_msg_->amplitude_value[51], 205) << "incorrect value for amplitude_value[51], expected 205, is " << last_msg_->amplitude_value[51]; - EXPECT_EQ(last_msg_->amplitude_value[52], 26) << "incorrect value for amplitude_value[52], expected 26, is " << last_msg_->amplitude_value[52]; - EXPECT_EQ(last_msg_->amplitude_value[53], 34) << "incorrect value for amplitude_value[53], expected 34, is " << last_msg_->amplitude_value[53]; - EXPECT_EQ(last_msg_->amplitude_value[54], 119) << "incorrect value for amplitude_value[54], expected 119, is " << last_msg_->amplitude_value[54]; - EXPECT_EQ(last_msg_->amplitude_value[55], 50) << "incorrect value for amplitude_value[55], expected 50, is " << last_msg_->amplitude_value[55]; - EXPECT_EQ(last_msg_->amplitude_value[56], 101) << "incorrect value for amplitude_value[56], expected 101, is " << last_msg_->amplitude_value[56]; - EXPECT_EQ(last_msg_->amplitude_value[57], 64) << "incorrect value for amplitude_value[57], expected 64, is " << last_msg_->amplitude_value[57]; - EXPECT_EQ(last_msg_->amplitude_value[58], 7) << "incorrect value for amplitude_value[58], expected 7, is " << last_msg_->amplitude_value[58]; - EXPECT_EQ(last_msg_->amplitude_value[59], 231) << "incorrect value for amplitude_value[59], expected 231, is " << last_msg_->amplitude_value[59]; - EXPECT_EQ(last_msg_->amplitude_value[60], 124) << "incorrect value for amplitude_value[60], expected 124, is " << last_msg_->amplitude_value[60]; - EXPECT_EQ(last_msg_->amplitude_value[61], 183) << "incorrect value for amplitude_value[61], expected 183, is " << last_msg_->amplitude_value[61]; - EXPECT_EQ(last_msg_->amplitude_value[62], 203) << "incorrect value for amplitude_value[62], expected 203, is " << last_msg_->amplitude_value[62]; - EXPECT_EQ(last_msg_->amplitude_value[63], 102) << "incorrect value for amplitude_value[63], expected 102, is " << last_msg_->amplitude_value[63]; - EXPECT_EQ(last_msg_->amplitude_value[64], 234) << "incorrect value for amplitude_value[64], expected 234, is " << last_msg_->amplitude_value[64]; - EXPECT_EQ(last_msg_->amplitude_value[65], 84) << "incorrect value for amplitude_value[65], expected 84, is " << last_msg_->amplitude_value[65]; - EXPECT_EQ(last_msg_->amplitude_value[66], 83) << "incorrect value for amplitude_value[66], expected 83, is " << last_msg_->amplitude_value[66]; - EXPECT_EQ(last_msg_->amplitude_value[67], 208) << "incorrect value for amplitude_value[67], expected 208, is " << last_msg_->amplitude_value[67]; - EXPECT_EQ(last_msg_->amplitude_value[68], 23) << "incorrect value for amplitude_value[68], expected 23, is " << last_msg_->amplitude_value[68]; - EXPECT_EQ(last_msg_->amplitude_value[69], 68) << "incorrect value for amplitude_value[69], expected 68, is " << last_msg_->amplitude_value[69]; - EXPECT_EQ(last_msg_->amplitude_value[70], 54) << "incorrect value for amplitude_value[70], expected 54, is " << last_msg_->amplitude_value[70]; - EXPECT_EQ(last_msg_->amplitude_value[71], 179) << "incorrect value for amplitude_value[71], expected 179, is " << last_msg_->amplitude_value[71]; - EXPECT_EQ(last_msg_->amplitude_value[72], 98) << "incorrect value for amplitude_value[72], expected 98, is " << last_msg_->amplitude_value[72]; - EXPECT_EQ(last_msg_->amplitude_value[73], 96) << "incorrect value for amplitude_value[73], expected 96, is " << last_msg_->amplitude_value[73]; - EXPECT_EQ(last_msg_->amplitude_value[74], 116) << "incorrect value for amplitude_value[74], expected 116, is " << last_msg_->amplitude_value[74]; - EXPECT_EQ(last_msg_->amplitude_value[75], 244) << "incorrect value for amplitude_value[75], expected 244, is " << last_msg_->amplitude_value[75]; - EXPECT_EQ(last_msg_->amplitude_value[76], 246) << "incorrect value for amplitude_value[76], expected 246, is " << last_msg_->amplitude_value[76]; - EXPECT_EQ(last_msg_->amplitude_value[77], 94) << "incorrect value for amplitude_value[77], expected 94, is " << last_msg_->amplitude_value[77]; - EXPECT_EQ(last_msg_->amplitude_value[78], 104) << "incorrect value for amplitude_value[78], expected 104, is " << last_msg_->amplitude_value[78]; - EXPECT_EQ(last_msg_->amplitude_value[79], 94) << "incorrect value for amplitude_value[79], expected 94, is " << last_msg_->amplitude_value[79]; - EXPECT_EQ(last_msg_->amplitude_value[80], 13) << "incorrect value for amplitude_value[80], expected 13, is " << last_msg_->amplitude_value[80]; - EXPECT_EQ(last_msg_->amplitude_value[81], 56) << "incorrect value for amplitude_value[81], expected 56, is " << last_msg_->amplitude_value[81]; - EXPECT_EQ(last_msg_->amplitude_value[82], 210) << "incorrect value for amplitude_value[82], expected 210, is " << last_msg_->amplitude_value[82]; - EXPECT_EQ(last_msg_->amplitude_value[83], 18) << "incorrect value for amplitude_value[83], expected 18, is " << last_msg_->amplitude_value[83]; - EXPECT_EQ(last_msg_->amplitude_value[84], 191) << "incorrect value for amplitude_value[84], expected 191, is " << last_msg_->amplitude_value[84]; - EXPECT_EQ(last_msg_->amplitude_value[85], 22) << "incorrect value for amplitude_value[85], expected 22, is " << last_msg_->amplitude_value[85]; - EXPECT_EQ(last_msg_->amplitude_value[86], 133) << "incorrect value for amplitude_value[86], expected 133, is " << last_msg_->amplitude_value[86]; - EXPECT_EQ(last_msg_->amplitude_value[87], 81) << "incorrect value for amplitude_value[87], expected 81, is " << last_msg_->amplitude_value[87]; - EXPECT_EQ(last_msg_->amplitude_value[88], 153) << "incorrect value for amplitude_value[88], expected 153, is " << last_msg_->amplitude_value[88]; - EXPECT_EQ(last_msg_->amplitude_value[89], 159) << "incorrect value for amplitude_value[89], expected 159, is " << last_msg_->amplitude_value[89]; - EXPECT_EQ(last_msg_->amplitude_value[90], 161) << "incorrect value for amplitude_value[90], expected 161, is " << last_msg_->amplitude_value[90]; - EXPECT_EQ(last_msg_->amplitude_value[91], 219) << "incorrect value for amplitude_value[91], expected 219, is " << last_msg_->amplitude_value[91]; - EXPECT_EQ(last_msg_->amplitude_value[92], 59) << "incorrect value for amplitude_value[92], expected 59, is " << last_msg_->amplitude_value[92]; - EXPECT_EQ(last_msg_->amplitude_value[93], 21) << "incorrect value for amplitude_value[93], expected 21, is " << last_msg_->amplitude_value[93]; - EXPECT_EQ(last_msg_->amplitude_value[94], 164) << "incorrect value for amplitude_value[94], expected 164, is " << last_msg_->amplitude_value[94]; - EXPECT_EQ(last_msg_->amplitude_value[95], 121) << "incorrect value for amplitude_value[95], expected 121, is " << last_msg_->amplitude_value[95]; - EXPECT_EQ(last_msg_->amplitude_value[96], 145) << "incorrect value for amplitude_value[96], expected 145, is " << last_msg_->amplitude_value[96]; - EXPECT_EQ(last_msg_->amplitude_value[97], 203) << "incorrect value for amplitude_value[97], expected 203, is " << last_msg_->amplitude_value[97]; - EXPECT_EQ(last_msg_->amplitude_value[98], 171) << "incorrect value for amplitude_value[98], expected 171, is " << last_msg_->amplitude_value[98]; - EXPECT_EQ(last_msg_->amplitude_value[99], 132) << "incorrect value for amplitude_value[99], expected 132, is " << last_msg_->amplitude_value[99]; - EXPECT_EQ(last_msg_->amplitude_value[100], 57) << "incorrect value for amplitude_value[100], expected 57, is " << last_msg_->amplitude_value[100]; - EXPECT_EQ(last_msg_->amplitude_value[101], 180) << "incorrect value for amplitude_value[101], expected 180, is " << last_msg_->amplitude_value[101]; - EXPECT_EQ(last_msg_->amplitude_value[102], 102) << "incorrect value for amplitude_value[102], expected 102, is " << last_msg_->amplitude_value[102]; - EXPECT_EQ(last_msg_->amplitude_value[103], 101) << "incorrect value for amplitude_value[103], expected 101, is " << last_msg_->amplitude_value[103]; - EXPECT_EQ(last_msg_->amplitude_value[104], 11) << "incorrect value for amplitude_value[104], expected 11, is " << last_msg_->amplitude_value[104]; - EXPECT_EQ(last_msg_->amplitude_value[105], 229) << "incorrect value for amplitude_value[105], expected 229, is " << last_msg_->amplitude_value[105]; - EXPECT_EQ(last_msg_->amplitude_value[106], 175) << "incorrect value for amplitude_value[106], expected 175, is " << last_msg_->amplitude_value[106]; - EXPECT_EQ(last_msg_->amplitude_value[107], 145) << "incorrect value for amplitude_value[107], expected 145, is " << last_msg_->amplitude_value[107]; - EXPECT_EQ(last_msg_->amplitude_value[108], 73) << "incorrect value for amplitude_value[108], expected 73, is " << last_msg_->amplitude_value[108]; - EXPECT_EQ(last_msg_->amplitude_value[109], 72) << "incorrect value for amplitude_value[109], expected 72, is " << last_msg_->amplitude_value[109]; - EXPECT_EQ(last_msg_->amplitude_value[110], 124) << "incorrect value for amplitude_value[110], expected 124, is " << last_msg_->amplitude_value[110]; - EXPECT_EQ(last_msg_->amplitude_value[111], 4) << "incorrect value for amplitude_value[111], expected 4, is " << last_msg_->amplitude_value[111]; - EXPECT_EQ(last_msg_->amplitude_value[112], 184) << "incorrect value for amplitude_value[112], expected 184, is " << last_msg_->amplitude_value[112]; - EXPECT_EQ(last_msg_->amplitude_value[113], 228) << "incorrect value for amplitude_value[113], expected 228, is " << last_msg_->amplitude_value[113]; - EXPECT_EQ(last_msg_->amplitude_value[114], 61) << "incorrect value for amplitude_value[114], expected 61, is " << last_msg_->amplitude_value[114]; - EXPECT_EQ(last_msg_->amplitude_value[115], 234) << "incorrect value for amplitude_value[115], expected 234, is " << last_msg_->amplitude_value[115]; - EXPECT_EQ(last_msg_->amplitude_value[116], 218) << "incorrect value for amplitude_value[116], expected 218, is " << last_msg_->amplitude_value[116]; - EXPECT_EQ(last_msg_->amplitude_value[117], 62) << "incorrect value for amplitude_value[117], expected 62, is " << last_msg_->amplitude_value[117]; - EXPECT_EQ(last_msg_->amplitude_value[118], 226) << "incorrect value for amplitude_value[118], expected 226, is " << last_msg_->amplitude_value[118]; - EXPECT_EQ(last_msg_->amplitude_value[119], 217) << "incorrect value for amplitude_value[119], expected 217, is " << last_msg_->amplitude_value[119]; - EXPECT_EQ(last_msg_->amplitude_value[120], 193) << "incorrect value for amplitude_value[120], expected 193, is " << last_msg_->amplitude_value[120]; - EXPECT_EQ(last_msg_->amplitude_value[121], 7) << "incorrect value for amplitude_value[121], expected 7, is " << last_msg_->amplitude_value[121]; - EXPECT_EQ(last_msg_->amplitude_value[122], 109) << "incorrect value for amplitude_value[122], expected 109, is " << last_msg_->amplitude_value[122]; - EXPECT_EQ(last_msg_->amplitude_value[123], 44) << "incorrect value for amplitude_value[123], expected 44, is " << last_msg_->amplitude_value[123]; - EXPECT_EQ(last_msg_->amplitude_value[124], 83) << "incorrect value for amplitude_value[124], expected 83, is " << last_msg_->amplitude_value[124]; - EXPECT_EQ(last_msg_->amplitude_value[125], 201) << "incorrect value for amplitude_value[125], expected 201, is " << last_msg_->amplitude_value[125]; - EXPECT_EQ(last_msg_->amplitude_value[126], 20) << "incorrect value for amplitude_value[126], expected 20, is " << last_msg_->amplitude_value[126]; - EXPECT_EQ(last_msg_->amplitude_value[127], 101) << "incorrect value for amplitude_value[127], expected 101, is " << last_msg_->amplitude_value[127]; - EXPECT_EQ(last_msg_->amplitude_value[128], 9) << "incorrect value for amplitude_value[128], expected 9, is " << last_msg_->amplitude_value[128]; - EXPECT_EQ(last_msg_->amplitude_value[129], 140) << "incorrect value for amplitude_value[129], expected 140, is " << last_msg_->amplitude_value[129]; - EXPECT_EQ(last_msg_->amplitude_value[130], 186) << "incorrect value for amplitude_value[130], expected 186, is " << last_msg_->amplitude_value[130]; - EXPECT_EQ(last_msg_->amplitude_value[131], 162) << "incorrect value for amplitude_value[131], expected 162, is " << last_msg_->amplitude_value[131]; - EXPECT_EQ(last_msg_->amplitude_value[132], 81) << "incorrect value for amplitude_value[132], expected 81, is " << last_msg_->amplitude_value[132]; - EXPECT_EQ(last_msg_->amplitude_value[133], 91) << "incorrect value for amplitude_value[133], expected 91, is " << last_msg_->amplitude_value[133]; - EXPECT_EQ(last_msg_->amplitude_value[134], 30) << "incorrect value for amplitude_value[134], expected 30, is " << last_msg_->amplitude_value[134]; - EXPECT_EQ(last_msg_->amplitude_value[135], 231) << "incorrect value for amplitude_value[135], expected 231, is " << last_msg_->amplitude_value[135]; - EXPECT_EQ(last_msg_->amplitude_value[136], 161) << "incorrect value for amplitude_value[136], expected 161, is " << last_msg_->amplitude_value[136]; - EXPECT_EQ(last_msg_->amplitude_value[137], 81) << "incorrect value for amplitude_value[137], expected 81, is " << last_msg_->amplitude_value[137]; - EXPECT_EQ(last_msg_->amplitude_value[138], 216) << "incorrect value for amplitude_value[138], expected 216, is " << last_msg_->amplitude_value[138]; - EXPECT_EQ(last_msg_->amplitude_value[139], 114) << "incorrect value for amplitude_value[139], expected 114, is " << last_msg_->amplitude_value[139]; - EXPECT_EQ(last_msg_->amplitude_value[140], 60) << "incorrect value for amplitude_value[140], expected 60, is " << last_msg_->amplitude_value[140]; - EXPECT_EQ(last_msg_->amplitude_value[141], 231) << "incorrect value for amplitude_value[141], expected 231, is " << last_msg_->amplitude_value[141]; - EXPECT_EQ(last_msg_->amplitude_value[142], 163) << "incorrect value for amplitude_value[142], expected 163, is " << last_msg_->amplitude_value[142]; - EXPECT_EQ(last_msg_->amplitude_value[143], 163) << "incorrect value for amplitude_value[143], expected 163, is " << last_msg_->amplitude_value[143]; - EXPECT_EQ(last_msg_->amplitude_value[144], 49) << "incorrect value for amplitude_value[144], expected 49, is " << last_msg_->amplitude_value[144]; - EXPECT_EQ(last_msg_->amplitude_value[145], 237) << "incorrect value for amplitude_value[145], expected 237, is " << last_msg_->amplitude_value[145]; - EXPECT_EQ(last_msg_->amplitude_value[146], 244) << "incorrect value for amplitude_value[146], expected 244, is " << last_msg_->amplitude_value[146]; - EXPECT_EQ(last_msg_->amplitude_value[147], 185) << "incorrect value for amplitude_value[147], expected 185, is " << last_msg_->amplitude_value[147]; - EXPECT_EQ(last_msg_->amplitude_value[148], 240) << "incorrect value for amplitude_value[148], expected 240, is " << last_msg_->amplitude_value[148]; - EXPECT_EQ(last_msg_->amplitude_value[149], 89) << "incorrect value for amplitude_value[149], expected 89, is " << last_msg_->amplitude_value[149]; - EXPECT_EQ(last_msg_->amplitude_value[150], 143) << "incorrect value for amplitude_value[150], expected 143, is " << last_msg_->amplitude_value[150]; - EXPECT_EQ(last_msg_->amplitude_value[151], 174) << "incorrect value for amplitude_value[151], expected 174, is " << last_msg_->amplitude_value[151]; - EXPECT_EQ(last_msg_->amplitude_value[152], 165) << "incorrect value for amplitude_value[152], expected 165, is " << last_msg_->amplitude_value[152]; - EXPECT_EQ(last_msg_->amplitude_value[153], 211) << "incorrect value for amplitude_value[153], expected 211, is " << last_msg_->amplitude_value[153]; - EXPECT_EQ(last_msg_->amplitude_value[154], 241) << "incorrect value for amplitude_value[154], expected 241, is " << last_msg_->amplitude_value[154]; - EXPECT_EQ(last_msg_->amplitude_value[155], 13) << "incorrect value for amplitude_value[155], expected 13, is " << last_msg_->amplitude_value[155]; - EXPECT_EQ(last_msg_->amplitude_value[156], 16) << "incorrect value for amplitude_value[156], expected 16, is " << last_msg_->amplitude_value[156]; - EXPECT_EQ(last_msg_->amplitude_value[157], 61) << "incorrect value for amplitude_value[157], expected 61, is " << last_msg_->amplitude_value[157]; - EXPECT_EQ(last_msg_->amplitude_value[158], 141) << "incorrect value for amplitude_value[158], expected 141, is " << last_msg_->amplitude_value[158]; - EXPECT_EQ(last_msg_->amplitude_value[159], 101) << "incorrect value for amplitude_value[159], expected 101, is " << last_msg_->amplitude_value[159]; - EXPECT_EQ(last_msg_->amplitude_value[160], 89) << "incorrect value for amplitude_value[160], expected 89, is " << last_msg_->amplitude_value[160]; - EXPECT_EQ(last_msg_->amplitude_value[161], 37) << "incorrect value for amplitude_value[161], expected 37, is " << last_msg_->amplitude_value[161]; - EXPECT_EQ(last_msg_->amplitude_value[162], 117) << "incorrect value for amplitude_value[162], expected 117, is " << last_msg_->amplitude_value[162]; - EXPECT_EQ(last_msg_->amplitude_value[163], 189) << "incorrect value for amplitude_value[163], expected 189, is " << last_msg_->amplitude_value[163]; - EXPECT_EQ(last_msg_->amplitude_value[164], 86) << "incorrect value for amplitude_value[164], expected 86, is " << last_msg_->amplitude_value[164]; - EXPECT_EQ(last_msg_->amplitude_value[165], 118) << "incorrect value for amplitude_value[165], expected 118, is " << last_msg_->amplitude_value[165]; - EXPECT_EQ(last_msg_->amplitude_value[166], 176) << "incorrect value for amplitude_value[166], expected 176, is " << last_msg_->amplitude_value[166]; - EXPECT_EQ(last_msg_->amplitude_value[167], 228) << "incorrect value for amplitude_value[167], expected 228, is " << last_msg_->amplitude_value[167]; - EXPECT_EQ(last_msg_->amplitude_value[168], 12) << "incorrect value for amplitude_value[168], expected 12, is " << last_msg_->amplitude_value[168]; - EXPECT_EQ(last_msg_->amplitude_value[169], 14) << "incorrect value for amplitude_value[169], expected 14, is " << last_msg_->amplitude_value[169]; - EXPECT_EQ(last_msg_->amplitude_value[170], 119) << "incorrect value for amplitude_value[170], expected 119, is " << last_msg_->amplitude_value[170]; - EXPECT_EQ(last_msg_->amplitude_value[171], 135) << "incorrect value for amplitude_value[171], expected 135, is " << last_msg_->amplitude_value[171]; - EXPECT_EQ(last_msg_->amplitude_value[172], 129) << "incorrect value for amplitude_value[172], expected 129, is " << last_msg_->amplitude_value[172]; - EXPECT_EQ(last_msg_->amplitude_value[173], 243) << "incorrect value for amplitude_value[173], expected 243, is " << last_msg_->amplitude_value[173]; - EXPECT_EQ(last_msg_->amplitude_value[174], 50) << "incorrect value for amplitude_value[174], expected 50, is " << last_msg_->amplitude_value[174]; - EXPECT_EQ(last_msg_->amplitude_value[175], 29) << "incorrect value for amplitude_value[175], expected 29, is " << last_msg_->amplitude_value[175]; - EXPECT_EQ(last_msg_->amplitude_value[176], 207) << "incorrect value for amplitude_value[176], expected 207, is " << last_msg_->amplitude_value[176]; - EXPECT_EQ(last_msg_->amplitude_value[177], 198) << "incorrect value for amplitude_value[177], expected 198, is " << last_msg_->amplitude_value[177]; - EXPECT_EQ(last_msg_->amplitude_value[178], 117) << "incorrect value for amplitude_value[178], expected 117, is " << last_msg_->amplitude_value[178]; - EXPECT_EQ(last_msg_->amplitude_value[179], 100) << "incorrect value for amplitude_value[179], expected 100, is " << last_msg_->amplitude_value[179]; - EXPECT_EQ(last_msg_->amplitude_value[180], 225) << "incorrect value for amplitude_value[180], expected 225, is " << last_msg_->amplitude_value[180]; - EXPECT_EQ(last_msg_->amplitude_value[181], 6) << "incorrect value for amplitude_value[181], expected 6, is " << last_msg_->amplitude_value[181]; - EXPECT_EQ(last_msg_->amplitude_value[182], 139) << "incorrect value for amplitude_value[182], expected 139, is " << last_msg_->amplitude_value[182]; - EXPECT_EQ(last_msg_->amplitude_value[183], 110) << "incorrect value for amplitude_value[183], expected 110, is " << last_msg_->amplitude_value[183]; - EXPECT_EQ(last_msg_->amplitude_value[184], 39) << "incorrect value for amplitude_value[184], expected 39, is " << last_msg_->amplitude_value[184]; - EXPECT_EQ(last_msg_->amplitude_value[185], 210) << "incorrect value for amplitude_value[185], expected 210, is " << last_msg_->amplitude_value[185]; - EXPECT_EQ(last_msg_->amplitude_value[186], 68) << "incorrect value for amplitude_value[186], expected 68, is " << last_msg_->amplitude_value[186]; - EXPECT_EQ(last_msg_->amplitude_value[187], 199) << "incorrect value for amplitude_value[187], expected 199, is " << last_msg_->amplitude_value[187]; - EXPECT_EQ(last_msg_->amplitude_value[188], 43) << "incorrect value for amplitude_value[188], expected 43, is " << last_msg_->amplitude_value[188]; - EXPECT_EQ(last_msg_->amplitude_value[189], 132) << "incorrect value for amplitude_value[189], expected 132, is " << last_msg_->amplitude_value[189]; - EXPECT_EQ(last_msg_->amplitude_value[190], 64) << "incorrect value for amplitude_value[190], expected 64, is " << last_msg_->amplitude_value[190]; - EXPECT_EQ(last_msg_->amplitude_value[191], 17) << "incorrect value for amplitude_value[191], expected 17, is " << last_msg_->amplitude_value[191]; - EXPECT_EQ(last_msg_->amplitude_value[192], 51) << "incorrect value for amplitude_value[192], expected 51, is " << last_msg_->amplitude_value[192]; - EXPECT_EQ(last_msg_->amplitude_value[193], 173) << "incorrect value for amplitude_value[193], expected 173, is " << last_msg_->amplitude_value[193]; - EXPECT_EQ(last_msg_->amplitude_value[194], 181) << "incorrect value for amplitude_value[194], expected 181, is " << last_msg_->amplitude_value[194]; - EXPECT_EQ(last_msg_->amplitude_value[195], 12) << "incorrect value for amplitude_value[195], expected 12, is " << last_msg_->amplitude_value[195]; - EXPECT_EQ(last_msg_->amplitude_value[196], 140) << "incorrect value for amplitude_value[196], expected 140, is " << last_msg_->amplitude_value[196]; - EXPECT_EQ(last_msg_->amplitude_value[197], 16) << "incorrect value for amplitude_value[197], expected 16, is " << last_msg_->amplitude_value[197]; - EXPECT_EQ(last_msg_->amplitude_value[198], 247) << "incorrect value for amplitude_value[198], expected 247, is " << last_msg_->amplitude_value[198]; - EXPECT_EQ(last_msg_->amplitude_value[199], 84) << "incorrect value for amplitude_value[199], expected 84, is " << last_msg_->amplitude_value[199]; - EXPECT_EQ(last_msg_->amplitude_value[200], 183) << "incorrect value for amplitude_value[200], expected 183, is " << last_msg_->amplitude_value[200]; - EXPECT_EQ(last_msg_->amplitude_value[201], 105) << "incorrect value for amplitude_value[201], expected 105, is " << last_msg_->amplitude_value[201]; - EXPECT_EQ(last_msg_->amplitude_value[202], 39) << "incorrect value for amplitude_value[202], expected 39, is " << last_msg_->amplitude_value[202]; - EXPECT_EQ(last_msg_->amplitude_value[203], 157) << "incorrect value for amplitude_value[203], expected 157, is " << last_msg_->amplitude_value[203]; - EXPECT_EQ(last_msg_->amplitude_value[204], 77) << "incorrect value for amplitude_value[204], expected 77, is " << last_msg_->amplitude_value[204]; - EXPECT_EQ(last_msg_->amplitude_value[205], 30) << "incorrect value for amplitude_value[205], expected 30, is " << last_msg_->amplitude_value[205]; - EXPECT_EQ(last_msg_->amplitude_value[206], 205) << "incorrect value for amplitude_value[206], expected 205, is " << last_msg_->amplitude_value[206]; - EXPECT_EQ(last_msg_->amplitude_value[207], 194) << "incorrect value for amplitude_value[207], expected 194, is " << last_msg_->amplitude_value[207]; - EXPECT_EQ(last_msg_->amplitude_value[208], 59) << "incorrect value for amplitude_value[208], expected 59, is " << last_msg_->amplitude_value[208]; - EXPECT_EQ(last_msg_->amplitude_value[209], 64) << "incorrect value for amplitude_value[209], expected 64, is " << last_msg_->amplitude_value[209]; - EXPECT_EQ(last_msg_->amplitude_value[210], 241) << "incorrect value for amplitude_value[210], expected 241, is " << last_msg_->amplitude_value[210]; - EXPECT_EQ(last_msg_->amplitude_value[211], 183) << "incorrect value for amplitude_value[211], expected 183, is " << last_msg_->amplitude_value[211]; - EXPECT_EQ(last_msg_->amplitude_value[212], 238) << "incorrect value for amplitude_value[212], expected 238, is " << last_msg_->amplitude_value[212]; - EXPECT_EQ(last_msg_->amplitude_value[213], 105) << "incorrect value for amplitude_value[213], expected 105, is " << last_msg_->amplitude_value[213]; - EXPECT_EQ(last_msg_->amplitude_value[214], 181) << "incorrect value for amplitude_value[214], expected 181, is " << last_msg_->amplitude_value[214]; - EXPECT_EQ(last_msg_->amplitude_value[215], 170) << "incorrect value for amplitude_value[215], expected 170, is " << last_msg_->amplitude_value[215]; - EXPECT_EQ(last_msg_->amplitude_value[216], 45) << "incorrect value for amplitude_value[216], expected 45, is " << last_msg_->amplitude_value[216]; - EXPECT_EQ(last_msg_->amplitude_value[217], 8) << "incorrect value for amplitude_value[217], expected 8, is " << last_msg_->amplitude_value[217]; - EXPECT_EQ(last_msg_->amplitude_value[218], 166) << "incorrect value for amplitude_value[218], expected 166, is " << last_msg_->amplitude_value[218]; - EXPECT_EQ(last_msg_->amplitude_value[219], 164) << "incorrect value for amplitude_value[219], expected 164, is " << last_msg_->amplitude_value[219]; - EXPECT_EQ(last_msg_->amplitude_value[220], 238) << "incorrect value for amplitude_value[220], expected 238, is " << last_msg_->amplitude_value[220]; - EXPECT_EQ(last_msg_->amplitude_value[221], 83) << "incorrect value for amplitude_value[221], expected 83, is " << last_msg_->amplitude_value[221]; - EXPECT_EQ(last_msg_->amplitude_value[222], 148) << "incorrect value for amplitude_value[222], expected 148, is " << last_msg_->amplitude_value[222]; - EXPECT_EQ(last_msg_->amplitude_value[223], 173) << "incorrect value for amplitude_value[223], expected 173, is " << last_msg_->amplitude_value[223]; - EXPECT_EQ(last_msg_->amplitude_value[224], 108) << "incorrect value for amplitude_value[224], expected 108, is " << last_msg_->amplitude_value[224]; - EXPECT_EQ(last_msg_->amplitude_value[225], 228) << "incorrect value for amplitude_value[225], expected 228, is " << last_msg_->amplitude_value[225]; - EXPECT_EQ(last_msg_->amplitude_value[226], 67) << "incorrect value for amplitude_value[226], expected 67, is " << last_msg_->amplitude_value[226]; - EXPECT_EQ(last_msg_->amplitude_value[227], 89) << "incorrect value for amplitude_value[227], expected 89, is " << last_msg_->amplitude_value[227]; - EXPECT_EQ(last_msg_->amplitude_value[228], 189) << "incorrect value for amplitude_value[228], expected 189, is " << last_msg_->amplitude_value[228]; - EXPECT_EQ(last_msg_->amplitude_value[229], 67) << "incorrect value for amplitude_value[229], expected 67, is " << last_msg_->amplitude_value[229]; - EXPECT_EQ(last_msg_->amplitude_value[230], 26) << "incorrect value for amplitude_value[230], expected 26, is " << last_msg_->amplitude_value[230]; - EXPECT_EQ(last_msg_->channel_tag, 5878) << "incorrect value for channel_tag, expected 5878, is " << last_msg_->channel_tag; - EXPECT_LT((last_msg_->freq_ref*100 - 6348.20019531*100), 0.05) << "incorrect value for freq_ref, expected 6348.20019531, is " << last_msg_->freq_ref; - EXPECT_LT((last_msg_->freq_step*100 - 4608.20019531*100), 0.05) << "incorrect value for freq_step, expected 4608.20019531, is " << last_msg_->freq_step; - EXPECT_EQ(last_msg_->t.tow, 992295133) << "incorrect value for t.tow, expected 992295133, is " << last_msg_->t.tow; - EXPECT_EQ(last_msg_->t.wn, 6957) << "incorrect value for t.wn, expected 6957, is " << last_msg_->t.wn; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55664); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->amplitude_ref * 100 - 9349.20019531 * 100), 0.05) + << "incorrect value for amplitude_ref, expected 9349.20019531, is " + << last_msg_->amplitude_ref; + EXPECT_LT((last_msg_->amplitude_unit * 100 - 3485.19995117 * 100), 0.05) + << "incorrect value for amplitude_unit, expected 3485.19995117, is " + << last_msg_->amplitude_unit; + EXPECT_EQ(last_msg_->amplitude_value[0], 240) + << "incorrect value for amplitude_value[0], expected 240, is " + << last_msg_->amplitude_value[0]; + EXPECT_EQ(last_msg_->amplitude_value[1], 14) + << "incorrect value for amplitude_value[1], expected 14, is " + << last_msg_->amplitude_value[1]; + EXPECT_EQ(last_msg_->amplitude_value[2], 179) + << "incorrect value for amplitude_value[2], expected 179, is " + << last_msg_->amplitude_value[2]; + EXPECT_EQ(last_msg_->amplitude_value[3], 186) + << "incorrect value for amplitude_value[3], expected 186, is " + << last_msg_->amplitude_value[3]; + EXPECT_EQ(last_msg_->amplitude_value[4], 227) + << "incorrect value for amplitude_value[4], expected 227, is " + << last_msg_->amplitude_value[4]; + EXPECT_EQ(last_msg_->amplitude_value[5], 244) + << "incorrect value for amplitude_value[5], expected 244, is " + << last_msg_->amplitude_value[5]; + EXPECT_EQ(last_msg_->amplitude_value[6], 173) + << "incorrect value for amplitude_value[6], expected 173, is " + << last_msg_->amplitude_value[6]; + EXPECT_EQ(last_msg_->amplitude_value[7], 240) + << "incorrect value for amplitude_value[7], expected 240, is " + << last_msg_->amplitude_value[7]; + EXPECT_EQ(last_msg_->amplitude_value[8], 182) + << "incorrect value for amplitude_value[8], expected 182, is " + << last_msg_->amplitude_value[8]; + EXPECT_EQ(last_msg_->amplitude_value[9], 71) + << "incorrect value for amplitude_value[9], expected 71, is " + << last_msg_->amplitude_value[9]; + EXPECT_EQ(last_msg_->amplitude_value[10], 166) + << "incorrect value for amplitude_value[10], expected 166, is " + << last_msg_->amplitude_value[10]; + EXPECT_EQ(last_msg_->amplitude_value[11], 117) + << "incorrect value for amplitude_value[11], expected 117, is " + << last_msg_->amplitude_value[11]; + EXPECT_EQ(last_msg_->amplitude_value[12], 196) + << "incorrect value for amplitude_value[12], expected 196, is " + << last_msg_->amplitude_value[12]; + EXPECT_EQ(last_msg_->amplitude_value[13], 13) + << "incorrect value for amplitude_value[13], expected 13, is " + << last_msg_->amplitude_value[13]; + EXPECT_EQ(last_msg_->amplitude_value[14], 44) + << "incorrect value for amplitude_value[14], expected 44, is " + << last_msg_->amplitude_value[14]; + EXPECT_EQ(last_msg_->amplitude_value[15], 27) + << "incorrect value for amplitude_value[15], expected 27, is " + << last_msg_->amplitude_value[15]; + EXPECT_EQ(last_msg_->amplitude_value[16], 33) + << "incorrect value for amplitude_value[16], expected 33, is " + << last_msg_->amplitude_value[16]; + EXPECT_EQ(last_msg_->amplitude_value[17], 28) + << "incorrect value for amplitude_value[17], expected 28, is " + << last_msg_->amplitude_value[17]; + EXPECT_EQ(last_msg_->amplitude_value[18], 67) + << "incorrect value for amplitude_value[18], expected 67, is " + << last_msg_->amplitude_value[18]; + EXPECT_EQ(last_msg_->amplitude_value[19], 254) + << "incorrect value for amplitude_value[19], expected 254, is " + << last_msg_->amplitude_value[19]; + EXPECT_EQ(last_msg_->amplitude_value[20], 3) + << "incorrect value for amplitude_value[20], expected 3, is " + << last_msg_->amplitude_value[20]; + EXPECT_EQ(last_msg_->amplitude_value[21], 249) + << "incorrect value for amplitude_value[21], expected 249, is " + << last_msg_->amplitude_value[21]; + EXPECT_EQ(last_msg_->amplitude_value[22], 92) + << "incorrect value for amplitude_value[22], expected 92, is " + << last_msg_->amplitude_value[22]; + EXPECT_EQ(last_msg_->amplitude_value[23], 44) + << "incorrect value for amplitude_value[23], expected 44, is " + << last_msg_->amplitude_value[23]; + EXPECT_EQ(last_msg_->amplitude_value[24], 122) + << "incorrect value for amplitude_value[24], expected 122, is " + << last_msg_->amplitude_value[24]; + EXPECT_EQ(last_msg_->amplitude_value[25], 169) + << "incorrect value for amplitude_value[25], expected 169, is " + << last_msg_->amplitude_value[25]; + EXPECT_EQ(last_msg_->amplitude_value[26], 77) + << "incorrect value for amplitude_value[26], expected 77, is " + << last_msg_->amplitude_value[26]; + EXPECT_EQ(last_msg_->amplitude_value[27], 186) + << "incorrect value for amplitude_value[27], expected 186, is " + << last_msg_->amplitude_value[27]; + EXPECT_EQ(last_msg_->amplitude_value[28], 68) + << "incorrect value for amplitude_value[28], expected 68, is " + << last_msg_->amplitude_value[28]; + EXPECT_EQ(last_msg_->amplitude_value[29], 135) + << "incorrect value for amplitude_value[29], expected 135, is " + << last_msg_->amplitude_value[29]; + EXPECT_EQ(last_msg_->amplitude_value[30], 63) + << "incorrect value for amplitude_value[30], expected 63, is " + << last_msg_->amplitude_value[30]; + EXPECT_EQ(last_msg_->amplitude_value[31], 168) + << "incorrect value for amplitude_value[31], expected 168, is " + << last_msg_->amplitude_value[31]; + EXPECT_EQ(last_msg_->amplitude_value[32], 162) + << "incorrect value for amplitude_value[32], expected 162, is " + << last_msg_->amplitude_value[32]; + EXPECT_EQ(last_msg_->amplitude_value[33], 89) + << "incorrect value for amplitude_value[33], expected 89, is " + << last_msg_->amplitude_value[33]; + EXPECT_EQ(last_msg_->amplitude_value[34], 36) + << "incorrect value for amplitude_value[34], expected 36, is " + << last_msg_->amplitude_value[34]; + EXPECT_EQ(last_msg_->amplitude_value[35], 186) + << "incorrect value for amplitude_value[35], expected 186, is " + << last_msg_->amplitude_value[35]; + EXPECT_EQ(last_msg_->amplitude_value[36], 99) + << "incorrect value for amplitude_value[36], expected 99, is " + << last_msg_->amplitude_value[36]; + EXPECT_EQ(last_msg_->amplitude_value[37], 63) + << "incorrect value for amplitude_value[37], expected 63, is " + << last_msg_->amplitude_value[37]; + EXPECT_EQ(last_msg_->amplitude_value[38], 105) + << "incorrect value for amplitude_value[38], expected 105, is " + << last_msg_->amplitude_value[38]; + EXPECT_EQ(last_msg_->amplitude_value[39], 116) + << "incorrect value for amplitude_value[39], expected 116, is " + << last_msg_->amplitude_value[39]; + EXPECT_EQ(last_msg_->amplitude_value[40], 216) + << "incorrect value for amplitude_value[40], expected 216, is " + << last_msg_->amplitude_value[40]; + EXPECT_EQ(last_msg_->amplitude_value[41], 44) + << "incorrect value for amplitude_value[41], expected 44, is " + << last_msg_->amplitude_value[41]; + EXPECT_EQ(last_msg_->amplitude_value[42], 67) + << "incorrect value for amplitude_value[42], expected 67, is " + << last_msg_->amplitude_value[42]; + EXPECT_EQ(last_msg_->amplitude_value[43], 212) + << "incorrect value for amplitude_value[43], expected 212, is " + << last_msg_->amplitude_value[43]; + EXPECT_EQ(last_msg_->amplitude_value[44], 156) + << "incorrect value for amplitude_value[44], expected 156, is " + << last_msg_->amplitude_value[44]; + EXPECT_EQ(last_msg_->amplitude_value[45], 75) + << "incorrect value for amplitude_value[45], expected 75, is " + << last_msg_->amplitude_value[45]; + EXPECT_EQ(last_msg_->amplitude_value[46], 81) + << "incorrect value for amplitude_value[46], expected 81, is " + << last_msg_->amplitude_value[46]; + EXPECT_EQ(last_msg_->amplitude_value[47], 53) + << "incorrect value for amplitude_value[47], expected 53, is " + << last_msg_->amplitude_value[47]; + EXPECT_EQ(last_msg_->amplitude_value[48], 250) + << "incorrect value for amplitude_value[48], expected 250, is " + << last_msg_->amplitude_value[48]; + EXPECT_EQ(last_msg_->amplitude_value[49], 225) + << "incorrect value for amplitude_value[49], expected 225, is " + << last_msg_->amplitude_value[49]; + EXPECT_EQ(last_msg_->amplitude_value[50], 23) + << "incorrect value for amplitude_value[50], expected 23, is " + << last_msg_->amplitude_value[50]; + EXPECT_EQ(last_msg_->amplitude_value[51], 205) + << "incorrect value for amplitude_value[51], expected 205, is " + << last_msg_->amplitude_value[51]; + EXPECT_EQ(last_msg_->amplitude_value[52], 26) + << "incorrect value for amplitude_value[52], expected 26, is " + << last_msg_->amplitude_value[52]; + EXPECT_EQ(last_msg_->amplitude_value[53], 34) + << "incorrect value for amplitude_value[53], expected 34, is " + << last_msg_->amplitude_value[53]; + EXPECT_EQ(last_msg_->amplitude_value[54], 119) + << "incorrect value for amplitude_value[54], expected 119, is " + << last_msg_->amplitude_value[54]; + EXPECT_EQ(last_msg_->amplitude_value[55], 50) + << "incorrect value for amplitude_value[55], expected 50, is " + << last_msg_->amplitude_value[55]; + EXPECT_EQ(last_msg_->amplitude_value[56], 101) + << "incorrect value for amplitude_value[56], expected 101, is " + << last_msg_->amplitude_value[56]; + EXPECT_EQ(last_msg_->amplitude_value[57], 64) + << "incorrect value for amplitude_value[57], expected 64, is " + << last_msg_->amplitude_value[57]; + EXPECT_EQ(last_msg_->amplitude_value[58], 7) + << "incorrect value for amplitude_value[58], expected 7, is " + << last_msg_->amplitude_value[58]; + EXPECT_EQ(last_msg_->amplitude_value[59], 231) + << "incorrect value for amplitude_value[59], expected 231, is " + << last_msg_->amplitude_value[59]; + EXPECT_EQ(last_msg_->amplitude_value[60], 124) + << "incorrect value for amplitude_value[60], expected 124, is " + << last_msg_->amplitude_value[60]; + EXPECT_EQ(last_msg_->amplitude_value[61], 183) + << "incorrect value for amplitude_value[61], expected 183, is " + << last_msg_->amplitude_value[61]; + EXPECT_EQ(last_msg_->amplitude_value[62], 203) + << "incorrect value for amplitude_value[62], expected 203, is " + << last_msg_->amplitude_value[62]; + EXPECT_EQ(last_msg_->amplitude_value[63], 102) + << "incorrect value for amplitude_value[63], expected 102, is " + << last_msg_->amplitude_value[63]; + EXPECT_EQ(last_msg_->amplitude_value[64], 234) + << "incorrect value for amplitude_value[64], expected 234, is " + << last_msg_->amplitude_value[64]; + EXPECT_EQ(last_msg_->amplitude_value[65], 84) + << "incorrect value for amplitude_value[65], expected 84, is " + << last_msg_->amplitude_value[65]; + EXPECT_EQ(last_msg_->amplitude_value[66], 83) + << "incorrect value for amplitude_value[66], expected 83, is " + << last_msg_->amplitude_value[66]; + EXPECT_EQ(last_msg_->amplitude_value[67], 208) + << "incorrect value for amplitude_value[67], expected 208, is " + << last_msg_->amplitude_value[67]; + EXPECT_EQ(last_msg_->amplitude_value[68], 23) + << "incorrect value for amplitude_value[68], expected 23, is " + << last_msg_->amplitude_value[68]; + EXPECT_EQ(last_msg_->amplitude_value[69], 68) + << "incorrect value for amplitude_value[69], expected 68, is " + << last_msg_->amplitude_value[69]; + EXPECT_EQ(last_msg_->amplitude_value[70], 54) + << "incorrect value for amplitude_value[70], expected 54, is " + << last_msg_->amplitude_value[70]; + EXPECT_EQ(last_msg_->amplitude_value[71], 179) + << "incorrect value for amplitude_value[71], expected 179, is " + << last_msg_->amplitude_value[71]; + EXPECT_EQ(last_msg_->amplitude_value[72], 98) + << "incorrect value for amplitude_value[72], expected 98, is " + << last_msg_->amplitude_value[72]; + EXPECT_EQ(last_msg_->amplitude_value[73], 96) + << "incorrect value for amplitude_value[73], expected 96, is " + << last_msg_->amplitude_value[73]; + EXPECT_EQ(last_msg_->amplitude_value[74], 116) + << "incorrect value for amplitude_value[74], expected 116, is " + << last_msg_->amplitude_value[74]; + EXPECT_EQ(last_msg_->amplitude_value[75], 244) + << "incorrect value for amplitude_value[75], expected 244, is " + << last_msg_->amplitude_value[75]; + EXPECT_EQ(last_msg_->amplitude_value[76], 246) + << "incorrect value for amplitude_value[76], expected 246, is " + << last_msg_->amplitude_value[76]; + EXPECT_EQ(last_msg_->amplitude_value[77], 94) + << "incorrect value for amplitude_value[77], expected 94, is " + << last_msg_->amplitude_value[77]; + EXPECT_EQ(last_msg_->amplitude_value[78], 104) + << "incorrect value for amplitude_value[78], expected 104, is " + << last_msg_->amplitude_value[78]; + EXPECT_EQ(last_msg_->amplitude_value[79], 94) + << "incorrect value for amplitude_value[79], expected 94, is " + << last_msg_->amplitude_value[79]; + EXPECT_EQ(last_msg_->amplitude_value[80], 13) + << "incorrect value for amplitude_value[80], expected 13, is " + << last_msg_->amplitude_value[80]; + EXPECT_EQ(last_msg_->amplitude_value[81], 56) + << "incorrect value for amplitude_value[81], expected 56, is " + << last_msg_->amplitude_value[81]; + EXPECT_EQ(last_msg_->amplitude_value[82], 210) + << "incorrect value for amplitude_value[82], expected 210, is " + << last_msg_->amplitude_value[82]; + EXPECT_EQ(last_msg_->amplitude_value[83], 18) + << "incorrect value for amplitude_value[83], expected 18, is " + << last_msg_->amplitude_value[83]; + EXPECT_EQ(last_msg_->amplitude_value[84], 191) + << "incorrect value for amplitude_value[84], expected 191, is " + << last_msg_->amplitude_value[84]; + EXPECT_EQ(last_msg_->amplitude_value[85], 22) + << "incorrect value for amplitude_value[85], expected 22, is " + << last_msg_->amplitude_value[85]; + EXPECT_EQ(last_msg_->amplitude_value[86], 133) + << "incorrect value for amplitude_value[86], expected 133, is " + << last_msg_->amplitude_value[86]; + EXPECT_EQ(last_msg_->amplitude_value[87], 81) + << "incorrect value for amplitude_value[87], expected 81, is " + << last_msg_->amplitude_value[87]; + EXPECT_EQ(last_msg_->amplitude_value[88], 153) + << "incorrect value for amplitude_value[88], expected 153, is " + << last_msg_->amplitude_value[88]; + EXPECT_EQ(last_msg_->amplitude_value[89], 159) + << "incorrect value for amplitude_value[89], expected 159, is " + << last_msg_->amplitude_value[89]; + EXPECT_EQ(last_msg_->amplitude_value[90], 161) + << "incorrect value for amplitude_value[90], expected 161, is " + << last_msg_->amplitude_value[90]; + EXPECT_EQ(last_msg_->amplitude_value[91], 219) + << "incorrect value for amplitude_value[91], expected 219, is " + << last_msg_->amplitude_value[91]; + EXPECT_EQ(last_msg_->amplitude_value[92], 59) + << "incorrect value for amplitude_value[92], expected 59, is " + << last_msg_->amplitude_value[92]; + EXPECT_EQ(last_msg_->amplitude_value[93], 21) + << "incorrect value for amplitude_value[93], expected 21, is " + << last_msg_->amplitude_value[93]; + EXPECT_EQ(last_msg_->amplitude_value[94], 164) + << "incorrect value for amplitude_value[94], expected 164, is " + << last_msg_->amplitude_value[94]; + EXPECT_EQ(last_msg_->amplitude_value[95], 121) + << "incorrect value for amplitude_value[95], expected 121, is " + << last_msg_->amplitude_value[95]; + EXPECT_EQ(last_msg_->amplitude_value[96], 145) + << "incorrect value for amplitude_value[96], expected 145, is " + << last_msg_->amplitude_value[96]; + EXPECT_EQ(last_msg_->amplitude_value[97], 203) + << "incorrect value for amplitude_value[97], expected 203, is " + << last_msg_->amplitude_value[97]; + EXPECT_EQ(last_msg_->amplitude_value[98], 171) + << "incorrect value for amplitude_value[98], expected 171, is " + << last_msg_->amplitude_value[98]; + EXPECT_EQ(last_msg_->amplitude_value[99], 132) + << "incorrect value for amplitude_value[99], expected 132, is " + << last_msg_->amplitude_value[99]; + EXPECT_EQ(last_msg_->amplitude_value[100], 57) + << "incorrect value for amplitude_value[100], expected 57, is " + << last_msg_->amplitude_value[100]; + EXPECT_EQ(last_msg_->amplitude_value[101], 180) + << "incorrect value for amplitude_value[101], expected 180, is " + << last_msg_->amplitude_value[101]; + EXPECT_EQ(last_msg_->amplitude_value[102], 102) + << "incorrect value for amplitude_value[102], expected 102, is " + << last_msg_->amplitude_value[102]; + EXPECT_EQ(last_msg_->amplitude_value[103], 101) + << "incorrect value for amplitude_value[103], expected 101, is " + << last_msg_->amplitude_value[103]; + EXPECT_EQ(last_msg_->amplitude_value[104], 11) + << "incorrect value for amplitude_value[104], expected 11, is " + << last_msg_->amplitude_value[104]; + EXPECT_EQ(last_msg_->amplitude_value[105], 229) + << "incorrect value for amplitude_value[105], expected 229, is " + << last_msg_->amplitude_value[105]; + EXPECT_EQ(last_msg_->amplitude_value[106], 175) + << "incorrect value for amplitude_value[106], expected 175, is " + << last_msg_->amplitude_value[106]; + EXPECT_EQ(last_msg_->amplitude_value[107], 145) + << "incorrect value for amplitude_value[107], expected 145, is " + << last_msg_->amplitude_value[107]; + EXPECT_EQ(last_msg_->amplitude_value[108], 73) + << "incorrect value for amplitude_value[108], expected 73, is " + << last_msg_->amplitude_value[108]; + EXPECT_EQ(last_msg_->amplitude_value[109], 72) + << "incorrect value for amplitude_value[109], expected 72, is " + << last_msg_->amplitude_value[109]; + EXPECT_EQ(last_msg_->amplitude_value[110], 124) + << "incorrect value for amplitude_value[110], expected 124, is " + << last_msg_->amplitude_value[110]; + EXPECT_EQ(last_msg_->amplitude_value[111], 4) + << "incorrect value for amplitude_value[111], expected 4, is " + << last_msg_->amplitude_value[111]; + EXPECT_EQ(last_msg_->amplitude_value[112], 184) + << "incorrect value for amplitude_value[112], expected 184, is " + << last_msg_->amplitude_value[112]; + EXPECT_EQ(last_msg_->amplitude_value[113], 228) + << "incorrect value for amplitude_value[113], expected 228, is " + << last_msg_->amplitude_value[113]; + EXPECT_EQ(last_msg_->amplitude_value[114], 61) + << "incorrect value for amplitude_value[114], expected 61, is " + << last_msg_->amplitude_value[114]; + EXPECT_EQ(last_msg_->amplitude_value[115], 234) + << "incorrect value for amplitude_value[115], expected 234, is " + << last_msg_->amplitude_value[115]; + EXPECT_EQ(last_msg_->amplitude_value[116], 218) + << "incorrect value for amplitude_value[116], expected 218, is " + << last_msg_->amplitude_value[116]; + EXPECT_EQ(last_msg_->amplitude_value[117], 62) + << "incorrect value for amplitude_value[117], expected 62, is " + << last_msg_->amplitude_value[117]; + EXPECT_EQ(last_msg_->amplitude_value[118], 226) + << "incorrect value for amplitude_value[118], expected 226, is " + << last_msg_->amplitude_value[118]; + EXPECT_EQ(last_msg_->amplitude_value[119], 217) + << "incorrect value for amplitude_value[119], expected 217, is " + << last_msg_->amplitude_value[119]; + EXPECT_EQ(last_msg_->amplitude_value[120], 193) + << "incorrect value for amplitude_value[120], expected 193, is " + << last_msg_->amplitude_value[120]; + EXPECT_EQ(last_msg_->amplitude_value[121], 7) + << "incorrect value for amplitude_value[121], expected 7, is " + << last_msg_->amplitude_value[121]; + EXPECT_EQ(last_msg_->amplitude_value[122], 109) + << "incorrect value for amplitude_value[122], expected 109, is " + << last_msg_->amplitude_value[122]; + EXPECT_EQ(last_msg_->amplitude_value[123], 44) + << "incorrect value for amplitude_value[123], expected 44, is " + << last_msg_->amplitude_value[123]; + EXPECT_EQ(last_msg_->amplitude_value[124], 83) + << "incorrect value for amplitude_value[124], expected 83, is " + << last_msg_->amplitude_value[124]; + EXPECT_EQ(last_msg_->amplitude_value[125], 201) + << "incorrect value for amplitude_value[125], expected 201, is " + << last_msg_->amplitude_value[125]; + EXPECT_EQ(last_msg_->amplitude_value[126], 20) + << "incorrect value for amplitude_value[126], expected 20, is " + << last_msg_->amplitude_value[126]; + EXPECT_EQ(last_msg_->amplitude_value[127], 101) + << "incorrect value for amplitude_value[127], expected 101, is " + << last_msg_->amplitude_value[127]; + EXPECT_EQ(last_msg_->amplitude_value[128], 9) + << "incorrect value for amplitude_value[128], expected 9, is " + << last_msg_->amplitude_value[128]; + EXPECT_EQ(last_msg_->amplitude_value[129], 140) + << "incorrect value for amplitude_value[129], expected 140, is " + << last_msg_->amplitude_value[129]; + EXPECT_EQ(last_msg_->amplitude_value[130], 186) + << "incorrect value for amplitude_value[130], expected 186, is " + << last_msg_->amplitude_value[130]; + EXPECT_EQ(last_msg_->amplitude_value[131], 162) + << "incorrect value for amplitude_value[131], expected 162, is " + << last_msg_->amplitude_value[131]; + EXPECT_EQ(last_msg_->amplitude_value[132], 81) + << "incorrect value for amplitude_value[132], expected 81, is " + << last_msg_->amplitude_value[132]; + EXPECT_EQ(last_msg_->amplitude_value[133], 91) + << "incorrect value for amplitude_value[133], expected 91, is " + << last_msg_->amplitude_value[133]; + EXPECT_EQ(last_msg_->amplitude_value[134], 30) + << "incorrect value for amplitude_value[134], expected 30, is " + << last_msg_->amplitude_value[134]; + EXPECT_EQ(last_msg_->amplitude_value[135], 231) + << "incorrect value for amplitude_value[135], expected 231, is " + << last_msg_->amplitude_value[135]; + EXPECT_EQ(last_msg_->amplitude_value[136], 161) + << "incorrect value for amplitude_value[136], expected 161, is " + << last_msg_->amplitude_value[136]; + EXPECT_EQ(last_msg_->amplitude_value[137], 81) + << "incorrect value for amplitude_value[137], expected 81, is " + << last_msg_->amplitude_value[137]; + EXPECT_EQ(last_msg_->amplitude_value[138], 216) + << "incorrect value for amplitude_value[138], expected 216, is " + << last_msg_->amplitude_value[138]; + EXPECT_EQ(last_msg_->amplitude_value[139], 114) + << "incorrect value for amplitude_value[139], expected 114, is " + << last_msg_->amplitude_value[139]; + EXPECT_EQ(last_msg_->amplitude_value[140], 60) + << "incorrect value for amplitude_value[140], expected 60, is " + << last_msg_->amplitude_value[140]; + EXPECT_EQ(last_msg_->amplitude_value[141], 231) + << "incorrect value for amplitude_value[141], expected 231, is " + << last_msg_->amplitude_value[141]; + EXPECT_EQ(last_msg_->amplitude_value[142], 163) + << "incorrect value for amplitude_value[142], expected 163, is " + << last_msg_->amplitude_value[142]; + EXPECT_EQ(last_msg_->amplitude_value[143], 163) + << "incorrect value for amplitude_value[143], expected 163, is " + << last_msg_->amplitude_value[143]; + EXPECT_EQ(last_msg_->amplitude_value[144], 49) + << "incorrect value for amplitude_value[144], expected 49, is " + << last_msg_->amplitude_value[144]; + EXPECT_EQ(last_msg_->amplitude_value[145], 237) + << "incorrect value for amplitude_value[145], expected 237, is " + << last_msg_->amplitude_value[145]; + EXPECT_EQ(last_msg_->amplitude_value[146], 244) + << "incorrect value for amplitude_value[146], expected 244, is " + << last_msg_->amplitude_value[146]; + EXPECT_EQ(last_msg_->amplitude_value[147], 185) + << "incorrect value for amplitude_value[147], expected 185, is " + << last_msg_->amplitude_value[147]; + EXPECT_EQ(last_msg_->amplitude_value[148], 240) + << "incorrect value for amplitude_value[148], expected 240, is " + << last_msg_->amplitude_value[148]; + EXPECT_EQ(last_msg_->amplitude_value[149], 89) + << "incorrect value for amplitude_value[149], expected 89, is " + << last_msg_->amplitude_value[149]; + EXPECT_EQ(last_msg_->amplitude_value[150], 143) + << "incorrect value for amplitude_value[150], expected 143, is " + << last_msg_->amplitude_value[150]; + EXPECT_EQ(last_msg_->amplitude_value[151], 174) + << "incorrect value for amplitude_value[151], expected 174, is " + << last_msg_->amplitude_value[151]; + EXPECT_EQ(last_msg_->amplitude_value[152], 165) + << "incorrect value for amplitude_value[152], expected 165, is " + << last_msg_->amplitude_value[152]; + EXPECT_EQ(last_msg_->amplitude_value[153], 211) + << "incorrect value for amplitude_value[153], expected 211, is " + << last_msg_->amplitude_value[153]; + EXPECT_EQ(last_msg_->amplitude_value[154], 241) + << "incorrect value for amplitude_value[154], expected 241, is " + << last_msg_->amplitude_value[154]; + EXPECT_EQ(last_msg_->amplitude_value[155], 13) + << "incorrect value for amplitude_value[155], expected 13, is " + << last_msg_->amplitude_value[155]; + EXPECT_EQ(last_msg_->amplitude_value[156], 16) + << "incorrect value for amplitude_value[156], expected 16, is " + << last_msg_->amplitude_value[156]; + EXPECT_EQ(last_msg_->amplitude_value[157], 61) + << "incorrect value for amplitude_value[157], expected 61, is " + << last_msg_->amplitude_value[157]; + EXPECT_EQ(last_msg_->amplitude_value[158], 141) + << "incorrect value for amplitude_value[158], expected 141, is " + << last_msg_->amplitude_value[158]; + EXPECT_EQ(last_msg_->amplitude_value[159], 101) + << "incorrect value for amplitude_value[159], expected 101, is " + << last_msg_->amplitude_value[159]; + EXPECT_EQ(last_msg_->amplitude_value[160], 89) + << "incorrect value for amplitude_value[160], expected 89, is " + << last_msg_->amplitude_value[160]; + EXPECT_EQ(last_msg_->amplitude_value[161], 37) + << "incorrect value for amplitude_value[161], expected 37, is " + << last_msg_->amplitude_value[161]; + EXPECT_EQ(last_msg_->amplitude_value[162], 117) + << "incorrect value for amplitude_value[162], expected 117, is " + << last_msg_->amplitude_value[162]; + EXPECT_EQ(last_msg_->amplitude_value[163], 189) + << "incorrect value for amplitude_value[163], expected 189, is " + << last_msg_->amplitude_value[163]; + EXPECT_EQ(last_msg_->amplitude_value[164], 86) + << "incorrect value for amplitude_value[164], expected 86, is " + << last_msg_->amplitude_value[164]; + EXPECT_EQ(last_msg_->amplitude_value[165], 118) + << "incorrect value for amplitude_value[165], expected 118, is " + << last_msg_->amplitude_value[165]; + EXPECT_EQ(last_msg_->amplitude_value[166], 176) + << "incorrect value for amplitude_value[166], expected 176, is " + << last_msg_->amplitude_value[166]; + EXPECT_EQ(last_msg_->amplitude_value[167], 228) + << "incorrect value for amplitude_value[167], expected 228, is " + << last_msg_->amplitude_value[167]; + EXPECT_EQ(last_msg_->amplitude_value[168], 12) + << "incorrect value for amplitude_value[168], expected 12, is " + << last_msg_->amplitude_value[168]; + EXPECT_EQ(last_msg_->amplitude_value[169], 14) + << "incorrect value for amplitude_value[169], expected 14, is " + << last_msg_->amplitude_value[169]; + EXPECT_EQ(last_msg_->amplitude_value[170], 119) + << "incorrect value for amplitude_value[170], expected 119, is " + << last_msg_->amplitude_value[170]; + EXPECT_EQ(last_msg_->amplitude_value[171], 135) + << "incorrect value for amplitude_value[171], expected 135, is " + << last_msg_->amplitude_value[171]; + EXPECT_EQ(last_msg_->amplitude_value[172], 129) + << "incorrect value for amplitude_value[172], expected 129, is " + << last_msg_->amplitude_value[172]; + EXPECT_EQ(last_msg_->amplitude_value[173], 243) + << "incorrect value for amplitude_value[173], expected 243, is " + << last_msg_->amplitude_value[173]; + EXPECT_EQ(last_msg_->amplitude_value[174], 50) + << "incorrect value for amplitude_value[174], expected 50, is " + << last_msg_->amplitude_value[174]; + EXPECT_EQ(last_msg_->amplitude_value[175], 29) + << "incorrect value for amplitude_value[175], expected 29, is " + << last_msg_->amplitude_value[175]; + EXPECT_EQ(last_msg_->amplitude_value[176], 207) + << "incorrect value for amplitude_value[176], expected 207, is " + << last_msg_->amplitude_value[176]; + EXPECT_EQ(last_msg_->amplitude_value[177], 198) + << "incorrect value for amplitude_value[177], expected 198, is " + << last_msg_->amplitude_value[177]; + EXPECT_EQ(last_msg_->amplitude_value[178], 117) + << "incorrect value for amplitude_value[178], expected 117, is " + << last_msg_->amplitude_value[178]; + EXPECT_EQ(last_msg_->amplitude_value[179], 100) + << "incorrect value for amplitude_value[179], expected 100, is " + << last_msg_->amplitude_value[179]; + EXPECT_EQ(last_msg_->amplitude_value[180], 225) + << "incorrect value for amplitude_value[180], expected 225, is " + << last_msg_->amplitude_value[180]; + EXPECT_EQ(last_msg_->amplitude_value[181], 6) + << "incorrect value for amplitude_value[181], expected 6, is " + << last_msg_->amplitude_value[181]; + EXPECT_EQ(last_msg_->amplitude_value[182], 139) + << "incorrect value for amplitude_value[182], expected 139, is " + << last_msg_->amplitude_value[182]; + EXPECT_EQ(last_msg_->amplitude_value[183], 110) + << "incorrect value for amplitude_value[183], expected 110, is " + << last_msg_->amplitude_value[183]; + EXPECT_EQ(last_msg_->amplitude_value[184], 39) + << "incorrect value for amplitude_value[184], expected 39, is " + << last_msg_->amplitude_value[184]; + EXPECT_EQ(last_msg_->amplitude_value[185], 210) + << "incorrect value for amplitude_value[185], expected 210, is " + << last_msg_->amplitude_value[185]; + EXPECT_EQ(last_msg_->amplitude_value[186], 68) + << "incorrect value for amplitude_value[186], expected 68, is " + << last_msg_->amplitude_value[186]; + EXPECT_EQ(last_msg_->amplitude_value[187], 199) + << "incorrect value for amplitude_value[187], expected 199, is " + << last_msg_->amplitude_value[187]; + EXPECT_EQ(last_msg_->amplitude_value[188], 43) + << "incorrect value for amplitude_value[188], expected 43, is " + << last_msg_->amplitude_value[188]; + EXPECT_EQ(last_msg_->amplitude_value[189], 132) + << "incorrect value for amplitude_value[189], expected 132, is " + << last_msg_->amplitude_value[189]; + EXPECT_EQ(last_msg_->amplitude_value[190], 64) + << "incorrect value for amplitude_value[190], expected 64, is " + << last_msg_->amplitude_value[190]; + EXPECT_EQ(last_msg_->amplitude_value[191], 17) + << "incorrect value for amplitude_value[191], expected 17, is " + << last_msg_->amplitude_value[191]; + EXPECT_EQ(last_msg_->amplitude_value[192], 51) + << "incorrect value for amplitude_value[192], expected 51, is " + << last_msg_->amplitude_value[192]; + EXPECT_EQ(last_msg_->amplitude_value[193], 173) + << "incorrect value for amplitude_value[193], expected 173, is " + << last_msg_->amplitude_value[193]; + EXPECT_EQ(last_msg_->amplitude_value[194], 181) + << "incorrect value for amplitude_value[194], expected 181, is " + << last_msg_->amplitude_value[194]; + EXPECT_EQ(last_msg_->amplitude_value[195], 12) + << "incorrect value for amplitude_value[195], expected 12, is " + << last_msg_->amplitude_value[195]; + EXPECT_EQ(last_msg_->amplitude_value[196], 140) + << "incorrect value for amplitude_value[196], expected 140, is " + << last_msg_->amplitude_value[196]; + EXPECT_EQ(last_msg_->amplitude_value[197], 16) + << "incorrect value for amplitude_value[197], expected 16, is " + << last_msg_->amplitude_value[197]; + EXPECT_EQ(last_msg_->amplitude_value[198], 247) + << "incorrect value for amplitude_value[198], expected 247, is " + << last_msg_->amplitude_value[198]; + EXPECT_EQ(last_msg_->amplitude_value[199], 84) + << "incorrect value for amplitude_value[199], expected 84, is " + << last_msg_->amplitude_value[199]; + EXPECT_EQ(last_msg_->amplitude_value[200], 183) + << "incorrect value for amplitude_value[200], expected 183, is " + << last_msg_->amplitude_value[200]; + EXPECT_EQ(last_msg_->amplitude_value[201], 105) + << "incorrect value for amplitude_value[201], expected 105, is " + << last_msg_->amplitude_value[201]; + EXPECT_EQ(last_msg_->amplitude_value[202], 39) + << "incorrect value for amplitude_value[202], expected 39, is " + << last_msg_->amplitude_value[202]; + EXPECT_EQ(last_msg_->amplitude_value[203], 157) + << "incorrect value for amplitude_value[203], expected 157, is " + << last_msg_->amplitude_value[203]; + EXPECT_EQ(last_msg_->amplitude_value[204], 77) + << "incorrect value for amplitude_value[204], expected 77, is " + << last_msg_->amplitude_value[204]; + EXPECT_EQ(last_msg_->amplitude_value[205], 30) + << "incorrect value for amplitude_value[205], expected 30, is " + << last_msg_->amplitude_value[205]; + EXPECT_EQ(last_msg_->amplitude_value[206], 205) + << "incorrect value for amplitude_value[206], expected 205, is " + << last_msg_->amplitude_value[206]; + EXPECT_EQ(last_msg_->amplitude_value[207], 194) + << "incorrect value for amplitude_value[207], expected 194, is " + << last_msg_->amplitude_value[207]; + EXPECT_EQ(last_msg_->amplitude_value[208], 59) + << "incorrect value for amplitude_value[208], expected 59, is " + << last_msg_->amplitude_value[208]; + EXPECT_EQ(last_msg_->amplitude_value[209], 64) + << "incorrect value for amplitude_value[209], expected 64, is " + << last_msg_->amplitude_value[209]; + EXPECT_EQ(last_msg_->amplitude_value[210], 241) + << "incorrect value for amplitude_value[210], expected 241, is " + << last_msg_->amplitude_value[210]; + EXPECT_EQ(last_msg_->amplitude_value[211], 183) + << "incorrect value for amplitude_value[211], expected 183, is " + << last_msg_->amplitude_value[211]; + EXPECT_EQ(last_msg_->amplitude_value[212], 238) + << "incorrect value for amplitude_value[212], expected 238, is " + << last_msg_->amplitude_value[212]; + EXPECT_EQ(last_msg_->amplitude_value[213], 105) + << "incorrect value for amplitude_value[213], expected 105, is " + << last_msg_->amplitude_value[213]; + EXPECT_EQ(last_msg_->amplitude_value[214], 181) + << "incorrect value for amplitude_value[214], expected 181, is " + << last_msg_->amplitude_value[214]; + EXPECT_EQ(last_msg_->amplitude_value[215], 170) + << "incorrect value for amplitude_value[215], expected 170, is " + << last_msg_->amplitude_value[215]; + EXPECT_EQ(last_msg_->amplitude_value[216], 45) + << "incorrect value for amplitude_value[216], expected 45, is " + << last_msg_->amplitude_value[216]; + EXPECT_EQ(last_msg_->amplitude_value[217], 8) + << "incorrect value for amplitude_value[217], expected 8, is " + << last_msg_->amplitude_value[217]; + EXPECT_EQ(last_msg_->amplitude_value[218], 166) + << "incorrect value for amplitude_value[218], expected 166, is " + << last_msg_->amplitude_value[218]; + EXPECT_EQ(last_msg_->amplitude_value[219], 164) + << "incorrect value for amplitude_value[219], expected 164, is " + << last_msg_->amplitude_value[219]; + EXPECT_EQ(last_msg_->amplitude_value[220], 238) + << "incorrect value for amplitude_value[220], expected 238, is " + << last_msg_->amplitude_value[220]; + EXPECT_EQ(last_msg_->amplitude_value[221], 83) + << "incorrect value for amplitude_value[221], expected 83, is " + << last_msg_->amplitude_value[221]; + EXPECT_EQ(last_msg_->amplitude_value[222], 148) + << "incorrect value for amplitude_value[222], expected 148, is " + << last_msg_->amplitude_value[222]; + EXPECT_EQ(last_msg_->amplitude_value[223], 173) + << "incorrect value for amplitude_value[223], expected 173, is " + << last_msg_->amplitude_value[223]; + EXPECT_EQ(last_msg_->amplitude_value[224], 108) + << "incorrect value for amplitude_value[224], expected 108, is " + << last_msg_->amplitude_value[224]; + EXPECT_EQ(last_msg_->amplitude_value[225], 228) + << "incorrect value for amplitude_value[225], expected 228, is " + << last_msg_->amplitude_value[225]; + EXPECT_EQ(last_msg_->amplitude_value[226], 67) + << "incorrect value for amplitude_value[226], expected 67, is " + << last_msg_->amplitude_value[226]; + EXPECT_EQ(last_msg_->amplitude_value[227], 89) + << "incorrect value for amplitude_value[227], expected 89, is " + << last_msg_->amplitude_value[227]; + EXPECT_EQ(last_msg_->amplitude_value[228], 189) + << "incorrect value for amplitude_value[228], expected 189, is " + << last_msg_->amplitude_value[228]; + EXPECT_EQ(last_msg_->amplitude_value[229], 67) + << "incorrect value for amplitude_value[229], expected 67, is " + << last_msg_->amplitude_value[229]; + EXPECT_EQ(last_msg_->amplitude_value[230], 26) + << "incorrect value for amplitude_value[230], expected 26, is " + << last_msg_->amplitude_value[230]; + EXPECT_EQ(last_msg_->channel_tag, 5878) + << "incorrect value for channel_tag, expected 5878, is " + << last_msg_->channel_tag; + EXPECT_LT((last_msg_->freq_ref * 100 - 6348.20019531 * 100), 0.05) + << "incorrect value for freq_ref, expected 6348.20019531, is " + << last_msg_->freq_ref; + EXPECT_LT((last_msg_->freq_step * 100 - 4608.20019531 * 100), 0.05) + << "incorrect value for freq_step, expected 4608.20019531, is " + << last_msg_->freq_step; + EXPECT_EQ(last_msg_->t.tow, 992295133) + << "incorrect value for t.tow, expected 992295133, is " + << last_msg_->t.tow; + EXPECT_EQ(last_msg_->t.wn, 6957) + << "incorrect value for t.wn, expected 6957, is " << last_msg_->t.wn; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgThreadState.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgThreadState.cc index 53eda4382..ebed5e645 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgThreadState.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgThreadState.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgThreadState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgThreadState.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgThreadState0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgThreadState0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgThreadState0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgThreadState0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_thread_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,99 +81,105 @@ class Test_legacy_auto_check_sbp_piksi_MsgThreadState0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_thread_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState0, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,246,215,26,109,97,105,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,156,9,0,0,73,138, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu = 0; - { - const char assign_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->stack_free = 2460; - - EXPECT_EQ(send_message( 0x17, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState0, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 109, 97, 105, 110, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 9, 0, 0, 73, 138, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_thread_state_t *test_msg = (msg_thread_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu = 0; + { + const char assign_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->name, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->stack_free = 2460; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu, 0) << "incorrect value for cpu, expected 0, is " << last_msg_->cpu; - { - const char check_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->name, expected string '" << check_string << "', is '" << last_msg_->name << "'"; - } - EXPECT_EQ(last_msg_->stack_free, 2460) << "incorrect value for stack_free, expected 2460, is " << last_msg_->stack_free; + EXPECT_EQ(send_message(0x17, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu, 0) + << "incorrect value for cpu, expected 0, is " << last_msg_->cpu; + { + const char check_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->name, expected string '" + << check_string << "', is '" << last_msg_->name << "'"; + } + EXPECT_EQ(last_msg_->stack_free, 2460) + << "incorrect value for stack_free, expected 2460, is " + << last_msg_->stack_free; } -class Test_legacy_auto_check_sbp_piksi_MsgThreadState1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgThreadState1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgThreadState1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgThreadState1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_thread_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -187,99 +189,105 @@ class Test_legacy_auto_check_sbp_piksi_MsgThreadState1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_thread_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState1, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,246,215,26,105,100,108,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,83,2,36,0,0,0,151,20, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu = 595; - { - const char assign_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->stack_free = 36; - - EXPECT_EQ(send_message( 0x17, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState1, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 105, 100, 108, 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 2, 36, 0, 0, 0, 151, 20, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_thread_state_t *test_msg = (msg_thread_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu = 595; + { + const char assign_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->name, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->stack_free = 36; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu, 595) << "incorrect value for cpu, expected 595, is " << last_msg_->cpu; - { - const char check_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->name, expected string '" << check_string << "', is '" << last_msg_->name << "'"; - } - EXPECT_EQ(last_msg_->stack_free, 36) << "incorrect value for stack_free, expected 36, is " << last_msg_->stack_free; + EXPECT_EQ(send_message(0x17, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu, 595) + << "incorrect value for cpu, expected 595, is " << last_msg_->cpu; + { + const char check_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->name, expected string '" + << check_string << "', is '" << last_msg_->name << "'"; + } + EXPECT_EQ(last_msg_->stack_free, 36) + << "incorrect value for stack_free, expected 36, is " + << last_msg_->stack_free; } -class Test_legacy_auto_check_sbp_piksi_MsgThreadState2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgThreadState2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgThreadState2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgThreadState2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_thread_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -289,99 +297,105 @@ class Test_legacy_auto_check_sbp_piksi_MsgThreadState2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_thread_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState2, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,246,215,26,78,65,80,32,73,83,82,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,116,4,0,0,226,60, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu = 14; - { - const char assign_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->stack_free = 1140; - - EXPECT_EQ(send_message( 0x17, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState2, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 78, 65, 80, 32, 73, 83, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 116, 4, 0, 0, 226, 60, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_thread_state_t *test_msg = (msg_thread_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu = 14; + { + const char assign_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->name, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->stack_free = 1140; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu, 14) << "incorrect value for cpu, expected 14, is " << last_msg_->cpu; - { - const char check_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->name, expected string '" << check_string << "', is '" << last_msg_->name << "'"; - } - EXPECT_EQ(last_msg_->stack_free, 1140) << "incorrect value for stack_free, expected 1140, is " << last_msg_->stack_free; + EXPECT_EQ(send_message(0x17, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu, 14) + << "incorrect value for cpu, expected 14, is " << last_msg_->cpu; + { + const char check_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->name, expected string '" + << check_string << "', is '" << last_msg_->name << "'"; + } + EXPECT_EQ(last_msg_->stack_free, 1140) + << "incorrect value for stack_free, expected 1140, is " + << last_msg_->stack_free; } -class Test_legacy_auto_check_sbp_piksi_MsgThreadState3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgThreadState3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgThreadState3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgThreadState3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_thread_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -391,99 +405,105 @@ class Test_legacy_auto_check_sbp_piksi_MsgThreadState3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_thread_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState3, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,246,215,26,83,66,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,196,19,0,0,90,169, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu = 1; - { - const char assign_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->stack_free = 5060; - - EXPECT_EQ(send_message( 0x17, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState3, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 83, 66, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 196, 19, 0, 0, 90, 169, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_thread_state_t *test_msg = (msg_thread_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu = 1; + { + const char assign_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->name, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->stack_free = 5060; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu, 1) << "incorrect value for cpu, expected 1, is " << last_msg_->cpu; - { - const char check_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->name, expected string '" << check_string << "', is '" << last_msg_->name << "'"; - } - EXPECT_EQ(last_msg_->stack_free, 5060) << "incorrect value for stack_free, expected 5060, is " << last_msg_->stack_free; + EXPECT_EQ(send_message(0x17, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu, 1) + << "incorrect value for cpu, expected 1, is " << last_msg_->cpu; + { + const char check_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->name, expected string '" + << check_string << "', is '" << last_msg_->name << "'"; + } + EXPECT_EQ(last_msg_->stack_free, 5060) + << "incorrect value for stack_free, expected 5060, is " + << last_msg_->stack_free; } -class Test_legacy_auto_check_sbp_piksi_MsgThreadState4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgThreadState4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgThreadState4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgThreadState4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_thread_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -493,99 +513,107 @@ class Test_legacy_auto_check_sbp_piksi_MsgThreadState4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_thread_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState4, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,246,215,26,109,97,110,97,103,101,32,97,99,113,0,0,0,0,0,0,0,0,0,0,7,0,20,9,0,0,47,75, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu = 7; - { - const char assign_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->stack_free = 2324; - - EXPECT_EQ(send_message( 0x17, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState4, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 246, 215, 26, 109, 97, 110, 97, 103, 101, 32, 97, 99, 113, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 20, 9, 0, 0, 47, 75, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_thread_state_t *test_msg = (msg_thread_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu = 7; + { + const char assign_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->name, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->stack_free = 2324; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu, 7) << "incorrect value for cpu, expected 7, is " << last_msg_->cpu; - { - const char check_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->name, expected string '" << check_string << "', is '" << last_msg_->name << "'"; - } - EXPECT_EQ(last_msg_->stack_free, 2324) << "incorrect value for stack_free, expected 2324, is " << last_msg_->stack_free; + EXPECT_EQ(send_message(0x17, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu, 7) + << "incorrect value for cpu, expected 7, is " << last_msg_->cpu; + { + const char check_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->name, expected string '" + << check_string << "', is '" << last_msg_->name << "'"; + } + EXPECT_EQ(last_msg_->stack_free, 2324) + << "incorrect value for stack_free, expected 2324, is " + << last_msg_->stack_free; } -class Test_legacy_auto_check_sbp_piksi_MsgThreadState5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgThreadState5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgThreadState5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgThreadState5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_thread_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -595,99 +623,105 @@ class Test_legacy_auto_check_sbp_piksi_MsgThreadState5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_thread_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState5, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,195,4,26,109,97,105,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148,9,0,0,195,212, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu = 0; - { - const char assign_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->stack_free = 2452; - - EXPECT_EQ(send_message( 0x17, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState5, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 109, 97, 105, 110, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 9, 0, 0, 195, 212, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_thread_state_t *test_msg = (msg_thread_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu = 0; + { + const char assign_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->name, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->stack_free = 2452; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu, 0) << "incorrect value for cpu, expected 0, is " << last_msg_->cpu; - { - const char check_string[] = { (char)109,(char)97,(char)105,(char)110,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->name, expected string '" << check_string << "', is '" << last_msg_->name << "'"; - } - EXPECT_EQ(last_msg_->stack_free, 2452) << "incorrect value for stack_free, expected 2452, is " << last_msg_->stack_free; + EXPECT_EQ(send_message(0x17, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu, 0) + << "incorrect value for cpu, expected 0, is " << last_msg_->cpu; + { + const char check_string[] = { + (char)109, (char)97, (char)105, (char)110, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->name, expected string '" + << check_string << "', is '" << last_msg_->name << "'"; + } + EXPECT_EQ(last_msg_->stack_free, 2452) + << "incorrect value for stack_free, expected 2452, is " + << last_msg_->stack_free; } -class Test_legacy_auto_check_sbp_piksi_MsgThreadState6 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgThreadState6() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgThreadState6 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgThreadState6() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_thread_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -697,99 +731,105 @@ class Test_legacy_auto_check_sbp_piksi_MsgThreadState6 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_thread_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState6, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,195,4,26,105,100,108,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,228,1,36,0,0,0,225,18, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu = 484; - { - const char assign_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->stack_free = 36; - - EXPECT_EQ(send_message( 0x17, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState6, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 105, 100, 108, 101, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 1, 36, 0, 0, 0, 225, 18, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_thread_state_t *test_msg = (msg_thread_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu = 484; + { + const char assign_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->name, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->stack_free = 36; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu, 484) << "incorrect value for cpu, expected 484, is " << last_msg_->cpu; - { - const char check_string[] = { (char)105,(char)100,(char)108,(char)101,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->name, expected string '" << check_string << "', is '" << last_msg_->name << "'"; - } - EXPECT_EQ(last_msg_->stack_free, 36) << "incorrect value for stack_free, expected 36, is " << last_msg_->stack_free; + EXPECT_EQ(send_message(0x17, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu, 484) + << "incorrect value for cpu, expected 484, is " << last_msg_->cpu; + { + const char check_string[] = { + (char)105, (char)100, (char)108, (char)101, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->name, expected string '" + << check_string << "', is '" << last_msg_->name << "'"; + } + EXPECT_EQ(last_msg_->stack_free, 36) + << "incorrect value for stack_free, expected 36, is " + << last_msg_->stack_free; } -class Test_legacy_auto_check_sbp_piksi_MsgThreadState7 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgThreadState7() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgThreadState7 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgThreadState7() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_thread_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -799,99 +839,105 @@ class Test_legacy_auto_check_sbp_piksi_MsgThreadState7 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_thread_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState7, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,195,4,26,78,65,80,32,73,83,82,0,0,0,0,0,0,0,0,0,0,0,0,0,138,1,92,7,0,0,166,116, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu = 394; - { - const char assign_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->stack_free = 1884; - - EXPECT_EQ(send_message( 0x17, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState7, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 78, 65, 80, 32, 73, 83, 82, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 138, 1, 92, 7, 0, 0, 166, 116, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_thread_state_t *test_msg = (msg_thread_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu = 394; + { + const char assign_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->name, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->stack_free = 1884; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu, 394) << "incorrect value for cpu, expected 394, is " << last_msg_->cpu; - { - const char check_string[] = { (char)78,(char)65,(char)80,(char)32,(char)73,(char)83,(char)82,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->name, expected string '" << check_string << "', is '" << last_msg_->name << "'"; - } - EXPECT_EQ(last_msg_->stack_free, 1884) << "incorrect value for stack_free, expected 1884, is " << last_msg_->stack_free; + EXPECT_EQ(send_message(0x17, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu, 394) + << "incorrect value for cpu, expected 394, is " << last_msg_->cpu; + { + const char check_string[] = { + (char)78, (char)65, (char)80, (char)32, (char)73, (char)83, (char)82, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->name, expected string '" + << check_string << "', is '" << last_msg_->name << "'"; + } + EXPECT_EQ(last_msg_->stack_free, 1884) + << "incorrect value for stack_free, expected 1884, is " + << last_msg_->stack_free; } -class Test_legacy_auto_check_sbp_piksi_MsgThreadState8 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgThreadState8() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgThreadState8 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgThreadState8() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_thread_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -901,99 +947,105 @@ class Test_legacy_auto_check_sbp_piksi_MsgThreadState8 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_thread_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState8, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,195,4,26,83,66,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,4,12,0,0,229,174, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu = 1; - { - const char assign_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->stack_free = 3076; - - EXPECT_EQ(send_message( 0x17, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState8, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 83, 66, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 12, 0, 0, 229, 174, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_thread_state_t *test_msg = (msg_thread_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu = 1; + { + const char assign_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->name, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->stack_free = 3076; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu, 1) << "incorrect value for cpu, expected 1, is " << last_msg_->cpu; - { - const char check_string[] = { (char)83,(char)66,(char)80,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->name, expected string '" << check_string << "', is '" << last_msg_->name << "'"; - } - EXPECT_EQ(last_msg_->stack_free, 3076) << "incorrect value for stack_free, expected 3076, is " << last_msg_->stack_free; + EXPECT_EQ(send_message(0x17, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu, 1) + << "incorrect value for cpu, expected 1, is " << last_msg_->cpu; + { + const char check_string[] = { + (char)83, (char)66, (char)80, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->name, expected string '" + << check_string << "', is '" << last_msg_->name << "'"; + } + EXPECT_EQ(last_msg_->stack_free, 3076) + << "incorrect value for stack_free, expected 3076, is " + << last_msg_->stack_free; } -class Test_legacy_auto_check_sbp_piksi_MsgThreadState9 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgThreadState9() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgThreadState9 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgThreadState9() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_thread_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -1003,99 +1055,107 @@ class Test_legacy_auto_check_sbp_piksi_MsgThreadState9 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_thread_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState9, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,195,4,26,109,97,110,97,103,101,32,97,99,113,0,0,0,0,0,0,0,0,0,0,10,0,124,9,0,0,52,2, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu = 10; - { - const char assign_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->stack_free = 2428; - - EXPECT_EQ(send_message( 0x17, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState9, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 109, 97, 110, 97, 103, 101, 32, 97, 99, 113, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 124, 9, 0, 0, 52, 2, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_thread_state_t *test_msg = (msg_thread_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu = 10; + { + const char assign_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->name, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->stack_free = 2428; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu, 10) << "incorrect value for cpu, expected 10, is " << last_msg_->cpu; - { - const char check_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)97,(char)99,(char)113,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->name, expected string '" << check_string << "', is '" << last_msg_->name << "'"; - } - EXPECT_EQ(last_msg_->stack_free, 2428) << "incorrect value for stack_free, expected 2428, is " << last_msg_->stack_free; + EXPECT_EQ(send_message(0x17, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu, 10) + << "incorrect value for cpu, expected 10, is " << last_msg_->cpu; + { + const char check_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)97, + (char)99, (char)113, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->name, expected string '" + << check_string << "', is '" << last_msg_->name << "'"; + } + EXPECT_EQ(last_msg_->stack_free, 2428) + << "incorrect value for stack_free, expected 2428, is " + << last_msg_->stack_free; } -class Test_legacy_auto_check_sbp_piksi_MsgThreadState10 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgThreadState10() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgThreadState10 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgThreadState10() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_thread_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_thread_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -1105,48 +1165,62 @@ class Test_legacy_auto_check_sbp_piksi_MsgThreadState10 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_thread_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState10, Test) -{ - - uint8_t encoded_frame[] = {85,23,0,195,4,26,109,97,110,97,103,101,32,116,114,97,99,107,0,0,0,0,0,0,0,0,0,0,28,9,0,0,122,54, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_thread_state_t* test_msg = ( msg_thread_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cpu = 0; - { - const char assign_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)116,(char)114,(char)97,(char)99,(char)107,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - memcpy(test_msg->name, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->name) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->stack_free = 2332; - - EXPECT_EQ(send_message( 0x17, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgThreadState10, Test) { + uint8_t encoded_frame[] = { + 85, 23, 0, 195, 4, 26, 109, 97, 110, 97, 103, 101, 32, 116, 114, 97, 99, + 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 9, 0, 0, 122, 54, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_thread_state_t *test_msg = (msg_thread_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cpu = 0; + { + const char assign_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)116, + (char)114, (char)97, (char)99, (char)107, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + memcpy(test_msg->name, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->name) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->stack_free = 2332; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cpu, 0) << "incorrect value for cpu, expected 0, is " << last_msg_->cpu; - { - const char check_string[] = { (char)109,(char)97,(char)110,(char)97,(char)103,(char)101,(char)32,(char)116,(char)114,(char)97,(char)99,(char)107,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->name, expected string '" << check_string << "', is '" << last_msg_->name << "'"; - } - EXPECT_EQ(last_msg_->stack_free, 2332) << "incorrect value for stack_free, expected 2332, is " << last_msg_->stack_free; + EXPECT_EQ(send_message(0x17, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cpu, 0) + << "incorrect value for cpu, expected 0, is " << last_msg_->cpu; + { + const char check_string[] = {(char)109, (char)97, (char)110, (char)97, + (char)103, (char)101, (char)32, (char)116, + (char)114, (char)97, (char)99, (char)107, + (char)0, (char)0, (char)0, (char)0, + (char)0, (char)0, (char)0, (char)0}; + EXPECT_EQ(memcmp(last_msg_->name, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->name, expected string '" + << check_string << "', is '" << last_msg_->name << "'"; + } + EXPECT_EQ(last_msg_->stack_free, 2332) + << "incorrect value for stack_free, expected 2332, is " + << last_msg_->stack_free; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgUartState.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgUartState.cc index bf66e37a9..03efe4d80 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgUartState.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgUartState.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartState.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgUartState0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgUartState0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgUartState0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgUartState0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_uart_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_uart_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,85 +81,146 @@ class Test_legacy_auto_check_sbp_piksi_MsgUartState0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_uart_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgUartState0, Test) -{ +}; - uint8_t encoded_frame[] = {85,29,0,200,224,74,154,169,242,69,102,166,231,68,89,98,79,184,138,244,154,73,201,69,154,65,211,69,201,16,103,249,143,161,154,17,186,69,51,211,7,69,215,149,253,25,218,24,29,195,16,19,159,142,71,17,10,113,137,219,135,18,182,21,38,190,59,196,169,155,107,111,253,168,244,158,112,19,251,131,100,225, }; +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgUartState0, Test) { + uint8_t encoded_frame[] = { + 85, 29, 0, 200, 224, 74, 154, 169, 242, 69, 102, 166, 231, 68, + 89, 98, 79, 184, 138, 244, 154, 73, 201, 69, 154, 65, 211, 69, + 201, 16, 103, 249, 143, 161, 154, 17, 186, 69, 51, 211, 7, 69, + 215, 149, 253, 25, 218, 24, 29, 195, 16, 19, 159, 142, 71, 17, + 10, 113, 137, 219, 135, 18, 182, 21, 38, 190, 59, 196, 169, 155, + 107, 111, 253, 168, 244, 158, 112, 19, 251, 131, 100, 225, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_uart_state_t* test_msg = ( msg_uart_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->latency.avg = 319865629; - test_msg->latency.current = 364253831; - test_msg->latency.lmax = -611749622; - test_msg->latency.lmin = 289902239; - test_msg->obs_period.avg = -1002717658; - test_msg->obs_period.current = -2080697488; - test_msg->obs_period.pmax = -1628133123; - test_msg->obs_period.pmin = 1869323177; - test_msg->uart_a.crc_error_count = 25177; - test_msg->uart_a.io_error_count = 47183; - test_msg->uart_a.rx_buffer_level = 244; - test_msg->uart_a.rx_throughput = 1853.199951171875; - test_msg->uart_a.tx_buffer_level = 138; - test_msg->uart_a.tx_throughput = 7765.2001953125; - test_msg->uart_b.crc_error_count = 4297; - test_msg->uart_b.io_error_count = 63847; - test_msg->uart_b.rx_buffer_level = 161; - test_msg->uart_b.rx_throughput = 6760.2001953125; - test_msg->uart_b.tx_buffer_level = 143; - test_msg->uart_b.tx_throughput = 6441.2001953125; - test_msg->uart_ftdi.crc_error_count = 38359; - test_msg->uart_ftdi.io_error_count = 6653; - test_msg->uart_ftdi.rx_buffer_level = 24; - test_msg->uart_ftdi.rx_throughput = 2173.199951171875; - test_msg->uart_ftdi.tx_buffer_level = 218; - test_msg->uart_ftdi.tx_throughput = 5954.2001953125; - - EXPECT_EQ(send_message( 0x1d, 57544, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_uart_state_t *test_msg = (msg_uart_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->latency.avg = 319865629; + test_msg->latency.current = 364253831; + test_msg->latency.lmax = -611749622; + test_msg->latency.lmin = 289902239; + test_msg->obs_period.avg = -1002717658; + test_msg->obs_period.current = -2080697488; + test_msg->obs_period.pmax = -1628133123; + test_msg->obs_period.pmin = 1869323177; + test_msg->uart_a.crc_error_count = 25177; + test_msg->uart_a.io_error_count = 47183; + test_msg->uart_a.rx_buffer_level = 244; + test_msg->uart_a.rx_throughput = 1853.199951171875; + test_msg->uart_a.tx_buffer_level = 138; + test_msg->uart_a.tx_throughput = 7765.2001953125; + test_msg->uart_b.crc_error_count = 4297; + test_msg->uart_b.io_error_count = 63847; + test_msg->uart_b.rx_buffer_level = 161; + test_msg->uart_b.rx_throughput = 6760.2001953125; + test_msg->uart_b.tx_buffer_level = 143; + test_msg->uart_b.tx_throughput = 6441.2001953125; + test_msg->uart_ftdi.crc_error_count = 38359; + test_msg->uart_ftdi.io_error_count = 6653; + test_msg->uart_ftdi.rx_buffer_level = 24; + test_msg->uart_ftdi.rx_throughput = 2173.199951171875; + test_msg->uart_ftdi.tx_buffer_level = 218; + test_msg->uart_ftdi.tx_throughput = 5954.2001953125; + + EXPECT_EQ(send_message(0x1d, 57544, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 57544); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->latency.avg, 319865629) << "incorrect value for latency.avg, expected 319865629, is " << last_msg_->latency.avg; - EXPECT_EQ(last_msg_->latency.current, 364253831) << "incorrect value for latency.current, expected 364253831, is " << last_msg_->latency.current; - EXPECT_EQ(last_msg_->latency.lmax, -611749622) << "incorrect value for latency.lmax, expected -611749622, is " << last_msg_->latency.lmax; - EXPECT_EQ(last_msg_->latency.lmin, 289902239) << "incorrect value for latency.lmin, expected 289902239, is " << last_msg_->latency.lmin; - EXPECT_EQ(last_msg_->obs_period.avg, -1002717658) << "incorrect value for obs_period.avg, expected -1002717658, is " << last_msg_->obs_period.avg; - EXPECT_EQ(last_msg_->obs_period.current, -2080697488) << "incorrect value for obs_period.current, expected -2080697488, is " << last_msg_->obs_period.current; - EXPECT_EQ(last_msg_->obs_period.pmax, -1628133123) << "incorrect value for obs_period.pmax, expected -1628133123, is " << last_msg_->obs_period.pmax; - EXPECT_EQ(last_msg_->obs_period.pmin, 1869323177) << "incorrect value for obs_period.pmin, expected 1869323177, is " << last_msg_->obs_period.pmin; - EXPECT_EQ(last_msg_->uart_a.crc_error_count, 25177) << "incorrect value for uart_a.crc_error_count, expected 25177, is " << last_msg_->uart_a.crc_error_count; - EXPECT_EQ(last_msg_->uart_a.io_error_count, 47183) << "incorrect value for uart_a.io_error_count, expected 47183, is " << last_msg_->uart_a.io_error_count; - EXPECT_EQ(last_msg_->uart_a.rx_buffer_level, 244) << "incorrect value for uart_a.rx_buffer_level, expected 244, is " << last_msg_->uart_a.rx_buffer_level; - EXPECT_LT((last_msg_->uart_a.rx_throughput*100 - 1853.19995117*100), 0.05) << "incorrect value for uart_a.rx_throughput, expected 1853.19995117, is " << last_msg_->uart_a.rx_throughput; - EXPECT_EQ(last_msg_->uart_a.tx_buffer_level, 138) << "incorrect value for uart_a.tx_buffer_level, expected 138, is " << last_msg_->uart_a.tx_buffer_level; - EXPECT_LT((last_msg_->uart_a.tx_throughput*100 - 7765.20019531*100), 0.05) << "incorrect value for uart_a.tx_throughput, expected 7765.20019531, is " << last_msg_->uart_a.tx_throughput; - EXPECT_EQ(last_msg_->uart_b.crc_error_count, 4297) << "incorrect value for uart_b.crc_error_count, expected 4297, is " << last_msg_->uart_b.crc_error_count; - EXPECT_EQ(last_msg_->uart_b.io_error_count, 63847) << "incorrect value for uart_b.io_error_count, expected 63847, is " << last_msg_->uart_b.io_error_count; - EXPECT_EQ(last_msg_->uart_b.rx_buffer_level, 161) << "incorrect value for uart_b.rx_buffer_level, expected 161, is " << last_msg_->uart_b.rx_buffer_level; - EXPECT_LT((last_msg_->uart_b.rx_throughput*100 - 6760.20019531*100), 0.05) << "incorrect value for uart_b.rx_throughput, expected 6760.20019531, is " << last_msg_->uart_b.rx_throughput; - EXPECT_EQ(last_msg_->uart_b.tx_buffer_level, 143) << "incorrect value for uart_b.tx_buffer_level, expected 143, is " << last_msg_->uart_b.tx_buffer_level; - EXPECT_LT((last_msg_->uart_b.tx_throughput*100 - 6441.20019531*100), 0.05) << "incorrect value for uart_b.tx_throughput, expected 6441.20019531, is " << last_msg_->uart_b.tx_throughput; - EXPECT_EQ(last_msg_->uart_ftdi.crc_error_count, 38359) << "incorrect value for uart_ftdi.crc_error_count, expected 38359, is " << last_msg_->uart_ftdi.crc_error_count; - EXPECT_EQ(last_msg_->uart_ftdi.io_error_count, 6653) << "incorrect value for uart_ftdi.io_error_count, expected 6653, is " << last_msg_->uart_ftdi.io_error_count; - EXPECT_EQ(last_msg_->uart_ftdi.rx_buffer_level, 24) << "incorrect value for uart_ftdi.rx_buffer_level, expected 24, is " << last_msg_->uart_ftdi.rx_buffer_level; - EXPECT_LT((last_msg_->uart_ftdi.rx_throughput*100 - 2173.19995117*100), 0.05) << "incorrect value for uart_ftdi.rx_throughput, expected 2173.19995117, is " << last_msg_->uart_ftdi.rx_throughput; - EXPECT_EQ(last_msg_->uart_ftdi.tx_buffer_level, 218) << "incorrect value for uart_ftdi.tx_buffer_level, expected 218, is " << last_msg_->uart_ftdi.tx_buffer_level; - EXPECT_LT((last_msg_->uart_ftdi.tx_throughput*100 - 5954.20019531*100), 0.05) << "incorrect value for uart_ftdi.tx_throughput, expected 5954.20019531, is " << last_msg_->uart_ftdi.tx_throughput; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 57544); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->latency.avg, 319865629) + << "incorrect value for latency.avg, expected 319865629, is " + << last_msg_->latency.avg; + EXPECT_EQ(last_msg_->latency.current, 364253831) + << "incorrect value for latency.current, expected 364253831, is " + << last_msg_->latency.current; + EXPECT_EQ(last_msg_->latency.lmax, -611749622) + << "incorrect value for latency.lmax, expected -611749622, is " + << last_msg_->latency.lmax; + EXPECT_EQ(last_msg_->latency.lmin, 289902239) + << "incorrect value for latency.lmin, expected 289902239, is " + << last_msg_->latency.lmin; + EXPECT_EQ(last_msg_->obs_period.avg, -1002717658) + << "incorrect value for obs_period.avg, expected -1002717658, is " + << last_msg_->obs_period.avg; + EXPECT_EQ(last_msg_->obs_period.current, -2080697488) + << "incorrect value for obs_period.current, expected -2080697488, is " + << last_msg_->obs_period.current; + EXPECT_EQ(last_msg_->obs_period.pmax, -1628133123) + << "incorrect value for obs_period.pmax, expected -1628133123, is " + << last_msg_->obs_period.pmax; + EXPECT_EQ(last_msg_->obs_period.pmin, 1869323177) + << "incorrect value for obs_period.pmin, expected 1869323177, is " + << last_msg_->obs_period.pmin; + EXPECT_EQ(last_msg_->uart_a.crc_error_count, 25177) + << "incorrect value for uart_a.crc_error_count, expected 25177, is " + << last_msg_->uart_a.crc_error_count; + EXPECT_EQ(last_msg_->uart_a.io_error_count, 47183) + << "incorrect value for uart_a.io_error_count, expected 47183, is " + << last_msg_->uart_a.io_error_count; + EXPECT_EQ(last_msg_->uart_a.rx_buffer_level, 244) + << "incorrect value for uart_a.rx_buffer_level, expected 244, is " + << last_msg_->uart_a.rx_buffer_level; + EXPECT_LT((last_msg_->uart_a.rx_throughput * 100 - 1853.19995117 * 100), 0.05) + << "incorrect value for uart_a.rx_throughput, expected 1853.19995117, is " + << last_msg_->uart_a.rx_throughput; + EXPECT_EQ(last_msg_->uart_a.tx_buffer_level, 138) + << "incorrect value for uart_a.tx_buffer_level, expected 138, is " + << last_msg_->uart_a.tx_buffer_level; + EXPECT_LT((last_msg_->uart_a.tx_throughput * 100 - 7765.20019531 * 100), 0.05) + << "incorrect value for uart_a.tx_throughput, expected 7765.20019531, is " + << last_msg_->uart_a.tx_throughput; + EXPECT_EQ(last_msg_->uart_b.crc_error_count, 4297) + << "incorrect value for uart_b.crc_error_count, expected 4297, is " + << last_msg_->uart_b.crc_error_count; + EXPECT_EQ(last_msg_->uart_b.io_error_count, 63847) + << "incorrect value for uart_b.io_error_count, expected 63847, is " + << last_msg_->uart_b.io_error_count; + EXPECT_EQ(last_msg_->uart_b.rx_buffer_level, 161) + << "incorrect value for uart_b.rx_buffer_level, expected 161, is " + << last_msg_->uart_b.rx_buffer_level; + EXPECT_LT((last_msg_->uart_b.rx_throughput * 100 - 6760.20019531 * 100), 0.05) + << "incorrect value for uart_b.rx_throughput, expected 6760.20019531, is " + << last_msg_->uart_b.rx_throughput; + EXPECT_EQ(last_msg_->uart_b.tx_buffer_level, 143) + << "incorrect value for uart_b.tx_buffer_level, expected 143, is " + << last_msg_->uart_b.tx_buffer_level; + EXPECT_LT((last_msg_->uart_b.tx_throughput * 100 - 6441.20019531 * 100), 0.05) + << "incorrect value for uart_b.tx_throughput, expected 6441.20019531, is " + << last_msg_->uart_b.tx_throughput; + EXPECT_EQ(last_msg_->uart_ftdi.crc_error_count, 38359) + << "incorrect value for uart_ftdi.crc_error_count, expected 38359, is " + << last_msg_->uart_ftdi.crc_error_count; + EXPECT_EQ(last_msg_->uart_ftdi.io_error_count, 6653) + << "incorrect value for uart_ftdi.io_error_count, expected 6653, is " + << last_msg_->uart_ftdi.io_error_count; + EXPECT_EQ(last_msg_->uart_ftdi.rx_buffer_level, 24) + << "incorrect value for uart_ftdi.rx_buffer_level, expected 24, is " + << last_msg_->uart_ftdi.rx_buffer_level; + EXPECT_LT((last_msg_->uart_ftdi.rx_throughput * 100 - 2173.19995117 * 100), + 0.05) + << "incorrect value for uart_ftdi.rx_throughput, expected 2173.19995117, " + "is " + << last_msg_->uart_ftdi.rx_throughput; + EXPECT_EQ(last_msg_->uart_ftdi.tx_buffer_level, 218) + << "incorrect value for uart_ftdi.tx_buffer_level, expected 218, is " + << last_msg_->uart_ftdi.tx_buffer_level; + EXPECT_LT((last_msg_->uart_ftdi.tx_throughput * 100 - 5954.20019531 * 100), + 0.05) + << "incorrect value for uart_ftdi.tx_throughput, expected 5954.20019531, " + "is " + << last_msg_->uart_ftdi.tx_throughput; } diff --git a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgUartStateDepA.cc b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgUartStateDepA.cc index badb72b79..2cd5ab6e2 100644 --- a/c/test/legacy/cpp/auto_check_sbp_piksi_MsgUartStateDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_piksi_MsgUartStateDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/piksi/test_MsgUartStateDepA.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_uart_state_depa_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_uart_state_depa_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,128 +81,171 @@ class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_uart_state_depa_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA0, Test) -{ - - uint8_t encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,154,153,57,65,0,0,0,0,0,0,0,0,15,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,247,5, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_uart_state_depa_t* test_msg = ( msg_uart_state_depa_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->latency.avg = -1; - test_msg->latency.current = -1; - test_msg->latency.lmax = 0; - test_msg->latency.lmin = 0; - test_msg->uart_a.crc_error_count = 0; - test_msg->uart_a.io_error_count = 0; - test_msg->uart_a.rx_buffer_level = 0; - test_msg->uart_a.rx_throughput = 0.0; - test_msg->uart_a.tx_buffer_level = 0; - test_msg->uart_a.tx_throughput = 0.0; - test_msg->uart_b.crc_error_count = 0; - test_msg->uart_b.io_error_count = 0; - test_msg->uart_b.rx_buffer_level = 0; - test_msg->uart_b.rx_throughput = 0.0; - test_msg->uart_b.tx_buffer_level = 0; - test_msg->uart_b.tx_throughput = 0.0; - test_msg->uart_ftdi.crc_error_count = 0; - test_msg->uart_ftdi.io_error_count = 0; - test_msg->uart_ftdi.rx_buffer_level = 0; - test_msg->uart_ftdi.rx_throughput = 0.0; - test_msg->uart_ftdi.tx_buffer_level = 15; - test_msg->uart_ftdi.tx_throughput = 11.600000381469727; - - EXPECT_EQ(send_message( 0x18, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->latency.avg, -1) << "incorrect value for latency.avg, expected -1, is " << last_msg_->latency.avg; - EXPECT_EQ(last_msg_->latency.current, -1) << "incorrect value for latency.current, expected -1, is " << last_msg_->latency.current; - EXPECT_EQ(last_msg_->latency.lmax, 0) << "incorrect value for latency.lmax, expected 0, is " << last_msg_->latency.lmax; - EXPECT_EQ(last_msg_->latency.lmin, 0) << "incorrect value for latency.lmin, expected 0, is " << last_msg_->latency.lmin; - EXPECT_EQ(last_msg_->uart_a.crc_error_count, 0) << "incorrect value for uart_a.crc_error_count, expected 0, is " << last_msg_->uart_a.crc_error_count; - EXPECT_EQ(last_msg_->uart_a.io_error_count, 0) << "incorrect value for uart_a.io_error_count, expected 0, is " << last_msg_->uart_a.io_error_count; - EXPECT_EQ(last_msg_->uart_a.rx_buffer_level, 0) << "incorrect value for uart_a.rx_buffer_level, expected 0, is " << last_msg_->uart_a.rx_buffer_level; - EXPECT_LT((last_msg_->uart_a.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_a.rx_throughput, expected 0.0, is " << last_msg_->uart_a.rx_throughput; - EXPECT_EQ(last_msg_->uart_a.tx_buffer_level, 0) << "incorrect value for uart_a.tx_buffer_level, expected 0, is " << last_msg_->uart_a.tx_buffer_level; - EXPECT_LT((last_msg_->uart_a.tx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_a.tx_throughput, expected 0.0, is " << last_msg_->uart_a.tx_throughput; - EXPECT_EQ(last_msg_->uart_b.crc_error_count, 0) << "incorrect value for uart_b.crc_error_count, expected 0, is " << last_msg_->uart_b.crc_error_count; - EXPECT_EQ(last_msg_->uart_b.io_error_count, 0) << "incorrect value for uart_b.io_error_count, expected 0, is " << last_msg_->uart_b.io_error_count; - EXPECT_EQ(last_msg_->uart_b.rx_buffer_level, 0) << "incorrect value for uart_b.rx_buffer_level, expected 0, is " << last_msg_->uart_b.rx_buffer_level; - EXPECT_LT((last_msg_->uart_b.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_b.rx_throughput, expected 0.0, is " << last_msg_->uart_b.rx_throughput; - EXPECT_EQ(last_msg_->uart_b.tx_buffer_level, 0) << "incorrect value for uart_b.tx_buffer_level, expected 0, is " << last_msg_->uart_b.tx_buffer_level; - EXPECT_LT((last_msg_->uart_b.tx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_b.tx_throughput, expected 0.0, is " << last_msg_->uart_b.tx_throughput; - EXPECT_EQ(last_msg_->uart_ftdi.crc_error_count, 0) << "incorrect value for uart_ftdi.crc_error_count, expected 0, is " << last_msg_->uart_ftdi.crc_error_count; - EXPECT_EQ(last_msg_->uart_ftdi.io_error_count, 0) << "incorrect value for uart_ftdi.io_error_count, expected 0, is " << last_msg_->uart_ftdi.io_error_count; - EXPECT_EQ(last_msg_->uart_ftdi.rx_buffer_level, 0) << "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is " << last_msg_->uart_ftdi.rx_buffer_level; - EXPECT_LT((last_msg_->uart_ftdi.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is " << last_msg_->uart_ftdi.rx_throughput; - EXPECT_EQ(last_msg_->uart_ftdi.tx_buffer_level, 15) << "incorrect value for uart_ftdi.tx_buffer_level, expected 15, is " << last_msg_->uart_ftdi.tx_buffer_level; - EXPECT_LT((last_msg_->uart_ftdi.tx_throughput*100 - 11.6000003815*100), 0.05) << "incorrect value for uart_ftdi.tx_throughput, expected 11.6000003815, is " << last_msg_->uart_ftdi.tx_throughput; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 154, 153, 57, 65, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 255, 255, 255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 247, 5, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_uart_state_depa_t *test_msg = (msg_uart_state_depa_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->latency.avg = -1; + test_msg->latency.current = -1; + test_msg->latency.lmax = 0; + test_msg->latency.lmin = 0; + test_msg->uart_a.crc_error_count = 0; + test_msg->uart_a.io_error_count = 0; + test_msg->uart_a.rx_buffer_level = 0; + test_msg->uart_a.rx_throughput = 0.0; + test_msg->uart_a.tx_buffer_level = 0; + test_msg->uart_a.tx_throughput = 0.0; + test_msg->uart_b.crc_error_count = 0; + test_msg->uart_b.io_error_count = 0; + test_msg->uart_b.rx_buffer_level = 0; + test_msg->uart_b.rx_throughput = 0.0; + test_msg->uart_b.tx_buffer_level = 0; + test_msg->uart_b.tx_throughput = 0.0; + test_msg->uart_ftdi.crc_error_count = 0; + test_msg->uart_ftdi.io_error_count = 0; + test_msg->uart_ftdi.rx_buffer_level = 0; + test_msg->uart_ftdi.rx_throughput = 0.0; + test_msg->uart_ftdi.tx_buffer_level = 15; + test_msg->uart_ftdi.tx_throughput = 11.600000381469727; + + EXPECT_EQ(send_message(0x18, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->latency.avg, -1) + << "incorrect value for latency.avg, expected -1, is " + << last_msg_->latency.avg; + EXPECT_EQ(last_msg_->latency.current, -1) + << "incorrect value for latency.current, expected -1, is " + << last_msg_->latency.current; + EXPECT_EQ(last_msg_->latency.lmax, 0) + << "incorrect value for latency.lmax, expected 0, is " + << last_msg_->latency.lmax; + EXPECT_EQ(last_msg_->latency.lmin, 0) + << "incorrect value for latency.lmin, expected 0, is " + << last_msg_->latency.lmin; + EXPECT_EQ(last_msg_->uart_a.crc_error_count, 0) + << "incorrect value for uart_a.crc_error_count, expected 0, is " + << last_msg_->uart_a.crc_error_count; + EXPECT_EQ(last_msg_->uart_a.io_error_count, 0) + << "incorrect value for uart_a.io_error_count, expected 0, is " + << last_msg_->uart_a.io_error_count; + EXPECT_EQ(last_msg_->uart_a.rx_buffer_level, 0) + << "incorrect value for uart_a.rx_buffer_level, expected 0, is " + << last_msg_->uart_a.rx_buffer_level; + EXPECT_LT((last_msg_->uart_a.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_a.rx_throughput, expected 0.0, is " + << last_msg_->uart_a.rx_throughput; + EXPECT_EQ(last_msg_->uart_a.tx_buffer_level, 0) + << "incorrect value for uart_a.tx_buffer_level, expected 0, is " + << last_msg_->uart_a.tx_buffer_level; + EXPECT_LT((last_msg_->uart_a.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_a.tx_throughput, expected 0.0, is " + << last_msg_->uart_a.tx_throughput; + EXPECT_EQ(last_msg_->uart_b.crc_error_count, 0) + << "incorrect value for uart_b.crc_error_count, expected 0, is " + << last_msg_->uart_b.crc_error_count; + EXPECT_EQ(last_msg_->uart_b.io_error_count, 0) + << "incorrect value for uart_b.io_error_count, expected 0, is " + << last_msg_->uart_b.io_error_count; + EXPECT_EQ(last_msg_->uart_b.rx_buffer_level, 0) + << "incorrect value for uart_b.rx_buffer_level, expected 0, is " + << last_msg_->uart_b.rx_buffer_level; + EXPECT_LT((last_msg_->uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_b.rx_throughput, expected 0.0, is " + << last_msg_->uart_b.rx_throughput; + EXPECT_EQ(last_msg_->uart_b.tx_buffer_level, 0) + << "incorrect value for uart_b.tx_buffer_level, expected 0, is " + << last_msg_->uart_b.tx_buffer_level; + EXPECT_LT((last_msg_->uart_b.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_b.tx_throughput, expected 0.0, is " + << last_msg_->uart_b.tx_throughput; + EXPECT_EQ(last_msg_->uart_ftdi.crc_error_count, 0) + << "incorrect value for uart_ftdi.crc_error_count, expected 0, is " + << last_msg_->uart_ftdi.crc_error_count; + EXPECT_EQ(last_msg_->uart_ftdi.io_error_count, 0) + << "incorrect value for uart_ftdi.io_error_count, expected 0, is " + << last_msg_->uart_ftdi.io_error_count; + EXPECT_EQ(last_msg_->uart_ftdi.rx_buffer_level, 0) + << "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is " + << last_msg_->uart_ftdi.rx_buffer_level; + EXPECT_LT((last_msg_->uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is " + << last_msg_->uart_ftdi.rx_throughput; + EXPECT_EQ(last_msg_->uart_ftdi.tx_buffer_level, 15) + << "incorrect value for uart_ftdi.tx_buffer_level, expected 15, is " + << last_msg_->uart_ftdi.tx_buffer_level; + EXPECT_LT((last_msg_->uart_ftdi.tx_throughput * 100 - 11.6000003815 * 100), + 0.05) + << "incorrect value for uart_ftdi.tx_throughput, expected 11.6000003815, " + "is " + << last_msg_->uart_ftdi.tx_throughput; } -class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_uart_state_depa_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_uart_state_depa_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -216,128 +255,171 @@ class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_uart_state_depa_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA1, Test) -{ - - uint8_t encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,43,135,61,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,65,110, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_uart_state_depa_t* test_msg = ( msg_uart_state_depa_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->latency.avg = -1; - test_msg->latency.current = -1; - test_msg->latency.lmax = 0; - test_msg->latency.lmin = 0; - test_msg->uart_a.crc_error_count = 0; - test_msg->uart_a.io_error_count = 0; - test_msg->uart_a.rx_buffer_level = 0; - test_msg->uart_a.rx_throughput = 0.0; - test_msg->uart_a.tx_buffer_level = 0; - test_msg->uart_a.tx_throughput = 0.0; - test_msg->uart_b.crc_error_count = 0; - test_msg->uart_b.io_error_count = 0; - test_msg->uart_b.rx_buffer_level = 0; - test_msg->uart_b.rx_throughput = 0.0; - test_msg->uart_b.tx_buffer_level = 0; - test_msg->uart_b.tx_throughput = 0.0; - test_msg->uart_ftdi.crc_error_count = 0; - test_msg->uart_ftdi.io_error_count = 0; - test_msg->uart_ftdi.rx_buffer_level = 0; - test_msg->uart_ftdi.rx_throughput = 0.0; - test_msg->uart_ftdi.tx_buffer_level = 0; - test_msg->uart_ftdi.tx_throughput = 0.06599999964237213; - - EXPECT_EQ(send_message( 0x18, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->latency.avg, -1) << "incorrect value for latency.avg, expected -1, is " << last_msg_->latency.avg; - EXPECT_EQ(last_msg_->latency.current, -1) << "incorrect value for latency.current, expected -1, is " << last_msg_->latency.current; - EXPECT_EQ(last_msg_->latency.lmax, 0) << "incorrect value for latency.lmax, expected 0, is " << last_msg_->latency.lmax; - EXPECT_EQ(last_msg_->latency.lmin, 0) << "incorrect value for latency.lmin, expected 0, is " << last_msg_->latency.lmin; - EXPECT_EQ(last_msg_->uart_a.crc_error_count, 0) << "incorrect value for uart_a.crc_error_count, expected 0, is " << last_msg_->uart_a.crc_error_count; - EXPECT_EQ(last_msg_->uart_a.io_error_count, 0) << "incorrect value for uart_a.io_error_count, expected 0, is " << last_msg_->uart_a.io_error_count; - EXPECT_EQ(last_msg_->uart_a.rx_buffer_level, 0) << "incorrect value for uart_a.rx_buffer_level, expected 0, is " << last_msg_->uart_a.rx_buffer_level; - EXPECT_LT((last_msg_->uart_a.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_a.rx_throughput, expected 0.0, is " << last_msg_->uart_a.rx_throughput; - EXPECT_EQ(last_msg_->uart_a.tx_buffer_level, 0) << "incorrect value for uart_a.tx_buffer_level, expected 0, is " << last_msg_->uart_a.tx_buffer_level; - EXPECT_LT((last_msg_->uart_a.tx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_a.tx_throughput, expected 0.0, is " << last_msg_->uart_a.tx_throughput; - EXPECT_EQ(last_msg_->uart_b.crc_error_count, 0) << "incorrect value for uart_b.crc_error_count, expected 0, is " << last_msg_->uart_b.crc_error_count; - EXPECT_EQ(last_msg_->uart_b.io_error_count, 0) << "incorrect value for uart_b.io_error_count, expected 0, is " << last_msg_->uart_b.io_error_count; - EXPECT_EQ(last_msg_->uart_b.rx_buffer_level, 0) << "incorrect value for uart_b.rx_buffer_level, expected 0, is " << last_msg_->uart_b.rx_buffer_level; - EXPECT_LT((last_msg_->uart_b.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_b.rx_throughput, expected 0.0, is " << last_msg_->uart_b.rx_throughput; - EXPECT_EQ(last_msg_->uart_b.tx_buffer_level, 0) << "incorrect value for uart_b.tx_buffer_level, expected 0, is " << last_msg_->uart_b.tx_buffer_level; - EXPECT_LT((last_msg_->uart_b.tx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_b.tx_throughput, expected 0.0, is " << last_msg_->uart_b.tx_throughput; - EXPECT_EQ(last_msg_->uart_ftdi.crc_error_count, 0) << "incorrect value for uart_ftdi.crc_error_count, expected 0, is " << last_msg_->uart_ftdi.crc_error_count; - EXPECT_EQ(last_msg_->uart_ftdi.io_error_count, 0) << "incorrect value for uart_ftdi.io_error_count, expected 0, is " << last_msg_->uart_ftdi.io_error_count; - EXPECT_EQ(last_msg_->uart_ftdi.rx_buffer_level, 0) << "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is " << last_msg_->uart_ftdi.rx_buffer_level; - EXPECT_LT((last_msg_->uart_ftdi.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is " << last_msg_->uart_ftdi.rx_throughput; - EXPECT_EQ(last_msg_->uart_ftdi.tx_buffer_level, 0) << "incorrect value for uart_ftdi.tx_buffer_level, expected 0, is " << last_msg_->uart_ftdi.tx_buffer_level; - EXPECT_LT((last_msg_->uart_ftdi.tx_throughput*100 - 0.0659999996424*100), 0.05) << "incorrect value for uart_ftdi.tx_throughput, expected 0.0659999996424, is " << last_msg_->uart_ftdi.tx_throughput; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 43, 135, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 65, 110, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_uart_state_depa_t *test_msg = (msg_uart_state_depa_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->latency.avg = -1; + test_msg->latency.current = -1; + test_msg->latency.lmax = 0; + test_msg->latency.lmin = 0; + test_msg->uart_a.crc_error_count = 0; + test_msg->uart_a.io_error_count = 0; + test_msg->uart_a.rx_buffer_level = 0; + test_msg->uart_a.rx_throughput = 0.0; + test_msg->uart_a.tx_buffer_level = 0; + test_msg->uart_a.tx_throughput = 0.0; + test_msg->uart_b.crc_error_count = 0; + test_msg->uart_b.io_error_count = 0; + test_msg->uart_b.rx_buffer_level = 0; + test_msg->uart_b.rx_throughput = 0.0; + test_msg->uart_b.tx_buffer_level = 0; + test_msg->uart_b.tx_throughput = 0.0; + test_msg->uart_ftdi.crc_error_count = 0; + test_msg->uart_ftdi.io_error_count = 0; + test_msg->uart_ftdi.rx_buffer_level = 0; + test_msg->uart_ftdi.rx_throughput = 0.0; + test_msg->uart_ftdi.tx_buffer_level = 0; + test_msg->uart_ftdi.tx_throughput = 0.06599999964237213; + + EXPECT_EQ(send_message(0x18, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->latency.avg, -1) + << "incorrect value for latency.avg, expected -1, is " + << last_msg_->latency.avg; + EXPECT_EQ(last_msg_->latency.current, -1) + << "incorrect value for latency.current, expected -1, is " + << last_msg_->latency.current; + EXPECT_EQ(last_msg_->latency.lmax, 0) + << "incorrect value for latency.lmax, expected 0, is " + << last_msg_->latency.lmax; + EXPECT_EQ(last_msg_->latency.lmin, 0) + << "incorrect value for latency.lmin, expected 0, is " + << last_msg_->latency.lmin; + EXPECT_EQ(last_msg_->uart_a.crc_error_count, 0) + << "incorrect value for uart_a.crc_error_count, expected 0, is " + << last_msg_->uart_a.crc_error_count; + EXPECT_EQ(last_msg_->uart_a.io_error_count, 0) + << "incorrect value for uart_a.io_error_count, expected 0, is " + << last_msg_->uart_a.io_error_count; + EXPECT_EQ(last_msg_->uart_a.rx_buffer_level, 0) + << "incorrect value for uart_a.rx_buffer_level, expected 0, is " + << last_msg_->uart_a.rx_buffer_level; + EXPECT_LT((last_msg_->uart_a.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_a.rx_throughput, expected 0.0, is " + << last_msg_->uart_a.rx_throughput; + EXPECT_EQ(last_msg_->uart_a.tx_buffer_level, 0) + << "incorrect value for uart_a.tx_buffer_level, expected 0, is " + << last_msg_->uart_a.tx_buffer_level; + EXPECT_LT((last_msg_->uart_a.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_a.tx_throughput, expected 0.0, is " + << last_msg_->uart_a.tx_throughput; + EXPECT_EQ(last_msg_->uart_b.crc_error_count, 0) + << "incorrect value for uart_b.crc_error_count, expected 0, is " + << last_msg_->uart_b.crc_error_count; + EXPECT_EQ(last_msg_->uart_b.io_error_count, 0) + << "incorrect value for uart_b.io_error_count, expected 0, is " + << last_msg_->uart_b.io_error_count; + EXPECT_EQ(last_msg_->uart_b.rx_buffer_level, 0) + << "incorrect value for uart_b.rx_buffer_level, expected 0, is " + << last_msg_->uart_b.rx_buffer_level; + EXPECT_LT((last_msg_->uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_b.rx_throughput, expected 0.0, is " + << last_msg_->uart_b.rx_throughput; + EXPECT_EQ(last_msg_->uart_b.tx_buffer_level, 0) + << "incorrect value for uart_b.tx_buffer_level, expected 0, is " + << last_msg_->uart_b.tx_buffer_level; + EXPECT_LT((last_msg_->uart_b.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_b.tx_throughput, expected 0.0, is " + << last_msg_->uart_b.tx_throughput; + EXPECT_EQ(last_msg_->uart_ftdi.crc_error_count, 0) + << "incorrect value for uart_ftdi.crc_error_count, expected 0, is " + << last_msg_->uart_ftdi.crc_error_count; + EXPECT_EQ(last_msg_->uart_ftdi.io_error_count, 0) + << "incorrect value for uart_ftdi.io_error_count, expected 0, is " + << last_msg_->uart_ftdi.io_error_count; + EXPECT_EQ(last_msg_->uart_ftdi.rx_buffer_level, 0) + << "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is " + << last_msg_->uart_ftdi.rx_buffer_level; + EXPECT_LT((last_msg_->uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is " + << last_msg_->uart_ftdi.rx_throughput; + EXPECT_EQ(last_msg_->uart_ftdi.tx_buffer_level, 0) + << "incorrect value for uart_ftdi.tx_buffer_level, expected 0, is " + << last_msg_->uart_ftdi.tx_buffer_level; + EXPECT_LT((last_msg_->uart_ftdi.tx_throughput * 100 - 0.0659999996424 * 100), + 0.05) + << "incorrect value for uart_ftdi.tx_throughput, expected " + "0.0659999996424, is " + << last_msg_->uart_ftdi.tx_throughput; } -class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_uart_state_depa_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_uart_state_depa_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -347,128 +429,171 @@ class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_uart_state_depa_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA2, Test) -{ - - uint8_t encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,86,14,62,0,0,0,0,0,0,0,0,10,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,198,36, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_uart_state_depa_t* test_msg = ( msg_uart_state_depa_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->latency.avg = -1; - test_msg->latency.current = -1; - test_msg->latency.lmax = 0; - test_msg->latency.lmin = 0; - test_msg->uart_a.crc_error_count = 0; - test_msg->uart_a.io_error_count = 0; - test_msg->uart_a.rx_buffer_level = 0; - test_msg->uart_a.rx_throughput = 0.0; - test_msg->uart_a.tx_buffer_level = 0; - test_msg->uart_a.tx_throughput = 0.0; - test_msg->uart_b.crc_error_count = 0; - test_msg->uart_b.io_error_count = 0; - test_msg->uart_b.rx_buffer_level = 0; - test_msg->uart_b.rx_throughput = 0.0; - test_msg->uart_b.tx_buffer_level = 0; - test_msg->uart_b.tx_throughput = 0.0; - test_msg->uart_ftdi.crc_error_count = 0; - test_msg->uart_ftdi.io_error_count = 0; - test_msg->uart_ftdi.rx_buffer_level = 0; - test_msg->uart_ftdi.rx_throughput = 0.0; - test_msg->uart_ftdi.tx_buffer_level = 10; - test_msg->uart_ftdi.tx_throughput = 0.13899999856948853; - - EXPECT_EQ(send_message( 0x18, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->latency.avg, -1) << "incorrect value for latency.avg, expected -1, is " << last_msg_->latency.avg; - EXPECT_EQ(last_msg_->latency.current, -1) << "incorrect value for latency.current, expected -1, is " << last_msg_->latency.current; - EXPECT_EQ(last_msg_->latency.lmax, 0) << "incorrect value for latency.lmax, expected 0, is " << last_msg_->latency.lmax; - EXPECT_EQ(last_msg_->latency.lmin, 0) << "incorrect value for latency.lmin, expected 0, is " << last_msg_->latency.lmin; - EXPECT_EQ(last_msg_->uart_a.crc_error_count, 0) << "incorrect value for uart_a.crc_error_count, expected 0, is " << last_msg_->uart_a.crc_error_count; - EXPECT_EQ(last_msg_->uart_a.io_error_count, 0) << "incorrect value for uart_a.io_error_count, expected 0, is " << last_msg_->uart_a.io_error_count; - EXPECT_EQ(last_msg_->uart_a.rx_buffer_level, 0) << "incorrect value for uart_a.rx_buffer_level, expected 0, is " << last_msg_->uart_a.rx_buffer_level; - EXPECT_LT((last_msg_->uart_a.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_a.rx_throughput, expected 0.0, is " << last_msg_->uart_a.rx_throughput; - EXPECT_EQ(last_msg_->uart_a.tx_buffer_level, 0) << "incorrect value for uart_a.tx_buffer_level, expected 0, is " << last_msg_->uart_a.tx_buffer_level; - EXPECT_LT((last_msg_->uart_a.tx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_a.tx_throughput, expected 0.0, is " << last_msg_->uart_a.tx_throughput; - EXPECT_EQ(last_msg_->uart_b.crc_error_count, 0) << "incorrect value for uart_b.crc_error_count, expected 0, is " << last_msg_->uart_b.crc_error_count; - EXPECT_EQ(last_msg_->uart_b.io_error_count, 0) << "incorrect value for uart_b.io_error_count, expected 0, is " << last_msg_->uart_b.io_error_count; - EXPECT_EQ(last_msg_->uart_b.rx_buffer_level, 0) << "incorrect value for uart_b.rx_buffer_level, expected 0, is " << last_msg_->uart_b.rx_buffer_level; - EXPECT_LT((last_msg_->uart_b.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_b.rx_throughput, expected 0.0, is " << last_msg_->uart_b.rx_throughput; - EXPECT_EQ(last_msg_->uart_b.tx_buffer_level, 0) << "incorrect value for uart_b.tx_buffer_level, expected 0, is " << last_msg_->uart_b.tx_buffer_level; - EXPECT_LT((last_msg_->uart_b.tx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_b.tx_throughput, expected 0.0, is " << last_msg_->uart_b.tx_throughput; - EXPECT_EQ(last_msg_->uart_ftdi.crc_error_count, 0) << "incorrect value for uart_ftdi.crc_error_count, expected 0, is " << last_msg_->uart_ftdi.crc_error_count; - EXPECT_EQ(last_msg_->uart_ftdi.io_error_count, 0) << "incorrect value for uart_ftdi.io_error_count, expected 0, is " << last_msg_->uart_ftdi.io_error_count; - EXPECT_EQ(last_msg_->uart_ftdi.rx_buffer_level, 0) << "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is " << last_msg_->uart_ftdi.rx_buffer_level; - EXPECT_LT((last_msg_->uart_ftdi.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is " << last_msg_->uart_ftdi.rx_throughput; - EXPECT_EQ(last_msg_->uart_ftdi.tx_buffer_level, 10) << "incorrect value for uart_ftdi.tx_buffer_level, expected 10, is " << last_msg_->uart_ftdi.tx_buffer_level; - EXPECT_LT((last_msg_->uart_ftdi.tx_throughput*100 - 0.138999998569*100), 0.05) << "incorrect value for uart_ftdi.tx_throughput, expected 0.138999998569, is " << last_msg_->uart_ftdi.tx_throughput; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 86, 14, 62, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 255, 255, 255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 198, 36, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_uart_state_depa_t *test_msg = (msg_uart_state_depa_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->latency.avg = -1; + test_msg->latency.current = -1; + test_msg->latency.lmax = 0; + test_msg->latency.lmin = 0; + test_msg->uart_a.crc_error_count = 0; + test_msg->uart_a.io_error_count = 0; + test_msg->uart_a.rx_buffer_level = 0; + test_msg->uart_a.rx_throughput = 0.0; + test_msg->uart_a.tx_buffer_level = 0; + test_msg->uart_a.tx_throughput = 0.0; + test_msg->uart_b.crc_error_count = 0; + test_msg->uart_b.io_error_count = 0; + test_msg->uart_b.rx_buffer_level = 0; + test_msg->uart_b.rx_throughput = 0.0; + test_msg->uart_b.tx_buffer_level = 0; + test_msg->uart_b.tx_throughput = 0.0; + test_msg->uart_ftdi.crc_error_count = 0; + test_msg->uart_ftdi.io_error_count = 0; + test_msg->uart_ftdi.rx_buffer_level = 0; + test_msg->uart_ftdi.rx_throughput = 0.0; + test_msg->uart_ftdi.tx_buffer_level = 10; + test_msg->uart_ftdi.tx_throughput = 0.13899999856948853; + + EXPECT_EQ(send_message(0x18, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->latency.avg, -1) + << "incorrect value for latency.avg, expected -1, is " + << last_msg_->latency.avg; + EXPECT_EQ(last_msg_->latency.current, -1) + << "incorrect value for latency.current, expected -1, is " + << last_msg_->latency.current; + EXPECT_EQ(last_msg_->latency.lmax, 0) + << "incorrect value for latency.lmax, expected 0, is " + << last_msg_->latency.lmax; + EXPECT_EQ(last_msg_->latency.lmin, 0) + << "incorrect value for latency.lmin, expected 0, is " + << last_msg_->latency.lmin; + EXPECT_EQ(last_msg_->uart_a.crc_error_count, 0) + << "incorrect value for uart_a.crc_error_count, expected 0, is " + << last_msg_->uart_a.crc_error_count; + EXPECT_EQ(last_msg_->uart_a.io_error_count, 0) + << "incorrect value for uart_a.io_error_count, expected 0, is " + << last_msg_->uart_a.io_error_count; + EXPECT_EQ(last_msg_->uart_a.rx_buffer_level, 0) + << "incorrect value for uart_a.rx_buffer_level, expected 0, is " + << last_msg_->uart_a.rx_buffer_level; + EXPECT_LT((last_msg_->uart_a.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_a.rx_throughput, expected 0.0, is " + << last_msg_->uart_a.rx_throughput; + EXPECT_EQ(last_msg_->uart_a.tx_buffer_level, 0) + << "incorrect value for uart_a.tx_buffer_level, expected 0, is " + << last_msg_->uart_a.tx_buffer_level; + EXPECT_LT((last_msg_->uart_a.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_a.tx_throughput, expected 0.0, is " + << last_msg_->uart_a.tx_throughput; + EXPECT_EQ(last_msg_->uart_b.crc_error_count, 0) + << "incorrect value for uart_b.crc_error_count, expected 0, is " + << last_msg_->uart_b.crc_error_count; + EXPECT_EQ(last_msg_->uart_b.io_error_count, 0) + << "incorrect value for uart_b.io_error_count, expected 0, is " + << last_msg_->uart_b.io_error_count; + EXPECT_EQ(last_msg_->uart_b.rx_buffer_level, 0) + << "incorrect value for uart_b.rx_buffer_level, expected 0, is " + << last_msg_->uart_b.rx_buffer_level; + EXPECT_LT((last_msg_->uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_b.rx_throughput, expected 0.0, is " + << last_msg_->uart_b.rx_throughput; + EXPECT_EQ(last_msg_->uart_b.tx_buffer_level, 0) + << "incorrect value for uart_b.tx_buffer_level, expected 0, is " + << last_msg_->uart_b.tx_buffer_level; + EXPECT_LT((last_msg_->uart_b.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_b.tx_throughput, expected 0.0, is " + << last_msg_->uart_b.tx_throughput; + EXPECT_EQ(last_msg_->uart_ftdi.crc_error_count, 0) + << "incorrect value for uart_ftdi.crc_error_count, expected 0, is " + << last_msg_->uart_ftdi.crc_error_count; + EXPECT_EQ(last_msg_->uart_ftdi.io_error_count, 0) + << "incorrect value for uart_ftdi.io_error_count, expected 0, is " + << last_msg_->uart_ftdi.io_error_count; + EXPECT_EQ(last_msg_->uart_ftdi.rx_buffer_level, 0) + << "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is " + << last_msg_->uart_ftdi.rx_buffer_level; + EXPECT_LT((last_msg_->uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is " + << last_msg_->uart_ftdi.rx_throughput; + EXPECT_EQ(last_msg_->uart_ftdi.tx_buffer_level, 10) + << "incorrect value for uart_ftdi.tx_buffer_level, expected 10, is " + << last_msg_->uart_ftdi.tx_buffer_level; + EXPECT_LT((last_msg_->uart_ftdi.tx_throughput * 100 - 0.138999998569 * 100), + 0.05) + << "incorrect value for uart_ftdi.tx_throughput, expected " + "0.138999998569, is " + << last_msg_->uart_ftdi.tx_throughput; } -class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_uart_state_depa_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_uart_state_depa_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -478,128 +603,171 @@ class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_uart_state_depa_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA3, Test) -{ - - uint8_t encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,43,135,61,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,65,110, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_uart_state_depa_t* test_msg = ( msg_uart_state_depa_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->latency.avg = -1; - test_msg->latency.current = -1; - test_msg->latency.lmax = 0; - test_msg->latency.lmin = 0; - test_msg->uart_a.crc_error_count = 0; - test_msg->uart_a.io_error_count = 0; - test_msg->uart_a.rx_buffer_level = 0; - test_msg->uart_a.rx_throughput = 0.0; - test_msg->uart_a.tx_buffer_level = 0; - test_msg->uart_a.tx_throughput = 0.0; - test_msg->uart_b.crc_error_count = 0; - test_msg->uart_b.io_error_count = 0; - test_msg->uart_b.rx_buffer_level = 0; - test_msg->uart_b.rx_throughput = 0.0; - test_msg->uart_b.tx_buffer_level = 0; - test_msg->uart_b.tx_throughput = 0.0; - test_msg->uart_ftdi.crc_error_count = 0; - test_msg->uart_ftdi.io_error_count = 0; - test_msg->uart_ftdi.rx_buffer_level = 0; - test_msg->uart_ftdi.rx_throughput = 0.0; - test_msg->uart_ftdi.tx_buffer_level = 0; - test_msg->uart_ftdi.tx_throughput = 0.06599999964237213; - - EXPECT_EQ(send_message( 0x18, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->latency.avg, -1) << "incorrect value for latency.avg, expected -1, is " << last_msg_->latency.avg; - EXPECT_EQ(last_msg_->latency.current, -1) << "incorrect value for latency.current, expected -1, is " << last_msg_->latency.current; - EXPECT_EQ(last_msg_->latency.lmax, 0) << "incorrect value for latency.lmax, expected 0, is " << last_msg_->latency.lmax; - EXPECT_EQ(last_msg_->latency.lmin, 0) << "incorrect value for latency.lmin, expected 0, is " << last_msg_->latency.lmin; - EXPECT_EQ(last_msg_->uart_a.crc_error_count, 0) << "incorrect value for uart_a.crc_error_count, expected 0, is " << last_msg_->uart_a.crc_error_count; - EXPECT_EQ(last_msg_->uart_a.io_error_count, 0) << "incorrect value for uart_a.io_error_count, expected 0, is " << last_msg_->uart_a.io_error_count; - EXPECT_EQ(last_msg_->uart_a.rx_buffer_level, 0) << "incorrect value for uart_a.rx_buffer_level, expected 0, is " << last_msg_->uart_a.rx_buffer_level; - EXPECT_LT((last_msg_->uart_a.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_a.rx_throughput, expected 0.0, is " << last_msg_->uart_a.rx_throughput; - EXPECT_EQ(last_msg_->uart_a.tx_buffer_level, 0) << "incorrect value for uart_a.tx_buffer_level, expected 0, is " << last_msg_->uart_a.tx_buffer_level; - EXPECT_LT((last_msg_->uart_a.tx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_a.tx_throughput, expected 0.0, is " << last_msg_->uart_a.tx_throughput; - EXPECT_EQ(last_msg_->uart_b.crc_error_count, 0) << "incorrect value for uart_b.crc_error_count, expected 0, is " << last_msg_->uart_b.crc_error_count; - EXPECT_EQ(last_msg_->uart_b.io_error_count, 0) << "incorrect value for uart_b.io_error_count, expected 0, is " << last_msg_->uart_b.io_error_count; - EXPECT_EQ(last_msg_->uart_b.rx_buffer_level, 0) << "incorrect value for uart_b.rx_buffer_level, expected 0, is " << last_msg_->uart_b.rx_buffer_level; - EXPECT_LT((last_msg_->uart_b.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_b.rx_throughput, expected 0.0, is " << last_msg_->uart_b.rx_throughput; - EXPECT_EQ(last_msg_->uart_b.tx_buffer_level, 0) << "incorrect value for uart_b.tx_buffer_level, expected 0, is " << last_msg_->uart_b.tx_buffer_level; - EXPECT_LT((last_msg_->uart_b.tx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_b.tx_throughput, expected 0.0, is " << last_msg_->uart_b.tx_throughput; - EXPECT_EQ(last_msg_->uart_ftdi.crc_error_count, 0) << "incorrect value for uart_ftdi.crc_error_count, expected 0, is " << last_msg_->uart_ftdi.crc_error_count; - EXPECT_EQ(last_msg_->uart_ftdi.io_error_count, 0) << "incorrect value for uart_ftdi.io_error_count, expected 0, is " << last_msg_->uart_ftdi.io_error_count; - EXPECT_EQ(last_msg_->uart_ftdi.rx_buffer_level, 0) << "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is " << last_msg_->uart_ftdi.rx_buffer_level; - EXPECT_LT((last_msg_->uart_ftdi.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is " << last_msg_->uart_ftdi.rx_throughput; - EXPECT_EQ(last_msg_->uart_ftdi.tx_buffer_level, 0) << "incorrect value for uart_ftdi.tx_buffer_level, expected 0, is " << last_msg_->uart_ftdi.tx_buffer_level; - EXPECT_LT((last_msg_->uart_ftdi.tx_throughput*100 - 0.0659999996424*100), 0.05) << "incorrect value for uart_ftdi.tx_throughput, expected 0.0659999996424, is " << last_msg_->uart_ftdi.tx_throughput; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 43, 135, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, + 255, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 65, 110, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_uart_state_depa_t *test_msg = (msg_uart_state_depa_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->latency.avg = -1; + test_msg->latency.current = -1; + test_msg->latency.lmax = 0; + test_msg->latency.lmin = 0; + test_msg->uart_a.crc_error_count = 0; + test_msg->uart_a.io_error_count = 0; + test_msg->uart_a.rx_buffer_level = 0; + test_msg->uart_a.rx_throughput = 0.0; + test_msg->uart_a.tx_buffer_level = 0; + test_msg->uart_a.tx_throughput = 0.0; + test_msg->uart_b.crc_error_count = 0; + test_msg->uart_b.io_error_count = 0; + test_msg->uart_b.rx_buffer_level = 0; + test_msg->uart_b.rx_throughput = 0.0; + test_msg->uart_b.tx_buffer_level = 0; + test_msg->uart_b.tx_throughput = 0.0; + test_msg->uart_ftdi.crc_error_count = 0; + test_msg->uart_ftdi.io_error_count = 0; + test_msg->uart_ftdi.rx_buffer_level = 0; + test_msg->uart_ftdi.rx_throughput = 0.0; + test_msg->uart_ftdi.tx_buffer_level = 0; + test_msg->uart_ftdi.tx_throughput = 0.06599999964237213; + + EXPECT_EQ(send_message(0x18, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->latency.avg, -1) + << "incorrect value for latency.avg, expected -1, is " + << last_msg_->latency.avg; + EXPECT_EQ(last_msg_->latency.current, -1) + << "incorrect value for latency.current, expected -1, is " + << last_msg_->latency.current; + EXPECT_EQ(last_msg_->latency.lmax, 0) + << "incorrect value for latency.lmax, expected 0, is " + << last_msg_->latency.lmax; + EXPECT_EQ(last_msg_->latency.lmin, 0) + << "incorrect value for latency.lmin, expected 0, is " + << last_msg_->latency.lmin; + EXPECT_EQ(last_msg_->uart_a.crc_error_count, 0) + << "incorrect value for uart_a.crc_error_count, expected 0, is " + << last_msg_->uart_a.crc_error_count; + EXPECT_EQ(last_msg_->uart_a.io_error_count, 0) + << "incorrect value for uart_a.io_error_count, expected 0, is " + << last_msg_->uart_a.io_error_count; + EXPECT_EQ(last_msg_->uart_a.rx_buffer_level, 0) + << "incorrect value for uart_a.rx_buffer_level, expected 0, is " + << last_msg_->uart_a.rx_buffer_level; + EXPECT_LT((last_msg_->uart_a.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_a.rx_throughput, expected 0.0, is " + << last_msg_->uart_a.rx_throughput; + EXPECT_EQ(last_msg_->uart_a.tx_buffer_level, 0) + << "incorrect value for uart_a.tx_buffer_level, expected 0, is " + << last_msg_->uart_a.tx_buffer_level; + EXPECT_LT((last_msg_->uart_a.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_a.tx_throughput, expected 0.0, is " + << last_msg_->uart_a.tx_throughput; + EXPECT_EQ(last_msg_->uart_b.crc_error_count, 0) + << "incorrect value for uart_b.crc_error_count, expected 0, is " + << last_msg_->uart_b.crc_error_count; + EXPECT_EQ(last_msg_->uart_b.io_error_count, 0) + << "incorrect value for uart_b.io_error_count, expected 0, is " + << last_msg_->uart_b.io_error_count; + EXPECT_EQ(last_msg_->uart_b.rx_buffer_level, 0) + << "incorrect value for uart_b.rx_buffer_level, expected 0, is " + << last_msg_->uart_b.rx_buffer_level; + EXPECT_LT((last_msg_->uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_b.rx_throughput, expected 0.0, is " + << last_msg_->uart_b.rx_throughput; + EXPECT_EQ(last_msg_->uart_b.tx_buffer_level, 0) + << "incorrect value for uart_b.tx_buffer_level, expected 0, is " + << last_msg_->uart_b.tx_buffer_level; + EXPECT_LT((last_msg_->uart_b.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_b.tx_throughput, expected 0.0, is " + << last_msg_->uart_b.tx_throughput; + EXPECT_EQ(last_msg_->uart_ftdi.crc_error_count, 0) + << "incorrect value for uart_ftdi.crc_error_count, expected 0, is " + << last_msg_->uart_ftdi.crc_error_count; + EXPECT_EQ(last_msg_->uart_ftdi.io_error_count, 0) + << "incorrect value for uart_ftdi.io_error_count, expected 0, is " + << last_msg_->uart_ftdi.io_error_count; + EXPECT_EQ(last_msg_->uart_ftdi.rx_buffer_level, 0) + << "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is " + << last_msg_->uart_ftdi.rx_buffer_level; + EXPECT_LT((last_msg_->uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is " + << last_msg_->uart_ftdi.rx_throughput; + EXPECT_EQ(last_msg_->uart_ftdi.tx_buffer_level, 0) + << "incorrect value for uart_ftdi.tx_buffer_level, expected 0, is " + << last_msg_->uart_ftdi.tx_buffer_level; + EXPECT_LT((last_msg_->uart_ftdi.tx_throughput * 100 - 0.0659999996424 * 100), + 0.05) + << "incorrect value for uart_ftdi.tx_throughput, expected " + "0.0659999996424, is " + << last_msg_->uart_ftdi.tx_throughput; } -class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_uart_state_depa_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_uart_state_depa_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -609,128 +777,176 @@ class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_uart_state_depa_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA4, Test) -{ - - uint8_t encoded_frame[] = {85,24,0,195,4,58,0,0,0,0,138,75,6,60,0,0,0,0,0,0,80,113,201,61,0,0,0,0,0,0,0,0,2,0,145,237,252,62,0,0,0,0,0,0,0,0,38,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,112,111, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_uart_state_depa_t* test_msg = ( msg_uart_state_depa_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->latency.avg = -1; - test_msg->latency.current = -1; - test_msg->latency.lmax = 0; - test_msg->latency.lmin = 0; - test_msg->uart_a.crc_error_count = 0; - test_msg->uart_a.io_error_count = 0; - test_msg->uart_a.rx_buffer_level = 0; - test_msg->uart_a.rx_throughput = 0.008196720853447914; - test_msg->uart_a.tx_buffer_level = 0; - test_msg->uart_a.tx_throughput = 0.0; - test_msg->uart_b.crc_error_count = 0; - test_msg->uart_b.io_error_count = 0; - test_msg->uart_b.rx_buffer_level = 0; - test_msg->uart_b.rx_throughput = 0.0; - test_msg->uart_b.tx_buffer_level = 2; - test_msg->uart_b.tx_throughput = 0.09836065769195557; - test_msg->uart_ftdi.crc_error_count = 0; - test_msg->uart_ftdi.io_error_count = 0; - test_msg->uart_ftdi.rx_buffer_level = 0; - test_msg->uart_ftdi.rx_throughput = 0.0; - test_msg->uart_ftdi.tx_buffer_level = 38; - test_msg->uart_ftdi.tx_throughput = 0.49399998784065247; - - EXPECT_EQ(send_message( 0x18, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->latency.avg, -1) << "incorrect value for latency.avg, expected -1, is " << last_msg_->latency.avg; - EXPECT_EQ(last_msg_->latency.current, -1) << "incorrect value for latency.current, expected -1, is " << last_msg_->latency.current; - EXPECT_EQ(last_msg_->latency.lmax, 0) << "incorrect value for latency.lmax, expected 0, is " << last_msg_->latency.lmax; - EXPECT_EQ(last_msg_->latency.lmin, 0) << "incorrect value for latency.lmin, expected 0, is " << last_msg_->latency.lmin; - EXPECT_EQ(last_msg_->uart_a.crc_error_count, 0) << "incorrect value for uart_a.crc_error_count, expected 0, is " << last_msg_->uart_a.crc_error_count; - EXPECT_EQ(last_msg_->uart_a.io_error_count, 0) << "incorrect value for uart_a.io_error_count, expected 0, is " << last_msg_->uart_a.io_error_count; - EXPECT_EQ(last_msg_->uart_a.rx_buffer_level, 0) << "incorrect value for uart_a.rx_buffer_level, expected 0, is " << last_msg_->uart_a.rx_buffer_level; - EXPECT_LT((last_msg_->uart_a.rx_throughput*100 - 0.00819672085345*100), 0.05) << "incorrect value for uart_a.rx_throughput, expected 0.00819672085345, is " << last_msg_->uart_a.rx_throughput; - EXPECT_EQ(last_msg_->uart_a.tx_buffer_level, 0) << "incorrect value for uart_a.tx_buffer_level, expected 0, is " << last_msg_->uart_a.tx_buffer_level; - EXPECT_LT((last_msg_->uart_a.tx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_a.tx_throughput, expected 0.0, is " << last_msg_->uart_a.tx_throughput; - EXPECT_EQ(last_msg_->uart_b.crc_error_count, 0) << "incorrect value for uart_b.crc_error_count, expected 0, is " << last_msg_->uart_b.crc_error_count; - EXPECT_EQ(last_msg_->uart_b.io_error_count, 0) << "incorrect value for uart_b.io_error_count, expected 0, is " << last_msg_->uart_b.io_error_count; - EXPECT_EQ(last_msg_->uart_b.rx_buffer_level, 0) << "incorrect value for uart_b.rx_buffer_level, expected 0, is " << last_msg_->uart_b.rx_buffer_level; - EXPECT_LT((last_msg_->uart_b.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_b.rx_throughput, expected 0.0, is " << last_msg_->uart_b.rx_throughput; - EXPECT_EQ(last_msg_->uart_b.tx_buffer_level, 2) << "incorrect value for uart_b.tx_buffer_level, expected 2, is " << last_msg_->uart_b.tx_buffer_level; - EXPECT_LT((last_msg_->uart_b.tx_throughput*100 - 0.098360657692*100), 0.05) << "incorrect value for uart_b.tx_throughput, expected 0.098360657692, is " << last_msg_->uart_b.tx_throughput; - EXPECT_EQ(last_msg_->uart_ftdi.crc_error_count, 0) << "incorrect value for uart_ftdi.crc_error_count, expected 0, is " << last_msg_->uart_ftdi.crc_error_count; - EXPECT_EQ(last_msg_->uart_ftdi.io_error_count, 0) << "incorrect value for uart_ftdi.io_error_count, expected 0, is " << last_msg_->uart_ftdi.io_error_count; - EXPECT_EQ(last_msg_->uart_ftdi.rx_buffer_level, 0) << "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is " << last_msg_->uart_ftdi.rx_buffer_level; - EXPECT_LT((last_msg_->uart_ftdi.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is " << last_msg_->uart_ftdi.rx_throughput; - EXPECT_EQ(last_msg_->uart_ftdi.tx_buffer_level, 38) << "incorrect value for uart_ftdi.tx_buffer_level, expected 38, is " << last_msg_->uart_ftdi.tx_buffer_level; - EXPECT_LT((last_msg_->uart_ftdi.tx_throughput*100 - 0.493999987841*100), 0.05) << "incorrect value for uart_ftdi.tx_throughput, expected 0.493999987841, is " << last_msg_->uart_ftdi.tx_throughput; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 0, 0, 0, 0, 138, 75, 6, 60, + 0, 0, 0, 0, 0, 0, 80, 113, 201, 61, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 145, 237, 252, 62, 0, 0, 0, 0, + 0, 0, 0, 0, 38, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 112, 111, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_uart_state_depa_t *test_msg = (msg_uart_state_depa_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->latency.avg = -1; + test_msg->latency.current = -1; + test_msg->latency.lmax = 0; + test_msg->latency.lmin = 0; + test_msg->uart_a.crc_error_count = 0; + test_msg->uart_a.io_error_count = 0; + test_msg->uart_a.rx_buffer_level = 0; + test_msg->uart_a.rx_throughput = 0.008196720853447914; + test_msg->uart_a.tx_buffer_level = 0; + test_msg->uart_a.tx_throughput = 0.0; + test_msg->uart_b.crc_error_count = 0; + test_msg->uart_b.io_error_count = 0; + test_msg->uart_b.rx_buffer_level = 0; + test_msg->uart_b.rx_throughput = 0.0; + test_msg->uart_b.tx_buffer_level = 2; + test_msg->uart_b.tx_throughput = 0.09836065769195557; + test_msg->uart_ftdi.crc_error_count = 0; + test_msg->uart_ftdi.io_error_count = 0; + test_msg->uart_ftdi.rx_buffer_level = 0; + test_msg->uart_ftdi.rx_throughput = 0.0; + test_msg->uart_ftdi.tx_buffer_level = 38; + test_msg->uart_ftdi.tx_throughput = 0.49399998784065247; + + EXPECT_EQ(send_message(0x18, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->latency.avg, -1) + << "incorrect value for latency.avg, expected -1, is " + << last_msg_->latency.avg; + EXPECT_EQ(last_msg_->latency.current, -1) + << "incorrect value for latency.current, expected -1, is " + << last_msg_->latency.current; + EXPECT_EQ(last_msg_->latency.lmax, 0) + << "incorrect value for latency.lmax, expected 0, is " + << last_msg_->latency.lmax; + EXPECT_EQ(last_msg_->latency.lmin, 0) + << "incorrect value for latency.lmin, expected 0, is " + << last_msg_->latency.lmin; + EXPECT_EQ(last_msg_->uart_a.crc_error_count, 0) + << "incorrect value for uart_a.crc_error_count, expected 0, is " + << last_msg_->uart_a.crc_error_count; + EXPECT_EQ(last_msg_->uart_a.io_error_count, 0) + << "incorrect value for uart_a.io_error_count, expected 0, is " + << last_msg_->uart_a.io_error_count; + EXPECT_EQ(last_msg_->uart_a.rx_buffer_level, 0) + << "incorrect value for uart_a.rx_buffer_level, expected 0, is " + << last_msg_->uart_a.rx_buffer_level; + EXPECT_LT((last_msg_->uart_a.rx_throughput * 100 - 0.00819672085345 * 100), + 0.05) + << "incorrect value for uart_a.rx_throughput, expected 0.00819672085345, " + "is " + << last_msg_->uart_a.rx_throughput; + EXPECT_EQ(last_msg_->uart_a.tx_buffer_level, 0) + << "incorrect value for uart_a.tx_buffer_level, expected 0, is " + << last_msg_->uart_a.tx_buffer_level; + EXPECT_LT((last_msg_->uart_a.tx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_a.tx_throughput, expected 0.0, is " + << last_msg_->uart_a.tx_throughput; + EXPECT_EQ(last_msg_->uart_b.crc_error_count, 0) + << "incorrect value for uart_b.crc_error_count, expected 0, is " + << last_msg_->uart_b.crc_error_count; + EXPECT_EQ(last_msg_->uart_b.io_error_count, 0) + << "incorrect value for uart_b.io_error_count, expected 0, is " + << last_msg_->uart_b.io_error_count; + EXPECT_EQ(last_msg_->uart_b.rx_buffer_level, 0) + << "incorrect value for uart_b.rx_buffer_level, expected 0, is " + << last_msg_->uart_b.rx_buffer_level; + EXPECT_LT((last_msg_->uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_b.rx_throughput, expected 0.0, is " + << last_msg_->uart_b.rx_throughput; + EXPECT_EQ(last_msg_->uart_b.tx_buffer_level, 2) + << "incorrect value for uart_b.tx_buffer_level, expected 2, is " + << last_msg_->uart_b.tx_buffer_level; + EXPECT_LT((last_msg_->uart_b.tx_throughput * 100 - 0.098360657692 * 100), + 0.05) + << "incorrect value for uart_b.tx_throughput, expected 0.098360657692, " + "is " + << last_msg_->uart_b.tx_throughput; + EXPECT_EQ(last_msg_->uart_ftdi.crc_error_count, 0) + << "incorrect value for uart_ftdi.crc_error_count, expected 0, is " + << last_msg_->uart_ftdi.crc_error_count; + EXPECT_EQ(last_msg_->uart_ftdi.io_error_count, 0) + << "incorrect value for uart_ftdi.io_error_count, expected 0, is " + << last_msg_->uart_ftdi.io_error_count; + EXPECT_EQ(last_msg_->uart_ftdi.rx_buffer_level, 0) + << "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is " + << last_msg_->uart_ftdi.rx_buffer_level; + EXPECT_LT((last_msg_->uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is " + << last_msg_->uart_ftdi.rx_throughput; + EXPECT_EQ(last_msg_->uart_ftdi.tx_buffer_level, 38) + << "incorrect value for uart_ftdi.tx_buffer_level, expected 38, is " + << last_msg_->uart_ftdi.tx_buffer_level; + EXPECT_LT((last_msg_->uart_ftdi.tx_throughput * 100 - 0.493999987841 * 100), + 0.05) + << "incorrect value for uart_ftdi.tx_throughput, expected " + "0.493999987841, is " + << last_msg_->uart_ftdi.tx_throughput; } -class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_uart_state_depa_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_uart_state_depa_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -740,77 +956,131 @@ class Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_uart_state_depa_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA5, Test) -{ - - uint8_t encoded_frame[] = {85,24,0,195,4,58,166,155,68,60,0,0,0,0,0,0,0,0,2,0,166,155,68,60,0,0,0,0,0,0,0,0,2,0,236,81,168,63,0,0,0,0,0,0,0,0,50,0,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,22,72, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_uart_state_depa_t* test_msg = ( msg_uart_state_depa_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->latency.avg = -1; - test_msg->latency.current = -1; - test_msg->latency.lmax = 0; - test_msg->latency.lmin = 0; - test_msg->uart_a.crc_error_count = 0; - test_msg->uart_a.io_error_count = 0; - test_msg->uart_a.rx_buffer_level = 0; - test_msg->uart_a.rx_throughput = 0.0; - test_msg->uart_a.tx_buffer_level = 2; - test_msg->uart_a.tx_throughput = 0.012000000104308128; - test_msg->uart_b.crc_error_count = 0; - test_msg->uart_b.io_error_count = 0; - test_msg->uart_b.rx_buffer_level = 0; - test_msg->uart_b.rx_throughput = 0.0; - test_msg->uart_b.tx_buffer_level = 2; - test_msg->uart_b.tx_throughput = 0.012000000104308128; - test_msg->uart_ftdi.crc_error_count = 0; - test_msg->uart_ftdi.io_error_count = 0; - test_msg->uart_ftdi.rx_buffer_level = 0; - test_msg->uart_ftdi.rx_throughput = 0.0; - test_msg->uart_ftdi.tx_buffer_level = 50; - test_msg->uart_ftdi.tx_throughput = 1.315000057220459; - - EXPECT_EQ(send_message( 0x18, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->latency.avg, -1) << "incorrect value for latency.avg, expected -1, is " << last_msg_->latency.avg; - EXPECT_EQ(last_msg_->latency.current, -1) << "incorrect value for latency.current, expected -1, is " << last_msg_->latency.current; - EXPECT_EQ(last_msg_->latency.lmax, 0) << "incorrect value for latency.lmax, expected 0, is " << last_msg_->latency.lmax; - EXPECT_EQ(last_msg_->latency.lmin, 0) << "incorrect value for latency.lmin, expected 0, is " << last_msg_->latency.lmin; - EXPECT_EQ(last_msg_->uart_a.crc_error_count, 0) << "incorrect value for uart_a.crc_error_count, expected 0, is " << last_msg_->uart_a.crc_error_count; - EXPECT_EQ(last_msg_->uart_a.io_error_count, 0) << "incorrect value for uart_a.io_error_count, expected 0, is " << last_msg_->uart_a.io_error_count; - EXPECT_EQ(last_msg_->uart_a.rx_buffer_level, 0) << "incorrect value for uart_a.rx_buffer_level, expected 0, is " << last_msg_->uart_a.rx_buffer_level; - EXPECT_LT((last_msg_->uart_a.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_a.rx_throughput, expected 0.0, is " << last_msg_->uart_a.rx_throughput; - EXPECT_EQ(last_msg_->uart_a.tx_buffer_level, 2) << "incorrect value for uart_a.tx_buffer_level, expected 2, is " << last_msg_->uart_a.tx_buffer_level; - EXPECT_LT((last_msg_->uart_a.tx_throughput*100 - 0.0120000001043*100), 0.05) << "incorrect value for uart_a.tx_throughput, expected 0.0120000001043, is " << last_msg_->uart_a.tx_throughput; - EXPECT_EQ(last_msg_->uart_b.crc_error_count, 0) << "incorrect value for uart_b.crc_error_count, expected 0, is " << last_msg_->uart_b.crc_error_count; - EXPECT_EQ(last_msg_->uart_b.io_error_count, 0) << "incorrect value for uart_b.io_error_count, expected 0, is " << last_msg_->uart_b.io_error_count; - EXPECT_EQ(last_msg_->uart_b.rx_buffer_level, 0) << "incorrect value for uart_b.rx_buffer_level, expected 0, is " << last_msg_->uart_b.rx_buffer_level; - EXPECT_LT((last_msg_->uart_b.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_b.rx_throughput, expected 0.0, is " << last_msg_->uart_b.rx_throughput; - EXPECT_EQ(last_msg_->uart_b.tx_buffer_level, 2) << "incorrect value for uart_b.tx_buffer_level, expected 2, is " << last_msg_->uart_b.tx_buffer_level; - EXPECT_LT((last_msg_->uart_b.tx_throughput*100 - 0.0120000001043*100), 0.05) << "incorrect value for uart_b.tx_throughput, expected 0.0120000001043, is " << last_msg_->uart_b.tx_throughput; - EXPECT_EQ(last_msg_->uart_ftdi.crc_error_count, 0) << "incorrect value for uart_ftdi.crc_error_count, expected 0, is " << last_msg_->uart_ftdi.crc_error_count; - EXPECT_EQ(last_msg_->uart_ftdi.io_error_count, 0) << "incorrect value for uart_ftdi.io_error_count, expected 0, is " << last_msg_->uart_ftdi.io_error_count; - EXPECT_EQ(last_msg_->uart_ftdi.rx_buffer_level, 0) << "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is " << last_msg_->uart_ftdi.rx_buffer_level; - EXPECT_LT((last_msg_->uart_ftdi.rx_throughput*100 - 0.0*100), 0.05) << "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is " << last_msg_->uart_ftdi.rx_throughput; - EXPECT_EQ(last_msg_->uart_ftdi.tx_buffer_level, 50) << "incorrect value for uart_ftdi.tx_buffer_level, expected 50, is " << last_msg_->uart_ftdi.tx_buffer_level; - EXPECT_LT((last_msg_->uart_ftdi.tx_throughput*100 - 1.31500005722*100), 0.05) << "incorrect value for uart_ftdi.tx_throughput, expected 1.31500005722, is " << last_msg_->uart_ftdi.tx_throughput; +}; + +TEST_F(Test_legacy_auto_check_sbp_piksi_MsgUartStateDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 24, 0, 195, 4, 58, 166, 155, 68, 60, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 166, 155, 68, 60, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, 236, 81, 168, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, 255, 255, 255, 255, 0, 0, 0, 0, + 0, 0, 0, 0, 255, 255, 255, 255, 22, 72, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_uart_state_depa_t *test_msg = (msg_uart_state_depa_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->latency.avg = -1; + test_msg->latency.current = -1; + test_msg->latency.lmax = 0; + test_msg->latency.lmin = 0; + test_msg->uart_a.crc_error_count = 0; + test_msg->uart_a.io_error_count = 0; + test_msg->uart_a.rx_buffer_level = 0; + test_msg->uart_a.rx_throughput = 0.0; + test_msg->uart_a.tx_buffer_level = 2; + test_msg->uart_a.tx_throughput = 0.012000000104308128; + test_msg->uart_b.crc_error_count = 0; + test_msg->uart_b.io_error_count = 0; + test_msg->uart_b.rx_buffer_level = 0; + test_msg->uart_b.rx_throughput = 0.0; + test_msg->uart_b.tx_buffer_level = 2; + test_msg->uart_b.tx_throughput = 0.012000000104308128; + test_msg->uart_ftdi.crc_error_count = 0; + test_msg->uart_ftdi.io_error_count = 0; + test_msg->uart_ftdi.rx_buffer_level = 0; + test_msg->uart_ftdi.rx_throughput = 0.0; + test_msg->uart_ftdi.tx_buffer_level = 50; + test_msg->uart_ftdi.tx_throughput = 1.315000057220459; + + EXPECT_EQ(send_message(0x18, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->latency.avg, -1) + << "incorrect value for latency.avg, expected -1, is " + << last_msg_->latency.avg; + EXPECT_EQ(last_msg_->latency.current, -1) + << "incorrect value for latency.current, expected -1, is " + << last_msg_->latency.current; + EXPECT_EQ(last_msg_->latency.lmax, 0) + << "incorrect value for latency.lmax, expected 0, is " + << last_msg_->latency.lmax; + EXPECT_EQ(last_msg_->latency.lmin, 0) + << "incorrect value for latency.lmin, expected 0, is " + << last_msg_->latency.lmin; + EXPECT_EQ(last_msg_->uart_a.crc_error_count, 0) + << "incorrect value for uart_a.crc_error_count, expected 0, is " + << last_msg_->uart_a.crc_error_count; + EXPECT_EQ(last_msg_->uart_a.io_error_count, 0) + << "incorrect value for uart_a.io_error_count, expected 0, is " + << last_msg_->uart_a.io_error_count; + EXPECT_EQ(last_msg_->uart_a.rx_buffer_level, 0) + << "incorrect value for uart_a.rx_buffer_level, expected 0, is " + << last_msg_->uart_a.rx_buffer_level; + EXPECT_LT((last_msg_->uart_a.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_a.rx_throughput, expected 0.0, is " + << last_msg_->uart_a.rx_throughput; + EXPECT_EQ(last_msg_->uart_a.tx_buffer_level, 2) + << "incorrect value for uart_a.tx_buffer_level, expected 2, is " + << last_msg_->uart_a.tx_buffer_level; + EXPECT_LT((last_msg_->uart_a.tx_throughput * 100 - 0.0120000001043 * 100), + 0.05) + << "incorrect value for uart_a.tx_throughput, expected 0.0120000001043, " + "is " + << last_msg_->uart_a.tx_throughput; + EXPECT_EQ(last_msg_->uart_b.crc_error_count, 0) + << "incorrect value for uart_b.crc_error_count, expected 0, is " + << last_msg_->uart_b.crc_error_count; + EXPECT_EQ(last_msg_->uart_b.io_error_count, 0) + << "incorrect value for uart_b.io_error_count, expected 0, is " + << last_msg_->uart_b.io_error_count; + EXPECT_EQ(last_msg_->uart_b.rx_buffer_level, 0) + << "incorrect value for uart_b.rx_buffer_level, expected 0, is " + << last_msg_->uart_b.rx_buffer_level; + EXPECT_LT((last_msg_->uart_b.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_b.rx_throughput, expected 0.0, is " + << last_msg_->uart_b.rx_throughput; + EXPECT_EQ(last_msg_->uart_b.tx_buffer_level, 2) + << "incorrect value for uart_b.tx_buffer_level, expected 2, is " + << last_msg_->uart_b.tx_buffer_level; + EXPECT_LT((last_msg_->uart_b.tx_throughput * 100 - 0.0120000001043 * 100), + 0.05) + << "incorrect value for uart_b.tx_throughput, expected 0.0120000001043, " + "is " + << last_msg_->uart_b.tx_throughput; + EXPECT_EQ(last_msg_->uart_ftdi.crc_error_count, 0) + << "incorrect value for uart_ftdi.crc_error_count, expected 0, is " + << last_msg_->uart_ftdi.crc_error_count; + EXPECT_EQ(last_msg_->uart_ftdi.io_error_count, 0) + << "incorrect value for uart_ftdi.io_error_count, expected 0, is " + << last_msg_->uart_ftdi.io_error_count; + EXPECT_EQ(last_msg_->uart_ftdi.rx_buffer_level, 0) + << "incorrect value for uart_ftdi.rx_buffer_level, expected 0, is " + << last_msg_->uart_ftdi.rx_buffer_level; + EXPECT_LT((last_msg_->uart_ftdi.rx_throughput * 100 - 0.0 * 100), 0.05) + << "incorrect value for uart_ftdi.rx_throughput, expected 0.0, is " + << last_msg_->uart_ftdi.rx_throughput; + EXPECT_EQ(last_msg_->uart_ftdi.tx_buffer_level, 50) + << "incorrect value for uart_ftdi.tx_buffer_level, expected 50, is " + << last_msg_->uart_ftdi.tx_buffer_level; + EXPECT_LT((last_msg_->uart_ftdi.tx_throughput * 100 - 1.31500005722 * 100), + 0.05) + << "incorrect value for uart_ftdi.tx_throughput, expected 1.31500005722, " + "is " + << last_msg_->uart_ftdi.tx_throughput; } diff --git a/c/test/legacy/cpp/auto_check_sbp_sbas_MsgSbasRaw.cc b/c/test/legacy/cpp/auto_check_sbp_sbas_MsgSbasRaw.cc index 4c4c634e7..108535440 100644 --- a/c/test/legacy/cpp/auto_check_sbp_sbas_MsgSbasRaw.cc +++ b/c/test/legacy/cpp/auto_check_sbp_sbas_MsgSbasRaw.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/sbas/test_MsgSbasRaw.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/sbas/test_MsgSbasRaw.yaml by generate.py. Do not +// modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_sbas_MsgSbasRaw0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_sbas_MsgSbasRaw0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_sbas_MsgSbasRaw0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_sbas_MsgSbasRaw0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_sbas_raw_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_sbas_raw_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,203 +81,253 @@ class Test_legacy_auto_check_sbp_sbas_MsgSbasRaw0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_sbas_raw_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_sbas_MsgSbasRaw0, Test) -{ +}; - uint8_t encoded_frame[] = {85,119,119,28,200,34,131,2,201,228,233,29,4,23,255,0,23,255,0,23,255,127,240,2,255,192,3,127,247,255,127,247,255,229,229,238,170,175,255,240,167,14, }; +TEST_F(Test_legacy_auto_check_sbp_sbas_MsgSbasRaw0, Test) { + uint8_t encoded_frame[] = { + 85, 119, 119, 28, 200, 34, 131, 2, 201, 228, 233, 29, 4, 23, + 255, 0, 23, 255, 0, 23, 255, 127, 240, 2, 255, 192, 3, 127, + 247, 255, 127, 247, 255, 229, 229, 238, 170, 175, 255, 240, 167, 14, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_sbas_raw_t* test_msg = ( msg_sbas_raw_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[0] = 23; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[1] = 255; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[2] = 0; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[3] = 23; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[4] = 255; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[5] = 0; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[6] = 23; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[7] = 255; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[8] = 127; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[9] = 240; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[10] = 2; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[11] = 255; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[12] = 192; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[13] = 3; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[14] = 127; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[15] = 247; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[16] = 255; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[17] = 127; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[18] = 247; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[19] = 255; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[20] = 229; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[21] = 229; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[22] = 238; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[23] = 170; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[24] = 175; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[25] = 255; - if (sizeof(test_msg->data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); - } - test_msg->data[26] = 240; - test_msg->message_type = 4; - test_msg->sid.code = 2; - test_msg->sid.sat = 131; - test_msg->tow = 501867721; - - EXPECT_EQ(send_message( 0x7777, 51228, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_sbas_raw_t *test_msg = (msg_sbas_raw_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[0] = 23; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[1] = 255; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[2] = 0; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[3] = 23; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[4] = 255; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[5] = 0; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[6] = 23; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[7] = 255; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[8] = 127; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[9] = 240; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[10] = 2; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[11] = 255; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[12] = 192; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[13] = 3; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[14] = 127; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[15] = 247; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[16] = 255; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[17] = 127; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[18] = 247; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[19] = 255; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[20] = 229; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[21] = 229; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[22] = 238; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[23] = 170; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[24] = 175; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[25] = 255; + if (sizeof(test_msg->data) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->data[0])); + } + test_msg->data[26] = 240; + test_msg->message_type = 4; + test_msg->sid.code = 2; + test_msg->sid.sat = 131; + test_msg->tow = 501867721; + + EXPECT_EQ(send_message(0x7777, 51228, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 51228); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->data[0], 23) << "incorrect value for data[0], expected 23, is " << last_msg_->data[0]; - EXPECT_EQ(last_msg_->data[1], 255) << "incorrect value for data[1], expected 255, is " << last_msg_->data[1]; - EXPECT_EQ(last_msg_->data[2], 0) << "incorrect value for data[2], expected 0, is " << last_msg_->data[2]; - EXPECT_EQ(last_msg_->data[3], 23) << "incorrect value for data[3], expected 23, is " << last_msg_->data[3]; - EXPECT_EQ(last_msg_->data[4], 255) << "incorrect value for data[4], expected 255, is " << last_msg_->data[4]; - EXPECT_EQ(last_msg_->data[5], 0) << "incorrect value for data[5], expected 0, is " << last_msg_->data[5]; - EXPECT_EQ(last_msg_->data[6], 23) << "incorrect value for data[6], expected 23, is " << last_msg_->data[6]; - EXPECT_EQ(last_msg_->data[7], 255) << "incorrect value for data[7], expected 255, is " << last_msg_->data[7]; - EXPECT_EQ(last_msg_->data[8], 127) << "incorrect value for data[8], expected 127, is " << last_msg_->data[8]; - EXPECT_EQ(last_msg_->data[9], 240) << "incorrect value for data[9], expected 240, is " << last_msg_->data[9]; - EXPECT_EQ(last_msg_->data[10], 2) << "incorrect value for data[10], expected 2, is " << last_msg_->data[10]; - EXPECT_EQ(last_msg_->data[11], 255) << "incorrect value for data[11], expected 255, is " << last_msg_->data[11]; - EXPECT_EQ(last_msg_->data[12], 192) << "incorrect value for data[12], expected 192, is " << last_msg_->data[12]; - EXPECT_EQ(last_msg_->data[13], 3) << "incorrect value for data[13], expected 3, is " << last_msg_->data[13]; - EXPECT_EQ(last_msg_->data[14], 127) << "incorrect value for data[14], expected 127, is " << last_msg_->data[14]; - EXPECT_EQ(last_msg_->data[15], 247) << "incorrect value for data[15], expected 247, is " << last_msg_->data[15]; - EXPECT_EQ(last_msg_->data[16], 255) << "incorrect value for data[16], expected 255, is " << last_msg_->data[16]; - EXPECT_EQ(last_msg_->data[17], 127) << "incorrect value for data[17], expected 127, is " << last_msg_->data[17]; - EXPECT_EQ(last_msg_->data[18], 247) << "incorrect value for data[18], expected 247, is " << last_msg_->data[18]; - EXPECT_EQ(last_msg_->data[19], 255) << "incorrect value for data[19], expected 255, is " << last_msg_->data[19]; - EXPECT_EQ(last_msg_->data[20], 229) << "incorrect value for data[20], expected 229, is " << last_msg_->data[20]; - EXPECT_EQ(last_msg_->data[21], 229) << "incorrect value for data[21], expected 229, is " << last_msg_->data[21]; - EXPECT_EQ(last_msg_->data[22], 238) << "incorrect value for data[22], expected 238, is " << last_msg_->data[22]; - EXPECT_EQ(last_msg_->data[23], 170) << "incorrect value for data[23], expected 170, is " << last_msg_->data[23]; - EXPECT_EQ(last_msg_->data[24], 175) << "incorrect value for data[24], expected 175, is " << last_msg_->data[24]; - EXPECT_EQ(last_msg_->data[25], 255) << "incorrect value for data[25], expected 255, is " << last_msg_->data[25]; - EXPECT_EQ(last_msg_->data[26], 240) << "incorrect value for data[26], expected 240, is " << last_msg_->data[26]; - EXPECT_EQ(last_msg_->message_type, 4) << "incorrect value for message_type, expected 4, is " << last_msg_->message_type; - EXPECT_EQ(last_msg_->sid.code, 2) << "incorrect value for sid.code, expected 2, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.sat, 131) << "incorrect value for sid.sat, expected 131, is " << last_msg_->sid.sat; - EXPECT_EQ(last_msg_->tow, 501867721) << "incorrect value for tow, expected 501867721, is " << last_msg_->tow; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 51228); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->data[0], 23) + << "incorrect value for data[0], expected 23, is " << last_msg_->data[0]; + EXPECT_EQ(last_msg_->data[1], 255) + << "incorrect value for data[1], expected 255, is " << last_msg_->data[1]; + EXPECT_EQ(last_msg_->data[2], 0) + << "incorrect value for data[2], expected 0, is " << last_msg_->data[2]; + EXPECT_EQ(last_msg_->data[3], 23) + << "incorrect value for data[3], expected 23, is " << last_msg_->data[3]; + EXPECT_EQ(last_msg_->data[4], 255) + << "incorrect value for data[4], expected 255, is " << last_msg_->data[4]; + EXPECT_EQ(last_msg_->data[5], 0) + << "incorrect value for data[5], expected 0, is " << last_msg_->data[5]; + EXPECT_EQ(last_msg_->data[6], 23) + << "incorrect value for data[6], expected 23, is " << last_msg_->data[6]; + EXPECT_EQ(last_msg_->data[7], 255) + << "incorrect value for data[7], expected 255, is " << last_msg_->data[7]; + EXPECT_EQ(last_msg_->data[8], 127) + << "incorrect value for data[8], expected 127, is " << last_msg_->data[8]; + EXPECT_EQ(last_msg_->data[9], 240) + << "incorrect value for data[9], expected 240, is " << last_msg_->data[9]; + EXPECT_EQ(last_msg_->data[10], 2) + << "incorrect value for data[10], expected 2, is " << last_msg_->data[10]; + EXPECT_EQ(last_msg_->data[11], 255) + << "incorrect value for data[11], expected 255, is " + << last_msg_->data[11]; + EXPECT_EQ(last_msg_->data[12], 192) + << "incorrect value for data[12], expected 192, is " + << last_msg_->data[12]; + EXPECT_EQ(last_msg_->data[13], 3) + << "incorrect value for data[13], expected 3, is " << last_msg_->data[13]; + EXPECT_EQ(last_msg_->data[14], 127) + << "incorrect value for data[14], expected 127, is " + << last_msg_->data[14]; + EXPECT_EQ(last_msg_->data[15], 247) + << "incorrect value for data[15], expected 247, is " + << last_msg_->data[15]; + EXPECT_EQ(last_msg_->data[16], 255) + << "incorrect value for data[16], expected 255, is " + << last_msg_->data[16]; + EXPECT_EQ(last_msg_->data[17], 127) + << "incorrect value for data[17], expected 127, is " + << last_msg_->data[17]; + EXPECT_EQ(last_msg_->data[18], 247) + << "incorrect value for data[18], expected 247, is " + << last_msg_->data[18]; + EXPECT_EQ(last_msg_->data[19], 255) + << "incorrect value for data[19], expected 255, is " + << last_msg_->data[19]; + EXPECT_EQ(last_msg_->data[20], 229) + << "incorrect value for data[20], expected 229, is " + << last_msg_->data[20]; + EXPECT_EQ(last_msg_->data[21], 229) + << "incorrect value for data[21], expected 229, is " + << last_msg_->data[21]; + EXPECT_EQ(last_msg_->data[22], 238) + << "incorrect value for data[22], expected 238, is " + << last_msg_->data[22]; + EXPECT_EQ(last_msg_->data[23], 170) + << "incorrect value for data[23], expected 170, is " + << last_msg_->data[23]; + EXPECT_EQ(last_msg_->data[24], 175) + << "incorrect value for data[24], expected 175, is " + << last_msg_->data[24]; + EXPECT_EQ(last_msg_->data[25], 255) + << "incorrect value for data[25], expected 255, is " + << last_msg_->data[25]; + EXPECT_EQ(last_msg_->data[26], 240) + << "incorrect value for data[26], expected 240, is " + << last_msg_->data[26]; + EXPECT_EQ(last_msg_->message_type, 4) + << "incorrect value for message_type, expected 4, is " + << last_msg_->message_type; + EXPECT_EQ(last_msg_->sid.code, 2) + << "incorrect value for sid.code, expected 2, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.sat, 131) + << "incorrect value for sid.sat, expected 131, is " << last_msg_->sid.sat; + EXPECT_EQ(last_msg_->tow, 501867721) + << "incorrect value for tow, expected 501867721, is " << last_msg_->tow; } diff --git a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexDone.cc b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexDone.cc index cfe555f18..ff0da56ea 100644 --- a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexDone.cc +++ b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexDone.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexDone.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexDone.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,6 +27,6 @@ #include #include +#include #include #include -#include diff --git a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexReq.cc b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexReq.cc index fcfecb3fe..fe6cd1716 100644 --- a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexReq.cc +++ b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexReq.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_settings_read_by_index_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_settings_read_by_index_req_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,35 +82,37 @@ class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_settings_read_by_index_req_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq0, Test) -{ +}; - uint8_t encoded_frame[] = {85,162,0,122,123,2,244,34,235,23, }; +TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexReq0, Test) { + uint8_t encoded_frame[] = { + 85, 162, 0, 122, 123, 2, 244, 34, 235, 23, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_settings_read_by_index_req_t* test_msg = ( msg_settings_read_by_index_req_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->index = 8948; - - EXPECT_EQ(send_message( 0xa2, 31610, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_settings_read_by_index_req_t *test_msg = + (msg_settings_read_by_index_req_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->index = 8948; + + EXPECT_EQ(send_message(0xa2, 31610, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 31610); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->index, 8948) << "incorrect value for index, expected 8948, is " << last_msg_->index; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 31610); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->index, 8948) + << "incorrect value for index, expected 8948, is " << last_msg_->index; } diff --git a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexResp.cc b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexResp.cc index 91aab421e..8012dc373 100644 --- a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexResp.cc +++ b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadByIndexResp.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadByIndexResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_settings_read_by_index_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_settings_read_by_index_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,97 +82,127 @@ class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_settings_read_by_index_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp0, Test) -{ - - uint8_t encoded_frame[] = {85,167,0,246,215,78,0,0,116,101,108,101,109,101,116,114,121,95,114,97,100,105,111,0,99,111,110,102,105,103,117,114,97,116,105,111,110,95,115,116,114,105,110,103,0,65,84,38,70,44,65,84,83,49,61,49,49,53,44,65,84,83,50,61,49,50,56,44,65,84,83,53,61,48,44,65,84,38,87,44,65,84,90,0,248,233, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_settings_read_by_index_resp_t* test_msg = ( msg_settings_read_by_index_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->index = 0; - { - const char assign_string[] = { (char)116,(char)101,(char)108,(char)101,(char)109,(char)101,(char)116,(char)114,(char)121,(char)95,(char)114,(char)97,(char)100,(char)105,(char)111,(char)0,(char)99,(char)111,(char)110,(char)102,(char)105,(char)103,(char)117,(char)114,(char)97,(char)116,(char)105,(char)111,(char)110,(char)95,(char)115,(char)116,(char)114,(char)105,(char)110,(char)103,(char)0,(char)65,(char)84,(char)38,(char)70,(char)44,(char)65,(char)84,(char)83,(char)49,(char)61,(char)49,(char)49,(char)53,(char)44,(char)65,(char)84,(char)83,(char)50,(char)61,(char)49,(char)50,(char)56,(char)44,(char)65,(char)84,(char)83,(char)53,(char)61,(char)48,(char)44,(char)65,(char)84,(char)38,(char)87,(char)44,(char)65,(char)84,(char)90,(char)0 }; - memcpy(test_msg->setting, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->setting) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0xa7, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp0, Test) { + uint8_t encoded_frame[] = { + 85, 167, 0, 246, 215, 78, 0, 0, 116, 101, 108, 101, 109, 101, 116, + 114, 121, 95, 114, 97, 100, 105, 111, 0, 99, 111, 110, 102, 105, 103, + 117, 114, 97, 116, 105, 111, 110, 95, 115, 116, 114, 105, 110, 103, 0, + 65, 84, 38, 70, 44, 65, 84, 83, 49, 61, 49, 49, 53, 44, 65, + 84, 83, 50, 61, 49, 50, 56, 44, 65, 84, 83, 53, 61, 48, 44, + 65, 84, 38, 87, 44, 65, 84, 90, 0, 248, 233, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_settings_read_by_index_resp_t *test_msg = + (msg_settings_read_by_index_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->index = 0; + { + const char assign_string[] = { + (char)116, (char)101, (char)108, (char)101, (char)109, (char)101, + (char)116, (char)114, (char)121, (char)95, (char)114, (char)97, + (char)100, (char)105, (char)111, (char)0, (char)99, (char)111, + (char)110, (char)102, (char)105, (char)103, (char)117, (char)114, + (char)97, (char)116, (char)105, (char)111, (char)110, (char)95, + (char)115, (char)116, (char)114, (char)105, (char)110, (char)103, + (char)0, (char)65, (char)84, (char)38, (char)70, (char)44, + (char)65, (char)84, (char)83, (char)49, (char)61, (char)49, + (char)49, (char)53, (char)44, (char)65, (char)84, (char)83, + (char)50, (char)61, (char)49, (char)50, (char)56, (char)44, + (char)65, (char)84, (char)83, (char)53, (char)61, (char)48, + (char)44, (char)65, (char)84, (char)38, (char)87, (char)44, + (char)65, (char)84, (char)90, (char)0}; + memcpy(test_msg->setting, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->setting) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->index, 0) << "incorrect value for index, expected 0, is " << last_msg_->index; - { - const char check_string[] = { (char)116,(char)101,(char)108,(char)101,(char)109,(char)101,(char)116,(char)114,(char)121,(char)95,(char)114,(char)97,(char)100,(char)105,(char)111,(char)0,(char)99,(char)111,(char)110,(char)102,(char)105,(char)103,(char)117,(char)114,(char)97,(char)116,(char)105,(char)111,(char)110,(char)95,(char)115,(char)116,(char)114,(char)105,(char)110,(char)103,(char)0,(char)65,(char)84,(char)38,(char)70,(char)44,(char)65,(char)84,(char)83,(char)49,(char)61,(char)49,(char)49,(char)53,(char)44,(char)65,(char)84,(char)83,(char)50,(char)61,(char)49,(char)50,(char)56,(char)44,(char)65,(char)84,(char)83,(char)53,(char)61,(char)48,(char)44,(char)65,(char)84,(char)38,(char)87,(char)44,(char)65,(char)84,(char)90,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->setting, expected string '" << check_string << "', is '" << last_msg_->setting << "'"; - } + EXPECT_EQ(send_message(0xa7, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->index, 0) + << "incorrect value for index, expected 0, is " << last_msg_->index; + { + const char check_string[] = { + (char)116, (char)101, (char)108, (char)101, (char)109, (char)101, + (char)116, (char)114, (char)121, (char)95, (char)114, (char)97, + (char)100, (char)105, (char)111, (char)0, (char)99, (char)111, + (char)110, (char)102, (char)105, (char)103, (char)117, (char)114, + (char)97, (char)116, (char)105, (char)111, (char)110, (char)95, + (char)115, (char)116, (char)114, (char)105, (char)110, (char)103, + (char)0, (char)65, (char)84, (char)38, (char)70, (char)44, + (char)65, (char)84, (char)83, (char)49, (char)61, (char)49, + (char)49, (char)53, (char)44, (char)65, (char)84, (char)83, + (char)50, (char)61, (char)49, (char)50, (char)56, (char)44, + (char)65, (char)84, (char)83, (char)53, (char)61, (char)48, + (char)44, (char)65, (char)84, (char)38, (char)87, (char)44, + (char)65, (char)84, (char)90, (char)0}; + EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->setting, expected string '" + << check_string << "', is '" << last_msg_->setting << "'"; + } } -class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_settings_read_by_index_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_settings_read_by_index_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -185,97 +212,110 @@ class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_settings_read_by_index_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp1, Test) -{ - - uint8_t encoded_frame[] = {85,167,0,246,215,35,1,0,117,97,114,116,95,102,116,100,105,0,109,111,100,101,0,83,66,80,0,101,110,117,109,58,83,66,80,44,78,77,69,65,0,167,243, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_settings_read_by_index_resp_t* test_msg = ( msg_settings_read_by_index_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->index = 1; - { - const char assign_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)102,(char)116,(char)100,(char)105,(char)0,(char)109,(char)111,(char)100,(char)101,(char)0,(char)83,(char)66,(char)80,(char)0,(char)101,(char)110,(char)117,(char)109,(char)58,(char)83,(char)66,(char)80,(char)44,(char)78,(char)77,(char)69,(char)65,(char)0 }; - memcpy(test_msg->setting, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->setting) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0xa7, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp1, Test) { + uint8_t encoded_frame[] = { + 85, 167, 0, 246, 215, 35, 1, 0, 117, 97, 114, 116, 95, 102, 116, + 100, 105, 0, 109, 111, 100, 101, 0, 83, 66, 80, 0, 101, 110, 117, + 109, 58, 83, 66, 80, 44, 78, 77, 69, 65, 0, 167, 243, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_settings_read_by_index_resp_t *test_msg = + (msg_settings_read_by_index_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->index = 1; + { + const char assign_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)102, + (char)116, (char)100, (char)105, (char)0, (char)109, (char)111, + (char)100, (char)101, (char)0, (char)83, (char)66, (char)80, + (char)0, (char)101, (char)110, (char)117, (char)109, (char)58, + (char)83, (char)66, (char)80, (char)44, (char)78, (char)77, + (char)69, (char)65, (char)0}; + memcpy(test_msg->setting, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->setting) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->index, 1) << "incorrect value for index, expected 1, is " << last_msg_->index; - { - const char check_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)102,(char)116,(char)100,(char)105,(char)0,(char)109,(char)111,(char)100,(char)101,(char)0,(char)83,(char)66,(char)80,(char)0,(char)101,(char)110,(char)117,(char)109,(char)58,(char)83,(char)66,(char)80,(char)44,(char)78,(char)77,(char)69,(char)65,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->setting, expected string '" << check_string << "', is '" << last_msg_->setting << "'"; - } + EXPECT_EQ(send_message(0xa7, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->index, 1) + << "incorrect value for index, expected 1, is " << last_msg_->index; + { + const char check_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)102, + (char)116, (char)100, (char)105, (char)0, (char)109, (char)111, + (char)100, (char)101, (char)0, (char)83, (char)66, (char)80, + (char)0, (char)101, (char)110, (char)117, (char)109, (char)58, + (char)83, (char)66, (char)80, (char)44, (char)78, (char)77, + (char)69, (char)65, (char)0}; + EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->setting, expected string '" + << check_string << "', is '" << last_msg_->setting << "'"; + } } -class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_settings_read_by_index_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_settings_read_by_index_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -285,97 +325,110 @@ class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_settings_read_by_index_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp2, Test) -{ - - uint8_t encoded_frame[] = {85,167,0,246,215,35,2,0,117,97,114,116,95,102,116,100,105,0,115,98,112,95,109,101,115,115,97,103,101,95,109,97,115,107,0,54,53,53,51,53,0,4,56, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_settings_read_by_index_resp_t* test_msg = ( msg_settings_read_by_index_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->index = 2; - { - const char assign_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)102,(char)116,(char)100,(char)105,(char)0,(char)115,(char)98,(char)112,(char)95,(char)109,(char)101,(char)115,(char)115,(char)97,(char)103,(char)101,(char)95,(char)109,(char)97,(char)115,(char)107,(char)0,(char)54,(char)53,(char)53,(char)51,(char)53,(char)0 }; - memcpy(test_msg->setting, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->setting) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0xa7, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp2, Test) { + uint8_t encoded_frame[] = { + 85, 167, 0, 246, 215, 35, 2, 0, 117, 97, 114, 116, 95, 102, 116, + 100, 105, 0, 115, 98, 112, 95, 109, 101, 115, 115, 97, 103, 101, 95, + 109, 97, 115, 107, 0, 54, 53, 53, 51, 53, 0, 4, 56, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_settings_read_by_index_resp_t *test_msg = + (msg_settings_read_by_index_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->index = 2; + { + const char assign_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)102, + (char)116, (char)100, (char)105, (char)0, (char)115, (char)98, + (char)112, (char)95, (char)109, (char)101, (char)115, (char)115, + (char)97, (char)103, (char)101, (char)95, (char)109, (char)97, + (char)115, (char)107, (char)0, (char)54, (char)53, (char)53, + (char)51, (char)53, (char)0}; + memcpy(test_msg->setting, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->setting) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->index, 2) << "incorrect value for index, expected 2, is " << last_msg_->index; - { - const char check_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)102,(char)116,(char)100,(char)105,(char)0,(char)115,(char)98,(char)112,(char)95,(char)109,(char)101,(char)115,(char)115,(char)97,(char)103,(char)101,(char)95,(char)109,(char)97,(char)115,(char)107,(char)0,(char)54,(char)53,(char)53,(char)51,(char)53,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->setting, expected string '" << check_string << "', is '" << last_msg_->setting << "'"; - } + EXPECT_EQ(send_message(0xa7, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->index, 2) + << "incorrect value for index, expected 2, is " << last_msg_->index; + { + const char check_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)102, + (char)116, (char)100, (char)105, (char)0, (char)115, (char)98, + (char)112, (char)95, (char)109, (char)101, (char)115, (char)115, + (char)97, (char)103, (char)101, (char)95, (char)109, (char)97, + (char)115, (char)107, (char)0, (char)54, (char)53, (char)53, + (char)51, (char)53, (char)0}; + EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->setting, expected string '" + << check_string << "', is '" << last_msg_->setting << "'"; + } } -class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_settings_read_by_index_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_settings_read_by_index_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -385,97 +438,108 @@ class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_settings_read_by_index_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp3, Test) -{ - - uint8_t encoded_frame[] = {85,167,0,246,215,29,3,0,117,97,114,116,95,102,116,100,105,0,98,97,117,100,114,97,116,101,0,49,48,48,48,48,48,48,0,242,146, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_settings_read_by_index_resp_t* test_msg = ( msg_settings_read_by_index_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->index = 3; - { - const char assign_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)102,(char)116,(char)100,(char)105,(char)0,(char)98,(char)97,(char)117,(char)100,(char)114,(char)97,(char)116,(char)101,(char)0,(char)49,(char)48,(char)48,(char)48,(char)48,(char)48,(char)48,(char)0 }; - memcpy(test_msg->setting, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->setting) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0xa7, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp3, Test) { + uint8_t encoded_frame[] = { + 85, 167, 0, 246, 215, 29, 3, 0, 117, 97, 114, 116, 95, + 102, 116, 100, 105, 0, 98, 97, 117, 100, 114, 97, 116, 101, + 0, 49, 48, 48, 48, 48, 48, 48, 0, 242, 146, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_settings_read_by_index_resp_t *test_msg = + (msg_settings_read_by_index_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->index = 3; + { + const char assign_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)102, + (char)116, (char)100, (char)105, (char)0, (char)98, (char)97, + (char)117, (char)100, (char)114, (char)97, (char)116, (char)101, + (char)0, (char)49, (char)48, (char)48, (char)48, (char)48, + (char)48, (char)48, (char)0}; + memcpy(test_msg->setting, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->setting) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->index, 3) << "incorrect value for index, expected 3, is " << last_msg_->index; - { - const char check_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)102,(char)116,(char)100,(char)105,(char)0,(char)98,(char)97,(char)117,(char)100,(char)114,(char)97,(char)116,(char)101,(char)0,(char)49,(char)48,(char)48,(char)48,(char)48,(char)48,(char)48,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->setting, expected string '" << check_string << "', is '" << last_msg_->setting << "'"; - } + EXPECT_EQ(send_message(0xa7, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->index, 3) + << "incorrect value for index, expected 3, is " << last_msg_->index; + { + const char check_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)102, + (char)116, (char)100, (char)105, (char)0, (char)98, (char)97, + (char)117, (char)100, (char)114, (char)97, (char)116, (char)101, + (char)0, (char)49, (char)48, (char)48, (char)48, (char)48, + (char)48, (char)48, (char)0}; + EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->setting, expected string '" + << check_string << "', is '" << last_msg_->setting << "'"; + } } -class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_settings_read_by_index_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_settings_read_by_index_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -485,46 +549,64 @@ class Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_settings_read_by_index_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp4, Test) -{ - - uint8_t encoded_frame[] = {85,167,0,246,215,36,4,0,117,97,114,116,95,117,97,114,116,97,0,109,111,100,101,0,83,66,80,0,101,110,117,109,58,83,66,80,44,78,77,69,65,0,22,4, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_settings_read_by_index_resp_t* test_msg = ( msg_settings_read_by_index_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->index = 4; - { - const char assign_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)117,(char)97,(char)114,(char)116,(char)97,(char)0,(char)109,(char)111,(char)100,(char)101,(char)0,(char)83,(char)66,(char)80,(char)0,(char)101,(char)110,(char)117,(char)109,(char)58,(char)83,(char)66,(char)80,(char)44,(char)78,(char)77,(char)69,(char)65,(char)0 }; - memcpy(test_msg->setting, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->setting) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0xa7, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); +}; + +TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp4, Test) { + uint8_t encoded_frame[] = { + 85, 167, 0, 246, 215, 36, 4, 0, 117, 97, 114, 116, 95, 117, 97, + 114, 116, 97, 0, 109, 111, 100, 101, 0, 83, 66, 80, 0, 101, 110, + 117, 109, 58, 83, 66, 80, 44, 78, 77, 69, 65, 0, 22, 4, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_settings_read_by_index_resp_t *test_msg = + (msg_settings_read_by_index_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->index = 4; + { + const char assign_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)117, + (char)97, (char)114, (char)116, (char)97, (char)0, (char)109, + (char)111, (char)100, (char)101, (char)0, (char)83, (char)66, + (char)80, (char)0, (char)101, (char)110, (char)117, (char)109, + (char)58, (char)83, (char)66, (char)80, (char)44, (char)78, + (char)77, (char)69, (char)65, (char)0}; + memcpy(test_msg->setting, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->setting) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->index, 4) << "incorrect value for index, expected 4, is " << last_msg_->index; - { - const char check_string[] = { (char)117,(char)97,(char)114,(char)116,(char)95,(char)117,(char)97,(char)114,(char)116,(char)97,(char)0,(char)109,(char)111,(char)100,(char)101,(char)0,(char)83,(char)66,(char)80,(char)0,(char)101,(char)110,(char)117,(char)109,(char)58,(char)83,(char)66,(char)80,(char)44,(char)78,(char)77,(char)69,(char)65,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->setting, expected string '" << check_string << "', is '" << last_msg_->setting << "'"; - } + EXPECT_EQ(send_message(0xa7, 55286, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->index, 4) + << "incorrect value for index, expected 4, is " << last_msg_->index; + { + const char check_string[] = { + (char)117, (char)97, (char)114, (char)116, (char)95, (char)117, + (char)97, (char)114, (char)116, (char)97, (char)0, (char)109, + (char)111, (char)100, (char)101, (char)0, (char)83, (char)66, + (char)80, (char)0, (char)101, (char)110, (char)117, (char)109, + (char)58, (char)83, (char)66, (char)80, (char)44, (char)78, + (char)77, (char)69, (char)65, (char)0}; + EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->setting, expected string '" + << check_string << "', is '" << last_msg_->setting << "'"; + } } diff --git a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadReq.cc b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadReq.cc index 72a89289c..0ea3bb93f 100644 --- a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadReq.cc +++ b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadReq.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadReq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadReq.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_settings_MsgSettingsReadReq0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_settings_MsgSettingsReadReq0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_settings_MsgSettingsReadReq0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_settings_MsgSettingsReadReq0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_settings_read_req_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_settings_read_req_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,44 +82,59 @@ class Test_legacy_auto_check_sbp_settings_MsgSettingsReadReq0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_settings_read_req_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadReq0, Test) -{ +}; - uint8_t encoded_frame[] = {85,164,0,152,214,26,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,181,228, }; +TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadReq0, Test) { + uint8_t encoded_frame[] = { + 85, 164, 0, 152, 214, 26, 115, 101, 99, 116, 105, 111, + 110, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, + 110, 103, 45, 110, 97, 109, 101, 0, 181, 228, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_settings_read_req_t* test_msg = ( msg_settings_read_req_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0 }; - memcpy(test_msg->setting, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->setting) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0xa4, 54936, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_settings_read_req_t *test_msg = + (msg_settings_read_req_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0}; + memcpy(test_msg->setting, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->setting) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 54936); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->setting, expected string '" << check_string << "', is '" << last_msg_->setting << "'"; - } + EXPECT_EQ(send_message(0xa4, 54936, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 54936); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0}; + EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->setting, expected string '" + << check_string << "', is '" << last_msg_->setting << "'"; + } } diff --git a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadResp.cc b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadResp.cc index 839868a06..aa5ec4dd6 100644 --- a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadResp.cc +++ b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsReadResp.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsReadResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_settings_MsgSettingsReadResp0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_settings_MsgSettingsReadResp0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_settings_MsgSettingsReadResp0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_settings_MsgSettingsReadResp0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_settings_read_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_settings_read_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,44 +82,73 @@ class Test_legacy_auto_check_sbp_settings_MsgSettingsReadResp0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_settings_read_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadResp0, Test) -{ +}; - uint8_t encoded_frame[] = {85,165,0,136,240,66,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,203,199, }; +TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsReadResp0, Test) { + uint8_t encoded_frame[] = { + 85, 165, 0, 136, 240, 66, 115, 101, 99, 116, 105, 111, 110, 45, 110, + 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 110, 97, 109, + 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 118, 97, 108, 117, 101, + 0, 101, 110, 117, 109, 59, 118, 97, 108, 117, 101, 49, 44, 118, 97, + 108, 117, 101, 50, 44, 118, 97, 108, 117, 101, 51, 0, 203, 199, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_settings_read_resp_t* test_msg = ( msg_settings_read_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; - memcpy(test_msg->setting, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->setting) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0xa5, 61576, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_settings_read_resp_t *test_msg = + (msg_settings_read_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; + memcpy(test_msg->setting, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->setting) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61576); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->setting, expected string '" << check_string << "', is '" << last_msg_->setting << "'"; - } + EXPECT_EQ(send_message(0xa5, 61576, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61576); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; + EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->setting, expected string '" + << check_string << "', is '" << last_msg_->setting << "'"; + } } diff --git a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsRegister.cc b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsRegister.cc index 9675d0f9a..a45a59df1 100644 --- a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsRegister.cc +++ b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsRegister.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegister.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegister.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_settings_MsgSettingsRegister0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_settings_MsgSettingsRegister0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_settings_MsgSettingsRegister0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_settings_MsgSettingsRegister0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_settings_register_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_settings_register_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,44 +82,73 @@ class Test_legacy_auto_check_sbp_settings_MsgSettingsRegister0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_settings_register_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsRegister0, Test) -{ +}; - uint8_t encoded_frame[] = {85,174,0,84,6,66,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,142,235, }; +TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsRegister0, Test) { + uint8_t encoded_frame[] = { + 85, 174, 0, 84, 6, 66, 115, 101, 99, 116, 105, 111, 110, 45, 110, + 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 110, 97, 109, + 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 118, 97, 108, 117, 101, + 0, 101, 110, 117, 109, 59, 118, 97, 108, 117, 101, 49, 44, 118, 97, + 108, 117, 101, 50, 44, 118, 97, 108, 117, 101, 51, 0, 142, 235, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_settings_register_t* test_msg = ( msg_settings_register_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; - memcpy(test_msg->setting, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->setting) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0xae, 1620, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_settings_register_t *test_msg = + (msg_settings_register_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; + memcpy(test_msg->setting, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->setting) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1620); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->setting, expected string '" << check_string << "', is '" << last_msg_->setting << "'"; - } + EXPECT_EQ(send_message(0xae, 1620, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1620); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; + EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->setting, expected string '" + << check_string << "', is '" << last_msg_->setting << "'"; + } } diff --git a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsRegisterResp.cc b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsRegisterResp.cc index aa5be1c81..7702ecac8 100644 --- a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsRegisterResp.cc +++ b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsRegisterResp.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegisterResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsRegisterResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_settings_MsgSettingsRegisterResp0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_settings_MsgSettingsRegisterResp0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_settings_MsgSettingsRegisterResp0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_settings_MsgSettingsRegisterResp0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_settings_register_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_settings_register_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,46 +82,76 @@ class Test_legacy_auto_check_sbp_settings_MsgSettingsRegisterResp0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_settings_register_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsRegisterResp0, Test) -{ +}; - uint8_t encoded_frame[] = {85,175,1,41,213,67,18,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,82,16, }; +TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsRegisterResp0, Test) { + uint8_t encoded_frame[] = { + 85, 175, 1, 41, 213, 67, 18, 115, 101, 99, 116, 105, 111, 110, 45, + 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 110, 97, + 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 118, 97, 108, 117, + 101, 0, 101, 110, 117, 109, 59, 118, 97, 108, 117, 101, 49, 44, 118, + 97, 108, 117, 101, 50, 44, 118, 97, 108, 117, 101, 51, 0, 82, 16, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_settings_register_resp_t* test_msg = ( msg_settings_register_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; - memcpy(test_msg->setting, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->setting) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->status = 18; - - EXPECT_EQ(send_message( 0x1af, 54569, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_settings_register_resp_t *test_msg = + (msg_settings_register_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; + memcpy(test_msg->setting, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->setting) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->status = 18; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 54569); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->setting, expected string '" << check_string << "', is '" << last_msg_->setting << "'"; - } - EXPECT_EQ(last_msg_->status, 18) << "incorrect value for status, expected 18, is " << last_msg_->status; + EXPECT_EQ(send_message(0x1af, 54569, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 54569); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; + EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->setting, expected string '" + << check_string << "', is '" << last_msg_->setting << "'"; + } + EXPECT_EQ(last_msg_->status, 18) + << "incorrect value for status, expected 18, is " << last_msg_->status; } diff --git a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsSave.cc b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsSave.cc index 6ec5baf3a..aafa8def4 100644 --- a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsSave.cc +++ b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsSave.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsSave.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsSave.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,6 +27,6 @@ #include #include +#include #include #include -#include diff --git a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsWrite.cc b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsWrite.cc index e23736182..31fb65b40 100644 --- a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsWrite.cc +++ b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsWrite.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWrite.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWrite.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_settings_MsgSettingsWrite0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_settings_MsgSettingsWrite0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_settings_MsgSettingsWrite0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_settings_MsgSettingsWrite0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_settings_write_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_settings_write_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,44 +81,63 @@ class Test_legacy_auto_check_sbp_settings_MsgSettingsWrite0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_settings_write_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsWrite0, Test) -{ +}; - uint8_t encoded_frame[] = {85,160,0,123,0,40,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,244,10, }; +TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsWrite0, Test) { + uint8_t encoded_frame[] = { + 85, 160, 0, 123, 0, 40, 115, 101, 99, 116, 105, 111, + 110, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, + 110, 103, 45, 110, 97, 109, 101, 0, 115, 101, 116, 116, + 105, 110, 103, 45, 118, 97, 108, 117, 101, 0, 244, 10, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_settings_write_t* test_msg = ( msg_settings_write_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0 }; - memcpy(test_msg->setting, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->setting) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0xa0, 123, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_settings_write_t *test_msg = (msg_settings_write_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0}; + memcpy(test_msg->setting, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->setting) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 123); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->setting, expected string '" << check_string << "', is '" << last_msg_->setting << "'"; - } + EXPECT_EQ(send_message(0xa0, 123, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 123); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0}; + EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->setting, expected string '" + << check_string << "', is '" << last_msg_->setting << "'"; + } } diff --git a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsWriteResp.cc b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsWriteResp.cc index e043cc64f..55807b6bd 100644 --- a/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsWriteResp.cc +++ b/c/test/legacy/cpp/auto_check_sbp_settings_MsgSettingsWriteResp.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWriteResp.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/settings/test_MsgSettingsWriteResp.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_settings_MsgSettingsWriteResp0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_settings_MsgSettingsWriteResp0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_settings_MsgSettingsWriteResp0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_settings_MsgSettingsWriteResp0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_settings_write_resp_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_settings_write_resp_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,46 +82,76 @@ class Test_legacy_auto_check_sbp_settings_MsgSettingsWriteResp0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_settings_write_resp_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsWriteResp0, Test) -{ +}; - uint8_t encoded_frame[] = {85,175,0,91,55,67,152,115,101,99,116,105,111,110,45,110,97,109,101,0,115,101,116,116,105,110,103,45,110,97,109,101,0,115,101,116,116,105,110,103,45,118,97,108,117,101,0,101,110,117,109,59,118,97,108,117,101,49,44,118,97,108,117,101,50,44,118,97,108,117,101,51,0,54,0, }; +TEST_F(Test_legacy_auto_check_sbp_settings_MsgSettingsWriteResp0, Test) { + uint8_t encoded_frame[] = { + 85, 175, 0, 91, 55, 67, 152, 115, 101, 99, 116, 105, 111, 110, 45, + 110, 97, 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 110, 97, + 109, 101, 0, 115, 101, 116, 116, 105, 110, 103, 45, 118, 97, 108, 117, + 101, 0, 101, 110, 117, 109, 59, 118, 97, 108, 117, 101, 49, 44, 118, + 97, 108, 117, 101, 50, 44, 118, 97, 108, 117, 101, 51, 0, 54, 0, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_settings_write_resp_t* test_msg = ( msg_settings_write_resp_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - { - const char assign_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; - memcpy(test_msg->setting, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->setting) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - test_msg->status = 152; - - EXPECT_EQ(send_message( 0xaf, 14171, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_settings_write_resp_t *test_msg = + (msg_settings_write_resp_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + { + const char assign_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; + memcpy(test_msg->setting, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->setting) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } + test_msg->status = 152; - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 14171); - EXPECT_EQ(last_msg_len_, test_msg_len); - { - const char check_string[] = { (char)115,(char)101,(char)99,(char)116,(char)105,(char)111,(char)110,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)110,(char)97,(char)109,(char)101,(char)0,(char)115,(char)101,(char)116,(char)116,(char)105,(char)110,(char)103,(char)45,(char)118,(char)97,(char)108,(char)117,(char)101,(char)0,(char)101,(char)110,(char)117,(char)109,(char)59,(char)118,(char)97,(char)108,(char)117,(char)101,(char)49,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)50,(char)44,(char)118,(char)97,(char)108,(char)117,(char)101,(char)51,(char)0 }; - EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->setting, expected string '" << check_string << "', is '" << last_msg_->setting << "'"; - } - EXPECT_EQ(last_msg_->status, 152) << "incorrect value for status, expected 152, is " << last_msg_->status; + EXPECT_EQ(send_message(0xaf, 14171, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 14171); + EXPECT_EQ(last_msg_len_, test_msg_len); + { + const char check_string[] = { + (char)115, (char)101, (char)99, (char)116, (char)105, (char)111, + (char)110, (char)45, (char)110, (char)97, (char)109, (char)101, + (char)0, (char)115, (char)101, (char)116, (char)116, (char)105, + (char)110, (char)103, (char)45, (char)110, (char)97, (char)109, + (char)101, (char)0, (char)115, (char)101, (char)116, (char)116, + (char)105, (char)110, (char)103, (char)45, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)0, (char)101, (char)110, + (char)117, (char)109, (char)59, (char)118, (char)97, (char)108, + (char)117, (char)101, (char)49, (char)44, (char)118, (char)97, + (char)108, (char)117, (char)101, (char)50, (char)44, (char)118, + (char)97, (char)108, (char)117, (char)101, (char)51, (char)0}; + EXPECT_EQ(memcmp(last_msg_->setting, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->setting, expected string '" + << check_string << "', is '" << last_msg_->setting << "'"; + } + EXPECT_EQ(last_msg_->status, 152) + << "incorrect value for status, expected 152, is " << last_msg_->status; } diff --git a/c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChain.cc b/c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChain.cc index b93773332..a088bbe5d 100644 --- a/c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChain.cc +++ b/c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChain.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChain.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChain.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_signing_MsgCertificateChain0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_signing_MsgCertificateChain0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_signing_MsgCertificateChain0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_signing_MsgCertificateChain0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_certificate_chain_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_certificate_chain_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,841 +82,1262 @@ class Test_legacy_auto_check_sbp_signing_MsgCertificateChain0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_certificate_chain_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_signing_MsgCertificateChain0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_signing_MsgCertificateChain0, Test) { + uint8_t encoded_frame[] = { + 85, 9, 12, 66, 0, 144, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 232, 7, + 3, 30, 12, 34, 59, 21, 205, 91, 7, 72, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 227, 224, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_certificate_chain_t *test_msg = + (msg_certificate_chain_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[0] = 20; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[1] = 21; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[2] = 22; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[3] = 23; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[4] = 24; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[5] = 25; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[6] = 26; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[7] = 27; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[8] = 28; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[9] = 29; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[10] = 10; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[11] = 11; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[12] = 12; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[13] = 13; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[14] = 14; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[15] = 15; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[16] = 16; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[17] = 17; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[18] = 18; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[19] = 19; + test_msg->expiration.day = 30; + test_msg->expiration.hours = 12; + test_msg->expiration.minutes = 34; + test_msg->expiration.month = 3; + test_msg->expiration.ns = 123456789; + test_msg->expiration.seconds = 59; + test_msg->expiration.year = 2024; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[0] = 10; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[1] = 11; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[2] = 12; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[3] = 13; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[4] = 14; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[5] = 15; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[6] = 16; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[7] = 17; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[8] = 18; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[9] = 19; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[10] = 0; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[11] = 1; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[12] = 2; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[13] = 3; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[14] = 4; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[15] = 5; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[16] = 6; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[17] = 7; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[18] = 8; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[19] = 9; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[0] = 0; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[1] = 1; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[2] = 2; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[3] = 3; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[4] = 4; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[5] = 5; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[6] = 6; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[7] = 7; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[8] = 8; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[9] = 9; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[10] = 10; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[11] = 11; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[12] = 12; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[13] = 13; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[14] = 14; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[15] = 15; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[16] = 16; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[17] = 17; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[18] = 18; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[19] = 19; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[0] = 0; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[1] = 1; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[2] = 2; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[3] = 3; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[4] = 4; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[5] = 5; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[6] = 6; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[7] = 7; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[8] = 8; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[9] = 9; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[10] = 10; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[11] = 11; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[12] = 12; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[13] = 13; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[14] = 14; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[15] = 15; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[16] = 16; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[17] = 17; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[18] = 18; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[19] = 19; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[20] = 20; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[21] = 21; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[22] = 22; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[23] = 23; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[24] = 24; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[25] = 25; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[26] = 26; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[27] = 27; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[28] = 28; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[29] = 29; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[30] = 30; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[31] = 31; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[32] = 32; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[33] = 33; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[34] = 34; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[35] = 35; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[36] = 36; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[37] = 37; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[38] = 38; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[39] = 39; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[40] = 40; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[41] = 41; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[42] = 42; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[43] = 43; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[44] = 44; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[45] = 45; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[46] = 46; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[47] = 47; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[48] = 48; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[49] = 49; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[50] = 50; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[51] = 51; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[52] = 52; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[53] = 53; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[54] = 54; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[55] = 55; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[56] = 56; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[57] = 57; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[58] = 58; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[59] = 59; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[60] = 60; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[61] = 61; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[62] = 62; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[63] = 63; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[64] = 64; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[65] = 65; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[66] = 66; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[67] = 67; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[68] = 68; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[69] = 69; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[70] = 70; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[71] = 71; + test_msg->signature.len = 72; - uint8_t encoded_frame[] = {85,9,12,66,0,144,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,20,21,22,23,24,25,26,27,28,29,10,11,12,13,14,15,16,17,18,19,232,7,3,30,12,34,59,21,205,91,7,72,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,227,224, }; + EXPECT_EQ(send_message(0xC09, 66, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_certificate_chain_t* test_msg = ( msg_certificate_chain_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[0] = 20; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[1] = 21; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[2] = 22; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[3] = 23; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[4] = 24; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[5] = 25; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[6] = 26; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[7] = 27; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[8] = 28; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[9] = 29; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[10] = 10; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[11] = 11; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[12] = 12; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[13] = 13; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[14] = 14; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[15] = 15; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[16] = 16; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[17] = 17; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[18] = 18; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[19] = 19; - test_msg->expiration.day = 30; - test_msg->expiration.hours = 12; - test_msg->expiration.minutes = 34; - test_msg->expiration.month = 3; - test_msg->expiration.ns = 123456789; - test_msg->expiration.seconds = 59; - test_msg->expiration.year = 2024; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[0] = 10; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[1] = 11; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[2] = 12; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[3] = 13; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[4] = 14; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[5] = 15; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[6] = 16; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[7] = 17; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[8] = 18; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[9] = 19; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[10] = 0; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[11] = 1; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[12] = 2; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[13] = 3; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[14] = 4; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[15] = 5; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[16] = 6; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[17] = 7; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[18] = 8; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[19] = 9; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[0] = 0; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[1] = 1; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[2] = 2; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[3] = 3; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[4] = 4; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[5] = 5; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[6] = 6; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[7] = 7; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[8] = 8; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[9] = 9; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[10] = 10; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[11] = 11; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[12] = 12; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[13] = 13; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[14] = 14; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[15] = 15; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[16] = 16; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[17] = 17; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[18] = 18; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[19] = 19; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[0] = 0; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[1] = 1; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[2] = 2; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[3] = 3; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[4] = 4; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[5] = 5; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[6] = 6; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[7] = 7; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[8] = 8; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[9] = 9; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[10] = 10; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[11] = 11; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[12] = 12; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[13] = 13; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[14] = 14; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[15] = 15; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[16] = 16; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[17] = 17; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[18] = 18; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[19] = 19; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[20] = 20; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[21] = 21; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[22] = 22; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[23] = 23; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[24] = 24; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[25] = 25; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[26] = 26; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[27] = 27; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[28] = 28; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[29] = 29; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[30] = 30; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[31] = 31; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[32] = 32; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[33] = 33; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[34] = 34; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[35] = 35; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[36] = 36; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[37] = 37; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[38] = 38; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[39] = 39; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[40] = 40; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[41] = 41; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[42] = 42; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[43] = 43; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[44] = 44; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[45] = 45; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[46] = 46; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[47] = 47; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[48] = 48; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[49] = 49; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[50] = 50; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[51] = 51; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[52] = 52; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[53] = 53; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[54] = 54; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[55] = 55; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[56] = 56; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[57] = 57; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[58] = 58; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[59] = 59; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[60] = 60; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[61] = 61; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[62] = 62; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[63] = 63; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[64] = 64; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[65] = 65; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[66] = 66; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[67] = 67; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[68] = 68; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[69] = 69; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[70] = 70; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[71] = 71; - test_msg->signature.len = 72; - - EXPECT_EQ(send_message( 0xC09, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->corrections_certificate[0], 20) << "incorrect value for corrections_certificate[0], expected 20, is " << last_msg_->corrections_certificate[0]; - EXPECT_EQ(last_msg_->corrections_certificate[1], 21) << "incorrect value for corrections_certificate[1], expected 21, is " << last_msg_->corrections_certificate[1]; - EXPECT_EQ(last_msg_->corrections_certificate[2], 22) << "incorrect value for corrections_certificate[2], expected 22, is " << last_msg_->corrections_certificate[2]; - EXPECT_EQ(last_msg_->corrections_certificate[3], 23) << "incorrect value for corrections_certificate[3], expected 23, is " << last_msg_->corrections_certificate[3]; - EXPECT_EQ(last_msg_->corrections_certificate[4], 24) << "incorrect value for corrections_certificate[4], expected 24, is " << last_msg_->corrections_certificate[4]; - EXPECT_EQ(last_msg_->corrections_certificate[5], 25) << "incorrect value for corrections_certificate[5], expected 25, is " << last_msg_->corrections_certificate[5]; - EXPECT_EQ(last_msg_->corrections_certificate[6], 26) << "incorrect value for corrections_certificate[6], expected 26, is " << last_msg_->corrections_certificate[6]; - EXPECT_EQ(last_msg_->corrections_certificate[7], 27) << "incorrect value for corrections_certificate[7], expected 27, is " << last_msg_->corrections_certificate[7]; - EXPECT_EQ(last_msg_->corrections_certificate[8], 28) << "incorrect value for corrections_certificate[8], expected 28, is " << last_msg_->corrections_certificate[8]; - EXPECT_EQ(last_msg_->corrections_certificate[9], 29) << "incorrect value for corrections_certificate[9], expected 29, is " << last_msg_->corrections_certificate[9]; - EXPECT_EQ(last_msg_->corrections_certificate[10], 10) << "incorrect value for corrections_certificate[10], expected 10, is " << last_msg_->corrections_certificate[10]; - EXPECT_EQ(last_msg_->corrections_certificate[11], 11) << "incorrect value for corrections_certificate[11], expected 11, is " << last_msg_->corrections_certificate[11]; - EXPECT_EQ(last_msg_->corrections_certificate[12], 12) << "incorrect value for corrections_certificate[12], expected 12, is " << last_msg_->corrections_certificate[12]; - EXPECT_EQ(last_msg_->corrections_certificate[13], 13) << "incorrect value for corrections_certificate[13], expected 13, is " << last_msg_->corrections_certificate[13]; - EXPECT_EQ(last_msg_->corrections_certificate[14], 14) << "incorrect value for corrections_certificate[14], expected 14, is " << last_msg_->corrections_certificate[14]; - EXPECT_EQ(last_msg_->corrections_certificate[15], 15) << "incorrect value for corrections_certificate[15], expected 15, is " << last_msg_->corrections_certificate[15]; - EXPECT_EQ(last_msg_->corrections_certificate[16], 16) << "incorrect value for corrections_certificate[16], expected 16, is " << last_msg_->corrections_certificate[16]; - EXPECT_EQ(last_msg_->corrections_certificate[17], 17) << "incorrect value for corrections_certificate[17], expected 17, is " << last_msg_->corrections_certificate[17]; - EXPECT_EQ(last_msg_->corrections_certificate[18], 18) << "incorrect value for corrections_certificate[18], expected 18, is " << last_msg_->corrections_certificate[18]; - EXPECT_EQ(last_msg_->corrections_certificate[19], 19) << "incorrect value for corrections_certificate[19], expected 19, is " << last_msg_->corrections_certificate[19]; - EXPECT_EQ(last_msg_->expiration.day, 30) << "incorrect value for expiration.day, expected 30, is " << last_msg_->expiration.day; - EXPECT_EQ(last_msg_->expiration.hours, 12) << "incorrect value for expiration.hours, expected 12, is " << last_msg_->expiration.hours; - EXPECT_EQ(last_msg_->expiration.minutes, 34) << "incorrect value for expiration.minutes, expected 34, is " << last_msg_->expiration.minutes; - EXPECT_EQ(last_msg_->expiration.month, 3) << "incorrect value for expiration.month, expected 3, is " << last_msg_->expiration.month; - EXPECT_EQ(last_msg_->expiration.ns, 123456789) << "incorrect value for expiration.ns, expected 123456789, is " << last_msg_->expiration.ns; - EXPECT_EQ(last_msg_->expiration.seconds, 59) << "incorrect value for expiration.seconds, expected 59, is " << last_msg_->expiration.seconds; - EXPECT_EQ(last_msg_->expiration.year, 2024) << "incorrect value for expiration.year, expected 2024, is " << last_msg_->expiration.year; - EXPECT_EQ(last_msg_->intermediate_certificate[0], 10) << "incorrect value for intermediate_certificate[0], expected 10, is " << last_msg_->intermediate_certificate[0]; - EXPECT_EQ(last_msg_->intermediate_certificate[1], 11) << "incorrect value for intermediate_certificate[1], expected 11, is " << last_msg_->intermediate_certificate[1]; - EXPECT_EQ(last_msg_->intermediate_certificate[2], 12) << "incorrect value for intermediate_certificate[2], expected 12, is " << last_msg_->intermediate_certificate[2]; - EXPECT_EQ(last_msg_->intermediate_certificate[3], 13) << "incorrect value for intermediate_certificate[3], expected 13, is " << last_msg_->intermediate_certificate[3]; - EXPECT_EQ(last_msg_->intermediate_certificate[4], 14) << "incorrect value for intermediate_certificate[4], expected 14, is " << last_msg_->intermediate_certificate[4]; - EXPECT_EQ(last_msg_->intermediate_certificate[5], 15) << "incorrect value for intermediate_certificate[5], expected 15, is " << last_msg_->intermediate_certificate[5]; - EXPECT_EQ(last_msg_->intermediate_certificate[6], 16) << "incorrect value for intermediate_certificate[6], expected 16, is " << last_msg_->intermediate_certificate[6]; - EXPECT_EQ(last_msg_->intermediate_certificate[7], 17) << "incorrect value for intermediate_certificate[7], expected 17, is " << last_msg_->intermediate_certificate[7]; - EXPECT_EQ(last_msg_->intermediate_certificate[8], 18) << "incorrect value for intermediate_certificate[8], expected 18, is " << last_msg_->intermediate_certificate[8]; - EXPECT_EQ(last_msg_->intermediate_certificate[9], 19) << "incorrect value for intermediate_certificate[9], expected 19, is " << last_msg_->intermediate_certificate[9]; - EXPECT_EQ(last_msg_->intermediate_certificate[10], 0) << "incorrect value for intermediate_certificate[10], expected 0, is " << last_msg_->intermediate_certificate[10]; - EXPECT_EQ(last_msg_->intermediate_certificate[11], 1) << "incorrect value for intermediate_certificate[11], expected 1, is " << last_msg_->intermediate_certificate[11]; - EXPECT_EQ(last_msg_->intermediate_certificate[12], 2) << "incorrect value for intermediate_certificate[12], expected 2, is " << last_msg_->intermediate_certificate[12]; - EXPECT_EQ(last_msg_->intermediate_certificate[13], 3) << "incorrect value for intermediate_certificate[13], expected 3, is " << last_msg_->intermediate_certificate[13]; - EXPECT_EQ(last_msg_->intermediate_certificate[14], 4) << "incorrect value for intermediate_certificate[14], expected 4, is " << last_msg_->intermediate_certificate[14]; - EXPECT_EQ(last_msg_->intermediate_certificate[15], 5) << "incorrect value for intermediate_certificate[15], expected 5, is " << last_msg_->intermediate_certificate[15]; - EXPECT_EQ(last_msg_->intermediate_certificate[16], 6) << "incorrect value for intermediate_certificate[16], expected 6, is " << last_msg_->intermediate_certificate[16]; - EXPECT_EQ(last_msg_->intermediate_certificate[17], 7) << "incorrect value for intermediate_certificate[17], expected 7, is " << last_msg_->intermediate_certificate[17]; - EXPECT_EQ(last_msg_->intermediate_certificate[18], 8) << "incorrect value for intermediate_certificate[18], expected 8, is " << last_msg_->intermediate_certificate[18]; - EXPECT_EQ(last_msg_->intermediate_certificate[19], 9) << "incorrect value for intermediate_certificate[19], expected 9, is " << last_msg_->intermediate_certificate[19]; - EXPECT_EQ(last_msg_->root_certificate[0], 0) << "incorrect value for root_certificate[0], expected 0, is " << last_msg_->root_certificate[0]; - EXPECT_EQ(last_msg_->root_certificate[1], 1) << "incorrect value for root_certificate[1], expected 1, is " << last_msg_->root_certificate[1]; - EXPECT_EQ(last_msg_->root_certificate[2], 2) << "incorrect value for root_certificate[2], expected 2, is " << last_msg_->root_certificate[2]; - EXPECT_EQ(last_msg_->root_certificate[3], 3) << "incorrect value for root_certificate[3], expected 3, is " << last_msg_->root_certificate[3]; - EXPECT_EQ(last_msg_->root_certificate[4], 4) << "incorrect value for root_certificate[4], expected 4, is " << last_msg_->root_certificate[4]; - EXPECT_EQ(last_msg_->root_certificate[5], 5) << "incorrect value for root_certificate[5], expected 5, is " << last_msg_->root_certificate[5]; - EXPECT_EQ(last_msg_->root_certificate[6], 6) << "incorrect value for root_certificate[6], expected 6, is " << last_msg_->root_certificate[6]; - EXPECT_EQ(last_msg_->root_certificate[7], 7) << "incorrect value for root_certificate[7], expected 7, is " << last_msg_->root_certificate[7]; - EXPECT_EQ(last_msg_->root_certificate[8], 8) << "incorrect value for root_certificate[8], expected 8, is " << last_msg_->root_certificate[8]; - EXPECT_EQ(last_msg_->root_certificate[9], 9) << "incorrect value for root_certificate[9], expected 9, is " << last_msg_->root_certificate[9]; - EXPECT_EQ(last_msg_->root_certificate[10], 10) << "incorrect value for root_certificate[10], expected 10, is " << last_msg_->root_certificate[10]; - EXPECT_EQ(last_msg_->root_certificate[11], 11) << "incorrect value for root_certificate[11], expected 11, is " << last_msg_->root_certificate[11]; - EXPECT_EQ(last_msg_->root_certificate[12], 12) << "incorrect value for root_certificate[12], expected 12, is " << last_msg_->root_certificate[12]; - EXPECT_EQ(last_msg_->root_certificate[13], 13) << "incorrect value for root_certificate[13], expected 13, is " << last_msg_->root_certificate[13]; - EXPECT_EQ(last_msg_->root_certificate[14], 14) << "incorrect value for root_certificate[14], expected 14, is " << last_msg_->root_certificate[14]; - EXPECT_EQ(last_msg_->root_certificate[15], 15) << "incorrect value for root_certificate[15], expected 15, is " << last_msg_->root_certificate[15]; - EXPECT_EQ(last_msg_->root_certificate[16], 16) << "incorrect value for root_certificate[16], expected 16, is " << last_msg_->root_certificate[16]; - EXPECT_EQ(last_msg_->root_certificate[17], 17) << "incorrect value for root_certificate[17], expected 17, is " << last_msg_->root_certificate[17]; - EXPECT_EQ(last_msg_->root_certificate[18], 18) << "incorrect value for root_certificate[18], expected 18, is " << last_msg_->root_certificate[18]; - EXPECT_EQ(last_msg_->root_certificate[19], 19) << "incorrect value for root_certificate[19], expected 19, is " << last_msg_->root_certificate[19]; - EXPECT_EQ(last_msg_->signature.data[0], 0) << "incorrect value for signature.data[0], expected 0, is " << last_msg_->signature.data[0]; - EXPECT_EQ(last_msg_->signature.data[1], 1) << "incorrect value for signature.data[1], expected 1, is " << last_msg_->signature.data[1]; - EXPECT_EQ(last_msg_->signature.data[2], 2) << "incorrect value for signature.data[2], expected 2, is " << last_msg_->signature.data[2]; - EXPECT_EQ(last_msg_->signature.data[3], 3) << "incorrect value for signature.data[3], expected 3, is " << last_msg_->signature.data[3]; - EXPECT_EQ(last_msg_->signature.data[4], 4) << "incorrect value for signature.data[4], expected 4, is " << last_msg_->signature.data[4]; - EXPECT_EQ(last_msg_->signature.data[5], 5) << "incorrect value for signature.data[5], expected 5, is " << last_msg_->signature.data[5]; - EXPECT_EQ(last_msg_->signature.data[6], 6) << "incorrect value for signature.data[6], expected 6, is " << last_msg_->signature.data[6]; - EXPECT_EQ(last_msg_->signature.data[7], 7) << "incorrect value for signature.data[7], expected 7, is " << last_msg_->signature.data[7]; - EXPECT_EQ(last_msg_->signature.data[8], 8) << "incorrect value for signature.data[8], expected 8, is " << last_msg_->signature.data[8]; - EXPECT_EQ(last_msg_->signature.data[9], 9) << "incorrect value for signature.data[9], expected 9, is " << last_msg_->signature.data[9]; - EXPECT_EQ(last_msg_->signature.data[10], 10) << "incorrect value for signature.data[10], expected 10, is " << last_msg_->signature.data[10]; - EXPECT_EQ(last_msg_->signature.data[11], 11) << "incorrect value for signature.data[11], expected 11, is " << last_msg_->signature.data[11]; - EXPECT_EQ(last_msg_->signature.data[12], 12) << "incorrect value for signature.data[12], expected 12, is " << last_msg_->signature.data[12]; - EXPECT_EQ(last_msg_->signature.data[13], 13) << "incorrect value for signature.data[13], expected 13, is " << last_msg_->signature.data[13]; - EXPECT_EQ(last_msg_->signature.data[14], 14) << "incorrect value for signature.data[14], expected 14, is " << last_msg_->signature.data[14]; - EXPECT_EQ(last_msg_->signature.data[15], 15) << "incorrect value for signature.data[15], expected 15, is " << last_msg_->signature.data[15]; - EXPECT_EQ(last_msg_->signature.data[16], 16) << "incorrect value for signature.data[16], expected 16, is " << last_msg_->signature.data[16]; - EXPECT_EQ(last_msg_->signature.data[17], 17) << "incorrect value for signature.data[17], expected 17, is " << last_msg_->signature.data[17]; - EXPECT_EQ(last_msg_->signature.data[18], 18) << "incorrect value for signature.data[18], expected 18, is " << last_msg_->signature.data[18]; - EXPECT_EQ(last_msg_->signature.data[19], 19) << "incorrect value for signature.data[19], expected 19, is " << last_msg_->signature.data[19]; - EXPECT_EQ(last_msg_->signature.data[20], 20) << "incorrect value for signature.data[20], expected 20, is " << last_msg_->signature.data[20]; - EXPECT_EQ(last_msg_->signature.data[21], 21) << "incorrect value for signature.data[21], expected 21, is " << last_msg_->signature.data[21]; - EXPECT_EQ(last_msg_->signature.data[22], 22) << "incorrect value for signature.data[22], expected 22, is " << last_msg_->signature.data[22]; - EXPECT_EQ(last_msg_->signature.data[23], 23) << "incorrect value for signature.data[23], expected 23, is " << last_msg_->signature.data[23]; - EXPECT_EQ(last_msg_->signature.data[24], 24) << "incorrect value for signature.data[24], expected 24, is " << last_msg_->signature.data[24]; - EXPECT_EQ(last_msg_->signature.data[25], 25) << "incorrect value for signature.data[25], expected 25, is " << last_msg_->signature.data[25]; - EXPECT_EQ(last_msg_->signature.data[26], 26) << "incorrect value for signature.data[26], expected 26, is " << last_msg_->signature.data[26]; - EXPECT_EQ(last_msg_->signature.data[27], 27) << "incorrect value for signature.data[27], expected 27, is " << last_msg_->signature.data[27]; - EXPECT_EQ(last_msg_->signature.data[28], 28) << "incorrect value for signature.data[28], expected 28, is " << last_msg_->signature.data[28]; - EXPECT_EQ(last_msg_->signature.data[29], 29) << "incorrect value for signature.data[29], expected 29, is " << last_msg_->signature.data[29]; - EXPECT_EQ(last_msg_->signature.data[30], 30) << "incorrect value for signature.data[30], expected 30, is " << last_msg_->signature.data[30]; - EXPECT_EQ(last_msg_->signature.data[31], 31) << "incorrect value for signature.data[31], expected 31, is " << last_msg_->signature.data[31]; - EXPECT_EQ(last_msg_->signature.data[32], 32) << "incorrect value for signature.data[32], expected 32, is " << last_msg_->signature.data[32]; - EXPECT_EQ(last_msg_->signature.data[33], 33) << "incorrect value for signature.data[33], expected 33, is " << last_msg_->signature.data[33]; - EXPECT_EQ(last_msg_->signature.data[34], 34) << "incorrect value for signature.data[34], expected 34, is " << last_msg_->signature.data[34]; - EXPECT_EQ(last_msg_->signature.data[35], 35) << "incorrect value for signature.data[35], expected 35, is " << last_msg_->signature.data[35]; - EXPECT_EQ(last_msg_->signature.data[36], 36) << "incorrect value for signature.data[36], expected 36, is " << last_msg_->signature.data[36]; - EXPECT_EQ(last_msg_->signature.data[37], 37) << "incorrect value for signature.data[37], expected 37, is " << last_msg_->signature.data[37]; - EXPECT_EQ(last_msg_->signature.data[38], 38) << "incorrect value for signature.data[38], expected 38, is " << last_msg_->signature.data[38]; - EXPECT_EQ(last_msg_->signature.data[39], 39) << "incorrect value for signature.data[39], expected 39, is " << last_msg_->signature.data[39]; - EXPECT_EQ(last_msg_->signature.data[40], 40) << "incorrect value for signature.data[40], expected 40, is " << last_msg_->signature.data[40]; - EXPECT_EQ(last_msg_->signature.data[41], 41) << "incorrect value for signature.data[41], expected 41, is " << last_msg_->signature.data[41]; - EXPECT_EQ(last_msg_->signature.data[42], 42) << "incorrect value for signature.data[42], expected 42, is " << last_msg_->signature.data[42]; - EXPECT_EQ(last_msg_->signature.data[43], 43) << "incorrect value for signature.data[43], expected 43, is " << last_msg_->signature.data[43]; - EXPECT_EQ(last_msg_->signature.data[44], 44) << "incorrect value for signature.data[44], expected 44, is " << last_msg_->signature.data[44]; - EXPECT_EQ(last_msg_->signature.data[45], 45) << "incorrect value for signature.data[45], expected 45, is " << last_msg_->signature.data[45]; - EXPECT_EQ(last_msg_->signature.data[46], 46) << "incorrect value for signature.data[46], expected 46, is " << last_msg_->signature.data[46]; - EXPECT_EQ(last_msg_->signature.data[47], 47) << "incorrect value for signature.data[47], expected 47, is " << last_msg_->signature.data[47]; - EXPECT_EQ(last_msg_->signature.data[48], 48) << "incorrect value for signature.data[48], expected 48, is " << last_msg_->signature.data[48]; - EXPECT_EQ(last_msg_->signature.data[49], 49) << "incorrect value for signature.data[49], expected 49, is " << last_msg_->signature.data[49]; - EXPECT_EQ(last_msg_->signature.data[50], 50) << "incorrect value for signature.data[50], expected 50, is " << last_msg_->signature.data[50]; - EXPECT_EQ(last_msg_->signature.data[51], 51) << "incorrect value for signature.data[51], expected 51, is " << last_msg_->signature.data[51]; - EXPECT_EQ(last_msg_->signature.data[52], 52) << "incorrect value for signature.data[52], expected 52, is " << last_msg_->signature.data[52]; - EXPECT_EQ(last_msg_->signature.data[53], 53) << "incorrect value for signature.data[53], expected 53, is " << last_msg_->signature.data[53]; - EXPECT_EQ(last_msg_->signature.data[54], 54) << "incorrect value for signature.data[54], expected 54, is " << last_msg_->signature.data[54]; - EXPECT_EQ(last_msg_->signature.data[55], 55) << "incorrect value for signature.data[55], expected 55, is " << last_msg_->signature.data[55]; - EXPECT_EQ(last_msg_->signature.data[56], 56) << "incorrect value for signature.data[56], expected 56, is " << last_msg_->signature.data[56]; - EXPECT_EQ(last_msg_->signature.data[57], 57) << "incorrect value for signature.data[57], expected 57, is " << last_msg_->signature.data[57]; - EXPECT_EQ(last_msg_->signature.data[58], 58) << "incorrect value for signature.data[58], expected 58, is " << last_msg_->signature.data[58]; - EXPECT_EQ(last_msg_->signature.data[59], 59) << "incorrect value for signature.data[59], expected 59, is " << last_msg_->signature.data[59]; - EXPECT_EQ(last_msg_->signature.data[60], 60) << "incorrect value for signature.data[60], expected 60, is " << last_msg_->signature.data[60]; - EXPECT_EQ(last_msg_->signature.data[61], 61) << "incorrect value for signature.data[61], expected 61, is " << last_msg_->signature.data[61]; - EXPECT_EQ(last_msg_->signature.data[62], 62) << "incorrect value for signature.data[62], expected 62, is " << last_msg_->signature.data[62]; - EXPECT_EQ(last_msg_->signature.data[63], 63) << "incorrect value for signature.data[63], expected 63, is " << last_msg_->signature.data[63]; - EXPECT_EQ(last_msg_->signature.data[64], 64) << "incorrect value for signature.data[64], expected 64, is " << last_msg_->signature.data[64]; - EXPECT_EQ(last_msg_->signature.data[65], 65) << "incorrect value for signature.data[65], expected 65, is " << last_msg_->signature.data[65]; - EXPECT_EQ(last_msg_->signature.data[66], 66) << "incorrect value for signature.data[66], expected 66, is " << last_msg_->signature.data[66]; - EXPECT_EQ(last_msg_->signature.data[67], 67) << "incorrect value for signature.data[67], expected 67, is " << last_msg_->signature.data[67]; - EXPECT_EQ(last_msg_->signature.data[68], 68) << "incorrect value for signature.data[68], expected 68, is " << last_msg_->signature.data[68]; - EXPECT_EQ(last_msg_->signature.data[69], 69) << "incorrect value for signature.data[69], expected 69, is " << last_msg_->signature.data[69]; - EXPECT_EQ(last_msg_->signature.data[70], 70) << "incorrect value for signature.data[70], expected 70, is " << last_msg_->signature.data[70]; - EXPECT_EQ(last_msg_->signature.data[71], 71) << "incorrect value for signature.data[71], expected 71, is " << last_msg_->signature.data[71]; - EXPECT_EQ(last_msg_->signature.len, 72) << "incorrect value for signature.len, expected 72, is " << last_msg_->signature.len; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->corrections_certificate[0], 20) + << "incorrect value for corrections_certificate[0], expected 20, is " + << last_msg_->corrections_certificate[0]; + EXPECT_EQ(last_msg_->corrections_certificate[1], 21) + << "incorrect value for corrections_certificate[1], expected 21, is " + << last_msg_->corrections_certificate[1]; + EXPECT_EQ(last_msg_->corrections_certificate[2], 22) + << "incorrect value for corrections_certificate[2], expected 22, is " + << last_msg_->corrections_certificate[2]; + EXPECT_EQ(last_msg_->corrections_certificate[3], 23) + << "incorrect value for corrections_certificate[3], expected 23, is " + << last_msg_->corrections_certificate[3]; + EXPECT_EQ(last_msg_->corrections_certificate[4], 24) + << "incorrect value for corrections_certificate[4], expected 24, is " + << last_msg_->corrections_certificate[4]; + EXPECT_EQ(last_msg_->corrections_certificate[5], 25) + << "incorrect value for corrections_certificate[5], expected 25, is " + << last_msg_->corrections_certificate[5]; + EXPECT_EQ(last_msg_->corrections_certificate[6], 26) + << "incorrect value for corrections_certificate[6], expected 26, is " + << last_msg_->corrections_certificate[6]; + EXPECT_EQ(last_msg_->corrections_certificate[7], 27) + << "incorrect value for corrections_certificate[7], expected 27, is " + << last_msg_->corrections_certificate[7]; + EXPECT_EQ(last_msg_->corrections_certificate[8], 28) + << "incorrect value for corrections_certificate[8], expected 28, is " + << last_msg_->corrections_certificate[8]; + EXPECT_EQ(last_msg_->corrections_certificate[9], 29) + << "incorrect value for corrections_certificate[9], expected 29, is " + << last_msg_->corrections_certificate[9]; + EXPECT_EQ(last_msg_->corrections_certificate[10], 10) + << "incorrect value for corrections_certificate[10], expected 10, is " + << last_msg_->corrections_certificate[10]; + EXPECT_EQ(last_msg_->corrections_certificate[11], 11) + << "incorrect value for corrections_certificate[11], expected 11, is " + << last_msg_->corrections_certificate[11]; + EXPECT_EQ(last_msg_->corrections_certificate[12], 12) + << "incorrect value for corrections_certificate[12], expected 12, is " + << last_msg_->corrections_certificate[12]; + EXPECT_EQ(last_msg_->corrections_certificate[13], 13) + << "incorrect value for corrections_certificate[13], expected 13, is " + << last_msg_->corrections_certificate[13]; + EXPECT_EQ(last_msg_->corrections_certificate[14], 14) + << "incorrect value for corrections_certificate[14], expected 14, is " + << last_msg_->corrections_certificate[14]; + EXPECT_EQ(last_msg_->corrections_certificate[15], 15) + << "incorrect value for corrections_certificate[15], expected 15, is " + << last_msg_->corrections_certificate[15]; + EXPECT_EQ(last_msg_->corrections_certificate[16], 16) + << "incorrect value for corrections_certificate[16], expected 16, is " + << last_msg_->corrections_certificate[16]; + EXPECT_EQ(last_msg_->corrections_certificate[17], 17) + << "incorrect value for corrections_certificate[17], expected 17, is " + << last_msg_->corrections_certificate[17]; + EXPECT_EQ(last_msg_->corrections_certificate[18], 18) + << "incorrect value for corrections_certificate[18], expected 18, is " + << last_msg_->corrections_certificate[18]; + EXPECT_EQ(last_msg_->corrections_certificate[19], 19) + << "incorrect value for corrections_certificate[19], expected 19, is " + << last_msg_->corrections_certificate[19]; + EXPECT_EQ(last_msg_->expiration.day, 30) + << "incorrect value for expiration.day, expected 30, is " + << last_msg_->expiration.day; + EXPECT_EQ(last_msg_->expiration.hours, 12) + << "incorrect value for expiration.hours, expected 12, is " + << last_msg_->expiration.hours; + EXPECT_EQ(last_msg_->expiration.minutes, 34) + << "incorrect value for expiration.minutes, expected 34, is " + << last_msg_->expiration.minutes; + EXPECT_EQ(last_msg_->expiration.month, 3) + << "incorrect value for expiration.month, expected 3, is " + << last_msg_->expiration.month; + EXPECT_EQ(last_msg_->expiration.ns, 123456789) + << "incorrect value for expiration.ns, expected 123456789, is " + << last_msg_->expiration.ns; + EXPECT_EQ(last_msg_->expiration.seconds, 59) + << "incorrect value for expiration.seconds, expected 59, is " + << last_msg_->expiration.seconds; + EXPECT_EQ(last_msg_->expiration.year, 2024) + << "incorrect value for expiration.year, expected 2024, is " + << last_msg_->expiration.year; + EXPECT_EQ(last_msg_->intermediate_certificate[0], 10) + << "incorrect value for intermediate_certificate[0], expected 10, is " + << last_msg_->intermediate_certificate[0]; + EXPECT_EQ(last_msg_->intermediate_certificate[1], 11) + << "incorrect value for intermediate_certificate[1], expected 11, is " + << last_msg_->intermediate_certificate[1]; + EXPECT_EQ(last_msg_->intermediate_certificate[2], 12) + << "incorrect value for intermediate_certificate[2], expected 12, is " + << last_msg_->intermediate_certificate[2]; + EXPECT_EQ(last_msg_->intermediate_certificate[3], 13) + << "incorrect value for intermediate_certificate[3], expected 13, is " + << last_msg_->intermediate_certificate[3]; + EXPECT_EQ(last_msg_->intermediate_certificate[4], 14) + << "incorrect value for intermediate_certificate[4], expected 14, is " + << last_msg_->intermediate_certificate[4]; + EXPECT_EQ(last_msg_->intermediate_certificate[5], 15) + << "incorrect value for intermediate_certificate[5], expected 15, is " + << last_msg_->intermediate_certificate[5]; + EXPECT_EQ(last_msg_->intermediate_certificate[6], 16) + << "incorrect value for intermediate_certificate[6], expected 16, is " + << last_msg_->intermediate_certificate[6]; + EXPECT_EQ(last_msg_->intermediate_certificate[7], 17) + << "incorrect value for intermediate_certificate[7], expected 17, is " + << last_msg_->intermediate_certificate[7]; + EXPECT_EQ(last_msg_->intermediate_certificate[8], 18) + << "incorrect value for intermediate_certificate[8], expected 18, is " + << last_msg_->intermediate_certificate[8]; + EXPECT_EQ(last_msg_->intermediate_certificate[9], 19) + << "incorrect value for intermediate_certificate[9], expected 19, is " + << last_msg_->intermediate_certificate[9]; + EXPECT_EQ(last_msg_->intermediate_certificate[10], 0) + << "incorrect value for intermediate_certificate[10], expected 0, is " + << last_msg_->intermediate_certificate[10]; + EXPECT_EQ(last_msg_->intermediate_certificate[11], 1) + << "incorrect value for intermediate_certificate[11], expected 1, is " + << last_msg_->intermediate_certificate[11]; + EXPECT_EQ(last_msg_->intermediate_certificate[12], 2) + << "incorrect value for intermediate_certificate[12], expected 2, is " + << last_msg_->intermediate_certificate[12]; + EXPECT_EQ(last_msg_->intermediate_certificate[13], 3) + << "incorrect value for intermediate_certificate[13], expected 3, is " + << last_msg_->intermediate_certificate[13]; + EXPECT_EQ(last_msg_->intermediate_certificate[14], 4) + << "incorrect value for intermediate_certificate[14], expected 4, is " + << last_msg_->intermediate_certificate[14]; + EXPECT_EQ(last_msg_->intermediate_certificate[15], 5) + << "incorrect value for intermediate_certificate[15], expected 5, is " + << last_msg_->intermediate_certificate[15]; + EXPECT_EQ(last_msg_->intermediate_certificate[16], 6) + << "incorrect value for intermediate_certificate[16], expected 6, is " + << last_msg_->intermediate_certificate[16]; + EXPECT_EQ(last_msg_->intermediate_certificate[17], 7) + << "incorrect value for intermediate_certificate[17], expected 7, is " + << last_msg_->intermediate_certificate[17]; + EXPECT_EQ(last_msg_->intermediate_certificate[18], 8) + << "incorrect value for intermediate_certificate[18], expected 8, is " + << last_msg_->intermediate_certificate[18]; + EXPECT_EQ(last_msg_->intermediate_certificate[19], 9) + << "incorrect value for intermediate_certificate[19], expected 9, is " + << last_msg_->intermediate_certificate[19]; + EXPECT_EQ(last_msg_->root_certificate[0], 0) + << "incorrect value for root_certificate[0], expected 0, is " + << last_msg_->root_certificate[0]; + EXPECT_EQ(last_msg_->root_certificate[1], 1) + << "incorrect value for root_certificate[1], expected 1, is " + << last_msg_->root_certificate[1]; + EXPECT_EQ(last_msg_->root_certificate[2], 2) + << "incorrect value for root_certificate[2], expected 2, is " + << last_msg_->root_certificate[2]; + EXPECT_EQ(last_msg_->root_certificate[3], 3) + << "incorrect value for root_certificate[3], expected 3, is " + << last_msg_->root_certificate[3]; + EXPECT_EQ(last_msg_->root_certificate[4], 4) + << "incorrect value for root_certificate[4], expected 4, is " + << last_msg_->root_certificate[4]; + EXPECT_EQ(last_msg_->root_certificate[5], 5) + << "incorrect value for root_certificate[5], expected 5, is " + << last_msg_->root_certificate[5]; + EXPECT_EQ(last_msg_->root_certificate[6], 6) + << "incorrect value for root_certificate[6], expected 6, is " + << last_msg_->root_certificate[6]; + EXPECT_EQ(last_msg_->root_certificate[7], 7) + << "incorrect value for root_certificate[7], expected 7, is " + << last_msg_->root_certificate[7]; + EXPECT_EQ(last_msg_->root_certificate[8], 8) + << "incorrect value for root_certificate[8], expected 8, is " + << last_msg_->root_certificate[8]; + EXPECT_EQ(last_msg_->root_certificate[9], 9) + << "incorrect value for root_certificate[9], expected 9, is " + << last_msg_->root_certificate[9]; + EXPECT_EQ(last_msg_->root_certificate[10], 10) + << "incorrect value for root_certificate[10], expected 10, is " + << last_msg_->root_certificate[10]; + EXPECT_EQ(last_msg_->root_certificate[11], 11) + << "incorrect value for root_certificate[11], expected 11, is " + << last_msg_->root_certificate[11]; + EXPECT_EQ(last_msg_->root_certificate[12], 12) + << "incorrect value for root_certificate[12], expected 12, is " + << last_msg_->root_certificate[12]; + EXPECT_EQ(last_msg_->root_certificate[13], 13) + << "incorrect value for root_certificate[13], expected 13, is " + << last_msg_->root_certificate[13]; + EXPECT_EQ(last_msg_->root_certificate[14], 14) + << "incorrect value for root_certificate[14], expected 14, is " + << last_msg_->root_certificate[14]; + EXPECT_EQ(last_msg_->root_certificate[15], 15) + << "incorrect value for root_certificate[15], expected 15, is " + << last_msg_->root_certificate[15]; + EXPECT_EQ(last_msg_->root_certificate[16], 16) + << "incorrect value for root_certificate[16], expected 16, is " + << last_msg_->root_certificate[16]; + EXPECT_EQ(last_msg_->root_certificate[17], 17) + << "incorrect value for root_certificate[17], expected 17, is " + << last_msg_->root_certificate[17]; + EXPECT_EQ(last_msg_->root_certificate[18], 18) + << "incorrect value for root_certificate[18], expected 18, is " + << last_msg_->root_certificate[18]; + EXPECT_EQ(last_msg_->root_certificate[19], 19) + << "incorrect value for root_certificate[19], expected 19, is " + << last_msg_->root_certificate[19]; + EXPECT_EQ(last_msg_->signature.data[0], 0) + << "incorrect value for signature.data[0], expected 0, is " + << last_msg_->signature.data[0]; + EXPECT_EQ(last_msg_->signature.data[1], 1) + << "incorrect value for signature.data[1], expected 1, is " + << last_msg_->signature.data[1]; + EXPECT_EQ(last_msg_->signature.data[2], 2) + << "incorrect value for signature.data[2], expected 2, is " + << last_msg_->signature.data[2]; + EXPECT_EQ(last_msg_->signature.data[3], 3) + << "incorrect value for signature.data[3], expected 3, is " + << last_msg_->signature.data[3]; + EXPECT_EQ(last_msg_->signature.data[4], 4) + << "incorrect value for signature.data[4], expected 4, is " + << last_msg_->signature.data[4]; + EXPECT_EQ(last_msg_->signature.data[5], 5) + << "incorrect value for signature.data[5], expected 5, is " + << last_msg_->signature.data[5]; + EXPECT_EQ(last_msg_->signature.data[6], 6) + << "incorrect value for signature.data[6], expected 6, is " + << last_msg_->signature.data[6]; + EXPECT_EQ(last_msg_->signature.data[7], 7) + << "incorrect value for signature.data[7], expected 7, is " + << last_msg_->signature.data[7]; + EXPECT_EQ(last_msg_->signature.data[8], 8) + << "incorrect value for signature.data[8], expected 8, is " + << last_msg_->signature.data[8]; + EXPECT_EQ(last_msg_->signature.data[9], 9) + << "incorrect value for signature.data[9], expected 9, is " + << last_msg_->signature.data[9]; + EXPECT_EQ(last_msg_->signature.data[10], 10) + << "incorrect value for signature.data[10], expected 10, is " + << last_msg_->signature.data[10]; + EXPECT_EQ(last_msg_->signature.data[11], 11) + << "incorrect value for signature.data[11], expected 11, is " + << last_msg_->signature.data[11]; + EXPECT_EQ(last_msg_->signature.data[12], 12) + << "incorrect value for signature.data[12], expected 12, is " + << last_msg_->signature.data[12]; + EXPECT_EQ(last_msg_->signature.data[13], 13) + << "incorrect value for signature.data[13], expected 13, is " + << last_msg_->signature.data[13]; + EXPECT_EQ(last_msg_->signature.data[14], 14) + << "incorrect value for signature.data[14], expected 14, is " + << last_msg_->signature.data[14]; + EXPECT_EQ(last_msg_->signature.data[15], 15) + << "incorrect value for signature.data[15], expected 15, is " + << last_msg_->signature.data[15]; + EXPECT_EQ(last_msg_->signature.data[16], 16) + << "incorrect value for signature.data[16], expected 16, is " + << last_msg_->signature.data[16]; + EXPECT_EQ(last_msg_->signature.data[17], 17) + << "incorrect value for signature.data[17], expected 17, is " + << last_msg_->signature.data[17]; + EXPECT_EQ(last_msg_->signature.data[18], 18) + << "incorrect value for signature.data[18], expected 18, is " + << last_msg_->signature.data[18]; + EXPECT_EQ(last_msg_->signature.data[19], 19) + << "incorrect value for signature.data[19], expected 19, is " + << last_msg_->signature.data[19]; + EXPECT_EQ(last_msg_->signature.data[20], 20) + << "incorrect value for signature.data[20], expected 20, is " + << last_msg_->signature.data[20]; + EXPECT_EQ(last_msg_->signature.data[21], 21) + << "incorrect value for signature.data[21], expected 21, is " + << last_msg_->signature.data[21]; + EXPECT_EQ(last_msg_->signature.data[22], 22) + << "incorrect value for signature.data[22], expected 22, is " + << last_msg_->signature.data[22]; + EXPECT_EQ(last_msg_->signature.data[23], 23) + << "incorrect value for signature.data[23], expected 23, is " + << last_msg_->signature.data[23]; + EXPECT_EQ(last_msg_->signature.data[24], 24) + << "incorrect value for signature.data[24], expected 24, is " + << last_msg_->signature.data[24]; + EXPECT_EQ(last_msg_->signature.data[25], 25) + << "incorrect value for signature.data[25], expected 25, is " + << last_msg_->signature.data[25]; + EXPECT_EQ(last_msg_->signature.data[26], 26) + << "incorrect value for signature.data[26], expected 26, is " + << last_msg_->signature.data[26]; + EXPECT_EQ(last_msg_->signature.data[27], 27) + << "incorrect value for signature.data[27], expected 27, is " + << last_msg_->signature.data[27]; + EXPECT_EQ(last_msg_->signature.data[28], 28) + << "incorrect value for signature.data[28], expected 28, is " + << last_msg_->signature.data[28]; + EXPECT_EQ(last_msg_->signature.data[29], 29) + << "incorrect value for signature.data[29], expected 29, is " + << last_msg_->signature.data[29]; + EXPECT_EQ(last_msg_->signature.data[30], 30) + << "incorrect value for signature.data[30], expected 30, is " + << last_msg_->signature.data[30]; + EXPECT_EQ(last_msg_->signature.data[31], 31) + << "incorrect value for signature.data[31], expected 31, is " + << last_msg_->signature.data[31]; + EXPECT_EQ(last_msg_->signature.data[32], 32) + << "incorrect value for signature.data[32], expected 32, is " + << last_msg_->signature.data[32]; + EXPECT_EQ(last_msg_->signature.data[33], 33) + << "incorrect value for signature.data[33], expected 33, is " + << last_msg_->signature.data[33]; + EXPECT_EQ(last_msg_->signature.data[34], 34) + << "incorrect value for signature.data[34], expected 34, is " + << last_msg_->signature.data[34]; + EXPECT_EQ(last_msg_->signature.data[35], 35) + << "incorrect value for signature.data[35], expected 35, is " + << last_msg_->signature.data[35]; + EXPECT_EQ(last_msg_->signature.data[36], 36) + << "incorrect value for signature.data[36], expected 36, is " + << last_msg_->signature.data[36]; + EXPECT_EQ(last_msg_->signature.data[37], 37) + << "incorrect value for signature.data[37], expected 37, is " + << last_msg_->signature.data[37]; + EXPECT_EQ(last_msg_->signature.data[38], 38) + << "incorrect value for signature.data[38], expected 38, is " + << last_msg_->signature.data[38]; + EXPECT_EQ(last_msg_->signature.data[39], 39) + << "incorrect value for signature.data[39], expected 39, is " + << last_msg_->signature.data[39]; + EXPECT_EQ(last_msg_->signature.data[40], 40) + << "incorrect value for signature.data[40], expected 40, is " + << last_msg_->signature.data[40]; + EXPECT_EQ(last_msg_->signature.data[41], 41) + << "incorrect value for signature.data[41], expected 41, is " + << last_msg_->signature.data[41]; + EXPECT_EQ(last_msg_->signature.data[42], 42) + << "incorrect value for signature.data[42], expected 42, is " + << last_msg_->signature.data[42]; + EXPECT_EQ(last_msg_->signature.data[43], 43) + << "incorrect value for signature.data[43], expected 43, is " + << last_msg_->signature.data[43]; + EXPECT_EQ(last_msg_->signature.data[44], 44) + << "incorrect value for signature.data[44], expected 44, is " + << last_msg_->signature.data[44]; + EXPECT_EQ(last_msg_->signature.data[45], 45) + << "incorrect value for signature.data[45], expected 45, is " + << last_msg_->signature.data[45]; + EXPECT_EQ(last_msg_->signature.data[46], 46) + << "incorrect value for signature.data[46], expected 46, is " + << last_msg_->signature.data[46]; + EXPECT_EQ(last_msg_->signature.data[47], 47) + << "incorrect value for signature.data[47], expected 47, is " + << last_msg_->signature.data[47]; + EXPECT_EQ(last_msg_->signature.data[48], 48) + << "incorrect value for signature.data[48], expected 48, is " + << last_msg_->signature.data[48]; + EXPECT_EQ(last_msg_->signature.data[49], 49) + << "incorrect value for signature.data[49], expected 49, is " + << last_msg_->signature.data[49]; + EXPECT_EQ(last_msg_->signature.data[50], 50) + << "incorrect value for signature.data[50], expected 50, is " + << last_msg_->signature.data[50]; + EXPECT_EQ(last_msg_->signature.data[51], 51) + << "incorrect value for signature.data[51], expected 51, is " + << last_msg_->signature.data[51]; + EXPECT_EQ(last_msg_->signature.data[52], 52) + << "incorrect value for signature.data[52], expected 52, is " + << last_msg_->signature.data[52]; + EXPECT_EQ(last_msg_->signature.data[53], 53) + << "incorrect value for signature.data[53], expected 53, is " + << last_msg_->signature.data[53]; + EXPECT_EQ(last_msg_->signature.data[54], 54) + << "incorrect value for signature.data[54], expected 54, is " + << last_msg_->signature.data[54]; + EXPECT_EQ(last_msg_->signature.data[55], 55) + << "incorrect value for signature.data[55], expected 55, is " + << last_msg_->signature.data[55]; + EXPECT_EQ(last_msg_->signature.data[56], 56) + << "incorrect value for signature.data[56], expected 56, is " + << last_msg_->signature.data[56]; + EXPECT_EQ(last_msg_->signature.data[57], 57) + << "incorrect value for signature.data[57], expected 57, is " + << last_msg_->signature.data[57]; + EXPECT_EQ(last_msg_->signature.data[58], 58) + << "incorrect value for signature.data[58], expected 58, is " + << last_msg_->signature.data[58]; + EXPECT_EQ(last_msg_->signature.data[59], 59) + << "incorrect value for signature.data[59], expected 59, is " + << last_msg_->signature.data[59]; + EXPECT_EQ(last_msg_->signature.data[60], 60) + << "incorrect value for signature.data[60], expected 60, is " + << last_msg_->signature.data[60]; + EXPECT_EQ(last_msg_->signature.data[61], 61) + << "incorrect value for signature.data[61], expected 61, is " + << last_msg_->signature.data[61]; + EXPECT_EQ(last_msg_->signature.data[62], 62) + << "incorrect value for signature.data[62], expected 62, is " + << last_msg_->signature.data[62]; + EXPECT_EQ(last_msg_->signature.data[63], 63) + << "incorrect value for signature.data[63], expected 63, is " + << last_msg_->signature.data[63]; + EXPECT_EQ(last_msg_->signature.data[64], 64) + << "incorrect value for signature.data[64], expected 64, is " + << last_msg_->signature.data[64]; + EXPECT_EQ(last_msg_->signature.data[65], 65) + << "incorrect value for signature.data[65], expected 65, is " + << last_msg_->signature.data[65]; + EXPECT_EQ(last_msg_->signature.data[66], 66) + << "incorrect value for signature.data[66], expected 66, is " + << last_msg_->signature.data[66]; + EXPECT_EQ(last_msg_->signature.data[67], 67) + << "incorrect value for signature.data[67], expected 67, is " + << last_msg_->signature.data[67]; + EXPECT_EQ(last_msg_->signature.data[68], 68) + << "incorrect value for signature.data[68], expected 68, is " + << last_msg_->signature.data[68]; + EXPECT_EQ(last_msg_->signature.data[69], 69) + << "incorrect value for signature.data[69], expected 69, is " + << last_msg_->signature.data[69]; + EXPECT_EQ(last_msg_->signature.data[70], 70) + << "incorrect value for signature.data[70], expected 70, is " + << last_msg_->signature.data[70]; + EXPECT_EQ(last_msg_->signature.data[71], 71) + << "incorrect value for signature.data[71], expected 71, is " + << last_msg_->signature.data[71]; + EXPECT_EQ(last_msg_->signature.len, 72) + << "incorrect value for signature.len, expected 72, is " + << last_msg_->signature.len; } diff --git a/c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc b/c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc index 9855036d3..17ccad8bb 100644 --- a/c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc +++ b/c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_signing_MsgCertificateChainDep0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_signing_MsgCertificateChainDep0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_signing_MsgCertificateChainDep0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_signing_MsgCertificateChainDep0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_certificate_chain_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_certificate_chain_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,791 +82,1122 @@ class Test_legacy_auto_check_sbp_signing_MsgCertificateChainDep0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_certificate_chain_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_signing_MsgCertificateChainDep0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_signing_MsgCertificateChainDep0, Test) { + uint8_t encoded_frame[] = { + 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 232, 7, 3, 30, 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_certificate_chain_dep_t *test_msg = + (msg_certificate_chain_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[0] = 20; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[1] = 21; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[2] = 22; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[3] = 23; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[4] = 24; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[5] = 25; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[6] = 26; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[7] = 27; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[8] = 28; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[9] = 29; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[10] = 10; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[11] = 11; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[12] = 12; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[13] = 13; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[14] = 14; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[15] = 15; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[16] = 16; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[17] = 17; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[18] = 18; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[19] = 19; + test_msg->expiration.day = 30; + test_msg->expiration.hours = 12; + test_msg->expiration.minutes = 34; + test_msg->expiration.month = 3; + test_msg->expiration.ns = 123456789; + test_msg->expiration.seconds = 59; + test_msg->expiration.year = 2024; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[0] = 10; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[1] = 11; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[2] = 12; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[3] = 13; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[4] = 14; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[5] = 15; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[6] = 16; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[7] = 17; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[8] = 18; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[9] = 19; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[10] = 0; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[11] = 1; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[12] = 2; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[13] = 3; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[14] = 4; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[15] = 5; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[16] = 6; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[17] = 7; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[18] = 8; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[19] = 9; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[0] = 0; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[1] = 1; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[2] = 2; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[3] = 3; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[4] = 4; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[5] = 5; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[6] = 6; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[7] = 7; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[8] = 8; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[9] = 9; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[10] = 10; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[11] = 11; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[12] = 12; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[13] = 13; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[14] = 14; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[15] = 15; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[16] = 16; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[17] = 17; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[18] = 18; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[19] = 19; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[0] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[1] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[2] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[3] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[4] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[5] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[6] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[7] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[8] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[9] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[10] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[11] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[12] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[13] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[14] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[15] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[16] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[17] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[18] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[19] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[20] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[21] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[22] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[23] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[24] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[25] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[26] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[27] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[28] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[29] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[30] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[31] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[32] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[33] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[34] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[35] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[36] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[37] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[38] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[39] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[40] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[41] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[42] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[43] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[44] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[45] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[46] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[47] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[48] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[49] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[50] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[51] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[52] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[53] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[54] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[55] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[56] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[57] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[58] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[59] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[60] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[61] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[62] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[63] = 7; - uint8_t encoded_frame[] = {85,5,12,66,0,135,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,10,11,12,13,14,15,16,17,18,19,0,1,2,3,4,5,6,7,8,9,20,21,22,23,24,25,26,27,28,29,10,11,12,13,14,15,16,17,18,19,232,7,3,30,12,34,59,21,205,91,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,112,100, }; + EXPECT_EQ(send_message(0xC05, 66, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_certificate_chain_dep_t* test_msg = ( msg_certificate_chain_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[0] = 20; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[1] = 21; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[2] = 22; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[3] = 23; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[4] = 24; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[5] = 25; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[6] = 26; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[7] = 27; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[8] = 28; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[9] = 29; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[10] = 10; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[11] = 11; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[12] = 12; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[13] = 13; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[14] = 14; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[15] = 15; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[16] = 16; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[17] = 17; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[18] = 18; - if (sizeof(test_msg->corrections_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); - } - test_msg->corrections_certificate[19] = 19; - test_msg->expiration.day = 30; - test_msg->expiration.hours = 12; - test_msg->expiration.minutes = 34; - test_msg->expiration.month = 3; - test_msg->expiration.ns = 123456789; - test_msg->expiration.seconds = 59; - test_msg->expiration.year = 2024; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[0] = 10; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[1] = 11; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[2] = 12; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[3] = 13; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[4] = 14; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[5] = 15; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[6] = 16; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[7] = 17; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[8] = 18; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[9] = 19; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[10] = 0; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[11] = 1; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[12] = 2; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[13] = 3; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[14] = 4; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[15] = 5; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[16] = 6; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[17] = 7; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[18] = 8; - if (sizeof(test_msg->intermediate_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); - } - test_msg->intermediate_certificate[19] = 9; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[0] = 0; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[1] = 1; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[2] = 2; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[3] = 3; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[4] = 4; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[5] = 5; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[6] = 6; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[7] = 7; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[8] = 8; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[9] = 9; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[10] = 10; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[11] = 11; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[12] = 12; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[13] = 13; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[14] = 14; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[15] = 15; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[16] = 16; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[17] = 17; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[18] = 18; - if (sizeof(test_msg->root_certificate) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); - } - test_msg->root_certificate[19] = 19; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[0] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[1] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[2] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[3] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[4] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[5] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[6] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[7] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[8] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[9] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[10] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[11] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[12] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[13] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[14] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[15] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[16] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[17] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[18] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[19] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[20] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[21] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[22] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[23] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[24] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[25] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[26] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[27] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[28] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[29] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[30] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[31] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[32] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[33] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[34] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[35] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[36] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[37] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[38] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[39] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[40] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[41] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[42] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[43] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[44] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[45] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[46] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[47] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[48] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[49] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[50] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[51] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[52] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[53] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[54] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[55] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[56] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[57] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[58] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[59] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[60] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[61] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[62] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[63] = 7; - - EXPECT_EQ(send_message( 0xC05, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->corrections_certificate[0], 20) << "incorrect value for corrections_certificate[0], expected 20, is " << last_msg_->corrections_certificate[0]; - EXPECT_EQ(last_msg_->corrections_certificate[1], 21) << "incorrect value for corrections_certificate[1], expected 21, is " << last_msg_->corrections_certificate[1]; - EXPECT_EQ(last_msg_->corrections_certificate[2], 22) << "incorrect value for corrections_certificate[2], expected 22, is " << last_msg_->corrections_certificate[2]; - EXPECT_EQ(last_msg_->corrections_certificate[3], 23) << "incorrect value for corrections_certificate[3], expected 23, is " << last_msg_->corrections_certificate[3]; - EXPECT_EQ(last_msg_->corrections_certificate[4], 24) << "incorrect value for corrections_certificate[4], expected 24, is " << last_msg_->corrections_certificate[4]; - EXPECT_EQ(last_msg_->corrections_certificate[5], 25) << "incorrect value for corrections_certificate[5], expected 25, is " << last_msg_->corrections_certificate[5]; - EXPECT_EQ(last_msg_->corrections_certificate[6], 26) << "incorrect value for corrections_certificate[6], expected 26, is " << last_msg_->corrections_certificate[6]; - EXPECT_EQ(last_msg_->corrections_certificate[7], 27) << "incorrect value for corrections_certificate[7], expected 27, is " << last_msg_->corrections_certificate[7]; - EXPECT_EQ(last_msg_->corrections_certificate[8], 28) << "incorrect value for corrections_certificate[8], expected 28, is " << last_msg_->corrections_certificate[8]; - EXPECT_EQ(last_msg_->corrections_certificate[9], 29) << "incorrect value for corrections_certificate[9], expected 29, is " << last_msg_->corrections_certificate[9]; - EXPECT_EQ(last_msg_->corrections_certificate[10], 10) << "incorrect value for corrections_certificate[10], expected 10, is " << last_msg_->corrections_certificate[10]; - EXPECT_EQ(last_msg_->corrections_certificate[11], 11) << "incorrect value for corrections_certificate[11], expected 11, is " << last_msg_->corrections_certificate[11]; - EXPECT_EQ(last_msg_->corrections_certificate[12], 12) << "incorrect value for corrections_certificate[12], expected 12, is " << last_msg_->corrections_certificate[12]; - EXPECT_EQ(last_msg_->corrections_certificate[13], 13) << "incorrect value for corrections_certificate[13], expected 13, is " << last_msg_->corrections_certificate[13]; - EXPECT_EQ(last_msg_->corrections_certificate[14], 14) << "incorrect value for corrections_certificate[14], expected 14, is " << last_msg_->corrections_certificate[14]; - EXPECT_EQ(last_msg_->corrections_certificate[15], 15) << "incorrect value for corrections_certificate[15], expected 15, is " << last_msg_->corrections_certificate[15]; - EXPECT_EQ(last_msg_->corrections_certificate[16], 16) << "incorrect value for corrections_certificate[16], expected 16, is " << last_msg_->corrections_certificate[16]; - EXPECT_EQ(last_msg_->corrections_certificate[17], 17) << "incorrect value for corrections_certificate[17], expected 17, is " << last_msg_->corrections_certificate[17]; - EXPECT_EQ(last_msg_->corrections_certificate[18], 18) << "incorrect value for corrections_certificate[18], expected 18, is " << last_msg_->corrections_certificate[18]; - EXPECT_EQ(last_msg_->corrections_certificate[19], 19) << "incorrect value for corrections_certificate[19], expected 19, is " << last_msg_->corrections_certificate[19]; - EXPECT_EQ(last_msg_->expiration.day, 30) << "incorrect value for expiration.day, expected 30, is " << last_msg_->expiration.day; - EXPECT_EQ(last_msg_->expiration.hours, 12) << "incorrect value for expiration.hours, expected 12, is " << last_msg_->expiration.hours; - EXPECT_EQ(last_msg_->expiration.minutes, 34) << "incorrect value for expiration.minutes, expected 34, is " << last_msg_->expiration.minutes; - EXPECT_EQ(last_msg_->expiration.month, 3) << "incorrect value for expiration.month, expected 3, is " << last_msg_->expiration.month; - EXPECT_EQ(last_msg_->expiration.ns, 123456789) << "incorrect value for expiration.ns, expected 123456789, is " << last_msg_->expiration.ns; - EXPECT_EQ(last_msg_->expiration.seconds, 59) << "incorrect value for expiration.seconds, expected 59, is " << last_msg_->expiration.seconds; - EXPECT_EQ(last_msg_->expiration.year, 2024) << "incorrect value for expiration.year, expected 2024, is " << last_msg_->expiration.year; - EXPECT_EQ(last_msg_->intermediate_certificate[0], 10) << "incorrect value for intermediate_certificate[0], expected 10, is " << last_msg_->intermediate_certificate[0]; - EXPECT_EQ(last_msg_->intermediate_certificate[1], 11) << "incorrect value for intermediate_certificate[1], expected 11, is " << last_msg_->intermediate_certificate[1]; - EXPECT_EQ(last_msg_->intermediate_certificate[2], 12) << "incorrect value for intermediate_certificate[2], expected 12, is " << last_msg_->intermediate_certificate[2]; - EXPECT_EQ(last_msg_->intermediate_certificate[3], 13) << "incorrect value for intermediate_certificate[3], expected 13, is " << last_msg_->intermediate_certificate[3]; - EXPECT_EQ(last_msg_->intermediate_certificate[4], 14) << "incorrect value for intermediate_certificate[4], expected 14, is " << last_msg_->intermediate_certificate[4]; - EXPECT_EQ(last_msg_->intermediate_certificate[5], 15) << "incorrect value for intermediate_certificate[5], expected 15, is " << last_msg_->intermediate_certificate[5]; - EXPECT_EQ(last_msg_->intermediate_certificate[6], 16) << "incorrect value for intermediate_certificate[6], expected 16, is " << last_msg_->intermediate_certificate[6]; - EXPECT_EQ(last_msg_->intermediate_certificate[7], 17) << "incorrect value for intermediate_certificate[7], expected 17, is " << last_msg_->intermediate_certificate[7]; - EXPECT_EQ(last_msg_->intermediate_certificate[8], 18) << "incorrect value for intermediate_certificate[8], expected 18, is " << last_msg_->intermediate_certificate[8]; - EXPECT_EQ(last_msg_->intermediate_certificate[9], 19) << "incorrect value for intermediate_certificate[9], expected 19, is " << last_msg_->intermediate_certificate[9]; - EXPECT_EQ(last_msg_->intermediate_certificate[10], 0) << "incorrect value for intermediate_certificate[10], expected 0, is " << last_msg_->intermediate_certificate[10]; - EXPECT_EQ(last_msg_->intermediate_certificate[11], 1) << "incorrect value for intermediate_certificate[11], expected 1, is " << last_msg_->intermediate_certificate[11]; - EXPECT_EQ(last_msg_->intermediate_certificate[12], 2) << "incorrect value for intermediate_certificate[12], expected 2, is " << last_msg_->intermediate_certificate[12]; - EXPECT_EQ(last_msg_->intermediate_certificate[13], 3) << "incorrect value for intermediate_certificate[13], expected 3, is " << last_msg_->intermediate_certificate[13]; - EXPECT_EQ(last_msg_->intermediate_certificate[14], 4) << "incorrect value for intermediate_certificate[14], expected 4, is " << last_msg_->intermediate_certificate[14]; - EXPECT_EQ(last_msg_->intermediate_certificate[15], 5) << "incorrect value for intermediate_certificate[15], expected 5, is " << last_msg_->intermediate_certificate[15]; - EXPECT_EQ(last_msg_->intermediate_certificate[16], 6) << "incorrect value for intermediate_certificate[16], expected 6, is " << last_msg_->intermediate_certificate[16]; - EXPECT_EQ(last_msg_->intermediate_certificate[17], 7) << "incorrect value for intermediate_certificate[17], expected 7, is " << last_msg_->intermediate_certificate[17]; - EXPECT_EQ(last_msg_->intermediate_certificate[18], 8) << "incorrect value for intermediate_certificate[18], expected 8, is " << last_msg_->intermediate_certificate[18]; - EXPECT_EQ(last_msg_->intermediate_certificate[19], 9) << "incorrect value for intermediate_certificate[19], expected 9, is " << last_msg_->intermediate_certificate[19]; - EXPECT_EQ(last_msg_->root_certificate[0], 0) << "incorrect value for root_certificate[0], expected 0, is " << last_msg_->root_certificate[0]; - EXPECT_EQ(last_msg_->root_certificate[1], 1) << "incorrect value for root_certificate[1], expected 1, is " << last_msg_->root_certificate[1]; - EXPECT_EQ(last_msg_->root_certificate[2], 2) << "incorrect value for root_certificate[2], expected 2, is " << last_msg_->root_certificate[2]; - EXPECT_EQ(last_msg_->root_certificate[3], 3) << "incorrect value for root_certificate[3], expected 3, is " << last_msg_->root_certificate[3]; - EXPECT_EQ(last_msg_->root_certificate[4], 4) << "incorrect value for root_certificate[4], expected 4, is " << last_msg_->root_certificate[4]; - EXPECT_EQ(last_msg_->root_certificate[5], 5) << "incorrect value for root_certificate[5], expected 5, is " << last_msg_->root_certificate[5]; - EXPECT_EQ(last_msg_->root_certificate[6], 6) << "incorrect value for root_certificate[6], expected 6, is " << last_msg_->root_certificate[6]; - EXPECT_EQ(last_msg_->root_certificate[7], 7) << "incorrect value for root_certificate[7], expected 7, is " << last_msg_->root_certificate[7]; - EXPECT_EQ(last_msg_->root_certificate[8], 8) << "incorrect value for root_certificate[8], expected 8, is " << last_msg_->root_certificate[8]; - EXPECT_EQ(last_msg_->root_certificate[9], 9) << "incorrect value for root_certificate[9], expected 9, is " << last_msg_->root_certificate[9]; - EXPECT_EQ(last_msg_->root_certificate[10], 10) << "incorrect value for root_certificate[10], expected 10, is " << last_msg_->root_certificate[10]; - EXPECT_EQ(last_msg_->root_certificate[11], 11) << "incorrect value for root_certificate[11], expected 11, is " << last_msg_->root_certificate[11]; - EXPECT_EQ(last_msg_->root_certificate[12], 12) << "incorrect value for root_certificate[12], expected 12, is " << last_msg_->root_certificate[12]; - EXPECT_EQ(last_msg_->root_certificate[13], 13) << "incorrect value for root_certificate[13], expected 13, is " << last_msg_->root_certificate[13]; - EXPECT_EQ(last_msg_->root_certificate[14], 14) << "incorrect value for root_certificate[14], expected 14, is " << last_msg_->root_certificate[14]; - EXPECT_EQ(last_msg_->root_certificate[15], 15) << "incorrect value for root_certificate[15], expected 15, is " << last_msg_->root_certificate[15]; - EXPECT_EQ(last_msg_->root_certificate[16], 16) << "incorrect value for root_certificate[16], expected 16, is " << last_msg_->root_certificate[16]; - EXPECT_EQ(last_msg_->root_certificate[17], 17) << "incorrect value for root_certificate[17], expected 17, is " << last_msg_->root_certificate[17]; - EXPECT_EQ(last_msg_->root_certificate[18], 18) << "incorrect value for root_certificate[18], expected 18, is " << last_msg_->root_certificate[18]; - EXPECT_EQ(last_msg_->root_certificate[19], 19) << "incorrect value for root_certificate[19], expected 19, is " << last_msg_->root_certificate[19]; - EXPECT_EQ(last_msg_->signature[0], 0) << "incorrect value for signature[0], expected 0, is " << last_msg_->signature[0]; - EXPECT_EQ(last_msg_->signature[1], 1) << "incorrect value for signature[1], expected 1, is " << last_msg_->signature[1]; - EXPECT_EQ(last_msg_->signature[2], 2) << "incorrect value for signature[2], expected 2, is " << last_msg_->signature[2]; - EXPECT_EQ(last_msg_->signature[3], 3) << "incorrect value for signature[3], expected 3, is " << last_msg_->signature[3]; - EXPECT_EQ(last_msg_->signature[4], 4) << "incorrect value for signature[4], expected 4, is " << last_msg_->signature[4]; - EXPECT_EQ(last_msg_->signature[5], 5) << "incorrect value for signature[5], expected 5, is " << last_msg_->signature[5]; - EXPECT_EQ(last_msg_->signature[6], 6) << "incorrect value for signature[6], expected 6, is " << last_msg_->signature[6]; - EXPECT_EQ(last_msg_->signature[7], 7) << "incorrect value for signature[7], expected 7, is " << last_msg_->signature[7]; - EXPECT_EQ(last_msg_->signature[8], 0) << "incorrect value for signature[8], expected 0, is " << last_msg_->signature[8]; - EXPECT_EQ(last_msg_->signature[9], 1) << "incorrect value for signature[9], expected 1, is " << last_msg_->signature[9]; - EXPECT_EQ(last_msg_->signature[10], 2) << "incorrect value for signature[10], expected 2, is " << last_msg_->signature[10]; - EXPECT_EQ(last_msg_->signature[11], 3) << "incorrect value for signature[11], expected 3, is " << last_msg_->signature[11]; - EXPECT_EQ(last_msg_->signature[12], 4) << "incorrect value for signature[12], expected 4, is " << last_msg_->signature[12]; - EXPECT_EQ(last_msg_->signature[13], 5) << "incorrect value for signature[13], expected 5, is " << last_msg_->signature[13]; - EXPECT_EQ(last_msg_->signature[14], 6) << "incorrect value for signature[14], expected 6, is " << last_msg_->signature[14]; - EXPECT_EQ(last_msg_->signature[15], 7) << "incorrect value for signature[15], expected 7, is " << last_msg_->signature[15]; - EXPECT_EQ(last_msg_->signature[16], 0) << "incorrect value for signature[16], expected 0, is " << last_msg_->signature[16]; - EXPECT_EQ(last_msg_->signature[17], 1) << "incorrect value for signature[17], expected 1, is " << last_msg_->signature[17]; - EXPECT_EQ(last_msg_->signature[18], 2) << "incorrect value for signature[18], expected 2, is " << last_msg_->signature[18]; - EXPECT_EQ(last_msg_->signature[19], 3) << "incorrect value for signature[19], expected 3, is " << last_msg_->signature[19]; - EXPECT_EQ(last_msg_->signature[20], 4) << "incorrect value for signature[20], expected 4, is " << last_msg_->signature[20]; - EXPECT_EQ(last_msg_->signature[21], 5) << "incorrect value for signature[21], expected 5, is " << last_msg_->signature[21]; - EXPECT_EQ(last_msg_->signature[22], 6) << "incorrect value for signature[22], expected 6, is " << last_msg_->signature[22]; - EXPECT_EQ(last_msg_->signature[23], 7) << "incorrect value for signature[23], expected 7, is " << last_msg_->signature[23]; - EXPECT_EQ(last_msg_->signature[24], 0) << "incorrect value for signature[24], expected 0, is " << last_msg_->signature[24]; - EXPECT_EQ(last_msg_->signature[25], 1) << "incorrect value for signature[25], expected 1, is " << last_msg_->signature[25]; - EXPECT_EQ(last_msg_->signature[26], 2) << "incorrect value for signature[26], expected 2, is " << last_msg_->signature[26]; - EXPECT_EQ(last_msg_->signature[27], 3) << "incorrect value for signature[27], expected 3, is " << last_msg_->signature[27]; - EXPECT_EQ(last_msg_->signature[28], 4) << "incorrect value for signature[28], expected 4, is " << last_msg_->signature[28]; - EXPECT_EQ(last_msg_->signature[29], 5) << "incorrect value for signature[29], expected 5, is " << last_msg_->signature[29]; - EXPECT_EQ(last_msg_->signature[30], 6) << "incorrect value for signature[30], expected 6, is " << last_msg_->signature[30]; - EXPECT_EQ(last_msg_->signature[31], 7) << "incorrect value for signature[31], expected 7, is " << last_msg_->signature[31]; - EXPECT_EQ(last_msg_->signature[32], 0) << "incorrect value for signature[32], expected 0, is " << last_msg_->signature[32]; - EXPECT_EQ(last_msg_->signature[33], 1) << "incorrect value for signature[33], expected 1, is " << last_msg_->signature[33]; - EXPECT_EQ(last_msg_->signature[34], 2) << "incorrect value for signature[34], expected 2, is " << last_msg_->signature[34]; - EXPECT_EQ(last_msg_->signature[35], 3) << "incorrect value for signature[35], expected 3, is " << last_msg_->signature[35]; - EXPECT_EQ(last_msg_->signature[36], 4) << "incorrect value for signature[36], expected 4, is " << last_msg_->signature[36]; - EXPECT_EQ(last_msg_->signature[37], 5) << "incorrect value for signature[37], expected 5, is " << last_msg_->signature[37]; - EXPECT_EQ(last_msg_->signature[38], 6) << "incorrect value for signature[38], expected 6, is " << last_msg_->signature[38]; - EXPECT_EQ(last_msg_->signature[39], 7) << "incorrect value for signature[39], expected 7, is " << last_msg_->signature[39]; - EXPECT_EQ(last_msg_->signature[40], 0) << "incorrect value for signature[40], expected 0, is " << last_msg_->signature[40]; - EXPECT_EQ(last_msg_->signature[41], 1) << "incorrect value for signature[41], expected 1, is " << last_msg_->signature[41]; - EXPECT_EQ(last_msg_->signature[42], 2) << "incorrect value for signature[42], expected 2, is " << last_msg_->signature[42]; - EXPECT_EQ(last_msg_->signature[43], 3) << "incorrect value for signature[43], expected 3, is " << last_msg_->signature[43]; - EXPECT_EQ(last_msg_->signature[44], 4) << "incorrect value for signature[44], expected 4, is " << last_msg_->signature[44]; - EXPECT_EQ(last_msg_->signature[45], 5) << "incorrect value for signature[45], expected 5, is " << last_msg_->signature[45]; - EXPECT_EQ(last_msg_->signature[46], 6) << "incorrect value for signature[46], expected 6, is " << last_msg_->signature[46]; - EXPECT_EQ(last_msg_->signature[47], 7) << "incorrect value for signature[47], expected 7, is " << last_msg_->signature[47]; - EXPECT_EQ(last_msg_->signature[48], 0) << "incorrect value for signature[48], expected 0, is " << last_msg_->signature[48]; - EXPECT_EQ(last_msg_->signature[49], 1) << "incorrect value for signature[49], expected 1, is " << last_msg_->signature[49]; - EXPECT_EQ(last_msg_->signature[50], 2) << "incorrect value for signature[50], expected 2, is " << last_msg_->signature[50]; - EXPECT_EQ(last_msg_->signature[51], 3) << "incorrect value for signature[51], expected 3, is " << last_msg_->signature[51]; - EXPECT_EQ(last_msg_->signature[52], 4) << "incorrect value for signature[52], expected 4, is " << last_msg_->signature[52]; - EXPECT_EQ(last_msg_->signature[53], 5) << "incorrect value for signature[53], expected 5, is " << last_msg_->signature[53]; - EXPECT_EQ(last_msg_->signature[54], 6) << "incorrect value for signature[54], expected 6, is " << last_msg_->signature[54]; - EXPECT_EQ(last_msg_->signature[55], 7) << "incorrect value for signature[55], expected 7, is " << last_msg_->signature[55]; - EXPECT_EQ(last_msg_->signature[56], 0) << "incorrect value for signature[56], expected 0, is " << last_msg_->signature[56]; - EXPECT_EQ(last_msg_->signature[57], 1) << "incorrect value for signature[57], expected 1, is " << last_msg_->signature[57]; - EXPECT_EQ(last_msg_->signature[58], 2) << "incorrect value for signature[58], expected 2, is " << last_msg_->signature[58]; - EXPECT_EQ(last_msg_->signature[59], 3) << "incorrect value for signature[59], expected 3, is " << last_msg_->signature[59]; - EXPECT_EQ(last_msg_->signature[60], 4) << "incorrect value for signature[60], expected 4, is " << last_msg_->signature[60]; - EXPECT_EQ(last_msg_->signature[61], 5) << "incorrect value for signature[61], expected 5, is " << last_msg_->signature[61]; - EXPECT_EQ(last_msg_->signature[62], 6) << "incorrect value for signature[62], expected 6, is " << last_msg_->signature[62]; - EXPECT_EQ(last_msg_->signature[63], 7) << "incorrect value for signature[63], expected 7, is " << last_msg_->signature[63]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->corrections_certificate[0], 20) + << "incorrect value for corrections_certificate[0], expected 20, is " + << last_msg_->corrections_certificate[0]; + EXPECT_EQ(last_msg_->corrections_certificate[1], 21) + << "incorrect value for corrections_certificate[1], expected 21, is " + << last_msg_->corrections_certificate[1]; + EXPECT_EQ(last_msg_->corrections_certificate[2], 22) + << "incorrect value for corrections_certificate[2], expected 22, is " + << last_msg_->corrections_certificate[2]; + EXPECT_EQ(last_msg_->corrections_certificate[3], 23) + << "incorrect value for corrections_certificate[3], expected 23, is " + << last_msg_->corrections_certificate[3]; + EXPECT_EQ(last_msg_->corrections_certificate[4], 24) + << "incorrect value for corrections_certificate[4], expected 24, is " + << last_msg_->corrections_certificate[4]; + EXPECT_EQ(last_msg_->corrections_certificate[5], 25) + << "incorrect value for corrections_certificate[5], expected 25, is " + << last_msg_->corrections_certificate[5]; + EXPECT_EQ(last_msg_->corrections_certificate[6], 26) + << "incorrect value for corrections_certificate[6], expected 26, is " + << last_msg_->corrections_certificate[6]; + EXPECT_EQ(last_msg_->corrections_certificate[7], 27) + << "incorrect value for corrections_certificate[7], expected 27, is " + << last_msg_->corrections_certificate[7]; + EXPECT_EQ(last_msg_->corrections_certificate[8], 28) + << "incorrect value for corrections_certificate[8], expected 28, is " + << last_msg_->corrections_certificate[8]; + EXPECT_EQ(last_msg_->corrections_certificate[9], 29) + << "incorrect value for corrections_certificate[9], expected 29, is " + << last_msg_->corrections_certificate[9]; + EXPECT_EQ(last_msg_->corrections_certificate[10], 10) + << "incorrect value for corrections_certificate[10], expected 10, is " + << last_msg_->corrections_certificate[10]; + EXPECT_EQ(last_msg_->corrections_certificate[11], 11) + << "incorrect value for corrections_certificate[11], expected 11, is " + << last_msg_->corrections_certificate[11]; + EXPECT_EQ(last_msg_->corrections_certificate[12], 12) + << "incorrect value for corrections_certificate[12], expected 12, is " + << last_msg_->corrections_certificate[12]; + EXPECT_EQ(last_msg_->corrections_certificate[13], 13) + << "incorrect value for corrections_certificate[13], expected 13, is " + << last_msg_->corrections_certificate[13]; + EXPECT_EQ(last_msg_->corrections_certificate[14], 14) + << "incorrect value for corrections_certificate[14], expected 14, is " + << last_msg_->corrections_certificate[14]; + EXPECT_EQ(last_msg_->corrections_certificate[15], 15) + << "incorrect value for corrections_certificate[15], expected 15, is " + << last_msg_->corrections_certificate[15]; + EXPECT_EQ(last_msg_->corrections_certificate[16], 16) + << "incorrect value for corrections_certificate[16], expected 16, is " + << last_msg_->corrections_certificate[16]; + EXPECT_EQ(last_msg_->corrections_certificate[17], 17) + << "incorrect value for corrections_certificate[17], expected 17, is " + << last_msg_->corrections_certificate[17]; + EXPECT_EQ(last_msg_->corrections_certificate[18], 18) + << "incorrect value for corrections_certificate[18], expected 18, is " + << last_msg_->corrections_certificate[18]; + EXPECT_EQ(last_msg_->corrections_certificate[19], 19) + << "incorrect value for corrections_certificate[19], expected 19, is " + << last_msg_->corrections_certificate[19]; + EXPECT_EQ(last_msg_->expiration.day, 30) + << "incorrect value for expiration.day, expected 30, is " + << last_msg_->expiration.day; + EXPECT_EQ(last_msg_->expiration.hours, 12) + << "incorrect value for expiration.hours, expected 12, is " + << last_msg_->expiration.hours; + EXPECT_EQ(last_msg_->expiration.minutes, 34) + << "incorrect value for expiration.minutes, expected 34, is " + << last_msg_->expiration.minutes; + EXPECT_EQ(last_msg_->expiration.month, 3) + << "incorrect value for expiration.month, expected 3, is " + << last_msg_->expiration.month; + EXPECT_EQ(last_msg_->expiration.ns, 123456789) + << "incorrect value for expiration.ns, expected 123456789, is " + << last_msg_->expiration.ns; + EXPECT_EQ(last_msg_->expiration.seconds, 59) + << "incorrect value for expiration.seconds, expected 59, is " + << last_msg_->expiration.seconds; + EXPECT_EQ(last_msg_->expiration.year, 2024) + << "incorrect value for expiration.year, expected 2024, is " + << last_msg_->expiration.year; + EXPECT_EQ(last_msg_->intermediate_certificate[0], 10) + << "incorrect value for intermediate_certificate[0], expected 10, is " + << last_msg_->intermediate_certificate[0]; + EXPECT_EQ(last_msg_->intermediate_certificate[1], 11) + << "incorrect value for intermediate_certificate[1], expected 11, is " + << last_msg_->intermediate_certificate[1]; + EXPECT_EQ(last_msg_->intermediate_certificate[2], 12) + << "incorrect value for intermediate_certificate[2], expected 12, is " + << last_msg_->intermediate_certificate[2]; + EXPECT_EQ(last_msg_->intermediate_certificate[3], 13) + << "incorrect value for intermediate_certificate[3], expected 13, is " + << last_msg_->intermediate_certificate[3]; + EXPECT_EQ(last_msg_->intermediate_certificate[4], 14) + << "incorrect value for intermediate_certificate[4], expected 14, is " + << last_msg_->intermediate_certificate[4]; + EXPECT_EQ(last_msg_->intermediate_certificate[5], 15) + << "incorrect value for intermediate_certificate[5], expected 15, is " + << last_msg_->intermediate_certificate[5]; + EXPECT_EQ(last_msg_->intermediate_certificate[6], 16) + << "incorrect value for intermediate_certificate[6], expected 16, is " + << last_msg_->intermediate_certificate[6]; + EXPECT_EQ(last_msg_->intermediate_certificate[7], 17) + << "incorrect value for intermediate_certificate[7], expected 17, is " + << last_msg_->intermediate_certificate[7]; + EXPECT_EQ(last_msg_->intermediate_certificate[8], 18) + << "incorrect value for intermediate_certificate[8], expected 18, is " + << last_msg_->intermediate_certificate[8]; + EXPECT_EQ(last_msg_->intermediate_certificate[9], 19) + << "incorrect value for intermediate_certificate[9], expected 19, is " + << last_msg_->intermediate_certificate[9]; + EXPECT_EQ(last_msg_->intermediate_certificate[10], 0) + << "incorrect value for intermediate_certificate[10], expected 0, is " + << last_msg_->intermediate_certificate[10]; + EXPECT_EQ(last_msg_->intermediate_certificate[11], 1) + << "incorrect value for intermediate_certificate[11], expected 1, is " + << last_msg_->intermediate_certificate[11]; + EXPECT_EQ(last_msg_->intermediate_certificate[12], 2) + << "incorrect value for intermediate_certificate[12], expected 2, is " + << last_msg_->intermediate_certificate[12]; + EXPECT_EQ(last_msg_->intermediate_certificate[13], 3) + << "incorrect value for intermediate_certificate[13], expected 3, is " + << last_msg_->intermediate_certificate[13]; + EXPECT_EQ(last_msg_->intermediate_certificate[14], 4) + << "incorrect value for intermediate_certificate[14], expected 4, is " + << last_msg_->intermediate_certificate[14]; + EXPECT_EQ(last_msg_->intermediate_certificate[15], 5) + << "incorrect value for intermediate_certificate[15], expected 5, is " + << last_msg_->intermediate_certificate[15]; + EXPECT_EQ(last_msg_->intermediate_certificate[16], 6) + << "incorrect value for intermediate_certificate[16], expected 6, is " + << last_msg_->intermediate_certificate[16]; + EXPECT_EQ(last_msg_->intermediate_certificate[17], 7) + << "incorrect value for intermediate_certificate[17], expected 7, is " + << last_msg_->intermediate_certificate[17]; + EXPECT_EQ(last_msg_->intermediate_certificate[18], 8) + << "incorrect value for intermediate_certificate[18], expected 8, is " + << last_msg_->intermediate_certificate[18]; + EXPECT_EQ(last_msg_->intermediate_certificate[19], 9) + << "incorrect value for intermediate_certificate[19], expected 9, is " + << last_msg_->intermediate_certificate[19]; + EXPECT_EQ(last_msg_->root_certificate[0], 0) + << "incorrect value for root_certificate[0], expected 0, is " + << last_msg_->root_certificate[0]; + EXPECT_EQ(last_msg_->root_certificate[1], 1) + << "incorrect value for root_certificate[1], expected 1, is " + << last_msg_->root_certificate[1]; + EXPECT_EQ(last_msg_->root_certificate[2], 2) + << "incorrect value for root_certificate[2], expected 2, is " + << last_msg_->root_certificate[2]; + EXPECT_EQ(last_msg_->root_certificate[3], 3) + << "incorrect value for root_certificate[3], expected 3, is " + << last_msg_->root_certificate[3]; + EXPECT_EQ(last_msg_->root_certificate[4], 4) + << "incorrect value for root_certificate[4], expected 4, is " + << last_msg_->root_certificate[4]; + EXPECT_EQ(last_msg_->root_certificate[5], 5) + << "incorrect value for root_certificate[5], expected 5, is " + << last_msg_->root_certificate[5]; + EXPECT_EQ(last_msg_->root_certificate[6], 6) + << "incorrect value for root_certificate[6], expected 6, is " + << last_msg_->root_certificate[6]; + EXPECT_EQ(last_msg_->root_certificate[7], 7) + << "incorrect value for root_certificate[7], expected 7, is " + << last_msg_->root_certificate[7]; + EXPECT_EQ(last_msg_->root_certificate[8], 8) + << "incorrect value for root_certificate[8], expected 8, is " + << last_msg_->root_certificate[8]; + EXPECT_EQ(last_msg_->root_certificate[9], 9) + << "incorrect value for root_certificate[9], expected 9, is " + << last_msg_->root_certificate[9]; + EXPECT_EQ(last_msg_->root_certificate[10], 10) + << "incorrect value for root_certificate[10], expected 10, is " + << last_msg_->root_certificate[10]; + EXPECT_EQ(last_msg_->root_certificate[11], 11) + << "incorrect value for root_certificate[11], expected 11, is " + << last_msg_->root_certificate[11]; + EXPECT_EQ(last_msg_->root_certificate[12], 12) + << "incorrect value for root_certificate[12], expected 12, is " + << last_msg_->root_certificate[12]; + EXPECT_EQ(last_msg_->root_certificate[13], 13) + << "incorrect value for root_certificate[13], expected 13, is " + << last_msg_->root_certificate[13]; + EXPECT_EQ(last_msg_->root_certificate[14], 14) + << "incorrect value for root_certificate[14], expected 14, is " + << last_msg_->root_certificate[14]; + EXPECT_EQ(last_msg_->root_certificate[15], 15) + << "incorrect value for root_certificate[15], expected 15, is " + << last_msg_->root_certificate[15]; + EXPECT_EQ(last_msg_->root_certificate[16], 16) + << "incorrect value for root_certificate[16], expected 16, is " + << last_msg_->root_certificate[16]; + EXPECT_EQ(last_msg_->root_certificate[17], 17) + << "incorrect value for root_certificate[17], expected 17, is " + << last_msg_->root_certificate[17]; + EXPECT_EQ(last_msg_->root_certificate[18], 18) + << "incorrect value for root_certificate[18], expected 18, is " + << last_msg_->root_certificate[18]; + EXPECT_EQ(last_msg_->root_certificate[19], 19) + << "incorrect value for root_certificate[19], expected 19, is " + << last_msg_->root_certificate[19]; + EXPECT_EQ(last_msg_->signature[0], 0) + << "incorrect value for signature[0], expected 0, is " + << last_msg_->signature[0]; + EXPECT_EQ(last_msg_->signature[1], 1) + << "incorrect value for signature[1], expected 1, is " + << last_msg_->signature[1]; + EXPECT_EQ(last_msg_->signature[2], 2) + << "incorrect value for signature[2], expected 2, is " + << last_msg_->signature[2]; + EXPECT_EQ(last_msg_->signature[3], 3) + << "incorrect value for signature[3], expected 3, is " + << last_msg_->signature[3]; + EXPECT_EQ(last_msg_->signature[4], 4) + << "incorrect value for signature[4], expected 4, is " + << last_msg_->signature[4]; + EXPECT_EQ(last_msg_->signature[5], 5) + << "incorrect value for signature[5], expected 5, is " + << last_msg_->signature[5]; + EXPECT_EQ(last_msg_->signature[6], 6) + << "incorrect value for signature[6], expected 6, is " + << last_msg_->signature[6]; + EXPECT_EQ(last_msg_->signature[7], 7) + << "incorrect value for signature[7], expected 7, is " + << last_msg_->signature[7]; + EXPECT_EQ(last_msg_->signature[8], 0) + << "incorrect value for signature[8], expected 0, is " + << last_msg_->signature[8]; + EXPECT_EQ(last_msg_->signature[9], 1) + << "incorrect value for signature[9], expected 1, is " + << last_msg_->signature[9]; + EXPECT_EQ(last_msg_->signature[10], 2) + << "incorrect value for signature[10], expected 2, is " + << last_msg_->signature[10]; + EXPECT_EQ(last_msg_->signature[11], 3) + << "incorrect value for signature[11], expected 3, is " + << last_msg_->signature[11]; + EXPECT_EQ(last_msg_->signature[12], 4) + << "incorrect value for signature[12], expected 4, is " + << last_msg_->signature[12]; + EXPECT_EQ(last_msg_->signature[13], 5) + << "incorrect value for signature[13], expected 5, is " + << last_msg_->signature[13]; + EXPECT_EQ(last_msg_->signature[14], 6) + << "incorrect value for signature[14], expected 6, is " + << last_msg_->signature[14]; + EXPECT_EQ(last_msg_->signature[15], 7) + << "incorrect value for signature[15], expected 7, is " + << last_msg_->signature[15]; + EXPECT_EQ(last_msg_->signature[16], 0) + << "incorrect value for signature[16], expected 0, is " + << last_msg_->signature[16]; + EXPECT_EQ(last_msg_->signature[17], 1) + << "incorrect value for signature[17], expected 1, is " + << last_msg_->signature[17]; + EXPECT_EQ(last_msg_->signature[18], 2) + << "incorrect value for signature[18], expected 2, is " + << last_msg_->signature[18]; + EXPECT_EQ(last_msg_->signature[19], 3) + << "incorrect value for signature[19], expected 3, is " + << last_msg_->signature[19]; + EXPECT_EQ(last_msg_->signature[20], 4) + << "incorrect value for signature[20], expected 4, is " + << last_msg_->signature[20]; + EXPECT_EQ(last_msg_->signature[21], 5) + << "incorrect value for signature[21], expected 5, is " + << last_msg_->signature[21]; + EXPECT_EQ(last_msg_->signature[22], 6) + << "incorrect value for signature[22], expected 6, is " + << last_msg_->signature[22]; + EXPECT_EQ(last_msg_->signature[23], 7) + << "incorrect value for signature[23], expected 7, is " + << last_msg_->signature[23]; + EXPECT_EQ(last_msg_->signature[24], 0) + << "incorrect value for signature[24], expected 0, is " + << last_msg_->signature[24]; + EXPECT_EQ(last_msg_->signature[25], 1) + << "incorrect value for signature[25], expected 1, is " + << last_msg_->signature[25]; + EXPECT_EQ(last_msg_->signature[26], 2) + << "incorrect value for signature[26], expected 2, is " + << last_msg_->signature[26]; + EXPECT_EQ(last_msg_->signature[27], 3) + << "incorrect value for signature[27], expected 3, is " + << last_msg_->signature[27]; + EXPECT_EQ(last_msg_->signature[28], 4) + << "incorrect value for signature[28], expected 4, is " + << last_msg_->signature[28]; + EXPECT_EQ(last_msg_->signature[29], 5) + << "incorrect value for signature[29], expected 5, is " + << last_msg_->signature[29]; + EXPECT_EQ(last_msg_->signature[30], 6) + << "incorrect value for signature[30], expected 6, is " + << last_msg_->signature[30]; + EXPECT_EQ(last_msg_->signature[31], 7) + << "incorrect value for signature[31], expected 7, is " + << last_msg_->signature[31]; + EXPECT_EQ(last_msg_->signature[32], 0) + << "incorrect value for signature[32], expected 0, is " + << last_msg_->signature[32]; + EXPECT_EQ(last_msg_->signature[33], 1) + << "incorrect value for signature[33], expected 1, is " + << last_msg_->signature[33]; + EXPECT_EQ(last_msg_->signature[34], 2) + << "incorrect value for signature[34], expected 2, is " + << last_msg_->signature[34]; + EXPECT_EQ(last_msg_->signature[35], 3) + << "incorrect value for signature[35], expected 3, is " + << last_msg_->signature[35]; + EXPECT_EQ(last_msg_->signature[36], 4) + << "incorrect value for signature[36], expected 4, is " + << last_msg_->signature[36]; + EXPECT_EQ(last_msg_->signature[37], 5) + << "incorrect value for signature[37], expected 5, is " + << last_msg_->signature[37]; + EXPECT_EQ(last_msg_->signature[38], 6) + << "incorrect value for signature[38], expected 6, is " + << last_msg_->signature[38]; + EXPECT_EQ(last_msg_->signature[39], 7) + << "incorrect value for signature[39], expected 7, is " + << last_msg_->signature[39]; + EXPECT_EQ(last_msg_->signature[40], 0) + << "incorrect value for signature[40], expected 0, is " + << last_msg_->signature[40]; + EXPECT_EQ(last_msg_->signature[41], 1) + << "incorrect value for signature[41], expected 1, is " + << last_msg_->signature[41]; + EXPECT_EQ(last_msg_->signature[42], 2) + << "incorrect value for signature[42], expected 2, is " + << last_msg_->signature[42]; + EXPECT_EQ(last_msg_->signature[43], 3) + << "incorrect value for signature[43], expected 3, is " + << last_msg_->signature[43]; + EXPECT_EQ(last_msg_->signature[44], 4) + << "incorrect value for signature[44], expected 4, is " + << last_msg_->signature[44]; + EXPECT_EQ(last_msg_->signature[45], 5) + << "incorrect value for signature[45], expected 5, is " + << last_msg_->signature[45]; + EXPECT_EQ(last_msg_->signature[46], 6) + << "incorrect value for signature[46], expected 6, is " + << last_msg_->signature[46]; + EXPECT_EQ(last_msg_->signature[47], 7) + << "incorrect value for signature[47], expected 7, is " + << last_msg_->signature[47]; + EXPECT_EQ(last_msg_->signature[48], 0) + << "incorrect value for signature[48], expected 0, is " + << last_msg_->signature[48]; + EXPECT_EQ(last_msg_->signature[49], 1) + << "incorrect value for signature[49], expected 1, is " + << last_msg_->signature[49]; + EXPECT_EQ(last_msg_->signature[50], 2) + << "incorrect value for signature[50], expected 2, is " + << last_msg_->signature[50]; + EXPECT_EQ(last_msg_->signature[51], 3) + << "incorrect value for signature[51], expected 3, is " + << last_msg_->signature[51]; + EXPECT_EQ(last_msg_->signature[52], 4) + << "incorrect value for signature[52], expected 4, is " + << last_msg_->signature[52]; + EXPECT_EQ(last_msg_->signature[53], 5) + << "incorrect value for signature[53], expected 5, is " + << last_msg_->signature[53]; + EXPECT_EQ(last_msg_->signature[54], 6) + << "incorrect value for signature[54], expected 6, is " + << last_msg_->signature[54]; + EXPECT_EQ(last_msg_->signature[55], 7) + << "incorrect value for signature[55], expected 7, is " + << last_msg_->signature[55]; + EXPECT_EQ(last_msg_->signature[56], 0) + << "incorrect value for signature[56], expected 0, is " + << last_msg_->signature[56]; + EXPECT_EQ(last_msg_->signature[57], 1) + << "incorrect value for signature[57], expected 1, is " + << last_msg_->signature[57]; + EXPECT_EQ(last_msg_->signature[58], 2) + << "incorrect value for signature[58], expected 2, is " + << last_msg_->signature[58]; + EXPECT_EQ(last_msg_->signature[59], 3) + << "incorrect value for signature[59], expected 3, is " + << last_msg_->signature[59]; + EXPECT_EQ(last_msg_->signature[60], 4) + << "incorrect value for signature[60], expected 4, is " + << last_msg_->signature[60]; + EXPECT_EQ(last_msg_->signature[61], 5) + << "incorrect value for signature[61], expected 5, is " + << last_msg_->signature[61]; + EXPECT_EQ(last_msg_->signature[62], 6) + << "incorrect value for signature[62], expected 6, is " + << last_msg_->signature[62]; + EXPECT_EQ(last_msg_->signature[63], 7) + << "incorrect value for signature[63], expected 7, is " + << last_msg_->signature[63]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaCertificate.cc b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaCertificate.cc index 7d53a52c8..2f94b9049 100644 --- a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaCertificate.cc +++ b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaCertificate.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaCertificate.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaCertificate.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_signing_MsgEcdsaCertificate0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_signing_MsgEcdsaCertificate0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_signing_MsgEcdsaCertificate0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_signing_MsgEcdsaCertificate0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ecdsa_certificate_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ecdsa_certificate_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,1543 +82,2316 @@ class Test_legacy_auto_check_sbp_signing_MsgEcdsaCertificate0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ecdsa_certificate_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaCertificate0, Test) -{ +}; - uint8_t encoded_frame[] = {85,4,12,66,0,253,48,10,11,12,13,2,180,160,116,77,243,28,173,36,86,33,8,31,120,73,64,169,148,224,57,95,17,40,213,92,195,146,235,228,177,101,82,182,25,172,170,250,236,7,119,4,201,10,14,208,47,126,49,210,174,75,221,203,24,66,52,35,26,30,140,111,246,39,226,205,198,178,196,5,81,9,44,164,163,214,138,123,76,74,237,121,13,137,186,97,193,189,200,124,69,115,230,159,185,158,51,12,225,65,192,105,56,41,85,133,19,217,166,48,139,131,96,216,98,147,132,234,167,248,247,32,239,194,188,254,114,117,83,25,251,191,104,240,118,68,42,93,18,16,37,232,99,179,23,90,94,136,6,125,91,255,15,71,43,46,25,252,229,80,143,58,241,11,62,181,155,53,153,149,152,227,150,87,112,165,2,128,231,25,157,244,204,108,253,127,122,145,113,162,197,171,199,54,184,222,206,67,144,78,187,207,60,211,141,135,106,220,79,183,245,21,161,168,34,129,50,176,1,218,20,130,59,249,109,219,0,100,103,55,29,242,110,154,190,233,142,45,61,215,202,238,88,209,70,63,151,27,102,219,30, }; +TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaCertificate0, Test) { + uint8_t encoded_frame[] = { + 85, 4, 12, 66, 0, 253, 48, 10, 11, 12, 13, 2, 180, 160, 116, + 77, 243, 28, 173, 36, 86, 33, 8, 31, 120, 73, 64, 169, 148, 224, + 57, 95, 17, 40, 213, 92, 195, 146, 235, 228, 177, 101, 82, 182, 25, + 172, 170, 250, 236, 7, 119, 4, 201, 10, 14, 208, 47, 126, 49, 210, + 174, 75, 221, 203, 24, 66, 52, 35, 26, 30, 140, 111, 246, 39, 226, + 205, 198, 178, 196, 5, 81, 9, 44, 164, 163, 214, 138, 123, 76, 74, + 237, 121, 13, 137, 186, 97, 193, 189, 200, 124, 69, 115, 230, 159, 185, + 158, 51, 12, 225, 65, 192, 105, 56, 41, 85, 133, 19, 217, 166, 48, + 139, 131, 96, 216, 98, 147, 132, 234, 167, 248, 247, 32, 239, 194, 188, + 254, 114, 117, 83, 25, 251, 191, 104, 240, 118, 68, 42, 93, 18, 16, + 37, 232, 99, 179, 23, 90, 94, 136, 6, 125, 91, 255, 15, 71, 43, + 46, 25, 252, 229, 80, 143, 58, 241, 11, 62, 181, 155, 53, 153, 149, + 152, 227, 150, 87, 112, 165, 2, 128, 231, 25, 157, 244, 204, 108, 253, + 127, 122, 145, 113, 162, 197, 171, 199, 54, 184, 222, 206, 67, 144, 78, + 187, 207, 60, 211, 141, 135, 106, 220, 79, 183, 245, 21, 161, 168, 34, + 129, 50, 176, 1, 218, 20, 130, 59, 249, 109, 219, 0, 100, 103, 55, + 29, 242, 110, 154, 190, 233, 142, 45, 61, 215, 202, 238, 88, 209, 70, + 63, 151, 27, 102, 219, 30, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ecdsa_certificate_t* test_msg = ( msg_ecdsa_certificate_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[0] = 180; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[1] = 160; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[2] = 116; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[3] = 77; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[4] = 243; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[5] = 28; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[6] = 173; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[7] = 36; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[8] = 86; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[9] = 33; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[10] = 8; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[11] = 31; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[12] = 120; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[13] = 73; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[14] = 64; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[15] = 169; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[16] = 148; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[17] = 224; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[18] = 57; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[19] = 95; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[20] = 17; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[21] = 40; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[22] = 213; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[23] = 92; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[24] = 195; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[25] = 146; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[26] = 235; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[27] = 228; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[28] = 177; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[29] = 101; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[30] = 82; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[31] = 182; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[32] = 25; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[33] = 172; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[34] = 170; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[35] = 250; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[36] = 236; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[37] = 7; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[38] = 119; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[39] = 4; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[40] = 201; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[41] = 10; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[42] = 14; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[43] = 208; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[44] = 47; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[45] = 126; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[46] = 49; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[47] = 210; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[48] = 174; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[49] = 75; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[50] = 221; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[51] = 203; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[52] = 24; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[53] = 66; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[54] = 52; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[55] = 35; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[56] = 26; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[57] = 30; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[58] = 140; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[59] = 111; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[60] = 246; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[61] = 39; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[62] = 226; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[63] = 205; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[64] = 198; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[65] = 178; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[66] = 196; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[67] = 5; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[68] = 81; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[69] = 9; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[70] = 44; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[71] = 164; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[72] = 163; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[73] = 214; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[74] = 138; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[75] = 123; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[76] = 76; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[77] = 74; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[78] = 237; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[79] = 121; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[80] = 13; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[81] = 137; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[82] = 186; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[83] = 97; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[84] = 193; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[85] = 189; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[86] = 200; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[87] = 124; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[88] = 69; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[89] = 115; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[90] = 230; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[91] = 159; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[92] = 185; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[93] = 158; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[94] = 51; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[95] = 12; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[96] = 225; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[97] = 65; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[98] = 192; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[99] = 105; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[100] = 56; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[101] = 41; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[102] = 85; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[103] = 133; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[104] = 19; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[105] = 217; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[106] = 166; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[107] = 48; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[108] = 139; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[109] = 131; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[110] = 96; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[111] = 216; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[112] = 98; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[113] = 147; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[114] = 132; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[115] = 234; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[116] = 167; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[117] = 248; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[118] = 247; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[119] = 32; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[120] = 239; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[121] = 194; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[122] = 188; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[123] = 254; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[124] = 114; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[125] = 117; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[126] = 83; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[127] = 25; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[128] = 251; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[129] = 191; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[130] = 104; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[131] = 240; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[132] = 118; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[133] = 68; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[134] = 42; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[135] = 93; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[136] = 18; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[137] = 16; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[138] = 37; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[139] = 232; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[140] = 99; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[141] = 179; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[142] = 23; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[143] = 90; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[144] = 94; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[145] = 136; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[146] = 6; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[147] = 125; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[148] = 91; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[149] = 255; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[150] = 15; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[151] = 71; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[152] = 43; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[153] = 46; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[154] = 25; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[155] = 252; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[156] = 229; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[157] = 80; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[158] = 143; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[159] = 58; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[160] = 241; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[161] = 11; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[162] = 62; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[163] = 181; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[164] = 155; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[165] = 53; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[166] = 153; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[167] = 149; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[168] = 152; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[169] = 227; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[170] = 150; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[171] = 87; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[172] = 112; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[173] = 165; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[174] = 2; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[175] = 128; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[176] = 231; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[177] = 25; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[178] = 157; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[179] = 244; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[180] = 204; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[181] = 108; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[182] = 253; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[183] = 127; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[184] = 122; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[185] = 145; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[186] = 113; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[187] = 162; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[188] = 197; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[189] = 171; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[190] = 199; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[191] = 54; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[192] = 184; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[193] = 222; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[194] = 206; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[195] = 67; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[196] = 144; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[197] = 78; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[198] = 187; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[199] = 207; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[200] = 60; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[201] = 211; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[202] = 141; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[203] = 135; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[204] = 106; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[205] = 220; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[206] = 79; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[207] = 183; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[208] = 245; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[209] = 21; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[210] = 161; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[211] = 168; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[212] = 34; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[213] = 129; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[214] = 50; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[215] = 176; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[216] = 1; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[217] = 218; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[218] = 20; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[219] = 130; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[220] = 59; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[221] = 249; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[222] = 109; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[223] = 219; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[224] = 0; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[225] = 100; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[226] = 103; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[227] = 55; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[228] = 29; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[229] = 242; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[230] = 110; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[231] = 154; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[232] = 190; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[233] = 233; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[234] = 142; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[235] = 45; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[236] = 61; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[237] = 215; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[238] = 202; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[239] = 238; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[240] = 88; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[241] = 209; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[242] = 70; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[243] = 63; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[244] = 151; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[245] = 27; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[246] = 102; - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[0] = 10; - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[1] = 11; - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[2] = 12; - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[3] = 13; - test_msg->flags = 2; - test_msg->n_msg = 48; - - EXPECT_EQ(send_message( 0xC04, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ecdsa_certificate_t *test_msg = + (msg_ecdsa_certificate_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[0] = 180; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[1] = 160; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[2] = 116; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[3] = 77; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[4] = 243; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[5] = 28; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[6] = 173; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[7] = 36; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[8] = 86; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[9] = 33; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[10] = 8; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[11] = 31; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[12] = 120; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[13] = 73; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[14] = 64; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[15] = 169; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[16] = 148; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[17] = 224; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[18] = 57; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[19] = 95; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[20] = 17; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[21] = 40; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[22] = 213; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[23] = 92; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[24] = 195; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[25] = 146; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[26] = 235; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[27] = 228; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[28] = 177; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[29] = 101; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[30] = 82; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[31] = 182; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[32] = 25; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[33] = 172; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[34] = 170; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[35] = 250; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[36] = 236; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[37] = 7; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[38] = 119; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[39] = 4; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[40] = 201; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[41] = 10; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[42] = 14; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[43] = 208; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[44] = 47; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[45] = 126; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[46] = 49; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[47] = 210; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[48] = 174; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[49] = 75; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[50] = 221; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[51] = 203; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[52] = 24; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[53] = 66; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[54] = 52; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[55] = 35; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[56] = 26; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[57] = 30; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[58] = 140; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[59] = 111; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[60] = 246; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[61] = 39; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[62] = 226; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[63] = 205; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[64] = 198; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[65] = 178; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[66] = 196; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[67] = 5; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[68] = 81; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[69] = 9; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[70] = 44; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[71] = 164; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[72] = 163; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[73] = 214; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[74] = 138; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[75] = 123; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[76] = 76; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[77] = 74; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[78] = 237; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[79] = 121; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[80] = 13; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[81] = 137; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[82] = 186; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[83] = 97; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[84] = 193; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[85] = 189; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[86] = 200; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[87] = 124; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[88] = 69; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[89] = 115; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[90] = 230; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[91] = 159; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[92] = 185; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[93] = 158; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[94] = 51; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[95] = 12; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[96] = 225; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[97] = 65; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[98] = 192; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[99] = 105; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[100] = 56; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[101] = 41; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[102] = 85; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[103] = 133; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[104] = 19; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[105] = 217; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[106] = 166; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[107] = 48; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[108] = 139; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[109] = 131; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[110] = 96; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[111] = 216; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[112] = 98; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[113] = 147; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[114] = 132; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[115] = 234; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[116] = 167; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[117] = 248; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[118] = 247; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[119] = 32; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[120] = 239; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[121] = 194; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[122] = 188; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[123] = 254; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[124] = 114; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[125] = 117; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[126] = 83; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[127] = 25; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[128] = 251; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[129] = 191; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[130] = 104; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[131] = 240; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[132] = 118; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[133] = 68; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[134] = 42; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[135] = 93; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[136] = 18; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[137] = 16; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[138] = 37; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[139] = 232; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[140] = 99; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[141] = 179; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[142] = 23; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[143] = 90; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[144] = 94; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[145] = 136; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[146] = 6; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[147] = 125; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[148] = 91; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[149] = 255; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[150] = 15; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[151] = 71; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[152] = 43; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[153] = 46; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[154] = 25; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[155] = 252; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[156] = 229; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[157] = 80; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[158] = 143; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[159] = 58; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[160] = 241; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[161] = 11; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[162] = 62; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[163] = 181; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[164] = 155; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[165] = 53; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[166] = 153; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[167] = 149; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[168] = 152; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[169] = 227; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[170] = 150; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[171] = 87; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[172] = 112; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[173] = 165; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[174] = 2; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[175] = 128; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[176] = 231; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[177] = 25; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[178] = 157; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[179] = 244; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[180] = 204; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[181] = 108; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[182] = 253; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[183] = 127; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[184] = 122; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[185] = 145; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[186] = 113; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[187] = 162; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[188] = 197; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[189] = 171; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[190] = 199; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[191] = 54; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[192] = 184; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[193] = 222; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[194] = 206; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[195] = 67; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[196] = 144; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[197] = 78; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[198] = 187; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[199] = 207; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[200] = 60; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[201] = 211; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[202] = 141; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[203] = 135; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[204] = 106; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[205] = 220; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[206] = 79; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[207] = 183; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[208] = 245; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[209] = 21; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[210] = 161; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[211] = 168; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[212] = 34; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[213] = 129; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[214] = 50; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[215] = 176; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[216] = 1; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[217] = 218; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[218] = 20; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[219] = 130; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[220] = 59; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[221] = 249; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[222] = 109; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[223] = 219; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[224] = 0; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[225] = 100; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[226] = 103; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[227] = 55; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[228] = 29; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[229] = 242; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[230] = 110; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[231] = 154; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[232] = 190; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[233] = 233; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[234] = 142; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[235] = 45; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[236] = 61; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[237] = 215; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[238] = 202; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[239] = 238; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[240] = 88; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[241] = 209; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[242] = 70; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[243] = 63; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[244] = 151; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[245] = 27; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[246] = 102; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[0] = 10; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[1] = 11; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[2] = 12; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[3] = 13; + test_msg->flags = 2; + test_msg->n_msg = 48; + + EXPECT_EQ(send_message(0xC04, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->certificate_bytes[0], 180) << "incorrect value for certificate_bytes[0], expected 180, is " << last_msg_->certificate_bytes[0]; - EXPECT_EQ(last_msg_->certificate_bytes[1], 160) << "incorrect value for certificate_bytes[1], expected 160, is " << last_msg_->certificate_bytes[1]; - EXPECT_EQ(last_msg_->certificate_bytes[2], 116) << "incorrect value for certificate_bytes[2], expected 116, is " << last_msg_->certificate_bytes[2]; - EXPECT_EQ(last_msg_->certificate_bytes[3], 77) << "incorrect value for certificate_bytes[3], expected 77, is " << last_msg_->certificate_bytes[3]; - EXPECT_EQ(last_msg_->certificate_bytes[4], 243) << "incorrect value for certificate_bytes[4], expected 243, is " << last_msg_->certificate_bytes[4]; - EXPECT_EQ(last_msg_->certificate_bytes[5], 28) << "incorrect value for certificate_bytes[5], expected 28, is " << last_msg_->certificate_bytes[5]; - EXPECT_EQ(last_msg_->certificate_bytes[6], 173) << "incorrect value for certificate_bytes[6], expected 173, is " << last_msg_->certificate_bytes[6]; - EXPECT_EQ(last_msg_->certificate_bytes[7], 36) << "incorrect value for certificate_bytes[7], expected 36, is " << last_msg_->certificate_bytes[7]; - EXPECT_EQ(last_msg_->certificate_bytes[8], 86) << "incorrect value for certificate_bytes[8], expected 86, is " << last_msg_->certificate_bytes[8]; - EXPECT_EQ(last_msg_->certificate_bytes[9], 33) << "incorrect value for certificate_bytes[9], expected 33, is " << last_msg_->certificate_bytes[9]; - EXPECT_EQ(last_msg_->certificate_bytes[10], 8) << "incorrect value for certificate_bytes[10], expected 8, is " << last_msg_->certificate_bytes[10]; - EXPECT_EQ(last_msg_->certificate_bytes[11], 31) << "incorrect value for certificate_bytes[11], expected 31, is " << last_msg_->certificate_bytes[11]; - EXPECT_EQ(last_msg_->certificate_bytes[12], 120) << "incorrect value for certificate_bytes[12], expected 120, is " << last_msg_->certificate_bytes[12]; - EXPECT_EQ(last_msg_->certificate_bytes[13], 73) << "incorrect value for certificate_bytes[13], expected 73, is " << last_msg_->certificate_bytes[13]; - EXPECT_EQ(last_msg_->certificate_bytes[14], 64) << "incorrect value for certificate_bytes[14], expected 64, is " << last_msg_->certificate_bytes[14]; - EXPECT_EQ(last_msg_->certificate_bytes[15], 169) << "incorrect value for certificate_bytes[15], expected 169, is " << last_msg_->certificate_bytes[15]; - EXPECT_EQ(last_msg_->certificate_bytes[16], 148) << "incorrect value for certificate_bytes[16], expected 148, is " << last_msg_->certificate_bytes[16]; - EXPECT_EQ(last_msg_->certificate_bytes[17], 224) << "incorrect value for certificate_bytes[17], expected 224, is " << last_msg_->certificate_bytes[17]; - EXPECT_EQ(last_msg_->certificate_bytes[18], 57) << "incorrect value for certificate_bytes[18], expected 57, is " << last_msg_->certificate_bytes[18]; - EXPECT_EQ(last_msg_->certificate_bytes[19], 95) << "incorrect value for certificate_bytes[19], expected 95, is " << last_msg_->certificate_bytes[19]; - EXPECT_EQ(last_msg_->certificate_bytes[20], 17) << "incorrect value for certificate_bytes[20], expected 17, is " << last_msg_->certificate_bytes[20]; - EXPECT_EQ(last_msg_->certificate_bytes[21], 40) << "incorrect value for certificate_bytes[21], expected 40, is " << last_msg_->certificate_bytes[21]; - EXPECT_EQ(last_msg_->certificate_bytes[22], 213) << "incorrect value for certificate_bytes[22], expected 213, is " << last_msg_->certificate_bytes[22]; - EXPECT_EQ(last_msg_->certificate_bytes[23], 92) << "incorrect value for certificate_bytes[23], expected 92, is " << last_msg_->certificate_bytes[23]; - EXPECT_EQ(last_msg_->certificate_bytes[24], 195) << "incorrect value for certificate_bytes[24], expected 195, is " << last_msg_->certificate_bytes[24]; - EXPECT_EQ(last_msg_->certificate_bytes[25], 146) << "incorrect value for certificate_bytes[25], expected 146, is " << last_msg_->certificate_bytes[25]; - EXPECT_EQ(last_msg_->certificate_bytes[26], 235) << "incorrect value for certificate_bytes[26], expected 235, is " << last_msg_->certificate_bytes[26]; - EXPECT_EQ(last_msg_->certificate_bytes[27], 228) << "incorrect value for certificate_bytes[27], expected 228, is " << last_msg_->certificate_bytes[27]; - EXPECT_EQ(last_msg_->certificate_bytes[28], 177) << "incorrect value for certificate_bytes[28], expected 177, is " << last_msg_->certificate_bytes[28]; - EXPECT_EQ(last_msg_->certificate_bytes[29], 101) << "incorrect value for certificate_bytes[29], expected 101, is " << last_msg_->certificate_bytes[29]; - EXPECT_EQ(last_msg_->certificate_bytes[30], 82) << "incorrect value for certificate_bytes[30], expected 82, is " << last_msg_->certificate_bytes[30]; - EXPECT_EQ(last_msg_->certificate_bytes[31], 182) << "incorrect value for certificate_bytes[31], expected 182, is " << last_msg_->certificate_bytes[31]; - EXPECT_EQ(last_msg_->certificate_bytes[32], 25) << "incorrect value for certificate_bytes[32], expected 25, is " << last_msg_->certificate_bytes[32]; - EXPECT_EQ(last_msg_->certificate_bytes[33], 172) << "incorrect value for certificate_bytes[33], expected 172, is " << last_msg_->certificate_bytes[33]; - EXPECT_EQ(last_msg_->certificate_bytes[34], 170) << "incorrect value for certificate_bytes[34], expected 170, is " << last_msg_->certificate_bytes[34]; - EXPECT_EQ(last_msg_->certificate_bytes[35], 250) << "incorrect value for certificate_bytes[35], expected 250, is " << last_msg_->certificate_bytes[35]; - EXPECT_EQ(last_msg_->certificate_bytes[36], 236) << "incorrect value for certificate_bytes[36], expected 236, is " << last_msg_->certificate_bytes[36]; - EXPECT_EQ(last_msg_->certificate_bytes[37], 7) << "incorrect value for certificate_bytes[37], expected 7, is " << last_msg_->certificate_bytes[37]; - EXPECT_EQ(last_msg_->certificate_bytes[38], 119) << "incorrect value for certificate_bytes[38], expected 119, is " << last_msg_->certificate_bytes[38]; - EXPECT_EQ(last_msg_->certificate_bytes[39], 4) << "incorrect value for certificate_bytes[39], expected 4, is " << last_msg_->certificate_bytes[39]; - EXPECT_EQ(last_msg_->certificate_bytes[40], 201) << "incorrect value for certificate_bytes[40], expected 201, is " << last_msg_->certificate_bytes[40]; - EXPECT_EQ(last_msg_->certificate_bytes[41], 10) << "incorrect value for certificate_bytes[41], expected 10, is " << last_msg_->certificate_bytes[41]; - EXPECT_EQ(last_msg_->certificate_bytes[42], 14) << "incorrect value for certificate_bytes[42], expected 14, is " << last_msg_->certificate_bytes[42]; - EXPECT_EQ(last_msg_->certificate_bytes[43], 208) << "incorrect value for certificate_bytes[43], expected 208, is " << last_msg_->certificate_bytes[43]; - EXPECT_EQ(last_msg_->certificate_bytes[44], 47) << "incorrect value for certificate_bytes[44], expected 47, is " << last_msg_->certificate_bytes[44]; - EXPECT_EQ(last_msg_->certificate_bytes[45], 126) << "incorrect value for certificate_bytes[45], expected 126, is " << last_msg_->certificate_bytes[45]; - EXPECT_EQ(last_msg_->certificate_bytes[46], 49) << "incorrect value for certificate_bytes[46], expected 49, is " << last_msg_->certificate_bytes[46]; - EXPECT_EQ(last_msg_->certificate_bytes[47], 210) << "incorrect value for certificate_bytes[47], expected 210, is " << last_msg_->certificate_bytes[47]; - EXPECT_EQ(last_msg_->certificate_bytes[48], 174) << "incorrect value for certificate_bytes[48], expected 174, is " << last_msg_->certificate_bytes[48]; - EXPECT_EQ(last_msg_->certificate_bytes[49], 75) << "incorrect value for certificate_bytes[49], expected 75, is " << last_msg_->certificate_bytes[49]; - EXPECT_EQ(last_msg_->certificate_bytes[50], 221) << "incorrect value for certificate_bytes[50], expected 221, is " << last_msg_->certificate_bytes[50]; - EXPECT_EQ(last_msg_->certificate_bytes[51], 203) << "incorrect value for certificate_bytes[51], expected 203, is " << last_msg_->certificate_bytes[51]; - EXPECT_EQ(last_msg_->certificate_bytes[52], 24) << "incorrect value for certificate_bytes[52], expected 24, is " << last_msg_->certificate_bytes[52]; - EXPECT_EQ(last_msg_->certificate_bytes[53], 66) << "incorrect value for certificate_bytes[53], expected 66, is " << last_msg_->certificate_bytes[53]; - EXPECT_EQ(last_msg_->certificate_bytes[54], 52) << "incorrect value for certificate_bytes[54], expected 52, is " << last_msg_->certificate_bytes[54]; - EXPECT_EQ(last_msg_->certificate_bytes[55], 35) << "incorrect value for certificate_bytes[55], expected 35, is " << last_msg_->certificate_bytes[55]; - EXPECT_EQ(last_msg_->certificate_bytes[56], 26) << "incorrect value for certificate_bytes[56], expected 26, is " << last_msg_->certificate_bytes[56]; - EXPECT_EQ(last_msg_->certificate_bytes[57], 30) << "incorrect value for certificate_bytes[57], expected 30, is " << last_msg_->certificate_bytes[57]; - EXPECT_EQ(last_msg_->certificate_bytes[58], 140) << "incorrect value for certificate_bytes[58], expected 140, is " << last_msg_->certificate_bytes[58]; - EXPECT_EQ(last_msg_->certificate_bytes[59], 111) << "incorrect value for certificate_bytes[59], expected 111, is " << last_msg_->certificate_bytes[59]; - EXPECT_EQ(last_msg_->certificate_bytes[60], 246) << "incorrect value for certificate_bytes[60], expected 246, is " << last_msg_->certificate_bytes[60]; - EXPECT_EQ(last_msg_->certificate_bytes[61], 39) << "incorrect value for certificate_bytes[61], expected 39, is " << last_msg_->certificate_bytes[61]; - EXPECT_EQ(last_msg_->certificate_bytes[62], 226) << "incorrect value for certificate_bytes[62], expected 226, is " << last_msg_->certificate_bytes[62]; - EXPECT_EQ(last_msg_->certificate_bytes[63], 205) << "incorrect value for certificate_bytes[63], expected 205, is " << last_msg_->certificate_bytes[63]; - EXPECT_EQ(last_msg_->certificate_bytes[64], 198) << "incorrect value for certificate_bytes[64], expected 198, is " << last_msg_->certificate_bytes[64]; - EXPECT_EQ(last_msg_->certificate_bytes[65], 178) << "incorrect value for certificate_bytes[65], expected 178, is " << last_msg_->certificate_bytes[65]; - EXPECT_EQ(last_msg_->certificate_bytes[66], 196) << "incorrect value for certificate_bytes[66], expected 196, is " << last_msg_->certificate_bytes[66]; - EXPECT_EQ(last_msg_->certificate_bytes[67], 5) << "incorrect value for certificate_bytes[67], expected 5, is " << last_msg_->certificate_bytes[67]; - EXPECT_EQ(last_msg_->certificate_bytes[68], 81) << "incorrect value for certificate_bytes[68], expected 81, is " << last_msg_->certificate_bytes[68]; - EXPECT_EQ(last_msg_->certificate_bytes[69], 9) << "incorrect value for certificate_bytes[69], expected 9, is " << last_msg_->certificate_bytes[69]; - EXPECT_EQ(last_msg_->certificate_bytes[70], 44) << "incorrect value for certificate_bytes[70], expected 44, is " << last_msg_->certificate_bytes[70]; - EXPECT_EQ(last_msg_->certificate_bytes[71], 164) << "incorrect value for certificate_bytes[71], expected 164, is " << last_msg_->certificate_bytes[71]; - EXPECT_EQ(last_msg_->certificate_bytes[72], 163) << "incorrect value for certificate_bytes[72], expected 163, is " << last_msg_->certificate_bytes[72]; - EXPECT_EQ(last_msg_->certificate_bytes[73], 214) << "incorrect value for certificate_bytes[73], expected 214, is " << last_msg_->certificate_bytes[73]; - EXPECT_EQ(last_msg_->certificate_bytes[74], 138) << "incorrect value for certificate_bytes[74], expected 138, is " << last_msg_->certificate_bytes[74]; - EXPECT_EQ(last_msg_->certificate_bytes[75], 123) << "incorrect value for certificate_bytes[75], expected 123, is " << last_msg_->certificate_bytes[75]; - EXPECT_EQ(last_msg_->certificate_bytes[76], 76) << "incorrect value for certificate_bytes[76], expected 76, is " << last_msg_->certificate_bytes[76]; - EXPECT_EQ(last_msg_->certificate_bytes[77], 74) << "incorrect value for certificate_bytes[77], expected 74, is " << last_msg_->certificate_bytes[77]; - EXPECT_EQ(last_msg_->certificate_bytes[78], 237) << "incorrect value for certificate_bytes[78], expected 237, is " << last_msg_->certificate_bytes[78]; - EXPECT_EQ(last_msg_->certificate_bytes[79], 121) << "incorrect value for certificate_bytes[79], expected 121, is " << last_msg_->certificate_bytes[79]; - EXPECT_EQ(last_msg_->certificate_bytes[80], 13) << "incorrect value for certificate_bytes[80], expected 13, is " << last_msg_->certificate_bytes[80]; - EXPECT_EQ(last_msg_->certificate_bytes[81], 137) << "incorrect value for certificate_bytes[81], expected 137, is " << last_msg_->certificate_bytes[81]; - EXPECT_EQ(last_msg_->certificate_bytes[82], 186) << "incorrect value for certificate_bytes[82], expected 186, is " << last_msg_->certificate_bytes[82]; - EXPECT_EQ(last_msg_->certificate_bytes[83], 97) << "incorrect value for certificate_bytes[83], expected 97, is " << last_msg_->certificate_bytes[83]; - EXPECT_EQ(last_msg_->certificate_bytes[84], 193) << "incorrect value for certificate_bytes[84], expected 193, is " << last_msg_->certificate_bytes[84]; - EXPECT_EQ(last_msg_->certificate_bytes[85], 189) << "incorrect value for certificate_bytes[85], expected 189, is " << last_msg_->certificate_bytes[85]; - EXPECT_EQ(last_msg_->certificate_bytes[86], 200) << "incorrect value for certificate_bytes[86], expected 200, is " << last_msg_->certificate_bytes[86]; - EXPECT_EQ(last_msg_->certificate_bytes[87], 124) << "incorrect value for certificate_bytes[87], expected 124, is " << last_msg_->certificate_bytes[87]; - EXPECT_EQ(last_msg_->certificate_bytes[88], 69) << "incorrect value for certificate_bytes[88], expected 69, is " << last_msg_->certificate_bytes[88]; - EXPECT_EQ(last_msg_->certificate_bytes[89], 115) << "incorrect value for certificate_bytes[89], expected 115, is " << last_msg_->certificate_bytes[89]; - EXPECT_EQ(last_msg_->certificate_bytes[90], 230) << "incorrect value for certificate_bytes[90], expected 230, is " << last_msg_->certificate_bytes[90]; - EXPECT_EQ(last_msg_->certificate_bytes[91], 159) << "incorrect value for certificate_bytes[91], expected 159, is " << last_msg_->certificate_bytes[91]; - EXPECT_EQ(last_msg_->certificate_bytes[92], 185) << "incorrect value for certificate_bytes[92], expected 185, is " << last_msg_->certificate_bytes[92]; - EXPECT_EQ(last_msg_->certificate_bytes[93], 158) << "incorrect value for certificate_bytes[93], expected 158, is " << last_msg_->certificate_bytes[93]; - EXPECT_EQ(last_msg_->certificate_bytes[94], 51) << "incorrect value for certificate_bytes[94], expected 51, is " << last_msg_->certificate_bytes[94]; - EXPECT_EQ(last_msg_->certificate_bytes[95], 12) << "incorrect value for certificate_bytes[95], expected 12, is " << last_msg_->certificate_bytes[95]; - EXPECT_EQ(last_msg_->certificate_bytes[96], 225) << "incorrect value for certificate_bytes[96], expected 225, is " << last_msg_->certificate_bytes[96]; - EXPECT_EQ(last_msg_->certificate_bytes[97], 65) << "incorrect value for certificate_bytes[97], expected 65, is " << last_msg_->certificate_bytes[97]; - EXPECT_EQ(last_msg_->certificate_bytes[98], 192) << "incorrect value for certificate_bytes[98], expected 192, is " << last_msg_->certificate_bytes[98]; - EXPECT_EQ(last_msg_->certificate_bytes[99], 105) << "incorrect value for certificate_bytes[99], expected 105, is " << last_msg_->certificate_bytes[99]; - EXPECT_EQ(last_msg_->certificate_bytes[100], 56) << "incorrect value for certificate_bytes[100], expected 56, is " << last_msg_->certificate_bytes[100]; - EXPECT_EQ(last_msg_->certificate_bytes[101], 41) << "incorrect value for certificate_bytes[101], expected 41, is " << last_msg_->certificate_bytes[101]; - EXPECT_EQ(last_msg_->certificate_bytes[102], 85) << "incorrect value for certificate_bytes[102], expected 85, is " << last_msg_->certificate_bytes[102]; - EXPECT_EQ(last_msg_->certificate_bytes[103], 133) << "incorrect value for certificate_bytes[103], expected 133, is " << last_msg_->certificate_bytes[103]; - EXPECT_EQ(last_msg_->certificate_bytes[104], 19) << "incorrect value for certificate_bytes[104], expected 19, is " << last_msg_->certificate_bytes[104]; - EXPECT_EQ(last_msg_->certificate_bytes[105], 217) << "incorrect value for certificate_bytes[105], expected 217, is " << last_msg_->certificate_bytes[105]; - EXPECT_EQ(last_msg_->certificate_bytes[106], 166) << "incorrect value for certificate_bytes[106], expected 166, is " << last_msg_->certificate_bytes[106]; - EXPECT_EQ(last_msg_->certificate_bytes[107], 48) << "incorrect value for certificate_bytes[107], expected 48, is " << last_msg_->certificate_bytes[107]; - EXPECT_EQ(last_msg_->certificate_bytes[108], 139) << "incorrect value for certificate_bytes[108], expected 139, is " << last_msg_->certificate_bytes[108]; - EXPECT_EQ(last_msg_->certificate_bytes[109], 131) << "incorrect value for certificate_bytes[109], expected 131, is " << last_msg_->certificate_bytes[109]; - EXPECT_EQ(last_msg_->certificate_bytes[110], 96) << "incorrect value for certificate_bytes[110], expected 96, is " << last_msg_->certificate_bytes[110]; - EXPECT_EQ(last_msg_->certificate_bytes[111], 216) << "incorrect value for certificate_bytes[111], expected 216, is " << last_msg_->certificate_bytes[111]; - EXPECT_EQ(last_msg_->certificate_bytes[112], 98) << "incorrect value for certificate_bytes[112], expected 98, is " << last_msg_->certificate_bytes[112]; - EXPECT_EQ(last_msg_->certificate_bytes[113], 147) << "incorrect value for certificate_bytes[113], expected 147, is " << last_msg_->certificate_bytes[113]; - EXPECT_EQ(last_msg_->certificate_bytes[114], 132) << "incorrect value for certificate_bytes[114], expected 132, is " << last_msg_->certificate_bytes[114]; - EXPECT_EQ(last_msg_->certificate_bytes[115], 234) << "incorrect value for certificate_bytes[115], expected 234, is " << last_msg_->certificate_bytes[115]; - EXPECT_EQ(last_msg_->certificate_bytes[116], 167) << "incorrect value for certificate_bytes[116], expected 167, is " << last_msg_->certificate_bytes[116]; - EXPECT_EQ(last_msg_->certificate_bytes[117], 248) << "incorrect value for certificate_bytes[117], expected 248, is " << last_msg_->certificate_bytes[117]; - EXPECT_EQ(last_msg_->certificate_bytes[118], 247) << "incorrect value for certificate_bytes[118], expected 247, is " << last_msg_->certificate_bytes[118]; - EXPECT_EQ(last_msg_->certificate_bytes[119], 32) << "incorrect value for certificate_bytes[119], expected 32, is " << last_msg_->certificate_bytes[119]; - EXPECT_EQ(last_msg_->certificate_bytes[120], 239) << "incorrect value for certificate_bytes[120], expected 239, is " << last_msg_->certificate_bytes[120]; - EXPECT_EQ(last_msg_->certificate_bytes[121], 194) << "incorrect value for certificate_bytes[121], expected 194, is " << last_msg_->certificate_bytes[121]; - EXPECT_EQ(last_msg_->certificate_bytes[122], 188) << "incorrect value for certificate_bytes[122], expected 188, is " << last_msg_->certificate_bytes[122]; - EXPECT_EQ(last_msg_->certificate_bytes[123], 254) << "incorrect value for certificate_bytes[123], expected 254, is " << last_msg_->certificate_bytes[123]; - EXPECT_EQ(last_msg_->certificate_bytes[124], 114) << "incorrect value for certificate_bytes[124], expected 114, is " << last_msg_->certificate_bytes[124]; - EXPECT_EQ(last_msg_->certificate_bytes[125], 117) << "incorrect value for certificate_bytes[125], expected 117, is " << last_msg_->certificate_bytes[125]; - EXPECT_EQ(last_msg_->certificate_bytes[126], 83) << "incorrect value for certificate_bytes[126], expected 83, is " << last_msg_->certificate_bytes[126]; - EXPECT_EQ(last_msg_->certificate_bytes[127], 25) << "incorrect value for certificate_bytes[127], expected 25, is " << last_msg_->certificate_bytes[127]; - EXPECT_EQ(last_msg_->certificate_bytes[128], 251) << "incorrect value for certificate_bytes[128], expected 251, is " << last_msg_->certificate_bytes[128]; - EXPECT_EQ(last_msg_->certificate_bytes[129], 191) << "incorrect value for certificate_bytes[129], expected 191, is " << last_msg_->certificate_bytes[129]; - EXPECT_EQ(last_msg_->certificate_bytes[130], 104) << "incorrect value for certificate_bytes[130], expected 104, is " << last_msg_->certificate_bytes[130]; - EXPECT_EQ(last_msg_->certificate_bytes[131], 240) << "incorrect value for certificate_bytes[131], expected 240, is " << last_msg_->certificate_bytes[131]; - EXPECT_EQ(last_msg_->certificate_bytes[132], 118) << "incorrect value for certificate_bytes[132], expected 118, is " << last_msg_->certificate_bytes[132]; - EXPECT_EQ(last_msg_->certificate_bytes[133], 68) << "incorrect value for certificate_bytes[133], expected 68, is " << last_msg_->certificate_bytes[133]; - EXPECT_EQ(last_msg_->certificate_bytes[134], 42) << "incorrect value for certificate_bytes[134], expected 42, is " << last_msg_->certificate_bytes[134]; - EXPECT_EQ(last_msg_->certificate_bytes[135], 93) << "incorrect value for certificate_bytes[135], expected 93, is " << last_msg_->certificate_bytes[135]; - EXPECT_EQ(last_msg_->certificate_bytes[136], 18) << "incorrect value for certificate_bytes[136], expected 18, is " << last_msg_->certificate_bytes[136]; - EXPECT_EQ(last_msg_->certificate_bytes[137], 16) << "incorrect value for certificate_bytes[137], expected 16, is " << last_msg_->certificate_bytes[137]; - EXPECT_EQ(last_msg_->certificate_bytes[138], 37) << "incorrect value for certificate_bytes[138], expected 37, is " << last_msg_->certificate_bytes[138]; - EXPECT_EQ(last_msg_->certificate_bytes[139], 232) << "incorrect value for certificate_bytes[139], expected 232, is " << last_msg_->certificate_bytes[139]; - EXPECT_EQ(last_msg_->certificate_bytes[140], 99) << "incorrect value for certificate_bytes[140], expected 99, is " << last_msg_->certificate_bytes[140]; - EXPECT_EQ(last_msg_->certificate_bytes[141], 179) << "incorrect value for certificate_bytes[141], expected 179, is " << last_msg_->certificate_bytes[141]; - EXPECT_EQ(last_msg_->certificate_bytes[142], 23) << "incorrect value for certificate_bytes[142], expected 23, is " << last_msg_->certificate_bytes[142]; - EXPECT_EQ(last_msg_->certificate_bytes[143], 90) << "incorrect value for certificate_bytes[143], expected 90, is " << last_msg_->certificate_bytes[143]; - EXPECT_EQ(last_msg_->certificate_bytes[144], 94) << "incorrect value for certificate_bytes[144], expected 94, is " << last_msg_->certificate_bytes[144]; - EXPECT_EQ(last_msg_->certificate_bytes[145], 136) << "incorrect value for certificate_bytes[145], expected 136, is " << last_msg_->certificate_bytes[145]; - EXPECT_EQ(last_msg_->certificate_bytes[146], 6) << "incorrect value for certificate_bytes[146], expected 6, is " << last_msg_->certificate_bytes[146]; - EXPECT_EQ(last_msg_->certificate_bytes[147], 125) << "incorrect value for certificate_bytes[147], expected 125, is " << last_msg_->certificate_bytes[147]; - EXPECT_EQ(last_msg_->certificate_bytes[148], 91) << "incorrect value for certificate_bytes[148], expected 91, is " << last_msg_->certificate_bytes[148]; - EXPECT_EQ(last_msg_->certificate_bytes[149], 255) << "incorrect value for certificate_bytes[149], expected 255, is " << last_msg_->certificate_bytes[149]; - EXPECT_EQ(last_msg_->certificate_bytes[150], 15) << "incorrect value for certificate_bytes[150], expected 15, is " << last_msg_->certificate_bytes[150]; - EXPECT_EQ(last_msg_->certificate_bytes[151], 71) << "incorrect value for certificate_bytes[151], expected 71, is " << last_msg_->certificate_bytes[151]; - EXPECT_EQ(last_msg_->certificate_bytes[152], 43) << "incorrect value for certificate_bytes[152], expected 43, is " << last_msg_->certificate_bytes[152]; - EXPECT_EQ(last_msg_->certificate_bytes[153], 46) << "incorrect value for certificate_bytes[153], expected 46, is " << last_msg_->certificate_bytes[153]; - EXPECT_EQ(last_msg_->certificate_bytes[154], 25) << "incorrect value for certificate_bytes[154], expected 25, is " << last_msg_->certificate_bytes[154]; - EXPECT_EQ(last_msg_->certificate_bytes[155], 252) << "incorrect value for certificate_bytes[155], expected 252, is " << last_msg_->certificate_bytes[155]; - EXPECT_EQ(last_msg_->certificate_bytes[156], 229) << "incorrect value for certificate_bytes[156], expected 229, is " << last_msg_->certificate_bytes[156]; - EXPECT_EQ(last_msg_->certificate_bytes[157], 80) << "incorrect value for certificate_bytes[157], expected 80, is " << last_msg_->certificate_bytes[157]; - EXPECT_EQ(last_msg_->certificate_bytes[158], 143) << "incorrect value for certificate_bytes[158], expected 143, is " << last_msg_->certificate_bytes[158]; - EXPECT_EQ(last_msg_->certificate_bytes[159], 58) << "incorrect value for certificate_bytes[159], expected 58, is " << last_msg_->certificate_bytes[159]; - EXPECT_EQ(last_msg_->certificate_bytes[160], 241) << "incorrect value for certificate_bytes[160], expected 241, is " << last_msg_->certificate_bytes[160]; - EXPECT_EQ(last_msg_->certificate_bytes[161], 11) << "incorrect value for certificate_bytes[161], expected 11, is " << last_msg_->certificate_bytes[161]; - EXPECT_EQ(last_msg_->certificate_bytes[162], 62) << "incorrect value for certificate_bytes[162], expected 62, is " << last_msg_->certificate_bytes[162]; - EXPECT_EQ(last_msg_->certificate_bytes[163], 181) << "incorrect value for certificate_bytes[163], expected 181, is " << last_msg_->certificate_bytes[163]; - EXPECT_EQ(last_msg_->certificate_bytes[164], 155) << "incorrect value for certificate_bytes[164], expected 155, is " << last_msg_->certificate_bytes[164]; - EXPECT_EQ(last_msg_->certificate_bytes[165], 53) << "incorrect value for certificate_bytes[165], expected 53, is " << last_msg_->certificate_bytes[165]; - EXPECT_EQ(last_msg_->certificate_bytes[166], 153) << "incorrect value for certificate_bytes[166], expected 153, is " << last_msg_->certificate_bytes[166]; - EXPECT_EQ(last_msg_->certificate_bytes[167], 149) << "incorrect value for certificate_bytes[167], expected 149, is " << last_msg_->certificate_bytes[167]; - EXPECT_EQ(last_msg_->certificate_bytes[168], 152) << "incorrect value for certificate_bytes[168], expected 152, is " << last_msg_->certificate_bytes[168]; - EXPECT_EQ(last_msg_->certificate_bytes[169], 227) << "incorrect value for certificate_bytes[169], expected 227, is " << last_msg_->certificate_bytes[169]; - EXPECT_EQ(last_msg_->certificate_bytes[170], 150) << "incorrect value for certificate_bytes[170], expected 150, is " << last_msg_->certificate_bytes[170]; - EXPECT_EQ(last_msg_->certificate_bytes[171], 87) << "incorrect value for certificate_bytes[171], expected 87, is " << last_msg_->certificate_bytes[171]; - EXPECT_EQ(last_msg_->certificate_bytes[172], 112) << "incorrect value for certificate_bytes[172], expected 112, is " << last_msg_->certificate_bytes[172]; - EXPECT_EQ(last_msg_->certificate_bytes[173], 165) << "incorrect value for certificate_bytes[173], expected 165, is " << last_msg_->certificate_bytes[173]; - EXPECT_EQ(last_msg_->certificate_bytes[174], 2) << "incorrect value for certificate_bytes[174], expected 2, is " << last_msg_->certificate_bytes[174]; - EXPECT_EQ(last_msg_->certificate_bytes[175], 128) << "incorrect value for certificate_bytes[175], expected 128, is " << last_msg_->certificate_bytes[175]; - EXPECT_EQ(last_msg_->certificate_bytes[176], 231) << "incorrect value for certificate_bytes[176], expected 231, is " << last_msg_->certificate_bytes[176]; - EXPECT_EQ(last_msg_->certificate_bytes[177], 25) << "incorrect value for certificate_bytes[177], expected 25, is " << last_msg_->certificate_bytes[177]; - EXPECT_EQ(last_msg_->certificate_bytes[178], 157) << "incorrect value for certificate_bytes[178], expected 157, is " << last_msg_->certificate_bytes[178]; - EXPECT_EQ(last_msg_->certificate_bytes[179], 244) << "incorrect value for certificate_bytes[179], expected 244, is " << last_msg_->certificate_bytes[179]; - EXPECT_EQ(last_msg_->certificate_bytes[180], 204) << "incorrect value for certificate_bytes[180], expected 204, is " << last_msg_->certificate_bytes[180]; - EXPECT_EQ(last_msg_->certificate_bytes[181], 108) << "incorrect value for certificate_bytes[181], expected 108, is " << last_msg_->certificate_bytes[181]; - EXPECT_EQ(last_msg_->certificate_bytes[182], 253) << "incorrect value for certificate_bytes[182], expected 253, is " << last_msg_->certificate_bytes[182]; - EXPECT_EQ(last_msg_->certificate_bytes[183], 127) << "incorrect value for certificate_bytes[183], expected 127, is " << last_msg_->certificate_bytes[183]; - EXPECT_EQ(last_msg_->certificate_bytes[184], 122) << "incorrect value for certificate_bytes[184], expected 122, is " << last_msg_->certificate_bytes[184]; - EXPECT_EQ(last_msg_->certificate_bytes[185], 145) << "incorrect value for certificate_bytes[185], expected 145, is " << last_msg_->certificate_bytes[185]; - EXPECT_EQ(last_msg_->certificate_bytes[186], 113) << "incorrect value for certificate_bytes[186], expected 113, is " << last_msg_->certificate_bytes[186]; - EXPECT_EQ(last_msg_->certificate_bytes[187], 162) << "incorrect value for certificate_bytes[187], expected 162, is " << last_msg_->certificate_bytes[187]; - EXPECT_EQ(last_msg_->certificate_bytes[188], 197) << "incorrect value for certificate_bytes[188], expected 197, is " << last_msg_->certificate_bytes[188]; - EXPECT_EQ(last_msg_->certificate_bytes[189], 171) << "incorrect value for certificate_bytes[189], expected 171, is " << last_msg_->certificate_bytes[189]; - EXPECT_EQ(last_msg_->certificate_bytes[190], 199) << "incorrect value for certificate_bytes[190], expected 199, is " << last_msg_->certificate_bytes[190]; - EXPECT_EQ(last_msg_->certificate_bytes[191], 54) << "incorrect value for certificate_bytes[191], expected 54, is " << last_msg_->certificate_bytes[191]; - EXPECT_EQ(last_msg_->certificate_bytes[192], 184) << "incorrect value for certificate_bytes[192], expected 184, is " << last_msg_->certificate_bytes[192]; - EXPECT_EQ(last_msg_->certificate_bytes[193], 222) << "incorrect value for certificate_bytes[193], expected 222, is " << last_msg_->certificate_bytes[193]; - EXPECT_EQ(last_msg_->certificate_bytes[194], 206) << "incorrect value for certificate_bytes[194], expected 206, is " << last_msg_->certificate_bytes[194]; - EXPECT_EQ(last_msg_->certificate_bytes[195], 67) << "incorrect value for certificate_bytes[195], expected 67, is " << last_msg_->certificate_bytes[195]; - EXPECT_EQ(last_msg_->certificate_bytes[196], 144) << "incorrect value for certificate_bytes[196], expected 144, is " << last_msg_->certificate_bytes[196]; - EXPECT_EQ(last_msg_->certificate_bytes[197], 78) << "incorrect value for certificate_bytes[197], expected 78, is " << last_msg_->certificate_bytes[197]; - EXPECT_EQ(last_msg_->certificate_bytes[198], 187) << "incorrect value for certificate_bytes[198], expected 187, is " << last_msg_->certificate_bytes[198]; - EXPECT_EQ(last_msg_->certificate_bytes[199], 207) << "incorrect value for certificate_bytes[199], expected 207, is " << last_msg_->certificate_bytes[199]; - EXPECT_EQ(last_msg_->certificate_bytes[200], 60) << "incorrect value for certificate_bytes[200], expected 60, is " << last_msg_->certificate_bytes[200]; - EXPECT_EQ(last_msg_->certificate_bytes[201], 211) << "incorrect value for certificate_bytes[201], expected 211, is " << last_msg_->certificate_bytes[201]; - EXPECT_EQ(last_msg_->certificate_bytes[202], 141) << "incorrect value for certificate_bytes[202], expected 141, is " << last_msg_->certificate_bytes[202]; - EXPECT_EQ(last_msg_->certificate_bytes[203], 135) << "incorrect value for certificate_bytes[203], expected 135, is " << last_msg_->certificate_bytes[203]; - EXPECT_EQ(last_msg_->certificate_bytes[204], 106) << "incorrect value for certificate_bytes[204], expected 106, is " << last_msg_->certificate_bytes[204]; - EXPECT_EQ(last_msg_->certificate_bytes[205], 220) << "incorrect value for certificate_bytes[205], expected 220, is " << last_msg_->certificate_bytes[205]; - EXPECT_EQ(last_msg_->certificate_bytes[206], 79) << "incorrect value for certificate_bytes[206], expected 79, is " << last_msg_->certificate_bytes[206]; - EXPECT_EQ(last_msg_->certificate_bytes[207], 183) << "incorrect value for certificate_bytes[207], expected 183, is " << last_msg_->certificate_bytes[207]; - EXPECT_EQ(last_msg_->certificate_bytes[208], 245) << "incorrect value for certificate_bytes[208], expected 245, is " << last_msg_->certificate_bytes[208]; - EXPECT_EQ(last_msg_->certificate_bytes[209], 21) << "incorrect value for certificate_bytes[209], expected 21, is " << last_msg_->certificate_bytes[209]; - EXPECT_EQ(last_msg_->certificate_bytes[210], 161) << "incorrect value for certificate_bytes[210], expected 161, is " << last_msg_->certificate_bytes[210]; - EXPECT_EQ(last_msg_->certificate_bytes[211], 168) << "incorrect value for certificate_bytes[211], expected 168, is " << last_msg_->certificate_bytes[211]; - EXPECT_EQ(last_msg_->certificate_bytes[212], 34) << "incorrect value for certificate_bytes[212], expected 34, is " << last_msg_->certificate_bytes[212]; - EXPECT_EQ(last_msg_->certificate_bytes[213], 129) << "incorrect value for certificate_bytes[213], expected 129, is " << last_msg_->certificate_bytes[213]; - EXPECT_EQ(last_msg_->certificate_bytes[214], 50) << "incorrect value for certificate_bytes[214], expected 50, is " << last_msg_->certificate_bytes[214]; - EXPECT_EQ(last_msg_->certificate_bytes[215], 176) << "incorrect value for certificate_bytes[215], expected 176, is " << last_msg_->certificate_bytes[215]; - EXPECT_EQ(last_msg_->certificate_bytes[216], 1) << "incorrect value for certificate_bytes[216], expected 1, is " << last_msg_->certificate_bytes[216]; - EXPECT_EQ(last_msg_->certificate_bytes[217], 218) << "incorrect value for certificate_bytes[217], expected 218, is " << last_msg_->certificate_bytes[217]; - EXPECT_EQ(last_msg_->certificate_bytes[218], 20) << "incorrect value for certificate_bytes[218], expected 20, is " << last_msg_->certificate_bytes[218]; - EXPECT_EQ(last_msg_->certificate_bytes[219], 130) << "incorrect value for certificate_bytes[219], expected 130, is " << last_msg_->certificate_bytes[219]; - EXPECT_EQ(last_msg_->certificate_bytes[220], 59) << "incorrect value for certificate_bytes[220], expected 59, is " << last_msg_->certificate_bytes[220]; - EXPECT_EQ(last_msg_->certificate_bytes[221], 249) << "incorrect value for certificate_bytes[221], expected 249, is " << last_msg_->certificate_bytes[221]; - EXPECT_EQ(last_msg_->certificate_bytes[222], 109) << "incorrect value for certificate_bytes[222], expected 109, is " << last_msg_->certificate_bytes[222]; - EXPECT_EQ(last_msg_->certificate_bytes[223], 219) << "incorrect value for certificate_bytes[223], expected 219, is " << last_msg_->certificate_bytes[223]; - EXPECT_EQ(last_msg_->certificate_bytes[224], 0) << "incorrect value for certificate_bytes[224], expected 0, is " << last_msg_->certificate_bytes[224]; - EXPECT_EQ(last_msg_->certificate_bytes[225], 100) << "incorrect value for certificate_bytes[225], expected 100, is " << last_msg_->certificate_bytes[225]; - EXPECT_EQ(last_msg_->certificate_bytes[226], 103) << "incorrect value for certificate_bytes[226], expected 103, is " << last_msg_->certificate_bytes[226]; - EXPECT_EQ(last_msg_->certificate_bytes[227], 55) << "incorrect value for certificate_bytes[227], expected 55, is " << last_msg_->certificate_bytes[227]; - EXPECT_EQ(last_msg_->certificate_bytes[228], 29) << "incorrect value for certificate_bytes[228], expected 29, is " << last_msg_->certificate_bytes[228]; - EXPECT_EQ(last_msg_->certificate_bytes[229], 242) << "incorrect value for certificate_bytes[229], expected 242, is " << last_msg_->certificate_bytes[229]; - EXPECT_EQ(last_msg_->certificate_bytes[230], 110) << "incorrect value for certificate_bytes[230], expected 110, is " << last_msg_->certificate_bytes[230]; - EXPECT_EQ(last_msg_->certificate_bytes[231], 154) << "incorrect value for certificate_bytes[231], expected 154, is " << last_msg_->certificate_bytes[231]; - EXPECT_EQ(last_msg_->certificate_bytes[232], 190) << "incorrect value for certificate_bytes[232], expected 190, is " << last_msg_->certificate_bytes[232]; - EXPECT_EQ(last_msg_->certificate_bytes[233], 233) << "incorrect value for certificate_bytes[233], expected 233, is " << last_msg_->certificate_bytes[233]; - EXPECT_EQ(last_msg_->certificate_bytes[234], 142) << "incorrect value for certificate_bytes[234], expected 142, is " << last_msg_->certificate_bytes[234]; - EXPECT_EQ(last_msg_->certificate_bytes[235], 45) << "incorrect value for certificate_bytes[235], expected 45, is " << last_msg_->certificate_bytes[235]; - EXPECT_EQ(last_msg_->certificate_bytes[236], 61) << "incorrect value for certificate_bytes[236], expected 61, is " << last_msg_->certificate_bytes[236]; - EXPECT_EQ(last_msg_->certificate_bytes[237], 215) << "incorrect value for certificate_bytes[237], expected 215, is " << last_msg_->certificate_bytes[237]; - EXPECT_EQ(last_msg_->certificate_bytes[238], 202) << "incorrect value for certificate_bytes[238], expected 202, is " << last_msg_->certificate_bytes[238]; - EXPECT_EQ(last_msg_->certificate_bytes[239], 238) << "incorrect value for certificate_bytes[239], expected 238, is " << last_msg_->certificate_bytes[239]; - EXPECT_EQ(last_msg_->certificate_bytes[240], 88) << "incorrect value for certificate_bytes[240], expected 88, is " << last_msg_->certificate_bytes[240]; - EXPECT_EQ(last_msg_->certificate_bytes[241], 209) << "incorrect value for certificate_bytes[241], expected 209, is " << last_msg_->certificate_bytes[241]; - EXPECT_EQ(last_msg_->certificate_bytes[242], 70) << "incorrect value for certificate_bytes[242], expected 70, is " << last_msg_->certificate_bytes[242]; - EXPECT_EQ(last_msg_->certificate_bytes[243], 63) << "incorrect value for certificate_bytes[243], expected 63, is " << last_msg_->certificate_bytes[243]; - EXPECT_EQ(last_msg_->certificate_bytes[244], 151) << "incorrect value for certificate_bytes[244], expected 151, is " << last_msg_->certificate_bytes[244]; - EXPECT_EQ(last_msg_->certificate_bytes[245], 27) << "incorrect value for certificate_bytes[245], expected 27, is " << last_msg_->certificate_bytes[245]; - EXPECT_EQ(last_msg_->certificate_bytes[246], 102) << "incorrect value for certificate_bytes[246], expected 102, is " << last_msg_->certificate_bytes[246]; - EXPECT_EQ(last_msg_->certificate_id[0], 10) << "incorrect value for certificate_id[0], expected 10, is " << last_msg_->certificate_id[0]; - EXPECT_EQ(last_msg_->certificate_id[1], 11) << "incorrect value for certificate_id[1], expected 11, is " << last_msg_->certificate_id[1]; - EXPECT_EQ(last_msg_->certificate_id[2], 12) << "incorrect value for certificate_id[2], expected 12, is " << last_msg_->certificate_id[2]; - EXPECT_EQ(last_msg_->certificate_id[3], 13) << "incorrect value for certificate_id[3], expected 13, is " << last_msg_->certificate_id[3]; - EXPECT_EQ(last_msg_->flags, 2) << "incorrect value for flags, expected 2, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_msg, 48) << "incorrect value for n_msg, expected 48, is " << last_msg_->n_msg; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->certificate_bytes[0], 180) + << "incorrect value for certificate_bytes[0], expected 180, is " + << last_msg_->certificate_bytes[0]; + EXPECT_EQ(last_msg_->certificate_bytes[1], 160) + << "incorrect value for certificate_bytes[1], expected 160, is " + << last_msg_->certificate_bytes[1]; + EXPECT_EQ(last_msg_->certificate_bytes[2], 116) + << "incorrect value for certificate_bytes[2], expected 116, is " + << last_msg_->certificate_bytes[2]; + EXPECT_EQ(last_msg_->certificate_bytes[3], 77) + << "incorrect value for certificate_bytes[3], expected 77, is " + << last_msg_->certificate_bytes[3]; + EXPECT_EQ(last_msg_->certificate_bytes[4], 243) + << "incorrect value for certificate_bytes[4], expected 243, is " + << last_msg_->certificate_bytes[4]; + EXPECT_EQ(last_msg_->certificate_bytes[5], 28) + << "incorrect value for certificate_bytes[5], expected 28, is " + << last_msg_->certificate_bytes[5]; + EXPECT_EQ(last_msg_->certificate_bytes[6], 173) + << "incorrect value for certificate_bytes[6], expected 173, is " + << last_msg_->certificate_bytes[6]; + EXPECT_EQ(last_msg_->certificate_bytes[7], 36) + << "incorrect value for certificate_bytes[7], expected 36, is " + << last_msg_->certificate_bytes[7]; + EXPECT_EQ(last_msg_->certificate_bytes[8], 86) + << "incorrect value for certificate_bytes[8], expected 86, is " + << last_msg_->certificate_bytes[8]; + EXPECT_EQ(last_msg_->certificate_bytes[9], 33) + << "incorrect value for certificate_bytes[9], expected 33, is " + << last_msg_->certificate_bytes[9]; + EXPECT_EQ(last_msg_->certificate_bytes[10], 8) + << "incorrect value for certificate_bytes[10], expected 8, is " + << last_msg_->certificate_bytes[10]; + EXPECT_EQ(last_msg_->certificate_bytes[11], 31) + << "incorrect value for certificate_bytes[11], expected 31, is " + << last_msg_->certificate_bytes[11]; + EXPECT_EQ(last_msg_->certificate_bytes[12], 120) + << "incorrect value for certificate_bytes[12], expected 120, is " + << last_msg_->certificate_bytes[12]; + EXPECT_EQ(last_msg_->certificate_bytes[13], 73) + << "incorrect value for certificate_bytes[13], expected 73, is " + << last_msg_->certificate_bytes[13]; + EXPECT_EQ(last_msg_->certificate_bytes[14], 64) + << "incorrect value for certificate_bytes[14], expected 64, is " + << last_msg_->certificate_bytes[14]; + EXPECT_EQ(last_msg_->certificate_bytes[15], 169) + << "incorrect value for certificate_bytes[15], expected 169, is " + << last_msg_->certificate_bytes[15]; + EXPECT_EQ(last_msg_->certificate_bytes[16], 148) + << "incorrect value for certificate_bytes[16], expected 148, is " + << last_msg_->certificate_bytes[16]; + EXPECT_EQ(last_msg_->certificate_bytes[17], 224) + << "incorrect value for certificate_bytes[17], expected 224, is " + << last_msg_->certificate_bytes[17]; + EXPECT_EQ(last_msg_->certificate_bytes[18], 57) + << "incorrect value for certificate_bytes[18], expected 57, is " + << last_msg_->certificate_bytes[18]; + EXPECT_EQ(last_msg_->certificate_bytes[19], 95) + << "incorrect value for certificate_bytes[19], expected 95, is " + << last_msg_->certificate_bytes[19]; + EXPECT_EQ(last_msg_->certificate_bytes[20], 17) + << "incorrect value for certificate_bytes[20], expected 17, is " + << last_msg_->certificate_bytes[20]; + EXPECT_EQ(last_msg_->certificate_bytes[21], 40) + << "incorrect value for certificate_bytes[21], expected 40, is " + << last_msg_->certificate_bytes[21]; + EXPECT_EQ(last_msg_->certificate_bytes[22], 213) + << "incorrect value for certificate_bytes[22], expected 213, is " + << last_msg_->certificate_bytes[22]; + EXPECT_EQ(last_msg_->certificate_bytes[23], 92) + << "incorrect value for certificate_bytes[23], expected 92, is " + << last_msg_->certificate_bytes[23]; + EXPECT_EQ(last_msg_->certificate_bytes[24], 195) + << "incorrect value for certificate_bytes[24], expected 195, is " + << last_msg_->certificate_bytes[24]; + EXPECT_EQ(last_msg_->certificate_bytes[25], 146) + << "incorrect value for certificate_bytes[25], expected 146, is " + << last_msg_->certificate_bytes[25]; + EXPECT_EQ(last_msg_->certificate_bytes[26], 235) + << "incorrect value for certificate_bytes[26], expected 235, is " + << last_msg_->certificate_bytes[26]; + EXPECT_EQ(last_msg_->certificate_bytes[27], 228) + << "incorrect value for certificate_bytes[27], expected 228, is " + << last_msg_->certificate_bytes[27]; + EXPECT_EQ(last_msg_->certificate_bytes[28], 177) + << "incorrect value for certificate_bytes[28], expected 177, is " + << last_msg_->certificate_bytes[28]; + EXPECT_EQ(last_msg_->certificate_bytes[29], 101) + << "incorrect value for certificate_bytes[29], expected 101, is " + << last_msg_->certificate_bytes[29]; + EXPECT_EQ(last_msg_->certificate_bytes[30], 82) + << "incorrect value for certificate_bytes[30], expected 82, is " + << last_msg_->certificate_bytes[30]; + EXPECT_EQ(last_msg_->certificate_bytes[31], 182) + << "incorrect value for certificate_bytes[31], expected 182, is " + << last_msg_->certificate_bytes[31]; + EXPECT_EQ(last_msg_->certificate_bytes[32], 25) + << "incorrect value for certificate_bytes[32], expected 25, is " + << last_msg_->certificate_bytes[32]; + EXPECT_EQ(last_msg_->certificate_bytes[33], 172) + << "incorrect value for certificate_bytes[33], expected 172, is " + << last_msg_->certificate_bytes[33]; + EXPECT_EQ(last_msg_->certificate_bytes[34], 170) + << "incorrect value for certificate_bytes[34], expected 170, is " + << last_msg_->certificate_bytes[34]; + EXPECT_EQ(last_msg_->certificate_bytes[35], 250) + << "incorrect value for certificate_bytes[35], expected 250, is " + << last_msg_->certificate_bytes[35]; + EXPECT_EQ(last_msg_->certificate_bytes[36], 236) + << "incorrect value for certificate_bytes[36], expected 236, is " + << last_msg_->certificate_bytes[36]; + EXPECT_EQ(last_msg_->certificate_bytes[37], 7) + << "incorrect value for certificate_bytes[37], expected 7, is " + << last_msg_->certificate_bytes[37]; + EXPECT_EQ(last_msg_->certificate_bytes[38], 119) + << "incorrect value for certificate_bytes[38], expected 119, is " + << last_msg_->certificate_bytes[38]; + EXPECT_EQ(last_msg_->certificate_bytes[39], 4) + << "incorrect value for certificate_bytes[39], expected 4, is " + << last_msg_->certificate_bytes[39]; + EXPECT_EQ(last_msg_->certificate_bytes[40], 201) + << "incorrect value for certificate_bytes[40], expected 201, is " + << last_msg_->certificate_bytes[40]; + EXPECT_EQ(last_msg_->certificate_bytes[41], 10) + << "incorrect value for certificate_bytes[41], expected 10, is " + << last_msg_->certificate_bytes[41]; + EXPECT_EQ(last_msg_->certificate_bytes[42], 14) + << "incorrect value for certificate_bytes[42], expected 14, is " + << last_msg_->certificate_bytes[42]; + EXPECT_EQ(last_msg_->certificate_bytes[43], 208) + << "incorrect value for certificate_bytes[43], expected 208, is " + << last_msg_->certificate_bytes[43]; + EXPECT_EQ(last_msg_->certificate_bytes[44], 47) + << "incorrect value for certificate_bytes[44], expected 47, is " + << last_msg_->certificate_bytes[44]; + EXPECT_EQ(last_msg_->certificate_bytes[45], 126) + << "incorrect value for certificate_bytes[45], expected 126, is " + << last_msg_->certificate_bytes[45]; + EXPECT_EQ(last_msg_->certificate_bytes[46], 49) + << "incorrect value for certificate_bytes[46], expected 49, is " + << last_msg_->certificate_bytes[46]; + EXPECT_EQ(last_msg_->certificate_bytes[47], 210) + << "incorrect value for certificate_bytes[47], expected 210, is " + << last_msg_->certificate_bytes[47]; + EXPECT_EQ(last_msg_->certificate_bytes[48], 174) + << "incorrect value for certificate_bytes[48], expected 174, is " + << last_msg_->certificate_bytes[48]; + EXPECT_EQ(last_msg_->certificate_bytes[49], 75) + << "incorrect value for certificate_bytes[49], expected 75, is " + << last_msg_->certificate_bytes[49]; + EXPECT_EQ(last_msg_->certificate_bytes[50], 221) + << "incorrect value for certificate_bytes[50], expected 221, is " + << last_msg_->certificate_bytes[50]; + EXPECT_EQ(last_msg_->certificate_bytes[51], 203) + << "incorrect value for certificate_bytes[51], expected 203, is " + << last_msg_->certificate_bytes[51]; + EXPECT_EQ(last_msg_->certificate_bytes[52], 24) + << "incorrect value for certificate_bytes[52], expected 24, is " + << last_msg_->certificate_bytes[52]; + EXPECT_EQ(last_msg_->certificate_bytes[53], 66) + << "incorrect value for certificate_bytes[53], expected 66, is " + << last_msg_->certificate_bytes[53]; + EXPECT_EQ(last_msg_->certificate_bytes[54], 52) + << "incorrect value for certificate_bytes[54], expected 52, is " + << last_msg_->certificate_bytes[54]; + EXPECT_EQ(last_msg_->certificate_bytes[55], 35) + << "incorrect value for certificate_bytes[55], expected 35, is " + << last_msg_->certificate_bytes[55]; + EXPECT_EQ(last_msg_->certificate_bytes[56], 26) + << "incorrect value for certificate_bytes[56], expected 26, is " + << last_msg_->certificate_bytes[56]; + EXPECT_EQ(last_msg_->certificate_bytes[57], 30) + << "incorrect value for certificate_bytes[57], expected 30, is " + << last_msg_->certificate_bytes[57]; + EXPECT_EQ(last_msg_->certificate_bytes[58], 140) + << "incorrect value for certificate_bytes[58], expected 140, is " + << last_msg_->certificate_bytes[58]; + EXPECT_EQ(last_msg_->certificate_bytes[59], 111) + << "incorrect value for certificate_bytes[59], expected 111, is " + << last_msg_->certificate_bytes[59]; + EXPECT_EQ(last_msg_->certificate_bytes[60], 246) + << "incorrect value for certificate_bytes[60], expected 246, is " + << last_msg_->certificate_bytes[60]; + EXPECT_EQ(last_msg_->certificate_bytes[61], 39) + << "incorrect value for certificate_bytes[61], expected 39, is " + << last_msg_->certificate_bytes[61]; + EXPECT_EQ(last_msg_->certificate_bytes[62], 226) + << "incorrect value for certificate_bytes[62], expected 226, is " + << last_msg_->certificate_bytes[62]; + EXPECT_EQ(last_msg_->certificate_bytes[63], 205) + << "incorrect value for certificate_bytes[63], expected 205, is " + << last_msg_->certificate_bytes[63]; + EXPECT_EQ(last_msg_->certificate_bytes[64], 198) + << "incorrect value for certificate_bytes[64], expected 198, is " + << last_msg_->certificate_bytes[64]; + EXPECT_EQ(last_msg_->certificate_bytes[65], 178) + << "incorrect value for certificate_bytes[65], expected 178, is " + << last_msg_->certificate_bytes[65]; + EXPECT_EQ(last_msg_->certificate_bytes[66], 196) + << "incorrect value for certificate_bytes[66], expected 196, is " + << last_msg_->certificate_bytes[66]; + EXPECT_EQ(last_msg_->certificate_bytes[67], 5) + << "incorrect value for certificate_bytes[67], expected 5, is " + << last_msg_->certificate_bytes[67]; + EXPECT_EQ(last_msg_->certificate_bytes[68], 81) + << "incorrect value for certificate_bytes[68], expected 81, is " + << last_msg_->certificate_bytes[68]; + EXPECT_EQ(last_msg_->certificate_bytes[69], 9) + << "incorrect value for certificate_bytes[69], expected 9, is " + << last_msg_->certificate_bytes[69]; + EXPECT_EQ(last_msg_->certificate_bytes[70], 44) + << "incorrect value for certificate_bytes[70], expected 44, is " + << last_msg_->certificate_bytes[70]; + EXPECT_EQ(last_msg_->certificate_bytes[71], 164) + << "incorrect value for certificate_bytes[71], expected 164, is " + << last_msg_->certificate_bytes[71]; + EXPECT_EQ(last_msg_->certificate_bytes[72], 163) + << "incorrect value for certificate_bytes[72], expected 163, is " + << last_msg_->certificate_bytes[72]; + EXPECT_EQ(last_msg_->certificate_bytes[73], 214) + << "incorrect value for certificate_bytes[73], expected 214, is " + << last_msg_->certificate_bytes[73]; + EXPECT_EQ(last_msg_->certificate_bytes[74], 138) + << "incorrect value for certificate_bytes[74], expected 138, is " + << last_msg_->certificate_bytes[74]; + EXPECT_EQ(last_msg_->certificate_bytes[75], 123) + << "incorrect value for certificate_bytes[75], expected 123, is " + << last_msg_->certificate_bytes[75]; + EXPECT_EQ(last_msg_->certificate_bytes[76], 76) + << "incorrect value for certificate_bytes[76], expected 76, is " + << last_msg_->certificate_bytes[76]; + EXPECT_EQ(last_msg_->certificate_bytes[77], 74) + << "incorrect value for certificate_bytes[77], expected 74, is " + << last_msg_->certificate_bytes[77]; + EXPECT_EQ(last_msg_->certificate_bytes[78], 237) + << "incorrect value for certificate_bytes[78], expected 237, is " + << last_msg_->certificate_bytes[78]; + EXPECT_EQ(last_msg_->certificate_bytes[79], 121) + << "incorrect value for certificate_bytes[79], expected 121, is " + << last_msg_->certificate_bytes[79]; + EXPECT_EQ(last_msg_->certificate_bytes[80], 13) + << "incorrect value for certificate_bytes[80], expected 13, is " + << last_msg_->certificate_bytes[80]; + EXPECT_EQ(last_msg_->certificate_bytes[81], 137) + << "incorrect value for certificate_bytes[81], expected 137, is " + << last_msg_->certificate_bytes[81]; + EXPECT_EQ(last_msg_->certificate_bytes[82], 186) + << "incorrect value for certificate_bytes[82], expected 186, is " + << last_msg_->certificate_bytes[82]; + EXPECT_EQ(last_msg_->certificate_bytes[83], 97) + << "incorrect value for certificate_bytes[83], expected 97, is " + << last_msg_->certificate_bytes[83]; + EXPECT_EQ(last_msg_->certificate_bytes[84], 193) + << "incorrect value for certificate_bytes[84], expected 193, is " + << last_msg_->certificate_bytes[84]; + EXPECT_EQ(last_msg_->certificate_bytes[85], 189) + << "incorrect value for certificate_bytes[85], expected 189, is " + << last_msg_->certificate_bytes[85]; + EXPECT_EQ(last_msg_->certificate_bytes[86], 200) + << "incorrect value for certificate_bytes[86], expected 200, is " + << last_msg_->certificate_bytes[86]; + EXPECT_EQ(last_msg_->certificate_bytes[87], 124) + << "incorrect value for certificate_bytes[87], expected 124, is " + << last_msg_->certificate_bytes[87]; + EXPECT_EQ(last_msg_->certificate_bytes[88], 69) + << "incorrect value for certificate_bytes[88], expected 69, is " + << last_msg_->certificate_bytes[88]; + EXPECT_EQ(last_msg_->certificate_bytes[89], 115) + << "incorrect value for certificate_bytes[89], expected 115, is " + << last_msg_->certificate_bytes[89]; + EXPECT_EQ(last_msg_->certificate_bytes[90], 230) + << "incorrect value for certificate_bytes[90], expected 230, is " + << last_msg_->certificate_bytes[90]; + EXPECT_EQ(last_msg_->certificate_bytes[91], 159) + << "incorrect value for certificate_bytes[91], expected 159, is " + << last_msg_->certificate_bytes[91]; + EXPECT_EQ(last_msg_->certificate_bytes[92], 185) + << "incorrect value for certificate_bytes[92], expected 185, is " + << last_msg_->certificate_bytes[92]; + EXPECT_EQ(last_msg_->certificate_bytes[93], 158) + << "incorrect value for certificate_bytes[93], expected 158, is " + << last_msg_->certificate_bytes[93]; + EXPECT_EQ(last_msg_->certificate_bytes[94], 51) + << "incorrect value for certificate_bytes[94], expected 51, is " + << last_msg_->certificate_bytes[94]; + EXPECT_EQ(last_msg_->certificate_bytes[95], 12) + << "incorrect value for certificate_bytes[95], expected 12, is " + << last_msg_->certificate_bytes[95]; + EXPECT_EQ(last_msg_->certificate_bytes[96], 225) + << "incorrect value for certificate_bytes[96], expected 225, is " + << last_msg_->certificate_bytes[96]; + EXPECT_EQ(last_msg_->certificate_bytes[97], 65) + << "incorrect value for certificate_bytes[97], expected 65, is " + << last_msg_->certificate_bytes[97]; + EXPECT_EQ(last_msg_->certificate_bytes[98], 192) + << "incorrect value for certificate_bytes[98], expected 192, is " + << last_msg_->certificate_bytes[98]; + EXPECT_EQ(last_msg_->certificate_bytes[99], 105) + << "incorrect value for certificate_bytes[99], expected 105, is " + << last_msg_->certificate_bytes[99]; + EXPECT_EQ(last_msg_->certificate_bytes[100], 56) + << "incorrect value for certificate_bytes[100], expected 56, is " + << last_msg_->certificate_bytes[100]; + EXPECT_EQ(last_msg_->certificate_bytes[101], 41) + << "incorrect value for certificate_bytes[101], expected 41, is " + << last_msg_->certificate_bytes[101]; + EXPECT_EQ(last_msg_->certificate_bytes[102], 85) + << "incorrect value for certificate_bytes[102], expected 85, is " + << last_msg_->certificate_bytes[102]; + EXPECT_EQ(last_msg_->certificate_bytes[103], 133) + << "incorrect value for certificate_bytes[103], expected 133, is " + << last_msg_->certificate_bytes[103]; + EXPECT_EQ(last_msg_->certificate_bytes[104], 19) + << "incorrect value for certificate_bytes[104], expected 19, is " + << last_msg_->certificate_bytes[104]; + EXPECT_EQ(last_msg_->certificate_bytes[105], 217) + << "incorrect value for certificate_bytes[105], expected 217, is " + << last_msg_->certificate_bytes[105]; + EXPECT_EQ(last_msg_->certificate_bytes[106], 166) + << "incorrect value for certificate_bytes[106], expected 166, is " + << last_msg_->certificate_bytes[106]; + EXPECT_EQ(last_msg_->certificate_bytes[107], 48) + << "incorrect value for certificate_bytes[107], expected 48, is " + << last_msg_->certificate_bytes[107]; + EXPECT_EQ(last_msg_->certificate_bytes[108], 139) + << "incorrect value for certificate_bytes[108], expected 139, is " + << last_msg_->certificate_bytes[108]; + EXPECT_EQ(last_msg_->certificate_bytes[109], 131) + << "incorrect value for certificate_bytes[109], expected 131, is " + << last_msg_->certificate_bytes[109]; + EXPECT_EQ(last_msg_->certificate_bytes[110], 96) + << "incorrect value for certificate_bytes[110], expected 96, is " + << last_msg_->certificate_bytes[110]; + EXPECT_EQ(last_msg_->certificate_bytes[111], 216) + << "incorrect value for certificate_bytes[111], expected 216, is " + << last_msg_->certificate_bytes[111]; + EXPECT_EQ(last_msg_->certificate_bytes[112], 98) + << "incorrect value for certificate_bytes[112], expected 98, is " + << last_msg_->certificate_bytes[112]; + EXPECT_EQ(last_msg_->certificate_bytes[113], 147) + << "incorrect value for certificate_bytes[113], expected 147, is " + << last_msg_->certificate_bytes[113]; + EXPECT_EQ(last_msg_->certificate_bytes[114], 132) + << "incorrect value for certificate_bytes[114], expected 132, is " + << last_msg_->certificate_bytes[114]; + EXPECT_EQ(last_msg_->certificate_bytes[115], 234) + << "incorrect value for certificate_bytes[115], expected 234, is " + << last_msg_->certificate_bytes[115]; + EXPECT_EQ(last_msg_->certificate_bytes[116], 167) + << "incorrect value for certificate_bytes[116], expected 167, is " + << last_msg_->certificate_bytes[116]; + EXPECT_EQ(last_msg_->certificate_bytes[117], 248) + << "incorrect value for certificate_bytes[117], expected 248, is " + << last_msg_->certificate_bytes[117]; + EXPECT_EQ(last_msg_->certificate_bytes[118], 247) + << "incorrect value for certificate_bytes[118], expected 247, is " + << last_msg_->certificate_bytes[118]; + EXPECT_EQ(last_msg_->certificate_bytes[119], 32) + << "incorrect value for certificate_bytes[119], expected 32, is " + << last_msg_->certificate_bytes[119]; + EXPECT_EQ(last_msg_->certificate_bytes[120], 239) + << "incorrect value for certificate_bytes[120], expected 239, is " + << last_msg_->certificate_bytes[120]; + EXPECT_EQ(last_msg_->certificate_bytes[121], 194) + << "incorrect value for certificate_bytes[121], expected 194, is " + << last_msg_->certificate_bytes[121]; + EXPECT_EQ(last_msg_->certificate_bytes[122], 188) + << "incorrect value for certificate_bytes[122], expected 188, is " + << last_msg_->certificate_bytes[122]; + EXPECT_EQ(last_msg_->certificate_bytes[123], 254) + << "incorrect value for certificate_bytes[123], expected 254, is " + << last_msg_->certificate_bytes[123]; + EXPECT_EQ(last_msg_->certificate_bytes[124], 114) + << "incorrect value for certificate_bytes[124], expected 114, is " + << last_msg_->certificate_bytes[124]; + EXPECT_EQ(last_msg_->certificate_bytes[125], 117) + << "incorrect value for certificate_bytes[125], expected 117, is " + << last_msg_->certificate_bytes[125]; + EXPECT_EQ(last_msg_->certificate_bytes[126], 83) + << "incorrect value for certificate_bytes[126], expected 83, is " + << last_msg_->certificate_bytes[126]; + EXPECT_EQ(last_msg_->certificate_bytes[127], 25) + << "incorrect value for certificate_bytes[127], expected 25, is " + << last_msg_->certificate_bytes[127]; + EXPECT_EQ(last_msg_->certificate_bytes[128], 251) + << "incorrect value for certificate_bytes[128], expected 251, is " + << last_msg_->certificate_bytes[128]; + EXPECT_EQ(last_msg_->certificate_bytes[129], 191) + << "incorrect value for certificate_bytes[129], expected 191, is " + << last_msg_->certificate_bytes[129]; + EXPECT_EQ(last_msg_->certificate_bytes[130], 104) + << "incorrect value for certificate_bytes[130], expected 104, is " + << last_msg_->certificate_bytes[130]; + EXPECT_EQ(last_msg_->certificate_bytes[131], 240) + << "incorrect value for certificate_bytes[131], expected 240, is " + << last_msg_->certificate_bytes[131]; + EXPECT_EQ(last_msg_->certificate_bytes[132], 118) + << "incorrect value for certificate_bytes[132], expected 118, is " + << last_msg_->certificate_bytes[132]; + EXPECT_EQ(last_msg_->certificate_bytes[133], 68) + << "incorrect value for certificate_bytes[133], expected 68, is " + << last_msg_->certificate_bytes[133]; + EXPECT_EQ(last_msg_->certificate_bytes[134], 42) + << "incorrect value for certificate_bytes[134], expected 42, is " + << last_msg_->certificate_bytes[134]; + EXPECT_EQ(last_msg_->certificate_bytes[135], 93) + << "incorrect value for certificate_bytes[135], expected 93, is " + << last_msg_->certificate_bytes[135]; + EXPECT_EQ(last_msg_->certificate_bytes[136], 18) + << "incorrect value for certificate_bytes[136], expected 18, is " + << last_msg_->certificate_bytes[136]; + EXPECT_EQ(last_msg_->certificate_bytes[137], 16) + << "incorrect value for certificate_bytes[137], expected 16, is " + << last_msg_->certificate_bytes[137]; + EXPECT_EQ(last_msg_->certificate_bytes[138], 37) + << "incorrect value for certificate_bytes[138], expected 37, is " + << last_msg_->certificate_bytes[138]; + EXPECT_EQ(last_msg_->certificate_bytes[139], 232) + << "incorrect value for certificate_bytes[139], expected 232, is " + << last_msg_->certificate_bytes[139]; + EXPECT_EQ(last_msg_->certificate_bytes[140], 99) + << "incorrect value for certificate_bytes[140], expected 99, is " + << last_msg_->certificate_bytes[140]; + EXPECT_EQ(last_msg_->certificate_bytes[141], 179) + << "incorrect value for certificate_bytes[141], expected 179, is " + << last_msg_->certificate_bytes[141]; + EXPECT_EQ(last_msg_->certificate_bytes[142], 23) + << "incorrect value for certificate_bytes[142], expected 23, is " + << last_msg_->certificate_bytes[142]; + EXPECT_EQ(last_msg_->certificate_bytes[143], 90) + << "incorrect value for certificate_bytes[143], expected 90, is " + << last_msg_->certificate_bytes[143]; + EXPECT_EQ(last_msg_->certificate_bytes[144], 94) + << "incorrect value for certificate_bytes[144], expected 94, is " + << last_msg_->certificate_bytes[144]; + EXPECT_EQ(last_msg_->certificate_bytes[145], 136) + << "incorrect value for certificate_bytes[145], expected 136, is " + << last_msg_->certificate_bytes[145]; + EXPECT_EQ(last_msg_->certificate_bytes[146], 6) + << "incorrect value for certificate_bytes[146], expected 6, is " + << last_msg_->certificate_bytes[146]; + EXPECT_EQ(last_msg_->certificate_bytes[147], 125) + << "incorrect value for certificate_bytes[147], expected 125, is " + << last_msg_->certificate_bytes[147]; + EXPECT_EQ(last_msg_->certificate_bytes[148], 91) + << "incorrect value for certificate_bytes[148], expected 91, is " + << last_msg_->certificate_bytes[148]; + EXPECT_EQ(last_msg_->certificate_bytes[149], 255) + << "incorrect value for certificate_bytes[149], expected 255, is " + << last_msg_->certificate_bytes[149]; + EXPECT_EQ(last_msg_->certificate_bytes[150], 15) + << "incorrect value for certificate_bytes[150], expected 15, is " + << last_msg_->certificate_bytes[150]; + EXPECT_EQ(last_msg_->certificate_bytes[151], 71) + << "incorrect value for certificate_bytes[151], expected 71, is " + << last_msg_->certificate_bytes[151]; + EXPECT_EQ(last_msg_->certificate_bytes[152], 43) + << "incorrect value for certificate_bytes[152], expected 43, is " + << last_msg_->certificate_bytes[152]; + EXPECT_EQ(last_msg_->certificate_bytes[153], 46) + << "incorrect value for certificate_bytes[153], expected 46, is " + << last_msg_->certificate_bytes[153]; + EXPECT_EQ(last_msg_->certificate_bytes[154], 25) + << "incorrect value for certificate_bytes[154], expected 25, is " + << last_msg_->certificate_bytes[154]; + EXPECT_EQ(last_msg_->certificate_bytes[155], 252) + << "incorrect value for certificate_bytes[155], expected 252, is " + << last_msg_->certificate_bytes[155]; + EXPECT_EQ(last_msg_->certificate_bytes[156], 229) + << "incorrect value for certificate_bytes[156], expected 229, is " + << last_msg_->certificate_bytes[156]; + EXPECT_EQ(last_msg_->certificate_bytes[157], 80) + << "incorrect value for certificate_bytes[157], expected 80, is " + << last_msg_->certificate_bytes[157]; + EXPECT_EQ(last_msg_->certificate_bytes[158], 143) + << "incorrect value for certificate_bytes[158], expected 143, is " + << last_msg_->certificate_bytes[158]; + EXPECT_EQ(last_msg_->certificate_bytes[159], 58) + << "incorrect value for certificate_bytes[159], expected 58, is " + << last_msg_->certificate_bytes[159]; + EXPECT_EQ(last_msg_->certificate_bytes[160], 241) + << "incorrect value for certificate_bytes[160], expected 241, is " + << last_msg_->certificate_bytes[160]; + EXPECT_EQ(last_msg_->certificate_bytes[161], 11) + << "incorrect value for certificate_bytes[161], expected 11, is " + << last_msg_->certificate_bytes[161]; + EXPECT_EQ(last_msg_->certificate_bytes[162], 62) + << "incorrect value for certificate_bytes[162], expected 62, is " + << last_msg_->certificate_bytes[162]; + EXPECT_EQ(last_msg_->certificate_bytes[163], 181) + << "incorrect value for certificate_bytes[163], expected 181, is " + << last_msg_->certificate_bytes[163]; + EXPECT_EQ(last_msg_->certificate_bytes[164], 155) + << "incorrect value for certificate_bytes[164], expected 155, is " + << last_msg_->certificate_bytes[164]; + EXPECT_EQ(last_msg_->certificate_bytes[165], 53) + << "incorrect value for certificate_bytes[165], expected 53, is " + << last_msg_->certificate_bytes[165]; + EXPECT_EQ(last_msg_->certificate_bytes[166], 153) + << "incorrect value for certificate_bytes[166], expected 153, is " + << last_msg_->certificate_bytes[166]; + EXPECT_EQ(last_msg_->certificate_bytes[167], 149) + << "incorrect value for certificate_bytes[167], expected 149, is " + << last_msg_->certificate_bytes[167]; + EXPECT_EQ(last_msg_->certificate_bytes[168], 152) + << "incorrect value for certificate_bytes[168], expected 152, is " + << last_msg_->certificate_bytes[168]; + EXPECT_EQ(last_msg_->certificate_bytes[169], 227) + << "incorrect value for certificate_bytes[169], expected 227, is " + << last_msg_->certificate_bytes[169]; + EXPECT_EQ(last_msg_->certificate_bytes[170], 150) + << "incorrect value for certificate_bytes[170], expected 150, is " + << last_msg_->certificate_bytes[170]; + EXPECT_EQ(last_msg_->certificate_bytes[171], 87) + << "incorrect value for certificate_bytes[171], expected 87, is " + << last_msg_->certificate_bytes[171]; + EXPECT_EQ(last_msg_->certificate_bytes[172], 112) + << "incorrect value for certificate_bytes[172], expected 112, is " + << last_msg_->certificate_bytes[172]; + EXPECT_EQ(last_msg_->certificate_bytes[173], 165) + << "incorrect value for certificate_bytes[173], expected 165, is " + << last_msg_->certificate_bytes[173]; + EXPECT_EQ(last_msg_->certificate_bytes[174], 2) + << "incorrect value for certificate_bytes[174], expected 2, is " + << last_msg_->certificate_bytes[174]; + EXPECT_EQ(last_msg_->certificate_bytes[175], 128) + << "incorrect value for certificate_bytes[175], expected 128, is " + << last_msg_->certificate_bytes[175]; + EXPECT_EQ(last_msg_->certificate_bytes[176], 231) + << "incorrect value for certificate_bytes[176], expected 231, is " + << last_msg_->certificate_bytes[176]; + EXPECT_EQ(last_msg_->certificate_bytes[177], 25) + << "incorrect value for certificate_bytes[177], expected 25, is " + << last_msg_->certificate_bytes[177]; + EXPECT_EQ(last_msg_->certificate_bytes[178], 157) + << "incorrect value for certificate_bytes[178], expected 157, is " + << last_msg_->certificate_bytes[178]; + EXPECT_EQ(last_msg_->certificate_bytes[179], 244) + << "incorrect value for certificate_bytes[179], expected 244, is " + << last_msg_->certificate_bytes[179]; + EXPECT_EQ(last_msg_->certificate_bytes[180], 204) + << "incorrect value for certificate_bytes[180], expected 204, is " + << last_msg_->certificate_bytes[180]; + EXPECT_EQ(last_msg_->certificate_bytes[181], 108) + << "incorrect value for certificate_bytes[181], expected 108, is " + << last_msg_->certificate_bytes[181]; + EXPECT_EQ(last_msg_->certificate_bytes[182], 253) + << "incorrect value for certificate_bytes[182], expected 253, is " + << last_msg_->certificate_bytes[182]; + EXPECT_EQ(last_msg_->certificate_bytes[183], 127) + << "incorrect value for certificate_bytes[183], expected 127, is " + << last_msg_->certificate_bytes[183]; + EXPECT_EQ(last_msg_->certificate_bytes[184], 122) + << "incorrect value for certificate_bytes[184], expected 122, is " + << last_msg_->certificate_bytes[184]; + EXPECT_EQ(last_msg_->certificate_bytes[185], 145) + << "incorrect value for certificate_bytes[185], expected 145, is " + << last_msg_->certificate_bytes[185]; + EXPECT_EQ(last_msg_->certificate_bytes[186], 113) + << "incorrect value for certificate_bytes[186], expected 113, is " + << last_msg_->certificate_bytes[186]; + EXPECT_EQ(last_msg_->certificate_bytes[187], 162) + << "incorrect value for certificate_bytes[187], expected 162, is " + << last_msg_->certificate_bytes[187]; + EXPECT_EQ(last_msg_->certificate_bytes[188], 197) + << "incorrect value for certificate_bytes[188], expected 197, is " + << last_msg_->certificate_bytes[188]; + EXPECT_EQ(last_msg_->certificate_bytes[189], 171) + << "incorrect value for certificate_bytes[189], expected 171, is " + << last_msg_->certificate_bytes[189]; + EXPECT_EQ(last_msg_->certificate_bytes[190], 199) + << "incorrect value for certificate_bytes[190], expected 199, is " + << last_msg_->certificate_bytes[190]; + EXPECT_EQ(last_msg_->certificate_bytes[191], 54) + << "incorrect value for certificate_bytes[191], expected 54, is " + << last_msg_->certificate_bytes[191]; + EXPECT_EQ(last_msg_->certificate_bytes[192], 184) + << "incorrect value for certificate_bytes[192], expected 184, is " + << last_msg_->certificate_bytes[192]; + EXPECT_EQ(last_msg_->certificate_bytes[193], 222) + << "incorrect value for certificate_bytes[193], expected 222, is " + << last_msg_->certificate_bytes[193]; + EXPECT_EQ(last_msg_->certificate_bytes[194], 206) + << "incorrect value for certificate_bytes[194], expected 206, is " + << last_msg_->certificate_bytes[194]; + EXPECT_EQ(last_msg_->certificate_bytes[195], 67) + << "incorrect value for certificate_bytes[195], expected 67, is " + << last_msg_->certificate_bytes[195]; + EXPECT_EQ(last_msg_->certificate_bytes[196], 144) + << "incorrect value for certificate_bytes[196], expected 144, is " + << last_msg_->certificate_bytes[196]; + EXPECT_EQ(last_msg_->certificate_bytes[197], 78) + << "incorrect value for certificate_bytes[197], expected 78, is " + << last_msg_->certificate_bytes[197]; + EXPECT_EQ(last_msg_->certificate_bytes[198], 187) + << "incorrect value for certificate_bytes[198], expected 187, is " + << last_msg_->certificate_bytes[198]; + EXPECT_EQ(last_msg_->certificate_bytes[199], 207) + << "incorrect value for certificate_bytes[199], expected 207, is " + << last_msg_->certificate_bytes[199]; + EXPECT_EQ(last_msg_->certificate_bytes[200], 60) + << "incorrect value for certificate_bytes[200], expected 60, is " + << last_msg_->certificate_bytes[200]; + EXPECT_EQ(last_msg_->certificate_bytes[201], 211) + << "incorrect value for certificate_bytes[201], expected 211, is " + << last_msg_->certificate_bytes[201]; + EXPECT_EQ(last_msg_->certificate_bytes[202], 141) + << "incorrect value for certificate_bytes[202], expected 141, is " + << last_msg_->certificate_bytes[202]; + EXPECT_EQ(last_msg_->certificate_bytes[203], 135) + << "incorrect value for certificate_bytes[203], expected 135, is " + << last_msg_->certificate_bytes[203]; + EXPECT_EQ(last_msg_->certificate_bytes[204], 106) + << "incorrect value for certificate_bytes[204], expected 106, is " + << last_msg_->certificate_bytes[204]; + EXPECT_EQ(last_msg_->certificate_bytes[205], 220) + << "incorrect value for certificate_bytes[205], expected 220, is " + << last_msg_->certificate_bytes[205]; + EXPECT_EQ(last_msg_->certificate_bytes[206], 79) + << "incorrect value for certificate_bytes[206], expected 79, is " + << last_msg_->certificate_bytes[206]; + EXPECT_EQ(last_msg_->certificate_bytes[207], 183) + << "incorrect value for certificate_bytes[207], expected 183, is " + << last_msg_->certificate_bytes[207]; + EXPECT_EQ(last_msg_->certificate_bytes[208], 245) + << "incorrect value for certificate_bytes[208], expected 245, is " + << last_msg_->certificate_bytes[208]; + EXPECT_EQ(last_msg_->certificate_bytes[209], 21) + << "incorrect value for certificate_bytes[209], expected 21, is " + << last_msg_->certificate_bytes[209]; + EXPECT_EQ(last_msg_->certificate_bytes[210], 161) + << "incorrect value for certificate_bytes[210], expected 161, is " + << last_msg_->certificate_bytes[210]; + EXPECT_EQ(last_msg_->certificate_bytes[211], 168) + << "incorrect value for certificate_bytes[211], expected 168, is " + << last_msg_->certificate_bytes[211]; + EXPECT_EQ(last_msg_->certificate_bytes[212], 34) + << "incorrect value for certificate_bytes[212], expected 34, is " + << last_msg_->certificate_bytes[212]; + EXPECT_EQ(last_msg_->certificate_bytes[213], 129) + << "incorrect value for certificate_bytes[213], expected 129, is " + << last_msg_->certificate_bytes[213]; + EXPECT_EQ(last_msg_->certificate_bytes[214], 50) + << "incorrect value for certificate_bytes[214], expected 50, is " + << last_msg_->certificate_bytes[214]; + EXPECT_EQ(last_msg_->certificate_bytes[215], 176) + << "incorrect value for certificate_bytes[215], expected 176, is " + << last_msg_->certificate_bytes[215]; + EXPECT_EQ(last_msg_->certificate_bytes[216], 1) + << "incorrect value for certificate_bytes[216], expected 1, is " + << last_msg_->certificate_bytes[216]; + EXPECT_EQ(last_msg_->certificate_bytes[217], 218) + << "incorrect value for certificate_bytes[217], expected 218, is " + << last_msg_->certificate_bytes[217]; + EXPECT_EQ(last_msg_->certificate_bytes[218], 20) + << "incorrect value for certificate_bytes[218], expected 20, is " + << last_msg_->certificate_bytes[218]; + EXPECT_EQ(last_msg_->certificate_bytes[219], 130) + << "incorrect value for certificate_bytes[219], expected 130, is " + << last_msg_->certificate_bytes[219]; + EXPECT_EQ(last_msg_->certificate_bytes[220], 59) + << "incorrect value for certificate_bytes[220], expected 59, is " + << last_msg_->certificate_bytes[220]; + EXPECT_EQ(last_msg_->certificate_bytes[221], 249) + << "incorrect value for certificate_bytes[221], expected 249, is " + << last_msg_->certificate_bytes[221]; + EXPECT_EQ(last_msg_->certificate_bytes[222], 109) + << "incorrect value for certificate_bytes[222], expected 109, is " + << last_msg_->certificate_bytes[222]; + EXPECT_EQ(last_msg_->certificate_bytes[223], 219) + << "incorrect value for certificate_bytes[223], expected 219, is " + << last_msg_->certificate_bytes[223]; + EXPECT_EQ(last_msg_->certificate_bytes[224], 0) + << "incorrect value for certificate_bytes[224], expected 0, is " + << last_msg_->certificate_bytes[224]; + EXPECT_EQ(last_msg_->certificate_bytes[225], 100) + << "incorrect value for certificate_bytes[225], expected 100, is " + << last_msg_->certificate_bytes[225]; + EXPECT_EQ(last_msg_->certificate_bytes[226], 103) + << "incorrect value for certificate_bytes[226], expected 103, is " + << last_msg_->certificate_bytes[226]; + EXPECT_EQ(last_msg_->certificate_bytes[227], 55) + << "incorrect value for certificate_bytes[227], expected 55, is " + << last_msg_->certificate_bytes[227]; + EXPECT_EQ(last_msg_->certificate_bytes[228], 29) + << "incorrect value for certificate_bytes[228], expected 29, is " + << last_msg_->certificate_bytes[228]; + EXPECT_EQ(last_msg_->certificate_bytes[229], 242) + << "incorrect value for certificate_bytes[229], expected 242, is " + << last_msg_->certificate_bytes[229]; + EXPECT_EQ(last_msg_->certificate_bytes[230], 110) + << "incorrect value for certificate_bytes[230], expected 110, is " + << last_msg_->certificate_bytes[230]; + EXPECT_EQ(last_msg_->certificate_bytes[231], 154) + << "incorrect value for certificate_bytes[231], expected 154, is " + << last_msg_->certificate_bytes[231]; + EXPECT_EQ(last_msg_->certificate_bytes[232], 190) + << "incorrect value for certificate_bytes[232], expected 190, is " + << last_msg_->certificate_bytes[232]; + EXPECT_EQ(last_msg_->certificate_bytes[233], 233) + << "incorrect value for certificate_bytes[233], expected 233, is " + << last_msg_->certificate_bytes[233]; + EXPECT_EQ(last_msg_->certificate_bytes[234], 142) + << "incorrect value for certificate_bytes[234], expected 142, is " + << last_msg_->certificate_bytes[234]; + EXPECT_EQ(last_msg_->certificate_bytes[235], 45) + << "incorrect value for certificate_bytes[235], expected 45, is " + << last_msg_->certificate_bytes[235]; + EXPECT_EQ(last_msg_->certificate_bytes[236], 61) + << "incorrect value for certificate_bytes[236], expected 61, is " + << last_msg_->certificate_bytes[236]; + EXPECT_EQ(last_msg_->certificate_bytes[237], 215) + << "incorrect value for certificate_bytes[237], expected 215, is " + << last_msg_->certificate_bytes[237]; + EXPECT_EQ(last_msg_->certificate_bytes[238], 202) + << "incorrect value for certificate_bytes[238], expected 202, is " + << last_msg_->certificate_bytes[238]; + EXPECT_EQ(last_msg_->certificate_bytes[239], 238) + << "incorrect value for certificate_bytes[239], expected 238, is " + << last_msg_->certificate_bytes[239]; + EXPECT_EQ(last_msg_->certificate_bytes[240], 88) + << "incorrect value for certificate_bytes[240], expected 88, is " + << last_msg_->certificate_bytes[240]; + EXPECT_EQ(last_msg_->certificate_bytes[241], 209) + << "incorrect value for certificate_bytes[241], expected 209, is " + << last_msg_->certificate_bytes[241]; + EXPECT_EQ(last_msg_->certificate_bytes[242], 70) + << "incorrect value for certificate_bytes[242], expected 70, is " + << last_msg_->certificate_bytes[242]; + EXPECT_EQ(last_msg_->certificate_bytes[243], 63) + << "incorrect value for certificate_bytes[243], expected 63, is " + << last_msg_->certificate_bytes[243]; + EXPECT_EQ(last_msg_->certificate_bytes[244], 151) + << "incorrect value for certificate_bytes[244], expected 151, is " + << last_msg_->certificate_bytes[244]; + EXPECT_EQ(last_msg_->certificate_bytes[245], 27) + << "incorrect value for certificate_bytes[245], expected 27, is " + << last_msg_->certificate_bytes[245]; + EXPECT_EQ(last_msg_->certificate_bytes[246], 102) + << "incorrect value for certificate_bytes[246], expected 102, is " + << last_msg_->certificate_bytes[246]; + EXPECT_EQ(last_msg_->certificate_id[0], 10) + << "incorrect value for certificate_id[0], expected 10, is " + << last_msg_->certificate_id[0]; + EXPECT_EQ(last_msg_->certificate_id[1], 11) + << "incorrect value for certificate_id[1], expected 11, is " + << last_msg_->certificate_id[1]; + EXPECT_EQ(last_msg_->certificate_id[2], 12) + << "incorrect value for certificate_id[2], expected 12, is " + << last_msg_->certificate_id[2]; + EXPECT_EQ(last_msg_->certificate_id[3], 13) + << "incorrect value for certificate_id[3], expected 13, is " + << last_msg_->certificate_id[3]; + EXPECT_EQ(last_msg_->flags, 2) + << "incorrect value for flags, expected 2, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_msg, 48) + << "incorrect value for n_msg, expected 48, is " << last_msg_->n_msg; } diff --git a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc index aed65dc04..df815fa05 100644 --- a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc +++ b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignature0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_signing_MsgEcdsaSignature0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignature0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_signing_MsgEcdsaSignature0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ecdsa_signature_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ecdsa_signature_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,515 +81,764 @@ class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignature0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ecdsa_signature_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaSignature0, Test) -{ +}; - uint8_t encoded_frame[] = {85,8,12,66,0,83,0,1,2,1,2,3,4,72,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,10,21,23,232,131, }; +TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaSignature0, Test) { + uint8_t encoded_frame[] = { + 85, 8, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 232, 131, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ecdsa_signature_t* test_msg = ( msg_ecdsa_signature_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[0] = 1; - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[1] = 2; - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[2] = 3; - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[3] = 4; - test_msg->flags = 0; - test_msg->on_demand_counter = 2; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[0] = 0; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[1] = 1; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[2] = 2; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[3] = 3; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[4] = 4; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[5] = 5; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[6] = 6; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[7] = 7; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[8] = 8; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[9] = 9; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[10] = 10; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[11] = 11; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[12] = 12; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[13] = 13; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[14] = 14; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[15] = 15; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[16] = 16; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[17] = 17; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[18] = 18; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[19] = 19; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[20] = 20; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[21] = 21; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[22] = 22; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[23] = 23; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[24] = 24; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[25] = 25; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[26] = 26; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[27] = 27; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[28] = 28; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[29] = 29; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[30] = 30; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[31] = 31; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[32] = 32; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[33] = 33; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[34] = 34; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[35] = 35; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[36] = 36; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[37] = 37; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[38] = 38; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[39] = 39; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[40] = 40; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[41] = 41; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[42] = 42; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[43] = 43; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[44] = 44; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[45] = 45; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[46] = 46; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[47] = 47; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[48] = 48; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[49] = 49; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[50] = 50; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[51] = 51; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[52] = 52; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[53] = 53; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[54] = 54; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[55] = 55; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[56] = 56; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[57] = 57; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[58] = 58; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[59] = 59; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[60] = 60; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[61] = 61; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[62] = 62; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[63] = 63; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[64] = 64; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[65] = 65; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[66] = 66; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[67] = 67; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[68] = 68; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[69] = 69; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[70] = 70; - if (sizeof(test_msg->signature.data) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); - } - test_msg->signature.data[71] = 71; - test_msg->signature.len = 72; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[0] = 10; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[1] = 21; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[2] = 23; - test_msg->stream_counter = 1; - - EXPECT_EQ(send_message( 0xC08, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ecdsa_signature_t *test_msg = (msg_ecdsa_signature_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[0] = 1; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[1] = 2; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[2] = 3; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[3] = 4; + test_msg->flags = 0; + test_msg->on_demand_counter = 2; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[0] = 0; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[1] = 1; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[2] = 2; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[3] = 3; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[4] = 4; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[5] = 5; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[6] = 6; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[7] = 7; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[8] = 8; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[9] = 9; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[10] = 10; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[11] = 11; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[12] = 12; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[13] = 13; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[14] = 14; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[15] = 15; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[16] = 16; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[17] = 17; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[18] = 18; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[19] = 19; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[20] = 20; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[21] = 21; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[22] = 22; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[23] = 23; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[24] = 24; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[25] = 25; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[26] = 26; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[27] = 27; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[28] = 28; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[29] = 29; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[30] = 30; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[31] = 31; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[32] = 32; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[33] = 33; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[34] = 34; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[35] = 35; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[36] = 36; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[37] = 37; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[38] = 38; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[39] = 39; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[40] = 40; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[41] = 41; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[42] = 42; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[43] = 43; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[44] = 44; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[45] = 45; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[46] = 46; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[47] = 47; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[48] = 48; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[49] = 49; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[50] = 50; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[51] = 51; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[52] = 52; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[53] = 53; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[54] = 54; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[55] = 55; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[56] = 56; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[57] = 57; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[58] = 58; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[59] = 59; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[60] = 60; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[61] = 61; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[62] = 62; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[63] = 63; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[64] = 64; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[65] = 65; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[66] = 66; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[67] = 67; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[68] = 68; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[69] = 69; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[70] = 70; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[71] = 71; + test_msg->signature.len = 72; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[0] = 10; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[1] = 21; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[2] = 23; + test_msg->stream_counter = 1; + + EXPECT_EQ(send_message(0xC08, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->certificate_id[0], 1) << "incorrect value for certificate_id[0], expected 1, is " << last_msg_->certificate_id[0]; - EXPECT_EQ(last_msg_->certificate_id[1], 2) << "incorrect value for certificate_id[1], expected 2, is " << last_msg_->certificate_id[1]; - EXPECT_EQ(last_msg_->certificate_id[2], 3) << "incorrect value for certificate_id[2], expected 3, is " << last_msg_->certificate_id[2]; - EXPECT_EQ(last_msg_->certificate_id[3], 4) << "incorrect value for certificate_id[3], expected 4, is " << last_msg_->certificate_id[3]; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->on_demand_counter, 2) << "incorrect value for on_demand_counter, expected 2, is " << last_msg_->on_demand_counter; - EXPECT_EQ(last_msg_->signature.data[0], 0) << "incorrect value for signature.data[0], expected 0, is " << last_msg_->signature.data[0]; - EXPECT_EQ(last_msg_->signature.data[1], 1) << "incorrect value for signature.data[1], expected 1, is " << last_msg_->signature.data[1]; - EXPECT_EQ(last_msg_->signature.data[2], 2) << "incorrect value for signature.data[2], expected 2, is " << last_msg_->signature.data[2]; - EXPECT_EQ(last_msg_->signature.data[3], 3) << "incorrect value for signature.data[3], expected 3, is " << last_msg_->signature.data[3]; - EXPECT_EQ(last_msg_->signature.data[4], 4) << "incorrect value for signature.data[4], expected 4, is " << last_msg_->signature.data[4]; - EXPECT_EQ(last_msg_->signature.data[5], 5) << "incorrect value for signature.data[5], expected 5, is " << last_msg_->signature.data[5]; - EXPECT_EQ(last_msg_->signature.data[6], 6) << "incorrect value for signature.data[6], expected 6, is " << last_msg_->signature.data[6]; - EXPECT_EQ(last_msg_->signature.data[7], 7) << "incorrect value for signature.data[7], expected 7, is " << last_msg_->signature.data[7]; - EXPECT_EQ(last_msg_->signature.data[8], 8) << "incorrect value for signature.data[8], expected 8, is " << last_msg_->signature.data[8]; - EXPECT_EQ(last_msg_->signature.data[9], 9) << "incorrect value for signature.data[9], expected 9, is " << last_msg_->signature.data[9]; - EXPECT_EQ(last_msg_->signature.data[10], 10) << "incorrect value for signature.data[10], expected 10, is " << last_msg_->signature.data[10]; - EXPECT_EQ(last_msg_->signature.data[11], 11) << "incorrect value for signature.data[11], expected 11, is " << last_msg_->signature.data[11]; - EXPECT_EQ(last_msg_->signature.data[12], 12) << "incorrect value for signature.data[12], expected 12, is " << last_msg_->signature.data[12]; - EXPECT_EQ(last_msg_->signature.data[13], 13) << "incorrect value for signature.data[13], expected 13, is " << last_msg_->signature.data[13]; - EXPECT_EQ(last_msg_->signature.data[14], 14) << "incorrect value for signature.data[14], expected 14, is " << last_msg_->signature.data[14]; - EXPECT_EQ(last_msg_->signature.data[15], 15) << "incorrect value for signature.data[15], expected 15, is " << last_msg_->signature.data[15]; - EXPECT_EQ(last_msg_->signature.data[16], 16) << "incorrect value for signature.data[16], expected 16, is " << last_msg_->signature.data[16]; - EXPECT_EQ(last_msg_->signature.data[17], 17) << "incorrect value for signature.data[17], expected 17, is " << last_msg_->signature.data[17]; - EXPECT_EQ(last_msg_->signature.data[18], 18) << "incorrect value for signature.data[18], expected 18, is " << last_msg_->signature.data[18]; - EXPECT_EQ(last_msg_->signature.data[19], 19) << "incorrect value for signature.data[19], expected 19, is " << last_msg_->signature.data[19]; - EXPECT_EQ(last_msg_->signature.data[20], 20) << "incorrect value for signature.data[20], expected 20, is " << last_msg_->signature.data[20]; - EXPECT_EQ(last_msg_->signature.data[21], 21) << "incorrect value for signature.data[21], expected 21, is " << last_msg_->signature.data[21]; - EXPECT_EQ(last_msg_->signature.data[22], 22) << "incorrect value for signature.data[22], expected 22, is " << last_msg_->signature.data[22]; - EXPECT_EQ(last_msg_->signature.data[23], 23) << "incorrect value for signature.data[23], expected 23, is " << last_msg_->signature.data[23]; - EXPECT_EQ(last_msg_->signature.data[24], 24) << "incorrect value for signature.data[24], expected 24, is " << last_msg_->signature.data[24]; - EXPECT_EQ(last_msg_->signature.data[25], 25) << "incorrect value for signature.data[25], expected 25, is " << last_msg_->signature.data[25]; - EXPECT_EQ(last_msg_->signature.data[26], 26) << "incorrect value for signature.data[26], expected 26, is " << last_msg_->signature.data[26]; - EXPECT_EQ(last_msg_->signature.data[27], 27) << "incorrect value for signature.data[27], expected 27, is " << last_msg_->signature.data[27]; - EXPECT_EQ(last_msg_->signature.data[28], 28) << "incorrect value for signature.data[28], expected 28, is " << last_msg_->signature.data[28]; - EXPECT_EQ(last_msg_->signature.data[29], 29) << "incorrect value for signature.data[29], expected 29, is " << last_msg_->signature.data[29]; - EXPECT_EQ(last_msg_->signature.data[30], 30) << "incorrect value for signature.data[30], expected 30, is " << last_msg_->signature.data[30]; - EXPECT_EQ(last_msg_->signature.data[31], 31) << "incorrect value for signature.data[31], expected 31, is " << last_msg_->signature.data[31]; - EXPECT_EQ(last_msg_->signature.data[32], 32) << "incorrect value for signature.data[32], expected 32, is " << last_msg_->signature.data[32]; - EXPECT_EQ(last_msg_->signature.data[33], 33) << "incorrect value for signature.data[33], expected 33, is " << last_msg_->signature.data[33]; - EXPECT_EQ(last_msg_->signature.data[34], 34) << "incorrect value for signature.data[34], expected 34, is " << last_msg_->signature.data[34]; - EXPECT_EQ(last_msg_->signature.data[35], 35) << "incorrect value for signature.data[35], expected 35, is " << last_msg_->signature.data[35]; - EXPECT_EQ(last_msg_->signature.data[36], 36) << "incorrect value for signature.data[36], expected 36, is " << last_msg_->signature.data[36]; - EXPECT_EQ(last_msg_->signature.data[37], 37) << "incorrect value for signature.data[37], expected 37, is " << last_msg_->signature.data[37]; - EXPECT_EQ(last_msg_->signature.data[38], 38) << "incorrect value for signature.data[38], expected 38, is " << last_msg_->signature.data[38]; - EXPECT_EQ(last_msg_->signature.data[39], 39) << "incorrect value for signature.data[39], expected 39, is " << last_msg_->signature.data[39]; - EXPECT_EQ(last_msg_->signature.data[40], 40) << "incorrect value for signature.data[40], expected 40, is " << last_msg_->signature.data[40]; - EXPECT_EQ(last_msg_->signature.data[41], 41) << "incorrect value for signature.data[41], expected 41, is " << last_msg_->signature.data[41]; - EXPECT_EQ(last_msg_->signature.data[42], 42) << "incorrect value for signature.data[42], expected 42, is " << last_msg_->signature.data[42]; - EXPECT_EQ(last_msg_->signature.data[43], 43) << "incorrect value for signature.data[43], expected 43, is " << last_msg_->signature.data[43]; - EXPECT_EQ(last_msg_->signature.data[44], 44) << "incorrect value for signature.data[44], expected 44, is " << last_msg_->signature.data[44]; - EXPECT_EQ(last_msg_->signature.data[45], 45) << "incorrect value for signature.data[45], expected 45, is " << last_msg_->signature.data[45]; - EXPECT_EQ(last_msg_->signature.data[46], 46) << "incorrect value for signature.data[46], expected 46, is " << last_msg_->signature.data[46]; - EXPECT_EQ(last_msg_->signature.data[47], 47) << "incorrect value for signature.data[47], expected 47, is " << last_msg_->signature.data[47]; - EXPECT_EQ(last_msg_->signature.data[48], 48) << "incorrect value for signature.data[48], expected 48, is " << last_msg_->signature.data[48]; - EXPECT_EQ(last_msg_->signature.data[49], 49) << "incorrect value for signature.data[49], expected 49, is " << last_msg_->signature.data[49]; - EXPECT_EQ(last_msg_->signature.data[50], 50) << "incorrect value for signature.data[50], expected 50, is " << last_msg_->signature.data[50]; - EXPECT_EQ(last_msg_->signature.data[51], 51) << "incorrect value for signature.data[51], expected 51, is " << last_msg_->signature.data[51]; - EXPECT_EQ(last_msg_->signature.data[52], 52) << "incorrect value for signature.data[52], expected 52, is " << last_msg_->signature.data[52]; - EXPECT_EQ(last_msg_->signature.data[53], 53) << "incorrect value for signature.data[53], expected 53, is " << last_msg_->signature.data[53]; - EXPECT_EQ(last_msg_->signature.data[54], 54) << "incorrect value for signature.data[54], expected 54, is " << last_msg_->signature.data[54]; - EXPECT_EQ(last_msg_->signature.data[55], 55) << "incorrect value for signature.data[55], expected 55, is " << last_msg_->signature.data[55]; - EXPECT_EQ(last_msg_->signature.data[56], 56) << "incorrect value for signature.data[56], expected 56, is " << last_msg_->signature.data[56]; - EXPECT_EQ(last_msg_->signature.data[57], 57) << "incorrect value for signature.data[57], expected 57, is " << last_msg_->signature.data[57]; - EXPECT_EQ(last_msg_->signature.data[58], 58) << "incorrect value for signature.data[58], expected 58, is " << last_msg_->signature.data[58]; - EXPECT_EQ(last_msg_->signature.data[59], 59) << "incorrect value for signature.data[59], expected 59, is " << last_msg_->signature.data[59]; - EXPECT_EQ(last_msg_->signature.data[60], 60) << "incorrect value for signature.data[60], expected 60, is " << last_msg_->signature.data[60]; - EXPECT_EQ(last_msg_->signature.data[61], 61) << "incorrect value for signature.data[61], expected 61, is " << last_msg_->signature.data[61]; - EXPECT_EQ(last_msg_->signature.data[62], 62) << "incorrect value for signature.data[62], expected 62, is " << last_msg_->signature.data[62]; - EXPECT_EQ(last_msg_->signature.data[63], 63) << "incorrect value for signature.data[63], expected 63, is " << last_msg_->signature.data[63]; - EXPECT_EQ(last_msg_->signature.data[64], 64) << "incorrect value for signature.data[64], expected 64, is " << last_msg_->signature.data[64]; - EXPECT_EQ(last_msg_->signature.data[65], 65) << "incorrect value for signature.data[65], expected 65, is " << last_msg_->signature.data[65]; - EXPECT_EQ(last_msg_->signature.data[66], 66) << "incorrect value for signature.data[66], expected 66, is " << last_msg_->signature.data[66]; - EXPECT_EQ(last_msg_->signature.data[67], 67) << "incorrect value for signature.data[67], expected 67, is " << last_msg_->signature.data[67]; - EXPECT_EQ(last_msg_->signature.data[68], 68) << "incorrect value for signature.data[68], expected 68, is " << last_msg_->signature.data[68]; - EXPECT_EQ(last_msg_->signature.data[69], 69) << "incorrect value for signature.data[69], expected 69, is " << last_msg_->signature.data[69]; - EXPECT_EQ(last_msg_->signature.data[70], 70) << "incorrect value for signature.data[70], expected 70, is " << last_msg_->signature.data[70]; - EXPECT_EQ(last_msg_->signature.data[71], 71) << "incorrect value for signature.data[71], expected 71, is " << last_msg_->signature.data[71]; - EXPECT_EQ(last_msg_->signature.len, 72) << "incorrect value for signature.len, expected 72, is " << last_msg_->signature.len; - EXPECT_EQ(last_msg_->signed_messages[0], 10) << "incorrect value for signed_messages[0], expected 10, is " << last_msg_->signed_messages[0]; - EXPECT_EQ(last_msg_->signed_messages[1], 21) << "incorrect value for signed_messages[1], expected 21, is " << last_msg_->signed_messages[1]; - EXPECT_EQ(last_msg_->signed_messages[2], 23) << "incorrect value for signed_messages[2], expected 23, is " << last_msg_->signed_messages[2]; - EXPECT_EQ(last_msg_->stream_counter, 1) << "incorrect value for stream_counter, expected 1, is " << last_msg_->stream_counter; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->certificate_id[0], 1) + << "incorrect value for certificate_id[0], expected 1, is " + << last_msg_->certificate_id[0]; + EXPECT_EQ(last_msg_->certificate_id[1], 2) + << "incorrect value for certificate_id[1], expected 2, is " + << last_msg_->certificate_id[1]; + EXPECT_EQ(last_msg_->certificate_id[2], 3) + << "incorrect value for certificate_id[2], expected 3, is " + << last_msg_->certificate_id[2]; + EXPECT_EQ(last_msg_->certificate_id[3], 4) + << "incorrect value for certificate_id[3], expected 4, is " + << last_msg_->certificate_id[3]; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->on_demand_counter, 2) + << "incorrect value for on_demand_counter, expected 2, is " + << last_msg_->on_demand_counter; + EXPECT_EQ(last_msg_->signature.data[0], 0) + << "incorrect value for signature.data[0], expected 0, is " + << last_msg_->signature.data[0]; + EXPECT_EQ(last_msg_->signature.data[1], 1) + << "incorrect value for signature.data[1], expected 1, is " + << last_msg_->signature.data[1]; + EXPECT_EQ(last_msg_->signature.data[2], 2) + << "incorrect value for signature.data[2], expected 2, is " + << last_msg_->signature.data[2]; + EXPECT_EQ(last_msg_->signature.data[3], 3) + << "incorrect value for signature.data[3], expected 3, is " + << last_msg_->signature.data[3]; + EXPECT_EQ(last_msg_->signature.data[4], 4) + << "incorrect value for signature.data[4], expected 4, is " + << last_msg_->signature.data[4]; + EXPECT_EQ(last_msg_->signature.data[5], 5) + << "incorrect value for signature.data[5], expected 5, is " + << last_msg_->signature.data[5]; + EXPECT_EQ(last_msg_->signature.data[6], 6) + << "incorrect value for signature.data[6], expected 6, is " + << last_msg_->signature.data[6]; + EXPECT_EQ(last_msg_->signature.data[7], 7) + << "incorrect value for signature.data[7], expected 7, is " + << last_msg_->signature.data[7]; + EXPECT_EQ(last_msg_->signature.data[8], 8) + << "incorrect value for signature.data[8], expected 8, is " + << last_msg_->signature.data[8]; + EXPECT_EQ(last_msg_->signature.data[9], 9) + << "incorrect value for signature.data[9], expected 9, is " + << last_msg_->signature.data[9]; + EXPECT_EQ(last_msg_->signature.data[10], 10) + << "incorrect value for signature.data[10], expected 10, is " + << last_msg_->signature.data[10]; + EXPECT_EQ(last_msg_->signature.data[11], 11) + << "incorrect value for signature.data[11], expected 11, is " + << last_msg_->signature.data[11]; + EXPECT_EQ(last_msg_->signature.data[12], 12) + << "incorrect value for signature.data[12], expected 12, is " + << last_msg_->signature.data[12]; + EXPECT_EQ(last_msg_->signature.data[13], 13) + << "incorrect value for signature.data[13], expected 13, is " + << last_msg_->signature.data[13]; + EXPECT_EQ(last_msg_->signature.data[14], 14) + << "incorrect value for signature.data[14], expected 14, is " + << last_msg_->signature.data[14]; + EXPECT_EQ(last_msg_->signature.data[15], 15) + << "incorrect value for signature.data[15], expected 15, is " + << last_msg_->signature.data[15]; + EXPECT_EQ(last_msg_->signature.data[16], 16) + << "incorrect value for signature.data[16], expected 16, is " + << last_msg_->signature.data[16]; + EXPECT_EQ(last_msg_->signature.data[17], 17) + << "incorrect value for signature.data[17], expected 17, is " + << last_msg_->signature.data[17]; + EXPECT_EQ(last_msg_->signature.data[18], 18) + << "incorrect value for signature.data[18], expected 18, is " + << last_msg_->signature.data[18]; + EXPECT_EQ(last_msg_->signature.data[19], 19) + << "incorrect value for signature.data[19], expected 19, is " + << last_msg_->signature.data[19]; + EXPECT_EQ(last_msg_->signature.data[20], 20) + << "incorrect value for signature.data[20], expected 20, is " + << last_msg_->signature.data[20]; + EXPECT_EQ(last_msg_->signature.data[21], 21) + << "incorrect value for signature.data[21], expected 21, is " + << last_msg_->signature.data[21]; + EXPECT_EQ(last_msg_->signature.data[22], 22) + << "incorrect value for signature.data[22], expected 22, is " + << last_msg_->signature.data[22]; + EXPECT_EQ(last_msg_->signature.data[23], 23) + << "incorrect value for signature.data[23], expected 23, is " + << last_msg_->signature.data[23]; + EXPECT_EQ(last_msg_->signature.data[24], 24) + << "incorrect value for signature.data[24], expected 24, is " + << last_msg_->signature.data[24]; + EXPECT_EQ(last_msg_->signature.data[25], 25) + << "incorrect value for signature.data[25], expected 25, is " + << last_msg_->signature.data[25]; + EXPECT_EQ(last_msg_->signature.data[26], 26) + << "incorrect value for signature.data[26], expected 26, is " + << last_msg_->signature.data[26]; + EXPECT_EQ(last_msg_->signature.data[27], 27) + << "incorrect value for signature.data[27], expected 27, is " + << last_msg_->signature.data[27]; + EXPECT_EQ(last_msg_->signature.data[28], 28) + << "incorrect value for signature.data[28], expected 28, is " + << last_msg_->signature.data[28]; + EXPECT_EQ(last_msg_->signature.data[29], 29) + << "incorrect value for signature.data[29], expected 29, is " + << last_msg_->signature.data[29]; + EXPECT_EQ(last_msg_->signature.data[30], 30) + << "incorrect value for signature.data[30], expected 30, is " + << last_msg_->signature.data[30]; + EXPECT_EQ(last_msg_->signature.data[31], 31) + << "incorrect value for signature.data[31], expected 31, is " + << last_msg_->signature.data[31]; + EXPECT_EQ(last_msg_->signature.data[32], 32) + << "incorrect value for signature.data[32], expected 32, is " + << last_msg_->signature.data[32]; + EXPECT_EQ(last_msg_->signature.data[33], 33) + << "incorrect value for signature.data[33], expected 33, is " + << last_msg_->signature.data[33]; + EXPECT_EQ(last_msg_->signature.data[34], 34) + << "incorrect value for signature.data[34], expected 34, is " + << last_msg_->signature.data[34]; + EXPECT_EQ(last_msg_->signature.data[35], 35) + << "incorrect value for signature.data[35], expected 35, is " + << last_msg_->signature.data[35]; + EXPECT_EQ(last_msg_->signature.data[36], 36) + << "incorrect value for signature.data[36], expected 36, is " + << last_msg_->signature.data[36]; + EXPECT_EQ(last_msg_->signature.data[37], 37) + << "incorrect value for signature.data[37], expected 37, is " + << last_msg_->signature.data[37]; + EXPECT_EQ(last_msg_->signature.data[38], 38) + << "incorrect value for signature.data[38], expected 38, is " + << last_msg_->signature.data[38]; + EXPECT_EQ(last_msg_->signature.data[39], 39) + << "incorrect value for signature.data[39], expected 39, is " + << last_msg_->signature.data[39]; + EXPECT_EQ(last_msg_->signature.data[40], 40) + << "incorrect value for signature.data[40], expected 40, is " + << last_msg_->signature.data[40]; + EXPECT_EQ(last_msg_->signature.data[41], 41) + << "incorrect value for signature.data[41], expected 41, is " + << last_msg_->signature.data[41]; + EXPECT_EQ(last_msg_->signature.data[42], 42) + << "incorrect value for signature.data[42], expected 42, is " + << last_msg_->signature.data[42]; + EXPECT_EQ(last_msg_->signature.data[43], 43) + << "incorrect value for signature.data[43], expected 43, is " + << last_msg_->signature.data[43]; + EXPECT_EQ(last_msg_->signature.data[44], 44) + << "incorrect value for signature.data[44], expected 44, is " + << last_msg_->signature.data[44]; + EXPECT_EQ(last_msg_->signature.data[45], 45) + << "incorrect value for signature.data[45], expected 45, is " + << last_msg_->signature.data[45]; + EXPECT_EQ(last_msg_->signature.data[46], 46) + << "incorrect value for signature.data[46], expected 46, is " + << last_msg_->signature.data[46]; + EXPECT_EQ(last_msg_->signature.data[47], 47) + << "incorrect value for signature.data[47], expected 47, is " + << last_msg_->signature.data[47]; + EXPECT_EQ(last_msg_->signature.data[48], 48) + << "incorrect value for signature.data[48], expected 48, is " + << last_msg_->signature.data[48]; + EXPECT_EQ(last_msg_->signature.data[49], 49) + << "incorrect value for signature.data[49], expected 49, is " + << last_msg_->signature.data[49]; + EXPECT_EQ(last_msg_->signature.data[50], 50) + << "incorrect value for signature.data[50], expected 50, is " + << last_msg_->signature.data[50]; + EXPECT_EQ(last_msg_->signature.data[51], 51) + << "incorrect value for signature.data[51], expected 51, is " + << last_msg_->signature.data[51]; + EXPECT_EQ(last_msg_->signature.data[52], 52) + << "incorrect value for signature.data[52], expected 52, is " + << last_msg_->signature.data[52]; + EXPECT_EQ(last_msg_->signature.data[53], 53) + << "incorrect value for signature.data[53], expected 53, is " + << last_msg_->signature.data[53]; + EXPECT_EQ(last_msg_->signature.data[54], 54) + << "incorrect value for signature.data[54], expected 54, is " + << last_msg_->signature.data[54]; + EXPECT_EQ(last_msg_->signature.data[55], 55) + << "incorrect value for signature.data[55], expected 55, is " + << last_msg_->signature.data[55]; + EXPECT_EQ(last_msg_->signature.data[56], 56) + << "incorrect value for signature.data[56], expected 56, is " + << last_msg_->signature.data[56]; + EXPECT_EQ(last_msg_->signature.data[57], 57) + << "incorrect value for signature.data[57], expected 57, is " + << last_msg_->signature.data[57]; + EXPECT_EQ(last_msg_->signature.data[58], 58) + << "incorrect value for signature.data[58], expected 58, is " + << last_msg_->signature.data[58]; + EXPECT_EQ(last_msg_->signature.data[59], 59) + << "incorrect value for signature.data[59], expected 59, is " + << last_msg_->signature.data[59]; + EXPECT_EQ(last_msg_->signature.data[60], 60) + << "incorrect value for signature.data[60], expected 60, is " + << last_msg_->signature.data[60]; + EXPECT_EQ(last_msg_->signature.data[61], 61) + << "incorrect value for signature.data[61], expected 61, is " + << last_msg_->signature.data[61]; + EXPECT_EQ(last_msg_->signature.data[62], 62) + << "incorrect value for signature.data[62], expected 62, is " + << last_msg_->signature.data[62]; + EXPECT_EQ(last_msg_->signature.data[63], 63) + << "incorrect value for signature.data[63], expected 63, is " + << last_msg_->signature.data[63]; + EXPECT_EQ(last_msg_->signature.data[64], 64) + << "incorrect value for signature.data[64], expected 64, is " + << last_msg_->signature.data[64]; + EXPECT_EQ(last_msg_->signature.data[65], 65) + << "incorrect value for signature.data[65], expected 65, is " + << last_msg_->signature.data[65]; + EXPECT_EQ(last_msg_->signature.data[66], 66) + << "incorrect value for signature.data[66], expected 66, is " + << last_msg_->signature.data[66]; + EXPECT_EQ(last_msg_->signature.data[67], 67) + << "incorrect value for signature.data[67], expected 67, is " + << last_msg_->signature.data[67]; + EXPECT_EQ(last_msg_->signature.data[68], 68) + << "incorrect value for signature.data[68], expected 68, is " + << last_msg_->signature.data[68]; + EXPECT_EQ(last_msg_->signature.data[69], 69) + << "incorrect value for signature.data[69], expected 69, is " + << last_msg_->signature.data[69]; + EXPECT_EQ(last_msg_->signature.data[70], 70) + << "incorrect value for signature.data[70], expected 70, is " + << last_msg_->signature.data[70]; + EXPECT_EQ(last_msg_->signature.data[71], 71) + << "incorrect value for signature.data[71], expected 71, is " + << last_msg_->signature.data[71]; + EXPECT_EQ(last_msg_->signature.len, 72) + << "incorrect value for signature.len, expected 72, is " + << last_msg_->signature.len; + EXPECT_EQ(last_msg_->signed_messages[0], 10) + << "incorrect value for signed_messages[0], expected 10, is " + << last_msg_->signed_messages[0]; + EXPECT_EQ(last_msg_->signed_messages[1], 21) + << "incorrect value for signed_messages[1], expected 21, is " + << last_msg_->signed_messages[1]; + EXPECT_EQ(last_msg_->signed_messages[2], 23) + << "incorrect value for signed_messages[2], expected 23, is " + << last_msg_->signed_messages[2]; + EXPECT_EQ(last_msg_->stream_counter, 1) + << "incorrect value for stream_counter, expected 1, is " + << last_msg_->stream_counter; } diff --git a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc index ffd0ccf95..7cede7d60 100644 --- a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ecdsa_signature_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ecdsa_signature_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,1551 +82,2266 @@ class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ecdsa_signature_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 6, 12, 66, 0, 255, 0, 1, 2, 1, 2, 3, 4, 0, 1, + 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, + 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, + 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, + 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, + 6, 7, 10, 21, 23, 63, 140, 37, 130, 106, 28, 40, 165, 179, 73, + 178, 60, 126, 114, 78, 113, 27, 95, 3, 62, 104, 145, 96, 19, 92, + 123, 14, 90, 153, 183, 9, 72, 81, 118, 112, 124, 16, 182, 76, 146, + 115, 58, 144, 17, 105, 66, 31, 135, 54, 100, 84, 181, 103, 11, 88, + 133, 155, 167, 173, 143, 86, 158, 20, 168, 132, 141, 102, 50, 48, 71, + 147, 53, 87, 1, 108, 138, 36, 134, 139, 163, 82, 43, 52, 150, 12, + 30, 110, 156, 107, 120, 91, 122, 69, 164, 170, 116, 25, 94, 5, 22, + 24, 162, 175, 38, 157, 98, 44, 160, 47, 97, 142, 8, 74, 13, 177, + 15, 128, 26, 131, 154, 65, 169, 55, 136, 125, 171, 161, 29, 129, 151, + 68, 166, 51, 70, 45, 56, 79, 149, 99, 42, 101, 152, 39, 89, 180, + 64, 49, 6, 80, 172, 32, 109, 2, 119, 93, 176, 0, 33, 57, 34, + 18, 85, 121, 137, 83, 111, 59, 7, 77, 4, 117, 159, 148, 35, 61, + 41, 67, 46, 127, 75, 174, 97, 172, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ecdsa_signature_dep_a_t *test_msg = + (msg_ecdsa_signature_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[0] = 1; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[1] = 2; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[2] = 3; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[3] = 4; + test_msg->flags = 0; + test_msg->on_demand_counter = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[0] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[1] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[2] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[3] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[4] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[5] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[6] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[7] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[8] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[9] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[10] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[11] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[12] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[13] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[14] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[15] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[16] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[17] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[18] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[19] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[20] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[21] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[22] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[23] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[24] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[25] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[26] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[27] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[28] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[29] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[30] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[31] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[32] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[33] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[34] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[35] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[36] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[37] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[38] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[39] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[40] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[41] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[42] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[43] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[44] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[45] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[46] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[47] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[48] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[49] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[50] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[51] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[52] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[53] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[54] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[55] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[56] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[57] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[58] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[59] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[60] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[61] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[62] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[63] = 7; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[0] = 10; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[1] = 21; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[2] = 23; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[3] = 63; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[4] = 140; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[5] = 37; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[6] = 130; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[7] = 106; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[8] = 28; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[9] = 40; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[10] = 165; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[11] = 179; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[12] = 73; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[13] = 178; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[14] = 60; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[15] = 126; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[16] = 114; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[17] = 78; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[18] = 113; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[19] = 27; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[20] = 95; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[21] = 3; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[22] = 62; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[23] = 104; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[24] = 145; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[25] = 96; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[26] = 19; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[27] = 92; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[28] = 123; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[29] = 14; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[30] = 90; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[31] = 153; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[32] = 183; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[33] = 9; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[34] = 72; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[35] = 81; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[36] = 118; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[37] = 112; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[38] = 124; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[39] = 16; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[40] = 182; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[41] = 76; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[42] = 146; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[43] = 115; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[44] = 58; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[45] = 144; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[46] = 17; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[47] = 105; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[48] = 66; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[49] = 31; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[50] = 135; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[51] = 54; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[52] = 100; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[53] = 84; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[54] = 181; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[55] = 103; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[56] = 11; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[57] = 88; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[58] = 133; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[59] = 155; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[60] = 167; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[61] = 173; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[62] = 143; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[63] = 86; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[64] = 158; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[65] = 20; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[66] = 168; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[67] = 132; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[68] = 141; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[69] = 102; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[70] = 50; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[71] = 48; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[72] = 71; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[73] = 147; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[74] = 53; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[75] = 87; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[76] = 1; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[77] = 108; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[78] = 138; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[79] = 36; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[80] = 134; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[81] = 139; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[82] = 163; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[83] = 82; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[84] = 43; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[85] = 52; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[86] = 150; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[87] = 12; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[88] = 30; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[89] = 110; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[90] = 156; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[91] = 107; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[92] = 120; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[93] = 91; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[94] = 122; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[95] = 69; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[96] = 164; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[97] = 170; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[98] = 116; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[99] = 25; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[100] = 94; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[101] = 5; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[102] = 22; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[103] = 24; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[104] = 162; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[105] = 175; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[106] = 38; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[107] = 157; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[108] = 98; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[109] = 44; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[110] = 160; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[111] = 47; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[112] = 97; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[113] = 142; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[114] = 8; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[115] = 74; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[116] = 13; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[117] = 177; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[118] = 15; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[119] = 128; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[120] = 26; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[121] = 131; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[122] = 154; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[123] = 65; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[124] = 169; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[125] = 55; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[126] = 136; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[127] = 125; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[128] = 171; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[129] = 161; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[130] = 29; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[131] = 129; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[132] = 151; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[133] = 68; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[134] = 166; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[135] = 51; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[136] = 70; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[137] = 45; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[138] = 56; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[139] = 79; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[140] = 149; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[141] = 99; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[142] = 42; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[143] = 101; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[144] = 152; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[145] = 39; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[146] = 89; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[147] = 180; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[148] = 64; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[149] = 49; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[150] = 6; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[151] = 80; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[152] = 172; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[153] = 32; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[154] = 109; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[155] = 2; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[156] = 119; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[157] = 93; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[158] = 176; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[159] = 0; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[160] = 33; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[161] = 57; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[162] = 34; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[163] = 18; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[164] = 85; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[165] = 121; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[166] = 137; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[167] = 83; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[168] = 111; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[169] = 59; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[170] = 7; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[171] = 77; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[172] = 4; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[173] = 117; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[174] = 159; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[175] = 148; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[176] = 35; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[177] = 61; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[178] = 41; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[179] = 67; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[180] = 46; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[181] = 127; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[182] = 75; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[183] = 174; + test_msg->stream_counter = 1; - uint8_t encoded_frame[] = {85,6,12,66,0,255,0,1,2,1,2,3,4,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,10,21,23,63,140,37,130,106,28,40,165,179,73,178,60,126,114,78,113,27,95,3,62,104,145,96,19,92,123,14,90,153,183,9,72,81,118,112,124,16,182,76,146,115,58,144,17,105,66,31,135,54,100,84,181,103,11,88,133,155,167,173,143,86,158,20,168,132,141,102,50,48,71,147,53,87,1,108,138,36,134,139,163,82,43,52,150,12,30,110,156,107,120,91,122,69,164,170,116,25,94,5,22,24,162,175,38,157,98,44,160,47,97,142,8,74,13,177,15,128,26,131,154,65,169,55,136,125,171,161,29,129,151,68,166,51,70,45,56,79,149,99,42,101,152,39,89,180,64,49,6,80,172,32,109,2,119,93,176,0,33,57,34,18,85,121,137,83,111,59,7,77,4,117,159,148,35,61,41,67,46,127,75,174,97,172, }; + EXPECT_EQ(send_message(0xC06, 66, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ecdsa_signature_dep_a_t* test_msg = ( msg_ecdsa_signature_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[0] = 1; - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[1] = 2; - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[2] = 3; - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[3] = 4; - test_msg->flags = 0; - test_msg->on_demand_counter = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[0] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[1] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[2] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[3] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[4] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[5] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[6] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[7] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[8] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[9] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[10] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[11] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[12] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[13] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[14] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[15] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[16] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[17] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[18] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[19] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[20] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[21] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[22] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[23] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[24] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[25] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[26] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[27] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[28] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[29] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[30] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[31] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[32] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[33] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[34] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[35] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[36] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[37] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[38] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[39] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[40] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[41] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[42] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[43] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[44] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[45] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[46] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[47] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[48] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[49] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[50] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[51] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[52] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[53] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[54] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[55] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[56] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[57] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[58] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[59] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[60] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[61] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[62] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[63] = 7; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[0] = 10; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[1] = 21; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[2] = 23; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[3] = 63; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[4] = 140; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[5] = 37; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[6] = 130; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[7] = 106; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[8] = 28; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[9] = 40; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[10] = 165; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[11] = 179; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[12] = 73; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[13] = 178; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[14] = 60; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[15] = 126; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[16] = 114; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[17] = 78; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[18] = 113; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[19] = 27; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[20] = 95; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[21] = 3; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[22] = 62; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[23] = 104; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[24] = 145; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[25] = 96; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[26] = 19; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[27] = 92; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[28] = 123; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[29] = 14; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[30] = 90; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[31] = 153; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[32] = 183; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[33] = 9; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[34] = 72; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[35] = 81; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[36] = 118; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[37] = 112; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[38] = 124; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[39] = 16; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[40] = 182; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[41] = 76; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[42] = 146; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[43] = 115; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[44] = 58; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[45] = 144; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[46] = 17; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[47] = 105; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[48] = 66; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[49] = 31; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[50] = 135; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[51] = 54; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[52] = 100; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[53] = 84; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[54] = 181; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[55] = 103; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[56] = 11; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[57] = 88; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[58] = 133; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[59] = 155; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[60] = 167; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[61] = 173; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[62] = 143; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[63] = 86; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[64] = 158; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[65] = 20; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[66] = 168; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[67] = 132; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[68] = 141; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[69] = 102; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[70] = 50; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[71] = 48; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[72] = 71; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[73] = 147; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[74] = 53; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[75] = 87; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[76] = 1; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[77] = 108; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[78] = 138; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[79] = 36; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[80] = 134; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[81] = 139; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[82] = 163; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[83] = 82; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[84] = 43; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[85] = 52; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[86] = 150; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[87] = 12; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[88] = 30; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[89] = 110; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[90] = 156; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[91] = 107; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[92] = 120; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[93] = 91; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[94] = 122; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[95] = 69; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[96] = 164; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[97] = 170; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[98] = 116; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[99] = 25; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[100] = 94; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[101] = 5; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[102] = 22; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[103] = 24; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[104] = 162; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[105] = 175; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[106] = 38; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[107] = 157; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[108] = 98; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[109] = 44; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[110] = 160; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[111] = 47; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[112] = 97; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[113] = 142; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[114] = 8; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[115] = 74; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[116] = 13; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[117] = 177; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[118] = 15; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[119] = 128; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[120] = 26; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[121] = 131; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[122] = 154; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[123] = 65; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[124] = 169; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[125] = 55; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[126] = 136; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[127] = 125; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[128] = 171; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[129] = 161; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[130] = 29; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[131] = 129; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[132] = 151; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[133] = 68; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[134] = 166; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[135] = 51; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[136] = 70; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[137] = 45; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[138] = 56; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[139] = 79; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[140] = 149; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[141] = 99; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[142] = 42; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[143] = 101; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[144] = 152; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[145] = 39; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[146] = 89; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[147] = 180; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[148] = 64; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[149] = 49; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[150] = 6; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[151] = 80; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[152] = 172; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[153] = 32; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[154] = 109; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[155] = 2; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[156] = 119; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[157] = 93; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[158] = 176; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[159] = 0; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[160] = 33; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[161] = 57; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[162] = 34; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[163] = 18; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[164] = 85; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[165] = 121; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[166] = 137; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[167] = 83; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[168] = 111; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[169] = 59; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[170] = 7; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[171] = 77; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[172] = 4; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[173] = 117; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[174] = 159; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[175] = 148; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[176] = 35; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[177] = 61; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[178] = 41; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[179] = 67; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[180] = 46; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[181] = 127; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[182] = 75; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[183] = 174; - test_msg->stream_counter = 1; - - EXPECT_EQ(send_message( 0xC06, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->certificate_id[0], 1) << "incorrect value for certificate_id[0], expected 1, is " << last_msg_->certificate_id[0]; - EXPECT_EQ(last_msg_->certificate_id[1], 2) << "incorrect value for certificate_id[1], expected 2, is " << last_msg_->certificate_id[1]; - EXPECT_EQ(last_msg_->certificate_id[2], 3) << "incorrect value for certificate_id[2], expected 3, is " << last_msg_->certificate_id[2]; - EXPECT_EQ(last_msg_->certificate_id[3], 4) << "incorrect value for certificate_id[3], expected 4, is " << last_msg_->certificate_id[3]; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->on_demand_counter, 2) << "incorrect value for on_demand_counter, expected 2, is " << last_msg_->on_demand_counter; - EXPECT_EQ(last_msg_->signature[0], 0) << "incorrect value for signature[0], expected 0, is " << last_msg_->signature[0]; - EXPECT_EQ(last_msg_->signature[1], 1) << "incorrect value for signature[1], expected 1, is " << last_msg_->signature[1]; - EXPECT_EQ(last_msg_->signature[2], 2) << "incorrect value for signature[2], expected 2, is " << last_msg_->signature[2]; - EXPECT_EQ(last_msg_->signature[3], 3) << "incorrect value for signature[3], expected 3, is " << last_msg_->signature[3]; - EXPECT_EQ(last_msg_->signature[4], 4) << "incorrect value for signature[4], expected 4, is " << last_msg_->signature[4]; - EXPECT_EQ(last_msg_->signature[5], 5) << "incorrect value for signature[5], expected 5, is " << last_msg_->signature[5]; - EXPECT_EQ(last_msg_->signature[6], 6) << "incorrect value for signature[6], expected 6, is " << last_msg_->signature[6]; - EXPECT_EQ(last_msg_->signature[7], 7) << "incorrect value for signature[7], expected 7, is " << last_msg_->signature[7]; - EXPECT_EQ(last_msg_->signature[8], 0) << "incorrect value for signature[8], expected 0, is " << last_msg_->signature[8]; - EXPECT_EQ(last_msg_->signature[9], 1) << "incorrect value for signature[9], expected 1, is " << last_msg_->signature[9]; - EXPECT_EQ(last_msg_->signature[10], 2) << "incorrect value for signature[10], expected 2, is " << last_msg_->signature[10]; - EXPECT_EQ(last_msg_->signature[11], 3) << "incorrect value for signature[11], expected 3, is " << last_msg_->signature[11]; - EXPECT_EQ(last_msg_->signature[12], 4) << "incorrect value for signature[12], expected 4, is " << last_msg_->signature[12]; - EXPECT_EQ(last_msg_->signature[13], 5) << "incorrect value for signature[13], expected 5, is " << last_msg_->signature[13]; - EXPECT_EQ(last_msg_->signature[14], 6) << "incorrect value for signature[14], expected 6, is " << last_msg_->signature[14]; - EXPECT_EQ(last_msg_->signature[15], 7) << "incorrect value for signature[15], expected 7, is " << last_msg_->signature[15]; - EXPECT_EQ(last_msg_->signature[16], 0) << "incorrect value for signature[16], expected 0, is " << last_msg_->signature[16]; - EXPECT_EQ(last_msg_->signature[17], 1) << "incorrect value for signature[17], expected 1, is " << last_msg_->signature[17]; - EXPECT_EQ(last_msg_->signature[18], 2) << "incorrect value for signature[18], expected 2, is " << last_msg_->signature[18]; - EXPECT_EQ(last_msg_->signature[19], 3) << "incorrect value for signature[19], expected 3, is " << last_msg_->signature[19]; - EXPECT_EQ(last_msg_->signature[20], 4) << "incorrect value for signature[20], expected 4, is " << last_msg_->signature[20]; - EXPECT_EQ(last_msg_->signature[21], 5) << "incorrect value for signature[21], expected 5, is " << last_msg_->signature[21]; - EXPECT_EQ(last_msg_->signature[22], 6) << "incorrect value for signature[22], expected 6, is " << last_msg_->signature[22]; - EXPECT_EQ(last_msg_->signature[23], 7) << "incorrect value for signature[23], expected 7, is " << last_msg_->signature[23]; - EXPECT_EQ(last_msg_->signature[24], 0) << "incorrect value for signature[24], expected 0, is " << last_msg_->signature[24]; - EXPECT_EQ(last_msg_->signature[25], 1) << "incorrect value for signature[25], expected 1, is " << last_msg_->signature[25]; - EXPECT_EQ(last_msg_->signature[26], 2) << "incorrect value for signature[26], expected 2, is " << last_msg_->signature[26]; - EXPECT_EQ(last_msg_->signature[27], 3) << "incorrect value for signature[27], expected 3, is " << last_msg_->signature[27]; - EXPECT_EQ(last_msg_->signature[28], 4) << "incorrect value for signature[28], expected 4, is " << last_msg_->signature[28]; - EXPECT_EQ(last_msg_->signature[29], 5) << "incorrect value for signature[29], expected 5, is " << last_msg_->signature[29]; - EXPECT_EQ(last_msg_->signature[30], 6) << "incorrect value for signature[30], expected 6, is " << last_msg_->signature[30]; - EXPECT_EQ(last_msg_->signature[31], 7) << "incorrect value for signature[31], expected 7, is " << last_msg_->signature[31]; - EXPECT_EQ(last_msg_->signature[32], 0) << "incorrect value for signature[32], expected 0, is " << last_msg_->signature[32]; - EXPECT_EQ(last_msg_->signature[33], 1) << "incorrect value for signature[33], expected 1, is " << last_msg_->signature[33]; - EXPECT_EQ(last_msg_->signature[34], 2) << "incorrect value for signature[34], expected 2, is " << last_msg_->signature[34]; - EXPECT_EQ(last_msg_->signature[35], 3) << "incorrect value for signature[35], expected 3, is " << last_msg_->signature[35]; - EXPECT_EQ(last_msg_->signature[36], 4) << "incorrect value for signature[36], expected 4, is " << last_msg_->signature[36]; - EXPECT_EQ(last_msg_->signature[37], 5) << "incorrect value for signature[37], expected 5, is " << last_msg_->signature[37]; - EXPECT_EQ(last_msg_->signature[38], 6) << "incorrect value for signature[38], expected 6, is " << last_msg_->signature[38]; - EXPECT_EQ(last_msg_->signature[39], 7) << "incorrect value for signature[39], expected 7, is " << last_msg_->signature[39]; - EXPECT_EQ(last_msg_->signature[40], 0) << "incorrect value for signature[40], expected 0, is " << last_msg_->signature[40]; - EXPECT_EQ(last_msg_->signature[41], 1) << "incorrect value for signature[41], expected 1, is " << last_msg_->signature[41]; - EXPECT_EQ(last_msg_->signature[42], 2) << "incorrect value for signature[42], expected 2, is " << last_msg_->signature[42]; - EXPECT_EQ(last_msg_->signature[43], 3) << "incorrect value for signature[43], expected 3, is " << last_msg_->signature[43]; - EXPECT_EQ(last_msg_->signature[44], 4) << "incorrect value for signature[44], expected 4, is " << last_msg_->signature[44]; - EXPECT_EQ(last_msg_->signature[45], 5) << "incorrect value for signature[45], expected 5, is " << last_msg_->signature[45]; - EXPECT_EQ(last_msg_->signature[46], 6) << "incorrect value for signature[46], expected 6, is " << last_msg_->signature[46]; - EXPECT_EQ(last_msg_->signature[47], 7) << "incorrect value for signature[47], expected 7, is " << last_msg_->signature[47]; - EXPECT_EQ(last_msg_->signature[48], 0) << "incorrect value for signature[48], expected 0, is " << last_msg_->signature[48]; - EXPECT_EQ(last_msg_->signature[49], 1) << "incorrect value for signature[49], expected 1, is " << last_msg_->signature[49]; - EXPECT_EQ(last_msg_->signature[50], 2) << "incorrect value for signature[50], expected 2, is " << last_msg_->signature[50]; - EXPECT_EQ(last_msg_->signature[51], 3) << "incorrect value for signature[51], expected 3, is " << last_msg_->signature[51]; - EXPECT_EQ(last_msg_->signature[52], 4) << "incorrect value for signature[52], expected 4, is " << last_msg_->signature[52]; - EXPECT_EQ(last_msg_->signature[53], 5) << "incorrect value for signature[53], expected 5, is " << last_msg_->signature[53]; - EXPECT_EQ(last_msg_->signature[54], 6) << "incorrect value for signature[54], expected 6, is " << last_msg_->signature[54]; - EXPECT_EQ(last_msg_->signature[55], 7) << "incorrect value for signature[55], expected 7, is " << last_msg_->signature[55]; - EXPECT_EQ(last_msg_->signature[56], 0) << "incorrect value for signature[56], expected 0, is " << last_msg_->signature[56]; - EXPECT_EQ(last_msg_->signature[57], 1) << "incorrect value for signature[57], expected 1, is " << last_msg_->signature[57]; - EXPECT_EQ(last_msg_->signature[58], 2) << "incorrect value for signature[58], expected 2, is " << last_msg_->signature[58]; - EXPECT_EQ(last_msg_->signature[59], 3) << "incorrect value for signature[59], expected 3, is " << last_msg_->signature[59]; - EXPECT_EQ(last_msg_->signature[60], 4) << "incorrect value for signature[60], expected 4, is " << last_msg_->signature[60]; - EXPECT_EQ(last_msg_->signature[61], 5) << "incorrect value for signature[61], expected 5, is " << last_msg_->signature[61]; - EXPECT_EQ(last_msg_->signature[62], 6) << "incorrect value for signature[62], expected 6, is " << last_msg_->signature[62]; - EXPECT_EQ(last_msg_->signature[63], 7) << "incorrect value for signature[63], expected 7, is " << last_msg_->signature[63]; - EXPECT_EQ(last_msg_->signed_messages[0], 10) << "incorrect value for signed_messages[0], expected 10, is " << last_msg_->signed_messages[0]; - EXPECT_EQ(last_msg_->signed_messages[1], 21) << "incorrect value for signed_messages[1], expected 21, is " << last_msg_->signed_messages[1]; - EXPECT_EQ(last_msg_->signed_messages[2], 23) << "incorrect value for signed_messages[2], expected 23, is " << last_msg_->signed_messages[2]; - EXPECT_EQ(last_msg_->signed_messages[3], 63) << "incorrect value for signed_messages[3], expected 63, is " << last_msg_->signed_messages[3]; - EXPECT_EQ(last_msg_->signed_messages[4], 140) << "incorrect value for signed_messages[4], expected 140, is " << last_msg_->signed_messages[4]; - EXPECT_EQ(last_msg_->signed_messages[5], 37) << "incorrect value for signed_messages[5], expected 37, is " << last_msg_->signed_messages[5]; - EXPECT_EQ(last_msg_->signed_messages[6], 130) << "incorrect value for signed_messages[6], expected 130, is " << last_msg_->signed_messages[6]; - EXPECT_EQ(last_msg_->signed_messages[7], 106) << "incorrect value for signed_messages[7], expected 106, is " << last_msg_->signed_messages[7]; - EXPECT_EQ(last_msg_->signed_messages[8], 28) << "incorrect value for signed_messages[8], expected 28, is " << last_msg_->signed_messages[8]; - EXPECT_EQ(last_msg_->signed_messages[9], 40) << "incorrect value for signed_messages[9], expected 40, is " << last_msg_->signed_messages[9]; - EXPECT_EQ(last_msg_->signed_messages[10], 165) << "incorrect value for signed_messages[10], expected 165, is " << last_msg_->signed_messages[10]; - EXPECT_EQ(last_msg_->signed_messages[11], 179) << "incorrect value for signed_messages[11], expected 179, is " << last_msg_->signed_messages[11]; - EXPECT_EQ(last_msg_->signed_messages[12], 73) << "incorrect value for signed_messages[12], expected 73, is " << last_msg_->signed_messages[12]; - EXPECT_EQ(last_msg_->signed_messages[13], 178) << "incorrect value for signed_messages[13], expected 178, is " << last_msg_->signed_messages[13]; - EXPECT_EQ(last_msg_->signed_messages[14], 60) << "incorrect value for signed_messages[14], expected 60, is " << last_msg_->signed_messages[14]; - EXPECT_EQ(last_msg_->signed_messages[15], 126) << "incorrect value for signed_messages[15], expected 126, is " << last_msg_->signed_messages[15]; - EXPECT_EQ(last_msg_->signed_messages[16], 114) << "incorrect value for signed_messages[16], expected 114, is " << last_msg_->signed_messages[16]; - EXPECT_EQ(last_msg_->signed_messages[17], 78) << "incorrect value for signed_messages[17], expected 78, is " << last_msg_->signed_messages[17]; - EXPECT_EQ(last_msg_->signed_messages[18], 113) << "incorrect value for signed_messages[18], expected 113, is " << last_msg_->signed_messages[18]; - EXPECT_EQ(last_msg_->signed_messages[19], 27) << "incorrect value for signed_messages[19], expected 27, is " << last_msg_->signed_messages[19]; - EXPECT_EQ(last_msg_->signed_messages[20], 95) << "incorrect value for signed_messages[20], expected 95, is " << last_msg_->signed_messages[20]; - EXPECT_EQ(last_msg_->signed_messages[21], 3) << "incorrect value for signed_messages[21], expected 3, is " << last_msg_->signed_messages[21]; - EXPECT_EQ(last_msg_->signed_messages[22], 62) << "incorrect value for signed_messages[22], expected 62, is " << last_msg_->signed_messages[22]; - EXPECT_EQ(last_msg_->signed_messages[23], 104) << "incorrect value for signed_messages[23], expected 104, is " << last_msg_->signed_messages[23]; - EXPECT_EQ(last_msg_->signed_messages[24], 145) << "incorrect value for signed_messages[24], expected 145, is " << last_msg_->signed_messages[24]; - EXPECT_EQ(last_msg_->signed_messages[25], 96) << "incorrect value for signed_messages[25], expected 96, is " << last_msg_->signed_messages[25]; - EXPECT_EQ(last_msg_->signed_messages[26], 19) << "incorrect value for signed_messages[26], expected 19, is " << last_msg_->signed_messages[26]; - EXPECT_EQ(last_msg_->signed_messages[27], 92) << "incorrect value for signed_messages[27], expected 92, is " << last_msg_->signed_messages[27]; - EXPECT_EQ(last_msg_->signed_messages[28], 123) << "incorrect value for signed_messages[28], expected 123, is " << last_msg_->signed_messages[28]; - EXPECT_EQ(last_msg_->signed_messages[29], 14) << "incorrect value for signed_messages[29], expected 14, is " << last_msg_->signed_messages[29]; - EXPECT_EQ(last_msg_->signed_messages[30], 90) << "incorrect value for signed_messages[30], expected 90, is " << last_msg_->signed_messages[30]; - EXPECT_EQ(last_msg_->signed_messages[31], 153) << "incorrect value for signed_messages[31], expected 153, is " << last_msg_->signed_messages[31]; - EXPECT_EQ(last_msg_->signed_messages[32], 183) << "incorrect value for signed_messages[32], expected 183, is " << last_msg_->signed_messages[32]; - EXPECT_EQ(last_msg_->signed_messages[33], 9) << "incorrect value for signed_messages[33], expected 9, is " << last_msg_->signed_messages[33]; - EXPECT_EQ(last_msg_->signed_messages[34], 72) << "incorrect value for signed_messages[34], expected 72, is " << last_msg_->signed_messages[34]; - EXPECT_EQ(last_msg_->signed_messages[35], 81) << "incorrect value for signed_messages[35], expected 81, is " << last_msg_->signed_messages[35]; - EXPECT_EQ(last_msg_->signed_messages[36], 118) << "incorrect value for signed_messages[36], expected 118, is " << last_msg_->signed_messages[36]; - EXPECT_EQ(last_msg_->signed_messages[37], 112) << "incorrect value for signed_messages[37], expected 112, is " << last_msg_->signed_messages[37]; - EXPECT_EQ(last_msg_->signed_messages[38], 124) << "incorrect value for signed_messages[38], expected 124, is " << last_msg_->signed_messages[38]; - EXPECT_EQ(last_msg_->signed_messages[39], 16) << "incorrect value for signed_messages[39], expected 16, is " << last_msg_->signed_messages[39]; - EXPECT_EQ(last_msg_->signed_messages[40], 182) << "incorrect value for signed_messages[40], expected 182, is " << last_msg_->signed_messages[40]; - EXPECT_EQ(last_msg_->signed_messages[41], 76) << "incorrect value for signed_messages[41], expected 76, is " << last_msg_->signed_messages[41]; - EXPECT_EQ(last_msg_->signed_messages[42], 146) << "incorrect value for signed_messages[42], expected 146, is " << last_msg_->signed_messages[42]; - EXPECT_EQ(last_msg_->signed_messages[43], 115) << "incorrect value for signed_messages[43], expected 115, is " << last_msg_->signed_messages[43]; - EXPECT_EQ(last_msg_->signed_messages[44], 58) << "incorrect value for signed_messages[44], expected 58, is " << last_msg_->signed_messages[44]; - EXPECT_EQ(last_msg_->signed_messages[45], 144) << "incorrect value for signed_messages[45], expected 144, is " << last_msg_->signed_messages[45]; - EXPECT_EQ(last_msg_->signed_messages[46], 17) << "incorrect value for signed_messages[46], expected 17, is " << last_msg_->signed_messages[46]; - EXPECT_EQ(last_msg_->signed_messages[47], 105) << "incorrect value for signed_messages[47], expected 105, is " << last_msg_->signed_messages[47]; - EXPECT_EQ(last_msg_->signed_messages[48], 66) << "incorrect value for signed_messages[48], expected 66, is " << last_msg_->signed_messages[48]; - EXPECT_EQ(last_msg_->signed_messages[49], 31) << "incorrect value for signed_messages[49], expected 31, is " << last_msg_->signed_messages[49]; - EXPECT_EQ(last_msg_->signed_messages[50], 135) << "incorrect value for signed_messages[50], expected 135, is " << last_msg_->signed_messages[50]; - EXPECT_EQ(last_msg_->signed_messages[51], 54) << "incorrect value for signed_messages[51], expected 54, is " << last_msg_->signed_messages[51]; - EXPECT_EQ(last_msg_->signed_messages[52], 100) << "incorrect value for signed_messages[52], expected 100, is " << last_msg_->signed_messages[52]; - EXPECT_EQ(last_msg_->signed_messages[53], 84) << "incorrect value for signed_messages[53], expected 84, is " << last_msg_->signed_messages[53]; - EXPECT_EQ(last_msg_->signed_messages[54], 181) << "incorrect value for signed_messages[54], expected 181, is " << last_msg_->signed_messages[54]; - EXPECT_EQ(last_msg_->signed_messages[55], 103) << "incorrect value for signed_messages[55], expected 103, is " << last_msg_->signed_messages[55]; - EXPECT_EQ(last_msg_->signed_messages[56], 11) << "incorrect value for signed_messages[56], expected 11, is " << last_msg_->signed_messages[56]; - EXPECT_EQ(last_msg_->signed_messages[57], 88) << "incorrect value for signed_messages[57], expected 88, is " << last_msg_->signed_messages[57]; - EXPECT_EQ(last_msg_->signed_messages[58], 133) << "incorrect value for signed_messages[58], expected 133, is " << last_msg_->signed_messages[58]; - EXPECT_EQ(last_msg_->signed_messages[59], 155) << "incorrect value for signed_messages[59], expected 155, is " << last_msg_->signed_messages[59]; - EXPECT_EQ(last_msg_->signed_messages[60], 167) << "incorrect value for signed_messages[60], expected 167, is " << last_msg_->signed_messages[60]; - EXPECT_EQ(last_msg_->signed_messages[61], 173) << "incorrect value for signed_messages[61], expected 173, is " << last_msg_->signed_messages[61]; - EXPECT_EQ(last_msg_->signed_messages[62], 143) << "incorrect value for signed_messages[62], expected 143, is " << last_msg_->signed_messages[62]; - EXPECT_EQ(last_msg_->signed_messages[63], 86) << "incorrect value for signed_messages[63], expected 86, is " << last_msg_->signed_messages[63]; - EXPECT_EQ(last_msg_->signed_messages[64], 158) << "incorrect value for signed_messages[64], expected 158, is " << last_msg_->signed_messages[64]; - EXPECT_EQ(last_msg_->signed_messages[65], 20) << "incorrect value for signed_messages[65], expected 20, is " << last_msg_->signed_messages[65]; - EXPECT_EQ(last_msg_->signed_messages[66], 168) << "incorrect value for signed_messages[66], expected 168, is " << last_msg_->signed_messages[66]; - EXPECT_EQ(last_msg_->signed_messages[67], 132) << "incorrect value for signed_messages[67], expected 132, is " << last_msg_->signed_messages[67]; - EXPECT_EQ(last_msg_->signed_messages[68], 141) << "incorrect value for signed_messages[68], expected 141, is " << last_msg_->signed_messages[68]; - EXPECT_EQ(last_msg_->signed_messages[69], 102) << "incorrect value for signed_messages[69], expected 102, is " << last_msg_->signed_messages[69]; - EXPECT_EQ(last_msg_->signed_messages[70], 50) << "incorrect value for signed_messages[70], expected 50, is " << last_msg_->signed_messages[70]; - EXPECT_EQ(last_msg_->signed_messages[71], 48) << "incorrect value for signed_messages[71], expected 48, is " << last_msg_->signed_messages[71]; - EXPECT_EQ(last_msg_->signed_messages[72], 71) << "incorrect value for signed_messages[72], expected 71, is " << last_msg_->signed_messages[72]; - EXPECT_EQ(last_msg_->signed_messages[73], 147) << "incorrect value for signed_messages[73], expected 147, is " << last_msg_->signed_messages[73]; - EXPECT_EQ(last_msg_->signed_messages[74], 53) << "incorrect value for signed_messages[74], expected 53, is " << last_msg_->signed_messages[74]; - EXPECT_EQ(last_msg_->signed_messages[75], 87) << "incorrect value for signed_messages[75], expected 87, is " << last_msg_->signed_messages[75]; - EXPECT_EQ(last_msg_->signed_messages[76], 1) << "incorrect value for signed_messages[76], expected 1, is " << last_msg_->signed_messages[76]; - EXPECT_EQ(last_msg_->signed_messages[77], 108) << "incorrect value for signed_messages[77], expected 108, is " << last_msg_->signed_messages[77]; - EXPECT_EQ(last_msg_->signed_messages[78], 138) << "incorrect value for signed_messages[78], expected 138, is " << last_msg_->signed_messages[78]; - EXPECT_EQ(last_msg_->signed_messages[79], 36) << "incorrect value for signed_messages[79], expected 36, is " << last_msg_->signed_messages[79]; - EXPECT_EQ(last_msg_->signed_messages[80], 134) << "incorrect value for signed_messages[80], expected 134, is " << last_msg_->signed_messages[80]; - EXPECT_EQ(last_msg_->signed_messages[81], 139) << "incorrect value for signed_messages[81], expected 139, is " << last_msg_->signed_messages[81]; - EXPECT_EQ(last_msg_->signed_messages[82], 163) << "incorrect value for signed_messages[82], expected 163, is " << last_msg_->signed_messages[82]; - EXPECT_EQ(last_msg_->signed_messages[83], 82) << "incorrect value for signed_messages[83], expected 82, is " << last_msg_->signed_messages[83]; - EXPECT_EQ(last_msg_->signed_messages[84], 43) << "incorrect value for signed_messages[84], expected 43, is " << last_msg_->signed_messages[84]; - EXPECT_EQ(last_msg_->signed_messages[85], 52) << "incorrect value for signed_messages[85], expected 52, is " << last_msg_->signed_messages[85]; - EXPECT_EQ(last_msg_->signed_messages[86], 150) << "incorrect value for signed_messages[86], expected 150, is " << last_msg_->signed_messages[86]; - EXPECT_EQ(last_msg_->signed_messages[87], 12) << "incorrect value for signed_messages[87], expected 12, is " << last_msg_->signed_messages[87]; - EXPECT_EQ(last_msg_->signed_messages[88], 30) << "incorrect value for signed_messages[88], expected 30, is " << last_msg_->signed_messages[88]; - EXPECT_EQ(last_msg_->signed_messages[89], 110) << "incorrect value for signed_messages[89], expected 110, is " << last_msg_->signed_messages[89]; - EXPECT_EQ(last_msg_->signed_messages[90], 156) << "incorrect value for signed_messages[90], expected 156, is " << last_msg_->signed_messages[90]; - EXPECT_EQ(last_msg_->signed_messages[91], 107) << "incorrect value for signed_messages[91], expected 107, is " << last_msg_->signed_messages[91]; - EXPECT_EQ(last_msg_->signed_messages[92], 120) << "incorrect value for signed_messages[92], expected 120, is " << last_msg_->signed_messages[92]; - EXPECT_EQ(last_msg_->signed_messages[93], 91) << "incorrect value for signed_messages[93], expected 91, is " << last_msg_->signed_messages[93]; - EXPECT_EQ(last_msg_->signed_messages[94], 122) << "incorrect value for signed_messages[94], expected 122, is " << last_msg_->signed_messages[94]; - EXPECT_EQ(last_msg_->signed_messages[95], 69) << "incorrect value for signed_messages[95], expected 69, is " << last_msg_->signed_messages[95]; - EXPECT_EQ(last_msg_->signed_messages[96], 164) << "incorrect value for signed_messages[96], expected 164, is " << last_msg_->signed_messages[96]; - EXPECT_EQ(last_msg_->signed_messages[97], 170) << "incorrect value for signed_messages[97], expected 170, is " << last_msg_->signed_messages[97]; - EXPECT_EQ(last_msg_->signed_messages[98], 116) << "incorrect value for signed_messages[98], expected 116, is " << last_msg_->signed_messages[98]; - EXPECT_EQ(last_msg_->signed_messages[99], 25) << "incorrect value for signed_messages[99], expected 25, is " << last_msg_->signed_messages[99]; - EXPECT_EQ(last_msg_->signed_messages[100], 94) << "incorrect value for signed_messages[100], expected 94, is " << last_msg_->signed_messages[100]; - EXPECT_EQ(last_msg_->signed_messages[101], 5) << "incorrect value for signed_messages[101], expected 5, is " << last_msg_->signed_messages[101]; - EXPECT_EQ(last_msg_->signed_messages[102], 22) << "incorrect value for signed_messages[102], expected 22, is " << last_msg_->signed_messages[102]; - EXPECT_EQ(last_msg_->signed_messages[103], 24) << "incorrect value for signed_messages[103], expected 24, is " << last_msg_->signed_messages[103]; - EXPECT_EQ(last_msg_->signed_messages[104], 162) << "incorrect value for signed_messages[104], expected 162, is " << last_msg_->signed_messages[104]; - EXPECT_EQ(last_msg_->signed_messages[105], 175) << "incorrect value for signed_messages[105], expected 175, is " << last_msg_->signed_messages[105]; - EXPECT_EQ(last_msg_->signed_messages[106], 38) << "incorrect value for signed_messages[106], expected 38, is " << last_msg_->signed_messages[106]; - EXPECT_EQ(last_msg_->signed_messages[107], 157) << "incorrect value for signed_messages[107], expected 157, is " << last_msg_->signed_messages[107]; - EXPECT_EQ(last_msg_->signed_messages[108], 98) << "incorrect value for signed_messages[108], expected 98, is " << last_msg_->signed_messages[108]; - EXPECT_EQ(last_msg_->signed_messages[109], 44) << "incorrect value for signed_messages[109], expected 44, is " << last_msg_->signed_messages[109]; - EXPECT_EQ(last_msg_->signed_messages[110], 160) << "incorrect value for signed_messages[110], expected 160, is " << last_msg_->signed_messages[110]; - EXPECT_EQ(last_msg_->signed_messages[111], 47) << "incorrect value for signed_messages[111], expected 47, is " << last_msg_->signed_messages[111]; - EXPECT_EQ(last_msg_->signed_messages[112], 97) << "incorrect value for signed_messages[112], expected 97, is " << last_msg_->signed_messages[112]; - EXPECT_EQ(last_msg_->signed_messages[113], 142) << "incorrect value for signed_messages[113], expected 142, is " << last_msg_->signed_messages[113]; - EXPECT_EQ(last_msg_->signed_messages[114], 8) << "incorrect value for signed_messages[114], expected 8, is " << last_msg_->signed_messages[114]; - EXPECT_EQ(last_msg_->signed_messages[115], 74) << "incorrect value for signed_messages[115], expected 74, is " << last_msg_->signed_messages[115]; - EXPECT_EQ(last_msg_->signed_messages[116], 13) << "incorrect value for signed_messages[116], expected 13, is " << last_msg_->signed_messages[116]; - EXPECT_EQ(last_msg_->signed_messages[117], 177) << "incorrect value for signed_messages[117], expected 177, is " << last_msg_->signed_messages[117]; - EXPECT_EQ(last_msg_->signed_messages[118], 15) << "incorrect value for signed_messages[118], expected 15, is " << last_msg_->signed_messages[118]; - EXPECT_EQ(last_msg_->signed_messages[119], 128) << "incorrect value for signed_messages[119], expected 128, is " << last_msg_->signed_messages[119]; - EXPECT_EQ(last_msg_->signed_messages[120], 26) << "incorrect value for signed_messages[120], expected 26, is " << last_msg_->signed_messages[120]; - EXPECT_EQ(last_msg_->signed_messages[121], 131) << "incorrect value for signed_messages[121], expected 131, is " << last_msg_->signed_messages[121]; - EXPECT_EQ(last_msg_->signed_messages[122], 154) << "incorrect value for signed_messages[122], expected 154, is " << last_msg_->signed_messages[122]; - EXPECT_EQ(last_msg_->signed_messages[123], 65) << "incorrect value for signed_messages[123], expected 65, is " << last_msg_->signed_messages[123]; - EXPECT_EQ(last_msg_->signed_messages[124], 169) << "incorrect value for signed_messages[124], expected 169, is " << last_msg_->signed_messages[124]; - EXPECT_EQ(last_msg_->signed_messages[125], 55) << "incorrect value for signed_messages[125], expected 55, is " << last_msg_->signed_messages[125]; - EXPECT_EQ(last_msg_->signed_messages[126], 136) << "incorrect value for signed_messages[126], expected 136, is " << last_msg_->signed_messages[126]; - EXPECT_EQ(last_msg_->signed_messages[127], 125) << "incorrect value for signed_messages[127], expected 125, is " << last_msg_->signed_messages[127]; - EXPECT_EQ(last_msg_->signed_messages[128], 171) << "incorrect value for signed_messages[128], expected 171, is " << last_msg_->signed_messages[128]; - EXPECT_EQ(last_msg_->signed_messages[129], 161) << "incorrect value for signed_messages[129], expected 161, is " << last_msg_->signed_messages[129]; - EXPECT_EQ(last_msg_->signed_messages[130], 29) << "incorrect value for signed_messages[130], expected 29, is " << last_msg_->signed_messages[130]; - EXPECT_EQ(last_msg_->signed_messages[131], 129) << "incorrect value for signed_messages[131], expected 129, is " << last_msg_->signed_messages[131]; - EXPECT_EQ(last_msg_->signed_messages[132], 151) << "incorrect value for signed_messages[132], expected 151, is " << last_msg_->signed_messages[132]; - EXPECT_EQ(last_msg_->signed_messages[133], 68) << "incorrect value for signed_messages[133], expected 68, is " << last_msg_->signed_messages[133]; - EXPECT_EQ(last_msg_->signed_messages[134], 166) << "incorrect value for signed_messages[134], expected 166, is " << last_msg_->signed_messages[134]; - EXPECT_EQ(last_msg_->signed_messages[135], 51) << "incorrect value for signed_messages[135], expected 51, is " << last_msg_->signed_messages[135]; - EXPECT_EQ(last_msg_->signed_messages[136], 70) << "incorrect value for signed_messages[136], expected 70, is " << last_msg_->signed_messages[136]; - EXPECT_EQ(last_msg_->signed_messages[137], 45) << "incorrect value for signed_messages[137], expected 45, is " << last_msg_->signed_messages[137]; - EXPECT_EQ(last_msg_->signed_messages[138], 56) << "incorrect value for signed_messages[138], expected 56, is " << last_msg_->signed_messages[138]; - EXPECT_EQ(last_msg_->signed_messages[139], 79) << "incorrect value for signed_messages[139], expected 79, is " << last_msg_->signed_messages[139]; - EXPECT_EQ(last_msg_->signed_messages[140], 149) << "incorrect value for signed_messages[140], expected 149, is " << last_msg_->signed_messages[140]; - EXPECT_EQ(last_msg_->signed_messages[141], 99) << "incorrect value for signed_messages[141], expected 99, is " << last_msg_->signed_messages[141]; - EXPECT_EQ(last_msg_->signed_messages[142], 42) << "incorrect value for signed_messages[142], expected 42, is " << last_msg_->signed_messages[142]; - EXPECT_EQ(last_msg_->signed_messages[143], 101) << "incorrect value for signed_messages[143], expected 101, is " << last_msg_->signed_messages[143]; - EXPECT_EQ(last_msg_->signed_messages[144], 152) << "incorrect value for signed_messages[144], expected 152, is " << last_msg_->signed_messages[144]; - EXPECT_EQ(last_msg_->signed_messages[145], 39) << "incorrect value for signed_messages[145], expected 39, is " << last_msg_->signed_messages[145]; - EXPECT_EQ(last_msg_->signed_messages[146], 89) << "incorrect value for signed_messages[146], expected 89, is " << last_msg_->signed_messages[146]; - EXPECT_EQ(last_msg_->signed_messages[147], 180) << "incorrect value for signed_messages[147], expected 180, is " << last_msg_->signed_messages[147]; - EXPECT_EQ(last_msg_->signed_messages[148], 64) << "incorrect value for signed_messages[148], expected 64, is " << last_msg_->signed_messages[148]; - EXPECT_EQ(last_msg_->signed_messages[149], 49) << "incorrect value for signed_messages[149], expected 49, is " << last_msg_->signed_messages[149]; - EXPECT_EQ(last_msg_->signed_messages[150], 6) << "incorrect value for signed_messages[150], expected 6, is " << last_msg_->signed_messages[150]; - EXPECT_EQ(last_msg_->signed_messages[151], 80) << "incorrect value for signed_messages[151], expected 80, is " << last_msg_->signed_messages[151]; - EXPECT_EQ(last_msg_->signed_messages[152], 172) << "incorrect value for signed_messages[152], expected 172, is " << last_msg_->signed_messages[152]; - EXPECT_EQ(last_msg_->signed_messages[153], 32) << "incorrect value for signed_messages[153], expected 32, is " << last_msg_->signed_messages[153]; - EXPECT_EQ(last_msg_->signed_messages[154], 109) << "incorrect value for signed_messages[154], expected 109, is " << last_msg_->signed_messages[154]; - EXPECT_EQ(last_msg_->signed_messages[155], 2) << "incorrect value for signed_messages[155], expected 2, is " << last_msg_->signed_messages[155]; - EXPECT_EQ(last_msg_->signed_messages[156], 119) << "incorrect value for signed_messages[156], expected 119, is " << last_msg_->signed_messages[156]; - EXPECT_EQ(last_msg_->signed_messages[157], 93) << "incorrect value for signed_messages[157], expected 93, is " << last_msg_->signed_messages[157]; - EXPECT_EQ(last_msg_->signed_messages[158], 176) << "incorrect value for signed_messages[158], expected 176, is " << last_msg_->signed_messages[158]; - EXPECT_EQ(last_msg_->signed_messages[159], 0) << "incorrect value for signed_messages[159], expected 0, is " << last_msg_->signed_messages[159]; - EXPECT_EQ(last_msg_->signed_messages[160], 33) << "incorrect value for signed_messages[160], expected 33, is " << last_msg_->signed_messages[160]; - EXPECT_EQ(last_msg_->signed_messages[161], 57) << "incorrect value for signed_messages[161], expected 57, is " << last_msg_->signed_messages[161]; - EXPECT_EQ(last_msg_->signed_messages[162], 34) << "incorrect value for signed_messages[162], expected 34, is " << last_msg_->signed_messages[162]; - EXPECT_EQ(last_msg_->signed_messages[163], 18) << "incorrect value for signed_messages[163], expected 18, is " << last_msg_->signed_messages[163]; - EXPECT_EQ(last_msg_->signed_messages[164], 85) << "incorrect value for signed_messages[164], expected 85, is " << last_msg_->signed_messages[164]; - EXPECT_EQ(last_msg_->signed_messages[165], 121) << "incorrect value for signed_messages[165], expected 121, is " << last_msg_->signed_messages[165]; - EXPECT_EQ(last_msg_->signed_messages[166], 137) << "incorrect value for signed_messages[166], expected 137, is " << last_msg_->signed_messages[166]; - EXPECT_EQ(last_msg_->signed_messages[167], 83) << "incorrect value for signed_messages[167], expected 83, is " << last_msg_->signed_messages[167]; - EXPECT_EQ(last_msg_->signed_messages[168], 111) << "incorrect value for signed_messages[168], expected 111, is " << last_msg_->signed_messages[168]; - EXPECT_EQ(last_msg_->signed_messages[169], 59) << "incorrect value for signed_messages[169], expected 59, is " << last_msg_->signed_messages[169]; - EXPECT_EQ(last_msg_->signed_messages[170], 7) << "incorrect value for signed_messages[170], expected 7, is " << last_msg_->signed_messages[170]; - EXPECT_EQ(last_msg_->signed_messages[171], 77) << "incorrect value for signed_messages[171], expected 77, is " << last_msg_->signed_messages[171]; - EXPECT_EQ(last_msg_->signed_messages[172], 4) << "incorrect value for signed_messages[172], expected 4, is " << last_msg_->signed_messages[172]; - EXPECT_EQ(last_msg_->signed_messages[173], 117) << "incorrect value for signed_messages[173], expected 117, is " << last_msg_->signed_messages[173]; - EXPECT_EQ(last_msg_->signed_messages[174], 159) << "incorrect value for signed_messages[174], expected 159, is " << last_msg_->signed_messages[174]; - EXPECT_EQ(last_msg_->signed_messages[175], 148) << "incorrect value for signed_messages[175], expected 148, is " << last_msg_->signed_messages[175]; - EXPECT_EQ(last_msg_->signed_messages[176], 35) << "incorrect value for signed_messages[176], expected 35, is " << last_msg_->signed_messages[176]; - EXPECT_EQ(last_msg_->signed_messages[177], 61) << "incorrect value for signed_messages[177], expected 61, is " << last_msg_->signed_messages[177]; - EXPECT_EQ(last_msg_->signed_messages[178], 41) << "incorrect value for signed_messages[178], expected 41, is " << last_msg_->signed_messages[178]; - EXPECT_EQ(last_msg_->signed_messages[179], 67) << "incorrect value for signed_messages[179], expected 67, is " << last_msg_->signed_messages[179]; - EXPECT_EQ(last_msg_->signed_messages[180], 46) << "incorrect value for signed_messages[180], expected 46, is " << last_msg_->signed_messages[180]; - EXPECT_EQ(last_msg_->signed_messages[181], 127) << "incorrect value for signed_messages[181], expected 127, is " << last_msg_->signed_messages[181]; - EXPECT_EQ(last_msg_->signed_messages[182], 75) << "incorrect value for signed_messages[182], expected 75, is " << last_msg_->signed_messages[182]; - EXPECT_EQ(last_msg_->signed_messages[183], 174) << "incorrect value for signed_messages[183], expected 174, is " << last_msg_->signed_messages[183]; - EXPECT_EQ(last_msg_->stream_counter, 1) << "incorrect value for stream_counter, expected 1, is " << last_msg_->stream_counter; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->certificate_id[0], 1) + << "incorrect value for certificate_id[0], expected 1, is " + << last_msg_->certificate_id[0]; + EXPECT_EQ(last_msg_->certificate_id[1], 2) + << "incorrect value for certificate_id[1], expected 2, is " + << last_msg_->certificate_id[1]; + EXPECT_EQ(last_msg_->certificate_id[2], 3) + << "incorrect value for certificate_id[2], expected 3, is " + << last_msg_->certificate_id[2]; + EXPECT_EQ(last_msg_->certificate_id[3], 4) + << "incorrect value for certificate_id[3], expected 4, is " + << last_msg_->certificate_id[3]; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->on_demand_counter, 2) + << "incorrect value for on_demand_counter, expected 2, is " + << last_msg_->on_demand_counter; + EXPECT_EQ(last_msg_->signature[0], 0) + << "incorrect value for signature[0], expected 0, is " + << last_msg_->signature[0]; + EXPECT_EQ(last_msg_->signature[1], 1) + << "incorrect value for signature[1], expected 1, is " + << last_msg_->signature[1]; + EXPECT_EQ(last_msg_->signature[2], 2) + << "incorrect value for signature[2], expected 2, is " + << last_msg_->signature[2]; + EXPECT_EQ(last_msg_->signature[3], 3) + << "incorrect value for signature[3], expected 3, is " + << last_msg_->signature[3]; + EXPECT_EQ(last_msg_->signature[4], 4) + << "incorrect value for signature[4], expected 4, is " + << last_msg_->signature[4]; + EXPECT_EQ(last_msg_->signature[5], 5) + << "incorrect value for signature[5], expected 5, is " + << last_msg_->signature[5]; + EXPECT_EQ(last_msg_->signature[6], 6) + << "incorrect value for signature[6], expected 6, is " + << last_msg_->signature[6]; + EXPECT_EQ(last_msg_->signature[7], 7) + << "incorrect value for signature[7], expected 7, is " + << last_msg_->signature[7]; + EXPECT_EQ(last_msg_->signature[8], 0) + << "incorrect value for signature[8], expected 0, is " + << last_msg_->signature[8]; + EXPECT_EQ(last_msg_->signature[9], 1) + << "incorrect value for signature[9], expected 1, is " + << last_msg_->signature[9]; + EXPECT_EQ(last_msg_->signature[10], 2) + << "incorrect value for signature[10], expected 2, is " + << last_msg_->signature[10]; + EXPECT_EQ(last_msg_->signature[11], 3) + << "incorrect value for signature[11], expected 3, is " + << last_msg_->signature[11]; + EXPECT_EQ(last_msg_->signature[12], 4) + << "incorrect value for signature[12], expected 4, is " + << last_msg_->signature[12]; + EXPECT_EQ(last_msg_->signature[13], 5) + << "incorrect value for signature[13], expected 5, is " + << last_msg_->signature[13]; + EXPECT_EQ(last_msg_->signature[14], 6) + << "incorrect value for signature[14], expected 6, is " + << last_msg_->signature[14]; + EXPECT_EQ(last_msg_->signature[15], 7) + << "incorrect value for signature[15], expected 7, is " + << last_msg_->signature[15]; + EXPECT_EQ(last_msg_->signature[16], 0) + << "incorrect value for signature[16], expected 0, is " + << last_msg_->signature[16]; + EXPECT_EQ(last_msg_->signature[17], 1) + << "incorrect value for signature[17], expected 1, is " + << last_msg_->signature[17]; + EXPECT_EQ(last_msg_->signature[18], 2) + << "incorrect value for signature[18], expected 2, is " + << last_msg_->signature[18]; + EXPECT_EQ(last_msg_->signature[19], 3) + << "incorrect value for signature[19], expected 3, is " + << last_msg_->signature[19]; + EXPECT_EQ(last_msg_->signature[20], 4) + << "incorrect value for signature[20], expected 4, is " + << last_msg_->signature[20]; + EXPECT_EQ(last_msg_->signature[21], 5) + << "incorrect value for signature[21], expected 5, is " + << last_msg_->signature[21]; + EXPECT_EQ(last_msg_->signature[22], 6) + << "incorrect value for signature[22], expected 6, is " + << last_msg_->signature[22]; + EXPECT_EQ(last_msg_->signature[23], 7) + << "incorrect value for signature[23], expected 7, is " + << last_msg_->signature[23]; + EXPECT_EQ(last_msg_->signature[24], 0) + << "incorrect value for signature[24], expected 0, is " + << last_msg_->signature[24]; + EXPECT_EQ(last_msg_->signature[25], 1) + << "incorrect value for signature[25], expected 1, is " + << last_msg_->signature[25]; + EXPECT_EQ(last_msg_->signature[26], 2) + << "incorrect value for signature[26], expected 2, is " + << last_msg_->signature[26]; + EXPECT_EQ(last_msg_->signature[27], 3) + << "incorrect value for signature[27], expected 3, is " + << last_msg_->signature[27]; + EXPECT_EQ(last_msg_->signature[28], 4) + << "incorrect value for signature[28], expected 4, is " + << last_msg_->signature[28]; + EXPECT_EQ(last_msg_->signature[29], 5) + << "incorrect value for signature[29], expected 5, is " + << last_msg_->signature[29]; + EXPECT_EQ(last_msg_->signature[30], 6) + << "incorrect value for signature[30], expected 6, is " + << last_msg_->signature[30]; + EXPECT_EQ(last_msg_->signature[31], 7) + << "incorrect value for signature[31], expected 7, is " + << last_msg_->signature[31]; + EXPECT_EQ(last_msg_->signature[32], 0) + << "incorrect value for signature[32], expected 0, is " + << last_msg_->signature[32]; + EXPECT_EQ(last_msg_->signature[33], 1) + << "incorrect value for signature[33], expected 1, is " + << last_msg_->signature[33]; + EXPECT_EQ(last_msg_->signature[34], 2) + << "incorrect value for signature[34], expected 2, is " + << last_msg_->signature[34]; + EXPECT_EQ(last_msg_->signature[35], 3) + << "incorrect value for signature[35], expected 3, is " + << last_msg_->signature[35]; + EXPECT_EQ(last_msg_->signature[36], 4) + << "incorrect value for signature[36], expected 4, is " + << last_msg_->signature[36]; + EXPECT_EQ(last_msg_->signature[37], 5) + << "incorrect value for signature[37], expected 5, is " + << last_msg_->signature[37]; + EXPECT_EQ(last_msg_->signature[38], 6) + << "incorrect value for signature[38], expected 6, is " + << last_msg_->signature[38]; + EXPECT_EQ(last_msg_->signature[39], 7) + << "incorrect value for signature[39], expected 7, is " + << last_msg_->signature[39]; + EXPECT_EQ(last_msg_->signature[40], 0) + << "incorrect value for signature[40], expected 0, is " + << last_msg_->signature[40]; + EXPECT_EQ(last_msg_->signature[41], 1) + << "incorrect value for signature[41], expected 1, is " + << last_msg_->signature[41]; + EXPECT_EQ(last_msg_->signature[42], 2) + << "incorrect value for signature[42], expected 2, is " + << last_msg_->signature[42]; + EXPECT_EQ(last_msg_->signature[43], 3) + << "incorrect value for signature[43], expected 3, is " + << last_msg_->signature[43]; + EXPECT_EQ(last_msg_->signature[44], 4) + << "incorrect value for signature[44], expected 4, is " + << last_msg_->signature[44]; + EXPECT_EQ(last_msg_->signature[45], 5) + << "incorrect value for signature[45], expected 5, is " + << last_msg_->signature[45]; + EXPECT_EQ(last_msg_->signature[46], 6) + << "incorrect value for signature[46], expected 6, is " + << last_msg_->signature[46]; + EXPECT_EQ(last_msg_->signature[47], 7) + << "incorrect value for signature[47], expected 7, is " + << last_msg_->signature[47]; + EXPECT_EQ(last_msg_->signature[48], 0) + << "incorrect value for signature[48], expected 0, is " + << last_msg_->signature[48]; + EXPECT_EQ(last_msg_->signature[49], 1) + << "incorrect value for signature[49], expected 1, is " + << last_msg_->signature[49]; + EXPECT_EQ(last_msg_->signature[50], 2) + << "incorrect value for signature[50], expected 2, is " + << last_msg_->signature[50]; + EXPECT_EQ(last_msg_->signature[51], 3) + << "incorrect value for signature[51], expected 3, is " + << last_msg_->signature[51]; + EXPECT_EQ(last_msg_->signature[52], 4) + << "incorrect value for signature[52], expected 4, is " + << last_msg_->signature[52]; + EXPECT_EQ(last_msg_->signature[53], 5) + << "incorrect value for signature[53], expected 5, is " + << last_msg_->signature[53]; + EXPECT_EQ(last_msg_->signature[54], 6) + << "incorrect value for signature[54], expected 6, is " + << last_msg_->signature[54]; + EXPECT_EQ(last_msg_->signature[55], 7) + << "incorrect value for signature[55], expected 7, is " + << last_msg_->signature[55]; + EXPECT_EQ(last_msg_->signature[56], 0) + << "incorrect value for signature[56], expected 0, is " + << last_msg_->signature[56]; + EXPECT_EQ(last_msg_->signature[57], 1) + << "incorrect value for signature[57], expected 1, is " + << last_msg_->signature[57]; + EXPECT_EQ(last_msg_->signature[58], 2) + << "incorrect value for signature[58], expected 2, is " + << last_msg_->signature[58]; + EXPECT_EQ(last_msg_->signature[59], 3) + << "incorrect value for signature[59], expected 3, is " + << last_msg_->signature[59]; + EXPECT_EQ(last_msg_->signature[60], 4) + << "incorrect value for signature[60], expected 4, is " + << last_msg_->signature[60]; + EXPECT_EQ(last_msg_->signature[61], 5) + << "incorrect value for signature[61], expected 5, is " + << last_msg_->signature[61]; + EXPECT_EQ(last_msg_->signature[62], 6) + << "incorrect value for signature[62], expected 6, is " + << last_msg_->signature[62]; + EXPECT_EQ(last_msg_->signature[63], 7) + << "incorrect value for signature[63], expected 7, is " + << last_msg_->signature[63]; + EXPECT_EQ(last_msg_->signed_messages[0], 10) + << "incorrect value for signed_messages[0], expected 10, is " + << last_msg_->signed_messages[0]; + EXPECT_EQ(last_msg_->signed_messages[1], 21) + << "incorrect value for signed_messages[1], expected 21, is " + << last_msg_->signed_messages[1]; + EXPECT_EQ(last_msg_->signed_messages[2], 23) + << "incorrect value for signed_messages[2], expected 23, is " + << last_msg_->signed_messages[2]; + EXPECT_EQ(last_msg_->signed_messages[3], 63) + << "incorrect value for signed_messages[3], expected 63, is " + << last_msg_->signed_messages[3]; + EXPECT_EQ(last_msg_->signed_messages[4], 140) + << "incorrect value for signed_messages[4], expected 140, is " + << last_msg_->signed_messages[4]; + EXPECT_EQ(last_msg_->signed_messages[5], 37) + << "incorrect value for signed_messages[5], expected 37, is " + << last_msg_->signed_messages[5]; + EXPECT_EQ(last_msg_->signed_messages[6], 130) + << "incorrect value for signed_messages[6], expected 130, is " + << last_msg_->signed_messages[6]; + EXPECT_EQ(last_msg_->signed_messages[7], 106) + << "incorrect value for signed_messages[7], expected 106, is " + << last_msg_->signed_messages[7]; + EXPECT_EQ(last_msg_->signed_messages[8], 28) + << "incorrect value for signed_messages[8], expected 28, is " + << last_msg_->signed_messages[8]; + EXPECT_EQ(last_msg_->signed_messages[9], 40) + << "incorrect value for signed_messages[9], expected 40, is " + << last_msg_->signed_messages[9]; + EXPECT_EQ(last_msg_->signed_messages[10], 165) + << "incorrect value for signed_messages[10], expected 165, is " + << last_msg_->signed_messages[10]; + EXPECT_EQ(last_msg_->signed_messages[11], 179) + << "incorrect value for signed_messages[11], expected 179, is " + << last_msg_->signed_messages[11]; + EXPECT_EQ(last_msg_->signed_messages[12], 73) + << "incorrect value for signed_messages[12], expected 73, is " + << last_msg_->signed_messages[12]; + EXPECT_EQ(last_msg_->signed_messages[13], 178) + << "incorrect value for signed_messages[13], expected 178, is " + << last_msg_->signed_messages[13]; + EXPECT_EQ(last_msg_->signed_messages[14], 60) + << "incorrect value for signed_messages[14], expected 60, is " + << last_msg_->signed_messages[14]; + EXPECT_EQ(last_msg_->signed_messages[15], 126) + << "incorrect value for signed_messages[15], expected 126, is " + << last_msg_->signed_messages[15]; + EXPECT_EQ(last_msg_->signed_messages[16], 114) + << "incorrect value for signed_messages[16], expected 114, is " + << last_msg_->signed_messages[16]; + EXPECT_EQ(last_msg_->signed_messages[17], 78) + << "incorrect value for signed_messages[17], expected 78, is " + << last_msg_->signed_messages[17]; + EXPECT_EQ(last_msg_->signed_messages[18], 113) + << "incorrect value for signed_messages[18], expected 113, is " + << last_msg_->signed_messages[18]; + EXPECT_EQ(last_msg_->signed_messages[19], 27) + << "incorrect value for signed_messages[19], expected 27, is " + << last_msg_->signed_messages[19]; + EXPECT_EQ(last_msg_->signed_messages[20], 95) + << "incorrect value for signed_messages[20], expected 95, is " + << last_msg_->signed_messages[20]; + EXPECT_EQ(last_msg_->signed_messages[21], 3) + << "incorrect value for signed_messages[21], expected 3, is " + << last_msg_->signed_messages[21]; + EXPECT_EQ(last_msg_->signed_messages[22], 62) + << "incorrect value for signed_messages[22], expected 62, is " + << last_msg_->signed_messages[22]; + EXPECT_EQ(last_msg_->signed_messages[23], 104) + << "incorrect value for signed_messages[23], expected 104, is " + << last_msg_->signed_messages[23]; + EXPECT_EQ(last_msg_->signed_messages[24], 145) + << "incorrect value for signed_messages[24], expected 145, is " + << last_msg_->signed_messages[24]; + EXPECT_EQ(last_msg_->signed_messages[25], 96) + << "incorrect value for signed_messages[25], expected 96, is " + << last_msg_->signed_messages[25]; + EXPECT_EQ(last_msg_->signed_messages[26], 19) + << "incorrect value for signed_messages[26], expected 19, is " + << last_msg_->signed_messages[26]; + EXPECT_EQ(last_msg_->signed_messages[27], 92) + << "incorrect value for signed_messages[27], expected 92, is " + << last_msg_->signed_messages[27]; + EXPECT_EQ(last_msg_->signed_messages[28], 123) + << "incorrect value for signed_messages[28], expected 123, is " + << last_msg_->signed_messages[28]; + EXPECT_EQ(last_msg_->signed_messages[29], 14) + << "incorrect value for signed_messages[29], expected 14, is " + << last_msg_->signed_messages[29]; + EXPECT_EQ(last_msg_->signed_messages[30], 90) + << "incorrect value for signed_messages[30], expected 90, is " + << last_msg_->signed_messages[30]; + EXPECT_EQ(last_msg_->signed_messages[31], 153) + << "incorrect value for signed_messages[31], expected 153, is " + << last_msg_->signed_messages[31]; + EXPECT_EQ(last_msg_->signed_messages[32], 183) + << "incorrect value for signed_messages[32], expected 183, is " + << last_msg_->signed_messages[32]; + EXPECT_EQ(last_msg_->signed_messages[33], 9) + << "incorrect value for signed_messages[33], expected 9, is " + << last_msg_->signed_messages[33]; + EXPECT_EQ(last_msg_->signed_messages[34], 72) + << "incorrect value for signed_messages[34], expected 72, is " + << last_msg_->signed_messages[34]; + EXPECT_EQ(last_msg_->signed_messages[35], 81) + << "incorrect value for signed_messages[35], expected 81, is " + << last_msg_->signed_messages[35]; + EXPECT_EQ(last_msg_->signed_messages[36], 118) + << "incorrect value for signed_messages[36], expected 118, is " + << last_msg_->signed_messages[36]; + EXPECT_EQ(last_msg_->signed_messages[37], 112) + << "incorrect value for signed_messages[37], expected 112, is " + << last_msg_->signed_messages[37]; + EXPECT_EQ(last_msg_->signed_messages[38], 124) + << "incorrect value for signed_messages[38], expected 124, is " + << last_msg_->signed_messages[38]; + EXPECT_EQ(last_msg_->signed_messages[39], 16) + << "incorrect value for signed_messages[39], expected 16, is " + << last_msg_->signed_messages[39]; + EXPECT_EQ(last_msg_->signed_messages[40], 182) + << "incorrect value for signed_messages[40], expected 182, is " + << last_msg_->signed_messages[40]; + EXPECT_EQ(last_msg_->signed_messages[41], 76) + << "incorrect value for signed_messages[41], expected 76, is " + << last_msg_->signed_messages[41]; + EXPECT_EQ(last_msg_->signed_messages[42], 146) + << "incorrect value for signed_messages[42], expected 146, is " + << last_msg_->signed_messages[42]; + EXPECT_EQ(last_msg_->signed_messages[43], 115) + << "incorrect value for signed_messages[43], expected 115, is " + << last_msg_->signed_messages[43]; + EXPECT_EQ(last_msg_->signed_messages[44], 58) + << "incorrect value for signed_messages[44], expected 58, is " + << last_msg_->signed_messages[44]; + EXPECT_EQ(last_msg_->signed_messages[45], 144) + << "incorrect value for signed_messages[45], expected 144, is " + << last_msg_->signed_messages[45]; + EXPECT_EQ(last_msg_->signed_messages[46], 17) + << "incorrect value for signed_messages[46], expected 17, is " + << last_msg_->signed_messages[46]; + EXPECT_EQ(last_msg_->signed_messages[47], 105) + << "incorrect value for signed_messages[47], expected 105, is " + << last_msg_->signed_messages[47]; + EXPECT_EQ(last_msg_->signed_messages[48], 66) + << "incorrect value for signed_messages[48], expected 66, is " + << last_msg_->signed_messages[48]; + EXPECT_EQ(last_msg_->signed_messages[49], 31) + << "incorrect value for signed_messages[49], expected 31, is " + << last_msg_->signed_messages[49]; + EXPECT_EQ(last_msg_->signed_messages[50], 135) + << "incorrect value for signed_messages[50], expected 135, is " + << last_msg_->signed_messages[50]; + EXPECT_EQ(last_msg_->signed_messages[51], 54) + << "incorrect value for signed_messages[51], expected 54, is " + << last_msg_->signed_messages[51]; + EXPECT_EQ(last_msg_->signed_messages[52], 100) + << "incorrect value for signed_messages[52], expected 100, is " + << last_msg_->signed_messages[52]; + EXPECT_EQ(last_msg_->signed_messages[53], 84) + << "incorrect value for signed_messages[53], expected 84, is " + << last_msg_->signed_messages[53]; + EXPECT_EQ(last_msg_->signed_messages[54], 181) + << "incorrect value for signed_messages[54], expected 181, is " + << last_msg_->signed_messages[54]; + EXPECT_EQ(last_msg_->signed_messages[55], 103) + << "incorrect value for signed_messages[55], expected 103, is " + << last_msg_->signed_messages[55]; + EXPECT_EQ(last_msg_->signed_messages[56], 11) + << "incorrect value for signed_messages[56], expected 11, is " + << last_msg_->signed_messages[56]; + EXPECT_EQ(last_msg_->signed_messages[57], 88) + << "incorrect value for signed_messages[57], expected 88, is " + << last_msg_->signed_messages[57]; + EXPECT_EQ(last_msg_->signed_messages[58], 133) + << "incorrect value for signed_messages[58], expected 133, is " + << last_msg_->signed_messages[58]; + EXPECT_EQ(last_msg_->signed_messages[59], 155) + << "incorrect value for signed_messages[59], expected 155, is " + << last_msg_->signed_messages[59]; + EXPECT_EQ(last_msg_->signed_messages[60], 167) + << "incorrect value for signed_messages[60], expected 167, is " + << last_msg_->signed_messages[60]; + EXPECT_EQ(last_msg_->signed_messages[61], 173) + << "incorrect value for signed_messages[61], expected 173, is " + << last_msg_->signed_messages[61]; + EXPECT_EQ(last_msg_->signed_messages[62], 143) + << "incorrect value for signed_messages[62], expected 143, is " + << last_msg_->signed_messages[62]; + EXPECT_EQ(last_msg_->signed_messages[63], 86) + << "incorrect value for signed_messages[63], expected 86, is " + << last_msg_->signed_messages[63]; + EXPECT_EQ(last_msg_->signed_messages[64], 158) + << "incorrect value for signed_messages[64], expected 158, is " + << last_msg_->signed_messages[64]; + EXPECT_EQ(last_msg_->signed_messages[65], 20) + << "incorrect value for signed_messages[65], expected 20, is " + << last_msg_->signed_messages[65]; + EXPECT_EQ(last_msg_->signed_messages[66], 168) + << "incorrect value for signed_messages[66], expected 168, is " + << last_msg_->signed_messages[66]; + EXPECT_EQ(last_msg_->signed_messages[67], 132) + << "incorrect value for signed_messages[67], expected 132, is " + << last_msg_->signed_messages[67]; + EXPECT_EQ(last_msg_->signed_messages[68], 141) + << "incorrect value for signed_messages[68], expected 141, is " + << last_msg_->signed_messages[68]; + EXPECT_EQ(last_msg_->signed_messages[69], 102) + << "incorrect value for signed_messages[69], expected 102, is " + << last_msg_->signed_messages[69]; + EXPECT_EQ(last_msg_->signed_messages[70], 50) + << "incorrect value for signed_messages[70], expected 50, is " + << last_msg_->signed_messages[70]; + EXPECT_EQ(last_msg_->signed_messages[71], 48) + << "incorrect value for signed_messages[71], expected 48, is " + << last_msg_->signed_messages[71]; + EXPECT_EQ(last_msg_->signed_messages[72], 71) + << "incorrect value for signed_messages[72], expected 71, is " + << last_msg_->signed_messages[72]; + EXPECT_EQ(last_msg_->signed_messages[73], 147) + << "incorrect value for signed_messages[73], expected 147, is " + << last_msg_->signed_messages[73]; + EXPECT_EQ(last_msg_->signed_messages[74], 53) + << "incorrect value for signed_messages[74], expected 53, is " + << last_msg_->signed_messages[74]; + EXPECT_EQ(last_msg_->signed_messages[75], 87) + << "incorrect value for signed_messages[75], expected 87, is " + << last_msg_->signed_messages[75]; + EXPECT_EQ(last_msg_->signed_messages[76], 1) + << "incorrect value for signed_messages[76], expected 1, is " + << last_msg_->signed_messages[76]; + EXPECT_EQ(last_msg_->signed_messages[77], 108) + << "incorrect value for signed_messages[77], expected 108, is " + << last_msg_->signed_messages[77]; + EXPECT_EQ(last_msg_->signed_messages[78], 138) + << "incorrect value for signed_messages[78], expected 138, is " + << last_msg_->signed_messages[78]; + EXPECT_EQ(last_msg_->signed_messages[79], 36) + << "incorrect value for signed_messages[79], expected 36, is " + << last_msg_->signed_messages[79]; + EXPECT_EQ(last_msg_->signed_messages[80], 134) + << "incorrect value for signed_messages[80], expected 134, is " + << last_msg_->signed_messages[80]; + EXPECT_EQ(last_msg_->signed_messages[81], 139) + << "incorrect value for signed_messages[81], expected 139, is " + << last_msg_->signed_messages[81]; + EXPECT_EQ(last_msg_->signed_messages[82], 163) + << "incorrect value for signed_messages[82], expected 163, is " + << last_msg_->signed_messages[82]; + EXPECT_EQ(last_msg_->signed_messages[83], 82) + << "incorrect value for signed_messages[83], expected 82, is " + << last_msg_->signed_messages[83]; + EXPECT_EQ(last_msg_->signed_messages[84], 43) + << "incorrect value for signed_messages[84], expected 43, is " + << last_msg_->signed_messages[84]; + EXPECT_EQ(last_msg_->signed_messages[85], 52) + << "incorrect value for signed_messages[85], expected 52, is " + << last_msg_->signed_messages[85]; + EXPECT_EQ(last_msg_->signed_messages[86], 150) + << "incorrect value for signed_messages[86], expected 150, is " + << last_msg_->signed_messages[86]; + EXPECT_EQ(last_msg_->signed_messages[87], 12) + << "incorrect value for signed_messages[87], expected 12, is " + << last_msg_->signed_messages[87]; + EXPECT_EQ(last_msg_->signed_messages[88], 30) + << "incorrect value for signed_messages[88], expected 30, is " + << last_msg_->signed_messages[88]; + EXPECT_EQ(last_msg_->signed_messages[89], 110) + << "incorrect value for signed_messages[89], expected 110, is " + << last_msg_->signed_messages[89]; + EXPECT_EQ(last_msg_->signed_messages[90], 156) + << "incorrect value for signed_messages[90], expected 156, is " + << last_msg_->signed_messages[90]; + EXPECT_EQ(last_msg_->signed_messages[91], 107) + << "incorrect value for signed_messages[91], expected 107, is " + << last_msg_->signed_messages[91]; + EXPECT_EQ(last_msg_->signed_messages[92], 120) + << "incorrect value for signed_messages[92], expected 120, is " + << last_msg_->signed_messages[92]; + EXPECT_EQ(last_msg_->signed_messages[93], 91) + << "incorrect value for signed_messages[93], expected 91, is " + << last_msg_->signed_messages[93]; + EXPECT_EQ(last_msg_->signed_messages[94], 122) + << "incorrect value for signed_messages[94], expected 122, is " + << last_msg_->signed_messages[94]; + EXPECT_EQ(last_msg_->signed_messages[95], 69) + << "incorrect value for signed_messages[95], expected 69, is " + << last_msg_->signed_messages[95]; + EXPECT_EQ(last_msg_->signed_messages[96], 164) + << "incorrect value for signed_messages[96], expected 164, is " + << last_msg_->signed_messages[96]; + EXPECT_EQ(last_msg_->signed_messages[97], 170) + << "incorrect value for signed_messages[97], expected 170, is " + << last_msg_->signed_messages[97]; + EXPECT_EQ(last_msg_->signed_messages[98], 116) + << "incorrect value for signed_messages[98], expected 116, is " + << last_msg_->signed_messages[98]; + EXPECT_EQ(last_msg_->signed_messages[99], 25) + << "incorrect value for signed_messages[99], expected 25, is " + << last_msg_->signed_messages[99]; + EXPECT_EQ(last_msg_->signed_messages[100], 94) + << "incorrect value for signed_messages[100], expected 94, is " + << last_msg_->signed_messages[100]; + EXPECT_EQ(last_msg_->signed_messages[101], 5) + << "incorrect value for signed_messages[101], expected 5, is " + << last_msg_->signed_messages[101]; + EXPECT_EQ(last_msg_->signed_messages[102], 22) + << "incorrect value for signed_messages[102], expected 22, is " + << last_msg_->signed_messages[102]; + EXPECT_EQ(last_msg_->signed_messages[103], 24) + << "incorrect value for signed_messages[103], expected 24, is " + << last_msg_->signed_messages[103]; + EXPECT_EQ(last_msg_->signed_messages[104], 162) + << "incorrect value for signed_messages[104], expected 162, is " + << last_msg_->signed_messages[104]; + EXPECT_EQ(last_msg_->signed_messages[105], 175) + << "incorrect value for signed_messages[105], expected 175, is " + << last_msg_->signed_messages[105]; + EXPECT_EQ(last_msg_->signed_messages[106], 38) + << "incorrect value for signed_messages[106], expected 38, is " + << last_msg_->signed_messages[106]; + EXPECT_EQ(last_msg_->signed_messages[107], 157) + << "incorrect value for signed_messages[107], expected 157, is " + << last_msg_->signed_messages[107]; + EXPECT_EQ(last_msg_->signed_messages[108], 98) + << "incorrect value for signed_messages[108], expected 98, is " + << last_msg_->signed_messages[108]; + EXPECT_EQ(last_msg_->signed_messages[109], 44) + << "incorrect value for signed_messages[109], expected 44, is " + << last_msg_->signed_messages[109]; + EXPECT_EQ(last_msg_->signed_messages[110], 160) + << "incorrect value for signed_messages[110], expected 160, is " + << last_msg_->signed_messages[110]; + EXPECT_EQ(last_msg_->signed_messages[111], 47) + << "incorrect value for signed_messages[111], expected 47, is " + << last_msg_->signed_messages[111]; + EXPECT_EQ(last_msg_->signed_messages[112], 97) + << "incorrect value for signed_messages[112], expected 97, is " + << last_msg_->signed_messages[112]; + EXPECT_EQ(last_msg_->signed_messages[113], 142) + << "incorrect value for signed_messages[113], expected 142, is " + << last_msg_->signed_messages[113]; + EXPECT_EQ(last_msg_->signed_messages[114], 8) + << "incorrect value for signed_messages[114], expected 8, is " + << last_msg_->signed_messages[114]; + EXPECT_EQ(last_msg_->signed_messages[115], 74) + << "incorrect value for signed_messages[115], expected 74, is " + << last_msg_->signed_messages[115]; + EXPECT_EQ(last_msg_->signed_messages[116], 13) + << "incorrect value for signed_messages[116], expected 13, is " + << last_msg_->signed_messages[116]; + EXPECT_EQ(last_msg_->signed_messages[117], 177) + << "incorrect value for signed_messages[117], expected 177, is " + << last_msg_->signed_messages[117]; + EXPECT_EQ(last_msg_->signed_messages[118], 15) + << "incorrect value for signed_messages[118], expected 15, is " + << last_msg_->signed_messages[118]; + EXPECT_EQ(last_msg_->signed_messages[119], 128) + << "incorrect value for signed_messages[119], expected 128, is " + << last_msg_->signed_messages[119]; + EXPECT_EQ(last_msg_->signed_messages[120], 26) + << "incorrect value for signed_messages[120], expected 26, is " + << last_msg_->signed_messages[120]; + EXPECT_EQ(last_msg_->signed_messages[121], 131) + << "incorrect value for signed_messages[121], expected 131, is " + << last_msg_->signed_messages[121]; + EXPECT_EQ(last_msg_->signed_messages[122], 154) + << "incorrect value for signed_messages[122], expected 154, is " + << last_msg_->signed_messages[122]; + EXPECT_EQ(last_msg_->signed_messages[123], 65) + << "incorrect value for signed_messages[123], expected 65, is " + << last_msg_->signed_messages[123]; + EXPECT_EQ(last_msg_->signed_messages[124], 169) + << "incorrect value for signed_messages[124], expected 169, is " + << last_msg_->signed_messages[124]; + EXPECT_EQ(last_msg_->signed_messages[125], 55) + << "incorrect value for signed_messages[125], expected 55, is " + << last_msg_->signed_messages[125]; + EXPECT_EQ(last_msg_->signed_messages[126], 136) + << "incorrect value for signed_messages[126], expected 136, is " + << last_msg_->signed_messages[126]; + EXPECT_EQ(last_msg_->signed_messages[127], 125) + << "incorrect value for signed_messages[127], expected 125, is " + << last_msg_->signed_messages[127]; + EXPECT_EQ(last_msg_->signed_messages[128], 171) + << "incorrect value for signed_messages[128], expected 171, is " + << last_msg_->signed_messages[128]; + EXPECT_EQ(last_msg_->signed_messages[129], 161) + << "incorrect value for signed_messages[129], expected 161, is " + << last_msg_->signed_messages[129]; + EXPECT_EQ(last_msg_->signed_messages[130], 29) + << "incorrect value for signed_messages[130], expected 29, is " + << last_msg_->signed_messages[130]; + EXPECT_EQ(last_msg_->signed_messages[131], 129) + << "incorrect value for signed_messages[131], expected 129, is " + << last_msg_->signed_messages[131]; + EXPECT_EQ(last_msg_->signed_messages[132], 151) + << "incorrect value for signed_messages[132], expected 151, is " + << last_msg_->signed_messages[132]; + EXPECT_EQ(last_msg_->signed_messages[133], 68) + << "incorrect value for signed_messages[133], expected 68, is " + << last_msg_->signed_messages[133]; + EXPECT_EQ(last_msg_->signed_messages[134], 166) + << "incorrect value for signed_messages[134], expected 166, is " + << last_msg_->signed_messages[134]; + EXPECT_EQ(last_msg_->signed_messages[135], 51) + << "incorrect value for signed_messages[135], expected 51, is " + << last_msg_->signed_messages[135]; + EXPECT_EQ(last_msg_->signed_messages[136], 70) + << "incorrect value for signed_messages[136], expected 70, is " + << last_msg_->signed_messages[136]; + EXPECT_EQ(last_msg_->signed_messages[137], 45) + << "incorrect value for signed_messages[137], expected 45, is " + << last_msg_->signed_messages[137]; + EXPECT_EQ(last_msg_->signed_messages[138], 56) + << "incorrect value for signed_messages[138], expected 56, is " + << last_msg_->signed_messages[138]; + EXPECT_EQ(last_msg_->signed_messages[139], 79) + << "incorrect value for signed_messages[139], expected 79, is " + << last_msg_->signed_messages[139]; + EXPECT_EQ(last_msg_->signed_messages[140], 149) + << "incorrect value for signed_messages[140], expected 149, is " + << last_msg_->signed_messages[140]; + EXPECT_EQ(last_msg_->signed_messages[141], 99) + << "incorrect value for signed_messages[141], expected 99, is " + << last_msg_->signed_messages[141]; + EXPECT_EQ(last_msg_->signed_messages[142], 42) + << "incorrect value for signed_messages[142], expected 42, is " + << last_msg_->signed_messages[142]; + EXPECT_EQ(last_msg_->signed_messages[143], 101) + << "incorrect value for signed_messages[143], expected 101, is " + << last_msg_->signed_messages[143]; + EXPECT_EQ(last_msg_->signed_messages[144], 152) + << "incorrect value for signed_messages[144], expected 152, is " + << last_msg_->signed_messages[144]; + EXPECT_EQ(last_msg_->signed_messages[145], 39) + << "incorrect value for signed_messages[145], expected 39, is " + << last_msg_->signed_messages[145]; + EXPECT_EQ(last_msg_->signed_messages[146], 89) + << "incorrect value for signed_messages[146], expected 89, is " + << last_msg_->signed_messages[146]; + EXPECT_EQ(last_msg_->signed_messages[147], 180) + << "incorrect value for signed_messages[147], expected 180, is " + << last_msg_->signed_messages[147]; + EXPECT_EQ(last_msg_->signed_messages[148], 64) + << "incorrect value for signed_messages[148], expected 64, is " + << last_msg_->signed_messages[148]; + EXPECT_EQ(last_msg_->signed_messages[149], 49) + << "incorrect value for signed_messages[149], expected 49, is " + << last_msg_->signed_messages[149]; + EXPECT_EQ(last_msg_->signed_messages[150], 6) + << "incorrect value for signed_messages[150], expected 6, is " + << last_msg_->signed_messages[150]; + EXPECT_EQ(last_msg_->signed_messages[151], 80) + << "incorrect value for signed_messages[151], expected 80, is " + << last_msg_->signed_messages[151]; + EXPECT_EQ(last_msg_->signed_messages[152], 172) + << "incorrect value for signed_messages[152], expected 172, is " + << last_msg_->signed_messages[152]; + EXPECT_EQ(last_msg_->signed_messages[153], 32) + << "incorrect value for signed_messages[153], expected 32, is " + << last_msg_->signed_messages[153]; + EXPECT_EQ(last_msg_->signed_messages[154], 109) + << "incorrect value for signed_messages[154], expected 109, is " + << last_msg_->signed_messages[154]; + EXPECT_EQ(last_msg_->signed_messages[155], 2) + << "incorrect value for signed_messages[155], expected 2, is " + << last_msg_->signed_messages[155]; + EXPECT_EQ(last_msg_->signed_messages[156], 119) + << "incorrect value for signed_messages[156], expected 119, is " + << last_msg_->signed_messages[156]; + EXPECT_EQ(last_msg_->signed_messages[157], 93) + << "incorrect value for signed_messages[157], expected 93, is " + << last_msg_->signed_messages[157]; + EXPECT_EQ(last_msg_->signed_messages[158], 176) + << "incorrect value for signed_messages[158], expected 176, is " + << last_msg_->signed_messages[158]; + EXPECT_EQ(last_msg_->signed_messages[159], 0) + << "incorrect value for signed_messages[159], expected 0, is " + << last_msg_->signed_messages[159]; + EXPECT_EQ(last_msg_->signed_messages[160], 33) + << "incorrect value for signed_messages[160], expected 33, is " + << last_msg_->signed_messages[160]; + EXPECT_EQ(last_msg_->signed_messages[161], 57) + << "incorrect value for signed_messages[161], expected 57, is " + << last_msg_->signed_messages[161]; + EXPECT_EQ(last_msg_->signed_messages[162], 34) + << "incorrect value for signed_messages[162], expected 34, is " + << last_msg_->signed_messages[162]; + EXPECT_EQ(last_msg_->signed_messages[163], 18) + << "incorrect value for signed_messages[163], expected 18, is " + << last_msg_->signed_messages[163]; + EXPECT_EQ(last_msg_->signed_messages[164], 85) + << "incorrect value for signed_messages[164], expected 85, is " + << last_msg_->signed_messages[164]; + EXPECT_EQ(last_msg_->signed_messages[165], 121) + << "incorrect value for signed_messages[165], expected 121, is " + << last_msg_->signed_messages[165]; + EXPECT_EQ(last_msg_->signed_messages[166], 137) + << "incorrect value for signed_messages[166], expected 137, is " + << last_msg_->signed_messages[166]; + EXPECT_EQ(last_msg_->signed_messages[167], 83) + << "incorrect value for signed_messages[167], expected 83, is " + << last_msg_->signed_messages[167]; + EXPECT_EQ(last_msg_->signed_messages[168], 111) + << "incorrect value for signed_messages[168], expected 111, is " + << last_msg_->signed_messages[168]; + EXPECT_EQ(last_msg_->signed_messages[169], 59) + << "incorrect value for signed_messages[169], expected 59, is " + << last_msg_->signed_messages[169]; + EXPECT_EQ(last_msg_->signed_messages[170], 7) + << "incorrect value for signed_messages[170], expected 7, is " + << last_msg_->signed_messages[170]; + EXPECT_EQ(last_msg_->signed_messages[171], 77) + << "incorrect value for signed_messages[171], expected 77, is " + << last_msg_->signed_messages[171]; + EXPECT_EQ(last_msg_->signed_messages[172], 4) + << "incorrect value for signed_messages[172], expected 4, is " + << last_msg_->signed_messages[172]; + EXPECT_EQ(last_msg_->signed_messages[173], 117) + << "incorrect value for signed_messages[173], expected 117, is " + << last_msg_->signed_messages[173]; + EXPECT_EQ(last_msg_->signed_messages[174], 159) + << "incorrect value for signed_messages[174], expected 159, is " + << last_msg_->signed_messages[174]; + EXPECT_EQ(last_msg_->signed_messages[175], 148) + << "incorrect value for signed_messages[175], expected 148, is " + << last_msg_->signed_messages[175]; + EXPECT_EQ(last_msg_->signed_messages[176], 35) + << "incorrect value for signed_messages[176], expected 35, is " + << last_msg_->signed_messages[176]; + EXPECT_EQ(last_msg_->signed_messages[177], 61) + << "incorrect value for signed_messages[177], expected 61, is " + << last_msg_->signed_messages[177]; + EXPECT_EQ(last_msg_->signed_messages[178], 41) + << "incorrect value for signed_messages[178], expected 41, is " + << last_msg_->signed_messages[178]; + EXPECT_EQ(last_msg_->signed_messages[179], 67) + << "incorrect value for signed_messages[179], expected 67, is " + << last_msg_->signed_messages[179]; + EXPECT_EQ(last_msg_->signed_messages[180], 46) + << "incorrect value for signed_messages[180], expected 46, is " + << last_msg_->signed_messages[180]; + EXPECT_EQ(last_msg_->signed_messages[181], 127) + << "incorrect value for signed_messages[181], expected 127, is " + << last_msg_->signed_messages[181]; + EXPECT_EQ(last_msg_->signed_messages[182], 75) + << "incorrect value for signed_messages[182], expected 75, is " + << last_msg_->signed_messages[182]; + EXPECT_EQ(last_msg_->signed_messages[183], 174) + << "incorrect value for signed_messages[183], expected 174, is " + << last_msg_->signed_messages[183]; + EXPECT_EQ(last_msg_->stream_counter, 1) + << "incorrect value for stream_counter, expected 1, is " + << last_msg_->stream_counter; } diff --git a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc index 309f7fe04..96504b064 100644 --- a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc +++ b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ecdsa_signature_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ecdsa_signature_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,515 +82,693 @@ class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ecdsa_signature_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB0, Test) -{ +}; - uint8_t encoded_frame[] = {85,7,12,66,0,83,0,1,2,1,2,3,4,72,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,10,21,23,254,159, }; +TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ecdsa_signature_dep_b_t* test_msg = ( msg_ecdsa_signature_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[0] = 1; - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[1] = 2; - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[2] = 3; - if (sizeof(test_msg->certificate_id) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); - } - test_msg->certificate_id[3] = 4; - test_msg->flags = 0; - test_msg->n_signature_bytes = 72; - test_msg->on_demand_counter = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[0] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[1] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[2] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[3] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[4] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[5] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[6] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[7] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[8] = 8; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[9] = 9; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[10] = 10; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[11] = 11; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[12] = 12; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[13] = 13; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[14] = 14; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[15] = 15; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[16] = 16; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[17] = 17; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[18] = 18; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[19] = 19; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[20] = 20; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[21] = 21; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[22] = 22; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[23] = 23; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[24] = 24; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[25] = 25; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[26] = 26; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[27] = 27; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[28] = 28; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[29] = 29; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[30] = 30; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[31] = 31; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[32] = 32; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[33] = 33; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[34] = 34; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[35] = 35; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[36] = 36; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[37] = 37; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[38] = 38; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[39] = 39; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[40] = 40; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[41] = 41; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[42] = 42; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[43] = 43; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[44] = 44; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[45] = 45; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[46] = 46; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[47] = 47; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[48] = 48; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[49] = 49; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[50] = 50; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[51] = 51; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[52] = 52; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[53] = 53; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[54] = 54; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[55] = 55; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[56] = 56; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[57] = 57; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[58] = 58; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[59] = 59; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[60] = 60; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[61] = 61; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[62] = 62; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[63] = 63; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[64] = 64; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[65] = 65; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[66] = 66; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[67] = 67; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[68] = 68; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[69] = 69; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[70] = 70; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[71] = 71; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[0] = 10; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[1] = 21; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[2] = 23; - test_msg->stream_counter = 1; - - EXPECT_EQ(send_message( 0xC07, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ecdsa_signature_dep_b_t *test_msg = + (msg_ecdsa_signature_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[0] = 1; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[1] = 2; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[2] = 3; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[3] = 4; + test_msg->flags = 0; + test_msg->n_signature_bytes = 72; + test_msg->on_demand_counter = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[0] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[1] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[2] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[3] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[4] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[5] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[6] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[7] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[8] = 8; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[9] = 9; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[10] = 10; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[11] = 11; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[12] = 12; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[13] = 13; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[14] = 14; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[15] = 15; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[16] = 16; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[17] = 17; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[18] = 18; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[19] = 19; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[20] = 20; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[21] = 21; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[22] = 22; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[23] = 23; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[24] = 24; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[25] = 25; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[26] = 26; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[27] = 27; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[28] = 28; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[29] = 29; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[30] = 30; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[31] = 31; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[32] = 32; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[33] = 33; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[34] = 34; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[35] = 35; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[36] = 36; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[37] = 37; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[38] = 38; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[39] = 39; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[40] = 40; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[41] = 41; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[42] = 42; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[43] = 43; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[44] = 44; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[45] = 45; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[46] = 46; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[47] = 47; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[48] = 48; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[49] = 49; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[50] = 50; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[51] = 51; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[52] = 52; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[53] = 53; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[54] = 54; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[55] = 55; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[56] = 56; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[57] = 57; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[58] = 58; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[59] = 59; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[60] = 60; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[61] = 61; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[62] = 62; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[63] = 63; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[64] = 64; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[65] = 65; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[66] = 66; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[67] = 67; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[68] = 68; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[69] = 69; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[70] = 70; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[71] = 71; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[0] = 10; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[1] = 21; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[2] = 23; + test_msg->stream_counter = 1; + + EXPECT_EQ(send_message(0xC07, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->certificate_id[0], 1) << "incorrect value for certificate_id[0], expected 1, is " << last_msg_->certificate_id[0]; - EXPECT_EQ(last_msg_->certificate_id[1], 2) << "incorrect value for certificate_id[1], expected 2, is " << last_msg_->certificate_id[1]; - EXPECT_EQ(last_msg_->certificate_id[2], 3) << "incorrect value for certificate_id[2], expected 3, is " << last_msg_->certificate_id[2]; - EXPECT_EQ(last_msg_->certificate_id[3], 4) << "incorrect value for certificate_id[3], expected 4, is " << last_msg_->certificate_id[3]; - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_signature_bytes, 72) << "incorrect value for n_signature_bytes, expected 72, is " << last_msg_->n_signature_bytes; - EXPECT_EQ(last_msg_->on_demand_counter, 2) << "incorrect value for on_demand_counter, expected 2, is " << last_msg_->on_demand_counter; - EXPECT_EQ(last_msg_->signature[0], 0) << "incorrect value for signature[0], expected 0, is " << last_msg_->signature[0]; - EXPECT_EQ(last_msg_->signature[1], 1) << "incorrect value for signature[1], expected 1, is " << last_msg_->signature[1]; - EXPECT_EQ(last_msg_->signature[2], 2) << "incorrect value for signature[2], expected 2, is " << last_msg_->signature[2]; - EXPECT_EQ(last_msg_->signature[3], 3) << "incorrect value for signature[3], expected 3, is " << last_msg_->signature[3]; - EXPECT_EQ(last_msg_->signature[4], 4) << "incorrect value for signature[4], expected 4, is " << last_msg_->signature[4]; - EXPECT_EQ(last_msg_->signature[5], 5) << "incorrect value for signature[5], expected 5, is " << last_msg_->signature[5]; - EXPECT_EQ(last_msg_->signature[6], 6) << "incorrect value for signature[6], expected 6, is " << last_msg_->signature[6]; - EXPECT_EQ(last_msg_->signature[7], 7) << "incorrect value for signature[7], expected 7, is " << last_msg_->signature[7]; - EXPECT_EQ(last_msg_->signature[8], 8) << "incorrect value for signature[8], expected 8, is " << last_msg_->signature[8]; - EXPECT_EQ(last_msg_->signature[9], 9) << "incorrect value for signature[9], expected 9, is " << last_msg_->signature[9]; - EXPECT_EQ(last_msg_->signature[10], 10) << "incorrect value for signature[10], expected 10, is " << last_msg_->signature[10]; - EXPECT_EQ(last_msg_->signature[11], 11) << "incorrect value for signature[11], expected 11, is " << last_msg_->signature[11]; - EXPECT_EQ(last_msg_->signature[12], 12) << "incorrect value for signature[12], expected 12, is " << last_msg_->signature[12]; - EXPECT_EQ(last_msg_->signature[13], 13) << "incorrect value for signature[13], expected 13, is " << last_msg_->signature[13]; - EXPECT_EQ(last_msg_->signature[14], 14) << "incorrect value for signature[14], expected 14, is " << last_msg_->signature[14]; - EXPECT_EQ(last_msg_->signature[15], 15) << "incorrect value for signature[15], expected 15, is " << last_msg_->signature[15]; - EXPECT_EQ(last_msg_->signature[16], 16) << "incorrect value for signature[16], expected 16, is " << last_msg_->signature[16]; - EXPECT_EQ(last_msg_->signature[17], 17) << "incorrect value for signature[17], expected 17, is " << last_msg_->signature[17]; - EXPECT_EQ(last_msg_->signature[18], 18) << "incorrect value for signature[18], expected 18, is " << last_msg_->signature[18]; - EXPECT_EQ(last_msg_->signature[19], 19) << "incorrect value for signature[19], expected 19, is " << last_msg_->signature[19]; - EXPECT_EQ(last_msg_->signature[20], 20) << "incorrect value for signature[20], expected 20, is " << last_msg_->signature[20]; - EXPECT_EQ(last_msg_->signature[21], 21) << "incorrect value for signature[21], expected 21, is " << last_msg_->signature[21]; - EXPECT_EQ(last_msg_->signature[22], 22) << "incorrect value for signature[22], expected 22, is " << last_msg_->signature[22]; - EXPECT_EQ(last_msg_->signature[23], 23) << "incorrect value for signature[23], expected 23, is " << last_msg_->signature[23]; - EXPECT_EQ(last_msg_->signature[24], 24) << "incorrect value for signature[24], expected 24, is " << last_msg_->signature[24]; - EXPECT_EQ(last_msg_->signature[25], 25) << "incorrect value for signature[25], expected 25, is " << last_msg_->signature[25]; - EXPECT_EQ(last_msg_->signature[26], 26) << "incorrect value for signature[26], expected 26, is " << last_msg_->signature[26]; - EXPECT_EQ(last_msg_->signature[27], 27) << "incorrect value for signature[27], expected 27, is " << last_msg_->signature[27]; - EXPECT_EQ(last_msg_->signature[28], 28) << "incorrect value for signature[28], expected 28, is " << last_msg_->signature[28]; - EXPECT_EQ(last_msg_->signature[29], 29) << "incorrect value for signature[29], expected 29, is " << last_msg_->signature[29]; - EXPECT_EQ(last_msg_->signature[30], 30) << "incorrect value for signature[30], expected 30, is " << last_msg_->signature[30]; - EXPECT_EQ(last_msg_->signature[31], 31) << "incorrect value for signature[31], expected 31, is " << last_msg_->signature[31]; - EXPECT_EQ(last_msg_->signature[32], 32) << "incorrect value for signature[32], expected 32, is " << last_msg_->signature[32]; - EXPECT_EQ(last_msg_->signature[33], 33) << "incorrect value for signature[33], expected 33, is " << last_msg_->signature[33]; - EXPECT_EQ(last_msg_->signature[34], 34) << "incorrect value for signature[34], expected 34, is " << last_msg_->signature[34]; - EXPECT_EQ(last_msg_->signature[35], 35) << "incorrect value for signature[35], expected 35, is " << last_msg_->signature[35]; - EXPECT_EQ(last_msg_->signature[36], 36) << "incorrect value for signature[36], expected 36, is " << last_msg_->signature[36]; - EXPECT_EQ(last_msg_->signature[37], 37) << "incorrect value for signature[37], expected 37, is " << last_msg_->signature[37]; - EXPECT_EQ(last_msg_->signature[38], 38) << "incorrect value for signature[38], expected 38, is " << last_msg_->signature[38]; - EXPECT_EQ(last_msg_->signature[39], 39) << "incorrect value for signature[39], expected 39, is " << last_msg_->signature[39]; - EXPECT_EQ(last_msg_->signature[40], 40) << "incorrect value for signature[40], expected 40, is " << last_msg_->signature[40]; - EXPECT_EQ(last_msg_->signature[41], 41) << "incorrect value for signature[41], expected 41, is " << last_msg_->signature[41]; - EXPECT_EQ(last_msg_->signature[42], 42) << "incorrect value for signature[42], expected 42, is " << last_msg_->signature[42]; - EXPECT_EQ(last_msg_->signature[43], 43) << "incorrect value for signature[43], expected 43, is " << last_msg_->signature[43]; - EXPECT_EQ(last_msg_->signature[44], 44) << "incorrect value for signature[44], expected 44, is " << last_msg_->signature[44]; - EXPECT_EQ(last_msg_->signature[45], 45) << "incorrect value for signature[45], expected 45, is " << last_msg_->signature[45]; - EXPECT_EQ(last_msg_->signature[46], 46) << "incorrect value for signature[46], expected 46, is " << last_msg_->signature[46]; - EXPECT_EQ(last_msg_->signature[47], 47) << "incorrect value for signature[47], expected 47, is " << last_msg_->signature[47]; - EXPECT_EQ(last_msg_->signature[48], 48) << "incorrect value for signature[48], expected 48, is " << last_msg_->signature[48]; - EXPECT_EQ(last_msg_->signature[49], 49) << "incorrect value for signature[49], expected 49, is " << last_msg_->signature[49]; - EXPECT_EQ(last_msg_->signature[50], 50) << "incorrect value for signature[50], expected 50, is " << last_msg_->signature[50]; - EXPECT_EQ(last_msg_->signature[51], 51) << "incorrect value for signature[51], expected 51, is " << last_msg_->signature[51]; - EXPECT_EQ(last_msg_->signature[52], 52) << "incorrect value for signature[52], expected 52, is " << last_msg_->signature[52]; - EXPECT_EQ(last_msg_->signature[53], 53) << "incorrect value for signature[53], expected 53, is " << last_msg_->signature[53]; - EXPECT_EQ(last_msg_->signature[54], 54) << "incorrect value for signature[54], expected 54, is " << last_msg_->signature[54]; - EXPECT_EQ(last_msg_->signature[55], 55) << "incorrect value for signature[55], expected 55, is " << last_msg_->signature[55]; - EXPECT_EQ(last_msg_->signature[56], 56) << "incorrect value for signature[56], expected 56, is " << last_msg_->signature[56]; - EXPECT_EQ(last_msg_->signature[57], 57) << "incorrect value for signature[57], expected 57, is " << last_msg_->signature[57]; - EXPECT_EQ(last_msg_->signature[58], 58) << "incorrect value for signature[58], expected 58, is " << last_msg_->signature[58]; - EXPECT_EQ(last_msg_->signature[59], 59) << "incorrect value for signature[59], expected 59, is " << last_msg_->signature[59]; - EXPECT_EQ(last_msg_->signature[60], 60) << "incorrect value for signature[60], expected 60, is " << last_msg_->signature[60]; - EXPECT_EQ(last_msg_->signature[61], 61) << "incorrect value for signature[61], expected 61, is " << last_msg_->signature[61]; - EXPECT_EQ(last_msg_->signature[62], 62) << "incorrect value for signature[62], expected 62, is " << last_msg_->signature[62]; - EXPECT_EQ(last_msg_->signature[63], 63) << "incorrect value for signature[63], expected 63, is " << last_msg_->signature[63]; - EXPECT_EQ(last_msg_->signature[64], 64) << "incorrect value for signature[64], expected 64, is " << last_msg_->signature[64]; - EXPECT_EQ(last_msg_->signature[65], 65) << "incorrect value for signature[65], expected 65, is " << last_msg_->signature[65]; - EXPECT_EQ(last_msg_->signature[66], 66) << "incorrect value for signature[66], expected 66, is " << last_msg_->signature[66]; - EXPECT_EQ(last_msg_->signature[67], 67) << "incorrect value for signature[67], expected 67, is " << last_msg_->signature[67]; - EXPECT_EQ(last_msg_->signature[68], 68) << "incorrect value for signature[68], expected 68, is " << last_msg_->signature[68]; - EXPECT_EQ(last_msg_->signature[69], 69) << "incorrect value for signature[69], expected 69, is " << last_msg_->signature[69]; - EXPECT_EQ(last_msg_->signature[70], 70) << "incorrect value for signature[70], expected 70, is " << last_msg_->signature[70]; - EXPECT_EQ(last_msg_->signature[71], 71) << "incorrect value for signature[71], expected 71, is " << last_msg_->signature[71]; - EXPECT_EQ(last_msg_->signed_messages[0], 10) << "incorrect value for signed_messages[0], expected 10, is " << last_msg_->signed_messages[0]; - EXPECT_EQ(last_msg_->signed_messages[1], 21) << "incorrect value for signed_messages[1], expected 21, is " << last_msg_->signed_messages[1]; - EXPECT_EQ(last_msg_->signed_messages[2], 23) << "incorrect value for signed_messages[2], expected 23, is " << last_msg_->signed_messages[2]; - EXPECT_EQ(last_msg_->stream_counter, 1) << "incorrect value for stream_counter, expected 1, is " << last_msg_->stream_counter; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->certificate_id[0], 1) + << "incorrect value for certificate_id[0], expected 1, is " + << last_msg_->certificate_id[0]; + EXPECT_EQ(last_msg_->certificate_id[1], 2) + << "incorrect value for certificate_id[1], expected 2, is " + << last_msg_->certificate_id[1]; + EXPECT_EQ(last_msg_->certificate_id[2], 3) + << "incorrect value for certificate_id[2], expected 3, is " + << last_msg_->certificate_id[2]; + EXPECT_EQ(last_msg_->certificate_id[3], 4) + << "incorrect value for certificate_id[3], expected 4, is " + << last_msg_->certificate_id[3]; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_signature_bytes, 72) + << "incorrect value for n_signature_bytes, expected 72, is " + << last_msg_->n_signature_bytes; + EXPECT_EQ(last_msg_->on_demand_counter, 2) + << "incorrect value for on_demand_counter, expected 2, is " + << last_msg_->on_demand_counter; + EXPECT_EQ(last_msg_->signature[0], 0) + << "incorrect value for signature[0], expected 0, is " + << last_msg_->signature[0]; + EXPECT_EQ(last_msg_->signature[1], 1) + << "incorrect value for signature[1], expected 1, is " + << last_msg_->signature[1]; + EXPECT_EQ(last_msg_->signature[2], 2) + << "incorrect value for signature[2], expected 2, is " + << last_msg_->signature[2]; + EXPECT_EQ(last_msg_->signature[3], 3) + << "incorrect value for signature[3], expected 3, is " + << last_msg_->signature[3]; + EXPECT_EQ(last_msg_->signature[4], 4) + << "incorrect value for signature[4], expected 4, is " + << last_msg_->signature[4]; + EXPECT_EQ(last_msg_->signature[5], 5) + << "incorrect value for signature[5], expected 5, is " + << last_msg_->signature[5]; + EXPECT_EQ(last_msg_->signature[6], 6) + << "incorrect value for signature[6], expected 6, is " + << last_msg_->signature[6]; + EXPECT_EQ(last_msg_->signature[7], 7) + << "incorrect value for signature[7], expected 7, is " + << last_msg_->signature[7]; + EXPECT_EQ(last_msg_->signature[8], 8) + << "incorrect value for signature[8], expected 8, is " + << last_msg_->signature[8]; + EXPECT_EQ(last_msg_->signature[9], 9) + << "incorrect value for signature[9], expected 9, is " + << last_msg_->signature[9]; + EXPECT_EQ(last_msg_->signature[10], 10) + << "incorrect value for signature[10], expected 10, is " + << last_msg_->signature[10]; + EXPECT_EQ(last_msg_->signature[11], 11) + << "incorrect value for signature[11], expected 11, is " + << last_msg_->signature[11]; + EXPECT_EQ(last_msg_->signature[12], 12) + << "incorrect value for signature[12], expected 12, is " + << last_msg_->signature[12]; + EXPECT_EQ(last_msg_->signature[13], 13) + << "incorrect value for signature[13], expected 13, is " + << last_msg_->signature[13]; + EXPECT_EQ(last_msg_->signature[14], 14) + << "incorrect value for signature[14], expected 14, is " + << last_msg_->signature[14]; + EXPECT_EQ(last_msg_->signature[15], 15) + << "incorrect value for signature[15], expected 15, is " + << last_msg_->signature[15]; + EXPECT_EQ(last_msg_->signature[16], 16) + << "incorrect value for signature[16], expected 16, is " + << last_msg_->signature[16]; + EXPECT_EQ(last_msg_->signature[17], 17) + << "incorrect value for signature[17], expected 17, is " + << last_msg_->signature[17]; + EXPECT_EQ(last_msg_->signature[18], 18) + << "incorrect value for signature[18], expected 18, is " + << last_msg_->signature[18]; + EXPECT_EQ(last_msg_->signature[19], 19) + << "incorrect value for signature[19], expected 19, is " + << last_msg_->signature[19]; + EXPECT_EQ(last_msg_->signature[20], 20) + << "incorrect value for signature[20], expected 20, is " + << last_msg_->signature[20]; + EXPECT_EQ(last_msg_->signature[21], 21) + << "incorrect value for signature[21], expected 21, is " + << last_msg_->signature[21]; + EXPECT_EQ(last_msg_->signature[22], 22) + << "incorrect value for signature[22], expected 22, is " + << last_msg_->signature[22]; + EXPECT_EQ(last_msg_->signature[23], 23) + << "incorrect value for signature[23], expected 23, is " + << last_msg_->signature[23]; + EXPECT_EQ(last_msg_->signature[24], 24) + << "incorrect value for signature[24], expected 24, is " + << last_msg_->signature[24]; + EXPECT_EQ(last_msg_->signature[25], 25) + << "incorrect value for signature[25], expected 25, is " + << last_msg_->signature[25]; + EXPECT_EQ(last_msg_->signature[26], 26) + << "incorrect value for signature[26], expected 26, is " + << last_msg_->signature[26]; + EXPECT_EQ(last_msg_->signature[27], 27) + << "incorrect value for signature[27], expected 27, is " + << last_msg_->signature[27]; + EXPECT_EQ(last_msg_->signature[28], 28) + << "incorrect value for signature[28], expected 28, is " + << last_msg_->signature[28]; + EXPECT_EQ(last_msg_->signature[29], 29) + << "incorrect value for signature[29], expected 29, is " + << last_msg_->signature[29]; + EXPECT_EQ(last_msg_->signature[30], 30) + << "incorrect value for signature[30], expected 30, is " + << last_msg_->signature[30]; + EXPECT_EQ(last_msg_->signature[31], 31) + << "incorrect value for signature[31], expected 31, is " + << last_msg_->signature[31]; + EXPECT_EQ(last_msg_->signature[32], 32) + << "incorrect value for signature[32], expected 32, is " + << last_msg_->signature[32]; + EXPECT_EQ(last_msg_->signature[33], 33) + << "incorrect value for signature[33], expected 33, is " + << last_msg_->signature[33]; + EXPECT_EQ(last_msg_->signature[34], 34) + << "incorrect value for signature[34], expected 34, is " + << last_msg_->signature[34]; + EXPECT_EQ(last_msg_->signature[35], 35) + << "incorrect value for signature[35], expected 35, is " + << last_msg_->signature[35]; + EXPECT_EQ(last_msg_->signature[36], 36) + << "incorrect value for signature[36], expected 36, is " + << last_msg_->signature[36]; + EXPECT_EQ(last_msg_->signature[37], 37) + << "incorrect value for signature[37], expected 37, is " + << last_msg_->signature[37]; + EXPECT_EQ(last_msg_->signature[38], 38) + << "incorrect value for signature[38], expected 38, is " + << last_msg_->signature[38]; + EXPECT_EQ(last_msg_->signature[39], 39) + << "incorrect value for signature[39], expected 39, is " + << last_msg_->signature[39]; + EXPECT_EQ(last_msg_->signature[40], 40) + << "incorrect value for signature[40], expected 40, is " + << last_msg_->signature[40]; + EXPECT_EQ(last_msg_->signature[41], 41) + << "incorrect value for signature[41], expected 41, is " + << last_msg_->signature[41]; + EXPECT_EQ(last_msg_->signature[42], 42) + << "incorrect value for signature[42], expected 42, is " + << last_msg_->signature[42]; + EXPECT_EQ(last_msg_->signature[43], 43) + << "incorrect value for signature[43], expected 43, is " + << last_msg_->signature[43]; + EXPECT_EQ(last_msg_->signature[44], 44) + << "incorrect value for signature[44], expected 44, is " + << last_msg_->signature[44]; + EXPECT_EQ(last_msg_->signature[45], 45) + << "incorrect value for signature[45], expected 45, is " + << last_msg_->signature[45]; + EXPECT_EQ(last_msg_->signature[46], 46) + << "incorrect value for signature[46], expected 46, is " + << last_msg_->signature[46]; + EXPECT_EQ(last_msg_->signature[47], 47) + << "incorrect value for signature[47], expected 47, is " + << last_msg_->signature[47]; + EXPECT_EQ(last_msg_->signature[48], 48) + << "incorrect value for signature[48], expected 48, is " + << last_msg_->signature[48]; + EXPECT_EQ(last_msg_->signature[49], 49) + << "incorrect value for signature[49], expected 49, is " + << last_msg_->signature[49]; + EXPECT_EQ(last_msg_->signature[50], 50) + << "incorrect value for signature[50], expected 50, is " + << last_msg_->signature[50]; + EXPECT_EQ(last_msg_->signature[51], 51) + << "incorrect value for signature[51], expected 51, is " + << last_msg_->signature[51]; + EXPECT_EQ(last_msg_->signature[52], 52) + << "incorrect value for signature[52], expected 52, is " + << last_msg_->signature[52]; + EXPECT_EQ(last_msg_->signature[53], 53) + << "incorrect value for signature[53], expected 53, is " + << last_msg_->signature[53]; + EXPECT_EQ(last_msg_->signature[54], 54) + << "incorrect value for signature[54], expected 54, is " + << last_msg_->signature[54]; + EXPECT_EQ(last_msg_->signature[55], 55) + << "incorrect value for signature[55], expected 55, is " + << last_msg_->signature[55]; + EXPECT_EQ(last_msg_->signature[56], 56) + << "incorrect value for signature[56], expected 56, is " + << last_msg_->signature[56]; + EXPECT_EQ(last_msg_->signature[57], 57) + << "incorrect value for signature[57], expected 57, is " + << last_msg_->signature[57]; + EXPECT_EQ(last_msg_->signature[58], 58) + << "incorrect value for signature[58], expected 58, is " + << last_msg_->signature[58]; + EXPECT_EQ(last_msg_->signature[59], 59) + << "incorrect value for signature[59], expected 59, is " + << last_msg_->signature[59]; + EXPECT_EQ(last_msg_->signature[60], 60) + << "incorrect value for signature[60], expected 60, is " + << last_msg_->signature[60]; + EXPECT_EQ(last_msg_->signature[61], 61) + << "incorrect value for signature[61], expected 61, is " + << last_msg_->signature[61]; + EXPECT_EQ(last_msg_->signature[62], 62) + << "incorrect value for signature[62], expected 62, is " + << last_msg_->signature[62]; + EXPECT_EQ(last_msg_->signature[63], 63) + << "incorrect value for signature[63], expected 63, is " + << last_msg_->signature[63]; + EXPECT_EQ(last_msg_->signature[64], 64) + << "incorrect value for signature[64], expected 64, is " + << last_msg_->signature[64]; + EXPECT_EQ(last_msg_->signature[65], 65) + << "incorrect value for signature[65], expected 65, is " + << last_msg_->signature[65]; + EXPECT_EQ(last_msg_->signature[66], 66) + << "incorrect value for signature[66], expected 66, is " + << last_msg_->signature[66]; + EXPECT_EQ(last_msg_->signature[67], 67) + << "incorrect value for signature[67], expected 67, is " + << last_msg_->signature[67]; + EXPECT_EQ(last_msg_->signature[68], 68) + << "incorrect value for signature[68], expected 68, is " + << last_msg_->signature[68]; + EXPECT_EQ(last_msg_->signature[69], 69) + << "incorrect value for signature[69], expected 69, is " + << last_msg_->signature[69]; + EXPECT_EQ(last_msg_->signature[70], 70) + << "incorrect value for signature[70], expected 70, is " + << last_msg_->signature[70]; + EXPECT_EQ(last_msg_->signature[71], 71) + << "incorrect value for signature[71], expected 71, is " + << last_msg_->signature[71]; + EXPECT_EQ(last_msg_->signed_messages[0], 10) + << "incorrect value for signed_messages[0], expected 10, is " + << last_msg_->signed_messages[0]; + EXPECT_EQ(last_msg_->signed_messages[1], 21) + << "incorrect value for signed_messages[1], expected 21, is " + << last_msg_->signed_messages[1]; + EXPECT_EQ(last_msg_->signed_messages[2], 23) + << "incorrect value for signed_messages[2], expected 23, is " + << last_msg_->signed_messages[2]; + EXPECT_EQ(last_msg_->stream_counter, 1) + << "incorrect value for stream_counter, expected 1, is " + << last_msg_->stream_counter; } diff --git a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEd25519CertificateDep.cc b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEd25519CertificateDep.cc index 3fb98cb0a..6416a947d 100644 --- a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEd25519CertificateDep.cc +++ b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEd25519CertificateDep.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519CertificateDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519CertificateDep.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ed25519_certificate_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ed25519_certificate_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,665 +82,969 @@ class Test_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ed25519_certificate_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep0, Test) -{ +}; - uint8_t encoded_frame[] = {85,2,12,66,0,106,16,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,123,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,177,180,183,186,189,192,195,198,201,204,207,210,213,216,219,222,225,228,231,234,237,240,243,246,249,252,218,148, }; +TEST_F(Test_legacy_auto_check_sbp_signing_MsgEd25519CertificateDep0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 12, 66, 0, 106, 16, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 0, 3, 6, + 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, + 54, 57, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, + 99, 102, 105, 108, 111, 114, 117, 120, 123, 126, 129, 132, 135, 138, 141, + 144, 147, 150, 153, 156, 159, 162, 165, 168, 171, 174, 177, 180, 183, 186, + 189, 192, 195, 198, 201, 204, 207, 210, 213, 216, 219, 222, 225, 228, 231, + 234, 237, 240, 243, 246, 249, 252, 218, 148, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ed25519_certificate_dep_t* test_msg = ( msg_ed25519_certificate_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[0] = 0; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[1] = 3; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[2] = 6; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[3] = 9; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[4] = 12; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[5] = 15; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[6] = 18; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[7] = 21; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[8] = 24; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[9] = 27; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[10] = 30; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[11] = 33; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[12] = 36; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[13] = 39; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[14] = 42; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[15] = 45; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[16] = 48; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[17] = 51; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[18] = 54; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[19] = 57; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[20] = 60; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[21] = 63; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[22] = 66; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[23] = 69; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[24] = 72; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[25] = 75; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[26] = 78; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[27] = 81; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[28] = 84; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[29] = 87; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[30] = 90; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[31] = 93; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[32] = 96; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[33] = 99; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[34] = 102; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[35] = 105; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[36] = 108; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[37] = 111; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[38] = 114; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[39] = 117; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[40] = 120; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[41] = 123; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[42] = 126; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[43] = 129; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[44] = 132; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[45] = 135; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[46] = 138; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[47] = 141; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[48] = 144; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[49] = 147; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[50] = 150; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[51] = 153; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[52] = 156; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[53] = 159; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[54] = 162; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[55] = 165; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[56] = 168; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[57] = 171; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[58] = 174; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[59] = 177; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[60] = 180; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[61] = 183; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[62] = 186; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[63] = 189; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[64] = 192; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[65] = 195; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[66] = 198; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[67] = 201; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[68] = 204; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[69] = 207; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[70] = 210; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[71] = 213; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[72] = 216; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[73] = 219; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[74] = 222; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[75] = 225; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[76] = 228; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[77] = 231; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[78] = 234; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[79] = 237; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[80] = 240; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[81] = 243; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[82] = 246; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[83] = 249; - if (sizeof(test_msg->certificate_bytes) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); - } - test_msg->certificate_bytes[84] = 252; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[0] = 100; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[1] = 101; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[2] = 102; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[3] = 103; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[4] = 104; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[5] = 105; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[6] = 106; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[7] = 107; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[8] = 108; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[9] = 109; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[10] = 110; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[11] = 111; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[12] = 112; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[13] = 113; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[14] = 114; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[15] = 115; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[16] = 116; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[17] = 117; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[18] = 118; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[19] = 119; - test_msg->n_msg = 16; - - EXPECT_EQ(send_message( 0xC02, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ed25519_certificate_dep_t *test_msg = + (msg_ed25519_certificate_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[0] = 0; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[1] = 3; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[2] = 6; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[3] = 9; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[4] = 12; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[5] = 15; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[6] = 18; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[7] = 21; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[8] = 24; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[9] = 27; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[10] = 30; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[11] = 33; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[12] = 36; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[13] = 39; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[14] = 42; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[15] = 45; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[16] = 48; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[17] = 51; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[18] = 54; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[19] = 57; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[20] = 60; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[21] = 63; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[22] = 66; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[23] = 69; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[24] = 72; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[25] = 75; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[26] = 78; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[27] = 81; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[28] = 84; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[29] = 87; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[30] = 90; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[31] = 93; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[32] = 96; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[33] = 99; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[34] = 102; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[35] = 105; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[36] = 108; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[37] = 111; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[38] = 114; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[39] = 117; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[40] = 120; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[41] = 123; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[42] = 126; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[43] = 129; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[44] = 132; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[45] = 135; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[46] = 138; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[47] = 141; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[48] = 144; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[49] = 147; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[50] = 150; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[51] = 153; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[52] = 156; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[53] = 159; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[54] = 162; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[55] = 165; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[56] = 168; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[57] = 171; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[58] = 174; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[59] = 177; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[60] = 180; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[61] = 183; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[62] = 186; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[63] = 189; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[64] = 192; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[65] = 195; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[66] = 198; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[67] = 201; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[68] = 204; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[69] = 207; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[70] = 210; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[71] = 213; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[72] = 216; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[73] = 219; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[74] = 222; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[75] = 225; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[76] = 228; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[77] = 231; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[78] = 234; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[79] = 237; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[80] = 240; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[81] = 243; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[82] = 246; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[83] = 249; + if (sizeof(test_msg->certificate_bytes) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_bytes[0])); + } + test_msg->certificate_bytes[84] = 252; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[0] = 100; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[1] = 101; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[2] = 102; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[3] = 103; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[4] = 104; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[5] = 105; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[6] = 106; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[7] = 107; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[8] = 108; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[9] = 109; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[10] = 110; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[11] = 111; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[12] = 112; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[13] = 113; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[14] = 114; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[15] = 115; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[16] = 116; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[17] = 117; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[18] = 118; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[19] = 119; + test_msg->n_msg = 16; + + EXPECT_EQ(send_message(0xC02, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->certificate_bytes[0], 0) << "incorrect value for certificate_bytes[0], expected 0, is " << last_msg_->certificate_bytes[0]; - EXPECT_EQ(last_msg_->certificate_bytes[1], 3) << "incorrect value for certificate_bytes[1], expected 3, is " << last_msg_->certificate_bytes[1]; - EXPECT_EQ(last_msg_->certificate_bytes[2], 6) << "incorrect value for certificate_bytes[2], expected 6, is " << last_msg_->certificate_bytes[2]; - EXPECT_EQ(last_msg_->certificate_bytes[3], 9) << "incorrect value for certificate_bytes[3], expected 9, is " << last_msg_->certificate_bytes[3]; - EXPECT_EQ(last_msg_->certificate_bytes[4], 12) << "incorrect value for certificate_bytes[4], expected 12, is " << last_msg_->certificate_bytes[4]; - EXPECT_EQ(last_msg_->certificate_bytes[5], 15) << "incorrect value for certificate_bytes[5], expected 15, is " << last_msg_->certificate_bytes[5]; - EXPECT_EQ(last_msg_->certificate_bytes[6], 18) << "incorrect value for certificate_bytes[6], expected 18, is " << last_msg_->certificate_bytes[6]; - EXPECT_EQ(last_msg_->certificate_bytes[7], 21) << "incorrect value for certificate_bytes[7], expected 21, is " << last_msg_->certificate_bytes[7]; - EXPECT_EQ(last_msg_->certificate_bytes[8], 24) << "incorrect value for certificate_bytes[8], expected 24, is " << last_msg_->certificate_bytes[8]; - EXPECT_EQ(last_msg_->certificate_bytes[9], 27) << "incorrect value for certificate_bytes[9], expected 27, is " << last_msg_->certificate_bytes[9]; - EXPECT_EQ(last_msg_->certificate_bytes[10], 30) << "incorrect value for certificate_bytes[10], expected 30, is " << last_msg_->certificate_bytes[10]; - EXPECT_EQ(last_msg_->certificate_bytes[11], 33) << "incorrect value for certificate_bytes[11], expected 33, is " << last_msg_->certificate_bytes[11]; - EXPECT_EQ(last_msg_->certificate_bytes[12], 36) << "incorrect value for certificate_bytes[12], expected 36, is " << last_msg_->certificate_bytes[12]; - EXPECT_EQ(last_msg_->certificate_bytes[13], 39) << "incorrect value for certificate_bytes[13], expected 39, is " << last_msg_->certificate_bytes[13]; - EXPECT_EQ(last_msg_->certificate_bytes[14], 42) << "incorrect value for certificate_bytes[14], expected 42, is " << last_msg_->certificate_bytes[14]; - EXPECT_EQ(last_msg_->certificate_bytes[15], 45) << "incorrect value for certificate_bytes[15], expected 45, is " << last_msg_->certificate_bytes[15]; - EXPECT_EQ(last_msg_->certificate_bytes[16], 48) << "incorrect value for certificate_bytes[16], expected 48, is " << last_msg_->certificate_bytes[16]; - EXPECT_EQ(last_msg_->certificate_bytes[17], 51) << "incorrect value for certificate_bytes[17], expected 51, is " << last_msg_->certificate_bytes[17]; - EXPECT_EQ(last_msg_->certificate_bytes[18], 54) << "incorrect value for certificate_bytes[18], expected 54, is " << last_msg_->certificate_bytes[18]; - EXPECT_EQ(last_msg_->certificate_bytes[19], 57) << "incorrect value for certificate_bytes[19], expected 57, is " << last_msg_->certificate_bytes[19]; - EXPECT_EQ(last_msg_->certificate_bytes[20], 60) << "incorrect value for certificate_bytes[20], expected 60, is " << last_msg_->certificate_bytes[20]; - EXPECT_EQ(last_msg_->certificate_bytes[21], 63) << "incorrect value for certificate_bytes[21], expected 63, is " << last_msg_->certificate_bytes[21]; - EXPECT_EQ(last_msg_->certificate_bytes[22], 66) << "incorrect value for certificate_bytes[22], expected 66, is " << last_msg_->certificate_bytes[22]; - EXPECT_EQ(last_msg_->certificate_bytes[23], 69) << "incorrect value for certificate_bytes[23], expected 69, is " << last_msg_->certificate_bytes[23]; - EXPECT_EQ(last_msg_->certificate_bytes[24], 72) << "incorrect value for certificate_bytes[24], expected 72, is " << last_msg_->certificate_bytes[24]; - EXPECT_EQ(last_msg_->certificate_bytes[25], 75) << "incorrect value for certificate_bytes[25], expected 75, is " << last_msg_->certificate_bytes[25]; - EXPECT_EQ(last_msg_->certificate_bytes[26], 78) << "incorrect value for certificate_bytes[26], expected 78, is " << last_msg_->certificate_bytes[26]; - EXPECT_EQ(last_msg_->certificate_bytes[27], 81) << "incorrect value for certificate_bytes[27], expected 81, is " << last_msg_->certificate_bytes[27]; - EXPECT_EQ(last_msg_->certificate_bytes[28], 84) << "incorrect value for certificate_bytes[28], expected 84, is " << last_msg_->certificate_bytes[28]; - EXPECT_EQ(last_msg_->certificate_bytes[29], 87) << "incorrect value for certificate_bytes[29], expected 87, is " << last_msg_->certificate_bytes[29]; - EXPECT_EQ(last_msg_->certificate_bytes[30], 90) << "incorrect value for certificate_bytes[30], expected 90, is " << last_msg_->certificate_bytes[30]; - EXPECT_EQ(last_msg_->certificate_bytes[31], 93) << "incorrect value for certificate_bytes[31], expected 93, is " << last_msg_->certificate_bytes[31]; - EXPECT_EQ(last_msg_->certificate_bytes[32], 96) << "incorrect value for certificate_bytes[32], expected 96, is " << last_msg_->certificate_bytes[32]; - EXPECT_EQ(last_msg_->certificate_bytes[33], 99) << "incorrect value for certificate_bytes[33], expected 99, is " << last_msg_->certificate_bytes[33]; - EXPECT_EQ(last_msg_->certificate_bytes[34], 102) << "incorrect value for certificate_bytes[34], expected 102, is " << last_msg_->certificate_bytes[34]; - EXPECT_EQ(last_msg_->certificate_bytes[35], 105) << "incorrect value for certificate_bytes[35], expected 105, is " << last_msg_->certificate_bytes[35]; - EXPECT_EQ(last_msg_->certificate_bytes[36], 108) << "incorrect value for certificate_bytes[36], expected 108, is " << last_msg_->certificate_bytes[36]; - EXPECT_EQ(last_msg_->certificate_bytes[37], 111) << "incorrect value for certificate_bytes[37], expected 111, is " << last_msg_->certificate_bytes[37]; - EXPECT_EQ(last_msg_->certificate_bytes[38], 114) << "incorrect value for certificate_bytes[38], expected 114, is " << last_msg_->certificate_bytes[38]; - EXPECT_EQ(last_msg_->certificate_bytes[39], 117) << "incorrect value for certificate_bytes[39], expected 117, is " << last_msg_->certificate_bytes[39]; - EXPECT_EQ(last_msg_->certificate_bytes[40], 120) << "incorrect value for certificate_bytes[40], expected 120, is " << last_msg_->certificate_bytes[40]; - EXPECT_EQ(last_msg_->certificate_bytes[41], 123) << "incorrect value for certificate_bytes[41], expected 123, is " << last_msg_->certificate_bytes[41]; - EXPECT_EQ(last_msg_->certificate_bytes[42], 126) << "incorrect value for certificate_bytes[42], expected 126, is " << last_msg_->certificate_bytes[42]; - EXPECT_EQ(last_msg_->certificate_bytes[43], 129) << "incorrect value for certificate_bytes[43], expected 129, is " << last_msg_->certificate_bytes[43]; - EXPECT_EQ(last_msg_->certificate_bytes[44], 132) << "incorrect value for certificate_bytes[44], expected 132, is " << last_msg_->certificate_bytes[44]; - EXPECT_EQ(last_msg_->certificate_bytes[45], 135) << "incorrect value for certificate_bytes[45], expected 135, is " << last_msg_->certificate_bytes[45]; - EXPECT_EQ(last_msg_->certificate_bytes[46], 138) << "incorrect value for certificate_bytes[46], expected 138, is " << last_msg_->certificate_bytes[46]; - EXPECT_EQ(last_msg_->certificate_bytes[47], 141) << "incorrect value for certificate_bytes[47], expected 141, is " << last_msg_->certificate_bytes[47]; - EXPECT_EQ(last_msg_->certificate_bytes[48], 144) << "incorrect value for certificate_bytes[48], expected 144, is " << last_msg_->certificate_bytes[48]; - EXPECT_EQ(last_msg_->certificate_bytes[49], 147) << "incorrect value for certificate_bytes[49], expected 147, is " << last_msg_->certificate_bytes[49]; - EXPECT_EQ(last_msg_->certificate_bytes[50], 150) << "incorrect value for certificate_bytes[50], expected 150, is " << last_msg_->certificate_bytes[50]; - EXPECT_EQ(last_msg_->certificate_bytes[51], 153) << "incorrect value for certificate_bytes[51], expected 153, is " << last_msg_->certificate_bytes[51]; - EXPECT_EQ(last_msg_->certificate_bytes[52], 156) << "incorrect value for certificate_bytes[52], expected 156, is " << last_msg_->certificate_bytes[52]; - EXPECT_EQ(last_msg_->certificate_bytes[53], 159) << "incorrect value for certificate_bytes[53], expected 159, is " << last_msg_->certificate_bytes[53]; - EXPECT_EQ(last_msg_->certificate_bytes[54], 162) << "incorrect value for certificate_bytes[54], expected 162, is " << last_msg_->certificate_bytes[54]; - EXPECT_EQ(last_msg_->certificate_bytes[55], 165) << "incorrect value for certificate_bytes[55], expected 165, is " << last_msg_->certificate_bytes[55]; - EXPECT_EQ(last_msg_->certificate_bytes[56], 168) << "incorrect value for certificate_bytes[56], expected 168, is " << last_msg_->certificate_bytes[56]; - EXPECT_EQ(last_msg_->certificate_bytes[57], 171) << "incorrect value for certificate_bytes[57], expected 171, is " << last_msg_->certificate_bytes[57]; - EXPECT_EQ(last_msg_->certificate_bytes[58], 174) << "incorrect value for certificate_bytes[58], expected 174, is " << last_msg_->certificate_bytes[58]; - EXPECT_EQ(last_msg_->certificate_bytes[59], 177) << "incorrect value for certificate_bytes[59], expected 177, is " << last_msg_->certificate_bytes[59]; - EXPECT_EQ(last_msg_->certificate_bytes[60], 180) << "incorrect value for certificate_bytes[60], expected 180, is " << last_msg_->certificate_bytes[60]; - EXPECT_EQ(last_msg_->certificate_bytes[61], 183) << "incorrect value for certificate_bytes[61], expected 183, is " << last_msg_->certificate_bytes[61]; - EXPECT_EQ(last_msg_->certificate_bytes[62], 186) << "incorrect value for certificate_bytes[62], expected 186, is " << last_msg_->certificate_bytes[62]; - EXPECT_EQ(last_msg_->certificate_bytes[63], 189) << "incorrect value for certificate_bytes[63], expected 189, is " << last_msg_->certificate_bytes[63]; - EXPECT_EQ(last_msg_->certificate_bytes[64], 192) << "incorrect value for certificate_bytes[64], expected 192, is " << last_msg_->certificate_bytes[64]; - EXPECT_EQ(last_msg_->certificate_bytes[65], 195) << "incorrect value for certificate_bytes[65], expected 195, is " << last_msg_->certificate_bytes[65]; - EXPECT_EQ(last_msg_->certificate_bytes[66], 198) << "incorrect value for certificate_bytes[66], expected 198, is " << last_msg_->certificate_bytes[66]; - EXPECT_EQ(last_msg_->certificate_bytes[67], 201) << "incorrect value for certificate_bytes[67], expected 201, is " << last_msg_->certificate_bytes[67]; - EXPECT_EQ(last_msg_->certificate_bytes[68], 204) << "incorrect value for certificate_bytes[68], expected 204, is " << last_msg_->certificate_bytes[68]; - EXPECT_EQ(last_msg_->certificate_bytes[69], 207) << "incorrect value for certificate_bytes[69], expected 207, is " << last_msg_->certificate_bytes[69]; - EXPECT_EQ(last_msg_->certificate_bytes[70], 210) << "incorrect value for certificate_bytes[70], expected 210, is " << last_msg_->certificate_bytes[70]; - EXPECT_EQ(last_msg_->certificate_bytes[71], 213) << "incorrect value for certificate_bytes[71], expected 213, is " << last_msg_->certificate_bytes[71]; - EXPECT_EQ(last_msg_->certificate_bytes[72], 216) << "incorrect value for certificate_bytes[72], expected 216, is " << last_msg_->certificate_bytes[72]; - EXPECT_EQ(last_msg_->certificate_bytes[73], 219) << "incorrect value for certificate_bytes[73], expected 219, is " << last_msg_->certificate_bytes[73]; - EXPECT_EQ(last_msg_->certificate_bytes[74], 222) << "incorrect value for certificate_bytes[74], expected 222, is " << last_msg_->certificate_bytes[74]; - EXPECT_EQ(last_msg_->certificate_bytes[75], 225) << "incorrect value for certificate_bytes[75], expected 225, is " << last_msg_->certificate_bytes[75]; - EXPECT_EQ(last_msg_->certificate_bytes[76], 228) << "incorrect value for certificate_bytes[76], expected 228, is " << last_msg_->certificate_bytes[76]; - EXPECT_EQ(last_msg_->certificate_bytes[77], 231) << "incorrect value for certificate_bytes[77], expected 231, is " << last_msg_->certificate_bytes[77]; - EXPECT_EQ(last_msg_->certificate_bytes[78], 234) << "incorrect value for certificate_bytes[78], expected 234, is " << last_msg_->certificate_bytes[78]; - EXPECT_EQ(last_msg_->certificate_bytes[79], 237) << "incorrect value for certificate_bytes[79], expected 237, is " << last_msg_->certificate_bytes[79]; - EXPECT_EQ(last_msg_->certificate_bytes[80], 240) << "incorrect value for certificate_bytes[80], expected 240, is " << last_msg_->certificate_bytes[80]; - EXPECT_EQ(last_msg_->certificate_bytes[81], 243) << "incorrect value for certificate_bytes[81], expected 243, is " << last_msg_->certificate_bytes[81]; - EXPECT_EQ(last_msg_->certificate_bytes[82], 246) << "incorrect value for certificate_bytes[82], expected 246, is " << last_msg_->certificate_bytes[82]; - EXPECT_EQ(last_msg_->certificate_bytes[83], 249) << "incorrect value for certificate_bytes[83], expected 249, is " << last_msg_->certificate_bytes[83]; - EXPECT_EQ(last_msg_->certificate_bytes[84], 252) << "incorrect value for certificate_bytes[84], expected 252, is " << last_msg_->certificate_bytes[84]; - EXPECT_EQ(last_msg_->fingerprint[0], 100) << "incorrect value for fingerprint[0], expected 100, is " << last_msg_->fingerprint[0]; - EXPECT_EQ(last_msg_->fingerprint[1], 101) << "incorrect value for fingerprint[1], expected 101, is " << last_msg_->fingerprint[1]; - EXPECT_EQ(last_msg_->fingerprint[2], 102) << "incorrect value for fingerprint[2], expected 102, is " << last_msg_->fingerprint[2]; - EXPECT_EQ(last_msg_->fingerprint[3], 103) << "incorrect value for fingerprint[3], expected 103, is " << last_msg_->fingerprint[3]; - EXPECT_EQ(last_msg_->fingerprint[4], 104) << "incorrect value for fingerprint[4], expected 104, is " << last_msg_->fingerprint[4]; - EXPECT_EQ(last_msg_->fingerprint[5], 105) << "incorrect value for fingerprint[5], expected 105, is " << last_msg_->fingerprint[5]; - EXPECT_EQ(last_msg_->fingerprint[6], 106) << "incorrect value for fingerprint[6], expected 106, is " << last_msg_->fingerprint[6]; - EXPECT_EQ(last_msg_->fingerprint[7], 107) << "incorrect value for fingerprint[7], expected 107, is " << last_msg_->fingerprint[7]; - EXPECT_EQ(last_msg_->fingerprint[8], 108) << "incorrect value for fingerprint[8], expected 108, is " << last_msg_->fingerprint[8]; - EXPECT_EQ(last_msg_->fingerprint[9], 109) << "incorrect value for fingerprint[9], expected 109, is " << last_msg_->fingerprint[9]; - EXPECT_EQ(last_msg_->fingerprint[10], 110) << "incorrect value for fingerprint[10], expected 110, is " << last_msg_->fingerprint[10]; - EXPECT_EQ(last_msg_->fingerprint[11], 111) << "incorrect value for fingerprint[11], expected 111, is " << last_msg_->fingerprint[11]; - EXPECT_EQ(last_msg_->fingerprint[12], 112) << "incorrect value for fingerprint[12], expected 112, is " << last_msg_->fingerprint[12]; - EXPECT_EQ(last_msg_->fingerprint[13], 113) << "incorrect value for fingerprint[13], expected 113, is " << last_msg_->fingerprint[13]; - EXPECT_EQ(last_msg_->fingerprint[14], 114) << "incorrect value for fingerprint[14], expected 114, is " << last_msg_->fingerprint[14]; - EXPECT_EQ(last_msg_->fingerprint[15], 115) << "incorrect value for fingerprint[15], expected 115, is " << last_msg_->fingerprint[15]; - EXPECT_EQ(last_msg_->fingerprint[16], 116) << "incorrect value for fingerprint[16], expected 116, is " << last_msg_->fingerprint[16]; - EXPECT_EQ(last_msg_->fingerprint[17], 117) << "incorrect value for fingerprint[17], expected 117, is " << last_msg_->fingerprint[17]; - EXPECT_EQ(last_msg_->fingerprint[18], 118) << "incorrect value for fingerprint[18], expected 118, is " << last_msg_->fingerprint[18]; - EXPECT_EQ(last_msg_->fingerprint[19], 119) << "incorrect value for fingerprint[19], expected 119, is " << last_msg_->fingerprint[19]; - EXPECT_EQ(last_msg_->n_msg, 16) << "incorrect value for n_msg, expected 16, is " << last_msg_->n_msg; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->certificate_bytes[0], 0) + << "incorrect value for certificate_bytes[0], expected 0, is " + << last_msg_->certificate_bytes[0]; + EXPECT_EQ(last_msg_->certificate_bytes[1], 3) + << "incorrect value for certificate_bytes[1], expected 3, is " + << last_msg_->certificate_bytes[1]; + EXPECT_EQ(last_msg_->certificate_bytes[2], 6) + << "incorrect value for certificate_bytes[2], expected 6, is " + << last_msg_->certificate_bytes[2]; + EXPECT_EQ(last_msg_->certificate_bytes[3], 9) + << "incorrect value for certificate_bytes[3], expected 9, is " + << last_msg_->certificate_bytes[3]; + EXPECT_EQ(last_msg_->certificate_bytes[4], 12) + << "incorrect value for certificate_bytes[4], expected 12, is " + << last_msg_->certificate_bytes[4]; + EXPECT_EQ(last_msg_->certificate_bytes[5], 15) + << "incorrect value for certificate_bytes[5], expected 15, is " + << last_msg_->certificate_bytes[5]; + EXPECT_EQ(last_msg_->certificate_bytes[6], 18) + << "incorrect value for certificate_bytes[6], expected 18, is " + << last_msg_->certificate_bytes[6]; + EXPECT_EQ(last_msg_->certificate_bytes[7], 21) + << "incorrect value for certificate_bytes[7], expected 21, is " + << last_msg_->certificate_bytes[7]; + EXPECT_EQ(last_msg_->certificate_bytes[8], 24) + << "incorrect value for certificate_bytes[8], expected 24, is " + << last_msg_->certificate_bytes[8]; + EXPECT_EQ(last_msg_->certificate_bytes[9], 27) + << "incorrect value for certificate_bytes[9], expected 27, is " + << last_msg_->certificate_bytes[9]; + EXPECT_EQ(last_msg_->certificate_bytes[10], 30) + << "incorrect value for certificate_bytes[10], expected 30, is " + << last_msg_->certificate_bytes[10]; + EXPECT_EQ(last_msg_->certificate_bytes[11], 33) + << "incorrect value for certificate_bytes[11], expected 33, is " + << last_msg_->certificate_bytes[11]; + EXPECT_EQ(last_msg_->certificate_bytes[12], 36) + << "incorrect value for certificate_bytes[12], expected 36, is " + << last_msg_->certificate_bytes[12]; + EXPECT_EQ(last_msg_->certificate_bytes[13], 39) + << "incorrect value for certificate_bytes[13], expected 39, is " + << last_msg_->certificate_bytes[13]; + EXPECT_EQ(last_msg_->certificate_bytes[14], 42) + << "incorrect value for certificate_bytes[14], expected 42, is " + << last_msg_->certificate_bytes[14]; + EXPECT_EQ(last_msg_->certificate_bytes[15], 45) + << "incorrect value for certificate_bytes[15], expected 45, is " + << last_msg_->certificate_bytes[15]; + EXPECT_EQ(last_msg_->certificate_bytes[16], 48) + << "incorrect value for certificate_bytes[16], expected 48, is " + << last_msg_->certificate_bytes[16]; + EXPECT_EQ(last_msg_->certificate_bytes[17], 51) + << "incorrect value for certificate_bytes[17], expected 51, is " + << last_msg_->certificate_bytes[17]; + EXPECT_EQ(last_msg_->certificate_bytes[18], 54) + << "incorrect value for certificate_bytes[18], expected 54, is " + << last_msg_->certificate_bytes[18]; + EXPECT_EQ(last_msg_->certificate_bytes[19], 57) + << "incorrect value for certificate_bytes[19], expected 57, is " + << last_msg_->certificate_bytes[19]; + EXPECT_EQ(last_msg_->certificate_bytes[20], 60) + << "incorrect value for certificate_bytes[20], expected 60, is " + << last_msg_->certificate_bytes[20]; + EXPECT_EQ(last_msg_->certificate_bytes[21], 63) + << "incorrect value for certificate_bytes[21], expected 63, is " + << last_msg_->certificate_bytes[21]; + EXPECT_EQ(last_msg_->certificate_bytes[22], 66) + << "incorrect value for certificate_bytes[22], expected 66, is " + << last_msg_->certificate_bytes[22]; + EXPECT_EQ(last_msg_->certificate_bytes[23], 69) + << "incorrect value for certificate_bytes[23], expected 69, is " + << last_msg_->certificate_bytes[23]; + EXPECT_EQ(last_msg_->certificate_bytes[24], 72) + << "incorrect value for certificate_bytes[24], expected 72, is " + << last_msg_->certificate_bytes[24]; + EXPECT_EQ(last_msg_->certificate_bytes[25], 75) + << "incorrect value for certificate_bytes[25], expected 75, is " + << last_msg_->certificate_bytes[25]; + EXPECT_EQ(last_msg_->certificate_bytes[26], 78) + << "incorrect value for certificate_bytes[26], expected 78, is " + << last_msg_->certificate_bytes[26]; + EXPECT_EQ(last_msg_->certificate_bytes[27], 81) + << "incorrect value for certificate_bytes[27], expected 81, is " + << last_msg_->certificate_bytes[27]; + EXPECT_EQ(last_msg_->certificate_bytes[28], 84) + << "incorrect value for certificate_bytes[28], expected 84, is " + << last_msg_->certificate_bytes[28]; + EXPECT_EQ(last_msg_->certificate_bytes[29], 87) + << "incorrect value for certificate_bytes[29], expected 87, is " + << last_msg_->certificate_bytes[29]; + EXPECT_EQ(last_msg_->certificate_bytes[30], 90) + << "incorrect value for certificate_bytes[30], expected 90, is " + << last_msg_->certificate_bytes[30]; + EXPECT_EQ(last_msg_->certificate_bytes[31], 93) + << "incorrect value for certificate_bytes[31], expected 93, is " + << last_msg_->certificate_bytes[31]; + EXPECT_EQ(last_msg_->certificate_bytes[32], 96) + << "incorrect value for certificate_bytes[32], expected 96, is " + << last_msg_->certificate_bytes[32]; + EXPECT_EQ(last_msg_->certificate_bytes[33], 99) + << "incorrect value for certificate_bytes[33], expected 99, is " + << last_msg_->certificate_bytes[33]; + EXPECT_EQ(last_msg_->certificate_bytes[34], 102) + << "incorrect value for certificate_bytes[34], expected 102, is " + << last_msg_->certificate_bytes[34]; + EXPECT_EQ(last_msg_->certificate_bytes[35], 105) + << "incorrect value for certificate_bytes[35], expected 105, is " + << last_msg_->certificate_bytes[35]; + EXPECT_EQ(last_msg_->certificate_bytes[36], 108) + << "incorrect value for certificate_bytes[36], expected 108, is " + << last_msg_->certificate_bytes[36]; + EXPECT_EQ(last_msg_->certificate_bytes[37], 111) + << "incorrect value for certificate_bytes[37], expected 111, is " + << last_msg_->certificate_bytes[37]; + EXPECT_EQ(last_msg_->certificate_bytes[38], 114) + << "incorrect value for certificate_bytes[38], expected 114, is " + << last_msg_->certificate_bytes[38]; + EXPECT_EQ(last_msg_->certificate_bytes[39], 117) + << "incorrect value for certificate_bytes[39], expected 117, is " + << last_msg_->certificate_bytes[39]; + EXPECT_EQ(last_msg_->certificate_bytes[40], 120) + << "incorrect value for certificate_bytes[40], expected 120, is " + << last_msg_->certificate_bytes[40]; + EXPECT_EQ(last_msg_->certificate_bytes[41], 123) + << "incorrect value for certificate_bytes[41], expected 123, is " + << last_msg_->certificate_bytes[41]; + EXPECT_EQ(last_msg_->certificate_bytes[42], 126) + << "incorrect value for certificate_bytes[42], expected 126, is " + << last_msg_->certificate_bytes[42]; + EXPECT_EQ(last_msg_->certificate_bytes[43], 129) + << "incorrect value for certificate_bytes[43], expected 129, is " + << last_msg_->certificate_bytes[43]; + EXPECT_EQ(last_msg_->certificate_bytes[44], 132) + << "incorrect value for certificate_bytes[44], expected 132, is " + << last_msg_->certificate_bytes[44]; + EXPECT_EQ(last_msg_->certificate_bytes[45], 135) + << "incorrect value for certificate_bytes[45], expected 135, is " + << last_msg_->certificate_bytes[45]; + EXPECT_EQ(last_msg_->certificate_bytes[46], 138) + << "incorrect value for certificate_bytes[46], expected 138, is " + << last_msg_->certificate_bytes[46]; + EXPECT_EQ(last_msg_->certificate_bytes[47], 141) + << "incorrect value for certificate_bytes[47], expected 141, is " + << last_msg_->certificate_bytes[47]; + EXPECT_EQ(last_msg_->certificate_bytes[48], 144) + << "incorrect value for certificate_bytes[48], expected 144, is " + << last_msg_->certificate_bytes[48]; + EXPECT_EQ(last_msg_->certificate_bytes[49], 147) + << "incorrect value for certificate_bytes[49], expected 147, is " + << last_msg_->certificate_bytes[49]; + EXPECT_EQ(last_msg_->certificate_bytes[50], 150) + << "incorrect value for certificate_bytes[50], expected 150, is " + << last_msg_->certificate_bytes[50]; + EXPECT_EQ(last_msg_->certificate_bytes[51], 153) + << "incorrect value for certificate_bytes[51], expected 153, is " + << last_msg_->certificate_bytes[51]; + EXPECT_EQ(last_msg_->certificate_bytes[52], 156) + << "incorrect value for certificate_bytes[52], expected 156, is " + << last_msg_->certificate_bytes[52]; + EXPECT_EQ(last_msg_->certificate_bytes[53], 159) + << "incorrect value for certificate_bytes[53], expected 159, is " + << last_msg_->certificate_bytes[53]; + EXPECT_EQ(last_msg_->certificate_bytes[54], 162) + << "incorrect value for certificate_bytes[54], expected 162, is " + << last_msg_->certificate_bytes[54]; + EXPECT_EQ(last_msg_->certificate_bytes[55], 165) + << "incorrect value for certificate_bytes[55], expected 165, is " + << last_msg_->certificate_bytes[55]; + EXPECT_EQ(last_msg_->certificate_bytes[56], 168) + << "incorrect value for certificate_bytes[56], expected 168, is " + << last_msg_->certificate_bytes[56]; + EXPECT_EQ(last_msg_->certificate_bytes[57], 171) + << "incorrect value for certificate_bytes[57], expected 171, is " + << last_msg_->certificate_bytes[57]; + EXPECT_EQ(last_msg_->certificate_bytes[58], 174) + << "incorrect value for certificate_bytes[58], expected 174, is " + << last_msg_->certificate_bytes[58]; + EXPECT_EQ(last_msg_->certificate_bytes[59], 177) + << "incorrect value for certificate_bytes[59], expected 177, is " + << last_msg_->certificate_bytes[59]; + EXPECT_EQ(last_msg_->certificate_bytes[60], 180) + << "incorrect value for certificate_bytes[60], expected 180, is " + << last_msg_->certificate_bytes[60]; + EXPECT_EQ(last_msg_->certificate_bytes[61], 183) + << "incorrect value for certificate_bytes[61], expected 183, is " + << last_msg_->certificate_bytes[61]; + EXPECT_EQ(last_msg_->certificate_bytes[62], 186) + << "incorrect value for certificate_bytes[62], expected 186, is " + << last_msg_->certificate_bytes[62]; + EXPECT_EQ(last_msg_->certificate_bytes[63], 189) + << "incorrect value for certificate_bytes[63], expected 189, is " + << last_msg_->certificate_bytes[63]; + EXPECT_EQ(last_msg_->certificate_bytes[64], 192) + << "incorrect value for certificate_bytes[64], expected 192, is " + << last_msg_->certificate_bytes[64]; + EXPECT_EQ(last_msg_->certificate_bytes[65], 195) + << "incorrect value for certificate_bytes[65], expected 195, is " + << last_msg_->certificate_bytes[65]; + EXPECT_EQ(last_msg_->certificate_bytes[66], 198) + << "incorrect value for certificate_bytes[66], expected 198, is " + << last_msg_->certificate_bytes[66]; + EXPECT_EQ(last_msg_->certificate_bytes[67], 201) + << "incorrect value for certificate_bytes[67], expected 201, is " + << last_msg_->certificate_bytes[67]; + EXPECT_EQ(last_msg_->certificate_bytes[68], 204) + << "incorrect value for certificate_bytes[68], expected 204, is " + << last_msg_->certificate_bytes[68]; + EXPECT_EQ(last_msg_->certificate_bytes[69], 207) + << "incorrect value for certificate_bytes[69], expected 207, is " + << last_msg_->certificate_bytes[69]; + EXPECT_EQ(last_msg_->certificate_bytes[70], 210) + << "incorrect value for certificate_bytes[70], expected 210, is " + << last_msg_->certificate_bytes[70]; + EXPECT_EQ(last_msg_->certificate_bytes[71], 213) + << "incorrect value for certificate_bytes[71], expected 213, is " + << last_msg_->certificate_bytes[71]; + EXPECT_EQ(last_msg_->certificate_bytes[72], 216) + << "incorrect value for certificate_bytes[72], expected 216, is " + << last_msg_->certificate_bytes[72]; + EXPECT_EQ(last_msg_->certificate_bytes[73], 219) + << "incorrect value for certificate_bytes[73], expected 219, is " + << last_msg_->certificate_bytes[73]; + EXPECT_EQ(last_msg_->certificate_bytes[74], 222) + << "incorrect value for certificate_bytes[74], expected 222, is " + << last_msg_->certificate_bytes[74]; + EXPECT_EQ(last_msg_->certificate_bytes[75], 225) + << "incorrect value for certificate_bytes[75], expected 225, is " + << last_msg_->certificate_bytes[75]; + EXPECT_EQ(last_msg_->certificate_bytes[76], 228) + << "incorrect value for certificate_bytes[76], expected 228, is " + << last_msg_->certificate_bytes[76]; + EXPECT_EQ(last_msg_->certificate_bytes[77], 231) + << "incorrect value for certificate_bytes[77], expected 231, is " + << last_msg_->certificate_bytes[77]; + EXPECT_EQ(last_msg_->certificate_bytes[78], 234) + << "incorrect value for certificate_bytes[78], expected 234, is " + << last_msg_->certificate_bytes[78]; + EXPECT_EQ(last_msg_->certificate_bytes[79], 237) + << "incorrect value for certificate_bytes[79], expected 237, is " + << last_msg_->certificate_bytes[79]; + EXPECT_EQ(last_msg_->certificate_bytes[80], 240) + << "incorrect value for certificate_bytes[80], expected 240, is " + << last_msg_->certificate_bytes[80]; + EXPECT_EQ(last_msg_->certificate_bytes[81], 243) + << "incorrect value for certificate_bytes[81], expected 243, is " + << last_msg_->certificate_bytes[81]; + EXPECT_EQ(last_msg_->certificate_bytes[82], 246) + << "incorrect value for certificate_bytes[82], expected 246, is " + << last_msg_->certificate_bytes[82]; + EXPECT_EQ(last_msg_->certificate_bytes[83], 249) + << "incorrect value for certificate_bytes[83], expected 249, is " + << last_msg_->certificate_bytes[83]; + EXPECT_EQ(last_msg_->certificate_bytes[84], 252) + << "incorrect value for certificate_bytes[84], expected 252, is " + << last_msg_->certificate_bytes[84]; + EXPECT_EQ(last_msg_->fingerprint[0], 100) + << "incorrect value for fingerprint[0], expected 100, is " + << last_msg_->fingerprint[0]; + EXPECT_EQ(last_msg_->fingerprint[1], 101) + << "incorrect value for fingerprint[1], expected 101, is " + << last_msg_->fingerprint[1]; + EXPECT_EQ(last_msg_->fingerprint[2], 102) + << "incorrect value for fingerprint[2], expected 102, is " + << last_msg_->fingerprint[2]; + EXPECT_EQ(last_msg_->fingerprint[3], 103) + << "incorrect value for fingerprint[3], expected 103, is " + << last_msg_->fingerprint[3]; + EXPECT_EQ(last_msg_->fingerprint[4], 104) + << "incorrect value for fingerprint[4], expected 104, is " + << last_msg_->fingerprint[4]; + EXPECT_EQ(last_msg_->fingerprint[5], 105) + << "incorrect value for fingerprint[5], expected 105, is " + << last_msg_->fingerprint[5]; + EXPECT_EQ(last_msg_->fingerprint[6], 106) + << "incorrect value for fingerprint[6], expected 106, is " + << last_msg_->fingerprint[6]; + EXPECT_EQ(last_msg_->fingerprint[7], 107) + << "incorrect value for fingerprint[7], expected 107, is " + << last_msg_->fingerprint[7]; + EXPECT_EQ(last_msg_->fingerprint[8], 108) + << "incorrect value for fingerprint[8], expected 108, is " + << last_msg_->fingerprint[8]; + EXPECT_EQ(last_msg_->fingerprint[9], 109) + << "incorrect value for fingerprint[9], expected 109, is " + << last_msg_->fingerprint[9]; + EXPECT_EQ(last_msg_->fingerprint[10], 110) + << "incorrect value for fingerprint[10], expected 110, is " + << last_msg_->fingerprint[10]; + EXPECT_EQ(last_msg_->fingerprint[11], 111) + << "incorrect value for fingerprint[11], expected 111, is " + << last_msg_->fingerprint[11]; + EXPECT_EQ(last_msg_->fingerprint[12], 112) + << "incorrect value for fingerprint[12], expected 112, is " + << last_msg_->fingerprint[12]; + EXPECT_EQ(last_msg_->fingerprint[13], 113) + << "incorrect value for fingerprint[13], expected 113, is " + << last_msg_->fingerprint[13]; + EXPECT_EQ(last_msg_->fingerprint[14], 114) + << "incorrect value for fingerprint[14], expected 114, is " + << last_msg_->fingerprint[14]; + EXPECT_EQ(last_msg_->fingerprint[15], 115) + << "incorrect value for fingerprint[15], expected 115, is " + << last_msg_->fingerprint[15]; + EXPECT_EQ(last_msg_->fingerprint[16], 116) + << "incorrect value for fingerprint[16], expected 116, is " + << last_msg_->fingerprint[16]; + EXPECT_EQ(last_msg_->fingerprint[17], 117) + << "incorrect value for fingerprint[17], expected 117, is " + << last_msg_->fingerprint[17]; + EXPECT_EQ(last_msg_->fingerprint[18], 118) + << "incorrect value for fingerprint[18], expected 118, is " + << last_msg_->fingerprint[18]; + EXPECT_EQ(last_msg_->fingerprint[19], 119) + << "incorrect value for fingerprint[19], expected 119, is " + << last_msg_->fingerprint[19]; + EXPECT_EQ(last_msg_->n_msg, 16) + << "incorrect value for n_msg, expected 16, is " << last_msg_->n_msg; } diff --git a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepA.cc b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepA.cc index 14c98b295..77b05d819 100644 --- a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ed25519_signature_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ed25519_signature_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,687 +82,943 @@ class Test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ed25519_signature_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,1,12,66,0,184,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,136,19,0,0,114,20,0,0,92,21,0,0,70,22,0,0,48,23,0,0,26,24,0,0,4,25,0,0,238,25,0,0,216,26,0,0,194,27,0,0,172,28,0,0,150,29,0,0,128,30,0,0,106,31,0,0,84,32,0,0,62,33,0,0,40,34,0,0,18,35,0,0,252,35,0,0,230,36,0,0,208,37,0,0,186,38,0,0,164,39,0,0,142,40,0,0,120,41,0,0,169,111, }; +TEST_F(Test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 1, 12, 66, 0, 184, 0, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 136, 19, 0, 0, 114, 20, 0, 0, 92, 21, 0, 0, 70, 22, 0, + 0, 48, 23, 0, 0, 26, 24, 0, 0, 4, 25, 0, 0, 238, 25, + 0, 0, 216, 26, 0, 0, 194, 27, 0, 0, 172, 28, 0, 0, 150, + 29, 0, 0, 128, 30, 0, 0, 106, 31, 0, 0, 84, 32, 0, 0, + 62, 33, 0, 0, 40, 34, 0, 0, 18, 35, 0, 0, 252, 35, 0, + 0, 230, 36, 0, 0, 208, 37, 0, 0, 186, 38, 0, 0, 164, 39, + 0, 0, 142, 40, 0, 0, 120, 41, 0, 0, 169, 111, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ed25519_signature_dep_a_t* test_msg = ( msg_ed25519_signature_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[0] = 100; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[1] = 101; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[2] = 102; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[3] = 103; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[4] = 104; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[5] = 105; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[6] = 106; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[7] = 107; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[8] = 108; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[9] = 109; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[10] = 110; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[11] = 111; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[12] = 112; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[13] = 113; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[14] = 114; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[15] = 115; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[16] = 116; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[17] = 117; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[18] = 118; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[19] = 119; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[0] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[1] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[2] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[3] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[4] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[5] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[6] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[7] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[8] = 8; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[9] = 9; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[10] = 10; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[11] = 11; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[12] = 12; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[13] = 13; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[14] = 14; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[15] = 15; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[16] = 16; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[17] = 17; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[18] = 18; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[19] = 19; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[20] = 20; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[21] = 21; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[22] = 22; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[23] = 23; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[24] = 24; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[25] = 25; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[26] = 26; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[27] = 27; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[28] = 28; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[29] = 29; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[30] = 30; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[31] = 31; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[32] = 32; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[33] = 33; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[34] = 34; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[35] = 35; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[36] = 36; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[37] = 37; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[38] = 38; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[39] = 39; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[40] = 40; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[41] = 41; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[42] = 42; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[43] = 43; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[44] = 44; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[45] = 45; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[46] = 46; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[47] = 47; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[48] = 48; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[49] = 49; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[50] = 50; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[51] = 51; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[52] = 52; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[53] = 53; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[54] = 54; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[55] = 55; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[56] = 56; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[57] = 57; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[58] = 58; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[59] = 59; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[60] = 60; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[61] = 61; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[62] = 62; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[63] = 63; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[0] = 5000; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[1] = 5234; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[2] = 5468; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[3] = 5702; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[4] = 5936; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[5] = 6170; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[6] = 6404; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[7] = 6638; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[8] = 6872; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[9] = 7106; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[10] = 7340; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[11] = 7574; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[12] = 7808; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[13] = 8042; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[14] = 8276; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[15] = 8510; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[16] = 8744; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[17] = 8978; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[18] = 9212; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[19] = 9446; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[20] = 9680; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[21] = 9914; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[22] = 10148; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[23] = 10382; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[24] = 10616; - - EXPECT_EQ(send_message( 0xC01, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ed25519_signature_dep_a_t *test_msg = + (msg_ed25519_signature_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[0] = 100; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[1] = 101; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[2] = 102; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[3] = 103; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[4] = 104; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[5] = 105; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[6] = 106; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[7] = 107; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[8] = 108; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[9] = 109; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[10] = 110; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[11] = 111; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[12] = 112; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[13] = 113; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[14] = 114; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[15] = 115; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[16] = 116; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[17] = 117; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[18] = 118; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[19] = 119; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[0] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[1] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[2] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[3] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[4] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[5] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[6] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[7] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[8] = 8; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[9] = 9; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[10] = 10; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[11] = 11; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[12] = 12; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[13] = 13; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[14] = 14; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[15] = 15; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[16] = 16; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[17] = 17; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[18] = 18; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[19] = 19; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[20] = 20; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[21] = 21; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[22] = 22; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[23] = 23; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[24] = 24; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[25] = 25; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[26] = 26; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[27] = 27; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[28] = 28; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[29] = 29; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[30] = 30; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[31] = 31; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[32] = 32; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[33] = 33; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[34] = 34; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[35] = 35; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[36] = 36; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[37] = 37; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[38] = 38; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[39] = 39; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[40] = 40; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[41] = 41; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[42] = 42; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[43] = 43; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[44] = 44; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[45] = 45; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[46] = 46; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[47] = 47; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[48] = 48; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[49] = 49; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[50] = 50; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[51] = 51; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[52] = 52; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[53] = 53; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[54] = 54; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[55] = 55; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[56] = 56; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[57] = 57; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[58] = 58; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[59] = 59; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[60] = 60; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[61] = 61; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[62] = 62; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[63] = 63; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[0] = 5000; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[1] = 5234; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[2] = 5468; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[3] = 5702; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[4] = 5936; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[5] = 6170; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[6] = 6404; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[7] = 6638; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[8] = 6872; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[9] = 7106; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[10] = 7340; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[11] = 7574; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[12] = 7808; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[13] = 8042; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[14] = 8276; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[15] = 8510; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[16] = 8744; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[17] = 8978; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[18] = 9212; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[19] = 9446; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[20] = 9680; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[21] = 9914; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[22] = 10148; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[23] = 10382; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[24] = 10616; + + EXPECT_EQ(send_message(0xC01, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->fingerprint[0], 100) << "incorrect value for fingerprint[0], expected 100, is " << last_msg_->fingerprint[0]; - EXPECT_EQ(last_msg_->fingerprint[1], 101) << "incorrect value for fingerprint[1], expected 101, is " << last_msg_->fingerprint[1]; - EXPECT_EQ(last_msg_->fingerprint[2], 102) << "incorrect value for fingerprint[2], expected 102, is " << last_msg_->fingerprint[2]; - EXPECT_EQ(last_msg_->fingerprint[3], 103) << "incorrect value for fingerprint[3], expected 103, is " << last_msg_->fingerprint[3]; - EXPECT_EQ(last_msg_->fingerprint[4], 104) << "incorrect value for fingerprint[4], expected 104, is " << last_msg_->fingerprint[4]; - EXPECT_EQ(last_msg_->fingerprint[5], 105) << "incorrect value for fingerprint[5], expected 105, is " << last_msg_->fingerprint[5]; - EXPECT_EQ(last_msg_->fingerprint[6], 106) << "incorrect value for fingerprint[6], expected 106, is " << last_msg_->fingerprint[6]; - EXPECT_EQ(last_msg_->fingerprint[7], 107) << "incorrect value for fingerprint[7], expected 107, is " << last_msg_->fingerprint[7]; - EXPECT_EQ(last_msg_->fingerprint[8], 108) << "incorrect value for fingerprint[8], expected 108, is " << last_msg_->fingerprint[8]; - EXPECT_EQ(last_msg_->fingerprint[9], 109) << "incorrect value for fingerprint[9], expected 109, is " << last_msg_->fingerprint[9]; - EXPECT_EQ(last_msg_->fingerprint[10], 110) << "incorrect value for fingerprint[10], expected 110, is " << last_msg_->fingerprint[10]; - EXPECT_EQ(last_msg_->fingerprint[11], 111) << "incorrect value for fingerprint[11], expected 111, is " << last_msg_->fingerprint[11]; - EXPECT_EQ(last_msg_->fingerprint[12], 112) << "incorrect value for fingerprint[12], expected 112, is " << last_msg_->fingerprint[12]; - EXPECT_EQ(last_msg_->fingerprint[13], 113) << "incorrect value for fingerprint[13], expected 113, is " << last_msg_->fingerprint[13]; - EXPECT_EQ(last_msg_->fingerprint[14], 114) << "incorrect value for fingerprint[14], expected 114, is " << last_msg_->fingerprint[14]; - EXPECT_EQ(last_msg_->fingerprint[15], 115) << "incorrect value for fingerprint[15], expected 115, is " << last_msg_->fingerprint[15]; - EXPECT_EQ(last_msg_->fingerprint[16], 116) << "incorrect value for fingerprint[16], expected 116, is " << last_msg_->fingerprint[16]; - EXPECT_EQ(last_msg_->fingerprint[17], 117) << "incorrect value for fingerprint[17], expected 117, is " << last_msg_->fingerprint[17]; - EXPECT_EQ(last_msg_->fingerprint[18], 118) << "incorrect value for fingerprint[18], expected 118, is " << last_msg_->fingerprint[18]; - EXPECT_EQ(last_msg_->fingerprint[19], 119) << "incorrect value for fingerprint[19], expected 119, is " << last_msg_->fingerprint[19]; - EXPECT_EQ(last_msg_->signature[0], 0) << "incorrect value for signature[0], expected 0, is " << last_msg_->signature[0]; - EXPECT_EQ(last_msg_->signature[1], 1) << "incorrect value for signature[1], expected 1, is " << last_msg_->signature[1]; - EXPECT_EQ(last_msg_->signature[2], 2) << "incorrect value for signature[2], expected 2, is " << last_msg_->signature[2]; - EXPECT_EQ(last_msg_->signature[3], 3) << "incorrect value for signature[3], expected 3, is " << last_msg_->signature[3]; - EXPECT_EQ(last_msg_->signature[4], 4) << "incorrect value for signature[4], expected 4, is " << last_msg_->signature[4]; - EXPECT_EQ(last_msg_->signature[5], 5) << "incorrect value for signature[5], expected 5, is " << last_msg_->signature[5]; - EXPECT_EQ(last_msg_->signature[6], 6) << "incorrect value for signature[6], expected 6, is " << last_msg_->signature[6]; - EXPECT_EQ(last_msg_->signature[7], 7) << "incorrect value for signature[7], expected 7, is " << last_msg_->signature[7]; - EXPECT_EQ(last_msg_->signature[8], 8) << "incorrect value for signature[8], expected 8, is " << last_msg_->signature[8]; - EXPECT_EQ(last_msg_->signature[9], 9) << "incorrect value for signature[9], expected 9, is " << last_msg_->signature[9]; - EXPECT_EQ(last_msg_->signature[10], 10) << "incorrect value for signature[10], expected 10, is " << last_msg_->signature[10]; - EXPECT_EQ(last_msg_->signature[11], 11) << "incorrect value for signature[11], expected 11, is " << last_msg_->signature[11]; - EXPECT_EQ(last_msg_->signature[12], 12) << "incorrect value for signature[12], expected 12, is " << last_msg_->signature[12]; - EXPECT_EQ(last_msg_->signature[13], 13) << "incorrect value for signature[13], expected 13, is " << last_msg_->signature[13]; - EXPECT_EQ(last_msg_->signature[14], 14) << "incorrect value for signature[14], expected 14, is " << last_msg_->signature[14]; - EXPECT_EQ(last_msg_->signature[15], 15) << "incorrect value for signature[15], expected 15, is " << last_msg_->signature[15]; - EXPECT_EQ(last_msg_->signature[16], 16) << "incorrect value for signature[16], expected 16, is " << last_msg_->signature[16]; - EXPECT_EQ(last_msg_->signature[17], 17) << "incorrect value for signature[17], expected 17, is " << last_msg_->signature[17]; - EXPECT_EQ(last_msg_->signature[18], 18) << "incorrect value for signature[18], expected 18, is " << last_msg_->signature[18]; - EXPECT_EQ(last_msg_->signature[19], 19) << "incorrect value for signature[19], expected 19, is " << last_msg_->signature[19]; - EXPECT_EQ(last_msg_->signature[20], 20) << "incorrect value for signature[20], expected 20, is " << last_msg_->signature[20]; - EXPECT_EQ(last_msg_->signature[21], 21) << "incorrect value for signature[21], expected 21, is " << last_msg_->signature[21]; - EXPECT_EQ(last_msg_->signature[22], 22) << "incorrect value for signature[22], expected 22, is " << last_msg_->signature[22]; - EXPECT_EQ(last_msg_->signature[23], 23) << "incorrect value for signature[23], expected 23, is " << last_msg_->signature[23]; - EXPECT_EQ(last_msg_->signature[24], 24) << "incorrect value for signature[24], expected 24, is " << last_msg_->signature[24]; - EXPECT_EQ(last_msg_->signature[25], 25) << "incorrect value for signature[25], expected 25, is " << last_msg_->signature[25]; - EXPECT_EQ(last_msg_->signature[26], 26) << "incorrect value for signature[26], expected 26, is " << last_msg_->signature[26]; - EXPECT_EQ(last_msg_->signature[27], 27) << "incorrect value for signature[27], expected 27, is " << last_msg_->signature[27]; - EXPECT_EQ(last_msg_->signature[28], 28) << "incorrect value for signature[28], expected 28, is " << last_msg_->signature[28]; - EXPECT_EQ(last_msg_->signature[29], 29) << "incorrect value for signature[29], expected 29, is " << last_msg_->signature[29]; - EXPECT_EQ(last_msg_->signature[30], 30) << "incorrect value for signature[30], expected 30, is " << last_msg_->signature[30]; - EXPECT_EQ(last_msg_->signature[31], 31) << "incorrect value for signature[31], expected 31, is " << last_msg_->signature[31]; - EXPECT_EQ(last_msg_->signature[32], 32) << "incorrect value for signature[32], expected 32, is " << last_msg_->signature[32]; - EXPECT_EQ(last_msg_->signature[33], 33) << "incorrect value for signature[33], expected 33, is " << last_msg_->signature[33]; - EXPECT_EQ(last_msg_->signature[34], 34) << "incorrect value for signature[34], expected 34, is " << last_msg_->signature[34]; - EXPECT_EQ(last_msg_->signature[35], 35) << "incorrect value for signature[35], expected 35, is " << last_msg_->signature[35]; - EXPECT_EQ(last_msg_->signature[36], 36) << "incorrect value for signature[36], expected 36, is " << last_msg_->signature[36]; - EXPECT_EQ(last_msg_->signature[37], 37) << "incorrect value for signature[37], expected 37, is " << last_msg_->signature[37]; - EXPECT_EQ(last_msg_->signature[38], 38) << "incorrect value for signature[38], expected 38, is " << last_msg_->signature[38]; - EXPECT_EQ(last_msg_->signature[39], 39) << "incorrect value for signature[39], expected 39, is " << last_msg_->signature[39]; - EXPECT_EQ(last_msg_->signature[40], 40) << "incorrect value for signature[40], expected 40, is " << last_msg_->signature[40]; - EXPECT_EQ(last_msg_->signature[41], 41) << "incorrect value for signature[41], expected 41, is " << last_msg_->signature[41]; - EXPECT_EQ(last_msg_->signature[42], 42) << "incorrect value for signature[42], expected 42, is " << last_msg_->signature[42]; - EXPECT_EQ(last_msg_->signature[43], 43) << "incorrect value for signature[43], expected 43, is " << last_msg_->signature[43]; - EXPECT_EQ(last_msg_->signature[44], 44) << "incorrect value for signature[44], expected 44, is " << last_msg_->signature[44]; - EXPECT_EQ(last_msg_->signature[45], 45) << "incorrect value for signature[45], expected 45, is " << last_msg_->signature[45]; - EXPECT_EQ(last_msg_->signature[46], 46) << "incorrect value for signature[46], expected 46, is " << last_msg_->signature[46]; - EXPECT_EQ(last_msg_->signature[47], 47) << "incorrect value for signature[47], expected 47, is " << last_msg_->signature[47]; - EXPECT_EQ(last_msg_->signature[48], 48) << "incorrect value for signature[48], expected 48, is " << last_msg_->signature[48]; - EXPECT_EQ(last_msg_->signature[49], 49) << "incorrect value for signature[49], expected 49, is " << last_msg_->signature[49]; - EXPECT_EQ(last_msg_->signature[50], 50) << "incorrect value for signature[50], expected 50, is " << last_msg_->signature[50]; - EXPECT_EQ(last_msg_->signature[51], 51) << "incorrect value for signature[51], expected 51, is " << last_msg_->signature[51]; - EXPECT_EQ(last_msg_->signature[52], 52) << "incorrect value for signature[52], expected 52, is " << last_msg_->signature[52]; - EXPECT_EQ(last_msg_->signature[53], 53) << "incorrect value for signature[53], expected 53, is " << last_msg_->signature[53]; - EXPECT_EQ(last_msg_->signature[54], 54) << "incorrect value for signature[54], expected 54, is " << last_msg_->signature[54]; - EXPECT_EQ(last_msg_->signature[55], 55) << "incorrect value for signature[55], expected 55, is " << last_msg_->signature[55]; - EXPECT_EQ(last_msg_->signature[56], 56) << "incorrect value for signature[56], expected 56, is " << last_msg_->signature[56]; - EXPECT_EQ(last_msg_->signature[57], 57) << "incorrect value for signature[57], expected 57, is " << last_msg_->signature[57]; - EXPECT_EQ(last_msg_->signature[58], 58) << "incorrect value for signature[58], expected 58, is " << last_msg_->signature[58]; - EXPECT_EQ(last_msg_->signature[59], 59) << "incorrect value for signature[59], expected 59, is " << last_msg_->signature[59]; - EXPECT_EQ(last_msg_->signature[60], 60) << "incorrect value for signature[60], expected 60, is " << last_msg_->signature[60]; - EXPECT_EQ(last_msg_->signature[61], 61) << "incorrect value for signature[61], expected 61, is " << last_msg_->signature[61]; - EXPECT_EQ(last_msg_->signature[62], 62) << "incorrect value for signature[62], expected 62, is " << last_msg_->signature[62]; - EXPECT_EQ(last_msg_->signature[63], 63) << "incorrect value for signature[63], expected 63, is " << last_msg_->signature[63]; - EXPECT_EQ(last_msg_->signed_messages[0], 5000) << "incorrect value for signed_messages[0], expected 5000, is " << last_msg_->signed_messages[0]; - EXPECT_EQ(last_msg_->signed_messages[1], 5234) << "incorrect value for signed_messages[1], expected 5234, is " << last_msg_->signed_messages[1]; - EXPECT_EQ(last_msg_->signed_messages[2], 5468) << "incorrect value for signed_messages[2], expected 5468, is " << last_msg_->signed_messages[2]; - EXPECT_EQ(last_msg_->signed_messages[3], 5702) << "incorrect value for signed_messages[3], expected 5702, is " << last_msg_->signed_messages[3]; - EXPECT_EQ(last_msg_->signed_messages[4], 5936) << "incorrect value for signed_messages[4], expected 5936, is " << last_msg_->signed_messages[4]; - EXPECT_EQ(last_msg_->signed_messages[5], 6170) << "incorrect value for signed_messages[5], expected 6170, is " << last_msg_->signed_messages[5]; - EXPECT_EQ(last_msg_->signed_messages[6], 6404) << "incorrect value for signed_messages[6], expected 6404, is " << last_msg_->signed_messages[6]; - EXPECT_EQ(last_msg_->signed_messages[7], 6638) << "incorrect value for signed_messages[7], expected 6638, is " << last_msg_->signed_messages[7]; - EXPECT_EQ(last_msg_->signed_messages[8], 6872) << "incorrect value for signed_messages[8], expected 6872, is " << last_msg_->signed_messages[8]; - EXPECT_EQ(last_msg_->signed_messages[9], 7106) << "incorrect value for signed_messages[9], expected 7106, is " << last_msg_->signed_messages[9]; - EXPECT_EQ(last_msg_->signed_messages[10], 7340) << "incorrect value for signed_messages[10], expected 7340, is " << last_msg_->signed_messages[10]; - EXPECT_EQ(last_msg_->signed_messages[11], 7574) << "incorrect value for signed_messages[11], expected 7574, is " << last_msg_->signed_messages[11]; - EXPECT_EQ(last_msg_->signed_messages[12], 7808) << "incorrect value for signed_messages[12], expected 7808, is " << last_msg_->signed_messages[12]; - EXPECT_EQ(last_msg_->signed_messages[13], 8042) << "incorrect value for signed_messages[13], expected 8042, is " << last_msg_->signed_messages[13]; - EXPECT_EQ(last_msg_->signed_messages[14], 8276) << "incorrect value for signed_messages[14], expected 8276, is " << last_msg_->signed_messages[14]; - EXPECT_EQ(last_msg_->signed_messages[15], 8510) << "incorrect value for signed_messages[15], expected 8510, is " << last_msg_->signed_messages[15]; - EXPECT_EQ(last_msg_->signed_messages[16], 8744) << "incorrect value for signed_messages[16], expected 8744, is " << last_msg_->signed_messages[16]; - EXPECT_EQ(last_msg_->signed_messages[17], 8978) << "incorrect value for signed_messages[17], expected 8978, is " << last_msg_->signed_messages[17]; - EXPECT_EQ(last_msg_->signed_messages[18], 9212) << "incorrect value for signed_messages[18], expected 9212, is " << last_msg_->signed_messages[18]; - EXPECT_EQ(last_msg_->signed_messages[19], 9446) << "incorrect value for signed_messages[19], expected 9446, is " << last_msg_->signed_messages[19]; - EXPECT_EQ(last_msg_->signed_messages[20], 9680) << "incorrect value for signed_messages[20], expected 9680, is " << last_msg_->signed_messages[20]; - EXPECT_EQ(last_msg_->signed_messages[21], 9914) << "incorrect value for signed_messages[21], expected 9914, is " << last_msg_->signed_messages[21]; - EXPECT_EQ(last_msg_->signed_messages[22], 10148) << "incorrect value for signed_messages[22], expected 10148, is " << last_msg_->signed_messages[22]; - EXPECT_EQ(last_msg_->signed_messages[23], 10382) << "incorrect value for signed_messages[23], expected 10382, is " << last_msg_->signed_messages[23]; - EXPECT_EQ(last_msg_->signed_messages[24], 10616) << "incorrect value for signed_messages[24], expected 10616, is " << last_msg_->signed_messages[24]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->fingerprint[0], 100) + << "incorrect value for fingerprint[0], expected 100, is " + << last_msg_->fingerprint[0]; + EXPECT_EQ(last_msg_->fingerprint[1], 101) + << "incorrect value for fingerprint[1], expected 101, is " + << last_msg_->fingerprint[1]; + EXPECT_EQ(last_msg_->fingerprint[2], 102) + << "incorrect value for fingerprint[2], expected 102, is " + << last_msg_->fingerprint[2]; + EXPECT_EQ(last_msg_->fingerprint[3], 103) + << "incorrect value for fingerprint[3], expected 103, is " + << last_msg_->fingerprint[3]; + EXPECT_EQ(last_msg_->fingerprint[4], 104) + << "incorrect value for fingerprint[4], expected 104, is " + << last_msg_->fingerprint[4]; + EXPECT_EQ(last_msg_->fingerprint[5], 105) + << "incorrect value for fingerprint[5], expected 105, is " + << last_msg_->fingerprint[5]; + EXPECT_EQ(last_msg_->fingerprint[6], 106) + << "incorrect value for fingerprint[6], expected 106, is " + << last_msg_->fingerprint[6]; + EXPECT_EQ(last_msg_->fingerprint[7], 107) + << "incorrect value for fingerprint[7], expected 107, is " + << last_msg_->fingerprint[7]; + EXPECT_EQ(last_msg_->fingerprint[8], 108) + << "incorrect value for fingerprint[8], expected 108, is " + << last_msg_->fingerprint[8]; + EXPECT_EQ(last_msg_->fingerprint[9], 109) + << "incorrect value for fingerprint[9], expected 109, is " + << last_msg_->fingerprint[9]; + EXPECT_EQ(last_msg_->fingerprint[10], 110) + << "incorrect value for fingerprint[10], expected 110, is " + << last_msg_->fingerprint[10]; + EXPECT_EQ(last_msg_->fingerprint[11], 111) + << "incorrect value for fingerprint[11], expected 111, is " + << last_msg_->fingerprint[11]; + EXPECT_EQ(last_msg_->fingerprint[12], 112) + << "incorrect value for fingerprint[12], expected 112, is " + << last_msg_->fingerprint[12]; + EXPECT_EQ(last_msg_->fingerprint[13], 113) + << "incorrect value for fingerprint[13], expected 113, is " + << last_msg_->fingerprint[13]; + EXPECT_EQ(last_msg_->fingerprint[14], 114) + << "incorrect value for fingerprint[14], expected 114, is " + << last_msg_->fingerprint[14]; + EXPECT_EQ(last_msg_->fingerprint[15], 115) + << "incorrect value for fingerprint[15], expected 115, is " + << last_msg_->fingerprint[15]; + EXPECT_EQ(last_msg_->fingerprint[16], 116) + << "incorrect value for fingerprint[16], expected 116, is " + << last_msg_->fingerprint[16]; + EXPECT_EQ(last_msg_->fingerprint[17], 117) + << "incorrect value for fingerprint[17], expected 117, is " + << last_msg_->fingerprint[17]; + EXPECT_EQ(last_msg_->fingerprint[18], 118) + << "incorrect value for fingerprint[18], expected 118, is " + << last_msg_->fingerprint[18]; + EXPECT_EQ(last_msg_->fingerprint[19], 119) + << "incorrect value for fingerprint[19], expected 119, is " + << last_msg_->fingerprint[19]; + EXPECT_EQ(last_msg_->signature[0], 0) + << "incorrect value for signature[0], expected 0, is " + << last_msg_->signature[0]; + EXPECT_EQ(last_msg_->signature[1], 1) + << "incorrect value for signature[1], expected 1, is " + << last_msg_->signature[1]; + EXPECT_EQ(last_msg_->signature[2], 2) + << "incorrect value for signature[2], expected 2, is " + << last_msg_->signature[2]; + EXPECT_EQ(last_msg_->signature[3], 3) + << "incorrect value for signature[3], expected 3, is " + << last_msg_->signature[3]; + EXPECT_EQ(last_msg_->signature[4], 4) + << "incorrect value for signature[4], expected 4, is " + << last_msg_->signature[4]; + EXPECT_EQ(last_msg_->signature[5], 5) + << "incorrect value for signature[5], expected 5, is " + << last_msg_->signature[5]; + EXPECT_EQ(last_msg_->signature[6], 6) + << "incorrect value for signature[6], expected 6, is " + << last_msg_->signature[6]; + EXPECT_EQ(last_msg_->signature[7], 7) + << "incorrect value for signature[7], expected 7, is " + << last_msg_->signature[7]; + EXPECT_EQ(last_msg_->signature[8], 8) + << "incorrect value for signature[8], expected 8, is " + << last_msg_->signature[8]; + EXPECT_EQ(last_msg_->signature[9], 9) + << "incorrect value for signature[9], expected 9, is " + << last_msg_->signature[9]; + EXPECT_EQ(last_msg_->signature[10], 10) + << "incorrect value for signature[10], expected 10, is " + << last_msg_->signature[10]; + EXPECT_EQ(last_msg_->signature[11], 11) + << "incorrect value for signature[11], expected 11, is " + << last_msg_->signature[11]; + EXPECT_EQ(last_msg_->signature[12], 12) + << "incorrect value for signature[12], expected 12, is " + << last_msg_->signature[12]; + EXPECT_EQ(last_msg_->signature[13], 13) + << "incorrect value for signature[13], expected 13, is " + << last_msg_->signature[13]; + EXPECT_EQ(last_msg_->signature[14], 14) + << "incorrect value for signature[14], expected 14, is " + << last_msg_->signature[14]; + EXPECT_EQ(last_msg_->signature[15], 15) + << "incorrect value for signature[15], expected 15, is " + << last_msg_->signature[15]; + EXPECT_EQ(last_msg_->signature[16], 16) + << "incorrect value for signature[16], expected 16, is " + << last_msg_->signature[16]; + EXPECT_EQ(last_msg_->signature[17], 17) + << "incorrect value for signature[17], expected 17, is " + << last_msg_->signature[17]; + EXPECT_EQ(last_msg_->signature[18], 18) + << "incorrect value for signature[18], expected 18, is " + << last_msg_->signature[18]; + EXPECT_EQ(last_msg_->signature[19], 19) + << "incorrect value for signature[19], expected 19, is " + << last_msg_->signature[19]; + EXPECT_EQ(last_msg_->signature[20], 20) + << "incorrect value for signature[20], expected 20, is " + << last_msg_->signature[20]; + EXPECT_EQ(last_msg_->signature[21], 21) + << "incorrect value for signature[21], expected 21, is " + << last_msg_->signature[21]; + EXPECT_EQ(last_msg_->signature[22], 22) + << "incorrect value for signature[22], expected 22, is " + << last_msg_->signature[22]; + EXPECT_EQ(last_msg_->signature[23], 23) + << "incorrect value for signature[23], expected 23, is " + << last_msg_->signature[23]; + EXPECT_EQ(last_msg_->signature[24], 24) + << "incorrect value for signature[24], expected 24, is " + << last_msg_->signature[24]; + EXPECT_EQ(last_msg_->signature[25], 25) + << "incorrect value for signature[25], expected 25, is " + << last_msg_->signature[25]; + EXPECT_EQ(last_msg_->signature[26], 26) + << "incorrect value for signature[26], expected 26, is " + << last_msg_->signature[26]; + EXPECT_EQ(last_msg_->signature[27], 27) + << "incorrect value for signature[27], expected 27, is " + << last_msg_->signature[27]; + EXPECT_EQ(last_msg_->signature[28], 28) + << "incorrect value for signature[28], expected 28, is " + << last_msg_->signature[28]; + EXPECT_EQ(last_msg_->signature[29], 29) + << "incorrect value for signature[29], expected 29, is " + << last_msg_->signature[29]; + EXPECT_EQ(last_msg_->signature[30], 30) + << "incorrect value for signature[30], expected 30, is " + << last_msg_->signature[30]; + EXPECT_EQ(last_msg_->signature[31], 31) + << "incorrect value for signature[31], expected 31, is " + << last_msg_->signature[31]; + EXPECT_EQ(last_msg_->signature[32], 32) + << "incorrect value for signature[32], expected 32, is " + << last_msg_->signature[32]; + EXPECT_EQ(last_msg_->signature[33], 33) + << "incorrect value for signature[33], expected 33, is " + << last_msg_->signature[33]; + EXPECT_EQ(last_msg_->signature[34], 34) + << "incorrect value for signature[34], expected 34, is " + << last_msg_->signature[34]; + EXPECT_EQ(last_msg_->signature[35], 35) + << "incorrect value for signature[35], expected 35, is " + << last_msg_->signature[35]; + EXPECT_EQ(last_msg_->signature[36], 36) + << "incorrect value for signature[36], expected 36, is " + << last_msg_->signature[36]; + EXPECT_EQ(last_msg_->signature[37], 37) + << "incorrect value for signature[37], expected 37, is " + << last_msg_->signature[37]; + EXPECT_EQ(last_msg_->signature[38], 38) + << "incorrect value for signature[38], expected 38, is " + << last_msg_->signature[38]; + EXPECT_EQ(last_msg_->signature[39], 39) + << "incorrect value for signature[39], expected 39, is " + << last_msg_->signature[39]; + EXPECT_EQ(last_msg_->signature[40], 40) + << "incorrect value for signature[40], expected 40, is " + << last_msg_->signature[40]; + EXPECT_EQ(last_msg_->signature[41], 41) + << "incorrect value for signature[41], expected 41, is " + << last_msg_->signature[41]; + EXPECT_EQ(last_msg_->signature[42], 42) + << "incorrect value for signature[42], expected 42, is " + << last_msg_->signature[42]; + EXPECT_EQ(last_msg_->signature[43], 43) + << "incorrect value for signature[43], expected 43, is " + << last_msg_->signature[43]; + EXPECT_EQ(last_msg_->signature[44], 44) + << "incorrect value for signature[44], expected 44, is " + << last_msg_->signature[44]; + EXPECT_EQ(last_msg_->signature[45], 45) + << "incorrect value for signature[45], expected 45, is " + << last_msg_->signature[45]; + EXPECT_EQ(last_msg_->signature[46], 46) + << "incorrect value for signature[46], expected 46, is " + << last_msg_->signature[46]; + EXPECT_EQ(last_msg_->signature[47], 47) + << "incorrect value for signature[47], expected 47, is " + << last_msg_->signature[47]; + EXPECT_EQ(last_msg_->signature[48], 48) + << "incorrect value for signature[48], expected 48, is " + << last_msg_->signature[48]; + EXPECT_EQ(last_msg_->signature[49], 49) + << "incorrect value for signature[49], expected 49, is " + << last_msg_->signature[49]; + EXPECT_EQ(last_msg_->signature[50], 50) + << "incorrect value for signature[50], expected 50, is " + << last_msg_->signature[50]; + EXPECT_EQ(last_msg_->signature[51], 51) + << "incorrect value for signature[51], expected 51, is " + << last_msg_->signature[51]; + EXPECT_EQ(last_msg_->signature[52], 52) + << "incorrect value for signature[52], expected 52, is " + << last_msg_->signature[52]; + EXPECT_EQ(last_msg_->signature[53], 53) + << "incorrect value for signature[53], expected 53, is " + << last_msg_->signature[53]; + EXPECT_EQ(last_msg_->signature[54], 54) + << "incorrect value for signature[54], expected 54, is " + << last_msg_->signature[54]; + EXPECT_EQ(last_msg_->signature[55], 55) + << "incorrect value for signature[55], expected 55, is " + << last_msg_->signature[55]; + EXPECT_EQ(last_msg_->signature[56], 56) + << "incorrect value for signature[56], expected 56, is " + << last_msg_->signature[56]; + EXPECT_EQ(last_msg_->signature[57], 57) + << "incorrect value for signature[57], expected 57, is " + << last_msg_->signature[57]; + EXPECT_EQ(last_msg_->signature[58], 58) + << "incorrect value for signature[58], expected 58, is " + << last_msg_->signature[58]; + EXPECT_EQ(last_msg_->signature[59], 59) + << "incorrect value for signature[59], expected 59, is " + << last_msg_->signature[59]; + EXPECT_EQ(last_msg_->signature[60], 60) + << "incorrect value for signature[60], expected 60, is " + << last_msg_->signature[60]; + EXPECT_EQ(last_msg_->signature[61], 61) + << "incorrect value for signature[61], expected 61, is " + << last_msg_->signature[61]; + EXPECT_EQ(last_msg_->signature[62], 62) + << "incorrect value for signature[62], expected 62, is " + << last_msg_->signature[62]; + EXPECT_EQ(last_msg_->signature[63], 63) + << "incorrect value for signature[63], expected 63, is " + << last_msg_->signature[63]; + EXPECT_EQ(last_msg_->signed_messages[0], 5000) + << "incorrect value for signed_messages[0], expected 5000, is " + << last_msg_->signed_messages[0]; + EXPECT_EQ(last_msg_->signed_messages[1], 5234) + << "incorrect value for signed_messages[1], expected 5234, is " + << last_msg_->signed_messages[1]; + EXPECT_EQ(last_msg_->signed_messages[2], 5468) + << "incorrect value for signed_messages[2], expected 5468, is " + << last_msg_->signed_messages[2]; + EXPECT_EQ(last_msg_->signed_messages[3], 5702) + << "incorrect value for signed_messages[3], expected 5702, is " + << last_msg_->signed_messages[3]; + EXPECT_EQ(last_msg_->signed_messages[4], 5936) + << "incorrect value for signed_messages[4], expected 5936, is " + << last_msg_->signed_messages[4]; + EXPECT_EQ(last_msg_->signed_messages[5], 6170) + << "incorrect value for signed_messages[5], expected 6170, is " + << last_msg_->signed_messages[5]; + EXPECT_EQ(last_msg_->signed_messages[6], 6404) + << "incorrect value for signed_messages[6], expected 6404, is " + << last_msg_->signed_messages[6]; + EXPECT_EQ(last_msg_->signed_messages[7], 6638) + << "incorrect value for signed_messages[7], expected 6638, is " + << last_msg_->signed_messages[7]; + EXPECT_EQ(last_msg_->signed_messages[8], 6872) + << "incorrect value for signed_messages[8], expected 6872, is " + << last_msg_->signed_messages[8]; + EXPECT_EQ(last_msg_->signed_messages[9], 7106) + << "incorrect value for signed_messages[9], expected 7106, is " + << last_msg_->signed_messages[9]; + EXPECT_EQ(last_msg_->signed_messages[10], 7340) + << "incorrect value for signed_messages[10], expected 7340, is " + << last_msg_->signed_messages[10]; + EXPECT_EQ(last_msg_->signed_messages[11], 7574) + << "incorrect value for signed_messages[11], expected 7574, is " + << last_msg_->signed_messages[11]; + EXPECT_EQ(last_msg_->signed_messages[12], 7808) + << "incorrect value for signed_messages[12], expected 7808, is " + << last_msg_->signed_messages[12]; + EXPECT_EQ(last_msg_->signed_messages[13], 8042) + << "incorrect value for signed_messages[13], expected 8042, is " + << last_msg_->signed_messages[13]; + EXPECT_EQ(last_msg_->signed_messages[14], 8276) + << "incorrect value for signed_messages[14], expected 8276, is " + << last_msg_->signed_messages[14]; + EXPECT_EQ(last_msg_->signed_messages[15], 8510) + << "incorrect value for signed_messages[15], expected 8510, is " + << last_msg_->signed_messages[15]; + EXPECT_EQ(last_msg_->signed_messages[16], 8744) + << "incorrect value for signed_messages[16], expected 8744, is " + << last_msg_->signed_messages[16]; + EXPECT_EQ(last_msg_->signed_messages[17], 8978) + << "incorrect value for signed_messages[17], expected 8978, is " + << last_msg_->signed_messages[17]; + EXPECT_EQ(last_msg_->signed_messages[18], 9212) + << "incorrect value for signed_messages[18], expected 9212, is " + << last_msg_->signed_messages[18]; + EXPECT_EQ(last_msg_->signed_messages[19], 9446) + << "incorrect value for signed_messages[19], expected 9446, is " + << last_msg_->signed_messages[19]; + EXPECT_EQ(last_msg_->signed_messages[20], 9680) + << "incorrect value for signed_messages[20], expected 9680, is " + << last_msg_->signed_messages[20]; + EXPECT_EQ(last_msg_->signed_messages[21], 9914) + << "incorrect value for signed_messages[21], expected 9914, is " + << last_msg_->signed_messages[21]; + EXPECT_EQ(last_msg_->signed_messages[22], 10148) + << "incorrect value for signed_messages[22], expected 10148, is " + << last_msg_->signed_messages[22]; + EXPECT_EQ(last_msg_->signed_messages[23], 10382) + << "incorrect value for signed_messages[23], expected 10382, is " + << last_msg_->signed_messages[23]; + EXPECT_EQ(last_msg_->signed_messages[24], 10616) + << "incorrect value for signed_messages[24], expected 10616, is " + << last_msg_->signed_messages[24]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepB.cc b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepB.cc index 72d90f82e..7aeaaea6f 100644 --- a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepB.cc +++ b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEd25519SignatureDepB.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEd25519SignatureDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ed25519_signature_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ed25519_signature_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,691 +82,951 @@ class Test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ed25519_signature_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB0, Test) -{ +}; - uint8_t encoded_frame[] = {85,3,12,66,0,186,1,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,136,19,0,0,114,20,0,0,92,21,0,0,70,22,0,0,48,23,0,0,26,24,0,0,4,25,0,0,238,25,0,0,216,26,0,0,194,27,0,0,172,28,0,0,150,29,0,0,128,30,0,0,106,31,0,0,84,32,0,0,62,33,0,0,40,34,0,0,18,35,0,0,252,35,0,0,230,36,0,0,208,37,0,0,186,38,0,0,164,39,0,0,142,40,0,0,120,41,0,0,238,145, }; +TEST_F(Test_legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 3, 12, 66, 0, 186, 1, 0, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 136, 19, 0, 0, 114, 20, 0, 0, 92, 21, 0, 0, 70, + 22, 0, 0, 48, 23, 0, 0, 26, 24, 0, 0, 4, 25, 0, 0, + 238, 25, 0, 0, 216, 26, 0, 0, 194, 27, 0, 0, 172, 28, 0, + 0, 150, 29, 0, 0, 128, 30, 0, 0, 106, 31, 0, 0, 84, 32, + 0, 0, 62, 33, 0, 0, 40, 34, 0, 0, 18, 35, 0, 0, 252, + 35, 0, 0, 230, 36, 0, 0, 208, 37, 0, 0, 186, 38, 0, 0, + 164, 39, 0, 0, 142, 40, 0, 0, 120, 41, 0, 0, 238, 145, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ed25519_signature_dep_b_t* test_msg = ( msg_ed25519_signature_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[0] = 100; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[1] = 101; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[2] = 102; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[3] = 103; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[4] = 104; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[5] = 105; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[6] = 106; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[7] = 107; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[8] = 108; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[9] = 109; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[10] = 110; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[11] = 111; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[12] = 112; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[13] = 113; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[14] = 114; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[15] = 115; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[16] = 116; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[17] = 117; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[18] = 118; - if (sizeof(test_msg->fingerprint) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); - } - test_msg->fingerprint[19] = 119; - test_msg->on_demand_counter = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[0] = 0; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[1] = 1; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[2] = 2; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[3] = 3; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[4] = 4; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[5] = 5; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[6] = 6; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[7] = 7; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[8] = 8; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[9] = 9; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[10] = 10; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[11] = 11; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[12] = 12; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[13] = 13; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[14] = 14; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[15] = 15; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[16] = 16; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[17] = 17; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[18] = 18; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[19] = 19; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[20] = 20; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[21] = 21; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[22] = 22; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[23] = 23; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[24] = 24; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[25] = 25; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[26] = 26; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[27] = 27; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[28] = 28; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[29] = 29; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[30] = 30; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[31] = 31; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[32] = 32; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[33] = 33; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[34] = 34; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[35] = 35; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[36] = 36; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[37] = 37; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[38] = 38; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[39] = 39; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[40] = 40; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[41] = 41; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[42] = 42; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[43] = 43; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[44] = 44; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[45] = 45; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[46] = 46; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[47] = 47; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[48] = 48; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[49] = 49; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[50] = 50; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[51] = 51; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[52] = 52; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[53] = 53; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[54] = 54; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[55] = 55; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[56] = 56; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[57] = 57; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[58] = 58; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[59] = 59; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[60] = 60; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[61] = 61; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[62] = 62; - if (sizeof(test_msg->signature) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); - } - test_msg->signature[63] = 63; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[0] = 5000; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[1] = 5234; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[2] = 5468; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[3] = 5702; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[4] = 5936; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[5] = 6170; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[6] = 6404; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[7] = 6638; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[8] = 6872; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[9] = 7106; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[10] = 7340; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[11] = 7574; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[12] = 7808; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[13] = 8042; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[14] = 8276; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[15] = 8510; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[16] = 8744; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[17] = 8978; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[18] = 9212; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[19] = 9446; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[20] = 9680; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[21] = 9914; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[22] = 10148; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[23] = 10382; - if (sizeof(test_msg->signed_messages) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); - } - test_msg->signed_messages[24] = 10616; - test_msg->stream_counter = 1; - - EXPECT_EQ(send_message( 0xC03, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ed25519_signature_dep_b_t *test_msg = + (msg_ed25519_signature_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[0] = 100; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[1] = 101; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[2] = 102; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[3] = 103; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[4] = 104; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[5] = 105; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[6] = 106; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[7] = 107; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[8] = 108; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[9] = 109; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[10] = 110; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[11] = 111; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[12] = 112; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[13] = 113; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[14] = 114; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[15] = 115; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[16] = 116; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[17] = 117; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[18] = 118; + if (sizeof(test_msg->fingerprint) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->fingerprint[0])); + } + test_msg->fingerprint[19] = 119; + test_msg->on_demand_counter = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[0] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[1] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[2] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[3] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[4] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[5] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[6] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[7] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[8] = 8; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[9] = 9; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[10] = 10; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[11] = 11; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[12] = 12; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[13] = 13; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[14] = 14; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[15] = 15; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[16] = 16; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[17] = 17; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[18] = 18; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[19] = 19; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[20] = 20; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[21] = 21; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[22] = 22; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[23] = 23; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[24] = 24; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[25] = 25; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[26] = 26; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[27] = 27; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[28] = 28; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[29] = 29; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[30] = 30; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[31] = 31; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[32] = 32; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[33] = 33; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[34] = 34; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[35] = 35; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[36] = 36; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[37] = 37; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[38] = 38; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[39] = 39; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[40] = 40; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[41] = 41; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[42] = 42; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[43] = 43; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[44] = 44; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[45] = 45; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[46] = 46; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[47] = 47; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[48] = 48; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[49] = 49; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[50] = 50; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[51] = 51; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[52] = 52; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[53] = 53; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[54] = 54; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[55] = 55; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[56] = 56; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[57] = 57; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[58] = 58; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[59] = 59; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[60] = 60; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[61] = 61; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[62] = 62; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[63] = 63; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[0] = 5000; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[1] = 5234; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[2] = 5468; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[3] = 5702; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[4] = 5936; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[5] = 6170; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[6] = 6404; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[7] = 6638; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[8] = 6872; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[9] = 7106; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[10] = 7340; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[11] = 7574; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[12] = 7808; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[13] = 8042; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[14] = 8276; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[15] = 8510; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[16] = 8744; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[17] = 8978; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[18] = 9212; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[19] = 9446; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[20] = 9680; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[21] = 9914; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[22] = 10148; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[23] = 10382; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[24] = 10616; + test_msg->stream_counter = 1; + + EXPECT_EQ(send_message(0xC03, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->fingerprint[0], 100) << "incorrect value for fingerprint[0], expected 100, is " << last_msg_->fingerprint[0]; - EXPECT_EQ(last_msg_->fingerprint[1], 101) << "incorrect value for fingerprint[1], expected 101, is " << last_msg_->fingerprint[1]; - EXPECT_EQ(last_msg_->fingerprint[2], 102) << "incorrect value for fingerprint[2], expected 102, is " << last_msg_->fingerprint[2]; - EXPECT_EQ(last_msg_->fingerprint[3], 103) << "incorrect value for fingerprint[3], expected 103, is " << last_msg_->fingerprint[3]; - EXPECT_EQ(last_msg_->fingerprint[4], 104) << "incorrect value for fingerprint[4], expected 104, is " << last_msg_->fingerprint[4]; - EXPECT_EQ(last_msg_->fingerprint[5], 105) << "incorrect value for fingerprint[5], expected 105, is " << last_msg_->fingerprint[5]; - EXPECT_EQ(last_msg_->fingerprint[6], 106) << "incorrect value for fingerprint[6], expected 106, is " << last_msg_->fingerprint[6]; - EXPECT_EQ(last_msg_->fingerprint[7], 107) << "incorrect value for fingerprint[7], expected 107, is " << last_msg_->fingerprint[7]; - EXPECT_EQ(last_msg_->fingerprint[8], 108) << "incorrect value for fingerprint[8], expected 108, is " << last_msg_->fingerprint[8]; - EXPECT_EQ(last_msg_->fingerprint[9], 109) << "incorrect value for fingerprint[9], expected 109, is " << last_msg_->fingerprint[9]; - EXPECT_EQ(last_msg_->fingerprint[10], 110) << "incorrect value for fingerprint[10], expected 110, is " << last_msg_->fingerprint[10]; - EXPECT_EQ(last_msg_->fingerprint[11], 111) << "incorrect value for fingerprint[11], expected 111, is " << last_msg_->fingerprint[11]; - EXPECT_EQ(last_msg_->fingerprint[12], 112) << "incorrect value for fingerprint[12], expected 112, is " << last_msg_->fingerprint[12]; - EXPECT_EQ(last_msg_->fingerprint[13], 113) << "incorrect value for fingerprint[13], expected 113, is " << last_msg_->fingerprint[13]; - EXPECT_EQ(last_msg_->fingerprint[14], 114) << "incorrect value for fingerprint[14], expected 114, is " << last_msg_->fingerprint[14]; - EXPECT_EQ(last_msg_->fingerprint[15], 115) << "incorrect value for fingerprint[15], expected 115, is " << last_msg_->fingerprint[15]; - EXPECT_EQ(last_msg_->fingerprint[16], 116) << "incorrect value for fingerprint[16], expected 116, is " << last_msg_->fingerprint[16]; - EXPECT_EQ(last_msg_->fingerprint[17], 117) << "incorrect value for fingerprint[17], expected 117, is " << last_msg_->fingerprint[17]; - EXPECT_EQ(last_msg_->fingerprint[18], 118) << "incorrect value for fingerprint[18], expected 118, is " << last_msg_->fingerprint[18]; - EXPECT_EQ(last_msg_->fingerprint[19], 119) << "incorrect value for fingerprint[19], expected 119, is " << last_msg_->fingerprint[19]; - EXPECT_EQ(last_msg_->on_demand_counter, 0) << "incorrect value for on_demand_counter, expected 0, is " << last_msg_->on_demand_counter; - EXPECT_EQ(last_msg_->signature[0], 0) << "incorrect value for signature[0], expected 0, is " << last_msg_->signature[0]; - EXPECT_EQ(last_msg_->signature[1], 1) << "incorrect value for signature[1], expected 1, is " << last_msg_->signature[1]; - EXPECT_EQ(last_msg_->signature[2], 2) << "incorrect value for signature[2], expected 2, is " << last_msg_->signature[2]; - EXPECT_EQ(last_msg_->signature[3], 3) << "incorrect value for signature[3], expected 3, is " << last_msg_->signature[3]; - EXPECT_EQ(last_msg_->signature[4], 4) << "incorrect value for signature[4], expected 4, is " << last_msg_->signature[4]; - EXPECT_EQ(last_msg_->signature[5], 5) << "incorrect value for signature[5], expected 5, is " << last_msg_->signature[5]; - EXPECT_EQ(last_msg_->signature[6], 6) << "incorrect value for signature[6], expected 6, is " << last_msg_->signature[6]; - EXPECT_EQ(last_msg_->signature[7], 7) << "incorrect value for signature[7], expected 7, is " << last_msg_->signature[7]; - EXPECT_EQ(last_msg_->signature[8], 8) << "incorrect value for signature[8], expected 8, is " << last_msg_->signature[8]; - EXPECT_EQ(last_msg_->signature[9], 9) << "incorrect value for signature[9], expected 9, is " << last_msg_->signature[9]; - EXPECT_EQ(last_msg_->signature[10], 10) << "incorrect value for signature[10], expected 10, is " << last_msg_->signature[10]; - EXPECT_EQ(last_msg_->signature[11], 11) << "incorrect value for signature[11], expected 11, is " << last_msg_->signature[11]; - EXPECT_EQ(last_msg_->signature[12], 12) << "incorrect value for signature[12], expected 12, is " << last_msg_->signature[12]; - EXPECT_EQ(last_msg_->signature[13], 13) << "incorrect value for signature[13], expected 13, is " << last_msg_->signature[13]; - EXPECT_EQ(last_msg_->signature[14], 14) << "incorrect value for signature[14], expected 14, is " << last_msg_->signature[14]; - EXPECT_EQ(last_msg_->signature[15], 15) << "incorrect value for signature[15], expected 15, is " << last_msg_->signature[15]; - EXPECT_EQ(last_msg_->signature[16], 16) << "incorrect value for signature[16], expected 16, is " << last_msg_->signature[16]; - EXPECT_EQ(last_msg_->signature[17], 17) << "incorrect value for signature[17], expected 17, is " << last_msg_->signature[17]; - EXPECT_EQ(last_msg_->signature[18], 18) << "incorrect value for signature[18], expected 18, is " << last_msg_->signature[18]; - EXPECT_EQ(last_msg_->signature[19], 19) << "incorrect value for signature[19], expected 19, is " << last_msg_->signature[19]; - EXPECT_EQ(last_msg_->signature[20], 20) << "incorrect value for signature[20], expected 20, is " << last_msg_->signature[20]; - EXPECT_EQ(last_msg_->signature[21], 21) << "incorrect value for signature[21], expected 21, is " << last_msg_->signature[21]; - EXPECT_EQ(last_msg_->signature[22], 22) << "incorrect value for signature[22], expected 22, is " << last_msg_->signature[22]; - EXPECT_EQ(last_msg_->signature[23], 23) << "incorrect value for signature[23], expected 23, is " << last_msg_->signature[23]; - EXPECT_EQ(last_msg_->signature[24], 24) << "incorrect value for signature[24], expected 24, is " << last_msg_->signature[24]; - EXPECT_EQ(last_msg_->signature[25], 25) << "incorrect value for signature[25], expected 25, is " << last_msg_->signature[25]; - EXPECT_EQ(last_msg_->signature[26], 26) << "incorrect value for signature[26], expected 26, is " << last_msg_->signature[26]; - EXPECT_EQ(last_msg_->signature[27], 27) << "incorrect value for signature[27], expected 27, is " << last_msg_->signature[27]; - EXPECT_EQ(last_msg_->signature[28], 28) << "incorrect value for signature[28], expected 28, is " << last_msg_->signature[28]; - EXPECT_EQ(last_msg_->signature[29], 29) << "incorrect value for signature[29], expected 29, is " << last_msg_->signature[29]; - EXPECT_EQ(last_msg_->signature[30], 30) << "incorrect value for signature[30], expected 30, is " << last_msg_->signature[30]; - EXPECT_EQ(last_msg_->signature[31], 31) << "incorrect value for signature[31], expected 31, is " << last_msg_->signature[31]; - EXPECT_EQ(last_msg_->signature[32], 32) << "incorrect value for signature[32], expected 32, is " << last_msg_->signature[32]; - EXPECT_EQ(last_msg_->signature[33], 33) << "incorrect value for signature[33], expected 33, is " << last_msg_->signature[33]; - EXPECT_EQ(last_msg_->signature[34], 34) << "incorrect value for signature[34], expected 34, is " << last_msg_->signature[34]; - EXPECT_EQ(last_msg_->signature[35], 35) << "incorrect value for signature[35], expected 35, is " << last_msg_->signature[35]; - EXPECT_EQ(last_msg_->signature[36], 36) << "incorrect value for signature[36], expected 36, is " << last_msg_->signature[36]; - EXPECT_EQ(last_msg_->signature[37], 37) << "incorrect value for signature[37], expected 37, is " << last_msg_->signature[37]; - EXPECT_EQ(last_msg_->signature[38], 38) << "incorrect value for signature[38], expected 38, is " << last_msg_->signature[38]; - EXPECT_EQ(last_msg_->signature[39], 39) << "incorrect value for signature[39], expected 39, is " << last_msg_->signature[39]; - EXPECT_EQ(last_msg_->signature[40], 40) << "incorrect value for signature[40], expected 40, is " << last_msg_->signature[40]; - EXPECT_EQ(last_msg_->signature[41], 41) << "incorrect value for signature[41], expected 41, is " << last_msg_->signature[41]; - EXPECT_EQ(last_msg_->signature[42], 42) << "incorrect value for signature[42], expected 42, is " << last_msg_->signature[42]; - EXPECT_EQ(last_msg_->signature[43], 43) << "incorrect value for signature[43], expected 43, is " << last_msg_->signature[43]; - EXPECT_EQ(last_msg_->signature[44], 44) << "incorrect value for signature[44], expected 44, is " << last_msg_->signature[44]; - EXPECT_EQ(last_msg_->signature[45], 45) << "incorrect value for signature[45], expected 45, is " << last_msg_->signature[45]; - EXPECT_EQ(last_msg_->signature[46], 46) << "incorrect value for signature[46], expected 46, is " << last_msg_->signature[46]; - EXPECT_EQ(last_msg_->signature[47], 47) << "incorrect value for signature[47], expected 47, is " << last_msg_->signature[47]; - EXPECT_EQ(last_msg_->signature[48], 48) << "incorrect value for signature[48], expected 48, is " << last_msg_->signature[48]; - EXPECT_EQ(last_msg_->signature[49], 49) << "incorrect value for signature[49], expected 49, is " << last_msg_->signature[49]; - EXPECT_EQ(last_msg_->signature[50], 50) << "incorrect value for signature[50], expected 50, is " << last_msg_->signature[50]; - EXPECT_EQ(last_msg_->signature[51], 51) << "incorrect value for signature[51], expected 51, is " << last_msg_->signature[51]; - EXPECT_EQ(last_msg_->signature[52], 52) << "incorrect value for signature[52], expected 52, is " << last_msg_->signature[52]; - EXPECT_EQ(last_msg_->signature[53], 53) << "incorrect value for signature[53], expected 53, is " << last_msg_->signature[53]; - EXPECT_EQ(last_msg_->signature[54], 54) << "incorrect value for signature[54], expected 54, is " << last_msg_->signature[54]; - EXPECT_EQ(last_msg_->signature[55], 55) << "incorrect value for signature[55], expected 55, is " << last_msg_->signature[55]; - EXPECT_EQ(last_msg_->signature[56], 56) << "incorrect value for signature[56], expected 56, is " << last_msg_->signature[56]; - EXPECT_EQ(last_msg_->signature[57], 57) << "incorrect value for signature[57], expected 57, is " << last_msg_->signature[57]; - EXPECT_EQ(last_msg_->signature[58], 58) << "incorrect value for signature[58], expected 58, is " << last_msg_->signature[58]; - EXPECT_EQ(last_msg_->signature[59], 59) << "incorrect value for signature[59], expected 59, is " << last_msg_->signature[59]; - EXPECT_EQ(last_msg_->signature[60], 60) << "incorrect value for signature[60], expected 60, is " << last_msg_->signature[60]; - EXPECT_EQ(last_msg_->signature[61], 61) << "incorrect value for signature[61], expected 61, is " << last_msg_->signature[61]; - EXPECT_EQ(last_msg_->signature[62], 62) << "incorrect value for signature[62], expected 62, is " << last_msg_->signature[62]; - EXPECT_EQ(last_msg_->signature[63], 63) << "incorrect value for signature[63], expected 63, is " << last_msg_->signature[63]; - EXPECT_EQ(last_msg_->signed_messages[0], 5000) << "incorrect value for signed_messages[0], expected 5000, is " << last_msg_->signed_messages[0]; - EXPECT_EQ(last_msg_->signed_messages[1], 5234) << "incorrect value for signed_messages[1], expected 5234, is " << last_msg_->signed_messages[1]; - EXPECT_EQ(last_msg_->signed_messages[2], 5468) << "incorrect value for signed_messages[2], expected 5468, is " << last_msg_->signed_messages[2]; - EXPECT_EQ(last_msg_->signed_messages[3], 5702) << "incorrect value for signed_messages[3], expected 5702, is " << last_msg_->signed_messages[3]; - EXPECT_EQ(last_msg_->signed_messages[4], 5936) << "incorrect value for signed_messages[4], expected 5936, is " << last_msg_->signed_messages[4]; - EXPECT_EQ(last_msg_->signed_messages[5], 6170) << "incorrect value for signed_messages[5], expected 6170, is " << last_msg_->signed_messages[5]; - EXPECT_EQ(last_msg_->signed_messages[6], 6404) << "incorrect value for signed_messages[6], expected 6404, is " << last_msg_->signed_messages[6]; - EXPECT_EQ(last_msg_->signed_messages[7], 6638) << "incorrect value for signed_messages[7], expected 6638, is " << last_msg_->signed_messages[7]; - EXPECT_EQ(last_msg_->signed_messages[8], 6872) << "incorrect value for signed_messages[8], expected 6872, is " << last_msg_->signed_messages[8]; - EXPECT_EQ(last_msg_->signed_messages[9], 7106) << "incorrect value for signed_messages[9], expected 7106, is " << last_msg_->signed_messages[9]; - EXPECT_EQ(last_msg_->signed_messages[10], 7340) << "incorrect value for signed_messages[10], expected 7340, is " << last_msg_->signed_messages[10]; - EXPECT_EQ(last_msg_->signed_messages[11], 7574) << "incorrect value for signed_messages[11], expected 7574, is " << last_msg_->signed_messages[11]; - EXPECT_EQ(last_msg_->signed_messages[12], 7808) << "incorrect value for signed_messages[12], expected 7808, is " << last_msg_->signed_messages[12]; - EXPECT_EQ(last_msg_->signed_messages[13], 8042) << "incorrect value for signed_messages[13], expected 8042, is " << last_msg_->signed_messages[13]; - EXPECT_EQ(last_msg_->signed_messages[14], 8276) << "incorrect value for signed_messages[14], expected 8276, is " << last_msg_->signed_messages[14]; - EXPECT_EQ(last_msg_->signed_messages[15], 8510) << "incorrect value for signed_messages[15], expected 8510, is " << last_msg_->signed_messages[15]; - EXPECT_EQ(last_msg_->signed_messages[16], 8744) << "incorrect value for signed_messages[16], expected 8744, is " << last_msg_->signed_messages[16]; - EXPECT_EQ(last_msg_->signed_messages[17], 8978) << "incorrect value for signed_messages[17], expected 8978, is " << last_msg_->signed_messages[17]; - EXPECT_EQ(last_msg_->signed_messages[18], 9212) << "incorrect value for signed_messages[18], expected 9212, is " << last_msg_->signed_messages[18]; - EXPECT_EQ(last_msg_->signed_messages[19], 9446) << "incorrect value for signed_messages[19], expected 9446, is " << last_msg_->signed_messages[19]; - EXPECT_EQ(last_msg_->signed_messages[20], 9680) << "incorrect value for signed_messages[20], expected 9680, is " << last_msg_->signed_messages[20]; - EXPECT_EQ(last_msg_->signed_messages[21], 9914) << "incorrect value for signed_messages[21], expected 9914, is " << last_msg_->signed_messages[21]; - EXPECT_EQ(last_msg_->signed_messages[22], 10148) << "incorrect value for signed_messages[22], expected 10148, is " << last_msg_->signed_messages[22]; - EXPECT_EQ(last_msg_->signed_messages[23], 10382) << "incorrect value for signed_messages[23], expected 10382, is " << last_msg_->signed_messages[23]; - EXPECT_EQ(last_msg_->signed_messages[24], 10616) << "incorrect value for signed_messages[24], expected 10616, is " << last_msg_->signed_messages[24]; - EXPECT_EQ(last_msg_->stream_counter, 1) << "incorrect value for stream_counter, expected 1, is " << last_msg_->stream_counter; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->fingerprint[0], 100) + << "incorrect value for fingerprint[0], expected 100, is " + << last_msg_->fingerprint[0]; + EXPECT_EQ(last_msg_->fingerprint[1], 101) + << "incorrect value for fingerprint[1], expected 101, is " + << last_msg_->fingerprint[1]; + EXPECT_EQ(last_msg_->fingerprint[2], 102) + << "incorrect value for fingerprint[2], expected 102, is " + << last_msg_->fingerprint[2]; + EXPECT_EQ(last_msg_->fingerprint[3], 103) + << "incorrect value for fingerprint[3], expected 103, is " + << last_msg_->fingerprint[3]; + EXPECT_EQ(last_msg_->fingerprint[4], 104) + << "incorrect value for fingerprint[4], expected 104, is " + << last_msg_->fingerprint[4]; + EXPECT_EQ(last_msg_->fingerprint[5], 105) + << "incorrect value for fingerprint[5], expected 105, is " + << last_msg_->fingerprint[5]; + EXPECT_EQ(last_msg_->fingerprint[6], 106) + << "incorrect value for fingerprint[6], expected 106, is " + << last_msg_->fingerprint[6]; + EXPECT_EQ(last_msg_->fingerprint[7], 107) + << "incorrect value for fingerprint[7], expected 107, is " + << last_msg_->fingerprint[7]; + EXPECT_EQ(last_msg_->fingerprint[8], 108) + << "incorrect value for fingerprint[8], expected 108, is " + << last_msg_->fingerprint[8]; + EXPECT_EQ(last_msg_->fingerprint[9], 109) + << "incorrect value for fingerprint[9], expected 109, is " + << last_msg_->fingerprint[9]; + EXPECT_EQ(last_msg_->fingerprint[10], 110) + << "incorrect value for fingerprint[10], expected 110, is " + << last_msg_->fingerprint[10]; + EXPECT_EQ(last_msg_->fingerprint[11], 111) + << "incorrect value for fingerprint[11], expected 111, is " + << last_msg_->fingerprint[11]; + EXPECT_EQ(last_msg_->fingerprint[12], 112) + << "incorrect value for fingerprint[12], expected 112, is " + << last_msg_->fingerprint[12]; + EXPECT_EQ(last_msg_->fingerprint[13], 113) + << "incorrect value for fingerprint[13], expected 113, is " + << last_msg_->fingerprint[13]; + EXPECT_EQ(last_msg_->fingerprint[14], 114) + << "incorrect value for fingerprint[14], expected 114, is " + << last_msg_->fingerprint[14]; + EXPECT_EQ(last_msg_->fingerprint[15], 115) + << "incorrect value for fingerprint[15], expected 115, is " + << last_msg_->fingerprint[15]; + EXPECT_EQ(last_msg_->fingerprint[16], 116) + << "incorrect value for fingerprint[16], expected 116, is " + << last_msg_->fingerprint[16]; + EXPECT_EQ(last_msg_->fingerprint[17], 117) + << "incorrect value for fingerprint[17], expected 117, is " + << last_msg_->fingerprint[17]; + EXPECT_EQ(last_msg_->fingerprint[18], 118) + << "incorrect value for fingerprint[18], expected 118, is " + << last_msg_->fingerprint[18]; + EXPECT_EQ(last_msg_->fingerprint[19], 119) + << "incorrect value for fingerprint[19], expected 119, is " + << last_msg_->fingerprint[19]; + EXPECT_EQ(last_msg_->on_demand_counter, 0) + << "incorrect value for on_demand_counter, expected 0, is " + << last_msg_->on_demand_counter; + EXPECT_EQ(last_msg_->signature[0], 0) + << "incorrect value for signature[0], expected 0, is " + << last_msg_->signature[0]; + EXPECT_EQ(last_msg_->signature[1], 1) + << "incorrect value for signature[1], expected 1, is " + << last_msg_->signature[1]; + EXPECT_EQ(last_msg_->signature[2], 2) + << "incorrect value for signature[2], expected 2, is " + << last_msg_->signature[2]; + EXPECT_EQ(last_msg_->signature[3], 3) + << "incorrect value for signature[3], expected 3, is " + << last_msg_->signature[3]; + EXPECT_EQ(last_msg_->signature[4], 4) + << "incorrect value for signature[4], expected 4, is " + << last_msg_->signature[4]; + EXPECT_EQ(last_msg_->signature[5], 5) + << "incorrect value for signature[5], expected 5, is " + << last_msg_->signature[5]; + EXPECT_EQ(last_msg_->signature[6], 6) + << "incorrect value for signature[6], expected 6, is " + << last_msg_->signature[6]; + EXPECT_EQ(last_msg_->signature[7], 7) + << "incorrect value for signature[7], expected 7, is " + << last_msg_->signature[7]; + EXPECT_EQ(last_msg_->signature[8], 8) + << "incorrect value for signature[8], expected 8, is " + << last_msg_->signature[8]; + EXPECT_EQ(last_msg_->signature[9], 9) + << "incorrect value for signature[9], expected 9, is " + << last_msg_->signature[9]; + EXPECT_EQ(last_msg_->signature[10], 10) + << "incorrect value for signature[10], expected 10, is " + << last_msg_->signature[10]; + EXPECT_EQ(last_msg_->signature[11], 11) + << "incorrect value for signature[11], expected 11, is " + << last_msg_->signature[11]; + EXPECT_EQ(last_msg_->signature[12], 12) + << "incorrect value for signature[12], expected 12, is " + << last_msg_->signature[12]; + EXPECT_EQ(last_msg_->signature[13], 13) + << "incorrect value for signature[13], expected 13, is " + << last_msg_->signature[13]; + EXPECT_EQ(last_msg_->signature[14], 14) + << "incorrect value for signature[14], expected 14, is " + << last_msg_->signature[14]; + EXPECT_EQ(last_msg_->signature[15], 15) + << "incorrect value for signature[15], expected 15, is " + << last_msg_->signature[15]; + EXPECT_EQ(last_msg_->signature[16], 16) + << "incorrect value for signature[16], expected 16, is " + << last_msg_->signature[16]; + EXPECT_EQ(last_msg_->signature[17], 17) + << "incorrect value for signature[17], expected 17, is " + << last_msg_->signature[17]; + EXPECT_EQ(last_msg_->signature[18], 18) + << "incorrect value for signature[18], expected 18, is " + << last_msg_->signature[18]; + EXPECT_EQ(last_msg_->signature[19], 19) + << "incorrect value for signature[19], expected 19, is " + << last_msg_->signature[19]; + EXPECT_EQ(last_msg_->signature[20], 20) + << "incorrect value for signature[20], expected 20, is " + << last_msg_->signature[20]; + EXPECT_EQ(last_msg_->signature[21], 21) + << "incorrect value for signature[21], expected 21, is " + << last_msg_->signature[21]; + EXPECT_EQ(last_msg_->signature[22], 22) + << "incorrect value for signature[22], expected 22, is " + << last_msg_->signature[22]; + EXPECT_EQ(last_msg_->signature[23], 23) + << "incorrect value for signature[23], expected 23, is " + << last_msg_->signature[23]; + EXPECT_EQ(last_msg_->signature[24], 24) + << "incorrect value for signature[24], expected 24, is " + << last_msg_->signature[24]; + EXPECT_EQ(last_msg_->signature[25], 25) + << "incorrect value for signature[25], expected 25, is " + << last_msg_->signature[25]; + EXPECT_EQ(last_msg_->signature[26], 26) + << "incorrect value for signature[26], expected 26, is " + << last_msg_->signature[26]; + EXPECT_EQ(last_msg_->signature[27], 27) + << "incorrect value for signature[27], expected 27, is " + << last_msg_->signature[27]; + EXPECT_EQ(last_msg_->signature[28], 28) + << "incorrect value for signature[28], expected 28, is " + << last_msg_->signature[28]; + EXPECT_EQ(last_msg_->signature[29], 29) + << "incorrect value for signature[29], expected 29, is " + << last_msg_->signature[29]; + EXPECT_EQ(last_msg_->signature[30], 30) + << "incorrect value for signature[30], expected 30, is " + << last_msg_->signature[30]; + EXPECT_EQ(last_msg_->signature[31], 31) + << "incorrect value for signature[31], expected 31, is " + << last_msg_->signature[31]; + EXPECT_EQ(last_msg_->signature[32], 32) + << "incorrect value for signature[32], expected 32, is " + << last_msg_->signature[32]; + EXPECT_EQ(last_msg_->signature[33], 33) + << "incorrect value for signature[33], expected 33, is " + << last_msg_->signature[33]; + EXPECT_EQ(last_msg_->signature[34], 34) + << "incorrect value for signature[34], expected 34, is " + << last_msg_->signature[34]; + EXPECT_EQ(last_msg_->signature[35], 35) + << "incorrect value for signature[35], expected 35, is " + << last_msg_->signature[35]; + EXPECT_EQ(last_msg_->signature[36], 36) + << "incorrect value for signature[36], expected 36, is " + << last_msg_->signature[36]; + EXPECT_EQ(last_msg_->signature[37], 37) + << "incorrect value for signature[37], expected 37, is " + << last_msg_->signature[37]; + EXPECT_EQ(last_msg_->signature[38], 38) + << "incorrect value for signature[38], expected 38, is " + << last_msg_->signature[38]; + EXPECT_EQ(last_msg_->signature[39], 39) + << "incorrect value for signature[39], expected 39, is " + << last_msg_->signature[39]; + EXPECT_EQ(last_msg_->signature[40], 40) + << "incorrect value for signature[40], expected 40, is " + << last_msg_->signature[40]; + EXPECT_EQ(last_msg_->signature[41], 41) + << "incorrect value for signature[41], expected 41, is " + << last_msg_->signature[41]; + EXPECT_EQ(last_msg_->signature[42], 42) + << "incorrect value for signature[42], expected 42, is " + << last_msg_->signature[42]; + EXPECT_EQ(last_msg_->signature[43], 43) + << "incorrect value for signature[43], expected 43, is " + << last_msg_->signature[43]; + EXPECT_EQ(last_msg_->signature[44], 44) + << "incorrect value for signature[44], expected 44, is " + << last_msg_->signature[44]; + EXPECT_EQ(last_msg_->signature[45], 45) + << "incorrect value for signature[45], expected 45, is " + << last_msg_->signature[45]; + EXPECT_EQ(last_msg_->signature[46], 46) + << "incorrect value for signature[46], expected 46, is " + << last_msg_->signature[46]; + EXPECT_EQ(last_msg_->signature[47], 47) + << "incorrect value for signature[47], expected 47, is " + << last_msg_->signature[47]; + EXPECT_EQ(last_msg_->signature[48], 48) + << "incorrect value for signature[48], expected 48, is " + << last_msg_->signature[48]; + EXPECT_EQ(last_msg_->signature[49], 49) + << "incorrect value for signature[49], expected 49, is " + << last_msg_->signature[49]; + EXPECT_EQ(last_msg_->signature[50], 50) + << "incorrect value for signature[50], expected 50, is " + << last_msg_->signature[50]; + EXPECT_EQ(last_msg_->signature[51], 51) + << "incorrect value for signature[51], expected 51, is " + << last_msg_->signature[51]; + EXPECT_EQ(last_msg_->signature[52], 52) + << "incorrect value for signature[52], expected 52, is " + << last_msg_->signature[52]; + EXPECT_EQ(last_msg_->signature[53], 53) + << "incorrect value for signature[53], expected 53, is " + << last_msg_->signature[53]; + EXPECT_EQ(last_msg_->signature[54], 54) + << "incorrect value for signature[54], expected 54, is " + << last_msg_->signature[54]; + EXPECT_EQ(last_msg_->signature[55], 55) + << "incorrect value for signature[55], expected 55, is " + << last_msg_->signature[55]; + EXPECT_EQ(last_msg_->signature[56], 56) + << "incorrect value for signature[56], expected 56, is " + << last_msg_->signature[56]; + EXPECT_EQ(last_msg_->signature[57], 57) + << "incorrect value for signature[57], expected 57, is " + << last_msg_->signature[57]; + EXPECT_EQ(last_msg_->signature[58], 58) + << "incorrect value for signature[58], expected 58, is " + << last_msg_->signature[58]; + EXPECT_EQ(last_msg_->signature[59], 59) + << "incorrect value for signature[59], expected 59, is " + << last_msg_->signature[59]; + EXPECT_EQ(last_msg_->signature[60], 60) + << "incorrect value for signature[60], expected 60, is " + << last_msg_->signature[60]; + EXPECT_EQ(last_msg_->signature[61], 61) + << "incorrect value for signature[61], expected 61, is " + << last_msg_->signature[61]; + EXPECT_EQ(last_msg_->signature[62], 62) + << "incorrect value for signature[62], expected 62, is " + << last_msg_->signature[62]; + EXPECT_EQ(last_msg_->signature[63], 63) + << "incorrect value for signature[63], expected 63, is " + << last_msg_->signature[63]; + EXPECT_EQ(last_msg_->signed_messages[0], 5000) + << "incorrect value for signed_messages[0], expected 5000, is " + << last_msg_->signed_messages[0]; + EXPECT_EQ(last_msg_->signed_messages[1], 5234) + << "incorrect value for signed_messages[1], expected 5234, is " + << last_msg_->signed_messages[1]; + EXPECT_EQ(last_msg_->signed_messages[2], 5468) + << "incorrect value for signed_messages[2], expected 5468, is " + << last_msg_->signed_messages[2]; + EXPECT_EQ(last_msg_->signed_messages[3], 5702) + << "incorrect value for signed_messages[3], expected 5702, is " + << last_msg_->signed_messages[3]; + EXPECT_EQ(last_msg_->signed_messages[4], 5936) + << "incorrect value for signed_messages[4], expected 5936, is " + << last_msg_->signed_messages[4]; + EXPECT_EQ(last_msg_->signed_messages[5], 6170) + << "incorrect value for signed_messages[5], expected 6170, is " + << last_msg_->signed_messages[5]; + EXPECT_EQ(last_msg_->signed_messages[6], 6404) + << "incorrect value for signed_messages[6], expected 6404, is " + << last_msg_->signed_messages[6]; + EXPECT_EQ(last_msg_->signed_messages[7], 6638) + << "incorrect value for signed_messages[7], expected 6638, is " + << last_msg_->signed_messages[7]; + EXPECT_EQ(last_msg_->signed_messages[8], 6872) + << "incorrect value for signed_messages[8], expected 6872, is " + << last_msg_->signed_messages[8]; + EXPECT_EQ(last_msg_->signed_messages[9], 7106) + << "incorrect value for signed_messages[9], expected 7106, is " + << last_msg_->signed_messages[9]; + EXPECT_EQ(last_msg_->signed_messages[10], 7340) + << "incorrect value for signed_messages[10], expected 7340, is " + << last_msg_->signed_messages[10]; + EXPECT_EQ(last_msg_->signed_messages[11], 7574) + << "incorrect value for signed_messages[11], expected 7574, is " + << last_msg_->signed_messages[11]; + EXPECT_EQ(last_msg_->signed_messages[12], 7808) + << "incorrect value for signed_messages[12], expected 7808, is " + << last_msg_->signed_messages[12]; + EXPECT_EQ(last_msg_->signed_messages[13], 8042) + << "incorrect value for signed_messages[13], expected 8042, is " + << last_msg_->signed_messages[13]; + EXPECT_EQ(last_msg_->signed_messages[14], 8276) + << "incorrect value for signed_messages[14], expected 8276, is " + << last_msg_->signed_messages[14]; + EXPECT_EQ(last_msg_->signed_messages[15], 8510) + << "incorrect value for signed_messages[15], expected 8510, is " + << last_msg_->signed_messages[15]; + EXPECT_EQ(last_msg_->signed_messages[16], 8744) + << "incorrect value for signed_messages[16], expected 8744, is " + << last_msg_->signed_messages[16]; + EXPECT_EQ(last_msg_->signed_messages[17], 8978) + << "incorrect value for signed_messages[17], expected 8978, is " + << last_msg_->signed_messages[17]; + EXPECT_EQ(last_msg_->signed_messages[18], 9212) + << "incorrect value for signed_messages[18], expected 9212, is " + << last_msg_->signed_messages[18]; + EXPECT_EQ(last_msg_->signed_messages[19], 9446) + << "incorrect value for signed_messages[19], expected 9446, is " + << last_msg_->signed_messages[19]; + EXPECT_EQ(last_msg_->signed_messages[20], 9680) + << "incorrect value for signed_messages[20], expected 9680, is " + << last_msg_->signed_messages[20]; + EXPECT_EQ(last_msg_->signed_messages[21], 9914) + << "incorrect value for signed_messages[21], expected 9914, is " + << last_msg_->signed_messages[21]; + EXPECT_EQ(last_msg_->signed_messages[22], 10148) + << "incorrect value for signed_messages[22], expected 10148, is " + << last_msg_->signed_messages[22]; + EXPECT_EQ(last_msg_->signed_messages[23], 10382) + << "incorrect value for signed_messages[23], expected 10382, is " + << last_msg_->signed_messages[23]; + EXPECT_EQ(last_msg_->signed_messages[24], 10616) + << "incorrect value for signed_messages[24], expected 10616, is " + << last_msg_->signed_messages[24]; + EXPECT_EQ(last_msg_->stream_counter, 1) + << "incorrect value for stream_counter, expected 1, is " + << last_msg_->stream_counter; } diff --git a/c/test/legacy/cpp/auto_check_sbp_solution_meta_MsgSolnMeta.cc b/c/test/legacy/cpp/auto_check_sbp_solution_meta_MsgSolnMeta.cc index 4a27e1006..38b4287fe 100644 --- a/c/test/legacy/cpp/auto_check_sbp_solution_meta_MsgSolnMeta.cc +++ b/c/test/legacy/cpp/auto_check_sbp_solution_meta_MsgSolnMeta.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMeta.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMeta.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_solution_meta_MsgSolnMeta0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_solution_meta_MsgSolnMeta0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_solution_meta_MsgSolnMeta0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_solution_meta_MsgSolnMeta0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_soln_meta_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_soln_meta_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,997 +81,1499 @@ class Test_legacy_auto_check_sbp_solution_meta_MsgSolnMeta0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_soln_meta_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_solution_meta_MsgSolnMeta0, Test) -{ +}; - uint8_t encoded_frame[] = {85,14,255,0,60,254,48,208,65,216,122,45,196,160,144,228,8,83,89,87,3,213,95,109,86,131,71,70,84,73,131,26,82,247,140,97,115,110,118,253,2,122,186,148,122,148,180,231,68,46,190,102,243,48,192,15,208,89,56,10,245,2,254,201,120,32,126,2,83,161,238,123,102,230,76,190,225,182,207,228,7,218,117,89,29,191,56,248,185,255,46,18,72,142,82,113,26,4,172,254,178,136,113,115,58,193,89,227,182,246,76,77,108,245,41,31,70,124,249,145,15,78,228,38,241,129,8,176,251,72,248,80,115,244,231,145,191,190,178,168,89,233,69,176,174,140,182,141,81,82,92,79,101,223,100,64,184,215,124,37,21,227,135,102,72,36,219,56,146,90,219,104,227,102,83,12,41,122,173,94,1,174,134,130,104,237,116,249,107,230,130,123,25,162,57,223,193,174,146,193,239,44,246,197,214,80,83,100,66,72,133,137,140,82,2,2,96,9,96,158,134,97,43,129,141,25,183,200,214,57,248,103,222,65,195,15,244,21,180,46,140,130,36,17,194,209,65,254,115,103,152,129,234,235,194,234,170,201,210,154,150,247, }; +TEST_F(Test_legacy_auto_check_sbp_solution_meta_MsgSolnMeta0, Test) { + uint8_t encoded_frame[] = { + 85, 14, 255, 0, 60, 254, 48, 208, 65, 216, 122, 45, 196, 160, 144, + 228, 8, 83, 89, 87, 3, 213, 95, 109, 86, 131, 71, 70, 84, 73, + 131, 26, 82, 247, 140, 97, 115, 110, 118, 253, 2, 122, 186, 148, 122, + 148, 180, 231, 68, 46, 190, 102, 243, 48, 192, 15, 208, 89, 56, 10, + 245, 2, 254, 201, 120, 32, 126, 2, 83, 161, 238, 123, 102, 230, 76, + 190, 225, 182, 207, 228, 7, 218, 117, 89, 29, 191, 56, 248, 185, 255, + 46, 18, 72, 142, 82, 113, 26, 4, 172, 254, 178, 136, 113, 115, 58, + 193, 89, 227, 182, 246, 76, 77, 108, 245, 41, 31, 70, 124, 249, 145, + 15, 78, 228, 38, 241, 129, 8, 176, 251, 72, 248, 80, 115, 244, 231, + 145, 191, 190, 178, 168, 89, 233, 69, 176, 174, 140, 182, 141, 81, 82, + 92, 79, 101, 223, 100, 64, 184, 215, 124, 37, 21, 227, 135, 102, 72, + 36, 219, 56, 146, 90, 219, 104, 227, 102, 83, 12, 41, 122, 173, 94, + 1, 174, 134, 130, 104, 237, 116, 249, 107, 230, 130, 123, 25, 162, 57, + 223, 193, 174, 146, 193, 239, 44, 246, 197, 214, 80, 83, 100, 66, 72, + 133, 137, 140, 82, 2, 2, 96, 9, 96, 158, 134, 97, 43, 129, 141, + 25, 183, 200, 214, 57, 248, 103, 222, 65, 195, 15, 244, 21, 180, 46, + 140, 130, 36, 17, 194, 209, 65, 254, 115, 103, 152, 129, 234, 235, 194, + 234, 170, 201, 210, 154, 150, 247, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_soln_meta_t* test_msg = ( msg_soln_meta_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->age_corrections = 21256; - test_msg->age_gnss = 3573765977; - test_msg->hdop = 41156; - test_msg->pdop = 11642; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[0].flags = 109; - test_msg->sol_in[0].sensor_type = 95; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[1].flags = 131; - test_msg->sol_in[1].sensor_type = 86; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[2].flags = 70; - test_msg->sol_in[2].sensor_type = 71; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[3].flags = 73; - test_msg->sol_in[3].sensor_type = 84; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[4].flags = 26; - test_msg->sol_in[4].sensor_type = 131; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[5].flags = 247; - test_msg->sol_in[5].sensor_type = 82; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[6].flags = 97; - test_msg->sol_in[6].sensor_type = 140; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[7].flags = 110; - test_msg->sol_in[7].sensor_type = 115; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[8].flags = 253; - test_msg->sol_in[8].sensor_type = 118; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[9].flags = 122; - test_msg->sol_in[9].sensor_type = 2; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[10].flags = 148; - test_msg->sol_in[10].sensor_type = 186; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[11].flags = 148; - test_msg->sol_in[11].sensor_type = 122; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[12].flags = 231; - test_msg->sol_in[12].sensor_type = 180; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[13].flags = 46; - test_msg->sol_in[13].sensor_type = 68; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[14].flags = 102; - test_msg->sol_in[14].sensor_type = 190; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[15].flags = 48; - test_msg->sol_in[15].sensor_type = 243; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[16].flags = 15; - test_msg->sol_in[16].sensor_type = 192; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[17].flags = 89; - test_msg->sol_in[17].sensor_type = 208; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[18].flags = 10; - test_msg->sol_in[18].sensor_type = 56; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[19].flags = 2; - test_msg->sol_in[19].sensor_type = 245; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[20].flags = 201; - test_msg->sol_in[20].sensor_type = 254; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[21].flags = 32; - test_msg->sol_in[21].sensor_type = 120; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[22].flags = 2; - test_msg->sol_in[22].sensor_type = 126; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[23].flags = 161; - test_msg->sol_in[23].sensor_type = 83; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[24].flags = 123; - test_msg->sol_in[24].sensor_type = 238; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[25].flags = 230; - test_msg->sol_in[25].sensor_type = 102; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[26].flags = 190; - test_msg->sol_in[26].sensor_type = 76; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[27].flags = 182; - test_msg->sol_in[27].sensor_type = 225; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[28].flags = 228; - test_msg->sol_in[28].sensor_type = 207; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[29].flags = 218; - test_msg->sol_in[29].sensor_type = 7; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[30].flags = 89; - test_msg->sol_in[30].sensor_type = 117; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[31].flags = 191; - test_msg->sol_in[31].sensor_type = 29; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[32].flags = 248; - test_msg->sol_in[32].sensor_type = 56; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[33].flags = 255; - test_msg->sol_in[33].sensor_type = 185; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[34].flags = 18; - test_msg->sol_in[34].sensor_type = 46; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[35].flags = 142; - test_msg->sol_in[35].sensor_type = 72; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[36].flags = 113; - test_msg->sol_in[36].sensor_type = 82; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[37].flags = 4; - test_msg->sol_in[37].sensor_type = 26; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[38].flags = 254; - test_msg->sol_in[38].sensor_type = 172; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[39].flags = 136; - test_msg->sol_in[39].sensor_type = 178; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[40].flags = 115; - test_msg->sol_in[40].sensor_type = 113; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[41].flags = 193; - test_msg->sol_in[41].sensor_type = 58; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[42].flags = 227; - test_msg->sol_in[42].sensor_type = 89; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[43].flags = 246; - test_msg->sol_in[43].sensor_type = 182; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[44].flags = 77; - test_msg->sol_in[44].sensor_type = 76; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[45].flags = 245; - test_msg->sol_in[45].sensor_type = 108; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[46].flags = 31; - test_msg->sol_in[46].sensor_type = 41; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[47].flags = 124; - test_msg->sol_in[47].sensor_type = 70; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[48].flags = 145; - test_msg->sol_in[48].sensor_type = 249; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[49].flags = 78; - test_msg->sol_in[49].sensor_type = 15; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[50].flags = 38; - test_msg->sol_in[50].sensor_type = 228; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[51].flags = 129; - test_msg->sol_in[51].sensor_type = 241; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[52].flags = 176; - test_msg->sol_in[52].sensor_type = 8; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[53].flags = 72; - test_msg->sol_in[53].sensor_type = 251; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[54].flags = 80; - test_msg->sol_in[54].sensor_type = 248; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[55].flags = 244; - test_msg->sol_in[55].sensor_type = 115; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[56].flags = 145; - test_msg->sol_in[56].sensor_type = 231; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[57].flags = 190; - test_msg->sol_in[57].sensor_type = 191; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[58].flags = 168; - test_msg->sol_in[58].sensor_type = 178; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[59].flags = 233; - test_msg->sol_in[59].sensor_type = 89; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[60].flags = 176; - test_msg->sol_in[60].sensor_type = 69; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[61].flags = 140; - test_msg->sol_in[61].sensor_type = 174; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[62].flags = 141; - test_msg->sol_in[62].sensor_type = 182; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[63].flags = 82; - test_msg->sol_in[63].sensor_type = 81; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[64].flags = 79; - test_msg->sol_in[64].sensor_type = 92; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[65].flags = 223; - test_msg->sol_in[65].sensor_type = 101; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[66].flags = 64; - test_msg->sol_in[66].sensor_type = 100; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[67].flags = 215; - test_msg->sol_in[67].sensor_type = 184; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[68].flags = 37; - test_msg->sol_in[68].sensor_type = 124; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[69].flags = 227; - test_msg->sol_in[69].sensor_type = 21; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[70].flags = 102; - test_msg->sol_in[70].sensor_type = 135; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[71].flags = 36; - test_msg->sol_in[71].sensor_type = 72; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[72].flags = 56; - test_msg->sol_in[72].sensor_type = 219; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[73].flags = 90; - test_msg->sol_in[73].sensor_type = 146; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[74].flags = 104; - test_msg->sol_in[74].sensor_type = 219; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[75].flags = 102; - test_msg->sol_in[75].sensor_type = 227; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[76].flags = 12; - test_msg->sol_in[76].sensor_type = 83; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[77].flags = 122; - test_msg->sol_in[77].sensor_type = 41; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[78].flags = 94; - test_msg->sol_in[78].sensor_type = 173; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[79].flags = 174; - test_msg->sol_in[79].sensor_type = 1; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[80].flags = 130; - test_msg->sol_in[80].sensor_type = 134; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[81].flags = 237; - test_msg->sol_in[81].sensor_type = 104; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[82].flags = 249; - test_msg->sol_in[82].sensor_type = 116; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[83].flags = 230; - test_msg->sol_in[83].sensor_type = 107; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[84].flags = 123; - test_msg->sol_in[84].sensor_type = 130; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[85].flags = 162; - test_msg->sol_in[85].sensor_type = 25; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[86].flags = 223; - test_msg->sol_in[86].sensor_type = 57; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[87].flags = 174; - test_msg->sol_in[87].sensor_type = 193; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[88].flags = 193; - test_msg->sol_in[88].sensor_type = 146; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[89].flags = 44; - test_msg->sol_in[89].sensor_type = 239; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[90].flags = 197; - test_msg->sol_in[90].sensor_type = 246; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[91].flags = 80; - test_msg->sol_in[91].sensor_type = 214; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[92].flags = 100; - test_msg->sol_in[92].sensor_type = 83; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[93].flags = 72; - test_msg->sol_in[93].sensor_type = 66; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[94].flags = 137; - test_msg->sol_in[94].sensor_type = 133; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[95].flags = 82; - test_msg->sol_in[95].sensor_type = 140; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[96].flags = 2; - test_msg->sol_in[96].sensor_type = 2; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[97].flags = 9; - test_msg->sol_in[97].sensor_type = 96; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[98].flags = 158; - test_msg->sol_in[98].sensor_type = 96; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[99].flags = 97; - test_msg->sol_in[99].sensor_type = 134; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[100].flags = 129; - test_msg->sol_in[100].sensor_type = 43; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[101].flags = 25; - test_msg->sol_in[101].sensor_type = 141; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[102].flags = 200; - test_msg->sol_in[102].sensor_type = 183; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[103].flags = 57; - test_msg->sol_in[103].sensor_type = 214; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[104].flags = 103; - test_msg->sol_in[104].sensor_type = 248; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[105].flags = 65; - test_msg->sol_in[105].sensor_type = 222; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[106].flags = 15; - test_msg->sol_in[106].sensor_type = 195; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[107].flags = 21; - test_msg->sol_in[107].sensor_type = 244; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[108].flags = 46; - test_msg->sol_in[108].sensor_type = 180; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[109].flags = 130; - test_msg->sol_in[109].sensor_type = 140; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[110].flags = 17; - test_msg->sol_in[110].sensor_type = 36; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[111].flags = 209; - test_msg->sol_in[111].sensor_type = 194; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[112].flags = 254; - test_msg->sol_in[112].sensor_type = 65; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[113].flags = 103; - test_msg->sol_in[113].sensor_type = 115; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[114].flags = 129; - test_msg->sol_in[114].sensor_type = 152; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[115].flags = 235; - test_msg->sol_in[115].sensor_type = 234; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[116].flags = 234; - test_msg->sol_in[116].sensor_type = 194; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[117].flags = 201; - test_msg->sol_in[117].sensor_type = 170; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[118].flags = 154; - test_msg->sol_in[118].sensor_type = 210; - test_msg->tow = 3628191792; - test_msg->vdop = 58512; - - EXPECT_EQ(send_message( 0xff0e, 15360, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_soln_meta_t *test_msg = (msg_soln_meta_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->age_corrections = 21256; + test_msg->age_gnss = 3573765977; + test_msg->hdop = 41156; + test_msg->pdop = 11642; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[0].flags = 109; + test_msg->sol_in[0].sensor_type = 95; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[1].flags = 131; + test_msg->sol_in[1].sensor_type = 86; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[2].flags = 70; + test_msg->sol_in[2].sensor_type = 71; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[3].flags = 73; + test_msg->sol_in[3].sensor_type = 84; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[4].flags = 26; + test_msg->sol_in[4].sensor_type = 131; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[5].flags = 247; + test_msg->sol_in[5].sensor_type = 82; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[6].flags = 97; + test_msg->sol_in[6].sensor_type = 140; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[7].flags = 110; + test_msg->sol_in[7].sensor_type = 115; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[8].flags = 253; + test_msg->sol_in[8].sensor_type = 118; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[9].flags = 122; + test_msg->sol_in[9].sensor_type = 2; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[10].flags = 148; + test_msg->sol_in[10].sensor_type = 186; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[11].flags = 148; + test_msg->sol_in[11].sensor_type = 122; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[12].flags = 231; + test_msg->sol_in[12].sensor_type = 180; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[13].flags = 46; + test_msg->sol_in[13].sensor_type = 68; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[14].flags = 102; + test_msg->sol_in[14].sensor_type = 190; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[15].flags = 48; + test_msg->sol_in[15].sensor_type = 243; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[16].flags = 15; + test_msg->sol_in[16].sensor_type = 192; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[17].flags = 89; + test_msg->sol_in[17].sensor_type = 208; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[18].flags = 10; + test_msg->sol_in[18].sensor_type = 56; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[19].flags = 2; + test_msg->sol_in[19].sensor_type = 245; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[20].flags = 201; + test_msg->sol_in[20].sensor_type = 254; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[21].flags = 32; + test_msg->sol_in[21].sensor_type = 120; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[22].flags = 2; + test_msg->sol_in[22].sensor_type = 126; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[23].flags = 161; + test_msg->sol_in[23].sensor_type = 83; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[24].flags = 123; + test_msg->sol_in[24].sensor_type = 238; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[25].flags = 230; + test_msg->sol_in[25].sensor_type = 102; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[26].flags = 190; + test_msg->sol_in[26].sensor_type = 76; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[27].flags = 182; + test_msg->sol_in[27].sensor_type = 225; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[28].flags = 228; + test_msg->sol_in[28].sensor_type = 207; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[29].flags = 218; + test_msg->sol_in[29].sensor_type = 7; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[30].flags = 89; + test_msg->sol_in[30].sensor_type = 117; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[31].flags = 191; + test_msg->sol_in[31].sensor_type = 29; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[32].flags = 248; + test_msg->sol_in[32].sensor_type = 56; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[33].flags = 255; + test_msg->sol_in[33].sensor_type = 185; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[34].flags = 18; + test_msg->sol_in[34].sensor_type = 46; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[35].flags = 142; + test_msg->sol_in[35].sensor_type = 72; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[36].flags = 113; + test_msg->sol_in[36].sensor_type = 82; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[37].flags = 4; + test_msg->sol_in[37].sensor_type = 26; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[38].flags = 254; + test_msg->sol_in[38].sensor_type = 172; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[39].flags = 136; + test_msg->sol_in[39].sensor_type = 178; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[40].flags = 115; + test_msg->sol_in[40].sensor_type = 113; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[41].flags = 193; + test_msg->sol_in[41].sensor_type = 58; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[42].flags = 227; + test_msg->sol_in[42].sensor_type = 89; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[43].flags = 246; + test_msg->sol_in[43].sensor_type = 182; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[44].flags = 77; + test_msg->sol_in[44].sensor_type = 76; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[45].flags = 245; + test_msg->sol_in[45].sensor_type = 108; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[46].flags = 31; + test_msg->sol_in[46].sensor_type = 41; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[47].flags = 124; + test_msg->sol_in[47].sensor_type = 70; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[48].flags = 145; + test_msg->sol_in[48].sensor_type = 249; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[49].flags = 78; + test_msg->sol_in[49].sensor_type = 15; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[50].flags = 38; + test_msg->sol_in[50].sensor_type = 228; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[51].flags = 129; + test_msg->sol_in[51].sensor_type = 241; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[52].flags = 176; + test_msg->sol_in[52].sensor_type = 8; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[53].flags = 72; + test_msg->sol_in[53].sensor_type = 251; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[54].flags = 80; + test_msg->sol_in[54].sensor_type = 248; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[55].flags = 244; + test_msg->sol_in[55].sensor_type = 115; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[56].flags = 145; + test_msg->sol_in[56].sensor_type = 231; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[57].flags = 190; + test_msg->sol_in[57].sensor_type = 191; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[58].flags = 168; + test_msg->sol_in[58].sensor_type = 178; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[59].flags = 233; + test_msg->sol_in[59].sensor_type = 89; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[60].flags = 176; + test_msg->sol_in[60].sensor_type = 69; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[61].flags = 140; + test_msg->sol_in[61].sensor_type = 174; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[62].flags = 141; + test_msg->sol_in[62].sensor_type = 182; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[63].flags = 82; + test_msg->sol_in[63].sensor_type = 81; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[64].flags = 79; + test_msg->sol_in[64].sensor_type = 92; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[65].flags = 223; + test_msg->sol_in[65].sensor_type = 101; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[66].flags = 64; + test_msg->sol_in[66].sensor_type = 100; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[67].flags = 215; + test_msg->sol_in[67].sensor_type = 184; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[68].flags = 37; + test_msg->sol_in[68].sensor_type = 124; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[69].flags = 227; + test_msg->sol_in[69].sensor_type = 21; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[70].flags = 102; + test_msg->sol_in[70].sensor_type = 135; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[71].flags = 36; + test_msg->sol_in[71].sensor_type = 72; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[72].flags = 56; + test_msg->sol_in[72].sensor_type = 219; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[73].flags = 90; + test_msg->sol_in[73].sensor_type = 146; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[74].flags = 104; + test_msg->sol_in[74].sensor_type = 219; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[75].flags = 102; + test_msg->sol_in[75].sensor_type = 227; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[76].flags = 12; + test_msg->sol_in[76].sensor_type = 83; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[77].flags = 122; + test_msg->sol_in[77].sensor_type = 41; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[78].flags = 94; + test_msg->sol_in[78].sensor_type = 173; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[79].flags = 174; + test_msg->sol_in[79].sensor_type = 1; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[80].flags = 130; + test_msg->sol_in[80].sensor_type = 134; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[81].flags = 237; + test_msg->sol_in[81].sensor_type = 104; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[82].flags = 249; + test_msg->sol_in[82].sensor_type = 116; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[83].flags = 230; + test_msg->sol_in[83].sensor_type = 107; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[84].flags = 123; + test_msg->sol_in[84].sensor_type = 130; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[85].flags = 162; + test_msg->sol_in[85].sensor_type = 25; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[86].flags = 223; + test_msg->sol_in[86].sensor_type = 57; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[87].flags = 174; + test_msg->sol_in[87].sensor_type = 193; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[88].flags = 193; + test_msg->sol_in[88].sensor_type = 146; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[89].flags = 44; + test_msg->sol_in[89].sensor_type = 239; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[90].flags = 197; + test_msg->sol_in[90].sensor_type = 246; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[91].flags = 80; + test_msg->sol_in[91].sensor_type = 214; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[92].flags = 100; + test_msg->sol_in[92].sensor_type = 83; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[93].flags = 72; + test_msg->sol_in[93].sensor_type = 66; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[94].flags = 137; + test_msg->sol_in[94].sensor_type = 133; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[95].flags = 82; + test_msg->sol_in[95].sensor_type = 140; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[96].flags = 2; + test_msg->sol_in[96].sensor_type = 2; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[97].flags = 9; + test_msg->sol_in[97].sensor_type = 96; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[98].flags = 158; + test_msg->sol_in[98].sensor_type = 96; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[99].flags = 97; + test_msg->sol_in[99].sensor_type = 134; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[100].flags = 129; + test_msg->sol_in[100].sensor_type = 43; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[101].flags = 25; + test_msg->sol_in[101].sensor_type = 141; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[102].flags = 200; + test_msg->sol_in[102].sensor_type = 183; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[103].flags = 57; + test_msg->sol_in[103].sensor_type = 214; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[104].flags = 103; + test_msg->sol_in[104].sensor_type = 248; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[105].flags = 65; + test_msg->sol_in[105].sensor_type = 222; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[106].flags = 15; + test_msg->sol_in[106].sensor_type = 195; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[107].flags = 21; + test_msg->sol_in[107].sensor_type = 244; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[108].flags = 46; + test_msg->sol_in[108].sensor_type = 180; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[109].flags = 130; + test_msg->sol_in[109].sensor_type = 140; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[110].flags = 17; + test_msg->sol_in[110].sensor_type = 36; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[111].flags = 209; + test_msg->sol_in[111].sensor_type = 194; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[112].flags = 254; + test_msg->sol_in[112].sensor_type = 65; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[113].flags = 103; + test_msg->sol_in[113].sensor_type = 115; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[114].flags = 129; + test_msg->sol_in[114].sensor_type = 152; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[115].flags = 235; + test_msg->sol_in[115].sensor_type = 234; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[116].flags = 234; + test_msg->sol_in[116].sensor_type = 194; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[117].flags = 201; + test_msg->sol_in[117].sensor_type = 170; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[118].flags = 154; + test_msg->sol_in[118].sensor_type = 210; + test_msg->tow = 3628191792; + test_msg->vdop = 58512; + + EXPECT_EQ(send_message(0xff0e, 15360, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 15360); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->age_corrections, 21256) << "incorrect value for age_corrections, expected 21256, is " << last_msg_->age_corrections; - EXPECT_EQ(last_msg_->age_gnss, 3573765977) << "incorrect value for age_gnss, expected 3573765977, is " << last_msg_->age_gnss; - EXPECT_EQ(last_msg_->hdop, 41156) << "incorrect value for hdop, expected 41156, is " << last_msg_->hdop; - EXPECT_EQ(last_msg_->pdop, 11642) << "incorrect value for pdop, expected 11642, is " << last_msg_->pdop; - EXPECT_EQ(last_msg_->sol_in[0].flags, 109) << "incorrect value for sol_in[0].flags, expected 109, is " << last_msg_->sol_in[0].flags; - EXPECT_EQ(last_msg_->sol_in[0].sensor_type, 95) << "incorrect value for sol_in[0].sensor_type, expected 95, is " << last_msg_->sol_in[0].sensor_type; - EXPECT_EQ(last_msg_->sol_in[1].flags, 131) << "incorrect value for sol_in[1].flags, expected 131, is " << last_msg_->sol_in[1].flags; - EXPECT_EQ(last_msg_->sol_in[1].sensor_type, 86) << "incorrect value for sol_in[1].sensor_type, expected 86, is " << last_msg_->sol_in[1].sensor_type; - EXPECT_EQ(last_msg_->sol_in[2].flags, 70) << "incorrect value for sol_in[2].flags, expected 70, is " << last_msg_->sol_in[2].flags; - EXPECT_EQ(last_msg_->sol_in[2].sensor_type, 71) << "incorrect value for sol_in[2].sensor_type, expected 71, is " << last_msg_->sol_in[2].sensor_type; - EXPECT_EQ(last_msg_->sol_in[3].flags, 73) << "incorrect value for sol_in[3].flags, expected 73, is " << last_msg_->sol_in[3].flags; - EXPECT_EQ(last_msg_->sol_in[3].sensor_type, 84) << "incorrect value for sol_in[3].sensor_type, expected 84, is " << last_msg_->sol_in[3].sensor_type; - EXPECT_EQ(last_msg_->sol_in[4].flags, 26) << "incorrect value for sol_in[4].flags, expected 26, is " << last_msg_->sol_in[4].flags; - EXPECT_EQ(last_msg_->sol_in[4].sensor_type, 131) << "incorrect value for sol_in[4].sensor_type, expected 131, is " << last_msg_->sol_in[4].sensor_type; - EXPECT_EQ(last_msg_->sol_in[5].flags, 247) << "incorrect value for sol_in[5].flags, expected 247, is " << last_msg_->sol_in[5].flags; - EXPECT_EQ(last_msg_->sol_in[5].sensor_type, 82) << "incorrect value for sol_in[5].sensor_type, expected 82, is " << last_msg_->sol_in[5].sensor_type; - EXPECT_EQ(last_msg_->sol_in[6].flags, 97) << "incorrect value for sol_in[6].flags, expected 97, is " << last_msg_->sol_in[6].flags; - EXPECT_EQ(last_msg_->sol_in[6].sensor_type, 140) << "incorrect value for sol_in[6].sensor_type, expected 140, is " << last_msg_->sol_in[6].sensor_type; - EXPECT_EQ(last_msg_->sol_in[7].flags, 110) << "incorrect value for sol_in[7].flags, expected 110, is " << last_msg_->sol_in[7].flags; - EXPECT_EQ(last_msg_->sol_in[7].sensor_type, 115) << "incorrect value for sol_in[7].sensor_type, expected 115, is " << last_msg_->sol_in[7].sensor_type; - EXPECT_EQ(last_msg_->sol_in[8].flags, 253) << "incorrect value for sol_in[8].flags, expected 253, is " << last_msg_->sol_in[8].flags; - EXPECT_EQ(last_msg_->sol_in[8].sensor_type, 118) << "incorrect value for sol_in[8].sensor_type, expected 118, is " << last_msg_->sol_in[8].sensor_type; - EXPECT_EQ(last_msg_->sol_in[9].flags, 122) << "incorrect value for sol_in[9].flags, expected 122, is " << last_msg_->sol_in[9].flags; - EXPECT_EQ(last_msg_->sol_in[9].sensor_type, 2) << "incorrect value for sol_in[9].sensor_type, expected 2, is " << last_msg_->sol_in[9].sensor_type; - EXPECT_EQ(last_msg_->sol_in[10].flags, 148) << "incorrect value for sol_in[10].flags, expected 148, is " << last_msg_->sol_in[10].flags; - EXPECT_EQ(last_msg_->sol_in[10].sensor_type, 186) << "incorrect value for sol_in[10].sensor_type, expected 186, is " << last_msg_->sol_in[10].sensor_type; - EXPECT_EQ(last_msg_->sol_in[11].flags, 148) << "incorrect value for sol_in[11].flags, expected 148, is " << last_msg_->sol_in[11].flags; - EXPECT_EQ(last_msg_->sol_in[11].sensor_type, 122) << "incorrect value for sol_in[11].sensor_type, expected 122, is " << last_msg_->sol_in[11].sensor_type; - EXPECT_EQ(last_msg_->sol_in[12].flags, 231) << "incorrect value for sol_in[12].flags, expected 231, is " << last_msg_->sol_in[12].flags; - EXPECT_EQ(last_msg_->sol_in[12].sensor_type, 180) << "incorrect value for sol_in[12].sensor_type, expected 180, is " << last_msg_->sol_in[12].sensor_type; - EXPECT_EQ(last_msg_->sol_in[13].flags, 46) << "incorrect value for sol_in[13].flags, expected 46, is " << last_msg_->sol_in[13].flags; - EXPECT_EQ(last_msg_->sol_in[13].sensor_type, 68) << "incorrect value for sol_in[13].sensor_type, expected 68, is " << last_msg_->sol_in[13].sensor_type; - EXPECT_EQ(last_msg_->sol_in[14].flags, 102) << "incorrect value for sol_in[14].flags, expected 102, is " << last_msg_->sol_in[14].flags; - EXPECT_EQ(last_msg_->sol_in[14].sensor_type, 190) << "incorrect value for sol_in[14].sensor_type, expected 190, is " << last_msg_->sol_in[14].sensor_type; - EXPECT_EQ(last_msg_->sol_in[15].flags, 48) << "incorrect value for sol_in[15].flags, expected 48, is " << last_msg_->sol_in[15].flags; - EXPECT_EQ(last_msg_->sol_in[15].sensor_type, 243) << "incorrect value for sol_in[15].sensor_type, expected 243, is " << last_msg_->sol_in[15].sensor_type; - EXPECT_EQ(last_msg_->sol_in[16].flags, 15) << "incorrect value for sol_in[16].flags, expected 15, is " << last_msg_->sol_in[16].flags; - EXPECT_EQ(last_msg_->sol_in[16].sensor_type, 192) << "incorrect value for sol_in[16].sensor_type, expected 192, is " << last_msg_->sol_in[16].sensor_type; - EXPECT_EQ(last_msg_->sol_in[17].flags, 89) << "incorrect value for sol_in[17].flags, expected 89, is " << last_msg_->sol_in[17].flags; - EXPECT_EQ(last_msg_->sol_in[17].sensor_type, 208) << "incorrect value for sol_in[17].sensor_type, expected 208, is " << last_msg_->sol_in[17].sensor_type; - EXPECT_EQ(last_msg_->sol_in[18].flags, 10) << "incorrect value for sol_in[18].flags, expected 10, is " << last_msg_->sol_in[18].flags; - EXPECT_EQ(last_msg_->sol_in[18].sensor_type, 56) << "incorrect value for sol_in[18].sensor_type, expected 56, is " << last_msg_->sol_in[18].sensor_type; - EXPECT_EQ(last_msg_->sol_in[19].flags, 2) << "incorrect value for sol_in[19].flags, expected 2, is " << last_msg_->sol_in[19].flags; - EXPECT_EQ(last_msg_->sol_in[19].sensor_type, 245) << "incorrect value for sol_in[19].sensor_type, expected 245, is " << last_msg_->sol_in[19].sensor_type; - EXPECT_EQ(last_msg_->sol_in[20].flags, 201) << "incorrect value for sol_in[20].flags, expected 201, is " << last_msg_->sol_in[20].flags; - EXPECT_EQ(last_msg_->sol_in[20].sensor_type, 254) << "incorrect value for sol_in[20].sensor_type, expected 254, is " << last_msg_->sol_in[20].sensor_type; - EXPECT_EQ(last_msg_->sol_in[21].flags, 32) << "incorrect value for sol_in[21].flags, expected 32, is " << last_msg_->sol_in[21].flags; - EXPECT_EQ(last_msg_->sol_in[21].sensor_type, 120) << "incorrect value for sol_in[21].sensor_type, expected 120, is " << last_msg_->sol_in[21].sensor_type; - EXPECT_EQ(last_msg_->sol_in[22].flags, 2) << "incorrect value for sol_in[22].flags, expected 2, is " << last_msg_->sol_in[22].flags; - EXPECT_EQ(last_msg_->sol_in[22].sensor_type, 126) << "incorrect value for sol_in[22].sensor_type, expected 126, is " << last_msg_->sol_in[22].sensor_type; - EXPECT_EQ(last_msg_->sol_in[23].flags, 161) << "incorrect value for sol_in[23].flags, expected 161, is " << last_msg_->sol_in[23].flags; - EXPECT_EQ(last_msg_->sol_in[23].sensor_type, 83) << "incorrect value for sol_in[23].sensor_type, expected 83, is " << last_msg_->sol_in[23].sensor_type; - EXPECT_EQ(last_msg_->sol_in[24].flags, 123) << "incorrect value for sol_in[24].flags, expected 123, is " << last_msg_->sol_in[24].flags; - EXPECT_EQ(last_msg_->sol_in[24].sensor_type, 238) << "incorrect value for sol_in[24].sensor_type, expected 238, is " << last_msg_->sol_in[24].sensor_type; - EXPECT_EQ(last_msg_->sol_in[25].flags, 230) << "incorrect value for sol_in[25].flags, expected 230, is " << last_msg_->sol_in[25].flags; - EXPECT_EQ(last_msg_->sol_in[25].sensor_type, 102) << "incorrect value for sol_in[25].sensor_type, expected 102, is " << last_msg_->sol_in[25].sensor_type; - EXPECT_EQ(last_msg_->sol_in[26].flags, 190) << "incorrect value for sol_in[26].flags, expected 190, is " << last_msg_->sol_in[26].flags; - EXPECT_EQ(last_msg_->sol_in[26].sensor_type, 76) << "incorrect value for sol_in[26].sensor_type, expected 76, is " << last_msg_->sol_in[26].sensor_type; - EXPECT_EQ(last_msg_->sol_in[27].flags, 182) << "incorrect value for sol_in[27].flags, expected 182, is " << last_msg_->sol_in[27].flags; - EXPECT_EQ(last_msg_->sol_in[27].sensor_type, 225) << "incorrect value for sol_in[27].sensor_type, expected 225, is " << last_msg_->sol_in[27].sensor_type; - EXPECT_EQ(last_msg_->sol_in[28].flags, 228) << "incorrect value for sol_in[28].flags, expected 228, is " << last_msg_->sol_in[28].flags; - EXPECT_EQ(last_msg_->sol_in[28].sensor_type, 207) << "incorrect value for sol_in[28].sensor_type, expected 207, is " << last_msg_->sol_in[28].sensor_type; - EXPECT_EQ(last_msg_->sol_in[29].flags, 218) << "incorrect value for sol_in[29].flags, expected 218, is " << last_msg_->sol_in[29].flags; - EXPECT_EQ(last_msg_->sol_in[29].sensor_type, 7) << "incorrect value for sol_in[29].sensor_type, expected 7, is " << last_msg_->sol_in[29].sensor_type; - EXPECT_EQ(last_msg_->sol_in[30].flags, 89) << "incorrect value for sol_in[30].flags, expected 89, is " << last_msg_->sol_in[30].flags; - EXPECT_EQ(last_msg_->sol_in[30].sensor_type, 117) << "incorrect value for sol_in[30].sensor_type, expected 117, is " << last_msg_->sol_in[30].sensor_type; - EXPECT_EQ(last_msg_->sol_in[31].flags, 191) << "incorrect value for sol_in[31].flags, expected 191, is " << last_msg_->sol_in[31].flags; - EXPECT_EQ(last_msg_->sol_in[31].sensor_type, 29) << "incorrect value for sol_in[31].sensor_type, expected 29, is " << last_msg_->sol_in[31].sensor_type; - EXPECT_EQ(last_msg_->sol_in[32].flags, 248) << "incorrect value for sol_in[32].flags, expected 248, is " << last_msg_->sol_in[32].flags; - EXPECT_EQ(last_msg_->sol_in[32].sensor_type, 56) << "incorrect value for sol_in[32].sensor_type, expected 56, is " << last_msg_->sol_in[32].sensor_type; - EXPECT_EQ(last_msg_->sol_in[33].flags, 255) << "incorrect value for sol_in[33].flags, expected 255, is " << last_msg_->sol_in[33].flags; - EXPECT_EQ(last_msg_->sol_in[33].sensor_type, 185) << "incorrect value for sol_in[33].sensor_type, expected 185, is " << last_msg_->sol_in[33].sensor_type; - EXPECT_EQ(last_msg_->sol_in[34].flags, 18) << "incorrect value for sol_in[34].flags, expected 18, is " << last_msg_->sol_in[34].flags; - EXPECT_EQ(last_msg_->sol_in[34].sensor_type, 46) << "incorrect value for sol_in[34].sensor_type, expected 46, is " << last_msg_->sol_in[34].sensor_type; - EXPECT_EQ(last_msg_->sol_in[35].flags, 142) << "incorrect value for sol_in[35].flags, expected 142, is " << last_msg_->sol_in[35].flags; - EXPECT_EQ(last_msg_->sol_in[35].sensor_type, 72) << "incorrect value for sol_in[35].sensor_type, expected 72, is " << last_msg_->sol_in[35].sensor_type; - EXPECT_EQ(last_msg_->sol_in[36].flags, 113) << "incorrect value for sol_in[36].flags, expected 113, is " << last_msg_->sol_in[36].flags; - EXPECT_EQ(last_msg_->sol_in[36].sensor_type, 82) << "incorrect value for sol_in[36].sensor_type, expected 82, is " << last_msg_->sol_in[36].sensor_type; - EXPECT_EQ(last_msg_->sol_in[37].flags, 4) << "incorrect value for sol_in[37].flags, expected 4, is " << last_msg_->sol_in[37].flags; - EXPECT_EQ(last_msg_->sol_in[37].sensor_type, 26) << "incorrect value for sol_in[37].sensor_type, expected 26, is " << last_msg_->sol_in[37].sensor_type; - EXPECT_EQ(last_msg_->sol_in[38].flags, 254) << "incorrect value for sol_in[38].flags, expected 254, is " << last_msg_->sol_in[38].flags; - EXPECT_EQ(last_msg_->sol_in[38].sensor_type, 172) << "incorrect value for sol_in[38].sensor_type, expected 172, is " << last_msg_->sol_in[38].sensor_type; - EXPECT_EQ(last_msg_->sol_in[39].flags, 136) << "incorrect value for sol_in[39].flags, expected 136, is " << last_msg_->sol_in[39].flags; - EXPECT_EQ(last_msg_->sol_in[39].sensor_type, 178) << "incorrect value for sol_in[39].sensor_type, expected 178, is " << last_msg_->sol_in[39].sensor_type; - EXPECT_EQ(last_msg_->sol_in[40].flags, 115) << "incorrect value for sol_in[40].flags, expected 115, is " << last_msg_->sol_in[40].flags; - EXPECT_EQ(last_msg_->sol_in[40].sensor_type, 113) << "incorrect value for sol_in[40].sensor_type, expected 113, is " << last_msg_->sol_in[40].sensor_type; - EXPECT_EQ(last_msg_->sol_in[41].flags, 193) << "incorrect value for sol_in[41].flags, expected 193, is " << last_msg_->sol_in[41].flags; - EXPECT_EQ(last_msg_->sol_in[41].sensor_type, 58) << "incorrect value for sol_in[41].sensor_type, expected 58, is " << last_msg_->sol_in[41].sensor_type; - EXPECT_EQ(last_msg_->sol_in[42].flags, 227) << "incorrect value for sol_in[42].flags, expected 227, is " << last_msg_->sol_in[42].flags; - EXPECT_EQ(last_msg_->sol_in[42].sensor_type, 89) << "incorrect value for sol_in[42].sensor_type, expected 89, is " << last_msg_->sol_in[42].sensor_type; - EXPECT_EQ(last_msg_->sol_in[43].flags, 246) << "incorrect value for sol_in[43].flags, expected 246, is " << last_msg_->sol_in[43].flags; - EXPECT_EQ(last_msg_->sol_in[43].sensor_type, 182) << "incorrect value for sol_in[43].sensor_type, expected 182, is " << last_msg_->sol_in[43].sensor_type; - EXPECT_EQ(last_msg_->sol_in[44].flags, 77) << "incorrect value for sol_in[44].flags, expected 77, is " << last_msg_->sol_in[44].flags; - EXPECT_EQ(last_msg_->sol_in[44].sensor_type, 76) << "incorrect value for sol_in[44].sensor_type, expected 76, is " << last_msg_->sol_in[44].sensor_type; - EXPECT_EQ(last_msg_->sol_in[45].flags, 245) << "incorrect value for sol_in[45].flags, expected 245, is " << last_msg_->sol_in[45].flags; - EXPECT_EQ(last_msg_->sol_in[45].sensor_type, 108) << "incorrect value for sol_in[45].sensor_type, expected 108, is " << last_msg_->sol_in[45].sensor_type; - EXPECT_EQ(last_msg_->sol_in[46].flags, 31) << "incorrect value for sol_in[46].flags, expected 31, is " << last_msg_->sol_in[46].flags; - EXPECT_EQ(last_msg_->sol_in[46].sensor_type, 41) << "incorrect value for sol_in[46].sensor_type, expected 41, is " << last_msg_->sol_in[46].sensor_type; - EXPECT_EQ(last_msg_->sol_in[47].flags, 124) << "incorrect value for sol_in[47].flags, expected 124, is " << last_msg_->sol_in[47].flags; - EXPECT_EQ(last_msg_->sol_in[47].sensor_type, 70) << "incorrect value for sol_in[47].sensor_type, expected 70, is " << last_msg_->sol_in[47].sensor_type; - EXPECT_EQ(last_msg_->sol_in[48].flags, 145) << "incorrect value for sol_in[48].flags, expected 145, is " << last_msg_->sol_in[48].flags; - EXPECT_EQ(last_msg_->sol_in[48].sensor_type, 249) << "incorrect value for sol_in[48].sensor_type, expected 249, is " << last_msg_->sol_in[48].sensor_type; - EXPECT_EQ(last_msg_->sol_in[49].flags, 78) << "incorrect value for sol_in[49].flags, expected 78, is " << last_msg_->sol_in[49].flags; - EXPECT_EQ(last_msg_->sol_in[49].sensor_type, 15) << "incorrect value for sol_in[49].sensor_type, expected 15, is " << last_msg_->sol_in[49].sensor_type; - EXPECT_EQ(last_msg_->sol_in[50].flags, 38) << "incorrect value for sol_in[50].flags, expected 38, is " << last_msg_->sol_in[50].flags; - EXPECT_EQ(last_msg_->sol_in[50].sensor_type, 228) << "incorrect value for sol_in[50].sensor_type, expected 228, is " << last_msg_->sol_in[50].sensor_type; - EXPECT_EQ(last_msg_->sol_in[51].flags, 129) << "incorrect value for sol_in[51].flags, expected 129, is " << last_msg_->sol_in[51].flags; - EXPECT_EQ(last_msg_->sol_in[51].sensor_type, 241) << "incorrect value for sol_in[51].sensor_type, expected 241, is " << last_msg_->sol_in[51].sensor_type; - EXPECT_EQ(last_msg_->sol_in[52].flags, 176) << "incorrect value for sol_in[52].flags, expected 176, is " << last_msg_->sol_in[52].flags; - EXPECT_EQ(last_msg_->sol_in[52].sensor_type, 8) << "incorrect value for sol_in[52].sensor_type, expected 8, is " << last_msg_->sol_in[52].sensor_type; - EXPECT_EQ(last_msg_->sol_in[53].flags, 72) << "incorrect value for sol_in[53].flags, expected 72, is " << last_msg_->sol_in[53].flags; - EXPECT_EQ(last_msg_->sol_in[53].sensor_type, 251) << "incorrect value for sol_in[53].sensor_type, expected 251, is " << last_msg_->sol_in[53].sensor_type; - EXPECT_EQ(last_msg_->sol_in[54].flags, 80) << "incorrect value for sol_in[54].flags, expected 80, is " << last_msg_->sol_in[54].flags; - EXPECT_EQ(last_msg_->sol_in[54].sensor_type, 248) << "incorrect value for sol_in[54].sensor_type, expected 248, is " << last_msg_->sol_in[54].sensor_type; - EXPECT_EQ(last_msg_->sol_in[55].flags, 244) << "incorrect value for sol_in[55].flags, expected 244, is " << last_msg_->sol_in[55].flags; - EXPECT_EQ(last_msg_->sol_in[55].sensor_type, 115) << "incorrect value for sol_in[55].sensor_type, expected 115, is " << last_msg_->sol_in[55].sensor_type; - EXPECT_EQ(last_msg_->sol_in[56].flags, 145) << "incorrect value for sol_in[56].flags, expected 145, is " << last_msg_->sol_in[56].flags; - EXPECT_EQ(last_msg_->sol_in[56].sensor_type, 231) << "incorrect value for sol_in[56].sensor_type, expected 231, is " << last_msg_->sol_in[56].sensor_type; - EXPECT_EQ(last_msg_->sol_in[57].flags, 190) << "incorrect value for sol_in[57].flags, expected 190, is " << last_msg_->sol_in[57].flags; - EXPECT_EQ(last_msg_->sol_in[57].sensor_type, 191) << "incorrect value for sol_in[57].sensor_type, expected 191, is " << last_msg_->sol_in[57].sensor_type; - EXPECT_EQ(last_msg_->sol_in[58].flags, 168) << "incorrect value for sol_in[58].flags, expected 168, is " << last_msg_->sol_in[58].flags; - EXPECT_EQ(last_msg_->sol_in[58].sensor_type, 178) << "incorrect value for sol_in[58].sensor_type, expected 178, is " << last_msg_->sol_in[58].sensor_type; - EXPECT_EQ(last_msg_->sol_in[59].flags, 233) << "incorrect value for sol_in[59].flags, expected 233, is " << last_msg_->sol_in[59].flags; - EXPECT_EQ(last_msg_->sol_in[59].sensor_type, 89) << "incorrect value for sol_in[59].sensor_type, expected 89, is " << last_msg_->sol_in[59].sensor_type; - EXPECT_EQ(last_msg_->sol_in[60].flags, 176) << "incorrect value for sol_in[60].flags, expected 176, is " << last_msg_->sol_in[60].flags; - EXPECT_EQ(last_msg_->sol_in[60].sensor_type, 69) << "incorrect value for sol_in[60].sensor_type, expected 69, is " << last_msg_->sol_in[60].sensor_type; - EXPECT_EQ(last_msg_->sol_in[61].flags, 140) << "incorrect value for sol_in[61].flags, expected 140, is " << last_msg_->sol_in[61].flags; - EXPECT_EQ(last_msg_->sol_in[61].sensor_type, 174) << "incorrect value for sol_in[61].sensor_type, expected 174, is " << last_msg_->sol_in[61].sensor_type; - EXPECT_EQ(last_msg_->sol_in[62].flags, 141) << "incorrect value for sol_in[62].flags, expected 141, is " << last_msg_->sol_in[62].flags; - EXPECT_EQ(last_msg_->sol_in[62].sensor_type, 182) << "incorrect value for sol_in[62].sensor_type, expected 182, is " << last_msg_->sol_in[62].sensor_type; - EXPECT_EQ(last_msg_->sol_in[63].flags, 82) << "incorrect value for sol_in[63].flags, expected 82, is " << last_msg_->sol_in[63].flags; - EXPECT_EQ(last_msg_->sol_in[63].sensor_type, 81) << "incorrect value for sol_in[63].sensor_type, expected 81, is " << last_msg_->sol_in[63].sensor_type; - EXPECT_EQ(last_msg_->sol_in[64].flags, 79) << "incorrect value for sol_in[64].flags, expected 79, is " << last_msg_->sol_in[64].flags; - EXPECT_EQ(last_msg_->sol_in[64].sensor_type, 92) << "incorrect value for sol_in[64].sensor_type, expected 92, is " << last_msg_->sol_in[64].sensor_type; - EXPECT_EQ(last_msg_->sol_in[65].flags, 223) << "incorrect value for sol_in[65].flags, expected 223, is " << last_msg_->sol_in[65].flags; - EXPECT_EQ(last_msg_->sol_in[65].sensor_type, 101) << "incorrect value for sol_in[65].sensor_type, expected 101, is " << last_msg_->sol_in[65].sensor_type; - EXPECT_EQ(last_msg_->sol_in[66].flags, 64) << "incorrect value for sol_in[66].flags, expected 64, is " << last_msg_->sol_in[66].flags; - EXPECT_EQ(last_msg_->sol_in[66].sensor_type, 100) << "incorrect value for sol_in[66].sensor_type, expected 100, is " << last_msg_->sol_in[66].sensor_type; - EXPECT_EQ(last_msg_->sol_in[67].flags, 215) << "incorrect value for sol_in[67].flags, expected 215, is " << last_msg_->sol_in[67].flags; - EXPECT_EQ(last_msg_->sol_in[67].sensor_type, 184) << "incorrect value for sol_in[67].sensor_type, expected 184, is " << last_msg_->sol_in[67].sensor_type; - EXPECT_EQ(last_msg_->sol_in[68].flags, 37) << "incorrect value for sol_in[68].flags, expected 37, is " << last_msg_->sol_in[68].flags; - EXPECT_EQ(last_msg_->sol_in[68].sensor_type, 124) << "incorrect value for sol_in[68].sensor_type, expected 124, is " << last_msg_->sol_in[68].sensor_type; - EXPECT_EQ(last_msg_->sol_in[69].flags, 227) << "incorrect value for sol_in[69].flags, expected 227, is " << last_msg_->sol_in[69].flags; - EXPECT_EQ(last_msg_->sol_in[69].sensor_type, 21) << "incorrect value for sol_in[69].sensor_type, expected 21, is " << last_msg_->sol_in[69].sensor_type; - EXPECT_EQ(last_msg_->sol_in[70].flags, 102) << "incorrect value for sol_in[70].flags, expected 102, is " << last_msg_->sol_in[70].flags; - EXPECT_EQ(last_msg_->sol_in[70].sensor_type, 135) << "incorrect value for sol_in[70].sensor_type, expected 135, is " << last_msg_->sol_in[70].sensor_type; - EXPECT_EQ(last_msg_->sol_in[71].flags, 36) << "incorrect value for sol_in[71].flags, expected 36, is " << last_msg_->sol_in[71].flags; - EXPECT_EQ(last_msg_->sol_in[71].sensor_type, 72) << "incorrect value for sol_in[71].sensor_type, expected 72, is " << last_msg_->sol_in[71].sensor_type; - EXPECT_EQ(last_msg_->sol_in[72].flags, 56) << "incorrect value for sol_in[72].flags, expected 56, is " << last_msg_->sol_in[72].flags; - EXPECT_EQ(last_msg_->sol_in[72].sensor_type, 219) << "incorrect value for sol_in[72].sensor_type, expected 219, is " << last_msg_->sol_in[72].sensor_type; - EXPECT_EQ(last_msg_->sol_in[73].flags, 90) << "incorrect value for sol_in[73].flags, expected 90, is " << last_msg_->sol_in[73].flags; - EXPECT_EQ(last_msg_->sol_in[73].sensor_type, 146) << "incorrect value for sol_in[73].sensor_type, expected 146, is " << last_msg_->sol_in[73].sensor_type; - EXPECT_EQ(last_msg_->sol_in[74].flags, 104) << "incorrect value for sol_in[74].flags, expected 104, is " << last_msg_->sol_in[74].flags; - EXPECT_EQ(last_msg_->sol_in[74].sensor_type, 219) << "incorrect value for sol_in[74].sensor_type, expected 219, is " << last_msg_->sol_in[74].sensor_type; - EXPECT_EQ(last_msg_->sol_in[75].flags, 102) << "incorrect value for sol_in[75].flags, expected 102, is " << last_msg_->sol_in[75].flags; - EXPECT_EQ(last_msg_->sol_in[75].sensor_type, 227) << "incorrect value for sol_in[75].sensor_type, expected 227, is " << last_msg_->sol_in[75].sensor_type; - EXPECT_EQ(last_msg_->sol_in[76].flags, 12) << "incorrect value for sol_in[76].flags, expected 12, is " << last_msg_->sol_in[76].flags; - EXPECT_EQ(last_msg_->sol_in[76].sensor_type, 83) << "incorrect value for sol_in[76].sensor_type, expected 83, is " << last_msg_->sol_in[76].sensor_type; - EXPECT_EQ(last_msg_->sol_in[77].flags, 122) << "incorrect value for sol_in[77].flags, expected 122, is " << last_msg_->sol_in[77].flags; - EXPECT_EQ(last_msg_->sol_in[77].sensor_type, 41) << "incorrect value for sol_in[77].sensor_type, expected 41, is " << last_msg_->sol_in[77].sensor_type; - EXPECT_EQ(last_msg_->sol_in[78].flags, 94) << "incorrect value for sol_in[78].flags, expected 94, is " << last_msg_->sol_in[78].flags; - EXPECT_EQ(last_msg_->sol_in[78].sensor_type, 173) << "incorrect value for sol_in[78].sensor_type, expected 173, is " << last_msg_->sol_in[78].sensor_type; - EXPECT_EQ(last_msg_->sol_in[79].flags, 174) << "incorrect value for sol_in[79].flags, expected 174, is " << last_msg_->sol_in[79].flags; - EXPECT_EQ(last_msg_->sol_in[79].sensor_type, 1) << "incorrect value for sol_in[79].sensor_type, expected 1, is " << last_msg_->sol_in[79].sensor_type; - EXPECT_EQ(last_msg_->sol_in[80].flags, 130) << "incorrect value for sol_in[80].flags, expected 130, is " << last_msg_->sol_in[80].flags; - EXPECT_EQ(last_msg_->sol_in[80].sensor_type, 134) << "incorrect value for sol_in[80].sensor_type, expected 134, is " << last_msg_->sol_in[80].sensor_type; - EXPECT_EQ(last_msg_->sol_in[81].flags, 237) << "incorrect value for sol_in[81].flags, expected 237, is " << last_msg_->sol_in[81].flags; - EXPECT_EQ(last_msg_->sol_in[81].sensor_type, 104) << "incorrect value for sol_in[81].sensor_type, expected 104, is " << last_msg_->sol_in[81].sensor_type; - EXPECT_EQ(last_msg_->sol_in[82].flags, 249) << "incorrect value for sol_in[82].flags, expected 249, is " << last_msg_->sol_in[82].flags; - EXPECT_EQ(last_msg_->sol_in[82].sensor_type, 116) << "incorrect value for sol_in[82].sensor_type, expected 116, is " << last_msg_->sol_in[82].sensor_type; - EXPECT_EQ(last_msg_->sol_in[83].flags, 230) << "incorrect value for sol_in[83].flags, expected 230, is " << last_msg_->sol_in[83].flags; - EXPECT_EQ(last_msg_->sol_in[83].sensor_type, 107) << "incorrect value for sol_in[83].sensor_type, expected 107, is " << last_msg_->sol_in[83].sensor_type; - EXPECT_EQ(last_msg_->sol_in[84].flags, 123) << "incorrect value for sol_in[84].flags, expected 123, is " << last_msg_->sol_in[84].flags; - EXPECT_EQ(last_msg_->sol_in[84].sensor_type, 130) << "incorrect value for sol_in[84].sensor_type, expected 130, is " << last_msg_->sol_in[84].sensor_type; - EXPECT_EQ(last_msg_->sol_in[85].flags, 162) << "incorrect value for sol_in[85].flags, expected 162, is " << last_msg_->sol_in[85].flags; - EXPECT_EQ(last_msg_->sol_in[85].sensor_type, 25) << "incorrect value for sol_in[85].sensor_type, expected 25, is " << last_msg_->sol_in[85].sensor_type; - EXPECT_EQ(last_msg_->sol_in[86].flags, 223) << "incorrect value for sol_in[86].flags, expected 223, is " << last_msg_->sol_in[86].flags; - EXPECT_EQ(last_msg_->sol_in[86].sensor_type, 57) << "incorrect value for sol_in[86].sensor_type, expected 57, is " << last_msg_->sol_in[86].sensor_type; - EXPECT_EQ(last_msg_->sol_in[87].flags, 174) << "incorrect value for sol_in[87].flags, expected 174, is " << last_msg_->sol_in[87].flags; - EXPECT_EQ(last_msg_->sol_in[87].sensor_type, 193) << "incorrect value for sol_in[87].sensor_type, expected 193, is " << last_msg_->sol_in[87].sensor_type; - EXPECT_EQ(last_msg_->sol_in[88].flags, 193) << "incorrect value for sol_in[88].flags, expected 193, is " << last_msg_->sol_in[88].flags; - EXPECT_EQ(last_msg_->sol_in[88].sensor_type, 146) << "incorrect value for sol_in[88].sensor_type, expected 146, is " << last_msg_->sol_in[88].sensor_type; - EXPECT_EQ(last_msg_->sol_in[89].flags, 44) << "incorrect value for sol_in[89].flags, expected 44, is " << last_msg_->sol_in[89].flags; - EXPECT_EQ(last_msg_->sol_in[89].sensor_type, 239) << "incorrect value for sol_in[89].sensor_type, expected 239, is " << last_msg_->sol_in[89].sensor_type; - EXPECT_EQ(last_msg_->sol_in[90].flags, 197) << "incorrect value for sol_in[90].flags, expected 197, is " << last_msg_->sol_in[90].flags; - EXPECT_EQ(last_msg_->sol_in[90].sensor_type, 246) << "incorrect value for sol_in[90].sensor_type, expected 246, is " << last_msg_->sol_in[90].sensor_type; - EXPECT_EQ(last_msg_->sol_in[91].flags, 80) << "incorrect value for sol_in[91].flags, expected 80, is " << last_msg_->sol_in[91].flags; - EXPECT_EQ(last_msg_->sol_in[91].sensor_type, 214) << "incorrect value for sol_in[91].sensor_type, expected 214, is " << last_msg_->sol_in[91].sensor_type; - EXPECT_EQ(last_msg_->sol_in[92].flags, 100) << "incorrect value for sol_in[92].flags, expected 100, is " << last_msg_->sol_in[92].flags; - EXPECT_EQ(last_msg_->sol_in[92].sensor_type, 83) << "incorrect value for sol_in[92].sensor_type, expected 83, is " << last_msg_->sol_in[92].sensor_type; - EXPECT_EQ(last_msg_->sol_in[93].flags, 72) << "incorrect value for sol_in[93].flags, expected 72, is " << last_msg_->sol_in[93].flags; - EXPECT_EQ(last_msg_->sol_in[93].sensor_type, 66) << "incorrect value for sol_in[93].sensor_type, expected 66, is " << last_msg_->sol_in[93].sensor_type; - EXPECT_EQ(last_msg_->sol_in[94].flags, 137) << "incorrect value for sol_in[94].flags, expected 137, is " << last_msg_->sol_in[94].flags; - EXPECT_EQ(last_msg_->sol_in[94].sensor_type, 133) << "incorrect value for sol_in[94].sensor_type, expected 133, is " << last_msg_->sol_in[94].sensor_type; - EXPECT_EQ(last_msg_->sol_in[95].flags, 82) << "incorrect value for sol_in[95].flags, expected 82, is " << last_msg_->sol_in[95].flags; - EXPECT_EQ(last_msg_->sol_in[95].sensor_type, 140) << "incorrect value for sol_in[95].sensor_type, expected 140, is " << last_msg_->sol_in[95].sensor_type; - EXPECT_EQ(last_msg_->sol_in[96].flags, 2) << "incorrect value for sol_in[96].flags, expected 2, is " << last_msg_->sol_in[96].flags; - EXPECT_EQ(last_msg_->sol_in[96].sensor_type, 2) << "incorrect value for sol_in[96].sensor_type, expected 2, is " << last_msg_->sol_in[96].sensor_type; - EXPECT_EQ(last_msg_->sol_in[97].flags, 9) << "incorrect value for sol_in[97].flags, expected 9, is " << last_msg_->sol_in[97].flags; - EXPECT_EQ(last_msg_->sol_in[97].sensor_type, 96) << "incorrect value for sol_in[97].sensor_type, expected 96, is " << last_msg_->sol_in[97].sensor_type; - EXPECT_EQ(last_msg_->sol_in[98].flags, 158) << "incorrect value for sol_in[98].flags, expected 158, is " << last_msg_->sol_in[98].flags; - EXPECT_EQ(last_msg_->sol_in[98].sensor_type, 96) << "incorrect value for sol_in[98].sensor_type, expected 96, is " << last_msg_->sol_in[98].sensor_type; - EXPECT_EQ(last_msg_->sol_in[99].flags, 97) << "incorrect value for sol_in[99].flags, expected 97, is " << last_msg_->sol_in[99].flags; - EXPECT_EQ(last_msg_->sol_in[99].sensor_type, 134) << "incorrect value for sol_in[99].sensor_type, expected 134, is " << last_msg_->sol_in[99].sensor_type; - EXPECT_EQ(last_msg_->sol_in[100].flags, 129) << "incorrect value for sol_in[100].flags, expected 129, is " << last_msg_->sol_in[100].flags; - EXPECT_EQ(last_msg_->sol_in[100].sensor_type, 43) << "incorrect value for sol_in[100].sensor_type, expected 43, is " << last_msg_->sol_in[100].sensor_type; - EXPECT_EQ(last_msg_->sol_in[101].flags, 25) << "incorrect value for sol_in[101].flags, expected 25, is " << last_msg_->sol_in[101].flags; - EXPECT_EQ(last_msg_->sol_in[101].sensor_type, 141) << "incorrect value for sol_in[101].sensor_type, expected 141, is " << last_msg_->sol_in[101].sensor_type; - EXPECT_EQ(last_msg_->sol_in[102].flags, 200) << "incorrect value for sol_in[102].flags, expected 200, is " << last_msg_->sol_in[102].flags; - EXPECT_EQ(last_msg_->sol_in[102].sensor_type, 183) << "incorrect value for sol_in[102].sensor_type, expected 183, is " << last_msg_->sol_in[102].sensor_type; - EXPECT_EQ(last_msg_->sol_in[103].flags, 57) << "incorrect value for sol_in[103].flags, expected 57, is " << last_msg_->sol_in[103].flags; - EXPECT_EQ(last_msg_->sol_in[103].sensor_type, 214) << "incorrect value for sol_in[103].sensor_type, expected 214, is " << last_msg_->sol_in[103].sensor_type; - EXPECT_EQ(last_msg_->sol_in[104].flags, 103) << "incorrect value for sol_in[104].flags, expected 103, is " << last_msg_->sol_in[104].flags; - EXPECT_EQ(last_msg_->sol_in[104].sensor_type, 248) << "incorrect value for sol_in[104].sensor_type, expected 248, is " << last_msg_->sol_in[104].sensor_type; - EXPECT_EQ(last_msg_->sol_in[105].flags, 65) << "incorrect value for sol_in[105].flags, expected 65, is " << last_msg_->sol_in[105].flags; - EXPECT_EQ(last_msg_->sol_in[105].sensor_type, 222) << "incorrect value for sol_in[105].sensor_type, expected 222, is " << last_msg_->sol_in[105].sensor_type; - EXPECT_EQ(last_msg_->sol_in[106].flags, 15) << "incorrect value for sol_in[106].flags, expected 15, is " << last_msg_->sol_in[106].flags; - EXPECT_EQ(last_msg_->sol_in[106].sensor_type, 195) << "incorrect value for sol_in[106].sensor_type, expected 195, is " << last_msg_->sol_in[106].sensor_type; - EXPECT_EQ(last_msg_->sol_in[107].flags, 21) << "incorrect value for sol_in[107].flags, expected 21, is " << last_msg_->sol_in[107].flags; - EXPECT_EQ(last_msg_->sol_in[107].sensor_type, 244) << "incorrect value for sol_in[107].sensor_type, expected 244, is " << last_msg_->sol_in[107].sensor_type; - EXPECT_EQ(last_msg_->sol_in[108].flags, 46) << "incorrect value for sol_in[108].flags, expected 46, is " << last_msg_->sol_in[108].flags; - EXPECT_EQ(last_msg_->sol_in[108].sensor_type, 180) << "incorrect value for sol_in[108].sensor_type, expected 180, is " << last_msg_->sol_in[108].sensor_type; - EXPECT_EQ(last_msg_->sol_in[109].flags, 130) << "incorrect value for sol_in[109].flags, expected 130, is " << last_msg_->sol_in[109].flags; - EXPECT_EQ(last_msg_->sol_in[109].sensor_type, 140) << "incorrect value for sol_in[109].sensor_type, expected 140, is " << last_msg_->sol_in[109].sensor_type; - EXPECT_EQ(last_msg_->sol_in[110].flags, 17) << "incorrect value for sol_in[110].flags, expected 17, is " << last_msg_->sol_in[110].flags; - EXPECT_EQ(last_msg_->sol_in[110].sensor_type, 36) << "incorrect value for sol_in[110].sensor_type, expected 36, is " << last_msg_->sol_in[110].sensor_type; - EXPECT_EQ(last_msg_->sol_in[111].flags, 209) << "incorrect value for sol_in[111].flags, expected 209, is " << last_msg_->sol_in[111].flags; - EXPECT_EQ(last_msg_->sol_in[111].sensor_type, 194) << "incorrect value for sol_in[111].sensor_type, expected 194, is " << last_msg_->sol_in[111].sensor_type; - EXPECT_EQ(last_msg_->sol_in[112].flags, 254) << "incorrect value for sol_in[112].flags, expected 254, is " << last_msg_->sol_in[112].flags; - EXPECT_EQ(last_msg_->sol_in[112].sensor_type, 65) << "incorrect value for sol_in[112].sensor_type, expected 65, is " << last_msg_->sol_in[112].sensor_type; - EXPECT_EQ(last_msg_->sol_in[113].flags, 103) << "incorrect value for sol_in[113].flags, expected 103, is " << last_msg_->sol_in[113].flags; - EXPECT_EQ(last_msg_->sol_in[113].sensor_type, 115) << "incorrect value for sol_in[113].sensor_type, expected 115, is " << last_msg_->sol_in[113].sensor_type; - EXPECT_EQ(last_msg_->sol_in[114].flags, 129) << "incorrect value for sol_in[114].flags, expected 129, is " << last_msg_->sol_in[114].flags; - EXPECT_EQ(last_msg_->sol_in[114].sensor_type, 152) << "incorrect value for sol_in[114].sensor_type, expected 152, is " << last_msg_->sol_in[114].sensor_type; - EXPECT_EQ(last_msg_->sol_in[115].flags, 235) << "incorrect value for sol_in[115].flags, expected 235, is " << last_msg_->sol_in[115].flags; - EXPECT_EQ(last_msg_->sol_in[115].sensor_type, 234) << "incorrect value for sol_in[115].sensor_type, expected 234, is " << last_msg_->sol_in[115].sensor_type; - EXPECT_EQ(last_msg_->sol_in[116].flags, 234) << "incorrect value for sol_in[116].flags, expected 234, is " << last_msg_->sol_in[116].flags; - EXPECT_EQ(last_msg_->sol_in[116].sensor_type, 194) << "incorrect value for sol_in[116].sensor_type, expected 194, is " << last_msg_->sol_in[116].sensor_type; - EXPECT_EQ(last_msg_->sol_in[117].flags, 201) << "incorrect value for sol_in[117].flags, expected 201, is " << last_msg_->sol_in[117].flags; - EXPECT_EQ(last_msg_->sol_in[117].sensor_type, 170) << "incorrect value for sol_in[117].sensor_type, expected 170, is " << last_msg_->sol_in[117].sensor_type; - EXPECT_EQ(last_msg_->sol_in[118].flags, 154) << "incorrect value for sol_in[118].flags, expected 154, is " << last_msg_->sol_in[118].flags; - EXPECT_EQ(last_msg_->sol_in[118].sensor_type, 210) << "incorrect value for sol_in[118].sensor_type, expected 210, is " << last_msg_->sol_in[118].sensor_type; - EXPECT_EQ(last_msg_->tow, 3628191792) << "incorrect value for tow, expected 3628191792, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->vdop, 58512) << "incorrect value for vdop, expected 58512, is " << last_msg_->vdop; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 15360); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->age_corrections, 21256) + << "incorrect value for age_corrections, expected 21256, is " + << last_msg_->age_corrections; + EXPECT_EQ(last_msg_->age_gnss, 3573765977) + << "incorrect value for age_gnss, expected 3573765977, is " + << last_msg_->age_gnss; + EXPECT_EQ(last_msg_->hdop, 41156) + << "incorrect value for hdop, expected 41156, is " << last_msg_->hdop; + EXPECT_EQ(last_msg_->pdop, 11642) + << "incorrect value for pdop, expected 11642, is " << last_msg_->pdop; + EXPECT_EQ(last_msg_->sol_in[0].flags, 109) + << "incorrect value for sol_in[0].flags, expected 109, is " + << last_msg_->sol_in[0].flags; + EXPECT_EQ(last_msg_->sol_in[0].sensor_type, 95) + << "incorrect value for sol_in[0].sensor_type, expected 95, is " + << last_msg_->sol_in[0].sensor_type; + EXPECT_EQ(last_msg_->sol_in[1].flags, 131) + << "incorrect value for sol_in[1].flags, expected 131, is " + << last_msg_->sol_in[1].flags; + EXPECT_EQ(last_msg_->sol_in[1].sensor_type, 86) + << "incorrect value for sol_in[1].sensor_type, expected 86, is " + << last_msg_->sol_in[1].sensor_type; + EXPECT_EQ(last_msg_->sol_in[2].flags, 70) + << "incorrect value for sol_in[2].flags, expected 70, is " + << last_msg_->sol_in[2].flags; + EXPECT_EQ(last_msg_->sol_in[2].sensor_type, 71) + << "incorrect value for sol_in[2].sensor_type, expected 71, is " + << last_msg_->sol_in[2].sensor_type; + EXPECT_EQ(last_msg_->sol_in[3].flags, 73) + << "incorrect value for sol_in[3].flags, expected 73, is " + << last_msg_->sol_in[3].flags; + EXPECT_EQ(last_msg_->sol_in[3].sensor_type, 84) + << "incorrect value for sol_in[3].sensor_type, expected 84, is " + << last_msg_->sol_in[3].sensor_type; + EXPECT_EQ(last_msg_->sol_in[4].flags, 26) + << "incorrect value for sol_in[4].flags, expected 26, is " + << last_msg_->sol_in[4].flags; + EXPECT_EQ(last_msg_->sol_in[4].sensor_type, 131) + << "incorrect value for sol_in[4].sensor_type, expected 131, is " + << last_msg_->sol_in[4].sensor_type; + EXPECT_EQ(last_msg_->sol_in[5].flags, 247) + << "incorrect value for sol_in[5].flags, expected 247, is " + << last_msg_->sol_in[5].flags; + EXPECT_EQ(last_msg_->sol_in[5].sensor_type, 82) + << "incorrect value for sol_in[5].sensor_type, expected 82, is " + << last_msg_->sol_in[5].sensor_type; + EXPECT_EQ(last_msg_->sol_in[6].flags, 97) + << "incorrect value for sol_in[6].flags, expected 97, is " + << last_msg_->sol_in[6].flags; + EXPECT_EQ(last_msg_->sol_in[6].sensor_type, 140) + << "incorrect value for sol_in[6].sensor_type, expected 140, is " + << last_msg_->sol_in[6].sensor_type; + EXPECT_EQ(last_msg_->sol_in[7].flags, 110) + << "incorrect value for sol_in[7].flags, expected 110, is " + << last_msg_->sol_in[7].flags; + EXPECT_EQ(last_msg_->sol_in[7].sensor_type, 115) + << "incorrect value for sol_in[7].sensor_type, expected 115, is " + << last_msg_->sol_in[7].sensor_type; + EXPECT_EQ(last_msg_->sol_in[8].flags, 253) + << "incorrect value for sol_in[8].flags, expected 253, is " + << last_msg_->sol_in[8].flags; + EXPECT_EQ(last_msg_->sol_in[8].sensor_type, 118) + << "incorrect value for sol_in[8].sensor_type, expected 118, is " + << last_msg_->sol_in[8].sensor_type; + EXPECT_EQ(last_msg_->sol_in[9].flags, 122) + << "incorrect value for sol_in[9].flags, expected 122, is " + << last_msg_->sol_in[9].flags; + EXPECT_EQ(last_msg_->sol_in[9].sensor_type, 2) + << "incorrect value for sol_in[9].sensor_type, expected 2, is " + << last_msg_->sol_in[9].sensor_type; + EXPECT_EQ(last_msg_->sol_in[10].flags, 148) + << "incorrect value for sol_in[10].flags, expected 148, is " + << last_msg_->sol_in[10].flags; + EXPECT_EQ(last_msg_->sol_in[10].sensor_type, 186) + << "incorrect value for sol_in[10].sensor_type, expected 186, is " + << last_msg_->sol_in[10].sensor_type; + EXPECT_EQ(last_msg_->sol_in[11].flags, 148) + << "incorrect value for sol_in[11].flags, expected 148, is " + << last_msg_->sol_in[11].flags; + EXPECT_EQ(last_msg_->sol_in[11].sensor_type, 122) + << "incorrect value for sol_in[11].sensor_type, expected 122, is " + << last_msg_->sol_in[11].sensor_type; + EXPECT_EQ(last_msg_->sol_in[12].flags, 231) + << "incorrect value for sol_in[12].flags, expected 231, is " + << last_msg_->sol_in[12].flags; + EXPECT_EQ(last_msg_->sol_in[12].sensor_type, 180) + << "incorrect value for sol_in[12].sensor_type, expected 180, is " + << last_msg_->sol_in[12].sensor_type; + EXPECT_EQ(last_msg_->sol_in[13].flags, 46) + << "incorrect value for sol_in[13].flags, expected 46, is " + << last_msg_->sol_in[13].flags; + EXPECT_EQ(last_msg_->sol_in[13].sensor_type, 68) + << "incorrect value for sol_in[13].sensor_type, expected 68, is " + << last_msg_->sol_in[13].sensor_type; + EXPECT_EQ(last_msg_->sol_in[14].flags, 102) + << "incorrect value for sol_in[14].flags, expected 102, is " + << last_msg_->sol_in[14].flags; + EXPECT_EQ(last_msg_->sol_in[14].sensor_type, 190) + << "incorrect value for sol_in[14].sensor_type, expected 190, is " + << last_msg_->sol_in[14].sensor_type; + EXPECT_EQ(last_msg_->sol_in[15].flags, 48) + << "incorrect value for sol_in[15].flags, expected 48, is " + << last_msg_->sol_in[15].flags; + EXPECT_EQ(last_msg_->sol_in[15].sensor_type, 243) + << "incorrect value for sol_in[15].sensor_type, expected 243, is " + << last_msg_->sol_in[15].sensor_type; + EXPECT_EQ(last_msg_->sol_in[16].flags, 15) + << "incorrect value for sol_in[16].flags, expected 15, is " + << last_msg_->sol_in[16].flags; + EXPECT_EQ(last_msg_->sol_in[16].sensor_type, 192) + << "incorrect value for sol_in[16].sensor_type, expected 192, is " + << last_msg_->sol_in[16].sensor_type; + EXPECT_EQ(last_msg_->sol_in[17].flags, 89) + << "incorrect value for sol_in[17].flags, expected 89, is " + << last_msg_->sol_in[17].flags; + EXPECT_EQ(last_msg_->sol_in[17].sensor_type, 208) + << "incorrect value for sol_in[17].sensor_type, expected 208, is " + << last_msg_->sol_in[17].sensor_type; + EXPECT_EQ(last_msg_->sol_in[18].flags, 10) + << "incorrect value for sol_in[18].flags, expected 10, is " + << last_msg_->sol_in[18].flags; + EXPECT_EQ(last_msg_->sol_in[18].sensor_type, 56) + << "incorrect value for sol_in[18].sensor_type, expected 56, is " + << last_msg_->sol_in[18].sensor_type; + EXPECT_EQ(last_msg_->sol_in[19].flags, 2) + << "incorrect value for sol_in[19].flags, expected 2, is " + << last_msg_->sol_in[19].flags; + EXPECT_EQ(last_msg_->sol_in[19].sensor_type, 245) + << "incorrect value for sol_in[19].sensor_type, expected 245, is " + << last_msg_->sol_in[19].sensor_type; + EXPECT_EQ(last_msg_->sol_in[20].flags, 201) + << "incorrect value for sol_in[20].flags, expected 201, is " + << last_msg_->sol_in[20].flags; + EXPECT_EQ(last_msg_->sol_in[20].sensor_type, 254) + << "incorrect value for sol_in[20].sensor_type, expected 254, is " + << last_msg_->sol_in[20].sensor_type; + EXPECT_EQ(last_msg_->sol_in[21].flags, 32) + << "incorrect value for sol_in[21].flags, expected 32, is " + << last_msg_->sol_in[21].flags; + EXPECT_EQ(last_msg_->sol_in[21].sensor_type, 120) + << "incorrect value for sol_in[21].sensor_type, expected 120, is " + << last_msg_->sol_in[21].sensor_type; + EXPECT_EQ(last_msg_->sol_in[22].flags, 2) + << "incorrect value for sol_in[22].flags, expected 2, is " + << last_msg_->sol_in[22].flags; + EXPECT_EQ(last_msg_->sol_in[22].sensor_type, 126) + << "incorrect value for sol_in[22].sensor_type, expected 126, is " + << last_msg_->sol_in[22].sensor_type; + EXPECT_EQ(last_msg_->sol_in[23].flags, 161) + << "incorrect value for sol_in[23].flags, expected 161, is " + << last_msg_->sol_in[23].flags; + EXPECT_EQ(last_msg_->sol_in[23].sensor_type, 83) + << "incorrect value for sol_in[23].sensor_type, expected 83, is " + << last_msg_->sol_in[23].sensor_type; + EXPECT_EQ(last_msg_->sol_in[24].flags, 123) + << "incorrect value for sol_in[24].flags, expected 123, is " + << last_msg_->sol_in[24].flags; + EXPECT_EQ(last_msg_->sol_in[24].sensor_type, 238) + << "incorrect value for sol_in[24].sensor_type, expected 238, is " + << last_msg_->sol_in[24].sensor_type; + EXPECT_EQ(last_msg_->sol_in[25].flags, 230) + << "incorrect value for sol_in[25].flags, expected 230, is " + << last_msg_->sol_in[25].flags; + EXPECT_EQ(last_msg_->sol_in[25].sensor_type, 102) + << "incorrect value for sol_in[25].sensor_type, expected 102, is " + << last_msg_->sol_in[25].sensor_type; + EXPECT_EQ(last_msg_->sol_in[26].flags, 190) + << "incorrect value for sol_in[26].flags, expected 190, is " + << last_msg_->sol_in[26].flags; + EXPECT_EQ(last_msg_->sol_in[26].sensor_type, 76) + << "incorrect value for sol_in[26].sensor_type, expected 76, is " + << last_msg_->sol_in[26].sensor_type; + EXPECT_EQ(last_msg_->sol_in[27].flags, 182) + << "incorrect value for sol_in[27].flags, expected 182, is " + << last_msg_->sol_in[27].flags; + EXPECT_EQ(last_msg_->sol_in[27].sensor_type, 225) + << "incorrect value for sol_in[27].sensor_type, expected 225, is " + << last_msg_->sol_in[27].sensor_type; + EXPECT_EQ(last_msg_->sol_in[28].flags, 228) + << "incorrect value for sol_in[28].flags, expected 228, is " + << last_msg_->sol_in[28].flags; + EXPECT_EQ(last_msg_->sol_in[28].sensor_type, 207) + << "incorrect value for sol_in[28].sensor_type, expected 207, is " + << last_msg_->sol_in[28].sensor_type; + EXPECT_EQ(last_msg_->sol_in[29].flags, 218) + << "incorrect value for sol_in[29].flags, expected 218, is " + << last_msg_->sol_in[29].flags; + EXPECT_EQ(last_msg_->sol_in[29].sensor_type, 7) + << "incorrect value for sol_in[29].sensor_type, expected 7, is " + << last_msg_->sol_in[29].sensor_type; + EXPECT_EQ(last_msg_->sol_in[30].flags, 89) + << "incorrect value for sol_in[30].flags, expected 89, is " + << last_msg_->sol_in[30].flags; + EXPECT_EQ(last_msg_->sol_in[30].sensor_type, 117) + << "incorrect value for sol_in[30].sensor_type, expected 117, is " + << last_msg_->sol_in[30].sensor_type; + EXPECT_EQ(last_msg_->sol_in[31].flags, 191) + << "incorrect value for sol_in[31].flags, expected 191, is " + << last_msg_->sol_in[31].flags; + EXPECT_EQ(last_msg_->sol_in[31].sensor_type, 29) + << "incorrect value for sol_in[31].sensor_type, expected 29, is " + << last_msg_->sol_in[31].sensor_type; + EXPECT_EQ(last_msg_->sol_in[32].flags, 248) + << "incorrect value for sol_in[32].flags, expected 248, is " + << last_msg_->sol_in[32].flags; + EXPECT_EQ(last_msg_->sol_in[32].sensor_type, 56) + << "incorrect value for sol_in[32].sensor_type, expected 56, is " + << last_msg_->sol_in[32].sensor_type; + EXPECT_EQ(last_msg_->sol_in[33].flags, 255) + << "incorrect value for sol_in[33].flags, expected 255, is " + << last_msg_->sol_in[33].flags; + EXPECT_EQ(last_msg_->sol_in[33].sensor_type, 185) + << "incorrect value for sol_in[33].sensor_type, expected 185, is " + << last_msg_->sol_in[33].sensor_type; + EXPECT_EQ(last_msg_->sol_in[34].flags, 18) + << "incorrect value for sol_in[34].flags, expected 18, is " + << last_msg_->sol_in[34].flags; + EXPECT_EQ(last_msg_->sol_in[34].sensor_type, 46) + << "incorrect value for sol_in[34].sensor_type, expected 46, is " + << last_msg_->sol_in[34].sensor_type; + EXPECT_EQ(last_msg_->sol_in[35].flags, 142) + << "incorrect value for sol_in[35].flags, expected 142, is " + << last_msg_->sol_in[35].flags; + EXPECT_EQ(last_msg_->sol_in[35].sensor_type, 72) + << "incorrect value for sol_in[35].sensor_type, expected 72, is " + << last_msg_->sol_in[35].sensor_type; + EXPECT_EQ(last_msg_->sol_in[36].flags, 113) + << "incorrect value for sol_in[36].flags, expected 113, is " + << last_msg_->sol_in[36].flags; + EXPECT_EQ(last_msg_->sol_in[36].sensor_type, 82) + << "incorrect value for sol_in[36].sensor_type, expected 82, is " + << last_msg_->sol_in[36].sensor_type; + EXPECT_EQ(last_msg_->sol_in[37].flags, 4) + << "incorrect value for sol_in[37].flags, expected 4, is " + << last_msg_->sol_in[37].flags; + EXPECT_EQ(last_msg_->sol_in[37].sensor_type, 26) + << "incorrect value for sol_in[37].sensor_type, expected 26, is " + << last_msg_->sol_in[37].sensor_type; + EXPECT_EQ(last_msg_->sol_in[38].flags, 254) + << "incorrect value for sol_in[38].flags, expected 254, is " + << last_msg_->sol_in[38].flags; + EXPECT_EQ(last_msg_->sol_in[38].sensor_type, 172) + << "incorrect value for sol_in[38].sensor_type, expected 172, is " + << last_msg_->sol_in[38].sensor_type; + EXPECT_EQ(last_msg_->sol_in[39].flags, 136) + << "incorrect value for sol_in[39].flags, expected 136, is " + << last_msg_->sol_in[39].flags; + EXPECT_EQ(last_msg_->sol_in[39].sensor_type, 178) + << "incorrect value for sol_in[39].sensor_type, expected 178, is " + << last_msg_->sol_in[39].sensor_type; + EXPECT_EQ(last_msg_->sol_in[40].flags, 115) + << "incorrect value for sol_in[40].flags, expected 115, is " + << last_msg_->sol_in[40].flags; + EXPECT_EQ(last_msg_->sol_in[40].sensor_type, 113) + << "incorrect value for sol_in[40].sensor_type, expected 113, is " + << last_msg_->sol_in[40].sensor_type; + EXPECT_EQ(last_msg_->sol_in[41].flags, 193) + << "incorrect value for sol_in[41].flags, expected 193, is " + << last_msg_->sol_in[41].flags; + EXPECT_EQ(last_msg_->sol_in[41].sensor_type, 58) + << "incorrect value for sol_in[41].sensor_type, expected 58, is " + << last_msg_->sol_in[41].sensor_type; + EXPECT_EQ(last_msg_->sol_in[42].flags, 227) + << "incorrect value for sol_in[42].flags, expected 227, is " + << last_msg_->sol_in[42].flags; + EXPECT_EQ(last_msg_->sol_in[42].sensor_type, 89) + << "incorrect value for sol_in[42].sensor_type, expected 89, is " + << last_msg_->sol_in[42].sensor_type; + EXPECT_EQ(last_msg_->sol_in[43].flags, 246) + << "incorrect value for sol_in[43].flags, expected 246, is " + << last_msg_->sol_in[43].flags; + EXPECT_EQ(last_msg_->sol_in[43].sensor_type, 182) + << "incorrect value for sol_in[43].sensor_type, expected 182, is " + << last_msg_->sol_in[43].sensor_type; + EXPECT_EQ(last_msg_->sol_in[44].flags, 77) + << "incorrect value for sol_in[44].flags, expected 77, is " + << last_msg_->sol_in[44].flags; + EXPECT_EQ(last_msg_->sol_in[44].sensor_type, 76) + << "incorrect value for sol_in[44].sensor_type, expected 76, is " + << last_msg_->sol_in[44].sensor_type; + EXPECT_EQ(last_msg_->sol_in[45].flags, 245) + << "incorrect value for sol_in[45].flags, expected 245, is " + << last_msg_->sol_in[45].flags; + EXPECT_EQ(last_msg_->sol_in[45].sensor_type, 108) + << "incorrect value for sol_in[45].sensor_type, expected 108, is " + << last_msg_->sol_in[45].sensor_type; + EXPECT_EQ(last_msg_->sol_in[46].flags, 31) + << "incorrect value for sol_in[46].flags, expected 31, is " + << last_msg_->sol_in[46].flags; + EXPECT_EQ(last_msg_->sol_in[46].sensor_type, 41) + << "incorrect value for sol_in[46].sensor_type, expected 41, is " + << last_msg_->sol_in[46].sensor_type; + EXPECT_EQ(last_msg_->sol_in[47].flags, 124) + << "incorrect value for sol_in[47].flags, expected 124, is " + << last_msg_->sol_in[47].flags; + EXPECT_EQ(last_msg_->sol_in[47].sensor_type, 70) + << "incorrect value for sol_in[47].sensor_type, expected 70, is " + << last_msg_->sol_in[47].sensor_type; + EXPECT_EQ(last_msg_->sol_in[48].flags, 145) + << "incorrect value for sol_in[48].flags, expected 145, is " + << last_msg_->sol_in[48].flags; + EXPECT_EQ(last_msg_->sol_in[48].sensor_type, 249) + << "incorrect value for sol_in[48].sensor_type, expected 249, is " + << last_msg_->sol_in[48].sensor_type; + EXPECT_EQ(last_msg_->sol_in[49].flags, 78) + << "incorrect value for sol_in[49].flags, expected 78, is " + << last_msg_->sol_in[49].flags; + EXPECT_EQ(last_msg_->sol_in[49].sensor_type, 15) + << "incorrect value for sol_in[49].sensor_type, expected 15, is " + << last_msg_->sol_in[49].sensor_type; + EXPECT_EQ(last_msg_->sol_in[50].flags, 38) + << "incorrect value for sol_in[50].flags, expected 38, is " + << last_msg_->sol_in[50].flags; + EXPECT_EQ(last_msg_->sol_in[50].sensor_type, 228) + << "incorrect value for sol_in[50].sensor_type, expected 228, is " + << last_msg_->sol_in[50].sensor_type; + EXPECT_EQ(last_msg_->sol_in[51].flags, 129) + << "incorrect value for sol_in[51].flags, expected 129, is " + << last_msg_->sol_in[51].flags; + EXPECT_EQ(last_msg_->sol_in[51].sensor_type, 241) + << "incorrect value for sol_in[51].sensor_type, expected 241, is " + << last_msg_->sol_in[51].sensor_type; + EXPECT_EQ(last_msg_->sol_in[52].flags, 176) + << "incorrect value for sol_in[52].flags, expected 176, is " + << last_msg_->sol_in[52].flags; + EXPECT_EQ(last_msg_->sol_in[52].sensor_type, 8) + << "incorrect value for sol_in[52].sensor_type, expected 8, is " + << last_msg_->sol_in[52].sensor_type; + EXPECT_EQ(last_msg_->sol_in[53].flags, 72) + << "incorrect value for sol_in[53].flags, expected 72, is " + << last_msg_->sol_in[53].flags; + EXPECT_EQ(last_msg_->sol_in[53].sensor_type, 251) + << "incorrect value for sol_in[53].sensor_type, expected 251, is " + << last_msg_->sol_in[53].sensor_type; + EXPECT_EQ(last_msg_->sol_in[54].flags, 80) + << "incorrect value for sol_in[54].flags, expected 80, is " + << last_msg_->sol_in[54].flags; + EXPECT_EQ(last_msg_->sol_in[54].sensor_type, 248) + << "incorrect value for sol_in[54].sensor_type, expected 248, is " + << last_msg_->sol_in[54].sensor_type; + EXPECT_EQ(last_msg_->sol_in[55].flags, 244) + << "incorrect value for sol_in[55].flags, expected 244, is " + << last_msg_->sol_in[55].flags; + EXPECT_EQ(last_msg_->sol_in[55].sensor_type, 115) + << "incorrect value for sol_in[55].sensor_type, expected 115, is " + << last_msg_->sol_in[55].sensor_type; + EXPECT_EQ(last_msg_->sol_in[56].flags, 145) + << "incorrect value for sol_in[56].flags, expected 145, is " + << last_msg_->sol_in[56].flags; + EXPECT_EQ(last_msg_->sol_in[56].sensor_type, 231) + << "incorrect value for sol_in[56].sensor_type, expected 231, is " + << last_msg_->sol_in[56].sensor_type; + EXPECT_EQ(last_msg_->sol_in[57].flags, 190) + << "incorrect value for sol_in[57].flags, expected 190, is " + << last_msg_->sol_in[57].flags; + EXPECT_EQ(last_msg_->sol_in[57].sensor_type, 191) + << "incorrect value for sol_in[57].sensor_type, expected 191, is " + << last_msg_->sol_in[57].sensor_type; + EXPECT_EQ(last_msg_->sol_in[58].flags, 168) + << "incorrect value for sol_in[58].flags, expected 168, is " + << last_msg_->sol_in[58].flags; + EXPECT_EQ(last_msg_->sol_in[58].sensor_type, 178) + << "incorrect value for sol_in[58].sensor_type, expected 178, is " + << last_msg_->sol_in[58].sensor_type; + EXPECT_EQ(last_msg_->sol_in[59].flags, 233) + << "incorrect value for sol_in[59].flags, expected 233, is " + << last_msg_->sol_in[59].flags; + EXPECT_EQ(last_msg_->sol_in[59].sensor_type, 89) + << "incorrect value for sol_in[59].sensor_type, expected 89, is " + << last_msg_->sol_in[59].sensor_type; + EXPECT_EQ(last_msg_->sol_in[60].flags, 176) + << "incorrect value for sol_in[60].flags, expected 176, is " + << last_msg_->sol_in[60].flags; + EXPECT_EQ(last_msg_->sol_in[60].sensor_type, 69) + << "incorrect value for sol_in[60].sensor_type, expected 69, is " + << last_msg_->sol_in[60].sensor_type; + EXPECT_EQ(last_msg_->sol_in[61].flags, 140) + << "incorrect value for sol_in[61].flags, expected 140, is " + << last_msg_->sol_in[61].flags; + EXPECT_EQ(last_msg_->sol_in[61].sensor_type, 174) + << "incorrect value for sol_in[61].sensor_type, expected 174, is " + << last_msg_->sol_in[61].sensor_type; + EXPECT_EQ(last_msg_->sol_in[62].flags, 141) + << "incorrect value for sol_in[62].flags, expected 141, is " + << last_msg_->sol_in[62].flags; + EXPECT_EQ(last_msg_->sol_in[62].sensor_type, 182) + << "incorrect value for sol_in[62].sensor_type, expected 182, is " + << last_msg_->sol_in[62].sensor_type; + EXPECT_EQ(last_msg_->sol_in[63].flags, 82) + << "incorrect value for sol_in[63].flags, expected 82, is " + << last_msg_->sol_in[63].flags; + EXPECT_EQ(last_msg_->sol_in[63].sensor_type, 81) + << "incorrect value for sol_in[63].sensor_type, expected 81, is " + << last_msg_->sol_in[63].sensor_type; + EXPECT_EQ(last_msg_->sol_in[64].flags, 79) + << "incorrect value for sol_in[64].flags, expected 79, is " + << last_msg_->sol_in[64].flags; + EXPECT_EQ(last_msg_->sol_in[64].sensor_type, 92) + << "incorrect value for sol_in[64].sensor_type, expected 92, is " + << last_msg_->sol_in[64].sensor_type; + EXPECT_EQ(last_msg_->sol_in[65].flags, 223) + << "incorrect value for sol_in[65].flags, expected 223, is " + << last_msg_->sol_in[65].flags; + EXPECT_EQ(last_msg_->sol_in[65].sensor_type, 101) + << "incorrect value for sol_in[65].sensor_type, expected 101, is " + << last_msg_->sol_in[65].sensor_type; + EXPECT_EQ(last_msg_->sol_in[66].flags, 64) + << "incorrect value for sol_in[66].flags, expected 64, is " + << last_msg_->sol_in[66].flags; + EXPECT_EQ(last_msg_->sol_in[66].sensor_type, 100) + << "incorrect value for sol_in[66].sensor_type, expected 100, is " + << last_msg_->sol_in[66].sensor_type; + EXPECT_EQ(last_msg_->sol_in[67].flags, 215) + << "incorrect value for sol_in[67].flags, expected 215, is " + << last_msg_->sol_in[67].flags; + EXPECT_EQ(last_msg_->sol_in[67].sensor_type, 184) + << "incorrect value for sol_in[67].sensor_type, expected 184, is " + << last_msg_->sol_in[67].sensor_type; + EXPECT_EQ(last_msg_->sol_in[68].flags, 37) + << "incorrect value for sol_in[68].flags, expected 37, is " + << last_msg_->sol_in[68].flags; + EXPECT_EQ(last_msg_->sol_in[68].sensor_type, 124) + << "incorrect value for sol_in[68].sensor_type, expected 124, is " + << last_msg_->sol_in[68].sensor_type; + EXPECT_EQ(last_msg_->sol_in[69].flags, 227) + << "incorrect value for sol_in[69].flags, expected 227, is " + << last_msg_->sol_in[69].flags; + EXPECT_EQ(last_msg_->sol_in[69].sensor_type, 21) + << "incorrect value for sol_in[69].sensor_type, expected 21, is " + << last_msg_->sol_in[69].sensor_type; + EXPECT_EQ(last_msg_->sol_in[70].flags, 102) + << "incorrect value for sol_in[70].flags, expected 102, is " + << last_msg_->sol_in[70].flags; + EXPECT_EQ(last_msg_->sol_in[70].sensor_type, 135) + << "incorrect value for sol_in[70].sensor_type, expected 135, is " + << last_msg_->sol_in[70].sensor_type; + EXPECT_EQ(last_msg_->sol_in[71].flags, 36) + << "incorrect value for sol_in[71].flags, expected 36, is " + << last_msg_->sol_in[71].flags; + EXPECT_EQ(last_msg_->sol_in[71].sensor_type, 72) + << "incorrect value for sol_in[71].sensor_type, expected 72, is " + << last_msg_->sol_in[71].sensor_type; + EXPECT_EQ(last_msg_->sol_in[72].flags, 56) + << "incorrect value for sol_in[72].flags, expected 56, is " + << last_msg_->sol_in[72].flags; + EXPECT_EQ(last_msg_->sol_in[72].sensor_type, 219) + << "incorrect value for sol_in[72].sensor_type, expected 219, is " + << last_msg_->sol_in[72].sensor_type; + EXPECT_EQ(last_msg_->sol_in[73].flags, 90) + << "incorrect value for sol_in[73].flags, expected 90, is " + << last_msg_->sol_in[73].flags; + EXPECT_EQ(last_msg_->sol_in[73].sensor_type, 146) + << "incorrect value for sol_in[73].sensor_type, expected 146, is " + << last_msg_->sol_in[73].sensor_type; + EXPECT_EQ(last_msg_->sol_in[74].flags, 104) + << "incorrect value for sol_in[74].flags, expected 104, is " + << last_msg_->sol_in[74].flags; + EXPECT_EQ(last_msg_->sol_in[74].sensor_type, 219) + << "incorrect value for sol_in[74].sensor_type, expected 219, is " + << last_msg_->sol_in[74].sensor_type; + EXPECT_EQ(last_msg_->sol_in[75].flags, 102) + << "incorrect value for sol_in[75].flags, expected 102, is " + << last_msg_->sol_in[75].flags; + EXPECT_EQ(last_msg_->sol_in[75].sensor_type, 227) + << "incorrect value for sol_in[75].sensor_type, expected 227, is " + << last_msg_->sol_in[75].sensor_type; + EXPECT_EQ(last_msg_->sol_in[76].flags, 12) + << "incorrect value for sol_in[76].flags, expected 12, is " + << last_msg_->sol_in[76].flags; + EXPECT_EQ(last_msg_->sol_in[76].sensor_type, 83) + << "incorrect value for sol_in[76].sensor_type, expected 83, is " + << last_msg_->sol_in[76].sensor_type; + EXPECT_EQ(last_msg_->sol_in[77].flags, 122) + << "incorrect value for sol_in[77].flags, expected 122, is " + << last_msg_->sol_in[77].flags; + EXPECT_EQ(last_msg_->sol_in[77].sensor_type, 41) + << "incorrect value for sol_in[77].sensor_type, expected 41, is " + << last_msg_->sol_in[77].sensor_type; + EXPECT_EQ(last_msg_->sol_in[78].flags, 94) + << "incorrect value for sol_in[78].flags, expected 94, is " + << last_msg_->sol_in[78].flags; + EXPECT_EQ(last_msg_->sol_in[78].sensor_type, 173) + << "incorrect value for sol_in[78].sensor_type, expected 173, is " + << last_msg_->sol_in[78].sensor_type; + EXPECT_EQ(last_msg_->sol_in[79].flags, 174) + << "incorrect value for sol_in[79].flags, expected 174, is " + << last_msg_->sol_in[79].flags; + EXPECT_EQ(last_msg_->sol_in[79].sensor_type, 1) + << "incorrect value for sol_in[79].sensor_type, expected 1, is " + << last_msg_->sol_in[79].sensor_type; + EXPECT_EQ(last_msg_->sol_in[80].flags, 130) + << "incorrect value for sol_in[80].flags, expected 130, is " + << last_msg_->sol_in[80].flags; + EXPECT_EQ(last_msg_->sol_in[80].sensor_type, 134) + << "incorrect value for sol_in[80].sensor_type, expected 134, is " + << last_msg_->sol_in[80].sensor_type; + EXPECT_EQ(last_msg_->sol_in[81].flags, 237) + << "incorrect value for sol_in[81].flags, expected 237, is " + << last_msg_->sol_in[81].flags; + EXPECT_EQ(last_msg_->sol_in[81].sensor_type, 104) + << "incorrect value for sol_in[81].sensor_type, expected 104, is " + << last_msg_->sol_in[81].sensor_type; + EXPECT_EQ(last_msg_->sol_in[82].flags, 249) + << "incorrect value for sol_in[82].flags, expected 249, is " + << last_msg_->sol_in[82].flags; + EXPECT_EQ(last_msg_->sol_in[82].sensor_type, 116) + << "incorrect value for sol_in[82].sensor_type, expected 116, is " + << last_msg_->sol_in[82].sensor_type; + EXPECT_EQ(last_msg_->sol_in[83].flags, 230) + << "incorrect value for sol_in[83].flags, expected 230, is " + << last_msg_->sol_in[83].flags; + EXPECT_EQ(last_msg_->sol_in[83].sensor_type, 107) + << "incorrect value for sol_in[83].sensor_type, expected 107, is " + << last_msg_->sol_in[83].sensor_type; + EXPECT_EQ(last_msg_->sol_in[84].flags, 123) + << "incorrect value for sol_in[84].flags, expected 123, is " + << last_msg_->sol_in[84].flags; + EXPECT_EQ(last_msg_->sol_in[84].sensor_type, 130) + << "incorrect value for sol_in[84].sensor_type, expected 130, is " + << last_msg_->sol_in[84].sensor_type; + EXPECT_EQ(last_msg_->sol_in[85].flags, 162) + << "incorrect value for sol_in[85].flags, expected 162, is " + << last_msg_->sol_in[85].flags; + EXPECT_EQ(last_msg_->sol_in[85].sensor_type, 25) + << "incorrect value for sol_in[85].sensor_type, expected 25, is " + << last_msg_->sol_in[85].sensor_type; + EXPECT_EQ(last_msg_->sol_in[86].flags, 223) + << "incorrect value for sol_in[86].flags, expected 223, is " + << last_msg_->sol_in[86].flags; + EXPECT_EQ(last_msg_->sol_in[86].sensor_type, 57) + << "incorrect value for sol_in[86].sensor_type, expected 57, is " + << last_msg_->sol_in[86].sensor_type; + EXPECT_EQ(last_msg_->sol_in[87].flags, 174) + << "incorrect value for sol_in[87].flags, expected 174, is " + << last_msg_->sol_in[87].flags; + EXPECT_EQ(last_msg_->sol_in[87].sensor_type, 193) + << "incorrect value for sol_in[87].sensor_type, expected 193, is " + << last_msg_->sol_in[87].sensor_type; + EXPECT_EQ(last_msg_->sol_in[88].flags, 193) + << "incorrect value for sol_in[88].flags, expected 193, is " + << last_msg_->sol_in[88].flags; + EXPECT_EQ(last_msg_->sol_in[88].sensor_type, 146) + << "incorrect value for sol_in[88].sensor_type, expected 146, is " + << last_msg_->sol_in[88].sensor_type; + EXPECT_EQ(last_msg_->sol_in[89].flags, 44) + << "incorrect value for sol_in[89].flags, expected 44, is " + << last_msg_->sol_in[89].flags; + EXPECT_EQ(last_msg_->sol_in[89].sensor_type, 239) + << "incorrect value for sol_in[89].sensor_type, expected 239, is " + << last_msg_->sol_in[89].sensor_type; + EXPECT_EQ(last_msg_->sol_in[90].flags, 197) + << "incorrect value for sol_in[90].flags, expected 197, is " + << last_msg_->sol_in[90].flags; + EXPECT_EQ(last_msg_->sol_in[90].sensor_type, 246) + << "incorrect value for sol_in[90].sensor_type, expected 246, is " + << last_msg_->sol_in[90].sensor_type; + EXPECT_EQ(last_msg_->sol_in[91].flags, 80) + << "incorrect value for sol_in[91].flags, expected 80, is " + << last_msg_->sol_in[91].flags; + EXPECT_EQ(last_msg_->sol_in[91].sensor_type, 214) + << "incorrect value for sol_in[91].sensor_type, expected 214, is " + << last_msg_->sol_in[91].sensor_type; + EXPECT_EQ(last_msg_->sol_in[92].flags, 100) + << "incorrect value for sol_in[92].flags, expected 100, is " + << last_msg_->sol_in[92].flags; + EXPECT_EQ(last_msg_->sol_in[92].sensor_type, 83) + << "incorrect value for sol_in[92].sensor_type, expected 83, is " + << last_msg_->sol_in[92].sensor_type; + EXPECT_EQ(last_msg_->sol_in[93].flags, 72) + << "incorrect value for sol_in[93].flags, expected 72, is " + << last_msg_->sol_in[93].flags; + EXPECT_EQ(last_msg_->sol_in[93].sensor_type, 66) + << "incorrect value for sol_in[93].sensor_type, expected 66, is " + << last_msg_->sol_in[93].sensor_type; + EXPECT_EQ(last_msg_->sol_in[94].flags, 137) + << "incorrect value for sol_in[94].flags, expected 137, is " + << last_msg_->sol_in[94].flags; + EXPECT_EQ(last_msg_->sol_in[94].sensor_type, 133) + << "incorrect value for sol_in[94].sensor_type, expected 133, is " + << last_msg_->sol_in[94].sensor_type; + EXPECT_EQ(last_msg_->sol_in[95].flags, 82) + << "incorrect value for sol_in[95].flags, expected 82, is " + << last_msg_->sol_in[95].flags; + EXPECT_EQ(last_msg_->sol_in[95].sensor_type, 140) + << "incorrect value for sol_in[95].sensor_type, expected 140, is " + << last_msg_->sol_in[95].sensor_type; + EXPECT_EQ(last_msg_->sol_in[96].flags, 2) + << "incorrect value for sol_in[96].flags, expected 2, is " + << last_msg_->sol_in[96].flags; + EXPECT_EQ(last_msg_->sol_in[96].sensor_type, 2) + << "incorrect value for sol_in[96].sensor_type, expected 2, is " + << last_msg_->sol_in[96].sensor_type; + EXPECT_EQ(last_msg_->sol_in[97].flags, 9) + << "incorrect value for sol_in[97].flags, expected 9, is " + << last_msg_->sol_in[97].flags; + EXPECT_EQ(last_msg_->sol_in[97].sensor_type, 96) + << "incorrect value for sol_in[97].sensor_type, expected 96, is " + << last_msg_->sol_in[97].sensor_type; + EXPECT_EQ(last_msg_->sol_in[98].flags, 158) + << "incorrect value for sol_in[98].flags, expected 158, is " + << last_msg_->sol_in[98].flags; + EXPECT_EQ(last_msg_->sol_in[98].sensor_type, 96) + << "incorrect value for sol_in[98].sensor_type, expected 96, is " + << last_msg_->sol_in[98].sensor_type; + EXPECT_EQ(last_msg_->sol_in[99].flags, 97) + << "incorrect value for sol_in[99].flags, expected 97, is " + << last_msg_->sol_in[99].flags; + EXPECT_EQ(last_msg_->sol_in[99].sensor_type, 134) + << "incorrect value for sol_in[99].sensor_type, expected 134, is " + << last_msg_->sol_in[99].sensor_type; + EXPECT_EQ(last_msg_->sol_in[100].flags, 129) + << "incorrect value for sol_in[100].flags, expected 129, is " + << last_msg_->sol_in[100].flags; + EXPECT_EQ(last_msg_->sol_in[100].sensor_type, 43) + << "incorrect value for sol_in[100].sensor_type, expected 43, is " + << last_msg_->sol_in[100].sensor_type; + EXPECT_EQ(last_msg_->sol_in[101].flags, 25) + << "incorrect value for sol_in[101].flags, expected 25, is " + << last_msg_->sol_in[101].flags; + EXPECT_EQ(last_msg_->sol_in[101].sensor_type, 141) + << "incorrect value for sol_in[101].sensor_type, expected 141, is " + << last_msg_->sol_in[101].sensor_type; + EXPECT_EQ(last_msg_->sol_in[102].flags, 200) + << "incorrect value for sol_in[102].flags, expected 200, is " + << last_msg_->sol_in[102].flags; + EXPECT_EQ(last_msg_->sol_in[102].sensor_type, 183) + << "incorrect value for sol_in[102].sensor_type, expected 183, is " + << last_msg_->sol_in[102].sensor_type; + EXPECT_EQ(last_msg_->sol_in[103].flags, 57) + << "incorrect value for sol_in[103].flags, expected 57, is " + << last_msg_->sol_in[103].flags; + EXPECT_EQ(last_msg_->sol_in[103].sensor_type, 214) + << "incorrect value for sol_in[103].sensor_type, expected 214, is " + << last_msg_->sol_in[103].sensor_type; + EXPECT_EQ(last_msg_->sol_in[104].flags, 103) + << "incorrect value for sol_in[104].flags, expected 103, is " + << last_msg_->sol_in[104].flags; + EXPECT_EQ(last_msg_->sol_in[104].sensor_type, 248) + << "incorrect value for sol_in[104].sensor_type, expected 248, is " + << last_msg_->sol_in[104].sensor_type; + EXPECT_EQ(last_msg_->sol_in[105].flags, 65) + << "incorrect value for sol_in[105].flags, expected 65, is " + << last_msg_->sol_in[105].flags; + EXPECT_EQ(last_msg_->sol_in[105].sensor_type, 222) + << "incorrect value for sol_in[105].sensor_type, expected 222, is " + << last_msg_->sol_in[105].sensor_type; + EXPECT_EQ(last_msg_->sol_in[106].flags, 15) + << "incorrect value for sol_in[106].flags, expected 15, is " + << last_msg_->sol_in[106].flags; + EXPECT_EQ(last_msg_->sol_in[106].sensor_type, 195) + << "incorrect value for sol_in[106].sensor_type, expected 195, is " + << last_msg_->sol_in[106].sensor_type; + EXPECT_EQ(last_msg_->sol_in[107].flags, 21) + << "incorrect value for sol_in[107].flags, expected 21, is " + << last_msg_->sol_in[107].flags; + EXPECT_EQ(last_msg_->sol_in[107].sensor_type, 244) + << "incorrect value for sol_in[107].sensor_type, expected 244, is " + << last_msg_->sol_in[107].sensor_type; + EXPECT_EQ(last_msg_->sol_in[108].flags, 46) + << "incorrect value for sol_in[108].flags, expected 46, is " + << last_msg_->sol_in[108].flags; + EXPECT_EQ(last_msg_->sol_in[108].sensor_type, 180) + << "incorrect value for sol_in[108].sensor_type, expected 180, is " + << last_msg_->sol_in[108].sensor_type; + EXPECT_EQ(last_msg_->sol_in[109].flags, 130) + << "incorrect value for sol_in[109].flags, expected 130, is " + << last_msg_->sol_in[109].flags; + EXPECT_EQ(last_msg_->sol_in[109].sensor_type, 140) + << "incorrect value for sol_in[109].sensor_type, expected 140, is " + << last_msg_->sol_in[109].sensor_type; + EXPECT_EQ(last_msg_->sol_in[110].flags, 17) + << "incorrect value for sol_in[110].flags, expected 17, is " + << last_msg_->sol_in[110].flags; + EXPECT_EQ(last_msg_->sol_in[110].sensor_type, 36) + << "incorrect value for sol_in[110].sensor_type, expected 36, is " + << last_msg_->sol_in[110].sensor_type; + EXPECT_EQ(last_msg_->sol_in[111].flags, 209) + << "incorrect value for sol_in[111].flags, expected 209, is " + << last_msg_->sol_in[111].flags; + EXPECT_EQ(last_msg_->sol_in[111].sensor_type, 194) + << "incorrect value for sol_in[111].sensor_type, expected 194, is " + << last_msg_->sol_in[111].sensor_type; + EXPECT_EQ(last_msg_->sol_in[112].flags, 254) + << "incorrect value for sol_in[112].flags, expected 254, is " + << last_msg_->sol_in[112].flags; + EXPECT_EQ(last_msg_->sol_in[112].sensor_type, 65) + << "incorrect value for sol_in[112].sensor_type, expected 65, is " + << last_msg_->sol_in[112].sensor_type; + EXPECT_EQ(last_msg_->sol_in[113].flags, 103) + << "incorrect value for sol_in[113].flags, expected 103, is " + << last_msg_->sol_in[113].flags; + EXPECT_EQ(last_msg_->sol_in[113].sensor_type, 115) + << "incorrect value for sol_in[113].sensor_type, expected 115, is " + << last_msg_->sol_in[113].sensor_type; + EXPECT_EQ(last_msg_->sol_in[114].flags, 129) + << "incorrect value for sol_in[114].flags, expected 129, is " + << last_msg_->sol_in[114].flags; + EXPECT_EQ(last_msg_->sol_in[114].sensor_type, 152) + << "incorrect value for sol_in[114].sensor_type, expected 152, is " + << last_msg_->sol_in[114].sensor_type; + EXPECT_EQ(last_msg_->sol_in[115].flags, 235) + << "incorrect value for sol_in[115].flags, expected 235, is " + << last_msg_->sol_in[115].flags; + EXPECT_EQ(last_msg_->sol_in[115].sensor_type, 234) + << "incorrect value for sol_in[115].sensor_type, expected 234, is " + << last_msg_->sol_in[115].sensor_type; + EXPECT_EQ(last_msg_->sol_in[116].flags, 234) + << "incorrect value for sol_in[116].flags, expected 234, is " + << last_msg_->sol_in[116].flags; + EXPECT_EQ(last_msg_->sol_in[116].sensor_type, 194) + << "incorrect value for sol_in[116].sensor_type, expected 194, is " + << last_msg_->sol_in[116].sensor_type; + EXPECT_EQ(last_msg_->sol_in[117].flags, 201) + << "incorrect value for sol_in[117].flags, expected 201, is " + << last_msg_->sol_in[117].flags; + EXPECT_EQ(last_msg_->sol_in[117].sensor_type, 170) + << "incorrect value for sol_in[117].sensor_type, expected 170, is " + << last_msg_->sol_in[117].sensor_type; + EXPECT_EQ(last_msg_->sol_in[118].flags, 154) + << "incorrect value for sol_in[118].flags, expected 154, is " + << last_msg_->sol_in[118].flags; + EXPECT_EQ(last_msg_->sol_in[118].sensor_type, 210) + << "incorrect value for sol_in[118].sensor_type, expected 210, is " + << last_msg_->sol_in[118].sensor_type; + EXPECT_EQ(last_msg_->tow, 3628191792) + << "incorrect value for tow, expected 3628191792, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->vdop, 58512) + << "incorrect value for vdop, expected 58512, is " << last_msg_->vdop; } diff --git a/c/test/legacy/cpp/auto_check_sbp_solution_meta_MsgSolnMetaDepA.cc b/c/test/legacy/cpp/auto_check_sbp_solution_meta_MsgSolnMetaDepA.cc index 9fe834e0c..c5d2a64fc 100644 --- a/c/test/legacy/cpp/auto_check_sbp_solution_meta_MsgSolnMetaDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_solution_meta_MsgSolnMetaDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMetaDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/soln_meta/test_MsgSolnMetaDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_soln_meta_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_soln_meta_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,993 +81,1495 @@ class Test_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_soln_meta_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_solution_meta_MsgSolnMetaDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 15, 255, 84, 241, 254, 183, 222, 157, 121, 5, 164, 238, 31, 190, + 115, 93, 59, 103, 36, 83, 161, 156, 46, 253, 67, 87, 200, 39, 250, + 245, 242, 228, 72, 18, 222, 11, 88, 207, 218, 231, 13, 226, 224, 22, + 196, 21, 242, 12, 89, 71, 219, 182, 85, 145, 204, 146, 40, 204, 51, + 21, 153, 227, 44, 15, 28, 255, 39, 205, 216, 240, 190, 93, 219, 103, + 42, 41, 182, 76, 222, 17, 23, 125, 31, 18, 229, 28, 47, 214, 25, + 100, 84, 106, 72, 48, 10, 222, 232, 235, 73, 109, 163, 51, 152, 133, + 235, 87, 70, 2, 108, 91, 101, 200, 55, 24, 156, 233, 73, 39, 66, + 97, 140, 252, 227, 230, 237, 135, 241, 245, 205, 70, 0, 219, 188, 107, + 136, 178, 58, 1, 29, 44, 213, 225, 147, 190, 96, 192, 108, 228, 15, + 203, 18, 3, 222, 180, 68, 101, 229, 223, 203, 243, 164, 92, 165, 220, + 159, 174, 121, 112, 167, 240, 40, 59, 3, 230, 52, 149, 148, 218, 142, + 212, 109, 176, 71, 179, 172, 77, 1, 193, 70, 147, 149, 23, 144, 148, + 239, 195, 186, 86, 30, 34, 143, 156, 207, 63, 55, 117, 255, 222, 222, + 219, 145, 224, 191, 210, 109, 86, 153, 21, 32, 226, 10, 60, 63, 106, + 236, 93, 96, 30, 163, 106, 238, 147, 133, 132, 107, 152, 214, 221, 185, + 202, 21, 252, 51, 130, 59, 166, 202, 127, 170, 58, 193, 215, 125, 22, + 58, 135, 47, 88, 142, 77, 211, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_soln_meta_dep_a_t *test_msg = (msg_soln_meta_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->age_corrections = 48671; + test_msg->alignment_status = 115; + test_msg->hdop = 31133; + test_msg->last_used_gnss_pos_tow = 610745181; + test_msg->last_used_gnss_vel_tow = 782016851; + test_msg->n_sats = 238; + test_msg->pdop = 57015; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[0].flags = 67; + test_msg->sol_in[0].sensor_type = 253; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[1].flags = 200; + test_msg->sol_in[1].sensor_type = 87; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[2].flags = 250; + test_msg->sol_in[2].sensor_type = 39; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[3].flags = 242; + test_msg->sol_in[3].sensor_type = 245; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[4].flags = 72; + test_msg->sol_in[4].sensor_type = 228; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[5].flags = 222; + test_msg->sol_in[5].sensor_type = 18; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[6].flags = 88; + test_msg->sol_in[6].sensor_type = 11; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[7].flags = 218; + test_msg->sol_in[7].sensor_type = 207; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[8].flags = 13; + test_msg->sol_in[8].sensor_type = 231; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[9].flags = 224; + test_msg->sol_in[9].sensor_type = 226; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[10].flags = 196; + test_msg->sol_in[10].sensor_type = 22; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[11].flags = 242; + test_msg->sol_in[11].sensor_type = 21; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[12].flags = 89; + test_msg->sol_in[12].sensor_type = 12; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[13].flags = 219; + test_msg->sol_in[13].sensor_type = 71; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[14].flags = 85; + test_msg->sol_in[14].sensor_type = 182; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[15].flags = 204; + test_msg->sol_in[15].sensor_type = 145; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[16].flags = 40; + test_msg->sol_in[16].sensor_type = 146; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[17].flags = 51; + test_msg->sol_in[17].sensor_type = 204; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[18].flags = 153; + test_msg->sol_in[18].sensor_type = 21; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[19].flags = 44; + test_msg->sol_in[19].sensor_type = 227; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[20].flags = 28; + test_msg->sol_in[20].sensor_type = 15; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[21].flags = 39; + test_msg->sol_in[21].sensor_type = 255; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[22].flags = 216; + test_msg->sol_in[22].sensor_type = 205; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[23].flags = 190; + test_msg->sol_in[23].sensor_type = 240; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[24].flags = 219; + test_msg->sol_in[24].sensor_type = 93; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[25].flags = 42; + test_msg->sol_in[25].sensor_type = 103; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[26].flags = 182; + test_msg->sol_in[26].sensor_type = 41; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[27].flags = 222; + test_msg->sol_in[27].sensor_type = 76; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[28].flags = 23; + test_msg->sol_in[28].sensor_type = 17; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[29].flags = 31; + test_msg->sol_in[29].sensor_type = 125; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[30].flags = 229; + test_msg->sol_in[30].sensor_type = 18; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[31].flags = 47; + test_msg->sol_in[31].sensor_type = 28; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[32].flags = 25; + test_msg->sol_in[32].sensor_type = 214; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[33].flags = 84; + test_msg->sol_in[33].sensor_type = 100; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[34].flags = 72; + test_msg->sol_in[34].sensor_type = 106; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[35].flags = 10; + test_msg->sol_in[35].sensor_type = 48; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[36].flags = 232; + test_msg->sol_in[36].sensor_type = 222; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[37].flags = 73; + test_msg->sol_in[37].sensor_type = 235; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[38].flags = 163; + test_msg->sol_in[38].sensor_type = 109; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[39].flags = 152; + test_msg->sol_in[39].sensor_type = 51; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[40].flags = 235; + test_msg->sol_in[40].sensor_type = 133; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[41].flags = 70; + test_msg->sol_in[41].sensor_type = 87; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[42].flags = 108; + test_msg->sol_in[42].sensor_type = 2; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[43].flags = 101; + test_msg->sol_in[43].sensor_type = 91; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[44].flags = 55; + test_msg->sol_in[44].sensor_type = 200; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[45].flags = 156; + test_msg->sol_in[45].sensor_type = 24; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[46].flags = 73; + test_msg->sol_in[46].sensor_type = 233; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[47].flags = 66; + test_msg->sol_in[47].sensor_type = 39; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[48].flags = 140; + test_msg->sol_in[48].sensor_type = 97; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[49].flags = 227; + test_msg->sol_in[49].sensor_type = 252; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[50].flags = 237; + test_msg->sol_in[50].sensor_type = 230; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[51].flags = 241; + test_msg->sol_in[51].sensor_type = 135; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[52].flags = 205; + test_msg->sol_in[52].sensor_type = 245; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[53].flags = 0; + test_msg->sol_in[53].sensor_type = 70; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[54].flags = 188; + test_msg->sol_in[54].sensor_type = 219; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[55].flags = 136; + test_msg->sol_in[55].sensor_type = 107; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[56].flags = 58; + test_msg->sol_in[56].sensor_type = 178; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[57].flags = 29; + test_msg->sol_in[57].sensor_type = 1; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[58].flags = 213; + test_msg->sol_in[58].sensor_type = 44; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[59].flags = 147; + test_msg->sol_in[59].sensor_type = 225; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[60].flags = 96; + test_msg->sol_in[60].sensor_type = 190; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[61].flags = 108; + test_msg->sol_in[61].sensor_type = 192; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[62].flags = 15; + test_msg->sol_in[62].sensor_type = 228; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[63].flags = 18; + test_msg->sol_in[63].sensor_type = 203; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[64].flags = 222; + test_msg->sol_in[64].sensor_type = 3; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[65].flags = 68; + test_msg->sol_in[65].sensor_type = 180; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[66].flags = 229; + test_msg->sol_in[66].sensor_type = 101; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[67].flags = 203; + test_msg->sol_in[67].sensor_type = 223; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[68].flags = 164; + test_msg->sol_in[68].sensor_type = 243; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[69].flags = 165; + test_msg->sol_in[69].sensor_type = 92; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[70].flags = 159; + test_msg->sol_in[70].sensor_type = 220; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[71].flags = 121; + test_msg->sol_in[71].sensor_type = 174; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[72].flags = 167; + test_msg->sol_in[72].sensor_type = 112; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[73].flags = 40; + test_msg->sol_in[73].sensor_type = 240; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[74].flags = 3; + test_msg->sol_in[74].sensor_type = 59; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[75].flags = 52; + test_msg->sol_in[75].sensor_type = 230; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[76].flags = 148; + test_msg->sol_in[76].sensor_type = 149; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[77].flags = 142; + test_msg->sol_in[77].sensor_type = 218; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[78].flags = 109; + test_msg->sol_in[78].sensor_type = 212; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[79].flags = 71; + test_msg->sol_in[79].sensor_type = 176; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[80].flags = 172; + test_msg->sol_in[80].sensor_type = 179; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[81].flags = 1; + test_msg->sol_in[81].sensor_type = 77; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[82].flags = 70; + test_msg->sol_in[82].sensor_type = 193; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[83].flags = 149; + test_msg->sol_in[83].sensor_type = 147; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[84].flags = 144; + test_msg->sol_in[84].sensor_type = 23; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[85].flags = 239; + test_msg->sol_in[85].sensor_type = 148; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[86].flags = 186; + test_msg->sol_in[86].sensor_type = 195; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[87].flags = 30; + test_msg->sol_in[87].sensor_type = 86; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[88].flags = 143; + test_msg->sol_in[88].sensor_type = 34; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[89].flags = 207; + test_msg->sol_in[89].sensor_type = 156; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[90].flags = 55; + test_msg->sol_in[90].sensor_type = 63; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[91].flags = 255; + test_msg->sol_in[91].sensor_type = 117; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[92].flags = 222; + test_msg->sol_in[92].sensor_type = 222; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[93].flags = 145; + test_msg->sol_in[93].sensor_type = 219; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[94].flags = 191; + test_msg->sol_in[94].sensor_type = 224; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[95].flags = 109; + test_msg->sol_in[95].sensor_type = 210; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[96].flags = 153; + test_msg->sol_in[96].sensor_type = 86; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[97].flags = 32; + test_msg->sol_in[97].sensor_type = 21; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[98].flags = 10; + test_msg->sol_in[98].sensor_type = 226; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[99].flags = 63; + test_msg->sol_in[99].sensor_type = 60; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[100].flags = 236; + test_msg->sol_in[100].sensor_type = 106; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[101].flags = 96; + test_msg->sol_in[101].sensor_type = 93; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[102].flags = 163; + test_msg->sol_in[102].sensor_type = 30; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[103].flags = 238; + test_msg->sol_in[103].sensor_type = 106; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[104].flags = 133; + test_msg->sol_in[104].sensor_type = 147; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[105].flags = 107; + test_msg->sol_in[105].sensor_type = 132; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[106].flags = 214; + test_msg->sol_in[106].sensor_type = 152; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[107].flags = 185; + test_msg->sol_in[107].sensor_type = 221; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[108].flags = 21; + test_msg->sol_in[108].sensor_type = 202; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[109].flags = 51; + test_msg->sol_in[109].sensor_type = 252; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[110].flags = 59; + test_msg->sol_in[110].sensor_type = 130; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[111].flags = 202; + test_msg->sol_in[111].sensor_type = 166; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[112].flags = 170; + test_msg->sol_in[112].sensor_type = 127; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[113].flags = 193; + test_msg->sol_in[113].sensor_type = 58; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[114].flags = 125; + test_msg->sol_in[114].sensor_type = 215; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[115].flags = 58; + test_msg->sol_in[115].sensor_type = 22; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[116].flags = 47; + test_msg->sol_in[116].sensor_type = 135; + if (sizeof(test_msg->sol_in) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); + } + test_msg->sol_in[117].flags = 142; + test_msg->sol_in[117].sensor_type = 88; + test_msg->vdop = 41989; + + EXPECT_EQ(send_message(0xff0f, 61780, test_msg_len, test_msg_storage), + SBP_OK); - uint8_t encoded_frame[] = {85,15,255,84,241,254,183,222,157,121,5,164,238,31,190,115,93,59,103,36,83,161,156,46,253,67,87,200,39,250,245,242,228,72,18,222,11,88,207,218,231,13,226,224,22,196,21,242,12,89,71,219,182,85,145,204,146,40,204,51,21,153,227,44,15,28,255,39,205,216,240,190,93,219,103,42,41,182,76,222,17,23,125,31,18,229,28,47,214,25,100,84,106,72,48,10,222,232,235,73,109,163,51,152,133,235,87,70,2,108,91,101,200,55,24,156,233,73,39,66,97,140,252,227,230,237,135,241,245,205,70,0,219,188,107,136,178,58,1,29,44,213,225,147,190,96,192,108,228,15,203,18,3,222,180,68,101,229,223,203,243,164,92,165,220,159,174,121,112,167,240,40,59,3,230,52,149,148,218,142,212,109,176,71,179,172,77,1,193,70,147,149,23,144,148,239,195,186,86,30,34,143,156,207,63,55,117,255,222,222,219,145,224,191,210,109,86,153,21,32,226,10,60,63,106,236,93,96,30,163,106,238,147,133,132,107,152,214,221,185,202,21,252,51,130,59,166,202,127,170,58,193,215,125,22,58,135,47,88,142,77,211, }; + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_soln_meta_dep_a_t* test_msg = ( msg_soln_meta_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->age_corrections = 48671; - test_msg->alignment_status = 115; - test_msg->hdop = 31133; - test_msg->last_used_gnss_pos_tow = 610745181; - test_msg->last_used_gnss_vel_tow = 782016851; - test_msg->n_sats = 238; - test_msg->pdop = 57015; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[0].flags = 67; - test_msg->sol_in[0].sensor_type = 253; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[1].flags = 200; - test_msg->sol_in[1].sensor_type = 87; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[2].flags = 250; - test_msg->sol_in[2].sensor_type = 39; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[3].flags = 242; - test_msg->sol_in[3].sensor_type = 245; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[4].flags = 72; - test_msg->sol_in[4].sensor_type = 228; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[5].flags = 222; - test_msg->sol_in[5].sensor_type = 18; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[6].flags = 88; - test_msg->sol_in[6].sensor_type = 11; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[7].flags = 218; - test_msg->sol_in[7].sensor_type = 207; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[8].flags = 13; - test_msg->sol_in[8].sensor_type = 231; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[9].flags = 224; - test_msg->sol_in[9].sensor_type = 226; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[10].flags = 196; - test_msg->sol_in[10].sensor_type = 22; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[11].flags = 242; - test_msg->sol_in[11].sensor_type = 21; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[12].flags = 89; - test_msg->sol_in[12].sensor_type = 12; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[13].flags = 219; - test_msg->sol_in[13].sensor_type = 71; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[14].flags = 85; - test_msg->sol_in[14].sensor_type = 182; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[15].flags = 204; - test_msg->sol_in[15].sensor_type = 145; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[16].flags = 40; - test_msg->sol_in[16].sensor_type = 146; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[17].flags = 51; - test_msg->sol_in[17].sensor_type = 204; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[18].flags = 153; - test_msg->sol_in[18].sensor_type = 21; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[19].flags = 44; - test_msg->sol_in[19].sensor_type = 227; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[20].flags = 28; - test_msg->sol_in[20].sensor_type = 15; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[21].flags = 39; - test_msg->sol_in[21].sensor_type = 255; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[22].flags = 216; - test_msg->sol_in[22].sensor_type = 205; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[23].flags = 190; - test_msg->sol_in[23].sensor_type = 240; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[24].flags = 219; - test_msg->sol_in[24].sensor_type = 93; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[25].flags = 42; - test_msg->sol_in[25].sensor_type = 103; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[26].flags = 182; - test_msg->sol_in[26].sensor_type = 41; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[27].flags = 222; - test_msg->sol_in[27].sensor_type = 76; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[28].flags = 23; - test_msg->sol_in[28].sensor_type = 17; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[29].flags = 31; - test_msg->sol_in[29].sensor_type = 125; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[30].flags = 229; - test_msg->sol_in[30].sensor_type = 18; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[31].flags = 47; - test_msg->sol_in[31].sensor_type = 28; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[32].flags = 25; - test_msg->sol_in[32].sensor_type = 214; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[33].flags = 84; - test_msg->sol_in[33].sensor_type = 100; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[34].flags = 72; - test_msg->sol_in[34].sensor_type = 106; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[35].flags = 10; - test_msg->sol_in[35].sensor_type = 48; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[36].flags = 232; - test_msg->sol_in[36].sensor_type = 222; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[37].flags = 73; - test_msg->sol_in[37].sensor_type = 235; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[38].flags = 163; - test_msg->sol_in[38].sensor_type = 109; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[39].flags = 152; - test_msg->sol_in[39].sensor_type = 51; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[40].flags = 235; - test_msg->sol_in[40].sensor_type = 133; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[41].flags = 70; - test_msg->sol_in[41].sensor_type = 87; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[42].flags = 108; - test_msg->sol_in[42].sensor_type = 2; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[43].flags = 101; - test_msg->sol_in[43].sensor_type = 91; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[44].flags = 55; - test_msg->sol_in[44].sensor_type = 200; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[45].flags = 156; - test_msg->sol_in[45].sensor_type = 24; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[46].flags = 73; - test_msg->sol_in[46].sensor_type = 233; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[47].flags = 66; - test_msg->sol_in[47].sensor_type = 39; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[48].flags = 140; - test_msg->sol_in[48].sensor_type = 97; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[49].flags = 227; - test_msg->sol_in[49].sensor_type = 252; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[50].flags = 237; - test_msg->sol_in[50].sensor_type = 230; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[51].flags = 241; - test_msg->sol_in[51].sensor_type = 135; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[52].flags = 205; - test_msg->sol_in[52].sensor_type = 245; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[53].flags = 0; - test_msg->sol_in[53].sensor_type = 70; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[54].flags = 188; - test_msg->sol_in[54].sensor_type = 219; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[55].flags = 136; - test_msg->sol_in[55].sensor_type = 107; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[56].flags = 58; - test_msg->sol_in[56].sensor_type = 178; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[57].flags = 29; - test_msg->sol_in[57].sensor_type = 1; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[58].flags = 213; - test_msg->sol_in[58].sensor_type = 44; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[59].flags = 147; - test_msg->sol_in[59].sensor_type = 225; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[60].flags = 96; - test_msg->sol_in[60].sensor_type = 190; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[61].flags = 108; - test_msg->sol_in[61].sensor_type = 192; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[62].flags = 15; - test_msg->sol_in[62].sensor_type = 228; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[63].flags = 18; - test_msg->sol_in[63].sensor_type = 203; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[64].flags = 222; - test_msg->sol_in[64].sensor_type = 3; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[65].flags = 68; - test_msg->sol_in[65].sensor_type = 180; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[66].flags = 229; - test_msg->sol_in[66].sensor_type = 101; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[67].flags = 203; - test_msg->sol_in[67].sensor_type = 223; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[68].flags = 164; - test_msg->sol_in[68].sensor_type = 243; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[69].flags = 165; - test_msg->sol_in[69].sensor_type = 92; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[70].flags = 159; - test_msg->sol_in[70].sensor_type = 220; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[71].flags = 121; - test_msg->sol_in[71].sensor_type = 174; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[72].flags = 167; - test_msg->sol_in[72].sensor_type = 112; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[73].flags = 40; - test_msg->sol_in[73].sensor_type = 240; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[74].flags = 3; - test_msg->sol_in[74].sensor_type = 59; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[75].flags = 52; - test_msg->sol_in[75].sensor_type = 230; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[76].flags = 148; - test_msg->sol_in[76].sensor_type = 149; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[77].flags = 142; - test_msg->sol_in[77].sensor_type = 218; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[78].flags = 109; - test_msg->sol_in[78].sensor_type = 212; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[79].flags = 71; - test_msg->sol_in[79].sensor_type = 176; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[80].flags = 172; - test_msg->sol_in[80].sensor_type = 179; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[81].flags = 1; - test_msg->sol_in[81].sensor_type = 77; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[82].flags = 70; - test_msg->sol_in[82].sensor_type = 193; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[83].flags = 149; - test_msg->sol_in[83].sensor_type = 147; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[84].flags = 144; - test_msg->sol_in[84].sensor_type = 23; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[85].flags = 239; - test_msg->sol_in[85].sensor_type = 148; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[86].flags = 186; - test_msg->sol_in[86].sensor_type = 195; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[87].flags = 30; - test_msg->sol_in[87].sensor_type = 86; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[88].flags = 143; - test_msg->sol_in[88].sensor_type = 34; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[89].flags = 207; - test_msg->sol_in[89].sensor_type = 156; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[90].flags = 55; - test_msg->sol_in[90].sensor_type = 63; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[91].flags = 255; - test_msg->sol_in[91].sensor_type = 117; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[92].flags = 222; - test_msg->sol_in[92].sensor_type = 222; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[93].flags = 145; - test_msg->sol_in[93].sensor_type = 219; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[94].flags = 191; - test_msg->sol_in[94].sensor_type = 224; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[95].flags = 109; - test_msg->sol_in[95].sensor_type = 210; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[96].flags = 153; - test_msg->sol_in[96].sensor_type = 86; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[97].flags = 32; - test_msg->sol_in[97].sensor_type = 21; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[98].flags = 10; - test_msg->sol_in[98].sensor_type = 226; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[99].flags = 63; - test_msg->sol_in[99].sensor_type = 60; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[100].flags = 236; - test_msg->sol_in[100].sensor_type = 106; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[101].flags = 96; - test_msg->sol_in[101].sensor_type = 93; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[102].flags = 163; - test_msg->sol_in[102].sensor_type = 30; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[103].flags = 238; - test_msg->sol_in[103].sensor_type = 106; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[104].flags = 133; - test_msg->sol_in[104].sensor_type = 147; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[105].flags = 107; - test_msg->sol_in[105].sensor_type = 132; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[106].flags = 214; - test_msg->sol_in[106].sensor_type = 152; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[107].flags = 185; - test_msg->sol_in[107].sensor_type = 221; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[108].flags = 21; - test_msg->sol_in[108].sensor_type = 202; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[109].flags = 51; - test_msg->sol_in[109].sensor_type = 252; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[110].flags = 59; - test_msg->sol_in[110].sensor_type = 130; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[111].flags = 202; - test_msg->sol_in[111].sensor_type = 166; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[112].flags = 170; - test_msg->sol_in[112].sensor_type = 127; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[113].flags = 193; - test_msg->sol_in[113].sensor_type = 58; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[114].flags = 125; - test_msg->sol_in[114].sensor_type = 215; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[115].flags = 58; - test_msg->sol_in[115].sensor_type = 22; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[116].flags = 47; - test_msg->sol_in[116].sensor_type = 135; - if (sizeof(test_msg->sol_in) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sol_in[0])); - } - test_msg->sol_in[117].flags = 142; - test_msg->sol_in[117].sensor_type = 88; - test_msg->vdop = 41989; - - EXPECT_EQ(send_message( 0xff0f, 61780, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61780); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->age_corrections, 48671) << "incorrect value for age_corrections, expected 48671, is " << last_msg_->age_corrections; - EXPECT_EQ(last_msg_->alignment_status, 115) << "incorrect value for alignment_status, expected 115, is " << last_msg_->alignment_status; - EXPECT_EQ(last_msg_->hdop, 31133) << "incorrect value for hdop, expected 31133, is " << last_msg_->hdop; - EXPECT_EQ(last_msg_->last_used_gnss_pos_tow, 610745181) << "incorrect value for last_used_gnss_pos_tow, expected 610745181, is " << last_msg_->last_used_gnss_pos_tow; - EXPECT_EQ(last_msg_->last_used_gnss_vel_tow, 782016851) << "incorrect value for last_used_gnss_vel_tow, expected 782016851, is " << last_msg_->last_used_gnss_vel_tow; - EXPECT_EQ(last_msg_->n_sats, 238) << "incorrect value for n_sats, expected 238, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->pdop, 57015) << "incorrect value for pdop, expected 57015, is " << last_msg_->pdop; - EXPECT_EQ(last_msg_->sol_in[0].flags, 67) << "incorrect value for sol_in[0].flags, expected 67, is " << last_msg_->sol_in[0].flags; - EXPECT_EQ(last_msg_->sol_in[0].sensor_type, 253) << "incorrect value for sol_in[0].sensor_type, expected 253, is " << last_msg_->sol_in[0].sensor_type; - EXPECT_EQ(last_msg_->sol_in[1].flags, 200) << "incorrect value for sol_in[1].flags, expected 200, is " << last_msg_->sol_in[1].flags; - EXPECT_EQ(last_msg_->sol_in[1].sensor_type, 87) << "incorrect value for sol_in[1].sensor_type, expected 87, is " << last_msg_->sol_in[1].sensor_type; - EXPECT_EQ(last_msg_->sol_in[2].flags, 250) << "incorrect value for sol_in[2].flags, expected 250, is " << last_msg_->sol_in[2].flags; - EXPECT_EQ(last_msg_->sol_in[2].sensor_type, 39) << "incorrect value for sol_in[2].sensor_type, expected 39, is " << last_msg_->sol_in[2].sensor_type; - EXPECT_EQ(last_msg_->sol_in[3].flags, 242) << "incorrect value for sol_in[3].flags, expected 242, is " << last_msg_->sol_in[3].flags; - EXPECT_EQ(last_msg_->sol_in[3].sensor_type, 245) << "incorrect value for sol_in[3].sensor_type, expected 245, is " << last_msg_->sol_in[3].sensor_type; - EXPECT_EQ(last_msg_->sol_in[4].flags, 72) << "incorrect value for sol_in[4].flags, expected 72, is " << last_msg_->sol_in[4].flags; - EXPECT_EQ(last_msg_->sol_in[4].sensor_type, 228) << "incorrect value for sol_in[4].sensor_type, expected 228, is " << last_msg_->sol_in[4].sensor_type; - EXPECT_EQ(last_msg_->sol_in[5].flags, 222) << "incorrect value for sol_in[5].flags, expected 222, is " << last_msg_->sol_in[5].flags; - EXPECT_EQ(last_msg_->sol_in[5].sensor_type, 18) << "incorrect value for sol_in[5].sensor_type, expected 18, is " << last_msg_->sol_in[5].sensor_type; - EXPECT_EQ(last_msg_->sol_in[6].flags, 88) << "incorrect value for sol_in[6].flags, expected 88, is " << last_msg_->sol_in[6].flags; - EXPECT_EQ(last_msg_->sol_in[6].sensor_type, 11) << "incorrect value for sol_in[6].sensor_type, expected 11, is " << last_msg_->sol_in[6].sensor_type; - EXPECT_EQ(last_msg_->sol_in[7].flags, 218) << "incorrect value for sol_in[7].flags, expected 218, is " << last_msg_->sol_in[7].flags; - EXPECT_EQ(last_msg_->sol_in[7].sensor_type, 207) << "incorrect value for sol_in[7].sensor_type, expected 207, is " << last_msg_->sol_in[7].sensor_type; - EXPECT_EQ(last_msg_->sol_in[8].flags, 13) << "incorrect value for sol_in[8].flags, expected 13, is " << last_msg_->sol_in[8].flags; - EXPECT_EQ(last_msg_->sol_in[8].sensor_type, 231) << "incorrect value for sol_in[8].sensor_type, expected 231, is " << last_msg_->sol_in[8].sensor_type; - EXPECT_EQ(last_msg_->sol_in[9].flags, 224) << "incorrect value for sol_in[9].flags, expected 224, is " << last_msg_->sol_in[9].flags; - EXPECT_EQ(last_msg_->sol_in[9].sensor_type, 226) << "incorrect value for sol_in[9].sensor_type, expected 226, is " << last_msg_->sol_in[9].sensor_type; - EXPECT_EQ(last_msg_->sol_in[10].flags, 196) << "incorrect value for sol_in[10].flags, expected 196, is " << last_msg_->sol_in[10].flags; - EXPECT_EQ(last_msg_->sol_in[10].sensor_type, 22) << "incorrect value for sol_in[10].sensor_type, expected 22, is " << last_msg_->sol_in[10].sensor_type; - EXPECT_EQ(last_msg_->sol_in[11].flags, 242) << "incorrect value for sol_in[11].flags, expected 242, is " << last_msg_->sol_in[11].flags; - EXPECT_EQ(last_msg_->sol_in[11].sensor_type, 21) << "incorrect value for sol_in[11].sensor_type, expected 21, is " << last_msg_->sol_in[11].sensor_type; - EXPECT_EQ(last_msg_->sol_in[12].flags, 89) << "incorrect value for sol_in[12].flags, expected 89, is " << last_msg_->sol_in[12].flags; - EXPECT_EQ(last_msg_->sol_in[12].sensor_type, 12) << "incorrect value for sol_in[12].sensor_type, expected 12, is " << last_msg_->sol_in[12].sensor_type; - EXPECT_EQ(last_msg_->sol_in[13].flags, 219) << "incorrect value for sol_in[13].flags, expected 219, is " << last_msg_->sol_in[13].flags; - EXPECT_EQ(last_msg_->sol_in[13].sensor_type, 71) << "incorrect value for sol_in[13].sensor_type, expected 71, is " << last_msg_->sol_in[13].sensor_type; - EXPECT_EQ(last_msg_->sol_in[14].flags, 85) << "incorrect value for sol_in[14].flags, expected 85, is " << last_msg_->sol_in[14].flags; - EXPECT_EQ(last_msg_->sol_in[14].sensor_type, 182) << "incorrect value for sol_in[14].sensor_type, expected 182, is " << last_msg_->sol_in[14].sensor_type; - EXPECT_EQ(last_msg_->sol_in[15].flags, 204) << "incorrect value for sol_in[15].flags, expected 204, is " << last_msg_->sol_in[15].flags; - EXPECT_EQ(last_msg_->sol_in[15].sensor_type, 145) << "incorrect value for sol_in[15].sensor_type, expected 145, is " << last_msg_->sol_in[15].sensor_type; - EXPECT_EQ(last_msg_->sol_in[16].flags, 40) << "incorrect value for sol_in[16].flags, expected 40, is " << last_msg_->sol_in[16].flags; - EXPECT_EQ(last_msg_->sol_in[16].sensor_type, 146) << "incorrect value for sol_in[16].sensor_type, expected 146, is " << last_msg_->sol_in[16].sensor_type; - EXPECT_EQ(last_msg_->sol_in[17].flags, 51) << "incorrect value for sol_in[17].flags, expected 51, is " << last_msg_->sol_in[17].flags; - EXPECT_EQ(last_msg_->sol_in[17].sensor_type, 204) << "incorrect value for sol_in[17].sensor_type, expected 204, is " << last_msg_->sol_in[17].sensor_type; - EXPECT_EQ(last_msg_->sol_in[18].flags, 153) << "incorrect value for sol_in[18].flags, expected 153, is " << last_msg_->sol_in[18].flags; - EXPECT_EQ(last_msg_->sol_in[18].sensor_type, 21) << "incorrect value for sol_in[18].sensor_type, expected 21, is " << last_msg_->sol_in[18].sensor_type; - EXPECT_EQ(last_msg_->sol_in[19].flags, 44) << "incorrect value for sol_in[19].flags, expected 44, is " << last_msg_->sol_in[19].flags; - EXPECT_EQ(last_msg_->sol_in[19].sensor_type, 227) << "incorrect value for sol_in[19].sensor_type, expected 227, is " << last_msg_->sol_in[19].sensor_type; - EXPECT_EQ(last_msg_->sol_in[20].flags, 28) << "incorrect value for sol_in[20].flags, expected 28, is " << last_msg_->sol_in[20].flags; - EXPECT_EQ(last_msg_->sol_in[20].sensor_type, 15) << "incorrect value for sol_in[20].sensor_type, expected 15, is " << last_msg_->sol_in[20].sensor_type; - EXPECT_EQ(last_msg_->sol_in[21].flags, 39) << "incorrect value for sol_in[21].flags, expected 39, is " << last_msg_->sol_in[21].flags; - EXPECT_EQ(last_msg_->sol_in[21].sensor_type, 255) << "incorrect value for sol_in[21].sensor_type, expected 255, is " << last_msg_->sol_in[21].sensor_type; - EXPECT_EQ(last_msg_->sol_in[22].flags, 216) << "incorrect value for sol_in[22].flags, expected 216, is " << last_msg_->sol_in[22].flags; - EXPECT_EQ(last_msg_->sol_in[22].sensor_type, 205) << "incorrect value for sol_in[22].sensor_type, expected 205, is " << last_msg_->sol_in[22].sensor_type; - EXPECT_EQ(last_msg_->sol_in[23].flags, 190) << "incorrect value for sol_in[23].flags, expected 190, is " << last_msg_->sol_in[23].flags; - EXPECT_EQ(last_msg_->sol_in[23].sensor_type, 240) << "incorrect value for sol_in[23].sensor_type, expected 240, is " << last_msg_->sol_in[23].sensor_type; - EXPECT_EQ(last_msg_->sol_in[24].flags, 219) << "incorrect value for sol_in[24].flags, expected 219, is " << last_msg_->sol_in[24].flags; - EXPECT_EQ(last_msg_->sol_in[24].sensor_type, 93) << "incorrect value for sol_in[24].sensor_type, expected 93, is " << last_msg_->sol_in[24].sensor_type; - EXPECT_EQ(last_msg_->sol_in[25].flags, 42) << "incorrect value for sol_in[25].flags, expected 42, is " << last_msg_->sol_in[25].flags; - EXPECT_EQ(last_msg_->sol_in[25].sensor_type, 103) << "incorrect value for sol_in[25].sensor_type, expected 103, is " << last_msg_->sol_in[25].sensor_type; - EXPECT_EQ(last_msg_->sol_in[26].flags, 182) << "incorrect value for sol_in[26].flags, expected 182, is " << last_msg_->sol_in[26].flags; - EXPECT_EQ(last_msg_->sol_in[26].sensor_type, 41) << "incorrect value for sol_in[26].sensor_type, expected 41, is " << last_msg_->sol_in[26].sensor_type; - EXPECT_EQ(last_msg_->sol_in[27].flags, 222) << "incorrect value for sol_in[27].flags, expected 222, is " << last_msg_->sol_in[27].flags; - EXPECT_EQ(last_msg_->sol_in[27].sensor_type, 76) << "incorrect value for sol_in[27].sensor_type, expected 76, is " << last_msg_->sol_in[27].sensor_type; - EXPECT_EQ(last_msg_->sol_in[28].flags, 23) << "incorrect value for sol_in[28].flags, expected 23, is " << last_msg_->sol_in[28].flags; - EXPECT_EQ(last_msg_->sol_in[28].sensor_type, 17) << "incorrect value for sol_in[28].sensor_type, expected 17, is " << last_msg_->sol_in[28].sensor_type; - EXPECT_EQ(last_msg_->sol_in[29].flags, 31) << "incorrect value for sol_in[29].flags, expected 31, is " << last_msg_->sol_in[29].flags; - EXPECT_EQ(last_msg_->sol_in[29].sensor_type, 125) << "incorrect value for sol_in[29].sensor_type, expected 125, is " << last_msg_->sol_in[29].sensor_type; - EXPECT_EQ(last_msg_->sol_in[30].flags, 229) << "incorrect value for sol_in[30].flags, expected 229, is " << last_msg_->sol_in[30].flags; - EXPECT_EQ(last_msg_->sol_in[30].sensor_type, 18) << "incorrect value for sol_in[30].sensor_type, expected 18, is " << last_msg_->sol_in[30].sensor_type; - EXPECT_EQ(last_msg_->sol_in[31].flags, 47) << "incorrect value for sol_in[31].flags, expected 47, is " << last_msg_->sol_in[31].flags; - EXPECT_EQ(last_msg_->sol_in[31].sensor_type, 28) << "incorrect value for sol_in[31].sensor_type, expected 28, is " << last_msg_->sol_in[31].sensor_type; - EXPECT_EQ(last_msg_->sol_in[32].flags, 25) << "incorrect value for sol_in[32].flags, expected 25, is " << last_msg_->sol_in[32].flags; - EXPECT_EQ(last_msg_->sol_in[32].sensor_type, 214) << "incorrect value for sol_in[32].sensor_type, expected 214, is " << last_msg_->sol_in[32].sensor_type; - EXPECT_EQ(last_msg_->sol_in[33].flags, 84) << "incorrect value for sol_in[33].flags, expected 84, is " << last_msg_->sol_in[33].flags; - EXPECT_EQ(last_msg_->sol_in[33].sensor_type, 100) << "incorrect value for sol_in[33].sensor_type, expected 100, is " << last_msg_->sol_in[33].sensor_type; - EXPECT_EQ(last_msg_->sol_in[34].flags, 72) << "incorrect value for sol_in[34].flags, expected 72, is " << last_msg_->sol_in[34].flags; - EXPECT_EQ(last_msg_->sol_in[34].sensor_type, 106) << "incorrect value for sol_in[34].sensor_type, expected 106, is " << last_msg_->sol_in[34].sensor_type; - EXPECT_EQ(last_msg_->sol_in[35].flags, 10) << "incorrect value for sol_in[35].flags, expected 10, is " << last_msg_->sol_in[35].flags; - EXPECT_EQ(last_msg_->sol_in[35].sensor_type, 48) << "incorrect value for sol_in[35].sensor_type, expected 48, is " << last_msg_->sol_in[35].sensor_type; - EXPECT_EQ(last_msg_->sol_in[36].flags, 232) << "incorrect value for sol_in[36].flags, expected 232, is " << last_msg_->sol_in[36].flags; - EXPECT_EQ(last_msg_->sol_in[36].sensor_type, 222) << "incorrect value for sol_in[36].sensor_type, expected 222, is " << last_msg_->sol_in[36].sensor_type; - EXPECT_EQ(last_msg_->sol_in[37].flags, 73) << "incorrect value for sol_in[37].flags, expected 73, is " << last_msg_->sol_in[37].flags; - EXPECT_EQ(last_msg_->sol_in[37].sensor_type, 235) << "incorrect value for sol_in[37].sensor_type, expected 235, is " << last_msg_->sol_in[37].sensor_type; - EXPECT_EQ(last_msg_->sol_in[38].flags, 163) << "incorrect value for sol_in[38].flags, expected 163, is " << last_msg_->sol_in[38].flags; - EXPECT_EQ(last_msg_->sol_in[38].sensor_type, 109) << "incorrect value for sol_in[38].sensor_type, expected 109, is " << last_msg_->sol_in[38].sensor_type; - EXPECT_EQ(last_msg_->sol_in[39].flags, 152) << "incorrect value for sol_in[39].flags, expected 152, is " << last_msg_->sol_in[39].flags; - EXPECT_EQ(last_msg_->sol_in[39].sensor_type, 51) << "incorrect value for sol_in[39].sensor_type, expected 51, is " << last_msg_->sol_in[39].sensor_type; - EXPECT_EQ(last_msg_->sol_in[40].flags, 235) << "incorrect value for sol_in[40].flags, expected 235, is " << last_msg_->sol_in[40].flags; - EXPECT_EQ(last_msg_->sol_in[40].sensor_type, 133) << "incorrect value for sol_in[40].sensor_type, expected 133, is " << last_msg_->sol_in[40].sensor_type; - EXPECT_EQ(last_msg_->sol_in[41].flags, 70) << "incorrect value for sol_in[41].flags, expected 70, is " << last_msg_->sol_in[41].flags; - EXPECT_EQ(last_msg_->sol_in[41].sensor_type, 87) << "incorrect value for sol_in[41].sensor_type, expected 87, is " << last_msg_->sol_in[41].sensor_type; - EXPECT_EQ(last_msg_->sol_in[42].flags, 108) << "incorrect value for sol_in[42].flags, expected 108, is " << last_msg_->sol_in[42].flags; - EXPECT_EQ(last_msg_->sol_in[42].sensor_type, 2) << "incorrect value for sol_in[42].sensor_type, expected 2, is " << last_msg_->sol_in[42].sensor_type; - EXPECT_EQ(last_msg_->sol_in[43].flags, 101) << "incorrect value for sol_in[43].flags, expected 101, is " << last_msg_->sol_in[43].flags; - EXPECT_EQ(last_msg_->sol_in[43].sensor_type, 91) << "incorrect value for sol_in[43].sensor_type, expected 91, is " << last_msg_->sol_in[43].sensor_type; - EXPECT_EQ(last_msg_->sol_in[44].flags, 55) << "incorrect value for sol_in[44].flags, expected 55, is " << last_msg_->sol_in[44].flags; - EXPECT_EQ(last_msg_->sol_in[44].sensor_type, 200) << "incorrect value for sol_in[44].sensor_type, expected 200, is " << last_msg_->sol_in[44].sensor_type; - EXPECT_EQ(last_msg_->sol_in[45].flags, 156) << "incorrect value for sol_in[45].flags, expected 156, is " << last_msg_->sol_in[45].flags; - EXPECT_EQ(last_msg_->sol_in[45].sensor_type, 24) << "incorrect value for sol_in[45].sensor_type, expected 24, is " << last_msg_->sol_in[45].sensor_type; - EXPECT_EQ(last_msg_->sol_in[46].flags, 73) << "incorrect value for sol_in[46].flags, expected 73, is " << last_msg_->sol_in[46].flags; - EXPECT_EQ(last_msg_->sol_in[46].sensor_type, 233) << "incorrect value for sol_in[46].sensor_type, expected 233, is " << last_msg_->sol_in[46].sensor_type; - EXPECT_EQ(last_msg_->sol_in[47].flags, 66) << "incorrect value for sol_in[47].flags, expected 66, is " << last_msg_->sol_in[47].flags; - EXPECT_EQ(last_msg_->sol_in[47].sensor_type, 39) << "incorrect value for sol_in[47].sensor_type, expected 39, is " << last_msg_->sol_in[47].sensor_type; - EXPECT_EQ(last_msg_->sol_in[48].flags, 140) << "incorrect value for sol_in[48].flags, expected 140, is " << last_msg_->sol_in[48].flags; - EXPECT_EQ(last_msg_->sol_in[48].sensor_type, 97) << "incorrect value for sol_in[48].sensor_type, expected 97, is " << last_msg_->sol_in[48].sensor_type; - EXPECT_EQ(last_msg_->sol_in[49].flags, 227) << "incorrect value for sol_in[49].flags, expected 227, is " << last_msg_->sol_in[49].flags; - EXPECT_EQ(last_msg_->sol_in[49].sensor_type, 252) << "incorrect value for sol_in[49].sensor_type, expected 252, is " << last_msg_->sol_in[49].sensor_type; - EXPECT_EQ(last_msg_->sol_in[50].flags, 237) << "incorrect value for sol_in[50].flags, expected 237, is " << last_msg_->sol_in[50].flags; - EXPECT_EQ(last_msg_->sol_in[50].sensor_type, 230) << "incorrect value for sol_in[50].sensor_type, expected 230, is " << last_msg_->sol_in[50].sensor_type; - EXPECT_EQ(last_msg_->sol_in[51].flags, 241) << "incorrect value for sol_in[51].flags, expected 241, is " << last_msg_->sol_in[51].flags; - EXPECT_EQ(last_msg_->sol_in[51].sensor_type, 135) << "incorrect value for sol_in[51].sensor_type, expected 135, is " << last_msg_->sol_in[51].sensor_type; - EXPECT_EQ(last_msg_->sol_in[52].flags, 205) << "incorrect value for sol_in[52].flags, expected 205, is " << last_msg_->sol_in[52].flags; - EXPECT_EQ(last_msg_->sol_in[52].sensor_type, 245) << "incorrect value for sol_in[52].sensor_type, expected 245, is " << last_msg_->sol_in[52].sensor_type; - EXPECT_EQ(last_msg_->sol_in[53].flags, 0) << "incorrect value for sol_in[53].flags, expected 0, is " << last_msg_->sol_in[53].flags; - EXPECT_EQ(last_msg_->sol_in[53].sensor_type, 70) << "incorrect value for sol_in[53].sensor_type, expected 70, is " << last_msg_->sol_in[53].sensor_type; - EXPECT_EQ(last_msg_->sol_in[54].flags, 188) << "incorrect value for sol_in[54].flags, expected 188, is " << last_msg_->sol_in[54].flags; - EXPECT_EQ(last_msg_->sol_in[54].sensor_type, 219) << "incorrect value for sol_in[54].sensor_type, expected 219, is " << last_msg_->sol_in[54].sensor_type; - EXPECT_EQ(last_msg_->sol_in[55].flags, 136) << "incorrect value for sol_in[55].flags, expected 136, is " << last_msg_->sol_in[55].flags; - EXPECT_EQ(last_msg_->sol_in[55].sensor_type, 107) << "incorrect value for sol_in[55].sensor_type, expected 107, is " << last_msg_->sol_in[55].sensor_type; - EXPECT_EQ(last_msg_->sol_in[56].flags, 58) << "incorrect value for sol_in[56].flags, expected 58, is " << last_msg_->sol_in[56].flags; - EXPECT_EQ(last_msg_->sol_in[56].sensor_type, 178) << "incorrect value for sol_in[56].sensor_type, expected 178, is " << last_msg_->sol_in[56].sensor_type; - EXPECT_EQ(last_msg_->sol_in[57].flags, 29) << "incorrect value for sol_in[57].flags, expected 29, is " << last_msg_->sol_in[57].flags; - EXPECT_EQ(last_msg_->sol_in[57].sensor_type, 1) << "incorrect value for sol_in[57].sensor_type, expected 1, is " << last_msg_->sol_in[57].sensor_type; - EXPECT_EQ(last_msg_->sol_in[58].flags, 213) << "incorrect value for sol_in[58].flags, expected 213, is " << last_msg_->sol_in[58].flags; - EXPECT_EQ(last_msg_->sol_in[58].sensor_type, 44) << "incorrect value for sol_in[58].sensor_type, expected 44, is " << last_msg_->sol_in[58].sensor_type; - EXPECT_EQ(last_msg_->sol_in[59].flags, 147) << "incorrect value for sol_in[59].flags, expected 147, is " << last_msg_->sol_in[59].flags; - EXPECT_EQ(last_msg_->sol_in[59].sensor_type, 225) << "incorrect value for sol_in[59].sensor_type, expected 225, is " << last_msg_->sol_in[59].sensor_type; - EXPECT_EQ(last_msg_->sol_in[60].flags, 96) << "incorrect value for sol_in[60].flags, expected 96, is " << last_msg_->sol_in[60].flags; - EXPECT_EQ(last_msg_->sol_in[60].sensor_type, 190) << "incorrect value for sol_in[60].sensor_type, expected 190, is " << last_msg_->sol_in[60].sensor_type; - EXPECT_EQ(last_msg_->sol_in[61].flags, 108) << "incorrect value for sol_in[61].flags, expected 108, is " << last_msg_->sol_in[61].flags; - EXPECT_EQ(last_msg_->sol_in[61].sensor_type, 192) << "incorrect value for sol_in[61].sensor_type, expected 192, is " << last_msg_->sol_in[61].sensor_type; - EXPECT_EQ(last_msg_->sol_in[62].flags, 15) << "incorrect value for sol_in[62].flags, expected 15, is " << last_msg_->sol_in[62].flags; - EXPECT_EQ(last_msg_->sol_in[62].sensor_type, 228) << "incorrect value for sol_in[62].sensor_type, expected 228, is " << last_msg_->sol_in[62].sensor_type; - EXPECT_EQ(last_msg_->sol_in[63].flags, 18) << "incorrect value for sol_in[63].flags, expected 18, is " << last_msg_->sol_in[63].flags; - EXPECT_EQ(last_msg_->sol_in[63].sensor_type, 203) << "incorrect value for sol_in[63].sensor_type, expected 203, is " << last_msg_->sol_in[63].sensor_type; - EXPECT_EQ(last_msg_->sol_in[64].flags, 222) << "incorrect value for sol_in[64].flags, expected 222, is " << last_msg_->sol_in[64].flags; - EXPECT_EQ(last_msg_->sol_in[64].sensor_type, 3) << "incorrect value for sol_in[64].sensor_type, expected 3, is " << last_msg_->sol_in[64].sensor_type; - EXPECT_EQ(last_msg_->sol_in[65].flags, 68) << "incorrect value for sol_in[65].flags, expected 68, is " << last_msg_->sol_in[65].flags; - EXPECT_EQ(last_msg_->sol_in[65].sensor_type, 180) << "incorrect value for sol_in[65].sensor_type, expected 180, is " << last_msg_->sol_in[65].sensor_type; - EXPECT_EQ(last_msg_->sol_in[66].flags, 229) << "incorrect value for sol_in[66].flags, expected 229, is " << last_msg_->sol_in[66].flags; - EXPECT_EQ(last_msg_->sol_in[66].sensor_type, 101) << "incorrect value for sol_in[66].sensor_type, expected 101, is " << last_msg_->sol_in[66].sensor_type; - EXPECT_EQ(last_msg_->sol_in[67].flags, 203) << "incorrect value for sol_in[67].flags, expected 203, is " << last_msg_->sol_in[67].flags; - EXPECT_EQ(last_msg_->sol_in[67].sensor_type, 223) << "incorrect value for sol_in[67].sensor_type, expected 223, is " << last_msg_->sol_in[67].sensor_type; - EXPECT_EQ(last_msg_->sol_in[68].flags, 164) << "incorrect value for sol_in[68].flags, expected 164, is " << last_msg_->sol_in[68].flags; - EXPECT_EQ(last_msg_->sol_in[68].sensor_type, 243) << "incorrect value for sol_in[68].sensor_type, expected 243, is " << last_msg_->sol_in[68].sensor_type; - EXPECT_EQ(last_msg_->sol_in[69].flags, 165) << "incorrect value for sol_in[69].flags, expected 165, is " << last_msg_->sol_in[69].flags; - EXPECT_EQ(last_msg_->sol_in[69].sensor_type, 92) << "incorrect value for sol_in[69].sensor_type, expected 92, is " << last_msg_->sol_in[69].sensor_type; - EXPECT_EQ(last_msg_->sol_in[70].flags, 159) << "incorrect value for sol_in[70].flags, expected 159, is " << last_msg_->sol_in[70].flags; - EXPECT_EQ(last_msg_->sol_in[70].sensor_type, 220) << "incorrect value for sol_in[70].sensor_type, expected 220, is " << last_msg_->sol_in[70].sensor_type; - EXPECT_EQ(last_msg_->sol_in[71].flags, 121) << "incorrect value for sol_in[71].flags, expected 121, is " << last_msg_->sol_in[71].flags; - EXPECT_EQ(last_msg_->sol_in[71].sensor_type, 174) << "incorrect value for sol_in[71].sensor_type, expected 174, is " << last_msg_->sol_in[71].sensor_type; - EXPECT_EQ(last_msg_->sol_in[72].flags, 167) << "incorrect value for sol_in[72].flags, expected 167, is " << last_msg_->sol_in[72].flags; - EXPECT_EQ(last_msg_->sol_in[72].sensor_type, 112) << "incorrect value for sol_in[72].sensor_type, expected 112, is " << last_msg_->sol_in[72].sensor_type; - EXPECT_EQ(last_msg_->sol_in[73].flags, 40) << "incorrect value for sol_in[73].flags, expected 40, is " << last_msg_->sol_in[73].flags; - EXPECT_EQ(last_msg_->sol_in[73].sensor_type, 240) << "incorrect value for sol_in[73].sensor_type, expected 240, is " << last_msg_->sol_in[73].sensor_type; - EXPECT_EQ(last_msg_->sol_in[74].flags, 3) << "incorrect value for sol_in[74].flags, expected 3, is " << last_msg_->sol_in[74].flags; - EXPECT_EQ(last_msg_->sol_in[74].sensor_type, 59) << "incorrect value for sol_in[74].sensor_type, expected 59, is " << last_msg_->sol_in[74].sensor_type; - EXPECT_EQ(last_msg_->sol_in[75].flags, 52) << "incorrect value for sol_in[75].flags, expected 52, is " << last_msg_->sol_in[75].flags; - EXPECT_EQ(last_msg_->sol_in[75].sensor_type, 230) << "incorrect value for sol_in[75].sensor_type, expected 230, is " << last_msg_->sol_in[75].sensor_type; - EXPECT_EQ(last_msg_->sol_in[76].flags, 148) << "incorrect value for sol_in[76].flags, expected 148, is " << last_msg_->sol_in[76].flags; - EXPECT_EQ(last_msg_->sol_in[76].sensor_type, 149) << "incorrect value for sol_in[76].sensor_type, expected 149, is " << last_msg_->sol_in[76].sensor_type; - EXPECT_EQ(last_msg_->sol_in[77].flags, 142) << "incorrect value for sol_in[77].flags, expected 142, is " << last_msg_->sol_in[77].flags; - EXPECT_EQ(last_msg_->sol_in[77].sensor_type, 218) << "incorrect value for sol_in[77].sensor_type, expected 218, is " << last_msg_->sol_in[77].sensor_type; - EXPECT_EQ(last_msg_->sol_in[78].flags, 109) << "incorrect value for sol_in[78].flags, expected 109, is " << last_msg_->sol_in[78].flags; - EXPECT_EQ(last_msg_->sol_in[78].sensor_type, 212) << "incorrect value for sol_in[78].sensor_type, expected 212, is " << last_msg_->sol_in[78].sensor_type; - EXPECT_EQ(last_msg_->sol_in[79].flags, 71) << "incorrect value for sol_in[79].flags, expected 71, is " << last_msg_->sol_in[79].flags; - EXPECT_EQ(last_msg_->sol_in[79].sensor_type, 176) << "incorrect value for sol_in[79].sensor_type, expected 176, is " << last_msg_->sol_in[79].sensor_type; - EXPECT_EQ(last_msg_->sol_in[80].flags, 172) << "incorrect value for sol_in[80].flags, expected 172, is " << last_msg_->sol_in[80].flags; - EXPECT_EQ(last_msg_->sol_in[80].sensor_type, 179) << "incorrect value for sol_in[80].sensor_type, expected 179, is " << last_msg_->sol_in[80].sensor_type; - EXPECT_EQ(last_msg_->sol_in[81].flags, 1) << "incorrect value for sol_in[81].flags, expected 1, is " << last_msg_->sol_in[81].flags; - EXPECT_EQ(last_msg_->sol_in[81].sensor_type, 77) << "incorrect value for sol_in[81].sensor_type, expected 77, is " << last_msg_->sol_in[81].sensor_type; - EXPECT_EQ(last_msg_->sol_in[82].flags, 70) << "incorrect value for sol_in[82].flags, expected 70, is " << last_msg_->sol_in[82].flags; - EXPECT_EQ(last_msg_->sol_in[82].sensor_type, 193) << "incorrect value for sol_in[82].sensor_type, expected 193, is " << last_msg_->sol_in[82].sensor_type; - EXPECT_EQ(last_msg_->sol_in[83].flags, 149) << "incorrect value for sol_in[83].flags, expected 149, is " << last_msg_->sol_in[83].flags; - EXPECT_EQ(last_msg_->sol_in[83].sensor_type, 147) << "incorrect value for sol_in[83].sensor_type, expected 147, is " << last_msg_->sol_in[83].sensor_type; - EXPECT_EQ(last_msg_->sol_in[84].flags, 144) << "incorrect value for sol_in[84].flags, expected 144, is " << last_msg_->sol_in[84].flags; - EXPECT_EQ(last_msg_->sol_in[84].sensor_type, 23) << "incorrect value for sol_in[84].sensor_type, expected 23, is " << last_msg_->sol_in[84].sensor_type; - EXPECT_EQ(last_msg_->sol_in[85].flags, 239) << "incorrect value for sol_in[85].flags, expected 239, is " << last_msg_->sol_in[85].flags; - EXPECT_EQ(last_msg_->sol_in[85].sensor_type, 148) << "incorrect value for sol_in[85].sensor_type, expected 148, is " << last_msg_->sol_in[85].sensor_type; - EXPECT_EQ(last_msg_->sol_in[86].flags, 186) << "incorrect value for sol_in[86].flags, expected 186, is " << last_msg_->sol_in[86].flags; - EXPECT_EQ(last_msg_->sol_in[86].sensor_type, 195) << "incorrect value for sol_in[86].sensor_type, expected 195, is " << last_msg_->sol_in[86].sensor_type; - EXPECT_EQ(last_msg_->sol_in[87].flags, 30) << "incorrect value for sol_in[87].flags, expected 30, is " << last_msg_->sol_in[87].flags; - EXPECT_EQ(last_msg_->sol_in[87].sensor_type, 86) << "incorrect value for sol_in[87].sensor_type, expected 86, is " << last_msg_->sol_in[87].sensor_type; - EXPECT_EQ(last_msg_->sol_in[88].flags, 143) << "incorrect value for sol_in[88].flags, expected 143, is " << last_msg_->sol_in[88].flags; - EXPECT_EQ(last_msg_->sol_in[88].sensor_type, 34) << "incorrect value for sol_in[88].sensor_type, expected 34, is " << last_msg_->sol_in[88].sensor_type; - EXPECT_EQ(last_msg_->sol_in[89].flags, 207) << "incorrect value for sol_in[89].flags, expected 207, is " << last_msg_->sol_in[89].flags; - EXPECT_EQ(last_msg_->sol_in[89].sensor_type, 156) << "incorrect value for sol_in[89].sensor_type, expected 156, is " << last_msg_->sol_in[89].sensor_type; - EXPECT_EQ(last_msg_->sol_in[90].flags, 55) << "incorrect value for sol_in[90].flags, expected 55, is " << last_msg_->sol_in[90].flags; - EXPECT_EQ(last_msg_->sol_in[90].sensor_type, 63) << "incorrect value for sol_in[90].sensor_type, expected 63, is " << last_msg_->sol_in[90].sensor_type; - EXPECT_EQ(last_msg_->sol_in[91].flags, 255) << "incorrect value for sol_in[91].flags, expected 255, is " << last_msg_->sol_in[91].flags; - EXPECT_EQ(last_msg_->sol_in[91].sensor_type, 117) << "incorrect value for sol_in[91].sensor_type, expected 117, is " << last_msg_->sol_in[91].sensor_type; - EXPECT_EQ(last_msg_->sol_in[92].flags, 222) << "incorrect value for sol_in[92].flags, expected 222, is " << last_msg_->sol_in[92].flags; - EXPECT_EQ(last_msg_->sol_in[92].sensor_type, 222) << "incorrect value for sol_in[92].sensor_type, expected 222, is " << last_msg_->sol_in[92].sensor_type; - EXPECT_EQ(last_msg_->sol_in[93].flags, 145) << "incorrect value for sol_in[93].flags, expected 145, is " << last_msg_->sol_in[93].flags; - EXPECT_EQ(last_msg_->sol_in[93].sensor_type, 219) << "incorrect value for sol_in[93].sensor_type, expected 219, is " << last_msg_->sol_in[93].sensor_type; - EXPECT_EQ(last_msg_->sol_in[94].flags, 191) << "incorrect value for sol_in[94].flags, expected 191, is " << last_msg_->sol_in[94].flags; - EXPECT_EQ(last_msg_->sol_in[94].sensor_type, 224) << "incorrect value for sol_in[94].sensor_type, expected 224, is " << last_msg_->sol_in[94].sensor_type; - EXPECT_EQ(last_msg_->sol_in[95].flags, 109) << "incorrect value for sol_in[95].flags, expected 109, is " << last_msg_->sol_in[95].flags; - EXPECT_EQ(last_msg_->sol_in[95].sensor_type, 210) << "incorrect value for sol_in[95].sensor_type, expected 210, is " << last_msg_->sol_in[95].sensor_type; - EXPECT_EQ(last_msg_->sol_in[96].flags, 153) << "incorrect value for sol_in[96].flags, expected 153, is " << last_msg_->sol_in[96].flags; - EXPECT_EQ(last_msg_->sol_in[96].sensor_type, 86) << "incorrect value for sol_in[96].sensor_type, expected 86, is " << last_msg_->sol_in[96].sensor_type; - EXPECT_EQ(last_msg_->sol_in[97].flags, 32) << "incorrect value for sol_in[97].flags, expected 32, is " << last_msg_->sol_in[97].flags; - EXPECT_EQ(last_msg_->sol_in[97].sensor_type, 21) << "incorrect value for sol_in[97].sensor_type, expected 21, is " << last_msg_->sol_in[97].sensor_type; - EXPECT_EQ(last_msg_->sol_in[98].flags, 10) << "incorrect value for sol_in[98].flags, expected 10, is " << last_msg_->sol_in[98].flags; - EXPECT_EQ(last_msg_->sol_in[98].sensor_type, 226) << "incorrect value for sol_in[98].sensor_type, expected 226, is " << last_msg_->sol_in[98].sensor_type; - EXPECT_EQ(last_msg_->sol_in[99].flags, 63) << "incorrect value for sol_in[99].flags, expected 63, is " << last_msg_->sol_in[99].flags; - EXPECT_EQ(last_msg_->sol_in[99].sensor_type, 60) << "incorrect value for sol_in[99].sensor_type, expected 60, is " << last_msg_->sol_in[99].sensor_type; - EXPECT_EQ(last_msg_->sol_in[100].flags, 236) << "incorrect value for sol_in[100].flags, expected 236, is " << last_msg_->sol_in[100].flags; - EXPECT_EQ(last_msg_->sol_in[100].sensor_type, 106) << "incorrect value for sol_in[100].sensor_type, expected 106, is " << last_msg_->sol_in[100].sensor_type; - EXPECT_EQ(last_msg_->sol_in[101].flags, 96) << "incorrect value for sol_in[101].flags, expected 96, is " << last_msg_->sol_in[101].flags; - EXPECT_EQ(last_msg_->sol_in[101].sensor_type, 93) << "incorrect value for sol_in[101].sensor_type, expected 93, is " << last_msg_->sol_in[101].sensor_type; - EXPECT_EQ(last_msg_->sol_in[102].flags, 163) << "incorrect value for sol_in[102].flags, expected 163, is " << last_msg_->sol_in[102].flags; - EXPECT_EQ(last_msg_->sol_in[102].sensor_type, 30) << "incorrect value for sol_in[102].sensor_type, expected 30, is " << last_msg_->sol_in[102].sensor_type; - EXPECT_EQ(last_msg_->sol_in[103].flags, 238) << "incorrect value for sol_in[103].flags, expected 238, is " << last_msg_->sol_in[103].flags; - EXPECT_EQ(last_msg_->sol_in[103].sensor_type, 106) << "incorrect value for sol_in[103].sensor_type, expected 106, is " << last_msg_->sol_in[103].sensor_type; - EXPECT_EQ(last_msg_->sol_in[104].flags, 133) << "incorrect value for sol_in[104].flags, expected 133, is " << last_msg_->sol_in[104].flags; - EXPECT_EQ(last_msg_->sol_in[104].sensor_type, 147) << "incorrect value for sol_in[104].sensor_type, expected 147, is " << last_msg_->sol_in[104].sensor_type; - EXPECT_EQ(last_msg_->sol_in[105].flags, 107) << "incorrect value for sol_in[105].flags, expected 107, is " << last_msg_->sol_in[105].flags; - EXPECT_EQ(last_msg_->sol_in[105].sensor_type, 132) << "incorrect value for sol_in[105].sensor_type, expected 132, is " << last_msg_->sol_in[105].sensor_type; - EXPECT_EQ(last_msg_->sol_in[106].flags, 214) << "incorrect value for sol_in[106].flags, expected 214, is " << last_msg_->sol_in[106].flags; - EXPECT_EQ(last_msg_->sol_in[106].sensor_type, 152) << "incorrect value for sol_in[106].sensor_type, expected 152, is " << last_msg_->sol_in[106].sensor_type; - EXPECT_EQ(last_msg_->sol_in[107].flags, 185) << "incorrect value for sol_in[107].flags, expected 185, is " << last_msg_->sol_in[107].flags; - EXPECT_EQ(last_msg_->sol_in[107].sensor_type, 221) << "incorrect value for sol_in[107].sensor_type, expected 221, is " << last_msg_->sol_in[107].sensor_type; - EXPECT_EQ(last_msg_->sol_in[108].flags, 21) << "incorrect value for sol_in[108].flags, expected 21, is " << last_msg_->sol_in[108].flags; - EXPECT_EQ(last_msg_->sol_in[108].sensor_type, 202) << "incorrect value for sol_in[108].sensor_type, expected 202, is " << last_msg_->sol_in[108].sensor_type; - EXPECT_EQ(last_msg_->sol_in[109].flags, 51) << "incorrect value for sol_in[109].flags, expected 51, is " << last_msg_->sol_in[109].flags; - EXPECT_EQ(last_msg_->sol_in[109].sensor_type, 252) << "incorrect value for sol_in[109].sensor_type, expected 252, is " << last_msg_->sol_in[109].sensor_type; - EXPECT_EQ(last_msg_->sol_in[110].flags, 59) << "incorrect value for sol_in[110].flags, expected 59, is " << last_msg_->sol_in[110].flags; - EXPECT_EQ(last_msg_->sol_in[110].sensor_type, 130) << "incorrect value for sol_in[110].sensor_type, expected 130, is " << last_msg_->sol_in[110].sensor_type; - EXPECT_EQ(last_msg_->sol_in[111].flags, 202) << "incorrect value for sol_in[111].flags, expected 202, is " << last_msg_->sol_in[111].flags; - EXPECT_EQ(last_msg_->sol_in[111].sensor_type, 166) << "incorrect value for sol_in[111].sensor_type, expected 166, is " << last_msg_->sol_in[111].sensor_type; - EXPECT_EQ(last_msg_->sol_in[112].flags, 170) << "incorrect value for sol_in[112].flags, expected 170, is " << last_msg_->sol_in[112].flags; - EXPECT_EQ(last_msg_->sol_in[112].sensor_type, 127) << "incorrect value for sol_in[112].sensor_type, expected 127, is " << last_msg_->sol_in[112].sensor_type; - EXPECT_EQ(last_msg_->sol_in[113].flags, 193) << "incorrect value for sol_in[113].flags, expected 193, is " << last_msg_->sol_in[113].flags; - EXPECT_EQ(last_msg_->sol_in[113].sensor_type, 58) << "incorrect value for sol_in[113].sensor_type, expected 58, is " << last_msg_->sol_in[113].sensor_type; - EXPECT_EQ(last_msg_->sol_in[114].flags, 125) << "incorrect value for sol_in[114].flags, expected 125, is " << last_msg_->sol_in[114].flags; - EXPECT_EQ(last_msg_->sol_in[114].sensor_type, 215) << "incorrect value for sol_in[114].sensor_type, expected 215, is " << last_msg_->sol_in[114].sensor_type; - EXPECT_EQ(last_msg_->sol_in[115].flags, 58) << "incorrect value for sol_in[115].flags, expected 58, is " << last_msg_->sol_in[115].flags; - EXPECT_EQ(last_msg_->sol_in[115].sensor_type, 22) << "incorrect value for sol_in[115].sensor_type, expected 22, is " << last_msg_->sol_in[115].sensor_type; - EXPECT_EQ(last_msg_->sol_in[116].flags, 47) << "incorrect value for sol_in[116].flags, expected 47, is " << last_msg_->sol_in[116].flags; - EXPECT_EQ(last_msg_->sol_in[116].sensor_type, 135) << "incorrect value for sol_in[116].sensor_type, expected 135, is " << last_msg_->sol_in[116].sensor_type; - EXPECT_EQ(last_msg_->sol_in[117].flags, 142) << "incorrect value for sol_in[117].flags, expected 142, is " << last_msg_->sol_in[117].flags; - EXPECT_EQ(last_msg_->sol_in[117].sensor_type, 88) << "incorrect value for sol_in[117].sensor_type, expected 88, is " << last_msg_->sol_in[117].sensor_type; - EXPECT_EQ(last_msg_->vdop, 41989) << "incorrect value for vdop, expected 41989, is " << last_msg_->vdop; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61780); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->age_corrections, 48671) + << "incorrect value for age_corrections, expected 48671, is " + << last_msg_->age_corrections; + EXPECT_EQ(last_msg_->alignment_status, 115) + << "incorrect value for alignment_status, expected 115, is " + << last_msg_->alignment_status; + EXPECT_EQ(last_msg_->hdop, 31133) + << "incorrect value for hdop, expected 31133, is " << last_msg_->hdop; + EXPECT_EQ(last_msg_->last_used_gnss_pos_tow, 610745181) + << "incorrect value for last_used_gnss_pos_tow, expected 610745181, is " + << last_msg_->last_used_gnss_pos_tow; + EXPECT_EQ(last_msg_->last_used_gnss_vel_tow, 782016851) + << "incorrect value for last_used_gnss_vel_tow, expected 782016851, is " + << last_msg_->last_used_gnss_vel_tow; + EXPECT_EQ(last_msg_->n_sats, 238) + << "incorrect value for n_sats, expected 238, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->pdop, 57015) + << "incorrect value for pdop, expected 57015, is " << last_msg_->pdop; + EXPECT_EQ(last_msg_->sol_in[0].flags, 67) + << "incorrect value for sol_in[0].flags, expected 67, is " + << last_msg_->sol_in[0].flags; + EXPECT_EQ(last_msg_->sol_in[0].sensor_type, 253) + << "incorrect value for sol_in[0].sensor_type, expected 253, is " + << last_msg_->sol_in[0].sensor_type; + EXPECT_EQ(last_msg_->sol_in[1].flags, 200) + << "incorrect value for sol_in[1].flags, expected 200, is " + << last_msg_->sol_in[1].flags; + EXPECT_EQ(last_msg_->sol_in[1].sensor_type, 87) + << "incorrect value for sol_in[1].sensor_type, expected 87, is " + << last_msg_->sol_in[1].sensor_type; + EXPECT_EQ(last_msg_->sol_in[2].flags, 250) + << "incorrect value for sol_in[2].flags, expected 250, is " + << last_msg_->sol_in[2].flags; + EXPECT_EQ(last_msg_->sol_in[2].sensor_type, 39) + << "incorrect value for sol_in[2].sensor_type, expected 39, is " + << last_msg_->sol_in[2].sensor_type; + EXPECT_EQ(last_msg_->sol_in[3].flags, 242) + << "incorrect value for sol_in[3].flags, expected 242, is " + << last_msg_->sol_in[3].flags; + EXPECT_EQ(last_msg_->sol_in[3].sensor_type, 245) + << "incorrect value for sol_in[3].sensor_type, expected 245, is " + << last_msg_->sol_in[3].sensor_type; + EXPECT_EQ(last_msg_->sol_in[4].flags, 72) + << "incorrect value for sol_in[4].flags, expected 72, is " + << last_msg_->sol_in[4].flags; + EXPECT_EQ(last_msg_->sol_in[4].sensor_type, 228) + << "incorrect value for sol_in[4].sensor_type, expected 228, is " + << last_msg_->sol_in[4].sensor_type; + EXPECT_EQ(last_msg_->sol_in[5].flags, 222) + << "incorrect value for sol_in[5].flags, expected 222, is " + << last_msg_->sol_in[5].flags; + EXPECT_EQ(last_msg_->sol_in[5].sensor_type, 18) + << "incorrect value for sol_in[5].sensor_type, expected 18, is " + << last_msg_->sol_in[5].sensor_type; + EXPECT_EQ(last_msg_->sol_in[6].flags, 88) + << "incorrect value for sol_in[6].flags, expected 88, is " + << last_msg_->sol_in[6].flags; + EXPECT_EQ(last_msg_->sol_in[6].sensor_type, 11) + << "incorrect value for sol_in[6].sensor_type, expected 11, is " + << last_msg_->sol_in[6].sensor_type; + EXPECT_EQ(last_msg_->sol_in[7].flags, 218) + << "incorrect value for sol_in[7].flags, expected 218, is " + << last_msg_->sol_in[7].flags; + EXPECT_EQ(last_msg_->sol_in[7].sensor_type, 207) + << "incorrect value for sol_in[7].sensor_type, expected 207, is " + << last_msg_->sol_in[7].sensor_type; + EXPECT_EQ(last_msg_->sol_in[8].flags, 13) + << "incorrect value for sol_in[8].flags, expected 13, is " + << last_msg_->sol_in[8].flags; + EXPECT_EQ(last_msg_->sol_in[8].sensor_type, 231) + << "incorrect value for sol_in[8].sensor_type, expected 231, is " + << last_msg_->sol_in[8].sensor_type; + EXPECT_EQ(last_msg_->sol_in[9].flags, 224) + << "incorrect value for sol_in[9].flags, expected 224, is " + << last_msg_->sol_in[9].flags; + EXPECT_EQ(last_msg_->sol_in[9].sensor_type, 226) + << "incorrect value for sol_in[9].sensor_type, expected 226, is " + << last_msg_->sol_in[9].sensor_type; + EXPECT_EQ(last_msg_->sol_in[10].flags, 196) + << "incorrect value for sol_in[10].flags, expected 196, is " + << last_msg_->sol_in[10].flags; + EXPECT_EQ(last_msg_->sol_in[10].sensor_type, 22) + << "incorrect value for sol_in[10].sensor_type, expected 22, is " + << last_msg_->sol_in[10].sensor_type; + EXPECT_EQ(last_msg_->sol_in[11].flags, 242) + << "incorrect value for sol_in[11].flags, expected 242, is " + << last_msg_->sol_in[11].flags; + EXPECT_EQ(last_msg_->sol_in[11].sensor_type, 21) + << "incorrect value for sol_in[11].sensor_type, expected 21, is " + << last_msg_->sol_in[11].sensor_type; + EXPECT_EQ(last_msg_->sol_in[12].flags, 89) + << "incorrect value for sol_in[12].flags, expected 89, is " + << last_msg_->sol_in[12].flags; + EXPECT_EQ(last_msg_->sol_in[12].sensor_type, 12) + << "incorrect value for sol_in[12].sensor_type, expected 12, is " + << last_msg_->sol_in[12].sensor_type; + EXPECT_EQ(last_msg_->sol_in[13].flags, 219) + << "incorrect value for sol_in[13].flags, expected 219, is " + << last_msg_->sol_in[13].flags; + EXPECT_EQ(last_msg_->sol_in[13].sensor_type, 71) + << "incorrect value for sol_in[13].sensor_type, expected 71, is " + << last_msg_->sol_in[13].sensor_type; + EXPECT_EQ(last_msg_->sol_in[14].flags, 85) + << "incorrect value for sol_in[14].flags, expected 85, is " + << last_msg_->sol_in[14].flags; + EXPECT_EQ(last_msg_->sol_in[14].sensor_type, 182) + << "incorrect value for sol_in[14].sensor_type, expected 182, is " + << last_msg_->sol_in[14].sensor_type; + EXPECT_EQ(last_msg_->sol_in[15].flags, 204) + << "incorrect value for sol_in[15].flags, expected 204, is " + << last_msg_->sol_in[15].flags; + EXPECT_EQ(last_msg_->sol_in[15].sensor_type, 145) + << "incorrect value for sol_in[15].sensor_type, expected 145, is " + << last_msg_->sol_in[15].sensor_type; + EXPECT_EQ(last_msg_->sol_in[16].flags, 40) + << "incorrect value for sol_in[16].flags, expected 40, is " + << last_msg_->sol_in[16].flags; + EXPECT_EQ(last_msg_->sol_in[16].sensor_type, 146) + << "incorrect value for sol_in[16].sensor_type, expected 146, is " + << last_msg_->sol_in[16].sensor_type; + EXPECT_EQ(last_msg_->sol_in[17].flags, 51) + << "incorrect value for sol_in[17].flags, expected 51, is " + << last_msg_->sol_in[17].flags; + EXPECT_EQ(last_msg_->sol_in[17].sensor_type, 204) + << "incorrect value for sol_in[17].sensor_type, expected 204, is " + << last_msg_->sol_in[17].sensor_type; + EXPECT_EQ(last_msg_->sol_in[18].flags, 153) + << "incorrect value for sol_in[18].flags, expected 153, is " + << last_msg_->sol_in[18].flags; + EXPECT_EQ(last_msg_->sol_in[18].sensor_type, 21) + << "incorrect value for sol_in[18].sensor_type, expected 21, is " + << last_msg_->sol_in[18].sensor_type; + EXPECT_EQ(last_msg_->sol_in[19].flags, 44) + << "incorrect value for sol_in[19].flags, expected 44, is " + << last_msg_->sol_in[19].flags; + EXPECT_EQ(last_msg_->sol_in[19].sensor_type, 227) + << "incorrect value for sol_in[19].sensor_type, expected 227, is " + << last_msg_->sol_in[19].sensor_type; + EXPECT_EQ(last_msg_->sol_in[20].flags, 28) + << "incorrect value for sol_in[20].flags, expected 28, is " + << last_msg_->sol_in[20].flags; + EXPECT_EQ(last_msg_->sol_in[20].sensor_type, 15) + << "incorrect value for sol_in[20].sensor_type, expected 15, is " + << last_msg_->sol_in[20].sensor_type; + EXPECT_EQ(last_msg_->sol_in[21].flags, 39) + << "incorrect value for sol_in[21].flags, expected 39, is " + << last_msg_->sol_in[21].flags; + EXPECT_EQ(last_msg_->sol_in[21].sensor_type, 255) + << "incorrect value for sol_in[21].sensor_type, expected 255, is " + << last_msg_->sol_in[21].sensor_type; + EXPECT_EQ(last_msg_->sol_in[22].flags, 216) + << "incorrect value for sol_in[22].flags, expected 216, is " + << last_msg_->sol_in[22].flags; + EXPECT_EQ(last_msg_->sol_in[22].sensor_type, 205) + << "incorrect value for sol_in[22].sensor_type, expected 205, is " + << last_msg_->sol_in[22].sensor_type; + EXPECT_EQ(last_msg_->sol_in[23].flags, 190) + << "incorrect value for sol_in[23].flags, expected 190, is " + << last_msg_->sol_in[23].flags; + EXPECT_EQ(last_msg_->sol_in[23].sensor_type, 240) + << "incorrect value for sol_in[23].sensor_type, expected 240, is " + << last_msg_->sol_in[23].sensor_type; + EXPECT_EQ(last_msg_->sol_in[24].flags, 219) + << "incorrect value for sol_in[24].flags, expected 219, is " + << last_msg_->sol_in[24].flags; + EXPECT_EQ(last_msg_->sol_in[24].sensor_type, 93) + << "incorrect value for sol_in[24].sensor_type, expected 93, is " + << last_msg_->sol_in[24].sensor_type; + EXPECT_EQ(last_msg_->sol_in[25].flags, 42) + << "incorrect value for sol_in[25].flags, expected 42, is " + << last_msg_->sol_in[25].flags; + EXPECT_EQ(last_msg_->sol_in[25].sensor_type, 103) + << "incorrect value for sol_in[25].sensor_type, expected 103, is " + << last_msg_->sol_in[25].sensor_type; + EXPECT_EQ(last_msg_->sol_in[26].flags, 182) + << "incorrect value for sol_in[26].flags, expected 182, is " + << last_msg_->sol_in[26].flags; + EXPECT_EQ(last_msg_->sol_in[26].sensor_type, 41) + << "incorrect value for sol_in[26].sensor_type, expected 41, is " + << last_msg_->sol_in[26].sensor_type; + EXPECT_EQ(last_msg_->sol_in[27].flags, 222) + << "incorrect value for sol_in[27].flags, expected 222, is " + << last_msg_->sol_in[27].flags; + EXPECT_EQ(last_msg_->sol_in[27].sensor_type, 76) + << "incorrect value for sol_in[27].sensor_type, expected 76, is " + << last_msg_->sol_in[27].sensor_type; + EXPECT_EQ(last_msg_->sol_in[28].flags, 23) + << "incorrect value for sol_in[28].flags, expected 23, is " + << last_msg_->sol_in[28].flags; + EXPECT_EQ(last_msg_->sol_in[28].sensor_type, 17) + << "incorrect value for sol_in[28].sensor_type, expected 17, is " + << last_msg_->sol_in[28].sensor_type; + EXPECT_EQ(last_msg_->sol_in[29].flags, 31) + << "incorrect value for sol_in[29].flags, expected 31, is " + << last_msg_->sol_in[29].flags; + EXPECT_EQ(last_msg_->sol_in[29].sensor_type, 125) + << "incorrect value for sol_in[29].sensor_type, expected 125, is " + << last_msg_->sol_in[29].sensor_type; + EXPECT_EQ(last_msg_->sol_in[30].flags, 229) + << "incorrect value for sol_in[30].flags, expected 229, is " + << last_msg_->sol_in[30].flags; + EXPECT_EQ(last_msg_->sol_in[30].sensor_type, 18) + << "incorrect value for sol_in[30].sensor_type, expected 18, is " + << last_msg_->sol_in[30].sensor_type; + EXPECT_EQ(last_msg_->sol_in[31].flags, 47) + << "incorrect value for sol_in[31].flags, expected 47, is " + << last_msg_->sol_in[31].flags; + EXPECT_EQ(last_msg_->sol_in[31].sensor_type, 28) + << "incorrect value for sol_in[31].sensor_type, expected 28, is " + << last_msg_->sol_in[31].sensor_type; + EXPECT_EQ(last_msg_->sol_in[32].flags, 25) + << "incorrect value for sol_in[32].flags, expected 25, is " + << last_msg_->sol_in[32].flags; + EXPECT_EQ(last_msg_->sol_in[32].sensor_type, 214) + << "incorrect value for sol_in[32].sensor_type, expected 214, is " + << last_msg_->sol_in[32].sensor_type; + EXPECT_EQ(last_msg_->sol_in[33].flags, 84) + << "incorrect value for sol_in[33].flags, expected 84, is " + << last_msg_->sol_in[33].flags; + EXPECT_EQ(last_msg_->sol_in[33].sensor_type, 100) + << "incorrect value for sol_in[33].sensor_type, expected 100, is " + << last_msg_->sol_in[33].sensor_type; + EXPECT_EQ(last_msg_->sol_in[34].flags, 72) + << "incorrect value for sol_in[34].flags, expected 72, is " + << last_msg_->sol_in[34].flags; + EXPECT_EQ(last_msg_->sol_in[34].sensor_type, 106) + << "incorrect value for sol_in[34].sensor_type, expected 106, is " + << last_msg_->sol_in[34].sensor_type; + EXPECT_EQ(last_msg_->sol_in[35].flags, 10) + << "incorrect value for sol_in[35].flags, expected 10, is " + << last_msg_->sol_in[35].flags; + EXPECT_EQ(last_msg_->sol_in[35].sensor_type, 48) + << "incorrect value for sol_in[35].sensor_type, expected 48, is " + << last_msg_->sol_in[35].sensor_type; + EXPECT_EQ(last_msg_->sol_in[36].flags, 232) + << "incorrect value for sol_in[36].flags, expected 232, is " + << last_msg_->sol_in[36].flags; + EXPECT_EQ(last_msg_->sol_in[36].sensor_type, 222) + << "incorrect value for sol_in[36].sensor_type, expected 222, is " + << last_msg_->sol_in[36].sensor_type; + EXPECT_EQ(last_msg_->sol_in[37].flags, 73) + << "incorrect value for sol_in[37].flags, expected 73, is " + << last_msg_->sol_in[37].flags; + EXPECT_EQ(last_msg_->sol_in[37].sensor_type, 235) + << "incorrect value for sol_in[37].sensor_type, expected 235, is " + << last_msg_->sol_in[37].sensor_type; + EXPECT_EQ(last_msg_->sol_in[38].flags, 163) + << "incorrect value for sol_in[38].flags, expected 163, is " + << last_msg_->sol_in[38].flags; + EXPECT_EQ(last_msg_->sol_in[38].sensor_type, 109) + << "incorrect value for sol_in[38].sensor_type, expected 109, is " + << last_msg_->sol_in[38].sensor_type; + EXPECT_EQ(last_msg_->sol_in[39].flags, 152) + << "incorrect value for sol_in[39].flags, expected 152, is " + << last_msg_->sol_in[39].flags; + EXPECT_EQ(last_msg_->sol_in[39].sensor_type, 51) + << "incorrect value for sol_in[39].sensor_type, expected 51, is " + << last_msg_->sol_in[39].sensor_type; + EXPECT_EQ(last_msg_->sol_in[40].flags, 235) + << "incorrect value for sol_in[40].flags, expected 235, is " + << last_msg_->sol_in[40].flags; + EXPECT_EQ(last_msg_->sol_in[40].sensor_type, 133) + << "incorrect value for sol_in[40].sensor_type, expected 133, is " + << last_msg_->sol_in[40].sensor_type; + EXPECT_EQ(last_msg_->sol_in[41].flags, 70) + << "incorrect value for sol_in[41].flags, expected 70, is " + << last_msg_->sol_in[41].flags; + EXPECT_EQ(last_msg_->sol_in[41].sensor_type, 87) + << "incorrect value for sol_in[41].sensor_type, expected 87, is " + << last_msg_->sol_in[41].sensor_type; + EXPECT_EQ(last_msg_->sol_in[42].flags, 108) + << "incorrect value for sol_in[42].flags, expected 108, is " + << last_msg_->sol_in[42].flags; + EXPECT_EQ(last_msg_->sol_in[42].sensor_type, 2) + << "incorrect value for sol_in[42].sensor_type, expected 2, is " + << last_msg_->sol_in[42].sensor_type; + EXPECT_EQ(last_msg_->sol_in[43].flags, 101) + << "incorrect value for sol_in[43].flags, expected 101, is " + << last_msg_->sol_in[43].flags; + EXPECT_EQ(last_msg_->sol_in[43].sensor_type, 91) + << "incorrect value for sol_in[43].sensor_type, expected 91, is " + << last_msg_->sol_in[43].sensor_type; + EXPECT_EQ(last_msg_->sol_in[44].flags, 55) + << "incorrect value for sol_in[44].flags, expected 55, is " + << last_msg_->sol_in[44].flags; + EXPECT_EQ(last_msg_->sol_in[44].sensor_type, 200) + << "incorrect value for sol_in[44].sensor_type, expected 200, is " + << last_msg_->sol_in[44].sensor_type; + EXPECT_EQ(last_msg_->sol_in[45].flags, 156) + << "incorrect value for sol_in[45].flags, expected 156, is " + << last_msg_->sol_in[45].flags; + EXPECT_EQ(last_msg_->sol_in[45].sensor_type, 24) + << "incorrect value for sol_in[45].sensor_type, expected 24, is " + << last_msg_->sol_in[45].sensor_type; + EXPECT_EQ(last_msg_->sol_in[46].flags, 73) + << "incorrect value for sol_in[46].flags, expected 73, is " + << last_msg_->sol_in[46].flags; + EXPECT_EQ(last_msg_->sol_in[46].sensor_type, 233) + << "incorrect value for sol_in[46].sensor_type, expected 233, is " + << last_msg_->sol_in[46].sensor_type; + EXPECT_EQ(last_msg_->sol_in[47].flags, 66) + << "incorrect value for sol_in[47].flags, expected 66, is " + << last_msg_->sol_in[47].flags; + EXPECT_EQ(last_msg_->sol_in[47].sensor_type, 39) + << "incorrect value for sol_in[47].sensor_type, expected 39, is " + << last_msg_->sol_in[47].sensor_type; + EXPECT_EQ(last_msg_->sol_in[48].flags, 140) + << "incorrect value for sol_in[48].flags, expected 140, is " + << last_msg_->sol_in[48].flags; + EXPECT_EQ(last_msg_->sol_in[48].sensor_type, 97) + << "incorrect value for sol_in[48].sensor_type, expected 97, is " + << last_msg_->sol_in[48].sensor_type; + EXPECT_EQ(last_msg_->sol_in[49].flags, 227) + << "incorrect value for sol_in[49].flags, expected 227, is " + << last_msg_->sol_in[49].flags; + EXPECT_EQ(last_msg_->sol_in[49].sensor_type, 252) + << "incorrect value for sol_in[49].sensor_type, expected 252, is " + << last_msg_->sol_in[49].sensor_type; + EXPECT_EQ(last_msg_->sol_in[50].flags, 237) + << "incorrect value for sol_in[50].flags, expected 237, is " + << last_msg_->sol_in[50].flags; + EXPECT_EQ(last_msg_->sol_in[50].sensor_type, 230) + << "incorrect value for sol_in[50].sensor_type, expected 230, is " + << last_msg_->sol_in[50].sensor_type; + EXPECT_EQ(last_msg_->sol_in[51].flags, 241) + << "incorrect value for sol_in[51].flags, expected 241, is " + << last_msg_->sol_in[51].flags; + EXPECT_EQ(last_msg_->sol_in[51].sensor_type, 135) + << "incorrect value for sol_in[51].sensor_type, expected 135, is " + << last_msg_->sol_in[51].sensor_type; + EXPECT_EQ(last_msg_->sol_in[52].flags, 205) + << "incorrect value for sol_in[52].flags, expected 205, is " + << last_msg_->sol_in[52].flags; + EXPECT_EQ(last_msg_->sol_in[52].sensor_type, 245) + << "incorrect value for sol_in[52].sensor_type, expected 245, is " + << last_msg_->sol_in[52].sensor_type; + EXPECT_EQ(last_msg_->sol_in[53].flags, 0) + << "incorrect value for sol_in[53].flags, expected 0, is " + << last_msg_->sol_in[53].flags; + EXPECT_EQ(last_msg_->sol_in[53].sensor_type, 70) + << "incorrect value for sol_in[53].sensor_type, expected 70, is " + << last_msg_->sol_in[53].sensor_type; + EXPECT_EQ(last_msg_->sol_in[54].flags, 188) + << "incorrect value for sol_in[54].flags, expected 188, is " + << last_msg_->sol_in[54].flags; + EXPECT_EQ(last_msg_->sol_in[54].sensor_type, 219) + << "incorrect value for sol_in[54].sensor_type, expected 219, is " + << last_msg_->sol_in[54].sensor_type; + EXPECT_EQ(last_msg_->sol_in[55].flags, 136) + << "incorrect value for sol_in[55].flags, expected 136, is " + << last_msg_->sol_in[55].flags; + EXPECT_EQ(last_msg_->sol_in[55].sensor_type, 107) + << "incorrect value for sol_in[55].sensor_type, expected 107, is " + << last_msg_->sol_in[55].sensor_type; + EXPECT_EQ(last_msg_->sol_in[56].flags, 58) + << "incorrect value for sol_in[56].flags, expected 58, is " + << last_msg_->sol_in[56].flags; + EXPECT_EQ(last_msg_->sol_in[56].sensor_type, 178) + << "incorrect value for sol_in[56].sensor_type, expected 178, is " + << last_msg_->sol_in[56].sensor_type; + EXPECT_EQ(last_msg_->sol_in[57].flags, 29) + << "incorrect value for sol_in[57].flags, expected 29, is " + << last_msg_->sol_in[57].flags; + EXPECT_EQ(last_msg_->sol_in[57].sensor_type, 1) + << "incorrect value for sol_in[57].sensor_type, expected 1, is " + << last_msg_->sol_in[57].sensor_type; + EXPECT_EQ(last_msg_->sol_in[58].flags, 213) + << "incorrect value for sol_in[58].flags, expected 213, is " + << last_msg_->sol_in[58].flags; + EXPECT_EQ(last_msg_->sol_in[58].sensor_type, 44) + << "incorrect value for sol_in[58].sensor_type, expected 44, is " + << last_msg_->sol_in[58].sensor_type; + EXPECT_EQ(last_msg_->sol_in[59].flags, 147) + << "incorrect value for sol_in[59].flags, expected 147, is " + << last_msg_->sol_in[59].flags; + EXPECT_EQ(last_msg_->sol_in[59].sensor_type, 225) + << "incorrect value for sol_in[59].sensor_type, expected 225, is " + << last_msg_->sol_in[59].sensor_type; + EXPECT_EQ(last_msg_->sol_in[60].flags, 96) + << "incorrect value for sol_in[60].flags, expected 96, is " + << last_msg_->sol_in[60].flags; + EXPECT_EQ(last_msg_->sol_in[60].sensor_type, 190) + << "incorrect value for sol_in[60].sensor_type, expected 190, is " + << last_msg_->sol_in[60].sensor_type; + EXPECT_EQ(last_msg_->sol_in[61].flags, 108) + << "incorrect value for sol_in[61].flags, expected 108, is " + << last_msg_->sol_in[61].flags; + EXPECT_EQ(last_msg_->sol_in[61].sensor_type, 192) + << "incorrect value for sol_in[61].sensor_type, expected 192, is " + << last_msg_->sol_in[61].sensor_type; + EXPECT_EQ(last_msg_->sol_in[62].flags, 15) + << "incorrect value for sol_in[62].flags, expected 15, is " + << last_msg_->sol_in[62].flags; + EXPECT_EQ(last_msg_->sol_in[62].sensor_type, 228) + << "incorrect value for sol_in[62].sensor_type, expected 228, is " + << last_msg_->sol_in[62].sensor_type; + EXPECT_EQ(last_msg_->sol_in[63].flags, 18) + << "incorrect value for sol_in[63].flags, expected 18, is " + << last_msg_->sol_in[63].flags; + EXPECT_EQ(last_msg_->sol_in[63].sensor_type, 203) + << "incorrect value for sol_in[63].sensor_type, expected 203, is " + << last_msg_->sol_in[63].sensor_type; + EXPECT_EQ(last_msg_->sol_in[64].flags, 222) + << "incorrect value for sol_in[64].flags, expected 222, is " + << last_msg_->sol_in[64].flags; + EXPECT_EQ(last_msg_->sol_in[64].sensor_type, 3) + << "incorrect value for sol_in[64].sensor_type, expected 3, is " + << last_msg_->sol_in[64].sensor_type; + EXPECT_EQ(last_msg_->sol_in[65].flags, 68) + << "incorrect value for sol_in[65].flags, expected 68, is " + << last_msg_->sol_in[65].flags; + EXPECT_EQ(last_msg_->sol_in[65].sensor_type, 180) + << "incorrect value for sol_in[65].sensor_type, expected 180, is " + << last_msg_->sol_in[65].sensor_type; + EXPECT_EQ(last_msg_->sol_in[66].flags, 229) + << "incorrect value for sol_in[66].flags, expected 229, is " + << last_msg_->sol_in[66].flags; + EXPECT_EQ(last_msg_->sol_in[66].sensor_type, 101) + << "incorrect value for sol_in[66].sensor_type, expected 101, is " + << last_msg_->sol_in[66].sensor_type; + EXPECT_EQ(last_msg_->sol_in[67].flags, 203) + << "incorrect value for sol_in[67].flags, expected 203, is " + << last_msg_->sol_in[67].flags; + EXPECT_EQ(last_msg_->sol_in[67].sensor_type, 223) + << "incorrect value for sol_in[67].sensor_type, expected 223, is " + << last_msg_->sol_in[67].sensor_type; + EXPECT_EQ(last_msg_->sol_in[68].flags, 164) + << "incorrect value for sol_in[68].flags, expected 164, is " + << last_msg_->sol_in[68].flags; + EXPECT_EQ(last_msg_->sol_in[68].sensor_type, 243) + << "incorrect value for sol_in[68].sensor_type, expected 243, is " + << last_msg_->sol_in[68].sensor_type; + EXPECT_EQ(last_msg_->sol_in[69].flags, 165) + << "incorrect value for sol_in[69].flags, expected 165, is " + << last_msg_->sol_in[69].flags; + EXPECT_EQ(last_msg_->sol_in[69].sensor_type, 92) + << "incorrect value for sol_in[69].sensor_type, expected 92, is " + << last_msg_->sol_in[69].sensor_type; + EXPECT_EQ(last_msg_->sol_in[70].flags, 159) + << "incorrect value for sol_in[70].flags, expected 159, is " + << last_msg_->sol_in[70].flags; + EXPECT_EQ(last_msg_->sol_in[70].sensor_type, 220) + << "incorrect value for sol_in[70].sensor_type, expected 220, is " + << last_msg_->sol_in[70].sensor_type; + EXPECT_EQ(last_msg_->sol_in[71].flags, 121) + << "incorrect value for sol_in[71].flags, expected 121, is " + << last_msg_->sol_in[71].flags; + EXPECT_EQ(last_msg_->sol_in[71].sensor_type, 174) + << "incorrect value for sol_in[71].sensor_type, expected 174, is " + << last_msg_->sol_in[71].sensor_type; + EXPECT_EQ(last_msg_->sol_in[72].flags, 167) + << "incorrect value for sol_in[72].flags, expected 167, is " + << last_msg_->sol_in[72].flags; + EXPECT_EQ(last_msg_->sol_in[72].sensor_type, 112) + << "incorrect value for sol_in[72].sensor_type, expected 112, is " + << last_msg_->sol_in[72].sensor_type; + EXPECT_EQ(last_msg_->sol_in[73].flags, 40) + << "incorrect value for sol_in[73].flags, expected 40, is " + << last_msg_->sol_in[73].flags; + EXPECT_EQ(last_msg_->sol_in[73].sensor_type, 240) + << "incorrect value for sol_in[73].sensor_type, expected 240, is " + << last_msg_->sol_in[73].sensor_type; + EXPECT_EQ(last_msg_->sol_in[74].flags, 3) + << "incorrect value for sol_in[74].flags, expected 3, is " + << last_msg_->sol_in[74].flags; + EXPECT_EQ(last_msg_->sol_in[74].sensor_type, 59) + << "incorrect value for sol_in[74].sensor_type, expected 59, is " + << last_msg_->sol_in[74].sensor_type; + EXPECT_EQ(last_msg_->sol_in[75].flags, 52) + << "incorrect value for sol_in[75].flags, expected 52, is " + << last_msg_->sol_in[75].flags; + EXPECT_EQ(last_msg_->sol_in[75].sensor_type, 230) + << "incorrect value for sol_in[75].sensor_type, expected 230, is " + << last_msg_->sol_in[75].sensor_type; + EXPECT_EQ(last_msg_->sol_in[76].flags, 148) + << "incorrect value for sol_in[76].flags, expected 148, is " + << last_msg_->sol_in[76].flags; + EXPECT_EQ(last_msg_->sol_in[76].sensor_type, 149) + << "incorrect value for sol_in[76].sensor_type, expected 149, is " + << last_msg_->sol_in[76].sensor_type; + EXPECT_EQ(last_msg_->sol_in[77].flags, 142) + << "incorrect value for sol_in[77].flags, expected 142, is " + << last_msg_->sol_in[77].flags; + EXPECT_EQ(last_msg_->sol_in[77].sensor_type, 218) + << "incorrect value for sol_in[77].sensor_type, expected 218, is " + << last_msg_->sol_in[77].sensor_type; + EXPECT_EQ(last_msg_->sol_in[78].flags, 109) + << "incorrect value for sol_in[78].flags, expected 109, is " + << last_msg_->sol_in[78].flags; + EXPECT_EQ(last_msg_->sol_in[78].sensor_type, 212) + << "incorrect value for sol_in[78].sensor_type, expected 212, is " + << last_msg_->sol_in[78].sensor_type; + EXPECT_EQ(last_msg_->sol_in[79].flags, 71) + << "incorrect value for sol_in[79].flags, expected 71, is " + << last_msg_->sol_in[79].flags; + EXPECT_EQ(last_msg_->sol_in[79].sensor_type, 176) + << "incorrect value for sol_in[79].sensor_type, expected 176, is " + << last_msg_->sol_in[79].sensor_type; + EXPECT_EQ(last_msg_->sol_in[80].flags, 172) + << "incorrect value for sol_in[80].flags, expected 172, is " + << last_msg_->sol_in[80].flags; + EXPECT_EQ(last_msg_->sol_in[80].sensor_type, 179) + << "incorrect value for sol_in[80].sensor_type, expected 179, is " + << last_msg_->sol_in[80].sensor_type; + EXPECT_EQ(last_msg_->sol_in[81].flags, 1) + << "incorrect value for sol_in[81].flags, expected 1, is " + << last_msg_->sol_in[81].flags; + EXPECT_EQ(last_msg_->sol_in[81].sensor_type, 77) + << "incorrect value for sol_in[81].sensor_type, expected 77, is " + << last_msg_->sol_in[81].sensor_type; + EXPECT_EQ(last_msg_->sol_in[82].flags, 70) + << "incorrect value for sol_in[82].flags, expected 70, is " + << last_msg_->sol_in[82].flags; + EXPECT_EQ(last_msg_->sol_in[82].sensor_type, 193) + << "incorrect value for sol_in[82].sensor_type, expected 193, is " + << last_msg_->sol_in[82].sensor_type; + EXPECT_EQ(last_msg_->sol_in[83].flags, 149) + << "incorrect value for sol_in[83].flags, expected 149, is " + << last_msg_->sol_in[83].flags; + EXPECT_EQ(last_msg_->sol_in[83].sensor_type, 147) + << "incorrect value for sol_in[83].sensor_type, expected 147, is " + << last_msg_->sol_in[83].sensor_type; + EXPECT_EQ(last_msg_->sol_in[84].flags, 144) + << "incorrect value for sol_in[84].flags, expected 144, is " + << last_msg_->sol_in[84].flags; + EXPECT_EQ(last_msg_->sol_in[84].sensor_type, 23) + << "incorrect value for sol_in[84].sensor_type, expected 23, is " + << last_msg_->sol_in[84].sensor_type; + EXPECT_EQ(last_msg_->sol_in[85].flags, 239) + << "incorrect value for sol_in[85].flags, expected 239, is " + << last_msg_->sol_in[85].flags; + EXPECT_EQ(last_msg_->sol_in[85].sensor_type, 148) + << "incorrect value for sol_in[85].sensor_type, expected 148, is " + << last_msg_->sol_in[85].sensor_type; + EXPECT_EQ(last_msg_->sol_in[86].flags, 186) + << "incorrect value for sol_in[86].flags, expected 186, is " + << last_msg_->sol_in[86].flags; + EXPECT_EQ(last_msg_->sol_in[86].sensor_type, 195) + << "incorrect value for sol_in[86].sensor_type, expected 195, is " + << last_msg_->sol_in[86].sensor_type; + EXPECT_EQ(last_msg_->sol_in[87].flags, 30) + << "incorrect value for sol_in[87].flags, expected 30, is " + << last_msg_->sol_in[87].flags; + EXPECT_EQ(last_msg_->sol_in[87].sensor_type, 86) + << "incorrect value for sol_in[87].sensor_type, expected 86, is " + << last_msg_->sol_in[87].sensor_type; + EXPECT_EQ(last_msg_->sol_in[88].flags, 143) + << "incorrect value for sol_in[88].flags, expected 143, is " + << last_msg_->sol_in[88].flags; + EXPECT_EQ(last_msg_->sol_in[88].sensor_type, 34) + << "incorrect value for sol_in[88].sensor_type, expected 34, is " + << last_msg_->sol_in[88].sensor_type; + EXPECT_EQ(last_msg_->sol_in[89].flags, 207) + << "incorrect value for sol_in[89].flags, expected 207, is " + << last_msg_->sol_in[89].flags; + EXPECT_EQ(last_msg_->sol_in[89].sensor_type, 156) + << "incorrect value for sol_in[89].sensor_type, expected 156, is " + << last_msg_->sol_in[89].sensor_type; + EXPECT_EQ(last_msg_->sol_in[90].flags, 55) + << "incorrect value for sol_in[90].flags, expected 55, is " + << last_msg_->sol_in[90].flags; + EXPECT_EQ(last_msg_->sol_in[90].sensor_type, 63) + << "incorrect value for sol_in[90].sensor_type, expected 63, is " + << last_msg_->sol_in[90].sensor_type; + EXPECT_EQ(last_msg_->sol_in[91].flags, 255) + << "incorrect value for sol_in[91].flags, expected 255, is " + << last_msg_->sol_in[91].flags; + EXPECT_EQ(last_msg_->sol_in[91].sensor_type, 117) + << "incorrect value for sol_in[91].sensor_type, expected 117, is " + << last_msg_->sol_in[91].sensor_type; + EXPECT_EQ(last_msg_->sol_in[92].flags, 222) + << "incorrect value for sol_in[92].flags, expected 222, is " + << last_msg_->sol_in[92].flags; + EXPECT_EQ(last_msg_->sol_in[92].sensor_type, 222) + << "incorrect value for sol_in[92].sensor_type, expected 222, is " + << last_msg_->sol_in[92].sensor_type; + EXPECT_EQ(last_msg_->sol_in[93].flags, 145) + << "incorrect value for sol_in[93].flags, expected 145, is " + << last_msg_->sol_in[93].flags; + EXPECT_EQ(last_msg_->sol_in[93].sensor_type, 219) + << "incorrect value for sol_in[93].sensor_type, expected 219, is " + << last_msg_->sol_in[93].sensor_type; + EXPECT_EQ(last_msg_->sol_in[94].flags, 191) + << "incorrect value for sol_in[94].flags, expected 191, is " + << last_msg_->sol_in[94].flags; + EXPECT_EQ(last_msg_->sol_in[94].sensor_type, 224) + << "incorrect value for sol_in[94].sensor_type, expected 224, is " + << last_msg_->sol_in[94].sensor_type; + EXPECT_EQ(last_msg_->sol_in[95].flags, 109) + << "incorrect value for sol_in[95].flags, expected 109, is " + << last_msg_->sol_in[95].flags; + EXPECT_EQ(last_msg_->sol_in[95].sensor_type, 210) + << "incorrect value for sol_in[95].sensor_type, expected 210, is " + << last_msg_->sol_in[95].sensor_type; + EXPECT_EQ(last_msg_->sol_in[96].flags, 153) + << "incorrect value for sol_in[96].flags, expected 153, is " + << last_msg_->sol_in[96].flags; + EXPECT_EQ(last_msg_->sol_in[96].sensor_type, 86) + << "incorrect value for sol_in[96].sensor_type, expected 86, is " + << last_msg_->sol_in[96].sensor_type; + EXPECT_EQ(last_msg_->sol_in[97].flags, 32) + << "incorrect value for sol_in[97].flags, expected 32, is " + << last_msg_->sol_in[97].flags; + EXPECT_EQ(last_msg_->sol_in[97].sensor_type, 21) + << "incorrect value for sol_in[97].sensor_type, expected 21, is " + << last_msg_->sol_in[97].sensor_type; + EXPECT_EQ(last_msg_->sol_in[98].flags, 10) + << "incorrect value for sol_in[98].flags, expected 10, is " + << last_msg_->sol_in[98].flags; + EXPECT_EQ(last_msg_->sol_in[98].sensor_type, 226) + << "incorrect value for sol_in[98].sensor_type, expected 226, is " + << last_msg_->sol_in[98].sensor_type; + EXPECT_EQ(last_msg_->sol_in[99].flags, 63) + << "incorrect value for sol_in[99].flags, expected 63, is " + << last_msg_->sol_in[99].flags; + EXPECT_EQ(last_msg_->sol_in[99].sensor_type, 60) + << "incorrect value for sol_in[99].sensor_type, expected 60, is " + << last_msg_->sol_in[99].sensor_type; + EXPECT_EQ(last_msg_->sol_in[100].flags, 236) + << "incorrect value for sol_in[100].flags, expected 236, is " + << last_msg_->sol_in[100].flags; + EXPECT_EQ(last_msg_->sol_in[100].sensor_type, 106) + << "incorrect value for sol_in[100].sensor_type, expected 106, is " + << last_msg_->sol_in[100].sensor_type; + EXPECT_EQ(last_msg_->sol_in[101].flags, 96) + << "incorrect value for sol_in[101].flags, expected 96, is " + << last_msg_->sol_in[101].flags; + EXPECT_EQ(last_msg_->sol_in[101].sensor_type, 93) + << "incorrect value for sol_in[101].sensor_type, expected 93, is " + << last_msg_->sol_in[101].sensor_type; + EXPECT_EQ(last_msg_->sol_in[102].flags, 163) + << "incorrect value for sol_in[102].flags, expected 163, is " + << last_msg_->sol_in[102].flags; + EXPECT_EQ(last_msg_->sol_in[102].sensor_type, 30) + << "incorrect value for sol_in[102].sensor_type, expected 30, is " + << last_msg_->sol_in[102].sensor_type; + EXPECT_EQ(last_msg_->sol_in[103].flags, 238) + << "incorrect value for sol_in[103].flags, expected 238, is " + << last_msg_->sol_in[103].flags; + EXPECT_EQ(last_msg_->sol_in[103].sensor_type, 106) + << "incorrect value for sol_in[103].sensor_type, expected 106, is " + << last_msg_->sol_in[103].sensor_type; + EXPECT_EQ(last_msg_->sol_in[104].flags, 133) + << "incorrect value for sol_in[104].flags, expected 133, is " + << last_msg_->sol_in[104].flags; + EXPECT_EQ(last_msg_->sol_in[104].sensor_type, 147) + << "incorrect value for sol_in[104].sensor_type, expected 147, is " + << last_msg_->sol_in[104].sensor_type; + EXPECT_EQ(last_msg_->sol_in[105].flags, 107) + << "incorrect value for sol_in[105].flags, expected 107, is " + << last_msg_->sol_in[105].flags; + EXPECT_EQ(last_msg_->sol_in[105].sensor_type, 132) + << "incorrect value for sol_in[105].sensor_type, expected 132, is " + << last_msg_->sol_in[105].sensor_type; + EXPECT_EQ(last_msg_->sol_in[106].flags, 214) + << "incorrect value for sol_in[106].flags, expected 214, is " + << last_msg_->sol_in[106].flags; + EXPECT_EQ(last_msg_->sol_in[106].sensor_type, 152) + << "incorrect value for sol_in[106].sensor_type, expected 152, is " + << last_msg_->sol_in[106].sensor_type; + EXPECT_EQ(last_msg_->sol_in[107].flags, 185) + << "incorrect value for sol_in[107].flags, expected 185, is " + << last_msg_->sol_in[107].flags; + EXPECT_EQ(last_msg_->sol_in[107].sensor_type, 221) + << "incorrect value for sol_in[107].sensor_type, expected 221, is " + << last_msg_->sol_in[107].sensor_type; + EXPECT_EQ(last_msg_->sol_in[108].flags, 21) + << "incorrect value for sol_in[108].flags, expected 21, is " + << last_msg_->sol_in[108].flags; + EXPECT_EQ(last_msg_->sol_in[108].sensor_type, 202) + << "incorrect value for sol_in[108].sensor_type, expected 202, is " + << last_msg_->sol_in[108].sensor_type; + EXPECT_EQ(last_msg_->sol_in[109].flags, 51) + << "incorrect value for sol_in[109].flags, expected 51, is " + << last_msg_->sol_in[109].flags; + EXPECT_EQ(last_msg_->sol_in[109].sensor_type, 252) + << "incorrect value for sol_in[109].sensor_type, expected 252, is " + << last_msg_->sol_in[109].sensor_type; + EXPECT_EQ(last_msg_->sol_in[110].flags, 59) + << "incorrect value for sol_in[110].flags, expected 59, is " + << last_msg_->sol_in[110].flags; + EXPECT_EQ(last_msg_->sol_in[110].sensor_type, 130) + << "incorrect value for sol_in[110].sensor_type, expected 130, is " + << last_msg_->sol_in[110].sensor_type; + EXPECT_EQ(last_msg_->sol_in[111].flags, 202) + << "incorrect value for sol_in[111].flags, expected 202, is " + << last_msg_->sol_in[111].flags; + EXPECT_EQ(last_msg_->sol_in[111].sensor_type, 166) + << "incorrect value for sol_in[111].sensor_type, expected 166, is " + << last_msg_->sol_in[111].sensor_type; + EXPECT_EQ(last_msg_->sol_in[112].flags, 170) + << "incorrect value for sol_in[112].flags, expected 170, is " + << last_msg_->sol_in[112].flags; + EXPECT_EQ(last_msg_->sol_in[112].sensor_type, 127) + << "incorrect value for sol_in[112].sensor_type, expected 127, is " + << last_msg_->sol_in[112].sensor_type; + EXPECT_EQ(last_msg_->sol_in[113].flags, 193) + << "incorrect value for sol_in[113].flags, expected 193, is " + << last_msg_->sol_in[113].flags; + EXPECT_EQ(last_msg_->sol_in[113].sensor_type, 58) + << "incorrect value for sol_in[113].sensor_type, expected 58, is " + << last_msg_->sol_in[113].sensor_type; + EXPECT_EQ(last_msg_->sol_in[114].flags, 125) + << "incorrect value for sol_in[114].flags, expected 125, is " + << last_msg_->sol_in[114].flags; + EXPECT_EQ(last_msg_->sol_in[114].sensor_type, 215) + << "incorrect value for sol_in[114].sensor_type, expected 215, is " + << last_msg_->sol_in[114].sensor_type; + EXPECT_EQ(last_msg_->sol_in[115].flags, 58) + << "incorrect value for sol_in[115].flags, expected 58, is " + << last_msg_->sol_in[115].flags; + EXPECT_EQ(last_msg_->sol_in[115].sensor_type, 22) + << "incorrect value for sol_in[115].sensor_type, expected 22, is " + << last_msg_->sol_in[115].sensor_type; + EXPECT_EQ(last_msg_->sol_in[116].flags, 47) + << "incorrect value for sol_in[116].flags, expected 47, is " + << last_msg_->sol_in[116].flags; + EXPECT_EQ(last_msg_->sol_in[116].sensor_type, 135) + << "incorrect value for sol_in[116].sensor_type, expected 135, is " + << last_msg_->sol_in[116].sensor_type; + EXPECT_EQ(last_msg_->sol_in[117].flags, 142) + << "incorrect value for sol_in[117].flags, expected 142, is " + << last_msg_->sol_in[117].flags; + EXPECT_EQ(last_msg_->sol_in[117].sensor_type, 88) + << "incorrect value for sol_in[117].sensor_type, expected 88, is " + << last_msg_->sol_in[117].sensor_type; + EXPECT_EQ(last_msg_->vdop, 41989) + << "incorrect value for vdop, expected 41989, is " << last_msg_->vdop; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrCodeBiases.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrCodeBiases.cc index bec3607d1..92ea05649 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrCodeBiases.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrCodeBiases.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodeBiases.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodeBiases.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrCodeBiases0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrCodeBiases0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrCodeBiases0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrCodeBiases0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_code_biases_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_code_biases_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,693 +81,1044 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrCodeBiases0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_code_biases_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrCodeBiases0, Test) -{ +}; - uint8_t encoded_frame[] = {85,225,5,39,87,253,208,90,19,23,9,66,133,241,254,132,51,4,131,240,120,83,148,209,213,62,228,232,71,66,188,210,128,54,131,152,129,111,139,242,177,145,44,9,245,207,241,202,150,141,50,159,220,139,37,187,98,191,23,128,136,167,200,6,211,90,23,244,138,215,209,139,13,101,32,7,18,29,70,250,109,73,202,79,144,9,146,69,241,52,22,99,98,204,3,171,230,180,75,62,145,86,130,31,30,155,37,18,55,210,39,127,242,66,13,237,152,170,212,15,246,59,94,180,195,157,69,100,119,16,68,179,175,144,113,81,82,30,151,21,109,41,225,8,77,164,157,0,73,30,6,78,81,143,116,240,151,55,185,169,254,51,39,74,175,247,34,97,74,97,176,48,236,173,12,174,101,130,30,169,193,190,204,196,123,107,25,225,74,9,10,55,3,131,246,99,133,34,227,203,68,18,97,223,89,192,246,50,69,91,10,151,74,118,110,36,168,247,160,77,179,141,178,99,191,120,77,192,91,224,1,226,50,87,146,148,238,100,179,125,227,215,104,184,31,57,90,79,21,156,245,81,60,93,170,60,200,167,13,125,132, }; +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrCodeBiases0, Test) { + uint8_t encoded_frame[] = { + 85, 225, 5, 39, 87, 253, 208, 90, 19, 23, 9, 66, 133, 241, 254, + 132, 51, 4, 131, 240, 120, 83, 148, 209, 213, 62, 228, 232, 71, 66, + 188, 210, 128, 54, 131, 152, 129, 111, 139, 242, 177, 145, 44, 9, 245, + 207, 241, 202, 150, 141, 50, 159, 220, 139, 37, 187, 98, 191, 23, 128, + 136, 167, 200, 6, 211, 90, 23, 244, 138, 215, 209, 139, 13, 101, 32, + 7, 18, 29, 70, 250, 109, 73, 202, 79, 144, 9, 146, 69, 241, 52, + 22, 99, 98, 204, 3, 171, 230, 180, 75, 62, 145, 86, 130, 31, 30, + 155, 37, 18, 55, 210, 39, 127, 242, 66, 13, 237, 152, 170, 212, 15, + 246, 59, 94, 180, 195, 157, 69, 100, 119, 16, 68, 179, 175, 144, 113, + 81, 82, 30, 151, 21, 109, 41, 225, 8, 77, 164, 157, 0, 73, 30, + 6, 78, 81, 143, 116, 240, 151, 55, 185, 169, 254, 51, 39, 74, 175, + 247, 34, 97, 74, 97, 176, 48, 236, 173, 12, 174, 101, 130, 30, 169, + 193, 190, 204, 196, 123, 107, 25, 225, 74, 9, 10, 55, 3, 131, 246, + 99, 133, 34, 227, 203, 68, 18, 97, 223, 89, 192, 246, 50, 69, 91, + 10, 151, 74, 118, 110, 36, 168, 247, 160, 77, 179, 141, 178, 99, 191, + 120, 77, 192, 91, 224, 1, 226, 50, 87, 146, 148, 238, 100, 179, 125, + 227, 215, 104, 184, 31, 57, 90, 79, 21, 156, 245, 81, 60, 93, 170, + 60, 200, 167, 13, 125, 132, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_code_biases_t* test_msg = ( msg_ssr_code_biases_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[0].code = 51; - test_msg->biases[0].value = -31996; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[1].code = 240; - test_msg->biases[1].value = 21368; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[2].code = 148; - test_msg->biases[2].value = -10799; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[3].code = 62; - test_msg->biases[3].value = -5916; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[4].code = 71; - test_msg->biases[4].value = -17342; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[5].code = 210; - test_msg->biases[5].value = 13952; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[6].code = 131; - test_msg->biases[6].value = -32360; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[7].code = 111; - test_msg->biases[7].value = -3445; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[8].code = 177; - test_msg->biases[8].value = 11409; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[9].code = 9; - test_msg->biases[9].value = -12299; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[10].code = 241; - test_msg->biases[10].value = -26934; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[11].code = 141; - test_msg->biases[11].value = -24782; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[12].code = 220; - test_msg->biases[12].value = 9611; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[13].code = 187; - test_msg->biases[13].value = -16542; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[14].code = 23; - test_msg->biases[14].value = -30592; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[15].code = 167; - test_msg->biases[15].value = 1736; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[16].code = 211; - test_msg->biases[16].value = 5978; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[17].code = 244; - test_msg->biases[17].value = -10358; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[18].code = 209; - test_msg->biases[18].value = 3467; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[19].code = 101; - test_msg->biases[19].value = 1824; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[20].code = 18; - test_msg->biases[20].value = 17949; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[21].code = 250; - test_msg->biases[21].value = 18797; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[22].code = 202; - test_msg->biases[22].value = -28593; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[23].code = 9; - test_msg->biases[23].value = 17810; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[24].code = 241; - test_msg->biases[24].value = 5684; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[25].code = 99; - test_msg->biases[25].value = -13214; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[26].code = 3; - test_msg->biases[26].value = -6485; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[27].code = 180; - test_msg->biases[27].value = 15947; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[28].code = 145; - test_msg->biases[28].value = -32170; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[29].code = 31; - test_msg->biases[29].value = -25826; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[30].code = 37; - test_msg->biases[30].value = 14098; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[31].code = 210; - test_msg->biases[31].value = 32551; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[32].code = 242; - test_msg->biases[32].value = 3394; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[33].code = 237; - test_msg->biases[33].value = -21864; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[34].code = 212; - test_msg->biases[34].value = -2545; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[35].code = 59; - test_msg->biases[35].value = -19362; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[36].code = 195; - test_msg->biases[36].value = 17821; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[37].code = 100; - test_msg->biases[37].value = 4215; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[38].code = 68; - test_msg->biases[38].value = -20557; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[39].code = 144; - test_msg->biases[39].value = 20849; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[40].code = 82; - test_msg->biases[40].value = -26850; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[41].code = 21; - test_msg->biases[41].value = 10605; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[42].code = 225; - test_msg->biases[42].value = 19720; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[43].code = 164; - test_msg->biases[43].value = 157; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[44].code = 73; - test_msg->biases[44].value = 1566; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[45].code = 78; - test_msg->biases[45].value = -28847; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[46].code = 116; - test_msg->biases[46].value = -26640; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[47].code = 55; - test_msg->biases[47].value = -22087; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[48].code = 254; - test_msg->biases[48].value = 10035; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[49].code = 74; - test_msg->biases[49].value = -2129; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[50].code = 34; - test_msg->biases[50].value = 19041; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[51].code = 97; - test_msg->biases[51].value = 12464; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[52].code = 236; - test_msg->biases[52].value = 3245; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[53].code = 174; - test_msg->biases[53].value = -32155; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[54].code = 30; - test_msg->biases[54].value = -15959; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[55].code = 190; - test_msg->biases[55].value = -15156; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[56].code = 123; - test_msg->biases[56].value = 6507; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[57].code = 225; - test_msg->biases[57].value = 2378; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[58].code = 10; - test_msg->biases[58].value = 823; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[59].code = 131; - test_msg->biases[59].value = 25590; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[60].code = 133; - test_msg->biases[60].value = -7390; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[61].code = 203; - test_msg->biases[61].value = 4676; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[62].code = 97; - test_msg->biases[62].value = 23007; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[63].code = 192; - test_msg->biases[63].value = 13046; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[64].code = 69; - test_msg->biases[64].value = 2651; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[65].code = 151; - test_msg->biases[65].value = 30282; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[66].code = 110; - test_msg->biases[66].value = -22492; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[67].code = 247; - test_msg->biases[67].value = 19872; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[68].code = 179; - test_msg->biases[68].value = -19827; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[69].code = 99; - test_msg->biases[69].value = 30911; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[70].code = 77; - test_msg->biases[70].value = 23488; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[71].code = 224; - test_msg->biases[71].value = -7679; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[72].code = 50; - test_msg->biases[72].value = -28073; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[73].code = 148; - test_msg->biases[73].value = 25838; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[74].code = 179; - test_msg->biases[74].value = -7299; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[75].code = 215; - test_msg->biases[75].value = -18328; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[76].code = 31; - test_msg->biases[76].value = 23097; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[77].code = 79; - test_msg->biases[77].value = -25579; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[78].code = 245; - test_msg->biases[78].value = 15441; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[79].code = 93; - test_msg->biases[79].value = 15530; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[80].code = 200; - test_msg->biases[80].value = 3495; - test_msg->iod_ssr = 132; - test_msg->sid.code = 241; - test_msg->sid.sat = 133; - test_msg->time.tow = 387144400; - test_msg->time.wn = 16905; - test_msg->update_interval = 254; - - EXPECT_EQ(send_message( 0x5e1, 22311, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_code_biases_t *test_msg = (msg_ssr_code_biases_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[0].code = 51; + test_msg->biases[0].value = -31996; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[1].code = 240; + test_msg->biases[1].value = 21368; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[2].code = 148; + test_msg->biases[2].value = -10799; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[3].code = 62; + test_msg->biases[3].value = -5916; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[4].code = 71; + test_msg->biases[4].value = -17342; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[5].code = 210; + test_msg->biases[5].value = 13952; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[6].code = 131; + test_msg->biases[6].value = -32360; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[7].code = 111; + test_msg->biases[7].value = -3445; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[8].code = 177; + test_msg->biases[8].value = 11409; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[9].code = 9; + test_msg->biases[9].value = -12299; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[10].code = 241; + test_msg->biases[10].value = -26934; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[11].code = 141; + test_msg->biases[11].value = -24782; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[12].code = 220; + test_msg->biases[12].value = 9611; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[13].code = 187; + test_msg->biases[13].value = -16542; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[14].code = 23; + test_msg->biases[14].value = -30592; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[15].code = 167; + test_msg->biases[15].value = 1736; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[16].code = 211; + test_msg->biases[16].value = 5978; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[17].code = 244; + test_msg->biases[17].value = -10358; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[18].code = 209; + test_msg->biases[18].value = 3467; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[19].code = 101; + test_msg->biases[19].value = 1824; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[20].code = 18; + test_msg->biases[20].value = 17949; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[21].code = 250; + test_msg->biases[21].value = 18797; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[22].code = 202; + test_msg->biases[22].value = -28593; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[23].code = 9; + test_msg->biases[23].value = 17810; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[24].code = 241; + test_msg->biases[24].value = 5684; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[25].code = 99; + test_msg->biases[25].value = -13214; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[26].code = 3; + test_msg->biases[26].value = -6485; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[27].code = 180; + test_msg->biases[27].value = 15947; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[28].code = 145; + test_msg->biases[28].value = -32170; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[29].code = 31; + test_msg->biases[29].value = -25826; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[30].code = 37; + test_msg->biases[30].value = 14098; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[31].code = 210; + test_msg->biases[31].value = 32551; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[32].code = 242; + test_msg->biases[32].value = 3394; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[33].code = 237; + test_msg->biases[33].value = -21864; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[34].code = 212; + test_msg->biases[34].value = -2545; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[35].code = 59; + test_msg->biases[35].value = -19362; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[36].code = 195; + test_msg->biases[36].value = 17821; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[37].code = 100; + test_msg->biases[37].value = 4215; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[38].code = 68; + test_msg->biases[38].value = -20557; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[39].code = 144; + test_msg->biases[39].value = 20849; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[40].code = 82; + test_msg->biases[40].value = -26850; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[41].code = 21; + test_msg->biases[41].value = 10605; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[42].code = 225; + test_msg->biases[42].value = 19720; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[43].code = 164; + test_msg->biases[43].value = 157; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[44].code = 73; + test_msg->biases[44].value = 1566; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[45].code = 78; + test_msg->biases[45].value = -28847; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[46].code = 116; + test_msg->biases[46].value = -26640; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[47].code = 55; + test_msg->biases[47].value = -22087; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[48].code = 254; + test_msg->biases[48].value = 10035; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[49].code = 74; + test_msg->biases[49].value = -2129; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[50].code = 34; + test_msg->biases[50].value = 19041; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[51].code = 97; + test_msg->biases[51].value = 12464; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[52].code = 236; + test_msg->biases[52].value = 3245; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[53].code = 174; + test_msg->biases[53].value = -32155; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[54].code = 30; + test_msg->biases[54].value = -15959; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[55].code = 190; + test_msg->biases[55].value = -15156; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[56].code = 123; + test_msg->biases[56].value = 6507; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[57].code = 225; + test_msg->biases[57].value = 2378; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[58].code = 10; + test_msg->biases[58].value = 823; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[59].code = 131; + test_msg->biases[59].value = 25590; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[60].code = 133; + test_msg->biases[60].value = -7390; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[61].code = 203; + test_msg->biases[61].value = 4676; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[62].code = 97; + test_msg->biases[62].value = 23007; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[63].code = 192; + test_msg->biases[63].value = 13046; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[64].code = 69; + test_msg->biases[64].value = 2651; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[65].code = 151; + test_msg->biases[65].value = 30282; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[66].code = 110; + test_msg->biases[66].value = -22492; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[67].code = 247; + test_msg->biases[67].value = 19872; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[68].code = 179; + test_msg->biases[68].value = -19827; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[69].code = 99; + test_msg->biases[69].value = 30911; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[70].code = 77; + test_msg->biases[70].value = 23488; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[71].code = 224; + test_msg->biases[71].value = -7679; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[72].code = 50; + test_msg->biases[72].value = -28073; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[73].code = 148; + test_msg->biases[73].value = 25838; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[74].code = 179; + test_msg->biases[74].value = -7299; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[75].code = 215; + test_msg->biases[75].value = -18328; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[76].code = 31; + test_msg->biases[76].value = 23097; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[77].code = 79; + test_msg->biases[77].value = -25579; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[78].code = 245; + test_msg->biases[78].value = 15441; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[79].code = 93; + test_msg->biases[79].value = 15530; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[80].code = 200; + test_msg->biases[80].value = 3495; + test_msg->iod_ssr = 132; + test_msg->sid.code = 241; + test_msg->sid.sat = 133; + test_msg->time.tow = 387144400; + test_msg->time.wn = 16905; + test_msg->update_interval = 254; + + EXPECT_EQ(send_message(0x5e1, 22311, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 22311); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->biases[0].code, 51) << "incorrect value for biases[0].code, expected 51, is " << last_msg_->biases[0].code; - EXPECT_EQ(last_msg_->biases[0].value, -31996) << "incorrect value for biases[0].value, expected -31996, is " << last_msg_->biases[0].value; - EXPECT_EQ(last_msg_->biases[1].code, 240) << "incorrect value for biases[1].code, expected 240, is " << last_msg_->biases[1].code; - EXPECT_EQ(last_msg_->biases[1].value, 21368) << "incorrect value for biases[1].value, expected 21368, is " << last_msg_->biases[1].value; - EXPECT_EQ(last_msg_->biases[2].code, 148) << "incorrect value for biases[2].code, expected 148, is " << last_msg_->biases[2].code; - EXPECT_EQ(last_msg_->biases[2].value, -10799) << "incorrect value for biases[2].value, expected -10799, is " << last_msg_->biases[2].value; - EXPECT_EQ(last_msg_->biases[3].code, 62) << "incorrect value for biases[3].code, expected 62, is " << last_msg_->biases[3].code; - EXPECT_EQ(last_msg_->biases[3].value, -5916) << "incorrect value for biases[3].value, expected -5916, is " << last_msg_->biases[3].value; - EXPECT_EQ(last_msg_->biases[4].code, 71) << "incorrect value for biases[4].code, expected 71, is " << last_msg_->biases[4].code; - EXPECT_EQ(last_msg_->biases[4].value, -17342) << "incorrect value for biases[4].value, expected -17342, is " << last_msg_->biases[4].value; - EXPECT_EQ(last_msg_->biases[5].code, 210) << "incorrect value for biases[5].code, expected 210, is " << last_msg_->biases[5].code; - EXPECT_EQ(last_msg_->biases[5].value, 13952) << "incorrect value for biases[5].value, expected 13952, is " << last_msg_->biases[5].value; - EXPECT_EQ(last_msg_->biases[6].code, 131) << "incorrect value for biases[6].code, expected 131, is " << last_msg_->biases[6].code; - EXPECT_EQ(last_msg_->biases[6].value, -32360) << "incorrect value for biases[6].value, expected -32360, is " << last_msg_->biases[6].value; - EXPECT_EQ(last_msg_->biases[7].code, 111) << "incorrect value for biases[7].code, expected 111, is " << last_msg_->biases[7].code; - EXPECT_EQ(last_msg_->biases[7].value, -3445) << "incorrect value for biases[7].value, expected -3445, is " << last_msg_->biases[7].value; - EXPECT_EQ(last_msg_->biases[8].code, 177) << "incorrect value for biases[8].code, expected 177, is " << last_msg_->biases[8].code; - EXPECT_EQ(last_msg_->biases[8].value, 11409) << "incorrect value for biases[8].value, expected 11409, is " << last_msg_->biases[8].value; - EXPECT_EQ(last_msg_->biases[9].code, 9) << "incorrect value for biases[9].code, expected 9, is " << last_msg_->biases[9].code; - EXPECT_EQ(last_msg_->biases[9].value, -12299) << "incorrect value for biases[9].value, expected -12299, is " << last_msg_->biases[9].value; - EXPECT_EQ(last_msg_->biases[10].code, 241) << "incorrect value for biases[10].code, expected 241, is " << last_msg_->biases[10].code; - EXPECT_EQ(last_msg_->biases[10].value, -26934) << "incorrect value for biases[10].value, expected -26934, is " << last_msg_->biases[10].value; - EXPECT_EQ(last_msg_->biases[11].code, 141) << "incorrect value for biases[11].code, expected 141, is " << last_msg_->biases[11].code; - EXPECT_EQ(last_msg_->biases[11].value, -24782) << "incorrect value for biases[11].value, expected -24782, is " << last_msg_->biases[11].value; - EXPECT_EQ(last_msg_->biases[12].code, 220) << "incorrect value for biases[12].code, expected 220, is " << last_msg_->biases[12].code; - EXPECT_EQ(last_msg_->biases[12].value, 9611) << "incorrect value for biases[12].value, expected 9611, is " << last_msg_->biases[12].value; - EXPECT_EQ(last_msg_->biases[13].code, 187) << "incorrect value for biases[13].code, expected 187, is " << last_msg_->biases[13].code; - EXPECT_EQ(last_msg_->biases[13].value, -16542) << "incorrect value for biases[13].value, expected -16542, is " << last_msg_->biases[13].value; - EXPECT_EQ(last_msg_->biases[14].code, 23) << "incorrect value for biases[14].code, expected 23, is " << last_msg_->biases[14].code; - EXPECT_EQ(last_msg_->biases[14].value, -30592) << "incorrect value for biases[14].value, expected -30592, is " << last_msg_->biases[14].value; - EXPECT_EQ(last_msg_->biases[15].code, 167) << "incorrect value for biases[15].code, expected 167, is " << last_msg_->biases[15].code; - EXPECT_EQ(last_msg_->biases[15].value, 1736) << "incorrect value for biases[15].value, expected 1736, is " << last_msg_->biases[15].value; - EXPECT_EQ(last_msg_->biases[16].code, 211) << "incorrect value for biases[16].code, expected 211, is " << last_msg_->biases[16].code; - EXPECT_EQ(last_msg_->biases[16].value, 5978) << "incorrect value for biases[16].value, expected 5978, is " << last_msg_->biases[16].value; - EXPECT_EQ(last_msg_->biases[17].code, 244) << "incorrect value for biases[17].code, expected 244, is " << last_msg_->biases[17].code; - EXPECT_EQ(last_msg_->biases[17].value, -10358) << "incorrect value for biases[17].value, expected -10358, is " << last_msg_->biases[17].value; - EXPECT_EQ(last_msg_->biases[18].code, 209) << "incorrect value for biases[18].code, expected 209, is " << last_msg_->biases[18].code; - EXPECT_EQ(last_msg_->biases[18].value, 3467) << "incorrect value for biases[18].value, expected 3467, is " << last_msg_->biases[18].value; - EXPECT_EQ(last_msg_->biases[19].code, 101) << "incorrect value for biases[19].code, expected 101, is " << last_msg_->biases[19].code; - EXPECT_EQ(last_msg_->biases[19].value, 1824) << "incorrect value for biases[19].value, expected 1824, is " << last_msg_->biases[19].value; - EXPECT_EQ(last_msg_->biases[20].code, 18) << "incorrect value for biases[20].code, expected 18, is " << last_msg_->biases[20].code; - EXPECT_EQ(last_msg_->biases[20].value, 17949) << "incorrect value for biases[20].value, expected 17949, is " << last_msg_->biases[20].value; - EXPECT_EQ(last_msg_->biases[21].code, 250) << "incorrect value for biases[21].code, expected 250, is " << last_msg_->biases[21].code; - EXPECT_EQ(last_msg_->biases[21].value, 18797) << "incorrect value for biases[21].value, expected 18797, is " << last_msg_->biases[21].value; - EXPECT_EQ(last_msg_->biases[22].code, 202) << "incorrect value for biases[22].code, expected 202, is " << last_msg_->biases[22].code; - EXPECT_EQ(last_msg_->biases[22].value, -28593) << "incorrect value for biases[22].value, expected -28593, is " << last_msg_->biases[22].value; - EXPECT_EQ(last_msg_->biases[23].code, 9) << "incorrect value for biases[23].code, expected 9, is " << last_msg_->biases[23].code; - EXPECT_EQ(last_msg_->biases[23].value, 17810) << "incorrect value for biases[23].value, expected 17810, is " << last_msg_->biases[23].value; - EXPECT_EQ(last_msg_->biases[24].code, 241) << "incorrect value for biases[24].code, expected 241, is " << last_msg_->biases[24].code; - EXPECT_EQ(last_msg_->biases[24].value, 5684) << "incorrect value for biases[24].value, expected 5684, is " << last_msg_->biases[24].value; - EXPECT_EQ(last_msg_->biases[25].code, 99) << "incorrect value for biases[25].code, expected 99, is " << last_msg_->biases[25].code; - EXPECT_EQ(last_msg_->biases[25].value, -13214) << "incorrect value for biases[25].value, expected -13214, is " << last_msg_->biases[25].value; - EXPECT_EQ(last_msg_->biases[26].code, 3) << "incorrect value for biases[26].code, expected 3, is " << last_msg_->biases[26].code; - EXPECT_EQ(last_msg_->biases[26].value, -6485) << "incorrect value for biases[26].value, expected -6485, is " << last_msg_->biases[26].value; - EXPECT_EQ(last_msg_->biases[27].code, 180) << "incorrect value for biases[27].code, expected 180, is " << last_msg_->biases[27].code; - EXPECT_EQ(last_msg_->biases[27].value, 15947) << "incorrect value for biases[27].value, expected 15947, is " << last_msg_->biases[27].value; - EXPECT_EQ(last_msg_->biases[28].code, 145) << "incorrect value for biases[28].code, expected 145, is " << last_msg_->biases[28].code; - EXPECT_EQ(last_msg_->biases[28].value, -32170) << "incorrect value for biases[28].value, expected -32170, is " << last_msg_->biases[28].value; - EXPECT_EQ(last_msg_->biases[29].code, 31) << "incorrect value for biases[29].code, expected 31, is " << last_msg_->biases[29].code; - EXPECT_EQ(last_msg_->biases[29].value, -25826) << "incorrect value for biases[29].value, expected -25826, is " << last_msg_->biases[29].value; - EXPECT_EQ(last_msg_->biases[30].code, 37) << "incorrect value for biases[30].code, expected 37, is " << last_msg_->biases[30].code; - EXPECT_EQ(last_msg_->biases[30].value, 14098) << "incorrect value for biases[30].value, expected 14098, is " << last_msg_->biases[30].value; - EXPECT_EQ(last_msg_->biases[31].code, 210) << "incorrect value for biases[31].code, expected 210, is " << last_msg_->biases[31].code; - EXPECT_EQ(last_msg_->biases[31].value, 32551) << "incorrect value for biases[31].value, expected 32551, is " << last_msg_->biases[31].value; - EXPECT_EQ(last_msg_->biases[32].code, 242) << "incorrect value for biases[32].code, expected 242, is " << last_msg_->biases[32].code; - EXPECT_EQ(last_msg_->biases[32].value, 3394) << "incorrect value for biases[32].value, expected 3394, is " << last_msg_->biases[32].value; - EXPECT_EQ(last_msg_->biases[33].code, 237) << "incorrect value for biases[33].code, expected 237, is " << last_msg_->biases[33].code; - EXPECT_EQ(last_msg_->biases[33].value, -21864) << "incorrect value for biases[33].value, expected -21864, is " << last_msg_->biases[33].value; - EXPECT_EQ(last_msg_->biases[34].code, 212) << "incorrect value for biases[34].code, expected 212, is " << last_msg_->biases[34].code; - EXPECT_EQ(last_msg_->biases[34].value, -2545) << "incorrect value for biases[34].value, expected -2545, is " << last_msg_->biases[34].value; - EXPECT_EQ(last_msg_->biases[35].code, 59) << "incorrect value for biases[35].code, expected 59, is " << last_msg_->biases[35].code; - EXPECT_EQ(last_msg_->biases[35].value, -19362) << "incorrect value for biases[35].value, expected -19362, is " << last_msg_->biases[35].value; - EXPECT_EQ(last_msg_->biases[36].code, 195) << "incorrect value for biases[36].code, expected 195, is " << last_msg_->biases[36].code; - EXPECT_EQ(last_msg_->biases[36].value, 17821) << "incorrect value for biases[36].value, expected 17821, is " << last_msg_->biases[36].value; - EXPECT_EQ(last_msg_->biases[37].code, 100) << "incorrect value for biases[37].code, expected 100, is " << last_msg_->biases[37].code; - EXPECT_EQ(last_msg_->biases[37].value, 4215) << "incorrect value for biases[37].value, expected 4215, is " << last_msg_->biases[37].value; - EXPECT_EQ(last_msg_->biases[38].code, 68) << "incorrect value for biases[38].code, expected 68, is " << last_msg_->biases[38].code; - EXPECT_EQ(last_msg_->biases[38].value, -20557) << "incorrect value for biases[38].value, expected -20557, is " << last_msg_->biases[38].value; - EXPECT_EQ(last_msg_->biases[39].code, 144) << "incorrect value for biases[39].code, expected 144, is " << last_msg_->biases[39].code; - EXPECT_EQ(last_msg_->biases[39].value, 20849) << "incorrect value for biases[39].value, expected 20849, is " << last_msg_->biases[39].value; - EXPECT_EQ(last_msg_->biases[40].code, 82) << "incorrect value for biases[40].code, expected 82, is " << last_msg_->biases[40].code; - EXPECT_EQ(last_msg_->biases[40].value, -26850) << "incorrect value for biases[40].value, expected -26850, is " << last_msg_->biases[40].value; - EXPECT_EQ(last_msg_->biases[41].code, 21) << "incorrect value for biases[41].code, expected 21, is " << last_msg_->biases[41].code; - EXPECT_EQ(last_msg_->biases[41].value, 10605) << "incorrect value for biases[41].value, expected 10605, is " << last_msg_->biases[41].value; - EXPECT_EQ(last_msg_->biases[42].code, 225) << "incorrect value for biases[42].code, expected 225, is " << last_msg_->biases[42].code; - EXPECT_EQ(last_msg_->biases[42].value, 19720) << "incorrect value for biases[42].value, expected 19720, is " << last_msg_->biases[42].value; - EXPECT_EQ(last_msg_->biases[43].code, 164) << "incorrect value for biases[43].code, expected 164, is " << last_msg_->biases[43].code; - EXPECT_EQ(last_msg_->biases[43].value, 157) << "incorrect value for biases[43].value, expected 157, is " << last_msg_->biases[43].value; - EXPECT_EQ(last_msg_->biases[44].code, 73) << "incorrect value for biases[44].code, expected 73, is " << last_msg_->biases[44].code; - EXPECT_EQ(last_msg_->biases[44].value, 1566) << "incorrect value for biases[44].value, expected 1566, is " << last_msg_->biases[44].value; - EXPECT_EQ(last_msg_->biases[45].code, 78) << "incorrect value for biases[45].code, expected 78, is " << last_msg_->biases[45].code; - EXPECT_EQ(last_msg_->biases[45].value, -28847) << "incorrect value for biases[45].value, expected -28847, is " << last_msg_->biases[45].value; - EXPECT_EQ(last_msg_->biases[46].code, 116) << "incorrect value for biases[46].code, expected 116, is " << last_msg_->biases[46].code; - EXPECT_EQ(last_msg_->biases[46].value, -26640) << "incorrect value for biases[46].value, expected -26640, is " << last_msg_->biases[46].value; - EXPECT_EQ(last_msg_->biases[47].code, 55) << "incorrect value for biases[47].code, expected 55, is " << last_msg_->biases[47].code; - EXPECT_EQ(last_msg_->biases[47].value, -22087) << "incorrect value for biases[47].value, expected -22087, is " << last_msg_->biases[47].value; - EXPECT_EQ(last_msg_->biases[48].code, 254) << "incorrect value for biases[48].code, expected 254, is " << last_msg_->biases[48].code; - EXPECT_EQ(last_msg_->biases[48].value, 10035) << "incorrect value for biases[48].value, expected 10035, is " << last_msg_->biases[48].value; - EXPECT_EQ(last_msg_->biases[49].code, 74) << "incorrect value for biases[49].code, expected 74, is " << last_msg_->biases[49].code; - EXPECT_EQ(last_msg_->biases[49].value, -2129) << "incorrect value for biases[49].value, expected -2129, is " << last_msg_->biases[49].value; - EXPECT_EQ(last_msg_->biases[50].code, 34) << "incorrect value for biases[50].code, expected 34, is " << last_msg_->biases[50].code; - EXPECT_EQ(last_msg_->biases[50].value, 19041) << "incorrect value for biases[50].value, expected 19041, is " << last_msg_->biases[50].value; - EXPECT_EQ(last_msg_->biases[51].code, 97) << "incorrect value for biases[51].code, expected 97, is " << last_msg_->biases[51].code; - EXPECT_EQ(last_msg_->biases[51].value, 12464) << "incorrect value for biases[51].value, expected 12464, is " << last_msg_->biases[51].value; - EXPECT_EQ(last_msg_->biases[52].code, 236) << "incorrect value for biases[52].code, expected 236, is " << last_msg_->biases[52].code; - EXPECT_EQ(last_msg_->biases[52].value, 3245) << "incorrect value for biases[52].value, expected 3245, is " << last_msg_->biases[52].value; - EXPECT_EQ(last_msg_->biases[53].code, 174) << "incorrect value for biases[53].code, expected 174, is " << last_msg_->biases[53].code; - EXPECT_EQ(last_msg_->biases[53].value, -32155) << "incorrect value for biases[53].value, expected -32155, is " << last_msg_->biases[53].value; - EXPECT_EQ(last_msg_->biases[54].code, 30) << "incorrect value for biases[54].code, expected 30, is " << last_msg_->biases[54].code; - EXPECT_EQ(last_msg_->biases[54].value, -15959) << "incorrect value for biases[54].value, expected -15959, is " << last_msg_->biases[54].value; - EXPECT_EQ(last_msg_->biases[55].code, 190) << "incorrect value for biases[55].code, expected 190, is " << last_msg_->biases[55].code; - EXPECT_EQ(last_msg_->biases[55].value, -15156) << "incorrect value for biases[55].value, expected -15156, is " << last_msg_->biases[55].value; - EXPECT_EQ(last_msg_->biases[56].code, 123) << "incorrect value for biases[56].code, expected 123, is " << last_msg_->biases[56].code; - EXPECT_EQ(last_msg_->biases[56].value, 6507) << "incorrect value for biases[56].value, expected 6507, is " << last_msg_->biases[56].value; - EXPECT_EQ(last_msg_->biases[57].code, 225) << "incorrect value for biases[57].code, expected 225, is " << last_msg_->biases[57].code; - EXPECT_EQ(last_msg_->biases[57].value, 2378) << "incorrect value for biases[57].value, expected 2378, is " << last_msg_->biases[57].value; - EXPECT_EQ(last_msg_->biases[58].code, 10) << "incorrect value for biases[58].code, expected 10, is " << last_msg_->biases[58].code; - EXPECT_EQ(last_msg_->biases[58].value, 823) << "incorrect value for biases[58].value, expected 823, is " << last_msg_->biases[58].value; - EXPECT_EQ(last_msg_->biases[59].code, 131) << "incorrect value for biases[59].code, expected 131, is " << last_msg_->biases[59].code; - EXPECT_EQ(last_msg_->biases[59].value, 25590) << "incorrect value for biases[59].value, expected 25590, is " << last_msg_->biases[59].value; - EXPECT_EQ(last_msg_->biases[60].code, 133) << "incorrect value for biases[60].code, expected 133, is " << last_msg_->biases[60].code; - EXPECT_EQ(last_msg_->biases[60].value, -7390) << "incorrect value for biases[60].value, expected -7390, is " << last_msg_->biases[60].value; - EXPECT_EQ(last_msg_->biases[61].code, 203) << "incorrect value for biases[61].code, expected 203, is " << last_msg_->biases[61].code; - EXPECT_EQ(last_msg_->biases[61].value, 4676) << "incorrect value for biases[61].value, expected 4676, is " << last_msg_->biases[61].value; - EXPECT_EQ(last_msg_->biases[62].code, 97) << "incorrect value for biases[62].code, expected 97, is " << last_msg_->biases[62].code; - EXPECT_EQ(last_msg_->biases[62].value, 23007) << "incorrect value for biases[62].value, expected 23007, is " << last_msg_->biases[62].value; - EXPECT_EQ(last_msg_->biases[63].code, 192) << "incorrect value for biases[63].code, expected 192, is " << last_msg_->biases[63].code; - EXPECT_EQ(last_msg_->biases[63].value, 13046) << "incorrect value for biases[63].value, expected 13046, is " << last_msg_->biases[63].value; - EXPECT_EQ(last_msg_->biases[64].code, 69) << "incorrect value for biases[64].code, expected 69, is " << last_msg_->biases[64].code; - EXPECT_EQ(last_msg_->biases[64].value, 2651) << "incorrect value for biases[64].value, expected 2651, is " << last_msg_->biases[64].value; - EXPECT_EQ(last_msg_->biases[65].code, 151) << "incorrect value for biases[65].code, expected 151, is " << last_msg_->biases[65].code; - EXPECT_EQ(last_msg_->biases[65].value, 30282) << "incorrect value for biases[65].value, expected 30282, is " << last_msg_->biases[65].value; - EXPECT_EQ(last_msg_->biases[66].code, 110) << "incorrect value for biases[66].code, expected 110, is " << last_msg_->biases[66].code; - EXPECT_EQ(last_msg_->biases[66].value, -22492) << "incorrect value for biases[66].value, expected -22492, is " << last_msg_->biases[66].value; - EXPECT_EQ(last_msg_->biases[67].code, 247) << "incorrect value for biases[67].code, expected 247, is " << last_msg_->biases[67].code; - EXPECT_EQ(last_msg_->biases[67].value, 19872) << "incorrect value for biases[67].value, expected 19872, is " << last_msg_->biases[67].value; - EXPECT_EQ(last_msg_->biases[68].code, 179) << "incorrect value for biases[68].code, expected 179, is " << last_msg_->biases[68].code; - EXPECT_EQ(last_msg_->biases[68].value, -19827) << "incorrect value for biases[68].value, expected -19827, is " << last_msg_->biases[68].value; - EXPECT_EQ(last_msg_->biases[69].code, 99) << "incorrect value for biases[69].code, expected 99, is " << last_msg_->biases[69].code; - EXPECT_EQ(last_msg_->biases[69].value, 30911) << "incorrect value for biases[69].value, expected 30911, is " << last_msg_->biases[69].value; - EXPECT_EQ(last_msg_->biases[70].code, 77) << "incorrect value for biases[70].code, expected 77, is " << last_msg_->biases[70].code; - EXPECT_EQ(last_msg_->biases[70].value, 23488) << "incorrect value for biases[70].value, expected 23488, is " << last_msg_->biases[70].value; - EXPECT_EQ(last_msg_->biases[71].code, 224) << "incorrect value for biases[71].code, expected 224, is " << last_msg_->biases[71].code; - EXPECT_EQ(last_msg_->biases[71].value, -7679) << "incorrect value for biases[71].value, expected -7679, is " << last_msg_->biases[71].value; - EXPECT_EQ(last_msg_->biases[72].code, 50) << "incorrect value for biases[72].code, expected 50, is " << last_msg_->biases[72].code; - EXPECT_EQ(last_msg_->biases[72].value, -28073) << "incorrect value for biases[72].value, expected -28073, is " << last_msg_->biases[72].value; - EXPECT_EQ(last_msg_->biases[73].code, 148) << "incorrect value for biases[73].code, expected 148, is " << last_msg_->biases[73].code; - EXPECT_EQ(last_msg_->biases[73].value, 25838) << "incorrect value for biases[73].value, expected 25838, is " << last_msg_->biases[73].value; - EXPECT_EQ(last_msg_->biases[74].code, 179) << "incorrect value for biases[74].code, expected 179, is " << last_msg_->biases[74].code; - EXPECT_EQ(last_msg_->biases[74].value, -7299) << "incorrect value for biases[74].value, expected -7299, is " << last_msg_->biases[74].value; - EXPECT_EQ(last_msg_->biases[75].code, 215) << "incorrect value for biases[75].code, expected 215, is " << last_msg_->biases[75].code; - EXPECT_EQ(last_msg_->biases[75].value, -18328) << "incorrect value for biases[75].value, expected -18328, is " << last_msg_->biases[75].value; - EXPECT_EQ(last_msg_->biases[76].code, 31) << "incorrect value for biases[76].code, expected 31, is " << last_msg_->biases[76].code; - EXPECT_EQ(last_msg_->biases[76].value, 23097) << "incorrect value for biases[76].value, expected 23097, is " << last_msg_->biases[76].value; - EXPECT_EQ(last_msg_->biases[77].code, 79) << "incorrect value for biases[77].code, expected 79, is " << last_msg_->biases[77].code; - EXPECT_EQ(last_msg_->biases[77].value, -25579) << "incorrect value for biases[77].value, expected -25579, is " << last_msg_->biases[77].value; - EXPECT_EQ(last_msg_->biases[78].code, 245) << "incorrect value for biases[78].code, expected 245, is " << last_msg_->biases[78].code; - EXPECT_EQ(last_msg_->biases[78].value, 15441) << "incorrect value for biases[78].value, expected 15441, is " << last_msg_->biases[78].value; - EXPECT_EQ(last_msg_->biases[79].code, 93) << "incorrect value for biases[79].code, expected 93, is " << last_msg_->biases[79].code; - EXPECT_EQ(last_msg_->biases[79].value, 15530) << "incorrect value for biases[79].value, expected 15530, is " << last_msg_->biases[79].value; - EXPECT_EQ(last_msg_->biases[80].code, 200) << "incorrect value for biases[80].code, expected 200, is " << last_msg_->biases[80].code; - EXPECT_EQ(last_msg_->biases[80].value, 3495) << "incorrect value for biases[80].value, expected 3495, is " << last_msg_->biases[80].value; - EXPECT_EQ(last_msg_->iod_ssr, 132) << "incorrect value for iod_ssr, expected 132, is " << last_msg_->iod_ssr; - EXPECT_EQ(last_msg_->sid.code, 241) << "incorrect value for sid.code, expected 241, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.sat, 133) << "incorrect value for sid.sat, expected 133, is " << last_msg_->sid.sat; - EXPECT_EQ(last_msg_->time.tow, 387144400) << "incorrect value for time.tow, expected 387144400, is " << last_msg_->time.tow; - EXPECT_EQ(last_msg_->time.wn, 16905) << "incorrect value for time.wn, expected 16905, is " << last_msg_->time.wn; - EXPECT_EQ(last_msg_->update_interval, 254) << "incorrect value for update_interval, expected 254, is " << last_msg_->update_interval; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 22311); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->biases[0].code, 51) + << "incorrect value for biases[0].code, expected 51, is " + << last_msg_->biases[0].code; + EXPECT_EQ(last_msg_->biases[0].value, -31996) + << "incorrect value for biases[0].value, expected -31996, is " + << last_msg_->biases[0].value; + EXPECT_EQ(last_msg_->biases[1].code, 240) + << "incorrect value for biases[1].code, expected 240, is " + << last_msg_->biases[1].code; + EXPECT_EQ(last_msg_->biases[1].value, 21368) + << "incorrect value for biases[1].value, expected 21368, is " + << last_msg_->biases[1].value; + EXPECT_EQ(last_msg_->biases[2].code, 148) + << "incorrect value for biases[2].code, expected 148, is " + << last_msg_->biases[2].code; + EXPECT_EQ(last_msg_->biases[2].value, -10799) + << "incorrect value for biases[2].value, expected -10799, is " + << last_msg_->biases[2].value; + EXPECT_EQ(last_msg_->biases[3].code, 62) + << "incorrect value for biases[3].code, expected 62, is " + << last_msg_->biases[3].code; + EXPECT_EQ(last_msg_->biases[3].value, -5916) + << "incorrect value for biases[3].value, expected -5916, is " + << last_msg_->biases[3].value; + EXPECT_EQ(last_msg_->biases[4].code, 71) + << "incorrect value for biases[4].code, expected 71, is " + << last_msg_->biases[4].code; + EXPECT_EQ(last_msg_->biases[4].value, -17342) + << "incorrect value for biases[4].value, expected -17342, is " + << last_msg_->biases[4].value; + EXPECT_EQ(last_msg_->biases[5].code, 210) + << "incorrect value for biases[5].code, expected 210, is " + << last_msg_->biases[5].code; + EXPECT_EQ(last_msg_->biases[5].value, 13952) + << "incorrect value for biases[5].value, expected 13952, is " + << last_msg_->biases[5].value; + EXPECT_EQ(last_msg_->biases[6].code, 131) + << "incorrect value for biases[6].code, expected 131, is " + << last_msg_->biases[6].code; + EXPECT_EQ(last_msg_->biases[6].value, -32360) + << "incorrect value for biases[6].value, expected -32360, is " + << last_msg_->biases[6].value; + EXPECT_EQ(last_msg_->biases[7].code, 111) + << "incorrect value for biases[7].code, expected 111, is " + << last_msg_->biases[7].code; + EXPECT_EQ(last_msg_->biases[7].value, -3445) + << "incorrect value for biases[7].value, expected -3445, is " + << last_msg_->biases[7].value; + EXPECT_EQ(last_msg_->biases[8].code, 177) + << "incorrect value for biases[8].code, expected 177, is " + << last_msg_->biases[8].code; + EXPECT_EQ(last_msg_->biases[8].value, 11409) + << "incorrect value for biases[8].value, expected 11409, is " + << last_msg_->biases[8].value; + EXPECT_EQ(last_msg_->biases[9].code, 9) + << "incorrect value for biases[9].code, expected 9, is " + << last_msg_->biases[9].code; + EXPECT_EQ(last_msg_->biases[9].value, -12299) + << "incorrect value for biases[9].value, expected -12299, is " + << last_msg_->biases[9].value; + EXPECT_EQ(last_msg_->biases[10].code, 241) + << "incorrect value for biases[10].code, expected 241, is " + << last_msg_->biases[10].code; + EXPECT_EQ(last_msg_->biases[10].value, -26934) + << "incorrect value for biases[10].value, expected -26934, is " + << last_msg_->biases[10].value; + EXPECT_EQ(last_msg_->biases[11].code, 141) + << "incorrect value for biases[11].code, expected 141, is " + << last_msg_->biases[11].code; + EXPECT_EQ(last_msg_->biases[11].value, -24782) + << "incorrect value for biases[11].value, expected -24782, is " + << last_msg_->biases[11].value; + EXPECT_EQ(last_msg_->biases[12].code, 220) + << "incorrect value for biases[12].code, expected 220, is " + << last_msg_->biases[12].code; + EXPECT_EQ(last_msg_->biases[12].value, 9611) + << "incorrect value for biases[12].value, expected 9611, is " + << last_msg_->biases[12].value; + EXPECT_EQ(last_msg_->biases[13].code, 187) + << "incorrect value for biases[13].code, expected 187, is " + << last_msg_->biases[13].code; + EXPECT_EQ(last_msg_->biases[13].value, -16542) + << "incorrect value for biases[13].value, expected -16542, is " + << last_msg_->biases[13].value; + EXPECT_EQ(last_msg_->biases[14].code, 23) + << "incorrect value for biases[14].code, expected 23, is " + << last_msg_->biases[14].code; + EXPECT_EQ(last_msg_->biases[14].value, -30592) + << "incorrect value for biases[14].value, expected -30592, is " + << last_msg_->biases[14].value; + EXPECT_EQ(last_msg_->biases[15].code, 167) + << "incorrect value for biases[15].code, expected 167, is " + << last_msg_->biases[15].code; + EXPECT_EQ(last_msg_->biases[15].value, 1736) + << "incorrect value for biases[15].value, expected 1736, is " + << last_msg_->biases[15].value; + EXPECT_EQ(last_msg_->biases[16].code, 211) + << "incorrect value for biases[16].code, expected 211, is " + << last_msg_->biases[16].code; + EXPECT_EQ(last_msg_->biases[16].value, 5978) + << "incorrect value for biases[16].value, expected 5978, is " + << last_msg_->biases[16].value; + EXPECT_EQ(last_msg_->biases[17].code, 244) + << "incorrect value for biases[17].code, expected 244, is " + << last_msg_->biases[17].code; + EXPECT_EQ(last_msg_->biases[17].value, -10358) + << "incorrect value for biases[17].value, expected -10358, is " + << last_msg_->biases[17].value; + EXPECT_EQ(last_msg_->biases[18].code, 209) + << "incorrect value for biases[18].code, expected 209, is " + << last_msg_->biases[18].code; + EXPECT_EQ(last_msg_->biases[18].value, 3467) + << "incorrect value for biases[18].value, expected 3467, is " + << last_msg_->biases[18].value; + EXPECT_EQ(last_msg_->biases[19].code, 101) + << "incorrect value for biases[19].code, expected 101, is " + << last_msg_->biases[19].code; + EXPECT_EQ(last_msg_->biases[19].value, 1824) + << "incorrect value for biases[19].value, expected 1824, is " + << last_msg_->biases[19].value; + EXPECT_EQ(last_msg_->biases[20].code, 18) + << "incorrect value for biases[20].code, expected 18, is " + << last_msg_->biases[20].code; + EXPECT_EQ(last_msg_->biases[20].value, 17949) + << "incorrect value for biases[20].value, expected 17949, is " + << last_msg_->biases[20].value; + EXPECT_EQ(last_msg_->biases[21].code, 250) + << "incorrect value for biases[21].code, expected 250, is " + << last_msg_->biases[21].code; + EXPECT_EQ(last_msg_->biases[21].value, 18797) + << "incorrect value for biases[21].value, expected 18797, is " + << last_msg_->biases[21].value; + EXPECT_EQ(last_msg_->biases[22].code, 202) + << "incorrect value for biases[22].code, expected 202, is " + << last_msg_->biases[22].code; + EXPECT_EQ(last_msg_->biases[22].value, -28593) + << "incorrect value for biases[22].value, expected -28593, is " + << last_msg_->biases[22].value; + EXPECT_EQ(last_msg_->biases[23].code, 9) + << "incorrect value for biases[23].code, expected 9, is " + << last_msg_->biases[23].code; + EXPECT_EQ(last_msg_->biases[23].value, 17810) + << "incorrect value for biases[23].value, expected 17810, is " + << last_msg_->biases[23].value; + EXPECT_EQ(last_msg_->biases[24].code, 241) + << "incorrect value for biases[24].code, expected 241, is " + << last_msg_->biases[24].code; + EXPECT_EQ(last_msg_->biases[24].value, 5684) + << "incorrect value for biases[24].value, expected 5684, is " + << last_msg_->biases[24].value; + EXPECT_EQ(last_msg_->biases[25].code, 99) + << "incorrect value for biases[25].code, expected 99, is " + << last_msg_->biases[25].code; + EXPECT_EQ(last_msg_->biases[25].value, -13214) + << "incorrect value for biases[25].value, expected -13214, is " + << last_msg_->biases[25].value; + EXPECT_EQ(last_msg_->biases[26].code, 3) + << "incorrect value for biases[26].code, expected 3, is " + << last_msg_->biases[26].code; + EXPECT_EQ(last_msg_->biases[26].value, -6485) + << "incorrect value for biases[26].value, expected -6485, is " + << last_msg_->biases[26].value; + EXPECT_EQ(last_msg_->biases[27].code, 180) + << "incorrect value for biases[27].code, expected 180, is " + << last_msg_->biases[27].code; + EXPECT_EQ(last_msg_->biases[27].value, 15947) + << "incorrect value for biases[27].value, expected 15947, is " + << last_msg_->biases[27].value; + EXPECT_EQ(last_msg_->biases[28].code, 145) + << "incorrect value for biases[28].code, expected 145, is " + << last_msg_->biases[28].code; + EXPECT_EQ(last_msg_->biases[28].value, -32170) + << "incorrect value for biases[28].value, expected -32170, is " + << last_msg_->biases[28].value; + EXPECT_EQ(last_msg_->biases[29].code, 31) + << "incorrect value for biases[29].code, expected 31, is " + << last_msg_->biases[29].code; + EXPECT_EQ(last_msg_->biases[29].value, -25826) + << "incorrect value for biases[29].value, expected -25826, is " + << last_msg_->biases[29].value; + EXPECT_EQ(last_msg_->biases[30].code, 37) + << "incorrect value for biases[30].code, expected 37, is " + << last_msg_->biases[30].code; + EXPECT_EQ(last_msg_->biases[30].value, 14098) + << "incorrect value for biases[30].value, expected 14098, is " + << last_msg_->biases[30].value; + EXPECT_EQ(last_msg_->biases[31].code, 210) + << "incorrect value for biases[31].code, expected 210, is " + << last_msg_->biases[31].code; + EXPECT_EQ(last_msg_->biases[31].value, 32551) + << "incorrect value for biases[31].value, expected 32551, is " + << last_msg_->biases[31].value; + EXPECT_EQ(last_msg_->biases[32].code, 242) + << "incorrect value for biases[32].code, expected 242, is " + << last_msg_->biases[32].code; + EXPECT_EQ(last_msg_->biases[32].value, 3394) + << "incorrect value for biases[32].value, expected 3394, is " + << last_msg_->biases[32].value; + EXPECT_EQ(last_msg_->biases[33].code, 237) + << "incorrect value for biases[33].code, expected 237, is " + << last_msg_->biases[33].code; + EXPECT_EQ(last_msg_->biases[33].value, -21864) + << "incorrect value for biases[33].value, expected -21864, is " + << last_msg_->biases[33].value; + EXPECT_EQ(last_msg_->biases[34].code, 212) + << "incorrect value for biases[34].code, expected 212, is " + << last_msg_->biases[34].code; + EXPECT_EQ(last_msg_->biases[34].value, -2545) + << "incorrect value for biases[34].value, expected -2545, is " + << last_msg_->biases[34].value; + EXPECT_EQ(last_msg_->biases[35].code, 59) + << "incorrect value for biases[35].code, expected 59, is " + << last_msg_->biases[35].code; + EXPECT_EQ(last_msg_->biases[35].value, -19362) + << "incorrect value for biases[35].value, expected -19362, is " + << last_msg_->biases[35].value; + EXPECT_EQ(last_msg_->biases[36].code, 195) + << "incorrect value for biases[36].code, expected 195, is " + << last_msg_->biases[36].code; + EXPECT_EQ(last_msg_->biases[36].value, 17821) + << "incorrect value for biases[36].value, expected 17821, is " + << last_msg_->biases[36].value; + EXPECT_EQ(last_msg_->biases[37].code, 100) + << "incorrect value for biases[37].code, expected 100, is " + << last_msg_->biases[37].code; + EXPECT_EQ(last_msg_->biases[37].value, 4215) + << "incorrect value for biases[37].value, expected 4215, is " + << last_msg_->biases[37].value; + EXPECT_EQ(last_msg_->biases[38].code, 68) + << "incorrect value for biases[38].code, expected 68, is " + << last_msg_->biases[38].code; + EXPECT_EQ(last_msg_->biases[38].value, -20557) + << "incorrect value for biases[38].value, expected -20557, is " + << last_msg_->biases[38].value; + EXPECT_EQ(last_msg_->biases[39].code, 144) + << "incorrect value for biases[39].code, expected 144, is " + << last_msg_->biases[39].code; + EXPECT_EQ(last_msg_->biases[39].value, 20849) + << "incorrect value for biases[39].value, expected 20849, is " + << last_msg_->biases[39].value; + EXPECT_EQ(last_msg_->biases[40].code, 82) + << "incorrect value for biases[40].code, expected 82, is " + << last_msg_->biases[40].code; + EXPECT_EQ(last_msg_->biases[40].value, -26850) + << "incorrect value for biases[40].value, expected -26850, is " + << last_msg_->biases[40].value; + EXPECT_EQ(last_msg_->biases[41].code, 21) + << "incorrect value for biases[41].code, expected 21, is " + << last_msg_->biases[41].code; + EXPECT_EQ(last_msg_->biases[41].value, 10605) + << "incorrect value for biases[41].value, expected 10605, is " + << last_msg_->biases[41].value; + EXPECT_EQ(last_msg_->biases[42].code, 225) + << "incorrect value for biases[42].code, expected 225, is " + << last_msg_->biases[42].code; + EXPECT_EQ(last_msg_->biases[42].value, 19720) + << "incorrect value for biases[42].value, expected 19720, is " + << last_msg_->biases[42].value; + EXPECT_EQ(last_msg_->biases[43].code, 164) + << "incorrect value for biases[43].code, expected 164, is " + << last_msg_->biases[43].code; + EXPECT_EQ(last_msg_->biases[43].value, 157) + << "incorrect value for biases[43].value, expected 157, is " + << last_msg_->biases[43].value; + EXPECT_EQ(last_msg_->biases[44].code, 73) + << "incorrect value for biases[44].code, expected 73, is " + << last_msg_->biases[44].code; + EXPECT_EQ(last_msg_->biases[44].value, 1566) + << "incorrect value for biases[44].value, expected 1566, is " + << last_msg_->biases[44].value; + EXPECT_EQ(last_msg_->biases[45].code, 78) + << "incorrect value for biases[45].code, expected 78, is " + << last_msg_->biases[45].code; + EXPECT_EQ(last_msg_->biases[45].value, -28847) + << "incorrect value for biases[45].value, expected -28847, is " + << last_msg_->biases[45].value; + EXPECT_EQ(last_msg_->biases[46].code, 116) + << "incorrect value for biases[46].code, expected 116, is " + << last_msg_->biases[46].code; + EXPECT_EQ(last_msg_->biases[46].value, -26640) + << "incorrect value for biases[46].value, expected -26640, is " + << last_msg_->biases[46].value; + EXPECT_EQ(last_msg_->biases[47].code, 55) + << "incorrect value for biases[47].code, expected 55, is " + << last_msg_->biases[47].code; + EXPECT_EQ(last_msg_->biases[47].value, -22087) + << "incorrect value for biases[47].value, expected -22087, is " + << last_msg_->biases[47].value; + EXPECT_EQ(last_msg_->biases[48].code, 254) + << "incorrect value for biases[48].code, expected 254, is " + << last_msg_->biases[48].code; + EXPECT_EQ(last_msg_->biases[48].value, 10035) + << "incorrect value for biases[48].value, expected 10035, is " + << last_msg_->biases[48].value; + EXPECT_EQ(last_msg_->biases[49].code, 74) + << "incorrect value for biases[49].code, expected 74, is " + << last_msg_->biases[49].code; + EXPECT_EQ(last_msg_->biases[49].value, -2129) + << "incorrect value for biases[49].value, expected -2129, is " + << last_msg_->biases[49].value; + EXPECT_EQ(last_msg_->biases[50].code, 34) + << "incorrect value for biases[50].code, expected 34, is " + << last_msg_->biases[50].code; + EXPECT_EQ(last_msg_->biases[50].value, 19041) + << "incorrect value for biases[50].value, expected 19041, is " + << last_msg_->biases[50].value; + EXPECT_EQ(last_msg_->biases[51].code, 97) + << "incorrect value for biases[51].code, expected 97, is " + << last_msg_->biases[51].code; + EXPECT_EQ(last_msg_->biases[51].value, 12464) + << "incorrect value for biases[51].value, expected 12464, is " + << last_msg_->biases[51].value; + EXPECT_EQ(last_msg_->biases[52].code, 236) + << "incorrect value for biases[52].code, expected 236, is " + << last_msg_->biases[52].code; + EXPECT_EQ(last_msg_->biases[52].value, 3245) + << "incorrect value for biases[52].value, expected 3245, is " + << last_msg_->biases[52].value; + EXPECT_EQ(last_msg_->biases[53].code, 174) + << "incorrect value for biases[53].code, expected 174, is " + << last_msg_->biases[53].code; + EXPECT_EQ(last_msg_->biases[53].value, -32155) + << "incorrect value for biases[53].value, expected -32155, is " + << last_msg_->biases[53].value; + EXPECT_EQ(last_msg_->biases[54].code, 30) + << "incorrect value for biases[54].code, expected 30, is " + << last_msg_->biases[54].code; + EXPECT_EQ(last_msg_->biases[54].value, -15959) + << "incorrect value for biases[54].value, expected -15959, is " + << last_msg_->biases[54].value; + EXPECT_EQ(last_msg_->biases[55].code, 190) + << "incorrect value for biases[55].code, expected 190, is " + << last_msg_->biases[55].code; + EXPECT_EQ(last_msg_->biases[55].value, -15156) + << "incorrect value for biases[55].value, expected -15156, is " + << last_msg_->biases[55].value; + EXPECT_EQ(last_msg_->biases[56].code, 123) + << "incorrect value for biases[56].code, expected 123, is " + << last_msg_->biases[56].code; + EXPECT_EQ(last_msg_->biases[56].value, 6507) + << "incorrect value for biases[56].value, expected 6507, is " + << last_msg_->biases[56].value; + EXPECT_EQ(last_msg_->biases[57].code, 225) + << "incorrect value for biases[57].code, expected 225, is " + << last_msg_->biases[57].code; + EXPECT_EQ(last_msg_->biases[57].value, 2378) + << "incorrect value for biases[57].value, expected 2378, is " + << last_msg_->biases[57].value; + EXPECT_EQ(last_msg_->biases[58].code, 10) + << "incorrect value for biases[58].code, expected 10, is " + << last_msg_->biases[58].code; + EXPECT_EQ(last_msg_->biases[58].value, 823) + << "incorrect value for biases[58].value, expected 823, is " + << last_msg_->biases[58].value; + EXPECT_EQ(last_msg_->biases[59].code, 131) + << "incorrect value for biases[59].code, expected 131, is " + << last_msg_->biases[59].code; + EXPECT_EQ(last_msg_->biases[59].value, 25590) + << "incorrect value for biases[59].value, expected 25590, is " + << last_msg_->biases[59].value; + EXPECT_EQ(last_msg_->biases[60].code, 133) + << "incorrect value for biases[60].code, expected 133, is " + << last_msg_->biases[60].code; + EXPECT_EQ(last_msg_->biases[60].value, -7390) + << "incorrect value for biases[60].value, expected -7390, is " + << last_msg_->biases[60].value; + EXPECT_EQ(last_msg_->biases[61].code, 203) + << "incorrect value for biases[61].code, expected 203, is " + << last_msg_->biases[61].code; + EXPECT_EQ(last_msg_->biases[61].value, 4676) + << "incorrect value for biases[61].value, expected 4676, is " + << last_msg_->biases[61].value; + EXPECT_EQ(last_msg_->biases[62].code, 97) + << "incorrect value for biases[62].code, expected 97, is " + << last_msg_->biases[62].code; + EXPECT_EQ(last_msg_->biases[62].value, 23007) + << "incorrect value for biases[62].value, expected 23007, is " + << last_msg_->biases[62].value; + EXPECT_EQ(last_msg_->biases[63].code, 192) + << "incorrect value for biases[63].code, expected 192, is " + << last_msg_->biases[63].code; + EXPECT_EQ(last_msg_->biases[63].value, 13046) + << "incorrect value for biases[63].value, expected 13046, is " + << last_msg_->biases[63].value; + EXPECT_EQ(last_msg_->biases[64].code, 69) + << "incorrect value for biases[64].code, expected 69, is " + << last_msg_->biases[64].code; + EXPECT_EQ(last_msg_->biases[64].value, 2651) + << "incorrect value for biases[64].value, expected 2651, is " + << last_msg_->biases[64].value; + EXPECT_EQ(last_msg_->biases[65].code, 151) + << "incorrect value for biases[65].code, expected 151, is " + << last_msg_->biases[65].code; + EXPECT_EQ(last_msg_->biases[65].value, 30282) + << "incorrect value for biases[65].value, expected 30282, is " + << last_msg_->biases[65].value; + EXPECT_EQ(last_msg_->biases[66].code, 110) + << "incorrect value for biases[66].code, expected 110, is " + << last_msg_->biases[66].code; + EXPECT_EQ(last_msg_->biases[66].value, -22492) + << "incorrect value for biases[66].value, expected -22492, is " + << last_msg_->biases[66].value; + EXPECT_EQ(last_msg_->biases[67].code, 247) + << "incorrect value for biases[67].code, expected 247, is " + << last_msg_->biases[67].code; + EXPECT_EQ(last_msg_->biases[67].value, 19872) + << "incorrect value for biases[67].value, expected 19872, is " + << last_msg_->biases[67].value; + EXPECT_EQ(last_msg_->biases[68].code, 179) + << "incorrect value for biases[68].code, expected 179, is " + << last_msg_->biases[68].code; + EXPECT_EQ(last_msg_->biases[68].value, -19827) + << "incorrect value for biases[68].value, expected -19827, is " + << last_msg_->biases[68].value; + EXPECT_EQ(last_msg_->biases[69].code, 99) + << "incorrect value for biases[69].code, expected 99, is " + << last_msg_->biases[69].code; + EXPECT_EQ(last_msg_->biases[69].value, 30911) + << "incorrect value for biases[69].value, expected 30911, is " + << last_msg_->biases[69].value; + EXPECT_EQ(last_msg_->biases[70].code, 77) + << "incorrect value for biases[70].code, expected 77, is " + << last_msg_->biases[70].code; + EXPECT_EQ(last_msg_->biases[70].value, 23488) + << "incorrect value for biases[70].value, expected 23488, is " + << last_msg_->biases[70].value; + EXPECT_EQ(last_msg_->biases[71].code, 224) + << "incorrect value for biases[71].code, expected 224, is " + << last_msg_->biases[71].code; + EXPECT_EQ(last_msg_->biases[71].value, -7679) + << "incorrect value for biases[71].value, expected -7679, is " + << last_msg_->biases[71].value; + EXPECT_EQ(last_msg_->biases[72].code, 50) + << "incorrect value for biases[72].code, expected 50, is " + << last_msg_->biases[72].code; + EXPECT_EQ(last_msg_->biases[72].value, -28073) + << "incorrect value for biases[72].value, expected -28073, is " + << last_msg_->biases[72].value; + EXPECT_EQ(last_msg_->biases[73].code, 148) + << "incorrect value for biases[73].code, expected 148, is " + << last_msg_->biases[73].code; + EXPECT_EQ(last_msg_->biases[73].value, 25838) + << "incorrect value for biases[73].value, expected 25838, is " + << last_msg_->biases[73].value; + EXPECT_EQ(last_msg_->biases[74].code, 179) + << "incorrect value for biases[74].code, expected 179, is " + << last_msg_->biases[74].code; + EXPECT_EQ(last_msg_->biases[74].value, -7299) + << "incorrect value for biases[74].value, expected -7299, is " + << last_msg_->biases[74].value; + EXPECT_EQ(last_msg_->biases[75].code, 215) + << "incorrect value for biases[75].code, expected 215, is " + << last_msg_->biases[75].code; + EXPECT_EQ(last_msg_->biases[75].value, -18328) + << "incorrect value for biases[75].value, expected -18328, is " + << last_msg_->biases[75].value; + EXPECT_EQ(last_msg_->biases[76].code, 31) + << "incorrect value for biases[76].code, expected 31, is " + << last_msg_->biases[76].code; + EXPECT_EQ(last_msg_->biases[76].value, 23097) + << "incorrect value for biases[76].value, expected 23097, is " + << last_msg_->biases[76].value; + EXPECT_EQ(last_msg_->biases[77].code, 79) + << "incorrect value for biases[77].code, expected 79, is " + << last_msg_->biases[77].code; + EXPECT_EQ(last_msg_->biases[77].value, -25579) + << "incorrect value for biases[77].value, expected -25579, is " + << last_msg_->biases[77].value; + EXPECT_EQ(last_msg_->biases[78].code, 245) + << "incorrect value for biases[78].code, expected 245, is " + << last_msg_->biases[78].code; + EXPECT_EQ(last_msg_->biases[78].value, 15441) + << "incorrect value for biases[78].value, expected 15441, is " + << last_msg_->biases[78].value; + EXPECT_EQ(last_msg_->biases[79].code, 93) + << "incorrect value for biases[79].code, expected 93, is " + << last_msg_->biases[79].code; + EXPECT_EQ(last_msg_->biases[79].value, 15530) + << "incorrect value for biases[79].value, expected 15530, is " + << last_msg_->biases[79].value; + EXPECT_EQ(last_msg_->biases[80].code, 200) + << "incorrect value for biases[80].code, expected 200, is " + << last_msg_->biases[80].code; + EXPECT_EQ(last_msg_->biases[80].value, 3495) + << "incorrect value for biases[80].value, expected 3495, is " + << last_msg_->biases[80].value; + EXPECT_EQ(last_msg_->iod_ssr, 132) + << "incorrect value for iod_ssr, expected 132, is " << last_msg_->iod_ssr; + EXPECT_EQ(last_msg_->sid.code, 241) + << "incorrect value for sid.code, expected 241, is " + << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.sat, 133) + << "incorrect value for sid.sat, expected 133, is " << last_msg_->sid.sat; + EXPECT_EQ(last_msg_->time.tow, 387144400) + << "incorrect value for time.tow, expected 387144400, is " + << last_msg_->time.tow; + EXPECT_EQ(last_msg_->time.wn, 16905) + << "incorrect value for time.wn, expected 16905, is " + << last_msg_->time.wn; + EXPECT_EQ(last_msg_->update_interval, 254) + << "incorrect value for update_interval, expected 254, is " + << last_msg_->update_interval; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.cc index a6a74d98c..fc07c6aab 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodePhaseBiasesBounds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrCodePhaseBiasesBounds.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_code_phase_biases_bounds_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_code_phase_biases_bounds_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,99 +82,168 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_code_phase_biases_bounds_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds0, Test) -{ +}; - uint8_t encoded_frame[] = {85,236,5,66,0,31,180,0,0,0,3,0,1,2,1,14,15,1,3,0,3,39,1,39,1,1,3,39,1,39,1,1,1,39,1,39,1,23,113, }; +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrCodePhaseBiasesBounds0, Test) { + uint8_t encoded_frame[] = { + 85, 236, 5, 66, 0, 31, 180, 0, 0, 0, 3, 0, 1, 2, 1, 14, 15, 1, 3, 0, + 3, 39, 1, 39, 1, 1, 3, 39, 1, 39, 1, 1, 1, 39, 1, 39, 1, 23, 113, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_code_phase_biases_bounds_t* test_msg = ( msg_ssr_code_phase_biases_bounds_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->const_id = 1; - test_msg->header.num_msgs = 1; - test_msg->header.seq_num = 2; - test_msg->header.sol_id = 14; - test_msg->header.time.tow = 180; - test_msg->header.time.wn = 3; - test_msg->header.update_interval = 1; - test_msg->n_sats_signals = 3; - if (sizeof(test_msg->satellites_signals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->satellites_signals[0])); - } - test_msg->satellites_signals[0].code_bias_bound_mu = 39; - test_msg->satellites_signals[0].code_bias_bound_sig = 1; - test_msg->satellites_signals[0].phase_bias_bound_mu = 39; - test_msg->satellites_signals[0].phase_bias_bound_sig = 1; - test_msg->satellites_signals[0].sat_id = 0; - test_msg->satellites_signals[0].signal_id = 3; - if (sizeof(test_msg->satellites_signals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->satellites_signals[0])); - } - test_msg->satellites_signals[1].code_bias_bound_mu = 39; - test_msg->satellites_signals[1].code_bias_bound_sig = 1; - test_msg->satellites_signals[1].phase_bias_bound_mu = 39; - test_msg->satellites_signals[1].phase_bias_bound_sig = 1; - test_msg->satellites_signals[1].sat_id = 1; - test_msg->satellites_signals[1].signal_id = 3; - if (sizeof(test_msg->satellites_signals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->satellites_signals[0])); - } - test_msg->satellites_signals[2].code_bias_bound_mu = 39; - test_msg->satellites_signals[2].code_bias_bound_sig = 1; - test_msg->satellites_signals[2].phase_bias_bound_mu = 39; - test_msg->satellites_signals[2].phase_bias_bound_sig = 1; - test_msg->satellites_signals[2].sat_id = 1; - test_msg->satellites_signals[2].signal_id = 1; - test_msg->ssr_iod = 15; - - EXPECT_EQ(send_message( 1516, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_code_phase_biases_bounds_t *test_msg = + (msg_ssr_code_phase_biases_bounds_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->const_id = 1; + test_msg->header.num_msgs = 1; + test_msg->header.seq_num = 2; + test_msg->header.sol_id = 14; + test_msg->header.time.tow = 180; + test_msg->header.time.wn = 3; + test_msg->header.update_interval = 1; + test_msg->n_sats_signals = 3; + if (sizeof(test_msg->satellites_signals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->satellites_signals[0])); + } + test_msg->satellites_signals[0].code_bias_bound_mu = 39; + test_msg->satellites_signals[0].code_bias_bound_sig = 1; + test_msg->satellites_signals[0].phase_bias_bound_mu = 39; + test_msg->satellites_signals[0].phase_bias_bound_sig = 1; + test_msg->satellites_signals[0].sat_id = 0; + test_msg->satellites_signals[0].signal_id = 3; + if (sizeof(test_msg->satellites_signals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->satellites_signals[0])); + } + test_msg->satellites_signals[1].code_bias_bound_mu = 39; + test_msg->satellites_signals[1].code_bias_bound_sig = 1; + test_msg->satellites_signals[1].phase_bias_bound_mu = 39; + test_msg->satellites_signals[1].phase_bias_bound_sig = 1; + test_msg->satellites_signals[1].sat_id = 1; + test_msg->satellites_signals[1].signal_id = 3; + if (sizeof(test_msg->satellites_signals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->satellites_signals[0])); + } + test_msg->satellites_signals[2].code_bias_bound_mu = 39; + test_msg->satellites_signals[2].code_bias_bound_sig = 1; + test_msg->satellites_signals[2].phase_bias_bound_mu = 39; + test_msg->satellites_signals[2].phase_bias_bound_sig = 1; + test_msg->satellites_signals[2].sat_id = 1; + test_msg->satellites_signals[2].signal_id = 1; + test_msg->ssr_iod = 15; + + EXPECT_EQ(send_message(1516, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->const_id, 1) << "incorrect value for const_id, expected 1, is " << last_msg_->const_id; - EXPECT_EQ(last_msg_->header.num_msgs, 1) << "incorrect value for header.num_msgs, expected 1, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.seq_num, 2) << "incorrect value for header.seq_num, expected 2, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->header.sol_id, 14) << "incorrect value for header.sol_id, expected 14, is " << last_msg_->header.sol_id; - EXPECT_EQ(last_msg_->header.time.tow, 180) << "incorrect value for header.time.tow, expected 180, is " << last_msg_->header.time.tow; - EXPECT_EQ(last_msg_->header.time.wn, 3) << "incorrect value for header.time.wn, expected 3, is " << last_msg_->header.time.wn; - EXPECT_EQ(last_msg_->header.update_interval, 1) << "incorrect value for header.update_interval, expected 1, is " << last_msg_->header.update_interval; - EXPECT_EQ(last_msg_->n_sats_signals, 3) << "incorrect value for n_sats_signals, expected 3, is " << last_msg_->n_sats_signals; - EXPECT_EQ(last_msg_->satellites_signals[0].code_bias_bound_mu, 39) << "incorrect value for satellites_signals[0].code_bias_bound_mu, expected 39, is " << last_msg_->satellites_signals[0].code_bias_bound_mu; - EXPECT_EQ(last_msg_->satellites_signals[0].code_bias_bound_sig, 1) << "incorrect value for satellites_signals[0].code_bias_bound_sig, expected 1, is " << last_msg_->satellites_signals[0].code_bias_bound_sig; - EXPECT_EQ(last_msg_->satellites_signals[0].phase_bias_bound_mu, 39) << "incorrect value for satellites_signals[0].phase_bias_bound_mu, expected 39, is " << last_msg_->satellites_signals[0].phase_bias_bound_mu; - EXPECT_EQ(last_msg_->satellites_signals[0].phase_bias_bound_sig, 1) << "incorrect value for satellites_signals[0].phase_bias_bound_sig, expected 1, is " << last_msg_->satellites_signals[0].phase_bias_bound_sig; - EXPECT_EQ(last_msg_->satellites_signals[0].sat_id, 0) << "incorrect value for satellites_signals[0].sat_id, expected 0, is " << last_msg_->satellites_signals[0].sat_id; - EXPECT_EQ(last_msg_->satellites_signals[0].signal_id, 3) << "incorrect value for satellites_signals[0].signal_id, expected 3, is " << last_msg_->satellites_signals[0].signal_id; - EXPECT_EQ(last_msg_->satellites_signals[1].code_bias_bound_mu, 39) << "incorrect value for satellites_signals[1].code_bias_bound_mu, expected 39, is " << last_msg_->satellites_signals[1].code_bias_bound_mu; - EXPECT_EQ(last_msg_->satellites_signals[1].code_bias_bound_sig, 1) << "incorrect value for satellites_signals[1].code_bias_bound_sig, expected 1, is " << last_msg_->satellites_signals[1].code_bias_bound_sig; - EXPECT_EQ(last_msg_->satellites_signals[1].phase_bias_bound_mu, 39) << "incorrect value for satellites_signals[1].phase_bias_bound_mu, expected 39, is " << last_msg_->satellites_signals[1].phase_bias_bound_mu; - EXPECT_EQ(last_msg_->satellites_signals[1].phase_bias_bound_sig, 1) << "incorrect value for satellites_signals[1].phase_bias_bound_sig, expected 1, is " << last_msg_->satellites_signals[1].phase_bias_bound_sig; - EXPECT_EQ(last_msg_->satellites_signals[1].sat_id, 1) << "incorrect value for satellites_signals[1].sat_id, expected 1, is " << last_msg_->satellites_signals[1].sat_id; - EXPECT_EQ(last_msg_->satellites_signals[1].signal_id, 3) << "incorrect value for satellites_signals[1].signal_id, expected 3, is " << last_msg_->satellites_signals[1].signal_id; - EXPECT_EQ(last_msg_->satellites_signals[2].code_bias_bound_mu, 39) << "incorrect value for satellites_signals[2].code_bias_bound_mu, expected 39, is " << last_msg_->satellites_signals[2].code_bias_bound_mu; - EXPECT_EQ(last_msg_->satellites_signals[2].code_bias_bound_sig, 1) << "incorrect value for satellites_signals[2].code_bias_bound_sig, expected 1, is " << last_msg_->satellites_signals[2].code_bias_bound_sig; - EXPECT_EQ(last_msg_->satellites_signals[2].phase_bias_bound_mu, 39) << "incorrect value for satellites_signals[2].phase_bias_bound_mu, expected 39, is " << last_msg_->satellites_signals[2].phase_bias_bound_mu; - EXPECT_EQ(last_msg_->satellites_signals[2].phase_bias_bound_sig, 1) << "incorrect value for satellites_signals[2].phase_bias_bound_sig, expected 1, is " << last_msg_->satellites_signals[2].phase_bias_bound_sig; - EXPECT_EQ(last_msg_->satellites_signals[2].sat_id, 1) << "incorrect value for satellites_signals[2].sat_id, expected 1, is " << last_msg_->satellites_signals[2].sat_id; - EXPECT_EQ(last_msg_->satellites_signals[2].signal_id, 1) << "incorrect value for satellites_signals[2].signal_id, expected 1, is " << last_msg_->satellites_signals[2].signal_id; - EXPECT_EQ(last_msg_->ssr_iod, 15) << "incorrect value for ssr_iod, expected 15, is " << last_msg_->ssr_iod; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->const_id, 1) + << "incorrect value for const_id, expected 1, is " << last_msg_->const_id; + EXPECT_EQ(last_msg_->header.num_msgs, 1) + << "incorrect value for header.num_msgs, expected 1, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.seq_num, 2) + << "incorrect value for header.seq_num, expected 2, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->header.sol_id, 14) + << "incorrect value for header.sol_id, expected 14, is " + << last_msg_->header.sol_id; + EXPECT_EQ(last_msg_->header.time.tow, 180) + << "incorrect value for header.time.tow, expected 180, is " + << last_msg_->header.time.tow; + EXPECT_EQ(last_msg_->header.time.wn, 3) + << "incorrect value for header.time.wn, expected 3, is " + << last_msg_->header.time.wn; + EXPECT_EQ(last_msg_->header.update_interval, 1) + << "incorrect value for header.update_interval, expected 1, is " + << last_msg_->header.update_interval; + EXPECT_EQ(last_msg_->n_sats_signals, 3) + << "incorrect value for n_sats_signals, expected 3, is " + << last_msg_->n_sats_signals; + EXPECT_EQ(last_msg_->satellites_signals[0].code_bias_bound_mu, 39) + << "incorrect value for satellites_signals[0].code_bias_bound_mu, " + "expected 39, is " + << last_msg_->satellites_signals[0].code_bias_bound_mu; + EXPECT_EQ(last_msg_->satellites_signals[0].code_bias_bound_sig, 1) + << "incorrect value for satellites_signals[0].code_bias_bound_sig, " + "expected 1, is " + << last_msg_->satellites_signals[0].code_bias_bound_sig; + EXPECT_EQ(last_msg_->satellites_signals[0].phase_bias_bound_mu, 39) + << "incorrect value for satellites_signals[0].phase_bias_bound_mu, " + "expected 39, is " + << last_msg_->satellites_signals[0].phase_bias_bound_mu; + EXPECT_EQ(last_msg_->satellites_signals[0].phase_bias_bound_sig, 1) + << "incorrect value for satellites_signals[0].phase_bias_bound_sig, " + "expected 1, is " + << last_msg_->satellites_signals[0].phase_bias_bound_sig; + EXPECT_EQ(last_msg_->satellites_signals[0].sat_id, 0) + << "incorrect value for satellites_signals[0].sat_id, expected 0, is " + << last_msg_->satellites_signals[0].sat_id; + EXPECT_EQ(last_msg_->satellites_signals[0].signal_id, 3) + << "incorrect value for satellites_signals[0].signal_id, expected 3, is " + << last_msg_->satellites_signals[0].signal_id; + EXPECT_EQ(last_msg_->satellites_signals[1].code_bias_bound_mu, 39) + << "incorrect value for satellites_signals[1].code_bias_bound_mu, " + "expected 39, is " + << last_msg_->satellites_signals[1].code_bias_bound_mu; + EXPECT_EQ(last_msg_->satellites_signals[1].code_bias_bound_sig, 1) + << "incorrect value for satellites_signals[1].code_bias_bound_sig, " + "expected 1, is " + << last_msg_->satellites_signals[1].code_bias_bound_sig; + EXPECT_EQ(last_msg_->satellites_signals[1].phase_bias_bound_mu, 39) + << "incorrect value for satellites_signals[1].phase_bias_bound_mu, " + "expected 39, is " + << last_msg_->satellites_signals[1].phase_bias_bound_mu; + EXPECT_EQ(last_msg_->satellites_signals[1].phase_bias_bound_sig, 1) + << "incorrect value for satellites_signals[1].phase_bias_bound_sig, " + "expected 1, is " + << last_msg_->satellites_signals[1].phase_bias_bound_sig; + EXPECT_EQ(last_msg_->satellites_signals[1].sat_id, 1) + << "incorrect value for satellites_signals[1].sat_id, expected 1, is " + << last_msg_->satellites_signals[1].sat_id; + EXPECT_EQ(last_msg_->satellites_signals[1].signal_id, 3) + << "incorrect value for satellites_signals[1].signal_id, expected 3, is " + << last_msg_->satellites_signals[1].signal_id; + EXPECT_EQ(last_msg_->satellites_signals[2].code_bias_bound_mu, 39) + << "incorrect value for satellites_signals[2].code_bias_bound_mu, " + "expected 39, is " + << last_msg_->satellites_signals[2].code_bias_bound_mu; + EXPECT_EQ(last_msg_->satellites_signals[2].code_bias_bound_sig, 1) + << "incorrect value for satellites_signals[2].code_bias_bound_sig, " + "expected 1, is " + << last_msg_->satellites_signals[2].code_bias_bound_sig; + EXPECT_EQ(last_msg_->satellites_signals[2].phase_bias_bound_mu, 39) + << "incorrect value for satellites_signals[2].phase_bias_bound_mu, " + "expected 39, is " + << last_msg_->satellites_signals[2].phase_bias_bound_mu; + EXPECT_EQ(last_msg_->satellites_signals[2].phase_bias_bound_sig, 1) + << "incorrect value for satellites_signals[2].phase_bias_bound_sig, " + "expected 1, is " + << last_msg_->satellites_signals[2].phase_bias_bound_sig; + EXPECT_EQ(last_msg_->satellites_signals[2].sat_id, 1) + << "incorrect value for satellites_signals[2].sat_id, expected 1, is " + << last_msg_->satellites_signals[2].sat_id; + EXPECT_EQ(last_msg_->satellites_signals[2].signal_id, 1) + << "incorrect value for satellites_signals[2].signal_id, expected 1, is " + << last_msg_->satellites_signals[2].signal_id; + EXPECT_EQ(last_msg_->ssr_iod, 15) + << "incorrect value for ssr_iod, expected 15, is " << last_msg_->ssr_iod; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.cc index 8920364a0..c952cc870 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGridDefinitionDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGridDefinitionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGridDefinitionDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_grid_definition_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_grid_definition_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,1521 +82,2043 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_grid_definition_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrGridDefinitionDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 245, 5, 181, 247, 255, 11, 84, 171, 229, 132, 143, 46, 204, 52, + 92, 104, 25, 204, 182, 22, 98, 203, 123, 211, 38, 13, 253, 129, 173, + 171, 235, 253, 26, 203, 3, 120, 126, 42, 44, 39, 87, 69, 154, 13, + 28, 179, 32, 47, 36, 195, 39, 198, 134, 235, 134, 57, 120, 243, 151, + 35, 17, 201, 211, 125, 117, 164, 142, 101, 239, 144, 158, 239, 90, 56, + 71, 120, 67, 221, 114, 10, 190, 4, 230, 164, 171, 78, 185, 90, 46, + 177, 82, 228, 123, 222, 227, 145, 195, 219, 27, 56, 227, 246, 215, 144, + 158, 31, 214, 241, 254, 200, 86, 142, 89, 12, 121, 29, 124, 9, 19, + 153, 44, 35, 126, 14, 217, 65, 116, 26, 139, 122, 114, 90, 124, 81, + 0, 186, 246, 46, 98, 179, 243, 198, 217, 36, 30, 202, 12, 135, 61, + 42, 150, 221, 102, 83, 179, 43, 252, 81, 62, 126, 204, 195, 238, 18, + 128, 193, 53, 94, 99, 63, 182, 2, 186, 220, 77, 186, 224, 220, 13, + 212, 182, 88, 15, 151, 5, 93, 251, 164, 18, 228, 168, 226, 195, 44, + 170, 145, 36, 58, 96, 107, 144, 11, 228, 12, 163, 238, 247, 159, 189, + 1, 115, 65, 202, 121, 47, 193, 11, 96, 93, 72, 81, 207, 121, 19, + 151, 136, 233, 51, 133, 195, 77, 44, 147, 206, 120, 252, 77, 212, 68, + 60, 206, 106, 207, 243, 158, 94, 6, 3, 205, 92, 84, 2, 220, 50, + 61, 38, 141, 117, 108, 101, 76, 139, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_grid_definition_dep_a_t *test_msg = + (msg_ssr_grid_definition_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.area_width = 43860; + test_msg->header.lat_nw_corner_enc = 34021; + test_msg->header.lon_nw_corner_enc = 11919; + test_msg->header.num_msgs = 204; + test_msg->header.region_size_inverse = 11; + test_msg->header.seq_num = 52; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[0] = 92; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[1] = 104; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[2] = 25; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[3] = 204; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[4] = 182; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[5] = 22; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[6] = 98; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[7] = 203; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[8] = 123; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[9] = 211; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[10] = 38; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[11] = 13; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[12] = 253; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[13] = 129; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[14] = 173; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[15] = 171; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[16] = 235; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[17] = 253; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[18] = 26; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[19] = 203; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[20] = 3; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[21] = 120; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[22] = 126; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[23] = 42; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[24] = 44; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[25] = 39; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[26] = 87; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[27] = 69; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[28] = 154; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[29] = 13; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[30] = 28; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[31] = 179; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[32] = 32; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[33] = 47; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[34] = 36; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[35] = 195; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[36] = 39; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[37] = 198; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[38] = 134; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[39] = 235; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[40] = 134; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[41] = 57; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[42] = 120; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[43] = 243; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[44] = 151; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[45] = 35; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[46] = 17; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[47] = 201; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[48] = 211; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[49] = 125; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[50] = 117; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[51] = 164; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[52] = 142; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[53] = 101; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[54] = 239; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[55] = 144; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[56] = 158; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[57] = 239; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[58] = 90; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[59] = 56; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[60] = 71; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[61] = 120; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[62] = 67; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[63] = 221; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[64] = 114; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[65] = 10; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[66] = 190; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[67] = 4; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[68] = 230; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[69] = 164; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[70] = 171; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[71] = 78; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[72] = 185; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[73] = 90; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[74] = 46; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[75] = 177; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[76] = 82; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[77] = 228; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[78] = 123; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[79] = 222; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[80] = 227; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[81] = 145; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[82] = 195; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[83] = 219; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[84] = 27; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[85] = 56; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[86] = 227; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[87] = 246; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[88] = 215; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[89] = 144; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[90] = 158; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[91] = 31; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[92] = 214; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[93] = 241; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[94] = 254; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[95] = 200; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[96] = 86; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[97] = 142; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[98] = 89; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[99] = 12; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[100] = 121; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[101] = 29; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[102] = 124; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[103] = 9; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[104] = 19; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[105] = 153; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[106] = 44; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[107] = 35; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[108] = 126; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[109] = 14; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[110] = 217; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[111] = 65; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[112] = 116; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[113] = 26; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[114] = 139; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[115] = 122; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[116] = 114; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[117] = 90; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[118] = 124; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[119] = 81; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[120] = 0; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[121] = 186; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[122] = 246; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[123] = 46; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[124] = 98; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[125] = 179; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[126] = 243; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[127] = 198; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[128] = 217; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[129] = 36; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[130] = 30; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[131] = 202; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[132] = 12; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[133] = 135; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[134] = 61; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[135] = 42; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[136] = 150; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[137] = 221; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[138] = 102; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[139] = 83; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[140] = 179; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[141] = 43; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[142] = 252; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[143] = 81; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[144] = 62; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[145] = 126; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[146] = 204; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[147] = 195; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[148] = 238; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[149] = 18; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[150] = 128; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[151] = 193; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[152] = 53; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[153] = 94; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[154] = 99; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[155] = 63; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[156] = 182; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[157] = 2; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[158] = 186; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[159] = 220; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[160] = 77; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[161] = 186; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[162] = 224; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[163] = 220; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[164] = 13; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[165] = 212; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[166] = 182; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[167] = 88; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[168] = 15; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[169] = 151; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[170] = 5; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[171] = 93; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[172] = 251; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[173] = 164; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[174] = 18; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[175] = 228; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[176] = 168; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[177] = 226; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[178] = 195; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[179] = 44; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[180] = 170; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[181] = 145; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[182] = 36; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[183] = 58; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[184] = 96; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[185] = 107; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[186] = 144; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[187] = 11; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[188] = 228; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[189] = 12; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[190] = 163; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[191] = 238; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[192] = 247; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[193] = 159; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[194] = 189; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[195] = 1; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[196] = 115; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[197] = 65; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[198] = 202; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[199] = 121; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[200] = 47; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[201] = 193; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[202] = 11; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[203] = 96; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[204] = 93; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[205] = 72; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[206] = 81; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[207] = 207; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[208] = 121; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[209] = 19; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[210] = 151; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[211] = 136; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[212] = 233; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[213] = 51; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[214] = 133; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[215] = 195; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[216] = 77; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[217] = 44; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[218] = 147; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[219] = 206; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[220] = 120; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[221] = 252; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[222] = 77; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[223] = 212; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[224] = 68; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[225] = 60; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[226] = 206; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[227] = 106; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[228] = 207; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[229] = 243; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[230] = 158; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[231] = 94; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[232] = 6; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[233] = 3; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[234] = 205; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[235] = 92; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[236] = 84; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[237] = 2; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[238] = 220; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[239] = 50; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[240] = 61; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[241] = 38; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[242] = 141; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[243] = 117; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[244] = 108; + if (sizeof(test_msg->rle_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); + } + test_msg->rle_list[245] = 101; + + EXPECT_EQ(send_message(0x5f5, 63413, test_msg_len, test_msg_storage), SBP_OK); - uint8_t encoded_frame[] = {85,245,5,181,247,255,11,84,171,229,132,143,46,204,52,92,104,25,204,182,22,98,203,123,211,38,13,253,129,173,171,235,253,26,203,3,120,126,42,44,39,87,69,154,13,28,179,32,47,36,195,39,198,134,235,134,57,120,243,151,35,17,201,211,125,117,164,142,101,239,144,158,239,90,56,71,120,67,221,114,10,190,4,230,164,171,78,185,90,46,177,82,228,123,222,227,145,195,219,27,56,227,246,215,144,158,31,214,241,254,200,86,142,89,12,121,29,124,9,19,153,44,35,126,14,217,65,116,26,139,122,114,90,124,81,0,186,246,46,98,179,243,198,217,36,30,202,12,135,61,42,150,221,102,83,179,43,252,81,62,126,204,195,238,18,128,193,53,94,99,63,182,2,186,220,77,186,224,220,13,212,182,88,15,151,5,93,251,164,18,228,168,226,195,44,170,145,36,58,96,107,144,11,228,12,163,238,247,159,189,1,115,65,202,121,47,193,11,96,93,72,81,207,121,19,151,136,233,51,133,195,77,44,147,206,120,252,77,212,68,60,206,106,207,243,158,94,6,3,205,92,84,2,220,50,61,38,141,117,108,101,76,139, }; + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_grid_definition_dep_a_t* test_msg = ( msg_ssr_grid_definition_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.area_width = 43860; - test_msg->header.lat_nw_corner_enc = 34021; - test_msg->header.lon_nw_corner_enc = 11919; - test_msg->header.num_msgs = 204; - test_msg->header.region_size_inverse = 11; - test_msg->header.seq_num = 52; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[0] = 92; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[1] = 104; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[2] = 25; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[3] = 204; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[4] = 182; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[5] = 22; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[6] = 98; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[7] = 203; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[8] = 123; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[9] = 211; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[10] = 38; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[11] = 13; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[12] = 253; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[13] = 129; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[14] = 173; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[15] = 171; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[16] = 235; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[17] = 253; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[18] = 26; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[19] = 203; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[20] = 3; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[21] = 120; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[22] = 126; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[23] = 42; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[24] = 44; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[25] = 39; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[26] = 87; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[27] = 69; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[28] = 154; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[29] = 13; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[30] = 28; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[31] = 179; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[32] = 32; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[33] = 47; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[34] = 36; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[35] = 195; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[36] = 39; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[37] = 198; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[38] = 134; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[39] = 235; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[40] = 134; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[41] = 57; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[42] = 120; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[43] = 243; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[44] = 151; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[45] = 35; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[46] = 17; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[47] = 201; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[48] = 211; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[49] = 125; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[50] = 117; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[51] = 164; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[52] = 142; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[53] = 101; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[54] = 239; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[55] = 144; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[56] = 158; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[57] = 239; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[58] = 90; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[59] = 56; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[60] = 71; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[61] = 120; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[62] = 67; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[63] = 221; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[64] = 114; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[65] = 10; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[66] = 190; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[67] = 4; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[68] = 230; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[69] = 164; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[70] = 171; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[71] = 78; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[72] = 185; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[73] = 90; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[74] = 46; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[75] = 177; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[76] = 82; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[77] = 228; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[78] = 123; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[79] = 222; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[80] = 227; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[81] = 145; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[82] = 195; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[83] = 219; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[84] = 27; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[85] = 56; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[86] = 227; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[87] = 246; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[88] = 215; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[89] = 144; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[90] = 158; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[91] = 31; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[92] = 214; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[93] = 241; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[94] = 254; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[95] = 200; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[96] = 86; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[97] = 142; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[98] = 89; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[99] = 12; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[100] = 121; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[101] = 29; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[102] = 124; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[103] = 9; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[104] = 19; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[105] = 153; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[106] = 44; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[107] = 35; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[108] = 126; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[109] = 14; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[110] = 217; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[111] = 65; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[112] = 116; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[113] = 26; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[114] = 139; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[115] = 122; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[116] = 114; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[117] = 90; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[118] = 124; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[119] = 81; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[120] = 0; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[121] = 186; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[122] = 246; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[123] = 46; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[124] = 98; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[125] = 179; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[126] = 243; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[127] = 198; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[128] = 217; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[129] = 36; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[130] = 30; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[131] = 202; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[132] = 12; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[133] = 135; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[134] = 61; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[135] = 42; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[136] = 150; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[137] = 221; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[138] = 102; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[139] = 83; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[140] = 179; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[141] = 43; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[142] = 252; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[143] = 81; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[144] = 62; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[145] = 126; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[146] = 204; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[147] = 195; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[148] = 238; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[149] = 18; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[150] = 128; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[151] = 193; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[152] = 53; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[153] = 94; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[154] = 99; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[155] = 63; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[156] = 182; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[157] = 2; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[158] = 186; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[159] = 220; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[160] = 77; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[161] = 186; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[162] = 224; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[163] = 220; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[164] = 13; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[165] = 212; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[166] = 182; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[167] = 88; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[168] = 15; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[169] = 151; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[170] = 5; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[171] = 93; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[172] = 251; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[173] = 164; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[174] = 18; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[175] = 228; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[176] = 168; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[177] = 226; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[178] = 195; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[179] = 44; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[180] = 170; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[181] = 145; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[182] = 36; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[183] = 58; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[184] = 96; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[185] = 107; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[186] = 144; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[187] = 11; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[188] = 228; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[189] = 12; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[190] = 163; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[191] = 238; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[192] = 247; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[193] = 159; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[194] = 189; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[195] = 1; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[196] = 115; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[197] = 65; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[198] = 202; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[199] = 121; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[200] = 47; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[201] = 193; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[202] = 11; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[203] = 96; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[204] = 93; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[205] = 72; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[206] = 81; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[207] = 207; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[208] = 121; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[209] = 19; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[210] = 151; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[211] = 136; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[212] = 233; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[213] = 51; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[214] = 133; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[215] = 195; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[216] = 77; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[217] = 44; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[218] = 147; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[219] = 206; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[220] = 120; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[221] = 252; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[222] = 77; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[223] = 212; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[224] = 68; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[225] = 60; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[226] = 206; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[227] = 106; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[228] = 207; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[229] = 243; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[230] = 158; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[231] = 94; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[232] = 6; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[233] = 3; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[234] = 205; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[235] = 92; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[236] = 84; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[237] = 2; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[238] = 220; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[239] = 50; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[240] = 61; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[241] = 38; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[242] = 141; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[243] = 117; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[244] = 108; - if (sizeof(test_msg->rle_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->rle_list[0])); - } - test_msg->rle_list[245] = 101; - - EXPECT_EQ(send_message( 0x5f5, 63413, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 63413); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.area_width, 43860) << "incorrect value for header.area_width, expected 43860, is " << last_msg_->header.area_width; - EXPECT_EQ(last_msg_->header.lat_nw_corner_enc, 34021) << "incorrect value for header.lat_nw_corner_enc, expected 34021, is " << last_msg_->header.lat_nw_corner_enc; - EXPECT_EQ(last_msg_->header.lon_nw_corner_enc, 11919) << "incorrect value for header.lon_nw_corner_enc, expected 11919, is " << last_msg_->header.lon_nw_corner_enc; - EXPECT_EQ(last_msg_->header.num_msgs, 204) << "incorrect value for header.num_msgs, expected 204, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.region_size_inverse, 11) << "incorrect value for header.region_size_inverse, expected 11, is " << last_msg_->header.region_size_inverse; - EXPECT_EQ(last_msg_->header.seq_num, 52) << "incorrect value for header.seq_num, expected 52, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->rle_list[0], 92) << "incorrect value for rle_list[0], expected 92, is " << last_msg_->rle_list[0]; - EXPECT_EQ(last_msg_->rle_list[1], 104) << "incorrect value for rle_list[1], expected 104, is " << last_msg_->rle_list[1]; - EXPECT_EQ(last_msg_->rle_list[2], 25) << "incorrect value for rle_list[2], expected 25, is " << last_msg_->rle_list[2]; - EXPECT_EQ(last_msg_->rle_list[3], 204) << "incorrect value for rle_list[3], expected 204, is " << last_msg_->rle_list[3]; - EXPECT_EQ(last_msg_->rle_list[4], 182) << "incorrect value for rle_list[4], expected 182, is " << last_msg_->rle_list[4]; - EXPECT_EQ(last_msg_->rle_list[5], 22) << "incorrect value for rle_list[5], expected 22, is " << last_msg_->rle_list[5]; - EXPECT_EQ(last_msg_->rle_list[6], 98) << "incorrect value for rle_list[6], expected 98, is " << last_msg_->rle_list[6]; - EXPECT_EQ(last_msg_->rle_list[7], 203) << "incorrect value for rle_list[7], expected 203, is " << last_msg_->rle_list[7]; - EXPECT_EQ(last_msg_->rle_list[8], 123) << "incorrect value for rle_list[8], expected 123, is " << last_msg_->rle_list[8]; - EXPECT_EQ(last_msg_->rle_list[9], 211) << "incorrect value for rle_list[9], expected 211, is " << last_msg_->rle_list[9]; - EXPECT_EQ(last_msg_->rle_list[10], 38) << "incorrect value for rle_list[10], expected 38, is " << last_msg_->rle_list[10]; - EXPECT_EQ(last_msg_->rle_list[11], 13) << "incorrect value for rle_list[11], expected 13, is " << last_msg_->rle_list[11]; - EXPECT_EQ(last_msg_->rle_list[12], 253) << "incorrect value for rle_list[12], expected 253, is " << last_msg_->rle_list[12]; - EXPECT_EQ(last_msg_->rle_list[13], 129) << "incorrect value for rle_list[13], expected 129, is " << last_msg_->rle_list[13]; - EXPECT_EQ(last_msg_->rle_list[14], 173) << "incorrect value for rle_list[14], expected 173, is " << last_msg_->rle_list[14]; - EXPECT_EQ(last_msg_->rle_list[15], 171) << "incorrect value for rle_list[15], expected 171, is " << last_msg_->rle_list[15]; - EXPECT_EQ(last_msg_->rle_list[16], 235) << "incorrect value for rle_list[16], expected 235, is " << last_msg_->rle_list[16]; - EXPECT_EQ(last_msg_->rle_list[17], 253) << "incorrect value for rle_list[17], expected 253, is " << last_msg_->rle_list[17]; - EXPECT_EQ(last_msg_->rle_list[18], 26) << "incorrect value for rle_list[18], expected 26, is " << last_msg_->rle_list[18]; - EXPECT_EQ(last_msg_->rle_list[19], 203) << "incorrect value for rle_list[19], expected 203, is " << last_msg_->rle_list[19]; - EXPECT_EQ(last_msg_->rle_list[20], 3) << "incorrect value for rle_list[20], expected 3, is " << last_msg_->rle_list[20]; - EXPECT_EQ(last_msg_->rle_list[21], 120) << "incorrect value for rle_list[21], expected 120, is " << last_msg_->rle_list[21]; - EXPECT_EQ(last_msg_->rle_list[22], 126) << "incorrect value for rle_list[22], expected 126, is " << last_msg_->rle_list[22]; - EXPECT_EQ(last_msg_->rle_list[23], 42) << "incorrect value for rle_list[23], expected 42, is " << last_msg_->rle_list[23]; - EXPECT_EQ(last_msg_->rle_list[24], 44) << "incorrect value for rle_list[24], expected 44, is " << last_msg_->rle_list[24]; - EXPECT_EQ(last_msg_->rle_list[25], 39) << "incorrect value for rle_list[25], expected 39, is " << last_msg_->rle_list[25]; - EXPECT_EQ(last_msg_->rle_list[26], 87) << "incorrect value for rle_list[26], expected 87, is " << last_msg_->rle_list[26]; - EXPECT_EQ(last_msg_->rle_list[27], 69) << "incorrect value for rle_list[27], expected 69, is " << last_msg_->rle_list[27]; - EXPECT_EQ(last_msg_->rle_list[28], 154) << "incorrect value for rle_list[28], expected 154, is " << last_msg_->rle_list[28]; - EXPECT_EQ(last_msg_->rle_list[29], 13) << "incorrect value for rle_list[29], expected 13, is " << last_msg_->rle_list[29]; - EXPECT_EQ(last_msg_->rle_list[30], 28) << "incorrect value for rle_list[30], expected 28, is " << last_msg_->rle_list[30]; - EXPECT_EQ(last_msg_->rle_list[31], 179) << "incorrect value for rle_list[31], expected 179, is " << last_msg_->rle_list[31]; - EXPECT_EQ(last_msg_->rle_list[32], 32) << "incorrect value for rle_list[32], expected 32, is " << last_msg_->rle_list[32]; - EXPECT_EQ(last_msg_->rle_list[33], 47) << "incorrect value for rle_list[33], expected 47, is " << last_msg_->rle_list[33]; - EXPECT_EQ(last_msg_->rle_list[34], 36) << "incorrect value for rle_list[34], expected 36, is " << last_msg_->rle_list[34]; - EXPECT_EQ(last_msg_->rle_list[35], 195) << "incorrect value for rle_list[35], expected 195, is " << last_msg_->rle_list[35]; - EXPECT_EQ(last_msg_->rle_list[36], 39) << "incorrect value for rle_list[36], expected 39, is " << last_msg_->rle_list[36]; - EXPECT_EQ(last_msg_->rle_list[37], 198) << "incorrect value for rle_list[37], expected 198, is " << last_msg_->rle_list[37]; - EXPECT_EQ(last_msg_->rle_list[38], 134) << "incorrect value for rle_list[38], expected 134, is " << last_msg_->rle_list[38]; - EXPECT_EQ(last_msg_->rle_list[39], 235) << "incorrect value for rle_list[39], expected 235, is " << last_msg_->rle_list[39]; - EXPECT_EQ(last_msg_->rle_list[40], 134) << "incorrect value for rle_list[40], expected 134, is " << last_msg_->rle_list[40]; - EXPECT_EQ(last_msg_->rle_list[41], 57) << "incorrect value for rle_list[41], expected 57, is " << last_msg_->rle_list[41]; - EXPECT_EQ(last_msg_->rle_list[42], 120) << "incorrect value for rle_list[42], expected 120, is " << last_msg_->rle_list[42]; - EXPECT_EQ(last_msg_->rle_list[43], 243) << "incorrect value for rle_list[43], expected 243, is " << last_msg_->rle_list[43]; - EXPECT_EQ(last_msg_->rle_list[44], 151) << "incorrect value for rle_list[44], expected 151, is " << last_msg_->rle_list[44]; - EXPECT_EQ(last_msg_->rle_list[45], 35) << "incorrect value for rle_list[45], expected 35, is " << last_msg_->rle_list[45]; - EXPECT_EQ(last_msg_->rle_list[46], 17) << "incorrect value for rle_list[46], expected 17, is " << last_msg_->rle_list[46]; - EXPECT_EQ(last_msg_->rle_list[47], 201) << "incorrect value for rle_list[47], expected 201, is " << last_msg_->rle_list[47]; - EXPECT_EQ(last_msg_->rle_list[48], 211) << "incorrect value for rle_list[48], expected 211, is " << last_msg_->rle_list[48]; - EXPECT_EQ(last_msg_->rle_list[49], 125) << "incorrect value for rle_list[49], expected 125, is " << last_msg_->rle_list[49]; - EXPECT_EQ(last_msg_->rle_list[50], 117) << "incorrect value for rle_list[50], expected 117, is " << last_msg_->rle_list[50]; - EXPECT_EQ(last_msg_->rle_list[51], 164) << "incorrect value for rle_list[51], expected 164, is " << last_msg_->rle_list[51]; - EXPECT_EQ(last_msg_->rle_list[52], 142) << "incorrect value for rle_list[52], expected 142, is " << last_msg_->rle_list[52]; - EXPECT_EQ(last_msg_->rle_list[53], 101) << "incorrect value for rle_list[53], expected 101, is " << last_msg_->rle_list[53]; - EXPECT_EQ(last_msg_->rle_list[54], 239) << "incorrect value for rle_list[54], expected 239, is " << last_msg_->rle_list[54]; - EXPECT_EQ(last_msg_->rle_list[55], 144) << "incorrect value for rle_list[55], expected 144, is " << last_msg_->rle_list[55]; - EXPECT_EQ(last_msg_->rle_list[56], 158) << "incorrect value for rle_list[56], expected 158, is " << last_msg_->rle_list[56]; - EXPECT_EQ(last_msg_->rle_list[57], 239) << "incorrect value for rle_list[57], expected 239, is " << last_msg_->rle_list[57]; - EXPECT_EQ(last_msg_->rle_list[58], 90) << "incorrect value for rle_list[58], expected 90, is " << last_msg_->rle_list[58]; - EXPECT_EQ(last_msg_->rle_list[59], 56) << "incorrect value for rle_list[59], expected 56, is " << last_msg_->rle_list[59]; - EXPECT_EQ(last_msg_->rle_list[60], 71) << "incorrect value for rle_list[60], expected 71, is " << last_msg_->rle_list[60]; - EXPECT_EQ(last_msg_->rle_list[61], 120) << "incorrect value for rle_list[61], expected 120, is " << last_msg_->rle_list[61]; - EXPECT_EQ(last_msg_->rle_list[62], 67) << "incorrect value for rle_list[62], expected 67, is " << last_msg_->rle_list[62]; - EXPECT_EQ(last_msg_->rle_list[63], 221) << "incorrect value for rle_list[63], expected 221, is " << last_msg_->rle_list[63]; - EXPECT_EQ(last_msg_->rle_list[64], 114) << "incorrect value for rle_list[64], expected 114, is " << last_msg_->rle_list[64]; - EXPECT_EQ(last_msg_->rle_list[65], 10) << "incorrect value for rle_list[65], expected 10, is " << last_msg_->rle_list[65]; - EXPECT_EQ(last_msg_->rle_list[66], 190) << "incorrect value for rle_list[66], expected 190, is " << last_msg_->rle_list[66]; - EXPECT_EQ(last_msg_->rle_list[67], 4) << "incorrect value for rle_list[67], expected 4, is " << last_msg_->rle_list[67]; - EXPECT_EQ(last_msg_->rle_list[68], 230) << "incorrect value for rle_list[68], expected 230, is " << last_msg_->rle_list[68]; - EXPECT_EQ(last_msg_->rle_list[69], 164) << "incorrect value for rle_list[69], expected 164, is " << last_msg_->rle_list[69]; - EXPECT_EQ(last_msg_->rle_list[70], 171) << "incorrect value for rle_list[70], expected 171, is " << last_msg_->rle_list[70]; - EXPECT_EQ(last_msg_->rle_list[71], 78) << "incorrect value for rle_list[71], expected 78, is " << last_msg_->rle_list[71]; - EXPECT_EQ(last_msg_->rle_list[72], 185) << "incorrect value for rle_list[72], expected 185, is " << last_msg_->rle_list[72]; - EXPECT_EQ(last_msg_->rle_list[73], 90) << "incorrect value for rle_list[73], expected 90, is " << last_msg_->rle_list[73]; - EXPECT_EQ(last_msg_->rle_list[74], 46) << "incorrect value for rle_list[74], expected 46, is " << last_msg_->rle_list[74]; - EXPECT_EQ(last_msg_->rle_list[75], 177) << "incorrect value for rle_list[75], expected 177, is " << last_msg_->rle_list[75]; - EXPECT_EQ(last_msg_->rle_list[76], 82) << "incorrect value for rle_list[76], expected 82, is " << last_msg_->rle_list[76]; - EXPECT_EQ(last_msg_->rle_list[77], 228) << "incorrect value for rle_list[77], expected 228, is " << last_msg_->rle_list[77]; - EXPECT_EQ(last_msg_->rle_list[78], 123) << "incorrect value for rle_list[78], expected 123, is " << last_msg_->rle_list[78]; - EXPECT_EQ(last_msg_->rle_list[79], 222) << "incorrect value for rle_list[79], expected 222, is " << last_msg_->rle_list[79]; - EXPECT_EQ(last_msg_->rle_list[80], 227) << "incorrect value for rle_list[80], expected 227, is " << last_msg_->rle_list[80]; - EXPECT_EQ(last_msg_->rle_list[81], 145) << "incorrect value for rle_list[81], expected 145, is " << last_msg_->rle_list[81]; - EXPECT_EQ(last_msg_->rle_list[82], 195) << "incorrect value for rle_list[82], expected 195, is " << last_msg_->rle_list[82]; - EXPECT_EQ(last_msg_->rle_list[83], 219) << "incorrect value for rle_list[83], expected 219, is " << last_msg_->rle_list[83]; - EXPECT_EQ(last_msg_->rle_list[84], 27) << "incorrect value for rle_list[84], expected 27, is " << last_msg_->rle_list[84]; - EXPECT_EQ(last_msg_->rle_list[85], 56) << "incorrect value for rle_list[85], expected 56, is " << last_msg_->rle_list[85]; - EXPECT_EQ(last_msg_->rle_list[86], 227) << "incorrect value for rle_list[86], expected 227, is " << last_msg_->rle_list[86]; - EXPECT_EQ(last_msg_->rle_list[87], 246) << "incorrect value for rle_list[87], expected 246, is " << last_msg_->rle_list[87]; - EXPECT_EQ(last_msg_->rle_list[88], 215) << "incorrect value for rle_list[88], expected 215, is " << last_msg_->rle_list[88]; - EXPECT_EQ(last_msg_->rle_list[89], 144) << "incorrect value for rle_list[89], expected 144, is " << last_msg_->rle_list[89]; - EXPECT_EQ(last_msg_->rle_list[90], 158) << "incorrect value for rle_list[90], expected 158, is " << last_msg_->rle_list[90]; - EXPECT_EQ(last_msg_->rle_list[91], 31) << "incorrect value for rle_list[91], expected 31, is " << last_msg_->rle_list[91]; - EXPECT_EQ(last_msg_->rle_list[92], 214) << "incorrect value for rle_list[92], expected 214, is " << last_msg_->rle_list[92]; - EXPECT_EQ(last_msg_->rle_list[93], 241) << "incorrect value for rle_list[93], expected 241, is " << last_msg_->rle_list[93]; - EXPECT_EQ(last_msg_->rle_list[94], 254) << "incorrect value for rle_list[94], expected 254, is " << last_msg_->rle_list[94]; - EXPECT_EQ(last_msg_->rle_list[95], 200) << "incorrect value for rle_list[95], expected 200, is " << last_msg_->rle_list[95]; - EXPECT_EQ(last_msg_->rle_list[96], 86) << "incorrect value for rle_list[96], expected 86, is " << last_msg_->rle_list[96]; - EXPECT_EQ(last_msg_->rle_list[97], 142) << "incorrect value for rle_list[97], expected 142, is " << last_msg_->rle_list[97]; - EXPECT_EQ(last_msg_->rle_list[98], 89) << "incorrect value for rle_list[98], expected 89, is " << last_msg_->rle_list[98]; - EXPECT_EQ(last_msg_->rle_list[99], 12) << "incorrect value for rle_list[99], expected 12, is " << last_msg_->rle_list[99]; - EXPECT_EQ(last_msg_->rle_list[100], 121) << "incorrect value for rle_list[100], expected 121, is " << last_msg_->rle_list[100]; - EXPECT_EQ(last_msg_->rle_list[101], 29) << "incorrect value for rle_list[101], expected 29, is " << last_msg_->rle_list[101]; - EXPECT_EQ(last_msg_->rle_list[102], 124) << "incorrect value for rle_list[102], expected 124, is " << last_msg_->rle_list[102]; - EXPECT_EQ(last_msg_->rle_list[103], 9) << "incorrect value for rle_list[103], expected 9, is " << last_msg_->rle_list[103]; - EXPECT_EQ(last_msg_->rle_list[104], 19) << "incorrect value for rle_list[104], expected 19, is " << last_msg_->rle_list[104]; - EXPECT_EQ(last_msg_->rle_list[105], 153) << "incorrect value for rle_list[105], expected 153, is " << last_msg_->rle_list[105]; - EXPECT_EQ(last_msg_->rle_list[106], 44) << "incorrect value for rle_list[106], expected 44, is " << last_msg_->rle_list[106]; - EXPECT_EQ(last_msg_->rle_list[107], 35) << "incorrect value for rle_list[107], expected 35, is " << last_msg_->rle_list[107]; - EXPECT_EQ(last_msg_->rle_list[108], 126) << "incorrect value for rle_list[108], expected 126, is " << last_msg_->rle_list[108]; - EXPECT_EQ(last_msg_->rle_list[109], 14) << "incorrect value for rle_list[109], expected 14, is " << last_msg_->rle_list[109]; - EXPECT_EQ(last_msg_->rle_list[110], 217) << "incorrect value for rle_list[110], expected 217, is " << last_msg_->rle_list[110]; - EXPECT_EQ(last_msg_->rle_list[111], 65) << "incorrect value for rle_list[111], expected 65, is " << last_msg_->rle_list[111]; - EXPECT_EQ(last_msg_->rle_list[112], 116) << "incorrect value for rle_list[112], expected 116, is " << last_msg_->rle_list[112]; - EXPECT_EQ(last_msg_->rle_list[113], 26) << "incorrect value for rle_list[113], expected 26, is " << last_msg_->rle_list[113]; - EXPECT_EQ(last_msg_->rle_list[114], 139) << "incorrect value for rle_list[114], expected 139, is " << last_msg_->rle_list[114]; - EXPECT_EQ(last_msg_->rle_list[115], 122) << "incorrect value for rle_list[115], expected 122, is " << last_msg_->rle_list[115]; - EXPECT_EQ(last_msg_->rle_list[116], 114) << "incorrect value for rle_list[116], expected 114, is " << last_msg_->rle_list[116]; - EXPECT_EQ(last_msg_->rle_list[117], 90) << "incorrect value for rle_list[117], expected 90, is " << last_msg_->rle_list[117]; - EXPECT_EQ(last_msg_->rle_list[118], 124) << "incorrect value for rle_list[118], expected 124, is " << last_msg_->rle_list[118]; - EXPECT_EQ(last_msg_->rle_list[119], 81) << "incorrect value for rle_list[119], expected 81, is " << last_msg_->rle_list[119]; - EXPECT_EQ(last_msg_->rle_list[120], 0) << "incorrect value for rle_list[120], expected 0, is " << last_msg_->rle_list[120]; - EXPECT_EQ(last_msg_->rle_list[121], 186) << "incorrect value for rle_list[121], expected 186, is " << last_msg_->rle_list[121]; - EXPECT_EQ(last_msg_->rle_list[122], 246) << "incorrect value for rle_list[122], expected 246, is " << last_msg_->rle_list[122]; - EXPECT_EQ(last_msg_->rle_list[123], 46) << "incorrect value for rle_list[123], expected 46, is " << last_msg_->rle_list[123]; - EXPECT_EQ(last_msg_->rle_list[124], 98) << "incorrect value for rle_list[124], expected 98, is " << last_msg_->rle_list[124]; - EXPECT_EQ(last_msg_->rle_list[125], 179) << "incorrect value for rle_list[125], expected 179, is " << last_msg_->rle_list[125]; - EXPECT_EQ(last_msg_->rle_list[126], 243) << "incorrect value for rle_list[126], expected 243, is " << last_msg_->rle_list[126]; - EXPECT_EQ(last_msg_->rle_list[127], 198) << "incorrect value for rle_list[127], expected 198, is " << last_msg_->rle_list[127]; - EXPECT_EQ(last_msg_->rle_list[128], 217) << "incorrect value for rle_list[128], expected 217, is " << last_msg_->rle_list[128]; - EXPECT_EQ(last_msg_->rle_list[129], 36) << "incorrect value for rle_list[129], expected 36, is " << last_msg_->rle_list[129]; - EXPECT_EQ(last_msg_->rle_list[130], 30) << "incorrect value for rle_list[130], expected 30, is " << last_msg_->rle_list[130]; - EXPECT_EQ(last_msg_->rle_list[131], 202) << "incorrect value for rle_list[131], expected 202, is " << last_msg_->rle_list[131]; - EXPECT_EQ(last_msg_->rle_list[132], 12) << "incorrect value for rle_list[132], expected 12, is " << last_msg_->rle_list[132]; - EXPECT_EQ(last_msg_->rle_list[133], 135) << "incorrect value for rle_list[133], expected 135, is " << last_msg_->rle_list[133]; - EXPECT_EQ(last_msg_->rle_list[134], 61) << "incorrect value for rle_list[134], expected 61, is " << last_msg_->rle_list[134]; - EXPECT_EQ(last_msg_->rle_list[135], 42) << "incorrect value for rle_list[135], expected 42, is " << last_msg_->rle_list[135]; - EXPECT_EQ(last_msg_->rle_list[136], 150) << "incorrect value for rle_list[136], expected 150, is " << last_msg_->rle_list[136]; - EXPECT_EQ(last_msg_->rle_list[137], 221) << "incorrect value for rle_list[137], expected 221, is " << last_msg_->rle_list[137]; - EXPECT_EQ(last_msg_->rle_list[138], 102) << "incorrect value for rle_list[138], expected 102, is " << last_msg_->rle_list[138]; - EXPECT_EQ(last_msg_->rle_list[139], 83) << "incorrect value for rle_list[139], expected 83, is " << last_msg_->rle_list[139]; - EXPECT_EQ(last_msg_->rle_list[140], 179) << "incorrect value for rle_list[140], expected 179, is " << last_msg_->rle_list[140]; - EXPECT_EQ(last_msg_->rle_list[141], 43) << "incorrect value for rle_list[141], expected 43, is " << last_msg_->rle_list[141]; - EXPECT_EQ(last_msg_->rle_list[142], 252) << "incorrect value for rle_list[142], expected 252, is " << last_msg_->rle_list[142]; - EXPECT_EQ(last_msg_->rle_list[143], 81) << "incorrect value for rle_list[143], expected 81, is " << last_msg_->rle_list[143]; - EXPECT_EQ(last_msg_->rle_list[144], 62) << "incorrect value for rle_list[144], expected 62, is " << last_msg_->rle_list[144]; - EXPECT_EQ(last_msg_->rle_list[145], 126) << "incorrect value for rle_list[145], expected 126, is " << last_msg_->rle_list[145]; - EXPECT_EQ(last_msg_->rle_list[146], 204) << "incorrect value for rle_list[146], expected 204, is " << last_msg_->rle_list[146]; - EXPECT_EQ(last_msg_->rle_list[147], 195) << "incorrect value for rle_list[147], expected 195, is " << last_msg_->rle_list[147]; - EXPECT_EQ(last_msg_->rle_list[148], 238) << "incorrect value for rle_list[148], expected 238, is " << last_msg_->rle_list[148]; - EXPECT_EQ(last_msg_->rle_list[149], 18) << "incorrect value for rle_list[149], expected 18, is " << last_msg_->rle_list[149]; - EXPECT_EQ(last_msg_->rle_list[150], 128) << "incorrect value for rle_list[150], expected 128, is " << last_msg_->rle_list[150]; - EXPECT_EQ(last_msg_->rle_list[151], 193) << "incorrect value for rle_list[151], expected 193, is " << last_msg_->rle_list[151]; - EXPECT_EQ(last_msg_->rle_list[152], 53) << "incorrect value for rle_list[152], expected 53, is " << last_msg_->rle_list[152]; - EXPECT_EQ(last_msg_->rle_list[153], 94) << "incorrect value for rle_list[153], expected 94, is " << last_msg_->rle_list[153]; - EXPECT_EQ(last_msg_->rle_list[154], 99) << "incorrect value for rle_list[154], expected 99, is " << last_msg_->rle_list[154]; - EXPECT_EQ(last_msg_->rle_list[155], 63) << "incorrect value for rle_list[155], expected 63, is " << last_msg_->rle_list[155]; - EXPECT_EQ(last_msg_->rle_list[156], 182) << "incorrect value for rle_list[156], expected 182, is " << last_msg_->rle_list[156]; - EXPECT_EQ(last_msg_->rle_list[157], 2) << "incorrect value for rle_list[157], expected 2, is " << last_msg_->rle_list[157]; - EXPECT_EQ(last_msg_->rle_list[158], 186) << "incorrect value for rle_list[158], expected 186, is " << last_msg_->rle_list[158]; - EXPECT_EQ(last_msg_->rle_list[159], 220) << "incorrect value for rle_list[159], expected 220, is " << last_msg_->rle_list[159]; - EXPECT_EQ(last_msg_->rle_list[160], 77) << "incorrect value for rle_list[160], expected 77, is " << last_msg_->rle_list[160]; - EXPECT_EQ(last_msg_->rle_list[161], 186) << "incorrect value for rle_list[161], expected 186, is " << last_msg_->rle_list[161]; - EXPECT_EQ(last_msg_->rle_list[162], 224) << "incorrect value for rle_list[162], expected 224, is " << last_msg_->rle_list[162]; - EXPECT_EQ(last_msg_->rle_list[163], 220) << "incorrect value for rle_list[163], expected 220, is " << last_msg_->rle_list[163]; - EXPECT_EQ(last_msg_->rle_list[164], 13) << "incorrect value for rle_list[164], expected 13, is " << last_msg_->rle_list[164]; - EXPECT_EQ(last_msg_->rle_list[165], 212) << "incorrect value for rle_list[165], expected 212, is " << last_msg_->rle_list[165]; - EXPECT_EQ(last_msg_->rle_list[166], 182) << "incorrect value for rle_list[166], expected 182, is " << last_msg_->rle_list[166]; - EXPECT_EQ(last_msg_->rle_list[167], 88) << "incorrect value for rle_list[167], expected 88, is " << last_msg_->rle_list[167]; - EXPECT_EQ(last_msg_->rle_list[168], 15) << "incorrect value for rle_list[168], expected 15, is " << last_msg_->rle_list[168]; - EXPECT_EQ(last_msg_->rle_list[169], 151) << "incorrect value for rle_list[169], expected 151, is " << last_msg_->rle_list[169]; - EXPECT_EQ(last_msg_->rle_list[170], 5) << "incorrect value for rle_list[170], expected 5, is " << last_msg_->rle_list[170]; - EXPECT_EQ(last_msg_->rle_list[171], 93) << "incorrect value for rle_list[171], expected 93, is " << last_msg_->rle_list[171]; - EXPECT_EQ(last_msg_->rle_list[172], 251) << "incorrect value for rle_list[172], expected 251, is " << last_msg_->rle_list[172]; - EXPECT_EQ(last_msg_->rle_list[173], 164) << "incorrect value for rle_list[173], expected 164, is " << last_msg_->rle_list[173]; - EXPECT_EQ(last_msg_->rle_list[174], 18) << "incorrect value for rle_list[174], expected 18, is " << last_msg_->rle_list[174]; - EXPECT_EQ(last_msg_->rle_list[175], 228) << "incorrect value for rle_list[175], expected 228, is " << last_msg_->rle_list[175]; - EXPECT_EQ(last_msg_->rle_list[176], 168) << "incorrect value for rle_list[176], expected 168, is " << last_msg_->rle_list[176]; - EXPECT_EQ(last_msg_->rle_list[177], 226) << "incorrect value for rle_list[177], expected 226, is " << last_msg_->rle_list[177]; - EXPECT_EQ(last_msg_->rle_list[178], 195) << "incorrect value for rle_list[178], expected 195, is " << last_msg_->rle_list[178]; - EXPECT_EQ(last_msg_->rle_list[179], 44) << "incorrect value for rle_list[179], expected 44, is " << last_msg_->rle_list[179]; - EXPECT_EQ(last_msg_->rle_list[180], 170) << "incorrect value for rle_list[180], expected 170, is " << last_msg_->rle_list[180]; - EXPECT_EQ(last_msg_->rle_list[181], 145) << "incorrect value for rle_list[181], expected 145, is " << last_msg_->rle_list[181]; - EXPECT_EQ(last_msg_->rle_list[182], 36) << "incorrect value for rle_list[182], expected 36, is " << last_msg_->rle_list[182]; - EXPECT_EQ(last_msg_->rle_list[183], 58) << "incorrect value for rle_list[183], expected 58, is " << last_msg_->rle_list[183]; - EXPECT_EQ(last_msg_->rle_list[184], 96) << "incorrect value for rle_list[184], expected 96, is " << last_msg_->rle_list[184]; - EXPECT_EQ(last_msg_->rle_list[185], 107) << "incorrect value for rle_list[185], expected 107, is " << last_msg_->rle_list[185]; - EXPECT_EQ(last_msg_->rle_list[186], 144) << "incorrect value for rle_list[186], expected 144, is " << last_msg_->rle_list[186]; - EXPECT_EQ(last_msg_->rle_list[187], 11) << "incorrect value for rle_list[187], expected 11, is " << last_msg_->rle_list[187]; - EXPECT_EQ(last_msg_->rle_list[188], 228) << "incorrect value for rle_list[188], expected 228, is " << last_msg_->rle_list[188]; - EXPECT_EQ(last_msg_->rle_list[189], 12) << "incorrect value for rle_list[189], expected 12, is " << last_msg_->rle_list[189]; - EXPECT_EQ(last_msg_->rle_list[190], 163) << "incorrect value for rle_list[190], expected 163, is " << last_msg_->rle_list[190]; - EXPECT_EQ(last_msg_->rle_list[191], 238) << "incorrect value for rle_list[191], expected 238, is " << last_msg_->rle_list[191]; - EXPECT_EQ(last_msg_->rle_list[192], 247) << "incorrect value for rle_list[192], expected 247, is " << last_msg_->rle_list[192]; - EXPECT_EQ(last_msg_->rle_list[193], 159) << "incorrect value for rle_list[193], expected 159, is " << last_msg_->rle_list[193]; - EXPECT_EQ(last_msg_->rle_list[194], 189) << "incorrect value for rle_list[194], expected 189, is " << last_msg_->rle_list[194]; - EXPECT_EQ(last_msg_->rle_list[195], 1) << "incorrect value for rle_list[195], expected 1, is " << last_msg_->rle_list[195]; - EXPECT_EQ(last_msg_->rle_list[196], 115) << "incorrect value for rle_list[196], expected 115, is " << last_msg_->rle_list[196]; - EXPECT_EQ(last_msg_->rle_list[197], 65) << "incorrect value for rle_list[197], expected 65, is " << last_msg_->rle_list[197]; - EXPECT_EQ(last_msg_->rle_list[198], 202) << "incorrect value for rle_list[198], expected 202, is " << last_msg_->rle_list[198]; - EXPECT_EQ(last_msg_->rle_list[199], 121) << "incorrect value for rle_list[199], expected 121, is " << last_msg_->rle_list[199]; - EXPECT_EQ(last_msg_->rle_list[200], 47) << "incorrect value for rle_list[200], expected 47, is " << last_msg_->rle_list[200]; - EXPECT_EQ(last_msg_->rle_list[201], 193) << "incorrect value for rle_list[201], expected 193, is " << last_msg_->rle_list[201]; - EXPECT_EQ(last_msg_->rle_list[202], 11) << "incorrect value for rle_list[202], expected 11, is " << last_msg_->rle_list[202]; - EXPECT_EQ(last_msg_->rle_list[203], 96) << "incorrect value for rle_list[203], expected 96, is " << last_msg_->rle_list[203]; - EXPECT_EQ(last_msg_->rle_list[204], 93) << "incorrect value for rle_list[204], expected 93, is " << last_msg_->rle_list[204]; - EXPECT_EQ(last_msg_->rle_list[205], 72) << "incorrect value for rle_list[205], expected 72, is " << last_msg_->rle_list[205]; - EXPECT_EQ(last_msg_->rle_list[206], 81) << "incorrect value for rle_list[206], expected 81, is " << last_msg_->rle_list[206]; - EXPECT_EQ(last_msg_->rle_list[207], 207) << "incorrect value for rle_list[207], expected 207, is " << last_msg_->rle_list[207]; - EXPECT_EQ(last_msg_->rle_list[208], 121) << "incorrect value for rle_list[208], expected 121, is " << last_msg_->rle_list[208]; - EXPECT_EQ(last_msg_->rle_list[209], 19) << "incorrect value for rle_list[209], expected 19, is " << last_msg_->rle_list[209]; - EXPECT_EQ(last_msg_->rle_list[210], 151) << "incorrect value for rle_list[210], expected 151, is " << last_msg_->rle_list[210]; - EXPECT_EQ(last_msg_->rle_list[211], 136) << "incorrect value for rle_list[211], expected 136, is " << last_msg_->rle_list[211]; - EXPECT_EQ(last_msg_->rle_list[212], 233) << "incorrect value for rle_list[212], expected 233, is " << last_msg_->rle_list[212]; - EXPECT_EQ(last_msg_->rle_list[213], 51) << "incorrect value for rle_list[213], expected 51, is " << last_msg_->rle_list[213]; - EXPECT_EQ(last_msg_->rle_list[214], 133) << "incorrect value for rle_list[214], expected 133, is " << last_msg_->rle_list[214]; - EXPECT_EQ(last_msg_->rle_list[215], 195) << "incorrect value for rle_list[215], expected 195, is " << last_msg_->rle_list[215]; - EXPECT_EQ(last_msg_->rle_list[216], 77) << "incorrect value for rle_list[216], expected 77, is " << last_msg_->rle_list[216]; - EXPECT_EQ(last_msg_->rle_list[217], 44) << "incorrect value for rle_list[217], expected 44, is " << last_msg_->rle_list[217]; - EXPECT_EQ(last_msg_->rle_list[218], 147) << "incorrect value for rle_list[218], expected 147, is " << last_msg_->rle_list[218]; - EXPECT_EQ(last_msg_->rle_list[219], 206) << "incorrect value for rle_list[219], expected 206, is " << last_msg_->rle_list[219]; - EXPECT_EQ(last_msg_->rle_list[220], 120) << "incorrect value for rle_list[220], expected 120, is " << last_msg_->rle_list[220]; - EXPECT_EQ(last_msg_->rle_list[221], 252) << "incorrect value for rle_list[221], expected 252, is " << last_msg_->rle_list[221]; - EXPECT_EQ(last_msg_->rle_list[222], 77) << "incorrect value for rle_list[222], expected 77, is " << last_msg_->rle_list[222]; - EXPECT_EQ(last_msg_->rle_list[223], 212) << "incorrect value for rle_list[223], expected 212, is " << last_msg_->rle_list[223]; - EXPECT_EQ(last_msg_->rle_list[224], 68) << "incorrect value for rle_list[224], expected 68, is " << last_msg_->rle_list[224]; - EXPECT_EQ(last_msg_->rle_list[225], 60) << "incorrect value for rle_list[225], expected 60, is " << last_msg_->rle_list[225]; - EXPECT_EQ(last_msg_->rle_list[226], 206) << "incorrect value for rle_list[226], expected 206, is " << last_msg_->rle_list[226]; - EXPECT_EQ(last_msg_->rle_list[227], 106) << "incorrect value for rle_list[227], expected 106, is " << last_msg_->rle_list[227]; - EXPECT_EQ(last_msg_->rle_list[228], 207) << "incorrect value for rle_list[228], expected 207, is " << last_msg_->rle_list[228]; - EXPECT_EQ(last_msg_->rle_list[229], 243) << "incorrect value for rle_list[229], expected 243, is " << last_msg_->rle_list[229]; - EXPECT_EQ(last_msg_->rle_list[230], 158) << "incorrect value for rle_list[230], expected 158, is " << last_msg_->rle_list[230]; - EXPECT_EQ(last_msg_->rle_list[231], 94) << "incorrect value for rle_list[231], expected 94, is " << last_msg_->rle_list[231]; - EXPECT_EQ(last_msg_->rle_list[232], 6) << "incorrect value for rle_list[232], expected 6, is " << last_msg_->rle_list[232]; - EXPECT_EQ(last_msg_->rle_list[233], 3) << "incorrect value for rle_list[233], expected 3, is " << last_msg_->rle_list[233]; - EXPECT_EQ(last_msg_->rle_list[234], 205) << "incorrect value for rle_list[234], expected 205, is " << last_msg_->rle_list[234]; - EXPECT_EQ(last_msg_->rle_list[235], 92) << "incorrect value for rle_list[235], expected 92, is " << last_msg_->rle_list[235]; - EXPECT_EQ(last_msg_->rle_list[236], 84) << "incorrect value for rle_list[236], expected 84, is " << last_msg_->rle_list[236]; - EXPECT_EQ(last_msg_->rle_list[237], 2) << "incorrect value for rle_list[237], expected 2, is " << last_msg_->rle_list[237]; - EXPECT_EQ(last_msg_->rle_list[238], 220) << "incorrect value for rle_list[238], expected 220, is " << last_msg_->rle_list[238]; - EXPECT_EQ(last_msg_->rle_list[239], 50) << "incorrect value for rle_list[239], expected 50, is " << last_msg_->rle_list[239]; - EXPECT_EQ(last_msg_->rle_list[240], 61) << "incorrect value for rle_list[240], expected 61, is " << last_msg_->rle_list[240]; - EXPECT_EQ(last_msg_->rle_list[241], 38) << "incorrect value for rle_list[241], expected 38, is " << last_msg_->rle_list[241]; - EXPECT_EQ(last_msg_->rle_list[242], 141) << "incorrect value for rle_list[242], expected 141, is " << last_msg_->rle_list[242]; - EXPECT_EQ(last_msg_->rle_list[243], 117) << "incorrect value for rle_list[243], expected 117, is " << last_msg_->rle_list[243]; - EXPECT_EQ(last_msg_->rle_list[244], 108) << "incorrect value for rle_list[244], expected 108, is " << last_msg_->rle_list[244]; - EXPECT_EQ(last_msg_->rle_list[245], 101) << "incorrect value for rle_list[245], expected 101, is " << last_msg_->rle_list[245]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 63413); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.area_width, 43860) + << "incorrect value for header.area_width, expected 43860, is " + << last_msg_->header.area_width; + EXPECT_EQ(last_msg_->header.lat_nw_corner_enc, 34021) + << "incorrect value for header.lat_nw_corner_enc, expected 34021, is " + << last_msg_->header.lat_nw_corner_enc; + EXPECT_EQ(last_msg_->header.lon_nw_corner_enc, 11919) + << "incorrect value for header.lon_nw_corner_enc, expected 11919, is " + << last_msg_->header.lon_nw_corner_enc; + EXPECT_EQ(last_msg_->header.num_msgs, 204) + << "incorrect value for header.num_msgs, expected 204, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.region_size_inverse, 11) + << "incorrect value for header.region_size_inverse, expected 11, is " + << last_msg_->header.region_size_inverse; + EXPECT_EQ(last_msg_->header.seq_num, 52) + << "incorrect value for header.seq_num, expected 52, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->rle_list[0], 92) + << "incorrect value for rle_list[0], expected 92, is " + << last_msg_->rle_list[0]; + EXPECT_EQ(last_msg_->rle_list[1], 104) + << "incorrect value for rle_list[1], expected 104, is " + << last_msg_->rle_list[1]; + EXPECT_EQ(last_msg_->rle_list[2], 25) + << "incorrect value for rle_list[2], expected 25, is " + << last_msg_->rle_list[2]; + EXPECT_EQ(last_msg_->rle_list[3], 204) + << "incorrect value for rle_list[3], expected 204, is " + << last_msg_->rle_list[3]; + EXPECT_EQ(last_msg_->rle_list[4], 182) + << "incorrect value for rle_list[4], expected 182, is " + << last_msg_->rle_list[4]; + EXPECT_EQ(last_msg_->rle_list[5], 22) + << "incorrect value for rle_list[5], expected 22, is " + << last_msg_->rle_list[5]; + EXPECT_EQ(last_msg_->rle_list[6], 98) + << "incorrect value for rle_list[6], expected 98, is " + << last_msg_->rle_list[6]; + EXPECT_EQ(last_msg_->rle_list[7], 203) + << "incorrect value for rle_list[7], expected 203, is " + << last_msg_->rle_list[7]; + EXPECT_EQ(last_msg_->rle_list[8], 123) + << "incorrect value for rle_list[8], expected 123, is " + << last_msg_->rle_list[8]; + EXPECT_EQ(last_msg_->rle_list[9], 211) + << "incorrect value for rle_list[9], expected 211, is " + << last_msg_->rle_list[9]; + EXPECT_EQ(last_msg_->rle_list[10], 38) + << "incorrect value for rle_list[10], expected 38, is " + << last_msg_->rle_list[10]; + EXPECT_EQ(last_msg_->rle_list[11], 13) + << "incorrect value for rle_list[11], expected 13, is " + << last_msg_->rle_list[11]; + EXPECT_EQ(last_msg_->rle_list[12], 253) + << "incorrect value for rle_list[12], expected 253, is " + << last_msg_->rle_list[12]; + EXPECT_EQ(last_msg_->rle_list[13], 129) + << "incorrect value for rle_list[13], expected 129, is " + << last_msg_->rle_list[13]; + EXPECT_EQ(last_msg_->rle_list[14], 173) + << "incorrect value for rle_list[14], expected 173, is " + << last_msg_->rle_list[14]; + EXPECT_EQ(last_msg_->rle_list[15], 171) + << "incorrect value for rle_list[15], expected 171, is " + << last_msg_->rle_list[15]; + EXPECT_EQ(last_msg_->rle_list[16], 235) + << "incorrect value for rle_list[16], expected 235, is " + << last_msg_->rle_list[16]; + EXPECT_EQ(last_msg_->rle_list[17], 253) + << "incorrect value for rle_list[17], expected 253, is " + << last_msg_->rle_list[17]; + EXPECT_EQ(last_msg_->rle_list[18], 26) + << "incorrect value for rle_list[18], expected 26, is " + << last_msg_->rle_list[18]; + EXPECT_EQ(last_msg_->rle_list[19], 203) + << "incorrect value for rle_list[19], expected 203, is " + << last_msg_->rle_list[19]; + EXPECT_EQ(last_msg_->rle_list[20], 3) + << "incorrect value for rle_list[20], expected 3, is " + << last_msg_->rle_list[20]; + EXPECT_EQ(last_msg_->rle_list[21], 120) + << "incorrect value for rle_list[21], expected 120, is " + << last_msg_->rle_list[21]; + EXPECT_EQ(last_msg_->rle_list[22], 126) + << "incorrect value for rle_list[22], expected 126, is " + << last_msg_->rle_list[22]; + EXPECT_EQ(last_msg_->rle_list[23], 42) + << "incorrect value for rle_list[23], expected 42, is " + << last_msg_->rle_list[23]; + EXPECT_EQ(last_msg_->rle_list[24], 44) + << "incorrect value for rle_list[24], expected 44, is " + << last_msg_->rle_list[24]; + EXPECT_EQ(last_msg_->rle_list[25], 39) + << "incorrect value for rle_list[25], expected 39, is " + << last_msg_->rle_list[25]; + EXPECT_EQ(last_msg_->rle_list[26], 87) + << "incorrect value for rle_list[26], expected 87, is " + << last_msg_->rle_list[26]; + EXPECT_EQ(last_msg_->rle_list[27], 69) + << "incorrect value for rle_list[27], expected 69, is " + << last_msg_->rle_list[27]; + EXPECT_EQ(last_msg_->rle_list[28], 154) + << "incorrect value for rle_list[28], expected 154, is " + << last_msg_->rle_list[28]; + EXPECT_EQ(last_msg_->rle_list[29], 13) + << "incorrect value for rle_list[29], expected 13, is " + << last_msg_->rle_list[29]; + EXPECT_EQ(last_msg_->rle_list[30], 28) + << "incorrect value for rle_list[30], expected 28, is " + << last_msg_->rle_list[30]; + EXPECT_EQ(last_msg_->rle_list[31], 179) + << "incorrect value for rle_list[31], expected 179, is " + << last_msg_->rle_list[31]; + EXPECT_EQ(last_msg_->rle_list[32], 32) + << "incorrect value for rle_list[32], expected 32, is " + << last_msg_->rle_list[32]; + EXPECT_EQ(last_msg_->rle_list[33], 47) + << "incorrect value for rle_list[33], expected 47, is " + << last_msg_->rle_list[33]; + EXPECT_EQ(last_msg_->rle_list[34], 36) + << "incorrect value for rle_list[34], expected 36, is " + << last_msg_->rle_list[34]; + EXPECT_EQ(last_msg_->rle_list[35], 195) + << "incorrect value for rle_list[35], expected 195, is " + << last_msg_->rle_list[35]; + EXPECT_EQ(last_msg_->rle_list[36], 39) + << "incorrect value for rle_list[36], expected 39, is " + << last_msg_->rle_list[36]; + EXPECT_EQ(last_msg_->rle_list[37], 198) + << "incorrect value for rle_list[37], expected 198, is " + << last_msg_->rle_list[37]; + EXPECT_EQ(last_msg_->rle_list[38], 134) + << "incorrect value for rle_list[38], expected 134, is " + << last_msg_->rle_list[38]; + EXPECT_EQ(last_msg_->rle_list[39], 235) + << "incorrect value for rle_list[39], expected 235, is " + << last_msg_->rle_list[39]; + EXPECT_EQ(last_msg_->rle_list[40], 134) + << "incorrect value for rle_list[40], expected 134, is " + << last_msg_->rle_list[40]; + EXPECT_EQ(last_msg_->rle_list[41], 57) + << "incorrect value for rle_list[41], expected 57, is " + << last_msg_->rle_list[41]; + EXPECT_EQ(last_msg_->rle_list[42], 120) + << "incorrect value for rle_list[42], expected 120, is " + << last_msg_->rle_list[42]; + EXPECT_EQ(last_msg_->rle_list[43], 243) + << "incorrect value for rle_list[43], expected 243, is " + << last_msg_->rle_list[43]; + EXPECT_EQ(last_msg_->rle_list[44], 151) + << "incorrect value for rle_list[44], expected 151, is " + << last_msg_->rle_list[44]; + EXPECT_EQ(last_msg_->rle_list[45], 35) + << "incorrect value for rle_list[45], expected 35, is " + << last_msg_->rle_list[45]; + EXPECT_EQ(last_msg_->rle_list[46], 17) + << "incorrect value for rle_list[46], expected 17, is " + << last_msg_->rle_list[46]; + EXPECT_EQ(last_msg_->rle_list[47], 201) + << "incorrect value for rle_list[47], expected 201, is " + << last_msg_->rle_list[47]; + EXPECT_EQ(last_msg_->rle_list[48], 211) + << "incorrect value for rle_list[48], expected 211, is " + << last_msg_->rle_list[48]; + EXPECT_EQ(last_msg_->rle_list[49], 125) + << "incorrect value for rle_list[49], expected 125, is " + << last_msg_->rle_list[49]; + EXPECT_EQ(last_msg_->rle_list[50], 117) + << "incorrect value for rle_list[50], expected 117, is " + << last_msg_->rle_list[50]; + EXPECT_EQ(last_msg_->rle_list[51], 164) + << "incorrect value for rle_list[51], expected 164, is " + << last_msg_->rle_list[51]; + EXPECT_EQ(last_msg_->rle_list[52], 142) + << "incorrect value for rle_list[52], expected 142, is " + << last_msg_->rle_list[52]; + EXPECT_EQ(last_msg_->rle_list[53], 101) + << "incorrect value for rle_list[53], expected 101, is " + << last_msg_->rle_list[53]; + EXPECT_EQ(last_msg_->rle_list[54], 239) + << "incorrect value for rle_list[54], expected 239, is " + << last_msg_->rle_list[54]; + EXPECT_EQ(last_msg_->rle_list[55], 144) + << "incorrect value for rle_list[55], expected 144, is " + << last_msg_->rle_list[55]; + EXPECT_EQ(last_msg_->rle_list[56], 158) + << "incorrect value for rle_list[56], expected 158, is " + << last_msg_->rle_list[56]; + EXPECT_EQ(last_msg_->rle_list[57], 239) + << "incorrect value for rle_list[57], expected 239, is " + << last_msg_->rle_list[57]; + EXPECT_EQ(last_msg_->rle_list[58], 90) + << "incorrect value for rle_list[58], expected 90, is " + << last_msg_->rle_list[58]; + EXPECT_EQ(last_msg_->rle_list[59], 56) + << "incorrect value for rle_list[59], expected 56, is " + << last_msg_->rle_list[59]; + EXPECT_EQ(last_msg_->rle_list[60], 71) + << "incorrect value for rle_list[60], expected 71, is " + << last_msg_->rle_list[60]; + EXPECT_EQ(last_msg_->rle_list[61], 120) + << "incorrect value for rle_list[61], expected 120, is " + << last_msg_->rle_list[61]; + EXPECT_EQ(last_msg_->rle_list[62], 67) + << "incorrect value for rle_list[62], expected 67, is " + << last_msg_->rle_list[62]; + EXPECT_EQ(last_msg_->rle_list[63], 221) + << "incorrect value for rle_list[63], expected 221, is " + << last_msg_->rle_list[63]; + EXPECT_EQ(last_msg_->rle_list[64], 114) + << "incorrect value for rle_list[64], expected 114, is " + << last_msg_->rle_list[64]; + EXPECT_EQ(last_msg_->rle_list[65], 10) + << "incorrect value for rle_list[65], expected 10, is " + << last_msg_->rle_list[65]; + EXPECT_EQ(last_msg_->rle_list[66], 190) + << "incorrect value for rle_list[66], expected 190, is " + << last_msg_->rle_list[66]; + EXPECT_EQ(last_msg_->rle_list[67], 4) + << "incorrect value for rle_list[67], expected 4, is " + << last_msg_->rle_list[67]; + EXPECT_EQ(last_msg_->rle_list[68], 230) + << "incorrect value for rle_list[68], expected 230, is " + << last_msg_->rle_list[68]; + EXPECT_EQ(last_msg_->rle_list[69], 164) + << "incorrect value for rle_list[69], expected 164, is " + << last_msg_->rle_list[69]; + EXPECT_EQ(last_msg_->rle_list[70], 171) + << "incorrect value for rle_list[70], expected 171, is " + << last_msg_->rle_list[70]; + EXPECT_EQ(last_msg_->rle_list[71], 78) + << "incorrect value for rle_list[71], expected 78, is " + << last_msg_->rle_list[71]; + EXPECT_EQ(last_msg_->rle_list[72], 185) + << "incorrect value for rle_list[72], expected 185, is " + << last_msg_->rle_list[72]; + EXPECT_EQ(last_msg_->rle_list[73], 90) + << "incorrect value for rle_list[73], expected 90, is " + << last_msg_->rle_list[73]; + EXPECT_EQ(last_msg_->rle_list[74], 46) + << "incorrect value for rle_list[74], expected 46, is " + << last_msg_->rle_list[74]; + EXPECT_EQ(last_msg_->rle_list[75], 177) + << "incorrect value for rle_list[75], expected 177, is " + << last_msg_->rle_list[75]; + EXPECT_EQ(last_msg_->rle_list[76], 82) + << "incorrect value for rle_list[76], expected 82, is " + << last_msg_->rle_list[76]; + EXPECT_EQ(last_msg_->rle_list[77], 228) + << "incorrect value for rle_list[77], expected 228, is " + << last_msg_->rle_list[77]; + EXPECT_EQ(last_msg_->rle_list[78], 123) + << "incorrect value for rle_list[78], expected 123, is " + << last_msg_->rle_list[78]; + EXPECT_EQ(last_msg_->rle_list[79], 222) + << "incorrect value for rle_list[79], expected 222, is " + << last_msg_->rle_list[79]; + EXPECT_EQ(last_msg_->rle_list[80], 227) + << "incorrect value for rle_list[80], expected 227, is " + << last_msg_->rle_list[80]; + EXPECT_EQ(last_msg_->rle_list[81], 145) + << "incorrect value for rle_list[81], expected 145, is " + << last_msg_->rle_list[81]; + EXPECT_EQ(last_msg_->rle_list[82], 195) + << "incorrect value for rle_list[82], expected 195, is " + << last_msg_->rle_list[82]; + EXPECT_EQ(last_msg_->rle_list[83], 219) + << "incorrect value for rle_list[83], expected 219, is " + << last_msg_->rle_list[83]; + EXPECT_EQ(last_msg_->rle_list[84], 27) + << "incorrect value for rle_list[84], expected 27, is " + << last_msg_->rle_list[84]; + EXPECT_EQ(last_msg_->rle_list[85], 56) + << "incorrect value for rle_list[85], expected 56, is " + << last_msg_->rle_list[85]; + EXPECT_EQ(last_msg_->rle_list[86], 227) + << "incorrect value for rle_list[86], expected 227, is " + << last_msg_->rle_list[86]; + EXPECT_EQ(last_msg_->rle_list[87], 246) + << "incorrect value for rle_list[87], expected 246, is " + << last_msg_->rle_list[87]; + EXPECT_EQ(last_msg_->rle_list[88], 215) + << "incorrect value for rle_list[88], expected 215, is " + << last_msg_->rle_list[88]; + EXPECT_EQ(last_msg_->rle_list[89], 144) + << "incorrect value for rle_list[89], expected 144, is " + << last_msg_->rle_list[89]; + EXPECT_EQ(last_msg_->rle_list[90], 158) + << "incorrect value for rle_list[90], expected 158, is " + << last_msg_->rle_list[90]; + EXPECT_EQ(last_msg_->rle_list[91], 31) + << "incorrect value for rle_list[91], expected 31, is " + << last_msg_->rle_list[91]; + EXPECT_EQ(last_msg_->rle_list[92], 214) + << "incorrect value for rle_list[92], expected 214, is " + << last_msg_->rle_list[92]; + EXPECT_EQ(last_msg_->rle_list[93], 241) + << "incorrect value for rle_list[93], expected 241, is " + << last_msg_->rle_list[93]; + EXPECT_EQ(last_msg_->rle_list[94], 254) + << "incorrect value for rle_list[94], expected 254, is " + << last_msg_->rle_list[94]; + EXPECT_EQ(last_msg_->rle_list[95], 200) + << "incorrect value for rle_list[95], expected 200, is " + << last_msg_->rle_list[95]; + EXPECT_EQ(last_msg_->rle_list[96], 86) + << "incorrect value for rle_list[96], expected 86, is " + << last_msg_->rle_list[96]; + EXPECT_EQ(last_msg_->rle_list[97], 142) + << "incorrect value for rle_list[97], expected 142, is " + << last_msg_->rle_list[97]; + EXPECT_EQ(last_msg_->rle_list[98], 89) + << "incorrect value for rle_list[98], expected 89, is " + << last_msg_->rle_list[98]; + EXPECT_EQ(last_msg_->rle_list[99], 12) + << "incorrect value for rle_list[99], expected 12, is " + << last_msg_->rle_list[99]; + EXPECT_EQ(last_msg_->rle_list[100], 121) + << "incorrect value for rle_list[100], expected 121, is " + << last_msg_->rle_list[100]; + EXPECT_EQ(last_msg_->rle_list[101], 29) + << "incorrect value for rle_list[101], expected 29, is " + << last_msg_->rle_list[101]; + EXPECT_EQ(last_msg_->rle_list[102], 124) + << "incorrect value for rle_list[102], expected 124, is " + << last_msg_->rle_list[102]; + EXPECT_EQ(last_msg_->rle_list[103], 9) + << "incorrect value for rle_list[103], expected 9, is " + << last_msg_->rle_list[103]; + EXPECT_EQ(last_msg_->rle_list[104], 19) + << "incorrect value for rle_list[104], expected 19, is " + << last_msg_->rle_list[104]; + EXPECT_EQ(last_msg_->rle_list[105], 153) + << "incorrect value for rle_list[105], expected 153, is " + << last_msg_->rle_list[105]; + EXPECT_EQ(last_msg_->rle_list[106], 44) + << "incorrect value for rle_list[106], expected 44, is " + << last_msg_->rle_list[106]; + EXPECT_EQ(last_msg_->rle_list[107], 35) + << "incorrect value for rle_list[107], expected 35, is " + << last_msg_->rle_list[107]; + EXPECT_EQ(last_msg_->rle_list[108], 126) + << "incorrect value for rle_list[108], expected 126, is " + << last_msg_->rle_list[108]; + EXPECT_EQ(last_msg_->rle_list[109], 14) + << "incorrect value for rle_list[109], expected 14, is " + << last_msg_->rle_list[109]; + EXPECT_EQ(last_msg_->rle_list[110], 217) + << "incorrect value for rle_list[110], expected 217, is " + << last_msg_->rle_list[110]; + EXPECT_EQ(last_msg_->rle_list[111], 65) + << "incorrect value for rle_list[111], expected 65, is " + << last_msg_->rle_list[111]; + EXPECT_EQ(last_msg_->rle_list[112], 116) + << "incorrect value for rle_list[112], expected 116, is " + << last_msg_->rle_list[112]; + EXPECT_EQ(last_msg_->rle_list[113], 26) + << "incorrect value for rle_list[113], expected 26, is " + << last_msg_->rle_list[113]; + EXPECT_EQ(last_msg_->rle_list[114], 139) + << "incorrect value for rle_list[114], expected 139, is " + << last_msg_->rle_list[114]; + EXPECT_EQ(last_msg_->rle_list[115], 122) + << "incorrect value for rle_list[115], expected 122, is " + << last_msg_->rle_list[115]; + EXPECT_EQ(last_msg_->rle_list[116], 114) + << "incorrect value for rle_list[116], expected 114, is " + << last_msg_->rle_list[116]; + EXPECT_EQ(last_msg_->rle_list[117], 90) + << "incorrect value for rle_list[117], expected 90, is " + << last_msg_->rle_list[117]; + EXPECT_EQ(last_msg_->rle_list[118], 124) + << "incorrect value for rle_list[118], expected 124, is " + << last_msg_->rle_list[118]; + EXPECT_EQ(last_msg_->rle_list[119], 81) + << "incorrect value for rle_list[119], expected 81, is " + << last_msg_->rle_list[119]; + EXPECT_EQ(last_msg_->rle_list[120], 0) + << "incorrect value for rle_list[120], expected 0, is " + << last_msg_->rle_list[120]; + EXPECT_EQ(last_msg_->rle_list[121], 186) + << "incorrect value for rle_list[121], expected 186, is " + << last_msg_->rle_list[121]; + EXPECT_EQ(last_msg_->rle_list[122], 246) + << "incorrect value for rle_list[122], expected 246, is " + << last_msg_->rle_list[122]; + EXPECT_EQ(last_msg_->rle_list[123], 46) + << "incorrect value for rle_list[123], expected 46, is " + << last_msg_->rle_list[123]; + EXPECT_EQ(last_msg_->rle_list[124], 98) + << "incorrect value for rle_list[124], expected 98, is " + << last_msg_->rle_list[124]; + EXPECT_EQ(last_msg_->rle_list[125], 179) + << "incorrect value for rle_list[125], expected 179, is " + << last_msg_->rle_list[125]; + EXPECT_EQ(last_msg_->rle_list[126], 243) + << "incorrect value for rle_list[126], expected 243, is " + << last_msg_->rle_list[126]; + EXPECT_EQ(last_msg_->rle_list[127], 198) + << "incorrect value for rle_list[127], expected 198, is " + << last_msg_->rle_list[127]; + EXPECT_EQ(last_msg_->rle_list[128], 217) + << "incorrect value for rle_list[128], expected 217, is " + << last_msg_->rle_list[128]; + EXPECT_EQ(last_msg_->rle_list[129], 36) + << "incorrect value for rle_list[129], expected 36, is " + << last_msg_->rle_list[129]; + EXPECT_EQ(last_msg_->rle_list[130], 30) + << "incorrect value for rle_list[130], expected 30, is " + << last_msg_->rle_list[130]; + EXPECT_EQ(last_msg_->rle_list[131], 202) + << "incorrect value for rle_list[131], expected 202, is " + << last_msg_->rle_list[131]; + EXPECT_EQ(last_msg_->rle_list[132], 12) + << "incorrect value for rle_list[132], expected 12, is " + << last_msg_->rle_list[132]; + EXPECT_EQ(last_msg_->rle_list[133], 135) + << "incorrect value for rle_list[133], expected 135, is " + << last_msg_->rle_list[133]; + EXPECT_EQ(last_msg_->rle_list[134], 61) + << "incorrect value for rle_list[134], expected 61, is " + << last_msg_->rle_list[134]; + EXPECT_EQ(last_msg_->rle_list[135], 42) + << "incorrect value for rle_list[135], expected 42, is " + << last_msg_->rle_list[135]; + EXPECT_EQ(last_msg_->rle_list[136], 150) + << "incorrect value for rle_list[136], expected 150, is " + << last_msg_->rle_list[136]; + EXPECT_EQ(last_msg_->rle_list[137], 221) + << "incorrect value for rle_list[137], expected 221, is " + << last_msg_->rle_list[137]; + EXPECT_EQ(last_msg_->rle_list[138], 102) + << "incorrect value for rle_list[138], expected 102, is " + << last_msg_->rle_list[138]; + EXPECT_EQ(last_msg_->rle_list[139], 83) + << "incorrect value for rle_list[139], expected 83, is " + << last_msg_->rle_list[139]; + EXPECT_EQ(last_msg_->rle_list[140], 179) + << "incorrect value for rle_list[140], expected 179, is " + << last_msg_->rle_list[140]; + EXPECT_EQ(last_msg_->rle_list[141], 43) + << "incorrect value for rle_list[141], expected 43, is " + << last_msg_->rle_list[141]; + EXPECT_EQ(last_msg_->rle_list[142], 252) + << "incorrect value for rle_list[142], expected 252, is " + << last_msg_->rle_list[142]; + EXPECT_EQ(last_msg_->rle_list[143], 81) + << "incorrect value for rle_list[143], expected 81, is " + << last_msg_->rle_list[143]; + EXPECT_EQ(last_msg_->rle_list[144], 62) + << "incorrect value for rle_list[144], expected 62, is " + << last_msg_->rle_list[144]; + EXPECT_EQ(last_msg_->rle_list[145], 126) + << "incorrect value for rle_list[145], expected 126, is " + << last_msg_->rle_list[145]; + EXPECT_EQ(last_msg_->rle_list[146], 204) + << "incorrect value for rle_list[146], expected 204, is " + << last_msg_->rle_list[146]; + EXPECT_EQ(last_msg_->rle_list[147], 195) + << "incorrect value for rle_list[147], expected 195, is " + << last_msg_->rle_list[147]; + EXPECT_EQ(last_msg_->rle_list[148], 238) + << "incorrect value for rle_list[148], expected 238, is " + << last_msg_->rle_list[148]; + EXPECT_EQ(last_msg_->rle_list[149], 18) + << "incorrect value for rle_list[149], expected 18, is " + << last_msg_->rle_list[149]; + EXPECT_EQ(last_msg_->rle_list[150], 128) + << "incorrect value for rle_list[150], expected 128, is " + << last_msg_->rle_list[150]; + EXPECT_EQ(last_msg_->rle_list[151], 193) + << "incorrect value for rle_list[151], expected 193, is " + << last_msg_->rle_list[151]; + EXPECT_EQ(last_msg_->rle_list[152], 53) + << "incorrect value for rle_list[152], expected 53, is " + << last_msg_->rle_list[152]; + EXPECT_EQ(last_msg_->rle_list[153], 94) + << "incorrect value for rle_list[153], expected 94, is " + << last_msg_->rle_list[153]; + EXPECT_EQ(last_msg_->rle_list[154], 99) + << "incorrect value for rle_list[154], expected 99, is " + << last_msg_->rle_list[154]; + EXPECT_EQ(last_msg_->rle_list[155], 63) + << "incorrect value for rle_list[155], expected 63, is " + << last_msg_->rle_list[155]; + EXPECT_EQ(last_msg_->rle_list[156], 182) + << "incorrect value for rle_list[156], expected 182, is " + << last_msg_->rle_list[156]; + EXPECT_EQ(last_msg_->rle_list[157], 2) + << "incorrect value for rle_list[157], expected 2, is " + << last_msg_->rle_list[157]; + EXPECT_EQ(last_msg_->rle_list[158], 186) + << "incorrect value for rle_list[158], expected 186, is " + << last_msg_->rle_list[158]; + EXPECT_EQ(last_msg_->rle_list[159], 220) + << "incorrect value for rle_list[159], expected 220, is " + << last_msg_->rle_list[159]; + EXPECT_EQ(last_msg_->rle_list[160], 77) + << "incorrect value for rle_list[160], expected 77, is " + << last_msg_->rle_list[160]; + EXPECT_EQ(last_msg_->rle_list[161], 186) + << "incorrect value for rle_list[161], expected 186, is " + << last_msg_->rle_list[161]; + EXPECT_EQ(last_msg_->rle_list[162], 224) + << "incorrect value for rle_list[162], expected 224, is " + << last_msg_->rle_list[162]; + EXPECT_EQ(last_msg_->rle_list[163], 220) + << "incorrect value for rle_list[163], expected 220, is " + << last_msg_->rle_list[163]; + EXPECT_EQ(last_msg_->rle_list[164], 13) + << "incorrect value for rle_list[164], expected 13, is " + << last_msg_->rle_list[164]; + EXPECT_EQ(last_msg_->rle_list[165], 212) + << "incorrect value for rle_list[165], expected 212, is " + << last_msg_->rle_list[165]; + EXPECT_EQ(last_msg_->rle_list[166], 182) + << "incorrect value for rle_list[166], expected 182, is " + << last_msg_->rle_list[166]; + EXPECT_EQ(last_msg_->rle_list[167], 88) + << "incorrect value for rle_list[167], expected 88, is " + << last_msg_->rle_list[167]; + EXPECT_EQ(last_msg_->rle_list[168], 15) + << "incorrect value for rle_list[168], expected 15, is " + << last_msg_->rle_list[168]; + EXPECT_EQ(last_msg_->rle_list[169], 151) + << "incorrect value for rle_list[169], expected 151, is " + << last_msg_->rle_list[169]; + EXPECT_EQ(last_msg_->rle_list[170], 5) + << "incorrect value for rle_list[170], expected 5, is " + << last_msg_->rle_list[170]; + EXPECT_EQ(last_msg_->rle_list[171], 93) + << "incorrect value for rle_list[171], expected 93, is " + << last_msg_->rle_list[171]; + EXPECT_EQ(last_msg_->rle_list[172], 251) + << "incorrect value for rle_list[172], expected 251, is " + << last_msg_->rle_list[172]; + EXPECT_EQ(last_msg_->rle_list[173], 164) + << "incorrect value for rle_list[173], expected 164, is " + << last_msg_->rle_list[173]; + EXPECT_EQ(last_msg_->rle_list[174], 18) + << "incorrect value for rle_list[174], expected 18, is " + << last_msg_->rle_list[174]; + EXPECT_EQ(last_msg_->rle_list[175], 228) + << "incorrect value for rle_list[175], expected 228, is " + << last_msg_->rle_list[175]; + EXPECT_EQ(last_msg_->rle_list[176], 168) + << "incorrect value for rle_list[176], expected 168, is " + << last_msg_->rle_list[176]; + EXPECT_EQ(last_msg_->rle_list[177], 226) + << "incorrect value for rle_list[177], expected 226, is " + << last_msg_->rle_list[177]; + EXPECT_EQ(last_msg_->rle_list[178], 195) + << "incorrect value for rle_list[178], expected 195, is " + << last_msg_->rle_list[178]; + EXPECT_EQ(last_msg_->rle_list[179], 44) + << "incorrect value for rle_list[179], expected 44, is " + << last_msg_->rle_list[179]; + EXPECT_EQ(last_msg_->rle_list[180], 170) + << "incorrect value for rle_list[180], expected 170, is " + << last_msg_->rle_list[180]; + EXPECT_EQ(last_msg_->rle_list[181], 145) + << "incorrect value for rle_list[181], expected 145, is " + << last_msg_->rle_list[181]; + EXPECT_EQ(last_msg_->rle_list[182], 36) + << "incorrect value for rle_list[182], expected 36, is " + << last_msg_->rle_list[182]; + EXPECT_EQ(last_msg_->rle_list[183], 58) + << "incorrect value for rle_list[183], expected 58, is " + << last_msg_->rle_list[183]; + EXPECT_EQ(last_msg_->rle_list[184], 96) + << "incorrect value for rle_list[184], expected 96, is " + << last_msg_->rle_list[184]; + EXPECT_EQ(last_msg_->rle_list[185], 107) + << "incorrect value for rle_list[185], expected 107, is " + << last_msg_->rle_list[185]; + EXPECT_EQ(last_msg_->rle_list[186], 144) + << "incorrect value for rle_list[186], expected 144, is " + << last_msg_->rle_list[186]; + EXPECT_EQ(last_msg_->rle_list[187], 11) + << "incorrect value for rle_list[187], expected 11, is " + << last_msg_->rle_list[187]; + EXPECT_EQ(last_msg_->rle_list[188], 228) + << "incorrect value for rle_list[188], expected 228, is " + << last_msg_->rle_list[188]; + EXPECT_EQ(last_msg_->rle_list[189], 12) + << "incorrect value for rle_list[189], expected 12, is " + << last_msg_->rle_list[189]; + EXPECT_EQ(last_msg_->rle_list[190], 163) + << "incorrect value for rle_list[190], expected 163, is " + << last_msg_->rle_list[190]; + EXPECT_EQ(last_msg_->rle_list[191], 238) + << "incorrect value for rle_list[191], expected 238, is " + << last_msg_->rle_list[191]; + EXPECT_EQ(last_msg_->rle_list[192], 247) + << "incorrect value for rle_list[192], expected 247, is " + << last_msg_->rle_list[192]; + EXPECT_EQ(last_msg_->rle_list[193], 159) + << "incorrect value for rle_list[193], expected 159, is " + << last_msg_->rle_list[193]; + EXPECT_EQ(last_msg_->rle_list[194], 189) + << "incorrect value for rle_list[194], expected 189, is " + << last_msg_->rle_list[194]; + EXPECT_EQ(last_msg_->rle_list[195], 1) + << "incorrect value for rle_list[195], expected 1, is " + << last_msg_->rle_list[195]; + EXPECT_EQ(last_msg_->rle_list[196], 115) + << "incorrect value for rle_list[196], expected 115, is " + << last_msg_->rle_list[196]; + EXPECT_EQ(last_msg_->rle_list[197], 65) + << "incorrect value for rle_list[197], expected 65, is " + << last_msg_->rle_list[197]; + EXPECT_EQ(last_msg_->rle_list[198], 202) + << "incorrect value for rle_list[198], expected 202, is " + << last_msg_->rle_list[198]; + EXPECT_EQ(last_msg_->rle_list[199], 121) + << "incorrect value for rle_list[199], expected 121, is " + << last_msg_->rle_list[199]; + EXPECT_EQ(last_msg_->rle_list[200], 47) + << "incorrect value for rle_list[200], expected 47, is " + << last_msg_->rle_list[200]; + EXPECT_EQ(last_msg_->rle_list[201], 193) + << "incorrect value for rle_list[201], expected 193, is " + << last_msg_->rle_list[201]; + EXPECT_EQ(last_msg_->rle_list[202], 11) + << "incorrect value for rle_list[202], expected 11, is " + << last_msg_->rle_list[202]; + EXPECT_EQ(last_msg_->rle_list[203], 96) + << "incorrect value for rle_list[203], expected 96, is " + << last_msg_->rle_list[203]; + EXPECT_EQ(last_msg_->rle_list[204], 93) + << "incorrect value for rle_list[204], expected 93, is " + << last_msg_->rle_list[204]; + EXPECT_EQ(last_msg_->rle_list[205], 72) + << "incorrect value for rle_list[205], expected 72, is " + << last_msg_->rle_list[205]; + EXPECT_EQ(last_msg_->rle_list[206], 81) + << "incorrect value for rle_list[206], expected 81, is " + << last_msg_->rle_list[206]; + EXPECT_EQ(last_msg_->rle_list[207], 207) + << "incorrect value for rle_list[207], expected 207, is " + << last_msg_->rle_list[207]; + EXPECT_EQ(last_msg_->rle_list[208], 121) + << "incorrect value for rle_list[208], expected 121, is " + << last_msg_->rle_list[208]; + EXPECT_EQ(last_msg_->rle_list[209], 19) + << "incorrect value for rle_list[209], expected 19, is " + << last_msg_->rle_list[209]; + EXPECT_EQ(last_msg_->rle_list[210], 151) + << "incorrect value for rle_list[210], expected 151, is " + << last_msg_->rle_list[210]; + EXPECT_EQ(last_msg_->rle_list[211], 136) + << "incorrect value for rle_list[211], expected 136, is " + << last_msg_->rle_list[211]; + EXPECT_EQ(last_msg_->rle_list[212], 233) + << "incorrect value for rle_list[212], expected 233, is " + << last_msg_->rle_list[212]; + EXPECT_EQ(last_msg_->rle_list[213], 51) + << "incorrect value for rle_list[213], expected 51, is " + << last_msg_->rle_list[213]; + EXPECT_EQ(last_msg_->rle_list[214], 133) + << "incorrect value for rle_list[214], expected 133, is " + << last_msg_->rle_list[214]; + EXPECT_EQ(last_msg_->rle_list[215], 195) + << "incorrect value for rle_list[215], expected 195, is " + << last_msg_->rle_list[215]; + EXPECT_EQ(last_msg_->rle_list[216], 77) + << "incorrect value for rle_list[216], expected 77, is " + << last_msg_->rle_list[216]; + EXPECT_EQ(last_msg_->rle_list[217], 44) + << "incorrect value for rle_list[217], expected 44, is " + << last_msg_->rle_list[217]; + EXPECT_EQ(last_msg_->rle_list[218], 147) + << "incorrect value for rle_list[218], expected 147, is " + << last_msg_->rle_list[218]; + EXPECT_EQ(last_msg_->rle_list[219], 206) + << "incorrect value for rle_list[219], expected 206, is " + << last_msg_->rle_list[219]; + EXPECT_EQ(last_msg_->rle_list[220], 120) + << "incorrect value for rle_list[220], expected 120, is " + << last_msg_->rle_list[220]; + EXPECT_EQ(last_msg_->rle_list[221], 252) + << "incorrect value for rle_list[221], expected 252, is " + << last_msg_->rle_list[221]; + EXPECT_EQ(last_msg_->rle_list[222], 77) + << "incorrect value for rle_list[222], expected 77, is " + << last_msg_->rle_list[222]; + EXPECT_EQ(last_msg_->rle_list[223], 212) + << "incorrect value for rle_list[223], expected 212, is " + << last_msg_->rle_list[223]; + EXPECT_EQ(last_msg_->rle_list[224], 68) + << "incorrect value for rle_list[224], expected 68, is " + << last_msg_->rle_list[224]; + EXPECT_EQ(last_msg_->rle_list[225], 60) + << "incorrect value for rle_list[225], expected 60, is " + << last_msg_->rle_list[225]; + EXPECT_EQ(last_msg_->rle_list[226], 206) + << "incorrect value for rle_list[226], expected 206, is " + << last_msg_->rle_list[226]; + EXPECT_EQ(last_msg_->rle_list[227], 106) + << "incorrect value for rle_list[227], expected 106, is " + << last_msg_->rle_list[227]; + EXPECT_EQ(last_msg_->rle_list[228], 207) + << "incorrect value for rle_list[228], expected 207, is " + << last_msg_->rle_list[228]; + EXPECT_EQ(last_msg_->rle_list[229], 243) + << "incorrect value for rle_list[229], expected 243, is " + << last_msg_->rle_list[229]; + EXPECT_EQ(last_msg_->rle_list[230], 158) + << "incorrect value for rle_list[230], expected 158, is " + << last_msg_->rle_list[230]; + EXPECT_EQ(last_msg_->rle_list[231], 94) + << "incorrect value for rle_list[231], expected 94, is " + << last_msg_->rle_list[231]; + EXPECT_EQ(last_msg_->rle_list[232], 6) + << "incorrect value for rle_list[232], expected 6, is " + << last_msg_->rle_list[232]; + EXPECT_EQ(last_msg_->rle_list[233], 3) + << "incorrect value for rle_list[233], expected 3, is " + << last_msg_->rle_list[233]; + EXPECT_EQ(last_msg_->rle_list[234], 205) + << "incorrect value for rle_list[234], expected 205, is " + << last_msg_->rle_list[234]; + EXPECT_EQ(last_msg_->rle_list[235], 92) + << "incorrect value for rle_list[235], expected 92, is " + << last_msg_->rle_list[235]; + EXPECT_EQ(last_msg_->rle_list[236], 84) + << "incorrect value for rle_list[236], expected 84, is " + << last_msg_->rle_list[236]; + EXPECT_EQ(last_msg_->rle_list[237], 2) + << "incorrect value for rle_list[237], expected 2, is " + << last_msg_->rle_list[237]; + EXPECT_EQ(last_msg_->rle_list[238], 220) + << "incorrect value for rle_list[238], expected 220, is " + << last_msg_->rle_list[238]; + EXPECT_EQ(last_msg_->rle_list[239], 50) + << "incorrect value for rle_list[239], expected 50, is " + << last_msg_->rle_list[239]; + EXPECT_EQ(last_msg_->rle_list[240], 61) + << "incorrect value for rle_list[240], expected 61, is " + << last_msg_->rle_list[240]; + EXPECT_EQ(last_msg_->rle_list[241], 38) + << "incorrect value for rle_list[241], expected 38, is " + << last_msg_->rle_list[241]; + EXPECT_EQ(last_msg_->rle_list[242], 141) + << "incorrect value for rle_list[242], expected 141, is " + << last_msg_->rle_list[242]; + EXPECT_EQ(last_msg_->rle_list[243], 117) + << "incorrect value for rle_list[243], expected 117, is " + << last_msg_->rle_list[243]; + EXPECT_EQ(last_msg_->rle_list[244], 108) + << "incorrect value for rle_list[244], expected 108, is " + << last_msg_->rle_list[244]; + EXPECT_EQ(last_msg_->rle_list[245], 101) + << "incorrect value for rle_list[245], expected 101, is " + << last_msg_->rle_list[245]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrection.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrection.cc index 4efadf398..d4c3e33bf 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrection.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrection.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrection.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrection.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_gridded_correction_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_gridded_correction_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,611 +82,1114 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_gridded_correction_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrection0, Test) { + uint8_t encoded_frame[] = { + 85, 252, 5, 196, 249, 253, 21, 14, 151, 50, 120, 133, 29, 151, 174, + 229, 151, 189, 204, 196, 105, 170, 120, 149, 169, 37, 244, 78, 72, 140, + 101, 2, 173, 88, 70, 180, 54, 152, 115, 78, 201, 161, 23, 135, 152, + 98, 61, 75, 178, 120, 229, 146, 55, 58, 169, 234, 230, 69, 172, 191, + 127, 146, 89, 150, 91, 111, 225, 41, 17, 119, 52, 166, 166, 120, 57, + 221, 12, 3, 156, 70, 156, 35, 127, 8, 127, 58, 128, 55, 115, 80, + 157, 122, 153, 124, 27, 128, 98, 103, 204, 75, 238, 128, 226, 148, 248, + 61, 216, 208, 149, 167, 224, 40, 144, 186, 157, 227, 72, 240, 100, 35, + 12, 212, 7, 59, 176, 81, 86, 27, 24, 155, 67, 43, 132, 45, 203, + 44, 6, 112, 183, 231, 176, 79, 194, 253, 247, 103, 91, 226, 116, 148, + 23, 62, 227, 240, 29, 219, 205, 18, 242, 207, 72, 71, 79, 37, 42, + 176, 201, 202, 91, 105, 115, 146, 59, 110, 44, 109, 128, 183, 185, 67, + 31, 165, 92, 79, 189, 180, 94, 7, 162, 121, 156, 210, 47, 7, 7, + 205, 174, 41, 241, 129, 210, 43, 101, 186, 208, 195, 226, 247, 187, 219, + 160, 120, 192, 102, 166, 42, 246, 173, 94, 102, 156, 222, 30, 35, 247, + 64, 189, 137, 204, 220, 32, 71, 222, 222, 201, 246, 3, 25, 45, 251, + 239, 115, 88, 218, 10, 209, 120, 65, 175, 131, 194, 41, 174, 137, 17, + 68, 28, 253, 42, 178, 35, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_gridded_correction_t *test_msg = + (msg_ssr_gridded_correction_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.iod_atmo = 170; + test_msg->header.num_msgs = 48535; + test_msg->header.seq_num = 50380; + test_msg->header.tile_id = 12951; + test_msg->header.tile_set_id = 3605; + test_msg->header.time.tow = 2535294328; + test_msg->header.time.wn = 58798; + test_msg->header.tropo_quality_indicator = 120; + test_msg->header.update_interval = 105; + test_msg->index = 43413; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[0].residual = -21246; + test_msg->stec_residuals[0].stddev = 88; + test_msg->stec_residuals[0].sv_id.constellation = 101; + test_msg->stec_residuals[0].sv_id.satId = 140; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[1].residual = -26570; + test_msg->stec_residuals[1].stddev = 115; + test_msg->stec_residuals[1].sv_id.constellation = 180; + test_msg->stec_residuals[1].sv_id.satId = 70; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[2].residual = 6049; + test_msg->stec_residuals[2].stddev = 135; + test_msg->stec_residuals[2].sv_id.constellation = 201; + test_msg->stec_residuals[2].sv_id.satId = 78; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[3].residual = 19261; + test_msg->stec_residuals[3].stddev = 178; + test_msg->stec_residuals[3].sv_id.constellation = 98; + test_msg->stec_residuals[3].sv_id.satId = 152; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[4].residual = 14226; + test_msg->stec_residuals[4].stddev = 58; + test_msg->stec_residuals[4].sv_id.constellation = 229; + test_msg->stec_residuals[4].sv_id.satId = 120; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[5].residual = 17894; + test_msg->stec_residuals[5].stddev = 172; + test_msg->stec_residuals[5].sv_id.constellation = 234; + test_msg->stec_residuals[5].sv_id.satId = 169; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[6].residual = 22930; + test_msg->stec_residuals[6].stddev = 150; + test_msg->stec_residuals[6].sv_id.constellation = 127; + test_msg->stec_residuals[6].sv_id.satId = 191; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[7].residual = 10721; + test_msg->stec_residuals[7].stddev = 17; + test_msg->stec_residuals[7].sv_id.constellation = 111; + test_msg->stec_residuals[7].sv_id.satId = 91; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[8].residual = -22874; + test_msg->stec_residuals[8].stddev = 120; + test_msg->stec_residuals[8].sv_id.constellation = 52; + test_msg->stec_residuals[8].sv_id.satId = 119; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[9].residual = 780; + test_msg->stec_residuals[9].stddev = 156; + test_msg->stec_residuals[9].sv_id.constellation = 221; + test_msg->stec_residuals[9].sv_id.satId = 57; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[10].residual = 32547; + test_msg->stec_residuals[10].stddev = 8; + test_msg->stec_residuals[10].sv_id.constellation = 156; + test_msg->stec_residuals[10].sv_id.satId = 70; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[11].residual = 14208; + test_msg->stec_residuals[11].stddev = 115; + test_msg->stec_residuals[11].sv_id.constellation = 58; + test_msg->stec_residuals[11].sv_id.satId = 127; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[12].residual = -26246; + test_msg->stec_residuals[12].stddev = 124; + test_msg->stec_residuals[12].sv_id.constellation = 157; + test_msg->stec_residuals[12].sv_id.satId = 80; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[13].residual = 26466; + test_msg->stec_residuals[13].stddev = 204; + test_msg->stec_residuals[13].sv_id.constellation = 128; + test_msg->stec_residuals[13].sv_id.satId = 27; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[14].residual = -7552; + test_msg->stec_residuals[14].stddev = 148; + test_msg->stec_residuals[14].sv_id.constellation = 238; + test_msg->stec_residuals[14].sv_id.satId = 75; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[15].residual = -12072; + test_msg->stec_residuals[15].stddev = 149; + test_msg->stec_residuals[15].sv_id.constellation = 61; + test_msg->stec_residuals[15].sv_id.satId = 248; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[16].residual = -28632; + test_msg->stec_residuals[16].stddev = 186; + test_msg->stec_residuals[16].sv_id.constellation = 224; + test_msg->stec_residuals[16].sv_id.satId = 167; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[17].residual = -4024; + test_msg->stec_residuals[17].stddev = 100; + test_msg->stec_residuals[17].sv_id.constellation = 227; + test_msg->stec_residuals[17].sv_id.satId = 157; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[18].residual = 2004; + test_msg->stec_residuals[18].stddev = 59; + test_msg->stec_residuals[18].sv_id.constellation = 12; + test_msg->stec_residuals[18].sv_id.satId = 35; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[19].residual = 6998; + test_msg->stec_residuals[19].stddev = 24; + test_msg->stec_residuals[19].sv_id.constellation = 81; + test_msg->stec_residuals[19].sv_id.satId = 176; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[20].residual = -31701; + test_msg->stec_residuals[20].stddev = 45; + test_msg->stec_residuals[20].sv_id.constellation = 67; + test_msg->stec_residuals[20].sv_id.satId = 155; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[21].residual = 28678; + test_msg->stec_residuals[21].stddev = 183; + test_msg->stec_residuals[21].sv_id.constellation = 44; + test_msg->stec_residuals[21].sv_id.satId = 203; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[22].residual = -15793; + test_msg->stec_residuals[22].stddev = 253; + test_msg->stec_residuals[22].sv_id.constellation = 176; + test_msg->stec_residuals[22].sv_id.satId = 231; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[23].residual = -7589; + test_msg->stec_residuals[23].stddev = 116; + test_msg->stec_residuals[23].sv_id.constellation = 103; + test_msg->stec_residuals[23].sv_id.satId = 247; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[24].residual = -7362; + test_msg->stec_residuals[24].stddev = 240; + test_msg->stec_residuals[24].sv_id.constellation = 23; + test_msg->stec_residuals[24].sv_id.satId = 148; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[25].residual = 4813; + test_msg->stec_residuals[25].stddev = 242; + test_msg->stec_residuals[25].sv_id.constellation = 219; + test_msg->stec_residuals[25].sv_id.satId = 29; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[26].residual = 20295; + test_msg->stec_residuals[26].stddev = 37; + test_msg->stec_residuals[26].sv_id.constellation = 72; + test_msg->stec_residuals[26].sv_id.satId = 207; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[27].residual = -13623; + test_msg->stec_residuals[27].stddev = 91; + test_msg->stec_residuals[27].sv_id.constellation = 176; + test_msg->stec_residuals[27].sv_id.satId = 42; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[28].residual = 15250; + test_msg->stec_residuals[28].stddev = 110; + test_msg->stec_residuals[28].sv_id.constellation = 115; + test_msg->stec_residuals[28].sv_id.satId = 105; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[29].residual = -18560; + test_msg->stec_residuals[29].stddev = 185; + test_msg->stec_residuals[29].sv_id.constellation = 109; + test_msg->stec_residuals[29].sv_id.satId = 44; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[30].residual = 23717; + test_msg->stec_residuals[30].stddev = 79; + test_msg->stec_residuals[30].sv_id.constellation = 31; + test_msg->stec_residuals[30].sv_id.satId = 67; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[31].residual = 1886; + test_msg->stec_residuals[31].stddev = 162; + test_msg->stec_residuals[31].sv_id.constellation = 180; + test_msg->stec_residuals[31].sv_id.satId = 189; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[32].residual = 12242; + test_msg->stec_residuals[32].stddev = 7; + test_msg->stec_residuals[32].sv_id.constellation = 156; + test_msg->stec_residuals[32].sv_id.satId = 121; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[33].residual = 10670; + test_msg->stec_residuals[33].stddev = 241; + test_msg->stec_residuals[33].sv_id.constellation = 205; + test_msg->stec_residuals[33].sv_id.satId = 7; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[34].residual = 25899; + test_msg->stec_residuals[34].stddev = 186; + test_msg->stec_residuals[34].sv_id.constellation = 210; + test_msg->stec_residuals[34].sv_id.satId = 129; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[35].residual = -2078; + test_msg->stec_residuals[35].stddev = 187; + test_msg->stec_residuals[35].sv_id.constellation = 195; + test_msg->stec_residuals[35].sv_id.satId = 208; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[36].residual = -16264; + test_msg->stec_residuals[36].stddev = 102; + test_msg->stec_residuals[36].sv_id.constellation = 160; + test_msg->stec_residuals[36].sv_id.satId = 219; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[37].residual = -21002; + test_msg->stec_residuals[37].stddev = 94; + test_msg->stec_residuals[37].sv_id.constellation = 42; + test_msg->stec_residuals[37].sv_id.satId = 166; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[38].residual = 7902; + test_msg->stec_residuals[38].stddev = 35; + test_msg->stec_residuals[38].sv_id.constellation = 156; + test_msg->stec_residuals[38].sv_id.satId = 102; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[39].residual = -30275; + test_msg->stec_residuals[39].stddev = 204; + test_msg->stec_residuals[39].sv_id.constellation = 64; + test_msg->stec_residuals[39].sv_id.satId = 247; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[40].residual = -8633; + test_msg->stec_residuals[40].stddev = 222; + test_msg->stec_residuals[40].sv_id.constellation = 32; + test_msg->stec_residuals[40].sv_id.satId = 220; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[41].residual = 6403; + test_msg->stec_residuals[41].stddev = 45; + test_msg->stec_residuals[41].sv_id.constellation = 246; + test_msg->stec_residuals[41].sv_id.satId = 201; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[42].residual = 22643; + test_msg->stec_residuals[42].stddev = 218; + test_msg->stec_residuals[42].sv_id.constellation = 239; + test_msg->stec_residuals[42].sv_id.satId = 251; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[43].residual = 16760; + test_msg->stec_residuals[43].stddev = 175; + test_msg->stec_residuals[43].sv_id.constellation = 209; + test_msg->stec_residuals[43].sv_id.satId = 10; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[44].residual = -20951; + test_msg->stec_residuals[44].stddev = 137; + test_msg->stec_residuals[44].sv_id.constellation = 194; + test_msg->stec_residuals[44].sv_id.satId = 131; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[45].residual = -740; + test_msg->stec_residuals[45].stddev = 42; + test_msg->stec_residuals[45].sv_id.constellation = 68; + test_msg->stec_residuals[45].sv_id.satId = 17; + test_msg->tropo_delay_correction.hydro = -3035; + test_msg->tropo_delay_correction.stddev = 72; + test_msg->tropo_delay_correction.wet = 78; + + EXPECT_EQ(send_message(0x5fc, 63940, test_msg_len, test_msg_storage), SBP_OK); - uint8_t encoded_frame[] = {85,252,5,196,249,253,21,14,151,50,120,133,29,151,174,229,151,189,204,196,105,170,120,149,169,37,244,78,72,140,101,2,173,88,70,180,54,152,115,78,201,161,23,135,152,98,61,75,178,120,229,146,55,58,169,234,230,69,172,191,127,146,89,150,91,111,225,41,17,119,52,166,166,120,57,221,12,3,156,70,156,35,127,8,127,58,128,55,115,80,157,122,153,124,27,128,98,103,204,75,238,128,226,148,248,61,216,208,149,167,224,40,144,186,157,227,72,240,100,35,12,212,7,59,176,81,86,27,24,155,67,43,132,45,203,44,6,112,183,231,176,79,194,253,247,103,91,226,116,148,23,62,227,240,29,219,205,18,242,207,72,71,79,37,42,176,201,202,91,105,115,146,59,110,44,109,128,183,185,67,31,165,92,79,189,180,94,7,162,121,156,210,47,7,7,205,174,41,241,129,210,43,101,186,208,195,226,247,187,219,160,120,192,102,166,42,246,173,94,102,156,222,30,35,247,64,189,137,204,220,32,71,222,222,201,246,3,25,45,251,239,115,88,218,10,209,120,65,175,131,194,41,174,137,17,68,28,253,42,178,35, }; + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_gridded_correction_t* test_msg = ( msg_ssr_gridded_correction_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.iod_atmo = 170; - test_msg->header.num_msgs = 48535; - test_msg->header.seq_num = 50380; - test_msg->header.tile_id = 12951; - test_msg->header.tile_set_id = 3605; - test_msg->header.time.tow = 2535294328; - test_msg->header.time.wn = 58798; - test_msg->header.tropo_quality_indicator = 120; - test_msg->header.update_interval = 105; - test_msg->index = 43413; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[0].residual = -21246; - test_msg->stec_residuals[0].stddev = 88; - test_msg->stec_residuals[0].sv_id.constellation = 101; - test_msg->stec_residuals[0].sv_id.satId = 140; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[1].residual = -26570; - test_msg->stec_residuals[1].stddev = 115; - test_msg->stec_residuals[1].sv_id.constellation = 180; - test_msg->stec_residuals[1].sv_id.satId = 70; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[2].residual = 6049; - test_msg->stec_residuals[2].stddev = 135; - test_msg->stec_residuals[2].sv_id.constellation = 201; - test_msg->stec_residuals[2].sv_id.satId = 78; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[3].residual = 19261; - test_msg->stec_residuals[3].stddev = 178; - test_msg->stec_residuals[3].sv_id.constellation = 98; - test_msg->stec_residuals[3].sv_id.satId = 152; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[4].residual = 14226; - test_msg->stec_residuals[4].stddev = 58; - test_msg->stec_residuals[4].sv_id.constellation = 229; - test_msg->stec_residuals[4].sv_id.satId = 120; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[5].residual = 17894; - test_msg->stec_residuals[5].stddev = 172; - test_msg->stec_residuals[5].sv_id.constellation = 234; - test_msg->stec_residuals[5].sv_id.satId = 169; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[6].residual = 22930; - test_msg->stec_residuals[6].stddev = 150; - test_msg->stec_residuals[6].sv_id.constellation = 127; - test_msg->stec_residuals[6].sv_id.satId = 191; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[7].residual = 10721; - test_msg->stec_residuals[7].stddev = 17; - test_msg->stec_residuals[7].sv_id.constellation = 111; - test_msg->stec_residuals[7].sv_id.satId = 91; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[8].residual = -22874; - test_msg->stec_residuals[8].stddev = 120; - test_msg->stec_residuals[8].sv_id.constellation = 52; - test_msg->stec_residuals[8].sv_id.satId = 119; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[9].residual = 780; - test_msg->stec_residuals[9].stddev = 156; - test_msg->stec_residuals[9].sv_id.constellation = 221; - test_msg->stec_residuals[9].sv_id.satId = 57; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[10].residual = 32547; - test_msg->stec_residuals[10].stddev = 8; - test_msg->stec_residuals[10].sv_id.constellation = 156; - test_msg->stec_residuals[10].sv_id.satId = 70; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[11].residual = 14208; - test_msg->stec_residuals[11].stddev = 115; - test_msg->stec_residuals[11].sv_id.constellation = 58; - test_msg->stec_residuals[11].sv_id.satId = 127; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[12].residual = -26246; - test_msg->stec_residuals[12].stddev = 124; - test_msg->stec_residuals[12].sv_id.constellation = 157; - test_msg->stec_residuals[12].sv_id.satId = 80; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[13].residual = 26466; - test_msg->stec_residuals[13].stddev = 204; - test_msg->stec_residuals[13].sv_id.constellation = 128; - test_msg->stec_residuals[13].sv_id.satId = 27; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[14].residual = -7552; - test_msg->stec_residuals[14].stddev = 148; - test_msg->stec_residuals[14].sv_id.constellation = 238; - test_msg->stec_residuals[14].sv_id.satId = 75; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[15].residual = -12072; - test_msg->stec_residuals[15].stddev = 149; - test_msg->stec_residuals[15].sv_id.constellation = 61; - test_msg->stec_residuals[15].sv_id.satId = 248; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[16].residual = -28632; - test_msg->stec_residuals[16].stddev = 186; - test_msg->stec_residuals[16].sv_id.constellation = 224; - test_msg->stec_residuals[16].sv_id.satId = 167; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[17].residual = -4024; - test_msg->stec_residuals[17].stddev = 100; - test_msg->stec_residuals[17].sv_id.constellation = 227; - test_msg->stec_residuals[17].sv_id.satId = 157; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[18].residual = 2004; - test_msg->stec_residuals[18].stddev = 59; - test_msg->stec_residuals[18].sv_id.constellation = 12; - test_msg->stec_residuals[18].sv_id.satId = 35; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[19].residual = 6998; - test_msg->stec_residuals[19].stddev = 24; - test_msg->stec_residuals[19].sv_id.constellation = 81; - test_msg->stec_residuals[19].sv_id.satId = 176; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[20].residual = -31701; - test_msg->stec_residuals[20].stddev = 45; - test_msg->stec_residuals[20].sv_id.constellation = 67; - test_msg->stec_residuals[20].sv_id.satId = 155; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[21].residual = 28678; - test_msg->stec_residuals[21].stddev = 183; - test_msg->stec_residuals[21].sv_id.constellation = 44; - test_msg->stec_residuals[21].sv_id.satId = 203; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[22].residual = -15793; - test_msg->stec_residuals[22].stddev = 253; - test_msg->stec_residuals[22].sv_id.constellation = 176; - test_msg->stec_residuals[22].sv_id.satId = 231; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[23].residual = -7589; - test_msg->stec_residuals[23].stddev = 116; - test_msg->stec_residuals[23].sv_id.constellation = 103; - test_msg->stec_residuals[23].sv_id.satId = 247; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[24].residual = -7362; - test_msg->stec_residuals[24].stddev = 240; - test_msg->stec_residuals[24].sv_id.constellation = 23; - test_msg->stec_residuals[24].sv_id.satId = 148; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[25].residual = 4813; - test_msg->stec_residuals[25].stddev = 242; - test_msg->stec_residuals[25].sv_id.constellation = 219; - test_msg->stec_residuals[25].sv_id.satId = 29; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[26].residual = 20295; - test_msg->stec_residuals[26].stddev = 37; - test_msg->stec_residuals[26].sv_id.constellation = 72; - test_msg->stec_residuals[26].sv_id.satId = 207; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[27].residual = -13623; - test_msg->stec_residuals[27].stddev = 91; - test_msg->stec_residuals[27].sv_id.constellation = 176; - test_msg->stec_residuals[27].sv_id.satId = 42; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[28].residual = 15250; - test_msg->stec_residuals[28].stddev = 110; - test_msg->stec_residuals[28].sv_id.constellation = 115; - test_msg->stec_residuals[28].sv_id.satId = 105; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[29].residual = -18560; - test_msg->stec_residuals[29].stddev = 185; - test_msg->stec_residuals[29].sv_id.constellation = 109; - test_msg->stec_residuals[29].sv_id.satId = 44; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[30].residual = 23717; - test_msg->stec_residuals[30].stddev = 79; - test_msg->stec_residuals[30].sv_id.constellation = 31; - test_msg->stec_residuals[30].sv_id.satId = 67; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[31].residual = 1886; - test_msg->stec_residuals[31].stddev = 162; - test_msg->stec_residuals[31].sv_id.constellation = 180; - test_msg->stec_residuals[31].sv_id.satId = 189; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[32].residual = 12242; - test_msg->stec_residuals[32].stddev = 7; - test_msg->stec_residuals[32].sv_id.constellation = 156; - test_msg->stec_residuals[32].sv_id.satId = 121; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[33].residual = 10670; - test_msg->stec_residuals[33].stddev = 241; - test_msg->stec_residuals[33].sv_id.constellation = 205; - test_msg->stec_residuals[33].sv_id.satId = 7; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[34].residual = 25899; - test_msg->stec_residuals[34].stddev = 186; - test_msg->stec_residuals[34].sv_id.constellation = 210; - test_msg->stec_residuals[34].sv_id.satId = 129; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[35].residual = -2078; - test_msg->stec_residuals[35].stddev = 187; - test_msg->stec_residuals[35].sv_id.constellation = 195; - test_msg->stec_residuals[35].sv_id.satId = 208; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[36].residual = -16264; - test_msg->stec_residuals[36].stddev = 102; - test_msg->stec_residuals[36].sv_id.constellation = 160; - test_msg->stec_residuals[36].sv_id.satId = 219; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[37].residual = -21002; - test_msg->stec_residuals[37].stddev = 94; - test_msg->stec_residuals[37].sv_id.constellation = 42; - test_msg->stec_residuals[37].sv_id.satId = 166; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[38].residual = 7902; - test_msg->stec_residuals[38].stddev = 35; - test_msg->stec_residuals[38].sv_id.constellation = 156; - test_msg->stec_residuals[38].sv_id.satId = 102; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[39].residual = -30275; - test_msg->stec_residuals[39].stddev = 204; - test_msg->stec_residuals[39].sv_id.constellation = 64; - test_msg->stec_residuals[39].sv_id.satId = 247; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[40].residual = -8633; - test_msg->stec_residuals[40].stddev = 222; - test_msg->stec_residuals[40].sv_id.constellation = 32; - test_msg->stec_residuals[40].sv_id.satId = 220; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[41].residual = 6403; - test_msg->stec_residuals[41].stddev = 45; - test_msg->stec_residuals[41].sv_id.constellation = 246; - test_msg->stec_residuals[41].sv_id.satId = 201; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[42].residual = 22643; - test_msg->stec_residuals[42].stddev = 218; - test_msg->stec_residuals[42].sv_id.constellation = 239; - test_msg->stec_residuals[42].sv_id.satId = 251; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[43].residual = 16760; - test_msg->stec_residuals[43].stddev = 175; - test_msg->stec_residuals[43].sv_id.constellation = 209; - test_msg->stec_residuals[43].sv_id.satId = 10; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[44].residual = -20951; - test_msg->stec_residuals[44].stddev = 137; - test_msg->stec_residuals[44].sv_id.constellation = 194; - test_msg->stec_residuals[44].sv_id.satId = 131; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[45].residual = -740; - test_msg->stec_residuals[45].stddev = 42; - test_msg->stec_residuals[45].sv_id.constellation = 68; - test_msg->stec_residuals[45].sv_id.satId = 17; - test_msg->tropo_delay_correction.hydro = -3035; - test_msg->tropo_delay_correction.stddev = 72; - test_msg->tropo_delay_correction.wet = 78; - - EXPECT_EQ(send_message( 0x5fc, 63940, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 63940); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.iod_atmo, 170) << "incorrect value for header.iod_atmo, expected 170, is " << last_msg_->header.iod_atmo; - EXPECT_EQ(last_msg_->header.num_msgs, 48535) << "incorrect value for header.num_msgs, expected 48535, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.seq_num, 50380) << "incorrect value for header.seq_num, expected 50380, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->header.tile_id, 12951) << "incorrect value for header.tile_id, expected 12951, is " << last_msg_->header.tile_id; - EXPECT_EQ(last_msg_->header.tile_set_id, 3605) << "incorrect value for header.tile_set_id, expected 3605, is " << last_msg_->header.tile_set_id; - EXPECT_EQ(last_msg_->header.time.tow, 2535294328) << "incorrect value for header.time.tow, expected 2535294328, is " << last_msg_->header.time.tow; - EXPECT_EQ(last_msg_->header.time.wn, 58798) << "incorrect value for header.time.wn, expected 58798, is " << last_msg_->header.time.wn; - EXPECT_EQ(last_msg_->header.tropo_quality_indicator, 120) << "incorrect value for header.tropo_quality_indicator, expected 120, is " << last_msg_->header.tropo_quality_indicator; - EXPECT_EQ(last_msg_->header.update_interval, 105) << "incorrect value for header.update_interval, expected 105, is " << last_msg_->header.update_interval; - EXPECT_EQ(last_msg_->index, 43413) << "incorrect value for index, expected 43413, is " << last_msg_->index; - EXPECT_EQ(last_msg_->stec_residuals[0].residual, -21246) << "incorrect value for stec_residuals[0].residual, expected -21246, is " << last_msg_->stec_residuals[0].residual; - EXPECT_EQ(last_msg_->stec_residuals[0].stddev, 88) << "incorrect value for stec_residuals[0].stddev, expected 88, is " << last_msg_->stec_residuals[0].stddev; - EXPECT_EQ(last_msg_->stec_residuals[0].sv_id.constellation, 101) << "incorrect value for stec_residuals[0].sv_id.constellation, expected 101, is " << last_msg_->stec_residuals[0].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[0].sv_id.satId, 140) << "incorrect value for stec_residuals[0].sv_id.satId, expected 140, is " << last_msg_->stec_residuals[0].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[1].residual, -26570) << "incorrect value for stec_residuals[1].residual, expected -26570, is " << last_msg_->stec_residuals[1].residual; - EXPECT_EQ(last_msg_->stec_residuals[1].stddev, 115) << "incorrect value for stec_residuals[1].stddev, expected 115, is " << last_msg_->stec_residuals[1].stddev; - EXPECT_EQ(last_msg_->stec_residuals[1].sv_id.constellation, 180) << "incorrect value for stec_residuals[1].sv_id.constellation, expected 180, is " << last_msg_->stec_residuals[1].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[1].sv_id.satId, 70) << "incorrect value for stec_residuals[1].sv_id.satId, expected 70, is " << last_msg_->stec_residuals[1].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[2].residual, 6049) << "incorrect value for stec_residuals[2].residual, expected 6049, is " << last_msg_->stec_residuals[2].residual; - EXPECT_EQ(last_msg_->stec_residuals[2].stddev, 135) << "incorrect value for stec_residuals[2].stddev, expected 135, is " << last_msg_->stec_residuals[2].stddev; - EXPECT_EQ(last_msg_->stec_residuals[2].sv_id.constellation, 201) << "incorrect value for stec_residuals[2].sv_id.constellation, expected 201, is " << last_msg_->stec_residuals[2].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[2].sv_id.satId, 78) << "incorrect value for stec_residuals[2].sv_id.satId, expected 78, is " << last_msg_->stec_residuals[2].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[3].residual, 19261) << "incorrect value for stec_residuals[3].residual, expected 19261, is " << last_msg_->stec_residuals[3].residual; - EXPECT_EQ(last_msg_->stec_residuals[3].stddev, 178) << "incorrect value for stec_residuals[3].stddev, expected 178, is " << last_msg_->stec_residuals[3].stddev; - EXPECT_EQ(last_msg_->stec_residuals[3].sv_id.constellation, 98) << "incorrect value for stec_residuals[3].sv_id.constellation, expected 98, is " << last_msg_->stec_residuals[3].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[3].sv_id.satId, 152) << "incorrect value for stec_residuals[3].sv_id.satId, expected 152, is " << last_msg_->stec_residuals[3].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[4].residual, 14226) << "incorrect value for stec_residuals[4].residual, expected 14226, is " << last_msg_->stec_residuals[4].residual; - EXPECT_EQ(last_msg_->stec_residuals[4].stddev, 58) << "incorrect value for stec_residuals[4].stddev, expected 58, is " << last_msg_->stec_residuals[4].stddev; - EXPECT_EQ(last_msg_->stec_residuals[4].sv_id.constellation, 229) << "incorrect value for stec_residuals[4].sv_id.constellation, expected 229, is " << last_msg_->stec_residuals[4].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[4].sv_id.satId, 120) << "incorrect value for stec_residuals[4].sv_id.satId, expected 120, is " << last_msg_->stec_residuals[4].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[5].residual, 17894) << "incorrect value for stec_residuals[5].residual, expected 17894, is " << last_msg_->stec_residuals[5].residual; - EXPECT_EQ(last_msg_->stec_residuals[5].stddev, 172) << "incorrect value for stec_residuals[5].stddev, expected 172, is " << last_msg_->stec_residuals[5].stddev; - EXPECT_EQ(last_msg_->stec_residuals[5].sv_id.constellation, 234) << "incorrect value for stec_residuals[5].sv_id.constellation, expected 234, is " << last_msg_->stec_residuals[5].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[5].sv_id.satId, 169) << "incorrect value for stec_residuals[5].sv_id.satId, expected 169, is " << last_msg_->stec_residuals[5].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[6].residual, 22930) << "incorrect value for stec_residuals[6].residual, expected 22930, is " << last_msg_->stec_residuals[6].residual; - EXPECT_EQ(last_msg_->stec_residuals[6].stddev, 150) << "incorrect value for stec_residuals[6].stddev, expected 150, is " << last_msg_->stec_residuals[6].stddev; - EXPECT_EQ(last_msg_->stec_residuals[6].sv_id.constellation, 127) << "incorrect value for stec_residuals[6].sv_id.constellation, expected 127, is " << last_msg_->stec_residuals[6].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[6].sv_id.satId, 191) << "incorrect value for stec_residuals[6].sv_id.satId, expected 191, is " << last_msg_->stec_residuals[6].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[7].residual, 10721) << "incorrect value for stec_residuals[7].residual, expected 10721, is " << last_msg_->stec_residuals[7].residual; - EXPECT_EQ(last_msg_->stec_residuals[7].stddev, 17) << "incorrect value for stec_residuals[7].stddev, expected 17, is " << last_msg_->stec_residuals[7].stddev; - EXPECT_EQ(last_msg_->stec_residuals[7].sv_id.constellation, 111) << "incorrect value for stec_residuals[7].sv_id.constellation, expected 111, is " << last_msg_->stec_residuals[7].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[7].sv_id.satId, 91) << "incorrect value for stec_residuals[7].sv_id.satId, expected 91, is " << last_msg_->stec_residuals[7].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[8].residual, -22874) << "incorrect value for stec_residuals[8].residual, expected -22874, is " << last_msg_->stec_residuals[8].residual; - EXPECT_EQ(last_msg_->stec_residuals[8].stddev, 120) << "incorrect value for stec_residuals[8].stddev, expected 120, is " << last_msg_->stec_residuals[8].stddev; - EXPECT_EQ(last_msg_->stec_residuals[8].sv_id.constellation, 52) << "incorrect value for stec_residuals[8].sv_id.constellation, expected 52, is " << last_msg_->stec_residuals[8].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[8].sv_id.satId, 119) << "incorrect value for stec_residuals[8].sv_id.satId, expected 119, is " << last_msg_->stec_residuals[8].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[9].residual, 780) << "incorrect value for stec_residuals[9].residual, expected 780, is " << last_msg_->stec_residuals[9].residual; - EXPECT_EQ(last_msg_->stec_residuals[9].stddev, 156) << "incorrect value for stec_residuals[9].stddev, expected 156, is " << last_msg_->stec_residuals[9].stddev; - EXPECT_EQ(last_msg_->stec_residuals[9].sv_id.constellation, 221) << "incorrect value for stec_residuals[9].sv_id.constellation, expected 221, is " << last_msg_->stec_residuals[9].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[9].sv_id.satId, 57) << "incorrect value for stec_residuals[9].sv_id.satId, expected 57, is " << last_msg_->stec_residuals[9].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[10].residual, 32547) << "incorrect value for stec_residuals[10].residual, expected 32547, is " << last_msg_->stec_residuals[10].residual; - EXPECT_EQ(last_msg_->stec_residuals[10].stddev, 8) << "incorrect value for stec_residuals[10].stddev, expected 8, is " << last_msg_->stec_residuals[10].stddev; - EXPECT_EQ(last_msg_->stec_residuals[10].sv_id.constellation, 156) << "incorrect value for stec_residuals[10].sv_id.constellation, expected 156, is " << last_msg_->stec_residuals[10].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[10].sv_id.satId, 70) << "incorrect value for stec_residuals[10].sv_id.satId, expected 70, is " << last_msg_->stec_residuals[10].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[11].residual, 14208) << "incorrect value for stec_residuals[11].residual, expected 14208, is " << last_msg_->stec_residuals[11].residual; - EXPECT_EQ(last_msg_->stec_residuals[11].stddev, 115) << "incorrect value for stec_residuals[11].stddev, expected 115, is " << last_msg_->stec_residuals[11].stddev; - EXPECT_EQ(last_msg_->stec_residuals[11].sv_id.constellation, 58) << "incorrect value for stec_residuals[11].sv_id.constellation, expected 58, is " << last_msg_->stec_residuals[11].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[11].sv_id.satId, 127) << "incorrect value for stec_residuals[11].sv_id.satId, expected 127, is " << last_msg_->stec_residuals[11].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[12].residual, -26246) << "incorrect value for stec_residuals[12].residual, expected -26246, is " << last_msg_->stec_residuals[12].residual; - EXPECT_EQ(last_msg_->stec_residuals[12].stddev, 124) << "incorrect value for stec_residuals[12].stddev, expected 124, is " << last_msg_->stec_residuals[12].stddev; - EXPECT_EQ(last_msg_->stec_residuals[12].sv_id.constellation, 157) << "incorrect value for stec_residuals[12].sv_id.constellation, expected 157, is " << last_msg_->stec_residuals[12].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[12].sv_id.satId, 80) << "incorrect value for stec_residuals[12].sv_id.satId, expected 80, is " << last_msg_->stec_residuals[12].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[13].residual, 26466) << "incorrect value for stec_residuals[13].residual, expected 26466, is " << last_msg_->stec_residuals[13].residual; - EXPECT_EQ(last_msg_->stec_residuals[13].stddev, 204) << "incorrect value for stec_residuals[13].stddev, expected 204, is " << last_msg_->stec_residuals[13].stddev; - EXPECT_EQ(last_msg_->stec_residuals[13].sv_id.constellation, 128) << "incorrect value for stec_residuals[13].sv_id.constellation, expected 128, is " << last_msg_->stec_residuals[13].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[13].sv_id.satId, 27) << "incorrect value for stec_residuals[13].sv_id.satId, expected 27, is " << last_msg_->stec_residuals[13].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[14].residual, -7552) << "incorrect value for stec_residuals[14].residual, expected -7552, is " << last_msg_->stec_residuals[14].residual; - EXPECT_EQ(last_msg_->stec_residuals[14].stddev, 148) << "incorrect value for stec_residuals[14].stddev, expected 148, is " << last_msg_->stec_residuals[14].stddev; - EXPECT_EQ(last_msg_->stec_residuals[14].sv_id.constellation, 238) << "incorrect value for stec_residuals[14].sv_id.constellation, expected 238, is " << last_msg_->stec_residuals[14].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[14].sv_id.satId, 75) << "incorrect value for stec_residuals[14].sv_id.satId, expected 75, is " << last_msg_->stec_residuals[14].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[15].residual, -12072) << "incorrect value for stec_residuals[15].residual, expected -12072, is " << last_msg_->stec_residuals[15].residual; - EXPECT_EQ(last_msg_->stec_residuals[15].stddev, 149) << "incorrect value for stec_residuals[15].stddev, expected 149, is " << last_msg_->stec_residuals[15].stddev; - EXPECT_EQ(last_msg_->stec_residuals[15].sv_id.constellation, 61) << "incorrect value for stec_residuals[15].sv_id.constellation, expected 61, is " << last_msg_->stec_residuals[15].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[15].sv_id.satId, 248) << "incorrect value for stec_residuals[15].sv_id.satId, expected 248, is " << last_msg_->stec_residuals[15].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[16].residual, -28632) << "incorrect value for stec_residuals[16].residual, expected -28632, is " << last_msg_->stec_residuals[16].residual; - EXPECT_EQ(last_msg_->stec_residuals[16].stddev, 186) << "incorrect value for stec_residuals[16].stddev, expected 186, is " << last_msg_->stec_residuals[16].stddev; - EXPECT_EQ(last_msg_->stec_residuals[16].sv_id.constellation, 224) << "incorrect value for stec_residuals[16].sv_id.constellation, expected 224, is " << last_msg_->stec_residuals[16].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[16].sv_id.satId, 167) << "incorrect value for stec_residuals[16].sv_id.satId, expected 167, is " << last_msg_->stec_residuals[16].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[17].residual, -4024) << "incorrect value for stec_residuals[17].residual, expected -4024, is " << last_msg_->stec_residuals[17].residual; - EXPECT_EQ(last_msg_->stec_residuals[17].stddev, 100) << "incorrect value for stec_residuals[17].stddev, expected 100, is " << last_msg_->stec_residuals[17].stddev; - EXPECT_EQ(last_msg_->stec_residuals[17].sv_id.constellation, 227) << "incorrect value for stec_residuals[17].sv_id.constellation, expected 227, is " << last_msg_->stec_residuals[17].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[17].sv_id.satId, 157) << "incorrect value for stec_residuals[17].sv_id.satId, expected 157, is " << last_msg_->stec_residuals[17].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[18].residual, 2004) << "incorrect value for stec_residuals[18].residual, expected 2004, is " << last_msg_->stec_residuals[18].residual; - EXPECT_EQ(last_msg_->stec_residuals[18].stddev, 59) << "incorrect value for stec_residuals[18].stddev, expected 59, is " << last_msg_->stec_residuals[18].stddev; - EXPECT_EQ(last_msg_->stec_residuals[18].sv_id.constellation, 12) << "incorrect value for stec_residuals[18].sv_id.constellation, expected 12, is " << last_msg_->stec_residuals[18].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[18].sv_id.satId, 35) << "incorrect value for stec_residuals[18].sv_id.satId, expected 35, is " << last_msg_->stec_residuals[18].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[19].residual, 6998) << "incorrect value for stec_residuals[19].residual, expected 6998, is " << last_msg_->stec_residuals[19].residual; - EXPECT_EQ(last_msg_->stec_residuals[19].stddev, 24) << "incorrect value for stec_residuals[19].stddev, expected 24, is " << last_msg_->stec_residuals[19].stddev; - EXPECT_EQ(last_msg_->stec_residuals[19].sv_id.constellation, 81) << "incorrect value for stec_residuals[19].sv_id.constellation, expected 81, is " << last_msg_->stec_residuals[19].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[19].sv_id.satId, 176) << "incorrect value for stec_residuals[19].sv_id.satId, expected 176, is " << last_msg_->stec_residuals[19].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[20].residual, -31701) << "incorrect value for stec_residuals[20].residual, expected -31701, is " << last_msg_->stec_residuals[20].residual; - EXPECT_EQ(last_msg_->stec_residuals[20].stddev, 45) << "incorrect value for stec_residuals[20].stddev, expected 45, is " << last_msg_->stec_residuals[20].stddev; - EXPECT_EQ(last_msg_->stec_residuals[20].sv_id.constellation, 67) << "incorrect value for stec_residuals[20].sv_id.constellation, expected 67, is " << last_msg_->stec_residuals[20].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[20].sv_id.satId, 155) << "incorrect value for stec_residuals[20].sv_id.satId, expected 155, is " << last_msg_->stec_residuals[20].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[21].residual, 28678) << "incorrect value for stec_residuals[21].residual, expected 28678, is " << last_msg_->stec_residuals[21].residual; - EXPECT_EQ(last_msg_->stec_residuals[21].stddev, 183) << "incorrect value for stec_residuals[21].stddev, expected 183, is " << last_msg_->stec_residuals[21].stddev; - EXPECT_EQ(last_msg_->stec_residuals[21].sv_id.constellation, 44) << "incorrect value for stec_residuals[21].sv_id.constellation, expected 44, is " << last_msg_->stec_residuals[21].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[21].sv_id.satId, 203) << "incorrect value for stec_residuals[21].sv_id.satId, expected 203, is " << last_msg_->stec_residuals[21].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[22].residual, -15793) << "incorrect value for stec_residuals[22].residual, expected -15793, is " << last_msg_->stec_residuals[22].residual; - EXPECT_EQ(last_msg_->stec_residuals[22].stddev, 253) << "incorrect value for stec_residuals[22].stddev, expected 253, is " << last_msg_->stec_residuals[22].stddev; - EXPECT_EQ(last_msg_->stec_residuals[22].sv_id.constellation, 176) << "incorrect value for stec_residuals[22].sv_id.constellation, expected 176, is " << last_msg_->stec_residuals[22].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[22].sv_id.satId, 231) << "incorrect value for stec_residuals[22].sv_id.satId, expected 231, is " << last_msg_->stec_residuals[22].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[23].residual, -7589) << "incorrect value for stec_residuals[23].residual, expected -7589, is " << last_msg_->stec_residuals[23].residual; - EXPECT_EQ(last_msg_->stec_residuals[23].stddev, 116) << "incorrect value for stec_residuals[23].stddev, expected 116, is " << last_msg_->stec_residuals[23].stddev; - EXPECT_EQ(last_msg_->stec_residuals[23].sv_id.constellation, 103) << "incorrect value for stec_residuals[23].sv_id.constellation, expected 103, is " << last_msg_->stec_residuals[23].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[23].sv_id.satId, 247) << "incorrect value for stec_residuals[23].sv_id.satId, expected 247, is " << last_msg_->stec_residuals[23].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[24].residual, -7362) << "incorrect value for stec_residuals[24].residual, expected -7362, is " << last_msg_->stec_residuals[24].residual; - EXPECT_EQ(last_msg_->stec_residuals[24].stddev, 240) << "incorrect value for stec_residuals[24].stddev, expected 240, is " << last_msg_->stec_residuals[24].stddev; - EXPECT_EQ(last_msg_->stec_residuals[24].sv_id.constellation, 23) << "incorrect value for stec_residuals[24].sv_id.constellation, expected 23, is " << last_msg_->stec_residuals[24].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[24].sv_id.satId, 148) << "incorrect value for stec_residuals[24].sv_id.satId, expected 148, is " << last_msg_->stec_residuals[24].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[25].residual, 4813) << "incorrect value for stec_residuals[25].residual, expected 4813, is " << last_msg_->stec_residuals[25].residual; - EXPECT_EQ(last_msg_->stec_residuals[25].stddev, 242) << "incorrect value for stec_residuals[25].stddev, expected 242, is " << last_msg_->stec_residuals[25].stddev; - EXPECT_EQ(last_msg_->stec_residuals[25].sv_id.constellation, 219) << "incorrect value for stec_residuals[25].sv_id.constellation, expected 219, is " << last_msg_->stec_residuals[25].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[25].sv_id.satId, 29) << "incorrect value for stec_residuals[25].sv_id.satId, expected 29, is " << last_msg_->stec_residuals[25].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[26].residual, 20295) << "incorrect value for stec_residuals[26].residual, expected 20295, is " << last_msg_->stec_residuals[26].residual; - EXPECT_EQ(last_msg_->stec_residuals[26].stddev, 37) << "incorrect value for stec_residuals[26].stddev, expected 37, is " << last_msg_->stec_residuals[26].stddev; - EXPECT_EQ(last_msg_->stec_residuals[26].sv_id.constellation, 72) << "incorrect value for stec_residuals[26].sv_id.constellation, expected 72, is " << last_msg_->stec_residuals[26].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[26].sv_id.satId, 207) << "incorrect value for stec_residuals[26].sv_id.satId, expected 207, is " << last_msg_->stec_residuals[26].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[27].residual, -13623) << "incorrect value for stec_residuals[27].residual, expected -13623, is " << last_msg_->stec_residuals[27].residual; - EXPECT_EQ(last_msg_->stec_residuals[27].stddev, 91) << "incorrect value for stec_residuals[27].stddev, expected 91, is " << last_msg_->stec_residuals[27].stddev; - EXPECT_EQ(last_msg_->stec_residuals[27].sv_id.constellation, 176) << "incorrect value for stec_residuals[27].sv_id.constellation, expected 176, is " << last_msg_->stec_residuals[27].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[27].sv_id.satId, 42) << "incorrect value for stec_residuals[27].sv_id.satId, expected 42, is " << last_msg_->stec_residuals[27].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[28].residual, 15250) << "incorrect value for stec_residuals[28].residual, expected 15250, is " << last_msg_->stec_residuals[28].residual; - EXPECT_EQ(last_msg_->stec_residuals[28].stddev, 110) << "incorrect value for stec_residuals[28].stddev, expected 110, is " << last_msg_->stec_residuals[28].stddev; - EXPECT_EQ(last_msg_->stec_residuals[28].sv_id.constellation, 115) << "incorrect value for stec_residuals[28].sv_id.constellation, expected 115, is " << last_msg_->stec_residuals[28].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[28].sv_id.satId, 105) << "incorrect value for stec_residuals[28].sv_id.satId, expected 105, is " << last_msg_->stec_residuals[28].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[29].residual, -18560) << "incorrect value for stec_residuals[29].residual, expected -18560, is " << last_msg_->stec_residuals[29].residual; - EXPECT_EQ(last_msg_->stec_residuals[29].stddev, 185) << "incorrect value for stec_residuals[29].stddev, expected 185, is " << last_msg_->stec_residuals[29].stddev; - EXPECT_EQ(last_msg_->stec_residuals[29].sv_id.constellation, 109) << "incorrect value for stec_residuals[29].sv_id.constellation, expected 109, is " << last_msg_->stec_residuals[29].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[29].sv_id.satId, 44) << "incorrect value for stec_residuals[29].sv_id.satId, expected 44, is " << last_msg_->stec_residuals[29].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[30].residual, 23717) << "incorrect value for stec_residuals[30].residual, expected 23717, is " << last_msg_->stec_residuals[30].residual; - EXPECT_EQ(last_msg_->stec_residuals[30].stddev, 79) << "incorrect value for stec_residuals[30].stddev, expected 79, is " << last_msg_->stec_residuals[30].stddev; - EXPECT_EQ(last_msg_->stec_residuals[30].sv_id.constellation, 31) << "incorrect value for stec_residuals[30].sv_id.constellation, expected 31, is " << last_msg_->stec_residuals[30].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[30].sv_id.satId, 67) << "incorrect value for stec_residuals[30].sv_id.satId, expected 67, is " << last_msg_->stec_residuals[30].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[31].residual, 1886) << "incorrect value for stec_residuals[31].residual, expected 1886, is " << last_msg_->stec_residuals[31].residual; - EXPECT_EQ(last_msg_->stec_residuals[31].stddev, 162) << "incorrect value for stec_residuals[31].stddev, expected 162, is " << last_msg_->stec_residuals[31].stddev; - EXPECT_EQ(last_msg_->stec_residuals[31].sv_id.constellation, 180) << "incorrect value for stec_residuals[31].sv_id.constellation, expected 180, is " << last_msg_->stec_residuals[31].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[31].sv_id.satId, 189) << "incorrect value for stec_residuals[31].sv_id.satId, expected 189, is " << last_msg_->stec_residuals[31].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[32].residual, 12242) << "incorrect value for stec_residuals[32].residual, expected 12242, is " << last_msg_->stec_residuals[32].residual; - EXPECT_EQ(last_msg_->stec_residuals[32].stddev, 7) << "incorrect value for stec_residuals[32].stddev, expected 7, is " << last_msg_->stec_residuals[32].stddev; - EXPECT_EQ(last_msg_->stec_residuals[32].sv_id.constellation, 156) << "incorrect value for stec_residuals[32].sv_id.constellation, expected 156, is " << last_msg_->stec_residuals[32].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[32].sv_id.satId, 121) << "incorrect value for stec_residuals[32].sv_id.satId, expected 121, is " << last_msg_->stec_residuals[32].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[33].residual, 10670) << "incorrect value for stec_residuals[33].residual, expected 10670, is " << last_msg_->stec_residuals[33].residual; - EXPECT_EQ(last_msg_->stec_residuals[33].stddev, 241) << "incorrect value for stec_residuals[33].stddev, expected 241, is " << last_msg_->stec_residuals[33].stddev; - EXPECT_EQ(last_msg_->stec_residuals[33].sv_id.constellation, 205) << "incorrect value for stec_residuals[33].sv_id.constellation, expected 205, is " << last_msg_->stec_residuals[33].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[33].sv_id.satId, 7) << "incorrect value for stec_residuals[33].sv_id.satId, expected 7, is " << last_msg_->stec_residuals[33].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[34].residual, 25899) << "incorrect value for stec_residuals[34].residual, expected 25899, is " << last_msg_->stec_residuals[34].residual; - EXPECT_EQ(last_msg_->stec_residuals[34].stddev, 186) << "incorrect value for stec_residuals[34].stddev, expected 186, is " << last_msg_->stec_residuals[34].stddev; - EXPECT_EQ(last_msg_->stec_residuals[34].sv_id.constellation, 210) << "incorrect value for stec_residuals[34].sv_id.constellation, expected 210, is " << last_msg_->stec_residuals[34].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[34].sv_id.satId, 129) << "incorrect value for stec_residuals[34].sv_id.satId, expected 129, is " << last_msg_->stec_residuals[34].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[35].residual, -2078) << "incorrect value for stec_residuals[35].residual, expected -2078, is " << last_msg_->stec_residuals[35].residual; - EXPECT_EQ(last_msg_->stec_residuals[35].stddev, 187) << "incorrect value for stec_residuals[35].stddev, expected 187, is " << last_msg_->stec_residuals[35].stddev; - EXPECT_EQ(last_msg_->stec_residuals[35].sv_id.constellation, 195) << "incorrect value for stec_residuals[35].sv_id.constellation, expected 195, is " << last_msg_->stec_residuals[35].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[35].sv_id.satId, 208) << "incorrect value for stec_residuals[35].sv_id.satId, expected 208, is " << last_msg_->stec_residuals[35].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[36].residual, -16264) << "incorrect value for stec_residuals[36].residual, expected -16264, is " << last_msg_->stec_residuals[36].residual; - EXPECT_EQ(last_msg_->stec_residuals[36].stddev, 102) << "incorrect value for stec_residuals[36].stddev, expected 102, is " << last_msg_->stec_residuals[36].stddev; - EXPECT_EQ(last_msg_->stec_residuals[36].sv_id.constellation, 160) << "incorrect value for stec_residuals[36].sv_id.constellation, expected 160, is " << last_msg_->stec_residuals[36].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[36].sv_id.satId, 219) << "incorrect value for stec_residuals[36].sv_id.satId, expected 219, is " << last_msg_->stec_residuals[36].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[37].residual, -21002) << "incorrect value for stec_residuals[37].residual, expected -21002, is " << last_msg_->stec_residuals[37].residual; - EXPECT_EQ(last_msg_->stec_residuals[37].stddev, 94) << "incorrect value for stec_residuals[37].stddev, expected 94, is " << last_msg_->stec_residuals[37].stddev; - EXPECT_EQ(last_msg_->stec_residuals[37].sv_id.constellation, 42) << "incorrect value for stec_residuals[37].sv_id.constellation, expected 42, is " << last_msg_->stec_residuals[37].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[37].sv_id.satId, 166) << "incorrect value for stec_residuals[37].sv_id.satId, expected 166, is " << last_msg_->stec_residuals[37].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[38].residual, 7902) << "incorrect value for stec_residuals[38].residual, expected 7902, is " << last_msg_->stec_residuals[38].residual; - EXPECT_EQ(last_msg_->stec_residuals[38].stddev, 35) << "incorrect value for stec_residuals[38].stddev, expected 35, is " << last_msg_->stec_residuals[38].stddev; - EXPECT_EQ(last_msg_->stec_residuals[38].sv_id.constellation, 156) << "incorrect value for stec_residuals[38].sv_id.constellation, expected 156, is " << last_msg_->stec_residuals[38].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[38].sv_id.satId, 102) << "incorrect value for stec_residuals[38].sv_id.satId, expected 102, is " << last_msg_->stec_residuals[38].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[39].residual, -30275) << "incorrect value for stec_residuals[39].residual, expected -30275, is " << last_msg_->stec_residuals[39].residual; - EXPECT_EQ(last_msg_->stec_residuals[39].stddev, 204) << "incorrect value for stec_residuals[39].stddev, expected 204, is " << last_msg_->stec_residuals[39].stddev; - EXPECT_EQ(last_msg_->stec_residuals[39].sv_id.constellation, 64) << "incorrect value for stec_residuals[39].sv_id.constellation, expected 64, is " << last_msg_->stec_residuals[39].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[39].sv_id.satId, 247) << "incorrect value for stec_residuals[39].sv_id.satId, expected 247, is " << last_msg_->stec_residuals[39].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[40].residual, -8633) << "incorrect value for stec_residuals[40].residual, expected -8633, is " << last_msg_->stec_residuals[40].residual; - EXPECT_EQ(last_msg_->stec_residuals[40].stddev, 222) << "incorrect value for stec_residuals[40].stddev, expected 222, is " << last_msg_->stec_residuals[40].stddev; - EXPECT_EQ(last_msg_->stec_residuals[40].sv_id.constellation, 32) << "incorrect value for stec_residuals[40].sv_id.constellation, expected 32, is " << last_msg_->stec_residuals[40].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[40].sv_id.satId, 220) << "incorrect value for stec_residuals[40].sv_id.satId, expected 220, is " << last_msg_->stec_residuals[40].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[41].residual, 6403) << "incorrect value for stec_residuals[41].residual, expected 6403, is " << last_msg_->stec_residuals[41].residual; - EXPECT_EQ(last_msg_->stec_residuals[41].stddev, 45) << "incorrect value for stec_residuals[41].stddev, expected 45, is " << last_msg_->stec_residuals[41].stddev; - EXPECT_EQ(last_msg_->stec_residuals[41].sv_id.constellation, 246) << "incorrect value for stec_residuals[41].sv_id.constellation, expected 246, is " << last_msg_->stec_residuals[41].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[41].sv_id.satId, 201) << "incorrect value for stec_residuals[41].sv_id.satId, expected 201, is " << last_msg_->stec_residuals[41].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[42].residual, 22643) << "incorrect value for stec_residuals[42].residual, expected 22643, is " << last_msg_->stec_residuals[42].residual; - EXPECT_EQ(last_msg_->stec_residuals[42].stddev, 218) << "incorrect value for stec_residuals[42].stddev, expected 218, is " << last_msg_->stec_residuals[42].stddev; - EXPECT_EQ(last_msg_->stec_residuals[42].sv_id.constellation, 239) << "incorrect value for stec_residuals[42].sv_id.constellation, expected 239, is " << last_msg_->stec_residuals[42].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[42].sv_id.satId, 251) << "incorrect value for stec_residuals[42].sv_id.satId, expected 251, is " << last_msg_->stec_residuals[42].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[43].residual, 16760) << "incorrect value for stec_residuals[43].residual, expected 16760, is " << last_msg_->stec_residuals[43].residual; - EXPECT_EQ(last_msg_->stec_residuals[43].stddev, 175) << "incorrect value for stec_residuals[43].stddev, expected 175, is " << last_msg_->stec_residuals[43].stddev; - EXPECT_EQ(last_msg_->stec_residuals[43].sv_id.constellation, 209) << "incorrect value for stec_residuals[43].sv_id.constellation, expected 209, is " << last_msg_->stec_residuals[43].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[43].sv_id.satId, 10) << "incorrect value for stec_residuals[43].sv_id.satId, expected 10, is " << last_msg_->stec_residuals[43].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[44].residual, -20951) << "incorrect value for stec_residuals[44].residual, expected -20951, is " << last_msg_->stec_residuals[44].residual; - EXPECT_EQ(last_msg_->stec_residuals[44].stddev, 137) << "incorrect value for stec_residuals[44].stddev, expected 137, is " << last_msg_->stec_residuals[44].stddev; - EXPECT_EQ(last_msg_->stec_residuals[44].sv_id.constellation, 194) << "incorrect value for stec_residuals[44].sv_id.constellation, expected 194, is " << last_msg_->stec_residuals[44].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[44].sv_id.satId, 131) << "incorrect value for stec_residuals[44].sv_id.satId, expected 131, is " << last_msg_->stec_residuals[44].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[45].residual, -740) << "incorrect value for stec_residuals[45].residual, expected -740, is " << last_msg_->stec_residuals[45].residual; - EXPECT_EQ(last_msg_->stec_residuals[45].stddev, 42) << "incorrect value for stec_residuals[45].stddev, expected 42, is " << last_msg_->stec_residuals[45].stddev; - EXPECT_EQ(last_msg_->stec_residuals[45].sv_id.constellation, 68) << "incorrect value for stec_residuals[45].sv_id.constellation, expected 68, is " << last_msg_->stec_residuals[45].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[45].sv_id.satId, 17) << "incorrect value for stec_residuals[45].sv_id.satId, expected 17, is " << last_msg_->stec_residuals[45].sv_id.satId; - EXPECT_EQ(last_msg_->tropo_delay_correction.hydro, -3035) << "incorrect value for tropo_delay_correction.hydro, expected -3035, is " << last_msg_->tropo_delay_correction.hydro; - EXPECT_EQ(last_msg_->tropo_delay_correction.stddev, 72) << "incorrect value for tropo_delay_correction.stddev, expected 72, is " << last_msg_->tropo_delay_correction.stddev; - EXPECT_EQ(last_msg_->tropo_delay_correction.wet, 78) << "incorrect value for tropo_delay_correction.wet, expected 78, is " << last_msg_->tropo_delay_correction.wet; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 63940); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.iod_atmo, 170) + << "incorrect value for header.iod_atmo, expected 170, is " + << last_msg_->header.iod_atmo; + EXPECT_EQ(last_msg_->header.num_msgs, 48535) + << "incorrect value for header.num_msgs, expected 48535, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.seq_num, 50380) + << "incorrect value for header.seq_num, expected 50380, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->header.tile_id, 12951) + << "incorrect value for header.tile_id, expected 12951, is " + << last_msg_->header.tile_id; + EXPECT_EQ(last_msg_->header.tile_set_id, 3605) + << "incorrect value for header.tile_set_id, expected 3605, is " + << last_msg_->header.tile_set_id; + EXPECT_EQ(last_msg_->header.time.tow, 2535294328) + << "incorrect value for header.time.tow, expected 2535294328, is " + << last_msg_->header.time.tow; + EXPECT_EQ(last_msg_->header.time.wn, 58798) + << "incorrect value for header.time.wn, expected 58798, is " + << last_msg_->header.time.wn; + EXPECT_EQ(last_msg_->header.tropo_quality_indicator, 120) + << "incorrect value for header.tropo_quality_indicator, expected 120, is " + << last_msg_->header.tropo_quality_indicator; + EXPECT_EQ(last_msg_->header.update_interval, 105) + << "incorrect value for header.update_interval, expected 105, is " + << last_msg_->header.update_interval; + EXPECT_EQ(last_msg_->index, 43413) + << "incorrect value for index, expected 43413, is " << last_msg_->index; + EXPECT_EQ(last_msg_->stec_residuals[0].residual, -21246) + << "incorrect value for stec_residuals[0].residual, expected -21246, is " + << last_msg_->stec_residuals[0].residual; + EXPECT_EQ(last_msg_->stec_residuals[0].stddev, 88) + << "incorrect value for stec_residuals[0].stddev, expected 88, is " + << last_msg_->stec_residuals[0].stddev; + EXPECT_EQ(last_msg_->stec_residuals[0].sv_id.constellation, 101) + << "incorrect value for stec_residuals[0].sv_id.constellation, expected " + "101, is " + << last_msg_->stec_residuals[0].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[0].sv_id.satId, 140) + << "incorrect value for stec_residuals[0].sv_id.satId, expected 140, is " + << last_msg_->stec_residuals[0].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[1].residual, -26570) + << "incorrect value for stec_residuals[1].residual, expected -26570, is " + << last_msg_->stec_residuals[1].residual; + EXPECT_EQ(last_msg_->stec_residuals[1].stddev, 115) + << "incorrect value for stec_residuals[1].stddev, expected 115, is " + << last_msg_->stec_residuals[1].stddev; + EXPECT_EQ(last_msg_->stec_residuals[1].sv_id.constellation, 180) + << "incorrect value for stec_residuals[1].sv_id.constellation, expected " + "180, is " + << last_msg_->stec_residuals[1].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[1].sv_id.satId, 70) + << "incorrect value for stec_residuals[1].sv_id.satId, expected 70, is " + << last_msg_->stec_residuals[1].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[2].residual, 6049) + << "incorrect value for stec_residuals[2].residual, expected 6049, is " + << last_msg_->stec_residuals[2].residual; + EXPECT_EQ(last_msg_->stec_residuals[2].stddev, 135) + << "incorrect value for stec_residuals[2].stddev, expected 135, is " + << last_msg_->stec_residuals[2].stddev; + EXPECT_EQ(last_msg_->stec_residuals[2].sv_id.constellation, 201) + << "incorrect value for stec_residuals[2].sv_id.constellation, expected " + "201, is " + << last_msg_->stec_residuals[2].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[2].sv_id.satId, 78) + << "incorrect value for stec_residuals[2].sv_id.satId, expected 78, is " + << last_msg_->stec_residuals[2].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[3].residual, 19261) + << "incorrect value for stec_residuals[3].residual, expected 19261, is " + << last_msg_->stec_residuals[3].residual; + EXPECT_EQ(last_msg_->stec_residuals[3].stddev, 178) + << "incorrect value for stec_residuals[3].stddev, expected 178, is " + << last_msg_->stec_residuals[3].stddev; + EXPECT_EQ(last_msg_->stec_residuals[3].sv_id.constellation, 98) + << "incorrect value for stec_residuals[3].sv_id.constellation, expected " + "98, is " + << last_msg_->stec_residuals[3].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[3].sv_id.satId, 152) + << "incorrect value for stec_residuals[3].sv_id.satId, expected 152, is " + << last_msg_->stec_residuals[3].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[4].residual, 14226) + << "incorrect value for stec_residuals[4].residual, expected 14226, is " + << last_msg_->stec_residuals[4].residual; + EXPECT_EQ(last_msg_->stec_residuals[4].stddev, 58) + << "incorrect value for stec_residuals[4].stddev, expected 58, is " + << last_msg_->stec_residuals[4].stddev; + EXPECT_EQ(last_msg_->stec_residuals[4].sv_id.constellation, 229) + << "incorrect value for stec_residuals[4].sv_id.constellation, expected " + "229, is " + << last_msg_->stec_residuals[4].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[4].sv_id.satId, 120) + << "incorrect value for stec_residuals[4].sv_id.satId, expected 120, is " + << last_msg_->stec_residuals[4].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[5].residual, 17894) + << "incorrect value for stec_residuals[5].residual, expected 17894, is " + << last_msg_->stec_residuals[5].residual; + EXPECT_EQ(last_msg_->stec_residuals[5].stddev, 172) + << "incorrect value for stec_residuals[5].stddev, expected 172, is " + << last_msg_->stec_residuals[5].stddev; + EXPECT_EQ(last_msg_->stec_residuals[5].sv_id.constellation, 234) + << "incorrect value for stec_residuals[5].sv_id.constellation, expected " + "234, is " + << last_msg_->stec_residuals[5].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[5].sv_id.satId, 169) + << "incorrect value for stec_residuals[5].sv_id.satId, expected 169, is " + << last_msg_->stec_residuals[5].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[6].residual, 22930) + << "incorrect value for stec_residuals[6].residual, expected 22930, is " + << last_msg_->stec_residuals[6].residual; + EXPECT_EQ(last_msg_->stec_residuals[6].stddev, 150) + << "incorrect value for stec_residuals[6].stddev, expected 150, is " + << last_msg_->stec_residuals[6].stddev; + EXPECT_EQ(last_msg_->stec_residuals[6].sv_id.constellation, 127) + << "incorrect value for stec_residuals[6].sv_id.constellation, expected " + "127, is " + << last_msg_->stec_residuals[6].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[6].sv_id.satId, 191) + << "incorrect value for stec_residuals[6].sv_id.satId, expected 191, is " + << last_msg_->stec_residuals[6].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[7].residual, 10721) + << "incorrect value for stec_residuals[7].residual, expected 10721, is " + << last_msg_->stec_residuals[7].residual; + EXPECT_EQ(last_msg_->stec_residuals[7].stddev, 17) + << "incorrect value for stec_residuals[7].stddev, expected 17, is " + << last_msg_->stec_residuals[7].stddev; + EXPECT_EQ(last_msg_->stec_residuals[7].sv_id.constellation, 111) + << "incorrect value for stec_residuals[7].sv_id.constellation, expected " + "111, is " + << last_msg_->stec_residuals[7].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[7].sv_id.satId, 91) + << "incorrect value for stec_residuals[7].sv_id.satId, expected 91, is " + << last_msg_->stec_residuals[7].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[8].residual, -22874) + << "incorrect value for stec_residuals[8].residual, expected -22874, is " + << last_msg_->stec_residuals[8].residual; + EXPECT_EQ(last_msg_->stec_residuals[8].stddev, 120) + << "incorrect value for stec_residuals[8].stddev, expected 120, is " + << last_msg_->stec_residuals[8].stddev; + EXPECT_EQ(last_msg_->stec_residuals[8].sv_id.constellation, 52) + << "incorrect value for stec_residuals[8].sv_id.constellation, expected " + "52, is " + << last_msg_->stec_residuals[8].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[8].sv_id.satId, 119) + << "incorrect value for stec_residuals[8].sv_id.satId, expected 119, is " + << last_msg_->stec_residuals[8].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[9].residual, 780) + << "incorrect value for stec_residuals[9].residual, expected 780, is " + << last_msg_->stec_residuals[9].residual; + EXPECT_EQ(last_msg_->stec_residuals[9].stddev, 156) + << "incorrect value for stec_residuals[9].stddev, expected 156, is " + << last_msg_->stec_residuals[9].stddev; + EXPECT_EQ(last_msg_->stec_residuals[9].sv_id.constellation, 221) + << "incorrect value for stec_residuals[9].sv_id.constellation, expected " + "221, is " + << last_msg_->stec_residuals[9].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[9].sv_id.satId, 57) + << "incorrect value for stec_residuals[9].sv_id.satId, expected 57, is " + << last_msg_->stec_residuals[9].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[10].residual, 32547) + << "incorrect value for stec_residuals[10].residual, expected 32547, is " + << last_msg_->stec_residuals[10].residual; + EXPECT_EQ(last_msg_->stec_residuals[10].stddev, 8) + << "incorrect value for stec_residuals[10].stddev, expected 8, is " + << last_msg_->stec_residuals[10].stddev; + EXPECT_EQ(last_msg_->stec_residuals[10].sv_id.constellation, 156) + << "incorrect value for stec_residuals[10].sv_id.constellation, expected " + "156, is " + << last_msg_->stec_residuals[10].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[10].sv_id.satId, 70) + << "incorrect value for stec_residuals[10].sv_id.satId, expected 70, is " + << last_msg_->stec_residuals[10].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[11].residual, 14208) + << "incorrect value for stec_residuals[11].residual, expected 14208, is " + << last_msg_->stec_residuals[11].residual; + EXPECT_EQ(last_msg_->stec_residuals[11].stddev, 115) + << "incorrect value for stec_residuals[11].stddev, expected 115, is " + << last_msg_->stec_residuals[11].stddev; + EXPECT_EQ(last_msg_->stec_residuals[11].sv_id.constellation, 58) + << "incorrect value for stec_residuals[11].sv_id.constellation, expected " + "58, is " + << last_msg_->stec_residuals[11].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[11].sv_id.satId, 127) + << "incorrect value for stec_residuals[11].sv_id.satId, expected 127, is " + << last_msg_->stec_residuals[11].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[12].residual, -26246) + << "incorrect value for stec_residuals[12].residual, expected -26246, is " + << last_msg_->stec_residuals[12].residual; + EXPECT_EQ(last_msg_->stec_residuals[12].stddev, 124) + << "incorrect value for stec_residuals[12].stddev, expected 124, is " + << last_msg_->stec_residuals[12].stddev; + EXPECT_EQ(last_msg_->stec_residuals[12].sv_id.constellation, 157) + << "incorrect value for stec_residuals[12].sv_id.constellation, expected " + "157, is " + << last_msg_->stec_residuals[12].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[12].sv_id.satId, 80) + << "incorrect value for stec_residuals[12].sv_id.satId, expected 80, is " + << last_msg_->stec_residuals[12].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[13].residual, 26466) + << "incorrect value for stec_residuals[13].residual, expected 26466, is " + << last_msg_->stec_residuals[13].residual; + EXPECT_EQ(last_msg_->stec_residuals[13].stddev, 204) + << "incorrect value for stec_residuals[13].stddev, expected 204, is " + << last_msg_->stec_residuals[13].stddev; + EXPECT_EQ(last_msg_->stec_residuals[13].sv_id.constellation, 128) + << "incorrect value for stec_residuals[13].sv_id.constellation, expected " + "128, is " + << last_msg_->stec_residuals[13].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[13].sv_id.satId, 27) + << "incorrect value for stec_residuals[13].sv_id.satId, expected 27, is " + << last_msg_->stec_residuals[13].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[14].residual, -7552) + << "incorrect value for stec_residuals[14].residual, expected -7552, is " + << last_msg_->stec_residuals[14].residual; + EXPECT_EQ(last_msg_->stec_residuals[14].stddev, 148) + << "incorrect value for stec_residuals[14].stddev, expected 148, is " + << last_msg_->stec_residuals[14].stddev; + EXPECT_EQ(last_msg_->stec_residuals[14].sv_id.constellation, 238) + << "incorrect value for stec_residuals[14].sv_id.constellation, expected " + "238, is " + << last_msg_->stec_residuals[14].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[14].sv_id.satId, 75) + << "incorrect value for stec_residuals[14].sv_id.satId, expected 75, is " + << last_msg_->stec_residuals[14].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[15].residual, -12072) + << "incorrect value for stec_residuals[15].residual, expected -12072, is " + << last_msg_->stec_residuals[15].residual; + EXPECT_EQ(last_msg_->stec_residuals[15].stddev, 149) + << "incorrect value for stec_residuals[15].stddev, expected 149, is " + << last_msg_->stec_residuals[15].stddev; + EXPECT_EQ(last_msg_->stec_residuals[15].sv_id.constellation, 61) + << "incorrect value for stec_residuals[15].sv_id.constellation, expected " + "61, is " + << last_msg_->stec_residuals[15].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[15].sv_id.satId, 248) + << "incorrect value for stec_residuals[15].sv_id.satId, expected 248, is " + << last_msg_->stec_residuals[15].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[16].residual, -28632) + << "incorrect value for stec_residuals[16].residual, expected -28632, is " + << last_msg_->stec_residuals[16].residual; + EXPECT_EQ(last_msg_->stec_residuals[16].stddev, 186) + << "incorrect value for stec_residuals[16].stddev, expected 186, is " + << last_msg_->stec_residuals[16].stddev; + EXPECT_EQ(last_msg_->stec_residuals[16].sv_id.constellation, 224) + << "incorrect value for stec_residuals[16].sv_id.constellation, expected " + "224, is " + << last_msg_->stec_residuals[16].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[16].sv_id.satId, 167) + << "incorrect value for stec_residuals[16].sv_id.satId, expected 167, is " + << last_msg_->stec_residuals[16].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[17].residual, -4024) + << "incorrect value for stec_residuals[17].residual, expected -4024, is " + << last_msg_->stec_residuals[17].residual; + EXPECT_EQ(last_msg_->stec_residuals[17].stddev, 100) + << "incorrect value for stec_residuals[17].stddev, expected 100, is " + << last_msg_->stec_residuals[17].stddev; + EXPECT_EQ(last_msg_->stec_residuals[17].sv_id.constellation, 227) + << "incorrect value for stec_residuals[17].sv_id.constellation, expected " + "227, is " + << last_msg_->stec_residuals[17].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[17].sv_id.satId, 157) + << "incorrect value for stec_residuals[17].sv_id.satId, expected 157, is " + << last_msg_->stec_residuals[17].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[18].residual, 2004) + << "incorrect value for stec_residuals[18].residual, expected 2004, is " + << last_msg_->stec_residuals[18].residual; + EXPECT_EQ(last_msg_->stec_residuals[18].stddev, 59) + << "incorrect value for stec_residuals[18].stddev, expected 59, is " + << last_msg_->stec_residuals[18].stddev; + EXPECT_EQ(last_msg_->stec_residuals[18].sv_id.constellation, 12) + << "incorrect value for stec_residuals[18].sv_id.constellation, expected " + "12, is " + << last_msg_->stec_residuals[18].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[18].sv_id.satId, 35) + << "incorrect value for stec_residuals[18].sv_id.satId, expected 35, is " + << last_msg_->stec_residuals[18].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[19].residual, 6998) + << "incorrect value for stec_residuals[19].residual, expected 6998, is " + << last_msg_->stec_residuals[19].residual; + EXPECT_EQ(last_msg_->stec_residuals[19].stddev, 24) + << "incorrect value for stec_residuals[19].stddev, expected 24, is " + << last_msg_->stec_residuals[19].stddev; + EXPECT_EQ(last_msg_->stec_residuals[19].sv_id.constellation, 81) + << "incorrect value for stec_residuals[19].sv_id.constellation, expected " + "81, is " + << last_msg_->stec_residuals[19].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[19].sv_id.satId, 176) + << "incorrect value for stec_residuals[19].sv_id.satId, expected 176, is " + << last_msg_->stec_residuals[19].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[20].residual, -31701) + << "incorrect value for stec_residuals[20].residual, expected -31701, is " + << last_msg_->stec_residuals[20].residual; + EXPECT_EQ(last_msg_->stec_residuals[20].stddev, 45) + << "incorrect value for stec_residuals[20].stddev, expected 45, is " + << last_msg_->stec_residuals[20].stddev; + EXPECT_EQ(last_msg_->stec_residuals[20].sv_id.constellation, 67) + << "incorrect value for stec_residuals[20].sv_id.constellation, expected " + "67, is " + << last_msg_->stec_residuals[20].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[20].sv_id.satId, 155) + << "incorrect value for stec_residuals[20].sv_id.satId, expected 155, is " + << last_msg_->stec_residuals[20].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[21].residual, 28678) + << "incorrect value for stec_residuals[21].residual, expected 28678, is " + << last_msg_->stec_residuals[21].residual; + EXPECT_EQ(last_msg_->stec_residuals[21].stddev, 183) + << "incorrect value for stec_residuals[21].stddev, expected 183, is " + << last_msg_->stec_residuals[21].stddev; + EXPECT_EQ(last_msg_->stec_residuals[21].sv_id.constellation, 44) + << "incorrect value for stec_residuals[21].sv_id.constellation, expected " + "44, is " + << last_msg_->stec_residuals[21].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[21].sv_id.satId, 203) + << "incorrect value for stec_residuals[21].sv_id.satId, expected 203, is " + << last_msg_->stec_residuals[21].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[22].residual, -15793) + << "incorrect value for stec_residuals[22].residual, expected -15793, is " + << last_msg_->stec_residuals[22].residual; + EXPECT_EQ(last_msg_->stec_residuals[22].stddev, 253) + << "incorrect value for stec_residuals[22].stddev, expected 253, is " + << last_msg_->stec_residuals[22].stddev; + EXPECT_EQ(last_msg_->stec_residuals[22].sv_id.constellation, 176) + << "incorrect value for stec_residuals[22].sv_id.constellation, expected " + "176, is " + << last_msg_->stec_residuals[22].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[22].sv_id.satId, 231) + << "incorrect value for stec_residuals[22].sv_id.satId, expected 231, is " + << last_msg_->stec_residuals[22].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[23].residual, -7589) + << "incorrect value for stec_residuals[23].residual, expected -7589, is " + << last_msg_->stec_residuals[23].residual; + EXPECT_EQ(last_msg_->stec_residuals[23].stddev, 116) + << "incorrect value for stec_residuals[23].stddev, expected 116, is " + << last_msg_->stec_residuals[23].stddev; + EXPECT_EQ(last_msg_->stec_residuals[23].sv_id.constellation, 103) + << "incorrect value for stec_residuals[23].sv_id.constellation, expected " + "103, is " + << last_msg_->stec_residuals[23].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[23].sv_id.satId, 247) + << "incorrect value for stec_residuals[23].sv_id.satId, expected 247, is " + << last_msg_->stec_residuals[23].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[24].residual, -7362) + << "incorrect value for stec_residuals[24].residual, expected -7362, is " + << last_msg_->stec_residuals[24].residual; + EXPECT_EQ(last_msg_->stec_residuals[24].stddev, 240) + << "incorrect value for stec_residuals[24].stddev, expected 240, is " + << last_msg_->stec_residuals[24].stddev; + EXPECT_EQ(last_msg_->stec_residuals[24].sv_id.constellation, 23) + << "incorrect value for stec_residuals[24].sv_id.constellation, expected " + "23, is " + << last_msg_->stec_residuals[24].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[24].sv_id.satId, 148) + << "incorrect value for stec_residuals[24].sv_id.satId, expected 148, is " + << last_msg_->stec_residuals[24].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[25].residual, 4813) + << "incorrect value for stec_residuals[25].residual, expected 4813, is " + << last_msg_->stec_residuals[25].residual; + EXPECT_EQ(last_msg_->stec_residuals[25].stddev, 242) + << "incorrect value for stec_residuals[25].stddev, expected 242, is " + << last_msg_->stec_residuals[25].stddev; + EXPECT_EQ(last_msg_->stec_residuals[25].sv_id.constellation, 219) + << "incorrect value for stec_residuals[25].sv_id.constellation, expected " + "219, is " + << last_msg_->stec_residuals[25].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[25].sv_id.satId, 29) + << "incorrect value for stec_residuals[25].sv_id.satId, expected 29, is " + << last_msg_->stec_residuals[25].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[26].residual, 20295) + << "incorrect value for stec_residuals[26].residual, expected 20295, is " + << last_msg_->stec_residuals[26].residual; + EXPECT_EQ(last_msg_->stec_residuals[26].stddev, 37) + << "incorrect value for stec_residuals[26].stddev, expected 37, is " + << last_msg_->stec_residuals[26].stddev; + EXPECT_EQ(last_msg_->stec_residuals[26].sv_id.constellation, 72) + << "incorrect value for stec_residuals[26].sv_id.constellation, expected " + "72, is " + << last_msg_->stec_residuals[26].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[26].sv_id.satId, 207) + << "incorrect value for stec_residuals[26].sv_id.satId, expected 207, is " + << last_msg_->stec_residuals[26].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[27].residual, -13623) + << "incorrect value for stec_residuals[27].residual, expected -13623, is " + << last_msg_->stec_residuals[27].residual; + EXPECT_EQ(last_msg_->stec_residuals[27].stddev, 91) + << "incorrect value for stec_residuals[27].stddev, expected 91, is " + << last_msg_->stec_residuals[27].stddev; + EXPECT_EQ(last_msg_->stec_residuals[27].sv_id.constellation, 176) + << "incorrect value for stec_residuals[27].sv_id.constellation, expected " + "176, is " + << last_msg_->stec_residuals[27].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[27].sv_id.satId, 42) + << "incorrect value for stec_residuals[27].sv_id.satId, expected 42, is " + << last_msg_->stec_residuals[27].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[28].residual, 15250) + << "incorrect value for stec_residuals[28].residual, expected 15250, is " + << last_msg_->stec_residuals[28].residual; + EXPECT_EQ(last_msg_->stec_residuals[28].stddev, 110) + << "incorrect value for stec_residuals[28].stddev, expected 110, is " + << last_msg_->stec_residuals[28].stddev; + EXPECT_EQ(last_msg_->stec_residuals[28].sv_id.constellation, 115) + << "incorrect value for stec_residuals[28].sv_id.constellation, expected " + "115, is " + << last_msg_->stec_residuals[28].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[28].sv_id.satId, 105) + << "incorrect value for stec_residuals[28].sv_id.satId, expected 105, is " + << last_msg_->stec_residuals[28].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[29].residual, -18560) + << "incorrect value for stec_residuals[29].residual, expected -18560, is " + << last_msg_->stec_residuals[29].residual; + EXPECT_EQ(last_msg_->stec_residuals[29].stddev, 185) + << "incorrect value for stec_residuals[29].stddev, expected 185, is " + << last_msg_->stec_residuals[29].stddev; + EXPECT_EQ(last_msg_->stec_residuals[29].sv_id.constellation, 109) + << "incorrect value for stec_residuals[29].sv_id.constellation, expected " + "109, is " + << last_msg_->stec_residuals[29].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[29].sv_id.satId, 44) + << "incorrect value for stec_residuals[29].sv_id.satId, expected 44, is " + << last_msg_->stec_residuals[29].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[30].residual, 23717) + << "incorrect value for stec_residuals[30].residual, expected 23717, is " + << last_msg_->stec_residuals[30].residual; + EXPECT_EQ(last_msg_->stec_residuals[30].stddev, 79) + << "incorrect value for stec_residuals[30].stddev, expected 79, is " + << last_msg_->stec_residuals[30].stddev; + EXPECT_EQ(last_msg_->stec_residuals[30].sv_id.constellation, 31) + << "incorrect value for stec_residuals[30].sv_id.constellation, expected " + "31, is " + << last_msg_->stec_residuals[30].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[30].sv_id.satId, 67) + << "incorrect value for stec_residuals[30].sv_id.satId, expected 67, is " + << last_msg_->stec_residuals[30].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[31].residual, 1886) + << "incorrect value for stec_residuals[31].residual, expected 1886, is " + << last_msg_->stec_residuals[31].residual; + EXPECT_EQ(last_msg_->stec_residuals[31].stddev, 162) + << "incorrect value for stec_residuals[31].stddev, expected 162, is " + << last_msg_->stec_residuals[31].stddev; + EXPECT_EQ(last_msg_->stec_residuals[31].sv_id.constellation, 180) + << "incorrect value for stec_residuals[31].sv_id.constellation, expected " + "180, is " + << last_msg_->stec_residuals[31].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[31].sv_id.satId, 189) + << "incorrect value for stec_residuals[31].sv_id.satId, expected 189, is " + << last_msg_->stec_residuals[31].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[32].residual, 12242) + << "incorrect value for stec_residuals[32].residual, expected 12242, is " + << last_msg_->stec_residuals[32].residual; + EXPECT_EQ(last_msg_->stec_residuals[32].stddev, 7) + << "incorrect value for stec_residuals[32].stddev, expected 7, is " + << last_msg_->stec_residuals[32].stddev; + EXPECT_EQ(last_msg_->stec_residuals[32].sv_id.constellation, 156) + << "incorrect value for stec_residuals[32].sv_id.constellation, expected " + "156, is " + << last_msg_->stec_residuals[32].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[32].sv_id.satId, 121) + << "incorrect value for stec_residuals[32].sv_id.satId, expected 121, is " + << last_msg_->stec_residuals[32].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[33].residual, 10670) + << "incorrect value for stec_residuals[33].residual, expected 10670, is " + << last_msg_->stec_residuals[33].residual; + EXPECT_EQ(last_msg_->stec_residuals[33].stddev, 241) + << "incorrect value for stec_residuals[33].stddev, expected 241, is " + << last_msg_->stec_residuals[33].stddev; + EXPECT_EQ(last_msg_->stec_residuals[33].sv_id.constellation, 205) + << "incorrect value for stec_residuals[33].sv_id.constellation, expected " + "205, is " + << last_msg_->stec_residuals[33].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[33].sv_id.satId, 7) + << "incorrect value for stec_residuals[33].sv_id.satId, expected 7, is " + << last_msg_->stec_residuals[33].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[34].residual, 25899) + << "incorrect value for stec_residuals[34].residual, expected 25899, is " + << last_msg_->stec_residuals[34].residual; + EXPECT_EQ(last_msg_->stec_residuals[34].stddev, 186) + << "incorrect value for stec_residuals[34].stddev, expected 186, is " + << last_msg_->stec_residuals[34].stddev; + EXPECT_EQ(last_msg_->stec_residuals[34].sv_id.constellation, 210) + << "incorrect value for stec_residuals[34].sv_id.constellation, expected " + "210, is " + << last_msg_->stec_residuals[34].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[34].sv_id.satId, 129) + << "incorrect value for stec_residuals[34].sv_id.satId, expected 129, is " + << last_msg_->stec_residuals[34].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[35].residual, -2078) + << "incorrect value for stec_residuals[35].residual, expected -2078, is " + << last_msg_->stec_residuals[35].residual; + EXPECT_EQ(last_msg_->stec_residuals[35].stddev, 187) + << "incorrect value for stec_residuals[35].stddev, expected 187, is " + << last_msg_->stec_residuals[35].stddev; + EXPECT_EQ(last_msg_->stec_residuals[35].sv_id.constellation, 195) + << "incorrect value for stec_residuals[35].sv_id.constellation, expected " + "195, is " + << last_msg_->stec_residuals[35].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[35].sv_id.satId, 208) + << "incorrect value for stec_residuals[35].sv_id.satId, expected 208, is " + << last_msg_->stec_residuals[35].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[36].residual, -16264) + << "incorrect value for stec_residuals[36].residual, expected -16264, is " + << last_msg_->stec_residuals[36].residual; + EXPECT_EQ(last_msg_->stec_residuals[36].stddev, 102) + << "incorrect value for stec_residuals[36].stddev, expected 102, is " + << last_msg_->stec_residuals[36].stddev; + EXPECT_EQ(last_msg_->stec_residuals[36].sv_id.constellation, 160) + << "incorrect value for stec_residuals[36].sv_id.constellation, expected " + "160, is " + << last_msg_->stec_residuals[36].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[36].sv_id.satId, 219) + << "incorrect value for stec_residuals[36].sv_id.satId, expected 219, is " + << last_msg_->stec_residuals[36].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[37].residual, -21002) + << "incorrect value for stec_residuals[37].residual, expected -21002, is " + << last_msg_->stec_residuals[37].residual; + EXPECT_EQ(last_msg_->stec_residuals[37].stddev, 94) + << "incorrect value for stec_residuals[37].stddev, expected 94, is " + << last_msg_->stec_residuals[37].stddev; + EXPECT_EQ(last_msg_->stec_residuals[37].sv_id.constellation, 42) + << "incorrect value for stec_residuals[37].sv_id.constellation, expected " + "42, is " + << last_msg_->stec_residuals[37].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[37].sv_id.satId, 166) + << "incorrect value for stec_residuals[37].sv_id.satId, expected 166, is " + << last_msg_->stec_residuals[37].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[38].residual, 7902) + << "incorrect value for stec_residuals[38].residual, expected 7902, is " + << last_msg_->stec_residuals[38].residual; + EXPECT_EQ(last_msg_->stec_residuals[38].stddev, 35) + << "incorrect value for stec_residuals[38].stddev, expected 35, is " + << last_msg_->stec_residuals[38].stddev; + EXPECT_EQ(last_msg_->stec_residuals[38].sv_id.constellation, 156) + << "incorrect value for stec_residuals[38].sv_id.constellation, expected " + "156, is " + << last_msg_->stec_residuals[38].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[38].sv_id.satId, 102) + << "incorrect value for stec_residuals[38].sv_id.satId, expected 102, is " + << last_msg_->stec_residuals[38].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[39].residual, -30275) + << "incorrect value for stec_residuals[39].residual, expected -30275, is " + << last_msg_->stec_residuals[39].residual; + EXPECT_EQ(last_msg_->stec_residuals[39].stddev, 204) + << "incorrect value for stec_residuals[39].stddev, expected 204, is " + << last_msg_->stec_residuals[39].stddev; + EXPECT_EQ(last_msg_->stec_residuals[39].sv_id.constellation, 64) + << "incorrect value for stec_residuals[39].sv_id.constellation, expected " + "64, is " + << last_msg_->stec_residuals[39].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[39].sv_id.satId, 247) + << "incorrect value for stec_residuals[39].sv_id.satId, expected 247, is " + << last_msg_->stec_residuals[39].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[40].residual, -8633) + << "incorrect value for stec_residuals[40].residual, expected -8633, is " + << last_msg_->stec_residuals[40].residual; + EXPECT_EQ(last_msg_->stec_residuals[40].stddev, 222) + << "incorrect value for stec_residuals[40].stddev, expected 222, is " + << last_msg_->stec_residuals[40].stddev; + EXPECT_EQ(last_msg_->stec_residuals[40].sv_id.constellation, 32) + << "incorrect value for stec_residuals[40].sv_id.constellation, expected " + "32, is " + << last_msg_->stec_residuals[40].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[40].sv_id.satId, 220) + << "incorrect value for stec_residuals[40].sv_id.satId, expected 220, is " + << last_msg_->stec_residuals[40].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[41].residual, 6403) + << "incorrect value for stec_residuals[41].residual, expected 6403, is " + << last_msg_->stec_residuals[41].residual; + EXPECT_EQ(last_msg_->stec_residuals[41].stddev, 45) + << "incorrect value for stec_residuals[41].stddev, expected 45, is " + << last_msg_->stec_residuals[41].stddev; + EXPECT_EQ(last_msg_->stec_residuals[41].sv_id.constellation, 246) + << "incorrect value for stec_residuals[41].sv_id.constellation, expected " + "246, is " + << last_msg_->stec_residuals[41].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[41].sv_id.satId, 201) + << "incorrect value for stec_residuals[41].sv_id.satId, expected 201, is " + << last_msg_->stec_residuals[41].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[42].residual, 22643) + << "incorrect value for stec_residuals[42].residual, expected 22643, is " + << last_msg_->stec_residuals[42].residual; + EXPECT_EQ(last_msg_->stec_residuals[42].stddev, 218) + << "incorrect value for stec_residuals[42].stddev, expected 218, is " + << last_msg_->stec_residuals[42].stddev; + EXPECT_EQ(last_msg_->stec_residuals[42].sv_id.constellation, 239) + << "incorrect value for stec_residuals[42].sv_id.constellation, expected " + "239, is " + << last_msg_->stec_residuals[42].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[42].sv_id.satId, 251) + << "incorrect value for stec_residuals[42].sv_id.satId, expected 251, is " + << last_msg_->stec_residuals[42].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[43].residual, 16760) + << "incorrect value for stec_residuals[43].residual, expected 16760, is " + << last_msg_->stec_residuals[43].residual; + EXPECT_EQ(last_msg_->stec_residuals[43].stddev, 175) + << "incorrect value for stec_residuals[43].stddev, expected 175, is " + << last_msg_->stec_residuals[43].stddev; + EXPECT_EQ(last_msg_->stec_residuals[43].sv_id.constellation, 209) + << "incorrect value for stec_residuals[43].sv_id.constellation, expected " + "209, is " + << last_msg_->stec_residuals[43].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[43].sv_id.satId, 10) + << "incorrect value for stec_residuals[43].sv_id.satId, expected 10, is " + << last_msg_->stec_residuals[43].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[44].residual, -20951) + << "incorrect value for stec_residuals[44].residual, expected -20951, is " + << last_msg_->stec_residuals[44].residual; + EXPECT_EQ(last_msg_->stec_residuals[44].stddev, 137) + << "incorrect value for stec_residuals[44].stddev, expected 137, is " + << last_msg_->stec_residuals[44].stddev; + EXPECT_EQ(last_msg_->stec_residuals[44].sv_id.constellation, 194) + << "incorrect value for stec_residuals[44].sv_id.constellation, expected " + "194, is " + << last_msg_->stec_residuals[44].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[44].sv_id.satId, 131) + << "incorrect value for stec_residuals[44].sv_id.satId, expected 131, is " + << last_msg_->stec_residuals[44].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[45].residual, -740) + << "incorrect value for stec_residuals[45].residual, expected -740, is " + << last_msg_->stec_residuals[45].residual; + EXPECT_EQ(last_msg_->stec_residuals[45].stddev, 42) + << "incorrect value for stec_residuals[45].stddev, expected 42, is " + << last_msg_->stec_residuals[45].stddev; + EXPECT_EQ(last_msg_->stec_residuals[45].sv_id.constellation, 68) + << "incorrect value for stec_residuals[45].sv_id.constellation, expected " + "68, is " + << last_msg_->stec_residuals[45].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[45].sv_id.satId, 17) + << "incorrect value for stec_residuals[45].sv_id.satId, expected 17, is " + << last_msg_->stec_residuals[45].sv_id.satId; + EXPECT_EQ(last_msg_->tropo_delay_correction.hydro, -3035) + << "incorrect value for tropo_delay_correction.hydro, expected -3035, is " + << last_msg_->tropo_delay_correction.hydro; + EXPECT_EQ(last_msg_->tropo_delay_correction.stddev, 72) + << "incorrect value for tropo_delay_correction.stddev, expected 72, is " + << last_msg_->tropo_delay_correction.stddev; + EXPECT_EQ(last_msg_->tropo_delay_correction.wet, 78) + << "incorrect value for tropo_delay_correction.wet, expected 78, is " + << last_msg_->tropo_delay_correction.wet; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.cc index 61726ada8..eefebd631 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionBounds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionBounds.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_gridded_correction_bounds_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_gridded_correction_bounds_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,162 +82,241 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_gridded_correction_bounds_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds0, Test) { + uint8_t encoded_frame[] = { + 85, 254, 5, 66, 0, 45, 180, 0, 0, 0, 3, 0, 1, 0, + 10, 0, 15, 1, 0, 10, 0, 39, 232, 3, 244, 1, 100, 200, + 150, 100, 150, 100, 2, 5, 10, 16, 0, 17, 18, 19, 20, 21, + 6, 10, 22, 0, 23, 24, 25, 26, 27, 236, 182, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_gridded_correction_bounds_t *test_msg = + (msg_ssr_gridded_correction_bounds_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->grid_point_id = 1000; + test_msg->header.num_msgs = 1; + test_msg->header.seq_num = 0; + test_msg->header.sol_id = 0; + test_msg->header.time.tow = 180; + test_msg->header.time.wn = 3; + test_msg->header.update_interval = 10; + test_msg->n_sats = 2; + test_msg->ssr_iod_atmo = 15; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + test_msg->stec_sat_list[0].stec_bound_mu = 18; + test_msg->stec_sat_list[0].stec_bound_mu_dot = 20; + test_msg->stec_sat_list[0].stec_bound_sig = 19; + test_msg->stec_sat_list[0].stec_bound_sig_dot = 21; + test_msg->stec_sat_list[0].stec_residual.residual = 16; + test_msg->stec_sat_list[0].stec_residual.stddev = 17; + test_msg->stec_sat_list[0].stec_residual.sv_id.constellation = 10; + test_msg->stec_sat_list[0].stec_residual.sv_id.satId = 5; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + test_msg->stec_sat_list[1].stec_bound_mu = 24; + test_msg->stec_sat_list[1].stec_bound_mu_dot = 26; + test_msg->stec_sat_list[1].stec_bound_sig = 25; + test_msg->stec_sat_list[1].stec_bound_sig_dot = 27; + test_msg->stec_sat_list[1].stec_residual.residual = 22; + test_msg->stec_sat_list[1].stec_residual.stddev = 23; + test_msg->stec_sat_list[1].stec_residual.sv_id.constellation = 10; + test_msg->stec_sat_list[1].stec_residual.sv_id.satId = 6; + test_msg->tile_id = 10; + test_msg->tile_set_id = 1; + test_msg->tropo_delay_correction.hydro = 500; + test_msg->tropo_delay_correction.stddev = 200; + test_msg->tropo_delay_correction.wet = 100; + test_msg->tropo_qi = 39; + test_msg->tropo_v_hydro_bound_mu = 150; + test_msg->tropo_v_hydro_bound_sig = 100; + test_msg->tropo_v_wet_bound_mu = 150; + test_msg->tropo_v_wet_bound_sig = 100; - uint8_t encoded_frame[] = {85,254,5,66,0,45,180,0,0,0,3,0,1,0,10,0,15,1,0,10,0,39,232,3,244,1,100,200,150,100,150,100,2,5,10,16,0,17,18,19,20,21,6,10,22,0,23,24,25,26,27,236,182, }; + EXPECT_EQ(send_message(1534, 66, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_gridded_correction_bounds_t* test_msg = ( msg_ssr_gridded_correction_bounds_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->grid_point_id = 1000; - test_msg->header.num_msgs = 1; - test_msg->header.seq_num = 0; - test_msg->header.sol_id = 0; - test_msg->header.time.tow = 180; - test_msg->header.time.wn = 3; - test_msg->header.update_interval = 10; - test_msg->n_sats = 2; - test_msg->ssr_iod_atmo = 15; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - test_msg->stec_sat_list[0].stec_bound_mu = 18; - test_msg->stec_sat_list[0].stec_bound_mu_dot = 20; - test_msg->stec_sat_list[0].stec_bound_sig = 19; - test_msg->stec_sat_list[0].stec_bound_sig_dot = 21; - test_msg->stec_sat_list[0].stec_residual.residual = 16; - test_msg->stec_sat_list[0].stec_residual.stddev = 17; - test_msg->stec_sat_list[0].stec_residual.sv_id.constellation = 10; - test_msg->stec_sat_list[0].stec_residual.sv_id.satId = 5; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - test_msg->stec_sat_list[1].stec_bound_mu = 24; - test_msg->stec_sat_list[1].stec_bound_mu_dot = 26; - test_msg->stec_sat_list[1].stec_bound_sig = 25; - test_msg->stec_sat_list[1].stec_bound_sig_dot = 27; - test_msg->stec_sat_list[1].stec_residual.residual = 22; - test_msg->stec_sat_list[1].stec_residual.stddev = 23; - test_msg->stec_sat_list[1].stec_residual.sv_id.constellation = 10; - test_msg->stec_sat_list[1].stec_residual.sv_id.satId = 6; - test_msg->tile_id = 10; - test_msg->tile_set_id = 1; - test_msg->tropo_delay_correction.hydro = 500; - test_msg->tropo_delay_correction.stddev = 200; - test_msg->tropo_delay_correction.wet = 100; - test_msg->tropo_qi = 39; - test_msg->tropo_v_hydro_bound_mu = 150; - test_msg->tropo_v_hydro_bound_sig = 100; - test_msg->tropo_v_wet_bound_mu = 150; - test_msg->tropo_v_wet_bound_sig = 100; - - EXPECT_EQ(send_message( 1534, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->grid_point_id, 1000) << "incorrect value for grid_point_id, expected 1000, is " << last_msg_->grid_point_id; - EXPECT_EQ(last_msg_->header.num_msgs, 1) << "incorrect value for header.num_msgs, expected 1, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.seq_num, 0) << "incorrect value for header.seq_num, expected 0, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->header.sol_id, 0) << "incorrect value for header.sol_id, expected 0, is " << last_msg_->header.sol_id; - EXPECT_EQ(last_msg_->header.time.tow, 180) << "incorrect value for header.time.tow, expected 180, is " << last_msg_->header.time.tow; - EXPECT_EQ(last_msg_->header.time.wn, 3) << "incorrect value for header.time.wn, expected 3, is " << last_msg_->header.time.wn; - EXPECT_EQ(last_msg_->header.update_interval, 10) << "incorrect value for header.update_interval, expected 10, is " << last_msg_->header.update_interval; - EXPECT_EQ(last_msg_->n_sats, 2) << "incorrect value for n_sats, expected 2, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->ssr_iod_atmo, 15) << "incorrect value for ssr_iod_atmo, expected 15, is " << last_msg_->ssr_iod_atmo; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_bound_mu, 18) << "incorrect value for stec_sat_list[0].stec_bound_mu, expected 18, is " << last_msg_->stec_sat_list[0].stec_bound_mu; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_bound_mu_dot, 20) << "incorrect value for stec_sat_list[0].stec_bound_mu_dot, expected 20, is " << last_msg_->stec_sat_list[0].stec_bound_mu_dot; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_bound_sig, 19) << "incorrect value for stec_sat_list[0].stec_bound_sig, expected 19, is " << last_msg_->stec_sat_list[0].stec_bound_sig; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_bound_sig_dot, 21) << "incorrect value for stec_sat_list[0].stec_bound_sig_dot, expected 21, is " << last_msg_->stec_sat_list[0].stec_bound_sig_dot; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_residual.residual, 16) << "incorrect value for stec_sat_list[0].stec_residual.residual, expected 16, is " << last_msg_->stec_sat_list[0].stec_residual.residual; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_residual.stddev, 17) << "incorrect value for stec_sat_list[0].stec_residual.stddev, expected 17, is " << last_msg_->stec_sat_list[0].stec_residual.stddev; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_residual.sv_id.constellation, 10) << "incorrect value for stec_sat_list[0].stec_residual.sv_id.constellation, expected 10, is " << last_msg_->stec_sat_list[0].stec_residual.sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_residual.sv_id.satId, 5) << "incorrect value for stec_sat_list[0].stec_residual.sv_id.satId, expected 5, is " << last_msg_->stec_sat_list[0].stec_residual.sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_bound_mu, 24) << "incorrect value for stec_sat_list[1].stec_bound_mu, expected 24, is " << last_msg_->stec_sat_list[1].stec_bound_mu; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_bound_mu_dot, 26) << "incorrect value for stec_sat_list[1].stec_bound_mu_dot, expected 26, is " << last_msg_->stec_sat_list[1].stec_bound_mu_dot; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_bound_sig, 25) << "incorrect value for stec_sat_list[1].stec_bound_sig, expected 25, is " << last_msg_->stec_sat_list[1].stec_bound_sig; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_bound_sig_dot, 27) << "incorrect value for stec_sat_list[1].stec_bound_sig_dot, expected 27, is " << last_msg_->stec_sat_list[1].stec_bound_sig_dot; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_residual.residual, 22) << "incorrect value for stec_sat_list[1].stec_residual.residual, expected 22, is " << last_msg_->stec_sat_list[1].stec_residual.residual; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_residual.stddev, 23) << "incorrect value for stec_sat_list[1].stec_residual.stddev, expected 23, is " << last_msg_->stec_sat_list[1].stec_residual.stddev; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_residual.sv_id.constellation, 10) << "incorrect value for stec_sat_list[1].stec_residual.sv_id.constellation, expected 10, is " << last_msg_->stec_sat_list[1].stec_residual.sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_residual.sv_id.satId, 6) << "incorrect value for stec_sat_list[1].stec_residual.sv_id.satId, expected 6, is " << last_msg_->stec_sat_list[1].stec_residual.sv_id.satId; - EXPECT_EQ(last_msg_->tile_id, 10) << "incorrect value for tile_id, expected 10, is " << last_msg_->tile_id; - EXPECT_EQ(last_msg_->tile_set_id, 1) << "incorrect value for tile_set_id, expected 1, is " << last_msg_->tile_set_id; - EXPECT_EQ(last_msg_->tropo_delay_correction.hydro, 500) << "incorrect value for tropo_delay_correction.hydro, expected 500, is " << last_msg_->tropo_delay_correction.hydro; - EXPECT_EQ(last_msg_->tropo_delay_correction.stddev, 200) << "incorrect value for tropo_delay_correction.stddev, expected 200, is " << last_msg_->tropo_delay_correction.stddev; - EXPECT_EQ(last_msg_->tropo_delay_correction.wet, 100) << "incorrect value for tropo_delay_correction.wet, expected 100, is " << last_msg_->tropo_delay_correction.wet; - EXPECT_EQ(last_msg_->tropo_qi, 39) << "incorrect value for tropo_qi, expected 39, is " << last_msg_->tropo_qi; - EXPECT_EQ(last_msg_->tropo_v_hydro_bound_mu, 150) << "incorrect value for tropo_v_hydro_bound_mu, expected 150, is " << last_msg_->tropo_v_hydro_bound_mu; - EXPECT_EQ(last_msg_->tropo_v_hydro_bound_sig, 100) << "incorrect value for tropo_v_hydro_bound_sig, expected 100, is " << last_msg_->tropo_v_hydro_bound_sig; - EXPECT_EQ(last_msg_->tropo_v_wet_bound_mu, 150) << "incorrect value for tropo_v_wet_bound_mu, expected 150, is " << last_msg_->tropo_v_wet_bound_mu; - EXPECT_EQ(last_msg_->tropo_v_wet_bound_sig, 100) << "incorrect value for tropo_v_wet_bound_sig, expected 100, is " << last_msg_->tropo_v_wet_bound_sig; + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->grid_point_id, 1000) + << "incorrect value for grid_point_id, expected 1000, is " + << last_msg_->grid_point_id; + EXPECT_EQ(last_msg_->header.num_msgs, 1) + << "incorrect value for header.num_msgs, expected 1, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.seq_num, 0) + << "incorrect value for header.seq_num, expected 0, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->header.sol_id, 0) + << "incorrect value for header.sol_id, expected 0, is " + << last_msg_->header.sol_id; + EXPECT_EQ(last_msg_->header.time.tow, 180) + << "incorrect value for header.time.tow, expected 180, is " + << last_msg_->header.time.tow; + EXPECT_EQ(last_msg_->header.time.wn, 3) + << "incorrect value for header.time.wn, expected 3, is " + << last_msg_->header.time.wn; + EXPECT_EQ(last_msg_->header.update_interval, 10) + << "incorrect value for header.update_interval, expected 10, is " + << last_msg_->header.update_interval; + EXPECT_EQ(last_msg_->n_sats, 2) + << "incorrect value for n_sats, expected 2, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->ssr_iod_atmo, 15) + << "incorrect value for ssr_iod_atmo, expected 15, is " + << last_msg_->ssr_iod_atmo; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_bound_mu, 18) + << "incorrect value for stec_sat_list[0].stec_bound_mu, expected 18, is " + << last_msg_->stec_sat_list[0].stec_bound_mu; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_bound_mu_dot, 20) + << "incorrect value for stec_sat_list[0].stec_bound_mu_dot, expected 20, " + "is " + << last_msg_->stec_sat_list[0].stec_bound_mu_dot; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_bound_sig, 19) + << "incorrect value for stec_sat_list[0].stec_bound_sig, expected 19, is " + << last_msg_->stec_sat_list[0].stec_bound_sig; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_bound_sig_dot, 21) + << "incorrect value for stec_sat_list[0].stec_bound_sig_dot, expected " + "21, is " + << last_msg_->stec_sat_list[0].stec_bound_sig_dot; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_residual.residual, 16) + << "incorrect value for stec_sat_list[0].stec_residual.residual, " + "expected 16, is " + << last_msg_->stec_sat_list[0].stec_residual.residual; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_residual.stddev, 17) + << "incorrect value for stec_sat_list[0].stec_residual.stddev, expected " + "17, is " + << last_msg_->stec_sat_list[0].stec_residual.stddev; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_residual.sv_id.constellation, 10) + << "incorrect value for " + "stec_sat_list[0].stec_residual.sv_id.constellation, expected 10, is " + << last_msg_->stec_sat_list[0].stec_residual.sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_residual.sv_id.satId, 5) + << "incorrect value for stec_sat_list[0].stec_residual.sv_id.satId, " + "expected 5, is " + << last_msg_->stec_sat_list[0].stec_residual.sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_bound_mu, 24) + << "incorrect value for stec_sat_list[1].stec_bound_mu, expected 24, is " + << last_msg_->stec_sat_list[1].stec_bound_mu; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_bound_mu_dot, 26) + << "incorrect value for stec_sat_list[1].stec_bound_mu_dot, expected 26, " + "is " + << last_msg_->stec_sat_list[1].stec_bound_mu_dot; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_bound_sig, 25) + << "incorrect value for stec_sat_list[1].stec_bound_sig, expected 25, is " + << last_msg_->stec_sat_list[1].stec_bound_sig; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_bound_sig_dot, 27) + << "incorrect value for stec_sat_list[1].stec_bound_sig_dot, expected " + "27, is " + << last_msg_->stec_sat_list[1].stec_bound_sig_dot; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_residual.residual, 22) + << "incorrect value for stec_sat_list[1].stec_residual.residual, " + "expected 22, is " + << last_msg_->stec_sat_list[1].stec_residual.residual; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_residual.stddev, 23) + << "incorrect value for stec_sat_list[1].stec_residual.stddev, expected " + "23, is " + << last_msg_->stec_sat_list[1].stec_residual.stddev; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_residual.sv_id.constellation, 10) + << "incorrect value for " + "stec_sat_list[1].stec_residual.sv_id.constellation, expected 10, is " + << last_msg_->stec_sat_list[1].stec_residual.sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_residual.sv_id.satId, 6) + << "incorrect value for stec_sat_list[1].stec_residual.sv_id.satId, " + "expected 6, is " + << last_msg_->stec_sat_list[1].stec_residual.sv_id.satId; + EXPECT_EQ(last_msg_->tile_id, 10) + << "incorrect value for tile_id, expected 10, is " << last_msg_->tile_id; + EXPECT_EQ(last_msg_->tile_set_id, 1) + << "incorrect value for tile_set_id, expected 1, is " + << last_msg_->tile_set_id; + EXPECT_EQ(last_msg_->tropo_delay_correction.hydro, 500) + << "incorrect value for tropo_delay_correction.hydro, expected 500, is " + << last_msg_->tropo_delay_correction.hydro; + EXPECT_EQ(last_msg_->tropo_delay_correction.stddev, 200) + << "incorrect value for tropo_delay_correction.stddev, expected 200, is " + << last_msg_->tropo_delay_correction.stddev; + EXPECT_EQ(last_msg_->tropo_delay_correction.wet, 100) + << "incorrect value for tropo_delay_correction.wet, expected 100, is " + << last_msg_->tropo_delay_correction.wet; + EXPECT_EQ(last_msg_->tropo_qi, 39) + << "incorrect value for tropo_qi, expected 39, is " + << last_msg_->tropo_qi; + EXPECT_EQ(last_msg_->tropo_v_hydro_bound_mu, 150) + << "incorrect value for tropo_v_hydro_bound_mu, expected 150, is " + << last_msg_->tropo_v_hydro_bound_mu; + EXPECT_EQ(last_msg_->tropo_v_hydro_bound_sig, 100) + << "incorrect value for tropo_v_hydro_bound_sig, expected 100, is " + << last_msg_->tropo_v_hydro_bound_sig; + EXPECT_EQ(last_msg_->tropo_v_wet_bound_mu, 150) + << "incorrect value for tropo_v_wet_bound_mu, expected 150, is " + << last_msg_->tropo_v_wet_bound_mu; + EXPECT_EQ(last_msg_->tropo_v_wet_bound_sig, 100) + << "incorrect value for tropo_v_wet_bound_sig, expected 100, is " + << last_msg_->tropo_v_wet_bound_sig; } -class Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_gridded_correction_bounds_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_gridded_correction_bounds_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -250,71 +326,110 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_gridded_correction_bounds_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds1, Test) -{ +}; - uint8_t encoded_frame[] = {85,254,5,66,0,27,180,0,0,0,3,0,1,0,10,0,15,1,0,10,0,39,232,3,244,1,100,200,150,100,150,100,0,155,36, }; +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionBounds1, Test) { + uint8_t encoded_frame[] = { + 85, 254, 5, 66, 0, 27, 180, 0, 0, 0, 3, 0, + 1, 0, 10, 0, 15, 1, 0, 10, 0, 39, 232, 3, + 244, 1, 100, 200, 150, 100, 150, 100, 0, 155, 36, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_gridded_correction_bounds_t* test_msg = ( msg_ssr_gridded_correction_bounds_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->grid_point_id = 1000; - test_msg->header.num_msgs = 1; - test_msg->header.seq_num = 0; - test_msg->header.sol_id = 0; - test_msg->header.time.tow = 180; - test_msg->header.time.wn = 3; - test_msg->header.update_interval = 10; - test_msg->n_sats = 0; - test_msg->ssr_iod_atmo = 15; - test_msg->tile_id = 10; - test_msg->tile_set_id = 1; - test_msg->tropo_delay_correction.hydro = 500; - test_msg->tropo_delay_correction.stddev = 200; - test_msg->tropo_delay_correction.wet = 100; - test_msg->tropo_qi = 39; - test_msg->tropo_v_hydro_bound_mu = 150; - test_msg->tropo_v_hydro_bound_sig = 100; - test_msg->tropo_v_wet_bound_mu = 150; - test_msg->tropo_v_wet_bound_sig = 100; - - EXPECT_EQ(send_message( 1534, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_gridded_correction_bounds_t *test_msg = + (msg_ssr_gridded_correction_bounds_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->grid_point_id = 1000; + test_msg->header.num_msgs = 1; + test_msg->header.seq_num = 0; + test_msg->header.sol_id = 0; + test_msg->header.time.tow = 180; + test_msg->header.time.wn = 3; + test_msg->header.update_interval = 10; + test_msg->n_sats = 0; + test_msg->ssr_iod_atmo = 15; + test_msg->tile_id = 10; + test_msg->tile_set_id = 1; + test_msg->tropo_delay_correction.hydro = 500; + test_msg->tropo_delay_correction.stddev = 200; + test_msg->tropo_delay_correction.wet = 100; + test_msg->tropo_qi = 39; + test_msg->tropo_v_hydro_bound_mu = 150; + test_msg->tropo_v_hydro_bound_sig = 100; + test_msg->tropo_v_wet_bound_mu = 150; + test_msg->tropo_v_wet_bound_sig = 100; + + EXPECT_EQ(send_message(1534, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->grid_point_id, 1000) << "incorrect value for grid_point_id, expected 1000, is " << last_msg_->grid_point_id; - EXPECT_EQ(last_msg_->header.num_msgs, 1) << "incorrect value for header.num_msgs, expected 1, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.seq_num, 0) << "incorrect value for header.seq_num, expected 0, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->header.sol_id, 0) << "incorrect value for header.sol_id, expected 0, is " << last_msg_->header.sol_id; - EXPECT_EQ(last_msg_->header.time.tow, 180) << "incorrect value for header.time.tow, expected 180, is " << last_msg_->header.time.tow; - EXPECT_EQ(last_msg_->header.time.wn, 3) << "incorrect value for header.time.wn, expected 3, is " << last_msg_->header.time.wn; - EXPECT_EQ(last_msg_->header.update_interval, 10) << "incorrect value for header.update_interval, expected 10, is " << last_msg_->header.update_interval; - EXPECT_EQ(last_msg_->n_sats, 0) << "incorrect value for n_sats, expected 0, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->ssr_iod_atmo, 15) << "incorrect value for ssr_iod_atmo, expected 15, is " << last_msg_->ssr_iod_atmo; - EXPECT_EQ(last_msg_->tile_id, 10) << "incorrect value for tile_id, expected 10, is " << last_msg_->tile_id; - EXPECT_EQ(last_msg_->tile_set_id, 1) << "incorrect value for tile_set_id, expected 1, is " << last_msg_->tile_set_id; - EXPECT_EQ(last_msg_->tropo_delay_correction.hydro, 500) << "incorrect value for tropo_delay_correction.hydro, expected 500, is " << last_msg_->tropo_delay_correction.hydro; - EXPECT_EQ(last_msg_->tropo_delay_correction.stddev, 200) << "incorrect value for tropo_delay_correction.stddev, expected 200, is " << last_msg_->tropo_delay_correction.stddev; - EXPECT_EQ(last_msg_->tropo_delay_correction.wet, 100) << "incorrect value for tropo_delay_correction.wet, expected 100, is " << last_msg_->tropo_delay_correction.wet; - EXPECT_EQ(last_msg_->tropo_qi, 39) << "incorrect value for tropo_qi, expected 39, is " << last_msg_->tropo_qi; - EXPECT_EQ(last_msg_->tropo_v_hydro_bound_mu, 150) << "incorrect value for tropo_v_hydro_bound_mu, expected 150, is " << last_msg_->tropo_v_hydro_bound_mu; - EXPECT_EQ(last_msg_->tropo_v_hydro_bound_sig, 100) << "incorrect value for tropo_v_hydro_bound_sig, expected 100, is " << last_msg_->tropo_v_hydro_bound_sig; - EXPECT_EQ(last_msg_->tropo_v_wet_bound_mu, 150) << "incorrect value for tropo_v_wet_bound_mu, expected 150, is " << last_msg_->tropo_v_wet_bound_mu; - EXPECT_EQ(last_msg_->tropo_v_wet_bound_sig, 100) << "incorrect value for tropo_v_wet_bound_sig, expected 100, is " << last_msg_->tropo_v_wet_bound_sig; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->grid_point_id, 1000) + << "incorrect value for grid_point_id, expected 1000, is " + << last_msg_->grid_point_id; + EXPECT_EQ(last_msg_->header.num_msgs, 1) + << "incorrect value for header.num_msgs, expected 1, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.seq_num, 0) + << "incorrect value for header.seq_num, expected 0, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->header.sol_id, 0) + << "incorrect value for header.sol_id, expected 0, is " + << last_msg_->header.sol_id; + EXPECT_EQ(last_msg_->header.time.tow, 180) + << "incorrect value for header.time.tow, expected 180, is " + << last_msg_->header.time.tow; + EXPECT_EQ(last_msg_->header.time.wn, 3) + << "incorrect value for header.time.wn, expected 3, is " + << last_msg_->header.time.wn; + EXPECT_EQ(last_msg_->header.update_interval, 10) + << "incorrect value for header.update_interval, expected 10, is " + << last_msg_->header.update_interval; + EXPECT_EQ(last_msg_->n_sats, 0) + << "incorrect value for n_sats, expected 0, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->ssr_iod_atmo, 15) + << "incorrect value for ssr_iod_atmo, expected 15, is " + << last_msg_->ssr_iod_atmo; + EXPECT_EQ(last_msg_->tile_id, 10) + << "incorrect value for tile_id, expected 10, is " << last_msg_->tile_id; + EXPECT_EQ(last_msg_->tile_set_id, 1) + << "incorrect value for tile_set_id, expected 1, is " + << last_msg_->tile_set_id; + EXPECT_EQ(last_msg_->tropo_delay_correction.hydro, 500) + << "incorrect value for tropo_delay_correction.hydro, expected 500, is " + << last_msg_->tropo_delay_correction.hydro; + EXPECT_EQ(last_msg_->tropo_delay_correction.stddev, 200) + << "incorrect value for tropo_delay_correction.stddev, expected 200, is " + << last_msg_->tropo_delay_correction.stddev; + EXPECT_EQ(last_msg_->tropo_delay_correction.wet, 100) + << "incorrect value for tropo_delay_correction.wet, expected 100, is " + << last_msg_->tropo_delay_correction.wet; + EXPECT_EQ(last_msg_->tropo_qi, 39) + << "incorrect value for tropo_qi, expected 39, is " + << last_msg_->tropo_qi; + EXPECT_EQ(last_msg_->tropo_v_hydro_bound_mu, 150) + << "incorrect value for tropo_v_hydro_bound_mu, expected 150, is " + << last_msg_->tropo_v_hydro_bound_mu; + EXPECT_EQ(last_msg_->tropo_v_hydro_bound_sig, 100) + << "incorrect value for tropo_v_hydro_bound_sig, expected 100, is " + << last_msg_->tropo_v_hydro_bound_sig; + EXPECT_EQ(last_msg_->tropo_v_wet_bound_mu, 150) + << "incorrect value for tropo_v_wet_bound_mu, expected 150, is " + << last_msg_->tropo_v_wet_bound_mu; + EXPECT_EQ(last_msg_->tropo_v_wet_bound_sig, 100) + << "incorrect value for tropo_v_wet_bound_sig, expected 100, is " + << last_msg_->tropo_v_wet_bound_sig; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.cc index 3459f0356..93f1caa59 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_gridded_correction_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_gridded_correction_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,619 +82,1128 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_gridded_correction_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,250,5,108,106,254,164,217,44,53,98,93,63,147,104,252,133,245,28,95,100,147,41,33,92,87,25,142,151,74,151,95,94,7,146,237,45,167,86,42,116,224,169,234,220,23,176,18,13,178,79,160,160,110,15,53,206,151,158,22,117,184,48,170,82,40,53,122,69,180,110,38,65,104,244,19,238,227,88,169,164,146,63,37,183,85,71,235,168,114,211,105,221,156,60,18,230,2,142,172,16,39,33,126,106,99,188,234,41,162,197,138,227,80,12,54,67,238,5,93,1,207,129,13,46,115,49,58,185,127,156,200,96,217,202,15,245,55,198,81,218,132,70,73,82,147,26,255,14,134,96,138,55,214,83,156,170,163,79,173,228,115,51,241,107,245,112,168,210,10,5,117,1,57,108,248,212,145,119,226,165,5,141,202,106,0,60,36,61,243,203,216,215,12,137,16,28,247,115,152,181,119,208,228,203,236,34,167,196,32,109,1,17,101,200,25,94,125,168,137,157,4,164,29,31,48,132,72,229,126,186,68,76,133,21,0,180,139,164,148,119,149,214,120,177,201,80,80,105,10,136,118,77,46,233,233,227,11,158,103,167,216, }; +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 250, 5, 108, 106, 254, 164, 217, 44, 53, 98, 93, 63, 147, 104, + 252, 133, 245, 28, 95, 100, 147, 41, 33, 92, 87, 25, 142, 151, 74, + 151, 95, 94, 7, 146, 237, 45, 167, 86, 42, 116, 224, 169, 234, 220, + 23, 176, 18, 13, 178, 79, 160, 160, 110, 15, 53, 206, 151, 158, 22, + 117, 184, 48, 170, 82, 40, 53, 122, 69, 180, 110, 38, 65, 104, 244, + 19, 238, 227, 88, 169, 164, 146, 63, 37, 183, 85, 71, 235, 168, 114, + 211, 105, 221, 156, 60, 18, 230, 2, 142, 172, 16, 39, 33, 126, 106, + 99, 188, 234, 41, 162, 197, 138, 227, 80, 12, 54, 67, 238, 5, 93, + 1, 207, 129, 13, 46, 115, 49, 58, 185, 127, 156, 200, 96, 217, 202, + 15, 245, 55, 198, 81, 218, 132, 70, 73, 82, 147, 26, 255, 14, 134, + 96, 138, 55, 214, 83, 156, 170, 163, 79, 173, 228, 115, 51, 241, 107, + 245, 112, 168, 210, 10, 5, 117, 1, 57, 108, 248, 212, 145, 119, 226, + 165, 5, 141, 202, 106, 0, 60, 36, 61, 243, 203, 216, 215, 12, 137, + 16, 28, 247, 115, 152, 181, 119, 208, 228, 203, 236, 34, 167, 196, 32, + 109, 1, 17, 101, 200, 25, 94, 125, 168, 137, 157, 4, 164, 29, 31, + 48, 132, 72, 229, 126, 186, 68, 76, 133, 21, 0, 180, 139, 164, 148, + 119, 149, 214, 120, 177, 201, 80, 80, 105, 10, 136, 118, 77, 46, 233, + 233, 227, 11, 158, 103, 167, 216, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_gridded_correction_dep_a_t* test_msg = ( msg_ssr_gridded_correction_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.iod_atmo = 245; - test_msg->header.num_msgs = 37695; - test_msg->header.seq_num = 64616; - test_msg->header.time.tow = 892131748; - test_msg->header.time.wn = 23906; - test_msg->header.tropo_quality_indicator = 28; - test_msg->header.update_interval = 133; - test_msg->index = 25695; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[0].residual = -26738; - test_msg->stec_residuals[0].stddev = 74; - test_msg->stec_residuals[0].sv_id.constellation = 25; - test_msg->stec_residuals[0].sv_id.satId = 87; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[1].residual = 1886; - test_msg->stec_residuals[1].stddev = 146; - test_msg->stec_residuals[1].sv_id.constellation = 95; - test_msg->stec_residuals[1].sv_id.satId = 151; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[2].residual = 22183; - test_msg->stec_residuals[2].stddev = 42; - test_msg->stec_residuals[2].sv_id.constellation = 45; - test_msg->stec_residuals[2].sv_id.satId = 237; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[3].residual = -5463; - test_msg->stec_residuals[3].stddev = 220; - test_msg->stec_residuals[3].sv_id.constellation = 224; - test_msg->stec_residuals[3].sv_id.satId = 116; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[4].residual = 3346; - test_msg->stec_residuals[4].stddev = 178; - test_msg->stec_residuals[4].sv_id.constellation = 176; - test_msg->stec_residuals[4].sv_id.satId = 23; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[5].residual = 28320; - test_msg->stec_residuals[5].stddev = 15; - test_msg->stec_residuals[5].sv_id.constellation = 160; - test_msg->stec_residuals[5].sv_id.satId = 79; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[6].residual = -24937; - test_msg->stec_residuals[6].stddev = 22; - test_msg->stec_residuals[6].sv_id.constellation = 206; - test_msg->stec_residuals[6].sv_id.satId = 53; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[7].residual = -21968; - test_msg->stec_residuals[7].stddev = 82; - test_msg->stec_residuals[7].sv_id.constellation = 184; - test_msg->stec_residuals[7].sv_id.satId = 117; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[8].residual = 17786; - test_msg->stec_residuals[8].stddev = 180; - test_msg->stec_residuals[8].sv_id.constellation = 53; - test_msg->stec_residuals[8].sv_id.satId = 40; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[9].residual = 26689; - test_msg->stec_residuals[9].stddev = 244; - test_msg->stec_residuals[9].sv_id.constellation = 38; - test_msg->stec_residuals[9].sv_id.satId = 110; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[10].residual = 22755; - test_msg->stec_residuals[10].stddev = 169; - test_msg->stec_residuals[10].sv_id.constellation = 238; - test_msg->stec_residuals[10].sv_id.satId = 19; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[11].residual = 9535; - test_msg->stec_residuals[11].stddev = 183; - test_msg->stec_residuals[11].sv_id.constellation = 146; - test_msg->stec_residuals[11].sv_id.satId = 164; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[12].residual = -22293; - test_msg->stec_residuals[12].stddev = 114; - test_msg->stec_residuals[12].sv_id.constellation = 71; - test_msg->stec_residuals[12].sv_id.satId = 85; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[13].residual = -25379; - test_msg->stec_residuals[13].stddev = 60; - test_msg->stec_residuals[13].sv_id.constellation = 105; - test_msg->stec_residuals[13].sv_id.satId = 211; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[14].residual = -29182; - test_msg->stec_residuals[14].stddev = 172; - test_msg->stec_residuals[14].sv_id.constellation = 230; - test_msg->stec_residuals[14].sv_id.satId = 18; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[15].residual = 32289; - test_msg->stec_residuals[15].stddev = 106; - test_msg->stec_residuals[15].sv_id.constellation = 39; - test_msg->stec_residuals[15].sv_id.satId = 16; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[16].residual = 10730; - test_msg->stec_residuals[16].stddev = 162; - test_msg->stec_residuals[16].sv_id.constellation = 188; - test_msg->stec_residuals[16].sv_id.satId = 99; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[17].residual = 20707; - test_msg->stec_residuals[17].stddev = 12; - test_msg->stec_residuals[17].sv_id.constellation = 138; - test_msg->stec_residuals[17].sv_id.satId = 197; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[18].residual = 1518; - test_msg->stec_residuals[18].stddev = 93; - test_msg->stec_residuals[18].sv_id.constellation = 67; - test_msg->stec_residuals[18].sv_id.satId = 54; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[19].residual = 3457; - test_msg->stec_residuals[19].stddev = 46; - test_msg->stec_residuals[19].sv_id.constellation = 207; - test_msg->stec_residuals[19].sv_id.satId = 1; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[20].residual = -18118; - test_msg->stec_residuals[20].stddev = 127; - test_msg->stec_residuals[20].sv_id.constellation = 49; - test_msg->stec_residuals[20].sv_id.satId = 115; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[21].residual = -9888; - test_msg->stec_residuals[21].stddev = 202; - test_msg->stec_residuals[21].sv_id.constellation = 200; - test_msg->stec_residuals[21].sv_id.satId = 156; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[22].residual = -14793; - test_msg->stec_residuals[22].stddev = 81; - test_msg->stec_residuals[22].sv_id.constellation = 245; - test_msg->stec_residuals[22].sv_id.satId = 15; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[23].residual = 18758; - test_msg->stec_residuals[23].stddev = 82; - test_msg->stec_residuals[23].sv_id.constellation = 132; - test_msg->stec_residuals[23].sv_id.satId = 218; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[24].residual = 3839; - test_msg->stec_residuals[24].stddev = 134; - test_msg->stec_residuals[24].sv_id.constellation = 26; - test_msg->stec_residuals[24].sv_id.satId = 147; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[25].residual = -10697; - test_msg->stec_residuals[25].stddev = 83; - test_msg->stec_residuals[25].sv_id.constellation = 138; - test_msg->stec_residuals[25].sv_id.satId = 96; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[26].residual = 20387; - test_msg->stec_residuals[26].stddev = 173; - test_msg->stec_residuals[26].sv_id.constellation = 170; - test_msg->stec_residuals[26].sv_id.satId = 156; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[27].residual = -3789; - test_msg->stec_residuals[27].stddev = 107; - test_msg->stec_residuals[27].sv_id.constellation = 115; - test_msg->stec_residuals[27].sv_id.satId = 228; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[28].residual = -11608; - test_msg->stec_residuals[28].stddev = 10; - test_msg->stec_residuals[28].sv_id.constellation = 112; - test_msg->stec_residuals[28].sv_id.satId = 245; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[29].residual = 14593; - test_msg->stec_residuals[29].stddev = 108; - test_msg->stec_residuals[29].sv_id.constellation = 117; - test_msg->stec_residuals[29].sv_id.satId = 5; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[30].residual = 30609; - test_msg->stec_residuals[30].stddev = 226; - test_msg->stec_residuals[30].sv_id.constellation = 212; - test_msg->stec_residuals[30].sv_id.satId = 248; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[31].residual = -13683; - test_msg->stec_residuals[31].stddev = 106; - test_msg->stec_residuals[31].sv_id.constellation = 5; - test_msg->stec_residuals[31].sv_id.satId = 165; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[32].residual = 15652; - test_msg->stec_residuals[32].stddev = 243; - test_msg->stec_residuals[32].sv_id.constellation = 60; - test_msg->stec_residuals[32].sv_id.satId = 0; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[33].residual = 3287; - test_msg->stec_residuals[33].stddev = 137; - test_msg->stec_residuals[33].sv_id.constellation = 216; - test_msg->stec_residuals[33].sv_id.satId = 203; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[34].residual = 29687; - test_msg->stec_residuals[34].stddev = 152; - test_msg->stec_residuals[34].sv_id.constellation = 28; - test_msg->stec_residuals[34].sv_id.satId = 16; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[35].residual = -6960; - test_msg->stec_residuals[35].stddev = 203; - test_msg->stec_residuals[35].sv_id.constellation = 119; - test_msg->stec_residuals[35].sv_id.satId = 181; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[36].residual = -15193; - test_msg->stec_residuals[36].stddev = 32; - test_msg->stec_residuals[36].sv_id.constellation = 34; - test_msg->stec_residuals[36].sv_id.satId = 236; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[37].residual = 25873; - test_msg->stec_residuals[37].stddev = 200; - test_msg->stec_residuals[37].sv_id.constellation = 1; - test_msg->stec_residuals[37].sv_id.satId = 109; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[38].residual = -22403; - test_msg->stec_residuals[38].stddev = 137; - test_msg->stec_residuals[38].sv_id.constellation = 94; - test_msg->stec_residuals[38].sv_id.satId = 25; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[39].residual = 7588; - test_msg->stec_residuals[39].stddev = 31; - test_msg->stec_residuals[39].sv_id.constellation = 4; - test_msg->stec_residuals[39].sv_id.satId = 157; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[40].residual = -6840; - test_msg->stec_residuals[40].stddev = 126; - test_msg->stec_residuals[40].sv_id.constellation = 132; - test_msg->stec_residuals[40].sv_id.satId = 48; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[41].residual = -31412; - test_msg->stec_residuals[41].stddev = 21; - test_msg->stec_residuals[41].sv_id.constellation = 68; - test_msg->stec_residuals[41].sv_id.satId = 186; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[42].residual = -23413; - test_msg->stec_residuals[42].stddev = 148; - test_msg->stec_residuals[42].sv_id.constellation = 180; - test_msg->stec_residuals[42].sv_id.satId = 0; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[43].residual = 30934; - test_msg->stec_residuals[43].stddev = 177; - test_msg->stec_residuals[43].sv_id.constellation = 149; - test_msg->stec_residuals[43].sv_id.satId = 119; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[44].residual = 26960; - test_msg->stec_residuals[44].stddev = 10; - test_msg->stec_residuals[44].sv_id.constellation = 80; - test_msg->stec_residuals[44].sv_id.satId = 201; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[45].residual = 11853; - test_msg->stec_residuals[45].stddev = 233; - test_msg->stec_residuals[45].sv_id.constellation = 118; - test_msg->stec_residuals[45].sv_id.satId = 136; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[46].residual = -25077; - test_msg->stec_residuals[46].stddev = 103; - test_msg->stec_residuals[46].sv_id.constellation = 227; - test_msg->stec_residuals[46].sv_id.satId = 233; - test_msg->tropo_delay_correction.hydro = 10643; - test_msg->tropo_delay_correction.stddev = 92; - test_msg->tropo_delay_correction.wet = 33; - - EXPECT_EQ(send_message( 0x5fa, 27244, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_gridded_correction_dep_a_t *test_msg = + (msg_ssr_gridded_correction_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.iod_atmo = 245; + test_msg->header.num_msgs = 37695; + test_msg->header.seq_num = 64616; + test_msg->header.time.tow = 892131748; + test_msg->header.time.wn = 23906; + test_msg->header.tropo_quality_indicator = 28; + test_msg->header.update_interval = 133; + test_msg->index = 25695; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[0].residual = -26738; + test_msg->stec_residuals[0].stddev = 74; + test_msg->stec_residuals[0].sv_id.constellation = 25; + test_msg->stec_residuals[0].sv_id.satId = 87; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[1].residual = 1886; + test_msg->stec_residuals[1].stddev = 146; + test_msg->stec_residuals[1].sv_id.constellation = 95; + test_msg->stec_residuals[1].sv_id.satId = 151; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[2].residual = 22183; + test_msg->stec_residuals[2].stddev = 42; + test_msg->stec_residuals[2].sv_id.constellation = 45; + test_msg->stec_residuals[2].sv_id.satId = 237; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[3].residual = -5463; + test_msg->stec_residuals[3].stddev = 220; + test_msg->stec_residuals[3].sv_id.constellation = 224; + test_msg->stec_residuals[3].sv_id.satId = 116; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[4].residual = 3346; + test_msg->stec_residuals[4].stddev = 178; + test_msg->stec_residuals[4].sv_id.constellation = 176; + test_msg->stec_residuals[4].sv_id.satId = 23; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[5].residual = 28320; + test_msg->stec_residuals[5].stddev = 15; + test_msg->stec_residuals[5].sv_id.constellation = 160; + test_msg->stec_residuals[5].sv_id.satId = 79; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[6].residual = -24937; + test_msg->stec_residuals[6].stddev = 22; + test_msg->stec_residuals[6].sv_id.constellation = 206; + test_msg->stec_residuals[6].sv_id.satId = 53; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[7].residual = -21968; + test_msg->stec_residuals[7].stddev = 82; + test_msg->stec_residuals[7].sv_id.constellation = 184; + test_msg->stec_residuals[7].sv_id.satId = 117; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[8].residual = 17786; + test_msg->stec_residuals[8].stddev = 180; + test_msg->stec_residuals[8].sv_id.constellation = 53; + test_msg->stec_residuals[8].sv_id.satId = 40; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[9].residual = 26689; + test_msg->stec_residuals[9].stddev = 244; + test_msg->stec_residuals[9].sv_id.constellation = 38; + test_msg->stec_residuals[9].sv_id.satId = 110; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[10].residual = 22755; + test_msg->stec_residuals[10].stddev = 169; + test_msg->stec_residuals[10].sv_id.constellation = 238; + test_msg->stec_residuals[10].sv_id.satId = 19; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[11].residual = 9535; + test_msg->stec_residuals[11].stddev = 183; + test_msg->stec_residuals[11].sv_id.constellation = 146; + test_msg->stec_residuals[11].sv_id.satId = 164; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[12].residual = -22293; + test_msg->stec_residuals[12].stddev = 114; + test_msg->stec_residuals[12].sv_id.constellation = 71; + test_msg->stec_residuals[12].sv_id.satId = 85; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[13].residual = -25379; + test_msg->stec_residuals[13].stddev = 60; + test_msg->stec_residuals[13].sv_id.constellation = 105; + test_msg->stec_residuals[13].sv_id.satId = 211; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[14].residual = -29182; + test_msg->stec_residuals[14].stddev = 172; + test_msg->stec_residuals[14].sv_id.constellation = 230; + test_msg->stec_residuals[14].sv_id.satId = 18; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[15].residual = 32289; + test_msg->stec_residuals[15].stddev = 106; + test_msg->stec_residuals[15].sv_id.constellation = 39; + test_msg->stec_residuals[15].sv_id.satId = 16; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[16].residual = 10730; + test_msg->stec_residuals[16].stddev = 162; + test_msg->stec_residuals[16].sv_id.constellation = 188; + test_msg->stec_residuals[16].sv_id.satId = 99; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[17].residual = 20707; + test_msg->stec_residuals[17].stddev = 12; + test_msg->stec_residuals[17].sv_id.constellation = 138; + test_msg->stec_residuals[17].sv_id.satId = 197; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[18].residual = 1518; + test_msg->stec_residuals[18].stddev = 93; + test_msg->stec_residuals[18].sv_id.constellation = 67; + test_msg->stec_residuals[18].sv_id.satId = 54; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[19].residual = 3457; + test_msg->stec_residuals[19].stddev = 46; + test_msg->stec_residuals[19].sv_id.constellation = 207; + test_msg->stec_residuals[19].sv_id.satId = 1; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[20].residual = -18118; + test_msg->stec_residuals[20].stddev = 127; + test_msg->stec_residuals[20].sv_id.constellation = 49; + test_msg->stec_residuals[20].sv_id.satId = 115; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[21].residual = -9888; + test_msg->stec_residuals[21].stddev = 202; + test_msg->stec_residuals[21].sv_id.constellation = 200; + test_msg->stec_residuals[21].sv_id.satId = 156; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[22].residual = -14793; + test_msg->stec_residuals[22].stddev = 81; + test_msg->stec_residuals[22].sv_id.constellation = 245; + test_msg->stec_residuals[22].sv_id.satId = 15; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[23].residual = 18758; + test_msg->stec_residuals[23].stddev = 82; + test_msg->stec_residuals[23].sv_id.constellation = 132; + test_msg->stec_residuals[23].sv_id.satId = 218; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[24].residual = 3839; + test_msg->stec_residuals[24].stddev = 134; + test_msg->stec_residuals[24].sv_id.constellation = 26; + test_msg->stec_residuals[24].sv_id.satId = 147; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[25].residual = -10697; + test_msg->stec_residuals[25].stddev = 83; + test_msg->stec_residuals[25].sv_id.constellation = 138; + test_msg->stec_residuals[25].sv_id.satId = 96; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[26].residual = 20387; + test_msg->stec_residuals[26].stddev = 173; + test_msg->stec_residuals[26].sv_id.constellation = 170; + test_msg->stec_residuals[26].sv_id.satId = 156; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[27].residual = -3789; + test_msg->stec_residuals[27].stddev = 107; + test_msg->stec_residuals[27].sv_id.constellation = 115; + test_msg->stec_residuals[27].sv_id.satId = 228; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[28].residual = -11608; + test_msg->stec_residuals[28].stddev = 10; + test_msg->stec_residuals[28].sv_id.constellation = 112; + test_msg->stec_residuals[28].sv_id.satId = 245; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[29].residual = 14593; + test_msg->stec_residuals[29].stddev = 108; + test_msg->stec_residuals[29].sv_id.constellation = 117; + test_msg->stec_residuals[29].sv_id.satId = 5; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[30].residual = 30609; + test_msg->stec_residuals[30].stddev = 226; + test_msg->stec_residuals[30].sv_id.constellation = 212; + test_msg->stec_residuals[30].sv_id.satId = 248; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[31].residual = -13683; + test_msg->stec_residuals[31].stddev = 106; + test_msg->stec_residuals[31].sv_id.constellation = 5; + test_msg->stec_residuals[31].sv_id.satId = 165; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[32].residual = 15652; + test_msg->stec_residuals[32].stddev = 243; + test_msg->stec_residuals[32].sv_id.constellation = 60; + test_msg->stec_residuals[32].sv_id.satId = 0; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[33].residual = 3287; + test_msg->stec_residuals[33].stddev = 137; + test_msg->stec_residuals[33].sv_id.constellation = 216; + test_msg->stec_residuals[33].sv_id.satId = 203; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[34].residual = 29687; + test_msg->stec_residuals[34].stddev = 152; + test_msg->stec_residuals[34].sv_id.constellation = 28; + test_msg->stec_residuals[34].sv_id.satId = 16; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[35].residual = -6960; + test_msg->stec_residuals[35].stddev = 203; + test_msg->stec_residuals[35].sv_id.constellation = 119; + test_msg->stec_residuals[35].sv_id.satId = 181; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[36].residual = -15193; + test_msg->stec_residuals[36].stddev = 32; + test_msg->stec_residuals[36].sv_id.constellation = 34; + test_msg->stec_residuals[36].sv_id.satId = 236; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[37].residual = 25873; + test_msg->stec_residuals[37].stddev = 200; + test_msg->stec_residuals[37].sv_id.constellation = 1; + test_msg->stec_residuals[37].sv_id.satId = 109; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[38].residual = -22403; + test_msg->stec_residuals[38].stddev = 137; + test_msg->stec_residuals[38].sv_id.constellation = 94; + test_msg->stec_residuals[38].sv_id.satId = 25; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[39].residual = 7588; + test_msg->stec_residuals[39].stddev = 31; + test_msg->stec_residuals[39].sv_id.constellation = 4; + test_msg->stec_residuals[39].sv_id.satId = 157; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[40].residual = -6840; + test_msg->stec_residuals[40].stddev = 126; + test_msg->stec_residuals[40].sv_id.constellation = 132; + test_msg->stec_residuals[40].sv_id.satId = 48; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[41].residual = -31412; + test_msg->stec_residuals[41].stddev = 21; + test_msg->stec_residuals[41].sv_id.constellation = 68; + test_msg->stec_residuals[41].sv_id.satId = 186; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[42].residual = -23413; + test_msg->stec_residuals[42].stddev = 148; + test_msg->stec_residuals[42].sv_id.constellation = 180; + test_msg->stec_residuals[42].sv_id.satId = 0; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[43].residual = 30934; + test_msg->stec_residuals[43].stddev = 177; + test_msg->stec_residuals[43].sv_id.constellation = 149; + test_msg->stec_residuals[43].sv_id.satId = 119; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[44].residual = 26960; + test_msg->stec_residuals[44].stddev = 10; + test_msg->stec_residuals[44].sv_id.constellation = 80; + test_msg->stec_residuals[44].sv_id.satId = 201; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[45].residual = 11853; + test_msg->stec_residuals[45].stddev = 233; + test_msg->stec_residuals[45].sv_id.constellation = 118; + test_msg->stec_residuals[45].sv_id.satId = 136; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[46].residual = -25077; + test_msg->stec_residuals[46].stddev = 103; + test_msg->stec_residuals[46].sv_id.constellation = 227; + test_msg->stec_residuals[46].sv_id.satId = 233; + test_msg->tropo_delay_correction.hydro = 10643; + test_msg->tropo_delay_correction.stddev = 92; + test_msg->tropo_delay_correction.wet = 33; + + EXPECT_EQ(send_message(0x5fa, 27244, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 27244); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.iod_atmo, 245) << "incorrect value for header.iod_atmo, expected 245, is " << last_msg_->header.iod_atmo; - EXPECT_EQ(last_msg_->header.num_msgs, 37695) << "incorrect value for header.num_msgs, expected 37695, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.seq_num, 64616) << "incorrect value for header.seq_num, expected 64616, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->header.time.tow, 892131748) << "incorrect value for header.time.tow, expected 892131748, is " << last_msg_->header.time.tow; - EXPECT_EQ(last_msg_->header.time.wn, 23906) << "incorrect value for header.time.wn, expected 23906, is " << last_msg_->header.time.wn; - EXPECT_EQ(last_msg_->header.tropo_quality_indicator, 28) << "incorrect value for header.tropo_quality_indicator, expected 28, is " << last_msg_->header.tropo_quality_indicator; - EXPECT_EQ(last_msg_->header.update_interval, 133) << "incorrect value for header.update_interval, expected 133, is " << last_msg_->header.update_interval; - EXPECT_EQ(last_msg_->index, 25695) << "incorrect value for index, expected 25695, is " << last_msg_->index; - EXPECT_EQ(last_msg_->stec_residuals[0].residual, -26738) << "incorrect value for stec_residuals[0].residual, expected -26738, is " << last_msg_->stec_residuals[0].residual; - EXPECT_EQ(last_msg_->stec_residuals[0].stddev, 74) << "incorrect value for stec_residuals[0].stddev, expected 74, is " << last_msg_->stec_residuals[0].stddev; - EXPECT_EQ(last_msg_->stec_residuals[0].sv_id.constellation, 25) << "incorrect value for stec_residuals[0].sv_id.constellation, expected 25, is " << last_msg_->stec_residuals[0].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[0].sv_id.satId, 87) << "incorrect value for stec_residuals[0].sv_id.satId, expected 87, is " << last_msg_->stec_residuals[0].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[1].residual, 1886) << "incorrect value for stec_residuals[1].residual, expected 1886, is " << last_msg_->stec_residuals[1].residual; - EXPECT_EQ(last_msg_->stec_residuals[1].stddev, 146) << "incorrect value for stec_residuals[1].stddev, expected 146, is " << last_msg_->stec_residuals[1].stddev; - EXPECT_EQ(last_msg_->stec_residuals[1].sv_id.constellation, 95) << "incorrect value for stec_residuals[1].sv_id.constellation, expected 95, is " << last_msg_->stec_residuals[1].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[1].sv_id.satId, 151) << "incorrect value for stec_residuals[1].sv_id.satId, expected 151, is " << last_msg_->stec_residuals[1].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[2].residual, 22183) << "incorrect value for stec_residuals[2].residual, expected 22183, is " << last_msg_->stec_residuals[2].residual; - EXPECT_EQ(last_msg_->stec_residuals[2].stddev, 42) << "incorrect value for stec_residuals[2].stddev, expected 42, is " << last_msg_->stec_residuals[2].stddev; - EXPECT_EQ(last_msg_->stec_residuals[2].sv_id.constellation, 45) << "incorrect value for stec_residuals[2].sv_id.constellation, expected 45, is " << last_msg_->stec_residuals[2].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[2].sv_id.satId, 237) << "incorrect value for stec_residuals[2].sv_id.satId, expected 237, is " << last_msg_->stec_residuals[2].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[3].residual, -5463) << "incorrect value for stec_residuals[3].residual, expected -5463, is " << last_msg_->stec_residuals[3].residual; - EXPECT_EQ(last_msg_->stec_residuals[3].stddev, 220) << "incorrect value for stec_residuals[3].stddev, expected 220, is " << last_msg_->stec_residuals[3].stddev; - EXPECT_EQ(last_msg_->stec_residuals[3].sv_id.constellation, 224) << "incorrect value for stec_residuals[3].sv_id.constellation, expected 224, is " << last_msg_->stec_residuals[3].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[3].sv_id.satId, 116) << "incorrect value for stec_residuals[3].sv_id.satId, expected 116, is " << last_msg_->stec_residuals[3].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[4].residual, 3346) << "incorrect value for stec_residuals[4].residual, expected 3346, is " << last_msg_->stec_residuals[4].residual; - EXPECT_EQ(last_msg_->stec_residuals[4].stddev, 178) << "incorrect value for stec_residuals[4].stddev, expected 178, is " << last_msg_->stec_residuals[4].stddev; - EXPECT_EQ(last_msg_->stec_residuals[4].sv_id.constellation, 176) << "incorrect value for stec_residuals[4].sv_id.constellation, expected 176, is " << last_msg_->stec_residuals[4].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[4].sv_id.satId, 23) << "incorrect value for stec_residuals[4].sv_id.satId, expected 23, is " << last_msg_->stec_residuals[4].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[5].residual, 28320) << "incorrect value for stec_residuals[5].residual, expected 28320, is " << last_msg_->stec_residuals[5].residual; - EXPECT_EQ(last_msg_->stec_residuals[5].stddev, 15) << "incorrect value for stec_residuals[5].stddev, expected 15, is " << last_msg_->stec_residuals[5].stddev; - EXPECT_EQ(last_msg_->stec_residuals[5].sv_id.constellation, 160) << "incorrect value for stec_residuals[5].sv_id.constellation, expected 160, is " << last_msg_->stec_residuals[5].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[5].sv_id.satId, 79) << "incorrect value for stec_residuals[5].sv_id.satId, expected 79, is " << last_msg_->stec_residuals[5].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[6].residual, -24937) << "incorrect value for stec_residuals[6].residual, expected -24937, is " << last_msg_->stec_residuals[6].residual; - EXPECT_EQ(last_msg_->stec_residuals[6].stddev, 22) << "incorrect value for stec_residuals[6].stddev, expected 22, is " << last_msg_->stec_residuals[6].stddev; - EXPECT_EQ(last_msg_->stec_residuals[6].sv_id.constellation, 206) << "incorrect value for stec_residuals[6].sv_id.constellation, expected 206, is " << last_msg_->stec_residuals[6].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[6].sv_id.satId, 53) << "incorrect value for stec_residuals[6].sv_id.satId, expected 53, is " << last_msg_->stec_residuals[6].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[7].residual, -21968) << "incorrect value for stec_residuals[7].residual, expected -21968, is " << last_msg_->stec_residuals[7].residual; - EXPECT_EQ(last_msg_->stec_residuals[7].stddev, 82) << "incorrect value for stec_residuals[7].stddev, expected 82, is " << last_msg_->stec_residuals[7].stddev; - EXPECT_EQ(last_msg_->stec_residuals[7].sv_id.constellation, 184) << "incorrect value for stec_residuals[7].sv_id.constellation, expected 184, is " << last_msg_->stec_residuals[7].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[7].sv_id.satId, 117) << "incorrect value for stec_residuals[7].sv_id.satId, expected 117, is " << last_msg_->stec_residuals[7].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[8].residual, 17786) << "incorrect value for stec_residuals[8].residual, expected 17786, is " << last_msg_->stec_residuals[8].residual; - EXPECT_EQ(last_msg_->stec_residuals[8].stddev, 180) << "incorrect value for stec_residuals[8].stddev, expected 180, is " << last_msg_->stec_residuals[8].stddev; - EXPECT_EQ(last_msg_->stec_residuals[8].sv_id.constellation, 53) << "incorrect value for stec_residuals[8].sv_id.constellation, expected 53, is " << last_msg_->stec_residuals[8].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[8].sv_id.satId, 40) << "incorrect value for stec_residuals[8].sv_id.satId, expected 40, is " << last_msg_->stec_residuals[8].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[9].residual, 26689) << "incorrect value for stec_residuals[9].residual, expected 26689, is " << last_msg_->stec_residuals[9].residual; - EXPECT_EQ(last_msg_->stec_residuals[9].stddev, 244) << "incorrect value for stec_residuals[9].stddev, expected 244, is " << last_msg_->stec_residuals[9].stddev; - EXPECT_EQ(last_msg_->stec_residuals[9].sv_id.constellation, 38) << "incorrect value for stec_residuals[9].sv_id.constellation, expected 38, is " << last_msg_->stec_residuals[9].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[9].sv_id.satId, 110) << "incorrect value for stec_residuals[9].sv_id.satId, expected 110, is " << last_msg_->stec_residuals[9].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[10].residual, 22755) << "incorrect value for stec_residuals[10].residual, expected 22755, is " << last_msg_->stec_residuals[10].residual; - EXPECT_EQ(last_msg_->stec_residuals[10].stddev, 169) << "incorrect value for stec_residuals[10].stddev, expected 169, is " << last_msg_->stec_residuals[10].stddev; - EXPECT_EQ(last_msg_->stec_residuals[10].sv_id.constellation, 238) << "incorrect value for stec_residuals[10].sv_id.constellation, expected 238, is " << last_msg_->stec_residuals[10].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[10].sv_id.satId, 19) << "incorrect value for stec_residuals[10].sv_id.satId, expected 19, is " << last_msg_->stec_residuals[10].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[11].residual, 9535) << "incorrect value for stec_residuals[11].residual, expected 9535, is " << last_msg_->stec_residuals[11].residual; - EXPECT_EQ(last_msg_->stec_residuals[11].stddev, 183) << "incorrect value for stec_residuals[11].stddev, expected 183, is " << last_msg_->stec_residuals[11].stddev; - EXPECT_EQ(last_msg_->stec_residuals[11].sv_id.constellation, 146) << "incorrect value for stec_residuals[11].sv_id.constellation, expected 146, is " << last_msg_->stec_residuals[11].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[11].sv_id.satId, 164) << "incorrect value for stec_residuals[11].sv_id.satId, expected 164, is " << last_msg_->stec_residuals[11].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[12].residual, -22293) << "incorrect value for stec_residuals[12].residual, expected -22293, is " << last_msg_->stec_residuals[12].residual; - EXPECT_EQ(last_msg_->stec_residuals[12].stddev, 114) << "incorrect value for stec_residuals[12].stddev, expected 114, is " << last_msg_->stec_residuals[12].stddev; - EXPECT_EQ(last_msg_->stec_residuals[12].sv_id.constellation, 71) << "incorrect value for stec_residuals[12].sv_id.constellation, expected 71, is " << last_msg_->stec_residuals[12].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[12].sv_id.satId, 85) << "incorrect value for stec_residuals[12].sv_id.satId, expected 85, is " << last_msg_->stec_residuals[12].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[13].residual, -25379) << "incorrect value for stec_residuals[13].residual, expected -25379, is " << last_msg_->stec_residuals[13].residual; - EXPECT_EQ(last_msg_->stec_residuals[13].stddev, 60) << "incorrect value for stec_residuals[13].stddev, expected 60, is " << last_msg_->stec_residuals[13].stddev; - EXPECT_EQ(last_msg_->stec_residuals[13].sv_id.constellation, 105) << "incorrect value for stec_residuals[13].sv_id.constellation, expected 105, is " << last_msg_->stec_residuals[13].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[13].sv_id.satId, 211) << "incorrect value for stec_residuals[13].sv_id.satId, expected 211, is " << last_msg_->stec_residuals[13].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[14].residual, -29182) << "incorrect value for stec_residuals[14].residual, expected -29182, is " << last_msg_->stec_residuals[14].residual; - EXPECT_EQ(last_msg_->stec_residuals[14].stddev, 172) << "incorrect value for stec_residuals[14].stddev, expected 172, is " << last_msg_->stec_residuals[14].stddev; - EXPECT_EQ(last_msg_->stec_residuals[14].sv_id.constellation, 230) << "incorrect value for stec_residuals[14].sv_id.constellation, expected 230, is " << last_msg_->stec_residuals[14].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[14].sv_id.satId, 18) << "incorrect value for stec_residuals[14].sv_id.satId, expected 18, is " << last_msg_->stec_residuals[14].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[15].residual, 32289) << "incorrect value for stec_residuals[15].residual, expected 32289, is " << last_msg_->stec_residuals[15].residual; - EXPECT_EQ(last_msg_->stec_residuals[15].stddev, 106) << "incorrect value for stec_residuals[15].stddev, expected 106, is " << last_msg_->stec_residuals[15].stddev; - EXPECT_EQ(last_msg_->stec_residuals[15].sv_id.constellation, 39) << "incorrect value for stec_residuals[15].sv_id.constellation, expected 39, is " << last_msg_->stec_residuals[15].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[15].sv_id.satId, 16) << "incorrect value for stec_residuals[15].sv_id.satId, expected 16, is " << last_msg_->stec_residuals[15].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[16].residual, 10730) << "incorrect value for stec_residuals[16].residual, expected 10730, is " << last_msg_->stec_residuals[16].residual; - EXPECT_EQ(last_msg_->stec_residuals[16].stddev, 162) << "incorrect value for stec_residuals[16].stddev, expected 162, is " << last_msg_->stec_residuals[16].stddev; - EXPECT_EQ(last_msg_->stec_residuals[16].sv_id.constellation, 188) << "incorrect value for stec_residuals[16].sv_id.constellation, expected 188, is " << last_msg_->stec_residuals[16].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[16].sv_id.satId, 99) << "incorrect value for stec_residuals[16].sv_id.satId, expected 99, is " << last_msg_->stec_residuals[16].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[17].residual, 20707) << "incorrect value for stec_residuals[17].residual, expected 20707, is " << last_msg_->stec_residuals[17].residual; - EXPECT_EQ(last_msg_->stec_residuals[17].stddev, 12) << "incorrect value for stec_residuals[17].stddev, expected 12, is " << last_msg_->stec_residuals[17].stddev; - EXPECT_EQ(last_msg_->stec_residuals[17].sv_id.constellation, 138) << "incorrect value for stec_residuals[17].sv_id.constellation, expected 138, is " << last_msg_->stec_residuals[17].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[17].sv_id.satId, 197) << "incorrect value for stec_residuals[17].sv_id.satId, expected 197, is " << last_msg_->stec_residuals[17].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[18].residual, 1518) << "incorrect value for stec_residuals[18].residual, expected 1518, is " << last_msg_->stec_residuals[18].residual; - EXPECT_EQ(last_msg_->stec_residuals[18].stddev, 93) << "incorrect value for stec_residuals[18].stddev, expected 93, is " << last_msg_->stec_residuals[18].stddev; - EXPECT_EQ(last_msg_->stec_residuals[18].sv_id.constellation, 67) << "incorrect value for stec_residuals[18].sv_id.constellation, expected 67, is " << last_msg_->stec_residuals[18].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[18].sv_id.satId, 54) << "incorrect value for stec_residuals[18].sv_id.satId, expected 54, is " << last_msg_->stec_residuals[18].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[19].residual, 3457) << "incorrect value for stec_residuals[19].residual, expected 3457, is " << last_msg_->stec_residuals[19].residual; - EXPECT_EQ(last_msg_->stec_residuals[19].stddev, 46) << "incorrect value for stec_residuals[19].stddev, expected 46, is " << last_msg_->stec_residuals[19].stddev; - EXPECT_EQ(last_msg_->stec_residuals[19].sv_id.constellation, 207) << "incorrect value for stec_residuals[19].sv_id.constellation, expected 207, is " << last_msg_->stec_residuals[19].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[19].sv_id.satId, 1) << "incorrect value for stec_residuals[19].sv_id.satId, expected 1, is " << last_msg_->stec_residuals[19].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[20].residual, -18118) << "incorrect value for stec_residuals[20].residual, expected -18118, is " << last_msg_->stec_residuals[20].residual; - EXPECT_EQ(last_msg_->stec_residuals[20].stddev, 127) << "incorrect value for stec_residuals[20].stddev, expected 127, is " << last_msg_->stec_residuals[20].stddev; - EXPECT_EQ(last_msg_->stec_residuals[20].sv_id.constellation, 49) << "incorrect value for stec_residuals[20].sv_id.constellation, expected 49, is " << last_msg_->stec_residuals[20].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[20].sv_id.satId, 115) << "incorrect value for stec_residuals[20].sv_id.satId, expected 115, is " << last_msg_->stec_residuals[20].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[21].residual, -9888) << "incorrect value for stec_residuals[21].residual, expected -9888, is " << last_msg_->stec_residuals[21].residual; - EXPECT_EQ(last_msg_->stec_residuals[21].stddev, 202) << "incorrect value for stec_residuals[21].stddev, expected 202, is " << last_msg_->stec_residuals[21].stddev; - EXPECT_EQ(last_msg_->stec_residuals[21].sv_id.constellation, 200) << "incorrect value for stec_residuals[21].sv_id.constellation, expected 200, is " << last_msg_->stec_residuals[21].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[21].sv_id.satId, 156) << "incorrect value for stec_residuals[21].sv_id.satId, expected 156, is " << last_msg_->stec_residuals[21].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[22].residual, -14793) << "incorrect value for stec_residuals[22].residual, expected -14793, is " << last_msg_->stec_residuals[22].residual; - EXPECT_EQ(last_msg_->stec_residuals[22].stddev, 81) << "incorrect value for stec_residuals[22].stddev, expected 81, is " << last_msg_->stec_residuals[22].stddev; - EXPECT_EQ(last_msg_->stec_residuals[22].sv_id.constellation, 245) << "incorrect value for stec_residuals[22].sv_id.constellation, expected 245, is " << last_msg_->stec_residuals[22].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[22].sv_id.satId, 15) << "incorrect value for stec_residuals[22].sv_id.satId, expected 15, is " << last_msg_->stec_residuals[22].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[23].residual, 18758) << "incorrect value for stec_residuals[23].residual, expected 18758, is " << last_msg_->stec_residuals[23].residual; - EXPECT_EQ(last_msg_->stec_residuals[23].stddev, 82) << "incorrect value for stec_residuals[23].stddev, expected 82, is " << last_msg_->stec_residuals[23].stddev; - EXPECT_EQ(last_msg_->stec_residuals[23].sv_id.constellation, 132) << "incorrect value for stec_residuals[23].sv_id.constellation, expected 132, is " << last_msg_->stec_residuals[23].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[23].sv_id.satId, 218) << "incorrect value for stec_residuals[23].sv_id.satId, expected 218, is " << last_msg_->stec_residuals[23].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[24].residual, 3839) << "incorrect value for stec_residuals[24].residual, expected 3839, is " << last_msg_->stec_residuals[24].residual; - EXPECT_EQ(last_msg_->stec_residuals[24].stddev, 134) << "incorrect value for stec_residuals[24].stddev, expected 134, is " << last_msg_->stec_residuals[24].stddev; - EXPECT_EQ(last_msg_->stec_residuals[24].sv_id.constellation, 26) << "incorrect value for stec_residuals[24].sv_id.constellation, expected 26, is " << last_msg_->stec_residuals[24].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[24].sv_id.satId, 147) << "incorrect value for stec_residuals[24].sv_id.satId, expected 147, is " << last_msg_->stec_residuals[24].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[25].residual, -10697) << "incorrect value for stec_residuals[25].residual, expected -10697, is " << last_msg_->stec_residuals[25].residual; - EXPECT_EQ(last_msg_->stec_residuals[25].stddev, 83) << "incorrect value for stec_residuals[25].stddev, expected 83, is " << last_msg_->stec_residuals[25].stddev; - EXPECT_EQ(last_msg_->stec_residuals[25].sv_id.constellation, 138) << "incorrect value for stec_residuals[25].sv_id.constellation, expected 138, is " << last_msg_->stec_residuals[25].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[25].sv_id.satId, 96) << "incorrect value for stec_residuals[25].sv_id.satId, expected 96, is " << last_msg_->stec_residuals[25].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[26].residual, 20387) << "incorrect value for stec_residuals[26].residual, expected 20387, is " << last_msg_->stec_residuals[26].residual; - EXPECT_EQ(last_msg_->stec_residuals[26].stddev, 173) << "incorrect value for stec_residuals[26].stddev, expected 173, is " << last_msg_->stec_residuals[26].stddev; - EXPECT_EQ(last_msg_->stec_residuals[26].sv_id.constellation, 170) << "incorrect value for stec_residuals[26].sv_id.constellation, expected 170, is " << last_msg_->stec_residuals[26].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[26].sv_id.satId, 156) << "incorrect value for stec_residuals[26].sv_id.satId, expected 156, is " << last_msg_->stec_residuals[26].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[27].residual, -3789) << "incorrect value for stec_residuals[27].residual, expected -3789, is " << last_msg_->stec_residuals[27].residual; - EXPECT_EQ(last_msg_->stec_residuals[27].stddev, 107) << "incorrect value for stec_residuals[27].stddev, expected 107, is " << last_msg_->stec_residuals[27].stddev; - EXPECT_EQ(last_msg_->stec_residuals[27].sv_id.constellation, 115) << "incorrect value for stec_residuals[27].sv_id.constellation, expected 115, is " << last_msg_->stec_residuals[27].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[27].sv_id.satId, 228) << "incorrect value for stec_residuals[27].sv_id.satId, expected 228, is " << last_msg_->stec_residuals[27].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[28].residual, -11608) << "incorrect value for stec_residuals[28].residual, expected -11608, is " << last_msg_->stec_residuals[28].residual; - EXPECT_EQ(last_msg_->stec_residuals[28].stddev, 10) << "incorrect value for stec_residuals[28].stddev, expected 10, is " << last_msg_->stec_residuals[28].stddev; - EXPECT_EQ(last_msg_->stec_residuals[28].sv_id.constellation, 112) << "incorrect value for stec_residuals[28].sv_id.constellation, expected 112, is " << last_msg_->stec_residuals[28].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[28].sv_id.satId, 245) << "incorrect value for stec_residuals[28].sv_id.satId, expected 245, is " << last_msg_->stec_residuals[28].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[29].residual, 14593) << "incorrect value for stec_residuals[29].residual, expected 14593, is " << last_msg_->stec_residuals[29].residual; - EXPECT_EQ(last_msg_->stec_residuals[29].stddev, 108) << "incorrect value for stec_residuals[29].stddev, expected 108, is " << last_msg_->stec_residuals[29].stddev; - EXPECT_EQ(last_msg_->stec_residuals[29].sv_id.constellation, 117) << "incorrect value for stec_residuals[29].sv_id.constellation, expected 117, is " << last_msg_->stec_residuals[29].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[29].sv_id.satId, 5) << "incorrect value for stec_residuals[29].sv_id.satId, expected 5, is " << last_msg_->stec_residuals[29].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[30].residual, 30609) << "incorrect value for stec_residuals[30].residual, expected 30609, is " << last_msg_->stec_residuals[30].residual; - EXPECT_EQ(last_msg_->stec_residuals[30].stddev, 226) << "incorrect value for stec_residuals[30].stddev, expected 226, is " << last_msg_->stec_residuals[30].stddev; - EXPECT_EQ(last_msg_->stec_residuals[30].sv_id.constellation, 212) << "incorrect value for stec_residuals[30].sv_id.constellation, expected 212, is " << last_msg_->stec_residuals[30].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[30].sv_id.satId, 248) << "incorrect value for stec_residuals[30].sv_id.satId, expected 248, is " << last_msg_->stec_residuals[30].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[31].residual, -13683) << "incorrect value for stec_residuals[31].residual, expected -13683, is " << last_msg_->stec_residuals[31].residual; - EXPECT_EQ(last_msg_->stec_residuals[31].stddev, 106) << "incorrect value for stec_residuals[31].stddev, expected 106, is " << last_msg_->stec_residuals[31].stddev; - EXPECT_EQ(last_msg_->stec_residuals[31].sv_id.constellation, 5) << "incorrect value for stec_residuals[31].sv_id.constellation, expected 5, is " << last_msg_->stec_residuals[31].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[31].sv_id.satId, 165) << "incorrect value for stec_residuals[31].sv_id.satId, expected 165, is " << last_msg_->stec_residuals[31].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[32].residual, 15652) << "incorrect value for stec_residuals[32].residual, expected 15652, is " << last_msg_->stec_residuals[32].residual; - EXPECT_EQ(last_msg_->stec_residuals[32].stddev, 243) << "incorrect value for stec_residuals[32].stddev, expected 243, is " << last_msg_->stec_residuals[32].stddev; - EXPECT_EQ(last_msg_->stec_residuals[32].sv_id.constellation, 60) << "incorrect value for stec_residuals[32].sv_id.constellation, expected 60, is " << last_msg_->stec_residuals[32].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[32].sv_id.satId, 0) << "incorrect value for stec_residuals[32].sv_id.satId, expected 0, is " << last_msg_->stec_residuals[32].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[33].residual, 3287) << "incorrect value for stec_residuals[33].residual, expected 3287, is " << last_msg_->stec_residuals[33].residual; - EXPECT_EQ(last_msg_->stec_residuals[33].stddev, 137) << "incorrect value for stec_residuals[33].stddev, expected 137, is " << last_msg_->stec_residuals[33].stddev; - EXPECT_EQ(last_msg_->stec_residuals[33].sv_id.constellation, 216) << "incorrect value for stec_residuals[33].sv_id.constellation, expected 216, is " << last_msg_->stec_residuals[33].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[33].sv_id.satId, 203) << "incorrect value for stec_residuals[33].sv_id.satId, expected 203, is " << last_msg_->stec_residuals[33].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[34].residual, 29687) << "incorrect value for stec_residuals[34].residual, expected 29687, is " << last_msg_->stec_residuals[34].residual; - EXPECT_EQ(last_msg_->stec_residuals[34].stddev, 152) << "incorrect value for stec_residuals[34].stddev, expected 152, is " << last_msg_->stec_residuals[34].stddev; - EXPECT_EQ(last_msg_->stec_residuals[34].sv_id.constellation, 28) << "incorrect value for stec_residuals[34].sv_id.constellation, expected 28, is " << last_msg_->stec_residuals[34].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[34].sv_id.satId, 16) << "incorrect value for stec_residuals[34].sv_id.satId, expected 16, is " << last_msg_->stec_residuals[34].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[35].residual, -6960) << "incorrect value for stec_residuals[35].residual, expected -6960, is " << last_msg_->stec_residuals[35].residual; - EXPECT_EQ(last_msg_->stec_residuals[35].stddev, 203) << "incorrect value for stec_residuals[35].stddev, expected 203, is " << last_msg_->stec_residuals[35].stddev; - EXPECT_EQ(last_msg_->stec_residuals[35].sv_id.constellation, 119) << "incorrect value for stec_residuals[35].sv_id.constellation, expected 119, is " << last_msg_->stec_residuals[35].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[35].sv_id.satId, 181) << "incorrect value for stec_residuals[35].sv_id.satId, expected 181, is " << last_msg_->stec_residuals[35].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[36].residual, -15193) << "incorrect value for stec_residuals[36].residual, expected -15193, is " << last_msg_->stec_residuals[36].residual; - EXPECT_EQ(last_msg_->stec_residuals[36].stddev, 32) << "incorrect value for stec_residuals[36].stddev, expected 32, is " << last_msg_->stec_residuals[36].stddev; - EXPECT_EQ(last_msg_->stec_residuals[36].sv_id.constellation, 34) << "incorrect value for stec_residuals[36].sv_id.constellation, expected 34, is " << last_msg_->stec_residuals[36].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[36].sv_id.satId, 236) << "incorrect value for stec_residuals[36].sv_id.satId, expected 236, is " << last_msg_->stec_residuals[36].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[37].residual, 25873) << "incorrect value for stec_residuals[37].residual, expected 25873, is " << last_msg_->stec_residuals[37].residual; - EXPECT_EQ(last_msg_->stec_residuals[37].stddev, 200) << "incorrect value for stec_residuals[37].stddev, expected 200, is " << last_msg_->stec_residuals[37].stddev; - EXPECT_EQ(last_msg_->stec_residuals[37].sv_id.constellation, 1) << "incorrect value for stec_residuals[37].sv_id.constellation, expected 1, is " << last_msg_->stec_residuals[37].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[37].sv_id.satId, 109) << "incorrect value for stec_residuals[37].sv_id.satId, expected 109, is " << last_msg_->stec_residuals[37].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[38].residual, -22403) << "incorrect value for stec_residuals[38].residual, expected -22403, is " << last_msg_->stec_residuals[38].residual; - EXPECT_EQ(last_msg_->stec_residuals[38].stddev, 137) << "incorrect value for stec_residuals[38].stddev, expected 137, is " << last_msg_->stec_residuals[38].stddev; - EXPECT_EQ(last_msg_->stec_residuals[38].sv_id.constellation, 94) << "incorrect value for stec_residuals[38].sv_id.constellation, expected 94, is " << last_msg_->stec_residuals[38].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[38].sv_id.satId, 25) << "incorrect value for stec_residuals[38].sv_id.satId, expected 25, is " << last_msg_->stec_residuals[38].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[39].residual, 7588) << "incorrect value for stec_residuals[39].residual, expected 7588, is " << last_msg_->stec_residuals[39].residual; - EXPECT_EQ(last_msg_->stec_residuals[39].stddev, 31) << "incorrect value for stec_residuals[39].stddev, expected 31, is " << last_msg_->stec_residuals[39].stddev; - EXPECT_EQ(last_msg_->stec_residuals[39].sv_id.constellation, 4) << "incorrect value for stec_residuals[39].sv_id.constellation, expected 4, is " << last_msg_->stec_residuals[39].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[39].sv_id.satId, 157) << "incorrect value for stec_residuals[39].sv_id.satId, expected 157, is " << last_msg_->stec_residuals[39].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[40].residual, -6840) << "incorrect value for stec_residuals[40].residual, expected -6840, is " << last_msg_->stec_residuals[40].residual; - EXPECT_EQ(last_msg_->stec_residuals[40].stddev, 126) << "incorrect value for stec_residuals[40].stddev, expected 126, is " << last_msg_->stec_residuals[40].stddev; - EXPECT_EQ(last_msg_->stec_residuals[40].sv_id.constellation, 132) << "incorrect value for stec_residuals[40].sv_id.constellation, expected 132, is " << last_msg_->stec_residuals[40].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[40].sv_id.satId, 48) << "incorrect value for stec_residuals[40].sv_id.satId, expected 48, is " << last_msg_->stec_residuals[40].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[41].residual, -31412) << "incorrect value for stec_residuals[41].residual, expected -31412, is " << last_msg_->stec_residuals[41].residual; - EXPECT_EQ(last_msg_->stec_residuals[41].stddev, 21) << "incorrect value for stec_residuals[41].stddev, expected 21, is " << last_msg_->stec_residuals[41].stddev; - EXPECT_EQ(last_msg_->stec_residuals[41].sv_id.constellation, 68) << "incorrect value for stec_residuals[41].sv_id.constellation, expected 68, is " << last_msg_->stec_residuals[41].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[41].sv_id.satId, 186) << "incorrect value for stec_residuals[41].sv_id.satId, expected 186, is " << last_msg_->stec_residuals[41].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[42].residual, -23413) << "incorrect value for stec_residuals[42].residual, expected -23413, is " << last_msg_->stec_residuals[42].residual; - EXPECT_EQ(last_msg_->stec_residuals[42].stddev, 148) << "incorrect value for stec_residuals[42].stddev, expected 148, is " << last_msg_->stec_residuals[42].stddev; - EXPECT_EQ(last_msg_->stec_residuals[42].sv_id.constellation, 180) << "incorrect value for stec_residuals[42].sv_id.constellation, expected 180, is " << last_msg_->stec_residuals[42].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[42].sv_id.satId, 0) << "incorrect value for stec_residuals[42].sv_id.satId, expected 0, is " << last_msg_->stec_residuals[42].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[43].residual, 30934) << "incorrect value for stec_residuals[43].residual, expected 30934, is " << last_msg_->stec_residuals[43].residual; - EXPECT_EQ(last_msg_->stec_residuals[43].stddev, 177) << "incorrect value for stec_residuals[43].stddev, expected 177, is " << last_msg_->stec_residuals[43].stddev; - EXPECT_EQ(last_msg_->stec_residuals[43].sv_id.constellation, 149) << "incorrect value for stec_residuals[43].sv_id.constellation, expected 149, is " << last_msg_->stec_residuals[43].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[43].sv_id.satId, 119) << "incorrect value for stec_residuals[43].sv_id.satId, expected 119, is " << last_msg_->stec_residuals[43].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[44].residual, 26960) << "incorrect value for stec_residuals[44].residual, expected 26960, is " << last_msg_->stec_residuals[44].residual; - EXPECT_EQ(last_msg_->stec_residuals[44].stddev, 10) << "incorrect value for stec_residuals[44].stddev, expected 10, is " << last_msg_->stec_residuals[44].stddev; - EXPECT_EQ(last_msg_->stec_residuals[44].sv_id.constellation, 80) << "incorrect value for stec_residuals[44].sv_id.constellation, expected 80, is " << last_msg_->stec_residuals[44].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[44].sv_id.satId, 201) << "incorrect value for stec_residuals[44].sv_id.satId, expected 201, is " << last_msg_->stec_residuals[44].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[45].residual, 11853) << "incorrect value for stec_residuals[45].residual, expected 11853, is " << last_msg_->stec_residuals[45].residual; - EXPECT_EQ(last_msg_->stec_residuals[45].stddev, 233) << "incorrect value for stec_residuals[45].stddev, expected 233, is " << last_msg_->stec_residuals[45].stddev; - EXPECT_EQ(last_msg_->stec_residuals[45].sv_id.constellation, 118) << "incorrect value for stec_residuals[45].sv_id.constellation, expected 118, is " << last_msg_->stec_residuals[45].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[45].sv_id.satId, 136) << "incorrect value for stec_residuals[45].sv_id.satId, expected 136, is " << last_msg_->stec_residuals[45].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[46].residual, -25077) << "incorrect value for stec_residuals[46].residual, expected -25077, is " << last_msg_->stec_residuals[46].residual; - EXPECT_EQ(last_msg_->stec_residuals[46].stddev, 103) << "incorrect value for stec_residuals[46].stddev, expected 103, is " << last_msg_->stec_residuals[46].stddev; - EXPECT_EQ(last_msg_->stec_residuals[46].sv_id.constellation, 227) << "incorrect value for stec_residuals[46].sv_id.constellation, expected 227, is " << last_msg_->stec_residuals[46].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[46].sv_id.satId, 233) << "incorrect value for stec_residuals[46].sv_id.satId, expected 233, is " << last_msg_->stec_residuals[46].sv_id.satId; - EXPECT_EQ(last_msg_->tropo_delay_correction.hydro, 10643) << "incorrect value for tropo_delay_correction.hydro, expected 10643, is " << last_msg_->tropo_delay_correction.hydro; - EXPECT_EQ(last_msg_->tropo_delay_correction.stddev, 92) << "incorrect value for tropo_delay_correction.stddev, expected 92, is " << last_msg_->tropo_delay_correction.stddev; - EXPECT_EQ(last_msg_->tropo_delay_correction.wet, 33) << "incorrect value for tropo_delay_correction.wet, expected 33, is " << last_msg_->tropo_delay_correction.wet; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 27244); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.iod_atmo, 245) + << "incorrect value for header.iod_atmo, expected 245, is " + << last_msg_->header.iod_atmo; + EXPECT_EQ(last_msg_->header.num_msgs, 37695) + << "incorrect value for header.num_msgs, expected 37695, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.seq_num, 64616) + << "incorrect value for header.seq_num, expected 64616, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->header.time.tow, 892131748) + << "incorrect value for header.time.tow, expected 892131748, is " + << last_msg_->header.time.tow; + EXPECT_EQ(last_msg_->header.time.wn, 23906) + << "incorrect value for header.time.wn, expected 23906, is " + << last_msg_->header.time.wn; + EXPECT_EQ(last_msg_->header.tropo_quality_indicator, 28) + << "incorrect value for header.tropo_quality_indicator, expected 28, is " + << last_msg_->header.tropo_quality_indicator; + EXPECT_EQ(last_msg_->header.update_interval, 133) + << "incorrect value for header.update_interval, expected 133, is " + << last_msg_->header.update_interval; + EXPECT_EQ(last_msg_->index, 25695) + << "incorrect value for index, expected 25695, is " << last_msg_->index; + EXPECT_EQ(last_msg_->stec_residuals[0].residual, -26738) + << "incorrect value for stec_residuals[0].residual, expected -26738, is " + << last_msg_->stec_residuals[0].residual; + EXPECT_EQ(last_msg_->stec_residuals[0].stddev, 74) + << "incorrect value for stec_residuals[0].stddev, expected 74, is " + << last_msg_->stec_residuals[0].stddev; + EXPECT_EQ(last_msg_->stec_residuals[0].sv_id.constellation, 25) + << "incorrect value for stec_residuals[0].sv_id.constellation, expected " + "25, is " + << last_msg_->stec_residuals[0].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[0].sv_id.satId, 87) + << "incorrect value for stec_residuals[0].sv_id.satId, expected 87, is " + << last_msg_->stec_residuals[0].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[1].residual, 1886) + << "incorrect value for stec_residuals[1].residual, expected 1886, is " + << last_msg_->stec_residuals[1].residual; + EXPECT_EQ(last_msg_->stec_residuals[1].stddev, 146) + << "incorrect value for stec_residuals[1].stddev, expected 146, is " + << last_msg_->stec_residuals[1].stddev; + EXPECT_EQ(last_msg_->stec_residuals[1].sv_id.constellation, 95) + << "incorrect value for stec_residuals[1].sv_id.constellation, expected " + "95, is " + << last_msg_->stec_residuals[1].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[1].sv_id.satId, 151) + << "incorrect value for stec_residuals[1].sv_id.satId, expected 151, is " + << last_msg_->stec_residuals[1].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[2].residual, 22183) + << "incorrect value for stec_residuals[2].residual, expected 22183, is " + << last_msg_->stec_residuals[2].residual; + EXPECT_EQ(last_msg_->stec_residuals[2].stddev, 42) + << "incorrect value for stec_residuals[2].stddev, expected 42, is " + << last_msg_->stec_residuals[2].stddev; + EXPECT_EQ(last_msg_->stec_residuals[2].sv_id.constellation, 45) + << "incorrect value for stec_residuals[2].sv_id.constellation, expected " + "45, is " + << last_msg_->stec_residuals[2].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[2].sv_id.satId, 237) + << "incorrect value for stec_residuals[2].sv_id.satId, expected 237, is " + << last_msg_->stec_residuals[2].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[3].residual, -5463) + << "incorrect value for stec_residuals[3].residual, expected -5463, is " + << last_msg_->stec_residuals[3].residual; + EXPECT_EQ(last_msg_->stec_residuals[3].stddev, 220) + << "incorrect value for stec_residuals[3].stddev, expected 220, is " + << last_msg_->stec_residuals[3].stddev; + EXPECT_EQ(last_msg_->stec_residuals[3].sv_id.constellation, 224) + << "incorrect value for stec_residuals[3].sv_id.constellation, expected " + "224, is " + << last_msg_->stec_residuals[3].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[3].sv_id.satId, 116) + << "incorrect value for stec_residuals[3].sv_id.satId, expected 116, is " + << last_msg_->stec_residuals[3].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[4].residual, 3346) + << "incorrect value for stec_residuals[4].residual, expected 3346, is " + << last_msg_->stec_residuals[4].residual; + EXPECT_EQ(last_msg_->stec_residuals[4].stddev, 178) + << "incorrect value for stec_residuals[4].stddev, expected 178, is " + << last_msg_->stec_residuals[4].stddev; + EXPECT_EQ(last_msg_->stec_residuals[4].sv_id.constellation, 176) + << "incorrect value for stec_residuals[4].sv_id.constellation, expected " + "176, is " + << last_msg_->stec_residuals[4].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[4].sv_id.satId, 23) + << "incorrect value for stec_residuals[4].sv_id.satId, expected 23, is " + << last_msg_->stec_residuals[4].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[5].residual, 28320) + << "incorrect value for stec_residuals[5].residual, expected 28320, is " + << last_msg_->stec_residuals[5].residual; + EXPECT_EQ(last_msg_->stec_residuals[5].stddev, 15) + << "incorrect value for stec_residuals[5].stddev, expected 15, is " + << last_msg_->stec_residuals[5].stddev; + EXPECT_EQ(last_msg_->stec_residuals[5].sv_id.constellation, 160) + << "incorrect value for stec_residuals[5].sv_id.constellation, expected " + "160, is " + << last_msg_->stec_residuals[5].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[5].sv_id.satId, 79) + << "incorrect value for stec_residuals[5].sv_id.satId, expected 79, is " + << last_msg_->stec_residuals[5].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[6].residual, -24937) + << "incorrect value for stec_residuals[6].residual, expected -24937, is " + << last_msg_->stec_residuals[6].residual; + EXPECT_EQ(last_msg_->stec_residuals[6].stddev, 22) + << "incorrect value for stec_residuals[6].stddev, expected 22, is " + << last_msg_->stec_residuals[6].stddev; + EXPECT_EQ(last_msg_->stec_residuals[6].sv_id.constellation, 206) + << "incorrect value for stec_residuals[6].sv_id.constellation, expected " + "206, is " + << last_msg_->stec_residuals[6].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[6].sv_id.satId, 53) + << "incorrect value for stec_residuals[6].sv_id.satId, expected 53, is " + << last_msg_->stec_residuals[6].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[7].residual, -21968) + << "incorrect value for stec_residuals[7].residual, expected -21968, is " + << last_msg_->stec_residuals[7].residual; + EXPECT_EQ(last_msg_->stec_residuals[7].stddev, 82) + << "incorrect value for stec_residuals[7].stddev, expected 82, is " + << last_msg_->stec_residuals[7].stddev; + EXPECT_EQ(last_msg_->stec_residuals[7].sv_id.constellation, 184) + << "incorrect value for stec_residuals[7].sv_id.constellation, expected " + "184, is " + << last_msg_->stec_residuals[7].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[7].sv_id.satId, 117) + << "incorrect value for stec_residuals[7].sv_id.satId, expected 117, is " + << last_msg_->stec_residuals[7].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[8].residual, 17786) + << "incorrect value for stec_residuals[8].residual, expected 17786, is " + << last_msg_->stec_residuals[8].residual; + EXPECT_EQ(last_msg_->stec_residuals[8].stddev, 180) + << "incorrect value for stec_residuals[8].stddev, expected 180, is " + << last_msg_->stec_residuals[8].stddev; + EXPECT_EQ(last_msg_->stec_residuals[8].sv_id.constellation, 53) + << "incorrect value for stec_residuals[8].sv_id.constellation, expected " + "53, is " + << last_msg_->stec_residuals[8].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[8].sv_id.satId, 40) + << "incorrect value for stec_residuals[8].sv_id.satId, expected 40, is " + << last_msg_->stec_residuals[8].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[9].residual, 26689) + << "incorrect value for stec_residuals[9].residual, expected 26689, is " + << last_msg_->stec_residuals[9].residual; + EXPECT_EQ(last_msg_->stec_residuals[9].stddev, 244) + << "incorrect value for stec_residuals[9].stddev, expected 244, is " + << last_msg_->stec_residuals[9].stddev; + EXPECT_EQ(last_msg_->stec_residuals[9].sv_id.constellation, 38) + << "incorrect value for stec_residuals[9].sv_id.constellation, expected " + "38, is " + << last_msg_->stec_residuals[9].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[9].sv_id.satId, 110) + << "incorrect value for stec_residuals[9].sv_id.satId, expected 110, is " + << last_msg_->stec_residuals[9].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[10].residual, 22755) + << "incorrect value for stec_residuals[10].residual, expected 22755, is " + << last_msg_->stec_residuals[10].residual; + EXPECT_EQ(last_msg_->stec_residuals[10].stddev, 169) + << "incorrect value for stec_residuals[10].stddev, expected 169, is " + << last_msg_->stec_residuals[10].stddev; + EXPECT_EQ(last_msg_->stec_residuals[10].sv_id.constellation, 238) + << "incorrect value for stec_residuals[10].sv_id.constellation, expected " + "238, is " + << last_msg_->stec_residuals[10].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[10].sv_id.satId, 19) + << "incorrect value for stec_residuals[10].sv_id.satId, expected 19, is " + << last_msg_->stec_residuals[10].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[11].residual, 9535) + << "incorrect value for stec_residuals[11].residual, expected 9535, is " + << last_msg_->stec_residuals[11].residual; + EXPECT_EQ(last_msg_->stec_residuals[11].stddev, 183) + << "incorrect value for stec_residuals[11].stddev, expected 183, is " + << last_msg_->stec_residuals[11].stddev; + EXPECT_EQ(last_msg_->stec_residuals[11].sv_id.constellation, 146) + << "incorrect value for stec_residuals[11].sv_id.constellation, expected " + "146, is " + << last_msg_->stec_residuals[11].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[11].sv_id.satId, 164) + << "incorrect value for stec_residuals[11].sv_id.satId, expected 164, is " + << last_msg_->stec_residuals[11].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[12].residual, -22293) + << "incorrect value for stec_residuals[12].residual, expected -22293, is " + << last_msg_->stec_residuals[12].residual; + EXPECT_EQ(last_msg_->stec_residuals[12].stddev, 114) + << "incorrect value for stec_residuals[12].stddev, expected 114, is " + << last_msg_->stec_residuals[12].stddev; + EXPECT_EQ(last_msg_->stec_residuals[12].sv_id.constellation, 71) + << "incorrect value for stec_residuals[12].sv_id.constellation, expected " + "71, is " + << last_msg_->stec_residuals[12].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[12].sv_id.satId, 85) + << "incorrect value for stec_residuals[12].sv_id.satId, expected 85, is " + << last_msg_->stec_residuals[12].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[13].residual, -25379) + << "incorrect value for stec_residuals[13].residual, expected -25379, is " + << last_msg_->stec_residuals[13].residual; + EXPECT_EQ(last_msg_->stec_residuals[13].stddev, 60) + << "incorrect value for stec_residuals[13].stddev, expected 60, is " + << last_msg_->stec_residuals[13].stddev; + EXPECT_EQ(last_msg_->stec_residuals[13].sv_id.constellation, 105) + << "incorrect value for stec_residuals[13].sv_id.constellation, expected " + "105, is " + << last_msg_->stec_residuals[13].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[13].sv_id.satId, 211) + << "incorrect value for stec_residuals[13].sv_id.satId, expected 211, is " + << last_msg_->stec_residuals[13].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[14].residual, -29182) + << "incorrect value for stec_residuals[14].residual, expected -29182, is " + << last_msg_->stec_residuals[14].residual; + EXPECT_EQ(last_msg_->stec_residuals[14].stddev, 172) + << "incorrect value for stec_residuals[14].stddev, expected 172, is " + << last_msg_->stec_residuals[14].stddev; + EXPECT_EQ(last_msg_->stec_residuals[14].sv_id.constellation, 230) + << "incorrect value for stec_residuals[14].sv_id.constellation, expected " + "230, is " + << last_msg_->stec_residuals[14].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[14].sv_id.satId, 18) + << "incorrect value for stec_residuals[14].sv_id.satId, expected 18, is " + << last_msg_->stec_residuals[14].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[15].residual, 32289) + << "incorrect value for stec_residuals[15].residual, expected 32289, is " + << last_msg_->stec_residuals[15].residual; + EXPECT_EQ(last_msg_->stec_residuals[15].stddev, 106) + << "incorrect value for stec_residuals[15].stddev, expected 106, is " + << last_msg_->stec_residuals[15].stddev; + EXPECT_EQ(last_msg_->stec_residuals[15].sv_id.constellation, 39) + << "incorrect value for stec_residuals[15].sv_id.constellation, expected " + "39, is " + << last_msg_->stec_residuals[15].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[15].sv_id.satId, 16) + << "incorrect value for stec_residuals[15].sv_id.satId, expected 16, is " + << last_msg_->stec_residuals[15].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[16].residual, 10730) + << "incorrect value for stec_residuals[16].residual, expected 10730, is " + << last_msg_->stec_residuals[16].residual; + EXPECT_EQ(last_msg_->stec_residuals[16].stddev, 162) + << "incorrect value for stec_residuals[16].stddev, expected 162, is " + << last_msg_->stec_residuals[16].stddev; + EXPECT_EQ(last_msg_->stec_residuals[16].sv_id.constellation, 188) + << "incorrect value for stec_residuals[16].sv_id.constellation, expected " + "188, is " + << last_msg_->stec_residuals[16].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[16].sv_id.satId, 99) + << "incorrect value for stec_residuals[16].sv_id.satId, expected 99, is " + << last_msg_->stec_residuals[16].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[17].residual, 20707) + << "incorrect value for stec_residuals[17].residual, expected 20707, is " + << last_msg_->stec_residuals[17].residual; + EXPECT_EQ(last_msg_->stec_residuals[17].stddev, 12) + << "incorrect value for stec_residuals[17].stddev, expected 12, is " + << last_msg_->stec_residuals[17].stddev; + EXPECT_EQ(last_msg_->stec_residuals[17].sv_id.constellation, 138) + << "incorrect value for stec_residuals[17].sv_id.constellation, expected " + "138, is " + << last_msg_->stec_residuals[17].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[17].sv_id.satId, 197) + << "incorrect value for stec_residuals[17].sv_id.satId, expected 197, is " + << last_msg_->stec_residuals[17].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[18].residual, 1518) + << "incorrect value for stec_residuals[18].residual, expected 1518, is " + << last_msg_->stec_residuals[18].residual; + EXPECT_EQ(last_msg_->stec_residuals[18].stddev, 93) + << "incorrect value for stec_residuals[18].stddev, expected 93, is " + << last_msg_->stec_residuals[18].stddev; + EXPECT_EQ(last_msg_->stec_residuals[18].sv_id.constellation, 67) + << "incorrect value for stec_residuals[18].sv_id.constellation, expected " + "67, is " + << last_msg_->stec_residuals[18].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[18].sv_id.satId, 54) + << "incorrect value for stec_residuals[18].sv_id.satId, expected 54, is " + << last_msg_->stec_residuals[18].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[19].residual, 3457) + << "incorrect value for stec_residuals[19].residual, expected 3457, is " + << last_msg_->stec_residuals[19].residual; + EXPECT_EQ(last_msg_->stec_residuals[19].stddev, 46) + << "incorrect value for stec_residuals[19].stddev, expected 46, is " + << last_msg_->stec_residuals[19].stddev; + EXPECT_EQ(last_msg_->stec_residuals[19].sv_id.constellation, 207) + << "incorrect value for stec_residuals[19].sv_id.constellation, expected " + "207, is " + << last_msg_->stec_residuals[19].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[19].sv_id.satId, 1) + << "incorrect value for stec_residuals[19].sv_id.satId, expected 1, is " + << last_msg_->stec_residuals[19].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[20].residual, -18118) + << "incorrect value for stec_residuals[20].residual, expected -18118, is " + << last_msg_->stec_residuals[20].residual; + EXPECT_EQ(last_msg_->stec_residuals[20].stddev, 127) + << "incorrect value for stec_residuals[20].stddev, expected 127, is " + << last_msg_->stec_residuals[20].stddev; + EXPECT_EQ(last_msg_->stec_residuals[20].sv_id.constellation, 49) + << "incorrect value for stec_residuals[20].sv_id.constellation, expected " + "49, is " + << last_msg_->stec_residuals[20].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[20].sv_id.satId, 115) + << "incorrect value for stec_residuals[20].sv_id.satId, expected 115, is " + << last_msg_->stec_residuals[20].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[21].residual, -9888) + << "incorrect value for stec_residuals[21].residual, expected -9888, is " + << last_msg_->stec_residuals[21].residual; + EXPECT_EQ(last_msg_->stec_residuals[21].stddev, 202) + << "incorrect value for stec_residuals[21].stddev, expected 202, is " + << last_msg_->stec_residuals[21].stddev; + EXPECT_EQ(last_msg_->stec_residuals[21].sv_id.constellation, 200) + << "incorrect value for stec_residuals[21].sv_id.constellation, expected " + "200, is " + << last_msg_->stec_residuals[21].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[21].sv_id.satId, 156) + << "incorrect value for stec_residuals[21].sv_id.satId, expected 156, is " + << last_msg_->stec_residuals[21].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[22].residual, -14793) + << "incorrect value for stec_residuals[22].residual, expected -14793, is " + << last_msg_->stec_residuals[22].residual; + EXPECT_EQ(last_msg_->stec_residuals[22].stddev, 81) + << "incorrect value for stec_residuals[22].stddev, expected 81, is " + << last_msg_->stec_residuals[22].stddev; + EXPECT_EQ(last_msg_->stec_residuals[22].sv_id.constellation, 245) + << "incorrect value for stec_residuals[22].sv_id.constellation, expected " + "245, is " + << last_msg_->stec_residuals[22].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[22].sv_id.satId, 15) + << "incorrect value for stec_residuals[22].sv_id.satId, expected 15, is " + << last_msg_->stec_residuals[22].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[23].residual, 18758) + << "incorrect value for stec_residuals[23].residual, expected 18758, is " + << last_msg_->stec_residuals[23].residual; + EXPECT_EQ(last_msg_->stec_residuals[23].stddev, 82) + << "incorrect value for stec_residuals[23].stddev, expected 82, is " + << last_msg_->stec_residuals[23].stddev; + EXPECT_EQ(last_msg_->stec_residuals[23].sv_id.constellation, 132) + << "incorrect value for stec_residuals[23].sv_id.constellation, expected " + "132, is " + << last_msg_->stec_residuals[23].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[23].sv_id.satId, 218) + << "incorrect value for stec_residuals[23].sv_id.satId, expected 218, is " + << last_msg_->stec_residuals[23].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[24].residual, 3839) + << "incorrect value for stec_residuals[24].residual, expected 3839, is " + << last_msg_->stec_residuals[24].residual; + EXPECT_EQ(last_msg_->stec_residuals[24].stddev, 134) + << "incorrect value for stec_residuals[24].stddev, expected 134, is " + << last_msg_->stec_residuals[24].stddev; + EXPECT_EQ(last_msg_->stec_residuals[24].sv_id.constellation, 26) + << "incorrect value for stec_residuals[24].sv_id.constellation, expected " + "26, is " + << last_msg_->stec_residuals[24].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[24].sv_id.satId, 147) + << "incorrect value for stec_residuals[24].sv_id.satId, expected 147, is " + << last_msg_->stec_residuals[24].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[25].residual, -10697) + << "incorrect value for stec_residuals[25].residual, expected -10697, is " + << last_msg_->stec_residuals[25].residual; + EXPECT_EQ(last_msg_->stec_residuals[25].stddev, 83) + << "incorrect value for stec_residuals[25].stddev, expected 83, is " + << last_msg_->stec_residuals[25].stddev; + EXPECT_EQ(last_msg_->stec_residuals[25].sv_id.constellation, 138) + << "incorrect value for stec_residuals[25].sv_id.constellation, expected " + "138, is " + << last_msg_->stec_residuals[25].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[25].sv_id.satId, 96) + << "incorrect value for stec_residuals[25].sv_id.satId, expected 96, is " + << last_msg_->stec_residuals[25].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[26].residual, 20387) + << "incorrect value for stec_residuals[26].residual, expected 20387, is " + << last_msg_->stec_residuals[26].residual; + EXPECT_EQ(last_msg_->stec_residuals[26].stddev, 173) + << "incorrect value for stec_residuals[26].stddev, expected 173, is " + << last_msg_->stec_residuals[26].stddev; + EXPECT_EQ(last_msg_->stec_residuals[26].sv_id.constellation, 170) + << "incorrect value for stec_residuals[26].sv_id.constellation, expected " + "170, is " + << last_msg_->stec_residuals[26].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[26].sv_id.satId, 156) + << "incorrect value for stec_residuals[26].sv_id.satId, expected 156, is " + << last_msg_->stec_residuals[26].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[27].residual, -3789) + << "incorrect value for stec_residuals[27].residual, expected -3789, is " + << last_msg_->stec_residuals[27].residual; + EXPECT_EQ(last_msg_->stec_residuals[27].stddev, 107) + << "incorrect value for stec_residuals[27].stddev, expected 107, is " + << last_msg_->stec_residuals[27].stddev; + EXPECT_EQ(last_msg_->stec_residuals[27].sv_id.constellation, 115) + << "incorrect value for stec_residuals[27].sv_id.constellation, expected " + "115, is " + << last_msg_->stec_residuals[27].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[27].sv_id.satId, 228) + << "incorrect value for stec_residuals[27].sv_id.satId, expected 228, is " + << last_msg_->stec_residuals[27].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[28].residual, -11608) + << "incorrect value for stec_residuals[28].residual, expected -11608, is " + << last_msg_->stec_residuals[28].residual; + EXPECT_EQ(last_msg_->stec_residuals[28].stddev, 10) + << "incorrect value for stec_residuals[28].stddev, expected 10, is " + << last_msg_->stec_residuals[28].stddev; + EXPECT_EQ(last_msg_->stec_residuals[28].sv_id.constellation, 112) + << "incorrect value for stec_residuals[28].sv_id.constellation, expected " + "112, is " + << last_msg_->stec_residuals[28].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[28].sv_id.satId, 245) + << "incorrect value for stec_residuals[28].sv_id.satId, expected 245, is " + << last_msg_->stec_residuals[28].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[29].residual, 14593) + << "incorrect value for stec_residuals[29].residual, expected 14593, is " + << last_msg_->stec_residuals[29].residual; + EXPECT_EQ(last_msg_->stec_residuals[29].stddev, 108) + << "incorrect value for stec_residuals[29].stddev, expected 108, is " + << last_msg_->stec_residuals[29].stddev; + EXPECT_EQ(last_msg_->stec_residuals[29].sv_id.constellation, 117) + << "incorrect value for stec_residuals[29].sv_id.constellation, expected " + "117, is " + << last_msg_->stec_residuals[29].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[29].sv_id.satId, 5) + << "incorrect value for stec_residuals[29].sv_id.satId, expected 5, is " + << last_msg_->stec_residuals[29].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[30].residual, 30609) + << "incorrect value for stec_residuals[30].residual, expected 30609, is " + << last_msg_->stec_residuals[30].residual; + EXPECT_EQ(last_msg_->stec_residuals[30].stddev, 226) + << "incorrect value for stec_residuals[30].stddev, expected 226, is " + << last_msg_->stec_residuals[30].stddev; + EXPECT_EQ(last_msg_->stec_residuals[30].sv_id.constellation, 212) + << "incorrect value for stec_residuals[30].sv_id.constellation, expected " + "212, is " + << last_msg_->stec_residuals[30].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[30].sv_id.satId, 248) + << "incorrect value for stec_residuals[30].sv_id.satId, expected 248, is " + << last_msg_->stec_residuals[30].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[31].residual, -13683) + << "incorrect value for stec_residuals[31].residual, expected -13683, is " + << last_msg_->stec_residuals[31].residual; + EXPECT_EQ(last_msg_->stec_residuals[31].stddev, 106) + << "incorrect value for stec_residuals[31].stddev, expected 106, is " + << last_msg_->stec_residuals[31].stddev; + EXPECT_EQ(last_msg_->stec_residuals[31].sv_id.constellation, 5) + << "incorrect value for stec_residuals[31].sv_id.constellation, expected " + "5, is " + << last_msg_->stec_residuals[31].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[31].sv_id.satId, 165) + << "incorrect value for stec_residuals[31].sv_id.satId, expected 165, is " + << last_msg_->stec_residuals[31].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[32].residual, 15652) + << "incorrect value for stec_residuals[32].residual, expected 15652, is " + << last_msg_->stec_residuals[32].residual; + EXPECT_EQ(last_msg_->stec_residuals[32].stddev, 243) + << "incorrect value for stec_residuals[32].stddev, expected 243, is " + << last_msg_->stec_residuals[32].stddev; + EXPECT_EQ(last_msg_->stec_residuals[32].sv_id.constellation, 60) + << "incorrect value for stec_residuals[32].sv_id.constellation, expected " + "60, is " + << last_msg_->stec_residuals[32].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[32].sv_id.satId, 0) + << "incorrect value for stec_residuals[32].sv_id.satId, expected 0, is " + << last_msg_->stec_residuals[32].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[33].residual, 3287) + << "incorrect value for stec_residuals[33].residual, expected 3287, is " + << last_msg_->stec_residuals[33].residual; + EXPECT_EQ(last_msg_->stec_residuals[33].stddev, 137) + << "incorrect value for stec_residuals[33].stddev, expected 137, is " + << last_msg_->stec_residuals[33].stddev; + EXPECT_EQ(last_msg_->stec_residuals[33].sv_id.constellation, 216) + << "incorrect value for stec_residuals[33].sv_id.constellation, expected " + "216, is " + << last_msg_->stec_residuals[33].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[33].sv_id.satId, 203) + << "incorrect value for stec_residuals[33].sv_id.satId, expected 203, is " + << last_msg_->stec_residuals[33].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[34].residual, 29687) + << "incorrect value for stec_residuals[34].residual, expected 29687, is " + << last_msg_->stec_residuals[34].residual; + EXPECT_EQ(last_msg_->stec_residuals[34].stddev, 152) + << "incorrect value for stec_residuals[34].stddev, expected 152, is " + << last_msg_->stec_residuals[34].stddev; + EXPECT_EQ(last_msg_->stec_residuals[34].sv_id.constellation, 28) + << "incorrect value for stec_residuals[34].sv_id.constellation, expected " + "28, is " + << last_msg_->stec_residuals[34].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[34].sv_id.satId, 16) + << "incorrect value for stec_residuals[34].sv_id.satId, expected 16, is " + << last_msg_->stec_residuals[34].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[35].residual, -6960) + << "incorrect value for stec_residuals[35].residual, expected -6960, is " + << last_msg_->stec_residuals[35].residual; + EXPECT_EQ(last_msg_->stec_residuals[35].stddev, 203) + << "incorrect value for stec_residuals[35].stddev, expected 203, is " + << last_msg_->stec_residuals[35].stddev; + EXPECT_EQ(last_msg_->stec_residuals[35].sv_id.constellation, 119) + << "incorrect value for stec_residuals[35].sv_id.constellation, expected " + "119, is " + << last_msg_->stec_residuals[35].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[35].sv_id.satId, 181) + << "incorrect value for stec_residuals[35].sv_id.satId, expected 181, is " + << last_msg_->stec_residuals[35].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[36].residual, -15193) + << "incorrect value for stec_residuals[36].residual, expected -15193, is " + << last_msg_->stec_residuals[36].residual; + EXPECT_EQ(last_msg_->stec_residuals[36].stddev, 32) + << "incorrect value for stec_residuals[36].stddev, expected 32, is " + << last_msg_->stec_residuals[36].stddev; + EXPECT_EQ(last_msg_->stec_residuals[36].sv_id.constellation, 34) + << "incorrect value for stec_residuals[36].sv_id.constellation, expected " + "34, is " + << last_msg_->stec_residuals[36].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[36].sv_id.satId, 236) + << "incorrect value for stec_residuals[36].sv_id.satId, expected 236, is " + << last_msg_->stec_residuals[36].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[37].residual, 25873) + << "incorrect value for stec_residuals[37].residual, expected 25873, is " + << last_msg_->stec_residuals[37].residual; + EXPECT_EQ(last_msg_->stec_residuals[37].stddev, 200) + << "incorrect value for stec_residuals[37].stddev, expected 200, is " + << last_msg_->stec_residuals[37].stddev; + EXPECT_EQ(last_msg_->stec_residuals[37].sv_id.constellation, 1) + << "incorrect value for stec_residuals[37].sv_id.constellation, expected " + "1, is " + << last_msg_->stec_residuals[37].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[37].sv_id.satId, 109) + << "incorrect value for stec_residuals[37].sv_id.satId, expected 109, is " + << last_msg_->stec_residuals[37].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[38].residual, -22403) + << "incorrect value for stec_residuals[38].residual, expected -22403, is " + << last_msg_->stec_residuals[38].residual; + EXPECT_EQ(last_msg_->stec_residuals[38].stddev, 137) + << "incorrect value for stec_residuals[38].stddev, expected 137, is " + << last_msg_->stec_residuals[38].stddev; + EXPECT_EQ(last_msg_->stec_residuals[38].sv_id.constellation, 94) + << "incorrect value for stec_residuals[38].sv_id.constellation, expected " + "94, is " + << last_msg_->stec_residuals[38].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[38].sv_id.satId, 25) + << "incorrect value for stec_residuals[38].sv_id.satId, expected 25, is " + << last_msg_->stec_residuals[38].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[39].residual, 7588) + << "incorrect value for stec_residuals[39].residual, expected 7588, is " + << last_msg_->stec_residuals[39].residual; + EXPECT_EQ(last_msg_->stec_residuals[39].stddev, 31) + << "incorrect value for stec_residuals[39].stddev, expected 31, is " + << last_msg_->stec_residuals[39].stddev; + EXPECT_EQ(last_msg_->stec_residuals[39].sv_id.constellation, 4) + << "incorrect value for stec_residuals[39].sv_id.constellation, expected " + "4, is " + << last_msg_->stec_residuals[39].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[39].sv_id.satId, 157) + << "incorrect value for stec_residuals[39].sv_id.satId, expected 157, is " + << last_msg_->stec_residuals[39].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[40].residual, -6840) + << "incorrect value for stec_residuals[40].residual, expected -6840, is " + << last_msg_->stec_residuals[40].residual; + EXPECT_EQ(last_msg_->stec_residuals[40].stddev, 126) + << "incorrect value for stec_residuals[40].stddev, expected 126, is " + << last_msg_->stec_residuals[40].stddev; + EXPECT_EQ(last_msg_->stec_residuals[40].sv_id.constellation, 132) + << "incorrect value for stec_residuals[40].sv_id.constellation, expected " + "132, is " + << last_msg_->stec_residuals[40].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[40].sv_id.satId, 48) + << "incorrect value for stec_residuals[40].sv_id.satId, expected 48, is " + << last_msg_->stec_residuals[40].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[41].residual, -31412) + << "incorrect value for stec_residuals[41].residual, expected -31412, is " + << last_msg_->stec_residuals[41].residual; + EXPECT_EQ(last_msg_->stec_residuals[41].stddev, 21) + << "incorrect value for stec_residuals[41].stddev, expected 21, is " + << last_msg_->stec_residuals[41].stddev; + EXPECT_EQ(last_msg_->stec_residuals[41].sv_id.constellation, 68) + << "incorrect value for stec_residuals[41].sv_id.constellation, expected " + "68, is " + << last_msg_->stec_residuals[41].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[41].sv_id.satId, 186) + << "incorrect value for stec_residuals[41].sv_id.satId, expected 186, is " + << last_msg_->stec_residuals[41].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[42].residual, -23413) + << "incorrect value for stec_residuals[42].residual, expected -23413, is " + << last_msg_->stec_residuals[42].residual; + EXPECT_EQ(last_msg_->stec_residuals[42].stddev, 148) + << "incorrect value for stec_residuals[42].stddev, expected 148, is " + << last_msg_->stec_residuals[42].stddev; + EXPECT_EQ(last_msg_->stec_residuals[42].sv_id.constellation, 180) + << "incorrect value for stec_residuals[42].sv_id.constellation, expected " + "180, is " + << last_msg_->stec_residuals[42].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[42].sv_id.satId, 0) + << "incorrect value for stec_residuals[42].sv_id.satId, expected 0, is " + << last_msg_->stec_residuals[42].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[43].residual, 30934) + << "incorrect value for stec_residuals[43].residual, expected 30934, is " + << last_msg_->stec_residuals[43].residual; + EXPECT_EQ(last_msg_->stec_residuals[43].stddev, 177) + << "incorrect value for stec_residuals[43].stddev, expected 177, is " + << last_msg_->stec_residuals[43].stddev; + EXPECT_EQ(last_msg_->stec_residuals[43].sv_id.constellation, 149) + << "incorrect value for stec_residuals[43].sv_id.constellation, expected " + "149, is " + << last_msg_->stec_residuals[43].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[43].sv_id.satId, 119) + << "incorrect value for stec_residuals[43].sv_id.satId, expected 119, is " + << last_msg_->stec_residuals[43].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[44].residual, 26960) + << "incorrect value for stec_residuals[44].residual, expected 26960, is " + << last_msg_->stec_residuals[44].residual; + EXPECT_EQ(last_msg_->stec_residuals[44].stddev, 10) + << "incorrect value for stec_residuals[44].stddev, expected 10, is " + << last_msg_->stec_residuals[44].stddev; + EXPECT_EQ(last_msg_->stec_residuals[44].sv_id.constellation, 80) + << "incorrect value for stec_residuals[44].sv_id.constellation, expected " + "80, is " + << last_msg_->stec_residuals[44].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[44].sv_id.satId, 201) + << "incorrect value for stec_residuals[44].sv_id.satId, expected 201, is " + << last_msg_->stec_residuals[44].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[45].residual, 11853) + << "incorrect value for stec_residuals[45].residual, expected 11853, is " + << last_msg_->stec_residuals[45].residual; + EXPECT_EQ(last_msg_->stec_residuals[45].stddev, 233) + << "incorrect value for stec_residuals[45].stddev, expected 233, is " + << last_msg_->stec_residuals[45].stddev; + EXPECT_EQ(last_msg_->stec_residuals[45].sv_id.constellation, 118) + << "incorrect value for stec_residuals[45].sv_id.constellation, expected " + "118, is " + << last_msg_->stec_residuals[45].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[45].sv_id.satId, 136) + << "incorrect value for stec_residuals[45].sv_id.satId, expected 136, is " + << last_msg_->stec_residuals[45].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[46].residual, -25077) + << "incorrect value for stec_residuals[46].residual, expected -25077, is " + << last_msg_->stec_residuals[46].residual; + EXPECT_EQ(last_msg_->stec_residuals[46].stddev, 103) + << "incorrect value for stec_residuals[46].stddev, expected 103, is " + << last_msg_->stec_residuals[46].stddev; + EXPECT_EQ(last_msg_->stec_residuals[46].sv_id.constellation, 227) + << "incorrect value for stec_residuals[46].sv_id.constellation, expected " + "227, is " + << last_msg_->stec_residuals[46].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[46].sv_id.satId, 233) + << "incorrect value for stec_residuals[46].sv_id.satId, expected 233, is " + << last_msg_->stec_residuals[46].sv_id.satId; + EXPECT_EQ(last_msg_->tropo_delay_correction.hydro, 10643) + << "incorrect value for tropo_delay_correction.hydro, expected 10643, is " + << last_msg_->tropo_delay_correction.hydro; + EXPECT_EQ(last_msg_->tropo_delay_correction.stddev, 92) + << "incorrect value for tropo_delay_correction.stddev, expected 92, is " + << last_msg_->tropo_delay_correction.stddev; + EXPECT_EQ(last_msg_->tropo_delay_correction.wet, 33) + << "incorrect value for tropo_delay_correction.wet, expected 33, is " + << last_msg_->tropo_delay_correction.wet; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.cc index 26bd48296..87d979542 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionNoStdDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrGriddedCorrectionNoStdDepA.yaml +// by generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,53 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_gridded_correction_no_std_dep_a_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, uint8_t message_length, + const msg_ssr_gridded_correction_no_std_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,643 +83,1152 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_gridded_correction_no_std_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,240,5,102,28,254,179,240,33,169,236,34,117,245,67,248,233,236,230,230,103,122,63,101,231,157,115,162,197,146,35,107,222,109,52,41,86,12,237,184,65,204,137,148,171,183,11,0,180,203,172,53,196,85,186,115,203,92,166,30,42,13,200,71,98,137,219,160,95,216,95,250,99,196,92,214,159,253,195,222,233,146,233,63,76,24,106,40,253,65,9,183,40,215,188,59,117,69,97,115,60,56,0,141,207,171,54,161,23,61,0,87,230,123,87,36,184,255,14,163,187,224,43,151,151,104,39,57,5,54,48,224,181,129,60,92,171,114,109,109,12,23,118,8,64,159,54,216,33,20,24,68,160,36,38,222,145,190,92,99,108,159,232,240,227,221,253,15,62,23,121,185,168,116,4,147,123,72,223,119,226,242,161,204,180,202,137,166,58,24,124,19,181,188,16,107,66,231,63,1,64,252,115,62,233,97,250,86,156,221,49,178,32,73,198,67,249,253,74,56,38,165,119,92,99,44,95,131,89,192,225,55,95,171,88,205,21,116,231,83,71,71,100,110,217,254,152,212,18,8,40,157,244,54,72,240,231,189,111,195,205,81, }; +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrGriddedCorrectionNoStdDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 240, 5, 102, 28, 254, 179, 240, 33, 169, 236, 34, 117, 245, 67, + 248, 233, 236, 230, 230, 103, 122, 63, 101, 231, 157, 115, 162, 197, 146, + 35, 107, 222, 109, 52, 41, 86, 12, 237, 184, 65, 204, 137, 148, 171, + 183, 11, 0, 180, 203, 172, 53, 196, 85, 186, 115, 203, 92, 166, 30, + 42, 13, 200, 71, 98, 137, 219, 160, 95, 216, 95, 250, 99, 196, 92, + 214, 159, 253, 195, 222, 233, 146, 233, 63, 76, 24, 106, 40, 253, 65, + 9, 183, 40, 215, 188, 59, 117, 69, 97, 115, 60, 56, 0, 141, 207, + 171, 54, 161, 23, 61, 0, 87, 230, 123, 87, 36, 184, 255, 14, 163, + 187, 224, 43, 151, 151, 104, 39, 57, 5, 54, 48, 224, 181, 129, 60, + 92, 171, 114, 109, 109, 12, 23, 118, 8, 64, 159, 54, 216, 33, 20, + 24, 68, 160, 36, 38, 222, 145, 190, 92, 99, 108, 159, 232, 240, 227, + 221, 253, 15, 62, 23, 121, 185, 168, 116, 4, 147, 123, 72, 223, 119, + 226, 242, 161, 204, 180, 202, 137, 166, 58, 24, 124, 19, 181, 188, 16, + 107, 66, 231, 63, 1, 64, 252, 115, 62, 233, 97, 250, 86, 156, 221, + 49, 178, 32, 73, 198, 67, 249, 253, 74, 56, 38, 165, 119, 92, 99, + 44, 95, 131, 89, 192, 225, 55, 95, 171, 88, 205, 21, 116, 231, 83, + 71, 71, 100, 110, 217, 254, 152, 212, 18, 8, 40, 157, 244, 54, 72, + 240, 231, 189, 111, 195, 205, 81, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_gridded_correction_no_std_dep_a_t* test_msg = ( msg_ssr_gridded_correction_no_std_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.iod_atmo = 236; - test_msg->header.num_msgs = 62837; - test_msg->header.seq_num = 63555; - test_msg->header.time.tow = 2837573811; - test_msg->header.time.wn = 8940; - test_msg->header.tropo_quality_indicator = 230; - test_msg->header.update_interval = 233; - test_msg->index = 26598; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[0].residual = -23949; - test_msg->stec_residuals[0].sv_id.constellation = 157; - test_msg->stec_residuals[0].sv_id.satId = 231; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[1].residual = 27427; - test_msg->stec_residuals[1].sv_id.constellation = 146; - test_msg->stec_residuals[1].sv_id.satId = 197; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[2].residual = 10548; - test_msg->stec_residuals[2].sv_id.constellation = 109; - test_msg->stec_residuals[2].sv_id.satId = 222; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[3].residual = -18195; - test_msg->stec_residuals[3].sv_id.constellation = 12; - test_msg->stec_residuals[3].sv_id.satId = 86; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[4].residual = -27511; - test_msg->stec_residuals[4].sv_id.constellation = 204; - test_msg->stec_residuals[4].sv_id.satId = 65; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[5].residual = 11; - test_msg->stec_residuals[5].sv_id.constellation = 183; - test_msg->stec_residuals[5].sv_id.satId = 171; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[6].residual = 13740; - test_msg->stec_residuals[6].sv_id.constellation = 203; - test_msg->stec_residuals[6].sv_id.satId = 180; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[7].residual = 29626; - test_msg->stec_residuals[7].sv_id.constellation = 85; - test_msg->stec_residuals[7].sv_id.satId = 196; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[8].residual = 7846; - test_msg->stec_residuals[8].sv_id.constellation = 92; - test_msg->stec_residuals[8].sv_id.satId = 203; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[9].residual = 18376; - test_msg->stec_residuals[9].sv_id.constellation = 13; - test_msg->stec_residuals[9].sv_id.satId = 42; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[10].residual = -24357; - test_msg->stec_residuals[10].sv_id.constellation = 137; - test_msg->stec_residuals[10].sv_id.satId = 98; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[11].residual = -1441; - test_msg->stec_residuals[11].sv_id.constellation = 216; - test_msg->stec_residuals[11].sv_id.satId = 95; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[12].residual = -10660; - test_msg->stec_residuals[12].sv_id.constellation = 196; - test_msg->stec_residuals[12].sv_id.satId = 99; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[13].residual = -8509; - test_msg->stec_residuals[13].sv_id.constellation = 253; - test_msg->stec_residuals[13].sv_id.satId = 159; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[14].residual = 16361; - test_msg->stec_residuals[14].sv_id.constellation = 146; - test_msg->stec_residuals[14].sv_id.satId = 233; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[15].residual = 10346; - test_msg->stec_residuals[15].sv_id.constellation = 24; - test_msg->stec_residuals[15].sv_id.satId = 76; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[16].residual = -18679; - test_msg->stec_residuals[16].sv_id.constellation = 65; - test_msg->stec_residuals[16].sv_id.satId = 253; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[17].residual = 15292; - test_msg->stec_residuals[17].sv_id.constellation = 215; - test_msg->stec_residuals[17].sv_id.satId = 40; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[18].residual = 29537; - test_msg->stec_residuals[18].sv_id.constellation = 69; - test_msg->stec_residuals[18].sv_id.satId = 117; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[19].residual = -29440; - test_msg->stec_residuals[19].sv_id.constellation = 56; - test_msg->stec_residuals[19].sv_id.satId = 60; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[20].residual = -24266; - test_msg->stec_residuals[20].sv_id.constellation = 171; - test_msg->stec_residuals[20].sv_id.satId = 207; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[21].residual = 22272; - test_msg->stec_residuals[21].sv_id.constellation = 61; - test_msg->stec_residuals[21].sv_id.satId = 23; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[22].residual = 9303; - test_msg->stec_residuals[22].sv_id.constellation = 123; - test_msg->stec_residuals[22].sv_id.satId = 230; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[23].residual = -23794; - test_msg->stec_residuals[23].sv_id.constellation = 255; - test_msg->stec_residuals[23].sv_id.satId = 184; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[24].residual = -26837; - test_msg->stec_residuals[24].sv_id.constellation = 224; - test_msg->stec_residuals[24].sv_id.satId = 187; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[25].residual = 14631; - test_msg->stec_residuals[25].sv_id.constellation = 104; - test_msg->stec_residuals[25].sv_id.satId = 151; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[26].residual = -8144; - test_msg->stec_residuals[26].sv_id.constellation = 54; - test_msg->stec_residuals[26].sv_id.satId = 5; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[27].residual = 23612; - test_msg->stec_residuals[27].sv_id.constellation = 129; - test_msg->stec_residuals[27].sv_id.satId = 181; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[28].residual = 28013; - test_msg->stec_residuals[28].sv_id.constellation = 114; - test_msg->stec_residuals[28].sv_id.satId = 171; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[29].residual = 2166; - test_msg->stec_residuals[29].sv_id.constellation = 23; - test_msg->stec_residuals[29].sv_id.satId = 12; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[30].residual = -10186; - test_msg->stec_residuals[30].sv_id.constellation = 159; - test_msg->stec_residuals[30].sv_id.satId = 64; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[31].residual = 17432; - test_msg->stec_residuals[31].sv_id.constellation = 20; - test_msg->stec_residuals[31].sv_id.satId = 33; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[32].residual = -8666; - test_msg->stec_residuals[32].sv_id.constellation = 36; - test_msg->stec_residuals[32].sv_id.satId = 160; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[33].residual = 25436; - test_msg->stec_residuals[33].sv_id.constellation = 190; - test_msg->stec_residuals[33].sv_id.satId = 145; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[34].residual = -3864; - test_msg->stec_residuals[34].sv_id.constellation = 159; - test_msg->stec_residuals[34].sv_id.satId = 108; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[35].residual = 4093; - test_msg->stec_residuals[35].sv_id.constellation = 221; - test_msg->stec_residuals[35].sv_id.satId = 227; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[36].residual = -18055; - test_msg->stec_residuals[36].sv_id.constellation = 23; - test_msg->stec_residuals[36].sv_id.satId = 62; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[37].residual = -27900; - test_msg->stec_residuals[37].sv_id.constellation = 116; - test_msg->stec_residuals[37].sv_id.satId = 168; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[38].residual = 30687; - test_msg->stec_residuals[38].sv_id.constellation = 72; - test_msg->stec_residuals[38].sv_id.satId = 123; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[39].residual = -13151; - test_msg->stec_residuals[39].sv_id.constellation = 242; - test_msg->stec_residuals[39].sv_id.satId = 226; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[40].residual = -22903; - test_msg->stec_residuals[40].sv_id.constellation = 202; - test_msg->stec_residuals[40].sv_id.satId = 180; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[41].residual = 4988; - test_msg->stec_residuals[41].sv_id.constellation = 24; - test_msg->stec_residuals[41].sv_id.satId = 58; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[42].residual = 27408; - test_msg->stec_residuals[42].sv_id.constellation = 188; - test_msg->stec_residuals[42].sv_id.satId = 181; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[43].residual = 319; - test_msg->stec_residuals[43].sv_id.constellation = 231; - test_msg->stec_residuals[43].sv_id.satId = 66; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[44].residual = 15987; - test_msg->stec_residuals[44].sv_id.constellation = 252; - test_msg->stec_residuals[44].sv_id.satId = 64; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[45].residual = 22266; - test_msg->stec_residuals[45].sv_id.constellation = 97; - test_msg->stec_residuals[45].sv_id.satId = 233; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[46].residual = -19919; - test_msg->stec_residuals[46].sv_id.constellation = 221; - test_msg->stec_residuals[46].sv_id.satId = 156; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[47].residual = 17350; - test_msg->stec_residuals[47].sv_id.constellation = 73; - test_msg->stec_residuals[47].sv_id.satId = 32; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[48].residual = 14410; - test_msg->stec_residuals[48].sv_id.constellation = 253; - test_msg->stec_residuals[48].sv_id.satId = 249; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[49].residual = 23671; - test_msg->stec_residuals[49].sv_id.constellation = 165; - test_msg->stec_residuals[49].sv_id.satId = 38; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[50].residual = -31905; - test_msg->stec_residuals[50].sv_id.constellation = 44; - test_msg->stec_residuals[50].sv_id.satId = 99; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[51].residual = 14305; - test_msg->stec_residuals[51].sv_id.constellation = 192; - test_msg->stec_residuals[51].sv_id.satId = 89; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[52].residual = -12968; - test_msg->stec_residuals[52].sv_id.constellation = 171; - test_msg->stec_residuals[52].sv_id.satId = 95; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[53].residual = 21479; - test_msg->stec_residuals[53].sv_id.constellation = 116; - test_msg->stec_residuals[53].sv_id.satId = 21; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[54].residual = 28260; - test_msg->stec_residuals[54].sv_id.constellation = 71; - test_msg->stec_residuals[54].sv_id.satId = 71; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[55].residual = -11112; - test_msg->stec_residuals[55].sv_id.constellation = 254; - test_msg->stec_residuals[55].sv_id.satId = 217; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[56].residual = -25304; - test_msg->stec_residuals[56].sv_id.constellation = 8; - test_msg->stec_residuals[56].sv_id.satId = 18; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[57].residual = -4024; - test_msg->stec_residuals[57].sv_id.constellation = 54; - test_msg->stec_residuals[57].sv_id.satId = 244; - if (sizeof(test_msg->stec_residuals) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); - } - test_msg->stec_residuals[58].residual = -15505; - test_msg->stec_residuals[58].sv_id.constellation = 189; - test_msg->stec_residuals[58].sv_id.satId = 231; - test_msg->tropo_delay_correction.hydro = 16250; - test_msg->tropo_delay_correction.wet = 101; - - EXPECT_EQ(send_message( 0x5f0, 7270, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_gridded_correction_no_std_dep_a_t *test_msg = + (msg_ssr_gridded_correction_no_std_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.iod_atmo = 236; + test_msg->header.num_msgs = 62837; + test_msg->header.seq_num = 63555; + test_msg->header.time.tow = 2837573811; + test_msg->header.time.wn = 8940; + test_msg->header.tropo_quality_indicator = 230; + test_msg->header.update_interval = 233; + test_msg->index = 26598; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[0].residual = -23949; + test_msg->stec_residuals[0].sv_id.constellation = 157; + test_msg->stec_residuals[0].sv_id.satId = 231; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[1].residual = 27427; + test_msg->stec_residuals[1].sv_id.constellation = 146; + test_msg->stec_residuals[1].sv_id.satId = 197; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[2].residual = 10548; + test_msg->stec_residuals[2].sv_id.constellation = 109; + test_msg->stec_residuals[2].sv_id.satId = 222; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[3].residual = -18195; + test_msg->stec_residuals[3].sv_id.constellation = 12; + test_msg->stec_residuals[3].sv_id.satId = 86; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[4].residual = -27511; + test_msg->stec_residuals[4].sv_id.constellation = 204; + test_msg->stec_residuals[4].sv_id.satId = 65; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[5].residual = 11; + test_msg->stec_residuals[5].sv_id.constellation = 183; + test_msg->stec_residuals[5].sv_id.satId = 171; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[6].residual = 13740; + test_msg->stec_residuals[6].sv_id.constellation = 203; + test_msg->stec_residuals[6].sv_id.satId = 180; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[7].residual = 29626; + test_msg->stec_residuals[7].sv_id.constellation = 85; + test_msg->stec_residuals[7].sv_id.satId = 196; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[8].residual = 7846; + test_msg->stec_residuals[8].sv_id.constellation = 92; + test_msg->stec_residuals[8].sv_id.satId = 203; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[9].residual = 18376; + test_msg->stec_residuals[9].sv_id.constellation = 13; + test_msg->stec_residuals[9].sv_id.satId = 42; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[10].residual = -24357; + test_msg->stec_residuals[10].sv_id.constellation = 137; + test_msg->stec_residuals[10].sv_id.satId = 98; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[11].residual = -1441; + test_msg->stec_residuals[11].sv_id.constellation = 216; + test_msg->stec_residuals[11].sv_id.satId = 95; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[12].residual = -10660; + test_msg->stec_residuals[12].sv_id.constellation = 196; + test_msg->stec_residuals[12].sv_id.satId = 99; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[13].residual = -8509; + test_msg->stec_residuals[13].sv_id.constellation = 253; + test_msg->stec_residuals[13].sv_id.satId = 159; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[14].residual = 16361; + test_msg->stec_residuals[14].sv_id.constellation = 146; + test_msg->stec_residuals[14].sv_id.satId = 233; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[15].residual = 10346; + test_msg->stec_residuals[15].sv_id.constellation = 24; + test_msg->stec_residuals[15].sv_id.satId = 76; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[16].residual = -18679; + test_msg->stec_residuals[16].sv_id.constellation = 65; + test_msg->stec_residuals[16].sv_id.satId = 253; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[17].residual = 15292; + test_msg->stec_residuals[17].sv_id.constellation = 215; + test_msg->stec_residuals[17].sv_id.satId = 40; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[18].residual = 29537; + test_msg->stec_residuals[18].sv_id.constellation = 69; + test_msg->stec_residuals[18].sv_id.satId = 117; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[19].residual = -29440; + test_msg->stec_residuals[19].sv_id.constellation = 56; + test_msg->stec_residuals[19].sv_id.satId = 60; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[20].residual = -24266; + test_msg->stec_residuals[20].sv_id.constellation = 171; + test_msg->stec_residuals[20].sv_id.satId = 207; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[21].residual = 22272; + test_msg->stec_residuals[21].sv_id.constellation = 61; + test_msg->stec_residuals[21].sv_id.satId = 23; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[22].residual = 9303; + test_msg->stec_residuals[22].sv_id.constellation = 123; + test_msg->stec_residuals[22].sv_id.satId = 230; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[23].residual = -23794; + test_msg->stec_residuals[23].sv_id.constellation = 255; + test_msg->stec_residuals[23].sv_id.satId = 184; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[24].residual = -26837; + test_msg->stec_residuals[24].sv_id.constellation = 224; + test_msg->stec_residuals[24].sv_id.satId = 187; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[25].residual = 14631; + test_msg->stec_residuals[25].sv_id.constellation = 104; + test_msg->stec_residuals[25].sv_id.satId = 151; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[26].residual = -8144; + test_msg->stec_residuals[26].sv_id.constellation = 54; + test_msg->stec_residuals[26].sv_id.satId = 5; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[27].residual = 23612; + test_msg->stec_residuals[27].sv_id.constellation = 129; + test_msg->stec_residuals[27].sv_id.satId = 181; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[28].residual = 28013; + test_msg->stec_residuals[28].sv_id.constellation = 114; + test_msg->stec_residuals[28].sv_id.satId = 171; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[29].residual = 2166; + test_msg->stec_residuals[29].sv_id.constellation = 23; + test_msg->stec_residuals[29].sv_id.satId = 12; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[30].residual = -10186; + test_msg->stec_residuals[30].sv_id.constellation = 159; + test_msg->stec_residuals[30].sv_id.satId = 64; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[31].residual = 17432; + test_msg->stec_residuals[31].sv_id.constellation = 20; + test_msg->stec_residuals[31].sv_id.satId = 33; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[32].residual = -8666; + test_msg->stec_residuals[32].sv_id.constellation = 36; + test_msg->stec_residuals[32].sv_id.satId = 160; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[33].residual = 25436; + test_msg->stec_residuals[33].sv_id.constellation = 190; + test_msg->stec_residuals[33].sv_id.satId = 145; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[34].residual = -3864; + test_msg->stec_residuals[34].sv_id.constellation = 159; + test_msg->stec_residuals[34].sv_id.satId = 108; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[35].residual = 4093; + test_msg->stec_residuals[35].sv_id.constellation = 221; + test_msg->stec_residuals[35].sv_id.satId = 227; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[36].residual = -18055; + test_msg->stec_residuals[36].sv_id.constellation = 23; + test_msg->stec_residuals[36].sv_id.satId = 62; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[37].residual = -27900; + test_msg->stec_residuals[37].sv_id.constellation = 116; + test_msg->stec_residuals[37].sv_id.satId = 168; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[38].residual = 30687; + test_msg->stec_residuals[38].sv_id.constellation = 72; + test_msg->stec_residuals[38].sv_id.satId = 123; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[39].residual = -13151; + test_msg->stec_residuals[39].sv_id.constellation = 242; + test_msg->stec_residuals[39].sv_id.satId = 226; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[40].residual = -22903; + test_msg->stec_residuals[40].sv_id.constellation = 202; + test_msg->stec_residuals[40].sv_id.satId = 180; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[41].residual = 4988; + test_msg->stec_residuals[41].sv_id.constellation = 24; + test_msg->stec_residuals[41].sv_id.satId = 58; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[42].residual = 27408; + test_msg->stec_residuals[42].sv_id.constellation = 188; + test_msg->stec_residuals[42].sv_id.satId = 181; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[43].residual = 319; + test_msg->stec_residuals[43].sv_id.constellation = 231; + test_msg->stec_residuals[43].sv_id.satId = 66; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[44].residual = 15987; + test_msg->stec_residuals[44].sv_id.constellation = 252; + test_msg->stec_residuals[44].sv_id.satId = 64; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[45].residual = 22266; + test_msg->stec_residuals[45].sv_id.constellation = 97; + test_msg->stec_residuals[45].sv_id.satId = 233; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[46].residual = -19919; + test_msg->stec_residuals[46].sv_id.constellation = 221; + test_msg->stec_residuals[46].sv_id.satId = 156; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[47].residual = 17350; + test_msg->stec_residuals[47].sv_id.constellation = 73; + test_msg->stec_residuals[47].sv_id.satId = 32; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[48].residual = 14410; + test_msg->stec_residuals[48].sv_id.constellation = 253; + test_msg->stec_residuals[48].sv_id.satId = 249; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[49].residual = 23671; + test_msg->stec_residuals[49].sv_id.constellation = 165; + test_msg->stec_residuals[49].sv_id.satId = 38; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[50].residual = -31905; + test_msg->stec_residuals[50].sv_id.constellation = 44; + test_msg->stec_residuals[50].sv_id.satId = 99; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[51].residual = 14305; + test_msg->stec_residuals[51].sv_id.constellation = 192; + test_msg->stec_residuals[51].sv_id.satId = 89; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[52].residual = -12968; + test_msg->stec_residuals[52].sv_id.constellation = 171; + test_msg->stec_residuals[52].sv_id.satId = 95; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[53].residual = 21479; + test_msg->stec_residuals[53].sv_id.constellation = 116; + test_msg->stec_residuals[53].sv_id.satId = 21; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[54].residual = 28260; + test_msg->stec_residuals[54].sv_id.constellation = 71; + test_msg->stec_residuals[54].sv_id.satId = 71; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[55].residual = -11112; + test_msg->stec_residuals[55].sv_id.constellation = 254; + test_msg->stec_residuals[55].sv_id.satId = 217; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[56].residual = -25304; + test_msg->stec_residuals[56].sv_id.constellation = 8; + test_msg->stec_residuals[56].sv_id.satId = 18; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[57].residual = -4024; + test_msg->stec_residuals[57].sv_id.constellation = 54; + test_msg->stec_residuals[57].sv_id.satId = 244; + if (sizeof(test_msg->stec_residuals) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->stec_residuals[0])); + } + test_msg->stec_residuals[58].residual = -15505; + test_msg->stec_residuals[58].sv_id.constellation = 189; + test_msg->stec_residuals[58].sv_id.satId = 231; + test_msg->tropo_delay_correction.hydro = 16250; + test_msg->tropo_delay_correction.wet = 101; + + EXPECT_EQ(send_message(0x5f0, 7270, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 7270); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.iod_atmo, 236) << "incorrect value for header.iod_atmo, expected 236, is " << last_msg_->header.iod_atmo; - EXPECT_EQ(last_msg_->header.num_msgs, 62837) << "incorrect value for header.num_msgs, expected 62837, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.seq_num, 63555) << "incorrect value for header.seq_num, expected 63555, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->header.time.tow, 2837573811) << "incorrect value for header.time.tow, expected 2837573811, is " << last_msg_->header.time.tow; - EXPECT_EQ(last_msg_->header.time.wn, 8940) << "incorrect value for header.time.wn, expected 8940, is " << last_msg_->header.time.wn; - EXPECT_EQ(last_msg_->header.tropo_quality_indicator, 230) << "incorrect value for header.tropo_quality_indicator, expected 230, is " << last_msg_->header.tropo_quality_indicator; - EXPECT_EQ(last_msg_->header.update_interval, 233) << "incorrect value for header.update_interval, expected 233, is " << last_msg_->header.update_interval; - EXPECT_EQ(last_msg_->index, 26598) << "incorrect value for index, expected 26598, is " << last_msg_->index; - EXPECT_EQ(last_msg_->stec_residuals[0].residual, -23949) << "incorrect value for stec_residuals[0].residual, expected -23949, is " << last_msg_->stec_residuals[0].residual; - EXPECT_EQ(last_msg_->stec_residuals[0].sv_id.constellation, 157) << "incorrect value for stec_residuals[0].sv_id.constellation, expected 157, is " << last_msg_->stec_residuals[0].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[0].sv_id.satId, 231) << "incorrect value for stec_residuals[0].sv_id.satId, expected 231, is " << last_msg_->stec_residuals[0].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[1].residual, 27427) << "incorrect value for stec_residuals[1].residual, expected 27427, is " << last_msg_->stec_residuals[1].residual; - EXPECT_EQ(last_msg_->stec_residuals[1].sv_id.constellation, 146) << "incorrect value for stec_residuals[1].sv_id.constellation, expected 146, is " << last_msg_->stec_residuals[1].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[1].sv_id.satId, 197) << "incorrect value for stec_residuals[1].sv_id.satId, expected 197, is " << last_msg_->stec_residuals[1].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[2].residual, 10548) << "incorrect value for stec_residuals[2].residual, expected 10548, is " << last_msg_->stec_residuals[2].residual; - EXPECT_EQ(last_msg_->stec_residuals[2].sv_id.constellation, 109) << "incorrect value for stec_residuals[2].sv_id.constellation, expected 109, is " << last_msg_->stec_residuals[2].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[2].sv_id.satId, 222) << "incorrect value for stec_residuals[2].sv_id.satId, expected 222, is " << last_msg_->stec_residuals[2].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[3].residual, -18195) << "incorrect value for stec_residuals[3].residual, expected -18195, is " << last_msg_->stec_residuals[3].residual; - EXPECT_EQ(last_msg_->stec_residuals[3].sv_id.constellation, 12) << "incorrect value for stec_residuals[3].sv_id.constellation, expected 12, is " << last_msg_->stec_residuals[3].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[3].sv_id.satId, 86) << "incorrect value for stec_residuals[3].sv_id.satId, expected 86, is " << last_msg_->stec_residuals[3].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[4].residual, -27511) << "incorrect value for stec_residuals[4].residual, expected -27511, is " << last_msg_->stec_residuals[4].residual; - EXPECT_EQ(last_msg_->stec_residuals[4].sv_id.constellation, 204) << "incorrect value for stec_residuals[4].sv_id.constellation, expected 204, is " << last_msg_->stec_residuals[4].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[4].sv_id.satId, 65) << "incorrect value for stec_residuals[4].sv_id.satId, expected 65, is " << last_msg_->stec_residuals[4].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[5].residual, 11) << "incorrect value for stec_residuals[5].residual, expected 11, is " << last_msg_->stec_residuals[5].residual; - EXPECT_EQ(last_msg_->stec_residuals[5].sv_id.constellation, 183) << "incorrect value for stec_residuals[5].sv_id.constellation, expected 183, is " << last_msg_->stec_residuals[5].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[5].sv_id.satId, 171) << "incorrect value for stec_residuals[5].sv_id.satId, expected 171, is " << last_msg_->stec_residuals[5].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[6].residual, 13740) << "incorrect value for stec_residuals[6].residual, expected 13740, is " << last_msg_->stec_residuals[6].residual; - EXPECT_EQ(last_msg_->stec_residuals[6].sv_id.constellation, 203) << "incorrect value for stec_residuals[6].sv_id.constellation, expected 203, is " << last_msg_->stec_residuals[6].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[6].sv_id.satId, 180) << "incorrect value for stec_residuals[6].sv_id.satId, expected 180, is " << last_msg_->stec_residuals[6].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[7].residual, 29626) << "incorrect value for stec_residuals[7].residual, expected 29626, is " << last_msg_->stec_residuals[7].residual; - EXPECT_EQ(last_msg_->stec_residuals[7].sv_id.constellation, 85) << "incorrect value for stec_residuals[7].sv_id.constellation, expected 85, is " << last_msg_->stec_residuals[7].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[7].sv_id.satId, 196) << "incorrect value for stec_residuals[7].sv_id.satId, expected 196, is " << last_msg_->stec_residuals[7].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[8].residual, 7846) << "incorrect value for stec_residuals[8].residual, expected 7846, is " << last_msg_->stec_residuals[8].residual; - EXPECT_EQ(last_msg_->stec_residuals[8].sv_id.constellation, 92) << "incorrect value for stec_residuals[8].sv_id.constellation, expected 92, is " << last_msg_->stec_residuals[8].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[8].sv_id.satId, 203) << "incorrect value for stec_residuals[8].sv_id.satId, expected 203, is " << last_msg_->stec_residuals[8].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[9].residual, 18376) << "incorrect value for stec_residuals[9].residual, expected 18376, is " << last_msg_->stec_residuals[9].residual; - EXPECT_EQ(last_msg_->stec_residuals[9].sv_id.constellation, 13) << "incorrect value for stec_residuals[9].sv_id.constellation, expected 13, is " << last_msg_->stec_residuals[9].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[9].sv_id.satId, 42) << "incorrect value for stec_residuals[9].sv_id.satId, expected 42, is " << last_msg_->stec_residuals[9].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[10].residual, -24357) << "incorrect value for stec_residuals[10].residual, expected -24357, is " << last_msg_->stec_residuals[10].residual; - EXPECT_EQ(last_msg_->stec_residuals[10].sv_id.constellation, 137) << "incorrect value for stec_residuals[10].sv_id.constellation, expected 137, is " << last_msg_->stec_residuals[10].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[10].sv_id.satId, 98) << "incorrect value for stec_residuals[10].sv_id.satId, expected 98, is " << last_msg_->stec_residuals[10].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[11].residual, -1441) << "incorrect value for stec_residuals[11].residual, expected -1441, is " << last_msg_->stec_residuals[11].residual; - EXPECT_EQ(last_msg_->stec_residuals[11].sv_id.constellation, 216) << "incorrect value for stec_residuals[11].sv_id.constellation, expected 216, is " << last_msg_->stec_residuals[11].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[11].sv_id.satId, 95) << "incorrect value for stec_residuals[11].sv_id.satId, expected 95, is " << last_msg_->stec_residuals[11].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[12].residual, -10660) << "incorrect value for stec_residuals[12].residual, expected -10660, is " << last_msg_->stec_residuals[12].residual; - EXPECT_EQ(last_msg_->stec_residuals[12].sv_id.constellation, 196) << "incorrect value for stec_residuals[12].sv_id.constellation, expected 196, is " << last_msg_->stec_residuals[12].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[12].sv_id.satId, 99) << "incorrect value for stec_residuals[12].sv_id.satId, expected 99, is " << last_msg_->stec_residuals[12].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[13].residual, -8509) << "incorrect value for stec_residuals[13].residual, expected -8509, is " << last_msg_->stec_residuals[13].residual; - EXPECT_EQ(last_msg_->stec_residuals[13].sv_id.constellation, 253) << "incorrect value for stec_residuals[13].sv_id.constellation, expected 253, is " << last_msg_->stec_residuals[13].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[13].sv_id.satId, 159) << "incorrect value for stec_residuals[13].sv_id.satId, expected 159, is " << last_msg_->stec_residuals[13].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[14].residual, 16361) << "incorrect value for stec_residuals[14].residual, expected 16361, is " << last_msg_->stec_residuals[14].residual; - EXPECT_EQ(last_msg_->stec_residuals[14].sv_id.constellation, 146) << "incorrect value for stec_residuals[14].sv_id.constellation, expected 146, is " << last_msg_->stec_residuals[14].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[14].sv_id.satId, 233) << "incorrect value for stec_residuals[14].sv_id.satId, expected 233, is " << last_msg_->stec_residuals[14].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[15].residual, 10346) << "incorrect value for stec_residuals[15].residual, expected 10346, is " << last_msg_->stec_residuals[15].residual; - EXPECT_EQ(last_msg_->stec_residuals[15].sv_id.constellation, 24) << "incorrect value for stec_residuals[15].sv_id.constellation, expected 24, is " << last_msg_->stec_residuals[15].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[15].sv_id.satId, 76) << "incorrect value for stec_residuals[15].sv_id.satId, expected 76, is " << last_msg_->stec_residuals[15].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[16].residual, -18679) << "incorrect value for stec_residuals[16].residual, expected -18679, is " << last_msg_->stec_residuals[16].residual; - EXPECT_EQ(last_msg_->stec_residuals[16].sv_id.constellation, 65) << "incorrect value for stec_residuals[16].sv_id.constellation, expected 65, is " << last_msg_->stec_residuals[16].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[16].sv_id.satId, 253) << "incorrect value for stec_residuals[16].sv_id.satId, expected 253, is " << last_msg_->stec_residuals[16].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[17].residual, 15292) << "incorrect value for stec_residuals[17].residual, expected 15292, is " << last_msg_->stec_residuals[17].residual; - EXPECT_EQ(last_msg_->stec_residuals[17].sv_id.constellation, 215) << "incorrect value for stec_residuals[17].sv_id.constellation, expected 215, is " << last_msg_->stec_residuals[17].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[17].sv_id.satId, 40) << "incorrect value for stec_residuals[17].sv_id.satId, expected 40, is " << last_msg_->stec_residuals[17].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[18].residual, 29537) << "incorrect value for stec_residuals[18].residual, expected 29537, is " << last_msg_->stec_residuals[18].residual; - EXPECT_EQ(last_msg_->stec_residuals[18].sv_id.constellation, 69) << "incorrect value for stec_residuals[18].sv_id.constellation, expected 69, is " << last_msg_->stec_residuals[18].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[18].sv_id.satId, 117) << "incorrect value for stec_residuals[18].sv_id.satId, expected 117, is " << last_msg_->stec_residuals[18].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[19].residual, -29440) << "incorrect value for stec_residuals[19].residual, expected -29440, is " << last_msg_->stec_residuals[19].residual; - EXPECT_EQ(last_msg_->stec_residuals[19].sv_id.constellation, 56) << "incorrect value for stec_residuals[19].sv_id.constellation, expected 56, is " << last_msg_->stec_residuals[19].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[19].sv_id.satId, 60) << "incorrect value for stec_residuals[19].sv_id.satId, expected 60, is " << last_msg_->stec_residuals[19].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[20].residual, -24266) << "incorrect value for stec_residuals[20].residual, expected -24266, is " << last_msg_->stec_residuals[20].residual; - EXPECT_EQ(last_msg_->stec_residuals[20].sv_id.constellation, 171) << "incorrect value for stec_residuals[20].sv_id.constellation, expected 171, is " << last_msg_->stec_residuals[20].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[20].sv_id.satId, 207) << "incorrect value for stec_residuals[20].sv_id.satId, expected 207, is " << last_msg_->stec_residuals[20].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[21].residual, 22272) << "incorrect value for stec_residuals[21].residual, expected 22272, is " << last_msg_->stec_residuals[21].residual; - EXPECT_EQ(last_msg_->stec_residuals[21].sv_id.constellation, 61) << "incorrect value for stec_residuals[21].sv_id.constellation, expected 61, is " << last_msg_->stec_residuals[21].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[21].sv_id.satId, 23) << "incorrect value for stec_residuals[21].sv_id.satId, expected 23, is " << last_msg_->stec_residuals[21].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[22].residual, 9303) << "incorrect value for stec_residuals[22].residual, expected 9303, is " << last_msg_->stec_residuals[22].residual; - EXPECT_EQ(last_msg_->stec_residuals[22].sv_id.constellation, 123) << "incorrect value for stec_residuals[22].sv_id.constellation, expected 123, is " << last_msg_->stec_residuals[22].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[22].sv_id.satId, 230) << "incorrect value for stec_residuals[22].sv_id.satId, expected 230, is " << last_msg_->stec_residuals[22].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[23].residual, -23794) << "incorrect value for stec_residuals[23].residual, expected -23794, is " << last_msg_->stec_residuals[23].residual; - EXPECT_EQ(last_msg_->stec_residuals[23].sv_id.constellation, 255) << "incorrect value for stec_residuals[23].sv_id.constellation, expected 255, is " << last_msg_->stec_residuals[23].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[23].sv_id.satId, 184) << "incorrect value for stec_residuals[23].sv_id.satId, expected 184, is " << last_msg_->stec_residuals[23].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[24].residual, -26837) << "incorrect value for stec_residuals[24].residual, expected -26837, is " << last_msg_->stec_residuals[24].residual; - EXPECT_EQ(last_msg_->stec_residuals[24].sv_id.constellation, 224) << "incorrect value for stec_residuals[24].sv_id.constellation, expected 224, is " << last_msg_->stec_residuals[24].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[24].sv_id.satId, 187) << "incorrect value for stec_residuals[24].sv_id.satId, expected 187, is " << last_msg_->stec_residuals[24].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[25].residual, 14631) << "incorrect value for stec_residuals[25].residual, expected 14631, is " << last_msg_->stec_residuals[25].residual; - EXPECT_EQ(last_msg_->stec_residuals[25].sv_id.constellation, 104) << "incorrect value for stec_residuals[25].sv_id.constellation, expected 104, is " << last_msg_->stec_residuals[25].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[25].sv_id.satId, 151) << "incorrect value for stec_residuals[25].sv_id.satId, expected 151, is " << last_msg_->stec_residuals[25].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[26].residual, -8144) << "incorrect value for stec_residuals[26].residual, expected -8144, is " << last_msg_->stec_residuals[26].residual; - EXPECT_EQ(last_msg_->stec_residuals[26].sv_id.constellation, 54) << "incorrect value for stec_residuals[26].sv_id.constellation, expected 54, is " << last_msg_->stec_residuals[26].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[26].sv_id.satId, 5) << "incorrect value for stec_residuals[26].sv_id.satId, expected 5, is " << last_msg_->stec_residuals[26].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[27].residual, 23612) << "incorrect value for stec_residuals[27].residual, expected 23612, is " << last_msg_->stec_residuals[27].residual; - EXPECT_EQ(last_msg_->stec_residuals[27].sv_id.constellation, 129) << "incorrect value for stec_residuals[27].sv_id.constellation, expected 129, is " << last_msg_->stec_residuals[27].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[27].sv_id.satId, 181) << "incorrect value for stec_residuals[27].sv_id.satId, expected 181, is " << last_msg_->stec_residuals[27].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[28].residual, 28013) << "incorrect value for stec_residuals[28].residual, expected 28013, is " << last_msg_->stec_residuals[28].residual; - EXPECT_EQ(last_msg_->stec_residuals[28].sv_id.constellation, 114) << "incorrect value for stec_residuals[28].sv_id.constellation, expected 114, is " << last_msg_->stec_residuals[28].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[28].sv_id.satId, 171) << "incorrect value for stec_residuals[28].sv_id.satId, expected 171, is " << last_msg_->stec_residuals[28].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[29].residual, 2166) << "incorrect value for stec_residuals[29].residual, expected 2166, is " << last_msg_->stec_residuals[29].residual; - EXPECT_EQ(last_msg_->stec_residuals[29].sv_id.constellation, 23) << "incorrect value for stec_residuals[29].sv_id.constellation, expected 23, is " << last_msg_->stec_residuals[29].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[29].sv_id.satId, 12) << "incorrect value for stec_residuals[29].sv_id.satId, expected 12, is " << last_msg_->stec_residuals[29].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[30].residual, -10186) << "incorrect value for stec_residuals[30].residual, expected -10186, is " << last_msg_->stec_residuals[30].residual; - EXPECT_EQ(last_msg_->stec_residuals[30].sv_id.constellation, 159) << "incorrect value for stec_residuals[30].sv_id.constellation, expected 159, is " << last_msg_->stec_residuals[30].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[30].sv_id.satId, 64) << "incorrect value for stec_residuals[30].sv_id.satId, expected 64, is " << last_msg_->stec_residuals[30].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[31].residual, 17432) << "incorrect value for stec_residuals[31].residual, expected 17432, is " << last_msg_->stec_residuals[31].residual; - EXPECT_EQ(last_msg_->stec_residuals[31].sv_id.constellation, 20) << "incorrect value for stec_residuals[31].sv_id.constellation, expected 20, is " << last_msg_->stec_residuals[31].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[31].sv_id.satId, 33) << "incorrect value for stec_residuals[31].sv_id.satId, expected 33, is " << last_msg_->stec_residuals[31].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[32].residual, -8666) << "incorrect value for stec_residuals[32].residual, expected -8666, is " << last_msg_->stec_residuals[32].residual; - EXPECT_EQ(last_msg_->stec_residuals[32].sv_id.constellation, 36) << "incorrect value for stec_residuals[32].sv_id.constellation, expected 36, is " << last_msg_->stec_residuals[32].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[32].sv_id.satId, 160) << "incorrect value for stec_residuals[32].sv_id.satId, expected 160, is " << last_msg_->stec_residuals[32].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[33].residual, 25436) << "incorrect value for stec_residuals[33].residual, expected 25436, is " << last_msg_->stec_residuals[33].residual; - EXPECT_EQ(last_msg_->stec_residuals[33].sv_id.constellation, 190) << "incorrect value for stec_residuals[33].sv_id.constellation, expected 190, is " << last_msg_->stec_residuals[33].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[33].sv_id.satId, 145) << "incorrect value for stec_residuals[33].sv_id.satId, expected 145, is " << last_msg_->stec_residuals[33].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[34].residual, -3864) << "incorrect value for stec_residuals[34].residual, expected -3864, is " << last_msg_->stec_residuals[34].residual; - EXPECT_EQ(last_msg_->stec_residuals[34].sv_id.constellation, 159) << "incorrect value for stec_residuals[34].sv_id.constellation, expected 159, is " << last_msg_->stec_residuals[34].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[34].sv_id.satId, 108) << "incorrect value for stec_residuals[34].sv_id.satId, expected 108, is " << last_msg_->stec_residuals[34].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[35].residual, 4093) << "incorrect value for stec_residuals[35].residual, expected 4093, is " << last_msg_->stec_residuals[35].residual; - EXPECT_EQ(last_msg_->stec_residuals[35].sv_id.constellation, 221) << "incorrect value for stec_residuals[35].sv_id.constellation, expected 221, is " << last_msg_->stec_residuals[35].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[35].sv_id.satId, 227) << "incorrect value for stec_residuals[35].sv_id.satId, expected 227, is " << last_msg_->stec_residuals[35].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[36].residual, -18055) << "incorrect value for stec_residuals[36].residual, expected -18055, is " << last_msg_->stec_residuals[36].residual; - EXPECT_EQ(last_msg_->stec_residuals[36].sv_id.constellation, 23) << "incorrect value for stec_residuals[36].sv_id.constellation, expected 23, is " << last_msg_->stec_residuals[36].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[36].sv_id.satId, 62) << "incorrect value for stec_residuals[36].sv_id.satId, expected 62, is " << last_msg_->stec_residuals[36].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[37].residual, -27900) << "incorrect value for stec_residuals[37].residual, expected -27900, is " << last_msg_->stec_residuals[37].residual; - EXPECT_EQ(last_msg_->stec_residuals[37].sv_id.constellation, 116) << "incorrect value for stec_residuals[37].sv_id.constellation, expected 116, is " << last_msg_->stec_residuals[37].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[37].sv_id.satId, 168) << "incorrect value for stec_residuals[37].sv_id.satId, expected 168, is " << last_msg_->stec_residuals[37].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[38].residual, 30687) << "incorrect value for stec_residuals[38].residual, expected 30687, is " << last_msg_->stec_residuals[38].residual; - EXPECT_EQ(last_msg_->stec_residuals[38].sv_id.constellation, 72) << "incorrect value for stec_residuals[38].sv_id.constellation, expected 72, is " << last_msg_->stec_residuals[38].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[38].sv_id.satId, 123) << "incorrect value for stec_residuals[38].sv_id.satId, expected 123, is " << last_msg_->stec_residuals[38].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[39].residual, -13151) << "incorrect value for stec_residuals[39].residual, expected -13151, is " << last_msg_->stec_residuals[39].residual; - EXPECT_EQ(last_msg_->stec_residuals[39].sv_id.constellation, 242) << "incorrect value for stec_residuals[39].sv_id.constellation, expected 242, is " << last_msg_->stec_residuals[39].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[39].sv_id.satId, 226) << "incorrect value for stec_residuals[39].sv_id.satId, expected 226, is " << last_msg_->stec_residuals[39].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[40].residual, -22903) << "incorrect value for stec_residuals[40].residual, expected -22903, is " << last_msg_->stec_residuals[40].residual; - EXPECT_EQ(last_msg_->stec_residuals[40].sv_id.constellation, 202) << "incorrect value for stec_residuals[40].sv_id.constellation, expected 202, is " << last_msg_->stec_residuals[40].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[40].sv_id.satId, 180) << "incorrect value for stec_residuals[40].sv_id.satId, expected 180, is " << last_msg_->stec_residuals[40].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[41].residual, 4988) << "incorrect value for stec_residuals[41].residual, expected 4988, is " << last_msg_->stec_residuals[41].residual; - EXPECT_EQ(last_msg_->stec_residuals[41].sv_id.constellation, 24) << "incorrect value for stec_residuals[41].sv_id.constellation, expected 24, is " << last_msg_->stec_residuals[41].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[41].sv_id.satId, 58) << "incorrect value for stec_residuals[41].sv_id.satId, expected 58, is " << last_msg_->stec_residuals[41].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[42].residual, 27408) << "incorrect value for stec_residuals[42].residual, expected 27408, is " << last_msg_->stec_residuals[42].residual; - EXPECT_EQ(last_msg_->stec_residuals[42].sv_id.constellation, 188) << "incorrect value for stec_residuals[42].sv_id.constellation, expected 188, is " << last_msg_->stec_residuals[42].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[42].sv_id.satId, 181) << "incorrect value for stec_residuals[42].sv_id.satId, expected 181, is " << last_msg_->stec_residuals[42].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[43].residual, 319) << "incorrect value for stec_residuals[43].residual, expected 319, is " << last_msg_->stec_residuals[43].residual; - EXPECT_EQ(last_msg_->stec_residuals[43].sv_id.constellation, 231) << "incorrect value for stec_residuals[43].sv_id.constellation, expected 231, is " << last_msg_->stec_residuals[43].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[43].sv_id.satId, 66) << "incorrect value for stec_residuals[43].sv_id.satId, expected 66, is " << last_msg_->stec_residuals[43].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[44].residual, 15987) << "incorrect value for stec_residuals[44].residual, expected 15987, is " << last_msg_->stec_residuals[44].residual; - EXPECT_EQ(last_msg_->stec_residuals[44].sv_id.constellation, 252) << "incorrect value for stec_residuals[44].sv_id.constellation, expected 252, is " << last_msg_->stec_residuals[44].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[44].sv_id.satId, 64) << "incorrect value for stec_residuals[44].sv_id.satId, expected 64, is " << last_msg_->stec_residuals[44].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[45].residual, 22266) << "incorrect value for stec_residuals[45].residual, expected 22266, is " << last_msg_->stec_residuals[45].residual; - EXPECT_EQ(last_msg_->stec_residuals[45].sv_id.constellation, 97) << "incorrect value for stec_residuals[45].sv_id.constellation, expected 97, is " << last_msg_->stec_residuals[45].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[45].sv_id.satId, 233) << "incorrect value for stec_residuals[45].sv_id.satId, expected 233, is " << last_msg_->stec_residuals[45].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[46].residual, -19919) << "incorrect value for stec_residuals[46].residual, expected -19919, is " << last_msg_->stec_residuals[46].residual; - EXPECT_EQ(last_msg_->stec_residuals[46].sv_id.constellation, 221) << "incorrect value for stec_residuals[46].sv_id.constellation, expected 221, is " << last_msg_->stec_residuals[46].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[46].sv_id.satId, 156) << "incorrect value for stec_residuals[46].sv_id.satId, expected 156, is " << last_msg_->stec_residuals[46].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[47].residual, 17350) << "incorrect value for stec_residuals[47].residual, expected 17350, is " << last_msg_->stec_residuals[47].residual; - EXPECT_EQ(last_msg_->stec_residuals[47].sv_id.constellation, 73) << "incorrect value for stec_residuals[47].sv_id.constellation, expected 73, is " << last_msg_->stec_residuals[47].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[47].sv_id.satId, 32) << "incorrect value for stec_residuals[47].sv_id.satId, expected 32, is " << last_msg_->stec_residuals[47].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[48].residual, 14410) << "incorrect value for stec_residuals[48].residual, expected 14410, is " << last_msg_->stec_residuals[48].residual; - EXPECT_EQ(last_msg_->stec_residuals[48].sv_id.constellation, 253) << "incorrect value for stec_residuals[48].sv_id.constellation, expected 253, is " << last_msg_->stec_residuals[48].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[48].sv_id.satId, 249) << "incorrect value for stec_residuals[48].sv_id.satId, expected 249, is " << last_msg_->stec_residuals[48].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[49].residual, 23671) << "incorrect value for stec_residuals[49].residual, expected 23671, is " << last_msg_->stec_residuals[49].residual; - EXPECT_EQ(last_msg_->stec_residuals[49].sv_id.constellation, 165) << "incorrect value for stec_residuals[49].sv_id.constellation, expected 165, is " << last_msg_->stec_residuals[49].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[49].sv_id.satId, 38) << "incorrect value for stec_residuals[49].sv_id.satId, expected 38, is " << last_msg_->stec_residuals[49].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[50].residual, -31905) << "incorrect value for stec_residuals[50].residual, expected -31905, is " << last_msg_->stec_residuals[50].residual; - EXPECT_EQ(last_msg_->stec_residuals[50].sv_id.constellation, 44) << "incorrect value for stec_residuals[50].sv_id.constellation, expected 44, is " << last_msg_->stec_residuals[50].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[50].sv_id.satId, 99) << "incorrect value for stec_residuals[50].sv_id.satId, expected 99, is " << last_msg_->stec_residuals[50].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[51].residual, 14305) << "incorrect value for stec_residuals[51].residual, expected 14305, is " << last_msg_->stec_residuals[51].residual; - EXPECT_EQ(last_msg_->stec_residuals[51].sv_id.constellation, 192) << "incorrect value for stec_residuals[51].sv_id.constellation, expected 192, is " << last_msg_->stec_residuals[51].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[51].sv_id.satId, 89) << "incorrect value for stec_residuals[51].sv_id.satId, expected 89, is " << last_msg_->stec_residuals[51].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[52].residual, -12968) << "incorrect value for stec_residuals[52].residual, expected -12968, is " << last_msg_->stec_residuals[52].residual; - EXPECT_EQ(last_msg_->stec_residuals[52].sv_id.constellation, 171) << "incorrect value for stec_residuals[52].sv_id.constellation, expected 171, is " << last_msg_->stec_residuals[52].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[52].sv_id.satId, 95) << "incorrect value for stec_residuals[52].sv_id.satId, expected 95, is " << last_msg_->stec_residuals[52].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[53].residual, 21479) << "incorrect value for stec_residuals[53].residual, expected 21479, is " << last_msg_->stec_residuals[53].residual; - EXPECT_EQ(last_msg_->stec_residuals[53].sv_id.constellation, 116) << "incorrect value for stec_residuals[53].sv_id.constellation, expected 116, is " << last_msg_->stec_residuals[53].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[53].sv_id.satId, 21) << "incorrect value for stec_residuals[53].sv_id.satId, expected 21, is " << last_msg_->stec_residuals[53].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[54].residual, 28260) << "incorrect value for stec_residuals[54].residual, expected 28260, is " << last_msg_->stec_residuals[54].residual; - EXPECT_EQ(last_msg_->stec_residuals[54].sv_id.constellation, 71) << "incorrect value for stec_residuals[54].sv_id.constellation, expected 71, is " << last_msg_->stec_residuals[54].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[54].sv_id.satId, 71) << "incorrect value for stec_residuals[54].sv_id.satId, expected 71, is " << last_msg_->stec_residuals[54].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[55].residual, -11112) << "incorrect value for stec_residuals[55].residual, expected -11112, is " << last_msg_->stec_residuals[55].residual; - EXPECT_EQ(last_msg_->stec_residuals[55].sv_id.constellation, 254) << "incorrect value for stec_residuals[55].sv_id.constellation, expected 254, is " << last_msg_->stec_residuals[55].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[55].sv_id.satId, 217) << "incorrect value for stec_residuals[55].sv_id.satId, expected 217, is " << last_msg_->stec_residuals[55].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[56].residual, -25304) << "incorrect value for stec_residuals[56].residual, expected -25304, is " << last_msg_->stec_residuals[56].residual; - EXPECT_EQ(last_msg_->stec_residuals[56].sv_id.constellation, 8) << "incorrect value for stec_residuals[56].sv_id.constellation, expected 8, is " << last_msg_->stec_residuals[56].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[56].sv_id.satId, 18) << "incorrect value for stec_residuals[56].sv_id.satId, expected 18, is " << last_msg_->stec_residuals[56].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[57].residual, -4024) << "incorrect value for stec_residuals[57].residual, expected -4024, is " << last_msg_->stec_residuals[57].residual; - EXPECT_EQ(last_msg_->stec_residuals[57].sv_id.constellation, 54) << "incorrect value for stec_residuals[57].sv_id.constellation, expected 54, is " << last_msg_->stec_residuals[57].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[57].sv_id.satId, 244) << "incorrect value for stec_residuals[57].sv_id.satId, expected 244, is " << last_msg_->stec_residuals[57].sv_id.satId; - EXPECT_EQ(last_msg_->stec_residuals[58].residual, -15505) << "incorrect value for stec_residuals[58].residual, expected -15505, is " << last_msg_->stec_residuals[58].residual; - EXPECT_EQ(last_msg_->stec_residuals[58].sv_id.constellation, 189) << "incorrect value for stec_residuals[58].sv_id.constellation, expected 189, is " << last_msg_->stec_residuals[58].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_residuals[58].sv_id.satId, 231) << "incorrect value for stec_residuals[58].sv_id.satId, expected 231, is " << last_msg_->stec_residuals[58].sv_id.satId; - EXPECT_EQ(last_msg_->tropo_delay_correction.hydro, 16250) << "incorrect value for tropo_delay_correction.hydro, expected 16250, is " << last_msg_->tropo_delay_correction.hydro; - EXPECT_EQ(last_msg_->tropo_delay_correction.wet, 101) << "incorrect value for tropo_delay_correction.wet, expected 101, is " << last_msg_->tropo_delay_correction.wet; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 7270); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.iod_atmo, 236) + << "incorrect value for header.iod_atmo, expected 236, is " + << last_msg_->header.iod_atmo; + EXPECT_EQ(last_msg_->header.num_msgs, 62837) + << "incorrect value for header.num_msgs, expected 62837, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.seq_num, 63555) + << "incorrect value for header.seq_num, expected 63555, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->header.time.tow, 2837573811) + << "incorrect value for header.time.tow, expected 2837573811, is " + << last_msg_->header.time.tow; + EXPECT_EQ(last_msg_->header.time.wn, 8940) + << "incorrect value for header.time.wn, expected 8940, is " + << last_msg_->header.time.wn; + EXPECT_EQ(last_msg_->header.tropo_quality_indicator, 230) + << "incorrect value for header.tropo_quality_indicator, expected 230, is " + << last_msg_->header.tropo_quality_indicator; + EXPECT_EQ(last_msg_->header.update_interval, 233) + << "incorrect value for header.update_interval, expected 233, is " + << last_msg_->header.update_interval; + EXPECT_EQ(last_msg_->index, 26598) + << "incorrect value for index, expected 26598, is " << last_msg_->index; + EXPECT_EQ(last_msg_->stec_residuals[0].residual, -23949) + << "incorrect value for stec_residuals[0].residual, expected -23949, is " + << last_msg_->stec_residuals[0].residual; + EXPECT_EQ(last_msg_->stec_residuals[0].sv_id.constellation, 157) + << "incorrect value for stec_residuals[0].sv_id.constellation, expected " + "157, is " + << last_msg_->stec_residuals[0].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[0].sv_id.satId, 231) + << "incorrect value for stec_residuals[0].sv_id.satId, expected 231, is " + << last_msg_->stec_residuals[0].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[1].residual, 27427) + << "incorrect value for stec_residuals[1].residual, expected 27427, is " + << last_msg_->stec_residuals[1].residual; + EXPECT_EQ(last_msg_->stec_residuals[1].sv_id.constellation, 146) + << "incorrect value for stec_residuals[1].sv_id.constellation, expected " + "146, is " + << last_msg_->stec_residuals[1].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[1].sv_id.satId, 197) + << "incorrect value for stec_residuals[1].sv_id.satId, expected 197, is " + << last_msg_->stec_residuals[1].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[2].residual, 10548) + << "incorrect value for stec_residuals[2].residual, expected 10548, is " + << last_msg_->stec_residuals[2].residual; + EXPECT_EQ(last_msg_->stec_residuals[2].sv_id.constellation, 109) + << "incorrect value for stec_residuals[2].sv_id.constellation, expected " + "109, is " + << last_msg_->stec_residuals[2].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[2].sv_id.satId, 222) + << "incorrect value for stec_residuals[2].sv_id.satId, expected 222, is " + << last_msg_->stec_residuals[2].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[3].residual, -18195) + << "incorrect value for stec_residuals[3].residual, expected -18195, is " + << last_msg_->stec_residuals[3].residual; + EXPECT_EQ(last_msg_->stec_residuals[3].sv_id.constellation, 12) + << "incorrect value for stec_residuals[3].sv_id.constellation, expected " + "12, is " + << last_msg_->stec_residuals[3].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[3].sv_id.satId, 86) + << "incorrect value for stec_residuals[3].sv_id.satId, expected 86, is " + << last_msg_->stec_residuals[3].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[4].residual, -27511) + << "incorrect value for stec_residuals[4].residual, expected -27511, is " + << last_msg_->stec_residuals[4].residual; + EXPECT_EQ(last_msg_->stec_residuals[4].sv_id.constellation, 204) + << "incorrect value for stec_residuals[4].sv_id.constellation, expected " + "204, is " + << last_msg_->stec_residuals[4].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[4].sv_id.satId, 65) + << "incorrect value for stec_residuals[4].sv_id.satId, expected 65, is " + << last_msg_->stec_residuals[4].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[5].residual, 11) + << "incorrect value for stec_residuals[5].residual, expected 11, is " + << last_msg_->stec_residuals[5].residual; + EXPECT_EQ(last_msg_->stec_residuals[5].sv_id.constellation, 183) + << "incorrect value for stec_residuals[5].sv_id.constellation, expected " + "183, is " + << last_msg_->stec_residuals[5].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[5].sv_id.satId, 171) + << "incorrect value for stec_residuals[5].sv_id.satId, expected 171, is " + << last_msg_->stec_residuals[5].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[6].residual, 13740) + << "incorrect value for stec_residuals[6].residual, expected 13740, is " + << last_msg_->stec_residuals[6].residual; + EXPECT_EQ(last_msg_->stec_residuals[6].sv_id.constellation, 203) + << "incorrect value for stec_residuals[6].sv_id.constellation, expected " + "203, is " + << last_msg_->stec_residuals[6].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[6].sv_id.satId, 180) + << "incorrect value for stec_residuals[6].sv_id.satId, expected 180, is " + << last_msg_->stec_residuals[6].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[7].residual, 29626) + << "incorrect value for stec_residuals[7].residual, expected 29626, is " + << last_msg_->stec_residuals[7].residual; + EXPECT_EQ(last_msg_->stec_residuals[7].sv_id.constellation, 85) + << "incorrect value for stec_residuals[7].sv_id.constellation, expected " + "85, is " + << last_msg_->stec_residuals[7].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[7].sv_id.satId, 196) + << "incorrect value for stec_residuals[7].sv_id.satId, expected 196, is " + << last_msg_->stec_residuals[7].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[8].residual, 7846) + << "incorrect value for stec_residuals[8].residual, expected 7846, is " + << last_msg_->stec_residuals[8].residual; + EXPECT_EQ(last_msg_->stec_residuals[8].sv_id.constellation, 92) + << "incorrect value for stec_residuals[8].sv_id.constellation, expected " + "92, is " + << last_msg_->stec_residuals[8].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[8].sv_id.satId, 203) + << "incorrect value for stec_residuals[8].sv_id.satId, expected 203, is " + << last_msg_->stec_residuals[8].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[9].residual, 18376) + << "incorrect value for stec_residuals[9].residual, expected 18376, is " + << last_msg_->stec_residuals[9].residual; + EXPECT_EQ(last_msg_->stec_residuals[9].sv_id.constellation, 13) + << "incorrect value for stec_residuals[9].sv_id.constellation, expected " + "13, is " + << last_msg_->stec_residuals[9].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[9].sv_id.satId, 42) + << "incorrect value for stec_residuals[9].sv_id.satId, expected 42, is " + << last_msg_->stec_residuals[9].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[10].residual, -24357) + << "incorrect value for stec_residuals[10].residual, expected -24357, is " + << last_msg_->stec_residuals[10].residual; + EXPECT_EQ(last_msg_->stec_residuals[10].sv_id.constellation, 137) + << "incorrect value for stec_residuals[10].sv_id.constellation, expected " + "137, is " + << last_msg_->stec_residuals[10].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[10].sv_id.satId, 98) + << "incorrect value for stec_residuals[10].sv_id.satId, expected 98, is " + << last_msg_->stec_residuals[10].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[11].residual, -1441) + << "incorrect value for stec_residuals[11].residual, expected -1441, is " + << last_msg_->stec_residuals[11].residual; + EXPECT_EQ(last_msg_->stec_residuals[11].sv_id.constellation, 216) + << "incorrect value for stec_residuals[11].sv_id.constellation, expected " + "216, is " + << last_msg_->stec_residuals[11].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[11].sv_id.satId, 95) + << "incorrect value for stec_residuals[11].sv_id.satId, expected 95, is " + << last_msg_->stec_residuals[11].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[12].residual, -10660) + << "incorrect value for stec_residuals[12].residual, expected -10660, is " + << last_msg_->stec_residuals[12].residual; + EXPECT_EQ(last_msg_->stec_residuals[12].sv_id.constellation, 196) + << "incorrect value for stec_residuals[12].sv_id.constellation, expected " + "196, is " + << last_msg_->stec_residuals[12].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[12].sv_id.satId, 99) + << "incorrect value for stec_residuals[12].sv_id.satId, expected 99, is " + << last_msg_->stec_residuals[12].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[13].residual, -8509) + << "incorrect value for stec_residuals[13].residual, expected -8509, is " + << last_msg_->stec_residuals[13].residual; + EXPECT_EQ(last_msg_->stec_residuals[13].sv_id.constellation, 253) + << "incorrect value for stec_residuals[13].sv_id.constellation, expected " + "253, is " + << last_msg_->stec_residuals[13].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[13].sv_id.satId, 159) + << "incorrect value for stec_residuals[13].sv_id.satId, expected 159, is " + << last_msg_->stec_residuals[13].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[14].residual, 16361) + << "incorrect value for stec_residuals[14].residual, expected 16361, is " + << last_msg_->stec_residuals[14].residual; + EXPECT_EQ(last_msg_->stec_residuals[14].sv_id.constellation, 146) + << "incorrect value for stec_residuals[14].sv_id.constellation, expected " + "146, is " + << last_msg_->stec_residuals[14].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[14].sv_id.satId, 233) + << "incorrect value for stec_residuals[14].sv_id.satId, expected 233, is " + << last_msg_->stec_residuals[14].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[15].residual, 10346) + << "incorrect value for stec_residuals[15].residual, expected 10346, is " + << last_msg_->stec_residuals[15].residual; + EXPECT_EQ(last_msg_->stec_residuals[15].sv_id.constellation, 24) + << "incorrect value for stec_residuals[15].sv_id.constellation, expected " + "24, is " + << last_msg_->stec_residuals[15].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[15].sv_id.satId, 76) + << "incorrect value for stec_residuals[15].sv_id.satId, expected 76, is " + << last_msg_->stec_residuals[15].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[16].residual, -18679) + << "incorrect value for stec_residuals[16].residual, expected -18679, is " + << last_msg_->stec_residuals[16].residual; + EXPECT_EQ(last_msg_->stec_residuals[16].sv_id.constellation, 65) + << "incorrect value for stec_residuals[16].sv_id.constellation, expected " + "65, is " + << last_msg_->stec_residuals[16].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[16].sv_id.satId, 253) + << "incorrect value for stec_residuals[16].sv_id.satId, expected 253, is " + << last_msg_->stec_residuals[16].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[17].residual, 15292) + << "incorrect value for stec_residuals[17].residual, expected 15292, is " + << last_msg_->stec_residuals[17].residual; + EXPECT_EQ(last_msg_->stec_residuals[17].sv_id.constellation, 215) + << "incorrect value for stec_residuals[17].sv_id.constellation, expected " + "215, is " + << last_msg_->stec_residuals[17].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[17].sv_id.satId, 40) + << "incorrect value for stec_residuals[17].sv_id.satId, expected 40, is " + << last_msg_->stec_residuals[17].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[18].residual, 29537) + << "incorrect value for stec_residuals[18].residual, expected 29537, is " + << last_msg_->stec_residuals[18].residual; + EXPECT_EQ(last_msg_->stec_residuals[18].sv_id.constellation, 69) + << "incorrect value for stec_residuals[18].sv_id.constellation, expected " + "69, is " + << last_msg_->stec_residuals[18].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[18].sv_id.satId, 117) + << "incorrect value for stec_residuals[18].sv_id.satId, expected 117, is " + << last_msg_->stec_residuals[18].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[19].residual, -29440) + << "incorrect value for stec_residuals[19].residual, expected -29440, is " + << last_msg_->stec_residuals[19].residual; + EXPECT_EQ(last_msg_->stec_residuals[19].sv_id.constellation, 56) + << "incorrect value for stec_residuals[19].sv_id.constellation, expected " + "56, is " + << last_msg_->stec_residuals[19].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[19].sv_id.satId, 60) + << "incorrect value for stec_residuals[19].sv_id.satId, expected 60, is " + << last_msg_->stec_residuals[19].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[20].residual, -24266) + << "incorrect value for stec_residuals[20].residual, expected -24266, is " + << last_msg_->stec_residuals[20].residual; + EXPECT_EQ(last_msg_->stec_residuals[20].sv_id.constellation, 171) + << "incorrect value for stec_residuals[20].sv_id.constellation, expected " + "171, is " + << last_msg_->stec_residuals[20].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[20].sv_id.satId, 207) + << "incorrect value for stec_residuals[20].sv_id.satId, expected 207, is " + << last_msg_->stec_residuals[20].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[21].residual, 22272) + << "incorrect value for stec_residuals[21].residual, expected 22272, is " + << last_msg_->stec_residuals[21].residual; + EXPECT_EQ(last_msg_->stec_residuals[21].sv_id.constellation, 61) + << "incorrect value for stec_residuals[21].sv_id.constellation, expected " + "61, is " + << last_msg_->stec_residuals[21].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[21].sv_id.satId, 23) + << "incorrect value for stec_residuals[21].sv_id.satId, expected 23, is " + << last_msg_->stec_residuals[21].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[22].residual, 9303) + << "incorrect value for stec_residuals[22].residual, expected 9303, is " + << last_msg_->stec_residuals[22].residual; + EXPECT_EQ(last_msg_->stec_residuals[22].sv_id.constellation, 123) + << "incorrect value for stec_residuals[22].sv_id.constellation, expected " + "123, is " + << last_msg_->stec_residuals[22].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[22].sv_id.satId, 230) + << "incorrect value for stec_residuals[22].sv_id.satId, expected 230, is " + << last_msg_->stec_residuals[22].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[23].residual, -23794) + << "incorrect value for stec_residuals[23].residual, expected -23794, is " + << last_msg_->stec_residuals[23].residual; + EXPECT_EQ(last_msg_->stec_residuals[23].sv_id.constellation, 255) + << "incorrect value for stec_residuals[23].sv_id.constellation, expected " + "255, is " + << last_msg_->stec_residuals[23].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[23].sv_id.satId, 184) + << "incorrect value for stec_residuals[23].sv_id.satId, expected 184, is " + << last_msg_->stec_residuals[23].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[24].residual, -26837) + << "incorrect value for stec_residuals[24].residual, expected -26837, is " + << last_msg_->stec_residuals[24].residual; + EXPECT_EQ(last_msg_->stec_residuals[24].sv_id.constellation, 224) + << "incorrect value for stec_residuals[24].sv_id.constellation, expected " + "224, is " + << last_msg_->stec_residuals[24].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[24].sv_id.satId, 187) + << "incorrect value for stec_residuals[24].sv_id.satId, expected 187, is " + << last_msg_->stec_residuals[24].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[25].residual, 14631) + << "incorrect value for stec_residuals[25].residual, expected 14631, is " + << last_msg_->stec_residuals[25].residual; + EXPECT_EQ(last_msg_->stec_residuals[25].sv_id.constellation, 104) + << "incorrect value for stec_residuals[25].sv_id.constellation, expected " + "104, is " + << last_msg_->stec_residuals[25].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[25].sv_id.satId, 151) + << "incorrect value for stec_residuals[25].sv_id.satId, expected 151, is " + << last_msg_->stec_residuals[25].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[26].residual, -8144) + << "incorrect value for stec_residuals[26].residual, expected -8144, is " + << last_msg_->stec_residuals[26].residual; + EXPECT_EQ(last_msg_->stec_residuals[26].sv_id.constellation, 54) + << "incorrect value for stec_residuals[26].sv_id.constellation, expected " + "54, is " + << last_msg_->stec_residuals[26].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[26].sv_id.satId, 5) + << "incorrect value for stec_residuals[26].sv_id.satId, expected 5, is " + << last_msg_->stec_residuals[26].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[27].residual, 23612) + << "incorrect value for stec_residuals[27].residual, expected 23612, is " + << last_msg_->stec_residuals[27].residual; + EXPECT_EQ(last_msg_->stec_residuals[27].sv_id.constellation, 129) + << "incorrect value for stec_residuals[27].sv_id.constellation, expected " + "129, is " + << last_msg_->stec_residuals[27].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[27].sv_id.satId, 181) + << "incorrect value for stec_residuals[27].sv_id.satId, expected 181, is " + << last_msg_->stec_residuals[27].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[28].residual, 28013) + << "incorrect value for stec_residuals[28].residual, expected 28013, is " + << last_msg_->stec_residuals[28].residual; + EXPECT_EQ(last_msg_->stec_residuals[28].sv_id.constellation, 114) + << "incorrect value for stec_residuals[28].sv_id.constellation, expected " + "114, is " + << last_msg_->stec_residuals[28].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[28].sv_id.satId, 171) + << "incorrect value for stec_residuals[28].sv_id.satId, expected 171, is " + << last_msg_->stec_residuals[28].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[29].residual, 2166) + << "incorrect value for stec_residuals[29].residual, expected 2166, is " + << last_msg_->stec_residuals[29].residual; + EXPECT_EQ(last_msg_->stec_residuals[29].sv_id.constellation, 23) + << "incorrect value for stec_residuals[29].sv_id.constellation, expected " + "23, is " + << last_msg_->stec_residuals[29].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[29].sv_id.satId, 12) + << "incorrect value for stec_residuals[29].sv_id.satId, expected 12, is " + << last_msg_->stec_residuals[29].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[30].residual, -10186) + << "incorrect value for stec_residuals[30].residual, expected -10186, is " + << last_msg_->stec_residuals[30].residual; + EXPECT_EQ(last_msg_->stec_residuals[30].sv_id.constellation, 159) + << "incorrect value for stec_residuals[30].sv_id.constellation, expected " + "159, is " + << last_msg_->stec_residuals[30].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[30].sv_id.satId, 64) + << "incorrect value for stec_residuals[30].sv_id.satId, expected 64, is " + << last_msg_->stec_residuals[30].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[31].residual, 17432) + << "incorrect value for stec_residuals[31].residual, expected 17432, is " + << last_msg_->stec_residuals[31].residual; + EXPECT_EQ(last_msg_->stec_residuals[31].sv_id.constellation, 20) + << "incorrect value for stec_residuals[31].sv_id.constellation, expected " + "20, is " + << last_msg_->stec_residuals[31].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[31].sv_id.satId, 33) + << "incorrect value for stec_residuals[31].sv_id.satId, expected 33, is " + << last_msg_->stec_residuals[31].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[32].residual, -8666) + << "incorrect value for stec_residuals[32].residual, expected -8666, is " + << last_msg_->stec_residuals[32].residual; + EXPECT_EQ(last_msg_->stec_residuals[32].sv_id.constellation, 36) + << "incorrect value for stec_residuals[32].sv_id.constellation, expected " + "36, is " + << last_msg_->stec_residuals[32].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[32].sv_id.satId, 160) + << "incorrect value for stec_residuals[32].sv_id.satId, expected 160, is " + << last_msg_->stec_residuals[32].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[33].residual, 25436) + << "incorrect value for stec_residuals[33].residual, expected 25436, is " + << last_msg_->stec_residuals[33].residual; + EXPECT_EQ(last_msg_->stec_residuals[33].sv_id.constellation, 190) + << "incorrect value for stec_residuals[33].sv_id.constellation, expected " + "190, is " + << last_msg_->stec_residuals[33].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[33].sv_id.satId, 145) + << "incorrect value for stec_residuals[33].sv_id.satId, expected 145, is " + << last_msg_->stec_residuals[33].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[34].residual, -3864) + << "incorrect value for stec_residuals[34].residual, expected -3864, is " + << last_msg_->stec_residuals[34].residual; + EXPECT_EQ(last_msg_->stec_residuals[34].sv_id.constellation, 159) + << "incorrect value for stec_residuals[34].sv_id.constellation, expected " + "159, is " + << last_msg_->stec_residuals[34].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[34].sv_id.satId, 108) + << "incorrect value for stec_residuals[34].sv_id.satId, expected 108, is " + << last_msg_->stec_residuals[34].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[35].residual, 4093) + << "incorrect value for stec_residuals[35].residual, expected 4093, is " + << last_msg_->stec_residuals[35].residual; + EXPECT_EQ(last_msg_->stec_residuals[35].sv_id.constellation, 221) + << "incorrect value for stec_residuals[35].sv_id.constellation, expected " + "221, is " + << last_msg_->stec_residuals[35].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[35].sv_id.satId, 227) + << "incorrect value for stec_residuals[35].sv_id.satId, expected 227, is " + << last_msg_->stec_residuals[35].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[36].residual, -18055) + << "incorrect value for stec_residuals[36].residual, expected -18055, is " + << last_msg_->stec_residuals[36].residual; + EXPECT_EQ(last_msg_->stec_residuals[36].sv_id.constellation, 23) + << "incorrect value for stec_residuals[36].sv_id.constellation, expected " + "23, is " + << last_msg_->stec_residuals[36].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[36].sv_id.satId, 62) + << "incorrect value for stec_residuals[36].sv_id.satId, expected 62, is " + << last_msg_->stec_residuals[36].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[37].residual, -27900) + << "incorrect value for stec_residuals[37].residual, expected -27900, is " + << last_msg_->stec_residuals[37].residual; + EXPECT_EQ(last_msg_->stec_residuals[37].sv_id.constellation, 116) + << "incorrect value for stec_residuals[37].sv_id.constellation, expected " + "116, is " + << last_msg_->stec_residuals[37].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[37].sv_id.satId, 168) + << "incorrect value for stec_residuals[37].sv_id.satId, expected 168, is " + << last_msg_->stec_residuals[37].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[38].residual, 30687) + << "incorrect value for stec_residuals[38].residual, expected 30687, is " + << last_msg_->stec_residuals[38].residual; + EXPECT_EQ(last_msg_->stec_residuals[38].sv_id.constellation, 72) + << "incorrect value for stec_residuals[38].sv_id.constellation, expected " + "72, is " + << last_msg_->stec_residuals[38].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[38].sv_id.satId, 123) + << "incorrect value for stec_residuals[38].sv_id.satId, expected 123, is " + << last_msg_->stec_residuals[38].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[39].residual, -13151) + << "incorrect value for stec_residuals[39].residual, expected -13151, is " + << last_msg_->stec_residuals[39].residual; + EXPECT_EQ(last_msg_->stec_residuals[39].sv_id.constellation, 242) + << "incorrect value for stec_residuals[39].sv_id.constellation, expected " + "242, is " + << last_msg_->stec_residuals[39].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[39].sv_id.satId, 226) + << "incorrect value for stec_residuals[39].sv_id.satId, expected 226, is " + << last_msg_->stec_residuals[39].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[40].residual, -22903) + << "incorrect value for stec_residuals[40].residual, expected -22903, is " + << last_msg_->stec_residuals[40].residual; + EXPECT_EQ(last_msg_->stec_residuals[40].sv_id.constellation, 202) + << "incorrect value for stec_residuals[40].sv_id.constellation, expected " + "202, is " + << last_msg_->stec_residuals[40].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[40].sv_id.satId, 180) + << "incorrect value for stec_residuals[40].sv_id.satId, expected 180, is " + << last_msg_->stec_residuals[40].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[41].residual, 4988) + << "incorrect value for stec_residuals[41].residual, expected 4988, is " + << last_msg_->stec_residuals[41].residual; + EXPECT_EQ(last_msg_->stec_residuals[41].sv_id.constellation, 24) + << "incorrect value for stec_residuals[41].sv_id.constellation, expected " + "24, is " + << last_msg_->stec_residuals[41].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[41].sv_id.satId, 58) + << "incorrect value for stec_residuals[41].sv_id.satId, expected 58, is " + << last_msg_->stec_residuals[41].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[42].residual, 27408) + << "incorrect value for stec_residuals[42].residual, expected 27408, is " + << last_msg_->stec_residuals[42].residual; + EXPECT_EQ(last_msg_->stec_residuals[42].sv_id.constellation, 188) + << "incorrect value for stec_residuals[42].sv_id.constellation, expected " + "188, is " + << last_msg_->stec_residuals[42].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[42].sv_id.satId, 181) + << "incorrect value for stec_residuals[42].sv_id.satId, expected 181, is " + << last_msg_->stec_residuals[42].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[43].residual, 319) + << "incorrect value for stec_residuals[43].residual, expected 319, is " + << last_msg_->stec_residuals[43].residual; + EXPECT_EQ(last_msg_->stec_residuals[43].sv_id.constellation, 231) + << "incorrect value for stec_residuals[43].sv_id.constellation, expected " + "231, is " + << last_msg_->stec_residuals[43].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[43].sv_id.satId, 66) + << "incorrect value for stec_residuals[43].sv_id.satId, expected 66, is " + << last_msg_->stec_residuals[43].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[44].residual, 15987) + << "incorrect value for stec_residuals[44].residual, expected 15987, is " + << last_msg_->stec_residuals[44].residual; + EXPECT_EQ(last_msg_->stec_residuals[44].sv_id.constellation, 252) + << "incorrect value for stec_residuals[44].sv_id.constellation, expected " + "252, is " + << last_msg_->stec_residuals[44].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[44].sv_id.satId, 64) + << "incorrect value for stec_residuals[44].sv_id.satId, expected 64, is " + << last_msg_->stec_residuals[44].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[45].residual, 22266) + << "incorrect value for stec_residuals[45].residual, expected 22266, is " + << last_msg_->stec_residuals[45].residual; + EXPECT_EQ(last_msg_->stec_residuals[45].sv_id.constellation, 97) + << "incorrect value for stec_residuals[45].sv_id.constellation, expected " + "97, is " + << last_msg_->stec_residuals[45].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[45].sv_id.satId, 233) + << "incorrect value for stec_residuals[45].sv_id.satId, expected 233, is " + << last_msg_->stec_residuals[45].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[46].residual, -19919) + << "incorrect value for stec_residuals[46].residual, expected -19919, is " + << last_msg_->stec_residuals[46].residual; + EXPECT_EQ(last_msg_->stec_residuals[46].sv_id.constellation, 221) + << "incorrect value for stec_residuals[46].sv_id.constellation, expected " + "221, is " + << last_msg_->stec_residuals[46].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[46].sv_id.satId, 156) + << "incorrect value for stec_residuals[46].sv_id.satId, expected 156, is " + << last_msg_->stec_residuals[46].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[47].residual, 17350) + << "incorrect value for stec_residuals[47].residual, expected 17350, is " + << last_msg_->stec_residuals[47].residual; + EXPECT_EQ(last_msg_->stec_residuals[47].sv_id.constellation, 73) + << "incorrect value for stec_residuals[47].sv_id.constellation, expected " + "73, is " + << last_msg_->stec_residuals[47].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[47].sv_id.satId, 32) + << "incorrect value for stec_residuals[47].sv_id.satId, expected 32, is " + << last_msg_->stec_residuals[47].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[48].residual, 14410) + << "incorrect value for stec_residuals[48].residual, expected 14410, is " + << last_msg_->stec_residuals[48].residual; + EXPECT_EQ(last_msg_->stec_residuals[48].sv_id.constellation, 253) + << "incorrect value for stec_residuals[48].sv_id.constellation, expected " + "253, is " + << last_msg_->stec_residuals[48].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[48].sv_id.satId, 249) + << "incorrect value for stec_residuals[48].sv_id.satId, expected 249, is " + << last_msg_->stec_residuals[48].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[49].residual, 23671) + << "incorrect value for stec_residuals[49].residual, expected 23671, is " + << last_msg_->stec_residuals[49].residual; + EXPECT_EQ(last_msg_->stec_residuals[49].sv_id.constellation, 165) + << "incorrect value for stec_residuals[49].sv_id.constellation, expected " + "165, is " + << last_msg_->stec_residuals[49].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[49].sv_id.satId, 38) + << "incorrect value for stec_residuals[49].sv_id.satId, expected 38, is " + << last_msg_->stec_residuals[49].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[50].residual, -31905) + << "incorrect value for stec_residuals[50].residual, expected -31905, is " + << last_msg_->stec_residuals[50].residual; + EXPECT_EQ(last_msg_->stec_residuals[50].sv_id.constellation, 44) + << "incorrect value for stec_residuals[50].sv_id.constellation, expected " + "44, is " + << last_msg_->stec_residuals[50].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[50].sv_id.satId, 99) + << "incorrect value for stec_residuals[50].sv_id.satId, expected 99, is " + << last_msg_->stec_residuals[50].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[51].residual, 14305) + << "incorrect value for stec_residuals[51].residual, expected 14305, is " + << last_msg_->stec_residuals[51].residual; + EXPECT_EQ(last_msg_->stec_residuals[51].sv_id.constellation, 192) + << "incorrect value for stec_residuals[51].sv_id.constellation, expected " + "192, is " + << last_msg_->stec_residuals[51].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[51].sv_id.satId, 89) + << "incorrect value for stec_residuals[51].sv_id.satId, expected 89, is " + << last_msg_->stec_residuals[51].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[52].residual, -12968) + << "incorrect value for stec_residuals[52].residual, expected -12968, is " + << last_msg_->stec_residuals[52].residual; + EXPECT_EQ(last_msg_->stec_residuals[52].sv_id.constellation, 171) + << "incorrect value for stec_residuals[52].sv_id.constellation, expected " + "171, is " + << last_msg_->stec_residuals[52].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[52].sv_id.satId, 95) + << "incorrect value for stec_residuals[52].sv_id.satId, expected 95, is " + << last_msg_->stec_residuals[52].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[53].residual, 21479) + << "incorrect value for stec_residuals[53].residual, expected 21479, is " + << last_msg_->stec_residuals[53].residual; + EXPECT_EQ(last_msg_->stec_residuals[53].sv_id.constellation, 116) + << "incorrect value for stec_residuals[53].sv_id.constellation, expected " + "116, is " + << last_msg_->stec_residuals[53].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[53].sv_id.satId, 21) + << "incorrect value for stec_residuals[53].sv_id.satId, expected 21, is " + << last_msg_->stec_residuals[53].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[54].residual, 28260) + << "incorrect value for stec_residuals[54].residual, expected 28260, is " + << last_msg_->stec_residuals[54].residual; + EXPECT_EQ(last_msg_->stec_residuals[54].sv_id.constellation, 71) + << "incorrect value for stec_residuals[54].sv_id.constellation, expected " + "71, is " + << last_msg_->stec_residuals[54].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[54].sv_id.satId, 71) + << "incorrect value for stec_residuals[54].sv_id.satId, expected 71, is " + << last_msg_->stec_residuals[54].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[55].residual, -11112) + << "incorrect value for stec_residuals[55].residual, expected -11112, is " + << last_msg_->stec_residuals[55].residual; + EXPECT_EQ(last_msg_->stec_residuals[55].sv_id.constellation, 254) + << "incorrect value for stec_residuals[55].sv_id.constellation, expected " + "254, is " + << last_msg_->stec_residuals[55].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[55].sv_id.satId, 217) + << "incorrect value for stec_residuals[55].sv_id.satId, expected 217, is " + << last_msg_->stec_residuals[55].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[56].residual, -25304) + << "incorrect value for stec_residuals[56].residual, expected -25304, is " + << last_msg_->stec_residuals[56].residual; + EXPECT_EQ(last_msg_->stec_residuals[56].sv_id.constellation, 8) + << "incorrect value for stec_residuals[56].sv_id.constellation, expected " + "8, is " + << last_msg_->stec_residuals[56].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[56].sv_id.satId, 18) + << "incorrect value for stec_residuals[56].sv_id.satId, expected 18, is " + << last_msg_->stec_residuals[56].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[57].residual, -4024) + << "incorrect value for stec_residuals[57].residual, expected -4024, is " + << last_msg_->stec_residuals[57].residual; + EXPECT_EQ(last_msg_->stec_residuals[57].sv_id.constellation, 54) + << "incorrect value for stec_residuals[57].sv_id.constellation, expected " + "54, is " + << last_msg_->stec_residuals[57].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[57].sv_id.satId, 244) + << "incorrect value for stec_residuals[57].sv_id.satId, expected 244, is " + << last_msg_->stec_residuals[57].sv_id.satId; + EXPECT_EQ(last_msg_->stec_residuals[58].residual, -15505) + << "incorrect value for stec_residuals[58].residual, expected -15505, is " + << last_msg_->stec_residuals[58].residual; + EXPECT_EQ(last_msg_->stec_residuals[58].sv_id.constellation, 189) + << "incorrect value for stec_residuals[58].sv_id.constellation, expected " + "189, is " + << last_msg_->stec_residuals[58].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_residuals[58].sv_id.satId, 231) + << "incorrect value for stec_residuals[58].sv_id.satId, expected 231, is " + << last_msg_->stec_residuals[58].sv_id.satId; + EXPECT_EQ(last_msg_->tropo_delay_correction.hydro, 16250) + << "incorrect value for tropo_delay_correction.hydro, expected 16250, is " + << last_msg_->tropo_delay_correction.hydro; + EXPECT_EQ(last_msg_->tropo_delay_correction.wet, 101) + << "incorrect value for tropo_delay_correction.wet, expected 101, is " + << last_msg_->tropo_delay_correction.wet; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClock.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClock.cc index 080092ab1..f434f6323 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClock.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClock.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClock.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClock.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClock0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClock0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClock0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClock0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_orbit_clock_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_orbit_clock_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,65 +81,94 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClock0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_orbit_clock_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClock0, Test) -{ +}; - uint8_t encoded_frame[] = {85,221,5,53,229,50,83,208,102,207,164,29,203,212,236,255,152,233,207,55,94,54,58,128,68,27,117,176,110,251,61,244,122,50,95,52,144,232,24,10,37,127,163,66,177,105,156,245,10,249,107,218,17,186,56,72,14,22, }; +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClock0, Test) { + uint8_t encoded_frame[] = { + 85, 221, 5, 53, 229, 50, 83, 208, 102, 207, 164, 29, 203, 212, 236, + 255, 152, 233, 207, 55, 94, 54, 58, 128, 68, 27, 117, 176, 110, 251, + 61, 244, 122, 50, 95, 52, 144, 232, 24, 10, 37, 127, 163, 66, 177, + 105, 156, 245, 10, 249, 107, 218, 17, 186, 56, 72, 14, 22, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_orbit_clock_t* test_msg = ( msg_ssr_orbit_clock_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->along = -1334502588; - test_msg->c0 = -174298703; - test_msg->c1 = -630458102; - test_msg->c2 = 1211677201; - test_msg->cross = -197264530; - test_msg->dot_along = 169404560; - test_msg->dot_cross = 1118011173; - test_msg->dot_radial = 878654074; - test_msg->iod = 936372632; - test_msg->iod_ssr = 255; - test_msg->radial = -2143668642; - test_msg->sid.code = 212; - test_msg->sid.sat = 203; - test_msg->time.tow = 3479621715; - test_msg->time.wn = 7588; - test_msg->update_interval = 236; - - EXPECT_EQ(send_message( 0x5dd, 58677, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_orbit_clock_t *test_msg = (msg_ssr_orbit_clock_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->along = -1334502588; + test_msg->c0 = -174298703; + test_msg->c1 = -630458102; + test_msg->c2 = 1211677201; + test_msg->cross = -197264530; + test_msg->dot_along = 169404560; + test_msg->dot_cross = 1118011173; + test_msg->dot_radial = 878654074; + test_msg->iod = 936372632; + test_msg->iod_ssr = 255; + test_msg->radial = -2143668642; + test_msg->sid.code = 212; + test_msg->sid.sat = 203; + test_msg->time.tow = 3479621715; + test_msg->time.wn = 7588; + test_msg->update_interval = 236; + + EXPECT_EQ(send_message(0x5dd, 58677, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 58677); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->along, -1334502588) << "incorrect value for along, expected -1334502588, is " << last_msg_->along; - EXPECT_EQ(last_msg_->c0, -174298703) << "incorrect value for c0, expected -174298703, is " << last_msg_->c0; - EXPECT_EQ(last_msg_->c1, -630458102) << "incorrect value for c1, expected -630458102, is " << last_msg_->c1; - EXPECT_EQ(last_msg_->c2, 1211677201) << "incorrect value for c2, expected 1211677201, is " << last_msg_->c2; - EXPECT_EQ(last_msg_->cross, -197264530) << "incorrect value for cross, expected -197264530, is " << last_msg_->cross; - EXPECT_EQ(last_msg_->dot_along, 169404560) << "incorrect value for dot_along, expected 169404560, is " << last_msg_->dot_along; - EXPECT_EQ(last_msg_->dot_cross, 1118011173) << "incorrect value for dot_cross, expected 1118011173, is " << last_msg_->dot_cross; - EXPECT_EQ(last_msg_->dot_radial, 878654074) << "incorrect value for dot_radial, expected 878654074, is " << last_msg_->dot_radial; - EXPECT_EQ(last_msg_->iod, 936372632) << "incorrect value for iod, expected 936372632, is " << last_msg_->iod; - EXPECT_EQ(last_msg_->iod_ssr, 255) << "incorrect value for iod_ssr, expected 255, is " << last_msg_->iod_ssr; - EXPECT_EQ(last_msg_->radial, -2143668642) << "incorrect value for radial, expected -2143668642, is " << last_msg_->radial; - EXPECT_EQ(last_msg_->sid.code, 212) << "incorrect value for sid.code, expected 212, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.sat, 203) << "incorrect value for sid.sat, expected 203, is " << last_msg_->sid.sat; - EXPECT_EQ(last_msg_->time.tow, 3479621715) << "incorrect value for time.tow, expected 3479621715, is " << last_msg_->time.tow; - EXPECT_EQ(last_msg_->time.wn, 7588) << "incorrect value for time.wn, expected 7588, is " << last_msg_->time.wn; - EXPECT_EQ(last_msg_->update_interval, 236) << "incorrect value for update_interval, expected 236, is " << last_msg_->update_interval; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 58677); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->along, -1334502588) + << "incorrect value for along, expected -1334502588, is " + << last_msg_->along; + EXPECT_EQ(last_msg_->c0, -174298703) + << "incorrect value for c0, expected -174298703, is " << last_msg_->c0; + EXPECT_EQ(last_msg_->c1, -630458102) + << "incorrect value for c1, expected -630458102, is " << last_msg_->c1; + EXPECT_EQ(last_msg_->c2, 1211677201) + << "incorrect value for c2, expected 1211677201, is " << last_msg_->c2; + EXPECT_EQ(last_msg_->cross, -197264530) + << "incorrect value for cross, expected -197264530, is " + << last_msg_->cross; + EXPECT_EQ(last_msg_->dot_along, 169404560) + << "incorrect value for dot_along, expected 169404560, is " + << last_msg_->dot_along; + EXPECT_EQ(last_msg_->dot_cross, 1118011173) + << "incorrect value for dot_cross, expected 1118011173, is " + << last_msg_->dot_cross; + EXPECT_EQ(last_msg_->dot_radial, 878654074) + << "incorrect value for dot_radial, expected 878654074, is " + << last_msg_->dot_radial; + EXPECT_EQ(last_msg_->iod, 936372632) + << "incorrect value for iod, expected 936372632, is " << last_msg_->iod; + EXPECT_EQ(last_msg_->iod_ssr, 255) + << "incorrect value for iod_ssr, expected 255, is " << last_msg_->iod_ssr; + EXPECT_EQ(last_msg_->radial, -2143668642) + << "incorrect value for radial, expected -2143668642, is " + << last_msg_->radial; + EXPECT_EQ(last_msg_->sid.code, 212) + << "incorrect value for sid.code, expected 212, is " + << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.sat, 203) + << "incorrect value for sid.sat, expected 203, is " << last_msg_->sid.sat; + EXPECT_EQ(last_msg_->time.tow, 3479621715) + << "incorrect value for time.tow, expected 3479621715, is " + << last_msg_->time.tow; + EXPECT_EQ(last_msg_->time.wn, 7588) + << "incorrect value for time.wn, expected 7588, is " + << last_msg_->time.wn; + EXPECT_EQ(last_msg_->update_interval, 236) + << "incorrect value for update_interval, expected 236, is " + << last_msg_->update_interval; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.cc index dcb941165..d05aea51b 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBounds.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBounds.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBounds.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_orbit_clock_bounds_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_orbit_clock_bounds_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,95 +82,167 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_orbit_clock_bounds_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBounds0, Test) { + uint8_t encoded_frame[] = { + 85, 222, 5, 66, 0, 31, 180, 0, 0, 0, 3, 0, 1, + 2, 3, 48, 15, 1, 2, 24, 39, 38, 37, 1, 2, 3, + 39, 1, 3, 39, 38, 37, 1, 2, 3, 39, 1, 21, 85, + }; - uint8_t encoded_frame[] = {85,222,5,66,0,31,180,0,0,0,3,0,1,2,3,48,15,1,2,24,39,38,37,1,2,3,39,1,3,39,38,37,1,2,3,39,1,21,85, }; + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_orbit_clock_bounds_t *test_msg = + (msg_ssr_orbit_clock_bounds_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->const_id = 1; + test_msg->header.num_msgs = 1; + test_msg->header.seq_num = 2; + test_msg->header.sol_id = 48; + test_msg->header.time.tow = 180; + test_msg->header.time.wn = 3; + test_msg->header.update_interval = 3; + test_msg->n_sats = 2; + if (sizeof(test_msg->orbit_clock_bounds) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->orbit_clock_bounds[0])); + } + test_msg->orbit_clock_bounds[0].clock_bound_mu = 39; + test_msg->orbit_clock_bounds[0].clock_bound_sig = 1; + test_msg->orbit_clock_bounds[0].orb_along_bound_mu = 38; + test_msg->orbit_clock_bounds[0].orb_along_bound_sig = 2; + test_msg->orbit_clock_bounds[0].orb_cross_bound_mu = 37; + test_msg->orbit_clock_bounds[0].orb_cross_bound_sig = 3; + test_msg->orbit_clock_bounds[0].orb_radial_bound_mu = 39; + test_msg->orbit_clock_bounds[0].orb_radial_bound_sig = 1; + test_msg->orbit_clock_bounds[0].sat_id = 24; + if (sizeof(test_msg->orbit_clock_bounds) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->orbit_clock_bounds[0])); + } + test_msg->orbit_clock_bounds[1].clock_bound_mu = 39; + test_msg->orbit_clock_bounds[1].clock_bound_sig = 1; + test_msg->orbit_clock_bounds[1].orb_along_bound_mu = 38; + test_msg->orbit_clock_bounds[1].orb_along_bound_sig = 2; + test_msg->orbit_clock_bounds[1].orb_cross_bound_mu = 37; + test_msg->orbit_clock_bounds[1].orb_cross_bound_sig = 3; + test_msg->orbit_clock_bounds[1].orb_radial_bound_mu = 39; + test_msg->orbit_clock_bounds[1].orb_radial_bound_sig = 1; + test_msg->orbit_clock_bounds[1].sat_id = 3; + test_msg->ssr_iod = 15; + + EXPECT_EQ(send_message(1502, 66, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_orbit_clock_bounds_t* test_msg = ( msg_ssr_orbit_clock_bounds_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->const_id = 1; - test_msg->header.num_msgs = 1; - test_msg->header.seq_num = 2; - test_msg->header.sol_id = 48; - test_msg->header.time.tow = 180; - test_msg->header.time.wn = 3; - test_msg->header.update_interval = 3; - test_msg->n_sats = 2; - if (sizeof(test_msg->orbit_clock_bounds) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->orbit_clock_bounds[0])); - } - test_msg->orbit_clock_bounds[0].clock_bound_mu = 39; - test_msg->orbit_clock_bounds[0].clock_bound_sig = 1; - test_msg->orbit_clock_bounds[0].orb_along_bound_mu = 38; - test_msg->orbit_clock_bounds[0].orb_along_bound_sig = 2; - test_msg->orbit_clock_bounds[0].orb_cross_bound_mu = 37; - test_msg->orbit_clock_bounds[0].orb_cross_bound_sig = 3; - test_msg->orbit_clock_bounds[0].orb_radial_bound_mu = 39; - test_msg->orbit_clock_bounds[0].orb_radial_bound_sig = 1; - test_msg->orbit_clock_bounds[0].sat_id = 24; - if (sizeof(test_msg->orbit_clock_bounds) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->orbit_clock_bounds[0])); - } - test_msg->orbit_clock_bounds[1].clock_bound_mu = 39; - test_msg->orbit_clock_bounds[1].clock_bound_sig = 1; - test_msg->orbit_clock_bounds[1].orb_along_bound_mu = 38; - test_msg->orbit_clock_bounds[1].orb_along_bound_sig = 2; - test_msg->orbit_clock_bounds[1].orb_cross_bound_mu = 37; - test_msg->orbit_clock_bounds[1].orb_cross_bound_sig = 3; - test_msg->orbit_clock_bounds[1].orb_radial_bound_mu = 39; - test_msg->orbit_clock_bounds[1].orb_radial_bound_sig = 1; - test_msg->orbit_clock_bounds[1].sat_id = 3; - test_msg->ssr_iod = 15; - - EXPECT_EQ(send_message( 1502, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->const_id, 1) << "incorrect value for const_id, expected 1, is " << last_msg_->const_id; - EXPECT_EQ(last_msg_->header.num_msgs, 1) << "incorrect value for header.num_msgs, expected 1, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.seq_num, 2) << "incorrect value for header.seq_num, expected 2, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->header.sol_id, 48) << "incorrect value for header.sol_id, expected 48, is " << last_msg_->header.sol_id; - EXPECT_EQ(last_msg_->header.time.tow, 180) << "incorrect value for header.time.tow, expected 180, is " << last_msg_->header.time.tow; - EXPECT_EQ(last_msg_->header.time.wn, 3) << "incorrect value for header.time.wn, expected 3, is " << last_msg_->header.time.wn; - EXPECT_EQ(last_msg_->header.update_interval, 3) << "incorrect value for header.update_interval, expected 3, is " << last_msg_->header.update_interval; - EXPECT_EQ(last_msg_->n_sats, 2) << "incorrect value for n_sats, expected 2, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->orbit_clock_bounds[0].clock_bound_mu, 39) << "incorrect value for orbit_clock_bounds[0].clock_bound_mu, expected 39, is " << last_msg_->orbit_clock_bounds[0].clock_bound_mu; - EXPECT_EQ(last_msg_->orbit_clock_bounds[0].clock_bound_sig, 1) << "incorrect value for orbit_clock_bounds[0].clock_bound_sig, expected 1, is " << last_msg_->orbit_clock_bounds[0].clock_bound_sig; - EXPECT_EQ(last_msg_->orbit_clock_bounds[0].orb_along_bound_mu, 38) << "incorrect value for orbit_clock_bounds[0].orb_along_bound_mu, expected 38, is " << last_msg_->orbit_clock_bounds[0].orb_along_bound_mu; - EXPECT_EQ(last_msg_->orbit_clock_bounds[0].orb_along_bound_sig, 2) << "incorrect value for orbit_clock_bounds[0].orb_along_bound_sig, expected 2, is " << last_msg_->orbit_clock_bounds[0].orb_along_bound_sig; - EXPECT_EQ(last_msg_->orbit_clock_bounds[0].orb_cross_bound_mu, 37) << "incorrect value for orbit_clock_bounds[0].orb_cross_bound_mu, expected 37, is " << last_msg_->orbit_clock_bounds[0].orb_cross_bound_mu; - EXPECT_EQ(last_msg_->orbit_clock_bounds[0].orb_cross_bound_sig, 3) << "incorrect value for orbit_clock_bounds[0].orb_cross_bound_sig, expected 3, is " << last_msg_->orbit_clock_bounds[0].orb_cross_bound_sig; - EXPECT_EQ(last_msg_->orbit_clock_bounds[0].orb_radial_bound_mu, 39) << "incorrect value for orbit_clock_bounds[0].orb_radial_bound_mu, expected 39, is " << last_msg_->orbit_clock_bounds[0].orb_radial_bound_mu; - EXPECT_EQ(last_msg_->orbit_clock_bounds[0].orb_radial_bound_sig, 1) << "incorrect value for orbit_clock_bounds[0].orb_radial_bound_sig, expected 1, is " << last_msg_->orbit_clock_bounds[0].orb_radial_bound_sig; - EXPECT_EQ(last_msg_->orbit_clock_bounds[0].sat_id, 24) << "incorrect value for orbit_clock_bounds[0].sat_id, expected 24, is " << last_msg_->orbit_clock_bounds[0].sat_id; - EXPECT_EQ(last_msg_->orbit_clock_bounds[1].clock_bound_mu, 39) << "incorrect value for orbit_clock_bounds[1].clock_bound_mu, expected 39, is " << last_msg_->orbit_clock_bounds[1].clock_bound_mu; - EXPECT_EQ(last_msg_->orbit_clock_bounds[1].clock_bound_sig, 1) << "incorrect value for orbit_clock_bounds[1].clock_bound_sig, expected 1, is " << last_msg_->orbit_clock_bounds[1].clock_bound_sig; - EXPECT_EQ(last_msg_->orbit_clock_bounds[1].orb_along_bound_mu, 38) << "incorrect value for orbit_clock_bounds[1].orb_along_bound_mu, expected 38, is " << last_msg_->orbit_clock_bounds[1].orb_along_bound_mu; - EXPECT_EQ(last_msg_->orbit_clock_bounds[1].orb_along_bound_sig, 2) << "incorrect value for orbit_clock_bounds[1].orb_along_bound_sig, expected 2, is " << last_msg_->orbit_clock_bounds[1].orb_along_bound_sig; - EXPECT_EQ(last_msg_->orbit_clock_bounds[1].orb_cross_bound_mu, 37) << "incorrect value for orbit_clock_bounds[1].orb_cross_bound_mu, expected 37, is " << last_msg_->orbit_clock_bounds[1].orb_cross_bound_mu; - EXPECT_EQ(last_msg_->orbit_clock_bounds[1].orb_cross_bound_sig, 3) << "incorrect value for orbit_clock_bounds[1].orb_cross_bound_sig, expected 3, is " << last_msg_->orbit_clock_bounds[1].orb_cross_bound_sig; - EXPECT_EQ(last_msg_->orbit_clock_bounds[1].orb_radial_bound_mu, 39) << "incorrect value for orbit_clock_bounds[1].orb_radial_bound_mu, expected 39, is " << last_msg_->orbit_clock_bounds[1].orb_radial_bound_mu; - EXPECT_EQ(last_msg_->orbit_clock_bounds[1].orb_radial_bound_sig, 1) << "incorrect value for orbit_clock_bounds[1].orb_radial_bound_sig, expected 1, is " << last_msg_->orbit_clock_bounds[1].orb_radial_bound_sig; - EXPECT_EQ(last_msg_->orbit_clock_bounds[1].sat_id, 3) << "incorrect value for orbit_clock_bounds[1].sat_id, expected 3, is " << last_msg_->orbit_clock_bounds[1].sat_id; - EXPECT_EQ(last_msg_->ssr_iod, 15) << "incorrect value for ssr_iod, expected 15, is " << last_msg_->ssr_iod; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->const_id, 1) + << "incorrect value for const_id, expected 1, is " << last_msg_->const_id; + EXPECT_EQ(last_msg_->header.num_msgs, 1) + << "incorrect value for header.num_msgs, expected 1, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.seq_num, 2) + << "incorrect value for header.seq_num, expected 2, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->header.sol_id, 48) + << "incorrect value for header.sol_id, expected 48, is " + << last_msg_->header.sol_id; + EXPECT_EQ(last_msg_->header.time.tow, 180) + << "incorrect value for header.time.tow, expected 180, is " + << last_msg_->header.time.tow; + EXPECT_EQ(last_msg_->header.time.wn, 3) + << "incorrect value for header.time.wn, expected 3, is " + << last_msg_->header.time.wn; + EXPECT_EQ(last_msg_->header.update_interval, 3) + << "incorrect value for header.update_interval, expected 3, is " + << last_msg_->header.update_interval; + EXPECT_EQ(last_msg_->n_sats, 2) + << "incorrect value for n_sats, expected 2, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->orbit_clock_bounds[0].clock_bound_mu, 39) + << "incorrect value for orbit_clock_bounds[0].clock_bound_mu, expected " + "39, is " + << last_msg_->orbit_clock_bounds[0].clock_bound_mu; + EXPECT_EQ(last_msg_->orbit_clock_bounds[0].clock_bound_sig, 1) + << "incorrect value for orbit_clock_bounds[0].clock_bound_sig, expected " + "1, is " + << last_msg_->orbit_clock_bounds[0].clock_bound_sig; + EXPECT_EQ(last_msg_->orbit_clock_bounds[0].orb_along_bound_mu, 38) + << "incorrect value for orbit_clock_bounds[0].orb_along_bound_mu, " + "expected 38, is " + << last_msg_->orbit_clock_bounds[0].orb_along_bound_mu; + EXPECT_EQ(last_msg_->orbit_clock_bounds[0].orb_along_bound_sig, 2) + << "incorrect value for orbit_clock_bounds[0].orb_along_bound_sig, " + "expected 2, is " + << last_msg_->orbit_clock_bounds[0].orb_along_bound_sig; + EXPECT_EQ(last_msg_->orbit_clock_bounds[0].orb_cross_bound_mu, 37) + << "incorrect value for orbit_clock_bounds[0].orb_cross_bound_mu, " + "expected 37, is " + << last_msg_->orbit_clock_bounds[0].orb_cross_bound_mu; + EXPECT_EQ(last_msg_->orbit_clock_bounds[0].orb_cross_bound_sig, 3) + << "incorrect value for orbit_clock_bounds[0].orb_cross_bound_sig, " + "expected 3, is " + << last_msg_->orbit_clock_bounds[0].orb_cross_bound_sig; + EXPECT_EQ(last_msg_->orbit_clock_bounds[0].orb_radial_bound_mu, 39) + << "incorrect value for orbit_clock_bounds[0].orb_radial_bound_mu, " + "expected 39, is " + << last_msg_->orbit_clock_bounds[0].orb_radial_bound_mu; + EXPECT_EQ(last_msg_->orbit_clock_bounds[0].orb_radial_bound_sig, 1) + << "incorrect value for orbit_clock_bounds[0].orb_radial_bound_sig, " + "expected 1, is " + << last_msg_->orbit_clock_bounds[0].orb_radial_bound_sig; + EXPECT_EQ(last_msg_->orbit_clock_bounds[0].sat_id, 24) + << "incorrect value for orbit_clock_bounds[0].sat_id, expected 24, is " + << last_msg_->orbit_clock_bounds[0].sat_id; + EXPECT_EQ(last_msg_->orbit_clock_bounds[1].clock_bound_mu, 39) + << "incorrect value for orbit_clock_bounds[1].clock_bound_mu, expected " + "39, is " + << last_msg_->orbit_clock_bounds[1].clock_bound_mu; + EXPECT_EQ(last_msg_->orbit_clock_bounds[1].clock_bound_sig, 1) + << "incorrect value for orbit_clock_bounds[1].clock_bound_sig, expected " + "1, is " + << last_msg_->orbit_clock_bounds[1].clock_bound_sig; + EXPECT_EQ(last_msg_->orbit_clock_bounds[1].orb_along_bound_mu, 38) + << "incorrect value for orbit_clock_bounds[1].orb_along_bound_mu, " + "expected 38, is " + << last_msg_->orbit_clock_bounds[1].orb_along_bound_mu; + EXPECT_EQ(last_msg_->orbit_clock_bounds[1].orb_along_bound_sig, 2) + << "incorrect value for orbit_clock_bounds[1].orb_along_bound_sig, " + "expected 2, is " + << last_msg_->orbit_clock_bounds[1].orb_along_bound_sig; + EXPECT_EQ(last_msg_->orbit_clock_bounds[1].orb_cross_bound_mu, 37) + << "incorrect value for orbit_clock_bounds[1].orb_cross_bound_mu, " + "expected 37, is " + << last_msg_->orbit_clock_bounds[1].orb_cross_bound_mu; + EXPECT_EQ(last_msg_->orbit_clock_bounds[1].orb_cross_bound_sig, 3) + << "incorrect value for orbit_clock_bounds[1].orb_cross_bound_sig, " + "expected 3, is " + << last_msg_->orbit_clock_bounds[1].orb_cross_bound_sig; + EXPECT_EQ(last_msg_->orbit_clock_bounds[1].orb_radial_bound_mu, 39) + << "incorrect value for orbit_clock_bounds[1].orb_radial_bound_mu, " + "expected 39, is " + << last_msg_->orbit_clock_bounds[1].orb_radial_bound_mu; + EXPECT_EQ(last_msg_->orbit_clock_bounds[1].orb_radial_bound_sig, 1) + << "incorrect value for orbit_clock_bounds[1].orb_radial_bound_sig, " + "expected 1, is " + << last_msg_->orbit_clock_bounds[1].orb_radial_bound_sig; + EXPECT_EQ(last_msg_->orbit_clock_bounds[1].sat_id, 3) + << "incorrect value for orbit_clock_bounds[1].sat_id, expected 3, is " + << last_msg_->orbit_clock_bounds[1].sat_id; + EXPECT_EQ(last_msg_->ssr_iod, 15) + << "incorrect value for ssr_iod, expected 15, is " << last_msg_->ssr_iod; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.cc index 4e2757cae..fca8c9acb 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBoundsDegradation.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockBoundsDegradation.yaml +// by generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,53 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_orbit_clock_bounds_degradation_t &msg) override - { + protected: + void handle_sbp_msg( + uint16_t sender_id, uint8_t message_length, + const msg_ssr_orbit_clock_bounds_degradation_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,67 +83,123 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_orbit_clock_bounds_degradation_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation0, Test) -{ +}; - uint8_t encoded_frame[] = {85,223,5,66,0,28,180,0,0,0,3,0,1,2,3,48,15,1,10,0,0,0,0,0,0,0,200,199,198,197,196,195,194,193,200,117, }; +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockBoundsDegradation0, + Test) { + uint8_t encoded_frame[] = { + 85, 223, 5, 66, 0, 28, 180, 0, 0, 0, 3, 0, + 1, 2, 3, 48, 15, 1, 10, 0, 0, 0, 0, 0, + 0, 0, 200, 199, 198, 197, 196, 195, 194, 193, 200, 117, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_orbit_clock_bounds_degradation_t* test_msg = ( msg_ssr_orbit_clock_bounds_degradation_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->const_id = 1; - test_msg->header.num_msgs = 1; - test_msg->header.seq_num = 2; - test_msg->header.sol_id = 48; - test_msg->header.time.tow = 180; - test_msg->header.time.wn = 3; - test_msg->header.update_interval = 3; - test_msg->orbit_clock_bounds_degradation.clock_bound_mu_dot = 194; - test_msg->orbit_clock_bounds_degradation.clock_bound_sig_dot = 193; - test_msg->orbit_clock_bounds_degradation.orb_along_bound_mu_dot = 199; - test_msg->orbit_clock_bounds_degradation.orb_along_bound_sig_dot = 196; - test_msg->orbit_clock_bounds_degradation.orb_cross_bound_mu_dot = 198; - test_msg->orbit_clock_bounds_degradation.orb_cross_bound_sig_dot = 195; - test_msg->orbit_clock_bounds_degradation.orb_radial_bound_mu_dot = 200; - test_msg->orbit_clock_bounds_degradation.orb_radial_bound_sig_dot = 197; - test_msg->sat_bitmask = 10; - test_msg->ssr_iod = 15; - - EXPECT_EQ(send_message( 1503, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_orbit_clock_bounds_degradation_t *test_msg = + (msg_ssr_orbit_clock_bounds_degradation_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->const_id = 1; + test_msg->header.num_msgs = 1; + test_msg->header.seq_num = 2; + test_msg->header.sol_id = 48; + test_msg->header.time.tow = 180; + test_msg->header.time.wn = 3; + test_msg->header.update_interval = 3; + test_msg->orbit_clock_bounds_degradation.clock_bound_mu_dot = 194; + test_msg->orbit_clock_bounds_degradation.clock_bound_sig_dot = 193; + test_msg->orbit_clock_bounds_degradation.orb_along_bound_mu_dot = 199; + test_msg->orbit_clock_bounds_degradation.orb_along_bound_sig_dot = 196; + test_msg->orbit_clock_bounds_degradation.orb_cross_bound_mu_dot = 198; + test_msg->orbit_clock_bounds_degradation.orb_cross_bound_sig_dot = 195; + test_msg->orbit_clock_bounds_degradation.orb_radial_bound_mu_dot = 200; + test_msg->orbit_clock_bounds_degradation.orb_radial_bound_sig_dot = 197; + test_msg->sat_bitmask = 10; + test_msg->ssr_iod = 15; + + EXPECT_EQ(send_message(1503, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->const_id, 1) << "incorrect value for const_id, expected 1, is " << last_msg_->const_id; - EXPECT_EQ(last_msg_->header.num_msgs, 1) << "incorrect value for header.num_msgs, expected 1, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.seq_num, 2) << "incorrect value for header.seq_num, expected 2, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->header.sol_id, 48) << "incorrect value for header.sol_id, expected 48, is " << last_msg_->header.sol_id; - EXPECT_EQ(last_msg_->header.time.tow, 180) << "incorrect value for header.time.tow, expected 180, is " << last_msg_->header.time.tow; - EXPECT_EQ(last_msg_->header.time.wn, 3) << "incorrect value for header.time.wn, expected 3, is " << last_msg_->header.time.wn; - EXPECT_EQ(last_msg_->header.update_interval, 3) << "incorrect value for header.update_interval, expected 3, is " << last_msg_->header.update_interval; - EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.clock_bound_mu_dot, 194) << "incorrect value for orbit_clock_bounds_degradation.clock_bound_mu_dot, expected 194, is " << last_msg_->orbit_clock_bounds_degradation.clock_bound_mu_dot; - EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.clock_bound_sig_dot, 193) << "incorrect value for orbit_clock_bounds_degradation.clock_bound_sig_dot, expected 193, is " << last_msg_->orbit_clock_bounds_degradation.clock_bound_sig_dot; - EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.orb_along_bound_mu_dot, 199) << "incorrect value for orbit_clock_bounds_degradation.orb_along_bound_mu_dot, expected 199, is " << last_msg_->orbit_clock_bounds_degradation.orb_along_bound_mu_dot; - EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.orb_along_bound_sig_dot, 196) << "incorrect value for orbit_clock_bounds_degradation.orb_along_bound_sig_dot, expected 196, is " << last_msg_->orbit_clock_bounds_degradation.orb_along_bound_sig_dot; - EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.orb_cross_bound_mu_dot, 198) << "incorrect value for orbit_clock_bounds_degradation.orb_cross_bound_mu_dot, expected 198, is " << last_msg_->orbit_clock_bounds_degradation.orb_cross_bound_mu_dot; - EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.orb_cross_bound_sig_dot, 195) << "incorrect value for orbit_clock_bounds_degradation.orb_cross_bound_sig_dot, expected 195, is " << last_msg_->orbit_clock_bounds_degradation.orb_cross_bound_sig_dot; - EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.orb_radial_bound_mu_dot, 200) << "incorrect value for orbit_clock_bounds_degradation.orb_radial_bound_mu_dot, expected 200, is " << last_msg_->orbit_clock_bounds_degradation.orb_radial_bound_mu_dot; - EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.orb_radial_bound_sig_dot, 197) << "incorrect value for orbit_clock_bounds_degradation.orb_radial_bound_sig_dot, expected 197, is " << last_msg_->orbit_clock_bounds_degradation.orb_radial_bound_sig_dot; - EXPECT_EQ(last_msg_->sat_bitmask, 10) << "incorrect value for sat_bitmask, expected 10, is " << last_msg_->sat_bitmask; - EXPECT_EQ(last_msg_->ssr_iod, 15) << "incorrect value for ssr_iod, expected 15, is " << last_msg_->ssr_iod; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->const_id, 1) + << "incorrect value for const_id, expected 1, is " << last_msg_->const_id; + EXPECT_EQ(last_msg_->header.num_msgs, 1) + << "incorrect value for header.num_msgs, expected 1, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.seq_num, 2) + << "incorrect value for header.seq_num, expected 2, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->header.sol_id, 48) + << "incorrect value for header.sol_id, expected 48, is " + << last_msg_->header.sol_id; + EXPECT_EQ(last_msg_->header.time.tow, 180) + << "incorrect value for header.time.tow, expected 180, is " + << last_msg_->header.time.tow; + EXPECT_EQ(last_msg_->header.time.wn, 3) + << "incorrect value for header.time.wn, expected 3, is " + << last_msg_->header.time.wn; + EXPECT_EQ(last_msg_->header.update_interval, 3) + << "incorrect value for header.update_interval, expected 3, is " + << last_msg_->header.update_interval; + EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.clock_bound_mu_dot, 194) + << "incorrect value for " + "orbit_clock_bounds_degradation.clock_bound_mu_dot, expected 194, is " + << last_msg_->orbit_clock_bounds_degradation.clock_bound_mu_dot; + EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.clock_bound_sig_dot, 193) + << "incorrect value for " + "orbit_clock_bounds_degradation.clock_bound_sig_dot, expected 193, is " + << last_msg_->orbit_clock_bounds_degradation.clock_bound_sig_dot; + EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.orb_along_bound_mu_dot, + 199) + << "incorrect value for " + "orbit_clock_bounds_degradation.orb_along_bound_mu_dot, expected 199, " + "is " + << last_msg_->orbit_clock_bounds_degradation.orb_along_bound_mu_dot; + EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.orb_along_bound_sig_dot, + 196) + << "incorrect value for " + "orbit_clock_bounds_degradation.orb_along_bound_sig_dot, expected " + "196, is " + << last_msg_->orbit_clock_bounds_degradation.orb_along_bound_sig_dot; + EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.orb_cross_bound_mu_dot, + 198) + << "incorrect value for " + "orbit_clock_bounds_degradation.orb_cross_bound_mu_dot, expected 198, " + "is " + << last_msg_->orbit_clock_bounds_degradation.orb_cross_bound_mu_dot; + EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.orb_cross_bound_sig_dot, + 195) + << "incorrect value for " + "orbit_clock_bounds_degradation.orb_cross_bound_sig_dot, expected " + "195, is " + << last_msg_->orbit_clock_bounds_degradation.orb_cross_bound_sig_dot; + EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.orb_radial_bound_mu_dot, + 200) + << "incorrect value for " + "orbit_clock_bounds_degradation.orb_radial_bound_mu_dot, expected " + "200, is " + << last_msg_->orbit_clock_bounds_degradation.orb_radial_bound_mu_dot; + EXPECT_EQ(last_msg_->orbit_clock_bounds_degradation.orb_radial_bound_sig_dot, + 197) + << "incorrect value for " + "orbit_clock_bounds_degradation.orb_radial_bound_sig_dot, expected " + "197, is " + << last_msg_->orbit_clock_bounds_degradation.orb_radial_bound_sig_dot; + EXPECT_EQ(last_msg_->sat_bitmask, 10) + << "incorrect value for sat_bitmask, expected 10, is " + << last_msg_->sat_bitmask; + EXPECT_EQ(last_msg_->ssr_iod, 15) + << "incorrect value for ssr_iod, expected 15, is " << last_msg_->ssr_iod; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.cc index 00a1462be..7540094c9 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrOrbitClockDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrOrbitClockDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_orbit_clock_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_orbit_clock_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,65 +82,95 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_orbit_clock_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,220,5,33,166,47,225,114,31,189,43,30,1,30,194,211,193,175,161,143,254,56,63,232,7,216,69,1,110,165,124,196,189,27,116,88,4,61,3,151,18,171,147,46,198,85,243,245,225,235,123,181,210,157,252, }; +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrOrbitClockDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 220, 5, 33, 166, 47, 225, 114, 31, 189, 43, 30, 1, 30, + 194, 211, 193, 175, 161, 143, 254, 56, 63, 232, 7, 216, 69, 1, + 110, 165, 124, 196, 189, 27, 116, 88, 4, 61, 3, 151, 18, 171, + 147, 46, 198, 85, 243, 245, 225, 235, 123, 181, 210, 157, 252, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_orbit_clock_dep_a_t* test_msg = ( msg_ssr_orbit_clock_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->along = 132661048; - test_msg->c0 = -970026069; - test_msg->c1 = -503975083; - test_msg->c2 = -759858197; - test_msg->cross = 1845577176; - test_msg->dot_along = 72905755; - test_msg->dot_cross = 311886653; - test_msg->dot_radial = -1111196507; - test_msg->iod = 193; - test_msg->iod_ssr = 211; - test_msg->radial = -24141393; - test_msg->sid.code = 30; - test_msg->sid.sat = 1; - test_msg->time.tow = 3172954849; - test_msg->time.wn = 7723; - test_msg->update_interval = 194; - - EXPECT_EQ(send_message( 0x5dc, 42529, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_orbit_clock_dep_a_t *test_msg = + (msg_ssr_orbit_clock_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->along = 132661048; + test_msg->c0 = -970026069; + test_msg->c1 = -503975083; + test_msg->c2 = -759858197; + test_msg->cross = 1845577176; + test_msg->dot_along = 72905755; + test_msg->dot_cross = 311886653; + test_msg->dot_radial = -1111196507; + test_msg->iod = 193; + test_msg->iod_ssr = 211; + test_msg->radial = -24141393; + test_msg->sid.code = 30; + test_msg->sid.sat = 1; + test_msg->time.tow = 3172954849; + test_msg->time.wn = 7723; + test_msg->update_interval = 194; + + EXPECT_EQ(send_message(0x5dc, 42529, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 42529); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->along, 132661048) << "incorrect value for along, expected 132661048, is " << last_msg_->along; - EXPECT_EQ(last_msg_->c0, -970026069) << "incorrect value for c0, expected -970026069, is " << last_msg_->c0; - EXPECT_EQ(last_msg_->c1, -503975083) << "incorrect value for c1, expected -503975083, is " << last_msg_->c1; - EXPECT_EQ(last_msg_->c2, -759858197) << "incorrect value for c2, expected -759858197, is " << last_msg_->c2; - EXPECT_EQ(last_msg_->cross, 1845577176) << "incorrect value for cross, expected 1845577176, is " << last_msg_->cross; - EXPECT_EQ(last_msg_->dot_along, 72905755) << "incorrect value for dot_along, expected 72905755, is " << last_msg_->dot_along; - EXPECT_EQ(last_msg_->dot_cross, 311886653) << "incorrect value for dot_cross, expected 311886653, is " << last_msg_->dot_cross; - EXPECT_EQ(last_msg_->dot_radial, -1111196507) << "incorrect value for dot_radial, expected -1111196507, is " << last_msg_->dot_radial; - EXPECT_EQ(last_msg_->iod, 193) << "incorrect value for iod, expected 193, is " << last_msg_->iod; - EXPECT_EQ(last_msg_->iod_ssr, 211) << "incorrect value for iod_ssr, expected 211, is " << last_msg_->iod_ssr; - EXPECT_EQ(last_msg_->radial, -24141393) << "incorrect value for radial, expected -24141393, is " << last_msg_->radial; - EXPECT_EQ(last_msg_->sid.code, 30) << "incorrect value for sid.code, expected 30, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.sat, 1) << "incorrect value for sid.sat, expected 1, is " << last_msg_->sid.sat; - EXPECT_EQ(last_msg_->time.tow, 3172954849) << "incorrect value for time.tow, expected 3172954849, is " << last_msg_->time.tow; - EXPECT_EQ(last_msg_->time.wn, 7723) << "incorrect value for time.wn, expected 7723, is " << last_msg_->time.wn; - EXPECT_EQ(last_msg_->update_interval, 194) << "incorrect value for update_interval, expected 194, is " << last_msg_->update_interval; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 42529); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->along, 132661048) + << "incorrect value for along, expected 132661048, is " + << last_msg_->along; + EXPECT_EQ(last_msg_->c0, -970026069) + << "incorrect value for c0, expected -970026069, is " << last_msg_->c0; + EXPECT_EQ(last_msg_->c1, -503975083) + << "incorrect value for c1, expected -503975083, is " << last_msg_->c1; + EXPECT_EQ(last_msg_->c2, -759858197) + << "incorrect value for c2, expected -759858197, is " << last_msg_->c2; + EXPECT_EQ(last_msg_->cross, 1845577176) + << "incorrect value for cross, expected 1845577176, is " + << last_msg_->cross; + EXPECT_EQ(last_msg_->dot_along, 72905755) + << "incorrect value for dot_along, expected 72905755, is " + << last_msg_->dot_along; + EXPECT_EQ(last_msg_->dot_cross, 311886653) + << "incorrect value for dot_cross, expected 311886653, is " + << last_msg_->dot_cross; + EXPECT_EQ(last_msg_->dot_radial, -1111196507) + << "incorrect value for dot_radial, expected -1111196507, is " + << last_msg_->dot_radial; + EXPECT_EQ(last_msg_->iod, 193) + << "incorrect value for iod, expected 193, is " << last_msg_->iod; + EXPECT_EQ(last_msg_->iod_ssr, 211) + << "incorrect value for iod_ssr, expected 211, is " << last_msg_->iod_ssr; + EXPECT_EQ(last_msg_->radial, -24141393) + << "incorrect value for radial, expected -24141393, is " + << last_msg_->radial; + EXPECT_EQ(last_msg_->sid.code, 30) + << "incorrect value for sid.code, expected 30, is " + << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.sat, 1) + << "incorrect value for sid.sat, expected 1, is " << last_msg_->sid.sat; + EXPECT_EQ(last_msg_->time.tow, 3172954849) + << "incorrect value for time.tow, expected 3172954849, is " + << last_msg_->time.tow; + EXPECT_EQ(last_msg_->time.wn, 7723) + << "incorrect value for time.wn, expected 7723, is " + << last_msg_->time.wn; + EXPECT_EQ(last_msg_->update_interval, 194) + << "incorrect value for update_interval, expected 194, is " + << last_msg_->update_interval; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrPhaseBiases.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrPhaseBiases.cc index c302006e7..137230e05 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrPhaseBiases.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrPhaseBiases.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrPhaseBiases.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrPhaseBiases.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_phase_biases_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_phase_biases_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,473 +82,860 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_phase_biases_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrPhaseBiases0, Test) { + uint8_t encoded_frame[] = { + 85, 230, 5, 219, 206, 255, 209, 154, 144, 12, 213, 164, 169, 82, 177, + 230, 98, 209, 249, 22, 17, 29, 250, 245, 193, 219, 30, 212, 177, 207, + 187, 33, 146, 58, 204, 164, 65, 114, 49, 248, 52, 8, 161, 44, 252, + 166, 168, 232, 124, 134, 86, 173, 241, 174, 44, 142, 155, 129, 143, 184, + 161, 211, 15, 36, 189, 208, 194, 221, 152, 16, 203, 87, 34, 188, 141, + 104, 189, 102, 156, 252, 22, 251, 136, 49, 188, 157, 222, 245, 49, 132, + 16, 34, 142, 228, 85, 139, 221, 197, 235, 98, 74, 107, 70, 36, 38, + 239, 251, 112, 188, 124, 246, 141, 164, 150, 104, 7, 213, 44, 21, 244, + 192, 4, 143, 24, 42, 21, 84, 136, 7, 42, 118, 45, 23, 174, 175, + 129, 54, 169, 14, 213, 2, 197, 98, 60, 13, 207, 105, 100, 129, 72, + 136, 240, 140, 129, 9, 114, 172, 151, 150, 17, 210, 127, 115, 151, 3, + 242, 254, 215, 14, 5, 34, 126, 2, 215, 65, 38, 176, 23, 210, 201, + 97, 36, 207, 92, 224, 26, 116, 155, 211, 165, 47, 102, 38, 67, 199, + 55, 117, 36, 169, 33, 1, 230, 201, 183, 21, 42, 62, 147, 173, 173, + 155, 98, 146, 231, 167, 138, 82, 167, 127, 229, 1, 2, 127, 237, 207, + 116, 90, 115, 159, 3, 42, 66, 145, 250, 201, 7, 251, 2, 75, 230, + 26, 213, 181, 56, 64, 97, 88, 255, 6, 147, 16, 89, 203, 27, 68, + 243, 230, 55, 242, 167, 169, 219, 240, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_phase_biases_t *test_msg = (msg_ssr_phase_biases_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[0].bias = -1311498533; + test_msg->biases[0].code = 29; + test_msg->biases[0].discontinuity_counter = 193; + test_msg->biases[0].integer_indicator = 250; + test_msg->biases[0].widelane_integer_indicator = 245; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[1].bias = 1101319226; + test_msg->biases[1].code = 207; + test_msg->biases[1].discontinuity_counter = 146; + test_msg->biases[1].integer_indicator = 187; + test_msg->biases[1].widelane_integer_indicator = 33; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[2].bias = -64184056; + test_msg->biases[2].code = 114; + test_msg->biases[2].discontinuity_counter = 52; + test_msg->biases[2].integer_indicator = 49; + test_msg->biases[2].widelane_integer_indicator = 248; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[3].bias = -240298362; + test_msg->biases[3].code = 166; + test_msg->biases[3].discontinuity_counter = 124; + test_msg->biases[3].integer_indicator = 168; + test_msg->biases[3].widelane_integer_indicator = 232; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[4].bias = -1581740159; + test_msg->biases[4].code = 174; + test_msg->biases[4].discontinuity_counter = 155; + test_msg->biases[4].integer_indicator = 44; + test_msg->biases[4].widelane_integer_indicator = 142; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[5].bias = -1730297136; + test_msg->biases[5].code = 211; + test_msg->biases[5].discontinuity_counter = 189; + test_msg->biases[5].integer_indicator = 15; + test_msg->biases[5].widelane_integer_indicator = 36; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[6].bias = -1117221444; + test_msg->biases[6].code = 16; + test_msg->biases[6].discontinuity_counter = 34; + test_msg->biases[6].integer_indicator = 203; + test_msg->biases[6].widelane_integer_indicator = 87; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[7].bias = -1137604357; + test_msg->biases[7].code = 102; + test_msg->biases[7].discontinuity_counter = 22; + test_msg->biases[7].integer_indicator = 156; + test_msg->biases[7].widelane_integer_indicator = 252; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[8].bias = -1910370172; + test_msg->biases[8].code = 157; + test_msg->biases[8].discontinuity_counter = 49; + test_msg->biases[8].integer_indicator = 222; + test_msg->biases[8].widelane_integer_indicator = 245; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[9].bias = 1247996869; + test_msg->biases[9].code = 228; + test_msg->biases[9].discontinuity_counter = 221; + test_msg->biases[9].integer_indicator = 85; + test_msg->biases[9].widelane_integer_indicator = 139; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[10].bias = -1133446161; + test_msg->biases[10].code = 107; + test_msg->biases[10].discontinuity_counter = 38; + test_msg->biases[10].integer_indicator = 70; + test_msg->biases[10].widelane_integer_indicator = 36; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[11].bias = -720934762; + test_msg->biases[11].code = 124; + test_msg->biases[11].discontinuity_counter = 164; + test_msg->biases[11].integer_indicator = 246; + test_msg->biases[11].widelane_integer_indicator = 141; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[12].bias = 706252548; + test_msg->biases[12].code = 44; + test_msg->biases[12].discontinuity_counter = 192; + test_msg->biases[12].integer_indicator = 21; + test_msg->biases[12].widelane_integer_indicator = 244; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[13].bias = 388855338; + test_msg->biases[13].code = 21; + test_msg->biases[13].discontinuity_counter = 7; + test_msg->biases[13].integer_indicator = 84; + test_msg->biases[13].widelane_integer_indicator = 136; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[14].bias = 47517353; + test_msg->biases[14].code = 174; + test_msg->biases[14].discontinuity_counter = 54; + test_msg->biases[14].integer_indicator = 175; + test_msg->biases[14].widelane_integer_indicator = 129; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[15].bias = -2124125745; + test_msg->biases[15].code = 197; + test_msg->biases[15].discontinuity_counter = 13; + test_msg->biases[15].integer_indicator = 98; + test_msg->biases[15].widelane_integer_indicator = 60; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[16].bias = -1401812607; + test_msg->biases[16].code = 72; + test_msg->biases[16].discontinuity_counter = 140; + test_msg->biases[16].integer_indicator = 136; + test_msg->biases[16].widelane_integer_indicator = 240; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[17].bias = 60257151; + test_msg->biases[17].code = 151; + test_msg->biases[17].discontinuity_counter = 210; + test_msg->biases[17].integer_indicator = 150; + test_msg->biases[17].widelane_integer_indicator = 17; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[18].bias = 41820677; + test_msg->biases[18].code = 242; + test_msg->biases[18].discontinuity_counter = 14; + test_msg->biases[18].integer_indicator = 254; + test_msg->biases[18].widelane_integer_indicator = 215; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[19].bias = 1640616471; + test_msg->biases[19].code = 215; + test_msg->biases[19].discontinuity_counter = 176; + test_msg->biases[19].integer_indicator = 65; + test_msg->biases[19].widelane_integer_indicator = 38; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[20].bias = -744786918; + test_msg->biases[20].code = 36; + test_msg->biases[20].discontinuity_counter = 224; + test_msg->biases[20].integer_indicator = 207; + test_msg->biases[20].widelane_integer_indicator = 92; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[21].bias = 1966589763; + test_msg->biases[21].code = 165; + test_msg->biases[21].discontinuity_counter = 38; + test_msg->biases[21].integer_indicator = 47; + test_msg->biases[21].widelane_integer_indicator = 102; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[22].bias = 364366310; + test_msg->biases[22].code = 36; + test_msg->biases[22].discontinuity_counter = 1; + test_msg->biases[22].integer_indicator = 169; + test_msg->biases[22].widelane_integer_indicator = 33; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[23].bias = -1839031379; + test_msg->biases[23].code = 42; + test_msg->biases[23].discontinuity_counter = 173; + test_msg->biases[23].integer_indicator = 62; + test_msg->biases[23].widelane_integer_indicator = 147; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[24].bias = 31817639; + test_msg->biases[24].code = 231; + test_msg->biases[24].discontinuity_counter = 82; + test_msg->biases[24].integer_indicator = 167; + test_msg->biases[24].widelane_integer_indicator = 138; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[25].bias = -1619830156; + test_msg->biases[25].code = 2; + test_msg->biases[25].discontinuity_counter = 207; + test_msg->biases[25].integer_indicator = 127; + test_msg->biases[25].widelane_integer_indicator = 237; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[26].bias = -83375622; + test_msg->biases[26].code = 3; + test_msg->biases[26].discontinuity_counter = 145; + test_msg->biases[26].integer_indicator = 42; + test_msg->biases[26].widelane_integer_indicator = 66; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[27].bias = 1077458389; + test_msg->biases[27].code = 2; + test_msg->biases[27].discontinuity_counter = 26; + test_msg->biases[27].integer_indicator = 75; + test_msg->biases[27].widelane_integer_indicator = 230; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[28].bias = -883355501; + test_msg->biases[28].code = 97; + test_msg->biases[28].discontinuity_counter = 6; + test_msg->biases[28].integer_indicator = 88; + test_msg->biases[28].widelane_integer_indicator = 255; + if (sizeof(test_msg->biases) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); + } + test_msg->biases[29].bias = -1448611273; + test_msg->biases[29].code = 27; + test_msg->biases[29].discontinuity_counter = 230; + test_msg->biases[29].integer_indicator = 68; + test_msg->biases[29].widelane_integer_indicator = 243; + test_msg->dispersive_bias = 98; + test_msg->iod_ssr = 230; + test_msg->mw_consistency = 209; + test_msg->sid.code = 82; + test_msg->sid.sat = 169; + test_msg->time.tow = 210803409; + test_msg->time.wn = 42197; + test_msg->update_interval = 177; + test_msg->yaw = 5881; + test_msg->yaw_rate = 17; - uint8_t encoded_frame[] = {85,230,5,219,206,255,209,154,144,12,213,164,169,82,177,230,98,209,249,22,17,29,250,245,193,219,30,212,177,207,187,33,146,58,204,164,65,114,49,248,52,8,161,44,252,166,168,232,124,134,86,173,241,174,44,142,155,129,143,184,161,211,15,36,189,208,194,221,152,16,203,87,34,188,141,104,189,102,156,252,22,251,136,49,188,157,222,245,49,132,16,34,142,228,85,139,221,197,235,98,74,107,70,36,38,239,251,112,188,124,246,141,164,150,104,7,213,44,21,244,192,4,143,24,42,21,84,136,7,42,118,45,23,174,175,129,54,169,14,213,2,197,98,60,13,207,105,100,129,72,136,240,140,129,9,114,172,151,150,17,210,127,115,151,3,242,254,215,14,5,34,126,2,215,65,38,176,23,210,201,97,36,207,92,224,26,116,155,211,165,47,102,38,67,199,55,117,36,169,33,1,230,201,183,21,42,62,147,173,173,155,98,146,231,167,138,82,167,127,229,1,2,127,237,207,116,90,115,159,3,42,66,145,250,201,7,251,2,75,230,26,213,181,56,64,97,88,255,6,147,16,89,203,27,68,243,230,55,242,167,169,219,240, }; + EXPECT_EQ(send_message(0x5e6, 52955, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_phase_biases_t* test_msg = ( msg_ssr_phase_biases_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[0].bias = -1311498533; - test_msg->biases[0].code = 29; - test_msg->biases[0].discontinuity_counter = 193; - test_msg->biases[0].integer_indicator = 250; - test_msg->biases[0].widelane_integer_indicator = 245; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[1].bias = 1101319226; - test_msg->biases[1].code = 207; - test_msg->biases[1].discontinuity_counter = 146; - test_msg->biases[1].integer_indicator = 187; - test_msg->biases[1].widelane_integer_indicator = 33; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[2].bias = -64184056; - test_msg->biases[2].code = 114; - test_msg->biases[2].discontinuity_counter = 52; - test_msg->biases[2].integer_indicator = 49; - test_msg->biases[2].widelane_integer_indicator = 248; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[3].bias = -240298362; - test_msg->biases[3].code = 166; - test_msg->biases[3].discontinuity_counter = 124; - test_msg->biases[3].integer_indicator = 168; - test_msg->biases[3].widelane_integer_indicator = 232; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[4].bias = -1581740159; - test_msg->biases[4].code = 174; - test_msg->biases[4].discontinuity_counter = 155; - test_msg->biases[4].integer_indicator = 44; - test_msg->biases[4].widelane_integer_indicator = 142; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[5].bias = -1730297136; - test_msg->biases[5].code = 211; - test_msg->biases[5].discontinuity_counter = 189; - test_msg->biases[5].integer_indicator = 15; - test_msg->biases[5].widelane_integer_indicator = 36; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[6].bias = -1117221444; - test_msg->biases[6].code = 16; - test_msg->biases[6].discontinuity_counter = 34; - test_msg->biases[6].integer_indicator = 203; - test_msg->biases[6].widelane_integer_indicator = 87; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[7].bias = -1137604357; - test_msg->biases[7].code = 102; - test_msg->biases[7].discontinuity_counter = 22; - test_msg->biases[7].integer_indicator = 156; - test_msg->biases[7].widelane_integer_indicator = 252; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[8].bias = -1910370172; - test_msg->biases[8].code = 157; - test_msg->biases[8].discontinuity_counter = 49; - test_msg->biases[8].integer_indicator = 222; - test_msg->biases[8].widelane_integer_indicator = 245; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[9].bias = 1247996869; - test_msg->biases[9].code = 228; - test_msg->biases[9].discontinuity_counter = 221; - test_msg->biases[9].integer_indicator = 85; - test_msg->biases[9].widelane_integer_indicator = 139; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[10].bias = -1133446161; - test_msg->biases[10].code = 107; - test_msg->biases[10].discontinuity_counter = 38; - test_msg->biases[10].integer_indicator = 70; - test_msg->biases[10].widelane_integer_indicator = 36; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[11].bias = -720934762; - test_msg->biases[11].code = 124; - test_msg->biases[11].discontinuity_counter = 164; - test_msg->biases[11].integer_indicator = 246; - test_msg->biases[11].widelane_integer_indicator = 141; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[12].bias = 706252548; - test_msg->biases[12].code = 44; - test_msg->biases[12].discontinuity_counter = 192; - test_msg->biases[12].integer_indicator = 21; - test_msg->biases[12].widelane_integer_indicator = 244; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[13].bias = 388855338; - test_msg->biases[13].code = 21; - test_msg->biases[13].discontinuity_counter = 7; - test_msg->biases[13].integer_indicator = 84; - test_msg->biases[13].widelane_integer_indicator = 136; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[14].bias = 47517353; - test_msg->biases[14].code = 174; - test_msg->biases[14].discontinuity_counter = 54; - test_msg->biases[14].integer_indicator = 175; - test_msg->biases[14].widelane_integer_indicator = 129; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[15].bias = -2124125745; - test_msg->biases[15].code = 197; - test_msg->biases[15].discontinuity_counter = 13; - test_msg->biases[15].integer_indicator = 98; - test_msg->biases[15].widelane_integer_indicator = 60; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[16].bias = -1401812607; - test_msg->biases[16].code = 72; - test_msg->biases[16].discontinuity_counter = 140; - test_msg->biases[16].integer_indicator = 136; - test_msg->biases[16].widelane_integer_indicator = 240; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[17].bias = 60257151; - test_msg->biases[17].code = 151; - test_msg->biases[17].discontinuity_counter = 210; - test_msg->biases[17].integer_indicator = 150; - test_msg->biases[17].widelane_integer_indicator = 17; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[18].bias = 41820677; - test_msg->biases[18].code = 242; - test_msg->biases[18].discontinuity_counter = 14; - test_msg->biases[18].integer_indicator = 254; - test_msg->biases[18].widelane_integer_indicator = 215; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[19].bias = 1640616471; - test_msg->biases[19].code = 215; - test_msg->biases[19].discontinuity_counter = 176; - test_msg->biases[19].integer_indicator = 65; - test_msg->biases[19].widelane_integer_indicator = 38; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[20].bias = -744786918; - test_msg->biases[20].code = 36; - test_msg->biases[20].discontinuity_counter = 224; - test_msg->biases[20].integer_indicator = 207; - test_msg->biases[20].widelane_integer_indicator = 92; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[21].bias = 1966589763; - test_msg->biases[21].code = 165; - test_msg->biases[21].discontinuity_counter = 38; - test_msg->biases[21].integer_indicator = 47; - test_msg->biases[21].widelane_integer_indicator = 102; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[22].bias = 364366310; - test_msg->biases[22].code = 36; - test_msg->biases[22].discontinuity_counter = 1; - test_msg->biases[22].integer_indicator = 169; - test_msg->biases[22].widelane_integer_indicator = 33; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[23].bias = -1839031379; - test_msg->biases[23].code = 42; - test_msg->biases[23].discontinuity_counter = 173; - test_msg->biases[23].integer_indicator = 62; - test_msg->biases[23].widelane_integer_indicator = 147; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[24].bias = 31817639; - test_msg->biases[24].code = 231; - test_msg->biases[24].discontinuity_counter = 82; - test_msg->biases[24].integer_indicator = 167; - test_msg->biases[24].widelane_integer_indicator = 138; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[25].bias = -1619830156; - test_msg->biases[25].code = 2; - test_msg->biases[25].discontinuity_counter = 207; - test_msg->biases[25].integer_indicator = 127; - test_msg->biases[25].widelane_integer_indicator = 237; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[26].bias = -83375622; - test_msg->biases[26].code = 3; - test_msg->biases[26].discontinuity_counter = 145; - test_msg->biases[26].integer_indicator = 42; - test_msg->biases[26].widelane_integer_indicator = 66; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[27].bias = 1077458389; - test_msg->biases[27].code = 2; - test_msg->biases[27].discontinuity_counter = 26; - test_msg->biases[27].integer_indicator = 75; - test_msg->biases[27].widelane_integer_indicator = 230; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[28].bias = -883355501; - test_msg->biases[28].code = 97; - test_msg->biases[28].discontinuity_counter = 6; - test_msg->biases[28].integer_indicator = 88; - test_msg->biases[28].widelane_integer_indicator = 255; - if (sizeof(test_msg->biases) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->biases[0])); - } - test_msg->biases[29].bias = -1448611273; - test_msg->biases[29].code = 27; - test_msg->biases[29].discontinuity_counter = 230; - test_msg->biases[29].integer_indicator = 68; - test_msg->biases[29].widelane_integer_indicator = 243; - test_msg->dispersive_bias = 98; - test_msg->iod_ssr = 230; - test_msg->mw_consistency = 209; - test_msg->sid.code = 82; - test_msg->sid.sat = 169; - test_msg->time.tow = 210803409; - test_msg->time.wn = 42197; - test_msg->update_interval = 177; - test_msg->yaw = 5881; - test_msg->yaw_rate = 17; - - EXPECT_EQ(send_message( 0x5e6, 52955, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 52955); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->biases[0].bias, -1311498533) << "incorrect value for biases[0].bias, expected -1311498533, is " << last_msg_->biases[0].bias; - EXPECT_EQ(last_msg_->biases[0].code, 29) << "incorrect value for biases[0].code, expected 29, is " << last_msg_->biases[0].code; - EXPECT_EQ(last_msg_->biases[0].discontinuity_counter, 193) << "incorrect value for biases[0].discontinuity_counter, expected 193, is " << last_msg_->biases[0].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[0].integer_indicator, 250) << "incorrect value for biases[0].integer_indicator, expected 250, is " << last_msg_->biases[0].integer_indicator; - EXPECT_EQ(last_msg_->biases[0].widelane_integer_indicator, 245) << "incorrect value for biases[0].widelane_integer_indicator, expected 245, is " << last_msg_->biases[0].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[1].bias, 1101319226) << "incorrect value for biases[1].bias, expected 1101319226, is " << last_msg_->biases[1].bias; - EXPECT_EQ(last_msg_->biases[1].code, 207) << "incorrect value for biases[1].code, expected 207, is " << last_msg_->biases[1].code; - EXPECT_EQ(last_msg_->biases[1].discontinuity_counter, 146) << "incorrect value for biases[1].discontinuity_counter, expected 146, is " << last_msg_->biases[1].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[1].integer_indicator, 187) << "incorrect value for biases[1].integer_indicator, expected 187, is " << last_msg_->biases[1].integer_indicator; - EXPECT_EQ(last_msg_->biases[1].widelane_integer_indicator, 33) << "incorrect value for biases[1].widelane_integer_indicator, expected 33, is " << last_msg_->biases[1].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[2].bias, -64184056) << "incorrect value for biases[2].bias, expected -64184056, is " << last_msg_->biases[2].bias; - EXPECT_EQ(last_msg_->biases[2].code, 114) << "incorrect value for biases[2].code, expected 114, is " << last_msg_->biases[2].code; - EXPECT_EQ(last_msg_->biases[2].discontinuity_counter, 52) << "incorrect value for biases[2].discontinuity_counter, expected 52, is " << last_msg_->biases[2].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[2].integer_indicator, 49) << "incorrect value for biases[2].integer_indicator, expected 49, is " << last_msg_->biases[2].integer_indicator; - EXPECT_EQ(last_msg_->biases[2].widelane_integer_indicator, 248) << "incorrect value for biases[2].widelane_integer_indicator, expected 248, is " << last_msg_->biases[2].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[3].bias, -240298362) << "incorrect value for biases[3].bias, expected -240298362, is " << last_msg_->biases[3].bias; - EXPECT_EQ(last_msg_->biases[3].code, 166) << "incorrect value for biases[3].code, expected 166, is " << last_msg_->biases[3].code; - EXPECT_EQ(last_msg_->biases[3].discontinuity_counter, 124) << "incorrect value for biases[3].discontinuity_counter, expected 124, is " << last_msg_->biases[3].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[3].integer_indicator, 168) << "incorrect value for biases[3].integer_indicator, expected 168, is " << last_msg_->biases[3].integer_indicator; - EXPECT_EQ(last_msg_->biases[3].widelane_integer_indicator, 232) << "incorrect value for biases[3].widelane_integer_indicator, expected 232, is " << last_msg_->biases[3].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[4].bias, -1581740159) << "incorrect value for biases[4].bias, expected -1581740159, is " << last_msg_->biases[4].bias; - EXPECT_EQ(last_msg_->biases[4].code, 174) << "incorrect value for biases[4].code, expected 174, is " << last_msg_->biases[4].code; - EXPECT_EQ(last_msg_->biases[4].discontinuity_counter, 155) << "incorrect value for biases[4].discontinuity_counter, expected 155, is " << last_msg_->biases[4].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[4].integer_indicator, 44) << "incorrect value for biases[4].integer_indicator, expected 44, is " << last_msg_->biases[4].integer_indicator; - EXPECT_EQ(last_msg_->biases[4].widelane_integer_indicator, 142) << "incorrect value for biases[4].widelane_integer_indicator, expected 142, is " << last_msg_->biases[4].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[5].bias, -1730297136) << "incorrect value for biases[5].bias, expected -1730297136, is " << last_msg_->biases[5].bias; - EXPECT_EQ(last_msg_->biases[5].code, 211) << "incorrect value for biases[5].code, expected 211, is " << last_msg_->biases[5].code; - EXPECT_EQ(last_msg_->biases[5].discontinuity_counter, 189) << "incorrect value for biases[5].discontinuity_counter, expected 189, is " << last_msg_->biases[5].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[5].integer_indicator, 15) << "incorrect value for biases[5].integer_indicator, expected 15, is " << last_msg_->biases[5].integer_indicator; - EXPECT_EQ(last_msg_->biases[5].widelane_integer_indicator, 36) << "incorrect value for biases[5].widelane_integer_indicator, expected 36, is " << last_msg_->biases[5].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[6].bias, -1117221444) << "incorrect value for biases[6].bias, expected -1117221444, is " << last_msg_->biases[6].bias; - EXPECT_EQ(last_msg_->biases[6].code, 16) << "incorrect value for biases[6].code, expected 16, is " << last_msg_->biases[6].code; - EXPECT_EQ(last_msg_->biases[6].discontinuity_counter, 34) << "incorrect value for biases[6].discontinuity_counter, expected 34, is " << last_msg_->biases[6].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[6].integer_indicator, 203) << "incorrect value for biases[6].integer_indicator, expected 203, is " << last_msg_->biases[6].integer_indicator; - EXPECT_EQ(last_msg_->biases[6].widelane_integer_indicator, 87) << "incorrect value for biases[6].widelane_integer_indicator, expected 87, is " << last_msg_->biases[6].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[7].bias, -1137604357) << "incorrect value for biases[7].bias, expected -1137604357, is " << last_msg_->biases[7].bias; - EXPECT_EQ(last_msg_->biases[7].code, 102) << "incorrect value for biases[7].code, expected 102, is " << last_msg_->biases[7].code; - EXPECT_EQ(last_msg_->biases[7].discontinuity_counter, 22) << "incorrect value for biases[7].discontinuity_counter, expected 22, is " << last_msg_->biases[7].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[7].integer_indicator, 156) << "incorrect value for biases[7].integer_indicator, expected 156, is " << last_msg_->biases[7].integer_indicator; - EXPECT_EQ(last_msg_->biases[7].widelane_integer_indicator, 252) << "incorrect value for biases[7].widelane_integer_indicator, expected 252, is " << last_msg_->biases[7].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[8].bias, -1910370172) << "incorrect value for biases[8].bias, expected -1910370172, is " << last_msg_->biases[8].bias; - EXPECT_EQ(last_msg_->biases[8].code, 157) << "incorrect value for biases[8].code, expected 157, is " << last_msg_->biases[8].code; - EXPECT_EQ(last_msg_->biases[8].discontinuity_counter, 49) << "incorrect value for biases[8].discontinuity_counter, expected 49, is " << last_msg_->biases[8].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[8].integer_indicator, 222) << "incorrect value for biases[8].integer_indicator, expected 222, is " << last_msg_->biases[8].integer_indicator; - EXPECT_EQ(last_msg_->biases[8].widelane_integer_indicator, 245) << "incorrect value for biases[8].widelane_integer_indicator, expected 245, is " << last_msg_->biases[8].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[9].bias, 1247996869) << "incorrect value for biases[9].bias, expected 1247996869, is " << last_msg_->biases[9].bias; - EXPECT_EQ(last_msg_->biases[9].code, 228) << "incorrect value for biases[9].code, expected 228, is " << last_msg_->biases[9].code; - EXPECT_EQ(last_msg_->biases[9].discontinuity_counter, 221) << "incorrect value for biases[9].discontinuity_counter, expected 221, is " << last_msg_->biases[9].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[9].integer_indicator, 85) << "incorrect value for biases[9].integer_indicator, expected 85, is " << last_msg_->biases[9].integer_indicator; - EXPECT_EQ(last_msg_->biases[9].widelane_integer_indicator, 139) << "incorrect value for biases[9].widelane_integer_indicator, expected 139, is " << last_msg_->biases[9].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[10].bias, -1133446161) << "incorrect value for biases[10].bias, expected -1133446161, is " << last_msg_->biases[10].bias; - EXPECT_EQ(last_msg_->biases[10].code, 107) << "incorrect value for biases[10].code, expected 107, is " << last_msg_->biases[10].code; - EXPECT_EQ(last_msg_->biases[10].discontinuity_counter, 38) << "incorrect value for biases[10].discontinuity_counter, expected 38, is " << last_msg_->biases[10].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[10].integer_indicator, 70) << "incorrect value for biases[10].integer_indicator, expected 70, is " << last_msg_->biases[10].integer_indicator; - EXPECT_EQ(last_msg_->biases[10].widelane_integer_indicator, 36) << "incorrect value for biases[10].widelane_integer_indicator, expected 36, is " << last_msg_->biases[10].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[11].bias, -720934762) << "incorrect value for biases[11].bias, expected -720934762, is " << last_msg_->biases[11].bias; - EXPECT_EQ(last_msg_->biases[11].code, 124) << "incorrect value for biases[11].code, expected 124, is " << last_msg_->biases[11].code; - EXPECT_EQ(last_msg_->biases[11].discontinuity_counter, 164) << "incorrect value for biases[11].discontinuity_counter, expected 164, is " << last_msg_->biases[11].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[11].integer_indicator, 246) << "incorrect value for biases[11].integer_indicator, expected 246, is " << last_msg_->biases[11].integer_indicator; - EXPECT_EQ(last_msg_->biases[11].widelane_integer_indicator, 141) << "incorrect value for biases[11].widelane_integer_indicator, expected 141, is " << last_msg_->biases[11].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[12].bias, 706252548) << "incorrect value for biases[12].bias, expected 706252548, is " << last_msg_->biases[12].bias; - EXPECT_EQ(last_msg_->biases[12].code, 44) << "incorrect value for biases[12].code, expected 44, is " << last_msg_->biases[12].code; - EXPECT_EQ(last_msg_->biases[12].discontinuity_counter, 192) << "incorrect value for biases[12].discontinuity_counter, expected 192, is " << last_msg_->biases[12].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[12].integer_indicator, 21) << "incorrect value for biases[12].integer_indicator, expected 21, is " << last_msg_->biases[12].integer_indicator; - EXPECT_EQ(last_msg_->biases[12].widelane_integer_indicator, 244) << "incorrect value for biases[12].widelane_integer_indicator, expected 244, is " << last_msg_->biases[12].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[13].bias, 388855338) << "incorrect value for biases[13].bias, expected 388855338, is " << last_msg_->biases[13].bias; - EXPECT_EQ(last_msg_->biases[13].code, 21) << "incorrect value for biases[13].code, expected 21, is " << last_msg_->biases[13].code; - EXPECT_EQ(last_msg_->biases[13].discontinuity_counter, 7) << "incorrect value for biases[13].discontinuity_counter, expected 7, is " << last_msg_->biases[13].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[13].integer_indicator, 84) << "incorrect value for biases[13].integer_indicator, expected 84, is " << last_msg_->biases[13].integer_indicator; - EXPECT_EQ(last_msg_->biases[13].widelane_integer_indicator, 136) << "incorrect value for biases[13].widelane_integer_indicator, expected 136, is " << last_msg_->biases[13].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[14].bias, 47517353) << "incorrect value for biases[14].bias, expected 47517353, is " << last_msg_->biases[14].bias; - EXPECT_EQ(last_msg_->biases[14].code, 174) << "incorrect value for biases[14].code, expected 174, is " << last_msg_->biases[14].code; - EXPECT_EQ(last_msg_->biases[14].discontinuity_counter, 54) << "incorrect value for biases[14].discontinuity_counter, expected 54, is " << last_msg_->biases[14].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[14].integer_indicator, 175) << "incorrect value for biases[14].integer_indicator, expected 175, is " << last_msg_->biases[14].integer_indicator; - EXPECT_EQ(last_msg_->biases[14].widelane_integer_indicator, 129) << "incorrect value for biases[14].widelane_integer_indicator, expected 129, is " << last_msg_->biases[14].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[15].bias, -2124125745) << "incorrect value for biases[15].bias, expected -2124125745, is " << last_msg_->biases[15].bias; - EXPECT_EQ(last_msg_->biases[15].code, 197) << "incorrect value for biases[15].code, expected 197, is " << last_msg_->biases[15].code; - EXPECT_EQ(last_msg_->biases[15].discontinuity_counter, 13) << "incorrect value for biases[15].discontinuity_counter, expected 13, is " << last_msg_->biases[15].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[15].integer_indicator, 98) << "incorrect value for biases[15].integer_indicator, expected 98, is " << last_msg_->biases[15].integer_indicator; - EXPECT_EQ(last_msg_->biases[15].widelane_integer_indicator, 60) << "incorrect value for biases[15].widelane_integer_indicator, expected 60, is " << last_msg_->biases[15].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[16].bias, -1401812607) << "incorrect value for biases[16].bias, expected -1401812607, is " << last_msg_->biases[16].bias; - EXPECT_EQ(last_msg_->biases[16].code, 72) << "incorrect value for biases[16].code, expected 72, is " << last_msg_->biases[16].code; - EXPECT_EQ(last_msg_->biases[16].discontinuity_counter, 140) << "incorrect value for biases[16].discontinuity_counter, expected 140, is " << last_msg_->biases[16].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[16].integer_indicator, 136) << "incorrect value for biases[16].integer_indicator, expected 136, is " << last_msg_->biases[16].integer_indicator; - EXPECT_EQ(last_msg_->biases[16].widelane_integer_indicator, 240) << "incorrect value for biases[16].widelane_integer_indicator, expected 240, is " << last_msg_->biases[16].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[17].bias, 60257151) << "incorrect value for biases[17].bias, expected 60257151, is " << last_msg_->biases[17].bias; - EXPECT_EQ(last_msg_->biases[17].code, 151) << "incorrect value for biases[17].code, expected 151, is " << last_msg_->biases[17].code; - EXPECT_EQ(last_msg_->biases[17].discontinuity_counter, 210) << "incorrect value for biases[17].discontinuity_counter, expected 210, is " << last_msg_->biases[17].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[17].integer_indicator, 150) << "incorrect value for biases[17].integer_indicator, expected 150, is " << last_msg_->biases[17].integer_indicator; - EXPECT_EQ(last_msg_->biases[17].widelane_integer_indicator, 17) << "incorrect value for biases[17].widelane_integer_indicator, expected 17, is " << last_msg_->biases[17].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[18].bias, 41820677) << "incorrect value for biases[18].bias, expected 41820677, is " << last_msg_->biases[18].bias; - EXPECT_EQ(last_msg_->biases[18].code, 242) << "incorrect value for biases[18].code, expected 242, is " << last_msg_->biases[18].code; - EXPECT_EQ(last_msg_->biases[18].discontinuity_counter, 14) << "incorrect value for biases[18].discontinuity_counter, expected 14, is " << last_msg_->biases[18].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[18].integer_indicator, 254) << "incorrect value for biases[18].integer_indicator, expected 254, is " << last_msg_->biases[18].integer_indicator; - EXPECT_EQ(last_msg_->biases[18].widelane_integer_indicator, 215) << "incorrect value for biases[18].widelane_integer_indicator, expected 215, is " << last_msg_->biases[18].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[19].bias, 1640616471) << "incorrect value for biases[19].bias, expected 1640616471, is " << last_msg_->biases[19].bias; - EXPECT_EQ(last_msg_->biases[19].code, 215) << "incorrect value for biases[19].code, expected 215, is " << last_msg_->biases[19].code; - EXPECT_EQ(last_msg_->biases[19].discontinuity_counter, 176) << "incorrect value for biases[19].discontinuity_counter, expected 176, is " << last_msg_->biases[19].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[19].integer_indicator, 65) << "incorrect value for biases[19].integer_indicator, expected 65, is " << last_msg_->biases[19].integer_indicator; - EXPECT_EQ(last_msg_->biases[19].widelane_integer_indicator, 38) << "incorrect value for biases[19].widelane_integer_indicator, expected 38, is " << last_msg_->biases[19].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[20].bias, -744786918) << "incorrect value for biases[20].bias, expected -744786918, is " << last_msg_->biases[20].bias; - EXPECT_EQ(last_msg_->biases[20].code, 36) << "incorrect value for biases[20].code, expected 36, is " << last_msg_->biases[20].code; - EXPECT_EQ(last_msg_->biases[20].discontinuity_counter, 224) << "incorrect value for biases[20].discontinuity_counter, expected 224, is " << last_msg_->biases[20].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[20].integer_indicator, 207) << "incorrect value for biases[20].integer_indicator, expected 207, is " << last_msg_->biases[20].integer_indicator; - EXPECT_EQ(last_msg_->biases[20].widelane_integer_indicator, 92) << "incorrect value for biases[20].widelane_integer_indicator, expected 92, is " << last_msg_->biases[20].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[21].bias, 1966589763) << "incorrect value for biases[21].bias, expected 1966589763, is " << last_msg_->biases[21].bias; - EXPECT_EQ(last_msg_->biases[21].code, 165) << "incorrect value for biases[21].code, expected 165, is " << last_msg_->biases[21].code; - EXPECT_EQ(last_msg_->biases[21].discontinuity_counter, 38) << "incorrect value for biases[21].discontinuity_counter, expected 38, is " << last_msg_->biases[21].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[21].integer_indicator, 47) << "incorrect value for biases[21].integer_indicator, expected 47, is " << last_msg_->biases[21].integer_indicator; - EXPECT_EQ(last_msg_->biases[21].widelane_integer_indicator, 102) << "incorrect value for biases[21].widelane_integer_indicator, expected 102, is " << last_msg_->biases[21].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[22].bias, 364366310) << "incorrect value for biases[22].bias, expected 364366310, is " << last_msg_->biases[22].bias; - EXPECT_EQ(last_msg_->biases[22].code, 36) << "incorrect value for biases[22].code, expected 36, is " << last_msg_->biases[22].code; - EXPECT_EQ(last_msg_->biases[22].discontinuity_counter, 1) << "incorrect value for biases[22].discontinuity_counter, expected 1, is " << last_msg_->biases[22].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[22].integer_indicator, 169) << "incorrect value for biases[22].integer_indicator, expected 169, is " << last_msg_->biases[22].integer_indicator; - EXPECT_EQ(last_msg_->biases[22].widelane_integer_indicator, 33) << "incorrect value for biases[22].widelane_integer_indicator, expected 33, is " << last_msg_->biases[22].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[23].bias, -1839031379) << "incorrect value for biases[23].bias, expected -1839031379, is " << last_msg_->biases[23].bias; - EXPECT_EQ(last_msg_->biases[23].code, 42) << "incorrect value for biases[23].code, expected 42, is " << last_msg_->biases[23].code; - EXPECT_EQ(last_msg_->biases[23].discontinuity_counter, 173) << "incorrect value for biases[23].discontinuity_counter, expected 173, is " << last_msg_->biases[23].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[23].integer_indicator, 62) << "incorrect value for biases[23].integer_indicator, expected 62, is " << last_msg_->biases[23].integer_indicator; - EXPECT_EQ(last_msg_->biases[23].widelane_integer_indicator, 147) << "incorrect value for biases[23].widelane_integer_indicator, expected 147, is " << last_msg_->biases[23].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[24].bias, 31817639) << "incorrect value for biases[24].bias, expected 31817639, is " << last_msg_->biases[24].bias; - EXPECT_EQ(last_msg_->biases[24].code, 231) << "incorrect value for biases[24].code, expected 231, is " << last_msg_->biases[24].code; - EXPECT_EQ(last_msg_->biases[24].discontinuity_counter, 82) << "incorrect value for biases[24].discontinuity_counter, expected 82, is " << last_msg_->biases[24].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[24].integer_indicator, 167) << "incorrect value for biases[24].integer_indicator, expected 167, is " << last_msg_->biases[24].integer_indicator; - EXPECT_EQ(last_msg_->biases[24].widelane_integer_indicator, 138) << "incorrect value for biases[24].widelane_integer_indicator, expected 138, is " << last_msg_->biases[24].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[25].bias, -1619830156) << "incorrect value for biases[25].bias, expected -1619830156, is " << last_msg_->biases[25].bias; - EXPECT_EQ(last_msg_->biases[25].code, 2) << "incorrect value for biases[25].code, expected 2, is " << last_msg_->biases[25].code; - EXPECT_EQ(last_msg_->biases[25].discontinuity_counter, 207) << "incorrect value for biases[25].discontinuity_counter, expected 207, is " << last_msg_->biases[25].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[25].integer_indicator, 127) << "incorrect value for biases[25].integer_indicator, expected 127, is " << last_msg_->biases[25].integer_indicator; - EXPECT_EQ(last_msg_->biases[25].widelane_integer_indicator, 237) << "incorrect value for biases[25].widelane_integer_indicator, expected 237, is " << last_msg_->biases[25].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[26].bias, -83375622) << "incorrect value for biases[26].bias, expected -83375622, is " << last_msg_->biases[26].bias; - EXPECT_EQ(last_msg_->biases[26].code, 3) << "incorrect value for biases[26].code, expected 3, is " << last_msg_->biases[26].code; - EXPECT_EQ(last_msg_->biases[26].discontinuity_counter, 145) << "incorrect value for biases[26].discontinuity_counter, expected 145, is " << last_msg_->biases[26].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[26].integer_indicator, 42) << "incorrect value for biases[26].integer_indicator, expected 42, is " << last_msg_->biases[26].integer_indicator; - EXPECT_EQ(last_msg_->biases[26].widelane_integer_indicator, 66) << "incorrect value for biases[26].widelane_integer_indicator, expected 66, is " << last_msg_->biases[26].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[27].bias, 1077458389) << "incorrect value for biases[27].bias, expected 1077458389, is " << last_msg_->biases[27].bias; - EXPECT_EQ(last_msg_->biases[27].code, 2) << "incorrect value for biases[27].code, expected 2, is " << last_msg_->biases[27].code; - EXPECT_EQ(last_msg_->biases[27].discontinuity_counter, 26) << "incorrect value for biases[27].discontinuity_counter, expected 26, is " << last_msg_->biases[27].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[27].integer_indicator, 75) << "incorrect value for biases[27].integer_indicator, expected 75, is " << last_msg_->biases[27].integer_indicator; - EXPECT_EQ(last_msg_->biases[27].widelane_integer_indicator, 230) << "incorrect value for biases[27].widelane_integer_indicator, expected 230, is " << last_msg_->biases[27].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[28].bias, -883355501) << "incorrect value for biases[28].bias, expected -883355501, is " << last_msg_->biases[28].bias; - EXPECT_EQ(last_msg_->biases[28].code, 97) << "incorrect value for biases[28].code, expected 97, is " << last_msg_->biases[28].code; - EXPECT_EQ(last_msg_->biases[28].discontinuity_counter, 6) << "incorrect value for biases[28].discontinuity_counter, expected 6, is " << last_msg_->biases[28].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[28].integer_indicator, 88) << "incorrect value for biases[28].integer_indicator, expected 88, is " << last_msg_->biases[28].integer_indicator; - EXPECT_EQ(last_msg_->biases[28].widelane_integer_indicator, 255) << "incorrect value for biases[28].widelane_integer_indicator, expected 255, is " << last_msg_->biases[28].widelane_integer_indicator; - EXPECT_EQ(last_msg_->biases[29].bias, -1448611273) << "incorrect value for biases[29].bias, expected -1448611273, is " << last_msg_->biases[29].bias; - EXPECT_EQ(last_msg_->biases[29].code, 27) << "incorrect value for biases[29].code, expected 27, is " << last_msg_->biases[29].code; - EXPECT_EQ(last_msg_->biases[29].discontinuity_counter, 230) << "incorrect value for biases[29].discontinuity_counter, expected 230, is " << last_msg_->biases[29].discontinuity_counter; - EXPECT_EQ(last_msg_->biases[29].integer_indicator, 68) << "incorrect value for biases[29].integer_indicator, expected 68, is " << last_msg_->biases[29].integer_indicator; - EXPECT_EQ(last_msg_->biases[29].widelane_integer_indicator, 243) << "incorrect value for biases[29].widelane_integer_indicator, expected 243, is " << last_msg_->biases[29].widelane_integer_indicator; - EXPECT_EQ(last_msg_->dispersive_bias, 98) << "incorrect value for dispersive_bias, expected 98, is " << last_msg_->dispersive_bias; - EXPECT_EQ(last_msg_->iod_ssr, 230) << "incorrect value for iod_ssr, expected 230, is " << last_msg_->iod_ssr; - EXPECT_EQ(last_msg_->mw_consistency, 209) << "incorrect value for mw_consistency, expected 209, is " << last_msg_->mw_consistency; - EXPECT_EQ(last_msg_->sid.code, 82) << "incorrect value for sid.code, expected 82, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.sat, 169) << "incorrect value for sid.sat, expected 169, is " << last_msg_->sid.sat; - EXPECT_EQ(last_msg_->time.tow, 210803409) << "incorrect value for time.tow, expected 210803409, is " << last_msg_->time.tow; - EXPECT_EQ(last_msg_->time.wn, 42197) << "incorrect value for time.wn, expected 42197, is " << last_msg_->time.wn; - EXPECT_EQ(last_msg_->update_interval, 177) << "incorrect value for update_interval, expected 177, is " << last_msg_->update_interval; - EXPECT_EQ(last_msg_->yaw, 5881) << "incorrect value for yaw, expected 5881, is " << last_msg_->yaw; - EXPECT_EQ(last_msg_->yaw_rate, 17) << "incorrect value for yaw_rate, expected 17, is " << last_msg_->yaw_rate; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 52955); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->biases[0].bias, -1311498533) + << "incorrect value for biases[0].bias, expected -1311498533, is " + << last_msg_->biases[0].bias; + EXPECT_EQ(last_msg_->biases[0].code, 29) + << "incorrect value for biases[0].code, expected 29, is " + << last_msg_->biases[0].code; + EXPECT_EQ(last_msg_->biases[0].discontinuity_counter, 193) + << "incorrect value for biases[0].discontinuity_counter, expected 193, " + "is " + << last_msg_->biases[0].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[0].integer_indicator, 250) + << "incorrect value for biases[0].integer_indicator, expected 250, is " + << last_msg_->biases[0].integer_indicator; + EXPECT_EQ(last_msg_->biases[0].widelane_integer_indicator, 245) + << "incorrect value for biases[0].widelane_integer_indicator, expected " + "245, is " + << last_msg_->biases[0].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[1].bias, 1101319226) + << "incorrect value for biases[1].bias, expected 1101319226, is " + << last_msg_->biases[1].bias; + EXPECT_EQ(last_msg_->biases[1].code, 207) + << "incorrect value for biases[1].code, expected 207, is " + << last_msg_->biases[1].code; + EXPECT_EQ(last_msg_->biases[1].discontinuity_counter, 146) + << "incorrect value for biases[1].discontinuity_counter, expected 146, " + "is " + << last_msg_->biases[1].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[1].integer_indicator, 187) + << "incorrect value for biases[1].integer_indicator, expected 187, is " + << last_msg_->biases[1].integer_indicator; + EXPECT_EQ(last_msg_->biases[1].widelane_integer_indicator, 33) + << "incorrect value for biases[1].widelane_integer_indicator, expected " + "33, is " + << last_msg_->biases[1].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[2].bias, -64184056) + << "incorrect value for biases[2].bias, expected -64184056, is " + << last_msg_->biases[2].bias; + EXPECT_EQ(last_msg_->biases[2].code, 114) + << "incorrect value for biases[2].code, expected 114, is " + << last_msg_->biases[2].code; + EXPECT_EQ(last_msg_->biases[2].discontinuity_counter, 52) + << "incorrect value for biases[2].discontinuity_counter, expected 52, is " + << last_msg_->biases[2].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[2].integer_indicator, 49) + << "incorrect value for biases[2].integer_indicator, expected 49, is " + << last_msg_->biases[2].integer_indicator; + EXPECT_EQ(last_msg_->biases[2].widelane_integer_indicator, 248) + << "incorrect value for biases[2].widelane_integer_indicator, expected " + "248, is " + << last_msg_->biases[2].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[3].bias, -240298362) + << "incorrect value for biases[3].bias, expected -240298362, is " + << last_msg_->biases[3].bias; + EXPECT_EQ(last_msg_->biases[3].code, 166) + << "incorrect value for biases[3].code, expected 166, is " + << last_msg_->biases[3].code; + EXPECT_EQ(last_msg_->biases[3].discontinuity_counter, 124) + << "incorrect value for biases[3].discontinuity_counter, expected 124, " + "is " + << last_msg_->biases[3].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[3].integer_indicator, 168) + << "incorrect value for biases[3].integer_indicator, expected 168, is " + << last_msg_->biases[3].integer_indicator; + EXPECT_EQ(last_msg_->biases[3].widelane_integer_indicator, 232) + << "incorrect value for biases[3].widelane_integer_indicator, expected " + "232, is " + << last_msg_->biases[3].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[4].bias, -1581740159) + << "incorrect value for biases[4].bias, expected -1581740159, is " + << last_msg_->biases[4].bias; + EXPECT_EQ(last_msg_->biases[4].code, 174) + << "incorrect value for biases[4].code, expected 174, is " + << last_msg_->biases[4].code; + EXPECT_EQ(last_msg_->biases[4].discontinuity_counter, 155) + << "incorrect value for biases[4].discontinuity_counter, expected 155, " + "is " + << last_msg_->biases[4].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[4].integer_indicator, 44) + << "incorrect value for biases[4].integer_indicator, expected 44, is " + << last_msg_->biases[4].integer_indicator; + EXPECT_EQ(last_msg_->biases[4].widelane_integer_indicator, 142) + << "incorrect value for biases[4].widelane_integer_indicator, expected " + "142, is " + << last_msg_->biases[4].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[5].bias, -1730297136) + << "incorrect value for biases[5].bias, expected -1730297136, is " + << last_msg_->biases[5].bias; + EXPECT_EQ(last_msg_->biases[5].code, 211) + << "incorrect value for biases[5].code, expected 211, is " + << last_msg_->biases[5].code; + EXPECT_EQ(last_msg_->biases[5].discontinuity_counter, 189) + << "incorrect value for biases[5].discontinuity_counter, expected 189, " + "is " + << last_msg_->biases[5].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[5].integer_indicator, 15) + << "incorrect value for biases[5].integer_indicator, expected 15, is " + << last_msg_->biases[5].integer_indicator; + EXPECT_EQ(last_msg_->biases[5].widelane_integer_indicator, 36) + << "incorrect value for biases[5].widelane_integer_indicator, expected " + "36, is " + << last_msg_->biases[5].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[6].bias, -1117221444) + << "incorrect value for biases[6].bias, expected -1117221444, is " + << last_msg_->biases[6].bias; + EXPECT_EQ(last_msg_->biases[6].code, 16) + << "incorrect value for biases[6].code, expected 16, is " + << last_msg_->biases[6].code; + EXPECT_EQ(last_msg_->biases[6].discontinuity_counter, 34) + << "incorrect value for biases[6].discontinuity_counter, expected 34, is " + << last_msg_->biases[6].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[6].integer_indicator, 203) + << "incorrect value for biases[6].integer_indicator, expected 203, is " + << last_msg_->biases[6].integer_indicator; + EXPECT_EQ(last_msg_->biases[6].widelane_integer_indicator, 87) + << "incorrect value for biases[6].widelane_integer_indicator, expected " + "87, is " + << last_msg_->biases[6].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[7].bias, -1137604357) + << "incorrect value for biases[7].bias, expected -1137604357, is " + << last_msg_->biases[7].bias; + EXPECT_EQ(last_msg_->biases[7].code, 102) + << "incorrect value for biases[7].code, expected 102, is " + << last_msg_->biases[7].code; + EXPECT_EQ(last_msg_->biases[7].discontinuity_counter, 22) + << "incorrect value for biases[7].discontinuity_counter, expected 22, is " + << last_msg_->biases[7].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[7].integer_indicator, 156) + << "incorrect value for biases[7].integer_indicator, expected 156, is " + << last_msg_->biases[7].integer_indicator; + EXPECT_EQ(last_msg_->biases[7].widelane_integer_indicator, 252) + << "incorrect value for biases[7].widelane_integer_indicator, expected " + "252, is " + << last_msg_->biases[7].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[8].bias, -1910370172) + << "incorrect value for biases[8].bias, expected -1910370172, is " + << last_msg_->biases[8].bias; + EXPECT_EQ(last_msg_->biases[8].code, 157) + << "incorrect value for biases[8].code, expected 157, is " + << last_msg_->biases[8].code; + EXPECT_EQ(last_msg_->biases[8].discontinuity_counter, 49) + << "incorrect value for biases[8].discontinuity_counter, expected 49, is " + << last_msg_->biases[8].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[8].integer_indicator, 222) + << "incorrect value for biases[8].integer_indicator, expected 222, is " + << last_msg_->biases[8].integer_indicator; + EXPECT_EQ(last_msg_->biases[8].widelane_integer_indicator, 245) + << "incorrect value for biases[8].widelane_integer_indicator, expected " + "245, is " + << last_msg_->biases[8].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[9].bias, 1247996869) + << "incorrect value for biases[9].bias, expected 1247996869, is " + << last_msg_->biases[9].bias; + EXPECT_EQ(last_msg_->biases[9].code, 228) + << "incorrect value for biases[9].code, expected 228, is " + << last_msg_->biases[9].code; + EXPECT_EQ(last_msg_->biases[9].discontinuity_counter, 221) + << "incorrect value for biases[9].discontinuity_counter, expected 221, " + "is " + << last_msg_->biases[9].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[9].integer_indicator, 85) + << "incorrect value for biases[9].integer_indicator, expected 85, is " + << last_msg_->biases[9].integer_indicator; + EXPECT_EQ(last_msg_->biases[9].widelane_integer_indicator, 139) + << "incorrect value for biases[9].widelane_integer_indicator, expected " + "139, is " + << last_msg_->biases[9].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[10].bias, -1133446161) + << "incorrect value for biases[10].bias, expected -1133446161, is " + << last_msg_->biases[10].bias; + EXPECT_EQ(last_msg_->biases[10].code, 107) + << "incorrect value for biases[10].code, expected 107, is " + << last_msg_->biases[10].code; + EXPECT_EQ(last_msg_->biases[10].discontinuity_counter, 38) + << "incorrect value for biases[10].discontinuity_counter, expected 38, " + "is " + << last_msg_->biases[10].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[10].integer_indicator, 70) + << "incorrect value for biases[10].integer_indicator, expected 70, is " + << last_msg_->biases[10].integer_indicator; + EXPECT_EQ(last_msg_->biases[10].widelane_integer_indicator, 36) + << "incorrect value for biases[10].widelane_integer_indicator, expected " + "36, is " + << last_msg_->biases[10].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[11].bias, -720934762) + << "incorrect value for biases[11].bias, expected -720934762, is " + << last_msg_->biases[11].bias; + EXPECT_EQ(last_msg_->biases[11].code, 124) + << "incorrect value for biases[11].code, expected 124, is " + << last_msg_->biases[11].code; + EXPECT_EQ(last_msg_->biases[11].discontinuity_counter, 164) + << "incorrect value for biases[11].discontinuity_counter, expected 164, " + "is " + << last_msg_->biases[11].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[11].integer_indicator, 246) + << "incorrect value for biases[11].integer_indicator, expected 246, is " + << last_msg_->biases[11].integer_indicator; + EXPECT_EQ(last_msg_->biases[11].widelane_integer_indicator, 141) + << "incorrect value for biases[11].widelane_integer_indicator, expected " + "141, is " + << last_msg_->biases[11].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[12].bias, 706252548) + << "incorrect value for biases[12].bias, expected 706252548, is " + << last_msg_->biases[12].bias; + EXPECT_EQ(last_msg_->biases[12].code, 44) + << "incorrect value for biases[12].code, expected 44, is " + << last_msg_->biases[12].code; + EXPECT_EQ(last_msg_->biases[12].discontinuity_counter, 192) + << "incorrect value for biases[12].discontinuity_counter, expected 192, " + "is " + << last_msg_->biases[12].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[12].integer_indicator, 21) + << "incorrect value for biases[12].integer_indicator, expected 21, is " + << last_msg_->biases[12].integer_indicator; + EXPECT_EQ(last_msg_->biases[12].widelane_integer_indicator, 244) + << "incorrect value for biases[12].widelane_integer_indicator, expected " + "244, is " + << last_msg_->biases[12].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[13].bias, 388855338) + << "incorrect value for biases[13].bias, expected 388855338, is " + << last_msg_->biases[13].bias; + EXPECT_EQ(last_msg_->biases[13].code, 21) + << "incorrect value for biases[13].code, expected 21, is " + << last_msg_->biases[13].code; + EXPECT_EQ(last_msg_->biases[13].discontinuity_counter, 7) + << "incorrect value for biases[13].discontinuity_counter, expected 7, is " + << last_msg_->biases[13].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[13].integer_indicator, 84) + << "incorrect value for biases[13].integer_indicator, expected 84, is " + << last_msg_->biases[13].integer_indicator; + EXPECT_EQ(last_msg_->biases[13].widelane_integer_indicator, 136) + << "incorrect value for biases[13].widelane_integer_indicator, expected " + "136, is " + << last_msg_->biases[13].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[14].bias, 47517353) + << "incorrect value for biases[14].bias, expected 47517353, is " + << last_msg_->biases[14].bias; + EXPECT_EQ(last_msg_->biases[14].code, 174) + << "incorrect value for biases[14].code, expected 174, is " + << last_msg_->biases[14].code; + EXPECT_EQ(last_msg_->biases[14].discontinuity_counter, 54) + << "incorrect value for biases[14].discontinuity_counter, expected 54, " + "is " + << last_msg_->biases[14].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[14].integer_indicator, 175) + << "incorrect value for biases[14].integer_indicator, expected 175, is " + << last_msg_->biases[14].integer_indicator; + EXPECT_EQ(last_msg_->biases[14].widelane_integer_indicator, 129) + << "incorrect value for biases[14].widelane_integer_indicator, expected " + "129, is " + << last_msg_->biases[14].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[15].bias, -2124125745) + << "incorrect value for biases[15].bias, expected -2124125745, is " + << last_msg_->biases[15].bias; + EXPECT_EQ(last_msg_->biases[15].code, 197) + << "incorrect value for biases[15].code, expected 197, is " + << last_msg_->biases[15].code; + EXPECT_EQ(last_msg_->biases[15].discontinuity_counter, 13) + << "incorrect value for biases[15].discontinuity_counter, expected 13, " + "is " + << last_msg_->biases[15].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[15].integer_indicator, 98) + << "incorrect value for biases[15].integer_indicator, expected 98, is " + << last_msg_->biases[15].integer_indicator; + EXPECT_EQ(last_msg_->biases[15].widelane_integer_indicator, 60) + << "incorrect value for biases[15].widelane_integer_indicator, expected " + "60, is " + << last_msg_->biases[15].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[16].bias, -1401812607) + << "incorrect value for biases[16].bias, expected -1401812607, is " + << last_msg_->biases[16].bias; + EXPECT_EQ(last_msg_->biases[16].code, 72) + << "incorrect value for biases[16].code, expected 72, is " + << last_msg_->biases[16].code; + EXPECT_EQ(last_msg_->biases[16].discontinuity_counter, 140) + << "incorrect value for biases[16].discontinuity_counter, expected 140, " + "is " + << last_msg_->biases[16].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[16].integer_indicator, 136) + << "incorrect value for biases[16].integer_indicator, expected 136, is " + << last_msg_->biases[16].integer_indicator; + EXPECT_EQ(last_msg_->biases[16].widelane_integer_indicator, 240) + << "incorrect value for biases[16].widelane_integer_indicator, expected " + "240, is " + << last_msg_->biases[16].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[17].bias, 60257151) + << "incorrect value for biases[17].bias, expected 60257151, is " + << last_msg_->biases[17].bias; + EXPECT_EQ(last_msg_->biases[17].code, 151) + << "incorrect value for biases[17].code, expected 151, is " + << last_msg_->biases[17].code; + EXPECT_EQ(last_msg_->biases[17].discontinuity_counter, 210) + << "incorrect value for biases[17].discontinuity_counter, expected 210, " + "is " + << last_msg_->biases[17].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[17].integer_indicator, 150) + << "incorrect value for biases[17].integer_indicator, expected 150, is " + << last_msg_->biases[17].integer_indicator; + EXPECT_EQ(last_msg_->biases[17].widelane_integer_indicator, 17) + << "incorrect value for biases[17].widelane_integer_indicator, expected " + "17, is " + << last_msg_->biases[17].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[18].bias, 41820677) + << "incorrect value for biases[18].bias, expected 41820677, is " + << last_msg_->biases[18].bias; + EXPECT_EQ(last_msg_->biases[18].code, 242) + << "incorrect value for biases[18].code, expected 242, is " + << last_msg_->biases[18].code; + EXPECT_EQ(last_msg_->biases[18].discontinuity_counter, 14) + << "incorrect value for biases[18].discontinuity_counter, expected 14, " + "is " + << last_msg_->biases[18].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[18].integer_indicator, 254) + << "incorrect value for biases[18].integer_indicator, expected 254, is " + << last_msg_->biases[18].integer_indicator; + EXPECT_EQ(last_msg_->biases[18].widelane_integer_indicator, 215) + << "incorrect value for biases[18].widelane_integer_indicator, expected " + "215, is " + << last_msg_->biases[18].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[19].bias, 1640616471) + << "incorrect value for biases[19].bias, expected 1640616471, is " + << last_msg_->biases[19].bias; + EXPECT_EQ(last_msg_->biases[19].code, 215) + << "incorrect value for biases[19].code, expected 215, is " + << last_msg_->biases[19].code; + EXPECT_EQ(last_msg_->biases[19].discontinuity_counter, 176) + << "incorrect value for biases[19].discontinuity_counter, expected 176, " + "is " + << last_msg_->biases[19].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[19].integer_indicator, 65) + << "incorrect value for biases[19].integer_indicator, expected 65, is " + << last_msg_->biases[19].integer_indicator; + EXPECT_EQ(last_msg_->biases[19].widelane_integer_indicator, 38) + << "incorrect value for biases[19].widelane_integer_indicator, expected " + "38, is " + << last_msg_->biases[19].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[20].bias, -744786918) + << "incorrect value for biases[20].bias, expected -744786918, is " + << last_msg_->biases[20].bias; + EXPECT_EQ(last_msg_->biases[20].code, 36) + << "incorrect value for biases[20].code, expected 36, is " + << last_msg_->biases[20].code; + EXPECT_EQ(last_msg_->biases[20].discontinuity_counter, 224) + << "incorrect value for biases[20].discontinuity_counter, expected 224, " + "is " + << last_msg_->biases[20].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[20].integer_indicator, 207) + << "incorrect value for biases[20].integer_indicator, expected 207, is " + << last_msg_->biases[20].integer_indicator; + EXPECT_EQ(last_msg_->biases[20].widelane_integer_indicator, 92) + << "incorrect value for biases[20].widelane_integer_indicator, expected " + "92, is " + << last_msg_->biases[20].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[21].bias, 1966589763) + << "incorrect value for biases[21].bias, expected 1966589763, is " + << last_msg_->biases[21].bias; + EXPECT_EQ(last_msg_->biases[21].code, 165) + << "incorrect value for biases[21].code, expected 165, is " + << last_msg_->biases[21].code; + EXPECT_EQ(last_msg_->biases[21].discontinuity_counter, 38) + << "incorrect value for biases[21].discontinuity_counter, expected 38, " + "is " + << last_msg_->biases[21].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[21].integer_indicator, 47) + << "incorrect value for biases[21].integer_indicator, expected 47, is " + << last_msg_->biases[21].integer_indicator; + EXPECT_EQ(last_msg_->biases[21].widelane_integer_indicator, 102) + << "incorrect value for biases[21].widelane_integer_indicator, expected " + "102, is " + << last_msg_->biases[21].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[22].bias, 364366310) + << "incorrect value for biases[22].bias, expected 364366310, is " + << last_msg_->biases[22].bias; + EXPECT_EQ(last_msg_->biases[22].code, 36) + << "incorrect value for biases[22].code, expected 36, is " + << last_msg_->biases[22].code; + EXPECT_EQ(last_msg_->biases[22].discontinuity_counter, 1) + << "incorrect value for biases[22].discontinuity_counter, expected 1, is " + << last_msg_->biases[22].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[22].integer_indicator, 169) + << "incorrect value for biases[22].integer_indicator, expected 169, is " + << last_msg_->biases[22].integer_indicator; + EXPECT_EQ(last_msg_->biases[22].widelane_integer_indicator, 33) + << "incorrect value for biases[22].widelane_integer_indicator, expected " + "33, is " + << last_msg_->biases[22].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[23].bias, -1839031379) + << "incorrect value for biases[23].bias, expected -1839031379, is " + << last_msg_->biases[23].bias; + EXPECT_EQ(last_msg_->biases[23].code, 42) + << "incorrect value for biases[23].code, expected 42, is " + << last_msg_->biases[23].code; + EXPECT_EQ(last_msg_->biases[23].discontinuity_counter, 173) + << "incorrect value for biases[23].discontinuity_counter, expected 173, " + "is " + << last_msg_->biases[23].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[23].integer_indicator, 62) + << "incorrect value for biases[23].integer_indicator, expected 62, is " + << last_msg_->biases[23].integer_indicator; + EXPECT_EQ(last_msg_->biases[23].widelane_integer_indicator, 147) + << "incorrect value for biases[23].widelane_integer_indicator, expected " + "147, is " + << last_msg_->biases[23].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[24].bias, 31817639) + << "incorrect value for biases[24].bias, expected 31817639, is " + << last_msg_->biases[24].bias; + EXPECT_EQ(last_msg_->biases[24].code, 231) + << "incorrect value for biases[24].code, expected 231, is " + << last_msg_->biases[24].code; + EXPECT_EQ(last_msg_->biases[24].discontinuity_counter, 82) + << "incorrect value for biases[24].discontinuity_counter, expected 82, " + "is " + << last_msg_->biases[24].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[24].integer_indicator, 167) + << "incorrect value for biases[24].integer_indicator, expected 167, is " + << last_msg_->biases[24].integer_indicator; + EXPECT_EQ(last_msg_->biases[24].widelane_integer_indicator, 138) + << "incorrect value for biases[24].widelane_integer_indicator, expected " + "138, is " + << last_msg_->biases[24].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[25].bias, -1619830156) + << "incorrect value for biases[25].bias, expected -1619830156, is " + << last_msg_->biases[25].bias; + EXPECT_EQ(last_msg_->biases[25].code, 2) + << "incorrect value for biases[25].code, expected 2, is " + << last_msg_->biases[25].code; + EXPECT_EQ(last_msg_->biases[25].discontinuity_counter, 207) + << "incorrect value for biases[25].discontinuity_counter, expected 207, " + "is " + << last_msg_->biases[25].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[25].integer_indicator, 127) + << "incorrect value for biases[25].integer_indicator, expected 127, is " + << last_msg_->biases[25].integer_indicator; + EXPECT_EQ(last_msg_->biases[25].widelane_integer_indicator, 237) + << "incorrect value for biases[25].widelane_integer_indicator, expected " + "237, is " + << last_msg_->biases[25].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[26].bias, -83375622) + << "incorrect value for biases[26].bias, expected -83375622, is " + << last_msg_->biases[26].bias; + EXPECT_EQ(last_msg_->biases[26].code, 3) + << "incorrect value for biases[26].code, expected 3, is " + << last_msg_->biases[26].code; + EXPECT_EQ(last_msg_->biases[26].discontinuity_counter, 145) + << "incorrect value for biases[26].discontinuity_counter, expected 145, " + "is " + << last_msg_->biases[26].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[26].integer_indicator, 42) + << "incorrect value for biases[26].integer_indicator, expected 42, is " + << last_msg_->biases[26].integer_indicator; + EXPECT_EQ(last_msg_->biases[26].widelane_integer_indicator, 66) + << "incorrect value for biases[26].widelane_integer_indicator, expected " + "66, is " + << last_msg_->biases[26].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[27].bias, 1077458389) + << "incorrect value for biases[27].bias, expected 1077458389, is " + << last_msg_->biases[27].bias; + EXPECT_EQ(last_msg_->biases[27].code, 2) + << "incorrect value for biases[27].code, expected 2, is " + << last_msg_->biases[27].code; + EXPECT_EQ(last_msg_->biases[27].discontinuity_counter, 26) + << "incorrect value for biases[27].discontinuity_counter, expected 26, " + "is " + << last_msg_->biases[27].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[27].integer_indicator, 75) + << "incorrect value for biases[27].integer_indicator, expected 75, is " + << last_msg_->biases[27].integer_indicator; + EXPECT_EQ(last_msg_->biases[27].widelane_integer_indicator, 230) + << "incorrect value for biases[27].widelane_integer_indicator, expected " + "230, is " + << last_msg_->biases[27].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[28].bias, -883355501) + << "incorrect value for biases[28].bias, expected -883355501, is " + << last_msg_->biases[28].bias; + EXPECT_EQ(last_msg_->biases[28].code, 97) + << "incorrect value for biases[28].code, expected 97, is " + << last_msg_->biases[28].code; + EXPECT_EQ(last_msg_->biases[28].discontinuity_counter, 6) + << "incorrect value for biases[28].discontinuity_counter, expected 6, is " + << last_msg_->biases[28].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[28].integer_indicator, 88) + << "incorrect value for biases[28].integer_indicator, expected 88, is " + << last_msg_->biases[28].integer_indicator; + EXPECT_EQ(last_msg_->biases[28].widelane_integer_indicator, 255) + << "incorrect value for biases[28].widelane_integer_indicator, expected " + "255, is " + << last_msg_->biases[28].widelane_integer_indicator; + EXPECT_EQ(last_msg_->biases[29].bias, -1448611273) + << "incorrect value for biases[29].bias, expected -1448611273, is " + << last_msg_->biases[29].bias; + EXPECT_EQ(last_msg_->biases[29].code, 27) + << "incorrect value for biases[29].code, expected 27, is " + << last_msg_->biases[29].code; + EXPECT_EQ(last_msg_->biases[29].discontinuity_counter, 230) + << "incorrect value for biases[29].discontinuity_counter, expected 230, " + "is " + << last_msg_->biases[29].discontinuity_counter; + EXPECT_EQ(last_msg_->biases[29].integer_indicator, 68) + << "incorrect value for biases[29].integer_indicator, expected 68, is " + << last_msg_->biases[29].integer_indicator; + EXPECT_EQ(last_msg_->biases[29].widelane_integer_indicator, 243) + << "incorrect value for biases[29].widelane_integer_indicator, expected " + "243, is " + << last_msg_->biases[29].widelane_integer_indicator; + EXPECT_EQ(last_msg_->dispersive_bias, 98) + << "incorrect value for dispersive_bias, expected 98, is " + << last_msg_->dispersive_bias; + EXPECT_EQ(last_msg_->iod_ssr, 230) + << "incorrect value for iod_ssr, expected 230, is " << last_msg_->iod_ssr; + EXPECT_EQ(last_msg_->mw_consistency, 209) + << "incorrect value for mw_consistency, expected 209, is " + << last_msg_->mw_consistency; + EXPECT_EQ(last_msg_->sid.code, 82) + << "incorrect value for sid.code, expected 82, is " + << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.sat, 169) + << "incorrect value for sid.sat, expected 169, is " << last_msg_->sid.sat; + EXPECT_EQ(last_msg_->time.tow, 210803409) + << "incorrect value for time.tow, expected 210803409, is " + << last_msg_->time.tow; + EXPECT_EQ(last_msg_->time.wn, 42197) + << "incorrect value for time.wn, expected 42197, is " + << last_msg_->time.wn; + EXPECT_EQ(last_msg_->update_interval, 177) + << "incorrect value for update_interval, expected 177, is " + << last_msg_->update_interval; + EXPECT_EQ(last_msg_->yaw, 5881) + << "incorrect value for yaw, expected 5881, is " << last_msg_->yaw; + EXPECT_EQ(last_msg_->yaw_rate, 17) + << "incorrect value for yaw_rate, expected 17, is " + << last_msg_->yaw_rate; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApc.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApc.cc index 564ee48c6..dbba2b547 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApc.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApc.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApc.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApc.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_satellite_apc_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_satellite_apc_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,199 +82,267 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_satellite_apc_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc0, Test) -{ +}; - uint8_t encoded_frame[] = {85,5,6,0,0,41,127,58,9,0,174,8,1,2,3,2,0,4,61,0,1,0,255,255,217,2,11,10,8,5,1,252,248,246,246,246,249,252,0,6,12,22,30,41,41,41,41,144,161, }; +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApc0, Test) { + uint8_t encoded_frame[] = { + 85, 5, 6, 0, 0, 41, 127, 58, 9, 0, 174, 8, 1, + 2, 3, 2, 0, 4, 61, 0, 1, 0, 255, 255, 217, 2, + 11, 10, 8, 5, 1, 252, 248, 246, 246, 246, 249, 252, 0, + 6, 12, 22, 30, 41, 41, 41, 41, 144, 161, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_satellite_apc_t* test_msg = ( msg_ssr_satellite_apc_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->apc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); - } - if (sizeof(test_msg->apc[0].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pco[0])); - } - test_msg->apc[0].pco[0] = 1; - if (sizeof(test_msg->apc[0].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pco[0])); - } - test_msg->apc[0].pco[1] = -1; - if (sizeof(test_msg->apc[0].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pco[0])); - } - test_msg->apc[0].pco[2] = 729; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[0] = 11; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[1] = 10; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[2] = 8; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[3] = 5; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[4] = 1; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[5] = -4; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[6] = -8; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[7] = -10; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[8] = -10; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[9] = -10; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[10] = -7; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[11] = -4; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[12] = 0; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[13] = 6; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[14] = 12; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[15] = 22; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[16] = 30; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[17] = 41; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[18] = 41; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[19] = 41; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[20] = 41; - test_msg->apc[0].sat_info = 4; - test_msg->apc[0].sid.code = 0; - test_msg->apc[0].sid.sat = 2; - test_msg->apc[0].svn = 61; - test_msg->iod_ssr = 3; - test_msg->sol_id = 2; - test_msg->time.tow = 604799; - test_msg->time.wn = 2222; - test_msg->update_interval = 1; - - EXPECT_EQ(send_message( 0x605, 0, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_satellite_apc_t *test_msg = + (msg_ssr_satellite_apc_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->apc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); + } + if (sizeof(test_msg->apc[0].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pco[0])); + } + test_msg->apc[0].pco[0] = 1; + if (sizeof(test_msg->apc[0].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pco[0])); + } + test_msg->apc[0].pco[1] = -1; + if (sizeof(test_msg->apc[0].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pco[0])); + } + test_msg->apc[0].pco[2] = 729; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[0] = 11; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[1] = 10; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[2] = 8; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[3] = 5; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[4] = 1; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[5] = -4; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[6] = -8; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[7] = -10; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[8] = -10; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[9] = -10; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[10] = -7; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[11] = -4; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[12] = 0; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[13] = 6; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[14] = 12; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[15] = 22; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[16] = 30; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[17] = 41; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[18] = 41; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[19] = 41; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[20] = 41; + test_msg->apc[0].sat_info = 4; + test_msg->apc[0].sid.code = 0; + test_msg->apc[0].sid.sat = 2; + test_msg->apc[0].svn = 61; + test_msg->iod_ssr = 3; + test_msg->sol_id = 2; + test_msg->time.tow = 604799; + test_msg->time.wn = 2222; + test_msg->update_interval = 1; + + EXPECT_EQ(send_message(0x605, 0, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->apc[0].pco[0], 1) << "incorrect value for apc[0].pco[0], expected 1, is " << last_msg_->apc[0].pco[0]; - EXPECT_EQ(last_msg_->apc[0].pco[1], -1) << "incorrect value for apc[0].pco[1], expected -1, is " << last_msg_->apc[0].pco[1]; - EXPECT_EQ(last_msg_->apc[0].pco[2], 729) << "incorrect value for apc[0].pco[2], expected 729, is " << last_msg_->apc[0].pco[2]; - EXPECT_EQ(last_msg_->apc[0].pcv[0], 11) << "incorrect value for apc[0].pcv[0], expected 11, is " << last_msg_->apc[0].pcv[0]; - EXPECT_EQ(last_msg_->apc[0].pcv[1], 10) << "incorrect value for apc[0].pcv[1], expected 10, is " << last_msg_->apc[0].pcv[1]; - EXPECT_EQ(last_msg_->apc[0].pcv[2], 8) << "incorrect value for apc[0].pcv[2], expected 8, is " << last_msg_->apc[0].pcv[2]; - EXPECT_EQ(last_msg_->apc[0].pcv[3], 5) << "incorrect value for apc[0].pcv[3], expected 5, is " << last_msg_->apc[0].pcv[3]; - EXPECT_EQ(last_msg_->apc[0].pcv[4], 1) << "incorrect value for apc[0].pcv[4], expected 1, is " << last_msg_->apc[0].pcv[4]; - EXPECT_EQ(last_msg_->apc[0].pcv[5], -4) << "incorrect value for apc[0].pcv[5], expected -4, is " << last_msg_->apc[0].pcv[5]; - EXPECT_EQ(last_msg_->apc[0].pcv[6], -8) << "incorrect value for apc[0].pcv[6], expected -8, is " << last_msg_->apc[0].pcv[6]; - EXPECT_EQ(last_msg_->apc[0].pcv[7], -10) << "incorrect value for apc[0].pcv[7], expected -10, is " << last_msg_->apc[0].pcv[7]; - EXPECT_EQ(last_msg_->apc[0].pcv[8], -10) << "incorrect value for apc[0].pcv[8], expected -10, is " << last_msg_->apc[0].pcv[8]; - EXPECT_EQ(last_msg_->apc[0].pcv[9], -10) << "incorrect value for apc[0].pcv[9], expected -10, is " << last_msg_->apc[0].pcv[9]; - EXPECT_EQ(last_msg_->apc[0].pcv[10], -7) << "incorrect value for apc[0].pcv[10], expected -7, is " << last_msg_->apc[0].pcv[10]; - EXPECT_EQ(last_msg_->apc[0].pcv[11], -4) << "incorrect value for apc[0].pcv[11], expected -4, is " << last_msg_->apc[0].pcv[11]; - EXPECT_EQ(last_msg_->apc[0].pcv[12], 0) << "incorrect value for apc[0].pcv[12], expected 0, is " << last_msg_->apc[0].pcv[12]; - EXPECT_EQ(last_msg_->apc[0].pcv[13], 6) << "incorrect value for apc[0].pcv[13], expected 6, is " << last_msg_->apc[0].pcv[13]; - EXPECT_EQ(last_msg_->apc[0].pcv[14], 12) << "incorrect value for apc[0].pcv[14], expected 12, is " << last_msg_->apc[0].pcv[14]; - EXPECT_EQ(last_msg_->apc[0].pcv[15], 22) << "incorrect value for apc[0].pcv[15], expected 22, is " << last_msg_->apc[0].pcv[15]; - EXPECT_EQ(last_msg_->apc[0].pcv[16], 30) << "incorrect value for apc[0].pcv[16], expected 30, is " << last_msg_->apc[0].pcv[16]; - EXPECT_EQ(last_msg_->apc[0].pcv[17], 41) << "incorrect value for apc[0].pcv[17], expected 41, is " << last_msg_->apc[0].pcv[17]; - EXPECT_EQ(last_msg_->apc[0].pcv[18], 41) << "incorrect value for apc[0].pcv[18], expected 41, is " << last_msg_->apc[0].pcv[18]; - EXPECT_EQ(last_msg_->apc[0].pcv[19], 41) << "incorrect value for apc[0].pcv[19], expected 41, is " << last_msg_->apc[0].pcv[19]; - EXPECT_EQ(last_msg_->apc[0].pcv[20], 41) << "incorrect value for apc[0].pcv[20], expected 41, is " << last_msg_->apc[0].pcv[20]; - EXPECT_EQ(last_msg_->apc[0].sat_info, 4) << "incorrect value for apc[0].sat_info, expected 4, is " << last_msg_->apc[0].sat_info; - EXPECT_EQ(last_msg_->apc[0].sid.code, 0) << "incorrect value for apc[0].sid.code, expected 0, is " << last_msg_->apc[0].sid.code; - EXPECT_EQ(last_msg_->apc[0].sid.sat, 2) << "incorrect value for apc[0].sid.sat, expected 2, is " << last_msg_->apc[0].sid.sat; - EXPECT_EQ(last_msg_->apc[0].svn, 61) << "incorrect value for apc[0].svn, expected 61, is " << last_msg_->apc[0].svn; - EXPECT_EQ(last_msg_->iod_ssr, 3) << "incorrect value for iod_ssr, expected 3, is " << last_msg_->iod_ssr; - EXPECT_EQ(last_msg_->sol_id, 2) << "incorrect value for sol_id, expected 2, is " << last_msg_->sol_id; - EXPECT_EQ(last_msg_->time.tow, 604799) << "incorrect value for time.tow, expected 604799, is " << last_msg_->time.tow; - EXPECT_EQ(last_msg_->time.wn, 2222) << "incorrect value for time.wn, expected 2222, is " << last_msg_->time.wn; - EXPECT_EQ(last_msg_->update_interval, 1) << "incorrect value for update_interval, expected 1, is " << last_msg_->update_interval; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->apc[0].pco[0], 1) + << "incorrect value for apc[0].pco[0], expected 1, is " + << last_msg_->apc[0].pco[0]; + EXPECT_EQ(last_msg_->apc[0].pco[1], -1) + << "incorrect value for apc[0].pco[1], expected -1, is " + << last_msg_->apc[0].pco[1]; + EXPECT_EQ(last_msg_->apc[0].pco[2], 729) + << "incorrect value for apc[0].pco[2], expected 729, is " + << last_msg_->apc[0].pco[2]; + EXPECT_EQ(last_msg_->apc[0].pcv[0], 11) + << "incorrect value for apc[0].pcv[0], expected 11, is " + << last_msg_->apc[0].pcv[0]; + EXPECT_EQ(last_msg_->apc[0].pcv[1], 10) + << "incorrect value for apc[0].pcv[1], expected 10, is " + << last_msg_->apc[0].pcv[1]; + EXPECT_EQ(last_msg_->apc[0].pcv[2], 8) + << "incorrect value for apc[0].pcv[2], expected 8, is " + << last_msg_->apc[0].pcv[2]; + EXPECT_EQ(last_msg_->apc[0].pcv[3], 5) + << "incorrect value for apc[0].pcv[3], expected 5, is " + << last_msg_->apc[0].pcv[3]; + EXPECT_EQ(last_msg_->apc[0].pcv[4], 1) + << "incorrect value for apc[0].pcv[4], expected 1, is " + << last_msg_->apc[0].pcv[4]; + EXPECT_EQ(last_msg_->apc[0].pcv[5], -4) + << "incorrect value for apc[0].pcv[5], expected -4, is " + << last_msg_->apc[0].pcv[5]; + EXPECT_EQ(last_msg_->apc[0].pcv[6], -8) + << "incorrect value for apc[0].pcv[6], expected -8, is " + << last_msg_->apc[0].pcv[6]; + EXPECT_EQ(last_msg_->apc[0].pcv[7], -10) + << "incorrect value for apc[0].pcv[7], expected -10, is " + << last_msg_->apc[0].pcv[7]; + EXPECT_EQ(last_msg_->apc[0].pcv[8], -10) + << "incorrect value for apc[0].pcv[8], expected -10, is " + << last_msg_->apc[0].pcv[8]; + EXPECT_EQ(last_msg_->apc[0].pcv[9], -10) + << "incorrect value for apc[0].pcv[9], expected -10, is " + << last_msg_->apc[0].pcv[9]; + EXPECT_EQ(last_msg_->apc[0].pcv[10], -7) + << "incorrect value for apc[0].pcv[10], expected -7, is " + << last_msg_->apc[0].pcv[10]; + EXPECT_EQ(last_msg_->apc[0].pcv[11], -4) + << "incorrect value for apc[0].pcv[11], expected -4, is " + << last_msg_->apc[0].pcv[11]; + EXPECT_EQ(last_msg_->apc[0].pcv[12], 0) + << "incorrect value for apc[0].pcv[12], expected 0, is " + << last_msg_->apc[0].pcv[12]; + EXPECT_EQ(last_msg_->apc[0].pcv[13], 6) + << "incorrect value for apc[0].pcv[13], expected 6, is " + << last_msg_->apc[0].pcv[13]; + EXPECT_EQ(last_msg_->apc[0].pcv[14], 12) + << "incorrect value for apc[0].pcv[14], expected 12, is " + << last_msg_->apc[0].pcv[14]; + EXPECT_EQ(last_msg_->apc[0].pcv[15], 22) + << "incorrect value for apc[0].pcv[15], expected 22, is " + << last_msg_->apc[0].pcv[15]; + EXPECT_EQ(last_msg_->apc[0].pcv[16], 30) + << "incorrect value for apc[0].pcv[16], expected 30, is " + << last_msg_->apc[0].pcv[16]; + EXPECT_EQ(last_msg_->apc[0].pcv[17], 41) + << "incorrect value for apc[0].pcv[17], expected 41, is " + << last_msg_->apc[0].pcv[17]; + EXPECT_EQ(last_msg_->apc[0].pcv[18], 41) + << "incorrect value for apc[0].pcv[18], expected 41, is " + << last_msg_->apc[0].pcv[18]; + EXPECT_EQ(last_msg_->apc[0].pcv[19], 41) + << "incorrect value for apc[0].pcv[19], expected 41, is " + << last_msg_->apc[0].pcv[19]; + EXPECT_EQ(last_msg_->apc[0].pcv[20], 41) + << "incorrect value for apc[0].pcv[20], expected 41, is " + << last_msg_->apc[0].pcv[20]; + EXPECT_EQ(last_msg_->apc[0].sat_info, 4) + << "incorrect value for apc[0].sat_info, expected 4, is " + << last_msg_->apc[0].sat_info; + EXPECT_EQ(last_msg_->apc[0].sid.code, 0) + << "incorrect value for apc[0].sid.code, expected 0, is " + << last_msg_->apc[0].sid.code; + EXPECT_EQ(last_msg_->apc[0].sid.sat, 2) + << "incorrect value for apc[0].sid.sat, expected 2, is " + << last_msg_->apc[0].sid.sat; + EXPECT_EQ(last_msg_->apc[0].svn, 61) + << "incorrect value for apc[0].svn, expected 61, is " + << last_msg_->apc[0].svn; + EXPECT_EQ(last_msg_->iod_ssr, 3) + << "incorrect value for iod_ssr, expected 3, is " << last_msg_->iod_ssr; + EXPECT_EQ(last_msg_->sol_id, 2) + << "incorrect value for sol_id, expected 2, is " << last_msg_->sol_id; + EXPECT_EQ(last_msg_->time.tow, 604799) + << "incorrect value for time.tow, expected 604799, is " + << last_msg_->time.tow; + EXPECT_EQ(last_msg_->time.wn, 2222) + << "incorrect value for time.wn, expected 2222, is " + << last_msg_->time.wn; + EXPECT_EQ(last_msg_->update_interval, 1) + << "incorrect value for update_interval, expected 1, is " + << last_msg_->update_interval; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.cc index 199cc9b9f..51e940fe1 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrSatelliteApcDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApcDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrSatelliteApcDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_satellite_apc_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_satellite_apc_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,1125 +82,1533 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_satellite_apc_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,4,6,56,19,224,203,169,240,78,4,213,171,254,214,212,4,8,33,31,80,21,4,105,225,39,139,124,149,48,15,214,197,141,32,33,135,150,148,123,49,135,97,39,90,20,169,239,47,153,175,35,145,145,123,194,2,102,74,149,95,171,238,249,7,237,170,125,106,158,83,188,181,194,27,84,226,142,123,77,217,248,67,215,129,114,138,25,240,10,56,76,61,161,216,22,181,174,33,13,252,236,230,196,128,215,239,234,179,220,44,212,57,44,173,49,36,137,248,235,97,112,157,139,26,115,192,31,85,127,228,81,252,219,249,110,147,8,161,215,212,180,25,83,144,247,12,27,199,173,74,23,4,239,103,223,220,139,91,127,214,86,48,203,228,99,45,83,159,11,250,135,170,42,217,199,233,42,170,78,206,41,43,81,247,99,198,144,2,132,2,224,220,148,58,85,138,210,200,158,7,158,67,46,200,132,118,241,13,37,62,107,253,190,136,66,9,84,155,86,180,41,196,40,119,101,252,223,144,153,50,13, }; +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrSatelliteApcDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 4, 6, 56, 19, 224, 203, 169, 240, 78, 4, 213, 171, 254, 214, + 212, 4, 8, 33, 31, 80, 21, 4, 105, 225, 39, 139, 124, 149, 48, + 15, 214, 197, 141, 32, 33, 135, 150, 148, 123, 49, 135, 97, 39, 90, + 20, 169, 239, 47, 153, 175, 35, 145, 145, 123, 194, 2, 102, 74, 149, + 95, 171, 238, 249, 7, 237, 170, 125, 106, 158, 83, 188, 181, 194, 27, + 84, 226, 142, 123, 77, 217, 248, 67, 215, 129, 114, 138, 25, 240, 10, + 56, 76, 61, 161, 216, 22, 181, 174, 33, 13, 252, 236, 230, 196, 128, + 215, 239, 234, 179, 220, 44, 212, 57, 44, 173, 49, 36, 137, 248, 235, + 97, 112, 157, 139, 26, 115, 192, 31, 85, 127, 228, 81, 252, 219, 249, + 110, 147, 8, 161, 215, 212, 180, 25, 83, 144, 247, 12, 27, 199, 173, + 74, 23, 4, 239, 103, 223, 220, 139, 91, 127, 214, 86, 48, 203, 228, + 99, 45, 83, 159, 11, 250, 135, 170, 42, 217, 199, 233, 42, 170, 78, + 206, 41, 43, 81, 247, 99, 198, 144, 2, 132, 2, 224, 220, 148, 58, + 85, 138, 210, 200, 158, 7, 158, 67, 46, 200, 132, 118, 241, 13, 37, + 62, 107, 253, 190, 136, 66, 9, 84, 155, 86, 180, 41, 196, 40, 119, + 101, 252, 223, 144, 153, 50, 13, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_satellite_apc_dep_t* test_msg = ( msg_ssr_satellite_apc_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->apc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); - } - if (sizeof(test_msg->apc[0].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pco[0])); - } - test_msg->apc[0].pco[0] = -21547; - if (sizeof(test_msg->apc[0].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pco[0])); - } - test_msg->apc[0].pco[1] = -10498; - if (sizeof(test_msg->apc[0].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pco[0])); - } - test_msg->apc[0].pco[2] = 1236; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[0] = 8; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[1] = 33; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[2] = 31; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[3] = 80; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[4] = 21; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[5] = 4; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[6] = 105; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[7] = -31; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[8] = 39; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[9] = -117; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[10] = 124; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[11] = -107; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[12] = 48; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[13] = 15; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[14] = -42; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[15] = -59; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[16] = -115; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[17] = 32; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[18] = 33; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[19] = -121; - if (sizeof(test_msg->apc[0].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); - } - test_msg->apc[0].pcv[20] = -106; - test_msg->apc[0].sat_info = 240; - test_msg->apc[0].sid.code = 169; - test_msg->apc[0].sid.sat = 203; - test_msg->apc[0].svn = 1102; - if (sizeof(test_msg->apc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); - } - if (sizeof(test_msg->apc[1].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pco[0])); - } - test_msg->apc[1].pco[0] = 23079; - if (sizeof(test_msg->apc[1].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pco[0])); - } - test_msg->apc[1].pco[1] = -22252; - if (sizeof(test_msg->apc[1].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pco[0])); - } - test_msg->apc[1].pco[2] = 12271; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[0] = -103; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[1] = -81; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[2] = 35; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[3] = -111; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[4] = -111; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[5] = 123; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[6] = -62; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[7] = 2; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[8] = 102; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[9] = 74; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[10] = -107; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[11] = 95; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[12] = -85; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[13] = -18; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[14] = -7; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[15] = 7; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[16] = -19; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[17] = -86; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[18] = 125; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[19] = 106; - if (sizeof(test_msg->apc[1].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); - } - test_msg->apc[1].pcv[20] = -98; - test_msg->apc[1].sat_info = 49; - test_msg->apc[1].sid.code = 123; - test_msg->apc[1].sid.sat = 148; - test_msg->apc[1].svn = 24967; - if (sizeof(test_msg->apc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); - } - if (sizeof(test_msg->apc[2].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pco[0])); - } - test_msg->apc[2].pco[0] = -7596; - if (sizeof(test_msg->apc[2].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pco[0])); - } - test_msg->apc[2].pco[1] = 31630; - if (sizeof(test_msg->apc[2].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pco[0])); - } - test_msg->apc[2].pco[2] = -9907; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[0] = -8; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[1] = 67; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[2] = -41; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[3] = -127; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[4] = 114; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[5] = -118; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[6] = 25; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[7] = -16; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[8] = 10; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[9] = 56; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[10] = 76; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[11] = 61; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[12] = -95; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[13] = -40; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[14] = 22; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[15] = -75; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[16] = -82; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[17] = 33; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[18] = 13; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[19] = -4; - if (sizeof(test_msg->apc[2].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); - } - test_msg->apc[2].pcv[20] = -20; - test_msg->apc[2].sat_info = 181; - test_msg->apc[2].sid.code = 188; - test_msg->apc[2].sid.sat = 83; - test_msg->apc[2].svn = 7106; - if (sizeof(test_msg->apc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); - } - if (sizeof(test_msg->apc[3].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pco[0])); - } - test_msg->apc[3].pco[0] = -19478; - if (sizeof(test_msg->apc[3].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pco[0])); - } - test_msg->apc[3].pco[1] = 11484; - if (sizeof(test_msg->apc[3].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pco[0])); - } - test_msg->apc[3].pco[2] = 14804; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[0] = 44; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[1] = -83; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[2] = 49; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[3] = 36; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[4] = -119; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[5] = -8; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[6] = -21; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[7] = 97; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[8] = 112; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[9] = -99; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[10] = -117; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[11] = 26; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[12] = 115; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[13] = -64; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[14] = 31; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[15] = 85; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[16] = 127; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[17] = -28; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[18] = 81; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[19] = -4; - if (sizeof(test_msg->apc[3].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); - } - test_msg->apc[3].pcv[20] = -37; - test_msg->apc[3].sat_info = 128; - test_msg->apc[3].sid.code = 196; - test_msg->apc[3].sid.sat = 230; - test_msg->apc[3].svn = 61399; - if (sizeof(test_msg->apc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); - } - if (sizeof(test_msg->apc[4].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pco[0])); - } - test_msg->apc[4].pco[0] = -11049; - if (sizeof(test_msg->apc[4].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pco[0])); - } - test_msg->apc[4].pco[1] = 6580; - if (sizeof(test_msg->apc[4].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pco[0])); - } - test_msg->apc[4].pco[2] = -28589; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[0] = -9; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[1] = 12; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[2] = 27; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[3] = -57; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[4] = -83; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[5] = 74; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[6] = 23; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[7] = 4; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[8] = -17; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[9] = 103; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[10] = -33; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[11] = -36; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[12] = -117; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[13] = 91; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[14] = 127; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[15] = -42; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[16] = 86; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[17] = 48; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[18] = -53; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[19] = -28; - if (sizeof(test_msg->apc[4].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); - } - test_msg->apc[4].pcv[20] = 99; - test_msg->apc[4].sat_info = 147; - test_msg->apc[4].sid.code = 110; - test_msg->apc[4].sid.sat = 249; - test_msg->apc[4].svn = 41224; - if (sizeof(test_msg->apc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); - } - if (sizeof(test_msg->apc[5].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pco[0])); - } - test_msg->apc[5].pco[0] = -21881; - if (sizeof(test_msg->apc[5].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pco[0])); - } - test_msg->apc[5].pco[1] = -9942; - if (sizeof(test_msg->apc[5].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pco[0])); - } - test_msg->apc[5].pco[2] = -5689; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[0] = 42; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[1] = -86; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[2] = 78; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[3] = -50; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[4] = 41; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[5] = 43; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[6] = 81; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[7] = -9; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[8] = 99; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[9] = -58; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[10] = -112; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[11] = 2; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[12] = -124; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[13] = 2; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[14] = -32; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[15] = -36; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[16] = -108; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[17] = 58; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[18] = 85; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[19] = -118; - if (sizeof(test_msg->apc[5].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); - } - test_msg->apc[5].pcv[20] = -46; - test_msg->apc[5].sat_info = 159; - test_msg->apc[5].sid.code = 83; - test_msg->apc[5].sid.sat = 45; - test_msg->apc[5].svn = 64011; - if (sizeof(test_msg->apc) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); - } - if (sizeof(test_msg->apc[6].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pco[0])); - } - test_msg->apc[6].pco[0] = -14290; - if (sizeof(test_msg->apc[6].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pco[0])); - } - test_msg->apc[6].pco[1] = 30340; - if (sizeof(test_msg->apc[6].pco) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pco[0])); - } - test_msg->apc[6].pco[2] = 3569; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[0] = 37; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[1] = 62; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[2] = 107; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[3] = -3; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[4] = -66; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[5] = -120; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[6] = 66; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[7] = 9; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[8] = 84; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[9] = -101; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[10] = 86; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[11] = -76; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[12] = 41; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[13] = -60; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[14] = 40; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[15] = 119; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[16] = 101; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[17] = -4; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[18] = -33; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[19] = -112; - if (sizeof(test_msg->apc[6].pcv) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); - } - test_msg->apc[6].pcv[20] = -103; - test_msg->apc[6].sat_info = 7; - test_msg->apc[6].sid.code = 158; - test_msg->apc[6].sid.sat = 200; - test_msg->apc[6].svn = 17310; - - EXPECT_EQ(send_message( 0x604, 4920, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_satellite_apc_dep_t *test_msg = + (msg_ssr_satellite_apc_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->apc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); + } + if (sizeof(test_msg->apc[0].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pco[0])); + } + test_msg->apc[0].pco[0] = -21547; + if (sizeof(test_msg->apc[0].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pco[0])); + } + test_msg->apc[0].pco[1] = -10498; + if (sizeof(test_msg->apc[0].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pco[0])); + } + test_msg->apc[0].pco[2] = 1236; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[0] = 8; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[1] = 33; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[2] = 31; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[3] = 80; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[4] = 21; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[5] = 4; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[6] = 105; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[7] = -31; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[8] = 39; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[9] = -117; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[10] = 124; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[11] = -107; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[12] = 48; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[13] = 15; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[14] = -42; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[15] = -59; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[16] = -115; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[17] = 32; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[18] = 33; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[19] = -121; + if (sizeof(test_msg->apc[0].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0].pcv[0])); + } + test_msg->apc[0].pcv[20] = -106; + test_msg->apc[0].sat_info = 240; + test_msg->apc[0].sid.code = 169; + test_msg->apc[0].sid.sat = 203; + test_msg->apc[0].svn = 1102; + if (sizeof(test_msg->apc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); + } + if (sizeof(test_msg->apc[1].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pco[0])); + } + test_msg->apc[1].pco[0] = 23079; + if (sizeof(test_msg->apc[1].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pco[0])); + } + test_msg->apc[1].pco[1] = -22252; + if (sizeof(test_msg->apc[1].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pco[0])); + } + test_msg->apc[1].pco[2] = 12271; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[0] = -103; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[1] = -81; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[2] = 35; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[3] = -111; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[4] = -111; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[5] = 123; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[6] = -62; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[7] = 2; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[8] = 102; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[9] = 74; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[10] = -107; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[11] = 95; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[12] = -85; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[13] = -18; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[14] = -7; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[15] = 7; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[16] = -19; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[17] = -86; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[18] = 125; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[19] = 106; + if (sizeof(test_msg->apc[1].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[1].pcv[0])); + } + test_msg->apc[1].pcv[20] = -98; + test_msg->apc[1].sat_info = 49; + test_msg->apc[1].sid.code = 123; + test_msg->apc[1].sid.sat = 148; + test_msg->apc[1].svn = 24967; + if (sizeof(test_msg->apc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); + } + if (sizeof(test_msg->apc[2].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pco[0])); + } + test_msg->apc[2].pco[0] = -7596; + if (sizeof(test_msg->apc[2].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pco[0])); + } + test_msg->apc[2].pco[1] = 31630; + if (sizeof(test_msg->apc[2].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pco[0])); + } + test_msg->apc[2].pco[2] = -9907; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[0] = -8; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[1] = 67; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[2] = -41; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[3] = -127; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[4] = 114; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[5] = -118; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[6] = 25; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[7] = -16; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[8] = 10; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[9] = 56; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[10] = 76; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[11] = 61; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[12] = -95; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[13] = -40; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[14] = 22; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[15] = -75; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[16] = -82; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[17] = 33; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[18] = 13; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[19] = -4; + if (sizeof(test_msg->apc[2].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[2].pcv[0])); + } + test_msg->apc[2].pcv[20] = -20; + test_msg->apc[2].sat_info = 181; + test_msg->apc[2].sid.code = 188; + test_msg->apc[2].sid.sat = 83; + test_msg->apc[2].svn = 7106; + if (sizeof(test_msg->apc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); + } + if (sizeof(test_msg->apc[3].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pco[0])); + } + test_msg->apc[3].pco[0] = -19478; + if (sizeof(test_msg->apc[3].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pco[0])); + } + test_msg->apc[3].pco[1] = 11484; + if (sizeof(test_msg->apc[3].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pco[0])); + } + test_msg->apc[3].pco[2] = 14804; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[0] = 44; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[1] = -83; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[2] = 49; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[3] = 36; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[4] = -119; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[5] = -8; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[6] = -21; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[7] = 97; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[8] = 112; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[9] = -99; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[10] = -117; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[11] = 26; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[12] = 115; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[13] = -64; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[14] = 31; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[15] = 85; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[16] = 127; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[17] = -28; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[18] = 81; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[19] = -4; + if (sizeof(test_msg->apc[3].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[3].pcv[0])); + } + test_msg->apc[3].pcv[20] = -37; + test_msg->apc[3].sat_info = 128; + test_msg->apc[3].sid.code = 196; + test_msg->apc[3].sid.sat = 230; + test_msg->apc[3].svn = 61399; + if (sizeof(test_msg->apc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); + } + if (sizeof(test_msg->apc[4].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pco[0])); + } + test_msg->apc[4].pco[0] = -11049; + if (sizeof(test_msg->apc[4].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pco[0])); + } + test_msg->apc[4].pco[1] = 6580; + if (sizeof(test_msg->apc[4].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pco[0])); + } + test_msg->apc[4].pco[2] = -28589; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[0] = -9; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[1] = 12; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[2] = 27; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[3] = -57; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[4] = -83; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[5] = 74; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[6] = 23; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[7] = 4; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[8] = -17; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[9] = 103; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[10] = -33; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[11] = -36; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[12] = -117; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[13] = 91; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[14] = 127; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[15] = -42; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[16] = 86; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[17] = 48; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[18] = -53; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[19] = -28; + if (sizeof(test_msg->apc[4].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[4].pcv[0])); + } + test_msg->apc[4].pcv[20] = 99; + test_msg->apc[4].sat_info = 147; + test_msg->apc[4].sid.code = 110; + test_msg->apc[4].sid.sat = 249; + test_msg->apc[4].svn = 41224; + if (sizeof(test_msg->apc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); + } + if (sizeof(test_msg->apc[5].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pco[0])); + } + test_msg->apc[5].pco[0] = -21881; + if (sizeof(test_msg->apc[5].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pco[0])); + } + test_msg->apc[5].pco[1] = -9942; + if (sizeof(test_msg->apc[5].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pco[0])); + } + test_msg->apc[5].pco[2] = -5689; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[0] = 42; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[1] = -86; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[2] = 78; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[3] = -50; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[4] = 41; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[5] = 43; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[6] = 81; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[7] = -9; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[8] = 99; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[9] = -58; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[10] = -112; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[11] = 2; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[12] = -124; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[13] = 2; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[14] = -32; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[15] = -36; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[16] = -108; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[17] = 58; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[18] = 85; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[19] = -118; + if (sizeof(test_msg->apc[5].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[5].pcv[0])); + } + test_msg->apc[5].pcv[20] = -46; + test_msg->apc[5].sat_info = 159; + test_msg->apc[5].sid.code = 83; + test_msg->apc[5].sid.sat = 45; + test_msg->apc[5].svn = 64011; + if (sizeof(test_msg->apc) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[0])); + } + if (sizeof(test_msg->apc[6].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pco[0])); + } + test_msg->apc[6].pco[0] = -14290; + if (sizeof(test_msg->apc[6].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pco[0])); + } + test_msg->apc[6].pco[1] = 30340; + if (sizeof(test_msg->apc[6].pco) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pco[0])); + } + test_msg->apc[6].pco[2] = 3569; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[0] = 37; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[1] = 62; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[2] = 107; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[3] = -3; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[4] = -66; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[5] = -120; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[6] = 66; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[7] = 9; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[8] = 84; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[9] = -101; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[10] = 86; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[11] = -76; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[12] = 41; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[13] = -60; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[14] = 40; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[15] = 119; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[16] = 101; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[17] = -4; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[18] = -33; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[19] = -112; + if (sizeof(test_msg->apc[6].pcv) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->apc[6].pcv[0])); + } + test_msg->apc[6].pcv[20] = -103; + test_msg->apc[6].sat_info = 7; + test_msg->apc[6].sid.code = 158; + test_msg->apc[6].sid.sat = 200; + test_msg->apc[6].svn = 17310; + + EXPECT_EQ(send_message(0x604, 4920, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 4920); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->apc[0].pco[0], -21547) << "incorrect value for apc[0].pco[0], expected -21547, is " << last_msg_->apc[0].pco[0]; - EXPECT_EQ(last_msg_->apc[0].pco[1], -10498) << "incorrect value for apc[0].pco[1], expected -10498, is " << last_msg_->apc[0].pco[1]; - EXPECT_EQ(last_msg_->apc[0].pco[2], 1236) << "incorrect value for apc[0].pco[2], expected 1236, is " << last_msg_->apc[0].pco[2]; - EXPECT_EQ(last_msg_->apc[0].pcv[0], 8) << "incorrect value for apc[0].pcv[0], expected 8, is " << last_msg_->apc[0].pcv[0]; - EXPECT_EQ(last_msg_->apc[0].pcv[1], 33) << "incorrect value for apc[0].pcv[1], expected 33, is " << last_msg_->apc[0].pcv[1]; - EXPECT_EQ(last_msg_->apc[0].pcv[2], 31) << "incorrect value for apc[0].pcv[2], expected 31, is " << last_msg_->apc[0].pcv[2]; - EXPECT_EQ(last_msg_->apc[0].pcv[3], 80) << "incorrect value for apc[0].pcv[3], expected 80, is " << last_msg_->apc[0].pcv[3]; - EXPECT_EQ(last_msg_->apc[0].pcv[4], 21) << "incorrect value for apc[0].pcv[4], expected 21, is " << last_msg_->apc[0].pcv[4]; - EXPECT_EQ(last_msg_->apc[0].pcv[5], 4) << "incorrect value for apc[0].pcv[5], expected 4, is " << last_msg_->apc[0].pcv[5]; - EXPECT_EQ(last_msg_->apc[0].pcv[6], 105) << "incorrect value for apc[0].pcv[6], expected 105, is " << last_msg_->apc[0].pcv[6]; - EXPECT_EQ(last_msg_->apc[0].pcv[7], -31) << "incorrect value for apc[0].pcv[7], expected -31, is " << last_msg_->apc[0].pcv[7]; - EXPECT_EQ(last_msg_->apc[0].pcv[8], 39) << "incorrect value for apc[0].pcv[8], expected 39, is " << last_msg_->apc[0].pcv[8]; - EXPECT_EQ(last_msg_->apc[0].pcv[9], -117) << "incorrect value for apc[0].pcv[9], expected -117, is " << last_msg_->apc[0].pcv[9]; - EXPECT_EQ(last_msg_->apc[0].pcv[10], 124) << "incorrect value for apc[0].pcv[10], expected 124, is " << last_msg_->apc[0].pcv[10]; - EXPECT_EQ(last_msg_->apc[0].pcv[11], -107) << "incorrect value for apc[0].pcv[11], expected -107, is " << last_msg_->apc[0].pcv[11]; - EXPECT_EQ(last_msg_->apc[0].pcv[12], 48) << "incorrect value for apc[0].pcv[12], expected 48, is " << last_msg_->apc[0].pcv[12]; - EXPECT_EQ(last_msg_->apc[0].pcv[13], 15) << "incorrect value for apc[0].pcv[13], expected 15, is " << last_msg_->apc[0].pcv[13]; - EXPECT_EQ(last_msg_->apc[0].pcv[14], -42) << "incorrect value for apc[0].pcv[14], expected -42, is " << last_msg_->apc[0].pcv[14]; - EXPECT_EQ(last_msg_->apc[0].pcv[15], -59) << "incorrect value for apc[0].pcv[15], expected -59, is " << last_msg_->apc[0].pcv[15]; - EXPECT_EQ(last_msg_->apc[0].pcv[16], -115) << "incorrect value for apc[0].pcv[16], expected -115, is " << last_msg_->apc[0].pcv[16]; - EXPECT_EQ(last_msg_->apc[0].pcv[17], 32) << "incorrect value for apc[0].pcv[17], expected 32, is " << last_msg_->apc[0].pcv[17]; - EXPECT_EQ(last_msg_->apc[0].pcv[18], 33) << "incorrect value for apc[0].pcv[18], expected 33, is " << last_msg_->apc[0].pcv[18]; - EXPECT_EQ(last_msg_->apc[0].pcv[19], -121) << "incorrect value for apc[0].pcv[19], expected -121, is " << last_msg_->apc[0].pcv[19]; - EXPECT_EQ(last_msg_->apc[0].pcv[20], -106) << "incorrect value for apc[0].pcv[20], expected -106, is " << last_msg_->apc[0].pcv[20]; - EXPECT_EQ(last_msg_->apc[0].sat_info, 240) << "incorrect value for apc[0].sat_info, expected 240, is " << last_msg_->apc[0].sat_info; - EXPECT_EQ(last_msg_->apc[0].sid.code, 169) << "incorrect value for apc[0].sid.code, expected 169, is " << last_msg_->apc[0].sid.code; - EXPECT_EQ(last_msg_->apc[0].sid.sat, 203) << "incorrect value for apc[0].sid.sat, expected 203, is " << last_msg_->apc[0].sid.sat; - EXPECT_EQ(last_msg_->apc[0].svn, 1102) << "incorrect value for apc[0].svn, expected 1102, is " << last_msg_->apc[0].svn; - EXPECT_EQ(last_msg_->apc[1].pco[0], 23079) << "incorrect value for apc[1].pco[0], expected 23079, is " << last_msg_->apc[1].pco[0]; - EXPECT_EQ(last_msg_->apc[1].pco[1], -22252) << "incorrect value for apc[1].pco[1], expected -22252, is " << last_msg_->apc[1].pco[1]; - EXPECT_EQ(last_msg_->apc[1].pco[2], 12271) << "incorrect value for apc[1].pco[2], expected 12271, is " << last_msg_->apc[1].pco[2]; - EXPECT_EQ(last_msg_->apc[1].pcv[0], -103) << "incorrect value for apc[1].pcv[0], expected -103, is " << last_msg_->apc[1].pcv[0]; - EXPECT_EQ(last_msg_->apc[1].pcv[1], -81) << "incorrect value for apc[1].pcv[1], expected -81, is " << last_msg_->apc[1].pcv[1]; - EXPECT_EQ(last_msg_->apc[1].pcv[2], 35) << "incorrect value for apc[1].pcv[2], expected 35, is " << last_msg_->apc[1].pcv[2]; - EXPECT_EQ(last_msg_->apc[1].pcv[3], -111) << "incorrect value for apc[1].pcv[3], expected -111, is " << last_msg_->apc[1].pcv[3]; - EXPECT_EQ(last_msg_->apc[1].pcv[4], -111) << "incorrect value for apc[1].pcv[4], expected -111, is " << last_msg_->apc[1].pcv[4]; - EXPECT_EQ(last_msg_->apc[1].pcv[5], 123) << "incorrect value for apc[1].pcv[5], expected 123, is " << last_msg_->apc[1].pcv[5]; - EXPECT_EQ(last_msg_->apc[1].pcv[6], -62) << "incorrect value for apc[1].pcv[6], expected -62, is " << last_msg_->apc[1].pcv[6]; - EXPECT_EQ(last_msg_->apc[1].pcv[7], 2) << "incorrect value for apc[1].pcv[7], expected 2, is " << last_msg_->apc[1].pcv[7]; - EXPECT_EQ(last_msg_->apc[1].pcv[8], 102) << "incorrect value for apc[1].pcv[8], expected 102, is " << last_msg_->apc[1].pcv[8]; - EXPECT_EQ(last_msg_->apc[1].pcv[9], 74) << "incorrect value for apc[1].pcv[9], expected 74, is " << last_msg_->apc[1].pcv[9]; - EXPECT_EQ(last_msg_->apc[1].pcv[10], -107) << "incorrect value for apc[1].pcv[10], expected -107, is " << last_msg_->apc[1].pcv[10]; - EXPECT_EQ(last_msg_->apc[1].pcv[11], 95) << "incorrect value for apc[1].pcv[11], expected 95, is " << last_msg_->apc[1].pcv[11]; - EXPECT_EQ(last_msg_->apc[1].pcv[12], -85) << "incorrect value for apc[1].pcv[12], expected -85, is " << last_msg_->apc[1].pcv[12]; - EXPECT_EQ(last_msg_->apc[1].pcv[13], -18) << "incorrect value for apc[1].pcv[13], expected -18, is " << last_msg_->apc[1].pcv[13]; - EXPECT_EQ(last_msg_->apc[1].pcv[14], -7) << "incorrect value for apc[1].pcv[14], expected -7, is " << last_msg_->apc[1].pcv[14]; - EXPECT_EQ(last_msg_->apc[1].pcv[15], 7) << "incorrect value for apc[1].pcv[15], expected 7, is " << last_msg_->apc[1].pcv[15]; - EXPECT_EQ(last_msg_->apc[1].pcv[16], -19) << "incorrect value for apc[1].pcv[16], expected -19, is " << last_msg_->apc[1].pcv[16]; - EXPECT_EQ(last_msg_->apc[1].pcv[17], -86) << "incorrect value for apc[1].pcv[17], expected -86, is " << last_msg_->apc[1].pcv[17]; - EXPECT_EQ(last_msg_->apc[1].pcv[18], 125) << "incorrect value for apc[1].pcv[18], expected 125, is " << last_msg_->apc[1].pcv[18]; - EXPECT_EQ(last_msg_->apc[1].pcv[19], 106) << "incorrect value for apc[1].pcv[19], expected 106, is " << last_msg_->apc[1].pcv[19]; - EXPECT_EQ(last_msg_->apc[1].pcv[20], -98) << "incorrect value for apc[1].pcv[20], expected -98, is " << last_msg_->apc[1].pcv[20]; - EXPECT_EQ(last_msg_->apc[1].sat_info, 49) << "incorrect value for apc[1].sat_info, expected 49, is " << last_msg_->apc[1].sat_info; - EXPECT_EQ(last_msg_->apc[1].sid.code, 123) << "incorrect value for apc[1].sid.code, expected 123, is " << last_msg_->apc[1].sid.code; - EXPECT_EQ(last_msg_->apc[1].sid.sat, 148) << "incorrect value for apc[1].sid.sat, expected 148, is " << last_msg_->apc[1].sid.sat; - EXPECT_EQ(last_msg_->apc[1].svn, 24967) << "incorrect value for apc[1].svn, expected 24967, is " << last_msg_->apc[1].svn; - EXPECT_EQ(last_msg_->apc[2].pco[0], -7596) << "incorrect value for apc[2].pco[0], expected -7596, is " << last_msg_->apc[2].pco[0]; - EXPECT_EQ(last_msg_->apc[2].pco[1], 31630) << "incorrect value for apc[2].pco[1], expected 31630, is " << last_msg_->apc[2].pco[1]; - EXPECT_EQ(last_msg_->apc[2].pco[2], -9907) << "incorrect value for apc[2].pco[2], expected -9907, is " << last_msg_->apc[2].pco[2]; - EXPECT_EQ(last_msg_->apc[2].pcv[0], -8) << "incorrect value for apc[2].pcv[0], expected -8, is " << last_msg_->apc[2].pcv[0]; - EXPECT_EQ(last_msg_->apc[2].pcv[1], 67) << "incorrect value for apc[2].pcv[1], expected 67, is " << last_msg_->apc[2].pcv[1]; - EXPECT_EQ(last_msg_->apc[2].pcv[2], -41) << "incorrect value for apc[2].pcv[2], expected -41, is " << last_msg_->apc[2].pcv[2]; - EXPECT_EQ(last_msg_->apc[2].pcv[3], -127) << "incorrect value for apc[2].pcv[3], expected -127, is " << last_msg_->apc[2].pcv[3]; - EXPECT_EQ(last_msg_->apc[2].pcv[4], 114) << "incorrect value for apc[2].pcv[4], expected 114, is " << last_msg_->apc[2].pcv[4]; - EXPECT_EQ(last_msg_->apc[2].pcv[5], -118) << "incorrect value for apc[2].pcv[5], expected -118, is " << last_msg_->apc[2].pcv[5]; - EXPECT_EQ(last_msg_->apc[2].pcv[6], 25) << "incorrect value for apc[2].pcv[6], expected 25, is " << last_msg_->apc[2].pcv[6]; - EXPECT_EQ(last_msg_->apc[2].pcv[7], -16) << "incorrect value for apc[2].pcv[7], expected -16, is " << last_msg_->apc[2].pcv[7]; - EXPECT_EQ(last_msg_->apc[2].pcv[8], 10) << "incorrect value for apc[2].pcv[8], expected 10, is " << last_msg_->apc[2].pcv[8]; - EXPECT_EQ(last_msg_->apc[2].pcv[9], 56) << "incorrect value for apc[2].pcv[9], expected 56, is " << last_msg_->apc[2].pcv[9]; - EXPECT_EQ(last_msg_->apc[2].pcv[10], 76) << "incorrect value for apc[2].pcv[10], expected 76, is " << last_msg_->apc[2].pcv[10]; - EXPECT_EQ(last_msg_->apc[2].pcv[11], 61) << "incorrect value for apc[2].pcv[11], expected 61, is " << last_msg_->apc[2].pcv[11]; - EXPECT_EQ(last_msg_->apc[2].pcv[12], -95) << "incorrect value for apc[2].pcv[12], expected -95, is " << last_msg_->apc[2].pcv[12]; - EXPECT_EQ(last_msg_->apc[2].pcv[13], -40) << "incorrect value for apc[2].pcv[13], expected -40, is " << last_msg_->apc[2].pcv[13]; - EXPECT_EQ(last_msg_->apc[2].pcv[14], 22) << "incorrect value for apc[2].pcv[14], expected 22, is " << last_msg_->apc[2].pcv[14]; - EXPECT_EQ(last_msg_->apc[2].pcv[15], -75) << "incorrect value for apc[2].pcv[15], expected -75, is " << last_msg_->apc[2].pcv[15]; - EXPECT_EQ(last_msg_->apc[2].pcv[16], -82) << "incorrect value for apc[2].pcv[16], expected -82, is " << last_msg_->apc[2].pcv[16]; - EXPECT_EQ(last_msg_->apc[2].pcv[17], 33) << "incorrect value for apc[2].pcv[17], expected 33, is " << last_msg_->apc[2].pcv[17]; - EXPECT_EQ(last_msg_->apc[2].pcv[18], 13) << "incorrect value for apc[2].pcv[18], expected 13, is " << last_msg_->apc[2].pcv[18]; - EXPECT_EQ(last_msg_->apc[2].pcv[19], -4) << "incorrect value for apc[2].pcv[19], expected -4, is " << last_msg_->apc[2].pcv[19]; - EXPECT_EQ(last_msg_->apc[2].pcv[20], -20) << "incorrect value for apc[2].pcv[20], expected -20, is " << last_msg_->apc[2].pcv[20]; - EXPECT_EQ(last_msg_->apc[2].sat_info, 181) << "incorrect value for apc[2].sat_info, expected 181, is " << last_msg_->apc[2].sat_info; - EXPECT_EQ(last_msg_->apc[2].sid.code, 188) << "incorrect value for apc[2].sid.code, expected 188, is " << last_msg_->apc[2].sid.code; - EXPECT_EQ(last_msg_->apc[2].sid.sat, 83) << "incorrect value for apc[2].sid.sat, expected 83, is " << last_msg_->apc[2].sid.sat; - EXPECT_EQ(last_msg_->apc[2].svn, 7106) << "incorrect value for apc[2].svn, expected 7106, is " << last_msg_->apc[2].svn; - EXPECT_EQ(last_msg_->apc[3].pco[0], -19478) << "incorrect value for apc[3].pco[0], expected -19478, is " << last_msg_->apc[3].pco[0]; - EXPECT_EQ(last_msg_->apc[3].pco[1], 11484) << "incorrect value for apc[3].pco[1], expected 11484, is " << last_msg_->apc[3].pco[1]; - EXPECT_EQ(last_msg_->apc[3].pco[2], 14804) << "incorrect value for apc[3].pco[2], expected 14804, is " << last_msg_->apc[3].pco[2]; - EXPECT_EQ(last_msg_->apc[3].pcv[0], 44) << "incorrect value for apc[3].pcv[0], expected 44, is " << last_msg_->apc[3].pcv[0]; - EXPECT_EQ(last_msg_->apc[3].pcv[1], -83) << "incorrect value for apc[3].pcv[1], expected -83, is " << last_msg_->apc[3].pcv[1]; - EXPECT_EQ(last_msg_->apc[3].pcv[2], 49) << "incorrect value for apc[3].pcv[2], expected 49, is " << last_msg_->apc[3].pcv[2]; - EXPECT_EQ(last_msg_->apc[3].pcv[3], 36) << "incorrect value for apc[3].pcv[3], expected 36, is " << last_msg_->apc[3].pcv[3]; - EXPECT_EQ(last_msg_->apc[3].pcv[4], -119) << "incorrect value for apc[3].pcv[4], expected -119, is " << last_msg_->apc[3].pcv[4]; - EXPECT_EQ(last_msg_->apc[3].pcv[5], -8) << "incorrect value for apc[3].pcv[5], expected -8, is " << last_msg_->apc[3].pcv[5]; - EXPECT_EQ(last_msg_->apc[3].pcv[6], -21) << "incorrect value for apc[3].pcv[6], expected -21, is " << last_msg_->apc[3].pcv[6]; - EXPECT_EQ(last_msg_->apc[3].pcv[7], 97) << "incorrect value for apc[3].pcv[7], expected 97, is " << last_msg_->apc[3].pcv[7]; - EXPECT_EQ(last_msg_->apc[3].pcv[8], 112) << "incorrect value for apc[3].pcv[8], expected 112, is " << last_msg_->apc[3].pcv[8]; - EXPECT_EQ(last_msg_->apc[3].pcv[9], -99) << "incorrect value for apc[3].pcv[9], expected -99, is " << last_msg_->apc[3].pcv[9]; - EXPECT_EQ(last_msg_->apc[3].pcv[10], -117) << "incorrect value for apc[3].pcv[10], expected -117, is " << last_msg_->apc[3].pcv[10]; - EXPECT_EQ(last_msg_->apc[3].pcv[11], 26) << "incorrect value for apc[3].pcv[11], expected 26, is " << last_msg_->apc[3].pcv[11]; - EXPECT_EQ(last_msg_->apc[3].pcv[12], 115) << "incorrect value for apc[3].pcv[12], expected 115, is " << last_msg_->apc[3].pcv[12]; - EXPECT_EQ(last_msg_->apc[3].pcv[13], -64) << "incorrect value for apc[3].pcv[13], expected -64, is " << last_msg_->apc[3].pcv[13]; - EXPECT_EQ(last_msg_->apc[3].pcv[14], 31) << "incorrect value for apc[3].pcv[14], expected 31, is " << last_msg_->apc[3].pcv[14]; - EXPECT_EQ(last_msg_->apc[3].pcv[15], 85) << "incorrect value for apc[3].pcv[15], expected 85, is " << last_msg_->apc[3].pcv[15]; - EXPECT_EQ(last_msg_->apc[3].pcv[16], 127) << "incorrect value for apc[3].pcv[16], expected 127, is " << last_msg_->apc[3].pcv[16]; - EXPECT_EQ(last_msg_->apc[3].pcv[17], -28) << "incorrect value for apc[3].pcv[17], expected -28, is " << last_msg_->apc[3].pcv[17]; - EXPECT_EQ(last_msg_->apc[3].pcv[18], 81) << "incorrect value for apc[3].pcv[18], expected 81, is " << last_msg_->apc[3].pcv[18]; - EXPECT_EQ(last_msg_->apc[3].pcv[19], -4) << "incorrect value for apc[3].pcv[19], expected -4, is " << last_msg_->apc[3].pcv[19]; - EXPECT_EQ(last_msg_->apc[3].pcv[20], -37) << "incorrect value for apc[3].pcv[20], expected -37, is " << last_msg_->apc[3].pcv[20]; - EXPECT_EQ(last_msg_->apc[3].sat_info, 128) << "incorrect value for apc[3].sat_info, expected 128, is " << last_msg_->apc[3].sat_info; - EXPECT_EQ(last_msg_->apc[3].sid.code, 196) << "incorrect value for apc[3].sid.code, expected 196, is " << last_msg_->apc[3].sid.code; - EXPECT_EQ(last_msg_->apc[3].sid.sat, 230) << "incorrect value for apc[3].sid.sat, expected 230, is " << last_msg_->apc[3].sid.sat; - EXPECT_EQ(last_msg_->apc[3].svn, 61399) << "incorrect value for apc[3].svn, expected 61399, is " << last_msg_->apc[3].svn; - EXPECT_EQ(last_msg_->apc[4].pco[0], -11049) << "incorrect value for apc[4].pco[0], expected -11049, is " << last_msg_->apc[4].pco[0]; - EXPECT_EQ(last_msg_->apc[4].pco[1], 6580) << "incorrect value for apc[4].pco[1], expected 6580, is " << last_msg_->apc[4].pco[1]; - EXPECT_EQ(last_msg_->apc[4].pco[2], -28589) << "incorrect value for apc[4].pco[2], expected -28589, is " << last_msg_->apc[4].pco[2]; - EXPECT_EQ(last_msg_->apc[4].pcv[0], -9) << "incorrect value for apc[4].pcv[0], expected -9, is " << last_msg_->apc[4].pcv[0]; - EXPECT_EQ(last_msg_->apc[4].pcv[1], 12) << "incorrect value for apc[4].pcv[1], expected 12, is " << last_msg_->apc[4].pcv[1]; - EXPECT_EQ(last_msg_->apc[4].pcv[2], 27) << "incorrect value for apc[4].pcv[2], expected 27, is " << last_msg_->apc[4].pcv[2]; - EXPECT_EQ(last_msg_->apc[4].pcv[3], -57) << "incorrect value for apc[4].pcv[3], expected -57, is " << last_msg_->apc[4].pcv[3]; - EXPECT_EQ(last_msg_->apc[4].pcv[4], -83) << "incorrect value for apc[4].pcv[4], expected -83, is " << last_msg_->apc[4].pcv[4]; - EXPECT_EQ(last_msg_->apc[4].pcv[5], 74) << "incorrect value for apc[4].pcv[5], expected 74, is " << last_msg_->apc[4].pcv[5]; - EXPECT_EQ(last_msg_->apc[4].pcv[6], 23) << "incorrect value for apc[4].pcv[6], expected 23, is " << last_msg_->apc[4].pcv[6]; - EXPECT_EQ(last_msg_->apc[4].pcv[7], 4) << "incorrect value for apc[4].pcv[7], expected 4, is " << last_msg_->apc[4].pcv[7]; - EXPECT_EQ(last_msg_->apc[4].pcv[8], -17) << "incorrect value for apc[4].pcv[8], expected -17, is " << last_msg_->apc[4].pcv[8]; - EXPECT_EQ(last_msg_->apc[4].pcv[9], 103) << "incorrect value for apc[4].pcv[9], expected 103, is " << last_msg_->apc[4].pcv[9]; - EXPECT_EQ(last_msg_->apc[4].pcv[10], -33) << "incorrect value for apc[4].pcv[10], expected -33, is " << last_msg_->apc[4].pcv[10]; - EXPECT_EQ(last_msg_->apc[4].pcv[11], -36) << "incorrect value for apc[4].pcv[11], expected -36, is " << last_msg_->apc[4].pcv[11]; - EXPECT_EQ(last_msg_->apc[4].pcv[12], -117) << "incorrect value for apc[4].pcv[12], expected -117, is " << last_msg_->apc[4].pcv[12]; - EXPECT_EQ(last_msg_->apc[4].pcv[13], 91) << "incorrect value for apc[4].pcv[13], expected 91, is " << last_msg_->apc[4].pcv[13]; - EXPECT_EQ(last_msg_->apc[4].pcv[14], 127) << "incorrect value for apc[4].pcv[14], expected 127, is " << last_msg_->apc[4].pcv[14]; - EXPECT_EQ(last_msg_->apc[4].pcv[15], -42) << "incorrect value for apc[4].pcv[15], expected -42, is " << last_msg_->apc[4].pcv[15]; - EXPECT_EQ(last_msg_->apc[4].pcv[16], 86) << "incorrect value for apc[4].pcv[16], expected 86, is " << last_msg_->apc[4].pcv[16]; - EXPECT_EQ(last_msg_->apc[4].pcv[17], 48) << "incorrect value for apc[4].pcv[17], expected 48, is " << last_msg_->apc[4].pcv[17]; - EXPECT_EQ(last_msg_->apc[4].pcv[18], -53) << "incorrect value for apc[4].pcv[18], expected -53, is " << last_msg_->apc[4].pcv[18]; - EXPECT_EQ(last_msg_->apc[4].pcv[19], -28) << "incorrect value for apc[4].pcv[19], expected -28, is " << last_msg_->apc[4].pcv[19]; - EXPECT_EQ(last_msg_->apc[4].pcv[20], 99) << "incorrect value for apc[4].pcv[20], expected 99, is " << last_msg_->apc[4].pcv[20]; - EXPECT_EQ(last_msg_->apc[4].sat_info, 147) << "incorrect value for apc[4].sat_info, expected 147, is " << last_msg_->apc[4].sat_info; - EXPECT_EQ(last_msg_->apc[4].sid.code, 110) << "incorrect value for apc[4].sid.code, expected 110, is " << last_msg_->apc[4].sid.code; - EXPECT_EQ(last_msg_->apc[4].sid.sat, 249) << "incorrect value for apc[4].sid.sat, expected 249, is " << last_msg_->apc[4].sid.sat; - EXPECT_EQ(last_msg_->apc[4].svn, 41224) << "incorrect value for apc[4].svn, expected 41224, is " << last_msg_->apc[4].svn; - EXPECT_EQ(last_msg_->apc[5].pco[0], -21881) << "incorrect value for apc[5].pco[0], expected -21881, is " << last_msg_->apc[5].pco[0]; - EXPECT_EQ(last_msg_->apc[5].pco[1], -9942) << "incorrect value for apc[5].pco[1], expected -9942, is " << last_msg_->apc[5].pco[1]; - EXPECT_EQ(last_msg_->apc[5].pco[2], -5689) << "incorrect value for apc[5].pco[2], expected -5689, is " << last_msg_->apc[5].pco[2]; - EXPECT_EQ(last_msg_->apc[5].pcv[0], 42) << "incorrect value for apc[5].pcv[0], expected 42, is " << last_msg_->apc[5].pcv[0]; - EXPECT_EQ(last_msg_->apc[5].pcv[1], -86) << "incorrect value for apc[5].pcv[1], expected -86, is " << last_msg_->apc[5].pcv[1]; - EXPECT_EQ(last_msg_->apc[5].pcv[2], 78) << "incorrect value for apc[5].pcv[2], expected 78, is " << last_msg_->apc[5].pcv[2]; - EXPECT_EQ(last_msg_->apc[5].pcv[3], -50) << "incorrect value for apc[5].pcv[3], expected -50, is " << last_msg_->apc[5].pcv[3]; - EXPECT_EQ(last_msg_->apc[5].pcv[4], 41) << "incorrect value for apc[5].pcv[4], expected 41, is " << last_msg_->apc[5].pcv[4]; - EXPECT_EQ(last_msg_->apc[5].pcv[5], 43) << "incorrect value for apc[5].pcv[5], expected 43, is " << last_msg_->apc[5].pcv[5]; - EXPECT_EQ(last_msg_->apc[5].pcv[6], 81) << "incorrect value for apc[5].pcv[6], expected 81, is " << last_msg_->apc[5].pcv[6]; - EXPECT_EQ(last_msg_->apc[5].pcv[7], -9) << "incorrect value for apc[5].pcv[7], expected -9, is " << last_msg_->apc[5].pcv[7]; - EXPECT_EQ(last_msg_->apc[5].pcv[8], 99) << "incorrect value for apc[5].pcv[8], expected 99, is " << last_msg_->apc[5].pcv[8]; - EXPECT_EQ(last_msg_->apc[5].pcv[9], -58) << "incorrect value for apc[5].pcv[9], expected -58, is " << last_msg_->apc[5].pcv[9]; - EXPECT_EQ(last_msg_->apc[5].pcv[10], -112) << "incorrect value for apc[5].pcv[10], expected -112, is " << last_msg_->apc[5].pcv[10]; - EXPECT_EQ(last_msg_->apc[5].pcv[11], 2) << "incorrect value for apc[5].pcv[11], expected 2, is " << last_msg_->apc[5].pcv[11]; - EXPECT_EQ(last_msg_->apc[5].pcv[12], -124) << "incorrect value for apc[5].pcv[12], expected -124, is " << last_msg_->apc[5].pcv[12]; - EXPECT_EQ(last_msg_->apc[5].pcv[13], 2) << "incorrect value for apc[5].pcv[13], expected 2, is " << last_msg_->apc[5].pcv[13]; - EXPECT_EQ(last_msg_->apc[5].pcv[14], -32) << "incorrect value for apc[5].pcv[14], expected -32, is " << last_msg_->apc[5].pcv[14]; - EXPECT_EQ(last_msg_->apc[5].pcv[15], -36) << "incorrect value for apc[5].pcv[15], expected -36, is " << last_msg_->apc[5].pcv[15]; - EXPECT_EQ(last_msg_->apc[5].pcv[16], -108) << "incorrect value for apc[5].pcv[16], expected -108, is " << last_msg_->apc[5].pcv[16]; - EXPECT_EQ(last_msg_->apc[5].pcv[17], 58) << "incorrect value for apc[5].pcv[17], expected 58, is " << last_msg_->apc[5].pcv[17]; - EXPECT_EQ(last_msg_->apc[5].pcv[18], 85) << "incorrect value for apc[5].pcv[18], expected 85, is " << last_msg_->apc[5].pcv[18]; - EXPECT_EQ(last_msg_->apc[5].pcv[19], -118) << "incorrect value for apc[5].pcv[19], expected -118, is " << last_msg_->apc[5].pcv[19]; - EXPECT_EQ(last_msg_->apc[5].pcv[20], -46) << "incorrect value for apc[5].pcv[20], expected -46, is " << last_msg_->apc[5].pcv[20]; - EXPECT_EQ(last_msg_->apc[5].sat_info, 159) << "incorrect value for apc[5].sat_info, expected 159, is " << last_msg_->apc[5].sat_info; - EXPECT_EQ(last_msg_->apc[5].sid.code, 83) << "incorrect value for apc[5].sid.code, expected 83, is " << last_msg_->apc[5].sid.code; - EXPECT_EQ(last_msg_->apc[5].sid.sat, 45) << "incorrect value for apc[5].sid.sat, expected 45, is " << last_msg_->apc[5].sid.sat; - EXPECT_EQ(last_msg_->apc[5].svn, 64011) << "incorrect value for apc[5].svn, expected 64011, is " << last_msg_->apc[5].svn; - EXPECT_EQ(last_msg_->apc[6].pco[0], -14290) << "incorrect value for apc[6].pco[0], expected -14290, is " << last_msg_->apc[6].pco[0]; - EXPECT_EQ(last_msg_->apc[6].pco[1], 30340) << "incorrect value for apc[6].pco[1], expected 30340, is " << last_msg_->apc[6].pco[1]; - EXPECT_EQ(last_msg_->apc[6].pco[2], 3569) << "incorrect value for apc[6].pco[2], expected 3569, is " << last_msg_->apc[6].pco[2]; - EXPECT_EQ(last_msg_->apc[6].pcv[0], 37) << "incorrect value for apc[6].pcv[0], expected 37, is " << last_msg_->apc[6].pcv[0]; - EXPECT_EQ(last_msg_->apc[6].pcv[1], 62) << "incorrect value for apc[6].pcv[1], expected 62, is " << last_msg_->apc[6].pcv[1]; - EXPECT_EQ(last_msg_->apc[6].pcv[2], 107) << "incorrect value for apc[6].pcv[2], expected 107, is " << last_msg_->apc[6].pcv[2]; - EXPECT_EQ(last_msg_->apc[6].pcv[3], -3) << "incorrect value for apc[6].pcv[3], expected -3, is " << last_msg_->apc[6].pcv[3]; - EXPECT_EQ(last_msg_->apc[6].pcv[4], -66) << "incorrect value for apc[6].pcv[4], expected -66, is " << last_msg_->apc[6].pcv[4]; - EXPECT_EQ(last_msg_->apc[6].pcv[5], -120) << "incorrect value for apc[6].pcv[5], expected -120, is " << last_msg_->apc[6].pcv[5]; - EXPECT_EQ(last_msg_->apc[6].pcv[6], 66) << "incorrect value for apc[6].pcv[6], expected 66, is " << last_msg_->apc[6].pcv[6]; - EXPECT_EQ(last_msg_->apc[6].pcv[7], 9) << "incorrect value for apc[6].pcv[7], expected 9, is " << last_msg_->apc[6].pcv[7]; - EXPECT_EQ(last_msg_->apc[6].pcv[8], 84) << "incorrect value for apc[6].pcv[8], expected 84, is " << last_msg_->apc[6].pcv[8]; - EXPECT_EQ(last_msg_->apc[6].pcv[9], -101) << "incorrect value for apc[6].pcv[9], expected -101, is " << last_msg_->apc[6].pcv[9]; - EXPECT_EQ(last_msg_->apc[6].pcv[10], 86) << "incorrect value for apc[6].pcv[10], expected 86, is " << last_msg_->apc[6].pcv[10]; - EXPECT_EQ(last_msg_->apc[6].pcv[11], -76) << "incorrect value for apc[6].pcv[11], expected -76, is " << last_msg_->apc[6].pcv[11]; - EXPECT_EQ(last_msg_->apc[6].pcv[12], 41) << "incorrect value for apc[6].pcv[12], expected 41, is " << last_msg_->apc[6].pcv[12]; - EXPECT_EQ(last_msg_->apc[6].pcv[13], -60) << "incorrect value for apc[6].pcv[13], expected -60, is " << last_msg_->apc[6].pcv[13]; - EXPECT_EQ(last_msg_->apc[6].pcv[14], 40) << "incorrect value for apc[6].pcv[14], expected 40, is " << last_msg_->apc[6].pcv[14]; - EXPECT_EQ(last_msg_->apc[6].pcv[15], 119) << "incorrect value for apc[6].pcv[15], expected 119, is " << last_msg_->apc[6].pcv[15]; - EXPECT_EQ(last_msg_->apc[6].pcv[16], 101) << "incorrect value for apc[6].pcv[16], expected 101, is " << last_msg_->apc[6].pcv[16]; - EXPECT_EQ(last_msg_->apc[6].pcv[17], -4) << "incorrect value for apc[6].pcv[17], expected -4, is " << last_msg_->apc[6].pcv[17]; - EXPECT_EQ(last_msg_->apc[6].pcv[18], -33) << "incorrect value for apc[6].pcv[18], expected -33, is " << last_msg_->apc[6].pcv[18]; - EXPECT_EQ(last_msg_->apc[6].pcv[19], -112) << "incorrect value for apc[6].pcv[19], expected -112, is " << last_msg_->apc[6].pcv[19]; - EXPECT_EQ(last_msg_->apc[6].pcv[20], -103) << "incorrect value for apc[6].pcv[20], expected -103, is " << last_msg_->apc[6].pcv[20]; - EXPECT_EQ(last_msg_->apc[6].sat_info, 7) << "incorrect value for apc[6].sat_info, expected 7, is " << last_msg_->apc[6].sat_info; - EXPECT_EQ(last_msg_->apc[6].sid.code, 158) << "incorrect value for apc[6].sid.code, expected 158, is " << last_msg_->apc[6].sid.code; - EXPECT_EQ(last_msg_->apc[6].sid.sat, 200) << "incorrect value for apc[6].sid.sat, expected 200, is " << last_msg_->apc[6].sid.sat; - EXPECT_EQ(last_msg_->apc[6].svn, 17310) << "incorrect value for apc[6].svn, expected 17310, is " << last_msg_->apc[6].svn; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 4920); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->apc[0].pco[0], -21547) + << "incorrect value for apc[0].pco[0], expected -21547, is " + << last_msg_->apc[0].pco[0]; + EXPECT_EQ(last_msg_->apc[0].pco[1], -10498) + << "incorrect value for apc[0].pco[1], expected -10498, is " + << last_msg_->apc[0].pco[1]; + EXPECT_EQ(last_msg_->apc[0].pco[2], 1236) + << "incorrect value for apc[0].pco[2], expected 1236, is " + << last_msg_->apc[0].pco[2]; + EXPECT_EQ(last_msg_->apc[0].pcv[0], 8) + << "incorrect value for apc[0].pcv[0], expected 8, is " + << last_msg_->apc[0].pcv[0]; + EXPECT_EQ(last_msg_->apc[0].pcv[1], 33) + << "incorrect value for apc[0].pcv[1], expected 33, is " + << last_msg_->apc[0].pcv[1]; + EXPECT_EQ(last_msg_->apc[0].pcv[2], 31) + << "incorrect value for apc[0].pcv[2], expected 31, is " + << last_msg_->apc[0].pcv[2]; + EXPECT_EQ(last_msg_->apc[0].pcv[3], 80) + << "incorrect value for apc[0].pcv[3], expected 80, is " + << last_msg_->apc[0].pcv[3]; + EXPECT_EQ(last_msg_->apc[0].pcv[4], 21) + << "incorrect value for apc[0].pcv[4], expected 21, is " + << last_msg_->apc[0].pcv[4]; + EXPECT_EQ(last_msg_->apc[0].pcv[5], 4) + << "incorrect value for apc[0].pcv[5], expected 4, is " + << last_msg_->apc[0].pcv[5]; + EXPECT_EQ(last_msg_->apc[0].pcv[6], 105) + << "incorrect value for apc[0].pcv[6], expected 105, is " + << last_msg_->apc[0].pcv[6]; + EXPECT_EQ(last_msg_->apc[0].pcv[7], -31) + << "incorrect value for apc[0].pcv[7], expected -31, is " + << last_msg_->apc[0].pcv[7]; + EXPECT_EQ(last_msg_->apc[0].pcv[8], 39) + << "incorrect value for apc[0].pcv[8], expected 39, is " + << last_msg_->apc[0].pcv[8]; + EXPECT_EQ(last_msg_->apc[0].pcv[9], -117) + << "incorrect value for apc[0].pcv[9], expected -117, is " + << last_msg_->apc[0].pcv[9]; + EXPECT_EQ(last_msg_->apc[0].pcv[10], 124) + << "incorrect value for apc[0].pcv[10], expected 124, is " + << last_msg_->apc[0].pcv[10]; + EXPECT_EQ(last_msg_->apc[0].pcv[11], -107) + << "incorrect value for apc[0].pcv[11], expected -107, is " + << last_msg_->apc[0].pcv[11]; + EXPECT_EQ(last_msg_->apc[0].pcv[12], 48) + << "incorrect value for apc[0].pcv[12], expected 48, is " + << last_msg_->apc[0].pcv[12]; + EXPECT_EQ(last_msg_->apc[0].pcv[13], 15) + << "incorrect value for apc[0].pcv[13], expected 15, is " + << last_msg_->apc[0].pcv[13]; + EXPECT_EQ(last_msg_->apc[0].pcv[14], -42) + << "incorrect value for apc[0].pcv[14], expected -42, is " + << last_msg_->apc[0].pcv[14]; + EXPECT_EQ(last_msg_->apc[0].pcv[15], -59) + << "incorrect value for apc[0].pcv[15], expected -59, is " + << last_msg_->apc[0].pcv[15]; + EXPECT_EQ(last_msg_->apc[0].pcv[16], -115) + << "incorrect value for apc[0].pcv[16], expected -115, is " + << last_msg_->apc[0].pcv[16]; + EXPECT_EQ(last_msg_->apc[0].pcv[17], 32) + << "incorrect value for apc[0].pcv[17], expected 32, is " + << last_msg_->apc[0].pcv[17]; + EXPECT_EQ(last_msg_->apc[0].pcv[18], 33) + << "incorrect value for apc[0].pcv[18], expected 33, is " + << last_msg_->apc[0].pcv[18]; + EXPECT_EQ(last_msg_->apc[0].pcv[19], -121) + << "incorrect value for apc[0].pcv[19], expected -121, is " + << last_msg_->apc[0].pcv[19]; + EXPECT_EQ(last_msg_->apc[0].pcv[20], -106) + << "incorrect value for apc[0].pcv[20], expected -106, is " + << last_msg_->apc[0].pcv[20]; + EXPECT_EQ(last_msg_->apc[0].sat_info, 240) + << "incorrect value for apc[0].sat_info, expected 240, is " + << last_msg_->apc[0].sat_info; + EXPECT_EQ(last_msg_->apc[0].sid.code, 169) + << "incorrect value for apc[0].sid.code, expected 169, is " + << last_msg_->apc[0].sid.code; + EXPECT_EQ(last_msg_->apc[0].sid.sat, 203) + << "incorrect value for apc[0].sid.sat, expected 203, is " + << last_msg_->apc[0].sid.sat; + EXPECT_EQ(last_msg_->apc[0].svn, 1102) + << "incorrect value for apc[0].svn, expected 1102, is " + << last_msg_->apc[0].svn; + EXPECT_EQ(last_msg_->apc[1].pco[0], 23079) + << "incorrect value for apc[1].pco[0], expected 23079, is " + << last_msg_->apc[1].pco[0]; + EXPECT_EQ(last_msg_->apc[1].pco[1], -22252) + << "incorrect value for apc[1].pco[1], expected -22252, is " + << last_msg_->apc[1].pco[1]; + EXPECT_EQ(last_msg_->apc[1].pco[2], 12271) + << "incorrect value for apc[1].pco[2], expected 12271, is " + << last_msg_->apc[1].pco[2]; + EXPECT_EQ(last_msg_->apc[1].pcv[0], -103) + << "incorrect value for apc[1].pcv[0], expected -103, is " + << last_msg_->apc[1].pcv[0]; + EXPECT_EQ(last_msg_->apc[1].pcv[1], -81) + << "incorrect value for apc[1].pcv[1], expected -81, is " + << last_msg_->apc[1].pcv[1]; + EXPECT_EQ(last_msg_->apc[1].pcv[2], 35) + << "incorrect value for apc[1].pcv[2], expected 35, is " + << last_msg_->apc[1].pcv[2]; + EXPECT_EQ(last_msg_->apc[1].pcv[3], -111) + << "incorrect value for apc[1].pcv[3], expected -111, is " + << last_msg_->apc[1].pcv[3]; + EXPECT_EQ(last_msg_->apc[1].pcv[4], -111) + << "incorrect value for apc[1].pcv[4], expected -111, is " + << last_msg_->apc[1].pcv[4]; + EXPECT_EQ(last_msg_->apc[1].pcv[5], 123) + << "incorrect value for apc[1].pcv[5], expected 123, is " + << last_msg_->apc[1].pcv[5]; + EXPECT_EQ(last_msg_->apc[1].pcv[6], -62) + << "incorrect value for apc[1].pcv[6], expected -62, is " + << last_msg_->apc[1].pcv[6]; + EXPECT_EQ(last_msg_->apc[1].pcv[7], 2) + << "incorrect value for apc[1].pcv[7], expected 2, is " + << last_msg_->apc[1].pcv[7]; + EXPECT_EQ(last_msg_->apc[1].pcv[8], 102) + << "incorrect value for apc[1].pcv[8], expected 102, is " + << last_msg_->apc[1].pcv[8]; + EXPECT_EQ(last_msg_->apc[1].pcv[9], 74) + << "incorrect value for apc[1].pcv[9], expected 74, is " + << last_msg_->apc[1].pcv[9]; + EXPECT_EQ(last_msg_->apc[1].pcv[10], -107) + << "incorrect value for apc[1].pcv[10], expected -107, is " + << last_msg_->apc[1].pcv[10]; + EXPECT_EQ(last_msg_->apc[1].pcv[11], 95) + << "incorrect value for apc[1].pcv[11], expected 95, is " + << last_msg_->apc[1].pcv[11]; + EXPECT_EQ(last_msg_->apc[1].pcv[12], -85) + << "incorrect value for apc[1].pcv[12], expected -85, is " + << last_msg_->apc[1].pcv[12]; + EXPECT_EQ(last_msg_->apc[1].pcv[13], -18) + << "incorrect value for apc[1].pcv[13], expected -18, is " + << last_msg_->apc[1].pcv[13]; + EXPECT_EQ(last_msg_->apc[1].pcv[14], -7) + << "incorrect value for apc[1].pcv[14], expected -7, is " + << last_msg_->apc[1].pcv[14]; + EXPECT_EQ(last_msg_->apc[1].pcv[15], 7) + << "incorrect value for apc[1].pcv[15], expected 7, is " + << last_msg_->apc[1].pcv[15]; + EXPECT_EQ(last_msg_->apc[1].pcv[16], -19) + << "incorrect value for apc[1].pcv[16], expected -19, is " + << last_msg_->apc[1].pcv[16]; + EXPECT_EQ(last_msg_->apc[1].pcv[17], -86) + << "incorrect value for apc[1].pcv[17], expected -86, is " + << last_msg_->apc[1].pcv[17]; + EXPECT_EQ(last_msg_->apc[1].pcv[18], 125) + << "incorrect value for apc[1].pcv[18], expected 125, is " + << last_msg_->apc[1].pcv[18]; + EXPECT_EQ(last_msg_->apc[1].pcv[19], 106) + << "incorrect value for apc[1].pcv[19], expected 106, is " + << last_msg_->apc[1].pcv[19]; + EXPECT_EQ(last_msg_->apc[1].pcv[20], -98) + << "incorrect value for apc[1].pcv[20], expected -98, is " + << last_msg_->apc[1].pcv[20]; + EXPECT_EQ(last_msg_->apc[1].sat_info, 49) + << "incorrect value for apc[1].sat_info, expected 49, is " + << last_msg_->apc[1].sat_info; + EXPECT_EQ(last_msg_->apc[1].sid.code, 123) + << "incorrect value for apc[1].sid.code, expected 123, is " + << last_msg_->apc[1].sid.code; + EXPECT_EQ(last_msg_->apc[1].sid.sat, 148) + << "incorrect value for apc[1].sid.sat, expected 148, is " + << last_msg_->apc[1].sid.sat; + EXPECT_EQ(last_msg_->apc[1].svn, 24967) + << "incorrect value for apc[1].svn, expected 24967, is " + << last_msg_->apc[1].svn; + EXPECT_EQ(last_msg_->apc[2].pco[0], -7596) + << "incorrect value for apc[2].pco[0], expected -7596, is " + << last_msg_->apc[2].pco[0]; + EXPECT_EQ(last_msg_->apc[2].pco[1], 31630) + << "incorrect value for apc[2].pco[1], expected 31630, is " + << last_msg_->apc[2].pco[1]; + EXPECT_EQ(last_msg_->apc[2].pco[2], -9907) + << "incorrect value for apc[2].pco[2], expected -9907, is " + << last_msg_->apc[2].pco[2]; + EXPECT_EQ(last_msg_->apc[2].pcv[0], -8) + << "incorrect value for apc[2].pcv[0], expected -8, is " + << last_msg_->apc[2].pcv[0]; + EXPECT_EQ(last_msg_->apc[2].pcv[1], 67) + << "incorrect value for apc[2].pcv[1], expected 67, is " + << last_msg_->apc[2].pcv[1]; + EXPECT_EQ(last_msg_->apc[2].pcv[2], -41) + << "incorrect value for apc[2].pcv[2], expected -41, is " + << last_msg_->apc[2].pcv[2]; + EXPECT_EQ(last_msg_->apc[2].pcv[3], -127) + << "incorrect value for apc[2].pcv[3], expected -127, is " + << last_msg_->apc[2].pcv[3]; + EXPECT_EQ(last_msg_->apc[2].pcv[4], 114) + << "incorrect value for apc[2].pcv[4], expected 114, is " + << last_msg_->apc[2].pcv[4]; + EXPECT_EQ(last_msg_->apc[2].pcv[5], -118) + << "incorrect value for apc[2].pcv[5], expected -118, is " + << last_msg_->apc[2].pcv[5]; + EXPECT_EQ(last_msg_->apc[2].pcv[6], 25) + << "incorrect value for apc[2].pcv[6], expected 25, is " + << last_msg_->apc[2].pcv[6]; + EXPECT_EQ(last_msg_->apc[2].pcv[7], -16) + << "incorrect value for apc[2].pcv[7], expected -16, is " + << last_msg_->apc[2].pcv[7]; + EXPECT_EQ(last_msg_->apc[2].pcv[8], 10) + << "incorrect value for apc[2].pcv[8], expected 10, is " + << last_msg_->apc[2].pcv[8]; + EXPECT_EQ(last_msg_->apc[2].pcv[9], 56) + << "incorrect value for apc[2].pcv[9], expected 56, is " + << last_msg_->apc[2].pcv[9]; + EXPECT_EQ(last_msg_->apc[2].pcv[10], 76) + << "incorrect value for apc[2].pcv[10], expected 76, is " + << last_msg_->apc[2].pcv[10]; + EXPECT_EQ(last_msg_->apc[2].pcv[11], 61) + << "incorrect value for apc[2].pcv[11], expected 61, is " + << last_msg_->apc[2].pcv[11]; + EXPECT_EQ(last_msg_->apc[2].pcv[12], -95) + << "incorrect value for apc[2].pcv[12], expected -95, is " + << last_msg_->apc[2].pcv[12]; + EXPECT_EQ(last_msg_->apc[2].pcv[13], -40) + << "incorrect value for apc[2].pcv[13], expected -40, is " + << last_msg_->apc[2].pcv[13]; + EXPECT_EQ(last_msg_->apc[2].pcv[14], 22) + << "incorrect value for apc[2].pcv[14], expected 22, is " + << last_msg_->apc[2].pcv[14]; + EXPECT_EQ(last_msg_->apc[2].pcv[15], -75) + << "incorrect value for apc[2].pcv[15], expected -75, is " + << last_msg_->apc[2].pcv[15]; + EXPECT_EQ(last_msg_->apc[2].pcv[16], -82) + << "incorrect value for apc[2].pcv[16], expected -82, is " + << last_msg_->apc[2].pcv[16]; + EXPECT_EQ(last_msg_->apc[2].pcv[17], 33) + << "incorrect value for apc[2].pcv[17], expected 33, is " + << last_msg_->apc[2].pcv[17]; + EXPECT_EQ(last_msg_->apc[2].pcv[18], 13) + << "incorrect value for apc[2].pcv[18], expected 13, is " + << last_msg_->apc[2].pcv[18]; + EXPECT_EQ(last_msg_->apc[2].pcv[19], -4) + << "incorrect value for apc[2].pcv[19], expected -4, is " + << last_msg_->apc[2].pcv[19]; + EXPECT_EQ(last_msg_->apc[2].pcv[20], -20) + << "incorrect value for apc[2].pcv[20], expected -20, is " + << last_msg_->apc[2].pcv[20]; + EXPECT_EQ(last_msg_->apc[2].sat_info, 181) + << "incorrect value for apc[2].sat_info, expected 181, is " + << last_msg_->apc[2].sat_info; + EXPECT_EQ(last_msg_->apc[2].sid.code, 188) + << "incorrect value for apc[2].sid.code, expected 188, is " + << last_msg_->apc[2].sid.code; + EXPECT_EQ(last_msg_->apc[2].sid.sat, 83) + << "incorrect value for apc[2].sid.sat, expected 83, is " + << last_msg_->apc[2].sid.sat; + EXPECT_EQ(last_msg_->apc[2].svn, 7106) + << "incorrect value for apc[2].svn, expected 7106, is " + << last_msg_->apc[2].svn; + EXPECT_EQ(last_msg_->apc[3].pco[0], -19478) + << "incorrect value for apc[3].pco[0], expected -19478, is " + << last_msg_->apc[3].pco[0]; + EXPECT_EQ(last_msg_->apc[3].pco[1], 11484) + << "incorrect value for apc[3].pco[1], expected 11484, is " + << last_msg_->apc[3].pco[1]; + EXPECT_EQ(last_msg_->apc[3].pco[2], 14804) + << "incorrect value for apc[3].pco[2], expected 14804, is " + << last_msg_->apc[3].pco[2]; + EXPECT_EQ(last_msg_->apc[3].pcv[0], 44) + << "incorrect value for apc[3].pcv[0], expected 44, is " + << last_msg_->apc[3].pcv[0]; + EXPECT_EQ(last_msg_->apc[3].pcv[1], -83) + << "incorrect value for apc[3].pcv[1], expected -83, is " + << last_msg_->apc[3].pcv[1]; + EXPECT_EQ(last_msg_->apc[3].pcv[2], 49) + << "incorrect value for apc[3].pcv[2], expected 49, is " + << last_msg_->apc[3].pcv[2]; + EXPECT_EQ(last_msg_->apc[3].pcv[3], 36) + << "incorrect value for apc[3].pcv[3], expected 36, is " + << last_msg_->apc[3].pcv[3]; + EXPECT_EQ(last_msg_->apc[3].pcv[4], -119) + << "incorrect value for apc[3].pcv[4], expected -119, is " + << last_msg_->apc[3].pcv[4]; + EXPECT_EQ(last_msg_->apc[3].pcv[5], -8) + << "incorrect value for apc[3].pcv[5], expected -8, is " + << last_msg_->apc[3].pcv[5]; + EXPECT_EQ(last_msg_->apc[3].pcv[6], -21) + << "incorrect value for apc[3].pcv[6], expected -21, is " + << last_msg_->apc[3].pcv[6]; + EXPECT_EQ(last_msg_->apc[3].pcv[7], 97) + << "incorrect value for apc[3].pcv[7], expected 97, is " + << last_msg_->apc[3].pcv[7]; + EXPECT_EQ(last_msg_->apc[3].pcv[8], 112) + << "incorrect value for apc[3].pcv[8], expected 112, is " + << last_msg_->apc[3].pcv[8]; + EXPECT_EQ(last_msg_->apc[3].pcv[9], -99) + << "incorrect value for apc[3].pcv[9], expected -99, is " + << last_msg_->apc[3].pcv[9]; + EXPECT_EQ(last_msg_->apc[3].pcv[10], -117) + << "incorrect value for apc[3].pcv[10], expected -117, is " + << last_msg_->apc[3].pcv[10]; + EXPECT_EQ(last_msg_->apc[3].pcv[11], 26) + << "incorrect value for apc[3].pcv[11], expected 26, is " + << last_msg_->apc[3].pcv[11]; + EXPECT_EQ(last_msg_->apc[3].pcv[12], 115) + << "incorrect value for apc[3].pcv[12], expected 115, is " + << last_msg_->apc[3].pcv[12]; + EXPECT_EQ(last_msg_->apc[3].pcv[13], -64) + << "incorrect value for apc[3].pcv[13], expected -64, is " + << last_msg_->apc[3].pcv[13]; + EXPECT_EQ(last_msg_->apc[3].pcv[14], 31) + << "incorrect value for apc[3].pcv[14], expected 31, is " + << last_msg_->apc[3].pcv[14]; + EXPECT_EQ(last_msg_->apc[3].pcv[15], 85) + << "incorrect value for apc[3].pcv[15], expected 85, is " + << last_msg_->apc[3].pcv[15]; + EXPECT_EQ(last_msg_->apc[3].pcv[16], 127) + << "incorrect value for apc[3].pcv[16], expected 127, is " + << last_msg_->apc[3].pcv[16]; + EXPECT_EQ(last_msg_->apc[3].pcv[17], -28) + << "incorrect value for apc[3].pcv[17], expected -28, is " + << last_msg_->apc[3].pcv[17]; + EXPECT_EQ(last_msg_->apc[3].pcv[18], 81) + << "incorrect value for apc[3].pcv[18], expected 81, is " + << last_msg_->apc[3].pcv[18]; + EXPECT_EQ(last_msg_->apc[3].pcv[19], -4) + << "incorrect value for apc[3].pcv[19], expected -4, is " + << last_msg_->apc[3].pcv[19]; + EXPECT_EQ(last_msg_->apc[3].pcv[20], -37) + << "incorrect value for apc[3].pcv[20], expected -37, is " + << last_msg_->apc[3].pcv[20]; + EXPECT_EQ(last_msg_->apc[3].sat_info, 128) + << "incorrect value for apc[3].sat_info, expected 128, is " + << last_msg_->apc[3].sat_info; + EXPECT_EQ(last_msg_->apc[3].sid.code, 196) + << "incorrect value for apc[3].sid.code, expected 196, is " + << last_msg_->apc[3].sid.code; + EXPECT_EQ(last_msg_->apc[3].sid.sat, 230) + << "incorrect value for apc[3].sid.sat, expected 230, is " + << last_msg_->apc[3].sid.sat; + EXPECT_EQ(last_msg_->apc[3].svn, 61399) + << "incorrect value for apc[3].svn, expected 61399, is " + << last_msg_->apc[3].svn; + EXPECT_EQ(last_msg_->apc[4].pco[0], -11049) + << "incorrect value for apc[4].pco[0], expected -11049, is " + << last_msg_->apc[4].pco[0]; + EXPECT_EQ(last_msg_->apc[4].pco[1], 6580) + << "incorrect value for apc[4].pco[1], expected 6580, is " + << last_msg_->apc[4].pco[1]; + EXPECT_EQ(last_msg_->apc[4].pco[2], -28589) + << "incorrect value for apc[4].pco[2], expected -28589, is " + << last_msg_->apc[4].pco[2]; + EXPECT_EQ(last_msg_->apc[4].pcv[0], -9) + << "incorrect value for apc[4].pcv[0], expected -9, is " + << last_msg_->apc[4].pcv[0]; + EXPECT_EQ(last_msg_->apc[4].pcv[1], 12) + << "incorrect value for apc[4].pcv[1], expected 12, is " + << last_msg_->apc[4].pcv[1]; + EXPECT_EQ(last_msg_->apc[4].pcv[2], 27) + << "incorrect value for apc[4].pcv[2], expected 27, is " + << last_msg_->apc[4].pcv[2]; + EXPECT_EQ(last_msg_->apc[4].pcv[3], -57) + << "incorrect value for apc[4].pcv[3], expected -57, is " + << last_msg_->apc[4].pcv[3]; + EXPECT_EQ(last_msg_->apc[4].pcv[4], -83) + << "incorrect value for apc[4].pcv[4], expected -83, is " + << last_msg_->apc[4].pcv[4]; + EXPECT_EQ(last_msg_->apc[4].pcv[5], 74) + << "incorrect value for apc[4].pcv[5], expected 74, is " + << last_msg_->apc[4].pcv[5]; + EXPECT_EQ(last_msg_->apc[4].pcv[6], 23) + << "incorrect value for apc[4].pcv[6], expected 23, is " + << last_msg_->apc[4].pcv[6]; + EXPECT_EQ(last_msg_->apc[4].pcv[7], 4) + << "incorrect value for apc[4].pcv[7], expected 4, is " + << last_msg_->apc[4].pcv[7]; + EXPECT_EQ(last_msg_->apc[4].pcv[8], -17) + << "incorrect value for apc[4].pcv[8], expected -17, is " + << last_msg_->apc[4].pcv[8]; + EXPECT_EQ(last_msg_->apc[4].pcv[9], 103) + << "incorrect value for apc[4].pcv[9], expected 103, is " + << last_msg_->apc[4].pcv[9]; + EXPECT_EQ(last_msg_->apc[4].pcv[10], -33) + << "incorrect value for apc[4].pcv[10], expected -33, is " + << last_msg_->apc[4].pcv[10]; + EXPECT_EQ(last_msg_->apc[4].pcv[11], -36) + << "incorrect value for apc[4].pcv[11], expected -36, is " + << last_msg_->apc[4].pcv[11]; + EXPECT_EQ(last_msg_->apc[4].pcv[12], -117) + << "incorrect value for apc[4].pcv[12], expected -117, is " + << last_msg_->apc[4].pcv[12]; + EXPECT_EQ(last_msg_->apc[4].pcv[13], 91) + << "incorrect value for apc[4].pcv[13], expected 91, is " + << last_msg_->apc[4].pcv[13]; + EXPECT_EQ(last_msg_->apc[4].pcv[14], 127) + << "incorrect value for apc[4].pcv[14], expected 127, is " + << last_msg_->apc[4].pcv[14]; + EXPECT_EQ(last_msg_->apc[4].pcv[15], -42) + << "incorrect value for apc[4].pcv[15], expected -42, is " + << last_msg_->apc[4].pcv[15]; + EXPECT_EQ(last_msg_->apc[4].pcv[16], 86) + << "incorrect value for apc[4].pcv[16], expected 86, is " + << last_msg_->apc[4].pcv[16]; + EXPECT_EQ(last_msg_->apc[4].pcv[17], 48) + << "incorrect value for apc[4].pcv[17], expected 48, is " + << last_msg_->apc[4].pcv[17]; + EXPECT_EQ(last_msg_->apc[4].pcv[18], -53) + << "incorrect value for apc[4].pcv[18], expected -53, is " + << last_msg_->apc[4].pcv[18]; + EXPECT_EQ(last_msg_->apc[4].pcv[19], -28) + << "incorrect value for apc[4].pcv[19], expected -28, is " + << last_msg_->apc[4].pcv[19]; + EXPECT_EQ(last_msg_->apc[4].pcv[20], 99) + << "incorrect value for apc[4].pcv[20], expected 99, is " + << last_msg_->apc[4].pcv[20]; + EXPECT_EQ(last_msg_->apc[4].sat_info, 147) + << "incorrect value for apc[4].sat_info, expected 147, is " + << last_msg_->apc[4].sat_info; + EXPECT_EQ(last_msg_->apc[4].sid.code, 110) + << "incorrect value for apc[4].sid.code, expected 110, is " + << last_msg_->apc[4].sid.code; + EXPECT_EQ(last_msg_->apc[4].sid.sat, 249) + << "incorrect value for apc[4].sid.sat, expected 249, is " + << last_msg_->apc[4].sid.sat; + EXPECT_EQ(last_msg_->apc[4].svn, 41224) + << "incorrect value for apc[4].svn, expected 41224, is " + << last_msg_->apc[4].svn; + EXPECT_EQ(last_msg_->apc[5].pco[0], -21881) + << "incorrect value for apc[5].pco[0], expected -21881, is " + << last_msg_->apc[5].pco[0]; + EXPECT_EQ(last_msg_->apc[5].pco[1], -9942) + << "incorrect value for apc[5].pco[1], expected -9942, is " + << last_msg_->apc[5].pco[1]; + EXPECT_EQ(last_msg_->apc[5].pco[2], -5689) + << "incorrect value for apc[5].pco[2], expected -5689, is " + << last_msg_->apc[5].pco[2]; + EXPECT_EQ(last_msg_->apc[5].pcv[0], 42) + << "incorrect value for apc[5].pcv[0], expected 42, is " + << last_msg_->apc[5].pcv[0]; + EXPECT_EQ(last_msg_->apc[5].pcv[1], -86) + << "incorrect value for apc[5].pcv[1], expected -86, is " + << last_msg_->apc[5].pcv[1]; + EXPECT_EQ(last_msg_->apc[5].pcv[2], 78) + << "incorrect value for apc[5].pcv[2], expected 78, is " + << last_msg_->apc[5].pcv[2]; + EXPECT_EQ(last_msg_->apc[5].pcv[3], -50) + << "incorrect value for apc[5].pcv[3], expected -50, is " + << last_msg_->apc[5].pcv[3]; + EXPECT_EQ(last_msg_->apc[5].pcv[4], 41) + << "incorrect value for apc[5].pcv[4], expected 41, is " + << last_msg_->apc[5].pcv[4]; + EXPECT_EQ(last_msg_->apc[5].pcv[5], 43) + << "incorrect value for apc[5].pcv[5], expected 43, is " + << last_msg_->apc[5].pcv[5]; + EXPECT_EQ(last_msg_->apc[5].pcv[6], 81) + << "incorrect value for apc[5].pcv[6], expected 81, is " + << last_msg_->apc[5].pcv[6]; + EXPECT_EQ(last_msg_->apc[5].pcv[7], -9) + << "incorrect value for apc[5].pcv[7], expected -9, is " + << last_msg_->apc[5].pcv[7]; + EXPECT_EQ(last_msg_->apc[5].pcv[8], 99) + << "incorrect value for apc[5].pcv[8], expected 99, is " + << last_msg_->apc[5].pcv[8]; + EXPECT_EQ(last_msg_->apc[5].pcv[9], -58) + << "incorrect value for apc[5].pcv[9], expected -58, is " + << last_msg_->apc[5].pcv[9]; + EXPECT_EQ(last_msg_->apc[5].pcv[10], -112) + << "incorrect value for apc[5].pcv[10], expected -112, is " + << last_msg_->apc[5].pcv[10]; + EXPECT_EQ(last_msg_->apc[5].pcv[11], 2) + << "incorrect value for apc[5].pcv[11], expected 2, is " + << last_msg_->apc[5].pcv[11]; + EXPECT_EQ(last_msg_->apc[5].pcv[12], -124) + << "incorrect value for apc[5].pcv[12], expected -124, is " + << last_msg_->apc[5].pcv[12]; + EXPECT_EQ(last_msg_->apc[5].pcv[13], 2) + << "incorrect value for apc[5].pcv[13], expected 2, is " + << last_msg_->apc[5].pcv[13]; + EXPECT_EQ(last_msg_->apc[5].pcv[14], -32) + << "incorrect value for apc[5].pcv[14], expected -32, is " + << last_msg_->apc[5].pcv[14]; + EXPECT_EQ(last_msg_->apc[5].pcv[15], -36) + << "incorrect value for apc[5].pcv[15], expected -36, is " + << last_msg_->apc[5].pcv[15]; + EXPECT_EQ(last_msg_->apc[5].pcv[16], -108) + << "incorrect value for apc[5].pcv[16], expected -108, is " + << last_msg_->apc[5].pcv[16]; + EXPECT_EQ(last_msg_->apc[5].pcv[17], 58) + << "incorrect value for apc[5].pcv[17], expected 58, is " + << last_msg_->apc[5].pcv[17]; + EXPECT_EQ(last_msg_->apc[5].pcv[18], 85) + << "incorrect value for apc[5].pcv[18], expected 85, is " + << last_msg_->apc[5].pcv[18]; + EXPECT_EQ(last_msg_->apc[5].pcv[19], -118) + << "incorrect value for apc[5].pcv[19], expected -118, is " + << last_msg_->apc[5].pcv[19]; + EXPECT_EQ(last_msg_->apc[5].pcv[20], -46) + << "incorrect value for apc[5].pcv[20], expected -46, is " + << last_msg_->apc[5].pcv[20]; + EXPECT_EQ(last_msg_->apc[5].sat_info, 159) + << "incorrect value for apc[5].sat_info, expected 159, is " + << last_msg_->apc[5].sat_info; + EXPECT_EQ(last_msg_->apc[5].sid.code, 83) + << "incorrect value for apc[5].sid.code, expected 83, is " + << last_msg_->apc[5].sid.code; + EXPECT_EQ(last_msg_->apc[5].sid.sat, 45) + << "incorrect value for apc[5].sid.sat, expected 45, is " + << last_msg_->apc[5].sid.sat; + EXPECT_EQ(last_msg_->apc[5].svn, 64011) + << "incorrect value for apc[5].svn, expected 64011, is " + << last_msg_->apc[5].svn; + EXPECT_EQ(last_msg_->apc[6].pco[0], -14290) + << "incorrect value for apc[6].pco[0], expected -14290, is " + << last_msg_->apc[6].pco[0]; + EXPECT_EQ(last_msg_->apc[6].pco[1], 30340) + << "incorrect value for apc[6].pco[1], expected 30340, is " + << last_msg_->apc[6].pco[1]; + EXPECT_EQ(last_msg_->apc[6].pco[2], 3569) + << "incorrect value for apc[6].pco[2], expected 3569, is " + << last_msg_->apc[6].pco[2]; + EXPECT_EQ(last_msg_->apc[6].pcv[0], 37) + << "incorrect value for apc[6].pcv[0], expected 37, is " + << last_msg_->apc[6].pcv[0]; + EXPECT_EQ(last_msg_->apc[6].pcv[1], 62) + << "incorrect value for apc[6].pcv[1], expected 62, is " + << last_msg_->apc[6].pcv[1]; + EXPECT_EQ(last_msg_->apc[6].pcv[2], 107) + << "incorrect value for apc[6].pcv[2], expected 107, is " + << last_msg_->apc[6].pcv[2]; + EXPECT_EQ(last_msg_->apc[6].pcv[3], -3) + << "incorrect value for apc[6].pcv[3], expected -3, is " + << last_msg_->apc[6].pcv[3]; + EXPECT_EQ(last_msg_->apc[6].pcv[4], -66) + << "incorrect value for apc[6].pcv[4], expected -66, is " + << last_msg_->apc[6].pcv[4]; + EXPECT_EQ(last_msg_->apc[6].pcv[5], -120) + << "incorrect value for apc[6].pcv[5], expected -120, is " + << last_msg_->apc[6].pcv[5]; + EXPECT_EQ(last_msg_->apc[6].pcv[6], 66) + << "incorrect value for apc[6].pcv[6], expected 66, is " + << last_msg_->apc[6].pcv[6]; + EXPECT_EQ(last_msg_->apc[6].pcv[7], 9) + << "incorrect value for apc[6].pcv[7], expected 9, is " + << last_msg_->apc[6].pcv[7]; + EXPECT_EQ(last_msg_->apc[6].pcv[8], 84) + << "incorrect value for apc[6].pcv[8], expected 84, is " + << last_msg_->apc[6].pcv[8]; + EXPECT_EQ(last_msg_->apc[6].pcv[9], -101) + << "incorrect value for apc[6].pcv[9], expected -101, is " + << last_msg_->apc[6].pcv[9]; + EXPECT_EQ(last_msg_->apc[6].pcv[10], 86) + << "incorrect value for apc[6].pcv[10], expected 86, is " + << last_msg_->apc[6].pcv[10]; + EXPECT_EQ(last_msg_->apc[6].pcv[11], -76) + << "incorrect value for apc[6].pcv[11], expected -76, is " + << last_msg_->apc[6].pcv[11]; + EXPECT_EQ(last_msg_->apc[6].pcv[12], 41) + << "incorrect value for apc[6].pcv[12], expected 41, is " + << last_msg_->apc[6].pcv[12]; + EXPECT_EQ(last_msg_->apc[6].pcv[13], -60) + << "incorrect value for apc[6].pcv[13], expected -60, is " + << last_msg_->apc[6].pcv[13]; + EXPECT_EQ(last_msg_->apc[6].pcv[14], 40) + << "incorrect value for apc[6].pcv[14], expected 40, is " + << last_msg_->apc[6].pcv[14]; + EXPECT_EQ(last_msg_->apc[6].pcv[15], 119) + << "incorrect value for apc[6].pcv[15], expected 119, is " + << last_msg_->apc[6].pcv[15]; + EXPECT_EQ(last_msg_->apc[6].pcv[16], 101) + << "incorrect value for apc[6].pcv[16], expected 101, is " + << last_msg_->apc[6].pcv[16]; + EXPECT_EQ(last_msg_->apc[6].pcv[17], -4) + << "incorrect value for apc[6].pcv[17], expected -4, is " + << last_msg_->apc[6].pcv[17]; + EXPECT_EQ(last_msg_->apc[6].pcv[18], -33) + << "incorrect value for apc[6].pcv[18], expected -33, is " + << last_msg_->apc[6].pcv[18]; + EXPECT_EQ(last_msg_->apc[6].pcv[19], -112) + << "incorrect value for apc[6].pcv[19], expected -112, is " + << last_msg_->apc[6].pcv[19]; + EXPECT_EQ(last_msg_->apc[6].pcv[20], -103) + << "incorrect value for apc[6].pcv[20], expected -103, is " + << last_msg_->apc[6].pcv[20]; + EXPECT_EQ(last_msg_->apc[6].sat_info, 7) + << "incorrect value for apc[6].sat_info, expected 7, is " + << last_msg_->apc[6].sat_info; + EXPECT_EQ(last_msg_->apc[6].sid.code, 158) + << "incorrect value for apc[6].sid.code, expected 158, is " + << last_msg_->apc[6].sid.code; + EXPECT_EQ(last_msg_->apc[6].sid.sat, 200) + << "incorrect value for apc[6].sid.sat, expected 200, is " + << last_msg_->apc[6].sid.sat; + EXPECT_EQ(last_msg_->apc[6].svn, 17310) + << "incorrect value for apc[6].svn, expected 17310, is " + << last_msg_->apc[6].svn; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrStecCorrection.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrStecCorrection.cc index e4924487b..4c5547e7a 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrStecCorrection.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrStecCorrection.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrection.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrection.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrection0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrection0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrection0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrection0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_stec_correction_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_stec_correction_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,121 +82,182 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrection0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_stec_correction_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrection0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrection0, Test) { + uint8_t encoded_frame[] = { + 85, 253, 5, 66, 0, 38, 180, 0, 0, 0, 3, 0, 1, 1, 10, 0, + 15, 1, 0, 10, 0, 2, 1, 1, 1, 63, 0, 62, 0, 61, 0, 60, + 0, 31, 15, 5, 63, 0, 64, 0, 65, 0, 66, 0, 119, 50, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_stec_correction_t *test_msg = + (msg_ssr_stec_correction_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.num_msgs = 1; + test_msg->header.seq_num = 1; + test_msg->header.sol_id = 0; + test_msg->header.time.tow = 180; + test_msg->header.time.wn = 3; + test_msg->header.update_interval = 10; + test_msg->n_sats = 2; + test_msg->ssr_iod_atmo = 15; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); + } + test_msg->stec_sat_list[0].stec_coeff[0] = 63; + if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); + } + test_msg->stec_sat_list[0].stec_coeff[1] = 62; + if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); + } + test_msg->stec_sat_list[0].stec_coeff[2] = 61; + if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); + } + test_msg->stec_sat_list[0].stec_coeff[3] = 60; + test_msg->stec_sat_list[0].stec_quality_indicator = 1; + test_msg->stec_sat_list[0].sv_id.constellation = 1; + test_msg->stec_sat_list[0].sv_id.satId = 1; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); + } + test_msg->stec_sat_list[1].stec_coeff[0] = 63; + if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); + } + test_msg->stec_sat_list[1].stec_coeff[1] = 64; + if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); + } + test_msg->stec_sat_list[1].stec_coeff[2] = 65; + if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); + } + test_msg->stec_sat_list[1].stec_coeff[3] = 66; + test_msg->stec_sat_list[1].stec_quality_indicator = 5; + test_msg->stec_sat_list[1].sv_id.constellation = 15; + test_msg->stec_sat_list[1].sv_id.satId = 31; + test_msg->tile_id = 10; + test_msg->tile_set_id = 1; - uint8_t encoded_frame[] = {85,253,5,66,0,38,180,0,0,0,3,0,1,1,10,0,15,1,0,10,0,2,1,1,1,63,0,62,0,61,0,60,0,31,15,5,63,0,64,0,65,0,66,0,119,50, }; + EXPECT_EQ(send_message(1533, 66, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_stec_correction_t* test_msg = ( msg_ssr_stec_correction_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.num_msgs = 1; - test_msg->header.seq_num = 1; - test_msg->header.sol_id = 0; - test_msg->header.time.tow = 180; - test_msg->header.time.wn = 3; - test_msg->header.update_interval = 10; - test_msg->n_sats = 2; - test_msg->ssr_iod_atmo = 15; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); - } - test_msg->stec_sat_list[0].stec_coeff[0] = 63; - if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); - } - test_msg->stec_sat_list[0].stec_coeff[1] = 62; - if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); - } - test_msg->stec_sat_list[0].stec_coeff[2] = 61; - if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); - } - test_msg->stec_sat_list[0].stec_coeff[3] = 60; - test_msg->stec_sat_list[0].stec_quality_indicator = 1; - test_msg->stec_sat_list[0].sv_id.constellation = 1; - test_msg->stec_sat_list[0].sv_id.satId = 1; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); - } - test_msg->stec_sat_list[1].stec_coeff[0] = 63; - if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); - } - test_msg->stec_sat_list[1].stec_coeff[1] = 64; - if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); - } - test_msg->stec_sat_list[1].stec_coeff[2] = 65; - if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); - } - test_msg->stec_sat_list[1].stec_coeff[3] = 66; - test_msg->stec_sat_list[1].stec_quality_indicator = 5; - test_msg->stec_sat_list[1].sv_id.constellation = 15; - test_msg->stec_sat_list[1].sv_id.satId = 31; - test_msg->tile_id = 10; - test_msg->tile_set_id = 1; - - EXPECT_EQ(send_message( 1533, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.num_msgs, 1) << "incorrect value for header.num_msgs, expected 1, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.seq_num, 1) << "incorrect value for header.seq_num, expected 1, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->header.sol_id, 0) << "incorrect value for header.sol_id, expected 0, is " << last_msg_->header.sol_id; - EXPECT_EQ(last_msg_->header.time.tow, 180) << "incorrect value for header.time.tow, expected 180, is " << last_msg_->header.time.tow; - EXPECT_EQ(last_msg_->header.time.wn, 3) << "incorrect value for header.time.wn, expected 3, is " << last_msg_->header.time.wn; - EXPECT_EQ(last_msg_->header.update_interval, 10) << "incorrect value for header.update_interval, expected 10, is " << last_msg_->header.update_interval; - EXPECT_EQ(last_msg_->n_sats, 2) << "incorrect value for n_sats, expected 2, is " << last_msg_->n_sats; - EXPECT_EQ(last_msg_->ssr_iod_atmo, 15) << "incorrect value for ssr_iod_atmo, expected 15, is " << last_msg_->ssr_iod_atmo; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[0], 63) << "incorrect value for stec_sat_list[0].stec_coeff[0], expected 63, is " << last_msg_->stec_sat_list[0].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[1], 62) << "incorrect value for stec_sat_list[0].stec_coeff[1], expected 62, is " << last_msg_->stec_sat_list[0].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[2], 61) << "incorrect value for stec_sat_list[0].stec_coeff[2], expected 61, is " << last_msg_->stec_sat_list[0].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[3], 60) << "incorrect value for stec_sat_list[0].stec_coeff[3], expected 60, is " << last_msg_->stec_sat_list[0].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_quality_indicator, 1) << "incorrect value for stec_sat_list[0].stec_quality_indicator, expected 1, is " << last_msg_->stec_sat_list[0].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[0].sv_id.constellation, 1) << "incorrect value for stec_sat_list[0].sv_id.constellation, expected 1, is " << last_msg_->stec_sat_list[0].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[0].sv_id.satId, 1) << "incorrect value for stec_sat_list[0].sv_id.satId, expected 1, is " << last_msg_->stec_sat_list[0].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[0], 63) << "incorrect value for stec_sat_list[1].stec_coeff[0], expected 63, is " << last_msg_->stec_sat_list[1].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[1], 64) << "incorrect value for stec_sat_list[1].stec_coeff[1], expected 64, is " << last_msg_->stec_sat_list[1].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[2], 65) << "incorrect value for stec_sat_list[1].stec_coeff[2], expected 65, is " << last_msg_->stec_sat_list[1].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[3], 66) << "incorrect value for stec_sat_list[1].stec_coeff[3], expected 66, is " << last_msg_->stec_sat_list[1].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_quality_indicator, 5) << "incorrect value for stec_sat_list[1].stec_quality_indicator, expected 5, is " << last_msg_->stec_sat_list[1].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[1].sv_id.constellation, 15) << "incorrect value for stec_sat_list[1].sv_id.constellation, expected 15, is " << last_msg_->stec_sat_list[1].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[1].sv_id.satId, 31) << "incorrect value for stec_sat_list[1].sv_id.satId, expected 31, is " << last_msg_->stec_sat_list[1].sv_id.satId; - EXPECT_EQ(last_msg_->tile_id, 10) << "incorrect value for tile_id, expected 10, is " << last_msg_->tile_id; - EXPECT_EQ(last_msg_->tile_set_id, 1) << "incorrect value for tile_set_id, expected 1, is " << last_msg_->tile_set_id; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.num_msgs, 1) + << "incorrect value for header.num_msgs, expected 1, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.seq_num, 1) + << "incorrect value for header.seq_num, expected 1, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->header.sol_id, 0) + << "incorrect value for header.sol_id, expected 0, is " + << last_msg_->header.sol_id; + EXPECT_EQ(last_msg_->header.time.tow, 180) + << "incorrect value for header.time.tow, expected 180, is " + << last_msg_->header.time.tow; + EXPECT_EQ(last_msg_->header.time.wn, 3) + << "incorrect value for header.time.wn, expected 3, is " + << last_msg_->header.time.wn; + EXPECT_EQ(last_msg_->header.update_interval, 10) + << "incorrect value for header.update_interval, expected 10, is " + << last_msg_->header.update_interval; + EXPECT_EQ(last_msg_->n_sats, 2) + << "incorrect value for n_sats, expected 2, is " << last_msg_->n_sats; + EXPECT_EQ(last_msg_->ssr_iod_atmo, 15) + << "incorrect value for ssr_iod_atmo, expected 15, is " + << last_msg_->ssr_iod_atmo; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[0], 63) + << "incorrect value for stec_sat_list[0].stec_coeff[0], expected 63, is " + << last_msg_->stec_sat_list[0].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[1], 62) + << "incorrect value for stec_sat_list[0].stec_coeff[1], expected 62, is " + << last_msg_->stec_sat_list[0].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[2], 61) + << "incorrect value for stec_sat_list[0].stec_coeff[2], expected 61, is " + << last_msg_->stec_sat_list[0].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[3], 60) + << "incorrect value for stec_sat_list[0].stec_coeff[3], expected 60, is " + << last_msg_->stec_sat_list[0].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_quality_indicator, 1) + << "incorrect value for stec_sat_list[0].stec_quality_indicator, " + "expected 1, is " + << last_msg_->stec_sat_list[0].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[0].sv_id.constellation, 1) + << "incorrect value for stec_sat_list[0].sv_id.constellation, expected " + "1, is " + << last_msg_->stec_sat_list[0].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[0].sv_id.satId, 1) + << "incorrect value for stec_sat_list[0].sv_id.satId, expected 1, is " + << last_msg_->stec_sat_list[0].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[0], 63) + << "incorrect value for stec_sat_list[1].stec_coeff[0], expected 63, is " + << last_msg_->stec_sat_list[1].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[1], 64) + << "incorrect value for stec_sat_list[1].stec_coeff[1], expected 64, is " + << last_msg_->stec_sat_list[1].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[2], 65) + << "incorrect value for stec_sat_list[1].stec_coeff[2], expected 65, is " + << last_msg_->stec_sat_list[1].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[3], 66) + << "incorrect value for stec_sat_list[1].stec_coeff[3], expected 66, is " + << last_msg_->stec_sat_list[1].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_quality_indicator, 5) + << "incorrect value for stec_sat_list[1].stec_quality_indicator, " + "expected 5, is " + << last_msg_->stec_sat_list[1].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[1].sv_id.constellation, 15) + << "incorrect value for stec_sat_list[1].sv_id.constellation, expected " + "15, is " + << last_msg_->stec_sat_list[1].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[1].sv_id.satId, 31) + << "incorrect value for stec_sat_list[1].sv_id.satId, expected 31, is " + << last_msg_->stec_sat_list[1].sv_id.satId; + EXPECT_EQ(last_msg_->tile_id, 10) + << "incorrect value for tile_id, expected 10, is " << last_msg_->tile_id; + EXPECT_EQ(last_msg_->tile_set_id, 1) + << "incorrect value for tile_set_id, expected 1, is " + << last_msg_->tile_set_id; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.cc index fe7bb21a7..b59f33767 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDep.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDep.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_stec_correction_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_stec_correction_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,763 +82,1298 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_stec_correction_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep0, Test) -{ +}; - uint8_t encoded_frame[] = {85,251,5,204,151,245,158,228,114,117,50,158,156,42,119,156,157,112,47,60,132,40,70,87,235,83,177,198,3,14,8,70,12,44,53,181,90,174,247,150,58,172,247,179,119,176,125,4,177,229,113,14,77,153,185,23,53,222,187,146,250,91,212,215,14,107,250,94,107,33,91,234,0,213,139,95,179,50,21,74,174,169,61,86,91,142,51,108,9,38,225,146,101,73,139,56,117,82,37,213,108,205,93,18,19,195,33,202,87,206,178,125,188,119,56,69,150,150,76,3,131,18,73,208,72,232,8,250,203,178,170,163,252,86,49,247,178,166,56,31,10,119,213,241,212,164,1,162,42,18,124,169,121,158,26,56,23,142,125,40,120,67,45,126,235,110,23,12,241,88,69,239,252,57,93,44,201,216,173,242,178,17,5,223,169,192,3,77,107,2,144,233,14,88,32,209,1,17,123,155,41,183,244,158,82,53,103,14,202,185,35,181,21,118,254,250,50,184,50,31,45,56,163,177,126,217,79,171,239,237,188,238,112,201,118,141,18,163,103,35,63,21,82,129,18,117,85,190,79,210,215,227,177, }; +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDep0, Test) { + uint8_t encoded_frame[] = { + 85, 251, 5, 204, 151, 245, 158, 228, 114, 117, 50, 158, 156, 42, 119, + 156, 157, 112, 47, 60, 132, 40, 70, 87, 235, 83, 177, 198, 3, 14, + 8, 70, 12, 44, 53, 181, 90, 174, 247, 150, 58, 172, 247, 179, 119, + 176, 125, 4, 177, 229, 113, 14, 77, 153, 185, 23, 53, 222, 187, 146, + 250, 91, 212, 215, 14, 107, 250, 94, 107, 33, 91, 234, 0, 213, 139, + 95, 179, 50, 21, 74, 174, 169, 61, 86, 91, 142, 51, 108, 9, 38, + 225, 146, 101, 73, 139, 56, 117, 82, 37, 213, 108, 205, 93, 18, 19, + 195, 33, 202, 87, 206, 178, 125, 188, 119, 56, 69, 150, 150, 76, 3, + 131, 18, 73, 208, 72, 232, 8, 250, 203, 178, 170, 163, 252, 86, 49, + 247, 178, 166, 56, 31, 10, 119, 213, 241, 212, 164, 1, 162, 42, 18, + 124, 169, 121, 158, 26, 56, 23, 142, 125, 40, 120, 67, 45, 126, 235, + 110, 23, 12, 241, 88, 69, 239, 252, 57, 93, 44, 201, 216, 173, 242, + 178, 17, 5, 223, 169, 192, 3, 77, 107, 2, 144, 233, 14, 88, 32, + 209, 1, 17, 123, 155, 41, 183, 244, 158, 82, 53, 103, 14, 202, 185, + 35, 181, 21, 118, 254, 250, 50, 184, 50, 31, 45, 56, 163, 177, 126, + 217, 79, 171, 239, 237, 188, 238, 112, 201, 118, 141, 18, 163, 103, 35, + 63, 21, 82, 129, 18, 117, 85, 190, 79, 210, 215, 227, 177, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_stec_correction_dep_t* test_msg = ( msg_ssr_stec_correction_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.iod_atmo = 60; - test_msg->header.num_msgs = 157; - test_msg->header.seq_num = 112; - test_msg->header.tile_id = 30066; - test_msg->header.tile_set_id = 58526; - test_msg->header.time.tow = 714907186; - test_msg->header.time.wn = 40055; - test_msg->header.update_interval = 47; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); - } - test_msg->stec_sat_list[0].stec_coeff[0] = -5289; - if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); - } - test_msg->stec_sat_list[0].stec_coeff[1] = -20141; - if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); - } - test_msg->stec_sat_list[0].stec_coeff[2] = 966; - if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); - } - test_msg->stec_sat_list[0].stec_coeff[3] = 2062; - test_msg->stec_sat_list[0].stec_quality_indicator = 70; - test_msg->stec_sat_list[0].sv_id.constellation = 40; - test_msg->stec_sat_list[0].sv_id.satId = 132; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); - } - test_msg->stec_sat_list[1].stec_coeff[0] = -19147; - if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); - } - test_msg->stec_sat_list[1].stec_coeff[1] = -20902; - if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); - } - test_msg->stec_sat_list[1].stec_coeff[2] = -26889; - if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); - } - test_msg->stec_sat_list[1].stec_coeff[3] = -21446; - test_msg->stec_sat_list[1].stec_quality_indicator = 44; - test_msg->stec_sat_list[1].sv_id.constellation = 12; - test_msg->stec_sat_list[1].sv_id.satId = 70; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); - } - test_msg->stec_sat_list[2].stec_coeff[0] = 32176; - if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); - } - test_msg->stec_sat_list[2].stec_coeff[1] = -20220; - if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); - } - test_msg->stec_sat_list[2].stec_coeff[2] = 29157; - if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); - } - test_msg->stec_sat_list[2].stec_coeff[3] = 19726; - test_msg->stec_sat_list[2].stec_quality_indicator = 119; - test_msg->stec_sat_list[2].sv_id.constellation = 179; - test_msg->stec_sat_list[2].sv_id.satId = 247; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); - } - test_msg->stec_sat_list[3].stec_coeff[0] = -8651; - if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); - } - test_msg->stec_sat_list[3].stec_coeff[1] = -27973; - if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); - } - test_msg->stec_sat_list[3].stec_coeff[2] = 23546; - if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); - } - test_msg->stec_sat_list[3].stec_coeff[3] = -10284; - test_msg->stec_sat_list[3].stec_quality_indicator = 23; - test_msg->stec_sat_list[3].sv_id.constellation = 185; - test_msg->stec_sat_list[3].sv_id.satId = 153; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); - } - test_msg->stec_sat_list[4].stec_coeff[0] = 27486; - if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); - } - test_msg->stec_sat_list[4].stec_coeff[1] = 23329; - if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); - } - test_msg->stec_sat_list[4].stec_coeff[2] = 234; - if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); - } - test_msg->stec_sat_list[4].stec_coeff[3] = -29739; - test_msg->stec_sat_list[4].stec_quality_indicator = 250; - test_msg->stec_sat_list[4].sv_id.constellation = 107; - test_msg->stec_sat_list[4].sv_id.satId = 14; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); - } - test_msg->stec_sat_list[5].stec_coeff[0] = 18965; - if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); - } - test_msg->stec_sat_list[5].stec_coeff[1] = -22098; - if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); - } - test_msg->stec_sat_list[5].stec_coeff[2] = 22077; - if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); - } - test_msg->stec_sat_list[5].stec_coeff[3] = -29093; - test_msg->stec_sat_list[5].stec_quality_indicator = 50; - test_msg->stec_sat_list[5].sv_id.constellation = 179; - test_msg->stec_sat_list[5].sv_id.satId = 95; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); - } - test_msg->stec_sat_list[6].stec_coeff[0] = -7898; - if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); - } - test_msg->stec_sat_list[6].stec_coeff[1] = 26002; - if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); - } - test_msg->stec_sat_list[6].stec_coeff[2] = -29879; - if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); - } - test_msg->stec_sat_list[6].stec_coeff[3] = 30008; - test_msg->stec_sat_list[6].stec_quality_indicator = 9; - test_msg->stec_sat_list[6].sv_id.constellation = 108; - test_msg->stec_sat_list[6].sv_id.satId = 51; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); - } - test_msg->stec_sat_list[7].stec_coeff[0] = -12948; - if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); - } - test_msg->stec_sat_list[7].stec_coeff[1] = 4701; - if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); - } - test_msg->stec_sat_list[7].stec_coeff[2] = -15597; - if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); - } - test_msg->stec_sat_list[7].stec_coeff[3] = -13791; - test_msg->stec_sat_list[7].stec_quality_indicator = 213; - test_msg->stec_sat_list[7].sv_id.constellation = 37; - test_msg->stec_sat_list[7].sv_id.satId = 82; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); - } - test_msg->stec_sat_list[8].stec_coeff[0] = -17283; - if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); - } - test_msg->stec_sat_list[8].stec_coeff[1] = 14455; - if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); - } - test_msg->stec_sat_list[8].stec_coeff[2] = -27067; - if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); - } - test_msg->stec_sat_list[8].stec_coeff[3] = 19606; - test_msg->stec_sat_list[8].stec_quality_indicator = 178; - test_msg->stec_sat_list[8].sv_id.constellation = 206; - test_msg->stec_sat_list[8].sv_id.satId = 87; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); - } - test_msg->stec_sat_list[9].stec_coeff[0] = -12215; - if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); - } - test_msg->stec_sat_list[9].stec_coeff[1] = -6072; - if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); - } - test_msg->stec_sat_list[9].stec_coeff[2] = -1528; - if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); - } - test_msg->stec_sat_list[9].stec_coeff[3] = -19765; - test_msg->stec_sat_list[9].stec_quality_indicator = 18; - test_msg->stec_sat_list[9].sv_id.constellation = 131; - test_msg->stec_sat_list[9].sv_id.satId = 3; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); - } - test_msg->stec_sat_list[10].stec_coeff[0] = 12630; - if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); - } - test_msg->stec_sat_list[10].stec_coeff[1] = -19721; - if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); - } - test_msg->stec_sat_list[10].stec_coeff[2] = 14502; - if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); - } - test_msg->stec_sat_list[10].stec_coeff[3] = 2591; - test_msg->stec_sat_list[10].stec_quality_indicator = 252; - test_msg->stec_sat_list[10].sv_id.constellation = 163; - test_msg->stec_sat_list[10].sv_id.satId = 170; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); - } - test_msg->stec_sat_list[11].stec_coeff[0] = -23340; - if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); - } - test_msg->stec_sat_list[11].stec_coeff[1] = -24063; - if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); - } - test_msg->stec_sat_list[11].stec_coeff[2] = 4650; - if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); - } - test_msg->stec_sat_list[11].stec_coeff[3] = -22148; - test_msg->stec_sat_list[11].stec_quality_indicator = 241; - test_msg->stec_sat_list[11].sv_id.constellation = 213; - test_msg->stec_sat_list[11].sv_id.satId = 119; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); - } - test_msg->stec_sat_list[12].stec_coeff[0] = 5944; - if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); - } - test_msg->stec_sat_list[12].stec_coeff[1] = 32142; - if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); - } - test_msg->stec_sat_list[12].stec_coeff[2] = 30760; - if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); - } - test_msg->stec_sat_list[12].stec_coeff[3] = 11587; - test_msg->stec_sat_list[12].stec_quality_indicator = 26; - test_msg->stec_sat_list[12].sv_id.constellation = 158; - test_msg->stec_sat_list[12].sv_id.satId = 121; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); - } - test_msg->stec_sat_list[13].stec_coeff[0] = 3095; - if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); - } - test_msg->stec_sat_list[13].stec_coeff[1] = 22769; - if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); - } - test_msg->stec_sat_list[13].stec_coeff[2] = -4283; - if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); - } - test_msg->stec_sat_list[13].stec_coeff[3] = 14844; - test_msg->stec_sat_list[13].stec_quality_indicator = 110; - test_msg->stec_sat_list[13].sv_id.constellation = 235; - test_msg->stec_sat_list[13].sv_id.satId = 126; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); - } - test_msg->stec_sat_list[14].stec_coeff[0] = -21032; - if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); - } - test_msg->stec_sat_list[14].stec_coeff[1] = -19726; - if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); - } - test_msg->stec_sat_list[14].stec_coeff[2] = 1297; - if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); - } - test_msg->stec_sat_list[14].stec_coeff[3] = -22049; - test_msg->stec_sat_list[14].stec_quality_indicator = 201; - test_msg->stec_sat_list[14].sv_id.constellation = 44; - test_msg->stec_sat_list[14].sv_id.satId = 93; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); - } - test_msg->stec_sat_list[15].stec_coeff[0] = 619; - if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); - } - test_msg->stec_sat_list[15].stec_coeff[1] = -5744; - if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); - } - test_msg->stec_sat_list[15].stec_coeff[2] = 22542; - if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); - } - test_msg->stec_sat_list[15].stec_coeff[3] = -12000; - test_msg->stec_sat_list[15].stec_quality_indicator = 77; - test_msg->stec_sat_list[15].sv_id.constellation = 3; - test_msg->stec_sat_list[15].sv_id.satId = 192; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); - } - test_msg->stec_sat_list[16].stec_coeff[0] = 10651; - if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); - } - test_msg->stec_sat_list[16].stec_coeff[1] = -2889; - if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); - } - test_msg->stec_sat_list[16].stec_coeff[2] = 21150; - if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); - } - test_msg->stec_sat_list[16].stec_coeff[3] = 26421; - test_msg->stec_sat_list[16].stec_quality_indicator = 123; - test_msg->stec_sat_list[16].sv_id.constellation = 17; - test_msg->stec_sat_list[16].sv_id.satId = 1; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); - } - test_msg->stec_sat_list[17].stec_coeff[0] = -19165; - if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); - } - test_msg->stec_sat_list[17].stec_coeff[1] = 30229; - if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); - } - test_msg->stec_sat_list[17].stec_coeff[2] = -1282; - if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); - } - test_msg->stec_sat_list[17].stec_coeff[3] = -18382; - test_msg->stec_sat_list[17].stec_quality_indicator = 185; - test_msg->stec_sat_list[17].sv_id.constellation = 202; - test_msg->stec_sat_list[17].sv_id.satId = 14; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); - } - test_msg->stec_sat_list[18].stec_coeff[0] = -23752; - if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); - } - test_msg->stec_sat_list[18].stec_coeff[1] = 32433; - if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); - } - test_msg->stec_sat_list[18].stec_coeff[2] = 20441; - if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); - } - test_msg->stec_sat_list[18].stec_coeff[3] = -4181; - test_msg->stec_sat_list[18].stec_quality_indicator = 45; - test_msg->stec_sat_list[18].sv_id.constellation = 31; - test_msg->stec_sat_list[18].sv_id.satId = 50; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); - } - test_msg->stec_sat_list[19].stec_coeff[0] = -13968; - if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); - } - test_msg->stec_sat_list[19].stec_coeff[1] = -29322; - if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); - } - test_msg->stec_sat_list[19].stec_coeff[2] = -23790; - if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); - } - test_msg->stec_sat_list[19].stec_coeff[3] = 9063; - test_msg->stec_sat_list[19].stec_quality_indicator = 238; - test_msg->stec_sat_list[19].sv_id.constellation = 188; - test_msg->stec_sat_list[19].sv_id.satId = 237; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); - } - test_msg->stec_sat_list[20].stec_coeff[0] = 4737; - if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); - } - test_msg->stec_sat_list[20].stec_coeff[1] = 21877; - if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); - } - test_msg->stec_sat_list[20].stec_coeff[2] = 20414; - if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); - } - test_msg->stec_sat_list[20].stec_coeff[3] = -10286; - test_msg->stec_sat_list[20].stec_quality_indicator = 82; - test_msg->stec_sat_list[20].sv_id.constellation = 21; - test_msg->stec_sat_list[20].sv_id.satId = 63; - - EXPECT_EQ(send_message( 0x5fb, 38860, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_stec_correction_dep_t *test_msg = + (msg_ssr_stec_correction_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.iod_atmo = 60; + test_msg->header.num_msgs = 157; + test_msg->header.seq_num = 112; + test_msg->header.tile_id = 30066; + test_msg->header.tile_set_id = 58526; + test_msg->header.time.tow = 714907186; + test_msg->header.time.wn = 40055; + test_msg->header.update_interval = 47; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); + } + test_msg->stec_sat_list[0].stec_coeff[0] = -5289; + if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); + } + test_msg->stec_sat_list[0].stec_coeff[1] = -20141; + if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); + } + test_msg->stec_sat_list[0].stec_coeff[2] = 966; + if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); + } + test_msg->stec_sat_list[0].stec_coeff[3] = 2062; + test_msg->stec_sat_list[0].stec_quality_indicator = 70; + test_msg->stec_sat_list[0].sv_id.constellation = 40; + test_msg->stec_sat_list[0].sv_id.satId = 132; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); + } + test_msg->stec_sat_list[1].stec_coeff[0] = -19147; + if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); + } + test_msg->stec_sat_list[1].stec_coeff[1] = -20902; + if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); + } + test_msg->stec_sat_list[1].stec_coeff[2] = -26889; + if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); + } + test_msg->stec_sat_list[1].stec_coeff[3] = -21446; + test_msg->stec_sat_list[1].stec_quality_indicator = 44; + test_msg->stec_sat_list[1].sv_id.constellation = 12; + test_msg->stec_sat_list[1].sv_id.satId = 70; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); + } + test_msg->stec_sat_list[2].stec_coeff[0] = 32176; + if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); + } + test_msg->stec_sat_list[2].stec_coeff[1] = -20220; + if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); + } + test_msg->stec_sat_list[2].stec_coeff[2] = 29157; + if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); + } + test_msg->stec_sat_list[2].stec_coeff[3] = 19726; + test_msg->stec_sat_list[2].stec_quality_indicator = 119; + test_msg->stec_sat_list[2].sv_id.constellation = 179; + test_msg->stec_sat_list[2].sv_id.satId = 247; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); + } + test_msg->stec_sat_list[3].stec_coeff[0] = -8651; + if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); + } + test_msg->stec_sat_list[3].stec_coeff[1] = -27973; + if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); + } + test_msg->stec_sat_list[3].stec_coeff[2] = 23546; + if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); + } + test_msg->stec_sat_list[3].stec_coeff[3] = -10284; + test_msg->stec_sat_list[3].stec_quality_indicator = 23; + test_msg->stec_sat_list[3].sv_id.constellation = 185; + test_msg->stec_sat_list[3].sv_id.satId = 153; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); + } + test_msg->stec_sat_list[4].stec_coeff[0] = 27486; + if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); + } + test_msg->stec_sat_list[4].stec_coeff[1] = 23329; + if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); + } + test_msg->stec_sat_list[4].stec_coeff[2] = 234; + if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); + } + test_msg->stec_sat_list[4].stec_coeff[3] = -29739; + test_msg->stec_sat_list[4].stec_quality_indicator = 250; + test_msg->stec_sat_list[4].sv_id.constellation = 107; + test_msg->stec_sat_list[4].sv_id.satId = 14; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); + } + test_msg->stec_sat_list[5].stec_coeff[0] = 18965; + if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); + } + test_msg->stec_sat_list[5].stec_coeff[1] = -22098; + if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); + } + test_msg->stec_sat_list[5].stec_coeff[2] = 22077; + if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); + } + test_msg->stec_sat_list[5].stec_coeff[3] = -29093; + test_msg->stec_sat_list[5].stec_quality_indicator = 50; + test_msg->stec_sat_list[5].sv_id.constellation = 179; + test_msg->stec_sat_list[5].sv_id.satId = 95; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); + } + test_msg->stec_sat_list[6].stec_coeff[0] = -7898; + if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); + } + test_msg->stec_sat_list[6].stec_coeff[1] = 26002; + if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); + } + test_msg->stec_sat_list[6].stec_coeff[2] = -29879; + if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); + } + test_msg->stec_sat_list[6].stec_coeff[3] = 30008; + test_msg->stec_sat_list[6].stec_quality_indicator = 9; + test_msg->stec_sat_list[6].sv_id.constellation = 108; + test_msg->stec_sat_list[6].sv_id.satId = 51; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); + } + test_msg->stec_sat_list[7].stec_coeff[0] = -12948; + if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); + } + test_msg->stec_sat_list[7].stec_coeff[1] = 4701; + if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); + } + test_msg->stec_sat_list[7].stec_coeff[2] = -15597; + if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); + } + test_msg->stec_sat_list[7].stec_coeff[3] = -13791; + test_msg->stec_sat_list[7].stec_quality_indicator = 213; + test_msg->stec_sat_list[7].sv_id.constellation = 37; + test_msg->stec_sat_list[7].sv_id.satId = 82; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); + } + test_msg->stec_sat_list[8].stec_coeff[0] = -17283; + if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); + } + test_msg->stec_sat_list[8].stec_coeff[1] = 14455; + if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); + } + test_msg->stec_sat_list[8].stec_coeff[2] = -27067; + if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); + } + test_msg->stec_sat_list[8].stec_coeff[3] = 19606; + test_msg->stec_sat_list[8].stec_quality_indicator = 178; + test_msg->stec_sat_list[8].sv_id.constellation = 206; + test_msg->stec_sat_list[8].sv_id.satId = 87; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); + } + test_msg->stec_sat_list[9].stec_coeff[0] = -12215; + if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); + } + test_msg->stec_sat_list[9].stec_coeff[1] = -6072; + if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); + } + test_msg->stec_sat_list[9].stec_coeff[2] = -1528; + if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); + } + test_msg->stec_sat_list[9].stec_coeff[3] = -19765; + test_msg->stec_sat_list[9].stec_quality_indicator = 18; + test_msg->stec_sat_list[9].sv_id.constellation = 131; + test_msg->stec_sat_list[9].sv_id.satId = 3; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); + } + test_msg->stec_sat_list[10].stec_coeff[0] = 12630; + if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); + } + test_msg->stec_sat_list[10].stec_coeff[1] = -19721; + if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); + } + test_msg->stec_sat_list[10].stec_coeff[2] = 14502; + if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); + } + test_msg->stec_sat_list[10].stec_coeff[3] = 2591; + test_msg->stec_sat_list[10].stec_quality_indicator = 252; + test_msg->stec_sat_list[10].sv_id.constellation = 163; + test_msg->stec_sat_list[10].sv_id.satId = 170; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); + } + test_msg->stec_sat_list[11].stec_coeff[0] = -23340; + if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); + } + test_msg->stec_sat_list[11].stec_coeff[1] = -24063; + if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); + } + test_msg->stec_sat_list[11].stec_coeff[2] = 4650; + if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); + } + test_msg->stec_sat_list[11].stec_coeff[3] = -22148; + test_msg->stec_sat_list[11].stec_quality_indicator = 241; + test_msg->stec_sat_list[11].sv_id.constellation = 213; + test_msg->stec_sat_list[11].sv_id.satId = 119; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); + } + test_msg->stec_sat_list[12].stec_coeff[0] = 5944; + if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); + } + test_msg->stec_sat_list[12].stec_coeff[1] = 32142; + if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); + } + test_msg->stec_sat_list[12].stec_coeff[2] = 30760; + if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); + } + test_msg->stec_sat_list[12].stec_coeff[3] = 11587; + test_msg->stec_sat_list[12].stec_quality_indicator = 26; + test_msg->stec_sat_list[12].sv_id.constellation = 158; + test_msg->stec_sat_list[12].sv_id.satId = 121; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); + } + test_msg->stec_sat_list[13].stec_coeff[0] = 3095; + if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); + } + test_msg->stec_sat_list[13].stec_coeff[1] = 22769; + if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); + } + test_msg->stec_sat_list[13].stec_coeff[2] = -4283; + if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); + } + test_msg->stec_sat_list[13].stec_coeff[3] = 14844; + test_msg->stec_sat_list[13].stec_quality_indicator = 110; + test_msg->stec_sat_list[13].sv_id.constellation = 235; + test_msg->stec_sat_list[13].sv_id.satId = 126; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); + } + test_msg->stec_sat_list[14].stec_coeff[0] = -21032; + if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); + } + test_msg->stec_sat_list[14].stec_coeff[1] = -19726; + if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); + } + test_msg->stec_sat_list[14].stec_coeff[2] = 1297; + if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); + } + test_msg->stec_sat_list[14].stec_coeff[3] = -22049; + test_msg->stec_sat_list[14].stec_quality_indicator = 201; + test_msg->stec_sat_list[14].sv_id.constellation = 44; + test_msg->stec_sat_list[14].sv_id.satId = 93; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); + } + test_msg->stec_sat_list[15].stec_coeff[0] = 619; + if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); + } + test_msg->stec_sat_list[15].stec_coeff[1] = -5744; + if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); + } + test_msg->stec_sat_list[15].stec_coeff[2] = 22542; + if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); + } + test_msg->stec_sat_list[15].stec_coeff[3] = -12000; + test_msg->stec_sat_list[15].stec_quality_indicator = 77; + test_msg->stec_sat_list[15].sv_id.constellation = 3; + test_msg->stec_sat_list[15].sv_id.satId = 192; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); + } + test_msg->stec_sat_list[16].stec_coeff[0] = 10651; + if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); + } + test_msg->stec_sat_list[16].stec_coeff[1] = -2889; + if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); + } + test_msg->stec_sat_list[16].stec_coeff[2] = 21150; + if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); + } + test_msg->stec_sat_list[16].stec_coeff[3] = 26421; + test_msg->stec_sat_list[16].stec_quality_indicator = 123; + test_msg->stec_sat_list[16].sv_id.constellation = 17; + test_msg->stec_sat_list[16].sv_id.satId = 1; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); + } + test_msg->stec_sat_list[17].stec_coeff[0] = -19165; + if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); + } + test_msg->stec_sat_list[17].stec_coeff[1] = 30229; + if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); + } + test_msg->stec_sat_list[17].stec_coeff[2] = -1282; + if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); + } + test_msg->stec_sat_list[17].stec_coeff[3] = -18382; + test_msg->stec_sat_list[17].stec_quality_indicator = 185; + test_msg->stec_sat_list[17].sv_id.constellation = 202; + test_msg->stec_sat_list[17].sv_id.satId = 14; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); + } + test_msg->stec_sat_list[18].stec_coeff[0] = -23752; + if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); + } + test_msg->stec_sat_list[18].stec_coeff[1] = 32433; + if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); + } + test_msg->stec_sat_list[18].stec_coeff[2] = 20441; + if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); + } + test_msg->stec_sat_list[18].stec_coeff[3] = -4181; + test_msg->stec_sat_list[18].stec_quality_indicator = 45; + test_msg->stec_sat_list[18].sv_id.constellation = 31; + test_msg->stec_sat_list[18].sv_id.satId = 50; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); + } + test_msg->stec_sat_list[19].stec_coeff[0] = -13968; + if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); + } + test_msg->stec_sat_list[19].stec_coeff[1] = -29322; + if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); + } + test_msg->stec_sat_list[19].stec_coeff[2] = -23790; + if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); + } + test_msg->stec_sat_list[19].stec_coeff[3] = 9063; + test_msg->stec_sat_list[19].stec_quality_indicator = 238; + test_msg->stec_sat_list[19].sv_id.constellation = 188; + test_msg->stec_sat_list[19].sv_id.satId = 237; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); + } + test_msg->stec_sat_list[20].stec_coeff[0] = 4737; + if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); + } + test_msg->stec_sat_list[20].stec_coeff[1] = 21877; + if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); + } + test_msg->stec_sat_list[20].stec_coeff[2] = 20414; + if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); + } + test_msg->stec_sat_list[20].stec_coeff[3] = -10286; + test_msg->stec_sat_list[20].stec_quality_indicator = 82; + test_msg->stec_sat_list[20].sv_id.constellation = 21; + test_msg->stec_sat_list[20].sv_id.satId = 63; + + EXPECT_EQ(send_message(0x5fb, 38860, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 38860); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.iod_atmo, 60) << "incorrect value for header.iod_atmo, expected 60, is " << last_msg_->header.iod_atmo; - EXPECT_EQ(last_msg_->header.num_msgs, 157) << "incorrect value for header.num_msgs, expected 157, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.seq_num, 112) << "incorrect value for header.seq_num, expected 112, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->header.tile_id, 30066) << "incorrect value for header.tile_id, expected 30066, is " << last_msg_->header.tile_id; - EXPECT_EQ(last_msg_->header.tile_set_id, 58526) << "incorrect value for header.tile_set_id, expected 58526, is " << last_msg_->header.tile_set_id; - EXPECT_EQ(last_msg_->header.time.tow, 714907186) << "incorrect value for header.time.tow, expected 714907186, is " << last_msg_->header.time.tow; - EXPECT_EQ(last_msg_->header.time.wn, 40055) << "incorrect value for header.time.wn, expected 40055, is " << last_msg_->header.time.wn; - EXPECT_EQ(last_msg_->header.update_interval, 47) << "incorrect value for header.update_interval, expected 47, is " << last_msg_->header.update_interval; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[0], -5289) << "incorrect value for stec_sat_list[0].stec_coeff[0], expected -5289, is " << last_msg_->stec_sat_list[0].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[1], -20141) << "incorrect value for stec_sat_list[0].stec_coeff[1], expected -20141, is " << last_msg_->stec_sat_list[0].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[2], 966) << "incorrect value for stec_sat_list[0].stec_coeff[2], expected 966, is " << last_msg_->stec_sat_list[0].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[3], 2062) << "incorrect value for stec_sat_list[0].stec_coeff[3], expected 2062, is " << last_msg_->stec_sat_list[0].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_quality_indicator, 70) << "incorrect value for stec_sat_list[0].stec_quality_indicator, expected 70, is " << last_msg_->stec_sat_list[0].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[0].sv_id.constellation, 40) << "incorrect value for stec_sat_list[0].sv_id.constellation, expected 40, is " << last_msg_->stec_sat_list[0].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[0].sv_id.satId, 132) << "incorrect value for stec_sat_list[0].sv_id.satId, expected 132, is " << last_msg_->stec_sat_list[0].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[0], -19147) << "incorrect value for stec_sat_list[1].stec_coeff[0], expected -19147, is " << last_msg_->stec_sat_list[1].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[1], -20902) << "incorrect value for stec_sat_list[1].stec_coeff[1], expected -20902, is " << last_msg_->stec_sat_list[1].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[2], -26889) << "incorrect value for stec_sat_list[1].stec_coeff[2], expected -26889, is " << last_msg_->stec_sat_list[1].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[3], -21446) << "incorrect value for stec_sat_list[1].stec_coeff[3], expected -21446, is " << last_msg_->stec_sat_list[1].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_quality_indicator, 44) << "incorrect value for stec_sat_list[1].stec_quality_indicator, expected 44, is " << last_msg_->stec_sat_list[1].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[1].sv_id.constellation, 12) << "incorrect value for stec_sat_list[1].sv_id.constellation, expected 12, is " << last_msg_->stec_sat_list[1].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[1].sv_id.satId, 70) << "incorrect value for stec_sat_list[1].sv_id.satId, expected 70, is " << last_msg_->stec_sat_list[1].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[0], 32176) << "incorrect value for stec_sat_list[2].stec_coeff[0], expected 32176, is " << last_msg_->stec_sat_list[2].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[1], -20220) << "incorrect value for stec_sat_list[2].stec_coeff[1], expected -20220, is " << last_msg_->stec_sat_list[2].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[2], 29157) << "incorrect value for stec_sat_list[2].stec_coeff[2], expected 29157, is " << last_msg_->stec_sat_list[2].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[3], 19726) << "incorrect value for stec_sat_list[2].stec_coeff[3], expected 19726, is " << last_msg_->stec_sat_list[2].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[2].stec_quality_indicator, 119) << "incorrect value for stec_sat_list[2].stec_quality_indicator, expected 119, is " << last_msg_->stec_sat_list[2].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[2].sv_id.constellation, 179) << "incorrect value for stec_sat_list[2].sv_id.constellation, expected 179, is " << last_msg_->stec_sat_list[2].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[2].sv_id.satId, 247) << "incorrect value for stec_sat_list[2].sv_id.satId, expected 247, is " << last_msg_->stec_sat_list[2].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[0], -8651) << "incorrect value for stec_sat_list[3].stec_coeff[0], expected -8651, is " << last_msg_->stec_sat_list[3].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[1], -27973) << "incorrect value for stec_sat_list[3].stec_coeff[1], expected -27973, is " << last_msg_->stec_sat_list[3].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[2], 23546) << "incorrect value for stec_sat_list[3].stec_coeff[2], expected 23546, is " << last_msg_->stec_sat_list[3].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[3], -10284) << "incorrect value for stec_sat_list[3].stec_coeff[3], expected -10284, is " << last_msg_->stec_sat_list[3].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[3].stec_quality_indicator, 23) << "incorrect value for stec_sat_list[3].stec_quality_indicator, expected 23, is " << last_msg_->stec_sat_list[3].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[3].sv_id.constellation, 185) << "incorrect value for stec_sat_list[3].sv_id.constellation, expected 185, is " << last_msg_->stec_sat_list[3].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[3].sv_id.satId, 153) << "incorrect value for stec_sat_list[3].sv_id.satId, expected 153, is " << last_msg_->stec_sat_list[3].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[0], 27486) << "incorrect value for stec_sat_list[4].stec_coeff[0], expected 27486, is " << last_msg_->stec_sat_list[4].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[1], 23329) << "incorrect value for stec_sat_list[4].stec_coeff[1], expected 23329, is " << last_msg_->stec_sat_list[4].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[2], 234) << "incorrect value for stec_sat_list[4].stec_coeff[2], expected 234, is " << last_msg_->stec_sat_list[4].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[3], -29739) << "incorrect value for stec_sat_list[4].stec_coeff[3], expected -29739, is " << last_msg_->stec_sat_list[4].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[4].stec_quality_indicator, 250) << "incorrect value for stec_sat_list[4].stec_quality_indicator, expected 250, is " << last_msg_->stec_sat_list[4].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[4].sv_id.constellation, 107) << "incorrect value for stec_sat_list[4].sv_id.constellation, expected 107, is " << last_msg_->stec_sat_list[4].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[4].sv_id.satId, 14) << "incorrect value for stec_sat_list[4].sv_id.satId, expected 14, is " << last_msg_->stec_sat_list[4].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[0], 18965) << "incorrect value for stec_sat_list[5].stec_coeff[0], expected 18965, is " << last_msg_->stec_sat_list[5].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[1], -22098) << "incorrect value for stec_sat_list[5].stec_coeff[1], expected -22098, is " << last_msg_->stec_sat_list[5].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[2], 22077) << "incorrect value for stec_sat_list[5].stec_coeff[2], expected 22077, is " << last_msg_->stec_sat_list[5].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[3], -29093) << "incorrect value for stec_sat_list[5].stec_coeff[3], expected -29093, is " << last_msg_->stec_sat_list[5].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[5].stec_quality_indicator, 50) << "incorrect value for stec_sat_list[5].stec_quality_indicator, expected 50, is " << last_msg_->stec_sat_list[5].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[5].sv_id.constellation, 179) << "incorrect value for stec_sat_list[5].sv_id.constellation, expected 179, is " << last_msg_->stec_sat_list[5].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[5].sv_id.satId, 95) << "incorrect value for stec_sat_list[5].sv_id.satId, expected 95, is " << last_msg_->stec_sat_list[5].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[0], -7898) << "incorrect value for stec_sat_list[6].stec_coeff[0], expected -7898, is " << last_msg_->stec_sat_list[6].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[1], 26002) << "incorrect value for stec_sat_list[6].stec_coeff[1], expected 26002, is " << last_msg_->stec_sat_list[6].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[2], -29879) << "incorrect value for stec_sat_list[6].stec_coeff[2], expected -29879, is " << last_msg_->stec_sat_list[6].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[3], 30008) << "incorrect value for stec_sat_list[6].stec_coeff[3], expected 30008, is " << last_msg_->stec_sat_list[6].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[6].stec_quality_indicator, 9) << "incorrect value for stec_sat_list[6].stec_quality_indicator, expected 9, is " << last_msg_->stec_sat_list[6].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[6].sv_id.constellation, 108) << "incorrect value for stec_sat_list[6].sv_id.constellation, expected 108, is " << last_msg_->stec_sat_list[6].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[6].sv_id.satId, 51) << "incorrect value for stec_sat_list[6].sv_id.satId, expected 51, is " << last_msg_->stec_sat_list[6].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[0], -12948) << "incorrect value for stec_sat_list[7].stec_coeff[0], expected -12948, is " << last_msg_->stec_sat_list[7].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[1], 4701) << "incorrect value for stec_sat_list[7].stec_coeff[1], expected 4701, is " << last_msg_->stec_sat_list[7].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[2], -15597) << "incorrect value for stec_sat_list[7].stec_coeff[2], expected -15597, is " << last_msg_->stec_sat_list[7].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[3], -13791) << "incorrect value for stec_sat_list[7].stec_coeff[3], expected -13791, is " << last_msg_->stec_sat_list[7].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[7].stec_quality_indicator, 213) << "incorrect value for stec_sat_list[7].stec_quality_indicator, expected 213, is " << last_msg_->stec_sat_list[7].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[7].sv_id.constellation, 37) << "incorrect value for stec_sat_list[7].sv_id.constellation, expected 37, is " << last_msg_->stec_sat_list[7].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[7].sv_id.satId, 82) << "incorrect value for stec_sat_list[7].sv_id.satId, expected 82, is " << last_msg_->stec_sat_list[7].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[0], -17283) << "incorrect value for stec_sat_list[8].stec_coeff[0], expected -17283, is " << last_msg_->stec_sat_list[8].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[1], 14455) << "incorrect value for stec_sat_list[8].stec_coeff[1], expected 14455, is " << last_msg_->stec_sat_list[8].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[2], -27067) << "incorrect value for stec_sat_list[8].stec_coeff[2], expected -27067, is " << last_msg_->stec_sat_list[8].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[3], 19606) << "incorrect value for stec_sat_list[8].stec_coeff[3], expected 19606, is " << last_msg_->stec_sat_list[8].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[8].stec_quality_indicator, 178) << "incorrect value for stec_sat_list[8].stec_quality_indicator, expected 178, is " << last_msg_->stec_sat_list[8].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[8].sv_id.constellation, 206) << "incorrect value for stec_sat_list[8].sv_id.constellation, expected 206, is " << last_msg_->stec_sat_list[8].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[8].sv_id.satId, 87) << "incorrect value for stec_sat_list[8].sv_id.satId, expected 87, is " << last_msg_->stec_sat_list[8].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[0], -12215) << "incorrect value for stec_sat_list[9].stec_coeff[0], expected -12215, is " << last_msg_->stec_sat_list[9].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[1], -6072) << "incorrect value for stec_sat_list[9].stec_coeff[1], expected -6072, is " << last_msg_->stec_sat_list[9].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[2], -1528) << "incorrect value for stec_sat_list[9].stec_coeff[2], expected -1528, is " << last_msg_->stec_sat_list[9].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[3], -19765) << "incorrect value for stec_sat_list[9].stec_coeff[3], expected -19765, is " << last_msg_->stec_sat_list[9].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[9].stec_quality_indicator, 18) << "incorrect value for stec_sat_list[9].stec_quality_indicator, expected 18, is " << last_msg_->stec_sat_list[9].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[9].sv_id.constellation, 131) << "incorrect value for stec_sat_list[9].sv_id.constellation, expected 131, is " << last_msg_->stec_sat_list[9].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[9].sv_id.satId, 3) << "incorrect value for stec_sat_list[9].sv_id.satId, expected 3, is " << last_msg_->stec_sat_list[9].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[0], 12630) << "incorrect value for stec_sat_list[10].stec_coeff[0], expected 12630, is " << last_msg_->stec_sat_list[10].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[1], -19721) << "incorrect value for stec_sat_list[10].stec_coeff[1], expected -19721, is " << last_msg_->stec_sat_list[10].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[2], 14502) << "incorrect value for stec_sat_list[10].stec_coeff[2], expected 14502, is " << last_msg_->stec_sat_list[10].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[3], 2591) << "incorrect value for stec_sat_list[10].stec_coeff[3], expected 2591, is " << last_msg_->stec_sat_list[10].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[10].stec_quality_indicator, 252) << "incorrect value for stec_sat_list[10].stec_quality_indicator, expected 252, is " << last_msg_->stec_sat_list[10].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[10].sv_id.constellation, 163) << "incorrect value for stec_sat_list[10].sv_id.constellation, expected 163, is " << last_msg_->stec_sat_list[10].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[10].sv_id.satId, 170) << "incorrect value for stec_sat_list[10].sv_id.satId, expected 170, is " << last_msg_->stec_sat_list[10].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[0], -23340) << "incorrect value for stec_sat_list[11].stec_coeff[0], expected -23340, is " << last_msg_->stec_sat_list[11].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[1], -24063) << "incorrect value for stec_sat_list[11].stec_coeff[1], expected -24063, is " << last_msg_->stec_sat_list[11].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[2], 4650) << "incorrect value for stec_sat_list[11].stec_coeff[2], expected 4650, is " << last_msg_->stec_sat_list[11].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[3], -22148) << "incorrect value for stec_sat_list[11].stec_coeff[3], expected -22148, is " << last_msg_->stec_sat_list[11].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[11].stec_quality_indicator, 241) << "incorrect value for stec_sat_list[11].stec_quality_indicator, expected 241, is " << last_msg_->stec_sat_list[11].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[11].sv_id.constellation, 213) << "incorrect value for stec_sat_list[11].sv_id.constellation, expected 213, is " << last_msg_->stec_sat_list[11].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[11].sv_id.satId, 119) << "incorrect value for stec_sat_list[11].sv_id.satId, expected 119, is " << last_msg_->stec_sat_list[11].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[0], 5944) << "incorrect value for stec_sat_list[12].stec_coeff[0], expected 5944, is " << last_msg_->stec_sat_list[12].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[1], 32142) << "incorrect value for stec_sat_list[12].stec_coeff[1], expected 32142, is " << last_msg_->stec_sat_list[12].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[2], 30760) << "incorrect value for stec_sat_list[12].stec_coeff[2], expected 30760, is " << last_msg_->stec_sat_list[12].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[3], 11587) << "incorrect value for stec_sat_list[12].stec_coeff[3], expected 11587, is " << last_msg_->stec_sat_list[12].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[12].stec_quality_indicator, 26) << "incorrect value for stec_sat_list[12].stec_quality_indicator, expected 26, is " << last_msg_->stec_sat_list[12].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[12].sv_id.constellation, 158) << "incorrect value for stec_sat_list[12].sv_id.constellation, expected 158, is " << last_msg_->stec_sat_list[12].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[12].sv_id.satId, 121) << "incorrect value for stec_sat_list[12].sv_id.satId, expected 121, is " << last_msg_->stec_sat_list[12].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[0], 3095) << "incorrect value for stec_sat_list[13].stec_coeff[0], expected 3095, is " << last_msg_->stec_sat_list[13].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[1], 22769) << "incorrect value for stec_sat_list[13].stec_coeff[1], expected 22769, is " << last_msg_->stec_sat_list[13].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[2], -4283) << "incorrect value for stec_sat_list[13].stec_coeff[2], expected -4283, is " << last_msg_->stec_sat_list[13].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[3], 14844) << "incorrect value for stec_sat_list[13].stec_coeff[3], expected 14844, is " << last_msg_->stec_sat_list[13].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[13].stec_quality_indicator, 110) << "incorrect value for stec_sat_list[13].stec_quality_indicator, expected 110, is " << last_msg_->stec_sat_list[13].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[13].sv_id.constellation, 235) << "incorrect value for stec_sat_list[13].sv_id.constellation, expected 235, is " << last_msg_->stec_sat_list[13].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[13].sv_id.satId, 126) << "incorrect value for stec_sat_list[13].sv_id.satId, expected 126, is " << last_msg_->stec_sat_list[13].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[0], -21032) << "incorrect value for stec_sat_list[14].stec_coeff[0], expected -21032, is " << last_msg_->stec_sat_list[14].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[1], -19726) << "incorrect value for stec_sat_list[14].stec_coeff[1], expected -19726, is " << last_msg_->stec_sat_list[14].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[2], 1297) << "incorrect value for stec_sat_list[14].stec_coeff[2], expected 1297, is " << last_msg_->stec_sat_list[14].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[3], -22049) << "incorrect value for stec_sat_list[14].stec_coeff[3], expected -22049, is " << last_msg_->stec_sat_list[14].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[14].stec_quality_indicator, 201) << "incorrect value for stec_sat_list[14].stec_quality_indicator, expected 201, is " << last_msg_->stec_sat_list[14].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[14].sv_id.constellation, 44) << "incorrect value for stec_sat_list[14].sv_id.constellation, expected 44, is " << last_msg_->stec_sat_list[14].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[14].sv_id.satId, 93) << "incorrect value for stec_sat_list[14].sv_id.satId, expected 93, is " << last_msg_->stec_sat_list[14].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[0], 619) << "incorrect value for stec_sat_list[15].stec_coeff[0], expected 619, is " << last_msg_->stec_sat_list[15].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[1], -5744) << "incorrect value for stec_sat_list[15].stec_coeff[1], expected -5744, is " << last_msg_->stec_sat_list[15].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[2], 22542) << "incorrect value for stec_sat_list[15].stec_coeff[2], expected 22542, is " << last_msg_->stec_sat_list[15].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[3], -12000) << "incorrect value for stec_sat_list[15].stec_coeff[3], expected -12000, is " << last_msg_->stec_sat_list[15].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[15].stec_quality_indicator, 77) << "incorrect value for stec_sat_list[15].stec_quality_indicator, expected 77, is " << last_msg_->stec_sat_list[15].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[15].sv_id.constellation, 3) << "incorrect value for stec_sat_list[15].sv_id.constellation, expected 3, is " << last_msg_->stec_sat_list[15].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[15].sv_id.satId, 192) << "incorrect value for stec_sat_list[15].sv_id.satId, expected 192, is " << last_msg_->stec_sat_list[15].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[0], 10651) << "incorrect value for stec_sat_list[16].stec_coeff[0], expected 10651, is " << last_msg_->stec_sat_list[16].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[1], -2889) << "incorrect value for stec_sat_list[16].stec_coeff[1], expected -2889, is " << last_msg_->stec_sat_list[16].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[2], 21150) << "incorrect value for stec_sat_list[16].stec_coeff[2], expected 21150, is " << last_msg_->stec_sat_list[16].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[3], 26421) << "incorrect value for stec_sat_list[16].stec_coeff[3], expected 26421, is " << last_msg_->stec_sat_list[16].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[16].stec_quality_indicator, 123) << "incorrect value for stec_sat_list[16].stec_quality_indicator, expected 123, is " << last_msg_->stec_sat_list[16].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[16].sv_id.constellation, 17) << "incorrect value for stec_sat_list[16].sv_id.constellation, expected 17, is " << last_msg_->stec_sat_list[16].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[16].sv_id.satId, 1) << "incorrect value for stec_sat_list[16].sv_id.satId, expected 1, is " << last_msg_->stec_sat_list[16].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[0], -19165) << "incorrect value for stec_sat_list[17].stec_coeff[0], expected -19165, is " << last_msg_->stec_sat_list[17].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[1], 30229) << "incorrect value for stec_sat_list[17].stec_coeff[1], expected 30229, is " << last_msg_->stec_sat_list[17].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[2], -1282) << "incorrect value for stec_sat_list[17].stec_coeff[2], expected -1282, is " << last_msg_->stec_sat_list[17].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[3], -18382) << "incorrect value for stec_sat_list[17].stec_coeff[3], expected -18382, is " << last_msg_->stec_sat_list[17].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[17].stec_quality_indicator, 185) << "incorrect value for stec_sat_list[17].stec_quality_indicator, expected 185, is " << last_msg_->stec_sat_list[17].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[17].sv_id.constellation, 202) << "incorrect value for stec_sat_list[17].sv_id.constellation, expected 202, is " << last_msg_->stec_sat_list[17].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[17].sv_id.satId, 14) << "incorrect value for stec_sat_list[17].sv_id.satId, expected 14, is " << last_msg_->stec_sat_list[17].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[0], -23752) << "incorrect value for stec_sat_list[18].stec_coeff[0], expected -23752, is " << last_msg_->stec_sat_list[18].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[1], 32433) << "incorrect value for stec_sat_list[18].stec_coeff[1], expected 32433, is " << last_msg_->stec_sat_list[18].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[2], 20441) << "incorrect value for stec_sat_list[18].stec_coeff[2], expected 20441, is " << last_msg_->stec_sat_list[18].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[3], -4181) << "incorrect value for stec_sat_list[18].stec_coeff[3], expected -4181, is " << last_msg_->stec_sat_list[18].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[18].stec_quality_indicator, 45) << "incorrect value for stec_sat_list[18].stec_quality_indicator, expected 45, is " << last_msg_->stec_sat_list[18].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[18].sv_id.constellation, 31) << "incorrect value for stec_sat_list[18].sv_id.constellation, expected 31, is " << last_msg_->stec_sat_list[18].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[18].sv_id.satId, 50) << "incorrect value for stec_sat_list[18].sv_id.satId, expected 50, is " << last_msg_->stec_sat_list[18].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[0], -13968) << "incorrect value for stec_sat_list[19].stec_coeff[0], expected -13968, is " << last_msg_->stec_sat_list[19].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[1], -29322) << "incorrect value for stec_sat_list[19].stec_coeff[1], expected -29322, is " << last_msg_->stec_sat_list[19].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[2], -23790) << "incorrect value for stec_sat_list[19].stec_coeff[2], expected -23790, is " << last_msg_->stec_sat_list[19].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[3], 9063) << "incorrect value for stec_sat_list[19].stec_coeff[3], expected 9063, is " << last_msg_->stec_sat_list[19].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[19].stec_quality_indicator, 238) << "incorrect value for stec_sat_list[19].stec_quality_indicator, expected 238, is " << last_msg_->stec_sat_list[19].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[19].sv_id.constellation, 188) << "incorrect value for stec_sat_list[19].sv_id.constellation, expected 188, is " << last_msg_->stec_sat_list[19].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[19].sv_id.satId, 237) << "incorrect value for stec_sat_list[19].sv_id.satId, expected 237, is " << last_msg_->stec_sat_list[19].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[0], 4737) << "incorrect value for stec_sat_list[20].stec_coeff[0], expected 4737, is " << last_msg_->stec_sat_list[20].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[1], 21877) << "incorrect value for stec_sat_list[20].stec_coeff[1], expected 21877, is " << last_msg_->stec_sat_list[20].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[2], 20414) << "incorrect value for stec_sat_list[20].stec_coeff[2], expected 20414, is " << last_msg_->stec_sat_list[20].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[3], -10286) << "incorrect value for stec_sat_list[20].stec_coeff[3], expected -10286, is " << last_msg_->stec_sat_list[20].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[20].stec_quality_indicator, 82) << "incorrect value for stec_sat_list[20].stec_quality_indicator, expected 82, is " << last_msg_->stec_sat_list[20].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[20].sv_id.constellation, 21) << "incorrect value for stec_sat_list[20].sv_id.constellation, expected 21, is " << last_msg_->stec_sat_list[20].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[20].sv_id.satId, 63) << "incorrect value for stec_sat_list[20].sv_id.satId, expected 63, is " << last_msg_->stec_sat_list[20].sv_id.satId; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 38860); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.iod_atmo, 60) + << "incorrect value for header.iod_atmo, expected 60, is " + << last_msg_->header.iod_atmo; + EXPECT_EQ(last_msg_->header.num_msgs, 157) + << "incorrect value for header.num_msgs, expected 157, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.seq_num, 112) + << "incorrect value for header.seq_num, expected 112, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->header.tile_id, 30066) + << "incorrect value for header.tile_id, expected 30066, is " + << last_msg_->header.tile_id; + EXPECT_EQ(last_msg_->header.tile_set_id, 58526) + << "incorrect value for header.tile_set_id, expected 58526, is " + << last_msg_->header.tile_set_id; + EXPECT_EQ(last_msg_->header.time.tow, 714907186) + << "incorrect value for header.time.tow, expected 714907186, is " + << last_msg_->header.time.tow; + EXPECT_EQ(last_msg_->header.time.wn, 40055) + << "incorrect value for header.time.wn, expected 40055, is " + << last_msg_->header.time.wn; + EXPECT_EQ(last_msg_->header.update_interval, 47) + << "incorrect value for header.update_interval, expected 47, is " + << last_msg_->header.update_interval; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[0], -5289) + << "incorrect value for stec_sat_list[0].stec_coeff[0], expected -5289, " + "is " + << last_msg_->stec_sat_list[0].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[1], -20141) + << "incorrect value for stec_sat_list[0].stec_coeff[1], expected -20141, " + "is " + << last_msg_->stec_sat_list[0].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[2], 966) + << "incorrect value for stec_sat_list[0].stec_coeff[2], expected 966, is " + << last_msg_->stec_sat_list[0].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[3], 2062) + << "incorrect value for stec_sat_list[0].stec_coeff[3], expected 2062, " + "is " + << last_msg_->stec_sat_list[0].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_quality_indicator, 70) + << "incorrect value for stec_sat_list[0].stec_quality_indicator, " + "expected 70, is " + << last_msg_->stec_sat_list[0].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[0].sv_id.constellation, 40) + << "incorrect value for stec_sat_list[0].sv_id.constellation, expected " + "40, is " + << last_msg_->stec_sat_list[0].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[0].sv_id.satId, 132) + << "incorrect value for stec_sat_list[0].sv_id.satId, expected 132, is " + << last_msg_->stec_sat_list[0].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[0], -19147) + << "incorrect value for stec_sat_list[1].stec_coeff[0], expected -19147, " + "is " + << last_msg_->stec_sat_list[1].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[1], -20902) + << "incorrect value for stec_sat_list[1].stec_coeff[1], expected -20902, " + "is " + << last_msg_->stec_sat_list[1].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[2], -26889) + << "incorrect value for stec_sat_list[1].stec_coeff[2], expected -26889, " + "is " + << last_msg_->stec_sat_list[1].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[3], -21446) + << "incorrect value for stec_sat_list[1].stec_coeff[3], expected -21446, " + "is " + << last_msg_->stec_sat_list[1].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_quality_indicator, 44) + << "incorrect value for stec_sat_list[1].stec_quality_indicator, " + "expected 44, is " + << last_msg_->stec_sat_list[1].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[1].sv_id.constellation, 12) + << "incorrect value for stec_sat_list[1].sv_id.constellation, expected " + "12, is " + << last_msg_->stec_sat_list[1].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[1].sv_id.satId, 70) + << "incorrect value for stec_sat_list[1].sv_id.satId, expected 70, is " + << last_msg_->stec_sat_list[1].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[0], 32176) + << "incorrect value for stec_sat_list[2].stec_coeff[0], expected 32176, " + "is " + << last_msg_->stec_sat_list[2].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[1], -20220) + << "incorrect value for stec_sat_list[2].stec_coeff[1], expected -20220, " + "is " + << last_msg_->stec_sat_list[2].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[2], 29157) + << "incorrect value for stec_sat_list[2].stec_coeff[2], expected 29157, " + "is " + << last_msg_->stec_sat_list[2].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[3], 19726) + << "incorrect value for stec_sat_list[2].stec_coeff[3], expected 19726, " + "is " + << last_msg_->stec_sat_list[2].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[2].stec_quality_indicator, 119) + << "incorrect value for stec_sat_list[2].stec_quality_indicator, " + "expected 119, is " + << last_msg_->stec_sat_list[2].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[2].sv_id.constellation, 179) + << "incorrect value for stec_sat_list[2].sv_id.constellation, expected " + "179, is " + << last_msg_->stec_sat_list[2].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[2].sv_id.satId, 247) + << "incorrect value for stec_sat_list[2].sv_id.satId, expected 247, is " + << last_msg_->stec_sat_list[2].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[0], -8651) + << "incorrect value for stec_sat_list[3].stec_coeff[0], expected -8651, " + "is " + << last_msg_->stec_sat_list[3].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[1], -27973) + << "incorrect value for stec_sat_list[3].stec_coeff[1], expected -27973, " + "is " + << last_msg_->stec_sat_list[3].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[2], 23546) + << "incorrect value for stec_sat_list[3].stec_coeff[2], expected 23546, " + "is " + << last_msg_->stec_sat_list[3].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[3], -10284) + << "incorrect value for stec_sat_list[3].stec_coeff[3], expected -10284, " + "is " + << last_msg_->stec_sat_list[3].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[3].stec_quality_indicator, 23) + << "incorrect value for stec_sat_list[3].stec_quality_indicator, " + "expected 23, is " + << last_msg_->stec_sat_list[3].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[3].sv_id.constellation, 185) + << "incorrect value for stec_sat_list[3].sv_id.constellation, expected " + "185, is " + << last_msg_->stec_sat_list[3].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[3].sv_id.satId, 153) + << "incorrect value for stec_sat_list[3].sv_id.satId, expected 153, is " + << last_msg_->stec_sat_list[3].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[0], 27486) + << "incorrect value for stec_sat_list[4].stec_coeff[0], expected 27486, " + "is " + << last_msg_->stec_sat_list[4].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[1], 23329) + << "incorrect value for stec_sat_list[4].stec_coeff[1], expected 23329, " + "is " + << last_msg_->stec_sat_list[4].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[2], 234) + << "incorrect value for stec_sat_list[4].stec_coeff[2], expected 234, is " + << last_msg_->stec_sat_list[4].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[3], -29739) + << "incorrect value for stec_sat_list[4].stec_coeff[3], expected -29739, " + "is " + << last_msg_->stec_sat_list[4].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[4].stec_quality_indicator, 250) + << "incorrect value for stec_sat_list[4].stec_quality_indicator, " + "expected 250, is " + << last_msg_->stec_sat_list[4].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[4].sv_id.constellation, 107) + << "incorrect value for stec_sat_list[4].sv_id.constellation, expected " + "107, is " + << last_msg_->stec_sat_list[4].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[4].sv_id.satId, 14) + << "incorrect value for stec_sat_list[4].sv_id.satId, expected 14, is " + << last_msg_->stec_sat_list[4].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[0], 18965) + << "incorrect value for stec_sat_list[5].stec_coeff[0], expected 18965, " + "is " + << last_msg_->stec_sat_list[5].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[1], -22098) + << "incorrect value for stec_sat_list[5].stec_coeff[1], expected -22098, " + "is " + << last_msg_->stec_sat_list[5].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[2], 22077) + << "incorrect value for stec_sat_list[5].stec_coeff[2], expected 22077, " + "is " + << last_msg_->stec_sat_list[5].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[3], -29093) + << "incorrect value for stec_sat_list[5].stec_coeff[3], expected -29093, " + "is " + << last_msg_->stec_sat_list[5].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[5].stec_quality_indicator, 50) + << "incorrect value for stec_sat_list[5].stec_quality_indicator, " + "expected 50, is " + << last_msg_->stec_sat_list[5].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[5].sv_id.constellation, 179) + << "incorrect value for stec_sat_list[5].sv_id.constellation, expected " + "179, is " + << last_msg_->stec_sat_list[5].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[5].sv_id.satId, 95) + << "incorrect value for stec_sat_list[5].sv_id.satId, expected 95, is " + << last_msg_->stec_sat_list[5].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[0], -7898) + << "incorrect value for stec_sat_list[6].stec_coeff[0], expected -7898, " + "is " + << last_msg_->stec_sat_list[6].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[1], 26002) + << "incorrect value for stec_sat_list[6].stec_coeff[1], expected 26002, " + "is " + << last_msg_->stec_sat_list[6].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[2], -29879) + << "incorrect value for stec_sat_list[6].stec_coeff[2], expected -29879, " + "is " + << last_msg_->stec_sat_list[6].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[3], 30008) + << "incorrect value for stec_sat_list[6].stec_coeff[3], expected 30008, " + "is " + << last_msg_->stec_sat_list[6].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[6].stec_quality_indicator, 9) + << "incorrect value for stec_sat_list[6].stec_quality_indicator, " + "expected 9, is " + << last_msg_->stec_sat_list[6].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[6].sv_id.constellation, 108) + << "incorrect value for stec_sat_list[6].sv_id.constellation, expected " + "108, is " + << last_msg_->stec_sat_list[6].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[6].sv_id.satId, 51) + << "incorrect value for stec_sat_list[6].sv_id.satId, expected 51, is " + << last_msg_->stec_sat_list[6].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[0], -12948) + << "incorrect value for stec_sat_list[7].stec_coeff[0], expected -12948, " + "is " + << last_msg_->stec_sat_list[7].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[1], 4701) + << "incorrect value for stec_sat_list[7].stec_coeff[1], expected 4701, " + "is " + << last_msg_->stec_sat_list[7].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[2], -15597) + << "incorrect value for stec_sat_list[7].stec_coeff[2], expected -15597, " + "is " + << last_msg_->stec_sat_list[7].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[3], -13791) + << "incorrect value for stec_sat_list[7].stec_coeff[3], expected -13791, " + "is " + << last_msg_->stec_sat_list[7].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[7].stec_quality_indicator, 213) + << "incorrect value for stec_sat_list[7].stec_quality_indicator, " + "expected 213, is " + << last_msg_->stec_sat_list[7].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[7].sv_id.constellation, 37) + << "incorrect value for stec_sat_list[7].sv_id.constellation, expected " + "37, is " + << last_msg_->stec_sat_list[7].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[7].sv_id.satId, 82) + << "incorrect value for stec_sat_list[7].sv_id.satId, expected 82, is " + << last_msg_->stec_sat_list[7].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[0], -17283) + << "incorrect value for stec_sat_list[8].stec_coeff[0], expected -17283, " + "is " + << last_msg_->stec_sat_list[8].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[1], 14455) + << "incorrect value for stec_sat_list[8].stec_coeff[1], expected 14455, " + "is " + << last_msg_->stec_sat_list[8].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[2], -27067) + << "incorrect value for stec_sat_list[8].stec_coeff[2], expected -27067, " + "is " + << last_msg_->stec_sat_list[8].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[3], 19606) + << "incorrect value for stec_sat_list[8].stec_coeff[3], expected 19606, " + "is " + << last_msg_->stec_sat_list[8].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[8].stec_quality_indicator, 178) + << "incorrect value for stec_sat_list[8].stec_quality_indicator, " + "expected 178, is " + << last_msg_->stec_sat_list[8].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[8].sv_id.constellation, 206) + << "incorrect value for stec_sat_list[8].sv_id.constellation, expected " + "206, is " + << last_msg_->stec_sat_list[8].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[8].sv_id.satId, 87) + << "incorrect value for stec_sat_list[8].sv_id.satId, expected 87, is " + << last_msg_->stec_sat_list[8].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[0], -12215) + << "incorrect value for stec_sat_list[9].stec_coeff[0], expected -12215, " + "is " + << last_msg_->stec_sat_list[9].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[1], -6072) + << "incorrect value for stec_sat_list[9].stec_coeff[1], expected -6072, " + "is " + << last_msg_->stec_sat_list[9].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[2], -1528) + << "incorrect value for stec_sat_list[9].stec_coeff[2], expected -1528, " + "is " + << last_msg_->stec_sat_list[9].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[3], -19765) + << "incorrect value for stec_sat_list[9].stec_coeff[3], expected -19765, " + "is " + << last_msg_->stec_sat_list[9].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[9].stec_quality_indicator, 18) + << "incorrect value for stec_sat_list[9].stec_quality_indicator, " + "expected 18, is " + << last_msg_->stec_sat_list[9].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[9].sv_id.constellation, 131) + << "incorrect value for stec_sat_list[9].sv_id.constellation, expected " + "131, is " + << last_msg_->stec_sat_list[9].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[9].sv_id.satId, 3) + << "incorrect value for stec_sat_list[9].sv_id.satId, expected 3, is " + << last_msg_->stec_sat_list[9].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[0], 12630) + << "incorrect value for stec_sat_list[10].stec_coeff[0], expected 12630, " + "is " + << last_msg_->stec_sat_list[10].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[1], -19721) + << "incorrect value for stec_sat_list[10].stec_coeff[1], expected " + "-19721, is " + << last_msg_->stec_sat_list[10].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[2], 14502) + << "incorrect value for stec_sat_list[10].stec_coeff[2], expected 14502, " + "is " + << last_msg_->stec_sat_list[10].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[3], 2591) + << "incorrect value for stec_sat_list[10].stec_coeff[3], expected 2591, " + "is " + << last_msg_->stec_sat_list[10].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[10].stec_quality_indicator, 252) + << "incorrect value for stec_sat_list[10].stec_quality_indicator, " + "expected 252, is " + << last_msg_->stec_sat_list[10].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[10].sv_id.constellation, 163) + << "incorrect value for stec_sat_list[10].sv_id.constellation, expected " + "163, is " + << last_msg_->stec_sat_list[10].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[10].sv_id.satId, 170) + << "incorrect value for stec_sat_list[10].sv_id.satId, expected 170, is " + << last_msg_->stec_sat_list[10].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[0], -23340) + << "incorrect value for stec_sat_list[11].stec_coeff[0], expected " + "-23340, is " + << last_msg_->stec_sat_list[11].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[1], -24063) + << "incorrect value for stec_sat_list[11].stec_coeff[1], expected " + "-24063, is " + << last_msg_->stec_sat_list[11].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[2], 4650) + << "incorrect value for stec_sat_list[11].stec_coeff[2], expected 4650, " + "is " + << last_msg_->stec_sat_list[11].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[3], -22148) + << "incorrect value for stec_sat_list[11].stec_coeff[3], expected " + "-22148, is " + << last_msg_->stec_sat_list[11].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[11].stec_quality_indicator, 241) + << "incorrect value for stec_sat_list[11].stec_quality_indicator, " + "expected 241, is " + << last_msg_->stec_sat_list[11].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[11].sv_id.constellation, 213) + << "incorrect value for stec_sat_list[11].sv_id.constellation, expected " + "213, is " + << last_msg_->stec_sat_list[11].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[11].sv_id.satId, 119) + << "incorrect value for stec_sat_list[11].sv_id.satId, expected 119, is " + << last_msg_->stec_sat_list[11].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[0], 5944) + << "incorrect value for stec_sat_list[12].stec_coeff[0], expected 5944, " + "is " + << last_msg_->stec_sat_list[12].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[1], 32142) + << "incorrect value for stec_sat_list[12].stec_coeff[1], expected 32142, " + "is " + << last_msg_->stec_sat_list[12].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[2], 30760) + << "incorrect value for stec_sat_list[12].stec_coeff[2], expected 30760, " + "is " + << last_msg_->stec_sat_list[12].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[3], 11587) + << "incorrect value for stec_sat_list[12].stec_coeff[3], expected 11587, " + "is " + << last_msg_->stec_sat_list[12].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[12].stec_quality_indicator, 26) + << "incorrect value for stec_sat_list[12].stec_quality_indicator, " + "expected 26, is " + << last_msg_->stec_sat_list[12].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[12].sv_id.constellation, 158) + << "incorrect value for stec_sat_list[12].sv_id.constellation, expected " + "158, is " + << last_msg_->stec_sat_list[12].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[12].sv_id.satId, 121) + << "incorrect value for stec_sat_list[12].sv_id.satId, expected 121, is " + << last_msg_->stec_sat_list[12].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[0], 3095) + << "incorrect value for stec_sat_list[13].stec_coeff[0], expected 3095, " + "is " + << last_msg_->stec_sat_list[13].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[1], 22769) + << "incorrect value for stec_sat_list[13].stec_coeff[1], expected 22769, " + "is " + << last_msg_->stec_sat_list[13].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[2], -4283) + << "incorrect value for stec_sat_list[13].stec_coeff[2], expected -4283, " + "is " + << last_msg_->stec_sat_list[13].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[3], 14844) + << "incorrect value for stec_sat_list[13].stec_coeff[3], expected 14844, " + "is " + << last_msg_->stec_sat_list[13].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[13].stec_quality_indicator, 110) + << "incorrect value for stec_sat_list[13].stec_quality_indicator, " + "expected 110, is " + << last_msg_->stec_sat_list[13].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[13].sv_id.constellation, 235) + << "incorrect value for stec_sat_list[13].sv_id.constellation, expected " + "235, is " + << last_msg_->stec_sat_list[13].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[13].sv_id.satId, 126) + << "incorrect value for stec_sat_list[13].sv_id.satId, expected 126, is " + << last_msg_->stec_sat_list[13].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[0], -21032) + << "incorrect value for stec_sat_list[14].stec_coeff[0], expected " + "-21032, is " + << last_msg_->stec_sat_list[14].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[1], -19726) + << "incorrect value for stec_sat_list[14].stec_coeff[1], expected " + "-19726, is " + << last_msg_->stec_sat_list[14].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[2], 1297) + << "incorrect value for stec_sat_list[14].stec_coeff[2], expected 1297, " + "is " + << last_msg_->stec_sat_list[14].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[3], -22049) + << "incorrect value for stec_sat_list[14].stec_coeff[3], expected " + "-22049, is " + << last_msg_->stec_sat_list[14].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[14].stec_quality_indicator, 201) + << "incorrect value for stec_sat_list[14].stec_quality_indicator, " + "expected 201, is " + << last_msg_->stec_sat_list[14].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[14].sv_id.constellation, 44) + << "incorrect value for stec_sat_list[14].sv_id.constellation, expected " + "44, is " + << last_msg_->stec_sat_list[14].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[14].sv_id.satId, 93) + << "incorrect value for stec_sat_list[14].sv_id.satId, expected 93, is " + << last_msg_->stec_sat_list[14].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[0], 619) + << "incorrect value for stec_sat_list[15].stec_coeff[0], expected 619, " + "is " + << last_msg_->stec_sat_list[15].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[1], -5744) + << "incorrect value for stec_sat_list[15].stec_coeff[1], expected -5744, " + "is " + << last_msg_->stec_sat_list[15].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[2], 22542) + << "incorrect value for stec_sat_list[15].stec_coeff[2], expected 22542, " + "is " + << last_msg_->stec_sat_list[15].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[3], -12000) + << "incorrect value for stec_sat_list[15].stec_coeff[3], expected " + "-12000, is " + << last_msg_->stec_sat_list[15].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[15].stec_quality_indicator, 77) + << "incorrect value for stec_sat_list[15].stec_quality_indicator, " + "expected 77, is " + << last_msg_->stec_sat_list[15].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[15].sv_id.constellation, 3) + << "incorrect value for stec_sat_list[15].sv_id.constellation, expected " + "3, is " + << last_msg_->stec_sat_list[15].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[15].sv_id.satId, 192) + << "incorrect value for stec_sat_list[15].sv_id.satId, expected 192, is " + << last_msg_->stec_sat_list[15].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[0], 10651) + << "incorrect value for stec_sat_list[16].stec_coeff[0], expected 10651, " + "is " + << last_msg_->stec_sat_list[16].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[1], -2889) + << "incorrect value for stec_sat_list[16].stec_coeff[1], expected -2889, " + "is " + << last_msg_->stec_sat_list[16].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[2], 21150) + << "incorrect value for stec_sat_list[16].stec_coeff[2], expected 21150, " + "is " + << last_msg_->stec_sat_list[16].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[3], 26421) + << "incorrect value for stec_sat_list[16].stec_coeff[3], expected 26421, " + "is " + << last_msg_->stec_sat_list[16].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[16].stec_quality_indicator, 123) + << "incorrect value for stec_sat_list[16].stec_quality_indicator, " + "expected 123, is " + << last_msg_->stec_sat_list[16].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[16].sv_id.constellation, 17) + << "incorrect value for stec_sat_list[16].sv_id.constellation, expected " + "17, is " + << last_msg_->stec_sat_list[16].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[16].sv_id.satId, 1) + << "incorrect value for stec_sat_list[16].sv_id.satId, expected 1, is " + << last_msg_->stec_sat_list[16].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[0], -19165) + << "incorrect value for stec_sat_list[17].stec_coeff[0], expected " + "-19165, is " + << last_msg_->stec_sat_list[17].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[1], 30229) + << "incorrect value for stec_sat_list[17].stec_coeff[1], expected 30229, " + "is " + << last_msg_->stec_sat_list[17].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[2], -1282) + << "incorrect value for stec_sat_list[17].stec_coeff[2], expected -1282, " + "is " + << last_msg_->stec_sat_list[17].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[3], -18382) + << "incorrect value for stec_sat_list[17].stec_coeff[3], expected " + "-18382, is " + << last_msg_->stec_sat_list[17].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[17].stec_quality_indicator, 185) + << "incorrect value for stec_sat_list[17].stec_quality_indicator, " + "expected 185, is " + << last_msg_->stec_sat_list[17].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[17].sv_id.constellation, 202) + << "incorrect value for stec_sat_list[17].sv_id.constellation, expected " + "202, is " + << last_msg_->stec_sat_list[17].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[17].sv_id.satId, 14) + << "incorrect value for stec_sat_list[17].sv_id.satId, expected 14, is " + << last_msg_->stec_sat_list[17].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[0], -23752) + << "incorrect value for stec_sat_list[18].stec_coeff[0], expected " + "-23752, is " + << last_msg_->stec_sat_list[18].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[1], 32433) + << "incorrect value for stec_sat_list[18].stec_coeff[1], expected 32433, " + "is " + << last_msg_->stec_sat_list[18].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[2], 20441) + << "incorrect value for stec_sat_list[18].stec_coeff[2], expected 20441, " + "is " + << last_msg_->stec_sat_list[18].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[3], -4181) + << "incorrect value for stec_sat_list[18].stec_coeff[3], expected -4181, " + "is " + << last_msg_->stec_sat_list[18].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[18].stec_quality_indicator, 45) + << "incorrect value for stec_sat_list[18].stec_quality_indicator, " + "expected 45, is " + << last_msg_->stec_sat_list[18].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[18].sv_id.constellation, 31) + << "incorrect value for stec_sat_list[18].sv_id.constellation, expected " + "31, is " + << last_msg_->stec_sat_list[18].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[18].sv_id.satId, 50) + << "incorrect value for stec_sat_list[18].sv_id.satId, expected 50, is " + << last_msg_->stec_sat_list[18].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[0], -13968) + << "incorrect value for stec_sat_list[19].stec_coeff[0], expected " + "-13968, is " + << last_msg_->stec_sat_list[19].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[1], -29322) + << "incorrect value for stec_sat_list[19].stec_coeff[1], expected " + "-29322, is " + << last_msg_->stec_sat_list[19].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[2], -23790) + << "incorrect value for stec_sat_list[19].stec_coeff[2], expected " + "-23790, is " + << last_msg_->stec_sat_list[19].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[3], 9063) + << "incorrect value for stec_sat_list[19].stec_coeff[3], expected 9063, " + "is " + << last_msg_->stec_sat_list[19].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[19].stec_quality_indicator, 238) + << "incorrect value for stec_sat_list[19].stec_quality_indicator, " + "expected 238, is " + << last_msg_->stec_sat_list[19].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[19].sv_id.constellation, 188) + << "incorrect value for stec_sat_list[19].sv_id.constellation, expected " + "188, is " + << last_msg_->stec_sat_list[19].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[19].sv_id.satId, 237) + << "incorrect value for stec_sat_list[19].sv_id.satId, expected 237, is " + << last_msg_->stec_sat_list[19].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[0], 4737) + << "incorrect value for stec_sat_list[20].stec_coeff[0], expected 4737, " + "is " + << last_msg_->stec_sat_list[20].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[1], 21877) + << "incorrect value for stec_sat_list[20].stec_coeff[1], expected 21877, " + "is " + << last_msg_->stec_sat_list[20].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[2], 20414) + << "incorrect value for stec_sat_list[20].stec_coeff[2], expected 20414, " + "is " + << last_msg_->stec_sat_list[20].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[3], -10286) + << "incorrect value for stec_sat_list[20].stec_coeff[3], expected " + "-10286, is " + << last_msg_->stec_sat_list[20].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[20].stec_quality_indicator, 82) + << "incorrect value for stec_sat_list[20].stec_quality_indicator, " + "expected 82, is " + << last_msg_->stec_sat_list[20].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[20].sv_id.constellation, 21) + << "incorrect value for stec_sat_list[20].sv_id.constellation, expected " + "21, is " + << last_msg_->stec_sat_list[20].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[20].sv_id.satId, 63) + << "incorrect value for stec_sat_list[20].sv_id.satId, expected 63, is " + << last_msg_->stec_sat_list[20].sv_id.satId; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.cc index e811464fa..c8b504c39 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrStecCorrectionDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrStecCorrectionDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_stec_correction_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_stec_correction_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,793 +82,1349 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_stec_correction_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrStecCorrectionDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 235, 5, 39, 7, 252, 70, 81, 196, 232, 185, 43, 147, 123, 39, + 4, 126, 19, 111, 97, 248, 130, 217, 217, 106, 58, 12, 65, 230, 171, + 81, 95, 86, 16, 39, 84, 228, 208, 201, 81, 219, 99, 203, 61, 182, + 66, 125, 203, 3, 193, 44, 100, 220, 125, 60, 21, 93, 218, 247, 158, + 207, 93, 129, 134, 14, 209, 48, 14, 215, 153, 148, 147, 72, 225, 180, + 236, 205, 201, 33, 3, 246, 204, 19, 3, 98, 4, 194, 191, 246, 76, + 219, 31, 191, 113, 79, 177, 15, 251, 33, 19, 96, 54, 58, 146, 210, + 100, 249, 72, 21, 161, 211, 198, 21, 238, 111, 107, 36, 227, 225, 213, + 3, 71, 243, 63, 65, 236, 92, 77, 0, 169, 15, 182, 5, 240, 180, + 9, 122, 86, 232, 6, 103, 104, 254, 189, 81, 110, 2, 49, 202, 84, + 216, 55, 50, 181, 5, 123, 80, 49, 244, 224, 188, 125, 164, 230, 56, + 66, 124, 168, 59, 139, 106, 118, 51, 187, 216, 191, 158, 77, 92, 58, + 253, 132, 150, 165, 9, 154, 189, 218, 61, 209, 1, 82, 181, 196, 23, + 53, 182, 112, 192, 206, 167, 157, 244, 35, 1, 189, 217, 61, 88, 97, + 201, 201, 74, 251, 217, 14, 104, 184, 54, 52, 74, 238, 10, 129, 22, + 178, 226, 109, 88, 157, 30, 196, 175, 26, 76, 34, 116, 220, 154, 232, + 12, 179, 244, 15, 155, 196, 202, 72, 70, 115, 10, 214, 114, 39, 245, + 28, 237, 68, 136, 155, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_stec_correction_dep_a_t *test_msg = + (msg_ssr_stec_correction_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->header.iod_atmo = 4; + test_msg->header.num_msgs = 147; + test_msg->header.seq_num = 123; + test_msg->header.time.tow = 3905179974; + test_msg->header.time.wn = 11193; + test_msg->header.update_interval = 39; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); + } + test_msg->stec_sat_list[0].stec_coeff[0] = -1951; + if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); + } + test_msg->stec_sat_list[0].stec_coeff[1] = -9854; + if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); + } + test_msg->stec_sat_list[0].stec_coeff[2] = 27353; + if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); + } + test_msg->stec_sat_list[0].stec_coeff[3] = 3130; + test_msg->stec_sat_list[0].stec_quality_indicator = 111; + test_msg->stec_sat_list[0].sv_id.constellation = 19; + test_msg->stec_sat_list[0].sv_id.satId = 126; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); + } + test_msg->stec_sat_list[1].stec_coeff[0] = 24401; + if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); + } + test_msg->stec_sat_list[1].stec_coeff[1] = 4182; + if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); + } + test_msg->stec_sat_list[1].stec_coeff[2] = 21543; + if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); + } + test_msg->stec_sat_list[1].stec_coeff[3] = -12060; + test_msg->stec_sat_list[1].stec_quality_indicator = 171; + test_msg->stec_sat_list[1].sv_id.constellation = 230; + test_msg->stec_sat_list[1].sv_id.satId = 65; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); + } + test_msg->stec_sat_list[2].stec_coeff[0] = -13469; + if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); + } + test_msg->stec_sat_list[2].stec_coeff[1] = -18883; + if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); + } + test_msg->stec_sat_list[2].stec_coeff[2] = 32066; + if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); + } + test_msg->stec_sat_list[2].stec_coeff[3] = 971; + test_msg->stec_sat_list[2].stec_quality_indicator = 219; + test_msg->stec_sat_list[2].sv_id.constellation = 81; + test_msg->stec_sat_list[2].sv_id.satId = 201; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); + } + test_msg->stec_sat_list[3].stec_coeff[0] = 32220; + if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); + } + test_msg->stec_sat_list[3].stec_coeff[1] = 5436; + if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); + } + test_msg->stec_sat_list[3].stec_coeff[2] = -9635; + if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); + } + test_msg->stec_sat_list[3].stec_coeff[3] = -24841; + test_msg->stec_sat_list[3].stec_quality_indicator = 100; + test_msg->stec_sat_list[3].sv_id.constellation = 44; + test_msg->stec_sat_list[3].sv_id.satId = 193; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); + } + test_msg->stec_sat_list[4].stec_coeff[0] = 3718; + if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); + } + test_msg->stec_sat_list[4].stec_coeff[1] = 12497; + if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); + } + test_msg->stec_sat_list[4].stec_coeff[2] = -10482; + if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); + } + test_msg->stec_sat_list[4].stec_coeff[3] = -27495; + test_msg->stec_sat_list[4].stec_quality_indicator = 129; + test_msg->stec_sat_list[4].sv_id.constellation = 93; + test_msg->stec_sat_list[4].sv_id.satId = 207; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); + } + test_msg->stec_sat_list[5].stec_coeff[0] = -4940; + if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); + } + test_msg->stec_sat_list[5].stec_coeff[1] = -13875; + if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); + } + test_msg->stec_sat_list[5].stec_coeff[2] = 801; + if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); + } + test_msg->stec_sat_list[5].stec_coeff[3] = -13066; + test_msg->stec_sat_list[5].stec_quality_indicator = 225; + test_msg->stec_sat_list[5].sv_id.constellation = 72; + test_msg->stec_sat_list[5].sv_id.satId = 147; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); + } + test_msg->stec_sat_list[6].stec_coeff[0] = -15868; + if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); + } + test_msg->stec_sat_list[6].stec_coeff[1] = -2369; + if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); + } + test_msg->stec_sat_list[6].stec_coeff[2] = -9396; + if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); + } + test_msg->stec_sat_list[6].stec_coeff[3] = -16609; + test_msg->stec_sat_list[6].stec_quality_indicator = 98; + test_msg->stec_sat_list[6].sv_id.constellation = 3; + test_msg->stec_sat_list[6].sv_id.satId = 19; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); + } + test_msg->stec_sat_list[7].stec_coeff[0] = -1265; + if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); + } + test_msg->stec_sat_list[7].stec_coeff[1] = 4897; + if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); + } + test_msg->stec_sat_list[7].stec_coeff[2] = 13920; + if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); + } + test_msg->stec_sat_list[7].stec_coeff[3] = -28102; + test_msg->stec_sat_list[7].stec_quality_indicator = 177; + test_msg->stec_sat_list[7].sv_id.constellation = 79; + test_msg->stec_sat_list[7].sv_id.satId = 113; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); + } + test_msg->stec_sat_list[8].stec_coeff[0] = 5448; + if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); + } + test_msg->stec_sat_list[8].stec_coeff[1] = -11359; + if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); + } + test_msg->stec_sat_list[8].stec_coeff[2] = 5574; + if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); + } + test_msg->stec_sat_list[8].stec_coeff[3] = 28654; + test_msg->stec_sat_list[8].stec_quality_indicator = 249; + test_msg->stec_sat_list[8].sv_id.constellation = 100; + test_msg->stec_sat_list[8].sv_id.satId = 210; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); + } + test_msg->stec_sat_list[9].stec_coeff[0] = -10783; + if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); + } + test_msg->stec_sat_list[9].stec_coeff[1] = 18179; + if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); + } + test_msg->stec_sat_list[9].stec_coeff[2] = 16371; + if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); + } + test_msg->stec_sat_list[9].stec_coeff[3] = -5055; + test_msg->stec_sat_list[9].stec_quality_indicator = 227; + test_msg->stec_sat_list[9].sv_id.constellation = 36; + test_msg->stec_sat_list[9].sv_id.satId = 107; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); + } + test_msg->stec_sat_list[10].stec_coeff[0] = 4009; + if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); + } + test_msg->stec_sat_list[10].stec_coeff[1] = 1462; + if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); + } + test_msg->stec_sat_list[10].stec_coeff[2] = -19216; + if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); + } + test_msg->stec_sat_list[10].stec_coeff[3] = 31241; + test_msg->stec_sat_list[10].stec_quality_indicator = 0; + test_msg->stec_sat_list[10].sv_id.constellation = 77; + test_msg->stec_sat_list[10].sv_id.satId = 92; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); + } + test_msg->stec_sat_list[11].stec_coeff[0] = 26727; + if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); + } + test_msg->stec_sat_list[11].stec_coeff[1] = -16898; + if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); + } + test_msg->stec_sat_list[11].stec_coeff[2] = 28241; + if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); + } + test_msg->stec_sat_list[11].stec_coeff[3] = 12546; + test_msg->stec_sat_list[11].stec_quality_indicator = 6; + test_msg->stec_sat_list[11].sv_id.constellation = 232; + test_msg->stec_sat_list[11].sv_id.satId = 86; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); + } + test_msg->stec_sat_list[12].stec_coeff[0] = 12855; + if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); + } + test_msg->stec_sat_list[12].stec_coeff[1] = 1461; + if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); + } + test_msg->stec_sat_list[12].stec_coeff[2] = 20603; + if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); + } + test_msg->stec_sat_list[12].stec_coeff[3] = -3023; + test_msg->stec_sat_list[12].stec_quality_indicator = 216; + test_msg->stec_sat_list[12].sv_id.constellation = 84; + test_msg->stec_sat_list[12].sv_id.satId = 202; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); + } + test_msg->stec_sat_list[13].stec_coeff[0] = -6492; + if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); + } + test_msg->stec_sat_list[13].stec_coeff[1] = 16952; + if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); + } + test_msg->stec_sat_list[13].stec_coeff[2] = -22404; + if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); + } + test_msg->stec_sat_list[13].stec_coeff[3] = -29893; + test_msg->stec_sat_list[13].stec_quality_indicator = 125; + test_msg->stec_sat_list[13].sv_id.constellation = 188; + test_msg->stec_sat_list[13].sv_id.satId = 224; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); + } + test_msg->stec_sat_list[14].stec_coeff[0] = -10053; + if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); + } + test_msg->stec_sat_list[14].stec_coeff[1] = -24897; + if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); + } + test_msg->stec_sat_list[14].stec_coeff[2] = 23629; + if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); + } + test_msg->stec_sat_list[14].stec_coeff[3] = -710; + test_msg->stec_sat_list[14].stec_quality_indicator = 51; + test_msg->stec_sat_list[14].sv_id.constellation = 118; + test_msg->stec_sat_list[14].sv_id.satId = 106; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); + } + test_msg->stec_sat_list[15].stec_coeff[0] = -26103; + if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); + } + test_msg->stec_sat_list[15].stec_coeff[1] = -9539; + if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); + } + test_msg->stec_sat_list[15].stec_coeff[2] = -11971; + if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); + } + test_msg->stec_sat_list[15].stec_coeff[3] = 20993; + test_msg->stec_sat_list[15].stec_quality_indicator = 165; + test_msg->stec_sat_list[15].sv_id.constellation = 150; + test_msg->stec_sat_list[15].sv_id.satId = 132; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); + } + test_msg->stec_sat_list[16].stec_coeff[0] = -18891; + if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); + } + test_msg->stec_sat_list[16].stec_coeff[1] = -16272; + if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); + } + test_msg->stec_sat_list[16].stec_coeff[2] = -22578; + if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); + } + test_msg->stec_sat_list[16].stec_coeff[3] = -2915; + test_msg->stec_sat_list[16].stec_quality_indicator = 23; + test_msg->stec_sat_list[16].sv_id.constellation = 196; + test_msg->stec_sat_list[16].sv_id.satId = 181; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); + } + test_msg->stec_sat_list[17].stec_coeff[0] = 15833; + if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); + } + test_msg->stec_sat_list[17].stec_coeff[1] = 24920; + if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); + } + test_msg->stec_sat_list[17].stec_coeff[2] = -13879; + if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); + } + test_msg->stec_sat_list[17].stec_coeff[3] = -1206; + test_msg->stec_sat_list[17].stec_quality_indicator = 189; + test_msg->stec_sat_list[17].sv_id.constellation = 1; + test_msg->stec_sat_list[17].sv_id.satId = 35; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); + } + test_msg->stec_sat_list[18].stec_coeff[0] = 14008; + if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); + } + test_msg->stec_sat_list[18].stec_coeff[1] = 18996; + if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); + } + test_msg->stec_sat_list[18].stec_coeff[2] = 2798; + if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); + } + test_msg->stec_sat_list[18].stec_coeff[3] = 5761; + test_msg->stec_sat_list[18].stec_quality_indicator = 104; + test_msg->stec_sat_list[18].sv_id.constellation = 14; + test_msg->stec_sat_list[18].sv_id.satId = 217; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); + } + test_msg->stec_sat_list[19].stec_coeff[0] = -25256; + if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); + } + test_msg->stec_sat_list[19].stec_coeff[1] = -15330; + if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); + } + test_msg->stec_sat_list[19].stec_coeff[2] = 6831; + if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); + } + test_msg->stec_sat_list[19].stec_coeff[3] = 8780; + test_msg->stec_sat_list[19].stec_quality_indicator = 109; + test_msg->stec_sat_list[19].sv_id.constellation = 226; + test_msg->stec_sat_list[19].sv_id.satId = 178; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); + } + test_msg->stec_sat_list[20].stec_coeff[0] = 3304; + if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); + } + test_msg->stec_sat_list[20].stec_coeff[1] = -2893; + if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); + } + test_msg->stec_sat_list[20].stec_coeff[2] = -25841; + if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); + } + test_msg->stec_sat_list[20].stec_coeff[3] = -13628; + test_msg->stec_sat_list[20].stec_quality_indicator = 154; + test_msg->stec_sat_list[20].sv_id.constellation = 220; + test_msg->stec_sat_list[20].sv_id.satId = 116; + if (sizeof(test_msg->stec_sat_list) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); + } + if (sizeof(test_msg->stec_sat_list[21].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[21].stec_coeff[0])); + } + test_msg->stec_sat_list[21].stec_coeff[0] = -10742; + if (sizeof(test_msg->stec_sat_list[21].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[21].stec_coeff[0])); + } + test_msg->stec_sat_list[21].stec_coeff[1] = 10098; + if (sizeof(test_msg->stec_sat_list[21].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[21].stec_coeff[0])); + } + test_msg->stec_sat_list[21].stec_coeff[2] = 7413; + if (sizeof(test_msg->stec_sat_list[21].stec_coeff) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + + sizeof(test_msg->stec_sat_list[21].stec_coeff[0])); + } + test_msg->stec_sat_list[21].stec_coeff[3] = 17645; + test_msg->stec_sat_list[21].stec_quality_indicator = 115; + test_msg->stec_sat_list[21].sv_id.constellation = 70; + test_msg->stec_sat_list[21].sv_id.satId = 72; + + EXPECT_EQ(send_message(0x5eb, 1831, test_msg_len, test_msg_storage), SBP_OK); - uint8_t encoded_frame[] = {85,235,5,39,7,252,70,81,196,232,185,43,147,123,39,4,126,19,111,97,248,130,217,217,106,58,12,65,230,171,81,95,86,16,39,84,228,208,201,81,219,99,203,61,182,66,125,203,3,193,44,100,220,125,60,21,93,218,247,158,207,93,129,134,14,209,48,14,215,153,148,147,72,225,180,236,205,201,33,3,246,204,19,3,98,4,194,191,246,76,219,31,191,113,79,177,15,251,33,19,96,54,58,146,210,100,249,72,21,161,211,198,21,238,111,107,36,227,225,213,3,71,243,63,65,236,92,77,0,169,15,182,5,240,180,9,122,86,232,6,103,104,254,189,81,110,2,49,202,84,216,55,50,181,5,123,80,49,244,224,188,125,164,230,56,66,124,168,59,139,106,118,51,187,216,191,158,77,92,58,253,132,150,165,9,154,189,218,61,209,1,82,181,196,23,53,182,112,192,206,167,157,244,35,1,189,217,61,88,97,201,201,74,251,217,14,104,184,54,52,74,238,10,129,22,178,226,109,88,157,30,196,175,26,76,34,116,220,154,232,12,179,244,15,155,196,202,72,70,115,10,214,114,39,245,28,237,68,136,155, }; + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_stec_correction_dep_a_t* test_msg = ( msg_ssr_stec_correction_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->header.iod_atmo = 4; - test_msg->header.num_msgs = 147; - test_msg->header.seq_num = 123; - test_msg->header.time.tow = 3905179974; - test_msg->header.time.wn = 11193; - test_msg->header.update_interval = 39; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); - } - test_msg->stec_sat_list[0].stec_coeff[0] = -1951; - if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); - } - test_msg->stec_sat_list[0].stec_coeff[1] = -9854; - if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); - } - test_msg->stec_sat_list[0].stec_coeff[2] = 27353; - if (sizeof(test_msg->stec_sat_list[0].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0].stec_coeff[0])); - } - test_msg->stec_sat_list[0].stec_coeff[3] = 3130; - test_msg->stec_sat_list[0].stec_quality_indicator = 111; - test_msg->stec_sat_list[0].sv_id.constellation = 19; - test_msg->stec_sat_list[0].sv_id.satId = 126; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); - } - test_msg->stec_sat_list[1].stec_coeff[0] = 24401; - if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); - } - test_msg->stec_sat_list[1].stec_coeff[1] = 4182; - if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); - } - test_msg->stec_sat_list[1].stec_coeff[2] = 21543; - if (sizeof(test_msg->stec_sat_list[1].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[1].stec_coeff[0])); - } - test_msg->stec_sat_list[1].stec_coeff[3] = -12060; - test_msg->stec_sat_list[1].stec_quality_indicator = 171; - test_msg->stec_sat_list[1].sv_id.constellation = 230; - test_msg->stec_sat_list[1].sv_id.satId = 65; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); - } - test_msg->stec_sat_list[2].stec_coeff[0] = -13469; - if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); - } - test_msg->stec_sat_list[2].stec_coeff[1] = -18883; - if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); - } - test_msg->stec_sat_list[2].stec_coeff[2] = 32066; - if (sizeof(test_msg->stec_sat_list[2].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[2].stec_coeff[0])); - } - test_msg->stec_sat_list[2].stec_coeff[3] = 971; - test_msg->stec_sat_list[2].stec_quality_indicator = 219; - test_msg->stec_sat_list[2].sv_id.constellation = 81; - test_msg->stec_sat_list[2].sv_id.satId = 201; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); - } - test_msg->stec_sat_list[3].stec_coeff[0] = 32220; - if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); - } - test_msg->stec_sat_list[3].stec_coeff[1] = 5436; - if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); - } - test_msg->stec_sat_list[3].stec_coeff[2] = -9635; - if (sizeof(test_msg->stec_sat_list[3].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[3].stec_coeff[0])); - } - test_msg->stec_sat_list[3].stec_coeff[3] = -24841; - test_msg->stec_sat_list[3].stec_quality_indicator = 100; - test_msg->stec_sat_list[3].sv_id.constellation = 44; - test_msg->stec_sat_list[3].sv_id.satId = 193; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); - } - test_msg->stec_sat_list[4].stec_coeff[0] = 3718; - if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); - } - test_msg->stec_sat_list[4].stec_coeff[1] = 12497; - if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); - } - test_msg->stec_sat_list[4].stec_coeff[2] = -10482; - if (sizeof(test_msg->stec_sat_list[4].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[4].stec_coeff[0])); - } - test_msg->stec_sat_list[4].stec_coeff[3] = -27495; - test_msg->stec_sat_list[4].stec_quality_indicator = 129; - test_msg->stec_sat_list[4].sv_id.constellation = 93; - test_msg->stec_sat_list[4].sv_id.satId = 207; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); - } - test_msg->stec_sat_list[5].stec_coeff[0] = -4940; - if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); - } - test_msg->stec_sat_list[5].stec_coeff[1] = -13875; - if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); - } - test_msg->stec_sat_list[5].stec_coeff[2] = 801; - if (sizeof(test_msg->stec_sat_list[5].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[5].stec_coeff[0])); - } - test_msg->stec_sat_list[5].stec_coeff[3] = -13066; - test_msg->stec_sat_list[5].stec_quality_indicator = 225; - test_msg->stec_sat_list[5].sv_id.constellation = 72; - test_msg->stec_sat_list[5].sv_id.satId = 147; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); - } - test_msg->stec_sat_list[6].stec_coeff[0] = -15868; - if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); - } - test_msg->stec_sat_list[6].stec_coeff[1] = -2369; - if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); - } - test_msg->stec_sat_list[6].stec_coeff[2] = -9396; - if (sizeof(test_msg->stec_sat_list[6].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[6].stec_coeff[0])); - } - test_msg->stec_sat_list[6].stec_coeff[3] = -16609; - test_msg->stec_sat_list[6].stec_quality_indicator = 98; - test_msg->stec_sat_list[6].sv_id.constellation = 3; - test_msg->stec_sat_list[6].sv_id.satId = 19; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); - } - test_msg->stec_sat_list[7].stec_coeff[0] = -1265; - if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); - } - test_msg->stec_sat_list[7].stec_coeff[1] = 4897; - if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); - } - test_msg->stec_sat_list[7].stec_coeff[2] = 13920; - if (sizeof(test_msg->stec_sat_list[7].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[7].stec_coeff[0])); - } - test_msg->stec_sat_list[7].stec_coeff[3] = -28102; - test_msg->stec_sat_list[7].stec_quality_indicator = 177; - test_msg->stec_sat_list[7].sv_id.constellation = 79; - test_msg->stec_sat_list[7].sv_id.satId = 113; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); - } - test_msg->stec_sat_list[8].stec_coeff[0] = 5448; - if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); - } - test_msg->stec_sat_list[8].stec_coeff[1] = -11359; - if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); - } - test_msg->stec_sat_list[8].stec_coeff[2] = 5574; - if (sizeof(test_msg->stec_sat_list[8].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[8].stec_coeff[0])); - } - test_msg->stec_sat_list[8].stec_coeff[3] = 28654; - test_msg->stec_sat_list[8].stec_quality_indicator = 249; - test_msg->stec_sat_list[8].sv_id.constellation = 100; - test_msg->stec_sat_list[8].sv_id.satId = 210; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); - } - test_msg->stec_sat_list[9].stec_coeff[0] = -10783; - if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); - } - test_msg->stec_sat_list[9].stec_coeff[1] = 18179; - if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); - } - test_msg->stec_sat_list[9].stec_coeff[2] = 16371; - if (sizeof(test_msg->stec_sat_list[9].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[9].stec_coeff[0])); - } - test_msg->stec_sat_list[9].stec_coeff[3] = -5055; - test_msg->stec_sat_list[9].stec_quality_indicator = 227; - test_msg->stec_sat_list[9].sv_id.constellation = 36; - test_msg->stec_sat_list[9].sv_id.satId = 107; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); - } - test_msg->stec_sat_list[10].stec_coeff[0] = 4009; - if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); - } - test_msg->stec_sat_list[10].stec_coeff[1] = 1462; - if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); - } - test_msg->stec_sat_list[10].stec_coeff[2] = -19216; - if (sizeof(test_msg->stec_sat_list[10].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[10].stec_coeff[0])); - } - test_msg->stec_sat_list[10].stec_coeff[3] = 31241; - test_msg->stec_sat_list[10].stec_quality_indicator = 0; - test_msg->stec_sat_list[10].sv_id.constellation = 77; - test_msg->stec_sat_list[10].sv_id.satId = 92; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); - } - test_msg->stec_sat_list[11].stec_coeff[0] = 26727; - if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); - } - test_msg->stec_sat_list[11].stec_coeff[1] = -16898; - if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); - } - test_msg->stec_sat_list[11].stec_coeff[2] = 28241; - if (sizeof(test_msg->stec_sat_list[11].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[11].stec_coeff[0])); - } - test_msg->stec_sat_list[11].stec_coeff[3] = 12546; - test_msg->stec_sat_list[11].stec_quality_indicator = 6; - test_msg->stec_sat_list[11].sv_id.constellation = 232; - test_msg->stec_sat_list[11].sv_id.satId = 86; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); - } - test_msg->stec_sat_list[12].stec_coeff[0] = 12855; - if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); - } - test_msg->stec_sat_list[12].stec_coeff[1] = 1461; - if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); - } - test_msg->stec_sat_list[12].stec_coeff[2] = 20603; - if (sizeof(test_msg->stec_sat_list[12].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[12].stec_coeff[0])); - } - test_msg->stec_sat_list[12].stec_coeff[3] = -3023; - test_msg->stec_sat_list[12].stec_quality_indicator = 216; - test_msg->stec_sat_list[12].sv_id.constellation = 84; - test_msg->stec_sat_list[12].sv_id.satId = 202; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); - } - test_msg->stec_sat_list[13].stec_coeff[0] = -6492; - if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); - } - test_msg->stec_sat_list[13].stec_coeff[1] = 16952; - if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); - } - test_msg->stec_sat_list[13].stec_coeff[2] = -22404; - if (sizeof(test_msg->stec_sat_list[13].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[13].stec_coeff[0])); - } - test_msg->stec_sat_list[13].stec_coeff[3] = -29893; - test_msg->stec_sat_list[13].stec_quality_indicator = 125; - test_msg->stec_sat_list[13].sv_id.constellation = 188; - test_msg->stec_sat_list[13].sv_id.satId = 224; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); - } - test_msg->stec_sat_list[14].stec_coeff[0] = -10053; - if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); - } - test_msg->stec_sat_list[14].stec_coeff[1] = -24897; - if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); - } - test_msg->stec_sat_list[14].stec_coeff[2] = 23629; - if (sizeof(test_msg->stec_sat_list[14].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[14].stec_coeff[0])); - } - test_msg->stec_sat_list[14].stec_coeff[3] = -710; - test_msg->stec_sat_list[14].stec_quality_indicator = 51; - test_msg->stec_sat_list[14].sv_id.constellation = 118; - test_msg->stec_sat_list[14].sv_id.satId = 106; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); - } - test_msg->stec_sat_list[15].stec_coeff[0] = -26103; - if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); - } - test_msg->stec_sat_list[15].stec_coeff[1] = -9539; - if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); - } - test_msg->stec_sat_list[15].stec_coeff[2] = -11971; - if (sizeof(test_msg->stec_sat_list[15].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[15].stec_coeff[0])); - } - test_msg->stec_sat_list[15].stec_coeff[3] = 20993; - test_msg->stec_sat_list[15].stec_quality_indicator = 165; - test_msg->stec_sat_list[15].sv_id.constellation = 150; - test_msg->stec_sat_list[15].sv_id.satId = 132; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); - } - test_msg->stec_sat_list[16].stec_coeff[0] = -18891; - if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); - } - test_msg->stec_sat_list[16].stec_coeff[1] = -16272; - if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); - } - test_msg->stec_sat_list[16].stec_coeff[2] = -22578; - if (sizeof(test_msg->stec_sat_list[16].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[16].stec_coeff[0])); - } - test_msg->stec_sat_list[16].stec_coeff[3] = -2915; - test_msg->stec_sat_list[16].stec_quality_indicator = 23; - test_msg->stec_sat_list[16].sv_id.constellation = 196; - test_msg->stec_sat_list[16].sv_id.satId = 181; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); - } - test_msg->stec_sat_list[17].stec_coeff[0] = 15833; - if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); - } - test_msg->stec_sat_list[17].stec_coeff[1] = 24920; - if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); - } - test_msg->stec_sat_list[17].stec_coeff[2] = -13879; - if (sizeof(test_msg->stec_sat_list[17].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[17].stec_coeff[0])); - } - test_msg->stec_sat_list[17].stec_coeff[3] = -1206; - test_msg->stec_sat_list[17].stec_quality_indicator = 189; - test_msg->stec_sat_list[17].sv_id.constellation = 1; - test_msg->stec_sat_list[17].sv_id.satId = 35; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); - } - test_msg->stec_sat_list[18].stec_coeff[0] = 14008; - if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); - } - test_msg->stec_sat_list[18].stec_coeff[1] = 18996; - if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); - } - test_msg->stec_sat_list[18].stec_coeff[2] = 2798; - if (sizeof(test_msg->stec_sat_list[18].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[18].stec_coeff[0])); - } - test_msg->stec_sat_list[18].stec_coeff[3] = 5761; - test_msg->stec_sat_list[18].stec_quality_indicator = 104; - test_msg->stec_sat_list[18].sv_id.constellation = 14; - test_msg->stec_sat_list[18].sv_id.satId = 217; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); - } - test_msg->stec_sat_list[19].stec_coeff[0] = -25256; - if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); - } - test_msg->stec_sat_list[19].stec_coeff[1] = -15330; - if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); - } - test_msg->stec_sat_list[19].stec_coeff[2] = 6831; - if (sizeof(test_msg->stec_sat_list[19].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[19].stec_coeff[0])); - } - test_msg->stec_sat_list[19].stec_coeff[3] = 8780; - test_msg->stec_sat_list[19].stec_quality_indicator = 109; - test_msg->stec_sat_list[19].sv_id.constellation = 226; - test_msg->stec_sat_list[19].sv_id.satId = 178; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); - } - test_msg->stec_sat_list[20].stec_coeff[0] = 3304; - if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); - } - test_msg->stec_sat_list[20].stec_coeff[1] = -2893; - if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); - } - test_msg->stec_sat_list[20].stec_coeff[2] = -25841; - if (sizeof(test_msg->stec_sat_list[20].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[20].stec_coeff[0])); - } - test_msg->stec_sat_list[20].stec_coeff[3] = -13628; - test_msg->stec_sat_list[20].stec_quality_indicator = 154; - test_msg->stec_sat_list[20].sv_id.constellation = 220; - test_msg->stec_sat_list[20].sv_id.satId = 116; - if (sizeof(test_msg->stec_sat_list) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[0])); - } - if (sizeof(test_msg->stec_sat_list[21].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[21].stec_coeff[0])); - } - test_msg->stec_sat_list[21].stec_coeff[0] = -10742; - if (sizeof(test_msg->stec_sat_list[21].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[21].stec_coeff[0])); - } - test_msg->stec_sat_list[21].stec_coeff[1] = 10098; - if (sizeof(test_msg->stec_sat_list[21].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[21].stec_coeff[0])); - } - test_msg->stec_sat_list[21].stec_coeff[2] = 7413; - if (sizeof(test_msg->stec_sat_list[21].stec_coeff) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->stec_sat_list[21].stec_coeff[0])); - } - test_msg->stec_sat_list[21].stec_coeff[3] = 17645; - test_msg->stec_sat_list[21].stec_quality_indicator = 115; - test_msg->stec_sat_list[21].sv_id.constellation = 70; - test_msg->stec_sat_list[21].sv_id.satId = 72; - - EXPECT_EQ(send_message( 0x5eb, 1831, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1831); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->header.iod_atmo, 4) << "incorrect value for header.iod_atmo, expected 4, is " << last_msg_->header.iod_atmo; - EXPECT_EQ(last_msg_->header.num_msgs, 147) << "incorrect value for header.num_msgs, expected 147, is " << last_msg_->header.num_msgs; - EXPECT_EQ(last_msg_->header.seq_num, 123) << "incorrect value for header.seq_num, expected 123, is " << last_msg_->header.seq_num; - EXPECT_EQ(last_msg_->header.time.tow, 3905179974) << "incorrect value for header.time.tow, expected 3905179974, is " << last_msg_->header.time.tow; - EXPECT_EQ(last_msg_->header.time.wn, 11193) << "incorrect value for header.time.wn, expected 11193, is " << last_msg_->header.time.wn; - EXPECT_EQ(last_msg_->header.update_interval, 39) << "incorrect value for header.update_interval, expected 39, is " << last_msg_->header.update_interval; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[0], -1951) << "incorrect value for stec_sat_list[0].stec_coeff[0], expected -1951, is " << last_msg_->stec_sat_list[0].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[1], -9854) << "incorrect value for stec_sat_list[0].stec_coeff[1], expected -9854, is " << last_msg_->stec_sat_list[0].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[2], 27353) << "incorrect value for stec_sat_list[0].stec_coeff[2], expected 27353, is " << last_msg_->stec_sat_list[0].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[3], 3130) << "incorrect value for stec_sat_list[0].stec_coeff[3], expected 3130, is " << last_msg_->stec_sat_list[0].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[0].stec_quality_indicator, 111) << "incorrect value for stec_sat_list[0].stec_quality_indicator, expected 111, is " << last_msg_->stec_sat_list[0].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[0].sv_id.constellation, 19) << "incorrect value for stec_sat_list[0].sv_id.constellation, expected 19, is " << last_msg_->stec_sat_list[0].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[0].sv_id.satId, 126) << "incorrect value for stec_sat_list[0].sv_id.satId, expected 126, is " << last_msg_->stec_sat_list[0].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[0], 24401) << "incorrect value for stec_sat_list[1].stec_coeff[0], expected 24401, is " << last_msg_->stec_sat_list[1].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[1], 4182) << "incorrect value for stec_sat_list[1].stec_coeff[1], expected 4182, is " << last_msg_->stec_sat_list[1].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[2], 21543) << "incorrect value for stec_sat_list[1].stec_coeff[2], expected 21543, is " << last_msg_->stec_sat_list[1].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[3], -12060) << "incorrect value for stec_sat_list[1].stec_coeff[3], expected -12060, is " << last_msg_->stec_sat_list[1].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[1].stec_quality_indicator, 171) << "incorrect value for stec_sat_list[1].stec_quality_indicator, expected 171, is " << last_msg_->stec_sat_list[1].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[1].sv_id.constellation, 230) << "incorrect value for stec_sat_list[1].sv_id.constellation, expected 230, is " << last_msg_->stec_sat_list[1].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[1].sv_id.satId, 65) << "incorrect value for stec_sat_list[1].sv_id.satId, expected 65, is " << last_msg_->stec_sat_list[1].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[0], -13469) << "incorrect value for stec_sat_list[2].stec_coeff[0], expected -13469, is " << last_msg_->stec_sat_list[2].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[1], -18883) << "incorrect value for stec_sat_list[2].stec_coeff[1], expected -18883, is " << last_msg_->stec_sat_list[2].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[2], 32066) << "incorrect value for stec_sat_list[2].stec_coeff[2], expected 32066, is " << last_msg_->stec_sat_list[2].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[3], 971) << "incorrect value for stec_sat_list[2].stec_coeff[3], expected 971, is " << last_msg_->stec_sat_list[2].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[2].stec_quality_indicator, 219) << "incorrect value for stec_sat_list[2].stec_quality_indicator, expected 219, is " << last_msg_->stec_sat_list[2].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[2].sv_id.constellation, 81) << "incorrect value for stec_sat_list[2].sv_id.constellation, expected 81, is " << last_msg_->stec_sat_list[2].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[2].sv_id.satId, 201) << "incorrect value for stec_sat_list[2].sv_id.satId, expected 201, is " << last_msg_->stec_sat_list[2].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[0], 32220) << "incorrect value for stec_sat_list[3].stec_coeff[0], expected 32220, is " << last_msg_->stec_sat_list[3].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[1], 5436) << "incorrect value for stec_sat_list[3].stec_coeff[1], expected 5436, is " << last_msg_->stec_sat_list[3].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[2], -9635) << "incorrect value for stec_sat_list[3].stec_coeff[2], expected -9635, is " << last_msg_->stec_sat_list[3].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[3], -24841) << "incorrect value for stec_sat_list[3].stec_coeff[3], expected -24841, is " << last_msg_->stec_sat_list[3].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[3].stec_quality_indicator, 100) << "incorrect value for stec_sat_list[3].stec_quality_indicator, expected 100, is " << last_msg_->stec_sat_list[3].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[3].sv_id.constellation, 44) << "incorrect value for stec_sat_list[3].sv_id.constellation, expected 44, is " << last_msg_->stec_sat_list[3].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[3].sv_id.satId, 193) << "incorrect value for stec_sat_list[3].sv_id.satId, expected 193, is " << last_msg_->stec_sat_list[3].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[0], 3718) << "incorrect value for stec_sat_list[4].stec_coeff[0], expected 3718, is " << last_msg_->stec_sat_list[4].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[1], 12497) << "incorrect value for stec_sat_list[4].stec_coeff[1], expected 12497, is " << last_msg_->stec_sat_list[4].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[2], -10482) << "incorrect value for stec_sat_list[4].stec_coeff[2], expected -10482, is " << last_msg_->stec_sat_list[4].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[3], -27495) << "incorrect value for stec_sat_list[4].stec_coeff[3], expected -27495, is " << last_msg_->stec_sat_list[4].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[4].stec_quality_indicator, 129) << "incorrect value for stec_sat_list[4].stec_quality_indicator, expected 129, is " << last_msg_->stec_sat_list[4].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[4].sv_id.constellation, 93) << "incorrect value for stec_sat_list[4].sv_id.constellation, expected 93, is " << last_msg_->stec_sat_list[4].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[4].sv_id.satId, 207) << "incorrect value for stec_sat_list[4].sv_id.satId, expected 207, is " << last_msg_->stec_sat_list[4].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[0], -4940) << "incorrect value for stec_sat_list[5].stec_coeff[0], expected -4940, is " << last_msg_->stec_sat_list[5].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[1], -13875) << "incorrect value for stec_sat_list[5].stec_coeff[1], expected -13875, is " << last_msg_->stec_sat_list[5].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[2], 801) << "incorrect value for stec_sat_list[5].stec_coeff[2], expected 801, is " << last_msg_->stec_sat_list[5].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[3], -13066) << "incorrect value for stec_sat_list[5].stec_coeff[3], expected -13066, is " << last_msg_->stec_sat_list[5].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[5].stec_quality_indicator, 225) << "incorrect value for stec_sat_list[5].stec_quality_indicator, expected 225, is " << last_msg_->stec_sat_list[5].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[5].sv_id.constellation, 72) << "incorrect value for stec_sat_list[5].sv_id.constellation, expected 72, is " << last_msg_->stec_sat_list[5].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[5].sv_id.satId, 147) << "incorrect value for stec_sat_list[5].sv_id.satId, expected 147, is " << last_msg_->stec_sat_list[5].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[0], -15868) << "incorrect value for stec_sat_list[6].stec_coeff[0], expected -15868, is " << last_msg_->stec_sat_list[6].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[1], -2369) << "incorrect value for stec_sat_list[6].stec_coeff[1], expected -2369, is " << last_msg_->stec_sat_list[6].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[2], -9396) << "incorrect value for stec_sat_list[6].stec_coeff[2], expected -9396, is " << last_msg_->stec_sat_list[6].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[3], -16609) << "incorrect value for stec_sat_list[6].stec_coeff[3], expected -16609, is " << last_msg_->stec_sat_list[6].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[6].stec_quality_indicator, 98) << "incorrect value for stec_sat_list[6].stec_quality_indicator, expected 98, is " << last_msg_->stec_sat_list[6].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[6].sv_id.constellation, 3) << "incorrect value for stec_sat_list[6].sv_id.constellation, expected 3, is " << last_msg_->stec_sat_list[6].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[6].sv_id.satId, 19) << "incorrect value for stec_sat_list[6].sv_id.satId, expected 19, is " << last_msg_->stec_sat_list[6].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[0], -1265) << "incorrect value for stec_sat_list[7].stec_coeff[0], expected -1265, is " << last_msg_->stec_sat_list[7].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[1], 4897) << "incorrect value for stec_sat_list[7].stec_coeff[1], expected 4897, is " << last_msg_->stec_sat_list[7].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[2], 13920) << "incorrect value for stec_sat_list[7].stec_coeff[2], expected 13920, is " << last_msg_->stec_sat_list[7].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[3], -28102) << "incorrect value for stec_sat_list[7].stec_coeff[3], expected -28102, is " << last_msg_->stec_sat_list[7].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[7].stec_quality_indicator, 177) << "incorrect value for stec_sat_list[7].stec_quality_indicator, expected 177, is " << last_msg_->stec_sat_list[7].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[7].sv_id.constellation, 79) << "incorrect value for stec_sat_list[7].sv_id.constellation, expected 79, is " << last_msg_->stec_sat_list[7].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[7].sv_id.satId, 113) << "incorrect value for stec_sat_list[7].sv_id.satId, expected 113, is " << last_msg_->stec_sat_list[7].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[0], 5448) << "incorrect value for stec_sat_list[8].stec_coeff[0], expected 5448, is " << last_msg_->stec_sat_list[8].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[1], -11359) << "incorrect value for stec_sat_list[8].stec_coeff[1], expected -11359, is " << last_msg_->stec_sat_list[8].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[2], 5574) << "incorrect value for stec_sat_list[8].stec_coeff[2], expected 5574, is " << last_msg_->stec_sat_list[8].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[3], 28654) << "incorrect value for stec_sat_list[8].stec_coeff[3], expected 28654, is " << last_msg_->stec_sat_list[8].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[8].stec_quality_indicator, 249) << "incorrect value for stec_sat_list[8].stec_quality_indicator, expected 249, is " << last_msg_->stec_sat_list[8].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[8].sv_id.constellation, 100) << "incorrect value for stec_sat_list[8].sv_id.constellation, expected 100, is " << last_msg_->stec_sat_list[8].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[8].sv_id.satId, 210) << "incorrect value for stec_sat_list[8].sv_id.satId, expected 210, is " << last_msg_->stec_sat_list[8].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[0], -10783) << "incorrect value for stec_sat_list[9].stec_coeff[0], expected -10783, is " << last_msg_->stec_sat_list[9].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[1], 18179) << "incorrect value for stec_sat_list[9].stec_coeff[1], expected 18179, is " << last_msg_->stec_sat_list[9].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[2], 16371) << "incorrect value for stec_sat_list[9].stec_coeff[2], expected 16371, is " << last_msg_->stec_sat_list[9].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[3], -5055) << "incorrect value for stec_sat_list[9].stec_coeff[3], expected -5055, is " << last_msg_->stec_sat_list[9].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[9].stec_quality_indicator, 227) << "incorrect value for stec_sat_list[9].stec_quality_indicator, expected 227, is " << last_msg_->stec_sat_list[9].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[9].sv_id.constellation, 36) << "incorrect value for stec_sat_list[9].sv_id.constellation, expected 36, is " << last_msg_->stec_sat_list[9].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[9].sv_id.satId, 107) << "incorrect value for stec_sat_list[9].sv_id.satId, expected 107, is " << last_msg_->stec_sat_list[9].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[0], 4009) << "incorrect value for stec_sat_list[10].stec_coeff[0], expected 4009, is " << last_msg_->stec_sat_list[10].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[1], 1462) << "incorrect value for stec_sat_list[10].stec_coeff[1], expected 1462, is " << last_msg_->stec_sat_list[10].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[2], -19216) << "incorrect value for stec_sat_list[10].stec_coeff[2], expected -19216, is " << last_msg_->stec_sat_list[10].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[3], 31241) << "incorrect value for stec_sat_list[10].stec_coeff[3], expected 31241, is " << last_msg_->stec_sat_list[10].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[10].stec_quality_indicator, 0) << "incorrect value for stec_sat_list[10].stec_quality_indicator, expected 0, is " << last_msg_->stec_sat_list[10].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[10].sv_id.constellation, 77) << "incorrect value for stec_sat_list[10].sv_id.constellation, expected 77, is " << last_msg_->stec_sat_list[10].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[10].sv_id.satId, 92) << "incorrect value for stec_sat_list[10].sv_id.satId, expected 92, is " << last_msg_->stec_sat_list[10].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[0], 26727) << "incorrect value for stec_sat_list[11].stec_coeff[0], expected 26727, is " << last_msg_->stec_sat_list[11].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[1], -16898) << "incorrect value for stec_sat_list[11].stec_coeff[1], expected -16898, is " << last_msg_->stec_sat_list[11].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[2], 28241) << "incorrect value for stec_sat_list[11].stec_coeff[2], expected 28241, is " << last_msg_->stec_sat_list[11].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[3], 12546) << "incorrect value for stec_sat_list[11].stec_coeff[3], expected 12546, is " << last_msg_->stec_sat_list[11].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[11].stec_quality_indicator, 6) << "incorrect value for stec_sat_list[11].stec_quality_indicator, expected 6, is " << last_msg_->stec_sat_list[11].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[11].sv_id.constellation, 232) << "incorrect value for stec_sat_list[11].sv_id.constellation, expected 232, is " << last_msg_->stec_sat_list[11].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[11].sv_id.satId, 86) << "incorrect value for stec_sat_list[11].sv_id.satId, expected 86, is " << last_msg_->stec_sat_list[11].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[0], 12855) << "incorrect value for stec_sat_list[12].stec_coeff[0], expected 12855, is " << last_msg_->stec_sat_list[12].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[1], 1461) << "incorrect value for stec_sat_list[12].stec_coeff[1], expected 1461, is " << last_msg_->stec_sat_list[12].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[2], 20603) << "incorrect value for stec_sat_list[12].stec_coeff[2], expected 20603, is " << last_msg_->stec_sat_list[12].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[3], -3023) << "incorrect value for stec_sat_list[12].stec_coeff[3], expected -3023, is " << last_msg_->stec_sat_list[12].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[12].stec_quality_indicator, 216) << "incorrect value for stec_sat_list[12].stec_quality_indicator, expected 216, is " << last_msg_->stec_sat_list[12].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[12].sv_id.constellation, 84) << "incorrect value for stec_sat_list[12].sv_id.constellation, expected 84, is " << last_msg_->stec_sat_list[12].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[12].sv_id.satId, 202) << "incorrect value for stec_sat_list[12].sv_id.satId, expected 202, is " << last_msg_->stec_sat_list[12].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[0], -6492) << "incorrect value for stec_sat_list[13].stec_coeff[0], expected -6492, is " << last_msg_->stec_sat_list[13].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[1], 16952) << "incorrect value for stec_sat_list[13].stec_coeff[1], expected 16952, is " << last_msg_->stec_sat_list[13].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[2], -22404) << "incorrect value for stec_sat_list[13].stec_coeff[2], expected -22404, is " << last_msg_->stec_sat_list[13].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[3], -29893) << "incorrect value for stec_sat_list[13].stec_coeff[3], expected -29893, is " << last_msg_->stec_sat_list[13].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[13].stec_quality_indicator, 125) << "incorrect value for stec_sat_list[13].stec_quality_indicator, expected 125, is " << last_msg_->stec_sat_list[13].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[13].sv_id.constellation, 188) << "incorrect value for stec_sat_list[13].sv_id.constellation, expected 188, is " << last_msg_->stec_sat_list[13].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[13].sv_id.satId, 224) << "incorrect value for stec_sat_list[13].sv_id.satId, expected 224, is " << last_msg_->stec_sat_list[13].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[0], -10053) << "incorrect value for stec_sat_list[14].stec_coeff[0], expected -10053, is " << last_msg_->stec_sat_list[14].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[1], -24897) << "incorrect value for stec_sat_list[14].stec_coeff[1], expected -24897, is " << last_msg_->stec_sat_list[14].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[2], 23629) << "incorrect value for stec_sat_list[14].stec_coeff[2], expected 23629, is " << last_msg_->stec_sat_list[14].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[3], -710) << "incorrect value for stec_sat_list[14].stec_coeff[3], expected -710, is " << last_msg_->stec_sat_list[14].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[14].stec_quality_indicator, 51) << "incorrect value for stec_sat_list[14].stec_quality_indicator, expected 51, is " << last_msg_->stec_sat_list[14].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[14].sv_id.constellation, 118) << "incorrect value for stec_sat_list[14].sv_id.constellation, expected 118, is " << last_msg_->stec_sat_list[14].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[14].sv_id.satId, 106) << "incorrect value for stec_sat_list[14].sv_id.satId, expected 106, is " << last_msg_->stec_sat_list[14].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[0], -26103) << "incorrect value for stec_sat_list[15].stec_coeff[0], expected -26103, is " << last_msg_->stec_sat_list[15].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[1], -9539) << "incorrect value for stec_sat_list[15].stec_coeff[1], expected -9539, is " << last_msg_->stec_sat_list[15].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[2], -11971) << "incorrect value for stec_sat_list[15].stec_coeff[2], expected -11971, is " << last_msg_->stec_sat_list[15].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[3], 20993) << "incorrect value for stec_sat_list[15].stec_coeff[3], expected 20993, is " << last_msg_->stec_sat_list[15].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[15].stec_quality_indicator, 165) << "incorrect value for stec_sat_list[15].stec_quality_indicator, expected 165, is " << last_msg_->stec_sat_list[15].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[15].sv_id.constellation, 150) << "incorrect value for stec_sat_list[15].sv_id.constellation, expected 150, is " << last_msg_->stec_sat_list[15].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[15].sv_id.satId, 132) << "incorrect value for stec_sat_list[15].sv_id.satId, expected 132, is " << last_msg_->stec_sat_list[15].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[0], -18891) << "incorrect value for stec_sat_list[16].stec_coeff[0], expected -18891, is " << last_msg_->stec_sat_list[16].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[1], -16272) << "incorrect value for stec_sat_list[16].stec_coeff[1], expected -16272, is " << last_msg_->stec_sat_list[16].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[2], -22578) << "incorrect value for stec_sat_list[16].stec_coeff[2], expected -22578, is " << last_msg_->stec_sat_list[16].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[3], -2915) << "incorrect value for stec_sat_list[16].stec_coeff[3], expected -2915, is " << last_msg_->stec_sat_list[16].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[16].stec_quality_indicator, 23) << "incorrect value for stec_sat_list[16].stec_quality_indicator, expected 23, is " << last_msg_->stec_sat_list[16].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[16].sv_id.constellation, 196) << "incorrect value for stec_sat_list[16].sv_id.constellation, expected 196, is " << last_msg_->stec_sat_list[16].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[16].sv_id.satId, 181) << "incorrect value for stec_sat_list[16].sv_id.satId, expected 181, is " << last_msg_->stec_sat_list[16].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[0], 15833) << "incorrect value for stec_sat_list[17].stec_coeff[0], expected 15833, is " << last_msg_->stec_sat_list[17].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[1], 24920) << "incorrect value for stec_sat_list[17].stec_coeff[1], expected 24920, is " << last_msg_->stec_sat_list[17].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[2], -13879) << "incorrect value for stec_sat_list[17].stec_coeff[2], expected -13879, is " << last_msg_->stec_sat_list[17].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[3], -1206) << "incorrect value for stec_sat_list[17].stec_coeff[3], expected -1206, is " << last_msg_->stec_sat_list[17].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[17].stec_quality_indicator, 189) << "incorrect value for stec_sat_list[17].stec_quality_indicator, expected 189, is " << last_msg_->stec_sat_list[17].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[17].sv_id.constellation, 1) << "incorrect value for stec_sat_list[17].sv_id.constellation, expected 1, is " << last_msg_->stec_sat_list[17].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[17].sv_id.satId, 35) << "incorrect value for stec_sat_list[17].sv_id.satId, expected 35, is " << last_msg_->stec_sat_list[17].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[0], 14008) << "incorrect value for stec_sat_list[18].stec_coeff[0], expected 14008, is " << last_msg_->stec_sat_list[18].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[1], 18996) << "incorrect value for stec_sat_list[18].stec_coeff[1], expected 18996, is " << last_msg_->stec_sat_list[18].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[2], 2798) << "incorrect value for stec_sat_list[18].stec_coeff[2], expected 2798, is " << last_msg_->stec_sat_list[18].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[3], 5761) << "incorrect value for stec_sat_list[18].stec_coeff[3], expected 5761, is " << last_msg_->stec_sat_list[18].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[18].stec_quality_indicator, 104) << "incorrect value for stec_sat_list[18].stec_quality_indicator, expected 104, is " << last_msg_->stec_sat_list[18].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[18].sv_id.constellation, 14) << "incorrect value for stec_sat_list[18].sv_id.constellation, expected 14, is " << last_msg_->stec_sat_list[18].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[18].sv_id.satId, 217) << "incorrect value for stec_sat_list[18].sv_id.satId, expected 217, is " << last_msg_->stec_sat_list[18].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[0], -25256) << "incorrect value for stec_sat_list[19].stec_coeff[0], expected -25256, is " << last_msg_->stec_sat_list[19].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[1], -15330) << "incorrect value for stec_sat_list[19].stec_coeff[1], expected -15330, is " << last_msg_->stec_sat_list[19].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[2], 6831) << "incorrect value for stec_sat_list[19].stec_coeff[2], expected 6831, is " << last_msg_->stec_sat_list[19].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[3], 8780) << "incorrect value for stec_sat_list[19].stec_coeff[3], expected 8780, is " << last_msg_->stec_sat_list[19].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[19].stec_quality_indicator, 109) << "incorrect value for stec_sat_list[19].stec_quality_indicator, expected 109, is " << last_msg_->stec_sat_list[19].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[19].sv_id.constellation, 226) << "incorrect value for stec_sat_list[19].sv_id.constellation, expected 226, is " << last_msg_->stec_sat_list[19].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[19].sv_id.satId, 178) << "incorrect value for stec_sat_list[19].sv_id.satId, expected 178, is " << last_msg_->stec_sat_list[19].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[0], 3304) << "incorrect value for stec_sat_list[20].stec_coeff[0], expected 3304, is " << last_msg_->stec_sat_list[20].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[1], -2893) << "incorrect value for stec_sat_list[20].stec_coeff[1], expected -2893, is " << last_msg_->stec_sat_list[20].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[2], -25841) << "incorrect value for stec_sat_list[20].stec_coeff[2], expected -25841, is " << last_msg_->stec_sat_list[20].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[3], -13628) << "incorrect value for stec_sat_list[20].stec_coeff[3], expected -13628, is " << last_msg_->stec_sat_list[20].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[20].stec_quality_indicator, 154) << "incorrect value for stec_sat_list[20].stec_quality_indicator, expected 154, is " << last_msg_->stec_sat_list[20].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[20].sv_id.constellation, 220) << "incorrect value for stec_sat_list[20].sv_id.constellation, expected 220, is " << last_msg_->stec_sat_list[20].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[20].sv_id.satId, 116) << "incorrect value for stec_sat_list[20].sv_id.satId, expected 116, is " << last_msg_->stec_sat_list[20].sv_id.satId; - EXPECT_EQ(last_msg_->stec_sat_list[21].stec_coeff[0], -10742) << "incorrect value for stec_sat_list[21].stec_coeff[0], expected -10742, is " << last_msg_->stec_sat_list[21].stec_coeff[0]; - EXPECT_EQ(last_msg_->stec_sat_list[21].stec_coeff[1], 10098) << "incorrect value for stec_sat_list[21].stec_coeff[1], expected 10098, is " << last_msg_->stec_sat_list[21].stec_coeff[1]; - EXPECT_EQ(last_msg_->stec_sat_list[21].stec_coeff[2], 7413) << "incorrect value for stec_sat_list[21].stec_coeff[2], expected 7413, is " << last_msg_->stec_sat_list[21].stec_coeff[2]; - EXPECT_EQ(last_msg_->stec_sat_list[21].stec_coeff[3], 17645) << "incorrect value for stec_sat_list[21].stec_coeff[3], expected 17645, is " << last_msg_->stec_sat_list[21].stec_coeff[3]; - EXPECT_EQ(last_msg_->stec_sat_list[21].stec_quality_indicator, 115) << "incorrect value for stec_sat_list[21].stec_quality_indicator, expected 115, is " << last_msg_->stec_sat_list[21].stec_quality_indicator; - EXPECT_EQ(last_msg_->stec_sat_list[21].sv_id.constellation, 70) << "incorrect value for stec_sat_list[21].sv_id.constellation, expected 70, is " << last_msg_->stec_sat_list[21].sv_id.constellation; - EXPECT_EQ(last_msg_->stec_sat_list[21].sv_id.satId, 72) << "incorrect value for stec_sat_list[21].sv_id.satId, expected 72, is " << last_msg_->stec_sat_list[21].sv_id.satId; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1831); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->header.iod_atmo, 4) + << "incorrect value for header.iod_atmo, expected 4, is " + << last_msg_->header.iod_atmo; + EXPECT_EQ(last_msg_->header.num_msgs, 147) + << "incorrect value for header.num_msgs, expected 147, is " + << last_msg_->header.num_msgs; + EXPECT_EQ(last_msg_->header.seq_num, 123) + << "incorrect value for header.seq_num, expected 123, is " + << last_msg_->header.seq_num; + EXPECT_EQ(last_msg_->header.time.tow, 3905179974) + << "incorrect value for header.time.tow, expected 3905179974, is " + << last_msg_->header.time.tow; + EXPECT_EQ(last_msg_->header.time.wn, 11193) + << "incorrect value for header.time.wn, expected 11193, is " + << last_msg_->header.time.wn; + EXPECT_EQ(last_msg_->header.update_interval, 39) + << "incorrect value for header.update_interval, expected 39, is " + << last_msg_->header.update_interval; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[0], -1951) + << "incorrect value for stec_sat_list[0].stec_coeff[0], expected -1951, " + "is " + << last_msg_->stec_sat_list[0].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[1], -9854) + << "incorrect value for stec_sat_list[0].stec_coeff[1], expected -9854, " + "is " + << last_msg_->stec_sat_list[0].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[2], 27353) + << "incorrect value for stec_sat_list[0].stec_coeff[2], expected 27353, " + "is " + << last_msg_->stec_sat_list[0].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_coeff[3], 3130) + << "incorrect value for stec_sat_list[0].stec_coeff[3], expected 3130, " + "is " + << last_msg_->stec_sat_list[0].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[0].stec_quality_indicator, 111) + << "incorrect value for stec_sat_list[0].stec_quality_indicator, " + "expected 111, is " + << last_msg_->stec_sat_list[0].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[0].sv_id.constellation, 19) + << "incorrect value for stec_sat_list[0].sv_id.constellation, expected " + "19, is " + << last_msg_->stec_sat_list[0].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[0].sv_id.satId, 126) + << "incorrect value for stec_sat_list[0].sv_id.satId, expected 126, is " + << last_msg_->stec_sat_list[0].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[0], 24401) + << "incorrect value for stec_sat_list[1].stec_coeff[0], expected 24401, " + "is " + << last_msg_->stec_sat_list[1].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[1], 4182) + << "incorrect value for stec_sat_list[1].stec_coeff[1], expected 4182, " + "is " + << last_msg_->stec_sat_list[1].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[2], 21543) + << "incorrect value for stec_sat_list[1].stec_coeff[2], expected 21543, " + "is " + << last_msg_->stec_sat_list[1].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_coeff[3], -12060) + << "incorrect value for stec_sat_list[1].stec_coeff[3], expected -12060, " + "is " + << last_msg_->stec_sat_list[1].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[1].stec_quality_indicator, 171) + << "incorrect value for stec_sat_list[1].stec_quality_indicator, " + "expected 171, is " + << last_msg_->stec_sat_list[1].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[1].sv_id.constellation, 230) + << "incorrect value for stec_sat_list[1].sv_id.constellation, expected " + "230, is " + << last_msg_->stec_sat_list[1].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[1].sv_id.satId, 65) + << "incorrect value for stec_sat_list[1].sv_id.satId, expected 65, is " + << last_msg_->stec_sat_list[1].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[0], -13469) + << "incorrect value for stec_sat_list[2].stec_coeff[0], expected -13469, " + "is " + << last_msg_->stec_sat_list[2].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[1], -18883) + << "incorrect value for stec_sat_list[2].stec_coeff[1], expected -18883, " + "is " + << last_msg_->stec_sat_list[2].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[2], 32066) + << "incorrect value for stec_sat_list[2].stec_coeff[2], expected 32066, " + "is " + << last_msg_->stec_sat_list[2].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[2].stec_coeff[3], 971) + << "incorrect value for stec_sat_list[2].stec_coeff[3], expected 971, is " + << last_msg_->stec_sat_list[2].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[2].stec_quality_indicator, 219) + << "incorrect value for stec_sat_list[2].stec_quality_indicator, " + "expected 219, is " + << last_msg_->stec_sat_list[2].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[2].sv_id.constellation, 81) + << "incorrect value for stec_sat_list[2].sv_id.constellation, expected " + "81, is " + << last_msg_->stec_sat_list[2].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[2].sv_id.satId, 201) + << "incorrect value for stec_sat_list[2].sv_id.satId, expected 201, is " + << last_msg_->stec_sat_list[2].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[0], 32220) + << "incorrect value for stec_sat_list[3].stec_coeff[0], expected 32220, " + "is " + << last_msg_->stec_sat_list[3].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[1], 5436) + << "incorrect value for stec_sat_list[3].stec_coeff[1], expected 5436, " + "is " + << last_msg_->stec_sat_list[3].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[2], -9635) + << "incorrect value for stec_sat_list[3].stec_coeff[2], expected -9635, " + "is " + << last_msg_->stec_sat_list[3].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[3].stec_coeff[3], -24841) + << "incorrect value for stec_sat_list[3].stec_coeff[3], expected -24841, " + "is " + << last_msg_->stec_sat_list[3].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[3].stec_quality_indicator, 100) + << "incorrect value for stec_sat_list[3].stec_quality_indicator, " + "expected 100, is " + << last_msg_->stec_sat_list[3].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[3].sv_id.constellation, 44) + << "incorrect value for stec_sat_list[3].sv_id.constellation, expected " + "44, is " + << last_msg_->stec_sat_list[3].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[3].sv_id.satId, 193) + << "incorrect value for stec_sat_list[3].sv_id.satId, expected 193, is " + << last_msg_->stec_sat_list[3].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[0], 3718) + << "incorrect value for stec_sat_list[4].stec_coeff[0], expected 3718, " + "is " + << last_msg_->stec_sat_list[4].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[1], 12497) + << "incorrect value for stec_sat_list[4].stec_coeff[1], expected 12497, " + "is " + << last_msg_->stec_sat_list[4].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[2], -10482) + << "incorrect value for stec_sat_list[4].stec_coeff[2], expected -10482, " + "is " + << last_msg_->stec_sat_list[4].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[4].stec_coeff[3], -27495) + << "incorrect value for stec_sat_list[4].stec_coeff[3], expected -27495, " + "is " + << last_msg_->stec_sat_list[4].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[4].stec_quality_indicator, 129) + << "incorrect value for stec_sat_list[4].stec_quality_indicator, " + "expected 129, is " + << last_msg_->stec_sat_list[4].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[4].sv_id.constellation, 93) + << "incorrect value for stec_sat_list[4].sv_id.constellation, expected " + "93, is " + << last_msg_->stec_sat_list[4].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[4].sv_id.satId, 207) + << "incorrect value for stec_sat_list[4].sv_id.satId, expected 207, is " + << last_msg_->stec_sat_list[4].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[0], -4940) + << "incorrect value for stec_sat_list[5].stec_coeff[0], expected -4940, " + "is " + << last_msg_->stec_sat_list[5].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[1], -13875) + << "incorrect value for stec_sat_list[5].stec_coeff[1], expected -13875, " + "is " + << last_msg_->stec_sat_list[5].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[2], 801) + << "incorrect value for stec_sat_list[5].stec_coeff[2], expected 801, is " + << last_msg_->stec_sat_list[5].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[5].stec_coeff[3], -13066) + << "incorrect value for stec_sat_list[5].stec_coeff[3], expected -13066, " + "is " + << last_msg_->stec_sat_list[5].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[5].stec_quality_indicator, 225) + << "incorrect value for stec_sat_list[5].stec_quality_indicator, " + "expected 225, is " + << last_msg_->stec_sat_list[5].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[5].sv_id.constellation, 72) + << "incorrect value for stec_sat_list[5].sv_id.constellation, expected " + "72, is " + << last_msg_->stec_sat_list[5].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[5].sv_id.satId, 147) + << "incorrect value for stec_sat_list[5].sv_id.satId, expected 147, is " + << last_msg_->stec_sat_list[5].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[0], -15868) + << "incorrect value for stec_sat_list[6].stec_coeff[0], expected -15868, " + "is " + << last_msg_->stec_sat_list[6].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[1], -2369) + << "incorrect value for stec_sat_list[6].stec_coeff[1], expected -2369, " + "is " + << last_msg_->stec_sat_list[6].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[2], -9396) + << "incorrect value for stec_sat_list[6].stec_coeff[2], expected -9396, " + "is " + << last_msg_->stec_sat_list[6].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[6].stec_coeff[3], -16609) + << "incorrect value for stec_sat_list[6].stec_coeff[3], expected -16609, " + "is " + << last_msg_->stec_sat_list[6].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[6].stec_quality_indicator, 98) + << "incorrect value for stec_sat_list[6].stec_quality_indicator, " + "expected 98, is " + << last_msg_->stec_sat_list[6].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[6].sv_id.constellation, 3) + << "incorrect value for stec_sat_list[6].sv_id.constellation, expected " + "3, is " + << last_msg_->stec_sat_list[6].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[6].sv_id.satId, 19) + << "incorrect value for stec_sat_list[6].sv_id.satId, expected 19, is " + << last_msg_->stec_sat_list[6].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[0], -1265) + << "incorrect value for stec_sat_list[7].stec_coeff[0], expected -1265, " + "is " + << last_msg_->stec_sat_list[7].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[1], 4897) + << "incorrect value for stec_sat_list[7].stec_coeff[1], expected 4897, " + "is " + << last_msg_->stec_sat_list[7].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[2], 13920) + << "incorrect value for stec_sat_list[7].stec_coeff[2], expected 13920, " + "is " + << last_msg_->stec_sat_list[7].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[7].stec_coeff[3], -28102) + << "incorrect value for stec_sat_list[7].stec_coeff[3], expected -28102, " + "is " + << last_msg_->stec_sat_list[7].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[7].stec_quality_indicator, 177) + << "incorrect value for stec_sat_list[7].stec_quality_indicator, " + "expected 177, is " + << last_msg_->stec_sat_list[7].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[7].sv_id.constellation, 79) + << "incorrect value for stec_sat_list[7].sv_id.constellation, expected " + "79, is " + << last_msg_->stec_sat_list[7].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[7].sv_id.satId, 113) + << "incorrect value for stec_sat_list[7].sv_id.satId, expected 113, is " + << last_msg_->stec_sat_list[7].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[0], 5448) + << "incorrect value for stec_sat_list[8].stec_coeff[0], expected 5448, " + "is " + << last_msg_->stec_sat_list[8].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[1], -11359) + << "incorrect value for stec_sat_list[8].stec_coeff[1], expected -11359, " + "is " + << last_msg_->stec_sat_list[8].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[2], 5574) + << "incorrect value for stec_sat_list[8].stec_coeff[2], expected 5574, " + "is " + << last_msg_->stec_sat_list[8].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[8].stec_coeff[3], 28654) + << "incorrect value for stec_sat_list[8].stec_coeff[3], expected 28654, " + "is " + << last_msg_->stec_sat_list[8].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[8].stec_quality_indicator, 249) + << "incorrect value for stec_sat_list[8].stec_quality_indicator, " + "expected 249, is " + << last_msg_->stec_sat_list[8].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[8].sv_id.constellation, 100) + << "incorrect value for stec_sat_list[8].sv_id.constellation, expected " + "100, is " + << last_msg_->stec_sat_list[8].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[8].sv_id.satId, 210) + << "incorrect value for stec_sat_list[8].sv_id.satId, expected 210, is " + << last_msg_->stec_sat_list[8].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[0], -10783) + << "incorrect value for stec_sat_list[9].stec_coeff[0], expected -10783, " + "is " + << last_msg_->stec_sat_list[9].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[1], 18179) + << "incorrect value for stec_sat_list[9].stec_coeff[1], expected 18179, " + "is " + << last_msg_->stec_sat_list[9].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[2], 16371) + << "incorrect value for stec_sat_list[9].stec_coeff[2], expected 16371, " + "is " + << last_msg_->stec_sat_list[9].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[9].stec_coeff[3], -5055) + << "incorrect value for stec_sat_list[9].stec_coeff[3], expected -5055, " + "is " + << last_msg_->stec_sat_list[9].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[9].stec_quality_indicator, 227) + << "incorrect value for stec_sat_list[9].stec_quality_indicator, " + "expected 227, is " + << last_msg_->stec_sat_list[9].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[9].sv_id.constellation, 36) + << "incorrect value for stec_sat_list[9].sv_id.constellation, expected " + "36, is " + << last_msg_->stec_sat_list[9].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[9].sv_id.satId, 107) + << "incorrect value for stec_sat_list[9].sv_id.satId, expected 107, is " + << last_msg_->stec_sat_list[9].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[0], 4009) + << "incorrect value for stec_sat_list[10].stec_coeff[0], expected 4009, " + "is " + << last_msg_->stec_sat_list[10].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[1], 1462) + << "incorrect value for stec_sat_list[10].stec_coeff[1], expected 1462, " + "is " + << last_msg_->stec_sat_list[10].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[2], -19216) + << "incorrect value for stec_sat_list[10].stec_coeff[2], expected " + "-19216, is " + << last_msg_->stec_sat_list[10].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[10].stec_coeff[3], 31241) + << "incorrect value for stec_sat_list[10].stec_coeff[3], expected 31241, " + "is " + << last_msg_->stec_sat_list[10].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[10].stec_quality_indicator, 0) + << "incorrect value for stec_sat_list[10].stec_quality_indicator, " + "expected 0, is " + << last_msg_->stec_sat_list[10].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[10].sv_id.constellation, 77) + << "incorrect value for stec_sat_list[10].sv_id.constellation, expected " + "77, is " + << last_msg_->stec_sat_list[10].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[10].sv_id.satId, 92) + << "incorrect value for stec_sat_list[10].sv_id.satId, expected 92, is " + << last_msg_->stec_sat_list[10].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[0], 26727) + << "incorrect value for stec_sat_list[11].stec_coeff[0], expected 26727, " + "is " + << last_msg_->stec_sat_list[11].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[1], -16898) + << "incorrect value for stec_sat_list[11].stec_coeff[1], expected " + "-16898, is " + << last_msg_->stec_sat_list[11].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[2], 28241) + << "incorrect value for stec_sat_list[11].stec_coeff[2], expected 28241, " + "is " + << last_msg_->stec_sat_list[11].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[11].stec_coeff[3], 12546) + << "incorrect value for stec_sat_list[11].stec_coeff[3], expected 12546, " + "is " + << last_msg_->stec_sat_list[11].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[11].stec_quality_indicator, 6) + << "incorrect value for stec_sat_list[11].stec_quality_indicator, " + "expected 6, is " + << last_msg_->stec_sat_list[11].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[11].sv_id.constellation, 232) + << "incorrect value for stec_sat_list[11].sv_id.constellation, expected " + "232, is " + << last_msg_->stec_sat_list[11].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[11].sv_id.satId, 86) + << "incorrect value for stec_sat_list[11].sv_id.satId, expected 86, is " + << last_msg_->stec_sat_list[11].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[0], 12855) + << "incorrect value for stec_sat_list[12].stec_coeff[0], expected 12855, " + "is " + << last_msg_->stec_sat_list[12].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[1], 1461) + << "incorrect value for stec_sat_list[12].stec_coeff[1], expected 1461, " + "is " + << last_msg_->stec_sat_list[12].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[2], 20603) + << "incorrect value for stec_sat_list[12].stec_coeff[2], expected 20603, " + "is " + << last_msg_->stec_sat_list[12].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[12].stec_coeff[3], -3023) + << "incorrect value for stec_sat_list[12].stec_coeff[3], expected -3023, " + "is " + << last_msg_->stec_sat_list[12].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[12].stec_quality_indicator, 216) + << "incorrect value for stec_sat_list[12].stec_quality_indicator, " + "expected 216, is " + << last_msg_->stec_sat_list[12].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[12].sv_id.constellation, 84) + << "incorrect value for stec_sat_list[12].sv_id.constellation, expected " + "84, is " + << last_msg_->stec_sat_list[12].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[12].sv_id.satId, 202) + << "incorrect value for stec_sat_list[12].sv_id.satId, expected 202, is " + << last_msg_->stec_sat_list[12].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[0], -6492) + << "incorrect value for stec_sat_list[13].stec_coeff[0], expected -6492, " + "is " + << last_msg_->stec_sat_list[13].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[1], 16952) + << "incorrect value for stec_sat_list[13].stec_coeff[1], expected 16952, " + "is " + << last_msg_->stec_sat_list[13].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[2], -22404) + << "incorrect value for stec_sat_list[13].stec_coeff[2], expected " + "-22404, is " + << last_msg_->stec_sat_list[13].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[13].stec_coeff[3], -29893) + << "incorrect value for stec_sat_list[13].stec_coeff[3], expected " + "-29893, is " + << last_msg_->stec_sat_list[13].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[13].stec_quality_indicator, 125) + << "incorrect value for stec_sat_list[13].stec_quality_indicator, " + "expected 125, is " + << last_msg_->stec_sat_list[13].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[13].sv_id.constellation, 188) + << "incorrect value for stec_sat_list[13].sv_id.constellation, expected " + "188, is " + << last_msg_->stec_sat_list[13].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[13].sv_id.satId, 224) + << "incorrect value for stec_sat_list[13].sv_id.satId, expected 224, is " + << last_msg_->stec_sat_list[13].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[0], -10053) + << "incorrect value for stec_sat_list[14].stec_coeff[0], expected " + "-10053, is " + << last_msg_->stec_sat_list[14].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[1], -24897) + << "incorrect value for stec_sat_list[14].stec_coeff[1], expected " + "-24897, is " + << last_msg_->stec_sat_list[14].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[2], 23629) + << "incorrect value for stec_sat_list[14].stec_coeff[2], expected 23629, " + "is " + << last_msg_->stec_sat_list[14].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[14].stec_coeff[3], -710) + << "incorrect value for stec_sat_list[14].stec_coeff[3], expected -710, " + "is " + << last_msg_->stec_sat_list[14].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[14].stec_quality_indicator, 51) + << "incorrect value for stec_sat_list[14].stec_quality_indicator, " + "expected 51, is " + << last_msg_->stec_sat_list[14].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[14].sv_id.constellation, 118) + << "incorrect value for stec_sat_list[14].sv_id.constellation, expected " + "118, is " + << last_msg_->stec_sat_list[14].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[14].sv_id.satId, 106) + << "incorrect value for stec_sat_list[14].sv_id.satId, expected 106, is " + << last_msg_->stec_sat_list[14].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[0], -26103) + << "incorrect value for stec_sat_list[15].stec_coeff[0], expected " + "-26103, is " + << last_msg_->stec_sat_list[15].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[1], -9539) + << "incorrect value for stec_sat_list[15].stec_coeff[1], expected -9539, " + "is " + << last_msg_->stec_sat_list[15].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[2], -11971) + << "incorrect value for stec_sat_list[15].stec_coeff[2], expected " + "-11971, is " + << last_msg_->stec_sat_list[15].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[15].stec_coeff[3], 20993) + << "incorrect value for stec_sat_list[15].stec_coeff[3], expected 20993, " + "is " + << last_msg_->stec_sat_list[15].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[15].stec_quality_indicator, 165) + << "incorrect value for stec_sat_list[15].stec_quality_indicator, " + "expected 165, is " + << last_msg_->stec_sat_list[15].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[15].sv_id.constellation, 150) + << "incorrect value for stec_sat_list[15].sv_id.constellation, expected " + "150, is " + << last_msg_->stec_sat_list[15].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[15].sv_id.satId, 132) + << "incorrect value for stec_sat_list[15].sv_id.satId, expected 132, is " + << last_msg_->stec_sat_list[15].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[0], -18891) + << "incorrect value for stec_sat_list[16].stec_coeff[0], expected " + "-18891, is " + << last_msg_->stec_sat_list[16].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[1], -16272) + << "incorrect value for stec_sat_list[16].stec_coeff[1], expected " + "-16272, is " + << last_msg_->stec_sat_list[16].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[2], -22578) + << "incorrect value for stec_sat_list[16].stec_coeff[2], expected " + "-22578, is " + << last_msg_->stec_sat_list[16].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[16].stec_coeff[3], -2915) + << "incorrect value for stec_sat_list[16].stec_coeff[3], expected -2915, " + "is " + << last_msg_->stec_sat_list[16].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[16].stec_quality_indicator, 23) + << "incorrect value for stec_sat_list[16].stec_quality_indicator, " + "expected 23, is " + << last_msg_->stec_sat_list[16].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[16].sv_id.constellation, 196) + << "incorrect value for stec_sat_list[16].sv_id.constellation, expected " + "196, is " + << last_msg_->stec_sat_list[16].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[16].sv_id.satId, 181) + << "incorrect value for stec_sat_list[16].sv_id.satId, expected 181, is " + << last_msg_->stec_sat_list[16].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[0], 15833) + << "incorrect value for stec_sat_list[17].stec_coeff[0], expected 15833, " + "is " + << last_msg_->stec_sat_list[17].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[1], 24920) + << "incorrect value for stec_sat_list[17].stec_coeff[1], expected 24920, " + "is " + << last_msg_->stec_sat_list[17].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[2], -13879) + << "incorrect value for stec_sat_list[17].stec_coeff[2], expected " + "-13879, is " + << last_msg_->stec_sat_list[17].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[17].stec_coeff[3], -1206) + << "incorrect value for stec_sat_list[17].stec_coeff[3], expected -1206, " + "is " + << last_msg_->stec_sat_list[17].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[17].stec_quality_indicator, 189) + << "incorrect value for stec_sat_list[17].stec_quality_indicator, " + "expected 189, is " + << last_msg_->stec_sat_list[17].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[17].sv_id.constellation, 1) + << "incorrect value for stec_sat_list[17].sv_id.constellation, expected " + "1, is " + << last_msg_->stec_sat_list[17].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[17].sv_id.satId, 35) + << "incorrect value for stec_sat_list[17].sv_id.satId, expected 35, is " + << last_msg_->stec_sat_list[17].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[0], 14008) + << "incorrect value for stec_sat_list[18].stec_coeff[0], expected 14008, " + "is " + << last_msg_->stec_sat_list[18].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[1], 18996) + << "incorrect value for stec_sat_list[18].stec_coeff[1], expected 18996, " + "is " + << last_msg_->stec_sat_list[18].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[2], 2798) + << "incorrect value for stec_sat_list[18].stec_coeff[2], expected 2798, " + "is " + << last_msg_->stec_sat_list[18].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[18].stec_coeff[3], 5761) + << "incorrect value for stec_sat_list[18].stec_coeff[3], expected 5761, " + "is " + << last_msg_->stec_sat_list[18].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[18].stec_quality_indicator, 104) + << "incorrect value for stec_sat_list[18].stec_quality_indicator, " + "expected 104, is " + << last_msg_->stec_sat_list[18].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[18].sv_id.constellation, 14) + << "incorrect value for stec_sat_list[18].sv_id.constellation, expected " + "14, is " + << last_msg_->stec_sat_list[18].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[18].sv_id.satId, 217) + << "incorrect value for stec_sat_list[18].sv_id.satId, expected 217, is " + << last_msg_->stec_sat_list[18].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[0], -25256) + << "incorrect value for stec_sat_list[19].stec_coeff[0], expected " + "-25256, is " + << last_msg_->stec_sat_list[19].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[1], -15330) + << "incorrect value for stec_sat_list[19].stec_coeff[1], expected " + "-15330, is " + << last_msg_->stec_sat_list[19].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[2], 6831) + << "incorrect value for stec_sat_list[19].stec_coeff[2], expected 6831, " + "is " + << last_msg_->stec_sat_list[19].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[19].stec_coeff[3], 8780) + << "incorrect value for stec_sat_list[19].stec_coeff[3], expected 8780, " + "is " + << last_msg_->stec_sat_list[19].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[19].stec_quality_indicator, 109) + << "incorrect value for stec_sat_list[19].stec_quality_indicator, " + "expected 109, is " + << last_msg_->stec_sat_list[19].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[19].sv_id.constellation, 226) + << "incorrect value for stec_sat_list[19].sv_id.constellation, expected " + "226, is " + << last_msg_->stec_sat_list[19].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[19].sv_id.satId, 178) + << "incorrect value for stec_sat_list[19].sv_id.satId, expected 178, is " + << last_msg_->stec_sat_list[19].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[0], 3304) + << "incorrect value for stec_sat_list[20].stec_coeff[0], expected 3304, " + "is " + << last_msg_->stec_sat_list[20].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[1], -2893) + << "incorrect value for stec_sat_list[20].stec_coeff[1], expected -2893, " + "is " + << last_msg_->stec_sat_list[20].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[2], -25841) + << "incorrect value for stec_sat_list[20].stec_coeff[2], expected " + "-25841, is " + << last_msg_->stec_sat_list[20].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[20].stec_coeff[3], -13628) + << "incorrect value for stec_sat_list[20].stec_coeff[3], expected " + "-13628, is " + << last_msg_->stec_sat_list[20].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[20].stec_quality_indicator, 154) + << "incorrect value for stec_sat_list[20].stec_quality_indicator, " + "expected 154, is " + << last_msg_->stec_sat_list[20].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[20].sv_id.constellation, 220) + << "incorrect value for stec_sat_list[20].sv_id.constellation, expected " + "220, is " + << last_msg_->stec_sat_list[20].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[20].sv_id.satId, 116) + << "incorrect value for stec_sat_list[20].sv_id.satId, expected 116, is " + << last_msg_->stec_sat_list[20].sv_id.satId; + EXPECT_EQ(last_msg_->stec_sat_list[21].stec_coeff[0], -10742) + << "incorrect value for stec_sat_list[21].stec_coeff[0], expected " + "-10742, is " + << last_msg_->stec_sat_list[21].stec_coeff[0]; + EXPECT_EQ(last_msg_->stec_sat_list[21].stec_coeff[1], 10098) + << "incorrect value for stec_sat_list[21].stec_coeff[1], expected 10098, " + "is " + << last_msg_->stec_sat_list[21].stec_coeff[1]; + EXPECT_EQ(last_msg_->stec_sat_list[21].stec_coeff[2], 7413) + << "incorrect value for stec_sat_list[21].stec_coeff[2], expected 7413, " + "is " + << last_msg_->stec_sat_list[21].stec_coeff[2]; + EXPECT_EQ(last_msg_->stec_sat_list[21].stec_coeff[3], 17645) + << "incorrect value for stec_sat_list[21].stec_coeff[3], expected 17645, " + "is " + << last_msg_->stec_sat_list[21].stec_coeff[3]; + EXPECT_EQ(last_msg_->stec_sat_list[21].stec_quality_indicator, 115) + << "incorrect value for stec_sat_list[21].stec_quality_indicator, " + "expected 115, is " + << last_msg_->stec_sat_list[21].stec_quality_indicator; + EXPECT_EQ(last_msg_->stec_sat_list[21].sv_id.constellation, 70) + << "incorrect value for stec_sat_list[21].sv_id.constellation, expected " + "70, is " + << last_msg_->stec_sat_list[21].sv_id.constellation; + EXPECT_EQ(last_msg_->stec_sat_list[21].sv_id.satId, 72) + << "incorrect value for stec_sat_list[21].sv_id.satId, expected 72, is " + << last_msg_->stec_sat_list[21].sv_id.satId; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrTileDefinition.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrTileDefinition.cc index 14321f5e8..b5a6f4983 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrTileDefinition.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrTileDefinition.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinition.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinition.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinition0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinition0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinition0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinition0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_tile_definition_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_tile_definition_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,61 +82,87 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinition0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_tile_definition_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinition0, Test) -{ +}; - uint8_t encoded_frame[] = {85,248,5,0,0,33,127,58,9,0,174,8,1,2,3,4,0,5,0,186,28,59,167,100,0,100,0,6,0,6,0,210,2,150,73,0,0,0,0,204,94, }; +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinition0, Test) { + uint8_t encoded_frame[] = { + 85, 248, 5, 0, 0, 33, 127, 58, 9, 0, 174, 8, 1, 2, + 3, 4, 0, 5, 0, 186, 28, 59, 167, 100, 0, 100, 0, 6, + 0, 6, 0, 210, 2, 150, 73, 0, 0, 0, 0, 204, 94, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_tile_definition_t* test_msg = ( msg_ssr_tile_definition_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->bitmask = 1234567890; - test_msg->cols = 6; - test_msg->corner_nw_lat = 7354; - test_msg->corner_nw_lon = -22725; - test_msg->iod_atmo = 3; - test_msg->rows = 6; - test_msg->sol_id = 2; - test_msg->spacing_lat = 100; - test_msg->spacing_lon = 100; - test_msg->tile_id = 5; - test_msg->tile_set_id = 4; - test_msg->time.tow = 604799; - test_msg->time.wn = 2222; - test_msg->update_interval = 1; - - EXPECT_EQ(send_message( 0x5F8, 0, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_tile_definition_t *test_msg = + (msg_ssr_tile_definition_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->bitmask = 1234567890; + test_msg->cols = 6; + test_msg->corner_nw_lat = 7354; + test_msg->corner_nw_lon = -22725; + test_msg->iod_atmo = 3; + test_msg->rows = 6; + test_msg->sol_id = 2; + test_msg->spacing_lat = 100; + test_msg->spacing_lon = 100; + test_msg->tile_id = 5; + test_msg->tile_set_id = 4; + test_msg->time.tow = 604799; + test_msg->time.wn = 2222; + test_msg->update_interval = 1; + + EXPECT_EQ(send_message(0x5F8, 0, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 0); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->bitmask, 1234567890) << "incorrect value for bitmask, expected 1234567890, is " << last_msg_->bitmask; - EXPECT_EQ(last_msg_->cols, 6) << "incorrect value for cols, expected 6, is " << last_msg_->cols; - EXPECT_EQ(last_msg_->corner_nw_lat, 7354) << "incorrect value for corner_nw_lat, expected 7354, is " << last_msg_->corner_nw_lat; - EXPECT_EQ(last_msg_->corner_nw_lon, -22725) << "incorrect value for corner_nw_lon, expected -22725, is " << last_msg_->corner_nw_lon; - EXPECT_EQ(last_msg_->iod_atmo, 3) << "incorrect value for iod_atmo, expected 3, is " << last_msg_->iod_atmo; - EXPECT_EQ(last_msg_->rows, 6) << "incorrect value for rows, expected 6, is " << last_msg_->rows; - EXPECT_EQ(last_msg_->sol_id, 2) << "incorrect value for sol_id, expected 2, is " << last_msg_->sol_id; - EXPECT_EQ(last_msg_->spacing_lat, 100) << "incorrect value for spacing_lat, expected 100, is " << last_msg_->spacing_lat; - EXPECT_EQ(last_msg_->spacing_lon, 100) << "incorrect value for spacing_lon, expected 100, is " << last_msg_->spacing_lon; - EXPECT_EQ(last_msg_->tile_id, 5) << "incorrect value for tile_id, expected 5, is " << last_msg_->tile_id; - EXPECT_EQ(last_msg_->tile_set_id, 4) << "incorrect value for tile_set_id, expected 4, is " << last_msg_->tile_set_id; - EXPECT_EQ(last_msg_->time.tow, 604799) << "incorrect value for time.tow, expected 604799, is " << last_msg_->time.tow; - EXPECT_EQ(last_msg_->time.wn, 2222) << "incorrect value for time.wn, expected 2222, is " << last_msg_->time.wn; - EXPECT_EQ(last_msg_->update_interval, 1) << "incorrect value for update_interval, expected 1, is " << last_msg_->update_interval; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 0); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->bitmask, 1234567890) + << "incorrect value for bitmask, expected 1234567890, is " + << last_msg_->bitmask; + EXPECT_EQ(last_msg_->cols, 6) + << "incorrect value for cols, expected 6, is " << last_msg_->cols; + EXPECT_EQ(last_msg_->corner_nw_lat, 7354) + << "incorrect value for corner_nw_lat, expected 7354, is " + << last_msg_->corner_nw_lat; + EXPECT_EQ(last_msg_->corner_nw_lon, -22725) + << "incorrect value for corner_nw_lon, expected -22725, is " + << last_msg_->corner_nw_lon; + EXPECT_EQ(last_msg_->iod_atmo, 3) + << "incorrect value for iod_atmo, expected 3, is " << last_msg_->iod_atmo; + EXPECT_EQ(last_msg_->rows, 6) + << "incorrect value for rows, expected 6, is " << last_msg_->rows; + EXPECT_EQ(last_msg_->sol_id, 2) + << "incorrect value for sol_id, expected 2, is " << last_msg_->sol_id; + EXPECT_EQ(last_msg_->spacing_lat, 100) + << "incorrect value for spacing_lat, expected 100, is " + << last_msg_->spacing_lat; + EXPECT_EQ(last_msg_->spacing_lon, 100) + << "incorrect value for spacing_lon, expected 100, is " + << last_msg_->spacing_lon; + EXPECT_EQ(last_msg_->tile_id, 5) + << "incorrect value for tile_id, expected 5, is " << last_msg_->tile_id; + EXPECT_EQ(last_msg_->tile_set_id, 4) + << "incorrect value for tile_set_id, expected 4, is " + << last_msg_->tile_set_id; + EXPECT_EQ(last_msg_->time.tow, 604799) + << "incorrect value for time.tow, expected 604799, is " + << last_msg_->time.tow; + EXPECT_EQ(last_msg_->time.wn, 2222) + << "incorrect value for time.wn, expected 2222, is " + << last_msg_->time.wn; + EXPECT_EQ(last_msg_->update_interval, 1) + << "incorrect value for update_interval, expected 1, is " + << last_msg_->update_interval; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.cc index 087fd9ab2..49d938ae8 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_tile_definition_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_tile_definition_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,51 +82,69 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_tile_definition_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,246,5,200,133,24,57,190,178,247,8,185,9,181,162,240,65,19,255,143,21,191,239,205,171,0,0,0,0,0,65,154, }; +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 246, 5, 200, 133, 24, 57, 190, 178, 247, 8, 185, 9, 181, 162, 240, + 65, 19, 255, 143, 21, 191, 239, 205, 171, 0, 0, 0, 0, 0, 65, 154, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_tile_definition_dep_a_t* test_msg = ( msg_ssr_tile_definition_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->bitmask = 11259375; - test_msg->cols = 48917; - test_msg->corner_nw_lat = -18168; - test_msg->corner_nw_lon = -19191; - test_msg->rows = 36863; - test_msg->spacing_lat = 61602; - test_msg->spacing_lon = 4929; - test_msg->tile_id = 63410; - test_msg->tile_set_id = 48697; - - EXPECT_EQ(send_message( 0x5f6, 34248, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_tile_definition_dep_a_t *test_msg = + (msg_ssr_tile_definition_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->bitmask = 11259375; + test_msg->cols = 48917; + test_msg->corner_nw_lat = -18168; + test_msg->corner_nw_lon = -19191; + test_msg->rows = 36863; + test_msg->spacing_lat = 61602; + test_msg->spacing_lon = 4929; + test_msg->tile_id = 63410; + test_msg->tile_set_id = 48697; + + EXPECT_EQ(send_message(0x5f6, 34248, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 34248); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->bitmask, 11259375) << "incorrect value for bitmask, expected 11259375, is " << last_msg_->bitmask; - EXPECT_EQ(last_msg_->cols, 48917) << "incorrect value for cols, expected 48917, is " << last_msg_->cols; - EXPECT_EQ(last_msg_->corner_nw_lat, -18168) << "incorrect value for corner_nw_lat, expected -18168, is " << last_msg_->corner_nw_lat; - EXPECT_EQ(last_msg_->corner_nw_lon, -19191) << "incorrect value for corner_nw_lon, expected -19191, is " << last_msg_->corner_nw_lon; - EXPECT_EQ(last_msg_->rows, 36863) << "incorrect value for rows, expected 36863, is " << last_msg_->rows; - EXPECT_EQ(last_msg_->spacing_lat, 61602) << "incorrect value for spacing_lat, expected 61602, is " << last_msg_->spacing_lat; - EXPECT_EQ(last_msg_->spacing_lon, 4929) << "incorrect value for spacing_lon, expected 4929, is " << last_msg_->spacing_lon; - EXPECT_EQ(last_msg_->tile_id, 63410) << "incorrect value for tile_id, expected 63410, is " << last_msg_->tile_id; - EXPECT_EQ(last_msg_->tile_set_id, 48697) << "incorrect value for tile_set_id, expected 48697, is " << last_msg_->tile_set_id; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 34248); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->bitmask, 11259375) + << "incorrect value for bitmask, expected 11259375, is " + << last_msg_->bitmask; + EXPECT_EQ(last_msg_->cols, 48917) + << "incorrect value for cols, expected 48917, is " << last_msg_->cols; + EXPECT_EQ(last_msg_->corner_nw_lat, -18168) + << "incorrect value for corner_nw_lat, expected -18168, is " + << last_msg_->corner_nw_lat; + EXPECT_EQ(last_msg_->corner_nw_lon, -19191) + << "incorrect value for corner_nw_lon, expected -19191, is " + << last_msg_->corner_nw_lon; + EXPECT_EQ(last_msg_->rows, 36863) + << "incorrect value for rows, expected 36863, is " << last_msg_->rows; + EXPECT_EQ(last_msg_->spacing_lat, 61602) + << "incorrect value for spacing_lat, expected 61602, is " + << last_msg_->spacing_lat; + EXPECT_EQ(last_msg_->spacing_lon, 4929) + << "incorrect value for spacing_lon, expected 4929, is " + << last_msg_->spacing_lon; + EXPECT_EQ(last_msg_->tile_id, 63410) + << "incorrect value for tile_id, expected 63410, is " + << last_msg_->tile_id; + EXPECT_EQ(last_msg_->tile_set_id, 48697) + << "incorrect value for tile_set_id, expected 48697, is " + << last_msg_->tile_set_id; } diff --git a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.cc b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.cc index e0baad813..ddf7636a3 100644 --- a/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.cc +++ b/c/test/legacy/cpp/auto_check_sbp_ssr_MsgSsrTileDefinitionDepB.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/ssr/test_MsgSsrTileDefinitionDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ssr_tile_definition_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ssr_tile_definition_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,53 +82,72 @@ class Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ssr_tile_definition_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB0, Test) -{ +}; - uint8_t encoded_frame[] = {85,247,5,66,0,25,31,0,1,0,2,0,4,0,8,0,16,0,32,0,64,0,128,210,2,150,73,0,0,0,0,214,71, }; +TEST_F(Test_legacy_auto_check_sbp_ssr_MsgSsrTileDefinitionDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 247, 5, 66, 0, 25, 31, 0, 1, 0, 2, 0, 4, 0, 8, 0, 16, + 0, 32, 0, 64, 0, 128, 210, 2, 150, 73, 0, 0, 0, 0, 214, 71, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ssr_tile_definition_dep_b_t* test_msg = ( msg_ssr_tile_definition_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->bitmask = 1234567890; - test_msg->cols = 32768; - test_msg->corner_nw_lat = 1024; - test_msg->corner_nw_lon = 2048; - test_msg->rows = 16384; - test_msg->spacing_lat = 4096; - test_msg->spacing_lon = 8192; - test_msg->ssr_sol_id = 31; - test_msg->tile_id = 512; - test_msg->tile_set_id = 256; - - EXPECT_EQ(send_message( 1527, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ssr_tile_definition_dep_b_t *test_msg = + (msg_ssr_tile_definition_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->bitmask = 1234567890; + test_msg->cols = 32768; + test_msg->corner_nw_lat = 1024; + test_msg->corner_nw_lon = 2048; + test_msg->rows = 16384; + test_msg->spacing_lat = 4096; + test_msg->spacing_lon = 8192; + test_msg->ssr_sol_id = 31; + test_msg->tile_id = 512; + test_msg->tile_set_id = 256; + + EXPECT_EQ(send_message(1527, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->bitmask, 1234567890) << "incorrect value for bitmask, expected 1234567890, is " << last_msg_->bitmask; - EXPECT_EQ(last_msg_->cols, 32768) << "incorrect value for cols, expected 32768, is " << last_msg_->cols; - EXPECT_EQ(last_msg_->corner_nw_lat, 1024) << "incorrect value for corner_nw_lat, expected 1024, is " << last_msg_->corner_nw_lat; - EXPECT_EQ(last_msg_->corner_nw_lon, 2048) << "incorrect value for corner_nw_lon, expected 2048, is " << last_msg_->corner_nw_lon; - EXPECT_EQ(last_msg_->rows, 16384) << "incorrect value for rows, expected 16384, is " << last_msg_->rows; - EXPECT_EQ(last_msg_->spacing_lat, 4096) << "incorrect value for spacing_lat, expected 4096, is " << last_msg_->spacing_lat; - EXPECT_EQ(last_msg_->spacing_lon, 8192) << "incorrect value for spacing_lon, expected 8192, is " << last_msg_->spacing_lon; - EXPECT_EQ(last_msg_->ssr_sol_id, 31) << "incorrect value for ssr_sol_id, expected 31, is " << last_msg_->ssr_sol_id; - EXPECT_EQ(last_msg_->tile_id, 512) << "incorrect value for tile_id, expected 512, is " << last_msg_->tile_id; - EXPECT_EQ(last_msg_->tile_set_id, 256) << "incorrect value for tile_set_id, expected 256, is " << last_msg_->tile_set_id; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->bitmask, 1234567890) + << "incorrect value for bitmask, expected 1234567890, is " + << last_msg_->bitmask; + EXPECT_EQ(last_msg_->cols, 32768) + << "incorrect value for cols, expected 32768, is " << last_msg_->cols; + EXPECT_EQ(last_msg_->corner_nw_lat, 1024) + << "incorrect value for corner_nw_lat, expected 1024, is " + << last_msg_->corner_nw_lat; + EXPECT_EQ(last_msg_->corner_nw_lon, 2048) + << "incorrect value for corner_nw_lon, expected 2048, is " + << last_msg_->corner_nw_lon; + EXPECT_EQ(last_msg_->rows, 16384) + << "incorrect value for rows, expected 16384, is " << last_msg_->rows; + EXPECT_EQ(last_msg_->spacing_lat, 4096) + << "incorrect value for spacing_lat, expected 4096, is " + << last_msg_->spacing_lat; + EXPECT_EQ(last_msg_->spacing_lon, 8192) + << "incorrect value for spacing_lon, expected 8192, is " + << last_msg_->spacing_lon; + EXPECT_EQ(last_msg_->ssr_sol_id, 31) + << "incorrect value for ssr_sol_id, expected 31, is " + << last_msg_->ssr_sol_id; + EXPECT_EQ(last_msg_->tile_id, 512) + << "incorrect value for tile_id, expected 512, is " << last_msg_->tile_id; + EXPECT_EQ(last_msg_->tile_set_id, 256) + << "incorrect value for tile_set_id, expected 256, is " + << last_msg_->tile_set_id; } diff --git a/c/test/legacy/cpp/auto_check_sbp_system_MsgCsacTelemetry.cc b/c/test/legacy/cpp/auto_check_sbp_system_MsgCsacTelemetry.cc index deecb7184..737946b21 100644 --- a/c/test/legacy/cpp/auto_check_sbp_system_MsgCsacTelemetry.cc +++ b/c/test/legacy/cpp/auto_check_sbp_system_MsgCsacTelemetry.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetry.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetry.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_system_MsgCsacTelemetry0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgCsacTelemetry0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgCsacTelemetry0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgCsacTelemetry0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_csac_telemetry_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_csac_telemetry_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,46 +81,56 @@ class Test_legacy_auto_check_sbp_system_MsgCsacTelemetry0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_csac_telemetry_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgCsacTelemetry0, Test) -{ +}; - uint8_t encoded_frame[] = {85,4,255,244,169,10,105,115,111,109,101,32,100,97,116,97,229,94, }; +TEST_F(Test_legacy_auto_check_sbp_system_MsgCsacTelemetry0, Test) { + uint8_t encoded_frame[] = { + 85, 4, 255, 244, 169, 10, 105, 115, 111, + 109, 101, 32, 100, 97, 116, 97, 229, 94, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_csac_telemetry_t* test_msg = ( msg_csac_telemetry_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->id = 105; - { - const char assign_string[] = { (char)115,(char)111,(char)109,(char)101,(char)32,(char)100,(char)97,(char)116,(char)97 }; - memcpy(test_msg->telemetry, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->telemetry) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0xff04, 43508, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_csac_telemetry_t *test_msg = (msg_csac_telemetry_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->id = 105; + { + const char assign_string[] = {(char)115, (char)111, (char)109, + (char)101, (char)32, (char)100, + (char)97, (char)116, (char)97}; + memcpy(test_msg->telemetry, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->telemetry) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 43508); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->id, 105) << "incorrect value for id, expected 105, is " << last_msg_->id; - { - const char check_string[] = { (char)115,(char)111,(char)109,(char)101,(char)32,(char)100,(char)97,(char)116,(char)97 }; - EXPECT_EQ(memcmp(last_msg_->telemetry, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->telemetry, expected string '" << check_string << "', is '" << last_msg_->telemetry << "'"; - } + EXPECT_EQ(send_message(0xff04, 43508, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 43508); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->id, 105) + << "incorrect value for id, expected 105, is " << last_msg_->id; + { + const char check_string[] = {(char)115, (char)111, (char)109, + (char)101, (char)32, (char)100, + (char)97, (char)116, (char)97}; + EXPECT_EQ(memcmp(last_msg_->telemetry, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_->telemetry, expected string '" + << check_string << "', is '" << last_msg_->telemetry << "'"; + } } diff --git a/c/test/legacy/cpp/auto_check_sbp_system_MsgCsacTelemetryLabels.cc b/c/test/legacy/cpp/auto_check_sbp_system_MsgCsacTelemetryLabels.cc index 4c60c7496..c6d2748da 100644 --- a/c/test/legacy/cpp/auto_check_sbp_system_MsgCsacTelemetryLabels.cc +++ b/c/test/legacy/cpp/auto_check_sbp_system_MsgCsacTelemetryLabels.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetryLabels.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgCsacTelemetryLabels.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_system_MsgCsacTelemetryLabels0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgCsacTelemetryLabels0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgCsacTelemetryLabels0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgCsacTelemetryLabels0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_csac_telemetry_labels_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_csac_telemetry_labels_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,46 +82,58 @@ class Test_legacy_auto_check_sbp_system_MsgCsacTelemetryLabels0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_csac_telemetry_labels_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgCsacTelemetryLabels0, Test) -{ +}; - uint8_t encoded_frame[] = {85,5,255,91,200,12,186,115,111,109,101,32,108,97,98,101,108,115,86,236, }; +TEST_F(Test_legacy_auto_check_sbp_system_MsgCsacTelemetryLabels0, Test) { + uint8_t encoded_frame[] = { + 85, 5, 255, 91, 200, 12, 186, 115, 111, 109, + 101, 32, 108, 97, 98, 101, 108, 115, 86, 236, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_csac_telemetry_labels_t* test_msg = ( msg_csac_telemetry_labels_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->id = 186; - { - const char assign_string[] = { (char)115,(char)111,(char)109,(char)101,(char)32,(char)108,(char)97,(char)98,(char)101,(char)108,(char)115 }; - memcpy(test_msg->telemetry_labels, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->telemetry_labels) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0xff05, 51291, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_csac_telemetry_labels_t *test_msg = + (msg_csac_telemetry_labels_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->id = 186; + { + const char assign_string[] = {(char)115, (char)111, (char)109, (char)101, + (char)32, (char)108, (char)97, (char)98, + (char)101, (char)108, (char)115}; + memcpy(test_msg->telemetry_labels, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->telemetry_labels) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 51291); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->id, 186) << "incorrect value for id, expected 186, is " << last_msg_->id; - { - const char check_string[] = { (char)115,(char)111,(char)109,(char)101,(char)32,(char)108,(char)97,(char)98,(char)101,(char)108,(char)115 }; - EXPECT_EQ(memcmp(last_msg_->telemetry_labels, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->telemetry_labels, expected string '" << check_string << "', is '" << last_msg_->telemetry_labels << "'"; - } + EXPECT_EQ(send_message(0xff05, 51291, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 51291); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->id, 186) + << "incorrect value for id, expected 186, is " << last_msg_->id; + { + const char check_string[] = {(char)115, (char)111, (char)109, (char)101, + (char)32, (char)108, (char)97, (char)98, + (char)101, (char)108, (char)115}; + EXPECT_EQ( + memcmp(last_msg_->telemetry_labels, check_string, sizeof(check_string)), + 0) + << "incorrect value for last_msg_->telemetry_labels, expected string '" + << check_string << "', is '" << last_msg_->telemetry_labels << "'"; + } } diff --git a/c/test/legacy/cpp/auto_check_sbp_system_MsgDgnssStatus.cc b/c/test/legacy/cpp/auto_check_sbp_system_MsgDgnssStatus.cc index 7f7f2a78b..32dd3e1e7 100644 --- a/c/test/legacy/cpp/auto_check_sbp_system_MsgDgnssStatus.cc +++ b/c/test/legacy/cpp/auto_check_sbp_system_MsgDgnssStatus.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgDgnssStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgDgnssStatus.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_system_MsgDgnssStatus0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgDgnssStatus0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgDgnssStatus0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgDgnssStatus0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_dgnss_status_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_dgnss_status_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,50 +81,59 @@ class Test_legacy_auto_check_sbp_system_MsgDgnssStatus0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_dgnss_status_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgDgnssStatus0, Test) -{ +}; - uint8_t encoded_frame[] = {85,2,255,66,0,11,0,50,0,12,83,107,121,108,97,114,107,202,1, }; +TEST_F(Test_legacy_auto_check_sbp_system_MsgDgnssStatus0, Test) { + uint8_t encoded_frame[] = { + 85, 2, 255, 66, 0, 11, 0, 50, 0, 12, + 83, 107, 121, 108, 97, 114, 107, 202, 1, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_dgnss_status_t* test_msg = ( msg_dgnss_status_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->latency = 50; - test_msg->num_signals = 12; - { - const char assign_string[] = { (char)83,(char)107,(char)121,(char)108,(char)97,(char)114,(char)107 }; - memcpy(test_msg->source, assign_string, sizeof(assign_string)); - if (sizeof(test_msg->source) == 0) { - test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); - } - } - - EXPECT_EQ(send_message( 0xff02, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_dgnss_status_t *test_msg = (msg_dgnss_status_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->latency = 50; + test_msg->num_signals = 12; + { + const char assign_string[] = {(char)83, (char)107, (char)121, (char)108, + (char)97, (char)114, (char)107}; + memcpy(test_msg->source, assign_string, sizeof(assign_string)); + if (sizeof(test_msg->source) == 0) { + test_msg_len = (uint8_t)(test_msg_len + sizeof(assign_string)); } + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->latency, 50) << "incorrect value for latency, expected 50, is " << last_msg_->latency; - EXPECT_EQ(last_msg_->num_signals, 12) << "incorrect value for num_signals, expected 12, is " << last_msg_->num_signals; - { - const char check_string[] = { (char)83,(char)107,(char)121,(char)108,(char)97,(char)114,(char)107 }; - EXPECT_EQ(memcmp(last_msg_->source, check_string, sizeof(check_string)), 0) << "incorrect value for last_msg_->source, expected string '" << check_string << "', is '" << last_msg_->source << "'"; - } + EXPECT_EQ(send_message(0xff02, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->latency, 50) + << "incorrect value for latency, expected 50, is " << last_msg_->latency; + EXPECT_EQ(last_msg_->num_signals, 12) + << "incorrect value for num_signals, expected 12, is " + << last_msg_->num_signals; + { + const char check_string[] = {(char)83, (char)107, (char)121, (char)108, + (char)97, (char)114, (char)107}; + EXPECT_EQ(memcmp(last_msg_->source, check_string, sizeof(check_string)), 0) + << "incorrect value for last_msg_->source, expected string '" + << check_string << "', is '" << last_msg_->source << "'"; + } } diff --git a/c/test/legacy/cpp/auto_check_sbp_system_MsgGnssTimeOffset.cc b/c/test/legacy/cpp/auto_check_sbp_system_MsgGnssTimeOffset.cc index 065d3b1be..ae73db16a 100644 --- a/c/test/legacy/cpp/auto_check_sbp_system_MsgGnssTimeOffset.cc +++ b/c/test/legacy/cpp/auto_check_sbp_system_MsgGnssTimeOffset.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgGnssTimeOffset.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgGnssTimeOffset.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_system_MsgGnssTimeOffset0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgGnssTimeOffset0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgGnssTimeOffset0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgGnssTimeOffset0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gnss_time_offset_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_gnss_time_offset_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,41 +82,47 @@ class Test_legacy_auto_check_sbp_system_MsgGnssTimeOffset0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_gnss_time_offset_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgGnssTimeOffset0, Test) -{ +}; - uint8_t encoded_frame[] = {85,7,255,22,15,9,9,58,82,83,9,103,22,37,221,84,100, }; +TEST_F(Test_legacy_auto_check_sbp_system_MsgGnssTimeOffset0, Test) { + uint8_t encoded_frame[] = { + 85, 7, 255, 22, 15, 9, 9, 58, 82, 83, 9, 103, 22, 37, 221, 84, 100, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_gnss_time_offset_t* test_msg = ( msg_gnss_time_offset_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 221; - test_msg->microseconds = 9494; - test_msg->milliseconds = 1728664402; - test_msg->weeks = 14857; - - EXPECT_EQ(send_message( 0xff07, 3862, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_gnss_time_offset_t *test_msg = (msg_gnss_time_offset_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 221; + test_msg->microseconds = 9494; + test_msg->milliseconds = 1728664402; + test_msg->weeks = 14857; + + EXPECT_EQ(send_message(0xff07, 3862, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 3862); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 221) << "incorrect value for flags, expected 221, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->microseconds, 9494) << "incorrect value for microseconds, expected 9494, is " << last_msg_->microseconds; - EXPECT_EQ(last_msg_->milliseconds, 1728664402) << "incorrect value for milliseconds, expected 1728664402, is " << last_msg_->milliseconds; - EXPECT_EQ(last_msg_->weeks, 14857) << "incorrect value for weeks, expected 14857, is " << last_msg_->weeks; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 3862); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 221) + << "incorrect value for flags, expected 221, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->microseconds, 9494) + << "incorrect value for microseconds, expected 9494, is " + << last_msg_->microseconds; + EXPECT_EQ(last_msg_->milliseconds, 1728664402) + << "incorrect value for milliseconds, expected 1728664402, is " + << last_msg_->milliseconds; + EXPECT_EQ(last_msg_->weeks, 14857) + << "incorrect value for weeks, expected 14857, is " << last_msg_->weeks; } diff --git a/c/test/legacy/cpp/auto_check_sbp_system_MsgGroupMeta.cc b/c/test/legacy/cpp/auto_check_sbp_system_MsgGroupMeta.cc index 85ed4c42d..fd81aa09e 100644 --- a/c/test/legacy/cpp/auto_check_sbp_system_MsgGroupMeta.cc +++ b/c/test/legacy/cpp/auto_check_sbp_system_MsgGroupMeta.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgGroupMeta.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgGroupMeta.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_system_MsgGroupMeta0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgGroupMeta0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgGroupMeta0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgGroupMeta0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_group_meta_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_group_meta_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,108 +81,113 @@ class Test_legacy_auto_check_sbp_system_MsgGroupMeta0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_group_meta_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgGroupMeta0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_system_MsgGroupMeta0, Test) { + uint8_t encoded_frame[] = { + 85, 10, 255, 238, 238, 9, 1, 2, 3, 10, 255, 10, 2, 2, 255, 2, 14, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_group_meta_t *test_msg = (msg_group_meta_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 2; + test_msg->group_id = 1; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[0] = 65290; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[1] = 522; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[2] = 65282; + test_msg->n_group_msgs = 3; + + EXPECT_EQ(send_message(0xFF0A, 61166, test_msg_len, test_msg_storage), + SBP_OK); - uint8_t encoded_frame[] = {85,10,255,238,238,9,1,2,3,10,255,10,2,2,255,2,14, }; + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_group_meta_t* test_msg = ( msg_group_meta_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 2; - test_msg->group_id = 1; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[0] = 65290; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[1] = 522; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[2] = 65282; - test_msg->n_group_msgs = 3; - - EXPECT_EQ(send_message( 0xFF0A, 61166, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61166); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 2) << "incorrect value for flags, expected 2, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->group_id, 1) << "incorrect value for group_id, expected 1, is " << last_msg_->group_id; - EXPECT_EQ(last_msg_->group_msgs[0], 65290) << "incorrect value for group_msgs[0], expected 65290, is " << last_msg_->group_msgs[0]; - EXPECT_EQ(last_msg_->group_msgs[1], 522) << "incorrect value for group_msgs[1], expected 522, is " << last_msg_->group_msgs[1]; - EXPECT_EQ(last_msg_->group_msgs[2], 65282) << "incorrect value for group_msgs[2], expected 65282, is " << last_msg_->group_msgs[2]; - EXPECT_EQ(last_msg_->n_group_msgs, 3) << "incorrect value for n_group_msgs, expected 3, is " << last_msg_->n_group_msgs; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61166); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 2) + << "incorrect value for flags, expected 2, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->group_id, 1) + << "incorrect value for group_id, expected 1, is " << last_msg_->group_id; + EXPECT_EQ(last_msg_->group_msgs[0], 65290) + << "incorrect value for group_msgs[0], expected 65290, is " + << last_msg_->group_msgs[0]; + EXPECT_EQ(last_msg_->group_msgs[1], 522) + << "incorrect value for group_msgs[1], expected 522, is " + << last_msg_->group_msgs[1]; + EXPECT_EQ(last_msg_->group_msgs[2], 65282) + << "incorrect value for group_msgs[2], expected 65282, is " + << last_msg_->group_msgs[2]; + EXPECT_EQ(last_msg_->n_group_msgs, 3) + << "incorrect value for n_group_msgs, expected 3, is " + << last_msg_->n_group_msgs; } -class Test_legacy_auto_check_sbp_system_MsgGroupMeta1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgGroupMeta1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgGroupMeta1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgGroupMeta1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_group_meta_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_group_meta_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -196,123 +197,157 @@ class Test_legacy_auto_check_sbp_system_MsgGroupMeta1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_group_meta_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgGroupMeta1, Test) -{ +}; - uint8_t encoded_frame[] = {85,10,255,21,3,31,1,1,14,2,1,3,1,10,2,17,2,9,2,20,2,14,2,18,2,13,2,21,2,33,2,3,255,6,255,14,255,82,154, }; +TEST_F(Test_legacy_auto_check_sbp_system_MsgGroupMeta1, Test) { + uint8_t encoded_frame[] = { + 85, 10, 255, 21, 3, 31, 1, 1, 14, 2, 1, 3, 1, + 10, 2, 17, 2, 9, 2, 20, 2, 14, 2, 18, 2, 13, + 2, 21, 2, 33, 2, 3, 255, 6, 255, 14, 255, 82, 154, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_group_meta_t* test_msg = ( msg_group_meta_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 1; - test_msg->group_id = 1; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[0] = 258; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[1] = 259; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[2] = 522; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[3] = 529; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[4] = 521; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[5] = 532; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[6] = 526; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[7] = 530; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[8] = 525; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[9] = 533; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[10] = 545; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[11] = 65283; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[12] = 65286; - if (sizeof(test_msg->group_msgs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); - } - test_msg->group_msgs[13] = 65294; - test_msg->n_group_msgs = 14; - - EXPECT_EQ(send_message( 0xFF0A, 789, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_group_meta_t *test_msg = (msg_group_meta_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 1; + test_msg->group_id = 1; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[0] = 258; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[1] = 259; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[2] = 522; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[3] = 529; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[4] = 521; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[5] = 532; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[6] = 526; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[7] = 530; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[8] = 525; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[9] = 533; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[10] = 545; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[11] = 65283; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[12] = 65286; + if (sizeof(test_msg->group_msgs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->group_msgs[0])); + } + test_msg->group_msgs[13] = 65294; + test_msg->n_group_msgs = 14; + + EXPECT_EQ(send_message(0xFF0A, 789, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 789); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->group_id, 1) << "incorrect value for group_id, expected 1, is " << last_msg_->group_id; - EXPECT_EQ(last_msg_->group_msgs[0], 258) << "incorrect value for group_msgs[0], expected 258, is " << last_msg_->group_msgs[0]; - EXPECT_EQ(last_msg_->group_msgs[1], 259) << "incorrect value for group_msgs[1], expected 259, is " << last_msg_->group_msgs[1]; - EXPECT_EQ(last_msg_->group_msgs[2], 522) << "incorrect value for group_msgs[2], expected 522, is " << last_msg_->group_msgs[2]; - EXPECT_EQ(last_msg_->group_msgs[3], 529) << "incorrect value for group_msgs[3], expected 529, is " << last_msg_->group_msgs[3]; - EXPECT_EQ(last_msg_->group_msgs[4], 521) << "incorrect value for group_msgs[4], expected 521, is " << last_msg_->group_msgs[4]; - EXPECT_EQ(last_msg_->group_msgs[5], 532) << "incorrect value for group_msgs[5], expected 532, is " << last_msg_->group_msgs[5]; - EXPECT_EQ(last_msg_->group_msgs[6], 526) << "incorrect value for group_msgs[6], expected 526, is " << last_msg_->group_msgs[6]; - EXPECT_EQ(last_msg_->group_msgs[7], 530) << "incorrect value for group_msgs[7], expected 530, is " << last_msg_->group_msgs[7]; - EXPECT_EQ(last_msg_->group_msgs[8], 525) << "incorrect value for group_msgs[8], expected 525, is " << last_msg_->group_msgs[8]; - EXPECT_EQ(last_msg_->group_msgs[9], 533) << "incorrect value for group_msgs[9], expected 533, is " << last_msg_->group_msgs[9]; - EXPECT_EQ(last_msg_->group_msgs[10], 545) << "incorrect value for group_msgs[10], expected 545, is " << last_msg_->group_msgs[10]; - EXPECT_EQ(last_msg_->group_msgs[11], 65283) << "incorrect value for group_msgs[11], expected 65283, is " << last_msg_->group_msgs[11]; - EXPECT_EQ(last_msg_->group_msgs[12], 65286) << "incorrect value for group_msgs[12], expected 65286, is " << last_msg_->group_msgs[12]; - EXPECT_EQ(last_msg_->group_msgs[13], 65294) << "incorrect value for group_msgs[13], expected 65294, is " << last_msg_->group_msgs[13]; - EXPECT_EQ(last_msg_->n_group_msgs, 14) << "incorrect value for n_group_msgs, expected 14, is " << last_msg_->n_group_msgs; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 789); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->group_id, 1) + << "incorrect value for group_id, expected 1, is " << last_msg_->group_id; + EXPECT_EQ(last_msg_->group_msgs[0], 258) + << "incorrect value for group_msgs[0], expected 258, is " + << last_msg_->group_msgs[0]; + EXPECT_EQ(last_msg_->group_msgs[1], 259) + << "incorrect value for group_msgs[1], expected 259, is " + << last_msg_->group_msgs[1]; + EXPECT_EQ(last_msg_->group_msgs[2], 522) + << "incorrect value for group_msgs[2], expected 522, is " + << last_msg_->group_msgs[2]; + EXPECT_EQ(last_msg_->group_msgs[3], 529) + << "incorrect value for group_msgs[3], expected 529, is " + << last_msg_->group_msgs[3]; + EXPECT_EQ(last_msg_->group_msgs[4], 521) + << "incorrect value for group_msgs[4], expected 521, is " + << last_msg_->group_msgs[4]; + EXPECT_EQ(last_msg_->group_msgs[5], 532) + << "incorrect value for group_msgs[5], expected 532, is " + << last_msg_->group_msgs[5]; + EXPECT_EQ(last_msg_->group_msgs[6], 526) + << "incorrect value for group_msgs[6], expected 526, is " + << last_msg_->group_msgs[6]; + EXPECT_EQ(last_msg_->group_msgs[7], 530) + << "incorrect value for group_msgs[7], expected 530, is " + << last_msg_->group_msgs[7]; + EXPECT_EQ(last_msg_->group_msgs[8], 525) + << "incorrect value for group_msgs[8], expected 525, is " + << last_msg_->group_msgs[8]; + EXPECT_EQ(last_msg_->group_msgs[9], 533) + << "incorrect value for group_msgs[9], expected 533, is " + << last_msg_->group_msgs[9]; + EXPECT_EQ(last_msg_->group_msgs[10], 545) + << "incorrect value for group_msgs[10], expected 545, is " + << last_msg_->group_msgs[10]; + EXPECT_EQ(last_msg_->group_msgs[11], 65283) + << "incorrect value for group_msgs[11], expected 65283, is " + << last_msg_->group_msgs[11]; + EXPECT_EQ(last_msg_->group_msgs[12], 65286) + << "incorrect value for group_msgs[12], expected 65286, is " + << last_msg_->group_msgs[12]; + EXPECT_EQ(last_msg_->group_msgs[13], 65294) + << "incorrect value for group_msgs[13], expected 65294, is " + << last_msg_->group_msgs[13]; + EXPECT_EQ(last_msg_->n_group_msgs, 14) + << "incorrect value for n_group_msgs, expected 14, is " + << last_msg_->n_group_msgs; } diff --git a/c/test/legacy/cpp/auto_check_sbp_system_MsgHeartbeat.cc b/c/test/legacy/cpp/auto_check_sbp_system_MsgHeartbeat.cc index 85b68c7e0..2286b5295 100644 --- a/c/test/legacy/cpp/auto_check_sbp_system_MsgHeartbeat.cc +++ b/c/test/legacy/cpp/auto_check_sbp_system_MsgHeartbeat.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgHeartbeat.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgHeartbeat.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_system_MsgHeartbeat0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgHeartbeat0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgHeartbeat0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgHeartbeat0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_heartbeat_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_heartbeat_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,86 +81,82 @@ class Test_legacy_auto_check_sbp_system_MsgHeartbeat0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_heartbeat_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgHeartbeat0, Test) -{ - - uint8_t encoded_frame[] = {85,255,255,246,215,4,0,50,0,0,249,216, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_heartbeat_t* test_msg = ( msg_heartbeat_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 12800; - - EXPECT_EQ(send_message( 0xffff, 55286, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 55286); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 12800) << "incorrect value for flags, expected 12800, is " << last_msg_->flags; +}; + +TEST_F(Test_legacy_auto_check_sbp_system_MsgHeartbeat0, Test) { + uint8_t encoded_frame[] = { + 85, 255, 255, 246, 215, 4, 0, 50, 0, 0, 249, 216, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_heartbeat_t *test_msg = (msg_heartbeat_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 12800; + + EXPECT_EQ(send_message(0xffff, 55286, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 55286); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 12800) + << "incorrect value for flags, expected 12800, is " << last_msg_->flags; } -class Test_legacy_auto_check_sbp_system_MsgHeartbeat1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgHeartbeat1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgHeartbeat1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgHeartbeat1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_heartbeat_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_heartbeat_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -174,35 +166,36 @@ class Test_legacy_auto_check_sbp_system_MsgHeartbeat1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_heartbeat_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgHeartbeat1, Test) -{ - - uint8_t encoded_frame[] = {85,255,255,195,4,4,0,0,0,0,66,57, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_heartbeat_t* test_msg = ( msg_heartbeat_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - - EXPECT_EQ(send_message( 0xffff, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; +}; + +TEST_F(Test_legacy_auto_check_sbp_system_MsgHeartbeat1, Test) { + uint8_t encoded_frame[] = { + 85, 255, 255, 195, 4, 4, 0, 0, 0, 0, 66, 57, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_heartbeat_t *test_msg = (msg_heartbeat_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + + EXPECT_EQ(send_message(0xffff, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; } diff --git a/c/test/legacy/cpp/auto_check_sbp_system_MsgInsStatus.cc b/c/test/legacy/cpp/auto_check_sbp_system_MsgInsStatus.cc index 77d8175cb..177bc7f22 100644 --- a/c/test/legacy/cpp/auto_check_sbp_system_MsgInsStatus.cc +++ b/c/test/legacy/cpp/auto_check_sbp_system_MsgInsStatus.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgInsStatus.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgInsStatus.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_system_MsgInsStatus0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgInsStatus0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgInsStatus0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgInsStatus0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ins_status_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ins_status_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,35 +81,37 @@ class Test_legacy_auto_check_sbp_system_MsgInsStatus0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ins_status_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgInsStatus0, Test) -{ +}; - uint8_t encoded_frame[] = {85,3,255,21,3,4,9,0,0,32,36,103, }; +TEST_F(Test_legacy_auto_check_sbp_system_MsgInsStatus0, Test) { + uint8_t encoded_frame[] = { + 85, 3, 255, 21, 3, 4, 9, 0, 0, 32, 36, 103, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ins_status_t* test_msg = ( msg_ins_status_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 536870921; - - EXPECT_EQ(send_message( 0xff03, 789, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ins_status_t *test_msg = (msg_ins_status_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 536870921; + + EXPECT_EQ(send_message(0xff03, 789, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 789); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 536870921) << "incorrect value for flags, expected 536870921, is " << last_msg_->flags; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 789); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 536870921) + << "incorrect value for flags, expected 536870921, is " + << last_msg_->flags; } diff --git a/c/test/legacy/cpp/auto_check_sbp_system_MsgInsUpdates.cc b/c/test/legacy/cpp/auto_check_sbp_system_MsgInsUpdates.cc index 2e289c072..004e10db2 100644 --- a/c/test/legacy/cpp/auto_check_sbp_system_MsgInsUpdates.cc +++ b/c/test/legacy/cpp/auto_check_sbp_system_MsgInsUpdates.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgInsUpdates.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgInsUpdates.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_system_MsgInsUpdates0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgInsUpdates0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgInsUpdates0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgInsUpdates0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_ins_updates_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ins_updates_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,47 +81,55 @@ class Test_legacy_auto_check_sbp_system_MsgInsUpdates0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_ins_updates_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgInsUpdates0, Test) -{ +}; - uint8_t encoded_frame[] = {85,6,255,21,3,10,84,229,17,30,0,0,0,0,0,0,81,63, }; +TEST_F(Test_legacy_auto_check_sbp_system_MsgInsUpdates0, Test) { + uint8_t encoded_frame[] = { + 85, 6, 255, 21, 3, 10, 84, 229, 17, 30, 0, 0, 0, 0, 0, 0, 81, 63, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_ins_updates_t* test_msg = ( msg_ins_updates_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->gnsspos = 0; - test_msg->gnssvel = 0; - test_msg->nhc = 0; - test_msg->speed = 0; - test_msg->tow = 504489300; - test_msg->wheelticks = 0; - test_msg->zerovel = 0; - - EXPECT_EQ(send_message( 0xff06, 789, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ins_updates_t *test_msg = (msg_ins_updates_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->gnsspos = 0; + test_msg->gnssvel = 0; + test_msg->nhc = 0; + test_msg->speed = 0; + test_msg->tow = 504489300; + test_msg->wheelticks = 0; + test_msg->zerovel = 0; + + EXPECT_EQ(send_message(0xff06, 789, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 789); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->gnsspos, 0) << "incorrect value for gnsspos, expected 0, is " << last_msg_->gnsspos; - EXPECT_EQ(last_msg_->gnssvel, 0) << "incorrect value for gnssvel, expected 0, is " << last_msg_->gnssvel; - EXPECT_EQ(last_msg_->nhc, 0) << "incorrect value for nhc, expected 0, is " << last_msg_->nhc; - EXPECT_EQ(last_msg_->speed, 0) << "incorrect value for speed, expected 0, is " << last_msg_->speed; - EXPECT_EQ(last_msg_->tow, 504489300) << "incorrect value for tow, expected 504489300, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wheelticks, 0) << "incorrect value for wheelticks, expected 0, is " << last_msg_->wheelticks; - EXPECT_EQ(last_msg_->zerovel, 0) << "incorrect value for zerovel, expected 0, is " << last_msg_->zerovel; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 789); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->gnsspos, 0) + << "incorrect value for gnsspos, expected 0, is " << last_msg_->gnsspos; + EXPECT_EQ(last_msg_->gnssvel, 0) + << "incorrect value for gnssvel, expected 0, is " << last_msg_->gnssvel; + EXPECT_EQ(last_msg_->nhc, 0) + << "incorrect value for nhc, expected 0, is " << last_msg_->nhc; + EXPECT_EQ(last_msg_->speed, 0) + << "incorrect value for speed, expected 0, is " << last_msg_->speed; + EXPECT_EQ(last_msg_->tow, 504489300) + << "incorrect value for tow, expected 504489300, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wheelticks, 0) + << "incorrect value for wheelticks, expected 0, is " + << last_msg_->wheelticks; + EXPECT_EQ(last_msg_->zerovel, 0) + << "incorrect value for zerovel, expected 0, is " << last_msg_->zerovel; } diff --git a/c/test/legacy/cpp/auto_check_sbp_system_MsgPpsTime.cc b/c/test/legacy/cpp/auto_check_sbp_system_MsgPpsTime.cc index 7b2885bcd..89eff6618 100644 --- a/c/test/legacy/cpp/auto_check_sbp_system_MsgPpsTime.cc +++ b/c/test/legacy/cpp/auto_check_sbp_system_MsgPpsTime.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgPpsTime.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgPpsTime.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_system_MsgPpsTime0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgPpsTime0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgPpsTime0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgPpsTime0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_pps_time_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_pps_time_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,37 +81,41 @@ class Test_legacy_auto_check_sbp_system_MsgPpsTime0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_pps_time_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgPpsTime0, Test) -{ +}; - uint8_t encoded_frame[] = {85,8,255,222,209,9,140,146,133,197,160,0,0,0,255,125,149, }; +TEST_F(Test_legacy_auto_check_sbp_system_MsgPpsTime0, Test) { + uint8_t encoded_frame[] = { + 85, 8, 255, 222, 209, 9, 140, 146, 133, 197, 160, 0, 0, 0, 255, 125, 149, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_pps_time_t* test_msg = ( msg_pps_time_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 255; - test_msg->time = 690508632716; - - EXPECT_EQ(send_message( 0xff08, 53726, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_pps_time_t *test_msg = (msg_pps_time_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 255; + test_msg->time = 690508632716; + + EXPECT_EQ(send_message(0xff08, 53726, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 53726); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 255) << "incorrect value for flags, expected 255, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->time, 690508632716) << "incorrect value for time, expected 690508632716, is " << last_msg_->time; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 53726); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 255) + << "incorrect value for flags, expected 255, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->time, 690508632716) + << "incorrect value for time, expected 690508632716, is " + << last_msg_->time; } diff --git a/c/test/legacy/cpp/auto_check_sbp_system_MsgSensorAidEvent.cc b/c/test/legacy/cpp/auto_check_sbp_system_MsgSensorAidEvent.cc index ac1e16672..67b4fee48 100644 --- a/c/test/legacy/cpp/auto_check_sbp_system_MsgSensorAidEvent.cc +++ b/c/test/legacy/cpp/auto_check_sbp_system_MsgSensorAidEvent.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgSensorAidEvent.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgSensorAidEvent.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_system_MsgSensorAidEvent0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgSensorAidEvent0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgSensorAidEvent0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgSensorAidEvent0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_sensor_aid_event_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_sensor_aid_event_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,49 +82,65 @@ class Test_legacy_auto_check_sbp_system_MsgSensorAidEvent0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_sensor_aid_event_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgSensorAidEvent0, Test) -{ +}; - uint8_t encoded_frame[] = {85,9,255,211,136,15,48,246,122,19,0,0,0,0,0,0,0,0,0,0,0,33,236, }; +TEST_F(Test_legacy_auto_check_sbp_system_MsgSensorAidEvent0, Test) { + uint8_t encoded_frame[] = { + 85, 9, 255, 211, 136, 15, 48, 246, 122, 19, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 236, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_sensor_aid_event_t* test_msg = ( msg_sensor_aid_event_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 0; - test_msg->n_accepted_meas = 0; - test_msg->n_attempted_meas = 0; - test_msg->n_available_meas = 0; - test_msg->sensor_id = 0; - test_msg->sensor_state = 0; - test_msg->sensor_type = 0; - test_msg->time = 326825520; - - EXPECT_EQ(send_message( 0xFF09, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_sensor_aid_event_t *test_msg = (msg_sensor_aid_event_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 0; + test_msg->n_accepted_meas = 0; + test_msg->n_attempted_meas = 0; + test_msg->n_available_meas = 0; + test_msg->sensor_id = 0; + test_msg->sensor_state = 0; + test_msg->sensor_type = 0; + test_msg->time = 326825520; + + EXPECT_EQ(send_message(0xFF09, 35027, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_accepted_meas, 0) << "incorrect value for n_accepted_meas, expected 0, is " << last_msg_->n_accepted_meas; - EXPECT_EQ(last_msg_->n_attempted_meas, 0) << "incorrect value for n_attempted_meas, expected 0, is " << last_msg_->n_attempted_meas; - EXPECT_EQ(last_msg_->n_available_meas, 0) << "incorrect value for n_available_meas, expected 0, is " << last_msg_->n_available_meas; - EXPECT_EQ(last_msg_->sensor_id, 0) << "incorrect value for sensor_id, expected 0, is " << last_msg_->sensor_id; - EXPECT_EQ(last_msg_->sensor_state, 0) << "incorrect value for sensor_state, expected 0, is " << last_msg_->sensor_state; - EXPECT_EQ(last_msg_->sensor_type, 0) << "incorrect value for sensor_type, expected 0, is " << last_msg_->sensor_type; - EXPECT_EQ(last_msg_->time, 326825520) << "incorrect value for time, expected 326825520, is " << last_msg_->time; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_accepted_meas, 0) + << "incorrect value for n_accepted_meas, expected 0, is " + << last_msg_->n_accepted_meas; + EXPECT_EQ(last_msg_->n_attempted_meas, 0) + << "incorrect value for n_attempted_meas, expected 0, is " + << last_msg_->n_attempted_meas; + EXPECT_EQ(last_msg_->n_available_meas, 0) + << "incorrect value for n_available_meas, expected 0, is " + << last_msg_->n_available_meas; + EXPECT_EQ(last_msg_->sensor_id, 0) + << "incorrect value for sensor_id, expected 0, is " + << last_msg_->sensor_id; + EXPECT_EQ(last_msg_->sensor_state, 0) + << "incorrect value for sensor_state, expected 0, is " + << last_msg_->sensor_state; + EXPECT_EQ(last_msg_->sensor_type, 0) + << "incorrect value for sensor_type, expected 0, is " + << last_msg_->sensor_type; + EXPECT_EQ(last_msg_->time, 326825520) + << "incorrect value for time, expected 326825520, is " << last_msg_->time; } diff --git a/c/test/legacy/cpp/auto_check_sbp_system_MsgStartup.cc b/c/test/legacy/cpp/auto_check_sbp_system_MsgStartup.cc index 7733642da..19d354880 100644 --- a/c/test/legacy/cpp/auto_check_sbp_system_MsgStartup.cc +++ b/c/test/legacy/cpp/auto_check_sbp_system_MsgStartup.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgStartup.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgStartup.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_system_MsgStartup0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgStartup0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgStartup0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgStartup0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_startup_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_startup_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,90 +81,88 @@ class Test_legacy_auto_check_sbp_system_MsgStartup0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_startup_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgStartup0, Test) -{ - - uint8_t encoded_frame[] = {85,0,255,66,0,4,0,0,0,0,70,160, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_startup_t* test_msg = ( msg_startup_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cause = 0; - test_msg->reserved = 0; - test_msg->startup_type = 0; - - EXPECT_EQ(send_message( 0xff00, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cause, 0) << "incorrect value for cause, expected 0, is " << last_msg_->cause; - EXPECT_EQ(last_msg_->reserved, 0) << "incorrect value for reserved, expected 0, is " << last_msg_->reserved; - EXPECT_EQ(last_msg_->startup_type, 0) << "incorrect value for startup_type, expected 0, is " << last_msg_->startup_type; +}; + +TEST_F(Test_legacy_auto_check_sbp_system_MsgStartup0, Test) { + uint8_t encoded_frame[] = { + 85, 0, 255, 66, 0, 4, 0, 0, 0, 0, 70, 160, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_startup_t *test_msg = (msg_startup_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cause = 0; + test_msg->reserved = 0; + test_msg->startup_type = 0; + + EXPECT_EQ(send_message(0xff00, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cause, 0) + << "incorrect value for cause, expected 0, is " << last_msg_->cause; + EXPECT_EQ(last_msg_->reserved, 0) + << "incorrect value for reserved, expected 0, is " << last_msg_->reserved; + EXPECT_EQ(last_msg_->startup_type, 0) + << "incorrect value for startup_type, expected 0, is " + << last_msg_->startup_type; } -class Test_legacy_auto_check_sbp_system_MsgStartup1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgStartup1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgStartup1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgStartup1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_startup_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_startup_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -178,39 +172,43 @@ class Test_legacy_auto_check_sbp_system_MsgStartup1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_startup_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgStartup1, Test) -{ - - uint8_t encoded_frame[] = {85,0,255,195,4,4,0,0,0,0,127,181, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_startup_t* test_msg = ( msg_startup_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->cause = 0; - test_msg->reserved = 0; - test_msg->startup_type = 0; - - EXPECT_EQ(send_message( 0xff00, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->cause, 0) << "incorrect value for cause, expected 0, is " << last_msg_->cause; - EXPECT_EQ(last_msg_->reserved, 0) << "incorrect value for reserved, expected 0, is " << last_msg_->reserved; - EXPECT_EQ(last_msg_->startup_type, 0) << "incorrect value for startup_type, expected 0, is " << last_msg_->startup_type; +}; + +TEST_F(Test_legacy_auto_check_sbp_system_MsgStartup1, Test) { + uint8_t encoded_frame[] = { + 85, 0, 255, 195, 4, 4, 0, 0, 0, 0, 127, 181, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_startup_t *test_msg = (msg_startup_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->cause = 0; + test_msg->reserved = 0; + test_msg->startup_type = 0; + + EXPECT_EQ(send_message(0xff00, 1219, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->cause, 0) + << "incorrect value for cause, expected 0, is " << last_msg_->cause; + EXPECT_EQ(last_msg_->reserved, 0) + << "incorrect value for reserved, expected 0, is " << last_msg_->reserved; + EXPECT_EQ(last_msg_->startup_type, 0) + << "incorrect value for startup_type, expected 0, is " + << last_msg_->startup_type; } diff --git a/c/test/legacy/cpp/auto_check_sbp_system_MsgStatusJournal.cc b/c/test/legacy/cpp/auto_check_sbp_system_MsgStatusJournal.cc index 0b1201992..212287661 100644 --- a/c/test/legacy/cpp/auto_check_sbp_system_MsgStatusJournal.cc +++ b/c/test/legacy/cpp/auto_check_sbp_system_MsgStatusJournal.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusJournal.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusJournal.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_system_MsgStatusJournal0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgStatusJournal0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgStatusJournal0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgStatusJournal0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_status_journal_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_status_journal_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,128 +81,157 @@ class Test_legacy_auto_check_sbp_system_MsgStatusJournal0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_status_journal_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgStatusJournal0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_system_MsgStatusJournal0, Test) { + uint8_t encoded_frame[] = { + 85, 253, 255, 211, 136, 33, 1, 0, 1, 4, 100, 0, 0, 0, + 16, 146, 16, 0, 0, 6, 0, 1, 13, 186, 19, 0, 0, 6, + 0, 1, 14, 184, 34, 0, 0, 6, 0, 1, 15, 113, 119, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_status_journal_t *test_msg = (msg_status_journal_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->journal) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->journal[0])); + } + test_msg->journal[0].report.component = 6; + test_msg->journal[0].report.generic = 1; + test_msg->journal[0].report.specific = 13; + test_msg->journal[0].uptime = 4242; + if (sizeof(test_msg->journal) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->journal[0])); + } + test_msg->journal[1].report.component = 6; + test_msg->journal[1].report.generic = 1; + test_msg->journal[1].report.specific = 14; + test_msg->journal[1].uptime = 5050; + if (sizeof(test_msg->journal) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->journal[0])); + } + test_msg->journal[2].report.component = 6; + test_msg->journal[2].report.generic = 1; + test_msg->journal[2].report.specific = 15; + test_msg->journal[2].uptime = 8888; + test_msg->reporting_system = 1; + test_msg->sbp_version = 1025; + test_msg->sequence_descriptor = 16; + test_msg->total_status_reports = 100; - uint8_t encoded_frame[] = {85,253,255,211,136,33,1,0,1,4,100,0,0,0,16,146,16,0,0,6,0,1,13,186,19,0,0,6,0,1,14,184,34,0,0,6,0,1,15,113,119, }; + EXPECT_EQ(send_message(0xFFFD, 35027, test_msg_len, test_msg_storage), + SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_status_journal_t* test_msg = ( msg_status_journal_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->journal) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->journal[0])); - } - test_msg->journal[0].report.component = 6; - test_msg->journal[0].report.generic = 1; - test_msg->journal[0].report.specific = 13; - test_msg->journal[0].uptime = 4242; - if (sizeof(test_msg->journal) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->journal[0])); - } - test_msg->journal[1].report.component = 6; - test_msg->journal[1].report.generic = 1; - test_msg->journal[1].report.specific = 14; - test_msg->journal[1].uptime = 5050; - if (sizeof(test_msg->journal) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->journal[0])); - } - test_msg->journal[2].report.component = 6; - test_msg->journal[2].report.generic = 1; - test_msg->journal[2].report.specific = 15; - test_msg->journal[2].uptime = 8888; - test_msg->reporting_system = 1; - test_msg->sbp_version = 1025; - test_msg->sequence_descriptor = 16; - test_msg->total_status_reports = 100; - - EXPECT_EQ(send_message( 0xFFFD, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->journal[0].report.component, 6) << "incorrect value for journal[0].report.component, expected 6, is " << last_msg_->journal[0].report.component; - EXPECT_EQ(last_msg_->journal[0].report.generic, 1) << "incorrect value for journal[0].report.generic, expected 1, is " << last_msg_->journal[0].report.generic; - EXPECT_EQ(last_msg_->journal[0].report.specific, 13) << "incorrect value for journal[0].report.specific, expected 13, is " << last_msg_->journal[0].report.specific; - EXPECT_EQ(last_msg_->journal[0].uptime, 4242) << "incorrect value for journal[0].uptime, expected 4242, is " << last_msg_->journal[0].uptime; - EXPECT_EQ(last_msg_->journal[1].report.component, 6) << "incorrect value for journal[1].report.component, expected 6, is " << last_msg_->journal[1].report.component; - EXPECT_EQ(last_msg_->journal[1].report.generic, 1) << "incorrect value for journal[1].report.generic, expected 1, is " << last_msg_->journal[1].report.generic; - EXPECT_EQ(last_msg_->journal[1].report.specific, 14) << "incorrect value for journal[1].report.specific, expected 14, is " << last_msg_->journal[1].report.specific; - EXPECT_EQ(last_msg_->journal[1].uptime, 5050) << "incorrect value for journal[1].uptime, expected 5050, is " << last_msg_->journal[1].uptime; - EXPECT_EQ(last_msg_->journal[2].report.component, 6) << "incorrect value for journal[2].report.component, expected 6, is " << last_msg_->journal[2].report.component; - EXPECT_EQ(last_msg_->journal[2].report.generic, 1) << "incorrect value for journal[2].report.generic, expected 1, is " << last_msg_->journal[2].report.generic; - EXPECT_EQ(last_msg_->journal[2].report.specific, 15) << "incorrect value for journal[2].report.specific, expected 15, is " << last_msg_->journal[2].report.specific; - EXPECT_EQ(last_msg_->journal[2].uptime, 8888) << "incorrect value for journal[2].uptime, expected 8888, is " << last_msg_->journal[2].uptime; - EXPECT_EQ(last_msg_->reporting_system, 1) << "incorrect value for reporting_system, expected 1, is " << last_msg_->reporting_system; - EXPECT_EQ(last_msg_->sbp_version, 1025) << "incorrect value for sbp_version, expected 1025, is " << last_msg_->sbp_version; - EXPECT_EQ(last_msg_->sequence_descriptor, 16) << "incorrect value for sequence_descriptor, expected 16, is " << last_msg_->sequence_descriptor; - EXPECT_EQ(last_msg_->total_status_reports, 100) << "incorrect value for total_status_reports, expected 100, is " << last_msg_->total_status_reports; + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->journal[0].report.component, 6) + << "incorrect value for journal[0].report.component, expected 6, is " + << last_msg_->journal[0].report.component; + EXPECT_EQ(last_msg_->journal[0].report.generic, 1) + << "incorrect value for journal[0].report.generic, expected 1, is " + << last_msg_->journal[0].report.generic; + EXPECT_EQ(last_msg_->journal[0].report.specific, 13) + << "incorrect value for journal[0].report.specific, expected 13, is " + << last_msg_->journal[0].report.specific; + EXPECT_EQ(last_msg_->journal[0].uptime, 4242) + << "incorrect value for journal[0].uptime, expected 4242, is " + << last_msg_->journal[0].uptime; + EXPECT_EQ(last_msg_->journal[1].report.component, 6) + << "incorrect value for journal[1].report.component, expected 6, is " + << last_msg_->journal[1].report.component; + EXPECT_EQ(last_msg_->journal[1].report.generic, 1) + << "incorrect value for journal[1].report.generic, expected 1, is " + << last_msg_->journal[1].report.generic; + EXPECT_EQ(last_msg_->journal[1].report.specific, 14) + << "incorrect value for journal[1].report.specific, expected 14, is " + << last_msg_->journal[1].report.specific; + EXPECT_EQ(last_msg_->journal[1].uptime, 5050) + << "incorrect value for journal[1].uptime, expected 5050, is " + << last_msg_->journal[1].uptime; + EXPECT_EQ(last_msg_->journal[2].report.component, 6) + << "incorrect value for journal[2].report.component, expected 6, is " + << last_msg_->journal[2].report.component; + EXPECT_EQ(last_msg_->journal[2].report.generic, 1) + << "incorrect value for journal[2].report.generic, expected 1, is " + << last_msg_->journal[2].report.generic; + EXPECT_EQ(last_msg_->journal[2].report.specific, 15) + << "incorrect value for journal[2].report.specific, expected 15, is " + << last_msg_->journal[2].report.specific; + EXPECT_EQ(last_msg_->journal[2].uptime, 8888) + << "incorrect value for journal[2].uptime, expected 8888, is " + << last_msg_->journal[2].uptime; + EXPECT_EQ(last_msg_->reporting_system, 1) + << "incorrect value for reporting_system, expected 1, is " + << last_msg_->reporting_system; + EXPECT_EQ(last_msg_->sbp_version, 1025) + << "incorrect value for sbp_version, expected 1025, is " + << last_msg_->sbp_version; + EXPECT_EQ(last_msg_->sequence_descriptor, 16) + << "incorrect value for sequence_descriptor, expected 16, is " + << last_msg_->sequence_descriptor; + EXPECT_EQ(last_msg_->total_status_reports, 100) + << "incorrect value for total_status_reports, expected 100, is " + << last_msg_->total_status_reports; } -class Test_legacy_auto_check_sbp_system_MsgStatusJournal1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgStatusJournal1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgStatusJournal1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgStatusJournal1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_status_journal_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_status_journal_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -216,53 +241,71 @@ class Test_legacy_auto_check_sbp_system_MsgStatusJournal1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_status_journal_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgStatusJournal1, Test) -{ +}; - uint8_t encoded_frame[] = {85,253,255,211,136,17,1,0,1,4,100,0,0,0,16,146,16,0,0,6,0,1,13,144,121, }; +TEST_F(Test_legacy_auto_check_sbp_system_MsgStatusJournal1, Test) { + uint8_t encoded_frame[] = { + 85, 253, 255, 211, 136, 17, 1, 0, 1, 4, 100, 0, 0, + 0, 16, 146, 16, 0, 0, 6, 0, 1, 13, 144, 121, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_status_journal_t* test_msg = ( msg_status_journal_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->journal) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->journal[0])); - } - test_msg->journal[0].report.component = 6; - test_msg->journal[0].report.generic = 1; - test_msg->journal[0].report.specific = 13; - test_msg->journal[0].uptime = 4242; - test_msg->reporting_system = 1; - test_msg->sbp_version = 1025; - test_msg->sequence_descriptor = 16; - test_msg->total_status_reports = 100; - - EXPECT_EQ(send_message( 0xFFFD, 35027, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_status_journal_t *test_msg = (msg_status_journal_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->journal) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->journal[0])); + } + test_msg->journal[0].report.component = 6; + test_msg->journal[0].report.generic = 1; + test_msg->journal[0].report.specific = 13; + test_msg->journal[0].uptime = 4242; + test_msg->reporting_system = 1; + test_msg->sbp_version = 1025; + test_msg->sequence_descriptor = 16; + test_msg->total_status_reports = 100; + + EXPECT_EQ(send_message(0xFFFD, 35027, test_msg_len, test_msg_storage), + SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 35027); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->journal[0].report.component, 6) << "incorrect value for journal[0].report.component, expected 6, is " << last_msg_->journal[0].report.component; - EXPECT_EQ(last_msg_->journal[0].report.generic, 1) << "incorrect value for journal[0].report.generic, expected 1, is " << last_msg_->journal[0].report.generic; - EXPECT_EQ(last_msg_->journal[0].report.specific, 13) << "incorrect value for journal[0].report.specific, expected 13, is " << last_msg_->journal[0].report.specific; - EXPECT_EQ(last_msg_->journal[0].uptime, 4242) << "incorrect value for journal[0].uptime, expected 4242, is " << last_msg_->journal[0].uptime; - EXPECT_EQ(last_msg_->reporting_system, 1) << "incorrect value for reporting_system, expected 1, is " << last_msg_->reporting_system; - EXPECT_EQ(last_msg_->sbp_version, 1025) << "incorrect value for sbp_version, expected 1025, is " << last_msg_->sbp_version; - EXPECT_EQ(last_msg_->sequence_descriptor, 16) << "incorrect value for sequence_descriptor, expected 16, is " << last_msg_->sequence_descriptor; - EXPECT_EQ(last_msg_->total_status_reports, 100) << "incorrect value for total_status_reports, expected 100, is " << last_msg_->total_status_reports; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 35027); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->journal[0].report.component, 6) + << "incorrect value for journal[0].report.component, expected 6, is " + << last_msg_->journal[0].report.component; + EXPECT_EQ(last_msg_->journal[0].report.generic, 1) + << "incorrect value for journal[0].report.generic, expected 1, is " + << last_msg_->journal[0].report.generic; + EXPECT_EQ(last_msg_->journal[0].report.specific, 13) + << "incorrect value for journal[0].report.specific, expected 13, is " + << last_msg_->journal[0].report.specific; + EXPECT_EQ(last_msg_->journal[0].uptime, 4242) + << "incorrect value for journal[0].uptime, expected 4242, is " + << last_msg_->journal[0].uptime; + EXPECT_EQ(last_msg_->reporting_system, 1) + << "incorrect value for reporting_system, expected 1, is " + << last_msg_->reporting_system; + EXPECT_EQ(last_msg_->sbp_version, 1025) + << "incorrect value for sbp_version, expected 1025, is " + << last_msg_->sbp_version; + EXPECT_EQ(last_msg_->sequence_descriptor, 16) + << "incorrect value for sequence_descriptor, expected 16, is " + << last_msg_->sequence_descriptor; + EXPECT_EQ(last_msg_->total_status_reports, 100) + << "incorrect value for total_status_reports, expected 100, is " + << last_msg_->total_status_reports; } diff --git a/c/test/legacy/cpp/auto_check_sbp_system_MsgStatusReport.cc b/c/test/legacy/cpp/auto_check_sbp_system_MsgStatusReport.cc index 01e39db85..061e1448b 100644 --- a/c/test/legacy/cpp/auto_check_sbp_system_MsgStatusReport.cc +++ b/c/test/legacy/cpp/auto_check_sbp_system_MsgStatusReport.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusReport.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/system/test_MsgStatusReport.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_system_MsgStatusReport0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_system_MsgStatusReport0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_system_MsgStatusReport0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_system_MsgStatusReport0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_status_report_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_status_report_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,641 +81,1027 @@ class Test_legacy_auto_check_sbp_system_MsgStatusReport0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_status_report_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_system_MsgStatusReport0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_system_MsgStatusReport0, Test) { + uint8_t encoded_frame[] = { + 85, 254, 255, 6, 84, 252, 82, 253, 177, 95, 3, 60, 143, 90, 233, + 21, 208, 98, 247, 203, 221, 198, 156, 207, 217, 238, 162, 136, 154, 11, + 114, 236, 134, 235, 12, 133, 9, 30, 175, 145, 26, 114, 215, 20, 146, + 249, 54, 54, 133, 193, 106, 186, 210, 183, 0, 129, 5, 248, 225, 149, + 135, 127, 2, 26, 88, 92, 10, 103, 73, 3, 103, 68, 76, 184, 33, + 206, 194, 163, 123, 30, 151, 176, 149, 172, 184, 231, 118, 230, 200, 168, + 100, 109, 10, 233, 4, 60, 247, 82, 215, 166, 28, 138, 110, 45, 98, + 218, 244, 179, 126, 107, 92, 124, 94, 157, 42, 187, 124, 6, 97, 247, + 160, 188, 110, 120, 254, 214, 110, 51, 240, 164, 147, 18, 74, 178, 67, + 4, 27, 73, 190, 64, 179, 146, 125, 153, 192, 46, 202, 66, 248, 46, + 40, 161, 173, 242, 214, 3, 11, 1, 118, 70, 162, 61, 178, 27, 156, + 40, 191, 113, 230, 200, 72, 8, 215, 245, 78, 59, 222, 250, 115, 32, + 33, 30, 211, 170, 145, 92, 157, 75, 24, 169, 6, 55, 62, 8, 107, + 82, 140, 49, 179, 122, 90, 71, 28, 88, 103, 51, 177, 72, 93, 39, + 148, 11, 202, 42, 34, 92, 204, 102, 29, 98, 249, 91, 134, 95, 23, + 248, 192, 20, 83, 195, 95, 180, 54, 36, 186, 75, 64, 20, 157, 133, + 12, 149, 28, 14, 185, 129, 101, 239, 74, 248, 245, 30, 228, 88, 142, + 212, 53, 224, 158, 166, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_status_report_t *test_msg = (msg_status_report_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->reporting_system = 64850; + test_msg->sbp_version = 24497; + test_msg->sequence = 1519336451; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[0].component = 52215; + test_msg->status[0].generic = 221; + test_msg->status[0].specific = 198; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[1].component = 53148; + test_msg->status[1].generic = 217; + test_msg->status[1].specific = 238; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[2].component = 34978; + test_msg->status[2].generic = 154; + test_msg->status[2].specific = 11; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[3].component = 60530; + test_msg->status[3].generic = 134; + test_msg->status[3].specific = 235; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[4].component = 34060; + test_msg->status[4].generic = 9; + test_msg->status[4].specific = 30; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[5].component = 37295; + test_msg->status[5].generic = 26; + test_msg->status[5].specific = 114; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[6].component = 5335; + test_msg->status[6].generic = 146; + test_msg->status[6].specific = 249; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[7].component = 13878; + test_msg->status[7].generic = 133; + test_msg->status[7].specific = 193; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[8].component = 47722; + test_msg->status[8].generic = 210; + test_msg->status[8].specific = 183; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[9].component = 33024; + test_msg->status[9].generic = 5; + test_msg->status[9].specific = 248; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[10].component = 38369; + test_msg->status[10].generic = 135; + test_msg->status[10].specific = 127; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[11].component = 6658; + test_msg->status[11].generic = 88; + test_msg->status[11].specific = 92; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[12].component = 26378; + test_msg->status[12].generic = 73; + test_msg->status[12].specific = 3; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[13].component = 17511; + test_msg->status[13].generic = 76; + test_msg->status[13].specific = 184; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[14].component = 52769; + test_msg->status[14].generic = 194; + test_msg->status[14].specific = 163; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[15].component = 7803; + test_msg->status[15].generic = 151; + test_msg->status[15].specific = 176; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[16].component = 44181; + test_msg->status[16].generic = 184; + test_msg->status[16].specific = 231; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[17].component = 58998; + test_msg->status[17].generic = 200; + test_msg->status[17].specific = 168; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[18].component = 28004; + test_msg->status[18].generic = 10; + test_msg->status[18].specific = 233; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[19].component = 15364; + test_msg->status[19].generic = 247; + test_msg->status[19].specific = 82; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[20].component = 42711; + test_msg->status[20].generic = 28; + test_msg->status[20].specific = 138; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[21].component = 11630; + test_msg->status[21].generic = 98; + test_msg->status[21].specific = 218; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[22].component = 46068; + test_msg->status[22].generic = 126; + test_msg->status[22].specific = 107; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[23].component = 31836; + test_msg->status[23].generic = 94; + test_msg->status[23].specific = 157; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[24].component = 47914; + test_msg->status[24].generic = 124; + test_msg->status[24].specific = 6; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[25].component = 63329; + test_msg->status[25].generic = 160; + test_msg->status[25].specific = 188; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[26].component = 30830; + test_msg->status[26].generic = 254; + test_msg->status[26].specific = 214; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[27].component = 13166; + test_msg->status[27].generic = 240; + test_msg->status[27].specific = 164; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[28].component = 4755; + test_msg->status[28].generic = 74; + test_msg->status[28].specific = 178; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[29].component = 1091; + test_msg->status[29].generic = 27; + test_msg->status[29].specific = 73; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[30].component = 16574; + test_msg->status[30].generic = 179; + test_msg->status[30].specific = 146; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[31].component = 39293; + test_msg->status[31].generic = 192; + test_msg->status[31].specific = 46; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[32].component = 17098; + test_msg->status[32].generic = 248; + test_msg->status[32].specific = 46; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[33].component = 41256; + test_msg->status[33].generic = 173; + test_msg->status[33].specific = 242; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[34].component = 982; + test_msg->status[34].generic = 11; + test_msg->status[34].specific = 1; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[35].component = 18038; + test_msg->status[35].generic = 162; + test_msg->status[35].specific = 61; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[36].component = 7090; + test_msg->status[36].generic = 156; + test_msg->status[36].specific = 40; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[37].component = 29119; + test_msg->status[37].generic = 230; + test_msg->status[37].specific = 200; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[38].component = 2120; + test_msg->status[38].generic = 215; + test_msg->status[38].specific = 245; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[39].component = 15182; + test_msg->status[39].generic = 222; + test_msg->status[39].specific = 250; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[40].component = 8307; + test_msg->status[40].generic = 33; + test_msg->status[40].specific = 30; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[41].component = 43731; + test_msg->status[41].generic = 145; + test_msg->status[41].specific = 92; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[42].component = 19357; + test_msg->status[42].generic = 24; + test_msg->status[42].specific = 169; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[43].component = 14086; + test_msg->status[43].generic = 62; + test_msg->status[43].specific = 8; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[44].component = 21099; + test_msg->status[44].generic = 140; + test_msg->status[44].specific = 49; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[45].component = 31411; + test_msg->status[45].generic = 90; + test_msg->status[45].specific = 71; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[46].component = 22556; + test_msg->status[46].generic = 103; + test_msg->status[46].specific = 51; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[47].component = 18609; + test_msg->status[47].generic = 93; + test_msg->status[47].specific = 39; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[48].component = 2964; + test_msg->status[48].generic = 202; + test_msg->status[48].specific = 42; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[49].component = 23586; + test_msg->status[49].generic = 204; + test_msg->status[49].specific = 102; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[50].component = 25117; + test_msg->status[50].generic = 249; + test_msg->status[50].specific = 91; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[51].component = 24454; + test_msg->status[51].generic = 23; + test_msg->status[51].specific = 248; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[52].component = 5312; + test_msg->status[52].generic = 83; + test_msg->status[52].specific = 195; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[53].component = 46175; + test_msg->status[53].generic = 54; + test_msg->status[53].specific = 36; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[54].component = 19386; + test_msg->status[54].generic = 64; + test_msg->status[54].specific = 20; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[55].component = 34205; + test_msg->status[55].generic = 12; + test_msg->status[55].specific = 149; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[56].component = 3612; + test_msg->status[56].generic = 185; + test_msg->status[56].specific = 129; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[57].component = 61285; + test_msg->status[57].generic = 74; + test_msg->status[57].specific = 248; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[58].component = 7925; + test_msg->status[58].generic = 228; + test_msg->status[58].specific = 88; + if (sizeof(test_msg->status) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); + } + test_msg->status[59].component = 54414; + test_msg->status[59].generic = 53; + test_msg->status[59].specific = 224; + test_msg->uptime = 1657804265; - uint8_t encoded_frame[] = {85,254,255,6,84,252,82,253,177,95,3,60,143,90,233,21,208,98,247,203,221,198,156,207,217,238,162,136,154,11,114,236,134,235,12,133,9,30,175,145,26,114,215,20,146,249,54,54,133,193,106,186,210,183,0,129,5,248,225,149,135,127,2,26,88,92,10,103,73,3,103,68,76,184,33,206,194,163,123,30,151,176,149,172,184,231,118,230,200,168,100,109,10,233,4,60,247,82,215,166,28,138,110,45,98,218,244,179,126,107,92,124,94,157,42,187,124,6,97,247,160,188,110,120,254,214,110,51,240,164,147,18,74,178,67,4,27,73,190,64,179,146,125,153,192,46,202,66,248,46,40,161,173,242,214,3,11,1,118,70,162,61,178,27,156,40,191,113,230,200,72,8,215,245,78,59,222,250,115,32,33,30,211,170,145,92,157,75,24,169,6,55,62,8,107,82,140,49,179,122,90,71,28,88,103,51,177,72,93,39,148,11,202,42,34,92,204,102,29,98,249,91,134,95,23,248,192,20,83,195,95,180,54,36,186,75,64,20,157,133,12,149,28,14,185,129,101,239,74,248,245,30,228,88,142,212,53,224,158,166, }; + EXPECT_EQ(send_message(0xfffe, 21510, test_msg_len, test_msg_storage), + SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_status_report_t* test_msg = ( msg_status_report_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->reporting_system = 64850; - test_msg->sbp_version = 24497; - test_msg->sequence = 1519336451; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[0].component = 52215; - test_msg->status[0].generic = 221; - test_msg->status[0].specific = 198; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[1].component = 53148; - test_msg->status[1].generic = 217; - test_msg->status[1].specific = 238; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[2].component = 34978; - test_msg->status[2].generic = 154; - test_msg->status[2].specific = 11; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[3].component = 60530; - test_msg->status[3].generic = 134; - test_msg->status[3].specific = 235; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[4].component = 34060; - test_msg->status[4].generic = 9; - test_msg->status[4].specific = 30; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[5].component = 37295; - test_msg->status[5].generic = 26; - test_msg->status[5].specific = 114; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[6].component = 5335; - test_msg->status[6].generic = 146; - test_msg->status[6].specific = 249; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[7].component = 13878; - test_msg->status[7].generic = 133; - test_msg->status[7].specific = 193; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[8].component = 47722; - test_msg->status[8].generic = 210; - test_msg->status[8].specific = 183; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[9].component = 33024; - test_msg->status[9].generic = 5; - test_msg->status[9].specific = 248; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[10].component = 38369; - test_msg->status[10].generic = 135; - test_msg->status[10].specific = 127; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[11].component = 6658; - test_msg->status[11].generic = 88; - test_msg->status[11].specific = 92; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[12].component = 26378; - test_msg->status[12].generic = 73; - test_msg->status[12].specific = 3; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[13].component = 17511; - test_msg->status[13].generic = 76; - test_msg->status[13].specific = 184; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[14].component = 52769; - test_msg->status[14].generic = 194; - test_msg->status[14].specific = 163; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[15].component = 7803; - test_msg->status[15].generic = 151; - test_msg->status[15].specific = 176; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[16].component = 44181; - test_msg->status[16].generic = 184; - test_msg->status[16].specific = 231; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[17].component = 58998; - test_msg->status[17].generic = 200; - test_msg->status[17].specific = 168; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[18].component = 28004; - test_msg->status[18].generic = 10; - test_msg->status[18].specific = 233; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[19].component = 15364; - test_msg->status[19].generic = 247; - test_msg->status[19].specific = 82; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[20].component = 42711; - test_msg->status[20].generic = 28; - test_msg->status[20].specific = 138; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[21].component = 11630; - test_msg->status[21].generic = 98; - test_msg->status[21].specific = 218; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[22].component = 46068; - test_msg->status[22].generic = 126; - test_msg->status[22].specific = 107; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[23].component = 31836; - test_msg->status[23].generic = 94; - test_msg->status[23].specific = 157; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[24].component = 47914; - test_msg->status[24].generic = 124; - test_msg->status[24].specific = 6; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[25].component = 63329; - test_msg->status[25].generic = 160; - test_msg->status[25].specific = 188; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[26].component = 30830; - test_msg->status[26].generic = 254; - test_msg->status[26].specific = 214; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[27].component = 13166; - test_msg->status[27].generic = 240; - test_msg->status[27].specific = 164; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[28].component = 4755; - test_msg->status[28].generic = 74; - test_msg->status[28].specific = 178; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[29].component = 1091; - test_msg->status[29].generic = 27; - test_msg->status[29].specific = 73; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[30].component = 16574; - test_msg->status[30].generic = 179; - test_msg->status[30].specific = 146; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[31].component = 39293; - test_msg->status[31].generic = 192; - test_msg->status[31].specific = 46; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[32].component = 17098; - test_msg->status[32].generic = 248; - test_msg->status[32].specific = 46; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[33].component = 41256; - test_msg->status[33].generic = 173; - test_msg->status[33].specific = 242; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[34].component = 982; - test_msg->status[34].generic = 11; - test_msg->status[34].specific = 1; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[35].component = 18038; - test_msg->status[35].generic = 162; - test_msg->status[35].specific = 61; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[36].component = 7090; - test_msg->status[36].generic = 156; - test_msg->status[36].specific = 40; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[37].component = 29119; - test_msg->status[37].generic = 230; - test_msg->status[37].specific = 200; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[38].component = 2120; - test_msg->status[38].generic = 215; - test_msg->status[38].specific = 245; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[39].component = 15182; - test_msg->status[39].generic = 222; - test_msg->status[39].specific = 250; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[40].component = 8307; - test_msg->status[40].generic = 33; - test_msg->status[40].specific = 30; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[41].component = 43731; - test_msg->status[41].generic = 145; - test_msg->status[41].specific = 92; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[42].component = 19357; - test_msg->status[42].generic = 24; - test_msg->status[42].specific = 169; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[43].component = 14086; - test_msg->status[43].generic = 62; - test_msg->status[43].specific = 8; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[44].component = 21099; - test_msg->status[44].generic = 140; - test_msg->status[44].specific = 49; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[45].component = 31411; - test_msg->status[45].generic = 90; - test_msg->status[45].specific = 71; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[46].component = 22556; - test_msg->status[46].generic = 103; - test_msg->status[46].specific = 51; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[47].component = 18609; - test_msg->status[47].generic = 93; - test_msg->status[47].specific = 39; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[48].component = 2964; - test_msg->status[48].generic = 202; - test_msg->status[48].specific = 42; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[49].component = 23586; - test_msg->status[49].generic = 204; - test_msg->status[49].specific = 102; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[50].component = 25117; - test_msg->status[50].generic = 249; - test_msg->status[50].specific = 91; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[51].component = 24454; - test_msg->status[51].generic = 23; - test_msg->status[51].specific = 248; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[52].component = 5312; - test_msg->status[52].generic = 83; - test_msg->status[52].specific = 195; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[53].component = 46175; - test_msg->status[53].generic = 54; - test_msg->status[53].specific = 36; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[54].component = 19386; - test_msg->status[54].generic = 64; - test_msg->status[54].specific = 20; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[55].component = 34205; - test_msg->status[55].generic = 12; - test_msg->status[55].specific = 149; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[56].component = 3612; - test_msg->status[56].generic = 185; - test_msg->status[56].specific = 129; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[57].component = 61285; - test_msg->status[57].generic = 74; - test_msg->status[57].specific = 248; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[58].component = 7925; - test_msg->status[58].generic = 228; - test_msg->status[58].specific = 88; - if (sizeof(test_msg->status) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->status[0])); - } - test_msg->status[59].component = 54414; - test_msg->status[59].generic = 53; - test_msg->status[59].specific = 224; - test_msg->uptime = 1657804265; - - EXPECT_EQ(send_message( 0xfffe, 21510, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 21510); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->reporting_system, 64850) << "incorrect value for reporting_system, expected 64850, is " << last_msg_->reporting_system; - EXPECT_EQ(last_msg_->sbp_version, 24497) << "incorrect value for sbp_version, expected 24497, is " << last_msg_->sbp_version; - EXPECT_EQ(last_msg_->sequence, 1519336451) << "incorrect value for sequence, expected 1519336451, is " << last_msg_->sequence; - EXPECT_EQ(last_msg_->status[0].component, 52215) << "incorrect value for status[0].component, expected 52215, is " << last_msg_->status[0].component; - EXPECT_EQ(last_msg_->status[0].generic, 221) << "incorrect value for status[0].generic, expected 221, is " << last_msg_->status[0].generic; - EXPECT_EQ(last_msg_->status[0].specific, 198) << "incorrect value for status[0].specific, expected 198, is " << last_msg_->status[0].specific; - EXPECT_EQ(last_msg_->status[1].component, 53148) << "incorrect value for status[1].component, expected 53148, is " << last_msg_->status[1].component; - EXPECT_EQ(last_msg_->status[1].generic, 217) << "incorrect value for status[1].generic, expected 217, is " << last_msg_->status[1].generic; - EXPECT_EQ(last_msg_->status[1].specific, 238) << "incorrect value for status[1].specific, expected 238, is " << last_msg_->status[1].specific; - EXPECT_EQ(last_msg_->status[2].component, 34978) << "incorrect value for status[2].component, expected 34978, is " << last_msg_->status[2].component; - EXPECT_EQ(last_msg_->status[2].generic, 154) << "incorrect value for status[2].generic, expected 154, is " << last_msg_->status[2].generic; - EXPECT_EQ(last_msg_->status[2].specific, 11) << "incorrect value for status[2].specific, expected 11, is " << last_msg_->status[2].specific; - EXPECT_EQ(last_msg_->status[3].component, 60530) << "incorrect value for status[3].component, expected 60530, is " << last_msg_->status[3].component; - EXPECT_EQ(last_msg_->status[3].generic, 134) << "incorrect value for status[3].generic, expected 134, is " << last_msg_->status[3].generic; - EXPECT_EQ(last_msg_->status[3].specific, 235) << "incorrect value for status[3].specific, expected 235, is " << last_msg_->status[3].specific; - EXPECT_EQ(last_msg_->status[4].component, 34060) << "incorrect value for status[4].component, expected 34060, is " << last_msg_->status[4].component; - EXPECT_EQ(last_msg_->status[4].generic, 9) << "incorrect value for status[4].generic, expected 9, is " << last_msg_->status[4].generic; - EXPECT_EQ(last_msg_->status[4].specific, 30) << "incorrect value for status[4].specific, expected 30, is " << last_msg_->status[4].specific; - EXPECT_EQ(last_msg_->status[5].component, 37295) << "incorrect value for status[5].component, expected 37295, is " << last_msg_->status[5].component; - EXPECT_EQ(last_msg_->status[5].generic, 26) << "incorrect value for status[5].generic, expected 26, is " << last_msg_->status[5].generic; - EXPECT_EQ(last_msg_->status[5].specific, 114) << "incorrect value for status[5].specific, expected 114, is " << last_msg_->status[5].specific; - EXPECT_EQ(last_msg_->status[6].component, 5335) << "incorrect value for status[6].component, expected 5335, is " << last_msg_->status[6].component; - EXPECT_EQ(last_msg_->status[6].generic, 146) << "incorrect value for status[6].generic, expected 146, is " << last_msg_->status[6].generic; - EXPECT_EQ(last_msg_->status[6].specific, 249) << "incorrect value for status[6].specific, expected 249, is " << last_msg_->status[6].specific; - EXPECT_EQ(last_msg_->status[7].component, 13878) << "incorrect value for status[7].component, expected 13878, is " << last_msg_->status[7].component; - EXPECT_EQ(last_msg_->status[7].generic, 133) << "incorrect value for status[7].generic, expected 133, is " << last_msg_->status[7].generic; - EXPECT_EQ(last_msg_->status[7].specific, 193) << "incorrect value for status[7].specific, expected 193, is " << last_msg_->status[7].specific; - EXPECT_EQ(last_msg_->status[8].component, 47722) << "incorrect value for status[8].component, expected 47722, is " << last_msg_->status[8].component; - EXPECT_EQ(last_msg_->status[8].generic, 210) << "incorrect value for status[8].generic, expected 210, is " << last_msg_->status[8].generic; - EXPECT_EQ(last_msg_->status[8].specific, 183) << "incorrect value for status[8].specific, expected 183, is " << last_msg_->status[8].specific; - EXPECT_EQ(last_msg_->status[9].component, 33024) << "incorrect value for status[9].component, expected 33024, is " << last_msg_->status[9].component; - EXPECT_EQ(last_msg_->status[9].generic, 5) << "incorrect value for status[9].generic, expected 5, is " << last_msg_->status[9].generic; - EXPECT_EQ(last_msg_->status[9].specific, 248) << "incorrect value for status[9].specific, expected 248, is " << last_msg_->status[9].specific; - EXPECT_EQ(last_msg_->status[10].component, 38369) << "incorrect value for status[10].component, expected 38369, is " << last_msg_->status[10].component; - EXPECT_EQ(last_msg_->status[10].generic, 135) << "incorrect value for status[10].generic, expected 135, is " << last_msg_->status[10].generic; - EXPECT_EQ(last_msg_->status[10].specific, 127) << "incorrect value for status[10].specific, expected 127, is " << last_msg_->status[10].specific; - EXPECT_EQ(last_msg_->status[11].component, 6658) << "incorrect value for status[11].component, expected 6658, is " << last_msg_->status[11].component; - EXPECT_EQ(last_msg_->status[11].generic, 88) << "incorrect value for status[11].generic, expected 88, is " << last_msg_->status[11].generic; - EXPECT_EQ(last_msg_->status[11].specific, 92) << "incorrect value for status[11].specific, expected 92, is " << last_msg_->status[11].specific; - EXPECT_EQ(last_msg_->status[12].component, 26378) << "incorrect value for status[12].component, expected 26378, is " << last_msg_->status[12].component; - EXPECT_EQ(last_msg_->status[12].generic, 73) << "incorrect value for status[12].generic, expected 73, is " << last_msg_->status[12].generic; - EXPECT_EQ(last_msg_->status[12].specific, 3) << "incorrect value for status[12].specific, expected 3, is " << last_msg_->status[12].specific; - EXPECT_EQ(last_msg_->status[13].component, 17511) << "incorrect value for status[13].component, expected 17511, is " << last_msg_->status[13].component; - EXPECT_EQ(last_msg_->status[13].generic, 76) << "incorrect value for status[13].generic, expected 76, is " << last_msg_->status[13].generic; - EXPECT_EQ(last_msg_->status[13].specific, 184) << "incorrect value for status[13].specific, expected 184, is " << last_msg_->status[13].specific; - EXPECT_EQ(last_msg_->status[14].component, 52769) << "incorrect value for status[14].component, expected 52769, is " << last_msg_->status[14].component; - EXPECT_EQ(last_msg_->status[14].generic, 194) << "incorrect value for status[14].generic, expected 194, is " << last_msg_->status[14].generic; - EXPECT_EQ(last_msg_->status[14].specific, 163) << "incorrect value for status[14].specific, expected 163, is " << last_msg_->status[14].specific; - EXPECT_EQ(last_msg_->status[15].component, 7803) << "incorrect value for status[15].component, expected 7803, is " << last_msg_->status[15].component; - EXPECT_EQ(last_msg_->status[15].generic, 151) << "incorrect value for status[15].generic, expected 151, is " << last_msg_->status[15].generic; - EXPECT_EQ(last_msg_->status[15].specific, 176) << "incorrect value for status[15].specific, expected 176, is " << last_msg_->status[15].specific; - EXPECT_EQ(last_msg_->status[16].component, 44181) << "incorrect value for status[16].component, expected 44181, is " << last_msg_->status[16].component; - EXPECT_EQ(last_msg_->status[16].generic, 184) << "incorrect value for status[16].generic, expected 184, is " << last_msg_->status[16].generic; - EXPECT_EQ(last_msg_->status[16].specific, 231) << "incorrect value for status[16].specific, expected 231, is " << last_msg_->status[16].specific; - EXPECT_EQ(last_msg_->status[17].component, 58998) << "incorrect value for status[17].component, expected 58998, is " << last_msg_->status[17].component; - EXPECT_EQ(last_msg_->status[17].generic, 200) << "incorrect value for status[17].generic, expected 200, is " << last_msg_->status[17].generic; - EXPECT_EQ(last_msg_->status[17].specific, 168) << "incorrect value for status[17].specific, expected 168, is " << last_msg_->status[17].specific; - EXPECT_EQ(last_msg_->status[18].component, 28004) << "incorrect value for status[18].component, expected 28004, is " << last_msg_->status[18].component; - EXPECT_EQ(last_msg_->status[18].generic, 10) << "incorrect value for status[18].generic, expected 10, is " << last_msg_->status[18].generic; - EXPECT_EQ(last_msg_->status[18].specific, 233) << "incorrect value for status[18].specific, expected 233, is " << last_msg_->status[18].specific; - EXPECT_EQ(last_msg_->status[19].component, 15364) << "incorrect value for status[19].component, expected 15364, is " << last_msg_->status[19].component; - EXPECT_EQ(last_msg_->status[19].generic, 247) << "incorrect value for status[19].generic, expected 247, is " << last_msg_->status[19].generic; - EXPECT_EQ(last_msg_->status[19].specific, 82) << "incorrect value for status[19].specific, expected 82, is " << last_msg_->status[19].specific; - EXPECT_EQ(last_msg_->status[20].component, 42711) << "incorrect value for status[20].component, expected 42711, is " << last_msg_->status[20].component; - EXPECT_EQ(last_msg_->status[20].generic, 28) << "incorrect value for status[20].generic, expected 28, is " << last_msg_->status[20].generic; - EXPECT_EQ(last_msg_->status[20].specific, 138) << "incorrect value for status[20].specific, expected 138, is " << last_msg_->status[20].specific; - EXPECT_EQ(last_msg_->status[21].component, 11630) << "incorrect value for status[21].component, expected 11630, is " << last_msg_->status[21].component; - EXPECT_EQ(last_msg_->status[21].generic, 98) << "incorrect value for status[21].generic, expected 98, is " << last_msg_->status[21].generic; - EXPECT_EQ(last_msg_->status[21].specific, 218) << "incorrect value for status[21].specific, expected 218, is " << last_msg_->status[21].specific; - EXPECT_EQ(last_msg_->status[22].component, 46068) << "incorrect value for status[22].component, expected 46068, is " << last_msg_->status[22].component; - EXPECT_EQ(last_msg_->status[22].generic, 126) << "incorrect value for status[22].generic, expected 126, is " << last_msg_->status[22].generic; - EXPECT_EQ(last_msg_->status[22].specific, 107) << "incorrect value for status[22].specific, expected 107, is " << last_msg_->status[22].specific; - EXPECT_EQ(last_msg_->status[23].component, 31836) << "incorrect value for status[23].component, expected 31836, is " << last_msg_->status[23].component; - EXPECT_EQ(last_msg_->status[23].generic, 94) << "incorrect value for status[23].generic, expected 94, is " << last_msg_->status[23].generic; - EXPECT_EQ(last_msg_->status[23].specific, 157) << "incorrect value for status[23].specific, expected 157, is " << last_msg_->status[23].specific; - EXPECT_EQ(last_msg_->status[24].component, 47914) << "incorrect value for status[24].component, expected 47914, is " << last_msg_->status[24].component; - EXPECT_EQ(last_msg_->status[24].generic, 124) << "incorrect value for status[24].generic, expected 124, is " << last_msg_->status[24].generic; - EXPECT_EQ(last_msg_->status[24].specific, 6) << "incorrect value for status[24].specific, expected 6, is " << last_msg_->status[24].specific; - EXPECT_EQ(last_msg_->status[25].component, 63329) << "incorrect value for status[25].component, expected 63329, is " << last_msg_->status[25].component; - EXPECT_EQ(last_msg_->status[25].generic, 160) << "incorrect value for status[25].generic, expected 160, is " << last_msg_->status[25].generic; - EXPECT_EQ(last_msg_->status[25].specific, 188) << "incorrect value for status[25].specific, expected 188, is " << last_msg_->status[25].specific; - EXPECT_EQ(last_msg_->status[26].component, 30830) << "incorrect value for status[26].component, expected 30830, is " << last_msg_->status[26].component; - EXPECT_EQ(last_msg_->status[26].generic, 254) << "incorrect value for status[26].generic, expected 254, is " << last_msg_->status[26].generic; - EXPECT_EQ(last_msg_->status[26].specific, 214) << "incorrect value for status[26].specific, expected 214, is " << last_msg_->status[26].specific; - EXPECT_EQ(last_msg_->status[27].component, 13166) << "incorrect value for status[27].component, expected 13166, is " << last_msg_->status[27].component; - EXPECT_EQ(last_msg_->status[27].generic, 240) << "incorrect value for status[27].generic, expected 240, is " << last_msg_->status[27].generic; - EXPECT_EQ(last_msg_->status[27].specific, 164) << "incorrect value for status[27].specific, expected 164, is " << last_msg_->status[27].specific; - EXPECT_EQ(last_msg_->status[28].component, 4755) << "incorrect value for status[28].component, expected 4755, is " << last_msg_->status[28].component; - EXPECT_EQ(last_msg_->status[28].generic, 74) << "incorrect value for status[28].generic, expected 74, is " << last_msg_->status[28].generic; - EXPECT_EQ(last_msg_->status[28].specific, 178) << "incorrect value for status[28].specific, expected 178, is " << last_msg_->status[28].specific; - EXPECT_EQ(last_msg_->status[29].component, 1091) << "incorrect value for status[29].component, expected 1091, is " << last_msg_->status[29].component; - EXPECT_EQ(last_msg_->status[29].generic, 27) << "incorrect value for status[29].generic, expected 27, is " << last_msg_->status[29].generic; - EXPECT_EQ(last_msg_->status[29].specific, 73) << "incorrect value for status[29].specific, expected 73, is " << last_msg_->status[29].specific; - EXPECT_EQ(last_msg_->status[30].component, 16574) << "incorrect value for status[30].component, expected 16574, is " << last_msg_->status[30].component; - EXPECT_EQ(last_msg_->status[30].generic, 179) << "incorrect value for status[30].generic, expected 179, is " << last_msg_->status[30].generic; - EXPECT_EQ(last_msg_->status[30].specific, 146) << "incorrect value for status[30].specific, expected 146, is " << last_msg_->status[30].specific; - EXPECT_EQ(last_msg_->status[31].component, 39293) << "incorrect value for status[31].component, expected 39293, is " << last_msg_->status[31].component; - EXPECT_EQ(last_msg_->status[31].generic, 192) << "incorrect value for status[31].generic, expected 192, is " << last_msg_->status[31].generic; - EXPECT_EQ(last_msg_->status[31].specific, 46) << "incorrect value for status[31].specific, expected 46, is " << last_msg_->status[31].specific; - EXPECT_EQ(last_msg_->status[32].component, 17098) << "incorrect value for status[32].component, expected 17098, is " << last_msg_->status[32].component; - EXPECT_EQ(last_msg_->status[32].generic, 248) << "incorrect value for status[32].generic, expected 248, is " << last_msg_->status[32].generic; - EXPECT_EQ(last_msg_->status[32].specific, 46) << "incorrect value for status[32].specific, expected 46, is " << last_msg_->status[32].specific; - EXPECT_EQ(last_msg_->status[33].component, 41256) << "incorrect value for status[33].component, expected 41256, is " << last_msg_->status[33].component; - EXPECT_EQ(last_msg_->status[33].generic, 173) << "incorrect value for status[33].generic, expected 173, is " << last_msg_->status[33].generic; - EXPECT_EQ(last_msg_->status[33].specific, 242) << "incorrect value for status[33].specific, expected 242, is " << last_msg_->status[33].specific; - EXPECT_EQ(last_msg_->status[34].component, 982) << "incorrect value for status[34].component, expected 982, is " << last_msg_->status[34].component; - EXPECT_EQ(last_msg_->status[34].generic, 11) << "incorrect value for status[34].generic, expected 11, is " << last_msg_->status[34].generic; - EXPECT_EQ(last_msg_->status[34].specific, 1) << "incorrect value for status[34].specific, expected 1, is " << last_msg_->status[34].specific; - EXPECT_EQ(last_msg_->status[35].component, 18038) << "incorrect value for status[35].component, expected 18038, is " << last_msg_->status[35].component; - EXPECT_EQ(last_msg_->status[35].generic, 162) << "incorrect value for status[35].generic, expected 162, is " << last_msg_->status[35].generic; - EXPECT_EQ(last_msg_->status[35].specific, 61) << "incorrect value for status[35].specific, expected 61, is " << last_msg_->status[35].specific; - EXPECT_EQ(last_msg_->status[36].component, 7090) << "incorrect value for status[36].component, expected 7090, is " << last_msg_->status[36].component; - EXPECT_EQ(last_msg_->status[36].generic, 156) << "incorrect value for status[36].generic, expected 156, is " << last_msg_->status[36].generic; - EXPECT_EQ(last_msg_->status[36].specific, 40) << "incorrect value for status[36].specific, expected 40, is " << last_msg_->status[36].specific; - EXPECT_EQ(last_msg_->status[37].component, 29119) << "incorrect value for status[37].component, expected 29119, is " << last_msg_->status[37].component; - EXPECT_EQ(last_msg_->status[37].generic, 230) << "incorrect value for status[37].generic, expected 230, is " << last_msg_->status[37].generic; - EXPECT_EQ(last_msg_->status[37].specific, 200) << "incorrect value for status[37].specific, expected 200, is " << last_msg_->status[37].specific; - EXPECT_EQ(last_msg_->status[38].component, 2120) << "incorrect value for status[38].component, expected 2120, is " << last_msg_->status[38].component; - EXPECT_EQ(last_msg_->status[38].generic, 215) << "incorrect value for status[38].generic, expected 215, is " << last_msg_->status[38].generic; - EXPECT_EQ(last_msg_->status[38].specific, 245) << "incorrect value for status[38].specific, expected 245, is " << last_msg_->status[38].specific; - EXPECT_EQ(last_msg_->status[39].component, 15182) << "incorrect value for status[39].component, expected 15182, is " << last_msg_->status[39].component; - EXPECT_EQ(last_msg_->status[39].generic, 222) << "incorrect value for status[39].generic, expected 222, is " << last_msg_->status[39].generic; - EXPECT_EQ(last_msg_->status[39].specific, 250) << "incorrect value for status[39].specific, expected 250, is " << last_msg_->status[39].specific; - EXPECT_EQ(last_msg_->status[40].component, 8307) << "incorrect value for status[40].component, expected 8307, is " << last_msg_->status[40].component; - EXPECT_EQ(last_msg_->status[40].generic, 33) << "incorrect value for status[40].generic, expected 33, is " << last_msg_->status[40].generic; - EXPECT_EQ(last_msg_->status[40].specific, 30) << "incorrect value for status[40].specific, expected 30, is " << last_msg_->status[40].specific; - EXPECT_EQ(last_msg_->status[41].component, 43731) << "incorrect value for status[41].component, expected 43731, is " << last_msg_->status[41].component; - EXPECT_EQ(last_msg_->status[41].generic, 145) << "incorrect value for status[41].generic, expected 145, is " << last_msg_->status[41].generic; - EXPECT_EQ(last_msg_->status[41].specific, 92) << "incorrect value for status[41].specific, expected 92, is " << last_msg_->status[41].specific; - EXPECT_EQ(last_msg_->status[42].component, 19357) << "incorrect value for status[42].component, expected 19357, is " << last_msg_->status[42].component; - EXPECT_EQ(last_msg_->status[42].generic, 24) << "incorrect value for status[42].generic, expected 24, is " << last_msg_->status[42].generic; - EXPECT_EQ(last_msg_->status[42].specific, 169) << "incorrect value for status[42].specific, expected 169, is " << last_msg_->status[42].specific; - EXPECT_EQ(last_msg_->status[43].component, 14086) << "incorrect value for status[43].component, expected 14086, is " << last_msg_->status[43].component; - EXPECT_EQ(last_msg_->status[43].generic, 62) << "incorrect value for status[43].generic, expected 62, is " << last_msg_->status[43].generic; - EXPECT_EQ(last_msg_->status[43].specific, 8) << "incorrect value for status[43].specific, expected 8, is " << last_msg_->status[43].specific; - EXPECT_EQ(last_msg_->status[44].component, 21099) << "incorrect value for status[44].component, expected 21099, is " << last_msg_->status[44].component; - EXPECT_EQ(last_msg_->status[44].generic, 140) << "incorrect value for status[44].generic, expected 140, is " << last_msg_->status[44].generic; - EXPECT_EQ(last_msg_->status[44].specific, 49) << "incorrect value for status[44].specific, expected 49, is " << last_msg_->status[44].specific; - EXPECT_EQ(last_msg_->status[45].component, 31411) << "incorrect value for status[45].component, expected 31411, is " << last_msg_->status[45].component; - EXPECT_EQ(last_msg_->status[45].generic, 90) << "incorrect value for status[45].generic, expected 90, is " << last_msg_->status[45].generic; - EXPECT_EQ(last_msg_->status[45].specific, 71) << "incorrect value for status[45].specific, expected 71, is " << last_msg_->status[45].specific; - EXPECT_EQ(last_msg_->status[46].component, 22556) << "incorrect value for status[46].component, expected 22556, is " << last_msg_->status[46].component; - EXPECT_EQ(last_msg_->status[46].generic, 103) << "incorrect value for status[46].generic, expected 103, is " << last_msg_->status[46].generic; - EXPECT_EQ(last_msg_->status[46].specific, 51) << "incorrect value for status[46].specific, expected 51, is " << last_msg_->status[46].specific; - EXPECT_EQ(last_msg_->status[47].component, 18609) << "incorrect value for status[47].component, expected 18609, is " << last_msg_->status[47].component; - EXPECT_EQ(last_msg_->status[47].generic, 93) << "incorrect value for status[47].generic, expected 93, is " << last_msg_->status[47].generic; - EXPECT_EQ(last_msg_->status[47].specific, 39) << "incorrect value for status[47].specific, expected 39, is " << last_msg_->status[47].specific; - EXPECT_EQ(last_msg_->status[48].component, 2964) << "incorrect value for status[48].component, expected 2964, is " << last_msg_->status[48].component; - EXPECT_EQ(last_msg_->status[48].generic, 202) << "incorrect value for status[48].generic, expected 202, is " << last_msg_->status[48].generic; - EXPECT_EQ(last_msg_->status[48].specific, 42) << "incorrect value for status[48].specific, expected 42, is " << last_msg_->status[48].specific; - EXPECT_EQ(last_msg_->status[49].component, 23586) << "incorrect value for status[49].component, expected 23586, is " << last_msg_->status[49].component; - EXPECT_EQ(last_msg_->status[49].generic, 204) << "incorrect value for status[49].generic, expected 204, is " << last_msg_->status[49].generic; - EXPECT_EQ(last_msg_->status[49].specific, 102) << "incorrect value for status[49].specific, expected 102, is " << last_msg_->status[49].specific; - EXPECT_EQ(last_msg_->status[50].component, 25117) << "incorrect value for status[50].component, expected 25117, is " << last_msg_->status[50].component; - EXPECT_EQ(last_msg_->status[50].generic, 249) << "incorrect value for status[50].generic, expected 249, is " << last_msg_->status[50].generic; - EXPECT_EQ(last_msg_->status[50].specific, 91) << "incorrect value for status[50].specific, expected 91, is " << last_msg_->status[50].specific; - EXPECT_EQ(last_msg_->status[51].component, 24454) << "incorrect value for status[51].component, expected 24454, is " << last_msg_->status[51].component; - EXPECT_EQ(last_msg_->status[51].generic, 23) << "incorrect value for status[51].generic, expected 23, is " << last_msg_->status[51].generic; - EXPECT_EQ(last_msg_->status[51].specific, 248) << "incorrect value for status[51].specific, expected 248, is " << last_msg_->status[51].specific; - EXPECT_EQ(last_msg_->status[52].component, 5312) << "incorrect value for status[52].component, expected 5312, is " << last_msg_->status[52].component; - EXPECT_EQ(last_msg_->status[52].generic, 83) << "incorrect value for status[52].generic, expected 83, is " << last_msg_->status[52].generic; - EXPECT_EQ(last_msg_->status[52].specific, 195) << "incorrect value for status[52].specific, expected 195, is " << last_msg_->status[52].specific; - EXPECT_EQ(last_msg_->status[53].component, 46175) << "incorrect value for status[53].component, expected 46175, is " << last_msg_->status[53].component; - EXPECT_EQ(last_msg_->status[53].generic, 54) << "incorrect value for status[53].generic, expected 54, is " << last_msg_->status[53].generic; - EXPECT_EQ(last_msg_->status[53].specific, 36) << "incorrect value for status[53].specific, expected 36, is " << last_msg_->status[53].specific; - EXPECT_EQ(last_msg_->status[54].component, 19386) << "incorrect value for status[54].component, expected 19386, is " << last_msg_->status[54].component; - EXPECT_EQ(last_msg_->status[54].generic, 64) << "incorrect value for status[54].generic, expected 64, is " << last_msg_->status[54].generic; - EXPECT_EQ(last_msg_->status[54].specific, 20) << "incorrect value for status[54].specific, expected 20, is " << last_msg_->status[54].specific; - EXPECT_EQ(last_msg_->status[55].component, 34205) << "incorrect value for status[55].component, expected 34205, is " << last_msg_->status[55].component; - EXPECT_EQ(last_msg_->status[55].generic, 12) << "incorrect value for status[55].generic, expected 12, is " << last_msg_->status[55].generic; - EXPECT_EQ(last_msg_->status[55].specific, 149) << "incorrect value for status[55].specific, expected 149, is " << last_msg_->status[55].specific; - EXPECT_EQ(last_msg_->status[56].component, 3612) << "incorrect value for status[56].component, expected 3612, is " << last_msg_->status[56].component; - EXPECT_EQ(last_msg_->status[56].generic, 185) << "incorrect value for status[56].generic, expected 185, is " << last_msg_->status[56].generic; - EXPECT_EQ(last_msg_->status[56].specific, 129) << "incorrect value for status[56].specific, expected 129, is " << last_msg_->status[56].specific; - EXPECT_EQ(last_msg_->status[57].component, 61285) << "incorrect value for status[57].component, expected 61285, is " << last_msg_->status[57].component; - EXPECT_EQ(last_msg_->status[57].generic, 74) << "incorrect value for status[57].generic, expected 74, is " << last_msg_->status[57].generic; - EXPECT_EQ(last_msg_->status[57].specific, 248) << "incorrect value for status[57].specific, expected 248, is " << last_msg_->status[57].specific; - EXPECT_EQ(last_msg_->status[58].component, 7925) << "incorrect value for status[58].component, expected 7925, is " << last_msg_->status[58].component; - EXPECT_EQ(last_msg_->status[58].generic, 228) << "incorrect value for status[58].generic, expected 228, is " << last_msg_->status[58].generic; - EXPECT_EQ(last_msg_->status[58].specific, 88) << "incorrect value for status[58].specific, expected 88, is " << last_msg_->status[58].specific; - EXPECT_EQ(last_msg_->status[59].component, 54414) << "incorrect value for status[59].component, expected 54414, is " << last_msg_->status[59].component; - EXPECT_EQ(last_msg_->status[59].generic, 53) << "incorrect value for status[59].generic, expected 53, is " << last_msg_->status[59].generic; - EXPECT_EQ(last_msg_->status[59].specific, 224) << "incorrect value for status[59].specific, expected 224, is " << last_msg_->status[59].specific; - EXPECT_EQ(last_msg_->uptime, 1657804265) << "incorrect value for uptime, expected 1657804265, is " << last_msg_->uptime; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 21510); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->reporting_system, 64850) + << "incorrect value for reporting_system, expected 64850, is " + << last_msg_->reporting_system; + EXPECT_EQ(last_msg_->sbp_version, 24497) + << "incorrect value for sbp_version, expected 24497, is " + << last_msg_->sbp_version; + EXPECT_EQ(last_msg_->sequence, 1519336451) + << "incorrect value for sequence, expected 1519336451, is " + << last_msg_->sequence; + EXPECT_EQ(last_msg_->status[0].component, 52215) + << "incorrect value for status[0].component, expected 52215, is " + << last_msg_->status[0].component; + EXPECT_EQ(last_msg_->status[0].generic, 221) + << "incorrect value for status[0].generic, expected 221, is " + << last_msg_->status[0].generic; + EXPECT_EQ(last_msg_->status[0].specific, 198) + << "incorrect value for status[0].specific, expected 198, is " + << last_msg_->status[0].specific; + EXPECT_EQ(last_msg_->status[1].component, 53148) + << "incorrect value for status[1].component, expected 53148, is " + << last_msg_->status[1].component; + EXPECT_EQ(last_msg_->status[1].generic, 217) + << "incorrect value for status[1].generic, expected 217, is " + << last_msg_->status[1].generic; + EXPECT_EQ(last_msg_->status[1].specific, 238) + << "incorrect value for status[1].specific, expected 238, is " + << last_msg_->status[1].specific; + EXPECT_EQ(last_msg_->status[2].component, 34978) + << "incorrect value for status[2].component, expected 34978, is " + << last_msg_->status[2].component; + EXPECT_EQ(last_msg_->status[2].generic, 154) + << "incorrect value for status[2].generic, expected 154, is " + << last_msg_->status[2].generic; + EXPECT_EQ(last_msg_->status[2].specific, 11) + << "incorrect value for status[2].specific, expected 11, is " + << last_msg_->status[2].specific; + EXPECT_EQ(last_msg_->status[3].component, 60530) + << "incorrect value for status[3].component, expected 60530, is " + << last_msg_->status[3].component; + EXPECT_EQ(last_msg_->status[3].generic, 134) + << "incorrect value for status[3].generic, expected 134, is " + << last_msg_->status[3].generic; + EXPECT_EQ(last_msg_->status[3].specific, 235) + << "incorrect value for status[3].specific, expected 235, is " + << last_msg_->status[3].specific; + EXPECT_EQ(last_msg_->status[4].component, 34060) + << "incorrect value for status[4].component, expected 34060, is " + << last_msg_->status[4].component; + EXPECT_EQ(last_msg_->status[4].generic, 9) + << "incorrect value for status[4].generic, expected 9, is " + << last_msg_->status[4].generic; + EXPECT_EQ(last_msg_->status[4].specific, 30) + << "incorrect value for status[4].specific, expected 30, is " + << last_msg_->status[4].specific; + EXPECT_EQ(last_msg_->status[5].component, 37295) + << "incorrect value for status[5].component, expected 37295, is " + << last_msg_->status[5].component; + EXPECT_EQ(last_msg_->status[5].generic, 26) + << "incorrect value for status[5].generic, expected 26, is " + << last_msg_->status[5].generic; + EXPECT_EQ(last_msg_->status[5].specific, 114) + << "incorrect value for status[5].specific, expected 114, is " + << last_msg_->status[5].specific; + EXPECT_EQ(last_msg_->status[6].component, 5335) + << "incorrect value for status[6].component, expected 5335, is " + << last_msg_->status[6].component; + EXPECT_EQ(last_msg_->status[6].generic, 146) + << "incorrect value for status[6].generic, expected 146, is " + << last_msg_->status[6].generic; + EXPECT_EQ(last_msg_->status[6].specific, 249) + << "incorrect value for status[6].specific, expected 249, is " + << last_msg_->status[6].specific; + EXPECT_EQ(last_msg_->status[7].component, 13878) + << "incorrect value for status[7].component, expected 13878, is " + << last_msg_->status[7].component; + EXPECT_EQ(last_msg_->status[7].generic, 133) + << "incorrect value for status[7].generic, expected 133, is " + << last_msg_->status[7].generic; + EXPECT_EQ(last_msg_->status[7].specific, 193) + << "incorrect value for status[7].specific, expected 193, is " + << last_msg_->status[7].specific; + EXPECT_EQ(last_msg_->status[8].component, 47722) + << "incorrect value for status[8].component, expected 47722, is " + << last_msg_->status[8].component; + EXPECT_EQ(last_msg_->status[8].generic, 210) + << "incorrect value for status[8].generic, expected 210, is " + << last_msg_->status[8].generic; + EXPECT_EQ(last_msg_->status[8].specific, 183) + << "incorrect value for status[8].specific, expected 183, is " + << last_msg_->status[8].specific; + EXPECT_EQ(last_msg_->status[9].component, 33024) + << "incorrect value for status[9].component, expected 33024, is " + << last_msg_->status[9].component; + EXPECT_EQ(last_msg_->status[9].generic, 5) + << "incorrect value for status[9].generic, expected 5, is " + << last_msg_->status[9].generic; + EXPECT_EQ(last_msg_->status[9].specific, 248) + << "incorrect value for status[9].specific, expected 248, is " + << last_msg_->status[9].specific; + EXPECT_EQ(last_msg_->status[10].component, 38369) + << "incorrect value for status[10].component, expected 38369, is " + << last_msg_->status[10].component; + EXPECT_EQ(last_msg_->status[10].generic, 135) + << "incorrect value for status[10].generic, expected 135, is " + << last_msg_->status[10].generic; + EXPECT_EQ(last_msg_->status[10].specific, 127) + << "incorrect value for status[10].specific, expected 127, is " + << last_msg_->status[10].specific; + EXPECT_EQ(last_msg_->status[11].component, 6658) + << "incorrect value for status[11].component, expected 6658, is " + << last_msg_->status[11].component; + EXPECT_EQ(last_msg_->status[11].generic, 88) + << "incorrect value for status[11].generic, expected 88, is " + << last_msg_->status[11].generic; + EXPECT_EQ(last_msg_->status[11].specific, 92) + << "incorrect value for status[11].specific, expected 92, is " + << last_msg_->status[11].specific; + EXPECT_EQ(last_msg_->status[12].component, 26378) + << "incorrect value for status[12].component, expected 26378, is " + << last_msg_->status[12].component; + EXPECT_EQ(last_msg_->status[12].generic, 73) + << "incorrect value for status[12].generic, expected 73, is " + << last_msg_->status[12].generic; + EXPECT_EQ(last_msg_->status[12].specific, 3) + << "incorrect value for status[12].specific, expected 3, is " + << last_msg_->status[12].specific; + EXPECT_EQ(last_msg_->status[13].component, 17511) + << "incorrect value for status[13].component, expected 17511, is " + << last_msg_->status[13].component; + EXPECT_EQ(last_msg_->status[13].generic, 76) + << "incorrect value for status[13].generic, expected 76, is " + << last_msg_->status[13].generic; + EXPECT_EQ(last_msg_->status[13].specific, 184) + << "incorrect value for status[13].specific, expected 184, is " + << last_msg_->status[13].specific; + EXPECT_EQ(last_msg_->status[14].component, 52769) + << "incorrect value for status[14].component, expected 52769, is " + << last_msg_->status[14].component; + EXPECT_EQ(last_msg_->status[14].generic, 194) + << "incorrect value for status[14].generic, expected 194, is " + << last_msg_->status[14].generic; + EXPECT_EQ(last_msg_->status[14].specific, 163) + << "incorrect value for status[14].specific, expected 163, is " + << last_msg_->status[14].specific; + EXPECT_EQ(last_msg_->status[15].component, 7803) + << "incorrect value for status[15].component, expected 7803, is " + << last_msg_->status[15].component; + EXPECT_EQ(last_msg_->status[15].generic, 151) + << "incorrect value for status[15].generic, expected 151, is " + << last_msg_->status[15].generic; + EXPECT_EQ(last_msg_->status[15].specific, 176) + << "incorrect value for status[15].specific, expected 176, is " + << last_msg_->status[15].specific; + EXPECT_EQ(last_msg_->status[16].component, 44181) + << "incorrect value for status[16].component, expected 44181, is " + << last_msg_->status[16].component; + EXPECT_EQ(last_msg_->status[16].generic, 184) + << "incorrect value for status[16].generic, expected 184, is " + << last_msg_->status[16].generic; + EXPECT_EQ(last_msg_->status[16].specific, 231) + << "incorrect value for status[16].specific, expected 231, is " + << last_msg_->status[16].specific; + EXPECT_EQ(last_msg_->status[17].component, 58998) + << "incorrect value for status[17].component, expected 58998, is " + << last_msg_->status[17].component; + EXPECT_EQ(last_msg_->status[17].generic, 200) + << "incorrect value for status[17].generic, expected 200, is " + << last_msg_->status[17].generic; + EXPECT_EQ(last_msg_->status[17].specific, 168) + << "incorrect value for status[17].specific, expected 168, is " + << last_msg_->status[17].specific; + EXPECT_EQ(last_msg_->status[18].component, 28004) + << "incorrect value for status[18].component, expected 28004, is " + << last_msg_->status[18].component; + EXPECT_EQ(last_msg_->status[18].generic, 10) + << "incorrect value for status[18].generic, expected 10, is " + << last_msg_->status[18].generic; + EXPECT_EQ(last_msg_->status[18].specific, 233) + << "incorrect value for status[18].specific, expected 233, is " + << last_msg_->status[18].specific; + EXPECT_EQ(last_msg_->status[19].component, 15364) + << "incorrect value for status[19].component, expected 15364, is " + << last_msg_->status[19].component; + EXPECT_EQ(last_msg_->status[19].generic, 247) + << "incorrect value for status[19].generic, expected 247, is " + << last_msg_->status[19].generic; + EXPECT_EQ(last_msg_->status[19].specific, 82) + << "incorrect value for status[19].specific, expected 82, is " + << last_msg_->status[19].specific; + EXPECT_EQ(last_msg_->status[20].component, 42711) + << "incorrect value for status[20].component, expected 42711, is " + << last_msg_->status[20].component; + EXPECT_EQ(last_msg_->status[20].generic, 28) + << "incorrect value for status[20].generic, expected 28, is " + << last_msg_->status[20].generic; + EXPECT_EQ(last_msg_->status[20].specific, 138) + << "incorrect value for status[20].specific, expected 138, is " + << last_msg_->status[20].specific; + EXPECT_EQ(last_msg_->status[21].component, 11630) + << "incorrect value for status[21].component, expected 11630, is " + << last_msg_->status[21].component; + EXPECT_EQ(last_msg_->status[21].generic, 98) + << "incorrect value for status[21].generic, expected 98, is " + << last_msg_->status[21].generic; + EXPECT_EQ(last_msg_->status[21].specific, 218) + << "incorrect value for status[21].specific, expected 218, is " + << last_msg_->status[21].specific; + EXPECT_EQ(last_msg_->status[22].component, 46068) + << "incorrect value for status[22].component, expected 46068, is " + << last_msg_->status[22].component; + EXPECT_EQ(last_msg_->status[22].generic, 126) + << "incorrect value for status[22].generic, expected 126, is " + << last_msg_->status[22].generic; + EXPECT_EQ(last_msg_->status[22].specific, 107) + << "incorrect value for status[22].specific, expected 107, is " + << last_msg_->status[22].specific; + EXPECT_EQ(last_msg_->status[23].component, 31836) + << "incorrect value for status[23].component, expected 31836, is " + << last_msg_->status[23].component; + EXPECT_EQ(last_msg_->status[23].generic, 94) + << "incorrect value for status[23].generic, expected 94, is " + << last_msg_->status[23].generic; + EXPECT_EQ(last_msg_->status[23].specific, 157) + << "incorrect value for status[23].specific, expected 157, is " + << last_msg_->status[23].specific; + EXPECT_EQ(last_msg_->status[24].component, 47914) + << "incorrect value for status[24].component, expected 47914, is " + << last_msg_->status[24].component; + EXPECT_EQ(last_msg_->status[24].generic, 124) + << "incorrect value for status[24].generic, expected 124, is " + << last_msg_->status[24].generic; + EXPECT_EQ(last_msg_->status[24].specific, 6) + << "incorrect value for status[24].specific, expected 6, is " + << last_msg_->status[24].specific; + EXPECT_EQ(last_msg_->status[25].component, 63329) + << "incorrect value for status[25].component, expected 63329, is " + << last_msg_->status[25].component; + EXPECT_EQ(last_msg_->status[25].generic, 160) + << "incorrect value for status[25].generic, expected 160, is " + << last_msg_->status[25].generic; + EXPECT_EQ(last_msg_->status[25].specific, 188) + << "incorrect value for status[25].specific, expected 188, is " + << last_msg_->status[25].specific; + EXPECT_EQ(last_msg_->status[26].component, 30830) + << "incorrect value for status[26].component, expected 30830, is " + << last_msg_->status[26].component; + EXPECT_EQ(last_msg_->status[26].generic, 254) + << "incorrect value for status[26].generic, expected 254, is " + << last_msg_->status[26].generic; + EXPECT_EQ(last_msg_->status[26].specific, 214) + << "incorrect value for status[26].specific, expected 214, is " + << last_msg_->status[26].specific; + EXPECT_EQ(last_msg_->status[27].component, 13166) + << "incorrect value for status[27].component, expected 13166, is " + << last_msg_->status[27].component; + EXPECT_EQ(last_msg_->status[27].generic, 240) + << "incorrect value for status[27].generic, expected 240, is " + << last_msg_->status[27].generic; + EXPECT_EQ(last_msg_->status[27].specific, 164) + << "incorrect value for status[27].specific, expected 164, is " + << last_msg_->status[27].specific; + EXPECT_EQ(last_msg_->status[28].component, 4755) + << "incorrect value for status[28].component, expected 4755, is " + << last_msg_->status[28].component; + EXPECT_EQ(last_msg_->status[28].generic, 74) + << "incorrect value for status[28].generic, expected 74, is " + << last_msg_->status[28].generic; + EXPECT_EQ(last_msg_->status[28].specific, 178) + << "incorrect value for status[28].specific, expected 178, is " + << last_msg_->status[28].specific; + EXPECT_EQ(last_msg_->status[29].component, 1091) + << "incorrect value for status[29].component, expected 1091, is " + << last_msg_->status[29].component; + EXPECT_EQ(last_msg_->status[29].generic, 27) + << "incorrect value for status[29].generic, expected 27, is " + << last_msg_->status[29].generic; + EXPECT_EQ(last_msg_->status[29].specific, 73) + << "incorrect value for status[29].specific, expected 73, is " + << last_msg_->status[29].specific; + EXPECT_EQ(last_msg_->status[30].component, 16574) + << "incorrect value for status[30].component, expected 16574, is " + << last_msg_->status[30].component; + EXPECT_EQ(last_msg_->status[30].generic, 179) + << "incorrect value for status[30].generic, expected 179, is " + << last_msg_->status[30].generic; + EXPECT_EQ(last_msg_->status[30].specific, 146) + << "incorrect value for status[30].specific, expected 146, is " + << last_msg_->status[30].specific; + EXPECT_EQ(last_msg_->status[31].component, 39293) + << "incorrect value for status[31].component, expected 39293, is " + << last_msg_->status[31].component; + EXPECT_EQ(last_msg_->status[31].generic, 192) + << "incorrect value for status[31].generic, expected 192, is " + << last_msg_->status[31].generic; + EXPECT_EQ(last_msg_->status[31].specific, 46) + << "incorrect value for status[31].specific, expected 46, is " + << last_msg_->status[31].specific; + EXPECT_EQ(last_msg_->status[32].component, 17098) + << "incorrect value for status[32].component, expected 17098, is " + << last_msg_->status[32].component; + EXPECT_EQ(last_msg_->status[32].generic, 248) + << "incorrect value for status[32].generic, expected 248, is " + << last_msg_->status[32].generic; + EXPECT_EQ(last_msg_->status[32].specific, 46) + << "incorrect value for status[32].specific, expected 46, is " + << last_msg_->status[32].specific; + EXPECT_EQ(last_msg_->status[33].component, 41256) + << "incorrect value for status[33].component, expected 41256, is " + << last_msg_->status[33].component; + EXPECT_EQ(last_msg_->status[33].generic, 173) + << "incorrect value for status[33].generic, expected 173, is " + << last_msg_->status[33].generic; + EXPECT_EQ(last_msg_->status[33].specific, 242) + << "incorrect value for status[33].specific, expected 242, is " + << last_msg_->status[33].specific; + EXPECT_EQ(last_msg_->status[34].component, 982) + << "incorrect value for status[34].component, expected 982, is " + << last_msg_->status[34].component; + EXPECT_EQ(last_msg_->status[34].generic, 11) + << "incorrect value for status[34].generic, expected 11, is " + << last_msg_->status[34].generic; + EXPECT_EQ(last_msg_->status[34].specific, 1) + << "incorrect value for status[34].specific, expected 1, is " + << last_msg_->status[34].specific; + EXPECT_EQ(last_msg_->status[35].component, 18038) + << "incorrect value for status[35].component, expected 18038, is " + << last_msg_->status[35].component; + EXPECT_EQ(last_msg_->status[35].generic, 162) + << "incorrect value for status[35].generic, expected 162, is " + << last_msg_->status[35].generic; + EXPECT_EQ(last_msg_->status[35].specific, 61) + << "incorrect value for status[35].specific, expected 61, is " + << last_msg_->status[35].specific; + EXPECT_EQ(last_msg_->status[36].component, 7090) + << "incorrect value for status[36].component, expected 7090, is " + << last_msg_->status[36].component; + EXPECT_EQ(last_msg_->status[36].generic, 156) + << "incorrect value for status[36].generic, expected 156, is " + << last_msg_->status[36].generic; + EXPECT_EQ(last_msg_->status[36].specific, 40) + << "incorrect value for status[36].specific, expected 40, is " + << last_msg_->status[36].specific; + EXPECT_EQ(last_msg_->status[37].component, 29119) + << "incorrect value for status[37].component, expected 29119, is " + << last_msg_->status[37].component; + EXPECT_EQ(last_msg_->status[37].generic, 230) + << "incorrect value for status[37].generic, expected 230, is " + << last_msg_->status[37].generic; + EXPECT_EQ(last_msg_->status[37].specific, 200) + << "incorrect value for status[37].specific, expected 200, is " + << last_msg_->status[37].specific; + EXPECT_EQ(last_msg_->status[38].component, 2120) + << "incorrect value for status[38].component, expected 2120, is " + << last_msg_->status[38].component; + EXPECT_EQ(last_msg_->status[38].generic, 215) + << "incorrect value for status[38].generic, expected 215, is " + << last_msg_->status[38].generic; + EXPECT_EQ(last_msg_->status[38].specific, 245) + << "incorrect value for status[38].specific, expected 245, is " + << last_msg_->status[38].specific; + EXPECT_EQ(last_msg_->status[39].component, 15182) + << "incorrect value for status[39].component, expected 15182, is " + << last_msg_->status[39].component; + EXPECT_EQ(last_msg_->status[39].generic, 222) + << "incorrect value for status[39].generic, expected 222, is " + << last_msg_->status[39].generic; + EXPECT_EQ(last_msg_->status[39].specific, 250) + << "incorrect value for status[39].specific, expected 250, is " + << last_msg_->status[39].specific; + EXPECT_EQ(last_msg_->status[40].component, 8307) + << "incorrect value for status[40].component, expected 8307, is " + << last_msg_->status[40].component; + EXPECT_EQ(last_msg_->status[40].generic, 33) + << "incorrect value for status[40].generic, expected 33, is " + << last_msg_->status[40].generic; + EXPECT_EQ(last_msg_->status[40].specific, 30) + << "incorrect value for status[40].specific, expected 30, is " + << last_msg_->status[40].specific; + EXPECT_EQ(last_msg_->status[41].component, 43731) + << "incorrect value for status[41].component, expected 43731, is " + << last_msg_->status[41].component; + EXPECT_EQ(last_msg_->status[41].generic, 145) + << "incorrect value for status[41].generic, expected 145, is " + << last_msg_->status[41].generic; + EXPECT_EQ(last_msg_->status[41].specific, 92) + << "incorrect value for status[41].specific, expected 92, is " + << last_msg_->status[41].specific; + EXPECT_EQ(last_msg_->status[42].component, 19357) + << "incorrect value for status[42].component, expected 19357, is " + << last_msg_->status[42].component; + EXPECT_EQ(last_msg_->status[42].generic, 24) + << "incorrect value for status[42].generic, expected 24, is " + << last_msg_->status[42].generic; + EXPECT_EQ(last_msg_->status[42].specific, 169) + << "incorrect value for status[42].specific, expected 169, is " + << last_msg_->status[42].specific; + EXPECT_EQ(last_msg_->status[43].component, 14086) + << "incorrect value for status[43].component, expected 14086, is " + << last_msg_->status[43].component; + EXPECT_EQ(last_msg_->status[43].generic, 62) + << "incorrect value for status[43].generic, expected 62, is " + << last_msg_->status[43].generic; + EXPECT_EQ(last_msg_->status[43].specific, 8) + << "incorrect value for status[43].specific, expected 8, is " + << last_msg_->status[43].specific; + EXPECT_EQ(last_msg_->status[44].component, 21099) + << "incorrect value for status[44].component, expected 21099, is " + << last_msg_->status[44].component; + EXPECT_EQ(last_msg_->status[44].generic, 140) + << "incorrect value for status[44].generic, expected 140, is " + << last_msg_->status[44].generic; + EXPECT_EQ(last_msg_->status[44].specific, 49) + << "incorrect value for status[44].specific, expected 49, is " + << last_msg_->status[44].specific; + EXPECT_EQ(last_msg_->status[45].component, 31411) + << "incorrect value for status[45].component, expected 31411, is " + << last_msg_->status[45].component; + EXPECT_EQ(last_msg_->status[45].generic, 90) + << "incorrect value for status[45].generic, expected 90, is " + << last_msg_->status[45].generic; + EXPECT_EQ(last_msg_->status[45].specific, 71) + << "incorrect value for status[45].specific, expected 71, is " + << last_msg_->status[45].specific; + EXPECT_EQ(last_msg_->status[46].component, 22556) + << "incorrect value for status[46].component, expected 22556, is " + << last_msg_->status[46].component; + EXPECT_EQ(last_msg_->status[46].generic, 103) + << "incorrect value for status[46].generic, expected 103, is " + << last_msg_->status[46].generic; + EXPECT_EQ(last_msg_->status[46].specific, 51) + << "incorrect value for status[46].specific, expected 51, is " + << last_msg_->status[46].specific; + EXPECT_EQ(last_msg_->status[47].component, 18609) + << "incorrect value for status[47].component, expected 18609, is " + << last_msg_->status[47].component; + EXPECT_EQ(last_msg_->status[47].generic, 93) + << "incorrect value for status[47].generic, expected 93, is " + << last_msg_->status[47].generic; + EXPECT_EQ(last_msg_->status[47].specific, 39) + << "incorrect value for status[47].specific, expected 39, is " + << last_msg_->status[47].specific; + EXPECT_EQ(last_msg_->status[48].component, 2964) + << "incorrect value for status[48].component, expected 2964, is " + << last_msg_->status[48].component; + EXPECT_EQ(last_msg_->status[48].generic, 202) + << "incorrect value for status[48].generic, expected 202, is " + << last_msg_->status[48].generic; + EXPECT_EQ(last_msg_->status[48].specific, 42) + << "incorrect value for status[48].specific, expected 42, is " + << last_msg_->status[48].specific; + EXPECT_EQ(last_msg_->status[49].component, 23586) + << "incorrect value for status[49].component, expected 23586, is " + << last_msg_->status[49].component; + EXPECT_EQ(last_msg_->status[49].generic, 204) + << "incorrect value for status[49].generic, expected 204, is " + << last_msg_->status[49].generic; + EXPECT_EQ(last_msg_->status[49].specific, 102) + << "incorrect value for status[49].specific, expected 102, is " + << last_msg_->status[49].specific; + EXPECT_EQ(last_msg_->status[50].component, 25117) + << "incorrect value for status[50].component, expected 25117, is " + << last_msg_->status[50].component; + EXPECT_EQ(last_msg_->status[50].generic, 249) + << "incorrect value for status[50].generic, expected 249, is " + << last_msg_->status[50].generic; + EXPECT_EQ(last_msg_->status[50].specific, 91) + << "incorrect value for status[50].specific, expected 91, is " + << last_msg_->status[50].specific; + EXPECT_EQ(last_msg_->status[51].component, 24454) + << "incorrect value for status[51].component, expected 24454, is " + << last_msg_->status[51].component; + EXPECT_EQ(last_msg_->status[51].generic, 23) + << "incorrect value for status[51].generic, expected 23, is " + << last_msg_->status[51].generic; + EXPECT_EQ(last_msg_->status[51].specific, 248) + << "incorrect value for status[51].specific, expected 248, is " + << last_msg_->status[51].specific; + EXPECT_EQ(last_msg_->status[52].component, 5312) + << "incorrect value for status[52].component, expected 5312, is " + << last_msg_->status[52].component; + EXPECT_EQ(last_msg_->status[52].generic, 83) + << "incorrect value for status[52].generic, expected 83, is " + << last_msg_->status[52].generic; + EXPECT_EQ(last_msg_->status[52].specific, 195) + << "incorrect value for status[52].specific, expected 195, is " + << last_msg_->status[52].specific; + EXPECT_EQ(last_msg_->status[53].component, 46175) + << "incorrect value for status[53].component, expected 46175, is " + << last_msg_->status[53].component; + EXPECT_EQ(last_msg_->status[53].generic, 54) + << "incorrect value for status[53].generic, expected 54, is " + << last_msg_->status[53].generic; + EXPECT_EQ(last_msg_->status[53].specific, 36) + << "incorrect value for status[53].specific, expected 36, is " + << last_msg_->status[53].specific; + EXPECT_EQ(last_msg_->status[54].component, 19386) + << "incorrect value for status[54].component, expected 19386, is " + << last_msg_->status[54].component; + EXPECT_EQ(last_msg_->status[54].generic, 64) + << "incorrect value for status[54].generic, expected 64, is " + << last_msg_->status[54].generic; + EXPECT_EQ(last_msg_->status[54].specific, 20) + << "incorrect value for status[54].specific, expected 20, is " + << last_msg_->status[54].specific; + EXPECT_EQ(last_msg_->status[55].component, 34205) + << "incorrect value for status[55].component, expected 34205, is " + << last_msg_->status[55].component; + EXPECT_EQ(last_msg_->status[55].generic, 12) + << "incorrect value for status[55].generic, expected 12, is " + << last_msg_->status[55].generic; + EXPECT_EQ(last_msg_->status[55].specific, 149) + << "incorrect value for status[55].specific, expected 149, is " + << last_msg_->status[55].specific; + EXPECT_EQ(last_msg_->status[56].component, 3612) + << "incorrect value for status[56].component, expected 3612, is " + << last_msg_->status[56].component; + EXPECT_EQ(last_msg_->status[56].generic, 185) + << "incorrect value for status[56].generic, expected 185, is " + << last_msg_->status[56].generic; + EXPECT_EQ(last_msg_->status[56].specific, 129) + << "incorrect value for status[56].specific, expected 129, is " + << last_msg_->status[56].specific; + EXPECT_EQ(last_msg_->status[57].component, 61285) + << "incorrect value for status[57].component, expected 61285, is " + << last_msg_->status[57].component; + EXPECT_EQ(last_msg_->status[57].generic, 74) + << "incorrect value for status[57].generic, expected 74, is " + << last_msg_->status[57].generic; + EXPECT_EQ(last_msg_->status[57].specific, 248) + << "incorrect value for status[57].specific, expected 248, is " + << last_msg_->status[57].specific; + EXPECT_EQ(last_msg_->status[58].component, 7925) + << "incorrect value for status[58].component, expected 7925, is " + << last_msg_->status[58].component; + EXPECT_EQ(last_msg_->status[58].generic, 228) + << "incorrect value for status[58].generic, expected 228, is " + << last_msg_->status[58].generic; + EXPECT_EQ(last_msg_->status[58].specific, 88) + << "incorrect value for status[58].specific, expected 88, is " + << last_msg_->status[58].specific; + EXPECT_EQ(last_msg_->status[59].component, 54414) + << "incorrect value for status[59].component, expected 54414, is " + << last_msg_->status[59].component; + EXPECT_EQ(last_msg_->status[59].generic, 53) + << "incorrect value for status[59].generic, expected 53, is " + << last_msg_->status[59].generic; + EXPECT_EQ(last_msg_->status[59].specific, 224) + << "incorrect value for status[59].specific, expected 224, is " + << last_msg_->status[59].specific; + EXPECT_EQ(last_msg_->uptime, 1657804265) + << "incorrect value for uptime, expected 1657804265, is " + << last_msg_->uptime; } diff --git a/c/test/legacy/cpp/auto_check_sbp_telemetry_MsgTelSv.cc b/c/test/legacy/cpp/auto_check_sbp_telemetry_MsgTelSv.cc index 1fe62fab4..57eb85301 100644 --- a/c/test/legacy/cpp/auto_check_sbp_telemetry_MsgTelSv.cc +++ b/c/test/legacy/cpp/auto_check_sbp_telemetry_MsgTelSv.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/telemetry/test_MsgTelSv.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/telemetry/test_MsgTelSv.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_telemetry_MsgTelSv0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_telemetry_MsgTelSv0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_telemetry_MsgTelSv0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_telemetry_MsgTelSv0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tel_sv_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tel_sv_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,65 +81,91 @@ class Test_legacy_auto_check_sbp_telemetry_MsgTelSv0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tel_sv_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_telemetry_MsgTelSv0, Test) -{ +}; - uint8_t encoded_frame[] = {85,32,1,148,38,20,175,8,208,221,62,24,16,1,40,50,5,226,255,1,0,1,1,1,33,12,39,105, }; +TEST_F(Test_legacy_auto_check_sbp_telemetry_MsgTelSv0, Test) { + uint8_t encoded_frame[] = { + 85, 32, 1, 148, 38, 20, 175, 8, 208, 221, 62, 24, 16, 1, + 40, 50, 5, 226, 255, 1, 0, 1, 1, 1, 33, 12, 39, 105, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tel_sv_t* test_msg = ( msg_tel_sv_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->n_obs = 16; - test_msg->origin_flags = 1; - if (sizeof(test_msg->sv_tel) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sv_tel[0])); - } - test_msg->sv_tel[0].availability_flags = 5; - test_msg->sv_tel[0].az = 40; - test_msg->sv_tel[0].correction_flags = 1; - test_msg->sv_tel[0].el = 50; - test_msg->sv_tel[0].ephemeris_flags = 1; - test_msg->sv_tel[0].outlier_flags = 1; - test_msg->sv_tel[0].phase_residual = 1; - test_msg->sv_tel[0].pseudorange_residual = -30; - test_msg->sv_tel[0].sid.code = 12; - test_msg->sv_tel[0].sid.sat = 33; - test_msg->tow = 406773200; - test_msg->wn = 2223; - - EXPECT_EQ(send_message( 0x120, 9876, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tel_sv_t *test_msg = (msg_tel_sv_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->n_obs = 16; + test_msg->origin_flags = 1; + if (sizeof(test_msg->sv_tel) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->sv_tel[0])); + } + test_msg->sv_tel[0].availability_flags = 5; + test_msg->sv_tel[0].az = 40; + test_msg->sv_tel[0].correction_flags = 1; + test_msg->sv_tel[0].el = 50; + test_msg->sv_tel[0].ephemeris_flags = 1; + test_msg->sv_tel[0].outlier_flags = 1; + test_msg->sv_tel[0].phase_residual = 1; + test_msg->sv_tel[0].pseudorange_residual = -30; + test_msg->sv_tel[0].sid.code = 12; + test_msg->sv_tel[0].sid.sat = 33; + test_msg->tow = 406773200; + test_msg->wn = 2223; + + EXPECT_EQ(send_message(0x120, 9876, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 9876); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->n_obs, 16) << "incorrect value for n_obs, expected 16, is " << last_msg_->n_obs; - EXPECT_EQ(last_msg_->origin_flags, 1) << "incorrect value for origin_flags, expected 1, is " << last_msg_->origin_flags; - EXPECT_EQ(last_msg_->sv_tel[0].availability_flags, 5) << "incorrect value for sv_tel[0].availability_flags, expected 5, is " << last_msg_->sv_tel[0].availability_flags; - EXPECT_EQ(last_msg_->sv_tel[0].az, 40) << "incorrect value for sv_tel[0].az, expected 40, is " << last_msg_->sv_tel[0].az; - EXPECT_EQ(last_msg_->sv_tel[0].correction_flags, 1) << "incorrect value for sv_tel[0].correction_flags, expected 1, is " << last_msg_->sv_tel[0].correction_flags; - EXPECT_EQ(last_msg_->sv_tel[0].el, 50) << "incorrect value for sv_tel[0].el, expected 50, is " << last_msg_->sv_tel[0].el; - EXPECT_EQ(last_msg_->sv_tel[0].ephemeris_flags, 1) << "incorrect value for sv_tel[0].ephemeris_flags, expected 1, is " << last_msg_->sv_tel[0].ephemeris_flags; - EXPECT_EQ(last_msg_->sv_tel[0].outlier_flags, 1) << "incorrect value for sv_tel[0].outlier_flags, expected 1, is " << last_msg_->sv_tel[0].outlier_flags; - EXPECT_EQ(last_msg_->sv_tel[0].phase_residual, 1) << "incorrect value for sv_tel[0].phase_residual, expected 1, is " << last_msg_->sv_tel[0].phase_residual; - EXPECT_EQ(last_msg_->sv_tel[0].pseudorange_residual, -30) << "incorrect value for sv_tel[0].pseudorange_residual, expected -30, is " << last_msg_->sv_tel[0].pseudorange_residual; - EXPECT_EQ(last_msg_->sv_tel[0].sid.code, 12) << "incorrect value for sv_tel[0].sid.code, expected 12, is " << last_msg_->sv_tel[0].sid.code; - EXPECT_EQ(last_msg_->sv_tel[0].sid.sat, 33) << "incorrect value for sv_tel[0].sid.sat, expected 33, is " << last_msg_->sv_tel[0].sid.sat; - EXPECT_EQ(last_msg_->tow, 406773200) << "incorrect value for tow, expected 406773200, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->wn, 2223) << "incorrect value for wn, expected 2223, is " << last_msg_->wn; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 9876); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->n_obs, 16) + << "incorrect value for n_obs, expected 16, is " << last_msg_->n_obs; + EXPECT_EQ(last_msg_->origin_flags, 1) + << "incorrect value for origin_flags, expected 1, is " + << last_msg_->origin_flags; + EXPECT_EQ(last_msg_->sv_tel[0].availability_flags, 5) + << "incorrect value for sv_tel[0].availability_flags, expected 5, is " + << last_msg_->sv_tel[0].availability_flags; + EXPECT_EQ(last_msg_->sv_tel[0].az, 40) + << "incorrect value for sv_tel[0].az, expected 40, is " + << last_msg_->sv_tel[0].az; + EXPECT_EQ(last_msg_->sv_tel[0].correction_flags, 1) + << "incorrect value for sv_tel[0].correction_flags, expected 1, is " + << last_msg_->sv_tel[0].correction_flags; + EXPECT_EQ(last_msg_->sv_tel[0].el, 50) + << "incorrect value for sv_tel[0].el, expected 50, is " + << last_msg_->sv_tel[0].el; + EXPECT_EQ(last_msg_->sv_tel[0].ephemeris_flags, 1) + << "incorrect value for sv_tel[0].ephemeris_flags, expected 1, is " + << last_msg_->sv_tel[0].ephemeris_flags; + EXPECT_EQ(last_msg_->sv_tel[0].outlier_flags, 1) + << "incorrect value for sv_tel[0].outlier_flags, expected 1, is " + << last_msg_->sv_tel[0].outlier_flags; + EXPECT_EQ(last_msg_->sv_tel[0].phase_residual, 1) + << "incorrect value for sv_tel[0].phase_residual, expected 1, is " + << last_msg_->sv_tel[0].phase_residual; + EXPECT_EQ(last_msg_->sv_tel[0].pseudorange_residual, -30) + << "incorrect value for sv_tel[0].pseudorange_residual, expected -30, is " + << last_msg_->sv_tel[0].pseudorange_residual; + EXPECT_EQ(last_msg_->sv_tel[0].sid.code, 12) + << "incorrect value for sv_tel[0].sid.code, expected 12, is " + << last_msg_->sv_tel[0].sid.code; + EXPECT_EQ(last_msg_->sv_tel[0].sid.sat, 33) + << "incorrect value for sv_tel[0].sid.sat, expected 33, is " + << last_msg_->sv_tel[0].sid.sat; + EXPECT_EQ(last_msg_->tow, 406773200) + << "incorrect value for tow, expected 406773200, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->wn, 2223) + << "incorrect value for wn, expected 2223, is " << last_msg_->wn; } diff --git a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgMeasurementState.cc b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgMeasurementState.cc index 56420d7f2..5132a2fce 100644 --- a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgMeasurementState.cc +++ b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgMeasurementState.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgMeasurementState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgMeasurementState.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_tracking_MsgMeasurementState0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgMeasurementState0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgMeasurementState0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgMeasurementState0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_measurement_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_measurement_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,823 +82,1314 @@ class Test_legacy_auto_check_sbp_tracking_MsgMeasurementState0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_measurement_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgMeasurementState0, Test) -{ +}; - uint8_t encoded_frame[] = {85,97,0,207,121,237,29,0,162,0,0,0,0,0,0,27,0,201,20,0,168,32,0,184,15,0,187,0,0,0,18,0,210,16,0,167,0,0,0,23,0,213,10,0,223,0,0,0,0,0,0,0,0,0,0,0,0,131,2,202,27,1,192,15,1,165,29,1,146,32,1,170,18,1,201,0,0,0,0,0,0,0,0,0,23,1,212,10,1,205,0,0,0,96,3,230,0,0,0,101,3,214,103,3,212,104,3,209,106,3,157,102,3,230,0,0,0,0,0,0,101,4,189,96,4,207,106,4,164,104,4,193,0,0,0,102,4,208,0,0,0,27,12,212,29,12,161,32,12,216,30,12,216,20,12,178,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,14,203,0,0,0,5,14,158,4,14,194,11,14,192,9,14,207,0,0,0,0,0,0,0,0,0,9,20,218,5,20,176,36,20,217,11,20,200,4,20,205,0,0,0,0,0,0,35,54, }; +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgMeasurementState0, Test) { + uint8_t encoded_frame[] = { + 85, 97, 0, 207, 121, 237, 29, 0, 162, 0, 0, 0, 0, 0, 0, + 27, 0, 201, 20, 0, 168, 32, 0, 184, 15, 0, 187, 0, 0, 0, + 18, 0, 210, 16, 0, 167, 0, 0, 0, 23, 0, 213, 10, 0, 223, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 2, 202, + 27, 1, 192, 15, 1, 165, 29, 1, 146, 32, 1, 170, 18, 1, 201, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 1, 212, 10, 1, 205, + 0, 0, 0, 96, 3, 230, 0, 0, 0, 101, 3, 214, 103, 3, 212, + 104, 3, 209, 106, 3, 157, 102, 3, 230, 0, 0, 0, 0, 0, 0, + 101, 4, 189, 96, 4, 207, 106, 4, 164, 104, 4, 193, 0, 0, 0, + 102, 4, 208, 0, 0, 0, 27, 12, 212, 29, 12, 161, 32, 12, 216, + 30, 12, 216, 20, 12, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 36, 14, 203, 0, 0, 0, 5, 14, 158, 4, 14, 194, 11, 14, 192, + 9, 14, 207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 20, 218, + 5, 20, 176, 36, 20, 217, 11, 20, 200, 4, 20, 205, 0, 0, 0, + 0, 0, 0, 35, 54, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_measurement_state_t* test_msg = ( msg_measurement_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[0].cn0 = 162; - test_msg->states[0].mesid.code = 0; - test_msg->states[0].mesid.sat = 29; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[1].cn0 = 0; - test_msg->states[1].mesid.code = 0; - test_msg->states[1].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[2].cn0 = 0; - test_msg->states[2].mesid.code = 0; - test_msg->states[2].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[3].cn0 = 201; - test_msg->states[3].mesid.code = 0; - test_msg->states[3].mesid.sat = 27; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[4].cn0 = 168; - test_msg->states[4].mesid.code = 0; - test_msg->states[4].mesid.sat = 20; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[5].cn0 = 184; - test_msg->states[5].mesid.code = 0; - test_msg->states[5].mesid.sat = 32; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[6].cn0 = 187; - test_msg->states[6].mesid.code = 0; - test_msg->states[6].mesid.sat = 15; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[7].cn0 = 0; - test_msg->states[7].mesid.code = 0; - test_msg->states[7].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[8].cn0 = 210; - test_msg->states[8].mesid.code = 0; - test_msg->states[8].mesid.sat = 18; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[9].cn0 = 167; - test_msg->states[9].mesid.code = 0; - test_msg->states[9].mesid.sat = 16; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[10].cn0 = 0; - test_msg->states[10].mesid.code = 0; - test_msg->states[10].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[11].cn0 = 213; - test_msg->states[11].mesid.code = 0; - test_msg->states[11].mesid.sat = 23; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[12].cn0 = 223; - test_msg->states[12].mesid.code = 0; - test_msg->states[12].mesid.sat = 10; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[13].cn0 = 0; - test_msg->states[13].mesid.code = 0; - test_msg->states[13].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[14].cn0 = 0; - test_msg->states[14].mesid.code = 0; - test_msg->states[14].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[15].cn0 = 0; - test_msg->states[15].mesid.code = 0; - test_msg->states[15].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[16].cn0 = 0; - test_msg->states[16].mesid.code = 0; - test_msg->states[16].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[17].cn0 = 202; - test_msg->states[17].mesid.code = 2; - test_msg->states[17].mesid.sat = 131; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[18].cn0 = 192; - test_msg->states[18].mesid.code = 1; - test_msg->states[18].mesid.sat = 27; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[19].cn0 = 165; - test_msg->states[19].mesid.code = 1; - test_msg->states[19].mesid.sat = 15; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[20].cn0 = 146; - test_msg->states[20].mesid.code = 1; - test_msg->states[20].mesid.sat = 29; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[21].cn0 = 170; - test_msg->states[21].mesid.code = 1; - test_msg->states[21].mesid.sat = 32; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[22].cn0 = 201; - test_msg->states[22].mesid.code = 1; - test_msg->states[22].mesid.sat = 18; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[23].cn0 = 0; - test_msg->states[23].mesid.code = 0; - test_msg->states[23].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[24].cn0 = 0; - test_msg->states[24].mesid.code = 0; - test_msg->states[24].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[25].cn0 = 0; - test_msg->states[25].mesid.code = 0; - test_msg->states[25].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[26].cn0 = 212; - test_msg->states[26].mesid.code = 1; - test_msg->states[26].mesid.sat = 23; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[27].cn0 = 205; - test_msg->states[27].mesid.code = 1; - test_msg->states[27].mesid.sat = 10; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[28].cn0 = 0; - test_msg->states[28].mesid.code = 0; - test_msg->states[28].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[29].cn0 = 230; - test_msg->states[29].mesid.code = 3; - test_msg->states[29].mesid.sat = 96; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[30].cn0 = 0; - test_msg->states[30].mesid.code = 0; - test_msg->states[30].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[31].cn0 = 214; - test_msg->states[31].mesid.code = 3; - test_msg->states[31].mesid.sat = 101; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[32].cn0 = 212; - test_msg->states[32].mesid.code = 3; - test_msg->states[32].mesid.sat = 103; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[33].cn0 = 209; - test_msg->states[33].mesid.code = 3; - test_msg->states[33].mesid.sat = 104; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[34].cn0 = 157; - test_msg->states[34].mesid.code = 3; - test_msg->states[34].mesid.sat = 106; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[35].cn0 = 230; - test_msg->states[35].mesid.code = 3; - test_msg->states[35].mesid.sat = 102; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[36].cn0 = 0; - test_msg->states[36].mesid.code = 0; - test_msg->states[36].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[37].cn0 = 0; - test_msg->states[37].mesid.code = 0; - test_msg->states[37].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[38].cn0 = 189; - test_msg->states[38].mesid.code = 4; - test_msg->states[38].mesid.sat = 101; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[39].cn0 = 207; - test_msg->states[39].mesid.code = 4; - test_msg->states[39].mesid.sat = 96; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[40].cn0 = 164; - test_msg->states[40].mesid.code = 4; - test_msg->states[40].mesid.sat = 106; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[41].cn0 = 193; - test_msg->states[41].mesid.code = 4; - test_msg->states[41].mesid.sat = 104; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[42].cn0 = 0; - test_msg->states[42].mesid.code = 0; - test_msg->states[42].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[43].cn0 = 208; - test_msg->states[43].mesid.code = 4; - test_msg->states[43].mesid.sat = 102; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[44].cn0 = 0; - test_msg->states[44].mesid.code = 0; - test_msg->states[44].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[45].cn0 = 212; - test_msg->states[45].mesid.code = 12; - test_msg->states[45].mesid.sat = 27; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[46].cn0 = 161; - test_msg->states[46].mesid.code = 12; - test_msg->states[46].mesid.sat = 29; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[47].cn0 = 216; - test_msg->states[47].mesid.code = 12; - test_msg->states[47].mesid.sat = 32; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[48].cn0 = 216; - test_msg->states[48].mesid.code = 12; - test_msg->states[48].mesid.sat = 30; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[49].cn0 = 178; - test_msg->states[49].mesid.code = 12; - test_msg->states[49].mesid.sat = 20; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[50].cn0 = 0; - test_msg->states[50].mesid.code = 0; - test_msg->states[50].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[51].cn0 = 0; - test_msg->states[51].mesid.code = 0; - test_msg->states[51].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[52].cn0 = 0; - test_msg->states[52].mesid.code = 0; - test_msg->states[52].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[53].cn0 = 0; - test_msg->states[53].mesid.code = 0; - test_msg->states[53].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[54].cn0 = 0; - test_msg->states[54].mesid.code = 0; - test_msg->states[54].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[55].cn0 = 0; - test_msg->states[55].mesid.code = 0; - test_msg->states[55].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[56].cn0 = 0; - test_msg->states[56].mesid.code = 0; - test_msg->states[56].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[57].cn0 = 0; - test_msg->states[57].mesid.code = 0; - test_msg->states[57].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[58].cn0 = 0; - test_msg->states[58].mesid.code = 0; - test_msg->states[58].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[59].cn0 = 0; - test_msg->states[59].mesid.code = 0; - test_msg->states[59].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[60].cn0 = 0; - test_msg->states[60].mesid.code = 0; - test_msg->states[60].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[61].cn0 = 0; - test_msg->states[61].mesid.code = 0; - test_msg->states[61].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[62].cn0 = 0; - test_msg->states[62].mesid.code = 0; - test_msg->states[62].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[63].cn0 = 203; - test_msg->states[63].mesid.code = 14; - test_msg->states[63].mesid.sat = 36; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[64].cn0 = 0; - test_msg->states[64].mesid.code = 0; - test_msg->states[64].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[65].cn0 = 158; - test_msg->states[65].mesid.code = 14; - test_msg->states[65].mesid.sat = 5; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[66].cn0 = 194; - test_msg->states[66].mesid.code = 14; - test_msg->states[66].mesid.sat = 4; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[67].cn0 = 192; - test_msg->states[67].mesid.code = 14; - test_msg->states[67].mesid.sat = 11; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[68].cn0 = 207; - test_msg->states[68].mesid.code = 14; - test_msg->states[68].mesid.sat = 9; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[69].cn0 = 0; - test_msg->states[69].mesid.code = 0; - test_msg->states[69].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[70].cn0 = 0; - test_msg->states[70].mesid.code = 0; - test_msg->states[70].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[71].cn0 = 0; - test_msg->states[71].mesid.code = 0; - test_msg->states[71].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[72].cn0 = 218; - test_msg->states[72].mesid.code = 20; - test_msg->states[72].mesid.sat = 9; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[73].cn0 = 176; - test_msg->states[73].mesid.code = 20; - test_msg->states[73].mesid.sat = 5; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[74].cn0 = 217; - test_msg->states[74].mesid.code = 20; - test_msg->states[74].mesid.sat = 36; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[75].cn0 = 200; - test_msg->states[75].mesid.code = 20; - test_msg->states[75].mesid.sat = 11; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[76].cn0 = 205; - test_msg->states[76].mesid.code = 20; - test_msg->states[76].mesid.sat = 4; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[77].cn0 = 0; - test_msg->states[77].mesid.code = 0; - test_msg->states[77].mesid.sat = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[78].cn0 = 0; - test_msg->states[78].mesid.code = 0; - test_msg->states[78].mesid.sat = 0; - - EXPECT_EQ(send_message( 0x61, 31183, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_measurement_state_t *test_msg = + (msg_measurement_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[0].cn0 = 162; + test_msg->states[0].mesid.code = 0; + test_msg->states[0].mesid.sat = 29; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[1].cn0 = 0; + test_msg->states[1].mesid.code = 0; + test_msg->states[1].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[2].cn0 = 0; + test_msg->states[2].mesid.code = 0; + test_msg->states[2].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[3].cn0 = 201; + test_msg->states[3].mesid.code = 0; + test_msg->states[3].mesid.sat = 27; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[4].cn0 = 168; + test_msg->states[4].mesid.code = 0; + test_msg->states[4].mesid.sat = 20; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[5].cn0 = 184; + test_msg->states[5].mesid.code = 0; + test_msg->states[5].mesid.sat = 32; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[6].cn0 = 187; + test_msg->states[6].mesid.code = 0; + test_msg->states[6].mesid.sat = 15; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[7].cn0 = 0; + test_msg->states[7].mesid.code = 0; + test_msg->states[7].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[8].cn0 = 210; + test_msg->states[8].mesid.code = 0; + test_msg->states[8].mesid.sat = 18; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[9].cn0 = 167; + test_msg->states[9].mesid.code = 0; + test_msg->states[9].mesid.sat = 16; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[10].cn0 = 0; + test_msg->states[10].mesid.code = 0; + test_msg->states[10].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[11].cn0 = 213; + test_msg->states[11].mesid.code = 0; + test_msg->states[11].mesid.sat = 23; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[12].cn0 = 223; + test_msg->states[12].mesid.code = 0; + test_msg->states[12].mesid.sat = 10; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[13].cn0 = 0; + test_msg->states[13].mesid.code = 0; + test_msg->states[13].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[14].cn0 = 0; + test_msg->states[14].mesid.code = 0; + test_msg->states[14].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[15].cn0 = 0; + test_msg->states[15].mesid.code = 0; + test_msg->states[15].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[16].cn0 = 0; + test_msg->states[16].mesid.code = 0; + test_msg->states[16].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[17].cn0 = 202; + test_msg->states[17].mesid.code = 2; + test_msg->states[17].mesid.sat = 131; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[18].cn0 = 192; + test_msg->states[18].mesid.code = 1; + test_msg->states[18].mesid.sat = 27; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[19].cn0 = 165; + test_msg->states[19].mesid.code = 1; + test_msg->states[19].mesid.sat = 15; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[20].cn0 = 146; + test_msg->states[20].mesid.code = 1; + test_msg->states[20].mesid.sat = 29; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[21].cn0 = 170; + test_msg->states[21].mesid.code = 1; + test_msg->states[21].mesid.sat = 32; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[22].cn0 = 201; + test_msg->states[22].mesid.code = 1; + test_msg->states[22].mesid.sat = 18; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[23].cn0 = 0; + test_msg->states[23].mesid.code = 0; + test_msg->states[23].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[24].cn0 = 0; + test_msg->states[24].mesid.code = 0; + test_msg->states[24].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[25].cn0 = 0; + test_msg->states[25].mesid.code = 0; + test_msg->states[25].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[26].cn0 = 212; + test_msg->states[26].mesid.code = 1; + test_msg->states[26].mesid.sat = 23; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[27].cn0 = 205; + test_msg->states[27].mesid.code = 1; + test_msg->states[27].mesid.sat = 10; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[28].cn0 = 0; + test_msg->states[28].mesid.code = 0; + test_msg->states[28].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[29].cn0 = 230; + test_msg->states[29].mesid.code = 3; + test_msg->states[29].mesid.sat = 96; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[30].cn0 = 0; + test_msg->states[30].mesid.code = 0; + test_msg->states[30].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[31].cn0 = 214; + test_msg->states[31].mesid.code = 3; + test_msg->states[31].mesid.sat = 101; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[32].cn0 = 212; + test_msg->states[32].mesid.code = 3; + test_msg->states[32].mesid.sat = 103; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[33].cn0 = 209; + test_msg->states[33].mesid.code = 3; + test_msg->states[33].mesid.sat = 104; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[34].cn0 = 157; + test_msg->states[34].mesid.code = 3; + test_msg->states[34].mesid.sat = 106; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[35].cn0 = 230; + test_msg->states[35].mesid.code = 3; + test_msg->states[35].mesid.sat = 102; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[36].cn0 = 0; + test_msg->states[36].mesid.code = 0; + test_msg->states[36].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[37].cn0 = 0; + test_msg->states[37].mesid.code = 0; + test_msg->states[37].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[38].cn0 = 189; + test_msg->states[38].mesid.code = 4; + test_msg->states[38].mesid.sat = 101; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[39].cn0 = 207; + test_msg->states[39].mesid.code = 4; + test_msg->states[39].mesid.sat = 96; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[40].cn0 = 164; + test_msg->states[40].mesid.code = 4; + test_msg->states[40].mesid.sat = 106; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[41].cn0 = 193; + test_msg->states[41].mesid.code = 4; + test_msg->states[41].mesid.sat = 104; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[42].cn0 = 0; + test_msg->states[42].mesid.code = 0; + test_msg->states[42].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[43].cn0 = 208; + test_msg->states[43].mesid.code = 4; + test_msg->states[43].mesid.sat = 102; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[44].cn0 = 0; + test_msg->states[44].mesid.code = 0; + test_msg->states[44].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[45].cn0 = 212; + test_msg->states[45].mesid.code = 12; + test_msg->states[45].mesid.sat = 27; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[46].cn0 = 161; + test_msg->states[46].mesid.code = 12; + test_msg->states[46].mesid.sat = 29; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[47].cn0 = 216; + test_msg->states[47].mesid.code = 12; + test_msg->states[47].mesid.sat = 32; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[48].cn0 = 216; + test_msg->states[48].mesid.code = 12; + test_msg->states[48].mesid.sat = 30; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[49].cn0 = 178; + test_msg->states[49].mesid.code = 12; + test_msg->states[49].mesid.sat = 20; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[50].cn0 = 0; + test_msg->states[50].mesid.code = 0; + test_msg->states[50].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[51].cn0 = 0; + test_msg->states[51].mesid.code = 0; + test_msg->states[51].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[52].cn0 = 0; + test_msg->states[52].mesid.code = 0; + test_msg->states[52].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[53].cn0 = 0; + test_msg->states[53].mesid.code = 0; + test_msg->states[53].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[54].cn0 = 0; + test_msg->states[54].mesid.code = 0; + test_msg->states[54].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[55].cn0 = 0; + test_msg->states[55].mesid.code = 0; + test_msg->states[55].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[56].cn0 = 0; + test_msg->states[56].mesid.code = 0; + test_msg->states[56].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[57].cn0 = 0; + test_msg->states[57].mesid.code = 0; + test_msg->states[57].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[58].cn0 = 0; + test_msg->states[58].mesid.code = 0; + test_msg->states[58].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[59].cn0 = 0; + test_msg->states[59].mesid.code = 0; + test_msg->states[59].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[60].cn0 = 0; + test_msg->states[60].mesid.code = 0; + test_msg->states[60].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[61].cn0 = 0; + test_msg->states[61].mesid.code = 0; + test_msg->states[61].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[62].cn0 = 0; + test_msg->states[62].mesid.code = 0; + test_msg->states[62].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[63].cn0 = 203; + test_msg->states[63].mesid.code = 14; + test_msg->states[63].mesid.sat = 36; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[64].cn0 = 0; + test_msg->states[64].mesid.code = 0; + test_msg->states[64].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[65].cn0 = 158; + test_msg->states[65].mesid.code = 14; + test_msg->states[65].mesid.sat = 5; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[66].cn0 = 194; + test_msg->states[66].mesid.code = 14; + test_msg->states[66].mesid.sat = 4; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[67].cn0 = 192; + test_msg->states[67].mesid.code = 14; + test_msg->states[67].mesid.sat = 11; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[68].cn0 = 207; + test_msg->states[68].mesid.code = 14; + test_msg->states[68].mesid.sat = 9; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[69].cn0 = 0; + test_msg->states[69].mesid.code = 0; + test_msg->states[69].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[70].cn0 = 0; + test_msg->states[70].mesid.code = 0; + test_msg->states[70].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[71].cn0 = 0; + test_msg->states[71].mesid.code = 0; + test_msg->states[71].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[72].cn0 = 218; + test_msg->states[72].mesid.code = 20; + test_msg->states[72].mesid.sat = 9; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[73].cn0 = 176; + test_msg->states[73].mesid.code = 20; + test_msg->states[73].mesid.sat = 5; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[74].cn0 = 217; + test_msg->states[74].mesid.code = 20; + test_msg->states[74].mesid.sat = 36; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[75].cn0 = 200; + test_msg->states[75].mesid.code = 20; + test_msg->states[75].mesid.sat = 11; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[76].cn0 = 205; + test_msg->states[76].mesid.code = 20; + test_msg->states[76].mesid.sat = 4; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[77].cn0 = 0; + test_msg->states[77].mesid.code = 0; + test_msg->states[77].mesid.sat = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[78].cn0 = 0; + test_msg->states[78].mesid.code = 0; + test_msg->states[78].mesid.sat = 0; + + EXPECT_EQ(send_message(0x61, 31183, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 31183); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->states[0].cn0, 162) << "incorrect value for states[0].cn0, expected 162, is " << last_msg_->states[0].cn0; - EXPECT_EQ(last_msg_->states[0].mesid.code, 0) << "incorrect value for states[0].mesid.code, expected 0, is " << last_msg_->states[0].mesid.code; - EXPECT_EQ(last_msg_->states[0].mesid.sat, 29) << "incorrect value for states[0].mesid.sat, expected 29, is " << last_msg_->states[0].mesid.sat; - EXPECT_EQ(last_msg_->states[1].cn0, 0) << "incorrect value for states[1].cn0, expected 0, is " << last_msg_->states[1].cn0; - EXPECT_EQ(last_msg_->states[1].mesid.code, 0) << "incorrect value for states[1].mesid.code, expected 0, is " << last_msg_->states[1].mesid.code; - EXPECT_EQ(last_msg_->states[1].mesid.sat, 0) << "incorrect value for states[1].mesid.sat, expected 0, is " << last_msg_->states[1].mesid.sat; - EXPECT_EQ(last_msg_->states[2].cn0, 0) << "incorrect value for states[2].cn0, expected 0, is " << last_msg_->states[2].cn0; - EXPECT_EQ(last_msg_->states[2].mesid.code, 0) << "incorrect value for states[2].mesid.code, expected 0, is " << last_msg_->states[2].mesid.code; - EXPECT_EQ(last_msg_->states[2].mesid.sat, 0) << "incorrect value for states[2].mesid.sat, expected 0, is " << last_msg_->states[2].mesid.sat; - EXPECT_EQ(last_msg_->states[3].cn0, 201) << "incorrect value for states[3].cn0, expected 201, is " << last_msg_->states[3].cn0; - EXPECT_EQ(last_msg_->states[3].mesid.code, 0) << "incorrect value for states[3].mesid.code, expected 0, is " << last_msg_->states[3].mesid.code; - EXPECT_EQ(last_msg_->states[3].mesid.sat, 27) << "incorrect value for states[3].mesid.sat, expected 27, is " << last_msg_->states[3].mesid.sat; - EXPECT_EQ(last_msg_->states[4].cn0, 168) << "incorrect value for states[4].cn0, expected 168, is " << last_msg_->states[4].cn0; - EXPECT_EQ(last_msg_->states[4].mesid.code, 0) << "incorrect value for states[4].mesid.code, expected 0, is " << last_msg_->states[4].mesid.code; - EXPECT_EQ(last_msg_->states[4].mesid.sat, 20) << "incorrect value for states[4].mesid.sat, expected 20, is " << last_msg_->states[4].mesid.sat; - EXPECT_EQ(last_msg_->states[5].cn0, 184) << "incorrect value for states[5].cn0, expected 184, is " << last_msg_->states[5].cn0; - EXPECT_EQ(last_msg_->states[5].mesid.code, 0) << "incorrect value for states[5].mesid.code, expected 0, is " << last_msg_->states[5].mesid.code; - EXPECT_EQ(last_msg_->states[5].mesid.sat, 32) << "incorrect value for states[5].mesid.sat, expected 32, is " << last_msg_->states[5].mesid.sat; - EXPECT_EQ(last_msg_->states[6].cn0, 187) << "incorrect value for states[6].cn0, expected 187, is " << last_msg_->states[6].cn0; - EXPECT_EQ(last_msg_->states[6].mesid.code, 0) << "incorrect value for states[6].mesid.code, expected 0, is " << last_msg_->states[6].mesid.code; - EXPECT_EQ(last_msg_->states[6].mesid.sat, 15) << "incorrect value for states[6].mesid.sat, expected 15, is " << last_msg_->states[6].mesid.sat; - EXPECT_EQ(last_msg_->states[7].cn0, 0) << "incorrect value for states[7].cn0, expected 0, is " << last_msg_->states[7].cn0; - EXPECT_EQ(last_msg_->states[7].mesid.code, 0) << "incorrect value for states[7].mesid.code, expected 0, is " << last_msg_->states[7].mesid.code; - EXPECT_EQ(last_msg_->states[7].mesid.sat, 0) << "incorrect value for states[7].mesid.sat, expected 0, is " << last_msg_->states[7].mesid.sat; - EXPECT_EQ(last_msg_->states[8].cn0, 210) << "incorrect value for states[8].cn0, expected 210, is " << last_msg_->states[8].cn0; - EXPECT_EQ(last_msg_->states[8].mesid.code, 0) << "incorrect value for states[8].mesid.code, expected 0, is " << last_msg_->states[8].mesid.code; - EXPECT_EQ(last_msg_->states[8].mesid.sat, 18) << "incorrect value for states[8].mesid.sat, expected 18, is " << last_msg_->states[8].mesid.sat; - EXPECT_EQ(last_msg_->states[9].cn0, 167) << "incorrect value for states[9].cn0, expected 167, is " << last_msg_->states[9].cn0; - EXPECT_EQ(last_msg_->states[9].mesid.code, 0) << "incorrect value for states[9].mesid.code, expected 0, is " << last_msg_->states[9].mesid.code; - EXPECT_EQ(last_msg_->states[9].mesid.sat, 16) << "incorrect value for states[9].mesid.sat, expected 16, is " << last_msg_->states[9].mesid.sat; - EXPECT_EQ(last_msg_->states[10].cn0, 0) << "incorrect value for states[10].cn0, expected 0, is " << last_msg_->states[10].cn0; - EXPECT_EQ(last_msg_->states[10].mesid.code, 0) << "incorrect value for states[10].mesid.code, expected 0, is " << last_msg_->states[10].mesid.code; - EXPECT_EQ(last_msg_->states[10].mesid.sat, 0) << "incorrect value for states[10].mesid.sat, expected 0, is " << last_msg_->states[10].mesid.sat; - EXPECT_EQ(last_msg_->states[11].cn0, 213) << "incorrect value for states[11].cn0, expected 213, is " << last_msg_->states[11].cn0; - EXPECT_EQ(last_msg_->states[11].mesid.code, 0) << "incorrect value for states[11].mesid.code, expected 0, is " << last_msg_->states[11].mesid.code; - EXPECT_EQ(last_msg_->states[11].mesid.sat, 23) << "incorrect value for states[11].mesid.sat, expected 23, is " << last_msg_->states[11].mesid.sat; - EXPECT_EQ(last_msg_->states[12].cn0, 223) << "incorrect value for states[12].cn0, expected 223, is " << last_msg_->states[12].cn0; - EXPECT_EQ(last_msg_->states[12].mesid.code, 0) << "incorrect value for states[12].mesid.code, expected 0, is " << last_msg_->states[12].mesid.code; - EXPECT_EQ(last_msg_->states[12].mesid.sat, 10) << "incorrect value for states[12].mesid.sat, expected 10, is " << last_msg_->states[12].mesid.sat; - EXPECT_EQ(last_msg_->states[13].cn0, 0) << "incorrect value for states[13].cn0, expected 0, is " << last_msg_->states[13].cn0; - EXPECT_EQ(last_msg_->states[13].mesid.code, 0) << "incorrect value for states[13].mesid.code, expected 0, is " << last_msg_->states[13].mesid.code; - EXPECT_EQ(last_msg_->states[13].mesid.sat, 0) << "incorrect value for states[13].mesid.sat, expected 0, is " << last_msg_->states[13].mesid.sat; - EXPECT_EQ(last_msg_->states[14].cn0, 0) << "incorrect value for states[14].cn0, expected 0, is " << last_msg_->states[14].cn0; - EXPECT_EQ(last_msg_->states[14].mesid.code, 0) << "incorrect value for states[14].mesid.code, expected 0, is " << last_msg_->states[14].mesid.code; - EXPECT_EQ(last_msg_->states[14].mesid.sat, 0) << "incorrect value for states[14].mesid.sat, expected 0, is " << last_msg_->states[14].mesid.sat; - EXPECT_EQ(last_msg_->states[15].cn0, 0) << "incorrect value for states[15].cn0, expected 0, is " << last_msg_->states[15].cn0; - EXPECT_EQ(last_msg_->states[15].mesid.code, 0) << "incorrect value for states[15].mesid.code, expected 0, is " << last_msg_->states[15].mesid.code; - EXPECT_EQ(last_msg_->states[15].mesid.sat, 0) << "incorrect value for states[15].mesid.sat, expected 0, is " << last_msg_->states[15].mesid.sat; - EXPECT_EQ(last_msg_->states[16].cn0, 0) << "incorrect value for states[16].cn0, expected 0, is " << last_msg_->states[16].cn0; - EXPECT_EQ(last_msg_->states[16].mesid.code, 0) << "incorrect value for states[16].mesid.code, expected 0, is " << last_msg_->states[16].mesid.code; - EXPECT_EQ(last_msg_->states[16].mesid.sat, 0) << "incorrect value for states[16].mesid.sat, expected 0, is " << last_msg_->states[16].mesid.sat; - EXPECT_EQ(last_msg_->states[17].cn0, 202) << "incorrect value for states[17].cn0, expected 202, is " << last_msg_->states[17].cn0; - EXPECT_EQ(last_msg_->states[17].mesid.code, 2) << "incorrect value for states[17].mesid.code, expected 2, is " << last_msg_->states[17].mesid.code; - EXPECT_EQ(last_msg_->states[17].mesid.sat, 131) << "incorrect value for states[17].mesid.sat, expected 131, is " << last_msg_->states[17].mesid.sat; - EXPECT_EQ(last_msg_->states[18].cn0, 192) << "incorrect value for states[18].cn0, expected 192, is " << last_msg_->states[18].cn0; - EXPECT_EQ(last_msg_->states[18].mesid.code, 1) << "incorrect value for states[18].mesid.code, expected 1, is " << last_msg_->states[18].mesid.code; - EXPECT_EQ(last_msg_->states[18].mesid.sat, 27) << "incorrect value for states[18].mesid.sat, expected 27, is " << last_msg_->states[18].mesid.sat; - EXPECT_EQ(last_msg_->states[19].cn0, 165) << "incorrect value for states[19].cn0, expected 165, is " << last_msg_->states[19].cn0; - EXPECT_EQ(last_msg_->states[19].mesid.code, 1) << "incorrect value for states[19].mesid.code, expected 1, is " << last_msg_->states[19].mesid.code; - EXPECT_EQ(last_msg_->states[19].mesid.sat, 15) << "incorrect value for states[19].mesid.sat, expected 15, is " << last_msg_->states[19].mesid.sat; - EXPECT_EQ(last_msg_->states[20].cn0, 146) << "incorrect value for states[20].cn0, expected 146, is " << last_msg_->states[20].cn0; - EXPECT_EQ(last_msg_->states[20].mesid.code, 1) << "incorrect value for states[20].mesid.code, expected 1, is " << last_msg_->states[20].mesid.code; - EXPECT_EQ(last_msg_->states[20].mesid.sat, 29) << "incorrect value for states[20].mesid.sat, expected 29, is " << last_msg_->states[20].mesid.sat; - EXPECT_EQ(last_msg_->states[21].cn0, 170) << "incorrect value for states[21].cn0, expected 170, is " << last_msg_->states[21].cn0; - EXPECT_EQ(last_msg_->states[21].mesid.code, 1) << "incorrect value for states[21].mesid.code, expected 1, is " << last_msg_->states[21].mesid.code; - EXPECT_EQ(last_msg_->states[21].mesid.sat, 32) << "incorrect value for states[21].mesid.sat, expected 32, is " << last_msg_->states[21].mesid.sat; - EXPECT_EQ(last_msg_->states[22].cn0, 201) << "incorrect value for states[22].cn0, expected 201, is " << last_msg_->states[22].cn0; - EXPECT_EQ(last_msg_->states[22].mesid.code, 1) << "incorrect value for states[22].mesid.code, expected 1, is " << last_msg_->states[22].mesid.code; - EXPECT_EQ(last_msg_->states[22].mesid.sat, 18) << "incorrect value for states[22].mesid.sat, expected 18, is " << last_msg_->states[22].mesid.sat; - EXPECT_EQ(last_msg_->states[23].cn0, 0) << "incorrect value for states[23].cn0, expected 0, is " << last_msg_->states[23].cn0; - EXPECT_EQ(last_msg_->states[23].mesid.code, 0) << "incorrect value for states[23].mesid.code, expected 0, is " << last_msg_->states[23].mesid.code; - EXPECT_EQ(last_msg_->states[23].mesid.sat, 0) << "incorrect value for states[23].mesid.sat, expected 0, is " << last_msg_->states[23].mesid.sat; - EXPECT_EQ(last_msg_->states[24].cn0, 0) << "incorrect value for states[24].cn0, expected 0, is " << last_msg_->states[24].cn0; - EXPECT_EQ(last_msg_->states[24].mesid.code, 0) << "incorrect value for states[24].mesid.code, expected 0, is " << last_msg_->states[24].mesid.code; - EXPECT_EQ(last_msg_->states[24].mesid.sat, 0) << "incorrect value for states[24].mesid.sat, expected 0, is " << last_msg_->states[24].mesid.sat; - EXPECT_EQ(last_msg_->states[25].cn0, 0) << "incorrect value for states[25].cn0, expected 0, is " << last_msg_->states[25].cn0; - EXPECT_EQ(last_msg_->states[25].mesid.code, 0) << "incorrect value for states[25].mesid.code, expected 0, is " << last_msg_->states[25].mesid.code; - EXPECT_EQ(last_msg_->states[25].mesid.sat, 0) << "incorrect value for states[25].mesid.sat, expected 0, is " << last_msg_->states[25].mesid.sat; - EXPECT_EQ(last_msg_->states[26].cn0, 212) << "incorrect value for states[26].cn0, expected 212, is " << last_msg_->states[26].cn0; - EXPECT_EQ(last_msg_->states[26].mesid.code, 1) << "incorrect value for states[26].mesid.code, expected 1, is " << last_msg_->states[26].mesid.code; - EXPECT_EQ(last_msg_->states[26].mesid.sat, 23) << "incorrect value for states[26].mesid.sat, expected 23, is " << last_msg_->states[26].mesid.sat; - EXPECT_EQ(last_msg_->states[27].cn0, 205) << "incorrect value for states[27].cn0, expected 205, is " << last_msg_->states[27].cn0; - EXPECT_EQ(last_msg_->states[27].mesid.code, 1) << "incorrect value for states[27].mesid.code, expected 1, is " << last_msg_->states[27].mesid.code; - EXPECT_EQ(last_msg_->states[27].mesid.sat, 10) << "incorrect value for states[27].mesid.sat, expected 10, is " << last_msg_->states[27].mesid.sat; - EXPECT_EQ(last_msg_->states[28].cn0, 0) << "incorrect value for states[28].cn0, expected 0, is " << last_msg_->states[28].cn0; - EXPECT_EQ(last_msg_->states[28].mesid.code, 0) << "incorrect value for states[28].mesid.code, expected 0, is " << last_msg_->states[28].mesid.code; - EXPECT_EQ(last_msg_->states[28].mesid.sat, 0) << "incorrect value for states[28].mesid.sat, expected 0, is " << last_msg_->states[28].mesid.sat; - EXPECT_EQ(last_msg_->states[29].cn0, 230) << "incorrect value for states[29].cn0, expected 230, is " << last_msg_->states[29].cn0; - EXPECT_EQ(last_msg_->states[29].mesid.code, 3) << "incorrect value for states[29].mesid.code, expected 3, is " << last_msg_->states[29].mesid.code; - EXPECT_EQ(last_msg_->states[29].mesid.sat, 96) << "incorrect value for states[29].mesid.sat, expected 96, is " << last_msg_->states[29].mesid.sat; - EXPECT_EQ(last_msg_->states[30].cn0, 0) << "incorrect value for states[30].cn0, expected 0, is " << last_msg_->states[30].cn0; - EXPECT_EQ(last_msg_->states[30].mesid.code, 0) << "incorrect value for states[30].mesid.code, expected 0, is " << last_msg_->states[30].mesid.code; - EXPECT_EQ(last_msg_->states[30].mesid.sat, 0) << "incorrect value for states[30].mesid.sat, expected 0, is " << last_msg_->states[30].mesid.sat; - EXPECT_EQ(last_msg_->states[31].cn0, 214) << "incorrect value for states[31].cn0, expected 214, is " << last_msg_->states[31].cn0; - EXPECT_EQ(last_msg_->states[31].mesid.code, 3) << "incorrect value for states[31].mesid.code, expected 3, is " << last_msg_->states[31].mesid.code; - EXPECT_EQ(last_msg_->states[31].mesid.sat, 101) << "incorrect value for states[31].mesid.sat, expected 101, is " << last_msg_->states[31].mesid.sat; - EXPECT_EQ(last_msg_->states[32].cn0, 212) << "incorrect value for states[32].cn0, expected 212, is " << last_msg_->states[32].cn0; - EXPECT_EQ(last_msg_->states[32].mesid.code, 3) << "incorrect value for states[32].mesid.code, expected 3, is " << last_msg_->states[32].mesid.code; - EXPECT_EQ(last_msg_->states[32].mesid.sat, 103) << "incorrect value for states[32].mesid.sat, expected 103, is " << last_msg_->states[32].mesid.sat; - EXPECT_EQ(last_msg_->states[33].cn0, 209) << "incorrect value for states[33].cn0, expected 209, is " << last_msg_->states[33].cn0; - EXPECT_EQ(last_msg_->states[33].mesid.code, 3) << "incorrect value for states[33].mesid.code, expected 3, is " << last_msg_->states[33].mesid.code; - EXPECT_EQ(last_msg_->states[33].mesid.sat, 104) << "incorrect value for states[33].mesid.sat, expected 104, is " << last_msg_->states[33].mesid.sat; - EXPECT_EQ(last_msg_->states[34].cn0, 157) << "incorrect value for states[34].cn0, expected 157, is " << last_msg_->states[34].cn0; - EXPECT_EQ(last_msg_->states[34].mesid.code, 3) << "incorrect value for states[34].mesid.code, expected 3, is " << last_msg_->states[34].mesid.code; - EXPECT_EQ(last_msg_->states[34].mesid.sat, 106) << "incorrect value for states[34].mesid.sat, expected 106, is " << last_msg_->states[34].mesid.sat; - EXPECT_EQ(last_msg_->states[35].cn0, 230) << "incorrect value for states[35].cn0, expected 230, is " << last_msg_->states[35].cn0; - EXPECT_EQ(last_msg_->states[35].mesid.code, 3) << "incorrect value for states[35].mesid.code, expected 3, is " << last_msg_->states[35].mesid.code; - EXPECT_EQ(last_msg_->states[35].mesid.sat, 102) << "incorrect value for states[35].mesid.sat, expected 102, is " << last_msg_->states[35].mesid.sat; - EXPECT_EQ(last_msg_->states[36].cn0, 0) << "incorrect value for states[36].cn0, expected 0, is " << last_msg_->states[36].cn0; - EXPECT_EQ(last_msg_->states[36].mesid.code, 0) << "incorrect value for states[36].mesid.code, expected 0, is " << last_msg_->states[36].mesid.code; - EXPECT_EQ(last_msg_->states[36].mesid.sat, 0) << "incorrect value for states[36].mesid.sat, expected 0, is " << last_msg_->states[36].mesid.sat; - EXPECT_EQ(last_msg_->states[37].cn0, 0) << "incorrect value for states[37].cn0, expected 0, is " << last_msg_->states[37].cn0; - EXPECT_EQ(last_msg_->states[37].mesid.code, 0) << "incorrect value for states[37].mesid.code, expected 0, is " << last_msg_->states[37].mesid.code; - EXPECT_EQ(last_msg_->states[37].mesid.sat, 0) << "incorrect value for states[37].mesid.sat, expected 0, is " << last_msg_->states[37].mesid.sat; - EXPECT_EQ(last_msg_->states[38].cn0, 189) << "incorrect value for states[38].cn0, expected 189, is " << last_msg_->states[38].cn0; - EXPECT_EQ(last_msg_->states[38].mesid.code, 4) << "incorrect value for states[38].mesid.code, expected 4, is " << last_msg_->states[38].mesid.code; - EXPECT_EQ(last_msg_->states[38].mesid.sat, 101) << "incorrect value for states[38].mesid.sat, expected 101, is " << last_msg_->states[38].mesid.sat; - EXPECT_EQ(last_msg_->states[39].cn0, 207) << "incorrect value for states[39].cn0, expected 207, is " << last_msg_->states[39].cn0; - EXPECT_EQ(last_msg_->states[39].mesid.code, 4) << "incorrect value for states[39].mesid.code, expected 4, is " << last_msg_->states[39].mesid.code; - EXPECT_EQ(last_msg_->states[39].mesid.sat, 96) << "incorrect value for states[39].mesid.sat, expected 96, is " << last_msg_->states[39].mesid.sat; - EXPECT_EQ(last_msg_->states[40].cn0, 164) << "incorrect value for states[40].cn0, expected 164, is " << last_msg_->states[40].cn0; - EXPECT_EQ(last_msg_->states[40].mesid.code, 4) << "incorrect value for states[40].mesid.code, expected 4, is " << last_msg_->states[40].mesid.code; - EXPECT_EQ(last_msg_->states[40].mesid.sat, 106) << "incorrect value for states[40].mesid.sat, expected 106, is " << last_msg_->states[40].mesid.sat; - EXPECT_EQ(last_msg_->states[41].cn0, 193) << "incorrect value for states[41].cn0, expected 193, is " << last_msg_->states[41].cn0; - EXPECT_EQ(last_msg_->states[41].mesid.code, 4) << "incorrect value for states[41].mesid.code, expected 4, is " << last_msg_->states[41].mesid.code; - EXPECT_EQ(last_msg_->states[41].mesid.sat, 104) << "incorrect value for states[41].mesid.sat, expected 104, is " << last_msg_->states[41].mesid.sat; - EXPECT_EQ(last_msg_->states[42].cn0, 0) << "incorrect value for states[42].cn0, expected 0, is " << last_msg_->states[42].cn0; - EXPECT_EQ(last_msg_->states[42].mesid.code, 0) << "incorrect value for states[42].mesid.code, expected 0, is " << last_msg_->states[42].mesid.code; - EXPECT_EQ(last_msg_->states[42].mesid.sat, 0) << "incorrect value for states[42].mesid.sat, expected 0, is " << last_msg_->states[42].mesid.sat; - EXPECT_EQ(last_msg_->states[43].cn0, 208) << "incorrect value for states[43].cn0, expected 208, is " << last_msg_->states[43].cn0; - EXPECT_EQ(last_msg_->states[43].mesid.code, 4) << "incorrect value for states[43].mesid.code, expected 4, is " << last_msg_->states[43].mesid.code; - EXPECT_EQ(last_msg_->states[43].mesid.sat, 102) << "incorrect value for states[43].mesid.sat, expected 102, is " << last_msg_->states[43].mesid.sat; - EXPECT_EQ(last_msg_->states[44].cn0, 0) << "incorrect value for states[44].cn0, expected 0, is " << last_msg_->states[44].cn0; - EXPECT_EQ(last_msg_->states[44].mesid.code, 0) << "incorrect value for states[44].mesid.code, expected 0, is " << last_msg_->states[44].mesid.code; - EXPECT_EQ(last_msg_->states[44].mesid.sat, 0) << "incorrect value for states[44].mesid.sat, expected 0, is " << last_msg_->states[44].mesid.sat; - EXPECT_EQ(last_msg_->states[45].cn0, 212) << "incorrect value for states[45].cn0, expected 212, is " << last_msg_->states[45].cn0; - EXPECT_EQ(last_msg_->states[45].mesid.code, 12) << "incorrect value for states[45].mesid.code, expected 12, is " << last_msg_->states[45].mesid.code; - EXPECT_EQ(last_msg_->states[45].mesid.sat, 27) << "incorrect value for states[45].mesid.sat, expected 27, is " << last_msg_->states[45].mesid.sat; - EXPECT_EQ(last_msg_->states[46].cn0, 161) << "incorrect value for states[46].cn0, expected 161, is " << last_msg_->states[46].cn0; - EXPECT_EQ(last_msg_->states[46].mesid.code, 12) << "incorrect value for states[46].mesid.code, expected 12, is " << last_msg_->states[46].mesid.code; - EXPECT_EQ(last_msg_->states[46].mesid.sat, 29) << "incorrect value for states[46].mesid.sat, expected 29, is " << last_msg_->states[46].mesid.sat; - EXPECT_EQ(last_msg_->states[47].cn0, 216) << "incorrect value for states[47].cn0, expected 216, is " << last_msg_->states[47].cn0; - EXPECT_EQ(last_msg_->states[47].mesid.code, 12) << "incorrect value for states[47].mesid.code, expected 12, is " << last_msg_->states[47].mesid.code; - EXPECT_EQ(last_msg_->states[47].mesid.sat, 32) << "incorrect value for states[47].mesid.sat, expected 32, is " << last_msg_->states[47].mesid.sat; - EXPECT_EQ(last_msg_->states[48].cn0, 216) << "incorrect value for states[48].cn0, expected 216, is " << last_msg_->states[48].cn0; - EXPECT_EQ(last_msg_->states[48].mesid.code, 12) << "incorrect value for states[48].mesid.code, expected 12, is " << last_msg_->states[48].mesid.code; - EXPECT_EQ(last_msg_->states[48].mesid.sat, 30) << "incorrect value for states[48].mesid.sat, expected 30, is " << last_msg_->states[48].mesid.sat; - EXPECT_EQ(last_msg_->states[49].cn0, 178) << "incorrect value for states[49].cn0, expected 178, is " << last_msg_->states[49].cn0; - EXPECT_EQ(last_msg_->states[49].mesid.code, 12) << "incorrect value for states[49].mesid.code, expected 12, is " << last_msg_->states[49].mesid.code; - EXPECT_EQ(last_msg_->states[49].mesid.sat, 20) << "incorrect value for states[49].mesid.sat, expected 20, is " << last_msg_->states[49].mesid.sat; - EXPECT_EQ(last_msg_->states[50].cn0, 0) << "incorrect value for states[50].cn0, expected 0, is " << last_msg_->states[50].cn0; - EXPECT_EQ(last_msg_->states[50].mesid.code, 0) << "incorrect value for states[50].mesid.code, expected 0, is " << last_msg_->states[50].mesid.code; - EXPECT_EQ(last_msg_->states[50].mesid.sat, 0) << "incorrect value for states[50].mesid.sat, expected 0, is " << last_msg_->states[50].mesid.sat; - EXPECT_EQ(last_msg_->states[51].cn0, 0) << "incorrect value for states[51].cn0, expected 0, is " << last_msg_->states[51].cn0; - EXPECT_EQ(last_msg_->states[51].mesid.code, 0) << "incorrect value for states[51].mesid.code, expected 0, is " << last_msg_->states[51].mesid.code; - EXPECT_EQ(last_msg_->states[51].mesid.sat, 0) << "incorrect value for states[51].mesid.sat, expected 0, is " << last_msg_->states[51].mesid.sat; - EXPECT_EQ(last_msg_->states[52].cn0, 0) << "incorrect value for states[52].cn0, expected 0, is " << last_msg_->states[52].cn0; - EXPECT_EQ(last_msg_->states[52].mesid.code, 0) << "incorrect value for states[52].mesid.code, expected 0, is " << last_msg_->states[52].mesid.code; - EXPECT_EQ(last_msg_->states[52].mesid.sat, 0) << "incorrect value for states[52].mesid.sat, expected 0, is " << last_msg_->states[52].mesid.sat; - EXPECT_EQ(last_msg_->states[53].cn0, 0) << "incorrect value for states[53].cn0, expected 0, is " << last_msg_->states[53].cn0; - EXPECT_EQ(last_msg_->states[53].mesid.code, 0) << "incorrect value for states[53].mesid.code, expected 0, is " << last_msg_->states[53].mesid.code; - EXPECT_EQ(last_msg_->states[53].mesid.sat, 0) << "incorrect value for states[53].mesid.sat, expected 0, is " << last_msg_->states[53].mesid.sat; - EXPECT_EQ(last_msg_->states[54].cn0, 0) << "incorrect value for states[54].cn0, expected 0, is " << last_msg_->states[54].cn0; - EXPECT_EQ(last_msg_->states[54].mesid.code, 0) << "incorrect value for states[54].mesid.code, expected 0, is " << last_msg_->states[54].mesid.code; - EXPECT_EQ(last_msg_->states[54].mesid.sat, 0) << "incorrect value for states[54].mesid.sat, expected 0, is " << last_msg_->states[54].mesid.sat; - EXPECT_EQ(last_msg_->states[55].cn0, 0) << "incorrect value for states[55].cn0, expected 0, is " << last_msg_->states[55].cn0; - EXPECT_EQ(last_msg_->states[55].mesid.code, 0) << "incorrect value for states[55].mesid.code, expected 0, is " << last_msg_->states[55].mesid.code; - EXPECT_EQ(last_msg_->states[55].mesid.sat, 0) << "incorrect value for states[55].mesid.sat, expected 0, is " << last_msg_->states[55].mesid.sat; - EXPECT_EQ(last_msg_->states[56].cn0, 0) << "incorrect value for states[56].cn0, expected 0, is " << last_msg_->states[56].cn0; - EXPECT_EQ(last_msg_->states[56].mesid.code, 0) << "incorrect value for states[56].mesid.code, expected 0, is " << last_msg_->states[56].mesid.code; - EXPECT_EQ(last_msg_->states[56].mesid.sat, 0) << "incorrect value for states[56].mesid.sat, expected 0, is " << last_msg_->states[56].mesid.sat; - EXPECT_EQ(last_msg_->states[57].cn0, 0) << "incorrect value for states[57].cn0, expected 0, is " << last_msg_->states[57].cn0; - EXPECT_EQ(last_msg_->states[57].mesid.code, 0) << "incorrect value for states[57].mesid.code, expected 0, is " << last_msg_->states[57].mesid.code; - EXPECT_EQ(last_msg_->states[57].mesid.sat, 0) << "incorrect value for states[57].mesid.sat, expected 0, is " << last_msg_->states[57].mesid.sat; - EXPECT_EQ(last_msg_->states[58].cn0, 0) << "incorrect value for states[58].cn0, expected 0, is " << last_msg_->states[58].cn0; - EXPECT_EQ(last_msg_->states[58].mesid.code, 0) << "incorrect value for states[58].mesid.code, expected 0, is " << last_msg_->states[58].mesid.code; - EXPECT_EQ(last_msg_->states[58].mesid.sat, 0) << "incorrect value for states[58].mesid.sat, expected 0, is " << last_msg_->states[58].mesid.sat; - EXPECT_EQ(last_msg_->states[59].cn0, 0) << "incorrect value for states[59].cn0, expected 0, is " << last_msg_->states[59].cn0; - EXPECT_EQ(last_msg_->states[59].mesid.code, 0) << "incorrect value for states[59].mesid.code, expected 0, is " << last_msg_->states[59].mesid.code; - EXPECT_EQ(last_msg_->states[59].mesid.sat, 0) << "incorrect value for states[59].mesid.sat, expected 0, is " << last_msg_->states[59].mesid.sat; - EXPECT_EQ(last_msg_->states[60].cn0, 0) << "incorrect value for states[60].cn0, expected 0, is " << last_msg_->states[60].cn0; - EXPECT_EQ(last_msg_->states[60].mesid.code, 0) << "incorrect value for states[60].mesid.code, expected 0, is " << last_msg_->states[60].mesid.code; - EXPECT_EQ(last_msg_->states[60].mesid.sat, 0) << "incorrect value for states[60].mesid.sat, expected 0, is " << last_msg_->states[60].mesid.sat; - EXPECT_EQ(last_msg_->states[61].cn0, 0) << "incorrect value for states[61].cn0, expected 0, is " << last_msg_->states[61].cn0; - EXPECT_EQ(last_msg_->states[61].mesid.code, 0) << "incorrect value for states[61].mesid.code, expected 0, is " << last_msg_->states[61].mesid.code; - EXPECT_EQ(last_msg_->states[61].mesid.sat, 0) << "incorrect value for states[61].mesid.sat, expected 0, is " << last_msg_->states[61].mesid.sat; - EXPECT_EQ(last_msg_->states[62].cn0, 0) << "incorrect value for states[62].cn0, expected 0, is " << last_msg_->states[62].cn0; - EXPECT_EQ(last_msg_->states[62].mesid.code, 0) << "incorrect value for states[62].mesid.code, expected 0, is " << last_msg_->states[62].mesid.code; - EXPECT_EQ(last_msg_->states[62].mesid.sat, 0) << "incorrect value for states[62].mesid.sat, expected 0, is " << last_msg_->states[62].mesid.sat; - EXPECT_EQ(last_msg_->states[63].cn0, 203) << "incorrect value for states[63].cn0, expected 203, is " << last_msg_->states[63].cn0; - EXPECT_EQ(last_msg_->states[63].mesid.code, 14) << "incorrect value for states[63].mesid.code, expected 14, is " << last_msg_->states[63].mesid.code; - EXPECT_EQ(last_msg_->states[63].mesid.sat, 36) << "incorrect value for states[63].mesid.sat, expected 36, is " << last_msg_->states[63].mesid.sat; - EXPECT_EQ(last_msg_->states[64].cn0, 0) << "incorrect value for states[64].cn0, expected 0, is " << last_msg_->states[64].cn0; - EXPECT_EQ(last_msg_->states[64].mesid.code, 0) << "incorrect value for states[64].mesid.code, expected 0, is " << last_msg_->states[64].mesid.code; - EXPECT_EQ(last_msg_->states[64].mesid.sat, 0) << "incorrect value for states[64].mesid.sat, expected 0, is " << last_msg_->states[64].mesid.sat; - EXPECT_EQ(last_msg_->states[65].cn0, 158) << "incorrect value for states[65].cn0, expected 158, is " << last_msg_->states[65].cn0; - EXPECT_EQ(last_msg_->states[65].mesid.code, 14) << "incorrect value for states[65].mesid.code, expected 14, is " << last_msg_->states[65].mesid.code; - EXPECT_EQ(last_msg_->states[65].mesid.sat, 5) << "incorrect value for states[65].mesid.sat, expected 5, is " << last_msg_->states[65].mesid.sat; - EXPECT_EQ(last_msg_->states[66].cn0, 194) << "incorrect value for states[66].cn0, expected 194, is " << last_msg_->states[66].cn0; - EXPECT_EQ(last_msg_->states[66].mesid.code, 14) << "incorrect value for states[66].mesid.code, expected 14, is " << last_msg_->states[66].mesid.code; - EXPECT_EQ(last_msg_->states[66].mesid.sat, 4) << "incorrect value for states[66].mesid.sat, expected 4, is " << last_msg_->states[66].mesid.sat; - EXPECT_EQ(last_msg_->states[67].cn0, 192) << "incorrect value for states[67].cn0, expected 192, is " << last_msg_->states[67].cn0; - EXPECT_EQ(last_msg_->states[67].mesid.code, 14) << "incorrect value for states[67].mesid.code, expected 14, is " << last_msg_->states[67].mesid.code; - EXPECT_EQ(last_msg_->states[67].mesid.sat, 11) << "incorrect value for states[67].mesid.sat, expected 11, is " << last_msg_->states[67].mesid.sat; - EXPECT_EQ(last_msg_->states[68].cn0, 207) << "incorrect value for states[68].cn0, expected 207, is " << last_msg_->states[68].cn0; - EXPECT_EQ(last_msg_->states[68].mesid.code, 14) << "incorrect value for states[68].mesid.code, expected 14, is " << last_msg_->states[68].mesid.code; - EXPECT_EQ(last_msg_->states[68].mesid.sat, 9) << "incorrect value for states[68].mesid.sat, expected 9, is " << last_msg_->states[68].mesid.sat; - EXPECT_EQ(last_msg_->states[69].cn0, 0) << "incorrect value for states[69].cn0, expected 0, is " << last_msg_->states[69].cn0; - EXPECT_EQ(last_msg_->states[69].mesid.code, 0) << "incorrect value for states[69].mesid.code, expected 0, is " << last_msg_->states[69].mesid.code; - EXPECT_EQ(last_msg_->states[69].mesid.sat, 0) << "incorrect value for states[69].mesid.sat, expected 0, is " << last_msg_->states[69].mesid.sat; - EXPECT_EQ(last_msg_->states[70].cn0, 0) << "incorrect value for states[70].cn0, expected 0, is " << last_msg_->states[70].cn0; - EXPECT_EQ(last_msg_->states[70].mesid.code, 0) << "incorrect value for states[70].mesid.code, expected 0, is " << last_msg_->states[70].mesid.code; - EXPECT_EQ(last_msg_->states[70].mesid.sat, 0) << "incorrect value for states[70].mesid.sat, expected 0, is " << last_msg_->states[70].mesid.sat; - EXPECT_EQ(last_msg_->states[71].cn0, 0) << "incorrect value for states[71].cn0, expected 0, is " << last_msg_->states[71].cn0; - EXPECT_EQ(last_msg_->states[71].mesid.code, 0) << "incorrect value for states[71].mesid.code, expected 0, is " << last_msg_->states[71].mesid.code; - EXPECT_EQ(last_msg_->states[71].mesid.sat, 0) << "incorrect value for states[71].mesid.sat, expected 0, is " << last_msg_->states[71].mesid.sat; - EXPECT_EQ(last_msg_->states[72].cn0, 218) << "incorrect value for states[72].cn0, expected 218, is " << last_msg_->states[72].cn0; - EXPECT_EQ(last_msg_->states[72].mesid.code, 20) << "incorrect value for states[72].mesid.code, expected 20, is " << last_msg_->states[72].mesid.code; - EXPECT_EQ(last_msg_->states[72].mesid.sat, 9) << "incorrect value for states[72].mesid.sat, expected 9, is " << last_msg_->states[72].mesid.sat; - EXPECT_EQ(last_msg_->states[73].cn0, 176) << "incorrect value for states[73].cn0, expected 176, is " << last_msg_->states[73].cn0; - EXPECT_EQ(last_msg_->states[73].mesid.code, 20) << "incorrect value for states[73].mesid.code, expected 20, is " << last_msg_->states[73].mesid.code; - EXPECT_EQ(last_msg_->states[73].mesid.sat, 5) << "incorrect value for states[73].mesid.sat, expected 5, is " << last_msg_->states[73].mesid.sat; - EXPECT_EQ(last_msg_->states[74].cn0, 217) << "incorrect value for states[74].cn0, expected 217, is " << last_msg_->states[74].cn0; - EXPECT_EQ(last_msg_->states[74].mesid.code, 20) << "incorrect value for states[74].mesid.code, expected 20, is " << last_msg_->states[74].mesid.code; - EXPECT_EQ(last_msg_->states[74].mesid.sat, 36) << "incorrect value for states[74].mesid.sat, expected 36, is " << last_msg_->states[74].mesid.sat; - EXPECT_EQ(last_msg_->states[75].cn0, 200) << "incorrect value for states[75].cn0, expected 200, is " << last_msg_->states[75].cn0; - EXPECT_EQ(last_msg_->states[75].mesid.code, 20) << "incorrect value for states[75].mesid.code, expected 20, is " << last_msg_->states[75].mesid.code; - EXPECT_EQ(last_msg_->states[75].mesid.sat, 11) << "incorrect value for states[75].mesid.sat, expected 11, is " << last_msg_->states[75].mesid.sat; - EXPECT_EQ(last_msg_->states[76].cn0, 205) << "incorrect value for states[76].cn0, expected 205, is " << last_msg_->states[76].cn0; - EXPECT_EQ(last_msg_->states[76].mesid.code, 20) << "incorrect value for states[76].mesid.code, expected 20, is " << last_msg_->states[76].mesid.code; - EXPECT_EQ(last_msg_->states[76].mesid.sat, 4) << "incorrect value for states[76].mesid.sat, expected 4, is " << last_msg_->states[76].mesid.sat; - EXPECT_EQ(last_msg_->states[77].cn0, 0) << "incorrect value for states[77].cn0, expected 0, is " << last_msg_->states[77].cn0; - EXPECT_EQ(last_msg_->states[77].mesid.code, 0) << "incorrect value for states[77].mesid.code, expected 0, is " << last_msg_->states[77].mesid.code; - EXPECT_EQ(last_msg_->states[77].mesid.sat, 0) << "incorrect value for states[77].mesid.sat, expected 0, is " << last_msg_->states[77].mesid.sat; - EXPECT_EQ(last_msg_->states[78].cn0, 0) << "incorrect value for states[78].cn0, expected 0, is " << last_msg_->states[78].cn0; - EXPECT_EQ(last_msg_->states[78].mesid.code, 0) << "incorrect value for states[78].mesid.code, expected 0, is " << last_msg_->states[78].mesid.code; - EXPECT_EQ(last_msg_->states[78].mesid.sat, 0) << "incorrect value for states[78].mesid.sat, expected 0, is " << last_msg_->states[78].mesid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 31183); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->states[0].cn0, 162) + << "incorrect value for states[0].cn0, expected 162, is " + << last_msg_->states[0].cn0; + EXPECT_EQ(last_msg_->states[0].mesid.code, 0) + << "incorrect value for states[0].mesid.code, expected 0, is " + << last_msg_->states[0].mesid.code; + EXPECT_EQ(last_msg_->states[0].mesid.sat, 29) + << "incorrect value for states[0].mesid.sat, expected 29, is " + << last_msg_->states[0].mesid.sat; + EXPECT_EQ(last_msg_->states[1].cn0, 0) + << "incorrect value for states[1].cn0, expected 0, is " + << last_msg_->states[1].cn0; + EXPECT_EQ(last_msg_->states[1].mesid.code, 0) + << "incorrect value for states[1].mesid.code, expected 0, is " + << last_msg_->states[1].mesid.code; + EXPECT_EQ(last_msg_->states[1].mesid.sat, 0) + << "incorrect value for states[1].mesid.sat, expected 0, is " + << last_msg_->states[1].mesid.sat; + EXPECT_EQ(last_msg_->states[2].cn0, 0) + << "incorrect value for states[2].cn0, expected 0, is " + << last_msg_->states[2].cn0; + EXPECT_EQ(last_msg_->states[2].mesid.code, 0) + << "incorrect value for states[2].mesid.code, expected 0, is " + << last_msg_->states[2].mesid.code; + EXPECT_EQ(last_msg_->states[2].mesid.sat, 0) + << "incorrect value for states[2].mesid.sat, expected 0, is " + << last_msg_->states[2].mesid.sat; + EXPECT_EQ(last_msg_->states[3].cn0, 201) + << "incorrect value for states[3].cn0, expected 201, is " + << last_msg_->states[3].cn0; + EXPECT_EQ(last_msg_->states[3].mesid.code, 0) + << "incorrect value for states[3].mesid.code, expected 0, is " + << last_msg_->states[3].mesid.code; + EXPECT_EQ(last_msg_->states[3].mesid.sat, 27) + << "incorrect value for states[3].mesid.sat, expected 27, is " + << last_msg_->states[3].mesid.sat; + EXPECT_EQ(last_msg_->states[4].cn0, 168) + << "incorrect value for states[4].cn0, expected 168, is " + << last_msg_->states[4].cn0; + EXPECT_EQ(last_msg_->states[4].mesid.code, 0) + << "incorrect value for states[4].mesid.code, expected 0, is " + << last_msg_->states[4].mesid.code; + EXPECT_EQ(last_msg_->states[4].mesid.sat, 20) + << "incorrect value for states[4].mesid.sat, expected 20, is " + << last_msg_->states[4].mesid.sat; + EXPECT_EQ(last_msg_->states[5].cn0, 184) + << "incorrect value for states[5].cn0, expected 184, is " + << last_msg_->states[5].cn0; + EXPECT_EQ(last_msg_->states[5].mesid.code, 0) + << "incorrect value for states[5].mesid.code, expected 0, is " + << last_msg_->states[5].mesid.code; + EXPECT_EQ(last_msg_->states[5].mesid.sat, 32) + << "incorrect value for states[5].mesid.sat, expected 32, is " + << last_msg_->states[5].mesid.sat; + EXPECT_EQ(last_msg_->states[6].cn0, 187) + << "incorrect value for states[6].cn0, expected 187, is " + << last_msg_->states[6].cn0; + EXPECT_EQ(last_msg_->states[6].mesid.code, 0) + << "incorrect value for states[6].mesid.code, expected 0, is " + << last_msg_->states[6].mesid.code; + EXPECT_EQ(last_msg_->states[6].mesid.sat, 15) + << "incorrect value for states[6].mesid.sat, expected 15, is " + << last_msg_->states[6].mesid.sat; + EXPECT_EQ(last_msg_->states[7].cn0, 0) + << "incorrect value for states[7].cn0, expected 0, is " + << last_msg_->states[7].cn0; + EXPECT_EQ(last_msg_->states[7].mesid.code, 0) + << "incorrect value for states[7].mesid.code, expected 0, is " + << last_msg_->states[7].mesid.code; + EXPECT_EQ(last_msg_->states[7].mesid.sat, 0) + << "incorrect value for states[7].mesid.sat, expected 0, is " + << last_msg_->states[7].mesid.sat; + EXPECT_EQ(last_msg_->states[8].cn0, 210) + << "incorrect value for states[8].cn0, expected 210, is " + << last_msg_->states[8].cn0; + EXPECT_EQ(last_msg_->states[8].mesid.code, 0) + << "incorrect value for states[8].mesid.code, expected 0, is " + << last_msg_->states[8].mesid.code; + EXPECT_EQ(last_msg_->states[8].mesid.sat, 18) + << "incorrect value for states[8].mesid.sat, expected 18, is " + << last_msg_->states[8].mesid.sat; + EXPECT_EQ(last_msg_->states[9].cn0, 167) + << "incorrect value for states[9].cn0, expected 167, is " + << last_msg_->states[9].cn0; + EXPECT_EQ(last_msg_->states[9].mesid.code, 0) + << "incorrect value for states[9].mesid.code, expected 0, is " + << last_msg_->states[9].mesid.code; + EXPECT_EQ(last_msg_->states[9].mesid.sat, 16) + << "incorrect value for states[9].mesid.sat, expected 16, is " + << last_msg_->states[9].mesid.sat; + EXPECT_EQ(last_msg_->states[10].cn0, 0) + << "incorrect value for states[10].cn0, expected 0, is " + << last_msg_->states[10].cn0; + EXPECT_EQ(last_msg_->states[10].mesid.code, 0) + << "incorrect value for states[10].mesid.code, expected 0, is " + << last_msg_->states[10].mesid.code; + EXPECT_EQ(last_msg_->states[10].mesid.sat, 0) + << "incorrect value for states[10].mesid.sat, expected 0, is " + << last_msg_->states[10].mesid.sat; + EXPECT_EQ(last_msg_->states[11].cn0, 213) + << "incorrect value for states[11].cn0, expected 213, is " + << last_msg_->states[11].cn0; + EXPECT_EQ(last_msg_->states[11].mesid.code, 0) + << "incorrect value for states[11].mesid.code, expected 0, is " + << last_msg_->states[11].mesid.code; + EXPECT_EQ(last_msg_->states[11].mesid.sat, 23) + << "incorrect value for states[11].mesid.sat, expected 23, is " + << last_msg_->states[11].mesid.sat; + EXPECT_EQ(last_msg_->states[12].cn0, 223) + << "incorrect value for states[12].cn0, expected 223, is " + << last_msg_->states[12].cn0; + EXPECT_EQ(last_msg_->states[12].mesid.code, 0) + << "incorrect value for states[12].mesid.code, expected 0, is " + << last_msg_->states[12].mesid.code; + EXPECT_EQ(last_msg_->states[12].mesid.sat, 10) + << "incorrect value for states[12].mesid.sat, expected 10, is " + << last_msg_->states[12].mesid.sat; + EXPECT_EQ(last_msg_->states[13].cn0, 0) + << "incorrect value for states[13].cn0, expected 0, is " + << last_msg_->states[13].cn0; + EXPECT_EQ(last_msg_->states[13].mesid.code, 0) + << "incorrect value for states[13].mesid.code, expected 0, is " + << last_msg_->states[13].mesid.code; + EXPECT_EQ(last_msg_->states[13].mesid.sat, 0) + << "incorrect value for states[13].mesid.sat, expected 0, is " + << last_msg_->states[13].mesid.sat; + EXPECT_EQ(last_msg_->states[14].cn0, 0) + << "incorrect value for states[14].cn0, expected 0, is " + << last_msg_->states[14].cn0; + EXPECT_EQ(last_msg_->states[14].mesid.code, 0) + << "incorrect value for states[14].mesid.code, expected 0, is " + << last_msg_->states[14].mesid.code; + EXPECT_EQ(last_msg_->states[14].mesid.sat, 0) + << "incorrect value for states[14].mesid.sat, expected 0, is " + << last_msg_->states[14].mesid.sat; + EXPECT_EQ(last_msg_->states[15].cn0, 0) + << "incorrect value for states[15].cn0, expected 0, is " + << last_msg_->states[15].cn0; + EXPECT_EQ(last_msg_->states[15].mesid.code, 0) + << "incorrect value for states[15].mesid.code, expected 0, is " + << last_msg_->states[15].mesid.code; + EXPECT_EQ(last_msg_->states[15].mesid.sat, 0) + << "incorrect value for states[15].mesid.sat, expected 0, is " + << last_msg_->states[15].mesid.sat; + EXPECT_EQ(last_msg_->states[16].cn0, 0) + << "incorrect value for states[16].cn0, expected 0, is " + << last_msg_->states[16].cn0; + EXPECT_EQ(last_msg_->states[16].mesid.code, 0) + << "incorrect value for states[16].mesid.code, expected 0, is " + << last_msg_->states[16].mesid.code; + EXPECT_EQ(last_msg_->states[16].mesid.sat, 0) + << "incorrect value for states[16].mesid.sat, expected 0, is " + << last_msg_->states[16].mesid.sat; + EXPECT_EQ(last_msg_->states[17].cn0, 202) + << "incorrect value for states[17].cn0, expected 202, is " + << last_msg_->states[17].cn0; + EXPECT_EQ(last_msg_->states[17].mesid.code, 2) + << "incorrect value for states[17].mesid.code, expected 2, is " + << last_msg_->states[17].mesid.code; + EXPECT_EQ(last_msg_->states[17].mesid.sat, 131) + << "incorrect value for states[17].mesid.sat, expected 131, is " + << last_msg_->states[17].mesid.sat; + EXPECT_EQ(last_msg_->states[18].cn0, 192) + << "incorrect value for states[18].cn0, expected 192, is " + << last_msg_->states[18].cn0; + EXPECT_EQ(last_msg_->states[18].mesid.code, 1) + << "incorrect value for states[18].mesid.code, expected 1, is " + << last_msg_->states[18].mesid.code; + EXPECT_EQ(last_msg_->states[18].mesid.sat, 27) + << "incorrect value for states[18].mesid.sat, expected 27, is " + << last_msg_->states[18].mesid.sat; + EXPECT_EQ(last_msg_->states[19].cn0, 165) + << "incorrect value for states[19].cn0, expected 165, is " + << last_msg_->states[19].cn0; + EXPECT_EQ(last_msg_->states[19].mesid.code, 1) + << "incorrect value for states[19].mesid.code, expected 1, is " + << last_msg_->states[19].mesid.code; + EXPECT_EQ(last_msg_->states[19].mesid.sat, 15) + << "incorrect value for states[19].mesid.sat, expected 15, is " + << last_msg_->states[19].mesid.sat; + EXPECT_EQ(last_msg_->states[20].cn0, 146) + << "incorrect value for states[20].cn0, expected 146, is " + << last_msg_->states[20].cn0; + EXPECT_EQ(last_msg_->states[20].mesid.code, 1) + << "incorrect value for states[20].mesid.code, expected 1, is " + << last_msg_->states[20].mesid.code; + EXPECT_EQ(last_msg_->states[20].mesid.sat, 29) + << "incorrect value for states[20].mesid.sat, expected 29, is " + << last_msg_->states[20].mesid.sat; + EXPECT_EQ(last_msg_->states[21].cn0, 170) + << "incorrect value for states[21].cn0, expected 170, is " + << last_msg_->states[21].cn0; + EXPECT_EQ(last_msg_->states[21].mesid.code, 1) + << "incorrect value for states[21].mesid.code, expected 1, is " + << last_msg_->states[21].mesid.code; + EXPECT_EQ(last_msg_->states[21].mesid.sat, 32) + << "incorrect value for states[21].mesid.sat, expected 32, is " + << last_msg_->states[21].mesid.sat; + EXPECT_EQ(last_msg_->states[22].cn0, 201) + << "incorrect value for states[22].cn0, expected 201, is " + << last_msg_->states[22].cn0; + EXPECT_EQ(last_msg_->states[22].mesid.code, 1) + << "incorrect value for states[22].mesid.code, expected 1, is " + << last_msg_->states[22].mesid.code; + EXPECT_EQ(last_msg_->states[22].mesid.sat, 18) + << "incorrect value for states[22].mesid.sat, expected 18, is " + << last_msg_->states[22].mesid.sat; + EXPECT_EQ(last_msg_->states[23].cn0, 0) + << "incorrect value for states[23].cn0, expected 0, is " + << last_msg_->states[23].cn0; + EXPECT_EQ(last_msg_->states[23].mesid.code, 0) + << "incorrect value for states[23].mesid.code, expected 0, is " + << last_msg_->states[23].mesid.code; + EXPECT_EQ(last_msg_->states[23].mesid.sat, 0) + << "incorrect value for states[23].mesid.sat, expected 0, is " + << last_msg_->states[23].mesid.sat; + EXPECT_EQ(last_msg_->states[24].cn0, 0) + << "incorrect value for states[24].cn0, expected 0, is " + << last_msg_->states[24].cn0; + EXPECT_EQ(last_msg_->states[24].mesid.code, 0) + << "incorrect value for states[24].mesid.code, expected 0, is " + << last_msg_->states[24].mesid.code; + EXPECT_EQ(last_msg_->states[24].mesid.sat, 0) + << "incorrect value for states[24].mesid.sat, expected 0, is " + << last_msg_->states[24].mesid.sat; + EXPECT_EQ(last_msg_->states[25].cn0, 0) + << "incorrect value for states[25].cn0, expected 0, is " + << last_msg_->states[25].cn0; + EXPECT_EQ(last_msg_->states[25].mesid.code, 0) + << "incorrect value for states[25].mesid.code, expected 0, is " + << last_msg_->states[25].mesid.code; + EXPECT_EQ(last_msg_->states[25].mesid.sat, 0) + << "incorrect value for states[25].mesid.sat, expected 0, is " + << last_msg_->states[25].mesid.sat; + EXPECT_EQ(last_msg_->states[26].cn0, 212) + << "incorrect value for states[26].cn0, expected 212, is " + << last_msg_->states[26].cn0; + EXPECT_EQ(last_msg_->states[26].mesid.code, 1) + << "incorrect value for states[26].mesid.code, expected 1, is " + << last_msg_->states[26].mesid.code; + EXPECT_EQ(last_msg_->states[26].mesid.sat, 23) + << "incorrect value for states[26].mesid.sat, expected 23, is " + << last_msg_->states[26].mesid.sat; + EXPECT_EQ(last_msg_->states[27].cn0, 205) + << "incorrect value for states[27].cn0, expected 205, is " + << last_msg_->states[27].cn0; + EXPECT_EQ(last_msg_->states[27].mesid.code, 1) + << "incorrect value for states[27].mesid.code, expected 1, is " + << last_msg_->states[27].mesid.code; + EXPECT_EQ(last_msg_->states[27].mesid.sat, 10) + << "incorrect value for states[27].mesid.sat, expected 10, is " + << last_msg_->states[27].mesid.sat; + EXPECT_EQ(last_msg_->states[28].cn0, 0) + << "incorrect value for states[28].cn0, expected 0, is " + << last_msg_->states[28].cn0; + EXPECT_EQ(last_msg_->states[28].mesid.code, 0) + << "incorrect value for states[28].mesid.code, expected 0, is " + << last_msg_->states[28].mesid.code; + EXPECT_EQ(last_msg_->states[28].mesid.sat, 0) + << "incorrect value for states[28].mesid.sat, expected 0, is " + << last_msg_->states[28].mesid.sat; + EXPECT_EQ(last_msg_->states[29].cn0, 230) + << "incorrect value for states[29].cn0, expected 230, is " + << last_msg_->states[29].cn0; + EXPECT_EQ(last_msg_->states[29].mesid.code, 3) + << "incorrect value for states[29].mesid.code, expected 3, is " + << last_msg_->states[29].mesid.code; + EXPECT_EQ(last_msg_->states[29].mesid.sat, 96) + << "incorrect value for states[29].mesid.sat, expected 96, is " + << last_msg_->states[29].mesid.sat; + EXPECT_EQ(last_msg_->states[30].cn0, 0) + << "incorrect value for states[30].cn0, expected 0, is " + << last_msg_->states[30].cn0; + EXPECT_EQ(last_msg_->states[30].mesid.code, 0) + << "incorrect value for states[30].mesid.code, expected 0, is " + << last_msg_->states[30].mesid.code; + EXPECT_EQ(last_msg_->states[30].mesid.sat, 0) + << "incorrect value for states[30].mesid.sat, expected 0, is " + << last_msg_->states[30].mesid.sat; + EXPECT_EQ(last_msg_->states[31].cn0, 214) + << "incorrect value for states[31].cn0, expected 214, is " + << last_msg_->states[31].cn0; + EXPECT_EQ(last_msg_->states[31].mesid.code, 3) + << "incorrect value for states[31].mesid.code, expected 3, is " + << last_msg_->states[31].mesid.code; + EXPECT_EQ(last_msg_->states[31].mesid.sat, 101) + << "incorrect value for states[31].mesid.sat, expected 101, is " + << last_msg_->states[31].mesid.sat; + EXPECT_EQ(last_msg_->states[32].cn0, 212) + << "incorrect value for states[32].cn0, expected 212, is " + << last_msg_->states[32].cn0; + EXPECT_EQ(last_msg_->states[32].mesid.code, 3) + << "incorrect value for states[32].mesid.code, expected 3, is " + << last_msg_->states[32].mesid.code; + EXPECT_EQ(last_msg_->states[32].mesid.sat, 103) + << "incorrect value for states[32].mesid.sat, expected 103, is " + << last_msg_->states[32].mesid.sat; + EXPECT_EQ(last_msg_->states[33].cn0, 209) + << "incorrect value for states[33].cn0, expected 209, is " + << last_msg_->states[33].cn0; + EXPECT_EQ(last_msg_->states[33].mesid.code, 3) + << "incorrect value for states[33].mesid.code, expected 3, is " + << last_msg_->states[33].mesid.code; + EXPECT_EQ(last_msg_->states[33].mesid.sat, 104) + << "incorrect value for states[33].mesid.sat, expected 104, is " + << last_msg_->states[33].mesid.sat; + EXPECT_EQ(last_msg_->states[34].cn0, 157) + << "incorrect value for states[34].cn0, expected 157, is " + << last_msg_->states[34].cn0; + EXPECT_EQ(last_msg_->states[34].mesid.code, 3) + << "incorrect value for states[34].mesid.code, expected 3, is " + << last_msg_->states[34].mesid.code; + EXPECT_EQ(last_msg_->states[34].mesid.sat, 106) + << "incorrect value for states[34].mesid.sat, expected 106, is " + << last_msg_->states[34].mesid.sat; + EXPECT_EQ(last_msg_->states[35].cn0, 230) + << "incorrect value for states[35].cn0, expected 230, is " + << last_msg_->states[35].cn0; + EXPECT_EQ(last_msg_->states[35].mesid.code, 3) + << "incorrect value for states[35].mesid.code, expected 3, is " + << last_msg_->states[35].mesid.code; + EXPECT_EQ(last_msg_->states[35].mesid.sat, 102) + << "incorrect value for states[35].mesid.sat, expected 102, is " + << last_msg_->states[35].mesid.sat; + EXPECT_EQ(last_msg_->states[36].cn0, 0) + << "incorrect value for states[36].cn0, expected 0, is " + << last_msg_->states[36].cn0; + EXPECT_EQ(last_msg_->states[36].mesid.code, 0) + << "incorrect value for states[36].mesid.code, expected 0, is " + << last_msg_->states[36].mesid.code; + EXPECT_EQ(last_msg_->states[36].mesid.sat, 0) + << "incorrect value for states[36].mesid.sat, expected 0, is " + << last_msg_->states[36].mesid.sat; + EXPECT_EQ(last_msg_->states[37].cn0, 0) + << "incorrect value for states[37].cn0, expected 0, is " + << last_msg_->states[37].cn0; + EXPECT_EQ(last_msg_->states[37].mesid.code, 0) + << "incorrect value for states[37].mesid.code, expected 0, is " + << last_msg_->states[37].mesid.code; + EXPECT_EQ(last_msg_->states[37].mesid.sat, 0) + << "incorrect value for states[37].mesid.sat, expected 0, is " + << last_msg_->states[37].mesid.sat; + EXPECT_EQ(last_msg_->states[38].cn0, 189) + << "incorrect value for states[38].cn0, expected 189, is " + << last_msg_->states[38].cn0; + EXPECT_EQ(last_msg_->states[38].mesid.code, 4) + << "incorrect value for states[38].mesid.code, expected 4, is " + << last_msg_->states[38].mesid.code; + EXPECT_EQ(last_msg_->states[38].mesid.sat, 101) + << "incorrect value for states[38].mesid.sat, expected 101, is " + << last_msg_->states[38].mesid.sat; + EXPECT_EQ(last_msg_->states[39].cn0, 207) + << "incorrect value for states[39].cn0, expected 207, is " + << last_msg_->states[39].cn0; + EXPECT_EQ(last_msg_->states[39].mesid.code, 4) + << "incorrect value for states[39].mesid.code, expected 4, is " + << last_msg_->states[39].mesid.code; + EXPECT_EQ(last_msg_->states[39].mesid.sat, 96) + << "incorrect value for states[39].mesid.sat, expected 96, is " + << last_msg_->states[39].mesid.sat; + EXPECT_EQ(last_msg_->states[40].cn0, 164) + << "incorrect value for states[40].cn0, expected 164, is " + << last_msg_->states[40].cn0; + EXPECT_EQ(last_msg_->states[40].mesid.code, 4) + << "incorrect value for states[40].mesid.code, expected 4, is " + << last_msg_->states[40].mesid.code; + EXPECT_EQ(last_msg_->states[40].mesid.sat, 106) + << "incorrect value for states[40].mesid.sat, expected 106, is " + << last_msg_->states[40].mesid.sat; + EXPECT_EQ(last_msg_->states[41].cn0, 193) + << "incorrect value for states[41].cn0, expected 193, is " + << last_msg_->states[41].cn0; + EXPECT_EQ(last_msg_->states[41].mesid.code, 4) + << "incorrect value for states[41].mesid.code, expected 4, is " + << last_msg_->states[41].mesid.code; + EXPECT_EQ(last_msg_->states[41].mesid.sat, 104) + << "incorrect value for states[41].mesid.sat, expected 104, is " + << last_msg_->states[41].mesid.sat; + EXPECT_EQ(last_msg_->states[42].cn0, 0) + << "incorrect value for states[42].cn0, expected 0, is " + << last_msg_->states[42].cn0; + EXPECT_EQ(last_msg_->states[42].mesid.code, 0) + << "incorrect value for states[42].mesid.code, expected 0, is " + << last_msg_->states[42].mesid.code; + EXPECT_EQ(last_msg_->states[42].mesid.sat, 0) + << "incorrect value for states[42].mesid.sat, expected 0, is " + << last_msg_->states[42].mesid.sat; + EXPECT_EQ(last_msg_->states[43].cn0, 208) + << "incorrect value for states[43].cn0, expected 208, is " + << last_msg_->states[43].cn0; + EXPECT_EQ(last_msg_->states[43].mesid.code, 4) + << "incorrect value for states[43].mesid.code, expected 4, is " + << last_msg_->states[43].mesid.code; + EXPECT_EQ(last_msg_->states[43].mesid.sat, 102) + << "incorrect value for states[43].mesid.sat, expected 102, is " + << last_msg_->states[43].mesid.sat; + EXPECT_EQ(last_msg_->states[44].cn0, 0) + << "incorrect value for states[44].cn0, expected 0, is " + << last_msg_->states[44].cn0; + EXPECT_EQ(last_msg_->states[44].mesid.code, 0) + << "incorrect value for states[44].mesid.code, expected 0, is " + << last_msg_->states[44].mesid.code; + EXPECT_EQ(last_msg_->states[44].mesid.sat, 0) + << "incorrect value for states[44].mesid.sat, expected 0, is " + << last_msg_->states[44].mesid.sat; + EXPECT_EQ(last_msg_->states[45].cn0, 212) + << "incorrect value for states[45].cn0, expected 212, is " + << last_msg_->states[45].cn0; + EXPECT_EQ(last_msg_->states[45].mesid.code, 12) + << "incorrect value for states[45].mesid.code, expected 12, is " + << last_msg_->states[45].mesid.code; + EXPECT_EQ(last_msg_->states[45].mesid.sat, 27) + << "incorrect value for states[45].mesid.sat, expected 27, is " + << last_msg_->states[45].mesid.sat; + EXPECT_EQ(last_msg_->states[46].cn0, 161) + << "incorrect value for states[46].cn0, expected 161, is " + << last_msg_->states[46].cn0; + EXPECT_EQ(last_msg_->states[46].mesid.code, 12) + << "incorrect value for states[46].mesid.code, expected 12, is " + << last_msg_->states[46].mesid.code; + EXPECT_EQ(last_msg_->states[46].mesid.sat, 29) + << "incorrect value for states[46].mesid.sat, expected 29, is " + << last_msg_->states[46].mesid.sat; + EXPECT_EQ(last_msg_->states[47].cn0, 216) + << "incorrect value for states[47].cn0, expected 216, is " + << last_msg_->states[47].cn0; + EXPECT_EQ(last_msg_->states[47].mesid.code, 12) + << "incorrect value for states[47].mesid.code, expected 12, is " + << last_msg_->states[47].mesid.code; + EXPECT_EQ(last_msg_->states[47].mesid.sat, 32) + << "incorrect value for states[47].mesid.sat, expected 32, is " + << last_msg_->states[47].mesid.sat; + EXPECT_EQ(last_msg_->states[48].cn0, 216) + << "incorrect value for states[48].cn0, expected 216, is " + << last_msg_->states[48].cn0; + EXPECT_EQ(last_msg_->states[48].mesid.code, 12) + << "incorrect value for states[48].mesid.code, expected 12, is " + << last_msg_->states[48].mesid.code; + EXPECT_EQ(last_msg_->states[48].mesid.sat, 30) + << "incorrect value for states[48].mesid.sat, expected 30, is " + << last_msg_->states[48].mesid.sat; + EXPECT_EQ(last_msg_->states[49].cn0, 178) + << "incorrect value for states[49].cn0, expected 178, is " + << last_msg_->states[49].cn0; + EXPECT_EQ(last_msg_->states[49].mesid.code, 12) + << "incorrect value for states[49].mesid.code, expected 12, is " + << last_msg_->states[49].mesid.code; + EXPECT_EQ(last_msg_->states[49].mesid.sat, 20) + << "incorrect value for states[49].mesid.sat, expected 20, is " + << last_msg_->states[49].mesid.sat; + EXPECT_EQ(last_msg_->states[50].cn0, 0) + << "incorrect value for states[50].cn0, expected 0, is " + << last_msg_->states[50].cn0; + EXPECT_EQ(last_msg_->states[50].mesid.code, 0) + << "incorrect value for states[50].mesid.code, expected 0, is " + << last_msg_->states[50].mesid.code; + EXPECT_EQ(last_msg_->states[50].mesid.sat, 0) + << "incorrect value for states[50].mesid.sat, expected 0, is " + << last_msg_->states[50].mesid.sat; + EXPECT_EQ(last_msg_->states[51].cn0, 0) + << "incorrect value for states[51].cn0, expected 0, is " + << last_msg_->states[51].cn0; + EXPECT_EQ(last_msg_->states[51].mesid.code, 0) + << "incorrect value for states[51].mesid.code, expected 0, is " + << last_msg_->states[51].mesid.code; + EXPECT_EQ(last_msg_->states[51].mesid.sat, 0) + << "incorrect value for states[51].mesid.sat, expected 0, is " + << last_msg_->states[51].mesid.sat; + EXPECT_EQ(last_msg_->states[52].cn0, 0) + << "incorrect value for states[52].cn0, expected 0, is " + << last_msg_->states[52].cn0; + EXPECT_EQ(last_msg_->states[52].mesid.code, 0) + << "incorrect value for states[52].mesid.code, expected 0, is " + << last_msg_->states[52].mesid.code; + EXPECT_EQ(last_msg_->states[52].mesid.sat, 0) + << "incorrect value for states[52].mesid.sat, expected 0, is " + << last_msg_->states[52].mesid.sat; + EXPECT_EQ(last_msg_->states[53].cn0, 0) + << "incorrect value for states[53].cn0, expected 0, is " + << last_msg_->states[53].cn0; + EXPECT_EQ(last_msg_->states[53].mesid.code, 0) + << "incorrect value for states[53].mesid.code, expected 0, is " + << last_msg_->states[53].mesid.code; + EXPECT_EQ(last_msg_->states[53].mesid.sat, 0) + << "incorrect value for states[53].mesid.sat, expected 0, is " + << last_msg_->states[53].mesid.sat; + EXPECT_EQ(last_msg_->states[54].cn0, 0) + << "incorrect value for states[54].cn0, expected 0, is " + << last_msg_->states[54].cn0; + EXPECT_EQ(last_msg_->states[54].mesid.code, 0) + << "incorrect value for states[54].mesid.code, expected 0, is " + << last_msg_->states[54].mesid.code; + EXPECT_EQ(last_msg_->states[54].mesid.sat, 0) + << "incorrect value for states[54].mesid.sat, expected 0, is " + << last_msg_->states[54].mesid.sat; + EXPECT_EQ(last_msg_->states[55].cn0, 0) + << "incorrect value for states[55].cn0, expected 0, is " + << last_msg_->states[55].cn0; + EXPECT_EQ(last_msg_->states[55].mesid.code, 0) + << "incorrect value for states[55].mesid.code, expected 0, is " + << last_msg_->states[55].mesid.code; + EXPECT_EQ(last_msg_->states[55].mesid.sat, 0) + << "incorrect value for states[55].mesid.sat, expected 0, is " + << last_msg_->states[55].mesid.sat; + EXPECT_EQ(last_msg_->states[56].cn0, 0) + << "incorrect value for states[56].cn0, expected 0, is " + << last_msg_->states[56].cn0; + EXPECT_EQ(last_msg_->states[56].mesid.code, 0) + << "incorrect value for states[56].mesid.code, expected 0, is " + << last_msg_->states[56].mesid.code; + EXPECT_EQ(last_msg_->states[56].mesid.sat, 0) + << "incorrect value for states[56].mesid.sat, expected 0, is " + << last_msg_->states[56].mesid.sat; + EXPECT_EQ(last_msg_->states[57].cn0, 0) + << "incorrect value for states[57].cn0, expected 0, is " + << last_msg_->states[57].cn0; + EXPECT_EQ(last_msg_->states[57].mesid.code, 0) + << "incorrect value for states[57].mesid.code, expected 0, is " + << last_msg_->states[57].mesid.code; + EXPECT_EQ(last_msg_->states[57].mesid.sat, 0) + << "incorrect value for states[57].mesid.sat, expected 0, is " + << last_msg_->states[57].mesid.sat; + EXPECT_EQ(last_msg_->states[58].cn0, 0) + << "incorrect value for states[58].cn0, expected 0, is " + << last_msg_->states[58].cn0; + EXPECT_EQ(last_msg_->states[58].mesid.code, 0) + << "incorrect value for states[58].mesid.code, expected 0, is " + << last_msg_->states[58].mesid.code; + EXPECT_EQ(last_msg_->states[58].mesid.sat, 0) + << "incorrect value for states[58].mesid.sat, expected 0, is " + << last_msg_->states[58].mesid.sat; + EXPECT_EQ(last_msg_->states[59].cn0, 0) + << "incorrect value for states[59].cn0, expected 0, is " + << last_msg_->states[59].cn0; + EXPECT_EQ(last_msg_->states[59].mesid.code, 0) + << "incorrect value for states[59].mesid.code, expected 0, is " + << last_msg_->states[59].mesid.code; + EXPECT_EQ(last_msg_->states[59].mesid.sat, 0) + << "incorrect value for states[59].mesid.sat, expected 0, is " + << last_msg_->states[59].mesid.sat; + EXPECT_EQ(last_msg_->states[60].cn0, 0) + << "incorrect value for states[60].cn0, expected 0, is " + << last_msg_->states[60].cn0; + EXPECT_EQ(last_msg_->states[60].mesid.code, 0) + << "incorrect value for states[60].mesid.code, expected 0, is " + << last_msg_->states[60].mesid.code; + EXPECT_EQ(last_msg_->states[60].mesid.sat, 0) + << "incorrect value for states[60].mesid.sat, expected 0, is " + << last_msg_->states[60].mesid.sat; + EXPECT_EQ(last_msg_->states[61].cn0, 0) + << "incorrect value for states[61].cn0, expected 0, is " + << last_msg_->states[61].cn0; + EXPECT_EQ(last_msg_->states[61].mesid.code, 0) + << "incorrect value for states[61].mesid.code, expected 0, is " + << last_msg_->states[61].mesid.code; + EXPECT_EQ(last_msg_->states[61].mesid.sat, 0) + << "incorrect value for states[61].mesid.sat, expected 0, is " + << last_msg_->states[61].mesid.sat; + EXPECT_EQ(last_msg_->states[62].cn0, 0) + << "incorrect value for states[62].cn0, expected 0, is " + << last_msg_->states[62].cn0; + EXPECT_EQ(last_msg_->states[62].mesid.code, 0) + << "incorrect value for states[62].mesid.code, expected 0, is " + << last_msg_->states[62].mesid.code; + EXPECT_EQ(last_msg_->states[62].mesid.sat, 0) + << "incorrect value for states[62].mesid.sat, expected 0, is " + << last_msg_->states[62].mesid.sat; + EXPECT_EQ(last_msg_->states[63].cn0, 203) + << "incorrect value for states[63].cn0, expected 203, is " + << last_msg_->states[63].cn0; + EXPECT_EQ(last_msg_->states[63].mesid.code, 14) + << "incorrect value for states[63].mesid.code, expected 14, is " + << last_msg_->states[63].mesid.code; + EXPECT_EQ(last_msg_->states[63].mesid.sat, 36) + << "incorrect value for states[63].mesid.sat, expected 36, is " + << last_msg_->states[63].mesid.sat; + EXPECT_EQ(last_msg_->states[64].cn0, 0) + << "incorrect value for states[64].cn0, expected 0, is " + << last_msg_->states[64].cn0; + EXPECT_EQ(last_msg_->states[64].mesid.code, 0) + << "incorrect value for states[64].mesid.code, expected 0, is " + << last_msg_->states[64].mesid.code; + EXPECT_EQ(last_msg_->states[64].mesid.sat, 0) + << "incorrect value for states[64].mesid.sat, expected 0, is " + << last_msg_->states[64].mesid.sat; + EXPECT_EQ(last_msg_->states[65].cn0, 158) + << "incorrect value for states[65].cn0, expected 158, is " + << last_msg_->states[65].cn0; + EXPECT_EQ(last_msg_->states[65].mesid.code, 14) + << "incorrect value for states[65].mesid.code, expected 14, is " + << last_msg_->states[65].mesid.code; + EXPECT_EQ(last_msg_->states[65].mesid.sat, 5) + << "incorrect value for states[65].mesid.sat, expected 5, is " + << last_msg_->states[65].mesid.sat; + EXPECT_EQ(last_msg_->states[66].cn0, 194) + << "incorrect value for states[66].cn0, expected 194, is " + << last_msg_->states[66].cn0; + EXPECT_EQ(last_msg_->states[66].mesid.code, 14) + << "incorrect value for states[66].mesid.code, expected 14, is " + << last_msg_->states[66].mesid.code; + EXPECT_EQ(last_msg_->states[66].mesid.sat, 4) + << "incorrect value for states[66].mesid.sat, expected 4, is " + << last_msg_->states[66].mesid.sat; + EXPECT_EQ(last_msg_->states[67].cn0, 192) + << "incorrect value for states[67].cn0, expected 192, is " + << last_msg_->states[67].cn0; + EXPECT_EQ(last_msg_->states[67].mesid.code, 14) + << "incorrect value for states[67].mesid.code, expected 14, is " + << last_msg_->states[67].mesid.code; + EXPECT_EQ(last_msg_->states[67].mesid.sat, 11) + << "incorrect value for states[67].mesid.sat, expected 11, is " + << last_msg_->states[67].mesid.sat; + EXPECT_EQ(last_msg_->states[68].cn0, 207) + << "incorrect value for states[68].cn0, expected 207, is " + << last_msg_->states[68].cn0; + EXPECT_EQ(last_msg_->states[68].mesid.code, 14) + << "incorrect value for states[68].mesid.code, expected 14, is " + << last_msg_->states[68].mesid.code; + EXPECT_EQ(last_msg_->states[68].mesid.sat, 9) + << "incorrect value for states[68].mesid.sat, expected 9, is " + << last_msg_->states[68].mesid.sat; + EXPECT_EQ(last_msg_->states[69].cn0, 0) + << "incorrect value for states[69].cn0, expected 0, is " + << last_msg_->states[69].cn0; + EXPECT_EQ(last_msg_->states[69].mesid.code, 0) + << "incorrect value for states[69].mesid.code, expected 0, is " + << last_msg_->states[69].mesid.code; + EXPECT_EQ(last_msg_->states[69].mesid.sat, 0) + << "incorrect value for states[69].mesid.sat, expected 0, is " + << last_msg_->states[69].mesid.sat; + EXPECT_EQ(last_msg_->states[70].cn0, 0) + << "incorrect value for states[70].cn0, expected 0, is " + << last_msg_->states[70].cn0; + EXPECT_EQ(last_msg_->states[70].mesid.code, 0) + << "incorrect value for states[70].mesid.code, expected 0, is " + << last_msg_->states[70].mesid.code; + EXPECT_EQ(last_msg_->states[70].mesid.sat, 0) + << "incorrect value for states[70].mesid.sat, expected 0, is " + << last_msg_->states[70].mesid.sat; + EXPECT_EQ(last_msg_->states[71].cn0, 0) + << "incorrect value for states[71].cn0, expected 0, is " + << last_msg_->states[71].cn0; + EXPECT_EQ(last_msg_->states[71].mesid.code, 0) + << "incorrect value for states[71].mesid.code, expected 0, is " + << last_msg_->states[71].mesid.code; + EXPECT_EQ(last_msg_->states[71].mesid.sat, 0) + << "incorrect value for states[71].mesid.sat, expected 0, is " + << last_msg_->states[71].mesid.sat; + EXPECT_EQ(last_msg_->states[72].cn0, 218) + << "incorrect value for states[72].cn0, expected 218, is " + << last_msg_->states[72].cn0; + EXPECT_EQ(last_msg_->states[72].mesid.code, 20) + << "incorrect value for states[72].mesid.code, expected 20, is " + << last_msg_->states[72].mesid.code; + EXPECT_EQ(last_msg_->states[72].mesid.sat, 9) + << "incorrect value for states[72].mesid.sat, expected 9, is " + << last_msg_->states[72].mesid.sat; + EXPECT_EQ(last_msg_->states[73].cn0, 176) + << "incorrect value for states[73].cn0, expected 176, is " + << last_msg_->states[73].cn0; + EXPECT_EQ(last_msg_->states[73].mesid.code, 20) + << "incorrect value for states[73].mesid.code, expected 20, is " + << last_msg_->states[73].mesid.code; + EXPECT_EQ(last_msg_->states[73].mesid.sat, 5) + << "incorrect value for states[73].mesid.sat, expected 5, is " + << last_msg_->states[73].mesid.sat; + EXPECT_EQ(last_msg_->states[74].cn0, 217) + << "incorrect value for states[74].cn0, expected 217, is " + << last_msg_->states[74].cn0; + EXPECT_EQ(last_msg_->states[74].mesid.code, 20) + << "incorrect value for states[74].mesid.code, expected 20, is " + << last_msg_->states[74].mesid.code; + EXPECT_EQ(last_msg_->states[74].mesid.sat, 36) + << "incorrect value for states[74].mesid.sat, expected 36, is " + << last_msg_->states[74].mesid.sat; + EXPECT_EQ(last_msg_->states[75].cn0, 200) + << "incorrect value for states[75].cn0, expected 200, is " + << last_msg_->states[75].cn0; + EXPECT_EQ(last_msg_->states[75].mesid.code, 20) + << "incorrect value for states[75].mesid.code, expected 20, is " + << last_msg_->states[75].mesid.code; + EXPECT_EQ(last_msg_->states[75].mesid.sat, 11) + << "incorrect value for states[75].mesid.sat, expected 11, is " + << last_msg_->states[75].mesid.sat; + EXPECT_EQ(last_msg_->states[76].cn0, 205) + << "incorrect value for states[76].cn0, expected 205, is " + << last_msg_->states[76].cn0; + EXPECT_EQ(last_msg_->states[76].mesid.code, 20) + << "incorrect value for states[76].mesid.code, expected 20, is " + << last_msg_->states[76].mesid.code; + EXPECT_EQ(last_msg_->states[76].mesid.sat, 4) + << "incorrect value for states[76].mesid.sat, expected 4, is " + << last_msg_->states[76].mesid.sat; + EXPECT_EQ(last_msg_->states[77].cn0, 0) + << "incorrect value for states[77].cn0, expected 0, is " + << last_msg_->states[77].cn0; + EXPECT_EQ(last_msg_->states[77].mesid.code, 0) + << "incorrect value for states[77].mesid.code, expected 0, is " + << last_msg_->states[77].mesid.code; + EXPECT_EQ(last_msg_->states[77].mesid.sat, 0) + << "incorrect value for states[77].mesid.sat, expected 0, is " + << last_msg_->states[77].mesid.sat; + EXPECT_EQ(last_msg_->states[78].cn0, 0) + << "incorrect value for states[78].cn0, expected 0, is " + << last_msg_->states[78].cn0; + EXPECT_EQ(last_msg_->states[78].mesid.code, 0) + << "incorrect value for states[78].mesid.code, expected 0, is " + << last_msg_->states[78].mesid.code; + EXPECT_EQ(last_msg_->states[78].mesid.sat, 0) + << "incorrect value for states[78].mesid.sat, expected 0, is " + << last_msg_->states[78].mesid.sat; } diff --git a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingIq.cc b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingIq.cc index 5b828df94..0fae0facf 100644 --- a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingIq.cc +++ b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingIq.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIq.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIq.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_tracking_MsgTrackingIq0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgTrackingIq0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgTrackingIq0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgTrackingIq0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_iq_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_iq_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,63 +81,80 @@ class Test_legacy_auto_check_sbp_tracking_MsgTrackingIq0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_iq_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingIq0, Test) -{ +}; - uint8_t encoded_frame[] = {85,45,0,2,80,15,145,121,203,47,217,239,55,45,38,189,88,159,19,208,12,97,167, }; +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingIq0, Test) { + uint8_t encoded_frame[] = { + 85, 45, 0, 2, 80, 15, 145, 121, 203, 47, 217, 239, + 55, 45, 38, 189, 88, 159, 19, 208, 12, 97, 167, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_iq_t* test_msg = ( msg_tracking_iq_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->channel = 145; - if (sizeof(test_msg->corrs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); - } - test_msg->corrs[0].I = -9937; - test_msg->corrs[0].Q = 14319; - if (sizeof(test_msg->corrs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); - } - test_msg->corrs[1].I = 9773; - test_msg->corrs[1].Q = 22717; - if (sizeof(test_msg->corrs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); - } - test_msg->corrs[2].I = 5023; - test_msg->corrs[2].Q = 3280; - test_msg->sid.code = 203; - test_msg->sid.sat = 121; - - EXPECT_EQ(send_message( 0x2d, 20482, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_iq_t *test_msg = (msg_tracking_iq_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->channel = 145; + if (sizeof(test_msg->corrs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); + } + test_msg->corrs[0].I = -9937; + test_msg->corrs[0].Q = 14319; + if (sizeof(test_msg->corrs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); + } + test_msg->corrs[1].I = 9773; + test_msg->corrs[1].Q = 22717; + if (sizeof(test_msg->corrs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); + } + test_msg->corrs[2].I = 5023; + test_msg->corrs[2].Q = 3280; + test_msg->sid.code = 203; + test_msg->sid.sat = 121; + + EXPECT_EQ(send_message(0x2d, 20482, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 20482); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->channel, 145) << "incorrect value for channel, expected 145, is " << last_msg_->channel; - EXPECT_EQ(last_msg_->corrs[0].I, -9937) << "incorrect value for corrs[0].I, expected -9937, is " << last_msg_->corrs[0].I; - EXPECT_EQ(last_msg_->corrs[0].Q, 14319) << "incorrect value for corrs[0].Q, expected 14319, is " << last_msg_->corrs[0].Q; - EXPECT_EQ(last_msg_->corrs[1].I, 9773) << "incorrect value for corrs[1].I, expected 9773, is " << last_msg_->corrs[1].I; - EXPECT_EQ(last_msg_->corrs[1].Q, 22717) << "incorrect value for corrs[1].Q, expected 22717, is " << last_msg_->corrs[1].Q; - EXPECT_EQ(last_msg_->corrs[2].I, 5023) << "incorrect value for corrs[2].I, expected 5023, is " << last_msg_->corrs[2].I; - EXPECT_EQ(last_msg_->corrs[2].Q, 3280) << "incorrect value for corrs[2].Q, expected 3280, is " << last_msg_->corrs[2].Q; - EXPECT_EQ(last_msg_->sid.code, 203) << "incorrect value for sid.code, expected 203, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.sat, 121) << "incorrect value for sid.sat, expected 121, is " << last_msg_->sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 20482); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->channel, 145) + << "incorrect value for channel, expected 145, is " << last_msg_->channel; + EXPECT_EQ(last_msg_->corrs[0].I, -9937) + << "incorrect value for corrs[0].I, expected -9937, is " + << last_msg_->corrs[0].I; + EXPECT_EQ(last_msg_->corrs[0].Q, 14319) + << "incorrect value for corrs[0].Q, expected 14319, is " + << last_msg_->corrs[0].Q; + EXPECT_EQ(last_msg_->corrs[1].I, 9773) + << "incorrect value for corrs[1].I, expected 9773, is " + << last_msg_->corrs[1].I; + EXPECT_EQ(last_msg_->corrs[1].Q, 22717) + << "incorrect value for corrs[1].Q, expected 22717, is " + << last_msg_->corrs[1].Q; + EXPECT_EQ(last_msg_->corrs[2].I, 5023) + << "incorrect value for corrs[2].I, expected 5023, is " + << last_msg_->corrs[2].I; + EXPECT_EQ(last_msg_->corrs[2].Q, 3280) + << "incorrect value for corrs[2].Q, expected 3280, is " + << last_msg_->corrs[2].Q; + EXPECT_EQ(last_msg_->sid.code, 203) + << "incorrect value for sid.code, expected 203, is " + << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.sat, 121) + << "incorrect value for sid.sat, expected 121, is " << last_msg_->sid.sat; } diff --git a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingIqDepA.cc b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingIqDepA.cc index 40b2a023d..4285f07a5 100644 --- a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingIqDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingIqDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_iq_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_iq_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,65 +82,87 @@ class Test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_iq_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,28,0,184,67,29,139,28,250,15,0,99,90,170,96,71,121,33,161,52,211,162,101,41,36,226,99,71,75,14,240,134,82,175,83,17,34, }; +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 28, 0, 184, 67, 29, 139, 28, 250, 15, 0, 99, 90, + 170, 96, 71, 121, 33, 161, 52, 211, 162, 101, 41, 36, 226, + 99, 71, 75, 14, 240, 134, 82, 175, 83, 17, 34, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_iq_dep_a_t* test_msg = ( msg_tracking_iq_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->channel = 139; - if (sizeof(test_msg->corrs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); - } - test_msg->corrs[0].I = 1621776995; - test_msg->corrs[0].Q = -1591641785; - if (sizeof(test_msg->corrs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); - } - test_msg->corrs[1].I = 1705169716; - test_msg->corrs[1].Q = 1675764777; - if (sizeof(test_msg->corrs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); - } - test_msg->corrs[2].I = -267498681; - test_msg->corrs[2].Q = 1403998854; - test_msg->sid.code = 15; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 64028; - - EXPECT_EQ(send_message( 0x1c, 17336, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_iq_dep_a_t *test_msg = + (msg_tracking_iq_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->channel = 139; + if (sizeof(test_msg->corrs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); + } + test_msg->corrs[0].I = 1621776995; + test_msg->corrs[0].Q = -1591641785; + if (sizeof(test_msg->corrs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); + } + test_msg->corrs[1].I = 1705169716; + test_msg->corrs[1].Q = 1675764777; + if (sizeof(test_msg->corrs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); + } + test_msg->corrs[2].I = -267498681; + test_msg->corrs[2].Q = 1403998854; + test_msg->sid.code = 15; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 64028; + + EXPECT_EQ(send_message(0x1c, 17336, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 17336); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->channel, 139) << "incorrect value for channel, expected 139, is " << last_msg_->channel; - EXPECT_EQ(last_msg_->corrs[0].I, 1621776995) << "incorrect value for corrs[0].I, expected 1621776995, is " << last_msg_->corrs[0].I; - EXPECT_EQ(last_msg_->corrs[0].Q, -1591641785) << "incorrect value for corrs[0].Q, expected -1591641785, is " << last_msg_->corrs[0].Q; - EXPECT_EQ(last_msg_->corrs[1].I, 1705169716) << "incorrect value for corrs[1].I, expected 1705169716, is " << last_msg_->corrs[1].I; - EXPECT_EQ(last_msg_->corrs[1].Q, 1675764777) << "incorrect value for corrs[1].Q, expected 1675764777, is " << last_msg_->corrs[1].Q; - EXPECT_EQ(last_msg_->corrs[2].I, -267498681) << "incorrect value for corrs[2].I, expected -267498681, is " << last_msg_->corrs[2].I; - EXPECT_EQ(last_msg_->corrs[2].Q, 1403998854) << "incorrect value for corrs[2].Q, expected 1403998854, is " << last_msg_->corrs[2].Q; - EXPECT_EQ(last_msg_->sid.code, 15) << "incorrect value for sid.code, expected 15, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 64028) << "incorrect value for sid.sat, expected 64028, is " << last_msg_->sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 17336); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->channel, 139) + << "incorrect value for channel, expected 139, is " << last_msg_->channel; + EXPECT_EQ(last_msg_->corrs[0].I, 1621776995) + << "incorrect value for corrs[0].I, expected 1621776995, is " + << last_msg_->corrs[0].I; + EXPECT_EQ(last_msg_->corrs[0].Q, -1591641785) + << "incorrect value for corrs[0].Q, expected -1591641785, is " + << last_msg_->corrs[0].Q; + EXPECT_EQ(last_msg_->corrs[1].I, 1705169716) + << "incorrect value for corrs[1].I, expected 1705169716, is " + << last_msg_->corrs[1].I; + EXPECT_EQ(last_msg_->corrs[1].Q, 1675764777) + << "incorrect value for corrs[1].Q, expected 1675764777, is " + << last_msg_->corrs[1].Q; + EXPECT_EQ(last_msg_->corrs[2].I, -267498681) + << "incorrect value for corrs[2].I, expected -267498681, is " + << last_msg_->corrs[2].I; + EXPECT_EQ(last_msg_->corrs[2].Q, 1403998854) + << "incorrect value for corrs[2].Q, expected 1403998854, is " + << last_msg_->corrs[2].Q; + EXPECT_EQ(last_msg_->sid.code, 15) + << "incorrect value for sid.code, expected 15, is " + << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 64028) + << "incorrect value for sid.sat, expected 64028, is " + << last_msg_->sid.sat; } diff --git a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingIqDepB.cc b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingIqDepB.cc index bfdad452c..8a05af363 100644 --- a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingIqDepB.cc +++ b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingIqDepB.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingIqDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepB0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepB0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepB0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepB0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_iq_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_iq_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,63 +82,82 @@ class Test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepB0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_iq_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepB0, Test) -{ +}; - uint8_t encoded_frame[] = {85,44,0,39,101,27,45,188,183,72,185,157,15,187,249,101,24,135,146,180,224,123,235,142,208,102,112,25,21,177,96,116,68,246,153, }; +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingIqDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 44, 0, 39, 101, 27, 45, 188, 183, 72, 185, 157, + 15, 187, 249, 101, 24, 135, 146, 180, 224, 123, 235, 142, + 208, 102, 112, 25, 21, 177, 96, 116, 68, 246, 153, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_iq_dep_b_t* test_msg = ( msg_tracking_iq_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->channel = 45; - if (sizeof(test_msg->corrs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); - } - test_msg->corrs[0].I = 261994824; - test_msg->corrs[0].Q = 409336251; - if (sizeof(test_msg->corrs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); - } - test_msg->corrs[1].I = -525036921; - test_msg->corrs[1].Q = -795939973; - if (sizeof(test_msg->corrs) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); - } - test_msg->corrs[2].I = 353988710; - test_msg->corrs[2].Q = 1148477617; - test_msg->sid.code = 183; - test_msg->sid.sat = 188; - - EXPECT_EQ(send_message( 0x2c, 25895, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_iq_dep_b_t *test_msg = + (msg_tracking_iq_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->channel = 45; + if (sizeof(test_msg->corrs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); + } + test_msg->corrs[0].I = 261994824; + test_msg->corrs[0].Q = 409336251; + if (sizeof(test_msg->corrs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); + } + test_msg->corrs[1].I = -525036921; + test_msg->corrs[1].Q = -795939973; + if (sizeof(test_msg->corrs) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->corrs[0])); + } + test_msg->corrs[2].I = 353988710; + test_msg->corrs[2].Q = 1148477617; + test_msg->sid.code = 183; + test_msg->sid.sat = 188; + + EXPECT_EQ(send_message(0x2c, 25895, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 25895); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->channel, 45) << "incorrect value for channel, expected 45, is " << last_msg_->channel; - EXPECT_EQ(last_msg_->corrs[0].I, 261994824) << "incorrect value for corrs[0].I, expected 261994824, is " << last_msg_->corrs[0].I; - EXPECT_EQ(last_msg_->corrs[0].Q, 409336251) << "incorrect value for corrs[0].Q, expected 409336251, is " << last_msg_->corrs[0].Q; - EXPECT_EQ(last_msg_->corrs[1].I, -525036921) << "incorrect value for corrs[1].I, expected -525036921, is " << last_msg_->corrs[1].I; - EXPECT_EQ(last_msg_->corrs[1].Q, -795939973) << "incorrect value for corrs[1].Q, expected -795939973, is " << last_msg_->corrs[1].Q; - EXPECT_EQ(last_msg_->corrs[2].I, 353988710) << "incorrect value for corrs[2].I, expected 353988710, is " << last_msg_->corrs[2].I; - EXPECT_EQ(last_msg_->corrs[2].Q, 1148477617) << "incorrect value for corrs[2].Q, expected 1148477617, is " << last_msg_->corrs[2].Q; - EXPECT_EQ(last_msg_->sid.code, 183) << "incorrect value for sid.code, expected 183, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.sat, 188) << "incorrect value for sid.sat, expected 188, is " << last_msg_->sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 25895); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->channel, 45) + << "incorrect value for channel, expected 45, is " << last_msg_->channel; + EXPECT_EQ(last_msg_->corrs[0].I, 261994824) + << "incorrect value for corrs[0].I, expected 261994824, is " + << last_msg_->corrs[0].I; + EXPECT_EQ(last_msg_->corrs[0].Q, 409336251) + << "incorrect value for corrs[0].Q, expected 409336251, is " + << last_msg_->corrs[0].Q; + EXPECT_EQ(last_msg_->corrs[1].I, -525036921) + << "incorrect value for corrs[1].I, expected -525036921, is " + << last_msg_->corrs[1].I; + EXPECT_EQ(last_msg_->corrs[1].Q, -795939973) + << "incorrect value for corrs[1].Q, expected -795939973, is " + << last_msg_->corrs[1].Q; + EXPECT_EQ(last_msg_->corrs[2].I, 353988710) + << "incorrect value for corrs[2].I, expected 353988710, is " + << last_msg_->corrs[2].I; + EXPECT_EQ(last_msg_->corrs[2].Q, 1148477617) + << "incorrect value for corrs[2].Q, expected 1148477617, is " + << last_msg_->corrs[2].Q; + EXPECT_EQ(last_msg_->sid.code, 183) + << "incorrect value for sid.code, expected 183, is " + << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.sat, 188) + << "incorrect value for sid.sat, expected 188, is " << last_msg_->sid.sat; } diff --git a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingState.cc b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingState.cc index 38ab1020c..ae3534cb1 100644 --- a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingState.cc +++ b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingState.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingState.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingState.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_tracking_MsgTrackingState0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgTrackingState0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgTrackingState0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgTrackingState0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_state_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_state_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,789 +81,1310 @@ class Test_legacy_auto_check_sbp_tracking_MsgTrackingState0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_state_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingState0, Test) -{ +}; - uint8_t encoded_frame[] = {85,65,0,55,129,252,117,184,3,102,38,106,140,141,25,4,90,195,246,108,75,82,137,127,45,163,32,46,187,93,153,60,201,147,23,29,5,208,181,30,219,69,254,136,3,121,33,98,144,215,133,182,14,56,169,77,218,62,242,84,171,249,152,137,131,130,193,21,42,68,253,227,216,227,24,26,210,179,19,15,227,255,122,75,187,200,217,48,218,122,187,238,142,149,238,55,251,212,128,160,194,104,113,255,141,62,43,69,245,39,100,230,108,56,247,68,149,143,137,101,233,70,49,165,38,110,218,230,80,213,196,179,139,128,15,178,196,171,8,212,97,194,83,233,79,99,55,90,31,180,5,25,105,186,22,224,80,111,8,48,106,166,4,48,156,49,86,19,142,146,91,124,115,64,28,230,115,178,190,131,16,242,105,59,182,113,192,180,48,179,166,31,172,211,77,228,140,49,128,77,240,194,134,194,41,58,18,53,129,55,91,72,134,92,33,224,157,56,186,54,224,174,82,84,148,190,236,54,62,67,52,215,57,254,16,133,36,174,219,172,145,17,192,179,111,97,207,56,208,134,180,17,43,226,255,182,140,113,141,111, }; +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingState0, Test) { + uint8_t encoded_frame[] = { + 85, 65, 0, 55, 129, 252, 117, 184, 3, 102, 38, 106, 140, 141, 25, + 4, 90, 195, 246, 108, 75, 82, 137, 127, 45, 163, 32, 46, 187, 93, + 153, 60, 201, 147, 23, 29, 5, 208, 181, 30, 219, 69, 254, 136, 3, + 121, 33, 98, 144, 215, 133, 182, 14, 56, 169, 77, 218, 62, 242, 84, + 171, 249, 152, 137, 131, 130, 193, 21, 42, 68, 253, 227, 216, 227, 24, + 26, 210, 179, 19, 15, 227, 255, 122, 75, 187, 200, 217, 48, 218, 122, + 187, 238, 142, 149, 238, 55, 251, 212, 128, 160, 194, 104, 113, 255, 141, + 62, 43, 69, 245, 39, 100, 230, 108, 56, 247, 68, 149, 143, 137, 101, + 233, 70, 49, 165, 38, 110, 218, 230, 80, 213, 196, 179, 139, 128, 15, + 178, 196, 171, 8, 212, 97, 194, 83, 233, 79, 99, 55, 90, 31, 180, + 5, 25, 105, 186, 22, 224, 80, 111, 8, 48, 106, 166, 4, 48, 156, + 49, 86, 19, 142, 146, 91, 124, 115, 64, 28, 230, 115, 178, 190, 131, + 16, 242, 105, 59, 182, 113, 192, 180, 48, 179, 166, 31, 172, 211, 77, + 228, 140, 49, 128, 77, 240, 194, 134, 194, 41, 58, 18, 53, 129, 55, + 91, 72, 134, 92, 33, 224, 157, 56, 186, 54, 224, 174, 82, 84, 148, + 190, 236, 54, 62, 67, 52, 215, 57, 254, 16, 133, 36, 174, 219, 172, + 145, 17, 192, 179, 111, 97, 207, 56, 208, 134, 180, 17, 43, 226, 255, + 182, 140, 113, 141, 111, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_state_t* test_msg = ( msg_tracking_state_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[0].cn0 = 102; - test_msg->states[0].fcn = 3; - test_msg->states[0].sid.code = 184; - test_msg->states[0].sid.sat = 117; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[1].cn0 = 141; - test_msg->states[1].fcn = 140; - test_msg->states[1].sid.code = 106; - test_msg->states[1].sid.sat = 38; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[2].cn0 = 195; - test_msg->states[2].fcn = 90; - test_msg->states[2].sid.code = 4; - test_msg->states[2].sid.sat = 25; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[3].cn0 = 82; - test_msg->states[3].fcn = 75; - test_msg->states[3].sid.code = 108; - test_msg->states[3].sid.sat = 246; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[4].cn0 = 163; - test_msg->states[4].fcn = 45; - test_msg->states[4].sid.code = 127; - test_msg->states[4].sid.sat = 137; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[5].cn0 = 93; - test_msg->states[5].fcn = 187; - test_msg->states[5].sid.code = 46; - test_msg->states[5].sid.sat = 32; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[6].cn0 = 147; - test_msg->states[6].fcn = 201; - test_msg->states[6].sid.code = 60; - test_msg->states[6].sid.sat = 153; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[7].cn0 = 208; - test_msg->states[7].fcn = 5; - test_msg->states[7].sid.code = 29; - test_msg->states[7].sid.sat = 23; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[8].cn0 = 69; - test_msg->states[8].fcn = 219; - test_msg->states[8].sid.code = 30; - test_msg->states[8].sid.sat = 181; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[9].cn0 = 121; - test_msg->states[9].fcn = 3; - test_msg->states[9].sid.code = 136; - test_msg->states[9].sid.sat = 254; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[10].cn0 = 215; - test_msg->states[10].fcn = 144; - test_msg->states[10].sid.code = 98; - test_msg->states[10].sid.sat = 33; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[11].cn0 = 56; - test_msg->states[11].fcn = 14; - test_msg->states[11].sid.code = 182; - test_msg->states[11].sid.sat = 133; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[12].cn0 = 62; - test_msg->states[12].fcn = 218; - test_msg->states[12].sid.code = 77; - test_msg->states[12].sid.sat = 169; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[13].cn0 = 249; - test_msg->states[13].fcn = 171; - test_msg->states[13].sid.code = 84; - test_msg->states[13].sid.sat = 242; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[14].cn0 = 130; - test_msg->states[14].fcn = 131; - test_msg->states[14].sid.code = 137; - test_msg->states[14].sid.sat = 152; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[15].cn0 = 68; - test_msg->states[15].fcn = 42; - test_msg->states[15].sid.code = 21; - test_msg->states[15].sid.sat = 193; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[16].cn0 = 227; - test_msg->states[16].fcn = 216; - test_msg->states[16].sid.code = 227; - test_msg->states[16].sid.sat = 253; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[17].cn0 = 179; - test_msg->states[17].fcn = 210; - test_msg->states[17].sid.code = 26; - test_msg->states[17].sid.sat = 24; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[18].cn0 = 255; - test_msg->states[18].fcn = 227; - test_msg->states[18].sid.code = 15; - test_msg->states[18].sid.sat = 19; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[19].cn0 = 200; - test_msg->states[19].fcn = 187; - test_msg->states[19].sid.code = 75; - test_msg->states[19].sid.sat = 122; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[20].cn0 = 122; - test_msg->states[20].fcn = 218; - test_msg->states[20].sid.code = 48; - test_msg->states[20].sid.sat = 217; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[21].cn0 = 149; - test_msg->states[21].fcn = 142; - test_msg->states[21].sid.code = 238; - test_msg->states[21].sid.sat = 187; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[22].cn0 = 212; - test_msg->states[22].fcn = 251; - test_msg->states[22].sid.code = 55; - test_msg->states[22].sid.sat = 238; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[23].cn0 = 104; - test_msg->states[23].fcn = 194; - test_msg->states[23].sid.code = 160; - test_msg->states[23].sid.sat = 128; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[24].cn0 = 62; - test_msg->states[24].fcn = 141; - test_msg->states[24].sid.code = 255; - test_msg->states[24].sid.sat = 113; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[25].cn0 = 39; - test_msg->states[25].fcn = 245; - test_msg->states[25].sid.code = 69; - test_msg->states[25].sid.sat = 43; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[26].cn0 = 56; - test_msg->states[26].fcn = 108; - test_msg->states[26].sid.code = 230; - test_msg->states[26].sid.sat = 100; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[27].cn0 = 143; - test_msg->states[27].fcn = 149; - test_msg->states[27].sid.code = 68; - test_msg->states[27].sid.sat = 247; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[28].cn0 = 70; - test_msg->states[28].fcn = 233; - test_msg->states[28].sid.code = 101; - test_msg->states[28].sid.sat = 137; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[29].cn0 = 110; - test_msg->states[29].fcn = 38; - test_msg->states[29].sid.code = 165; - test_msg->states[29].sid.sat = 49; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[30].cn0 = 213; - test_msg->states[30].fcn = 80; - test_msg->states[30].sid.code = 230; - test_msg->states[30].sid.sat = 218; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[31].cn0 = 128; - test_msg->states[31].fcn = 139; - test_msg->states[31].sid.code = 179; - test_msg->states[31].sid.sat = 196; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[32].cn0 = 171; - test_msg->states[32].fcn = 196; - test_msg->states[32].sid.code = 178; - test_msg->states[32].sid.sat = 15; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[33].cn0 = 194; - test_msg->states[33].fcn = 97; - test_msg->states[33].sid.code = 212; - test_msg->states[33].sid.sat = 8; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[34].cn0 = 99; - test_msg->states[34].fcn = 79; - test_msg->states[34].sid.code = 233; - test_msg->states[34].sid.sat = 83; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[35].cn0 = 180; - test_msg->states[35].fcn = 31; - test_msg->states[35].sid.code = 90; - test_msg->states[35].sid.sat = 55; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[36].cn0 = 186; - test_msg->states[36].fcn = 105; - test_msg->states[36].sid.code = 25; - test_msg->states[36].sid.sat = 5; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[37].cn0 = 111; - test_msg->states[37].fcn = 80; - test_msg->states[37].sid.code = 224; - test_msg->states[37].sid.sat = 22; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[38].cn0 = 166; - test_msg->states[38].fcn = 106; - test_msg->states[38].sid.code = 48; - test_msg->states[38].sid.sat = 8; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[39].cn0 = 49; - test_msg->states[39].fcn = 156; - test_msg->states[39].sid.code = 48; - test_msg->states[39].sid.sat = 4; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[40].cn0 = 146; - test_msg->states[40].fcn = 142; - test_msg->states[40].sid.code = 19; - test_msg->states[40].sid.sat = 86; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[41].cn0 = 64; - test_msg->states[41].fcn = 115; - test_msg->states[41].sid.code = 124; - test_msg->states[41].sid.sat = 91; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[42].cn0 = 178; - test_msg->states[42].fcn = 115; - test_msg->states[42].sid.code = 230; - test_msg->states[42].sid.sat = 28; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[43].cn0 = 242; - test_msg->states[43].fcn = 16; - test_msg->states[43].sid.code = 131; - test_msg->states[43].sid.sat = 190; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[44].cn0 = 113; - test_msg->states[44].fcn = 182; - test_msg->states[44].sid.code = 59; - test_msg->states[44].sid.sat = 105; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[45].cn0 = 179; - test_msg->states[45].fcn = 48; - test_msg->states[45].sid.code = 180; - test_msg->states[45].sid.sat = 192; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[46].cn0 = 211; - test_msg->states[46].fcn = 172; - test_msg->states[46].sid.code = 31; - test_msg->states[46].sid.sat = 166; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[47].cn0 = 49; - test_msg->states[47].fcn = 140; - test_msg->states[47].sid.code = 228; - test_msg->states[47].sid.sat = 77; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[48].cn0 = 194; - test_msg->states[48].fcn = 240; - test_msg->states[48].sid.code = 77; - test_msg->states[48].sid.sat = 128; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[49].cn0 = 58; - test_msg->states[49].fcn = 41; - test_msg->states[49].sid.code = 194; - test_msg->states[49].sid.sat = 134; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[50].cn0 = 55; - test_msg->states[50].fcn = 129; - test_msg->states[50].sid.code = 53; - test_msg->states[50].sid.sat = 18; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[51].cn0 = 92; - test_msg->states[51].fcn = 134; - test_msg->states[51].sid.code = 72; - test_msg->states[51].sid.sat = 91; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[52].cn0 = 56; - test_msg->states[52].fcn = 157; - test_msg->states[52].sid.code = 224; - test_msg->states[52].sid.sat = 33; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[53].cn0 = 174; - test_msg->states[53].fcn = 224; - test_msg->states[53].sid.code = 54; - test_msg->states[53].sid.sat = 186; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[54].cn0 = 190; - test_msg->states[54].fcn = 148; - test_msg->states[54].sid.code = 84; - test_msg->states[54].sid.sat = 82; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[55].cn0 = 67; - test_msg->states[55].fcn = 62; - test_msg->states[55].sid.code = 54; - test_msg->states[55].sid.sat = 236; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[56].cn0 = 254; - test_msg->states[56].fcn = 57; - test_msg->states[56].sid.code = 215; - test_msg->states[56].sid.sat = 52; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[57].cn0 = 174; - test_msg->states[57].fcn = 36; - test_msg->states[57].sid.code = 133; - test_msg->states[57].sid.sat = 16; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[58].cn0 = 17; - test_msg->states[58].fcn = 145; - test_msg->states[58].sid.code = 172; - test_msg->states[58].sid.sat = 219; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[59].cn0 = 97; - test_msg->states[59].fcn = 111; - test_msg->states[59].sid.code = 179; - test_msg->states[59].sid.sat = 192; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[60].cn0 = 134; - test_msg->states[60].fcn = 208; - test_msg->states[60].sid.code = 56; - test_msg->states[60].sid.sat = 207; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[61].cn0 = 226; - test_msg->states[61].fcn = 43; - test_msg->states[61].sid.code = 17; - test_msg->states[61].sid.sat = 180; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[62].cn0 = 113; - test_msg->states[62].fcn = 140; - test_msg->states[62].sid.code = 182; - test_msg->states[62].sid.sat = 255; - - EXPECT_EQ(send_message( 0x41, 33079, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_state_t *test_msg = (msg_tracking_state_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[0].cn0 = 102; + test_msg->states[0].fcn = 3; + test_msg->states[0].sid.code = 184; + test_msg->states[0].sid.sat = 117; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[1].cn0 = 141; + test_msg->states[1].fcn = 140; + test_msg->states[1].sid.code = 106; + test_msg->states[1].sid.sat = 38; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[2].cn0 = 195; + test_msg->states[2].fcn = 90; + test_msg->states[2].sid.code = 4; + test_msg->states[2].sid.sat = 25; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[3].cn0 = 82; + test_msg->states[3].fcn = 75; + test_msg->states[3].sid.code = 108; + test_msg->states[3].sid.sat = 246; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[4].cn0 = 163; + test_msg->states[4].fcn = 45; + test_msg->states[4].sid.code = 127; + test_msg->states[4].sid.sat = 137; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[5].cn0 = 93; + test_msg->states[5].fcn = 187; + test_msg->states[5].sid.code = 46; + test_msg->states[5].sid.sat = 32; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[6].cn0 = 147; + test_msg->states[6].fcn = 201; + test_msg->states[6].sid.code = 60; + test_msg->states[6].sid.sat = 153; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[7].cn0 = 208; + test_msg->states[7].fcn = 5; + test_msg->states[7].sid.code = 29; + test_msg->states[7].sid.sat = 23; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[8].cn0 = 69; + test_msg->states[8].fcn = 219; + test_msg->states[8].sid.code = 30; + test_msg->states[8].sid.sat = 181; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[9].cn0 = 121; + test_msg->states[9].fcn = 3; + test_msg->states[9].sid.code = 136; + test_msg->states[9].sid.sat = 254; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[10].cn0 = 215; + test_msg->states[10].fcn = 144; + test_msg->states[10].sid.code = 98; + test_msg->states[10].sid.sat = 33; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[11].cn0 = 56; + test_msg->states[11].fcn = 14; + test_msg->states[11].sid.code = 182; + test_msg->states[11].sid.sat = 133; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[12].cn0 = 62; + test_msg->states[12].fcn = 218; + test_msg->states[12].sid.code = 77; + test_msg->states[12].sid.sat = 169; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[13].cn0 = 249; + test_msg->states[13].fcn = 171; + test_msg->states[13].sid.code = 84; + test_msg->states[13].sid.sat = 242; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[14].cn0 = 130; + test_msg->states[14].fcn = 131; + test_msg->states[14].sid.code = 137; + test_msg->states[14].sid.sat = 152; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[15].cn0 = 68; + test_msg->states[15].fcn = 42; + test_msg->states[15].sid.code = 21; + test_msg->states[15].sid.sat = 193; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[16].cn0 = 227; + test_msg->states[16].fcn = 216; + test_msg->states[16].sid.code = 227; + test_msg->states[16].sid.sat = 253; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[17].cn0 = 179; + test_msg->states[17].fcn = 210; + test_msg->states[17].sid.code = 26; + test_msg->states[17].sid.sat = 24; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[18].cn0 = 255; + test_msg->states[18].fcn = 227; + test_msg->states[18].sid.code = 15; + test_msg->states[18].sid.sat = 19; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[19].cn0 = 200; + test_msg->states[19].fcn = 187; + test_msg->states[19].sid.code = 75; + test_msg->states[19].sid.sat = 122; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[20].cn0 = 122; + test_msg->states[20].fcn = 218; + test_msg->states[20].sid.code = 48; + test_msg->states[20].sid.sat = 217; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[21].cn0 = 149; + test_msg->states[21].fcn = 142; + test_msg->states[21].sid.code = 238; + test_msg->states[21].sid.sat = 187; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[22].cn0 = 212; + test_msg->states[22].fcn = 251; + test_msg->states[22].sid.code = 55; + test_msg->states[22].sid.sat = 238; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[23].cn0 = 104; + test_msg->states[23].fcn = 194; + test_msg->states[23].sid.code = 160; + test_msg->states[23].sid.sat = 128; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[24].cn0 = 62; + test_msg->states[24].fcn = 141; + test_msg->states[24].sid.code = 255; + test_msg->states[24].sid.sat = 113; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[25].cn0 = 39; + test_msg->states[25].fcn = 245; + test_msg->states[25].sid.code = 69; + test_msg->states[25].sid.sat = 43; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[26].cn0 = 56; + test_msg->states[26].fcn = 108; + test_msg->states[26].sid.code = 230; + test_msg->states[26].sid.sat = 100; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[27].cn0 = 143; + test_msg->states[27].fcn = 149; + test_msg->states[27].sid.code = 68; + test_msg->states[27].sid.sat = 247; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[28].cn0 = 70; + test_msg->states[28].fcn = 233; + test_msg->states[28].sid.code = 101; + test_msg->states[28].sid.sat = 137; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[29].cn0 = 110; + test_msg->states[29].fcn = 38; + test_msg->states[29].sid.code = 165; + test_msg->states[29].sid.sat = 49; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[30].cn0 = 213; + test_msg->states[30].fcn = 80; + test_msg->states[30].sid.code = 230; + test_msg->states[30].sid.sat = 218; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[31].cn0 = 128; + test_msg->states[31].fcn = 139; + test_msg->states[31].sid.code = 179; + test_msg->states[31].sid.sat = 196; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[32].cn0 = 171; + test_msg->states[32].fcn = 196; + test_msg->states[32].sid.code = 178; + test_msg->states[32].sid.sat = 15; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[33].cn0 = 194; + test_msg->states[33].fcn = 97; + test_msg->states[33].sid.code = 212; + test_msg->states[33].sid.sat = 8; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[34].cn0 = 99; + test_msg->states[34].fcn = 79; + test_msg->states[34].sid.code = 233; + test_msg->states[34].sid.sat = 83; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[35].cn0 = 180; + test_msg->states[35].fcn = 31; + test_msg->states[35].sid.code = 90; + test_msg->states[35].sid.sat = 55; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[36].cn0 = 186; + test_msg->states[36].fcn = 105; + test_msg->states[36].sid.code = 25; + test_msg->states[36].sid.sat = 5; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[37].cn0 = 111; + test_msg->states[37].fcn = 80; + test_msg->states[37].sid.code = 224; + test_msg->states[37].sid.sat = 22; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[38].cn0 = 166; + test_msg->states[38].fcn = 106; + test_msg->states[38].sid.code = 48; + test_msg->states[38].sid.sat = 8; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[39].cn0 = 49; + test_msg->states[39].fcn = 156; + test_msg->states[39].sid.code = 48; + test_msg->states[39].sid.sat = 4; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[40].cn0 = 146; + test_msg->states[40].fcn = 142; + test_msg->states[40].sid.code = 19; + test_msg->states[40].sid.sat = 86; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[41].cn0 = 64; + test_msg->states[41].fcn = 115; + test_msg->states[41].sid.code = 124; + test_msg->states[41].sid.sat = 91; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[42].cn0 = 178; + test_msg->states[42].fcn = 115; + test_msg->states[42].sid.code = 230; + test_msg->states[42].sid.sat = 28; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[43].cn0 = 242; + test_msg->states[43].fcn = 16; + test_msg->states[43].sid.code = 131; + test_msg->states[43].sid.sat = 190; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[44].cn0 = 113; + test_msg->states[44].fcn = 182; + test_msg->states[44].sid.code = 59; + test_msg->states[44].sid.sat = 105; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[45].cn0 = 179; + test_msg->states[45].fcn = 48; + test_msg->states[45].sid.code = 180; + test_msg->states[45].sid.sat = 192; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[46].cn0 = 211; + test_msg->states[46].fcn = 172; + test_msg->states[46].sid.code = 31; + test_msg->states[46].sid.sat = 166; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[47].cn0 = 49; + test_msg->states[47].fcn = 140; + test_msg->states[47].sid.code = 228; + test_msg->states[47].sid.sat = 77; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[48].cn0 = 194; + test_msg->states[48].fcn = 240; + test_msg->states[48].sid.code = 77; + test_msg->states[48].sid.sat = 128; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[49].cn0 = 58; + test_msg->states[49].fcn = 41; + test_msg->states[49].sid.code = 194; + test_msg->states[49].sid.sat = 134; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[50].cn0 = 55; + test_msg->states[50].fcn = 129; + test_msg->states[50].sid.code = 53; + test_msg->states[50].sid.sat = 18; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[51].cn0 = 92; + test_msg->states[51].fcn = 134; + test_msg->states[51].sid.code = 72; + test_msg->states[51].sid.sat = 91; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[52].cn0 = 56; + test_msg->states[52].fcn = 157; + test_msg->states[52].sid.code = 224; + test_msg->states[52].sid.sat = 33; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[53].cn0 = 174; + test_msg->states[53].fcn = 224; + test_msg->states[53].sid.code = 54; + test_msg->states[53].sid.sat = 186; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[54].cn0 = 190; + test_msg->states[54].fcn = 148; + test_msg->states[54].sid.code = 84; + test_msg->states[54].sid.sat = 82; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[55].cn0 = 67; + test_msg->states[55].fcn = 62; + test_msg->states[55].sid.code = 54; + test_msg->states[55].sid.sat = 236; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[56].cn0 = 254; + test_msg->states[56].fcn = 57; + test_msg->states[56].sid.code = 215; + test_msg->states[56].sid.sat = 52; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[57].cn0 = 174; + test_msg->states[57].fcn = 36; + test_msg->states[57].sid.code = 133; + test_msg->states[57].sid.sat = 16; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[58].cn0 = 17; + test_msg->states[58].fcn = 145; + test_msg->states[58].sid.code = 172; + test_msg->states[58].sid.sat = 219; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[59].cn0 = 97; + test_msg->states[59].fcn = 111; + test_msg->states[59].sid.code = 179; + test_msg->states[59].sid.sat = 192; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[60].cn0 = 134; + test_msg->states[60].fcn = 208; + test_msg->states[60].sid.code = 56; + test_msg->states[60].sid.sat = 207; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[61].cn0 = 226; + test_msg->states[61].fcn = 43; + test_msg->states[61].sid.code = 17; + test_msg->states[61].sid.sat = 180; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[62].cn0 = 113; + test_msg->states[62].fcn = 140; + test_msg->states[62].sid.code = 182; + test_msg->states[62].sid.sat = 255; + + EXPECT_EQ(send_message(0x41, 33079, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 33079); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->states[0].cn0, 102) << "incorrect value for states[0].cn0, expected 102, is " << last_msg_->states[0].cn0; - EXPECT_EQ(last_msg_->states[0].fcn, 3) << "incorrect value for states[0].fcn, expected 3, is " << last_msg_->states[0].fcn; - EXPECT_EQ(last_msg_->states[0].sid.code, 184) << "incorrect value for states[0].sid.code, expected 184, is " << last_msg_->states[0].sid.code; - EXPECT_EQ(last_msg_->states[0].sid.sat, 117) << "incorrect value for states[0].sid.sat, expected 117, is " << last_msg_->states[0].sid.sat; - EXPECT_EQ(last_msg_->states[1].cn0, 141) << "incorrect value for states[1].cn0, expected 141, is " << last_msg_->states[1].cn0; - EXPECT_EQ(last_msg_->states[1].fcn, 140) << "incorrect value for states[1].fcn, expected 140, is " << last_msg_->states[1].fcn; - EXPECT_EQ(last_msg_->states[1].sid.code, 106) << "incorrect value for states[1].sid.code, expected 106, is " << last_msg_->states[1].sid.code; - EXPECT_EQ(last_msg_->states[1].sid.sat, 38) << "incorrect value for states[1].sid.sat, expected 38, is " << last_msg_->states[1].sid.sat; - EXPECT_EQ(last_msg_->states[2].cn0, 195) << "incorrect value for states[2].cn0, expected 195, is " << last_msg_->states[2].cn0; - EXPECT_EQ(last_msg_->states[2].fcn, 90) << "incorrect value for states[2].fcn, expected 90, is " << last_msg_->states[2].fcn; - EXPECT_EQ(last_msg_->states[2].sid.code, 4) << "incorrect value for states[2].sid.code, expected 4, is " << last_msg_->states[2].sid.code; - EXPECT_EQ(last_msg_->states[2].sid.sat, 25) << "incorrect value for states[2].sid.sat, expected 25, is " << last_msg_->states[2].sid.sat; - EXPECT_EQ(last_msg_->states[3].cn0, 82) << "incorrect value for states[3].cn0, expected 82, is " << last_msg_->states[3].cn0; - EXPECT_EQ(last_msg_->states[3].fcn, 75) << "incorrect value for states[3].fcn, expected 75, is " << last_msg_->states[3].fcn; - EXPECT_EQ(last_msg_->states[3].sid.code, 108) << "incorrect value for states[3].sid.code, expected 108, is " << last_msg_->states[3].sid.code; - EXPECT_EQ(last_msg_->states[3].sid.sat, 246) << "incorrect value for states[3].sid.sat, expected 246, is " << last_msg_->states[3].sid.sat; - EXPECT_EQ(last_msg_->states[4].cn0, 163) << "incorrect value for states[4].cn0, expected 163, is " << last_msg_->states[4].cn0; - EXPECT_EQ(last_msg_->states[4].fcn, 45) << "incorrect value for states[4].fcn, expected 45, is " << last_msg_->states[4].fcn; - EXPECT_EQ(last_msg_->states[4].sid.code, 127) << "incorrect value for states[4].sid.code, expected 127, is " << last_msg_->states[4].sid.code; - EXPECT_EQ(last_msg_->states[4].sid.sat, 137) << "incorrect value for states[4].sid.sat, expected 137, is " << last_msg_->states[4].sid.sat; - EXPECT_EQ(last_msg_->states[5].cn0, 93) << "incorrect value for states[5].cn0, expected 93, is " << last_msg_->states[5].cn0; - EXPECT_EQ(last_msg_->states[5].fcn, 187) << "incorrect value for states[5].fcn, expected 187, is " << last_msg_->states[5].fcn; - EXPECT_EQ(last_msg_->states[5].sid.code, 46) << "incorrect value for states[5].sid.code, expected 46, is " << last_msg_->states[5].sid.code; - EXPECT_EQ(last_msg_->states[5].sid.sat, 32) << "incorrect value for states[5].sid.sat, expected 32, is " << last_msg_->states[5].sid.sat; - EXPECT_EQ(last_msg_->states[6].cn0, 147) << "incorrect value for states[6].cn0, expected 147, is " << last_msg_->states[6].cn0; - EXPECT_EQ(last_msg_->states[6].fcn, 201) << "incorrect value for states[6].fcn, expected 201, is " << last_msg_->states[6].fcn; - EXPECT_EQ(last_msg_->states[6].sid.code, 60) << "incorrect value for states[6].sid.code, expected 60, is " << last_msg_->states[6].sid.code; - EXPECT_EQ(last_msg_->states[6].sid.sat, 153) << "incorrect value for states[6].sid.sat, expected 153, is " << last_msg_->states[6].sid.sat; - EXPECT_EQ(last_msg_->states[7].cn0, 208) << "incorrect value for states[7].cn0, expected 208, is " << last_msg_->states[7].cn0; - EXPECT_EQ(last_msg_->states[7].fcn, 5) << "incorrect value for states[7].fcn, expected 5, is " << last_msg_->states[7].fcn; - EXPECT_EQ(last_msg_->states[7].sid.code, 29) << "incorrect value for states[7].sid.code, expected 29, is " << last_msg_->states[7].sid.code; - EXPECT_EQ(last_msg_->states[7].sid.sat, 23) << "incorrect value for states[7].sid.sat, expected 23, is " << last_msg_->states[7].sid.sat; - EXPECT_EQ(last_msg_->states[8].cn0, 69) << "incorrect value for states[8].cn0, expected 69, is " << last_msg_->states[8].cn0; - EXPECT_EQ(last_msg_->states[8].fcn, 219) << "incorrect value for states[8].fcn, expected 219, is " << last_msg_->states[8].fcn; - EXPECT_EQ(last_msg_->states[8].sid.code, 30) << "incorrect value for states[8].sid.code, expected 30, is " << last_msg_->states[8].sid.code; - EXPECT_EQ(last_msg_->states[8].sid.sat, 181) << "incorrect value for states[8].sid.sat, expected 181, is " << last_msg_->states[8].sid.sat; - EXPECT_EQ(last_msg_->states[9].cn0, 121) << "incorrect value for states[9].cn0, expected 121, is " << last_msg_->states[9].cn0; - EXPECT_EQ(last_msg_->states[9].fcn, 3) << "incorrect value for states[9].fcn, expected 3, is " << last_msg_->states[9].fcn; - EXPECT_EQ(last_msg_->states[9].sid.code, 136) << "incorrect value for states[9].sid.code, expected 136, is " << last_msg_->states[9].sid.code; - EXPECT_EQ(last_msg_->states[9].sid.sat, 254) << "incorrect value for states[9].sid.sat, expected 254, is " << last_msg_->states[9].sid.sat; - EXPECT_EQ(last_msg_->states[10].cn0, 215) << "incorrect value for states[10].cn0, expected 215, is " << last_msg_->states[10].cn0; - EXPECT_EQ(last_msg_->states[10].fcn, 144) << "incorrect value for states[10].fcn, expected 144, is " << last_msg_->states[10].fcn; - EXPECT_EQ(last_msg_->states[10].sid.code, 98) << "incorrect value for states[10].sid.code, expected 98, is " << last_msg_->states[10].sid.code; - EXPECT_EQ(last_msg_->states[10].sid.sat, 33) << "incorrect value for states[10].sid.sat, expected 33, is " << last_msg_->states[10].sid.sat; - EXPECT_EQ(last_msg_->states[11].cn0, 56) << "incorrect value for states[11].cn0, expected 56, is " << last_msg_->states[11].cn0; - EXPECT_EQ(last_msg_->states[11].fcn, 14) << "incorrect value for states[11].fcn, expected 14, is " << last_msg_->states[11].fcn; - EXPECT_EQ(last_msg_->states[11].sid.code, 182) << "incorrect value for states[11].sid.code, expected 182, is " << last_msg_->states[11].sid.code; - EXPECT_EQ(last_msg_->states[11].sid.sat, 133) << "incorrect value for states[11].sid.sat, expected 133, is " << last_msg_->states[11].sid.sat; - EXPECT_EQ(last_msg_->states[12].cn0, 62) << "incorrect value for states[12].cn0, expected 62, is " << last_msg_->states[12].cn0; - EXPECT_EQ(last_msg_->states[12].fcn, 218) << "incorrect value for states[12].fcn, expected 218, is " << last_msg_->states[12].fcn; - EXPECT_EQ(last_msg_->states[12].sid.code, 77) << "incorrect value for states[12].sid.code, expected 77, is " << last_msg_->states[12].sid.code; - EXPECT_EQ(last_msg_->states[12].sid.sat, 169) << "incorrect value for states[12].sid.sat, expected 169, is " << last_msg_->states[12].sid.sat; - EXPECT_EQ(last_msg_->states[13].cn0, 249) << "incorrect value for states[13].cn0, expected 249, is " << last_msg_->states[13].cn0; - EXPECT_EQ(last_msg_->states[13].fcn, 171) << "incorrect value for states[13].fcn, expected 171, is " << last_msg_->states[13].fcn; - EXPECT_EQ(last_msg_->states[13].sid.code, 84) << "incorrect value for states[13].sid.code, expected 84, is " << last_msg_->states[13].sid.code; - EXPECT_EQ(last_msg_->states[13].sid.sat, 242) << "incorrect value for states[13].sid.sat, expected 242, is " << last_msg_->states[13].sid.sat; - EXPECT_EQ(last_msg_->states[14].cn0, 130) << "incorrect value for states[14].cn0, expected 130, is " << last_msg_->states[14].cn0; - EXPECT_EQ(last_msg_->states[14].fcn, 131) << "incorrect value for states[14].fcn, expected 131, is " << last_msg_->states[14].fcn; - EXPECT_EQ(last_msg_->states[14].sid.code, 137) << "incorrect value for states[14].sid.code, expected 137, is " << last_msg_->states[14].sid.code; - EXPECT_EQ(last_msg_->states[14].sid.sat, 152) << "incorrect value for states[14].sid.sat, expected 152, is " << last_msg_->states[14].sid.sat; - EXPECT_EQ(last_msg_->states[15].cn0, 68) << "incorrect value for states[15].cn0, expected 68, is " << last_msg_->states[15].cn0; - EXPECT_EQ(last_msg_->states[15].fcn, 42) << "incorrect value for states[15].fcn, expected 42, is " << last_msg_->states[15].fcn; - EXPECT_EQ(last_msg_->states[15].sid.code, 21) << "incorrect value for states[15].sid.code, expected 21, is " << last_msg_->states[15].sid.code; - EXPECT_EQ(last_msg_->states[15].sid.sat, 193) << "incorrect value for states[15].sid.sat, expected 193, is " << last_msg_->states[15].sid.sat; - EXPECT_EQ(last_msg_->states[16].cn0, 227) << "incorrect value for states[16].cn0, expected 227, is " << last_msg_->states[16].cn0; - EXPECT_EQ(last_msg_->states[16].fcn, 216) << "incorrect value for states[16].fcn, expected 216, is " << last_msg_->states[16].fcn; - EXPECT_EQ(last_msg_->states[16].sid.code, 227) << "incorrect value for states[16].sid.code, expected 227, is " << last_msg_->states[16].sid.code; - EXPECT_EQ(last_msg_->states[16].sid.sat, 253) << "incorrect value for states[16].sid.sat, expected 253, is " << last_msg_->states[16].sid.sat; - EXPECT_EQ(last_msg_->states[17].cn0, 179) << "incorrect value for states[17].cn0, expected 179, is " << last_msg_->states[17].cn0; - EXPECT_EQ(last_msg_->states[17].fcn, 210) << "incorrect value for states[17].fcn, expected 210, is " << last_msg_->states[17].fcn; - EXPECT_EQ(last_msg_->states[17].sid.code, 26) << "incorrect value for states[17].sid.code, expected 26, is " << last_msg_->states[17].sid.code; - EXPECT_EQ(last_msg_->states[17].sid.sat, 24) << "incorrect value for states[17].sid.sat, expected 24, is " << last_msg_->states[17].sid.sat; - EXPECT_EQ(last_msg_->states[18].cn0, 255) << "incorrect value for states[18].cn0, expected 255, is " << last_msg_->states[18].cn0; - EXPECT_EQ(last_msg_->states[18].fcn, 227) << "incorrect value for states[18].fcn, expected 227, is " << last_msg_->states[18].fcn; - EXPECT_EQ(last_msg_->states[18].sid.code, 15) << "incorrect value for states[18].sid.code, expected 15, is " << last_msg_->states[18].sid.code; - EXPECT_EQ(last_msg_->states[18].sid.sat, 19) << "incorrect value for states[18].sid.sat, expected 19, is " << last_msg_->states[18].sid.sat; - EXPECT_EQ(last_msg_->states[19].cn0, 200) << "incorrect value for states[19].cn0, expected 200, is " << last_msg_->states[19].cn0; - EXPECT_EQ(last_msg_->states[19].fcn, 187) << "incorrect value for states[19].fcn, expected 187, is " << last_msg_->states[19].fcn; - EXPECT_EQ(last_msg_->states[19].sid.code, 75) << "incorrect value for states[19].sid.code, expected 75, is " << last_msg_->states[19].sid.code; - EXPECT_EQ(last_msg_->states[19].sid.sat, 122) << "incorrect value for states[19].sid.sat, expected 122, is " << last_msg_->states[19].sid.sat; - EXPECT_EQ(last_msg_->states[20].cn0, 122) << "incorrect value for states[20].cn0, expected 122, is " << last_msg_->states[20].cn0; - EXPECT_EQ(last_msg_->states[20].fcn, 218) << "incorrect value for states[20].fcn, expected 218, is " << last_msg_->states[20].fcn; - EXPECT_EQ(last_msg_->states[20].sid.code, 48) << "incorrect value for states[20].sid.code, expected 48, is " << last_msg_->states[20].sid.code; - EXPECT_EQ(last_msg_->states[20].sid.sat, 217) << "incorrect value for states[20].sid.sat, expected 217, is " << last_msg_->states[20].sid.sat; - EXPECT_EQ(last_msg_->states[21].cn0, 149) << "incorrect value for states[21].cn0, expected 149, is " << last_msg_->states[21].cn0; - EXPECT_EQ(last_msg_->states[21].fcn, 142) << "incorrect value for states[21].fcn, expected 142, is " << last_msg_->states[21].fcn; - EXPECT_EQ(last_msg_->states[21].sid.code, 238) << "incorrect value for states[21].sid.code, expected 238, is " << last_msg_->states[21].sid.code; - EXPECT_EQ(last_msg_->states[21].sid.sat, 187) << "incorrect value for states[21].sid.sat, expected 187, is " << last_msg_->states[21].sid.sat; - EXPECT_EQ(last_msg_->states[22].cn0, 212) << "incorrect value for states[22].cn0, expected 212, is " << last_msg_->states[22].cn0; - EXPECT_EQ(last_msg_->states[22].fcn, 251) << "incorrect value for states[22].fcn, expected 251, is " << last_msg_->states[22].fcn; - EXPECT_EQ(last_msg_->states[22].sid.code, 55) << "incorrect value for states[22].sid.code, expected 55, is " << last_msg_->states[22].sid.code; - EXPECT_EQ(last_msg_->states[22].sid.sat, 238) << "incorrect value for states[22].sid.sat, expected 238, is " << last_msg_->states[22].sid.sat; - EXPECT_EQ(last_msg_->states[23].cn0, 104) << "incorrect value for states[23].cn0, expected 104, is " << last_msg_->states[23].cn0; - EXPECT_EQ(last_msg_->states[23].fcn, 194) << "incorrect value for states[23].fcn, expected 194, is " << last_msg_->states[23].fcn; - EXPECT_EQ(last_msg_->states[23].sid.code, 160) << "incorrect value for states[23].sid.code, expected 160, is " << last_msg_->states[23].sid.code; - EXPECT_EQ(last_msg_->states[23].sid.sat, 128) << "incorrect value for states[23].sid.sat, expected 128, is " << last_msg_->states[23].sid.sat; - EXPECT_EQ(last_msg_->states[24].cn0, 62) << "incorrect value for states[24].cn0, expected 62, is " << last_msg_->states[24].cn0; - EXPECT_EQ(last_msg_->states[24].fcn, 141) << "incorrect value for states[24].fcn, expected 141, is " << last_msg_->states[24].fcn; - EXPECT_EQ(last_msg_->states[24].sid.code, 255) << "incorrect value for states[24].sid.code, expected 255, is " << last_msg_->states[24].sid.code; - EXPECT_EQ(last_msg_->states[24].sid.sat, 113) << "incorrect value for states[24].sid.sat, expected 113, is " << last_msg_->states[24].sid.sat; - EXPECT_EQ(last_msg_->states[25].cn0, 39) << "incorrect value for states[25].cn0, expected 39, is " << last_msg_->states[25].cn0; - EXPECT_EQ(last_msg_->states[25].fcn, 245) << "incorrect value for states[25].fcn, expected 245, is " << last_msg_->states[25].fcn; - EXPECT_EQ(last_msg_->states[25].sid.code, 69) << "incorrect value for states[25].sid.code, expected 69, is " << last_msg_->states[25].sid.code; - EXPECT_EQ(last_msg_->states[25].sid.sat, 43) << "incorrect value for states[25].sid.sat, expected 43, is " << last_msg_->states[25].sid.sat; - EXPECT_EQ(last_msg_->states[26].cn0, 56) << "incorrect value for states[26].cn0, expected 56, is " << last_msg_->states[26].cn0; - EXPECT_EQ(last_msg_->states[26].fcn, 108) << "incorrect value for states[26].fcn, expected 108, is " << last_msg_->states[26].fcn; - EXPECT_EQ(last_msg_->states[26].sid.code, 230) << "incorrect value for states[26].sid.code, expected 230, is " << last_msg_->states[26].sid.code; - EXPECT_EQ(last_msg_->states[26].sid.sat, 100) << "incorrect value for states[26].sid.sat, expected 100, is " << last_msg_->states[26].sid.sat; - EXPECT_EQ(last_msg_->states[27].cn0, 143) << "incorrect value for states[27].cn0, expected 143, is " << last_msg_->states[27].cn0; - EXPECT_EQ(last_msg_->states[27].fcn, 149) << "incorrect value for states[27].fcn, expected 149, is " << last_msg_->states[27].fcn; - EXPECT_EQ(last_msg_->states[27].sid.code, 68) << "incorrect value for states[27].sid.code, expected 68, is " << last_msg_->states[27].sid.code; - EXPECT_EQ(last_msg_->states[27].sid.sat, 247) << "incorrect value for states[27].sid.sat, expected 247, is " << last_msg_->states[27].sid.sat; - EXPECT_EQ(last_msg_->states[28].cn0, 70) << "incorrect value for states[28].cn0, expected 70, is " << last_msg_->states[28].cn0; - EXPECT_EQ(last_msg_->states[28].fcn, 233) << "incorrect value for states[28].fcn, expected 233, is " << last_msg_->states[28].fcn; - EXPECT_EQ(last_msg_->states[28].sid.code, 101) << "incorrect value for states[28].sid.code, expected 101, is " << last_msg_->states[28].sid.code; - EXPECT_EQ(last_msg_->states[28].sid.sat, 137) << "incorrect value for states[28].sid.sat, expected 137, is " << last_msg_->states[28].sid.sat; - EXPECT_EQ(last_msg_->states[29].cn0, 110) << "incorrect value for states[29].cn0, expected 110, is " << last_msg_->states[29].cn0; - EXPECT_EQ(last_msg_->states[29].fcn, 38) << "incorrect value for states[29].fcn, expected 38, is " << last_msg_->states[29].fcn; - EXPECT_EQ(last_msg_->states[29].sid.code, 165) << "incorrect value for states[29].sid.code, expected 165, is " << last_msg_->states[29].sid.code; - EXPECT_EQ(last_msg_->states[29].sid.sat, 49) << "incorrect value for states[29].sid.sat, expected 49, is " << last_msg_->states[29].sid.sat; - EXPECT_EQ(last_msg_->states[30].cn0, 213) << "incorrect value for states[30].cn0, expected 213, is " << last_msg_->states[30].cn0; - EXPECT_EQ(last_msg_->states[30].fcn, 80) << "incorrect value for states[30].fcn, expected 80, is " << last_msg_->states[30].fcn; - EXPECT_EQ(last_msg_->states[30].sid.code, 230) << "incorrect value for states[30].sid.code, expected 230, is " << last_msg_->states[30].sid.code; - EXPECT_EQ(last_msg_->states[30].sid.sat, 218) << "incorrect value for states[30].sid.sat, expected 218, is " << last_msg_->states[30].sid.sat; - EXPECT_EQ(last_msg_->states[31].cn0, 128) << "incorrect value for states[31].cn0, expected 128, is " << last_msg_->states[31].cn0; - EXPECT_EQ(last_msg_->states[31].fcn, 139) << "incorrect value for states[31].fcn, expected 139, is " << last_msg_->states[31].fcn; - EXPECT_EQ(last_msg_->states[31].sid.code, 179) << "incorrect value for states[31].sid.code, expected 179, is " << last_msg_->states[31].sid.code; - EXPECT_EQ(last_msg_->states[31].sid.sat, 196) << "incorrect value for states[31].sid.sat, expected 196, is " << last_msg_->states[31].sid.sat; - EXPECT_EQ(last_msg_->states[32].cn0, 171) << "incorrect value for states[32].cn0, expected 171, is " << last_msg_->states[32].cn0; - EXPECT_EQ(last_msg_->states[32].fcn, 196) << "incorrect value for states[32].fcn, expected 196, is " << last_msg_->states[32].fcn; - EXPECT_EQ(last_msg_->states[32].sid.code, 178) << "incorrect value for states[32].sid.code, expected 178, is " << last_msg_->states[32].sid.code; - EXPECT_EQ(last_msg_->states[32].sid.sat, 15) << "incorrect value for states[32].sid.sat, expected 15, is " << last_msg_->states[32].sid.sat; - EXPECT_EQ(last_msg_->states[33].cn0, 194) << "incorrect value for states[33].cn0, expected 194, is " << last_msg_->states[33].cn0; - EXPECT_EQ(last_msg_->states[33].fcn, 97) << "incorrect value for states[33].fcn, expected 97, is " << last_msg_->states[33].fcn; - EXPECT_EQ(last_msg_->states[33].sid.code, 212) << "incorrect value for states[33].sid.code, expected 212, is " << last_msg_->states[33].sid.code; - EXPECT_EQ(last_msg_->states[33].sid.sat, 8) << "incorrect value for states[33].sid.sat, expected 8, is " << last_msg_->states[33].sid.sat; - EXPECT_EQ(last_msg_->states[34].cn0, 99) << "incorrect value for states[34].cn0, expected 99, is " << last_msg_->states[34].cn0; - EXPECT_EQ(last_msg_->states[34].fcn, 79) << "incorrect value for states[34].fcn, expected 79, is " << last_msg_->states[34].fcn; - EXPECT_EQ(last_msg_->states[34].sid.code, 233) << "incorrect value for states[34].sid.code, expected 233, is " << last_msg_->states[34].sid.code; - EXPECT_EQ(last_msg_->states[34].sid.sat, 83) << "incorrect value for states[34].sid.sat, expected 83, is " << last_msg_->states[34].sid.sat; - EXPECT_EQ(last_msg_->states[35].cn0, 180) << "incorrect value for states[35].cn0, expected 180, is " << last_msg_->states[35].cn0; - EXPECT_EQ(last_msg_->states[35].fcn, 31) << "incorrect value for states[35].fcn, expected 31, is " << last_msg_->states[35].fcn; - EXPECT_EQ(last_msg_->states[35].sid.code, 90) << "incorrect value for states[35].sid.code, expected 90, is " << last_msg_->states[35].sid.code; - EXPECT_EQ(last_msg_->states[35].sid.sat, 55) << "incorrect value for states[35].sid.sat, expected 55, is " << last_msg_->states[35].sid.sat; - EXPECT_EQ(last_msg_->states[36].cn0, 186) << "incorrect value for states[36].cn0, expected 186, is " << last_msg_->states[36].cn0; - EXPECT_EQ(last_msg_->states[36].fcn, 105) << "incorrect value for states[36].fcn, expected 105, is " << last_msg_->states[36].fcn; - EXPECT_EQ(last_msg_->states[36].sid.code, 25) << "incorrect value for states[36].sid.code, expected 25, is " << last_msg_->states[36].sid.code; - EXPECT_EQ(last_msg_->states[36].sid.sat, 5) << "incorrect value for states[36].sid.sat, expected 5, is " << last_msg_->states[36].sid.sat; - EXPECT_EQ(last_msg_->states[37].cn0, 111) << "incorrect value for states[37].cn0, expected 111, is " << last_msg_->states[37].cn0; - EXPECT_EQ(last_msg_->states[37].fcn, 80) << "incorrect value for states[37].fcn, expected 80, is " << last_msg_->states[37].fcn; - EXPECT_EQ(last_msg_->states[37].sid.code, 224) << "incorrect value for states[37].sid.code, expected 224, is " << last_msg_->states[37].sid.code; - EXPECT_EQ(last_msg_->states[37].sid.sat, 22) << "incorrect value for states[37].sid.sat, expected 22, is " << last_msg_->states[37].sid.sat; - EXPECT_EQ(last_msg_->states[38].cn0, 166) << "incorrect value for states[38].cn0, expected 166, is " << last_msg_->states[38].cn0; - EXPECT_EQ(last_msg_->states[38].fcn, 106) << "incorrect value for states[38].fcn, expected 106, is " << last_msg_->states[38].fcn; - EXPECT_EQ(last_msg_->states[38].sid.code, 48) << "incorrect value for states[38].sid.code, expected 48, is " << last_msg_->states[38].sid.code; - EXPECT_EQ(last_msg_->states[38].sid.sat, 8) << "incorrect value for states[38].sid.sat, expected 8, is " << last_msg_->states[38].sid.sat; - EXPECT_EQ(last_msg_->states[39].cn0, 49) << "incorrect value for states[39].cn0, expected 49, is " << last_msg_->states[39].cn0; - EXPECT_EQ(last_msg_->states[39].fcn, 156) << "incorrect value for states[39].fcn, expected 156, is " << last_msg_->states[39].fcn; - EXPECT_EQ(last_msg_->states[39].sid.code, 48) << "incorrect value for states[39].sid.code, expected 48, is " << last_msg_->states[39].sid.code; - EXPECT_EQ(last_msg_->states[39].sid.sat, 4) << "incorrect value for states[39].sid.sat, expected 4, is " << last_msg_->states[39].sid.sat; - EXPECT_EQ(last_msg_->states[40].cn0, 146) << "incorrect value for states[40].cn0, expected 146, is " << last_msg_->states[40].cn0; - EXPECT_EQ(last_msg_->states[40].fcn, 142) << "incorrect value for states[40].fcn, expected 142, is " << last_msg_->states[40].fcn; - EXPECT_EQ(last_msg_->states[40].sid.code, 19) << "incorrect value for states[40].sid.code, expected 19, is " << last_msg_->states[40].sid.code; - EXPECT_EQ(last_msg_->states[40].sid.sat, 86) << "incorrect value for states[40].sid.sat, expected 86, is " << last_msg_->states[40].sid.sat; - EXPECT_EQ(last_msg_->states[41].cn0, 64) << "incorrect value for states[41].cn0, expected 64, is " << last_msg_->states[41].cn0; - EXPECT_EQ(last_msg_->states[41].fcn, 115) << "incorrect value for states[41].fcn, expected 115, is " << last_msg_->states[41].fcn; - EXPECT_EQ(last_msg_->states[41].sid.code, 124) << "incorrect value for states[41].sid.code, expected 124, is " << last_msg_->states[41].sid.code; - EXPECT_EQ(last_msg_->states[41].sid.sat, 91) << "incorrect value for states[41].sid.sat, expected 91, is " << last_msg_->states[41].sid.sat; - EXPECT_EQ(last_msg_->states[42].cn0, 178) << "incorrect value for states[42].cn0, expected 178, is " << last_msg_->states[42].cn0; - EXPECT_EQ(last_msg_->states[42].fcn, 115) << "incorrect value for states[42].fcn, expected 115, is " << last_msg_->states[42].fcn; - EXPECT_EQ(last_msg_->states[42].sid.code, 230) << "incorrect value for states[42].sid.code, expected 230, is " << last_msg_->states[42].sid.code; - EXPECT_EQ(last_msg_->states[42].sid.sat, 28) << "incorrect value for states[42].sid.sat, expected 28, is " << last_msg_->states[42].sid.sat; - EXPECT_EQ(last_msg_->states[43].cn0, 242) << "incorrect value for states[43].cn0, expected 242, is " << last_msg_->states[43].cn0; - EXPECT_EQ(last_msg_->states[43].fcn, 16) << "incorrect value for states[43].fcn, expected 16, is " << last_msg_->states[43].fcn; - EXPECT_EQ(last_msg_->states[43].sid.code, 131) << "incorrect value for states[43].sid.code, expected 131, is " << last_msg_->states[43].sid.code; - EXPECT_EQ(last_msg_->states[43].sid.sat, 190) << "incorrect value for states[43].sid.sat, expected 190, is " << last_msg_->states[43].sid.sat; - EXPECT_EQ(last_msg_->states[44].cn0, 113) << "incorrect value for states[44].cn0, expected 113, is " << last_msg_->states[44].cn0; - EXPECT_EQ(last_msg_->states[44].fcn, 182) << "incorrect value for states[44].fcn, expected 182, is " << last_msg_->states[44].fcn; - EXPECT_EQ(last_msg_->states[44].sid.code, 59) << "incorrect value for states[44].sid.code, expected 59, is " << last_msg_->states[44].sid.code; - EXPECT_EQ(last_msg_->states[44].sid.sat, 105) << "incorrect value for states[44].sid.sat, expected 105, is " << last_msg_->states[44].sid.sat; - EXPECT_EQ(last_msg_->states[45].cn0, 179) << "incorrect value for states[45].cn0, expected 179, is " << last_msg_->states[45].cn0; - EXPECT_EQ(last_msg_->states[45].fcn, 48) << "incorrect value for states[45].fcn, expected 48, is " << last_msg_->states[45].fcn; - EXPECT_EQ(last_msg_->states[45].sid.code, 180) << "incorrect value for states[45].sid.code, expected 180, is " << last_msg_->states[45].sid.code; - EXPECT_EQ(last_msg_->states[45].sid.sat, 192) << "incorrect value for states[45].sid.sat, expected 192, is " << last_msg_->states[45].sid.sat; - EXPECT_EQ(last_msg_->states[46].cn0, 211) << "incorrect value for states[46].cn0, expected 211, is " << last_msg_->states[46].cn0; - EXPECT_EQ(last_msg_->states[46].fcn, 172) << "incorrect value for states[46].fcn, expected 172, is " << last_msg_->states[46].fcn; - EXPECT_EQ(last_msg_->states[46].sid.code, 31) << "incorrect value for states[46].sid.code, expected 31, is " << last_msg_->states[46].sid.code; - EXPECT_EQ(last_msg_->states[46].sid.sat, 166) << "incorrect value for states[46].sid.sat, expected 166, is " << last_msg_->states[46].sid.sat; - EXPECT_EQ(last_msg_->states[47].cn0, 49) << "incorrect value for states[47].cn0, expected 49, is " << last_msg_->states[47].cn0; - EXPECT_EQ(last_msg_->states[47].fcn, 140) << "incorrect value for states[47].fcn, expected 140, is " << last_msg_->states[47].fcn; - EXPECT_EQ(last_msg_->states[47].sid.code, 228) << "incorrect value for states[47].sid.code, expected 228, is " << last_msg_->states[47].sid.code; - EXPECT_EQ(last_msg_->states[47].sid.sat, 77) << "incorrect value for states[47].sid.sat, expected 77, is " << last_msg_->states[47].sid.sat; - EXPECT_EQ(last_msg_->states[48].cn0, 194) << "incorrect value for states[48].cn0, expected 194, is " << last_msg_->states[48].cn0; - EXPECT_EQ(last_msg_->states[48].fcn, 240) << "incorrect value for states[48].fcn, expected 240, is " << last_msg_->states[48].fcn; - EXPECT_EQ(last_msg_->states[48].sid.code, 77) << "incorrect value for states[48].sid.code, expected 77, is " << last_msg_->states[48].sid.code; - EXPECT_EQ(last_msg_->states[48].sid.sat, 128) << "incorrect value for states[48].sid.sat, expected 128, is " << last_msg_->states[48].sid.sat; - EXPECT_EQ(last_msg_->states[49].cn0, 58) << "incorrect value for states[49].cn0, expected 58, is " << last_msg_->states[49].cn0; - EXPECT_EQ(last_msg_->states[49].fcn, 41) << "incorrect value for states[49].fcn, expected 41, is " << last_msg_->states[49].fcn; - EXPECT_EQ(last_msg_->states[49].sid.code, 194) << "incorrect value for states[49].sid.code, expected 194, is " << last_msg_->states[49].sid.code; - EXPECT_EQ(last_msg_->states[49].sid.sat, 134) << "incorrect value for states[49].sid.sat, expected 134, is " << last_msg_->states[49].sid.sat; - EXPECT_EQ(last_msg_->states[50].cn0, 55) << "incorrect value for states[50].cn0, expected 55, is " << last_msg_->states[50].cn0; - EXPECT_EQ(last_msg_->states[50].fcn, 129) << "incorrect value for states[50].fcn, expected 129, is " << last_msg_->states[50].fcn; - EXPECT_EQ(last_msg_->states[50].sid.code, 53) << "incorrect value for states[50].sid.code, expected 53, is " << last_msg_->states[50].sid.code; - EXPECT_EQ(last_msg_->states[50].sid.sat, 18) << "incorrect value for states[50].sid.sat, expected 18, is " << last_msg_->states[50].sid.sat; - EXPECT_EQ(last_msg_->states[51].cn0, 92) << "incorrect value for states[51].cn0, expected 92, is " << last_msg_->states[51].cn0; - EXPECT_EQ(last_msg_->states[51].fcn, 134) << "incorrect value for states[51].fcn, expected 134, is " << last_msg_->states[51].fcn; - EXPECT_EQ(last_msg_->states[51].sid.code, 72) << "incorrect value for states[51].sid.code, expected 72, is " << last_msg_->states[51].sid.code; - EXPECT_EQ(last_msg_->states[51].sid.sat, 91) << "incorrect value for states[51].sid.sat, expected 91, is " << last_msg_->states[51].sid.sat; - EXPECT_EQ(last_msg_->states[52].cn0, 56) << "incorrect value for states[52].cn0, expected 56, is " << last_msg_->states[52].cn0; - EXPECT_EQ(last_msg_->states[52].fcn, 157) << "incorrect value for states[52].fcn, expected 157, is " << last_msg_->states[52].fcn; - EXPECT_EQ(last_msg_->states[52].sid.code, 224) << "incorrect value for states[52].sid.code, expected 224, is " << last_msg_->states[52].sid.code; - EXPECT_EQ(last_msg_->states[52].sid.sat, 33) << "incorrect value for states[52].sid.sat, expected 33, is " << last_msg_->states[52].sid.sat; - EXPECT_EQ(last_msg_->states[53].cn0, 174) << "incorrect value for states[53].cn0, expected 174, is " << last_msg_->states[53].cn0; - EXPECT_EQ(last_msg_->states[53].fcn, 224) << "incorrect value for states[53].fcn, expected 224, is " << last_msg_->states[53].fcn; - EXPECT_EQ(last_msg_->states[53].sid.code, 54) << "incorrect value for states[53].sid.code, expected 54, is " << last_msg_->states[53].sid.code; - EXPECT_EQ(last_msg_->states[53].sid.sat, 186) << "incorrect value for states[53].sid.sat, expected 186, is " << last_msg_->states[53].sid.sat; - EXPECT_EQ(last_msg_->states[54].cn0, 190) << "incorrect value for states[54].cn0, expected 190, is " << last_msg_->states[54].cn0; - EXPECT_EQ(last_msg_->states[54].fcn, 148) << "incorrect value for states[54].fcn, expected 148, is " << last_msg_->states[54].fcn; - EXPECT_EQ(last_msg_->states[54].sid.code, 84) << "incorrect value for states[54].sid.code, expected 84, is " << last_msg_->states[54].sid.code; - EXPECT_EQ(last_msg_->states[54].sid.sat, 82) << "incorrect value for states[54].sid.sat, expected 82, is " << last_msg_->states[54].sid.sat; - EXPECT_EQ(last_msg_->states[55].cn0, 67) << "incorrect value for states[55].cn0, expected 67, is " << last_msg_->states[55].cn0; - EXPECT_EQ(last_msg_->states[55].fcn, 62) << "incorrect value for states[55].fcn, expected 62, is " << last_msg_->states[55].fcn; - EXPECT_EQ(last_msg_->states[55].sid.code, 54) << "incorrect value for states[55].sid.code, expected 54, is " << last_msg_->states[55].sid.code; - EXPECT_EQ(last_msg_->states[55].sid.sat, 236) << "incorrect value for states[55].sid.sat, expected 236, is " << last_msg_->states[55].sid.sat; - EXPECT_EQ(last_msg_->states[56].cn0, 254) << "incorrect value for states[56].cn0, expected 254, is " << last_msg_->states[56].cn0; - EXPECT_EQ(last_msg_->states[56].fcn, 57) << "incorrect value for states[56].fcn, expected 57, is " << last_msg_->states[56].fcn; - EXPECT_EQ(last_msg_->states[56].sid.code, 215) << "incorrect value for states[56].sid.code, expected 215, is " << last_msg_->states[56].sid.code; - EXPECT_EQ(last_msg_->states[56].sid.sat, 52) << "incorrect value for states[56].sid.sat, expected 52, is " << last_msg_->states[56].sid.sat; - EXPECT_EQ(last_msg_->states[57].cn0, 174) << "incorrect value for states[57].cn0, expected 174, is " << last_msg_->states[57].cn0; - EXPECT_EQ(last_msg_->states[57].fcn, 36) << "incorrect value for states[57].fcn, expected 36, is " << last_msg_->states[57].fcn; - EXPECT_EQ(last_msg_->states[57].sid.code, 133) << "incorrect value for states[57].sid.code, expected 133, is " << last_msg_->states[57].sid.code; - EXPECT_EQ(last_msg_->states[57].sid.sat, 16) << "incorrect value for states[57].sid.sat, expected 16, is " << last_msg_->states[57].sid.sat; - EXPECT_EQ(last_msg_->states[58].cn0, 17) << "incorrect value for states[58].cn0, expected 17, is " << last_msg_->states[58].cn0; - EXPECT_EQ(last_msg_->states[58].fcn, 145) << "incorrect value for states[58].fcn, expected 145, is " << last_msg_->states[58].fcn; - EXPECT_EQ(last_msg_->states[58].sid.code, 172) << "incorrect value for states[58].sid.code, expected 172, is " << last_msg_->states[58].sid.code; - EXPECT_EQ(last_msg_->states[58].sid.sat, 219) << "incorrect value for states[58].sid.sat, expected 219, is " << last_msg_->states[58].sid.sat; - EXPECT_EQ(last_msg_->states[59].cn0, 97) << "incorrect value for states[59].cn0, expected 97, is " << last_msg_->states[59].cn0; - EXPECT_EQ(last_msg_->states[59].fcn, 111) << "incorrect value for states[59].fcn, expected 111, is " << last_msg_->states[59].fcn; - EXPECT_EQ(last_msg_->states[59].sid.code, 179) << "incorrect value for states[59].sid.code, expected 179, is " << last_msg_->states[59].sid.code; - EXPECT_EQ(last_msg_->states[59].sid.sat, 192) << "incorrect value for states[59].sid.sat, expected 192, is " << last_msg_->states[59].sid.sat; - EXPECT_EQ(last_msg_->states[60].cn0, 134) << "incorrect value for states[60].cn0, expected 134, is " << last_msg_->states[60].cn0; - EXPECT_EQ(last_msg_->states[60].fcn, 208) << "incorrect value for states[60].fcn, expected 208, is " << last_msg_->states[60].fcn; - EXPECT_EQ(last_msg_->states[60].sid.code, 56) << "incorrect value for states[60].sid.code, expected 56, is " << last_msg_->states[60].sid.code; - EXPECT_EQ(last_msg_->states[60].sid.sat, 207) << "incorrect value for states[60].sid.sat, expected 207, is " << last_msg_->states[60].sid.sat; - EXPECT_EQ(last_msg_->states[61].cn0, 226) << "incorrect value for states[61].cn0, expected 226, is " << last_msg_->states[61].cn0; - EXPECT_EQ(last_msg_->states[61].fcn, 43) << "incorrect value for states[61].fcn, expected 43, is " << last_msg_->states[61].fcn; - EXPECT_EQ(last_msg_->states[61].sid.code, 17) << "incorrect value for states[61].sid.code, expected 17, is " << last_msg_->states[61].sid.code; - EXPECT_EQ(last_msg_->states[61].sid.sat, 180) << "incorrect value for states[61].sid.sat, expected 180, is " << last_msg_->states[61].sid.sat; - EXPECT_EQ(last_msg_->states[62].cn0, 113) << "incorrect value for states[62].cn0, expected 113, is " << last_msg_->states[62].cn0; - EXPECT_EQ(last_msg_->states[62].fcn, 140) << "incorrect value for states[62].fcn, expected 140, is " << last_msg_->states[62].fcn; - EXPECT_EQ(last_msg_->states[62].sid.code, 182) << "incorrect value for states[62].sid.code, expected 182, is " << last_msg_->states[62].sid.code; - EXPECT_EQ(last_msg_->states[62].sid.sat, 255) << "incorrect value for states[62].sid.sat, expected 255, is " << last_msg_->states[62].sid.sat; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 33079); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->states[0].cn0, 102) + << "incorrect value for states[0].cn0, expected 102, is " + << last_msg_->states[0].cn0; + EXPECT_EQ(last_msg_->states[0].fcn, 3) + << "incorrect value for states[0].fcn, expected 3, is " + << last_msg_->states[0].fcn; + EXPECT_EQ(last_msg_->states[0].sid.code, 184) + << "incorrect value for states[0].sid.code, expected 184, is " + << last_msg_->states[0].sid.code; + EXPECT_EQ(last_msg_->states[0].sid.sat, 117) + << "incorrect value for states[0].sid.sat, expected 117, is " + << last_msg_->states[0].sid.sat; + EXPECT_EQ(last_msg_->states[1].cn0, 141) + << "incorrect value for states[1].cn0, expected 141, is " + << last_msg_->states[1].cn0; + EXPECT_EQ(last_msg_->states[1].fcn, 140) + << "incorrect value for states[1].fcn, expected 140, is " + << last_msg_->states[1].fcn; + EXPECT_EQ(last_msg_->states[1].sid.code, 106) + << "incorrect value for states[1].sid.code, expected 106, is " + << last_msg_->states[1].sid.code; + EXPECT_EQ(last_msg_->states[1].sid.sat, 38) + << "incorrect value for states[1].sid.sat, expected 38, is " + << last_msg_->states[1].sid.sat; + EXPECT_EQ(last_msg_->states[2].cn0, 195) + << "incorrect value for states[2].cn0, expected 195, is " + << last_msg_->states[2].cn0; + EXPECT_EQ(last_msg_->states[2].fcn, 90) + << "incorrect value for states[2].fcn, expected 90, is " + << last_msg_->states[2].fcn; + EXPECT_EQ(last_msg_->states[2].sid.code, 4) + << "incorrect value for states[2].sid.code, expected 4, is " + << last_msg_->states[2].sid.code; + EXPECT_EQ(last_msg_->states[2].sid.sat, 25) + << "incorrect value for states[2].sid.sat, expected 25, is " + << last_msg_->states[2].sid.sat; + EXPECT_EQ(last_msg_->states[3].cn0, 82) + << "incorrect value for states[3].cn0, expected 82, is " + << last_msg_->states[3].cn0; + EXPECT_EQ(last_msg_->states[3].fcn, 75) + << "incorrect value for states[3].fcn, expected 75, is " + << last_msg_->states[3].fcn; + EXPECT_EQ(last_msg_->states[3].sid.code, 108) + << "incorrect value for states[3].sid.code, expected 108, is " + << last_msg_->states[3].sid.code; + EXPECT_EQ(last_msg_->states[3].sid.sat, 246) + << "incorrect value for states[3].sid.sat, expected 246, is " + << last_msg_->states[3].sid.sat; + EXPECT_EQ(last_msg_->states[4].cn0, 163) + << "incorrect value for states[4].cn0, expected 163, is " + << last_msg_->states[4].cn0; + EXPECT_EQ(last_msg_->states[4].fcn, 45) + << "incorrect value for states[4].fcn, expected 45, is " + << last_msg_->states[4].fcn; + EXPECT_EQ(last_msg_->states[4].sid.code, 127) + << "incorrect value for states[4].sid.code, expected 127, is " + << last_msg_->states[4].sid.code; + EXPECT_EQ(last_msg_->states[4].sid.sat, 137) + << "incorrect value for states[4].sid.sat, expected 137, is " + << last_msg_->states[4].sid.sat; + EXPECT_EQ(last_msg_->states[5].cn0, 93) + << "incorrect value for states[5].cn0, expected 93, is " + << last_msg_->states[5].cn0; + EXPECT_EQ(last_msg_->states[5].fcn, 187) + << "incorrect value for states[5].fcn, expected 187, is " + << last_msg_->states[5].fcn; + EXPECT_EQ(last_msg_->states[5].sid.code, 46) + << "incorrect value for states[5].sid.code, expected 46, is " + << last_msg_->states[5].sid.code; + EXPECT_EQ(last_msg_->states[5].sid.sat, 32) + << "incorrect value for states[5].sid.sat, expected 32, is " + << last_msg_->states[5].sid.sat; + EXPECT_EQ(last_msg_->states[6].cn0, 147) + << "incorrect value for states[6].cn0, expected 147, is " + << last_msg_->states[6].cn0; + EXPECT_EQ(last_msg_->states[6].fcn, 201) + << "incorrect value for states[6].fcn, expected 201, is " + << last_msg_->states[6].fcn; + EXPECT_EQ(last_msg_->states[6].sid.code, 60) + << "incorrect value for states[6].sid.code, expected 60, is " + << last_msg_->states[6].sid.code; + EXPECT_EQ(last_msg_->states[6].sid.sat, 153) + << "incorrect value for states[6].sid.sat, expected 153, is " + << last_msg_->states[6].sid.sat; + EXPECT_EQ(last_msg_->states[7].cn0, 208) + << "incorrect value for states[7].cn0, expected 208, is " + << last_msg_->states[7].cn0; + EXPECT_EQ(last_msg_->states[7].fcn, 5) + << "incorrect value for states[7].fcn, expected 5, is " + << last_msg_->states[7].fcn; + EXPECT_EQ(last_msg_->states[7].sid.code, 29) + << "incorrect value for states[7].sid.code, expected 29, is " + << last_msg_->states[7].sid.code; + EXPECT_EQ(last_msg_->states[7].sid.sat, 23) + << "incorrect value for states[7].sid.sat, expected 23, is " + << last_msg_->states[7].sid.sat; + EXPECT_EQ(last_msg_->states[8].cn0, 69) + << "incorrect value for states[8].cn0, expected 69, is " + << last_msg_->states[8].cn0; + EXPECT_EQ(last_msg_->states[8].fcn, 219) + << "incorrect value for states[8].fcn, expected 219, is " + << last_msg_->states[8].fcn; + EXPECT_EQ(last_msg_->states[8].sid.code, 30) + << "incorrect value for states[8].sid.code, expected 30, is " + << last_msg_->states[8].sid.code; + EXPECT_EQ(last_msg_->states[8].sid.sat, 181) + << "incorrect value for states[8].sid.sat, expected 181, is " + << last_msg_->states[8].sid.sat; + EXPECT_EQ(last_msg_->states[9].cn0, 121) + << "incorrect value for states[9].cn0, expected 121, is " + << last_msg_->states[9].cn0; + EXPECT_EQ(last_msg_->states[9].fcn, 3) + << "incorrect value for states[9].fcn, expected 3, is " + << last_msg_->states[9].fcn; + EXPECT_EQ(last_msg_->states[9].sid.code, 136) + << "incorrect value for states[9].sid.code, expected 136, is " + << last_msg_->states[9].sid.code; + EXPECT_EQ(last_msg_->states[9].sid.sat, 254) + << "incorrect value for states[9].sid.sat, expected 254, is " + << last_msg_->states[9].sid.sat; + EXPECT_EQ(last_msg_->states[10].cn0, 215) + << "incorrect value for states[10].cn0, expected 215, is " + << last_msg_->states[10].cn0; + EXPECT_EQ(last_msg_->states[10].fcn, 144) + << "incorrect value for states[10].fcn, expected 144, is " + << last_msg_->states[10].fcn; + EXPECT_EQ(last_msg_->states[10].sid.code, 98) + << "incorrect value for states[10].sid.code, expected 98, is " + << last_msg_->states[10].sid.code; + EXPECT_EQ(last_msg_->states[10].sid.sat, 33) + << "incorrect value for states[10].sid.sat, expected 33, is " + << last_msg_->states[10].sid.sat; + EXPECT_EQ(last_msg_->states[11].cn0, 56) + << "incorrect value for states[11].cn0, expected 56, is " + << last_msg_->states[11].cn0; + EXPECT_EQ(last_msg_->states[11].fcn, 14) + << "incorrect value for states[11].fcn, expected 14, is " + << last_msg_->states[11].fcn; + EXPECT_EQ(last_msg_->states[11].sid.code, 182) + << "incorrect value for states[11].sid.code, expected 182, is " + << last_msg_->states[11].sid.code; + EXPECT_EQ(last_msg_->states[11].sid.sat, 133) + << "incorrect value for states[11].sid.sat, expected 133, is " + << last_msg_->states[11].sid.sat; + EXPECT_EQ(last_msg_->states[12].cn0, 62) + << "incorrect value for states[12].cn0, expected 62, is " + << last_msg_->states[12].cn0; + EXPECT_EQ(last_msg_->states[12].fcn, 218) + << "incorrect value for states[12].fcn, expected 218, is " + << last_msg_->states[12].fcn; + EXPECT_EQ(last_msg_->states[12].sid.code, 77) + << "incorrect value for states[12].sid.code, expected 77, is " + << last_msg_->states[12].sid.code; + EXPECT_EQ(last_msg_->states[12].sid.sat, 169) + << "incorrect value for states[12].sid.sat, expected 169, is " + << last_msg_->states[12].sid.sat; + EXPECT_EQ(last_msg_->states[13].cn0, 249) + << "incorrect value for states[13].cn0, expected 249, is " + << last_msg_->states[13].cn0; + EXPECT_EQ(last_msg_->states[13].fcn, 171) + << "incorrect value for states[13].fcn, expected 171, is " + << last_msg_->states[13].fcn; + EXPECT_EQ(last_msg_->states[13].sid.code, 84) + << "incorrect value for states[13].sid.code, expected 84, is " + << last_msg_->states[13].sid.code; + EXPECT_EQ(last_msg_->states[13].sid.sat, 242) + << "incorrect value for states[13].sid.sat, expected 242, is " + << last_msg_->states[13].sid.sat; + EXPECT_EQ(last_msg_->states[14].cn0, 130) + << "incorrect value for states[14].cn0, expected 130, is " + << last_msg_->states[14].cn0; + EXPECT_EQ(last_msg_->states[14].fcn, 131) + << "incorrect value for states[14].fcn, expected 131, is " + << last_msg_->states[14].fcn; + EXPECT_EQ(last_msg_->states[14].sid.code, 137) + << "incorrect value for states[14].sid.code, expected 137, is " + << last_msg_->states[14].sid.code; + EXPECT_EQ(last_msg_->states[14].sid.sat, 152) + << "incorrect value for states[14].sid.sat, expected 152, is " + << last_msg_->states[14].sid.sat; + EXPECT_EQ(last_msg_->states[15].cn0, 68) + << "incorrect value for states[15].cn0, expected 68, is " + << last_msg_->states[15].cn0; + EXPECT_EQ(last_msg_->states[15].fcn, 42) + << "incorrect value for states[15].fcn, expected 42, is " + << last_msg_->states[15].fcn; + EXPECT_EQ(last_msg_->states[15].sid.code, 21) + << "incorrect value for states[15].sid.code, expected 21, is " + << last_msg_->states[15].sid.code; + EXPECT_EQ(last_msg_->states[15].sid.sat, 193) + << "incorrect value for states[15].sid.sat, expected 193, is " + << last_msg_->states[15].sid.sat; + EXPECT_EQ(last_msg_->states[16].cn0, 227) + << "incorrect value for states[16].cn0, expected 227, is " + << last_msg_->states[16].cn0; + EXPECT_EQ(last_msg_->states[16].fcn, 216) + << "incorrect value for states[16].fcn, expected 216, is " + << last_msg_->states[16].fcn; + EXPECT_EQ(last_msg_->states[16].sid.code, 227) + << "incorrect value for states[16].sid.code, expected 227, is " + << last_msg_->states[16].sid.code; + EXPECT_EQ(last_msg_->states[16].sid.sat, 253) + << "incorrect value for states[16].sid.sat, expected 253, is " + << last_msg_->states[16].sid.sat; + EXPECT_EQ(last_msg_->states[17].cn0, 179) + << "incorrect value for states[17].cn0, expected 179, is " + << last_msg_->states[17].cn0; + EXPECT_EQ(last_msg_->states[17].fcn, 210) + << "incorrect value for states[17].fcn, expected 210, is " + << last_msg_->states[17].fcn; + EXPECT_EQ(last_msg_->states[17].sid.code, 26) + << "incorrect value for states[17].sid.code, expected 26, is " + << last_msg_->states[17].sid.code; + EXPECT_EQ(last_msg_->states[17].sid.sat, 24) + << "incorrect value for states[17].sid.sat, expected 24, is " + << last_msg_->states[17].sid.sat; + EXPECT_EQ(last_msg_->states[18].cn0, 255) + << "incorrect value for states[18].cn0, expected 255, is " + << last_msg_->states[18].cn0; + EXPECT_EQ(last_msg_->states[18].fcn, 227) + << "incorrect value for states[18].fcn, expected 227, is " + << last_msg_->states[18].fcn; + EXPECT_EQ(last_msg_->states[18].sid.code, 15) + << "incorrect value for states[18].sid.code, expected 15, is " + << last_msg_->states[18].sid.code; + EXPECT_EQ(last_msg_->states[18].sid.sat, 19) + << "incorrect value for states[18].sid.sat, expected 19, is " + << last_msg_->states[18].sid.sat; + EXPECT_EQ(last_msg_->states[19].cn0, 200) + << "incorrect value for states[19].cn0, expected 200, is " + << last_msg_->states[19].cn0; + EXPECT_EQ(last_msg_->states[19].fcn, 187) + << "incorrect value for states[19].fcn, expected 187, is " + << last_msg_->states[19].fcn; + EXPECT_EQ(last_msg_->states[19].sid.code, 75) + << "incorrect value for states[19].sid.code, expected 75, is " + << last_msg_->states[19].sid.code; + EXPECT_EQ(last_msg_->states[19].sid.sat, 122) + << "incorrect value for states[19].sid.sat, expected 122, is " + << last_msg_->states[19].sid.sat; + EXPECT_EQ(last_msg_->states[20].cn0, 122) + << "incorrect value for states[20].cn0, expected 122, is " + << last_msg_->states[20].cn0; + EXPECT_EQ(last_msg_->states[20].fcn, 218) + << "incorrect value for states[20].fcn, expected 218, is " + << last_msg_->states[20].fcn; + EXPECT_EQ(last_msg_->states[20].sid.code, 48) + << "incorrect value for states[20].sid.code, expected 48, is " + << last_msg_->states[20].sid.code; + EXPECT_EQ(last_msg_->states[20].sid.sat, 217) + << "incorrect value for states[20].sid.sat, expected 217, is " + << last_msg_->states[20].sid.sat; + EXPECT_EQ(last_msg_->states[21].cn0, 149) + << "incorrect value for states[21].cn0, expected 149, is " + << last_msg_->states[21].cn0; + EXPECT_EQ(last_msg_->states[21].fcn, 142) + << "incorrect value for states[21].fcn, expected 142, is " + << last_msg_->states[21].fcn; + EXPECT_EQ(last_msg_->states[21].sid.code, 238) + << "incorrect value for states[21].sid.code, expected 238, is " + << last_msg_->states[21].sid.code; + EXPECT_EQ(last_msg_->states[21].sid.sat, 187) + << "incorrect value for states[21].sid.sat, expected 187, is " + << last_msg_->states[21].sid.sat; + EXPECT_EQ(last_msg_->states[22].cn0, 212) + << "incorrect value for states[22].cn0, expected 212, is " + << last_msg_->states[22].cn0; + EXPECT_EQ(last_msg_->states[22].fcn, 251) + << "incorrect value for states[22].fcn, expected 251, is " + << last_msg_->states[22].fcn; + EXPECT_EQ(last_msg_->states[22].sid.code, 55) + << "incorrect value for states[22].sid.code, expected 55, is " + << last_msg_->states[22].sid.code; + EXPECT_EQ(last_msg_->states[22].sid.sat, 238) + << "incorrect value for states[22].sid.sat, expected 238, is " + << last_msg_->states[22].sid.sat; + EXPECT_EQ(last_msg_->states[23].cn0, 104) + << "incorrect value for states[23].cn0, expected 104, is " + << last_msg_->states[23].cn0; + EXPECT_EQ(last_msg_->states[23].fcn, 194) + << "incorrect value for states[23].fcn, expected 194, is " + << last_msg_->states[23].fcn; + EXPECT_EQ(last_msg_->states[23].sid.code, 160) + << "incorrect value for states[23].sid.code, expected 160, is " + << last_msg_->states[23].sid.code; + EXPECT_EQ(last_msg_->states[23].sid.sat, 128) + << "incorrect value for states[23].sid.sat, expected 128, is " + << last_msg_->states[23].sid.sat; + EXPECT_EQ(last_msg_->states[24].cn0, 62) + << "incorrect value for states[24].cn0, expected 62, is " + << last_msg_->states[24].cn0; + EXPECT_EQ(last_msg_->states[24].fcn, 141) + << "incorrect value for states[24].fcn, expected 141, is " + << last_msg_->states[24].fcn; + EXPECT_EQ(last_msg_->states[24].sid.code, 255) + << "incorrect value for states[24].sid.code, expected 255, is " + << last_msg_->states[24].sid.code; + EXPECT_EQ(last_msg_->states[24].sid.sat, 113) + << "incorrect value for states[24].sid.sat, expected 113, is " + << last_msg_->states[24].sid.sat; + EXPECT_EQ(last_msg_->states[25].cn0, 39) + << "incorrect value for states[25].cn0, expected 39, is " + << last_msg_->states[25].cn0; + EXPECT_EQ(last_msg_->states[25].fcn, 245) + << "incorrect value for states[25].fcn, expected 245, is " + << last_msg_->states[25].fcn; + EXPECT_EQ(last_msg_->states[25].sid.code, 69) + << "incorrect value for states[25].sid.code, expected 69, is " + << last_msg_->states[25].sid.code; + EXPECT_EQ(last_msg_->states[25].sid.sat, 43) + << "incorrect value for states[25].sid.sat, expected 43, is " + << last_msg_->states[25].sid.sat; + EXPECT_EQ(last_msg_->states[26].cn0, 56) + << "incorrect value for states[26].cn0, expected 56, is " + << last_msg_->states[26].cn0; + EXPECT_EQ(last_msg_->states[26].fcn, 108) + << "incorrect value for states[26].fcn, expected 108, is " + << last_msg_->states[26].fcn; + EXPECT_EQ(last_msg_->states[26].sid.code, 230) + << "incorrect value for states[26].sid.code, expected 230, is " + << last_msg_->states[26].sid.code; + EXPECT_EQ(last_msg_->states[26].sid.sat, 100) + << "incorrect value for states[26].sid.sat, expected 100, is " + << last_msg_->states[26].sid.sat; + EXPECT_EQ(last_msg_->states[27].cn0, 143) + << "incorrect value for states[27].cn0, expected 143, is " + << last_msg_->states[27].cn0; + EXPECT_EQ(last_msg_->states[27].fcn, 149) + << "incorrect value for states[27].fcn, expected 149, is " + << last_msg_->states[27].fcn; + EXPECT_EQ(last_msg_->states[27].sid.code, 68) + << "incorrect value for states[27].sid.code, expected 68, is " + << last_msg_->states[27].sid.code; + EXPECT_EQ(last_msg_->states[27].sid.sat, 247) + << "incorrect value for states[27].sid.sat, expected 247, is " + << last_msg_->states[27].sid.sat; + EXPECT_EQ(last_msg_->states[28].cn0, 70) + << "incorrect value for states[28].cn0, expected 70, is " + << last_msg_->states[28].cn0; + EXPECT_EQ(last_msg_->states[28].fcn, 233) + << "incorrect value for states[28].fcn, expected 233, is " + << last_msg_->states[28].fcn; + EXPECT_EQ(last_msg_->states[28].sid.code, 101) + << "incorrect value for states[28].sid.code, expected 101, is " + << last_msg_->states[28].sid.code; + EXPECT_EQ(last_msg_->states[28].sid.sat, 137) + << "incorrect value for states[28].sid.sat, expected 137, is " + << last_msg_->states[28].sid.sat; + EXPECT_EQ(last_msg_->states[29].cn0, 110) + << "incorrect value for states[29].cn0, expected 110, is " + << last_msg_->states[29].cn0; + EXPECT_EQ(last_msg_->states[29].fcn, 38) + << "incorrect value for states[29].fcn, expected 38, is " + << last_msg_->states[29].fcn; + EXPECT_EQ(last_msg_->states[29].sid.code, 165) + << "incorrect value for states[29].sid.code, expected 165, is " + << last_msg_->states[29].sid.code; + EXPECT_EQ(last_msg_->states[29].sid.sat, 49) + << "incorrect value for states[29].sid.sat, expected 49, is " + << last_msg_->states[29].sid.sat; + EXPECT_EQ(last_msg_->states[30].cn0, 213) + << "incorrect value for states[30].cn0, expected 213, is " + << last_msg_->states[30].cn0; + EXPECT_EQ(last_msg_->states[30].fcn, 80) + << "incorrect value for states[30].fcn, expected 80, is " + << last_msg_->states[30].fcn; + EXPECT_EQ(last_msg_->states[30].sid.code, 230) + << "incorrect value for states[30].sid.code, expected 230, is " + << last_msg_->states[30].sid.code; + EXPECT_EQ(last_msg_->states[30].sid.sat, 218) + << "incorrect value for states[30].sid.sat, expected 218, is " + << last_msg_->states[30].sid.sat; + EXPECT_EQ(last_msg_->states[31].cn0, 128) + << "incorrect value for states[31].cn0, expected 128, is " + << last_msg_->states[31].cn0; + EXPECT_EQ(last_msg_->states[31].fcn, 139) + << "incorrect value for states[31].fcn, expected 139, is " + << last_msg_->states[31].fcn; + EXPECT_EQ(last_msg_->states[31].sid.code, 179) + << "incorrect value for states[31].sid.code, expected 179, is " + << last_msg_->states[31].sid.code; + EXPECT_EQ(last_msg_->states[31].sid.sat, 196) + << "incorrect value for states[31].sid.sat, expected 196, is " + << last_msg_->states[31].sid.sat; + EXPECT_EQ(last_msg_->states[32].cn0, 171) + << "incorrect value for states[32].cn0, expected 171, is " + << last_msg_->states[32].cn0; + EXPECT_EQ(last_msg_->states[32].fcn, 196) + << "incorrect value for states[32].fcn, expected 196, is " + << last_msg_->states[32].fcn; + EXPECT_EQ(last_msg_->states[32].sid.code, 178) + << "incorrect value for states[32].sid.code, expected 178, is " + << last_msg_->states[32].sid.code; + EXPECT_EQ(last_msg_->states[32].sid.sat, 15) + << "incorrect value for states[32].sid.sat, expected 15, is " + << last_msg_->states[32].sid.sat; + EXPECT_EQ(last_msg_->states[33].cn0, 194) + << "incorrect value for states[33].cn0, expected 194, is " + << last_msg_->states[33].cn0; + EXPECT_EQ(last_msg_->states[33].fcn, 97) + << "incorrect value for states[33].fcn, expected 97, is " + << last_msg_->states[33].fcn; + EXPECT_EQ(last_msg_->states[33].sid.code, 212) + << "incorrect value for states[33].sid.code, expected 212, is " + << last_msg_->states[33].sid.code; + EXPECT_EQ(last_msg_->states[33].sid.sat, 8) + << "incorrect value for states[33].sid.sat, expected 8, is " + << last_msg_->states[33].sid.sat; + EXPECT_EQ(last_msg_->states[34].cn0, 99) + << "incorrect value for states[34].cn0, expected 99, is " + << last_msg_->states[34].cn0; + EXPECT_EQ(last_msg_->states[34].fcn, 79) + << "incorrect value for states[34].fcn, expected 79, is " + << last_msg_->states[34].fcn; + EXPECT_EQ(last_msg_->states[34].sid.code, 233) + << "incorrect value for states[34].sid.code, expected 233, is " + << last_msg_->states[34].sid.code; + EXPECT_EQ(last_msg_->states[34].sid.sat, 83) + << "incorrect value for states[34].sid.sat, expected 83, is " + << last_msg_->states[34].sid.sat; + EXPECT_EQ(last_msg_->states[35].cn0, 180) + << "incorrect value for states[35].cn0, expected 180, is " + << last_msg_->states[35].cn0; + EXPECT_EQ(last_msg_->states[35].fcn, 31) + << "incorrect value for states[35].fcn, expected 31, is " + << last_msg_->states[35].fcn; + EXPECT_EQ(last_msg_->states[35].sid.code, 90) + << "incorrect value for states[35].sid.code, expected 90, is " + << last_msg_->states[35].sid.code; + EXPECT_EQ(last_msg_->states[35].sid.sat, 55) + << "incorrect value for states[35].sid.sat, expected 55, is " + << last_msg_->states[35].sid.sat; + EXPECT_EQ(last_msg_->states[36].cn0, 186) + << "incorrect value for states[36].cn0, expected 186, is " + << last_msg_->states[36].cn0; + EXPECT_EQ(last_msg_->states[36].fcn, 105) + << "incorrect value for states[36].fcn, expected 105, is " + << last_msg_->states[36].fcn; + EXPECT_EQ(last_msg_->states[36].sid.code, 25) + << "incorrect value for states[36].sid.code, expected 25, is " + << last_msg_->states[36].sid.code; + EXPECT_EQ(last_msg_->states[36].sid.sat, 5) + << "incorrect value for states[36].sid.sat, expected 5, is " + << last_msg_->states[36].sid.sat; + EXPECT_EQ(last_msg_->states[37].cn0, 111) + << "incorrect value for states[37].cn0, expected 111, is " + << last_msg_->states[37].cn0; + EXPECT_EQ(last_msg_->states[37].fcn, 80) + << "incorrect value for states[37].fcn, expected 80, is " + << last_msg_->states[37].fcn; + EXPECT_EQ(last_msg_->states[37].sid.code, 224) + << "incorrect value for states[37].sid.code, expected 224, is " + << last_msg_->states[37].sid.code; + EXPECT_EQ(last_msg_->states[37].sid.sat, 22) + << "incorrect value for states[37].sid.sat, expected 22, is " + << last_msg_->states[37].sid.sat; + EXPECT_EQ(last_msg_->states[38].cn0, 166) + << "incorrect value for states[38].cn0, expected 166, is " + << last_msg_->states[38].cn0; + EXPECT_EQ(last_msg_->states[38].fcn, 106) + << "incorrect value for states[38].fcn, expected 106, is " + << last_msg_->states[38].fcn; + EXPECT_EQ(last_msg_->states[38].sid.code, 48) + << "incorrect value for states[38].sid.code, expected 48, is " + << last_msg_->states[38].sid.code; + EXPECT_EQ(last_msg_->states[38].sid.sat, 8) + << "incorrect value for states[38].sid.sat, expected 8, is " + << last_msg_->states[38].sid.sat; + EXPECT_EQ(last_msg_->states[39].cn0, 49) + << "incorrect value for states[39].cn0, expected 49, is " + << last_msg_->states[39].cn0; + EXPECT_EQ(last_msg_->states[39].fcn, 156) + << "incorrect value for states[39].fcn, expected 156, is " + << last_msg_->states[39].fcn; + EXPECT_EQ(last_msg_->states[39].sid.code, 48) + << "incorrect value for states[39].sid.code, expected 48, is " + << last_msg_->states[39].sid.code; + EXPECT_EQ(last_msg_->states[39].sid.sat, 4) + << "incorrect value for states[39].sid.sat, expected 4, is " + << last_msg_->states[39].sid.sat; + EXPECT_EQ(last_msg_->states[40].cn0, 146) + << "incorrect value for states[40].cn0, expected 146, is " + << last_msg_->states[40].cn0; + EXPECT_EQ(last_msg_->states[40].fcn, 142) + << "incorrect value for states[40].fcn, expected 142, is " + << last_msg_->states[40].fcn; + EXPECT_EQ(last_msg_->states[40].sid.code, 19) + << "incorrect value for states[40].sid.code, expected 19, is " + << last_msg_->states[40].sid.code; + EXPECT_EQ(last_msg_->states[40].sid.sat, 86) + << "incorrect value for states[40].sid.sat, expected 86, is " + << last_msg_->states[40].sid.sat; + EXPECT_EQ(last_msg_->states[41].cn0, 64) + << "incorrect value for states[41].cn0, expected 64, is " + << last_msg_->states[41].cn0; + EXPECT_EQ(last_msg_->states[41].fcn, 115) + << "incorrect value for states[41].fcn, expected 115, is " + << last_msg_->states[41].fcn; + EXPECT_EQ(last_msg_->states[41].sid.code, 124) + << "incorrect value for states[41].sid.code, expected 124, is " + << last_msg_->states[41].sid.code; + EXPECT_EQ(last_msg_->states[41].sid.sat, 91) + << "incorrect value for states[41].sid.sat, expected 91, is " + << last_msg_->states[41].sid.sat; + EXPECT_EQ(last_msg_->states[42].cn0, 178) + << "incorrect value for states[42].cn0, expected 178, is " + << last_msg_->states[42].cn0; + EXPECT_EQ(last_msg_->states[42].fcn, 115) + << "incorrect value for states[42].fcn, expected 115, is " + << last_msg_->states[42].fcn; + EXPECT_EQ(last_msg_->states[42].sid.code, 230) + << "incorrect value for states[42].sid.code, expected 230, is " + << last_msg_->states[42].sid.code; + EXPECT_EQ(last_msg_->states[42].sid.sat, 28) + << "incorrect value for states[42].sid.sat, expected 28, is " + << last_msg_->states[42].sid.sat; + EXPECT_EQ(last_msg_->states[43].cn0, 242) + << "incorrect value for states[43].cn0, expected 242, is " + << last_msg_->states[43].cn0; + EXPECT_EQ(last_msg_->states[43].fcn, 16) + << "incorrect value for states[43].fcn, expected 16, is " + << last_msg_->states[43].fcn; + EXPECT_EQ(last_msg_->states[43].sid.code, 131) + << "incorrect value for states[43].sid.code, expected 131, is " + << last_msg_->states[43].sid.code; + EXPECT_EQ(last_msg_->states[43].sid.sat, 190) + << "incorrect value for states[43].sid.sat, expected 190, is " + << last_msg_->states[43].sid.sat; + EXPECT_EQ(last_msg_->states[44].cn0, 113) + << "incorrect value for states[44].cn0, expected 113, is " + << last_msg_->states[44].cn0; + EXPECT_EQ(last_msg_->states[44].fcn, 182) + << "incorrect value for states[44].fcn, expected 182, is " + << last_msg_->states[44].fcn; + EXPECT_EQ(last_msg_->states[44].sid.code, 59) + << "incorrect value for states[44].sid.code, expected 59, is " + << last_msg_->states[44].sid.code; + EXPECT_EQ(last_msg_->states[44].sid.sat, 105) + << "incorrect value for states[44].sid.sat, expected 105, is " + << last_msg_->states[44].sid.sat; + EXPECT_EQ(last_msg_->states[45].cn0, 179) + << "incorrect value for states[45].cn0, expected 179, is " + << last_msg_->states[45].cn0; + EXPECT_EQ(last_msg_->states[45].fcn, 48) + << "incorrect value for states[45].fcn, expected 48, is " + << last_msg_->states[45].fcn; + EXPECT_EQ(last_msg_->states[45].sid.code, 180) + << "incorrect value for states[45].sid.code, expected 180, is " + << last_msg_->states[45].sid.code; + EXPECT_EQ(last_msg_->states[45].sid.sat, 192) + << "incorrect value for states[45].sid.sat, expected 192, is " + << last_msg_->states[45].sid.sat; + EXPECT_EQ(last_msg_->states[46].cn0, 211) + << "incorrect value for states[46].cn0, expected 211, is " + << last_msg_->states[46].cn0; + EXPECT_EQ(last_msg_->states[46].fcn, 172) + << "incorrect value for states[46].fcn, expected 172, is " + << last_msg_->states[46].fcn; + EXPECT_EQ(last_msg_->states[46].sid.code, 31) + << "incorrect value for states[46].sid.code, expected 31, is " + << last_msg_->states[46].sid.code; + EXPECT_EQ(last_msg_->states[46].sid.sat, 166) + << "incorrect value for states[46].sid.sat, expected 166, is " + << last_msg_->states[46].sid.sat; + EXPECT_EQ(last_msg_->states[47].cn0, 49) + << "incorrect value for states[47].cn0, expected 49, is " + << last_msg_->states[47].cn0; + EXPECT_EQ(last_msg_->states[47].fcn, 140) + << "incorrect value for states[47].fcn, expected 140, is " + << last_msg_->states[47].fcn; + EXPECT_EQ(last_msg_->states[47].sid.code, 228) + << "incorrect value for states[47].sid.code, expected 228, is " + << last_msg_->states[47].sid.code; + EXPECT_EQ(last_msg_->states[47].sid.sat, 77) + << "incorrect value for states[47].sid.sat, expected 77, is " + << last_msg_->states[47].sid.sat; + EXPECT_EQ(last_msg_->states[48].cn0, 194) + << "incorrect value for states[48].cn0, expected 194, is " + << last_msg_->states[48].cn0; + EXPECT_EQ(last_msg_->states[48].fcn, 240) + << "incorrect value for states[48].fcn, expected 240, is " + << last_msg_->states[48].fcn; + EXPECT_EQ(last_msg_->states[48].sid.code, 77) + << "incorrect value for states[48].sid.code, expected 77, is " + << last_msg_->states[48].sid.code; + EXPECT_EQ(last_msg_->states[48].sid.sat, 128) + << "incorrect value for states[48].sid.sat, expected 128, is " + << last_msg_->states[48].sid.sat; + EXPECT_EQ(last_msg_->states[49].cn0, 58) + << "incorrect value for states[49].cn0, expected 58, is " + << last_msg_->states[49].cn0; + EXPECT_EQ(last_msg_->states[49].fcn, 41) + << "incorrect value for states[49].fcn, expected 41, is " + << last_msg_->states[49].fcn; + EXPECT_EQ(last_msg_->states[49].sid.code, 194) + << "incorrect value for states[49].sid.code, expected 194, is " + << last_msg_->states[49].sid.code; + EXPECT_EQ(last_msg_->states[49].sid.sat, 134) + << "incorrect value for states[49].sid.sat, expected 134, is " + << last_msg_->states[49].sid.sat; + EXPECT_EQ(last_msg_->states[50].cn0, 55) + << "incorrect value for states[50].cn0, expected 55, is " + << last_msg_->states[50].cn0; + EXPECT_EQ(last_msg_->states[50].fcn, 129) + << "incorrect value for states[50].fcn, expected 129, is " + << last_msg_->states[50].fcn; + EXPECT_EQ(last_msg_->states[50].sid.code, 53) + << "incorrect value for states[50].sid.code, expected 53, is " + << last_msg_->states[50].sid.code; + EXPECT_EQ(last_msg_->states[50].sid.sat, 18) + << "incorrect value for states[50].sid.sat, expected 18, is " + << last_msg_->states[50].sid.sat; + EXPECT_EQ(last_msg_->states[51].cn0, 92) + << "incorrect value for states[51].cn0, expected 92, is " + << last_msg_->states[51].cn0; + EXPECT_EQ(last_msg_->states[51].fcn, 134) + << "incorrect value for states[51].fcn, expected 134, is " + << last_msg_->states[51].fcn; + EXPECT_EQ(last_msg_->states[51].sid.code, 72) + << "incorrect value for states[51].sid.code, expected 72, is " + << last_msg_->states[51].sid.code; + EXPECT_EQ(last_msg_->states[51].sid.sat, 91) + << "incorrect value for states[51].sid.sat, expected 91, is " + << last_msg_->states[51].sid.sat; + EXPECT_EQ(last_msg_->states[52].cn0, 56) + << "incorrect value for states[52].cn0, expected 56, is " + << last_msg_->states[52].cn0; + EXPECT_EQ(last_msg_->states[52].fcn, 157) + << "incorrect value for states[52].fcn, expected 157, is " + << last_msg_->states[52].fcn; + EXPECT_EQ(last_msg_->states[52].sid.code, 224) + << "incorrect value for states[52].sid.code, expected 224, is " + << last_msg_->states[52].sid.code; + EXPECT_EQ(last_msg_->states[52].sid.sat, 33) + << "incorrect value for states[52].sid.sat, expected 33, is " + << last_msg_->states[52].sid.sat; + EXPECT_EQ(last_msg_->states[53].cn0, 174) + << "incorrect value for states[53].cn0, expected 174, is " + << last_msg_->states[53].cn0; + EXPECT_EQ(last_msg_->states[53].fcn, 224) + << "incorrect value for states[53].fcn, expected 224, is " + << last_msg_->states[53].fcn; + EXPECT_EQ(last_msg_->states[53].sid.code, 54) + << "incorrect value for states[53].sid.code, expected 54, is " + << last_msg_->states[53].sid.code; + EXPECT_EQ(last_msg_->states[53].sid.sat, 186) + << "incorrect value for states[53].sid.sat, expected 186, is " + << last_msg_->states[53].sid.sat; + EXPECT_EQ(last_msg_->states[54].cn0, 190) + << "incorrect value for states[54].cn0, expected 190, is " + << last_msg_->states[54].cn0; + EXPECT_EQ(last_msg_->states[54].fcn, 148) + << "incorrect value for states[54].fcn, expected 148, is " + << last_msg_->states[54].fcn; + EXPECT_EQ(last_msg_->states[54].sid.code, 84) + << "incorrect value for states[54].sid.code, expected 84, is " + << last_msg_->states[54].sid.code; + EXPECT_EQ(last_msg_->states[54].sid.sat, 82) + << "incorrect value for states[54].sid.sat, expected 82, is " + << last_msg_->states[54].sid.sat; + EXPECT_EQ(last_msg_->states[55].cn0, 67) + << "incorrect value for states[55].cn0, expected 67, is " + << last_msg_->states[55].cn0; + EXPECT_EQ(last_msg_->states[55].fcn, 62) + << "incorrect value for states[55].fcn, expected 62, is " + << last_msg_->states[55].fcn; + EXPECT_EQ(last_msg_->states[55].sid.code, 54) + << "incorrect value for states[55].sid.code, expected 54, is " + << last_msg_->states[55].sid.code; + EXPECT_EQ(last_msg_->states[55].sid.sat, 236) + << "incorrect value for states[55].sid.sat, expected 236, is " + << last_msg_->states[55].sid.sat; + EXPECT_EQ(last_msg_->states[56].cn0, 254) + << "incorrect value for states[56].cn0, expected 254, is " + << last_msg_->states[56].cn0; + EXPECT_EQ(last_msg_->states[56].fcn, 57) + << "incorrect value for states[56].fcn, expected 57, is " + << last_msg_->states[56].fcn; + EXPECT_EQ(last_msg_->states[56].sid.code, 215) + << "incorrect value for states[56].sid.code, expected 215, is " + << last_msg_->states[56].sid.code; + EXPECT_EQ(last_msg_->states[56].sid.sat, 52) + << "incorrect value for states[56].sid.sat, expected 52, is " + << last_msg_->states[56].sid.sat; + EXPECT_EQ(last_msg_->states[57].cn0, 174) + << "incorrect value for states[57].cn0, expected 174, is " + << last_msg_->states[57].cn0; + EXPECT_EQ(last_msg_->states[57].fcn, 36) + << "incorrect value for states[57].fcn, expected 36, is " + << last_msg_->states[57].fcn; + EXPECT_EQ(last_msg_->states[57].sid.code, 133) + << "incorrect value for states[57].sid.code, expected 133, is " + << last_msg_->states[57].sid.code; + EXPECT_EQ(last_msg_->states[57].sid.sat, 16) + << "incorrect value for states[57].sid.sat, expected 16, is " + << last_msg_->states[57].sid.sat; + EXPECT_EQ(last_msg_->states[58].cn0, 17) + << "incorrect value for states[58].cn0, expected 17, is " + << last_msg_->states[58].cn0; + EXPECT_EQ(last_msg_->states[58].fcn, 145) + << "incorrect value for states[58].fcn, expected 145, is " + << last_msg_->states[58].fcn; + EXPECT_EQ(last_msg_->states[58].sid.code, 172) + << "incorrect value for states[58].sid.code, expected 172, is " + << last_msg_->states[58].sid.code; + EXPECT_EQ(last_msg_->states[58].sid.sat, 219) + << "incorrect value for states[58].sid.sat, expected 219, is " + << last_msg_->states[58].sid.sat; + EXPECT_EQ(last_msg_->states[59].cn0, 97) + << "incorrect value for states[59].cn0, expected 97, is " + << last_msg_->states[59].cn0; + EXPECT_EQ(last_msg_->states[59].fcn, 111) + << "incorrect value for states[59].fcn, expected 111, is " + << last_msg_->states[59].fcn; + EXPECT_EQ(last_msg_->states[59].sid.code, 179) + << "incorrect value for states[59].sid.code, expected 179, is " + << last_msg_->states[59].sid.code; + EXPECT_EQ(last_msg_->states[59].sid.sat, 192) + << "incorrect value for states[59].sid.sat, expected 192, is " + << last_msg_->states[59].sid.sat; + EXPECT_EQ(last_msg_->states[60].cn0, 134) + << "incorrect value for states[60].cn0, expected 134, is " + << last_msg_->states[60].cn0; + EXPECT_EQ(last_msg_->states[60].fcn, 208) + << "incorrect value for states[60].fcn, expected 208, is " + << last_msg_->states[60].fcn; + EXPECT_EQ(last_msg_->states[60].sid.code, 56) + << "incorrect value for states[60].sid.code, expected 56, is " + << last_msg_->states[60].sid.code; + EXPECT_EQ(last_msg_->states[60].sid.sat, 207) + << "incorrect value for states[60].sid.sat, expected 207, is " + << last_msg_->states[60].sid.sat; + EXPECT_EQ(last_msg_->states[61].cn0, 226) + << "incorrect value for states[61].cn0, expected 226, is " + << last_msg_->states[61].cn0; + EXPECT_EQ(last_msg_->states[61].fcn, 43) + << "incorrect value for states[61].fcn, expected 43, is " + << last_msg_->states[61].fcn; + EXPECT_EQ(last_msg_->states[61].sid.code, 17) + << "incorrect value for states[61].sid.code, expected 17, is " + << last_msg_->states[61].sid.code; + EXPECT_EQ(last_msg_->states[61].sid.sat, 180) + << "incorrect value for states[61].sid.sat, expected 180, is " + << last_msg_->states[61].sid.sat; + EXPECT_EQ(last_msg_->states[62].cn0, 113) + << "incorrect value for states[62].cn0, expected 113, is " + << last_msg_->states[62].cn0; + EXPECT_EQ(last_msg_->states[62].fcn, 140) + << "incorrect value for states[62].fcn, expected 140, is " + << last_msg_->states[62].fcn; + EXPECT_EQ(last_msg_->states[62].sid.code, 182) + << "incorrect value for states[62].sid.code, expected 182, is " + << last_msg_->states[62].sid.code; + EXPECT_EQ(last_msg_->states[62].sid.sat, 255) + << "incorrect value for states[62].sid.sat, expected 255, is " + << last_msg_->states[62].sid.sat; } diff --git a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingStateDepB.cc b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingStateDepB.cc index dc733a6d3..012bcd7cf 100644 --- a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingStateDepB.cc +++ b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingStateDepB.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDepB.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDepB.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_state_dep_b_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_state_dep_b_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,425 +82,723 @@ class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_state_dep_b_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 19, 0, 242, 241, 252, 115, 183, 227, 63, 68, 154, 1, 183, 69, + 255, 175, 121, 43, 222, 51, 67, 35, 69, 78, 240, 5, 53, 20, 51, + 211, 54, 69, 153, 130, 237, 66, 155, 51, 227, 71, 69, 53, 242, 136, + 161, 190, 205, 188, 6, 70, 153, 125, 255, 142, 149, 154, 217, 184, 69, + 248, 102, 95, 31, 76, 154, 33, 169, 69, 131, 115, 141, 27, 12, 154, + 225, 200, 69, 208, 44, 147, 39, 23, 51, 3, 66, 69, 237, 159, 251, + 49, 203, 51, 99, 102, 69, 70, 214, 87, 128, 206, 154, 121, 186, 69, + 14, 206, 111, 218, 19, 154, 121, 169, 69, 216, 98, 209, 54, 2, 154, + 25, 219, 67, 200, 133, 99, 7, 34, 102, 198, 232, 68, 155, 43, 85, + 135, 46, 154, 177, 170, 69, 155, 3, 83, 171, 201, 154, 241, 232, 69, + 121, 43, 197, 16, 19, 154, 241, 222, 69, 128, 245, 53, 63, 176, 51, + 115, 66, 69, 36, 20, 61, 153, 51, 154, 73, 134, 69, 46, 82, 116, + 140, 22, 51, 147, 37, 69, 177, 67, 146, 96, 143, 205, 76, 107, 68, + 220, 51, 160, 201, 251, 102, 102, 192, 68, 168, 194, 2, 161, 220, 102, + 102, 180, 68, 69, 8, 9, 125, 178, 102, 70, 134, 68, 185, 20, 135, + 186, 171, 51, 163, 4, 69, 18, 124, 155, 85, 170, 205, 208, 13, 70, + 57, 244, 206, 255, 186, 154, 105, 149, 69, 165, 199, 93, 181, 175, 51, + 67, 64, 69, 6, 28, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_state_dep_b_t *test_msg = + (msg_tracking_state_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[0].cn0 = 5856.2001953125; + test_msg->states[0].sid.code = 63; + test_msg->states[0].sid.reserved = 68; + test_msg->states[0].sid.sat = 58295; + test_msg->states[0].state = 115; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[1].cn0 = 2612.199951171875; + test_msg->states[1].sid.code = 43; + test_msg->states[1].sid.reserved = 222; + test_msg->states[1].sid.sat = 31151; + test_msg->states[1].state = 255; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[2].cn0 = 2925.199951171875; + test_msg->states[2].sid.code = 53; + test_msg->states[2].sid.reserved = 20; + test_msg->states[2].sid.sat = 1520; + test_msg->states[2].state = 78; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[3].cn0 = 3198.199951171875; + test_msg->states[3].sid.code = 66; + test_msg->states[3].sid.reserved = 155; + test_msg->states[3].sid.sat = 60802; + test_msg->states[3].state = 153; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[4].cn0 = 8623.2001953125; + test_msg->states[4].sid.code = 161; + test_msg->states[4].sid.reserved = 190; + test_msg->states[4].sid.sat = 35058; + test_msg->states[4].state = 53; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[5].cn0 = 5915.2001953125; + test_msg->states[5].sid.code = 142; + test_msg->states[5].sid.reserved = 149; + test_msg->states[5].sid.sat = 65405; + test_msg->states[5].state = 153; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[6].cn0 = 5412.2001953125; + test_msg->states[6].sid.code = 31; + test_msg->states[6].sid.reserved = 76; + test_msg->states[6].sid.sat = 24422; + test_msg->states[6].state = 248; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[7].cn0 = 6428.2001953125; + test_msg->states[7].sid.code = 27; + test_msg->states[7].sid.reserved = 12; + test_msg->states[7].sid.sat = 36211; + test_msg->states[7].state = 131; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[8].cn0 = 3104.199951171875; + test_msg->states[8].sid.code = 39; + test_msg->states[8].sid.reserved = 23; + test_msg->states[8].sid.sat = 37676; + test_msg->states[8].state = 208; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[9].cn0 = 3686.199951171875; + test_msg->states[9].sid.code = 49; + test_msg->states[9].sid.reserved = 203; + test_msg->states[9].sid.sat = 64415; + test_msg->states[9].state = 237; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[10].cn0 = 5967.2001953125; + test_msg->states[10].sid.code = 128; + test_msg->states[10].sid.reserved = 206; + test_msg->states[10].sid.sat = 22486; + test_msg->states[10].state = 70; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[11].cn0 = 5423.2001953125; + test_msg->states[11].sid.code = 218; + test_msg->states[11].sid.reserved = 19; + test_msg->states[11].sid.sat = 28622; + test_msg->states[11].state = 14; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[12].cn0 = 438.20001220703125; + test_msg->states[12].sid.code = 54; + test_msg->states[12].sid.reserved = 2; + test_msg->states[12].sid.sat = 53602; + test_msg->states[12].state = 216; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[13].cn0 = 1862.199951171875; + test_msg->states[13].sid.code = 7; + test_msg->states[13].sid.reserved = 34; + test_msg->states[13].sid.sat = 25477; + test_msg->states[13].state = 200; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[14].cn0 = 5462.2001953125; + test_msg->states[14].sid.code = 135; + test_msg->states[14].sid.reserved = 46; + test_msg->states[14].sid.sat = 21803; + test_msg->states[14].state = 155; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[15].cn0 = 7454.2001953125; + test_msg->states[15].sid.code = 171; + test_msg->states[15].sid.reserved = 201; + test_msg->states[15].sid.sat = 21251; + test_msg->states[15].state = 155; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[16].cn0 = 7134.2001953125; + test_msg->states[16].sid.code = 16; + test_msg->states[16].sid.reserved = 19; + test_msg->states[16].sid.sat = 50475; + test_msg->states[16].state = 121; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[17].cn0 = 3111.199951171875; + test_msg->states[17].sid.code = 63; + test_msg->states[17].sid.reserved = 176; + test_msg->states[17].sid.sat = 13813; + test_msg->states[17].state = 128; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[18].cn0 = 4297.2001953125; + test_msg->states[18].sid.code = 153; + test_msg->states[18].sid.reserved = 51; + test_msg->states[18].sid.sat = 15636; + test_msg->states[18].state = 36; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[19].cn0 = 2649.199951171875; + test_msg->states[19].sid.code = 140; + test_msg->states[19].sid.reserved = 22; + test_msg->states[19].sid.sat = 29778; + test_msg->states[19].state = 46; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[20].cn0 = 941.2000122070312; + test_msg->states[20].sid.code = 96; + test_msg->states[20].sid.reserved = 143; + test_msg->states[20].sid.sat = 37443; + test_msg->states[20].state = 177; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[21].cn0 = 1539.199951171875; + test_msg->states[21].sid.code = 201; + test_msg->states[21].sid.reserved = 251; + test_msg->states[21].sid.sat = 41011; + test_msg->states[21].state = 220; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[22].cn0 = 1443.199951171875; + test_msg->states[22].sid.code = 161; + test_msg->states[22].sid.reserved = 220; + test_msg->states[22].sid.sat = 706; + test_msg->states[22].state = 168; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[23].cn0 = 1074.199951171875; + test_msg->states[23].sid.code = 125; + test_msg->states[23].sid.reserved = 178; + test_msg->states[23].sid.sat = 2312; + test_msg->states[23].state = 69; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[24].cn0 = 2122.199951171875; + test_msg->states[24].sid.code = 186; + test_msg->states[24].sid.reserved = 171; + test_msg->states[24].sid.sat = 34580; + test_msg->states[24].state = 185; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[25].cn0 = 9076.2001953125; + test_msg->states[25].sid.code = 85; + test_msg->states[25].sid.reserved = 170; + test_msg->states[25].sid.sat = 39804; + test_msg->states[25].state = 18; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[26].cn0 = 4781.2001953125; + test_msg->states[26].sid.code = 255; + test_msg->states[26].sid.reserved = 186; + test_msg->states[26].sid.sat = 52980; + test_msg->states[26].state = 57; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[27].cn0 = 3076.199951171875; + test_msg->states[27].sid.code = 181; + test_msg->states[27].sid.reserved = 175; + test_msg->states[27].sid.sat = 24007; + test_msg->states[27].state = 165; - uint8_t encoded_frame[] = {85,19,0,242,241,252,115,183,227,63,68,154,1,183,69,255,175,121,43,222,51,67,35,69,78,240,5,53,20,51,211,54,69,153,130,237,66,155,51,227,71,69,53,242,136,161,190,205,188,6,70,153,125,255,142,149,154,217,184,69,248,102,95,31,76,154,33,169,69,131,115,141,27,12,154,225,200,69,208,44,147,39,23,51,3,66,69,237,159,251,49,203,51,99,102,69,70,214,87,128,206,154,121,186,69,14,206,111,218,19,154,121,169,69,216,98,209,54,2,154,25,219,67,200,133,99,7,34,102,198,232,68,155,43,85,135,46,154,177,170,69,155,3,83,171,201,154,241,232,69,121,43,197,16,19,154,241,222,69,128,245,53,63,176,51,115,66,69,36,20,61,153,51,154,73,134,69,46,82,116,140,22,51,147,37,69,177,67,146,96,143,205,76,107,68,220,51,160,201,251,102,102,192,68,168,194,2,161,220,102,102,180,68,69,8,9,125,178,102,70,134,68,185,20,135,186,171,51,163,4,69,18,124,155,85,170,205,208,13,70,57,244,206,255,186,154,105,149,69,165,199,93,181,175,51,67,64,69,6,28, }; + EXPECT_EQ(send_message(0x13, 61938, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_state_dep_b_t* test_msg = ( msg_tracking_state_dep_b_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[0].cn0 = 5856.2001953125; - test_msg->states[0].sid.code = 63; - test_msg->states[0].sid.reserved = 68; - test_msg->states[0].sid.sat = 58295; - test_msg->states[0].state = 115; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[1].cn0 = 2612.199951171875; - test_msg->states[1].sid.code = 43; - test_msg->states[1].sid.reserved = 222; - test_msg->states[1].sid.sat = 31151; - test_msg->states[1].state = 255; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[2].cn0 = 2925.199951171875; - test_msg->states[2].sid.code = 53; - test_msg->states[2].sid.reserved = 20; - test_msg->states[2].sid.sat = 1520; - test_msg->states[2].state = 78; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[3].cn0 = 3198.199951171875; - test_msg->states[3].sid.code = 66; - test_msg->states[3].sid.reserved = 155; - test_msg->states[3].sid.sat = 60802; - test_msg->states[3].state = 153; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[4].cn0 = 8623.2001953125; - test_msg->states[4].sid.code = 161; - test_msg->states[4].sid.reserved = 190; - test_msg->states[4].sid.sat = 35058; - test_msg->states[4].state = 53; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[5].cn0 = 5915.2001953125; - test_msg->states[5].sid.code = 142; - test_msg->states[5].sid.reserved = 149; - test_msg->states[5].sid.sat = 65405; - test_msg->states[5].state = 153; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[6].cn0 = 5412.2001953125; - test_msg->states[6].sid.code = 31; - test_msg->states[6].sid.reserved = 76; - test_msg->states[6].sid.sat = 24422; - test_msg->states[6].state = 248; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[7].cn0 = 6428.2001953125; - test_msg->states[7].sid.code = 27; - test_msg->states[7].sid.reserved = 12; - test_msg->states[7].sid.sat = 36211; - test_msg->states[7].state = 131; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[8].cn0 = 3104.199951171875; - test_msg->states[8].sid.code = 39; - test_msg->states[8].sid.reserved = 23; - test_msg->states[8].sid.sat = 37676; - test_msg->states[8].state = 208; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[9].cn0 = 3686.199951171875; - test_msg->states[9].sid.code = 49; - test_msg->states[9].sid.reserved = 203; - test_msg->states[9].sid.sat = 64415; - test_msg->states[9].state = 237; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[10].cn0 = 5967.2001953125; - test_msg->states[10].sid.code = 128; - test_msg->states[10].sid.reserved = 206; - test_msg->states[10].sid.sat = 22486; - test_msg->states[10].state = 70; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[11].cn0 = 5423.2001953125; - test_msg->states[11].sid.code = 218; - test_msg->states[11].sid.reserved = 19; - test_msg->states[11].sid.sat = 28622; - test_msg->states[11].state = 14; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[12].cn0 = 438.20001220703125; - test_msg->states[12].sid.code = 54; - test_msg->states[12].sid.reserved = 2; - test_msg->states[12].sid.sat = 53602; - test_msg->states[12].state = 216; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[13].cn0 = 1862.199951171875; - test_msg->states[13].sid.code = 7; - test_msg->states[13].sid.reserved = 34; - test_msg->states[13].sid.sat = 25477; - test_msg->states[13].state = 200; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[14].cn0 = 5462.2001953125; - test_msg->states[14].sid.code = 135; - test_msg->states[14].sid.reserved = 46; - test_msg->states[14].sid.sat = 21803; - test_msg->states[14].state = 155; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[15].cn0 = 7454.2001953125; - test_msg->states[15].sid.code = 171; - test_msg->states[15].sid.reserved = 201; - test_msg->states[15].sid.sat = 21251; - test_msg->states[15].state = 155; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[16].cn0 = 7134.2001953125; - test_msg->states[16].sid.code = 16; - test_msg->states[16].sid.reserved = 19; - test_msg->states[16].sid.sat = 50475; - test_msg->states[16].state = 121; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[17].cn0 = 3111.199951171875; - test_msg->states[17].sid.code = 63; - test_msg->states[17].sid.reserved = 176; - test_msg->states[17].sid.sat = 13813; - test_msg->states[17].state = 128; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[18].cn0 = 4297.2001953125; - test_msg->states[18].sid.code = 153; - test_msg->states[18].sid.reserved = 51; - test_msg->states[18].sid.sat = 15636; - test_msg->states[18].state = 36; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[19].cn0 = 2649.199951171875; - test_msg->states[19].sid.code = 140; - test_msg->states[19].sid.reserved = 22; - test_msg->states[19].sid.sat = 29778; - test_msg->states[19].state = 46; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[20].cn0 = 941.2000122070312; - test_msg->states[20].sid.code = 96; - test_msg->states[20].sid.reserved = 143; - test_msg->states[20].sid.sat = 37443; - test_msg->states[20].state = 177; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[21].cn0 = 1539.199951171875; - test_msg->states[21].sid.code = 201; - test_msg->states[21].sid.reserved = 251; - test_msg->states[21].sid.sat = 41011; - test_msg->states[21].state = 220; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[22].cn0 = 1443.199951171875; - test_msg->states[22].sid.code = 161; - test_msg->states[22].sid.reserved = 220; - test_msg->states[22].sid.sat = 706; - test_msg->states[22].state = 168; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[23].cn0 = 1074.199951171875; - test_msg->states[23].sid.code = 125; - test_msg->states[23].sid.reserved = 178; - test_msg->states[23].sid.sat = 2312; - test_msg->states[23].state = 69; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[24].cn0 = 2122.199951171875; - test_msg->states[24].sid.code = 186; - test_msg->states[24].sid.reserved = 171; - test_msg->states[24].sid.sat = 34580; - test_msg->states[24].state = 185; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[25].cn0 = 9076.2001953125; - test_msg->states[25].sid.code = 85; - test_msg->states[25].sid.reserved = 170; - test_msg->states[25].sid.sat = 39804; - test_msg->states[25].state = 18; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[26].cn0 = 4781.2001953125; - test_msg->states[26].sid.code = 255; - test_msg->states[26].sid.reserved = 186; - test_msg->states[26].sid.sat = 52980; - test_msg->states[26].state = 57; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[27].cn0 = 3076.199951171875; - test_msg->states[27].sid.code = 181; - test_msg->states[27].sid.reserved = 175; - test_msg->states[27].sid.sat = 24007; - test_msg->states[27].state = 165; - - EXPECT_EQ(send_message( 0x13, 61938, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 61938); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->states[0].cn0*100 - 5856.20019531*100), 0.05) << "incorrect value for states[0].cn0, expected 5856.20019531, is " << last_msg_->states[0].cn0; - EXPECT_EQ(last_msg_->states[0].sid.code, 63) << "incorrect value for states[0].sid.code, expected 63, is " << last_msg_->states[0].sid.code; - EXPECT_EQ(last_msg_->states[0].sid.reserved, 68) << "incorrect value for states[0].sid.reserved, expected 68, is " << last_msg_->states[0].sid.reserved; - EXPECT_EQ(last_msg_->states[0].sid.sat, 58295) << "incorrect value for states[0].sid.sat, expected 58295, is " << last_msg_->states[0].sid.sat; - EXPECT_EQ(last_msg_->states[0].state, 115) << "incorrect value for states[0].state, expected 115, is " << last_msg_->states[0].state; - EXPECT_LT((last_msg_->states[1].cn0*100 - 2612.19995117*100), 0.05) << "incorrect value for states[1].cn0, expected 2612.19995117, is " << last_msg_->states[1].cn0; - EXPECT_EQ(last_msg_->states[1].sid.code, 43) << "incorrect value for states[1].sid.code, expected 43, is " << last_msg_->states[1].sid.code; - EXPECT_EQ(last_msg_->states[1].sid.reserved, 222) << "incorrect value for states[1].sid.reserved, expected 222, is " << last_msg_->states[1].sid.reserved; - EXPECT_EQ(last_msg_->states[1].sid.sat, 31151) << "incorrect value for states[1].sid.sat, expected 31151, is " << last_msg_->states[1].sid.sat; - EXPECT_EQ(last_msg_->states[1].state, 255) << "incorrect value for states[1].state, expected 255, is " << last_msg_->states[1].state; - EXPECT_LT((last_msg_->states[2].cn0*100 - 2925.19995117*100), 0.05) << "incorrect value for states[2].cn0, expected 2925.19995117, is " << last_msg_->states[2].cn0; - EXPECT_EQ(last_msg_->states[2].sid.code, 53) << "incorrect value for states[2].sid.code, expected 53, is " << last_msg_->states[2].sid.code; - EXPECT_EQ(last_msg_->states[2].sid.reserved, 20) << "incorrect value for states[2].sid.reserved, expected 20, is " << last_msg_->states[2].sid.reserved; - EXPECT_EQ(last_msg_->states[2].sid.sat, 1520) << "incorrect value for states[2].sid.sat, expected 1520, is " << last_msg_->states[2].sid.sat; - EXPECT_EQ(last_msg_->states[2].state, 78) << "incorrect value for states[2].state, expected 78, is " << last_msg_->states[2].state; - EXPECT_LT((last_msg_->states[3].cn0*100 - 3198.19995117*100), 0.05) << "incorrect value for states[3].cn0, expected 3198.19995117, is " << last_msg_->states[3].cn0; - EXPECT_EQ(last_msg_->states[3].sid.code, 66) << "incorrect value for states[3].sid.code, expected 66, is " << last_msg_->states[3].sid.code; - EXPECT_EQ(last_msg_->states[3].sid.reserved, 155) << "incorrect value for states[3].sid.reserved, expected 155, is " << last_msg_->states[3].sid.reserved; - EXPECT_EQ(last_msg_->states[3].sid.sat, 60802) << "incorrect value for states[3].sid.sat, expected 60802, is " << last_msg_->states[3].sid.sat; - EXPECT_EQ(last_msg_->states[3].state, 153) << "incorrect value for states[3].state, expected 153, is " << last_msg_->states[3].state; - EXPECT_LT((last_msg_->states[4].cn0*100 - 8623.20019531*100), 0.05) << "incorrect value for states[4].cn0, expected 8623.20019531, is " << last_msg_->states[4].cn0; - EXPECT_EQ(last_msg_->states[4].sid.code, 161) << "incorrect value for states[4].sid.code, expected 161, is " << last_msg_->states[4].sid.code; - EXPECT_EQ(last_msg_->states[4].sid.reserved, 190) << "incorrect value for states[4].sid.reserved, expected 190, is " << last_msg_->states[4].sid.reserved; - EXPECT_EQ(last_msg_->states[4].sid.sat, 35058) << "incorrect value for states[4].sid.sat, expected 35058, is " << last_msg_->states[4].sid.sat; - EXPECT_EQ(last_msg_->states[4].state, 53) << "incorrect value for states[4].state, expected 53, is " << last_msg_->states[4].state; - EXPECT_LT((last_msg_->states[5].cn0*100 - 5915.20019531*100), 0.05) << "incorrect value for states[5].cn0, expected 5915.20019531, is " << last_msg_->states[5].cn0; - EXPECT_EQ(last_msg_->states[5].sid.code, 142) << "incorrect value for states[5].sid.code, expected 142, is " << last_msg_->states[5].sid.code; - EXPECT_EQ(last_msg_->states[5].sid.reserved, 149) << "incorrect value for states[5].sid.reserved, expected 149, is " << last_msg_->states[5].sid.reserved; - EXPECT_EQ(last_msg_->states[5].sid.sat, 65405) << "incorrect value for states[5].sid.sat, expected 65405, is " << last_msg_->states[5].sid.sat; - EXPECT_EQ(last_msg_->states[5].state, 153) << "incorrect value for states[5].state, expected 153, is " << last_msg_->states[5].state; - EXPECT_LT((last_msg_->states[6].cn0*100 - 5412.20019531*100), 0.05) << "incorrect value for states[6].cn0, expected 5412.20019531, is " << last_msg_->states[6].cn0; - EXPECT_EQ(last_msg_->states[6].sid.code, 31) << "incorrect value for states[6].sid.code, expected 31, is " << last_msg_->states[6].sid.code; - EXPECT_EQ(last_msg_->states[6].sid.reserved, 76) << "incorrect value for states[6].sid.reserved, expected 76, is " << last_msg_->states[6].sid.reserved; - EXPECT_EQ(last_msg_->states[6].sid.sat, 24422) << "incorrect value for states[6].sid.sat, expected 24422, is " << last_msg_->states[6].sid.sat; - EXPECT_EQ(last_msg_->states[6].state, 248) << "incorrect value for states[6].state, expected 248, is " << last_msg_->states[6].state; - EXPECT_LT((last_msg_->states[7].cn0*100 - 6428.20019531*100), 0.05) << "incorrect value for states[7].cn0, expected 6428.20019531, is " << last_msg_->states[7].cn0; - EXPECT_EQ(last_msg_->states[7].sid.code, 27) << "incorrect value for states[7].sid.code, expected 27, is " << last_msg_->states[7].sid.code; - EXPECT_EQ(last_msg_->states[7].sid.reserved, 12) << "incorrect value for states[7].sid.reserved, expected 12, is " << last_msg_->states[7].sid.reserved; - EXPECT_EQ(last_msg_->states[7].sid.sat, 36211) << "incorrect value for states[7].sid.sat, expected 36211, is " << last_msg_->states[7].sid.sat; - EXPECT_EQ(last_msg_->states[7].state, 131) << "incorrect value for states[7].state, expected 131, is " << last_msg_->states[7].state; - EXPECT_LT((last_msg_->states[8].cn0*100 - 3104.19995117*100), 0.05) << "incorrect value for states[8].cn0, expected 3104.19995117, is " << last_msg_->states[8].cn0; - EXPECT_EQ(last_msg_->states[8].sid.code, 39) << "incorrect value for states[8].sid.code, expected 39, is " << last_msg_->states[8].sid.code; - EXPECT_EQ(last_msg_->states[8].sid.reserved, 23) << "incorrect value for states[8].sid.reserved, expected 23, is " << last_msg_->states[8].sid.reserved; - EXPECT_EQ(last_msg_->states[8].sid.sat, 37676) << "incorrect value for states[8].sid.sat, expected 37676, is " << last_msg_->states[8].sid.sat; - EXPECT_EQ(last_msg_->states[8].state, 208) << "incorrect value for states[8].state, expected 208, is " << last_msg_->states[8].state; - EXPECT_LT((last_msg_->states[9].cn0*100 - 3686.19995117*100), 0.05) << "incorrect value for states[9].cn0, expected 3686.19995117, is " << last_msg_->states[9].cn0; - EXPECT_EQ(last_msg_->states[9].sid.code, 49) << "incorrect value for states[9].sid.code, expected 49, is " << last_msg_->states[9].sid.code; - EXPECT_EQ(last_msg_->states[9].sid.reserved, 203) << "incorrect value for states[9].sid.reserved, expected 203, is " << last_msg_->states[9].sid.reserved; - EXPECT_EQ(last_msg_->states[9].sid.sat, 64415) << "incorrect value for states[9].sid.sat, expected 64415, is " << last_msg_->states[9].sid.sat; - EXPECT_EQ(last_msg_->states[9].state, 237) << "incorrect value for states[9].state, expected 237, is " << last_msg_->states[9].state; - EXPECT_LT((last_msg_->states[10].cn0*100 - 5967.20019531*100), 0.05) << "incorrect value for states[10].cn0, expected 5967.20019531, is " << last_msg_->states[10].cn0; - EXPECT_EQ(last_msg_->states[10].sid.code, 128) << "incorrect value for states[10].sid.code, expected 128, is " << last_msg_->states[10].sid.code; - EXPECT_EQ(last_msg_->states[10].sid.reserved, 206) << "incorrect value for states[10].sid.reserved, expected 206, is " << last_msg_->states[10].sid.reserved; - EXPECT_EQ(last_msg_->states[10].sid.sat, 22486) << "incorrect value for states[10].sid.sat, expected 22486, is " << last_msg_->states[10].sid.sat; - EXPECT_EQ(last_msg_->states[10].state, 70) << "incorrect value for states[10].state, expected 70, is " << last_msg_->states[10].state; - EXPECT_LT((last_msg_->states[11].cn0*100 - 5423.20019531*100), 0.05) << "incorrect value for states[11].cn0, expected 5423.20019531, is " << last_msg_->states[11].cn0; - EXPECT_EQ(last_msg_->states[11].sid.code, 218) << "incorrect value for states[11].sid.code, expected 218, is " << last_msg_->states[11].sid.code; - EXPECT_EQ(last_msg_->states[11].sid.reserved, 19) << "incorrect value for states[11].sid.reserved, expected 19, is " << last_msg_->states[11].sid.reserved; - EXPECT_EQ(last_msg_->states[11].sid.sat, 28622) << "incorrect value for states[11].sid.sat, expected 28622, is " << last_msg_->states[11].sid.sat; - EXPECT_EQ(last_msg_->states[11].state, 14) << "incorrect value for states[11].state, expected 14, is " << last_msg_->states[11].state; - EXPECT_LT((last_msg_->states[12].cn0*100 - 438.200012207*100), 0.05) << "incorrect value for states[12].cn0, expected 438.200012207, is " << last_msg_->states[12].cn0; - EXPECT_EQ(last_msg_->states[12].sid.code, 54) << "incorrect value for states[12].sid.code, expected 54, is " << last_msg_->states[12].sid.code; - EXPECT_EQ(last_msg_->states[12].sid.reserved, 2) << "incorrect value for states[12].sid.reserved, expected 2, is " << last_msg_->states[12].sid.reserved; - EXPECT_EQ(last_msg_->states[12].sid.sat, 53602) << "incorrect value for states[12].sid.sat, expected 53602, is " << last_msg_->states[12].sid.sat; - EXPECT_EQ(last_msg_->states[12].state, 216) << "incorrect value for states[12].state, expected 216, is " << last_msg_->states[12].state; - EXPECT_LT((last_msg_->states[13].cn0*100 - 1862.19995117*100), 0.05) << "incorrect value for states[13].cn0, expected 1862.19995117, is " << last_msg_->states[13].cn0; - EXPECT_EQ(last_msg_->states[13].sid.code, 7) << "incorrect value for states[13].sid.code, expected 7, is " << last_msg_->states[13].sid.code; - EXPECT_EQ(last_msg_->states[13].sid.reserved, 34) << "incorrect value for states[13].sid.reserved, expected 34, is " << last_msg_->states[13].sid.reserved; - EXPECT_EQ(last_msg_->states[13].sid.sat, 25477) << "incorrect value for states[13].sid.sat, expected 25477, is " << last_msg_->states[13].sid.sat; - EXPECT_EQ(last_msg_->states[13].state, 200) << "incorrect value for states[13].state, expected 200, is " << last_msg_->states[13].state; - EXPECT_LT((last_msg_->states[14].cn0*100 - 5462.20019531*100), 0.05) << "incorrect value for states[14].cn0, expected 5462.20019531, is " << last_msg_->states[14].cn0; - EXPECT_EQ(last_msg_->states[14].sid.code, 135) << "incorrect value for states[14].sid.code, expected 135, is " << last_msg_->states[14].sid.code; - EXPECT_EQ(last_msg_->states[14].sid.reserved, 46) << "incorrect value for states[14].sid.reserved, expected 46, is " << last_msg_->states[14].sid.reserved; - EXPECT_EQ(last_msg_->states[14].sid.sat, 21803) << "incorrect value for states[14].sid.sat, expected 21803, is " << last_msg_->states[14].sid.sat; - EXPECT_EQ(last_msg_->states[14].state, 155) << "incorrect value for states[14].state, expected 155, is " << last_msg_->states[14].state; - EXPECT_LT((last_msg_->states[15].cn0*100 - 7454.20019531*100), 0.05) << "incorrect value for states[15].cn0, expected 7454.20019531, is " << last_msg_->states[15].cn0; - EXPECT_EQ(last_msg_->states[15].sid.code, 171) << "incorrect value for states[15].sid.code, expected 171, is " << last_msg_->states[15].sid.code; - EXPECT_EQ(last_msg_->states[15].sid.reserved, 201) << "incorrect value for states[15].sid.reserved, expected 201, is " << last_msg_->states[15].sid.reserved; - EXPECT_EQ(last_msg_->states[15].sid.sat, 21251) << "incorrect value for states[15].sid.sat, expected 21251, is " << last_msg_->states[15].sid.sat; - EXPECT_EQ(last_msg_->states[15].state, 155) << "incorrect value for states[15].state, expected 155, is " << last_msg_->states[15].state; - EXPECT_LT((last_msg_->states[16].cn0*100 - 7134.20019531*100), 0.05) << "incorrect value for states[16].cn0, expected 7134.20019531, is " << last_msg_->states[16].cn0; - EXPECT_EQ(last_msg_->states[16].sid.code, 16) << "incorrect value for states[16].sid.code, expected 16, is " << last_msg_->states[16].sid.code; - EXPECT_EQ(last_msg_->states[16].sid.reserved, 19) << "incorrect value for states[16].sid.reserved, expected 19, is " << last_msg_->states[16].sid.reserved; - EXPECT_EQ(last_msg_->states[16].sid.sat, 50475) << "incorrect value for states[16].sid.sat, expected 50475, is " << last_msg_->states[16].sid.sat; - EXPECT_EQ(last_msg_->states[16].state, 121) << "incorrect value for states[16].state, expected 121, is " << last_msg_->states[16].state; - EXPECT_LT((last_msg_->states[17].cn0*100 - 3111.19995117*100), 0.05) << "incorrect value for states[17].cn0, expected 3111.19995117, is " << last_msg_->states[17].cn0; - EXPECT_EQ(last_msg_->states[17].sid.code, 63) << "incorrect value for states[17].sid.code, expected 63, is " << last_msg_->states[17].sid.code; - EXPECT_EQ(last_msg_->states[17].sid.reserved, 176) << "incorrect value for states[17].sid.reserved, expected 176, is " << last_msg_->states[17].sid.reserved; - EXPECT_EQ(last_msg_->states[17].sid.sat, 13813) << "incorrect value for states[17].sid.sat, expected 13813, is " << last_msg_->states[17].sid.sat; - EXPECT_EQ(last_msg_->states[17].state, 128) << "incorrect value for states[17].state, expected 128, is " << last_msg_->states[17].state; - EXPECT_LT((last_msg_->states[18].cn0*100 - 4297.20019531*100), 0.05) << "incorrect value for states[18].cn0, expected 4297.20019531, is " << last_msg_->states[18].cn0; - EXPECT_EQ(last_msg_->states[18].sid.code, 153) << "incorrect value for states[18].sid.code, expected 153, is " << last_msg_->states[18].sid.code; - EXPECT_EQ(last_msg_->states[18].sid.reserved, 51) << "incorrect value for states[18].sid.reserved, expected 51, is " << last_msg_->states[18].sid.reserved; - EXPECT_EQ(last_msg_->states[18].sid.sat, 15636) << "incorrect value for states[18].sid.sat, expected 15636, is " << last_msg_->states[18].sid.sat; - EXPECT_EQ(last_msg_->states[18].state, 36) << "incorrect value for states[18].state, expected 36, is " << last_msg_->states[18].state; - EXPECT_LT((last_msg_->states[19].cn0*100 - 2649.19995117*100), 0.05) << "incorrect value for states[19].cn0, expected 2649.19995117, is " << last_msg_->states[19].cn0; - EXPECT_EQ(last_msg_->states[19].sid.code, 140) << "incorrect value for states[19].sid.code, expected 140, is " << last_msg_->states[19].sid.code; - EXPECT_EQ(last_msg_->states[19].sid.reserved, 22) << "incorrect value for states[19].sid.reserved, expected 22, is " << last_msg_->states[19].sid.reserved; - EXPECT_EQ(last_msg_->states[19].sid.sat, 29778) << "incorrect value for states[19].sid.sat, expected 29778, is " << last_msg_->states[19].sid.sat; - EXPECT_EQ(last_msg_->states[19].state, 46) << "incorrect value for states[19].state, expected 46, is " << last_msg_->states[19].state; - EXPECT_LT((last_msg_->states[20].cn0*100 - 941.200012207*100), 0.05) << "incorrect value for states[20].cn0, expected 941.200012207, is " << last_msg_->states[20].cn0; - EXPECT_EQ(last_msg_->states[20].sid.code, 96) << "incorrect value for states[20].sid.code, expected 96, is " << last_msg_->states[20].sid.code; - EXPECT_EQ(last_msg_->states[20].sid.reserved, 143) << "incorrect value for states[20].sid.reserved, expected 143, is " << last_msg_->states[20].sid.reserved; - EXPECT_EQ(last_msg_->states[20].sid.sat, 37443) << "incorrect value for states[20].sid.sat, expected 37443, is " << last_msg_->states[20].sid.sat; - EXPECT_EQ(last_msg_->states[20].state, 177) << "incorrect value for states[20].state, expected 177, is " << last_msg_->states[20].state; - EXPECT_LT((last_msg_->states[21].cn0*100 - 1539.19995117*100), 0.05) << "incorrect value for states[21].cn0, expected 1539.19995117, is " << last_msg_->states[21].cn0; - EXPECT_EQ(last_msg_->states[21].sid.code, 201) << "incorrect value for states[21].sid.code, expected 201, is " << last_msg_->states[21].sid.code; - EXPECT_EQ(last_msg_->states[21].sid.reserved, 251) << "incorrect value for states[21].sid.reserved, expected 251, is " << last_msg_->states[21].sid.reserved; - EXPECT_EQ(last_msg_->states[21].sid.sat, 41011) << "incorrect value for states[21].sid.sat, expected 41011, is " << last_msg_->states[21].sid.sat; - EXPECT_EQ(last_msg_->states[21].state, 220) << "incorrect value for states[21].state, expected 220, is " << last_msg_->states[21].state; - EXPECT_LT((last_msg_->states[22].cn0*100 - 1443.19995117*100), 0.05) << "incorrect value for states[22].cn0, expected 1443.19995117, is " << last_msg_->states[22].cn0; - EXPECT_EQ(last_msg_->states[22].sid.code, 161) << "incorrect value for states[22].sid.code, expected 161, is " << last_msg_->states[22].sid.code; - EXPECT_EQ(last_msg_->states[22].sid.reserved, 220) << "incorrect value for states[22].sid.reserved, expected 220, is " << last_msg_->states[22].sid.reserved; - EXPECT_EQ(last_msg_->states[22].sid.sat, 706) << "incorrect value for states[22].sid.sat, expected 706, is " << last_msg_->states[22].sid.sat; - EXPECT_EQ(last_msg_->states[22].state, 168) << "incorrect value for states[22].state, expected 168, is " << last_msg_->states[22].state; - EXPECT_LT((last_msg_->states[23].cn0*100 - 1074.19995117*100), 0.05) << "incorrect value for states[23].cn0, expected 1074.19995117, is " << last_msg_->states[23].cn0; - EXPECT_EQ(last_msg_->states[23].sid.code, 125) << "incorrect value for states[23].sid.code, expected 125, is " << last_msg_->states[23].sid.code; - EXPECT_EQ(last_msg_->states[23].sid.reserved, 178) << "incorrect value for states[23].sid.reserved, expected 178, is " << last_msg_->states[23].sid.reserved; - EXPECT_EQ(last_msg_->states[23].sid.sat, 2312) << "incorrect value for states[23].sid.sat, expected 2312, is " << last_msg_->states[23].sid.sat; - EXPECT_EQ(last_msg_->states[23].state, 69) << "incorrect value for states[23].state, expected 69, is " << last_msg_->states[23].state; - EXPECT_LT((last_msg_->states[24].cn0*100 - 2122.19995117*100), 0.05) << "incorrect value for states[24].cn0, expected 2122.19995117, is " << last_msg_->states[24].cn0; - EXPECT_EQ(last_msg_->states[24].sid.code, 186) << "incorrect value for states[24].sid.code, expected 186, is " << last_msg_->states[24].sid.code; - EXPECT_EQ(last_msg_->states[24].sid.reserved, 171) << "incorrect value for states[24].sid.reserved, expected 171, is " << last_msg_->states[24].sid.reserved; - EXPECT_EQ(last_msg_->states[24].sid.sat, 34580) << "incorrect value for states[24].sid.sat, expected 34580, is " << last_msg_->states[24].sid.sat; - EXPECT_EQ(last_msg_->states[24].state, 185) << "incorrect value for states[24].state, expected 185, is " << last_msg_->states[24].state; - EXPECT_LT((last_msg_->states[25].cn0*100 - 9076.20019531*100), 0.05) << "incorrect value for states[25].cn0, expected 9076.20019531, is " << last_msg_->states[25].cn0; - EXPECT_EQ(last_msg_->states[25].sid.code, 85) << "incorrect value for states[25].sid.code, expected 85, is " << last_msg_->states[25].sid.code; - EXPECT_EQ(last_msg_->states[25].sid.reserved, 170) << "incorrect value for states[25].sid.reserved, expected 170, is " << last_msg_->states[25].sid.reserved; - EXPECT_EQ(last_msg_->states[25].sid.sat, 39804) << "incorrect value for states[25].sid.sat, expected 39804, is " << last_msg_->states[25].sid.sat; - EXPECT_EQ(last_msg_->states[25].state, 18) << "incorrect value for states[25].state, expected 18, is " << last_msg_->states[25].state; - EXPECT_LT((last_msg_->states[26].cn0*100 - 4781.20019531*100), 0.05) << "incorrect value for states[26].cn0, expected 4781.20019531, is " << last_msg_->states[26].cn0; - EXPECT_EQ(last_msg_->states[26].sid.code, 255) << "incorrect value for states[26].sid.code, expected 255, is " << last_msg_->states[26].sid.code; - EXPECT_EQ(last_msg_->states[26].sid.reserved, 186) << "incorrect value for states[26].sid.reserved, expected 186, is " << last_msg_->states[26].sid.reserved; - EXPECT_EQ(last_msg_->states[26].sid.sat, 52980) << "incorrect value for states[26].sid.sat, expected 52980, is " << last_msg_->states[26].sid.sat; - EXPECT_EQ(last_msg_->states[26].state, 57) << "incorrect value for states[26].state, expected 57, is " << last_msg_->states[26].state; - EXPECT_LT((last_msg_->states[27].cn0*100 - 3076.19995117*100), 0.05) << "incorrect value for states[27].cn0, expected 3076.19995117, is " << last_msg_->states[27].cn0; - EXPECT_EQ(last_msg_->states[27].sid.code, 181) << "incorrect value for states[27].sid.code, expected 181, is " << last_msg_->states[27].sid.code; - EXPECT_EQ(last_msg_->states[27].sid.reserved, 175) << "incorrect value for states[27].sid.reserved, expected 175, is " << last_msg_->states[27].sid.reserved; - EXPECT_EQ(last_msg_->states[27].sid.sat, 24007) << "incorrect value for states[27].sid.sat, expected 24007, is " << last_msg_->states[27].sid.sat; - EXPECT_EQ(last_msg_->states[27].state, 165) << "incorrect value for states[27].state, expected 165, is " << last_msg_->states[27].state; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 61938); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->states[0].cn0 * 100 - 5856.20019531 * 100), 0.05) + << "incorrect value for states[0].cn0, expected 5856.20019531, is " + << last_msg_->states[0].cn0; + EXPECT_EQ(last_msg_->states[0].sid.code, 63) + << "incorrect value for states[0].sid.code, expected 63, is " + << last_msg_->states[0].sid.code; + EXPECT_EQ(last_msg_->states[0].sid.reserved, 68) + << "incorrect value for states[0].sid.reserved, expected 68, is " + << last_msg_->states[0].sid.reserved; + EXPECT_EQ(last_msg_->states[0].sid.sat, 58295) + << "incorrect value for states[0].sid.sat, expected 58295, is " + << last_msg_->states[0].sid.sat; + EXPECT_EQ(last_msg_->states[0].state, 115) + << "incorrect value for states[0].state, expected 115, is " + << last_msg_->states[0].state; + EXPECT_LT((last_msg_->states[1].cn0 * 100 - 2612.19995117 * 100), 0.05) + << "incorrect value for states[1].cn0, expected 2612.19995117, is " + << last_msg_->states[1].cn0; + EXPECT_EQ(last_msg_->states[1].sid.code, 43) + << "incorrect value for states[1].sid.code, expected 43, is " + << last_msg_->states[1].sid.code; + EXPECT_EQ(last_msg_->states[1].sid.reserved, 222) + << "incorrect value for states[1].sid.reserved, expected 222, is " + << last_msg_->states[1].sid.reserved; + EXPECT_EQ(last_msg_->states[1].sid.sat, 31151) + << "incorrect value for states[1].sid.sat, expected 31151, is " + << last_msg_->states[1].sid.sat; + EXPECT_EQ(last_msg_->states[1].state, 255) + << "incorrect value for states[1].state, expected 255, is " + << last_msg_->states[1].state; + EXPECT_LT((last_msg_->states[2].cn0 * 100 - 2925.19995117 * 100), 0.05) + << "incorrect value for states[2].cn0, expected 2925.19995117, is " + << last_msg_->states[2].cn0; + EXPECT_EQ(last_msg_->states[2].sid.code, 53) + << "incorrect value for states[2].sid.code, expected 53, is " + << last_msg_->states[2].sid.code; + EXPECT_EQ(last_msg_->states[2].sid.reserved, 20) + << "incorrect value for states[2].sid.reserved, expected 20, is " + << last_msg_->states[2].sid.reserved; + EXPECT_EQ(last_msg_->states[2].sid.sat, 1520) + << "incorrect value for states[2].sid.sat, expected 1520, is " + << last_msg_->states[2].sid.sat; + EXPECT_EQ(last_msg_->states[2].state, 78) + << "incorrect value for states[2].state, expected 78, is " + << last_msg_->states[2].state; + EXPECT_LT((last_msg_->states[3].cn0 * 100 - 3198.19995117 * 100), 0.05) + << "incorrect value for states[3].cn0, expected 3198.19995117, is " + << last_msg_->states[3].cn0; + EXPECT_EQ(last_msg_->states[3].sid.code, 66) + << "incorrect value for states[3].sid.code, expected 66, is " + << last_msg_->states[3].sid.code; + EXPECT_EQ(last_msg_->states[3].sid.reserved, 155) + << "incorrect value for states[3].sid.reserved, expected 155, is " + << last_msg_->states[3].sid.reserved; + EXPECT_EQ(last_msg_->states[3].sid.sat, 60802) + << "incorrect value for states[3].sid.sat, expected 60802, is " + << last_msg_->states[3].sid.sat; + EXPECT_EQ(last_msg_->states[3].state, 153) + << "incorrect value for states[3].state, expected 153, is " + << last_msg_->states[3].state; + EXPECT_LT((last_msg_->states[4].cn0 * 100 - 8623.20019531 * 100), 0.05) + << "incorrect value for states[4].cn0, expected 8623.20019531, is " + << last_msg_->states[4].cn0; + EXPECT_EQ(last_msg_->states[4].sid.code, 161) + << "incorrect value for states[4].sid.code, expected 161, is " + << last_msg_->states[4].sid.code; + EXPECT_EQ(last_msg_->states[4].sid.reserved, 190) + << "incorrect value for states[4].sid.reserved, expected 190, is " + << last_msg_->states[4].sid.reserved; + EXPECT_EQ(last_msg_->states[4].sid.sat, 35058) + << "incorrect value for states[4].sid.sat, expected 35058, is " + << last_msg_->states[4].sid.sat; + EXPECT_EQ(last_msg_->states[4].state, 53) + << "incorrect value for states[4].state, expected 53, is " + << last_msg_->states[4].state; + EXPECT_LT((last_msg_->states[5].cn0 * 100 - 5915.20019531 * 100), 0.05) + << "incorrect value for states[5].cn0, expected 5915.20019531, is " + << last_msg_->states[5].cn0; + EXPECT_EQ(last_msg_->states[5].sid.code, 142) + << "incorrect value for states[5].sid.code, expected 142, is " + << last_msg_->states[5].sid.code; + EXPECT_EQ(last_msg_->states[5].sid.reserved, 149) + << "incorrect value for states[5].sid.reserved, expected 149, is " + << last_msg_->states[5].sid.reserved; + EXPECT_EQ(last_msg_->states[5].sid.sat, 65405) + << "incorrect value for states[5].sid.sat, expected 65405, is " + << last_msg_->states[5].sid.sat; + EXPECT_EQ(last_msg_->states[5].state, 153) + << "incorrect value for states[5].state, expected 153, is " + << last_msg_->states[5].state; + EXPECT_LT((last_msg_->states[6].cn0 * 100 - 5412.20019531 * 100), 0.05) + << "incorrect value for states[6].cn0, expected 5412.20019531, is " + << last_msg_->states[6].cn0; + EXPECT_EQ(last_msg_->states[6].sid.code, 31) + << "incorrect value for states[6].sid.code, expected 31, is " + << last_msg_->states[6].sid.code; + EXPECT_EQ(last_msg_->states[6].sid.reserved, 76) + << "incorrect value for states[6].sid.reserved, expected 76, is " + << last_msg_->states[6].sid.reserved; + EXPECT_EQ(last_msg_->states[6].sid.sat, 24422) + << "incorrect value for states[6].sid.sat, expected 24422, is " + << last_msg_->states[6].sid.sat; + EXPECT_EQ(last_msg_->states[6].state, 248) + << "incorrect value for states[6].state, expected 248, is " + << last_msg_->states[6].state; + EXPECT_LT((last_msg_->states[7].cn0 * 100 - 6428.20019531 * 100), 0.05) + << "incorrect value for states[7].cn0, expected 6428.20019531, is " + << last_msg_->states[7].cn0; + EXPECT_EQ(last_msg_->states[7].sid.code, 27) + << "incorrect value for states[7].sid.code, expected 27, is " + << last_msg_->states[7].sid.code; + EXPECT_EQ(last_msg_->states[7].sid.reserved, 12) + << "incorrect value for states[7].sid.reserved, expected 12, is " + << last_msg_->states[7].sid.reserved; + EXPECT_EQ(last_msg_->states[7].sid.sat, 36211) + << "incorrect value for states[7].sid.sat, expected 36211, is " + << last_msg_->states[7].sid.sat; + EXPECT_EQ(last_msg_->states[7].state, 131) + << "incorrect value for states[7].state, expected 131, is " + << last_msg_->states[7].state; + EXPECT_LT((last_msg_->states[8].cn0 * 100 - 3104.19995117 * 100), 0.05) + << "incorrect value for states[8].cn0, expected 3104.19995117, is " + << last_msg_->states[8].cn0; + EXPECT_EQ(last_msg_->states[8].sid.code, 39) + << "incorrect value for states[8].sid.code, expected 39, is " + << last_msg_->states[8].sid.code; + EXPECT_EQ(last_msg_->states[8].sid.reserved, 23) + << "incorrect value for states[8].sid.reserved, expected 23, is " + << last_msg_->states[8].sid.reserved; + EXPECT_EQ(last_msg_->states[8].sid.sat, 37676) + << "incorrect value for states[8].sid.sat, expected 37676, is " + << last_msg_->states[8].sid.sat; + EXPECT_EQ(last_msg_->states[8].state, 208) + << "incorrect value for states[8].state, expected 208, is " + << last_msg_->states[8].state; + EXPECT_LT((last_msg_->states[9].cn0 * 100 - 3686.19995117 * 100), 0.05) + << "incorrect value for states[9].cn0, expected 3686.19995117, is " + << last_msg_->states[9].cn0; + EXPECT_EQ(last_msg_->states[9].sid.code, 49) + << "incorrect value for states[9].sid.code, expected 49, is " + << last_msg_->states[9].sid.code; + EXPECT_EQ(last_msg_->states[9].sid.reserved, 203) + << "incorrect value for states[9].sid.reserved, expected 203, is " + << last_msg_->states[9].sid.reserved; + EXPECT_EQ(last_msg_->states[9].sid.sat, 64415) + << "incorrect value for states[9].sid.sat, expected 64415, is " + << last_msg_->states[9].sid.sat; + EXPECT_EQ(last_msg_->states[9].state, 237) + << "incorrect value for states[9].state, expected 237, is " + << last_msg_->states[9].state; + EXPECT_LT((last_msg_->states[10].cn0 * 100 - 5967.20019531 * 100), 0.05) + << "incorrect value for states[10].cn0, expected 5967.20019531, is " + << last_msg_->states[10].cn0; + EXPECT_EQ(last_msg_->states[10].sid.code, 128) + << "incorrect value for states[10].sid.code, expected 128, is " + << last_msg_->states[10].sid.code; + EXPECT_EQ(last_msg_->states[10].sid.reserved, 206) + << "incorrect value for states[10].sid.reserved, expected 206, is " + << last_msg_->states[10].sid.reserved; + EXPECT_EQ(last_msg_->states[10].sid.sat, 22486) + << "incorrect value for states[10].sid.sat, expected 22486, is " + << last_msg_->states[10].sid.sat; + EXPECT_EQ(last_msg_->states[10].state, 70) + << "incorrect value for states[10].state, expected 70, is " + << last_msg_->states[10].state; + EXPECT_LT((last_msg_->states[11].cn0 * 100 - 5423.20019531 * 100), 0.05) + << "incorrect value for states[11].cn0, expected 5423.20019531, is " + << last_msg_->states[11].cn0; + EXPECT_EQ(last_msg_->states[11].sid.code, 218) + << "incorrect value for states[11].sid.code, expected 218, is " + << last_msg_->states[11].sid.code; + EXPECT_EQ(last_msg_->states[11].sid.reserved, 19) + << "incorrect value for states[11].sid.reserved, expected 19, is " + << last_msg_->states[11].sid.reserved; + EXPECT_EQ(last_msg_->states[11].sid.sat, 28622) + << "incorrect value for states[11].sid.sat, expected 28622, is " + << last_msg_->states[11].sid.sat; + EXPECT_EQ(last_msg_->states[11].state, 14) + << "incorrect value for states[11].state, expected 14, is " + << last_msg_->states[11].state; + EXPECT_LT((last_msg_->states[12].cn0 * 100 - 438.200012207 * 100), 0.05) + << "incorrect value for states[12].cn0, expected 438.200012207, is " + << last_msg_->states[12].cn0; + EXPECT_EQ(last_msg_->states[12].sid.code, 54) + << "incorrect value for states[12].sid.code, expected 54, is " + << last_msg_->states[12].sid.code; + EXPECT_EQ(last_msg_->states[12].sid.reserved, 2) + << "incorrect value for states[12].sid.reserved, expected 2, is " + << last_msg_->states[12].sid.reserved; + EXPECT_EQ(last_msg_->states[12].sid.sat, 53602) + << "incorrect value for states[12].sid.sat, expected 53602, is " + << last_msg_->states[12].sid.sat; + EXPECT_EQ(last_msg_->states[12].state, 216) + << "incorrect value for states[12].state, expected 216, is " + << last_msg_->states[12].state; + EXPECT_LT((last_msg_->states[13].cn0 * 100 - 1862.19995117 * 100), 0.05) + << "incorrect value for states[13].cn0, expected 1862.19995117, is " + << last_msg_->states[13].cn0; + EXPECT_EQ(last_msg_->states[13].sid.code, 7) + << "incorrect value for states[13].sid.code, expected 7, is " + << last_msg_->states[13].sid.code; + EXPECT_EQ(last_msg_->states[13].sid.reserved, 34) + << "incorrect value for states[13].sid.reserved, expected 34, is " + << last_msg_->states[13].sid.reserved; + EXPECT_EQ(last_msg_->states[13].sid.sat, 25477) + << "incorrect value for states[13].sid.sat, expected 25477, is " + << last_msg_->states[13].sid.sat; + EXPECT_EQ(last_msg_->states[13].state, 200) + << "incorrect value for states[13].state, expected 200, is " + << last_msg_->states[13].state; + EXPECT_LT((last_msg_->states[14].cn0 * 100 - 5462.20019531 * 100), 0.05) + << "incorrect value for states[14].cn0, expected 5462.20019531, is " + << last_msg_->states[14].cn0; + EXPECT_EQ(last_msg_->states[14].sid.code, 135) + << "incorrect value for states[14].sid.code, expected 135, is " + << last_msg_->states[14].sid.code; + EXPECT_EQ(last_msg_->states[14].sid.reserved, 46) + << "incorrect value for states[14].sid.reserved, expected 46, is " + << last_msg_->states[14].sid.reserved; + EXPECT_EQ(last_msg_->states[14].sid.sat, 21803) + << "incorrect value for states[14].sid.sat, expected 21803, is " + << last_msg_->states[14].sid.sat; + EXPECT_EQ(last_msg_->states[14].state, 155) + << "incorrect value for states[14].state, expected 155, is " + << last_msg_->states[14].state; + EXPECT_LT((last_msg_->states[15].cn0 * 100 - 7454.20019531 * 100), 0.05) + << "incorrect value for states[15].cn0, expected 7454.20019531, is " + << last_msg_->states[15].cn0; + EXPECT_EQ(last_msg_->states[15].sid.code, 171) + << "incorrect value for states[15].sid.code, expected 171, is " + << last_msg_->states[15].sid.code; + EXPECT_EQ(last_msg_->states[15].sid.reserved, 201) + << "incorrect value for states[15].sid.reserved, expected 201, is " + << last_msg_->states[15].sid.reserved; + EXPECT_EQ(last_msg_->states[15].sid.sat, 21251) + << "incorrect value for states[15].sid.sat, expected 21251, is " + << last_msg_->states[15].sid.sat; + EXPECT_EQ(last_msg_->states[15].state, 155) + << "incorrect value for states[15].state, expected 155, is " + << last_msg_->states[15].state; + EXPECT_LT((last_msg_->states[16].cn0 * 100 - 7134.20019531 * 100), 0.05) + << "incorrect value for states[16].cn0, expected 7134.20019531, is " + << last_msg_->states[16].cn0; + EXPECT_EQ(last_msg_->states[16].sid.code, 16) + << "incorrect value for states[16].sid.code, expected 16, is " + << last_msg_->states[16].sid.code; + EXPECT_EQ(last_msg_->states[16].sid.reserved, 19) + << "incorrect value for states[16].sid.reserved, expected 19, is " + << last_msg_->states[16].sid.reserved; + EXPECT_EQ(last_msg_->states[16].sid.sat, 50475) + << "incorrect value for states[16].sid.sat, expected 50475, is " + << last_msg_->states[16].sid.sat; + EXPECT_EQ(last_msg_->states[16].state, 121) + << "incorrect value for states[16].state, expected 121, is " + << last_msg_->states[16].state; + EXPECT_LT((last_msg_->states[17].cn0 * 100 - 3111.19995117 * 100), 0.05) + << "incorrect value for states[17].cn0, expected 3111.19995117, is " + << last_msg_->states[17].cn0; + EXPECT_EQ(last_msg_->states[17].sid.code, 63) + << "incorrect value for states[17].sid.code, expected 63, is " + << last_msg_->states[17].sid.code; + EXPECT_EQ(last_msg_->states[17].sid.reserved, 176) + << "incorrect value for states[17].sid.reserved, expected 176, is " + << last_msg_->states[17].sid.reserved; + EXPECT_EQ(last_msg_->states[17].sid.sat, 13813) + << "incorrect value for states[17].sid.sat, expected 13813, is " + << last_msg_->states[17].sid.sat; + EXPECT_EQ(last_msg_->states[17].state, 128) + << "incorrect value for states[17].state, expected 128, is " + << last_msg_->states[17].state; + EXPECT_LT((last_msg_->states[18].cn0 * 100 - 4297.20019531 * 100), 0.05) + << "incorrect value for states[18].cn0, expected 4297.20019531, is " + << last_msg_->states[18].cn0; + EXPECT_EQ(last_msg_->states[18].sid.code, 153) + << "incorrect value for states[18].sid.code, expected 153, is " + << last_msg_->states[18].sid.code; + EXPECT_EQ(last_msg_->states[18].sid.reserved, 51) + << "incorrect value for states[18].sid.reserved, expected 51, is " + << last_msg_->states[18].sid.reserved; + EXPECT_EQ(last_msg_->states[18].sid.sat, 15636) + << "incorrect value for states[18].sid.sat, expected 15636, is " + << last_msg_->states[18].sid.sat; + EXPECT_EQ(last_msg_->states[18].state, 36) + << "incorrect value for states[18].state, expected 36, is " + << last_msg_->states[18].state; + EXPECT_LT((last_msg_->states[19].cn0 * 100 - 2649.19995117 * 100), 0.05) + << "incorrect value for states[19].cn0, expected 2649.19995117, is " + << last_msg_->states[19].cn0; + EXPECT_EQ(last_msg_->states[19].sid.code, 140) + << "incorrect value for states[19].sid.code, expected 140, is " + << last_msg_->states[19].sid.code; + EXPECT_EQ(last_msg_->states[19].sid.reserved, 22) + << "incorrect value for states[19].sid.reserved, expected 22, is " + << last_msg_->states[19].sid.reserved; + EXPECT_EQ(last_msg_->states[19].sid.sat, 29778) + << "incorrect value for states[19].sid.sat, expected 29778, is " + << last_msg_->states[19].sid.sat; + EXPECT_EQ(last_msg_->states[19].state, 46) + << "incorrect value for states[19].state, expected 46, is " + << last_msg_->states[19].state; + EXPECT_LT((last_msg_->states[20].cn0 * 100 - 941.200012207 * 100), 0.05) + << "incorrect value for states[20].cn0, expected 941.200012207, is " + << last_msg_->states[20].cn0; + EXPECT_EQ(last_msg_->states[20].sid.code, 96) + << "incorrect value for states[20].sid.code, expected 96, is " + << last_msg_->states[20].sid.code; + EXPECT_EQ(last_msg_->states[20].sid.reserved, 143) + << "incorrect value for states[20].sid.reserved, expected 143, is " + << last_msg_->states[20].sid.reserved; + EXPECT_EQ(last_msg_->states[20].sid.sat, 37443) + << "incorrect value for states[20].sid.sat, expected 37443, is " + << last_msg_->states[20].sid.sat; + EXPECT_EQ(last_msg_->states[20].state, 177) + << "incorrect value for states[20].state, expected 177, is " + << last_msg_->states[20].state; + EXPECT_LT((last_msg_->states[21].cn0 * 100 - 1539.19995117 * 100), 0.05) + << "incorrect value for states[21].cn0, expected 1539.19995117, is " + << last_msg_->states[21].cn0; + EXPECT_EQ(last_msg_->states[21].sid.code, 201) + << "incorrect value for states[21].sid.code, expected 201, is " + << last_msg_->states[21].sid.code; + EXPECT_EQ(last_msg_->states[21].sid.reserved, 251) + << "incorrect value for states[21].sid.reserved, expected 251, is " + << last_msg_->states[21].sid.reserved; + EXPECT_EQ(last_msg_->states[21].sid.sat, 41011) + << "incorrect value for states[21].sid.sat, expected 41011, is " + << last_msg_->states[21].sid.sat; + EXPECT_EQ(last_msg_->states[21].state, 220) + << "incorrect value for states[21].state, expected 220, is " + << last_msg_->states[21].state; + EXPECT_LT((last_msg_->states[22].cn0 * 100 - 1443.19995117 * 100), 0.05) + << "incorrect value for states[22].cn0, expected 1443.19995117, is " + << last_msg_->states[22].cn0; + EXPECT_EQ(last_msg_->states[22].sid.code, 161) + << "incorrect value for states[22].sid.code, expected 161, is " + << last_msg_->states[22].sid.code; + EXPECT_EQ(last_msg_->states[22].sid.reserved, 220) + << "incorrect value for states[22].sid.reserved, expected 220, is " + << last_msg_->states[22].sid.reserved; + EXPECT_EQ(last_msg_->states[22].sid.sat, 706) + << "incorrect value for states[22].sid.sat, expected 706, is " + << last_msg_->states[22].sid.sat; + EXPECT_EQ(last_msg_->states[22].state, 168) + << "incorrect value for states[22].state, expected 168, is " + << last_msg_->states[22].state; + EXPECT_LT((last_msg_->states[23].cn0 * 100 - 1074.19995117 * 100), 0.05) + << "incorrect value for states[23].cn0, expected 1074.19995117, is " + << last_msg_->states[23].cn0; + EXPECT_EQ(last_msg_->states[23].sid.code, 125) + << "incorrect value for states[23].sid.code, expected 125, is " + << last_msg_->states[23].sid.code; + EXPECT_EQ(last_msg_->states[23].sid.reserved, 178) + << "incorrect value for states[23].sid.reserved, expected 178, is " + << last_msg_->states[23].sid.reserved; + EXPECT_EQ(last_msg_->states[23].sid.sat, 2312) + << "incorrect value for states[23].sid.sat, expected 2312, is " + << last_msg_->states[23].sid.sat; + EXPECT_EQ(last_msg_->states[23].state, 69) + << "incorrect value for states[23].state, expected 69, is " + << last_msg_->states[23].state; + EXPECT_LT((last_msg_->states[24].cn0 * 100 - 2122.19995117 * 100), 0.05) + << "incorrect value for states[24].cn0, expected 2122.19995117, is " + << last_msg_->states[24].cn0; + EXPECT_EQ(last_msg_->states[24].sid.code, 186) + << "incorrect value for states[24].sid.code, expected 186, is " + << last_msg_->states[24].sid.code; + EXPECT_EQ(last_msg_->states[24].sid.reserved, 171) + << "incorrect value for states[24].sid.reserved, expected 171, is " + << last_msg_->states[24].sid.reserved; + EXPECT_EQ(last_msg_->states[24].sid.sat, 34580) + << "incorrect value for states[24].sid.sat, expected 34580, is " + << last_msg_->states[24].sid.sat; + EXPECT_EQ(last_msg_->states[24].state, 185) + << "incorrect value for states[24].state, expected 185, is " + << last_msg_->states[24].state; + EXPECT_LT((last_msg_->states[25].cn0 * 100 - 9076.20019531 * 100), 0.05) + << "incorrect value for states[25].cn0, expected 9076.20019531, is " + << last_msg_->states[25].cn0; + EXPECT_EQ(last_msg_->states[25].sid.code, 85) + << "incorrect value for states[25].sid.code, expected 85, is " + << last_msg_->states[25].sid.code; + EXPECT_EQ(last_msg_->states[25].sid.reserved, 170) + << "incorrect value for states[25].sid.reserved, expected 170, is " + << last_msg_->states[25].sid.reserved; + EXPECT_EQ(last_msg_->states[25].sid.sat, 39804) + << "incorrect value for states[25].sid.sat, expected 39804, is " + << last_msg_->states[25].sid.sat; + EXPECT_EQ(last_msg_->states[25].state, 18) + << "incorrect value for states[25].state, expected 18, is " + << last_msg_->states[25].state; + EXPECT_LT((last_msg_->states[26].cn0 * 100 - 4781.20019531 * 100), 0.05) + << "incorrect value for states[26].cn0, expected 4781.20019531, is " + << last_msg_->states[26].cn0; + EXPECT_EQ(last_msg_->states[26].sid.code, 255) + << "incorrect value for states[26].sid.code, expected 255, is " + << last_msg_->states[26].sid.code; + EXPECT_EQ(last_msg_->states[26].sid.reserved, 186) + << "incorrect value for states[26].sid.reserved, expected 186, is " + << last_msg_->states[26].sid.reserved; + EXPECT_EQ(last_msg_->states[26].sid.sat, 52980) + << "incorrect value for states[26].sid.sat, expected 52980, is " + << last_msg_->states[26].sid.sat; + EXPECT_EQ(last_msg_->states[26].state, 57) + << "incorrect value for states[26].state, expected 57, is " + << last_msg_->states[26].state; + EXPECT_LT((last_msg_->states[27].cn0 * 100 - 3076.19995117 * 100), 0.05) + << "incorrect value for states[27].cn0, expected 3076.19995117, is " + << last_msg_->states[27].cn0; + EXPECT_EQ(last_msg_->states[27].sid.code, 181) + << "incorrect value for states[27].sid.code, expected 181, is " + << last_msg_->states[27].sid.code; + EXPECT_EQ(last_msg_->states[27].sid.reserved, 175) + << "incorrect value for states[27].sid.reserved, expected 175, is " + << last_msg_->states[27].sid.reserved; + EXPECT_EQ(last_msg_->states[27].sid.sat, 24007) + << "incorrect value for states[27].sid.sat, expected 24007, is " + << last_msg_->states[27].sid.sat; + EXPECT_EQ(last_msg_->states[27].state, 165) + << "incorrect value for states[27].state, expected 165, is " + << last_msg_->states[27].state; } diff --git a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.cc b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.cc index 7eac0a2e9..e525fb74c 100644 --- a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.cc +++ b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDep.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDep.yaml +// by generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_state_detailed_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_state_detailed_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,134 +82,172 @@ class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_state_detailed_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep0, Test) -{ - - uint8_t encoded_frame[] = {85,17,0,59,103,55,163,151,112,215,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,5,0,0,169,177,208,54,15,0,0,0,85,61,0,0,39,0,1,0,0,0,0,0,0,0,40,0,108,1,0,11,0,0,9,166,214, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_state_detailed_dep_t* test_msg = ( msg_tracking_state_detailed_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->L.f = 169; - test_msg->L.i = 1319; - test_msg->P = 0; - test_msg->P_std = 0; - test_msg->acceleration = 108; - test_msg->clock_drift = 0; - test_msg->clock_offset = 0; - test_msg->cn0 = 177; - test_msg->corr_spacing = 40; - test_msg->doppler = 15701; - test_msg->doppler_std = 39; - test_msg->lock = 14032; - test_msg->misc_flags = 9; - test_msg->nav_flags = 0; - test_msg->pset_flags = 0; - test_msg->recv_time = 7909447587; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 15; - test_msg->sync_flags = 1; - test_msg->tot.tow = 0; - test_msg->tot.wn = 0; - test_msg->tow_flags = 0; - test_msg->track_flags = 11; - test_msg->uptime = 1; - - EXPECT_EQ(send_message( 0x11, 26427, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 26427); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->L.f, 169) << "incorrect value for L.f, expected 169, is " << last_msg_->L.f; - EXPECT_EQ(last_msg_->L.i, 1319) << "incorrect value for L.i, expected 1319, is " << last_msg_->L.i; - EXPECT_EQ(last_msg_->P, 0) << "incorrect value for P, expected 0, is " << last_msg_->P; - EXPECT_EQ(last_msg_->P_std, 0) << "incorrect value for P_std, expected 0, is " << last_msg_->P_std; - EXPECT_EQ(last_msg_->acceleration, 108) << "incorrect value for acceleration, expected 108, is " << last_msg_->acceleration; - EXPECT_EQ(last_msg_->clock_drift, 0) << "incorrect value for clock_drift, expected 0, is " << last_msg_->clock_drift; - EXPECT_EQ(last_msg_->clock_offset, 0) << "incorrect value for clock_offset, expected 0, is " << last_msg_->clock_offset; - EXPECT_EQ(last_msg_->cn0, 177) << "incorrect value for cn0, expected 177, is " << last_msg_->cn0; - EXPECT_EQ(last_msg_->corr_spacing, 40) << "incorrect value for corr_spacing, expected 40, is " << last_msg_->corr_spacing; - EXPECT_EQ(last_msg_->doppler, 15701) << "incorrect value for doppler, expected 15701, is " << last_msg_->doppler; - EXPECT_EQ(last_msg_->doppler_std, 39) << "incorrect value for doppler_std, expected 39, is " << last_msg_->doppler_std; - EXPECT_EQ(last_msg_->lock, 14032) << "incorrect value for lock, expected 14032, is " << last_msg_->lock; - EXPECT_EQ(last_msg_->misc_flags, 9) << "incorrect value for misc_flags, expected 9, is " << last_msg_->misc_flags; - EXPECT_EQ(last_msg_->nav_flags, 0) << "incorrect value for nav_flags, expected 0, is " << last_msg_->nav_flags; - EXPECT_EQ(last_msg_->pset_flags, 0) << "incorrect value for pset_flags, expected 0, is " << last_msg_->pset_flags; - EXPECT_EQ(last_msg_->recv_time, 7909447587) << "incorrect value for recv_time, expected 7909447587, is " << last_msg_->recv_time; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 15) << "incorrect value for sid.sat, expected 15, is " << last_msg_->sid.sat; - EXPECT_EQ(last_msg_->sync_flags, 1) << "incorrect value for sync_flags, expected 1, is " << last_msg_->sync_flags; - EXPECT_EQ(last_msg_->tot.tow, 0) << "incorrect value for tot.tow, expected 0, is " << last_msg_->tot.tow; - EXPECT_EQ(last_msg_->tot.wn, 0) << "incorrect value for tot.wn, expected 0, is " << last_msg_->tot.wn; - EXPECT_EQ(last_msg_->tow_flags, 0) << "incorrect value for tow_flags, expected 0, is " << last_msg_->tow_flags; - EXPECT_EQ(last_msg_->track_flags, 11) << "incorrect value for track_flags, expected 11, is " << last_msg_->track_flags; - EXPECT_EQ(last_msg_->uptime, 1) << "incorrect value for uptime, expected 1, is " << last_msg_->uptime; +}; + +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep0, Test) { + uint8_t encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 163, 151, 112, 215, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, 5, 0, 0, 169, 177, + 208, 54, 15, 0, 0, 0, 85, 61, 0, 0, 39, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 108, 1, 0, 11, 0, 0, 9, 166, 214, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_state_detailed_dep_t *test_msg = + (msg_tracking_state_detailed_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->L.f = 169; + test_msg->L.i = 1319; + test_msg->P = 0; + test_msg->P_std = 0; + test_msg->acceleration = 108; + test_msg->clock_drift = 0; + test_msg->clock_offset = 0; + test_msg->cn0 = 177; + test_msg->corr_spacing = 40; + test_msg->doppler = 15701; + test_msg->doppler_std = 39; + test_msg->lock = 14032; + test_msg->misc_flags = 9; + test_msg->nav_flags = 0; + test_msg->pset_flags = 0; + test_msg->recv_time = 7909447587; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 15; + test_msg->sync_flags = 1; + test_msg->tot.tow = 0; + test_msg->tot.wn = 0; + test_msg->tow_flags = 0; + test_msg->track_flags = 11; + test_msg->uptime = 1; + + EXPECT_EQ(send_message(0x11, 26427, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 26427); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->L.f, 169) + << "incorrect value for L.f, expected 169, is " << last_msg_->L.f; + EXPECT_EQ(last_msg_->L.i, 1319) + << "incorrect value for L.i, expected 1319, is " << last_msg_->L.i; + EXPECT_EQ(last_msg_->P, 0) + << "incorrect value for P, expected 0, is " << last_msg_->P; + EXPECT_EQ(last_msg_->P_std, 0) + << "incorrect value for P_std, expected 0, is " << last_msg_->P_std; + EXPECT_EQ(last_msg_->acceleration, 108) + << "incorrect value for acceleration, expected 108, is " + << last_msg_->acceleration; + EXPECT_EQ(last_msg_->clock_drift, 0) + << "incorrect value for clock_drift, expected 0, is " + << last_msg_->clock_drift; + EXPECT_EQ(last_msg_->clock_offset, 0) + << "incorrect value for clock_offset, expected 0, is " + << last_msg_->clock_offset; + EXPECT_EQ(last_msg_->cn0, 177) + << "incorrect value for cn0, expected 177, is " << last_msg_->cn0; + EXPECT_EQ(last_msg_->corr_spacing, 40) + << "incorrect value for corr_spacing, expected 40, is " + << last_msg_->corr_spacing; + EXPECT_EQ(last_msg_->doppler, 15701) + << "incorrect value for doppler, expected 15701, is " + << last_msg_->doppler; + EXPECT_EQ(last_msg_->doppler_std, 39) + << "incorrect value for doppler_std, expected 39, is " + << last_msg_->doppler_std; + EXPECT_EQ(last_msg_->lock, 14032) + << "incorrect value for lock, expected 14032, is " << last_msg_->lock; + EXPECT_EQ(last_msg_->misc_flags, 9) + << "incorrect value for misc_flags, expected 9, is " + << last_msg_->misc_flags; + EXPECT_EQ(last_msg_->nav_flags, 0) + << "incorrect value for nav_flags, expected 0, is " + << last_msg_->nav_flags; + EXPECT_EQ(last_msg_->pset_flags, 0) + << "incorrect value for pset_flags, expected 0, is " + << last_msg_->pset_flags; + EXPECT_EQ(last_msg_->recv_time, 7909447587) + << "incorrect value for recv_time, expected 7909447587, is " + << last_msg_->recv_time; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 15) + << "incorrect value for sid.sat, expected 15, is " << last_msg_->sid.sat; + EXPECT_EQ(last_msg_->sync_flags, 1) + << "incorrect value for sync_flags, expected 1, is " + << last_msg_->sync_flags; + EXPECT_EQ(last_msg_->tot.tow, 0) + << "incorrect value for tot.tow, expected 0, is " << last_msg_->tot.tow; + EXPECT_EQ(last_msg_->tot.wn, 0) + << "incorrect value for tot.wn, expected 0, is " << last_msg_->tot.wn; + EXPECT_EQ(last_msg_->tow_flags, 0) + << "incorrect value for tow_flags, expected 0, is " + << last_msg_->tow_flags; + EXPECT_EQ(last_msg_->track_flags, 11) + << "incorrect value for track_flags, expected 11, is " + << last_msg_->track_flags; + EXPECT_EQ(last_msg_->uptime, 1) + << "incorrect value for uptime, expected 1, is " << last_msg_->uptime; } -class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_state_detailed_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_state_detailed_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -222,134 +257,172 @@ class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_state_detailed_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep1, Test) -{ - - uint8_t encoded_frame[] = {85,17,0,59,103,55,97,251,61,245,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,7,0,0,14,175,208,54,15,0,0,0,51,61,0,0,30,0,1,0,0,0,0,0,0,0,40,0,224,1,0,11,0,0,9,136,179, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_state_detailed_dep_t* test_msg = ( msg_tracking_state_detailed_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->L.f = 14; - test_msg->L.i = 1810; - test_msg->P = 0; - test_msg->P_std = 0; - test_msg->acceleration = -32; - test_msg->clock_drift = 0; - test_msg->clock_offset = 0; - test_msg->cn0 = 175; - test_msg->corr_spacing = 40; - test_msg->doppler = 15667; - test_msg->doppler_std = 30; - test_msg->lock = 14032; - test_msg->misc_flags = 9; - test_msg->nav_flags = 0; - test_msg->pset_flags = 0; - test_msg->recv_time = 8409447265; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 15; - test_msg->sync_flags = 1; - test_msg->tot.tow = 0; - test_msg->tot.wn = 0; - test_msg->tow_flags = 0; - test_msg->track_flags = 11; - test_msg->uptime = 1; - - EXPECT_EQ(send_message( 0x11, 26427, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 26427); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->L.f, 14) << "incorrect value for L.f, expected 14, is " << last_msg_->L.f; - EXPECT_EQ(last_msg_->L.i, 1810) << "incorrect value for L.i, expected 1810, is " << last_msg_->L.i; - EXPECT_EQ(last_msg_->P, 0) << "incorrect value for P, expected 0, is " << last_msg_->P; - EXPECT_EQ(last_msg_->P_std, 0) << "incorrect value for P_std, expected 0, is " << last_msg_->P_std; - EXPECT_EQ(last_msg_->acceleration, -32) << "incorrect value for acceleration, expected -32, is " << last_msg_->acceleration; - EXPECT_EQ(last_msg_->clock_drift, 0) << "incorrect value for clock_drift, expected 0, is " << last_msg_->clock_drift; - EXPECT_EQ(last_msg_->clock_offset, 0) << "incorrect value for clock_offset, expected 0, is " << last_msg_->clock_offset; - EXPECT_EQ(last_msg_->cn0, 175) << "incorrect value for cn0, expected 175, is " << last_msg_->cn0; - EXPECT_EQ(last_msg_->corr_spacing, 40) << "incorrect value for corr_spacing, expected 40, is " << last_msg_->corr_spacing; - EXPECT_EQ(last_msg_->doppler, 15667) << "incorrect value for doppler, expected 15667, is " << last_msg_->doppler; - EXPECT_EQ(last_msg_->doppler_std, 30) << "incorrect value for doppler_std, expected 30, is " << last_msg_->doppler_std; - EXPECT_EQ(last_msg_->lock, 14032) << "incorrect value for lock, expected 14032, is " << last_msg_->lock; - EXPECT_EQ(last_msg_->misc_flags, 9) << "incorrect value for misc_flags, expected 9, is " << last_msg_->misc_flags; - EXPECT_EQ(last_msg_->nav_flags, 0) << "incorrect value for nav_flags, expected 0, is " << last_msg_->nav_flags; - EXPECT_EQ(last_msg_->pset_flags, 0) << "incorrect value for pset_flags, expected 0, is " << last_msg_->pset_flags; - EXPECT_EQ(last_msg_->recv_time, 8409447265) << "incorrect value for recv_time, expected 8409447265, is " << last_msg_->recv_time; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 15) << "incorrect value for sid.sat, expected 15, is " << last_msg_->sid.sat; - EXPECT_EQ(last_msg_->sync_flags, 1) << "incorrect value for sync_flags, expected 1, is " << last_msg_->sync_flags; - EXPECT_EQ(last_msg_->tot.tow, 0) << "incorrect value for tot.tow, expected 0, is " << last_msg_->tot.tow; - EXPECT_EQ(last_msg_->tot.wn, 0) << "incorrect value for tot.wn, expected 0, is " << last_msg_->tot.wn; - EXPECT_EQ(last_msg_->tow_flags, 0) << "incorrect value for tow_flags, expected 0, is " << last_msg_->tow_flags; - EXPECT_EQ(last_msg_->track_flags, 11) << "incorrect value for track_flags, expected 11, is " << last_msg_->track_flags; - EXPECT_EQ(last_msg_->uptime, 1) << "incorrect value for uptime, expected 1, is " << last_msg_->uptime; +}; + +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep1, Test) { + uint8_t encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 97, 251, 61, 245, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 7, 0, 0, 14, 175, + 208, 54, 15, 0, 0, 0, 51, 61, 0, 0, 30, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 224, 1, 0, 11, 0, 0, 9, 136, 179, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_state_detailed_dep_t *test_msg = + (msg_tracking_state_detailed_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->L.f = 14; + test_msg->L.i = 1810; + test_msg->P = 0; + test_msg->P_std = 0; + test_msg->acceleration = -32; + test_msg->clock_drift = 0; + test_msg->clock_offset = 0; + test_msg->cn0 = 175; + test_msg->corr_spacing = 40; + test_msg->doppler = 15667; + test_msg->doppler_std = 30; + test_msg->lock = 14032; + test_msg->misc_flags = 9; + test_msg->nav_flags = 0; + test_msg->pset_flags = 0; + test_msg->recv_time = 8409447265; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 15; + test_msg->sync_flags = 1; + test_msg->tot.tow = 0; + test_msg->tot.wn = 0; + test_msg->tow_flags = 0; + test_msg->track_flags = 11; + test_msg->uptime = 1; + + EXPECT_EQ(send_message(0x11, 26427, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 26427); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->L.f, 14) + << "incorrect value for L.f, expected 14, is " << last_msg_->L.f; + EXPECT_EQ(last_msg_->L.i, 1810) + << "incorrect value for L.i, expected 1810, is " << last_msg_->L.i; + EXPECT_EQ(last_msg_->P, 0) + << "incorrect value for P, expected 0, is " << last_msg_->P; + EXPECT_EQ(last_msg_->P_std, 0) + << "incorrect value for P_std, expected 0, is " << last_msg_->P_std; + EXPECT_EQ(last_msg_->acceleration, -32) + << "incorrect value for acceleration, expected -32, is " + << last_msg_->acceleration; + EXPECT_EQ(last_msg_->clock_drift, 0) + << "incorrect value for clock_drift, expected 0, is " + << last_msg_->clock_drift; + EXPECT_EQ(last_msg_->clock_offset, 0) + << "incorrect value for clock_offset, expected 0, is " + << last_msg_->clock_offset; + EXPECT_EQ(last_msg_->cn0, 175) + << "incorrect value for cn0, expected 175, is " << last_msg_->cn0; + EXPECT_EQ(last_msg_->corr_spacing, 40) + << "incorrect value for corr_spacing, expected 40, is " + << last_msg_->corr_spacing; + EXPECT_EQ(last_msg_->doppler, 15667) + << "incorrect value for doppler, expected 15667, is " + << last_msg_->doppler; + EXPECT_EQ(last_msg_->doppler_std, 30) + << "incorrect value for doppler_std, expected 30, is " + << last_msg_->doppler_std; + EXPECT_EQ(last_msg_->lock, 14032) + << "incorrect value for lock, expected 14032, is " << last_msg_->lock; + EXPECT_EQ(last_msg_->misc_flags, 9) + << "incorrect value for misc_flags, expected 9, is " + << last_msg_->misc_flags; + EXPECT_EQ(last_msg_->nav_flags, 0) + << "incorrect value for nav_flags, expected 0, is " + << last_msg_->nav_flags; + EXPECT_EQ(last_msg_->pset_flags, 0) + << "incorrect value for pset_flags, expected 0, is " + << last_msg_->pset_flags; + EXPECT_EQ(last_msg_->recv_time, 8409447265) + << "incorrect value for recv_time, expected 8409447265, is " + << last_msg_->recv_time; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 15) + << "incorrect value for sid.sat, expected 15, is " << last_msg_->sid.sat; + EXPECT_EQ(last_msg_->sync_flags, 1) + << "incorrect value for sync_flags, expected 1, is " + << last_msg_->sync_flags; + EXPECT_EQ(last_msg_->tot.tow, 0) + << "incorrect value for tot.tow, expected 0, is " << last_msg_->tot.tow; + EXPECT_EQ(last_msg_->tot.wn, 0) + << "incorrect value for tot.wn, expected 0, is " << last_msg_->tot.wn; + EXPECT_EQ(last_msg_->tow_flags, 0) + << "incorrect value for tow_flags, expected 0, is " + << last_msg_->tow_flags; + EXPECT_EQ(last_msg_->track_flags, 11) + << "incorrect value for track_flags, expected 11, is " + << last_msg_->track_flags; + EXPECT_EQ(last_msg_->uptime, 1) + << "incorrect value for uptime, expected 1, is " << last_msg_->uptime; } -class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_state_detailed_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_state_detailed_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -359,134 +432,172 @@ class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_state_detailed_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep2, Test) -{ - - uint8_t encoded_frame[] = {85,17,0,59,103,55,139,218,236,18,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,250,8,0,0,8,179,208,54,15,0,0,0,67,61,0,0,22,0,2,0,0,0,0,0,0,0,40,0,27,1,0,11,0,2,9,217,159, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_state_detailed_dep_t* test_msg = ( msg_tracking_state_detailed_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->L.f = 8; - test_msg->L.i = 2298; - test_msg->P = 0; - test_msg->P_std = 0; - test_msg->acceleration = 27; - test_msg->clock_drift = 0; - test_msg->clock_offset = 0; - test_msg->cn0 = 179; - test_msg->corr_spacing = 40; - test_msg->doppler = 15683; - test_msg->doppler_std = 22; - test_msg->lock = 14032; - test_msg->misc_flags = 9; - test_msg->nav_flags = 0; - test_msg->pset_flags = 2; - test_msg->recv_time = 8907446923; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 15; - test_msg->sync_flags = 1; - test_msg->tot.tow = 0; - test_msg->tot.wn = 0; - test_msg->tow_flags = 0; - test_msg->track_flags = 11; - test_msg->uptime = 2; - - EXPECT_EQ(send_message( 0x11, 26427, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 26427); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->L.f, 8) << "incorrect value for L.f, expected 8, is " << last_msg_->L.f; - EXPECT_EQ(last_msg_->L.i, 2298) << "incorrect value for L.i, expected 2298, is " << last_msg_->L.i; - EXPECT_EQ(last_msg_->P, 0) << "incorrect value for P, expected 0, is " << last_msg_->P; - EXPECT_EQ(last_msg_->P_std, 0) << "incorrect value for P_std, expected 0, is " << last_msg_->P_std; - EXPECT_EQ(last_msg_->acceleration, 27) << "incorrect value for acceleration, expected 27, is " << last_msg_->acceleration; - EXPECT_EQ(last_msg_->clock_drift, 0) << "incorrect value for clock_drift, expected 0, is " << last_msg_->clock_drift; - EXPECT_EQ(last_msg_->clock_offset, 0) << "incorrect value for clock_offset, expected 0, is " << last_msg_->clock_offset; - EXPECT_EQ(last_msg_->cn0, 179) << "incorrect value for cn0, expected 179, is " << last_msg_->cn0; - EXPECT_EQ(last_msg_->corr_spacing, 40) << "incorrect value for corr_spacing, expected 40, is " << last_msg_->corr_spacing; - EXPECT_EQ(last_msg_->doppler, 15683) << "incorrect value for doppler, expected 15683, is " << last_msg_->doppler; - EXPECT_EQ(last_msg_->doppler_std, 22) << "incorrect value for doppler_std, expected 22, is " << last_msg_->doppler_std; - EXPECT_EQ(last_msg_->lock, 14032) << "incorrect value for lock, expected 14032, is " << last_msg_->lock; - EXPECT_EQ(last_msg_->misc_flags, 9) << "incorrect value for misc_flags, expected 9, is " << last_msg_->misc_flags; - EXPECT_EQ(last_msg_->nav_flags, 0) << "incorrect value for nav_flags, expected 0, is " << last_msg_->nav_flags; - EXPECT_EQ(last_msg_->pset_flags, 2) << "incorrect value for pset_flags, expected 2, is " << last_msg_->pset_flags; - EXPECT_EQ(last_msg_->recv_time, 8907446923) << "incorrect value for recv_time, expected 8907446923, is " << last_msg_->recv_time; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 15) << "incorrect value for sid.sat, expected 15, is " << last_msg_->sid.sat; - EXPECT_EQ(last_msg_->sync_flags, 1) << "incorrect value for sync_flags, expected 1, is " << last_msg_->sync_flags; - EXPECT_EQ(last_msg_->tot.tow, 0) << "incorrect value for tot.tow, expected 0, is " << last_msg_->tot.tow; - EXPECT_EQ(last_msg_->tot.wn, 0) << "incorrect value for tot.wn, expected 0, is " << last_msg_->tot.wn; - EXPECT_EQ(last_msg_->tow_flags, 0) << "incorrect value for tow_flags, expected 0, is " << last_msg_->tow_flags; - EXPECT_EQ(last_msg_->track_flags, 11) << "incorrect value for track_flags, expected 11, is " << last_msg_->track_flags; - EXPECT_EQ(last_msg_->uptime, 2) << "incorrect value for uptime, expected 2, is " << last_msg_->uptime; +}; + +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep2, Test) { + uint8_t encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 139, 218, 236, 18, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 8, 0, 0, 8, 179, + 208, 54, 15, 0, 0, 0, 67, 61, 0, 0, 22, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 27, 1, 0, 11, 0, 2, 9, 217, 159, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_state_detailed_dep_t *test_msg = + (msg_tracking_state_detailed_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->L.f = 8; + test_msg->L.i = 2298; + test_msg->P = 0; + test_msg->P_std = 0; + test_msg->acceleration = 27; + test_msg->clock_drift = 0; + test_msg->clock_offset = 0; + test_msg->cn0 = 179; + test_msg->corr_spacing = 40; + test_msg->doppler = 15683; + test_msg->doppler_std = 22; + test_msg->lock = 14032; + test_msg->misc_flags = 9; + test_msg->nav_flags = 0; + test_msg->pset_flags = 2; + test_msg->recv_time = 8907446923; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 15; + test_msg->sync_flags = 1; + test_msg->tot.tow = 0; + test_msg->tot.wn = 0; + test_msg->tow_flags = 0; + test_msg->track_flags = 11; + test_msg->uptime = 2; + + EXPECT_EQ(send_message(0x11, 26427, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 26427); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->L.f, 8) + << "incorrect value for L.f, expected 8, is " << last_msg_->L.f; + EXPECT_EQ(last_msg_->L.i, 2298) + << "incorrect value for L.i, expected 2298, is " << last_msg_->L.i; + EXPECT_EQ(last_msg_->P, 0) + << "incorrect value for P, expected 0, is " << last_msg_->P; + EXPECT_EQ(last_msg_->P_std, 0) + << "incorrect value for P_std, expected 0, is " << last_msg_->P_std; + EXPECT_EQ(last_msg_->acceleration, 27) + << "incorrect value for acceleration, expected 27, is " + << last_msg_->acceleration; + EXPECT_EQ(last_msg_->clock_drift, 0) + << "incorrect value for clock_drift, expected 0, is " + << last_msg_->clock_drift; + EXPECT_EQ(last_msg_->clock_offset, 0) + << "incorrect value for clock_offset, expected 0, is " + << last_msg_->clock_offset; + EXPECT_EQ(last_msg_->cn0, 179) + << "incorrect value for cn0, expected 179, is " << last_msg_->cn0; + EXPECT_EQ(last_msg_->corr_spacing, 40) + << "incorrect value for corr_spacing, expected 40, is " + << last_msg_->corr_spacing; + EXPECT_EQ(last_msg_->doppler, 15683) + << "incorrect value for doppler, expected 15683, is " + << last_msg_->doppler; + EXPECT_EQ(last_msg_->doppler_std, 22) + << "incorrect value for doppler_std, expected 22, is " + << last_msg_->doppler_std; + EXPECT_EQ(last_msg_->lock, 14032) + << "incorrect value for lock, expected 14032, is " << last_msg_->lock; + EXPECT_EQ(last_msg_->misc_flags, 9) + << "incorrect value for misc_flags, expected 9, is " + << last_msg_->misc_flags; + EXPECT_EQ(last_msg_->nav_flags, 0) + << "incorrect value for nav_flags, expected 0, is " + << last_msg_->nav_flags; + EXPECT_EQ(last_msg_->pset_flags, 2) + << "incorrect value for pset_flags, expected 2, is " + << last_msg_->pset_flags; + EXPECT_EQ(last_msg_->recv_time, 8907446923) + << "incorrect value for recv_time, expected 8907446923, is " + << last_msg_->recv_time; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 15) + << "incorrect value for sid.sat, expected 15, is " << last_msg_->sid.sat; + EXPECT_EQ(last_msg_->sync_flags, 1) + << "incorrect value for sync_flags, expected 1, is " + << last_msg_->sync_flags; + EXPECT_EQ(last_msg_->tot.tow, 0) + << "incorrect value for tot.tow, expected 0, is " << last_msg_->tot.tow; + EXPECT_EQ(last_msg_->tot.wn, 0) + << "incorrect value for tot.wn, expected 0, is " << last_msg_->tot.wn; + EXPECT_EQ(last_msg_->tow_flags, 0) + << "incorrect value for tow_flags, expected 0, is " + << last_msg_->tow_flags; + EXPECT_EQ(last_msg_->track_flags, 11) + << "incorrect value for track_flags, expected 11, is " + << last_msg_->track_flags; + EXPECT_EQ(last_msg_->uptime, 2) + << "incorrect value for uptime, expected 2, is " << last_msg_->uptime; } -class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_state_detailed_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_state_detailed_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -496,134 +607,172 @@ class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_state_detailed_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep3, Test) -{ - - uint8_t encoded_frame[] = {85,17,0,59,103,55,255,251,170,48,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,226,10,0,0,125,181,208,54,15,0,0,0,29,61,0,0,10,0,2,0,0,0,0,0,0,0,40,0,220,1,0,11,0,3,9,66,95, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_state_detailed_dep_t* test_msg = ( msg_tracking_state_detailed_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->L.f = 125; - test_msg->L.i = 2786; - test_msg->P = 0; - test_msg->P_std = 0; - test_msg->acceleration = -36; - test_msg->clock_drift = 0; - test_msg->clock_offset = 0; - test_msg->cn0 = 181; - test_msg->corr_spacing = 40; - test_msg->doppler = 15645; - test_msg->doppler_std = 10; - test_msg->lock = 14032; - test_msg->misc_flags = 9; - test_msg->nav_flags = 0; - test_msg->pset_flags = 3; - test_msg->recv_time = 9406446591; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 15; - test_msg->sync_flags = 1; - test_msg->tot.tow = 0; - test_msg->tot.wn = 0; - test_msg->tow_flags = 0; - test_msg->track_flags = 11; - test_msg->uptime = 2; - - EXPECT_EQ(send_message( 0x11, 26427, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 26427); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->L.f, 125) << "incorrect value for L.f, expected 125, is " << last_msg_->L.f; - EXPECT_EQ(last_msg_->L.i, 2786) << "incorrect value for L.i, expected 2786, is " << last_msg_->L.i; - EXPECT_EQ(last_msg_->P, 0) << "incorrect value for P, expected 0, is " << last_msg_->P; - EXPECT_EQ(last_msg_->P_std, 0) << "incorrect value for P_std, expected 0, is " << last_msg_->P_std; - EXPECT_EQ(last_msg_->acceleration, -36) << "incorrect value for acceleration, expected -36, is " << last_msg_->acceleration; - EXPECT_EQ(last_msg_->clock_drift, 0) << "incorrect value for clock_drift, expected 0, is " << last_msg_->clock_drift; - EXPECT_EQ(last_msg_->clock_offset, 0) << "incorrect value for clock_offset, expected 0, is " << last_msg_->clock_offset; - EXPECT_EQ(last_msg_->cn0, 181) << "incorrect value for cn0, expected 181, is " << last_msg_->cn0; - EXPECT_EQ(last_msg_->corr_spacing, 40) << "incorrect value for corr_spacing, expected 40, is " << last_msg_->corr_spacing; - EXPECT_EQ(last_msg_->doppler, 15645) << "incorrect value for doppler, expected 15645, is " << last_msg_->doppler; - EXPECT_EQ(last_msg_->doppler_std, 10) << "incorrect value for doppler_std, expected 10, is " << last_msg_->doppler_std; - EXPECT_EQ(last_msg_->lock, 14032) << "incorrect value for lock, expected 14032, is " << last_msg_->lock; - EXPECT_EQ(last_msg_->misc_flags, 9) << "incorrect value for misc_flags, expected 9, is " << last_msg_->misc_flags; - EXPECT_EQ(last_msg_->nav_flags, 0) << "incorrect value for nav_flags, expected 0, is " << last_msg_->nav_flags; - EXPECT_EQ(last_msg_->pset_flags, 3) << "incorrect value for pset_flags, expected 3, is " << last_msg_->pset_flags; - EXPECT_EQ(last_msg_->recv_time, 9406446591) << "incorrect value for recv_time, expected 9406446591, is " << last_msg_->recv_time; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 15) << "incorrect value for sid.sat, expected 15, is " << last_msg_->sid.sat; - EXPECT_EQ(last_msg_->sync_flags, 1) << "incorrect value for sync_flags, expected 1, is " << last_msg_->sync_flags; - EXPECT_EQ(last_msg_->tot.tow, 0) << "incorrect value for tot.tow, expected 0, is " << last_msg_->tot.tow; - EXPECT_EQ(last_msg_->tot.wn, 0) << "incorrect value for tot.wn, expected 0, is " << last_msg_->tot.wn; - EXPECT_EQ(last_msg_->tow_flags, 0) << "incorrect value for tow_flags, expected 0, is " << last_msg_->tow_flags; - EXPECT_EQ(last_msg_->track_flags, 11) << "incorrect value for track_flags, expected 11, is " << last_msg_->track_flags; - EXPECT_EQ(last_msg_->uptime, 2) << "incorrect value for uptime, expected 2, is " << last_msg_->uptime; +}; + +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep3, Test) { + uint8_t encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 255, 251, 170, 48, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 226, 10, 0, 0, 125, 181, + 208, 54, 15, 0, 0, 0, 29, 61, 0, 0, 10, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 220, 1, 0, 11, 0, 3, 9, 66, 95, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_state_detailed_dep_t *test_msg = + (msg_tracking_state_detailed_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->L.f = 125; + test_msg->L.i = 2786; + test_msg->P = 0; + test_msg->P_std = 0; + test_msg->acceleration = -36; + test_msg->clock_drift = 0; + test_msg->clock_offset = 0; + test_msg->cn0 = 181; + test_msg->corr_spacing = 40; + test_msg->doppler = 15645; + test_msg->doppler_std = 10; + test_msg->lock = 14032; + test_msg->misc_flags = 9; + test_msg->nav_flags = 0; + test_msg->pset_flags = 3; + test_msg->recv_time = 9406446591; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 15; + test_msg->sync_flags = 1; + test_msg->tot.tow = 0; + test_msg->tot.wn = 0; + test_msg->tow_flags = 0; + test_msg->track_flags = 11; + test_msg->uptime = 2; + + EXPECT_EQ(send_message(0x11, 26427, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 26427); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->L.f, 125) + << "incorrect value for L.f, expected 125, is " << last_msg_->L.f; + EXPECT_EQ(last_msg_->L.i, 2786) + << "incorrect value for L.i, expected 2786, is " << last_msg_->L.i; + EXPECT_EQ(last_msg_->P, 0) + << "incorrect value for P, expected 0, is " << last_msg_->P; + EXPECT_EQ(last_msg_->P_std, 0) + << "incorrect value for P_std, expected 0, is " << last_msg_->P_std; + EXPECT_EQ(last_msg_->acceleration, -36) + << "incorrect value for acceleration, expected -36, is " + << last_msg_->acceleration; + EXPECT_EQ(last_msg_->clock_drift, 0) + << "incorrect value for clock_drift, expected 0, is " + << last_msg_->clock_drift; + EXPECT_EQ(last_msg_->clock_offset, 0) + << "incorrect value for clock_offset, expected 0, is " + << last_msg_->clock_offset; + EXPECT_EQ(last_msg_->cn0, 181) + << "incorrect value for cn0, expected 181, is " << last_msg_->cn0; + EXPECT_EQ(last_msg_->corr_spacing, 40) + << "incorrect value for corr_spacing, expected 40, is " + << last_msg_->corr_spacing; + EXPECT_EQ(last_msg_->doppler, 15645) + << "incorrect value for doppler, expected 15645, is " + << last_msg_->doppler; + EXPECT_EQ(last_msg_->doppler_std, 10) + << "incorrect value for doppler_std, expected 10, is " + << last_msg_->doppler_std; + EXPECT_EQ(last_msg_->lock, 14032) + << "incorrect value for lock, expected 14032, is " << last_msg_->lock; + EXPECT_EQ(last_msg_->misc_flags, 9) + << "incorrect value for misc_flags, expected 9, is " + << last_msg_->misc_flags; + EXPECT_EQ(last_msg_->nav_flags, 0) + << "incorrect value for nav_flags, expected 0, is " + << last_msg_->nav_flags; + EXPECT_EQ(last_msg_->pset_flags, 3) + << "incorrect value for pset_flags, expected 3, is " + << last_msg_->pset_flags; + EXPECT_EQ(last_msg_->recv_time, 9406446591) + << "incorrect value for recv_time, expected 9406446591, is " + << last_msg_->recv_time; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 15) + << "incorrect value for sid.sat, expected 15, is " << last_msg_->sid.sat; + EXPECT_EQ(last_msg_->sync_flags, 1) + << "incorrect value for sync_flags, expected 1, is " + << last_msg_->sync_flags; + EXPECT_EQ(last_msg_->tot.tow, 0) + << "incorrect value for tot.tow, expected 0, is " << last_msg_->tot.tow; + EXPECT_EQ(last_msg_->tot.wn, 0) + << "incorrect value for tot.wn, expected 0, is " << last_msg_->tot.wn; + EXPECT_EQ(last_msg_->tow_flags, 0) + << "incorrect value for tow_flags, expected 0, is " + << last_msg_->tow_flags; + EXPECT_EQ(last_msg_->track_flags, 11) + << "incorrect value for track_flags, expected 11, is " + << last_msg_->track_flags; + EXPECT_EQ(last_msg_->uptime, 2) + << "incorrect value for uptime, expected 2, is " << last_msg_->uptime; } -class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_state_detailed_dep_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_state_detailed_dep_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -633,83 +782,126 @@ class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_state_detailed_dep_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep4, Test) -{ - - uint8_t encoded_frame[] = {85,17,0,59,103,55,189,95,120,78,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,12,0,0,64,184,208,54,15,0,0,0,24,61,0,0,4,0,3,0,0,0,0,0,0,0,40,0,2,1,0,11,0,3,9,194,206, }; - - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_state_detailed_dep_t* test_msg = ( msg_tracking_state_detailed_dep_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->L.f = 64; - test_msg->L.i = 3275; - test_msg->P = 0; - test_msg->P_std = 0; - test_msg->acceleration = 2; - test_msg->clock_drift = 0; - test_msg->clock_offset = 0; - test_msg->cn0 = 184; - test_msg->corr_spacing = 40; - test_msg->doppler = 15640; - test_msg->doppler_std = 4; - test_msg->lock = 14032; - test_msg->misc_flags = 9; - test_msg->nav_flags = 0; - test_msg->pset_flags = 3; - test_msg->recv_time = 9906446269; - test_msg->sid.code = 0; - test_msg->sid.reserved = 0; - test_msg->sid.sat = 15; - test_msg->sync_flags = 1; - test_msg->tot.tow = 0; - test_msg->tot.wn = 0; - test_msg->tow_flags = 0; - test_msg->track_flags = 11; - test_msg->uptime = 3; - - EXPECT_EQ(send_message( 0x11, 26427, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } - - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 26427); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->L.f, 64) << "incorrect value for L.f, expected 64, is " << last_msg_->L.f; - EXPECT_EQ(last_msg_->L.i, 3275) << "incorrect value for L.i, expected 3275, is " << last_msg_->L.i; - EXPECT_EQ(last_msg_->P, 0) << "incorrect value for P, expected 0, is " << last_msg_->P; - EXPECT_EQ(last_msg_->P_std, 0) << "incorrect value for P_std, expected 0, is " << last_msg_->P_std; - EXPECT_EQ(last_msg_->acceleration, 2) << "incorrect value for acceleration, expected 2, is " << last_msg_->acceleration; - EXPECT_EQ(last_msg_->clock_drift, 0) << "incorrect value for clock_drift, expected 0, is " << last_msg_->clock_drift; - EXPECT_EQ(last_msg_->clock_offset, 0) << "incorrect value for clock_offset, expected 0, is " << last_msg_->clock_offset; - EXPECT_EQ(last_msg_->cn0, 184) << "incorrect value for cn0, expected 184, is " << last_msg_->cn0; - EXPECT_EQ(last_msg_->corr_spacing, 40) << "incorrect value for corr_spacing, expected 40, is " << last_msg_->corr_spacing; - EXPECT_EQ(last_msg_->doppler, 15640) << "incorrect value for doppler, expected 15640, is " << last_msg_->doppler; - EXPECT_EQ(last_msg_->doppler_std, 4) << "incorrect value for doppler_std, expected 4, is " << last_msg_->doppler_std; - EXPECT_EQ(last_msg_->lock, 14032) << "incorrect value for lock, expected 14032, is " << last_msg_->lock; - EXPECT_EQ(last_msg_->misc_flags, 9) << "incorrect value for misc_flags, expected 9, is " << last_msg_->misc_flags; - EXPECT_EQ(last_msg_->nav_flags, 0) << "incorrect value for nav_flags, expected 0, is " << last_msg_->nav_flags; - EXPECT_EQ(last_msg_->pset_flags, 3) << "incorrect value for pset_flags, expected 3, is " << last_msg_->pset_flags; - EXPECT_EQ(last_msg_->recv_time, 9906446269) << "incorrect value for recv_time, expected 9906446269, is " << last_msg_->recv_time; - EXPECT_EQ(last_msg_->sid.code, 0) << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.reserved, 0) << "incorrect value for sid.reserved, expected 0, is " << last_msg_->sid.reserved; - EXPECT_EQ(last_msg_->sid.sat, 15) << "incorrect value for sid.sat, expected 15, is " << last_msg_->sid.sat; - EXPECT_EQ(last_msg_->sync_flags, 1) << "incorrect value for sync_flags, expected 1, is " << last_msg_->sync_flags; - EXPECT_EQ(last_msg_->tot.tow, 0) << "incorrect value for tot.tow, expected 0, is " << last_msg_->tot.tow; - EXPECT_EQ(last_msg_->tot.wn, 0) << "incorrect value for tot.wn, expected 0, is " << last_msg_->tot.wn; - EXPECT_EQ(last_msg_->tow_flags, 0) << "incorrect value for tow_flags, expected 0, is " << last_msg_->tow_flags; - EXPECT_EQ(last_msg_->track_flags, 11) << "incorrect value for track_flags, expected 11, is " << last_msg_->track_flags; - EXPECT_EQ(last_msg_->uptime, 3) << "incorrect value for uptime, expected 3, is " << last_msg_->uptime; +}; + +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDep4, Test) { + uint8_t encoded_frame[] = { + 85, 17, 0, 59, 103, 55, 189, 95, 120, 78, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 203, 12, 0, 0, 64, 184, + 208, 54, 15, 0, 0, 0, 24, 61, 0, 0, 4, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 2, 1, 0, 11, 0, 3, 9, 194, 206, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_state_detailed_dep_t *test_msg = + (msg_tracking_state_detailed_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->L.f = 64; + test_msg->L.i = 3275; + test_msg->P = 0; + test_msg->P_std = 0; + test_msg->acceleration = 2; + test_msg->clock_drift = 0; + test_msg->clock_offset = 0; + test_msg->cn0 = 184; + test_msg->corr_spacing = 40; + test_msg->doppler = 15640; + test_msg->doppler_std = 4; + test_msg->lock = 14032; + test_msg->misc_flags = 9; + test_msg->nav_flags = 0; + test_msg->pset_flags = 3; + test_msg->recv_time = 9906446269; + test_msg->sid.code = 0; + test_msg->sid.reserved = 0; + test_msg->sid.sat = 15; + test_msg->sync_flags = 1; + test_msg->tot.tow = 0; + test_msg->tot.wn = 0; + test_msg->tow_flags = 0; + test_msg->track_flags = 11; + test_msg->uptime = 3; + + EXPECT_EQ(send_message(0x11, 26427, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 26427); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->L.f, 64) + << "incorrect value for L.f, expected 64, is " << last_msg_->L.f; + EXPECT_EQ(last_msg_->L.i, 3275) + << "incorrect value for L.i, expected 3275, is " << last_msg_->L.i; + EXPECT_EQ(last_msg_->P, 0) + << "incorrect value for P, expected 0, is " << last_msg_->P; + EXPECT_EQ(last_msg_->P_std, 0) + << "incorrect value for P_std, expected 0, is " << last_msg_->P_std; + EXPECT_EQ(last_msg_->acceleration, 2) + << "incorrect value for acceleration, expected 2, is " + << last_msg_->acceleration; + EXPECT_EQ(last_msg_->clock_drift, 0) + << "incorrect value for clock_drift, expected 0, is " + << last_msg_->clock_drift; + EXPECT_EQ(last_msg_->clock_offset, 0) + << "incorrect value for clock_offset, expected 0, is " + << last_msg_->clock_offset; + EXPECT_EQ(last_msg_->cn0, 184) + << "incorrect value for cn0, expected 184, is " << last_msg_->cn0; + EXPECT_EQ(last_msg_->corr_spacing, 40) + << "incorrect value for corr_spacing, expected 40, is " + << last_msg_->corr_spacing; + EXPECT_EQ(last_msg_->doppler, 15640) + << "incorrect value for doppler, expected 15640, is " + << last_msg_->doppler; + EXPECT_EQ(last_msg_->doppler_std, 4) + << "incorrect value for doppler_std, expected 4, is " + << last_msg_->doppler_std; + EXPECT_EQ(last_msg_->lock, 14032) + << "incorrect value for lock, expected 14032, is " << last_msg_->lock; + EXPECT_EQ(last_msg_->misc_flags, 9) + << "incorrect value for misc_flags, expected 9, is " + << last_msg_->misc_flags; + EXPECT_EQ(last_msg_->nav_flags, 0) + << "incorrect value for nav_flags, expected 0, is " + << last_msg_->nav_flags; + EXPECT_EQ(last_msg_->pset_flags, 3) + << "incorrect value for pset_flags, expected 3, is " + << last_msg_->pset_flags; + EXPECT_EQ(last_msg_->recv_time, 9906446269) + << "incorrect value for recv_time, expected 9906446269, is " + << last_msg_->recv_time; + EXPECT_EQ(last_msg_->sid.code, 0) + << "incorrect value for sid.code, expected 0, is " << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.reserved, 0) + << "incorrect value for sid.reserved, expected 0, is " + << last_msg_->sid.reserved; + EXPECT_EQ(last_msg_->sid.sat, 15) + << "incorrect value for sid.sat, expected 15, is " << last_msg_->sid.sat; + EXPECT_EQ(last_msg_->sync_flags, 1) + << "incorrect value for sync_flags, expected 1, is " + << last_msg_->sync_flags; + EXPECT_EQ(last_msg_->tot.tow, 0) + << "incorrect value for tot.tow, expected 0, is " << last_msg_->tot.tow; + EXPECT_EQ(last_msg_->tot.wn, 0) + << "incorrect value for tot.wn, expected 0, is " << last_msg_->tot.wn; + EXPECT_EQ(last_msg_->tow_flags, 0) + << "incorrect value for tow_flags, expected 0, is " + << last_msg_->tow_flags; + EXPECT_EQ(last_msg_->track_flags, 11) + << "incorrect value for track_flags, expected 11, is " + << last_msg_->track_flags; + EXPECT_EQ(last_msg_->uptime, 3) + << "incorrect value for uptime, expected 3, is " << last_msg_->uptime; } diff --git a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.cc b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.cc index b5f812039..4e9f0bde9 100644 --- a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgTrackingStateDetailedDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgTrackingStateDetailedDepA.yaml +// by generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast( + last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_state_detailed_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_state_detailed_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,83 +82,131 @@ class Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_state_detailed_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA0, Test) -{ +}; - uint8_t encoded_frame[] = {85,33,0,155,110,57,46,31,180,38,219,0,0,0,133,100,71,94,192,2,160,207,212,255,135,139,62,62,179,83,227,245,134,160,204,78,95,255,38,59,161,15,255,86,189,248,31,191,136,194,124,23,15,91,249,117,142,90,219,67,25,83,62,122,100, }; +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgTrackingStateDetailedDepA0, + Test) { + uint8_t encoded_frame[] = { + 85, 33, 0, 155, 110, 57, 46, 31, 180, 38, 219, 0, 0, + 0, 133, 100, 71, 94, 192, 2, 160, 207, 212, 255, 135, 139, + 62, 62, 179, 83, 227, 245, 134, 160, 204, 78, 95, 255, 38, + 59, 161, 15, 255, 86, 189, 248, 31, 191, 136, 194, 124, 23, + 15, 91, 249, 117, 142, 90, 219, 67, 25, 83, 62, 122, 100, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_state_detailed_dep_a_t* test_msg = ( msg_tracking_state_detailed_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->L.f = 204; - test_msg->L.i = -1601767965; - test_msg->P = 1044286343; - test_msg->P_std = 21427; - test_msg->acceleration = -114; - test_msg->clock_drift = 23311; - test_msg->clock_offset = 6012; - test_msg->cn0 = 78; - test_msg->corr_spacing = 30201; - test_msg->doppler = 1459556257; - test_msg->doppler_std = 63677; - test_msg->lock = 65375; - test_msg->misc_flags = 62; - test_msg->nav_flags = 25; - test_msg->pset_flags = 83; - test_msg->recv_time = 941247176494; - test_msg->sid.code = 59; - test_msg->sid.sat = 38; - test_msg->sync_flags = 90; - test_msg->tot.ns_residual = -811597120; - test_msg->tot.tow = 1581737093; - test_msg->tot.wn = 65492; - test_msg->tow_flags = 219; - test_msg->track_flags = 67; - test_msg->uptime = 3263741727; - - EXPECT_EQ(send_message( 0x21, 28315, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_state_detailed_dep_a_t *test_msg = + (msg_tracking_state_detailed_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->L.f = 204; + test_msg->L.i = -1601767965; + test_msg->P = 1044286343; + test_msg->P_std = 21427; + test_msg->acceleration = -114; + test_msg->clock_drift = 23311; + test_msg->clock_offset = 6012; + test_msg->cn0 = 78; + test_msg->corr_spacing = 30201; + test_msg->doppler = 1459556257; + test_msg->doppler_std = 63677; + test_msg->lock = 65375; + test_msg->misc_flags = 62; + test_msg->nav_flags = 25; + test_msg->pset_flags = 83; + test_msg->recv_time = 941247176494; + test_msg->sid.code = 59; + test_msg->sid.sat = 38; + test_msg->sync_flags = 90; + test_msg->tot.ns_residual = -811597120; + test_msg->tot.tow = 1581737093; + test_msg->tot.wn = 65492; + test_msg->tow_flags = 219; + test_msg->track_flags = 67; + test_msg->uptime = 3263741727; + + EXPECT_EQ(send_message(0x21, 28315, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 28315); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->L.f, 204) << "incorrect value for L.f, expected 204, is " << last_msg_->L.f; - EXPECT_EQ(last_msg_->L.i, -1601767965) << "incorrect value for L.i, expected -1601767965, is " << last_msg_->L.i; - EXPECT_EQ(last_msg_->P, 1044286343) << "incorrect value for P, expected 1044286343, is " << last_msg_->P; - EXPECT_EQ(last_msg_->P_std, 21427) << "incorrect value for P_std, expected 21427, is " << last_msg_->P_std; - EXPECT_EQ(last_msg_->acceleration, -114) << "incorrect value for acceleration, expected -114, is " << last_msg_->acceleration; - EXPECT_EQ(last_msg_->clock_drift, 23311) << "incorrect value for clock_drift, expected 23311, is " << last_msg_->clock_drift; - EXPECT_EQ(last_msg_->clock_offset, 6012) << "incorrect value for clock_offset, expected 6012, is " << last_msg_->clock_offset; - EXPECT_EQ(last_msg_->cn0, 78) << "incorrect value for cn0, expected 78, is " << last_msg_->cn0; - EXPECT_EQ(last_msg_->corr_spacing, 30201) << "incorrect value for corr_spacing, expected 30201, is " << last_msg_->corr_spacing; - EXPECT_EQ(last_msg_->doppler, 1459556257) << "incorrect value for doppler, expected 1459556257, is " << last_msg_->doppler; - EXPECT_EQ(last_msg_->doppler_std, 63677) << "incorrect value for doppler_std, expected 63677, is " << last_msg_->doppler_std; - EXPECT_EQ(last_msg_->lock, 65375) << "incorrect value for lock, expected 65375, is " << last_msg_->lock; - EXPECT_EQ(last_msg_->misc_flags, 62) << "incorrect value for misc_flags, expected 62, is " << last_msg_->misc_flags; - EXPECT_EQ(last_msg_->nav_flags, 25) << "incorrect value for nav_flags, expected 25, is " << last_msg_->nav_flags; - EXPECT_EQ(last_msg_->pset_flags, 83) << "incorrect value for pset_flags, expected 83, is " << last_msg_->pset_flags; - EXPECT_EQ(last_msg_->recv_time, 941247176494) << "incorrect value for recv_time, expected 941247176494, is " << last_msg_->recv_time; - EXPECT_EQ(last_msg_->sid.code, 59) << "incorrect value for sid.code, expected 59, is " << last_msg_->sid.code; - EXPECT_EQ(last_msg_->sid.sat, 38) << "incorrect value for sid.sat, expected 38, is " << last_msg_->sid.sat; - EXPECT_EQ(last_msg_->sync_flags, 90) << "incorrect value for sync_flags, expected 90, is " << last_msg_->sync_flags; - EXPECT_EQ(last_msg_->tot.ns_residual, -811597120) << "incorrect value for tot.ns_residual, expected -811597120, is " << last_msg_->tot.ns_residual; - EXPECT_EQ(last_msg_->tot.tow, 1581737093) << "incorrect value for tot.tow, expected 1581737093, is " << last_msg_->tot.tow; - EXPECT_EQ(last_msg_->tot.wn, 65492) << "incorrect value for tot.wn, expected 65492, is " << last_msg_->tot.wn; - EXPECT_EQ(last_msg_->tow_flags, 219) << "incorrect value for tow_flags, expected 219, is " << last_msg_->tow_flags; - EXPECT_EQ(last_msg_->track_flags, 67) << "incorrect value for track_flags, expected 67, is " << last_msg_->track_flags; - EXPECT_EQ(last_msg_->uptime, 3263741727) << "incorrect value for uptime, expected 3263741727, is " << last_msg_->uptime; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 28315); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->L.f, 204) + << "incorrect value for L.f, expected 204, is " << last_msg_->L.f; + EXPECT_EQ(last_msg_->L.i, -1601767965) + << "incorrect value for L.i, expected -1601767965, is " << last_msg_->L.i; + EXPECT_EQ(last_msg_->P, 1044286343) + << "incorrect value for P, expected 1044286343, is " << last_msg_->P; + EXPECT_EQ(last_msg_->P_std, 21427) + << "incorrect value for P_std, expected 21427, is " << last_msg_->P_std; + EXPECT_EQ(last_msg_->acceleration, -114) + << "incorrect value for acceleration, expected -114, is " + << last_msg_->acceleration; + EXPECT_EQ(last_msg_->clock_drift, 23311) + << "incorrect value for clock_drift, expected 23311, is " + << last_msg_->clock_drift; + EXPECT_EQ(last_msg_->clock_offset, 6012) + << "incorrect value for clock_offset, expected 6012, is " + << last_msg_->clock_offset; + EXPECT_EQ(last_msg_->cn0, 78) + << "incorrect value for cn0, expected 78, is " << last_msg_->cn0; + EXPECT_EQ(last_msg_->corr_spacing, 30201) + << "incorrect value for corr_spacing, expected 30201, is " + << last_msg_->corr_spacing; + EXPECT_EQ(last_msg_->doppler, 1459556257) + << "incorrect value for doppler, expected 1459556257, is " + << last_msg_->doppler; + EXPECT_EQ(last_msg_->doppler_std, 63677) + << "incorrect value for doppler_std, expected 63677, is " + << last_msg_->doppler_std; + EXPECT_EQ(last_msg_->lock, 65375) + << "incorrect value for lock, expected 65375, is " << last_msg_->lock; + EXPECT_EQ(last_msg_->misc_flags, 62) + << "incorrect value for misc_flags, expected 62, is " + << last_msg_->misc_flags; + EXPECT_EQ(last_msg_->nav_flags, 25) + << "incorrect value for nav_flags, expected 25, is " + << last_msg_->nav_flags; + EXPECT_EQ(last_msg_->pset_flags, 83) + << "incorrect value for pset_flags, expected 83, is " + << last_msg_->pset_flags; + EXPECT_EQ(last_msg_->recv_time, 941247176494) + << "incorrect value for recv_time, expected 941247176494, is " + << last_msg_->recv_time; + EXPECT_EQ(last_msg_->sid.code, 59) + << "incorrect value for sid.code, expected 59, is " + << last_msg_->sid.code; + EXPECT_EQ(last_msg_->sid.sat, 38) + << "incorrect value for sid.sat, expected 38, is " << last_msg_->sid.sat; + EXPECT_EQ(last_msg_->sync_flags, 90) + << "incorrect value for sync_flags, expected 90, is " + << last_msg_->sync_flags; + EXPECT_EQ(last_msg_->tot.ns_residual, -811597120) + << "incorrect value for tot.ns_residual, expected -811597120, is " + << last_msg_->tot.ns_residual; + EXPECT_EQ(last_msg_->tot.tow, 1581737093) + << "incorrect value for tot.tow, expected 1581737093, is " + << last_msg_->tot.tow; + EXPECT_EQ(last_msg_->tot.wn, 65492) + << "incorrect value for tot.wn, expected 65492, is " << last_msg_->tot.wn; + EXPECT_EQ(last_msg_->tow_flags, 219) + << "incorrect value for tow_flags, expected 219, is " + << last_msg_->tow_flags; + EXPECT_EQ(last_msg_->track_flags, 67) + << "incorrect value for track_flags, expected 67, is " + << last_msg_->track_flags; + EXPECT_EQ(last_msg_->uptime, 3263741727) + << "incorrect value for uptime, expected 3263741727, is " + << last_msg_->uptime; } diff --git a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgtrackingStateDepA.cc b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgtrackingStateDepA.cc index 9d67219ba..29f1ac18c 100644 --- a/c/test/legacy/cpp/auto_check_sbp_tracking_MsgtrackingStateDepA.cc +++ b/c/test/legacy/cpp/auto_check_sbp_tracking_MsgtrackingStateDepA.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/tracking/test_MsgtrackingStateDepA.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/tracking/test_MsgtrackingStateDepA.yaml by +// generate.py. Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,52 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_state_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,194 +82,260 @@ class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_state_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA0, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA0, Test) { + uint8_t encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 204, 177, 51, 65, 1, 2, 198, + 4, 39, 65, 1, 3, 219, 182, 27, 65, 1, 7, 132, 120, 101, 65, + 1, 10, 91, 91, 251, 64, 1, 13, 42, 37, 163, 64, 1, 22, 130, + 184, 215, 64, 1, 30, 115, 53, 75, 65, 1, 31, 16, 74, 126, 65, + 1, 25, 132, 196, 135, 64, 1, 6, 100, 59, 223, 64, 17, 225, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_state_dep_a_t *test_msg = + (msg_tracking_state_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[0].cn0 = 11.230907440185547; + test_msg->states[0].prn = 0; + test_msg->states[0].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[1].cn0 = 10.438665390014648; + test_msg->states[1].prn = 2; + test_msg->states[1].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[2].cn0 = 9.732142448425293; + test_msg->states[2].prn = 3; + test_msg->states[2].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[3].cn0 = 14.341922760009766; + test_msg->states[3].prn = 7; + test_msg->states[3].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[4].cn0 = 7.8549017906188965; + test_msg->states[4].prn = 10; + test_msg->states[4].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[5].cn0 = 5.0982866287231445; + test_msg->states[5].prn = 13; + test_msg->states[5].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[6].cn0 = 6.741272926330566; + test_msg->states[6].prn = 22; + test_msg->states[6].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[7].cn0 = 12.700549125671387; + test_msg->states[7].prn = 30; + test_msg->states[7].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[8].cn0 = 15.893081665039062; + test_msg->states[8].prn = 31; + test_msg->states[8].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[9].cn0 = 4.242738723754883; + test_msg->states[9].prn = 25; + test_msg->states[9].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[10].cn0 = 6.97599983215332; + test_msg->states[10].prn = 6; + test_msg->states[10].state = 1; - uint8_t encoded_frame[] = {85,22,0,195,4,66,1,0,204,177,51,65,1,2,198,4,39,65,1,3,219,182,27,65,1,7,132,120,101,65,1,10,91,91,251,64,1,13,42,37,163,64,1,22,130,184,215,64,1,30,115,53,75,65,1,31,16,74,126,65,1,25,132,196,135,64,1,6,100,59,223,64,17,225, }; + EXPECT_EQ(send_message(0x16, 1219, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_state_dep_a_t* test_msg = ( msg_tracking_state_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[0].cn0 = 11.230907440185547; - test_msg->states[0].prn = 0; - test_msg->states[0].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[1].cn0 = 10.438665390014648; - test_msg->states[1].prn = 2; - test_msg->states[1].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[2].cn0 = 9.732142448425293; - test_msg->states[2].prn = 3; - test_msg->states[2].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[3].cn0 = 14.341922760009766; - test_msg->states[3].prn = 7; - test_msg->states[3].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[4].cn0 = 7.8549017906188965; - test_msg->states[4].prn = 10; - test_msg->states[4].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[5].cn0 = 5.0982866287231445; - test_msg->states[5].prn = 13; - test_msg->states[5].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[6].cn0 = 6.741272926330566; - test_msg->states[6].prn = 22; - test_msg->states[6].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[7].cn0 = 12.700549125671387; - test_msg->states[7].prn = 30; - test_msg->states[7].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[8].cn0 = 15.893081665039062; - test_msg->states[8].prn = 31; - test_msg->states[8].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[9].cn0 = 4.242738723754883; - test_msg->states[9].prn = 25; - test_msg->states[9].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[10].cn0 = 6.97599983215332; - test_msg->states[10].prn = 6; - test_msg->states[10].state = 1; - - EXPECT_EQ(send_message( 0x16, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->states[0].cn0*100 - 11.2309074402*100), 0.05) << "incorrect value for states[0].cn0, expected 11.2309074402, is " << last_msg_->states[0].cn0; - EXPECT_EQ(last_msg_->states[0].prn, 0) << "incorrect value for states[0].prn, expected 0, is " << last_msg_->states[0].prn; - EXPECT_EQ(last_msg_->states[0].state, 1) << "incorrect value for states[0].state, expected 1, is " << last_msg_->states[0].state; - EXPECT_LT((last_msg_->states[1].cn0*100 - 10.43866539*100), 0.05) << "incorrect value for states[1].cn0, expected 10.43866539, is " << last_msg_->states[1].cn0; - EXPECT_EQ(last_msg_->states[1].prn, 2) << "incorrect value for states[1].prn, expected 2, is " << last_msg_->states[1].prn; - EXPECT_EQ(last_msg_->states[1].state, 1) << "incorrect value for states[1].state, expected 1, is " << last_msg_->states[1].state; - EXPECT_LT((last_msg_->states[2].cn0*100 - 9.73214244843*100), 0.05) << "incorrect value for states[2].cn0, expected 9.73214244843, is " << last_msg_->states[2].cn0; - EXPECT_EQ(last_msg_->states[2].prn, 3) << "incorrect value for states[2].prn, expected 3, is " << last_msg_->states[2].prn; - EXPECT_EQ(last_msg_->states[2].state, 1) << "incorrect value for states[2].state, expected 1, is " << last_msg_->states[2].state; - EXPECT_LT((last_msg_->states[3].cn0*100 - 14.34192276*100), 0.05) << "incorrect value for states[3].cn0, expected 14.34192276, is " << last_msg_->states[3].cn0; - EXPECT_EQ(last_msg_->states[3].prn, 7) << "incorrect value for states[3].prn, expected 7, is " << last_msg_->states[3].prn; - EXPECT_EQ(last_msg_->states[3].state, 1) << "incorrect value for states[3].state, expected 1, is " << last_msg_->states[3].state; - EXPECT_LT((last_msg_->states[4].cn0*100 - 7.85490179062*100), 0.05) << "incorrect value for states[4].cn0, expected 7.85490179062, is " << last_msg_->states[4].cn0; - EXPECT_EQ(last_msg_->states[4].prn, 10) << "incorrect value for states[4].prn, expected 10, is " << last_msg_->states[4].prn; - EXPECT_EQ(last_msg_->states[4].state, 1) << "incorrect value for states[4].state, expected 1, is " << last_msg_->states[4].state; - EXPECT_LT((last_msg_->states[5].cn0*100 - 5.09828662872*100), 0.05) << "incorrect value for states[5].cn0, expected 5.09828662872, is " << last_msg_->states[5].cn0; - EXPECT_EQ(last_msg_->states[5].prn, 13) << "incorrect value for states[5].prn, expected 13, is " << last_msg_->states[5].prn; - EXPECT_EQ(last_msg_->states[5].state, 1) << "incorrect value for states[5].state, expected 1, is " << last_msg_->states[5].state; - EXPECT_LT((last_msg_->states[6].cn0*100 - 6.74127292633*100), 0.05) << "incorrect value for states[6].cn0, expected 6.74127292633, is " << last_msg_->states[6].cn0; - EXPECT_EQ(last_msg_->states[6].prn, 22) << "incorrect value for states[6].prn, expected 22, is " << last_msg_->states[6].prn; - EXPECT_EQ(last_msg_->states[6].state, 1) << "incorrect value for states[6].state, expected 1, is " << last_msg_->states[6].state; - EXPECT_LT((last_msg_->states[7].cn0*100 - 12.7005491257*100), 0.05) << "incorrect value for states[7].cn0, expected 12.7005491257, is " << last_msg_->states[7].cn0; - EXPECT_EQ(last_msg_->states[7].prn, 30) << "incorrect value for states[7].prn, expected 30, is " << last_msg_->states[7].prn; - EXPECT_EQ(last_msg_->states[7].state, 1) << "incorrect value for states[7].state, expected 1, is " << last_msg_->states[7].state; - EXPECT_LT((last_msg_->states[8].cn0*100 - 15.893081665*100), 0.05) << "incorrect value for states[8].cn0, expected 15.893081665, is " << last_msg_->states[8].cn0; - EXPECT_EQ(last_msg_->states[8].prn, 31) << "incorrect value for states[8].prn, expected 31, is " << last_msg_->states[8].prn; - EXPECT_EQ(last_msg_->states[8].state, 1) << "incorrect value for states[8].state, expected 1, is " << last_msg_->states[8].state; - EXPECT_LT((last_msg_->states[9].cn0*100 - 4.24273872375*100), 0.05) << "incorrect value for states[9].cn0, expected 4.24273872375, is " << last_msg_->states[9].cn0; - EXPECT_EQ(last_msg_->states[9].prn, 25) << "incorrect value for states[9].prn, expected 25, is " << last_msg_->states[9].prn; - EXPECT_EQ(last_msg_->states[9].state, 1) << "incorrect value for states[9].state, expected 1, is " << last_msg_->states[9].state; - EXPECT_LT((last_msg_->states[10].cn0*100 - 6.97599983215*100), 0.05) << "incorrect value for states[10].cn0, expected 6.97599983215, is " << last_msg_->states[10].cn0; - EXPECT_EQ(last_msg_->states[10].prn, 6) << "incorrect value for states[10].prn, expected 6, is " << last_msg_->states[10].prn; - EXPECT_EQ(last_msg_->states[10].state, 1) << "incorrect value for states[10].state, expected 1, is " << last_msg_->states[10].state; + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->states[0].cn0 * 100 - 11.2309074402 * 100), 0.05) + << "incorrect value for states[0].cn0, expected 11.2309074402, is " + << last_msg_->states[0].cn0; + EXPECT_EQ(last_msg_->states[0].prn, 0) + << "incorrect value for states[0].prn, expected 0, is " + << last_msg_->states[0].prn; + EXPECT_EQ(last_msg_->states[0].state, 1) + << "incorrect value for states[0].state, expected 1, is " + << last_msg_->states[0].state; + EXPECT_LT((last_msg_->states[1].cn0 * 100 - 10.43866539 * 100), 0.05) + << "incorrect value for states[1].cn0, expected 10.43866539, is " + << last_msg_->states[1].cn0; + EXPECT_EQ(last_msg_->states[1].prn, 2) + << "incorrect value for states[1].prn, expected 2, is " + << last_msg_->states[1].prn; + EXPECT_EQ(last_msg_->states[1].state, 1) + << "incorrect value for states[1].state, expected 1, is " + << last_msg_->states[1].state; + EXPECT_LT((last_msg_->states[2].cn0 * 100 - 9.73214244843 * 100), 0.05) + << "incorrect value for states[2].cn0, expected 9.73214244843, is " + << last_msg_->states[2].cn0; + EXPECT_EQ(last_msg_->states[2].prn, 3) + << "incorrect value for states[2].prn, expected 3, is " + << last_msg_->states[2].prn; + EXPECT_EQ(last_msg_->states[2].state, 1) + << "incorrect value for states[2].state, expected 1, is " + << last_msg_->states[2].state; + EXPECT_LT((last_msg_->states[3].cn0 * 100 - 14.34192276 * 100), 0.05) + << "incorrect value for states[3].cn0, expected 14.34192276, is " + << last_msg_->states[3].cn0; + EXPECT_EQ(last_msg_->states[3].prn, 7) + << "incorrect value for states[3].prn, expected 7, is " + << last_msg_->states[3].prn; + EXPECT_EQ(last_msg_->states[3].state, 1) + << "incorrect value for states[3].state, expected 1, is " + << last_msg_->states[3].state; + EXPECT_LT((last_msg_->states[4].cn0 * 100 - 7.85490179062 * 100), 0.05) + << "incorrect value for states[4].cn0, expected 7.85490179062, is " + << last_msg_->states[4].cn0; + EXPECT_EQ(last_msg_->states[4].prn, 10) + << "incorrect value for states[4].prn, expected 10, is " + << last_msg_->states[4].prn; + EXPECT_EQ(last_msg_->states[4].state, 1) + << "incorrect value for states[4].state, expected 1, is " + << last_msg_->states[4].state; + EXPECT_LT((last_msg_->states[5].cn0 * 100 - 5.09828662872 * 100), 0.05) + << "incorrect value for states[5].cn0, expected 5.09828662872, is " + << last_msg_->states[5].cn0; + EXPECT_EQ(last_msg_->states[5].prn, 13) + << "incorrect value for states[5].prn, expected 13, is " + << last_msg_->states[5].prn; + EXPECT_EQ(last_msg_->states[5].state, 1) + << "incorrect value for states[5].state, expected 1, is " + << last_msg_->states[5].state; + EXPECT_LT((last_msg_->states[6].cn0 * 100 - 6.74127292633 * 100), 0.05) + << "incorrect value for states[6].cn0, expected 6.74127292633, is " + << last_msg_->states[6].cn0; + EXPECT_EQ(last_msg_->states[6].prn, 22) + << "incorrect value for states[6].prn, expected 22, is " + << last_msg_->states[6].prn; + EXPECT_EQ(last_msg_->states[6].state, 1) + << "incorrect value for states[6].state, expected 1, is " + << last_msg_->states[6].state; + EXPECT_LT((last_msg_->states[7].cn0 * 100 - 12.7005491257 * 100), 0.05) + << "incorrect value for states[7].cn0, expected 12.7005491257, is " + << last_msg_->states[7].cn0; + EXPECT_EQ(last_msg_->states[7].prn, 30) + << "incorrect value for states[7].prn, expected 30, is " + << last_msg_->states[7].prn; + EXPECT_EQ(last_msg_->states[7].state, 1) + << "incorrect value for states[7].state, expected 1, is " + << last_msg_->states[7].state; + EXPECT_LT((last_msg_->states[8].cn0 * 100 - 15.893081665 * 100), 0.05) + << "incorrect value for states[8].cn0, expected 15.893081665, is " + << last_msg_->states[8].cn0; + EXPECT_EQ(last_msg_->states[8].prn, 31) + << "incorrect value for states[8].prn, expected 31, is " + << last_msg_->states[8].prn; + EXPECT_EQ(last_msg_->states[8].state, 1) + << "incorrect value for states[8].state, expected 1, is " + << last_msg_->states[8].state; + EXPECT_LT((last_msg_->states[9].cn0 * 100 - 4.24273872375 * 100), 0.05) + << "incorrect value for states[9].cn0, expected 4.24273872375, is " + << last_msg_->states[9].cn0; + EXPECT_EQ(last_msg_->states[9].prn, 25) + << "incorrect value for states[9].prn, expected 25, is " + << last_msg_->states[9].prn; + EXPECT_EQ(last_msg_->states[9].state, 1) + << "incorrect value for states[9].state, expected 1, is " + << last_msg_->states[9].state; + EXPECT_LT((last_msg_->states[10].cn0 * 100 - 6.97599983215 * 100), 0.05) + << "incorrect value for states[10].cn0, expected 6.97599983215, is " + << last_msg_->states[10].cn0; + EXPECT_EQ(last_msg_->states[10].prn, 6) + << "incorrect value for states[10].prn, expected 6, is " + << last_msg_->states[10].prn; + EXPECT_EQ(last_msg_->states[10].state, 1) + << "incorrect value for states[10].state, expected 1, is " + << last_msg_->states[10].state; } -class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA1 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA1() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA1 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA1() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_state_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -282,194 +345,260 @@ class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA1 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_state_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA1, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA1, Test) { + uint8_t encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 216, 57, 48, 65, 1, 2, 145, + 41, 46, 65, 1, 3, 4, 26, 34, 65, 1, 7, 177, 67, 109, 65, + 1, 10, 61, 80, 249, 64, 1, 13, 250, 199, 155, 64, 1, 22, 55, + 19, 215, 64, 1, 30, 138, 138, 79, 65, 1, 31, 214, 179, 119, 65, + 1, 25, 53, 138, 120, 64, 1, 6, 183, 247, 129, 64, 168, 173, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_state_dep_a_t *test_msg = + (msg_tracking_state_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[0].cn0 = 11.014122009277344; + test_msg->states[0].prn = 0; + test_msg->states[0].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[1].cn0 = 10.885148048400879; + test_msg->states[1].prn = 2; + test_msg->states[1].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[2].cn0 = 10.131351470947266; + test_msg->states[2].prn = 3; + test_msg->states[2].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[3].cn0 = 14.829026222229004; + test_msg->states[3].prn = 7; + test_msg->states[3].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[4].cn0 = 7.79104471206665; + test_msg->states[4].prn = 10; + test_msg->states[4].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[5].cn0 = 4.868161201477051; + test_msg->states[5].prn = 13; + test_msg->states[5].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[6].cn0 = 6.721095561981201; + test_msg->states[6].prn = 22; + test_msg->states[6].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[7].cn0 = 12.971323013305664; + test_msg->states[7].prn = 30; + test_msg->states[7].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[8].cn0 = 15.481405258178711; + test_msg->states[8].prn = 31; + test_msg->states[8].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[9].cn0 = 3.8834354877471924; + test_msg->states[9].prn = 25; + test_msg->states[9].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[10].cn0 = 4.061488628387451; + test_msg->states[10].prn = 6; + test_msg->states[10].state = 1; + + EXPECT_EQ(send_message(0x16, 1219, test_msg_len, test_msg_storage), SBP_OK); - uint8_t encoded_frame[] = {85,22,0,195,4,66,1,0,216,57,48,65,1,2,145,41,46,65,1,3,4,26,34,65,1,7,177,67,109,65,1,10,61,80,249,64,1,13,250,199,155,64,1,22,55,19,215,64,1,30,138,138,79,65,1,31,214,179,119,65,1,25,53,138,120,64,1,6,183,247,129,64,168,173, }; + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_state_dep_a_t* test_msg = ( msg_tracking_state_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[0].cn0 = 11.014122009277344; - test_msg->states[0].prn = 0; - test_msg->states[0].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[1].cn0 = 10.885148048400879; - test_msg->states[1].prn = 2; - test_msg->states[1].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[2].cn0 = 10.131351470947266; - test_msg->states[2].prn = 3; - test_msg->states[2].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[3].cn0 = 14.829026222229004; - test_msg->states[3].prn = 7; - test_msg->states[3].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[4].cn0 = 7.79104471206665; - test_msg->states[4].prn = 10; - test_msg->states[4].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[5].cn0 = 4.868161201477051; - test_msg->states[5].prn = 13; - test_msg->states[5].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[6].cn0 = 6.721095561981201; - test_msg->states[6].prn = 22; - test_msg->states[6].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[7].cn0 = 12.971323013305664; - test_msg->states[7].prn = 30; - test_msg->states[7].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[8].cn0 = 15.481405258178711; - test_msg->states[8].prn = 31; - test_msg->states[8].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[9].cn0 = 3.8834354877471924; - test_msg->states[9].prn = 25; - test_msg->states[9].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[10].cn0 = 4.061488628387451; - test_msg->states[10].prn = 6; - test_msg->states[10].state = 1; - - EXPECT_EQ(send_message( 0x16, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->states[0].cn0*100 - 11.0141220093*100), 0.05) << "incorrect value for states[0].cn0, expected 11.0141220093, is " << last_msg_->states[0].cn0; - EXPECT_EQ(last_msg_->states[0].prn, 0) << "incorrect value for states[0].prn, expected 0, is " << last_msg_->states[0].prn; - EXPECT_EQ(last_msg_->states[0].state, 1) << "incorrect value for states[0].state, expected 1, is " << last_msg_->states[0].state; - EXPECT_LT((last_msg_->states[1].cn0*100 - 10.8851480484*100), 0.05) << "incorrect value for states[1].cn0, expected 10.8851480484, is " << last_msg_->states[1].cn0; - EXPECT_EQ(last_msg_->states[1].prn, 2) << "incorrect value for states[1].prn, expected 2, is " << last_msg_->states[1].prn; - EXPECT_EQ(last_msg_->states[1].state, 1) << "incorrect value for states[1].state, expected 1, is " << last_msg_->states[1].state; - EXPECT_LT((last_msg_->states[2].cn0*100 - 10.1313514709*100), 0.05) << "incorrect value for states[2].cn0, expected 10.1313514709, is " << last_msg_->states[2].cn0; - EXPECT_EQ(last_msg_->states[2].prn, 3) << "incorrect value for states[2].prn, expected 3, is " << last_msg_->states[2].prn; - EXPECT_EQ(last_msg_->states[2].state, 1) << "incorrect value for states[2].state, expected 1, is " << last_msg_->states[2].state; - EXPECT_LT((last_msg_->states[3].cn0*100 - 14.8290262222*100), 0.05) << "incorrect value for states[3].cn0, expected 14.8290262222, is " << last_msg_->states[3].cn0; - EXPECT_EQ(last_msg_->states[3].prn, 7) << "incorrect value for states[3].prn, expected 7, is " << last_msg_->states[3].prn; - EXPECT_EQ(last_msg_->states[3].state, 1) << "incorrect value for states[3].state, expected 1, is " << last_msg_->states[3].state; - EXPECT_LT((last_msg_->states[4].cn0*100 - 7.79104471207*100), 0.05) << "incorrect value for states[4].cn0, expected 7.79104471207, is " << last_msg_->states[4].cn0; - EXPECT_EQ(last_msg_->states[4].prn, 10) << "incorrect value for states[4].prn, expected 10, is " << last_msg_->states[4].prn; - EXPECT_EQ(last_msg_->states[4].state, 1) << "incorrect value for states[4].state, expected 1, is " << last_msg_->states[4].state; - EXPECT_LT((last_msg_->states[5].cn0*100 - 4.86816120148*100), 0.05) << "incorrect value for states[5].cn0, expected 4.86816120148, is " << last_msg_->states[5].cn0; - EXPECT_EQ(last_msg_->states[5].prn, 13) << "incorrect value for states[5].prn, expected 13, is " << last_msg_->states[5].prn; - EXPECT_EQ(last_msg_->states[5].state, 1) << "incorrect value for states[5].state, expected 1, is " << last_msg_->states[5].state; - EXPECT_LT((last_msg_->states[6].cn0*100 - 6.72109556198*100), 0.05) << "incorrect value for states[6].cn0, expected 6.72109556198, is " << last_msg_->states[6].cn0; - EXPECT_EQ(last_msg_->states[6].prn, 22) << "incorrect value for states[6].prn, expected 22, is " << last_msg_->states[6].prn; - EXPECT_EQ(last_msg_->states[6].state, 1) << "incorrect value for states[6].state, expected 1, is " << last_msg_->states[6].state; - EXPECT_LT((last_msg_->states[7].cn0*100 - 12.9713230133*100), 0.05) << "incorrect value for states[7].cn0, expected 12.9713230133, is " << last_msg_->states[7].cn0; - EXPECT_EQ(last_msg_->states[7].prn, 30) << "incorrect value for states[7].prn, expected 30, is " << last_msg_->states[7].prn; - EXPECT_EQ(last_msg_->states[7].state, 1) << "incorrect value for states[7].state, expected 1, is " << last_msg_->states[7].state; - EXPECT_LT((last_msg_->states[8].cn0*100 - 15.4814052582*100), 0.05) << "incorrect value for states[8].cn0, expected 15.4814052582, is " << last_msg_->states[8].cn0; - EXPECT_EQ(last_msg_->states[8].prn, 31) << "incorrect value for states[8].prn, expected 31, is " << last_msg_->states[8].prn; - EXPECT_EQ(last_msg_->states[8].state, 1) << "incorrect value for states[8].state, expected 1, is " << last_msg_->states[8].state; - EXPECT_LT((last_msg_->states[9].cn0*100 - 3.88343548775*100), 0.05) << "incorrect value for states[9].cn0, expected 3.88343548775, is " << last_msg_->states[9].cn0; - EXPECT_EQ(last_msg_->states[9].prn, 25) << "incorrect value for states[9].prn, expected 25, is " << last_msg_->states[9].prn; - EXPECT_EQ(last_msg_->states[9].state, 1) << "incorrect value for states[9].state, expected 1, is " << last_msg_->states[9].state; - EXPECT_LT((last_msg_->states[10].cn0*100 - 4.06148862839*100), 0.05) << "incorrect value for states[10].cn0, expected 4.06148862839, is " << last_msg_->states[10].cn0; - EXPECT_EQ(last_msg_->states[10].prn, 6) << "incorrect value for states[10].prn, expected 6, is " << last_msg_->states[10].prn; - EXPECT_EQ(last_msg_->states[10].state, 1) << "incorrect value for states[10].state, expected 1, is " << last_msg_->states[10].state; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->states[0].cn0 * 100 - 11.0141220093 * 100), 0.05) + << "incorrect value for states[0].cn0, expected 11.0141220093, is " + << last_msg_->states[0].cn0; + EXPECT_EQ(last_msg_->states[0].prn, 0) + << "incorrect value for states[0].prn, expected 0, is " + << last_msg_->states[0].prn; + EXPECT_EQ(last_msg_->states[0].state, 1) + << "incorrect value for states[0].state, expected 1, is " + << last_msg_->states[0].state; + EXPECT_LT((last_msg_->states[1].cn0 * 100 - 10.8851480484 * 100), 0.05) + << "incorrect value for states[1].cn0, expected 10.8851480484, is " + << last_msg_->states[1].cn0; + EXPECT_EQ(last_msg_->states[1].prn, 2) + << "incorrect value for states[1].prn, expected 2, is " + << last_msg_->states[1].prn; + EXPECT_EQ(last_msg_->states[1].state, 1) + << "incorrect value for states[1].state, expected 1, is " + << last_msg_->states[1].state; + EXPECT_LT((last_msg_->states[2].cn0 * 100 - 10.1313514709 * 100), 0.05) + << "incorrect value for states[2].cn0, expected 10.1313514709, is " + << last_msg_->states[2].cn0; + EXPECT_EQ(last_msg_->states[2].prn, 3) + << "incorrect value for states[2].prn, expected 3, is " + << last_msg_->states[2].prn; + EXPECT_EQ(last_msg_->states[2].state, 1) + << "incorrect value for states[2].state, expected 1, is " + << last_msg_->states[2].state; + EXPECT_LT((last_msg_->states[3].cn0 * 100 - 14.8290262222 * 100), 0.05) + << "incorrect value for states[3].cn0, expected 14.8290262222, is " + << last_msg_->states[3].cn0; + EXPECT_EQ(last_msg_->states[3].prn, 7) + << "incorrect value for states[3].prn, expected 7, is " + << last_msg_->states[3].prn; + EXPECT_EQ(last_msg_->states[3].state, 1) + << "incorrect value for states[3].state, expected 1, is " + << last_msg_->states[3].state; + EXPECT_LT((last_msg_->states[4].cn0 * 100 - 7.79104471207 * 100), 0.05) + << "incorrect value for states[4].cn0, expected 7.79104471207, is " + << last_msg_->states[4].cn0; + EXPECT_EQ(last_msg_->states[4].prn, 10) + << "incorrect value for states[4].prn, expected 10, is " + << last_msg_->states[4].prn; + EXPECT_EQ(last_msg_->states[4].state, 1) + << "incorrect value for states[4].state, expected 1, is " + << last_msg_->states[4].state; + EXPECT_LT((last_msg_->states[5].cn0 * 100 - 4.86816120148 * 100), 0.05) + << "incorrect value for states[5].cn0, expected 4.86816120148, is " + << last_msg_->states[5].cn0; + EXPECT_EQ(last_msg_->states[5].prn, 13) + << "incorrect value for states[5].prn, expected 13, is " + << last_msg_->states[5].prn; + EXPECT_EQ(last_msg_->states[5].state, 1) + << "incorrect value for states[5].state, expected 1, is " + << last_msg_->states[5].state; + EXPECT_LT((last_msg_->states[6].cn0 * 100 - 6.72109556198 * 100), 0.05) + << "incorrect value for states[6].cn0, expected 6.72109556198, is " + << last_msg_->states[6].cn0; + EXPECT_EQ(last_msg_->states[6].prn, 22) + << "incorrect value for states[6].prn, expected 22, is " + << last_msg_->states[6].prn; + EXPECT_EQ(last_msg_->states[6].state, 1) + << "incorrect value for states[6].state, expected 1, is " + << last_msg_->states[6].state; + EXPECT_LT((last_msg_->states[7].cn0 * 100 - 12.9713230133 * 100), 0.05) + << "incorrect value for states[7].cn0, expected 12.9713230133, is " + << last_msg_->states[7].cn0; + EXPECT_EQ(last_msg_->states[7].prn, 30) + << "incorrect value for states[7].prn, expected 30, is " + << last_msg_->states[7].prn; + EXPECT_EQ(last_msg_->states[7].state, 1) + << "incorrect value for states[7].state, expected 1, is " + << last_msg_->states[7].state; + EXPECT_LT((last_msg_->states[8].cn0 * 100 - 15.4814052582 * 100), 0.05) + << "incorrect value for states[8].cn0, expected 15.4814052582, is " + << last_msg_->states[8].cn0; + EXPECT_EQ(last_msg_->states[8].prn, 31) + << "incorrect value for states[8].prn, expected 31, is " + << last_msg_->states[8].prn; + EXPECT_EQ(last_msg_->states[8].state, 1) + << "incorrect value for states[8].state, expected 1, is " + << last_msg_->states[8].state; + EXPECT_LT((last_msg_->states[9].cn0 * 100 - 3.88343548775 * 100), 0.05) + << "incorrect value for states[9].cn0, expected 3.88343548775, is " + << last_msg_->states[9].cn0; + EXPECT_EQ(last_msg_->states[9].prn, 25) + << "incorrect value for states[9].prn, expected 25, is " + << last_msg_->states[9].prn; + EXPECT_EQ(last_msg_->states[9].state, 1) + << "incorrect value for states[9].state, expected 1, is " + << last_msg_->states[9].state; + EXPECT_LT((last_msg_->states[10].cn0 * 100 - 4.06148862839 * 100), 0.05) + << "incorrect value for states[10].cn0, expected 4.06148862839, is " + << last_msg_->states[10].cn0; + EXPECT_EQ(last_msg_->states[10].prn, 6) + << "incorrect value for states[10].prn, expected 6, is " + << last_msg_->states[10].prn; + EXPECT_EQ(last_msg_->states[10].state, 1) + << "incorrect value for states[10].state, expected 1, is " + << last_msg_->states[10].state; } -class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA2 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA2() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA2 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA2() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_state_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -479,194 +608,260 @@ class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA2 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_state_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA2, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA2, Test) { + uint8_t encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 141, 76, 60, 65, 1, 2, 69, + 139, 46, 65, 1, 3, 146, 27, 30, 65, 1, 7, 235, 56, 97, 65, + 1, 10, 141, 213, 243, 64, 1, 13, 250, 170, 166, 64, 1, 22, 17, + 101, 201, 64, 1, 30, 172, 183, 83, 65, 1, 31, 238, 193, 120, 65, + 1, 25, 220, 48, 132, 64, 1, 6, 49, 214, 54, 64, 110, 179, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_state_dep_a_t *test_msg = + (msg_tracking_state_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[0].cn0 = 11.768689155578613; + test_msg->states[0].prn = 0; + test_msg->states[0].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[1].cn0 = 10.909001350402832; + test_msg->states[1].prn = 2; + test_msg->states[1].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[2].cn0 = 9.881731033325195; + test_msg->states[2].prn = 3; + test_msg->states[2].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[3].cn0 = 14.076395988464355; + test_msg->states[3].prn = 7; + test_msg->states[3].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[4].cn0 = 7.619818210601807; + test_msg->states[4].prn = 10; + test_msg->states[4].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[5].cn0 = 5.208371162414551; + test_msg->states[5].prn = 13; + test_msg->states[5].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[6].cn0 = 6.2935872077941895; + test_msg->states[6].prn = 22; + test_msg->states[6].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[7].cn0 = 13.232341766357422; + test_msg->states[7].prn = 30; + test_msg->states[7].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[8].cn0 = 15.547346115112305; + test_msg->states[8].prn = 31; + test_msg->states[8].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[9].cn0 = 4.130964279174805; + test_msg->states[9].prn = 25; + test_msg->states[9].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[10].cn0 = 2.856823205947876; + test_msg->states[10].prn = 6; + test_msg->states[10].state = 1; + + EXPECT_EQ(send_message(0x16, 1219, test_msg_len, test_msg_storage), SBP_OK); - uint8_t encoded_frame[] = {85,22,0,195,4,66,1,0,141,76,60,65,1,2,69,139,46,65,1,3,146,27,30,65,1,7,235,56,97,65,1,10,141,213,243,64,1,13,250,170,166,64,1,22,17,101,201,64,1,30,172,183,83,65,1,31,238,193,120,65,1,25,220,48,132,64,1,6,49,214,54,64,110,179, }; + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_state_dep_a_t* test_msg = ( msg_tracking_state_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[0].cn0 = 11.768689155578613; - test_msg->states[0].prn = 0; - test_msg->states[0].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[1].cn0 = 10.909001350402832; - test_msg->states[1].prn = 2; - test_msg->states[1].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[2].cn0 = 9.881731033325195; - test_msg->states[2].prn = 3; - test_msg->states[2].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[3].cn0 = 14.076395988464355; - test_msg->states[3].prn = 7; - test_msg->states[3].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[4].cn0 = 7.619818210601807; - test_msg->states[4].prn = 10; - test_msg->states[4].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[5].cn0 = 5.208371162414551; - test_msg->states[5].prn = 13; - test_msg->states[5].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[6].cn0 = 6.2935872077941895; - test_msg->states[6].prn = 22; - test_msg->states[6].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[7].cn0 = 13.232341766357422; - test_msg->states[7].prn = 30; - test_msg->states[7].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[8].cn0 = 15.547346115112305; - test_msg->states[8].prn = 31; - test_msg->states[8].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[9].cn0 = 4.130964279174805; - test_msg->states[9].prn = 25; - test_msg->states[9].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[10].cn0 = 2.856823205947876; - test_msg->states[10].prn = 6; - test_msg->states[10].state = 1; - - EXPECT_EQ(send_message( 0x16, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->states[0].cn0*100 - 11.7686891556*100), 0.05) << "incorrect value for states[0].cn0, expected 11.7686891556, is " << last_msg_->states[0].cn0; - EXPECT_EQ(last_msg_->states[0].prn, 0) << "incorrect value for states[0].prn, expected 0, is " << last_msg_->states[0].prn; - EXPECT_EQ(last_msg_->states[0].state, 1) << "incorrect value for states[0].state, expected 1, is " << last_msg_->states[0].state; - EXPECT_LT((last_msg_->states[1].cn0*100 - 10.9090013504*100), 0.05) << "incorrect value for states[1].cn0, expected 10.9090013504, is " << last_msg_->states[1].cn0; - EXPECT_EQ(last_msg_->states[1].prn, 2) << "incorrect value for states[1].prn, expected 2, is " << last_msg_->states[1].prn; - EXPECT_EQ(last_msg_->states[1].state, 1) << "incorrect value for states[1].state, expected 1, is " << last_msg_->states[1].state; - EXPECT_LT((last_msg_->states[2].cn0*100 - 9.88173103333*100), 0.05) << "incorrect value for states[2].cn0, expected 9.88173103333, is " << last_msg_->states[2].cn0; - EXPECT_EQ(last_msg_->states[2].prn, 3) << "incorrect value for states[2].prn, expected 3, is " << last_msg_->states[2].prn; - EXPECT_EQ(last_msg_->states[2].state, 1) << "incorrect value for states[2].state, expected 1, is " << last_msg_->states[2].state; - EXPECT_LT((last_msg_->states[3].cn0*100 - 14.0763959885*100), 0.05) << "incorrect value for states[3].cn0, expected 14.0763959885, is " << last_msg_->states[3].cn0; - EXPECT_EQ(last_msg_->states[3].prn, 7) << "incorrect value for states[3].prn, expected 7, is " << last_msg_->states[3].prn; - EXPECT_EQ(last_msg_->states[3].state, 1) << "incorrect value for states[3].state, expected 1, is " << last_msg_->states[3].state; - EXPECT_LT((last_msg_->states[4].cn0*100 - 7.6198182106*100), 0.05) << "incorrect value for states[4].cn0, expected 7.6198182106, is " << last_msg_->states[4].cn0; - EXPECT_EQ(last_msg_->states[4].prn, 10) << "incorrect value for states[4].prn, expected 10, is " << last_msg_->states[4].prn; - EXPECT_EQ(last_msg_->states[4].state, 1) << "incorrect value for states[4].state, expected 1, is " << last_msg_->states[4].state; - EXPECT_LT((last_msg_->states[5].cn0*100 - 5.20837116241*100), 0.05) << "incorrect value for states[5].cn0, expected 5.20837116241, is " << last_msg_->states[5].cn0; - EXPECT_EQ(last_msg_->states[5].prn, 13) << "incorrect value for states[5].prn, expected 13, is " << last_msg_->states[5].prn; - EXPECT_EQ(last_msg_->states[5].state, 1) << "incorrect value for states[5].state, expected 1, is " << last_msg_->states[5].state; - EXPECT_LT((last_msg_->states[6].cn0*100 - 6.29358720779*100), 0.05) << "incorrect value for states[6].cn0, expected 6.29358720779, is " << last_msg_->states[6].cn0; - EXPECT_EQ(last_msg_->states[6].prn, 22) << "incorrect value for states[6].prn, expected 22, is " << last_msg_->states[6].prn; - EXPECT_EQ(last_msg_->states[6].state, 1) << "incorrect value for states[6].state, expected 1, is " << last_msg_->states[6].state; - EXPECT_LT((last_msg_->states[7].cn0*100 - 13.2323417664*100), 0.05) << "incorrect value for states[7].cn0, expected 13.2323417664, is " << last_msg_->states[7].cn0; - EXPECT_EQ(last_msg_->states[7].prn, 30) << "incorrect value for states[7].prn, expected 30, is " << last_msg_->states[7].prn; - EXPECT_EQ(last_msg_->states[7].state, 1) << "incorrect value for states[7].state, expected 1, is " << last_msg_->states[7].state; - EXPECT_LT((last_msg_->states[8].cn0*100 - 15.5473461151*100), 0.05) << "incorrect value for states[8].cn0, expected 15.5473461151, is " << last_msg_->states[8].cn0; - EXPECT_EQ(last_msg_->states[8].prn, 31) << "incorrect value for states[8].prn, expected 31, is " << last_msg_->states[8].prn; - EXPECT_EQ(last_msg_->states[8].state, 1) << "incorrect value for states[8].state, expected 1, is " << last_msg_->states[8].state; - EXPECT_LT((last_msg_->states[9].cn0*100 - 4.13096427917*100), 0.05) << "incorrect value for states[9].cn0, expected 4.13096427917, is " << last_msg_->states[9].cn0; - EXPECT_EQ(last_msg_->states[9].prn, 25) << "incorrect value for states[9].prn, expected 25, is " << last_msg_->states[9].prn; - EXPECT_EQ(last_msg_->states[9].state, 1) << "incorrect value for states[9].state, expected 1, is " << last_msg_->states[9].state; - EXPECT_LT((last_msg_->states[10].cn0*100 - 2.85682320595*100), 0.05) << "incorrect value for states[10].cn0, expected 2.85682320595, is " << last_msg_->states[10].cn0; - EXPECT_EQ(last_msg_->states[10].prn, 6) << "incorrect value for states[10].prn, expected 6, is " << last_msg_->states[10].prn; - EXPECT_EQ(last_msg_->states[10].state, 1) << "incorrect value for states[10].state, expected 1, is " << last_msg_->states[10].state; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->states[0].cn0 * 100 - 11.7686891556 * 100), 0.05) + << "incorrect value for states[0].cn0, expected 11.7686891556, is " + << last_msg_->states[0].cn0; + EXPECT_EQ(last_msg_->states[0].prn, 0) + << "incorrect value for states[0].prn, expected 0, is " + << last_msg_->states[0].prn; + EXPECT_EQ(last_msg_->states[0].state, 1) + << "incorrect value for states[0].state, expected 1, is " + << last_msg_->states[0].state; + EXPECT_LT((last_msg_->states[1].cn0 * 100 - 10.9090013504 * 100), 0.05) + << "incorrect value for states[1].cn0, expected 10.9090013504, is " + << last_msg_->states[1].cn0; + EXPECT_EQ(last_msg_->states[1].prn, 2) + << "incorrect value for states[1].prn, expected 2, is " + << last_msg_->states[1].prn; + EXPECT_EQ(last_msg_->states[1].state, 1) + << "incorrect value for states[1].state, expected 1, is " + << last_msg_->states[1].state; + EXPECT_LT((last_msg_->states[2].cn0 * 100 - 9.88173103333 * 100), 0.05) + << "incorrect value for states[2].cn0, expected 9.88173103333, is " + << last_msg_->states[2].cn0; + EXPECT_EQ(last_msg_->states[2].prn, 3) + << "incorrect value for states[2].prn, expected 3, is " + << last_msg_->states[2].prn; + EXPECT_EQ(last_msg_->states[2].state, 1) + << "incorrect value for states[2].state, expected 1, is " + << last_msg_->states[2].state; + EXPECT_LT((last_msg_->states[3].cn0 * 100 - 14.0763959885 * 100), 0.05) + << "incorrect value for states[3].cn0, expected 14.0763959885, is " + << last_msg_->states[3].cn0; + EXPECT_EQ(last_msg_->states[3].prn, 7) + << "incorrect value for states[3].prn, expected 7, is " + << last_msg_->states[3].prn; + EXPECT_EQ(last_msg_->states[3].state, 1) + << "incorrect value for states[3].state, expected 1, is " + << last_msg_->states[3].state; + EXPECT_LT((last_msg_->states[4].cn0 * 100 - 7.6198182106 * 100), 0.05) + << "incorrect value for states[4].cn0, expected 7.6198182106, is " + << last_msg_->states[4].cn0; + EXPECT_EQ(last_msg_->states[4].prn, 10) + << "incorrect value for states[4].prn, expected 10, is " + << last_msg_->states[4].prn; + EXPECT_EQ(last_msg_->states[4].state, 1) + << "incorrect value for states[4].state, expected 1, is " + << last_msg_->states[4].state; + EXPECT_LT((last_msg_->states[5].cn0 * 100 - 5.20837116241 * 100), 0.05) + << "incorrect value for states[5].cn0, expected 5.20837116241, is " + << last_msg_->states[5].cn0; + EXPECT_EQ(last_msg_->states[5].prn, 13) + << "incorrect value for states[5].prn, expected 13, is " + << last_msg_->states[5].prn; + EXPECT_EQ(last_msg_->states[5].state, 1) + << "incorrect value for states[5].state, expected 1, is " + << last_msg_->states[5].state; + EXPECT_LT((last_msg_->states[6].cn0 * 100 - 6.29358720779 * 100), 0.05) + << "incorrect value for states[6].cn0, expected 6.29358720779, is " + << last_msg_->states[6].cn0; + EXPECT_EQ(last_msg_->states[6].prn, 22) + << "incorrect value for states[6].prn, expected 22, is " + << last_msg_->states[6].prn; + EXPECT_EQ(last_msg_->states[6].state, 1) + << "incorrect value for states[6].state, expected 1, is " + << last_msg_->states[6].state; + EXPECT_LT((last_msg_->states[7].cn0 * 100 - 13.2323417664 * 100), 0.05) + << "incorrect value for states[7].cn0, expected 13.2323417664, is " + << last_msg_->states[7].cn0; + EXPECT_EQ(last_msg_->states[7].prn, 30) + << "incorrect value for states[7].prn, expected 30, is " + << last_msg_->states[7].prn; + EXPECT_EQ(last_msg_->states[7].state, 1) + << "incorrect value for states[7].state, expected 1, is " + << last_msg_->states[7].state; + EXPECT_LT((last_msg_->states[8].cn0 * 100 - 15.5473461151 * 100), 0.05) + << "incorrect value for states[8].cn0, expected 15.5473461151, is " + << last_msg_->states[8].cn0; + EXPECT_EQ(last_msg_->states[8].prn, 31) + << "incorrect value for states[8].prn, expected 31, is " + << last_msg_->states[8].prn; + EXPECT_EQ(last_msg_->states[8].state, 1) + << "incorrect value for states[8].state, expected 1, is " + << last_msg_->states[8].state; + EXPECT_LT((last_msg_->states[9].cn0 * 100 - 4.13096427917 * 100), 0.05) + << "incorrect value for states[9].cn0, expected 4.13096427917, is " + << last_msg_->states[9].cn0; + EXPECT_EQ(last_msg_->states[9].prn, 25) + << "incorrect value for states[9].prn, expected 25, is " + << last_msg_->states[9].prn; + EXPECT_EQ(last_msg_->states[9].state, 1) + << "incorrect value for states[9].state, expected 1, is " + << last_msg_->states[9].state; + EXPECT_LT((last_msg_->states[10].cn0 * 100 - 2.85682320595 * 100), 0.05) + << "incorrect value for states[10].cn0, expected 2.85682320595, is " + << last_msg_->states[10].cn0; + EXPECT_EQ(last_msg_->states[10].prn, 6) + << "incorrect value for states[10].prn, expected 6, is " + << last_msg_->states[10].prn; + EXPECT_EQ(last_msg_->states[10].state, 1) + << "incorrect value for states[10].state, expected 1, is " + << last_msg_->states[10].state; } -class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA3 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA3() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA3 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA3() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_state_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -676,194 +871,260 @@ class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA3 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_state_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA3, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA3, Test) { + uint8_t encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 55, 143, 120, 66, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 248, 89, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_state_dep_a_t *test_msg = + (msg_tracking_state_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[0].cn0 = 62.13985824584961; + test_msg->states[0].prn = 0; + test_msg->states[0].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[1].cn0 = -1.0; + test_msg->states[1].prn = 0; + test_msg->states[1].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[2].cn0 = -1.0; + test_msg->states[2].prn = 0; + test_msg->states[2].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[3].cn0 = -1.0; + test_msg->states[3].prn = 0; + test_msg->states[3].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[4].cn0 = -1.0; + test_msg->states[4].prn = 0; + test_msg->states[4].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[5].cn0 = -1.0; + test_msg->states[5].prn = 0; + test_msg->states[5].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[6].cn0 = -1.0; + test_msg->states[6].prn = 0; + test_msg->states[6].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[7].cn0 = -1.0; + test_msg->states[7].prn = 0; + test_msg->states[7].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[8].cn0 = -1.0; + test_msg->states[8].prn = 0; + test_msg->states[8].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[9].cn0 = -1.0; + test_msg->states[9].prn = 0; + test_msg->states[9].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[10].cn0 = -1.0; + test_msg->states[10].prn = 0; + test_msg->states[10].state = 0; - uint8_t encoded_frame[] = {85,22,0,195,4,66,1,0,55,143,120,66,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,248,89, }; + EXPECT_EQ(send_message(0x16, 1219, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_state_dep_a_t* test_msg = ( msg_tracking_state_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[0].cn0 = 62.13985824584961; - test_msg->states[0].prn = 0; - test_msg->states[0].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[1].cn0 = -1.0; - test_msg->states[1].prn = 0; - test_msg->states[1].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[2].cn0 = -1.0; - test_msg->states[2].prn = 0; - test_msg->states[2].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[3].cn0 = -1.0; - test_msg->states[3].prn = 0; - test_msg->states[3].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[4].cn0 = -1.0; - test_msg->states[4].prn = 0; - test_msg->states[4].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[5].cn0 = -1.0; - test_msg->states[5].prn = 0; - test_msg->states[5].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[6].cn0 = -1.0; - test_msg->states[6].prn = 0; - test_msg->states[6].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[7].cn0 = -1.0; - test_msg->states[7].prn = 0; - test_msg->states[7].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[8].cn0 = -1.0; - test_msg->states[8].prn = 0; - test_msg->states[8].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[9].cn0 = -1.0; - test_msg->states[9].prn = 0; - test_msg->states[9].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[10].cn0 = -1.0; - test_msg->states[10].prn = 0; - test_msg->states[10].state = 0; - - EXPECT_EQ(send_message( 0x16, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->states[0].cn0*100 - 62.1398582458*100), 0.05) << "incorrect value for states[0].cn0, expected 62.1398582458, is " << last_msg_->states[0].cn0; - EXPECT_EQ(last_msg_->states[0].prn, 0) << "incorrect value for states[0].prn, expected 0, is " << last_msg_->states[0].prn; - EXPECT_EQ(last_msg_->states[0].state, 1) << "incorrect value for states[0].state, expected 1, is " << last_msg_->states[0].state; - EXPECT_LT((last_msg_->states[1].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[1].cn0, expected -1.0, is " << last_msg_->states[1].cn0; - EXPECT_EQ(last_msg_->states[1].prn, 0) << "incorrect value for states[1].prn, expected 0, is " << last_msg_->states[1].prn; - EXPECT_EQ(last_msg_->states[1].state, 0) << "incorrect value for states[1].state, expected 0, is " << last_msg_->states[1].state; - EXPECT_LT((last_msg_->states[2].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[2].cn0, expected -1.0, is " << last_msg_->states[2].cn0; - EXPECT_EQ(last_msg_->states[2].prn, 0) << "incorrect value for states[2].prn, expected 0, is " << last_msg_->states[2].prn; - EXPECT_EQ(last_msg_->states[2].state, 0) << "incorrect value for states[2].state, expected 0, is " << last_msg_->states[2].state; - EXPECT_LT((last_msg_->states[3].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[3].cn0, expected -1.0, is " << last_msg_->states[3].cn0; - EXPECT_EQ(last_msg_->states[3].prn, 0) << "incorrect value for states[3].prn, expected 0, is " << last_msg_->states[3].prn; - EXPECT_EQ(last_msg_->states[3].state, 0) << "incorrect value for states[3].state, expected 0, is " << last_msg_->states[3].state; - EXPECT_LT((last_msg_->states[4].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[4].cn0, expected -1.0, is " << last_msg_->states[4].cn0; - EXPECT_EQ(last_msg_->states[4].prn, 0) << "incorrect value for states[4].prn, expected 0, is " << last_msg_->states[4].prn; - EXPECT_EQ(last_msg_->states[4].state, 0) << "incorrect value for states[4].state, expected 0, is " << last_msg_->states[4].state; - EXPECT_LT((last_msg_->states[5].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[5].cn0, expected -1.0, is " << last_msg_->states[5].cn0; - EXPECT_EQ(last_msg_->states[5].prn, 0) << "incorrect value for states[5].prn, expected 0, is " << last_msg_->states[5].prn; - EXPECT_EQ(last_msg_->states[5].state, 0) << "incorrect value for states[5].state, expected 0, is " << last_msg_->states[5].state; - EXPECT_LT((last_msg_->states[6].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[6].cn0, expected -1.0, is " << last_msg_->states[6].cn0; - EXPECT_EQ(last_msg_->states[6].prn, 0) << "incorrect value for states[6].prn, expected 0, is " << last_msg_->states[6].prn; - EXPECT_EQ(last_msg_->states[6].state, 0) << "incorrect value for states[6].state, expected 0, is " << last_msg_->states[6].state; - EXPECT_LT((last_msg_->states[7].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[7].cn0, expected -1.0, is " << last_msg_->states[7].cn0; - EXPECT_EQ(last_msg_->states[7].prn, 0) << "incorrect value for states[7].prn, expected 0, is " << last_msg_->states[7].prn; - EXPECT_EQ(last_msg_->states[7].state, 0) << "incorrect value for states[7].state, expected 0, is " << last_msg_->states[7].state; - EXPECT_LT((last_msg_->states[8].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[8].cn0, expected -1.0, is " << last_msg_->states[8].cn0; - EXPECT_EQ(last_msg_->states[8].prn, 0) << "incorrect value for states[8].prn, expected 0, is " << last_msg_->states[8].prn; - EXPECT_EQ(last_msg_->states[8].state, 0) << "incorrect value for states[8].state, expected 0, is " << last_msg_->states[8].state; - EXPECT_LT((last_msg_->states[9].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[9].cn0, expected -1.0, is " << last_msg_->states[9].cn0; - EXPECT_EQ(last_msg_->states[9].prn, 0) << "incorrect value for states[9].prn, expected 0, is " << last_msg_->states[9].prn; - EXPECT_EQ(last_msg_->states[9].state, 0) << "incorrect value for states[9].state, expected 0, is " << last_msg_->states[9].state; - EXPECT_LT((last_msg_->states[10].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[10].cn0, expected -1.0, is " << last_msg_->states[10].cn0; - EXPECT_EQ(last_msg_->states[10].prn, 0) << "incorrect value for states[10].prn, expected 0, is " << last_msg_->states[10].prn; - EXPECT_EQ(last_msg_->states[10].state, 0) << "incorrect value for states[10].state, expected 0, is " << last_msg_->states[10].state; + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->states[0].cn0 * 100 - 62.1398582458 * 100), 0.05) + << "incorrect value for states[0].cn0, expected 62.1398582458, is " + << last_msg_->states[0].cn0; + EXPECT_EQ(last_msg_->states[0].prn, 0) + << "incorrect value for states[0].prn, expected 0, is " + << last_msg_->states[0].prn; + EXPECT_EQ(last_msg_->states[0].state, 1) + << "incorrect value for states[0].state, expected 1, is " + << last_msg_->states[0].state; + EXPECT_LT((last_msg_->states[1].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[1].cn0, expected -1.0, is " + << last_msg_->states[1].cn0; + EXPECT_EQ(last_msg_->states[1].prn, 0) + << "incorrect value for states[1].prn, expected 0, is " + << last_msg_->states[1].prn; + EXPECT_EQ(last_msg_->states[1].state, 0) + << "incorrect value for states[1].state, expected 0, is " + << last_msg_->states[1].state; + EXPECT_LT((last_msg_->states[2].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[2].cn0, expected -1.0, is " + << last_msg_->states[2].cn0; + EXPECT_EQ(last_msg_->states[2].prn, 0) + << "incorrect value for states[2].prn, expected 0, is " + << last_msg_->states[2].prn; + EXPECT_EQ(last_msg_->states[2].state, 0) + << "incorrect value for states[2].state, expected 0, is " + << last_msg_->states[2].state; + EXPECT_LT((last_msg_->states[3].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[3].cn0, expected -1.0, is " + << last_msg_->states[3].cn0; + EXPECT_EQ(last_msg_->states[3].prn, 0) + << "incorrect value for states[3].prn, expected 0, is " + << last_msg_->states[3].prn; + EXPECT_EQ(last_msg_->states[3].state, 0) + << "incorrect value for states[3].state, expected 0, is " + << last_msg_->states[3].state; + EXPECT_LT((last_msg_->states[4].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[4].cn0, expected -1.0, is " + << last_msg_->states[4].cn0; + EXPECT_EQ(last_msg_->states[4].prn, 0) + << "incorrect value for states[4].prn, expected 0, is " + << last_msg_->states[4].prn; + EXPECT_EQ(last_msg_->states[4].state, 0) + << "incorrect value for states[4].state, expected 0, is " + << last_msg_->states[4].state; + EXPECT_LT((last_msg_->states[5].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[5].cn0, expected -1.0, is " + << last_msg_->states[5].cn0; + EXPECT_EQ(last_msg_->states[5].prn, 0) + << "incorrect value for states[5].prn, expected 0, is " + << last_msg_->states[5].prn; + EXPECT_EQ(last_msg_->states[5].state, 0) + << "incorrect value for states[5].state, expected 0, is " + << last_msg_->states[5].state; + EXPECT_LT((last_msg_->states[6].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[6].cn0, expected -1.0, is " + << last_msg_->states[6].cn0; + EXPECT_EQ(last_msg_->states[6].prn, 0) + << "incorrect value for states[6].prn, expected 0, is " + << last_msg_->states[6].prn; + EXPECT_EQ(last_msg_->states[6].state, 0) + << "incorrect value for states[6].state, expected 0, is " + << last_msg_->states[6].state; + EXPECT_LT((last_msg_->states[7].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[7].cn0, expected -1.0, is " + << last_msg_->states[7].cn0; + EXPECT_EQ(last_msg_->states[7].prn, 0) + << "incorrect value for states[7].prn, expected 0, is " + << last_msg_->states[7].prn; + EXPECT_EQ(last_msg_->states[7].state, 0) + << "incorrect value for states[7].state, expected 0, is " + << last_msg_->states[7].state; + EXPECT_LT((last_msg_->states[8].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[8].cn0, expected -1.0, is " + << last_msg_->states[8].cn0; + EXPECT_EQ(last_msg_->states[8].prn, 0) + << "incorrect value for states[8].prn, expected 0, is " + << last_msg_->states[8].prn; + EXPECT_EQ(last_msg_->states[8].state, 0) + << "incorrect value for states[8].state, expected 0, is " + << last_msg_->states[8].state; + EXPECT_LT((last_msg_->states[9].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[9].cn0, expected -1.0, is " + << last_msg_->states[9].cn0; + EXPECT_EQ(last_msg_->states[9].prn, 0) + << "incorrect value for states[9].prn, expected 0, is " + << last_msg_->states[9].prn; + EXPECT_EQ(last_msg_->states[9].state, 0) + << "incorrect value for states[9].state, expected 0, is " + << last_msg_->states[9].state; + EXPECT_LT((last_msg_->states[10].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[10].cn0, expected -1.0, is " + << last_msg_->states[10].cn0; + EXPECT_EQ(last_msg_->states[10].prn, 0) + << "incorrect value for states[10].prn, expected 0, is " + << last_msg_->states[10].prn; + EXPECT_EQ(last_msg_->states[10].state, 0) + << "incorrect value for states[10].state, expected 0, is " + << last_msg_->states[10].state; } -class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA4 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA4() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA4 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA4() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_state_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -873,194 +1134,260 @@ class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA4 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_state_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA4, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA4, Test) { + uint8_t encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 218, 14, 19, 66, 1, 2, 210, + 3, 21, 65, 1, 3, 234, 214, 134, 65, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 84, 101, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_state_dep_a_t *test_msg = + (msg_tracking_state_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[0].cn0 = 36.764503479003906; + test_msg->states[0].prn = 0; + test_msg->states[0].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[1].cn0 = 9.313432693481445; + test_msg->states[1].prn = 2; + test_msg->states[1].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[2].cn0 = 16.854938507080078; + test_msg->states[2].prn = 3; + test_msg->states[2].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[3].cn0 = -1.0; + test_msg->states[3].prn = 0; + test_msg->states[3].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[4].cn0 = -1.0; + test_msg->states[4].prn = 0; + test_msg->states[4].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[5].cn0 = -1.0; + test_msg->states[5].prn = 0; + test_msg->states[5].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[6].cn0 = -1.0; + test_msg->states[6].prn = 0; + test_msg->states[6].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[7].cn0 = -1.0; + test_msg->states[7].prn = 0; + test_msg->states[7].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[8].cn0 = -1.0; + test_msg->states[8].prn = 0; + test_msg->states[8].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[9].cn0 = -1.0; + test_msg->states[9].prn = 0; + test_msg->states[9].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[10].cn0 = -1.0; + test_msg->states[10].prn = 0; + test_msg->states[10].state = 0; - uint8_t encoded_frame[] = {85,22,0,195,4,66,1,0,218,14,19,66,1,2,210,3,21,65,1,3,234,214,134,65,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,84,101, }; + EXPECT_EQ(send_message(0x16, 1219, test_msg_len, test_msg_storage), SBP_OK); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_state_dep_a_t* test_msg = ( msg_tracking_state_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[0].cn0 = 36.764503479003906; - test_msg->states[0].prn = 0; - test_msg->states[0].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[1].cn0 = 9.313432693481445; - test_msg->states[1].prn = 2; - test_msg->states[1].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[2].cn0 = 16.854938507080078; - test_msg->states[2].prn = 3; - test_msg->states[2].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[3].cn0 = -1.0; - test_msg->states[3].prn = 0; - test_msg->states[3].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[4].cn0 = -1.0; - test_msg->states[4].prn = 0; - test_msg->states[4].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[5].cn0 = -1.0; - test_msg->states[5].prn = 0; - test_msg->states[5].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[6].cn0 = -1.0; - test_msg->states[6].prn = 0; - test_msg->states[6].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[7].cn0 = -1.0; - test_msg->states[7].prn = 0; - test_msg->states[7].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[8].cn0 = -1.0; - test_msg->states[8].prn = 0; - test_msg->states[8].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[9].cn0 = -1.0; - test_msg->states[9].prn = 0; - test_msg->states[9].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[10].cn0 = -1.0; - test_msg->states[10].prn = 0; - test_msg->states[10].state = 0; - - EXPECT_EQ(send_message( 0x16, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->states[0].cn0*100 - 36.764503479*100), 0.05) << "incorrect value for states[0].cn0, expected 36.764503479, is " << last_msg_->states[0].cn0; - EXPECT_EQ(last_msg_->states[0].prn, 0) << "incorrect value for states[0].prn, expected 0, is " << last_msg_->states[0].prn; - EXPECT_EQ(last_msg_->states[0].state, 1) << "incorrect value for states[0].state, expected 1, is " << last_msg_->states[0].state; - EXPECT_LT((last_msg_->states[1].cn0*100 - 9.31343269348*100), 0.05) << "incorrect value for states[1].cn0, expected 9.31343269348, is " << last_msg_->states[1].cn0; - EXPECT_EQ(last_msg_->states[1].prn, 2) << "incorrect value for states[1].prn, expected 2, is " << last_msg_->states[1].prn; - EXPECT_EQ(last_msg_->states[1].state, 1) << "incorrect value for states[1].state, expected 1, is " << last_msg_->states[1].state; - EXPECT_LT((last_msg_->states[2].cn0*100 - 16.8549385071*100), 0.05) << "incorrect value for states[2].cn0, expected 16.8549385071, is " << last_msg_->states[2].cn0; - EXPECT_EQ(last_msg_->states[2].prn, 3) << "incorrect value for states[2].prn, expected 3, is " << last_msg_->states[2].prn; - EXPECT_EQ(last_msg_->states[2].state, 1) << "incorrect value for states[2].state, expected 1, is " << last_msg_->states[2].state; - EXPECT_LT((last_msg_->states[3].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[3].cn0, expected -1.0, is " << last_msg_->states[3].cn0; - EXPECT_EQ(last_msg_->states[3].prn, 0) << "incorrect value for states[3].prn, expected 0, is " << last_msg_->states[3].prn; - EXPECT_EQ(last_msg_->states[3].state, 0) << "incorrect value for states[3].state, expected 0, is " << last_msg_->states[3].state; - EXPECT_LT((last_msg_->states[4].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[4].cn0, expected -1.0, is " << last_msg_->states[4].cn0; - EXPECT_EQ(last_msg_->states[4].prn, 0) << "incorrect value for states[4].prn, expected 0, is " << last_msg_->states[4].prn; - EXPECT_EQ(last_msg_->states[4].state, 0) << "incorrect value for states[4].state, expected 0, is " << last_msg_->states[4].state; - EXPECT_LT((last_msg_->states[5].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[5].cn0, expected -1.0, is " << last_msg_->states[5].cn0; - EXPECT_EQ(last_msg_->states[5].prn, 0) << "incorrect value for states[5].prn, expected 0, is " << last_msg_->states[5].prn; - EXPECT_EQ(last_msg_->states[5].state, 0) << "incorrect value for states[5].state, expected 0, is " << last_msg_->states[5].state; - EXPECT_LT((last_msg_->states[6].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[6].cn0, expected -1.0, is " << last_msg_->states[6].cn0; - EXPECT_EQ(last_msg_->states[6].prn, 0) << "incorrect value for states[6].prn, expected 0, is " << last_msg_->states[6].prn; - EXPECT_EQ(last_msg_->states[6].state, 0) << "incorrect value for states[6].state, expected 0, is " << last_msg_->states[6].state; - EXPECT_LT((last_msg_->states[7].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[7].cn0, expected -1.0, is " << last_msg_->states[7].cn0; - EXPECT_EQ(last_msg_->states[7].prn, 0) << "incorrect value for states[7].prn, expected 0, is " << last_msg_->states[7].prn; - EXPECT_EQ(last_msg_->states[7].state, 0) << "incorrect value for states[7].state, expected 0, is " << last_msg_->states[7].state; - EXPECT_LT((last_msg_->states[8].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[8].cn0, expected -1.0, is " << last_msg_->states[8].cn0; - EXPECT_EQ(last_msg_->states[8].prn, 0) << "incorrect value for states[8].prn, expected 0, is " << last_msg_->states[8].prn; - EXPECT_EQ(last_msg_->states[8].state, 0) << "incorrect value for states[8].state, expected 0, is " << last_msg_->states[8].state; - EXPECT_LT((last_msg_->states[9].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[9].cn0, expected -1.0, is " << last_msg_->states[9].cn0; - EXPECT_EQ(last_msg_->states[9].prn, 0) << "incorrect value for states[9].prn, expected 0, is " << last_msg_->states[9].prn; - EXPECT_EQ(last_msg_->states[9].state, 0) << "incorrect value for states[9].state, expected 0, is " << last_msg_->states[9].state; - EXPECT_LT((last_msg_->states[10].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[10].cn0, expected -1.0, is " << last_msg_->states[10].cn0; - EXPECT_EQ(last_msg_->states[10].prn, 0) << "incorrect value for states[10].prn, expected 0, is " << last_msg_->states[10].prn; - EXPECT_EQ(last_msg_->states[10].state, 0) << "incorrect value for states[10].state, expected 0, is " << last_msg_->states[10].state; + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->states[0].cn0 * 100 - 36.764503479 * 100), 0.05) + << "incorrect value for states[0].cn0, expected 36.764503479, is " + << last_msg_->states[0].cn0; + EXPECT_EQ(last_msg_->states[0].prn, 0) + << "incorrect value for states[0].prn, expected 0, is " + << last_msg_->states[0].prn; + EXPECT_EQ(last_msg_->states[0].state, 1) + << "incorrect value for states[0].state, expected 1, is " + << last_msg_->states[0].state; + EXPECT_LT((last_msg_->states[1].cn0 * 100 - 9.31343269348 * 100), 0.05) + << "incorrect value for states[1].cn0, expected 9.31343269348, is " + << last_msg_->states[1].cn0; + EXPECT_EQ(last_msg_->states[1].prn, 2) + << "incorrect value for states[1].prn, expected 2, is " + << last_msg_->states[1].prn; + EXPECT_EQ(last_msg_->states[1].state, 1) + << "incorrect value for states[1].state, expected 1, is " + << last_msg_->states[1].state; + EXPECT_LT((last_msg_->states[2].cn0 * 100 - 16.8549385071 * 100), 0.05) + << "incorrect value for states[2].cn0, expected 16.8549385071, is " + << last_msg_->states[2].cn0; + EXPECT_EQ(last_msg_->states[2].prn, 3) + << "incorrect value for states[2].prn, expected 3, is " + << last_msg_->states[2].prn; + EXPECT_EQ(last_msg_->states[2].state, 1) + << "incorrect value for states[2].state, expected 1, is " + << last_msg_->states[2].state; + EXPECT_LT((last_msg_->states[3].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[3].cn0, expected -1.0, is " + << last_msg_->states[3].cn0; + EXPECT_EQ(last_msg_->states[3].prn, 0) + << "incorrect value for states[3].prn, expected 0, is " + << last_msg_->states[3].prn; + EXPECT_EQ(last_msg_->states[3].state, 0) + << "incorrect value for states[3].state, expected 0, is " + << last_msg_->states[3].state; + EXPECT_LT((last_msg_->states[4].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[4].cn0, expected -1.0, is " + << last_msg_->states[4].cn0; + EXPECT_EQ(last_msg_->states[4].prn, 0) + << "incorrect value for states[4].prn, expected 0, is " + << last_msg_->states[4].prn; + EXPECT_EQ(last_msg_->states[4].state, 0) + << "incorrect value for states[4].state, expected 0, is " + << last_msg_->states[4].state; + EXPECT_LT((last_msg_->states[5].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[5].cn0, expected -1.0, is " + << last_msg_->states[5].cn0; + EXPECT_EQ(last_msg_->states[5].prn, 0) + << "incorrect value for states[5].prn, expected 0, is " + << last_msg_->states[5].prn; + EXPECT_EQ(last_msg_->states[5].state, 0) + << "incorrect value for states[5].state, expected 0, is " + << last_msg_->states[5].state; + EXPECT_LT((last_msg_->states[6].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[6].cn0, expected -1.0, is " + << last_msg_->states[6].cn0; + EXPECT_EQ(last_msg_->states[6].prn, 0) + << "incorrect value for states[6].prn, expected 0, is " + << last_msg_->states[6].prn; + EXPECT_EQ(last_msg_->states[6].state, 0) + << "incorrect value for states[6].state, expected 0, is " + << last_msg_->states[6].state; + EXPECT_LT((last_msg_->states[7].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[7].cn0, expected -1.0, is " + << last_msg_->states[7].cn0; + EXPECT_EQ(last_msg_->states[7].prn, 0) + << "incorrect value for states[7].prn, expected 0, is " + << last_msg_->states[7].prn; + EXPECT_EQ(last_msg_->states[7].state, 0) + << "incorrect value for states[7].state, expected 0, is " + << last_msg_->states[7].state; + EXPECT_LT((last_msg_->states[8].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[8].cn0, expected -1.0, is " + << last_msg_->states[8].cn0; + EXPECT_EQ(last_msg_->states[8].prn, 0) + << "incorrect value for states[8].prn, expected 0, is " + << last_msg_->states[8].prn; + EXPECT_EQ(last_msg_->states[8].state, 0) + << "incorrect value for states[8].state, expected 0, is " + << last_msg_->states[8].state; + EXPECT_LT((last_msg_->states[9].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[9].cn0, expected -1.0, is " + << last_msg_->states[9].cn0; + EXPECT_EQ(last_msg_->states[9].prn, 0) + << "incorrect value for states[9].prn, expected 0, is " + << last_msg_->states[9].prn; + EXPECT_EQ(last_msg_->states[9].state, 0) + << "incorrect value for states[9].state, expected 0, is " + << last_msg_->states[9].state; + EXPECT_LT((last_msg_->states[10].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[10].cn0, expected -1.0, is " + << last_msg_->states[10].cn0; + EXPECT_EQ(last_msg_->states[10].prn, 0) + << "incorrect value for states[10].prn, expected 0, is " + << last_msg_->states[10].prn; + EXPECT_EQ(last_msg_->states[10].state, 0) + << "incorrect value for states[10].state, expected 0, is " + << last_msg_->states[10].state; } -class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA5 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA5() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA5 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA5() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_( + reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_tracking_state_dep_a_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_tracking_state_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -1070,143 +1397,214 @@ class Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA5 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_tracking_state_dep_a_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA5, Test) -{ +}; + +TEST_F(Test_legacy_auto_check_sbp_tracking_MsgtrackingStateDepA5, Test) { + uint8_t encoded_frame[] = { + 85, 22, 0, 195, 4, 66, 1, 0, 98, 39, 219, 65, 1, 2, 0, + 0, 56, 64, 1, 3, 121, 123, 7, 65, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, + 0, 128, 191, 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, + 0, 0, 0, 0, 128, 191, 0, 0, 0, 0, 128, 191, 37, 123, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_tracking_state_dep_a_t *test_msg = + (msg_tracking_state_dep_a_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[0].cn0 = 27.394229888916016; + test_msg->states[0].prn = 0; + test_msg->states[0].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[1].cn0 = 2.875; + test_msg->states[1].prn = 2; + test_msg->states[1].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[2].cn0 = 8.467644691467285; + test_msg->states[2].prn = 3; + test_msg->states[2].state = 1; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[3].cn0 = -1.0; + test_msg->states[3].prn = 0; + test_msg->states[3].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[4].cn0 = -1.0; + test_msg->states[4].prn = 0; + test_msg->states[4].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[5].cn0 = -1.0; + test_msg->states[5].prn = 0; + test_msg->states[5].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[6].cn0 = -1.0; + test_msg->states[6].prn = 0; + test_msg->states[6].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[7].cn0 = -1.0; + test_msg->states[7].prn = 0; + test_msg->states[7].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[8].cn0 = -1.0; + test_msg->states[8].prn = 0; + test_msg->states[8].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[9].cn0 = -1.0; + test_msg->states[9].prn = 0; + test_msg->states[9].state = 0; + if (sizeof(test_msg->states) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); + } + test_msg->states[10].cn0 = -1.0; + test_msg->states[10].prn = 0; + test_msg->states[10].state = 0; + + EXPECT_EQ(send_message(0x16, 1219, test_msg_len, test_msg_storage), SBP_OK); - uint8_t encoded_frame[] = {85,22,0,195,4,66,1,0,98,39,219,65,1,2,0,0,56,64,1,3,121,123,7,65,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,0,0,0,0,128,191,37,123, }; + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_tracking_state_dep_a_t* test_msg = ( msg_tracking_state_dep_a_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[0].cn0 = 27.394229888916016; - test_msg->states[0].prn = 0; - test_msg->states[0].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[1].cn0 = 2.875; - test_msg->states[1].prn = 2; - test_msg->states[1].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[2].cn0 = 8.467644691467285; - test_msg->states[2].prn = 3; - test_msg->states[2].state = 1; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[3].cn0 = -1.0; - test_msg->states[3].prn = 0; - test_msg->states[3].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[4].cn0 = -1.0; - test_msg->states[4].prn = 0; - test_msg->states[4].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[5].cn0 = -1.0; - test_msg->states[5].prn = 0; - test_msg->states[5].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[6].cn0 = -1.0; - test_msg->states[6].prn = 0; - test_msg->states[6].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[7].cn0 = -1.0; - test_msg->states[7].prn = 0; - test_msg->states[7].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[8].cn0 = -1.0; - test_msg->states[8].prn = 0; - test_msg->states[8].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[9].cn0 = -1.0; - test_msg->states[9].prn = 0; - test_msg->states[9].state = 0; - if (sizeof(test_msg->states) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->states[0])); - } - test_msg->states[10].cn0 = -1.0; - test_msg->states[10].prn = 0; - test_msg->states[10].state = 0; - - EXPECT_EQ(send_message( 0x16, 1219, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 1219); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_LT((last_msg_->states[0].cn0*100 - 27.3942298889*100), 0.05) << "incorrect value for states[0].cn0, expected 27.3942298889, is " << last_msg_->states[0].cn0; - EXPECT_EQ(last_msg_->states[0].prn, 0) << "incorrect value for states[0].prn, expected 0, is " << last_msg_->states[0].prn; - EXPECT_EQ(last_msg_->states[0].state, 1) << "incorrect value for states[0].state, expected 1, is " << last_msg_->states[0].state; - EXPECT_LT((last_msg_->states[1].cn0*100 - 2.875*100), 0.05) << "incorrect value for states[1].cn0, expected 2.875, is " << last_msg_->states[1].cn0; - EXPECT_EQ(last_msg_->states[1].prn, 2) << "incorrect value for states[1].prn, expected 2, is " << last_msg_->states[1].prn; - EXPECT_EQ(last_msg_->states[1].state, 1) << "incorrect value for states[1].state, expected 1, is " << last_msg_->states[1].state; - EXPECT_LT((last_msg_->states[2].cn0*100 - 8.46764469147*100), 0.05) << "incorrect value for states[2].cn0, expected 8.46764469147, is " << last_msg_->states[2].cn0; - EXPECT_EQ(last_msg_->states[2].prn, 3) << "incorrect value for states[2].prn, expected 3, is " << last_msg_->states[2].prn; - EXPECT_EQ(last_msg_->states[2].state, 1) << "incorrect value for states[2].state, expected 1, is " << last_msg_->states[2].state; - EXPECT_LT((last_msg_->states[3].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[3].cn0, expected -1.0, is " << last_msg_->states[3].cn0; - EXPECT_EQ(last_msg_->states[3].prn, 0) << "incorrect value for states[3].prn, expected 0, is " << last_msg_->states[3].prn; - EXPECT_EQ(last_msg_->states[3].state, 0) << "incorrect value for states[3].state, expected 0, is " << last_msg_->states[3].state; - EXPECT_LT((last_msg_->states[4].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[4].cn0, expected -1.0, is " << last_msg_->states[4].cn0; - EXPECT_EQ(last_msg_->states[4].prn, 0) << "incorrect value for states[4].prn, expected 0, is " << last_msg_->states[4].prn; - EXPECT_EQ(last_msg_->states[4].state, 0) << "incorrect value for states[4].state, expected 0, is " << last_msg_->states[4].state; - EXPECT_LT((last_msg_->states[5].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[5].cn0, expected -1.0, is " << last_msg_->states[5].cn0; - EXPECT_EQ(last_msg_->states[5].prn, 0) << "incorrect value for states[5].prn, expected 0, is " << last_msg_->states[5].prn; - EXPECT_EQ(last_msg_->states[5].state, 0) << "incorrect value for states[5].state, expected 0, is " << last_msg_->states[5].state; - EXPECT_LT((last_msg_->states[6].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[6].cn0, expected -1.0, is " << last_msg_->states[6].cn0; - EXPECT_EQ(last_msg_->states[6].prn, 0) << "incorrect value for states[6].prn, expected 0, is " << last_msg_->states[6].prn; - EXPECT_EQ(last_msg_->states[6].state, 0) << "incorrect value for states[6].state, expected 0, is " << last_msg_->states[6].state; - EXPECT_LT((last_msg_->states[7].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[7].cn0, expected -1.0, is " << last_msg_->states[7].cn0; - EXPECT_EQ(last_msg_->states[7].prn, 0) << "incorrect value for states[7].prn, expected 0, is " << last_msg_->states[7].prn; - EXPECT_EQ(last_msg_->states[7].state, 0) << "incorrect value for states[7].state, expected 0, is " << last_msg_->states[7].state; - EXPECT_LT((last_msg_->states[8].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[8].cn0, expected -1.0, is " << last_msg_->states[8].cn0; - EXPECT_EQ(last_msg_->states[8].prn, 0) << "incorrect value for states[8].prn, expected 0, is " << last_msg_->states[8].prn; - EXPECT_EQ(last_msg_->states[8].state, 0) << "incorrect value for states[8].state, expected 0, is " << last_msg_->states[8].state; - EXPECT_LT((last_msg_->states[9].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[9].cn0, expected -1.0, is " << last_msg_->states[9].cn0; - EXPECT_EQ(last_msg_->states[9].prn, 0) << "incorrect value for states[9].prn, expected 0, is " << last_msg_->states[9].prn; - EXPECT_EQ(last_msg_->states[9].state, 0) << "incorrect value for states[9].state, expected 0, is " << last_msg_->states[9].state; - EXPECT_LT((last_msg_->states[10].cn0*100 - -1.0*100), 0.05) << "incorrect value for states[10].cn0, expected -1.0, is " << last_msg_->states[10].cn0; - EXPECT_EQ(last_msg_->states[10].prn, 0) << "incorrect value for states[10].prn, expected 0, is " << last_msg_->states[10].prn; - EXPECT_EQ(last_msg_->states[10].state, 0) << "incorrect value for states[10].state, expected 0, is " << last_msg_->states[10].state; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 1219); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_LT((last_msg_->states[0].cn0 * 100 - 27.3942298889 * 100), 0.05) + << "incorrect value for states[0].cn0, expected 27.3942298889, is " + << last_msg_->states[0].cn0; + EXPECT_EQ(last_msg_->states[0].prn, 0) + << "incorrect value for states[0].prn, expected 0, is " + << last_msg_->states[0].prn; + EXPECT_EQ(last_msg_->states[0].state, 1) + << "incorrect value for states[0].state, expected 1, is " + << last_msg_->states[0].state; + EXPECT_LT((last_msg_->states[1].cn0 * 100 - 2.875 * 100), 0.05) + << "incorrect value for states[1].cn0, expected 2.875, is " + << last_msg_->states[1].cn0; + EXPECT_EQ(last_msg_->states[1].prn, 2) + << "incorrect value for states[1].prn, expected 2, is " + << last_msg_->states[1].prn; + EXPECT_EQ(last_msg_->states[1].state, 1) + << "incorrect value for states[1].state, expected 1, is " + << last_msg_->states[1].state; + EXPECT_LT((last_msg_->states[2].cn0 * 100 - 8.46764469147 * 100), 0.05) + << "incorrect value for states[2].cn0, expected 8.46764469147, is " + << last_msg_->states[2].cn0; + EXPECT_EQ(last_msg_->states[2].prn, 3) + << "incorrect value for states[2].prn, expected 3, is " + << last_msg_->states[2].prn; + EXPECT_EQ(last_msg_->states[2].state, 1) + << "incorrect value for states[2].state, expected 1, is " + << last_msg_->states[2].state; + EXPECT_LT((last_msg_->states[3].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[3].cn0, expected -1.0, is " + << last_msg_->states[3].cn0; + EXPECT_EQ(last_msg_->states[3].prn, 0) + << "incorrect value for states[3].prn, expected 0, is " + << last_msg_->states[3].prn; + EXPECT_EQ(last_msg_->states[3].state, 0) + << "incorrect value for states[3].state, expected 0, is " + << last_msg_->states[3].state; + EXPECT_LT((last_msg_->states[4].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[4].cn0, expected -1.0, is " + << last_msg_->states[4].cn0; + EXPECT_EQ(last_msg_->states[4].prn, 0) + << "incorrect value for states[4].prn, expected 0, is " + << last_msg_->states[4].prn; + EXPECT_EQ(last_msg_->states[4].state, 0) + << "incorrect value for states[4].state, expected 0, is " + << last_msg_->states[4].state; + EXPECT_LT((last_msg_->states[5].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[5].cn0, expected -1.0, is " + << last_msg_->states[5].cn0; + EXPECT_EQ(last_msg_->states[5].prn, 0) + << "incorrect value for states[5].prn, expected 0, is " + << last_msg_->states[5].prn; + EXPECT_EQ(last_msg_->states[5].state, 0) + << "incorrect value for states[5].state, expected 0, is " + << last_msg_->states[5].state; + EXPECT_LT((last_msg_->states[6].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[6].cn0, expected -1.0, is " + << last_msg_->states[6].cn0; + EXPECT_EQ(last_msg_->states[6].prn, 0) + << "incorrect value for states[6].prn, expected 0, is " + << last_msg_->states[6].prn; + EXPECT_EQ(last_msg_->states[6].state, 0) + << "incorrect value for states[6].state, expected 0, is " + << last_msg_->states[6].state; + EXPECT_LT((last_msg_->states[7].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[7].cn0, expected -1.0, is " + << last_msg_->states[7].cn0; + EXPECT_EQ(last_msg_->states[7].prn, 0) + << "incorrect value for states[7].prn, expected 0, is " + << last_msg_->states[7].prn; + EXPECT_EQ(last_msg_->states[7].state, 0) + << "incorrect value for states[7].state, expected 0, is " + << last_msg_->states[7].state; + EXPECT_LT((last_msg_->states[8].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[8].cn0, expected -1.0, is " + << last_msg_->states[8].cn0; + EXPECT_EQ(last_msg_->states[8].prn, 0) + << "incorrect value for states[8].prn, expected 0, is " + << last_msg_->states[8].prn; + EXPECT_EQ(last_msg_->states[8].state, 0) + << "incorrect value for states[8].state, expected 0, is " + << last_msg_->states[8].state; + EXPECT_LT((last_msg_->states[9].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[9].cn0, expected -1.0, is " + << last_msg_->states[9].cn0; + EXPECT_EQ(last_msg_->states[9].prn, 0) + << "incorrect value for states[9].prn, expected 0, is " + << last_msg_->states[9].prn; + EXPECT_EQ(last_msg_->states[9].state, 0) + << "incorrect value for states[9].state, expected 0, is " + << last_msg_->states[9].state; + EXPECT_LT((last_msg_->states[10].cn0 * 100 - -1.0 * 100), 0.05) + << "incorrect value for states[10].cn0, expected -1.0, is " + << last_msg_->states[10].cn0; + EXPECT_EQ(last_msg_->states[10].prn, 0) + << "incorrect value for states[10].prn, expected 0, is " + << last_msg_->states[10].prn; + EXPECT_EQ(last_msg_->states[10].state, 0) + << "incorrect value for states[10].state, expected 0, is " + << last_msg_->states[10].state; } diff --git a/c/test/legacy/cpp/auto_check_sbp_user_MsgUserData.cc b/c/test/legacy/cpp/auto_check_sbp_user_MsgUserData.cc index 9f2bb3185..999ce7c27 100644 --- a/c/test/legacy/cpp/auto_check_sbp_user_MsgUserData.cc +++ b/c/test/legacy/cpp/auto_check_sbp_user_MsgUserData.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/user/test_MsgUserData.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/user/test_MsgUserData.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_user_MsgUserData0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_user_MsgUserData0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_user_MsgUserData0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_user_MsgUserData0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_user_data_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_user_data_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,1563 +81,2090 @@ class Test_legacy_auto_check_sbp_user_MsgUserData0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_user_data_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_user_MsgUserData0, Test) -{ +}; - uint8_t encoded_frame[] = {85,0,8,126,33,255,53,5,172,138,50,49,206,234,149,204,113,31,108,188,179,154,156,167,145,139,42,207,126,242,193,9,58,75,8,135,11,92,131,245,24,90,255,30,58,31,109,148,56,178,140,30,159,70,17,170,50,148,1,99,112,88,217,36,84,34,234,82,144,144,97,96,75,174,58,219,180,148,247,59,2,116,214,114,55,134,54,119,108,128,73,181,20,233,23,23,73,119,136,231,189,26,174,128,93,30,76,45,109,134,81,0,116,158,127,40,133,208,134,127,140,232,183,184,108,6,228,54,238,59,220,30,228,212,50,182,97,20,41,76,227,88,12,95,112,209,183,127,4,165,189,44,239,232,132,9,114,184,249,208,246,194,250,2,97,173,157,202,172,180,150,213,193,177,209,156,20,174,18,73,132,215,115,128,175,169,116,132,100,72,45,25,14,205,213,145,68,137,249,54,40,174,215,148,166,190,63,118,6,165,212,74,68,200,38,139,212,112,45,167,236,255,106,92,132,59,61,233,3,246,158,83,134,246,154,17,0,6,56,216,19,216,70,71,161,184,5,177,45,37,98,56,149,0,73,221,105,239,168,205,85,81,245, }; +TEST_F(Test_legacy_auto_check_sbp_user_MsgUserData0, Test) { + uint8_t encoded_frame[] = { + 85, 0, 8, 126, 33, 255, 53, 5, 172, 138, 50, 49, 206, 234, 149, + 204, 113, 31, 108, 188, 179, 154, 156, 167, 145, 139, 42, 207, 126, 242, + 193, 9, 58, 75, 8, 135, 11, 92, 131, 245, 24, 90, 255, 30, 58, + 31, 109, 148, 56, 178, 140, 30, 159, 70, 17, 170, 50, 148, 1, 99, + 112, 88, 217, 36, 84, 34, 234, 82, 144, 144, 97, 96, 75, 174, 58, + 219, 180, 148, 247, 59, 2, 116, 214, 114, 55, 134, 54, 119, 108, 128, + 73, 181, 20, 233, 23, 23, 73, 119, 136, 231, 189, 26, 174, 128, 93, + 30, 76, 45, 109, 134, 81, 0, 116, 158, 127, 40, 133, 208, 134, 127, + 140, 232, 183, 184, 108, 6, 228, 54, 238, 59, 220, 30, 228, 212, 50, + 182, 97, 20, 41, 76, 227, 88, 12, 95, 112, 209, 183, 127, 4, 165, + 189, 44, 239, 232, 132, 9, 114, 184, 249, 208, 246, 194, 250, 2, 97, + 173, 157, 202, 172, 180, 150, 213, 193, 177, 209, 156, 20, 174, 18, 73, + 132, 215, 115, 128, 175, 169, 116, 132, 100, 72, 45, 25, 14, 205, 213, + 145, 68, 137, 249, 54, 40, 174, 215, 148, 166, 190, 63, 118, 6, 165, + 212, 74, 68, 200, 38, 139, 212, 112, 45, 167, 236, 255, 106, 92, 132, + 59, 61, 233, 3, 246, 158, 83, 134, 246, 154, 17, 0, 6, 56, 216, + 19, 216, 70, 71, 161, 184, 5, 177, 45, 37, 98, 56, 149, 0, 73, + 221, 105, 239, 168, 205, 85, 81, 245, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_user_data_t* test_msg = ( msg_user_data_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[0] = 53; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[1] = 5; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[2] = 172; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[3] = 138; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[4] = 50; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[5] = 49; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[6] = 206; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[7] = 234; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[8] = 149; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[9] = 204; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[10] = 113; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[11] = 31; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[12] = 108; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[13] = 188; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[14] = 179; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[15] = 154; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[16] = 156; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[17] = 167; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[18] = 145; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[19] = 139; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[20] = 42; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[21] = 207; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[22] = 126; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[23] = 242; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[24] = 193; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[25] = 9; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[26] = 58; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[27] = 75; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[28] = 8; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[29] = 135; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[30] = 11; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[31] = 92; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[32] = 131; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[33] = 245; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[34] = 24; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[35] = 90; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[36] = 255; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[37] = 30; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[38] = 58; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[39] = 31; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[40] = 109; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[41] = 148; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[42] = 56; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[43] = 178; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[44] = 140; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[45] = 30; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[46] = 159; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[47] = 70; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[48] = 17; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[49] = 170; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[50] = 50; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[51] = 148; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[52] = 1; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[53] = 99; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[54] = 112; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[55] = 88; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[56] = 217; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[57] = 36; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[58] = 84; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[59] = 34; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[60] = 234; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[61] = 82; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[62] = 144; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[63] = 144; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[64] = 97; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[65] = 96; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[66] = 75; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[67] = 174; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[68] = 58; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[69] = 219; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[70] = 180; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[71] = 148; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[72] = 247; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[73] = 59; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[74] = 2; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[75] = 116; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[76] = 214; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[77] = 114; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[78] = 55; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[79] = 134; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[80] = 54; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[81] = 119; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[82] = 108; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[83] = 128; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[84] = 73; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[85] = 181; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[86] = 20; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[87] = 233; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[88] = 23; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[89] = 23; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[90] = 73; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[91] = 119; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[92] = 136; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[93] = 231; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[94] = 189; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[95] = 26; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[96] = 174; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[97] = 128; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[98] = 93; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[99] = 30; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[100] = 76; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[101] = 45; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[102] = 109; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[103] = 134; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[104] = 81; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[105] = 0; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[106] = 116; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[107] = 158; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[108] = 127; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[109] = 40; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[110] = 133; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[111] = 208; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[112] = 134; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[113] = 127; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[114] = 140; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[115] = 232; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[116] = 183; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[117] = 184; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[118] = 108; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[119] = 6; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[120] = 228; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[121] = 54; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[122] = 238; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[123] = 59; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[124] = 220; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[125] = 30; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[126] = 228; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[127] = 212; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[128] = 50; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[129] = 182; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[130] = 97; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[131] = 20; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[132] = 41; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[133] = 76; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[134] = 227; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[135] = 88; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[136] = 12; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[137] = 95; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[138] = 112; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[139] = 209; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[140] = 183; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[141] = 127; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[142] = 4; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[143] = 165; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[144] = 189; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[145] = 44; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[146] = 239; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[147] = 232; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[148] = 132; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[149] = 9; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[150] = 114; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[151] = 184; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[152] = 249; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[153] = 208; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[154] = 246; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[155] = 194; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[156] = 250; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[157] = 2; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[158] = 97; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[159] = 173; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[160] = 157; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[161] = 202; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[162] = 172; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[163] = 180; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[164] = 150; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[165] = 213; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[166] = 193; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[167] = 177; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[168] = 209; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[169] = 156; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[170] = 20; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[171] = 174; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[172] = 18; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[173] = 73; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[174] = 132; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[175] = 215; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[176] = 115; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[177] = 128; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[178] = 175; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[179] = 169; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[180] = 116; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[181] = 132; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[182] = 100; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[183] = 72; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[184] = 45; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[185] = 25; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[186] = 14; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[187] = 205; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[188] = 213; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[189] = 145; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[190] = 68; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[191] = 137; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[192] = 249; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[193] = 54; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[194] = 40; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[195] = 174; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[196] = 215; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[197] = 148; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[198] = 166; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[199] = 190; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[200] = 63; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[201] = 118; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[202] = 6; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[203] = 165; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[204] = 212; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[205] = 74; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[206] = 68; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[207] = 200; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[208] = 38; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[209] = 139; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[210] = 212; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[211] = 112; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[212] = 45; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[213] = 167; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[214] = 236; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[215] = 255; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[216] = 106; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[217] = 92; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[218] = 132; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[219] = 59; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[220] = 61; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[221] = 233; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[222] = 3; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[223] = 246; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[224] = 158; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[225] = 83; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[226] = 134; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[227] = 246; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[228] = 154; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[229] = 17; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[230] = 0; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[231] = 6; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[232] = 56; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[233] = 216; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[234] = 19; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[235] = 216; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[236] = 70; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[237] = 71; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[238] = 161; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[239] = 184; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[240] = 5; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[241] = 177; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[242] = 45; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[243] = 37; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[244] = 98; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[245] = 56; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[246] = 149; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[247] = 0; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[248] = 73; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[249] = 221; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[250] = 105; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[251] = 239; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[252] = 168; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[253] = 205; - if (sizeof(test_msg->contents) == 0) { - // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); - } - test_msg->contents[254] = 85; - - EXPECT_EQ(send_message( 0x800, 8574, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_user_data_t *test_msg = (msg_user_data_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[0] = 53; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[1] = 5; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[2] = 172; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[3] = 138; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[4] = 50; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[5] = 49; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[6] = 206; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[7] = 234; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[8] = 149; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[9] = 204; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[10] = 113; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[11] = 31; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[12] = 108; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[13] = 188; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[14] = 179; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[15] = 154; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[16] = 156; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[17] = 167; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[18] = 145; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[19] = 139; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[20] = 42; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[21] = 207; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[22] = 126; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[23] = 242; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[24] = 193; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[25] = 9; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[26] = 58; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[27] = 75; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[28] = 8; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[29] = 135; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[30] = 11; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[31] = 92; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[32] = 131; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[33] = 245; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[34] = 24; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[35] = 90; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[36] = 255; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[37] = 30; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[38] = 58; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[39] = 31; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[40] = 109; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[41] = 148; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[42] = 56; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[43] = 178; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[44] = 140; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[45] = 30; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[46] = 159; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[47] = 70; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[48] = 17; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[49] = 170; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[50] = 50; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[51] = 148; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[52] = 1; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[53] = 99; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[54] = 112; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[55] = 88; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[56] = 217; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[57] = 36; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[58] = 84; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[59] = 34; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[60] = 234; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[61] = 82; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[62] = 144; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[63] = 144; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[64] = 97; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[65] = 96; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[66] = 75; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[67] = 174; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[68] = 58; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[69] = 219; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[70] = 180; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[71] = 148; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[72] = 247; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[73] = 59; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[74] = 2; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[75] = 116; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[76] = 214; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[77] = 114; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[78] = 55; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[79] = 134; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[80] = 54; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[81] = 119; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[82] = 108; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[83] = 128; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[84] = 73; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[85] = 181; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[86] = 20; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[87] = 233; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[88] = 23; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[89] = 23; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[90] = 73; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[91] = 119; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[92] = 136; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[93] = 231; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[94] = 189; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[95] = 26; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[96] = 174; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[97] = 128; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[98] = 93; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[99] = 30; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[100] = 76; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[101] = 45; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[102] = 109; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[103] = 134; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[104] = 81; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[105] = 0; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[106] = 116; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[107] = 158; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[108] = 127; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[109] = 40; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[110] = 133; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[111] = 208; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[112] = 134; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[113] = 127; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[114] = 140; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[115] = 232; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[116] = 183; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[117] = 184; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[118] = 108; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[119] = 6; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[120] = 228; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[121] = 54; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[122] = 238; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[123] = 59; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[124] = 220; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[125] = 30; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[126] = 228; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[127] = 212; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[128] = 50; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[129] = 182; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[130] = 97; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[131] = 20; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[132] = 41; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[133] = 76; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[134] = 227; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[135] = 88; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[136] = 12; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[137] = 95; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[138] = 112; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[139] = 209; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[140] = 183; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[141] = 127; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[142] = 4; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[143] = 165; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[144] = 189; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[145] = 44; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[146] = 239; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[147] = 232; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[148] = 132; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[149] = 9; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[150] = 114; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[151] = 184; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[152] = 249; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[153] = 208; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[154] = 246; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[155] = 194; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[156] = 250; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[157] = 2; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[158] = 97; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[159] = 173; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[160] = 157; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[161] = 202; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[162] = 172; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[163] = 180; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[164] = 150; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[165] = 213; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[166] = 193; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[167] = 177; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[168] = 209; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[169] = 156; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[170] = 20; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[171] = 174; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[172] = 18; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[173] = 73; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[174] = 132; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[175] = 215; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[176] = 115; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[177] = 128; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[178] = 175; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[179] = 169; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[180] = 116; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[181] = 132; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[182] = 100; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[183] = 72; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[184] = 45; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[185] = 25; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[186] = 14; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[187] = 205; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[188] = 213; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[189] = 145; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[190] = 68; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[191] = 137; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[192] = 249; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[193] = 54; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[194] = 40; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[195] = 174; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[196] = 215; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[197] = 148; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[198] = 166; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[199] = 190; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[200] = 63; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[201] = 118; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[202] = 6; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[203] = 165; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[204] = 212; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[205] = 74; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[206] = 68; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[207] = 200; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[208] = 38; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[209] = 139; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[210] = 212; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[211] = 112; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[212] = 45; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[213] = 167; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[214] = 236; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[215] = 255; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[216] = 106; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[217] = 92; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[218] = 132; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[219] = 59; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[220] = 61; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[221] = 233; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[222] = 3; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[223] = 246; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[224] = 158; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[225] = 83; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[226] = 134; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[227] = 246; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[228] = 154; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[229] = 17; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[230] = 0; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[231] = 6; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[232] = 56; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[233] = 216; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[234] = 19; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[235] = 216; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[236] = 70; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[237] = 71; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[238] = 161; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[239] = 184; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[240] = 5; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[241] = 177; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[242] = 45; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[243] = 37; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[244] = 98; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[245] = 56; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[246] = 149; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[247] = 0; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[248] = 73; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[249] = 221; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[250] = 105; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[251] = 239; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[252] = 168; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[253] = 205; + if (sizeof(test_msg->contents) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->contents[0])); + } + test_msg->contents[254] = 85; + + EXPECT_EQ(send_message(0x800, 8574, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 8574); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->contents[0], 53) << "incorrect value for contents[0], expected 53, is " << last_msg_->contents[0]; - EXPECT_EQ(last_msg_->contents[1], 5) << "incorrect value for contents[1], expected 5, is " << last_msg_->contents[1]; - EXPECT_EQ(last_msg_->contents[2], 172) << "incorrect value for contents[2], expected 172, is " << last_msg_->contents[2]; - EXPECT_EQ(last_msg_->contents[3], 138) << "incorrect value for contents[3], expected 138, is " << last_msg_->contents[3]; - EXPECT_EQ(last_msg_->contents[4], 50) << "incorrect value for contents[4], expected 50, is " << last_msg_->contents[4]; - EXPECT_EQ(last_msg_->contents[5], 49) << "incorrect value for contents[5], expected 49, is " << last_msg_->contents[5]; - EXPECT_EQ(last_msg_->contents[6], 206) << "incorrect value for contents[6], expected 206, is " << last_msg_->contents[6]; - EXPECT_EQ(last_msg_->contents[7], 234) << "incorrect value for contents[7], expected 234, is " << last_msg_->contents[7]; - EXPECT_EQ(last_msg_->contents[8], 149) << "incorrect value for contents[8], expected 149, is " << last_msg_->contents[8]; - EXPECT_EQ(last_msg_->contents[9], 204) << "incorrect value for contents[9], expected 204, is " << last_msg_->contents[9]; - EXPECT_EQ(last_msg_->contents[10], 113) << "incorrect value for contents[10], expected 113, is " << last_msg_->contents[10]; - EXPECT_EQ(last_msg_->contents[11], 31) << "incorrect value for contents[11], expected 31, is " << last_msg_->contents[11]; - EXPECT_EQ(last_msg_->contents[12], 108) << "incorrect value for contents[12], expected 108, is " << last_msg_->contents[12]; - EXPECT_EQ(last_msg_->contents[13], 188) << "incorrect value for contents[13], expected 188, is " << last_msg_->contents[13]; - EXPECT_EQ(last_msg_->contents[14], 179) << "incorrect value for contents[14], expected 179, is " << last_msg_->contents[14]; - EXPECT_EQ(last_msg_->contents[15], 154) << "incorrect value for contents[15], expected 154, is " << last_msg_->contents[15]; - EXPECT_EQ(last_msg_->contents[16], 156) << "incorrect value for contents[16], expected 156, is " << last_msg_->contents[16]; - EXPECT_EQ(last_msg_->contents[17], 167) << "incorrect value for contents[17], expected 167, is " << last_msg_->contents[17]; - EXPECT_EQ(last_msg_->contents[18], 145) << "incorrect value for contents[18], expected 145, is " << last_msg_->contents[18]; - EXPECT_EQ(last_msg_->contents[19], 139) << "incorrect value for contents[19], expected 139, is " << last_msg_->contents[19]; - EXPECT_EQ(last_msg_->contents[20], 42) << "incorrect value for contents[20], expected 42, is " << last_msg_->contents[20]; - EXPECT_EQ(last_msg_->contents[21], 207) << "incorrect value for contents[21], expected 207, is " << last_msg_->contents[21]; - EXPECT_EQ(last_msg_->contents[22], 126) << "incorrect value for contents[22], expected 126, is " << last_msg_->contents[22]; - EXPECT_EQ(last_msg_->contents[23], 242) << "incorrect value for contents[23], expected 242, is " << last_msg_->contents[23]; - EXPECT_EQ(last_msg_->contents[24], 193) << "incorrect value for contents[24], expected 193, is " << last_msg_->contents[24]; - EXPECT_EQ(last_msg_->contents[25], 9) << "incorrect value for contents[25], expected 9, is " << last_msg_->contents[25]; - EXPECT_EQ(last_msg_->contents[26], 58) << "incorrect value for contents[26], expected 58, is " << last_msg_->contents[26]; - EXPECT_EQ(last_msg_->contents[27], 75) << "incorrect value for contents[27], expected 75, is " << last_msg_->contents[27]; - EXPECT_EQ(last_msg_->contents[28], 8) << "incorrect value for contents[28], expected 8, is " << last_msg_->contents[28]; - EXPECT_EQ(last_msg_->contents[29], 135) << "incorrect value for contents[29], expected 135, is " << last_msg_->contents[29]; - EXPECT_EQ(last_msg_->contents[30], 11) << "incorrect value for contents[30], expected 11, is " << last_msg_->contents[30]; - EXPECT_EQ(last_msg_->contents[31], 92) << "incorrect value for contents[31], expected 92, is " << last_msg_->contents[31]; - EXPECT_EQ(last_msg_->contents[32], 131) << "incorrect value for contents[32], expected 131, is " << last_msg_->contents[32]; - EXPECT_EQ(last_msg_->contents[33], 245) << "incorrect value for contents[33], expected 245, is " << last_msg_->contents[33]; - EXPECT_EQ(last_msg_->contents[34], 24) << "incorrect value for contents[34], expected 24, is " << last_msg_->contents[34]; - EXPECT_EQ(last_msg_->contents[35], 90) << "incorrect value for contents[35], expected 90, is " << last_msg_->contents[35]; - EXPECT_EQ(last_msg_->contents[36], 255) << "incorrect value for contents[36], expected 255, is " << last_msg_->contents[36]; - EXPECT_EQ(last_msg_->contents[37], 30) << "incorrect value for contents[37], expected 30, is " << last_msg_->contents[37]; - EXPECT_EQ(last_msg_->contents[38], 58) << "incorrect value for contents[38], expected 58, is " << last_msg_->contents[38]; - EXPECT_EQ(last_msg_->contents[39], 31) << "incorrect value for contents[39], expected 31, is " << last_msg_->contents[39]; - EXPECT_EQ(last_msg_->contents[40], 109) << "incorrect value for contents[40], expected 109, is " << last_msg_->contents[40]; - EXPECT_EQ(last_msg_->contents[41], 148) << "incorrect value for contents[41], expected 148, is " << last_msg_->contents[41]; - EXPECT_EQ(last_msg_->contents[42], 56) << "incorrect value for contents[42], expected 56, is " << last_msg_->contents[42]; - EXPECT_EQ(last_msg_->contents[43], 178) << "incorrect value for contents[43], expected 178, is " << last_msg_->contents[43]; - EXPECT_EQ(last_msg_->contents[44], 140) << "incorrect value for contents[44], expected 140, is " << last_msg_->contents[44]; - EXPECT_EQ(last_msg_->contents[45], 30) << "incorrect value for contents[45], expected 30, is " << last_msg_->contents[45]; - EXPECT_EQ(last_msg_->contents[46], 159) << "incorrect value for contents[46], expected 159, is " << last_msg_->contents[46]; - EXPECT_EQ(last_msg_->contents[47], 70) << "incorrect value for contents[47], expected 70, is " << last_msg_->contents[47]; - EXPECT_EQ(last_msg_->contents[48], 17) << "incorrect value for contents[48], expected 17, is " << last_msg_->contents[48]; - EXPECT_EQ(last_msg_->contents[49], 170) << "incorrect value for contents[49], expected 170, is " << last_msg_->contents[49]; - EXPECT_EQ(last_msg_->contents[50], 50) << "incorrect value for contents[50], expected 50, is " << last_msg_->contents[50]; - EXPECT_EQ(last_msg_->contents[51], 148) << "incorrect value for contents[51], expected 148, is " << last_msg_->contents[51]; - EXPECT_EQ(last_msg_->contents[52], 1) << "incorrect value for contents[52], expected 1, is " << last_msg_->contents[52]; - EXPECT_EQ(last_msg_->contents[53], 99) << "incorrect value for contents[53], expected 99, is " << last_msg_->contents[53]; - EXPECT_EQ(last_msg_->contents[54], 112) << "incorrect value for contents[54], expected 112, is " << last_msg_->contents[54]; - EXPECT_EQ(last_msg_->contents[55], 88) << "incorrect value for contents[55], expected 88, is " << last_msg_->contents[55]; - EXPECT_EQ(last_msg_->contents[56], 217) << "incorrect value for contents[56], expected 217, is " << last_msg_->contents[56]; - EXPECT_EQ(last_msg_->contents[57], 36) << "incorrect value for contents[57], expected 36, is " << last_msg_->contents[57]; - EXPECT_EQ(last_msg_->contents[58], 84) << "incorrect value for contents[58], expected 84, is " << last_msg_->contents[58]; - EXPECT_EQ(last_msg_->contents[59], 34) << "incorrect value for contents[59], expected 34, is " << last_msg_->contents[59]; - EXPECT_EQ(last_msg_->contents[60], 234) << "incorrect value for contents[60], expected 234, is " << last_msg_->contents[60]; - EXPECT_EQ(last_msg_->contents[61], 82) << "incorrect value for contents[61], expected 82, is " << last_msg_->contents[61]; - EXPECT_EQ(last_msg_->contents[62], 144) << "incorrect value for contents[62], expected 144, is " << last_msg_->contents[62]; - EXPECT_EQ(last_msg_->contents[63], 144) << "incorrect value for contents[63], expected 144, is " << last_msg_->contents[63]; - EXPECT_EQ(last_msg_->contents[64], 97) << "incorrect value for contents[64], expected 97, is " << last_msg_->contents[64]; - EXPECT_EQ(last_msg_->contents[65], 96) << "incorrect value for contents[65], expected 96, is " << last_msg_->contents[65]; - EXPECT_EQ(last_msg_->contents[66], 75) << "incorrect value for contents[66], expected 75, is " << last_msg_->contents[66]; - EXPECT_EQ(last_msg_->contents[67], 174) << "incorrect value for contents[67], expected 174, is " << last_msg_->contents[67]; - EXPECT_EQ(last_msg_->contents[68], 58) << "incorrect value for contents[68], expected 58, is " << last_msg_->contents[68]; - EXPECT_EQ(last_msg_->contents[69], 219) << "incorrect value for contents[69], expected 219, is " << last_msg_->contents[69]; - EXPECT_EQ(last_msg_->contents[70], 180) << "incorrect value for contents[70], expected 180, is " << last_msg_->contents[70]; - EXPECT_EQ(last_msg_->contents[71], 148) << "incorrect value for contents[71], expected 148, is " << last_msg_->contents[71]; - EXPECT_EQ(last_msg_->contents[72], 247) << "incorrect value for contents[72], expected 247, is " << last_msg_->contents[72]; - EXPECT_EQ(last_msg_->contents[73], 59) << "incorrect value for contents[73], expected 59, is " << last_msg_->contents[73]; - EXPECT_EQ(last_msg_->contents[74], 2) << "incorrect value for contents[74], expected 2, is " << last_msg_->contents[74]; - EXPECT_EQ(last_msg_->contents[75], 116) << "incorrect value for contents[75], expected 116, is " << last_msg_->contents[75]; - EXPECT_EQ(last_msg_->contents[76], 214) << "incorrect value for contents[76], expected 214, is " << last_msg_->contents[76]; - EXPECT_EQ(last_msg_->contents[77], 114) << "incorrect value for contents[77], expected 114, is " << last_msg_->contents[77]; - EXPECT_EQ(last_msg_->contents[78], 55) << "incorrect value for contents[78], expected 55, is " << last_msg_->contents[78]; - EXPECT_EQ(last_msg_->contents[79], 134) << "incorrect value for contents[79], expected 134, is " << last_msg_->contents[79]; - EXPECT_EQ(last_msg_->contents[80], 54) << "incorrect value for contents[80], expected 54, is " << last_msg_->contents[80]; - EXPECT_EQ(last_msg_->contents[81], 119) << "incorrect value for contents[81], expected 119, is " << last_msg_->contents[81]; - EXPECT_EQ(last_msg_->contents[82], 108) << "incorrect value for contents[82], expected 108, is " << last_msg_->contents[82]; - EXPECT_EQ(last_msg_->contents[83], 128) << "incorrect value for contents[83], expected 128, is " << last_msg_->contents[83]; - EXPECT_EQ(last_msg_->contents[84], 73) << "incorrect value for contents[84], expected 73, is " << last_msg_->contents[84]; - EXPECT_EQ(last_msg_->contents[85], 181) << "incorrect value for contents[85], expected 181, is " << last_msg_->contents[85]; - EXPECT_EQ(last_msg_->contents[86], 20) << "incorrect value for contents[86], expected 20, is " << last_msg_->contents[86]; - EXPECT_EQ(last_msg_->contents[87], 233) << "incorrect value for contents[87], expected 233, is " << last_msg_->contents[87]; - EXPECT_EQ(last_msg_->contents[88], 23) << "incorrect value for contents[88], expected 23, is " << last_msg_->contents[88]; - EXPECT_EQ(last_msg_->contents[89], 23) << "incorrect value for contents[89], expected 23, is " << last_msg_->contents[89]; - EXPECT_EQ(last_msg_->contents[90], 73) << "incorrect value for contents[90], expected 73, is " << last_msg_->contents[90]; - EXPECT_EQ(last_msg_->contents[91], 119) << "incorrect value for contents[91], expected 119, is " << last_msg_->contents[91]; - EXPECT_EQ(last_msg_->contents[92], 136) << "incorrect value for contents[92], expected 136, is " << last_msg_->contents[92]; - EXPECT_EQ(last_msg_->contents[93], 231) << "incorrect value for contents[93], expected 231, is " << last_msg_->contents[93]; - EXPECT_EQ(last_msg_->contents[94], 189) << "incorrect value for contents[94], expected 189, is " << last_msg_->contents[94]; - EXPECT_EQ(last_msg_->contents[95], 26) << "incorrect value for contents[95], expected 26, is " << last_msg_->contents[95]; - EXPECT_EQ(last_msg_->contents[96], 174) << "incorrect value for contents[96], expected 174, is " << last_msg_->contents[96]; - EXPECT_EQ(last_msg_->contents[97], 128) << "incorrect value for contents[97], expected 128, is " << last_msg_->contents[97]; - EXPECT_EQ(last_msg_->contents[98], 93) << "incorrect value for contents[98], expected 93, is " << last_msg_->contents[98]; - EXPECT_EQ(last_msg_->contents[99], 30) << "incorrect value for contents[99], expected 30, is " << last_msg_->contents[99]; - EXPECT_EQ(last_msg_->contents[100], 76) << "incorrect value for contents[100], expected 76, is " << last_msg_->contents[100]; - EXPECT_EQ(last_msg_->contents[101], 45) << "incorrect value for contents[101], expected 45, is " << last_msg_->contents[101]; - EXPECT_EQ(last_msg_->contents[102], 109) << "incorrect value for contents[102], expected 109, is " << last_msg_->contents[102]; - EXPECT_EQ(last_msg_->contents[103], 134) << "incorrect value for contents[103], expected 134, is " << last_msg_->contents[103]; - EXPECT_EQ(last_msg_->contents[104], 81) << "incorrect value for contents[104], expected 81, is " << last_msg_->contents[104]; - EXPECT_EQ(last_msg_->contents[105], 0) << "incorrect value for contents[105], expected 0, is " << last_msg_->contents[105]; - EXPECT_EQ(last_msg_->contents[106], 116) << "incorrect value for contents[106], expected 116, is " << last_msg_->contents[106]; - EXPECT_EQ(last_msg_->contents[107], 158) << "incorrect value for contents[107], expected 158, is " << last_msg_->contents[107]; - EXPECT_EQ(last_msg_->contents[108], 127) << "incorrect value for contents[108], expected 127, is " << last_msg_->contents[108]; - EXPECT_EQ(last_msg_->contents[109], 40) << "incorrect value for contents[109], expected 40, is " << last_msg_->contents[109]; - EXPECT_EQ(last_msg_->contents[110], 133) << "incorrect value for contents[110], expected 133, is " << last_msg_->contents[110]; - EXPECT_EQ(last_msg_->contents[111], 208) << "incorrect value for contents[111], expected 208, is " << last_msg_->contents[111]; - EXPECT_EQ(last_msg_->contents[112], 134) << "incorrect value for contents[112], expected 134, is " << last_msg_->contents[112]; - EXPECT_EQ(last_msg_->contents[113], 127) << "incorrect value for contents[113], expected 127, is " << last_msg_->contents[113]; - EXPECT_EQ(last_msg_->contents[114], 140) << "incorrect value for contents[114], expected 140, is " << last_msg_->contents[114]; - EXPECT_EQ(last_msg_->contents[115], 232) << "incorrect value for contents[115], expected 232, is " << last_msg_->contents[115]; - EXPECT_EQ(last_msg_->contents[116], 183) << "incorrect value for contents[116], expected 183, is " << last_msg_->contents[116]; - EXPECT_EQ(last_msg_->contents[117], 184) << "incorrect value for contents[117], expected 184, is " << last_msg_->contents[117]; - EXPECT_EQ(last_msg_->contents[118], 108) << "incorrect value for contents[118], expected 108, is " << last_msg_->contents[118]; - EXPECT_EQ(last_msg_->contents[119], 6) << "incorrect value for contents[119], expected 6, is " << last_msg_->contents[119]; - EXPECT_EQ(last_msg_->contents[120], 228) << "incorrect value for contents[120], expected 228, is " << last_msg_->contents[120]; - EXPECT_EQ(last_msg_->contents[121], 54) << "incorrect value for contents[121], expected 54, is " << last_msg_->contents[121]; - EXPECT_EQ(last_msg_->contents[122], 238) << "incorrect value for contents[122], expected 238, is " << last_msg_->contents[122]; - EXPECT_EQ(last_msg_->contents[123], 59) << "incorrect value for contents[123], expected 59, is " << last_msg_->contents[123]; - EXPECT_EQ(last_msg_->contents[124], 220) << "incorrect value for contents[124], expected 220, is " << last_msg_->contents[124]; - EXPECT_EQ(last_msg_->contents[125], 30) << "incorrect value for contents[125], expected 30, is " << last_msg_->contents[125]; - EXPECT_EQ(last_msg_->contents[126], 228) << "incorrect value for contents[126], expected 228, is " << last_msg_->contents[126]; - EXPECT_EQ(last_msg_->contents[127], 212) << "incorrect value for contents[127], expected 212, is " << last_msg_->contents[127]; - EXPECT_EQ(last_msg_->contents[128], 50) << "incorrect value for contents[128], expected 50, is " << last_msg_->contents[128]; - EXPECT_EQ(last_msg_->contents[129], 182) << "incorrect value for contents[129], expected 182, is " << last_msg_->contents[129]; - EXPECT_EQ(last_msg_->contents[130], 97) << "incorrect value for contents[130], expected 97, is " << last_msg_->contents[130]; - EXPECT_EQ(last_msg_->contents[131], 20) << "incorrect value for contents[131], expected 20, is " << last_msg_->contents[131]; - EXPECT_EQ(last_msg_->contents[132], 41) << "incorrect value for contents[132], expected 41, is " << last_msg_->contents[132]; - EXPECT_EQ(last_msg_->contents[133], 76) << "incorrect value for contents[133], expected 76, is " << last_msg_->contents[133]; - EXPECT_EQ(last_msg_->contents[134], 227) << "incorrect value for contents[134], expected 227, is " << last_msg_->contents[134]; - EXPECT_EQ(last_msg_->contents[135], 88) << "incorrect value for contents[135], expected 88, is " << last_msg_->contents[135]; - EXPECT_EQ(last_msg_->contents[136], 12) << "incorrect value for contents[136], expected 12, is " << last_msg_->contents[136]; - EXPECT_EQ(last_msg_->contents[137], 95) << "incorrect value for contents[137], expected 95, is " << last_msg_->contents[137]; - EXPECT_EQ(last_msg_->contents[138], 112) << "incorrect value for contents[138], expected 112, is " << last_msg_->contents[138]; - EXPECT_EQ(last_msg_->contents[139], 209) << "incorrect value for contents[139], expected 209, is " << last_msg_->contents[139]; - EXPECT_EQ(last_msg_->contents[140], 183) << "incorrect value for contents[140], expected 183, is " << last_msg_->contents[140]; - EXPECT_EQ(last_msg_->contents[141], 127) << "incorrect value for contents[141], expected 127, is " << last_msg_->contents[141]; - EXPECT_EQ(last_msg_->contents[142], 4) << "incorrect value for contents[142], expected 4, is " << last_msg_->contents[142]; - EXPECT_EQ(last_msg_->contents[143], 165) << "incorrect value for contents[143], expected 165, is " << last_msg_->contents[143]; - EXPECT_EQ(last_msg_->contents[144], 189) << "incorrect value for contents[144], expected 189, is " << last_msg_->contents[144]; - EXPECT_EQ(last_msg_->contents[145], 44) << "incorrect value for contents[145], expected 44, is " << last_msg_->contents[145]; - EXPECT_EQ(last_msg_->contents[146], 239) << "incorrect value for contents[146], expected 239, is " << last_msg_->contents[146]; - EXPECT_EQ(last_msg_->contents[147], 232) << "incorrect value for contents[147], expected 232, is " << last_msg_->contents[147]; - EXPECT_EQ(last_msg_->contents[148], 132) << "incorrect value for contents[148], expected 132, is " << last_msg_->contents[148]; - EXPECT_EQ(last_msg_->contents[149], 9) << "incorrect value for contents[149], expected 9, is " << last_msg_->contents[149]; - EXPECT_EQ(last_msg_->contents[150], 114) << "incorrect value for contents[150], expected 114, is " << last_msg_->contents[150]; - EXPECT_EQ(last_msg_->contents[151], 184) << "incorrect value for contents[151], expected 184, is " << last_msg_->contents[151]; - EXPECT_EQ(last_msg_->contents[152], 249) << "incorrect value for contents[152], expected 249, is " << last_msg_->contents[152]; - EXPECT_EQ(last_msg_->contents[153], 208) << "incorrect value for contents[153], expected 208, is " << last_msg_->contents[153]; - EXPECT_EQ(last_msg_->contents[154], 246) << "incorrect value for contents[154], expected 246, is " << last_msg_->contents[154]; - EXPECT_EQ(last_msg_->contents[155], 194) << "incorrect value for contents[155], expected 194, is " << last_msg_->contents[155]; - EXPECT_EQ(last_msg_->contents[156], 250) << "incorrect value for contents[156], expected 250, is " << last_msg_->contents[156]; - EXPECT_EQ(last_msg_->contents[157], 2) << "incorrect value for contents[157], expected 2, is " << last_msg_->contents[157]; - EXPECT_EQ(last_msg_->contents[158], 97) << "incorrect value for contents[158], expected 97, is " << last_msg_->contents[158]; - EXPECT_EQ(last_msg_->contents[159], 173) << "incorrect value for contents[159], expected 173, is " << last_msg_->contents[159]; - EXPECT_EQ(last_msg_->contents[160], 157) << "incorrect value for contents[160], expected 157, is " << last_msg_->contents[160]; - EXPECT_EQ(last_msg_->contents[161], 202) << "incorrect value for contents[161], expected 202, is " << last_msg_->contents[161]; - EXPECT_EQ(last_msg_->contents[162], 172) << "incorrect value for contents[162], expected 172, is " << last_msg_->contents[162]; - EXPECT_EQ(last_msg_->contents[163], 180) << "incorrect value for contents[163], expected 180, is " << last_msg_->contents[163]; - EXPECT_EQ(last_msg_->contents[164], 150) << "incorrect value for contents[164], expected 150, is " << last_msg_->contents[164]; - EXPECT_EQ(last_msg_->contents[165], 213) << "incorrect value for contents[165], expected 213, is " << last_msg_->contents[165]; - EXPECT_EQ(last_msg_->contents[166], 193) << "incorrect value for contents[166], expected 193, is " << last_msg_->contents[166]; - EXPECT_EQ(last_msg_->contents[167], 177) << "incorrect value for contents[167], expected 177, is " << last_msg_->contents[167]; - EXPECT_EQ(last_msg_->contents[168], 209) << "incorrect value for contents[168], expected 209, is " << last_msg_->contents[168]; - EXPECT_EQ(last_msg_->contents[169], 156) << "incorrect value for contents[169], expected 156, is " << last_msg_->contents[169]; - EXPECT_EQ(last_msg_->contents[170], 20) << "incorrect value for contents[170], expected 20, is " << last_msg_->contents[170]; - EXPECT_EQ(last_msg_->contents[171], 174) << "incorrect value for contents[171], expected 174, is " << last_msg_->contents[171]; - EXPECT_EQ(last_msg_->contents[172], 18) << "incorrect value for contents[172], expected 18, is " << last_msg_->contents[172]; - EXPECT_EQ(last_msg_->contents[173], 73) << "incorrect value for contents[173], expected 73, is " << last_msg_->contents[173]; - EXPECT_EQ(last_msg_->contents[174], 132) << "incorrect value for contents[174], expected 132, is " << last_msg_->contents[174]; - EXPECT_EQ(last_msg_->contents[175], 215) << "incorrect value for contents[175], expected 215, is " << last_msg_->contents[175]; - EXPECT_EQ(last_msg_->contents[176], 115) << "incorrect value for contents[176], expected 115, is " << last_msg_->contents[176]; - EXPECT_EQ(last_msg_->contents[177], 128) << "incorrect value for contents[177], expected 128, is " << last_msg_->contents[177]; - EXPECT_EQ(last_msg_->contents[178], 175) << "incorrect value for contents[178], expected 175, is " << last_msg_->contents[178]; - EXPECT_EQ(last_msg_->contents[179], 169) << "incorrect value for contents[179], expected 169, is " << last_msg_->contents[179]; - EXPECT_EQ(last_msg_->contents[180], 116) << "incorrect value for contents[180], expected 116, is " << last_msg_->contents[180]; - EXPECT_EQ(last_msg_->contents[181], 132) << "incorrect value for contents[181], expected 132, is " << last_msg_->contents[181]; - EXPECT_EQ(last_msg_->contents[182], 100) << "incorrect value for contents[182], expected 100, is " << last_msg_->contents[182]; - EXPECT_EQ(last_msg_->contents[183], 72) << "incorrect value for contents[183], expected 72, is " << last_msg_->contents[183]; - EXPECT_EQ(last_msg_->contents[184], 45) << "incorrect value for contents[184], expected 45, is " << last_msg_->contents[184]; - EXPECT_EQ(last_msg_->contents[185], 25) << "incorrect value for contents[185], expected 25, is " << last_msg_->contents[185]; - EXPECT_EQ(last_msg_->contents[186], 14) << "incorrect value for contents[186], expected 14, is " << last_msg_->contents[186]; - EXPECT_EQ(last_msg_->contents[187], 205) << "incorrect value for contents[187], expected 205, is " << last_msg_->contents[187]; - EXPECT_EQ(last_msg_->contents[188], 213) << "incorrect value for contents[188], expected 213, is " << last_msg_->contents[188]; - EXPECT_EQ(last_msg_->contents[189], 145) << "incorrect value for contents[189], expected 145, is " << last_msg_->contents[189]; - EXPECT_EQ(last_msg_->contents[190], 68) << "incorrect value for contents[190], expected 68, is " << last_msg_->contents[190]; - EXPECT_EQ(last_msg_->contents[191], 137) << "incorrect value for contents[191], expected 137, is " << last_msg_->contents[191]; - EXPECT_EQ(last_msg_->contents[192], 249) << "incorrect value for contents[192], expected 249, is " << last_msg_->contents[192]; - EXPECT_EQ(last_msg_->contents[193], 54) << "incorrect value for contents[193], expected 54, is " << last_msg_->contents[193]; - EXPECT_EQ(last_msg_->contents[194], 40) << "incorrect value for contents[194], expected 40, is " << last_msg_->contents[194]; - EXPECT_EQ(last_msg_->contents[195], 174) << "incorrect value for contents[195], expected 174, is " << last_msg_->contents[195]; - EXPECT_EQ(last_msg_->contents[196], 215) << "incorrect value for contents[196], expected 215, is " << last_msg_->contents[196]; - EXPECT_EQ(last_msg_->contents[197], 148) << "incorrect value for contents[197], expected 148, is " << last_msg_->contents[197]; - EXPECT_EQ(last_msg_->contents[198], 166) << "incorrect value for contents[198], expected 166, is " << last_msg_->contents[198]; - EXPECT_EQ(last_msg_->contents[199], 190) << "incorrect value for contents[199], expected 190, is " << last_msg_->contents[199]; - EXPECT_EQ(last_msg_->contents[200], 63) << "incorrect value for contents[200], expected 63, is " << last_msg_->contents[200]; - EXPECT_EQ(last_msg_->contents[201], 118) << "incorrect value for contents[201], expected 118, is " << last_msg_->contents[201]; - EXPECT_EQ(last_msg_->contents[202], 6) << "incorrect value for contents[202], expected 6, is " << last_msg_->contents[202]; - EXPECT_EQ(last_msg_->contents[203], 165) << "incorrect value for contents[203], expected 165, is " << last_msg_->contents[203]; - EXPECT_EQ(last_msg_->contents[204], 212) << "incorrect value for contents[204], expected 212, is " << last_msg_->contents[204]; - EXPECT_EQ(last_msg_->contents[205], 74) << "incorrect value for contents[205], expected 74, is " << last_msg_->contents[205]; - EXPECT_EQ(last_msg_->contents[206], 68) << "incorrect value for contents[206], expected 68, is " << last_msg_->contents[206]; - EXPECT_EQ(last_msg_->contents[207], 200) << "incorrect value for contents[207], expected 200, is " << last_msg_->contents[207]; - EXPECT_EQ(last_msg_->contents[208], 38) << "incorrect value for contents[208], expected 38, is " << last_msg_->contents[208]; - EXPECT_EQ(last_msg_->contents[209], 139) << "incorrect value for contents[209], expected 139, is " << last_msg_->contents[209]; - EXPECT_EQ(last_msg_->contents[210], 212) << "incorrect value for contents[210], expected 212, is " << last_msg_->contents[210]; - EXPECT_EQ(last_msg_->contents[211], 112) << "incorrect value for contents[211], expected 112, is " << last_msg_->contents[211]; - EXPECT_EQ(last_msg_->contents[212], 45) << "incorrect value for contents[212], expected 45, is " << last_msg_->contents[212]; - EXPECT_EQ(last_msg_->contents[213], 167) << "incorrect value for contents[213], expected 167, is " << last_msg_->contents[213]; - EXPECT_EQ(last_msg_->contents[214], 236) << "incorrect value for contents[214], expected 236, is " << last_msg_->contents[214]; - EXPECT_EQ(last_msg_->contents[215], 255) << "incorrect value for contents[215], expected 255, is " << last_msg_->contents[215]; - EXPECT_EQ(last_msg_->contents[216], 106) << "incorrect value for contents[216], expected 106, is " << last_msg_->contents[216]; - EXPECT_EQ(last_msg_->contents[217], 92) << "incorrect value for contents[217], expected 92, is " << last_msg_->contents[217]; - EXPECT_EQ(last_msg_->contents[218], 132) << "incorrect value for contents[218], expected 132, is " << last_msg_->contents[218]; - EXPECT_EQ(last_msg_->contents[219], 59) << "incorrect value for contents[219], expected 59, is " << last_msg_->contents[219]; - EXPECT_EQ(last_msg_->contents[220], 61) << "incorrect value for contents[220], expected 61, is " << last_msg_->contents[220]; - EXPECT_EQ(last_msg_->contents[221], 233) << "incorrect value for contents[221], expected 233, is " << last_msg_->contents[221]; - EXPECT_EQ(last_msg_->contents[222], 3) << "incorrect value for contents[222], expected 3, is " << last_msg_->contents[222]; - EXPECT_EQ(last_msg_->contents[223], 246) << "incorrect value for contents[223], expected 246, is " << last_msg_->contents[223]; - EXPECT_EQ(last_msg_->contents[224], 158) << "incorrect value for contents[224], expected 158, is " << last_msg_->contents[224]; - EXPECT_EQ(last_msg_->contents[225], 83) << "incorrect value for contents[225], expected 83, is " << last_msg_->contents[225]; - EXPECT_EQ(last_msg_->contents[226], 134) << "incorrect value for contents[226], expected 134, is " << last_msg_->contents[226]; - EXPECT_EQ(last_msg_->contents[227], 246) << "incorrect value for contents[227], expected 246, is " << last_msg_->contents[227]; - EXPECT_EQ(last_msg_->contents[228], 154) << "incorrect value for contents[228], expected 154, is " << last_msg_->contents[228]; - EXPECT_EQ(last_msg_->contents[229], 17) << "incorrect value for contents[229], expected 17, is " << last_msg_->contents[229]; - EXPECT_EQ(last_msg_->contents[230], 0) << "incorrect value for contents[230], expected 0, is " << last_msg_->contents[230]; - EXPECT_EQ(last_msg_->contents[231], 6) << "incorrect value for contents[231], expected 6, is " << last_msg_->contents[231]; - EXPECT_EQ(last_msg_->contents[232], 56) << "incorrect value for contents[232], expected 56, is " << last_msg_->contents[232]; - EXPECT_EQ(last_msg_->contents[233], 216) << "incorrect value for contents[233], expected 216, is " << last_msg_->contents[233]; - EXPECT_EQ(last_msg_->contents[234], 19) << "incorrect value for contents[234], expected 19, is " << last_msg_->contents[234]; - EXPECT_EQ(last_msg_->contents[235], 216) << "incorrect value for contents[235], expected 216, is " << last_msg_->contents[235]; - EXPECT_EQ(last_msg_->contents[236], 70) << "incorrect value for contents[236], expected 70, is " << last_msg_->contents[236]; - EXPECT_EQ(last_msg_->contents[237], 71) << "incorrect value for contents[237], expected 71, is " << last_msg_->contents[237]; - EXPECT_EQ(last_msg_->contents[238], 161) << "incorrect value for contents[238], expected 161, is " << last_msg_->contents[238]; - EXPECT_EQ(last_msg_->contents[239], 184) << "incorrect value for contents[239], expected 184, is " << last_msg_->contents[239]; - EXPECT_EQ(last_msg_->contents[240], 5) << "incorrect value for contents[240], expected 5, is " << last_msg_->contents[240]; - EXPECT_EQ(last_msg_->contents[241], 177) << "incorrect value for contents[241], expected 177, is " << last_msg_->contents[241]; - EXPECT_EQ(last_msg_->contents[242], 45) << "incorrect value for contents[242], expected 45, is " << last_msg_->contents[242]; - EXPECT_EQ(last_msg_->contents[243], 37) << "incorrect value for contents[243], expected 37, is " << last_msg_->contents[243]; - EXPECT_EQ(last_msg_->contents[244], 98) << "incorrect value for contents[244], expected 98, is " << last_msg_->contents[244]; - EXPECT_EQ(last_msg_->contents[245], 56) << "incorrect value for contents[245], expected 56, is " << last_msg_->contents[245]; - EXPECT_EQ(last_msg_->contents[246], 149) << "incorrect value for contents[246], expected 149, is " << last_msg_->contents[246]; - EXPECT_EQ(last_msg_->contents[247], 0) << "incorrect value for contents[247], expected 0, is " << last_msg_->contents[247]; - EXPECT_EQ(last_msg_->contents[248], 73) << "incorrect value for contents[248], expected 73, is " << last_msg_->contents[248]; - EXPECT_EQ(last_msg_->contents[249], 221) << "incorrect value for contents[249], expected 221, is " << last_msg_->contents[249]; - EXPECT_EQ(last_msg_->contents[250], 105) << "incorrect value for contents[250], expected 105, is " << last_msg_->contents[250]; - EXPECT_EQ(last_msg_->contents[251], 239) << "incorrect value for contents[251], expected 239, is " << last_msg_->contents[251]; - EXPECT_EQ(last_msg_->contents[252], 168) << "incorrect value for contents[252], expected 168, is " << last_msg_->contents[252]; - EXPECT_EQ(last_msg_->contents[253], 205) << "incorrect value for contents[253], expected 205, is " << last_msg_->contents[253]; - EXPECT_EQ(last_msg_->contents[254], 85) << "incorrect value for contents[254], expected 85, is " << last_msg_->contents[254]; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 8574); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->contents[0], 53) + << "incorrect value for contents[0], expected 53, is " + << last_msg_->contents[0]; + EXPECT_EQ(last_msg_->contents[1], 5) + << "incorrect value for contents[1], expected 5, is " + << last_msg_->contents[1]; + EXPECT_EQ(last_msg_->contents[2], 172) + << "incorrect value for contents[2], expected 172, is " + << last_msg_->contents[2]; + EXPECT_EQ(last_msg_->contents[3], 138) + << "incorrect value for contents[3], expected 138, is " + << last_msg_->contents[3]; + EXPECT_EQ(last_msg_->contents[4], 50) + << "incorrect value for contents[4], expected 50, is " + << last_msg_->contents[4]; + EXPECT_EQ(last_msg_->contents[5], 49) + << "incorrect value for contents[5], expected 49, is " + << last_msg_->contents[5]; + EXPECT_EQ(last_msg_->contents[6], 206) + << "incorrect value for contents[6], expected 206, is " + << last_msg_->contents[6]; + EXPECT_EQ(last_msg_->contents[7], 234) + << "incorrect value for contents[7], expected 234, is " + << last_msg_->contents[7]; + EXPECT_EQ(last_msg_->contents[8], 149) + << "incorrect value for contents[8], expected 149, is " + << last_msg_->contents[8]; + EXPECT_EQ(last_msg_->contents[9], 204) + << "incorrect value for contents[9], expected 204, is " + << last_msg_->contents[9]; + EXPECT_EQ(last_msg_->contents[10], 113) + << "incorrect value for contents[10], expected 113, is " + << last_msg_->contents[10]; + EXPECT_EQ(last_msg_->contents[11], 31) + << "incorrect value for contents[11], expected 31, is " + << last_msg_->contents[11]; + EXPECT_EQ(last_msg_->contents[12], 108) + << "incorrect value for contents[12], expected 108, is " + << last_msg_->contents[12]; + EXPECT_EQ(last_msg_->contents[13], 188) + << "incorrect value for contents[13], expected 188, is " + << last_msg_->contents[13]; + EXPECT_EQ(last_msg_->contents[14], 179) + << "incorrect value for contents[14], expected 179, is " + << last_msg_->contents[14]; + EXPECT_EQ(last_msg_->contents[15], 154) + << "incorrect value for contents[15], expected 154, is " + << last_msg_->contents[15]; + EXPECT_EQ(last_msg_->contents[16], 156) + << "incorrect value for contents[16], expected 156, is " + << last_msg_->contents[16]; + EXPECT_EQ(last_msg_->contents[17], 167) + << "incorrect value for contents[17], expected 167, is " + << last_msg_->contents[17]; + EXPECT_EQ(last_msg_->contents[18], 145) + << "incorrect value for contents[18], expected 145, is " + << last_msg_->contents[18]; + EXPECT_EQ(last_msg_->contents[19], 139) + << "incorrect value for contents[19], expected 139, is " + << last_msg_->contents[19]; + EXPECT_EQ(last_msg_->contents[20], 42) + << "incorrect value for contents[20], expected 42, is " + << last_msg_->contents[20]; + EXPECT_EQ(last_msg_->contents[21], 207) + << "incorrect value for contents[21], expected 207, is " + << last_msg_->contents[21]; + EXPECT_EQ(last_msg_->contents[22], 126) + << "incorrect value for contents[22], expected 126, is " + << last_msg_->contents[22]; + EXPECT_EQ(last_msg_->contents[23], 242) + << "incorrect value for contents[23], expected 242, is " + << last_msg_->contents[23]; + EXPECT_EQ(last_msg_->contents[24], 193) + << "incorrect value for contents[24], expected 193, is " + << last_msg_->contents[24]; + EXPECT_EQ(last_msg_->contents[25], 9) + << "incorrect value for contents[25], expected 9, is " + << last_msg_->contents[25]; + EXPECT_EQ(last_msg_->contents[26], 58) + << "incorrect value for contents[26], expected 58, is " + << last_msg_->contents[26]; + EXPECT_EQ(last_msg_->contents[27], 75) + << "incorrect value for contents[27], expected 75, is " + << last_msg_->contents[27]; + EXPECT_EQ(last_msg_->contents[28], 8) + << "incorrect value for contents[28], expected 8, is " + << last_msg_->contents[28]; + EXPECT_EQ(last_msg_->contents[29], 135) + << "incorrect value for contents[29], expected 135, is " + << last_msg_->contents[29]; + EXPECT_EQ(last_msg_->contents[30], 11) + << "incorrect value for contents[30], expected 11, is " + << last_msg_->contents[30]; + EXPECT_EQ(last_msg_->contents[31], 92) + << "incorrect value for contents[31], expected 92, is " + << last_msg_->contents[31]; + EXPECT_EQ(last_msg_->contents[32], 131) + << "incorrect value for contents[32], expected 131, is " + << last_msg_->contents[32]; + EXPECT_EQ(last_msg_->contents[33], 245) + << "incorrect value for contents[33], expected 245, is " + << last_msg_->contents[33]; + EXPECT_EQ(last_msg_->contents[34], 24) + << "incorrect value for contents[34], expected 24, is " + << last_msg_->contents[34]; + EXPECT_EQ(last_msg_->contents[35], 90) + << "incorrect value for contents[35], expected 90, is " + << last_msg_->contents[35]; + EXPECT_EQ(last_msg_->contents[36], 255) + << "incorrect value for contents[36], expected 255, is " + << last_msg_->contents[36]; + EXPECT_EQ(last_msg_->contents[37], 30) + << "incorrect value for contents[37], expected 30, is " + << last_msg_->contents[37]; + EXPECT_EQ(last_msg_->contents[38], 58) + << "incorrect value for contents[38], expected 58, is " + << last_msg_->contents[38]; + EXPECT_EQ(last_msg_->contents[39], 31) + << "incorrect value for contents[39], expected 31, is " + << last_msg_->contents[39]; + EXPECT_EQ(last_msg_->contents[40], 109) + << "incorrect value for contents[40], expected 109, is " + << last_msg_->contents[40]; + EXPECT_EQ(last_msg_->contents[41], 148) + << "incorrect value for contents[41], expected 148, is " + << last_msg_->contents[41]; + EXPECT_EQ(last_msg_->contents[42], 56) + << "incorrect value for contents[42], expected 56, is " + << last_msg_->contents[42]; + EXPECT_EQ(last_msg_->contents[43], 178) + << "incorrect value for contents[43], expected 178, is " + << last_msg_->contents[43]; + EXPECT_EQ(last_msg_->contents[44], 140) + << "incorrect value for contents[44], expected 140, is " + << last_msg_->contents[44]; + EXPECT_EQ(last_msg_->contents[45], 30) + << "incorrect value for contents[45], expected 30, is " + << last_msg_->contents[45]; + EXPECT_EQ(last_msg_->contents[46], 159) + << "incorrect value for contents[46], expected 159, is " + << last_msg_->contents[46]; + EXPECT_EQ(last_msg_->contents[47], 70) + << "incorrect value for contents[47], expected 70, is " + << last_msg_->contents[47]; + EXPECT_EQ(last_msg_->contents[48], 17) + << "incorrect value for contents[48], expected 17, is " + << last_msg_->contents[48]; + EXPECT_EQ(last_msg_->contents[49], 170) + << "incorrect value for contents[49], expected 170, is " + << last_msg_->contents[49]; + EXPECT_EQ(last_msg_->contents[50], 50) + << "incorrect value for contents[50], expected 50, is " + << last_msg_->contents[50]; + EXPECT_EQ(last_msg_->contents[51], 148) + << "incorrect value for contents[51], expected 148, is " + << last_msg_->contents[51]; + EXPECT_EQ(last_msg_->contents[52], 1) + << "incorrect value for contents[52], expected 1, is " + << last_msg_->contents[52]; + EXPECT_EQ(last_msg_->contents[53], 99) + << "incorrect value for contents[53], expected 99, is " + << last_msg_->contents[53]; + EXPECT_EQ(last_msg_->contents[54], 112) + << "incorrect value for contents[54], expected 112, is " + << last_msg_->contents[54]; + EXPECT_EQ(last_msg_->contents[55], 88) + << "incorrect value for contents[55], expected 88, is " + << last_msg_->contents[55]; + EXPECT_EQ(last_msg_->contents[56], 217) + << "incorrect value for contents[56], expected 217, is " + << last_msg_->contents[56]; + EXPECT_EQ(last_msg_->contents[57], 36) + << "incorrect value for contents[57], expected 36, is " + << last_msg_->contents[57]; + EXPECT_EQ(last_msg_->contents[58], 84) + << "incorrect value for contents[58], expected 84, is " + << last_msg_->contents[58]; + EXPECT_EQ(last_msg_->contents[59], 34) + << "incorrect value for contents[59], expected 34, is " + << last_msg_->contents[59]; + EXPECT_EQ(last_msg_->contents[60], 234) + << "incorrect value for contents[60], expected 234, is " + << last_msg_->contents[60]; + EXPECT_EQ(last_msg_->contents[61], 82) + << "incorrect value for contents[61], expected 82, is " + << last_msg_->contents[61]; + EXPECT_EQ(last_msg_->contents[62], 144) + << "incorrect value for contents[62], expected 144, is " + << last_msg_->contents[62]; + EXPECT_EQ(last_msg_->contents[63], 144) + << "incorrect value for contents[63], expected 144, is " + << last_msg_->contents[63]; + EXPECT_EQ(last_msg_->contents[64], 97) + << "incorrect value for contents[64], expected 97, is " + << last_msg_->contents[64]; + EXPECT_EQ(last_msg_->contents[65], 96) + << "incorrect value for contents[65], expected 96, is " + << last_msg_->contents[65]; + EXPECT_EQ(last_msg_->contents[66], 75) + << "incorrect value for contents[66], expected 75, is " + << last_msg_->contents[66]; + EXPECT_EQ(last_msg_->contents[67], 174) + << "incorrect value for contents[67], expected 174, is " + << last_msg_->contents[67]; + EXPECT_EQ(last_msg_->contents[68], 58) + << "incorrect value for contents[68], expected 58, is " + << last_msg_->contents[68]; + EXPECT_EQ(last_msg_->contents[69], 219) + << "incorrect value for contents[69], expected 219, is " + << last_msg_->contents[69]; + EXPECT_EQ(last_msg_->contents[70], 180) + << "incorrect value for contents[70], expected 180, is " + << last_msg_->contents[70]; + EXPECT_EQ(last_msg_->contents[71], 148) + << "incorrect value for contents[71], expected 148, is " + << last_msg_->contents[71]; + EXPECT_EQ(last_msg_->contents[72], 247) + << "incorrect value for contents[72], expected 247, is " + << last_msg_->contents[72]; + EXPECT_EQ(last_msg_->contents[73], 59) + << "incorrect value for contents[73], expected 59, is " + << last_msg_->contents[73]; + EXPECT_EQ(last_msg_->contents[74], 2) + << "incorrect value for contents[74], expected 2, is " + << last_msg_->contents[74]; + EXPECT_EQ(last_msg_->contents[75], 116) + << "incorrect value for contents[75], expected 116, is " + << last_msg_->contents[75]; + EXPECT_EQ(last_msg_->contents[76], 214) + << "incorrect value for contents[76], expected 214, is " + << last_msg_->contents[76]; + EXPECT_EQ(last_msg_->contents[77], 114) + << "incorrect value for contents[77], expected 114, is " + << last_msg_->contents[77]; + EXPECT_EQ(last_msg_->contents[78], 55) + << "incorrect value for contents[78], expected 55, is " + << last_msg_->contents[78]; + EXPECT_EQ(last_msg_->contents[79], 134) + << "incorrect value for contents[79], expected 134, is " + << last_msg_->contents[79]; + EXPECT_EQ(last_msg_->contents[80], 54) + << "incorrect value for contents[80], expected 54, is " + << last_msg_->contents[80]; + EXPECT_EQ(last_msg_->contents[81], 119) + << "incorrect value for contents[81], expected 119, is " + << last_msg_->contents[81]; + EXPECT_EQ(last_msg_->contents[82], 108) + << "incorrect value for contents[82], expected 108, is " + << last_msg_->contents[82]; + EXPECT_EQ(last_msg_->contents[83], 128) + << "incorrect value for contents[83], expected 128, is " + << last_msg_->contents[83]; + EXPECT_EQ(last_msg_->contents[84], 73) + << "incorrect value for contents[84], expected 73, is " + << last_msg_->contents[84]; + EXPECT_EQ(last_msg_->contents[85], 181) + << "incorrect value for contents[85], expected 181, is " + << last_msg_->contents[85]; + EXPECT_EQ(last_msg_->contents[86], 20) + << "incorrect value for contents[86], expected 20, is " + << last_msg_->contents[86]; + EXPECT_EQ(last_msg_->contents[87], 233) + << "incorrect value for contents[87], expected 233, is " + << last_msg_->contents[87]; + EXPECT_EQ(last_msg_->contents[88], 23) + << "incorrect value for contents[88], expected 23, is " + << last_msg_->contents[88]; + EXPECT_EQ(last_msg_->contents[89], 23) + << "incorrect value for contents[89], expected 23, is " + << last_msg_->contents[89]; + EXPECT_EQ(last_msg_->contents[90], 73) + << "incorrect value for contents[90], expected 73, is " + << last_msg_->contents[90]; + EXPECT_EQ(last_msg_->contents[91], 119) + << "incorrect value for contents[91], expected 119, is " + << last_msg_->contents[91]; + EXPECT_EQ(last_msg_->contents[92], 136) + << "incorrect value for contents[92], expected 136, is " + << last_msg_->contents[92]; + EXPECT_EQ(last_msg_->contents[93], 231) + << "incorrect value for contents[93], expected 231, is " + << last_msg_->contents[93]; + EXPECT_EQ(last_msg_->contents[94], 189) + << "incorrect value for contents[94], expected 189, is " + << last_msg_->contents[94]; + EXPECT_EQ(last_msg_->contents[95], 26) + << "incorrect value for contents[95], expected 26, is " + << last_msg_->contents[95]; + EXPECT_EQ(last_msg_->contents[96], 174) + << "incorrect value for contents[96], expected 174, is " + << last_msg_->contents[96]; + EXPECT_EQ(last_msg_->contents[97], 128) + << "incorrect value for contents[97], expected 128, is " + << last_msg_->contents[97]; + EXPECT_EQ(last_msg_->contents[98], 93) + << "incorrect value for contents[98], expected 93, is " + << last_msg_->contents[98]; + EXPECT_EQ(last_msg_->contents[99], 30) + << "incorrect value for contents[99], expected 30, is " + << last_msg_->contents[99]; + EXPECT_EQ(last_msg_->contents[100], 76) + << "incorrect value for contents[100], expected 76, is " + << last_msg_->contents[100]; + EXPECT_EQ(last_msg_->contents[101], 45) + << "incorrect value for contents[101], expected 45, is " + << last_msg_->contents[101]; + EXPECT_EQ(last_msg_->contents[102], 109) + << "incorrect value for contents[102], expected 109, is " + << last_msg_->contents[102]; + EXPECT_EQ(last_msg_->contents[103], 134) + << "incorrect value for contents[103], expected 134, is " + << last_msg_->contents[103]; + EXPECT_EQ(last_msg_->contents[104], 81) + << "incorrect value for contents[104], expected 81, is " + << last_msg_->contents[104]; + EXPECT_EQ(last_msg_->contents[105], 0) + << "incorrect value for contents[105], expected 0, is " + << last_msg_->contents[105]; + EXPECT_EQ(last_msg_->contents[106], 116) + << "incorrect value for contents[106], expected 116, is " + << last_msg_->contents[106]; + EXPECT_EQ(last_msg_->contents[107], 158) + << "incorrect value for contents[107], expected 158, is " + << last_msg_->contents[107]; + EXPECT_EQ(last_msg_->contents[108], 127) + << "incorrect value for contents[108], expected 127, is " + << last_msg_->contents[108]; + EXPECT_EQ(last_msg_->contents[109], 40) + << "incorrect value for contents[109], expected 40, is " + << last_msg_->contents[109]; + EXPECT_EQ(last_msg_->contents[110], 133) + << "incorrect value for contents[110], expected 133, is " + << last_msg_->contents[110]; + EXPECT_EQ(last_msg_->contents[111], 208) + << "incorrect value for contents[111], expected 208, is " + << last_msg_->contents[111]; + EXPECT_EQ(last_msg_->contents[112], 134) + << "incorrect value for contents[112], expected 134, is " + << last_msg_->contents[112]; + EXPECT_EQ(last_msg_->contents[113], 127) + << "incorrect value for contents[113], expected 127, is " + << last_msg_->contents[113]; + EXPECT_EQ(last_msg_->contents[114], 140) + << "incorrect value for contents[114], expected 140, is " + << last_msg_->contents[114]; + EXPECT_EQ(last_msg_->contents[115], 232) + << "incorrect value for contents[115], expected 232, is " + << last_msg_->contents[115]; + EXPECT_EQ(last_msg_->contents[116], 183) + << "incorrect value for contents[116], expected 183, is " + << last_msg_->contents[116]; + EXPECT_EQ(last_msg_->contents[117], 184) + << "incorrect value for contents[117], expected 184, is " + << last_msg_->contents[117]; + EXPECT_EQ(last_msg_->contents[118], 108) + << "incorrect value for contents[118], expected 108, is " + << last_msg_->contents[118]; + EXPECT_EQ(last_msg_->contents[119], 6) + << "incorrect value for contents[119], expected 6, is " + << last_msg_->contents[119]; + EXPECT_EQ(last_msg_->contents[120], 228) + << "incorrect value for contents[120], expected 228, is " + << last_msg_->contents[120]; + EXPECT_EQ(last_msg_->contents[121], 54) + << "incorrect value for contents[121], expected 54, is " + << last_msg_->contents[121]; + EXPECT_EQ(last_msg_->contents[122], 238) + << "incorrect value for contents[122], expected 238, is " + << last_msg_->contents[122]; + EXPECT_EQ(last_msg_->contents[123], 59) + << "incorrect value for contents[123], expected 59, is " + << last_msg_->contents[123]; + EXPECT_EQ(last_msg_->contents[124], 220) + << "incorrect value for contents[124], expected 220, is " + << last_msg_->contents[124]; + EXPECT_EQ(last_msg_->contents[125], 30) + << "incorrect value for contents[125], expected 30, is " + << last_msg_->contents[125]; + EXPECT_EQ(last_msg_->contents[126], 228) + << "incorrect value for contents[126], expected 228, is " + << last_msg_->contents[126]; + EXPECT_EQ(last_msg_->contents[127], 212) + << "incorrect value for contents[127], expected 212, is " + << last_msg_->contents[127]; + EXPECT_EQ(last_msg_->contents[128], 50) + << "incorrect value for contents[128], expected 50, is " + << last_msg_->contents[128]; + EXPECT_EQ(last_msg_->contents[129], 182) + << "incorrect value for contents[129], expected 182, is " + << last_msg_->contents[129]; + EXPECT_EQ(last_msg_->contents[130], 97) + << "incorrect value for contents[130], expected 97, is " + << last_msg_->contents[130]; + EXPECT_EQ(last_msg_->contents[131], 20) + << "incorrect value for contents[131], expected 20, is " + << last_msg_->contents[131]; + EXPECT_EQ(last_msg_->contents[132], 41) + << "incorrect value for contents[132], expected 41, is " + << last_msg_->contents[132]; + EXPECT_EQ(last_msg_->contents[133], 76) + << "incorrect value for contents[133], expected 76, is " + << last_msg_->contents[133]; + EXPECT_EQ(last_msg_->contents[134], 227) + << "incorrect value for contents[134], expected 227, is " + << last_msg_->contents[134]; + EXPECT_EQ(last_msg_->contents[135], 88) + << "incorrect value for contents[135], expected 88, is " + << last_msg_->contents[135]; + EXPECT_EQ(last_msg_->contents[136], 12) + << "incorrect value for contents[136], expected 12, is " + << last_msg_->contents[136]; + EXPECT_EQ(last_msg_->contents[137], 95) + << "incorrect value for contents[137], expected 95, is " + << last_msg_->contents[137]; + EXPECT_EQ(last_msg_->contents[138], 112) + << "incorrect value for contents[138], expected 112, is " + << last_msg_->contents[138]; + EXPECT_EQ(last_msg_->contents[139], 209) + << "incorrect value for contents[139], expected 209, is " + << last_msg_->contents[139]; + EXPECT_EQ(last_msg_->contents[140], 183) + << "incorrect value for contents[140], expected 183, is " + << last_msg_->contents[140]; + EXPECT_EQ(last_msg_->contents[141], 127) + << "incorrect value for contents[141], expected 127, is " + << last_msg_->contents[141]; + EXPECT_EQ(last_msg_->contents[142], 4) + << "incorrect value for contents[142], expected 4, is " + << last_msg_->contents[142]; + EXPECT_EQ(last_msg_->contents[143], 165) + << "incorrect value for contents[143], expected 165, is " + << last_msg_->contents[143]; + EXPECT_EQ(last_msg_->contents[144], 189) + << "incorrect value for contents[144], expected 189, is " + << last_msg_->contents[144]; + EXPECT_EQ(last_msg_->contents[145], 44) + << "incorrect value for contents[145], expected 44, is " + << last_msg_->contents[145]; + EXPECT_EQ(last_msg_->contents[146], 239) + << "incorrect value for contents[146], expected 239, is " + << last_msg_->contents[146]; + EXPECT_EQ(last_msg_->contents[147], 232) + << "incorrect value for contents[147], expected 232, is " + << last_msg_->contents[147]; + EXPECT_EQ(last_msg_->contents[148], 132) + << "incorrect value for contents[148], expected 132, is " + << last_msg_->contents[148]; + EXPECT_EQ(last_msg_->contents[149], 9) + << "incorrect value for contents[149], expected 9, is " + << last_msg_->contents[149]; + EXPECT_EQ(last_msg_->contents[150], 114) + << "incorrect value for contents[150], expected 114, is " + << last_msg_->contents[150]; + EXPECT_EQ(last_msg_->contents[151], 184) + << "incorrect value for contents[151], expected 184, is " + << last_msg_->contents[151]; + EXPECT_EQ(last_msg_->contents[152], 249) + << "incorrect value for contents[152], expected 249, is " + << last_msg_->contents[152]; + EXPECT_EQ(last_msg_->contents[153], 208) + << "incorrect value for contents[153], expected 208, is " + << last_msg_->contents[153]; + EXPECT_EQ(last_msg_->contents[154], 246) + << "incorrect value for contents[154], expected 246, is " + << last_msg_->contents[154]; + EXPECT_EQ(last_msg_->contents[155], 194) + << "incorrect value for contents[155], expected 194, is " + << last_msg_->contents[155]; + EXPECT_EQ(last_msg_->contents[156], 250) + << "incorrect value for contents[156], expected 250, is " + << last_msg_->contents[156]; + EXPECT_EQ(last_msg_->contents[157], 2) + << "incorrect value for contents[157], expected 2, is " + << last_msg_->contents[157]; + EXPECT_EQ(last_msg_->contents[158], 97) + << "incorrect value for contents[158], expected 97, is " + << last_msg_->contents[158]; + EXPECT_EQ(last_msg_->contents[159], 173) + << "incorrect value for contents[159], expected 173, is " + << last_msg_->contents[159]; + EXPECT_EQ(last_msg_->contents[160], 157) + << "incorrect value for contents[160], expected 157, is " + << last_msg_->contents[160]; + EXPECT_EQ(last_msg_->contents[161], 202) + << "incorrect value for contents[161], expected 202, is " + << last_msg_->contents[161]; + EXPECT_EQ(last_msg_->contents[162], 172) + << "incorrect value for contents[162], expected 172, is " + << last_msg_->contents[162]; + EXPECT_EQ(last_msg_->contents[163], 180) + << "incorrect value for contents[163], expected 180, is " + << last_msg_->contents[163]; + EXPECT_EQ(last_msg_->contents[164], 150) + << "incorrect value for contents[164], expected 150, is " + << last_msg_->contents[164]; + EXPECT_EQ(last_msg_->contents[165], 213) + << "incorrect value for contents[165], expected 213, is " + << last_msg_->contents[165]; + EXPECT_EQ(last_msg_->contents[166], 193) + << "incorrect value for contents[166], expected 193, is " + << last_msg_->contents[166]; + EXPECT_EQ(last_msg_->contents[167], 177) + << "incorrect value for contents[167], expected 177, is " + << last_msg_->contents[167]; + EXPECT_EQ(last_msg_->contents[168], 209) + << "incorrect value for contents[168], expected 209, is " + << last_msg_->contents[168]; + EXPECT_EQ(last_msg_->contents[169], 156) + << "incorrect value for contents[169], expected 156, is " + << last_msg_->contents[169]; + EXPECT_EQ(last_msg_->contents[170], 20) + << "incorrect value for contents[170], expected 20, is " + << last_msg_->contents[170]; + EXPECT_EQ(last_msg_->contents[171], 174) + << "incorrect value for contents[171], expected 174, is " + << last_msg_->contents[171]; + EXPECT_EQ(last_msg_->contents[172], 18) + << "incorrect value for contents[172], expected 18, is " + << last_msg_->contents[172]; + EXPECT_EQ(last_msg_->contents[173], 73) + << "incorrect value for contents[173], expected 73, is " + << last_msg_->contents[173]; + EXPECT_EQ(last_msg_->contents[174], 132) + << "incorrect value for contents[174], expected 132, is " + << last_msg_->contents[174]; + EXPECT_EQ(last_msg_->contents[175], 215) + << "incorrect value for contents[175], expected 215, is " + << last_msg_->contents[175]; + EXPECT_EQ(last_msg_->contents[176], 115) + << "incorrect value for contents[176], expected 115, is " + << last_msg_->contents[176]; + EXPECT_EQ(last_msg_->contents[177], 128) + << "incorrect value for contents[177], expected 128, is " + << last_msg_->contents[177]; + EXPECT_EQ(last_msg_->contents[178], 175) + << "incorrect value for contents[178], expected 175, is " + << last_msg_->contents[178]; + EXPECT_EQ(last_msg_->contents[179], 169) + << "incorrect value for contents[179], expected 169, is " + << last_msg_->contents[179]; + EXPECT_EQ(last_msg_->contents[180], 116) + << "incorrect value for contents[180], expected 116, is " + << last_msg_->contents[180]; + EXPECT_EQ(last_msg_->contents[181], 132) + << "incorrect value for contents[181], expected 132, is " + << last_msg_->contents[181]; + EXPECT_EQ(last_msg_->contents[182], 100) + << "incorrect value for contents[182], expected 100, is " + << last_msg_->contents[182]; + EXPECT_EQ(last_msg_->contents[183], 72) + << "incorrect value for contents[183], expected 72, is " + << last_msg_->contents[183]; + EXPECT_EQ(last_msg_->contents[184], 45) + << "incorrect value for contents[184], expected 45, is " + << last_msg_->contents[184]; + EXPECT_EQ(last_msg_->contents[185], 25) + << "incorrect value for contents[185], expected 25, is " + << last_msg_->contents[185]; + EXPECT_EQ(last_msg_->contents[186], 14) + << "incorrect value for contents[186], expected 14, is " + << last_msg_->contents[186]; + EXPECT_EQ(last_msg_->contents[187], 205) + << "incorrect value for contents[187], expected 205, is " + << last_msg_->contents[187]; + EXPECT_EQ(last_msg_->contents[188], 213) + << "incorrect value for contents[188], expected 213, is " + << last_msg_->contents[188]; + EXPECT_EQ(last_msg_->contents[189], 145) + << "incorrect value for contents[189], expected 145, is " + << last_msg_->contents[189]; + EXPECT_EQ(last_msg_->contents[190], 68) + << "incorrect value for contents[190], expected 68, is " + << last_msg_->contents[190]; + EXPECT_EQ(last_msg_->contents[191], 137) + << "incorrect value for contents[191], expected 137, is " + << last_msg_->contents[191]; + EXPECT_EQ(last_msg_->contents[192], 249) + << "incorrect value for contents[192], expected 249, is " + << last_msg_->contents[192]; + EXPECT_EQ(last_msg_->contents[193], 54) + << "incorrect value for contents[193], expected 54, is " + << last_msg_->contents[193]; + EXPECT_EQ(last_msg_->contents[194], 40) + << "incorrect value for contents[194], expected 40, is " + << last_msg_->contents[194]; + EXPECT_EQ(last_msg_->contents[195], 174) + << "incorrect value for contents[195], expected 174, is " + << last_msg_->contents[195]; + EXPECT_EQ(last_msg_->contents[196], 215) + << "incorrect value for contents[196], expected 215, is " + << last_msg_->contents[196]; + EXPECT_EQ(last_msg_->contents[197], 148) + << "incorrect value for contents[197], expected 148, is " + << last_msg_->contents[197]; + EXPECT_EQ(last_msg_->contents[198], 166) + << "incorrect value for contents[198], expected 166, is " + << last_msg_->contents[198]; + EXPECT_EQ(last_msg_->contents[199], 190) + << "incorrect value for contents[199], expected 190, is " + << last_msg_->contents[199]; + EXPECT_EQ(last_msg_->contents[200], 63) + << "incorrect value for contents[200], expected 63, is " + << last_msg_->contents[200]; + EXPECT_EQ(last_msg_->contents[201], 118) + << "incorrect value for contents[201], expected 118, is " + << last_msg_->contents[201]; + EXPECT_EQ(last_msg_->contents[202], 6) + << "incorrect value for contents[202], expected 6, is " + << last_msg_->contents[202]; + EXPECT_EQ(last_msg_->contents[203], 165) + << "incorrect value for contents[203], expected 165, is " + << last_msg_->contents[203]; + EXPECT_EQ(last_msg_->contents[204], 212) + << "incorrect value for contents[204], expected 212, is " + << last_msg_->contents[204]; + EXPECT_EQ(last_msg_->contents[205], 74) + << "incorrect value for contents[205], expected 74, is " + << last_msg_->contents[205]; + EXPECT_EQ(last_msg_->contents[206], 68) + << "incorrect value for contents[206], expected 68, is " + << last_msg_->contents[206]; + EXPECT_EQ(last_msg_->contents[207], 200) + << "incorrect value for contents[207], expected 200, is " + << last_msg_->contents[207]; + EXPECT_EQ(last_msg_->contents[208], 38) + << "incorrect value for contents[208], expected 38, is " + << last_msg_->contents[208]; + EXPECT_EQ(last_msg_->contents[209], 139) + << "incorrect value for contents[209], expected 139, is " + << last_msg_->contents[209]; + EXPECT_EQ(last_msg_->contents[210], 212) + << "incorrect value for contents[210], expected 212, is " + << last_msg_->contents[210]; + EXPECT_EQ(last_msg_->contents[211], 112) + << "incorrect value for contents[211], expected 112, is " + << last_msg_->contents[211]; + EXPECT_EQ(last_msg_->contents[212], 45) + << "incorrect value for contents[212], expected 45, is " + << last_msg_->contents[212]; + EXPECT_EQ(last_msg_->contents[213], 167) + << "incorrect value for contents[213], expected 167, is " + << last_msg_->contents[213]; + EXPECT_EQ(last_msg_->contents[214], 236) + << "incorrect value for contents[214], expected 236, is " + << last_msg_->contents[214]; + EXPECT_EQ(last_msg_->contents[215], 255) + << "incorrect value for contents[215], expected 255, is " + << last_msg_->contents[215]; + EXPECT_EQ(last_msg_->contents[216], 106) + << "incorrect value for contents[216], expected 106, is " + << last_msg_->contents[216]; + EXPECT_EQ(last_msg_->contents[217], 92) + << "incorrect value for contents[217], expected 92, is " + << last_msg_->contents[217]; + EXPECT_EQ(last_msg_->contents[218], 132) + << "incorrect value for contents[218], expected 132, is " + << last_msg_->contents[218]; + EXPECT_EQ(last_msg_->contents[219], 59) + << "incorrect value for contents[219], expected 59, is " + << last_msg_->contents[219]; + EXPECT_EQ(last_msg_->contents[220], 61) + << "incorrect value for contents[220], expected 61, is " + << last_msg_->contents[220]; + EXPECT_EQ(last_msg_->contents[221], 233) + << "incorrect value for contents[221], expected 233, is " + << last_msg_->contents[221]; + EXPECT_EQ(last_msg_->contents[222], 3) + << "incorrect value for contents[222], expected 3, is " + << last_msg_->contents[222]; + EXPECT_EQ(last_msg_->contents[223], 246) + << "incorrect value for contents[223], expected 246, is " + << last_msg_->contents[223]; + EXPECT_EQ(last_msg_->contents[224], 158) + << "incorrect value for contents[224], expected 158, is " + << last_msg_->contents[224]; + EXPECT_EQ(last_msg_->contents[225], 83) + << "incorrect value for contents[225], expected 83, is " + << last_msg_->contents[225]; + EXPECT_EQ(last_msg_->contents[226], 134) + << "incorrect value for contents[226], expected 134, is " + << last_msg_->contents[226]; + EXPECT_EQ(last_msg_->contents[227], 246) + << "incorrect value for contents[227], expected 246, is " + << last_msg_->contents[227]; + EXPECT_EQ(last_msg_->contents[228], 154) + << "incorrect value for contents[228], expected 154, is " + << last_msg_->contents[228]; + EXPECT_EQ(last_msg_->contents[229], 17) + << "incorrect value for contents[229], expected 17, is " + << last_msg_->contents[229]; + EXPECT_EQ(last_msg_->contents[230], 0) + << "incorrect value for contents[230], expected 0, is " + << last_msg_->contents[230]; + EXPECT_EQ(last_msg_->contents[231], 6) + << "incorrect value for contents[231], expected 6, is " + << last_msg_->contents[231]; + EXPECT_EQ(last_msg_->contents[232], 56) + << "incorrect value for contents[232], expected 56, is " + << last_msg_->contents[232]; + EXPECT_EQ(last_msg_->contents[233], 216) + << "incorrect value for contents[233], expected 216, is " + << last_msg_->contents[233]; + EXPECT_EQ(last_msg_->contents[234], 19) + << "incorrect value for contents[234], expected 19, is " + << last_msg_->contents[234]; + EXPECT_EQ(last_msg_->contents[235], 216) + << "incorrect value for contents[235], expected 216, is " + << last_msg_->contents[235]; + EXPECT_EQ(last_msg_->contents[236], 70) + << "incorrect value for contents[236], expected 70, is " + << last_msg_->contents[236]; + EXPECT_EQ(last_msg_->contents[237], 71) + << "incorrect value for contents[237], expected 71, is " + << last_msg_->contents[237]; + EXPECT_EQ(last_msg_->contents[238], 161) + << "incorrect value for contents[238], expected 161, is " + << last_msg_->contents[238]; + EXPECT_EQ(last_msg_->contents[239], 184) + << "incorrect value for contents[239], expected 184, is " + << last_msg_->contents[239]; + EXPECT_EQ(last_msg_->contents[240], 5) + << "incorrect value for contents[240], expected 5, is " + << last_msg_->contents[240]; + EXPECT_EQ(last_msg_->contents[241], 177) + << "incorrect value for contents[241], expected 177, is " + << last_msg_->contents[241]; + EXPECT_EQ(last_msg_->contents[242], 45) + << "incorrect value for contents[242], expected 45, is " + << last_msg_->contents[242]; + EXPECT_EQ(last_msg_->contents[243], 37) + << "incorrect value for contents[243], expected 37, is " + << last_msg_->contents[243]; + EXPECT_EQ(last_msg_->contents[244], 98) + << "incorrect value for contents[244], expected 98, is " + << last_msg_->contents[244]; + EXPECT_EQ(last_msg_->contents[245], 56) + << "incorrect value for contents[245], expected 56, is " + << last_msg_->contents[245]; + EXPECT_EQ(last_msg_->contents[246], 149) + << "incorrect value for contents[246], expected 149, is " + << last_msg_->contents[246]; + EXPECT_EQ(last_msg_->contents[247], 0) + << "incorrect value for contents[247], expected 0, is " + << last_msg_->contents[247]; + EXPECT_EQ(last_msg_->contents[248], 73) + << "incorrect value for contents[248], expected 73, is " + << last_msg_->contents[248]; + EXPECT_EQ(last_msg_->contents[249], 221) + << "incorrect value for contents[249], expected 221, is " + << last_msg_->contents[249]; + EXPECT_EQ(last_msg_->contents[250], 105) + << "incorrect value for contents[250], expected 105, is " + << last_msg_->contents[250]; + EXPECT_EQ(last_msg_->contents[251], 239) + << "incorrect value for contents[251], expected 239, is " + << last_msg_->contents[251]; + EXPECT_EQ(last_msg_->contents[252], 168) + << "incorrect value for contents[252], expected 168, is " + << last_msg_->contents[252]; + EXPECT_EQ(last_msg_->contents[253], 205) + << "incorrect value for contents[253], expected 205, is " + << last_msg_->contents[253]; + EXPECT_EQ(last_msg_->contents[254], 85) + << "incorrect value for contents[254], expected 85, is " + << last_msg_->contents[254]; } diff --git a/c/test/legacy/cpp/auto_check_sbp_vehicle_MsgOdometry.cc b/c/test/legacy/cpp/auto_check_sbp_vehicle_MsgOdometry.cc index 709c3ea09..ad27bc2ce 100644 --- a/c/test/legacy/cpp/auto_check_sbp_vehicle_MsgOdometry.cc +++ b/c/test/legacy/cpp/auto_check_sbp_vehicle_MsgOdometry.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgOdometry.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgOdometry.yaml by generate.py. Do +// not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_vehicle_MsgOdometry0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_vehicle_MsgOdometry0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_vehicle_MsgOdometry0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_vehicle_MsgOdometry0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_odometry_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_odometry_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,39 +81,42 @@ class Test_legacy_auto_check_sbp_vehicle_MsgOdometry0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_odometry_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_vehicle_MsgOdometry0, Test) -{ +}; - uint8_t encoded_frame[] = {85,3,9,66,0,9,8,0,0,0,7,0,0,0,1,52,99, }; +TEST_F(Test_legacy_auto_check_sbp_vehicle_MsgOdometry0, Test) { + uint8_t encoded_frame[] = { + 85, 3, 9, 66, 0, 9, 8, 0, 0, 0, 7, 0, 0, 0, 1, 52, 99, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_odometry_t* test_msg = ( msg_odometry_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 1; - test_msg->tow = 8; - test_msg->velocity = 7; - - EXPECT_EQ(send_message( 0x903, 66, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_odometry_t *test_msg = (msg_odometry_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 1; + test_msg->tow = 8; + test_msg->velocity = 7; + + EXPECT_EQ(send_message(0x903, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 66); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->tow, 8) << "incorrect value for tow, expected 8, is " << last_msg_->tow; - EXPECT_EQ(last_msg_->velocity, 7) << "incorrect value for velocity, expected 7, is " << last_msg_->velocity; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->tow, 8) + << "incorrect value for tow, expected 8, is " << last_msg_->tow; + EXPECT_EQ(last_msg_->velocity, 7) + << "incorrect value for velocity, expected 7, is " << last_msg_->velocity; } diff --git a/c/test/legacy/cpp/auto_check_sbp_vehicle_MsgWheeltick.cc b/c/test/legacy/cpp/auto_check_sbp_vehicle_MsgWheeltick.cc index e53f9fbac..de649f4df 100644 --- a/c/test/legacy/cpp/auto_check_sbp_vehicle_MsgWheeltick.cc +++ b/c/test/legacy/cpp/auto_check_sbp_vehicle_MsgWheeltick.cc @@ -10,7 +10,9 @@ * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. */ -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgWheeltick.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/vehicle/test_MsgWheeltick.yaml by generate.py. +// Do not modify by hand! // This exists solely to surpress the deprecated messages which will be // generated at compile time whenever a legacy header file is included. We @@ -25,57 +27,51 @@ #include #include +#include #include #include -#include -class Test_legacy_auto_check_sbp_vehicle_MsgWheeltick0 : - public ::testing::Test, - public sbp::LegacyState, - public sbp::IReader, - public sbp::IWriter, - sbp::PayloadHandler -{ -public: - Test_legacy_auto_check_sbp_vehicle_MsgWheeltick0() : - ::testing::Test(), - sbp::LegacyState(), - sbp::IReader(), - sbp::IWriter(), - sbp::PayloadHandler(this), +class Test_legacy_auto_check_sbp_vehicle_MsgWheeltick0 + : public ::testing::Test, + public sbp::LegacyState, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_vehicle_MsgWheeltick0() + : ::testing::Test(), + sbp::LegacyState(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), last_msg_storage_(), - last_msg_(reinterpret_cast(last_msg_storage_)), + last_msg_(reinterpret_cast(last_msg_storage_)), last_msg_len_(), - last_sender_id_(), - n_callbacks_logged_(), - dummy_wr_(), - dummy_rd_(), - dummy_buff_() - { + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { set_reader(this); set_writer(this); } - s32 read(uint8_t *buf, const uint32_t n) override - { + s32 read(uint8_t *buf, const uint32_t n) override { uint32_t real_n = n; memcpy(buf, dummy_buff_ + dummy_rd_, real_n); dummy_rd_ += real_n; return (s32)real_n; } - s32 write(const uint8_t *buf, uint32_t n) override - { + s32 write(const uint8_t *buf, uint32_t n) override { uint32_t real_n = n; memcpy(dummy_buff_ + dummy_wr_, buf, real_n); dummy_wr_ += real_n; return (s32)real_n; } - -protected: - - void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_wheeltick_t &msg) override - { + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_wheeltick_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -85,41 +81,48 @@ class Test_legacy_auto_check_sbp_vehicle_MsgWheeltick0 : uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; msg_wheeltick_t *last_msg_; uint8_t last_msg_len_; - uint16_t last_sender_id_; - size_t n_callbacks_logged_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; uint32_t dummy_wr_; uint32_t dummy_rd_; uint8_t dummy_buff_[1024]; -}; - -TEST_F(Test_legacy_auto_check_sbp_vehicle_MsgWheeltick0, Test) -{ +}; - uint8_t encoded_frame[] = {85,4,9,107,69,14,254,27,114,44,26,0,0,0,1,146,225,51,9,210,36,56, }; +TEST_F(Test_legacy_auto_check_sbp_vehicle_MsgWheeltick0, Test) { + uint8_t encoded_frame[] = { + 85, 4, 9, 107, 69, 14, 254, 27, 114, 44, 26, + 0, 0, 0, 1, 146, 225, 51, 9, 210, 36, 56, + }; - uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; - uint8_t test_msg_len = 0; - msg_wheeltick_t* test_msg = ( msg_wheeltick_t* )test_msg_storage; - test_msg_len = (uint8_t)sizeof(*test_msg); - test_msg->flags = 1; - test_msg->source = 146; - test_msg->ticks = -771148831; - test_msg->time = 112414825470; - - EXPECT_EQ(send_message( 0x904, 17771, test_msg_len, test_msg_storage), SBP_OK); - - EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); - EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); - - while (dummy_rd_ < dummy_wr_) { - process(); - } + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_wheeltick_t *test_msg = (msg_wheeltick_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + test_msg->flags = 1; + test_msg->source = 146; + test_msg->ticks = -771148831; + test_msg->time = 112414825470; + + EXPECT_EQ(send_message(0x904, 17771, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } - EXPECT_EQ(n_callbacks_logged_, 1); - EXPECT_EQ(last_sender_id_, 17771); - EXPECT_EQ(last_msg_len_, test_msg_len); - EXPECT_EQ(last_msg_->flags, 1) << "incorrect value for flags, expected 1, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->source, 146) << "incorrect value for source, expected 146, is " << last_msg_->source; - EXPECT_EQ(last_msg_->ticks, -771148831) << "incorrect value for ticks, expected -771148831, is " << last_msg_->ticks; - EXPECT_EQ(last_msg_->time, 112414825470) << "incorrect value for time, expected 112414825470, is " << last_msg_->time; + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 17771); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->flags, 1) + << "incorrect value for flags, expected 1, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->source, 146) + << "incorrect value for source, expected 146, is " << last_msg_->source; + EXPECT_EQ(last_msg_->ticks, -771148831) + << "incorrect value for ticks, expected -771148831, is " + << last_msg_->ticks; + EXPECT_EQ(last_msg_->time, 112414825470) + << "incorrect value for time, expected 112414825470, is " + << last_msg_->time; }